From 369e3e193f72afd176bbe7fffbb61c264b4937c6 Mon Sep 17 00:00:00 2001 From: ff6347 Date: Fri, 5 Jan 2024 10:06:07 +0100 Subject: [PATCH 01/26] chore(astro): Upgrade astro to v4 --- package-lock.json | 5937 +++++++++++++--------------- package.json | 88 +- public/lib/p5.js | 8709 +++++++++++++++++++++++++++++------------- public/lib/p5.min.js | 4 +- 4 files changed, 8578 insertions(+), 6160 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd8a6a2..2751fbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@types/p5": "1.7.6", "@types/react": "18.2.45", "@types/react-dom": "18.2.18", - "astro": "3.6.4", + "astro": "4.1.0", "lodash.debounce": "4.0.8", "p5": "1.9.0", "prettier": "3.1.1", @@ -67,9 +67,9 @@ } }, "node_modules/@astrojs/compiler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.3.0.tgz", - "integrity": "sha512-pxYRAaRdMS6XUll8lbFM+Lr0DI1HKIDT+VpiC+S+9di5H/nmm3znZOgdMlLiMxADot+56eps+M1BvtKfQremXA==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.4.0.tgz", + "integrity": "sha512-LUN/iG8KcStfChHwTvCg/t91IQFQxguF3CkDLW3tdY2vBKZmOJy9MgtRl20ZGgPtgrykGCtnr4AellEm0bPuFg==" }, "node_modules/@astrojs/internal-helpers": { "version": "0.2.1", @@ -117,27 +117,24 @@ } }, "node_modules/@astrojs/markdown-remark": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-3.5.0.tgz", - "integrity": "sha512-q7vdIqzYhxpsfghg2YmkmSXCfp4w7lBTYP+SSHw89wVhC5Riltr3u8w2otBRxNLSByNi+ht/gGkFC23Shetytw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-4.0.1.tgz", + "integrity": "sha512-RU4ESnqvyLpj8WZs0n5elS6idaDdtIIm7mIpMaRNPCebpxMjfcfdwcmBwz83ktAj5d2eO5bC3z92TcGdli+lRw==", "dependencies": { "@astrojs/prism": "^3.0.0", "github-slugger": "^2.0.0", - "import-meta-resolve": "^3.0.0", + "import-meta-resolve": "^4.0.0", "mdast-util-definitions": "^6.0.0", - "rehype-raw": "^6.1.1", - "rehype-stringify": "^9.0.4", - "remark-gfm": "^3.0.1", - "remark-parse": "^10.0.2", - "remark-rehype": "^10.1.0", + "rehype-raw": "^7.0.0", + "rehype-stringify": "^10.0.0", + "remark-gfm": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", "remark-smartypants": "^2.0.0", - "shikiji": "^0.6.8", - "unified": "^10.1.2", - "unist-util-visit": "^4.1.2", - "vfile": "^5.3.7" - }, - "peerDependencies": { - "astro": "^3.0.0" + "shikiji": "^0.6.13", + "unified": "^11.0.4", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1" } }, "node_modules/@astrojs/prism": { @@ -592,10 +589,34 @@ "resolved": "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz", "integrity": "sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==" }, + "node_modules/@emnapi/runtime": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.44.0.tgz", + "integrity": "sha512-ZX/etZEZw8DR7zAB1eVQT40lNo0jeqpb6dCgOvctB6FIQ5PoXfMuNY8+ayQfu8tNQbAB8gQWSSJupR8NxeiZXw==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", + "integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz", - "integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.11.tgz", + "integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==", "cpu": [ "arm" ], @@ -608,9 +629,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz", - "integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz", + "integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==", "cpu": [ "arm64" ], @@ -623,9 +644,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz", - "integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.11.tgz", + "integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==", "cpu": [ "x64" ], @@ -638,9 +659,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz", - "integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz", + "integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==", "cpu": [ "arm64" ], @@ -653,9 +674,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz", - "integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz", + "integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==", "cpu": [ "x64" ], @@ -668,9 +689,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz", - "integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz", + "integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==", "cpu": [ "arm64" ], @@ -683,9 +704,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz", - "integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz", + "integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==", "cpu": [ "x64" ], @@ -698,9 +719,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz", - "integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz", + "integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==", "cpu": [ "arm" ], @@ -713,9 +734,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz", - "integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz", + "integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==", "cpu": [ "arm64" ], @@ -728,9 +749,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz", - "integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz", + "integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==", "cpu": [ "ia32" ], @@ -743,9 +764,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz", - "integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz", + "integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==", "cpu": [ "loong64" ], @@ -758,9 +779,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz", - "integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz", + "integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==", "cpu": [ "mips64el" ], @@ -773,9 +794,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz", - "integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz", + "integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==", "cpu": [ "ppc64" ], @@ -788,9 +809,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz", - "integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz", + "integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==", "cpu": [ "riscv64" ], @@ -803,9 +824,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz", - "integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz", + "integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==", "cpu": [ "s390x" ], @@ -818,9 +839,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz", - "integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz", + "integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==", "cpu": [ "x64" ], @@ -833,9 +854,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz", - "integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz", + "integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==", "cpu": [ "x64" ], @@ -848,9 +869,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz", - "integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz", + "integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==", "cpu": [ "x64" ], @@ -863,9 +884,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz", - "integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz", + "integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==", "cpu": [ "x64" ], @@ -878,9 +899,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz", - "integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz", + "integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==", "cpu": [ "arm64" ], @@ -893,9 +914,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz", - "integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz", + "integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==", "cpu": [ "ia32" ], @@ -908,9 +929,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz", - "integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz", + "integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==", "cpu": [ "x64" ], @@ -922,149 +943,580 @@ "node": ">=12" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.1.tgz", + "integrity": "sha512-esr2BZ1x0bo+wl7Gx2hjssYhjrhUsD88VQulI0FrG8/otRQUOxLWHMBd1Y1qo2Gfg2KUvXNpT0ASnV9BzJCexw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" }, - "engines": { - "node": ">=6.0.0" + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.1.tgz", + "integrity": "sha512-YrnuB3bXuWdG+hJlXtq7C73lF8ampkhU3tMxg5Hh+E7ikxbUVOU9nlNtVTloDXz6pRHt2y2oKJq7DY/yt+UXYw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.0.tgz", + "integrity": "sha512-VzYd6OwnUR81sInf3alj1wiokY50DjsHz5bvfnsFpxs5tqQxESoHtJO6xyksDs3RIkyhMWq2FufXo6GNSU9BMw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.0.tgz", + "integrity": "sha512-dD9OznTlHD6aovRswaPNEy8dKtSAmNo4++tO7uuR4o5VxbVAOoEQ1uSmN4iFAdQneTHws1lkTZeiXPrcCkh6IA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@monaco-editor/loader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.4.0.tgz", - "integrity": "sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==", - "dependencies": { - "state-local": "^1.0.6" + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.0.tgz", + "integrity": "sha512-VwgD2eEikDJUk09Mn9Dzi1OW2OJFRQK+XlBTkUNmAWPrtj8Ly0yq05DFgu1VCMx2/DqCGQVi5A1dM9hTmxf3uw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" }, - "peerDependencies": { - "monaco-editor": ">= 0.21.0 < 1" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@monaco-editor/react": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.6.0.tgz", - "integrity": "sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==", - "dependencies": { - "@monaco-editor/loader": "^1.4.0" + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.0.tgz", + "integrity": "sha512-xTYThiqEZEZc0PRU90yVtM3KE7lw1bKdnDQ9kCTHWbqWyHOe4NpPOtMGy27YnN51q0J5dqRrvicfPbALIOeAZA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" }, - "peerDependencies": { - "monaco-editor": ">= 0.25.0 < 1", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.0.tgz", + "integrity": "sha512-o9E46WWBC6JsBlwU4QyU9578G77HBDT1NInd+aERfxeOPbk0qBZHgoDsQmA2v9TbqJRWzoBPx1aLOhprBMgPjw==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 8" + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.0.tgz", + "integrity": "sha512-naldaJy4hSVhWBgEjfdBY85CAa4UO+W1nx6a1sWStHZ7EUfNiuBTTN2KUYT5dH1+p/xij1t2QSXfCiFJoC5S/Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 8" + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.0.tgz", + "integrity": "sha512-OdorplCyvmSAPsoJLldtLh3nLxRrkAAAOHsGWGDYfN0kh730gifK+UZb3dWORRa6EusNqCTjfXV4GxvgJ/nPDQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 8" + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@octokit/auth-token": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", - "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", - "dev": true, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.0.tgz", + "integrity": "sha512-FW8iK6rJrg+X2jKD0Ajhjv6y74lToIBEvkZhl42nZt563FfxkCYacrXZtd+q/sRQDypQLzY5WdLkVTbJoPyqNg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 18" + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@octokit/core": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.0.1.tgz", - "integrity": "sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw==", - "dev": true, - "dependencies": { - "@octokit/auth-token": "^4.0.0", - "@octokit/graphql": "^7.0.0", - "@octokit/request": "^8.0.2", - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.1.tgz", + "integrity": "sha512-Ii4X1vnzzI4j0+cucsrYA5ctrzU9ciXERfJR633S2r39CiD8npqH2GMj63uFZRCFt3E687IenAdbwIpQOJ5BNA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 18" + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.0" } }, - "node_modules/@octokit/endpoint": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.2.tgz", - "integrity": "sha512-qhKW8YLIi+Kmc92FQUFGr++DYtkx/1fBv+Thua6baqnjnOsgBYJDCvWZR1YcINuHGOEQt416WOfE+A/oG60NBQ==", - "dev": true, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.1.tgz", + "integrity": "sha512-59B5GRO2d5N3tIfeGHAbJps7cLpuWEQv/8ySd9109ohQ3kzyCACENkFVAnGPX00HwPTQcaBNF7HQYEfZyZUFfw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.0" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.1.tgz", + "integrity": "sha512-tRGrb2pHnFUXpOAj84orYNxHADBDIr0J7rrjwQrTNMQMWA4zy3StKmMvwsI7u3dEZcgwuMMooIIGWEWOjnmG8A==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.0" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.1.tgz", + "integrity": "sha512-4y8osC0cAc1TRpy02yn5omBeloZZwS62fPZ0WUAYQiLhSFSpWJfY/gMrzKzLcHB9ulUV6ExFiu2elMaixKDbeg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.0" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.1.tgz", + "integrity": "sha512-D3lV6clkqIKUizNS8K6pkuCKNGmWoKlBGh5p0sLO2jQERzbakhu4bVX1Gz+RS4vTZBprKlWaf+/Rdp3ni2jLfA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.0" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.1.tgz", + "integrity": "sha512-LOGKNu5w8uu1evVqUAUKTix2sQu1XDRIYbsi5Q0c/SrXhvJ4QyOx+GaajxmOg5PZSsSnCYPSmhjHHsRBx06/wQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.0" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.1.tgz", + "integrity": "sha512-vWI/sA+0p+92DLkpAMb5T6I8dg4z2vzCUnp8yvxHlwBpzN8CIcO3xlSXrLltSvK6iMsVMNswAv+ub77rsf25lA==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.44.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.1.tgz", + "integrity": "sha512-/xhYkylsKL05R+NXGJc9xr2Tuw6WIVl2lubFJaFYfW4/MQ4J+dgjIo/T4qjNRizrqs/szF/lC9a5+updmY9jaQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.1.tgz", + "integrity": "sha512-XaM69X0n6kTEsp9tVYYLhXdg7Qj32vYJlAKRutxUsm1UlgQNx6BOhHwZPwukCGXBU2+tH87ip2eV1I/E8MQnZg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@monaco-editor/loader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.4.0.tgz", + "integrity": "sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==", + "dependencies": { + "state-local": "^1.0.6" + }, + "peerDependencies": { + "monaco-editor": ">= 0.21.0 < 1" + } + }, + "node_modules/@monaco-editor/react": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.6.0.tgz", + "integrity": "sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==", + "dependencies": { + "@monaco-editor/loader": "^1.4.0" + }, + "peerDependencies": { + "monaco-editor": ">= 0.25.0 < 1", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.0.1.tgz", + "integrity": "sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw==", + "dev": true, + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.0.0", + "@octokit/request": "^8.0.2", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.2.tgz", + "integrity": "sha512-qhKW8YLIi+Kmc92FQUFGr++DYtkx/1fBv+Thua6baqnjnOsgBYJDCvWZR1YcINuHGOEQt416WOfE+A/oG60NBQ==", + "dev": true, "dependencies": { "@octokit/types": "^12.0.0", "is-plain-object": "^5.0.0", @@ -1268,169 +1720,156 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.6.1.tgz", - "integrity": "sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.3.tgz", + "integrity": "sha512-nvh9bB41vXEoKKvlWCGptpGt8EhrEwPQFDCY0VAto+R+qpSbaErPS3OjMZuXR8i/2UVw952Dtlnl2JFxH31Qvg==", "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.6.1.tgz", - "integrity": "sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.3.tgz", + "integrity": "sha512-kffYCJ2RhDL1DlshLzYPyJtVeusHlA8Q1j6k6s4AEVKLq/3HfGa2ADDycLsmPo3OW83r4XtOPqRMbcFzFsEIzQ==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.6.1.tgz", - "integrity": "sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.3.tgz", + "integrity": "sha512-Fo7DR6Q9/+ztTyMBZ79+WJtb8RWZonyCgkBCjV51rW5K/dizBzImTW6HLC0pzmHaAevwM0jW1GtB5LCFE81mSw==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.6.1.tgz", - "integrity": "sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.3.tgz", + "integrity": "sha512-5HcxDF9fqHucIlTiw/gmMb3Qv23L8bLCg904I74Q2lpl4j/20z9ogaD3tWkeguRuz+/17cuS321PT3PAuyjQdg==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.6.1.tgz", - "integrity": "sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.3.tgz", + "integrity": "sha512-cO6hKV+99D1V7uNJQn1chWaF9EGp7qV2N8sGH99q9Y62bsbN6Il55EwJppEWT+JiqDRg396vWCgwdHwje8itBQ==", "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.6.1.tgz", - "integrity": "sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.3.tgz", + "integrity": "sha512-xANyq6lVg6KMO8UUs0LjA4q7di3tPpDbzLPgVEU2/F1ngIZ54eli8Zdt3uUUTMXVbgTCafIO+JPeGMhu097i3w==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.6.1.tgz", - "integrity": "sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.3.tgz", + "integrity": "sha512-TZJUfRTugVFATQToCMD8DNV6jv/KpSwhE1lLq5kXiQbBX3Pqw6dRKtzNkh5wcp0n09reBBq/7CGDERRw9KmE+g==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz", - "integrity": "sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.3.tgz", + "integrity": "sha512-4/QVaRyaB5tkEAGfjVvWrmWdPF6F2NoaoO5uEP7N0AyeBw7l8SeCWWKAGrbx/00PUdHrJVURJiYikazslSKttQ==", "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.6.1.tgz", - "integrity": "sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.3.tgz", + "integrity": "sha512-koLC6D3pj1YLZSkTy/jsk3HOadp7q2h6VQl/lPX854twOmmLNekHB6yuS+MkWcKdGGdW1JPuPBv/ZYhr5Yhtdg==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.6.1.tgz", - "integrity": "sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.3.tgz", + "integrity": "sha512-0OAkQ4HBp+JO2ip2Lgt/ShlrveOMzyhwt2D0KvqH28jFPqfZco28KSq76zymZwmU+F6GRojdxtQMJiNSXKNzeA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.6.1.tgz", - "integrity": "sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.3.tgz", + "integrity": "sha512-z5uvoMvdRWggigOnsb9OOCLERHV0ykRZoRB5O+URPZC9zM3pkoMg5fN4NKu2oHqgkzZtfx9u4njqqlYEzM1v9A==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.6.1.tgz", - "integrity": "sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.3.tgz", + "integrity": "sha512-wxomCHjBVKws+O4N1WLnniKCXu7vkLtdq9Fl9CN/EbwEldojvUrkoHE/fBLZzC7IT/x12Ut6d6cRs4dFvqJkMg==", "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.6.1.tgz", - "integrity": "sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.3.tgz", + "integrity": "sha512-1Qf/qk/iEtx0aOi+AQQt5PBoW0mFngsm7bPuxHClC/hWh2hHBktR6ktSfUg5b5rC9v8hTwNmHE7lBWXkgqluUQ==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -2061,31 +2500,26 @@ } }, "node_modules/@types/debug": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.10.tgz", - "integrity": "sha512-tOSCru6s732pofZ+sMv9o4o3Zc+Sa8l3bxd/tweTQudFn06vAzb13ZX46Zi6m6EJ+RUbRTHvgQJ1gBtSgkaUYA==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/estree": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz", - "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@types/hast": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.7.tgz", - "integrity": "sha512-EVLigw5zInURhzfXUM65eixfadfsHKomGKUakToXo84t8gGIJuTcD2xooM2See7GyQ7DRtYjhCHnSUQez8JaLw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.3.tgz", + "integrity": "sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==", "dependencies": { - "@types/unist": "^2" + "@types/unist": "*" } }, - "node_modules/@types/hast/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/@types/lodash": { "version": "4.14.201", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.201.tgz", @@ -2102,30 +2536,30 @@ } }, "node_modules/@types/mdast": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.2.tgz", - "integrity": "sha512-tYR83EignvhYO9iU3kDg8V28M0jqyh9zzp5GV+EO+AYnyUl3P5ltkTeJuTiFZQFz670FSb3EwT/6LQdX+UdKfw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/ms": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.33.tgz", - "integrity": "sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==" + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/nlcst": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.3.tgz", - "integrity": "sha512-cpO6PPMz4E++zxP2Vhp/3KVl2Nbtj+Iksb25rlRinG7mphu2zmCIKWWlqdsx1NwJEISogR2eeZTD7JqLOCzaiw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.4.tgz", + "integrity": "sha512-ABoYdNQ/kBSsLvZAekMhIPMQ3YUZvavStpKYs7BjLLuKVmIMA0LUgZ7b54zzuWJRbHF80v1cNf4r90Vd6eMQDg==", "dependencies": { "@types/unist": "^2" } }, "node_modules/@types/nlcst/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { "version": "20.10.6", @@ -2147,11 +2581,6 @@ "resolved": "https://registry.npmjs.org/@types/p5/-/p5-1.7.6.tgz", "integrity": "sha512-6pLTOo0V3N5jZb5nTwjiv3lPHLK3Z/TjbhQUj8CTWXocUk1Z/f6OHTp3Pcwi1BhWnf5gqKUcyEb1gP0KIJuQgw==" }, - "node_modules/@types/parse5": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", - "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==" - }, "node_modules/@types/prop-types": { "version": "15.7.9", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.9.tgz", @@ -2181,9 +2610,9 @@ "integrity": "sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==" }, "node_modules/@types/unist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.1.tgz", - "integrity": "sha512-ue/hDUpPjC85m+PM9OQDMZr3LywT+CT6mPsQq8OJtCLiERkGRcQUFvu9XASF5XWqyZFXbf15lvb3JFJ4dRLWPg==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", @@ -2600,37 +3029,42 @@ } }, "node_modules/astro": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/astro/-/astro-3.6.4.tgz", - "integrity": "sha512-YatUyWEQ9GUC79Wc2zbovy6D6bXPW9++Z6PYs4GDamEDspUSnnzL/INB7WJqgFI0xAFk9jcUr+MZYjkdWqXYTw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.1.0.tgz", + "integrity": "sha512-xbLWqvMn2JFyv7FpzHiXFn17bRS0P/b4cdEPXMMZOpBI9V8ZC33o6Xs+c59/pYSZpYiNd1HTg778XT5MhcpyKw==", "dependencies": { - "@astrojs/compiler": "^2.3.0", + "@astrojs/compiler": "^2.3.4", "@astrojs/internal-helpers": "0.2.1", - "@astrojs/markdown-remark": "3.5.0", + "@astrojs/markdown-remark": "4.0.1", "@astrojs/telemetry": "3.0.4", - "@babel/core": "^7.22.10", - "@babel/generator": "^7.22.10", - "@babel/parser": "^7.22.10", + "@babel/core": "^7.23.3", + "@babel/generator": "^7.23.3", + "@babel/parser": "^7.23.3", "@babel/plugin-transform-react-jsx": "^7.22.5", - "@babel/traverse": "^7.22.10", - "@babel/types": "^7.22.10", - "@types/babel__core": "^7.20.1", - "acorn": "^8.10.0", + "@babel/traverse": "^7.23.3", + "@babel/types": "^7.23.3", + "@types/babel__core": "^7.20.4", + "acorn": "^8.11.2", + "aria-query": "^5.3.0", + "axobject-query": "^4.0.0", "boxen": "^7.1.1", "chokidar": "^3.5.3", - "ci-info": "^3.8.0", + "ci-info": "^4.0.0", "clsx": "^2.0.0", "common-ancestor-path": "^1.0.1", - "cookie": "^0.5.0", + "cookie": "^0.6.0", "debug": "^4.3.4", - "deterministic-object-hash": "^1.3.1", + "deterministic-object-hash": "^2.0.1", "devalue": "^4.3.2", "diff": "^5.1.0", - "es-module-lexer": "^1.3.0", - "esbuild": "^0.19.2", + "dlv": "^1.1.3", + "dset": "^3.1.3", + "es-module-lexer": "^1.4.1", + "esbuild": "^0.19.6", "estree-walker": "^3.0.3", "execa": "^8.0.1", - "fast-glob": "^3.3.1", + "fast-glob": "^3.3.2", + "flattie": "^1.1.0", "github-slugger": "^2.0.0", "gray-matter": "^4.0.3", "html-escaper": "^3.0.3", @@ -2638,27 +3072,27 @@ "js-yaml": "^4.1.0", "kleur": "^4.1.4", "magic-string": "^0.30.3", - "mdast-util-to-hast": "12.3.0", + "mdast-util-to-hast": "13.0.2", "mime": "^3.0.0", "ora": "^7.0.1", - "p-limit": "^4.0.0", - "p-queue": "^7.4.1", + "p-limit": "^5.0.0", + "p-queue": "^8.0.1", "path-to-regexp": "^6.2.1", "preferred-pm": "^3.1.2", "probe-image-size": "^7.2.3", "prompts": "^2.4.2", - "rehype": "^12.0.1", + "rehype": "^13.0.1", "resolve": "^1.22.4", "semver": "^7.5.4", "server-destroy": "^1.0.1", - "shikiji": "^0.6.8", - "string-width": "^6.1.0", + "shikiji": "^0.6.13", + "string-width": "^7.0.0", "strip-ansi": "^7.1.0", "tsconfck": "^3.0.0", - "unist-util-visit": "^4.1.2", - "vfile": "^5.3.7", - "vite": "^4.4.9", - "vitefu": "^0.2.4", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1", + "vite": "^5.0.10", + "vitefu": "^0.2.5", "which-pm": "^2.1.1", "yargs-parser": "^21.1.1", "zod": "^3.22.4" @@ -2671,7 +3105,59 @@ "npm": ">=6.14.0" }, "optionalDependencies": { - "sharp": "^0.32.5" + "sharp": "^0.33.1" + } + }, + "node_modules/astro/node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/astro/node_modules/ci-info": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/astro/node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/string-width": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.0.0.tgz", + "integrity": "sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/asynckit": { @@ -2692,11 +3178,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/b4a": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", - "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", - "optional": true + "node_modules/axobject-query": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", + "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", + "dependencies": { + "dequal": "^2.0.3" + } }, "node_modules/bail": { "version": "2.0.2", @@ -2713,6 +3201,11 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/base-64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -3082,12 +3575,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "optional": true - }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -3483,9 +3970,9 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "engines": { "node": ">= 0.6" } @@ -3660,21 +4147,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "optional": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-eql": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", @@ -3729,7 +4201,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=4.0.0" } @@ -3798,9 +4270,15 @@ } }, "node_modules/deterministic-object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-1.3.1.tgz", - "integrity": "sha512-kQDIieBUreEgY+akq0N7o4FzZCr27dPG1xr3wq267vPwDlSXQ3UMcBXHqTGUBaM/5WDS1jwTYjxRhUzHeuiAvw==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", + "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", + "dependencies": { + "base-64": "^1.0.0" + }, + "engines": { + "node": ">=18" + } }, "node_modules/devalue": { "version": "4.3.2", @@ -3953,15 +4431,6 @@ "dev": true, "peer": true }, - "node_modules/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==", - "optional": true, - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -4029,14 +4498,14 @@ "dev": true }, "node_modules/es-module-lexer": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", - "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" }, "node_modules/esbuild": { - "version": "0.19.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz", - "integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==", + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz", + "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -4045,28 +4514,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.19.5", - "@esbuild/android-arm64": "0.19.5", - "@esbuild/android-x64": "0.19.5", - "@esbuild/darwin-arm64": "0.19.5", - "@esbuild/darwin-x64": "0.19.5", - "@esbuild/freebsd-arm64": "0.19.5", - "@esbuild/freebsd-x64": "0.19.5", - "@esbuild/linux-arm": "0.19.5", - "@esbuild/linux-arm64": "0.19.5", - "@esbuild/linux-ia32": "0.19.5", - "@esbuild/linux-loong64": "0.19.5", - "@esbuild/linux-mips64el": "0.19.5", - "@esbuild/linux-ppc64": "0.19.5", - "@esbuild/linux-riscv64": "0.19.5", - "@esbuild/linux-s390x": "0.19.5", - "@esbuild/linux-x64": "0.19.5", - "@esbuild/netbsd-x64": "0.19.5", - "@esbuild/openbsd-x64": "0.19.5", - "@esbuild/sunos-x64": "0.19.5", - "@esbuild/win32-arm64": "0.19.5", - "@esbuild/win32-ia32": "0.19.5", - "@esbuild/win32-x64": "0.19.5" + "@esbuild/aix-ppc64": "0.19.11", + "@esbuild/android-arm": "0.19.11", + "@esbuild/android-arm64": "0.19.11", + "@esbuild/android-x64": "0.19.11", + "@esbuild/darwin-arm64": "0.19.11", + "@esbuild/darwin-x64": "0.19.11", + "@esbuild/freebsd-arm64": "0.19.11", + "@esbuild/freebsd-x64": "0.19.11", + "@esbuild/linux-arm": "0.19.11", + "@esbuild/linux-arm64": "0.19.11", + "@esbuild/linux-ia32": "0.19.11", + "@esbuild/linux-loong64": "0.19.11", + "@esbuild/linux-mips64el": "0.19.11", + "@esbuild/linux-ppc64": "0.19.11", + "@esbuild/linux-riscv64": "0.19.11", + "@esbuild/linux-s390x": "0.19.11", + "@esbuild/linux-x64": "0.19.11", + "@esbuild/netbsd-x64": "0.19.11", + "@esbuild/openbsd-x64": "0.19.11", + "@esbuild/sunos-x64": "0.19.11", + "@esbuild/win32-arm64": "0.19.11", + "@esbuild/win32-ia32": "0.19.11", + "@esbuild/win32-x64": "0.19.11" } }, "node_modules/escalade": { @@ -4132,15 +4602,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -4157,16 +4618,10 @@ "node": ">=0.10.0" } }, - "node_modules/fast-fifo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", - "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", - "optional": true - }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -4279,6 +4734,14 @@ "pkg-dir": "^4.2.0" } }, + "node_modules/flattie": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.0.tgz", + "integrity": "sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==", + "engines": { + "node": ">=8" + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -4342,12 +4805,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "optional": true - }, "node_modules/fs-extra": { "version": "11.1.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", @@ -4414,6 +4871,17 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -4474,12 +4942,6 @@ "through2": "~2.0.0" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", - "optional": true - }, "node_modules/github-slugger": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", @@ -4694,17 +5156,35 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-from-html": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz", + "integrity": "sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-from-parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz", - "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", "dependencies": { - "@types/hast": "^2.0.0", - "@types/unist": "^2.0.0", - "hastscript": "^7.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^8.0.0", "property-information": "^6.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", "web-namespaces": "^2.0.0" }, "funding": { @@ -4712,17 +5192,12 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-from-parse5/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/hast-util-parse-selector": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", - "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", "dependencies": { - "@types/hast": "^2.0.0" + "@types/hast": "^3.0.0" }, "funding": { "type": "opencollective", @@ -4730,19 +5205,21 @@ } }, "node_modules/hast-util-raw": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz", - "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/parse5": "^6.0.0", - "hast-util-from-parse5": "^7.0.0", - "hast-util-to-parse5": "^7.0.0", - "html-void-elements": "^2.0.0", - "parse5": "^6.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile": "^5.0.0", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.1.tgz", + "integrity": "sha512-5m1gmba658Q+lO5uqL5YNGQWeh1MYWZbZmWrM5lncdcuiXuo5E2HT/CIOp0rLF8ksfSwiCVJ3twlgVRyTGThGA==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", "web-namespaces": "^2.0.0", "zwitch": "^2.0.0" }, @@ -4752,17 +5229,18 @@ } }, "node_modules/hast-util-to-html": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz", - "integrity": "sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", + "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", "dependencies": { - "@types/hast": "^2.0.0", - "@types/unist": "^2.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", "ccount": "^2.0.0", "comma-separated-tokens": "^2.0.0", - "hast-util-raw": "^7.0.0", - "hast-util-whitespace": "^2.0.0", - "html-void-elements": "^2.0.0", + "hast-util-raw": "^9.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", "property-information": "^6.0.0", "space-separated-tokens": "^2.0.0", "stringify-entities": "^4.0.0", @@ -4773,18 +5251,14 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-to-html/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/hast-util-to-parse5": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz", - "integrity": "sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", + "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", "dependencies": { - "@types/hast": "^2.0.0", + "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", "property-information": "^6.0.0", "space-separated-tokens": "^2.0.0", "web-namespaces": "^2.0.0", @@ -4796,22 +5270,25 @@ } }, "node_modules/hast-util-whitespace": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", - "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dependencies": { + "@types/hast": "^3.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/hastscript": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz", - "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", "dependencies": { - "@types/hast": "^2.0.0", + "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", - "hast-util-parse-selector": "^3.0.0", + "hast-util-parse-selector": "^4.0.0", "property-information": "^6.0.0", "space-separated-tokens": "^2.0.0" }, @@ -4872,9 +5349,9 @@ "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" }, "node_modules/html-void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", - "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4998,9 +5475,9 @@ } }, "node_modules/import-meta-resolve": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz", - "integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5047,7 +5524,7 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "devOptional": true + "dev": true }, "node_modules/internal-slot": { "version": "1.0.6", @@ -5612,18 +6089,6 @@ } } }, - "node_modules/jsdom/node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dev": true, - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -6044,73 +6509,21 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-definitions/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-definitions/node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-definitions/node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdast-util-find-and-replace": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", - "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", "dependencies": { - "@types/mdast": "^3.0.0", + "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-find-and-replace/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-find-and-replace/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -6123,53 +6536,40 @@ } }, "node_modules/mdast-util-from-markdown": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", - "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-from-markdown/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-from-markdown/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-gfm": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz", - "integrity": "sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", "dependencies": { - "mdast-util-from-markdown": "^1.0.0", - "mdast-util-gfm-autolink-literal": "^1.0.0", - "mdast-util-gfm-footnote": "^1.0.0", - "mdast-util-gfm-strikethrough": "^1.0.0", - "mdast-util-gfm-table": "^1.0.0", - "mdast-util-gfm-task-list-item": "^1.0.0", - "mdast-util-to-markdown": "^1.0.0" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6177,206 +6577,108 @@ } }, "node_modules/mdast-util-gfm-autolink-literal": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz", - "integrity": "sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", "dependencies": { - "@types/mdast": "^3.0.0", + "@types/mdast": "^4.0.0", "ccount": "^2.0.0", - "mdast-util-find-and-replace": "^2.0.0", - "micromark-util-character": "^1.0.0" + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-gfm-autolink-literal/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-gfm-autolink-literal/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-gfm-footnote": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz", - "integrity": "sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.3.0", - "micromark-util-normalize-identifier": "^1.0.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-gfm-footnote/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-gfm-footnote/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-gfm-strikethrough": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz", - "integrity": "sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.3.0" + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-gfm-strikethrough/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-gfm-strikethrough/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-gfm-table": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz", - "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", "dependencies": { - "@types/mdast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", "markdown-table": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "mdast-util-to-markdown": "^1.3.0" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-gfm-table/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-gfm-table/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-gfm-task-list-item": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz", - "integrity": "sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-to-markdown": "^1.3.0" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-gfm-task-list-item/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-gfm-task-list-item/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-phrasing": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz", - "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz", + "integrity": "sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==", "dependencies": { - "@types/mdast": "^3.0.0", - "unist-util-is": "^5.0.0" + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-phrasing/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-phrasing/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-to-hast": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", - "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/mdast": "^3.0.0", - "mdast-util-definitions": "^5.0.0", - "micromark-util-sanitize-uri": "^1.1.0", - "trim-lines": "^3.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-hast/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-to-hast/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/mdast-util-to-hast/node_modules/mdast-util-definitions": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", - "integrity": "sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "unist-util-visit": "^4.0.0" + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" }, "funding": { "type": "opencollective", @@ -6384,17 +6686,17 @@ } }, "node_modules/mdast-util-to-markdown": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", - "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", "longest-streak": "^3.0.0", - "mdast-util-phrasing": "^3.0.0", - "mdast-util-to-string": "^3.0.0", - "micromark-util-decode-string": "^1.0.0", - "unist-util-visit": "^4.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" }, "funding": { @@ -6402,44 +6704,18 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-to-markdown/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-to-markdown/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/mdast-util-to-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", - "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dependencies": { - "@types/mdast": "^3.0.0" + "@types/mdast": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-to-string/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/mdast-util-to-string/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/meow": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", @@ -6466,9 +6742,9 @@ } }, "node_modules/micromark": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", - "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", "funding": [ { "type": "GitHub Sponsors", @@ -6483,26 +6759,26 @@ "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-core-commonmark": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", - "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", "funding": [ { "type": "GitHub Sponsors", @@ -6515,36 +6791,36 @@ ], "dependencies": { "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-extension-gfm": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz", - "integrity": "sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==", - "dependencies": { - "micromark-extension-gfm-autolink-literal": "^1.0.0", - "micromark-extension-gfm-footnote": "^1.0.0", - "micromark-extension-gfm-strikethrough": "^1.0.0", - "micromark-extension-gfm-table": "^1.0.0", - "micromark-extension-gfm-tagfilter": "^1.0.0", - "micromark-extension-gfm-task-list-item": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-types": "^1.0.0" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6552,14 +6828,14 @@ } }, "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz", - "integrity": "sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6567,18 +6843,18 @@ } }, "node_modules/micromark-extension-gfm-footnote": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz", - "integrity": "sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", "dependencies": { - "micromark-core-commonmark": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6586,16 +6862,16 @@ } }, "node_modules/micromark-extension-gfm-strikethrough": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz", - "integrity": "sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6603,15 +6879,15 @@ } }, "node_modules/micromark-extension-gfm-table": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz", - "integrity": "sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", + "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6619,11 +6895,11 @@ } }, "node_modules/micromark-extension-gfm-tagfilter": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz", - "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", "dependencies": { - "micromark-util-types": "^1.0.0" + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6631,15 +6907,15 @@ } }, "node_modules/micromark-extension-gfm-task-list-item": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz", - "integrity": "sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", + "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", @@ -6647,9 +6923,9 @@ } }, "node_modules/micromark-factory-destination": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", - "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", "funding": [ { "type": "GitHub Sponsors", @@ -6661,15 +6937,15 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-label": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", - "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", "funding": [ { "type": "GitHub Sponsors", @@ -6681,16 +6957,16 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-space": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", - "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", "funding": [ { "type": "GitHub Sponsors", @@ -6702,14 +6978,14 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-title": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", - "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", "funding": [ { "type": "GitHub Sponsors", @@ -6721,16 +6997,16 @@ } ], "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-whitespace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", - "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", "funding": [ { "type": "GitHub Sponsors", @@ -6742,16 +7018,16 @@ } ], "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-character": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", - "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", + "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", "funding": [ { "type": "GitHub Sponsors", @@ -6763,14 +7039,14 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-chunked": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", - "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", "funding": [ { "type": "GitHub Sponsors", @@ -6782,13 +7058,13 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-classify-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", - "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", "funding": [ { "type": "GitHub Sponsors", @@ -6800,15 +7076,15 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } }, "node_modules/micromark-util-combine-extensions": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", - "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", "funding": [ { "type": "GitHub Sponsors", @@ -6820,14 +7096,14 @@ } ], "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", - "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", "funding": [ { "type": "GitHub Sponsors", @@ -6839,13 +7115,13 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-decode-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", - "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", "funding": [ { "type": "GitHub Sponsors", @@ -6858,15 +7134,15 @@ ], "dependencies": { "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", - "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", "funding": [ { "type": "GitHub Sponsors", @@ -6879,9 +7155,9 @@ ] }, "node_modules/micromark-util-html-tag-name": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", - "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", "funding": [ { "type": "GitHub Sponsors", @@ -6894,9 +7170,9 @@ ] }, "node_modules/micromark-util-normalize-identifier": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", - "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", "funding": [ { "type": "GitHub Sponsors", @@ -6908,13 +7184,13 @@ } ], "dependencies": { - "micromark-util-symbol": "^1.0.0" + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-resolve-all": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", - "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", "funding": [ { "type": "GitHub Sponsors", @@ -6926,13 +7202,13 @@ } ], "dependencies": { - "micromark-util-types": "^1.0.0" + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-sanitize-uri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", - "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", "funding": [ { "type": "GitHub Sponsors", @@ -6944,15 +7220,15 @@ } ], "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-subtokenize": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", - "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", "funding": [ { "type": "GitHub Sponsors", @@ -6964,16 +7240,16 @@ } ], "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-symbol": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", - "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", "funding": [ { "type": "GitHub Sponsors", @@ -6986,9 +7262,9 @@ ] }, "node_modules/micromark-util-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", - "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", "funding": [ { "type": "GitHub Sponsors", @@ -7055,18 +7331,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -7083,7 +7347,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "devOptional": true, + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7103,12 +7367,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "optional": true - }, "node_modules/mlly": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", @@ -7127,14 +7385,6 @@ "integrity": "sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q==", "peer": true }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "engines": { - "node": ">=4" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -7162,12 +7412,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", - "optional": true - }, "node_modules/needle": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", @@ -25255,24 +25499,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/node-abi": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", - "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", - "optional": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-addon-api": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", - "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", - "optional": true - }, "node_modules/node-emoji": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.0.tgz", @@ -28284,7 +28510,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "devOptional": true, + "dev": true, "dependencies": { "wrappy": "1" } @@ -28377,6 +28603,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, "dependencies": { "yocto-queue": "^1.0.0" }, @@ -28497,15 +28724,15 @@ } }, "node_modules/p-queue": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", - "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", "dependencies": { "eventemitter3": "^5.0.1", - "p-timeout": "^5.0.2" + "p-timeout": "^6.1.2" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -28521,11 +28748,11 @@ } }, "node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -28603,9 +28830,15 @@ } }, "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } }, "node_modules/path-browserify": { "version": "1.0.1", @@ -28929,95 +29162,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", - "optional": true, - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prebuild-install/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "optional": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/prebuild-install/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true, - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/prebuild-install/node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "optional": true, - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/prebuild-install/node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "optional": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/preferred-pm": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.2.tgz", @@ -29149,16 +29293,6 @@ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "dev": true }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "optional": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -29193,17 +29327,11 @@ } ] }, - "node_modules/queue-tick": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", - "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", - "optional": true - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "devOptional": true, + "dev": true, "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -29447,14 +29575,14 @@ } }, "node_modules/rehype": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz", - "integrity": "sha512-ey6kAqwLM3X6QnMDILJthGvG1m1ULROS9NT4uG9IDCuv08SFyLlreSuvOa//DgEvbXx62DS6elGVqusWhRUbgw==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", + "integrity": "sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg==", "dependencies": { - "@types/hast": "^2.0.0", - "rehype-parse": "^8.0.0", - "rehype-stringify": "^9.0.0", - "unified": "^10.0.0" + "@types/hast": "^3.0.0", + "rehype-parse": "^9.0.0", + "rehype-stringify": "^10.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", @@ -29462,14 +29590,13 @@ } }, "node_modules/rehype-parse": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.5.tgz", - "integrity": "sha512-Ds3RglaY/+clEX2U2mHflt7NlMA72KspZ0JLUJgBBLpRddBcEw3H8uYZQliQriku22NZpYMfjDdSgHcjxue24A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz", + "integrity": "sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==", "dependencies": { - "@types/hast": "^2.0.0", - "hast-util-from-parse5": "^7.0.0", - "parse5": "^6.0.0", - "unified": "^10.0.0" + "@types/hast": "^3.0.0", + "hast-util-from-html": "^2.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", @@ -29477,13 +29604,13 @@ } }, "node_modules/rehype-raw": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz", - "integrity": "sha512-d6AKtisSRtDRX4aSPsJGTfnzrX2ZkHQLE5kiUuGOeEoLpbEulFF4hj0mLPbsa+7vmguDKOVVEQdHKDSwoaIDsQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", "dependencies": { - "@types/hast": "^2.0.0", - "hast-util-raw": "^7.2.0", - "unified": "^10.0.0" + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", @@ -29491,13 +29618,13 @@ } }, "node_modules/rehype-stringify": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.4.tgz", - "integrity": "sha512-Uk5xu1YKdqobe5XpSskwPvo1XeHUUucWEQSl8hTrXt5selvca1e8K1EZ37E6YoZ4BT8BCqCdVfQW7OfHfthtVQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz", + "integrity": "sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ==", "dependencies": { - "@types/hast": "^2.0.0", - "hast-util-to-html": "^8.0.0", - "unified": "^10.0.0" + "@types/hast": "^3.0.0", + "hast-util-to-html": "^9.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", @@ -29505,101 +29632,80 @@ } }, "node_modules/remark-gfm": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz", - "integrity": "sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-gfm": "^2.0.0", - "micromark-extension-gfm": "^2.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-gfm/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/remark-gfm/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/remark-parse": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz", - "integrity": "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "unified": "^10.0.0" + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-parse/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/remark-parse/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/remark-rehype": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz", - "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.0.0.tgz", + "integrity": "sha512-vx8x2MDMcxuE4lBmQ46zYUDfcFMmvg80WYX+UNLeG6ixjdCCLcw1lrgAukwBTuOFsS78eoAedHGn9sNM0w7TPw==", "dependencies": { - "@types/hast": "^2.0.0", - "@types/mdast": "^3.0.0", - "mdast-util-to-hast": "^12.1.0", - "unified": "^10.0.0" + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-rehype/node_modules/@types/mdast": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.14.tgz", - "integrity": "sha512-gVZ04PGgw1qLZKsnWnyFv4ORnaJ+DXLdHTVSFbU8yX6xZ34Bjg4Q32yPkmveUP1yItXReKfB0Aknlh/3zxTKAw==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/remark-rehype/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, "node_modules/remark-smartypants": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.0.0.tgz", - "integrity": "sha512-Rc0VDmr/yhnMQIz8n2ACYXlfw/P/XZev884QU1I5u+5DgJls32o97Vc1RbK3pfumLsJomS2yy8eT4Fxj/2MDVA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.1.0.tgz", + "integrity": "sha512-qoF6Vz3BjU2tP6OfZqHOvCU0ACmu/6jhGaINSQRI9mM7wCxNQTKB3JUAN4SVoN2ybElEDTxBIABRep7e569iJw==", "dependencies": { "retext": "^8.1.0", - "retext-smartypants": "^5.1.0", - "unist-util-visit": "^4.1.0" + "retext-smartypants": "^5.2.0", + "unist-util-visit": "^5.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/request-light": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", @@ -29717,6 +29823,69 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/retext-latin/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-latin/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/retext-smartypants": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-5.2.0.tgz", @@ -29732,151 +29901,384 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/retext-stringify": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", - "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", + "node_modules/retext-smartypants/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-smartypants/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { - "@types/nlcst": "^1.0.0", - "nlcst-to-string": "^3.0.0", - "unified": "^10.0.0" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" + "node_modules/retext-smartypants/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=14.18.0", - "npm": ">=8.0.0" + "node_modules/retext-smartypants/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", - "dev": true - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], + "node_modules/retext-smartypants/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", "dependencies": { - "queue-microtask": "^1.2.2" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "node_modules/retext-smartypants/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", "dependencies": { - "mri": "^1.1.0" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/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==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sax": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" - }, - "node_modules/saxes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "dev": true, + "node_modules/retext-smartypants/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { - "xmlchars": "^2.2.0" + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, - "engines": { - "node": ">=v12.22.7" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "node_modules/retext-smartypants/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { - "loose-envify": "^1.1.0" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "node_modules/retext-stringify": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", + "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" + "@types/nlcst": "^1.0.0", + "nlcst-to-string": "^3.0.0", + "unified": "^10.0.0" }, - "engines": { - "node": ">=4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/semantic-release": { - "version": "22.0.7", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-22.0.7.tgz", - "integrity": "sha512-Stx23Hjn7iU8GOAlhG3pHlR7AoNEahj9q7lKBP0rdK2BasGtJ4AWYh3zm1u3SCMuFiA8y4CE/Gu4RGKau1WiaQ==", - "dev": true, - "peer": true, - "dependencies": { + "node_modules/retext-stringify/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-stringify/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.3.tgz", + "integrity": "sha512-JnchF0ZGFiqGpAPjg3e89j656Ne4tTtCY1VZc1AxtoQcRIxjTu9jyYHBAtkDXE+X681n4un/nX9SU52AroSRzg==", + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.9.3", + "@rollup/rollup-android-arm64": "4.9.3", + "@rollup/rollup-darwin-arm64": "4.9.3", + "@rollup/rollup-darwin-x64": "4.9.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.3", + "@rollup/rollup-linux-arm64-gnu": "4.9.3", + "@rollup/rollup-linux-arm64-musl": "4.9.3", + "@rollup/rollup-linux-riscv64-gnu": "4.9.3", + "@rollup/rollup-linux-x64-gnu": "4.9.3", + "@rollup/rollup-linux-x64-musl": "4.9.3", + "@rollup/rollup-win32-arm64-msvc": "4.9.3", + "@rollup/rollup-win32-ia32-msvc": "4.9.3", + "@rollup/rollup-win32-x64-msvc": "4.9.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/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==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sax": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/section-matter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "dependencies": { + "extend-shallow": "^2.0.1", + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/semantic-release": { + "version": "22.0.7", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-22.0.7.tgz", + "integrity": "sha512-Stx23Hjn7iU8GOAlhG3pHlR7AoNEahj9q7lKBP0rdK2BasGtJ4AWYh3zm1u3SCMuFiA8y4CE/Gu4RGKau1WiaQ==", + "dev": true, + "peer": true, + "dependencies": { "@semantic-release/commit-analyzer": "^11.0.0", "@semantic-release/error": "^4.0.0", "@semantic-release/github": "^9.0.0", @@ -30172,26 +30574,43 @@ } }, "node_modules/sharp": { - "version": "0.32.6", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", - "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.1.tgz", + "integrity": "sha512-iAYUnOdTqqZDb3QjMneBKINTllCJDZ3em6WaWy7NPECM4aHncvqHRm0v0bN9nqJxMiwamv5KIdauJ6lUzKDpTQ==", "hasInstallScript": true, "optional": true, "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.2", - "node-addon-api": "^6.1.0", - "prebuild-install": "^7.1.1", - "semver": "^7.5.4", - "simple-get": "^4.0.1", - "tar-fs": "^3.0.4", - "tunnel-agent": "^0.6.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=14.15.0" + "libvips": ">=8.15.0", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.1", + "@img/sharp-darwin-x64": "0.33.1", + "@img/sharp-libvips-darwin-arm64": "1.0.0", + "@img/sharp-libvips-darwin-x64": "1.0.0", + "@img/sharp-libvips-linux-arm": "1.0.0", + "@img/sharp-libvips-linux-arm64": "1.0.0", + "@img/sharp-libvips-linux-s390x": "1.0.0", + "@img/sharp-libvips-linux-x64": "1.0.0", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.0", + "@img/sharp-libvips-linuxmusl-x64": "1.0.0", + "@img/sharp-linux-arm": "0.33.1", + "@img/sharp-linux-arm64": "0.33.1", + "@img/sharp-linux-s390x": "0.33.1", + "@img/sharp-linux-x64": "0.33.1", + "@img/sharp-linuxmusl-arm64": "0.33.1", + "@img/sharp-linuxmusl-x64": "0.33.1", + "@img/sharp-wasm32": "0.33.1", + "@img/sharp-win32-ia32": "0.33.1", + "@img/sharp-win32-x64": "0.33.1" } }, "node_modules/shebang-command": { @@ -30231,664 +30650,535 @@ } }, "node_modules/shikiji": { - "version": "0.6.12", - "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.12.tgz", - "integrity": "sha512-sm7Wg8P4w6T3quDAZQxvk0P02o2hheIFEdbaEuGOhGnqLDjVsP28GDUVPdgbacOIc1auapNVNCVEykhPploLyg==", + "version": "0.6.13", + "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.13.tgz", + "integrity": "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA==", "dependencies": { "hast-util-to-html": "^9.0.0" } }, - "node_modules/shikiji/node_modules/@types/hast": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.2.tgz", - "integrity": "sha512-B5hZHgHsXvfCoO3xgNJvBnX7N8p86TqQeGKXcokW4XXi+qY4vxxPSFYofytvVmpFxzPv7oxDQzjg5Un5m2/xiw==", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/shikiji/node_modules/hast-util-from-parse5": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", - "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", + "node_modules/shx": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", + "dev": true, "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "devlop": "^1.0.0", - "hastscript": "^8.0.0", - "property-information": "^6.0.0", - "vfile": "^6.0.0", - "vfile-location": "^5.0.0", - "web-namespaces": "^2.0.0" + "minimist": "^1.2.3", + "shelljs": "^0.8.5" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "bin": { + "shx": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, - "node_modules/shikiji/node_modules/hast-util-parse-selector": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", - "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, "dependencies": { - "@types/hast": "^3.0.0" + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/shikiji/node_modules/hast-util-raw": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.1.tgz", - "integrity": "sha512-5m1gmba658Q+lO5uqL5YNGQWeh1MYWZbZmWrM5lncdcuiXuo5E2HT/CIOp0rLF8ksfSwiCVJ3twlgVRyTGThGA==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "@ungap/structured-clone": "^1.0.0", - "hast-util-from-parse5": "^8.0.0", - "hast-util-to-parse5": "^8.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "parse5": "^7.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/shikiji/node_modules/hast-util-to-html": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", - "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", + "node_modules/signale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", + "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", + "dev": true, + "peer": true, "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-raw": "^9.0.0", - "hast-util-whitespace": "^3.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "stringify-entities": "^4.0.0", - "zwitch": "^2.0.4" + "chalk": "^2.3.2", + "figures": "^2.0.0", + "pkg-conf": "^2.1.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">=6" } }, - "node_modules/shikiji/node_modules/hast-util-to-parse5": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", - "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", + "node_modules/signale/node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "peer": true, "dependencies": { - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "devlop": "^1.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" + "escape-string-regexp": "^1.0.5" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">=4" } }, - "node_modules/shikiji/node_modules/hast-util-whitespace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", - "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "optional": true, "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "is-arrayish": "^0.3.1" } }, - "node_modules/shikiji/node_modules/hastscript": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", - "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/skin-tone": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", + "dev": true, + "peer": true, "dependencies": { - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-parse-selector": "^4.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0" + "unicode-emoji-modifier-base": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/shikiji/node_modules/html-void-elements": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", - "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/shikiji/node_modules/mdast-util-to-hast": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", - "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", + "node_modules/spawn-error-forwarder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", + "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", + "dev": true, + "peer": true + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@ungap/structured-clone": "^1.0.0", - "devlop": "^1.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "trim-lines": "^3.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/shikiji/node_modules/micromark-util-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.0.1.tgz", - "integrity": "sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/shikiji/node_modules/micromark-util-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", - "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] + "node_modules/spdx-license-ids": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", + "dev": true }, - "node_modules/shikiji/node_modules/micromark-util-sanitize-uri": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", - "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "engines": { + "node": ">= 10.x" } }, - "node_modules/shikiji/node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, - "node_modules/shikiji/node_modules/micromark-util-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", - "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true }, - "node_modules/shikiji/node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "node_modules/state-local": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", + "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==" + }, + "node_modules/std-env": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.6.0.tgz", + "integrity": "sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==", + "dev": true + }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", "dependencies": { - "entities": "^4.4.0" + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/shikiji/node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, "dependencies": { - "@types/unist": "^3.0.0" + "internal-slot": "^1.0.4" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">= 0.4" } }, - "node_modules/shikiji/node_modules/unist-util-position": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", - "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "node_modules/stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", + "dev": true, + "peer": true, "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" } }, - "node_modules/shikiji/node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "node_modules/stream-combiner2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "peer": true, "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/shikiji/node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "node_modules/stream-combiner2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "peer": true + }, + "node_modules/stream-combiner2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "peer": true, "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "safe-buffer": "~5.1.0" } }, - "node_modules/shikiji/node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "node_modules/stream-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "debug": "2" } }, - "node_modules/shikiji/node_modules/vfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", - "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "node_modules/stream-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "ms": "2.0.0" } }, - "node_modules/shikiji/node_modules/vfile-location": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", - "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", + "node_modules/stream-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/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==", "dependencies": { - "@types/unist": "^3.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "safe-buffer": "~5.2.0" } }, - "node_modules/shikiji/node_modules/vfile-message": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", - "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/shx": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", - "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", - "dev": true, + "node_modules/stringify-entities": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", "dependencies": { - "minimist": "^1.2.3", - "shelljs": "^0.8.5" - }, - "bin": { - "shx": "lib/cli.js" + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", "engines": { - "node": ">=14" + "node": ">=0.10.0" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/signale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", - "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true, - "peer": true, - "dependencies": { - "chalk": "^2.3.2", - "figures": "^2.0.0", - "pkg-conf": "^2.1.0" - }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/signale/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "node_modules/strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", "dev": true, - "peer": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "acorn": "^8.10.0" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/antfu" } }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true - }, - "node_modules/simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "optional": true, + "node_modules/supports-hyperlinks": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "dev": true, + "peer": true, "dependencies": { - "is-arrayish": "^0.3.1" + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" } }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + "node_modules/supports-hyperlinks/node_modules/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, + "peer": true, + "engines": { + "node": ">=8" + } }, - "node_modules/skin-tone": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", - "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", + "node_modules/supports-hyperlinks/node_modules/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, "peer": true, "dependencies": { - "unicode-emoji-modifier-base": "^1.0.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "engines": { - "node": ">=12" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/temp-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=14.16" } }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "node_modules/tempy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", + "dev": true, + "dependencies": { + "is-stream": "^3.0.0", + "temp-dir": "^3.0.0", + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/space-separated-tokens": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", - "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "node_modules/text-extensions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", + "dev": true, + "engines": { + "node": ">=8" + }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/spawn-error-forwarder": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", - "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", - "dev": true, - "peer": true + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, + "peer": true, "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", - "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", - "dev": true - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "dev": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, - "node_modules/state-local": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", - "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==" - }, - "node_modules/std-env": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.6.0.tgz", - "integrity": "sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==", - "dev": true - }, - "node_modules/stdin-discarder": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", - "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", - "dependencies": { - "bl": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", - "dev": true, - "peer": true, - "dependencies": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-combiner2/node_modules/readable-stream": { + "node_modules/through2/node_modules/readable-stream": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", @@ -30904,14 +31194,14 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/stream-combiner2/node_modules/safe-buffer": { + "node_modules/through2/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "peer": true }, - "node_modules/stream-combiner2/node_modules/string_decoder": { + "node_modules/through2/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", @@ -30921,1388 +31211,555 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/stream-parser": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", - "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", - "dependencies": { - "debug": "2" + "node_modules/tinybench": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", + "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.1.tgz", + "integrity": "sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==", + "dev": true, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/stream-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" + "node_modules/tinyspy": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", + "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "dev": true, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/stream-parser/node_modules/ms": { + "node_modules/to-fast-properties": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } }, - "node_modules/streamx": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.2.tgz", - "integrity": "sha512-b62pAV/aeMjUoRN2C/9F0n+G8AfcJjNC0zw/ZmOHeFsIe4m4GzjVW9m6VHXVjk536NbdU9JRwKMJRfkc+zUFTg==", - "optional": true, + "node_modules/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==", "dependencies": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, - "node_modules/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==", + "node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, "dependencies": { - "safe-buffer": "~5.2.0" + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" } }, - "node_modules/string-width": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", - "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^10.2.1", - "strip-ansi": "^7.0.1" + "punycode": "^2.3.1" }, "engines": { - "node": ">=16" - }, + "node": ">=18" + } + }, + "node_modules/traverse": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", + "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", + "dev": true, + "peer": true, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/stringify-entities": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", - "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", - "dependencies": { - "character-entities-html4": "^2.0.0", - "character-entities-legacy": "^3.0.0" - }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": { - "ansi-regex": "^6.0.1" + "node_modules/trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/tsconfck": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.0.tgz", + "integrity": "sha512-w3wnsIrJNi7avf4Zb0VjOoodoO0woEqGgZGQm+LHH9przdUI+XDKsWAXwxHA1DaRTjeuZNcregSzr7RaA8zG9A==", + "bin": { + "tsconfck": "bin/tsconfck.js" }, "engines": { - "node": ">=12" + "node": "^18 || >=20" }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "optional": true + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, "engines": { "node": ">=4" } }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "engines": { - "node": ">=12" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "devOptional": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/typesafe-path": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", + "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" }, - "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", - "dev": true, - "dependencies": { - "acorn": "^8.10.0" + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, - "funding": { - "url": "https://github.com/sponsors/antfu" + "engines": { + "node": ">=14.17" } }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/typescript-auto-import-cache": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.0.tgz", + "integrity": "sha512-Rq6/q4O9iyqUdjvOoyas7x/Qf9nWUMeqpP3YeTaLA+uECgfy5wOhfOS+SW/+fZ/uI/ZcKaf+2/ZhFzXh8xfofQ==", "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "semver": "^7.3.8" } }, - "node_modules/supports-hyperlinks": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", - "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "node_modules/ufo": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", + "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", + "dev": true + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" }, "engines": { - "node": ">=14.18" + "node": ">=0.8.0" } }, - "node_modules/supports-hyperlinks/node_modules/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, - "peer": true, - "engines": { - "node": ">=8" + "node_modules/ultrahtml": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.2.tgz", + "integrity": "sha512-qh4mBffhlkiXwDAOxvSGxhL0QEQsTbnP9BozOK3OYPEGvPvdWzvAUaXNtUSMdNsKDtuyjEbyVUPFZ52SSLhLqw==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "devOptional": true + }, + "node_modules/unherit": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", + "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/supports-hyperlinks/node_modules/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==", + "node_modules/unicode-emoji-modifier-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", "dev": true, "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "engines": { - "node": ">= 0.4" + "node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "node_modules/tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", - "optional": true, - "dependencies": { - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - } - }, - "node_modules/tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", - "optional": true, - "dependencies": { - "b4a": "^1.6.4", - "fast-fifo": "^1.2.0", - "streamx": "^2.15.0" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/temp-dir": { + "node_modules/unique-string": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", - "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/tempy": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", - "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, "dependencies": { - "is-stream": "^3.0.0", - "temp-dir": "^3.0.0", - "type-fest": "^2.12.2", - "unique-string": "^3.0.0" + "crypto-random-string": "^4.0.0" }, "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/text-extensions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", - "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dependencies": { + "@types/unist": "^3.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "peer": true, + "node_modules/unist-util-modify-children": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", + "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "@types/unist": "^2.0.0", + "array-iterate": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "peer": true, + "node_modules/unist-util-modify-children/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "peer": true - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "peer": true, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/tinybench": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", - "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.1.tgz", - "integrity": "sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", - "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", - "dev": true, - "engines": { - "node": ">=14.0.0" + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "engines": { - "node": ">=4" + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/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==", + "node_modules/unist-util-visit-children": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", + "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", "dependencies": { - "is-number": "^7.0.0" + "@types/unist": "^2.0.0" }, - "engines": { - "node": ">=8.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", - "dev": true, + "node_modules/unist-util-visit-children/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { - "node": ">= 4.0.0" + "node": ">= 10.0.0" } }, - "node_modules/tr46": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", - "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", - "dev": true, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "punycode": "^2.3.1" + "escalade": "^3.1.1", + "picocolors": "^1.0.0" }, - "engines": { - "node": ">=18" + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, - "node_modules/traverse": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", - "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", + "node_modules/url-join": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", "dev": true, - "peer": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/trim-lines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", - "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" } }, - "node_modules/trough": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", - "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, - "node_modules/tsconfck": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.0.tgz", - "integrity": "sha512-w3wnsIrJNi7avf4Zb0VjOoodoO0woEqGgZGQm+LHH9przdUI+XDKsWAXwxHA1DaRTjeuZNcregSzr7RaA8zG9A==", - "bin": { - "tsconfck": "bin/tsconfck.js" - }, - "engines": { - "node": "^18 || >=20" - }, - "peerDependencies": { - "typescript": "^5.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "optional": true, + "node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dependencies": { - "safe-buffer": "^5.0.1" + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" }, - "engines": { - "node": "*" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "engines": { - "node": ">=12.20" + "node_modules/vfile-location": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/typesafe-path": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", - "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" - }, - "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/typescript-auto-import-cache": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.0.tgz", - "integrity": "sha512-Rq6/q4O9iyqUdjvOoyas7x/Qf9nWUMeqpP3YeTaLA+uECgfy5wOhfOS+SW/+fZ/uI/ZcKaf+2/ZhFzXh8xfofQ==", - "dependencies": { - "semver": "^7.3.8" - } - }, - "node_modules/ufo": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", - "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", - "dev": true - }, - "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", - "dev": true, - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ultrahtml": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.2.tgz", - "integrity": "sha512-qh4mBffhlkiXwDAOxvSGxhL0QEQsTbnP9BozOK3OYPEGvPvdWzvAUaXNtUSMdNsKDtuyjEbyVUPFZ52SSLhLqw==" - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true - }, - "node_modules/unherit": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", - "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/unicode-emoji-modifier-base": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", - "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unified/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unique-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", - "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", - "dev": true, - "dependencies": { - "crypto-random-string": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/unist-util-generated": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz", - "integrity": "sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-is": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", - "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-is/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unist-util-modify-children": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", - "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", - "dependencies": { - "@types/unist": "^2.0.0", - "array-iterate": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-modify-children/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unist-util-position": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", - "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-position/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-stringify-position/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unist-util-visit": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", - "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.1.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-children": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", - "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-children/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unist-util-visit-parents": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", - "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/unist-util-visit/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/universal-user-agent": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", - "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", - "dev": true - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/url-join": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", - "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/uvu": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", - "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", - "dependencies": { - "dequal": "^2.0.0", - "diff": "^5.0.0", - "kleur": "^4.0.3", - "sade": "^1.7.3" - }, - "bin": { - "uvu": "bin.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-location": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.1.0.tgz", - "integrity": "sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==", - "dependencies": { - "@types/unist": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-location/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-message/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/vfile/node_modules/@types/unist": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", - "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" - }, - "node_modules/vite": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz", - "integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==", - "dependencies": { - "esbuild": "^0.18.10", - "postcss": "^8.4.27", - "rollup": "^3.27.1" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - }, - "peerDependencies": { - "@types/node": ">= 14", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.1.1.tgz", - "integrity": "sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==", - "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vite-node/node_modules/rollup": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.6.1.tgz", - "integrity": "sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.6.1", - "@rollup/rollup-android-arm64": "4.6.1", - "@rollup/rollup-darwin-arm64": "4.6.1", - "@rollup/rollup-darwin-x64": "4.6.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.6.1", - "@rollup/rollup-linux-arm64-gnu": "4.6.1", - "@rollup/rollup-linux-arm64-musl": "4.6.1", - "@rollup/rollup-linux-x64-gnu": "4.6.1", - "@rollup/rollup-linux-x64-musl": "4.6.1", - "@rollup/rollup-win32-arm64-msvc": "4.6.1", - "@rollup/rollup-win32-ia32-msvc": "4.6.1", - "@rollup/rollup-win32-x64-msvc": "4.6.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/vite-node/node_modules/vite": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.5.tgz", - "integrity": "sha512-OekeWqR9Ls56f3zd4CaxzbbS11gqYkEiBtnWFFgYR2WV8oPJRRKq0mpskYy/XaoCL3L7VINDhqqOMNDiYdGvGg==", - "dev": true, - "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.32", - "rollup": "^4.2.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", - "cpu": [ - "loong64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", - "cpu": [ - "mips64el" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" + "node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], + "node_modules/vite": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.11.tgz", + "integrity": "sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==", + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.32", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, "engines": { - "node": ">=12" + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } } }, - "node_modules/vite/node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "hasInstallScript": true, + "node_modules/vite-node": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.1.1.tgz", + "integrity": "sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, "bin": { - "esbuild": "bin/esbuild" + "vite-node": "vite-node.mjs" }, "engines": { - "node": ">=12" + "node": "^18.0.0 || >=20.0.0" }, - "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/vitefu": { @@ -32384,246 +31841,6 @@ } } }, - "node_modules/vitest/node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz", - "integrity": "sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz", - "integrity": "sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz", - "integrity": "sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz", - "integrity": "sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz", - "integrity": "sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz", - "integrity": "sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz", - "integrity": "sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz", - "integrity": "sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz", - "integrity": "sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz", - "integrity": "sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz", - "integrity": "sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vitest/node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz", - "integrity": "sha512-SYRedJi+mweatroB+6TTnJYLts0L0bosg531xnQWtklOI6dezEagx4Q0qDyvRdK+qgdA3YZpjjGuPFtxBmddBA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/vitest/node_modules/rollup": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.2.tgz", - "integrity": "sha512-66RB8OtFKUTozmVEh3qyNfH+b+z2RXBVloqO2KCC/pjFaGaHtxP9fVfOQKPSGXg2mElmjmxjW/fZ7iKrEpMH5Q==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.2", - "@rollup/rollup-android-arm64": "4.9.2", - "@rollup/rollup-darwin-arm64": "4.9.2", - "@rollup/rollup-darwin-x64": "4.9.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.2", - "@rollup/rollup-linux-arm64-gnu": "4.9.2", - "@rollup/rollup-linux-arm64-musl": "4.9.2", - "@rollup/rollup-linux-riscv64-gnu": "4.9.2", - "@rollup/rollup-linux-x64-gnu": "4.9.2", - "@rollup/rollup-linux-x64-musl": "4.9.2", - "@rollup/rollup-win32-arm64-msvc": "4.9.2", - "@rollup/rollup-win32-ia32-msvc": "4.9.2", - "@rollup/rollup-win32-x64-msvc": "4.9.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/vitest/node_modules/vite": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz", - "integrity": "sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==", - "dev": true, - "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.32", - "rollup": "^4.2.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, "node_modules/volar-service-css": { "version": "0.0.16", "resolved": "https://registry.npmjs.org/volar-service-css/-/volar-service-css-0.0.16.tgz", @@ -33066,7 +32283,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "devOptional": true + "dev": true }, "node_modules/ws": { "version": "8.14.2", diff --git a/package.json b/package.json index 9866d84..6bdbddf 100644 --- a/package.json +++ b/package.json @@ -1,46 +1,46 @@ { - "name": "@ff6347/p5-sandbox", - "private": true, - "version": "1.4.5", - "type": "module", - "scripts": { - "copy:p5": "mkdirp ./public/lib && shx cp -r ./node_modules/p5/lib ./public/", - "dev": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro dev", - "start": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro dev", - "prebuild": "npm run copy:p5", - "postinstall": "npm run copy:p5", - "build": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro build", - "check": "astro check", - "preview": "astro preview", - "astro": "astro", - "test": "vitest", - "test:e2e": "playwright test" - }, - "dependencies": { - "@astrojs/check": "0.3.4", - "@astrojs/react": "3.0.9", - "@monaco-editor/react": "4.6.0", - "@types/p5": "1.7.6", - "@types/react": "18.2.45", - "@types/react-dom": "18.2.18", - "astro": "3.6.4", - "lodash.debounce": "4.0.8", - "p5": "1.9.0", - "prettier": "3.1.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "typescript": "5.3.3" - }, - "devDependencies": { - "@playwright/test": "1.40.1", - "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", - "@types/lodash.debounce": "4.0.9", - "@types/node": "20.10.6", - "jsdom": "23.0.1", - "mkdirp": "3.0.1", - "netlify-cli": "17.10.2", - "shx": "0.3.4", - "vitest": "1.1.1" - } + "name": "@ff6347/p5-sandbox", + "private": true, + "version": "1.4.5", + "type": "module", + "scripts": { + "copy:p5": "mkdirp ./public/lib && shx cp -r ./node_modules/p5/lib ./public/", + "dev": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro dev", + "start": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro dev", + "prebuild": "npm run copy:p5", + "postinstall": "npm run copy:p5", + "build": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro build", + "check": "astro check", + "preview": "astro preview", + "astro": "astro", + "test": "vitest", + "test:e2e": "playwright test" + }, + "dependencies": { + "@astrojs/check": "0.3.4", + "@astrojs/react": "3.0.9", + "@monaco-editor/react": "4.6.0", + "@types/p5": "1.7.6", + "@types/react": "18.2.45", + "@types/react-dom": "18.2.18", + "astro": "4.1.0", + "lodash.debounce": "4.0.8", + "p5": "1.9.0", + "prettier": "3.1.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "typescript": "5.3.3" + }, + "devDependencies": { + "@playwright/test": "1.40.1", + "@technologiestiftung/semantic-release-config": "1.2.4", + "@testing-library/react": "14.1.2", + "@types/lodash.debounce": "4.0.9", + "@types/node": "20.10.6", + "jsdom": "23.0.1", + "mkdirp": "3.0.1", + "netlify-cli": "17.10.2", + "shx": "0.3.4", + "vitest": "1.1.1" + } } diff --git a/public/lib/p5.js b/public/lib/p5.js index 95a0c26..6c470be 100644 --- a/public/lib/p5.js +++ b/public/lib/p5.js @@ -1,4 +1,4 @@ -/*! p5.js v1.8.0 October 25, 2023 */ +/*! p5.js v1.9.0 November 28, 2023 */ (function (f) { if (typeof exports === 'object' && typeof module !== 'undefined') { module.exports = f() @@ -58,12 +58,12 @@ 'params': [ { 'name': 'text', - 'description': '

description of the canvas

\n', + 'description': '

description of the canvas.

\n', 'type': 'String' }, { 'name': 'display', - 'description': '

either LABEL or FALLBACK

\n', + 'description': '

either LABEL or FALLBACK.

\n', 'type': 'Constant', 'optional': true } @@ -76,17 +76,17 @@ 'params': [ { 'name': 'name', - 'description': '

name of the element

\n', + 'description': '

name of the element.

\n', 'type': 'String' }, { 'name': 'text', - 'description': '

description of the element

\n', + 'description': '

description of the element.

\n', 'type': 'String' }, { 'name': 'display', - 'description': '

either LABEL or FALLBACK

\n', + 'description': '

either LABEL or FALLBACK.

\n', 'type': 'Constant', 'optional': true } @@ -99,7 +99,7 @@ 'params': [ { 'name': 'display', - 'description': '

either FALLBACK or LABEL

\n', + 'description': '

either FALLBACK or LABEL.

\n', 'type': 'Constant', 'optional': true } @@ -112,7 +112,7 @@ 'params': [ { 'name': 'display', - 'description': '

either FALLBACK or LABEL

\n', + 'description': '

either FALLBACK or LABEL.

\n', 'type': 'Constant', 'optional': true } @@ -2634,6 +2634,16 @@ 'class': 'p5', 'module': 'Constants' }, + 'FLAT': { + 'name': 'FLAT', + 'class': 'p5', + 'module': 'Constants' + }, + 'SMOOTH': { + 'name': 'SMOOTH', + 'class': 'p5', + 'module': 'Constants' + }, 'LANDSCAPE': { 'name': 'LANDSCAPE', 'class': 'p5', @@ -2704,7 +2714,7 @@ 'params': [ { 'name': 'contents', - 'description': '

any combination of Number, String, Object, Boolean,\n Array to print

\n', + 'description': '

content to print to the console.

\n', 'type': 'Any' } ], @@ -2731,18 +2741,18 @@ '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', + 'description': '

Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT.\n Native CSS properties: \'grab\', \'progress\', and so on.\n Path to cursor image.

\n', 'type': 'String|Constant' }, { 'name': 'x', - 'description': '

the horizontal active spot of the cursor (must be less than 32)

\n', + 'description': '

horizontal active spot of the cursor.

\n', 'type': 'Number', 'optional': true }, { 'name': 'y', - 'description': '

the vertical active spot of the cursor (must be less than 32)

\n', + 'description': '

vertical active spot of the cursor.

\n', 'type': 'Number', 'optional': true } @@ -2759,7 +2769,7 @@ 'params': [ { 'name': 'fps', - 'description': '

number of frames to be displayed every second

\n', + 'description': '

number of frames to draw per second.

\n', 'type': 'Number' } ], @@ -2811,7 +2821,7 @@ 'params': [ { 'name': 'event', - 'description': '

optional Event callback argument.

\n', + 'description': '

optional resize Event.

\n', 'type': 'UIEvent', 'optional': true } @@ -2834,7 +2844,7 @@ 'params': [ { 'name': 'val', - 'description': '

whether the sketch should be in fullscreen mode\nor not

\n', + 'description': '

whether the sketch should be in fullscreen mode.

\n', 'type': 'Boolean', 'optional': true } @@ -2851,8 +2861,9 @@ 'params': [ { 'name': 'val', - 'description': '

whether or how much the sketch should scale

\n', - 'type': 'Number' + 'description': '

desired pixel density.

\n', + 'type': 'Number', + 'optional': true } ], 'chainable': 1 @@ -3627,12 +3638,12 @@ 'params': [ { 'name': 'selectors', - 'description': '

CSS selector string of element to search for

\n', + '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', + 'description': '

CSS selector string, p5.Element, or\n HTMLElement to search within.

\n', 'type': 'String|p5.Element|HTMLElement', 'optional': true } @@ -3645,12 +3656,12 @@ 'params': [ { 'name': 'selectors', - 'description': '

CSS selector string of elements to search for

\n', + 'description': '

CSS selector string of element to search for.

\n', 'type': 'String' }, { 'name': 'container', - 'description': '

CSS selector string, p5.Element\n , or HTML element to search within

\n', + 'description': '

CSS selector string, p5.Element, or\n HTMLElement to search within.

\n', 'type': 'String|p5.Element|HTMLElement', 'optional': true } @@ -3668,7 +3679,7 @@ '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', + 'description': '

function to call when the element changes.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -3680,7 +3691,7 @@ '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', + 'description': '

function to call when input is detected within\n the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -3692,7 +3703,7 @@ 'params': [ { 'name': 'html', - 'description': '

inner HTML for element created

\n', + 'description': '

inner HTML for the new <div></div> element.

\n', 'type': 'String', 'optional': true } @@ -3705,7 +3716,7 @@ 'params': [ { 'name': 'html', - 'description': '

inner HTML for element created

\n', + 'description': '

inner HTML for the new <p></p> element.

\n', 'type': 'String', 'optional': true } @@ -3718,7 +3729,7 @@ 'params': [ { 'name': 'html', - 'description': '

inner HTML for element created

\n', + 'description': '

inner HTML for the new <span></span> element.

\n', 'type': 'String', 'optional': true } @@ -3735,12 +3746,12 @@ 'params': [ { 'name': 'src', - 'description': '

src path or url for image

\n', + 'description': '

relative path or URL for the 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', + 'description': '

alternate text for the image.

\n', 'type': 'String' } ] @@ -3759,12 +3770,13 @@ }, { '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' + 'description': '

crossOrigin property to use when fetching the image.

\n', + 'type': 'String', + 'optional': true }, { 'name': 'successCallback', - 'description': '

callback to be called once image data is loaded with the p5.Element as argument

\n', + 'description': '

function to call once the image loads. The new image will be passed\n to the function as a p5.Element object.

\n', 'type': 'Function', 'optional': true } @@ -3777,17 +3789,17 @@ 'params': [ { 'name': 'href', - 'description': '

url of page to link to

\n', + 'description': '

URL of linked page.

\n', 'type': 'String' }, { 'name': 'html', - 'description': '

inner html of link element to display

\n', + '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', + 'description': '

target where the new link should open,\n either \'_blank\', \'_self\', \'_parent\', or \'_top\'.

\n', 'type': 'String', 'optional': true } @@ -3800,23 +3812,23 @@ 'params': [ { 'name': 'min', - 'description': '

minimum value of the slider

\n', + 'description': '

minimum value of the slider.

\n', 'type': 'Number' }, { 'name': 'max', - 'description': '

maximum value of the slider

\n', + 'description': '

maximum value of the slider.

\n', 'type': 'Number' }, { 'name': 'value', - 'description': '

default value of the slider

\n', + 'description': '

default value of the slider.

\n', 'type': 'Number', 'optional': true }, { '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', + 'description': '

size for each step in the slider\'s range.

\n', 'type': 'Number', 'optional': true } @@ -3829,12 +3841,12 @@ 'params': [ { 'name': 'label', - 'description': '

label displayed on the button

\n', + 'description': '

label displayed on the button.

\n', 'type': 'String' }, { 'name': 'value', - 'description': '

value of the button

\n', + 'description': '

value of the button.

\n', 'type': 'String', 'optional': true } @@ -3847,13 +3859,13 @@ 'params': [ { 'name': 'label', - 'description': '

label displayed after checkbox

\n', + 'description': '

label displayed after the checkbox.

\n', 'type': 'String', 'optional': true }, { 'name': 'value', - 'description': '

value of the checkbox; checked is true, unchecked is false

\n', + 'description': '

value of the checkbox. Checked is true and unchecked is false.

\n', 'type': 'Boolean', 'optional': true } @@ -3870,7 +3882,7 @@ 'params': [ { 'name': 'multiple', - 'description': '

true if dropdown should support multiple selections

\n', + 'description': '

support multiple selections.

\n', 'type': 'Boolean', 'optional': true } @@ -3880,7 +3892,7 @@ 'params': [ { 'name': 'existing', - 'description': '

DOM select element

\n', + 'description': '

select element to wrap, either as a p5.Element or\n a HTMLSelectElement.

\n', 'type': 'Object' } ] @@ -3896,13 +3908,8 @@ 'params': [ { 'name': 'containerElement', - 'description': '

A 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', + 'description': '

container HTML Element, either a <div></div>\nor <span></span>.

\n', + 'type': 'Object', 'optional': true } ] @@ -3911,8 +3918,9 @@ 'params': [ { 'name': 'name', - 'description': '', - 'type': 'String' + 'description': '

name parameter assigned to each option\'s <input></input> element.

\n', + 'type': 'String', + 'optional': true } ] }, @@ -3927,7 +3935,7 @@ 'params': [ { 'name': 'value', - 'description': '

default color of element

\n', + 'description': '

default color as a CSS color string.

\n', 'type': 'String|p5.Color', 'optional': true } @@ -3944,12 +3952,13 @@ 'params': [ { 'name': 'value', - 'description': '

default value of the input box

\n', - 'type': 'String' + 'description': '

default value of the input box. Defaults to an empty string \'\'.

\n', + 'type': 'String', + 'optional': true }, { 'name': 'type', - 'description': '

type of text, ie text, password etc. Defaults to text.\n Needs a value to be specified first.

\n', + 'description': '

type of input. Defaults to \'text\'.

\n', 'type': 'String', 'optional': true } @@ -3972,12 +3981,12 @@ 'params': [ { 'name': 'callback', - 'description': '

callback function for when a file is loaded

\n', + 'description': '

function to call once the file loads.

\n', 'type': 'Function' }, { 'name': 'multiple', - 'description': '

optional, to allow multiple files to be selected

\n', + 'description': '

allow multiple files to be selected.

\n', 'type': 'Boolean', 'optional': true } @@ -3990,12 +3999,12 @@ 'params': [ { 'name': 'src', - 'description': '

path to a video file, or array of paths for\n supporting different browsers

\n', + 'description': '

path to a video file, or an 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', + 'description': '

function to call once the video is ready to play.

\n', 'type': 'Function', 'optional': true } @@ -4008,13 +4017,13 @@ 'params': [ { 'name': 'src', - 'description': '

path to an audio file, or array of paths\n for supporting different browsers

\n', + 'description': '

path to an audio file, or an array of paths\n for supporting different browsers.

\n', 'type': 'String|String[]', 'optional': true }, { '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', + 'description': '

function to call once the audio is ready to play.

\n', 'type': 'Function', 'optional': true } @@ -4027,12 +4036,13 @@ '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' + 'description': '

type of capture, either AUDIO or VIDEO,\n or a constraints object. Both video and audio\n audio streams are captured by default.

\n', + 'type': 'String|Constant|Object', + 'optional': true }, { 'name': 'callback', - 'description': '

function to be called once\n stream has loaded

\n', + 'description': '

function to call once the stream\n has loaded.

\n', 'type': 'Function', 'optional': true } @@ -4045,12 +4055,12 @@ 'params': [ { 'name': 'tag', - 'description': '

tag for the new element

\n', + 'description': '

tag for the new element.

\n', 'type': 'String' }, { 'name': 'content', - 'description': '

html content to be inserted into the element

\n', + 'description': '

HTML content to insert into the element.

\n', 'type': 'String', 'optional': true } @@ -4465,7 +4475,7 @@ { 'name': 'selectedCanvas', 'description': '

reference to a\n specific HTML5 canvas element.

\n', - 'type': 'p5.Element|HTMLCanvasElement' + 'type': 'p5.Framebuffer|p5.Element|HTMLCanvasElement' }, { 'name': 'filename', @@ -6367,12 +6377,12 @@ 'params': [ { 'name': 'horizAlign', - 'description': '

horizontal alignment, either LEFT,\n CENTER, or RIGHT

\n', + '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', + 'description': '

vertical alignment, either TOP,\n BOTTOM, CENTER, or BASELINE.

\n', 'type': 'Constant', 'optional': true } @@ -6394,7 +6404,7 @@ 'params': [ { 'name': 'leading', - 'description': '

the size in pixels for spacing between lines

\n', + 'description': '

spacing between lines of text in units of pixels.

\n', 'type': 'Number' } ], @@ -6414,8 +6424,8 @@ { 'params': [ { - 'name': 'theSize', - 'description': '

the size of the letters in units of pixels

\n', + 'name': 'size', + 'description': '

size of the letters in units of pixels

\n', 'type': 'Number' } ], @@ -6435,7 +6445,7 @@ { 'params': [ { - 'name': 'theStyle', + 'name': 'style', 'description': '

styling for text, either NORMAL,\n ITALIC, BOLD or BOLDITALIC

\n', 'type': 'Constant' } @@ -6452,8 +6462,8 @@ 'name': 'textWidth', 'params': [ { - 'name': 'theText', - 'description': '

the String of characters to measure

\n', + 'name': 'str', + 'description': '

string of text to measure.

\n', 'type': 'String' } ], @@ -6474,8 +6484,8 @@ 'name': 'textWrap', 'params': [ { - 'name': 'wrapStyle', - 'description': '

text wrapping style, either WORD or CHAR

\n', + 'name': 'style', + 'description': '

text wrapping style, either WORD or CHAR.

\n', 'type': 'Constant' } ], @@ -7316,8 +7326,8 @@ 'name': 'freeGeometry', 'params': [ { - 'name': 'The', - 'description': '

geometry whose resources should be freed

\n', + 'name': 'geometry', + 'description': '

The geometry whose resources should be freed

\n', 'type': 'p5.Geometry' } ], @@ -8111,6 +8121,18 @@ } ] }, + 'imageLight': { + 'name': 'imageLight', + 'params': [ + { + 'name': 'img', + 'description': '

image for the background

\n', + 'type': 'p5.image' + } + ], + 'class': 'p5', + 'module': '3D' + }, 'lights': { 'name': 'lights', 'class': 'p5', @@ -9420,7 +9442,7 @@ 'params': [ { 'name': 'parent', - 'description': '

the ID, DOM node, or p5.Element\n of desired parent element

\n', + 'description': '

ID, p5.Element,\n or HTMLElement of desired parent element.

\n', 'type': 'String|p5.Element|Object' } ], @@ -9441,7 +9463,7 @@ 'params': [ { 'name': 'id', - 'description': '

ID of the element

\n', + 'description': '

ID of the element.

\n', 'type': 'String' } ], @@ -9462,7 +9484,7 @@ 'params': [ { 'name': 'class', - 'description': '

class to add

\n', + 'description': '

class to add.

\n', 'type': 'String' } ], @@ -9479,7 +9501,7 @@ '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', + 'description': '

function to call when the mouse is\n pressed over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9491,7 +9513,7 @@ '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', + 'description': '

function to call when the mouse is\n double clicked over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9503,7 +9525,7 @@ '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', + 'description': '

function to call when the mouse wheel is\n scrolled over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9515,7 +9537,7 @@ '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', + 'description': '

function to call when the mouse is\n pressed over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9527,7 +9549,7 @@ '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', + 'description': '

function to call when the mouse is\n pressed and released over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9539,7 +9561,7 @@ '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', + 'description': '

function to call when the mouse\n moves over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9551,7 +9573,7 @@ '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', + 'description': '

function to call when the mouse\n moves onto the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9563,7 +9585,7 @@ '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', + 'description': '

function to call when the mouse\n moves off the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9575,7 +9597,7 @@ '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', + 'description': '

function to call when the touch\n starts.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9587,7 +9609,7 @@ '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', + 'description': '

function to call when the touch\n moves over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9599,7 +9621,7 @@ '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', + 'description': '

function to call when the touch\n ends.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9611,7 +9633,7 @@ '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', + 'description': '

function to call when the file is\n dragged over the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9623,7 +9645,7 @@ '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', + 'description': '

function to call when the file is\n dragged off the element.\n false disables the function.

\n', 'type': 'Function|Boolean' } ], @@ -9784,7 +9806,7 @@ 'params': [ { 'name': 'property', - 'description': '

property to be set

\n', + 'description': '

style property to set.

\n', 'type': 'String' } ] @@ -9798,7 +9820,7 @@ }, { 'name': 'value', - 'description': '

value to assign to property

\n', + 'description': '

value to assign to the property.

\n', 'type': 'String|p5.Color' } ], @@ -9819,12 +9841,12 @@ 'params': [ { 'name': 'attr', - 'description': '

attribute to set

\n', + 'description': '

attribute to set.

\n', 'type': 'String' }, { 'name': 'value', - 'description': '

value to assign to attribute

\n', + 'description': '

value to assign to the attribute.

\n', 'type': 'String' } ], @@ -9837,7 +9859,7 @@ 'params': [ { 'name': 'attr', - 'description': '

attribute to remove

\n', + 'description': '

attribute to remove.

\n', 'type': 'String' } ], @@ -9888,12 +9910,12 @@ 'params': [ { 'name': 'w', - 'description': '

width of the element, either AUTO, or a number

\n', + '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', + 'description': '

height of the element, either AUTO, or a number.

\n', 'type': 'Number|Constant', 'optional': true } @@ -9912,18 +9934,31 @@ 'params': [ { 'name': 'callback', - 'description': '

callback to receive loaded file, called for each file dropped.

\n', + 'description': '

called when a file loads. Called once for each file dropped.

\n', 'type': 'Function' }, { 'name': 'fxn', - 'description': '

callback triggered once when files are dropped with the drop event.

\n', + 'description': '

called once when any files are dropped.

\n', 'type': 'Function', 'optional': true } ], 'class': 'p5.Element', 'module': 'DOM' + }, + 'draggable': { + 'name': 'draggable', + 'params': [ + { + 'name': 'elmnt', + 'description': '

pass another p5.Element

\n', + 'type': 'p5.Element', + 'optional': true + } + ], + 'class': 'p5.Element', + 'module': 'DOM' } }, 'p5.Graphics': { @@ -10207,8 +10242,9 @@ 'params': [ { 'name': 'shouldAutoplay', - 'description': '

whether the element should autoplay

\n', - 'type': 'Boolean' + 'description': '

whether the element should autoplay.

\n', + 'type': 'Boolean', + 'optional': true } ], 'class': 'p5.MediaElement', @@ -10227,7 +10263,7 @@ 'params': [ { 'name': 'val', - 'description': '

volume between 0.0 and 1.0

\n', + 'description': '

volume between 0.0 and 1.0.

\n', 'type': 'Number' } ], @@ -10248,7 +10284,7 @@ 'params': [ { 'name': 'speed', - 'description': '

speed multiplier for element playback

\n', + 'description': '

speed multiplier for playback.

\n', 'type': 'Number' } ], @@ -10269,7 +10305,7 @@ 'params': [ { 'name': 'time', - 'description': '

time to jump to (in seconds)

\n', + 'description': '

time to jump to (in seconds).

\n', 'type': 'Number' } ], @@ -10287,7 +10323,7 @@ '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', + 'description': '

function to call when playback ends.\n The p5.MediaElement is passed as\n the argument.

\n', 'type': 'Function' } ], @@ -10326,17 +10362,17 @@ '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', + 'description': '

cue time to run 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', + 'description': '

function to call at the cue time.

\n', 'type': 'Function' }, { 'name': 'value', - 'description': '

An object to be passed as the\n second parameter to the\n callback function.

\n', + 'description': '

object to pass as the argument to\n callback.

\n', 'type': 'Object', 'optional': true } @@ -10349,7 +10385,7 @@ 'params': [ { 'name': 'id', - 'description': '

ID of the cue, as returned by addCue

\n', + 'description': '

ID of the cue, created by media.addCue().

\n', 'type': 'Number' } ], @@ -10358,13 +10394,6 @@ }, 'clearCues': { 'name': 'clearCues', - 'params': [ - { - 'name': 'id', - 'description': '

ID of the cue, as returned by addCue

\n', - 'type': 'Number' - } - ], 'class': 'p5.MediaElement', 'module': 'DOM' } @@ -13126,6 +13155,11 @@ } }, 'p5.Geometry': { + 'clearColors': { + 'name': 'clearColors', + 'class': 'p5.Geometry', + 'module': 'Shape' + }, 'computeFaces': { 'name': 'computeFaces', 'class': 'p5.Geometry', @@ -13133,6 +13167,20 @@ }, 'computeNormals': { 'name': 'computeNormals', + 'params': [ + { + 'name': 'shadingType', + 'description': '

shading type (FLAT for flat shading or SMOOTH for smooth shading) for buildGeometry() outputs. Defaults to FLAT.

\n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'options', + 'description': '

An optional object with configuration.

\n', + 'type': 'Object', + 'optional': true + } + ], 'class': 'p5.Geometry', 'module': 'Shape' }, @@ -52148,57 +52196,105 @@ var labelTableId = '_labelTable'; //Label Table var labelTableElId = '_lte_'; //Label Table Element /** - * Creates a screen reader accessible description for the canvas. - * The first parameter should be a string with a description of the canvas. - * The second parameter is optional. If specified, it determines how the - * description is displayed. + * Creates a screen reader-accessible description for the canvas. + * + * The first parameter, `text`, is the description of the canvas. * - * describe(text, LABEL) displays - * the description to all users as a - * tombstone or exhibit label/caption in a div - * adjacent to the canvas. You can style it as you wish in your CSS. + * The second parameter, `display`, is optional. It determines how the + * description is displayed. If `LABEL` is passed, as in + * `describe('A description.', LABEL)`, the description will be visible in + * a div element next to the canvas. If `FALLBACK` is passed, as in + * `describe('A description.', FALLBACK)`, the description will only be + * visible to screen readers. This is the default mode. * - * describe(text, FALLBACK) makes the - * description accessible to screen-reader users only, in - * - * a sub DOM inside the canvas element. If a second parameter is not - * specified, by default, the description will only be available to - * screen-reader users. + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. * * @method describe - * @param {String} text description of the canvas - * @param {Constant} [display] either LABEL or FALLBACK + * @param {String} text description of the canvas. + * @param {Constant} [display] either LABEL or FALLBACK. * * @example *
* - * describe('pink square with red heart in the bottom right corner'); - * background('pink'); - * fill('red'); - * noStroke(); - * ellipse(67, 67, 20, 20); - * ellipse(83, 67, 20, 20); - * triangle(91, 73, 75, 95, 59, 73); + * function setup() { + * background('pink'); + * + * // Draw a heart. + * fill('red'); + * noStroke(); + * circle(67, 67, 20); + * circle(83, 67, 20); + * triangle(91, 73, 75, 95, 59, 73); + * + * // Add a general description of the canvas. + * describe('A pink square with a red heart in the bottom-right corner.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background('pink'); + * + * // Draw a heart. + * fill('red'); + * noStroke(); + * circle(67, 67, 20); + * circle(83, 67, 20); + * triangle(91, 73, 75, 95, 59, 73); + * + * // Add a general description of the canvas + * // and display it for debugging. + * describe('A pink square with a red heart in the bottom-right corner.', LABEL); + * } * *
* *
* - * let x = 0; * function draw() { - * if (x > 100) { - * x = 0; - * } - * background(220); + * background(200); + * + * // The expression + * // frameCount % 100 + * // causes x to increase from 0 + * // to 99, then restart from 0. + * let x = frameCount % 100; + * + * // Draw the circle. * fill(0, 255, 0); - * ellipse(x, 50, 40, 40); - * x = x + 0.1; - * describe('green circle at x pos ' + round(x) + ' moving to the right'); + * circle(x, 50, 40); + * + * // Add a general description of the canvas. + * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`); * } * *
* + *
+ * + * function draw() { + * background(200); + * + * // The expression + * // frameCount % 100 + * // causes x to increase from 0 + * // to 99, then restart from 0. + * let x = frameCount % 100; + * + * // Draw the circle. + * fill(0, 255, 0); + * circle(x, 50, 40); + * + * // Add a general description of the canvas + * // and display it for debugging. + * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); + * } + * + *
*/ _main.default.prototype.describe = function (text, display) { _main.default._validateParameters('describe', arguments); @@ -52243,45 +52339,83 @@ } }; /** - * This function creates a screen-reader accessible - * description for elements —shapes or groups of shapes that create - * meaning together— in the canvas. The first paramater should - * be the name of the element. The second parameter should be a string - * with a description of the element. The third parameter is optional. - * If specified, it determines how the element description is displayed. + * Creates a screen reader-accessible description for elements in the canvas. + * Elements are shapes or groups of shapes that create meaning together. + * + * The first parameter, `name`, is the name of the element. + * + * The second parameter, `text`, is the description of the element. * - * describeElement(name, text, LABEL) - * displays the element description to all users as a - * - * tombstone or exhibit label/caption in a div - * adjacent to the canvas. You can style it as you wish in your CSS. + * The third parameter, `display`, is optional. It determines how the + * description is displayed. If `LABEL` is passed, as in + * `describe('A description.', LABEL)`, the description will be visible in + * a div element next to the canvas. Using `LABEL` creates unhelpful + * duplicates for screen readers. Only use `LABEL` during development. If + * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. * - * describeElement(name, text, FALLBACK) - * makes the element description accessible to screen-reader users - * only, in - * a sub DOM inside the canvas element. If a second parameter is not - * specified, by default, the element description will only be available - * to screen-reader users. + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. * * @method describeElement - * @param {String} name name of the element - * @param {String} text description of the element - * @param {Constant} [display] either LABEL or FALLBACK + * @param {String} name name of the element. + * @param {String} text description of the element. + * @param {Constant} [display] either LABEL or FALLBACK. * * @example *
* - * describe('Heart and yellow circle over pink background'); - * noStroke(); - * background('pink'); - * describeElement('Circle', 'Yellow circle in the top left corner'); - * fill('yellow'); - * ellipse(25, 25, 40, 40); - * describeElement('Heart', 'red heart in the bottom right corner'); - * fill('red'); - * ellipse(66.6, 66.6, 20, 20); - * ellipse(83.2, 66.6, 20, 20); - * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * function setup() { + * background('pink'); + * + * // Describe the first element + * // and draw it. + * describeElement('Circle', 'A yellow circle in the top-left corner.'); + * noStroke(); + * fill('yellow'); + * circle(25, 25, 40); + * + * // Describe the second element + * // and draw it. + * describeElement('Heart', 'A red heart in the bottom-right corner.'); + * fill('red'); + * circle(66.6, 66.6, 20); + * circle(83.2, 66.6, 20); + * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * + * // Add a general description of the canvas. + * describe('A red heart and yellow circle over a pink background.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background('pink'); + * + * // Describe the first element + * // and draw it. Display the + * // description for debugging. + * describeElement('Circle', 'A yellow circle in the top-left corner.', LABEL); + * noStroke(); + * fill('yellow'); + * circle(25, 25, 40); + * + * // Describe the second element + * // and draw it. Display the + * // description for debugging. + * describeElement('Heart', 'A red heart in the bottom-right corner.', LABEL); + * fill('red'); + * circle(66.6, 66.6, 20); + * circle(83.2, 66.6, 20); + * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * + * // Add a general description of the canvas. + * describe('A red heart and yellow circle over a pink background.'); + * } * *
*/ @@ -52711,62 +52845,119 @@ * @requires core */ /** - * textOutput() creates a screenreader - * accessible output that describes the shapes present on the canvas. - * The general description of the canvas includes canvas size, - * canvas color, and number of elements in the canvas - * (example: 'Your output is a, 400 by 400 pixels, lavender blue - * canvas containing the following 4 shapes:'). This description - * is followed by a list of shapes where the color, position, and area - * of each shape are described (example: "orange ellipse at top left - * covering 1% of the canvas"). Each element can be selected to get - * more details. A table of elements is also provided. In this table, - * shape, color, location, coordinates and area are described - * (example: "orange ellipse location=top left area=2"). - * - * textOutput() and textOutput(FALLBACK) - * make the output available in - * a sub DOM inside the canvas element which is accessible to screen readers. - * textOutput(LABEL) creates an - * additional div with the output adjacent to the canvas, this is useful - * for non-screen reader users that might want to display the output outside - * of the canvas' sub DOM as they code. However, using LABEL will create - * unnecessary redundancy for screen reader users. We recommend using LABEL - * only as part of the development process of a sketch and removing it before - * publishing or sharing with screen reader users. + * Creates a screen reader-accessible description for shapes on the canvas. + * `textOutput()` adds a general description, list of shapes, and + * table of shapes to the web page. + * + * The general description includes the canvas size, canvas color, and number + * of shapes. For example, + * `Your output is a, 100 by 100 pixels, gray canvas containing the following 2 shapes:`. + * + * A list of shapes follows the general description. The list describes the + * color, location, and area of each shape. For example, + * `a red circle at middle covering 3% of the canvas`. Each shape can be + * selected to get more details. + * + * `textOutput()` uses its table of shapes as a list. The table describes the + * shape, color, location, coordinates and area. For example, + * `red circle location = middle area = 3%`. This is different from + * gridOutput(), which uses its table as a grid. + * + * The `display` parameter is optional. It determines how the description is + * displayed. If `LABEL` is passed, as in `textOutput(LABEL)`, the description + * will be visible in a div element next to the canvas. Using `LABEL` creates + * unhelpful duplicates for screen readers. Only use `LABEL` during + * development. If `FALLBACK` is passed, as in `textOutput(FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. * * @method textOutput - * @param {Constant} [display] either FALLBACK or LABEL + * @param {Constant} [display] either FALLBACK or LABEL. * * @example *
* - * textOutput(); - * background(148, 196, 0); - * fill(255, 0, 0); - * ellipse(20, 20, 20, 20); - * fill(0, 0, 255); - * rect(50, 50, 50, 50); + * function setup() { + * // Add the text description. + * textOutput(); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } * *
* + *
+ * + * function setup() { + * // Add the text description and + * // display it for debugging. + * textOutput(LABEL); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
* *
* - * let x = 0; * function draw() { + * // Add the text description. * textOutput(); - * background(148, 196, 0); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; * fill(255, 0, 0); - * ellipse(x, 20, 20, 20); + * circle(x, 20, 20); * fill(0, 0, 255); - * rect(50, 50, 50, 50); - * ellipse(20, 20, 20, 20); - * x += 0.1; + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); * } * *
* + *
+ * + * function draw() { + * // Add the text description and + * // display it for debugging. + * textOutput(LABEL); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
*/ _main.default.prototype.textOutput = function (display) { @@ -52788,63 +52979,120 @@ } }; /** - * gridOutput() lays out the - * content of the canvas in the form of a grid (html table) based - * on the spatial location of each shape. A brief - * description of the canvas is available before the table output. - * This description includes: color of the background, size of the canvas, - * number of objects, and object types (example: "lavender blue canvas is - * 200 by 200 and contains 4 objects - 3 ellipses 1 rectangle"). The grid - * describes the content spatially, each element is placed on a cell of the - * table depending on its position. Within each cell an element the color - * and type of shape of that element are available (example: "orange ellipse"). - * These descriptions can be selected individually to get more details. - * A list of elements where shape, color, location, and area are described - * (example: "orange ellipse location=top left area=1%") is also available. - * - * gridOutput() and gridOutput(FALLBACK) - * make the output available in - * a sub DOM inside the canvas element which is accessible to screen readers. - * gridOutput(LABEL) creates an - * additional div with the output adjacent to the canvas, this is useful - * for non-screen reader users that might want to display the output outside - * of the canvas' sub DOM as they code. However, using LABEL will create - * unnecessary redundancy for screen reader users. We recommend using LABEL - * only as part of the development process of a sketch and removing it before - * publishing or sharing with screen reader users. + * Creates a screen reader-accessible description for shapes on the canvas. + * `gridOutput()` adds a general description, table of shapes, and list of + * shapes to the web page. + * + * The general description includes the canvas size, canvas color, and number of + * shapes. For example, + * `gray canvas, 100 by 100 pixels, contains 2 shapes: 1 circle 1 square`. + * + * `gridOutput()` uses its table of shapes as a grid. Each shape in the grid + * is placed in a cell whose row and column correspond to the shape's location + * on the canvas. The grid cells describe the color and type of shape at that + * location. For example, `red circle`. These descriptions can be selected + * individually to get more details. This is different from + * textOutput(), which uses its table as a list. + * + * A list of shapes follows the table. The list describes the color, type, + * location, and area of each shape. For example, + * `red circle, location = middle, area = 3 %`. + * + * The `display` parameter is optional. It determines how the description is + * displayed. If `LABEL` is passed, as in `gridOutput(LABEL)`, the description + * will be visible in a div element next to the canvas. Using `LABEL` creates + * unhelpful duplicates for screen readers. Only use `LABEL` during + * development. If `FALLBACK` is passed, as in `gridOutput(FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. * * @method gridOutput - * @param {Constant} [display] either FALLBACK or LABEL + * @param {Constant} [display] either FALLBACK or LABEL. * * @example *
* - * gridOutput(); - * background(148, 196, 0); - * fill(255, 0, 0); - * ellipse(20, 20, 20, 20); - * fill(0, 0, 255); - * rect(50, 50, 50, 50); + * function setup() { + * // Add the grid description. + * gridOutput(); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } * *
* + *
+ * + * function setup() { + * // Add the grid description and + * // display it for debugging. + * gridOutput(LABEL); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
* *
* - * let x = 0; * function draw() { + * // Add the grid description. * gridOutput(); - * background(148, 196, 0); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; * fill(255, 0, 0); - * ellipse(x, 20, 20, 20); + * circle(x, 20, 20); * fill(0, 0, 255); - * rect(50, 50, 50, 50); - * ellipse(20, 20, 20, 20); - * x += 0.1; + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); * } * *
* + *
+ * + * function draw() { + * // Add the grid description and + * // display it for debugging. + * gridOutput(LABEL); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
*/ _main.default.prototype.gridOutput = function (display) { _main.default._validateParameters('gridOutput', arguments); @@ -56710,7 +56958,7 @@ value: true }); exports.QUADRATIC = exports.LINEAR = exports._CTX_MIDDLE = exports._DEFAULT_LEADMULT = exports._DEFAULT_TEXT_FILL = exports.WORD = exports.CHAR = exports.BOLDITALIC = exports.BOLD = exports.ITALIC = exports.NORMAL = exports.BLUR = exports.ERODE = exports.DILATE = exports.POSTERIZE = exports.INVERT = exports.OPAQUE = exports.GRAY = exports.THRESHOLD = exports.BURN = exports.DODGE = exports.SOFT_LIGHT = exports.HARD_LIGHT = exports.OVERLAY = exports.REPLACE = exports.SCREEN = exports.MULTIPLY = exports.EXCLUSION = exports.SUBTRACT = exports.DIFFERENCE = exports.LIGHTEST = exports.DARKEST = exports.ADD = exports.REMOVE = exports.BLEND = exports.UP_ARROW = exports.TAB = exports.SHIFT = exports.RIGHT_ARROW = exports.RETURN = exports.OPTION = exports.LEFT_ARROW = exports.ESCAPE = exports.ENTER = exports.DOWN_ARROW = exports.DELETE = exports.CONTROL = exports.BACKSPACE = exports.ALT = exports.AUTO = exports.HSL = exports.HSB = exports.RGB = exports.MITER = exports.BEVEL = exports.ROUND = exports.SQUARE = exports.PROJECT = exports.PIE = exports.CHORD = exports.OPEN = exports.CLOSE = exports.TESS = exports.QUAD_STRIP = exports.QUADS = exports.TRIANGLE_STRIP = exports.TRIANGLE_FAN = exports.TRIANGLES = exports.LINE_LOOP = exports.LINE_STRIP = exports.LINES = exports.POINTS = exports.BASELINE = exports.BOTTOM = exports.TOP = exports.CENTER = exports.LEFT = exports.RIGHT = exports.RADIUS = exports.CORNERS = exports.CORNER = exports.RAD_TO_DEG = exports.DEG_TO_RAD = exports.RADIANS = exports.DEGREES = exports.TWO_PI = exports.TAU = exports.QUARTER_PI = exports.PI = exports.HALF_PI = exports.WAIT = exports.TEXT = exports.MOVE = exports.HAND = exports.CROSS = exports.ARROW = exports.WEBGL2 = exports.WEBGL = exports.P2D = exports.VERSION = void 0; - exports.RGBA = exports.HALF_FLOAT = exports.FLOAT = exports.UNSIGNED_INT = exports.UNSIGNED_BYTE = exports.COVER = exports.CONTAIN = exports.FALLBACK = exports.LABEL = exports.AXES = exports.GRID = exports._DEFAULT_FILL = exports._DEFAULT_STROKE = exports.PORTRAIT = exports.LANDSCAPE = exports.MIRROR = exports.CLAMP = exports.REPEAT = exports.NEAREST = exports.IMAGE = exports.IMMEDIATE = exports.TEXTURE = exports.FILL = exports.STROKE = exports.CURVE = exports.BEZIER = void 0; + exports.RGBA = exports.HALF_FLOAT = exports.FLOAT = exports.UNSIGNED_INT = exports.UNSIGNED_BYTE = exports.COVER = exports.CONTAIN = exports.FALLBACK = exports.LABEL = exports.AXES = exports.GRID = exports._DEFAULT_FILL = exports._DEFAULT_STROKE = exports.PORTRAIT = exports.LANDSCAPE = exports.SMOOTH = exports.FLAT = exports.MIRROR = exports.CLAMP = exports.REPEAT = exports.NEAREST = exports.IMAGE = exports.IMMEDIATE = exports.TEXTURE = exports.FILL = exports.STROKE = exports.CURVE = exports.BEZIER = void 0; /** * @module Constants * @submodule Constants @@ -56722,7 +56970,7 @@ * @property {String} VERSION * @final */ - var VERSION = '1.8.0'; + var VERSION = '1.9.0'; // GRAPHICS RENDERER /** * The default, two-dimensional renderer. @@ -57512,12 +57760,25 @@ */ exports.CLAMP = CLAMP; var MIRROR = 'mirror'; + // WEBGL GEOMETRY SHADING + /** + * @property {String} FLAT + * @final + */ + exports.MIRROR = MIRROR; + var FLAT = 'flat'; + /** + * @property {String} SMOOTH + * @final + */ + exports.FLAT = FLAT; + var SMOOTH = 'smooth'; // DEVICE-ORIENTATION /** * @property {String} LANDSCAPE * @final */ - exports.MIRROR = MIRROR; + exports.SMOOTH = SMOOTH; var LANDSCAPE = 'landscape'; /** * @property {String} PORTRAIT @@ -57725,28 +57986,35 @@ var _windowPrint = window.print; var windowPrintDisabled = false; /** - * The print() function writes to the console area of - * your browser. This function is often helpful for looking at the data a program - * is producing. This function creates a new line of text for each call to - * the function. Individual elements can be separated with quotes ("") and joined - * with the addition operator (+). + * Displays text in the web browser's console. + * + * `print()` is helpful for printing values while debugging. Each call to + * `print()` creates a new line of text. * - * Note that calling print() without any arguments invokes the window.print() - * function which opens the browser's print dialog. To print a blank line - * to console you can write print('\n'). + * Note: Call `print('\n')` to print a blank line. Calling `print()` without + * an argument opens the browser's dialog for printing documents. * * @method print - * @param {Any} contents any combination of Number, String, Object, Boolean, - * Array to print + * @param {Any} contents content to print to the console. * @example - *
- * let x = 10; - * print('The value of x is ' + x); - * // prints "The value of x is 10" - *
+ *
+ * + * function setup() { + * // Prints "hello, world" to the console. + * print('hello, world'); + * } + * + *
* - * @alt - * default grey canvas + *
+ * + * function setup() { + * let name = 'ada'; + * // Prints "hello, ada" to the console. + * print(`hello, ${name}`); + * } + * + *
*/ _main.default.prototype.print = function () { if (!arguments.length) { @@ -57762,132 +58030,172 @@ } }; /** - * The system variable frameCount contains the - * number of frames that have been displayed since the program started. Inside - * setup() the value is 0, after the first iteration - * of draw() it is 1, etc. + * Tracks the number of frames drawn since the sketch started. + * + * `frameCount`'s value is 0 inside setup(). It + * increments by 1 each time the code in draw() + * finishes executing. * * @property {Integer} frameCount * @readOnly * @example - *
+ *
+ * + * function setup() { + * background(200); + * + * // Display the value of + * // frameCount. + * textSize(30); + * textAlign(CENTER, CENTER); + * text(frameCount, 50, 50); + * + * describe('The number 0 written in black in the middle of a gray square.'); + * } + * + *
+ * + *
+ * * function setup() { + * // Set the frameRate to 30. * frameRate(30); + * * textSize(30); - * textAlign(CENTER); + * textAlign(CENTER, CENTER); * } * * function draw() { * background(200); - * text(frameCount, width / 2, height / 2); - * } - *
* - * @alt - * numbers rapidly counting upward with frame count set to 30. + * // Display the value of + * // frameCount. + * text(frameCount, 50, 50); + * + * describe('A number written in black in the middle of a gray square. Its value increases rapidly.'); + * } + *
+ *
*/ _main.default.prototype.frameCount = 0; /** - * The system variable deltaTime contains the time - * difference between the beginning of the previous frame and the beginning - * of the current frame in milliseconds. - * - * This variable is useful for creating time sensitive animation or physics - * calculation that should stay constant regardless of frame rate. + * Tracks the amount of time, in milliseconds, it took for + * draw to draw the previous frame. `deltaTime` is + * useful for simulating physics. * * @property {Integer} deltaTime * @readOnly * @example - *
- * let rectX = 0; - * let fr = 30; //starting FPS - * let clr; + *
+ * + * let x = 0; + * let speed = 0.05; * - * function setup() { - * background(200); - * frameRate(fr); // Attempt to refresh at starting FPS - * clr = color(255, 0, 0); + * function setup() { + * // Set the frameRate to 30. + * frameRate(30); * } * * function draw() { * background(200); - * rectX = rectX + 1 * (deltaTime / 50); // Move Rectangle in relation to deltaTime - * - * if (rectX >= width) { - * // If you go off screen. - * if (fr === 30) { - * clr = color(0, 0, 255); - * fr = 10; - * frameRate(fr); // make frameRate 10 FPS - * } else { - * clr = color(255, 0, 0); - * fr = 30; - * frameRate(fr); // make frameRate 30 FPS - * } - * rectX = 0; + * + * // Use deltaTime to calculate + * // a change in position. + * let deltaX = speed * deltaTime; + * + * // Update the x variable. + * x += deltaX; + * + * // Reset x to 0 if it's + * // greater than 100. + * if (x > 100) { + * x = 0; * } - * fill(clr); - * rect(rectX, 40, 20, 20); - * } - *
* - * @alt - * red rect moves left to right, followed by blue rect moving at the same speed - * with a lower frame rate. Loops. + * // Use x to set the circle's + * // position. + * circle(x, 50, 20); + * + * describe('A white circle moves from left to right on a gray background. It reappears on the left side when it reaches the right side.'); + * } + *
+ *
*/ _main.default.prototype.deltaTime = 0; /** - * Confirms if the window a p5.js program is in is "focused," meaning that - * the sketch will accept mouse or keyboard input. This variable is - * "true" if the window is focused and "false" if not. + * Tracks whether the browser window is focused and can receive user input. + * `focused` is `true` if the window if focused and `false` if not. * * @property {Boolean} focused * @readOnly * @example - *
- * // To demonstrate, put two windows side by side. - * // Click on the window that the p5 sketch isn't in! + *
+ * + * // Open this example in two separate browser + * // windows placed side-by-side to demonstrate. + * * function draw() { - * background(200); - * noStroke(); - * fill(0, 200, 0); - * ellipse(25, 25, 50, 50); - * - * if (!focused) { - // or "if (focused === false)" - * stroke(200, 0, 0); - * line(0, 0, 100, 100); - * line(100, 0, 0, 100); + * // Change the background color + * // when the browser window + * // goes in/out of focus. + * if (focused === true) { + * background(0, 255, 0); + * } else { + * background(255, 0, 0); * } - * } - *
* - * @alt - * green 50×50 ellipse at top left. Red X covers canvas when page focus changes + * describe('A square changes color from green to red when the browser window is out of focus.'); + * } + *
+ *
*/ _main.default.prototype.focused = document.hasFocus(); /** - * Sets the cursor to a predefined symbol or an image, or makes it visible - * if already hidden. If you are trying to set an image as the cursor, the - * recommended size is 16×16 or 32×32 pixels. The values for parameters x and y - * must be less than the dimensions of the image. + * Changes the cursor's appearance. + * + * The first parameter, `type`, sets the type of cursor to display. The + * built-in options are `ARROW`, `CROSS`, `HAND`, `MOVE`, `TEXT`, and `WAIT`. + * `cursor()` also recognizes standard CSS cursor properties passed as + * strings: `'help'`, `'wait'`, `'crosshair'`, `'not-allowed'`, `'zoom-in'`, + * and `'grab'`. If the path to an image is passed, as in + * `cursor('assets/target.png')`, then the image will be used as the cursor. + * Images must be in .cur, .gif, .jpg, .jpeg, or .png format. + * + * The parameters `x` and `y` are optional. If an image is used for the + * cursor, `x` and `y` set the location pointed to within the image. They are + * both 0 by default, so the cursor points to the image's top-left corner. `x` + * and `y` must be less than the image's width and height, respectively. * * @method cursor - * @param {String|Constant} type Built-In: either ARROW, CROSS, HAND, MOVE, TEXT and WAIT - * Native CSS properties: 'grab', 'progress', 'cell' etc. - * External: path for cursor's images - * (Allowed File extensions: .cur, .gif, .jpg, .jpeg, .png) - * For more information on Native CSS cursors and url visit: - * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor - * @param {Number} [x] the horizontal active spot of the cursor (must be less than 32) - * @param {Number} [y] the vertical active spot of the cursor (must be less than 32) + * @param {String|Constant} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT. + * Native CSS properties: 'grab', 'progress', and so on. + * Path to cursor image. + * @param {Number} [x] horizontal active spot of the cursor. + * @param {Number} [y] vertical active spot of the cursor. * @example - *
- * // Move the mouse across the quadrants - * // to see the cursor change + *
+ * + * function draw() { + * background(200); + * + * // Set the cursor to crosshairs: + + * cursor(CROSS); + * + * describe('A gray square. The cursor appears as crosshairs.'); + * } + * + *
+ * + *
+ * * function draw() { - * line(width / 2, 0, width / 2, height); - * line(0, height / 2, width, height / 2); + * background(200); + * + * // Divide the canvas into quadrants. + * line(50, 0, 50, 100); + * line(0, 50, 100, 50); + * + * // Change cursor based on mouse position. * if (mouseX < 50 && mouseY < 50) { * cursor(CROSS); * } else if (mouseX > 50 && mouseY < 50) { @@ -57897,12 +58205,29 @@ * } else { * cursor('grab'); * } + * + * describe('A gray square divided into quadrants. The cursor image changes when the mouse moves to each quadrant.'); * } - *
+ *
+ *
* - * @alt - * canvas is divided into four quadrants. cursor on first is a cross, second is a progress, - * third is a custom cursor using path to the cursor and fourth is a grab. + *
+ * + * function draw() { + * background(200); + * + * // Change the cursor's active spot + * // when the mouse is pressed. + * if (mouseIsPressed === true) { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16', 8, 8); + * } else { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); + * } + * + * describe('An image of three purple curves follows the mouse. The image shifts when the mouse is pressed.'); + * } + * + *
*/ _main.default.prototype.cursor = function (type, x, y) { var cursor = 'auto'; @@ -57931,71 +58256,74 @@ canvas.style.cursor = cursor; }; /** - * Specifies the number of frames to be displayed every second. For example, - * the function call frameRate(30) will attempt to refresh 30 times a second. - * If the processor is not fast enough to maintain the specified rate, the - * frame rate will not be achieved. Setting the frame rate within - * setup() is recommended. The default frame rate is - * based on the frame rate of the display (here also called "refresh rate"), - * which is set to 60 frames per second on most computers. A frame rate of 24 - * frames per second (usual for movies) or above will be enough for smooth - * animations. This is the same as setFrameRate(val). - * - * Calling frameRate() with no arguments or - * with arguments that are not of type Number or are non-positive returns - * an approximation of the current frame rate. The draw function must run at - * least once before it will return a value. - * - * Even if the code in your draw() function consistently produces frames in time - * for them to be displayed at the desired frame rate, the value frameRate() returns - * will vary frame to frame because it's an inaccurate approximation. To accurately - * test the performance of your sketches, use your browser's performance profiling tools. + * Sets the number of frames to draw per second. + * + * Calling `frameRate()` with one numeric argument, as in `frameRate(30)`, + * attempts to draw 30 frames per second (FPS). The target frame rate may not + * be achieved depending on the sketch's processing needs. Most computers + * default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are + * fast enough for smooth animations. + * + * Calling `frameRate()` without an argument returns the current frame rate. + * The value returned is an approximation. * * @method frameRate - * @param {Number} fps number of frames to be displayed every second + * @param {Number} fps number of frames to draw per second. * @chainable * * @example + *
+ * + * function draw() { + * background(200); * - *
- * let rectX = 0; - * let fr = 30; //starting FPS - * let clr; + * // Set the x variable based + * // on the current frameCount. + * let x = frameCount % 100; * - * function setup() { - * background(200); - * frameRate(fr); // Attempt to refresh at starting FPS - * clr = color(255, 0, 0); + * // If the mouse is pressed, + * // decrease the frame rate. + * if (mouseIsPressed === true) { + * frameRate(10); + * } else { + * frameRate(60); + * } + * + * // Use x to set the circle's + * // position. + * circle(x, 50, 20); + * + * describe('A white circle on a gray background. The circle moves from left to right in a loop. It slows down when the mouse is pressed.'); * } + * + *
* + *
+ * * function draw() { * background(200); - * rectX += 1; // Move Rectangle - * - * if (rectX >= width) { - * // If you go off screen. - * if (fr === 30) { - * clr = color(0, 0, 255); - * fr = 10; - * frameRate(fr); // make frameRate 10 FPS - * } else { - * clr = color(255, 0, 0); - * fr = 30; - * frameRate(fr); // make frameRate 30 FPS + * + * // If the mouse is pressed, do lots + * // of math to slow down drawing. + * if (mouseIsPressed === true) { + * for (let i = 0; i < 1000000; i += 1) { + * random(); * } - * rectX = 0; * } - * fill(clr); - * rect(rectX, 40, 20, 20); - * } - *
* - * @alt - * blue rect moves left to right, followed by red rect moving faster. Loops. + * // Get the current frame rate + * // and display it. + * let fps = frameRate(); + * text(fps, 50, 50); + * + * describe('A number written in black written on a gray background. The number decreases when the mouse is pressed.'); + * } + *
+ *
*/ /** * @method frameRate - * @return {Number} current frameRate + * @return {Number} current frame rate. */ _main.default.prototype.frameRate = function (fps) { _main.default._validateParameters('frameRate', arguments); @@ -58025,7 +58353,7 @@ * frame rate will not be achieved. Setting the frame rate within setup() is * recommended. The default rate is 60 frames per second. * - * Calling frameRate() with no arguments returns the current framerate. + * Calling `frameRate()` with no arguments returns the current frame rate. * * @private * @param {Number} [fps] number of frames to be displayed every second @@ -58034,18 +58362,29 @@ return this.frameRate(fps); }; /** - * Returns _targetFrameRate variable. The default _targetFrameRate is set to 60. - * This could be changed by calling frameRate() and setting it to the desired - * value. When getTargetFrameRate() is called, it should return the value that was set. + * Returns the target frame rate. The value is either the system frame rate or + * the last value passed to frameRate(). + * * @method getTargetFrameRate * @return {Number} _targetFrameRate * @example - *
+ *
+ * * function draw() { + * background(200); + * + * // Set the frame rate to 20. * frameRate(20); - * text(getTargetFrameRate(), width / 2, height / 2); + * + * // Get the target frame rate and + * // display it. + * let fps = getTargetFrameRate(); + * text(fps, 43, 54); + * + * describe('The number 20 written in black on a gray background.'); * } - *
+ *
+ *
*/ _main.default.prototype.getTargetFrameRate = function () { return this._targetFrameRate; @@ -58055,165 +58394,271 @@ * * @method noCursor * @example - *
+ *
+ * * function setup() { + * // Hide the cursor. * noCursor(); * } * * function draw() { * background(200); - * ellipse(mouseX, mouseY, 10, 10); - * } - *
* - * @alt - * cursor becomes 10×10 white ellipse the moves with mouse x and y. + * circle(mouseX, mouseY, 10); + * + * describe('A white circle on a gray background. The circle follows the mouse as it moves. The cursor is hidden.'); + * } + *
+ *
*/ _main.default.prototype.noCursor = function () { this._curElement.elt.style.cursor = 'none'; }; /** - * If the sketch was created in WebGL mode, then `weglVersion` will indicate - * which version of WebGL it is using. It will try to create a WebGL2 canvas - * unless you have requested WebGL1 via `setAttributes({ version: 1 })`, and - * will fall back to WebGL1 if WebGL2 is not available. + * A string variable with the WebGL version in use. Its value equals one of + * the followin string constants: + * + * - `WEBGL2` whose value is `'webgl2'`, + * - `WEBGL` whose value is `'webgl'`, or + * - `P2D` whose value is `'p2d'`. This is the default for 2D sketches. + * + * See setAttributes() for ways to set the + * WebGL version. * - * `webglVersion` will always be either `WEBGL2`, `WEBGL`, or `P2D` if not in - * WebGL mode. * @property {String} webglVersion * @readOnly * @example - *
- * let myFont; + *
+ * + * function setup() { + * background(200); + * + * // Display the current WebGL version. + * text(webglVersion, 42, 54); + * + * describe('The text "p2d" written in black on a gray background.'); + * } + * + *
+ * + *
+ * + * let font; + * * function preload() { - * myFont = loadFont('assets/inconsolata.otf'); + * // Load a font to use. + * font = loadFont('assets/inconsolata.otf'); * } + * * function setup() { + * // Create a canvas using WEBGL mode. * createCanvas(100, 50, WEBGL); - * // Uncomment the following line to see the behavior change in WebGL 1: - * // setAttributes({ version: 1 }) - * - * const graphic = createGraphics(30, 30); - * graphic.background(255); - * graphic.noStroke(); - * graphic.fill(200); - * graphic.rect(0, 0, graphic.width/2, graphic.height/2); - * graphic.rect( - * graphic.width/2, graphic.height/2, - * graphic.width/2, graphic.height/2 - * ); - * - * noStroke(); - * translate(-width/2, -height/2); - * textureWrap(REPEAT); - * texture(graphic); - * beginShape(QUADS); - * vertex(0, 0, 0, 0, 0); - * vertex(width, 0, 0, width, 0); - * vertex(width, height, 0, width, height); - * vertex(0, height, 0, 0, height); - * endShape(); + * background(200); * - * textFont(myFont); - * textAlign(CENTER, CENTER); - * textSize(30); + * // Display the current WebGL version. * fill(0); - * text('WebGL' + (webglVersion === WEBGL2 ? 2 : 1), 0, 0, width, height); + * textFont(font); + * text(webglVersion, -15, 5); + * + * describe('The text "webgl2" written in black on a gray background.'); * } - *
+ *
+ *
* - * @alt - * This example writes either 'WebGL1' or 'WebGL2' on the canvas, depending on - * the capabilities of the device it runs on. If it says WebGL2, the background - * will be checkered. Otherwise, the background will have just one checker tile - * with colors stretched to the edges of the canvas. + *
+ * + * let font; + * + * function preload() { + * // Load a font to use. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * // Create a canvas using WEBGL mode. + * createCanvas(100, 50, WEBGL); + * + * // Set WebGL to version 1. + * setAttributes({ version: 1 }); + * + * background(200); + * + * // Display the current WebGL version. + * fill(0); + * textFont(font); + * text(webglVersion, -14, 5); + * + * describe('The text "webgl" written in black on a gray background.'); + * } + * + *
*/ _main.default.prototype.webglVersion = C.P2D; /** - * System variable that stores the width of the screen display according to The - * default pixelDensity. This is used to run a - * full-screen program on any display size. To return actual screen size, - * multiply this by pixelDensity. + * A numeric variable that stores the width of the screen display. Its value + * depends on the current pixelDensity(). + * `displayWidth` is useful for running full-screen programs. + * + * Note: The actual screen width can be computed as + * `displayWidth * pixelDensity()`. * * @property {Number} displayWidth * @readOnly * @example - *
- * createCanvas(displayWidth, displayHeight); - *
+ *
+ * + * function setup() { + * // Set the canvas' width and height + * // using the display's dimensions. + * createCanvas(displayWidth, displayHeight); + * + * background(200); + * + * describe('A gray canvas that is the same size as the display.'); + * } + * + *
* * @alt * This example does not render anything. */ _main.default.prototype.displayWidth = screen.width; /** - * System variable that stores the height of the screen display according to The - * default pixelDensity. This is used to run a - * full-screen program on any display size. To return actual screen size, - * multiply this by pixelDensity. + * A numeric variable that stores the height of the screen display. Its value + * depends on the current pixelDensity(). + * `displayHeight` is useful for running full-screen programs. + * + * Note: The actual screen height can be computed as + * `displayHeight * pixelDensity()`. * * @property {Number} displayHeight * @readOnly * @example - *
- * createCanvas(displayWidth, displayHeight); - *
+ *
+ * + * function setup() { + * // Set the canvas' width and height + * // using the display's dimensions. + * createCanvas(displayWidth, displayHeight); + * + * background(200); + * + * describe('A gray canvas that is the same size as the display.'); + * } + * + *
* * @alt * This example does not render anything. */ _main.default.prototype.displayHeight = screen.height; /** - * System variable that stores the width of the inner window, it maps to - * window.innerWidth. + * A numeric variable that stores the width of the browser's + * layout viewport. + * This viewport is the area within the browser that's available for drawing. * * @property {Number} windowWidth * @readOnly * @example - *
- * createCanvas(windowWidth, windowHeight); - *
+ *
+ * + * function setup() { + * // Set the canvas' width and height + * // using the browser's dimensions. + * createCanvas(windowWidth, windowHeight); + * + * background(200); + * + * describe('A gray canvas that takes up the entire browser window.'); + * } + * + *
* * @alt * This example does not render anything. */ _main.default.prototype.windowWidth = getWindowWidth(); /** - * System variable that stores the height of the inner window, it maps to - * window.innerHeight. + * A numeric variable that stores the height of the browser's + * layout viewport. + * This viewport is the area within the browser that's available for drawing. * * @property {Number} windowHeight * @readOnly * @example - *
- * createCanvas(windowWidth, windowHeight); - *
+ *
+ * + * function setup() { + * // Set the canvas' width and height + * // using the browser's dimensions. + * createCanvas(windowWidth, windowHeight); + * + * background(200); + * + * describe('A gray canvas that takes up the entire browser window.'); + * } + * + *
* * @alt * This example does not render anything. */ _main.default.prototype.windowHeight = getWindowHeight(); /** - * The windowResized() function is called once - * every time the browser window is resized. This is a good place to resize the - * canvas or do any other adjustments to accommodate the new window size. + * The code in `windowResized()` is called once each time the browser window + * is resized. It's a good place to resize the canvas or make other + * adjustments to accommodate the new window size. + * + * The `event` parameter is optional. If added to the function definition, it + * can be used for debugging or other purposes. * * @method windowResized - * @param {UIEvent} [event] optional Event callback argument. + * @param {UIEvent} [event] optional resize Event. * @example - *
+ *
+ * * function setup() { * createCanvas(windowWidth, windowHeight); * } * * function draw() { - * background(0, 100, 200); + * background(200); + * + * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); * } * + * // Resize the canvas when the + * // browser's size changes. * function windowResized() { * resizeCanvas(windowWidth, windowHeight); * } - *
+ *
+ *
+ * @alt + * This example does not render anything. + * + *
+ * + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(200); + * + * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); + * } + * + * function windowResized(event) { + * // Resize the canvas when the + * // browser's size changes. + * resizeCanvas(windowWidth, windowHeight); + * + * // Print the resize event to the console for debugging. + * print(event); + * } + * + *
* @alt * This example does not render anything. */ @@ -58235,11 +58680,68 @@ function getWindowHeight() { return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight || 0; } /** - * System variable that stores the width of the drawing canvas. This value - * is set by the first parameter of the createCanvas() function. - * For example, the function call createCanvas(320, 240) sets the width - * variable to the value 320. The value of width defaults to 100 if - * createCanvas() is not used in a program. + * A numeric variable that stores the width of the drawing canvas. Its + * default value is 100. + * + * Calling createCanvas() or + * resizeCanvas() changes the value of + * `width`. Calling noCanvas() sets its value to + * 0. + * + * @example + *
+ * + * function setup() { + * background(200); + * + * // Display the canvas' width. + * text(width, 42, 54); + * + * describe('The number 100 written in black on a gray square.'); + * } + * + *
+ * + *
+ * + * function setup() { + * createCanvas(50, 100); + * + * background(200); + * + * // Display the canvas' width. + * text(width, 21, 54); + * + * describe('The number 50 written in black on a gray rectangle.'); + * } + * + *
+ * + *
+ * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Display the canvas' width. + * text(width, 42, 54); + * + * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); + * } + * + * // If the mouse is pressed, reisze + * // the canvas and display its new + * // width. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * resizeCanvas(50, 100); + * background(200); + * text(width, 42, 27); + * } + * } + * + *
* * @property {Number} width * @readOnly @@ -58247,45 +58749,107 @@ _main.default.prototype.width = 0; /** - * System variable that stores the height of the drawing canvas. This value - * is set by the second parameter of the createCanvas() function. For - * example, the function call createCanvas(320, 240) sets the height - * variable to the value 240. The value of height defaults to 100 if - * createCanvas() is not used in a program. + * A numeric variable that stores the height of the drawing canvas. Its + * default value is 100. + * + * Calling createCanvas() or + * resizeCanvas() changes the value of + * `height`. Calling noCanvas() sets its value to + * 0. + * + * @example + *
+ * + * function setup() { + * background(200); + * + * // Display the canvas' height. + * text(height, 42, 54); + * + * describe('The number 100 written in black on a gray square.'); + * } + * + *
+ * + *
+ * + * function setup() { + * createCanvas(100, 50); + * + * background(200); + * + * // Display the canvas' height. + * text(height, 21, 54); + * + * describe('The number 50 written in black on a gray rectangle.'); + * } + * + *
+ * + *
+ * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Display the canvas' height. + * text(height, 42, 54); + * + * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); + * } + * + * // If the mouse is pressed, reisze + * // the canvas and display its new + * // height. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * resizeCanvas(100, 50); + * background(200); + * text(height, 42, 27); + * } + * } + * + *
* * @property {Number} height * @readOnly */ _main.default.prototype.height = 0; /** - * If argument is given, sets the sketch to fullscreen or not based on the - * value of the argument. If no argument is given, returns the current - * fullscreen state. Note that due to browser restrictions this can only - * be called on user input, for example, on mouse press like the example - * below. + * Toggles full-screen mode or returns the current mode. + * + * Calling `fullscreen(true)` makes the sketch full-screen. Calling + * `fullscreen(false)` makes the sketch its original size. + * + * Calling `fullscreen()` without an argument returns `true` if the sketch + * is in full-screen mode and `false` if not. + * + * Note: Due to browser restrictions, `fullscreen()` can only be called with + * user input such as a mouse press. * * @method fullscreen - * @param {Boolean} [val] whether the sketch should be in fullscreen mode - * or not - * @return {Boolean} current fullscreen state + * @param {Boolean} [val] whether the sketch should be in fullscreen mode. + * @return {Boolean} current fullscreen state. * @example *
* - * // Clicking in the box toggles fullscreen on and off. * function setup() { * background(200); + * + * describe('A gray canvas that switches between default and full-screen display when clicked.'); * } + * + * // If the mouse is pressed, + * // toggle full-screen mode. * function mousePressed() { - * if (mouseX > 0 && mouseX < 100 && mouseY > 0 && mouseY < 100) { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { * let fs = fullscreen(); * fullscreen(!fs); * } * } * *
- * - * @alt - * This example does not render anything. */ _main.default.prototype.fullscreen = function (val) { _main.default._validateParameters('fullscreen', arguments); @@ -58302,22 +58866,31 @@ } }; /** - * Sets the pixel scaling for high pixel density displays. By default - * pixel density is set to match display density, call pixelDensity(1) - * to turn this off. Calling pixelDensity() with no arguments returns - * the current pixel density of the sketch. + * Sets the pixel scaling for high pixel density displays. + * + * By default, the pixel density is set to match display density. Calling + * `pixelDensity(1)` turn this off. + * + * Calling `pixelDensity()` without an argument returns the current pixel + * density. * * @method pixelDensity - * @param {Number} val whether or how much the sketch should scale + * @param {Number} [val] desired pixel density. * @chainable * @example *
* * function setup() { + * // Set the pixel density to 1. * pixelDensity(1); + * + * // Create a canvas and draw + * // a circle. * createCanvas(100, 100); * background(200); - * ellipse(width / 2, height / 2, 50, 50); + * circle(50, 50, 70); + * + * describe('A fuzzy white circle on a gray canvas.'); * } * *
@@ -58325,21 +58898,24 @@ *
* * function setup() { - * pixelDensity(3.0); + * // Set the pixel density to 3. + * pixelDensity(3); + * + * // Create a canvas, paint the + * // background, and draw a + * // circle. * createCanvas(100, 100); * background(200); - * ellipse(width / 2, height / 2, 50, 50); + * circle(50, 50, 70); + * + * describe('A sharp white circle on a gray canvas.'); * } * *
- * - * @alt - * fuzzy 50×50 white ellipse with black outline in center of canvas. - * sharp 50×50 white ellipse with black outline in center of canvas. */ /** * @method pixelDensity - * @returns {Number} current pixel density of the sketch + * @returns {Number} current pixel density of the sketch. */ _main.default.prototype.pixelDensity = function (val) { _main.default._validateParameters('pixelDensity', arguments); @@ -58356,25 +58932,41 @@ return returnValue; }; /** - * Returns the pixel density of the current display the sketch is running on. + * Returns the display's current pixel density. * * @method displayDensity - * @returns {Number} current pixel density of the display + * @returns {Number} current pixel density of the display. * @example *
* * function setup() { - * let density = displayDensity(); - * pixelDensity(density); + * // Set the pixel density to 1. + * pixelDensity(1); + * + * // Create a canvas and draw + * // a circle. * createCanvas(100, 100); * background(200); - * ellipse(width / 2, height / 2, 50, 50); + * circle(50, 50, 70); + * + * describe('A fuzzy white circle drawn on a gray background. The circle becomes sharper when the mouse is pressed.'); + * } + * + * function mousePressed() { + * // Get the current display density. + * let d = displayDensity(); + * + * // Use the display density to set + * // the sketch's pixel density. + * pixelDensity(d); + * + * // Paint the background and + * // draw a circle. + * background(200); + * circle(50, 50, 70); * } * *
- * - * @alt - * 50×50 white ellipse with black outline in center of canvas. */ _main.default.prototype.displayDensity = function () { return window.devicePixelRatio; @@ -58405,58 +58997,62 @@ document.msExitFullscreen(); } } /** - * Gets the current URL. Note: when using the - * p5 Editor, this will return an empty object because the sketch - * is embedded in an iframe. It will work correctly if you view the - * sketch using the editor's present or share URLs. + * Returns the sketch's current + * URL + * as a string. + * * @method getURL * @return {String} url * @example *
* - * let url; - * let x = 100; - * * function setup() { - * fill(0); - * noStroke(); - * url = getURL(); - * } - * - * function draw() { * background(200); - * text(url, x, height / 2); - * x--; + * + * // Get the sketch's URL + * // and display it. + * let url = getURL(); + * textWrap(CHAR); + * text(url, 0, 40, 100); + * + * describe('The URL "https://p5js.org/reference/#/p5/getURL" written in black on a gray background.'); * } * *
- * - * @alt - * current url (http://p5js.org/reference/#/p5/getURL) moves right to left. */ _main.default.prototype.getURL = function () { return location.href; }; /** - * Gets the current URL path as an array. Note: when using the - * p5 Editor, this will return an empty object because the sketch - * is embedded in an iframe. It will work correctly if you view the - * sketch using the editor's present or share URLs. + * Returns the current + * URL + * path as an array of strings. + * + * For example, consider a sketch hosted at the URL + * `https://example.com/sketchbook`. Calling `getURLPath()` returns + * `['sketchbook']`. For a sketch hosted at the URL + * `https://example.com/sketchbook/monday`, `getURLPath()` returns + * `['sketchbook', 'monday']`. + * * @method getURLPath - * @return {String[]} path components + * @return {String[]} path components. * @example - *
+ *
+ * * function setup() { - * let urlPath = getURLPath(); - * for (let i = 0; i < urlPath.length; i++) { - * text(urlPath[i], 10, i * 20 + 20); - * } - * } - *
+ * background(200); * - * @alt - * This example does not render anything. + * // Get the sketch's URL path + * // and display the first + * // part. + * let path = getURLPath(); + * text(path[0], 25, 54); + * + * describe('The word "reference" written in black on a gray background.'); + * } + *
+ *
*/ _main.default.prototype.getURLPath = function () { return location.pathname.split('/').filter(function (v) { @@ -58464,22 +59060,34 @@ }); }; /** - * Gets the current URL params as an Object. Note: when using the - * p5 Editor, this will return an empty object because the sketch - * is embedded in an iframe. It will work correctly if you view the - * sketch using the editor's present or share URLs. + * Returns the current + * URL parameters + * in an Object. + * + * For example, calling `getURLParams()` in a sketch hosted at the URL + * `http://p5js.org?year=2014&month=May&day=15` returns + * `{ year: 2014, month: 'May', day: 15 }`. + * * @method getURLParams * @return {Object} URL params * @example *
* - * // Example: http://p5js.org?year=2014&month=May&day=15 + * // Imagine this sketch is hosted at the following URL: + * // https://p5js.org?year=2014&month=May&day=15 * * function setup() { + * background(200); + * + * // Get the sketch's URL + * // parameters and display + * // them. * let params = getURLParams(); * text(params.day, 10, 20); * text(params.month, 10, 40); * text(params.year, 10, 60); + * + * describe('The text "15", "May", and "2014" written in black on separate lines.'); * } * *
@@ -62349,7 +62957,7 @@ * * @class p5 * @constructor - * @param {function} sketch a closure that can set optional preload(), + * @param {function(p5)} sketch a closure that can set optional preload(), * setup(), and/or draw() properties on the * given p5 instance * @param {HTMLElement} [node] element to attach canvas to @@ -63234,43 +63842,86 @@ * @for p5.Element */ /** - * Base class for all elements added to a sketch, including canvas, - * graphics buffers, and other HTML elements. It is not called directly, but p5.Element - * objects are created by calling createCanvas(), createGraphics(), - * createDiv(), createImg(), createInput(), etc. + * A class to describe an + * HTML element. + * Sketches can use many elements. Common elements include the drawing canvas, + * buttons, sliders, webcam feeds, and so on. + * + * All elements share the methods of the `p5.Element` class. They're created + * with functions such as createCanvas() and + * createButton(). * * @class p5.Element * @constructor - * @param {HTMLElement} elt DOM node that is wrapped - * @param {p5} [pInst] pointer to p5 instance + * @param {HTMLElement} elt wrapped DOM element. + * @param {p5} [pInst] pointer to p5 instance. + * + * @example + *
+ * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Create a button element and + * // place it beneath the canvas. + * let btn = createButton('change'); + * btn.position(0, 100); + * + * // Call randomColor() when + * // the button is pressed. + * btn.mousePressed(randomColor); + * + * describe('A gray square with a button that says "change" beneath it. The square changes color when the user presses the button.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
*/ _main.default.Element = /*#__PURE__*/ function () { function _class(elt, pInst) { _classCallCheck(this, _class); /** - * Underlying HTML element. All normal HTML methods can be called on this. + * Underlying + * HTMLElement + * object. Its properties and methods can be used directly. + * * @example *
* * function setup() { - * let c = createCanvas(50, 50); - * c.elt.style.border = '5px solid red'; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(220); + * background(200); + * + * // Set the border style for the + * // canvas. + * cnv.elt.style.border = '5px dashed deeppink'; + * + * describe('A gray square with a pink border drawn with dashed lines.'); * } * *
* * @property elt + * @name elt * @readOnly */ this.elt = elt; /** * @private * @type {p5.Element} + * @name _pInst */ this._pInst = this._pixelsState = pInst; this._events = { @@ -63278,58 +63929,121 @@ /** * @type {Number} * @property width + * @name width */ this.width = this.elt.offsetWidth; /** * @type {Number} * @property height + * @name height */ this.height = this.elt.offsetHeight; } /** + * Attaches this element to a parent element. + * + * For example, a `<div></div>` element may be used as a box to + * hold two pieces of text, a header and a paragraph. The + * `<div></div>` is the parent element of both the header and + * paragraph. * - * Attaches the element to the parent specified. A way of setting - * the container for the element. Accepts either a string ID, DOM - * node, or p5.Element. If no arguments are given, parent node is returned. - * For more ways to position the canvas, see the - * - * positioning the canvas wiki page. + * The parameter `parent` can have one of three types. `parent` can be a + * string with the parent element's ID, as in + * `myElement.parent('container')`. It can also be another + * p5.Element object, as in + * `myElement.parent(myDiv)`. Finally, `parent` can be an `HTMLElement` + * object, as in `myElement.parent(anotherElement)`. + * + * Calling `myElement.parent()` without an argument returns this element's + * parent. * * @method parent - * @param {String|p5.Element|Object} parent the ID, DOM node, or p5.Element - * of desired parent element + * @param {String|p5.Element|Object} parent ID, p5.Element, + * or HTMLElement of desired parent element. * @chainable * * @example - *
- * // Add the following comment to html file. - * // <div id="myContainer"></div> + *
+ * + * function setup() { + * background(200); * - * // The js code - * let cnv = createCanvas(100, 100); - * cnv.parent('myContainer'); - *
+ * // Create a div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color to white + * div.style('background-color', 'white'); + * // Align any text to the center. + * div.style('text-align', 'center'); + * // Set its ID to "container". + * div.id('container'); * - *
- * let div0 = createDiv('this is the parent'); - * let div1 = createDiv('this is the child'); - * div1.parent(div0); // use p5.Element - *
+ * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent + * // using its ID "container". + * p.parent('container'); * - *
- * let div0 = createDiv('this is the parent'); - * div0.id('apples'); - * let div1 = createDiv('this is the child'); - * div1.parent('apples'); // use id - *
+ * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + *
+ *
* - *
- * let elt = document.getElementById('myParentDiv'); - * let div1 = createDiv('this is the child'); - * div1.parent(elt); // use element from page - *
+ *
+ * + * function setup() { + * background(200); * - * @alt - * no display. + * // Create rectangular div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color and align + * // any text to the center. + * div.style('background-color', 'white'); + * div.style('text-align', 'center'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent. + * p.parent(div); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create rectangular div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color and align + * // any text to the center. + * div.style('background-color', 'white'); + * div.style('text-align', 'center'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent + * // using the underlying + * // HTMLElement. + * p.parent(div.elt); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
*/ /** * @method parent @@ -63354,33 +64068,40 @@ p.appendChild(this.elt); return this; } /** + * Sets this element's ID using a given string. * - * Sets the ID of the element. If no ID argument is passed in, it instead - * returns the current ID of the element. - * Note that only one element can have a particular id in a page. - * The class() method can be used - * to identify multiple elements with the same class name. + * Calling `myElement.id()` without an argument returns its ID as a string. * * @method id - * @param {String} id ID of the element + * @param {String} id ID of the element. * @chainable * * @example - *
+ *
+ * * function setup() { + * // Create a canvas element and + * // assign it to cnv. * let cnv = createCanvas(100, 100); - * // Assigns a CSS selector ID to - * // the canvas element. + * + * background(200); + * + * // Set the canvas' ID + * // to "mycanvas". * cnv.id('mycanvas'); - * } - *
* - * @alt - * no display. + * // Get the canvas' ID. + * let id = cnv.id(); + * text(id, 24, 54); + * + * describe('The text "mycanvas" written in black on a gray background.'); + * } + *
+ *
*/ /** * @method id - * @return {String} the id of the element + * @return {String} ID of the element. */ }, @@ -63395,30 +64116,44 @@ this.height = this.elt.offsetHeight; return this; } /** + * Adds a + * class attribute + * to the element. * - * Adds given class to the element. If no class argument is passed in, it - * instead returns a string containing the current class(es) of the element. + * Calling `myElement.class()` without an argument returns a string with its current classes. * * @method class - * @param {String} class class to add + * @param {String} class class to add. * @chainable * * @example - *
+ *
+ * * function setup() { + * // Create a canvas element and + * // assign it to cnv. * let cnv = createCanvas(100, 100); - * // Assigns a CSS selector class 'small' - * // to the canvas element. + * + * background(200); + * + * // Add the class "small" to the + * // canvas element. * cnv.class('small'); - * } - *
* - * @alt - * no display. + * // Get the canvas element's class + * // and display it. + * let c = cnv.class(); + * text(c, 35, 54); + * + * describe('The word "small" written in black on a gray canvas.'); + * + * } + *
+ *
*/ /** * @method class - * @return {String} the class of the element + * @return {String} element's classes, if any. */ }, @@ -63431,46 +64166,64 @@ this.elt.className = c; return this; } /** - * The mousePressed() method is called - * once after every time a mouse button is pressed over the element. Some mobile - * browsers may also trigger this event on a touch screen, if the user performs - * a quick tap. This can be used to attach element-specific event listeners. + * Calls a function when the mouse is pressed over the element. + * Calling `myElement.mousePressed(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. * * @method mousePressed - * @param {Function|Boolean} fxn function to be fired when mouse is + * @param {Function|Boolean} fxn function to call when the mouse is * pressed over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * `false` disables the function. * @chainable * @example - *
- * let cnv, d, g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mousePressed(changeGray); // attach listener for - * // canvas click only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); * - * // this function fires with any click anywhere - * function mousePressed() { - * d = d + 10; + * // Call randomColor() when the canvas + * // is pressed. + * cnv.mousePressed(randomColor); + * + * describe('A gray square changes color when the mouse is pressed.'); * } * - * // this function fires only when cnv is clicked - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the canvas is pressed. + * cnv.mousePressed(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse is pressed.'); + * } + * + *
*/ }, @@ -63490,45 +64243,61 @@ _main.default.Element._adjustListener('mousedown', eventPrependedFxn, this); return this; } /** - * The doubleClicked() method is called once after every time a - * mouse button is pressed twice over the element. This can be used to - * attach element and action-specific event listeners. + * Calls a function when the mouse is pressed twice over the element. + * Calling `myElement.doubleClicked(false)` disables the function. * * @method doubleClicked - * @param {Function|Boolean} fxn function to be fired when mouse is + * @param {Function|Boolean} fxn function to call when the mouse is * double clicked over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * `false` disables the function. * @chainable * @example - *
- * let cnv, d, g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.doubleClicked(changeGray); // attach listener for - * // canvas double click only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); * - * // this function fires with any double click anywhere - * function doubleClicked() { - * d = d + 10; + * // Call randomColor() when the + * // canvas is double-clicked. + * cnv.doubleClicked(randomColor); + * + * describe('A gray square changes color when the user double-clicks the canvas.'); * } * - * // this function fires only when cnv is double clicked - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the canvas is double-clicked. + * cnv.doubleClicked(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user double-clicks the canvas.'); + * } + * + *
*/ }, @@ -63538,61 +64307,106 @@ _main.default.Element._adjustListener('dblclick', fxn, this); return this; } /** - * The mouseWheel() method is called - * once after every time a mouse wheel is scrolled over the element. This can - * be used to attach element-specific event listeners. + * Calls a function when the mouse wheel scrolls over th element. * - * The method accepts a callback function as argument which will be executed - * when the `wheel` event is triggered on the element, the callback function is - * passed one argument `event`. The `event.deltaY` property returns negative - * values if the mouse wheel is rotated up or away from the user and positive - * in the other direction. The `event.deltaX` does the same as `event.deltaY` - * except it reads the horizontal wheel scroll of the mouse wheel. + * The callback function, `fxn`, is passed an `event` object. `event` has + * two numeric properties, `deltaY` and `deltaX`. `event.deltaY` is + * negative if the mouse wheel rotates away from the user. It's positive if + * the mouse wheel rotates toward the user. `event.deltaX` is positive if + * the mouse wheel moves to the right. It's negative if the mouse wheel moves + * to the left. * - * On macOS with "natural" scrolling enabled, the `event.deltaY` values are - * reversed. + * Calling `myElement.mouseWheel(false)` disables the function. * * @method mouseWheel - * @param {Function|Boolean} fxn function to be fired when mouse is + * @param {Function|Boolean} fxn function to call when the mouse wheel is * scrolled over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * `false` disables the function. * @chainable * @example - *
- * let cnv, d, g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mouseWheel(changeSize); // attach listener for - * // activity on canvas only - * d = 10; - * g = 100; + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse wheel moves. + * cnv.mouseWheel(randomColor); + * + * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); * } * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
+ * + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse wheel moves. + * cnv.mouseWheel(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); * } + * + *
+ * + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call changeBackground() when the + * // mouse wheel moves. + * cnv.mouseWheel(changeBackground); * - * // this function fires with mousewheel movement - * // anywhere on screen - * function mouseWheel() { - * g = g + 10; + * describe('A gray square. When the mouse wheel scrolls over the square, it changes color and displays shapes.'); * } * - * // this function fires with mousewheel movement - * // over canvas only - * function changeSize(event) { + * function changeBackground(event) { + * // Change the background color + * // based on deltaY. * if (event.deltaY > 0) { - * d = d + 10; + * background('deeppink'); + * } else if (event.deltaY < 0) { + * background('cornflowerblue'); * } else { - * d = d - 10; + * background(200); * } - * } - *
* - * @alt - * no display. + * // Draw a shape based on deltaX. + * if (event.deltaX > 0) { + * circle(50, 50, 20); + * } else if (event.deltaX < 0) { + * square(40, 40, 20); + * } + * } + *
+ *
*/ }, @@ -63602,48 +64416,64 @@ _main.default.Element._adjustListener('wheel', fxn, this); return this; } /** - * The mouseReleased() method is - * called once after every time a mouse button is released over the element. - * Some mobile browsers may also trigger this event on a touch screen, if the - * user performs a quick tap. This can be used to attach element-specific event listeners. + * Calls a function when the mouse is released over the element. Calling + * `myElement.mouseReleased(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. * * @method mouseReleased - * @param {Function|Boolean} fxn function to be fired when mouse is - * released over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed over the element. + * `false` disables the function. * @chainable * @example - *
- * let cnv, d, g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mouseReleased(changeGray); // attach listener for - * // activity on canvas only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); * - * // this function fires after the mouse has been - * // released - * function mouseReleased() { - * d = d + 10; + * // Call randomColor() when a + * // mouse press ends. + * cnv.mouseReleased(randomColor); + * + * describe('A gray square changes color when the user releases a mouse press.'); * } * - * // this function fires after the mouse has been - * // released while on canvas - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when a mouse press ends. + * cnv.mouseReleased(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + *
*/ }, @@ -63653,50 +64483,64 @@ _main.default.Element._adjustListener('mouseup', fxn, this); return this; } /** - * The mouseClicked() method is - * called once after a mouse button is pressed and released over the element. - * Some mobile browsers may also trigger this event on a touch screen, if the - * user performs a quick tap. This can be used to attach element-specific event listeners. + * Calls a function when the mouse is pressed and released over the element. + * Calling `myElement.mouseReleased(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. * * @method mouseClicked - * @param {Function|Boolean} fxn function to be fired when mouse is - * clicked over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed and released over the element. + * `false` disables the function. * @chainable * @example - *
+ *
* - * let cnv, d, g; * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mouseClicked(changeGray); // attach listener for - * // activity on canvas only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); * - * // this function fires after the mouse has been - * // clicked anywhere - * function mouseClicked() { - * d = d + 10; + * // Call randomColor() when a + * // mouse press ends. + * cnv.mouseClicked(randomColor); + * + * describe('A gray square changes color when the user releases a mouse press.'); * } * - * // this function fires after the mouse has been - * // clicked on canvas - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } * *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when a mouse press ends. + * cnv.mouseClicked(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + *
*/ }, @@ -63706,55 +64550,61 @@ _main.default.Element._adjustListener('click', fxn, this); return this; } /** - * The mouseMoved() method is called once every time a - * mouse moves over the element. This can be used to attach an - * element-specific event listener. + * Calls a function when the mouse moves over the element. Calling + * `myElement.mouseMoved(false)` disables the function. * * @method mouseMoved - * @param {Function|Boolean} fxn function to be fired when a mouse moves - * over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the mouse + * moves over the element. + * `false` disables the function. * @chainable * @example - *
- * let cnv; - * let d = 30; - * let g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mouseMoved(changeSize); // attach listener for - * // activity on canvas only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * fill(200); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); * - * // this function fires when mouse moves anywhere on - * // page - * function mouseMoved() { - * g = g + 5; - * if (g > 255) { - * g = 0; - * } + * // Call randomColor() when the + * // mouse moves. + * cnv.mouseMoved(randomColor); + * + * describe('A gray square changes color when the mouse moves over the canvas.'); * } * - * // this function fires when mouse moves over canvas - * function changeSize() { - * d = d + 2; - * if (d > 100) { - * d = 0; - * } + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves. + * cnv.mouseMoved(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves over the canvas.'); + * } + * + *
*/ }, @@ -63764,40 +64614,62 @@ _main.default.Element._adjustListener('mousemove', fxn, this); return this; } /** - * The mouseOver() method is called once after every time a - * mouse moves onto the element. This can be used to attach an - * element-specific event listener. + * Calls a function when the mouse moves onto the element. Calling + * `myElement.mouseOver(false)` disables the function. * * @method mouseOver - * @param {Function|Boolean} fxn function to be fired when a mouse moves - * onto the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the mouse + * moves onto the element. + * `false` disables the function. * @chainable * @example - *
- * let cnv; - * let d; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mouseOver(changeGray); - * d = 10; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * ellipse(width / 2, height / 2, d, d); + * background(200); + * + * // Call randomColor() when the + * // mouse moves onto the canvas. + * cnv.mouseOver(randomColor); + * + * describe('A gray square changes color when the mouse moves onto the canvas.'); * } * - * function changeGray() { - * d = d + 10; - * if (d > 100) { - * d = 0; - * } + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves onto + * // the canvas. + * cnv.mouseOver(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves onto the canvas.'); + * } + * + *
*/ }, @@ -63807,40 +64679,62 @@ _main.default.Element._adjustListener('mouseover', fxn, this); return this; } /** - * The mouseOut() method is called once after every time a - * mouse moves off the element. This can be used to attach an - * element-specific event listener. + * Calls a function when the mouse moves off the element. Calling + * `myElement.mouseOut(false)` disables the function. * * @method mouseOut - * @param {Function|Boolean} fxn function to be fired when a mouse - * moves off of an element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the mouse + * moves off the element. + * `false` disables the function. * @chainable * @example - *
- * let cnv; - * let d; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.mouseOut(changeGray); - * d = 10; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * ellipse(width / 2, height / 2, d, d); + * background(200); + * + * // Call randomColor() when the + * // mouse moves off the canvas. + * cnv.mouseOut(randomColor); + * + * describe('A gray square changes color when the mouse moves off the canvas.'); * } * - * function changeGray() { - * d = d + 10; - * if (d > 100) { - * d = 0; - * } + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves off + * // the canvas. + * cnv.mouseOut(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves off the canvas.'); + * } + * + *
*/ }, @@ -63850,46 +64744,64 @@ _main.default.Element._adjustListener('mouseout', fxn, this); return this; } /** - * The touchStarted() method is called once after every time a touch is - * registered. This can be used to attach element-specific event listeners. + * Calls a function when the element is touched. Calling + * `myElement.touchStarted(false)` disables the function. + * + * Note: Touch functions only work on mobile devices. * * @method touchStarted - * @param {Function|Boolean} fxn function to be fired when a touch - * starts over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the touch + * starts. + * `false` disables the function. * @chainable * @example - *
- * let cnv; - * let d; - * let g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.touchStarted(changeGray); // attach listener for - * // canvas click only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); * - * // this function fires with any touch anywhere - * function touchStarted() { - * d = d + 10; + * // Call randomColor() when the + * // user touches the canvas. + * cnv.touchStarted(randomColor); + * + * describe('A gray square changes color when the user touches the canvas.'); * } * - * // this function fires only when cnv is clicked - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas. + * cnv.touchStarted(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas.'); + * } + * + *
*/ }, @@ -63899,38 +64811,66 @@ _main.default.Element._adjustListener('touchstart', fxn, this); return this; } /** - * The touchMoved() method is called once after every time a touch move is - * registered. This can be used to attach element-specific event listeners. + * Calls a function when the user touches the element and moves their + * finger. Calling `myElement.touchMoved(false)` disables the + * function. + * + * Note: Touch functions only work on mobile devices. * * @method touchMoved - * @param {Function|Boolean} fxn function to be fired when a touch moves over - * the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the touch + * moves over the element. + * `false` disables the function. * @chainable * @example - *
- * let cnv; - * let g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.touchMoved(changeGray); // attach listener for - * // canvas click only - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas + * // and moves. + * cnv.touchMoved(randomColor); + * + * describe('A gray square changes color when the user touches the canvas and moves.'); * } * - * // this function fires only when cnv is clicked - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas and moves. + * cnv.touchMoved(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas and moves.'); + * } + * + *
*/ }, @@ -63940,46 +64880,66 @@ _main.default.Element._adjustListener('touchmove', fxn, this); return this; } /** - * The touchEnded() method is called once after every time a touch is - * registered. This can be used to attach element-specific event listeners. + * Calls a function when the user stops touching the element. Calling + * `myElement.touchMoved(false)` disables the function. + * + * Note: Touch functions only work on mobile devices. * * @method touchEnded - * @param {Function|Boolean} fxn function to be fired when a touch ends - * over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the touch + * ends. + * `false` disables the function. * @chainable * @example - *
- * let cnv; - * let d; - * let g; + *
+ * * function setup() { - * cnv = createCanvas(100, 100); - * cnv.touchEnded(changeGray); // attach listener for - * // canvas click only - * d = 10; - * g = 100; - * } + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); * - * function draw() { - * background(g); - * ellipse(width / 2, height / 2, d, d); - * } + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas, + * // then lifts their finger. + * cnv.touchEnded(randomColor); * - * // this function fires with any touch anywhere - * function touchEnded() { - * d = d + 10; + * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); * } * - * // this function fires only when cnv is clicked - * function changeGray() { - * g = random(0, 255); + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas, then lifts their + * // finger. + * cnv.touchEnded(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); + * } + * + *
*/ }, @@ -63989,37 +64949,62 @@ _main.default.Element._adjustListener('touchend', fxn, this); return this; } /** - * The dragOver() method is called once after every time a - * file is dragged over the element. This can be used to attach an - * element-specific event listener. + * Calls a function when a file is dragged over the element. Calling + * `myElement.dragOver(false)` disables the function. * * @method dragOver - * @param {Function|Boolean} fxn function to be fired when a file is + * @param {Function|Boolean} fxn function to call when the file is * dragged over the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * `false` disables the function. * @chainable * @example - *
- * // To test this sketch, simply drag a - * // file over the canvas + *
+ * + * // Drag a file over the canvas to test. + * * function setup() { - * let c = createCanvas(100, 100); + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * * background(200); - * textAlign(CENTER); - * text('Drag file', width / 2, height / 2); - * c.dragOver(dragOverCallback); + * + * // Call helloFile() when a + * // file is dragged over + * // the canvas. + * cnv.dragOver(helloFile); + * + * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); * } * - * // This function will be called whenever - * // a file is dragged over the canvas - * function dragOverCallback() { - * background(240); - * text('Dragged over', width / 2, height / 2); + * function helloFile() { + * text('hello, file', 50, 50); * } - *
- * @alt - * nothing displayed + *
+ *
+ * + *
+ * + * // Drag a file over the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Say "hello, file" when a + * // file is dragged over + * // the canvas. + * cnv.dragOver(() => { + * text('hello, file', 50, 50); + * }); + * + * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); + * } + * + *
*/ }, @@ -64029,37 +65014,64 @@ _main.default.Element._adjustListener('dragover', fxn, this); return this; } /** - * The dragLeave() method is called once after every time a - * dragged file leaves the element area. This can be used to attach an - * element-specific event listener. + * Calls a function when a file is dragged off the element. Calling + * Calling `myElement.dragLeave(false)` disables the function. * * @method dragLeave - * @param {Function|Boolean} fxn function to be fired when a file is + * @param {Function|Boolean} fxn function to call when the file is * dragged off the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * `false` disables the function. * @chainable * @example - *
- * // To test this sketch, simply drag a file - * // over and then out of the canvas area + *
+ * + * // Drag a file over, then off + * // the canvas to test. + * * function setup() { - * let c = createCanvas(100, 100); + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * * background(200); - * textAlign(CENTER); - * text('Drag file', width / 2, height / 2); - * c.dragLeave(dragLeaveCallback); + * + * // Call byeFile() when a + * // file is dragged over, + * // then off the canvas. + * cnv.dragLeave(byeFile); + * + * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); * } * - * // This function will be called whenever - * // a file is dragged out of the canvas - * function dragLeaveCallback() { - * background(240); - * text('Dragged off', width / 2, height / 2); + * function byeFile() { + * text('bye, file', 50, 50); * } - *
- * @alt - * nothing displayed + *
+ *
+ * + *
+ * + * // Drag a file over, then off + * // the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Say "bye, file" when a + * // file is dragged over, + * // then off the canvas. + * cnv.dragLeave(() => { + * text('bye, file', 50, 50); + * }); + * + * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); + * } + * + *
*/ }, @@ -64921,7 +65933,7 @@ } var region = new _main.default.Image(w * pd, h * pd); - region._pixelDensity = pd; + region.pixelDensity(pd); region.canvas.getContext('2d').drawImage(canvas, x, y, w * pd, h * pd, 0, 0, w * pd, h * pd); return region; } @@ -65523,6 +66535,26 @@ return _this; } _createClass(Renderer2D, [ + { + key: 'getFilterGraphicsLayer', + value: function getFilterGraphicsLayer() { + // create hidden webgl renderer if it doesn't exist + if (!this.filterGraphicsLayer) { + // the real _pInst is buried when this is a secondary p5.Graphics + var pInst = this._pInst instanceof _main.default.Graphics ? this._pInst._pInst : this._pInst; + // create secondary layer + this.filterGraphicsLayer = new _main.default.Graphics(this.width, this.height, constants.WEBGL, pInst); + } + if (this.filterGraphicsLayer.width !== this.width || this.filterGraphicsLayer.height !== this.height) { + // Resize the graphics layer + this.filterGraphicsLayer.resizeCanvas(this.width, this.height); + } + if (this.filterGraphicsLayer.pixelDensity() !== this._pInst.pixelDensity()) { + this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()); + } + return this.filterGraphicsLayer; + } + }, { key: '_applyDefaults', value: function _applyDefaults() { @@ -66283,7 +67315,7 @@ var i, j; var numVerts = vertices.length; - if (isCurve && (shapeKind === constants.POLYGON || shapeKind === null)) { + if (isCurve && shapeKind === null) { if (numVerts > 3) { var b = [ ], @@ -66315,7 +67347,7 @@ } this._doFillStrokeClose(closeShape); } - } else if (isBezier && (shapeKind === constants.POLYGON || shapeKind === null)) { + } else if (isBezier && shapeKind === null) { if (!this._clipping) this.drawingContext.beginPath(); for (i = 0; i < numVerts; i++) { if (vertices[i].isVert) { @@ -66329,7 +67361,7 @@ } } this._doFillStrokeClose(closeShape); - } else if (isQuadratic && (shapeKind === constants.POLYGON || shapeKind === null)) { + } else if (isQuadratic && shapeKind === null) { if (!this._clipping) this.drawingContext.beginPath(); for (i = 0; i < numVerts; i++) { if (vertices[i].isVert) { @@ -67364,13 +68396,20 @@ * @param {HTMLCanvasElement} [canvas] * @return {p5.Graphics} offscreen graphics buffer */ - _main.default.prototype.createGraphics = function (w, h, renderer, canvas) { - if (arguments[2] instanceof HTMLCanvasElement) { - renderer = constants.P2D; - canvas = arguments[2]; + _main.default.prototype.createGraphics = function (w, h) { + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } /** + * args[0] is expected to be renderer + * args[1] is expected to be canvas + */ + + if (args[0] instanceof HTMLCanvasElement) { + args[1] = args[0]; + args[0] = constants.P2D; } _main.default._validateParameters('createGraphics', arguments); - return new _main.default.Graphics(w, h, renderer, this, canvas); + return new _main.default.Graphics(w, h, args[0], this, args[1]); }; /** * Creates and returns a new p5.Framebuffer, a @@ -70162,8 +71201,8 @@ * * // gl_InstanceID represents a numeric value for each instance * // using gl_InstanceID allows us to move each instance separately - * // here we move each instance horizontally by id * 100 - * float xOffset = float(gl_InstanceID) * 100.0; + * // here we move each instance horizontally by id * 40 + * float xOffset = float(gl_InstanceID) * 40.0; * * // apply the offset to the final position * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4 - @@ -70191,7 +71230,7 @@ * `; * * function setup() { - * createCanvas(400, 400, WEBGL); + * createCanvas(100, 100, WEBGL); * fx = createShader(vs, fs); * } * @@ -70202,12 +71241,16 @@ * shader(fx); * fx.setUniform('numInstances', 4); * + * // this doesn't have to do with instancing, this is just for centering the squares + * translate(25, -10); + * + * // here we draw the squares we want to instance * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * vertex(30, 20); + * vertex(0, 0); + * vertex(0, 20); + * vertex(20, 20); + * vertex(20, 0); + * vertex(0, 0); * endShape(CLOSE, 4); * * resetShader(); @@ -73517,40 +74560,75 @@ * @requires p5 */ /** - * Searches the page for the first element that matches the given CSS selector string (can be an - * ID, class, tag name or a combination) and returns it as a p5.Element. - * The DOM node itself can be accessed with .elt. - * Returns null if none found. You can also specify a container to search within. + * Searches the page for the first element that matches the given + * CSS selector string. + * The string can be an ID, class, tag name, or a combination. `select()` + * returns a p5.Element object if it finds a match + * and `null` otherwise. + * + * The second parameter, `container`, is optional. It specifies a container to + * search within. container can be CSS selector string, a + * p5.Element object, or an + * HTMLElement object. * * @method select - * @param {String} selectors CSS selector string of element to search for + * @param {String} selectors CSS selector string of element to search for. * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or - * HTML element to search within - * @return {p5.Element|null} p5.Element containing node found + * HTMLElement to search within. + * @return {p5.Element|null} p5.Element containing the element. * @example - *
+ *
+ * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * // Select the canvas by its tag. + * let cnv = select('canvas'); + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
+ * + *
+ * * function setup() { - * createCanvas(50, 50); - * background(30); - * // move canvas down and right - * select('canvas').position(10, 30); + * let cnv = createCanvas(100, 100); + * // Add a class attribute to the canvas. + * cnv.class('pinkborder'); + * + * background(200); + * + * // Select the canvas by its class. + * cnv = select('.pinkborder'); + * // Style its border. + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); * } - *
+ *
+ *
* - *
- * // select using ID - * let a = select('#container'); - * let b = select('#beep', '#container'); - * let c; - * if (a) { - * // select using class - * c = select('.boop', a); - * } - * // select using CSS selector string - * let d = select('#container #bleep'); - * let e = select('#container p'); - * [a, b, c, d, e]; // unused - *
+ *
+ * + * function setup() { + * let cnv = createCanvas(100, 100); + * // Set the canvas ID. + * cnv.id('mycanvas'); + * + * background(200); + * + * // Select the canvas by its ID. + * cnv = select('#mycanvas'); + * // Style its border. + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
*/ _main.default.prototype.select = function (e, p) { @@ -73564,49 +74642,78 @@ } }; /** - * Searches the page for elements that match the given CSS selector string (can be an ID a class, - * tag name or a combination) and returns them as p5.Elements in - * an array. - * The DOM node itself can be accessed with .elt. - * Returns an empty array if none found. - * You can also specify a container to search within. + * Searches the page for all elements that matches the given + * CSS selector string. + * The string can be an ID, class, tag name, or a combination. `selectAll()` + * returns an array of p5.Element objects if it + * finds any matches and an empty array otherwise. + * + * The second parameter, `container`, is optional. It specifies a container to + * search within. container can be CSS selector string, a + * p5.Element object, or an + * HTMLElement object. * * @method selectAll - * @param {String} selectors CSS selector string of elements to search for - * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element - * , or HTML element to search within - * @return {p5.Element[]} Array of p5.Elements containing nodes found + * @param {String} selectors CSS selector string of element to search for. + * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or + * HTMLElement to search within. + * @return {p5.Element[]} array of p5.Elements containing any elements found. * @example - *
+ *
+ * * function setup() { - * createButton('btn'); - * createButton('2nd btn'); - * createButton('3rd btn'); + * // Create three buttons. + * createButton('1'); + * createButton('2'); + * createButton('3'); + * + * // Select the buttons by their tag. * let buttons = selectAll('button'); * - * for (let i = 0; i < 3; i++) { - * buttons[i].size(100); + * // Position the buttons. + * for (let i = 0; i < 3; i += 1) { * buttons[i].position(0, i * 30); * } + * + * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3".'); * } - *
- *
- * // these are all valid calls to selectAll() - * let a = selectAll('.beep'); - * a = selectAll('div'); - * a = selectAll('button', '#container'); - * - * let b = createDiv(); - * b.id('container'); - * let c = select('#container'); - * a = selectAll('p', c); - * a = selectAll('#container p'); - * - * let d = document.getElementById('container'); - * a = selectAll('.boop', d); - * a = selectAll('#container .boop'); - * console.log(a); - *
+ *
+ *
+ * + *
+ * + * function setup() { + * // Create three buttons and position them. + * let b1 = createButton('1'); + * b1.position(0, 0); + * let b2 = createButton('2'); + * b2.position(0, 30); + * let b3 = createButton('3'); + * b3.position(0, 60); + * + * // Add a class attribute to each button. + * b1.class('btn'); + * b2.class('btn btn-pink'); + * b3.class('btn'); + * + * // Select the buttons by their class. + * let buttons = selectAll('.btn'); + * let pinkButtons = selectAll('.btn-pink'); + * + * // Style the selected buttons. + * buttons.forEach(btn => { + * btn.style('font-family', 'Comic Sans MS'); + * }); + * + * pinkButtons.forEach(btn => { + * btn.style('background', 'deeppink'); + * btn.style('color', 'white'); + * }); + * + * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3". Buttons "1" and "3" are gray. Button "2" is pink.'); + * } + * + *
*/ _main.default.prototype.selectAll = function (e, p) { _main.default._validateParameters('selectAll', arguments); @@ -73667,24 +74774,65 @@ } }; /** - * Removes all elements created by p5, except any canvas / graphics - * elements created by createCanvas or createGraphics. - * Event handlers are removed, and element is removed from the DOM. + * Removes all elements created by p5.js, including any event handlers. + * There are two exceptions: + * canvas elements created by createCanvas + * and p5.Render objects created by + * createGraphics. + * * @method removeElements * @example - *
+ *
+ * * function setup() { * createCanvas(100, 100); - * background('grey'); - * let div = createDiv('this is some text'); - * let p = createP('this is a paragraph'); - * div.style('font-size', '16px'); - * p.style('font-size', '16px'); + * background(200); + * + * // Create a paragraph element and place + * // it in the middle of the canvas. + * let p = createP('p5*js'); + * p.position(25, 25); + * + * describe('A gray square with the text "p5*js" written in its center. The text disappears when the mouse is pressed.'); * } + * * function mousePressed() { - * removeElements(); // this will remove the div and p, not canvas + * removeElements(); * } - *
+ *
+ *
+ * + *
+ * + * let slider; + * + * function setup() { + * createCanvas(100, 100); + * + * // Create a paragraph element and place + * // it at the top of the canvas. + * let p = createP('p5*js'); + * p.position(25, 25); + * + * // Create a slider element and place it + * // beneath the canvas. + * slider = createSlider(0, 255, 200); + * slider.position(0, 100); + * + * describe('A gray square with the text "p5*js" written in its center and a range slider beneath it. The square changes color when the slider is moved. The text and slider disappear when the square is double-clicked.'); + * } + * + * function draw() { + * // Use the slider value to change the background color. + * let g = slider.value(); + * background(g); + * } + * + * function doubleClicked() { + * removeElements(); + * } + * + *
*/ _main.default.prototype.removeElements = function (e) { _main.default._validateParameters('removeElements', arguments); @@ -73698,103 +74846,120 @@ }); }; /** - * The .changed() function is called when the value of an - * element changes. - * This can be used to attach an element specific event listener. + * `myElement.changed()` sets a function to call when the value of the + * p5.Element object changes. Calling + * `myElement.changed(false)` disables the function. * * @method changed - * @param {Function|Boolean} fxn function to be fired when the value of - * an element changes. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when the element changes. + * `false` disables the function. * @chainable * @example - *
- * let sel; - * + *
+ * * function setup() { - * textAlign(CENTER); * background(200); - * sel = createSelect(); - * sel.position(10, 10); - * sel.option('pear'); - * sel.option('kiwi'); - * sel.option('grape'); - * sel.changed(mySelectEvent); - * } * - * function mySelectEvent() { - * let item = sel.value(); - * background(200); - * text("it's a " + item + '!', 50, 50); - * } - *
- * - *
- * let checkbox; - * let cnv; + * // Create a dropdown menu and add a few color options. + * let drop = createSelect(); + * drop.position(0, 0); + * drop.option('red'); + * drop.option('green'); + * drop.option('blue'); + * + * // When the color option changes, paint the background with + * // that color. + * drop.changed(() => { + * let c = drop.value(); + * background(c); + * }); * - * function setup() { - * checkbox = createCheckbox(' fill'); - * checkbox.changed(changeFill); - * cnv = createCanvas(100, 100); - * cnv.position(0, 30); - * noFill(); + * describe('A gray square with a dropdown menu at the top. The square changes color when an option is selected.'); * } + * + *
* - * function draw() { + *
+ * + * function setup() { * background(200); - * ellipse(50, 50, 50, 50); - * } * - * function changeFill() { - * if (checkbox.checked()) { - * fill(0); - * } else { - * noFill(); - * } - * } - *
+ * // Create a checkbox and place it beneath the canvas. + * let checkbox = createCheckbox(' circle'); + * checkbox.position(0, 100); * - * @alt - * dropdown: pear, kiwi, grape. When selected text "it's a" + selection shown. + * // When the checkbox changes, paint the background gray + * // and determine whether to draw a circle. + * checkbox.changed(() => { + * background(200); + * if (checkbox.checked() === true) { + * circle(50, 50, 30); + * } + * }); + * + * describe('A gray square with a checkbox underneath it that says "circle". A white circle appears when the box is checked and disappears otherwise.'); + * } + *
+ *
*/ _main.default.Element.prototype.changed = function (fxn) { _main.default.Element._adjustListener('change', fxn, this); return this; }; /** - * The .input() function is called when any user input is - * detected with an element. The input event is often used - * to detect keystrokes in a input element, or changes on a - * slider element. This can be used to attach an element specific - * event listener. + * `myElement.input()` sets a function to call when input is detected within + * the p5.Element object. It's often used to with + * text inputs and sliders. Calling `myElement.input(false)` disables the + * function. * * @method input - * @param {Function|Boolean} fxn function to be fired when any user input is - * detected within the element. - * if `false` is passed instead, the previously - * firing function will no longer fire. + * @param {Function|Boolean} fxn function to call when input is detected within + * the element. + * `false` disables the function. * @chainable * @example - *
- * // Open your console to see the output + *
+ * * function setup() { - * createCanvas(100, 100); - * background('grey'); - * let inp = createInput(''); - * inp.position(0, 0); - * inp.size(100); - * inp.input(myInputEvent); - * } + * background(200); + * + * // Create a slider and place it beneath the canvas. + * let slider = createSlider(0, 255, 200); + * slider.position(0, 100); + * + * // When the slider changes, use its value to paint + * // the background. + * slider.input(() => { + * let g = slider.value(); + * background(g); + * }); * - * function myInputEvent() { - * console.log('you are typing: ', this.value()); + * describe('A gray square with a range slider underneath it. The background changes shades of gray when the slider is moved.'); * } - *
+ *
+ *
* - * @alt - * no display. + *
+ * + * function setup() { + * background(200); + * + * // Create an input and place it beneath the canvas. + * let inp = createInput(''); + * inp.position(0, 100); + * + * // When input is detected, paint the background gray + * // and display the text. + * inp.input(() => { + * background(200); + * let msg = inp.value(); + * text(msg, 5, 50); + * }); + * + * describe('A gray square with a text input bar beneath it. Any text written in the input appears in the middle of the square.'); + * } + * + *
*/ _main.default.Element.prototype.input = function (fxn) { _main.default.Element._adjustListener('input', fxn, this); @@ -73810,17 +74975,42 @@ pInst._elements.push(c); return c; } /** - * Creates a `<div></div>` element in the DOM with given inner HTML. + * Creates a `<div></div>` element. It's commonly used as a + * container for other elements. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<div></div>`. * * @method createDiv - * @param {String} [html] inner HTML for element created - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [html] inner HTML for the new `<div></div>` element. + * @return {p5.Element} new p5.Element object. * @example - *
- * let div = createDiv('this is some text'); - * div.style('font-size', '16px'); - * div.position(10, 0); - *
+ *
+ * + * function setup() { + * background(200); + * + * let div = createDiv('p5*js'); + * div.position(25, 35); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create an h3 element within the div. + * let div = createDiv('

p5*js

'); + * div.position(20, 5); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + *
+ *
*/ _main.default.prototype.createDiv = function () { @@ -73830,18 +75020,28 @@ return addElement(elt, this); }; /** - * Creates a `<p></p>` element in the DOM with given inner HTML. Used - * for paragraph length text. + * Creates a `<p></p>` element. It's commonly used for + * paragraph-length text. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<p></p>`. * * @method createP - * @param {String} [html] inner HTML for element created - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [html] inner HTML for the new `<p></p>` element. + * @return {p5.Element} new p5.Element object. * @example - *
- * let p = createP('this is some text'); - * p.style('font-size', '16px'); - * p.position(10, 0); - *
+ *
+ * + * function setup() { + * background(200); + * + * let p = createP('Tell me a story.'); + * p.position(5, 0); + * + * describe('A gray square displaying the text "Tell me a story." written in black.'); + * } + * + *
*/ _main.default.prototype.createP = function () { var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; @@ -73850,16 +75050,63 @@ return addElement(elt, this); }; /** - * Creates a `<span></span>` element in the DOM with given inner HTML. + * Creates a `<span></span>` element. It's commonly used as a + * container for inline elements. For example, a `<span></span>` + * can hold part of a sentence that's a + * different style. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<span></span>`. * * @method createSpan - * @param {String} [html] inner HTML for element created - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [html] inner HTML for the new `<span></span>` element. + * @return {p5.Element} new p5.Element object. * @example - *
- * let span = createSpan('this is some text'); - * span.position(0, 0); - *
+ *
+ * + * function setup() { + * background(200); + * + * // Create a span element. + * let span = createSpan('p5*js'); + * span.position(25, 35); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create a div element as + * // a container. + * let div = createDiv(); + * // Place the div at the + * // center. + * div.position(25, 35); + * + * // Create a span element. + * let s1 = createSpan('p5'); + * // Create a second span element. + * let s2 = createSpan('*'); + * // Set the span's font color. + * s2.style('color', 'deeppink'); + * // Create a third span element. + * let s3 = createSpan('js'); + * + * // Add all the spans to the + * // container div. + * s1.parent(div); + * s2.parent(div); + * s3.parent(div); + * + * describe('A gray square with the text "p5*js" written in black at its center. The asterisk is pink.'); + * } + * + *
*/ _main.default.prototype.createSpan = function () { var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; @@ -73868,29 +75115,54 @@ return addElement(elt, this); }; /** - * Creates an `<img>` element in the DOM with given src and - * alternate text. + * Creates an `<img>` element that can appear outside of the canvas. + * + * The first parameter, `src`, is a string with the path to the image file. + * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as + * in `'https://example.com/image.png'`. + * + * The second parameter, `alt`, is a string with the + * alternate text + * for the image. An empty string `''` can be used for images that aren't displayed. + * + * The third parameter, `crossOrigin`, is optional. It's a string that sets the + * crossOrigin property + * of the image. Use `'anonymous'` or `'use-credentials'` to fetch the image + * with cross-origin access. + * + * The fourth parameter, `callback`, is also optional. It sets a function to + * call after the image loads. The new image is passed to the callback + * function as a p5.Element object. * * @method createImg - * @param {String} src src path or url for image - * @param {String} alt 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. - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} src relative path or URL for the image. + * @param {String} alt alternate text for the image. + * @return {p5.Element} new p5.Element object. * @example - *
- * let img = createImg( - * 'https://p5js.org/assets/img/asterisk-01.png', - * 'the p5 magenta asterisk' - * ); - * img.position(0, -10); - *
+ *
+ * + * function setup() { + * background(200); + * + * let img = createImg( + * 'https://p5js.org/assets/img/asterisk-01.png', + * 'The p5.js magenta asterisk.' + * ); + * img.position(0, -10); + * + * describe('A gray square with a magenta asterisk in its center.'); + * } + * + *
*/ /** * @method createImg * @param {String} src * @param {String} alt - * @param {String} crossOrigin 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 - * @param {Function} [successCallback] callback to be called once image data is loaded with the p5.Element as argument - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [crossOrigin] crossOrigin property to use when fetching the image. + * @param {Function} [successCallback] function to call once the image loads. The new image will be passed + * to the function as a p5.Element object. + * @return {p5.Element} new p5.Element object. */ _main.default.prototype.createImg = function () { _main.default._validateParameters('createImg', arguments); @@ -73914,19 +75186,55 @@ return self; }; /** - * Creates an `<a></a>` element in the DOM for including a hyperlink. + * Creates an `<a></a>` element that links to another web page. + * + * The first parmeter, `href`, is a string that sets the URL of the linked + * page. + * + * The second parameter, `html`, is a string that sets the inner HTML of the + * link. It's common to use text, images, or buttons as links. + * + * The third parameter, `target`, is optional. It's a string that tells the + * web browser where to open the link. By default, links open in the current + * browser tab. Passing `'_blank'` will cause the link to open in a new + * browser tab. MDN describes a few + * other options. * * @method createA - * @param {String} href url of page to link to - * @param {String} html inner html of link element to display - * @param {String} [target] target where new link should open, - * could be _blank, _self, _parent, _top. - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} href URL of linked page. + * @param {String} html inner HTML of link element to display. + * @param {String} [target] target where the new link should open, + * either `'_blank'`, `'_self'`, `'_parent'`, or `'_top'`. + * @return {p5.Element} new p5.Element object. * @example - *
- * let a = createA('http://p5js.org/', 'this is a link'); - * a.position(0, 0); - *
+ *
+ * + * function setup() { + * background(200); + * + * // Create an anchor element that links to p5js.org. + * let a = createA('http://p5js.org/', 'p5*js'); + * a.position(25, 35); + * + * describe('The text "p5*js" written at the center of a gray square.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create an anchor element that links to p5js.org. + * // Open the link in a new tab. + * let a = createA('http://p5js.org/', 'p5*js', '_blank'); + * a.position(25, 35); + * + * describe('The text "p5*js" written at the center of a gray square.'); + * } + * + *
*/ _main.default.prototype.createA = function (href, html, target) { _main.default._validateParameters('createA', arguments); @@ -73938,44 +75246,114 @@ }; /** INPUT **/ /** - * Creates a slider `<input></input>` element in the DOM. - * Use .size() to set the display length of the slider. + * Creates a slider `<input></input>` element. Range sliders are + * useful for quickly selecting numbers from a given range. + * + * The first two parameters, `min` and `max`, are numbers that set the + * slider's minimum and maximum. + * + * The third parameter, `value`, is optional. It's a number that sets the + * slider's default value. + * + * The fourth parameter, `step`, is also optional. It's a number that sets the + * spacing between each value in the slider's range. Setting `step` to 0 + * allows the slider to move smoothly from `min` to `max`. * * @method createSlider - * @param {Number} min minimum value of the slider - * @param {Number} max maximum value of the slider - * @param {Number} [value] default value of the slider - * @param {Number} [step] 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) - * @return {p5.Element} pointer to p5.Element holding the created node + * @param {Number} min minimum value of the slider. + * @param {Number} max maximum value of the slider. + * @param {Number} [value] default value of the slider. + * @param {Number} [step] size for each step in the slider's range. + * @return {p5.Element} new p5.Element object. * @example - *
+ *
+ * * let slider; + * * function setup() { - * slider = createSlider(0, 255, 100); + * // Create a slider and place it at the top of the canvas. + * slider = createSlider(0, 255); * slider.position(10, 10); - * slider.style('width', '80px'); + * slider.size(80); + * + * describe('A dark gray square with a range slider at the top. The square changes color when the slider is moved.'); * } * * function draw() { - * let val = slider.value(); - * background(val); + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); * } - *
+ *
+ *
* - *
+ *
+ * * let slider; + * * function setup() { - * colorMode(HSB); - * slider = createSlider(0, 360, 60, 40); + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * slider = createSlider(0, 255, 0); * slider.position(10, 10); - * slider.style('width', '80px'); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); * } * * function draw() { - * let val = slider.value(); - * background(val, 100, 100, 1); + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); * } - *
+ *
+ *
+ * + *
+ * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * // Set its step size to 50. + * slider = createSlider(0, 255, 0, 50); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
+ * + *
+ * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * // Set its step size to 0 so that it moves smoothly. + * slider = createSlider(0, 255, 0, 0); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
*/ _main.default.prototype.createSlider = function (min, max, value, step) { _main.default._validateParameters('createSlider', arguments); @@ -73992,30 +75370,68 @@ return addElement(elt, this); }; /** - * Creates a `<button></button>` element in the DOM. - * Use .size() to set the display size of the button. - * Use .mousePressed() to specify behavior on press. + * Creates a `<button></button>` element. + * + * The first parameter, `label`, is a string that sets the label displayed on + * the button. + * + * The second parameter, `value`, is optional. It's a string that sets the + * button's value. See + * MDN + * for more details. * * @method createButton - * @param {String} label label displayed on the button - * @param {String} [value] value of the button - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} label label displayed on the button. + * @param {String} [value] value of the button. + * @return {p5.Element} new p5.Element object. * @example - *
+ *
+ * + * function setup() { + * background(200); + * + * // Create a button and place it beneath the canvas. + * let button = createButton('click me'); + * button.position(0, 100); + * + * // Use the button to change the background color. + * button.mousePressed(() => { + * let g = random(255); + * background(g); + * }); + * + * describe('A gray square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); + * } + * + *
+ * + *
+ * * let button; + * * function setup() { - * createCanvas(100, 100); - * background(0); - * button = createButton('click me'); - * button.position(0, 0); - * button.mousePressed(changeBG); + * // Create a button and set its value to 0. + * // Place the button beneath the canvas. + * button = createButton('click me', 'red'); + * button.position(0, 100); + * + * // Change the button's value when the mouse + * // is pressed. + * button.mousePressed(() => { + * let c = random(['red', 'green', 'blue', 'yellow']); + * button.value(c); + * }); + * + * describe('A red square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); * } * - * function changeBG() { - * let val = random(255); - * background(val); + * function draw() { + * // Use the button's value to set the background color. + * let c = button.value(); + * background(c); * } - *
+ *
+ *
*/ _main.default.prototype.createButton = function (label, value) { _main.default._validateParameters('createButton', arguments); @@ -74025,31 +75441,92 @@ return addElement(elt, this); }; /** - * Creates a checkbox `<input></input>` element in the DOM. - * Calling .checked() on a checkbox returns a boolean indicating whether - * it is checked or not. + * Creates a checkbox `<input></input>` element. Checkboxes extend + * the p5.Element class with a `checked()` method. + * Calling `myBox.checked()` returns `true` if it the box is checked and + * `false` otherwise. + * + * The first parameter, `label`, is optional. It's a string that sets the label + * to display next to the checkbox. + * + * The second parameter, `value`, is also optional. It's a boolean that sets the + * checkbox's value. * * @method createCheckbox - * @param {String} [label] label displayed after checkbox - * @param {boolean} [value] value of the checkbox; checked is true, unchecked is false - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [label] label displayed after the checkbox. + * @param {boolean} [value] value of the checkbox. Checked is `true` and unchecked is `false`. + * @return {p5.Element} new p5.Element object. * @example - *
+ *
+ * * let checkbox; * * function setup() { - * checkbox = createCheckbox('label', false); - * checkbox.changed(myCheckedEvent); + * // Create a checkbox and place it beneath the canvas. + * checkbox = createCheckbox(); + * checkbox.position(0, 100); + * + * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.'); * } * - * function myCheckedEvent() { + * function draw() { + * // Use the checkbox to set the background color. * if (checkbox.checked()) { - * console.log('Checking!'); + * background(255); * } else { - * console.log('Unchecking!'); + * background(0); * } * } - *
+ *
+ *
+ * + *
+ * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * // Label the checkbox "white". + * checkbox = createCheckbox(' white'); + * checkbox.position(0, 100); + * + * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
+ * + *
+ * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * // Label the checkbox "white" and set its value to true. + * checkbox = createCheckbox(' white', true); + * checkbox.position(0, 100); + * + * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
*/ _main.default.prototype.createCheckbox = function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { @@ -74099,79 +75576,159 @@ return self; }; /** - * Creates a dropdown menu `<select></select>` element in the DOM. - * It also assigns select-related methods to p5.Element when selecting an existing select box. Options in the menu are unique by `name` (the display text). - * - `.option(name, [value])` can be used to add an option with `name` (the display text) and `value` to the select element. If an option with `name` already exists within the select element, this method will change its value to `value`. - * - `.value()` will return the currently selected option. - * - `.selected()` will return the current dropdown element which is an instance of p5.Element. - * - `.selected(value)` can be used to make given option selected by default when the page first loads. - * - `.disable()` marks the whole dropdown element as disabled. - * - `.disable(value)` marks a given option as disabled. - * - `.enable()` marks the whole dropdown element as enabled if whole dropdown element is disabled intially. - * - `.enable(value)` marks a given option as enable if the initial option is disabled. + * Creates a dropdown menu `<select></select>` element. + * + * The parameter is optional. If `true` is passed, as in + * `let mySelect = createSelect(true)`, then the dropdown will support + * multiple selections. If an existing `<select></select>` element + * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing + * element will be wrapped in a new p5.Element + * object. + * + * Dropdowns extend the p5.Element class with a few + * helpful methods for managing options: + * - `mySelect.option(name, [value])` adds an option to the menu. The first paremeter, `name`, is a string that sets the option's name and value. The second parameter, `value`, is optional. If provided, it sets the value that corresponds to the key `name`. If an option with `name` already exists, its value is changed to `value`. + * - `mySelect.value()` returns the currently-selected option's value. + * - `mySelect.selected()` returns the currently-selected option. + * - `mySelect.selected(option)` selects the given option by default. + * - `mySelect.disable()` marks the whole dropdown element as disabled. + * - `mySelect.disable(option)` marks a given option as disabled. + * - `mySelect.enable()` marks the whole dropdown element as enabled. + * - `mySelect.enable(option)` marks a given option as enabled. * * @method createSelect - * @param {boolean} [multiple] true if dropdown should support multiple selections - * @return {p5.Element} pointer to p5.Element holding created node + * @param {boolean} [multiple] support multiple selections. + * @return {p5.Element} new p5.Element object. * @example - *
- * let sel; + *
+ * + * let mySelect; * * function setup() { - * textAlign(CENTER); - * background(200); - * sel = createSelect(); - * sel.position(10, 10); - * sel.option('pear'); - * sel.option('kiwi'); - * sel.option('grape'); - * sel.selected('kiwi'); - * sel.changed(mySelectEvent); + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * // Set the selected option to "red". + * mySelect.selected('red'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); * } * - * function mySelectEvent() { - * let item = sel.value(); - * background(200); - * text('It is a ' + item + '!', 50, 50); + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); * } - *
+ *
+ *
* - *
- * let sel; + *
+ * + * let mySelect; * * function setup() { - * textAlign(CENTER); - * background(200); - * sel = createSelect(); - * sel.position(10, 10); - * sel.option('oil'); - * sel.option('milk'); - * sel.option('bread'); - * sel.disable('milk'); + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * // Set the selected option to "red". + * mySelect.selected('red'); + * + * // Disable the "yellow" option. + * mySelect.disable('yellow'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); * } - *
- *
- * let sel; + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
+ * + *
+ * + * let mySelect; * * function setup() { - * textAlign(CENTER); + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options with names and values. + * mySelect.option('one', 'red'); + * mySelect.option('two', 'green'); + * mySelect.option('three', 'blue'); + * mySelect.option('four', 'yellow'); + * + * // Set the selected option to "one". + * mySelect.selected('one'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
+ * + *
+ * + * // Hold CTRL to select multiple options on Windows and Linux. + * // Hold CMD to select multiple options on macOS. + * let mySelect; + * + * function setup() { + * // Create a dropdown and allow multiple selections. + * // Place it beneath the canvas. + * mySelect = createSelect(true); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * describe('A gray square with a dropdown menu beneath it. Colorful circles appear when their color is selected.'); + * } + * + * function draw() { * background(200); - * sel = createSelect(); - * sel.position(10, 10); - * sel.option('oil'); - * sel.option('milk'); - * sel.option('bread'); - * // disable milk and oil - * sel.disable('milk'); - * sel.disable('oil'); - * // enable milk again - * sel.enable('milk'); + * + * // Use the selected value(s) to draw circles. + * let colors = mySelect.selected(); + * colors.forEach((c, index) => { + * let x = 10 + index * 20; + * fill(c); + * circle(x, 50, 20); + * }); * } - *
+ *
+ *
*/ /** * @method createSelect - * @param {Object} existing DOM select element + * @param {Object} existing select element to wrap, either as a p5.Element or + * a HTMLSelectElement. * @return {p5.Element} */ _main.default.prototype.createSelect = function () { @@ -74301,75 +75858,137 @@ return self; }; /** - * Creates a radio button element in the DOM. It also helps existing radio buttons - * assign methods of p5.Element. - * - `.option(value, [label])` can be used to create a new option for the - * element. If an option with a value already exists, it will be returned. - * It is recommended to use string values as input for `value`. - * Optionally, a label can be provided as second argument for the option. - * - `.remove(value)` can be used to remove an option for the element. String - * values recommended as input for `value`. - * - `.value()` method will return the currently selected value. - * - `.selected()` method will return the currently selected input element. - * - `.selected(value)` method will select the option and return it. String - * values recommended as input for `value`. - * - `.disable(Boolean)` method will enable/disable the whole radio button element. + * Creates a radio button element. + * + * The parameter is optional. If a string is passed, as in + * `let myRadio = createSelect('food')`, then each radio option will + * have `"food"` as its `name` parameter: `<input name="food"></input>`. + * If an existing `<div></div>` or `<span></span>` + * element is passed, as in `let myRadio = createSelect(container)`, it will + * become the radio button's parent element. + * + * Radio buttons extend the p5.Element class with a few + * helpful methods for managing options: + * - `myRadio.option(value, [label])` adds an option to the menu. The first paremeter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned. + * - `myRadio.value()` returns the currently-selected option's value. + * - `myRadio.selected()` returns the currently-selected option. + * - `myRadio.selected(value)` selects the given option and returns it as an `HTMLInputElement`. + * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed. * * @method createRadio - * @param {Object} containerElement A container HTML Element, either a div - * or span, inside which all existing radio inputs will be considered as options. - * @param {string} [name] A name parameter for each Input Element. - * @return {p5.Element} pointer to p5.Element holding created node + * @param {Object} [containerElement] container HTML Element, either a `<div></div>` + * or `<span></span>`. + * @return {p5.Element} new p5.Element object. * @example - *
- * let radio; + *
+ * + * let myRadio; * * function setup() { - * radio = createRadio(); - * radio.option('black'); - * radio.option('white'); - * radio.option('gray'); - * radio.style('width', '60px'); - * textAlign(CENTER); - * fill(255, 0, 0); + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(60); + * + * // Add a few color options. + * myRadio.option('red'); + * myRadio.option('yellow'); + * myRadio.option('blue'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * describe('A yellow square with three color options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option.'); * } * * function draw() { - * let val = radio.value(); - * background(val); - * text(val, width / 2, height / 2); + * // Set the background color using the radio button. + * let g = myRadio.value(); + * background(g); * } - *
- *
- * let radio; + * + *
+ * + *
+ * + * let myRadio; * * function setup() { - * radio = createRadio(); - * radio.option('1', 'apple'); - * radio.option('2', 'bread'); - * radio.option('3', 'juice'); - * radio.style('width', '30px'); - * radio.selected('2'); - * textAlign(CENTER); + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(50); + * + * // Add a few color options. + * // Color values are labeled with + * // emotions they evoke. + * myRadio.option('red', 'love'); + * myRadio.option('yellow', 'joy'); + * myRadio.option('blue', 'trust'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * describe('A yellow square with three options listed, "love", "joy", and "trust". The square changes color when the user selects a new option.'); * } * * function draw() { - * background(200); - * let val = radio.value(); - * if (val) { - * text('item cost is $' + val, width / 2, height / 2); - * } + * // Set the background color using the radio button. + * let c = myRadio.value(); + * background(c); * } - *
+ *
+ *
+ * + *
+ * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(50); + * + * // Add a few color options. + * myRadio.option('red'); + * myRadio.option('yellow'); + * myRadio.option('blue'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * // Create a button and place it beneath the canvas. + * let btn = createButton('disable'); + * btn.position(0, 100); + * + * // Use the button to disable the radio button. + * btn.mousePressed(() => { + * myRadio.disable(true); + * }); + * + * describe('A yellow square with three options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option. A "disable" button beneath the canvas disables the color options when pressed.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let c = myRadio.value(); + * background(c); + * } + * + *
*/ /** * @method createRadio - * @param {String} name - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [name] name parameter assigned to each option's `<input></input>` element. + * @return {p5.Element} new p5.Element object. */ /** * @method createRadio - * @return {p5.Element} pointer to p5.Element holding created node + * @return {p5.Element} new p5.Element object. */ _main.default.prototype.createRadio = function () { // Creates a div, adds each option as an individual input inside it. @@ -74625,57 +76244,62 @@ return self; }; /** - * Creates a colorPicker element in the DOM for color input. - * The .value() method will return a hex string (#rrggbb) of the color. - * The .color() method will return a p5.Color - * object with the current chosen color. + * Creates a color picker element. + * + * The parameter, `value`, is optional. If a color string or + * p5.Color object is passed, it will set the default + * color. + * + * Color pickers extend the p5.Element class with a + * couple of helpful methods for managing colors: + * - `myPicker.value()` returns the current color as a hex string in the format `'#rrggbb'`. + * - `myPicker.color()` returns the current color as a p5.Color object. + * * * @method createColorPicker - * @param {String|p5.Color} [value] default color of element - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String|p5.Color} [value] default color as a CSS color string. + * @return {p5.Element} new p5.Element object. * @example - *
- * let colorPicker; + *
+ * + * let myPicker; + * * function setup() { - * createCanvas(100, 100); - * colorPicker = createColorPicker('#ed225d'); - * colorPicker.position(0, height + 5); + * myPicker = createColorPicker('deeppink'); + * myPicker.position(0, 100); + * + * describe('A pink square with a color picker beneath it. The square changes color when the user picks a new color.'); * } * * function draw() { - * background(colorPicker.color()); + * // Use the color picker to paint the background. + * let c = myPicker.color(); + * background(c); * } - *
- *
- * let inp1, inp2; + * + *
+ * + *
+ * + * let myPicker; + * * function setup() { - * createCanvas(100, 100); - * background('grey'); - * inp1 = createColorPicker('#ff0000'); - * inp1.position(0, height + 5); - * inp1.input(setShade1); - * inp2 = createColorPicker(color('yellow')); - * inp2.position(0, height + 30); - * inp2.input(setShade2); - * setMidShade(); - * } + * myPicker = createColorPicker('deeppink'); + * myPicker.position(0, 100); * - * function setMidShade() { - * // Finding a shade between the two - * let commonShade = lerpColor(inp1.color(), inp2.color(), 0.5); - * fill(commonShade); - * rect(20, 20, 60, 60); + * describe('A number with the format "#rrggbb" is displayed on a pink canvas. The background color and number change when the user picks a new color.'); * } * - * function setShade1() { - * setMidShade(); - * console.log('You are choosing shade 1 to be : ', this.value()); - * } - * function setShade2() { - * setMidShade(); - * console.log('You are choosing shade 2 to be : ', this.value()); + * function draw() { + * // Use the color picker to paint the background. + * let c = myPicker.value(); + * background(c); + * + * // Display the current color as a hex string. + * text(c, 25, 55); * } - *
+ *
+ *
*/ _main.default.prototype.createColorPicker = function (value) { _main.default._validateParameters('createColorPicker', arguments); @@ -74728,29 +76352,68 @@ return self; }; /** - * Creates an `<input></input>` element in the DOM for text input. - * Use .size() to set the display length of the box. + * Creates a text `<input></input>` element. Call `myInput.size()` + * to set the length of the text box. + * + * The first parameter, `value`, is optional. It's a string that sets the + * input's default value. The input is blank by default. + * + * The second parameter, `type`, is also optional. It's a string that + * specifies the type of text being input. See MDN for a full + * list of options. + * The default is `'text'`. * * @method createInput - * @param {String} value default value of the input box - * @param {String} [type] type of text, ie text, password etc. Defaults to text. - * Needs a value to be specified first. - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} [value] default value of the input box. Defaults to an empty string `''`. + * @param {String} [type] type of input. Defaults to `'text'`. + * @return {p5.Element} new p5.Element object. * @example - *
+ *
+ * + * let myInput; + * * function setup() { - * createCanvas(100, 100); - * background('grey'); - * let inp = createInput(''); - * inp.position(0, 0); - * inp.size(100); - * inp.input(myInputEvent); + * // Create an input element and place it + * // beneath the canvas. + * myInput = createInput(); + * myInput.position(0, 100); + * + * describe('A gray square with a text box beneath it. The text in the square changes when the user types something new in the input bar.'); * } * - * function myInputEvent() { - * console.log('you are typing: ', this.value()); + * function draw() { + * background(200); + * + * // Use the input to display a message. + * let msg = myInput.value(); + * text(msg, 25, 55); * } - *
+ *
+ *
+ * + *
+ * + * let myInput; + * + * function setup() { + * // Create an input element and place it + * // beneath the canvas. Set its default + * // text to "hello!". + * myInput = createInput('hello!'); + * myInput.position(0, 100); + * + * describe('The text "hello!" written at the center of a gray square. A text box beneath the square also says "hello!". The text in the square changes when the user types something new in the input bar.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input to display a message. + * let msg = myInput.value(); + * text(msg, 25, 55); + * } + * + *
*/ /** * @method createInput @@ -74767,32 +76430,49 @@ return addElement(elt, this); }; /** - * Creates an `<input></input>` element in the DOM of type 'file'. + * Creates an `<input></input>` element of type `'file'`. * This allows users to select local files for use in a sketch. * + * The first parameter, `callback`, is a function that's called when the file + * loads. The callback function should have one parameter, `file`, that's a + * p5.File object. + * + * The second parameter, `multiple`, is optional. It's a boolean value that + * allows loading multiple files if set to `true`. If `true`, `callback` + * will be called once per file. + * * @method createFileInput - * @param {Function} callback callback function for when a file is loaded - * @param {Boolean} [multiple] optional, to allow multiple files to be selected - * @return {p5.Element} pointer to p5.Element holding created DOM element + * @param {Function} callback function to call once the file loads. + * @param {Boolean} [multiple] allow multiple files to be selected. + * @return {p5.Element} new p5.Element object. * @example - *
+ *
+ * + * // Use the file input to select an image to + * // load and display. * let input; * let img; * * function setup() { - * input = createFileInput(handleFile); - * input.position(0, 0); + * // Create a file input and place it beneath + * // the canvas. + * input = createFileInput(handleImage); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); * } * * function draw() { - * background(255); + * background(200); + * + * // Draw the image if loaded. * if (img) { * image(img, 0, 0, width, height); * } * } * - * function handleFile(file) { - * print(file); + * // Create an image if the file is an image. + * function handleImage(file) { * if (file.type === 'image') { * img = createImg(file.data, ''); * img.hide(); @@ -74800,7 +76480,48 @@ * img = null; * } * } - *
+ *
+ *
+ * + *
+ * + * // Use the file input to select multiple images + * // to load and display. + * let input; + * let images = []; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. Allow it to load multiple files. + * input = createFileInput(handleImage, true); + * input.position(0, 100); + * } + * + * function draw() { + * background(200); + * + * // Draw the images if loaded. Each image + * // is drawn 20 pixels lower than the + * // previous image. + * images.forEach((img, index) => { + * let y = index * 20; + * image(img, 0, y, width, height); + * }); + * + * describe('A gray square with a file input beneath it. If the user selects multiple image files to load, they are displayed on the square.'); + * } + * + * // Create an image if the file is an image, + * // then add it to the images array. + * function handleImage(file) { + * if (file.type === 'image') { + * let img = createImg(file.data, ''); + * img.hide(); + * images.push(img); + * } + * } + * + *
*/ _main.default.prototype.createFileInput = function (callback) { var multiple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; @@ -74900,45 +76621,90 @@ }); return mediaEl; } /** - * Creates an HTML5 `<video>` element in the DOM for simple playback - * of audio/video. Shown by default, can be hidden with .hide() - * and drawn into canvas using image(). The first parameter - * can be either a single string path to a video file, or an array of string - * paths to different formats of the same video. This is useful for ensuring - * that your video can play across different browsers, as each supports - * different formats. See this - * page for further information about supported formats. + * Creates a `<video>` element for simple audio/video playback. + * Returns a new p5.MediaElement object. + * + * Videos are shown by default. They can be hidden by calling `video.hide()` + * and drawn to the canvas using image(). + * + * The first parameter, `src`, is the path the video. If a single string is + * passed, as in `'assets/topsecret.mp4'`, a single video is loaded. An array + * of strings can be used to load the same video in different formats. For + * example, `['assets/topsecret.mp4', 'assets/topsecret.ogv', 'assets/topsecret.webm']`. + * This is useful for ensuring that the video can play across different browsers with + * different capabilities. See + * MDN + * for more information about supported formats. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the video is ready to play. * * @method createVideo - * @param {String|String[]} src path to a video file, or array of paths for - * supporting different browsers - * @param {Function} [callback] callback function to be called upon - * 'canplaythrough' event fire, that is, when the - * browser can play the media, and estimates that - * enough data has been loaded to play the media - * up to its end without having to stop for - * further buffering of content - * @return {p5.MediaElement} pointer to video p5.MediaElement + * @param {String|String[]} src path to a video file, or an array of paths for + * supporting different browsers. + * @param {Function} [callback] function to call once the video is ready to play. + * @return {p5.MediaElement} new p5.MediaElement object. * @example - *
- * let vid; + *
+ * * function setup() { * noCanvas(); * - * vid = createVideo( + * // Load a video and add it to the page. + * // Note: this may not work in some browsers. + * let video = createVideo('assets/small.mp4'); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + *
+ * + *
+ * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Provide an array options for different file formats. + * let video = createVideo( + * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'] + * ); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + *
+ * + *
+ * + * let video; + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Provide an array options for different file formats. + * // Call mute() once the video loads. + * video = createVideo( * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'], - * vidLoad + * muteVideo * ); + * // Show the default video controls. + * video.showControls(); * - * vid.size(100, 100); + * describe('A video of a toy robot with playback controls beneath it.'); * } * - * // This function is called when the video loads - * function vidLoad() { - * vid.loop(); - * vid.volume(0); + * // Mute the video once it loads. + * function muteVideo() { + * video.volume(0); * } - *
+ *
+ *
*/ _main.default.prototype.createVideo = function (src, callback) { @@ -74947,36 +76713,41 @@ }; /** AUDIO STUFF **/ /** - * Creates a hidden HTML5 `<audio>` element in the DOM for simple audio - * playback. The first parameter can be either a single string path to a - * audio file, or an array of string paths to different formats of the same - * audio. This is useful for ensuring that your audio can play across - * different browsers, as each supports different formats. - * See this - * page for further information about supported formats. + * Creates a hidden `<audio>` element for simple audio playback. + * Returns a new p5.MediaElement object. + * + * The first parameter, `src`, is the path the video. If a single string is + * passed, as in `'assets/video.mp4'`, a single video is loaded. An array + * of strings can be used to load the same video in different formats. For + * example, `['assets/video.mp4', 'assets/video.ogv', 'assets/video.webm']`. + * This is useful for ensuring that the video can play across different + * browsers with different capabilities. See + * MDN + * for more information about supported formats. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the audio is ready to play. * * @method createAudio - * @param {String|String[]} [src] path to an audio file, or array of paths - * for supporting different browsers - * @param {Function} [callback] callback function to be called upon - * 'canplaythrough' event fire, that is, when the - * browser can play the media, and estimates that - * enough data has been loaded to play the media - * up to its end without having to stop for - * further buffering of content - * @return {p5.MediaElement} pointer to audio p5.MediaElement + * @param {String|String[]} [src] path to an audio file, or an array of paths + * for supporting different browsers. + * @param {Function} [callback] function to call once the audio is ready to play. + * @return {p5.MediaElement} new p5.MediaElement object. * @example - *
- * let ele; + *
+ * * function setup() { - * ele = createAudio('assets/beat.mp3'); + * noCanvas(); * - * // here we set the element to autoplay - * // The element will play as soon - * // as it is able to do so. - * ele.autoplay(true); + * // Load the audio. + * let beat = createAudio('assets/beat.mp3'); + * // Show the default audio controls. + * beat.showControls(); + * + * describe('An audio beat plays when the user double-clicks the square.'); * } - *
+ *
+ *
*/ _main.default.prototype.createAudio = function (src, callback) { _main.default._validateParameters('createAudio', arguments); @@ -75009,44 +76780,66 @@ }); }; } /** - * Creates a new HTML5 `<video>` element that contains the audio/video feed - * from a webcam. The element is separate from the canvas and is displayed by - * default. The element can be hidden using .hide(). - * The feed can be drawn onto the canvas using image(). - * The loadedmetadata property can be used to detect when the element has fully - * loaded (see second example). - * - * More specific properties of the feed can be passing in a Constraints object. - * See the - * W3C spec for possible properties. Note that not all of these are supported - * by all browsers. - * - * Security note: A new browser security specification requires that - * getUserMedia, which is behind createCapture(), - * only works when you're running the code locally, or on HTTPS. Learn more - * here - * and here. + * Creates a `<video>` element that "captures" the audio/video stream from + * the webcam and microphone. Returns a new + * p5.Element object. + * + * Videos are shown by default. They can be hidden by calling `capture.hide()` + * and drawn to the canvas using image(). + * + * The first parameter, `type`, is optional. It sets the type of capture to + * use. By default, `createCapture()` captures both audio and video. If `VIDEO` + * is passed, as in `createCapture(VIDEO)`, only video will be captured. + * If `AUDIO` is passed, as in `createCapture(AUDIO)`, only audio will be + * captured. A constraints object can also be passed to customize the stream. + * See the + * W3C documentation for possible properties. Different browsers support different + * properties. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the capture is ready for use. The callback function should have one + * parameter, `stream`, that's a + * MediaStream object. + * + * Note: `createCapture()` only works when running a sketch locally or using HTTPS. Learn more + * here + * and here. * * @method createCapture - * @param {String|Constant|Object} type type of capture, either VIDEO or - * AUDIO if none specified, default both, - * or a Constraints object - * @param {Function} [callback] function to be called once - * stream has loaded - * @return {p5.Element} capture video p5.Element + * @param {String|Constant|Object} [type] type of capture, either AUDIO or VIDEO, + * or a constraints object. Both video and audio + * audio streams are captured by default. + * @param {Function} [callback] function to call once the stream + * has loaded. + * @return {p5.Element} new p5.Element object. * @example *
* + * function setup() { + * noCanvas(); + * createCapture(VIDEO); + * + * describe('A video stream from the webcam.'); + * } + * + *
+ * + *
+ * * let capture; * * function setup() { - * createCanvas(100, 100); + * // Create the video capture and hide the element. * capture = createCapture(VIDEO); * capture.hide(); + * + * describe('A video stream from the webcam with inverted colors.'); * } * * function draw() { + * // Draw the video capture within the canvas. * image(capture, 0, 0, width, width * capture.height / capture.width); + * // Invert the colors in the stream. * filter(INVERT); * } * @@ -75056,6 +76849,8 @@ * * function setup() { * createCanvas(480, 120); + * + * // Create a constraints object. * let constraints = { * video: { * mandatory: { @@ -75064,28 +76859,13 @@ * }, * optional: [{ maxFrameRate: 10 }] * }, - * audio: true + * audio: false * }; - * createCapture(constraints, function(stream) { - * console.log(stream); - * }); - * } - * - *
- *
- * - * let capture; * - * function setup() { - * createCanvas(640, 480); - * capture = createCapture(VIDEO); - * } - * function draw() { - * background(0); - * if (capture.loadedmetadata) { - * let c = capture.get(0, 0, 100, 100); - * image(c, 0, 0); - * } + * // Create the video capture. + * createCapture(constraints); + * + * describe('A video stream from the webcam.'); * } * *
@@ -75147,18 +76927,48 @@ return videoEl; }; /** - * Creates element with given tag in the DOM with given content. + * Creates a new p5.Element object. + * + * The first parameter, `tag`, is a string an HTML tag such as `'h5'`. + * + * The second parameter, `content`, is optional. It's a string that sets the + * HTML content to insert into the new element. New elements have no content + * by default. * * @method createElement - * @param {String} tag tag for the new element - * @param {String} [content] html content to be inserted into the element - * @return {p5.Element} pointer to p5.Element holding created node + * @param {String} tag tag for the new element. + * @param {String} [content] HTML content to insert into the element. + * @return {p5.Element} new p5.Element object. * @example - *
- * let h5 = createElement('h5', 'im an h5 p5.element!'); - * h5.style('color', '#00a1d3'); - * h5.position(0, 0); - *
+ *
+ * + * function setup() { + * background(200); + * + * // Create an h5 element with nothing in it. + * createElement('h5'); + * + * describe('A gray square.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create an h5 element with the content + * // "p5*js". + * let h5 = createElement('h5', 'p5*js'); + * // Set the element's style and position. + * h5.style('color', 'deeppink'); + * h5.position(30, 15); + * + * describe('The text "p5*js" written in pink in the middle of a gray square.'); + * } + * + *
*/ _main.default.prototype.createElement = function (tag, content) { _main.default._validateParameters('createElement', arguments); @@ -75523,48 +77333,108 @@ return this; }; /** - * Sets the given style (CSS) property (1st arg) of the element with the - * given value (2nd arg). If a single argument is given, .style() - * returns the value of the given property; however, if a single argument - * is given in CSS syntax ('text-align:center'), .style() sets the CSS - * appropriately. + * Applies a style to an element by adding a + * CSS declaration. + * + * The first parameter, `property`, is a string. If the name of a style + * property is passed, as in `myElement.style('color')`, the method returns + * the current value as a string or `null` if it hasn't been set. If a + * `property:style` string is passed, as in + * `myElement.style('color:deeppink')`, the method sets `property` to + * `value`. + * + * The second parameter, `value`, is optional. It sets the property's value. + * `value` can be a string, as in + * `myElement.style('color', 'deeppink')`, or a + * p5.Color object, as in + * `myElement.style('color', myColor)`. * * @method style - * @param {String} property property to be set - * @returns {String} value of property + * @param {String} property style property to set. + * @returns {String} value of the property. * @example - *
- * let myDiv = createDiv('I like pandas.'); - * myDiv.style('font-size', '18px'); - * myDiv.style('color', '#ff0000'); - * myDiv.position(0, 0); - *
- *
- * let col = color(25, 23, 200, 50); - * let button = createButton('button'); - * button.style('background-color', col); - * button.position(0, 0); - *
- *
- * let myDiv, fontSize; + *
+ * + * function setup() { + * background(200); + * + * // Create a paragraph element and + * // set its font color to "deeppink". + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color', 'deeppink'); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
+ * + *
+ * * function setup() { * background(200); - * myDiv = createDiv('I like gray.'); - * myDiv.position(0, 0); - * myDiv.style('z-index', 10); + * + * // Create a p5.Color object. + * let c = color('deeppink'); + * + * // Create a paragraph element and + * // set its font color using a + * // p5.Color object. + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color', c); + * + * describe('The text p5*js written in pink on a gray background.'); * } + * + *
* - * function draw() { - * fontSize = min(mouseX, 90); - * myDiv.style('font-size', fontSize + 'px'); + *
+ * + * function setup() { + * background(200); + * + * // Create a paragraph element and + * // set its font color to "deeppink" + * // using property:value syntax. + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color:deeppink'); + * + * describe('The text p5*js written in pink on a gray background.'); * } - *
+ *
+ *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create an empty paragraph element + * // and set its font color to "deeppink". + * let p = createP(); + * p.position(5, 5); + * p.style('color', 'deeppink'); + * + * // Get the element's color as an + * // RGB color string. + * let c = p.style('color'); + * + * // Set the element's inner HTML + * // using the RGB color string. + * p.html(c); + * + * describe('The text "rgb(255, 20, 147)" written in pink on a gray background.'); + * } + * + *
*/ /** * @method style * @param {String} property - * @param {String|p5.Color} value value to assign to property - * @return {String} current value of property, if no value is given as second argument + * @param {String|p5.Color} value value to assign to the property. + * @return {String} value of the property. * @chainable */ _main.default.Element.prototype.style = function (prop, val) { @@ -75601,24 +77471,69 @@ return this; }; /** + * Adds an + * attribute + * to the element. This method is useful for advanced tasks. + * + * Most commonly-used attributes, such as `id`, can be set with their + * dedicated methods. For example, `nextButton.id('next')` sets an element's + * `id` attribute. * - * Adds a new attribute or changes the value of an existing attribute - * on the specified element. If no value is specified, returns the - * value of the given attribute, or null if the attribute is not set. + * The first parameter, `attr`, is the attribute's name as a string. Calling + * `myElement.attribute('align')` returns the attribute's current value as a + * string or `null` if it hasn't been set. + * + * The second parameter, `value`, is optional. It's a string used to set the + * attribute's value. For example, calling + * `myElement.attribute('align', 'center')` sets the element's horizontal + * alignment to `center`. * * @method attribute - * @return {String} value of attribute + * @return {String} value of the attribute. * * @example - *
- * let myDiv = createDiv('I like pandas.'); - * myDiv.attribute('align', 'center'); - *
+ *
+ * + * function setup() { + * // Create a container div and + * // place it at the top-left + * // corner. + * let container = createDiv(); + * container.position(0, 0); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "left". + * let p1 = createP('hi'); + * p1.parent(container); + * p1.attribute('align', 'left'); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "center". + * let p2 = createP('hi'); + * p2.parent(container); + * p2.attribute('align', 'center'); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "right". + * let p3 = createP('hi'); + * p3.parent(container); + * p3.attribute('align', 'right'); + * + * describe('A gray square with the text "hi" written on three separate lines, each placed further to the right.'); + * } + * + *
*/ /** * @method attribute - * @param {String} attr attribute to set - * @param {String} value value to assign to attribute + * @param {String} attr attribute to set. + * @param {String} value value to assign to the attribute. * @chainable */ _main.default.Element.prototype.attribute = function (attr, value) { @@ -75640,35 +77555,39 @@ } }; /** + * Removes an attribute from the element. * - * Removes an attribute on the specified element. + * The parameter `attr` is the attribute's name as a string. For example, + * calling `myElement.removeAttribute('align')` removes its `align` + * attribute if it's been set. * * @method removeAttribute - * @param {String} attr attribute to remove + * @param {String} attr attribute to remove. * @chainable * * @example - *
- * let button; - * let checkbox; + *
+ * + * let p; * * function setup() { - * checkbox = createCheckbox('enable', true); - * checkbox.changed(enableButton); - * button = createButton('button'); - * button.position(10, 10); + * background(200); + * + * // Create a paragraph element and place it + * // in the center of the canvas. + * // Set its "align" attribute to "center". + * p = createP('hi'); + * p.position(0, 20); + * p.attribute('align', 'center'); + * + * describe('The text "hi" written in black at the center of a gray square. The text moves to the left edge when double-clicked.'); * } * - * function enableButton() { - * if (this.checked()) { - * // Re-enable the button - * button.removeAttribute('disabled'); - * } else { - * // Disable the button - * button.attribute('disabled', ''); - * } + * function doubleClicked() { + * p.removeAttribute('align'); * } - *
+ *
+ *
*/ _main.default.Element.prototype.removeAttribute = function (attr) { if (this.elt.firstChild != null && (this.elt.firstChild.type === 'checkbox' || this.elt.firstChild.type === 'radio')) { @@ -75680,34 +77599,68 @@ return this; }; /** - * Either returns the value of the element if no arguments - * given, or sets the value of the element. + * Returns or sets the element's value. + * + * Calling `myElement.value()` returns the element's current value. + * + * The parameter, `value`, is an optional number or string. If provided, + * as in `myElement.value(123)`, it's used to set the element's value. * * @method value - * @return {String|Number} value of the element + * @return {String|Number} value of the element. * @example - *
- * // gets the value + *
+ * * let inp; + * * function setup() { - * inp = createInput(''); + * // Create a text input and place it + * // beneath the canvas. Set its default + * // value to "hello". + * inp = createInput('hello'); + * inp.position(0, 100); + * + * describe('The text from an input box is displayed on a gray square.'); * } * - * function mousePressed() { - * print(inp.value()); + * function draw() { + * background(200); + * + * // Use the input's value to display a message. + * let msg = inp.value(); + * text(msg, 0, 55); * } - *
- *
- * // sets the value + * + *
+ * + *
+ * * let inp; + * * function setup() { - * inp = createInput('myValue'); + * // Create a text input and place it + * // beneath the canvas. Set its default + * // value to "hello". + * inp = createInput('hello'); + * inp.position(0, 100); + * + * describe('The text from an input box is displayed on a gray square. The text resets to "hello" when the user double-clicks the square.'); * } * - * function mousePressed() { - * inp.value('myValue'); + * function draw() { + * background(200); + * + * // Use the input's value to display a message. + * let msg = inp.value(); + * text(msg, 0, 55); * } - *
+ * + * // Reset the input's value. + * function doubleClicked() { + * inp.value('hello'); + * } + *
+ *
*/ /** * @method value @@ -75725,65 +77678,174 @@ } }; /** - * - * Shows the current element. Essentially, setting display:block for the style. + * Shows the current element. * * @method show * @chainable * @example - *
- * let div = createDiv('div'); - * div.style('display', 'none'); - * div.show(); // turns display to block - *
+ *
+ * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element and hide it. + * p = createP('p5*js'); + * p.position(10, 10); + * p.hide(); + * + * describe('A gray square. The text "p5*js" appears when the user double-clicks the square.'); + * } + * + * // Show the paragraph when double-clicked. + * function doubleClicked() { + * p.show(); + * } + * + *
*/ _main.default.Element.prototype.show = function () { this.elt.style.display = 'block'; return this; }; /** - * Hides the current element. Essentially, setting display:none for the style. + * Hides the current element. * * @method hide * @chainable * @example - *
- * let div = createDiv('this is a div'); - * div.hide(); - *
+ * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element. + * p = createP('p5*js'); + * p.position(10, 10); + * + * describe('The text "p5*js" at the center of a gray square. The text disappears when the user double-clicks the square.'); + * } + * + * // Hide the paragraph when double-clicked. + * function doubleClicked() { + * p.hide(); + * } + * + *
*/ _main.default.Element.prototype.hide = function () { this.elt.style.display = 'none'; return this; }; /** + * Sets the element's width and height. + * + * Calling `myElement.size()` without an argument returns the element's size + * as an object with the properties `width` and `height`. For example, + * `{ width: 20, height: 10 }`. * - * Sets the width and height of the element. AUTO can be used to - * only adjust one dimension at a time. If no arguments are given, it - * returns the width and height of the element in an Object. In the case of - * elements that need to be loaded, such as images, it is recommended - * to call the function after the element has finished loading. + * The first parameter, `width`, is optional. It's a number used to set the + * element's width. Calling `myElement.size(10)` + * + * The second parameter, 'height`, is also optional. It's a + * number used to set the element's height. For example, calling + * `myElement.size(20, 10)` sets the element's width to 20 pixels and height + * to 10 pixels. + * + * The constant `AUTO` can be used to adjust one dimension at a time while + * maintaining the aspect ratio, which is `width / height`. For example, + * consider an element that's 200 pixels wide and 100 pixels tall. Calling + * `myElement.size(20, AUTO)` sets the width to 20 pixels and height to 10 + * pixels. + * + * Note: In the case of elements that need to load data, such as images, wait + * to call `myElement.size()` until after the data loads. * * @method size - * @return {Object} the width and height of the element in an object + * @return {Object} width and height of the element in an object. * @example - *
- * let div = createDiv('this is a div'); - * div.size(100, 100); - * let img = createImg( - * 'assets/rockies.jpg', - * 'A tall mountain with a small forest and field in front of it on a sunny day', - * '', - * () => { - * img.size(10, AUTO); - * } - * ); - *
+ *
+ * + * function setup() { + * background(200); + * + * // Create a pink div element and place it at + * // the top-left corner. + * let div = createDiv(); + * div.position(10, 10); + * div.style('background-color', 'deeppink'); + * + * // Set the div's width to 80 pixels and + * // height to 20 pixels. + * div.size(80, 20); + * + * describe('A gray square with a pink rectangle near its top.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Create a pink div element and place it at + * // the top-left corner. + * let div = createDiv(); + * div.position(10, 10); + * div.style('background-color', 'deeppink'); + * + * // Set the div's width to 80 pixels and + * // height to 40 pixels. + * div.size(80, 40); + * + * // Get the div's size as an object. + * let s = div.size(); + * // Write the div's dimensions. + * div.html(`${s.width} x ${s.height}`); + * + * describe('A gray square with a pink rectangle near its top. The text "80 x 40" is written within the rectangle.'); + * } + * + *
+ * + *
+ * + * function setup() { + * background(200); + * + * // Load an image of an astronaut on the moon + * // and place it at the top-left of the canvas. + * let img1 = createImg( + * 'assets/moonwalk.jpg', + * 'An astronaut walking on the moon', + * '' + * ); + * img1.position(0, 0); + * + * // Load an image of an astronaut on the moon + * // and place it at the top-left of the canvas. + * // Resize the image once it's loaded. + * let img2 = createImg( + * 'assets/moonwalk.jpg', + * 'An astronaut walking on the moon', + * '', + * () => { + * img2.size(50, AUTO); + * } + * ); + * img2.position(0, 0); + * + * describe('A gray square two copies of a space image at the top-left. The copy in front is smaller.'); + * } + * + *
*/ /** * @method size - * @param {Number|Constant} w width of the element, either AUTO, or a number - * @param {Number|Constant} [h] height of the element, either AUTO, or a number + * @param {Number|Constant} w width of the element, either AUTO, or a number. + * @param {Number|Constant} [h] height of the element, either AUTO, or a number. * @chainable */ _main.default.Element.prototype.size = function (w, h) { @@ -75839,13 +77901,31 @@ } }; /** - * Removes the element, stops all media streams, and deregisters all listeners. + * Removes the element, stops all audio/video streams, and removes all + * callback functions. + * * @method remove * @example - *
- * let myDiv = createDiv('this is some text'); - * myDiv.remove(); - *
+ *
+ * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element. + * p = createP('p5*js'); + * p.position(10, 10); + * + * describe('The text "p5*js" written at the center of a gray square. '); + * } + * + * // Remove the paragraph when double-clicked. + * function doubleClicked() { + * p.remove(); + * } + * + *
*/ _main.default.Element.prototype.remove = function () { // stop all audios/videos and detach all devices like microphone/camera etc @@ -75874,63 +77954,115 @@ } }; /** - * Registers a callback that gets called every time a file that is - * dropped on the element has been loaded. - * p5 will load every dropped file into memory and pass it as a p5.File object to the callback. - * Multiple files dropped at the same time will result in multiple calls to the callback. + * Sets a function to call when the user drops a file on the element. + * + * The first parameter, `callback`, is a function to call once the file loads. + * The callback function should have one parameter, `file`, that's a + * p5.File object. If the user drops multiple files on + * the element, `callback`, is called once for each file. * - * You can optionally pass a second callback which will be registered to the raw - * drop event. - * The callback will thus be provided the original + * The second parameter, `fxn`, is a function to call when the browser detects + * one or more dropped files. The callback function should have one + * parameter, `event`, that's a * DragEvent. - * Dropping multiple files at the same time will trigger the second callback once per drop, - * whereas the first callback will trigger for each loaded file. * * @method drop - * @param {Function} callback callback to receive loaded file, called for each file dropped. - * @param {Function} [fxn] callback triggered once when files are dropped with the drop event. + * @param {Function} callback called when a file loads. Called once for each file dropped. + * @param {Function} [fxn] called once when any files are dropped. * @chainable * @example - *
+ *
+ * + * // Drop an image on the canvas to view + * // this example. + * let img; + * * function setup() { * let c = createCanvas(100, 100); - * background(200); - * textAlign(CENTER); - * text('drop file', width / 2, height / 2); - * c.drop(gotFile); - * } * - * function gotFile(file) { * background(200); - * text('received file:', width / 2, height / 2); - * text(file.name, width / 2, height / 2 + 50); + * + * // Call a function when a file + * // dropped on the canvas has + * // loaded. + * c.drop(file => { + * // Remove the current image, if any. + * if (img) { + * img.remove(); + * } + * + * // Create an element with the + * // dropped file. + * img = createImg(file.data, ''); + * img.hide(); + * + * // Draw the image. + * image(img, 0, 0, width, height); + * }); + * + * describe('A gray square. When the user drops an image on the square, it is displayed.'); * } - *
+ *
+ *
* - *
+ *
+ * + * // Drop an image on the canvas to view + * // this example. * let img; + * let msg; * * function setup() { * let c = createCanvas(100, 100); + * * background(200); - * textAlign(CENTER); - * text('drop image', width / 2, height / 2); - * c.drop(gotFile); + * + * // Call functions when the user + * // drops a file on the canvas + * // and when the file loads. + * c.drop(handleFile, handleDrop); + * + * describe('A gray square. When the user drops an image on the square, it is displayed. The id attribute of canvas element is also displayed.'); * } * - * function draw() { + * function handleFile(file) { + * // Remove the current image, if any. * if (img) { - * image(img, 0, 0, width, height); + * img.remove(); * } - * } * - * function gotFile(file) { - * img = createImg(file.data, '').hide(); + * // Create an element with the + * // dropped file. + * img = createImg(file.data, ''); + * img.hide(); + * + * // Draw the image. + * image(img, 0, 0, width, height); * } - *
* - * @alt - * Canvas turns into whatever image is dragged/dropped onto it. + * function handleDrop(event) { + * // Remove current paragraph, if any. + * if (msg) { + * msg.remove(); + * } + * + * // Use event to get the drop + * // target's id. + * let id = event.target.id; + * + * // Write the canvas' id + * // beneath it. + * msg = createP(id); + * msg.position(0, 100); + * + * // Set the font color + * // randomly for each drop. + * let c = random(['red', 'green', 'blue']); + * msg.style('color', c); + * msg.style('font-size', '12px'); + * } + *
+ *
*/ _main.default.Element.prototype.drop = function (callback, fxn) { // Is the file stuff supported? @@ -75985,6 +78117,108 @@ } return this; }; + /** + * Turns p5.Element into a draggable item. If an argument is given, it will drag that p5.Element instead, ie. drag a entire GUI panel (parent container) with the panel's title bar. + * + * @method draggable + * @param {p5.Element} [elmnt] pass another p5.Element + * @chainable + * + * @example + *
+ * function setup() { + * createCanvas(100, 100); + * background(200); + * + * createDiv('Post-It') + * .position(5, 5) + * .size(75, 20) + * .style('font-size', '16px') + * .style('background', 'yellow') + * .style('color', '#000') + * .style('border', '1px solid #aaaa00') + * .style('padding', '5px') + * .draggable(); + * // .style('cursor', 'help') // override cursor + * + * let gui = createDiv('') + * .position(5, 40) + * .size(85, 50) + * .style('font-size', '16px') + * .style('background', 'yellow') + * .style('z-index', '100') + * .style('border', '1px solid #00aaaa'); + * + * createDiv('= PANEL =') + * .parent(gui) + * .style('background', 'cyan') + * .style('padding', '2px') + * .style('text-align', 'center') + * .draggable(gui); + * + * createSlider(0, 100, random(100)) + * .style('cursor', 'pointer') + * .size(80, 5) + * .parent(gui); + * } + *
+ */ + _main.default.Element.prototype.draggable = function (elmMove) { + var isTouch = ('ontouchstart' in window); + var x = 0, + y = 0, + px = 0, + py = 0, + elmDrag, + dragMouseDownEvt = isTouch ? 'touchstart' : 'mousedown', + closeDragElementEvt = isTouch ? 'touchend' : 'mouseup', + elementDragEvt = isTouch ? 'touchmove' : 'mousemove'; + if (elmMove === undefined) { + elmMove = this.elt; + elmDrag = elmMove; + } else if (elmMove !== this.elt && elmMove.elt !== this.elt) { + elmMove = elmMove.elt; + elmDrag = this.elt; + } + elmDrag.addEventListener(dragMouseDownEvt, dragMouseDown, false); + elmDrag.style.cursor = 'move'; + function dragMouseDown(e) { + e = e || window.event; + if (isTouch) { + var touches = e.changedTouches; + px = parseInt(touches[0].clientX); + py = parseInt(touches[0].clientY); + } else { + px = parseInt(e.clientX); + py = parseInt(e.clientY); + } + document.addEventListener(closeDragElementEvt, closeDragElement, false); + document.addEventListener(elementDragEvt, elementDrag, false); + return false; + } + function elementDrag(e) { + e = e || window.event; + if (isTouch) { + var touches = e.changedTouches; + x = px - parseInt(touches[0].clientX); + y = py - parseInt(touches[0].clientY); + px = parseInt(touches[0].clientX); + py = parseInt(touches[0].clientY); + } else { + x = px - parseInt(e.clientX); + y = py - parseInt(e.clientY); + px = parseInt(e.clientX); + py = parseInt(e.clientY); + } + elmMove.style.left = elmMove.offsetLeft - x + 'px'; + elmMove.style.top = elmMove.offsetTop - y + 'px'; + } + function closeDragElement() { + document.removeEventListener(closeDragElementEvt, closeDragElement, false); + document.removeEventListener(elementDragEvt, elementDrag, false); + } + return this; + }; /*** SCHEDULE EVENTS ***/ // Cue inspired by JavaScript setTimeout, and the // Tone.js Transport Timeline Event, MIT License Yotam Mann 2015 tonejs.org @@ -75999,15 +78233,38 @@ // p5.MediaElement additions // ============================================================================= /** - * Extends p5.Element to handle audio and video. In addition to the methods - * of p5.Element, it also contains methods for controlling media. It is not - * called directly, but p5.MediaElements are created by calling createVideo, - * createAudio, and createCapture. + * A class to handle audio and video. + * + * `p5.MediaElement` extends p5.Element with + * methods to handle audio and video. `p5.MediaElement` objects are created by + * calling createVideo, + * createAudio, and + * createCapture. * * @class p5.MediaElement * @constructor * @param {String} elt DOM node that is wrapped * @extends p5.Element + * @example + *
+ * + * let capture; + * + * function setup() { + * createCanvas(100, 100); + * + * // Create a p5.MediaElement using createCapture(). + * capture = createCapture(VIDEO); + * capture.hide(); + * } + * + * function draw() { + * // Display the video stream and invert the colors. + * image(capture, 0, 0, width, width * capture.height / capture.width); + * filter(INVERT); + * } + * + *
*/ var MediaElement = /*#__PURE__*/ function (_p5$Element) { _inherits(MediaElement, _p5$Element); @@ -76034,42 +78291,30 @@ // the internal canvas so we only update it if the frame has changed. _this._frameOnCanvas = - 1; /** - * Path to the media element source. + * Path to the media element's source as a string. * * @property src * @return {String} src * @example - *
- * let ele; + *
+ * + * let beat; * * function setup() { - * background(250); + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); * - * //p5.MediaElement objects are usually created - * //by calling the createAudio(), createVideo(), - * //and createCapture() functions. - * - * //In this example we create - * //a new p5.MediaElement via createAudio(). - * ele = createAudio('assets/beat.mp3'); - * - * //We'll set up our example so that - * //when you click on the text, - * //an alert box displays the MediaElement's - * //src field. - * textAlign(CENTER); - * text('Click Me!', width / 2, height / 2); + * describe('The text "https://p5js.org/reference/assets/beat.mp3" written in black on a gray background.'); * } * - * function mouseClicked() { - * //here we test if the mouse is over the - * //canvas element when it's clicked - * if (mouseX >= 0 && mouseX <= width && mouseY >= 0 && mouseY <= height) { - * //Show our p5.MediaElement's src field - * alert(ele.src); - * } + * function draw() { + * background(200); + * + * textWrap(CHAR); + * text(beat.src, 10, 10, 80, 80); * } - *
+ *
+ *
*/ Object.defineProperty(self, 'src', { get: function get() { @@ -76097,42 +78342,34 @@ }; return _this; } /** - * Play an HTML5 media element. + * Play audio or video from a media element. * * @method play * @chainable * @example - *
- * let ele; + *
+ * + * let beat; * * function setup() { - * //p5.MediaElement objects are usually created - * //by calling the createAudio(), createVideo(), - * //and createCapture() functions. - * - * //In this example we create - * //a new p5.MediaElement via createAudio(). - * ele = createAudio('assets/beat.mp3'); + * background(200); * - * background(250); * textAlign(CENTER); - * text('Click to Play!', width / 2, height / 2); - * } + * text('Click to play', 50, 50); * - * function mouseClicked() { - * //here we test if the mouse is over the - * //canvas element when it's clicked - * if (mouseX >= 0 && mouseX <= width && mouseY >= 0 && mouseY <= height) { - * //Here we call the play() function on - * //the p5.MediaElement we created above. - * //This will start the audio sample. - * ele.play(); + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); * - * background(200); - * text('You clicked Play!', width / 2, height / 2); - * } + * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks the square.'); * } - *
+ * + * // Play the beat when the user + * // presses the mouse. + * function mousePressed() { + * beat.play(); + * } + *
+ *
*/ _createClass(MediaElement, [ @@ -76168,62 +78405,52 @@ } return this; } /** - * Stops an HTML5 media element (sets current time to zero). + * Stops a media element and sets its current time to zero. Calling + * `media.play()` will restart playing audio/video from the beginning. * * @method stop * @chainable * @example - *
- * //This example both starts - * //and stops a sound sample - * //when the user clicks the canvas + *
+ * + * let beat; + * let isStopped = true; * - * //We will store the p5.MediaElement - * //object in here - * let ele; + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); * - * //while our audio is playing, - * //this will be set to true - * let sampleIsPlaying = false; + * describe('The text "Click to start" written in black on a gray background. The beat starts or stops when the user presses the mouse.'); + * } * - * function setup() { - * //Here we create a p5.MediaElement object - * //using the createAudio() function. - * ele = createAudio('assets/beat.mp3'); + * function draw() { * background(200); + * * textAlign(CENTER); - * text('Click to play!', width / 2, height / 2); + * if (isStopped === true) { + * text('Click to start', 50, 50); + * } else { + * text('Click to stop', 50, 50); + * } * } * - * function mouseClicked() { - * //here we test if the mouse is over the - * //canvas element when it's clicked - * if (mouseX >= 0 && mouseX <= width && mouseY >= 0 && mouseY <= height) { - * background(200); - * - * if (sampleIsPlaying) { - * //if the sample is currently playing - * //calling the stop() function on - * //our p5.MediaElement will stop - * //it and reset its current - * //time to 0 (i.e. it will start - * //at the beginning the next time - * //you play it) - * ele.stop(); - * - * sampleIsPlaying = false; - * text('Click to play!', width / 2, height / 2); - * } else { - * //loop our sound element until we - * //call ele.stop() on it. - * ele.loop(); - * - * sampleIsPlaying = true; - * text('Click to stop!', width / 2, height / 2); - * } + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isStopped === true) { + * // If the beat is stopped, + * // play it. + * beat.play(); + * isStopped = false; + * } else { + * // If the beat is playing, + * // stop it. + * beat.stop(); + * isStopped = true; * } * } - *
+ *
+ *
*/ }, @@ -76234,61 +78461,54 @@ this.elt.currentTime = 0; return this; } /** - * Pauses an HTML5 media element. + * Pauses a media element. Calling `media.play()` will resume playing + * audio/video from the moment it paused. * * @method pause * @chainable * @example - *
- * //This example both starts - * //and pauses a sound sample - * //when the user clicks the canvas + *
+ * + * let beat; + * let isPaused = true; * - * //We will store the p5.MediaElement - * //object in here - * let ele; + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); * - * //while our audio is playing, - * //this will be set to true - * let sampleIsPlaying = false; + * describe('The text "Click to play" written in black on a gray background. The beat plays or pauses when the user clicks the square.'); + * } * - * function setup() { - * //Here we create a p5.MediaElement object - * //using the createAudio() function. - * ele = createAudio('assets/lucky_dragons.mp3'); + * function draw() { * background(200); + * + * // Display different instructions + * // based on playback. * textAlign(CENTER); - * text('Click to play!', width / 2, height / 2); + * if (isPaused === true) { + * text('Click to play', 50, 50); + * } else { + * text('Click to pause', 50, 50); + * } * } * - * function mouseClicked() { - * //here we test if the mouse is over the - * //canvas element when it's clicked - * if (mouseX >= 0 && mouseX <= width && mouseY >= 0 && mouseY <= height) { - * background(200); - * - * if (sampleIsPlaying) { - * //Calling pause() on our - * //p5.MediaElement will stop it - * //playing, but when we call the - * //loop() or play() functions - * //the sample will start from - * //where we paused it. - * ele.pause(); - * - * sampleIsPlaying = false; - * text('Click to resume!', width / 2, height / 2); - * } else { - * //loop our sound element until we - * //call ele.pause() on it. - * ele.loop(); - * - * sampleIsPlaying = true; - * text('Click to pause!', width / 2, height / 2); - * } + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isPaused === true) { + * // If the beat is paused, + * // play it. + * beat.play(); + * isPaused = false; + * } else { + * // If the beat is playing, + * // pause it. + * beat.pause(); + * isPaused = true; * } * } - *
+ *
+ *
*/ }, @@ -76298,55 +78518,55 @@ this.elt.pause(); return this; } /** - * Set 'loop' to true for an HTML5 media element, and starts playing. + * Play the audio/video repeatedly in a loop. * * @method loop * @chainable * @example - *
- * //Clicking the canvas will loop - * //the audio sample until the user - * //clicks again to stop it - * - * //We will store the p5.MediaElement - * //object in here - * let ele; - * - * //while our audio is playing, - * //this will be set to true - * let sampleIsLooping = false; + *
+ * + * let beat; + * let isLooping = false; * * function setup() { - * //Here we create a p5.MediaElement object - * //using the createAudio() function. - * ele = createAudio('assets/lucky_dragons.mp3'); * background(200); - * textAlign(CENTER); - * text('Click to loop!', width / 2, height / 2); - * } * - * function mouseClicked() { - * //here we test if the mouse is over the - * //canvas element when it's clicked - * if (mouseX >= 0 && mouseX <= width && mouseY >= 0 && mouseY <= height) { - * background(200); + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); * - * if (!sampleIsLooping) { - * //loop our sound element until we - * //call ele.stop() on it. - * ele.loop(); + * describe('The text "Click to loop" written in black on a gray background. A beat plays repeatedly in a loop when the user clicks. The beat stops when the user clicks again.'); + * } * - * sampleIsLooping = true; - * text('Click to stop!', width / 2, height / 2); - * } else { - * ele.stop(); + * function draw() { + * background(200); * - * sampleIsLooping = false; - * text('Click to loop!', width / 2, height / 2); - * } + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isLooping === true) { + * text('Click to stop', 50, 50); + * } else { + * text('Click to loop', 50, 50); * } * } - *
+ * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isLooping === true) { + * // If the beat is looping, + * // stop it. + * beat.stop(); + * isLooping = false; + * } else { + * // If the beat is stopped, + * // loop it. + * beat.loop(); + * isLooping = true; + * } + * } + *
+ *
*/ }, @@ -76357,51 +78577,56 @@ this.play(); return this; } /** - * Set 'loop' to false for an HTML5 media element. Element will stop - * when it reaches the end. + * Stops the audio/video from playing in a loop. It will stop when it + * reaches the end. * * @method noLoop * @chainable * @example - *
- * //This example both starts - * //and stops loop of sound sample - * //when the user clicks the canvas - * - * //We will store the p5.MediaElement - * //object in here - * let ele; - * //while our audio is playing, - * //this will be set to true - * let sampleIsPlaying = false; + *
+ * + * let beat; + * let isPlaying = false; * * function setup() { - * //Here we create a p5.MediaElement object - * //using the createAudio() function. - * ele = createAudio('assets/beat.mp3'); * background(200); - * textAlign(CENTER); - * text('Click to play!', width / 2, height / 2); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks. The beat stops when the user clicks again.'); * } * - * function mouseClicked() { - * //here we test if the mouse is over the - * //canvas element when it's clicked - * if (mouseX >= 0 && mouseX <= width && mouseY >= 0 && mouseY <= height) { - * background(200); + * function draw() { + * background(200); * - * if (sampleIsPlaying) { - * ele.noLoop(); - * sampleIsPlaying = false; - * text('No more Loops!', width / 2, height / 2); - * } else { - * ele.loop(); - * sampleIsPlaying = true; - * text('Click to stop looping!', width / 2, height / 2); - * } + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isPlaying === true) { + * text('Click to stop', 50, 50); + * } else { + * text('Click to play', 50, 50); * } * } - *
+ * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isPlaying === true) { + * // If the beat is playing, + * // stop it. + * beat.stop(); + * isPlaying = false; + * } else { + * // If the beat is stopped, + * // play it. + * beat.play(); + * isPlaying = true; + * } + * } + *
+ *
*/ }, @@ -76436,48 +78661,54 @@ once: true }); } /** - * Set HTML5 media element to autoplay or not. If no argument is specified, by - * default it will autoplay. + * Sets the audio/video to play once it's loaded. + * + * The parameter, `shouldAutoplay`, is optional. Calling + * `media.autoplay()` without an argument causes the media to play + * automatically. If `true` is passed, as in `media.autoplay(true)`, the + * media will automatically play. If `false` is passed, as in + * `media.autoPlay(false)`, it won't play automatically. * * @method autoplay - * @param {Boolean} shouldAutoplay whether the element should autoplay + * @param {Boolean} [shouldAutoplay] whether the element should autoplay. * @chainable * @example - *
- * let videoElement; + *
+ * * function setup() { * noCanvas(); - * videoElement = createVideo(['assets/small.mp4'], onVideoLoad); - * } - * function onVideoLoad() { - * // The media will play as soon as it is loaded. - * videoElement.autoplay(); - * videoElement.volume(0); - * videoElement.size(100, 100); + * + * // Load a video and play it automatically. + * let video = createVideo('assets/fingers.mov', () => { + * video.autoplay(); + * video.size(100, 100); + * }); + * + * describe('A video of fingers walking on a treadmill.'); * } - *
+ *
+ *
* - *
- * let videoElement; + *
+ * * function setup() { * noCanvas(); - * videoElement = createVideo(['assets/small.mp4'], onVideoLoad); - * } - * function onVideoLoad() { - * // The media will not play until some explicitly triggered. - * videoElement.autoplay(false); - * videoElement.volume(0); - * videoElement.size(100, 100); - * } * - * function mouseClicked() { - * videoElement.play(); - * } - *
+ * // Load a video, but don't play it automatically. + * let video = createVideo('assets/fingers.mov', () => { + * video.autoplay(false); + * video.size(100, 100); + * }); * - * @alt - * An example of a video element which autoplays after it is loaded. - * An example of a video element which waits for a trigger for playing. + * // Play the video when the user clicks on it. + * video.mousePressed(() => { + * video.play(); + * }); + * + * describe('An image of fingers on a treadmill. They start walking when the user double-clicks on them.'); + * } + *
+ *
*/ }, @@ -76506,81 +78737,55 @@ } return this; } /** - * Sets volume for this HTML5 media element. If no argument is given, - * returns the current volume. + * Manages the audio/video volume. + * + * Calling `media.volume()` without an argument returns the current volume + * as a number in the range 0 (off) to 1 (maximum). + * + * The parameter, `val`, is optional. It's a number that sets the volume + * from 0 (off) to 1 (maximum). For example, calling `media.volume(0.5)` + * sets the volume to half of its maximum. * * @method volume - * @return {Number} current volume + * @return {Number} current volume. * * @example - *
- * let ele; - * function setup() { - * // p5.MediaElement objects are usually created - * // by calling the createAudio(), createVideo(), - * // and createCapture() functions. - * // In this example we create - * // a new p5.MediaElement via createAudio(). - * ele = createAudio('assets/lucky_dragons.mp3'); - * background(250); - * textAlign(CENTER); - * text('Click to Play!', width / 2, height / 2); - * } - * function mouseClicked() { - * // Here we call the volume() function - * // on the sound element to set its volume - * // Volume must be between 0.0 and 1.0 - * ele.volume(0.2); - * ele.play(); - * background(200); - * text('You clicked Play!', width / 2, height / 2); - * } - *
- *
- * let audio; - * let counter = 0; - * - * function loaded() { - * audio.play(); - * } + *
+ * + * let dragon; * * function setup() { - * audio = createAudio('assets/lucky_dragons.mp3', loaded); - * textAlign(CENTER); + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Volume: V" on a gray square with media controls beneath it. The number "V" oscillates between 0 and 1 as the music plays.'); * } * * function draw() { - * if (counter === 0) { - * background(0, 255, 0); - * text('volume(0.9)', width / 2, height / 2); - * } else if (counter === 1) { - * background(255, 255, 0); - * text('volume(0.5)', width / 2, height / 2); - * } else if (counter === 2) { - * background(255, 0, 0); - * text('volume(0.1)', width / 2, height / 2); - * } - * } + * background(200); * - * function mousePressed() { - * counter++; - * if (counter === 0) { - * audio.volume(0.9); - * } else if (counter === 1) { - * audio.volume(0.5); - * } else if (counter === 2) { - * audio.volume(0.1); - * } else { - * counter = 0; - * audio.volume(0.9); - * } + * // Produce a number between 0 and 1. + * let n = 0.5 * sin(frameCount * 0.01) + 0.5; + * // Use n to set the volume. + * dragon.volume(n); + * + * // Get the current volume + * // and display it. + * let v = dragon.volume(); + * // Round v to 1 decimal place + * // for display. + * v = round(v, 1); + * textAlign(CENTER); + * text(`Volume: ${v}`, 50, 50); * } * *
*/ /** * @method volume - * @param {Number} val volume between 0.0 and 1.0 + * @param {Number} val volume between 0.0 and 1.0. * @chainable */ @@ -76594,79 +78799,57 @@ this.elt.volume = val; } } /** - * If no arguments are given, returns the current playback speed of the - * element. The speed parameter sets the speed where 2.0 will play the - * element twice as fast, 0.5 will play at half the speed, and -1 will play - * the element in normal speed in reverse.(Note that not all browsers support - * backward playback and even if they do, playback might not be smooth.) + * Manages the audio/video playback speed. Calling `media.speed()` returns + * the current speed as a number. + * + * The parameter, `val`, is optional. It's a number that sets the playback + * speed. 1 plays the media at normal speed, 0.5 plays it at half speed, 2 + * plays it at double speed, and so on. -1 plays the media at normal speed + * in reverse. + * + * Note: Not all browsers support backward playback. Even if they do, + * playback might not be smooth. * * @method speed - * @return {Number} current playback speed of the element + * @return {Number} current playback speed. * * @example - *
- * //Clicking the canvas will loop - * //the audio sample until the user - * //clicks again to stop it - * - * //We will store the p5.MediaElement - * //object in here - * let ele; - * let button; + *
+ * + * let dragon; * * function setup() { - * createCanvas(710, 400); - * //Here we create a p5.MediaElement object - * //using the createAudio() function. - * ele = createAudio('assets/beat.mp3'); - * ele.loop(); - * background(200); - * - * button = createButton('2x speed'); - * button.position(100, 68); - * button.mousePressed(twice_speed); - * - * button = createButton('half speed'); - * button.position(200, 68); - * button.mousePressed(half_speed); - * - * button = createButton('reverse play'); - * button.position(300, 68); - * button.mousePressed(reverse_speed); - * - * button = createButton('STOP'); - * button.position(400, 68); - * button.mousePressed(stop_song); + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); * - * button = createButton('PLAY!'); - * button.position(500, 68); - * button.mousePressed(play_speed); - * } - * - * function twice_speed() { - * ele.speed(2); - * } + * // Show the default media controls. + * dragon.showControls(); * - * function half_speed() { - * ele.speed(0.5); + * describe('The text "Speed: S" on a gray square with media controls beneath it. The number "S" oscillates between 0 and 1 as the music plays.'); * } * - * function reverse_speed() { - * ele.speed(-1); - * } + * function draw() { + * background(200); * - * function stop_song() { - * ele.stop(); - * } + * // Produce a number between 0 and 2. + * let n = sin(frameCount * 0.01) + 1; + * // Use n to set the playback speed. + * dragon.speed(n); * - * function play_speed() { - * ele.play(); + * // Get the current speed + * // and display it. + * let s = dragon.speed(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`Speed: ${s}`, 50, 50); * } - *
+ *
*/ /** * @method speed - * @param {Number} speed speed multiplier for element playback + * @param {Number} speed speed multiplier for playback. * @chainable */ @@ -76684,53 +78867,78 @@ } } } /** - * If no arguments are given, returns the current time of the element. - * If an argument is given the current time of the element is set to it. + * Manages the media element's playback time. Calling `media.time()` + * returns the number of seconds the audio/video has played. Time resets to + * 0 when the looping media restarts. + * + * The parameter, `time`, is optional. It's a number that specifies the + * time, in seconds, to jump to when playback begins. * * @method time - * @return {Number} current time (in seconds) + * @return {Number} current time (in seconds). * * @example - *
- * let ele; - * let beginning = true; + *
+ * + * let dragon; + * * function setup() { - * //p5.MediaElement objects are usually created - * //by calling the createAudio(), createVideo(), - * //and createCapture() functions. - * - * //In this example we create - * //a new p5.MediaElement via createAudio(). - * ele = createAudio('assets/lucky_dragons.mp3'); - * background(250); + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Display the current time. + * let s = dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); * textAlign(CENTER); - * text('start at beginning', width / 2, height / 2); + * text(`${s} seconds`, 50, 50); * } + * + *
* - * // this function fires with click anywhere - * function mousePressed() { - * if (beginning === true) { - * // here we start the sound at the beginning - * // time(0) is not necessary here - * // as this produces the same result as - * // play() - * ele.play().time(0); - * background(200); - * text('jump 2 sec in', width / 2, height / 2); - * beginning = false; - * } else { - * // here we jump 2 seconds into the sound - * ele.play().time(2); - * background(250); - * text('start at beginning', width / 2, height / 2); - * beginning = true; - * } + *
+ * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * // Jump to 2 seconds + * // to start. + * dragon.time(2); + * + * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); * } - *
+ * + * function draw() { + * background(200); + * + * // Display the current time. + * let s = dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`${s} seconds`, 50, 50); + * } + *
+ *
*/ /** * @method time - * @param {Number} time time to jump to (in seconds) + * @param {Number} time time to jump to (in seconds). * @chainable */ @@ -76745,32 +78953,42 @@ return this; } } /** - * Returns the duration of the HTML5 media element. + * Returns the audio/video's duration in seconds. * * @method duration - * @return {Number} duration + * @return {Number} duration (in seconds). * * @example - *
- * let ele; + *
+ * + * let dragon; + * * function setup() { - * //p5.MediaElement objects are usually created - * //by calling the createAudio(), createVideo(), - * //and createCapture() functions. - * //In this example we create - * //a new p5.MediaElement via createAudio(). - * ele = createAudio('assets/doorbell.mp3'); - * background(250); - * textAlign(CENTER); - * text('Click to know the duration!', 10, 25, 70, 80); + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "S seconds left" on a gray square with media controls beneath it. The number "S" decreases as the song plays.'); * } - * function mouseClicked() { - * ele.play(); + * + * function draw() { * background(200); - * //ele.duration dislpays the duration - * text(ele.duration() + ' seconds', width / 2, height / 2); + * + * // Calculate the time remaining. + * let s = dragon.duration() - dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * + * // Display the time remaining. + * textAlign(CENTER); + * text(`${s} seconds left`, 50, 50); * } - *
+ *
+ *
*/ }, @@ -76911,30 +79129,62 @@ value: function setModified(value) { this._modified = value; } /** - * Schedule an event to be called when the audio or video - * element reaches the end. If the element is looping, - * this will not be called. The element is passed in - * as the argument to the onended callback. + * Calls a function when the audio/video reaches the end of its playback + * The function won't be called if the media is looping. + * + * The `p5.MediaElement` is passed as an argument to the callback function. * * @method onended - * @param {Function} callback function to call when the - * soundfile has ended. The - * media element will be passed - * in as the argument to the - * callback. + * @param {Function} callback function to call when playback ends. + * The `p5.MediaElement` is passed as + * the argument. * @chainable * @example - *
+ *
+ * + * let beat; + * let isPlaying = false; + * let isDone = false; + * * function setup() { - * let audioEl = createAudio('assets/beat.mp3'); - * audioEl.showControls(); - * audioEl.onended(sayDone); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * // Set isDone to false when + * // the beat finishes. + * beat.onended(() => { + * isDone = true; + * }); + * + * describe('The text "Click to play" written in black on a gray square. A beat plays when the user clicks. The text "Done!" appears when the beat finishes playing.'); + * } + * + * function draw() { + * background(200); + * + * // Display different messages + * // based on playback. + * textAlign(CENTER); + * if (isDone === true) { + * text('Done!', 50, 50); + * } else if (isPlaying === false) { + * text('Click to play', 50, 50); + * } else { + * text('Playing...', 50, 50); + * } * } * - * function sayDone(elt) { - * alert('done playing ' + elt.src); + * // Play the beat when the + * // user presses the mouse. + * function mousePressed() { + * if (isPlaying === false) { + * isPlaying = true; + * beat.play(); + * } * } - *
+ *
+ *
*/ }, @@ -77011,29 +79261,30 @@ } } /*** SHOW / HIDE CONTROLS ***/ /** - * Show the default MediaElement controls, as determined by the web browser. + * Show the default + * HTMLMediaElement + * controls. These vary between web browser. * * @method showControls * @example - *
- * let ele; + *
+ * * function setup() { - * //p5.MediaElement objects are usually created - * //by calling the createAudio(), createVideo(), - * //and createCapture() functions. - * //In this example we create - * //a new p5.MediaElement via createAudio() - * ele = createAudio('assets/lucky_dragons.mp3'); - * background(200); + * background('cornflowerblue'); + * * textAlign(CENTER); - * text('Click to Show Controls!', 10, 25, 70, 80); - * } - * function mousePressed() { - * ele.showControls(); - * background(200); - * text('Controls Shown', width / 2, height / 2); + * textSize(50); + * text('🐉', 50, 50); + * + * // Create a p5.MediaElement using createAudio(). + * let dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('A dragon emoji, 🐉, drawn in the center of a blue square. A song plays in the background. Audio controls are displayed beneath the canvas.'); * } - *
+ *
+ *
*/ }, @@ -77044,29 +79295,51 @@ this.elt.style['text-align'] = 'inherit'; this.elt.controls = true; } /** - * Hide the default mediaElement controls. + * Hide the default + * HTMLMediaElement + * controls. + * * @method hideControls * @example - *
- * let ele; + *
+ * + * let dragon; + * let isHidden = false; + * * function setup() { - * //p5.MediaElement objects are usually created - * //by calling the createAudio(), createVideo(), - * //and createCapture() functions. - * //In this example we create - * //a new p5.MediaElement via createAudio() - * ele = createAudio('assets/lucky_dragons.mp3'); - * ele.showControls(); + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Double-click to hide controls" written in the middle of a gray square. A song plays in the background. Audio controls are displayed beneath the canvas. The controls appear/disappear when the user double-clicks the square.'); + * } + * + * function draw() { * background(200); + * + * // Display a different message when + * // controls are hidden or shown. * textAlign(CENTER); - * text('Click to hide Controls!', 10, 25, 70, 80); + * if (isHidden === true) { + * text('Double-click to show controls', 10, 20, 80, 80); + * } else { + * text('Double-click to hide controls', 10, 20, 80, 80); + * } * } - * function mousePressed() { - * ele.hideControls(); - * background(200); - * text('Controls hidden', width / 2, height / 2); + * + * // Show/hide controls based on a double-click. + * function doubleClicked() { + * if (isHidden === true) { + * dragon.showControls(); + * isHidden = false; + * } else { + * dragon.hideControls(); + * isHidden = true; + * } * } - *
+ *
+ *
*/ }, @@ -77075,54 +79348,51 @@ value: function hideControls() { this.elt.controls = false; } /** - * Schedule events to trigger every time a MediaElement - * (audio/video) reaches a playback cue point. + * Schedules a function to call when the audio/video reaches a specific time + * during its playback. + * + * The first parameter, `time`, is the time, in seconds, when the function + * should run. This value is passed to `callback` as its first argument. * - * Accepts a callback function, a time (in seconds) at which to trigger - * the callback, and an optional parameter for the callback. + * The second parameter, `callback`, is the function to call at the specified + * cue time. * - * Time will be passed as the first parameter to the callback function, - * and param will be the second parameter. + * The third parameter, `value`, is optional and can be any type of value. + * `value` is passed to `callback`. + * + * Calling `media.addCue()` returns an ID as a string. This is useful for + * removing the cue later. * * @method addCue - * @param {Number} time Time in seconds, relative to this media - * element's playback. For example, to trigger - * an event every time playback reaches two - * seconds, pass in the number 2. This will be - * passed as the first parameter to - * the callback function. - * @param {Function} callback Name of a function that will be - * called at the given time. The callback will - * receive time and (optionally) param as its - * two parameters. - * @param {Object} [value] An object to be passed as the - * second parameter to the - * callback function. + * @param {Number} time cue time to run the callback function. + * @param {Function} callback function to call at the cue time. + * @param {Object} [value] object to pass as the argument to + * `callback`. * @return {Number} id ID of this cue, - * useful for removeCue(id) + * useful for `media.removeCue(id)`. * @example - *
- * // - * // + *
+ * * function setup() { - * createCanvas(200, 200); - * - * let audioEl = createAudio('assets/beat.mp3'); - * audioEl.showControls(); - * - * // schedule three calls to changeBackground - * audioEl.addCue(0.5, changeBackground, color(255, 0, 0)); - * audioEl.addCue(1.0, changeBackground, color(0, 255, 0)); - * audioEl.addCue(2.5, changeBackground, color(0, 0, 255)); - * audioEl.addCue(3.0, changeBackground, color(0, 255, 255)); - * audioEl.addCue(4.2, changeBackground, color(255, 255, 0)); - * audioEl.addCue(5.0, changeBackground, color(255, 255, 0)); + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * beat.addCue(6, changeBackground, 'lavender'); + * + * describe('A red square with a beat playing in the background. Its color changes every 2 seconds while the audio plays.'); * } * - * function changeBackground(val) { - * background(val); + * function changeBackground(c) { + * background(c); * } - *
+ *
+ *
*/ }, @@ -77137,33 +79407,55 @@ } return id; } /** - * Remove a callback based on its ID. The ID is returned by the - * addCue method. + * Remove a callback based on its ID. + * * @method removeCue - * @param {Number} id ID of the cue, as returned by addCue + * @param {Number} id ID of the cue, created by `media.addCue()`. * @example - *
- * let audioEl, id1, id2; + *
+ * + * let lavenderID; + * let isRemoved = false; + * * function setup() { - * background(255, 255, 255); - * audioEl = createAudio('assets/beat.mp3'); - * audioEl.showControls(); - * // schedule five calls to changeBackground - * id1 = audioEl.addCue(0.5, changeBackground, color(255, 0, 0)); - * audioEl.addCue(1.0, changeBackground, color(0, 255, 0)); - * audioEl.addCue(2.5, changeBackground, color(0, 0, 255)); - * audioEl.addCue(3.0, changeBackground, color(0, 255, 255)); - * id2 = audioEl.addCue(4.2, changeBackground, color(255, 255, 0)); - * text('Click to remove first and last Cue!', 10, 25, 70, 80); + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * + * // Record the ID of the "lavender" callback. + * lavenderID = beat.addCue(6, changeBackground, 'lavender'); + * + * describe('The text "Double-click to remove lavender." written on a red square. The color changes every 2 seconds while the audio plays. The lavender option is removed when the user double-clicks the square.'); * } - * function mousePressed() { - * audioEl.removeCue(id1); - * audioEl.removeCue(id2); + * + * function draw() { + * if (isRemoved === false) { + * text('Double-click to remove lavender.', 10, 10, 80, 80); + * } else { + * text('No more lavender.', 10, 10, 80, 80); + * } * } - * function changeBackground(val) { - * background(val); + * + * function changeBackground(c) { + * background(c); * } - *
+ * + * // Remove the lavender color-change cue + * // when the user double-clicks. + * function doubleClicked() { + * if (isRemoved === false) { + * beat.removeCue(lavenderID); + * isRemoved = true; + * } + * } + *
+ *
*/ }, @@ -77180,38 +79472,54 @@ this.elt.ontimeupdate = null; } } /** - * Remove all of the callbacks that had originally been scheduled - * via the addCue method. + * Removes all functions scheduled with `media.addCue()`. + * * @method clearCues - * @param {Number} id ID of the cue, as returned by addCue * @example - *
- * let audioEl; + *
+ * + * let isChanging = true; + * * function setup() { - * background(255, 255, 255); - * audioEl = createAudio('assets/beat.mp3'); - * //Show the default MediaElement controls, as determined by the web browser - * audioEl.showControls(); - * // schedule calls to changeBackground * background(200); - * text('Click to change Cue!', 10, 25, 70, 80); - * audioEl.addCue(0.5, changeBackground, color(255, 0, 0)); - * audioEl.addCue(1.0, changeBackground, color(0, 255, 0)); - * audioEl.addCue(2.5, changeBackground, color(0, 0, 255)); - * audioEl.addCue(3.0, changeBackground, color(0, 255, 255)); - * audioEl.addCue(4.2, changeBackground, color(255, 255, 0)); + * + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * beat.addCue(6, changeBackground, 'lavender'); + * + * describe('The text "Double-click to stop changing." written on a square. The color changes every 2 seconds while the audio plays. The color stops changing when the user double-clicks the square.'); * } - * function mousePressed() { - * // here we clear the scheduled callbacks - * audioEl.clearCues(); - * // then we add some more callbacks - * audioEl.addCue(1, changeBackground, color(2, 2, 2)); - * audioEl.addCue(3, changeBackground, color(255, 255, 0)); + * + * function draw() { + * if (isChanging === true) { + * text('Double-click to stop changing.', 10, 10, 80, 80); + * } else { + * text('No more changes.', 10, 10, 80, 80); + * } * } - * function changeBackground(val) { - * background(val); + * + * function changeBackground(c) { + * background(c); * } - *
+ * + * // Remove cued functions and stop + * // changing colors when the user + * // double-clicks. + * function doubleClicked() { + * if (isChanging === true) { + * beat.clearCues(); + * isChanging = false; + * } + * } + *
+ *
*/ }, @@ -77245,20 +79553,134 @@ }(_main.default.Element); _main.default.MediaElement = MediaElement; /** - * Base class for a file. - * Used for Element.drop and createFileInput. + * A class to describe a file. + * + * `p5.File` objects are used by + * myElement.drop() and + * created by + * createFileInput. * * @class p5.File * @constructor - * @param {File} file File that is wrapped + * @param {File} file wrapped file. + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayInfo() when + * // the file loads. + * let input = createFileInput(displayInfo); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); + * } + * + * // Display the p5.File's info + * // once it loads. + * function displayInfo(file) { + * background(200); + * + * // Display the p5.File's name. + * text(file.name, 10, 10, 80, 40); + * // Display the p5.File's type and subtype. + * text(`${file.type}/${file.subtype}`, 10, 70); + * // Display the p5.File's size in bytes. + * text(file.size, 10, 90); + * } + * + *
+ * + *
+ * + * // Use the file input to select an image to + * // load and display. + * let img; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. Call handleImage() when + * // the file image loads. + * let input = createFileInput(handleImage); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); + * } + * + * function draw() { + * background(200); + * + * // Draw the image if it's ready. + * if (img) { + * image(img, 0, 0, width, height); + * } + * } + * + * // Use the p5.File's data once + * // it loads. + * function handleImage(file) { + * // Check the p5.File's type. + * if (file.type === 'image') { + * // Create an image using using + * // the p5.File's data. + * img = createImg(file.data, ''); + * + * // Hide the image element so it + * // doesn't appear twice. + * img.hide(); + * } else { + * img = null; + * } + * } + * + *
*/ var File = /*#__PURE__*/ function () { function File(file, pInst) { _classCallCheck(this, File); /** - * Underlying File object. All normal File methods can be called on this. + * Underlying + * File + * object. All `File` properties and methods are accessible. * * @property file + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayInfo() when + * // the file loads. + * let input = createFileInput(displayInfo); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); + * } + * + * // Use the p5.File once + * // it loads. + * function displayInfo(file) { + * background(200); + * + * // Display the p5.File's name. + * text(file.name, 10, 10, 80, 40); + * // Display the p5.File's type and subtype. + * text(`${file.type}/${file.subtype}`, 10, 70); + * // Display the p5.File's size in bytes. + * text(file.size, 10, 90); + * } + * + *
*/ this.file = file; this._pInst = pInst; @@ -77266,34 +79688,181 @@ // This makes determining if image or text etc simpler var typeList = file.type.split('/'); /** - * File type (image, text, etc.) + * The file + * MIME type + * as a string. For example, `'image'`, `'text'`, and so on. * * @property type + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayType() when + * // the file loads. + * let input = createFileInput(displayType); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its type is written in black.'); + * } + * + * // Display the p5.File's type + * // once it loads. + * function displayType(file) { + * background(200); + * + * // Display the p5.File's type. + * text(`This is file's type is: ${file.type}`, 10, 10, 80, 80); + * } + * + *
*/ this.type = typeList[0]; /** - * File subtype (usually the file extension jpg, png, xml, etc.) + * The file subtype as a string. For example, a file with an `'image'` + * MIME type + * may have a subtype such as ``png`` or ``jpeg``. * * @property subtype + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displaySubtype() when + * // the file loads. + * let input = createFileInput(displaySubtype); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its subtype is written in black.'); + * } + * + * // Display the p5.File's type + * // once it loads. + * function displaySubtype(file) { + * background(200); + * + * // Display the p5.File's subtype. + * text(`This is file's subtype is: ${file.subtype}`, 10, 10, 80, 80); + * } + * + *
*/ this.subtype = typeList[1]; /** - * File name + * The file name as a string. * * @property name + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayName() when + * // the file loads. + * let input = createFileInput(displayName); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its name is written in black.'); + * } + * + * // Display the p5.File's name + * // once it loads. + * function displayName(file) { + * background(200); + * + * // Display the p5.File's name. + * text(`This is file's name is: ${file.name}`, 10, 10, 80, 80); + * } + * + *
*/ this.name = file.name; /** - * File size + * The number of bytes in the file. * * @property size + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displaySize() when + * // the file loads. + * let input = createFileInput(displaySize); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its size in bytes is written in black.'); + * } + * + * // Display the p5.File's size + * // in bytes once it loads. + * function displaySize(file) { + * background(200); + * + * // Display the p5.File's size. + * text(`This is file has ${file.size} bytes.`, 10, 10, 80, 80); + * } + * + *
*/ this.size = file.size; /** - * URL string containing either image data, the text contents of the file or - * a parsed object if file is JSON and p5.XML if XML + * A string containing either the file's image data, text contents, or + * a parsed object in the case of JSON and + * p5.XML objects. * * @property data + * @example + *
+ * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayData() when + * // the file loads. + * let input = createFileInput(displayData); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its data is written in black.'); + * } + * + * // Display the p5.File's data + * // once it loads. + * function displayData(file) { + * background(200); + * + * // Display the p5.File's data, + * // which looks like a random + * // string of characters. + * text(file.data, 10, 10, 80, 80); + * } + * + *
*/ this.data = undefined; } @@ -80050,44 +82619,58 @@ * Helper functions */ /** - * Returns the pixel buffer for a canvas + * Returns the pixel buffer for a canvas. * * @private * * @param {Canvas|ImageData} canvas the canvas to get pixels from * @return {Uint8ClampedArray} a one-dimensional array containing - * the data in thc RGBA order, with integer - * values between 0 and 255 + * the data in the RGBA order, with integer + * values between 0 and 255. */ _toPixels: function _toPixels(canvas) { + // Return pixel data if 'canvas' is an ImageData object. if (canvas instanceof ImageData) { return canvas.data; } else { + // Check 2D context support. if (canvas.getContext('2d')) { + // Retrieve pixel data. return canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height).data; } else if (canvas.getContext('webgl')) { + //Check WebGL context support var gl = canvas.getContext('webgl'); + // Calculate the size of pixel data + // (4 bytes per pixel - one byte for each RGBA channel). var len = gl.drawingBufferWidth * gl.drawingBufferHeight * 4; var data = new Uint8Array(len); + // Use gl.readPixels to fetch pixel data from the WebGL + // canvas, storing it in the data array as UNSIGNED_BYTE integers. gl.readPixels(0, 0, canvas.width, canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, data); return data; } } }, /** - * Returns a 32 bit number containing ARGB data at ith pixel in the + * Returns a 32-bit number containing ARGB data at the ith pixel in the * 1D array containing pixels data. * * @private * * @param {Uint8ClampedArray} data array returned by _toPixels() * @param {Integer} i index of a 1D Image Array - * @return {Integer} 32 bit integer value representing + * @return {Integer} 32-bit integer value representing * ARGB value. */ _getARGB: function _getARGB(data, i) { + // Determine the starting position in the 'data' array for the 'i'-th pixel. var offset = i * 4; - return data[offset + 3] << 24 & 4278190080 | data[offset] << 16 & 16711680 | data[offset + 1] << 8 & 65280 | data[offset + 2] & 255; + return ( // Combining the extracted components using bitwise OR operations to form the final ARGB value. + data[offset + 3] << 24 & 4278190080 | //Extract alpha component + data[offset] << 16 & 16711680 | //Extract Red component + data[offset + 1] << 8 & 65280 | //Extract green component + data[offset + 2] & 255 //Extract blue component + ); }, /** * Modifies pixels RGBA values to values contained in the data object. @@ -80109,7 +82692,7 @@ } }, /** - * Returns the ImageData object for a canvas + * Returns the ImageData object for a canvas. * https://developer.mozilla.org/en-US/docs/Web/API/ImageData * * @private @@ -80154,9 +82737,9 @@ * the canvas in between everystep. * * @private - * @param {HTMLCanvasElement} canvas [description] - * @param {function(ImageData,Object)} func [description] - * @param {Object} filterParam [description] + * @param {HTMLCanvasElement} canvas The input canvas to apply the filter on. + * @param {function(ImageData,Object)} func The filter function to apply to the canvas's pixel data. + * @param {Object} filterParam An optional parameter to pass to the filter function. */ apply: function apply(canvas, func, filterParam) { var pixelsState = canvas.getContext('2d'); @@ -80164,9 +82747,11 @@ //Filters can either return a new ImageData object, or just modify //the one they received. var newImageData = func(imageData, filterParam); + //If new ImageData is returned, replace the canvas's pixel data with it. if (newImageData instanceof ImageData) { pixelsState.putImageData(newImageData, 0, 0, 0, 0, canvas.width, canvas.height); } else { + //Restore the original pixel. pixelsState.putImageData(imageData, 0, 0, 0, 0, canvas.width, canvas.height); } }, @@ -80181,19 +82766,21 @@ * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ * * @private - * @param {Canvas} canvas - * @param {Float} level + * @param {Canvas} canvas Canvas to apply thershold filter on. + * @param {Float} level Threshold level (0-1). */ threshold: function threshold(canvas, level) { var pixels = Filters._toPixels(canvas); if (level === undefined) { level = 0.5; - } + } // Calculate threshold value on a (0-255) scale. + var thresh = Math.floor(level * 255); for (var i = 0; i < pixels.length; i += 4) { var r = pixels[i]; var g = pixels[i + 1]; var b = pixels[i + 2]; + // CIE luminance for RGB var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; var val = void 0; if (gray >= thresh) { @@ -80201,7 +82788,7 @@ } else { val = 0; } - pixels[i] = pixels[i + 1] = pixels[i + 2] = val; + pixels[i] = pixels[i + 1] = pixels[i + 2] = val; //set pixel to val. } }, /** @@ -80211,7 +82798,7 @@ * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ * * @private - * @param {Canvas} canvas + * @param {Canvas} canvas Canvas to apply gray filter on. */ gray: function gray(canvas) { var pixels = Filters._toPixels(canvas); @@ -80221,7 +82808,7 @@ var b = pixels[i + 2]; // CIE luminance for RGB var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; - pixels[i] = pixels[i + 1] = pixels[i + 2] = gray; + pixels[i] = pixels[i + 1] = pixels[i + 2] = gray; // set pixel to gray. } }, /** @@ -80263,6 +82850,9 @@ */ posterize: function posterize(canvas, level) { var pixels = Filters._toPixels(canvas); + if (level === undefined) { + level = 4; + } if (level < 2 || level > 255) { throw new Error('Level must be greater than 2 and less than 255 for posterize'); } @@ -80271,13 +82861,14 @@ var rlevel = pixels[i]; var glevel = pixels[i + 1]; var blevel = pixels[i + 2]; + // New pixel value by posterizing each color. pixels[i] = (rlevel * level >> 8) * 255 / levels1; pixels[i + 1] = (glevel * level >> 8) * 255 / levels1; pixels[i + 2] = (blevel * level >> 8) * 255 / levels1; } }, /** - * increases the bright areas in an image + * Increases the bright areas in an image. * @private * @param {Canvas} canvas */ @@ -80303,15 +82894,19 @@ lumLeft, lumUp, lumDown; + // Iterates through rows of pixels. while (currIdx < maxIdx) { currRowIdx = currIdx; maxRowIdx = currIdx + canvas.width; + // Iterates through pixels within the current row. while (currIdx < maxRowIdx) { + // Get original color of current pixel. colOrig = colOut = Filters._getARGB(pixels, currIdx); idxLeft = currIdx - 1; idxRight = currIdx + 1; idxUp = currIdx - canvas.width; idxDown = currIdx + canvas.width; + // Adjust the indices to avoid going out of bounds. if (idxLeft < currRowIdx) { idxLeft = currIdx; } @@ -80328,12 +82923,13 @@ colLeft = Filters._getARGB(pixels, idxLeft); colDown = Filters._getARGB(pixels, idxDown); colRight = Filters._getARGB(pixels, idxRight); - //compute luminance + // Compute luminance currLum = 77 * (colOrig >> 16 & 255) + 151 * (colOrig >> 8 & 255) + 28 * (colOrig & 255); lumLeft = 77 * (colLeft >> 16 & 255) + 151 * (colLeft >> 8 & 255) + 28 * (colLeft & 255); lumRight = 77 * (colRight >> 16 & 255) + 151 * (colRight >> 8 & 255) + 28 * (colRight & 255); lumUp = 77 * (colUp >> 16 & 255) + 151 * (colUp >> 8 & 255) + 28 * (colUp & 255); lumDown = 77 * (colDown >> 16 & 255) + 151 * (colDown >> 8 & 255) + 28 * (colDown & 255); + // Update the output color based on the highest luminance value if (lumLeft > currLum) { colOut = colLeft; currLum = lumLeft; @@ -80349,14 +82945,16 @@ if (lumDown > currLum) { colOut = colDown; currLum = lumDown; - } + } // Store the updated color. + out[currIdx++] = colOut; } } Filters._setPixels(pixels, out); }, /** - * reduces the bright areas in an image + * Reduces the bright areas in an image. + * Similar to `dilate()`, but updates the output color based on the lowest luminance value. * @private * @param {Canvas} canvas */ @@ -80428,7 +83026,8 @@ if (lumDown < currLum) { colOut = colDown; currLum = lumDown; - } + } // Store the updated color. + out[currIdx++] = colOut; } } @@ -80439,7 +83038,7 @@ } }; // BLUR - // internal kernel stuff for the gaussian blur filter + // Internal kernel stuff for the gaussian blur filter. var blurRadius; var blurKernelSize; var blurKernel; @@ -80459,6 +83058,7 @@ radius = radius < 1 ? 1 : radius < 248 ? radius : 248; if (blurRadius !== radius) { blurRadius = radius; + // Calculating the size of the blur kernel blurKernelSize = 1 + blurRadius << 1; blurKernel = new Int32Array(blurKernelSize); blurMult = new Array(blurKernelSize); @@ -80469,6 +83069,7 @@ bki; var bm, bmi; + // Generating blur kernel values. for (var i = 1, radiusi = radius - 1; i < radius; i++) { blurKernel[radius + i] = blurKernel[radiusi] = bki = radiusi * radiusi; bm = blurMult[radius + i]; @@ -80487,6 +83088,7 @@ // main/core/src/processing/core/PImage.java#L1433 function blurARGB(canvas, radius) { + // Get pixel data. var pixels = Filters._toPixels(canvas); var width = canvas.width; var height = canvas.height; @@ -80515,10 +83117,12 @@ y, i; var bm; + // Horizontal pass. for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { cb = cg = cr = ca = sum = 0; read = x - blurRadius; + // Handle edge cases. if (read < 0) { bk0 = - read; read = 0; @@ -80552,9 +83156,11 @@ yi = 0; ym = - blurRadius; ymi = ym * width; + // Vertical pass. for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { cb = cg = cr = ca = sum = 0; + // Handle edge cases. if (ym < 0) { bk0 = ri = - ym; read = x; @@ -80578,7 +83184,8 @@ sum += blurKernel[i]; ri++; read += width; - } + } // Set final ARGB value + argb[x + yi] = ca / sum << 24 | cr / sum << 16 | cg / sum << 8 | cb / sum; } yi += width; @@ -80834,7 +83441,7 @@ * file immediately or prompt the user with a dialogue window. * * @method saveCanvas - * @param {p5.Element|HTMLCanvasElement} selectedCanvas reference to a + * @param {p5.Framebuffer|p5.Element|HTMLCanvasElement} selectedCanvas reference to a * specific HTML5 canvas element. * @param {String} [filename] file name. Defaults to 'untitled'. * @param {String} [extension] file extension, either 'jpg' or 'png'. Defaults to 'png'. @@ -80912,13 +83519,24 @@ ].slice.call(arguments); var htmlCanvas, filename, - extension; + extension, + temporaryGraphics; if (arguments[0] instanceof HTMLCanvasElement) { htmlCanvas = arguments[0]; args.shift(); } else if (arguments[0] instanceof _main.default.Element) { htmlCanvas = arguments[0].elt; args.shift(); + } else if (arguments[0] instanceof _main.default.Framebuffer) { + var framebuffer = arguments[0]; + temporaryGraphics = this.createGraphics(framebuffer.width, framebuffer.height); + temporaryGraphics.pixelDensity(pixelDensity()); + framebuffer.loadPixels(); + temporaryGraphics.loadPixels(); + temporaryGraphics.pixels.set(framebuffer.pixels); + temporaryGraphics.updatePixels(); + htmlCanvas = temporaryGraphics.elt; + args.shift(); } else { htmlCanvas = this._curElement && this._curElement.elt; } @@ -80942,6 +83560,7 @@ } htmlCanvas.toBlob(function (blob) { _main.default.prototype.downloadFile(blob, filename, extension); + if (temporaryGraphics) temporaryGraphics.remove(); }, mimeType); }; // this is the old saveGif, left here for compatibility purposes @@ -82953,7 +85572,9 @@ _classCallCheck(this, _class); /** * Image width. + * @type {Number} * @property {Number} width + * @name width * @readOnly * @example *
@@ -82979,7 +85600,9 @@ this.width = width; /** * Image height. - * @property {Number} height + * @type {Number} + * @property height + * @name height * @readOnly * @example *
@@ -83036,6 +85659,7 @@ * called after any changes are made. * * @property {Number[]} pixels + * @name pixels * @example *
* @@ -84504,40 +87128,7 @@ 323: [ function (_dereq_, module, exports) { 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } _dereq_('core-js/modules/es.array.filter'); Object.defineProperty(exports, '__esModule', { value: true @@ -84546,48 +87137,6 @@ var _main = _interopRequireDefault(_dereq_('../core/main')); var _filters = _interopRequireDefault(_dereq_('./filters')); _dereq_('../color/p5.Color'); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: @@ -84888,7 +87437,6 @@ _main.default.prototype._copyHelper(this, srcImage, sx, sy, sw, sh, dx, dy, dw, dh); }; _main.default.prototype._copyHelper = function (dstImage, srcImage, sx, sy, sw, sh, dx, dy, dw, dh) { - srcImage.loadPixels(); var s = srcImage.canvas.width / srcImage.width; // adjust coord system for 3D when renderer // ie top-left = -width/2, -height/2 @@ -85112,6 +87660,14 @@ *
*/ /** + * @method getFilterGraphicsLayer + * @private + * @returns {p5.Graphics} + */ + _main.default.prototype.getFilterGraphicsLayer = function () { + return this._renderer.getFilterGraphicsLayer(); + }; + /** * @method filter * @param {Constant} filterType * @param {Boolean} [useWebGL] @@ -85131,7 +87687,7 @@ operation = _parseFilterArgs.operation, value = _parseFilterArgs.value, useWebGL = _parseFilterArgs.useWebGL; // when passed a shader, use it directly - if (shader) { + if (this._renderer.isP3D && shader) { _main.default.RendererGL.prototype.filter.call(this._renderer, shader); return; } // when opting out of webgl, use old pixels method @@ -85152,24 +87708,21 @@ _main.default.RendererGL.prototype.filter.call(this._renderer, operation, value); } // when this is P2D renderer, create/use hidden webgl renderer else { - // create hidden webgl renderer if it doesn't exist - if (!this.filterGraphicsLayer) { - // the real _pInst is buried when this is a secondary p5.Graphics - var pInst = this._renderer._pInst instanceof _main.default.Graphics ? this._renderer._pInst._pInst : this._renderer._pInst; - // create secondary layer - this.filterGraphicsLayer = new _main.default.Graphics(this.width, this.height, constants.WEBGL, pInst); - } // copy p2d canvas contents to secondary webgl renderer + var filterGraphicsLayer = this.getFilterGraphicsLayer(); + // copy p2d canvas contents to secondary webgl renderer // dest - - this.filterGraphicsLayer.copy( // src + filterGraphicsLayer.copy( // src this._renderer, // src coods 0, 0, this.width, this.height, // dest coords - this.width / 2, - this.height / 2, this.width, this.height); + //clearing the main canvas + this._renderer.clear(); + this._renderer.resetMatrix(); // filter it with shaders - this.filterGraphicsLayer.filter(operation, value); + filterGraphicsLayer.filter.apply(filterGraphicsLayer, args); // copy secondary webgl renderer back to original p2d canvas - this._renderer._pInst.image(this.filterGraphicsLayer, 0, 0); - this.filterGraphicsLayer.clear(); // prevent feedback effects on p2d canvas + this._renderer._pInst.image(filterGraphicsLayer, 0, 0); + filterGraphicsLayer.clear(); // prevent feedback effects on p2d canvas } }; function parseFilterArgs() { @@ -85472,19 +88025,9 @@ }, { '../color/p5.Color': 284, - '../core/constants': 286, '../core/main': 298, './filters': 319, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 + 'core-js/modules/es.array.filter': 173 } ], 324: [ @@ -87537,7 +90080,9 @@ /** * An array containing the names of the columns in the table, if the "header" the table is * loaded with the "header" parameter. - * @property columns {String[]} + * @type {String[]} + * @property columns + * @name columns * @example *
* @@ -87573,7 +90118,9 @@ /** * An array containing the p5.TableRow objects that make up the * rows of the table. The same result as calling getRows() - * @property rows {p5.TableRow[]} + * @type {p5.TableRow[]} + * @property rows + * @name rows */ this.rows = [ ]; @@ -90580,10 +93127,10 @@ _main.default._validateParameters('dist', args); if (args.length === 4) { //2D - return hypot(args[2] - args[0], args[3] - args[1]); + return Math.hypot(args[2] - args[0], args[3] - args[1]); } else if (args.length === 6) { //3D - return hypot(args[3] - args[0], args[4] - args[1], args[5] - args[2]); + return Math.hypot(args[3] - args[0], args[4] - args[1], args[5] - args[2]); } }; /** @@ -90742,7 +93289,7 @@ */ _main.default.prototype.mag = function (x, y) { _main.default._validateParameters('mag', arguments); - return hypot(x, y); + return Math.hypot(x, y); }; /** * Re-maps a number from one range to another. @@ -91163,46 +93710,7 @@ *
*/ _main.default.prototype.sqrt = Math.sqrt; - // Calculate the length of the hypotenuse of a right triangle - // This won't under- or overflow in intermediate steps - // https://en.wikipedia.org/wiki/Hypot - function hypot(x, y, z) { - // Use the native implementation if it's available - if (typeof Math.hypot === 'function') { - return Math.hypot.apply(null, arguments); - } // Otherwise use the V8 implementation - // https://github.com/v8/v8/blob/8cd3cf297287e581a49e487067f5cbd991b27123/src/js/math.js#L217 - - var length = arguments.length; - var args = [ - ]; - var max = 0; - for (var i = 0; i < length; i++) { - var n = arguments[i]; - n = + n; - if (n === Infinity || n === - Infinity) { - return Infinity; - } - n = Math.abs(n); - if (n > max) { - max = n; - } - args[i] = n; - } - if (max === 0) { - max = 1; - } - var sum = 0; - var compensation = 0; - for (var j = 0; j < length; j++) { - var m = args[j] / max; - var summand = m * m - compensation; - var preliminary = sum + summand; - compensation = preliminary - sum - summand; - sum = preliminary; - } - return Math.sqrt(sum) * max; - } /** + /** * Calculates the fractional part of a number. For example, * `fract(12.34)` returns 0.34. * @@ -91221,7 +93729,6 @@ * *
*/ - _main.default.prototype.fract = function (toConvert) { _main.default._validateParameters('fract', arguments); var sign = 0; @@ -91340,7 +93847,7 @@ * ball is moving straight up, its velocity vector points straight up. Adding * the ball's velocity vector to its position vector moves it, as in * `pos.add(vel)`. Vector math relies on methods inside the - * p5.Vector` class. + * p5.Vector class. * * @method createVector * @param {Number} [x] x component of the vector. @@ -92059,18 +94566,24 @@ z = (arguments.length <= 2 ? undefined : arguments[2]) || 0; } /** * The x component of the vector - * @property x {Number} + * @type {Number} + * @property x + * @name x */ this.x = x; /** * The y component of the vector - * @property y {Number} + * @type {Number} + * @property y + * @name y */ this.y = y; /** * The z component of the vector - * @property z {Number} + * @type {Number} + * @property z + * @name z */ this.z = z; } /** @@ -95897,29 +98410,34 @@ * @requires constants */ /** - * Sets the current alignment for drawing text. Accepts two - * arguments: horizAlign (LEFT, CENTER, or RIGHT) and - * vertAlign (TOP, BOTTOM, CENTER, or BASELINE). + * Sets the way text is aligned when text() is called. * - * The horizAlign parameter is in reference to the x value - * of the text() function, while the vertAlign parameter - * is in reference to the y value. + * By default, calling `text('hi', 10, 20)` places the bottom-left corner of + * the text's bounding box at (10, 20). * - * So if you write textAlign(LEFT), you are aligning the left - * edge of your text to the x value you give in text(). - * If you write textAlign(RIGHT, TOP), you are aligning the right edge - * of your text to the x value and the top edge of the text - * to the y value. + * The first parameter, `horizAlign`, changes the way + * text() interprets x-coordinates. By default, the + * x-coordinate sets the left edge of the bounding box. `textAlign()` accepts + * the following values for `horizAlign`: `LEFT`, `CENTER`, or `RIGHT`. + * + * The second parameter, `vertAlign`, is optional. It changes the way + * text() interprets y-coordinates. By default, the + * y-coordinate sets the bottom edge of the bounding box. `textAlign()` + * accepts the following values for `vertAlign`: `TOP`, `BOTTOM`, `CENTER`, + * or `BASELINE`. * * @method textAlign * @param {Constant} horizAlign horizontal alignment, either LEFT, - * CENTER, or RIGHT + * CENTER, or RIGHT. * @param {Constant} [vertAlign] vertical alignment, either TOP, - * BOTTOM, CENTER, or BASELINE + * BOTTOM, CENTER, or BASELINE. * @chainable * @example *
* + * strokeWeight(0.5); + * line(50, 0, 50, 100); + * * textSize(16); * textAlign(RIGHT); * text('ABCD', 50, 30); @@ -95927,35 +98445,32 @@ * text('EFGH', 50, 50); * textAlign(LEFT); * text('IJKL', 50, 70); - * describe(`Letters ABCD displayed at top left, EFGH at center, and - * IJKL at bottom right.`); + * + * describe('The letters ABCD displayed at top-left, EFGH at center, and IJKL at bottom-right. A vertical line divides the canvas in half.'); * *
* *
* - * textSize(16); * strokeWeight(0.5); * * line(0, 12, width, 12); * textAlign(CENTER, TOP); - * text('TOP', 0, 12, width); + * text('TOP', 50, 12); * * line(0, 37, width, 37); * textAlign(CENTER, CENTER); - * text('CENTER', 0, 37, width); + * text('CENTER', 50, 37); * * line(0, 62, width, 62); * textAlign(CENTER, BASELINE); - * text('BASELINE', 0, 62, width); + * text('BASELINE', 50, 62); * * line(0, 97, width, 97); * textAlign(CENTER, BOTTOM); - * text('BOTTOM', 0, 97, width); + * text('BOTTOM', 50, 97); * - * describe(`The names of the four vertical alignments (TOP, CENTER, BASELINE, - * and BOTTOM) rendered each showing that alignment's placement relative to a - * horizontal line.`); + * describe('The words "TOP", "CENTER", "BASELINE", and "BOTTOM" each drawn relative to a horizontal line. Their positions demonstrate different vertical alignments.'); * *
*/ @@ -95970,30 +98485,27 @@ return (_this$_renderer = this._renderer).textAlign.apply(_this$_renderer, arguments); }; /** - * Sets/gets the spacing, in pixels, between lines of text. This setting will be - * used in all subsequent calls to the text() function. + * Sets the spacing between lines of text when + * text() is called. Spacing is measured in pixels. + * + * Calling `textLeading()` without an argument returns the current spacing. * * @method textLeading - * @param {Number} leading the size in pixels for spacing between lines + * @param {Number} leading spacing between lines of text in units of pixels. * @chainable * * @example *
* - * let lines = 'L1\nL2\nL3'; // "\n" is a "new line" character - * textSize(12); + * // "\n" starts a new line of text. + * let lines = 'one\ntwo'; * - * textLeading(10); * text(lines, 10, 25); * - * textLeading(20); - * text(lines, 40, 25); - * * textLeading(30); * text(lines, 70, 25); * - * describe(`A set of L1, L2, and L3, displayed vertically 3 times. - * Spacing increases for each set.`); + * describe('The words "one" and "two" written on separate lines twice. The words on the left have less vertical spacing than the words on the right.'); * *
*/ @@ -96007,11 +98519,13 @@ return (_this$_renderer2 = this._renderer).textLeading.apply(_this$_renderer2, arguments); }; /** - * Sets/gets the current font size. This size will be used in all subsequent - * calls to the text() function. Font size is measured in pixels. + * Sets the font size when + * text() is called. Font size is measured in pixels. + * + * Calling `textSize()` without an arugment returns the current size. * * @method textSize - * @param {Number} theSize the size of the letters in units of pixels + * @param {Number} size size of the letters in units of pixels * @chainable * * @example @@ -96024,9 +98538,7 @@ * textSize(16); * text('Font Size 16', 10, 90); * - * describe(`'Font Size 12' displayed small, - * 'Font Size 14' medium, and - * 'Font Size 16' large`); + * describe('The text "Font Size 12" drawn small, "Font Size 14" drawn medium, and "Font Size 16" drawn large.'); *
*
*/ @@ -96040,31 +98552,33 @@ return (_this$_renderer3 = this._renderer).textSize.apply(_this$_renderer3, arguments); }; /** - * Sets/gets the style of the text for system fonts to NORMAL, ITALIC, BOLD or BOLDITALIC. - * Note: this may be is overridden by CSS styling. For non-system fonts - * (opentype, truetype, etc.) please load styled fonts instead. + * Sets the style for system fonts when + * text() is called. `textStyle()` accepts the + * following values: `NORMAL`, `ITALIC`, `BOLD` or `BOLDITALIC`. + * + * `textStyle()` may be overridden by CSS styling. This function doesn't + * affect fonts loaded with loadFont(). * * @method textStyle - * @param {Constant} theStyle styling for text, either NORMAL, + * @param {Constant} style styling for text, either NORMAL, * ITALIC, BOLD or BOLDITALIC * @chainable * @example *
* - * strokeWeight(0); * textSize(12); + * textAlign(CENTER); + * * textStyle(NORMAL); - * text('Font Style Normal', 10, 15); + * text('Normal', 50, 15); * textStyle(ITALIC); - * text('Font Style Italic', 10, 40); + * text('Italic', 50, 40); * textStyle(BOLD); - * text('Font Style Bold', 10, 65); + * text('Bold', 50, 65); * textStyle(BOLDITALIC); - * text('Font Style Bold Italic', 10, 90); - * describe(`The words “Font Style Normal” displayed normally, - * “Font Style Italic” in italic, - * “Font Style Bold” in bold, and - * “Font Style Bold Italic” in bold italics.`); + * text('Bold Italic', 50, 90); + * + * describe('The words "Normal" displayed normally, "Italic" in italic, "Bold" in bold, and "Bold Italic" in bold italics.'); * *
*/ @@ -96078,41 +98592,45 @@ return (_this$_renderer4 = this._renderer).textStyle.apply(_this$_renderer4, arguments); }; /** - * Calculates and returns the width of any character or the maximum width of any paragrph. + * Returns the maximum width of a string of text drawn when + * text() is called. * * @method textWidth - * @param {String} theText the String of characters to measure - * @return {Number} the calculated width + * @param {String} str string of text to measure. + * @return {Number} width measured in units of pixels. * @example *
* - * textSize(28); - * - * let aChar = 'P'; - * let cWidth = textWidth(aChar); - * text(aChar, 0, 40); - * line(cWidth, 0, cWidth, 50); + * function setup() { + * background(200); * - * let aString = 'p5.js'; - * let sWidth = textWidth(aString); - * text(aString, 0, 85); - * line(sWidth, 50, sWidth, 100); + * textSize(28); + * strokeWeight(0.5); + * let s = 'yoyo'; + * let w = textWidth(s); + * text(s, 22, 55); + * line(22, 55, 22 + w, 55); * - * describe('Letter P and p5.js are displayed with vertical lines at end.'); + * describe('The word "yoyo" underlined.'); + * } * *
* - * *
* - * textSize(28); + * function setup() { + * background(200); * - * let aChar = 'text\nWidth'; - * let cWidth = textWidth(aChar); - * text(aChar, 0, 40); - * line(cWidth, 0, cWidth, 100); + * textSize(28); + * strokeWeight(0.5); + * // "\n" starts a new line. + * let s = 'yo\nyo'; + * let w = textWidth(s); + * text(s, 22, 55); + * line(22, 55, 22 + w, 55); * - * describe('Text text and Width() are displayed with vertical lines at end of Width().'); + * describe('The word "yo" written twice, one copy beneath the other. The words are divided by a horizontal line.'); + * } * *
*/ @@ -96141,23 +98659,46 @@ * Returns the ascent of the current font at its current size. The ascent * represents the distance, in pixels, of the tallest character above * the baseline. + * * @method textAscent - * @return {Number} + * @return {Number} ascent measured in units of pixels. * @example *
* - * let base = height * 0.75; - * let scalar = 0.8; // Different for each font + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * textFont(font); * - * textSize(32); // Set initial text size - * let asc = textAscent() * scalar; // Calc ascent - * line(0, base - asc, width, base - asc); - * text('dp', 0, base); // Draw text on baseline + * // Different for each font. + * let fontScale = 0.8; * - * textSize(64); // Increase text size - * asc = textAscent() * scalar; // Recalc ascent - * line(40, base - asc, width, base - asc); - * text('dp', 40, base); // Draw text on baseline + * let baseY = 75; + * strokeWeight(0.5); + * + * // Draw small text. + * textSize(24); + * text('dp', 0, baseY); + * // Draw baseline and ascent. + * let a = textAscent() * fontScale; + * line(0, baseY, 23, baseY); + * line(23, baseY - a, 23, baseY); + * + * // Draw large text. + * textSize(48); + * text('dp', 45, baseY); + * // Draw baseline and ascent. + * a = textAscent() * fontScale; + * line(45, baseY, 91, baseY); + * line(91, baseY - a, 91, baseY); + * + * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends upward from each baseline to the top of the "d".'); + * } * *
*/ @@ -96172,23 +98713,46 @@ * Returns the descent of the current font at its current size. The descent * represents the distance, in pixels, of the character with the longest * descender below the baseline. + * * @method textDescent - * @return {Number} + * @return {Number} descent measured in units of pixels. * @example *
* - * let base = height * 0.75; - * let scalar = 0.8; // Different for each font + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * textFont(font); + * + * // Different for each font. + * let fontScale = 0.9; * - * textSize(32); // Set initial text size - * let desc = textDescent() * scalar; // Calc descent - * line(0, base + desc, width, base + desc); - * text('dp', 0, base); // Draw text on baseline + * let baseY = 75; + * strokeWeight(0.5); * - * textSize(64); // Increase text size - * desc = textDescent() * scalar; // Recalc descent - * line(40, base + desc, width, base + desc); - * text('dp', 40, base); // Draw text on baseline + * // Draw small text. + * textSize(24); + * text('dp', 0, baseY); + * // Draw baseline and descent. + * let d = textDescent() * fontScale; + * line(0, baseY, 23, baseY); + * line(23, baseY, 23, baseY + d); + * + * // Draw large text. + * textSize(48); + * text('dp', 45, baseY); + * // Draw baseline and descent. + * d = textDescent() * fontScale; + * line(45, baseY, 91, baseY); + * line(91, baseY, 91, baseY + d); + * + * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends downward from each baseline to the bottom of the "p".'); + * } * *
*/ @@ -96206,17 +98770,25 @@ return this._renderer._updateTextMetrics(); }; /** - * Specifies how lines of text are wrapped within a text box. This requires a max-width set on the text area, specified in text() as parameter `x2`. + * Sets the style for wrapping text when + * text() is called. `textWrap()` accepts the + * following values: * - * WORD wrap style only breaks lines at spaces. A single string without spaces that exceeds the boundaries of the canvas or text area is not truncated, and will overflow the desired area, disappearing at the canvas edge. + * `WORD` starts new lines of text at spaces. If a string of text doesn't + * have spaces, it may overflow the text box and the canvas. This is the + * default style. * - * CHAR wrap style breaks lines wherever needed to stay within the text box. + * `CHAR` starts new lines as needed to stay within the text box. * - * WORD is the default wrap style, and both styles will still break lines at any line breaks (`\n`) specified in the original text. The text area max-height parameter (`y2`) also still applies to wrapped text in both styles, lines of text that do not fit within the text area will not be drawn to the screen. + * `textWrap()` only works when the maximum width is set for a text box. For + * example, calling `text('Have a wonderful day', 0, 10, 100)` sets the + * maximum width to 100 pixels. + * + * Calling `textWrap()` without an argument returns the current style. * * @method textWrap - * @param {Constant} wrapStyle text wrapping style, either WORD or CHAR - * @return {String} wrapStyle + * @param {Constant} style text wrapping style, either WORD or CHAR. + * @return {String} style * @example *
* @@ -96225,6 +98797,7 @@ * text('Have a wonderful day', 0, 10, 100); * *
+ * *
* * textSize(20); @@ -96232,6 +98805,7 @@ * text('Have a wonderful day', 0, 10, 100); * *
+ * *
* * textSize(20); @@ -96239,33 +98813,6 @@ * text('祝你有美好的一天', 0, 10, 100); * *
- *
- * - * const scream = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; - * textSize(20); - * textWrap(WORD); - * text(scream, 0, 0, 100); - * fill(0, 0, 0, 75); - * text(scream, 0, 20, 100); - * fill(0, 0, 0, 50); - * text(scream, 0, 40, 100); - * fill(0, 0, 0, 25); - * text(scream, 0, 60, 100); - * strokeWeight(2); - * ellipseMode(CENTER); - * fill(255); - * ellipse(15, 50, 15, 15); - * fill(0); - * ellipse(11, 47, 1, 1); - * ellipse(19, 47, 1, 1); - * ellipse(15, 52, 5, 5); - * line(15, 60, 15, 70); - * line(15, 65, 5, 55); - * line(15, 65, 25, 55); - * line(15, 70, 10, 80); - * line(15, 70, 20, 80); - * - *
*/ _main.default.prototype.textWrap = function (wrapStyle) { if (wrapStyle !== 'WORD' && wrapStyle !== 'CHAR') { @@ -97012,6 +99559,7 @@ * opentype.js * font object. * @property font + * @name font */ this.font = undefined; } /** @@ -100164,7 +102712,7 @@ * from loadModel(). * * @method freeGeometry - * @param {p5.Geometry} The geometry whose resources should be freed + * @param {p5.Geometry} geometry The geometry whose resources should be freed */ _main.default.prototype.freeGeometry = function (geometry) { this._renderer._freeBuffers(geometry.gid); @@ -102475,20 +105023,6 @@ key: 'finish', value: function finish() { this.renderer._pInst.pop(); - // If all vertices are the same color (no per-vertex colors were - // supplied), remove the vertex color data so that one may override the - // fill when drawing the geometry with `model()` - var allVertexColorsSame = true; - for (var i = 4; i < this.geometry.vertexColors.length; i++) { - if (this.geometry.vertexColors[i] !== this.geometry.vertexColors[i % 4]) { - allVertexColorsSame = false; - break; - } - } - if (allVertexColorsSame) { - this.geometry.vertexColors = [ - ]; - } return this.geometry; } } @@ -102840,7 +105374,7 @@ deltaPhi = sensitivityY * this.movedY / scaleFactor; } else if (this.mouseButton === this.RIGHT) { moveDeltaX = this.movedX; - moveDeltaY = this.movedY; + moveDeltaY = this.movedY * cam.yScale; } // start rotate and move when mouse is pressed within the canvas. if (pointersInCanvas) this._renderer.executeRotateAndMove = true; @@ -103765,6 +106299,98 @@ return this; }; /** + * Creates an image light with the given image. + * + * The image light simulates light from all the directions. + * This is done by using the image as a texture for an infinitely + * large sphere light. This sphere contains + * or encapsulates the whole scene/drawing. + * It will have different effect for varying shininess of the + * object in the drawing. + * Under the hood it is mainly doing 2 types of calculations, + * the first one is creating an irradiance map the + * environment map of the input image. + * The second one is managing reflections based on the shininess + * or roughness of the material used in the scene. + * + * Note: The image's diffuse light will be affected by fill() + * and the specular reflections will be affected by specularMaterial() + * and shininess(). + * + * @method imageLight + * @param {p5.image} img image for the background + * @example + *
+ * + * let img; + * function preload() { + * img = loadImage('assets/outdoor_image.jpg'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(220); + * imageMode(CENTER); + * push(); + * translate(0, 0, -200); + * scale(2); + * image(img, 0, 0, width, height); + * pop(); + * ambientLight(50); + * imageLight(img); + * specularMaterial(20); + * noStroke(); + * scale(2); + * rotateX(frameCount * 0.005); + * rotateY(frameCount * 0.005); + * box(25); + * } + * + *
+ * @alt + * image light example + * @example + *
+ * + * let img; + * let slider; + * function preload() { + * img = loadImage('assets/outdoor_spheremap.jpg'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * slider = createSlider(0, 400, 100, 1); + * slider.position(0, height); + * } + * function draw() { + * background(220); + * imageMode(CENTER); + * push(); + * translate(0, 0, -200); + * scale(2); + * image(img, 0, 0, width, height); + * pop(); + * ambientLight(50); + * imageLight(img); + * specularMaterial(20); + * shininess(slider.value()); + * noStroke(); + * scale(2); + * sphere(15); + * } + * + *
+ * @alt + * light with slider having a slider for varying roughness + */ + _main.default.prototype.imageLight = function (img) { + // activeImageLight property is checked by _setFillUniforms + // for sending uniforms to the fillshader + this._renderer.activeImageLight = img; + this._renderer._enableLighting = true; + }; + /** * Places an ambient and directional light in the scene. * The lights are set to ambientLight(128, 128, 128) and * directionalLight(128, 128, 128, 0, 0, -1). @@ -105017,6 +107643,9 @@ * The shader files are loaded asynchronously in the * background, so this method should be used in preload(). * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. + * * Note, shaders can only be used in WEBGL mode. * * @method loadShader @@ -105097,6 +107726,9 @@ * * Note, shaders can only be used in WEBGL mode. * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader shown in the example below. + * * @method createShader * @param {String} vertSrc source code for the vertex shader * @param {String} fragSrc source code for the fragment shader @@ -105106,33 +107738,44 @@ * @example *
* - * // the 'varying's are shared between both vertex & fragment shaders - * let varying = 'precision highp float; varying vec2 vPos;'; * * // the vertex shader is called for each vertex - * let vs = - * varying + - * 'attribute vec3 aPosition;' + - * 'void main() { vPos = (gl_Position = vec4(aPosition,1.0)).xy; }'; + * let vs = ` + * precision highp float; + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * varying vec2 vTexCoord; + * + * void main() { + * vTexCoord = aTexCoord; + * vec4 positionVec4 = vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; + * } + * `; + * * * // the fragment shader is called for each pixel - * let fs = - * varying + - * 'uniform vec2 p;' + - * 'uniform float r;' + - * 'const int I = 500;' + - * 'void main() {' + - * ' vec2 c = p + vPos * r, z = c;' + - * ' float n = 0.0;' + - * ' for (int i = I; i > 0; i --) {' + - * ' if(z.x*z.x+z.y*z.y > 4.0) {' + - * ' n = float(i)/float(I);' + - * ' break;' + - * ' }' + - * ' z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c;' + - * ' }' + - * ' gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0);' + - * '}'; + * let fs = ` + * precision highp float; + * uniform vec2 p; + * uniform float r; + * const int I = 500; + * varying vec2 vTexCoord; + * void main() { + * vec2 c = p + gl_FragCoord.xy * r, z = c; + * float n = 0.0; + * for (int i = I; i > 0; i --) { + * if(z.x*z.x+z.y*z.y > 4.0) { + * n = float(i)/float(I); + * break; + * } + * z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c; + * } + * gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0); + * }`; * * let mandel; * function setup() { @@ -105151,7 +107794,7 @@ * function draw() { * // 'r' is the size of the image in Mandelbrot-space * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); - * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * plane(width, height); * } * *
@@ -105160,7 +107803,6 @@ * zooming Mandelbrot set. a colorful, infinitely detailed fractal. */ _main.default.prototype.createShader = function (vertSrc, fragSrc) { - this._assert3d('createShader'); _main.default._validateParameters('createShader', arguments); return new _main.default.Shader(this._renderer, vertSrc, fragSrc); }; @@ -105168,13 +107810,13 @@ * Creates a new p5.Shader using only a fragment shader, as a convenience method for creating image effects. * It's like createShader() but with a default vertex shader included. * - * createFilterShader() is intended to be used along with filter() for filtering the contents of a canvas in WebGL mode. + * createFilterShader() is intended to be used along with filter() for filtering the contents of a canvas. * A filter shader will not be applied to any geometries. * * The fragment shader receives some uniforms: * - `sampler2D tex0`, which contains the canvas contents as a texture - * - `vec2 canvasSize`, which is the width and height of the canvas - * - `vec2 texelSize`, which is the size of a pixel (`1.0/width`, `1.0/height`) +* - `vec2 canvasSize`, which is the p5 width and height of the canvas (not including pixel density) + * - `vec2 texelSize`, which is the size of a physical pixel including pixel density (`1.0/(width*density)`, `1.0/(height*density)`) * * For more info about filters and shaders, see Adam Ferriss' repo of shader examples * or the introduction to shaders page. @@ -105242,19 +107884,25 @@ *
*/ _main.default.prototype.createFilterShader = function (fragSrc) { - this._assert3d('createFilterShader'); _main.default._validateParameters('createFilterShader', arguments); var defaultVertV1 = '\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n '; var defaultVertV2 = '#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n '; var vertSrc = fragSrc.includes('#version 300 es') ? defaultVertV2 : defaultVertV1; var shader = new _main.default.Shader(this._renderer, vertSrc, fragSrc); - shader.ensureCompiledOnContext(this._renderer.getFilterGraphicsLayer()); + if (this._renderer.GL) { + shader.ensureCompiledOnContext(this); + } else { + shader.ensureCompiledOnContext(this._renderer.getFilterGraphicsLayer()); + } return shader; }; /** * Sets the p5.Shader object to * be used to render subsequent shapes. * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. + * * Custom shaders can be created using the * createShader() and * loadShader() functions. @@ -106371,9 +109019,19 @@ * vertical field of view, aspect ratio (usually width/height), and near and far * clipping planes. * - * If no parameters are given, the following default is used: - * perspective(PI/3, width/height, eyeZ/10, eyeZ*10), - * where eyeZ is equal to ((height/2) / tan(PI/6)). + * If no parameters are given, the default values are used as: + * + * - `fov` : The default field of view for the camera is such that the full height of renderer is visible when it is positioned at a default distance of 800 units from the camera. + * - `aspect` : The default aspect ratio is the ratio of renderer's width to renderer's height. + * - `near` : The default value for the near clipping plane is 80, which is 0.1 times the default distance from the camera to its subject. + * - `far` : The default value for the far clipping plane is 8000, which is 10 times the default distance from the camera to its subject. + * + * If you prefer a fixed field of view, follow these steps: + * 1. Choose your desired field of view angle (`fovy`). This is how wide the camera can see. + * 2. To ensure that you can see the entire width across horizontally and height across vertically, place the camera a distance of `(height / 2) / tan(fovy / 2)` back from its subject. + * 3. Call perspective with the chosen field of view, canvas aspect ratio, and near/far values: + * `perspective(fovy, width / height, cameraDistance / 10, cameraDistance * 10);` + * * @method perspective * @for p5 * @param {Number} [fovy] camera frustum vertical field of view, @@ -106398,9 +109056,9 @@ * orbitControl(); * normalMaterial(); * + * translate(0, 0, 550); * rotateX(-0.3); * rotateY(-0.2); - * translate(0, 0, -50); * * push(); * translate(-15, 0, sin(frameCount / 30) * 95); @@ -106466,6 +109124,7 @@ * orbitControl(); * normalMaterial(); * + * translate(0,0,500); * rotateX(0.2); * rotateY(-0.2); * push(); @@ -106535,7 +109194,7 @@ * background(200); * orbitControl(); * normalMaterial(); - * + * translate(0,0,700); * rotateY(-0.2); * rotateX(-0.3); * push(); @@ -106985,9 +109644,9 @@ * orbitControl(); * normalMaterial(); * + * translate(0, 0, 550); * rotateX(-0.3); * rotateY(-0.2); - * translate(0, 0, -50); * * push(); * translate(-15, 0, sin(frameCount / 30) * 95); @@ -107072,7 +109731,7 @@ * background(200); * orbitControl(); * normalMaterial(); - * + * translate(0,0,500); * rotateX(0.2); * rotateY(-0.2); * push(); @@ -107144,7 +109803,7 @@ * background(200); * orbitControl(); * normalMaterial(); - * + * translate(0,0,700); * rotateY(-0.2); * rotateX(-0.3); * push(); @@ -107910,10 +110569,10 @@ var rotMat0 = cam0.cameraMatrix.createSubMatrix3x3(); var rotMat1 = cam1.cameraMatrix.createSubMatrix3x3(); // get front and up vector from local-coordinate-system. - var front0 = rotMat0.column(2); - var front1 = rotMat1.column(2); - var up0 = rotMat0.column(1); - var up1 = rotMat1.column(1); + var front0 = rotMat0.row(2); + var front1 = rotMat1.row(2); + var up0 = rotMat0.row(1); + var up1 = rotMat1.row(1); // prepare new vectors. var newFront = new _main.default.Vector(); var newUp = new _main.default.Vector(); @@ -108018,11 +110677,11 @@ { key: '_computeCameraDefaultSettings', value: function _computeCameraDefaultSettings() { - this.defaultCameraFOV = 60 / 180 * Math.PI; this.defaultAspectRatio = this._renderer.width / this._renderer.height; this.defaultEyeX = 0; this.defaultEyeY = 0; - this.defaultEyeZ = this._renderer.height / 2 / Math.tan(this.defaultCameraFOV / 2); + this.defaultEyeZ = 800; + this.defaultCameraFOV = 2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ); this.defaultCenterX = 0; this.defaultCenterY = 0; this.defaultCenterZ = 0; @@ -108059,9 +110718,9 @@ // If we're using the default camera, update the aspect ratio if (this.cameraType === 'default') { this._computeCameraDefaultSettings(); - this._setDefaultCamera(); - } else { - this.perspective(this.cameraFOV, this._renderer.width / this._renderer.height); + this.cameraFOV = this.defaultCameraFOV; + this.aspectRatio = this.defaultAspectRatio; + this.perspective(); } } /** * Returns a copy of a camera. @@ -108990,28 +111649,7 @@ value: function _computeCameraDefaultSettings() { _get(_getPrototypeOf(FramebufferCamera.prototype), '_computeCameraDefaultSettings', this).call(this); this.defaultAspectRatio = this.fbo.width / this.fbo.height; - this.defaultEyeZ = this.fbo.height / 2 / Math.tan(this.defaultCameraFOV / 2); - this.defaultCameraNear = this.defaultEyeZ * 0.1; - this.defaultCameraFar = this.defaultEyeZ * 10; - } /** - * Resets the camera to a default perspective camera sized to match - * the p5.Framebuffer it is attached to. - * - * @method resize - * @private - */ - - }, - { - key: '_resize', - value: function _resize() { - // If we're using the default camera, update the aspect ratio - if (this.cameraType === 'default') { - this._computeCameraDefaultSettings(); - this._setDefaultCamera(); - } else { - this.perspective(this.cameraFOV, this.fbo.width / this.fbo.height); - } + this.defaultCameraFOV = 2 * Math.atan(this.fbo.height / 2 / this.defaultEyeZ); } } ]); @@ -110264,13 +112902,39 @@ _dereq_('core-js/modules/es.array.iterator'); _dereq_('core-js/modules/es.array.slice'); _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); _dereq_('core-js/modules/es.object.to-string'); _dereq_('core-js/modules/es.regexp.to-string'); _dereq_('core-js/modules/es.set'); _dereq_('core-js/modules/es.string.iterator'); _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/es.weak-map'); _dereq_('core-js/modules/web.dom-collections.for-each'); _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } _dereq_('core-js/modules/es.symbol'); _dereq_('core-js/modules/es.symbol.description'); _dereq_('core-js/modules/es.symbol.iterator'); @@ -110290,6 +112954,48 @@ }); exports.default = void 0; var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: @@ -110421,6 +113127,64 @@ this.dirtyFlags = { }; } /** + * Removes the internal colors of p5.Geometry. + * Using `clearColors()`, you can use `fill()` to supply new colors before drawing each shape. + * If `clearColors()` is not used, the shapes will use their internal colors by ignoring `fill()`. + * + * @method clearColors + * + * @example + *
+ * + * let shape01; + * let shape02; + * let points = []; + * + * function setup() { + * createCanvas(600, 600, WEBGL); + * points.push(new p5.Vector(-1, -1, 0), new p5.Vector(-1, 1, 0), + * new p5.Vector(1, -1, 0), new p5.Vector(-1, -1, 0)); + * buildShape01(); + * buildShape02(); + * } + * function draw() { + * background(0); + * fill('pink'); // shape01 retains its internal blue color, so it won't turn pink. + * model(shape01); + * fill('yellow'); // Now, shape02 is yellow. + * model(shape02); + * } + * + * function buildShape01() { + * beginGeometry(); + * fill('blue'); // shape01's color is blue because its internal colors remain. + * beginShape(); + * for (let vec of points) vertex(vec.x * 100, vec.y * 100, vec.z * 100); + * endShape(CLOSE); + * shape01 = endGeometry(); + * } + * + * function buildShape02() { + * beginGeometry(); + * fill('red'); // shape02.clearColors() removes its internal colors. Now, shape02 is red. + * beginShape(); + * for (let vec of points) vertex(vec.x * 200, vec.y * 200, vec.z * 200); + * endShape(CLOSE); + * shape02 = endGeometry(); + * shape02.clearColors(); // Resets shape02's colors. + * } + * + *
+ */ + + }, + { + key: 'clearColors', + value: function clearColors() { + this.vertexColors = [ + ]; + return this; + } /** * computes faces for geometry objects based on the vertices. * @method computeFaces * @chainable @@ -110473,22 +113237,159 @@ if (sinAlpha > 1) sinAlpha = 1; // handle float rounding error return n.mult(Math.asin(sinAlpha) / ln); } /** - * computes smooth normals per vertex as an average of each - * face. - * @method computeNormals - * @chainable - */ + * This function calculates normals for each face, where each vertex's normal is the average of the normals of all faces it's connected to. + * i.e computes smooth normals per vertex as an average of each face. + * + * When using `FLAT` shading, vertices are disconnected/duplicated i.e each face has its own copy of vertices. + * When using `SMOOTH` shading, vertices are connected/deduplicated i.e each face has its vertices shared with other faces. + * + * Options can include: + * - `roundToPrecision`: Precision value for rounding computations. Defaults to 3. + * + * @method computeNormals + * @param {String} [shadingType] shading type (`FLAT` for flat shading or `SMOOTH` for smooth shading) for buildGeometry() outputs. Defaults to `FLAT`. + * @param {Object} [options] An optional object with configuration. + * @chainable + * + * @example + *
+ * + * let helix; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * helix = buildGeometry(() => { + * beginShape(); + * + * for (let i = 0; i < TWO_PI * 3; i += 0.6) { + * let radius = 20; + * let x = cos(i) * radius; + * let y = sin(i) * radius; + * let z = map(i, 0, TWO_PI * 3, -30, 30); + * vertex(x, y, z); + * } + * endShape(); + * }); + * helix.computeNormals(); + * } + * function draw() { + * background(255); + * stroke(0); + * fill(150, 200, 250); + * lights(); + * rotateX(PI*0.2); + * orbitControl(); + * model(helix); + * } + * + *
+ * + * @alt + * A 3D helix using the computeNormals() function by default uses `FLAT` to create a flat shading effect on the helix. + * + * @example + *
+ * + * let star; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * star = buildGeometry(() => { + * beginShape(); + * for (let i = 0; i < TWO_PI; i += PI / 5) { + * let outerRadius = 60; + * let innerRadius = 30; + * let xOuter = cos(i) * outerRadius; + * let yOuter = sin(i) * outerRadius; + * let zOuter = random(-20, 20); + * vertex(xOuter, yOuter, zOuter); + * + * let nextI = i + PI / 5 / 2; + * let xInner = cos(nextI) * innerRadius; + * let yInner = sin(nextI) * innerRadius; + * let zInner = random(-20, 20); + * vertex(xInner, yInner, zInner); + * } + * endShape(CLOSE); + * }); + * star.computeNormals(SMOOTH); + * } + * function draw() { + * background(255); + * stroke(0); + * fill(150, 200, 250); + * lights(); + * rotateX(PI*0.2); + * orbitControl(); + * model(star); + * } + * + *
+ * + * @alt + * A star-like geometry, here the computeNormals(SMOOTH) is applied for a smooth shading effect. + * This helps to avoid the faceted appearance that can occur with flat shading. + */ }, { key: 'computeNormals', value: function computeNormals() { var _this = this; + var shadingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : constants.FLAT; + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }, + _ref$roundToPrecision = _ref.roundToPrecision, + roundToPrecision = _ref$roundToPrecision === void 0 ? 3 : _ref$roundToPrecision; var vertexNormals = this.vertexNormals; var vertices = this.vertices; var faces = this.faces; var iv; - // initialize the vertexNormals array with empty vectors + if (shadingType === constants.SMOOTH) { + var vertexIndices = { + }; + var uniqueVertices = [ + ]; + var power = Math.pow(10, roundToPrecision); + var rounded = function rounded(val) { + return Math.round(val * power) / power; + }; + var getKey = function getKey(vert) { + return ''.concat(rounded(vert.x), ',').concat(rounded(vert.y), ',').concat(rounded(vert.z)); + }; + // loop through each vertex and add uniqueVertices + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + var key = getKey(vertex); + if (vertexIndices[key] === undefined) { + vertexIndices[key] = uniqueVertices.length; + uniqueVertices.push(vertex); + } + } // update face indices to use the deduplicated vertex indices + + faces.forEach(function (face) { + for (var fv = 0; fv < 3; ++fv) { + var originalVertexIndex = face[fv]; + var originalVertex = vertices[originalVertexIndex]; + var _key = getKey(originalVertex); + face[fv] = vertexIndices[_key]; + } + }); + // update edge indices to use the deduplicated vertex indices + this.edges.forEach(function (edge) { + for (var ev = 0; ev < 2; ++ev) { + var originalVertexIndex = edge[ev]; + var originalVertex = vertices[originalVertexIndex]; + var _key2 = getKey(originalVertex); + edge[ev] = vertexIndices[_key2]; + } + }); + // update the deduplicated vertices + this.vertices = vertices = uniqueVertices; + } // initialize the vertexNormals array with empty vectors + vertexNormals.length = 0; for (iv = 0; iv < vertices.length; ++iv) { vertexNormals.push(new _main.default.Vector()); @@ -110879,6 +113780,7 @@ exports.default = _default; }, { + '../core/constants': 286, '../core/main': 298, 'core-js/modules/es.array.concat': 169, 'core-js/modules/es.array.for-each': 175, @@ -110886,6 +113788,7 @@ 'core-js/modules/es.array.iterator': 179, 'core-js/modules/es.array.slice': 183, 'core-js/modules/es.map': 187, + 'core-js/modules/es.object.get-own-property-descriptor': 196, 'core-js/modules/es.object.to-string': 200, 'core-js/modules/es.regexp.to-string': 206, 'core-js/modules/es.set': 207, @@ -110894,6 +113797,7 @@ 'core-js/modules/es.symbol': 222, 'core-js/modules/es.symbol.description': 220, 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, 'core-js/modules/web.dom-collections.for-each': 255, 'core-js/modules/web.dom-collections.iterator': 256 } @@ -113461,6 +116365,7 @@ _dereq_('./p5.Matrix'); _dereq_('./p5.Framebuffer'); var _path = _dereq_('path'); + var _p6 = _dereq_('./p5.Texture'); var _filterShaderFrags; function _getRequireWildcardCache() { if (typeof WeakMap !== 'function') return null; @@ -113666,28 +116571,34 @@ defineStrokeJoinEnum('ROUND', 0); defineStrokeJoinEnum('MITER', 1); defineStrokeJoinEnum('BEVEL', 2); - var lightingShader = 'precision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'; + var lightingShader = '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'; var webgl2CompatibilityShader = '#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n'; var defaultShaders = { - immediateVert: 'attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nvarying vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n', - vertexColorVert: 'attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n', - vertexColorFrag: 'precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', - normalVert: 'attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nvarying vec3 vVertexNormal;\nvarying highp vec2 vVertTexCoord;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', - normalFrag: 'precision mediump float;\nvarying vec3 vVertexNormal;\nvoid main(void) {\n gl_FragColor = vec4(vVertexNormal, 1.0);\n}', - basicFrag: 'precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', - lightVert: lightingShader + '// include lighting.glgl\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nvarying highp vec2 vVertTexCoord;\nvarying vec3 vDiffuseColor;\nvarying vec3 vSpecularColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', - lightTextureFrag: 'precision highp float;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nvarying highp vec2 vVertTexCoord;\nvarying vec3 vDiffuseColor;\nvarying vec3 vSpecularColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n gl_FragColor = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? texture2D(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n gl_FragColor = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n', - phongVert: 'precision highp float;\nprecision highp int;\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', - phongFrag: lightingShader + '// include lighting.glsl\nprecision highp float;\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? texture2D(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n gl_FragColor = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n', - fontVert: webgl2CompatibilityShader + 'IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph\'s rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter\'s line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n', - fontFrag: webgl2CompatibilityShader + '#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of \'t\' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n', - lineVert: lineDefs + '/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump float;\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nattribute vec4 aPosition;\nattribute vec3 aTangentIn;\nattribute vec3 aTangentOut;\nattribute float aSide;\nattribute vec4 aVertexColor;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent\'s z value is 0 if it\'s facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don\'t get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don\'t care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can\'t remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the "elbow" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.) * curPerspScale,\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.) * curPerspScale,\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We\'ll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * curPerspScale * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * curPerspScale * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5 * curPerspScale;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset / curPerspScale;\n\n gl_Position.xy = p.xy + offset.xy;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n', - lineFrag: lineDefs + 'precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', - pointVert: 'attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}', - pointFrag: 'precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n' - }; + immediateVert: 'IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n', + vertexColorVert: 'IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n', + vertexColorFrag: 'IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', + normalVert: 'IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', + normalFrag: 'IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n', + basicFrag: 'IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', + lightVert: lightingShader + '// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', + lightTextureFrag: 'uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n', + phongVert: 'precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', + phongFrag: lightingShader + '// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n', + fontVert: 'IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph\'s rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter\'s line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n', + fontFrag: '#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of \'t\' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n', + lineVert: lineDefs + '/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent\'s z value is 0 if it\'s facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don\'t get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don\'t care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can\'t remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the "elbow" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We\'ll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n', + lineFrag: lineDefs + 'precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', + pointVert: 'IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n', + pointFrag: 'precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n', + imageLightVert: 'precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we\'ll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n', + imageLightDiffusedFrag: 'precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere\'s orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral\'s\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}', + imageLightSpecularFrag: 'precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n' + }; + for (var key in defaultShaders) { + defaultShaders[key] = webgl2CompatibilityShader + defaultShaders[key]; + } var filterShaderFrags = (_filterShaderFrags = { - }, _defineProperty(_filterShaderFrags, constants.GRAY, 'precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.ERODE, '// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.DILATE, '// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.BLUR, 'precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss\' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn\'t a real Gaussian weight, it\'s a quadratic weight. It\'s what the\n// CPU mode\'s blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n'), _defineProperty(_filterShaderFrags, constants.POSTERIZE, '// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.OPAQUE, '// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb, 1.0);\n}\n'), _defineProperty(_filterShaderFrags, constants.INVERT, '// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n vec3 invertedColor = 1.0 - color.rgb;\n gl_FragColor = vec4(invertedColor, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.THRESHOLD, '// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite), color.a);\n}\n'), _filterShaderFrags); + }, _defineProperty(_filterShaderFrags, constants.GRAY, 'precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.ERODE, '// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.DILATE, '// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.BLUR, 'precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss\' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn\'t a real Gaussian weight, it\'s a quadratic weight. It\'s what the\n// CPU mode\'s blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n'), _defineProperty(_filterShaderFrags, constants.POSTERIZE, '// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.OPAQUE, '// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n'), _defineProperty(_filterShaderFrags, constants.INVERT, '// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.THRESHOLD, '// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n'), _filterShaderFrags); var filterShaderVert = 'uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n'; /** * @module Rendering @@ -114020,6 +116931,18 @@ ]; _this.spotLightConc = [ ]; + // This property contains the input image if imageLight function + // is called. + // activeImageLight is checked by _setFillUniforms + // for sending uniforms to the fillshader + _this.activeImageLight = null; + // If activeImageLight property is Null, diffusedTextures, + // specularTextures are Empty. + // Else, it maps a p5.Image used by imageLight() to a p5.Graphics. + // p5.Graphics for this are calculated in getDiffusedTexture function + _this.diffusedTextures = new Map(); + // p5.Graphics for this are calculated in getSpecularTexture function + _this.specularTextures = new Map(); _this.drawMode = constants.FILL; _this.curFillColor = _this._cachedFillStyle = [ 1, @@ -114090,6 +117013,10 @@ _this._curCamera = new _main.default.Camera(_assertThisInitialized(_this)); _this._curCamera._computeCameraDefaultSettings(); _this._curCamera._setDefaultCamera(); + // FilterCamera + _this.filterCamera = new _main.default.Camera(_assertThisInitialized(_this)); + _this.filterCamera._computeCameraDefaultSettings(); + _this.filterCamera._setDefaultCamera(); // Information about the previous frame's touch object // for executing orbitControl() _this.prevTouches = [ @@ -114180,8 +117107,8 @@ ]; // for post processing step _this.filterShader = undefined; - _this.filterGraphicsLayer = undefined; - _this.filterGraphicsLayerTemp = undefined; + _this.filterLayer = undefined; + _this.filterLayerTemp = undefined; _this.defaultFilterShaders = { }; _this.textureMode = constants.IMAGE; @@ -114536,53 +117463,39 @@ } }, { - key: 'getFilterGraphicsLayer', - value: function getFilterGraphicsLayer() { - // Lazily initialize the filter graphics layer. We only do this on demand - // because the graphics layer itself has a p5.RendererGL, which would then - // try to make its own filter layer, infinitely looping. - if (!this.filterGraphicsLayer) { - // the real _pInst is buried when this is a secondary p5.Graphics - var pInst = this._pInst instanceof _main.default.Graphics ? this._pInst._pInst : this._pInst; - // create secondary layer - this.filterGraphicsLayer = new _main.default.Graphics(this.width, this.height, constants.WEBGL, pInst); - // geometries/borders on this layer should always be invisible - this.filterGraphicsLayer.noStroke(); + key: 'getFilterLayer', + value: function getFilterLayer() { + if (!this.filterLayer) { + this.filterLayer = this._pInst.createFramebuffer(); } - if (this.filterGraphicsLayer.width !== this.width || this.filterGraphicsLayer.height !== this.height) { - // Resize the graphics layer - this.filterGraphicsLayer.resizeCanvas(this.width, this.height); - } - if (this.filterGraphicsLayer.pixelDensity() !== this._pInst.pixelDensity()) { - this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()); - } - return this.filterGraphicsLayer; + return this.filterLayer; } }, { - key: 'getFilterGraphicsLayerTemp', - value: function getFilterGraphicsLayerTemp() { - // two-pass blur filter needs another graphics layer - if (!this.filterGraphicsLayerTemp) { - var pInst = this._pInst instanceof _main.default.Graphics ? this._pInst._pInst : this._pInst; - // create secondary layer - this.filterGraphicsLayerTemp = new _main.default.Graphics(this.width, this.height, constants.WEBGL, pInst); - this.filterGraphicsLayerTemp.noStroke(); + key: 'getFilterLayerTemp', + value: function getFilterLayerTemp() { + if (!this.filterLayerTemp) { + this.filterLayerTemp = this._pInst.createFramebuffer(); } - if (this.filterGraphicsLayerTemp.width !== this.width || this.filterGraphicsLayerTemp.height !== this.height) { - // Resize the graphics layer - this.filterGraphicsLayerTemp.resizeCanvas(this.width, this.height); + return this.filterLayerTemp; + } + }, + { + key: 'matchSize', + value: function matchSize(fboToMatch, target) { + if (fboToMatch.width !== target.width || fboToMatch.height !== target.height) { + fboToMatch.resize(target.width, target.height); } - if (this.filterGraphicsLayerTemp.pixelDensity() !== this._pInst.pixelDensity()) { - this.filterGraphicsLayerTemp.pixelDensity(this._pInst.pixelDensity()); + if (fboToMatch.pixelDensity() !== target.pixelDensity()) { + fboToMatch.pixelDensity(target.pixelDensity()); } - return this.filterGraphicsLayerTemp; } }, { key: 'filter', value: function filter() { - var pg = this.getFilterGraphicsLayer(); + var _this2 = this; + var fbo = this.getFilterLayer(); // use internal shader for filter constants BLUR, INVERT, etc var filterParameter = undefined; var operation = undefined; @@ -114597,71 +117510,109 @@ // Need to store multiple in case user calls different filters, // eg. filter(BLUR) then filter(GRAY) if (!(operation in this.defaultFilterShaders)) { - this.defaultFilterShaders[operation] = new _main.default.Shader(pg._renderer, filterShaderVert, filterShaderFrags[operation]); + this.defaultFilterShaders[operation] = new _main.default.Shader(fbo._renderer, filterShaderVert, filterShaderFrags[operation]); } this.filterShader = this.defaultFilterShaders[operation]; } // use custom user-supplied shader else { this.filterShader = arguments.length <= 0 ? undefined : arguments[0]; - } - pg.clear(); // prevent undesirable feedback effects accumulating secretly - var pd = this._pInst.pixelDensity(); + } // Setting the target to the framebuffer when applying a filter to a framebuffer. + + var target = this.activeFramebuffer() || this; + // Resize the framebuffer 'fbo' and adjust its pixel density if it doesn't match the target. + this.matchSize(fbo, target); + // Set filterCamera for framebuffers. + if (target !== this) { + this.filterCamera = this.getFilterLayer().createCamera(); + } + fbo.draw(function () { + return _this2._pInst.clear(); + }); // prevent undesirable feedback effects accumulating secretly. var texelSize = [ - 1 / (this.width * pd), - 1 / (this.height * pd) + 1 / (target.width * target.pixelDensity()), + 1 / (target.height * target.pixelDensity()) ]; - // apply blur shader with multiple passes + // apply blur shader with multiple passes. if (operation === constants.BLUR) { - var tmp = this.getFilterGraphicsLayerTemp(); - tmp.clear(); // prevent feedback effects here too + // Treating 'tmp' as a framebuffer. + var tmp = this.getFilterLayerTemp(); + // Resize the framebuffer 'tmp' and adjust its pixel density if it doesn't match the target. + this.matchSize(tmp, target); // setup this._pInst.push(); this._pInst.noStroke(); // draw main to temp buffer - tmp.image(this, - this.width / 2, - this.height / 2); - pg.shader(this.filterShader); + this._pInst.shader(this.filterShader); this.filterShader.setUniform('texelSize', texelSize); this.filterShader.setUniform('canvasSize', [ - this.width, - this.height + target.width, + target.height ]); this.filterShader.setUniform('radius', Math.max(1, filterParameter)); - // horiz pass - this.filterShader.setUniform('direction', [ - 1, - 0 - ]); - this.filterShader.setUniform('tex0', tmp); - pg.rect( - this.width / 2, - this.height / 2, this.width, this.height); - // read back to temp buffer - tmp.image(pg, - this.width / 2, - this.height / 2); - // vert pass - this.filterShader.setUniform('direction', [ - 0, - 1 - ]); - this.filterShader.setUniform('tex0', tmp); - pg.rect( - this.width / 2, - this.height / 2, this.width, this.height); + // Horiz pass: draw `target` to `tmp` + tmp.draw(function () { + _this2.filterShader.setUniform('direction', [ + 1, + 0 + ]); + _this2.filterShader.setUniform('tex0', target); + _this2._pInst.clear(); + _this2._pInst.shader(_this2.filterShader); + _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); + }); + // Vert pass: draw `tmp` to `fbo` + fbo.draw(function () { + _this2.filterShader.setUniform('direction', [ + 0, + 1 + ]); + _this2.filterShader.setUniform('tex0', tmp); + _this2._pInst.clear(); + _this2._pInst.shader(_this2.filterShader); + _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); + }); this._pInst.pop(); } // every other non-blur shader uses single pass else { - pg.shader(this.filterShader); - this.filterShader.setUniform('tex0', this); - this.filterShader.setUniform('texelSize', texelSize); - this.filterShader.setUniform('canvasSize', [ - this.width, - this.height - ]); - // filterParameter uniform only used for POSTERIZE, and THRESHOLD - // but shouldn't hurt to always set - this.filterShader.setUniform('filterParameter', filterParameter); - pg.rect( - this.width / 2, - this.height / 2, this.width, this.height); - } // draw pg contents onto main renderer + fbo.draw(function () { + _this2._pInst.noStroke(); + _this2._pInst.shader(_this2.filterShader); + _this2.filterShader.setUniform('tex0', target); + _this2.filterShader.setUniform('texelSize', texelSize); + _this2.filterShader.setUniform('canvasSize', [ + target.width, + target.height + ]); + // filterParameter uniform only used for POSTERIZE, and THRESHOLD + // but shouldn't hurt to always set + _this2.filterShader.setUniform('filterParameter', filterParameter); + _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); + }); + } // draw fbo contents onto main renderer. this._pInst.push(); this._pInst.noStroke(); - this._pInst.image(pg, - this.width / 2, - this.height / 2, this.width, this.height); + this.clear(); + this._pInst.push(); + this._pInst.imageMode(constants.CORNER); + this._pInst.blendMode(constants.BLEND); + this.filterCamera._resize(); + this._pInst.setCamera(this.filterCamera); + this._pInst.resetMatrix(); + this._pInst.image(fbo, - this.width / 2, - this.height / 2, this.width, this.height); this._pInst.pop(); + this._pInst.pop(); + } // Pass this off to the host instance so that we can treat a renderer and a + // framebuffer the same in filter() + + }, + { + key: 'pixelDensity', + value: function pixelDensity(newDensity) { + if (newDensity) { + return this._pInst.pixelDensity(newDensity); + } + return this._pInst.pixelDensity(); } }, { @@ -114677,8 +117628,9 @@ key: 'erase', value: function erase(opacityFill, opacityStroke) { if (!this._isErasing) { - this._applyBlendMode(constants.REMOVE); + this._cachedBlendMode = this.curBlendMode; this._isErasing = true; + this.blendMode(constants.REMOVE); this._cachedFillStyle = this.curFillColor.slice(); this.curFillColor = [ 1, @@ -114700,10 +117652,14 @@ key: 'noErase', value: function noErase() { if (this._isErasing) { - this._isErasing = false; this.curFillColor = this._cachedFillStyle.slice(); this.curStrokeColor = this._cachedStrokeStyle.slice(); + // It's necessary to restore post-erase state. Needs rework + var temp = this.curBlendMode; this.blendMode(this._cachedBlendMode); + this._cachedBlendMode = temp; // If we don't do this, applyBlendMode() returns null + this._isErasing = false; + this._applyBlendMode(); // This sets _cachedBlendMode back to the original blendmode } } }, @@ -114936,8 +117892,7 @@ // Notify framebuffers of the resize so that any auto-sized framebuffers // can also update their size framebuffer._canvasSizeChanged(); - } // resize filter graphics layer - + } } catch (err) { _didIteratorError = true; _iteratorError = err; @@ -114952,9 +117907,6 @@ } } } - if (this.filterGraphicsLayer) { - _main.default.Renderer.prototype.resize.call(this.filterGraphicsLayer, w, h); - } } /** * clears color and depth buffers * with r,g,b,a @@ -115131,6 +118083,8 @@ properties.drawMode = this.drawMode; properties._currentNormal = this._currentNormal; properties.curBlendMode = this.curBlendMode; + // So that the activeImageLight gets reset in push/pop + properties.activeImageLight = this.activeImageLight; return style; } }, @@ -115270,9 +118224,9 @@ value: function _getLightShader() { if (!this._defaultLightShader) { if (this._pInst._glAttributes.perPixelLighting) { - this._defaultLightShader = new _main.default.Shader(this, defaultShaders.phongVert, defaultShaders.phongFrag); + this._defaultLightShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.phongVert, this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.phongFrag); } else { - this._defaultLightShader = new _main.default.Shader(this, defaultShaders.lightVert, defaultShaders.lightTextureFrag); + this._defaultLightShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.lightVert, this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.lightTextureFrag); } } return this._defaultLightShader; @@ -115282,7 +118236,7 @@ key: '_getImmediateModeShader', value: function _getImmediateModeShader() { if (!this._defaultImmediateModeShader) { - this._defaultImmediateModeShader = new _main.default.Shader(this, defaultShaders.immediateVert, defaultShaders.vertexColorFrag); + this._defaultImmediateModeShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.immediateVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.vertexColorFrag); } return this._defaultImmediateModeShader; } @@ -115291,7 +118245,7 @@ key: '_getNormalShader', value: function _getNormalShader() { if (!this._defaultNormalShader) { - this._defaultNormalShader = new _main.default.Shader(this, defaultShaders.normalVert, defaultShaders.normalFrag); + this._defaultNormalShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.normalVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.normalFrag); } return this._defaultNormalShader; } @@ -115300,7 +118254,7 @@ key: '_getColorShader', value: function _getColorShader() { if (!this._defaultColorShader) { - this._defaultColorShader = new _main.default.Shader(this, defaultShaders.normalVert, defaultShaders.basicFrag); + this._defaultColorShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.normalVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.basicFrag); } return this._defaultColorShader; } @@ -115309,7 +118263,7 @@ key: '_getPointShader', value: function _getPointShader() { if (!this._defaultPointShader) { - this._defaultPointShader = new _main.default.Shader(this, defaultShaders.pointVert, defaultShaders.pointFrag); + this._defaultPointShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.pointVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.pointFrag); } return this._defaultPointShader; } @@ -115318,7 +118272,7 @@ key: '_getLineShader', value: function _getLineShader() { if (!this._defaultLineShader) { - this._defaultLineShader = new _main.default.Shader(this, defaultShaders.lineVert, defaultShaders.lineFrag); + this._defaultLineShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.lineVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.lineFrag); } return this._defaultLineShader; } @@ -115379,6 +118333,89 @@ var tex = new _main.default.Texture(this, src); this.textures.set(src, tex); return tex; + } /* + * used in imageLight, + * To create a blurry image from the input non blurry img, if it doesn't already exist + * Add it to the diffusedTexture map, + * Returns the blurry image + * maps a p5.Image used by imageLight() to a p5.Graphics + */ + + }, + { + key: 'getDiffusedTexture', + value: function getDiffusedTexture(input) { + // if one already exists for a given input image + if (this.diffusedTextures.get(input) != null) { + return this.diffusedTextures.get(input); + } // if not, only then create one + + var newGraphic; // maybe switch to framebuffer + // hardcoded to 200px, because it's going to be blurry and smooth + var smallWidth = 200; + var width = smallWidth; + var height = Math.floor(smallWidth * (input.height / input.width)); + newGraphic = this._pInst.createGraphics(width, height, constants.WEBGL); + // create graphics is like making a new sketch, all functions on main + // sketch it would be available on graphics + var irradiance = newGraphic.createShader(defaultShaders.imageLightVert, defaultShaders.imageLightDiffusedFrag); + newGraphic.shader(irradiance); + irradiance.setUniform('environmentMap', input); + newGraphic.noStroke(); + newGraphic.rectMode(newGraphic.CENTER); + newGraphic.rect(0, 0, newGraphic.width, newGraphic.height); + this.diffusedTextures.set(input, newGraphic); + return newGraphic; + } /* + * used in imageLight, + * To create a texture from the input non blurry image, if it doesn't already exist + * Creating 8 different levels of textures according to different + * sizes and atoring them in `levels` array + * Creating a new Mipmap texture with that `levels` array + * Storing the texture for input image in map called `specularTextures` + * maps the input p5.Image to a p5.MipmapTexture + */ + + }, + { + key: 'getSpecularTexture', + value: function getSpecularTexture(input) { + // check if already exits (there are tex of diff resolution so which one to check) + // currently doing the whole array + if (this.specularTextures.get(input) != null) { + return this.specularTextures.get(input); + } // Hardcoded size + + var size = 512; + var tex; + var levels = [ + ]; + var graphic = this._pInst.createGraphics(size, size, constants.WEBGL); + var count = Math.log(size) / Math.log(2); + graphic.pixelDensity(1); + // currently only 8 levels + // This loop calculates 8 graphics of varying size of canvas + // and corresponding different roughness levels. + // Roughness increases with the decrease in canvas size, + // because rougher surfaces have less detailed/more blurry reflections. + for (var w = size; w >= 1; w /= 2) { + graphic.resizeCanvas(w, w); + var currCount = Math.log(w) / Math.log(2); + var roughness = 1 - currCount / count; + var myShader = graphic.createShader(defaultShaders.imageLightVert, defaultShaders.imageLightSpecularFrag); + graphic.shader(myShader); + graphic.clear(); + myShader.setUniform('environmentMap', input); + myShader.setUniform('roughness', roughness); + graphic.noStroke(); + graphic.plane(w, w); + levels.push(graphic.get().drawingContext.getImageData(0, 0, w, w)); + } + graphic.remove(); + tex = new _p6.MipmapTexture(this, levels, { + }); + this.specularTextures.set(input, tex); + return tex; } /** * @method activeFramebuffer * @private @@ -115430,6 +118467,7 @@ fillShader.setUniform('uSpecular', this._useSpecularMaterial); fillShader.setUniform('uEmissive', this._useEmissiveMaterial); fillShader.setUniform('uShininess', this._useShininess); + this._setImageLightUniforms(fillShader); fillShader.setUniform('uUseLighting', this._enableLighting); var pointLightCount = this.pointLightDiffuseColors.length / 3; fillShader.setUniform('uPointLightCount', pointLightCount); @@ -115457,6 +118495,31 @@ fillShader.setUniform('uLinearAttenuation', this.linearAttenuation); fillShader.setUniform('uQuadraticAttenuation', this.quadraticAttenuation); fillShader.bindTextures(); + } // getting called from _setFillUniforms + + }, + { + key: '_setImageLightUniforms', + value: function _setImageLightUniforms(shader) { + //set uniform values + shader.setUniform('uUseImageLight', this.activeImageLight != null); + // true + if (this.activeImageLight) { + // this.activeImageLight has image as a key + // look up the texture from the diffusedTexture map + var diffusedLight = this.getDiffusedTexture(this.activeImageLight); + shader.setUniform('environmentMapDiffused', diffusedLight); + var specularLight = this.getSpecularTexture(this.activeImageLight); + // In p5js the range of shininess is >= 1, + // Therefore roughness range will be ([0,1]*8)*20 or [0, 160] + // The factor of 8 is because currently the getSpecularTexture + // only calculated 8 different levels of roughness + // The factor of 20 is just to spread up this range so that, + // [1, max] of shininess is converted to [0,160] of roughness + var roughness = 20 / this._useShininess; + shader.setUniform('levelOfDetail', roughness * 8); + shader.setUniform('environmentMapSpecular', specularLight); + } } }, { @@ -115780,6 +118843,7 @@ './p5.Framebuffer': 349, './p5.Matrix': 351, './p5.Shader': 356, + './p5.Texture': 357, 'core-js/modules/es.array.concat': 169, 'core-js/modules/es.array.copy-within': 170, 'core-js/modules/es.array.every': 171, @@ -115995,6 +119059,18 @@ * @param {p5|p5.Graphics} context The graphic or instance to copy this shader to. * Pass `window` if you need to copy to the main canvas. * @returns {p5.Shader} A new shader on the target context. + * + * @example + *
+ * + * let graphic = createGraphics(200, 200, WEBGL); + * let graphicShader = graphic.createShader(vert, frag); + * graphic.shader(graphicShader); // Use graphicShader on the graphic + * + * let mainShader = graphicShader.copyToContext(window); + * shader(mainShader); // Use `mainShader` on the main canvas + * + *
*/ }, @@ -116606,7 +119682,10 @@ _dereq_('core-js/modules/es.symbol.iterator'); _dereq_('core-js/modules/es.array.iterator'); _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.to-string'); _dereq_('core-js/modules/es.string.iterator'); _dereq_('core-js/modules/es.typed-array.uint8-array'); _dereq_('core-js/modules/es.typed-array.copy-within'); @@ -116688,7 +119767,7 @@ value: true }); exports.checkWebGLCapabilities = checkWebGLCapabilities; - exports.default = void 0; + exports.default = exports.MipmapTexture = void 0; var _main = _interopRequireDefault(_dereq_('../core/main')); var constants = _interopRequireWildcard(_dereq_('../core/constants')); function _getRequireWildcardCache() { @@ -116738,6 +119817,70 @@ obj }; } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); @@ -117041,20 +120184,23 @@ key: 'setInterpolation', value: function setInterpolation(downScale, upScale) { var gl = this._renderer.GL; - if (downScale === constants.NEAREST) { - this.glMinFilter = gl.NEAREST; - } else { - this.glMinFilter = gl.LINEAR; - } - if (upScale === constants.NEAREST) { - this.glMagFilter = gl.NEAREST; - } else { - this.glMagFilter = gl.LINEAR; - } + this.glMinFilter = this.glFilter(downScale); + this.glMagFilter = this.glFilter(upScale); this.bindTexture(); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); this.unbindTexture(); + } + }, + { + key: 'glFilter', + value: function glFilter(filter) { + var gl = this._renderer.GL; + if (filter === constants.NEAREST) { + return gl.NEAREST; + } else { + return gl.LINEAR; + } } /** * Sets the texture wrapping mode. This controls how textures behave * when their uv's go outside of the 0 - 1 range. There are three options: @@ -117133,6 +120279,58 @@ ]); return Texture; }(); + var MipmapTexture = /*#__PURE__*/ function (_p5$Texture) { + _inherits(MipmapTexture, _p5$Texture); + var _super = _createSuper(MipmapTexture); + function MipmapTexture(renderer, levels, settings) { + var _this; + _classCallCheck(this, MipmapTexture); + _this = _super.call(this, renderer, levels, settings); + var gl = _this._renderer.GL; + if (_this.glMinFilter === gl.LINEAR) { + _this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; + } + return _this; + } + _createClass(MipmapTexture, [ + { + key: 'glFilter', + value: function glFilter(_filter) { + var gl = this._renderer.GL; + // TODO: support others + return gl.LINEAR_MIPMAP_LINEAR; + } + }, + { + key: '_getTextureDataFromSource', + value: function _getTextureDataFromSource() { + return this.src; + } + }, + { + key: 'init', + value: function init(levels) { + var gl = this._renderer.GL; + this.glTex = gl.createTexture(); + this.bindTexture(); + for (var level = 0; level < levels.length; level++) { + gl.texImage2D(this.glTarget, level, this.glFormat, this.glFormat, this.glDataType, levels[level]); + } + this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); + this.unbindTexture(); + } + }, + { + key: 'update', + value: function update() { + } + } + ]); + return MipmapTexture; + }(_main.default.Texture); + exports.MipmapTexture = MipmapTexture; function checkWebGLCapabilities(_ref) { var GL = _ref.GL, webglVersion = _ref.webglVersion; @@ -117156,7 +120354,10 @@ '../core/main': 298, 'core-js/modules/es.array.iterator': 179, 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.to-string': 206, 'core-js/modules/es.string.iterator': 210, 'core-js/modules/es.symbol': 222, 'core-js/modules/es.symbol.description': 220, diff --git a/public/lib/p5.min.js b/public/lib/p5.min.js index 5b72044..7b436a7 100644 --- a/public/lib/p5.min.js +++ b/public/lib/p5.min.js @@ -1,2 +1,2 @@ -/*! p5.js v1.8.0 October 25, 2023 */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n>>1;case"base64":return M(e).length;default:if(n)return o?-1:E(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function T(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var h=o,f=h.length;if(f<=v)return String.fromCharCode.apply(String,h);for(var p="",m=0;mt&&(e+=" ... "),""},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(C(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,h=r,f=(d=Number(d)||0,u.length-d);(!h||f<(h=Number(h)))&&(h=f),(f=c.length)/2e.length)throw new RangeError("Index out of range")}function j(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function M(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function O(e){return e!=e}var A=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,P("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:246}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":148}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(E,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,j=g&&p(g),_=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),T=s&&!!m&&"Opera"!==c(a.opera),e=!1,E={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in E)a[n]||(T=!1);if((!T||"function"!=typeof j||j===Function.prototype)&&(j=function(){throw TypeError("Incorrect invocation")},T))for(n in E)a[n]&&m(a[n],j);if((!T||!_||_===x)&&(_=j.prototype,T))for(n in E)a[n]&&m(a[n].prototype,_);if(T&&p(b)!==_&&m(b,_),i&&!u(_,y))for(n in e=!0,f(_,y,{get:function(){return l(this)?this[S]:void 0}}),E)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(j,e))return e}else for(var t in E)if(u(E,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in E){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}_[e]&&!r||h(_,e,!r&&T&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in E)(n=a[o])&&u(n,e)&&delete n[e];if(j[e]&&!r)return;try{return h(j,e,!r&&T&&g[e]||t)}catch(e){}}for(o in E)!(n=a[o])||n[e]&&!r||h(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(E,e)},isTypedArray:o,TypedArray:j,TypedArrayPrototype:_}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":145,"../internals/well-known-symbol":148}],13:[function(e,t,I){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return O(e,23,4)}function F(e){return O(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;uR;)(P=L[R++])in E||N(E,P,T[P]);c.constructor=E}g&&V(e)!==k&&g(e,k);var y=new M(new E(2)),D=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||h(e,{setInt8:function(e,t){D.call(this,e,t<<24>>24)},setUint8:function(e,t){D.call(this,e,t<<24>>24)}},{unsafe:!0})}else E=function(e){p(this,E,_);e=m(e);j(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},M=function(e,t,r){p(this,M,x),p(e,E,x);var o=b(e).byteLength,t=B(t);if(t<0||o>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1>16},getUint16:function(e){e=l(this,2,e,1>>0},getFloat32:function(e){return A(l(this,4,e,1"+e+""}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":140}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),j=e("../internals/set-to-string-tag"),_=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/iterators"),e=e("../internals/iterators-core"),T=e.IteratorPrototype,E=e.BUGGY_SAFARI_ITERATORS,M=o("iterator"),k="values",C="entries";t.exports=function(e,t,r,o,n,s,i){g(r,t,o);function a(e){if(e===n&&f)return f;if(!E&&e in d)return d[e];switch(e){case"keys":case k:case C:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,u,o=t+" Iterator",c=!1,d=e.prototype,h=d[M]||d["@@iterator"]||n&&d[n],f=!E&&h||a(n),p="Array"==t&&d.entries||h;if(p&&(p=v(p.call(new e)),T!==Object.prototype&&p.next&&(w||v(p)===T||(b?b(p,T):"function"!=typeof p[M]&&_(p,M,m)),j(p,o,!0,!0),w&&(S[o]=m))),n==k&&h&&h.name!==k&&(c=!0,f=function(){return h.call(this)}),w&&!i||d[M]===f||_(d,M,f),S[t]=f,n)if(l={values:a(k),keys:s?f:a("keys"),entries:a(C)},i)for(u in l)!E&&!c&&u in d||x(d,u,l[u]);else y({target:t,proto:!0,forced:E||c},l);return l}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":148}],42:[function(e,t,r){var o=e("../internals/path"),n=e("../internals/has"),s=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});n(t,e)||i(t,e,{value:s.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":147}],43:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/is-object"),n=o.document,s=e(n)&&e(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,n,s=e("../internals/global"),e=e("../internals/engine-user-agent"),s=s.process,s=s&&s.versions,s=s&&s.v8;s?n=(o=s.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(n=o[1]),t.exports=n&&+n},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var u=e("../internals/global"),c=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/set-global"),p=e("../internals/copy-constructor-properties"),m=e("../internals/is-forced");t.exports=function(e,t){var r,o,n,s=e.target,i=e.global,a=e.stat,l=i?u:a?u[s]||f(s,{}):(u[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.noTargetGet?(n=c(l,r))&&n.value:l[r],!m(i?r:s+(a?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;p(o,n)}(e.sham||n&&n.sham)&&d(o,"sham",!0),h(l,r,o,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var u=e("../internals/redefine"),c=e("../internals/fails"),d=e("../internals/well-known-symbol"),h=e("../internals/regexp-exec"),f=e("../internals/create-non-enumerable-property"),p=d("species"),m=!c(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),y="$0"==="a".replace(/./,"$0"),e=d("replace"),g=!!/./[e]&&""===/./[e]("a","$0"),v=!c(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(r,e,t,o){var s,n,i=d(r),a=!c(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),l=a&&!c(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[p]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});a&&l&&("replace"!==r||m&&y&&!g)&&("split"!==r||v)||(s=/./[i],t=(l=t(i,""[r],function(e,t,r,o,n){return t.exec===h?a&&!n?{done:!0,value:s.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}))[0],n=l[1],u(String.prototype,r,t),u(RegExp.prototype,i,2==e?function(e,t){return n.call(e,this,t)}:function(e){return n.call(e,this)})),o&&f(RegExp.prototype[i],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":148,"../modules/es.regexp.exec":187}],53:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(e,t,r){var s=e("../internals/a-function");t.exports=function(o,n,e){if(s(o),void 0===n)return o;switch(e){case 0:return function(){return o.call(n)};case 1:return function(e){return o.call(n,e)};case 2:return function(e,t){return o.call(n,e,t)};case 3:return function(e,t,r){return o.call(n,e,t,r)}}return function(){return o.apply(n,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){"use strict";var o=e("../internals/a-function"),n=e("../internals/is-object"),c=[].slice,d={};t.exports=Function.bind||function(i){var a=o(this),l=c.call(arguments,1),u=function(){var e=l.concat(c.call(arguments));if(this instanceof u){var t=a,r=e.length,o=e;if(!(r in d)){for(var n=[],s=0;s>1,u=23===t?f(2,-24)-f(2,-77):0,c=e<0||0===e&&1/e<0?1:0,d=0;for((e=h(e))!=e||e===1/0?(n=e!=e?1:0,o=r):(o=p(m(e)/y),e*(s=f(2,-o))<1&&(o--,s*=2),2<=(e+=1<=o+l?u/s:u*f(2,1-l))*s&&(o++,s/=2),r<=o+l?(n=0,o=r):1<=o+l?(n=(e*s-1)*f(2,t),o+=l):(n=e*f(2,l-1)*f(2,t),o=0));8<=t;i[d++]=255&n,n/=256,t-=8);for(o=o<>1,a=n-7,l=o-1,n=e[l--],u=127&n;for(n>>=7;0>=-a,a+=t;0"+e+""},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=n?((e=n).write(p("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=c("iframe"),t="java"+h+":",e.style.display="none",u.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[f]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=s(e),r=new o,o[d]=null,r[f]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),l=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){a(e);for(var r,o=l(t),n=o.length,s=0;sn;)!i(o,r=t[n++])||~l(s,r)||s.push(r);return s}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":134}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){"use strict";var o={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!o.call({1:2},1);r.f=s?function(e){e=n(this,e);return!!e&&e.enumerable}:o},{}],101:[function(e,t,r){var n=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return n(e),s(t),o?r.call(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){"use strict";var o=e("../internals/to-string-tag-support"),n=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+n(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":141}],103:[function(e,t,r){var o=e("../internals/get-built-in"),n=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=n.f(i(e)),r=s.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global");t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/is-object"),s=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),n(t)&&t.constructor===e?t:((0,(e=s.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var i=e("../internals/global"),a=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),u=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),n=e.get,c=e.enforce,d=String(String).split("String");(t.exports=function(e,t,r,o){var n=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,o=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||l(r,"name")||a(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e===i?s?e[t]=r:u(t,r):(n?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=r:a(e,t,r))})(Function.prototype,"toString",function(){return"function"==typeof this&&n(this).source||o(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),n=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){r=r.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return n.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){"use strict";var o,n,d=e("./regexp-flags"),e=e("./regexp-sticky-helpers"),h=RegExp.prototype.exec,f=String.prototype.replace,s=h,p=(o=/a/,n=/b*/g,h.call(o,"a"),h.call(n,"a"),0!==o.lastIndex||0!==n.lastIndex),m=e.UNSUPPORTED_Y||e.BROKEN_CARET,y=void 0!==/()??/.exec("")[1];t.exports=s=p||y||m?function(e){var t,r,o,n,s=this,i=m&&s.sticky,a=d.call(s),l=s.source,u=0,c=e;return i&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),c=String(e).slice(s.lastIndex),0t&&(o=o.slice(0,t)),n?e+o:o+e)}}var s=e("../internals/to-length"),i=e("../internals/string-repeat"),a=e("../internals/require-object-coercible"),l=Math.ceil;t.exports={start:o(!1),end:o(!0)}},{"../internals/require-object-coercible":113,"../internals/string-repeat":127,"../internals/to-length":136}],126:[function(e,t,r){"use strict";function g(e){return e+22+75*(e<26)}function s(e){var t,r=[],o=(e=function(e){for(var t=[],r=0,o=e.length;rT((v-s)/d))throw RangeError(w);for(s+=(u-n)*d,n=u,c=0;cv)throw RangeError(w);if(t==n){for(var h=s,f=b;;f+=b){var p=f<=i?1:i+j<=f?j:f-i;if(h>1,e+=T(e/t);S*j>>1>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":135}],128:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/whitespaces");t.exports=function(e){return o(function(){return!!n[e]()||"​…᠎"!="​…᠎"[e]()||n[e].name!==e})}},{"../internals/fails":51,"../internals/whitespaces":149}],129:[function(e,t,r){function o(t){return function(e){e=String(n(e));return 1&t&&(e=e.replace(s,"")),e=2&t?e.replace(i,""):e}}var n=e("../internals/require-object-coercible"),e="["+e("../internals/whitespaces")+"]",s=RegExp("^"+e+e+"*"),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":149}],130:[function(e,t,r){function o(e){return function(){x(e)}}function n(e){x(e.data)}function s(e){a.postMessage(e+"",f.protocol+"//"+f.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),u=e("../internals/classof-raw"),c=e("../internals/function-bind-context"),d=e("../internals/html"),h=e("../internals/document-create-element"),e=e("../internals/engine-is-ios"),f=a.location,p=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,j={},_="onreadystatechange",x=function(e){var t;j.hasOwnProperty(e)&&(t=j[e],delete j[e],t())};p&&m||(p=function(e){for(var t=[],r=1;r=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":134}],162:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),i=[].join,n=n!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:n||!e},{join:function(e){return i.call(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":134}],163:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/array-last-index-of");o({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],164:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").map,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("map"),e=e("map");o({target:"Array",proto:!0,forced:!s||!e},{map:function(e){return n(this,e,1T;T++)l(b,x=S[T])&&!l(w,x)&&y(w,x,m(b,x));(w.prototype=j).constructor=w,a(s,v,w)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":129,"../internals/to-primitive":140}],174:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],175:[function(e,t,r){"use strict";function c(e,t,r){return 0===t?r:t%2==1?c(e,t-1,r*e):c(e*e,t/2,r)}var o=e("../internals/export"),d=e("../internals/to-integer"),h=e("../internals/this-number-value"),f=e("../internals/string-repeat"),e=e("../internals/fails"),n=1..toFixed,p=Math.floor;o({target:"Number",proto:!0,forced:n&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!e(function(){n.call({})})},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*a[r],a[r]=o%1e7,o=p(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=a[t],a[t]=p(r/e),r=r%e*1e7}function o(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===a[t]||(e=String(a[t]),r=""===r?e:r+f.call("0",7-e.length)+e);return r}var n,s,i=h(this),e=d(e),a=[0,0,0,0,0,0],l="",u="0";if(e<0||20n;){var s,i,a,l=y[n++],u=t?l.ok:l.fail,c=l.resolve,d=l.reject,h=l.domain;try{u?(t||(p.rejection===oe&&function(e,t){v.call(g,function(){if(k)T.emit("rejectionHandled",e);else se(te,e,t.value)})}(f,p),p.rejection=A),!0===u?s=e:(h&&h.enter(),s=u(e),h&&(h.exit(),a=!0)),s===l.promise?d(w("Promise-chain cycle")):(i=ne(s))?i.call(s,c,d):c(s)):d(e)}catch(e){h&&!a&&h.exit(),d(e)}}p.reactions=[],p.notified=!1,m&&!p.rejection&&(r=f,o=p,v.call(g,function(){var e=o.value,t=ie(o);if(t&&(t=b(function(){k?T.emit("unhandledRejection",e,r):se(C,r,e)}),o.rejection=k||ie(o)?oe:A,t.error))throw t.value}))}))},se=function(e,t,r){var o;ee?((o=S.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),g.dispatchEvent(o)):o={promise:t,reason:r},(t=g["on"+e])?t(o):e===C&&Y("Unhandled promise rejection",r)},ie=function(e){return e.rejection!==A&&!e.parent},L=function(t,r,o,n){return function(e){t(r,o,e,n)}},R=function(e,t,r,o){t.done||(t.done=!0,(t=o?o:t).value=r,t.state=re,P(e,t,!0))},D=function(r,o,e,t){if(!o.done){o.done=!0,t&&(o=t);try{if(r===e)throw w("Promise can't be resolved itself");var n=ne(e);n?u(function(){var t={done:!1};try{n.call(e,L(D,r,t,o),L(R,r,t,o))}catch(e){R(r,t,e,o)}}):(o.value=e,o.state=O,P(r,o,!1))}catch(e){R(r,{done:!1},e,o)}}};e&&(x=function(e){z(this,x,j),c(e),r.call(this);var t=_(this);try{e(L(D,this,t),L(R,this,t))}catch(e){R(this,t,e)}},(r=function(e){J(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=N(x.prototype,{then:function(e,t){var r=K(this),o=M(X(this,x));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=k?T.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&P(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),t=function(){var e=new r,t=_(e);this.promise=e,this.resolve=L(D,e,t),this.reject=L(R,e,t)},f.f=M=function(e){return e===x||e===o?new t:$(e)},i||"function"!=typeof l||(n=l.prototype.then,U(l.prototype,"then",function(e,t){var r=this;return new x(function(e,t){n.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof E&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return h(x,E.apply(g,arguments))}}))),s({global:!0,wrap:!0,forced:e},{Promise:x}),B(x,j,!1,!0),G(j),o=a(j),s({target:j,stat:!0,forced:e},{reject:function(e){var t=M(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:i||e},{resolve:function(e){return h(i&&this===o?x:this,e)}}),s({target:j,stat:!0,forced:m},{all:function(e){var a=this,t=M(a),l=t.resolve,u=t.reject,r=b(function(){var o=c(a.resolve),n=[],s=0,i=1;d(e,function(e){var t=s++,r=!1;n.push(void 0),i++,o.call(a,e).then(function(e){r||(r=!0,n[t]=e,--i||l(n))},u)}),--i||l(n)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,o=M(r),n=o.reject,t=b(function(){var t=c(r.resolve);d(e,function(e){t.call(r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":130,"../internals/well-known-symbol":148}],184:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/get-built-in"),s=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),c=n("Reflect","construct"),d=e(function(){function e(){}return!(c(function(){},[],e)instanceof e)}),h=!e(function(){c(function(){})}),n=d||h;o({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(e,t){s(e),i(t);var r=arguments.length<3?e:s(arguments[2]);if(h&&!d)return c(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(u.apply(e,o))}o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t);return a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],185:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/is-object"),i=e("../internals/an-object"),a=e("../internals/has"),l=e("../internals/object-get-own-property-descriptor"),u=e("../internals/object-get-prototype-of");o({target:"Reflect",stat:!0},{get:function e(t,r){var o,n=arguments.length<3?t:arguments[2];return i(t)===n?t[r]:(o=l.f(t,r))?a(o,"value")?o.value:void 0===o.get?void 0:o.get.call(n):s(o=u(t))?e(o,r,n):void 0}})},{"../internals/an-object":10,"../internals/export":50,"../internals/has":60,"../internals/is-object":74,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-prototype-of":97}],186:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/global"),s=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,u=e("../internals/is-regexp"),c=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),h=e("../internals/redefine"),f=e("../internals/fails"),p=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=n.RegExp,v=g.prototype,b=/a/g,j=/a/g,_=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&s("RegExp",!_||x||f(function(){return j[y]=!1,g(b)!=b||g(j)==j||"/a/i"!=g(b,"i")}))){for(var w=function(e,t){var r,o=this instanceof w,n=u(e),s=void 0===t;if(!o&&n&&e.constructor===w&&s)return e;_?n&&!s&&(e=e.source):e instanceof w&&(s&&(t=c.call(e)),e=e.source),x&&(r=!!t&&-1T;)!function(t){t in w||a(w,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})}(S[T++]);(v.constructor=w).prototype=v,h(n,"RegExp",w)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":148}],187:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],188:[function(e,t,r){"use strict";var o=e("../internals/redefine"),n=e("../internals/an-object"),s=e("../internals/fails"),i=e("../internals/regexp-flags"),e="toString",a=RegExp.prototype,l=a[e],s=s(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),u=l.name!=e;(s||u)&&o(RegExp.prototype,e,function(){var e=n(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],189:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],190:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),e=e("../internals/is-pure"),u="".endsWith,c=Math.min,l=l("endsWith");o({target:"String",proto:!0,forced:!!(e||l||(!(o=n(String.prototype,"endsWith"))||o.writable))&&!l},{endsWith:function(e){var t=String(a(this)),r=(i(e),1=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],193:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/an-object"),d=e("../internals/to-length"),n=e("../internals/require-object-coercible"),h=e("../internals/advance-string-index"),f=e("../internals/regexp-exec-abstract");o("match",1,function(o,l,u){return[function(e){var t=n(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=u(l,e,this);if(t.done)return t.value;var r=c(e),o=String(this);if(!r.global)return f(r,o);for(var n=r.unicode,s=[],i=r.lastIndex=0;null!==(a=f(r,o));){var a=String(a[0]);""===(s[i]=a)&&(r.lastIndex=h(o,d(r.lastIndex),n)),i++}return 0===i?null:s}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":136}],194:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/string-pad").start;o({target:"String",proto:!0,forced:e("../internals/string-pad-webkit-bug")},{padStart:function(e){return n(this,e,1]*>)/g,D=/\$([$&'`]|\d\d?)/g;o("replace",2,function(n,j,_,e){var x=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=e.REPLACE_KEEPS_$0,S=x?"$":"$0";return[function(e,t){var r=s(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):j.call(String(r),e,t)},function(e,t){if(!x&&w||"string"==typeof t&&-1===t.indexOf(S)){var r=_(j,e,this,t);if(r.done)return r.value}for(var o,n=T(e),s=String(this),i="function"==typeof t,a=(i||(t=String(t)),n.global),l=(a&&(o=n.unicode,n.lastIndex=0),[]);null!==(f=O(n,s))&&(l.push(f),a);)""===String(f[0])&&(n.lastIndex=C(s,M(n.lastIndex),o));for(var u,c="",d=0,h=0;h>>0;if(0==o)return[];if(void 0===e)return[r];if(!c(e))return p.call(r,e,o);for(var n,s,i,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=new RegExp(e.source,t+"g");(n=h.call(u,r))&&!(l<(s=u.lastIndex)&&(a.push(r.slice(l,n.index)),1=o));)u.lastIndex===n.index&&u.lastIndex++;return l===r.length?!i&&u.test("")||a.push(""):a.push(r.slice(l)),a.length>o?a.slice(0,o):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)}:p;return[function(e,t){var r=d(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):y.call(String(r),e,t)},function(e,t){var r=m(y,e,this,t,y!==p);if(r.done)return r.value;var r=g(e),o=String(this),e=v(r,RegExp),n=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"y":"g"),i=new e(S?r:"^(?:"+r.source+")",s),a=void 0===t?w:t>>>0;if(0==a)return[];if(0===o.length)return null===_(i,o)?[o]:[];for(var l=0,u=0,c=[];ue.key){o.splice(t,0,e);break}t===s&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=A(this).entries,o=v(e,16)return;a=0;while(h()){l=null;if(a>0)if(h()=="."&&a<4)n++;else return;if(!x.test(h()))return;while(x.test(h())){u=parseInt(h(),10);if(l===null)l=u;else if(l==0)return;else l=l*10+u;if(l>255)return;n++}t[r]=t[r]*256+l;a++;if(a==2||a==4)r++}if(a!=4)return;break}else if(h()==":"){n++;if(!h())return}else if(h())return;t[r++]=s}if(o!==null){c=r-o;r=7;while(r!=0&&c>0){d=t[r];t[r--]=t[o+c-1];t[o+--c]=d}}else if(r!=8)return;return t}(t.slice(1,-1)))?void(e.host=r):_;if(k(e))return t=z(t),ne.test(t)||null===(r=function(e){var t=e.split("."),r,o,n,s,i,a,l;if(t.length&&t[t.length-1]=="")t.pop();if((r=t.length)>4)return e;for(o=[],n=0;n1&&s.charAt(0)=="0"){i=ee.test(s)?16:8;s=s.slice(i==8?1:2)}if(s==="")a=0;else{if(!(i==10?re:i==8?te:oe).test(s))return e;a=parseInt(s,i)}o.push(a)}for(n=0;n=Z(256,5-r))return null}else if(a>255)return null}for(l=o.pop(),n=0;n":1,"`":1}),ce=d({},ue,{"#":1,"?":1,"{":1,"}":1}),T=d({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),E=function(e,t){var r=V(e,0);return 32h,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,c=l>>16&255,d=l>>8&255,l=255&l,h=A(l,d,c,u),h=h in a?a[h]:a[h]=function(t,r,o,n,s){let i=0,a=1e100;for(let e=0;ea||(l=u[0],(c+=v(l-t))>a||(l=u[1],(c+=v(l-r))>a||(l=u[2],(c+=v(l-o))>a||(a=c,i=e))))}return i}(l,d,c,u,t);i[e]=h}else{const g="rgb444"===r?P:O;for(let e=0;e>16&255,m=f>>8&255,f=255&f,y=g(f,m,p),y=y in a?a[y]:a[y]=function(t,r,o,n){let s=0,i=1e100;for(let e=0;ei||(a=l[1],(u+=v(a-r))>i||(a=l[2],(u+=v(a-o))>i||(i=u,s=e)))}return s}(f,m,p,t);i[e]=y}}return i},default:()=>f,nearestColor:()=>function(e,t,r=u){return e[l(e,t,r)]},nearestColorIndex:()=>l,nearestColorIndexWithDistance:()=>d,prequantize:()=>function(e,{roundRGB:r=5,roundAlpha:o=10,oneBitAlpha:n=null}={}){const s=new Uint32Array(e.buffer);for(let t=0;t>24&255;var a,l=i>>16&255,u=i>>8&255,i=255&i;e=c(e,o),n&&(a="number"==typeof n?n:127,e=e<=a?0:255),i=c(i,r),u=c(u,r),l=c(l,r),s[t]=e<<24|l<<16|u<<8|i<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:n=!0,clearAlphaColor:s=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const u="rgba4444"===o,c=function(r,e){const t="rgb444"===e?4096:65536,o=new Array(t),n=r.length;if("rgba4444"===e)for(let t=0;t>24&255,a=s>>16&255,l=s>>8&255,s=255&s,u=A(s,l,a,i);let e=u in o?o[u]:o[u]=I();e.rc+=s,e.gc+=l,e.bc+=a,e.ac+=i,e.cnt++}else if("rgb444"===e)for(let t=0;t>16&255,h=c>>8&255,c=255&c,f=P(c,h,d);let e=f in o?o[f]:o[f]=I();e.rc+=c,e.gc+=h,e.bc+=d,e.cnt++}else for(let t=0;t>16&255,y=p>>8&255,p=255&p,g=O(p,y,m);let e=g in o?o[g]:o[g]=I();e.rc+=p,e.gc+=y,e.bc+=m,e.cnt++}return o}(e,o),d=c.length,h=d-1,f=new Uint32Array(d+1);for(var p=0,m=0;m>1,!(c[y=f[v]].err<=b));g=v)f[g]=y;f[g]=m}var j,_=p-t;for(m=0;m<_;){for(;;){var x=f[1];if((j=c[x]).tm>=j.mtm&&c[j.nn].mtm<=j.tm)break;j.mtm==h?x=f[1]=f[f[0]--]:(D(c,x,!1),j.tm=m);b=c[x].err;for(g=1;(v=g+g)<=f[0]&&(vc[f[v+1]].err&&v++,!(b<=c[y=f[v]].err));g=v)f[g]=y;f[g]=x}var w=c[j.nn],S=j.cnt,T=w.cnt,E=1/(S+T);u&&(j.ac=E*(S*j.ac+T*w.ac)),j.rc=E*(S*j.rc+T*w.rc),j.gc=E*(S*j.gc+T*w.gc),j.bc=E*(S*j.bc+T*w.bc),j.cnt+=w.cnt,j.mtm=++m,c[w.bk].fw=w.fw,c[w.fw].bk=w.bk,w.mtm=h}let M=[];for(m=0;;0){let e=L(Math.round(c[m].rc),0,255),t=L(Math.round(c[m].gc),0,255),r=L(Math.round(c[m].bc),0,255),o=255;u&&(o=L(Math.round(c[m].ac),0,255),a&&(k="number"==typeof a?a:127,o=o<=k?0:255),n&&o<=i&&(e=t=r=s,o=0));var k=u?[e,t,r,o]:[e,t,r];if(function(t,r){for(let e=0;efunction(r,o,e=5){if(r.length&&o.length){var n=r.map(e=>e.slice(0,3)),s=e*e,i=r[0].length;for(let t=0;ti?e.slice(0,3):e.slice();var a=d(n,e.slice(0,3),u),l=a[0],a=a[1];0>>0),0!=t&&(e=Math.max(e,256));const r=s;s=new Uint8Array(e),0>=8,c-=8;if((v>m||f)&&(f?(p=h,m=(1<>=8,c-=8;0>3}function A(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function P(e,t,r){return e>>4<<8|240&t|r>>4}function L(e,t,r){return e>8&255)}function C(e,t){for(var r=0;r>1,c=-7,d=r?n-1:0,h=r?-1:1,n=e[t+d];for(d+=h,s=n&(1<<-c)-1,n>>=-c,c+=a;0>=-c,c+=o;0>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:s-1,f=o?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+c?d/o:d*Math.pow(2,1-c))*o&&(i++,o/=2),u<=i+c?(a=0,i=u):1<=i+c?(a=(t*o-1)*Math.pow(2,n),i+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),i=0));8<=n;e[r+h]=255&a,h+=f,a/=256,n-=8);for(i=i<Math.abs(e[0])&&(t=1),t=Math.abs(e[2])>Math.abs(e[t])?2:t}function M(e,t){e.f+=t.f,e.b.f+=t.b.f}function h(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 k(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function C(e,t){m(e.a),e.c=!1,(e.a=t).i=e}function O(e){for(var t=e.a.a;(e=G(e)).a.a===t;);return e.c&&(C(e,t=S(B(e).a.b,e.a.e)),e=G(e)),e}function q(e,t,r){var o=new N;return o.a=r,o.e=p(e.f,t.e,o),r.i=o}function X(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],a[i[u]])?U:ue)(r,u),a[s]=null,l[s]=r.b,r.b=s}else for(r.c[-(s+1)]=null;0Math.max(i.a,l.a))){if(g(s,i)){if(0r.f&&(r.f*=2,r.c=ae(r.c,r.f+1)),0===r.b?n=o:(n=r.b,r.b=r.c[r.b]),r.e[n]=t,r.c[n]=o,r.d[o]=n,r.h&&ue(r,o),n):(r=e.a++,e.c[r]=t,-(r+1))}function se(e){if(0===e.a)return le(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(F(e.b),t))return le(e.b);for(;--e.a,0e.a||g(o[i],o[l])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function ue(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s>>1,l=r[a];if(0==a||g(o[l],o[i])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function N(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function B(e){return e.e.c.b}function G(e){return e.e.a.b}(t=r.prototype).x=function(){D(this,0)},t.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 l(this,100900)}l(this,100901)},t.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:l(this,100900)}return!1},t.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},t.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:l(this,100900)}},t.C=function(e,t){var r=!1,o=[0,0,0];D(this,2);for(var n=0;n<3;++n){var s=e[n];s<-1e150&&(s=-1e150,r=!0),1e150o[u]&&(o[u]=c,n[u]=r)}if(o[1]-a[1]>o[r=0]-a[0]&&(r=1),a[r=o[2]-a[2]>o[r]-a[r]?2:r]>=o[r])i[0]=0,i[1]=0,i[2]=1;else{for(a=l[r],n=n[r],l=[o=0,0,0],a=[a.g[0]-n.g[0],a.g[1]-n.g[1],a.g[2]-n.g[2]],u=[0,0,0],r=s.e;r!==s;r=r.e)u[0]=r.g[0]-n.g[0],u[1]=r.g[1]-n.g[1],u[2]=r.g[2]-n.g[2],l[0]=a[1]*u[2]-a[2]*u[1],l[1]=a[2]*u[0]-a[0]*u[2],l[2]=a[0]*u[1]-a[1]*u[0],o<(c=l[0]*l[0]+l[1]*l[1]+l[2]*l[2])&&(o=c,i[0]=l[0],i[1]=l[1],i[2]=l[2]);o<=0&&(i[0]=i[1]=i[2]=0,i[W(a)]=1)}s=!0}for(l=W(i),r=this.b.c,o=(l+1)%3,n=(l+2)%3,l=0>=1;)++n;if(i=1<>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|n,g[v++]=s,g[v++]=0,null!==b)for(var a=0,l=b.length;a>16&255,g[v++]=u>>8&255,g[v++]=255&u}if(null!==o){if(o<0||65535>8&255,g[v++]=0}var _=!1;this.addFrame=function(e,t,r,o,n,s){if(!0===_&&(--v,_=!1),s=void 0===s?{}:s,e<0||t<0||65535>=1;)++u;var l=1<>8&255,g[v++]=f,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&o,g[v++]=o>>8&255,g[v++]=!0===i?128|u-1:0,!0===i)for(var p=0,m=a.length;p>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,o){t[r++]=e;var n=r++,s=1<>=8,c-=8,r===n+256&&(t[n]=255,n=r++)}function f(e){d|=e<>=8,c-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(f(s),l=1+a,u=e+1,m={}):(1<>=l,c-=l,y==s)a=1+i,u=(1<<(l=n+1))-1,m=null;else{if(y==i)break;for(var g=y>8,++v;var j=b;if(o>=8;null!==m&&a<4096&&(p[a++]=m<<8|j,u+1<=a&&l<12&&(++l,u=u<<1|1)),m=y}}h!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=o,r.GifReader=function(b){var e=0;if(71!==b[e++]||73!==b[e++]||70!==b[e++]||56!==b[e++]||56!=(b[e++]+1&253)||97!==b[e++])throw new Error("Invalid GIF 87a/89a header.");var j=b[e++]|b[e++]<<8,t=b[e++]|b[e++]<<8,r=b[e++],o=1<<1+(7&r),n=(b[e++],b[e++],null),s=null,i=(r>>7&&(n=e,e+=3*(s=o)),!0),a=[],l=0,u=null,c=0,d=null;for(this.width=j,this.height=t;i&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}break;default:throw new Error("Unknown graphic control label: 0x"+b[e-1].toString(16))}break;case 44:var f,p=b[e++]|b[e++]<<8,m=b[e++]|b[e++]<<8,y=b[e++]|b[e++]<<8,g=b[e++]|b[e++]<<8,v=b[e++],_=v>>6&1,x=1<<1+(7&v),w=n,S=s,T=!1,v=(v>>7&&(T=!0,w=e,e+=3*(S=x)),e);for(e++;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}a.push({x:p,y:m,width:y,height:g,has_local_palette:T,palette_offset:w,palette_size:S,data_offset:v,data_length:e-v,transparent_index:u,interlaced:!!_,delay:l,disposal:c});break;case 59:i=!1;break;default:throw new Error("Unknown gif block: 0x"+b[e-1].toString(16))}this.numFrames=function(){return a.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=a.length)throw new Error("Frame index out of range.");return a[e]},this.decodeAndBlitFrameBGRA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(E(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=v,t[d++]=g,t[d++]=y,t[d++]=255),--l}},this.decodeAndBlitFrameRGBA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(E(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=y,t[d++]=g,t[d++]=v,t[d++]=255),--l}}}}catch(e){}},{}],249:[function(Pr,r,o){!function(Ar){var e,t;e=this,t=function(j){"use strict";function I(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length,e=e?Number(e):0;if(!((e=e!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function $(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,r+=t.table[++n],0<=(o-=t.table[n]););return e.tag=s,e.bitcount-=n,t.trans[r+o]}function ee(e,t,r){for(;;){var o=$(e,t);if(256===o)return U;if(o<256)e.dest[e.destLen++]=o;else for(var n,s=b(e,H[o-=257],W[o]),o=$(e,r),i=n=e.destLen-b(e,q[o],X[o]);i>>=1,o=n,b(s,2,0)){case 0:r=function(e){for(var t,r;8this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,r,o,n,s,i,a){var l=[e,t],u=[r,o],c=[n,s],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var h=0;h<=1;h++){var f,p=6*l[h]-12*u[h]+6*c[h],m=-3*l[h]+9*u[h]-9*c[h]+3*d[h],y=3*u[h]-3*l[h];0==m?0==p||0<(f=-y/p)&&f<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],f)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],f))):(f=Math.pow(p,2)-4*y*m)<0||(0<(y=(-p+Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))),0<(y=(-p-Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))))}},a.prototype.addQuad=function(e,t,r,o,n,s){r=e+2/3*(r-e),o=t+2/3*(o-t);this.addBezier(e,t,r,o,r+1/3*(n-e),o+1/3*(s-t),n,s)},h.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},h.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},h.prototype.curveTo=h.prototype.bezierCurveTo=function(e,t,r,o,n,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:n,y:s})},h.prototype.quadTo=h.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},h.prototype.close=h.prototype.closePath=function(){this.commands.push({type:"Z"})},h.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof a)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},h.prototype.getBoundingBox=function(){for(var e=new a,t=0,r=0,o=0,n=0,s=0;s>8&255,255&e]},l.USHORT=r(2),w.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},l.SHORT=r(2),w.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},l.UINT24=r(3),w.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.ULONG=r(4),w.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},l.LONG=r(4),w.FIXED=w.ULONG,l.FIXED=l.ULONG,w.FWORD=w.SHORT,l.FWORD=l.SHORT,w.UFWORD=w.USHORT,l.UFWORD=l.USHORT,w.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},l.LONGDATETIME=r(8),w.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)]},l.TAG=r(4),w.Card8=w.BYTE,l.Card8=l.BYTE,w.Card16=w.USHORT,l.Card16=l.USHORT,w.OffSize=w.BYTE,l.OffSize=l.BYTE,w.SID=w.USHORT,l.SID=l.USHORT,w.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?w.NUMBER16(e):w.NUMBER32(e)},l.NUMBER=function(e){return w.NUMBER(e).length},w.NUMBER16=function(e){return[28,e>>8&255,255&e]},l.NUMBER16=r(3),w.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},l.NUMBER32=r(5),w.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),n=0,s=t.length;n>8&255,t[t.length]=255&o}return t},l.UTF16=function(e){return 2*e.length};var se,ie={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(m.MACSTRING=function(e,t,r,o){var n=ie[o];if(void 0!==n){for(var s="",i=0;i>8&255,l+256&255)}return s})(e,t,r);return r},w.INDEX=function(e){for(var t=1,r=[t],o=[],n=0;n>8,t[c+1]=255&d,t=t.concat(o[u])}return t},l.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o>1,a.skip("uShort",3),y.glyphIndexMap={};for(var j,_=new R.Parser(g,v+b+14),x=new R.Parser(g,v+b+16+2*j),w=new R.Parser(g,v+b+16+4*j),S=new R.Parser(g,v+b+16+6*j),T=v+b+16+8*j,E=0;E>4,s=15&s;if(15==i)break;if(o+=n[i],15==s)break;o+=n[s]}return parseFloat(o)}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 De(e,t,r){var o=new R.Parser(e,t=void 0!==t?t:0),n=[],s=[];for(r=void 0!==r?r:e.length;o.relativeOffset>1,E.length=0,k=!0}return function e(t){for(var r,o,n,s,i,a,l,u,c,d,h,f,p=0;pMath.abs(f-A)?O=h+E.shift():A=f+E.shift(),T.curveTo(v,b,j,_,l,u),T.curveTo(c,d,h,f,O,A);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+m),E.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:i=E.pop()+y.gsubrsBias,(a=y.gsubrs[i])&&e(a);break;case 30:for(;0=r.begin&&e=c.length&&(s=o.parseChar(),r.names.push(o.parseString(s)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;at.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(n),t}function xt(e,t,r){for(var o=0;o 123 are reserved for internal usage");f|=1<>>1,s=e[n].tag;if(s===t)return n;s>>1,s=e[n];if(s===t)return n;s>>1,i=(n=e[s]).start;if(i===t)return n;i(n=e[r-1]).end?0:n}function Mt(e,t){this.font=e,this.tableName=t}function kt(e){Mt.call(this,e,"gpos")}function i(e){Mt.call(this,e,"gsub")}function Ct(e,t,r){for(var o=e.subtables,n=0;nt.points.length-1||o.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=n.points[o.matchedPoints[1]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0},a=Lt([a],o)[0];o.dx=i.x-a.x,o.dy=i.y-a.y,s=Lt(n.points,o)}t.points=t.points.concat(s)}}return Rt(t.points)}(kt.prototype=Mt.prototype={searchTag:St,binSearch:Tt,getTable:function(e){var t=this.font.tables[this.tableName];return t=!t&&e?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=i[t-1].tag,"Features must be added in alphabetical order."),i.push(n={tag:r,feature:{params:0,lookupListIndexes:[]}}),s.push(t),n.feature}},getLookupTables:function(e,t,r,o,n){var e=this.getFeatureTable(e,t,r,n),s=[];if(e){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u",s),t.stack.push(Math.round(64*s))}function hr(e,t){var r=t.stack,o=r.pop(),n=t.fv,s=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;j.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,r);for(var c=0;c>4)===i&&(0<=(h=(15&h)-8)&&h++,j.DEBUG&&console.log(t.step,"DELTAPFIX",d,"by",h*l),d=u[d],n.setRelative(d,d,h*l,s))}}function fr(e,t){var r=t.stack,o=r.pop();j.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(o/64))}function pr(e,t){var r=t.stack,o=r.pop(),n=t.ppem,s=t.deltaBase+16*(e-1),i=t.deltaShift;j.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,r);for(var a=0;a>4)===n&&(0<=(u=(15&u)-8)&&u++,u=u*i,j.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",u),t.cvt[l]+=u)}}function mr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.dpv=qt(r,n)}function k(e,t){var r=t.stack,o=t.prog,n=t.ip;j.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var s=0;s":"_")+(o?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+a+")":"",l,"(d =",i,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",o),a.interpolate(d,s,i,l),a.touch(d)}e.loop=1},lr.bind(void 0,0),lr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,o=e.z0[r],n=e.loop,s=e.fv,i=e.pv,a=e.z1;n--;){var l=t.pop(),u=a[l];j.DEBUG&&console.log(e.step,(1'.concat(n,"").concat(t,""),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},s.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+i))?this.dummyDOM.querySelector("#"+o+l).insertAdjacentHTML("beforebegin",'

')):(r='

'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(a)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+u))?this.dummyDOM.querySelector("#".concat(o+d))&&this.dummyDOM.querySelector("#".concat(o+d)).insertAdjacentHTML("beforebegin",'

')):(r='

'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+c),this.descriptions.label.innerHTML=t)},s.default.prototype._describeElementHTML=function(e,t,r){var o,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+l)||this.dummyDOM.querySelector("#"+n+a).insertAdjacentHTML("afterend",'
Canvas elements and their descriptions
')):(o='
Canvas elements and their descriptions
'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).innerHTML=o),(o=document.createElement("tr")).id=n+"_fte_"+t,this.dummyDOM.querySelector("#"+n+l).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+u))?this.dummyDOM.querySelector("#".concat(n+d))||this.dummyDOM.querySelector("#"+n+c).insertAdjacentHTML("afterend",'
')):(o='
'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=n+"_lte_"+t,this.dummyDOM.querySelector("#"+n+d).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)};e=s.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.ends-with":190,"core-js/modules/es.string.replace":196}],256:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateGridOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]);t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1]);return t}((r=function(e,t){var r,o="",n="",s=0;for(r in t){var i,a=0;for(i in t[r]){var l='
  • ').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="
  • "),o+=l,a++,s++}n=1').concat(t[r][a].color," ").concat(r,"
    "):'').concat(t[r][a].color," ").concat(r," midpoint"),i[t[r][a].loc.locY][t[r][a].loc.locX]?i[t[r][a].loc.locY][t[r][a].loc.locX]=i[t[r][a].loc.locY][t[r][a].loc.locX]+" "+l:i[t[r][a].loc.locY][t[r][a].loc.locX]=l,n++}for(o in i){var u,c="";for(u in i[o])c+="",void 0!==i[o][u]&&(c+=i[o][u]),c+="";s=s+c+""}return s}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.from":158,"core-js/modules/es.array.map":164,"core-js/modules/es.string.iterator":192}],257:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t
    ')):this.dummyDOM.querySelector("#".concat(s)).innerHTML='
    '))):"Label"===t&&(r=s+e+(i=t),this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(s,"_Label"))?this.dummyDOM.querySelector("#".concat(s,"_Label")):this.dummyDOM.querySelector("#".concat(s))).insertAdjacentHTML("afterend",'
    '))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(s,"gridOutput").concat(i),n='
    Text Output

      '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(s,"textOutput").concat(i),n='
      Grid Output

        '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,n={},s=!0,i=function(e,t){var r;e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,e]}(e,t);if("line"===e?(n.color=this.ingredients.colors.stroke,n.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=this._getPos(t[0],[1]),o=this._getPos(t[2],[3]),n.loc=u(i,this.width,this.height),n.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?n.color=this.ingredients.colors.stroke:(n.color=this.ingredients.colors.fill,n.area=this._getArea(e,t)),n.pos=this._getPos.apply(this,l(i)),n.loc=u(i,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[n]){for(var a in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][a])===JSON.stringify(n)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(n)}}else this.ingredients.shapes[e]=[n]},o.default.prototype._getPos=function(e,t){var e=new DOMPointReadOnly(e,t),t=this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform(),e=e.matrixTransform(t),t=e.x,e=e.y,r=this.width,o=this.height;return t<.4*r?e<.4*o?"top left":.6*oMath.PI?n+=o:n-=o)):"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),this.width*this._pixelDensity),i=this.height*this._pixelDensity,a=[new DOMPoint(0,0),new DOMPoint(s,0),new DOMPoint(s,i),new DOMPoint(0,i)],l=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),u=a.map(function(e){return e.matrixTransform(l)}),c=Math.abs((u[3].x+u[0].x)*(u[3].y-u[0].y)+(u[0].x+u[1].x)*(u[0].y-u[1].y)+(u[1].x+u[2].x)*(u[1].y-u[2].y)+(u[2].x+u[3].x)*(u[2].y-u[3].y))/2;return Math.round(100*n/c)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.from":158,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.number.to-fixed":175,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/web.dom-collections.iterator":238}],258:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateTextOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following");r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:");return r}((r=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='
      • ').concat(t[r][s].color," ").concat(r,"");"line"===r?i+=", ".concat(t[r][s].pos,", ").concat(t[r][s].length," pixels long.
      • "):(i+=", at ".concat(t[r][s].pos),"point"!==r&&(i+=", covering ".concat(t[r][s].area,"% of the canvas")),i+="."),o+=i,n++}return{numShapes:n,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='').concat(t[r][s].color," ").concat(r,"");"line"===r?i+="location = ".concat(t[r][s].pos,"length = ").concat(t[r][s].length," pixels"):(i+="location = ".concat(t[r][s].pos,""),"point"!==r&&(i+=" area = ".concat(t[r][s].area,"%")),i+=""),o+=i,n++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151}],259:[function(e,t,r){"use strict";var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.DataArray"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Framebuffer"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":254,"./accessibility/describe":255,"./accessibility/gridOutput":256,"./accessibility/outputs":257,"./accessibility/textOutput":258,"./color/color_conversion":260,"./color/creating_reading":261,"./color/p5.Color":262,"./color/setting":263,"./core/constants":264,"./core/environment":265,"./core/friendly_errors/fes_core":266,"./core/friendly_errors/file_errors":267,"./core/friendly_errors/sketch_reader":268,"./core/friendly_errors/stacktrace":269,"./core/friendly_errors/validate_params":270,"./core/helpers":271,"./core/init":272,"./core/legacy":274,"./core/main":275,"./core/p5.Element":276,"./core/p5.Graphics":277,"./core/p5.Renderer":278,"./core/p5.Renderer2D":279,"./core/preload":280,"./core/rendering":281,"./core/shape/2d_primitives":282,"./core/shape/attributes":283,"./core/shape/curves":284,"./core/shape/vertex":285,"./core/shim":286,"./core/structure":287,"./core/transform":288,"./data/local_storage.js":289,"./data/p5.TypedDict":290,"./dom/dom":291,"./events/acceleration":292,"./events/keyboard":293,"./events/mouse":294,"./events/touch":295,"./image/filters":296,"./image/image":297,"./image/loading_displaying":298,"./image/p5.Image":299,"./image/pixels":300,"./io/files":301,"./io/p5.Table":302,"./io/p5.TableRow":303,"./io/p5.XML":304,"./math/calculation":305,"./math/math":306,"./math/noise":307,"./math/p5.Vector":308,"./math/random":309,"./math/trigonometry":310,"./typography/attributes":311,"./typography/loading_displaying":312,"./typography/p5.Font":313,"./utilities/array_functions":314,"./utilities/conversion":315,"./utilities/string_functions":316,"./utilities/time_date":317,"./webgl/3d_primitives":318,"./webgl/interaction":320,"./webgl/light":321,"./webgl/loading":322,"./webgl/material":323,"./webgl/p5.Camera":324,"./webgl/p5.DataArray":325,"./webgl/p5.Framebuffer":326,"./webgl/p5.Geometry":327,"./webgl/p5.Matrix":328,"./webgl/p5.RenderBuffer":329,"./webgl/p5.RendererGL":332,"./webgl/p5.RendererGL.Immediate":330,"./webgl/p5.RendererGL.Retained":331,"./webgl/p5.Shader":333,"./webgl/p5.Texture":334,"./webgl/text":335}],260:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.ColorConversion={_hsbaToHSLA:function(e){var t=e[0],r=e[1],o=e[2],n=(2-r)*o/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*o/(2-2*n)),[t,r,n,e[3]]},_hsbaToRGBA:function(e){var t,r,o,n,s,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(n=o,s=l,r):2===t?(n=r,s=l,a):3===t?(n=r,s=o,l):4===t?(n=a,s=r,l):5===t?(n=l,s=r,o):(n=l,s=a,r),[n,s,i,e[3]])},_hslaToHSBA:function(e){var t=e[0],r=e[1],o=e[2],n=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(n-o)/n,n,e[3]]},_hslaToRGBA:function(e){var t,r=6*e[0],o=e[1],n=e[2];return 0===o?[n,n,n,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*n-(n=n<.5?(1+o)*n:n+o-n*o),n),t(r,o,n),t(r-2,o,n),e[3]]},_rgbaToHSBA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=i-Math.min(o,n,s);return 0==a?r=t=0:(r=a/i,o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},_rgbaToHSLA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=Math.min(o,n,s),l=i+a,a=i-a;return 0==a?r=t=0:(r=l<1?a/l:a/(2-l),o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]}};e=e.default.ColorConversion;r.default=e},{"../core/main":275}],261:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.alpha=function(e){return l.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},l.default.prototype.blue=function(e){return l.default._validateParameters("blue",arguments),this.color(e)._getBlue()},l.default.prototype.brightness=function(e){return l.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},l.default.prototype.color=function(){var e;return l.default._validateParameters("color",arguments),arguments[0]instanceof l.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new l.default.Color(this,e))},l.default.prototype.green=function(e){return l.default._validateParameters("green",arguments),this.color(e)._getGreen()},l.default.prototype.hue=function(e){return l.default._validateParameters("hue",arguments),this.color(e)._getHue()},l.default.prototype.lerpColor=function(e,t,r){l.default._validateParameters("lerpColor",arguments);var o,n,s,i=this._colorMode,a=this._colorMaxes;if(i===u.RGB)n=e.levels.map(function(e){return e/255}),s=t.levels.map(function(e){return e/255});else if(i===u.HSB)e._getBrightness(),t._getBrightness(),n=e.hsba,s=t.hsba;else{if(i!==u.HSL)throw new Error("".concat(i,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),n=e.hsla,s=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(n[0],s[0],r),t=this.lerp(n[1],s[1],r),o=this.lerp(n[2],s[2],r),n=this.lerp(n[3],s[3],r),e*=a[i][0],t*=a[i][1],o*=a[i][2],n*=a[i][3],this.color(e,t,o,n)},l.default.prototype.lightness=function(e){return l.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},l.default.prototype.red=function(e){return l.default._validateParameters("red",arguments),this.color(e)._getRed()},l.default.prototype.saturation=function(e){return l.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=l.default;r.default=n},{"../core/constants":264,"../core/friendly_errors/fes_core":266,"../core/friendly_errors/file_errors":267,"../core/friendly_errors/validate_params":270,"../core/main":275,"./p5.Color":262,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],262:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(e("../core/main")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),h=s(e("./color_conversion"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r"].indexOf(r[0])?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(o)},this).map(function(e){var t,r;return-1===(e=-1 eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[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"),o=[],n=2,s=r.length;n/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}},this)}}}e.default._getErrorStackParser=function(){return new o};e=e.default;r.default=e},{"../main":275,"core-js/modules/es.array.filter":155,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.join":162,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.match":193,"core-js/modules/es.string.replace":196,"core-js/modules/es.string.split":198}],270:[function(e,t,r){"use strict";function o(e){return(o="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)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==a(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o)})(e("../constants")),e("../internationalization");function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};e=n.default;r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":264,"../internationalization":273,"../main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.for-each":157,"core-js/modules/es.array.includes":159,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.join":162,"core-js/modules/es.array.last-index-of":163,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.function.name":168,"core-js/modules/es.map":169,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.get-prototype-of":180,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.reflect.construct":184,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.set":189,"core-js/modules/es.string.includes":191,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.for-each":237,"core-js/modules/web.dom-collections.iterator":238}],271:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,n){return n===s.CORNER?{x:e,y:t,w:r,h:o}:n===s.CORNERS?{x:e,y:t,w:r-e,h:o-t}:n===s.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:n===s.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":264,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],272:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var n=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),n]).then(function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default})},{"../core/main":275,"./internationalization":273,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.to-string":182,"core-js/modules/es.promise":183,"core-js/modules/es.string.iterator":192,"core-js/modules/web.dom-collections.iterator":238}],273:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,s,o=a(e("i18next")),i=a(e("i18next-browser-languagedetector"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r*s,o*s);return n._pixelDensity=s,n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r*s,o*s),n}},{key:"textLeading",value:function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading}},{key:"textStyle",value:function(e){return e?(e!==A.NORMAL&&e!==A.ITALIC&&e!==A.BOLD&&e!==A.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle}},{key:"textAscent",value:function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent}},{key:"textDescent",value:function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent}},{key:"textAlign",value: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}}},{key:"textWrap",value:function(e){return this._setProperty("_textWrap",e),this._textWrap}},{key:"text",value:function(e,t,r,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,h=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===A.CENTER&&(t-=o/2),this._textAlign){case A.CENTER:t+=o/2;break;case A.RIGHT:t+=o}if(void 0!==n){this._rectMode===A.CENTER&&(r-=n/2,h-=n/2);var e=r,f=u.textAscent();switch(this._textBaseline){case A.BOTTOM:l=r+n,r=Math.max(l,r),h+=f;break;case A.CENTER:l=r+n/2,r=Math.max(l,r),h+=f/2}d=r+n-f,this._textBaseline===A.CENTER&&(d=e+n-f/2)}else this._textBaseline!==A.BOTTOM&&this._textBaseline!==A.CENTER||(h=r-(e=u.textSize()*this._textLeading)/2,d=r+e/2);if(c===A.WORD){for(var p=[],m=0;ma.HALF_PI&&e<=3*a.HALF_PI?Math.atan(r/o*Math.tan(e))+a.PI:Math.atan(r/o*Math.tan(e))+a.TWO_PI,t=t<=a.HALF_PI?Math.atan(r/o*Math.tan(t)):t>a.HALF_PI&&t<=3*a.HALF_PI?Math.atan(r/o*Math.tan(t))+a.PI:Math.atan(r/o*Math.tan(t))+a.TWO_PI),tp||Math.abs(this.accelerationY-this.pAccelerationY)>p||Math.abs(this.accelerationZ-this.pAccelerationZ)>p)&&s.deviceMoved(),"function"==typeof s.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},_toImageData:function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},_createImageData:function(e,t){return V._tmpCanvas=document.createElement("canvas"),V._tmpCtx=V._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},apply:function(e,t,r){var o=e.getContext("2d"),n=o.getImageData(0,0,e.width,e.height),t=t(n,r);t instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(n,0,0,0,0,e.width,e.height)},threshold:function(e,t){for(var r=V._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),n=0;n>8)/o,r[n+1]=255*(i*t>>8)/o,r[n+2]=255*(a*t>>8)/o}},dilate:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(n>>8&255)+28*(255&n))<(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=s,n=l),n<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,n=u),f[d++]=o;V._setPixels(c,f)},erode:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(u>>8&255)+28*(255&u))<(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=u,n=a),(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(s>>8&255)+28*(255&s))>16&255)+151*(i>>8&255)+28*(255&i))>>24],r+=j[(16711680&D)>>16],o+=j[(65280&D)>>8],n+=j[255&D],t+=B[b],i++}T[a=k+g]=s/t,E[a]=r/t,M[a]=o/t,F[a]=n/t}k+=h}for(u=(l=-U)*h,v=k=0;v"+p.length.toString()+" out of "+c.toString()),e.next=48,new Promise(function(e){return setTimeout(e,0)});e.next=50;break;case 48:e.next=39;break;case 50:i||m.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(f),v=(0,A.GIFEncoder)(),b=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r"+S.toString()+" out of "+c.toString()),e.next=68,new Promise(function(e){return setTimeout(e,0)});case 68:S++,e.next=60;break;case 71:v.finish(),k=v.bytesView(),k=new Blob([k],{type:"image/gif"}),p=[],this._recording=!1,this.loop(),i||(m.html("Done. Downloading your gif!🌸"),0=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))}},{key:"_setProperty",value:function(e,t){this[e]=t,this.setModified(!0)}},{key:"loadPixels",value:function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)}},{key:"updatePixels",value:function(e,t,r,o){s.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o),this.setModified(!0)}},{key:"get",value:function(e,t,r,o){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)}},{key:"_getPixel",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(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"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==s[0]){n.print(" ");for(var c=0;c".concat(d)),n.print(" ")}n.print(" ")}for(var h=0;h");for(var f=0;f".concat(p)),n.print(" ")}n.print(" ")}n.print("
        "),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream",e=(v.default.prototype._isSafari()&&(o="text/plain"),new Blob(e,{type:o}));v.default.prototype.downloadFile(e,t,r)},v.default.prototype.downloadFile=function(e,t,r){var o,t=i(t,r),r=t[0];e instanceof Blob?n.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},v.default.prototype._checkFileExtension=i,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%o)/o}};n.setSeed(e),j=new Array(4096);for(var s=0;s<4096;s++)j[s]=n.rand()},e.default);r.default=e},{"../core/main":275}],308:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("../core/main"))&&n.__esModule?n:{default:n},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function u(e,t){for(var r=0;r>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(tf&&(b=d,v=a,s=l,d=x+f*(i&&x=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.map":164,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.repeat":195}],316:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(u=e("../core/main"))&&u.__esModule?u:{default:u};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t,r){var o=i(e.toString().split("."),2),n=o[0],o=o[1];return void 0===r?(n=n.padStart(t,"0"),o?n+"."+o:n):(n=(e=i(e.toFixed(r).toString().split("."),2))[0],o=e[1],n=n.padStart(t,"0"),void 0===o?n:n+"."+o)}function n(e,t){var r=(e=e.toString()).indexOf("."),o=-1!==r?e.substring(r):"",e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(0===t)o="";else if(void 0!==t)if(t>o.length)for(var n=t-(o+=-1===r?".":"").length+1,s=0;s=_.TWO_PI?"".concat(c="ellipse","|"):"".concat(c="arc","|").concat(s,"|").concat(i,"|").concat(a,"|")).concat(l,"|"),c=(this.geometryInHash(u)||((t=new S.default.Geometry(l,1,function(){if(s.toFixed(10)!==i.toFixed(10)){a!==_.PIE&&void 0!==a||(this.vertices.push(new S.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=l;e++){var t=(i-s)*(e/l)+s,r=.5+Math.cos(t)/2,t=.5+Math.sin(t)/2;this.vertices.push(new S.default.Vector(r,t,0)),this.uvs.push([r,t]),e>5&31)/31,(p>>10&31)/31):(r=i,o=a,l)),new x.default.Vector(y,g,v)),j=1;j<=3;j++){var _=m+12*j,_=new x.default.Vector(u.getFloat32(_,!0),u.getFloat32(4+_,!0),u.getFloat32(8+_,!0));e.vertices.push(_),e.vertexNormals.push(b),d&&s.push(r,o,n)}e.faces.push([3*f,3*f+1,3*f+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{t=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");t=new TextDecoder("utf-8").decode(t).split("\n");!function(e,t){for(var r,o,n="",s=[],i=0;ithis.cameraFar&&(i=this.cameraFar),Math.acos(Math.max(-1,Math.min(1,_.default.Vector.dot(o,n))))+t),t=e;(r<=0||r>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),n.mult(Math.cos(r)),a.mult(Math.cos(t)*Math.sin(r)),s.mult(Math.sin(t)*Math.sin(r)),o.set(n).add(a).add(s),this.eyeX=i*o.x+this.centerX,this.eyeY=i*o.y+this.centerY,this.eyeZ=i*o.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.hypot(o,n,s),o=new _.default.Vector(o,n,s).normalize(),n=new _.default.Vector(this.upX,this.upY,this.upZ),s=new _.default.Vector.cross(n,o).normalize(),a=new _.default.Vector.cross(o,s),l=Math.atan2(t,e),l=(a.mult(Math.sin(l)),s.mult(Math.cos(l)).add(a),Math.sqrt(e*e+t*t)),a=new _.default.Vector.cross(o,s),e=((i=(i*=Math.pow(10,r))this.cameraFar&&(i=this.cameraFar),Math.cos(l)),t=Math.sin(l),r=n.dot(o),l=n.dot(s),u=r*e+l*t,r=-r*t+l*e,l=n.dot(a);n.x=u*o.x+r*s.x+l*a.x,n.y=u*o.y+r*s.y+l*a.y,n.z=u*o.z+r*s.z+l*a.z,s.mult(-t),o.mult(e).add(s).mult(i),this.camera(o.x+this.centerX,o.y+this.centerY,o.z+this.centerZ,this.centerX,this.centerY,this.centerZ,n.x,n.y,n.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&n(e.prototype,r),o&&n(e,o),t}(),_.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};e=_.default.Camera;r.default=e},{"../core/main":275,"core-js/modules/es.array.slice":165,"core-js/modules/es.math.hypot":170,"core-js/modules/es.string.sub":200}],325:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t){for(var r=0;r=this.width||t>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1)),(0,p.readPixelWebGL)(this.gl,this.framebuffer,e*this.density,t*this.density,n.format,n.type);e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1),r=this.target.constrain(r,1,this.width-e),o=this.target.constrain(o,1,this.height-t);for(var s=(0,p.readPixelsWebGL)(void 0,this.gl,this.framebuffer,e*this.density,t*this.density,r*this.density,o*this.density,n.format,n.type),i=new Uint8ClampedArray(r*o*this.density*this.density*4),a=(i.fill(255),n.type===this.gl.RGB?3:4),l=0;lthis.vertices.length-1-this.detailX;o--)e.add(this.vertexNormals[o]);e=a.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this}},{key:"_makeTriangleEdges",value:function(){for(var e=this.edges.length=0;e 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},a.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),this._applyColorBlend(this.curStrokeColor),r.drawArrays(r.Points,0,e.length),o.unbindShader()};var s=a.default.RendererGL;r.default=s},{"../core/constants":264,"../core/main":275,"./p5.RenderBuffer":329,"./p5.RendererGL":332,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.some":166,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.typed-array.copy-within":205,"core-js/modules/es.typed-array.every":206,"core-js/modules/es.typed-array.fill":207,"core-js/modules/es.typed-array.filter":208,"core-js/modules/es.typed-array.find":210,"core-js/modules/es.typed-array.find-index":209,"core-js/modules/es.typed-array.float32-array":211,"core-js/modules/es.typed-array.for-each":213,"core-js/modules/es.typed-array.includes":214,"core-js/modules/es.typed-array.index-of":215,"core-js/modules/es.typed-array.iterator":218,"core-js/modules/es.typed-array.join":219,"core-js/modules/es.typed-array.last-index-of":220,"core-js/modules/es.typed-array.map":221,"core-js/modules/es.typed-array.reduce":223,"core-js/modules/es.typed-array.reduce-right":222,"core-js/modules/es.typed-array.reverse":224,"core-js/modules/es.typed-array.set":225,"core-js/modules/es.typed-array.slice":226,"core-js/modules/es.typed-array.some":227,"core-js/modules/es.typed-array.sort":228,"core-js/modules/es.typed-array.subarray":229,"core-js/modules/es.typed-array.to-locale-string":230,"core-js/modules/es.typed-array.to-string":231,"core-js/modules/es.typed-array.uint16-array":232,"core-js/modules/es.typed-array.uint32-array":233,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],332:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.readPixelsWebGL=M,r.readPixelWebGL=k,r.default=void 0;var g=n(e("../core/main")),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),l=n(e("./GeometryBuilder")),u=n(e("libtess"));e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("./p5.Framebuffer"),e("path");function c(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,c=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n",lineVert:w+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump float;\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nattribute vec4 aPosition;\nattribute vec3 aTangentIn;\nattribute vec3 aTangentOut;\nattribute float aSide;\nattribute vec4 aVertexColor;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.) * curPerspScale,\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.) * curPerspScale,\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * curPerspScale * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * curPerspScale * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5 * curPerspScale;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset / curPerspScale;\n\n gl_Position.xy = p.xy + offset.xy;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:w+"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n"},E=(b(e={},a.GRAY,"precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n"),b(e,a.ERODE,"// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),b(e,a.DILATE,"// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),b(e,a.BLUR,"precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n"),b(e,a.POSTERIZE,"// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb, color.a);\n}\n"),b(e,a.OPAQUE,"// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb, 1.0);\n}\n"),b(e,a.INVERT,"// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n vec3 invertedColor = 1.0 - color.rgb;\n gl_FragColor = vec4(invertedColor, color.a);\n}\n"),b(e,a.THRESHOLD,"// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite), color.a);\n}\n"),e);function M(e,t,r,o,n,s,i,a,l,u){var c=t.getParameter(t.FRAMEBUFFER_BINDING),r=(t.bindFramebuffer(t.FRAMEBUFFER,r),a===t.RGBA?4:3),d=s*i*r,h=l===t.UNSIGNED_BYTE?Uint8Array:Float32Array;if(e instanceof h&&e.length===d||(e=new h(d)),t.readPixels(o,u?u-n-i:n,s,i,a,l,e),t.bindFramebuffer(t.FRAMEBUFFER,c),u)for(var f=Math.floor(i/2),p=new h(s*r),m=0;m>7,127&d,c>>7,127&c);for(var h=0;h>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}]),t}();B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=E.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new M(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var h,f=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(h=f.next()).done);d=!0)h.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==f.return||f.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var j,_=y[Symbol.iterator]();!(g=(j=_.next()).done);g=!0){var x,w,S=j.value,T=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));T.uGlyphRect&&(x=T.rowInfo,w=T.colInfo,u.setUniform("uSamplerStrokes",T.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",T.uGridOffset),u.setUniform("uGlyphRect",T.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":264,"../core/main":275,"./p5.RendererGL.Retained":331,"./p5.Shader":333,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.string.sub":200,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}]},{},[259])(259)}); \ No newline at end of file +/*! p5.js v1.9.0 November 28, 2023 */ +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n>>1;case"base64":return E(e).length;default:if(n)return o?-1:M(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function T(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var h=o,f=h.length;if(f<=v)return String.fromCharCode.apply(String,h);for(var p="",m=0;mt&&(e+=" ... "),""},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(C(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,h=r,f=(d=Number(d)||0,u.length-d);(!h||f<(h=Number(h)))&&(h=f),(f=c.length)/2e.length)throw new RangeError("Index out of range")}function j(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function E(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function O(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,A("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:246}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":148}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(M,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,j=g&&p(g),_=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),T=s&&!!m&&"Opera"!==c(a.opera),e=!1,M={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in M)a[n]||(T=!1);if((!T||"function"!=typeof j||j===Function.prototype)&&(j=function(){throw TypeError("Incorrect invocation")},T))for(n in M)a[n]&&m(a[n],j);if((!T||!_||_===x)&&(_=j.prototype,T))for(n in M)a[n]&&m(a[n].prototype,_);if(T&&p(b)!==_&&m(b,_),i&&!u(_,y))for(n in e=!0,f(_,y,{get:function(){return l(this)?this[S]:void 0}}),M)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(j,e))return e}else for(var t in M)if(u(M,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in M){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}_[e]&&!r||h(_,e,!r&&T&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in M)(n=a[o])&&u(n,e)&&delete n[e];if(j[e]&&!r)return;try{return h(j,e,!r&&T&&g[e]||t)}catch(e){}}for(o in M)!(n=a[o])||n[e]&&!r||h(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(M,e)},isTypedArray:o,TypedArray:j,TypedArrayPrototype:_}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":145,"../internals/well-known-symbol":148}],13:[function(e,t,D){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return O(e,23,4)}function F(e){return O(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;uR;)(A=L[R++])in M||N(M,A,T[A]);c.constructor=M}g&&V(e)!==k&&g(e,k);var y=new E(new M(2)),I=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||h(e,{setInt8:function(e,t){I.call(this,e,t<<24>>24)},setUint8:function(e,t){I.call(this,e,t<<24>>24)}},{unsafe:!0})}else M=function(e){p(this,M,_);e=m(e);j(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},E=function(e,t,r){p(this,E,x),p(e,M,x);var o=b(e).byteLength,t=B(t);if(t<0||o>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1>16},getUint16:function(e){e=l(this,2,e,1>>0},getFloat32:function(e){return P(l(this,4,e,1"+e+""}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":140}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),j=e("../internals/set-to-string-tag"),_=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/iterators"),e=e("../internals/iterators-core"),T=e.IteratorPrototype,M=e.BUGGY_SAFARI_ITERATORS,E=o("iterator"),k="values",C="entries";t.exports=function(e,t,r,o,n,s,i){g(r,t,o);function a(e){if(e===n&&f)return f;if(!M&&e in d)return d[e];switch(e){case"keys":case k:case C:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,u,o=t+" Iterator",c=!1,d=e.prototype,h=d[E]||d["@@iterator"]||n&&d[n],f=!M&&h||a(n),p="Array"==t&&d.entries||h;if(p&&(p=v(p.call(new e)),T!==Object.prototype&&p.next&&(w||v(p)===T||(b?b(p,T):"function"!=typeof p[E]&&_(p,E,m)),j(p,o,!0,!0),w&&(S[o]=m))),n==k&&h&&h.name!==k&&(c=!0,f=function(){return h.call(this)}),w&&!i||d[E]===f||_(d,E,f),S[t]=f,n)if(l={values:a(k),keys:s?f:a("keys"),entries:a(C)},i)for(u in l)!M&&!c&&u in d||x(d,u,l[u]);else y({target:t,proto:!0,forced:M||c},l);return l}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":148}],42:[function(e,t,r){var o=e("../internals/path"),n=e("../internals/has"),s=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});n(t,e)||i(t,e,{value:s.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":147}],43:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/is-object"),n=o.document,s=e(n)&&e(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,n,s=e("../internals/global"),e=e("../internals/engine-user-agent"),s=s.process,s=s&&s.versions,s=s&&s.v8;s?n=(o=s.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(n=o[1]),t.exports=n&&+n},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var u=e("../internals/global"),c=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/set-global"),p=e("../internals/copy-constructor-properties"),m=e("../internals/is-forced");t.exports=function(e,t){var r,o,n,s=e.target,i=e.global,a=e.stat,l=i?u:a?u[s]||f(s,{}):(u[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.noTargetGet?(n=c(l,r))&&n.value:l[r],!m(i?r:s+(a?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;p(o,n)}(e.sham||n&&n.sham)&&d(o,"sham",!0),h(l,r,o,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var u=e("../internals/redefine"),c=e("../internals/fails"),d=e("../internals/well-known-symbol"),h=e("../internals/regexp-exec"),f=e("../internals/create-non-enumerable-property"),p=d("species"),m=!c(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),y="$0"==="a".replace(/./,"$0"),e=d("replace"),g=!!/./[e]&&""===/./[e]("a","$0"),v=!c(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(r,e,t,o){var s,n,i=d(r),a=!c(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),l=a&&!c(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[p]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});a&&l&&("replace"!==r||m&&y&&!g)&&("split"!==r||v)||(s=/./[i],t=(l=t(i,""[r],function(e,t,r,o,n){return t.exec===h?a&&!n?{done:!0,value:s.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}))[0],n=l[1],u(String.prototype,r,t),u(RegExp.prototype,i,2==e?function(e,t){return n.call(e,this,t)}:function(e){return n.call(e,this)})),o&&f(RegExp.prototype[i],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":148,"../modules/es.regexp.exec":187}],53:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(e,t,r){var s=e("../internals/a-function");t.exports=function(o,n,e){if(s(o),void 0===n)return o;switch(e){case 0:return function(){return o.call(n)};case 1:return function(e){return o.call(n,e)};case 2:return function(e,t){return o.call(n,e,t)};case 3:return function(e,t,r){return o.call(n,e,t,r)}}return function(){return o.apply(n,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){"use strict";var o=e("../internals/a-function"),n=e("../internals/is-object"),c=[].slice,d={};t.exports=Function.bind||function(i){var a=o(this),l=c.call(arguments,1),u=function(){var e=l.concat(c.call(arguments));if(this instanceof u){var t=a,r=e.length,o=e;if(!(r in d)){for(var n=[],s=0;s>1,u=23===t?f(2,-24)-f(2,-77):0,c=e<0||0===e&&1/e<0?1:0,d=0;for((e=h(e))!=e||e===1/0?(n=e!=e?1:0,o=r):(o=p(m(e)/y),e*(s=f(2,-o))<1&&(o--,s*=2),2<=(e+=1<=o+l?u/s:u*f(2,1-l))*s&&(o++,s/=2),r<=o+l?(n=0,o=r):1<=o+l?(n=(e*s-1)*f(2,t),o+=l):(n=e*f(2,l-1)*f(2,t),o=0));8<=t;i[d++]=255&n,n/=256,t-=8);for(o=o<>1,a=n-7,l=o-1,n=e[l--],u=127&n;for(n>>=7;0>=-a,a+=t;0"+e+""},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=n?((e=n).write(p("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=c("iframe"),t="java"+h+":",e.style.display="none",u.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[f]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=s(e),r=new o,o[d]=null,r[f]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),l=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){a(e);for(var r,o=l(t),n=o.length,s=0;sn;)!i(o,r=t[n++])||~l(s,r)||s.push(r);return s}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":134}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){"use strict";var o={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!o.call({1:2},1);r.f=s?function(e){e=n(this,e);return!!e&&e.enumerable}:o},{}],101:[function(e,t,r){var n=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return n(e),s(t),o?r.call(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){"use strict";var o=e("../internals/to-string-tag-support"),n=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+n(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":141}],103:[function(e,t,r){var o=e("../internals/get-built-in"),n=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=n.f(i(e)),r=s.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global");t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/is-object"),s=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),n(t)&&t.constructor===e?t:((0,(e=s.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var i=e("../internals/global"),a=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),u=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),n=e.get,c=e.enforce,d=String(String).split("String");(t.exports=function(e,t,r,o){var n=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,o=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||l(r,"name")||a(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e===i?s?e[t]=r:u(t,r):(n?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=r:a(e,t,r))})(Function.prototype,"toString",function(){return"function"==typeof this&&n(this).source||o(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),n=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){r=r.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return n.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){"use strict";var o,n,d=e("./regexp-flags"),e=e("./regexp-sticky-helpers"),h=RegExp.prototype.exec,f=String.prototype.replace,s=h,p=(o=/a/,n=/b*/g,h.call(o,"a"),h.call(n,"a"),0!==o.lastIndex||0!==n.lastIndex),m=e.UNSUPPORTED_Y||e.BROKEN_CARET,y=void 0!==/()??/.exec("")[1];t.exports=s=p||y||m?function(e){var t,r,o,n,s=this,i=m&&s.sticky,a=d.call(s),l=s.source,u=0,c=e;return i&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),c=String(e).slice(s.lastIndex),0t&&(o=o.slice(0,t)),n?e+o:o+e)}}var s=e("../internals/to-length"),i=e("../internals/string-repeat"),a=e("../internals/require-object-coercible"),l=Math.ceil;t.exports={start:o(!1),end:o(!0)}},{"../internals/require-object-coercible":113,"../internals/string-repeat":127,"../internals/to-length":136}],126:[function(e,t,r){"use strict";function g(e){return e+22+75*(e<26)}function s(e){var t,r=[],o=(e=function(e){for(var t=[],r=0,o=e.length;rT((v-s)/d))throw RangeError(w);for(s+=(u-n)*d,n=u,c=0;cv)throw RangeError(w);if(t==n){for(var h=s,f=b;;f+=b){var p=f<=i?1:i+j<=f?j:f-i;if(h>1,e+=T(e/t);S*j>>1>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":135}],128:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/whitespaces");t.exports=function(e){return o(function(){return!!n[e]()||"​…᠎"!="​…᠎"[e]()||n[e].name!==e})}},{"../internals/fails":51,"../internals/whitespaces":149}],129:[function(e,t,r){function o(t){return function(e){e=String(n(e));return 1&t&&(e=e.replace(s,"")),e=2&t?e.replace(i,""):e}}var n=e("../internals/require-object-coercible"),e="["+e("../internals/whitespaces")+"]",s=RegExp("^"+e+e+"*"),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":149}],130:[function(e,t,r){function o(e){return function(){x(e)}}function n(e){x(e.data)}function s(e){a.postMessage(e+"",f.protocol+"//"+f.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),u=e("../internals/classof-raw"),c=e("../internals/function-bind-context"),d=e("../internals/html"),h=e("../internals/document-create-element"),e=e("../internals/engine-is-ios"),f=a.location,p=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,j={},_="onreadystatechange",x=function(e){var t;j.hasOwnProperty(e)&&(t=j[e],delete j[e],t())};p&&m||(p=function(e){for(var t=[],r=1;r=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":134}],162:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),i=[].join,n=n!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:n||!e},{join:function(e){return i.call(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":134}],163:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/array-last-index-of");o({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],164:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").map,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("map"),e=e("map");o({target:"Array",proto:!0,forced:!s||!e},{map:function(e){return n(this,e,1T;T++)l(b,x=S[T])&&!l(w,x)&&y(w,x,m(b,x));(w.prototype=j).constructor=w,a(s,v,w)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":129,"../internals/to-primitive":140}],174:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],175:[function(e,t,r){"use strict";function c(e,t,r){return 0===t?r:t%2==1?c(e,t-1,r*e):c(e*e,t/2,r)}var o=e("../internals/export"),d=e("../internals/to-integer"),h=e("../internals/this-number-value"),f=e("../internals/string-repeat"),e=e("../internals/fails"),n=1..toFixed,p=Math.floor;o({target:"Number",proto:!0,forced:n&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!e(function(){n.call({})})},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*a[r],a[r]=o%1e7,o=p(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=a[t],a[t]=p(r/e),r=r%e*1e7}function o(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===a[t]||(e=String(a[t]),r=""===r?e:r+f.call("0",7-e.length)+e);return r}var n,s,i=h(this),e=d(e),a=[0,0,0,0,0,0],l="",u="0";if(e<0||20n;){var s,i,a,l=y[n++],u=t?l.ok:l.fail,c=l.resolve,d=l.reject,h=l.domain;try{u?(t||(p.rejection===oe&&function(e,t){v.call(g,function(){if(k)T.emit("rejectionHandled",e);else se(te,e,t.value)})}(f,p),p.rejection=P),!0===u?s=e:(h&&h.enter(),s=u(e),h&&(h.exit(),a=!0)),s===l.promise?d(w("Promise-chain cycle")):(i=ne(s))?i.call(s,c,d):c(s)):d(e)}catch(e){h&&!a&&h.exit(),d(e)}}p.reactions=[],p.notified=!1,m&&!p.rejection&&(r=f,o=p,v.call(g,function(){var e=o.value,t=ie(o);if(t&&(t=b(function(){k?T.emit("unhandledRejection",e,r):se(C,r,e)}),o.rejection=k||ie(o)?oe:P,t.error))throw t.value}))}))},se=function(e,t,r){var o;ee?((o=S.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),g.dispatchEvent(o)):o={promise:t,reason:r},(t=g["on"+e])?t(o):e===C&&Y("Unhandled promise rejection",r)},ie=function(e){return e.rejection!==P&&!e.parent},L=function(t,r,o,n){return function(e){t(r,o,e,n)}},R=function(e,t,r,o){t.done||(t.done=!0,(t=o?o:t).value=r,t.state=re,A(e,t,!0))},I=function(r,o,e,t){if(!o.done){o.done=!0,t&&(o=t);try{if(r===e)throw w("Promise can't be resolved itself");var n=ne(e);n?u(function(){var t={done:!1};try{n.call(e,L(I,r,t,o),L(R,r,t,o))}catch(e){R(r,t,e,o)}}):(o.value=e,o.state=O,A(r,o,!1))}catch(e){R(r,{done:!1},e,o)}}};e&&(x=function(e){z(this,x,j),c(e),r.call(this);var t=_(this);try{e(L(I,this,t),L(R,this,t))}catch(e){R(this,t,e)}},(r=function(e){J(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=N(x.prototype,{then:function(e,t){var r=K(this),o=E(X(this,x));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=k?T.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&A(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),t=function(){var e=new r,t=_(e);this.promise=e,this.resolve=L(I,e,t),this.reject=L(R,e,t)},f.f=E=function(e){return e===x||e===o?new t:$(e)},i||"function"!=typeof l||(n=l.prototype.then,U(l.prototype,"then",function(e,t){var r=this;return new x(function(e,t){n.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof M&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return h(x,M.apply(g,arguments))}}))),s({global:!0,wrap:!0,forced:e},{Promise:x}),B(x,j,!1,!0),G(j),o=a(j),s({target:j,stat:!0,forced:e},{reject:function(e){var t=E(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:i||e},{resolve:function(e){return h(i&&this===o?x:this,e)}}),s({target:j,stat:!0,forced:m},{all:function(e){var a=this,t=E(a),l=t.resolve,u=t.reject,r=b(function(){var o=c(a.resolve),n=[],s=0,i=1;d(e,function(e){var t=s++,r=!1;n.push(void 0),i++,o.call(a,e).then(function(e){r||(r=!0,n[t]=e,--i||l(n))},u)}),--i||l(n)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,o=E(r),n=o.reject,t=b(function(){var t=c(r.resolve);d(e,function(e){t.call(r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":130,"../internals/well-known-symbol":148}],184:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/get-built-in"),s=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),c=n("Reflect","construct"),d=e(function(){function e(){}return!(c(function(){},[],e)instanceof e)}),h=!e(function(){c(function(){})}),n=d||h;o({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(e,t){s(e),i(t);var r=arguments.length<3?e:s(arguments[2]);if(h&&!d)return c(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(u.apply(e,o))}o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t);return a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],185:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/is-object"),i=e("../internals/an-object"),a=e("../internals/has"),l=e("../internals/object-get-own-property-descriptor"),u=e("../internals/object-get-prototype-of");o({target:"Reflect",stat:!0},{get:function e(t,r){var o,n=arguments.length<3?t:arguments[2];return i(t)===n?t[r]:(o=l.f(t,r))?a(o,"value")?o.value:void 0===o.get?void 0:o.get.call(n):s(o=u(t))?e(o,r,n):void 0}})},{"../internals/an-object":10,"../internals/export":50,"../internals/has":60,"../internals/is-object":74,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-prototype-of":97}],186:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/global"),s=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,u=e("../internals/is-regexp"),c=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),h=e("../internals/redefine"),f=e("../internals/fails"),p=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=n.RegExp,v=g.prototype,b=/a/g,j=/a/g,_=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&s("RegExp",!_||x||f(function(){return j[y]=!1,g(b)!=b||g(j)==j||"/a/i"!=g(b,"i")}))){for(var w=function(e,t){var r,o=this instanceof w,n=u(e),s=void 0===t;if(!o&&n&&e.constructor===w&&s)return e;_?n&&!s&&(e=e.source):e instanceof w&&(s&&(t=c.call(e)),e=e.source),x&&(r=!!t&&-1T;)!function(t){t in w||a(w,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})}(S[T++]);(v.constructor=w).prototype=v,h(n,"RegExp",w)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":148}],187:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],188:[function(e,t,r){"use strict";var o=e("../internals/redefine"),n=e("../internals/an-object"),s=e("../internals/fails"),i=e("../internals/regexp-flags"),e="toString",a=RegExp.prototype,l=a[e],s=s(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),u=l.name!=e;(s||u)&&o(RegExp.prototype,e,function(){var e=n(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],189:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],190:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),e=e("../internals/is-pure"),u="".endsWith,c=Math.min,l=l("endsWith");o({target:"String",proto:!0,forced:!!(e||l||(!(o=n(String.prototype,"endsWith"))||o.writable))&&!l},{endsWith:function(e){var t=String(a(this)),r=(i(e),1=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],193:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/an-object"),d=e("../internals/to-length"),n=e("../internals/require-object-coercible"),h=e("../internals/advance-string-index"),f=e("../internals/regexp-exec-abstract");o("match",1,function(o,l,u){return[function(e){var t=n(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=u(l,e,this);if(t.done)return t.value;var r=c(e),o=String(this);if(!r.global)return f(r,o);for(var n=r.unicode,s=[],i=r.lastIndex=0;null!==(a=f(r,o));){var a=String(a[0]);""===(s[i]=a)&&(r.lastIndex=h(o,d(r.lastIndex),n)),i++}return 0===i?null:s}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":136}],194:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/string-pad").start;o({target:"String",proto:!0,forced:e("../internals/string-pad-webkit-bug")},{padStart:function(e){return n(this,e,1]*>)/g,I=/\$([$&'`]|\d\d?)/g;o("replace",2,function(n,j,_,e){var x=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=e.REPLACE_KEEPS_$0,S=x?"$":"$0";return[function(e,t){var r=s(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):j.call(String(r),e,t)},function(e,t){if(!x&&w||"string"==typeof t&&-1===t.indexOf(S)){var r=_(j,e,this,t);if(r.done)return r.value}for(var o,n=T(e),s=String(this),i="function"==typeof t,a=(i||(t=String(t)),n.global),l=(a&&(o=n.unicode,n.lastIndex=0),[]);null!==(f=O(n,s))&&(l.push(f),a);)""===String(f[0])&&(n.lastIndex=C(s,E(n.lastIndex),o));for(var u,c="",d=0,h=0;h>>0;if(0==o)return[];if(void 0===e)return[r];if(!c(e))return p.call(r,e,o);for(var n,s,i,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=new RegExp(e.source,t+"g");(n=h.call(u,r))&&!(l<(s=u.lastIndex)&&(a.push(r.slice(l,n.index)),1=o));)u.lastIndex===n.index&&u.lastIndex++;return l===r.length?!i&&u.test("")||a.push(""):a.push(r.slice(l)),a.length>o?a.slice(0,o):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)}:p;return[function(e,t){var r=d(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):y.call(String(r),e,t)},function(e,t){var r=m(y,e,this,t,y!==p);if(r.done)return r.value;var r=g(e),o=String(this),e=v(r,RegExp),n=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"y":"g"),i=new e(S?r:"^(?:"+r.source+")",s),a=void 0===t?w:t>>>0;if(0==a)return[];if(0===o.length)return null===_(i,o)?[o]:[];for(var l=0,u=0,c=[];ue.key){o.splice(t,0,e);break}t===s&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=P(this).entries,o=v(e,16)return;a=0;while(h()){l=null;if(a>0)if(h()=="."&&a<4)n++;else return;if(!x.test(h()))return;while(x.test(h())){u=parseInt(h(),10);if(l===null)l=u;else if(l==0)return;else l=l*10+u;if(l>255)return;n++}t[r]=t[r]*256+l;a++;if(a==2||a==4)r++}if(a!=4)return;break}else if(h()==":"){n++;if(!h())return}else if(h())return;t[r++]=s}if(o!==null){c=r-o;r=7;while(r!=0&&c>0){d=t[r];t[r--]=t[o+c-1];t[o+--c]=d}}else if(r!=8)return;return t}(t.slice(1,-1)))?void(e.host=r):_;if(k(e))return t=z(t),ne.test(t)||null===(r=function(e){var t=e.split("."),r,o,n,s,i,a,l;if(t.length&&t[t.length-1]=="")t.pop();if((r=t.length)>4)return e;for(o=[],n=0;n1&&s.charAt(0)=="0"){i=ee.test(s)?16:8;s=s.slice(i==8?1:2)}if(s==="")a=0;else{if(!(i==10?re:i==8?te:oe).test(s))return e;a=parseInt(s,i)}o.push(a)}for(n=0;n=Z(256,5-r))return null}else if(a>255)return null}for(l=o.pop(),n=0;n":1,"`":1}),ce=d({},ue,{"#":1,"?":1,"{":1,"}":1}),T=d({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),M=function(e,t){var r=V(e,0);return 32h,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,c=l>>16&255,d=l>>8&255,l=255&l,h=P(l,d,c,u),h=h in a?a[h]:a[h]=function(t,r,o,n,s){let i=0,a=1e100;for(let e=0;ea||(l=u[0],(c+=v(l-t))>a||(l=u[1],(c+=v(l-r))>a||(l=u[2],(c+=v(l-o))>a||(a=c,i=e))))}return i}(l,d,c,u,t);i[e]=h}else{const g="rgb444"===r?A:O;for(let e=0;e>16&255,m=f>>8&255,f=255&f,y=g(f,m,p),y=y in a?a[y]:a[y]=function(t,r,o,n){let s=0,i=1e100;for(let e=0;ei||(a=l[1],(u+=v(a-r))>i||(a=l[2],(u+=v(a-o))>i||(i=u,s=e)))}return s}(f,m,p,t);i[e]=y}}return i},default:()=>f,nearestColor:()=>function(e,t,r=u){return e[l(e,t,r)]},nearestColorIndex:()=>l,nearestColorIndexWithDistance:()=>d,prequantize:()=>function(e,{roundRGB:r=5,roundAlpha:o=10,oneBitAlpha:n=null}={}){const s=new Uint32Array(e.buffer);for(let t=0;t>24&255;var a,l=i>>16&255,u=i>>8&255,i=255&i;e=c(e,o),n&&(a="number"==typeof n?n:127,e=e<=a?0:255),i=c(i,r),u=c(u,r),l=c(l,r),s[t]=e<<24|l<<16|u<<8|i<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:n=!0,clearAlphaColor:s=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const u="rgba4444"===o,c=function(r,e){const t="rgb444"===e?4096:65536,o=new Array(t),n=r.length;if("rgba4444"===e)for(let t=0;t>24&255,a=s>>16&255,l=s>>8&255,s=255&s,u=P(s,l,a,i);let e=u in o?o[u]:o[u]=D();e.rc+=s,e.gc+=l,e.bc+=a,e.ac+=i,e.cnt++}else if("rgb444"===e)for(let t=0;t>16&255,h=c>>8&255,c=255&c,f=A(c,h,d);let e=f in o?o[f]:o[f]=D();e.rc+=c,e.gc+=h,e.bc+=d,e.cnt++}else for(let t=0;t>16&255,y=p>>8&255,p=255&p,g=O(p,y,m);let e=g in o?o[g]:o[g]=D();e.rc+=p,e.gc+=y,e.bc+=m,e.cnt++}return o}(e,o),d=c.length,h=d-1,f=new Uint32Array(d+1);for(var p=0,m=0;m>1,!(c[y=f[v]].err<=b));g=v)f[g]=y;f[g]=m}var j,_=p-t;for(m=0;m<_;){for(;;){var x=f[1];if((j=c[x]).tm>=j.mtm&&c[j.nn].mtm<=j.tm)break;j.mtm==h?x=f[1]=f[f[0]--]:(I(c,x,!1),j.tm=m);b=c[x].err;for(g=1;(v=g+g)<=f[0]&&(vc[f[v+1]].err&&v++,!(b<=c[y=f[v]].err));g=v)f[g]=y;f[g]=x}var w=c[j.nn],S=j.cnt,T=w.cnt,M=1/(S+T);u&&(j.ac=M*(S*j.ac+T*w.ac)),j.rc=M*(S*j.rc+T*w.rc),j.gc=M*(S*j.gc+T*w.gc),j.bc=M*(S*j.bc+T*w.bc),j.cnt+=w.cnt,j.mtm=++m,c[w.bk].fw=w.fw,c[w.fw].bk=w.bk,w.mtm=h}let E=[];for(m=0;;0){let e=L(Math.round(c[m].rc),0,255),t=L(Math.round(c[m].gc),0,255),r=L(Math.round(c[m].bc),0,255),o=255;u&&(o=L(Math.round(c[m].ac),0,255),a&&(k="number"==typeof a?a:127,o=o<=k?0:255),n&&o<=i&&(e=t=r=s,o=0));var k=u?[e,t,r,o]:[e,t,r];if(function(t,r){for(let e=0;efunction(r,o,e=5){if(r.length&&o.length){var n=r.map(e=>e.slice(0,3)),s=e*e,i=r[0].length;for(let t=0;ti?e.slice(0,3):e.slice();var a=d(n,e.slice(0,3),u),l=a[0],a=a[1];0>>0),0!=t&&(e=Math.max(e,256));const r=s;s=new Uint8Array(e),0>=8,c-=8;if((v>m||f)&&(f?(p=h,m=(1<>=8,c-=8;0>3}function P(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function A(e,t,r){return e>>4<<8|240&t|r>>4}function L(e,t,r){return e>8&255)}function C(e,t){for(var r=0;r>1,c=-7,d=r?n-1:0,h=r?-1:1,n=e[t+d];for(d+=h,s=n&(1<<-c)-1,n>>=-c,c+=a;0>=-c,c+=o;0>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:s-1,f=o?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+c?d/o:d*Math.pow(2,1-c))*o&&(i++,o/=2),u<=i+c?(a=0,i=u):1<=i+c?(a=(t*o-1)*Math.pow(2,n),i+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),i=0));8<=n;e[r+h]=255&a,h+=f,a/=256,n-=8);for(i=i<Math.abs(e[0])&&(t=1),t=Math.abs(e[2])>Math.abs(e[t])?2:t}function E(e,t){e.f+=t.f,e.b.f+=t.b.f}function h(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 k(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function C(e,t){m(e.a),e.c=!1,(e.a=t).i=e}function O(e){for(var t=e.a.a;(e=G(e)).a.a===t;);return e.c&&(C(e,t=S(B(e).a.b,e.a.e)),e=G(e)),e}function q(e,t,r){var o=new N;return o.a=r,o.e=p(e.f,t.e,o),r.i=o}function X(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],a[i[u]])?U:ue)(r,u),a[s]=null,l[s]=r.b,r.b=s}else for(r.c[-(s+1)]=null;0Math.max(i.a,l.a))){if(g(s,i)){if(0r.f&&(r.f*=2,r.c=ae(r.c,r.f+1)),0===r.b?n=o:(n=r.b,r.b=r.c[r.b]),r.e[n]=t,r.c[n]=o,r.d[o]=n,r.h&&ue(r,o),n):(r=e.a++,e.c[r]=t,-(r+1))}function se(e){if(0===e.a)return le(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(F(e.b),t))return le(e.b);for(;--e.a,0e.a||g(o[i],o[l])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function ue(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s>>1,l=r[a];if(0==a||g(o[l],o[i])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function N(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function B(e){return e.e.c.b}function G(e){return e.e.a.b}(t=r.prototype).x=function(){I(this,0)},t.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 l(this,100900)}l(this,100901)},t.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:l(this,100900)}return!1},t.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},t.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:l(this,100900)}},t.C=function(e,t){var r=!1,o=[0,0,0];I(this,2);for(var n=0;n<3;++n){var s=e[n];s<-1e150&&(s=-1e150,r=!0),1e150o[u]&&(o[u]=c,n[u]=r)}if(o[1]-a[1]>o[r=0]-a[0]&&(r=1),a[r=o[2]-a[2]>o[r]-a[r]?2:r]>=o[r])i[0]=0,i[1]=0,i[2]=1;else{for(a=l[r],n=n[r],l=[o=0,0,0],a=[a.g[0]-n.g[0],a.g[1]-n.g[1],a.g[2]-n.g[2]],u=[0,0,0],r=s.e;r!==s;r=r.e)u[0]=r.g[0]-n.g[0],u[1]=r.g[1]-n.g[1],u[2]=r.g[2]-n.g[2],l[0]=a[1]*u[2]-a[2]*u[1],l[1]=a[2]*u[0]-a[0]*u[2],l[2]=a[0]*u[1]-a[1]*u[0],o<(c=l[0]*l[0]+l[1]*l[1]+l[2]*l[2])&&(o=c,i[0]=l[0],i[1]=l[1],i[2]=l[2]);o<=0&&(i[0]=i[1]=i[2]=0,i[W(a)]=1)}s=!0}for(l=W(i),r=this.b.c,o=(l+1)%3,n=(l+2)%3,l=0>=1;)++n;if(i=1<>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|n,g[v++]=s,g[v++]=0,null!==b)for(var a=0,l=b.length;a>16&255,g[v++]=u>>8&255,g[v++]=255&u}if(null!==o){if(o<0||65535>8&255,g[v++]=0}var _=!1;this.addFrame=function(e,t,r,o,n,s){if(!0===_&&(--v,_=!1),s=void 0===s?{}:s,e<0||t<0||65535>=1;)++u;var l=1<>8&255,g[v++]=f,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&o,g[v++]=o>>8&255,g[v++]=!0===i?128|u-1:0,!0===i)for(var p=0,m=a.length;p>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,o){t[r++]=e;var n=r++,s=1<>=8,c-=8,r===n+256&&(t[n]=255,n=r++)}function f(e){d|=e<>=8,c-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(f(s),l=1+a,u=e+1,m={}):(1<>=l,c-=l,y==s)a=1+i,u=(1<<(l=n+1))-1,m=null;else{if(y==i)break;for(var g=y>8,++v;var j=b;if(o>=8;null!==m&&a<4096&&(p[a++]=m<<8|j,u+1<=a&&l<12&&(++l,u=u<<1|1)),m=y}}h!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=o,r.GifReader=function(b){var e=0;if(71!==b[e++]||73!==b[e++]||70!==b[e++]||56!==b[e++]||56!=(b[e++]+1&253)||97!==b[e++])throw new Error("Invalid GIF 87a/89a header.");var j=b[e++]|b[e++]<<8,t=b[e++]|b[e++]<<8,r=b[e++],o=1<<1+(7&r),n=(b[e++],b[e++],null),s=null,i=(r>>7&&(n=e,e+=3*(s=o)),!0),a=[],l=0,u=null,c=0,d=null;for(this.width=j,this.height=t;i&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}break;default:throw new Error("Unknown graphic control label: 0x"+b[e-1].toString(16))}break;case 44:var f,p=b[e++]|b[e++]<<8,m=b[e++]|b[e++]<<8,y=b[e++]|b[e++]<<8,g=b[e++]|b[e++]<<8,v=b[e++],_=v>>6&1,x=1<<1+(7&v),w=n,S=s,T=!1,v=(v>>7&&(T=!0,w=e,e+=3*(S=x)),e);for(e++;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}a.push({x:p,y:m,width:y,height:g,has_local_palette:T,palette_offset:w,palette_size:S,data_offset:v,data_length:e-v,transparent_index:u,interlaced:!!_,delay:l,disposal:c});break;case 59:i=!1;break;default:throw new Error("Unknown gif block: 0x"+b[e-1].toString(16))}this.numFrames=function(){return a.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=a.length)throw new Error("Frame index out of range.");return a[e]},this.decodeAndBlitFrameBGRA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(M(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=v,t[d++]=g,t[d++]=y,t[d++]=255),--l}},this.decodeAndBlitFrameRGBA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(M(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=y,t[d++]=g,t[d++]=v,t[d++]=255),--l}}}}catch(e){}},{}],249:[function(Ar,r,o){!function(Pr){var e,t;e=this,t=function(j){"use strict";function D(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length,e=e?Number(e):0;if(!((e=e!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function $(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,r+=t.table[++n],0<=(o-=t.table[n]););return e.tag=s,e.bitcount-=n,t.trans[r+o]}function ee(e,t,r){for(;;){var o=$(e,t);if(256===o)return U;if(o<256)e.dest[e.destLen++]=o;else for(var n,s=b(e,H[o-=257],W[o]),o=$(e,r),i=n=e.destLen-b(e,q[o],X[o]);i>>=1,o=n,b(s,2,0)){case 0:r=function(e){for(var t,r;8this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,r,o,n,s,i,a){var l=[e,t],u=[r,o],c=[n,s],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var h=0;h<=1;h++){var f,p=6*l[h]-12*u[h]+6*c[h],m=-3*l[h]+9*u[h]-9*c[h]+3*d[h],y=3*u[h]-3*l[h];0==m?0==p||0<(f=-y/p)&&f<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],f)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],f))):(f=Math.pow(p,2)-4*y*m)<0||(0<(y=(-p+Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))),0<(y=(-p-Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))))}},a.prototype.addQuad=function(e,t,r,o,n,s){r=e+2/3*(r-e),o=t+2/3*(o-t);this.addBezier(e,t,r,o,r+1/3*(n-e),o+1/3*(s-t),n,s)},h.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},h.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},h.prototype.curveTo=h.prototype.bezierCurveTo=function(e,t,r,o,n,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:n,y:s})},h.prototype.quadTo=h.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},h.prototype.close=h.prototype.closePath=function(){this.commands.push({type:"Z"})},h.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof a)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},h.prototype.getBoundingBox=function(){for(var e=new a,t=0,r=0,o=0,n=0,s=0;s>8&255,255&e]},l.USHORT=r(2),w.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},l.SHORT=r(2),w.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},l.UINT24=r(3),w.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.ULONG=r(4),w.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},l.LONG=r(4),w.FIXED=w.ULONG,l.FIXED=l.ULONG,w.FWORD=w.SHORT,l.FWORD=l.SHORT,w.UFWORD=w.USHORT,l.UFWORD=l.USHORT,w.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},l.LONGDATETIME=r(8),w.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)]},l.TAG=r(4),w.Card8=w.BYTE,l.Card8=l.BYTE,w.Card16=w.USHORT,l.Card16=l.USHORT,w.OffSize=w.BYTE,l.OffSize=l.BYTE,w.SID=w.USHORT,l.SID=l.USHORT,w.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?w.NUMBER16(e):w.NUMBER32(e)},l.NUMBER=function(e){return w.NUMBER(e).length},w.NUMBER16=function(e){return[28,e>>8&255,255&e]},l.NUMBER16=r(3),w.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},l.NUMBER32=r(5),w.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),n=0,s=t.length;n>8&255,t[t.length]=255&o}return t},l.UTF16=function(e){return 2*e.length};var se,ie={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(m.MACSTRING=function(e,t,r,o){var n=ie[o];if(void 0!==n){for(var s="",i=0;i>8&255,l+256&255)}return s})(e,t,r);return r},w.INDEX=function(e){for(var t=1,r=[t],o=[],n=0;n>8,t[c+1]=255&d,t=t.concat(o[u])}return t},l.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o>1,a.skip("uShort",3),y.glyphIndexMap={};for(var j,_=new R.Parser(g,v+b+14),x=new R.Parser(g,v+b+16+2*j),w=new R.Parser(g,v+b+16+4*j),S=new R.Parser(g,v+b+16+6*j),T=v+b+16+8*j,M=0;M>4,s=15&s;if(15==i)break;if(o+=n[i],15==s)break;o+=n[s]}return parseFloat(o)}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 Ie(e,t,r){var o=new R.Parser(e,t=void 0!==t?t:0),n=[],s=[];for(r=void 0!==r?r:e.length;o.relativeOffset>1,M.length=0,k=!0}return function e(t){for(var r,o,n,s,i,a,l,u,c,d,h,f,p=0;pMath.abs(f-P)?O=h+M.shift():P=f+M.shift(),T.curveTo(v,b,j,_,l,u),T.curveTo(c,d,h,f,O,P);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+m),M.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:i=M.pop()+y.gsubrsBias,(a=y.gsubrs[i])&&e(a);break;case 30:for(;0=r.begin&&e=c.length&&(s=o.parseChar(),r.names.push(o.parseString(s)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;at.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(n),t}function xt(e,t,r){for(var o=0;o 123 are reserved for internal usage");f|=1<>>1,s=e[n].tag;if(s===t)return n;s>>1,s=e[n];if(s===t)return n;s>>1,i=(n=e[s]).start;if(i===t)return n;i(n=e[r-1]).end?0:n}function Et(e,t){this.font=e,this.tableName=t}function kt(e){Et.call(this,e,"gpos")}function i(e){Et.call(this,e,"gsub")}function Ct(e,t,r){for(var o=e.subtables,n=0;nt.points.length-1||o.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=n.points[o.matchedPoints[1]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0},a=Lt([a],o)[0];o.dx=i.x-a.x,o.dy=i.y-a.y,s=Lt(n.points,o)}t.points=t.points.concat(s)}}return Rt(t.points)}(kt.prototype=Et.prototype={searchTag:St,binSearch:Tt,getTable:function(e){var t=this.font.tables[this.tableName];return t=!t&&e?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=i[t-1].tag,"Features must be added in alphabetical order."),i.push(n={tag:r,feature:{params:0,lookupListIndexes:[]}}),s.push(t),n.feature}},getLookupTables:function(e,t,r,o,n){var e=this.getFeatureTable(e,t,r,n),s=[];if(e){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u",s),t.stack.push(Math.round(64*s))}function hr(e,t){var r=t.stack,o=r.pop(),n=t.fv,s=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;j.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,r);for(var c=0;c>4)===i&&(0<=(h=(15&h)-8)&&h++,j.DEBUG&&console.log(t.step,"DELTAPFIX",d,"by",h*l),d=u[d],n.setRelative(d,d,h*l,s))}}function fr(e,t){var r=t.stack,o=r.pop();j.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(o/64))}function pr(e,t){var r=t.stack,o=r.pop(),n=t.ppem,s=t.deltaBase+16*(e-1),i=t.deltaShift;j.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,r);for(var a=0;a>4)===n&&(0<=(u=(15&u)-8)&&u++,u=u*i,j.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",u),t.cvt[l]+=u)}}function mr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.dpv=qt(r,n)}function k(e,t){var r=t.stack,o=t.prog,n=t.ip;j.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var s=0;s":"_")+(o?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+a+")":"",l,"(d =",i,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",o),a.interpolate(d,s,i,l),a.touch(d)}e.loop=1},lr.bind(void 0,0),lr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,o=e.z0[r],n=e.loop,s=e.fv,i=e.pv,a=e.z1;n--;){var l=t.pop(),u=a[l];j.DEBUG&&console.log(e.step,(1'.concat(n,"").concat(t,""),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},s.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+i))?this.dummyDOM.querySelector("#"+o+l).insertAdjacentHTML("beforebegin",'

        ')):(r='

        '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(a)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+u))?this.dummyDOM.querySelector("#".concat(o+d))&&this.dummyDOM.querySelector("#".concat(o+d)).insertAdjacentHTML("beforebegin",'

        ')):(r='

        '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+c),this.descriptions.label.innerHTML=t)},s.default.prototype._describeElementHTML=function(e,t,r){var o,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+l)||this.dummyDOM.querySelector("#"+n+a).insertAdjacentHTML("afterend",'
        Canvas elements and their descriptions
        ')):(o='
        Canvas elements and their descriptions
        '),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).innerHTML=o),(o=document.createElement("tr")).id=n+"_fte_"+t,this.dummyDOM.querySelector("#"+n+l).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+u))?this.dummyDOM.querySelector("#".concat(n+d))||this.dummyDOM.querySelector("#"+n+c).insertAdjacentHTML("afterend",'
        ')):(o='
        '),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=n+"_lte_"+t,this.dummyDOM.querySelector("#"+n+d).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)};e=s.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.ends-with":190,"core-js/modules/es.string.replace":196}],256:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateGridOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]);t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1]);return t}((r=function(e,t){var r,o="",n="",s=0;for(r in t){var i,a=0;for(i in t[r]){var l='
      • ').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="
      • "),o+=l,a++,s++}n=1').concat(t[r][a].color," ").concat(r,"
        "):'').concat(t[r][a].color," ").concat(r," midpoint"),i[t[r][a].loc.locY][t[r][a].loc.locX]?i[t[r][a].loc.locY][t[r][a].loc.locX]=i[t[r][a].loc.locY][t[r][a].loc.locX]+" "+l:i[t[r][a].loc.locY][t[r][a].loc.locX]=l,n++}for(o in i){var u,c="";for(u in i[o])c+="",void 0!==i[o][u]&&(c+=i[o][u]),c+="";s=s+c+""}return s}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.from":158,"core-js/modules/es.array.map":164,"core-js/modules/es.string.iterator":192}],257:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t')):this.dummyDOM.querySelector("#".concat(s)).innerHTML='
        '))):"Label"===t&&(r=s+e+(i=t),this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(s,"_Label"))?this.dummyDOM.querySelector("#".concat(s,"_Label")):this.dummyDOM.querySelector("#".concat(s))).insertAdjacentHTML("afterend",'
        '))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(s,"gridOutput").concat(i),n='
        Text Output

          '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(s,"textOutput").concat(i),n='
          Grid Output

            '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,n={},s=!0,i=function(e,t){var r;e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,e]}(e,t);if("line"===e?(n.color=this.ingredients.colors.stroke,n.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=this._getPos(t[0],[1]),o=this._getPos(t[2],[3]),n.loc=u(i,this.width,this.height),n.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?n.color=this.ingredients.colors.stroke:(n.color=this.ingredients.colors.fill,n.area=this._getArea(e,t)),n.pos=this._getPos.apply(this,l(i)),n.loc=u(i,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[n]){for(var a in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][a])===JSON.stringify(n)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(n)}}else this.ingredients.shapes[e]=[n]},o.default.prototype._getPos=function(e,t){var e=new DOMPointReadOnly(e,t),t=this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform(),e=e.matrixTransform(t),t=e.x,e=e.y,r=this.width,o=this.height;return t<.4*r?e<.4*o?"top left":.6*oMath.PI?n+=o:n-=o)):"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),this.width*this._pixelDensity),i=this.height*this._pixelDensity,a=[new DOMPoint(0,0),new DOMPoint(s,0),new DOMPoint(s,i),new DOMPoint(0,i)],l=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),u=a.map(function(e){return e.matrixTransform(l)}),c=Math.abs((u[3].x+u[0].x)*(u[3].y-u[0].y)+(u[0].x+u[1].x)*(u[0].y-u[1].y)+(u[1].x+u[2].x)*(u[1].y-u[2].y)+(u[2].x+u[3].x)*(u[2].y-u[3].y))/2;return Math.round(100*n/c)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.from":158,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.number.to-fixed":175,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/web.dom-collections.iterator":238}],258:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateTextOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following");r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:");return r}((r=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='
          • ').concat(t[r][s].color," ").concat(r,"");"line"===r?i+=", ".concat(t[r][s].pos,", ").concat(t[r][s].length," pixels long.
          • "):(i+=", at ".concat(t[r][s].pos),"point"!==r&&(i+=", covering ".concat(t[r][s].area,"% of the canvas")),i+="."),o+=i,n++}return{numShapes:n,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='').concat(t[r][s].color," ").concat(r,"");"line"===r?i+="location = ".concat(t[r][s].pos,"length = ").concat(t[r][s].length," pixels"):(i+="location = ".concat(t[r][s].pos,""),"point"!==r&&(i+=" area = ".concat(t[r][s].area,"%")),i+=""),o+=i,n++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151}],259:[function(e,t,r){"use strict";var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.DataArray"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Framebuffer"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":254,"./accessibility/describe":255,"./accessibility/gridOutput":256,"./accessibility/outputs":257,"./accessibility/textOutput":258,"./color/color_conversion":260,"./color/creating_reading":261,"./color/p5.Color":262,"./color/setting":263,"./core/constants":264,"./core/environment":265,"./core/friendly_errors/fes_core":266,"./core/friendly_errors/file_errors":267,"./core/friendly_errors/sketch_reader":268,"./core/friendly_errors/stacktrace":269,"./core/friendly_errors/validate_params":270,"./core/helpers":271,"./core/init":272,"./core/legacy":274,"./core/main":275,"./core/p5.Element":276,"./core/p5.Graphics":277,"./core/p5.Renderer":278,"./core/p5.Renderer2D":279,"./core/preload":280,"./core/rendering":281,"./core/shape/2d_primitives":282,"./core/shape/attributes":283,"./core/shape/curves":284,"./core/shape/vertex":285,"./core/shim":286,"./core/structure":287,"./core/transform":288,"./data/local_storage.js":289,"./data/p5.TypedDict":290,"./dom/dom":291,"./events/acceleration":292,"./events/keyboard":293,"./events/mouse":294,"./events/touch":295,"./image/filters":296,"./image/image":297,"./image/loading_displaying":298,"./image/p5.Image":299,"./image/pixels":300,"./io/files":301,"./io/p5.Table":302,"./io/p5.TableRow":303,"./io/p5.XML":304,"./math/calculation":305,"./math/math":306,"./math/noise":307,"./math/p5.Vector":308,"./math/random":309,"./math/trigonometry":310,"./typography/attributes":311,"./typography/loading_displaying":312,"./typography/p5.Font":313,"./utilities/array_functions":314,"./utilities/conversion":315,"./utilities/string_functions":316,"./utilities/time_date":317,"./webgl/3d_primitives":318,"./webgl/interaction":320,"./webgl/light":321,"./webgl/loading":322,"./webgl/material":323,"./webgl/p5.Camera":324,"./webgl/p5.DataArray":325,"./webgl/p5.Framebuffer":326,"./webgl/p5.Geometry":327,"./webgl/p5.Matrix":328,"./webgl/p5.RenderBuffer":329,"./webgl/p5.RendererGL":332,"./webgl/p5.RendererGL.Immediate":330,"./webgl/p5.RendererGL.Retained":331,"./webgl/p5.Shader":333,"./webgl/p5.Texture":334,"./webgl/text":335}],260:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.ColorConversion={_hsbaToHSLA:function(e){var t=e[0],r=e[1],o=e[2],n=(2-r)*o/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*o/(2-2*n)),[t,r,n,e[3]]},_hsbaToRGBA:function(e){var t,r,o,n,s,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(n=o,s=l,r):2===t?(n=r,s=l,a):3===t?(n=r,s=o,l):4===t?(n=a,s=r,l):5===t?(n=l,s=r,o):(n=l,s=a,r),[n,s,i,e[3]])},_hslaToHSBA:function(e){var t=e[0],r=e[1],o=e[2],n=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(n-o)/n,n,e[3]]},_hslaToRGBA:function(e){var t,r=6*e[0],o=e[1],n=e[2];return 0===o?[n,n,n,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*n-(n=n<.5?(1+o)*n:n+o-n*o),n),t(r,o,n),t(r-2,o,n),e[3]]},_rgbaToHSBA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=i-Math.min(o,n,s);return 0==a?r=t=0:(r=a/i,o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},_rgbaToHSLA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=Math.min(o,n,s),l=i+a,a=i-a;return 0==a?r=t=0:(r=l<1?a/l:a/(2-l),o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]}};e=e.default.ColorConversion;r.default=e},{"../core/main":275}],261:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.alpha=function(e){return l.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},l.default.prototype.blue=function(e){return l.default._validateParameters("blue",arguments),this.color(e)._getBlue()},l.default.prototype.brightness=function(e){return l.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},l.default.prototype.color=function(){var e;return l.default._validateParameters("color",arguments),arguments[0]instanceof l.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new l.default.Color(this,e))},l.default.prototype.green=function(e){return l.default._validateParameters("green",arguments),this.color(e)._getGreen()},l.default.prototype.hue=function(e){return l.default._validateParameters("hue",arguments),this.color(e)._getHue()},l.default.prototype.lerpColor=function(e,t,r){l.default._validateParameters("lerpColor",arguments);var o,n,s,i=this._colorMode,a=this._colorMaxes;if(i===u.RGB)n=e.levels.map(function(e){return e/255}),s=t.levels.map(function(e){return e/255});else if(i===u.HSB)e._getBrightness(),t._getBrightness(),n=e.hsba,s=t.hsba;else{if(i!==u.HSL)throw new Error("".concat(i,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),n=e.hsla,s=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(n[0],s[0],r),t=this.lerp(n[1],s[1],r),o=this.lerp(n[2],s[2],r),n=this.lerp(n[3],s[3],r),e*=a[i][0],t*=a[i][1],o*=a[i][2],n*=a[i][3],this.color(e,t,o,n)},l.default.prototype.lightness=function(e){return l.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},l.default.prototype.red=function(e){return l.default._validateParameters("red",arguments),this.color(e)._getRed()},l.default.prototype.saturation=function(e){return l.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=l.default;r.default=n},{"../core/constants":264,"../core/friendly_errors/fes_core":266,"../core/friendly_errors/file_errors":267,"../core/friendly_errors/validate_params":270,"../core/main":275,"./p5.Color":262,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],262:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(e("../core/main")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),h=s(e("./color_conversion"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r"].indexOf(r[0])?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(o)},this).map(function(e){var t,r;return-1===(e=-1 eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[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"),o=[],n=2,s=r.length;n/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}},this)}}}e.default._getErrorStackParser=function(){return new o};e=e.default;r.default=e},{"../main":275,"core-js/modules/es.array.filter":155,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.join":162,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.match":193,"core-js/modules/es.string.replace":196,"core-js/modules/es.string.split":198}],270:[function(e,t,r){"use strict";function o(e){return(o="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)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==a(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o)})(e("../constants")),e("../internationalization");function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};e=n.default;r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":264,"../internationalization":273,"../main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.for-each":157,"core-js/modules/es.array.includes":159,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.join":162,"core-js/modules/es.array.last-index-of":163,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.function.name":168,"core-js/modules/es.map":169,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.get-prototype-of":180,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.reflect.construct":184,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.set":189,"core-js/modules/es.string.includes":191,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.for-each":237,"core-js/modules/web.dom-collections.iterator":238}],271:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,n){return n===s.CORNER?{x:e,y:t,w:r,h:o}:n===s.CORNERS?{x:e,y:t,w:r-e,h:o-t}:n===s.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:n===s.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":264,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],272:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var n=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),n]).then(function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default})},{"../core/main":275,"./internationalization":273,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.to-string":182,"core-js/modules/es.promise":183,"core-js/modules/es.string.iterator":192,"core-js/modules/web.dom-collections.iterator":238}],273:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,s,o=a(e("i18next")),i=a(e("i18next-browser-languagedetector"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r*s,o*s);return n.pixelDensity(s),n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r*s,o*s),n}},{key:"textLeading",value:function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading}},{key:"textStyle",value:function(e){return e?(e!==P.NORMAL&&e!==P.ITALIC&&e!==P.BOLD&&e!==P.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle}},{key:"textAscent",value:function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent}},{key:"textDescent",value:function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent}},{key:"textAlign",value: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}}},{key:"textWrap",value:function(e){return this._setProperty("_textWrap",e),this._textWrap}},{key:"text",value:function(e,t,r,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,h=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===P.CENTER&&(t-=o/2),this._textAlign){case P.CENTER:t+=o/2;break;case P.RIGHT:t+=o}if(void 0!==n){this._rectMode===P.CENTER&&(r-=n/2,h-=n/2);var e=r,f=u.textAscent();switch(this._textBaseline){case P.BOTTOM:l=r+n,r=Math.max(l,r),h+=f;break;case P.CENTER:l=r+n/2,r=Math.max(l,r),h+=f/2}d=r+n-f,this._textBaseline===P.CENTER&&(d=e+n-f/2)}else this._textBaseline!==P.BOTTOM&&this._textBaseline!==P.CENTER||(h=r-(e=u.textSize()*this._textLeading)/2,d=r+e/2);if(c===P.WORD){for(var p=[],m=0;ma.HALF_PI&&e<=3*a.HALF_PI?Math.atan(r/o*Math.tan(e))+a.PI:Math.atan(r/o*Math.tan(e))+a.TWO_PI,t=t<=a.HALF_PI?Math.atan(r/o*Math.tan(t)):t>a.HALF_PI&&t<=3*a.HALF_PI?Math.atan(r/o*Math.tan(t))+a.PI:Math.atan(r/o*Math.tan(t))+a.TWO_PI),tp||Math.abs(this.accelerationY-this.pAccelerationY)>p||Math.abs(this.accelerationZ-this.pAccelerationZ)>p)&&s.deviceMoved(),"function"==typeof s.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},_toImageData:function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},_createImageData:function(e,t){return V._tmpCanvas=document.createElement("canvas"),V._tmpCtx=V._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},apply:function(e,t,r){var o=e.getContext("2d"),n=o.getImageData(0,0,e.width,e.height),t=t(n,r);t instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(n,0,0,0,0,e.width,e.height)},threshold:function(e,t){for(var r=V._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),n=0;n>8)/o,r[n+1]=255*(i*t>>8)/o,r[n+2]=255*(a*t>>8)/o}},dilate:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(n>>8&255)+28*(255&n))<(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=s,n=l),n<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,n=u),f[d++]=o;V._setPixels(c,f)},erode:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(u>>8&255)+28*(255&u))<(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=u,n=a),(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(s>>8&255)+28*(255&s))>16&255)+151*(i>>8&255)+28*(255&i))>>24],r+=j[(16711680&I)>>16],o+=j[(65280&I)>>8],n+=j[255&I],t+=B[b],i++}T[a=k+g]=s/t,M[a]=r/t,E[a]=o/t,F[a]=n/t}k+=h}for(u=(l=-U)*h,v=k=0;v"+p.length.toString()+" out of "+c.toString()),e.next=48,new Promise(function(e){return setTimeout(e,0)});e.next=50;break;case 48:e.next=39;break;case 50:i||m.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(f),v=(0,P.GIFEncoder)(),b=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r"+S.toString()+" out of "+c.toString()),e.next=68,new Promise(function(e){return setTimeout(e,0)});case 68:S++,e.next=60;break;case 71:v.finish(),k=v.bytesView(),k=new Blob([k],{type:"image/gif"}),p=[],this._recording=!1,this.loop(),i||(m.html("Done. Downloading your gif!🌸"),0=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))}},{key:"_setProperty",value:function(e,t){this[e]=t,this.setModified(!0)}},{key:"loadPixels",value:function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)}},{key:"updatePixels",value:function(e,t,r,o){s.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o),this.setModified(!0)}},{key:"get",value:function(e,t,r,o){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)}},{key:"_getPixel",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(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"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==s[0]){n.print(" ");for(var c=0;c".concat(d)),n.print(" ")}n.print(" ")}for(var h=0;h");for(var f=0;f".concat(p)),n.print(" ")}n.print(" ")}n.print("
            "),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream",e=(v.default.prototype._isSafari()&&(o="text/plain"),new Blob(e,{type:o}));v.default.prototype.downloadFile(e,t,r)},v.default.prototype.downloadFile=function(e,t,r){var o,t=i(t,r),r=t[0];e instanceof Blob?n.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},v.default.prototype._checkFileExtension=i,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%o)/o}};n.setSeed(e),j=new Array(4096);for(var s=0;s<4096;s++)j[s]=n.rand()},e.default);r.default=e},{"../core/main":275}],308:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("../core/main"))&&n.__esModule?n:{default:n},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function u(e,t){for(var r=0;r>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(tf&&(b=d,v=a,s=l,d=x+f*(i&&x=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.map":164,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.repeat":195}],316:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(u=e("../core/main"))&&u.__esModule?u:{default:u};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t,r){var o=i(e.toString().split("."),2),n=o[0],o=o[1];return void 0===r?(n=n.padStart(t,"0"),o?n+"."+o:n):(n=(e=i(e.toFixed(r).toString().split("."),2))[0],o=e[1],n=n.padStart(t,"0"),void 0===o?n:n+"."+o)}function n(e,t){var r=(e=e.toString()).indexOf("."),o=-1!==r?e.substring(r):"",e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(0===t)o="";else if(void 0!==t)if(t>o.length)for(var n=t-(o+=-1===r?".":"").length+1,s=0;s=_.TWO_PI?"".concat(c="ellipse","|"):"".concat(c="arc","|").concat(s,"|").concat(i,"|").concat(a,"|")).concat(l,"|"),c=(this.geometryInHash(u)||((t=new S.default.Geometry(l,1,function(){if(s.toFixed(10)!==i.toFixed(10)){a!==_.PIE&&void 0!==a||(this.vertices.push(new S.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=l;e++){var t=(i-s)*(e/l)+s,r=.5+Math.cos(t)/2,t=.5+Math.sin(t)/2;this.vertices.push(new S.default.Vector(r,t,0)),this.uvs.push([r,t]),e>5&31)/31,(p>>10&31)/31):(r=i,o=a,l)),new x.default.Vector(y,g,v)),j=1;j<=3;j++){var _=m+12*j,_=new x.default.Vector(u.getFloat32(_,!0),u.getFloat32(4+_,!0),u.getFloat32(8+_,!0));e.vertices.push(_),e.vertexNormals.push(b),d&&s.push(r,o,n)}e.faces.push([3*f,3*f+1,3*f+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{t=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");t=new TextDecoder("utf-8").decode(t).split("\n");!function(e,t){for(var r,o,n="",s=[],i=0;ithis.cameraFar&&(i=this.cameraFar),Math.acos(Math.max(-1,Math.min(1,_.default.Vector.dot(o,n))))+t),t=e;(r<=0||r>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),n.mult(Math.cos(r)),a.mult(Math.cos(t)*Math.sin(r)),s.mult(Math.sin(t)*Math.sin(r)),o.set(n).add(a).add(s),this.eyeX=i*o.x+this.centerX,this.eyeY=i*o.y+this.centerY,this.eyeZ=i*o.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.hypot(o,n,s),o=new _.default.Vector(o,n,s).normalize(),n=new _.default.Vector(this.upX,this.upY,this.upZ),s=new _.default.Vector.cross(n,o).normalize(),a=new _.default.Vector.cross(o,s),l=Math.atan2(t,e),l=(a.mult(Math.sin(l)),s.mult(Math.cos(l)).add(a),Math.sqrt(e*e+t*t)),a=new _.default.Vector.cross(o,s),e=((i=(i*=Math.pow(10,r))this.cameraFar&&(i=this.cameraFar),Math.cos(l)),t=Math.sin(l),r=n.dot(o),l=n.dot(s),u=r*e+l*t,r=-r*t+l*e,l=n.dot(a);n.x=u*o.x+r*s.x+l*a.x,n.y=u*o.y+r*s.y+l*a.y,n.z=u*o.z+r*s.z+l*a.z,s.mult(-t),o.mult(e).add(s).mult(i),this.camera(o.x+this.centerX,o.y+this.centerY,o.z+this.centerZ,this.centerX,this.centerY,this.centerZ,n.x,n.y,n.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&n(e.prototype,r),o&&n(e,o),t}(),_.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};e=_.default.Camera;r.default=e},{"../core/main":275,"core-js/modules/es.array.slice":165,"core-js/modules/es.math.hypot":170,"core-js/modules/es.string.sub":200}],325:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t){for(var r=0;r=this.width||t>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1)),(0,p.readPixelWebGL)(this.gl,this.framebuffer,e*this.density,t*this.density,n.format,n.type);e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1),r=this.target.constrain(r,1,this.width-e),o=this.target.constrain(o,1,this.height-t);for(var s=(0,p.readPixelsWebGL)(void 0,this.gl,this.framebuffer,e*this.density,t*this.density,r*this.density,o*this.density,n.format,n.type),i=new Uint8ClampedArray(r*o*this.density*this.density*4),a=(i.fill(255),n.type===this.gl.RGB?3:4),l=0;lthis.vertices.length-1-this.detailX;o--)e.add(this.vertexNormals[o]);e=m.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this}},{key:"_makeTriangleEdges",value:function(){for(var e=this.edges.length=0;e 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},a.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),this._applyColorBlend(this.curStrokeColor),r.drawArrays(r.Points,0,e.length),o.unbindShader()};var s=a.default.RendererGL;r.default=s},{"../core/constants":264,"../core/main":275,"./p5.RenderBuffer":329,"./p5.RendererGL":332,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.some":166,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.typed-array.copy-within":205,"core-js/modules/es.typed-array.every":206,"core-js/modules/es.typed-array.fill":207,"core-js/modules/es.typed-array.filter":208,"core-js/modules/es.typed-array.find":210,"core-js/modules/es.typed-array.find-index":209,"core-js/modules/es.typed-array.float32-array":211,"core-js/modules/es.typed-array.for-each":213,"core-js/modules/es.typed-array.includes":214,"core-js/modules/es.typed-array.index-of":215,"core-js/modules/es.typed-array.iterator":218,"core-js/modules/es.typed-array.join":219,"core-js/modules/es.typed-array.last-index-of":220,"core-js/modules/es.typed-array.map":221,"core-js/modules/es.typed-array.reduce":223,"core-js/modules/es.typed-array.reduce-right":222,"core-js/modules/es.typed-array.reverse":224,"core-js/modules/es.typed-array.set":225,"core-js/modules/es.typed-array.slice":226,"core-js/modules/es.typed-array.some":227,"core-js/modules/es.typed-array.sort":228,"core-js/modules/es.typed-array.subarray":229,"core-js/modules/es.typed-array.to-locale-string":230,"core-js/modules/es.typed-array.to-string":231,"core-js/modules/es.typed-array.uint16-array":232,"core-js/modules/es.typed-array.uint32-array":233,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],332:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.readPixelsWebGL=k,r.readPixelWebGL=C,r.default=void 0;var g=n(e("../core/main")),l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),a=n(e("./GeometryBuilder")),u=n(e("libtess")),c=(e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("./p5.Framebuffer"),e("path"),e("./p5.Texture"));function d(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,d=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n",lineVert:T+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:T+"precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n",pointFrag:"precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n",imageLightVert:"precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n",imageLightDiffusedFrag:"precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}",imageLightSpecularFrag:"precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n"};for(x in M)M[x]="#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n"+M[x];j(e={},l.GRAY,"precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n"),j(e,l.ERODE,"// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),j(e,l.DILATE,"// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),j(e,l.BLUR,"precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n"),j(e,l.POSTERIZE,"// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n"),j(e,l.OPAQUE,"// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n"),j(e,l.INVERT,"// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n"),j(e,l.THRESHOLD,"// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n");var E=e;function k(e,t,r,o,n,s,i,a,l,u){var c=t.getParameter(t.FRAMEBUFFER_BINDING),r=(t.bindFramebuffer(t.FRAMEBUFFER,r),a===t.RGBA?4:3),d=s*i*r,h=l===t.UNSIGNED_BYTE?Uint8Array:Float32Array;if(e instanceof h&&e.length===d||(e=new h(d)),t.readPixels(o,u?u-n-i:n,s,i,a,l,e),t.bindFramebuffer(t.FRAMEBUFFER,c),u)for(var f=Math.floor(i/2),p=new h(s*r),m=0;m>7,127&d,c>>7,127&c);for(var h=0;h>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}]),t}();B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=M.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new E(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var h,f=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(h=f.next()).done);d=!0)h.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==f.return||f.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var j,_=y[Symbol.iterator]();!(g=(j=_.next()).done);g=!0){var x,w,S=j.value,T=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));T.uGlyphRect&&(x=T.rowInfo,w=T.colInfo,u.setUniform("uSamplerStrokes",T.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",T.uGridOffset),u.setUniform("uGlyphRect",T.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":264,"../core/main":275,"./p5.RendererGL.Retained":331,"./p5.Shader":333,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.string.sub":200,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}]},{},[259])(259)}); \ No newline at end of file From b22663a25831eca7afa776cc5b55103c07a853c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 20 Jan 2024 00:46:10 +0000 Subject: [PATCH 02/26] chore(deps): update devdependencies-non-major --- package-lock.json | 6578 +++++++++++++++++---------------------------- package.json | 10 +- 2 files changed, 2535 insertions(+), 4053 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd8a6a2..5e63be5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,16 +24,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.40.1", + "@playwright/test": "1.41.1", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.1.2", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.10.6", - "jsdom": "23.0.1", + "@types/node": "20.11.5", + "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.10.2", + "netlify-cli": "17.15.1", "shx": "0.3.4", - "vitest": "1.1.1" + "vitest": "1.2.1" } }, "node_modules/@ampproject/remapping": { @@ -48,6 +48,17 @@ "node": ">=6.0.0" } }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-2.0.2.tgz", + "integrity": "sha512-x1KXOatwofR6ZAYzXRBL5wrdV0vwNxlTCK9NCuLqAzQYARqGcvFwiJA6A1ERuh+dgeA4Dxm3JBYictIes+SqUQ==", + "dev": true, + "dependencies": { + "bidi-js": "^1.0.3", + "css-tree": "^2.3.1", + "is-potential-custom-element-name": "^1.0.1" + } + }, "node_modules/@astrojs/check": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.3.4.tgz", @@ -1212,12 +1223,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", - "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.1.tgz", + "integrity": "sha512-9g8EWTjiQ9yFBXc6HjCWe41msLpxEX0KhmfmPl9RPLJdfzL4F0lg2BdJ91O9azFdl11y1pmpwdjBiSxvqc+btw==", "dev": true, "dependencies": { - "playwright": "1.40.1" + "playwright": "1.41.1" }, "bin": { "playwright": "cli.js" @@ -1359,9 +1370,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz", - "integrity": "sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.5.tgz", + "integrity": "sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA==", "cpu": [ "riscv64" ], @@ -2069,9 +2080,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz", - "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@types/hast": { "version": "2.3.7", @@ -2128,9 +2139,9 @@ "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" }, "node_modules/@types/node": { - "version": "20.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", - "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "version": "20.11.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", + "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2209,13 +2220,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.1.1.tgz", - "integrity": "sha512-Qpw01C2Hyb3085jBkOJLQ7HRX0Ncnh2qV4p+xWmmhcIUlMykUF69zsnZ1vPmAjZpomw9+5tWEGOQ0GTfR8U+kA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.1.tgz", + "integrity": "sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.1.1", - "@vitest/utils": "1.1.1", + "@vitest/spy": "1.2.1", + "@vitest/utils": "1.2.1", "chai": "^4.3.10" }, "funding": { @@ -2223,12 +2234,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.1.1.tgz", - "integrity": "sha512-8HokyJo1SnSi3uPFKfWm/Oq1qDwLC4QDcVsqpXIXwsRPAg3gIDh8EbZ1ri8cmQkBxdOu62aOF9B4xcqJhvt4xQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.1.tgz", + "integrity": "sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.1.1", + "@vitest/utils": "1.2.1", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2252,9 +2263,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.1.1.tgz", - "integrity": "sha512-WnMHjv4VdHLbFGgCdVVvyRkRPnOKN75JJg+LLTdr6ah7YnL75W+7CTIMdzPEPzaDxA8r5yvSVlc1d8lH3yE28w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.1.tgz", + "integrity": "sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2266,9 +2277,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.1.1.tgz", - "integrity": "sha512-hDU2KkOTfFp4WFFPWwHFauddwcKuGQ7gF6Un/ZZkCogoAiTMN7/7YKvUDbywPZZ754iCQGjdUmXN3t4k0jm1IQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.1.tgz", + "integrity": "sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2278,12 +2289,13 @@ } }, "node_modules/@vitest/utils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.1.1.tgz", - "integrity": "sha512-E9LedH093vST/JuBSyHLFMpxJKW3dLhe/flUSPFedoyj4wKiFX7Jm8gYLtOIiin59dgrssfmFv0BJ1u8P/LC/A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", "loupe": "^2.3.7", "pretty-format": "^29.7.0" }, @@ -2393,9 +2405,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", - "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -2738,6 +2750,15 @@ "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "dev": true, + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -3596,16 +3617,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, "node_modules/cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", + "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", "dev": true, "dependencies": { "rrweb-cssom": "^0.6.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/csstype": { @@ -5573,12 +5607,13 @@ } }, "node_modules/jsdom": { - "version": "23.0.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz", - "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==", + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.2.0.tgz", + "integrity": "sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==", "dev": true, "dependencies": { - "cssstyle": "^3.0.0", + "@asamuzakjp/dom-selector": "^2.0.1", + "cssstyle": "^4.0.1", "data-urls": "^5.0.0", "decimal.js": "^10.4.3", "form-data": "^4.0.0", @@ -5586,7 +5621,6 @@ "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.7", "parse5": "^7.1.2", "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", @@ -5597,7 +5631,7 @@ "whatwg-encoding": "^3.1.1", "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0", - "ws": "^8.14.2", + "ws": "^8.16.0", "xml-name-validator": "^5.0.0" }, "engines": { @@ -5624,6 +5658,27 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/jsdom/node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -6440,6 +6495,12 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.9.tgz", "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true + }, "node_modules/meow": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", @@ -7205,22 +7266,22 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.10.2", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.10.2.tgz", - "integrity": "sha512-pKXL+w5/vm4ld6IUotBEse3KvN4+WCComLP6a73OiOvy8uM6uxtDUiuL+uAhRaozohjjaU/Ym4q1TqwbqWF5rA==", + "version": "17.15.1", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.15.1.tgz", + "integrity": "sha512-6ADmj/3acsshJi115ONCNnl7O5guD8PrMC9sSnQKwAfe4Vc98dBb7kH/tpdMfMHimsJksaT3fsHbDmuNl0jlOw==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "dependencies": { "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", - "@netlify/blobs": "6.3.1", - "@netlify/build": "29.31.0", - "@netlify/build-info": "7.11.3", - "@netlify/config": "20.10.0", - "@netlify/edge-bundler": "10.1.3", + "@netlify/blobs": "6.4.2", + "@netlify/build": "29.32.1", + "@netlify/build-info": "7.11.5", + "@netlify/config": "20.10.2", + "@netlify/edge-bundler": "11.2.0", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.28.1", + "@netlify/zip-it-and-ship-it": "9.28.2", "@octokit/rest": "19.0.13", "ansi-escapes": "6.2.0", "ansi-styles": "6.2.1", @@ -7285,9 +7346,9 @@ "log-symbols": "5.1.0", "log-update": "5.0.1", "multiparty": "4.2.3", - "netlify": "13.1.11", - "netlify-headers-parser": "7.1.2", - "netlify-redirect-parser": "14.2.0", + "netlify": "13.1.13", + "netlify-headers-parser": "7.1.3", + "netlify-redirect-parser": "14.2.1", "netlify-redirector": "0.5.0", "node-fetch": "2.6.12", "node-version-alias": "3.4.1", @@ -7489,9 +7550,9 @@ } }, "node_modules/netlify-cli/node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -7501,9 +7562,9 @@ } }, "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", - "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", + "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.23.4", @@ -7617,578 +7678,503 @@ "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@fastify/accept-negotiator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", - "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", + "node_modules/netlify-cli/node_modules/@esbuild/aix-ppc64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", + "integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==", + "cpu": [ + "ppc64" + ], "dev": true, + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", - "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==", + "node_modules/netlify-cli/node_modules/@esbuild/android-arm": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.11.tgz", + "integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "ajv": "^8.11.0", - "ajv-formats": "^2.1.1", - "fast-uri": "^2.0.0" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/netlify-cli/node_modules/@esbuild/android-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz", + "integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", - "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@fastify/error": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", - "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", - "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", + "node_modules/netlify-cli/node_modules/@esbuild/android-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.11.tgz", + "integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "fast-json-stringify": "^5.7.0" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/send": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.0.1.tgz", - "integrity": "sha512-8jdouu0o5d0FMq1+zCKeKXc1tmOQ5tTGYdQP3MpyF9+WWrZT1KCBdh6hvoEYxOm3oJG/akdE9BpehLiJgYRvGw==", + "node_modules/netlify-cli/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz", + "integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@lukeed/ms": "^2.0.1", - "escape-html": "~1.0.3", - "fast-decode-uri-component": "^1.0.1", - "http-errors": "2.0.0", - "mime": "^3.0.0" + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "node_modules/netlify-cli/node_modules/@esbuild/darwin-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz", + "integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">= 0.8" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "node_modules/netlify-cli/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz", + "integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">= 0.8" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "node_modules/netlify-cli/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz", + "integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==", + "cpu": [ + "x64" + ], "dev": true, - "bin": { - "mime": "cli.js" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=10.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/static": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.10.2.tgz", - "integrity": "sha512-UoaMvIHSBLCZBYOVZwFRYqX2ufUhd7FFMYGDeSf0Z+D8jhYtwljjmuQGuanUP8kS4y/ZEV1a8mfLha3zNwsnnQ==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-arm": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz", + "integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@fastify/accept-negotiator": "^1.0.0", - "@fastify/send": "^2.0.0", - "content-disposition": "^0.5.3", - "fastify-plugin": "^4.0.0", - "glob": "^8.0.1", - "p-limit": "^3.1.0", - "readable-stream": "^4.0.0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz", + "integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-ia32": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz", + "integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==", + "cpu": [ + "ia32" + ], "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } + "optional": true, + "os": [ + "linux" ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-loong64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz", + "integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==", + "cpu": [ + "loong64" + ], "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz", + "integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==", + "cpu": [ + "mips64el" + ], "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", - "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz", + "integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz", + "integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.2.tgz", - "integrity": "sha512-Lf2pUhNTaviEdEaGgjU+29qw3arX7Qd/45q66F3z1EV5hroE6wM9xSHPvjB8EY+b1RmKZgwnLWXQorC6fZ9g5g==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-s390x": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz", + "integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==", + "cpu": [ + "s390x" + ], "dev": true, - "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.9.tgz", - "integrity": "sha512-YJsOehVXzgurc+lLAxYnlSMc1p/Gu6VAvnfx0ATi2nzvr0YZcjhmZDeY8SeAKv1M7zE3aEJH0Xo9mK1iZ8GYoQ==", + "node_modules/netlify-cli/node_modules/@esbuild/linux-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz", + "integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.2.4", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@honeycombio/opentelemetry-node": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@honeycombio/opentelemetry-node/-/opentelemetry-node-0.5.0.tgz", - "integrity": "sha512-bAg//j0Lh0SFC0LhUrrgpO4FVScOBDt+my4YXeIo9lHi1aXXn6meaB/ycecjVfjyQLaGYWKPKu2C66rTgKIzMQ==", + "node_modules/netlify-cli/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz", + "integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.3", - "@opentelemetry/api": "^1.4.1", - "@opentelemetry/core": "^1.13.0", - "@opentelemetry/exporter-metrics-otlp-grpc": "^0.41.0", - "@opentelemetry/exporter-metrics-otlp-proto": "^0.39.1", - "@opentelemetry/exporter-trace-otlp-grpc": "^0.41.0", - "@opentelemetry/exporter-trace-otlp-proto": "^0.41.0", - "@opentelemetry/resources": "^1.13.0", - "@opentelemetry/sdk-metrics": "^1.13.0", - "@opentelemetry/sdk-node": "^0.39.1", - "@opentelemetry/sdk-trace-base": "^1.13.0", - "axios": "^1.1.3" - }, + "optional": true, + "os": [ + "netbsd" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", - "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", + "node_modules/netlify-cli/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz", + "integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": ">=10.10.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@import-maps/resolve": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@import-maps/resolve/-/resolve-1.0.1.tgz", - "integrity": "sha512-tWZNBIS1CoekcwlMuyG2mr0a1Wo5lb5lEHwwWvZo+5GLgr3e9LLDTtmgtCWEwBpXMkxn9D+2W9j2FY6eZQq0tA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@ioredis/commands": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", - "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@jest/types": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", - "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "node_modules/netlify-cli/node_modules/@esbuild/sunos-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz", + "integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^16.0.0", - "chalk": "^4.0.0" - }, + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "node_modules/netlify-cli/node_modules/@esbuild/win32-arm64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz", + "integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@types/yargs-parser": "*" + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/netlify-cli/node_modules/@esbuild/win32-ia32": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz", + "integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/netlify-cli/node_modules/@esbuild/win32-x64": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz", + "integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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==", + "node_modules/netlify-cli/node_modules/@fastify/accept-negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", + "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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==", + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", + "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1", + "fast-uri": "^2.0.0" } }, - "node_modules/netlify-cli/node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, - "engines": { - "node": ">=6.0.0" + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/netlify-cli/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/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==", "dev": true }, - "node_modules/netlify-cli/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", + "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/error": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", + "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", + "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "fast-json-stringify": "^5.7.0" } }, - "node_modules/netlify-cli/node_modules/@lukeed/ms": { + "node_modules/netlify-cli/node_modules/@fastify/send": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", - "integrity": "sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.0.1.tgz", + "integrity": "sha512-8jdouu0o5d0FMq1+zCKeKXc1tmOQ5tTGYdQP3MpyF9+WWrZT1KCBdh6hvoEYxOm3oJG/akdE9BpehLiJgYRvGw==", "dev": true, "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" + "@lukeed/ms": "^2.0.1", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "2.0.0", + "mime": "^3.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/binary-info": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@netlify/binary-info/-/binary-info-1.0.0.tgz", - "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.1.tgz", - "integrity": "sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg==", + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.31.0", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.31.0.tgz", - "integrity": "sha512-XtUXnj3LtdWxcgP4kz1k0creF9bZa7eGNh85B89sw4V99Mtsn1Sl89yAZJkEH6rtuGJIs1eiQ261nlhUZ6+C6Q==", + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "dependencies": { - "@bugsnag/js": "^7.0.0", - "@honeycombio/opentelemetry-node": "^0.5.0", - "@netlify/blobs": "^6.3.1", - "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.10.0", - "@netlify/edge-bundler": "10.1.3", - "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.45", - "@netlify/git-utils": "^5.1.1", - "@netlify/plugins-list": "^6.72.0", - "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.28.1", - "@opentelemetry/api": "^1.4.1", - "@opentelemetry/core": "^1.17.1", - "@sindresorhus/slugify": "^2.0.0", - "ansi-escapes": "^6.0.0", - "chalk": "^5.0.0", - "clean-stack": "^4.0.0", - "execa": "^6.0.0", - "fdir": "^6.0.1", - "figures": "^5.0.0", - "filter-obj": "^5.0.0", - "got": "^12.0.0", - "hot-shots": "10.0.0", - "indent-string": "^5.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "keep-func-props": "^4.0.0", - "locate-path": "^7.0.0", - "log-process-errors": "^8.0.0", - "map-obj": "^5.0.0", - "memoize-one": "^6.0.0", - "node-fetch": "^3.3.2", - "os-name": "^5.0.0", - "p-event": "^5.0.0", - "p-every": "^2.0.0", - "p-filter": "^3.0.0", - "p-locate": "^6.0.0", - "p-map": "^6.0.0", - "p-reduce": "^3.0.0", - "path-exists": "^5.0.0", - "path-type": "^5.0.0", - "pkg-dir": "^7.0.0", - "pretty-ms": "^8.0.0", - "ps-list": "^8.0.0", - "read-pkg-up": "^9.0.0", - "readdirp": "^3.4.0", - "resolve": "^2.0.0-next.1", - "rfdc": "^1.3.0", - "safe-json-stringify": "^1.2.0", - "semver": "^7.3.8", - "string-width": "^5.0.0", - "strip-ansi": "^7.0.0", - "supports-color": "^9.0.0", - "terminal-link": "^3.0.0", - "ts-node": "^10.9.1", - "typescript": "^5.0.0", - "uuid": "^9.0.0", - "yargs": "^17.6.0" - }, - "bin": { - "netlify-build": "bin.js" + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" }, "engines": { - "node": "^14.16.0 || >=16.0.0" - }, - "peerDependencies": { - "@netlify/opentelemetry-sdk-setup": "^1.0.1" - }, - "peerDependenciesMeta": { - "@netlify/opentelemetry-sdk-setup": { - "optional": true - } + "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.11.3", - "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.11.3.tgz", - "integrity": "sha512-lnJsJcoFSZIIB+4tOU/rdPjPn2+TP896B9y23z5THyACeN/e2I0Y7Y+d+BzHgFDcJBwqFpIehEs2jf8wPb9CHw==", + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "dev": true, - "dependencies": { - "@bugsnag/js": "^7.20.0", - "dot-prop": "^7.2.0", - "find-up": "^6.3.0", - "minimatch": "^9.0.0", - "read-pkg": "^7.1.0", - "semver": "^7.3.8", - "toml": "^3.0.0", - "yaml": "^2.1.3", - "yargs": "^17.6.0" - }, "bin": { - "build-info": "bin.js" + "mime": "cli.js" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=10.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/brace-expansion": { + "node_modules/netlify-cli/node_modules/@fastify/static": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.10.2.tgz", + "integrity": "sha512-UoaMvIHSBLCZBYOVZwFRYqX2ufUhd7FFMYGDeSf0Z+D8jhYtwljjmuQGuanUP8kS4y/ZEV1a8mfLha3zNwsnnQ==", + "dev": true, + "dependencies": { + "@fastify/accept-negotiator": "^1.0.0", + "@fastify/send": "^2.0.0", + "content-disposition": "^0.5.3", + "fastify-plugin": "^4.0.0", + "glob": "^8.0.1", + "p-limit": "^3.1.0", + "readable-stream": "^4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", @@ -8197,411 +8183,509 @@ "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", - "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "@types/normalize-package-data": "^2.4.1", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^2.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, "engines": { - "node": ">=12.20" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true, - "engines": { - "node": ">= 14" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/core": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.18.1.tgz", - "integrity": "sha512-kvnUqezHMhsQvdsnhnqTNfAJs3ox/isB0SVrM1dhVFw7SsB7TstuVa6fgWnN2GdPyilIFLUvvbTZoVRmx6eiRg==", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.18.1" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.8.0" + "node": ">=10" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.18.1.tgz", - "integrity": "sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA==", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", + "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, "engines": { - "node": ">=14" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", "dev": true, "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" + "safe-buffer": "~5.2.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", + "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", "dev": true, "engines": { - "node": ">=14.16" + "node": ">=10.10.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "node_modules/netlify-cli/node_modules/@import-maps/resolve": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@import-maps/resolve/-/resolve-1.0.1.tgz", + "integrity": "sha512-tWZNBIS1CoekcwlMuyG2mr0a1Wo5lb5lEHwwWvZo+5GLgr3e9LLDTtmgtCWEwBpXMkxn9D+2W9j2FY6eZQq0tA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" }, "engines": { - "node": ">=14.16" + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "@types/yargs-parser": "*" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=8" }, "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/figures": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", - "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=14" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" + "node": ">=7.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=10.19.0" + "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "node_modules/netlify-cli/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, "engines": { - "node": ">=12.20.0" + "node": ">=6.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "node_modules/netlify-cli/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "node_modules/netlify-cli/node_modules/@lukeed/ms": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", + "integrity": "sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "node_modules/netlify-cli/node_modules/@netlify/binary-info": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@netlify/binary-info/-/binary-info-1.0.0.tgz", + "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/blobs": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.4.2.tgz", + "integrity": "sha512-MccXfC/b8vRr5FWJTvMN7L3aBgtrbhNLWQsSu802C/R2Gmlb5C9/OC0IY4i0+BEZ8rS+F4TU/8NQsVlqHHVESQ==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "node_modules/netlify-cli/node_modules/@netlify/build": { + "version": "29.32.1", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.32.1.tgz", + "integrity": "sha512-H+vHSucPMCNtMYVjnzPTZnbUGoIVe3vSKoS4j+AOw/Rvuhqyb0Dr/9Bhw6D3uaa3YAaJhuf09naD/9yYxzTJfg==", "dev": true, "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" + "@bugsnag/js": "^7.0.0", + "@netlify/blobs": "^6.4.2", + "@netlify/cache-utils": "^5.1.5", + "@netlify/config": "^20.10.2", + "@netlify/edge-bundler": "11.2.0", + "@netlify/framework-info": "^9.8.10", + "@netlify/functions-utils": "^5.2.46", + "@netlify/git-utils": "^5.1.1", + "@netlify/opentelemetry-utils": "^1.0.1", + "@netlify/plugins-list": "^6.73.0", + "@netlify/run-utils": "^5.1.1", + "@netlify/zip-it-and-ship-it": "9.28.2", + "@opentelemetry/api": "~1.6.0", + "@sindresorhus/slugify": "^2.0.0", + "ansi-escapes": "^6.0.0", + "chalk": "^5.0.0", + "clean-stack": "^4.0.0", + "execa": "^6.0.0", + "fdir": "^6.0.1", + "figures": "^5.0.0", + "filter-obj": "^5.0.0", + "got": "^12.0.0", + "hot-shots": "10.0.0", + "indent-string": "^5.0.0", + "is-plain-obj": "^4.0.0", + "js-yaml": "^4.0.0", + "keep-func-props": "^4.0.0", + "locate-path": "^7.0.0", + "log-process-errors": "^8.0.0", + "map-obj": "^5.0.0", + "memoize-one": "^6.0.0", + "node-fetch": "^3.3.2", + "os-name": "^5.0.0", + "p-event": "^5.0.0", + "p-every": "^2.0.0", + "p-filter": "^3.0.0", + "p-locate": "^6.0.0", + "p-map": "^6.0.0", + "p-reduce": "^3.0.0", + "path-exists": "^5.0.0", + "path-type": "^5.0.0", + "pkg-dir": "^7.0.0", + "pretty-ms": "^8.0.0", + "ps-list": "^8.0.0", + "read-pkg-up": "^9.0.0", + "readdirp": "^3.4.0", + "resolve": "^2.0.0-next.1", + "rfdc": "^1.3.0", + "safe-json-stringify": "^1.2.0", + "semver": "^7.3.8", + "string-width": "^5.0.0", + "strip-ansi": "^7.0.0", + "supports-color": "^9.0.0", + "terminal-link": "^3.0.0", + "ts-node": "^10.9.1", + "typescript": "^5.0.0", + "uuid": "^9.0.0", + "yargs": "^17.6.0" + }, + "bin": { + "netlify-build": "bin.js" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": "^14.16.0 || >=16.0.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "peerDependencies": { + "@netlify/opentelemetry-sdk-setup": "^1.0.2" + }, + "peerDependenciesMeta": { + "@netlify/opentelemetry-sdk-setup": { + "optional": true + } } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "node_modules/netlify-cli/node_modules/@netlify/build-info": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.11.5.tgz", + "integrity": "sha512-uZIlBVUHgJuW46iSAEgI2WOAFFhzufhvTrLzuNsXFSo2/v79rEfjYI2lnuknkihgjVSyrmxAjMfWFzpaQjNGyQ==", "dev": true, - "engines": { - "node": ">=14.16" + "dependencies": { + "@bugsnag/js": "^7.20.0", + "dot-prop": "^7.2.0", + "find-up": "^6.3.0", + "minimatch": "^9.0.0", + "read-pkg": "^7.1.0", + "semver": "^7.3.8", + "toml": "^3.0.0", + "yaml": "^2.1.3", + "yargs": "^17.6.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "bin": { + "build-info": "bin.js" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "path-key": "^4.0.0" + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", "dev": true, "dependencies": { - "mimic-fn": "^4.0.0" + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" }, "engines": { - "node": ">=12" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "engines": { "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-map": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", - "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", "dev": true, "engines": { - "node": ">=16" + "node": ">=14.16" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-type": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/escape-string-regexp": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { "node": ">=12" @@ -8610,46 +8694,97 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/pkg-dir": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", - "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, "dependencies": { - "find-up": "^6.3.0" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=14.16" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, "dependencies": { - "lowercase-keys": "^3.0.0" + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" }, "engines": { "node": ">=14.16" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, "engines": { "node": ">=12" }, @@ -8657,192 +8792,95 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/strip-final-newline": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, "engines": { - "node": ">=12.20" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.5.tgz", - "integrity": "sha512-lMNdFmy2Yu3oVquSPooRDLxJ8QOsIX6X6vzA2pKz/9V2LQFJiqBukggXM+Rnqzk1regPpdJ0jK3dPGvOKaRQgg==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, - "dependencies": { - "cpy": "^9.0.0", - "get-stream": "^6.0.0", - "globby": "^13.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "move-file": "^3.0.0", - "path-exists": "^5.0.0", - "readdirp": "^3.4.0" - }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.10.0", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.0.tgz", - "integrity": "sha512-7CNoL5IPSRBzDVzxuQgltZ71D/vZ/oYR29sfN8EXjAFOZPSLtnZgborcPa9V9BXLN4N5h0hFp2A26lnnCttEFg==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { - "chalk": "^5.0.0", - "cron-parser": "^4.1.0", - "deepmerge": "^4.2.2", - "dot-prop": "^7.0.0", - "execa": "^6.0.0", - "fast-safe-stringify": "^2.0.7", - "figures": "^5.0.0", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "indent-string": "^5.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "map-obj": "^5.0.0", - "netlify": "^13.1.11", - "netlify-headers-parser": "^7.1.2", - "netlify-redirect-parser": "^14.2.0", - "node-fetch": "^3.3.1", - "omit.js": "^2.0.2", - "p-locate": "^6.0.0", - "path-type": "^5.0.0", - "toml": "^3.0.0", - "tomlify-j0.4": "^3.0.0", - "validate-npm-package-name": "^4.0.0", - "yargs": "^17.6.0" - }, - "bin": { - "netlify-config": "bin.js" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/figures": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", - "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, - "engines": { - "node": ">=14" + "mimic-fn": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, "engines": { "node": ">=12" }, @@ -8850,67 +8888,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12.20" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-limit": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", @@ -8925,7 +8912,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-locate": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-locate": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", @@ -8940,1186 +8927,78 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", "dev": true, "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true, "engines": { - "node": ">=12.20" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-10.1.3.tgz", - "integrity": "sha512-+cFFUrdbkhbtmpvQlRam4CmNguKBjte7usNXO1IxDmExeYxdwkDWWBCjOO4zd/D12TIC3HSJGJjT76GkF+RwTg==", - "dev": true, - "dependencies": { - "@import-maps/resolve": "^1.0.1", - "@vercel/nft": "^0.24.3", - "ajv": "^8.11.2", - "ajv-errors": "^3.0.0", - "better-ajv-errors": "^1.2.0", - "common-path-prefix": "^3.0.0", - "env-paths": "^3.0.0", - "esbuild": "0.19.6", - "execa": "^6.0.0", - "find-up": "^6.3.0", - "get-package-name": "^2.2.0", - "get-port": "^6.1.2", - "is-path-inside": "^4.0.0", - "jsonc-parser": "^3.2.0", - "node-fetch": "^3.1.1", - "node-stream-zip": "^1.15.0", - "p-retry": "^5.1.1", - "p-wait-for": "^4.1.0", - "path-key": "^4.0.0", - "regexp-tree": "^0.1.24", - "semver": "^7.3.8", - "tmp-promise": "^3.0.3", - "urlpattern-polyfill": "8.0.2", - "uuid": "^9.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", - "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", - "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", - "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", - "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", - "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", - "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", - "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", - "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", - "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", - "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", - "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", - "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", - "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", - "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", - "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", - "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", - "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", - "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", - "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", - "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", - "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", - "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.24.3", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.24.3.tgz", - "integrity": "sha512-IyBdIxmFAeGZnEfMgt4QrGK7XX4lWazlQj34HEi9dw04/WeDBJ7r1yaOIO5tTf9pbfvwUFodj9b0H+NDGGoOMg==", - "dev": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", - "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", - "dev": true, - "peerDependencies": { - "ajv": "^8.0.1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", - "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.19.6", - "@esbuild/android-arm64": "0.19.6", - "@esbuild/android-x64": "0.19.6", - "@esbuild/darwin-arm64": "0.19.6", - "@esbuild/darwin-x64": "0.19.6", - "@esbuild/freebsd-arm64": "0.19.6", - "@esbuild/freebsd-x64": "0.19.6", - "@esbuild/linux-arm": "0.19.6", - "@esbuild/linux-arm64": "0.19.6", - "@esbuild/linux-ia32": "0.19.6", - "@esbuild/linux-loong64": "0.19.6", - "@esbuild/linux-mips64el": "0.19.6", - "@esbuild/linux-ppc64": "0.19.6", - "@esbuild/linux-riscv64": "0.19.6", - "@esbuild/linux-s390x": "0.19.6", - "@esbuild/linux-x64": "0.19.6", - "@esbuild/netbsd-x64": "0.19.6", - "@esbuild/openbsd-x64": "0.19.6", - "@esbuild/sunos-x64": "0.19.6", - "@esbuild/win32-arm64": "0.19.6", - "@esbuild/win32-ia32": "0.19.6", - "@esbuild/win32-x64": "0.19.6" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", - "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-wait-for": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", - "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", - "dev": true, - "dependencies": { - "p-timeout": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info": { - "version": "9.8.10", - "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.10.tgz", - "integrity": "sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==", - "dev": true, - "dependencies": { - "ajv": "^8.12.0", - "filter-obj": "^5.0.0", - "find-up": "^6.3.0", - "is-plain-obj": "^4.0.0", - "locate-path": "^7.0.0", - "p-filter": "^3.0.0", - "p-locate": "^6.0.0", - "process": "^0.11.10", - "read-pkg-up": "^9.0.0", - "semver": "^7.3.8" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.45", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.45.tgz", - "integrity": "sha512-p7NQwOUmDbOG8G+J0UlMOKtTnEoaQemMCM8DgzFd4aOvlzZP870ociP/e6hfaxrq1cFB/cFGax+xfuRWAX66pA==", - "dev": true, - "dependencies": { - "@netlify/zip-it-and-ship-it": "9.28.1", - "cpy": "^9.0.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", - "integrity": "sha512-oyHieuTZH3rKTmg7EKpGEGa28IFxta2oXuVwpPJI/FJAtBje3UE+yko0eDjNufgm3AyGa8G77trUxgBhInAYuw==", - "dev": true, - "dependencies": { - "execa": "^6.0.0", - "map-obj": "^5.0.0", - "micromatch": "^4.0.2", - "moize": "^6.1.3", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy/-/local-functions-proxy-1.1.1.tgz", - "integrity": "sha512-eXSsayLT6PMvjzFQpjC9nkg2Otc3lZ5GoYele9M6f8PmsvWpaXRhwjNQ0NYhQQ2UZbLMIiO2dH8dbRsT3bMkFw==", - "dev": true, - "optionalDependencies": { - "@netlify/local-functions-proxy-darwin-arm64": "1.1.1", - "@netlify/local-functions-proxy-darwin-x64": "1.1.1", - "@netlify/local-functions-proxy-freebsd-arm64": "1.1.1", - "@netlify/local-functions-proxy-freebsd-x64": "1.1.1", - "@netlify/local-functions-proxy-linux-arm": "1.1.1", - "@netlify/local-functions-proxy-linux-arm64": "1.1.1", - "@netlify/local-functions-proxy-linux-ia32": "1.1.1", - "@netlify/local-functions-proxy-linux-ppc64": "1.1.1", - "@netlify/local-functions-proxy-linux-x64": "1.1.1", - "@netlify/local-functions-proxy-openbsd-x64": "1.1.1", - "@netlify/local-functions-proxy-win32-ia32": "1.1.1", - "@netlify/local-functions-proxy-win32-x64": "1.1.1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-arm64/-/local-functions-proxy-darwin-arm64-1.1.1.tgz", - "integrity": "sha512-lphJ9qqZ3glnKWEqlemU1LMqXxtJ/tKf7VzakqqyjigwLscXSZSb6fupSjQfd4tR1xqxA76ylws/2HDhc/gs+Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-x64/-/local-functions-proxy-darwin-x64-1.1.1.tgz", - "integrity": "sha512-4CRB0H+dXZzoEklq5Jpmg+chizXlVwCko94d8+UHWCgy/bA3M/rU/BJ8OLZisnJaAktHoeLABKtcLOhtRHpxZQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-arm64/-/local-functions-proxy-freebsd-arm64-1.1.1.tgz", - "integrity": "sha512-u13lWTVMJDF0A6jX7V4N3HYGTIHLe5d1Z2wT43fSIHwXkTs6UXi72cGSraisajG+5JFIwHfPr7asw5vxFC0P9w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-x64/-/local-functions-proxy-freebsd-x64-1.1.1.tgz", - "integrity": "sha512-g5xw4xATK5YDzvXtzJ8S1qSkWBiyF8VVRehXPMOAMzpGjCX86twYhWp8rbAk7yA1zBWmmWrWNA2Odq/MgpKJJg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm/-/local-functions-proxy-linux-arm-1.1.1.tgz", - "integrity": "sha512-YsTpL+AbHwQrfHWXmKnwUrJBjoUON363nr6jUG1ueYnpbbv6wTUA7gI5snMi/gkGpqFusBthAA7C30e6bixfiA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm64/-/local-functions-proxy-linux-arm64-1.1.1.tgz", - "integrity": "sha512-dPGu1H5n8na7mBKxiXQ+FNmthDAiA57wqgpm5JMAHtcdcmRvcXwJkwWVGvwfj8ShhYJHQaSaS9oPgO+mpKkgmA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ia32": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ia32/-/local-functions-proxy-linux-ia32-1.1.1.tgz", - "integrity": "sha512-Ra0FlXDrmPRaq+rYH3/ttkXSrwk1D5Zx/Na7UPfJZxMY7Qo5iY4bgi/FuzjzWzlp0uuKZOhYOYzYzsIIyrSvmw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ppc64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ppc64/-/local-functions-proxy-linux-ppc64-1.1.1.tgz", - "integrity": "sha512-oXf1satwqwUUxz7LHS1BxbRqc4FFEKIDFTls04eXiLReFR3sqv9H/QuYNTCCDMuRcCOd92qKyDfATdnxT4HR8w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-x64/-/local-functions-proxy-linux-x64-1.1.1.tgz", - "integrity": "sha512-bS3u4JuDg/eC0y4Na3i/29JBOxrdUvsK5JSjHfzUeZEbOcuXYf4KavTpHS5uikdvTgyczoSrvbmQJ5m0FLXfLA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-openbsd-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-openbsd-x64/-/local-functions-proxy-openbsd-x64-1.1.1.tgz", - "integrity": "sha512-1xLef/kLRNkBTXJ+ZGoRFcwsFxd/B2H3oeJZyXaZ3CN5umd9Mv9wZuAD74NuMt/535yRva8jtAJqvEgl9xMSdA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-ia32": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-ia32/-/local-functions-proxy-win32-ia32-1.1.1.tgz", - "integrity": "sha512-4IOMDBxp2f8VbIkhZ85zGNDrZR4ey8d68fCMSOIwitjsnKav35YrCf8UmAh3UR6CNIRJdJL4MW1GYePJ7iJ8uA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "bin": { - "local-functions-proxy.exe": "bin/local-functions-proxy.exe" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-x64/-/local-functions-proxy-win32-x64-1.1.1.tgz", - "integrity": "sha512-VCBXBJWBujVxyo5f+3r8ovLc9I7wJqpmgDn3ixs1fvdrER5Ac+SzYwYH4mUug9HI08mzTSAKZErzKeuadSez3w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "bin": { - "local-functions-proxy.exe": "bin/local-functions-proxy.exe" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/node-cookies": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@netlify/node-cookies/-/node-cookies-0.1.0.tgz", - "integrity": "sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==", - "dev": true, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.26.0.tgz", - "integrity": "sha512-B7q+ySzQm6rJhaGbY0Pzqnb1p3FsBqwiPLnLtA17JgTsqmXgQ7j6OQImW9fRJy/Al1ob9M6Oxng/FA2c7aIW1g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { - "version": "6.72.0", - "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.72.0.tgz", - "integrity": "sha512-GB3HxvUmOAkB6V3Tau7iQT7aH2NssmQHAgHWMrdD7pDfjcU6Vg0WcQfOWovjx2Bh6M0urOsJkBboX2egCuicEQ==", - "dev": true, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@netlify/run-utils/-/run-utils-5.1.1.tgz", - "integrity": "sha512-V2B8ZB19heVKa715uOeDkztxLH7uaqZ+9U5fV7BRzbQ2514DO5Vxj9hG0irzuRLfZXZZjp/chPUesv4VVsce/A==", - "dev": true, - "dependencies": { - "execa": "^6.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" + "dependencies": { + "find-up": "^6.3.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" }, "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "dependencies": { - "path-key": "^4.0.0" + "lowercase-keys": "^3.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "dependencies": { - "mimic-fn": "^4.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { "node": ">=12" @@ -10128,7 +9007,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/strip-final-newline": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", @@ -10140,465 +9019,400 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.1.tgz", - "integrity": "sha512-+G9cTltqfH54dF4dLqoEOV2P4qTIY8dM9blUVqg+NtVTXyuadzgpHqtffhVeyeLytVnTx1238kWJUe+sV3bnlg==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, - "dependencies": { - "@netlify/node-cookies": "^0.1.0", - "urlpattern-polyfill": "8.0.2" - }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.28.1", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.28.1.tgz", - "integrity": "sha512-cihW7K9JvlhcrhbdUO9Rhe0r5pydKr8HL++4A2/J7S4Vzl3KftBHyS7O/2Vh54+u3aMon6m4CDXWwErSwjjLNQ==", + "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.5.tgz", + "integrity": "sha512-lMNdFmy2Yu3oVquSPooRDLxJ8QOsIX6X6vzA2pKz/9V2LQFJiqBukggXM+Rnqzk1regPpdJ0jK3dPGvOKaRQgg==", "dev": true, "dependencies": { - "@babel/parser": "^7.22.5", - "@babel/types": "7.23.4", - "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.12.1", - "@vercel/nft": "^0.23.0", - "archiver": "^6.0.0", - "common-path-prefix": "^3.0.0", - "cp-file": "^10.0.0", - "es-module-lexer": "^1.0.0", - "esbuild": "0.19.6", - "execa": "^6.0.0", - "fast-glob": "^3.3.2", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "glob": "^8.0.3", - "is-builtin-module": "^3.1.0", - "is-path-inside": "^4.0.0", + "cpy": "^9.0.0", + "get-stream": "^6.0.0", + "globby": "^13.0.0", "junk": "^4.0.0", "locate-path": "^7.0.0", - "merge-options": "^3.0.4", - "minimatch": "^9.0.0", - "normalize-path": "^3.0.0", - "p-map": "^5.0.0", + "move-file": "^3.0.0", "path-exists": "^5.0.0", - "precinct": "^11.0.0", - "require-package-name": "^2.0.1", - "resolve": "^2.0.0-next.1", - "semver": "^7.3.8", - "tmp-promise": "^3.0.2", - "toml": "^3.0.0", - "unixify": "^1.0.0", - "urlpattern-polyfill": "8.0.2", - "yargs": "^17.0.0" - }, - "bin": { - "zip-it-and-ship-it": "dist/bin.js" + "readdirp": "^3.4.0" }, "engines": { - "node": "^14.18.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", - "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", - "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", - "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", - "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", - "cpu": [ - "arm64" - ], + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", - "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", - "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", - "cpu": [ - "arm64" - ], + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", - "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config": { + "version": "20.10.2", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.2.tgz", + "integrity": "sha512-Q/0GzbY+Sgp28EC/WuiKiUHEBkDhKPqm4dYWVdkNZnd7BwSpHgiLRQrVBu4rfI00DDFrHW3ulGbXfn05egtxqA==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "chalk": "^5.0.0", + "cron-parser": "^4.1.0", + "deepmerge": "^4.2.2", + "dot-prop": "^7.0.0", + "execa": "^6.0.0", + "fast-safe-stringify": "^2.0.7", + "figures": "^5.0.0", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "indent-string": "^5.0.0", + "is-plain-obj": "^4.0.0", + "js-yaml": "^4.0.0", + "map-obj": "^5.0.0", + "netlify": "^13.1.13", + "netlify-headers-parser": "^7.1.3", + "netlify-redirect-parser": "^14.2.1", + "node-fetch": "^3.3.1", + "omit.js": "^2.0.2", + "p-locate": "^6.0.0", + "path-type": "^5.0.0", + "toml": "^3.0.0", + "tomlify-j0.4": "^3.0.0", + "validate-npm-package-name": "^4.0.0", + "yargs": "^17.6.0" + }, + "bin": { + "netlify-config": "bin.js" + }, "engines": { - "node": ">=12" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", - "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", - "cpu": [ - "arm" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", - "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", - "cpu": [ - "arm64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", - "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", - "cpu": [ - "ia32" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, "engines": { - "node": ">=12" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-loong64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", - "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", - "cpu": [ - "loong64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=12" + "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", - "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", - "cpu": [ - "mips64el" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", - "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", - "cpu": [ - "ppc64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", - "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", - "cpu": [ - "riscv64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-s390x": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", - "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", - "cpu": [ - "s390x" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "path-key": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", - "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "mimic-fn": "^4.0.0" + }, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", - "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "yocto-queue": "^1.0.0" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", - "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], + "dependencies": { + "p-limit": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/sunos-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", - "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true, - "optional": true, - "os": [ - "sunos" - ], "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", - "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", - "cpu": [ - "arm64" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "optional": true, - "os": [ - "win32" - ], "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", - "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", - "cpu": [ - "ia32" - ], + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, - "optional": true, - "os": [ - "win32" - ], "engines": { - "node": ">=12" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", - "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", - "cpu": [ - "x64" - ], + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.2.0.tgz", + "integrity": "sha512-pZqBtf1qt41KZMTo0CkKMM+lfwaOMaex+52d5W+F18p92VPypudLJ+7uRp+M7ztvBBTmxeiD8dxI3Bs34x7K9w==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@import-maps/resolve": "^1.0.1", + "@vercel/nft": "^0.26.0", + "ajv": "^8.11.2", + "ajv-errors": "^3.0.0", + "better-ajv-errors": "^1.2.0", + "common-path-prefix": "^3.0.0", + "env-paths": "^3.0.0", + "esbuild": "0.19.11", + "execa": "^6.0.0", + "find-up": "^6.3.0", + "get-package-name": "^2.2.0", + "get-port": "^6.1.2", + "is-path-inside": "^4.0.0", + "jsonc-parser": "^3.2.0", + "node-fetch": "^3.1.1", + "node-stream-zip": "^1.15.0", + "p-retry": "^5.1.1", + "p-wait-for": "^4.1.0", + "path-key": "^4.0.0", + "regexp-tree": "^0.1.24", + "semver": "^7.3.8", + "tmp-promise": "^3.0.3", + "urlpattern-polyfill": "8.0.2", + "uuid": "^9.0.0" + }, "engines": { - "node": ">=12" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { + "version": "0.26.2", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.2.tgz", + "integrity": "sha512-bxe2iShmKZi7476xYamyKvhhKwQ6JPEtQ2FSq1AjMUH2buMd8LQMkdoHinTqZYc+1sMTh3G0ARdjzNvV1FEisA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/esbuild": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", - "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", - "dev": true, - "hasInstallScript": true, + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "acorn-import-attributes": "^1.9.2", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" + }, "bin": { - "esbuild": "bin/esbuild" + "nft": "out/cli.js" }, "engines": { - "node": ">=12" + "node": ">=16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "optionalDependencies": { - "@esbuild/android-arm": "0.19.6", - "@esbuild/android-arm64": "0.19.6", - "@esbuild/android-x64": "0.19.6", - "@esbuild/darwin-arm64": "0.19.6", - "@esbuild/darwin-x64": "0.19.6", - "@esbuild/freebsd-arm64": "0.19.6", - "@esbuild/freebsd-x64": "0.19.6", - "@esbuild/linux-arm": "0.19.6", - "@esbuild/linux-arm64": "0.19.6", - "@esbuild/linux-ia32": "0.19.6", - "@esbuild/linux-loong64": "0.19.6", - "@esbuild/linux-mips64el": "0.19.6", - "@esbuild/linux-ppc64": "0.19.6", - "@esbuild/linux-riscv64": "0.19.6", - "@esbuild/linux-s390x": "0.19.6", - "@esbuild/linux-x64": "0.19.6", - "@esbuild/netbsd-x64": "0.19.6", - "@esbuild/openbsd-x64": "0.19.6", - "@esbuild/sunos-x64": "0.19.6", - "@esbuild/win32-arm64": "0.19.6", - "@esbuild/win32-ia32": "0.19.6", - "@esbuild/win32-x64": "0.19.6" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/execa": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "dev": true, + "peerDependencies": { + "ajv": "^8.0.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", @@ -10621,54 +9435,19 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/human-signals": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", @@ -10677,7 +9456,7 @@ "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/is-path-inside": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", @@ -10689,25 +9468,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dev": true, "dependencies": { "path-key": "^4.0.0" @@ -10719,7 +9507,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/onetime": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", @@ -10734,16 +9522,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/strip-final-newline": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "dev": true, + "dependencies": { + "p-timeout": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", @@ -10755,1424 +9561,1414 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/netlify-cli/node_modules/@netlify/framework-info": { + "version": "9.8.10", + "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.10.tgz", + "integrity": "sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "ajv": "^8.12.0", + "filter-obj": "^5.0.0", + "find-up": "^6.3.0", + "is-plain-obj": "^4.0.0", + "locate-path": "^7.0.0", + "p-filter": "^3.0.0", + "p-locate": "^6.0.0", + "process": "^0.11.10", + "read-pkg-up": "^9.0.0", + "semver": "^7.3.8" }, "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" + "node": "^14.14.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/netlify-cli/node_modules/@octokit/auth-token": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", - "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, "dependencies": { - "@octokit/types": "^7.0.0" + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">= 14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz", - "integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==", + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, "dependencies": { - "@octokit/auth-token": "^3.0.0", - "@octokit/graphql": "^5.0.0", - "@octokit/request": "^6.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^9.0.0", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" + "p-limit": "^4.0.0" }, "engines": { - "node": ">= 14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/endpoint": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", - "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { + "version": "5.2.46", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.46.tgz", + "integrity": "sha512-fbruHy8nQRhqJ1jCsQN1kU6tZIYQvdSwYZkgkj5r6/rsyzZe5F0gaIE8FmlkUCSmw38GOPUuk78jR2MCmwNzGw==", "dev": true, "dependencies": { - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" + "@netlify/zip-it-and-ship-it": "9.28.2", + "cpy": "^9.0.0", + "path-exists": "^5.0.0" }, "engines": { - "node": ">= 14" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@octokit/graphql": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", - "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "dependencies": { - "@octokit/request": "^6.0.0", - "@octokit/types": "^7.0.0", - "universal-user-agent": "^6.0.0" - }, "engines": { - "node": ">= 14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { - "version": "13.13.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", - "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", - "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", + "integrity": "sha512-oyHieuTZH3rKTmg7EKpGEGa28IFxta2oXuVwpPJI/FJAtBje3UE+yko0eDjNufgm3AyGa8G77trUxgBhInAYuw==", "dev": true, "dependencies": { - "@octokit/tsconfig": "^1.0.2", - "@octokit/types": "^9.2.3" + "execa": "^6.0.0", + "map-obj": "^5.0.0", + "micromatch": "^4.0.2", + "moize": "^6.1.3", + "path-exists": "^5.0.0" }, "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "@octokit/core": ">=4" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "peerDependencies": { - "@octokit/core": ">=3" + "engines": { + "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz", - "integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "dependencies": { - "@octokit/types": "^9.2.3", - "deprecation": "^2.3.1" - }, "engines": { - "node": ">= 14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@octokit/core": ">=3" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/request": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", - "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { - "@octokit/endpoint": "^7.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">= 14" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/request-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", - "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, "engines": { - "node": ">= 14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@octokit/rest": { - "version": "19.0.13", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", - "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "dependencies": { - "@octokit/core": "^4.2.1", - "@octokit/plugin-paginate-rest": "^6.1.2", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^7.1.2" - }, "engines": { - "node": ">= 14" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@octokit/tsconfig": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", - "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", - "dev": true + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy/-/local-functions-proxy-1.1.1.tgz", + "integrity": "sha512-eXSsayLT6PMvjzFQpjC9nkg2Otc3lZ5GoYele9M6f8PmsvWpaXRhwjNQ0NYhQQ2UZbLMIiO2dH8dbRsT3bMkFw==", + "dev": true, + "optionalDependencies": { + "@netlify/local-functions-proxy-darwin-arm64": "1.1.1", + "@netlify/local-functions-proxy-darwin-x64": "1.1.1", + "@netlify/local-functions-proxy-freebsd-arm64": "1.1.1", + "@netlify/local-functions-proxy-freebsd-x64": "1.1.1", + "@netlify/local-functions-proxy-linux-arm": "1.1.1", + "@netlify/local-functions-proxy-linux-arm64": "1.1.1", + "@netlify/local-functions-proxy-linux-ia32": "1.1.1", + "@netlify/local-functions-proxy-linux-ppc64": "1.1.1", + "@netlify/local-functions-proxy-linux-x64": "1.1.1", + "@netlify/local-functions-proxy-openbsd-x64": "1.1.1", + "@netlify/local-functions-proxy-win32-ia32": "1.1.1", + "@netlify/local-functions-proxy-win32-x64": "1.1.1" + } }, - "node_modules/netlify-cli/node_modules/@octokit/types": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", - "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-arm64/-/local-functions-proxy-darwin-arm64-1.1.1.tgz", + "integrity": "sha512-lphJ9qqZ3glnKWEqlemU1LMqXxtJ/tKf7VzakqqyjigwLscXSZSb6fupSjQfd4tR1xqxA76ylws/2HDhc/gs+Q==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@octokit/openapi-types": "^13.11.0" + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/api": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", - "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-x64/-/local-functions-proxy-darwin-x64-1.1.1.tgz", + "integrity": "sha512-4CRB0H+dXZzoEklq5Jpmg+chizXlVwCko94d8+UHWCgy/bA3M/rU/BJ8OLZisnJaAktHoeLABKtcLOhtRHpxZQ==", + "cpu": [ + "x64" + ], "dev": true, - "engines": { - "node": ">=8.0.0" + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/api-logs": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.41.2.tgz", - "integrity": "sha512-JEV2RAqijAFdWeT6HddYymfnkiRu2ASxoTBr4WsnGJhOjWZkEy6vp+Sx9ozr1NaIODOa2HUyckExIqQjn6qywQ==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-arm64/-/local-functions-proxy-freebsd-arm64-1.1.1.tgz", + "integrity": "sha512-u13lWTVMJDF0A6jX7V4N3HYGTIHLe5d1Z2wT43fSIHwXkTs6UXi72cGSraisajG+5JFIwHfPr7asw5vxFC0P9w==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" + "optional": true, + "os": [ + "freebsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/context-async-hooks": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.13.0.tgz", - "integrity": "sha512-pS5fU4lrRjOIPZQqA2V1SUM9QUFXbO+8flubAiy6ntLjnAjJJUdRFOUOxK6v86ZHI2p2S8A0vD0BTu95FZYvjA==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-x64/-/local-functions-proxy-freebsd-x64-1.1.1.tgz", + "integrity": "sha512-g5xw4xATK5YDzvXtzJ8S1qSkWBiyF8VVRehXPMOAMzpGjCX86twYhWp8rbAk7yA1zBWmmWrWNA2Odq/MgpKJJg==", + "cpu": [ + "x64" + ], "dev": true, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "optional": true, + "os": [ + "freebsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/core": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.13.0.tgz", - "integrity": "sha512-2dBX3Sj99H96uwJKvc2w9NOiNgbvAO6mOFJFramNkKfS9O4Um+VWgpnlAazoYjT6kUJ1MP70KQ5ngD4ed+4NUw==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm/-/local-functions-proxy-linux-arm-1.1.1.tgz", + "integrity": "sha512-YsTpL+AbHwQrfHWXmKnwUrJBjoUON363nr6jUG1ueYnpbbv6wTUA7gI5snMi/gkGpqFusBthAA7C30e6bixfiA==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-jaeger": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-jaeger/-/exporter-jaeger-1.13.0.tgz", - "integrity": "sha512-ke/STs/erRDqKmNv6Dv+5SetXsVD+Zm1/Wo8cLdAGrZn6kG6Fyp5EXVO/BJuzx6q+jHCdODm8jV4veXl4m71nQ==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm64/-/local-functions-proxy-linux-arm64-1.1.1.tgz", + "integrity": "sha512-dPGu1H5n8na7mBKxiXQ+FNmthDAiA57wqgpm5JMAHtcdcmRvcXwJkwWVGvwfj8ShhYJHQaSaS9oPgO+mpKkgmA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0", - "jaeger-client": "^3.15.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-grpc/-/exporter-metrics-otlp-grpc-0.41.2.tgz", - "integrity": "sha512-gQuCcd5QSMkfi1XIriWAoak/vaRvFzpvtzh2hjziIvbnA3VtoGD3bDb2dzEzOA1iSWO0/tHwnBsSmmUZsETyOA==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ia32": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ia32/-/local-functions-proxy-linux-ia32-1.1.1.tgz", + "integrity": "sha512-Ra0FlXDrmPRaq+rYH3/ttkXSrwk1D5Zx/Na7UPfJZxMY7Qo5iY4bgi/FuzjzWzlp0uuKZOhYOYzYzsIIyrSvmw==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/exporter-metrics-otlp-http": "0.41.2", - "@opentelemetry/otlp-grpc-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-metrics": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ppc64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ppc64/-/local-functions-proxy-linux-ppc64-1.1.1.tgz", + "integrity": "sha512-oXf1satwqwUUxz7LHS1BxbRqc4FFEKIDFTls04eXiLReFR3sqv9H/QuYNTCCDMuRcCOd92qKyDfATdnxT4HR8w==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-x64/-/local-functions-proxy-linux-x64-1.1.1.tgz", + "integrity": "sha512-bS3u4JuDg/eC0y4Na3i/29JBOxrdUvsK5JSjHfzUeZEbOcuXYf4KavTpHS5uikdvTgyczoSrvbmQJ5m0FLXfLA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-openbsd-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-openbsd-x64/-/local-functions-proxy-openbsd-x64-1.1.1.tgz", + "integrity": "sha512-1xLef/kLRNkBTXJ+ZGoRFcwsFxd/B2H3oeJZyXaZ3CN5umd9Mv9wZuAD74NuMt/535yRva8jtAJqvEgl9xMSdA==", + "cpu": [ + "x64" + ], "dev": true, - "engines": { - "node": ">=14" + "optional": true, + "os": [ + "openbsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.41.2.tgz", - "integrity": "sha512-+YeIcL4nuldWE89K8NBLImpXCvih04u1MBnn8EzvoywG2TKR5JC3CZEPepODIxlsfGSgP8W5khCEP1NHZzftYw==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-ia32": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-ia32/-/local-functions-proxy-win32-ia32-1.1.1.tgz", + "integrity": "sha512-4IOMDBxp2f8VbIkhZ85zGNDrZR4ey8d68fCMSOIwitjsnKav35YrCf8UmAh3UR6CNIRJdJL4MW1GYePJ7iJ8uA==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-metrics": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" + "optional": true, + "os": [ + "win32" + ], + "bin": { + "local-functions-proxy.exe": "bin/local-functions-proxy.exe" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-x64/-/local-functions-proxy-win32-x64-1.1.1.tgz", + "integrity": "sha512-VCBXBJWBujVxyo5f+3r8ovLc9I7wJqpmgDn3ixs1fvdrER5Ac+SzYwYH4mUug9HI08mzTSAKZErzKeuadSez3w==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "optional": true, + "os": [ + "win32" + ], + "bin": { + "local-functions-proxy.exe": "bin/local-functions-proxy.exe" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@netlify/node-cookies": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@netlify/node-cookies/-/node-cookies-0.1.0.tgz", + "integrity": "sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==", "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/open-api": { + "version": "2.26.1", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.26.1.tgz", + "integrity": "sha512-nRppm5IhltEL82F6/dsEAJoXhgxwiXdJifGR1vogSS7VcLCobjGmaJc5702/zrsDH1y106wYlX0xKFCAf3A8XA==", "dev": true, "engines": { "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-proto/-/exporter-metrics-otlp-proto-0.39.1.tgz", - "integrity": "sha512-S+FgIhmZiFMsUivtAlCyzf3L5ezPyCqvlzt4hSZmiKs0kqapau1HS4cSpGacs9Jy499TRSNtqfjj7GxZrNIevw==", + "node_modules/netlify-cli/node_modules/@netlify/opentelemetry-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.0.1.tgz", + "integrity": "sha512-mL8vhn4tUpdkHg1+WuqEhguULNeN0kQWZtel6lFEEZ36G41Vxm1gv6n7RcOanNLHxQEnaLS4J8zRVUSuwj6iTQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/exporter-metrics-otlp-http": "0.39.1", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-proto-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-metrics": "1.13.0" + "@opentelemetry/api": "~1.6.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" + "node": ">=18.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/api-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", - "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", + "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { + "version": "6.74.0", + "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.74.0.tgz", + "integrity": "sha512-cWZ9vQ0LgKowjlSG4vkLAQ+P41aB8KFrRRId2WCvYeK3g2pUJpseceZtYzTuQvvsOtBZh5qVkqRz1Ye/AfSP+A==", "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, "engines": { - "node": ">=14" + "node": "^14.14.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/exporter-metrics-otlp-http": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.39.1.tgz", - "integrity": "sha512-Uj2i6t5v9aexV03xvVobwLV0Yxn7lQcCxBGN5KKxcs8BTZYSfjdwhrFjsOxvEQ2cXugL0aIzCuTKxrlXYTmFwA==", + "node_modules/netlify-cli/node_modules/@netlify/run-utils": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@netlify/run-utils/-/run-utils-5.1.1.tgz", + "integrity": "sha512-V2B8ZB19heVKa715uOeDkztxLH7uaqZ+9U5fV7BRzbQ2514DO5Vxj9hG0irzuRLfZXZZjp/chPUesv4VVsce/A==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-metrics": "1.13.0" + "execa": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", - "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.39.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-logs": "0.39.1", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", - "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0" + "path-key": "^4.0.0" }, "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.38.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", - "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "lodash.merge": "4.6.2" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=14" + "node": ">=12" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.41.2.tgz", - "integrity": "sha512-tRM/mq7PFj7mXCws5ICMVp/rmgU93JvZdoLE0uLj4tugNz231u2ZgeRYXulBjdeHM88ZQSsWTJMu2mvr/3JV1A==", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-grpc-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-trace-base": "1.15.2" - }, "engines": { - "node": ">=14" + "node": ">=12" }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.13.0.tgz", + "integrity": "sha512-H3SMpHw24jWjnEMqbXgILWdo3/Iv/2DRzOZZevqqEswRTOWcQJGlU35Dth72VAOxhPyWXjulogG1zJNRw8m2sQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" + "@netlify/node-cookies": "^0.1.0", + "urlpattern-polyfill": "8.0.2" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": "^14.18.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { + "version": "9.28.2", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.28.2.tgz", + "integrity": "sha512-tNv/SXjoWWwrO22fYSxYsB7oIs/h0MDYNnoy8tt/X1AyFF0qIF+7ppNZCwNzh6QGVkGwDHPRz2c6HL2k+pZLIg==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" + "@babel/parser": "^7.22.5", + "@babel/types": "7.23.5", + "@netlify/binary-info": "^1.0.0", + "@netlify/serverless-functions-api": "^1.13.0", + "@vercel/nft": "^0.23.0", + "archiver": "^6.0.0", + "common-path-prefix": "^3.0.0", + "cp-file": "^10.0.0", + "es-module-lexer": "^1.0.0", + "esbuild": "0.19.9", + "execa": "^6.0.0", + "fast-glob": "^3.3.2", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "glob": "^8.0.3", + "is-builtin-module": "^3.1.0", + "is-path-inside": "^4.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "merge-options": "^3.0.4", + "minimatch": "^9.0.0", + "normalize-path": "^3.0.0", + "p-map": "^5.0.0", + "path-exists": "^5.0.0", + "precinct": "^11.0.0", + "require-package-name": "^2.0.1", + "resolve": "^2.0.0-next.1", + "semver": "^7.3.8", + "tmp-promise": "^3.0.2", + "toml": "^3.0.0", + "unixify": "^1.0.0", + "urlpattern-polyfill": "8.0.2", + "yargs": "^17.0.0" }, - "engines": { - "node": ">=14" + "bin": { + "zip-it-and-ship-it": "dist/bin.js" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "engines": { + "node": "^14.18.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", - "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.9.tgz", + "integrity": "sha512-jkYjjq7SdsWuNI6b5quymW0oC83NN5FdRPuCbs9HZ02mfVdAP8B8eeqLSYU3gb6OJEaY5CQabtTFbqBf26H3GA==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.9.tgz", + "integrity": "sha512-q4cR+6ZD0938R19MyEW3jEsMzbb/1rulLXiNAJQADD/XYp7pT+rOS5JGxvpRW8dFDEfjW4wLgC/3FXIw4zYglQ==", + "cpu": [ + "arm64" + ], "dev": true, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.39.1.tgz", - "integrity": "sha512-AEhnJfVmo1g+7NxszAuf3c6vddld2DGH2+IM4XrPxCklucCsIpuStuC5EVZbCXXXBMpAY+n3t04QMxIQqNrcSw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.9.tgz", + "integrity": "sha512-KOqoPntWAH6ZxDwx1D6mRntIgZh9KodzgNOy5Ebt9ghzffOk9X2c1sPwtM9P+0eXbefnDhqYfkh5PLP5ULtWFA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/api-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", - "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.9.tgz", + "integrity": "sha512-KBJ9S0AFyLVx2E5D8W0vExqRW01WqRtczUZ8NRu+Pi+87opZn5tL4Y0xT0mA4FtHctd0ZgwNoN639fUUGlNIWw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.9.tgz", + "integrity": "sha512-vE0VotmNTQaTdX0Q9dOHmMTao6ObjyPm58CHZr1UK7qpNleQyxlFlNCaHsHx6Uqv86VgPmR4o2wdNq3dP1qyDQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", - "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.9.tgz", + "integrity": "sha512-uFQyd/o1IjiEk3rUHSwUKkqZwqdvuD8GevWF065eqgYfexcVkxh+IJgwTaGZVu59XczZGcN/YMh9uF1fWD8j1g==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.39.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-logs": "0.39.1", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", - "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.9.tgz", + "integrity": "sha512-WMLgWAtkdTbTu1AWacY7uoj/YtHthgqrqhf1OaEWnZb7PQgpt8eaA/F3LkV0E6K/Lc0cUr/uaVP/49iE4M4asA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.38.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", - "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.9.tgz", + "integrity": "sha512-C/ChPohUYoyUaqn1h17m/6yt6OB14hbXvT8EgM1ZWaiiTYz7nWZR0SYmMnB5BzQA4GXl3BgBO1l8MYqL/He3qw==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "lodash.merge": "4.6.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.41.2.tgz", - "integrity": "sha512-IGZga9IIckqYE3IpRE9FO9G5umabObIrChlXUHYpMJtDgx797dsb3qXCvLeuAwB+HoB8NsEZstlzmLnoa6/HmA==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.9.tgz", + "integrity": "sha512-PiPblfe1BjK7WDAKR1Cr9O7VVPqVNpwFcPWgfn4xu0eMemzRp442hXyzF/fSwgrufI66FpHOEJk0yYdPInsmyQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "@opentelemetry/otlp-proto-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-trace-base": "1.15.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ia32": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.9.tgz", + "integrity": "sha512-f37i/0zE0MjDxijkPSQw1CO/7C27Eojqb+r3BbHVxMLkj8GCa78TrBZzvPyA/FNLUMzP3eyHCVkAopkKVja+6Q==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-proto-exporter-base": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.41.2.tgz", - "integrity": "sha512-BxmEMiP6tHiFroe5/dTt9BsxCci7BTLtF7A6d4DKHLiLweWWZxQ9l7hON7qt/IhpKrQcAFD1OzZ1Gq2ZkNzhCw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-loong64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.9.tgz", + "integrity": "sha512-t6mN147pUIf3t6wUt3FeumoOTPfmv9Cc6DQlsVBpB7eCpLOqQDyWBP1ymXn1lDw4fNUSb/gBcKAmvTP49oIkaA==", + "cpu": [ + "loong64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "protobufjs": "^7.2.3" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.9.tgz", + "integrity": "sha512-jg9fujJTNTQBuDXdmAg1eeJUL4Jds7BklOTkkH80ZgQIoCTdQrDaHYgbFZyeTq8zbY+axgptncko3v9p5hLZtw==", + "cpu": [ + "mips64el" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", - "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.9.tgz", + "integrity": "sha512-tkV0xUX0pUUgY4ha7z5BbDS85uI7ABw3V1d0RNTii7E9lbmV8Z37Pup2tsLV46SQWzjOeyDi1Q7Wx2+QM8WaCQ==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.9.tgz", + "integrity": "sha512-DfLp8dj91cufgPZDXr9p3FoR++m3ZJ6uIXsXrIvJdOjXVREtXuQCjfMfvmc3LScAVmLjcfloyVtpn43D56JFHg==", + "cpu": [ + "riscv64" + ], "dev": true, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.13.0.tgz", - "integrity": "sha512-4IuUmYEhlHm8tAGtd6KKkktEO9Bt7dpdBdAPVAzhmXsPwGi0yExo7E5qfi9HtHQcdfP9SnrGRkeorVtrZkGlhg==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-s390x": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.9.tgz", + "integrity": "sha512-zHbglfEdC88KMgCWpOl/zc6dDYJvWGLiUtmPRsr1OgCViu3z5GncvNVdf+6/56O2Ca8jUU+t1BW261V6kp8qdw==", + "cpu": [ + "s390x" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.39.1.tgz", - "integrity": "sha512-s7/9tPmM0l5KCd07VQizC4AO2/5UJdkXq5gMSHPdCeiMKSeBEdyDyQX7A+Cq+RYZM452qzFmrJ4ut628J5bnSg==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.9.tgz", + "integrity": "sha512-JUjpystGFFmNrEHQnIVG8hKwvA2DN5o7RqiO1CVX8EN/F/gkCjkUMgVn6hzScpwnJtl2mPR6I9XV1oW8k9O+0A==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "require-in-the-middle": "^7.1.0", - "semver": "^7.3.2", - "shimmer": "^1.2.1" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.41.2.tgz", - "integrity": "sha512-pfwa6d+Dax3itZcGWiA0AoXeVaCuZbbqUTsCtOysd2re8C2PWXNxDONUfBWsn+KgxAdi+ljwTjJGiaVLDaIEvQ==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.9.tgz", + "integrity": "sha512-GThgZPAwOBOsheA2RUlW5UeroRfESwMq/guy8uEe3wJlAOjpOXuSevLRd70NZ37ZrpO6RHGHgEHvPg1h3S1Jug==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2" - }, + "optional": true, + "os": [ + "netbsd" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.9.tgz", + "integrity": "sha512-Ki6PlzppaFVbLnD8PtlVQfsYw4S9n3eQl87cqgeIw+O3sRr9IghpfSKY62mggdt1yCSZ8QWvTZ9jo9fjDSg9uw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/sunos-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.9.tgz", + "integrity": "sha512-MLHj7k9hWh4y1ddkBpvRj2b9NCBhfgBt3VpWbHQnXRedVun/hC7sIyTGDGTfsGuXo4ebik2+3ShjcPbhtFwWDw==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.41.2.tgz", - "integrity": "sha512-OErK8dYjXG01XIMIpmOV2SzL9ctkZ0Nyhf2UumICOAKtgLvR5dG1JMlsNVp8Jn0RzpsKc6Urv7JpP69wzRXN+A==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-arm64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.9.tgz", + "integrity": "sha512-GQoa6OrQ8G08guMFgeXPH7yE/8Dt0IfOGWJSfSH4uafwdC7rWwrfE6P9N8AtPGIjUzdo2+7bN8Xo3qC578olhg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "protobufjs": "^7.2.3" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-ia32": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.9.tgz", + "integrity": "sha512-UOozV7Ntykvr5tSOlGCrqU3NBr3d8JqPes0QWN2WOXfvkWVGRajC+Ym0/Wj88fUgecUCLDdJPDF0Nna2UK3Qtg==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-x64": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.9.tgz", + "integrity": "sha512-oxoQgglOP7RH6iasDrhY+R/3cHrfwIDvRlT4CGChflq6twk8iENeVvMJjmvBb94Ik1Z+93iGO27err7w6l54GQ==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=14" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.39.1.tgz", - "integrity": "sha512-VssdfGYu6LkSliQATdkvoP8lPSQuNLENRdHTUOV2veF4iqY/UpxBFFlkarY29W+MYjWXIBfYntgNjQvcn78A+w==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "protobufjs": "^7.1.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/esbuild": { + "version": "0.19.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.9.tgz", + "integrity": "sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==", "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" }, "engines": { - "node": ">=14" + "node": ">=12" }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "optionalDependencies": { + "@esbuild/android-arm": "0.19.9", + "@esbuild/android-arm64": "0.19.9", + "@esbuild/android-x64": "0.19.9", + "@esbuild/darwin-arm64": "0.19.9", + "@esbuild/darwin-x64": "0.19.9", + "@esbuild/freebsd-arm64": "0.19.9", + "@esbuild/freebsd-x64": "0.19.9", + "@esbuild/linux-arm": "0.19.9", + "@esbuild/linux-arm64": "0.19.9", + "@esbuild/linux-ia32": "0.19.9", + "@esbuild/linux-loong64": "0.19.9", + "@esbuild/linux-mips64el": "0.19.9", + "@esbuild/linux-ppc64": "0.19.9", + "@esbuild/linux-riscv64": "0.19.9", + "@esbuild/linux-s390x": "0.19.9", + "@esbuild/linux-x64": "0.19.9", + "@esbuild/netbsd-x64": "0.19.9", + "@esbuild/openbsd-x64": "0.19.9", + "@esbuild/sunos-x64": "0.19.9", + "@esbuild/win32-arm64": "0.19.9", + "@esbuild/win32-ia32": "0.19.9", + "@esbuild/win32-x64": "0.19.9" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.41.2.tgz", - "integrity": "sha512-jJbPwB0tNu2v+Xi0c/v/R3YBLJKLonw1p+v3RVjT2VfzeUyzSp/tBeVdY7RZtL6dzZpA9XSmp8UEfWIFQo33yA==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, "dependencies": { - "@opentelemetry/api-logs": "0.41.2", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-logs": "0.41.2", - "@opentelemetry/sdk-metrics": "1.15.2", - "@opentelemetry/sdk-trace-base": "1.15.2" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": ">=14" + "node": ">=12" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=10" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", - "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, "engines": { - "node": ">=14" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.13.0.tgz", - "integrity": "sha512-HOo91EI4UbuG8xQVLFziTzrcIn0MJQhy8m9jorh8aonb94jFVFi3CFNIiAnIGOabmnshJLOABxpYXsiPB8Xnzg==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=14" + "node": ">=16 || 14 >=14.17" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.13.0.tgz", - "integrity": "sha512-IV9TO+u1Jzm9mUDAD3gyXf89eyvgEJUY1t+GB5QmS4wjVeWrSMUtD0JjH3yG9SNqkrQOqOGJq7YUSSetW+Lf5Q==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0" + "path-key": "^4.0.0" }, "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/resources": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.13.0.tgz", - "integrity": "sha512-euqjOkiN6xhjE//0vQYGvbStxoD/WWQRhDiO0OTLlnLBO9Yw2Gd/VoSx2H+svsebjzYk5OxLuREBmcdw6rbUNg==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=14" + "node": ">=12" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.41.2.tgz", - "integrity": "sha512-smqKIw0tTW15waj7BAPHFomii5c3aHnSE4LQYTszGoK5P9nZs8tEAIpu15UBxi3aG31ZfsLmm4EUQkjckdlFrw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2" - }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.39.1" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, "engines": { - "node": ">=14" + "node": ">=12" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">= 8" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { - "node": ">=14" + "node": ">= 8" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.2.tgz", - "integrity": "sha512-9aIlcX8GnhcsAHW/Wl8bzk4ZnWTpNlLtud+fxUfBtFATu6OZ6TrGrF4JkT9EVrnoxwtPIDtjHdEsSjOqisY/iA==", + "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "lodash.merge": "^4.6.2" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "node": ">= 8" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "node_modules/netlify-cli/node_modules/@octokit/auth-token": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" + "@octokit/types": "^7.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "node_modules/netlify-cli/node_modules/@octokit/core": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz", + "integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dev": true, - "engines": { - "node": ">=14" + "dependencies": { + "@octokit/openapi-types": "^18.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.39.1.tgz", - "integrity": "sha512-qODReBGNSdfRS5gvCFj1SdiIi/3ZFTZb0H1KvWE/OrTkklyL5RhIs7vDwvEGHmha+YpUu0Y2+R2+itSBSu/jCA==", + "node_modules/netlify-cli/node_modules/@octokit/endpoint": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", + "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/exporter-jaeger": "1.13.0", - "@opentelemetry/exporter-trace-otlp-grpc": "0.39.1", - "@opentelemetry/exporter-trace-otlp-http": "0.39.1", - "@opentelemetry/exporter-trace-otlp-proto": "0.39.1", - "@opentelemetry/exporter-zipkin": "1.13.0", - "@opentelemetry/instrumentation": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "@opentelemetry/sdk-trace-node": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/api-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", - "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", + "node_modules/netlify-cli/node_modules/@octokit/graphql": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", + "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", "dev": true, "dependencies": { - "@opentelemetry/api": "^1.0.0" + "@octokit/request": "^6.0.0", + "@octokit/types": "^7.0.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.39.1.tgz", - "integrity": "sha512-l5RhLKx6U+yuLhMrtgavTDthX50E1mZM3/SSySC7OPZiArFHV/b/9x9jxAzrOgIQUDxyj4N0V9aLKSA2t7Qzxg==", + "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { + "version": "13.13.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", + "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", + "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", "dev": true, "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-grpc-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" + "@octokit/tsconfig": "^1.0.2", + "@octokit/types": "^9.2.3" }, "engines": { - "node": ">=14" + "node": ">= 14" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@octokit/core": ">=4" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-proto": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.39.1.tgz", - "integrity": "sha512-oJQC7a67iwExRYynKqn/O9Fl5gUjDa43ZQsZu2iKAADs/6YJ+u5MJ/wcq3CpJsn2KU/8j8HWAKOcDkkQXPuJ9A==", + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-proto-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@octokit/openapi-types": "^18.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@octokit/core": ">=3" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-grpc-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.39.1.tgz", - "integrity": "sha512-u3ErFRQqQFKjjIMuwLWxz/tLPYInfmiAmSy//fGSCzCh2ZdJgqQjMOAxBgqFtCF2xFL+OmMhyuC2ThMzceGRWA==", + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz", + "integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==", "dev": true, "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "protobufjs": "^7.2.2" + "@octokit/types": "^9.2.3", + "deprecation": "^2.3.1" }, "engines": { - "node": ">=14" + "node": ">= 14" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@octokit/core": ">=3" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", - "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dev": true, "dependencies": { - "@opentelemetry/api-logs": "0.39.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-logs": "0.39.1", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "@octokit/openapi-types": "^18.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", - "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", + "node_modules/netlify-cli/node_modules/@octokit/request": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0" + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.38.0" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", - "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", + "node_modules/netlify-cli/node_modules/@octokit/request-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "lodash.merge": "4.6.2" + "@octokit/types": "^7.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.13.0.tgz", - "integrity": "sha512-moTiQtc0uPR1hQLt6gLDJH9IIkeBhgRb71OKjNHZPE1VF45fHtD6nBDi5J/DkTHTwYP5X3kBJLa3xN7ub6J4eg==", + "node_modules/netlify-cli/node_modules/@octokit/rest": { + "version": "19.0.13", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", + "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" + "@octokit/core": "^4.2.1", + "@octokit/plugin-paginate-rest": "^6.1.2", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^7.1.2" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.13.0.tgz", - "integrity": "sha512-FXA85lXKTsnbOflA/TBuBf2pmhD3c8uDjNjG0YqK+ap8UayfALmfJhf+aG1yBOUHevCY0JXJ4/xtbXExxpsMog==", + "node_modules/netlify-cli/node_modules/@octokit/tsconfig": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", + "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/types": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", + "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", "dev": true, "dependencies": { - "@opentelemetry/context-async-hooks": "1.13.0", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/propagator-b3": "1.13.0", - "@opentelemetry/propagator-jaeger": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "semver": "^7.3.5" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "@octokit/openapi-types": "^13.11.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.13.0.tgz", - "integrity": "sha512-LMGqfSZkaMQXqewO0o1wvWr/2fQdCh4a3Sqlxka/UsJCe0cfLulh6x2aqnKLnsrSGiCq5rSCwvINd152i0nCqw==", + "node_modules/netlify-cli/node_modules/@opentelemetry/api": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.6.0.tgz", + "integrity": "sha512-OWlrQAnWn9577PhVgqjUvMr1pg57Bc4jv0iL4w0PRuOSRvq67rvHW9Ie/dZVMvCzhSCB+UxhcY/PmCmFj33Q+g==", "dev": true, "engines": { - "node": ">=14" + "node": ">=8.0.0" } }, "node_modules/netlify-cli/node_modules/@parcel/watcher": { @@ -12509,83 +11305,19 @@ "node": ">=12.22.0" } }, - "node_modules/netlify-cli/node_modules/@pnpm/npm-conf": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.0.tgz", - "integrity": "sha512-roLI1ul/GwzwcfcVpZYPdrgW2W/drLriObl1h+yLF5syc8/5ULWw2ALbCHUWF+4YltIqA3xFSbG4IwyJz37e9g==", - "dev": true, - "dependencies": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dev": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "dev": true + "node_modules/netlify-cli/node_modules/@pnpm/npm-conf": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.0.tgz", + "integrity": "sha512-roLI1ul/GwzwcfcVpZYPdrgW2W/drLriObl1h+yLF5syc8/5ULWw2ALbCHUWF+4YltIqA3xFSbG4IwyJz37e9g==", + "dev": true, + "dependencies": { + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + }, + "engines": { + "node": ">=12" + } }, "node_modules/netlify-cli/node_modules/@rollup/pluginutils": { "version": "4.2.1", @@ -13275,10 +12007,19 @@ "node": ">=0.4.0" } }, + "node_modules/netlify-cli/node_modules/acorn-import-attributes": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.2.tgz", + "integrity": "sha512-O+nfJwNolEA771IYJaiLWK1UAwjNsQmZbTRqqwBYxCgVQTmpFEMvBw6LOIQV0Me339L5UMVYFyRohGnGlQDdIQ==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, "node_modules/netlify-cli/node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -13430,15 +12171,6 @@ "string-width": "^4.1.0" } }, - "node_modules/netlify-cli/node_modules/ansi-color": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", - "integrity": "sha512-bF6xLaZBLpOQzgYUtYEhJx090nPSZk1BQ/q2oyBK9aMMcJHzx9uXGCjI2Y+LebsN4Jwoykr0V9whbPiogdyHoQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/netlify-cli/node_modules/ansi-escapes": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", @@ -13749,12 +12481,6 @@ "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", "dev": true }, - "node_modules/netlify-cli/node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, "node_modules/netlify-cli/node_modules/atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -13787,17 +12513,6 @@ "fastq": "^1.6.1" } }, - "node_modules/netlify-cli/node_modules/axios": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", - "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/netlify-cli/node_modules/b4a": { "version": "1.6.4", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", @@ -14243,21 +12958,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/bufrw": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bufrw/-/bufrw-1.3.0.tgz", - "integrity": "sha512-jzQnSbdJqhIltU9O5KUiTtljP9ccw2u5ix59McQy4pV2xGhVLhRZIndY8GIrgh5HjXa6+QJ9AQhOd2QWQizJFQ==", - "dev": true, - "dependencies": { - "ansi-color": "^0.2.1", - "error": "^7.0.0", - "hexer": "^1.5.0", - "xtend": "^4.0.0" - }, - "engines": { - "node": ">= 0.10.x" - } - }, "node_modules/netlify-cli/node_modules/builtin-modules": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", @@ -14756,18 +13456,6 @@ "text-hex": "1.0.x" } }, - "node_modules/netlify-cli/node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/netlify-cli/node_modules/commander": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", @@ -15699,15 +14387,6 @@ "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/netlify-cli/node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -16074,16 +14753,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/error": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", - "integrity": "sha512-UtVv4l5MhijsYUxPJo4390gzfZvAnTHreNnDjnTZaKIiZ/SemXxAhBkYSKtWa5RtBXbLP8tMgn/n0RUa/H7jXw==", - "dev": true, - "dependencies": { - "string-template": "~0.2.1", - "xtend": "~4.0.0" - } - }, "node_modules/netlify-cli/node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -16114,6 +14783,44 @@ "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", "dev": true }, + "node_modules/netlify-cli/node_modules/esbuild": { + "version": "0.19.11", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz", + "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.11", + "@esbuild/android-arm": "0.19.11", + "@esbuild/android-arm64": "0.19.11", + "@esbuild/android-x64": "0.19.11", + "@esbuild/darwin-arm64": "0.19.11", + "@esbuild/darwin-x64": "0.19.11", + "@esbuild/freebsd-arm64": "0.19.11", + "@esbuild/freebsd-x64": "0.19.11", + "@esbuild/linux-arm": "0.19.11", + "@esbuild/linux-arm64": "0.19.11", + "@esbuild/linux-ia32": "0.19.11", + "@esbuild/linux-loong64": "0.19.11", + "@esbuild/linux-mips64el": "0.19.11", + "@esbuild/linux-ppc64": "0.19.11", + "@esbuild/linux-riscv64": "0.19.11", + "@esbuild/linux-s390x": "0.19.11", + "@esbuild/linux-x64": "0.19.11", + "@esbuild/netbsd-x64": "0.19.11", + "@esbuild/openbsd-x64": "0.19.11", + "@esbuild/sunos-x64": "0.19.11", + "@esbuild/win32-arm64": "0.19.11", + "@esbuild/win32-ia32": "0.19.11", + "@esbuild/win32-x64": "0.19.11" + } + }, "node_modules/netlify-cli/node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -16707,9 +15414,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -17435,20 +16142,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/netlify-cli/node_modules/form-data-encoder": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", @@ -17571,9 +16264,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -18081,33 +16774,6 @@ "node": ">= 0.4" } }, - "node_modules/netlify-cli/node_modules/hexer": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/hexer/-/hexer-1.5.0.tgz", - "integrity": "sha512-dyrPC8KzBzUJ19QTIo1gXNqIISRXQ0NwteW6OeQHRN4ZuZeHkdODfj0zHBdOlHbRY8GqbqK57C9oWSvQZizFsg==", - "dev": true, - "dependencies": { - "ansi-color": "^0.2.1", - "minimist": "^1.1.0", - "process": "^0.10.0", - "xtend": "^4.0.0" - }, - "bin": { - "hexer": "cli.js" - }, - "engines": { - "node": ">= 0.10.x" - } - }, - "node_modules/netlify-cli/node_modules/hexer/node_modules/process": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", - "integrity": "sha512-dyIett8dgGIZ/TXKUzeYExt7WA6ldDzys9vTDU/cCA9L17Ypme+KzS+NjQCjpn9xsvi/shbMC+yP/BcFMBz0NA==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/netlify-cli/node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -19077,31 +17743,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/jaeger-client": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/jaeger-client/-/jaeger-client-3.19.0.tgz", - "integrity": "sha512-M0c7cKHmdyEUtjemnJyx/y9uX16XHocL46yQvyqDlPdvAcwPDbHrIbKjQdBqtiE4apQ/9dmr+ZLJYYPGnurgpw==", - "dev": true, - "dependencies": { - "node-int64": "^0.4.0", - "opentracing": "^0.14.4", - "thriftrw": "^3.5.0", - "uuid": "^8.3.2", - "xorshift": "^1.1.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/jaeger-client/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/netlify-cli/node_modules/jest-get-type": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", @@ -19657,12 +18298,6 @@ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true }, - "node_modules/netlify-cli/node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true - }, "node_modules/netlify-cli/node_modules/lodash.deburr": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", @@ -19693,12 +18328,6 @@ "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", "dev": true }, - "node_modules/netlify-cli/node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "node_modules/netlify-cli/node_modules/lodash.transform": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", @@ -19921,12 +18550,6 @@ "triple-beam": "^1.3.0" } }, - "node_modules/netlify-cli/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true - }, "node_modules/netlify-cli/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -20341,12 +18964,6 @@ "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/module-details-from-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", - "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", - "dev": true - }, "node_modules/netlify-cli/node_modules/moize": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/moize/-/moize-6.1.3.tgz", @@ -20444,9 +19061,9 @@ "optional": true }, "node_modules/netlify-cli/node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { @@ -20505,12 +19122,12 @@ "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.11", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.11.tgz", - "integrity": "sha512-exrD6cqwo5avDNtU7YT9iuN0+yoW+aaEUxvr/39oP36wZRKreoPm6KNVisTR9d4lXrPeUG8XI+rERuLhwMQmdw==", + "version": "13.1.13", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.13.tgz", + "integrity": "sha512-nemPkZNyuVfItsw9qaRij8ZFJp0IlFT1/RdGd5P/JNlJ3eS1cMGqMP80vfOUhe6IlpKggRuYZausN1qZUryxFA==", "dev": true, "dependencies": { - "@netlify/open-api": "^2.26.0", + "@netlify/open-api": "^2.26.1", "lodash-es": "^4.17.21", "micro-api-client": "^3.3.0", "node-fetch": "^3.0.0", @@ -20523,9 +19140,9 @@ } }, "node_modules/netlify-cli/node_modules/netlify-headers-parser": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.2.tgz", - "integrity": "sha512-DfoboA8PrcLXMan3jIVyLsQtKS+nepKDx6WwZKk5EQDMr2AJoBPCtSHTOLuABzkde1UXdOITf3snmcAmzlNLqw==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.3.tgz", + "integrity": "sha512-0iR1iWbknBLv6T7zzmMR2AtfO7G/0lMajRyAX3SXhc3U3MqpXsElXinWZteMWM7KeGb7PePQgEalEkk2T6kXSw==", "dev": true, "dependencies": { "escape-string-regexp": "^5.0.0", @@ -20573,9 +19190,9 @@ } }, "node_modules/netlify-cli/node_modules/netlify-redirect-parser": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.0.tgz", - "integrity": "sha512-3Mi7sMH7XXZhjvXx/5RtJ/rU/E6zKkE4etcYQbEu8B3r872D0opoYyGdPW/MvaYQyVdfg23XEFaEI4zzQTupaw==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.1.tgz", + "integrity": "sha512-poQgLGh+YATMHatzf/1TaWcbKQIBhszebhJV7btc6Ysw4xmnUedaE8nCscfdDH2PygT6Y+IHZkyMU4gvTFffVA==", "dev": true, "dependencies": { "fast-safe-stringify": "^2.1.1", @@ -20731,12 +19348,6 @@ "node-gyp-build-test": "build-test.js" } }, - "node_modules/netlify-cli/node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true - }, "node_modules/netlify-cli/node_modules/node-source-walk": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.1.tgz", @@ -21106,15 +19717,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/opentracing": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.7.tgz", - "integrity": "sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, "node_modules/netlify-cli/node_modules/ora": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", @@ -21719,9 +20321,9 @@ } }, "node_modules/netlify-cli/node_modules/postcss": { - "version": "8.4.31", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", - "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", "dev": true, "funding": [ { @@ -21738,7 +20340,7 @@ } ], "dependencies": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -21939,30 +20541,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/netlify-cli/node_modules/protobufjs": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", - "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/netlify-cli/node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -21976,12 +20554,6 @@ "node": ">= 0.10" } }, - "node_modules/netlify-cli/node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, "node_modules/netlify-cli/node_modules/ps-list": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-8.1.0.tgz", @@ -22442,37 +21014,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/require-in-the-middle": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", - "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "module-details-from-path": "^1.0.3", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/netlify-cli/node_modules/require-in-the-middle/node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/netlify-cli/node_modules/require-package-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", @@ -22977,12 +21518,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", - "dev": true - }, "node_modules/netlify-cli/node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -23431,9 +21966,9 @@ } }, "node_modules/netlify-cli/node_modules/std-env": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", - "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, "node_modules/netlify-cli/node_modules/stdin-discarder": { @@ -23505,12 +22040,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/netlify-cli/node_modules/string-template": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", - "integrity": "sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==", - "dev": true - }, "node_modules/netlify-cli/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -23868,32 +22397,6 @@ "real-require": "^0.2.0" } }, - "node_modules/netlify-cli/node_modules/thriftrw": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/thriftrw/-/thriftrw-3.11.4.tgz", - "integrity": "sha512-UcuBd3eanB3T10nXWRRMwfwoaC6VMk7qe3/5YIWP2Jtw+EbHqJ0p1/K3x8ixiR5dozKSSfcg1W+0e33G1Di3XA==", - "dev": true, - "dependencies": { - "bufrw": "^1.2.1", - "error": "7.0.2", - "long": "^2.4.0" - }, - "bin": { - "thrift2json": "thrift2json.js" - }, - "engines": { - "node": ">= 0.10.x" - } - }, - "node_modules/netlify-cli/node_modules/thriftrw/node_modules/long": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", - "integrity": "sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/netlify-cli/node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -25080,12 +23583,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/xorshift": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/xorshift/-/xorshift-1.2.0.tgz", - "integrity": "sha512-iYgNnGyeeJ4t6U11NpA/QiKy+PXn5Aa3Azg5qkwIFz1tBLllQrjjsk9yzD7IAK0naNU4JxdeDgqW9ov4u/hc4g==", - "dev": true - }, "node_modules/netlify-cli/node_modules/xss": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", @@ -28222,12 +26719,6 @@ "inBundle": true, "license": "ISC" }, - "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", - "dev": true - }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -28859,12 +27350,12 @@ "dev": true }, "node_modules/playwright": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", - "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.1.tgz", + "integrity": "sha512-gdZAWG97oUnbBdRL3GuBvX3nDDmUOuqzV/D24dytqlKt+eI5KbwusluZRGljx1YoJKZ2NRPaeWiFTeGZO7SosQ==", "dev": true, "dependencies": { - "playwright-core": "1.40.1" + "playwright-core": "1.41.1" }, "bin": { "playwright": "cli.js" @@ -28877,9 +27368,9 @@ } }, "node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.1.tgz", + "integrity": "sha512-/KPO5DzXSMlxSX77wy+HihKGOunh3hqndhqeo/nMxfigiKzogn8kfL0ZBDu0L1RKgan5XHCPmn6zXd2NUJgjhg==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -29613,6 +28104,15 @@ "node": ">=0.10.0" } }, + "node_modules/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==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -31835,9 +30335,9 @@ } }, "node_modules/vite-node": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.1.1.tgz", - "integrity": "sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.1.tgz", + "integrity": "sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -32319,17 +30819,17 @@ } }, "node_modules/vitest": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.1.1.tgz", - "integrity": "sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.1.tgz", + "integrity": "sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA==", "dev": true, "dependencies": { - "@vitest/expect": "1.1.1", - "@vitest/runner": "1.1.1", - "@vitest/snapshot": "1.1.1", - "@vitest/spy": "1.1.1", - "@vitest/utils": "1.1.1", - "acorn-walk": "^8.3.0", + "@vitest/expect": "1.2.1", + "@vitest/runner": "1.2.1", + "@vitest/snapshot": "1.2.1", + "@vitest/spy": "1.2.1", + "@vitest/utils": "1.2.1", + "acorn-walk": "^8.3.2", "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", @@ -32343,7 +30843,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.1", "vite": "^5.0.0", - "vite-node": "1.1.1", + "vite-node": "1.2.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -32385,9 +30885,9 @@ } }, "node_modules/vitest/node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz", - "integrity": "sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz", + "integrity": "sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==", "cpu": [ "arm" ], @@ -32398,9 +30898,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz", - "integrity": "sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.5.tgz", + "integrity": "sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg==", "cpu": [ "arm64" ], @@ -32411,9 +30911,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz", - "integrity": "sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.5.tgz", + "integrity": "sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w==", "cpu": [ "arm64" ], @@ -32424,9 +30924,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz", - "integrity": "sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.5.tgz", + "integrity": "sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA==", "cpu": [ "x64" ], @@ -32437,9 +30937,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz", - "integrity": "sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.5.tgz", + "integrity": "sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g==", "cpu": [ "arm" ], @@ -32450,9 +30950,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz", - "integrity": "sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.5.tgz", + "integrity": "sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA==", "cpu": [ "arm64" ], @@ -32463,9 +30963,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz", - "integrity": "sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.5.tgz", + "integrity": "sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ==", "cpu": [ "arm64" ], @@ -32476,9 +30976,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz", - "integrity": "sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz", + "integrity": "sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==", "cpu": [ "x64" ], @@ -32489,9 +30989,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz", - "integrity": "sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.5.tgz", + "integrity": "sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg==", "cpu": [ "x64" ], @@ -32502,9 +31002,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz", - "integrity": "sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.5.tgz", + "integrity": "sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ==", "cpu": [ "arm64" ], @@ -32515,9 +31015,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz", - "integrity": "sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.5.tgz", + "integrity": "sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA==", "cpu": [ "ia32" ], @@ -32528,9 +31028,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz", - "integrity": "sha512-SYRedJi+mweatroB+6TTnJYLts0L0bosg531xnQWtklOI6dezEagx4Q0qDyvRdK+qgdA3YZpjjGuPFtxBmddBA==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.5.tgz", + "integrity": "sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ==", "cpu": [ "x64" ], @@ -32541,10 +31041,13 @@ ] }, "node_modules/vitest/node_modules/rollup": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.2.tgz", - "integrity": "sha512-66RB8OtFKUTozmVEh3qyNfH+b+z2RXBVloqO2KCC/pjFaGaHtxP9fVfOQKPSGXg2mElmjmxjW/fZ7iKrEpMH5Q==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.5.tgz", + "integrity": "sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ==", "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, "bin": { "rollup": "dist/bin/rollup" }, @@ -32553,26 +31056,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.2", - "@rollup/rollup-android-arm64": "4.9.2", - "@rollup/rollup-darwin-arm64": "4.9.2", - "@rollup/rollup-darwin-x64": "4.9.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.2", - "@rollup/rollup-linux-arm64-gnu": "4.9.2", - "@rollup/rollup-linux-arm64-musl": "4.9.2", - "@rollup/rollup-linux-riscv64-gnu": "4.9.2", - "@rollup/rollup-linux-x64-gnu": "4.9.2", - "@rollup/rollup-linux-x64-musl": "4.9.2", - "@rollup/rollup-win32-arm64-msvc": "4.9.2", - "@rollup/rollup-win32-ia32-msvc": "4.9.2", - "@rollup/rollup-win32-x64-msvc": "4.9.2", + "@rollup/rollup-android-arm-eabi": "4.9.5", + "@rollup/rollup-android-arm64": "4.9.5", + "@rollup/rollup-darwin-arm64": "4.9.5", + "@rollup/rollup-darwin-x64": "4.9.5", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.5", + "@rollup/rollup-linux-arm64-gnu": "4.9.5", + "@rollup/rollup-linux-arm64-musl": "4.9.5", + "@rollup/rollup-linux-riscv64-gnu": "4.9.5", + "@rollup/rollup-linux-x64-gnu": "4.9.5", + "@rollup/rollup-linux-x64-musl": "4.9.5", + "@rollup/rollup-win32-arm64-msvc": "4.9.5", + "@rollup/rollup-win32-ia32-msvc": "4.9.5", + "@rollup/rollup-win32-x64-msvc": "4.9.5", "fsevents": "~2.3.2" } }, "node_modules/vitest/node_modules/vite": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz", - "integrity": "sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", + "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", "dev": true, "dependencies": { "esbuild": "^0.19.3", @@ -33068,27 +31571,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "devOptional": true }, - "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/xml-name-validator": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", diff --git a/package.json b/package.json index 9866d84..72e6293 100644 --- a/package.json +++ b/package.json @@ -32,15 +32,15 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.40.1", + "@playwright/test": "1.41.1", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.1.2", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.10.6", - "jsdom": "23.0.1", + "@types/node": "20.11.5", + "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.10.2", + "netlify-cli": "17.15.1", "shx": "0.3.4", - "vitest": "1.1.1" + "vitest": "1.2.1" } } From c9ada68d78b3b5fa55b9e94e87413da2765967c1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 21:24:29 +0000 Subject: [PATCH 03/26] chore(deps): update devdependencies-non-major --- package-lock.json | 709 +++++++++++----------------------------------- package.json | 10 +- 2 files changed, 165 insertions(+), 554 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5e63be5..cdce8b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,16 +24,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.41.1", + "@playwright/test": "1.41.2", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", + "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.5", + "@types/node": "20.11.16", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.15.1", + "netlify-cli": "17.15.7", "shx": "0.3.4", - "vitest": "1.2.1" + "vitest": "1.2.2" } }, "node_modules/@ampproject/remapping": { @@ -1223,12 +1223,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.41.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.1.tgz", - "integrity": "sha512-9g8EWTjiQ9yFBXc6HjCWe41msLpxEX0KhmfmPl9RPLJdfzL4F0lg2BdJ91O9azFdl11y1pmpwdjBiSxvqc+btw==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", + "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", "dev": true, "dependencies": { - "playwright": "1.41.1" + "playwright": "1.41.2" }, "bin": { "playwright": "cli.js" @@ -1370,9 +1370,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.5.tgz", - "integrity": "sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz", + "integrity": "sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==", "cpu": [ "riscv64" ], @@ -2011,9 +2011,9 @@ } }, "node_modules/@testing-library/react": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", - "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.1.tgz", + "integrity": "sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A==", "dev": true, "dependencies": { "@babel/runtime": "^7.12.5", @@ -2139,9 +2139,9 @@ "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" }, "node_modules/@types/node": { - "version": "20.11.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", - "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2220,13 +2220,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.1.tgz", - "integrity": "sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", + "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", "dev": true, "dependencies": { - "@vitest/spy": "1.2.1", - "@vitest/utils": "1.2.1", + "@vitest/spy": "1.2.2", + "@vitest/utils": "1.2.2", "chai": "^4.3.10" }, "funding": { @@ -2234,12 +2234,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.1.tgz", - "integrity": "sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", + "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", "dev": true, "dependencies": { - "@vitest/utils": "1.2.1", + "@vitest/utils": "1.2.2", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2263,9 +2263,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.1.tgz", - "integrity": "sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", + "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2277,9 +2277,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.1.tgz", - "integrity": "sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", + "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2289,9 +2289,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.1.tgz", - "integrity": "sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", + "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -7266,9 +7266,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.15.1", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.15.1.tgz", - "integrity": "sha512-6ADmj/3acsshJi115ONCNnl7O5guD8PrMC9sSnQKwAfe4Vc98dBb7kH/tpdMfMHimsJksaT3fsHbDmuNl0jlOw==", + "version": "17.15.7", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.15.7.tgz", + "integrity": "sha512-OxqsMSZdUt7iJDLi4WMWbDqnuzRcYim6FnmfrilzqAQ2kPRDuL9gb7/sNiSc0sKBpqhbKOoTaaECVfivTD+5xg==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7276,12 +7276,12 @@ "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", "@netlify/blobs": "6.4.2", - "@netlify/build": "29.32.1", - "@netlify/build-info": "7.11.5", - "@netlify/config": "20.10.2", - "@netlify/edge-bundler": "11.2.0", + "@netlify/build": "29.33.4", + "@netlify/build-info": "7.12.0", + "@netlify/config": "20.10.3", + "@netlify/edge-bundler": "11.2.2", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.28.2", + "@netlify/zip-it-and-ship-it": "9.29.0", "@octokit/rest": "19.0.13", "ansi-escapes": "6.2.0", "ansi-styles": "6.2.1", @@ -7346,7 +7346,7 @@ "log-symbols": "5.1.0", "log-update": "5.0.1", "multiparty": "4.2.3", - "netlify": "13.1.13", + "netlify": "13.1.14", "netlify-headers-parser": "7.1.3", "netlify-redirect-parser": "14.2.1", "netlify-redirector": "0.5.0", @@ -7562,9 +7562,9 @@ } }, "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", - "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.23.4", @@ -8460,23 +8460,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.32.1", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.32.1.tgz", - "integrity": "sha512-H+vHSucPMCNtMYVjnzPTZnbUGoIVe3vSKoS4j+AOw/Rvuhqyb0Dr/9Bhw6D3uaa3YAaJhuf09naD/9yYxzTJfg==", + "version": "29.33.4", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.33.4.tgz", + "integrity": "sha512-pB0NDP0VoBNUKpe4XnmnjmDtzRVXxJgzgZ+vk2fNmvI81Ta+fSC+oHSURaxugHKvF2yFOzFgsV8FUlIlk3o5Eg==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^6.4.2", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.10.2", - "@netlify/edge-bundler": "11.2.0", + "@netlify/config": "^20.10.3", + "@netlify/edge-bundler": "11.2.2", "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.46", + "@netlify/functions-utils": "^5.2.49", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.0.1", "@netlify/plugins-list": "^6.73.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.28.2", + "@netlify/zip-it-and-ship-it": "9.29.0", "@opentelemetry/api": "~1.6.0", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", @@ -8540,9 +8540,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.11.5.tgz", - "integrity": "sha512-uZIlBVUHgJuW46iSAEgI2WOAFFhzufhvTrLzuNsXFSo2/v79rEfjYI2lnuknkihgjVSyrmxAjMfWFzpaQjNGyQ==", + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.12.0.tgz", + "integrity": "sha512-sYL/IIWYcZIqY+8W+2AysWnHB0PG7iUSJz9yb3aGSp40WaYsrjw69GUkw6GPRkcNxS/VR8a8eHL6ISlwYw/ONw==", "dev": true, "dependencies": { "@bugsnag/js": "^7.20.0", @@ -9091,9 +9091,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.10.2", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.2.tgz", - "integrity": "sha512-Q/0GzbY+Sgp28EC/WuiKiUHEBkDhKPqm4dYWVdkNZnd7BwSpHgiLRQrVBu4rfI00DDFrHW3ulGbXfn05egtxqA==", + "version": "20.10.3", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.3.tgz", + "integrity": "sha512-MZAvf6BWMBk3MpMeqjrZoI8EUjHIVJTHSFRlRn8/QROHyUgO9XWTZL892MKJZE3mgu1YP0iQP4rVkzidAikTQA==", "dev": true, "dependencies": { "chalk": "^5.0.0", @@ -9109,7 +9109,7 @@ "is-plain-obj": "^4.0.0", "js-yaml": "^4.0.0", "map-obj": "^5.0.0", - "netlify": "^13.1.13", + "netlify": "^13.1.14", "netlify-headers-parser": "^7.1.3", "netlify-redirect-parser": "^14.2.1", "node-fetch": "^3.3.1", @@ -9327,9 +9327,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.2.0.tgz", - "integrity": "sha512-pZqBtf1qt41KZMTo0CkKMM+lfwaOMaex+52d5W+F18p92VPypudLJ+7uRp+M7ztvBBTmxeiD8dxI3Bs34x7K9w==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.2.2.tgz", + "integrity": "sha512-RrRmM/bSl9K5InIJS9BbpY89Y7Y+83DoOoKR1/PE3gy7b9FONm8Cry9/YC4y+tUUWLuUo4dgt8+/Pw0uGFyI+g==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", @@ -9647,12 +9647,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.46", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.46.tgz", - "integrity": "sha512-fbruHy8nQRhqJ1jCsQN1kU6tZIYQvdSwYZkgkj5r6/rsyzZe5F0gaIE8FmlkUCSmw38GOPUuk78jR2MCmwNzGw==", + "version": "5.2.49", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.49.tgz", + "integrity": "sha512-risycfkRDJtlJ7/ixdlOth3h92toGuvkFol15VGywstXz40icIEFEw35VZR3w6TTR64gfDo4A3s4lGDdH5UdGA==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.28.2", + "@netlify/zip-it-and-ship-it": "9.29.0", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10002,9 +10002,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.26.1", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.26.1.tgz", - "integrity": "sha512-nRppm5IhltEL82F6/dsEAJoXhgxwiXdJifGR1vogSS7VcLCobjGmaJc5702/zrsDH1y106wYlX0xKFCAf3A8XA==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.28.0.tgz", + "integrity": "sha512-lSx9yVn5mzTS7u9aevQyDRoWaHJYNl15B7CU373g8We39wW8fGh4sdNY7ciPWshf42FblOVlBdoasn/LpzquXg==", "dev": true, "engines": { "node": ">=14" @@ -10118,9 +10118,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.13.0.tgz", - "integrity": "sha512-H3SMpHw24jWjnEMqbXgILWdo3/Iv/2DRzOZZevqqEswRTOWcQJGlU35Dth72VAOxhPyWXjulogG1zJNRw8m2sQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.13.1.tgz", + "integrity": "sha512-LWi0/ku6UvkCIwlREoJc3k2y/2uTc1u2pf+ODUdCwGwtewDJW8+wduVeQYLyywWemdIdg9IoMga3Q5wW0lBitQ==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", @@ -10131,21 +10131,21 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.28.2", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.28.2.tgz", - "integrity": "sha512-tNv/SXjoWWwrO22fYSxYsB7oIs/h0MDYNnoy8tt/X1AyFF0qIF+7ppNZCwNzh6QGVkGwDHPRz2c6HL2k+pZLIg==", + "version": "9.29.0", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.0.tgz", + "integrity": "sha512-z6DxHmFmBiBRMZ1FgM/LnfnS0PFy9xdBVxk8SlzFPiNwOSQKpz1zV+DFcAfrWKEa4hvTtNzW05+teIqXRLLIqA==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", - "@babel/types": "7.23.5", + "@babel/types": "7.23.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.13.0", + "@netlify/serverless-functions-api": "^1.13.1", "@vercel/nft": "^0.23.0", "archiver": "^6.0.0", "common-path-prefix": "^3.0.0", "cp-file": "^10.0.0", "es-module-lexer": "^1.0.0", - "esbuild": "0.19.9", + "esbuild": "0.19.11", "execa": "^6.0.0", "fast-glob": "^3.3.2", "filter-obj": "^5.0.0", @@ -10177,358 +10177,6 @@ "node": "^14.18.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.9.tgz", - "integrity": "sha512-jkYjjq7SdsWuNI6b5quymW0oC83NN5FdRPuCbs9HZ02mfVdAP8B8eeqLSYU3gb6OJEaY5CQabtTFbqBf26H3GA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.9.tgz", - "integrity": "sha512-q4cR+6ZD0938R19MyEW3jEsMzbb/1rulLXiNAJQADD/XYp7pT+rOS5JGxvpRW8dFDEfjW4wLgC/3FXIw4zYglQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.9.tgz", - "integrity": "sha512-KOqoPntWAH6ZxDwx1D6mRntIgZh9KodzgNOy5Ebt9ghzffOk9X2c1sPwtM9P+0eXbefnDhqYfkh5PLP5ULtWFA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.9.tgz", - "integrity": "sha512-KBJ9S0AFyLVx2E5D8W0vExqRW01WqRtczUZ8NRu+Pi+87opZn5tL4Y0xT0mA4FtHctd0ZgwNoN639fUUGlNIWw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.9.tgz", - "integrity": "sha512-vE0VotmNTQaTdX0Q9dOHmMTao6ObjyPm58CHZr1UK7qpNleQyxlFlNCaHsHx6Uqv86VgPmR4o2wdNq3dP1qyDQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.9.tgz", - "integrity": "sha512-uFQyd/o1IjiEk3rUHSwUKkqZwqdvuD8GevWF065eqgYfexcVkxh+IJgwTaGZVu59XczZGcN/YMh9uF1fWD8j1g==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.9.tgz", - "integrity": "sha512-WMLgWAtkdTbTu1AWacY7uoj/YtHthgqrqhf1OaEWnZb7PQgpt8eaA/F3LkV0E6K/Lc0cUr/uaVP/49iE4M4asA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.9.tgz", - "integrity": "sha512-C/ChPohUYoyUaqn1h17m/6yt6OB14hbXvT8EgM1ZWaiiTYz7nWZR0SYmMnB5BzQA4GXl3BgBO1l8MYqL/He3qw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.9.tgz", - "integrity": "sha512-PiPblfe1BjK7WDAKR1Cr9O7VVPqVNpwFcPWgfn4xu0eMemzRp442hXyzF/fSwgrufI66FpHOEJk0yYdPInsmyQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ia32": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.9.tgz", - "integrity": "sha512-f37i/0zE0MjDxijkPSQw1CO/7C27Eojqb+r3BbHVxMLkj8GCa78TrBZzvPyA/FNLUMzP3eyHCVkAopkKVja+6Q==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-loong64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.9.tgz", - "integrity": "sha512-t6mN147pUIf3t6wUt3FeumoOTPfmv9Cc6DQlsVBpB7eCpLOqQDyWBP1ymXn1lDw4fNUSb/gBcKAmvTP49oIkaA==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.9.tgz", - "integrity": "sha512-jg9fujJTNTQBuDXdmAg1eeJUL4Jds7BklOTkkH80ZgQIoCTdQrDaHYgbFZyeTq8zbY+axgptncko3v9p5hLZtw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.9.tgz", - "integrity": "sha512-tkV0xUX0pUUgY4ha7z5BbDS85uI7ABw3V1d0RNTii7E9lbmV8Z37Pup2tsLV46SQWzjOeyDi1Q7Wx2+QM8WaCQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.9.tgz", - "integrity": "sha512-DfLp8dj91cufgPZDXr9p3FoR++m3ZJ6uIXsXrIvJdOjXVREtXuQCjfMfvmc3LScAVmLjcfloyVtpn43D56JFHg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-s390x": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.9.tgz", - "integrity": "sha512-zHbglfEdC88KMgCWpOl/zc6dDYJvWGLiUtmPRsr1OgCViu3z5GncvNVdf+6/56O2Ca8jUU+t1BW261V6kp8qdw==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.9.tgz", - "integrity": "sha512-JUjpystGFFmNrEHQnIVG8hKwvA2DN5o7RqiO1CVX8EN/F/gkCjkUMgVn6hzScpwnJtl2mPR6I9XV1oW8k9O+0A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.9.tgz", - "integrity": "sha512-GThgZPAwOBOsheA2RUlW5UeroRfESwMq/guy8uEe3wJlAOjpOXuSevLRd70NZ37ZrpO6RHGHgEHvPg1h3S1Jug==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.9.tgz", - "integrity": "sha512-Ki6PlzppaFVbLnD8PtlVQfsYw4S9n3eQl87cqgeIw+O3sRr9IghpfSKY62mggdt1yCSZ8QWvTZ9jo9fjDSg9uw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/sunos-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.9.tgz", - "integrity": "sha512-MLHj7k9hWh4y1ddkBpvRj2b9NCBhfgBt3VpWbHQnXRedVun/hC7sIyTGDGTfsGuXo4ebik2+3ShjcPbhtFwWDw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.9.tgz", - "integrity": "sha512-GQoa6OrQ8G08guMFgeXPH7yE/8Dt0IfOGWJSfSH4uafwdC7rWwrfE6P9N8AtPGIjUzdo2+7bN8Xo3qC578olhg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-ia32": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.9.tgz", - "integrity": "sha512-UOozV7Ntykvr5tSOlGCrqU3NBr3d8JqPes0QWN2WOXfvkWVGRajC+Ym0/Wj88fUgecUCLDdJPDF0Nna2UK3Qtg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.9.tgz", - "integrity": "sha512-oxoQgglOP7RH6iasDrhY+R/3cHrfwIDvRlT4CGChflq6twk8iENeVvMJjmvBb94Ik1Z+93iGO27err7w6l54GQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -10538,43 +10186,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/esbuild": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.9.tgz", - "integrity": "sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.19.9", - "@esbuild/android-arm64": "0.19.9", - "@esbuild/android-x64": "0.19.9", - "@esbuild/darwin-arm64": "0.19.9", - "@esbuild/darwin-x64": "0.19.9", - "@esbuild/freebsd-arm64": "0.19.9", - "@esbuild/freebsd-x64": "0.19.9", - "@esbuild/linux-arm": "0.19.9", - "@esbuild/linux-arm64": "0.19.9", - "@esbuild/linux-ia32": "0.19.9", - "@esbuild/linux-loong64": "0.19.9", - "@esbuild/linux-mips64el": "0.19.9", - "@esbuild/linux-ppc64": "0.19.9", - "@esbuild/linux-riscv64": "0.19.9", - "@esbuild/linux-s390x": "0.19.9", - "@esbuild/linux-x64": "0.19.9", - "@esbuild/netbsd-x64": "0.19.9", - "@esbuild/openbsd-x64": "0.19.9", - "@esbuild/sunos-x64": "0.19.9", - "@esbuild/win32-arm64": "0.19.9", - "@esbuild/win32-ia32": "0.19.9", - "@esbuild/win32-x64": "0.19.9" - } - }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/execa": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", @@ -19122,12 +18733,12 @@ "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.13", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.13.tgz", - "integrity": "sha512-nemPkZNyuVfItsw9qaRij8ZFJp0IlFT1/RdGd5P/JNlJ3eS1cMGqMP80vfOUhe6IlpKggRuYZausN1qZUryxFA==", + "version": "13.1.14", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.14.tgz", + "integrity": "sha512-7vSq6so7lPjr3HEpjbtLyde0F3IXOzD0ocJs3s2wnJR+nX+8pWOAVGe+KN6S98odsClJBJxCkWG2rLjTBzW9pw==", "dev": true, "dependencies": { - "@netlify/open-api": "^2.26.1", + "@netlify/open-api": "^2.28.0", "lodash-es": "^4.17.21", "micro-api-client": "^3.3.0", "node-fetch": "^3.0.0", @@ -27350,12 +26961,12 @@ "dev": true }, "node_modules/playwright": { - "version": "1.41.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.1.tgz", - "integrity": "sha512-gdZAWG97oUnbBdRL3GuBvX3nDDmUOuqzV/D24dytqlKt+eI5KbwusluZRGljx1YoJKZ2NRPaeWiFTeGZO7SosQ==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", + "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", "dev": true, "dependencies": { - "playwright-core": "1.41.1" + "playwright-core": "1.41.2" }, "bin": { "playwright": "cli.js" @@ -27368,9 +26979,9 @@ } }, "node_modules/playwright-core": { - "version": "1.41.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.1.tgz", - "integrity": "sha512-/KPO5DzXSMlxSX77wy+HihKGOunh3hqndhqeo/nMxfigiKzogn8kfL0ZBDu0L1RKgan5XHCPmn6zXd2NUJgjhg==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", + "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -29734,9 +29345,9 @@ "dev": true }, "node_modules/tinypool": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.1.tgz", - "integrity": "sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", "dev": true, "engines": { "node": ">=14.0.0" @@ -30335,9 +29946,9 @@ } }, "node_modules/vite-node": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.1.tgz", - "integrity": "sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", + "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -30819,16 +30430,16 @@ } }, "node_modules/vitest": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.1.tgz", - "integrity": "sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", + "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", "dev": true, "dependencies": { - "@vitest/expect": "1.2.1", - "@vitest/runner": "1.2.1", - "@vitest/snapshot": "1.2.1", - "@vitest/spy": "1.2.1", - "@vitest/utils": "1.2.1", + "@vitest/expect": "1.2.2", + "@vitest/runner": "1.2.2", + "@vitest/snapshot": "1.2.2", + "@vitest/spy": "1.2.2", + "@vitest/utils": "1.2.2", "acorn-walk": "^8.3.2", "cac": "^6.7.14", "chai": "^4.3.10", @@ -30841,9 +30452,9 @@ "std-env": "^3.5.0", "strip-literal": "^1.3.0", "tinybench": "^2.5.1", - "tinypool": "^0.8.1", + "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.2.1", + "vite-node": "1.2.2", "why-is-node-running": "^2.2.2" }, "bin": { @@ -30885,9 +30496,9 @@ } }, "node_modules/vitest/node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz", - "integrity": "sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", + "integrity": "sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==", "cpu": [ "arm" ], @@ -30898,9 +30509,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.5.tgz", - "integrity": "sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz", + "integrity": "sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==", "cpu": [ "arm64" ], @@ -30911,9 +30522,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.5.tgz", - "integrity": "sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz", + "integrity": "sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==", "cpu": [ "arm64" ], @@ -30924,9 +30535,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.5.tgz", - "integrity": "sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz", + "integrity": "sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==", "cpu": [ "x64" ], @@ -30937,9 +30548,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.5.tgz", - "integrity": "sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz", + "integrity": "sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==", "cpu": [ "arm" ], @@ -30950,9 +30561,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.5.tgz", - "integrity": "sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz", + "integrity": "sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==", "cpu": [ "arm64" ], @@ -30963,9 +30574,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.5.tgz", - "integrity": "sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz", + "integrity": "sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==", "cpu": [ "arm64" ], @@ -30976,9 +30587,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz", - "integrity": "sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz", + "integrity": "sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==", "cpu": [ "x64" ], @@ -30989,9 +30600,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.5.tgz", - "integrity": "sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz", + "integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==", "cpu": [ "x64" ], @@ -31002,9 +30613,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.5.tgz", - "integrity": "sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz", + "integrity": "sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==", "cpu": [ "arm64" ], @@ -31015,9 +30626,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.5.tgz", - "integrity": "sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz", + "integrity": "sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==", "cpu": [ "ia32" ], @@ -31028,9 +30639,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.5.tgz", - "integrity": "sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz", + "integrity": "sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==", "cpu": [ "x64" ], @@ -31041,9 +30652,9 @@ ] }, "node_modules/vitest/node_modules/rollup": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.5.tgz", - "integrity": "sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ==", + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", + "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -31056,19 +30667,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.5", - "@rollup/rollup-android-arm64": "4.9.5", - "@rollup/rollup-darwin-arm64": "4.9.5", - "@rollup/rollup-darwin-x64": "4.9.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.5", - "@rollup/rollup-linux-arm64-gnu": "4.9.5", - "@rollup/rollup-linux-arm64-musl": "4.9.5", - "@rollup/rollup-linux-riscv64-gnu": "4.9.5", - "@rollup/rollup-linux-x64-gnu": "4.9.5", - "@rollup/rollup-linux-x64-musl": "4.9.5", - "@rollup/rollup-win32-arm64-msvc": "4.9.5", - "@rollup/rollup-win32-ia32-msvc": "4.9.5", - "@rollup/rollup-win32-x64-msvc": "4.9.5", + "@rollup/rollup-android-arm-eabi": "4.9.6", + "@rollup/rollup-android-arm64": "4.9.6", + "@rollup/rollup-darwin-arm64": "4.9.6", + "@rollup/rollup-darwin-x64": "4.9.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", + "@rollup/rollup-linux-arm64-gnu": "4.9.6", + "@rollup/rollup-linux-arm64-musl": "4.9.6", + "@rollup/rollup-linux-riscv64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-musl": "4.9.6", + "@rollup/rollup-win32-arm64-msvc": "4.9.6", + "@rollup/rollup-win32-ia32-msvc": "4.9.6", + "@rollup/rollup-win32-x64-msvc": "4.9.6", "fsevents": "~2.3.2" } }, diff --git a/package.json b/package.json index 72e6293..5fe1dca 100644 --- a/package.json +++ b/package.json @@ -32,15 +32,15 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.41.1", + "@playwright/test": "1.41.2", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", + "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.5", + "@types/node": "20.11.16", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.15.1", + "netlify-cli": "17.15.7", "shx": "0.3.4", - "vitest": "1.2.1" + "vitest": "1.2.2" } } From bbc44a0edeb0f3374b39bac63d73a855b4d96a4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 01:50:35 +0000 Subject: [PATCH 04/26] chore(deps): update devdependencies-non-major --- package-lock.json | 73 ++++++++++++++++++++++++++--------------------- package.json | 4 +-- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index cdce8b6..0255016 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,10 +28,10 @@ "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.16", + "@types/node": "20.11.17", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.15.7", + "netlify-cli": "17.16.1", "shx": "0.3.4", "vitest": "1.2.2" } @@ -2139,9 +2139,9 @@ "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" }, "node_modules/@types/node": { - "version": "20.11.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", - "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", + "version": "20.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", + "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -7266,9 +7266,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.15.7", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.15.7.tgz", - "integrity": "sha512-OxqsMSZdUt7iJDLi4WMWbDqnuzRcYim6FnmfrilzqAQ2kPRDuL9gb7/sNiSc0sKBpqhbKOoTaaECVfivTD+5xg==", + "version": "17.16.1", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.16.1.tgz", + "integrity": "sha512-GgBNXyMiIGKjn+8ypo21tP6uGNvUtQS06rbz0sbNQy4XekcgH1ZLF9AJNq0e+XIIfcniZVtdamQs3L1uhBwkMw==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7276,12 +7276,12 @@ "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", "@netlify/blobs": "6.4.2", - "@netlify/build": "29.33.4", + "@netlify/build": "29.33.6", "@netlify/build-info": "7.12.0", - "@netlify/config": "20.10.3", + "@netlify/config": "20.11.0", "@netlify/edge-bundler": "11.2.2", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.29.0", + "@netlify/zip-it-and-ship-it": "9.29.1", "@octokit/rest": "19.0.13", "ansi-escapes": "6.2.0", "ansi-styles": "6.2.1", @@ -8460,23 +8460,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.33.4", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.33.4.tgz", - "integrity": "sha512-pB0NDP0VoBNUKpe4XnmnjmDtzRVXxJgzgZ+vk2fNmvI81Ta+fSC+oHSURaxugHKvF2yFOzFgsV8FUlIlk3o5Eg==", + "version": "29.33.6", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.33.6.tgz", + "integrity": "sha512-avgahPxfY9jeeH6ovMHeNzLvNWi6Bjh/lm0HJf+T4b5eqk3qLeqTCIcZAOiRI/4qfJ0XBOviifKy3DQMGpFwdQ==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", - "@netlify/blobs": "^6.4.2", + "@netlify/blobs": "^6.5.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.10.3", + "@netlify/config": "^20.11.0", "@netlify/edge-bundler": "11.2.2", "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.49", + "@netlify/functions-utils": "^5.2.50", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.0.1", "@netlify/plugins-list": "^6.73.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.29.0", + "@netlify/zip-it-and-ship-it": "9.29.1", "@opentelemetry/api": "~1.6.0", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", @@ -8625,6 +8625,15 @@ "node": ">= 14" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/blobs": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", + "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", + "dev": true, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", @@ -9091,9 +9100,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.10.3", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.3.tgz", - "integrity": "sha512-MZAvf6BWMBk3MpMeqjrZoI8EUjHIVJTHSFRlRn8/QROHyUgO9XWTZL892MKJZE3mgu1YP0iQP4rVkzidAikTQA==", + "version": "20.11.0", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.11.0.tgz", + "integrity": "sha512-MjWSgtVCtWpAb0CRmro0sfC6SiIJd37eRHSFggEyX9bSI8JytpDUt3J8wpiS4z+LhpFDp+IKAZ1pionbVvXiUw==", "dev": true, "dependencies": { "chalk": "^5.0.0", @@ -9647,12 +9656,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.49", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.49.tgz", - "integrity": "sha512-risycfkRDJtlJ7/ixdlOth3h92toGuvkFol15VGywstXz40icIEFEw35VZR3w6TTR64gfDo4A3s4lGDdH5UdGA==", + "version": "5.2.50", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.50.tgz", + "integrity": "sha512-XbJPdptmINULEL9YBbKMvee1/qsnjWvH4tnTpSo9yLsOx2O6/YDqU/uUNI/iJTwZp2fu7RaLI/MU6nkpCceW1g==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.29.0", + "@netlify/zip-it-and-ship-it": "9.29.1", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10118,9 +10127,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.13.1.tgz", - "integrity": "sha512-LWi0/ku6UvkCIwlREoJc3k2y/2uTc1u2pf+ODUdCwGwtewDJW8+wduVeQYLyywWemdIdg9IoMga3Q5wW0lBitQ==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.14.0.tgz", + "integrity": "sha512-HUNETLNvNiC2J+SB/YuRwJA9+agPrc0azSoWVk8H85GC+YE114hcS5JW+dstpKwVerp2xILE3vNWN7IMXP5Q5Q==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", @@ -10131,15 +10140,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.29.0", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.0.tgz", - "integrity": "sha512-z6DxHmFmBiBRMZ1FgM/LnfnS0PFy9xdBVxk8SlzFPiNwOSQKpz1zV+DFcAfrWKEa4hvTtNzW05+teIqXRLLIqA==", + "version": "9.29.1", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.1.tgz", + "integrity": "sha512-Dli45ALeBTvoedU5BGNX1yvvOw7FUm6SHzkxoUPs/4ekQTwPz9IZI35fBRRY28eNJANuZw51PRhtglIyUbYKIg==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", "@babel/types": "7.23.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.13.1", + "@netlify/serverless-functions-api": "^1.14.0", "@vercel/nft": "^0.23.0", "archiver": "^6.0.0", "common-path-prefix": "^3.0.0", diff --git a/package.json b/package.json index 5fe1dca..27da24c 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,10 @@ "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.16", + "@types/node": "20.11.17", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.15.7", + "netlify-cli": "17.16.1", "shx": "0.3.4", "vitest": "1.2.2" } From 0e7412050a6ea87d4772d8fdddacec68fd2fc158 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 19:37:06 +0000 Subject: [PATCH 05/26] chore(deps): update dependency node to v20.11.1 --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index d5a1596..2dbbe00 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.10.0 +20.11.1 From 962c702e9adc2e4659050b5100fa482dfb2feac8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Feb 2024 19:43:37 +0000 Subject: [PATCH 06/26] chore(deps): update devdependencies-non-major --- package-lock.json | 382 +++++++++++++++++++++++----------------------- package.json | 8 +- 2 files changed, 196 insertions(+), 194 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0255016..cec302a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,16 +24,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.41.2", + "@playwright/test": "1.42.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.17", + "@types/node": "20.11.20", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.16.1", + "netlify-cli": "17.17.1", "shx": "0.3.4", - "vitest": "1.2.2" + "vitest": "1.3.1" } }, "node_modules/@ampproject/remapping": { @@ -1223,12 +1223,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", - "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.0.tgz", + "integrity": "sha512-2k1HzC28Fs+HiwbJOQDUwrWMttqSLUVdjCqitBOjdCD0svWOMQUVqrXX6iFD7POps6xXAojsX/dGBpKnjZctLA==", "dev": true, "dependencies": { - "playwright": "1.41.2" + "playwright": "1.42.0" }, "bin": { "playwright": "cli.js" @@ -1370,9 +1370,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz", - "integrity": "sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", "cpu": [ "riscv64" ], @@ -2139,9 +2139,9 @@ "integrity": "sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==" }, "node_modules/@types/node": { - "version": "20.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", - "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "version": "20.11.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", + "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2220,13 +2220,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", - "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", "dev": true, "dependencies": { - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", "chai": "^4.3.10" }, "funding": { @@ -2234,12 +2234,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", - "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", "dev": true, "dependencies": { - "@vitest/utils": "1.2.2", + "@vitest/utils": "1.3.1", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2263,9 +2263,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", - "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2277,9 +2277,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", - "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2289,9 +2289,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", - "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -7266,22 +7266,22 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.16.1", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.16.1.tgz", - "integrity": "sha512-GgBNXyMiIGKjn+8ypo21tP6uGNvUtQS06rbz0sbNQy4XekcgH1ZLF9AJNq0e+XIIfcniZVtdamQs3L1uhBwkMw==", + "version": "17.17.1", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.17.1.tgz", + "integrity": "sha512-jn0KPVKDnLnpm8vytmUgG36AjdOKQVQ8qnWzm3lOPNtpX37W8j38PK/m5+C4ZXLLwVbwe8e4ZRNajDFBB3M1AA==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "dependencies": { "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", - "@netlify/blobs": "6.4.2", - "@netlify/build": "29.33.6", - "@netlify/build-info": "7.12.0", - "@netlify/config": "20.11.0", + "@netlify/blobs": "6.5.0", + "@netlify/build": "29.36.1", + "@netlify/build-info": "7.13.0", + "@netlify/config": "20.12.1", "@netlify/edge-bundler": "11.2.2", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.29.1", + "@netlify/zip-it-and-ship-it": "9.29.2", "@octokit/rest": "19.0.13", "ansi-escapes": "6.2.0", "ansi-styles": "6.2.1", @@ -7347,8 +7347,8 @@ "log-update": "5.0.1", "multiparty": "4.2.3", "netlify": "13.1.14", - "netlify-headers-parser": "7.1.3", - "netlify-redirect-parser": "14.2.1", + "netlify-headers-parser": "7.1.4", + "netlify-redirect-parser": "14.2.2", "netlify-redirector": "0.5.0", "node-fetch": "2.6.12", "node-version-alias": "3.4.1", @@ -8292,6 +8292,12 @@ "node": ">=10.10.0" } }, + "node_modules/netlify-cli/node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@import-maps/resolve": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@import-maps/resolve/-/resolve-1.0.1.tgz", @@ -8451,33 +8457,33 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.4.2.tgz", - "integrity": "sha512-MccXfC/b8vRr5FWJTvMN7L3aBgtrbhNLWQsSu802C/R2Gmlb5C9/OC0IY4i0+BEZ8rS+F4TU/8NQsVlqHHVESQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", + "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", "dev": true, "engines": { "node": "^14.16.0 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.33.6", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.33.6.tgz", - "integrity": "sha512-avgahPxfY9jeeH6ovMHeNzLvNWi6Bjh/lm0HJf+T4b5eqk3qLeqTCIcZAOiRI/4qfJ0XBOviifKy3DQMGpFwdQ==", + "version": "29.36.1", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.36.1.tgz", + "integrity": "sha512-S+zQbdw7Np4NesLK3kA1BzmNK8oijNZ13y2kknJdGLyQbz+bQxU0iMIuMyFca+6LtGPPonCFlWPz+cKe9G0/Mw==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^6.5.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.11.0", + "@netlify/config": "^20.12.1", "@netlify/edge-bundler": "11.2.2", "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.50", + "@netlify/functions-utils": "^5.2.51", "@netlify/git-utils": "^5.1.1", - "@netlify/opentelemetry-utils": "^1.0.1", - "@netlify/plugins-list": "^6.73.0", + "@netlify/opentelemetry-utils": "^1.0.2", + "@netlify/plugins-list": "^6.75.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.29.1", - "@opentelemetry/api": "~1.6.0", + "@netlify/zip-it-and-ship-it": "9.29.2", + "@opentelemetry/api": "~1.7.0", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -8531,7 +8537,7 @@ "node": "^14.16.0 || >=16.0.0" }, "peerDependencies": { - "@netlify/opentelemetry-sdk-setup": "^1.0.2" + "@netlify/opentelemetry-sdk-setup": "^1.0.3" }, "peerDependenciesMeta": { "@netlify/opentelemetry-sdk-setup": { @@ -8540,18 +8546,18 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.12.0.tgz", - "integrity": "sha512-sYL/IIWYcZIqY+8W+2AysWnHB0PG7iUSJz9yb3aGSp40WaYsrjw69GUkw6GPRkcNxS/VR8a8eHL6ISlwYw/ONw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.13.0.tgz", + "integrity": "sha512-rVwq9HGp72mLjSzmyHXMwmKBtArbZYdvLMnqIdiTOVJDOC7nL8mce1JQhHC4DI0dNe/3k3xfzceeKPeeNY993A==", "dev": true, "dependencies": { "@bugsnag/js": "^7.20.0", + "@iarna/toml": "^2.2.5", "dot-prop": "^7.2.0", "find-up": "^6.3.0", "minimatch": "^9.0.0", "read-pkg": "^7.1.0", "semver": "^7.3.8", - "toml": "^3.0.0", "yaml": "^2.1.3", "yargs": "^17.6.0" }, @@ -8625,15 +8631,6 @@ "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/blobs": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", - "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", - "dev": true, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", @@ -9100,11 +9097,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.11.0", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.11.0.tgz", - "integrity": "sha512-MjWSgtVCtWpAb0CRmro0sfC6SiIJd37eRHSFggEyX9bSI8JytpDUt3J8wpiS4z+LhpFDp+IKAZ1pionbVvXiUw==", + "version": "20.12.1", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.12.1.tgz", + "integrity": "sha512-sziuaOA9XfeQjQf6Yru7S9k9xTMy9GAJSPJL02WFld0cFDA5dgDyAFLN34jedIbgl7jVV+g7Vb2nOJocfgibbg==", "dev": true, "dependencies": { + "@iarna/toml": "^2.2.5", "chalk": "^5.0.0", "cron-parser": "^4.1.0", "deepmerge": "^4.2.2", @@ -9119,13 +9117,12 @@ "js-yaml": "^4.0.0", "map-obj": "^5.0.0", "netlify": "^13.1.14", - "netlify-headers-parser": "^7.1.3", - "netlify-redirect-parser": "^14.2.1", + "netlify-headers-parser": "^7.1.4", + "netlify-redirect-parser": "^14.2.2", "node-fetch": "^3.3.1", "omit.js": "^2.0.2", "p-locate": "^6.0.0", "path-type": "^5.0.0", - "toml": "^3.0.0", "tomlify-j0.4": "^3.0.0", "validate-npm-package-name": "^4.0.0", "yargs": "^17.6.0" @@ -9656,12 +9653,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.50", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.50.tgz", - "integrity": "sha512-XbJPdptmINULEL9YBbKMvee1/qsnjWvH4tnTpSo9yLsOx2O6/YDqU/uUNI/iJTwZp2fu7RaLI/MU6nkpCceW1g==", + "version": "5.2.51", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.51.tgz", + "integrity": "sha512-A4XLQOE2pfcOHcCTs97G6FDVQg20zGoROCAZcpnNd8bMvBDDVgziC/xoFxm4xGC36u0YogSECsLoIbSKSxLloA==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.29.1", + "@netlify/zip-it-and-ship-it": "9.29.2", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10020,21 +10017,21 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/opentelemetry-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.0.1.tgz", - "integrity": "sha512-mL8vhn4tUpdkHg1+WuqEhguULNeN0kQWZtel6lFEEZ36G41Vxm1gv6n7RcOanNLHxQEnaLS4J8zRVUSuwj6iTQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.0.2.tgz", + "integrity": "sha512-GeY5z/Af7q7DMSmJbJtrtKQaHCsw/XPdJwnryv/CqRpvg7z6rpGVH6V1UTck1Fe8BVQuB20mrb6qr4MZsAAiyg==", "dev": true, "dependencies": { - "@opentelemetry/api": "~1.6.0" + "@opentelemetry/api": "~1.7.0" }, "engines": { "node": ">=18.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { - "version": "6.74.0", - "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.74.0.tgz", - "integrity": "sha512-cWZ9vQ0LgKowjlSG4vkLAQ+P41aB8KFrRRId2WCvYeK3g2pUJpseceZtYzTuQvvsOtBZh5qVkqRz1Ye/AfSP+A==", + "version": "6.75.0", + "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.75.0.tgz", + "integrity": "sha512-xH5UWc6v6oOu53kaNhJI6o0vESVECoGBjD5hW5nmjFaIkEJFDfbtHj/gSQ2hCcwIzTlGYRGIyGVBMY+e7ki6bw==", "dev": true, "engines": { "node": "^14.14.0 || >=16.0.0" @@ -10140,9 +10137,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.29.1", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.1.tgz", - "integrity": "sha512-Dli45ALeBTvoedU5BGNX1yvvOw7FUm6SHzkxoUPs/4ekQTwPz9IZI35fBRRY28eNJANuZw51PRhtglIyUbYKIg==", + "version": "9.29.2", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", + "integrity": "sha512-9o/4lsFWuyPpe38Rhk/00JyccKSBRGM9Av3DINnh/QrpTeIC6esfJsaJNQ4JQ+gU4XXAwxPY9Uk+16WMPs/zkg==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", @@ -10583,9 +10580,9 @@ } }, "node_modules/netlify-cli/node_modules/@opentelemetry/api": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.6.0.tgz", - "integrity": "sha512-OWlrQAnWn9577PhVgqjUvMr1pg57Bc4jv0iL4w0PRuOSRvq67rvHW9Ie/dZVMvCzhSCB+UxhcY/PmCmFj33Q+g==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", "dev": true, "engines": { "node": ">=8.0.0" @@ -18760,17 +18757,17 @@ } }, "node_modules/netlify-cli/node_modules/netlify-headers-parser": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.3.tgz", - "integrity": "sha512-0iR1iWbknBLv6T7zzmMR2AtfO7G/0lMajRyAX3SXhc3U3MqpXsElXinWZteMWM7KeGb7PePQgEalEkk2T6kXSw==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.4.tgz", + "integrity": "sha512-fTVQf8u65vS4YTP2Qt1K6Np01q3yecRKXf6VMONMlWbfl5n3M/on7pZlZISNAXHNOtnVt+6Kpwfl+RIeALC8Kg==", "dev": true, "dependencies": { + "@iarna/toml": "^2.2.5", "escape-string-regexp": "^5.0.0", "fast-safe-stringify": "^2.0.7", "is-plain-obj": "^4.0.0", "map-obj": "^5.0.0", - "path-exists": "^5.0.0", - "toml": "^3.0.0" + "path-exists": "^5.0.0" }, "engines": { "node": "^14.16.0 || >=16.0.0" @@ -18810,16 +18807,16 @@ } }, "node_modules/netlify-cli/node_modules/netlify-redirect-parser": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.1.tgz", - "integrity": "sha512-poQgLGh+YATMHatzf/1TaWcbKQIBhszebhJV7btc6Ysw4xmnUedaE8nCscfdDH2PygT6Y+IHZkyMU4gvTFffVA==", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.2.tgz", + "integrity": "sha512-LS3cbHZfATtfZFeJr8RLBREAjCE1rEG1CybKnA6dTLgXez0lGJE/QTPzjn6GqfNmiMowo15YQe4+UjRhbzQ04w==", "dev": true, "dependencies": { + "@iarna/toml": "^2.2.5", "fast-safe-stringify": "^2.1.1", "filter-obj": "^5.0.0", "is-plain-obj": "^4.0.0", - "path-exists": "^5.0.0", - "toml": "^3.0.0" + "path-exists": "^5.0.0" }, "engines": { "node": "^14.16.0 || >=16.0.0" @@ -26970,12 +26967,12 @@ "dev": true }, "node_modules/playwright": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", - "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.0.tgz", + "integrity": "sha512-Ko7YRUgj5xBHbntrgt4EIw/nE//XBHOKVKnBjO1KuZkmkhlbgyggTe5s9hjqQ1LpN+Xg+kHsQyt5Pa0Bw5XpvQ==", "dev": true, "dependencies": { - "playwright-core": "1.41.2" + "playwright-core": "1.42.0" }, "bin": { "playwright": "cli.js" @@ -26988,9 +26985,9 @@ } }, "node_modules/playwright-core": { - "version": "1.41.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", - "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.0.tgz", + "integrity": "sha512-0HD9y8qEVlcbsAjdpBaFjmaTHf+1FeIddy8VJLeiqwhcNqGCBe4Wp2e8knpqiYbzxtxarxiXyNDw2cG8sCaNMQ==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -27014,9 +27011,9 @@ } }, "node_modules/postcss": { - "version": "8.4.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", - "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "funding": [ { "type": "opencollective", @@ -29160,17 +29157,23 @@ } }, "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", "dev": true, "dependencies": { - "acorn": "^8.10.0" + "js-tokens": "^8.0.2" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -29363,9 +29366,9 @@ } }, "node_modules/tinyspy": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", - "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true, "engines": { "node": ">=14.0.0" @@ -29955,9 +29958,9 @@ } }, "node_modules/vite-node": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", - "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -30439,18 +30442,17 @@ } }, "node_modules/vitest": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", - "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", "dev": true, "dependencies": { - "@vitest/expect": "1.2.2", - "@vitest/runner": "1.2.2", - "@vitest/snapshot": "1.2.2", - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", "acorn-walk": "^8.3.2", - "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", "execa": "^8.0.1", @@ -30459,11 +30461,11 @@ "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.5.0", - "strip-literal": "^1.3.0", + "strip-literal": "^2.0.0", "tinybench": "^2.5.1", "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.2.2", + "vite-node": "1.3.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -30478,8 +30480,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "^1.0.0", - "@vitest/ui": "^1.0.0", + "@vitest/browser": "1.3.1", + "@vitest/ui": "1.3.1", "happy-dom": "*", "jsdom": "*" }, @@ -30505,9 +30507,9 @@ } }, "node_modules/vitest/node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", - "integrity": "sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", "cpu": [ "arm" ], @@ -30518,9 +30520,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz", - "integrity": "sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", "cpu": [ "arm64" ], @@ -30531,9 +30533,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz", - "integrity": "sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", "cpu": [ "arm64" ], @@ -30544,9 +30546,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz", - "integrity": "sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", "cpu": [ "x64" ], @@ -30557,9 +30559,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz", - "integrity": "sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", "cpu": [ "arm" ], @@ -30570,9 +30572,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz", - "integrity": "sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", "cpu": [ "arm64" ], @@ -30583,9 +30585,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz", - "integrity": "sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", "cpu": [ "arm64" ], @@ -30596,9 +30598,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz", - "integrity": "sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", "cpu": [ "x64" ], @@ -30609,9 +30611,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz", - "integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", "cpu": [ "x64" ], @@ -30622,9 +30624,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz", - "integrity": "sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", "cpu": [ "arm64" ], @@ -30635,9 +30637,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz", - "integrity": "sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", "cpu": [ "ia32" ], @@ -30648,9 +30650,9 @@ ] }, "node_modules/vitest/node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz", - "integrity": "sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", "cpu": [ "x64" ], @@ -30661,9 +30663,9 @@ ] }, "node_modules/vitest/node_modules/rollup": { - "version": "4.9.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", - "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -30676,30 +30678,30 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.6", - "@rollup/rollup-android-arm64": "4.9.6", - "@rollup/rollup-darwin-arm64": "4.9.6", - "@rollup/rollup-darwin-x64": "4.9.6", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", - "@rollup/rollup-linux-arm64-gnu": "4.9.6", - "@rollup/rollup-linux-arm64-musl": "4.9.6", - "@rollup/rollup-linux-riscv64-gnu": "4.9.6", - "@rollup/rollup-linux-x64-gnu": "4.9.6", - "@rollup/rollup-linux-x64-musl": "4.9.6", - "@rollup/rollup-win32-arm64-msvc": "4.9.6", - "@rollup/rollup-win32-ia32-msvc": "4.9.6", - "@rollup/rollup-win32-x64-msvc": "4.9.6", + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", "fsevents": "~2.3.2" } }, "node_modules/vitest/node_modules/vite": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", - "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", "dev": true, "dependencies": { "esbuild": "^0.19.3", - "postcss": "^8.4.32", + "postcss": "^8.4.35", "rollup": "^4.2.0" }, "bin": { diff --git a/package.json b/package.json index 27da24c..bc88050 100644 --- a/package.json +++ b/package.json @@ -32,15 +32,15 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.41.2", + "@playwright/test": "1.42.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.17", + "@types/node": "20.11.20", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.16.1", + "netlify-cli": "17.17.1", "shx": "0.3.4", - "vitest": "1.2.2" + "vitest": "1.3.1" } } From 81d7c680070290504379820fc529d43cd148810a Mon Sep 17 00:00:00 2001 From: ff6347 Date: Wed, 28 Feb 2024 09:02:08 +0100 Subject: [PATCH 07/26] ci(build): Renovate node and package lock Should fix build with npm error with npm/cli/issues/4828 --- netlify.toml | 2 +- package-lock.json | 14986 +++++++++++++++++++++++++++++--------------- package.json | 8 +- 3 files changed, 9894 insertions(+), 5102 deletions(-) diff --git a/netlify.toml b/netlify.toml index 0c15c71..5655f6f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,3 @@ [build] -command = "export PUBLIC_BASE_URL=$DEPLOY_URL && npm run build" +command = "export PUBLIC_BASE_URL=$DEPLOY_URL && npm run build:netlify" publish = "dist" diff --git a/package-lock.json b/package-lock.json index d2eb812..b83ed8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,8 @@ }, "node_modules/@ampproject/remapping": { "version": "2.2.1", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -49,7 +50,8 @@ }, "node_modules/@astrojs/check": { "version": "0.3.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.3.4.tgz", + "integrity": "sha512-Wi4KwW38J3GCd/U6LH2UuU4uc4P/K1WYaqhoKm2o7rVoGhQfO+RWrSO26rUPRXYbmae8JugAgpCmsHC8bt5RlA==", "dependencies": { "@astrojs/language-server": "^2.5.5", "chokidar": "^3.5.3", @@ -65,34 +67,35 @@ } }, "node_modules/@astrojs/compiler": { - "version": "2.4.0", - "license": "MIT" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.6.0.tgz", + "integrity": "sha512-c74k8iGHL3DzkosSJ0tGcHIEBEiIfBhr7eadSaPyvWlVKaieDVzVs8OW1tnRSQyBsfMc8DZQ4RcN2KAcESD8UQ==" }, "node_modules/@astrojs/internal-helpers": { "version": "0.2.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.2.1.tgz", + "integrity": "sha512-06DD2ZnItMwUnH81LBLco3tWjcZ1lGU9rLCCBaeUCGYe9cI0wKyY2W3kDyoW1I6GmcWgt1fu+D1CTvz+FIKf8A==" }, "node_modules/@astrojs/language-server": { - "version": "2.5.5", - "license": "MIT", + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/@astrojs/language-server/-/language-server-2.7.6.tgz", + "integrity": "sha512-NhMSmMAuKBMXnvpfn9eYPR7R6zOasAjRb+ta8L+rCHHuKzUc0lBgAF5M6rx01FJqlpGqeqao13eYt4287Ze49g==", "dependencies": { - "@astrojs/compiler": "^2.2.2", + "@astrojs/compiler": "^2.4.0", "@jridgewell/sourcemap-codec": "^1.4.15", - "@volar/kit": "~1.10.9", - "@volar/language-core": "~1.10.9", - "@volar/language-server": "~1.10.9", - "@volar/language-service": "~1.10.9", - "@volar/source-map": "~1.10.9", - "@volar/typescript": "~1.10.9", + "@volar/kit": "~2.0.4", + "@volar/language-core": "~2.0.4", + "@volar/language-server": "~2.0.4", + "@volar/language-service": "~2.0.4", + "@volar/typescript": "~2.0.4", "fast-glob": "^3.2.12", - "muggle-string": "^0.3.1", - "volar-service-css": "0.0.16", - "volar-service-emmet": "0.0.16", - "volar-service-html": "0.0.16", - "volar-service-prettier": "0.0.16", - "volar-service-typescript": "0.0.16", - "volar-service-typescript-twoslash-queries": "0.0.16", - "vscode-html-languageservice": "^5.1.0", + "volar-service-css": "0.0.30", + "volar-service-emmet": "0.0.30", + "volar-service-html": "0.0.30", + "volar-service-prettier": "0.0.30", + "volar-service-typescript": "0.0.30", + "volar-service-typescript-twoslash-queries": "0.0.30", + "vscode-html-languageservice": "^5.1.2", "vscode-uri": "^3.0.8" }, "bin": { @@ -113,7 +116,8 @@ }, "node_modules/@astrojs/markdown-remark": { "version": "4.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-4.0.1.tgz", + "integrity": "sha512-RU4ESnqvyLpj8WZs0n5elS6idaDdtIIm7mIpMaRNPCebpxMjfcfdwcmBwz83ktAj5d2eO5bC3z92TcGdli+lRw==", "dependencies": { "@astrojs/prism": "^3.0.0", "github-slugger": "^2.0.0", @@ -133,7 +137,8 @@ }, "node_modules/@astrojs/prism": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.0.0.tgz", + "integrity": "sha512-g61lZupWq1bYbcBnYZqdjndShr/J3l/oFobBKPA3+qMat146zce3nz2kdO4giGbhYDt4gYdhmoBz0vZJ4sIurQ==", "dependencies": { "prismjs": "^1.29.0" }, @@ -143,7 +148,8 @@ }, "node_modules/@astrojs/react": { "version": "3.0.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-3.0.9.tgz", + "integrity": "sha512-31J5yF5p9yBFV1axBooLA9PB4B2+MYm7swWhtlezSsJiUNXRFo5Is9qI3teJ7cKgmaCv+ZA593Smskko0NGaDQ==", "dependencies": { "@vitejs/plugin-react": "^4.2.0", "ultrahtml": "^1.3.0" @@ -160,7 +166,8 @@ }, "node_modules/@astrojs/telemetry": { "version": "3.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.0.4.tgz", + "integrity": "sha512-A+0c7k/Xy293xx6odsYZuXiaHO0PL+bnDoXOc47sGDF5ffIKdKQGRPFl2NMlCF4L0NqN4Ynbgnaip+pPF0s7pQ==", "dependencies": { "ci-info": "^3.8.0", "debug": "^4.3.4", @@ -174,9 +181,24 @@ "node": ">=18.14.1" } }, + "node_modules/@astrojs/telemetry/node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, "node_modules/@babel/code-frame": { "version": "7.23.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" @@ -185,27 +207,93 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { - "version": "7.23.2", - "license": "MIT", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.5", - "license": "MIT", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", + "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.5", - "@babel/helper-compilation-targets": "^7.22.15", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.5", - "@babel/parser": "^7.23.5", - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.5", - "@babel/types": "^7.23.5", + "@babel/helpers": "^7.23.9", + "@babel/parser": "^7.23.9", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -222,16 +310,18 @@ }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.23.5", - "license": "MIT", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dependencies": { - "@babel/types": "^7.23.5", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -242,7 +332,8 @@ }, "node_modules/@babel/helper-annotate-as-pure": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -251,12 +342,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.15", - "license": "MIT", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dependencies": { - "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.15", - "browserslist": "^4.21.9", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -266,21 +358,24 @@ }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { "version": "7.23.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dependencies": { "@babel/template": "^7.22.15", "@babel/types": "^7.23.0" @@ -291,7 +386,8 @@ }, "node_modules/@babel/helper-hoist-variables": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -301,7 +397,8 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.22.15", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dependencies": { "@babel/types": "^7.22.15" }, @@ -311,7 +408,8 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -328,14 +426,16 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -345,7 +445,8 @@ }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.22.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -355,32 +456,36 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.23.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.15", - "license": "MIT", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.23.5", - "license": "MIT", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", + "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", "dependencies": { - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.5", - "@babel/types": "^7.23.5" + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" }, "engines": { "node": ">=6.9.0" @@ -388,7 +493,8 @@ }, "node_modules/@babel/highlight": { "version": "7.23.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -398,9 +504,74 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/parser": { - "version": "7.23.5", - "license": "MIT", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -409,8 +580,9 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.22.5", - "license": "MIT", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -422,14 +594,15 @@ } }, "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.22.15", - "license": "MIT", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", + "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-jsx": "^7.22.5", - "@babel/types": "^7.22.15" + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/types": "^7.23.4" }, "engines": { "node": ">=6.9.0" @@ -440,7 +613,8 @@ }, "node_modules/@babel/plugin-transform-react-jsx-self": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", + "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -453,7 +627,8 @@ }, "node_modules/@babel/plugin-transform-react-jsx-source": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", + "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -465,9 +640,10 @@ } }, "node_modules/@babel/runtime": { - "version": "7.23.2", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", + "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", "dev": true, - "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -476,30 +652,32 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "license": "MIT", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.5", - "license": "MIT", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", "dependencies": { "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.5", + "@babel/generator": "^7.23.6", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.5", - "@babel/types": "^7.23.5", - "debug": "^4.1.0", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -507,8 +685,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.5", - "license": "MIT", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -520,8 +699,9 @@ }, "node_modules/@colors/colors": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, - "license": "MIT", "optional": true, "peer": true, "engines": { @@ -530,124 +710,860 @@ }, "node_modules/@emmetio/abbreviation": { "version": "2.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz", + "integrity": "sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==", "dependencies": { "@emmetio/scanner": "^1.0.4" } }, "node_modules/@emmetio/css-abbreviation": { "version": "2.1.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz", + "integrity": "sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==", "dependencies": { "@emmetio/scanner": "^1.0.4" } }, "node_modules/@emmetio/scanner": { "version": "1.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz", + "integrity": "sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==" }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.11", + "node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", "cpu": [ - "arm64" + "ppc64" ], - "license": "MIT", "optional": true, "os": [ - "darwin" + "aix" ], "engines": { "node": ">=12" } }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.1", + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", "cpu": [ - "arm64" + "arm" ], - "license": "Apache-2.0", "optional": true, "os": [ - "darwin" + "android" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.0" + "node": ">=12" } }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.0", + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", "cpu": [ "arm64" ], - "license": "LGPL-3.0-or-later", "optional": true, "os": [ - "darwin" + "android" ], "engines": { - "macos": ">=11", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" + "node": ">=12" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "license": "MIT", + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "license": "MIT", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=6.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "license": "MIT" + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz", + "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz", + "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz", + "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz", + "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz", + "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz", + "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz", + "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz", + "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz", + "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz", + "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz", + "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz", + "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz", + "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz", + "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz", + "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz", + "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.45.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz", + "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz", + "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", + "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "license": "MIT", + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", + "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -655,7 +1571,8 @@ }, "node_modules/@monaco-editor/loader": { "version": "1.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.4.0.tgz", + "integrity": "sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==", "dependencies": { "state-local": "^1.0.6" }, @@ -665,7 +1582,8 @@ }, "node_modules/@monaco-editor/react": { "version": "4.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.6.0.tgz", + "integrity": "sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==", "dependencies": { "@monaco-editor/loader": "^1.4.0" }, @@ -677,7 +1595,8 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -688,14 +1607,16 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -706,16 +1627,18 @@ }, "node_modules/@octokit/auth-token": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@octokit/core": { - "version": "5.0.1", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", + "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.0.0", @@ -730,12 +1653,12 @@ } }, "node_modules/@octokit/endpoint": { - "version": "9.0.2", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", + "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^12.0.0", - "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" }, "engines": { @@ -744,8 +1667,9 @@ }, "node_modules/@octokit/graphql": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", + "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/request": "^8.0.1", "@octokit/types": "^12.0.0", @@ -756,14 +1680,16 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "19.0.2", - "dev": true, - "license": "MIT" + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-8.0.0.tgz", + "integrity": "sha512-2xZ+baZWUg+qudVXnnvXz7qfrTmDeYPCzangBVq/1gXxii/OiS//4shJp9dnCCvj1x+JAm9ji1Egwm1BA47lPQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^11.0.0" }, @@ -776,21 +1702,24 @@ }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", + "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/@octokit/plugin-retry": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/request-error": "^5.0.0", "@octokit/types": "^12.0.0", @@ -805,8 +1734,9 @@ }, "node_modules/@octokit/plugin-throttling": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-7.0.0.tgz", + "integrity": "sha512-KL2k/d0uANc8XqP5S64YcNFCudR3F5AaKO39XWdUtlJIjT9Ni79ekWJ6Kj5xvAw87udkOMEPcVf9xEge2+ahew==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^11.0.0", "bottleneck": "^2.15.3" @@ -820,26 +1750,28 @@ }, "node_modules/@octokit/plugin-throttling/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/@octokit/plugin-throttling/node_modules/@octokit/types": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", + "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/@octokit/request": { - "version": "8.1.4", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", + "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/endpoint": "^9.0.0", "@octokit/request-error": "^5.0.0", "@octokit/types": "^12.0.0", - "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" }, "engines": { @@ -848,8 +1780,9 @@ }, "node_modules/@octokit/request-error": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", + "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^12.0.0", "deprecation": "^2.0.0", @@ -860,17 +1793,19 @@ } }, "node_modules/@octokit/types": { - "version": "12.1.1", + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", "dev": true, - "license": "MIT", "dependencies": { - "@octokit/openapi-types": "^19.0.2" + "@octokit/openapi-types": "^20.0.0" } }, "node_modules/@playwright/test": { "version": "1.40.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", + "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "playwright": "1.40.1" }, @@ -883,16 +1818,18 @@ }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.22.0" } }, "node_modules/@pnpm/network.ca-file": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "4.2.10" }, @@ -902,13 +1839,15 @@ }, "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { "version": "4.2.10", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/@pnpm/npm-conf": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", + "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", "dev": true, - "license": "MIT", "dependencies": { "@pnpm/config.env-replace": "^1.1.0", "@pnpm/network.ca-file": "^1.0.1", @@ -918,185 +1857,237 @@ "node": ">=12" } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ] + }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.3", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "darwin" ] }, - "node_modules/@semantic-release/changelog": { - "version": "6.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "fs-extra": "^11.0.0", - "lodash": "^4.17.4" - }, - "engines": { - "node": ">=14.17" - }, - "peerDependencies": { - "semantic-release": ">=18.0.0" - } + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/@semantic-release/commit-analyzer": { - "version": "11.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "conventional-changelog-angular": "^7.0.0", - "conventional-commits-filter": "^4.0.0", - "conventional-commits-parser": "^5.0.0", - "debug": "^4.0.0", - "import-from": "^4.0.0", - "lodash-es": "^4.17.21", - "micromatch": "^4.0.2" - }, - "engines": { - "node": "^18.17 || >=20.6.1" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@semantic-release/error": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.17" - } + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@semantic-release/git": { - "version": "10.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "debug": "^4.0.0", - "dir-glob": "^3.0.0", - "execa": "^5.0.0", - "lodash": "^4.17.4", - "micromatch": "^4.0.0", - "p-reduce": "^2.0.0" - }, - "engines": { - "node": ">=14.17" - }, - "peerDependencies": { - "semantic-release": ">=18.0.0" - } + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@semantic-release/git/node_modules/execa": { - "version": "5.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@semantic-release/git/node_modules/get-stream": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@semantic-release/git/node_modules/human-signals": { - "version": "2.1.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=10.17.0" - } + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@semantic-release/git/node_modules/is-stream": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@semantic-release/git/node_modules/mimic-fn": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@semantic-release/git/node_modules/npm-run-path": { - "version": "4.0.1", + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@semantic-release/changelog": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", "dev": true, - "license": "MIT", "dependencies": { - "path-key": "^3.0.0" + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "fs-extra": "^11.0.0", + "lodash": "^4.17.4" }, "engines": { - "node": ">=8" + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" } }, - "node_modules/@semantic-release/git/node_modules/onetime": { - "version": "5.1.2", + "node_modules/@semantic-release/commit-analyzer": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-11.0.0.tgz", + "integrity": "sha512-uEXyf4Z0AWJuxI9TbSQP5kkIYqus1/E1NcmE7pIv6d6/m/5EJcNWAGR4FOo34vrV26FhEaRVkxFfYzp/M7BKIg==", "dev": true, - "license": "MIT", "dependencies": { - "mimic-fn": "^2.1.0" + "conventional-changelog-angular": "^7.0.0", + "conventional-commits-filter": "^4.0.0", + "conventional-commits-parser": "^5.0.0", + "debug": "^4.0.0", + "import-from": "^4.0.0", + "lodash-es": "^4.17.21", + "micromatch": "^4.0.2" }, "engines": { - "node": ">=6" + "node": "^18.17 || >=20.6.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@semantic-release/git/node_modules/signal-exit": { - "version": "3.0.7", + "node_modules/@semantic-release/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", "dev": true, - "license": "ISC" + "engines": { + "node": ">=14.17" + } }, - "node_modules/@semantic-release/git/node_modules/strip-final-newline": { - "version": "2.0.0", + "node_modules/@semantic-release/git": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", + "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", "dev": true, - "license": "MIT", + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "debug": "^4.0.0", + "dir-glob": "^3.0.0", + "execa": "^5.0.0", + "lodash": "^4.17.4", + "micromatch": "^4.0.0", + "p-reduce": "^2.0.0" + }, "engines": { - "node": ">=6" + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" } }, "node_modules/@semantic-release/github": { "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-9.0.5.tgz", + "integrity": "sha512-d1ZZjMvXpSa4E1L3XjdNOqgUy00o9QZX55L75pMsb/w+1NV6CCfDYOvH8qwKygHS/rKzI3FkBTcR40ahOodsgg==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/core": "^5.0.0", "@octokit/plugin-paginate-rest": "^8.0.0", @@ -1124,16 +2115,18 @@ }, "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@semantic-release/github/node_modules/aggregate-error": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^4.0.0", "indent-string": "^5.0.0" @@ -1147,8 +2140,9 @@ }, "node_modules/@semantic-release/github/node_modules/clean-stack": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -1159,21 +2153,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github/node_modules/escape-string-regexp": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@semantic-release/github/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1183,8 +2167,9 @@ }, "node_modules/@semantic-release/npm": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-11.0.0.tgz", + "integrity": "sha512-ozNCiPUp14Xp2rgeY7j96yFTEhDncLSWOJr0IAUr888+ax6fH5xgYkNVv08vpkV8C5GIXBgnGd9coRiOCD6oqQ==", "dev": true, - "license": "MIT", "dependencies": { "@semantic-release/error": "^4.0.0", "aggregate-error": "^5.0.0", @@ -1209,16 +2194,18 @@ }, "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@semantic-release/npm/node_modules/aggregate-error": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^5.2.0", "indent-string": "^5.0.0" @@ -1232,8 +2219,9 @@ }, "node_modules/@semantic-release/npm/node_modules/clean-stack": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -1244,217 +2232,235 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/escape-string-regexp": { - "version": "5.0.0", + "node_modules/@semantic-release/npm/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, "engines": { - "node": ">=12" + "node": ">=16.17" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/@semantic-release/npm/node_modules/indent-string": { - "version": "5.0.0", + "node_modules/@semantic-release/npm/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "license": "MIT", "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/release-notes-generator": { - "version": "12.0.0", + "node_modules/@semantic-release/npm/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, - "license": "MIT", - "dependencies": { - "conventional-changelog-angular": "^7.0.0", - "conventional-changelog-writer": "^7.0.0", - "conventional-commits-filter": "^4.0.0", - "conventional-commits-parser": "^5.0.0", - "debug": "^4.0.0", - "get-stream": "^7.0.0", - "import-from": "^4.0.0", - "into-stream": "^7.0.0", - "lodash-es": "^4.17.21", - "read-pkg-up": "^10.0.0" - }, "engines": { - "node": "^18.17 || >=20.6.1" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" + "node": ">=16.17.0" } }, - "node_modules/@semantic-release/release-notes-generator/node_modules/get-stream": { - "version": "7.0.1", + "node_modules/@semantic-release/npm/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=16" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "dev": true, - "license": "MIT" - }, - "node_modules/@sindresorhus/is": { - "version": "3.1.2", + "node_modules/@semantic-release/npm/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", - "peer": true, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@technologiestiftung/semantic-release-config": { - "version": "1.2.4", + "node_modules/@semantic-release/npm/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, - "license": "MIT", - "dependencies": { - "@semantic-release/changelog": "6.0.3", - "@semantic-release/commit-analyzer": "11.0.0", - "@semantic-release/git": "10.0.1", - "@semantic-release/github": "9.0.5", - "@semantic-release/npm": "11.0.0", - "@semantic-release/release-notes-generator": "12.0.0", - "@technologiestiftung/semantic-release-config": "^1.0.0", - "lodash.merge": "4.6.2" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@testing-library/dom": { - "version": "9.3.3", + "node_modules/@semantic-release/npm/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^5.0.1", - "aria-query": "5.1.3", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.9", - "lz-string": "^1.5.0", - "pretty-format": "^27.0.2" + "path-key": "^4.0.0" }, "engines": { - "node": ">=14" - } - }, - "node_modules/@testing-library/dom/node_modules/ansi-regex": { - "version": "5.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@testing-library/dom/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@semantic-release/npm/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@testing-library/dom/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@semantic-release/npm/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@testing-library/dom/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@semantic-release/npm/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@testing-library/dom/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@testing-library/dom/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@testing-library/dom/node_modules/pretty-format": { - "version": "27.5.1", + "node_modules/@semantic-release/release-notes-generator": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-12.0.0.tgz", + "integrity": "sha512-m7Ds8ComP1KJgA2Lke2xMwE1TOOU40U7AzP4lT8hJ2tUAeicziPz/1GeDFmRkTOkMFlfHvE6kuvMkvU+mIzIDQ==", "dev": true, - "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "conventional-changelog-angular": "^7.0.0", + "conventional-changelog-writer": "^7.0.0", + "conventional-commits-filter": "^4.0.0", + "conventional-commits-parser": "^5.0.0", + "debug": "^4.0.0", + "get-stream": "^7.0.0", + "import-from": "^4.0.0", + "into-stream": "^7.0.0", + "lodash-es": "^4.17.21", + "read-pkg-up": "^10.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^18.17 || >=20.6.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, - "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@testing-library/dom/node_modules/react-is": { - "version": "17.0.2", + "node_modules/@technologiestiftung/semantic-release-config": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@technologiestiftung/semantic-release-config/-/semantic-release-config-1.2.4.tgz", + "integrity": "sha512-MlZmQJEXbHjJN3uPnu4I2cIAmIQy94TVUamxLka9vRVKZrCKACMNp7dkmXEL++roj9SK5X2DAh+GvHn/LkaWgQ==", "dev": true, - "license": "MIT" + "dependencies": { + "@semantic-release/changelog": "6.0.3", + "@semantic-release/commit-analyzer": "11.0.0", + "@semantic-release/git": "10.0.1", + "@semantic-release/github": "9.0.5", + "@semantic-release/npm": "11.0.0", + "@semantic-release/release-notes-generator": "12.0.0", + "@technologiestiftung/semantic-release-config": "^1.0.0", + "lodash.merge": "4.6.2" + } }, - "node_modules/@testing-library/dom/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@testing-library/dom": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", + "integrity": "sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==", "dev": true, - "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.1.3", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" }, "engines": { - "node": ">=8" + "node": ">=14" } }, "node_modules/@testing-library/react": { "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", + "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", "@testing-library/dom": "^9.0.0", @@ -1470,12 +2476,14 @@ }, "node_modules/@types/aria-query": { "version": "5.0.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true }, "node_modules/@types/babel__core": { "version": "7.20.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -1485,104 +2493,121 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.6", - "license": "MIT", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.3", - "license": "MIT", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__traverse": { - "version": "7.20.3", - "license": "MIT", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dependencies": { "@babel/types": "^7.20.7" } }, "node_modules/@types/debug": { "version": "4.1.12", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/estree": { "version": "1.0.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@types/hast": { - "version": "3.0.3", - "license": "MIT", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/lodash": { - "version": "4.14.201", - "dev": true, - "license": "MIT" + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dev": true }, "node_modules/@types/lodash.debounce": { "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.9.tgz", + "integrity": "sha512-Ma5JcgTREwpLRwMM+XwBR7DaWe96nC38uCBDFKZWbNKD+osjVzdpnUSwBcqCptrp16sSOLBAUb50Car5I0TCsQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/lodash": "*" } }, "node_modules/@types/mdast": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/ms": { "version": "0.7.34", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/nlcst": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.4.tgz", + "integrity": "sha512-ABoYdNQ/kBSsLvZAekMhIPMQ3YUZvavStpKYs7BjLLuKVmIMA0LUgZ7b54zzuWJRbHF80v1cNf4r90Vd6eMQDg==", "dependencies": { "@types/unist": "^2" } }, "node_modules/@types/nlcst/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", "devOptional": true, - "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } }, "node_modules/@types/normalize-package-data": { - "version": "2.4.3", - "dev": true, - "license": "MIT" + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true }, "node_modules/@types/p5": { "version": "1.7.6", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/p5/-/p5-1.7.6.tgz", + "integrity": "sha512-6pLTOo0V3N5jZb5nTwjiv3lPHLK3Z/TjbhQUj8CTWXocUk1Z/f6OHTp3Pcwi1BhWnf5gqKUcyEb1gP0KIJuQgw==" }, "node_modules/@types/prop-types": { - "version": "15.7.9", - "license": "MIT" + "version": "15.7.11", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", + "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { "version": "18.2.45", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz", + "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1591,26 +2616,31 @@ }, "node_modules/@types/react-dom": { "version": "18.2.18", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz", + "integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==", "dependencies": { "@types/react": "*" } }, "node_modules/@types/scheduler": { - "version": "0.16.5", - "license": "MIT" + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", + "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" }, "node_modules/@types/unist": { "version": "3.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, "node_modules/@vitejs/plugin-react": { "version": "4.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", + "integrity": "sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==", "dependencies": { "@babel/core": "^7.23.5", "@babel/plugin-transform-react-jsx-self": "^7.23.3", @@ -1627,8 +2657,9 @@ }, "node_modules/@vitest/expect": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.1.1.tgz", + "integrity": "sha512-Qpw01C2Hyb3085jBkOJLQ7HRX0Ncnh2qV4p+xWmmhcIUlMykUF69zsnZ1vPmAjZpomw9+5tWEGOQ0GTfR8U+kA==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/spy": "1.1.1", "@vitest/utils": "1.1.1", @@ -1640,8 +2671,9 @@ }, "node_modules/@vitest/runner": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.1.1.tgz", + "integrity": "sha512-8HokyJo1SnSi3uPFKfWm/Oq1qDwLC4QDcVsqpXIXwsRPAg3gIDh8EbZ1ri8cmQkBxdOu62aOF9B4xcqJhvt4xQ==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/utils": "1.1.1", "p-limit": "^5.0.0", @@ -1651,37 +2683,57 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner/node_modules/p-limit": { - "version": "5.0.0", + "node_modules/@vitest/snapshot": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.1.1.tgz", + "integrity": "sha512-WnMHjv4VdHLbFGgCdVVvyRkRPnOKN75JJg+LLTdr6ah7YnL75W+7CTIMdzPEPzaDxA8r5yvSVlc1d8lH3yE28w==", "dev": true, - "license": "MIT", "dependencies": { - "yocto-queue": "^1.0.0" + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@vitest/snapshot": { - "version": "1.1.1", + "node_modules/@vitest/snapshot/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, - "license": "MIT", "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" }, - "funding": { - "url": "https://opencollective.com/vitest" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@vitest/snapshot/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "node_modules/@vitest/spy": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.1.1.tgz", + "integrity": "sha512-hDU2KkOTfFp4WFFPWwHFauddwcKuGQ7gF6Un/ZZkCogoAiTMN7/7YKvUDbywPZZ754iCQGjdUmXN3t4k0jm1IQ==", "dev": true, - "license": "MIT", "dependencies": { "tinyspy": "^2.2.0" }, @@ -1691,8 +2743,9 @@ }, "node_modules/@vitest/utils": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.1.1.tgz", + "integrity": "sha512-E9LedH093vST/JuBSyHLFMpxJKW3dLhe/flUSPFedoyj4wKiFX7Jm8gYLtOIiin59dgrssfmFv0BJ1u8P/LC/A==", "dev": true, - "license": "MIT", "dependencies": { "diff-sequences": "^29.6.3", "loupe": "^2.3.7", @@ -1702,11 +2755,45 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@vitest/utils/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@vitest/utils/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@vitest/utils/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "node_modules/@volar/kit": { - "version": "1.10.10", - "license": "MIT", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.4.tgz", + "integrity": "sha512-USRx/o0jKz7o8+lEKWMxWqbqvC46XFrf3IE6CZBYzRo9kM7RERQLwUYaoT2bOcHt5DQWublpnTgdgHMm37Gysg==", "dependencies": { - "@volar/language-service": "1.10.10", + "@volar/language-service": "2.0.4", + "@volar/typescript": "2.0.4", "typesafe-path": "^0.2.2", "vscode-languageserver-textdocument": "^1.0.11", "vscode-uri": "^3.0.8" @@ -1716,19 +2803,22 @@ } }, "node_modules/@volar/language-core": { - "version": "1.10.10", - "license": "MIT", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.0.4.tgz", + "integrity": "sha512-VhC8i03P0x9LKGLTBi81xNTNWm40yxQ/Iba8IpH+LFr+Yb7c/D7fF90Cvf31MzPDM4G5rjIOlCfs+eQKPBkwQw==", "dependencies": { - "@volar/source-map": "1.10.10" + "@volar/source-map": "2.0.4" } }, "node_modules/@volar/language-server": { - "version": "1.10.10", - "license": "MIT", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-server/-/language-server-2.0.4.tgz", + "integrity": "sha512-VnljhooQjT6RhmvwwJK9+3YYs2ovFmav4IVNHiQgnTMfiOiyABzcghwvJrJrI39rJDI6LNOWF7BYUJq7K07BKQ==", "dependencies": { - "@volar/language-core": "1.10.10", - "@volar/language-service": "1.10.10", - "@volar/typescript": "1.10.10", + "@volar/language-core": "2.0.4", + "@volar/language-service": "2.0.4", + "@volar/snapshot-document": "2.0.4", + "@volar/typescript": "2.0.4", "@vscode/l10n": "^0.0.16", "path-browserify": "^1.0.1", "request-light": "^0.7.0", @@ -1739,34 +2829,46 @@ } }, "node_modules/@volar/language-service": { - "version": "1.10.10", - "license": "MIT", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.0.4.tgz", + "integrity": "sha512-DoanyU9I9Nl85lUytDl8jgyk+nrUDR5CFNVMrxWXGXclP4WTqBayBgSFAeF1L/5AwP3MywmWoK4GLAEVvl8D+Q==", "dependencies": { - "@volar/language-core": "1.10.10", - "@volar/source-map": "1.10.10", + "@volar/language-core": "2.0.4", "vscode-languageserver-protocol": "^3.17.5", "vscode-languageserver-textdocument": "^1.0.11", "vscode-uri": "^3.0.8" } }, + "node_modules/@volar/snapshot-document": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/snapshot-document/-/snapshot-document-2.0.4.tgz", + "integrity": "sha512-YzgdmvpdRFxiBFCOVWga67naAtbPtKmPaFtGnmxWx+KXrjGkpUXT/2tzeKn5FLdtoYV+DRTdpMdP/45ArnVwZQ==", + "dependencies": { + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11" + } + }, "node_modules/@volar/source-map": { - "version": "1.10.10", - "license": "MIT", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.0.4.tgz", + "integrity": "sha512-BbxUinEMoJZqrHsSj1aBa0boCBnN3BoXnf7j9IBwjxosxGXOhCvqmH2L9raJemadaKjeVR8ZQLhV7AOhyoHt/Q==", "dependencies": { - "muggle-string": "^0.3.1" + "muggle-string": "^0.4.0" } }, "node_modules/@volar/typescript": { - "version": "1.10.10", - "license": "MIT", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.0.4.tgz", + "integrity": "sha512-KF7yh7GIo4iWuAQOKf/ONeFHdQA+wFriitW8LtGZB4iOOT6MdlRlYNsRL8do7XxmXvsBKcs4jTMtGn+uZRwlWg==", "dependencies": { - "@volar/language-core": "1.10.10", + "@volar/language-core": "2.0.4", "path-browserify": "^1.0.1" } }, "node_modules/@vscode/emmet-helper": { "version": "2.9.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.9.2.tgz", + "integrity": "sha512-MaGuyW+fa13q3aYsluKqclmh62Hgp0BpKIqS66fCxfOaBcVQ1OnMQxRRgQUYnCkxFISAQlkJ0qWWPyXjro1Qrg==", "dependencies": { "emmet": "^2.4.3", "jsonc-parser": "^2.3.0", @@ -1775,17 +2877,25 @@ "vscode-uri": "^2.1.2" } }, + "node_modules/@vscode/emmet-helper/node_modules/jsonc-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", + "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" + }, "node_modules/@vscode/emmet-helper/node_modules/vscode-uri": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", + "integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==" }, "node_modules/@vscode/l10n": { "version": "0.0.16", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.16.tgz", + "integrity": "sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==" }, "node_modules/acorn": { - "version": "8.11.2", - "license": "MIT", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "bin": { "acorn": "bin/acorn" }, @@ -1794,17 +2904,19 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.0", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/agent-base": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^4.3.4" }, @@ -1814,8 +2926,9 @@ }, "node_modules/aggregate-error": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -1826,25 +2939,21 @@ }, "node_modules/ansi-align": { "version": "3.0.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dependencies": { "string-width": "^4.1.0" } }, - "node_modules/ansi-align/node_modules/ansi-regex": { - "version": "5.0.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/ansi-align/node_modules/emoji-regex": { "version": "8.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/ansi-align/node_modules/string-width": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1856,7 +2965,8 @@ }, "node_modules/ansi-align/node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1866,8 +2976,9 @@ }, "node_modules/ansi-escapes": { "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "type-fest": "^3.0.0" @@ -1881,8 +2992,9 @@ }, "node_modules/ansi-escapes/node_modules/type-fest": { "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, - "license": "(MIT OR CC0-1.0)", "peer": true, "engines": { "node": ">=14.16" @@ -1892,34 +3004,38 @@ } }, "node_modules/ansi-regex": { - "version": "6.0.1", - "license": "MIT", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=8" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "license": "MIT", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/ansicolors": { - "version": "0.3.2", + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/anymatch": { "version": "3.1.3", - "license": "ISC", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1930,29 +3046,36 @@ }, "node_modules/argparse": { "version": "2.0.1", - "license": "Python-2.0" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/argv-formatter": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", + "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/aria-query": { "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "deep-equal": "^2.0.5" } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, - "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1960,12 +3083,14 @@ }, "node_modules/array-ify": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true }, "node_modules/array-iterate": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -1973,15 +3098,17 @@ }, "node_modules/assertion-error": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true, - "license": "MIT", "engines": { "node": "*" } }, "node_modules/astro": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.1.0.tgz", + "integrity": "sha512-xbLWqvMn2JFyv7FpzHiXFn17bRS0P/b4cdEPXMMZOpBI9V8ZC33o6Xs+c59/pYSZpYiNd1HTg778XT5MhcpyKw==", "dependencies": { "@astrojs/compiler": "^2.3.4", "@astrojs/internal-helpers": "0.2.1", @@ -2060,47 +3187,131 @@ }, "node_modules/astro/node_modules/aria-query": { "version": "5.3.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dependencies": { "dequal": "^2.0.3" } }, - "node_modules/astro/node_modules/ci-info": { + "node_modules/astro/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/astro/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/astro/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/mimic-fn": { "version": "4.0.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dependencies": { + "path-key": "^4.0.0" + }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/astro/node_modules/p-limit": { - "version": "5.0.0", - "license": "MIT", + "node_modules/astro/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dependencies": { - "yocto-queue": "^1.0.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=18" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/astro/node_modules/string-width": { - "version": "7.0.0", - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "node_modules/astro/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "engines": { - "node": ">=18" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/astro/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2108,13 +3319,18 @@ }, "node_modules/asynckit": { "version": "0.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/available-typed-arrays": { - "version": "1.0.5", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, - "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -2124,14 +3340,16 @@ }, "node_modules/axobject-query": { "version": "4.0.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", + "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", "dependencies": { "dequal": "^2.0.3" } }, "node_modules/bail": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2139,15 +3357,19 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/base-64": { "version": "1.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -2161,38 +3383,55 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/before-after-hook": { "version": "2.2.3", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true }, "node_modules/binary-extensions": { "version": "2.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "engines": { "node": ">=8" } }, "node_modules/bl": { "version": "5.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/bottleneck": { "version": "2.19.5", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dev": true }, "node_modules/boxen": { "version": "7.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^7.0.1", @@ -2212,7 +3451,8 @@ }, "node_modules/boxen/node_modules/chalk": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -2222,11 +3462,13 @@ }, "node_modules/boxen/node_modules/emoji-regex": { "version": "9.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/boxen/node_modules/string-width": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -2241,8 +3483,9 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2250,7 +3493,8 @@ }, "node_modules/braces": { "version": "3.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dependencies": { "fill-range": "^7.0.1" }, @@ -2259,7 +3503,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.1", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "funding": [ { "type": "opencollective", @@ -2274,11 +3520,10 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, "bin": { @@ -2290,6 +3535,8 @@ }, "node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -2304,7 +3551,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -2312,20 +3558,27 @@ }, "node_modules/cac": { "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/call-bind": { - "version": "1.0.5", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, - "license": "MIT", "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2333,8 +3586,9 @@ }, "node_modules/callsites": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -2342,7 +3596,8 @@ }, "node_modules/camelcase": { "version": "7.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", "engines": { "node": ">=14.16" }, @@ -2351,7 +3606,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001561", + "version": "1.0.30001591", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", + "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", "funding": [ { "type": "opencollective", @@ -2365,34 +3622,22 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" - }, - "node_modules/cardinal": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ansicolors": "~0.3.2", - "redeyed": "~2.1.0" - }, - "bin": { - "cdl": "bin/cdl.js" - } + ] }, "node_modules/ccount": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/chai": { - "version": "4.3.10", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, - "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -2407,21 +3652,26 @@ } }, "node_modules/chalk": { - "version": "2.4.2", - "license": "MIT", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/char-regex": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -2429,7 +3679,8 @@ }, "node_modules/character-entities": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2437,7 +3688,8 @@ }, "node_modules/character-entities-html4": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2445,7 +3697,8 @@ }, "node_modules/character-entities-legacy": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2453,8 +3706,9 @@ }, "node_modules/check-error": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, - "license": "MIT", "dependencies": { "get-func-name": "^2.0.2" }, @@ -2463,14 +3717,9 @@ } }, "node_modules/chokidar": { - "version": "3.5.3", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "license": "MIT", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -2483,34 +3732,40 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "node_modules/ci-info": { - "version": "3.9.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/sibiraj-s" } ], - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/clean-stack": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/cli-boxes": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", "engines": { "node": ">=10" }, @@ -2520,7 +3775,8 @@ }, "node_modules/cli-cursor": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dependencies": { "restore-cursor": "^4.0.0" }, @@ -2531,50 +3787,59 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-spinners": { - "version": "2.9.1", - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-table3": { - "version": "0.6.3", + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "string-width": "^4.2.0" + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" }, - "engines": { - "node": "10.* || >= 12.*" + "bin": { + "highlight": "bin/highlight" }, - "optionalDependencies": { - "@colors/colors": "1.5.0" + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" } }, - "node_modules/cli-table3/node_modules/ansi-regex": { - "version": "5.0.1", + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, - "license": "MIT", "peer": true, - "engines": { - "node": ">=8" + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "node_modules/cli-table3/node_modules/emoji-regex": { + "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true }, - "node_modules/cli-table3/node_modules/string-width": { + "node_modules/cli-highlight/node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true, + "peer": true + }, + "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -2585,10 +3850,11 @@ "node": ">=8" } }, - "node_modules/cli-table3/node_modules/strip-ansi": { + "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -2597,59 +3863,137 @@ "node": ">=8" } }, - "node_modules/cliui": { - "version": "8.0.1", - "license": "ISC", + "node_modules/cli-highlight/node_modules/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, + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "peer": true, "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "license": "MIT", + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "peer": true, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/cliui/node_modules/ansi-styles": { - "version": "4.3.0", - "license": "MIT", + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "dev": true, + "peer": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-table3/node_modules/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, + "peer": true + }, + "node_modules/cli-table3/node_modules/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, + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/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, + "peer": true, "dependencies": { - "color-convert": "^2.0.1" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/cliui/node_modules/color-convert": { - "version": "2.0.1", - "license": "MIT", + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": { - "color-name": "~1.1.4" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=12" } }, - "node_modules/cliui/node_modules/color-name": { - "version": "1.1.4", - "license": "MIT" - }, "node_modules/cliui/node_modules/emoji-regex": { "version": "8.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/cliui/node_modules/string-width": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2661,7 +4005,8 @@ }, "node_modules/cliui/node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2671,7 +4016,8 @@ }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2685,15 +4031,17 @@ } }, "node_modules/clsx": { - "version": "2.0.0", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", "engines": { "node": ">=6" } }, "node_modules/color": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", "optional": true, "dependencies": { "color-convert": "^2.0.1", @@ -2704,45 +4052,36 @@ } }, "node_modules/color-convert": { - "version": "1.9.3", - "license": "MIT", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "license": "MIT" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/color-string": { "version": "1.9.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", "optional": true, "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" } }, - "node_modules/color/node_modules/color-convert": { - "version": "2.0.1", - "license": "MIT", - "optional": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color/node_modules/color-name": { - "version": "1.1.4", - "license": "MIT", - "optional": true - }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2752,7 +4091,8 @@ }, "node_modules/comma-separated-tokens": { "version": "2.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2760,12 +4100,14 @@ }, "node_modules/common-ancestor-path": { "version": "1.0.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==" }, "node_modules/compare-func": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, - "license": "MIT", "dependencies": { "array-ify": "^1.0.0", "dot-prop": "^5.1.0" @@ -2773,13 +4115,15 @@ }, "node_modules/concat-map": { "version": "0.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/config-chain": { "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, - "license": "MIT", "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" @@ -2787,8 +4131,9 @@ }, "node_modules/conventional-changelog-angular": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", "dev": true, - "license": "ISC", "dependencies": { "compare-func": "^2.0.0" }, @@ -2798,8 +4143,9 @@ }, "node_modules/conventional-changelog-writer": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.1.tgz", + "integrity": "sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==", "dev": true, - "license": "MIT", "dependencies": { "conventional-commits-filter": "^4.0.0", "handlebars": "^4.7.7", @@ -2817,16 +4163,18 @@ }, "node_modules/conventional-commits-filter": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-4.0.0.tgz", + "integrity": "sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" } }, "node_modules/conventional-commits-parser": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", "dev": true, - "license": "MIT", "dependencies": { "is-text-path": "^2.0.0", "JSONStream": "^1.3.5", @@ -2842,30 +4190,34 @@ }, "node_modules/convert-source-map": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/cookie": { "version": "0.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "engines": { "node": ">= 0.6" } }, "node_modules/core-util-is": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true }, "node_modules/cosmiconfig": { - "version": "8.3.6", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { + "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" + "parse-json": "^5.2.0" }, "engines": { "node": ">=14" @@ -2884,20 +4236,23 @@ }, "node_modules/cosmiconfig/node_modules/json-parse-even-better-errors": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/cosmiconfig/node_modules/lines-and-columns": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/cosmiconfig/node_modules/parse-json": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", @@ -2914,7 +4269,8 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2926,8 +4282,9 @@ }, "node_modules/crypto-random-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^1.0.1" }, @@ -2940,8 +4297,9 @@ }, "node_modules/crypto-random-string/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2951,8 +4309,9 @@ }, "node_modules/cssstyle": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, - "license": "MIT", "dependencies": { "rrweb-cssom": "^0.6.0" }, @@ -2961,13 +4320,15 @@ } }, "node_modules/csstype": { - "version": "3.1.2", - "license": "MIT" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/data-urls": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0" @@ -2978,7 +4339,8 @@ }, "node_modules/debug": { "version": "4.3.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -2993,12 +4355,14 @@ }, "node_modules/decimal.js": { "version": "10.4.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true }, "node_modules/decode-named-character-reference": { "version": "1.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", + "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", "dependencies": { "character-entities": "^2.0.0" }, @@ -3009,8 +4373,9 @@ }, "node_modules/deep-eql": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dev": true, - "license": "MIT", "dependencies": { "type-detect": "^4.0.0" }, @@ -3020,8 +4385,9 @@ }, "node_modules/deep-equal": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", "dev": true, - "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.5", @@ -3049,36 +4415,37 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/deep-equal/node_modules/isarray": { - "version": "2.0.5", - "dev": true, - "license": "MIT" - }, "node_modules/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, - "license": "MIT", "engines": { "node": ">=4.0.0" } }, "node_modules/define-data-property": { - "version": "1.1.1", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, - "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-properties": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -3093,27 +4460,31 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/deprecation": { "version": "2.3.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true }, "node_modules/dequal": { "version": "2.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "engines": { "node": ">=6" } }, "node_modules/detect-libc": { "version": "2.0.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", "optional": true, "engines": { "node": ">=8" @@ -3121,7 +4492,8 @@ }, "node_modules/deterministic-object-hash": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", + "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", "dependencies": { "base-64": "^1.0.0" }, @@ -3131,11 +4503,13 @@ }, "node_modules/devalue": { "version": "4.3.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.2.tgz", + "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==" }, "node_modules/devlop": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dependencies": { "dequal": "^2.0.0" }, @@ -3145,24 +4519,27 @@ } }, "node_modules/diff": { - "version": "5.1.0", - "license": "BSD-3-Clause", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "engines": { "node": ">=0.3.1" } }, "node_modules/diff-sequences": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, - "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/dir-glob": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, - "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -3172,17 +4549,20 @@ }, "node_modules/dlv": { "version": "1.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" }, "node_modules/dom-accessibility-api": { "version": "0.5.16", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true }, "node_modules/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, - "license": "MIT", "dependencies": { "is-obj": "^2.0.0" }, @@ -3192,122 +4572,267 @@ }, "node_modules/dset": { "version": "3.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", "engines": { "node": ">=4" } }, "node_modules/duplexer2": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dev": true, - "license": "BSD-3-Clause", "peer": true, "dependencies": { "readable-stream": "^2.0.2" } }, - "node_modules/duplexer2/node_modules/readable-stream": { - "version": "2.3.8", - "dev": true, - "license": "MIT", - "peer": true, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/electron-to-chromium": { + "version": "1.4.685", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.685.tgz", + "integrity": "sha512-yDYeobbTEe4TNooEzOQO6xFqg9XnAkVy2Lod1C1B2it8u47JNLYvl9nLDWBamqUakWB8Jc1hhS1uHUNYTNQdfw==" + }, + "node_modules/emmet": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.6.tgz", + "integrity": "sha512-dJfbdY/hfeTyf/Ef7Y7ubLYzkBvPQ912wPaeVYpAxvFxkEBf/+hJu4H6vhAvFN6HlxqedlfVn2x1S44FfQ97pg==", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "@emmetio/abbreviation": "^2.3.3", + "@emmetio/css-abbreviation": "^2.1.8" } }, - "node_modules/duplexer2/node_modules/safe-buffer": { - "version": "5.1.2", + "node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" + }, + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", "dev": true, - "license": "MIT", "peer": true }, - "node_modules/duplexer2/node_modules/string_decoder": { - "version": "1.1.1", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-ci": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.0.0.tgz", + "integrity": "sha512-apikxMgkipkgTvMdRT9MNqWx5VLOci79F4VBd7Op/7OPjjoanjdAvn6fglMCCEf/1bAh8eOiuEVCUs4V3qP3nQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "safe-buffer": "~5.1.0" + "execa": "^8.0.0", + "java-properties": "^1.0.2" + }, + "engines": { + "node": "^18.17 || >=20.6.1" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "license": "MIT" + "node_modules/env-ci/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } }, - "node_modules/electron-to-chromium": { - "version": "1.4.576", - "license": "ISC" + "node_modules/env-ci/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/emmet": { - "version": "2.4.6", - "license": "MIT", - "workspaces": [ - "./packages/scanner", - "./packages/abbreviation", - "./packages/css-abbreviation", - "./" - ], + "node_modules/env-ci/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/env-ci/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "peer": true, "dependencies": { - "@emmetio/abbreviation": "^2.3.3", - "@emmetio/css-abbreviation": "^2.1.8" + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/emoji-regex": { - "version": "10.3.0", - "license": "MIT" - }, - "node_modules/emojilib": { - "version": "2.4.0", + "node_modules/env-ci/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", - "peer": true + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/entities": { - "version": "4.5.0", - "license": "BSD-2-Clause", + "node_modules/env-ci/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "peer": true, "engines": { - "node": ">=0.12" + "node": ">=14" }, "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/env-ci": { - "version": "10.0.0", + "node_modules/env-ci/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "peer": true, - "dependencies": { - "execa": "^8.0.0", - "java-properties": "^1.0.2" + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "peer": true, "engines": { - "node": "^18.17 || >=20.6.1" + "node": ">=6" } }, "node_modules/error-ex": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } }, - "node_modules/error-ex/node_modules/is-arrayish": { - "version": "0.2.1", + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", "dev": true, - "license": "MIT" + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } }, "node_modules/es-get-iterator": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -3323,19 +4848,16 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-get-iterator/node_modules/isarray": { - "version": "2.0.5", - "dev": true, - "license": "MIT" - }, "node_modules/es-module-lexer": { "version": "1.4.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" }, "node_modules/esbuild": { - "version": "0.19.11", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -3343,48 +4865,54 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.11", - "@esbuild/android-arm": "0.19.11", - "@esbuild/android-arm64": "0.19.11", - "@esbuild/android-x64": "0.19.11", - "@esbuild/darwin-arm64": "0.19.11", - "@esbuild/darwin-x64": "0.19.11", - "@esbuild/freebsd-arm64": "0.19.11", - "@esbuild/freebsd-x64": "0.19.11", - "@esbuild/linux-arm": "0.19.11", - "@esbuild/linux-arm64": "0.19.11", - "@esbuild/linux-ia32": "0.19.11", - "@esbuild/linux-loong64": "0.19.11", - "@esbuild/linux-mips64el": "0.19.11", - "@esbuild/linux-ppc64": "0.19.11", - "@esbuild/linux-riscv64": "0.19.11", - "@esbuild/linux-s390x": "0.19.11", - "@esbuild/linux-x64": "0.19.11", - "@esbuild/netbsd-x64": "0.19.11", - "@esbuild/openbsd-x64": "0.19.11", - "@esbuild/sunos-x64": "0.19.11", - "@esbuild/win32-arm64": "0.19.11", - "@esbuild/win32-ia32": "0.19.11", - "@esbuild/win32-x64": "0.19.11" + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" } }, "node_modules/escalade": { - "version": "3.1.1", - "license": "MIT", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "engines": { - "node": ">=0.8.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/esprima": { "version": "4.0.1", - "license": "BSD-2-Clause", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -3395,43 +4923,61 @@ }, "node_modules/estree-walker": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dependencies": { "@types/estree": "^1.0.0" } }, "node_modules/eventemitter3": { "version": "5.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "node_modules/execa": { - "version": "8.0.1", - "license": "MIT", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" }, "engines": { - "node": ">=16.17" + "node": ">=10" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/execa/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/extend": { "version": "3.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "node_modules/extend-shallow": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dependencies": { "is-extendable": "^0.1.0" }, @@ -3441,7 +4987,8 @@ }, "node_modules/fast-glob": { "version": "3.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3454,16 +5001,18 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "license": "ISC", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/figures": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", + "integrity": "sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "is-unicode-supported": "^2.0.0" @@ -3477,8 +5026,9 @@ }, "node_modules/figures/node_modules/is-unicode-supported": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", + "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -3489,7 +5039,8 @@ }, "node_modules/fill-range": { "version": "7.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3499,7 +5050,8 @@ }, "node_modules/find-up": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3513,8 +5065,9 @@ }, "node_modules/find-up-simple": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -3525,8 +5078,9 @@ }, "node_modules/find-versions": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "semver-regex": "^4.0.5" @@ -3540,7 +5094,8 @@ }, "node_modules/find-yarn-workspace-root2": { "version": "1.2.16", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", "dependencies": { "micromatch": "^4.0.2", "pkg-dir": "^4.2.0" @@ -3548,23 +5103,26 @@ }, "node_modules/flattie": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.0.tgz", + "integrity": "sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==", "engines": { "node": ">=8" } }, "node_modules/for-each": { "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, - "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/form-data": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3576,44 +5134,19 @@ }, "node_modules/from2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" } }, - "node_modules/from2/node_modules/readable-stream": { - "version": "2.3.8", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/from2/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/from2/node_modules/string_decoder": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/fs-extra": { - "version": "11.1.1", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -3625,12 +5158,15 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -3641,36 +5177,41 @@ }, "node_modules/function-bind": { "version": "1.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "engines": { "node": ">=6.9.0" } }, "node_modules/get-caller-file": { "version": "2.0.5", - "license": "ISC", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-east-asian-width": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", "engines": { "node": ">=18" }, @@ -3680,29 +5221,37 @@ }, "node_modules/get-func-name": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, - "license": "MIT", "engines": { "node": "*" } }, "node_modules/get-intrinsic": { - "version": "1.2.2", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, - "license": "MIT", "dependencies": { + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-stream": { - "version": "8.0.1", - "license": "MIT", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", + "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", + "dev": true, "engines": { "node": ">=16" }, @@ -3712,8 +5261,9 @@ }, "node_modules/git-log-parser": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", + "integrity": "sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "argv-formatter": "~1.0.0", @@ -3726,8 +5276,9 @@ }, "node_modules/git-log-parser/node_modules/split2": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", + "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", "dev": true, - "license": "ISC", "peer": true, "dependencies": { "through2": "~2.0.0" @@ -3735,12 +5286,14 @@ }, "node_modules/github-slugger": { "version": "2.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" }, "node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3758,7 +5311,8 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dependencies": { "is-glob": "^4.0.1" }, @@ -3768,15 +5322,17 @@ }, "node_modules/globals": { "version": "11.12.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "engines": { "node": ">=4" } }, "node_modules/globby": { "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, - "license": "MIT", "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.3.0", @@ -3793,8 +5349,9 @@ }, "node_modules/gopd": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -3804,11 +5361,13 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", - "license": "ISC" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/gray-matter": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", "dependencies": { "js-yaml": "^3.13.1", "kind-of": "^6.0.2", @@ -3821,14 +5380,16 @@ }, "node_modules/gray-matter/node_modules/argparse": { "version": "1.0.10", - "license": "MIT", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/gray-matter/node_modules/js-yaml": { "version": "3.14.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -3839,8 +5400,9 @@ }, "node_modules/handlebars": { "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -3859,34 +5421,39 @@ }, "node_modules/has-bigints": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { - "version": "3.0.0", - "license": "MIT", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/has-property-descriptors": { - "version": "1.0.1", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, - "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3896,8 +5463,9 @@ }, "node_modules/has-symbols": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -3906,11 +5474,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, - "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -3920,8 +5489,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "license": "MIT", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", "dependencies": { "function-bind": "^1.1.2" }, @@ -3931,7 +5501,8 @@ }, "node_modules/hast-util-from-html": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz", + "integrity": "sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==", "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.1.0", @@ -3947,7 +5518,8 @@ }, "node_modules/hast-util-from-parse5": { "version": "8.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -3965,7 +5537,8 @@ }, "node_modules/hast-util-parse-selector": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", "dependencies": { "@types/hast": "^3.0.0" }, @@ -3975,8 +5548,9 @@ } }, "node_modules/hast-util-raw": { - "version": "9.0.1", - "license": "MIT", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.2.tgz", + "integrity": "sha512-PldBy71wO9Uq1kyaMch9AHIghtQvIwxBUkv823pKmkTM3oV1JxtsTNYdevMxvUHqcnOAuO65JKU2+0NOxc2ksA==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -3999,7 +5573,8 @@ }, "node_modules/hast-util-to-html": { "version": "9.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", + "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -4021,7 +5596,8 @@ }, "node_modules/hast-util-to-parse5": { "version": "8.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", + "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", @@ -4038,7 +5614,8 @@ }, "node_modules/hast-util-whitespace": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", "dependencies": { "@types/hast": "^3.0.0" }, @@ -4049,7 +5626,8 @@ }, "node_modules/hastscript": { "version": "8.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", @@ -4062,10 +5640,21 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, "node_modules/hook-std": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -4076,8 +5665,9 @@ }, "node_modules/hosted-git-info": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^10.0.1" }, @@ -4086,17 +5676,19 @@ } }, "node_modules/hosted-git-info/node_modules/lru-cache": { - "version": "10.0.1", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "dev": true, - "license": "ISC", "engines": { "node": "14 || >=16.14" } }, "node_modules/html-encoding-sniffer": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-encoding": "^3.1.1" }, @@ -4106,11 +5698,13 @@ }, "node_modules/html-escaper": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", + "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" }, "node_modules/html-void-elements": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4118,12 +5712,14 @@ }, "node_modules/http-cache-semantics": { "version": "4.1.1", - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http-proxy-agent": { - "version": "7.0.0", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" @@ -4133,9 +5729,10 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.2", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -4145,15 +5742,18 @@ } }, "node_modules/human-signals": { - "version": "5.0.0", - "license": "Apache-2.0", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, "engines": { - "node": ">=16.17.0" + "node": ">=10.17.0" } }, "node_modules/iconv-lite": { "version": "0.4.24", - "license": "MIT", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -4163,6 +5763,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -4176,21 +5778,22 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/ignore": { - "version": "5.2.4", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "parent-module": "^1.0.0", @@ -4205,8 +5808,9 @@ }, "node_modules/import-fresh/node_modules/resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -4214,8 +5818,9 @@ }, "node_modules/import-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", + "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.2" }, @@ -4223,9 +5828,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-from-esm": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.3.tgz", + "integrity": "sha512-U3Qt/CyfFpTUv6LOP2jRTLYjphH6zg3okMfHbyqRa/W2w6hr8OsJWVggNlR4jxuojQy81TgTJTxgSkyoteRGMQ==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^4.3.4", + "import-meta-resolve": "^4.0.0" + }, + "engines": { + "node": ">=16.20" + } + }, "node_modules/import-meta-resolve": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4233,16 +5853,18 @@ }, "node_modules/indent-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/index-to-position": { - "version": "0.1.0", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -4253,8 +5875,9 @@ }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, - "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4262,19 +5885,22 @@ }, "node_modules/inherits": { "version": "2.0.4", - "license": "ISC" + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "1.3.8", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/internal-slot": { - "version": "1.0.6", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, - "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2", + "es-errors": "^1.3.0", "hasown": "^2.0.0", "side-channel": "^1.0.4" }, @@ -4284,16 +5910,18 @@ }, "node_modules/interpret": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/into-stream": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", + "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", "dev": true, - "license": "MIT", "dependencies": { "from2": "^2.3.0", "p-is-promise": "^3.0.0" @@ -4307,8 +5935,9 @@ }, "node_modules/is-arguments": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4321,27 +5950,32 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-arrayish": { - "version": "0.3.2", - "license": "MIT", - "optional": true + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, - "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -4351,7 +5985,8 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -4361,8 +5996,9 @@ }, "node_modules/is-boolean-object": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4376,6 +6012,8 @@ }, "node_modules/is-buffer": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "funding": [ { "type": "github", @@ -4390,15 +6028,15 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -4408,7 +6046,8 @@ }, "node_modules/is-core-module": { "version": "2.13.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dependencies": { "hasown": "^2.0.0" }, @@ -4418,8 +6057,9 @@ }, "node_modules/is-date-object": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4432,7 +6072,8 @@ }, "node_modules/is-docker": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", "bin": { "is-docker": "cli.js" }, @@ -4445,28 +6086,32 @@ }, "node_modules/is-extendable": { "version": "0.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "engines": { "node": ">=0.10.0" } }, "node_modules/is-extglob": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "engines": { "node": ">=8" } }, "node_modules/is-glob": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dependencies": { "is-extglob": "^2.1.1" }, @@ -4476,7 +6121,8 @@ }, "node_modules/is-inside-container": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", "dependencies": { "is-docker": "^3.0.0" }, @@ -4492,7 +6138,8 @@ }, "node_modules/is-interactive": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "engines": { "node": ">=12" }, @@ -4502,23 +6149,26 @@ }, "node_modules/is-map": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4531,15 +6181,17 @@ }, "node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-plain-obj": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "engines": { "node": ">=12" }, @@ -4547,23 +6199,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true }, "node_modules/is-regex": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4577,28 +6223,35 @@ }, "node_modules/is-set": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, - "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-stream": { - "version": "3.0.0", - "license": "MIT", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4606,8 +6259,9 @@ }, "node_modules/is-string": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4620,8 +6274,9 @@ }, "node_modules/is-symbol": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, - "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -4634,8 +6289,9 @@ }, "node_modules/is-text-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", "dev": true, - "license": "MIT", "dependencies": { "text-extensions": "^2.0.0" }, @@ -4643,23 +6299,10 @@ "node": ">=8" } }, - "node_modules/is-typed-array": { - "version": "1.1.12", - "dev": true, - "license": "MIT", - "dependencies": { - "which-typed-array": "^1.1.11" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "1.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "engines": { "node": ">=12" }, @@ -4669,16 +6312,18 @@ }, "node_modules/is-weakmap": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakset": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -4689,7 +6334,8 @@ }, "node_modules/is-wsl": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", "dependencies": { "is-inside-container": "^1.0.0" }, @@ -4701,18 +6347,21 @@ } }, "node_modules/isarray": { - "version": "1.0.0", - "dev": true, - "license": "MIT" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/issue-parser": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", + "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", "dev": true, - "license": "MIT", "dependencies": { "lodash.capitalize": "^4.2.1", "lodash.escaperegexp": "^4.1.2", @@ -4726,8 +6375,9 @@ }, "node_modules/java-properties": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", + "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">= 0.6.0" @@ -4735,11 +6385,13 @@ }, "node_modules/js-tokens": { "version": "4.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dependencies": { "argparse": "^2.0.1" }, @@ -4749,8 +6401,9 @@ }, "node_modules/jsdom": { "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz", + "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==", "dev": true, - "license": "MIT", "dependencies": { "cssstyle": "^3.0.0", "data-urls": "^5.0.0", @@ -4788,7 +6441,8 @@ }, "node_modules/jsesc": { "version": "2.5.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "bin": { "jsesc": "bin/jsesc" }, @@ -4798,26 +6452,30 @@ }, "node_modules/json-parse-better-errors": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/json-parse-even-better-errors": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz", + "integrity": "sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==", "dev": true, - "license": "MIT", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true }, "node_modules/json5": { "version": "2.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": { "json5": "lib/cli.js" }, @@ -4826,13 +6484,16 @@ } }, "node_modules/jsonc-parser": { - "version": "2.3.1", - "license": "MIT" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true }, "node_modules/jsonfile": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -4842,16 +6503,18 @@ }, "node_modules/jsonparse": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true, "engines": [ "node >= 0.2.0" - ], - "license": "MIT" + ] }, "node_modules/JSONStream": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, - "license": "(MIT OR Apache-2.0)", "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -4865,30 +6528,34 @@ }, "node_modules/kind-of": { "version": "6.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "engines": { "node": ">=0.10.0" } }, "node_modules/kleur": { "version": "4.1.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "engines": { "node": ">=6" } }, "node_modules/lines-and-columns": { - "version": "2.0.3", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/load-json-file": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "graceful-fs": "^4.1.2", @@ -4902,8 +6569,9 @@ }, "node_modules/load-json-file/node_modules/parse-json": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "error-ex": "^1.3.1", @@ -4913,18 +6581,10 @@ "node": ">=4" } }, - "node_modules/load-json-file/node_modules/pify": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/load-yaml-file": { "version": "0.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", "dependencies": { "graceful-fs": "^4.1.5", "js-yaml": "^3.13.0", @@ -4937,14 +6597,16 @@ }, "node_modules/load-yaml-file/node_modules/argparse": { "version": "1.0.10", - "license": "MIT", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/load-yaml-file/node_modules/js-yaml": { "version": "3.14.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -4953,10 +6615,19 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/load-yaml-file/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "engines": { + "node": ">=6" + } + }, "node_modules/local-pkg": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", "dev": true, - "license": "MIT", "dependencies": { "mlly": "^1.4.2", "pkg-types": "^1.0.3" @@ -4970,7 +6641,8 @@ }, "node_modules/locate-path": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dependencies": { "p-locate": "^5.0.0" }, @@ -4983,50 +6655,60 @@ }, "node_modules/lodash": { "version": "4.17.21", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/lodash-es": { "version": "4.17.21", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true }, "node_modules/lodash.capitalize": { "version": "4.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", + "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", + "dev": true }, "node_modules/lodash.debounce": { "version": "4.0.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true }, "node_modules/lodash.isstring": { "version": "4.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lodash.uniqby": { "version": "4.7.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", + "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", + "dev": true }, "node_modules/log-symbols": { "version": "5.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", "dependencies": { "chalk": "^5.0.0", "is-unicode-supported": "^1.1.0" @@ -5040,7 +6722,8 @@ }, "node_modules/log-symbols/node_modules/chalk": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -5050,7 +6733,8 @@ }, "node_modules/longest-streak": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5058,7 +6742,8 @@ }, "node_modules/loose-envify": { "version": "1.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -5068,30 +6753,34 @@ }, "node_modules/loupe": { "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, - "license": "MIT", "dependencies": { "get-func-name": "^2.0.1" } }, "node_modules/lru-cache": { "version": "5.1.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/lz-string": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, - "license": "MIT", "bin": { "lz-string": "bin/bin.js" } }, "node_modules/magic-string": { - "version": "0.30.5", - "license": "MIT", + "version": "0.30.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", + "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -5101,48 +6790,52 @@ }, "node_modules/markdown-table": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/marked": { - "version": "9.1.5", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", + "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", "dev": true, - "license": "MIT", "peer": true, "bin": { "marked": "bin/marked.js" }, "engines": { - "node": ">= 16" + "node": ">= 18" } }, "node_modules/marked-terminal": { - "version": "6.0.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.0.0.tgz", + "integrity": "sha512-sNEx8nn9Ktcm6pL0TnRz8tnXq/mSS0Q1FRSwJOAqw4lAB4l49UeDf85Gm1n9RPFm5qurCPjwi1StAQT2XExhZw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "ansi-escapes": "^6.2.0", - "cardinal": "^2.1.1", "chalk": "^5.3.0", + "cli-highlight": "^2.1.11", "cli-table3": "^0.6.3", - "node-emoji": "^2.1.0", + "node-emoji": "^2.1.3", "supports-hyperlinks": "^3.0.0" }, "engines": { "node": ">=16.0.0" }, "peerDependencies": { - "marked": ">=1 <10" + "marked": ">=1 <13" } }, "node_modules/marked-terminal/node_modules/chalk": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -5153,7 +6846,8 @@ }, "node_modules/mdast-util-definitions": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", + "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -5166,7 +6860,8 @@ }, "node_modules/mdast-util-find-and-replace": { "version": "3.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", @@ -5178,19 +6873,10 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { - "version": "5.0.0", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/mdast-util-from-markdown": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -5212,7 +6898,8 @@ }, "node_modules/mdast-util-gfm": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", @@ -5229,7 +6916,8 @@ }, "node_modules/mdast-util-gfm-autolink-literal": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", @@ -5244,7 +6932,8 @@ }, "node_modules/mdast-util-gfm-footnote": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", @@ -5259,7 +6948,8 @@ }, "node_modules/mdast-util-gfm-strikethrough": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", @@ -5272,7 +6962,8 @@ }, "node_modules/mdast-util-gfm-table": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", @@ -5287,7 +6978,8 @@ }, "node_modules/mdast-util-gfm-task-list-item": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", @@ -5300,8 +6992,9 @@ } }, "node_modules/mdast-util-phrasing": { - "version": "4.0.0", - "license": "MIT", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" @@ -5313,7 +7006,8 @@ }, "node_modules/mdast-util-to-hast": { "version": "13.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -5331,7 +7025,8 @@ }, "node_modules/mdast-util-to-markdown": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -5349,7 +7044,8 @@ }, "node_modules/mdast-util-to-string": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dependencies": { "@types/mdast": "^4.0.0" }, @@ -5360,8 +7056,9 @@ }, "node_modules/meow": { "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", "dev": true, - "license": "MIT", "engines": { "node": ">=16.10" }, @@ -5371,17 +7068,21 @@ }, "node_modules/merge-stream": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/merge2": { "version": "1.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "engines": { "node": ">= 8" } }, "node_modules/micromark": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", "funding": [ { "type": "GitHub Sponsors", @@ -5392,7 +7093,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", @@ -5415,6 +7115,8 @@ }, "node_modules/micromark-core-commonmark": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", "funding": [ { "type": "GitHub Sponsors", @@ -5425,7 +7127,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", @@ -5447,7 +7148,8 @@ }, "node_modules/micromark-extension-gfm": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", "dependencies": { "micromark-extension-gfm-autolink-literal": "^2.0.0", "micromark-extension-gfm-footnote": "^2.0.0", @@ -5465,7 +7167,8 @@ }, "node_modules/micromark-extension-gfm-autolink-literal": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", @@ -5479,7 +7182,8 @@ }, "node_modules/micromark-extension-gfm-footnote": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", @@ -5497,7 +7201,8 @@ }, "node_modules/micromark-extension-gfm-strikethrough": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -5513,7 +7218,8 @@ }, "node_modules/micromark-extension-gfm-table": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", + "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -5528,7 +7234,8 @@ }, "node_modules/micromark-extension-gfm-tagfilter": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", "dependencies": { "micromark-util-types": "^2.0.0" }, @@ -5539,7 +7246,8 @@ }, "node_modules/micromark-extension-gfm-task-list-item": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", + "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -5554,6 +7262,8 @@ }, "node_modules/micromark-factory-destination": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", "funding": [ { "type": "GitHub Sponsors", @@ -5564,7 +7274,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -5573,6 +7282,8 @@ }, "node_modules/micromark-factory-label": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", "funding": [ { "type": "GitHub Sponsors", @@ -5583,7 +7294,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -5593,6 +7303,8 @@ }, "node_modules/micromark-factory-space": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", "funding": [ { "type": "GitHub Sponsors", @@ -5603,7 +7315,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -5611,6 +7322,8 @@ }, "node_modules/micromark-factory-title": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", "funding": [ { "type": "GitHub Sponsors", @@ -5621,7 +7334,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -5631,6 +7343,8 @@ }, "node_modules/micromark-factory-whitespace": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", "funding": [ { "type": "GitHub Sponsors", @@ -5641,7 +7355,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -5650,7 +7363,9 @@ } }, "node_modules/micromark-util-character": { - "version": "2.0.1", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -5661,7 +7376,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -5669,6 +7383,8 @@ }, "node_modules/micromark-util-chunked": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", "funding": [ { "type": "GitHub Sponsors", @@ -5679,13 +7395,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-classify-character": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", "funding": [ { "type": "GitHub Sponsors", @@ -5696,7 +7413,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -5705,6 +7421,8 @@ }, "node_modules/micromark-util-combine-extensions": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", "funding": [ { "type": "GitHub Sponsors", @@ -5715,7 +7433,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -5723,6 +7440,8 @@ }, "node_modules/micromark-util-decode-numeric-character-reference": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", "funding": [ { "type": "GitHub Sponsors", @@ -5733,13 +7452,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-decode-string": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", "funding": [ { "type": "GitHub Sponsors", @@ -5750,7 +7470,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -5760,6 +7479,8 @@ }, "node_modules/micromark-util-encode": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", "funding": [ { "type": "GitHub Sponsors", @@ -5769,11 +7490,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromark-util-html-tag-name": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", "funding": [ { "type": "GitHub Sponsors", @@ -5783,11 +7505,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromark-util-normalize-identifier": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", "funding": [ { "type": "GitHub Sponsors", @@ -5798,13 +7521,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-resolve-all": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", "funding": [ { "type": "GitHub Sponsors", @@ -5815,13 +7539,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-sanitize-uri": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", "funding": [ { "type": "GitHub Sponsors", @@ -5832,7 +7557,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", @@ -5841,6 +7565,8 @@ }, "node_modules/micromark-util-subtokenize": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", "funding": [ { "type": "GitHub Sponsors", @@ -5851,7 +7577,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -5861,6 +7586,8 @@ }, "node_modules/micromark-util-symbol": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", "funding": [ { "type": "GitHub Sponsors", @@ -5870,11 +7597,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromark-util-types": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", "funding": [ { "type": "GitHub Sponsors", @@ -5884,12 +7612,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromatch": { "version": "4.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -5900,7 +7628,8 @@ }, "node_modules/mime": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "bin": { "mime": "cli.js" }, @@ -5910,16 +7639,18 @@ }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -5928,19 +7659,18 @@ } }, "node_modules/mimic-fn": { - "version": "4.0.0", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, "node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5950,16 +7680,18 @@ }, "node_modules/minimist": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/mkdirp": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", "dev": true, - "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -5971,38 +7703,55 @@ } }, "node_modules/mlly": { - "version": "1.4.2", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", "dev": true, - "license": "MIT", "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", + "acorn": "^8.11.3", + "pathe": "^1.1.2", "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "ufo": "^1.3.2" } }, "node_modules/monaco-editor": { - "version": "0.44.0", - "license": "MIT", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.46.0.tgz", + "integrity": "sha512-ADwtLIIww+9FKybWscd7OCfm9odsFYHImBRI1v9AviGce55QY8raT+9ihH8jX/E/e6QVSGM+pKj4jSUSRmALNQ==", "peer": true }, "node_modules/ms": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/muggle-string": { - "version": "0.3.1", - "license": "MIT" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "peer": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } }, "node_modules/nanoid": { "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -6012,7 +7761,8 @@ }, "node_modules/needle": { "version": "2.9.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", "dependencies": { "debug": "^3.2.6", "iconv-lite": "^0.4.4", @@ -6027,26 +7777,31 @@ }, "node_modules/needle/node_modules/debug": { "version": "3.2.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dependencies": { "ms": "^2.1.1" } }, "node_modules/neo-async": { "version": "2.6.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true }, "node_modules/nerf-dart": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", + "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", + "dev": true }, "node_modules/netlify-cli": { "version": "17.10.2", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.10.2.tgz", + "integrity": "sha512-pKXL+w5/vm4ld6IUotBEse3KvN4+WCComLP6a73OiOvy8uM6uxtDUiuL+uAhRaozohjjaU/Ym4q1TqwbqWF5rA==", "dev": true, "hasInstallScript": true, - "license": "MIT", + "hasShrinkwrap": true, "dependencies": { "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", @@ -6169,8 +7924,9 @@ }, "node_modules/netlify-cli/node_modules/@babel/code-frame": { "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" @@ -6181,8 +7937,9 @@ }, "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/ansi-styles": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -6192,8 +7949,9 @@ }, "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -6205,1019 +7963,1489 @@ }, "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", + "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.0" } }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/types": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", + "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/browser": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz", + "integrity": "sha512-4J4s53ZpYr3hHA+QjxUjOI6U+A8+XuUVH45UshE87Jp2Y4mV8ML2DovejqJS8J8yjdbnh2z1Wtg/v3WUNt4ayQ==", + "dev": true, + "dependencies": { + "@bugsnag/core": "^7.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/core": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz", + "integrity": "sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==", + "dev": true, + "dependencies": { + "@bugsnag/cuid": "^3.0.0", + "@bugsnag/safe-json-stringify": "^6.0.0", + "error-stack-parser": "^2.0.3", + "iserror": "0.0.2", + "stack-generator": "^2.0.3" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/cuid": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz", + "integrity": "sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@bugsnag/js": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.2.tgz", + "integrity": "sha512-Q08k0h0h6NFwFGkFmib39Uln2WpvJdqT1EGF1JlyYiGW03Y+VopVb9r37pZrRrN9IY08mxaIEO8la5xeaWAs6A==", + "dev": true, + "dependencies": { + "@bugsnag/browser": "^7.20.2", + "@bugsnag/node": "^7.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/node": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.19.0.tgz", + "integrity": "sha512-c4snyxx5d/fsMogmgehFBGc//daH6+4XCplia4zrEQYltjaQ+l8ud0dPx623DgJl/2j1+2zlRc7y7IHSd7Gm5w==", + "dev": true, + "dependencies": { + "@bugsnag/core": "^7.19.0", + "byline": "^5.0.0", + "error-stack-parser": "^2.0.2", + "iserror": "^0.0.2", + "pump": "^3.0.0", + "stack-generator": "^2.0.3" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/safe-json-stringify": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz", + "integrity": "sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/netlify-cli/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@dabh/diagnostics": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", + "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", + "dev": true, + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@dependents/detective-less": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.0.0.tgz", + "integrity": "sha512-0udn+HKjGUzTX4Z+0vXdEJVsO28gxy5QxWjeChK4ZH+bwdvIXLuztiGZk8wLyAG1+LNZ5haVHKr5j1XfJnAkyQ==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^6.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/accept-negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", + "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", + "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==", + "dev": true, + "dependencies": { + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1", + "fast-uri": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", + "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/error": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", + "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", + "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", "dev": true, - "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "fast-json-stringify": "^5.7.0" } }, - "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { - "version": "7.23.4", + "node_modules/netlify-cli/node_modules/@fastify/send": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.0.1.tgz", + "integrity": "sha512-8jdouu0o5d0FMq1+zCKeKXc1tmOQ5tTGYdQP3MpyF9+WWrZT1KCBdh6hvoEYxOm3oJG/akdE9BpehLiJgYRvGw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" + "dependencies": { + "@lukeed/ms": "^2.0.1", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "2.0.0", + "mime": "^3.0.0" } }, - "node_modules/netlify-cli/node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, - "license": "MIT", "engines": { - "node": ">=6.9.0" + "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/@babel/highlight": { - "version": "7.22.13", + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" + "bin": { + "mime": "cli.js" }, "engines": { - "node": ">=4" + "node": ">=10.0.0" } }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", + "node_modules/netlify-cli/node_modules/@fastify/static": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.10.2.tgz", + "integrity": "sha512-UoaMvIHSBLCZBYOVZwFRYqX2ufUhd7FFMYGDeSf0Z+D8jhYtwljjmuQGuanUP8kS4y/ZEV1a8mfLha3zNwsnnQ==", "dev": true, - "license": "MIT", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" + "@fastify/accept-negotiator": "^1.0.0", + "@fastify/send": "^2.0.0", + "content-disposition": "^0.5.3", + "fastify-plugin": "^4.0.0", + "glob": "^8.0.1", + "p-limit": "^3.1.0", + "readable-stream": "^4.0.0" } }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" } }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, - "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@babel/parser": { - "version": "7.23.0", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" } }, - "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.23.4", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", + "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" }, "engines": { - "node": ">=6.9.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@bugsnag/browser": { - "version": "7.20.2", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", "dev": true, - "license": "MIT", - "dependencies": { - "@bugsnag/core": "^7.19.0" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/netlify-cli/node_modules/@bugsnag/core": { - "version": "7.19.0", + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { - "@bugsnag/cuid": "^3.0.0", - "@bugsnag/safe-json-stringify": "^6.0.0", - "error-stack-parser": "^2.0.3", - "iserror": "0.0.2", - "stack-generator": "^2.0.3" + "safe-buffer": "~5.2.0" } }, - "node_modules/netlify-cli/node_modules/@bugsnag/cuid": { - "version": "3.0.2", + "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.2.tgz", + "integrity": "sha512-Lf2pUhNTaviEdEaGgjU+29qw3arX7Qd/45q66F3z1EV5hroE6wM9xSHPvjB8EY+b1RmKZgwnLWXQorC6fZ9g5g==", "dev": true, - "license": "MIT" + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } }, - "node_modules/netlify-cli/node_modules/@bugsnag/js": { - "version": "7.20.2", + "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.9.tgz", + "integrity": "sha512-YJsOehVXzgurc+lLAxYnlSMc1p/Gu6VAvnfx0ATi2nzvr0YZcjhmZDeY8SeAKv1M7zE3aEJH0Xo9mK1iZ8GYoQ==", "dev": true, - "license": "MIT", "dependencies": { - "@bugsnag/browser": "^7.20.2", - "@bugsnag/node": "^7.19.0" + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.4", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" } }, - "node_modules/netlify-cli/node_modules/@bugsnag/node": { - "version": "7.19.0", + "node_modules/netlify-cli/node_modules/@honeycombio/opentelemetry-node": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@honeycombio/opentelemetry-node/-/opentelemetry-node-0.5.0.tgz", + "integrity": "sha512-bAg//j0Lh0SFC0LhUrrgpO4FVScOBDt+my4YXeIo9lHi1aXXn6meaB/ycecjVfjyQLaGYWKPKu2C66rTgKIzMQ==", "dev": true, - "license": "MIT", "dependencies": { - "@bugsnag/core": "^7.19.0", - "byline": "^5.0.0", - "error-stack-parser": "^2.0.2", - "iserror": "^0.0.2", - "pump": "^3.0.0", - "stack-generator": "^2.0.3" + "@grpc/grpc-js": "^1.7.3", + "@opentelemetry/api": "^1.4.1", + "@opentelemetry/core": "^1.13.0", + "@opentelemetry/exporter-metrics-otlp-grpc": "^0.41.0", + "@opentelemetry/exporter-metrics-otlp-proto": "^0.39.1", + "@opentelemetry/exporter-trace-otlp-grpc": "^0.41.0", + "@opentelemetry/exporter-trace-otlp-proto": "^0.41.0", + "@opentelemetry/resources": "^1.13.0", + "@opentelemetry/sdk-metrics": "^1.13.0", + "@opentelemetry/sdk-node": "^0.39.1", + "@opentelemetry/sdk-trace-base": "^1.13.0", + "axios": "^1.1.3" + }, + "engines": { + "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@bugsnag/safe-json-stringify": { - "version": "6.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@colors/colors": { - "version": "1.5.0", + "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", + "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", "dev": true, - "license": "MIT", "engines": { - "node": ">=0.1.90" + "node": ">=10.10.0" } }, - "node_modules/netlify-cli/node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", + "node_modules/netlify-cli/node_modules/@import-maps/resolve": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@import-maps/resolve/-/resolve-1.0.1.tgz", + "integrity": "sha512-tWZNBIS1CoekcwlMuyG2mr0a1Wo5lb5lEHwwWvZo+5GLgr3e9LLDTtmgtCWEwBpXMkxn9D+2W9j2FY6eZQq0tA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", "dev": true, - "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" }, "engines": { - "node": ">=12" + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/netlify-cli/node_modules/@dabh/diagnostics": { - "version": "2.0.2", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", "dev": true, - "license": "MIT", "dependencies": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" + "@types/yargs-parser": "*" } }, - "node_modules/netlify-cli/node_modules/@dependents/detective-less": { - "version": "4.0.0", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, - "license": "MIT", "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=14" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@fastify/accept-negotiator": { - "version": "1.1.0", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">=14" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler": { - "version": "3.5.0", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, - "license": "MIT", "dependencies": { - "ajv": "^8.11.0", - "ajv-formats": "^2.1.1", - "fast-uri": "^2.0.0" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/ajv": { - "version": "8.12.0", + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, - "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "has-flag": "^4.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/json-schema-traverse": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { - "version": "1.3.0", + "node_modules/netlify-cli/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, - "license": "MIT" + "engines": { + "node": ">=6.0.0" + } }, - "node_modules/netlify-cli/node_modules/@fastify/error": { - "version": "3.2.0", - "dev": true, - "license": "MIT" + "node_modules/netlify-cli/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true }, - "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { - "version": "4.3.0", + "node_modules/netlify-cli/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, - "license": "MIT", "dependencies": { - "fast-json-stringify": "^5.7.0" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/netlify-cli/node_modules/@fastify/send": { + "node_modules/netlify-cli/node_modules/@lukeed/ms": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", + "integrity": "sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "dev": true, - "license": "MIT", "dependencies": { - "@lukeed/ms": "^2.0.1", - "escape-html": "~1.0.3", - "fast-decode-uri-component": "^1.0.1", - "http-errors": "2.0.0", - "mime": "^3.0.0" + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" } }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/depd": { - "version": "2.0.0", + "node_modules/netlify-cli/node_modules/@netlify/binary-info": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@netlify/binary-info/-/binary-info-1.0.0.tgz", + "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/blobs": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.1.tgz", + "integrity": "sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg==", "dev": true, - "license": "MIT", "engines": { - "node": ">= 0.8" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/http-errors": { - "version": "2.0.0", + "node_modules/netlify-cli/node_modules/@netlify/build": { + "version": "29.31.0", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.31.0.tgz", + "integrity": "sha512-XtUXnj3LtdWxcgP4kz1k0creF9bZa7eGNh85B89sw4V99Mtsn1Sl89yAZJkEH6rtuGJIs1eiQ261nlhUZ6+C6Q==", "dev": true, - "license": "MIT", "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" + "@bugsnag/js": "^7.0.0", + "@honeycombio/opentelemetry-node": "^0.5.0", + "@netlify/blobs": "^6.3.1", + "@netlify/cache-utils": "^5.1.5", + "@netlify/config": "^20.10.0", + "@netlify/edge-bundler": "10.1.3", + "@netlify/framework-info": "^9.8.10", + "@netlify/functions-utils": "^5.2.45", + "@netlify/git-utils": "^5.1.1", + "@netlify/plugins-list": "^6.72.0", + "@netlify/run-utils": "^5.1.1", + "@netlify/zip-it-and-ship-it": "9.28.1", + "@opentelemetry/api": "^1.4.1", + "@opentelemetry/core": "^1.17.1", + "@sindresorhus/slugify": "^2.0.0", + "ansi-escapes": "^6.0.0", + "chalk": "^5.0.0", + "clean-stack": "^4.0.0", + "execa": "^6.0.0", + "fdir": "^6.0.1", + "figures": "^5.0.0", + "filter-obj": "^5.0.0", + "got": "^12.0.0", + "hot-shots": "10.0.0", + "indent-string": "^5.0.0", + "is-plain-obj": "^4.0.0", + "js-yaml": "^4.0.0", + "keep-func-props": "^4.0.0", + "locate-path": "^7.0.0", + "log-process-errors": "^8.0.0", + "map-obj": "^5.0.0", + "memoize-one": "^6.0.0", + "node-fetch": "^3.3.2", + "os-name": "^5.0.0", + "p-event": "^5.0.0", + "p-every": "^2.0.0", + "p-filter": "^3.0.0", + "p-locate": "^6.0.0", + "p-map": "^6.0.0", + "p-reduce": "^3.0.0", + "path-exists": "^5.0.0", + "path-type": "^5.0.0", + "pkg-dir": "^7.0.0", + "pretty-ms": "^8.0.0", + "ps-list": "^8.0.0", + "read-pkg-up": "^9.0.0", + "readdirp": "^3.4.0", + "resolve": "^2.0.0-next.1", + "rfdc": "^1.3.0", + "safe-json-stringify": "^1.2.0", + "semver": "^7.3.8", + "string-width": "^5.0.0", + "strip-ansi": "^7.0.0", + "supports-color": "^9.0.0", + "terminal-link": "^3.0.0", + "ts-node": "^10.9.1", + "typescript": "^5.0.0", + "uuid": "^9.0.0", + "yargs": "^17.6.0" + }, + "bin": { + "netlify-build": "bin.js" }, "engines": { - "node": ">= 0.8" + "node": "^14.16.0 || >=16.0.0" + }, + "peerDependencies": { + "@netlify/opentelemetry-sdk-setup": "^1.0.1" + }, + "peerDependenciesMeta": { + "@netlify/opentelemetry-sdk-setup": { + "optional": true + } } }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/mime": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/build-info": { + "version": "7.11.3", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.11.3.tgz", + "integrity": "sha512-lnJsJcoFSZIIB+4tOU/rdPjPn2+TP896B9y23z5THyACeN/e2I0Y7Y+d+BzHgFDcJBwqFpIehEs2jf8wPb9CHw==", "dev": true, - "license": "MIT", + "dependencies": { + "@bugsnag/js": "^7.20.0", + "dot-prop": "^7.2.0", + "find-up": "^6.3.0", + "minimatch": "^9.0.0", + "read-pkg": "^7.1.0", + "semver": "^7.3.8", + "toml": "^3.0.0", + "yaml": "^2.1.3", + "yargs": "^17.6.0" + }, "bin": { - "mime": "cli.js" + "build-info": "bin.js" }, "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static": { - "version": "6.10.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@fastify/accept-negotiator": "^1.0.0", - "@fastify/send": "^2.0.0", - "content-disposition": "^0.5.3", - "fastify-plugin": "^4.0.0", - "glob": "^8.0.1", - "p-limit": "^3.1.0", - "readable-stream": "^4.0.0" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { - "version": "6.0.3", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { - "version": "8.1.0", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, - "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { - "version": "5.1.6", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", "dev": true, - "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { - "version": "4.4.2", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/safe-buffer": { - "version": "5.2.1", + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" + "engines": { + "node": ">= 14" + } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/string_decoder": { - "version": "1.3.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/core": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.18.1.tgz", + "integrity": "sha512-kvnUqezHMhsQvdsnhnqTNfAJs3ox/isB0SVrM1dhVFw7SsB7TstuVa6fgWnN2GdPyilIFLUvvbTZoVRmx6eiRg==", "dev": true, - "license": "MIT", "dependencies": { - "safe-buffer": "~5.2.0" + "@opentelemetry/semantic-conventions": "1.18.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.8.0" } }, - "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { - "version": "1.9.2", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.18.1.tgz", + "integrity": "sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA==", "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" - }, "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { - "version": "0.7.9", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", "dev": true, - "license": "Apache-2.0", - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.2.4", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, "engines": { - "node": ">=6" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@honeycombio/opentelemetry-node": { - "version": "0.5.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@grpc/grpc-js": "^1.7.3", - "@opentelemetry/api": "^1.4.1", - "@opentelemetry/core": "^1.13.0", - "@opentelemetry/exporter-metrics-otlp-grpc": "^0.41.0", - "@opentelemetry/exporter-metrics-otlp-proto": "^0.39.1", - "@opentelemetry/exporter-trace-otlp-grpc": "^0.41.0", - "@opentelemetry/exporter-trace-otlp-proto": "^0.41.0", - "@opentelemetry/resources": "^1.13.0", - "@opentelemetry/sdk-metrics": "^1.13.0", - "@opentelemetry/sdk-node": "^0.39.1", - "@opentelemetry/sdk-trace-base": "^1.13.0", - "axios": "^1.1.3" + "defer-to-connect": "^2.0.1" }, "engines": { - "node": ">=14" + "node": ">=14.16" } }, - "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { - "version": "2.0.4", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, - "license": "Apache-2.0", "engines": { - "node": ">=10.10.0" + "node": ">=14.16" } }, - "node_modules/netlify-cli/node_modules/@import-maps/resolve": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@ioredis/commands": { - "version": "1.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@jest/types": { - "version": "27.5.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", "dev": true, - "license": "MIT", "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^16.0.0", - "chalk": "^4.0.0" + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": ">=14.16" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/@types/yargs": { - "version": "16.0.4", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", - "dependencies": { - "@types/yargs-parser": "*" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, - "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, - "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" }, "engines": { - "node": ">=10" + "node": ">=14" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, - "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "dev": true, - "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" }, "engines": { - "node": ">=8" + "node": ">=10.19.0" } }, - "node_modules/netlify-cli/node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "license": "MIT", "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@lukeed/ms": { - "version": "2.0.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/binary-info": { - "version": "1.0.0", - "dev": true, - "license": "Apache 2" - }, - "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "6.3.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "license": "MIT", "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.31.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, - "license": "MIT", - "dependencies": { - "@bugsnag/js": "^7.0.0", - "@honeycombio/opentelemetry-node": "^0.5.0", - "@netlify/blobs": "^6.3.1", - "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.10.0", - "@netlify/edge-bundler": "10.1.3", - "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.45", - "@netlify/git-utils": "^5.1.1", - "@netlify/plugins-list": "^6.72.0", - "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.28.1", - "@opentelemetry/api": "^1.4.1", - "@opentelemetry/core": "^1.17.1", - "@sindresorhus/slugify": "^2.0.0", - "ansi-escapes": "^6.0.0", - "chalk": "^5.0.0", - "clean-stack": "^4.0.0", - "execa": "^6.0.0", - "fdir": "^6.0.1", - "figures": "^5.0.0", - "filter-obj": "^5.0.0", - "got": "^12.0.0", - "hot-shots": "10.0.0", - "indent-string": "^5.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "keep-func-props": "^4.0.0", - "locate-path": "^7.0.0", - "log-process-errors": "^8.0.0", - "map-obj": "^5.0.0", - "memoize-one": "^6.0.0", - "node-fetch": "^3.3.2", - "os-name": "^5.0.0", - "p-event": "^5.0.0", - "p-every": "^2.0.0", - "p-filter": "^3.0.0", - "p-locate": "^6.0.0", - "p-map": "^6.0.0", - "p-reduce": "^3.0.0", - "path-exists": "^5.0.0", - "path-type": "^5.0.0", - "pkg-dir": "^7.0.0", - "pretty-ms": "^8.0.0", - "ps-list": "^8.0.0", - "read-pkg-up": "^9.0.0", - "readdirp": "^3.4.0", - "resolve": "^2.0.0-next.1", - "rfdc": "^1.3.0", - "safe-json-stringify": "^1.2.0", - "semver": "^7.3.8", - "string-width": "^5.0.0", - "strip-ansi": "^7.0.0", - "supports-color": "^9.0.0", - "terminal-link": "^3.0.0", - "ts-node": "^10.9.1", - "typescript": "^5.0.0", - "uuid": "^9.0.0", - "yargs": "^17.6.0" - }, - "bin": { - "netlify-build": "bin.js" - }, "engines": { - "node": "^14.16.0 || >=16.0.0" - }, - "peerDependencies": { - "@netlify/opentelemetry-sdk-setup": "^1.0.1" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependenciesMeta": { - "@netlify/opentelemetry-sdk-setup": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.11.3", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, - "license": "MIT", "dependencies": { - "@bugsnag/js": "^7.20.0", - "dot-prop": "^7.2.0", - "find-up": "^6.3.0", - "minimatch": "^9.0.0", - "read-pkg": "^7.1.0", - "semver": "^7.3.8", - "toml": "^3.0.0", - "yaml": "^2.1.3", - "yargs": "^17.6.0" - }, - "bin": { - "build-info": "bin.js" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/brace-expansion": { - "version": "2.0.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { - "version": "9.0.3", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "path-key": "^4.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { - "version": "7.1.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { - "@types/normalize-package-data": "^2.4.1", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^2.0.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">=12.20" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { - "version": "2.19.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { - "version": "2.3.4", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "license": "ISC", + "dependencies": { + "p-limit": "^4.0.0" + }, "engines": { - "node": ">= 14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/core": { - "version": "1.18.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/semantic-conventions": "1.18.1" - }, "engines": { - "node": ">=14" + "node": ">=16" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.8.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.18.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { - "version": "5.6.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", "dev": true, - "license": "MIT", "dependencies": { - "defer-to-connect": "^2.0.1" + "find-up": "^6.3.0" }, "engines": { "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { - "version": "7.0.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, - "license": "MIT", + "dependencies": { + "lowercase-keys": "^3.0.0" + }, "engines": { "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { - "version": "10.2.14", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=14.16" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { - "version": "9.2.2", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/escape-string-regexp": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, - "license": "MIT", "engines": { - "node": ">=12" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/execa": { - "version": "6.1.0", + "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.5.tgz", + "integrity": "sha512-lMNdFmy2Yu3oVquSPooRDLxJ8QOsIX6X6vzA2pKz/9V2LQFJiqBukggXM+Rnqzk1regPpdJ0jK3dPGvOKaRQgg==", "dev": true, - "license": "MIT", "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" + "cpy": "^9.0.0", + "get-stream": "^6.0.0", + "globby": "^13.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "move-file": "^3.0.0", + "path-exists": "^5.0.0", + "readdirp": "^3.4.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/figures": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, - "license": "MIT", "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" }, "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { - "version": "12.6.1", + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, "engines": { - "node": ">=14.16" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { - "version": "2.2.1", + "node_modules/netlify-cli/node_modules/@netlify/config": { + "version": "20.10.0", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.0.tgz", + "integrity": "sha512-7CNoL5IPSRBzDVzxuQgltZ71D/vZ/oYR29sfN8EXjAFOZPSLtnZgborcPa9V9BXLN4N5h0hFp2A26lnnCttEFg==", "dev": true, - "license": "MIT", "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" + "chalk": "^5.0.0", + "cron-parser": "^4.1.0", + "deepmerge": "^4.2.2", + "dot-prop": "^7.0.0", + "execa": "^6.0.0", + "fast-safe-stringify": "^2.0.7", + "figures": "^5.0.0", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "indent-string": "^5.0.0", + "is-plain-obj": "^4.0.0", + "js-yaml": "^4.0.0", + "map-obj": "^5.0.0", + "netlify": "^13.1.11", + "netlify-headers-parser": "^7.1.2", + "netlify-redirect-parser": "^14.2.0", + "node-fetch": "^3.3.1", + "omit.js": "^2.0.2", + "p-locate": "^6.0.0", + "path-type": "^5.0.0", + "toml": "^3.0.0", + "tomlify-j0.4": "^3.0.0", + "validate-npm-package-name": "^4.0.0", + "yargs": "^17.6.0" + }, + "bin": { + "netlify-config": "bin.js" }, "engines": { - "node": ">=10.19.0" + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { - "version": "3.0.1", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "Apache-2.0", "engines": { - "node": ">=12.20.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/indent-string": { + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/figures": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, - "license": "MIT", + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, "engines": { - "node": ">=12" + "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "license": "MIT", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/map-obj": { - "version": "5.0.2", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { - "version": "4.0.0", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -7225,10 +9453,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, - "license": "MIT", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -7242,21 +9471,11 @@ "url": "https://opencollective.com/node-fetch" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { - "version": "8.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -7267,10 +9486,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -7281,18 +9501,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-limit": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -7303,10 +9516,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-locate": { + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-locate": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^4.0.0" }, @@ -7317,209 +9531,521 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-map": { - "version": "6.0.0", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=16" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-10.1.3.tgz", + "integrity": "sha512-+cFFUrdbkhbtmpvQlRam4CmNguKBjte7usNXO1IxDmExeYxdwkDWWBCjOO4zd/D12TIC3HSJGJjT76GkF+RwTg==", + "dev": true, + "dependencies": { + "@import-maps/resolve": "^1.0.1", + "@vercel/nft": "^0.24.3", + "ajv": "^8.11.2", + "ajv-errors": "^3.0.0", + "better-ajv-errors": "^1.2.0", + "common-path-prefix": "^3.0.0", + "env-paths": "^3.0.0", + "esbuild": "0.19.6", + "execa": "^6.0.0", + "find-up": "^6.3.0", + "get-package-name": "^2.2.0", + "get-port": "^6.1.2", + "is-path-inside": "^4.0.0", + "jsonc-parser": "^3.2.0", + "node-fetch": "^3.1.1", + "node-stream-zip": "^1.15.0", + "p-retry": "^5.1.1", + "p-wait-for": "^4.1.0", + "path-key": "^4.0.0", + "regexp-tree": "^0.1.24", + "semver": "^7.3.8", + "tmp-promise": "^3.0.3", + "urlpattern-polyfill": "8.0.2", + "uuid": "^9.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", + "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", + "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", + "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", + "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", + "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", + "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", + "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", + "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", + "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", + "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", + "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", + "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", + "cpu": [ + "mips64el" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-type": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", + "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/pkg-dir": { - "version": "7.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", + "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^6.3.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", + "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", + "cpu": [ + "s390x" + ], "dev": true, - "license": "MIT", - "dependencies": { - "lowercase-keys": "^3.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { - "version": "5.1.2", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", + "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/strip-final-newline": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", + "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { - "version": "1.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", + "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { - "version": "5.1.5", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", + "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "cpy": "^9.0.0", - "get-stream": "^6.0.0", - "globby": "^13.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "move-file": "^3.0.0", - "path-exists": "^5.0.0", - "readdirp": "^3.4.0" - }, + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/globby": { - "version": "13.2.2", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", + "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/path-exists": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", + "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", + "cpu": [ + "ia32" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/slash": { - "version": "4.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", + "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.10.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { + "version": "0.24.3", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.24.3.tgz", + "integrity": "sha512-IyBdIxmFAeGZnEfMgt4QrGK7XX4lWazlQj34HEi9dw04/WeDBJ7r1yaOIO5tTf9pbfvwUFodj9b0H+NDGGoOMg==", "dev": true, - "license": "MIT", "dependencies": { - "chalk": "^5.0.0", - "cron-parser": "^4.1.0", - "deepmerge": "^4.2.2", - "dot-prop": "^7.0.0", - "execa": "^6.0.0", - "fast-safe-stringify": "^2.0.7", - "figures": "^5.0.0", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "indent-string": "^5.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "map-obj": "^5.0.0", - "netlify": "^13.1.11", - "netlify-headers-parser": "^7.1.2", - "netlify-redirect-parser": "^14.2.0", - "node-fetch": "^3.3.1", - "omit.js": "^2.0.2", - "p-locate": "^6.0.0", - "path-type": "^5.0.0", - "toml": "^3.0.0", - "tomlify-j0.4": "^3.0.0", - "validate-npm-package-name": "^4.0.0", - "yargs": "^17.6.0" + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" }, "bin": { - "netlify-config": "bin.js" + "nft": "out/cli.js" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=16" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, - "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "dev": true, + "peerDependencies": { + "ajv": "^8.0.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", + "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, "engines": { "node": ">=12" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "@esbuild/android-arm": "0.19.6", + "@esbuild/android-arm64": "0.19.6", + "@esbuild/android-x64": "0.19.6", + "@esbuild/darwin-arm64": "0.19.6", + "@esbuild/darwin-x64": "0.19.6", + "@esbuild/freebsd-arm64": "0.19.6", + "@esbuild/freebsd-x64": "0.19.6", + "@esbuild/linux-arm": "0.19.6", + "@esbuild/linux-arm64": "0.19.6", + "@esbuild/linux-ia32": "0.19.6", + "@esbuild/linux-loong64": "0.19.6", + "@esbuild/linux-mips64el": "0.19.6", + "@esbuild/linux-ppc64": "0.19.6", + "@esbuild/linux-riscv64": "0.19.6", + "@esbuild/linux-s390x": "0.19.6", + "@esbuild/linux-x64": "0.19.6", + "@esbuild/netbsd-x64": "0.19.6", + "@esbuild/openbsd-x64": "0.19.6", + "@esbuild/sunos-x64": "0.19.6", + "@esbuild/win32-arm64": "0.19.6", + "@esbuild/win32-ia32": "0.19.6", + "@esbuild/win32-x64": "0.19.6" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/execa": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", @@ -7538,33 +10064,32 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/figures": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, "engines": { - "node": ">=14" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/indent-string": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -7572,21 +10097,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { - "version": "5.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", + "dev": true }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, - "license": "MIT", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -7600,10 +10121,11 @@ "url": "https://opencollective.com/node-fetch" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -7614,10 +10136,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/onetime": { + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -7628,38 +10151,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-limit": { - "version": "4.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^1.0.0" - }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-locate": { - "version": "6.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", "dev": true, - "license": "MIT", "dependencies": { - "p-limit": "^4.0.0" + "p-timeout": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -7667,164 +10190,135 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/strip-final-newline": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/framework-info": { + "version": "9.8.10", + "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.10.tgz", + "integrity": "sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==", "dev": true, - "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "filter-obj": "^5.0.0", + "find-up": "^6.3.0", + "is-plain-obj": "^4.0.0", + "locate-path": "^7.0.0", + "p-filter": "^3.0.0", + "p-locate": "^6.0.0", + "process": "^0.11.10", + "read-pkg-up": "^9.0.0", + "semver": "^7.3.8" + }, "engines": { - "node": ">=12" + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, - "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, "engines": { - "node": ">=12.20" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "10.1.3", + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "license": "MIT", "dependencies": { - "@import-maps/resolve": "^1.0.1", - "@vercel/nft": "^0.24.3", - "ajv": "^8.11.2", - "ajv-errors": "^3.0.0", - "better-ajv-errors": "^1.2.0", - "common-path-prefix": "^3.0.0", - "env-paths": "^3.0.0", - "esbuild": "0.19.6", - "execa": "^6.0.0", - "find-up": "^6.3.0", - "get-package-name": "^2.2.0", - "get-port": "^6.1.2", - "is-path-inside": "^4.0.0", - "jsonc-parser": "^3.2.0", - "node-fetch": "^3.1.1", - "node-stream-zip": "^1.15.0", - "p-retry": "^5.1.1", - "p-wait-for": "^4.1.0", - "path-key": "^4.0.0", - "regexp-tree": "^0.1.24", - "semver": "^7.3.8", - "tmp-promise": "^3.0.3", - "urlpattern-polyfill": "8.0.2", - "uuid": "^9.0.0" + "p-limit": "^4.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.6", - "cpu": [ - "arm64" - ], + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.24.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" + "node": ">=12.20" }, - "engines": { - "node": ">=16" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.12.0", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { + "version": "5.2.45", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.45.tgz", + "integrity": "sha512-p7NQwOUmDbOG8G+J0UlMOKtTnEoaQemMCM8DgzFd4aOvlzZP870ociP/e6hfaxrq1cFB/cFGax+xfuRWAX66pA==", "dev": true, - "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "@netlify/zip-it-and-ship-it": "9.28.1", + "cpy": "^9.0.0", + "path-exists": "^5.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "peerDependencies": { - "ajv": "^8.0.1" + "engines": { + "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { - "version": "0.19.6", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.19.6", - "@esbuild/android-arm64": "0.19.6", - "@esbuild/android-x64": "0.19.6", - "@esbuild/darwin-arm64": "0.19.6", - "@esbuild/darwin-x64": "0.19.6", - "@esbuild/freebsd-arm64": "0.19.6", - "@esbuild/freebsd-x64": "0.19.6", - "@esbuild/linux-arm": "0.19.6", - "@esbuild/linux-arm64": "0.19.6", - "@esbuild/linux-ia32": "0.19.6", - "@esbuild/linux-loong64": "0.19.6", - "@esbuild/linux-mips64el": "0.19.6", - "@esbuild/linux-ppc64": "0.19.6", - "@esbuild/linux-riscv64": "0.19.6", - "@esbuild/linux-s390x": "0.19.6", - "@esbuild/linux-x64": "0.19.6", - "@esbuild/netbsd-x64": "0.19.6", - "@esbuild/openbsd-x64": "0.19.6", - "@esbuild/sunos-x64": "0.19.6", - "@esbuild/win32-arm64": "0.19.6", - "@esbuild/win32-ia32": "0.19.6", - "@esbuild/win32-x64": "0.19.6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { + "node_modules/netlify-cli/node_modules/@netlify/git-utils": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", + "integrity": "sha512-oyHieuTZH3rKTmg7EKpGEGa28IFxta2oXuVwpPJI/FJAtBje3UE+yko0eDjNufgm3AyGa8G77trUxgBhInAYuw==", + "dev": true, + "dependencies": { + "execa": "^6.0.0", + "map-obj": "^5.0.0", + "micromatch": "^4.0.2", + "moize": "^6.1.3", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/execa": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", @@ -7843,62 +10337,32 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { - "version": "6.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/human-signals": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/json-schema-traverse": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { - "version": "3.3.2", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/npm-run-path": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -7909,10 +10373,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -7923,24 +10388,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-timeout": { - "version": "5.1.0", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-wait-for": { - "version": "4.1.0", + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", - "dependencies": { - "p-timeout": "^5.0.0" - }, "engines": { "node": ">=12" }, @@ -7948,136 +10409,259 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy/-/local-functions-proxy-1.1.1.tgz", + "integrity": "sha512-eXSsayLT6PMvjzFQpjC9nkg2Otc3lZ5GoYele9M6f8PmsvWpaXRhwjNQ0NYhQQ2UZbLMIiO2dH8dbRsT3bMkFw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "@netlify/local-functions-proxy-darwin-arm64": "1.1.1", + "@netlify/local-functions-proxy-darwin-x64": "1.1.1", + "@netlify/local-functions-proxy-freebsd-arm64": "1.1.1", + "@netlify/local-functions-proxy-freebsd-x64": "1.1.1", + "@netlify/local-functions-proxy-linux-arm": "1.1.1", + "@netlify/local-functions-proxy-linux-arm64": "1.1.1", + "@netlify/local-functions-proxy-linux-ia32": "1.1.1", + "@netlify/local-functions-proxy-linux-ppc64": "1.1.1", + "@netlify/local-functions-proxy-linux-x64": "1.1.1", + "@netlify/local-functions-proxy-openbsd-x64": "1.1.1", + "@netlify/local-functions-proxy-win32-ia32": "1.1.1", + "@netlify/local-functions-proxy-win32-x64": "1.1.1" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info": { - "version": "9.8.10", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-arm64/-/local-functions-proxy-darwin-arm64-1.1.1.tgz", + "integrity": "sha512-lphJ9qqZ3glnKWEqlemU1LMqXxtJ/tKf7VzakqqyjigwLscXSZSb6fupSjQfd4tR1xqxA76ylws/2HDhc/gs+Q==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^8.12.0", - "filter-obj": "^5.0.0", - "find-up": "^6.3.0", - "is-plain-obj": "^4.0.0", - "locate-path": "^7.0.0", - "p-filter": "^3.0.0", - "p-locate": "^6.0.0", - "process": "^0.11.10", - "read-pkg-up": "^9.0.0", - "semver": "^7.3.8" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { - "version": "8.12.0", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-x64/-/local-functions-proxy-darwin-x64-1.1.1.tgz", + "integrity": "sha512-4CRB0H+dXZzoEklq5Jpmg+chizXlVwCko94d8+UHWCgy/bA3M/rU/BJ8OLZisnJaAktHoeLABKtcLOhtRHpxZQ==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/json-schema-traverse": { - "version": "1.0.0", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-arm64/-/local-functions-proxy-freebsd-arm64-1.1.1.tgz", + "integrity": "sha512-u13lWTVMJDF0A6jX7V4N3HYGTIHLe5d1Z2wT43fSIHwXkTs6UXi72cGSraisajG+5JFIwHfPr7asw5vxFC0P9w==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT" + "optional": true, + "os": [ + "freebsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { - "version": "4.0.0", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-x64/-/local-functions-proxy-freebsd-x64-1.1.1.tgz", + "integrity": "sha512-g5xw4xATK5YDzvXtzJ8S1qSkWBiyF8VVRehXPMOAMzpGjCX86twYhWp8rbAk7yA1zBWmmWrWNA2Odq/MgpKJJg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optional": true, + "os": [ + "freebsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { - "version": "6.0.0", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm/-/local-functions-proxy-linux-arm-1.1.1.tgz", + "integrity": "sha512-YsTpL+AbHwQrfHWXmKnwUrJBjoUON363nr6jUG1ueYnpbbv6wTUA7gI5snMi/gkGpqFusBthAA7C30e6bixfiA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm64/-/local-functions-proxy-linux-arm64-1.1.1.tgz", + "integrity": "sha512-dPGu1H5n8na7mBKxiXQ+FNmthDAiA57wqgpm5JMAHtcdcmRvcXwJkwWVGvwfj8ShhYJHQaSaS9oPgO+mpKkgmA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ia32": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ia32/-/local-functions-proxy-linux-ia32-1.1.1.tgz", + "integrity": "sha512-Ra0FlXDrmPRaq+rYH3/ttkXSrwk1D5Zx/Na7UPfJZxMY7Qo5iY4bgi/FuzjzWzlp0uuKZOhYOYzYzsIIyrSvmw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ppc64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ppc64/-/local-functions-proxy-linux-ppc64-1.1.1.tgz", + "integrity": "sha512-oXf1satwqwUUxz7LHS1BxbRqc4FFEKIDFTls04eXiLReFR3sqv9H/QuYNTCCDMuRcCOd92qKyDfATdnxT4HR8w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-x64/-/local-functions-proxy-linux-x64-1.1.1.tgz", + "integrity": "sha512-bS3u4JuDg/eC0y4Na3i/29JBOxrdUvsK5JSjHfzUeZEbOcuXYf4KavTpHS5uikdvTgyczoSrvbmQJ5m0FLXfLA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-openbsd-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-openbsd-x64/-/local-functions-proxy-openbsd-x64-1.1.1.tgz", + "integrity": "sha512-1xLef/kLRNkBTXJ+ZGoRFcwsFxd/B2H3oeJZyXaZ3CN5umd9Mv9wZuAD74NuMt/535yRva8jtAJqvEgl9xMSdA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-ia32": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-ia32/-/local-functions-proxy-win32-ia32-1.1.1.tgz", + "integrity": "sha512-4IOMDBxp2f8VbIkhZ85zGNDrZR4ey8d68fCMSOIwitjsnKav35YrCf8UmAh3UR6CNIRJdJL4MW1GYePJ7iJ8uA==", + "cpu": [ + "ia32" + ], "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optional": true, + "os": [ + "win32" + ], + "bin": { + "local-functions-proxy.exe": "bin/local-functions-proxy.exe" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { - "version": "1.0.0", + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-x64/-/local-functions-proxy-win32-x64-1.1.1.tgz", + "integrity": "sha512-VCBXBJWBujVxyo5f+3r8ovLc9I7wJqpmgDn3ixs1fvdrER5Ac+SzYwYH4mUug9HI08mzTSAKZErzKeuadSez3w==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optional": true, + "os": [ + "win32" + ], + "bin": { + "local-functions-proxy.exe": "bin/local-functions-proxy.exe" } }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.45", + "node_modules/netlify-cli/node_modules/@netlify/node-cookies": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@netlify/node-cookies/-/node-cookies-0.1.0.tgz", + "integrity": "sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==", "dev": true, - "license": "MIT", - "dependencies": { - "@netlify/zip-it-and-ship-it": "9.28.1", - "cpy": "^9.0.0", - "path-exists": "^5.0.0" - }, "engines": { "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/open-api": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.26.0.tgz", + "integrity": "sha512-B7q+ySzQm6rJhaGbY0Pzqnb1p3FsBqwiPLnLtA17JgTsqmXgQ7j6OQImW9fRJy/Al1ob9M6Oxng/FA2c7aIW1g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { + "version": "6.72.0", + "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.72.0.tgz", + "integrity": "sha512-GB3HxvUmOAkB6V3Tau7iQT7aH2NssmQHAgHWMrdD7pDfjcU6Vg0WcQfOWovjx2Bh6M0urOsJkBboX2egCuicEQ==", "dev": true, - "license": "MIT", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": "^14.14.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils": { + "node_modules/netlify-cli/node_modules/@netlify/run-utils": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@netlify/run-utils/-/run-utils-5.1.1.tgz", + "integrity": "sha512-V2B8ZB19heVKa715uOeDkztxLH7uaqZ+9U5fV7BRzbQ2514DO5Vxj9hG0irzuRLfZXZZjp/chPUesv4VVsce/A==", "dev": true, - "license": "MIT", "dependencies": { - "execa": "^6.0.0", - "map-obj": "^5.0.0", - "micromatch": "^4.0.2", - "moize": "^6.1.3", - "path-exists": "^5.0.0" + "execa": "^6.0.0" }, "engines": { "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/execa": { + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/execa": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", @@ -8096,18 +10680,23 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/human-signals": { + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/human-signals": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { - "version": "5.0.2", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -8115,27 +10704,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/npm-run-path": { - "version": "5.1.0", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { - "path-key": "^4.0.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/onetime": { - "version": "6.0.0", + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^4.0.0" - }, "engines": { "node": ">=12" }, @@ -8143,228 +10731,413 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/path-exists": { - "version": "5.0.0", + "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.1.tgz", + "integrity": "sha512-+G9cTltqfH54dF4dLqoEOV2P4qTIY8dM9blUVqg+NtVTXyuadzgpHqtffhVeyeLytVnTx1238kWJUe+sV3bnlg==", "dev": true, - "license": "MIT", + "dependencies": { + "@netlify/node-cookies": "^0.1.0", + "urlpattern-polyfill": "8.0.2" + }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": "^14.18.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/strip-final-newline": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { + "version": "9.28.1", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.28.1.tgz", + "integrity": "sha512-cihW7K9JvlhcrhbdUO9Rhe0r5pydKr8HL++4A2/J7S4Vzl3KftBHyS7O/2Vh54+u3aMon6m4CDXWwErSwjjLNQ==", "dev": true, - "license": "MIT", + "dependencies": { + "@babel/parser": "^7.22.5", + "@babel/types": "7.23.4", + "@netlify/binary-info": "^1.0.0", + "@netlify/serverless-functions-api": "^1.12.1", + "@vercel/nft": "^0.23.0", + "archiver": "^6.0.0", + "common-path-prefix": "^3.0.0", + "cp-file": "^10.0.0", + "es-module-lexer": "^1.0.0", + "esbuild": "0.19.6", + "execa": "^6.0.0", + "fast-glob": "^3.3.2", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "glob": "^8.0.3", + "is-builtin-module": "^3.1.0", + "is-path-inside": "^4.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "merge-options": "^3.0.4", + "minimatch": "^9.0.0", + "normalize-path": "^3.0.0", + "p-map": "^5.0.0", + "path-exists": "^5.0.0", + "precinct": "^11.0.0", + "require-package-name": "^2.0.1", + "resolve": "^2.0.0-next.1", + "semver": "^7.3.8", + "tmp-promise": "^3.0.2", + "toml": "^3.0.0", + "unixify": "^1.0.0", + "urlpattern-polyfill": "8.0.2", + "yargs": "^17.0.0" + }, + "bin": { + "zip-it-and-ship-it": "dist/bin.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", + "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy": { - "version": "1.1.1", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", + "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "optionalDependencies": { - "@netlify/local-functions-proxy-darwin-arm64": "1.1.1", - "@netlify/local-functions-proxy-darwin-x64": "1.1.1", - "@netlify/local-functions-proxy-freebsd-arm64": "1.1.1", - "@netlify/local-functions-proxy-freebsd-x64": "1.1.1", - "@netlify/local-functions-proxy-linux-arm": "1.1.1", - "@netlify/local-functions-proxy-linux-arm64": "1.1.1", - "@netlify/local-functions-proxy-linux-ia32": "1.1.1", - "@netlify/local-functions-proxy-linux-ppc64": "1.1.1", - "@netlify/local-functions-proxy-linux-x64": "1.1.1", - "@netlify/local-functions-proxy-openbsd-x64": "1.1.1", - "@netlify/local-functions-proxy-win32-ia32": "1.1.1", - "@netlify/local-functions-proxy-win32-x64": "1.1.1" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", + "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", + "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", + "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", + "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", + "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", + "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-arm64": { - "version": "1.1.1", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", + "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ - "darwin" + "linux" ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/node-cookies": { - "version": "0.1.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", + "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", + "cpu": [ + "ia32" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.26.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-loong64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", + "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", + "cpu": [ + "loong64" + ], "dev": true, - "license": "MIT" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } }, - "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { - "version": "6.72.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", + "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", + "cpu": [ + "mips64el" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.14.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils": { - "version": "5.1.1", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", + "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "execa": "^6.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/execa": { - "version": "6.1.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", + "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/human-signals": { - "version": "3.0.1", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-s390x": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", + "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", + "cpu": [ + "s390x" + ], "dev": true, - "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=12.20.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { - "version": "5.1.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", + "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^4.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/onetime": { - "version": "6.0.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", + "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^4.0.0" - }, + "optional": true, + "os": [ + "netbsd" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/strip-final-newline": { - "version": "3.0.0", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", + "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.12.1", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/sunos-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", + "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "@netlify/node-cookies": "^0.1.0", - "urlpattern-polyfill": "8.0.2" - }, + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.28.1", + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", + "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.22.5", - "@babel/types": "7.23.4", - "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.12.1", - "@vercel/nft": "^0.23.0", - "archiver": "^6.0.0", - "common-path-prefix": "^3.0.0", - "cp-file": "^10.0.0", - "es-module-lexer": "^1.0.0", - "esbuild": "0.19.6", - "execa": "^6.0.0", - "fast-glob": "^3.3.2", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "glob": "^8.0.3", - "is-builtin-module": "^3.1.0", - "is-path-inside": "^4.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "merge-options": "^3.0.4", - "minimatch": "^9.0.0", - "normalize-path": "^3.0.0", - "p-map": "^5.0.0", - "path-exists": "^5.0.0", - "precinct": "^11.0.0", - "require-package-name": "^2.0.1", - "resolve": "^2.0.0-next.1", - "semver": "^7.3.8", - "tmp-promise": "^3.0.2", - "toml": "^3.0.0", - "unixify": "^1.0.0", - "urlpattern-polyfill": "8.0.2", - "yargs": "^17.0.0" - }, - "bin": { - "zip-it-and-ship-it": "dist/bin.js" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-ia32": { "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", + "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", "cpu": [ - "arm64" + "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ - "darwin" + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", + "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" ], "engines": { "node": ">=12" @@ -8372,17 +11145,19 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/esbuild": { "version": "0.19.6", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", + "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -8416,8 +11191,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/execa": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.1", @@ -8438,8 +11214,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/fast-glob": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -8453,8 +11230,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -8471,8 +11249,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob/node_modules/minimatch": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -8482,16 +11261,18 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/human-signals": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=12.20.0" } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/is-path-inside": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -8501,8 +11282,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -8515,8 +11297,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/npm-run-path": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -8529,8 +11312,9 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -8543,16 +11327,18 @@ }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -8562,8 +11348,9 @@ }, "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -8574,16 +11361,18 @@ }, "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -8594,8 +11383,9 @@ }, "node_modules/netlify-cli/node_modules/@octokit/auth-token": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^7.0.0" }, @@ -8605,8 +11395,9 @@ }, "node_modules/netlify-cli/node_modules/@octokit/core": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz", + "integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", @@ -8622,21 +11413,24 @@ }, "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/types": { "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/netlify-cli/node_modules/@octokit/endpoint": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", + "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^7.0.0", "is-plain-object": "^5.0.0", @@ -8648,8 +11442,9 @@ }, "node_modules/netlify-cli/node_modules/@octokit/graphql": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", + "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/request": "^6.0.0", "@octokit/types": "^7.0.0", @@ -8661,13 +11456,15 @@ }, "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { "version": "13.13.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", + "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", + "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/tsconfig": "^1.0.2", "@octokit/types": "^9.2.3" @@ -8681,29 +11478,33 @@ }, "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", "dev": true, - "license": "MIT", "peerDependencies": { "@octokit/core": ">=3" } }, "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz", + "integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^9.2.3", "deprecation": "^2.3.1" @@ -8717,21 +11518,24 @@ }, "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/netlify-cli/node_modules/@octokit/request": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/endpoint": "^7.0.0", "@octokit/request-error": "^3.0.0", @@ -8746,8 +11550,9 @@ }, "node_modules/netlify-cli/node_modules/@octokit/request-error": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^7.0.0", "deprecation": "^2.0.0", @@ -8759,8 +11564,9 @@ }, "node_modules/netlify-cli/node_modules/@octokit/rest": { "version": "19.0.13", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", + "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/core": "^4.2.1", "@octokit/plugin-paginate-rest": "^6.1.2", @@ -8773,29 +11579,33 @@ }, "node_modules/netlify-cli/node_modules/@octokit/tsconfig": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", + "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", + "dev": true }, "node_modules/netlify-cli/node_modules/@octokit/types": { "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", + "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^13.11.0" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/api": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", + "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8.0.0" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/api-logs": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.41.2.tgz", + "integrity": "sha512-JEV2RAqijAFdWeT6HddYymfnkiRu2ASxoTBr4WsnGJhOjWZkEy6vp+Sx9ozr1NaIODOa2HUyckExIqQjn6qywQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.0.0" }, @@ -8805,8 +11615,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/context-async-hooks": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.13.0.tgz", + "integrity": "sha512-pS5fU4lrRjOIPZQqA2V1SUM9QUFXbO+8flubAiy6ntLjnAjJJUdRFOUOxK6v86ZHI2p2S8A0vD0BTu95FZYvjA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" }, @@ -8816,8 +11627,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/core": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.13.0.tgz", + "integrity": "sha512-2dBX3Sj99H96uwJKvc2w9NOiNgbvAO6mOFJFramNkKfS9O4Um+VWgpnlAazoYjT6kUJ1MP70KQ5ngD4ed+4NUw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.13.0" }, @@ -8830,8 +11642,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-jaeger": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-jaeger/-/exporter-jaeger-1.13.0.tgz", + "integrity": "sha512-ke/STs/erRDqKmNv6Dv+5SetXsVD+Zm1/Wo8cLdAGrZn6kG6Fyp5EXVO/BJuzx6q+jHCdODm8jV4veXl4m71nQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/sdk-trace-base": "1.13.0", @@ -8847,8 +11660,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-grpc/-/exporter-metrics-otlp-grpc-0.41.2.tgz", + "integrity": "sha512-gQuCcd5QSMkfi1XIriWAoak/vaRvFzpvtzh2hjziIvbnA3VtoGD3bDb2dzEzOA1iSWO0/tHwnBsSmmUZsETyOA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.15.2", @@ -8867,8 +11681,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -8881,8 +11696,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -8896,16 +11712,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.41.2.tgz", + "integrity": "sha512-+YeIcL4nuldWE89K8NBLImpXCvih04u1MBnn8EzvoywG2TKR5JC3CZEPepODIxlsfGSgP8W5khCEP1NHZzftYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/otlp-exporter-base": "0.41.2", @@ -8922,8 +11740,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -8936,8 +11755,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -8951,16 +11771,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-proto/-/exporter-metrics-otlp-proto-0.39.1.tgz", + "integrity": "sha512-S+FgIhmZiFMsUivtAlCyzf3L5ezPyCqvlzt4hSZmiKs0kqapau1HS4cSpGacs9Jy499TRSNtqfjj7GxZrNIevw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/exporter-metrics-otlp-http": "0.39.1", @@ -8979,8 +11801,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/api-logs": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", + "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.0.0" }, @@ -8990,8 +11813,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/exporter-metrics-otlp-http": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.39.1.tgz", + "integrity": "sha512-Uj2i6t5v9aexV03xvVobwLV0Yxn7lQcCxBGN5KKxcs8BTZYSfjdwhrFjsOxvEQ2cXugL0aIzCuTKxrlXYTmFwA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/otlp-exporter-base": "0.39.1", @@ -9008,8 +11832,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-exporter-base": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0" }, @@ -9022,8 +11847,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", + "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.39.1", "@opentelemetry/core": "1.13.0", @@ -9041,8 +11867,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-logs": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", + "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0" @@ -9057,8 +11884,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", + "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0", @@ -9073,8 +11901,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.41.2.tgz", + "integrity": "sha512-tRM/mq7PFj7mXCws5ICMVp/rmgU93JvZdoLE0uLj4tugNz231u2ZgeRYXulBjdeHM88ZQSsWTJMu2mvr/3JV1A==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.15.2", @@ -9092,8 +11921,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9106,8 +11936,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -9121,8 +11952,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-trace-base": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", + "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/resources": "1.15.2", @@ -9137,16 +11969,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.39.1.tgz", + "integrity": "sha512-AEhnJfVmo1g+7NxszAuf3c6vddld2DGH2+IM4XrPxCklucCsIpuStuC5EVZbCXXXBMpAY+n3t04QMxIQqNrcSw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/otlp-exporter-base": "0.39.1", @@ -9163,8 +11997,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/api-logs": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", + "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.0.0" }, @@ -9174,8 +12009,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-exporter-base": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0" }, @@ -9188,8 +12024,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", + "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.39.1", "@opentelemetry/core": "1.13.0", @@ -9207,8 +12044,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-logs": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", + "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0" @@ -9223,8 +12061,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-metrics": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", + "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0", @@ -9239,8 +12078,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.41.2.tgz", + "integrity": "sha512-IGZga9IIckqYE3IpRE9FO9G5umabObIrChlXUHYpMJtDgx797dsb3qXCvLeuAwB+HoB8NsEZstlzmLnoa6/HmA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/otlp-exporter-base": "0.41.2", @@ -9258,8 +12098,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9272,8 +12113,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-proto-exporter-base": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.41.2.tgz", + "integrity": "sha512-BxmEMiP6tHiFroe5/dTt9BsxCci7BTLtF7A6d4DKHLiLweWWZxQ9l7hON7qt/IhpKrQcAFD1OzZ1Gq2ZkNzhCw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/otlp-exporter-base": "0.41.2", @@ -9288,8 +12130,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -9303,8 +12146,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", + "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/resources": "1.15.2", @@ -9319,16 +12163,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.13.0.tgz", + "integrity": "sha512-4IuUmYEhlHm8tAGtd6KKkktEO9Bt7dpdBdAPVAzhmXsPwGi0yExo7E5qfi9HtHQcdfP9SnrGRkeorVtrZkGlhg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0", @@ -9344,8 +12190,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.39.1.tgz", + "integrity": "sha512-s7/9tPmM0l5KCd07VQizC4AO2/5UJdkXq5gMSHPdCeiMKSeBEdyDyQX7A+Cq+RYZM452qzFmrJ4ut628J5bnSg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "require-in-the-middle": "^7.1.0", "semver": "^7.3.2", @@ -9360,8 +12207,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.41.2.tgz", + "integrity": "sha512-pfwa6d+Dax3itZcGWiA0AoXeVaCuZbbqUTsCtOysd2re8C2PWXNxDONUfBWsn+KgxAdi+ljwTjJGiaVLDaIEvQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2" }, @@ -9374,8 +12222,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9388,16 +12237,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.41.2.tgz", + "integrity": "sha512-OErK8dYjXG01XIMIpmOV2SzL9ctkZ0Nyhf2UumICOAKtgLvR5dG1JMlsNVp8Jn0RzpsKc6Urv7JpP69wzRXN+A==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.15.2", @@ -9413,8 +12264,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9427,16 +12279,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.39.1.tgz", + "integrity": "sha512-VssdfGYu6LkSliQATdkvoP8lPSQuNLENRdHTUOV2veF4iqY/UpxBFFlkarY29W+MYjWXIBfYntgNjQvcn78A+w==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/otlp-exporter-base": "0.39.1", @@ -9451,8 +12305,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/otlp-exporter-base": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0" }, @@ -9465,8 +12320,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.41.2.tgz", + "integrity": "sha512-jJbPwB0tNu2v+Xi0c/v/R3YBLJKLonw1p+v3RVjT2VfzeUyzSp/tBeVdY7RZtL6dzZpA9XSmp8UEfWIFQo33yA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.41.2", "@opentelemetry/core": "1.15.2", @@ -9484,8 +12340,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9498,8 +12355,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -9513,8 +12371,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-trace-base": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", + "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/resources": "1.15.2", @@ -9529,16 +12388,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.13.0.tgz", + "integrity": "sha512-HOo91EI4UbuG8xQVLFziTzrcIn0MJQhy8m9jorh8aonb94jFVFi3CFNIiAnIGOabmnshJLOABxpYXsiPB8Xnzg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0" }, @@ -9551,8 +12412,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.13.0.tgz", + "integrity": "sha512-IV9TO+u1Jzm9mUDAD3gyXf89eyvgEJUY1t+GB5QmS4wjVeWrSMUtD0JjH3yG9SNqkrQOqOGJq7YUSSetW+Lf5Q==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0" }, @@ -9565,8 +12427,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/resources": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.13.0.tgz", + "integrity": "sha512-euqjOkiN6xhjE//0vQYGvbStxoD/WWQRhDiO0OTLlnLBO9Yw2Gd/VoSx2H+svsebjzYk5OxLuREBmcdw6rbUNg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/semantic-conventions": "1.13.0" @@ -9580,8 +12443,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs": { "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.41.2.tgz", + "integrity": "sha512-smqKIw0tTW15waj7BAPHFomii5c3aHnSE4LQYTszGoK5P9nZs8tEAIpu15UBxi3aG31ZfsLmm4EUQkjckdlFrw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/resources": "1.15.2" @@ -9596,8 +12460,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9610,8 +12475,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -9625,16 +12491,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.2.tgz", + "integrity": "sha512-9aIlcX8GnhcsAHW/Wl8bzk4ZnWTpNlLtud+fxUfBtFATu6OZ6TrGrF4JkT9EVrnoxwtPIDtjHdEsSjOqisY/iA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/resources": "1.15.2", @@ -9649,8 +12517,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "1.15.2" }, @@ -9663,8 +12532,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.15.2", "@opentelemetry/semantic-conventions": "1.15.2" @@ -9678,16 +12548,18 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/semantic-conventions": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.39.1.tgz", + "integrity": "sha512-qODReBGNSdfRS5gvCFj1SdiIi/3ZFTZb0H1KvWE/OrTkklyL5RhIs7vDwvEGHmha+YpUu0Y2+R2+itSBSu/jCA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/exporter-jaeger": "1.13.0", @@ -9711,8 +12583,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/api-logs": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", + "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.0.0" }, @@ -9722,8 +12595,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.39.1.tgz", + "integrity": "sha512-l5RhLKx6U+yuLhMrtgavTDthX50E1mZM3/SSySC7OPZiArFHV/b/9x9jxAzrOgIQUDxyj4N0V9aLKSA2t7Qzxg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.13.0", @@ -9741,8 +12615,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-proto": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.39.1.tgz", + "integrity": "sha512-oJQC7a67iwExRYynKqn/O9Fl5gUjDa43ZQsZu2iKAADs/6YJ+u5MJ/wcq3CpJsn2KU/8j8HWAKOcDkkQXPuJ9A==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/otlp-exporter-base": "0.39.1", @@ -9760,8 +12635,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-exporter-base": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0" }, @@ -9774,8 +12650,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-grpc-exporter-base": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.39.1.tgz", + "integrity": "sha512-u3ErFRQqQFKjjIMuwLWxz/tLPYInfmiAmSy//fGSCzCh2ZdJgqQjMOAxBgqFtCF2xFL+OmMhyuC2ThMzceGRWA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.7.1", "@opentelemetry/core": "1.13.0", @@ -9791,8 +12668,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-transformer": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", + "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/api-logs": "0.39.1", "@opentelemetry/core": "1.13.0", @@ -9810,8 +12688,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-logs": { "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", + "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0" @@ -9826,8 +12705,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-metrics": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", + "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0", @@ -9842,8 +12722,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-base": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.13.0.tgz", + "integrity": "sha512-moTiQtc0uPR1hQLt6gLDJH9IIkeBhgRb71OKjNHZPE1VF45fHtD6nBDi5J/DkTHTwYP5X3kBJLa3xN7ub6J4eg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/core": "1.13.0", "@opentelemetry/resources": "1.13.0", @@ -9858,8 +12739,9 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.13.0.tgz", + "integrity": "sha512-FXA85lXKTsnbOflA/TBuBf2pmhD3c8uDjNjG0YqK+ap8UayfALmfJhf+aG1yBOUHevCY0JXJ4/xtbXExxpsMog==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@opentelemetry/context-async-hooks": "1.13.0", "@opentelemetry/core": "1.13.0", @@ -9877,16 +12759,19 @@ }, "node_modules/netlify-cli/node_modules/@opentelemetry/semantic-conventions": { "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.13.0.tgz", + "integrity": "sha512-LMGqfSZkaMQXqewO0o1wvWr/2fQdCh4a3Sqlxka/UsJCe0cfLulh6x2aqnKLnsrSGiCq5rSCwvINd152i0nCqw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@parcel/watcher": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.3.0.tgz", + "integrity": "sha512-pW7QaFiL11O0BphO+bq3MgqeX/INAk9jgBldVDYjlQPO4VddoZnF22TcF9onMhnLVHuNqBJeRf+Fj7eezi/+rQ==", "dev": true, - "license": "MIT", + "hasInstallScript": true, "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", @@ -9915,13 +12800,34 @@ "@parcel/watcher-win32-x64": "2.3.0" } }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-android-arm64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.3.0.tgz", + "integrity": "sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-arm64": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.3.0.tgz", + "integrity": "sha512-mKY+oijI4ahBMc/GygVGvEdOq0L4DxhYgwQqYAz/7yPzuGi79oXrZG52WdpGA1wLBPrYb0T8uBaGFo7I6rvSKw==", "cpu": [ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -9934,13 +12840,154 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-x64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.3.0.tgz", + "integrity": "sha512-20oBj8LcEOnLE3mgpy6zuOq8AplPu9NcSSSfyVKgfOhNAc4eF4ob3ldj0xWjGGbOF7Dcy1Tvm6ytvgdjlfUeow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.3.0.tgz", + "integrity": "sha512-7LftKlaHunueAEiojhCn+Ef2CTXWsLgTl4hq0pkhkTBFI3ssj2bJXmH2L67mKpiAD5dz66JYk4zS66qzdnIOgw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.3.0.tgz", + "integrity": "sha512-1apPw5cD2xBv1XIHPUlq0cO6iAaEUQ3BcY0ysSyD9Kuyw4MoWm1DV+W9mneWI+1g6OeP6dhikiFE6BlU+AToTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.3.0.tgz", + "integrity": "sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.3.0.tgz", + "integrity": "sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.3.0.tgz", + "integrity": "sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.3.0.tgz", + "integrity": "sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.3.0.tgz", + "integrity": "sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==", "bundleDependencies": [ "napi-wasm" ], "dev": true, - "license": "MIT", "dependencies": { "is-glob": "^4.0.3", "micromatch": "^4.0.5", @@ -9954,16 +13001,77 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-arm64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.3.0.tgz", + "integrity": "sha512-35gXCnaz1AqIXpG42evcoP2+sNL62gZTMZne3IackM+6QlfMcJLy3DrjuL6Iks7Czpd3j4xRBzez3ADCj1l7Aw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-ia32": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.3.0.tgz", + "integrity": "sha512-FJS/IBQHhRpZ6PiCjFt1UAcPr0YmCLHRbTc00IBTrelEjlmmgIVLeOx4MSXzx2HFEy5Jo5YdhGpxCuqCyDJ5ow==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-x64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.3.0.tgz", + "integrity": "sha512-dLx+0XRdMnVI62kU3wbXvbIRhLck4aE28bIGKbRGS7BJNt54IIj9+c/Dkqb+7DJEbHUZAX1bwaoM8PqVlHJmCA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/netlify-cli/node_modules/@parcel/watcher/node_modules/detect-libc": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", "dev": true, - "license": "Apache-2.0", "bin": { "detect-libc": "bin/detect-libc.js" }, @@ -9973,16 +13081,18 @@ }, "node_modules/netlify-cli/node_modules/@pnpm/config.env-replace": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.22.0" } }, "node_modules/netlify-cli/node_modules/@pnpm/network.ca-file": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", + "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "4.2.10" }, @@ -9992,8 +13102,9 @@ }, "node_modules/netlify-cli/node_modules/@pnpm/npm-conf": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.0.tgz", + "integrity": "sha512-roLI1ul/GwzwcfcVpZYPdrgW2W/drLriObl1h+yLF5syc8/5ULWw2ALbCHUWF+4YltIqA3xFSbG4IwyJz37e9g==", "dev": true, - "license": "MIT", "dependencies": { "@pnpm/config.env-replace": "^1.1.0", "@pnpm/network.ca-file": "^1.0.1", @@ -10005,28 +13116,33 @@ }, "node_modules/netlify-cli/node_modules/@protobufjs/aspromise": { "version": "1.1.2", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/base64": { "version": "1.1.2", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/codegen": { "version": "2.0.4", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/fetch": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -10034,33 +13150,39 @@ }, "node_modules/netlify-cli/node_modules/@protobufjs/float": { "version": "1.0.2", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/inquire": { "version": "1.1.0", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/path": { "version": "1.1.2", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/pool": { "version": "1.1.0", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@protobufjs/utf8": { "version": "1.1.0", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@rollup/pluginutils": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", "dev": true, - "license": "MIT", "dependencies": { "estree-walker": "^2.0.1", "picomatch": "^2.2.2" @@ -10071,8 +13193,9 @@ }, "node_modules/netlify-cli/node_modules/@sindresorhus/slugify": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", + "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", "dev": true, - "license": "MIT", "dependencies": { "@sindresorhus/transliterate": "^1.0.0", "escape-string-regexp": "^5.0.0" @@ -10086,8 +13209,9 @@ }, "node_modules/netlify-cli/node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -10097,8 +13221,9 @@ }, "node_modules/netlify-cli/node_modules/@sindresorhus/transliterate": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.5.0.tgz", + "integrity": "sha512-/sfSkoNelLq5riqNRp5uBjHIKBi1MWZk9ubRT1WiBQuTfmDf7BeQkph2DJzRB83QagMPHk2VDjuvpy0VuwyzdA==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0", "lodash.deburr": "^4.1.0" @@ -10112,8 +13237,9 @@ }, "node_modules/netlify-cli/node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -10123,41 +13249,48 @@ }, "node_modules/netlify-cli/node_modules/@tokenizer/token": { "version": "0.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "dev": true }, "node_modules/netlify-cli/node_modules/@trysound/sax": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", + "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", "dev": true, - "license": "ISC", "engines": { "node": ">=10.13.0" } }, "node_modules/netlify-cli/node_modules/@tsconfig/node10": { "version": "1.0.8", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true }, "node_modules/netlify-cli/node_modules/@tsconfig/node12": { "version": "1.0.9", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@tsconfig/node14": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true }, "node_modules/netlify-cli/node_modules/@tsconfig/node16": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true }, "node_modules/netlify-cli/node_modules/@types/body-parser": { "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "dev": true, - "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -10167,8 +13300,9 @@ }, "node_modules/netlify-cli/node_modules/@types/connect": { "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "dev": true, - "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -10177,8 +13311,9 @@ }, "node_modules/netlify-cli/node_modules/@types/express": { "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", "dev": true, - "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -10190,8 +13325,9 @@ }, "node_modules/netlify-cli/node_modules/@types/express-serve-static-core": { "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", "dev": true, - "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -10202,81 +13338,93 @@ }, "node_modules/netlify-cli/node_modules/@types/http-cache-semantics": { "version": "4.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.2.tgz", + "integrity": "sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@types/http-proxy": { "version": "1.17.8", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.8.tgz", + "integrity": "sha512-5kPLG5BKpWYkw/LVOGWpiq3nEVqxiN32rTgI53Sk12/xHFQ2rG3ehI9IO+O3W2QoKeyB92dJkoka8SUm6BX1pA==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/netlify-cli/node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true }, "node_modules/netlify-cli/node_modules/@types/istanbul-lib-report": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", "dev": true, - "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/netlify-cli/node_modules/@types/istanbul-reports": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, - "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/netlify-cli/node_modules/@types/mime": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", "dev": true, - "license": "MIT", "optional": true, "peer": true }, "node_modules/netlify-cli/node_modules/@types/node": { "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "dev": true, - "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } }, "node_modules/netlify-cli/node_modules/@types/normalize-package-data": { "version": "2.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@types/qs": { "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", "dev": true, - "license": "MIT", "optional": true, "peer": true }, "node_modules/netlify-cli/node_modules/@types/range-parser": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "dev": true, - "license": "MIT", "optional": true, "peer": true }, "node_modules/netlify-cli/node_modules/@types/retry": { "version": "0.12.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", + "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==", + "dev": true }, "node_modules/netlify-cli/node_modules/@types/serve-static": { "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", "dev": true, - "license": "MIT", "optional": true, "peer": true, "dependencies": { @@ -10286,13 +13434,15 @@ }, "node_modules/netlify-cli/node_modules/@types/yargs-parser": { "version": "20.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "dev": true }, "node_modules/netlify-cli/node_modules/@types/yauzl": { "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@types/node": "*" @@ -10300,8 +13450,9 @@ }, "node_modules/netlify-cli/node_modules/@vercel/nft": { "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.23.1.tgz", + "integrity": "sha512-NE0xSmGWVhgHF1OIoir71XAd0W0C1UE3nzFyhpFiMr3rVhetww7NvM1kc41trBsPG37Bh+dE5FYCTMzM/gBu0w==", "dev": true, - "license": "MIT", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.5", "@rollup/pluginutils": "^4.0.0", @@ -10324,8 +13475,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/archive-type": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-6.0.1.tgz", + "integrity": "sha512-PB3NeJL8xARZt52yDBupK0dNPn8uIVQDe15qNehUpoeeLWCZyAOam4vGXnoZGz2N9D1VXtjievJuCsXam2TmbQ==", "dev": true, - "license": "MIT", "dependencies": { "file-type": "^18.5.0" }, @@ -10335,8 +13487,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress/-/decompress-9.0.1.tgz", + "integrity": "sha512-9Lvlt6Qdpo9SaRQyRIXCo3lgU++eMZ68lzgjcTwtuKDrlwT635+5zsHZ1yrSx/Blc5IDuVLlPkBPj5CZkx+2+Q==", "dev": true, - "license": "MIT", "dependencies": { "@xhmikosr/decompress-tar": "^7.0.0", "@xhmikosr/decompress-tarbz2": "^7.0.0", @@ -10352,8 +13505,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tar": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tar/-/decompress-tar-7.0.0.tgz", + "integrity": "sha512-kyWf2hybtQVbWtB+FdRyOT+jyR5jxCNZPLqvQGB7djZj75lrpLUPEmRbyo86AtJ5OEtivpYaNWjCkqSJ8xtRWw==", "dev": true, - "license": "MIT", "dependencies": { "file-type": "^18.5.0", "is-stream": "^3.0.0", @@ -10365,8 +13519,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tarbz2": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tarbz2/-/decompress-tarbz2-7.0.0.tgz", + "integrity": "sha512-3QnjipYkRgh3Dee1MWDgKmANWxOQBVN4e1IwiGNe2fHYfMYTeSkVvWREt87UIoSucKUh3E95v8uGFttgTknZcA==", "dev": true, - "license": "MIT", "dependencies": { "@xhmikosr/decompress-tar": "^7.0.0", "file-type": "^18.5.0", @@ -10380,8 +13535,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-targz": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-targz/-/decompress-targz-7.0.0.tgz", + "integrity": "sha512-7BNHJl92g9OLhw89zqcFS67V1LAtm4Ex02j6OiQzuE8P7Yy9lQcyBuEL3x6v436grLdL+BcFjgbmhWxnem4GHw==", "dev": true, - "license": "MIT", "dependencies": { "@xhmikosr/decompress-tar": "^7.0.0", "file-type": "^18.5.0", @@ -10393,8 +13549,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-unzip": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-unzip/-/decompress-unzip-6.0.0.tgz", + "integrity": "sha512-R1HAkjXLS7RAL74YFLxYY9zYflCcYGssld9KKFDu87PnJ4h4btdhzXfSC8J5i5A2njH3oYIoCzx03RIGTH07Sg==", "dev": true, - "license": "MIT", "dependencies": { "file-type": "^18.5.0", "get-stream": "^6.0.1", @@ -10406,13 +13563,15 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress/node_modules/graceful-fs": { "version": "4.2.11", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress/node_modules/make-dir": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -10425,8 +13584,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader": { "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@xhmikosr/downloader/-/downloader-13.0.1.tgz", + "integrity": "sha512-mBvWew1kZJHfNQVVfVllMjUDwCGN9apPa0t4/z1zaUJ9MzpXjRL3w8fsfJKB8gHN/h4rik9HneKfDbh2fErN+w==", "dev": true, - "license": "MIT", "dependencies": { "@xhmikosr/archive-type": "^6.0.1", "@xhmikosr/decompress": "^9.0.1", @@ -10445,8 +13605,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@sindresorhus/is": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -10456,8 +13617,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@szmarczak/http-timer": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, - "license": "MIT", "dependencies": { "defer-to-connect": "^2.0.1" }, @@ -10467,16 +13629,18 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-lookup": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" } }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-request": { "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/http-cache-semantics": "^4.0.2", "get-stream": "^6.0.1", @@ -10492,8 +13656,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -10503,8 +13668,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filename-reserved-regex": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz", + "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -10514,8 +13680,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filenamify": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-5.1.1.tgz", + "integrity": "sha512-M45CbrJLGACfrPOkrTp3j2EcO9OBkKUYME0eiqOCa7i2poaklU0jhlIaMlr8ijLorT0uLAzrn3qXOp5684CkfA==", "dev": true, - "license": "MIT", "dependencies": { "filename-reserved-regex": "^3.0.0", "strip-outer": "^2.0.0", @@ -10530,8 +13697,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/got": { "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, - "license": "MIT", "dependencies": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", @@ -10554,8 +13722,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/http2-wrapper": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", "dev": true, - "license": "MIT", "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" @@ -10566,8 +13735,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/lowercase-keys": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -10577,8 +13747,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/mimic-response": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -10588,8 +13759,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/normalize-url": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -10599,16 +13771,18 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/p-cancelable": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20" } }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/responselike": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, - "license": "MIT", "dependencies": { "lowercase-keys": "^3.0.0" }, @@ -10621,8 +13795,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/strip-outer": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-2.0.0.tgz", + "integrity": "sha512-A21Xsm1XzUkK0qK1ZrytDUvqsQWict2Cykhvi0fBQntGG5JSprESasEyV1EZ/4CiR5WB5KjzLTrP/bO37B0wPg==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -10632,8 +13807,9 @@ }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/trim-repeated": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-2.0.0.tgz", + "integrity": "sha512-QUHBFTJGdOwmp0tbOG505xAgOp/YliZP/6UgafFXYZ26WT1bvQmSMJUvkeVSASuJJHbqsFbynTvkd5W8RBTipg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0" }, @@ -10643,13 +13819,15 @@ }, "node_modules/netlify-cli/node_modules/abbrev": { "version": "1.1.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/abort-controller": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "dev": true, - "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -10659,13 +13837,15 @@ }, "node_modules/netlify-cli/node_modules/abstract-logging": { "version": "2.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==", + "dev": true }, "node_modules/netlify-cli/node_modules/accepts": { "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, - "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -10676,8 +13856,9 @@ }, "node_modules/netlify-cli/node_modules/acorn": { "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -10687,16 +13868,18 @@ }, "node_modules/netlify-cli/node_modules/acorn-walk": { "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "debug": "4" }, @@ -10706,8 +13889,9 @@ }, "node_modules/netlify-cli/node_modules/aggregate-error": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^4.0.0", "indent-string": "^5.0.0" @@ -10721,8 +13905,9 @@ }, "node_modules/netlify-cli/node_modules/aggregate-error/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -10732,8 +13917,9 @@ }, "node_modules/netlify-cli/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -10748,8 +13934,9 @@ }, "node_modules/netlify-cli/node_modules/ajv-formats": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^8.0.0" }, @@ -10764,8 +13951,9 @@ }, "node_modules/netlify-cli/node_modules/ajv-formats/node_modules/ajv": { "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -10779,13 +13967,15 @@ }, "node_modules/netlify-cli/node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true }, "node_modules/netlify-cli/node_modules/all-node-versions": { "version": "11.3.0", + "resolved": "https://registry.npmjs.org/all-node-versions/-/all-node-versions-11.3.0.tgz", + "integrity": "sha512-psMkc5s3qpr+QMfires9bC4azRYciPWql1wqZKMsYRh1731qefQDH2X4+O19xSBX6u0Ra/8Y5diG6y/fEmqKsw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "fetch-node-website": "^7.3.0", "filter-obj": "^5.1.0", @@ -10802,16 +13992,18 @@ }, "node_modules/netlify-cli/node_modules/all-node-versions/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/all-node-versions/node_modules/write-file-atomic": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -10822,20 +14014,27 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "ISC", "dependencies": { "string-width": "^4.1.0" } }, "node_modules/netlify-cli/node_modules/ansi-color": { "version": "0.2.1", - "dev": true + "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", + "integrity": "sha512-bF6xLaZBLpOQzgYUtYEhJx090nPSZk1BQ/q2oyBK9aMMcJHzx9uXGCjI2Y+LebsN4Jwoykr0V9whbPiogdyHoQ==", + "dev": true, + "engines": { + "node": "*" + } }, "node_modules/netlify-cli/node_modules/ansi-escapes": { "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^3.0.0" }, @@ -10848,16 +14047,18 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -10867,8 +14068,9 @@ }, "node_modules/netlify-cli/node_modules/ansi-to-html": { "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.7.2.tgz", + "integrity": "sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==", "dev": true, - "license": "MIT", "dependencies": { "entities": "^2.2.0" }, @@ -10881,16 +14083,18 @@ }, "node_modules/netlify-cli/node_modules/ansi-to-html/node_modules/entities": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", "dev": true, - "license": "BSD-2-Clause", "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } }, "node_modules/netlify-cli/node_modules/anymatch": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, - "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -10901,11 +14105,14 @@ }, "node_modules/netlify-cli/node_modules/aproba": { "version": "2.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/arch": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", "dev": true, "funding": [ { @@ -10920,13 +14127,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/archiver": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.1.tgz", + "integrity": "sha512-CXGy4poOLBKptiZH//VlWdFuUC1RESbdZjGjILwBuZ73P7WkAUN0htfSfBq/7k6FRFlpu7bg4JOkj1vU9G6jcQ==", "dev": true, - "license": "MIT", "dependencies": { "archiver-utils": "^4.0.1", "async": "^3.2.4", @@ -10942,8 +14149,9 @@ }, "node_modules/netlify-cli/node_modules/archiver-utils": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-4.0.1.tgz", + "integrity": "sha512-Q4Q99idbvzmgCTEAAhi32BkOyq8iVI5EwdO0PmBDSGIzzjYNdcFn7Q7k3OzbLy4kLUPXfJtG6fO2RjftXbobBg==", "dev": true, - "license": "MIT", "dependencies": { "glob": "^8.0.0", "graceful-fs": "^4.2.0", @@ -10958,16 +14166,18 @@ }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/glob": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -10984,8 +14194,9 @@ }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minimatch": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -10995,13 +14206,15 @@ }, "node_modules/netlify-cli/node_modules/archy": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true }, "node_modules/netlify-cli/node_modules/are-we-there-yet": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "dev": true, - "license": "ISC", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -11012,68 +14225,78 @@ }, "node_modules/netlify-cli/node_modules/arg": { "version": "4.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true }, "node_modules/netlify-cli/node_modules/argparse": { "version": "2.0.1", - "dev": true, - "license": "Python-2.0" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/arr-diff": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/arr-flatten": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/arr-union": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/array-flatten": { "version": "1.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true }, "node_modules/netlify-cli/node_modules/array-timsort": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/array-union": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/array-unique": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/arrify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -11083,44 +14306,51 @@ }, "node_modules/netlify-cli/node_modules/ascii-table": { "version": "0.0.9", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", + "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=", + "dev": true }, "node_modules/netlify-cli/node_modules/assign-symbols": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/ast-module-types": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-5.0.0.tgz", + "integrity": "sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/async": { "version": "3.2.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/async-sema": { "version": "3.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz", + "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", + "dev": true }, "node_modules/netlify-cli/node_modules/asynckit": { "version": "0.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "node_modules/netlify-cli/node_modules/atob": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true, - "license": "(MIT OR Apache-2.0)", "bin": { "atob": "bin/atob.js" }, @@ -11130,16 +14360,18 @@ }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/netlify-cli/node_modules/avvio": { "version": "8.2.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", + "integrity": "sha512-bbCQdg7bpEv6kGH41RO/3B2/GMMmJSo2iBK+X8AWN9mujtfUipMDfIjsgHCfpnKqoGEQrrmCDKSa5OQ19+fDmg==", "dev": true, - "license": "MIT", "dependencies": { "archy": "^1.0.0", "debug": "^4.0.0", @@ -11148,8 +14380,9 @@ }, "node_modules/netlify-cli/node_modules/axios": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "dev": true, - "license": "MIT", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -11158,13 +14391,15 @@ }, "node_modules/netlify-cli/node_modules/b4a": { "version": "1.6.4", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "dev": true }, "node_modules/netlify-cli/node_modules/backoff": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==", "dev": true, - "license": "MIT", "dependencies": { "precond": "0.2" }, @@ -11174,13 +14409,15 @@ }, "node_modules/netlify-cli/node_modules/balanced-match": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/netlify-cli/node_modules/base": { "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, - "license": "MIT", "dependencies": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", @@ -11196,8 +14433,9 @@ }, "node_modules/netlify-cli/node_modules/base/node_modules/define-property": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^1.0.0" }, @@ -11207,6 +14445,8 @@ }, "node_modules/netlify-cli/node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true, "funding": [ { @@ -11221,18 +14461,19 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/before-after-hook": { "version": "2.2.2", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/better-ajv-errors": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-1.2.0.tgz", + "integrity": "sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@babel/code-frame": "^7.16.0", "@humanwhocodes/momoa": "^2.0.2", @@ -11249,8 +14490,9 @@ }, "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -11263,8 +14505,9 @@ }, "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -11278,8 +14521,9 @@ }, "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -11289,13 +14533,15 @@ }, "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -11305,8 +14551,9 @@ }, "node_modules/netlify-cli/node_modules/better-opn": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.2.tgz", + "integrity": "sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==", "dev": true, - "license": "MIT", "dependencies": { "open": "^8.0.4" }, @@ -11316,24 +14563,27 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/bindings": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, - "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } }, "node_modules/netlify-cli/node_modules/bl": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, - "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -11342,13 +14592,15 @@ }, "node_modules/netlify-cli/node_modules/blueimp-md5": { "version": "2.19.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", + "dev": true }, "node_modules/netlify-cli/node_modules/body-parser": { "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dev": true, - "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -11370,24 +14622,27 @@ }, "node_modules/netlify-cli/node_modules/body-parser/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/netlify-cli/node_modules/body-parser/node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/body-parser/node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, - "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -11401,13 +14656,15 @@ }, "node_modules/netlify-cli/node_modules/body-parser/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/netlify-cli/node_modules/body-parser/node_modules/raw-body": { "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dev": true, - "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -11420,13 +14677,15 @@ }, "node_modules/netlify-cli/node_modules/boolbase": { "version": "1.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true }, "node_modules/netlify-cli/node_modules/boxen": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", "dev": true, - "license": "MIT", "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^7.0.1", @@ -11446,8 +14705,9 @@ }, "node_modules/netlify-cli/node_modules/boxen/node_modules/camelcase": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -11457,13 +14717,15 @@ }, "node_modules/netlify-cli/node_modules/boxen/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true }, "node_modules/netlify-cli/node_modules/boxen/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -11478,8 +14740,9 @@ }, "node_modules/netlify-cli/node_modules/boxen/node_modules/type-fest": { "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" }, @@ -11489,8 +14752,9 @@ }, "node_modules/netlify-cli/node_modules/boxen/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -11505,8 +14769,9 @@ }, "node_modules/netlify-cli/node_modules/brace-expansion": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -11514,8 +14779,9 @@ }, "node_modules/netlify-cli/node_modules/braces": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "license": "MIT", "dependencies": { "fill-range": "^7.0.1" }, @@ -11525,6 +14791,8 @@ }, "node_modules/netlify-cli/node_modules/buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { @@ -11540,7 +14808,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -11548,24 +14815,29 @@ }, "node_modules/netlify-cli/node_modules/buffer-crc32": { "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true, - "license": "MIT", "engines": { "node": "*" } }, "node_modules/netlify-cli/node_modules/buffer-equal-constant-time": { "version": "1.0.1", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", + "dev": true }, "node_modules/netlify-cli/node_modules/buffer-from": { "version": "1.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/bufrw": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bufrw/-/bufrw-1.3.0.tgz", + "integrity": "sha512-jzQnSbdJqhIltU9O5KUiTtljP9ccw2u5ix59McQy4pV2xGhVLhRZIndY8GIrgh5HjXa6+QJ9AQhOd2QWQizJFQ==", "dev": true, "dependencies": { "ansi-color": "^0.2.1", @@ -11579,8 +14851,9 @@ }, "node_modules/netlify-cli/node_modules/builtin-modules": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -11590,32 +14863,36 @@ }, "node_modules/netlify-cli/node_modules/builtins": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.0.0" } }, "node_modules/netlify-cli/node_modules/byline": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/cache-base": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, - "license": "MIT", "dependencies": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", @@ -11633,16 +14910,18 @@ }, "node_modules/netlify-cli/node_modules/cachedir": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/call-bind": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, - "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -11653,6 +14932,8 @@ }, "node_modules/netlify-cli/node_modules/callsite": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", "dev": true, "engines": { "node": "*" @@ -11660,8 +14941,9 @@ }, "node_modules/netlify-cli/node_modules/camelcase": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -11671,8 +14953,9 @@ }, "node_modules/netlify-cli/node_modules/chalk": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -11682,11 +14965,14 @@ }, "node_modules/netlify-cli/node_modules/chardet": { "version": "0.7.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true }, "node_modules/netlify-cli/node_modules/chokidar": { "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { @@ -11694,7 +14980,6 @@ "url": "https://paulmillr.com/funding/" } ], - "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -11713,14 +14998,17 @@ }, "node_modules/netlify-cli/node_modules/chownr": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/netlify-cli/node_modules/ci-info": { "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true, "funding": [ { @@ -11728,23 +15016,24 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/citty": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.4.tgz", + "integrity": "sha512-Q3bK1huLxzQrvj7hImJ7Z1vKYJRPQCDnd0EjXfHMidcjecGOMuLrmuQmtWmFkuKLcMThlGh1yCKG8IEc6VeNXQ==", "dev": true, - "license": "MIT", "dependencies": { "consola": "^3.2.3" } }, "node_modules/netlify-cli/node_modules/class-utils": { "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, - "license": "MIT", "dependencies": { "arr-union": "^3.1.0", "define-property": "^0.2.5", @@ -11757,8 +15046,9 @@ }, "node_modules/netlify-cli/node_modules/class-utils/node_modules/define-property": { "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -11768,8 +15058,9 @@ }, "node_modules/netlify-cli/node_modules/class-utils/node_modules/is-descriptor": { "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", "dev": true, - "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -11780,8 +15071,9 @@ }, "node_modules/netlify-cli/node_modules/clean-deep": { "version": "3.4.0", + "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", + "integrity": "sha512-Lo78NV5ItJL/jl+B5w0BycAisaieJGXK1qYi/9m4SjR8zbqmrUtO7Yhro40wEShGmmxs/aJLI/A+jNhdkXK8mw==", "dev": true, - "license": "MIT", "dependencies": { "lodash.isempty": "^4.4.0", "lodash.isplainobject": "^4.0.6", @@ -11793,8 +15085,9 @@ }, "node_modules/netlify-cli/node_modules/clean-stack": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -11807,8 +15100,9 @@ }, "node_modules/netlify-cli/node_modules/clean-stack/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -11818,8 +15112,9 @@ }, "node_modules/netlify-cli/node_modules/cli-boxes": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -11829,8 +15124,9 @@ }, "node_modules/netlify-cli/node_modules/cli-cursor": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", "dev": true, - "license": "MIT", "dependencies": { "restore-cursor": "^2.0.0" }, @@ -11840,8 +15136,9 @@ }, "node_modules/netlify-cli/node_modules/cli-progress": { "version": "3.12.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", + "integrity": "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==", "dev": true, - "license": "MIT", "dependencies": { "string-width": "^4.2.3" }, @@ -11851,8 +15148,9 @@ }, "node_modules/netlify-cli/node_modules/cli-spinners": { "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -11862,8 +15160,9 @@ }, "node_modules/netlify-cli/node_modules/cli-truncate": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, - "license": "MIT", "dependencies": { "slice-ansi": "^5.0.0", "string-width": "^5.0.0" @@ -11877,13 +15176,15 @@ }, "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true }, "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -11898,13 +15199,15 @@ }, "node_modules/netlify-cli/node_modules/cli-width": { "version": "2.2.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true }, "node_modules/netlify-cli/node_modules/clipboardy": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-3.0.0.tgz", + "integrity": "sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==", "dev": true, - "license": "MIT", "dependencies": { "arch": "^2.2.0", "execa": "^5.1.1", @@ -11919,24 +15222,27 @@ }, "node_modules/netlify-cli/node_modules/clone": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/netlify-cli/node_modules/cluster-key-slot": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/collection-visit": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, - "license": "MIT", "dependencies": { "map-visit": "^1.0.0", "object-visit": "^1.0.0" @@ -11947,8 +15253,9 @@ }, "node_modules/netlify-cli/node_modules/color": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -11956,21 +15263,24 @@ }, "node_modules/netlify-cli/node_modules/color-convert": { "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/netlify-cli/node_modules/color-name": { "version": "1.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/netlify-cli/node_modules/color-string": { "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", + "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -11978,29 +15288,33 @@ }, "node_modules/netlify-cli/node_modules/color-support": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true, - "license": "ISC", "bin": { "color-support": "bin.js" } }, "node_modules/netlify-cli/node_modules/colorette": { "version": "2.0.20", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true }, "node_modules/netlify-cli/node_modules/colors": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.1.90" } }, "node_modules/netlify-cli/node_modules/colors-option": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-3.0.0.tgz", + "integrity": "sha512-DP3FpjsiDDvnQC1OJBsdOJZPuy7r0o6sepY2T5M3L/d2nrE23O/ErFkEqyY3ngVL1ZhTj/H0pCMNObZGkEOaaQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "chalk": "^5.0.0", "filter-obj": "^3.0.0", @@ -12013,8 +15327,9 @@ }, "node_modules/netlify-cli/node_modules/colors-option/node_modules/filter-obj": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", + "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -12024,8 +15339,9 @@ }, "node_modules/netlify-cli/node_modules/colorspace": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", "dev": true, - "license": "MIT", "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -12033,8 +15349,9 @@ }, "node_modules/netlify-cli/node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -12044,16 +15361,18 @@ }, "node_modules/netlify-cli/node_modules/commander": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, - "license": "MIT", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/comment-json": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", + "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", "dev": true, - "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -12067,23 +15386,27 @@ }, "node_modules/netlify-cli/node_modules/comment-json/node_modules/core-util-is": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/common-path-prefix": { "version": "3.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true }, "node_modules/netlify-cli/node_modules/component-emitter": { "version": "1.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true }, "node_modules/netlify-cli/node_modules/compress-commons": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-5.0.1.tgz", + "integrity": "sha512-MPh//1cERdLtqwO3pOFLeXtpuai0Y2WCd5AhtKxznqM7WtaMYaOEMSgn45d9D10sIHSfIKE603HlOp8OPGrvag==", "dev": true, - "license": "MIT", "dependencies": { "crc-32": "^1.2.0", "crc32-stream": "^5.0.0", @@ -12096,13 +15419,15 @@ }, "node_modules/netlify-cli/node_modules/concat-map": { "version": "0.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "node_modules/netlify-cli/node_modules/concordance": { "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", "dev": true, - "license": "ISC", "dependencies": { "date-time": "^3.1.0", "esutils": "^2.0.3", @@ -12119,8 +15444,9 @@ }, "node_modules/netlify-cli/node_modules/config-chain": { "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, - "license": "MIT", "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" @@ -12128,13 +15454,15 @@ }, "node_modules/netlify-cli/node_modules/config-chain/node_modules/ini": { "version": "1.3.8", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/netlify-cli/node_modules/configstore": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "dot-prop": "^6.0.1", "graceful-fs": "^4.2.6", @@ -12151,8 +15479,9 @@ }, "node_modules/netlify-cli/node_modules/configstore/node_modules/dot-prop": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, - "license": "MIT", "dependencies": { "is-obj": "^2.0.0" }, @@ -12165,8 +15494,9 @@ }, "node_modules/netlify-cli/node_modules/configstore/node_modules/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, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -12176,21 +15506,24 @@ }, "node_modules/netlify-cli/node_modules/consola": { "version": "3.2.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", + "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", "dev": true, - "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" } }, "node_modules/netlify-cli/node_modules/console-control-strings": { "version": "1.1.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" }, @@ -12200,6 +15533,8 @@ }, "node_modules/netlify-cli/node_modules/content-disposition/node_modules/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==", "dev": true, "funding": [ { @@ -12214,47 +15549,52 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/cookie": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/cookie-es": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", + "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/cookie-signature": { "version": "1.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true }, "node_modules/netlify-cli/node_modules/copy-descriptor": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/copy-template-dir": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/copy-template-dir/-/copy-template-dir-1.4.0.tgz", + "integrity": "sha512-xkXSJhvKz4MfLbVkZ7GyCaFo4ciB3uKI/HHzkGwj1eyTH5+7RTFxW5CE0irWAZgV5oFcO9hd6+NVXAtY9hlo7Q==", "dev": true, - "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "graceful-fs": "^4.1.3", @@ -12269,8 +15609,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces": { "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, - "license": "MIT", "dependencies": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -12289,8 +15630,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces/node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -12300,8 +15642,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", "dev": true, - "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", "is-number": "^3.0.0", @@ -12314,8 +15657,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range/node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -12325,16 +15669,18 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, - "license": "MIT", "dependencies": { "kind-of": "^3.0.2" }, @@ -12344,8 +15690,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number/node_modules/kind-of": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, - "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -12355,8 +15702,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/micromatch": { "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, - "license": "MIT", "dependencies": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -12378,8 +15726,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/pump": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", "dev": true, - "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -12387,8 +15736,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -12401,8 +15751,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readdirp": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", @@ -12414,8 +15765,9 @@ }, "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/to-regex-range": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", "dev": true, - "license": "MIT", "dependencies": { "is-number": "^3.0.0", "repeat-string": "^1.6.1" @@ -12426,13 +15778,15 @@ }, "node_modules/netlify-cli/node_modules/core-util-is": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/cp-file": { "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.10", "nested-error-stacks": "^2.1.1", @@ -12447,8 +15801,9 @@ }, "node_modules/netlify-cli/node_modules/cpy": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", + "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", "dev": true, - "license": "MIT", "dependencies": { "arrify": "^3.0.0", "cp-file": "^9.1.0", @@ -12468,8 +15823,9 @@ }, "node_modules/netlify-cli/node_modules/cpy/node_modules/cp-file": { "version": "9.1.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", + "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "make-dir": "^3.0.0", @@ -12485,8 +15841,9 @@ }, "node_modules/netlify-cli/node_modules/cpy/node_modules/globby": { "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, - "license": "MIT", "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.3.0", @@ -12503,8 +15860,9 @@ }, "node_modules/netlify-cli/node_modules/cpy/node_modules/p-event": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", "dev": true, - "license": "MIT", "dependencies": { "p-timeout": "^3.1.0" }, @@ -12517,8 +15875,9 @@ }, "node_modules/netlify-cli/node_modules/cpy/node_modules/p-timeout": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "dev": true, - "license": "MIT", "dependencies": { "p-finally": "^1.0.0" }, @@ -12528,8 +15887,9 @@ }, "node_modules/netlify-cli/node_modules/cpy/node_modules/slash": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -12539,8 +15899,9 @@ }, "node_modules/netlify-cli/node_modules/crc-32": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "dev": true, - "license": "Apache-2.0", "bin": { "crc32": "bin/crc32.njs" }, @@ -12550,8 +15911,9 @@ }, "node_modules/netlify-cli/node_modules/crc32-stream": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-5.0.0.tgz", + "integrity": "sha512-B0EPa1UK+qnpBZpG+7FgPCu0J2ETLpXq09o9BkLkEAhdB6Z61Qo4pJ3JYu0c+Qi+/SAL7QThqnzS06pmSSyZaw==", "dev": true, - "license": "MIT", "dependencies": { "crc-32": "^1.2.0", "readable-stream": "^3.4.0" @@ -12562,13 +15924,15 @@ }, "node_modules/netlify-cli/node_modules/create-require": { "version": "1.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/cron-parser": { "version": "4.8.1", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.8.1.tgz", + "integrity": "sha512-jbokKWGcyU4gl6jAfX97E1gDpY12DJ1cLJZmoDzaAln/shZ+S3KBFBuA2Q6WeUN4gJf/8klnV1EfvhA2lK5IRQ==", "dev": true, - "license": "MIT", "dependencies": { "luxon": "^3.2.1" }, @@ -12578,8 +15942,9 @@ }, "node_modules/netlify-cli/node_modules/cross-spawn": { "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -12591,16 +15956,18 @@ }, "node_modules/netlify-cli/node_modules/cross-spawn/node_modules/path-key": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/crypto-random-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^1.0.1" }, @@ -12613,8 +15980,9 @@ }, "node_modules/netlify-cli/node_modules/crypto-random-string/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -12624,8 +15992,9 @@ }, "node_modules/netlify-cli/node_modules/css-select": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -12639,8 +16008,9 @@ }, "node_modules/netlify-cli/node_modules/css-select/node_modules/dom-serializer": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, - "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -12652,8 +16022,9 @@ }, "node_modules/netlify-cli/node_modules/css-select/node_modules/domhandler": { "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -12666,8 +16037,9 @@ }, "node_modules/netlify-cli/node_modules/css-select/node_modules/domutils": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -12679,8 +16051,9 @@ }, "node_modules/netlify-cli/node_modules/css-select/node_modules/entities": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -12690,8 +16063,9 @@ }, "node_modules/netlify-cli/node_modules/css-tree": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", "dev": true, - "license": "MIT", "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -12702,8 +16076,9 @@ }, "node_modules/netlify-cli/node_modules/css-what": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">= 6" }, @@ -12713,13 +16088,15 @@ }, "node_modules/netlify-cli/node_modules/cssfilter": { "version": "0.0.10", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==", + "dev": true }, "node_modules/netlify-cli/node_modules/csso": { "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dev": true, - "license": "MIT", "dependencies": { "css-tree": "~2.2.0" }, @@ -12730,8 +16107,9 @@ }, "node_modules/netlify-cli/node_modules/csso/node_modules/css-tree": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", "dev": true, - "license": "MIT", "dependencies": { "mdn-data": "2.0.28", "source-map-js": "^1.0.1" @@ -12743,26 +16121,30 @@ }, "node_modules/netlify-cli/node_modules/csso/node_modules/mdn-data": { "version": "2.0.28", - "dev": true, - "license": "CC0-1.0" + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "dev": true }, "node_modules/netlify-cli/node_modules/cyclist": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true }, "node_modules/netlify-cli/node_modules/data-uri-to-buffer": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 12" } }, "node_modules/netlify-cli/node_modules/date-time": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", "dev": true, - "license": "MIT", "dependencies": { "time-zone": "^1.0.0" }, @@ -12772,8 +16154,9 @@ }, "node_modules/netlify-cli/node_modules/debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -12788,29 +16171,33 @@ }, "node_modules/netlify-cli/node_modules/debug/node_modules/ms": { "version": "2.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/netlify-cli/node_modules/decache": { "version": "4.6.2", + "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.2.tgz", + "integrity": "sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==", "dev": true, - "license": "MIT", "dependencies": { "callsite": "^1.0.0" } }, "node_modules/netlify-cli/node_modules/decode-uri-component": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10" } }, "node_modules/netlify-cli/node_modules/decompress-response": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-response": "^3.1.0" }, @@ -12823,8 +16210,9 @@ }, "node_modules/netlify-cli/node_modules/decompress-response/node_modules/mimic-response": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -12834,53 +16222,60 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=4.0.0" } }, "node_modules/netlify-cli/node_modules/deep-is": { "version": "0.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/deepmerge": { "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/defaults": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "dev": true, - "license": "MIT", "dependencies": { "clone": "^1.0.2" } }, "node_modules/netlify-cli/node_modules/defer-to-connect": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/netlify-cli/node_modules/define-lazy-prop": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/define-property": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^1.0.2", "isobject": "^3.0.1" @@ -12891,52 +16286,60 @@ }, "node_modules/netlify-cli/node_modules/defu": { "version": "6.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.3.tgz", + "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/netlify-cli/node_modules/delegates": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/denque": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=0.10" } }, "node_modules/netlify-cli/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/deprecation": { "version": "2.3.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/destr": { "version": "2.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.2.tgz", + "integrity": "sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==", + "dev": true }, "node_modules/netlify-cli/node_modules/destroy": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -12944,16 +16347,18 @@ }, "node_modules/netlify-cli/node_modules/detect-libc": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/detective-amd": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.1.tgz", + "integrity": "sha512-e7n0E0Wte78U9lcpl3hsTh1ZJ+zp/rgEbdbzGLgTowSbbSemuHnM8olp4KHMF1eCaurrCE50IU9VkoV13ezK4A==", "dev": true, - "license": "MIT", "dependencies": { "ast-module-types": "^5.0.0", "escodegen": "^2.0.0", @@ -12969,8 +16374,9 @@ }, "node_modules/netlify-cli/node_modules/detective-cjs": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-5.0.1.tgz", + "integrity": "sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==", "dev": true, - "license": "MIT", "dependencies": { "ast-module-types": "^5.0.0", "node-source-walk": "^6.0.0" @@ -12981,8 +16387,9 @@ }, "node_modules/netlify-cli/node_modules/detective-es6": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-4.0.1.tgz", + "integrity": "sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==", "dev": true, - "license": "MIT", "dependencies": { "node-source-walk": "^6.0.1" }, @@ -12992,8 +16399,9 @@ }, "node_modules/netlify-cli/node_modules/detective-postcss": { "version": "6.1.3", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", + "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", "dev": true, - "license": "MIT", "dependencies": { "is-url": "^1.2.4", "postcss": "^8.4.23", @@ -13005,8 +16413,9 @@ }, "node_modules/netlify-cli/node_modules/detective-sass": { "version": "5.0.3", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-5.0.3.tgz", + "integrity": "sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==", "dev": true, - "license": "MIT", "dependencies": { "gonzales-pe": "^4.3.0", "node-source-walk": "^6.0.1" @@ -13017,8 +16426,9 @@ }, "node_modules/netlify-cli/node_modules/detective-scss": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-4.0.3.tgz", + "integrity": "sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==", "dev": true, - "license": "MIT", "dependencies": { "gonzales-pe": "^4.3.0", "node-source-walk": "^6.0.1" @@ -13029,16 +16439,18 @@ }, "node_modules/netlify-cli/node_modules/detective-stylus": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-4.0.0.tgz", + "integrity": "sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/detective-typescript": { "version": "11.0.1", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.0.1.tgz", + "integrity": "sha512-pVCuFWdEAyHI16zO3NBWSAULV8pevSkX3gwK8w3y9RrBGUrig6wDvwv6vUpnu+HfOr0MDmjMkmJGNWaTb6+HkA==", "dev": true, - "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "^5.59.2", "ast-module-types": "^5.0.0", @@ -13051,8 +16463,9 @@ }, "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/types": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -13063,8 +16476,9 @@ }, "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/typescript-estree": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "5.62.0", "@typescript-eslint/visitor-keys": "5.62.0", @@ -13089,8 +16503,9 @@ }, "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/visitor-keys": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, - "license": "MIT", "dependencies": { "@typescript-eslint/types": "5.62.0", "eslint-visitor-keys": "^3.3.0" @@ -13105,8 +16520,9 @@ }, "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/eslint-visitor-keys": { "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -13116,8 +16532,9 @@ }, "node_modules/netlify-cli/node_modules/dir-glob": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, - "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -13127,19 +16544,21 @@ }, "node_modules/netlify-cli/node_modules/domelementtype": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/fb55" } - ], - "license": "BSD-2-Clause" + ] }, "node_modules/netlify-cli/node_modules/dot-prop": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz", + "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^2.11.2" }, @@ -13152,8 +16571,9 @@ }, "node_modules/netlify-cli/node_modules/dot-prop/node_modules/type-fest": { "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" }, @@ -13163,60 +16583,69 @@ }, "node_modules/netlify-cli/node_modules/dotenv": { "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=12" } }, "node_modules/netlify-cli/node_modules/eastasianwidth": { "version": "0.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true }, "node_modules/netlify-cli/node_modules/ecdsa-sig-formatter": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } }, "node_modules/netlify-cli/node_modules/ee-first": { "version": "1.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true }, "node_modules/netlify-cli/node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/netlify-cli/node_modules/enabled": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/encodeurl": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/netlify-cli/node_modules/env-paths": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -13226,8 +16655,9 @@ }, "node_modules/netlify-cli/node_modules/envinfo": { "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", "dev": true, - "license": "MIT", "bin": { "envinfo": "dist/cli.js" }, @@ -13237,6 +16667,8 @@ }, "node_modules/netlify-cli/node_modules/error": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", + "integrity": "sha512-UtVv4l5MhijsYUxPJo4390gzfZvAnTHreNnDjnTZaKIiZ/SemXxAhBkYSKtWa5RtBXbLP8tMgn/n0RUa/H7jXw==", "dev": true, "dependencies": { "string-template": "~0.2.1", @@ -13245,42 +16677,48 @@ }, "node_modules/netlify-cli/node_modules/error-ex": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/netlify-cli/node_modules/error-stack-parser": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", "dev": true, - "license": "MIT", "dependencies": { "stackframe": "^1.3.4" } }, "node_modules/netlify-cli/node_modules/es-module-lexer": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.3.tgz", + "integrity": "sha512-iC67eXHToclrlVhQfpRawDiF8D8sQxNxmbqw5oebegOaJkyx/w9C/k57/5e6yJR2zIByRt9OXdqX50DV2t6ZKw==", + "dev": true }, "node_modules/netlify-cli/node_modules/es6-promisify": { "version": "6.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true }, "node_modules/netlify-cli/node_modules/escalade": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/escape-goat": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", + "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -13290,13 +16728,15 @@ }, "node_modules/netlify-cli/node_modules/escape-html": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true }, "node_modules/netlify-cli/node_modules/escodegen": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", @@ -13316,8 +16756,9 @@ }, "node_modules/netlify-cli/node_modules/escodegen/node_modules/levn": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, - "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -13328,8 +16769,9 @@ }, "node_modules/netlify-cli/node_modules/escodegen/node_modules/optionator": { "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, - "license": "MIT", "dependencies": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -13344,6 +16786,8 @@ }, "node_modules/netlify-cli/node_modules/escodegen/node_modules/prelude-ls": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true, "engines": { "node": ">= 0.8.0" @@ -13351,8 +16795,9 @@ }, "node_modules/netlify-cli/node_modules/escodegen/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "license": "BSD-3-Clause", "optional": true, "engines": { "node": ">=0.10.0" @@ -13360,8 +16805,9 @@ }, "node_modules/netlify-cli/node_modules/escodegen/node_modules/type-check": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, - "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2" }, @@ -13371,8 +16817,9 @@ }, "node_modules/netlify-cli/node_modules/esprima": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -13383,58 +16830,66 @@ }, "node_modules/netlify-cli/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/netlify-cli/node_modules/estree-walker": { "version": "2.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true }, "node_modules/netlify-cli/node_modules/esutils": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/etag": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/event-target-shim": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/eventemitter3": { "version": "4.0.7", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true }, "node_modules/netlify-cli/node_modules/events": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/netlify-cli/node_modules/execa": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -13455,8 +16910,9 @@ }, "node_modules/netlify-cli/node_modules/execa/node_modules/is-stream": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -13466,8 +16922,9 @@ }, "node_modules/netlify-cli/node_modules/expand-brackets": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, - "license": "MIT", "dependencies": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -13483,16 +16940,18 @@ }, "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/define-property": { "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -13502,8 +16961,9 @@ }, "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -13513,8 +16973,9 @@ }, "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-descriptor": { "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", "dev": true, - "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -13525,29 +16986,33 @@ }, "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/netlify-cli/node_modules/expand-template": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", "dev": true, - "license": "(MIT OR WTFPL)", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/express": { "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dev": true, - "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -13587,8 +17052,9 @@ }, "node_modules/netlify-cli/node_modules/express-logging": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/express-logging/-/express-logging-1.1.1.tgz", + "integrity": "sha512-1KboYwxxCG5kwkJHR5LjFDTD1Mgl8n4PIMcCuhhd/1OqaxlC68P3QKbvvAbZVUtVgtlxEdTgSUwf6yxwzRCuuA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "on-headers": "^1.0.0" }, @@ -13598,24 +17064,27 @@ }, "node_modules/netlify-cli/node_modules/express/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/netlify-cli/node_modules/express/node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/express/node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, - "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -13629,11 +17098,14 @@ }, "node_modules/netlify-cli/node_modules/express/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/netlify-cli/node_modules/express/node_modules/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==", "dev": true, "funding": [ { @@ -13648,13 +17120,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/ext-list": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", + "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "^1.28.0" }, @@ -13664,8 +17136,9 @@ }, "node_modules/netlify-cli/node_modules/ext-name": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz", + "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==", "dev": true, - "license": "MIT", "dependencies": { "ext-list": "^2.0.0", "sort-keys-length": "^1.0.0" @@ -13676,8 +17149,9 @@ }, "node_modules/netlify-cli/node_modules/extend-shallow": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, - "license": "MIT", "dependencies": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" @@ -13688,8 +17162,9 @@ }, "node_modules/netlify-cli/node_modules/external-editor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, - "license": "MIT", "dependencies": { "chardet": "^0.7.0", "iconv-lite": "^0.4.24", @@ -13701,8 +17176,9 @@ }, "node_modules/netlify-cli/node_modules/extglob": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, - "license": "MIT", "dependencies": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -13719,8 +17195,9 @@ }, "node_modules/netlify-cli/node_modules/extglob/node_modules/define-property": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^1.0.0" }, @@ -13730,8 +17207,9 @@ }, "node_modules/netlify-cli/node_modules/extglob/node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -13741,16 +17219,18 @@ }, "node_modules/netlify-cli/node_modules/extglob/node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/extract-zip": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -13768,8 +17248,9 @@ }, "node_modules/netlify-cli/node_modules/extract-zip/node_modules/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, - "license": "MIT", "dependencies": { "pump": "^3.0.0" }, @@ -13782,38 +17263,45 @@ }, "node_modules/netlify-cli/node_modules/fast-content-type-parse": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.0.0.tgz", + "integrity": "sha512-Xbc4XcysUXcsP5aHUU7Nq3OwvHq97C+WnbkeIefpeYLX+ryzFJlU6OStFJhs6Ol0LkUGpcK+wL0JwfM+FCU5IA==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-decode-uri-component": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-deep-equal": { "version": "3.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-diff": { "version": "1.2.0", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-equals": { "version": "3.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-3.0.3.tgz", + "integrity": "sha512-NCe8qxnZFARSHGztGMZOO/PC1qa5MIFB5Hp66WdzbCRAz8U8US3bx1UTgLS49efBQPcUtO9gf5oVEY8o7y/7Kg==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-fifo": { "version": "1.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.0.tgz", + "integrity": "sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-glob": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, - "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -13827,14 +17315,16 @@ }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/netlify-cli/node_modules/fast-json-stringify": { "version": "5.7.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.7.0.tgz", + "integrity": "sha512-sBVPTgnAZseLu1Qgj6lUbQ0HfjFhZWXAmpZ5AaSGkyLh5gAXBga/uPJjQPHpDFjC9adWIpdOcCLSDTgrZ7snoQ==", "dev": true, - "license": "MIT", "dependencies": { "@fastify/deepmerge": "^1.0.0", "ajv": "^8.10.0", @@ -13846,8 +17336,9 @@ }, "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/ajv": { "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -13861,52 +17352,60 @@ }, "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/json-schema-traverse": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-levenshtein": { "version": "2.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-querystring": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", + "integrity": "sha512-3LQi62IhQoDlmt4ULCYmh17vRO2EtS7hTSsG4WwoKWgV7GLMKBOecEh+aiavASnLx8I2y89OD33AGLo0ccRhzA==", "dev": true, - "license": "MIT", "dependencies": { "fast-decode-uri-component": "^1.0.1" } }, "node_modules/netlify-cli/node_modules/fast-redact": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.2.tgz", + "integrity": "sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/fast-safe-stringify": { "version": "2.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true }, "node_modules/netlify-cli/node_modules/fast-uri": { "version": "2.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.2.0.tgz", + "integrity": "sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg==", + "dev": true }, "node_modules/netlify-cli/node_modules/fastest-levenshtein": { "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4.9.1" } }, "node_modules/netlify-cli/node_modules/fastify": { "version": "4.17.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.17.0.tgz", + "integrity": "sha512-tzuY1tgWJo2Y6qEKwmLhFvACUmr68Io2pqP/sDKU71KRM6A6R3DrCDqLGqANbeLZcKUfdfY58ut35CGqemcTgg==", "dev": true, - "license": "MIT", "dependencies": { "@fastify/ajv-compiler": "^3.5.0", "@fastify/error": "^3.0.0", @@ -13928,11 +17427,14 @@ }, "node_modules/netlify-cli/node_modules/fastify-plugin": { "version": "4.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-4.4.0.tgz", + "integrity": "sha512-ovwFQG2qNy3jcCROiWpr94Hs0le+c7N/3t7m9aVwbFhkxcR/esp2xu25dP8e617HpQdmeDv+gFX4zagdUhDByw==", + "dev": true }, "node_modules/netlify-cli/node_modules/fastify/node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, "funding": [ { @@ -13948,7 +17450,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -13956,8 +17457,9 @@ }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino": { "version": "8.16.1", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz", + "integrity": "sha512-3bKsVhBmgPjGV9pyn4fO/8RtoVDR8ssW1ev819FsRXlRNgW8gR/9Kx+gCK4UPWd4JjrRDLWpzd/pb1AyWm3MGA==", "dev": true, - "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -13977,8 +17479,9 @@ }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-abstract-transport": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", + "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", "dev": true, - "license": "MIT", "dependencies": { "readable-stream": "^4.0.0", "split2": "^4.0.0" @@ -13986,18 +17489,21 @@ }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-std-serializers": { "version": "6.2.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", + "dev": true }, "node_modules/netlify-cli/node_modules/fastify/node_modules/process-warning": { "version": "2.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", + "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", + "dev": true }, "node_modules/netlify-cli/node_modules/fastify/node_modules/readable-stream": { "version": "4.4.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", + "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", "dev": true, - "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -14011,6 +17517,8 @@ }, "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", "dev": true, "funding": [ { @@ -14025,53 +17533,58 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/fastify/node_modules/sonic-boom": { "version": "3.7.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.7.0.tgz", + "integrity": "sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==", "dev": true, - "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" } }, "node_modules/netlify-cli/node_modules/fastify/node_modules/split2": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, - "license": "ISC", "engines": { "node": ">= 10.x" } }, "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/netlify-cli/node_modules/fastq": { "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, - "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/netlify-cli/node_modules/fd-slicer": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, - "license": "MIT", "dependencies": { "pend": "~1.2.0" } }, "node_modules/netlify-cli/node_modules/fdir": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.0.1.tgz", + "integrity": "sha512-bdrUUb0eYQrPRlaAtlSRoLs7sp6yKEwbMQuUgwvi/14TnaqhM/deSZUrC5ic+yjm5nEPPWE61oWpTTxQFQMmLA==", "dev": true, - "license": "MIT", "peerDependencies": { "picomatch": "2.x" }, @@ -14083,11 +17596,14 @@ }, "node_modules/netlify-cli/node_modules/fecha": { "version": "4.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", + "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/fetch-blob": { "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", "dev": true, "funding": [ { @@ -14099,7 +17615,6 @@ "url": "https://paypal.me/jimmywarting" } ], - "license": "MIT", "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" @@ -14110,8 +17625,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website": { "version": "7.3.0", + "resolved": "https://registry.npmjs.org/fetch-node-website/-/fetch-node-website-7.3.0.tgz", + "integrity": "sha512-/wayUHbdVUWrD72aqRNNrr6+MHnCkumZgNugN0RfiWJpbNJUdAkMk4Z18MGayGZVVqYXR1RWrV+bIFEt5HuBZg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "cli-progress": "^3.11.2", "colors-option": "^4.4.0", @@ -14125,8 +17641,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@sindresorhus/is": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -14136,8 +17653,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@szmarczak/http-timer": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, - "license": "MIT", "dependencies": { "defer-to-connect": "^2.0.1" }, @@ -14147,16 +17665,18 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-lookup": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" } }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-request": { "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/http-cache-semantics": "^4.0.2", "get-stream": "^6.0.1", @@ -14172,8 +17692,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/colors-option": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-4.5.0.tgz", + "integrity": "sha512-Soe5lerRg3erMRgYC0EC696/8dMCGpBzcQchFfi55Yrkja8F+P7cUt0LVTIg7u5ob5BexLZ/F1kO+ejmv+nq8w==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^5.0.1", "is-plain-obj": "^4.1.0" @@ -14184,8 +17705,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -14195,8 +17717,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/figures": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0", "is-unicode-supported": "^1.2.0" @@ -14210,8 +17733,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/got": { "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, - "license": "MIT", "dependencies": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", @@ -14234,8 +17758,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/http2-wrapper": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", "dev": true, - "license": "MIT", "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" @@ -14246,8 +17771,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/lowercase-keys": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -14257,8 +17783,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/mimic-response": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -14268,8 +17795,9 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/normalize-url": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -14279,16 +17807,18 @@ }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/p-cancelable": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20" } }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/responselike": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, - "license": "MIT", "dependencies": { "lowercase-keys": "^3.0.0" }, @@ -14301,8 +17831,9 @@ }, "node_modules/netlify-cli/node_modules/figures": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -14315,16 +17846,18 @@ }, "node_modules/netlify-cli/node_modules/figures/node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/netlify-cli/node_modules/file-type": { "version": "18.5.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz", + "integrity": "sha512-yvpl5U868+V6PqXHMmsESpg6unQ5GfnPssl4dxdJudBrr9qy7Fddt7EVX1VLlddFfe8Gj9N7goCZH22FXuSQXQ==", "dev": true, - "license": "MIT", "dependencies": { "readable-web-to-node-stream": "^3.0.2", "strtok3": "^7.0.0", @@ -14339,13 +17872,15 @@ }, "node_modules/netlify-cli/node_modules/file-uri-to-path": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -14355,8 +17890,9 @@ }, "node_modules/netlify-cli/node_modules/filter-obj": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", + "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -14366,8 +17902,9 @@ }, "node_modules/netlify-cli/node_modules/finalhandler": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dev": true, - "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -14383,21 +17920,24 @@ }, "node_modules/netlify-cli/node_modules/finalhandler/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/netlify-cli/node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/netlify-cli/node_modules/find-my-way": { "version": "7.6.2", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.2.tgz", + "integrity": "sha512-0OjHn1b1nCX3eVbm9ByeEHiscPYiHLfhei1wOUU9qffQkk98wE0Lo8VrVYfSGMgnSnDh86DxedduAnBf4nwUEw==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-querystring": "^1.0.0", @@ -14409,8 +17949,9 @@ }, "node_modules/netlify-cli/node_modules/find-up": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" @@ -14424,16 +17965,18 @@ }, "node_modules/netlify-cli/node_modules/find-up/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/flush-write-stream": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-2.0.0.tgz", + "integrity": "sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "readable-stream": "^3.1.1" @@ -14441,19 +17984,23 @@ }, "node_modules/netlify-cli/node_modules/fn.name": { "version": "1.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "dev": true }, "node_modules/netlify-cli/node_modules/folder-walker": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/folder-walker/-/folder-walker-3.2.0.tgz", + "integrity": "sha512-VjAQdSLsl6AkpZNyrQJfO7BXLo4chnStqb055bumZMbRUPpVuPN3a4ktsnRCmrFZjtMlYLkyXiR5rAs4WOpC4Q==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "from2": "^2.1.0" } }, "node_modules/netlify-cli/node_modules/follow-redirects": { "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", "dev": true, "funding": [ { @@ -14461,7 +18008,6 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -14473,16 +18019,18 @@ }, "node_modules/netlify-cli/node_modules/for-in": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/form-data": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -14494,16 +18042,18 @@ }, "node_modules/netlify-cli/node_modules/form-data-encoder": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 14.17" } }, "node_modules/netlify-cli/node_modules/formdata-polyfill": { "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "dev": true, - "license": "MIT", "dependencies": { "fetch-blob": "^3.1.2" }, @@ -14513,16 +18063,18 @@ }, "node_modules/netlify-cli/node_modules/forwarded": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/fragment-cache": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, - "license": "MIT", "dependencies": { "map-cache": "^0.2.2" }, @@ -14532,16 +18084,18 @@ }, "node_modules/netlify-cli/node_modules/fresh": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/from2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" @@ -14549,16 +18103,18 @@ }, "node_modules/netlify-cli/node_modules/from2-array": { "version": "0.0.4", + "resolved": "https://registry.npmjs.org/from2-array/-/from2-array-0.0.4.tgz", + "integrity": "sha512-0G0cAp7sYLobH7ALsr835x98PU/YeVF7wlwxdWbCUaea7wsa7lJfKZUAo6p2YZGZ8F94luCuqHZS3JtFER6uPg==", "dev": true, - "license": "MIT", "dependencies": { "from2": "^2.0.3" } }, "node_modules/netlify-cli/node_modules/from2/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -14571,13 +18127,15 @@ }, "node_modules/netlify-cli/node_modules/fs-constants": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true }, "node_modules/netlify-cli/node_modules/fs-minipass": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, - "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, @@ -14587,8 +18145,9 @@ }, "node_modules/netlify-cli/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -14598,13 +18157,16 @@ }, "node_modules/netlify-cli/node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "node_modules/netlify-cli/node_modules/fsevents": { "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "license": "MIT", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -14615,14 +18177,17 @@ }, "node_modules/netlify-cli/node_modules/function-bind": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/netlify-cli/node_modules/fuzzy": { "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz", + "integrity": "sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==", "dev": true, "engines": { "node": ">= 0.6.0" @@ -14630,8 +18195,9 @@ }, "node_modules/netlify-cli/node_modules/gauge": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "dev": true, - "license": "ISC", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -14649,8 +18215,9 @@ }, "node_modules/netlify-cli/node_modules/gauge/node_modules/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, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -14660,8 +18227,9 @@ }, "node_modules/netlify-cli/node_modules/get-amd-module-type": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-5.0.1.tgz", + "integrity": "sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==", "dev": true, - "license": "MIT", "dependencies": { "ast-module-types": "^5.0.0", "node-source-walk": "^6.0.1" @@ -14672,16 +18240,18 @@ }, "node_modules/netlify-cli/node_modules/get-caller-file": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, - "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/netlify-cli/node_modules/get-intrinsic": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "dev": true, - "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -14693,16 +18263,18 @@ }, "node_modules/netlify-cli/node_modules/get-package-name": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/get-package-name/-/get-package-name-2.2.0.tgz", + "integrity": "sha512-LmCKVxioe63Fy6KDAQ/mmCSOSSRUE/x4zdrMD+7dU8quF3bGpzvP8mOmq4Dgce3nzU9AgkVDotucNOOg7c27BQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 12.0.0" } }, "node_modules/netlify-cli/node_modules/get-port": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -14712,13 +18284,15 @@ }, "node_modules/netlify-cli/node_modules/get-port-please": { "version": "3.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.1.tgz", + "integrity": "sha512-3UBAyM3u4ZBVYDsxOQfJDxEa6XTbpBDrOjp4mf7ExFRt5BKs/QywQQiJsh2B+hxcZLSapWqCRvElUe8DnKcFHA==", + "dev": true }, "node_modules/netlify-cli/node_modules/get-stream": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -14728,16 +18302,18 @@ }, "node_modules/netlify-cli/node_modules/get-value": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/gh-release-fetch": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-4.0.3.tgz", + "integrity": "sha512-TOiP1nwLsH5shG85Yt6v6Kjq5JU/44jXyEpbcfPgmj3C829yeXIlx9nAEwQRaxtRF3SJinn2lz7XUkfG9W/U4g==", "dev": true, - "license": "MIT", "dependencies": { "@xhmikosr/downloader": "^13.0.0", "node-fetch": "^3.3.1", @@ -14749,8 +18325,9 @@ }, "node_modules/netlify-cli/node_modules/gh-release-fetch/node_modules/node-fetch": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, - "license": "MIT", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -14766,34 +18343,39 @@ }, "node_modules/netlify-cli/node_modules/git-repo-info": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/git-repo-info/-/git-repo-info-2.1.1.tgz", + "integrity": "sha512-8aCohiDo4jwjOwma4FmYFd3i97urZulL8XL24nIPxuE+GZnfsAyy/g2Shqx6OjUiFKUXZM+Yy+KHnOmmA3FVcg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4.0" } }, "node_modules/netlify-cli/node_modules/gitconfiglocal": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-2.1.0.tgz", + "integrity": "sha512-qoerOEliJn3z+Zyn1HW2F6eoYJqKwS6MgC9cztTLUB/xLWX8gD/6T60pKn4+t/d6tP7JlybI7Z3z+I572CR/Vg==", "dev": true, - "license": "BSD", "dependencies": { "ini": "^1.3.2" } }, "node_modules/netlify-cli/node_modules/gitconfiglocal/node_modules/ini": { "version": "1.3.8", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/netlify-cli/node_modules/github-from-package": { "version": "0.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true }, "node_modules/netlify-cli/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -14811,8 +18393,9 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -14822,8 +18405,9 @@ }, "node_modules/netlify-cli/node_modules/global-cache-dir": { "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global-cache-dir/-/global-cache-dir-4.4.0.tgz", + "integrity": "sha512-bk0gI6IbbphRjAaCJJn5H+T/CcEck5B3a5KBO2BXSDzjFSV+API17w8GA7YPJ6IXJiasW8M0VsEIig1PCHdfOQ==", "dev": true, - "license": "MIT", "dependencies": { "cachedir": "^2.3.0", "path-exists": "^5.0.0" @@ -14834,16 +18418,18 @@ }, "node_modules/netlify-cli/node_modules/global-cache-dir/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/globby": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, - "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -14861,8 +18447,9 @@ }, "node_modules/netlify-cli/node_modules/gonzales-pe": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", + "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5" }, @@ -14875,13 +18462,15 @@ }, "node_modules/netlify-cli/node_modules/graceful-fs": { "version": "4.2.10", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/netlify-cli/node_modules/h3": { "version": "1.8.2", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.8.2.tgz", + "integrity": "sha512-1Ca0orJJlCaiFY68BvzQtP2lKLk46kcLAxVM8JgYbtm2cUg6IY7pjpYgWMwUvDO9QI30N5JAukOKoT8KD3Q0PQ==", "dev": true, - "license": "MIT", "dependencies": { "cookie-es": "^1.0.0", "defu": "^6.1.2", @@ -14895,8 +18484,9 @@ }, "node_modules/netlify-cli/node_modules/has": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, - "license": "MIT", "dependencies": { "function-bind": "^1.1.1" }, @@ -14906,24 +18496,27 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/has-own-prop": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/has-symbols": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -14933,13 +18526,15 @@ }, "node_modules/netlify-cli/node_modules/has-unicode": { "version": "2.0.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/has-value": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", "dev": true, - "license": "MIT", "dependencies": { "get-value": "^2.0.6", "has-values": "^1.0.0", @@ -14951,8 +18546,9 @@ }, "node_modules/netlify-cli/node_modules/has-values": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", "dev": true, - "license": "MIT", "dependencies": { "is-number": "^3.0.0", "kind-of": "^4.0.0" @@ -14963,8 +18559,9 @@ }, "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, - "license": "MIT", "dependencies": { "kind-of": "^3.0.2" }, @@ -14974,8 +18571,9 @@ }, "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number/node_modules/kind-of": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, - "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -14985,8 +18583,9 @@ }, "node_modules/netlify-cli/node_modules/has-values/node_modules/kind-of": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", "dev": true, - "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -14996,8 +18595,9 @@ }, "node_modules/netlify-cli/node_modules/has-yarn": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", + "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -15007,8 +18607,9 @@ }, "node_modules/netlify-cli/node_modules/hasbin": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz", + "integrity": "sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==", "dev": true, - "license": "MIT", "dependencies": { "async": "~1.5" }, @@ -15018,13 +18619,15 @@ }, "node_modules/netlify-cli/node_modules/hasbin/node_modules/async": { "version": "1.5.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "dev": true }, "node_modules/netlify-cli/node_modules/hasha": { "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, - "license": "MIT", "dependencies": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" @@ -15038,8 +18641,9 @@ }, "node_modules/netlify-cli/node_modules/hasha/node_modules/is-stream": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -15049,16 +18653,18 @@ }, "node_modules/netlify-cli/node_modules/hasha/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/hasown": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", "dev": true, - "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -15068,6 +18674,8 @@ }, "node_modules/netlify-cli/node_modules/hexer": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/hexer/-/hexer-1.5.0.tgz", + "integrity": "sha512-dyrPC8KzBzUJ19QTIo1gXNqIISRXQ0NwteW6OeQHRN4ZuZeHkdODfj0zHBdOlHbRY8GqbqK57C9oWSvQZizFsg==", "dev": true, "dependencies": { "ansi-color": "^0.2.1", @@ -15084,6 +18692,8 @@ }, "node_modules/netlify-cli/node_modules/hexer/node_modules/process": { "version": "0.10.1", + "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", + "integrity": "sha512-dyIett8dgGIZ/TXKUzeYExt7WA6ldDzys9vTDU/cCA9L17Ypme+KzS+NjQCjpn9xsvi/shbMC+yP/BcFMBz0NA==", "dev": true, "engines": { "node": ">= 0.6.0" @@ -15091,8 +18701,9 @@ }, "node_modules/netlify-cli/node_modules/hosted-git-info": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -15102,8 +18713,9 @@ }, "node_modules/netlify-cli/node_modules/hot-shots": { "version": "10.0.0", + "resolved": "https://registry.npmjs.org/hot-shots/-/hot-shots-10.0.0.tgz", + "integrity": "sha512-uy/uGpuJk7yuyiKRfZMBNkF1GAOX5O2ifO9rDCaX9jw8fu6eW9QeWC7WRPDI+O98frW1HQgV3+xwjWsZPECIzQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -15113,13 +18725,15 @@ }, "node_modules/netlify-cli/node_modules/http-cache-semantics": { "version": "4.1.1", - "dev": true, - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", @@ -15133,16 +18747,18 @@ }, "node_modules/netlify-cli/node_modules/http-errors/node_modules/statuses": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/http-proxy": { "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, - "license": "MIT", "dependencies": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -15154,8 +18770,9 @@ }, "node_modules/netlify-cli/node_modules/http-proxy-middleware": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", "dev": true, - "license": "MIT", "dependencies": { "@types/http-proxy": "^1.17.8", "http-proxy": "^1.18.1", @@ -15177,8 +18794,9 @@ }, "node_modules/netlify-cli/node_modules/http-proxy-middleware/node_modules/is-plain-obj": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -15188,8 +18806,9 @@ }, "node_modules/netlify-cli/node_modules/http-shutdown": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/http-shutdown/-/http-shutdown-1.2.2.tgz", + "integrity": "sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==", "dev": true, - "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -15197,8 +18816,9 @@ }, "node_modules/netlify-cli/node_modules/https-proxy-agent": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "6", "debug": "4" @@ -15209,16 +18829,18 @@ }, "node_modules/netlify-cli/node_modules/human-signals": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } }, "node_modules/netlify-cli/node_modules/iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -15228,6 +18850,8 @@ }, "node_modules/netlify-cli/node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, "funding": [ { @@ -15242,42 +18866,46 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/netlify-cli/node_modules/ignore": { "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/netlify-cli/node_modules/image-meta": { "version": "0.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/image-meta/-/image-meta-0.2.0.tgz", + "integrity": "sha512-ZBGjl0ZMEMeOC3Ns0wUF/5UdUmr3qQhBSCniT0LxOgGGIRHiNFOkMtIHB7EOznRU47V2AxPgiVP+s+0/UCU0Hg==", + "dev": true }, "node_modules/netlify-cli/node_modules/import-lazy": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/imurmurhash": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.19" } }, "node_modules/netlify-cli/node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -15285,21 +18913,24 @@ }, "node_modules/netlify-cli/node_modules/inherits": { "version": "2.0.4", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/ini": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/netlify-cli/node_modules/inquirer": { "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-escapes": "^3.2.0", "chalk": "^2.4.2", @@ -15321,8 +18952,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-1.4.0.tgz", + "integrity": "sha512-qHgHyJmbULt4hI+kCmwX92MnSxDs/Yhdt4wPA30qnoa01OF6uTXV8yvH4hKXgdaTNmkZ9D01MHjqKYEuJN+ONw==", "dev": true, - "license": "ISC", "dependencies": { "ansi-escapes": "^4.3.1", "chalk": "^4.0.0", @@ -15339,8 +18971,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/ansi-escapes": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -15353,8 +18986,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -15367,8 +19001,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -15382,8 +19017,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -15393,13 +19029,15 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -15409,8 +19047,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/type-fest": { "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -15420,24 +19059,27 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-escapes": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-regex": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-styles": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -15447,8 +19089,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -15460,16 +19103,18 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/figures": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -15479,24 +19124,27 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/has-flag": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/is-fullwidth-code-point": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, - "license": "MIT", "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -15507,16 +19155,18 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^3.0.0" }, @@ -15526,8 +19176,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/strip-ansi": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^4.1.0" }, @@ -15537,8 +19188,9 @@ }, "node_modules/netlify-cli/node_modules/inquirer/node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -15548,16 +19200,18 @@ }, "node_modules/netlify-cli/node_modules/inspect-with-kind": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/inspect-with-kind/-/inspect-with-kind-1.0.5.tgz", + "integrity": "sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==", "dev": true, - "license": "ISC", "dependencies": { "kind-of": "^6.0.2" } }, "node_modules/netlify-cli/node_modules/ioredis": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", "dev": true, - "license": "MIT", "dependencies": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", @@ -15579,16 +19233,18 @@ }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/netlify-cli/node_modules/ipx": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ipx/-/ipx-2.0.1.tgz", + "integrity": "sha512-+EyZiVNosYr3hu3F5+5GripTBLjKmSPTvcy3YdT4zxlhqHQJ2gUopLGxpfv9Wd11YgeiPh53ysbtG+ZNIOVF4A==", "dev": true, - "license": "MIT", "dependencies": { "@fastify/accept-negotiator": "^1.1.0", "citty": "^0.1.4", @@ -15613,16 +19269,18 @@ }, "node_modules/netlify-cli/node_modules/iron-webcrypto": { "version": "0.10.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-0.10.1.tgz", + "integrity": "sha512-QGOS8MRMnj/UiOa+aMIgfyHcvkhqNUsUxb1XzskENvbo+rEfp6TOwqd1KPuDzXC4OnGHcMSVxDGRoilqB8ViqA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/brc-dd" } }, "node_modules/netlify-cli/node_modules/is-accessor-descriptor": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", + "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", "dev": true, - "license": "MIT", "dependencies": { "hasown": "^2.0.0" }, @@ -15632,13 +19290,15 @@ }, "node_modules/netlify-cli/node_modules/is-arrayish": { "version": "0.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -15648,13 +19308,15 @@ }, "node_modules/netlify-cli/node_modules/is-buffer": { "version": "1.1.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "node_modules/netlify-cli/node_modules/is-builtin-module": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", "dev": true, - "license": "MIT", "dependencies": { "builtin-modules": "^3.0.0" }, @@ -15664,8 +19326,9 @@ }, "node_modules/netlify-cli/node_modules/is-ci": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, - "license": "MIT", "dependencies": { "ci-info": "^3.2.0" }, @@ -15675,8 +19338,9 @@ }, "node_modules/netlify-cli/node_modules/is-core-module": { "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, - "license": "MIT", "dependencies": { "has": "^1.0.3" }, @@ -15686,8 +19350,9 @@ }, "node_modules/netlify-cli/node_modules/is-data-descriptor": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", + "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", "dev": true, - "license": "MIT", "dependencies": { "hasown": "^2.0.0" }, @@ -15697,8 +19362,9 @@ }, "node_modules/netlify-cli/node_modules/is-descriptor": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", "dev": true, - "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -15709,8 +19375,9 @@ }, "node_modules/netlify-cli/node_modules/is-docker": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", "dev": true, - "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -15723,8 +19390,9 @@ }, "node_modules/netlify-cli/node_modules/is-extendable": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, - "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4" }, @@ -15734,8 +19402,9 @@ }, "node_modules/netlify-cli/node_modules/is-extendable/node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, - "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -15745,16 +19414,18 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/is-fullwidth-code-point": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -15764,8 +19435,9 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -15775,8 +19447,9 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -15790,8 +19463,9 @@ }, "node_modules/netlify-cli/node_modules/is-installed-globally/node_modules/global-dirs": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, - "license": "MIT", "dependencies": { "ini": "2.0.0" }, @@ -15804,8 +19478,9 @@ }, "node_modules/netlify-cli/node_modules/is-interactive": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -15815,8 +19490,9 @@ }, "node_modules/netlify-cli/node_modules/is-npm": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", + "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -15826,32 +19502,36 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/is-plain-obj": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -15861,16 +19541,18 @@ }, "node_modules/netlify-cli/node_modules/is-plain-object": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -15880,13 +19562,15 @@ }, "node_modules/netlify-cli/node_modules/is-typedarray": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "node_modules/netlify-cli/node_modules/is-unicode-supported": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -15896,13 +19580,15 @@ }, "node_modules/netlify-cli/node_modules/is-url": { "version": "1.2.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true }, "node_modules/netlify-cli/node_modules/is-url-superb": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", + "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -15912,16 +19598,18 @@ }, "node_modules/netlify-cli/node_modules/is-windows": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/is-wsl": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, - "license": "MIT", "dependencies": { "is-docker": "^2.0.0" }, @@ -15931,8 +19619,9 @@ }, "node_modules/netlify-cli/node_modules/is-wsl/node_modules/is-docker": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, - "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -15945,39 +19634,45 @@ }, "node_modules/netlify-cli/node_modules/is-yarn-global": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", + "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/netlify-cli/node_modules/isarray": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/iserror": { "version": "0.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz", + "integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw==", + "dev": true }, "node_modules/netlify-cli/node_modules/isexe": { "version": "2.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/netlify-cli/node_modules/isobject": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/jaeger-client": { "version": "3.19.0", + "resolved": "https://registry.npmjs.org/jaeger-client/-/jaeger-client-3.19.0.tgz", + "integrity": "sha512-M0c7cKHmdyEUtjemnJyx/y9uX16XHocL46yQvyqDlPdvAcwPDbHrIbKjQdBqtiE4apQ/9dmr+ZLJYYPGnurgpw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "node-int64": "^0.4.0", "opentracing": "^0.14.4", @@ -15991,24 +19686,27 @@ }, "node_modules/netlify-cli/node_modules/jaeger-client/node_modules/uuid": { "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, - "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/netlify-cli/node_modules/jest-get-type": { "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", "dev": true, - "license": "MIT", "engines": { "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, "node_modules/netlify-cli/node_modules/jest-validate": { "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz", + "integrity": "sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "^27.5.1", "camelcase": "^6.2.0", @@ -16023,8 +19721,9 @@ }, "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -16037,8 +19736,9 @@ }, "node_modules/netlify-cli/node_modules/jest-validate/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -16052,8 +19752,9 @@ }, "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -16063,13 +19764,15 @@ }, "node_modules/netlify-cli/node_modules/jest-validate/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -16079,29 +19782,33 @@ }, "node_modules/netlify-cli/node_modules/jiti": { "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", "dev": true, - "license": "MIT", "bin": { "jiti": "bin/jiti.js" } }, "node_modules/netlify-cli/node_modules/js-string-escape": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/js-tokens": { "version": "4.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -16111,37 +19818,43 @@ }, "node_modules/netlify-cli/node_modules/json-buffer": { "version": "3.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/netlify-cli/node_modules/jsonc-parser": { "version": "3.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true }, "node_modules/netlify-cli/node_modules/jsonpointer": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/jsonwebtoken": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.1.tgz", + "integrity": "sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==", "dev": true, - "license": "MIT", "dependencies": { "jws": "^3.2.2", "lodash": "^4.17.21", @@ -16155,8 +19868,9 @@ }, "node_modules/netlify-cli/node_modules/junk": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", + "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20" }, @@ -16166,8 +19880,9 @@ }, "node_modules/netlify-cli/node_modules/jwa": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "dev": true, - "license": "MIT", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -16176,8 +19891,9 @@ }, "node_modules/netlify-cli/node_modules/jws": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "dev": true, - "license": "MIT", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" @@ -16185,13 +19901,15 @@ }, "node_modules/netlify-cli/node_modules/jwt-decode": { "version": "3.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", + "dev": true }, "node_modules/netlify-cli/node_modules/keep-func-props": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/keep-func-props/-/keep-func-props-4.0.1.tgz", + "integrity": "sha512-87ftOIICfdww3SxR5P1veq3ThBNyRPG0JGL//oaR08v0k2yTicEIHd7s0GqSJfQvlb+ybC3GiDepOweo0LDhvw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -16201,29 +19919,33 @@ }, "node_modules/netlify-cli/node_modules/keyv": { "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", "dev": true, - "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/netlify-cli/node_modules/kind-of": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/kuler": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "dev": true }, "node_modules/netlify-cli/node_modules/lambda-local": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/lambda-local/-/lambda-local-2.1.2.tgz", + "integrity": "sha512-nGTJn2JxZWcLGpNwXFmXC7UEXL7QCLieQWDiXs46vIv9y/gSPm/uHygEMCaym+HIziniAw0XIm+1VTrXCvG1Zw==", "dev": true, - "license": "MIT", "dependencies": { "commander": "^10.0.1", "dotenv": "^16.3.1", @@ -16238,16 +19960,18 @@ }, "node_modules/netlify-cli/node_modules/lambda-local/node_modules/@colors/colors": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.1.90" } }, "node_modules/netlify-cli/node_modules/lambda-local/node_modules/dotenv": { "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -16257,8 +19981,9 @@ }, "node_modules/netlify-cli/node_modules/lambda-local/node_modules/is-stream": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -16268,8 +19993,9 @@ }, "node_modules/netlify-cli/node_modules/lambda-local/node_modules/winston": { "version": "3.11.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", + "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", "dev": true, - "license": "MIT", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", @@ -16289,8 +20015,9 @@ }, "node_modules/netlify-cli/node_modules/latest-version": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", + "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", "dev": true, - "license": "MIT", "dependencies": { "package-json": "^8.1.0" }, @@ -16303,8 +20030,9 @@ }, "node_modules/netlify-cli/node_modules/lazystream": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", "dev": true, - "license": "MIT", "dependencies": { "readable-stream": "^2.0.5" }, @@ -16314,8 +20042,9 @@ }, "node_modules/netlify-cli/node_modules/lazystream/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -16328,16 +20057,18 @@ }, "node_modules/netlify-cli/node_modules/leven": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/light-my-request": { "version": "5.8.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.8.0.tgz", + "integrity": "sha512-4BtD5C+VmyTpzlDPCZbsatZMJVgUIciSOwYhJDCbLffPZ35KoDkDj4zubLeHDEb35b4kkPeEv5imbh+RJxK/Pg==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "cookie": "^0.5.0", "process-warning": "^2.0.0", @@ -16346,18 +20077,21 @@ }, "node_modules/netlify-cli/node_modules/light-my-request/node_modules/process-warning": { "version": "2.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", + "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", + "dev": true }, "node_modules/netlify-cli/node_modules/lines-and-columns": { "version": "1.2.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true }, "node_modules/netlify-cli/node_modules/listhen": { "version": "1.5.5", + "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.5.5.tgz", + "integrity": "sha512-LXe8Xlyh3gnxdv4tSjTjscD1vpr/2PRpzq8YIaMJgyKzRG8wdISlWVWnGThJfHnlJ6hmLt2wq1yeeix0TEbuoA==", "dev": true, - "license": "MIT", "dependencies": { "@parcel/watcher": "^2.3.0", "@parcel/watcher-wasm": "2.3.0", @@ -16384,8 +20118,9 @@ }, "node_modules/netlify-cli/node_modules/listr2": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", + "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", "dev": true, - "license": "MIT", "dependencies": { "cli-truncate": "^3.1.0", "colorette": "^2.0.20", @@ -16400,18 +20135,21 @@ }, "node_modules/netlify-cli/node_modules/listr2/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true }, "node_modules/netlify-cli/node_modules/listr2/node_modules/eventemitter3": { "version": "5.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true }, "node_modules/netlify-cli/node_modules/listr2/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -16426,8 +20164,9 @@ }, "node_modules/netlify-cli/node_modules/listr2/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -16442,8 +20181,9 @@ }, "node_modules/netlify-cli/node_modules/locate-path": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^6.0.0" }, @@ -16456,8 +20196,9 @@ }, "node_modules/netlify-cli/node_modules/locate-path/node_modules/p-limit": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -16470,8 +20211,9 @@ }, "node_modules/netlify-cli/node_modules/locate-path/node_modules/p-locate": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^4.0.0" }, @@ -16484,8 +20226,9 @@ }, "node_modules/netlify-cli/node_modules/locate-path/node_modules/yocto-queue": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20" }, @@ -16495,58 +20238,69 @@ }, "node_modules/netlify-cli/node_modules/lodash": { "version": "4.17.21", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash-es": { "version": "4.17.21", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.camelcase": { "version": "4.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.deburr": { "version": "4.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", + "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.defaults": { "version": "4.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.isarguments": { "version": "3.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.isempty": { "version": "4.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.isplainobject": { "version": "4.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.merge": { "version": "4.6.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/lodash.transform": { "version": "4.6.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", + "integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=", + "dev": true }, "node_modules/netlify-cli/node_modules/log-process-errors": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/log-process-errors/-/log-process-errors-8.0.0.tgz", + "integrity": "sha512-+SNGqNC1gCMJfhwYzAHr/YgNT/ZJc+V2nCkvtPnjrENMeCe+B/jgShBW0lmWoh6uVV2edFAPc/IUOkDdsjTbTg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "colors-option": "^3.0.0", "figures": "^4.0.0", @@ -16562,8 +20316,9 @@ }, "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -16573,8 +20328,9 @@ }, "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/figures": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", + "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0", "is-unicode-supported": "^1.2.0" @@ -16588,8 +20344,9 @@ }, "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/filter-obj": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", + "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -16599,8 +20356,9 @@ }, "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/map-obj": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -16610,8 +20368,9 @@ }, "node_modules/netlify-cli/node_modules/log-symbols": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^5.0.0", "is-unicode-supported": "^1.1.0" @@ -16625,8 +20384,9 @@ }, "node_modules/netlify-cli/node_modules/log-update": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, - "license": "MIT", "dependencies": { "ansi-escapes": "^5.0.0", "cli-cursor": "^4.0.0", @@ -16643,8 +20403,9 @@ }, "node_modules/netlify-cli/node_modules/log-update/node_modules/ansi-escapes": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^1.0.2" }, @@ -16657,8 +20418,9 @@ }, "node_modules/netlify-cli/node_modules/log-update/node_modules/cli-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, - "license": "MIT", "dependencies": { "restore-cursor": "^4.0.0" }, @@ -16671,13 +20433,15 @@ }, "node_modules/netlify-cli/node_modules/log-update/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true }, "node_modules/netlify-cli/node_modules/log-update/node_modules/restore-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, - "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -16691,8 +20455,9 @@ }, "node_modules/netlify-cli/node_modules/log-update/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -16707,8 +20472,9 @@ }, "node_modules/netlify-cli/node_modules/log-update/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -16718,8 +20484,9 @@ }, "node_modules/netlify-cli/node_modules/log-update/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -16734,8 +20501,9 @@ }, "node_modules/netlify-cli/node_modules/logform": { "version": "2.4.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", + "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", "dev": true, - "license": "MIT", "dependencies": { "@colors/colors": "1.5.0", "fecha": "^4.2.0", @@ -16746,13 +20514,15 @@ }, "node_modules/netlify-cli/node_modules/long": { "version": "5.2.3", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -16762,16 +20532,18 @@ }, "node_modules/netlify-cli/node_modules/luxon": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", + "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/netlify-cli/node_modules/macos-release": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.0.1.tgz", + "integrity": "sha512-3l6OrhdDg2H2SigtuN3jBh+5dRJRWxNKuJTPBbGeNJTsmt/pj9PO25wYaNb05NuNmAsl435j4rDP6rgNXz7s7g==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -16781,8 +20553,9 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -16795,29 +20568,33 @@ }, "node_modules/netlify-cli/node_modules/make-dir/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/netlify-cli/node_modules/make-error": { "version": "1.3.6", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true }, "node_modules/netlify-cli/node_modules/map-cache": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/map-visit": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, - "license": "MIT", "dependencies": { "object-visit": "^1.0.0" }, @@ -16827,13 +20604,15 @@ }, "node_modules/netlify-cli/node_modules/maxstache": { "version": "1.0.7", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/maxstache/-/maxstache-1.0.7.tgz", + "integrity": "sha1-IjHVGAung9Xs/DHEX+2seuQnaYQ=", + "dev": true }, "node_modules/netlify-cli/node_modules/maxstache-stream": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/maxstache-stream/-/maxstache-stream-1.0.4.tgz", + "integrity": "sha1-nH9cq35f3S2Q2oYUO06WMeoygEA=", "dev": true, - "license": "MIT", "dependencies": { "maxstache": "^1.0.0", "pump": "^1.0.0", @@ -16843,8 +20622,9 @@ }, "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/pump": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", "dev": true, - "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -16852,8 +20632,9 @@ }, "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -16866,16 +20647,18 @@ }, "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/split2": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.1.1.tgz", + "integrity": "sha512-cfurE2q8LamExY+lJ9Ex3ZfBwqAPduzOKVscPDXNCLLMvyaeD3DTz1yk7fVIs6Chco+12XeD0BB6HEoYzPYbXA==", "dev": true, - "license": "ISC", "dependencies": { "through2": "~2.0.0" } }, "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, - "license": "MIT", "dependencies": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" @@ -16883,8 +20666,9 @@ }, "node_modules/netlify-cli/node_modules/md5-hex": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", "dev": true, - "license": "MIT", "dependencies": { "blueimp-md5": "^2.10.0" }, @@ -16894,31 +20678,36 @@ }, "node_modules/netlify-cli/node_modules/mdn-data": { "version": "2.0.30", - "dev": true, - "license": "CC0-1.0" + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true }, "node_modules/netlify-cli/node_modules/media-typer": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/memoize-one": { "version": "6.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "dev": true }, "node_modules/netlify-cli/node_modules/merge-descriptors": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true }, "node_modules/netlify-cli/node_modules/merge-options": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", "dev": true, - "license": "MIT", "dependencies": { "is-plain-obj": "^2.1.0" }, @@ -16928,47 +20717,54 @@ }, "node_modules/netlify-cli/node_modules/merge-options/node_modules/is-plain-obj": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/merge-stream": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true }, "node_modules/netlify-cli/node_modules/merge2": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/netlify-cli/node_modules/methods": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/micro-api-client": { "version": "3.3.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/micro-api-client/-/micro-api-client-3.3.0.tgz", + "integrity": "sha512-y0y6CUB9RLVsy3kfgayU28746QrNMpSm9O/AYGNsBgOkJr/X/Jk0VLGoO8Ude7Bpa8adywzF+MzXNZRFRsNPhg==", + "dev": true }, "node_modules/netlify-cli/node_modules/micro-memoize": { "version": "4.0.11", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/micro-memoize/-/micro-memoize-4.0.11.tgz", + "integrity": "sha512-CjxsaYe4j43df32DtzzNCwanPqZjZDwuQAZilsCYpa2ZVtSPDjHXbTlR4gsEZRyO9/twHs0b7HLjvy/sowl7sA==", + "dev": true }, "node_modules/netlify-cli/node_modules/micromatch": { "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, - "license": "MIT", "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -16979,8 +20775,9 @@ }, "node_modules/netlify-cli/node_modules/mime": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, - "license": "MIT", "bin": { "mime": "cli.js" }, @@ -16990,16 +20787,18 @@ }, "node_modules/netlify-cli/node_modules/mime-db": { "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "1.51.0" }, @@ -17009,8 +20808,9 @@ }, "node_modules/netlify-cli/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -17020,8 +20820,9 @@ }, "node_modules/netlify-cli/node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -17031,24 +20832,27 @@ }, "node_modules/netlify-cli/node_modules/minimist": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/netlify-cli/node_modules/minipass": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "license": "ISC", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/minizlib": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, - "license": "MIT", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -17059,8 +20863,9 @@ }, "node_modules/netlify-cli/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -17070,8 +20875,9 @@ }, "node_modules/netlify-cli/node_modules/mixin-deep": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, - "license": "MIT", "dependencies": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" @@ -17082,8 +20888,9 @@ }, "node_modules/netlify-cli/node_modules/mkdirp": { "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.6" }, @@ -17093,13 +20900,15 @@ }, "node_modules/netlify-cli/node_modules/mkdirp-classic": { "version": "0.5.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true }, "node_modules/netlify-cli/node_modules/mlly": { "version": "1.4.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", + "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", "dev": true, - "license": "MIT", "dependencies": { "acorn": "^8.10.0", "pathe": "^1.1.1", @@ -17109,8 +20918,9 @@ }, "node_modules/netlify-cli/node_modules/module-definition": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-5.0.1.tgz", + "integrity": "sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==", "dev": true, - "license": "MIT", "dependencies": { "ast-module-types": "^5.0.0", "node-source-walk": "^6.0.1" @@ -17124,13 +20934,15 @@ }, "node_modules/netlify-cli/node_modules/module-details-from-path": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", + "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", + "dev": true }, "node_modules/netlify-cli/node_modules/moize": { "version": "6.1.3", + "resolved": "https://registry.npmjs.org/moize/-/moize-6.1.3.tgz", + "integrity": "sha512-Cn+1T5Ypieeo46fn8X98V2gHj2VSRohVPjvT8BRvNANJJC3UOeege/G84xA/3S9c5qA4p9jOdSB1jfhumwe8qw==", "dev": true, - "license": "MIT", "dependencies": { "fast-equals": "^3.0.1", "micro-memoize": "^4.0.11" @@ -17138,8 +20950,9 @@ }, "node_modules/netlify-cli/node_modules/move-file": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/move-file/-/move-file-3.0.0.tgz", + "integrity": "sha512-v6u4XjX3MFW6Jo1V/YfbhC7eiGSgvYPJ/NM+aGtTtB9/Y6IYj7YViaHu6dkgDsZFB7MbnAoSI5+Z26XZXnP0vg==", "dev": true, - "license": "MIT", "dependencies": { "path-exists": "^5.0.0" }, @@ -17152,29 +20965,33 @@ }, "node_modules/netlify-cli/node_modules/move-file/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/mri": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/ms": { "version": "2.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/netlify-cli/node_modules/multiparty": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.2.3.tgz", + "integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==", "dev": true, - "license": "MIT", "dependencies": { "http-errors": "~1.8.1", "safe-buffer": "5.2.1", @@ -17186,6 +21003,8 @@ }, "node_modules/netlify-cli/node_modules/multiparty/node_modules/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==", "dev": true, "funding": [ { @@ -17200,22 +21019,25 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/mute-stream": { "version": "0.0.7", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/nan": { "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", "dev": true, - "license": "MIT", "optional": true }, "node_modules/netlify-cli/node_modules/nanoid": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, "funding": [ { @@ -17223,7 +21045,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -17233,8 +21054,9 @@ }, "node_modules/netlify-cli/node_modules/nanomatch": { "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, - "license": "MIT", "dependencies": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -17254,26 +21076,30 @@ }, "node_modules/netlify-cli/node_modules/napi-build-utils": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true }, "node_modules/netlify-cli/node_modules/negotiator": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/nested-error-stacks": { "version": "2.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { "version": "13.1.11", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.11.tgz", + "integrity": "sha512-exrD6cqwo5avDNtU7YT9iuN0+yoW+aaEUxvr/39oP36wZRKreoPm6KNVisTR9d4lXrPeUG8XI+rERuLhwMQmdw==", "dev": true, - "license": "MIT", "dependencies": { "@netlify/open-api": "^2.26.0", "lodash-es": "^4.17.21", @@ -17289,8 +21115,9 @@ }, "node_modules/netlify-cli/node_modules/netlify-headers-parser": { "version": "7.1.2", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.2.tgz", + "integrity": "sha512-DfoboA8PrcLXMan3jIVyLsQtKS+nepKDx6WwZKk5EQDMr2AJoBPCtSHTOLuABzkde1UXdOITf3snmcAmzlNLqw==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0", "fast-safe-stringify": "^2.0.7", @@ -17305,8 +21132,9 @@ }, "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -17316,8 +21144,9 @@ }, "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/map-obj": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -17327,16 +21156,18 @@ }, "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/netlify-redirect-parser": { "version": "14.2.0", + "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.0.tgz", + "integrity": "sha512-3Mi7sMH7XXZhjvXx/5RtJ/rU/E6zKkE4etcYQbEu8B3r872D0opoYyGdPW/MvaYQyVdfg23XEFaEI4zzQTupaw==", "dev": true, - "license": "MIT", "dependencies": { "fast-safe-stringify": "^2.1.1", "filter-obj": "^5.0.0", @@ -17350,21 +21181,24 @@ }, "node_modules/netlify-cli/node_modules/netlify-redirect-parser/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/netlify-redirector": { "version": "0.5.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.5.0.tgz", + "integrity": "sha512-4zdzIP+6muqPCuE8avnrgDJ6KW/2+UpHTRcTbMXCIRxiRmyrX+IZ4WSJGZdHPWF3WmQpXpy603XxecZ9iygN7w==", + "dev": true }, "node_modules/netlify-cli/node_modules/netlify/node_modules/node-fetch": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, - "license": "MIT", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -17380,8 +21214,9 @@ }, "node_modules/netlify-cli/node_modules/netlify/node_modules/p-timeout": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -17391,8 +21226,9 @@ }, "node_modules/netlify-cli/node_modules/netlify/node_modules/p-wait-for": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", "dev": true, - "license": "MIT", "dependencies": { "p-timeout": "^5.0.0" }, @@ -17405,8 +21241,9 @@ }, "node_modules/netlify-cli/node_modules/node-abi": { "version": "3.51.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", + "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.3.5" }, @@ -17416,11 +21253,14 @@ }, "node_modules/netlify-cli/node_modules/node-addon-api": { "version": "7.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", + "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", + "dev": true }, "node_modules/netlify-cli/node_modules/node-domexception": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", "dev": true, "funding": [ { @@ -17432,15 +21272,15 @@ "url": "https://paypal.me/jimmywarting" } ], - "license": "MIT", "engines": { "node": ">=10.5.0" } }, "node_modules/netlify-cli/node_modules/node-fetch": { "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -17458,21 +21298,24 @@ }, "node_modules/netlify-cli/node_modules/node-fetch-native": { "version": "1.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.4.1.tgz", + "integrity": "sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==", + "dev": true }, "node_modules/netlify-cli/node_modules/node-forge": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", "dev": true, - "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.13.0" } }, "node_modules/netlify-cli/node_modules/node-gyp-build": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", "dev": true, - "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -17481,13 +21324,15 @@ }, "node_modules/netlify-cli/node_modules/node-int64": { "version": "0.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true }, "node_modules/netlify-cli/node_modules/node-source-walk": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.1.tgz", + "integrity": "sha512-QUlkJYzrNewUCp4c7CCPN8Mh8c+pwNs23JsQfHKUwIkCxYa6c0AFLuUJIZxU6BdnarfytPSGKm1YMAz06hj9cw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/parser": "^7.21.8" }, @@ -17497,8 +21342,9 @@ }, "node_modules/netlify-cli/node_modules/node-stream-zip": { "version": "1.15.0", + "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", + "integrity": "sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.12.0" }, @@ -17509,8 +21355,9 @@ }, "node_modules/netlify-cli/node_modules/node-version-alias": { "version": "3.4.1", + "resolved": "https://registry.npmjs.org/node-version-alias/-/node-version-alias-3.4.1.tgz", + "integrity": "sha512-Kf3L9spAL6lEHMPyqpwHSTNG3LPkOXBfSUnBMG/YE2TdoC8Qoqf0+qg01nr6K9MFQEcXtWUyTQzLJByRixSBsA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "all-node-versions": "^11.3.0", "filter-obj": "^5.1.0", @@ -17525,21 +21372,24 @@ }, "node_modules/netlify-cli/node_modules/node-version-alias/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/noop2": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/noop2/-/noop2-2.0.0.tgz", + "integrity": "sha1-S2NgFemIK1R4PAK0EvaZ2MXNCls=", + "dev": true }, "node_modules/netlify-cli/node_modules/nopt": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, - "license": "ISC", "dependencies": { "abbrev": "1" }, @@ -17552,8 +21402,9 @@ }, "node_modules/netlify-cli/node_modules/normalize-node-version": { "version": "12.4.0", + "resolved": "https://registry.npmjs.org/normalize-node-version/-/normalize-node-version-12.4.0.tgz", + "integrity": "sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "all-node-versions": "^11.3.0", "filter-obj": "^5.1.0", @@ -17565,8 +21416,9 @@ }, "node_modules/netlify-cli/node_modules/normalize-package-data": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -17579,16 +21431,18 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/npm-run-path": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -17598,16 +21452,18 @@ }, "node_modules/netlify-cli/node_modules/npm-run-path/node_modules/path-key": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/npmlog": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", "dev": true, - "license": "ISC", "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -17617,8 +21473,9 @@ }, "node_modules/netlify-cli/node_modules/nth-check": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0" }, @@ -17628,16 +21485,18 @@ }, "node_modules/netlify-cli/node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/object-copy": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, - "license": "MIT", "dependencies": { "copy-descriptor": "^0.1.0", "define-property": "^0.2.5", @@ -17649,8 +21508,9 @@ }, "node_modules/netlify-cli/node_modules/object-copy/node_modules/define-property": { "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -17660,8 +21520,9 @@ }, "node_modules/netlify-cli/node_modules/object-copy/node_modules/is-descriptor": { "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", "dev": true, - "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -17672,8 +21533,9 @@ }, "node_modules/netlify-cli/node_modules/object-copy/node_modules/kind-of": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, - "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -17683,16 +21545,18 @@ }, "node_modules/netlify-cli/node_modules/object-inspect": { "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/netlify-cli/node_modules/object-visit": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, - "license": "MIT", "dependencies": { "isobject": "^3.0.0" }, @@ -17702,8 +21566,9 @@ }, "node_modules/netlify-cli/node_modules/object.pick": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, - "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -17713,8 +21578,9 @@ }, "node_modules/netlify-cli/node_modules/ofetch": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", + "integrity": "sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==", "dev": true, - "license": "MIT", "dependencies": { "destr": "^2.0.1", "node-fetch-native": "^1.4.0", @@ -17723,21 +21589,24 @@ }, "node_modules/netlify-cli/node_modules/omit.js": { "version": "2.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-2.0.2.tgz", + "integrity": "sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==", + "dev": true }, "node_modules/netlify-cli/node_modules/on-exit-leak-free": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/netlify-cli/node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, - "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -17747,32 +21616,36 @@ }, "node_modules/netlify-cli/node_modules/on-headers": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/netlify-cli/node_modules/one-time": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "dev": true, - "license": "MIT", "dependencies": { "fn.name": "1.x.x" } }, "node_modules/netlify-cli/node_modules/onetime": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -17785,16 +21658,18 @@ }, "node_modules/netlify-cli/node_modules/onetime/node_modules/mimic-fn": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/open": { "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, - "license": "MIT", "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", @@ -17809,8 +21684,9 @@ }, "node_modules/netlify-cli/node_modules/open/node_modules/is-docker": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, - "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -17823,16 +21699,18 @@ }, "node_modules/netlify-cli/node_modules/opentracing": { "version": "0.14.7", + "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.7.tgz", + "integrity": "sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=0.10" } }, "node_modules/netlify-cli/node_modules/ora": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", + "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^5.0.0", "cli-cursor": "^4.0.0", @@ -17853,8 +21731,9 @@ }, "node_modules/netlify-cli/node_modules/ora/node_modules/cli-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, - "license": "MIT", "dependencies": { "restore-cursor": "^4.0.0" }, @@ -17867,8 +21746,9 @@ }, "node_modules/netlify-cli/node_modules/ora/node_modules/restore-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, - "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -17882,8 +21762,9 @@ }, "node_modules/netlify-cli/node_modules/os-name": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", + "integrity": "sha512-0EQpaHUHq7olp2/YFUr+0vZi9tMpDTblHGz+Ch5RntKxiRXOAY0JOz1UlxhSjMSksHvkm13eD6elJj3M8Ht/kw==", "dev": true, - "license": "MIT", "dependencies": { "macos-release": "^3.0.1", "windows-release": "^5.0.1" @@ -17897,16 +21778,18 @@ }, "node_modules/netlify-cli/node_modules/os-tmpdir": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/p-event": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", "dev": true, - "license": "MIT", "dependencies": { "p-timeout": "^5.0.2" }, @@ -17919,8 +21802,9 @@ }, "node_modules/netlify-cli/node_modules/p-event/node_modules/p-timeout": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -17930,8 +21814,9 @@ }, "node_modules/netlify-cli/node_modules/p-every": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-every/-/p-every-2.0.0.tgz", + "integrity": "sha512-MCz9DqD5opPC48Zsd+BHm56O/HfhYIQQtupfDzhXoVgQdg/Ux4F8/JcdRuQ+arq7zD5fB6zP3axbH3d9Nr8dlw==", "dev": true, - "license": "MIT", "dependencies": { "p-map": "^2.0.0" }, @@ -17941,16 +21826,18 @@ }, "node_modules/netlify-cli/node_modules/p-every/node_modules/p-map": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/p-filter": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", "dev": true, - "license": "MIT", "dependencies": { "p-map": "^5.1.0" }, @@ -17963,16 +21850,18 @@ }, "node_modules/netlify-cli/node_modules/p-finally": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/p-limit": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -17985,8 +21874,9 @@ }, "node_modules/netlify-cli/node_modules/p-map": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", "dev": true, - "license": "MIT", "dependencies": { "aggregate-error": "^4.0.0" }, @@ -17999,8 +21889,9 @@ }, "node_modules/netlify-cli/node_modules/p-reduce": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -18010,8 +21901,9 @@ }, "node_modules/netlify-cli/node_modules/p-retry": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", "dev": true, - "license": "MIT", "dependencies": { "@types/retry": "0.12.1", "retry": "^0.13.1" @@ -18025,8 +21917,9 @@ }, "node_modules/netlify-cli/node_modules/p-wait-for": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-5.0.2.tgz", + "integrity": "sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==", "dev": true, - "license": "MIT", "dependencies": { "p-timeout": "^6.0.0" }, @@ -18039,8 +21932,9 @@ }, "node_modules/netlify-cli/node_modules/p-wait-for/node_modules/p-timeout": { "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -18050,8 +21944,9 @@ }, "node_modules/netlify-cli/node_modules/package-json": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", + "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", "dev": true, - "license": "MIT", "dependencies": { "got": "^12.1.0", "registry-auth-token": "^5.0.1", @@ -18067,8 +21962,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/@sindresorhus/is": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -18078,8 +21974,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/@szmarczak/http-timer": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", "dev": true, - "license": "MIT", "dependencies": { "defer-to-connect": "^2.0.1" }, @@ -18089,16 +21986,18 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-lookup": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" } }, "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-request": { "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/http-cache-semantics": "^4.0.2", "get-stream": "^6.0.1", @@ -18114,8 +22013,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/got": { "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, - "license": "MIT", "dependencies": { "@sindresorhus/is": "^5.2.0", "@szmarczak/http-timer": "^5.0.1", @@ -18138,8 +22038,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/http2-wrapper": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", "dev": true, - "license": "MIT", "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" @@ -18150,8 +22051,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/lowercase-keys": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -18161,8 +22063,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/mimic-response": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -18172,8 +22075,9 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/normalize-url": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -18183,16 +22087,18 @@ }, "node_modules/netlify-cli/node_modules/package-json/node_modules/p-cancelable": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20" } }, "node_modules/netlify-cli/node_modules/package-json/node_modules/responselike": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, - "license": "MIT", "dependencies": { "lowercase-keys": "^3.0.0" }, @@ -18205,8 +22111,9 @@ }, "node_modules/netlify-cli/node_modules/parallel-transform": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", "dev": true, - "license": "MIT", "dependencies": { "cyclist": "^1.0.1", "inherits": "^2.0.3", @@ -18215,8 +22122,9 @@ }, "node_modules/netlify-cli/node_modules/parallel-transform/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -18229,8 +22137,9 @@ }, "node_modules/netlify-cli/node_modules/parse-github-url": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", "dev": true, - "license": "MIT", "bin": { "parse-github-url": "cli.js" }, @@ -18240,16 +22149,18 @@ }, "node_modules/netlify-cli/node_modules/parse-gitignore": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-gitignore/-/parse-gitignore-2.0.0.tgz", + "integrity": "sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==", "dev": true, - "license": "MIT", "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/parse-json": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -18265,8 +22176,9 @@ }, "node_modules/netlify-cli/node_modules/parse-ms": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", + "integrity": "sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -18276,32 +22188,36 @@ }, "node_modules/netlify-cli/node_modules/parseurl": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/pascalcase": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/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=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -18311,31 +22227,36 @@ }, "node_modules/netlify-cli/node_modules/path-parse": { "version": "1.0.7", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/netlify-cli/node_modules/path-to-regexp": { "version": "0.1.7", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/path-type": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/pathe": { "version": "1.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/peek-readable": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -18346,18 +22267,21 @@ }, "node_modules/netlify-cli/node_modules/pend": { "version": "1.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true }, "node_modules/netlify-cli/node_modules/picocolors": { "version": "1.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/picomatch": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, @@ -18367,8 +22291,9 @@ }, "node_modules/netlify-cli/node_modules/pkg-types": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", "dev": true, - "license": "MIT", "dependencies": { "jsonc-parser": "^3.2.0", "mlly": "^1.2.0", @@ -18377,14 +22302,17 @@ }, "node_modules/netlify-cli/node_modules/posix-character-classes": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/postcss": { "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -18400,7 +22328,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", @@ -18412,8 +22339,9 @@ }, "node_modules/netlify-cli/node_modules/postcss-values-parser": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", + "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", "dev": true, - "license": "MPL-2.0", "dependencies": { "color-name": "^1.1.4", "is-url-superb": "^4.0.0", @@ -18428,13 +22356,15 @@ }, "node_modules/netlify-cli/node_modules/postcss-values-parser/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/prebuild-install": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", "dev": true, - "license": "MIT", "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", @@ -18458,13 +22388,15 @@ }, "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/chownr": { "version": "1.1.4", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true }, "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/tar-fs": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", "dev": true, - "license": "MIT", "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", @@ -18474,8 +22406,9 @@ }, "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/tar-stream": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dev": true, - "license": "MIT", "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -18489,8 +22422,9 @@ }, "node_modules/netlify-cli/node_modules/precinct": { "version": "11.0.2", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.2.tgz", + "integrity": "sha512-UuhB1q0nEFf80iMGcs7IoT0o1GnNFWT4CjZjcMsHDXAIsW/aiLovOSbeMJ2Ejg6raRsplsriZZkoBUh0h/IHlw==", "dev": true, - "license": "MIT", "dependencies": { "@dependents/detective-less": "^4.0.0", "commander": "^10.0.1", @@ -18514,6 +22448,8 @@ }, "node_modules/netlify-cli/node_modules/precond": { "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=", "dev": true, "engines": { "node": ">= 0.6" @@ -18521,8 +22457,9 @@ }, "node_modules/netlify-cli/node_modules/pretty-format": { "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -18534,8 +22471,9 @@ }, "node_modules/netlify-cli/node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -18545,8 +22483,9 @@ }, "node_modules/netlify-cli/node_modules/pretty-ms": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-8.0.0.tgz", + "integrity": "sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==", "dev": true, - "license": "MIT", "dependencies": { "parse-ms": "^3.0.0" }, @@ -18559,8 +22498,9 @@ }, "node_modules/netlify-cli/node_modules/prettyjson": { "version": "1.2.5", + "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.5.tgz", + "integrity": "sha512-rksPWtoZb2ZpT5OVgtmy0KHVM+Dca3iVwWY9ifwhcexfjebtgjg3wmrUt9PvJ59XIYBcknQeYHD8IAnVlh9lAw==", "dev": true, - "license": "MIT", "dependencies": { "colors": "1.4.0", "minimist": "^1.2.0" @@ -18571,27 +22511,31 @@ }, "node_modules/netlify-cli/node_modules/process": { "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6.0" } }, "node_modules/netlify-cli/node_modules/process-nextick-args": { "version": "2.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "node_modules/netlify-cli/node_modules/proto-list": { "version": "1.2.4", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true }, "node_modules/netlify-cli/node_modules/protobufjs": { "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", "dev": true, "hasInstallScript": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -18612,8 +22556,9 @@ }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -18624,13 +22569,15 @@ }, "node_modules/netlify-cli/node_modules/proxy-from-env": { "version": "1.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true }, "node_modules/netlify-cli/node_modules/ps-list": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-8.1.0.tgz", + "integrity": "sha512-NoGBqJe7Ou3kfQxEvDzDyKGAyEgwIuD3YrfXinjcCmBRv0hTld0Xb71hrXvtsNPj7HSFATfemvzB8PPJtq6Yag==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -18640,8 +22587,9 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -18649,16 +22597,18 @@ }, "node_modules/netlify-cli/node_modules/punycode": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/pupa": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", + "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", "dev": true, - "license": "MIT", "dependencies": { "escape-goat": "^4.0.0" }, @@ -18671,8 +22621,9 @@ }, "node_modules/netlify-cli/node_modules/qs": { "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.4" }, @@ -18685,6 +22636,8 @@ }, "node_modules/netlify-cli/node_modules/queue-microtask": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -18699,23 +22652,25 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/queue-tick": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true }, "node_modules/netlify-cli/node_modules/quick-format-unescaped": { "version": "4.0.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "dev": true }, "node_modules/netlify-cli/node_modules/quick-lru": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -18725,34 +22680,39 @@ }, "node_modules/netlify-cli/node_modules/quote-unquote": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", + "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", + "dev": true }, "node_modules/netlify-cli/node_modules/radix3": { "version": "1.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.0.tgz", + "integrity": "sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==", + "dev": true }, "node_modules/netlify-cli/node_modules/random-bytes": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/netlify-cli/node_modules/raw-body": { "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, - "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -18765,16 +22725,18 @@ }, "node_modules/netlify-cli/node_modules/raw-body/node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/raw-body/node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, - "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -18788,8 +22750,9 @@ }, "node_modules/netlify-cli/node_modules/rc": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -18802,26 +22765,30 @@ }, "node_modules/netlify-cli/node_modules/rc/node_modules/ini": { "version": "1.3.8", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/netlify-cli/node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/react-is": { "version": "17.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true }, "node_modules/netlify-cli/node_modules/read-pkg-up": { "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", "dev": true, - "license": "MIT", "dependencies": { "find-up": "^6.3.0", "read-pkg": "^7.1.0", @@ -18836,8 +22803,9 @@ }, "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/read-pkg": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", "dev": true, - "license": "MIT", "dependencies": { "@types/normalize-package-data": "^2.4.1", "normalize-package-data": "^3.0.2", @@ -18853,8 +22821,9 @@ }, "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/type-fest": { "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" }, @@ -18864,8 +22833,9 @@ }, "node_modules/netlify-cli/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -18877,8 +22847,9 @@ }, "node_modules/netlify-cli/node_modules/readable-web-to-node-stream": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", "dev": true, - "license": "MIT", "dependencies": { "readable-stream": "^3.6.0" }, @@ -18892,24 +22863,27 @@ }, "node_modules/netlify-cli/node_modules/readdir-glob": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "minimatch": "^5.1.0" } }, "node_modules/netlify-cli/node_modules/readdir-glob/node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/netlify-cli/node_modules/readdir-glob/node_modules/minimatch": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -18919,8 +22893,9 @@ }, "node_modules/netlify-cli/node_modules/readdirp": { "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -18930,24 +22905,27 @@ }, "node_modules/netlify-cli/node_modules/real-require": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 12.13.0" } }, "node_modules/netlify-cli/node_modules/redis-errors": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/redis-parser": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", "dev": true, - "license": "MIT", "dependencies": { "redis-errors": "^1.0.0" }, @@ -18957,8 +22935,9 @@ }, "node_modules/netlify-cli/node_modules/regex-not": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, - "license": "MIT", "dependencies": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" @@ -18969,24 +22948,27 @@ }, "node_modules/netlify-cli/node_modules/regex-not/node_modules/safe-regex": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", "dev": true, - "license": "MIT", "dependencies": { "ret": "~0.1.10" } }, "node_modules/netlify-cli/node_modules/regexp-tree": { "version": "0.1.24", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz", + "integrity": "sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==", "dev": true, - "license": "MIT", "bin": { "regexp-tree": "bin/regexp-tree" } }, "node_modules/netlify-cli/node_modules/registry-auth-token": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", "dev": true, - "license": "MIT", "dependencies": { "@pnpm/npm-conf": "^2.1.0" }, @@ -18996,8 +22978,9 @@ }, "node_modules/netlify-cli/node_modules/registry-url": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", "dev": true, - "license": "MIT", "dependencies": { "rc": "1.2.8" }, @@ -19010,45 +22993,51 @@ }, "node_modules/netlify-cli/node_modules/remove-trailing-separator": { "version": "1.1.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true }, "node_modules/netlify-cli/node_modules/repeat-element": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/repeat-string": { "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10" } }, "node_modules/netlify-cli/node_modules/require-directory": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/require-in-the-middle": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", + "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^4.1.1", "module-details-from-path": "^1.0.3", @@ -19060,8 +23049,9 @@ }, "node_modules/netlify-cli/node_modules/require-in-the-middle/node_modules/resolve": { "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, - "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -19076,18 +23066,21 @@ }, "node_modules/netlify-cli/node_modules/require-package-name": { "version": "2.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", + "integrity": "sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk=", + "dev": true }, "node_modules/netlify-cli/node_modules/requires-port": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true }, "node_modules/netlify-cli/node_modules/resolve": { "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", "dev": true, - "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -19102,26 +23095,31 @@ }, "node_modules/netlify-cli/node_modules/resolve-alpn": { "version": "1.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true }, "node_modules/netlify-cli/node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/resolve-url": { "version": "0.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true }, "node_modules/netlify-cli/node_modules/restore-cursor": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", "dev": true, - "license": "MIT", "dependencies": { "onetime": "^2.0.0", "signal-exit": "^3.0.2" @@ -19132,16 +23130,18 @@ }, "node_modules/netlify-cli/node_modules/restore-cursor/node_modules/mimic-fn": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/restore-cursor/node_modules/onetime": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^1.0.0" }, @@ -19151,24 +23151,27 @@ }, "node_modules/netlify-cli/node_modules/ret": { "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.12" } }, "node_modules/netlify-cli/node_modules/retry": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/netlify-cli/node_modules/reusify": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, - "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -19176,13 +23179,15 @@ }, "node_modules/netlify-cli/node_modules/rfdc": { "version": "1.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "dev": true }, "node_modules/netlify-cli/node_modules/rimraf": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, - "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -19195,14 +23200,17 @@ }, "node_modules/netlify-cli/node_modules/run-async": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/netlify-cli/node_modules/run-parallel": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { @@ -19218,15 +23226,15 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/netlify-cli/node_modules/rxjs": { "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "tslib": "^1.9.0" }, @@ -19236,52 +23244,60 @@ }, "node_modules/netlify-cli/node_modules/safe-buffer": { "version": "5.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "node_modules/netlify-cli/node_modules/safe-json-stringify": { "version": "1.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "dev": true }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "ret": "~0.2.0" } }, "node_modules/netlify-cli/node_modules/safe-regex2/node_modules/ret": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", + "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/safe-stable-stringify": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", + "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/netlify-cli/node_modules/safer-buffer": { "version": "2.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "node_modules/netlify-cli/node_modules/secure-json-parse": { "version": "2.6.0", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.6.0.tgz", + "integrity": "sha512-B9osKohb6L+EZ6Kve3wHKfsAClzOC/iISA2vSuCe5Jx5NAKiwitfxx8ZKYapHXr0sYRj7UZInT7pLb3rp2Yx6A==", + "dev": true }, "node_modules/netlify-cli/node_modules/seek-bzip": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", + "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", "dev": true, - "license": "MIT", "dependencies": { "commander": "^2.8.1" }, @@ -19292,13 +23308,15 @@ }, "node_modules/netlify-cli/node_modules/seek-bzip/node_modules/commander": { "version": "2.20.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/semver": { "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -19311,8 +23329,9 @@ }, "node_modules/netlify-cli/node_modules/semver-diff": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.3.5" }, @@ -19325,8 +23344,9 @@ }, "node_modules/netlify-cli/node_modules/send": { "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dev": true, - "license": "MIT", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -19348,29 +23368,33 @@ }, "node_modules/netlify-cli/node_modules/send/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/netlify-cli/node_modules/send/node_modules/debug/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/netlify-cli/node_modules/send/node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/send/node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, - "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -19384,8 +23408,9 @@ }, "node_modules/netlify-cli/node_modules/serve-static": { "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dev": true, - "license": "MIT", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -19398,18 +23423,21 @@ }, "node_modules/netlify-cli/node_modules/set-blocking": { "version": "2.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true }, "node_modules/netlify-cli/node_modules/set-cookie-parser": { "version": "2.5.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz", + "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/set-value": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, - "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", @@ -19422,8 +23450,9 @@ }, "node_modules/netlify-cli/node_modules/set-value/node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -19433,16 +23462,18 @@ }, "node_modules/netlify-cli/node_modules/set-value/node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/set-value/node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, - "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -19452,14 +23483,16 @@ }, "node_modules/netlify-cli/node_modules/setprototypeof": { "version": "1.2.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true }, "node_modules/netlify-cli/node_modules/sharp": { "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", "dev": true, "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.2", @@ -19479,8 +23512,9 @@ }, "node_modules/netlify-cli/node_modules/sharp/node_modules/color": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" @@ -19491,8 +23525,9 @@ }, "node_modules/netlify-cli/node_modules/sharp/node_modules/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, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -19502,18 +23537,21 @@ }, "node_modules/netlify-cli/node_modules/sharp/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/sharp/node_modules/node-addon-api": { "version": "6.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "dev": true }, "node_modules/netlify-cli/node_modules/shebang-command": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -19523,21 +23561,24 @@ }, "node_modules/netlify-cli/node_modules/shebang-regex": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/shimmer": { "version": "1.2.1", - "dev": true, - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", + "dev": true }, "node_modules/netlify-cli/node_modules/side-channel": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -19549,11 +23590,14 @@ }, "node_modules/netlify-cli/node_modules/signal-exit": { "version": "3.0.7", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/simple-concat": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true, "funding": [ { @@ -19568,11 +23612,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/netlify-cli/node_modules/simple-get": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", "dev": true, "funding": [ { @@ -19588,7 +23633,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", @@ -19597,29 +23641,33 @@ }, "node_modules/netlify-cli/node_modules/simple-swizzle": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" } }, "node_modules/netlify-cli/node_modules/simple-swizzle/node_modules/is-arrayish": { "version": "0.3.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/slash": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/slice-ansi": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" @@ -19633,8 +23681,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon": { "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, - "license": "MIT", "dependencies": { "base": "^0.11.1", "debug": "^2.2.0", @@ -19651,8 +23700,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon-node": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, - "license": "MIT", "dependencies": { "define-property": "^1.0.0", "isobject": "^3.0.0", @@ -19664,8 +23714,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon-node/node_modules/define-property": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^1.0.0" }, @@ -19675,8 +23726,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon-util": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, - "license": "MIT", "dependencies": { "kind-of": "^3.2.0" }, @@ -19686,8 +23738,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon-util/node_modules/kind-of": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, - "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -19697,16 +23750,18 @@ }, "node_modules/netlify-cli/node_modules/snapdragon/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.0.0" } }, "node_modules/netlify-cli/node_modules/snapdragon/node_modules/define-property": { "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -19716,8 +23771,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon/node_modules/extend-shallow": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, - "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -19727,8 +23783,9 @@ }, "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-descriptor": { "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", "dev": true, - "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -19739,21 +23796,24 @@ }, "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/snapdragon/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true }, "node_modules/netlify-cli/node_modules/sort-keys": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==", "dev": true, - "license": "MIT", "dependencies": { "is-plain-obj": "^1.0.0" }, @@ -19763,8 +23823,9 @@ }, "node_modules/netlify-cli/node_modules/sort-keys-length": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz", + "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", "dev": true, - "license": "MIT", "dependencies": { "sort-keys": "^1.0.0" }, @@ -19774,32 +23835,37 @@ }, "node_modules/netlify-cli/node_modules/sort-keys/node_modules/is-plain-obj": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/source-map": { "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/source-map-js": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/source-map-resolve": { "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", "dev": true, - "license": "MIT", "dependencies": { "atob": "^2.1.2", "decode-uri-component": "^0.2.0", @@ -19810,8 +23876,9 @@ }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -19819,21 +23886,25 @@ }, "node_modules/netlify-cli/node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/source-map-url": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "dev": true }, "node_modules/netlify-cli/node_modules/spdx-correct": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, - "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -19841,13 +23912,15 @@ }, "node_modules/netlify-cli/node_modules/spdx-exceptions": { "version": "2.3.0", - "dev": true, - "license": "CC-BY-3.0" + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true }, "node_modules/netlify-cli/node_modules/spdx-expression-parse": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, - "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -19855,13 +23928,15 @@ }, "node_modules/netlify-cli/node_modules/spdx-license-ids": { "version": "3.0.11", - "dev": true, - "license": "CC0-1.0" + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "dev": true }, "node_modules/netlify-cli/node_modules/split-string": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, - "license": "MIT", "dependencies": { "extend-shallow": "^3.0.0" }, @@ -19871,34 +23946,39 @@ }, "node_modules/netlify-cli/node_modules/stack-generator": { "version": "2.0.10", + "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", + "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", "dev": true, - "license": "MIT", "dependencies": { "stackframe": "^1.3.4" } }, "node_modules/netlify-cli/node_modules/stack-trace": { "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true, - "license": "MIT", "engines": { "node": "*" } }, "node_modules/netlify-cli/node_modules/stackframe": { "version": "1.3.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "dev": true }, "node_modules/netlify-cli/node_modules/standard-as-callback": { "version": "2.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", + "dev": true }, "node_modules/netlify-cli/node_modules/static-extend": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, - "license": "MIT", "dependencies": { "define-property": "^0.2.5", "object-copy": "^0.1.0" @@ -19909,8 +23989,9 @@ }, "node_modules/netlify-cli/node_modules/static-extend/node_modules/define-property": { "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, - "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -19920,8 +24001,9 @@ }, "node_modules/netlify-cli/node_modules/static-extend/node_modules/is-descriptor": { "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", "dev": true, - "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -19932,21 +24014,24 @@ }, "node_modules/netlify-cli/node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/std-env": { "version": "3.4.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", + "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/stdin-discarder": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", "dev": true, - "license": "MIT", "dependencies": { "bl": "^5.0.0" }, @@ -19959,8 +24044,9 @@ }, "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/bl": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "dev": true, - "license": "MIT", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -19969,6 +24055,8 @@ }, "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, "funding": [ { @@ -19984,7 +24072,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -19992,8 +24079,9 @@ }, "node_modules/netlify-cli/node_modules/streamx": { "version": "2.15.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", + "integrity": "sha512-HcxY6ncGjjklGs1xsP1aR71INYcsXFJet5CU1CHqihQ2J5nOsbd4OjgjHO42w/4QNv9gZb3BueV+Vxok5pLEXg==", "dev": true, - "license": "MIT", "dependencies": { "fast-fifo": "^1.1.0", "queue-tick": "^1.0.1" @@ -20001,20 +24089,24 @@ }, "node_modules/netlify-cli/node_modules/string_decoder": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/netlify-cli/node_modules/string-template": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==", "dev": true }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -20026,16 +24118,18 @@ }, "node_modules/netlify-cli/node_modules/string-width/node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/string-width/node_modules/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, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -20045,8 +24139,9 @@ }, "node_modules/netlify-cli/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -20059,13 +24154,15 @@ }, "node_modules/netlify-cli/node_modules/strip-ansi-control-characters": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/strip-ansi-control-characters/-/strip-ansi-control-characters-2.0.0.tgz", + "integrity": "sha512-Q0/k5orrVGeaOlIOUn1gybGU0IcAbgHQT1faLo5hik4DqClKVSaka5xOhNNoRgtfztHVxCYxi7j71mrWom0bIw==", + "dev": true }, "node_modules/netlify-cli/node_modules/strip-ansi/node_modules/ansi-regex": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -20075,8 +24172,9 @@ }, "node_modules/netlify-cli/node_modules/strip-dirs": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-3.0.0.tgz", + "integrity": "sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ==", "dev": true, - "license": "ISC", "dependencies": { "inspect-with-kind": "^1.0.5", "is-plain-obj": "^1.1.0" @@ -20084,24 +24182,27 @@ }, "node_modules/netlify-cli/node_modules/strip-dirs/node_modules/is-plain-obj": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/strip-final-newline": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/strtok3": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", "dev": true, - "license": "MIT", "dependencies": { "@tokenizer/token": "^0.3.0", "peek-readable": "^5.0.0" @@ -20116,8 +24217,9 @@ }, "node_modules/netlify-cli/node_modules/supports-color": { "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -20127,8 +24229,9 @@ }, "node_modules/netlify-cli/node_modules/supports-hyperlinks": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" @@ -20139,8 +24242,9 @@ }, "node_modules/netlify-cli/node_modules/supports-hyperlinks/node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -20150,8 +24254,9 @@ }, "node_modules/netlify-cli/node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -20161,8 +24266,9 @@ }, "node_modules/netlify-cli/node_modules/svgo": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", "dev": true, - "license": "MIT", "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", @@ -20184,16 +24290,18 @@ }, "node_modules/netlify-cli/node_modules/svgo/node_modules/commander": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 10" } }, "node_modules/netlify-cli/node_modules/tabtab": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-3.0.2.tgz", + "integrity": "sha512-jANKmUe0sIQc/zTALTBy186PoM/k6aPrh3A7p6AaAfF6WPSbTx1JYeGIGH162btpH+mmVEXln+UxwViZHO2Jhg==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^4.0.1", "es6-promisify": "^6.0.0", @@ -20205,8 +24313,9 @@ }, "node_modules/netlify-cli/node_modules/tar": { "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", "dev": true, - "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -20221,8 +24330,9 @@ }, "node_modules/netlify-cli/node_modules/tar-fs": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", "dev": true, - "license": "MIT", "dependencies": { "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", @@ -20231,8 +24341,9 @@ }, "node_modules/netlify-cli/node_modules/tar-stream": { "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", "dev": true, - "license": "MIT", "dependencies": { "b4a": "^1.6.4", "fast-fifo": "^1.2.0", @@ -20241,8 +24352,9 @@ }, "node_modules/netlify-cli/node_modules/tar/node_modules/mkdirp": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, - "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -20252,16 +24364,18 @@ }, "node_modules/netlify-cli/node_modules/temp-dir": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/netlify-cli/node_modules/tempy": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", + "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", "dev": true, - "license": "MIT", "dependencies": { "is-stream": "^3.0.0", "temp-dir": "^2.0.0", @@ -20277,8 +24391,9 @@ }, "node_modules/netlify-cli/node_modules/tempy/node_modules/type-fest": { "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" }, @@ -20288,8 +24403,9 @@ }, "node_modules/netlify-cli/node_modules/terminal-link": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-3.0.0.tgz", + "integrity": "sha512-flFL3m4wuixmf6IfhFJd1YPiLiMuxEc8uHRM1buzIeZPm22Au2pDqBJQgdo7n1WfPU1ONFGv7YDwpFBmHGF6lg==", "dev": true, - "license": "MIT", "dependencies": { "ansi-escapes": "^5.0.0", "supports-hyperlinks": "^2.2.0" @@ -20303,8 +24419,9 @@ }, "node_modules/netlify-cli/node_modules/terminal-link/node_modules/ansi-escapes": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^1.0.2" }, @@ -20317,8 +24434,9 @@ }, "node_modules/netlify-cli/node_modules/terminal-link/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -20328,19 +24446,23 @@ }, "node_modules/netlify-cli/node_modules/text-hex": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true }, "node_modules/netlify-cli/node_modules/thread-stream": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", + "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", "dev": true, - "license": "MIT", "dependencies": { "real-require": "^0.2.0" } }, "node_modules/netlify-cli/node_modules/thriftrw": { "version": "3.11.4", + "resolved": "https://registry.npmjs.org/thriftrw/-/thriftrw-3.11.4.tgz", + "integrity": "sha512-UcuBd3eanB3T10nXWRRMwfwoaC6VMk7qe3/5YIWP2Jtw+EbHqJ0p1/K3x8ixiR5dozKSSfcg1W+0e33G1Di3XA==", "dev": true, "dependencies": { "bufrw": "^1.2.1", @@ -20356,21 +24478,24 @@ }, "node_modules/netlify-cli/node_modules/thriftrw/node_modules/long": { "version": "2.4.0", + "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", + "integrity": "sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=0.6" } }, "node_modules/netlify-cli/node_modules/through": { "version": "2.3.8", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true }, "node_modules/netlify-cli/node_modules/through2-filter": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", "dev": true, - "license": "MIT", "dependencies": { "through2": "~2.0.0", "xtend": "~4.0.0" @@ -20378,8 +24503,9 @@ }, "node_modules/netlify-cli/node_modules/through2-filter/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -20392,8 +24518,9 @@ }, "node_modules/netlify-cli/node_modules/through2-filter/node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, - "license": "MIT", "dependencies": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" @@ -20401,8 +24528,9 @@ }, "node_modules/netlify-cli/node_modules/through2-map": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-map/-/through2-map-3.0.0.tgz", + "integrity": "sha512-Ms68QPbSJKjRYY7fmqZHB0VGt+vD0/tjmDHUWgxltjifCof6hZWWeQAEi27Wjbs7jyNlIIyerQw/TVj7gHkd/Q==", "dev": true, - "license": "MIT", "dependencies": { "through2": "~2.0.0", "xtend": "^4.0.0" @@ -20410,8 +24538,9 @@ }, "node_modules/netlify-cli/node_modules/through2-map/node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -20424,8 +24553,9 @@ }, "node_modules/netlify-cli/node_modules/through2-map/node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, - "license": "MIT", "dependencies": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" @@ -20433,24 +24563,27 @@ }, "node_modules/netlify-cli/node_modules/time-zone": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/tiny-lru": { "version": "11.0.1", + "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-11.0.1.tgz", + "integrity": "sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=12" } }, "node_modules/netlify-cli/node_modules/tmp": { "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, - "license": "MIT", "dependencies": { "os-tmpdir": "~1.0.2" }, @@ -20460,16 +24593,18 @@ }, "node_modules/netlify-cli/node_modules/tmp-promise": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", + "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", "dev": true, - "license": "MIT", "dependencies": { "tmp": "^0.2.0" } }, "node_modules/netlify-cli/node_modules/tmp-promise/node_modules/tmp": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, - "license": "MIT", "dependencies": { "rimraf": "^3.0.0" }, @@ -20479,16 +24614,18 @@ }, "node_modules/netlify-cli/node_modules/to-fast-properties": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/to-object-path": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, - "license": "MIT", "dependencies": { "kind-of": "^3.0.2" }, @@ -20498,8 +24635,9 @@ }, "node_modules/netlify-cli/node_modules/to-object-path/node_modules/kind-of": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, - "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -20509,8 +24647,9 @@ }, "node_modules/netlify-cli/node_modules/to-readable-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-3.0.0.tgz", + "integrity": "sha512-vD2LytT6DxPynBa1xbMtswY9gGqj27wNbh2uvI5OhBe+mrGLurRWRQZyQn3812sqlQRtUJwaKVshG+PoGwbPDQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -20520,8 +24659,9 @@ }, "node_modules/netlify-cli/node_modules/to-regex": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, - "license": "MIT", "dependencies": { "define-property": "^2.0.2", "extend-shallow": "^3.0.2", @@ -20534,8 +24674,9 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -20545,24 +24686,27 @@ }, "node_modules/netlify-cli/node_modules/to-regex/node_modules/safe-regex": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", "dev": true, - "license": "MIT", "dependencies": { "ret": "~0.1.10" } }, "node_modules/netlify-cli/node_modules/toidentifier": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/netlify-cli/node_modules/token-types": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", "dev": true, - "license": "MIT", "dependencies": { "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" @@ -20577,28 +24721,33 @@ }, "node_modules/netlify-cli/node_modules/toml": { "version": "3.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "dev": true }, "node_modules/netlify-cli/node_modules/tomlify-j0.4": { "version": "3.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/tomlify-j0.4/-/tomlify-j0.4-3.0.0.tgz", + "integrity": "sha512-2Ulkc8T7mXJ2l0W476YC/A209PR38Nw8PuaCNtk9uI3t1zzFdGQeWYGQvmj2PZkVvRC/Yoi4xQKMRnWc/N29tQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/tr46": { "version": "0.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true }, "node_modules/netlify-cli/node_modules/triple-beam": { "version": "1.3.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", + "dev": true }, "node_modules/netlify-cli/node_modules/ts-node": { "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, - "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -20639,21 +24788,24 @@ }, "node_modules/netlify-cli/node_modules/ts-node/node_modules/diff": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/netlify-cli/node_modules/tslib": { "version": "1.14.1", - "dev": true, - "license": "0BSD" + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true }, "node_modules/netlify-cli/node_modules/tsutils": { "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, - "license": "MIT", "dependencies": { "tslib": "^1.8.1" }, @@ -20666,8 +24818,9 @@ }, "node_modules/netlify-cli/node_modules/tunnel-agent": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, - "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -20677,8 +24830,9 @@ }, "node_modules/netlify-cli/node_modules/type-fest": { "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -20688,8 +24842,9 @@ }, "node_modules/netlify-cli/node_modules/type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, - "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -20700,16 +24855,18 @@ }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" } }, "node_modules/netlify-cli/node_modules/typescript": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -20720,13 +24877,15 @@ }, "node_modules/netlify-cli/node_modules/ufo": { "version": "1.3.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", + "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", + "dev": true }, "node_modules/netlify-cli/node_modules/uid-safe": { "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", "dev": true, - "license": "MIT", "dependencies": { "random-bytes": "~1.0.0" }, @@ -20736,16 +24895,18 @@ }, "node_modules/netlify-cli/node_modules/ulid": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ulid/-/ulid-2.3.0.tgz", + "integrity": "sha512-keqHubrlpvT6G2wH0OEfSW4mquYRcbe/J8NMmveoQOjUqmo+hXtO+ORCpWhdbZ7k72UtY61BL7haGxW6enBnjw==", "dev": true, - "license": "MIT", "bin": { "ulid": "bin/cli.js" } }, "node_modules/netlify-cli/node_modules/unbzip2-stream": { "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", "dev": true, - "license": "MIT", "dependencies": { "buffer": "^5.2.1", "through": "^2.3.8" @@ -20753,18 +24914,21 @@ }, "node_modules/netlify-cli/node_modules/uncrypto": { "version": "0.1.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", + "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", + "dev": true }, "node_modules/netlify-cli/node_modules/undici-types": { "version": "5.26.5", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "node_modules/netlify-cli/node_modules/unenv": { "version": "1.7.4", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.7.4.tgz", + "integrity": "sha512-fjYsXYi30It0YCQYqLOcT6fHfMXsBr2hw9XC7ycf8rTG7Xxpe3ZssiqUnD0khrjiZEmkBXWLwm42yCSCH46fMw==", "dev": true, - "license": "MIT", "dependencies": { "consola": "^3.2.3", "defu": "^6.1.2", @@ -20775,8 +24939,9 @@ }, "node_modules/netlify-cli/node_modules/unenv/node_modules/mime": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "dev": true, - "license": "MIT", "bin": { "mime": "cli.js" }, @@ -20786,8 +24951,9 @@ }, "node_modules/netlify-cli/node_modules/union-value": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, - "license": "MIT", "dependencies": { "arr-union": "^3.1.0", "get-value": "^2.0.6", @@ -20800,16 +24966,18 @@ }, "node_modules/netlify-cli/node_modules/union-value/node_modules/is-extendable": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/unique-string": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, - "license": "MIT", "dependencies": { "crypto-random-string": "^4.0.0" }, @@ -20822,13 +24990,16 @@ }, "node_modules/netlify-cli/node_modules/universal-user-agent": { "version": "6.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true }, "node_modules/netlify-cli/node_modules/unix-dgram": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/unix-dgram/-/unix-dgram-2.0.6.tgz", + "integrity": "sha512-AURroAsb73BZ6CdAyMrTk/hYKNj3DuYYEuOaB8bYMOHGKupRNScw90Q5C71tWJc3uE7dIeXRyuwN0xLLq3vDTg==", "dev": true, - "license": "ISC", + "hasInstallScript": true, "optional": true, "dependencies": { "bindings": "^1.5.0", @@ -20840,8 +25011,9 @@ }, "node_modules/netlify-cli/node_modules/unixify": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unixify/-/unixify-1.0.0.tgz", + "integrity": "sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==", "dev": true, - "license": "MIT", "dependencies": { "normalize-path": "^2.1.1" }, @@ -20851,8 +25023,9 @@ }, "node_modules/netlify-cli/node_modules/unixify/node_modules/normalize-path": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", "dev": true, - "license": "MIT", "dependencies": { "remove-trailing-separator": "^1.0.1" }, @@ -20862,16 +25035,18 @@ }, "node_modules/netlify-cli/node_modules/unpipe": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/unset-value": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, - "license": "MIT", "dependencies": { "has-value": "^0.3.1", "isobject": "^3.0.0" @@ -20882,8 +25057,9 @@ }, "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value": { "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", "dev": true, - "license": "MIT", "dependencies": { "get-value": "^2.0.3", "has-values": "^0.1.4", @@ -20895,8 +25071,9 @@ }, "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value/node_modules/isobject": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", "dev": true, - "license": "MIT", "dependencies": { "isarray": "1.0.0" }, @@ -20906,16 +25083,18 @@ }, "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-values": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/unstorage": { "version": "1.9.0", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.9.0.tgz", + "integrity": "sha512-VpD8ZEYc/le8DZCrny3bnqKE4ZjioQxBRnWE+j5sGNvziPjeDlaS1NaFFHzl/kkXaO3r7UaF8MGQrs14+1B4pQ==", "dev": true, - "license": "MIT", "dependencies": { "anymatch": "^3.1.3", "chokidar": "^3.5.3", @@ -20980,24 +25159,27 @@ }, "node_modules/netlify-cli/node_modules/unstorage/node_modules/lru-cache": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", "dev": true, - "license": "ISC", "engines": { "node": "14 || >=16.14" } }, "node_modules/netlify-cli/node_modules/untildify": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/netlify-cli/node_modules/untun": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.2.tgz", + "integrity": "sha512-wLAMWvxfqyTiBODA1lg3IXHQtjggYLeTK7RnSfqtOXixWJ3bAa2kK/HHmOOg19upteqO3muLvN6O/icbyQY33Q==", "dev": true, - "license": "MIT", "dependencies": { "citty": "^0.1.3", "consola": "^3.2.3", @@ -21009,8 +25191,9 @@ }, "node_modules/netlify-cli/node_modules/update-notifier": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", + "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "boxen": "^7.0.0", "chalk": "^5.0.1", @@ -21036,65 +25219,76 @@ }, "node_modules/netlify-cli/node_modules/uqr": { "version": "0.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/uqr/-/uqr-0.1.2.tgz", + "integrity": "sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==", + "dev": true }, "node_modules/netlify-cli/node_modules/uri-js": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/netlify-cli/node_modules/urix": { "version": "0.1.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true }, "node_modules/netlify-cli/node_modules/urlpattern-polyfill": { "version": "8.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz", + "integrity": "sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/use": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "node_modules/netlify-cli/node_modules/utils-merge": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/netlify-cli/node_modules/uuid": { "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "dev": true, - "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/netlify-cli/node_modules/v8-compile-cache-lib": { "version": "3.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true }, "node_modules/netlify-cli/node_modules/validate-npm-package-license": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, - "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -21102,8 +25296,9 @@ }, "node_modules/netlify-cli/node_modules/validate-npm-package-name": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", "dev": true, - "license": "ISC", "dependencies": { "builtins": "^5.0.0" }, @@ -21113,16 +25308,18 @@ }, "node_modules/netlify-cli/node_modules/vary": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/netlify-cli/node_modules/wait-port": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.0.4.tgz", + "integrity": "sha512-w8Ftna3h6XSFWWc2JC5gZEgp64nz8bnaTp5cvzbJSZ53j+omktWTDdwXxEF0jM8YveviLgFWvNGrSvRHnkyHyw==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.2", "commander": "^9.3.0", @@ -21137,8 +25334,9 @@ }, "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -21151,8 +25349,9 @@ }, "node_modules/netlify-cli/node_modules/wait-port/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -21166,8 +25365,9 @@ }, "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -21177,21 +25377,24 @@ }, "node_modules/netlify-cli/node_modules/wait-port/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/wait-port/node_modules/commander": { "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || >=14" } }, "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -21201,32 +25404,36 @@ }, "node_modules/netlify-cli/node_modules/wcwidth": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", "dev": true, - "license": "MIT", "dependencies": { "defaults": "^1.0.3" } }, "node_modules/netlify-cli/node_modules/web-streams-polyfill": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/netlify-cli/node_modules/well-known-symbols": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", "dev": true, - "license": "ISC", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, - "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -21234,13 +25441,15 @@ }, "node_modules/netlify-cli/node_modules/whatwg-url/node_modules/webidl-conversions": { "version": "3.0.1", - "dev": true, - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -21253,16 +25462,18 @@ }, "node_modules/netlify-cli/node_modules/wide-align": { "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, - "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, "node_modules/netlify-cli/node_modules/widest-line": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", "dev": true, - "license": "MIT", "dependencies": { "string-width": "^5.0.1" }, @@ -21275,13 +25486,15 @@ }, "node_modules/netlify-cli/node_modules/widest-line/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true }, "node_modules/netlify-cli/node_modules/widest-line/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -21296,8 +25509,9 @@ }, "node_modules/netlify-cli/node_modules/windows-release": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.0.1.tgz", + "integrity": "sha512-y1xFdFvdMiDXI3xiOhMbJwt1Y7dUxidha0CWPs1NgjZIjZANTcX7+7bMqNjuezhzb8s5JGEiBAbQjQQYYy7ulw==", "dev": true, - "license": "MIT", "dependencies": { "execa": "^5.1.1" }, @@ -21310,8 +25524,9 @@ }, "node_modules/netlify-cli/node_modules/winston-transport": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", "dev": true, - "license": "MIT", "dependencies": { "logform": "^2.3.2", "readable-stream": "^3.6.0", @@ -21323,16 +25538,18 @@ }, "node_modules/netlify-cli/node_modules/word-wrap": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/netlify-cli/node_modules/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, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -21347,8 +25564,9 @@ }, "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -21361,8 +25579,9 @@ }, "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -21372,13 +25591,15 @@ }, "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -21388,13 +25609,15 @@ }, "node_modules/netlify-cli/node_modules/wrappy": { "version": "1.0.2", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "node_modules/netlify-cli/node_modules/write-file-atomic": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" @@ -21405,8 +25628,9 @@ }, "node_modules/netlify-cli/node_modules/write-file-atomic/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "engines": { "node": ">=14" }, @@ -21416,8 +25640,9 @@ }, "node_modules/netlify-cli/node_modules/ws": { "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -21436,8 +25661,9 @@ }, "node_modules/netlify-cli/node_modules/xdg-basedir": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -21447,13 +25673,15 @@ }, "node_modules/netlify-cli/node_modules/xorshift": { "version": "1.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/xorshift/-/xorshift-1.2.0.tgz", + "integrity": "sha512-iYgNnGyeeJ4t6U11NpA/QiKy+PXn5Aa3Azg5qkwIFz1tBLllQrjjsk9yzD7IAK0naNU4JxdeDgqW9ov4u/hc4g==", + "dev": true }, "node_modules/netlify-cli/node_modules/xss": { "version": "1.0.14", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", + "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", "dev": true, - "license": "MIT", "dependencies": { "commander": "^2.20.3", "cssfilter": "0.0.10" @@ -21467,34 +25695,39 @@ }, "node_modules/netlify-cli/node_modules/xss/node_modules/commander": { "version": "2.20.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true }, "node_modules/netlify-cli/node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4" } }, "node_modules/netlify-cli/node_modules/y18n": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/netlify-cli/node_modules/yallist": { "version": "4.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/netlify-cli/node_modules/yargs": { "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, - "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -21510,8 +25743,9 @@ }, "node_modules/netlify-cli/node_modules/yargs/node_modules/cliui": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, - "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -21523,8 +25757,9 @@ }, "node_modules/netlify-cli/node_modules/yargs/node_modules/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, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -21534,16 +25769,18 @@ }, "node_modules/netlify-cli/node_modules/yargs/node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/netlify-cli/node_modules/yauzl": { "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "dev": true, - "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" @@ -21551,16 +25788,18 @@ }, "node_modules/netlify-cli/node_modules/yn": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/netlify-cli/node_modules/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==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -21570,8 +25809,9 @@ }, "node_modules/netlify-cli/node_modules/zip-stream": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz", + "integrity": "sha512-UfZ0oa0C8LI58wJ+moL46BDIMgCQbnsb+2PoiJYtonhBsMh2bq1eRBVkvjfVsqbEHd9/EgKPUuL9saSSsec8OA==", "dev": true, - "license": "MIT", "dependencies": { "archiver-utils": "^4.0.1", "compress-commons": "^5.0.1", @@ -21583,15 +25823,21 @@ }, "node_modules/netlify-cli/node_modules/zod": { "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, + "node_modules/netlify-cli/tools/lint-rules": { + "name": "eslint-plugin-workspace", + "extraneous": true + }, "node_modules/nlcst-to-string": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", + "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", "dependencies": { "@types/nlcst": "^1.0.0" }, @@ -21601,25 +25847,31 @@ } }, "node_modules/node-emoji": { - "version": "2.1.0", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "@sindresorhus/is": "^3.1.2", + "@sindresorhus/is": "^4.6.0", "char-regex": "^1.0.2", "emojilib": "^2.4.0", "skin-tone": "^2.0.0" + }, + "engines": { + "node": ">=18" } }, "node_modules/node-releases": { - "version": "2.0.13", - "license": "MIT" + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/normalize-package-data": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^7.0.0", "is-core-module": "^2.8.1", @@ -21632,15 +25884,17 @@ }, "node_modules/normalize-path": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "engines": { "node": ">=0.10.0" } }, "node_modules/normalize-url": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -21649,7 +25903,9 @@ } }, "node_modules/npm": { - "version": "10.2.3", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.4.0.tgz", + "integrity": "sha512-RS7Mx0OVfXlOcQLRePuDIYdFCVBPCNapWHplDK+mh7GDdP/Tvor4ocuybRRPSvfcRb2vjRJt1fHCqw3cr8qACQ==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -21713,7 +25969,6 @@ "semver", "spdx-expression-parse", "ssri", - "strip-ansi", "supports-color", "tar", "text-table", @@ -21724,29 +25979,21 @@ "write-file-atomic" ], "dev": true, - "license": "Artistic-2.0", - "workspaces": [ - "docs", - "smoke-tests", - "mock-globals", - "mock-registry", - "workspaces/*" - ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^7.2.1", - "@npmcli/config": "^8.0.1", + "@npmcli/config": "^8.0.2", "@npmcli/fs": "^3.1.0", "@npmcli/map-workspaces": "^3.0.4", "@npmcli/package-json": "^5.0.0", - "@npmcli/promise-spawn": "^7.0.0", - "@npmcli/run-script": "^7.0.2", - "@sigstore/tuf": "^2.1.0", + "@npmcli/promise-spawn": "^7.0.1", + "@npmcli/run-script": "^7.0.4", + "@sigstore/tuf": "^2.3.0", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^18.0.0", + "cacache": "^18.0.2", "chalk": "^5.3.0", - "ci-info": "^3.9.0", + "ci-info": "^4.0.0", "cli-columns": "^4.0.0", "cli-table3": "^0.6.3", "columnify": "^1.6.0", @@ -21757,16 +26004,16 @@ "hosted-git-info": "^7.0.1", "ini": "^4.1.1", "init-package-json": "^6.0.0", - "is-cidr": "^4.0.2", - "json-parse-even-better-errors": "^3.0.0", + "is-cidr": "^5.0.3", + "json-parse-even-better-errors": "^3.0.1", "libnpmaccess": "^8.0.1", "libnpmdiff": "^6.0.3", - "libnpmexec": "^7.0.3", + "libnpmexec": "^7.0.4", "libnpmfund": "^5.0.1", "libnpmhook": "^10.0.0", "libnpmorg": "^6.0.1", "libnpmpack": "^6.0.3", - "libnpmpublish": "^9.0.1", + "libnpmpublish": "^9.0.2", "libnpmsearch": "^7.0.0", "libnpmteam": "^6.0.0", "libnpmversion": "^5.0.1", @@ -21787,7 +26034,7 @@ "npm-user-validate": "^2.0.0", "npmlog": "^7.0.1", "p-map": "^4.0.0", - "pacote": "^17.0.4", + "pacote": "^17.0.6", "parse-conflict-json": "^3.0.1", "proc-log": "^3.0.0", "qrcode-terminal": "^0.12.0", @@ -21795,7 +26042,6 @@ "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1", "ssri": "^10.0.5", - "strip-ansi": "^6.0.1", "supports-color": "^9.4.0", "tar": "^6.2.0", "text-table": "~0.2.0", @@ -21814,26 +26060,15 @@ } }, "node_modules/npm-run-path": { - "version": "5.1.0", - "license": "MIT", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "path-key": "^3.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/npm/node_modules/@colors/colors": { @@ -21935,60 +26170,8 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@npmcli/agent/node_modules/agent-base": { - "version": "7.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent": { - "version": "7.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent": { - "version": "7.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/@npmcli/agent/node_modules/socks-proxy-agent": { - "version": "8.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "socks": "^2.7.1" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "7.2.1", + "version": "7.3.1", "dev": true, "inBundle": true, "license": "ISC", @@ -22020,7 +26203,7 @@ "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.2", + "promise-call-limit": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "ssri": "^10.0.5", @@ -22035,13 +26218,13 @@ } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "8.0.1", + "version": "8.1.0", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/map-workspaces": "^3.0.2", - "ci-info": "^3.8.0", + "ci-info": "^4.0.0", "ini": "^4.1.0", "nopt": "^7.0.0", "proc-log": "^3.0.0", @@ -22065,6 +26248,21 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.0", "dev": true, @@ -22078,7 +26276,7 @@ } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "5.0.3", + "version": "5.0.4", "dev": true, "inBundle": true, "license": "ISC", @@ -22179,7 +26377,7 @@ } }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "7.0.0", + "version": "7.0.1", "dev": true, "inBundle": true, "license": "ISC", @@ -22203,15 +26401,15 @@ } }, "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "7.0.2", + "version": "7.0.4", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/node-gyp": "^3.0.0", + "@npmcli/package-json": "^5.0.0", "@npmcli/promise-spawn": "^7.0.0", "node-gyp": "^10.0.0", - "read-package-json-fast": "^3.0.0", "which": "^4.0.0" }, "engines": { @@ -22229,7 +26427,7 @@ } }, "node_modules/npm/node_modules/@sigstore/bundle": { - "version": "2.1.0", + "version": "2.1.1", "dev": true, "inBundle": true, "license": "Apache-2.0", @@ -22240,6 +26438,15 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/@sigstore/core": { + "version": "0.2.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.2.1", "dev": true, @@ -22250,12 +26457,13 @@ } }, "node_modules/npm/node_modules/@sigstore/sign": { - "version": "2.1.0", + "version": "2.2.1", "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^2.1.0", + "@sigstore/bundle": "^2.1.1", + "@sigstore/core": "^0.2.0", "@sigstore/protobuf-specs": "^0.2.1", "make-fetch-happen": "^13.0.0" }, @@ -22264,13 +26472,27 @@ } }, "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "2.1.0", + "version": "2.3.0", "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { "@sigstore/protobuf-specs": "^0.2.1", - "tuf-js": "^2.1.0" + "tuf-js": "^2.2.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/verify": { + "version": "0.1.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.1.1", + "@sigstore/core": "^0.2.0", + "@sigstore/protobuf-specs": "^0.2.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -22307,16 +26529,16 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/abort-controller": { - "version": "3.0.0", + "node_modules/npm/node_modules/agent-base": { + "version": "7.1.0", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "event-target-shim": "^5.0.0" + "debug": "^4.3.4" }, "engines": { - "node": ">=6.5" + "node": ">= 14" } }, "node_modules/npm/node_modules/aggregate-error": { @@ -22342,15 +26564,12 @@ } }, "node_modules/npm/node_modules/ansi-styles": { - "version": "4.3.0", + "version": "6.2.1", "dev": true, "inBundle": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -22369,14 +26588,10 @@ "license": "MIT" }, "node_modules/npm/node_modules/are-we-there-yet": { - "version": "4.0.1", + "version": "4.0.2", "dev": true, "inBundle": true, "license": "ISC", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^4.1.0" - }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -22387,26 +26602,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/base64-js": { - "version": "1.5.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.3", "dev": true, @@ -22440,30 +26635,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/npm/node_modules/buffer": { - "version": "6.0.3", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/npm/node_modules/builtins": { "version": "5.0.1", "dev": true, @@ -22474,7 +26645,7 @@ } }, "node_modules/npm/node_modules/cacache": { - "version": "18.0.0", + "version": "18.0.2", "dev": true, "inBundle": true, "license": "ISC", @@ -22484,7 +26655,7 @@ "glob": "^10.2.2", "lru-cache": "^10.0.1", "minipass": "^7.0.3", - "minipass-collect": "^1.0.2", + "minipass-collect": "^2.0.1", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "p-map": "^4.0.0", @@ -22518,7 +26689,7 @@ } }, "node_modules/npm/node_modules/ci-info": { - "version": "3.9.0", + "version": "4.0.0", "dev": true, "funding": [ { @@ -22533,15 +26704,15 @@ } }, "node_modules/npm/node_modules/cidr-regex": { - "version": "3.1.1", + "version": "4.0.3", "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "ip-regex": "^4.1.0" + "ip-regex": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/npm/node_modules/clean-stack": { @@ -22727,12 +26898,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm/node_modules/delegates": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/diff": { "version": "5.1.0", "dev": true, @@ -22774,28 +26939,10 @@ } }, "node_modules/npm/node_modules/err-code": { - "version": "2.0.3", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/event-target-shim": { - "version": "5.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/npm/node_modules/events": { - "version": "3.3.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.8.x" - } + "version": "2.0.3", + "dev": true, + "inBundle": true, + "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", @@ -22841,10 +26988,13 @@ } }, "node_modules/npm/node_modules/function-bind": { - "version": "1.1.1", + "version": "1.1.2", "dev": true, "inBundle": true, - "license": "MIT" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/npm/node_modules/gauge": { "version": "5.0.1", @@ -22893,24 +27043,24 @@ "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/has": { - "version": "1.0.3", + "node_modules/npm/node_modules/has-unicode": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/hasown": { + "version": "2.0.0", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "function-bind": "^1.1.1" + "function-bind": "^1.1.2" }, "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" } }, - "node_modules/npm/node_modules/has-unicode": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.1", "dev": true, @@ -22929,6 +27079,32 @@ "inBundle": true, "license": "BSD-2-Clause" }, + "node_modules/npm/node_modules/http-proxy-agent": { + "version": "7.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/https-proxy-agent": { + "version": "7.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", "dev": true, @@ -22942,28 +27118,8 @@ "node": ">=0.10.0" } }, - "node_modules/npm/node_modules/ieee754": { - "version": "1.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "BSD-3-Clause" - }, "node_modules/npm/node_modules/ignore-walk": { - "version": "6.0.3", + "version": "6.0.4", "dev": true, "inBundle": true, "license": "ISC", @@ -23026,33 +27182,36 @@ "license": "MIT" }, "node_modules/npm/node_modules/ip-regex": { - "version": "4.3.0", + "version": "5.0.0", "dev": true, "inBundle": true, "license": "MIT", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/is-cidr": { - "version": "4.0.2", + "version": "5.0.3", "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "cidr-regex": "^3.1.1" + "cidr-regex": "4.0.3" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/npm/node_modules/is-core-module": { - "version": "2.13.0", + "version": "2.13.1", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -23098,7 +27257,7 @@ } }, "node_modules/npm/node_modules/json-parse-even-better-errors": { - "version": "3.0.0", + "version": "3.0.1", "dev": true, "inBundle": true, "license": "MIT", @@ -23137,7 +27296,7 @@ "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "8.0.1", + "version": "8.0.2", "dev": true, "inBundle": true, "license": "ISC", @@ -23150,7 +27309,7 @@ } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "6.0.3", + "version": "6.0.6", "dev": true, "inBundle": true, "license": "ISC", @@ -23170,14 +27329,14 @@ } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "7.0.3", + "version": "7.0.7", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/arborist": "^7.2.1", "@npmcli/run-script": "^7.0.2", - "ci-info": "^3.7.1", + "ci-info": "^4.0.0", "npm-package-arg": "^11.0.1", "npmlog": "^7.0.1", "pacote": "^17.0.4", @@ -23192,7 +27351,7 @@ } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "5.0.1", + "version": "5.0.4", "dev": true, "inBundle": true, "license": "ISC", @@ -23204,7 +27363,7 @@ } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "10.0.0", + "version": "10.0.1", "dev": true, "inBundle": true, "license": "ISC", @@ -23217,7 +27376,7 @@ } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "6.0.1", + "version": "6.0.2", "dev": true, "inBundle": true, "license": "ISC", @@ -23230,7 +27389,7 @@ } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "6.0.3", + "version": "6.0.6", "dev": true, "inBundle": true, "license": "ISC", @@ -23245,18 +27404,18 @@ } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "9.0.1", + "version": "9.0.4", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "ci-info": "^3.6.1", + "ci-info": "^4.0.0", "normalize-package-data": "^6.0.0", "npm-package-arg": "^11.0.1", "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0", "semver": "^7.3.7", - "sigstore": "^2.1.0", + "sigstore": "^2.2.0", "ssri": "^10.0.5" }, "engines": { @@ -23264,7 +27423,7 @@ } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "7.0.0", + "version": "7.0.1", "dev": true, "inBundle": true, "license": "ISC", @@ -23276,7 +27435,7 @@ } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "6.0.0", + "version": "6.0.1", "dev": true, "inBundle": true, "license": "ISC", @@ -23289,7 +27448,7 @@ } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "5.0.1", + "version": "5.0.2", "dev": true, "inBundle": true, "license": "ISC", @@ -23305,7 +27464,7 @@ } }, "node_modules/npm/node_modules/lru-cache": { - "version": "10.0.1", + "version": "10.1.0", "dev": true, "inBundle": true, "license": "ISC", @@ -23360,27 +27519,15 @@ } }, "node_modules/npm/node_modules/minipass-collect": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/minipass-collect/node_modules/minipass": { - "version": "3.3.6", + "version": "2.0.1", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "yallist": "^4.0.0" + "minipass": "^7.0.3" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/npm/node_modules/minipass-fetch": { @@ -23667,12 +27814,12 @@ } }, "node_modules/npm/node_modules/npm-packlist": { - "version": "8.0.0", + "version": "8.0.2", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "ignore-walk": "^6.0.0" + "ignore-walk": "^6.0.4" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -23764,7 +27911,7 @@ } }, "node_modules/npm/node_modules/pacote": { - "version": "17.0.4", + "version": "17.0.6", "dev": true, "inBundle": true, "license": "ISC", @@ -23784,7 +27931,7 @@ "promise-retry": "^2.0.1", "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", - "sigstore": "^2.0.0", + "sigstore": "^2.2.0", "ssri": "^10.0.0", "tar": "^6.1.11" }, @@ -23835,7 +27982,7 @@ } }, "node_modules/npm/node_modules/postcss-selector-parser": { - "version": "6.0.13", + "version": "6.0.15", "dev": true, "inBundle": true, "license": "MIT", @@ -23856,15 +28003,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/process": { - "version": "0.11.10", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", "dev": true, @@ -23875,7 +28013,7 @@ } }, "node_modules/npm/node_modules/promise-call-limit": { - "version": "1.0.2", + "version": "3.0.1", "dev": true, "inBundle": true, "license": "ISC", @@ -23971,22 +28109,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/readable-stream": { - "version": "4.4.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", "dev": true, @@ -23996,26 +28118,6 @@ "node": ">= 4" } }, - "node_modules/npm/node_modules/safe-buffer": { - "version": "5.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", "dev": true, @@ -24078,7 +28180,7 @@ } }, "node_modules/npm/node_modules/signal-exit": { - "version": "4.0.2", + "version": "4.1.0", "dev": true, "inBundle": true, "license": "ISC", @@ -24090,15 +28192,17 @@ } }, "node_modules/npm/node_modules/sigstore": { - "version": "2.1.0", + "version": "2.2.0", "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^2.1.0", + "@sigstore/bundle": "^2.1.1", + "@sigstore/core": "^0.2.0", "@sigstore/protobuf-specs": "^0.2.1", - "@sigstore/sign": "^2.1.0", - "@sigstore/tuf": "^2.1.0" + "@sigstore/sign": "^2.2.1", + "@sigstore/tuf": "^2.3.0", + "@sigstore/verify": "^0.1.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -24128,6 +28232,20 @@ "npm": ">= 3.0.0" } }, + "node_modules/npm/node_modules/socks-proxy-agent": { + "version": "8.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", "dev": true, @@ -24172,15 +28290,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/string_decoder": { - "version": "1.3.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", "dev": true, @@ -24319,7 +28428,7 @@ } }, "node_modules/npm/node_modules/tuf-js": { - "version": "2.1.0", + "version": "2.2.0", "dev": true, "inBundle": true, "license": "MIT", @@ -24467,20 +28576,23 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.0.1", + "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", "dev": true, "inBundle": true, "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", + "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", "dev": true, "inBundle": true, "license": "MIT", @@ -24488,7 +28600,7 @@ "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { @@ -24550,24 +28662,37 @@ }, "node_modules/nwsapi": { "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, - "license": "MIT" + "peer": true, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/object-inspect": { "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-is": { - "version": "1.1.5", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "dev": true, - "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -24578,19 +28703,21 @@ }, "node_modules/object-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { - "version": "4.1.4", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, - "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -24603,20 +28730,22 @@ }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { - "version": "6.0.0", - "license": "MIT", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dependencies": { - "mimic-fn": "^4.0.0" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">=12" + "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -24624,7 +28753,8 @@ }, "node_modules/ora": { "version": "7.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^4.0.0", @@ -24645,7 +28775,8 @@ }, "node_modules/ora/node_modules/chalk": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -24653,10 +28784,27 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/ora/node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-each-series": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -24667,8 +28815,9 @@ }, "node_modules/p-filter": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", "dev": true, - "license": "MIT", "dependencies": { "p-map": "^5.1.0" }, @@ -24681,21 +28830,22 @@ }, "node_modules/p-is-promise": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-limit": { - "version": "4.0.0", - "dev": true, - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", "dependencies": { "yocto-queue": "^1.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -24703,7 +28853,8 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dependencies": { "p-limit": "^3.0.2" }, @@ -24716,7 +28867,8 @@ }, "node_modules/p-locate/node_modules/p-limit": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -24729,7 +28881,8 @@ }, "node_modules/p-locate/node_modules/yocto-queue": { "version": "0.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "engines": { "node": ">=10" }, @@ -24739,8 +28892,9 @@ }, "node_modules/p-map": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", "dev": true, - "license": "MIT", "dependencies": { "aggregate-error": "^4.0.0" }, @@ -24753,8 +28907,9 @@ }, "node_modules/p-map/node_modules/aggregate-error": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^4.0.0", "indent-string": "^5.0.0" @@ -24768,8 +28923,9 @@ }, "node_modules/p-map/node_modules/clean-stack": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -24780,21 +28936,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-map/node_modules/escape-string-regexp": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-map/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -24804,7 +28950,8 @@ }, "node_modules/p-queue": { "version": "8.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", "dependencies": { "eventemitter3": "^5.0.1", "p-timeout": "^6.1.2" @@ -24818,15 +28965,17 @@ }, "node_modules/p-reduce": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-timeout": { "version": "6.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "engines": { "node": ">=14.16" }, @@ -24835,20 +28984,25 @@ } }, "node_modules/p-try": { - "version": "2.2.0", - "license": "MIT", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "peer": true, "engines": { - "node": ">=6" + "node": ">=4" } }, "node_modules/p5": { "version": "1.9.0", - "license": "LGPL-2.1" + "resolved": "https://registry.npmjs.org/p5/-/p5-1.9.0.tgz", + "integrity": "sha512-+5/hz0ZokCDf7BMMAeemE7FIo7gFZK7ImL62acHLXZwerGjqj+171bnaAWj4aCFCx6fwysAr2U7/AKuPyPhehA==" }, "node_modules/parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "callsites": "^3.0.0" @@ -24859,8 +29013,9 @@ }, "node_modules/parse-json": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.1.tgz", + "integrity": "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.21.4", "error-ex": "^1.3.2", @@ -24877,8 +29032,9 @@ }, "node_modules/parse-json/node_modules/type-fest": { "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -24888,7 +29044,8 @@ }, "node_modules/parse-latin": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz", + "integrity": "sha512-b/K8ExXaWC9t34kKeDV8kGXBkXZ1HCSAZRYE7HR14eA1GlXX5L8iWhs8USJNhQU9q5ci413jCKF0gOyovvyRBg==", "dependencies": { "nlcst-to-string": "^3.0.0", "unist-util-modify-children": "^3.0.0", @@ -24901,7 +29058,8 @@ }, "node_modules/parse5": { "version": "7.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dependencies": { "entities": "^4.4.0" }, @@ -24909,68 +29067,96 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dev": true, + "peer": true, + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true, + "peer": true + }, "node_modules/path-browserify": { "version": "1.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, "node_modules/path-exists": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/path-key": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "engines": { "node": ">=8" } }, "node_modules/path-parse": { "version": "1.0.7", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { "version": "6.2.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "node_modules/path-type": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/pathe": { - "version": "1.1.1", - "dev": true, - "license": "MIT" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true }, "node_modules/pathval": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true, - "license": "MIT", "engines": { "node": "*" } }, "node_modules/picocolors": { "version": "1.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { "node": ">=8.6" }, @@ -24979,16 +29165,20 @@ } }, "node_modules/pify": { - "version": "4.0.1", - "license": "MIT", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "peer": true, "engines": { - "node": ">=6" + "node": ">=4" } }, "node_modules/pkg-conf": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "find-up": "^2.0.0", @@ -25000,8 +29190,9 @@ }, "node_modules/pkg-conf/node_modules/find-up": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "locate-path": "^2.0.0" @@ -25012,8 +29203,9 @@ }, "node_modules/pkg-conf/node_modules/locate-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "p-locate": "^2.0.0", @@ -25025,8 +29217,9 @@ }, "node_modules/pkg-conf/node_modules/p-limit": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "p-try": "^1.0.0" @@ -25037,8 +29230,9 @@ }, "node_modules/pkg-conf/node_modules/p-locate": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "p-limit": "^1.1.0" @@ -25047,19 +29241,11 @@ "node": ">=4" } }, - "node_modules/pkg-conf/node_modules/p-try": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/pkg-conf/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -25067,7 +29253,8 @@ }, "node_modules/pkg-dir": { "version": "4.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dependencies": { "find-up": "^4.0.0" }, @@ -25077,7 +29264,8 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -25088,7 +29276,8 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dependencies": { "p-locate": "^4.1.0" }, @@ -25098,7 +29287,8 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dependencies": { "p-try": "^2.0.0" }, @@ -25111,7 +29301,8 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dependencies": { "p-limit": "^2.2.0" }, @@ -25119,25 +29310,30 @@ "node": ">=8" } }, + "node_modules/pkg-dir/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/pkg-types": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", "dev": true, - "license": "MIT", "dependencies": { "jsonc-parser": "^3.2.0", "mlly": "^1.2.0", "pathe": "^1.1.0" } }, - "node_modules/pkg-types/node_modules/jsonc-parser": { - "version": "3.2.0", - "dev": true, - "license": "MIT" - }, "node_modules/playwright": { "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", + "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "playwright-core": "1.40.1" }, @@ -25153,8 +29349,9 @@ }, "node_modules/playwright-core": { "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", + "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", "dev": true, - "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, @@ -25164,8 +29361,10 @@ }, "node_modules/playwright/node_modules/fsevents": { "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "license": "MIT", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -25174,8 +29373,19 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { - "version": "8.4.32", + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "funding": [ { "type": "opencollective", @@ -25190,7 +29400,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", @@ -25201,8 +29410,9 @@ } }, "node_modules/preferred-pm": { - "version": "3.1.2", - "license": "MIT", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.3.tgz", + "integrity": "sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==", "dependencies": { "find-up": "^5.0.0", "find-yarn-workspace-root2": "1.2.16", @@ -25215,7 +29425,8 @@ }, "node_modules/preferred-pm/node_modules/which-pm": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", + "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", "dependencies": { "load-yaml-file": "^0.2.0", "path-exists": "^4.0.0" @@ -25226,7 +29437,8 @@ }, "node_modules/prettier": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "bin": { "prettier": "bin/prettier.cjs" }, @@ -25238,22 +29450,24 @@ } }, "node_modules/pretty-format": { - "version": "29.7.0", + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, - "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", + "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "react-is": "^17.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -25263,14 +29477,16 @@ }, "node_modules/prismjs": { "version": "1.29.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", "engines": { "node": ">=6" } }, "node_modules/probe-image-size": { "version": "7.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", + "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", "dependencies": { "lodash.merge": "^4.6.2", "needle": "^2.5.2", @@ -25279,12 +29495,14 @@ }, "node_modules/process-nextick-args": { "version": "2.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "node_modules/prompts": { "version": "2.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -25295,14 +29513,16 @@ }, "node_modules/prompts/node_modules/kleur": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "engines": { "node": ">=6" } }, "node_modules/property-information": { - "version": "6.4.0", - "license": "MIT", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz", + "integrity": "sha512-OHYtXfu5aI2sS2LWFSN5rgJjrQ4pCy8i1jubJLe2QvMF8JJ++HXTUIVWFLfXJoaOfvYYjk2SN8J2wFUWIGXT4w==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -25310,29 +29530,35 @@ }, "node_modules/proto-list": { "version": "1.2.4", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true }, "node_modules/psl": { "version": "1.9.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true }, "node_modules/punycode": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/querystringify": { "version": "2.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true }, "node_modules/queue-microtask": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "funding": [ { "type": "github", @@ -25346,13 +29572,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/rc": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -25365,7 +29591,8 @@ }, "node_modules/react": { "version": "18.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -25375,7 +29602,8 @@ }, "node_modules/react-dom": { "version": "18.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" @@ -25385,21 +29613,24 @@ } }, "node_modules/react-is": { - "version": "18.2.0", - "dev": true, - "license": "MIT" + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true }, "node_modules/react-refresh": { "version": "0.14.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", + "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/read-pkg": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", + "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/normalize-package-data": "^2.4.1", "normalize-package-data": "^6.0.0", @@ -25415,8 +29646,9 @@ }, "node_modules/read-pkg-up": { "version": "10.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-10.1.0.tgz", + "integrity": "sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==", "dev": true, - "license": "MIT", "dependencies": { "find-up": "^6.3.0", "read-pkg": "^8.1.0", @@ -25431,8 +29663,9 @@ }, "node_modules/read-pkg-up/node_modules/find-up": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" @@ -25446,8 +29679,9 @@ }, "node_modules/read-pkg-up/node_modules/locate-path": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^6.0.0" }, @@ -25458,10 +29692,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/read-pkg-up/node_modules/p-locate": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^4.0.0" }, @@ -25474,16 +29724,18 @@ }, "node_modules/read-pkg-up/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "4.6.0", + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -25492,9 +29744,10 @@ } }, "node_modules/read-pkg/node_modules/type-fest": { - "version": "4.6.0", + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -25503,20 +29756,30 @@ } }, "node_modules/readable-stream": { - "version": "3.6.2", - "license": "MIT", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, "node_modules/readdirp": { "version": "3.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dependencies": { "picomatch": "^2.2.1" }, @@ -25526,6 +29789,8 @@ }, "node_modules/rechoir": { "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "dependencies": { "resolve": "^1.1.6" @@ -25534,28 +29799,22 @@ "node": ">= 0.10" } }, - "node_modules/redeyed": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "esprima": "~4.0.0" - } - }, "node_modules/regenerator-runtime": { - "version": "0.14.0", - "dev": true, - "license": "MIT" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true }, "node_modules/regexp.prototype.flags": { - "version": "1.5.1", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, - "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -25566,8 +29825,9 @@ }, "node_modules/registry-auth-token": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", "dev": true, - "license": "MIT", "dependencies": { "@pnpm/npm-conf": "^2.1.0" }, @@ -25577,7 +29837,8 @@ }, "node_modules/rehype": { "version": "13.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", + "integrity": "sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg==", "dependencies": { "@types/hast": "^3.0.0", "rehype-parse": "^9.0.0", @@ -25591,7 +29852,8 @@ }, "node_modules/rehype-parse": { "version": "9.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz", + "integrity": "sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==", "dependencies": { "@types/hast": "^3.0.0", "hast-util-from-html": "^2.0.0", @@ -25604,7 +29866,8 @@ }, "node_modules/rehype-raw": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", "dependencies": { "@types/hast": "^3.0.0", "hast-util-raw": "^9.0.0", @@ -25617,7 +29880,8 @@ }, "node_modules/rehype-stringify": { "version": "10.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz", + "integrity": "sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ==", "dependencies": { "@types/hast": "^3.0.0", "hast-util-to-html": "^9.0.0", @@ -25630,7 +29894,8 @@ }, "node_modules/remark-gfm": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", @@ -25646,7 +29911,8 @@ }, "node_modules/remark-parse": { "version": "11.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", @@ -25659,8 +29925,9 @@ } }, "node_modules/remark-rehype": { - "version": "11.0.0", - "license": "MIT", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", + "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -25675,7 +29942,8 @@ }, "node_modules/remark-smartypants": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.1.0.tgz", + "integrity": "sha512-qoF6Vz3BjU2tP6OfZqHOvCU0ACmu/6jhGaINSQRI9mM7wCxNQTKB3JUAN4SVoN2ybElEDTxBIABRep7e569iJw==", "dependencies": { "retext": "^8.1.0", "retext-smartypants": "^5.2.0", @@ -25687,7 +29955,8 @@ }, "node_modules/remark-stringify": { "version": "11.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-to-markdown": "^2.0.0", @@ -25700,23 +29969,27 @@ }, "node_modules/request-light": { "version": "0.7.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", + "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==" }, "node_modules/require-directory": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "engines": { "node": ">=0.10.0" } }, "node_modules/requires-port": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true }, "node_modules/resolve": { "version": "1.22.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -25731,8 +30004,9 @@ }, "node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=8" @@ -25740,7 +30014,8 @@ }, "node_modules/restore-cursor": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -25752,33 +30027,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "2.1.0", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/restore-cursor/node_modules/onetime": { - "version": "5.1.2", - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/restore-cursor/node_modules/signal-exit": { - "version": "3.0.7", - "license": "ISC" - }, "node_modules/retext": { "version": "8.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext/-/retext-8.1.0.tgz", + "integrity": "sha512-N9/Kq7YTn6ZpzfiGW45WfEGJqFf1IM1q8OsRa1CGzIebCJBNCANDRmOrholiDRGKo/We7ofKR4SEvcGAWEMD3Q==", "dependencies": { "@types/nlcst": "^1.0.0", "retext-latin": "^3.0.0", @@ -25792,7 +30044,8 @@ }, "node_modules/retext-latin": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-3.1.0.tgz", + "integrity": "sha512-5MrD1tuebzO8ppsja5eEu+ZbBeUNCjoEarn70tkXOS7Bdsdf6tNahsv2bY0Z8VooFF6cw7/6S+d3yI/TMlMVVQ==", "dependencies": { "@types/nlcst": "^1.0.0", "parse-latin": "^5.0.0", @@ -25806,11 +30059,13 @@ }, "node_modules/retext-latin/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext-latin/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -25827,7 +30082,8 @@ }, "node_modules/retext-latin/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -25838,7 +30094,8 @@ }, "node_modules/retext-latin/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -25852,7 +30109,8 @@ }, "node_modules/retext-latin/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -25864,7 +30122,8 @@ }, "node_modules/retext-smartypants": { "version": "5.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-5.2.0.tgz", + "integrity": "sha512-Do8oM+SsjrbzT2UNIKgheP0hgUQTDDQYyZaIY3kfq0pdFzoPk+ZClYJ+OERNXveog4xf1pZL4PfRxNoVL7a/jw==", "dependencies": { "@types/nlcst": "^1.0.0", "nlcst-to-string": "^3.0.0", @@ -25878,11 +30137,13 @@ }, "node_modules/retext-smartypants/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext-smartypants/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -25899,7 +30160,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-is": { "version": "5.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -25910,7 +30172,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -25921,7 +30184,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-visit": { "version": "4.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0", @@ -25934,7 +30198,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-visit-parents": { "version": "5.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0" @@ -25946,7 +30211,8 @@ }, "node_modules/retext-smartypants/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -25960,7 +30226,8 @@ }, "node_modules/retext-smartypants/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -25972,7 +30239,8 @@ }, "node_modules/retext-stringify": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", + "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", "dependencies": { "@types/nlcst": "^1.0.0", "nlcst-to-string": "^3.0.0", @@ -25985,11 +30253,13 @@ }, "node_modules/retext-stringify/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext-stringify/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -26006,7 +30276,8 @@ }, "node_modules/retext-stringify/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26017,7 +30288,8 @@ }, "node_modules/retext-stringify/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -26031,7 +30303,8 @@ }, "node_modules/retext-stringify/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -26043,11 +30316,13 @@ }, "node_modules/retext/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -26064,7 +30339,8 @@ }, "node_modules/retext/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26075,7 +30351,8 @@ }, "node_modules/retext/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -26089,7 +30366,8 @@ }, "node_modules/retext/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -26101,15 +30379,17 @@ }, "node_modules/reusify": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rollup": { - "version": "4.9.3", - "license": "MIT", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", "dependencies": { "@types/estree": "1.0.5" }, @@ -26121,29 +30401,32 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.3", - "@rollup/rollup-android-arm64": "4.9.3", - "@rollup/rollup-darwin-arm64": "4.9.3", - "@rollup/rollup-darwin-x64": "4.9.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.3", - "@rollup/rollup-linux-arm64-gnu": "4.9.3", - "@rollup/rollup-linux-arm64-musl": "4.9.3", - "@rollup/rollup-linux-riscv64-gnu": "4.9.3", - "@rollup/rollup-linux-x64-gnu": "4.9.3", - "@rollup/rollup-linux-x64-musl": "4.9.3", - "@rollup/rollup-win32-arm64-msvc": "4.9.3", - "@rollup/rollup-win32-ia32-msvc": "4.9.3", - "@rollup/rollup-win32-x64-msvc": "4.9.3", + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", "fsevents": "~2.3.2" } }, "node_modules/rrweb-cssom": { "version": "0.6.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true }, "node_modules/run-parallel": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "funding": [ { "type": "github", @@ -26158,41 +30441,30 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/safe-buffer": { - "version": "5.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safer-buffer": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sax": { "version": "1.3.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" }, "node_modules/saxes": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, - "license": "ISC", "dependencies": { "xmlchars": "^2.2.0" }, @@ -26202,14 +30474,16 @@ }, "node_modules/scheduler": { "version": "0.23.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dependencies": { "loose-envify": "^1.1.0" } }, "node_modules/section-matter": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", "dependencies": { "extend-shallow": "^2.0.1", "kind-of": "^6.0.0" @@ -26219,9 +30493,10 @@ } }, "node_modules/semantic-release": { - "version": "22.0.7", + "version": "23.0.2", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-23.0.2.tgz", + "integrity": "sha512-OnVYJ6Xgzwe1x8MKswba7RU9+5djS1MWRTrTn5qsq3xZYpslroZkV9Pt0dA2YcIuieeuSZWJhn+yUWoBUHO5Fw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@semantic-release/commit-analyzer": "^11.0.0", @@ -26230,9 +30505,9 @@ "@semantic-release/npm": "^11.0.0", "@semantic-release/release-notes-generator": "^12.0.0", "aggregate-error": "^5.0.0", - "cosmiconfig": "^8.0.0", + "cosmiconfig": "^9.0.0", "debug": "^4.0.0", - "env-ci": "^10.0.0", + "env-ci": "^11.0.0", "execa": "^8.0.0", "figures": "^6.0.0", "find-versions": "^5.1.0", @@ -26240,9 +30515,10 @@ "git-log-parser": "^1.2.0", "hook-std": "^3.0.0", "hosted-git-info": "^7.0.0", + "import-from-esm": "^1.3.1", "lodash-es": "^4.17.21", - "marked": "^9.0.0", - "marked-terminal": "^6.0.0", + "marked": "^12.0.0", + "marked-terminal": "^7.0.0", "micromatch": "^4.0.2", "p-each-series": "^3.0.0", "p-reduce": "^3.0.0", @@ -26257,13 +30533,14 @@ "semantic-release": "bin/semantic-release.js" }, "engines": { - "node": "^18.17 || >=20.6.1" + "node": ">=20.8.1" } }, "node_modules/semantic-release/node_modules/@semantic-release/error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -26271,8 +30548,9 @@ }, "node_modules/semantic-release/node_modules/aggregate-error": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "clean-stack": "^5.2.0", @@ -26287,8 +30565,9 @@ }, "node_modules/semantic-release/node_modules/clean-stack": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "escape-string-regexp": "5.0.0" @@ -26300,13 +30579,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semantic-release/node_modules/escape-string-regexp": { - "version": "5.0.0", + "node_modules/semantic-release/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/semantic-release/node_modules/execa/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "license": "MIT", "peer": true, "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -26314,8 +30618,9 @@ }, "node_modules/semantic-release/node_modules/get-stream": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -26324,11 +30629,80 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semantic-release/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/semantic-release/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "peer": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, "engines": { "node": ">=12" }, @@ -26338,8 +30712,9 @@ }, "node_modules/semantic-release/node_modules/p-reduce": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -26349,15 +30724,15 @@ } }, "node_modules/semantic-release/node_modules/parse-json": { - "version": "8.0.0", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.22.13", - "index-to-position": "^0.1.0", - "json-parse-even-better-errors": "^3.0.0", - "type-fest": "^4.6.0" + "index-to-position": "^0.1.2", + "type-fest": "^4.7.1" }, "engines": { "node": ">=18" @@ -26366,16 +30741,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semantic-release/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/semantic-release/node_modules/read-pkg": { - "version": "9.0.0", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@types/normalize-package-data": "^2.4.3", "normalize-package-data": "^6.0.0", "parse-json": "^8.0.0", - "type-fest": "^4.6.0" + "type-fest": "^4.6.0", + "unicorn-magic": "^0.1.0" }, "engines": { "node": ">=18" @@ -26386,8 +30776,10 @@ }, "node_modules/semantic-release/node_modules/read-pkg-up": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-11.0.0.tgz", + "integrity": "sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==", + "deprecated": "Renamed to read-package-up", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "find-up-simple": "^1.0.0", @@ -26401,10 +30793,37 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semantic-release/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/semantic-release/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/semantic-release/node_modules/type-fest": { - "version": "4.6.0", + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "peer": true, "engines": { "node": ">=16" @@ -26414,8 +30833,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "license": "ISC", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -26428,8 +30848,9 @@ }, "node_modules/semver-diff": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "semver": "^7.3.5" @@ -26443,8 +30864,9 @@ }, "node_modules/semver-regex": { "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -26455,7 +30877,8 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { "yallist": "^4.0.0" }, @@ -26465,43 +30888,51 @@ }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/server-destroy": { "version": "1.0.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==" }, "node_modules/set-function-length": { - "version": "1.1.1", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", "dev": true, - "license": "MIT", "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.1" }, "engines": { "node": ">= 0.4" } }, "node_modules/set-function-name": { - "version": "2.0.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, - "license": "MIT", "dependencies": { - "define-data-property": "^1.0.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/sharp": { - "version": "0.33.1", + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", + "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==", "hasInstallScript": true, - "license": "Apache-2.0", "optional": true, "dependencies": { "color": "^4.2.3", @@ -26509,37 +30940,38 @@ "semver": "^7.5.4" }, "engines": { - "libvips": ">=8.15.0", + "libvips": ">=8.15.1", "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.33.1", - "@img/sharp-darwin-x64": "0.33.1", - "@img/sharp-libvips-darwin-arm64": "1.0.0", - "@img/sharp-libvips-darwin-x64": "1.0.0", - "@img/sharp-libvips-linux-arm": "1.0.0", - "@img/sharp-libvips-linux-arm64": "1.0.0", - "@img/sharp-libvips-linux-s390x": "1.0.0", - "@img/sharp-libvips-linux-x64": "1.0.0", - "@img/sharp-libvips-linuxmusl-arm64": "1.0.0", - "@img/sharp-libvips-linuxmusl-x64": "1.0.0", - "@img/sharp-linux-arm": "0.33.1", - "@img/sharp-linux-arm64": "0.33.1", - "@img/sharp-linux-s390x": "0.33.1", - "@img/sharp-linux-x64": "0.33.1", - "@img/sharp-linuxmusl-arm64": "0.33.1", - "@img/sharp-linuxmusl-x64": "0.33.1", - "@img/sharp-wasm32": "0.33.1", - "@img/sharp-win32-ia32": "0.33.1", - "@img/sharp-win32-x64": "0.33.1" + "@img/sharp-darwin-arm64": "0.33.2", + "@img/sharp-darwin-x64": "0.33.2", + "@img/sharp-libvips-darwin-arm64": "1.0.1", + "@img/sharp-libvips-darwin-x64": "1.0.1", + "@img/sharp-libvips-linux-arm": "1.0.1", + "@img/sharp-libvips-linux-arm64": "1.0.1", + "@img/sharp-libvips-linux-s390x": "1.0.1", + "@img/sharp-libvips-linux-x64": "1.0.1", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1", + "@img/sharp-libvips-linuxmusl-x64": "1.0.1", + "@img/sharp-linux-arm": "0.33.2", + "@img/sharp-linux-arm64": "0.33.2", + "@img/sharp-linux-s390x": "0.33.2", + "@img/sharp-linux-x64": "0.33.2", + "@img/sharp-linuxmusl-arm64": "0.33.2", + "@img/sharp-linuxmusl-x64": "0.33.2", + "@img/sharp-wasm32": "0.33.2", + "@img/sharp-win32-ia32": "0.33.2", + "@img/sharp-win32-x64": "0.33.2" } }, "node_modules/shebang-command": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -26549,15 +30981,17 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "engines": { "node": ">=8" } }, "node_modules/shelljs": { "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -26572,15 +31006,17 @@ }, "node_modules/shikiji": { "version": "0.6.13", - "license": "MIT", + "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.13.tgz", + "integrity": "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA==", "dependencies": { "hast-util-to-html": "^9.0.0" } }, "node_modules/shx": { "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.3", "shelljs": "^0.8.5" @@ -26589,58 +31025,139 @@ "shx": "lib/cli.js" }, "engines": { - "node": ">=6" + "node": ">=6" + } + }, + "node_modules/side-channel": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", + "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/signale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", + "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^2.3.2", + "figures": "^2.0.0", + "pkg-conf": "^2.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/signale/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/signale/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/side-channel": { - "version": "1.0.4", + "node_modules/signale/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "license": "MIT", + "peer": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "color-name": "1.1.3" } }, - "node_modules/siginfo": { - "version": "2.0.0", + "node_modules/signale/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true, - "license": "ISC" + "peer": true }, - "node_modules/signal-exit": { - "version": "4.1.0", - "license": "ISC", + "node_modules/signale/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=0.8.0" } }, - "node_modules/signale": { - "version": "1.4.0", + "node_modules/signale/node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "chalk": "^2.3.2", - "figures": "^2.0.0", - "pkg-conf": "^2.1.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/signale/node_modules/figures": { - "version": "2.0.0", + "node_modules/signale/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/signale/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "has-flag": "^3.0.0" }, "engines": { "node": ">=4" @@ -26648,20 +31165,29 @@ }, "node_modules/simple-swizzle": { "version": "0.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", "optional": true, "dependencies": { "is-arrayish": "^0.3.1" } }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "optional": true + }, "node_modules/sisteransi": { "version": "1.0.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, "node_modules/skin-tone": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "unicode-emoji-modifier-base": "^1.0.0" @@ -26672,8 +31198,9 @@ }, "node_modules/slash": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -26683,22 +31210,25 @@ }, "node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-js": { "version": "1.0.2", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "engines": { "node": ">=0.10.0" } }, "node_modules/space-separated-tokens": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -26706,67 +31236,78 @@ }, "node_modules/spawn-error-forwarder": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", + "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/spdx-correct": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "dev": true, - "license": "CC-BY-3.0" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true }, "node_modules/spdx-expression-parse": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, - "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-license-ids": { - "version": "3.0.16", - "dev": true, - "license": "CC0-1.0" + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true }, "node_modules/split2": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, - "license": "ISC", "engines": { "node": ">= 10.x" } }, "node_modules/sprintf-js": { "version": "1.0.3", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/stackback": { "version": "0.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true }, "node_modules/state-local": { "version": "1.0.7", - "license": "MIT" + "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", + "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==" }, "node_modules/std-env": { - "version": "3.6.0", - "dev": true, - "license": "MIT" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true }, "node_modules/stdin-discarder": { "version": "0.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", "dependencies": { "bl": "^5.0.0" }, @@ -26779,8 +31320,9 @@ }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", "dev": true, - "license": "MIT", "dependencies": { "internal-slot": "^1.0.4" }, @@ -26790,79 +31332,55 @@ }, "node_modules/stream-combiner2": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "duplexer2": "~0.1.0", "readable-stream": "^2.0.2" } }, - "node_modules/stream-combiner2/node_modules/readable-stream": { - "version": "2.3.8", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/stream-combiner2/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "peer": true - }, - "node_modules/stream-combiner2/node_modules/string_decoder": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/stream-parser": { "version": "0.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", "dependencies": { "debug": "2" } }, "node_modules/stream-parser/node_modules/debug": { "version": "2.6.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dependencies": { "ms": "2.0.0" } }, "node_modules/stream-parser/node_modules/ms": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/string_decoder": { - "version": "1.3.0", - "license": "MIT", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "safe-buffer": "~5.2.0" + "safe-buffer": "~5.1.0" } }, "node_modules/string-width": { - "version": "6.1.0", - "license": "MIT", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^10.2.1", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -26870,7 +31388,8 @@ }, "node_modules/stringify-entities": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" @@ -26882,7 +31401,8 @@ }, "node_modules/strip-ansi": { "version": "7.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -26893,42 +31413,56 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/strip-bom": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "engines": { "node": ">=4" } }, "node_modules/strip-bom-string": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", "engines": { "node": ">=0.10.0" } }, "node_modules/strip-final-newline": { - "version": "3.0.0", - "license": "MIT", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, "node_modules/strip-json-comments": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/strip-literal": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", "dev": true, - "license": "MIT", "dependencies": { "acorn": "^8.10.0" }, @@ -26937,19 +31471,22 @@ } }, "node_modules/supports-color": { - "version": "5.5.0", - "license": "MIT", + "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, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/supports-hyperlinks": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "has-flag": "^4.0.0", @@ -26959,30 +31496,10 @@ "node": ">=14.18" } }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "engines": { "node": ">= 0.4" }, @@ -26992,21 +31509,24 @@ }, "node_modules/symbol-tree": { "version": "3.2.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true }, "node_modules/temp-dir": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" } }, "node_modules/tempy": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", "dev": true, - "license": "MIT", "dependencies": { "is-stream": "^3.0.0", "temp-dir": "^3.0.0", @@ -27020,10 +31540,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/tempy/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/text-extensions": { "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -27031,82 +31564,82 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/through": { - "version": "2.3.8", - "dev": true, - "license": "MIT" - }, - "node_modules/through2": { - "version": "2.0.5", + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "any-promise": "^1.0.0" } }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.8", + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" } }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "peer": true + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "safe-buffer": "~5.1.0" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, "node_modules/tinybench": { - "version": "2.5.1", - "dev": true, - "license": "MIT" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true }, "node_modules/tinypool": { - "version": "0.8.1", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.0", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/to-fast-properties": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dependencies": { "is-number": "^7.0.0" }, @@ -27116,8 +31649,9 @@ }, "node_modules/tough-cookie": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -27130,16 +31664,18 @@ }, "node_modules/tough-cookie/node_modules/universalify": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4.0.0" } }, "node_modules/tr46": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dev": true, - "license": "MIT", "dependencies": { "punycode": "^2.3.1" }, @@ -27148,33 +31684,40 @@ } }, "node_modules/traverse": { - "version": "0.6.7", + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", "dev": true, - "license": "MIT", "peer": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/trim-lines": { "version": "3.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/trough": { - "version": "2.1.0", - "license": "MIT", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/tsconfck": { - "version": "3.0.0", - "license": "MIT", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", + "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", "bin": { "tsconfck": "bin/tsconfck.js" }, @@ -27190,17 +31733,25 @@ } } }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "optional": true + }, "node_modules/type-detect": { "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/type-fest": { "version": "2.19.0", - "license": "(MIT OR CC0-1.0)", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "engines": { "node": ">=12.20" }, @@ -27210,11 +31761,13 @@ }, "node_modules/typesafe-path": { "version": "0.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", + "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" }, "node_modules/typescript": { "version": "5.3.3", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -27224,21 +31777,24 @@ } }, "node_modules/typescript-auto-import-cache": { - "version": "0.3.0", - "license": "MIT", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.2.tgz", + "integrity": "sha512-+laqe5SFL1vN62FPOOJSUDTZxtgsoOXjneYOXIpx5rQ4UMiN89NAtJLpqLqyebv9fgQ/IMeeTX+mQyRnwvJzvg==", "dependencies": { "semver": "^7.3.8" } }, "node_modules/ufo": { - "version": "1.3.1", - "dev": true, - "license": "MIT" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", + "dev": true }, "node_modules/uglify-js": { "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, - "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -27248,17 +31804,20 @@ } }, "node_modules/ultrahtml": { - "version": "1.5.2", - "license": "MIT" + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.3.tgz", + "integrity": "sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==" }, "node_modules/undici-types": { "version": "5.26.5", - "devOptional": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "devOptional": true }, "node_modules/unherit": { "version": "3.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", + "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -27266,16 +31825,31 @@ }, "node_modules/unicode-emoji-modifier-base": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unified": { "version": "11.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", @@ -27292,8 +31866,9 @@ }, "node_modules/unique-string": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, - "license": "MIT", "dependencies": { "crypto-random-string": "^4.0.0" }, @@ -27306,7 +31881,8 @@ }, "node_modules/unist-util-is": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", "dependencies": { "@types/unist": "^3.0.0" }, @@ -27317,7 +31893,8 @@ }, "node_modules/unist-util-modify-children": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", + "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", "dependencies": { "@types/unist": "^2.0.0", "array-iterate": "^2.0.0" @@ -27329,11 +31906,13 @@ }, "node_modules/unist-util-modify-children/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/unist-util-position": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dependencies": { "@types/unist": "^3.0.0" }, @@ -27344,7 +31923,8 @@ }, "node_modules/unist-util-stringify-position": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dependencies": { "@types/unist": "^3.0.0" }, @@ -27355,7 +31935,8 @@ }, "node_modules/unist-util-visit": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", @@ -27368,7 +31949,8 @@ }, "node_modules/unist-util-visit-children": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", + "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -27379,11 +31961,13 @@ }, "node_modules/unist-util-visit-children/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/unist-util-visit-parents": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" @@ -27395,19 +31979,23 @@ }, "node_modules/universal-user-agent": { "version": "6.0.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true }, "node_modules/universalify": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 10.0.0" } }, "node_modules/update-browserslist-db": { "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "funding": [ { "type": "opencollective", @@ -27422,7 +32010,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" @@ -27436,16 +32023,18 @@ }, "node_modules/url-join": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/url-parse": { "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dev": true, - "license": "MIT", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -27453,12 +32042,14 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/validate-npm-package-license": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, - "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -27466,7 +32057,8 @@ }, "node_modules/vfile": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0", @@ -27479,7 +32071,8 @@ }, "node_modules/vfile-location": { "version": "5.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", "dependencies": { "@types/unist": "^3.0.0", "vfile": "^6.0.0" @@ -27491,7 +32084,8 @@ }, "node_modules/vfile-message": { "version": "4.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" @@ -27502,11 +32096,12 @@ } }, "node_modules/vite": { - "version": "5.0.11", - "license": "MIT", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", "dependencies": { "esbuild": "^0.19.3", - "postcss": "^8.4.32", + "postcss": "^8.4.35", "rollup": "^4.2.0" }, "bin": { @@ -27556,8 +32151,9 @@ }, "node_modules/vite-node": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.1.1.tgz", + "integrity": "sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==", "dev": true, - "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", @@ -27577,7 +32173,8 @@ }, "node_modules/vitefu": { "version": "0.2.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", + "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, @@ -27589,8 +32186,9 @@ }, "node_modules/vitest": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.1.1.tgz", + "integrity": "sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/expect": "1.1.1", "@vitest/runner": "1.1.1", @@ -27652,15 +32250,150 @@ } } }, + "node_modules/vitest/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/vitest/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/vitest/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/vitest/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/volar-service-css": { - "version": "0.0.16", - "license": "MIT", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-css/-/volar-service-css-0.0.30.tgz", + "integrity": "sha512-jui+1N0HBfjW43tRfhyZp0axhBee4997BRyX4os8xQm/7cjD2KjAuyz92nMIPRt1QDoG4/7uQT28xNhy0TPJTA==", "dependencies": { "vscode-css-languageservice": "^6.2.10", "vscode-uri": "^3.0.8" }, "peerDependencies": { - "@volar/language-service": "~1.10.0" + "@volar/language-service": "~2.0.1" }, "peerDependenciesMeta": { "@volar/language-service": { @@ -27669,14 +32402,15 @@ } }, "node_modules/volar-service-emmet": { - "version": "0.0.16", - "license": "MIT", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-emmet/-/volar-service-emmet-0.0.30.tgz", + "integrity": "sha512-HEeIrmqQ/DTfuQDI9ER5+YReXXjE9f7W6MlBmn5biUuPyizVTGfuILN8pJhmYvmPHCA7qHhU7CJqwE9DAh9AJg==", "dependencies": { "@vscode/emmet-helper": "^2.9.2", - "volar-service-html": "0.0.16" + "volar-service-html": "0.0.30" }, "peerDependencies": { - "@volar/language-service": "~1.10.0" + "@volar/language-service": "~2.0.1" }, "peerDependenciesMeta": { "@volar/language-service": { @@ -27685,14 +32419,15 @@ } }, "node_modules/volar-service-html": { - "version": "0.0.16", - "license": "MIT", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-html/-/volar-service-html-0.0.30.tgz", + "integrity": "sha512-wW3TEeRTeHv/3mC8Ik6T62SwewMWFungb8ydyEK/2GDHEntBEG/J9wtuh01/J0kYqPerhlT9zhdGB6PGYHAGuA==", "dependencies": { "vscode-html-languageservice": "^5.1.0", "vscode-uri": "^3.0.8" }, "peerDependencies": { - "@volar/language-service": "~1.10.0" + "@volar/language-service": "~2.0.1" }, "peerDependenciesMeta": { "@volar/language-service": { @@ -27701,10 +32436,14 @@ } }, "node_modules/volar-service-prettier": { - "version": "0.0.16", - "license": "MIT", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-prettier/-/volar-service-prettier-0.0.30.tgz", + "integrity": "sha512-Qdc5Zc0y4hJmJbpIQ52cSDjs0uvVug/e2nuL/XZWPJM6Cr5/3RjjoRVKtDQbKItFYlGk+JH+LSXvwQeD5TXZqg==", + "dependencies": { + "vscode-uri": "^3.0.8" + }, "peerDependencies": { - "@volar/language-service": "~1.10.0", + "@volar/language-service": "~2.0.1", "prettier": "^2.2 || ^3.0" }, "peerDependenciesMeta": { @@ -27717,19 +32456,20 @@ } }, "node_modules/volar-service-typescript": { - "version": "0.0.16", - "license": "MIT", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-typescript/-/volar-service-typescript-0.0.30.tgz", + "integrity": "sha512-jA8c0Mhy9rgAsrgtwocK95Smws1M2E0MxlQ/SVo/rmOGH32cX9UGgI0IENWKa3yagp/khfoemOIQDz/KNhI3zg==", "dependencies": { "path-browserify": "^1.0.1", "semver": "^7.5.4", - "typescript-auto-import-cache": "^0.3.0", + "typescript-auto-import-cache": "^0.3.1", "vscode-languageserver-textdocument": "^1.0.11", "vscode-nls": "^5.2.0", "vscode-uri": "^3.0.8" }, "peerDependencies": { - "@volar/language-service": "~1.10.0", - "@volar/typescript": "~1.10.0" + "@volar/language-service": "~2.0.1", + "@volar/typescript": "~2.0.1" }, "peerDependenciesMeta": { "@volar/language-service": { @@ -27738,10 +32478,11 @@ } }, "node_modules/volar-service-typescript-twoslash-queries": { - "version": "0.0.16", - "license": "MIT", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-typescript-twoslash-queries/-/volar-service-typescript-twoslash-queries-0.0.30.tgz", + "integrity": "sha512-ahj6woBxhkZu7icQR58x5TnUaS8ZRKn7a+UvY+andmiTWsOaSu85zj36+LPZgZQi1MG+BtjNwUjKoxtZiN51PA==", "peerDependencies": { - "@volar/language-service": "~1.10.0" + "@volar/language-service": "~2.0.1" }, "peerDependenciesMeta": { "@volar/language-service": { @@ -27750,35 +32491,49 @@ } }, "node_modules/vscode-css-languageservice": { - "version": "6.2.10", - "license": "MIT", + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.2.12.tgz", + "integrity": "sha512-PS9r7HgNjqzRl3v91sXpCyZPc8UDotNo6gntFNtGCKPhGA9Frk7g/VjX1Mbv3F00pn56D+rxrFzR9ep4cawOgA==", "dependencies": { - "@vscode/l10n": "^0.0.16", + "@vscode/l10n": "^0.0.18", "vscode-languageserver-textdocument": "^1.0.11", "vscode-languageserver-types": "3.17.5", "vscode-uri": "^3.0.8" } }, + "node_modules/vscode-css-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, "node_modules/vscode-html-languageservice": { - "version": "5.1.1", - "license": "MIT", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.1.2.tgz", + "integrity": "sha512-wkWfEx/IIR3s2P5yD4aTGHiOb8IAzFxgkSt1uSC3itJ4oDAm23yG7o0L29JljUdnXDDgLafPAvhv8A2I/8riHw==", "dependencies": { - "@vscode/l10n": "^0.0.16", + "@vscode/l10n": "^0.0.18", "vscode-languageserver-textdocument": "^1.0.11", "vscode-languageserver-types": "^3.17.5", "vscode-uri": "^3.0.8" } }, + "node_modules/vscode-html-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { "version": "9.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, @@ -27788,7 +32543,8 @@ }, "node_modules/vscode-languageserver-protocol": { "version": "3.17.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" @@ -27796,24 +32552,29 @@ }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.11", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, "node_modules/vscode-nls": { "version": "5.2.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==" }, "node_modules/vscode-uri": { "version": "3.0.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, - "license": "MIT", "dependencies": { "xml-name-validator": "^5.0.0" }, @@ -27823,7 +32584,8 @@ }, "node_modules/web-namespaces": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -27831,16 +32593,18 @@ }, "node_modules/webidl-conversions": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=12" } }, "node_modules/whatwg-encoding": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, - "license": "MIT", "dependencies": { "iconv-lite": "0.6.3" }, @@ -27850,8 +32614,9 @@ }, "node_modules/whatwg-encoding/node_modules/iconv-lite": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -27861,16 +32626,18 @@ }, "node_modules/whatwg-mimetype": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/whatwg-url": { "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", "dev": true, - "license": "MIT", "dependencies": { "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" @@ -27881,7 +32648,8 @@ }, "node_modules/which": { "version": "2.0.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dependencies": { "isexe": "^2.0.0" }, @@ -27894,8 +32662,9 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, - "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -27909,8 +32678,9 @@ }, "node_modules/which-collection": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "dev": true, - "license": "MIT", "dependencies": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -27923,7 +32693,8 @@ }, "node_modules/which-pm": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", + "integrity": "sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ==", "dependencies": { "load-yaml-file": "^0.2.0", "path-exists": "^4.0.0" @@ -27934,21 +32705,23 @@ }, "node_modules/which-pm-runs": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", "engines": { "node": ">=4" } }, "node_modules/which-typed-array": { - "version": "1.1.13", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dev": true, - "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -27959,8 +32732,9 @@ }, "node_modules/why-is-node-running": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", "dev": true, - "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -27974,7 +32748,8 @@ }, "node_modules/widest-line": { "version": "4.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", "dependencies": { "string-width": "^5.0.1" }, @@ -27987,11 +32762,13 @@ }, "node_modules/widest-line/node_modules/emoji-regex": { "version": "9.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/widest-line/node_modules/string-width": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -28006,12 +32783,14 @@ }, "node_modules/wordwrap": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true }, "node_modules/wrap-ansi": { "version": "8.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -28026,7 +32805,8 @@ }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "6.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "engines": { "node": ">=12" }, @@ -28036,11 +32816,13 @@ }, "node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -28055,13 +32837,15 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/ws": { - "version": "8.14.2", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -28080,21 +32864,24 @@ }, "node_modules/xml-name-validator": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=18" } }, "node_modules/xmlchars": { "version": "2.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true }, "node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=0.4" @@ -28102,18 +32889,21 @@ }, "node_modules/y18n": { "version": "5.0.8", - "license": "ISC", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "3.1.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yargs": { "version": "17.7.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -28129,25 +32919,21 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "engines": { "node": ">=12" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/yargs/node_modules/emoji-regex": { "version": "8.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/yargs/node_modules/string-width": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -28159,7 +32945,8 @@ }, "node_modules/yargs/node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -28169,7 +32956,8 @@ }, "node_modules/yocto-queue": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "engines": { "node": ">=12.20" }, @@ -28179,14 +32967,16 @@ }, "node_modules/zod": { "version": "3.22.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zwitch": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" diff --git a/package.json b/package.json index 6bdbddf..02cb2b0 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,13 @@ "type": "module", "scripts": { "copy:p5": "mkdirp ./public/lib && shx cp -r ./node_modules/p5/lib ./public/", - "dev": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro dev", - "start": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro dev", + "dev": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro dev", + "start": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro dev", "prebuild": "npm run copy:p5", "postinstall": "npm run copy:p5", - "build": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro build", + "build": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro build", + "build:netlify": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro build", + "check": "astro check", "preview": "astro preview", "astro": "astro", From caf6b7afa765cf8bf8a475e46ea1d04f9853ef05 Mon Sep 17 00:00:00 2001 From: ff6347 Date: Wed, 28 Feb 2024 09:07:03 +0100 Subject: [PATCH 08/26] style(prettier): Make it pretty --- .all-contributorsrc | 47 +- .vscode/extensions.json | 4 +- CHANGELOG.md | 57 +- package-lock.json | 65968 +++---- package.json | 109 +- playwright.config.ts | 2 +- public/lib/addons/p5.sound.js | 29418 +-- public/lib/addons/p5.sound.min.js | 9488 +- public/lib/p5.js | 256096 ++++++++++++++------------- public/lib/p5.min.js | 55917 +++++- src/components/Sandbox.tsx | 360 +- src/components/sandox.css | 250 +- 12 files changed, 250708 insertions(+), 167008 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7b4cf15..aade08e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,29 +1,22 @@ { - "files": [ - "README.md" - ], - "imageSize": 100, - "commit": false, - "commitType": "docs", - "commitConvention": "angular", - "contributors": [ - { - "login": "ff6347", - "name": "Fabian Morón Zirfas", - "avatar_url": "https://avatars.githubusercontent.com/u/315106?v=4", - "profile": "https://fabianmoronzirfas.me", - "contributions": [ - "code", - "design", - "ideas", - "infra" - ] - } - ], - "contributorsPerLine": 7, - "skipCi": true, - "repoType": "github", - "repoHost": "https://github.com", - "projectName": "p5-code-sandbox", - "projectOwner": "ff6347" + "files": ["README.md"], + "imageSize": 100, + "commit": false, + "commitType": "docs", + "commitConvention": "angular", + "contributors": [ + { + "login": "ff6347", + "name": "Fabian Morón Zirfas", + "avatar_url": "https://avatars.githubusercontent.com/u/315106?v=4", + "profile": "https://fabianmoronzirfas.me", + "contributions": ["code", "design", "ideas", "infra"] + } + ], + "contributorsPerLine": 7, + "skipCi": true, + "repoType": "github", + "repoHost": "https://github.com", + "projectName": "p5-code-sandbox", + "projectOwner": "ff6347" } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 22a1505..3a1c9ec 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/CHANGELOG.md b/CHANGELOG.md index e605b5f..7edb2a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,95 +1,82 @@ ## [1.4.5](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.4...v1.4.5) (2023-12-17) - ### Bug Fixes -* **mobile:** Add background on small screens ([8630b72](https://github.com/ff6347/p5-code-sandbox/commit/8630b721dfd75772b079bd243653b45f6c946ec9)) +- **mobile:** Add background on small screens ([8630b72](https://github.com/ff6347/p5-code-sandbox/commit/8630b721dfd75772b079bd243653b45f6c946ec9)) ## [1.4.4](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.3...v1.4.4) (2023-12-06) - ### Bug Fixes -* **deps:** update dependency @astrojs/react to v3.0.7 ([176b754](https://github.com/ff6347/p5-code-sandbox/commit/176b754ce236cbcb8434923b62375b77e738a785)) +- **deps:** update dependency @astrojs/react to v3.0.7 ([176b754](https://github.com/ff6347/p5-code-sandbox/commit/176b754ce236cbcb8434923b62375b77e738a785)) ## [1.4.3](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.2...v1.4.3) (2023-12-04) - ### Bug Fixes -* **deps:** update dependency astro to v3.6.4 ([6e7c628](https://github.com/ff6347/p5-code-sandbox/commit/6e7c628ab8c47bc402feb8c3124fe1edc3ad4f26)) -* **deps:** update dependency p5 to v1.9.0 ([1565985](https://github.com/ff6347/p5-code-sandbox/commit/1565985db28d85ed3cf0b5b55cbb5cef48bf59ca)) +- **deps:** update dependency astro to v3.6.4 ([6e7c628](https://github.com/ff6347/p5-code-sandbox/commit/6e7c628ab8c47bc402feb8c3124fe1edc3ad4f26)) +- **deps:** update dependency p5 to v1.9.0 ([1565985](https://github.com/ff6347/p5-code-sandbox/commit/1565985db28d85ed3cf0b5b55cbb5cef48bf59ca)) ## [1.4.2](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.1...v1.4.2) (2023-11-29) - ### Bug Fixes -* **deps:** update dependency astro to v3.6.3 ([b393c0a](https://github.com/ff6347/p5-code-sandbox/commit/b393c0af6fda015cb7b06724da0a960e1f8425fa)) +- **deps:** update dependency astro to v3.6.3 ([b393c0a](https://github.com/ff6347/p5-code-sandbox/commit/b393c0af6fda015cb7b06724da0a960e1f8425fa)) ## [1.4.1](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.0...v1.4.1) (2023-11-25) - ### Bug Fixes -* **deps:** update dependency @astrojs/react to v3.0.6 ([38e9f8a](https://github.com/ff6347/p5-code-sandbox/commit/38e9f8a7ab3d8baf5a176fa0240ba10190d07cb1)) -* **deps:** update dependency @types/p5 to v1.7.4 ([7f7fa96](https://github.com/ff6347/p5-code-sandbox/commit/7f7fa965b812b4dcb05053c2dbb6b3dc656d96b1)) -* **deps:** update dependency astro to v3.6.0 ([a86caef](https://github.com/ff6347/p5-code-sandbox/commit/a86caef1dfbf1f670c37685208a5236f59668105)) -* **deps:** update dependency typescript to v5.3.2 ([22ca5cd](https://github.com/ff6347/p5-code-sandbox/commit/22ca5cd05f82db202e6206512e76dc94305656ac)) +- **deps:** update dependency @astrojs/react to v3.0.6 ([38e9f8a](https://github.com/ff6347/p5-code-sandbox/commit/38e9f8a7ab3d8baf5a176fa0240ba10190d07cb1)) +- **deps:** update dependency @types/p5 to v1.7.4 ([7f7fa96](https://github.com/ff6347/p5-code-sandbox/commit/7f7fa965b812b4dcb05053c2dbb6b3dc656d96b1)) +- **deps:** update dependency astro to v3.6.0 ([a86caef](https://github.com/ff6347/p5-code-sandbox/commit/a86caef1dfbf1f670c37685208a5236f59668105)) +- **deps:** update dependency typescript to v5.3.2 ([22ca5cd](https://github.com/ff6347/p5-code-sandbox/commit/22ca5cd05f82db202e6206512e76dc94305656ac)) # [1.4.0](https://github.com/ff6347/p5-code-sandbox/compare/v1.3.0...v1.4.0) (2023-11-22) - ### Features -* **startercode:** Add new starter code ([e1942de](https://github.com/ff6347/p5-code-sandbox/commit/e1942de6e31440afe741b07e9f4aa5bc7a107774)) +- **startercode:** Add new starter code ([e1942de](https://github.com/ff6347/p5-code-sandbox/commit/e1942de6e31440afe741b07e9f4aa5bc7a107774)) # [1.3.0](https://github.com/ff6347/p5-code-sandbox/compare/v1.2.0...v1.3.0) (2023-11-18) - ### Features -* **formatter:** et default opts for prettier ([7ea71a9](https://github.com/ff6347/p5-code-sandbox/commit/7ea71a9b0902be7f35a978827ab44f0643d6d1c0)) -* **formatter:** Use prettier as default formater ([757d03f](https://github.com/ff6347/p5-code-sandbox/commit/757d03fafaeb41ea514cbd9dde2e28391f7cfd50)) +- **formatter:** et default opts for prettier ([7ea71a9](https://github.com/ff6347/p5-code-sandbox/commit/7ea71a9b0902be7f35a978827ab44f0643d6d1c0)) +- **formatter:** Use prettier as default formater ([757d03f](https://github.com/ff6347/p5-code-sandbox/commit/757d03fafaeb41ea514cbd9dde2e28391f7cfd50)) # [1.2.0](https://github.com/ff6347/p5-code-sandbox/compare/v1.1.1...v1.2.0) (2023-11-11) - ### Bug Fixes -* Add missing types ([d2f8d86](https://github.com/ff6347/p5-code-sandbox/commit/d2f8d86de0f1ddb199f8ab9f1f3aaf65703be31a)) - +- Add missing types ([d2f8d86](https://github.com/ff6347/p5-code-sandbox/commit/d2f8d86de0f1ddb199f8ab9f1f3aaf65703be31a)) ### Features -* **storage:** Save code in local storage ([ba296fd](https://github.com/ff6347/p5-code-sandbox/commit/ba296fd39068f10f3de9fc672d1552a69bc3504a)) +- **storage:** Save code in local storage ([ba296fd](https://github.com/ff6347/p5-code-sandbox/commit/ba296fd39068f10f3de9fc672d1552a69bc3504a)) ## [1.1.1](https://github.com/ff6347/p5-code-sandbox/compare/v1.1.0...v1.1.1) (2023-11-11) - ### Bug Fixes -* **deps:** update dependency @types/p5 to v1.7.3 ([b665747](https://github.com/ff6347/p5-code-sandbox/commit/b6657478a77137dbbdc4b0eee48b45ec95ab37d5)) -* **deps:** update dependency astro to v3.5.2 ([af931a2](https://github.com/ff6347/p5-code-sandbox/commit/af931a23e5c27c83e27d94b1eec7973cc69a1679)) +- **deps:** update dependency @types/p5 to v1.7.3 ([b665747](https://github.com/ff6347/p5-code-sandbox/commit/b6657478a77137dbbdc4b0eee48b45ec95ab37d5)) +- **deps:** update dependency astro to v3.5.2 ([af931a2](https://github.com/ff6347/p5-code-sandbox/commit/af931a23e5c27c83e27d94b1eec7973cc69a1679)) # [1.1.0](https://github.com/ff6347/p5-code-sandbox/compare/v1.0.0...v1.1.0) (2023-11-08) - ### Bug Fixes -* Mising p5 lib ([0bb8d31](https://github.com/ff6347/p5-code-sandbox/commit/0bb8d31d6f9fb42fb0e6f807d85836a031d97172)) -* Responsive style for output ([ec72f46](https://github.com/ff6347/p5-code-sandbox/commit/ec72f468ee5185da1bfcdfcd414a8ac39d09e0fe)) - +- Mising p5 lib ([0bb8d31](https://github.com/ff6347/p5-code-sandbox/commit/0bb8d31d6f9fb42fb0e6f807d85836a031d97172)) +- Responsive style for output ([ec72f46](https://github.com/ff6347/p5-code-sandbox/commit/ec72f468ee5185da1bfcdfcd414a8ac39d09e0fe)) ### Features -* **editor:** Debounce input for smoother UX ([2495c28](https://github.com/ff6347/p5-code-sandbox/commit/2495c286811ef825cd96d42e3aa803cdcd3d7dc7)) -* Load p5 from localhost ([33ae6e5](https://github.com/ff6347/p5-code-sandbox/commit/33ae6e5888b4d0dd628c6ca373492838a32cba8a)) -* Move to astro ([87d6d1d](https://github.com/ff6347/p5-code-sandbox/commit/87d6d1de8576b281d27c8b7f0f769be3b6d2d382)) +- **editor:** Debounce input for smoother UX ([2495c28](https://github.com/ff6347/p5-code-sandbox/commit/2495c286811ef825cd96d42e3aa803cdcd3d7dc7)) +- Load p5 from localhost ([33ae6e5](https://github.com/ff6347/p5-code-sandbox/commit/33ae6e5888b4d0dd628c6ca373492838a32cba8a)) +- Move to astro ([87d6d1d](https://github.com/ff6347/p5-code-sandbox/commit/87d6d1de8576b281d27c8b7f0f769be3b6d2d382)) # 1.0.0 (2023-11-04) - ### Features -* **mvp:** First working version of editor ([f571adf](https://github.com/ff6347/p5-code-sandbox/commit/f571adfad5882e2746b4b9d0c84b340242672155)) +- **mvp:** First working version of editor ([f571adf](https://github.com/ff6347/p5-code-sandbox/commit/f571adfad5882e2746b4b9d0c84b340242672155)) diff --git a/package-lock.json b/package-lock.json index b83ed8d..41699bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,32986 +1,32986 @@ { - "name": "@ff6347/p5-sandbox", - "version": "1.4.5", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@ff6347/p5-sandbox", - "version": "1.4.5", - "hasInstallScript": true, - "dependencies": { - "@astrojs/check": "0.3.4", - "@astrojs/react": "3.0.9", - "@monaco-editor/react": "4.6.0", - "@types/p5": "1.7.6", - "@types/react": "18.2.45", - "@types/react-dom": "18.2.18", - "astro": "4.1.0", - "lodash.debounce": "4.0.8", - "p5": "1.9.0", - "prettier": "3.1.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "typescript": "5.3.3" - }, - "devDependencies": { - "@playwright/test": "1.40.1", - "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", - "@types/lodash.debounce": "4.0.9", - "@types/node": "20.10.6", - "jsdom": "23.0.1", - "mkdirp": "3.0.1", - "netlify-cli": "17.10.2", - "shx": "0.3.4", - "vitest": "1.1.1" - } - }, - "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@astrojs/check": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.3.4.tgz", - "integrity": "sha512-Wi4KwW38J3GCd/U6LH2UuU4uc4P/K1WYaqhoKm2o7rVoGhQfO+RWrSO26rUPRXYbmae8JugAgpCmsHC8bt5RlA==", - "dependencies": { - "@astrojs/language-server": "^2.5.5", - "chokidar": "^3.5.3", - "fast-glob": "^3.3.1", - "kleur": "^4.1.5", - "yargs": "^17.7.2" - }, - "bin": { - "astro-check": "dist/bin.js" - }, - "peerDependencies": { - "typescript": "^5.0.0" - } - }, - "node_modules/@astrojs/compiler": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.6.0.tgz", - "integrity": "sha512-c74k8iGHL3DzkosSJ0tGcHIEBEiIfBhr7eadSaPyvWlVKaieDVzVs8OW1tnRSQyBsfMc8DZQ4RcN2KAcESD8UQ==" - }, - "node_modules/@astrojs/internal-helpers": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.2.1.tgz", - "integrity": "sha512-06DD2ZnItMwUnH81LBLco3tWjcZ1lGU9rLCCBaeUCGYe9cI0wKyY2W3kDyoW1I6GmcWgt1fu+D1CTvz+FIKf8A==" - }, - "node_modules/@astrojs/language-server": { - "version": "2.7.6", - "resolved": "https://registry.npmjs.org/@astrojs/language-server/-/language-server-2.7.6.tgz", - "integrity": "sha512-NhMSmMAuKBMXnvpfn9eYPR7R6zOasAjRb+ta8L+rCHHuKzUc0lBgAF5M6rx01FJqlpGqeqao13eYt4287Ze49g==", - "dependencies": { - "@astrojs/compiler": "^2.4.0", - "@jridgewell/sourcemap-codec": "^1.4.15", - "@volar/kit": "~2.0.4", - "@volar/language-core": "~2.0.4", - "@volar/language-server": "~2.0.4", - "@volar/language-service": "~2.0.4", - "@volar/typescript": "~2.0.4", - "fast-glob": "^3.2.12", - "volar-service-css": "0.0.30", - "volar-service-emmet": "0.0.30", - "volar-service-html": "0.0.30", - "volar-service-prettier": "0.0.30", - "volar-service-typescript": "0.0.30", - "volar-service-typescript-twoslash-queries": "0.0.30", - "vscode-html-languageservice": "^5.1.2", - "vscode-uri": "^3.0.8" - }, - "bin": { - "astro-ls": "bin/nodeServer.js" - }, - "peerDependencies": { - "prettier": "^3.0.0", - "prettier-plugin-astro": ">=0.11.0" - }, - "peerDependenciesMeta": { - "prettier": { - "optional": true - }, - "prettier-plugin-astro": { - "optional": true - } - } - }, - "node_modules/@astrojs/markdown-remark": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-4.0.1.tgz", - "integrity": "sha512-RU4ESnqvyLpj8WZs0n5elS6idaDdtIIm7mIpMaRNPCebpxMjfcfdwcmBwz83ktAj5d2eO5bC3z92TcGdli+lRw==", - "dependencies": { - "@astrojs/prism": "^3.0.0", - "github-slugger": "^2.0.0", - "import-meta-resolve": "^4.0.0", - "mdast-util-definitions": "^6.0.0", - "rehype-raw": "^7.0.0", - "rehype-stringify": "^10.0.0", - "remark-gfm": "^4.0.0", - "remark-parse": "^11.0.0", - "remark-rehype": "^11.0.0", - "remark-smartypants": "^2.0.0", - "shikiji": "^0.6.13", - "unified": "^11.0.4", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.1" - } - }, - "node_modules/@astrojs/prism": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.0.0.tgz", - "integrity": "sha512-g61lZupWq1bYbcBnYZqdjndShr/J3l/oFobBKPA3+qMat146zce3nz2kdO4giGbhYDt4gYdhmoBz0vZJ4sIurQ==", - "dependencies": { - "prismjs": "^1.29.0" - }, - "engines": { - "node": ">=18.14.1" - } - }, - "node_modules/@astrojs/react": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-3.0.9.tgz", - "integrity": "sha512-31J5yF5p9yBFV1axBooLA9PB4B2+MYm7swWhtlezSsJiUNXRFo5Is9qI3teJ7cKgmaCv+ZA593Smskko0NGaDQ==", - "dependencies": { - "@vitejs/plugin-react": "^4.2.0", - "ultrahtml": "^1.3.0" - }, - "engines": { - "node": ">=18.14.1" - }, - "peerDependencies": { - "@types/react": "^17.0.50 || ^18.0.21", - "@types/react-dom": "^17.0.17 || ^18.0.6", - "react": "^17.0.2 || ^18.0.0", - "react-dom": "^17.0.2 || ^18.0.0" - } - }, - "node_modules/@astrojs/telemetry": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.0.4.tgz", - "integrity": "sha512-A+0c7k/Xy293xx6odsYZuXiaHO0PL+bnDoXOc47sGDF5ffIKdKQGRPFl2NMlCF4L0NqN4Ynbgnaip+pPF0s7pQ==", - "dependencies": { - "ci-info": "^3.8.0", - "debug": "^4.3.4", - "dlv": "^1.1.3", - "dset": "^3.1.2", - "is-docker": "^3.0.0", - "is-wsl": "^3.0.0", - "which-pm-runs": "^1.1.0" - }, - "engines": { - "node": ">=18.14.1" - } - }, - "node_modules/@astrojs/telemetry/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", - "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", - "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.9", - "@babel/parser": "^7.23.9", - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", - "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", - "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", - "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", - "dependencies": { - "@babel/types": "^7.22.15" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", - "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", - "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", - "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", - "dependencies": { - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", - "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", - "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-jsx": "^7.23.3", - "@babel/types": "^7.23.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", - "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", - "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", - "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", - "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", - "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", - "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", - "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", - "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@emmetio/abbreviation": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz", - "integrity": "sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==", - "dependencies": { - "@emmetio/scanner": "^1.0.4" - } - }, - "node_modules/@emmetio/css-abbreviation": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz", - "integrity": "sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==", - "dependencies": { - "@emmetio/scanner": "^1.0.4" - } - }, - "node_modules/@emmetio/scanner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz", - "integrity": "sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==" - }, - "node_modules/@emnapi/runtime": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", - "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", - "cpu": [ - "loong64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", - "cpu": [ - "mips64el" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz", - "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.1" - } - }, - "node_modules/@img/sharp-darwin-x64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz", - "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.0.1" - } - }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz", - "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "macos": ">=11", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz", - "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "macos": ">=10.13", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz", - "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.28", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz", - "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.26", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz", - "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.28", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz", - "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.26", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz", - "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "musl": ">=1.2.2", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz", - "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "musl": ">=1.2.2", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-linux-arm": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz", - "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.28", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.0.1" - } - }, - "node_modules/@img/sharp-linux-arm64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz", - "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.0.1" - } - }, - "node_modules/@img/sharp-linux-s390x": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz", - "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.28", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.0.1" - } - }, - "node_modules/@img/sharp-linux-x64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz", - "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.0.1" - } - }, - "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz", - "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "musl": ">=1.2.2", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.1" - } - }, - "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz", - "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "musl": ">=1.2.2", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.0.1" - } - }, - "node_modules/@img/sharp-wasm32": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz", - "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==", - "cpu": [ - "wasm32" - ], - "optional": true, - "dependencies": { - "@emnapi/runtime": "^0.45.0" - }, - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-ia32": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz", - "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-x64": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz", - "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", - "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", - "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@monaco-editor/loader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.4.0.tgz", - "integrity": "sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==", - "dependencies": { - "state-local": "^1.0.6" - }, - "peerDependencies": { - "monaco-editor": ">= 0.21.0 < 1" - } - }, - "node_modules/@monaco-editor/react": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.6.0.tgz", - "integrity": "sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==", - "dependencies": { - "@monaco-editor/loader": "^1.4.0" - }, - "peerDependencies": { - "monaco-editor": ">= 0.25.0 < 1", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@octokit/auth-token": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", - "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", - "dev": true, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/core": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", - "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", - "dev": true, - "dependencies": { - "@octokit/auth-token": "^4.0.0", - "@octokit/graphql": "^7.0.0", - "@octokit/request": "^8.0.2", - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/endpoint": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", - "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", - "dev": true, - "dependencies": { - "@octokit/types": "^12.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/graphql": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", - "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", - "dev": true, - "dependencies": { - "@octokit/request": "^8.0.1", - "@octokit/types": "^12.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/openapi-types": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", - "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", - "dev": true - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-8.0.0.tgz", - "integrity": "sha512-2xZ+baZWUg+qudVXnnvXz7qfrTmDeYPCzangBVq/1gXxii/OiS//4shJp9dnCCvj1x+JAm9ji1Egwm1BA47lPQ==", - "dev": true, - "dependencies": { - "@octokit/types": "^11.0.0" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "@octokit/core": ">=5" - } - }, - "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", - "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" - } - }, - "node_modules/@octokit/plugin-retry": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", - "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", - "dev": true, - "dependencies": { - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", - "bottleneck": "^2.15.3" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "@octokit/core": ">=5" - } - }, - "node_modules/@octokit/plugin-throttling": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-7.0.0.tgz", - "integrity": "sha512-KL2k/d0uANc8XqP5S64YcNFCudR3F5AaKO39XWdUtlJIjT9Ni79ekWJ6Kj5xvAw87udkOMEPcVf9xEge2+ahew==", - "dev": true, - "dependencies": { - "@octokit/types": "^11.0.0", - "bottleneck": "^2.15.3" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "@octokit/core": "^5.0.0" - } - }, - "node_modules/@octokit/plugin-throttling/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/@octokit/plugin-throttling/node_modules/@octokit/types": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", - "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" - } - }, - "node_modules/@octokit/request": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", - "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", - "dev": true, - "dependencies": { - "@octokit/endpoint": "^9.0.0", - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/request-error": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", - "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", - "dev": true, - "dependencies": { - "@octokit/types": "^12.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@octokit/types": { - "version": "12.6.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", - "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^20.0.0" - } - }, - "node_modules/@playwright/test": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", - "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", - "dev": true, - "dependencies": { - "playwright": "1.40.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/@pnpm/config.env-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", - "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", - "dev": true, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", - "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", - "dev": true, - "dependencies": { - "graceful-fs": "4.2.10" - }, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/@pnpm/npm-conf": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", - "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", - "dev": true, - "dependencies": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", - "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", - "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", - "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", - "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", - "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", - "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", - "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", - "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", - "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", - "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", - "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", - "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", - "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@semantic-release/changelog": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", - "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", - "dev": true, - "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "fs-extra": "^11.0.0", - "lodash": "^4.17.4" - }, - "engines": { - "node": ">=14.17" - }, - "peerDependencies": { - "semantic-release": ">=18.0.0" - } - }, - "node_modules/@semantic-release/commit-analyzer": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-11.0.0.tgz", - "integrity": "sha512-uEXyf4Z0AWJuxI9TbSQP5kkIYqus1/E1NcmE7pIv6d6/m/5EJcNWAGR4FOo34vrV26FhEaRVkxFfYzp/M7BKIg==", - "dev": true, - "dependencies": { - "conventional-changelog-angular": "^7.0.0", - "conventional-commits-filter": "^4.0.0", - "conventional-commits-parser": "^5.0.0", - "debug": "^4.0.0", - "import-from": "^4.0.0", - "lodash-es": "^4.17.21", - "micromatch": "^4.0.2" - }, - "engines": { - "node": "^18.17 || >=20.6.1" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } - }, - "node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", - "dev": true, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/@semantic-release/git": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", - "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", - "dev": true, - "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "debug": "^4.0.0", - "dir-glob": "^3.0.0", - "execa": "^5.0.0", - "lodash": "^4.17.4", - "micromatch": "^4.0.0", - "p-reduce": "^2.0.0" - }, - "engines": { - "node": ">=14.17" - }, - "peerDependencies": { - "semantic-release": ">=18.0.0" - } - }, - "node_modules/@semantic-release/github": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-9.0.5.tgz", - "integrity": "sha512-d1ZZjMvXpSa4E1L3XjdNOqgUy00o9QZX55L75pMsb/w+1NV6CCfDYOvH8qwKygHS/rKzI3FkBTcR40ahOodsgg==", - "dev": true, - "dependencies": { - "@octokit/core": "^5.0.0", - "@octokit/plugin-paginate-rest": "^8.0.0", - "@octokit/plugin-retry": "^6.0.0", - "@octokit/plugin-throttling": "^7.0.0", - "@semantic-release/error": "^4.0.0", - "aggregate-error": "^4.0.1", - "debug": "^4.3.4", - "dir-glob": "^3.0.1", - "globby": "^13.1.4", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "issue-parser": "^6.0.0", - "lodash-es": "^4.17.21", - "mime": "^3.0.0", - "p-filter": "^3.0.0", - "url-join": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } - }, - "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", - "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/@semantic-release/github/node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", - "dev": true, - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/github/node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/github/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-11.0.0.tgz", - "integrity": "sha512-ozNCiPUp14Xp2rgeY7j96yFTEhDncLSWOJr0IAUr888+ax6fH5xgYkNVv08vpkV8C5GIXBgnGd9coRiOCD6oqQ==", - "dev": true, - "dependencies": { - "@semantic-release/error": "^4.0.0", - "aggregate-error": "^5.0.0", - "execa": "^8.0.0", - "fs-extra": "^11.0.0", - "lodash-es": "^4.17.21", - "nerf-dart": "^1.0.0", - "normalize-url": "^8.0.0", - "npm": "^10.0.0", - "rc": "^1.2.8", - "read-pkg": "^8.0.0", - "registry-auth-token": "^5.0.0", - "semver": "^7.1.2", - "tempy": "^3.0.0" - }, - "engines": { - "node": "^18.17 || >=20" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } - }, - "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", - "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/@semantic-release/npm/node_modules/aggregate-error": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", - "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", - "dev": true, - "dependencies": { - "clean-stack": "^5.2.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/clean-stack": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", - "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", - "dev": true, - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/@semantic-release/npm/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/@semantic-release/npm/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-12.0.0.tgz", - "integrity": "sha512-m7Ds8ComP1KJgA2Lke2xMwE1TOOU40U7AzP4lT8hJ2tUAeicziPz/1GeDFmRkTOkMFlfHvE6kuvMkvU+mIzIDQ==", - "dev": true, - "dependencies": { - "conventional-changelog-angular": "^7.0.0", - "conventional-changelog-writer": "^7.0.0", - "conventional-commits-filter": "^4.0.0", - "conventional-commits-parser": "^5.0.0", - "debug": "^4.0.0", - "get-stream": "^7.0.0", - "import-from": "^4.0.0", - "into-stream": "^7.0.0", - "lodash-es": "^4.17.21", - "read-pkg-up": "^10.0.0" - }, - "engines": { - "node": "^18.17 || >=20.6.1" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@technologiestiftung/semantic-release-config": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@technologiestiftung/semantic-release-config/-/semantic-release-config-1.2.4.tgz", - "integrity": "sha512-MlZmQJEXbHjJN3uPnu4I2cIAmIQy94TVUamxLka9vRVKZrCKACMNp7dkmXEL++roj9SK5X2DAh+GvHn/LkaWgQ==", - "dev": true, - "dependencies": { - "@semantic-release/changelog": "6.0.3", - "@semantic-release/commit-analyzer": "11.0.0", - "@semantic-release/git": "10.0.1", - "@semantic-release/github": "9.0.5", - "@semantic-release/npm": "11.0.0", - "@semantic-release/release-notes-generator": "12.0.0", - "@technologiestiftung/semantic-release-config": "^1.0.0", - "lodash.merge": "4.6.2" - } - }, - "node_modules/@testing-library/dom": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", - "integrity": "sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^5.0.1", - "aria-query": "5.1.3", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.9", - "lz-string": "^1.5.0", - "pretty-format": "^27.0.2" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@testing-library/react": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", - "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.12.5", - "@testing-library/dom": "^9.0.0", - "@types/react-dom": "^18.0.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@types/aria-query": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", - "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "dev": true - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.6.8", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", - "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", - "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", - "dependencies": { - "@babel/types": "^7.20.7" - } - }, - "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" - }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/lodash": { - "version": "4.14.202", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", - "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", - "dev": true - }, - "node_modules/@types/lodash.debounce": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.9.tgz", - "integrity": "sha512-Ma5JcgTREwpLRwMM+XwBR7DaWe96nC38uCBDFKZWbNKD+osjVzdpnUSwBcqCptrp16sSOLBAUb50Car5I0TCsQ==", - "dev": true, - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/mdast": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", - "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" - }, - "node_modules/@types/nlcst": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.4.tgz", - "integrity": "sha512-ABoYdNQ/kBSsLvZAekMhIPMQ3YUZvavStpKYs7BjLLuKVmIMA0LUgZ7b54zzuWJRbHF80v1cNf4r90Vd6eMQDg==", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/@types/nlcst/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/@types/node": { - "version": "20.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", - "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", - "devOptional": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", - "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", - "dev": true - }, - "node_modules/@types/p5": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/@types/p5/-/p5-1.7.6.tgz", - "integrity": "sha512-6pLTOo0V3N5jZb5nTwjiv3lPHLK3Z/TjbhQUj8CTWXocUk1Z/f6OHTp3Pcwi1BhWnf5gqKUcyEb1gP0KIJuQgw==" - }, - "node_modules/@types/prop-types": { - "version": "15.7.11", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", - "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" - }, - "node_modules/@types/react": { - "version": "18.2.45", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz", - "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==", - "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" - } - }, - "node_modules/@types/react-dom": { - "version": "18.2.18", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz", - "integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==", - "dependencies": { - "@types/react": "*" - } - }, - "node_modules/@types/scheduler": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", - "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" - }, - "node_modules/@types/unist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", - "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" - }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - }, - "node_modules/@vitejs/plugin-react": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", - "integrity": "sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==", - "dependencies": { - "@babel/core": "^7.23.5", - "@babel/plugin-transform-react-jsx-self": "^7.23.3", - "@babel/plugin-transform-react-jsx-source": "^7.23.3", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.14.0" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0" - } - }, - "node_modules/@vitest/expect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.1.1.tgz", - "integrity": "sha512-Qpw01C2Hyb3085jBkOJLQ7HRX0Ncnh2qV4p+xWmmhcIUlMykUF69zsnZ1vPmAjZpomw9+5tWEGOQ0GTfR8U+kA==", - "dev": true, - "dependencies": { - "@vitest/spy": "1.1.1", - "@vitest/utils": "1.1.1", - "chai": "^4.3.10" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.1.1.tgz", - "integrity": "sha512-8HokyJo1SnSi3uPFKfWm/Oq1qDwLC4QDcVsqpXIXwsRPAg3gIDh8EbZ1ri8cmQkBxdOu62aOF9B4xcqJhvt4xQ==", - "dev": true, - "dependencies": { - "@vitest/utils": "1.1.1", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.1.1.tgz", - "integrity": "sha512-WnMHjv4VdHLbFGgCdVVvyRkRPnOKN75JJg+LLTdr6ah7YnL75W+7CTIMdzPEPzaDxA8r5yvSVlc1d8lH3yE28w==", - "dev": true, - "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@vitest/snapshot/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@vitest/snapshot/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, - "node_modules/@vitest/spy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.1.1.tgz", - "integrity": "sha512-hDU2KkOTfFp4WFFPWwHFauddwcKuGQ7gF6Un/ZZkCogoAiTMN7/7YKvUDbywPZZ754iCQGjdUmXN3t4k0jm1IQ==", - "dev": true, - "dependencies": { - "tinyspy": "^2.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.1.1.tgz", - "integrity": "sha512-E9LedH093vST/JuBSyHLFMpxJKW3dLhe/flUSPFedoyj4wKiFX7Jm8gYLtOIiin59dgrssfmFv0BJ1u8P/LC/A==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.6.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@vitest/utils/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@vitest/utils/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, - "node_modules/@volar/kit": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.4.tgz", - "integrity": "sha512-USRx/o0jKz7o8+lEKWMxWqbqvC46XFrf3IE6CZBYzRo9kM7RERQLwUYaoT2bOcHt5DQWublpnTgdgHMm37Gysg==", - "dependencies": { - "@volar/language-service": "2.0.4", - "@volar/typescript": "2.0.4", - "typesafe-path": "^0.2.2", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "typescript": "*" - } - }, - "node_modules/@volar/language-core": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.0.4.tgz", - "integrity": "sha512-VhC8i03P0x9LKGLTBi81xNTNWm40yxQ/Iba8IpH+LFr+Yb7c/D7fF90Cvf31MzPDM4G5rjIOlCfs+eQKPBkwQw==", - "dependencies": { - "@volar/source-map": "2.0.4" - } - }, - "node_modules/@volar/language-server": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/language-server/-/language-server-2.0.4.tgz", - "integrity": "sha512-VnljhooQjT6RhmvwwJK9+3YYs2ovFmav4IVNHiQgnTMfiOiyABzcghwvJrJrI39rJDI6LNOWF7BYUJq7K07BKQ==", - "dependencies": { - "@volar/language-core": "2.0.4", - "@volar/language-service": "2.0.4", - "@volar/snapshot-document": "2.0.4", - "@volar/typescript": "2.0.4", - "@vscode/l10n": "^0.0.16", - "path-browserify": "^1.0.1", - "request-light": "^0.7.0", - "vscode-languageserver": "^9.0.1", - "vscode-languageserver-protocol": "^3.17.5", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-uri": "^3.0.8" - } - }, - "node_modules/@volar/language-service": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.0.4.tgz", - "integrity": "sha512-DoanyU9I9Nl85lUytDl8jgyk+nrUDR5CFNVMrxWXGXclP4WTqBayBgSFAeF1L/5AwP3MywmWoK4GLAEVvl8D+Q==", - "dependencies": { - "@volar/language-core": "2.0.4", - "vscode-languageserver-protocol": "^3.17.5", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-uri": "^3.0.8" - } - }, - "node_modules/@volar/snapshot-document": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/snapshot-document/-/snapshot-document-2.0.4.tgz", - "integrity": "sha512-YzgdmvpdRFxiBFCOVWga67naAtbPtKmPaFtGnmxWx+KXrjGkpUXT/2tzeKn5FLdtoYV+DRTdpMdP/45ArnVwZQ==", - "dependencies": { - "vscode-languageserver-protocol": "^3.17.5", - "vscode-languageserver-textdocument": "^1.0.11" - } - }, - "node_modules/@volar/source-map": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.0.4.tgz", - "integrity": "sha512-BbxUinEMoJZqrHsSj1aBa0boCBnN3BoXnf7j9IBwjxosxGXOhCvqmH2L9raJemadaKjeVR8ZQLhV7AOhyoHt/Q==", - "dependencies": { - "muggle-string": "^0.4.0" - } - }, - "node_modules/@volar/typescript": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.0.4.tgz", - "integrity": "sha512-KF7yh7GIo4iWuAQOKf/ONeFHdQA+wFriitW8LtGZB4iOOT6MdlRlYNsRL8do7XxmXvsBKcs4jTMtGn+uZRwlWg==", - "dependencies": { - "@volar/language-core": "2.0.4", - "path-browserify": "^1.0.1" - } - }, - "node_modules/@vscode/emmet-helper": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.9.2.tgz", - "integrity": "sha512-MaGuyW+fa13q3aYsluKqclmh62Hgp0BpKIqS66fCxfOaBcVQ1OnMQxRRgQUYnCkxFISAQlkJ0qWWPyXjro1Qrg==", - "dependencies": { - "emmet": "^2.4.3", - "jsonc-parser": "^2.3.0", - "vscode-languageserver-textdocument": "^1.0.1", - "vscode-languageserver-types": "^3.15.1", - "vscode-uri": "^2.1.2" - } - }, - "node_modules/@vscode/emmet-helper/node_modules/jsonc-parser": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", - "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" - }, - "node_modules/@vscode/emmet-helper/node_modules/vscode-uri": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", - "integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==" - }, - "node_modules/@vscode/l10n": { - "version": "0.0.16", - "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.16.tgz", - "integrity": "sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==" - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", - "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", - "dev": true, - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/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==", - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/ansi-align/node_modules/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==" - }, - "node_modules/ansi-align/node_modules/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==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-align/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-escapes": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", - "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "peer": true - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/argv-formatter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", - "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", - "dev": true, - "peer": true - }, - "node_modules/aria-query": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", - "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", - "dev": true, - "dependencies": { - "deep-equal": "^2.0.5" - } - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", - "dev": true - }, - "node_modules/array-iterate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", - "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/astro": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.1.0.tgz", - "integrity": "sha512-xbLWqvMn2JFyv7FpzHiXFn17bRS0P/b4cdEPXMMZOpBI9V8ZC33o6Xs+c59/pYSZpYiNd1HTg778XT5MhcpyKw==", - "dependencies": { - "@astrojs/compiler": "^2.3.4", - "@astrojs/internal-helpers": "0.2.1", - "@astrojs/markdown-remark": "4.0.1", - "@astrojs/telemetry": "3.0.4", - "@babel/core": "^7.23.3", - "@babel/generator": "^7.23.3", - "@babel/parser": "^7.23.3", - "@babel/plugin-transform-react-jsx": "^7.22.5", - "@babel/traverse": "^7.23.3", - "@babel/types": "^7.23.3", - "@types/babel__core": "^7.20.4", - "acorn": "^8.11.2", - "aria-query": "^5.3.0", - "axobject-query": "^4.0.0", - "boxen": "^7.1.1", - "chokidar": "^3.5.3", - "ci-info": "^4.0.0", - "clsx": "^2.0.0", - "common-ancestor-path": "^1.0.1", - "cookie": "^0.6.0", - "debug": "^4.3.4", - "deterministic-object-hash": "^2.0.1", - "devalue": "^4.3.2", - "diff": "^5.1.0", - "dlv": "^1.1.3", - "dset": "^3.1.3", - "es-module-lexer": "^1.4.1", - "esbuild": "^0.19.6", - "estree-walker": "^3.0.3", - "execa": "^8.0.1", - "fast-glob": "^3.3.2", - "flattie": "^1.1.0", - "github-slugger": "^2.0.0", - "gray-matter": "^4.0.3", - "html-escaper": "^3.0.3", - "http-cache-semantics": "^4.1.1", - "js-yaml": "^4.1.0", - "kleur": "^4.1.4", - "magic-string": "^0.30.3", - "mdast-util-to-hast": "13.0.2", - "mime": "^3.0.0", - "ora": "^7.0.1", - "p-limit": "^5.0.0", - "p-queue": "^8.0.1", - "path-to-regexp": "^6.2.1", - "preferred-pm": "^3.1.2", - "probe-image-size": "^7.2.3", - "prompts": "^2.4.2", - "rehype": "^13.0.1", - "resolve": "^1.22.4", - "semver": "^7.5.4", - "server-destroy": "^1.0.1", - "shikiji": "^0.6.13", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0", - "tsconfck": "^3.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.1", - "vite": "^5.0.10", - "vitefu": "^0.2.5", - "which-pm": "^2.1.1", - "yargs-parser": "^21.1.1", - "zod": "^3.22.4" - }, - "bin": { - "astro": "astro.js" - }, - "engines": { - "node": ">=18.14.1", - "npm": ">=6.14.0" - }, - "optionalDependencies": { - "sharp": "^0.33.1" - } - }, - "node_modules/astro/node_modules/aria-query": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", - "dependencies": { - "dequal": "^2.0.3" - } - }, - "node_modules/astro/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/astro/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/astro/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/astro/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/astro/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/astro/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/astro/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/astro/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/astro/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/astro/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/axobject-query": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", - "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", - "dependencies": { - "dequal": "^2.0.3" - } - }, - "node_modules/bail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base-64": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", - "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/before-after-hook": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", - "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/bottleneck": { - "version": "2.19.5", - "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", - "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", - "dev": true - }, - "node_modules/boxen": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", - "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", - "dependencies": { - "ansi-align": "^3.0.1", - "camelcase": "^7.0.1", - "chalk": "^5.2.0", - "cli-boxes": "^3.0.0", - "string-width": "^5.1.2", - "type-fest": "^2.13.0", - "widest-line": "^4.0.1", - "wrap-ansi": "^8.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/boxen/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "node_modules/boxen/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", - "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001591", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", - "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ] - }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", - "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/character-entities": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-html4": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", - "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", - "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.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" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/ci-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", - "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cli-boxes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", - "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "dev": true, - "peer": true, - "dependencies": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - }, - "bin": { - "highlight": "bin/highlight" - }, - "engines": { - "node": ">=8.0.0", - "npm": ">=5.0.0" - } - }, - "node_modules/cli-highlight/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cli-highlight/node_modules/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, - "peer": true - }, - "node_modules/cli-highlight/node_modules/parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true, - "peer": true - }, - "node_modules/cli-highlight/node_modules/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, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-highlight/node_modules/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, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-highlight/node_modules/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, - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/cli-highlight/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "peer": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cli-highlight/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", - "dev": true, - "peer": true, - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/cli-table3/node_modules/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, - "peer": true - }, - "node_modules/cli-table3/node_modules/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, - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-table3/node_modules/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, - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cliui/node_modules/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==" - }, - "node_modules/cliui/node_modules/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==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/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==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/clsx": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", - "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "optional": true, - "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" - }, - "engines": { - "node": ">=12.5.0" - } - }, - "node_modules/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==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/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==" - }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "optional": true, - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/comma-separated-tokens": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", - "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/common-ancestor-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", - "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==" - }, - "node_modules/compare-func": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", - "dev": true, - "dependencies": { - "array-ify": "^1.0.0", - "dot-prop": "^5.1.0" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "dev": true, - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "node_modules/conventional-changelog-angular": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", - "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", - "dev": true, - "dependencies": { - "compare-func": "^2.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/conventional-changelog-writer": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.1.tgz", - "integrity": "sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==", - "dev": true, - "dependencies": { - "conventional-commits-filter": "^4.0.0", - "handlebars": "^4.7.7", - "json-stringify-safe": "^5.0.1", - "meow": "^12.0.1", - "semver": "^7.5.2", - "split2": "^4.0.0" - }, - "bin": { - "conventional-changelog-writer": "cli.mjs" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/conventional-commits-filter": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-4.0.0.tgz", - "integrity": "sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==", - "dev": true, - "engines": { - "node": ">=16" - } - }, - "node_modules/conventional-commits-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", - "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", - "dev": true, - "dependencies": { - "is-text-path": "^2.0.0", - "JSONStream": "^1.3.5", - "meow": "^12.0.1", - "split2": "^4.0.0" - }, - "bin": { - "conventional-commits-parser": "cli.mjs" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" - }, - "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/cosmiconfig": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", - "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", - "dev": true, - "peer": true, - "dependencies": { - "env-paths": "^2.2.1", - "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", - "parse-json": "^5.2.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - }, - "peerDependencies": { - "typescript": ">=4.9.5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/cosmiconfig/node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "peer": true - }, - "node_modules/cosmiconfig/node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "peer": true - }, - "node_modules/cosmiconfig/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/crypto-random-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", - "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", - "dev": true, - "dependencies": { - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/crypto-random-string/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", - "dev": true, - "dependencies": { - "rrweb-cssom": "^0.6.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/csstype": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" - }, - "node_modules/data-urls": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", - "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", - "dev": true, - "dependencies": { - "whatwg-mimetype": "^4.0.0", - "whatwg-url": "^14.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decimal.js": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true - }, - "node_modules/decode-named-character-reference": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", - "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", - "dependencies": { - "character-entities": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/deep-equal": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", - "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.5", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.2", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/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, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", - "dev": true - }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/deterministic-object-hash": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", - "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", - "dependencies": { - "base-64": "^1.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/devalue": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.2.tgz", - "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==" - }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", - "dependencies": { - "dequal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dlv": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" - }, - "node_modules/dom-accessibility-api": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", - "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "dev": true - }, - "node_modules/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, - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dset": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", - "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", - "dev": true, - "peer": true, - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "node_modules/electron-to-chromium": { - "version": "1.4.685", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.685.tgz", - "integrity": "sha512-yDYeobbTEe4TNooEzOQO6xFqg9XnAkVy2Lod1C1B2it8u47JNLYvl9nLDWBamqUakWB8Jc1hhS1uHUNYTNQdfw==" - }, - "node_modules/emmet": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.6.tgz", - "integrity": "sha512-dJfbdY/hfeTyf/Ef7Y7ubLYzkBvPQ912wPaeVYpAxvFxkEBf/+hJu4H6vhAvFN6HlxqedlfVn2x1S44FfQ97pg==", - "dependencies": { - "@emmetio/abbreviation": "^2.3.3", - "@emmetio/css-abbreviation": "^2.1.8" - } - }, - "node_modules/emoji-regex": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", - "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" - }, - "node_modules/emojilib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", - "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", - "dev": true, - "peer": true - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/env-ci": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.0.0.tgz", - "integrity": "sha512-apikxMgkipkgTvMdRT9MNqWx5VLOci79F4VBd7Op/7OPjjoanjdAvn6fglMCCEf/1bAh8eOiuEVCUs4V3qP3nQ==", - "dev": true, - "peer": true, - "dependencies": { - "execa": "^8.0.0", - "java-properties": "^1.0.2" - }, - "engines": { - "node": "^18.17 || >=20.6.1" - } - }, - "node_modules/env-ci/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "peer": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/env-ci/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/env-ci/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "peer": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-ci/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/env-ci/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" - }, - "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" - } - }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/execa/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/figures": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", - "integrity": "sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==", - "dev": true, - "peer": true, - "dependencies": { - "is-unicode-supported": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/figures/node_modules/is-unicode-supported": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", - "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/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==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-up-simple": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", - "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-versions": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", - "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", - "dev": true, - "peer": true, - "dependencies": { - "semver-regex": "^4.0.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-yarn-workspace-root2": { - "version": "1.2.16", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", - "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", - "dependencies": { - "micromatch": "^4.0.2", - "pkg-dir": "^4.2.0" - } - }, - "node_modules/flattie": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.0.tgz", - "integrity": "sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-east-asian-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", - "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-stream": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", - "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/git-log-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", - "integrity": "sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==", - "dev": true, - "peer": true, - "dependencies": { - "argv-formatter": "~1.0.0", - "spawn-error-forwarder": "~1.0.0", - "split2": "~1.0.0", - "stream-combiner2": "~1.1.1", - "through2": "~2.0.0", - "traverse": "~0.6.6" - } - }, - "node_modules/git-log-parser/node_modules/split2": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", - "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", - "dev": true, - "peer": true, - "dependencies": { - "through2": "~2.0.0" - } - }, - "node_modules/github-slugger": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", - "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "dev": true, - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", - "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/handlebars": { - "version": "4.7.8", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", - "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hast-util-from-html": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz", - "integrity": "sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==", - "dependencies": { - "@types/hast": "^3.0.0", - "devlop": "^1.1.0", - "hast-util-from-parse5": "^8.0.0", - "parse5": "^7.0.0", - "vfile": "^6.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-from-parse5": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", - "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "devlop": "^1.0.0", - "hastscript": "^8.0.0", - "property-information": "^6.0.0", - "vfile": "^6.0.0", - "vfile-location": "^5.0.0", - "web-namespaces": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-parse-selector": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", - "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-raw": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.2.tgz", - "integrity": "sha512-PldBy71wO9Uq1kyaMch9AHIghtQvIwxBUkv823pKmkTM3oV1JxtsTNYdevMxvUHqcnOAuO65JKU2+0NOxc2ksA==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "@ungap/structured-clone": "^1.0.0", - "hast-util-from-parse5": "^8.0.0", - "hast-util-to-parse5": "^8.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "parse5": "^7.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-html": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", - "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-raw": "^9.0.0", - "hast-util-whitespace": "^3.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "stringify-entities": "^4.0.0", - "zwitch": "^2.0.4" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-parse5": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", - "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", - "dependencies": { - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "devlop": "^1.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "web-namespaces": "^2.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-whitespace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", - "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hastscript": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", - "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", - "dependencies": { - "@types/hast": "^3.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-parse-selector": "^4.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", - "dev": true, - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/hook-std": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", - "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hosted-git-info": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", - "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", - "dev": true, - "dependencies": { - "lru-cache": "^10.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/hosted-git-info/node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/html-encoding-sniffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", - "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^3.1.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/html-escaper": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", - "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" - }, - "node_modules/html-void-elements": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", - "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", - "dev": true, - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "peer": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", - "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", - "dev": true, - "engines": { - "node": ">=12.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-from-esm": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.3.tgz", - "integrity": "sha512-U3Qt/CyfFpTUv6LOP2jRTLYjphH6zg3okMfHbyqRa/W2w6hr8OsJWVggNlR4jxuojQy81TgTJTxgSkyoteRGMQ==", - "dev": true, - "peer": true, - "dependencies": { - "debug": "^4.3.4", - "import-meta-resolve": "^4.0.0" - }, - "engines": { - "node": ">=16.20" - } - }, - "node_modules/import-meta-resolve": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", - "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/index-to-position": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", - "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/into-stream": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", - "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", - "dev": true, - "dependencies": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/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==", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dependencies": { - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-docker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/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==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-inside-container": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", - "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", - "dependencies": { - "is-docker": "^3.0.0" - }, - "bin": { - "is-inside-container": "cli.js" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-text-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", - "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", - "dev": true, - "dependencies": { - "text-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-wsl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", - "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", - "dependencies": { - "is-inside-container": "^1.0.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/issue-parser": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", - "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", - "dev": true, - "dependencies": { - "lodash.capitalize": "^4.2.1", - "lodash.escaperegexp": "^4.1.2", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.uniqby": "^4.7.0" - }, - "engines": { - "node": ">=10.13" - } - }, - "node_modules/java-properties": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", - "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsdom": { - "version": "23.0.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz", - "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==", - "dev": true, - "dependencies": { - "cssstyle": "^3.0.0", - "data-urls": "^5.0.0", - "decimal.js": "^10.4.3", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^4.0.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.7", - "parse5": "^7.1.2", - "rrweb-cssom": "^0.6.0", - "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.3", - "w3c-xmlserializer": "^5.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^3.1.1", - "whatwg-mimetype": "^4.0.0", - "whatwg-url": "^14.0.0", - "ws": "^8.14.2", - "xml-name-validator": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "canvas": "^2.11.2" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true, - "peer": true - }, - "node_modules/json-parse-even-better-errors": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz", - "integrity": "sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", - "dev": true, - "engines": [ - "node >= 0.2.0" - ] - }, - "node_modules/JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "dependencies": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - }, - "bin": { - "JSONStream": "bin.js" - }, - "engines": { - "node": "*" - } - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/lines-and-columns": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", - "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", - "dev": true, - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/load-json-file/node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", - "dev": true, - "peer": true, - "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/load-yaml-file": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", - "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", - "dependencies": { - "graceful-fs": "^4.1.5", - "js-yaml": "^3.13.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/load-yaml-file/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/load-yaml-file/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/load-yaml-file/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "engines": { - "node": ">=6" - } - }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "dev": true - }, - "node_modules/lodash.capitalize": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", - "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", - "dev": true - }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" - }, - "node_modules/lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", - "dev": true - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "dev": true - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "node_modules/lodash.uniqby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", - "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", - "dev": true - }, - "node_modules/log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", - "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/longest-streak": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", - "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/lz-string": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", - "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", - "dev": true, - "bin": { - "lz-string": "bin/bin.js" - } - }, - "node_modules/magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/markdown-table": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", - "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/marked": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", - "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", - "dev": true, - "peer": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/marked-terminal": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.0.0.tgz", - "integrity": "sha512-sNEx8nn9Ktcm6pL0TnRz8tnXq/mSS0Q1FRSwJOAqw4lAB4l49UeDf85Gm1n9RPFm5qurCPjwi1StAQT2XExhZw==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-escapes": "^6.2.0", - "chalk": "^5.3.0", - "cli-highlight": "^2.1.11", - "cli-table3": "^0.6.3", - "node-emoji": "^2.1.3", - "supports-hyperlinks": "^3.0.0" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "marked": ">=1 <13" - } - }, - "node_modules/marked-terminal/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/mdast-util-definitions": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", - "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "unist-util-visit": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-find-and-replace": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", - "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", - "dependencies": { - "@types/mdast": "^4.0.0", - "escape-string-regexp": "^5.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-from-markdown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", - "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark": "^4.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-decode-string": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", - "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", - "dependencies": { - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-gfm-autolink-literal": "^2.0.0", - "mdast-util-gfm-footnote": "^2.0.0", - "mdast-util-gfm-strikethrough": "^2.0.0", - "mdast-util-gfm-table": "^2.0.0", - "mdast-util-gfm-task-list-item": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-autolink-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", - "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", - "dependencies": { - "@types/mdast": "^4.0.0", - "ccount": "^2.0.0", - "devlop": "^1.0.0", - "mdast-util-find-and-replace": "^3.0.0", - "micromark-util-character": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-footnote": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", - "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.1.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", - "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "markdown-table": "^3.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-task-list-item": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", - "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-phrasing": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", - "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", - "dependencies": { - "@types/mdast": "^4.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-hast": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", - "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@ungap/structured-clone": "^1.0.0", - "devlop": "^1.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "trim-lines": "^3.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-markdown": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", - "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "longest-streak": "^3.0.0", - "mdast-util-phrasing": "^4.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark-util-decode-string": "^2.0.0", - "unist-util-visit": "^5.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", - "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", - "dependencies": { - "@types/mdast": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/meow": { - "version": "12.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", - "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", - "dev": true, - "engines": { - "node": ">=16.10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromark": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", - "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-core-commonmark": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", - "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-factory-destination": "^2.0.0", - "micromark-factory-label": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-factory-title": "^2.0.0", - "micromark-factory-whitespace": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-html-tag-name": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-gfm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", - "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", - "dependencies": { - "micromark-extension-gfm-autolink-literal": "^2.0.0", - "micromark-extension-gfm-footnote": "^2.0.0", - "micromark-extension-gfm-strikethrough": "^2.0.0", - "micromark-extension-gfm-table": "^2.0.0", - "micromark-extension-gfm-tagfilter": "^2.0.0", - "micromark-extension-gfm-task-list-item": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", - "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-footnote": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", - "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", - "dependencies": { - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", - "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-tagfilter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", - "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", - "dependencies": { - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-task-list-item": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", - "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-factory-destination": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", - "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-label": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", - "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-space": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", - "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-title": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", - "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-whitespace": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", - "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-character": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", - "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-chunked": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", - "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-classify-character": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", - "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-combine-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", - "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-chunked": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", - "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", - "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", - "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-html-tag-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", - "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-normalize-identifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", - "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-resolve-all": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", - "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", - "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-subtokenize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", - "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-symbol": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", - "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromark-util-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", - "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ] - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "dev": true, - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/mlly": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", - "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.0.3", - "ufo": "^1.3.2" - } - }, - "node_modules/monaco-editor": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.46.0.tgz", - "integrity": "sha512-ADwtLIIww+9FKybWscd7OCfm9odsFYHImBRI1v9AviGce55QY8raT+9ihH8jX/E/e6QVSGM+pKj4jSUSRmALNQ==", - "peer": true - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/muggle-string": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", - "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==" - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "peer": true, - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/needle": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", - "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", - "dependencies": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "bin": { - "needle": "bin/needle" - }, - "engines": { - "node": ">= 4.4.x" - } - }, - "node_modules/needle/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/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==", - "dev": true - }, - "node_modules/nerf-dart": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", - "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", - "dev": true - }, - "node_modules/netlify-cli": { - "version": "17.10.2", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.10.2.tgz", - "integrity": "sha512-pKXL+w5/vm4ld6IUotBEse3KvN4+WCComLP6a73OiOvy8uM6uxtDUiuL+uAhRaozohjjaU/Ym4q1TqwbqWF5rA==", - "dev": true, - "hasInstallScript": true, - "hasShrinkwrap": true, - "dependencies": { - "@bugsnag/js": "7.20.2", - "@fastify/static": "6.10.2", - "@netlify/blobs": "6.3.1", - "@netlify/build": "29.31.0", - "@netlify/build-info": "7.11.3", - "@netlify/config": "20.10.0", - "@netlify/edge-bundler": "10.1.3", - "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.28.1", - "@octokit/rest": "19.0.13", - "ansi-escapes": "6.2.0", - "ansi-styles": "6.2.1", - "ansi-to-html": "0.7.2", - "ascii-table": "0.0.9", - "backoff": "2.5.0", - "better-opn": "3.0.2", - "boxen": "7.1.1", - "chalk": "5.2.0", - "chokidar": "3.5.3", - "ci-info": "3.8.0", - "clean-deep": "3.4.0", - "commander": "10.0.1", - "comment-json": "4.2.3", - "concordance": "5.0.4", - "configstore": "6.0.0", - "content-type": "1.0.5", - "cookie": "0.5.0", - "copy-template-dir": "1.4.0", - "cron-parser": "4.8.1", - "debug": "4.3.4", - "decache": "4.6.2", - "dot-prop": "7.2.0", - "dotenv": "16.0.3", - "env-paths": "3.0.0", - "envinfo": "7.8.1", - "etag": "1.8.1", - "execa": "5.1.1", - "express": "4.18.2", - "express-logging": "1.1.1", - "extract-zip": "2.0.1", - "fastest-levenshtein": "1.0.16", - "fastify": "4.17.0", - "find-up": "6.3.0", - "flush-write-stream": "2.0.0", - "folder-walker": "3.2.0", - "from2-array": "0.0.4", - "fuzzy": "0.1.3", - "get-port": "5.1.1", - "gh-release-fetch": "4.0.3", - "git-repo-info": "2.1.1", - "gitconfiglocal": "2.1.0", - "hasbin": "1.2.3", - "hasha": "5.2.2", - "http-proxy": "1.18.1", - "http-proxy-middleware": "2.0.6", - "https-proxy-agent": "5.0.1", - "inquirer": "6.5.2", - "inquirer-autocomplete-prompt": "1.4.0", - "ipx": "2.0.1", - "is-docker": "3.0.0", - "is-stream": "3.0.0", - "is-wsl": "2.2.0", - "isexe": "2.0.0", - "js-yaml": "4.1.0", - "jsonwebtoken": "9.0.1", - "jwt-decode": "3.1.2", - "lambda-local": "2.1.2", - "listr2": "7.0.2", - "locate-path": "7.2.0", - "lodash": "4.17.21", - "log-symbols": "5.1.0", - "log-update": "5.0.1", - "multiparty": "4.2.3", - "netlify": "13.1.11", - "netlify-headers-parser": "7.1.2", - "netlify-redirect-parser": "14.2.0", - "netlify-redirector": "0.5.0", - "node-fetch": "2.6.12", - "node-version-alias": "3.4.1", - "ora": "6.3.1", - "p-filter": "3.0.0", - "p-map": "5.5.0", - "p-wait-for": "5.0.2", - "parallel-transform": "1.2.0", - "parse-github-url": "1.0.2", - "parse-gitignore": "2.0.0", - "path-key": "4.0.0", - "prettyjson": "1.2.5", - "pump": "3.0.0", - "raw-body": "2.5.2", - "read-pkg-up": "9.1.0", - "semver": "7.5.4", - "source-map-support": "0.5.21", - "strip-ansi-control-characters": "2.0.0", - "tabtab": "3.0.2", - "tempy": "3.0.0", - "terminal-link": "3.0.0", - "through2-filter": "3.0.0", - "through2-map": "3.0.0", - "to-readable-stream": "3.0.0", - "toml": "3.0.0", - "tomlify-j0.4": "3.0.0", - "ulid": "2.3.0", - "unixify": "1.0.0", - "update-notifier": "6.0.2", - "uuid": "9.0.0", - "wait-port": "1.0.4", - "write-file-atomic": "5.0.1", - "ws": "8.14.2", - "zod": "3.22.4" - }, - "bin": { - "netlify": "bin/run.js", - "ntl": "bin/run.js" - }, - "engines": { - "node": ">=18.14.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/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, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/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, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", - "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@bugsnag/browser": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz", - "integrity": "sha512-4J4s53ZpYr3hHA+QjxUjOI6U+A8+XuUVH45UshE87Jp2Y4mV8ML2DovejqJS8J8yjdbnh2z1Wtg/v3WUNt4ayQ==", - "dev": true, - "dependencies": { - "@bugsnag/core": "^7.19.0" - } - }, - "node_modules/netlify-cli/node_modules/@bugsnag/core": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz", - "integrity": "sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==", - "dev": true, - "dependencies": { - "@bugsnag/cuid": "^3.0.0", - "@bugsnag/safe-json-stringify": "^6.0.0", - "error-stack-parser": "^2.0.3", - "iserror": "0.0.2", - "stack-generator": "^2.0.3" - } - }, - "node_modules/netlify-cli/node_modules/@bugsnag/cuid": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz", - "integrity": "sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@bugsnag/js": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.2.tgz", - "integrity": "sha512-Q08k0h0h6NFwFGkFmib39Uln2WpvJdqT1EGF1JlyYiGW03Y+VopVb9r37pZrRrN9IY08mxaIEO8la5xeaWAs6A==", - "dev": true, - "dependencies": { - "@bugsnag/browser": "^7.20.2", - "@bugsnag/node": "^7.19.0" - } - }, - "node_modules/netlify-cli/node_modules/@bugsnag/node": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.19.0.tgz", - "integrity": "sha512-c4snyxx5d/fsMogmgehFBGc//daH6+4XCplia4zrEQYltjaQ+l8ud0dPx623DgJl/2j1+2zlRc7y7IHSd7Gm5w==", - "dev": true, - "dependencies": { - "@bugsnag/core": "^7.19.0", - "byline": "^5.0.0", - "error-stack-parser": "^2.0.2", - "iserror": "^0.0.2", - "pump": "^3.0.0", - "stack-generator": "^2.0.3" - } - }, - "node_modules/netlify-cli/node_modules/@bugsnag/safe-json-stringify": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz", - "integrity": "sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/netlify-cli/node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@dabh/diagnostics": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", - "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", - "dev": true, - "dependencies": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@dependents/detective-less": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.0.0.tgz", - "integrity": "sha512-0udn+HKjGUzTX4Z+0vXdEJVsO28gxy5QxWjeChK4ZH+bwdvIXLuztiGZk8wLyAG1+LNZ5haVHKr5j1XfJnAkyQ==", - "dev": true, - "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/accept-negotiator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", - "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", - "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==", - "dev": true, - "dependencies": { - "ajv": "^8.11.0", - "ajv-formats": "^2.1.1", - "fast-uri": "^2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", - "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@fastify/error": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", - "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", - "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", - "dev": true, - "dependencies": { - "fast-json-stringify": "^5.7.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/send": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.0.1.tgz", - "integrity": "sha512-8jdouu0o5d0FMq1+zCKeKXc1tmOQ5tTGYdQP3MpyF9+WWrZT1KCBdh6hvoEYxOm3oJG/akdE9BpehLiJgYRvGw==", - "dev": true, - "dependencies": { - "@lukeed/ms": "^2.0.1", - "escape-html": "~1.0.3", - "fast-decode-uri-component": "^1.0.1", - "http-errors": "2.0.0", - "mime": "^3.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.10.2.tgz", - "integrity": "sha512-UoaMvIHSBLCZBYOVZwFRYqX2ufUhd7FFMYGDeSf0Z+D8jhYtwljjmuQGuanUP8kS4y/ZEV1a8mfLha3zNwsnnQ==", - "dev": true, - "dependencies": { - "@fastify/accept-negotiator": "^1.0.0", - "@fastify/send": "^2.0.0", - "content-disposition": "^0.5.3", - "fastify-plugin": "^4.0.0", - "glob": "^8.0.1", - "p-limit": "^3.1.0", - "readable-stream": "^4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", - "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", - "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.2.tgz", - "integrity": "sha512-Lf2pUhNTaviEdEaGgjU+29qw3arX7Qd/45q66F3z1EV5hroE6wM9xSHPvjB8EY+b1RmKZgwnLWXQorC6fZ9g5g==", - "dev": true, - "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.9.tgz", - "integrity": "sha512-YJsOehVXzgurc+lLAxYnlSMc1p/Gu6VAvnfx0ATi2nzvr0YZcjhmZDeY8SeAKv1M7zE3aEJH0Xo9mK1iZ8GYoQ==", - "dev": true, - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.2.4", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/@honeycombio/opentelemetry-node": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@honeycombio/opentelemetry-node/-/opentelemetry-node-0.5.0.tgz", - "integrity": "sha512-bAg//j0Lh0SFC0LhUrrgpO4FVScOBDt+my4YXeIo9lHi1aXXn6meaB/ycecjVfjyQLaGYWKPKu2C66rTgKIzMQ==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.3", - "@opentelemetry/api": "^1.4.1", - "@opentelemetry/core": "^1.13.0", - "@opentelemetry/exporter-metrics-otlp-grpc": "^0.41.0", - "@opentelemetry/exporter-metrics-otlp-proto": "^0.39.1", - "@opentelemetry/exporter-trace-otlp-grpc": "^0.41.0", - "@opentelemetry/exporter-trace-otlp-proto": "^0.41.0", - "@opentelemetry/resources": "^1.13.0", - "@opentelemetry/sdk-metrics": "^1.13.0", - "@opentelemetry/sdk-node": "^0.39.1", - "@opentelemetry/sdk-trace-base": "^1.13.0", - "axios": "^1.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", - "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", - "dev": true, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/netlify-cli/node_modules/@import-maps/resolve": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@import-maps/resolve/-/resolve-1.0.1.tgz", - "integrity": "sha512-tWZNBIS1CoekcwlMuyG2mr0a1Wo5lb5lEHwwWvZo+5GLgr3e9LLDTtmgtCWEwBpXMkxn9D+2W9j2FY6eZQq0tA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@ioredis/commands": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", - "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@jest/types": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", - "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^16.0.0", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/netlify-cli/node_modules/@lukeed/ms": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", - "integrity": "sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", - "dev": true, - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/binary-info": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@netlify/binary-info/-/binary-info-1.0.0.tgz", - "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.1.tgz", - "integrity": "sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg==", - "dev": true, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.31.0", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.31.0.tgz", - "integrity": "sha512-XtUXnj3LtdWxcgP4kz1k0creF9bZa7eGNh85B89sw4V99Mtsn1Sl89yAZJkEH6rtuGJIs1eiQ261nlhUZ6+C6Q==", - "dev": true, - "dependencies": { - "@bugsnag/js": "^7.0.0", - "@honeycombio/opentelemetry-node": "^0.5.0", - "@netlify/blobs": "^6.3.1", - "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.10.0", - "@netlify/edge-bundler": "10.1.3", - "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.45", - "@netlify/git-utils": "^5.1.1", - "@netlify/plugins-list": "^6.72.0", - "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.28.1", - "@opentelemetry/api": "^1.4.1", - "@opentelemetry/core": "^1.17.1", - "@sindresorhus/slugify": "^2.0.0", - "ansi-escapes": "^6.0.0", - "chalk": "^5.0.0", - "clean-stack": "^4.0.0", - "execa": "^6.0.0", - "fdir": "^6.0.1", - "figures": "^5.0.0", - "filter-obj": "^5.0.0", - "got": "^12.0.0", - "hot-shots": "10.0.0", - "indent-string": "^5.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "keep-func-props": "^4.0.0", - "locate-path": "^7.0.0", - "log-process-errors": "^8.0.0", - "map-obj": "^5.0.0", - "memoize-one": "^6.0.0", - "node-fetch": "^3.3.2", - "os-name": "^5.0.0", - "p-event": "^5.0.0", - "p-every": "^2.0.0", - "p-filter": "^3.0.0", - "p-locate": "^6.0.0", - "p-map": "^6.0.0", - "p-reduce": "^3.0.0", - "path-exists": "^5.0.0", - "path-type": "^5.0.0", - "pkg-dir": "^7.0.0", - "pretty-ms": "^8.0.0", - "ps-list": "^8.0.0", - "read-pkg-up": "^9.0.0", - "readdirp": "^3.4.0", - "resolve": "^2.0.0-next.1", - "rfdc": "^1.3.0", - "safe-json-stringify": "^1.2.0", - "semver": "^7.3.8", - "string-width": "^5.0.0", - "strip-ansi": "^7.0.0", - "supports-color": "^9.0.0", - "terminal-link": "^3.0.0", - "ts-node": "^10.9.1", - "typescript": "^5.0.0", - "uuid": "^9.0.0", - "yargs": "^17.6.0" - }, - "bin": { - "netlify-build": "bin.js" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - }, - "peerDependencies": { - "@netlify/opentelemetry-sdk-setup": "^1.0.1" - }, - "peerDependenciesMeta": { - "@netlify/opentelemetry-sdk-setup": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.11.3", - "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.11.3.tgz", - "integrity": "sha512-lnJsJcoFSZIIB+4tOU/rdPjPn2+TP896B9y23z5THyACeN/e2I0Y7Y+d+BzHgFDcJBwqFpIehEs2jf8wPb9CHw==", - "dev": true, - "dependencies": { - "@bugsnag/js": "^7.20.0", - "dot-prop": "^7.2.0", - "find-up": "^6.3.0", - "minimatch": "^9.0.0", - "read-pkg": "^7.1.0", - "semver": "^7.3.8", - "toml": "^3.0.0", - "yaml": "^2.1.3", - "yargs": "^17.6.0" - }, - "bin": { - "build-info": "bin.js" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", - "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.1", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^2.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/core": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.18.1.tgz", - "integrity": "sha512-kvnUqezHMhsQvdsnhnqTNfAJs3ox/isB0SVrM1dhVFw7SsB7TstuVa6fgWnN2GdPyilIFLUvvbTZoVRmx6eiRg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.18.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.8.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.18.1.tgz", - "integrity": "sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/figures": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", - "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-map": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", - "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-type": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/pkg-dir": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", - "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", - "dev": true, - "dependencies": { - "find-up": "^6.3.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.5.tgz", - "integrity": "sha512-lMNdFmy2Yu3oVquSPooRDLxJ8QOsIX6X6vzA2pKz/9V2LQFJiqBukggXM+Rnqzk1regPpdJ0jK3dPGvOKaRQgg==", - "dev": true, - "dependencies": { - "cpy": "^9.0.0", - "get-stream": "^6.0.0", - "globby": "^13.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "move-file": "^3.0.0", - "path-exists": "^5.0.0", - "readdirp": "^3.4.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "dev": true, - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.10.0", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.0.tgz", - "integrity": "sha512-7CNoL5IPSRBzDVzxuQgltZ71D/vZ/oYR29sfN8EXjAFOZPSLtnZgborcPa9V9BXLN4N5h0hFp2A26lnnCttEFg==", - "dev": true, - "dependencies": { - "chalk": "^5.0.0", - "cron-parser": "^4.1.0", - "deepmerge": "^4.2.2", - "dot-prop": "^7.0.0", - "execa": "^6.0.0", - "fast-safe-stringify": "^2.0.7", - "figures": "^5.0.0", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "indent-string": "^5.0.0", - "is-plain-obj": "^4.0.0", - "js-yaml": "^4.0.0", - "map-obj": "^5.0.0", - "netlify": "^13.1.11", - "netlify-headers-parser": "^7.1.2", - "netlify-redirect-parser": "^14.2.0", - "node-fetch": "^3.3.1", - "omit.js": "^2.0.2", - "p-locate": "^6.0.0", - "path-type": "^5.0.0", - "toml": "^3.0.0", - "tomlify-j0.4": "^3.0.0", - "validate-npm-package-name": "^4.0.0", - "yargs": "^17.6.0" - }, - "bin": { - "netlify-config": "bin.js" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/figures": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", - "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-10.1.3.tgz", - "integrity": "sha512-+cFFUrdbkhbtmpvQlRam4CmNguKBjte7usNXO1IxDmExeYxdwkDWWBCjOO4zd/D12TIC3HSJGJjT76GkF+RwTg==", - "dev": true, - "dependencies": { - "@import-maps/resolve": "^1.0.1", - "@vercel/nft": "^0.24.3", - "ajv": "^8.11.2", - "ajv-errors": "^3.0.0", - "better-ajv-errors": "^1.2.0", - "common-path-prefix": "^3.0.0", - "env-paths": "^3.0.0", - "esbuild": "0.19.6", - "execa": "^6.0.0", - "find-up": "^6.3.0", - "get-package-name": "^2.2.0", - "get-port": "^6.1.2", - "is-path-inside": "^4.0.0", - "jsonc-parser": "^3.2.0", - "node-fetch": "^3.1.1", - "node-stream-zip": "^1.15.0", - "p-retry": "^5.1.1", - "p-wait-for": "^4.1.0", - "path-key": "^4.0.0", - "regexp-tree": "^0.1.24", - "semver": "^7.3.8", - "tmp-promise": "^3.0.3", - "urlpattern-polyfill": "8.0.2", - "uuid": "^9.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", - "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", - "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", - "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", - "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", - "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", - "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", - "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", - "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", - "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", - "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", - "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", - "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", - "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", - "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", - "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", - "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", - "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", - "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", - "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", - "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", - "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", - "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.24.3", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.24.3.tgz", - "integrity": "sha512-IyBdIxmFAeGZnEfMgt4QrGK7XX4lWazlQj34HEi9dw04/WeDBJ7r1yaOIO5tTf9pbfvwUFodj9b0H+NDGGoOMg==", - "dev": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", - "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", - "dev": true, - "peerDependencies": { - "ajv": "^8.0.1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", - "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.19.6", - "@esbuild/android-arm64": "0.19.6", - "@esbuild/android-x64": "0.19.6", - "@esbuild/darwin-arm64": "0.19.6", - "@esbuild/darwin-x64": "0.19.6", - "@esbuild/freebsd-arm64": "0.19.6", - "@esbuild/freebsd-x64": "0.19.6", - "@esbuild/linux-arm": "0.19.6", - "@esbuild/linux-arm64": "0.19.6", - "@esbuild/linux-ia32": "0.19.6", - "@esbuild/linux-loong64": "0.19.6", - "@esbuild/linux-mips64el": "0.19.6", - "@esbuild/linux-ppc64": "0.19.6", - "@esbuild/linux-riscv64": "0.19.6", - "@esbuild/linux-s390x": "0.19.6", - "@esbuild/linux-x64": "0.19.6", - "@esbuild/netbsd-x64": "0.19.6", - "@esbuild/openbsd-x64": "0.19.6", - "@esbuild/sunos-x64": "0.19.6", - "@esbuild/win32-arm64": "0.19.6", - "@esbuild/win32-ia32": "0.19.6", - "@esbuild/win32-x64": "0.19.6" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", - "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-wait-for": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", - "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", - "dev": true, - "dependencies": { - "p-timeout": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info": { - "version": "9.8.10", - "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.10.tgz", - "integrity": "sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==", - "dev": true, - "dependencies": { - "ajv": "^8.12.0", - "filter-obj": "^5.0.0", - "find-up": "^6.3.0", - "is-plain-obj": "^4.0.0", - "locate-path": "^7.0.0", - "p-filter": "^3.0.0", - "p-locate": "^6.0.0", - "process": "^0.11.10", - "read-pkg-up": "^9.0.0", - "semver": "^7.3.8" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.45", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.45.tgz", - "integrity": "sha512-p7NQwOUmDbOG8G+J0UlMOKtTnEoaQemMCM8DgzFd4aOvlzZP870ociP/e6hfaxrq1cFB/cFGax+xfuRWAX66pA==", - "dev": true, - "dependencies": { - "@netlify/zip-it-and-ship-it": "9.28.1", - "cpy": "^9.0.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", - "integrity": "sha512-oyHieuTZH3rKTmg7EKpGEGa28IFxta2oXuVwpPJI/FJAtBje3UE+yko0eDjNufgm3AyGa8G77trUxgBhInAYuw==", - "dev": true, - "dependencies": { - "execa": "^6.0.0", - "map-obj": "^5.0.0", - "micromatch": "^4.0.2", - "moize": "^6.1.3", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy/-/local-functions-proxy-1.1.1.tgz", - "integrity": "sha512-eXSsayLT6PMvjzFQpjC9nkg2Otc3lZ5GoYele9M6f8PmsvWpaXRhwjNQ0NYhQQ2UZbLMIiO2dH8dbRsT3bMkFw==", - "dev": true, - "optionalDependencies": { - "@netlify/local-functions-proxy-darwin-arm64": "1.1.1", - "@netlify/local-functions-proxy-darwin-x64": "1.1.1", - "@netlify/local-functions-proxy-freebsd-arm64": "1.1.1", - "@netlify/local-functions-proxy-freebsd-x64": "1.1.1", - "@netlify/local-functions-proxy-linux-arm": "1.1.1", - "@netlify/local-functions-proxy-linux-arm64": "1.1.1", - "@netlify/local-functions-proxy-linux-ia32": "1.1.1", - "@netlify/local-functions-proxy-linux-ppc64": "1.1.1", - "@netlify/local-functions-proxy-linux-x64": "1.1.1", - "@netlify/local-functions-proxy-openbsd-x64": "1.1.1", - "@netlify/local-functions-proxy-win32-ia32": "1.1.1", - "@netlify/local-functions-proxy-win32-x64": "1.1.1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-arm64/-/local-functions-proxy-darwin-arm64-1.1.1.tgz", - "integrity": "sha512-lphJ9qqZ3glnKWEqlemU1LMqXxtJ/tKf7VzakqqyjigwLscXSZSb6fupSjQfd4tR1xqxA76ylws/2HDhc/gs+Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-x64/-/local-functions-proxy-darwin-x64-1.1.1.tgz", - "integrity": "sha512-4CRB0H+dXZzoEklq5Jpmg+chizXlVwCko94d8+UHWCgy/bA3M/rU/BJ8OLZisnJaAktHoeLABKtcLOhtRHpxZQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-arm64/-/local-functions-proxy-freebsd-arm64-1.1.1.tgz", - "integrity": "sha512-u13lWTVMJDF0A6jX7V4N3HYGTIHLe5d1Z2wT43fSIHwXkTs6UXi72cGSraisajG+5JFIwHfPr7asw5vxFC0P9w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-x64/-/local-functions-proxy-freebsd-x64-1.1.1.tgz", - "integrity": "sha512-g5xw4xATK5YDzvXtzJ8S1qSkWBiyF8VVRehXPMOAMzpGjCX86twYhWp8rbAk7yA1zBWmmWrWNA2Odq/MgpKJJg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm/-/local-functions-proxy-linux-arm-1.1.1.tgz", - "integrity": "sha512-YsTpL+AbHwQrfHWXmKnwUrJBjoUON363nr6jUG1ueYnpbbv6wTUA7gI5snMi/gkGpqFusBthAA7C30e6bixfiA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm64/-/local-functions-proxy-linux-arm64-1.1.1.tgz", - "integrity": "sha512-dPGu1H5n8na7mBKxiXQ+FNmthDAiA57wqgpm5JMAHtcdcmRvcXwJkwWVGvwfj8ShhYJHQaSaS9oPgO+mpKkgmA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ia32": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ia32/-/local-functions-proxy-linux-ia32-1.1.1.tgz", - "integrity": "sha512-Ra0FlXDrmPRaq+rYH3/ttkXSrwk1D5Zx/Na7UPfJZxMY7Qo5iY4bgi/FuzjzWzlp0uuKZOhYOYzYzsIIyrSvmw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ppc64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ppc64/-/local-functions-proxy-linux-ppc64-1.1.1.tgz", - "integrity": "sha512-oXf1satwqwUUxz7LHS1BxbRqc4FFEKIDFTls04eXiLReFR3sqv9H/QuYNTCCDMuRcCOd92qKyDfATdnxT4HR8w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-x64/-/local-functions-proxy-linux-x64-1.1.1.tgz", - "integrity": "sha512-bS3u4JuDg/eC0y4Na3i/29JBOxrdUvsK5JSjHfzUeZEbOcuXYf4KavTpHS5uikdvTgyczoSrvbmQJ5m0FLXfLA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-openbsd-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-openbsd-x64/-/local-functions-proxy-openbsd-x64-1.1.1.tgz", - "integrity": "sha512-1xLef/kLRNkBTXJ+ZGoRFcwsFxd/B2H3oeJZyXaZ3CN5umd9Mv9wZuAD74NuMt/535yRva8jtAJqvEgl9xMSdA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "bin": { - "local-functions-proxy": "bin/local-functions-proxy" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-ia32": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-ia32/-/local-functions-proxy-win32-ia32-1.1.1.tgz", - "integrity": "sha512-4IOMDBxp2f8VbIkhZ85zGNDrZR4ey8d68fCMSOIwitjsnKav35YrCf8UmAh3UR6CNIRJdJL4MW1GYePJ7iJ8uA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "bin": { - "local-functions-proxy.exe": "bin/local-functions-proxy.exe" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-x64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-x64/-/local-functions-proxy-win32-x64-1.1.1.tgz", - "integrity": "sha512-VCBXBJWBujVxyo5f+3r8ovLc9I7wJqpmgDn3ixs1fvdrER5Ac+SzYwYH4mUug9HI08mzTSAKZErzKeuadSez3w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "bin": { - "local-functions-proxy.exe": "bin/local-functions-proxy.exe" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/node-cookies": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@netlify/node-cookies/-/node-cookies-0.1.0.tgz", - "integrity": "sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==", - "dev": true, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.26.0.tgz", - "integrity": "sha512-B7q+ySzQm6rJhaGbY0Pzqnb1p3FsBqwiPLnLtA17JgTsqmXgQ7j6OQImW9fRJy/Al1ob9M6Oxng/FA2c7aIW1g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { - "version": "6.72.0", - "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.72.0.tgz", - "integrity": "sha512-GB3HxvUmOAkB6V3Tau7iQT7aH2NssmQHAgHWMrdD7pDfjcU6Vg0WcQfOWovjx2Bh6M0urOsJkBboX2egCuicEQ==", - "dev": true, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@netlify/run-utils/-/run-utils-5.1.1.tgz", - "integrity": "sha512-V2B8ZB19heVKa715uOeDkztxLH7uaqZ+9U5fV7BRzbQ2514DO5Vxj9hG0irzuRLfZXZZjp/chPUesv4VVsce/A==", - "dev": true, - "dependencies": { - "execa": "^6.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.1.tgz", - "integrity": "sha512-+G9cTltqfH54dF4dLqoEOV2P4qTIY8dM9blUVqg+NtVTXyuadzgpHqtffhVeyeLytVnTx1238kWJUe+sV3bnlg==", - "dev": true, - "dependencies": { - "@netlify/node-cookies": "^0.1.0", - "urlpattern-polyfill": "8.0.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.28.1", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.28.1.tgz", - "integrity": "sha512-cihW7K9JvlhcrhbdUO9Rhe0r5pydKr8HL++4A2/J7S4Vzl3KftBHyS7O/2Vh54+u3aMon6m4CDXWwErSwjjLNQ==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.22.5", - "@babel/types": "7.23.4", - "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.12.1", - "@vercel/nft": "^0.23.0", - "archiver": "^6.0.0", - "common-path-prefix": "^3.0.0", - "cp-file": "^10.0.0", - "es-module-lexer": "^1.0.0", - "esbuild": "0.19.6", - "execa": "^6.0.0", - "fast-glob": "^3.3.2", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "glob": "^8.0.3", - "is-builtin-module": "^3.1.0", - "is-path-inside": "^4.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "merge-options": "^3.0.4", - "minimatch": "^9.0.0", - "normalize-path": "^3.0.0", - "p-map": "^5.0.0", - "path-exists": "^5.0.0", - "precinct": "^11.0.0", - "require-package-name": "^2.0.1", - "resolve": "^2.0.0-next.1", - "semver": "^7.3.8", - "tmp-promise": "^3.0.2", - "toml": "^3.0.0", - "unixify": "^1.0.0", - "urlpattern-polyfill": "8.0.2", - "yargs": "^17.0.0" - }, - "bin": { - "zip-it-and-ship-it": "dist/bin.js" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", - "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", - "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", - "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", - "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", - "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", - "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", - "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", - "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", - "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", - "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-loong64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", - "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", - "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", - "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", - "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-s390x": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", - "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", - "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", - "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", - "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/sunos-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", - "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-arm64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", - "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-ia32": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", - "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-x64": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", - "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/esbuild": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", - "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.19.6", - "@esbuild/android-arm64": "0.19.6", - "@esbuild/android-x64": "0.19.6", - "@esbuild/darwin-arm64": "0.19.6", - "@esbuild/darwin-x64": "0.19.6", - "@esbuild/freebsd-arm64": "0.19.6", - "@esbuild/freebsd-x64": "0.19.6", - "@esbuild/linux-arm": "0.19.6", - "@esbuild/linux-arm64": "0.19.6", - "@esbuild/linux-ia32": "0.19.6", - "@esbuild/linux-loong64": "0.19.6", - "@esbuild/linux-mips64el": "0.19.6", - "@esbuild/linux-ppc64": "0.19.6", - "@esbuild/linux-riscv64": "0.19.6", - "@esbuild/linux-s390x": "0.19.6", - "@esbuild/linux-x64": "0.19.6", - "@esbuild/netbsd-x64": "0.19.6", - "@esbuild/openbsd-x64": "0.19.6", - "@esbuild/sunos-x64": "0.19.6", - "@esbuild/win32-arm64": "0.19.6", - "@esbuild/win32-ia32": "0.19.6", - "@esbuild/win32-x64": "0.19.6" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/auth-token": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", - "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz", - "integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==", - "dev": true, - "dependencies": { - "@octokit/auth-token": "^3.0.0", - "@octokit/graphql": "^5.0.0", - "@octokit/request": "^6.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^9.0.0", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/endpoint": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", - "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/graphql": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", - "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", - "dev": true, - "dependencies": { - "@octokit/request": "^6.0.0", - "@octokit/types": "^7.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { - "version": "13.13.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", - "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", - "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", - "dev": true, - "dependencies": { - "@octokit/tsconfig": "^1.0.2", - "@octokit/types": "^9.2.3" - }, - "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "@octokit/core": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz", - "integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==", - "dev": true, - "dependencies": { - "@octokit/types": "^9.2.3", - "deprecation": "^2.3.1" - }, - "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/request": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", - "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", - "dev": true, - "dependencies": { - "@octokit/endpoint": "^7.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/request-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", - "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/rest": { - "version": "19.0.13", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", - "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", - "dev": true, - "dependencies": { - "@octokit/core": "^4.2.1", - "@octokit/plugin-paginate-rest": "^6.1.2", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^7.1.2" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/tsconfig": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", - "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/types": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", - "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^13.11.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/api": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", - "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/api-logs": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.41.2.tgz", - "integrity": "sha512-JEV2RAqijAFdWeT6HddYymfnkiRu2ASxoTBr4WsnGJhOjWZkEy6vp+Sx9ozr1NaIODOa2HUyckExIqQjn6qywQ==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/context-async-hooks": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.13.0.tgz", - "integrity": "sha512-pS5fU4lrRjOIPZQqA2V1SUM9QUFXbO+8flubAiy6ntLjnAjJJUdRFOUOxK6v86ZHI2p2S8A0vD0BTu95FZYvjA==", - "dev": true, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/core": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.13.0.tgz", - "integrity": "sha512-2dBX3Sj99H96uwJKvc2w9NOiNgbvAO6mOFJFramNkKfS9O4Um+VWgpnlAazoYjT6kUJ1MP70KQ5ngD4ed+4NUw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-jaeger": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-jaeger/-/exporter-jaeger-1.13.0.tgz", - "integrity": "sha512-ke/STs/erRDqKmNv6Dv+5SetXsVD+Zm1/Wo8cLdAGrZn6kG6Fyp5EXVO/BJuzx6q+jHCdODm8jV4veXl4m71nQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0", - "jaeger-client": "^3.15.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-grpc/-/exporter-metrics-otlp-grpc-0.41.2.tgz", - "integrity": "sha512-gQuCcd5QSMkfi1XIriWAoak/vaRvFzpvtzh2hjziIvbnA3VtoGD3bDb2dzEzOA1iSWO0/tHwnBsSmmUZsETyOA==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/exporter-metrics-otlp-http": "0.41.2", - "@opentelemetry/otlp-grpc-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-metrics": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.41.2.tgz", - "integrity": "sha512-+YeIcL4nuldWE89K8NBLImpXCvih04u1MBnn8EzvoywG2TKR5JC3CZEPepODIxlsfGSgP8W5khCEP1NHZzftYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-metrics": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-proto/-/exporter-metrics-otlp-proto-0.39.1.tgz", - "integrity": "sha512-S+FgIhmZiFMsUivtAlCyzf3L5ezPyCqvlzt4hSZmiKs0kqapau1HS4cSpGacs9Jy499TRSNtqfjj7GxZrNIevw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/exporter-metrics-otlp-http": "0.39.1", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-proto-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-metrics": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/api-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", - "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/exporter-metrics-otlp-http": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.39.1.tgz", - "integrity": "sha512-Uj2i6t5v9aexV03xvVobwLV0Yxn7lQcCxBGN5KKxcs8BTZYSfjdwhrFjsOxvEQ2cXugL0aIzCuTKxrlXYTmFwA==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-metrics": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", - "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.39.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-logs": "0.39.1", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", - "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.38.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", - "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "lodash.merge": "4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.41.2.tgz", - "integrity": "sha512-tRM/mq7PFj7mXCws5ICMVp/rmgU93JvZdoLE0uLj4tugNz231u2ZgeRYXulBjdeHM88ZQSsWTJMu2mvr/3JV1A==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-grpc-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-trace-base": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", - "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.39.1.tgz", - "integrity": "sha512-AEhnJfVmo1g+7NxszAuf3c6vddld2DGH2+IM4XrPxCklucCsIpuStuC5EVZbCXXXBMpAY+n3t04QMxIQqNrcSw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/api-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", - "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", - "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.39.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-logs": "0.39.1", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", - "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.38.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", - "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "lodash.merge": "4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.41.2.tgz", - "integrity": "sha512-IGZga9IIckqYE3IpRE9FO9G5umabObIrChlXUHYpMJtDgx797dsb3qXCvLeuAwB+HoB8NsEZstlzmLnoa6/HmA==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "@opentelemetry/otlp-proto-exporter-base": "0.41.2", - "@opentelemetry/otlp-transformer": "0.41.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-trace-base": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-proto-exporter-base": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.41.2.tgz", - "integrity": "sha512-BxmEMiP6tHiFroe5/dTt9BsxCci7BTLtF7A6d4DKHLiLweWWZxQ9l7hON7qt/IhpKrQcAFD1OzZ1Gq2ZkNzhCw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "protobufjs": "^7.2.3" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", - "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.13.0.tgz", - "integrity": "sha512-4IuUmYEhlHm8tAGtd6KKkktEO9Bt7dpdBdAPVAzhmXsPwGi0yExo7E5qfi9HtHQcdfP9SnrGRkeorVtrZkGlhg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.39.1.tgz", - "integrity": "sha512-s7/9tPmM0l5KCd07VQizC4AO2/5UJdkXq5gMSHPdCeiMKSeBEdyDyQX7A+Cq+RYZM452qzFmrJ4ut628J5bnSg==", - "dev": true, - "dependencies": { - "require-in-the-middle": "^7.1.0", - "semver": "^7.3.2", - "shimmer": "^1.2.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.41.2.tgz", - "integrity": "sha512-pfwa6d+Dax3itZcGWiA0AoXeVaCuZbbqUTsCtOysd2re8C2PWXNxDONUfBWsn+KgxAdi+ljwTjJGiaVLDaIEvQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.41.2.tgz", - "integrity": "sha512-OErK8dYjXG01XIMIpmOV2SzL9ctkZ0Nyhf2UumICOAKtgLvR5dG1JMlsNVp8Jn0RzpsKc6Urv7JpP69wzRXN+A==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/otlp-exporter-base": "0.41.2", - "protobufjs": "^7.2.3" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.39.1.tgz", - "integrity": "sha512-VssdfGYu6LkSliQATdkvoP8lPSQuNLENRdHTUOV2veF4iqY/UpxBFFlkarY29W+MYjWXIBfYntgNjQvcn78A+w==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "protobufjs": "^7.1.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.41.2.tgz", - "integrity": "sha512-jJbPwB0tNu2v+Xi0c/v/R3YBLJKLonw1p+v3RVjT2VfzeUyzSp/tBeVdY7RZtL6dzZpA9XSmp8UEfWIFQo33yA==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.41.2", - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/sdk-logs": "0.41.2", - "@opentelemetry/sdk-metrics": "1.15.2", - "@opentelemetry/sdk-trace-base": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", - "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.13.0.tgz", - "integrity": "sha512-HOo91EI4UbuG8xQVLFziTzrcIn0MJQhy8m9jorh8aonb94jFVFi3CFNIiAnIGOabmnshJLOABxpYXsiPB8Xnzg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.13.0.tgz", - "integrity": "sha512-IV9TO+u1Jzm9mUDAD3gyXf89eyvgEJUY1t+GB5QmS4wjVeWrSMUtD0JjH3yG9SNqkrQOqOGJq7YUSSetW+Lf5Q==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/resources": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.13.0.tgz", - "integrity": "sha512-euqjOkiN6xhjE//0vQYGvbStxoD/WWQRhDiO0OTLlnLBO9Yw2Gd/VoSx2H+svsebjzYk5OxLuREBmcdw6rbUNg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.41.2.tgz", - "integrity": "sha512-smqKIw0tTW15waj7BAPHFomii5c3aHnSE4LQYTszGoK5P9nZs8tEAIpu15UBxi3aG31ZfsLmm4EUQkjckdlFrw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.39.1" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.2.tgz", - "integrity": "sha512-9aIlcX8GnhcsAHW/Wl8bzk4ZnWTpNlLtud+fxUfBtFATu6OZ6TrGrF4JkT9EVrnoxwtPIDtjHdEsSjOqisY/iA==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/resources": "1.15.2", - "lodash.merge": "^4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", - "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.15.2", - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.39.1.tgz", - "integrity": "sha512-qODReBGNSdfRS5gvCFj1SdiIi/3ZFTZb0H1KvWE/OrTkklyL5RhIs7vDwvEGHmha+YpUu0Y2+R2+itSBSu/jCA==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/exporter-jaeger": "1.13.0", - "@opentelemetry/exporter-trace-otlp-grpc": "0.39.1", - "@opentelemetry/exporter-trace-otlp-http": "0.39.1", - "@opentelemetry/exporter-trace-otlp-proto": "0.39.1", - "@opentelemetry/exporter-zipkin": "1.13.0", - "@opentelemetry/instrumentation": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "@opentelemetry/sdk-trace-node": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/api-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", - "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.39.1.tgz", - "integrity": "sha512-l5RhLKx6U+yuLhMrtgavTDthX50E1mZM3/SSySC7OPZiArFHV/b/9x9jxAzrOgIQUDxyj4N0V9aLKSA2t7Qzxg==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-grpc-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-proto": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.39.1.tgz", - "integrity": "sha512-oJQC7a67iwExRYynKqn/O9Fl5gUjDa43ZQsZu2iKAADs/6YJ+u5MJ/wcq3CpJsn2KU/8j8HWAKOcDkkQXPuJ9A==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "@opentelemetry/otlp-proto-exporter-base": "0.39.1", - "@opentelemetry/otlp-transformer": "0.39.1", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", - "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-grpc-exporter-base": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.39.1.tgz", - "integrity": "sha512-u3ErFRQqQFKjjIMuwLWxz/tLPYInfmiAmSy//fGSCzCh2ZdJgqQjMOAxBgqFtCF2xFL+OmMhyuC2ThMzceGRWA==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/otlp-exporter-base": "0.39.1", - "protobufjs": "^7.2.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", - "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.39.1", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/sdk-logs": "0.39.1", - "@opentelemetry/sdk-metrics": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-logs": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", - "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.5.0", - "@opentelemetry/api-logs": ">=0.38.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", - "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "lodash.merge": "4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.13.0.tgz", - "integrity": "sha512-moTiQtc0uPR1hQLt6gLDJH9IIkeBhgRb71OKjNHZPE1VF45fHtD6nBDi5J/DkTHTwYP5X3kBJLa3xN7ub6J4eg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.13.0", - "@opentelemetry/resources": "1.13.0", - "@opentelemetry/semantic-conventions": "1.13.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.13.0.tgz", - "integrity": "sha512-FXA85lXKTsnbOflA/TBuBf2pmhD3c8uDjNjG0YqK+ap8UayfALmfJhf+aG1yBOUHevCY0JXJ4/xtbXExxpsMog==", - "dev": true, - "dependencies": { - "@opentelemetry/context-async-hooks": "1.13.0", - "@opentelemetry/core": "1.13.0", - "@opentelemetry/propagator-b3": "1.13.0", - "@opentelemetry/propagator-jaeger": "1.13.0", - "@opentelemetry/sdk-trace-base": "1.13.0", - "semver": "^7.3.5" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.13.0.tgz", - "integrity": "sha512-LMGqfSZkaMQXqewO0o1wvWr/2fQdCh4a3Sqlxka/UsJCe0cfLulh6x2aqnKLnsrSGiCq5rSCwvINd152i0nCqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.3.0.tgz", - "integrity": "sha512-pW7QaFiL11O0BphO+bq3MgqeX/INAk9jgBldVDYjlQPO4VddoZnF22TcF9onMhnLVHuNqBJeRf+Fj7eezi/+rQ==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "detect-libc": "^1.0.3", - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "node-addon-api": "^7.0.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.3.0", - "@parcel/watcher-darwin-arm64": "2.3.0", - "@parcel/watcher-darwin-x64": "2.3.0", - "@parcel/watcher-freebsd-x64": "2.3.0", - "@parcel/watcher-linux-arm-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-musl": "2.3.0", - "@parcel/watcher-linux-x64-glibc": "2.3.0", - "@parcel/watcher-linux-x64-musl": "2.3.0", - "@parcel/watcher-win32-arm64": "2.3.0", - "@parcel/watcher-win32-ia32": "2.3.0", - "@parcel/watcher-win32-x64": "2.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-android-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.3.0.tgz", - "integrity": "sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.3.0.tgz", - "integrity": "sha512-mKY+oijI4ahBMc/GygVGvEdOq0L4DxhYgwQqYAz/7yPzuGi79oXrZG52WdpGA1wLBPrYb0T8uBaGFo7I6rvSKw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.3.0.tgz", - "integrity": "sha512-20oBj8LcEOnLE3mgpy6zuOq8AplPu9NcSSSfyVKgfOhNAc4eF4ob3ldj0xWjGGbOF7Dcy1Tvm6ytvgdjlfUeow==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.3.0.tgz", - "integrity": "sha512-7LftKlaHunueAEiojhCn+Ef2CTXWsLgTl4hq0pkhkTBFI3ssj2bJXmH2L67mKpiAD5dz66JYk4zS66qzdnIOgw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.3.0.tgz", - "integrity": "sha512-1apPw5cD2xBv1XIHPUlq0cO6iAaEUQ3BcY0ysSyD9Kuyw4MoWm1DV+W9mneWI+1g6OeP6dhikiFE6BlU+AToTQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.3.0.tgz", - "integrity": "sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.3.0.tgz", - "integrity": "sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.3.0.tgz", - "integrity": "sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.3.0.tgz", - "integrity": "sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.3.0.tgz", - "integrity": "sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==", - "bundleDependencies": [ - "napi-wasm" - ], - "dev": true, - "dependencies": { - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "napi-wasm": "^1.1.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.3.0.tgz", - "integrity": "sha512-35gXCnaz1AqIXpG42evcoP2+sNL62gZTMZne3IackM+6QlfMcJLy3DrjuL6Iks7Czpd3j4xRBzez3ADCj1l7Aw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-ia32": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.3.0.tgz", - "integrity": "sha512-FJS/IBQHhRpZ6PiCjFt1UAcPr0YmCLHRbTc00IBTrelEjlmmgIVLeOx4MSXzx2HFEy5Jo5YdhGpxCuqCyDJ5ow==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.3.0.tgz", - "integrity": "sha512-dLx+0XRdMnVI62kU3wbXvbIRhLck4aE28bIGKbRGS7BJNt54IIj9+c/Dkqb+7DJEbHUZAX1bwaoM8PqVlHJmCA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/netlify-cli/node_modules/@parcel/watcher/node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "dev": true, - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/@pnpm/config.env-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", - "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", - "dev": true, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/netlify-cli/node_modules/@pnpm/network.ca-file": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", - "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", - "dev": true, - "dependencies": { - "graceful-fs": "4.2.10" - }, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/netlify-cli/node_modules/@pnpm/npm-conf": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.0.tgz", - "integrity": "sha512-roLI1ul/GwzwcfcVpZYPdrgW2W/drLriObl1h+yLF5syc8/5ULWw2ALbCHUWF+4YltIqA3xFSbG4IwyJz37e9g==", - "dev": true, - "dependencies": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dev": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", - "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", - "dev": true, - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@sindresorhus/slugify": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", - "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", - "dev": true, - "dependencies": { - "@sindresorhus/transliterate": "^1.0.0", - "escape-string-regexp": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@sindresorhus/transliterate": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.5.0.tgz", - "integrity": "sha512-/sfSkoNelLq5riqNRp5uBjHIKBi1MWZk9ubRT1WiBQuTfmDf7BeQkph2DJzRB83QagMPHk2VDjuvpy0VuwyzdA==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "lodash.deburr": "^4.1.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@tokenizer/token": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@trysound/sax": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", - "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/netlify-cli/node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/http-cache-semantics": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.2.tgz", - "integrity": "sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@types/http-proxy": { - "version": "1.17.8", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.8.tgz", - "integrity": "sha512-5kPLG5BKpWYkw/LVOGWpiq3nEVqxiN32rTgI53Sk12/xHFQ2rG3ehI9IO+O3W2QoKeyB92dJkoka8SUm6BX1pA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/mime": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", - "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/netlify-cli/node_modules/@types/node": { - "version": "20.9.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", - "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/netlify-cli/node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/netlify-cli/node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/netlify-cli/node_modules/@types/retry": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", - "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@types/serve-static": { - "version": "1.13.10", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", - "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@types/mime": "^1", - "@types/node": "*" - } - }, - "node_modules/netlify-cli/node_modules/@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@types/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/netlify-cli/node_modules/@vercel/nft": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.23.1.tgz", - "integrity": "sha512-NE0xSmGWVhgHF1OIoir71XAd0W0C1UE3nzFyhpFiMr3rVhetww7NvM1kc41trBsPG37Bh+dE5FYCTMzM/gBu0w==", - "dev": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/archive-type": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-6.0.1.tgz", - "integrity": "sha512-PB3NeJL8xARZt52yDBupK0dNPn8uIVQDe15qNehUpoeeLWCZyAOam4vGXnoZGz2N9D1VXtjievJuCsXam2TmbQ==", - "dev": true, - "dependencies": { - "file-type": "^18.5.0" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@xhmikosr/decompress/-/decompress-9.0.1.tgz", - "integrity": "sha512-9Lvlt6Qdpo9SaRQyRIXCo3lgU++eMZ68lzgjcTwtuKDrlwT635+5zsHZ1yrSx/Blc5IDuVLlPkBPj5CZkx+2+Q==", - "dev": true, - "dependencies": { - "@xhmikosr/decompress-tar": "^7.0.0", - "@xhmikosr/decompress-tarbz2": "^7.0.0", - "@xhmikosr/decompress-targz": "^7.0.0", - "@xhmikosr/decompress-unzip": "^6.0.0", - "graceful-fs": "^4.2.11", - "make-dir": "^4.0.0", - "strip-dirs": "^3.0.0" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tar": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tar/-/decompress-tar-7.0.0.tgz", - "integrity": "sha512-kyWf2hybtQVbWtB+FdRyOT+jyR5jxCNZPLqvQGB7djZj75lrpLUPEmRbyo86AtJ5OEtivpYaNWjCkqSJ8xtRWw==", - "dev": true, - "dependencies": { - "file-type": "^18.5.0", - "is-stream": "^3.0.0", - "tar-stream": "^3.1.4" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tarbz2": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tarbz2/-/decompress-tarbz2-7.0.0.tgz", - "integrity": "sha512-3QnjipYkRgh3Dee1MWDgKmANWxOQBVN4e1IwiGNe2fHYfMYTeSkVvWREt87UIoSucKUh3E95v8uGFttgTknZcA==", - "dev": true, - "dependencies": { - "@xhmikosr/decompress-tar": "^7.0.0", - "file-type": "^18.5.0", - "is-stream": "^3.0.0", - "seek-bzip": "^1.0.6", - "unbzip2-stream": "^1.4.3" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-targz": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-targz/-/decompress-targz-7.0.0.tgz", - "integrity": "sha512-7BNHJl92g9OLhw89zqcFS67V1LAtm4Ex02j6OiQzuE8P7Yy9lQcyBuEL3x6v436grLdL+BcFjgbmhWxnem4GHw==", - "dev": true, - "dependencies": { - "@xhmikosr/decompress-tar": "^7.0.0", - "file-type": "^18.5.0", - "is-stream": "^3.0.0" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-unzip": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-unzip/-/decompress-unzip-6.0.0.tgz", - "integrity": "sha512-R1HAkjXLS7RAL74YFLxYY9zYflCcYGssld9KKFDu87PnJ4h4btdhzXfSC8J5i5A2njH3oYIoCzx03RIGTH07Sg==", - "dev": true, - "dependencies": { - "file-type": "^18.5.0", - "get-stream": "^6.0.1", - "yauzl": "^2.10.0" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress/node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/decompress/node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/@xhmikosr/downloader/-/downloader-13.0.1.tgz", - "integrity": "sha512-mBvWew1kZJHfNQVVfVllMjUDwCGN9apPa0t4/z1zaUJ9MzpXjRL3w8fsfJKB8gHN/h4rik9HneKfDbh2fErN+w==", - "dev": true, - "dependencies": { - "@xhmikosr/archive-type": "^6.0.1", - "@xhmikosr/decompress": "^9.0.1", - "content-disposition": "^0.5.4", - "ext-name": "^5.0.0", - "file-type": "^18.5.0", - "filenamify": "^5.1.1", - "get-stream": "^6.0.1", - "got": "^12.6.1", - "merge-options": "^3.0.4", - "p-event": "^5.0.1" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filename-reserved-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz", - "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filenamify": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-5.1.1.tgz", - "integrity": "sha512-M45CbrJLGACfrPOkrTp3j2EcO9OBkKUYME0eiqOCa7i2poaklU0jhlIaMlr8ijLorT0uLAzrn3qXOp5684CkfA==", - "dev": true, - "dependencies": { - "filename-reserved-regex": "^3.0.0", - "strip-outer": "^2.0.0", - "trim-repeated": "^2.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/strip-outer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-2.0.0.tgz", - "integrity": "sha512-A21Xsm1XzUkK0qK1ZrytDUvqsQWict2Cykhvi0fBQntGG5JSprESasEyV1EZ/4CiR5WB5KjzLTrP/bO37B0wPg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/trim-repeated": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-2.0.0.tgz", - "integrity": "sha512-QUHBFTJGdOwmp0tbOG505xAgOp/YliZP/6UgafFXYZ26WT1bvQmSMJUvkeVSASuJJHbqsFbynTvkd5W8RBTipg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dev": true, - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/netlify-cli/node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/netlify-cli/node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", - "dev": true, - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/aggregate-error/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/ajv-formats/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/all-node-versions": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/all-node-versions/-/all-node-versions-11.3.0.tgz", - "integrity": "sha512-psMkc5s3qpr+QMfires9bC4azRYciPWql1wqZKMsYRh1731qefQDH2X4+O19xSBX6u0Ra/8Y5diG6y/fEmqKsw==", - "dev": true, - "dependencies": { - "fetch-node-website": "^7.3.0", - "filter-obj": "^5.1.0", - "get-stream": "^6.0.0", - "global-cache-dir": "^4.3.1", - "is-plain-obj": "^4.1.0", - "path-exists": "^5.0.0", - "semver": "^7.3.7", - "write-file-atomic": "^4.0.1" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/netlify-cli/node_modules/all-node-versions/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/all-node-versions/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "string-width": "^4.1.0" - } - }, - "node_modules/netlify-cli/node_modules/ansi-color": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", - "integrity": "sha512-bF6xLaZBLpOQzgYUtYEhJx090nPSZk1BQ/q2oyBK9aMMcJHzx9uXGCjI2Y+LebsN4Jwoykr0V9whbPiogdyHoQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/ansi-escapes": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", - "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", - "dev": true, - "dependencies": { - "type-fest": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/ansi-to-html": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.7.2.tgz", - "integrity": "sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==", - "dev": true, - "dependencies": { - "entities": "^2.2.0" - }, - "bin": { - "ansi-to-html": "bin/ansi-to-html" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/ansi-to-html/node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/arch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", - "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/archiver": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.1.tgz", - "integrity": "sha512-CXGy4poOLBKptiZH//VlWdFuUC1RESbdZjGjILwBuZ73P7WkAUN0htfSfBq/7k6FRFlpu7bg4JOkj1vU9G6jcQ==", - "dev": true, - "dependencies": { - "archiver-utils": "^4.0.1", - "async": "^3.2.4", - "buffer-crc32": "^0.2.1", - "readable-stream": "^3.6.0", - "readdir-glob": "^1.1.2", - "tar-stream": "^3.0.0", - "zip-stream": "^5.0.1" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/archiver-utils": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-4.0.1.tgz", - "integrity": "sha512-Q4Q99idbvzmgCTEAAhi32BkOyq8iVI5EwdO0PmBDSGIzzjYNdcFn7Q7k3OzbLy4kLUPXfJtG6fO2RjftXbobBg==", - "dev": true, - "dependencies": { - "glob": "^8.0.0", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash": "^4.17.15", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "dev": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/array-timsort": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", - "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/arrify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", - "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/ascii-table": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", - "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/ast-module-types": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-5.0.0.tgz", - "integrity": "sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/async-sema": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz", - "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/avvio": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", - "integrity": "sha512-bbCQdg7bpEv6kGH41RO/3B2/GMMmJSo2iBK+X8AWN9mujtfUipMDfIjsgHCfpnKqoGEQrrmCDKSa5OQ19+fDmg==", - "dev": true, - "dependencies": { - "archy": "^1.0.0", - "debug": "^4.0.0", - "fastq": "^1.6.1" - } - }, - "node_modules/netlify-cli/node_modules/axios": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", - "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/b4a": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", - "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/backoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", - "integrity": "sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==", - "dev": true, - "dependencies": { - "precond": "0.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/better-ajv-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-1.2.0.tgz", - "integrity": "sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.0", - "@humanwhocodes/momoa": "^2.0.2", - "chalk": "^4.1.2", - "jsonpointer": "^5.0.0", - "leven": "^3.1.0 < 4" - }, - "engines": { - "node": ">= 12.13.0" - }, - "peerDependencies": { - "ajv": "4.11.8 - 8" - } - }, - "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/better-opn": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.2.tgz", - "integrity": "sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==", - "dev": true, - "dependencies": { - "open": "^8.0.4" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/netlify-cli/node_modules/blueimp-md5": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", - "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/boxen": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", - "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", - "dev": true, - "dependencies": { - "ansi-align": "^3.0.1", - "camelcase": "^7.0.1", - "chalk": "^5.2.0", - "cli-boxes": "^3.0.0", - "string-width": "^5.1.2", - "type-fest": "^2.13.0", - "widest-line": "^4.0.1", - "wrap-ansi": "^8.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/boxen/node_modules/camelcase": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", - "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/boxen/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/boxen/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/boxen/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/boxen/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/netlify-cli/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/netlify-cli/node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/bufrw": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bufrw/-/bufrw-1.3.0.tgz", - "integrity": "sha512-jzQnSbdJqhIltU9O5KUiTtljP9ccw2u5ix59McQy4pV2xGhVLhRZIndY8GIrgh5HjXa6+QJ9AQhOd2QWQizJFQ==", - "dev": true, - "dependencies": { - "ansi-color": "^0.2.1", - "error": "^7.0.0", - "hexer": "^1.5.0", - "xtend": "^4.0.0" - }, - "engines": { - "node": ">= 0.10.x" - } - }, - "node_modules/netlify-cli/node_modules/builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/builtins": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", - "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", - "dev": true, - "dependencies": { - "semver": "^7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/byline": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", - "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/cachedir": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", - "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/chalk": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", - "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.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" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/netlify-cli/node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/citty": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.4.tgz", - "integrity": "sha512-Q3bK1huLxzQrvj7hImJ7Z1vKYJRPQCDnd0EjXfHMidcjecGOMuLrmuQmtWmFkuKLcMThlGh1yCKG8IEc6VeNXQ==", - "dev": true, - "dependencies": { - "consola": "^3.2.3" - } - }, - "node_modules/netlify-cli/node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/clean-deep": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", - "integrity": "sha512-Lo78NV5ItJL/jl+B5w0BycAisaieJGXK1qYi/9m4SjR8zbqmrUtO7Yhro40wEShGmmxs/aJLI/A+jNhdkXK8mw==", - "dev": true, - "dependencies": { - "lodash.isempty": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.transform": "^4.6.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/clean-stack/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cli-boxes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", - "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", - "dev": true, - "dependencies": { - "restore-cursor": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/cli-progress": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", - "integrity": "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==", - "dev": true, - "dependencies": { - "string-width": "^4.2.3" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", - "dev": true, - "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/clipboardy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-3.0.0.tgz", - "integrity": "sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==", - "dev": true, - "dependencies": { - "arch": "^2.2.0", - "execa": "^5.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/netlify-cli/node_modules/cluster-key-slot": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - } - }, - "node_modules/netlify-cli/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/netlify-cli/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/color-string": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", - "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", - "dev": true, - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "node_modules/netlify-cli/node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "dev": true, - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/netlify-cli/node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/netlify-cli/node_modules/colors-option": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-3.0.0.tgz", - "integrity": "sha512-DP3FpjsiDDvnQC1OJBsdOJZPuy7r0o6sepY2T5M3L/d2nrE23O/ErFkEqyY3ngVL1ZhTj/H0pCMNObZGkEOaaQ==", - "dev": true, - "dependencies": { - "chalk": "^5.0.0", - "filter-obj": "^3.0.0", - "is-plain-obj": "^4.0.0", - "jest-validate": "^27.3.1" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/colors-option/node_modules/filter-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", - "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/colorspace": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "dev": true, - "dependencies": { - "color": "^3.1.3", - "text-hex": "1.0.x" - } - }, - "node_modules/netlify-cli/node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/comment-json": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", - "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", - "dev": true, - "dependencies": { - "array-timsort": "^1.0.3", - "core-util-is": "^1.0.3", - "esprima": "^4.0.1", - "has-own-prop": "^2.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/netlify-cli/node_modules/comment-json/node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/common-path-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", - "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/compress-commons": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-5.0.1.tgz", - "integrity": "sha512-MPh//1cERdLtqwO3pOFLeXtpuai0Y2WCd5AhtKxznqM7WtaMYaOEMSgn45d9D10sIHSfIKE603HlOp8OPGrvag==", - "dev": true, - "dependencies": { - "crc-32": "^1.2.0", - "crc32-stream": "^5.0.0", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/concordance": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", - "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", - "dev": true, - "dependencies": { - "date-time": "^3.1.0", - "esutils": "^2.0.3", - "fast-diff": "^1.2.0", - "js-string-escape": "^1.0.1", - "lodash": "^4.17.15", - "md5-hex": "^3.0.1", - "semver": "^7.3.2", - "well-known-symbols": "^2.0.0" - }, - "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" - } - }, - "node_modules/netlify-cli/node_modules/config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "dev": true, - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "node_modules/netlify-cli/node_modules/config-chain/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/configstore": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", - "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", - "dev": true, - "dependencies": { - "dot-prop": "^6.0.1", - "graceful-fs": "^4.2.6", - "unique-string": "^3.0.0", - "write-file-atomic": "^3.0.3", - "xdg-basedir": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/yeoman/configstore?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/configstore/node_modules/dot-prop": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", - "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", - "dev": true, - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/configstore/node_modules/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, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/netlify-cli/node_modules/consola": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", - "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", - "dev": true, - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, - "node_modules/netlify-cli/node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/content-disposition/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/cookie-es": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", - "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/copy-template-dir/-/copy-template-dir-1.4.0.tgz", - "integrity": "sha512-xkXSJhvKz4MfLbVkZ7GyCaFo4ciB3uKI/HHzkGwj1eyTH5+7RTFxW5CE0irWAZgV5oFcO9hd6+NVXAtY9hlo7Q==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "graceful-fs": "^4.1.3", - "maxstache": "^1.0.0", - "maxstache-stream": "^1.0.0", - "mkdirp": "^0.5.1", - "noop2": "^2.0.0", - "pump": "^1.0.0", - "readdirp": "^2.0.0", - "run-parallel": "^1.1.4" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/cp-file": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", - "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.10", - "nested-error-stacks": "^2.1.1", - "p-event": "^5.0.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", - "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", - "dev": true, - "dependencies": { - "arrify": "^3.0.0", - "cp-file": "^9.1.0", - "globby": "^13.1.1", - "junk": "^4.0.0", - "micromatch": "^4.0.4", - "nested-error-stacks": "^2.1.0", - "p-filter": "^3.0.0", - "p-map": "^5.3.0" - }, - "engines": { - "node": "^12.20.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/cp-file": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", - "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "nested-error-stacks": "^2.0.0", - "p-event": "^4.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "dev": true, - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/p-event": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", - "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", - "dev": true, - "dependencies": { - "p-timeout": "^3.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "dev": true, - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "dev": true, - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/netlify-cli/node_modules/crc32-stream": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-5.0.0.tgz", - "integrity": "sha512-B0EPa1UK+qnpBZpG+7FgPCu0J2ETLpXq09o9BkLkEAhdB6Z61Qo4pJ3JYu0c+Qi+/SAL7QThqnzS06pmSSyZaw==", - "dev": true, - "dependencies": { - "crc-32": "^1.2.0", - "readable-stream": "^3.4.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/cron-parser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.8.1.tgz", - "integrity": "sha512-jbokKWGcyU4gl6jAfX97E1gDpY12DJ1cLJZmoDzaAln/shZ+S3KBFBuA2Q6WeUN4gJf/8klnV1EfvhA2lK5IRQ==", - "dev": true, - "dependencies": { - "luxon": "^3.2.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/cross-spawn/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/crypto-random-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", - "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", - "dev": true, - "dependencies": { - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/crypto-random-string/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-tree": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dev": true, - "dependencies": { - "mdn-data": "2.0.30", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, - "node_modules/netlify-cli/node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/netlify-cli/node_modules/cssfilter": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", - "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/csso": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", - "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", - "dev": true, - "dependencies": { - "css-tree": "~2.2.0" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/csso/node_modules/css-tree": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", - "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", - "dev": true, - "dependencies": { - "mdn-data": "2.0.28", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/csso/node_modules/mdn-data": { - "version": "2.0.28", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", - "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, - "node_modules/netlify-cli/node_modules/date-time": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", - "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", - "dev": true, - "dependencies": { - "time-zone": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/decache": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.2.tgz", - "integrity": "sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==", - "dev": true, - "dependencies": { - "callsite": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "dependencies": { - "clone": "^1.0.2" - } - }, - "node_modules/netlify-cli/node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/defu": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.3.tgz", - "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/netlify-cli/node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/destr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.2.tgz", - "integrity": "sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "dev": true, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/netlify-cli/node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/detective-amd": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.1.tgz", - "integrity": "sha512-e7n0E0Wte78U9lcpl3hsTh1ZJ+zp/rgEbdbzGLgTowSbbSemuHnM8olp4KHMF1eCaurrCE50IU9VkoV13ezK4A==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "escodegen": "^2.0.0", - "get-amd-module-type": "^5.0.0", - "node-source-walk": "^6.0.0" - }, - "bin": { - "detective-amd": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/detective-cjs": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-5.0.1.tgz", - "integrity": "sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/detective-es6": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-4.0.1.tgz", - "integrity": "sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==", - "dev": true, - "dependencies": { - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/detective-postcss": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", - "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", - "dev": true, - "dependencies": { - "is-url": "^1.2.4", - "postcss": "^8.4.23", - "postcss-values-parser": "^6.0.2" - }, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/detective-sass": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-5.0.3.tgz", - "integrity": "sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==", - "dev": true, - "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/detective-scss": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-4.0.3.tgz", - "integrity": "sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==", - "dev": true, - "dependencies": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/detective-stylus": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-4.0.0.tgz", - "integrity": "sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/detective-typescript": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.0.1.tgz", - "integrity": "sha512-pVCuFWdEAyHI16zO3NBWSAULV8pevSkX3gwK8w3y9RrBGUrig6wDvwv6vUpnu+HfOr0MDmjMkmJGNWaTb6+HkA==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "^5.59.2", - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.0", - "typescript": "^5.0.4" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/netlify-cli/node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/netlify-cli/node_modules/dot-prop": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz", - "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==", - "dev": true, - "dependencies": { - "type-fest": "^2.11.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/dot-prop/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/netlify-cli/node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/netlify-cli/node_modules/env-paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", - "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/error": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", - "integrity": "sha512-UtVv4l5MhijsYUxPJo4390gzfZvAnTHreNnDjnTZaKIiZ/SemXxAhBkYSKtWa5RtBXbLP8tMgn/n0RUa/H7jXw==", - "dev": true, - "dependencies": { - "string-template": "~0.2.1", - "xtend": "~4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/netlify-cli/node_modules/error-stack-parser": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", - "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", - "dev": true, - "dependencies": { - "stackframe": "^1.3.4" - } - }, - "node_modules/netlify-cli/node_modules/es-module-lexer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.3.tgz", - "integrity": "sha512-iC67eXHToclrlVhQfpRawDiF8D8sQxNxmbqw5oebegOaJkyx/w9C/k57/5e6yJR2zIByRt9OXdqX50DV2t6ZKw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/es6-promisify": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/escape-goat": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", - "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/netlify-cli/node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/netlify-cli/node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/execa/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dev": true, - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/express-logging": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/express-logging/-/express-logging-1.1.1.tgz", - "integrity": "sha512-1KboYwxxCG5kwkJHR5LjFDTD1Mgl8n4PIMcCuhhd/1OqaxlC68P3QKbvvAbZVUtVgtlxEdTgSUwf6yxwzRCuuA==", - "dev": true, - "dependencies": { - "on-headers": "^1.0.0" - }, - "engines": { - "node": ">= 0.10.26" - } - }, - "node_modules/netlify-cli/node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/express/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/express/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/express/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/ext-list": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", - "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==", - "dev": true, - "dependencies": { - "mime-db": "^1.28.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/ext-name": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz", - "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==", - "dev": true, - "dependencies": { - "ext-list": "^2.0.0", - "sort-keys-length": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", - "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extglob/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/netlify-cli/node_modules/extract-zip/node_modules/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, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fast-content-type-parse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.0.0.tgz", - "integrity": "sha512-Xbc4XcysUXcsP5aHUU7Nq3OwvHq97C+WnbkeIefpeYLX+ryzFJlU6OStFJhs6Ol0LkUGpcK+wL0JwfM+FCU5IA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-equals": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-3.0.3.tgz", - "integrity": "sha512-NCe8qxnZFARSHGztGMZOO/PC1qa5MIFB5Hp66WdzbCRAz8U8US3bx1UTgLS49efBQPcUtO9gf5oVEY8o7y/7Kg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-fifo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.0.tgz", - "integrity": "sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "peer": true - }, - "node_modules/netlify-cli/node_modules/fast-json-stringify": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.7.0.tgz", - "integrity": "sha512-sBVPTgnAZseLu1Qgj6lUbQ0HfjFhZWXAmpZ5AaSGkyLh5gAXBga/uPJjQPHpDFjC9adWIpdOcCLSDTgrZ7snoQ==", - "dev": true, - "dependencies": { - "@fastify/deepmerge": "^1.0.0", - "ajv": "^8.10.0", - "ajv-formats": "^2.1.1", - "fast-deep-equal": "^3.1.3", - "fast-uri": "^2.1.0", - "rfdc": "^1.2.0" - } - }, - "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-querystring": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", - "integrity": "sha512-3LQi62IhQoDlmt4ULCYmh17vRO2EtS7hTSsG4WwoKWgV7GLMKBOecEh+aiavASnLx8I2y89OD33AGLo0ccRhzA==", - "dev": true, - "dependencies": { - "fast-decode-uri-component": "^1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/fast-redact": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.2.tgz", - "integrity": "sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fast-uri": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.2.0.tgz", - "integrity": "sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/netlify-cli/node_modules/fastify": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.17.0.tgz", - "integrity": "sha512-tzuY1tgWJo2Y6qEKwmLhFvACUmr68Io2pqP/sDKU71KRM6A6R3DrCDqLGqANbeLZcKUfdfY58ut35CGqemcTgg==", - "dev": true, - "dependencies": { - "@fastify/ajv-compiler": "^3.5.0", - "@fastify/error": "^3.0.0", - "@fastify/fast-json-stringify-compiler": "^4.3.0", - "abstract-logging": "^2.0.1", - "avvio": "^8.2.0", - "fast-content-type-parse": "^1.0.0", - "fast-json-stringify": "^5.7.0", - "find-my-way": "^7.6.0", - "light-my-request": "^5.6.1", - "pino": "^8.5.0", - "process-warning": "^2.0.0", - "proxy-addr": "^2.0.7", - "rfdc": "^1.3.0", - "secure-json-parse": "^2.5.0", - "semver": "^7.3.7", - "tiny-lru": "^11.0.1" - } - }, - "node_modules/netlify-cli/node_modules/fastify-plugin": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-4.4.0.tgz", - "integrity": "sha512-ovwFQG2qNy3jcCROiWpr94Hs0le+c7N/3t7m9aVwbFhkxcR/esp2xu25dP8e617HpQdmeDv+gFX4zagdUhDByw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/pino": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz", - "integrity": "sha512-3bKsVhBmgPjGV9pyn4fO/8RtoVDR8ssW1ev819FsRXlRNgW8gR/9Kx+gCK4UPWd4JjrRDLWpzd/pb1AyWm3MGA==", - "dev": true, - "dependencies": { - "atomic-sleep": "^1.0.0", - "fast-redact": "^3.1.1", - "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "v1.1.0", - "pino-std-serializers": "^6.0.0", - "process-warning": "^2.0.0", - "quick-format-unescaped": "^4.0.3", - "real-require": "^0.2.0", - "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^3.7.0", - "thread-stream": "^2.0.0" - }, - "bin": { - "pino": "bin.js" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-abstract-transport": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", - "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", - "dev": true, - "dependencies": { - "readable-stream": "^4.0.0", - "split2": "^4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-std-serializers": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/process-warning": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", - "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/readable-stream": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", - "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", - "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/sonic-boom": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.7.0.tgz", - "integrity": "sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==", - "dev": true, - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "dev": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/netlify-cli/node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/netlify-cli/node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, - "node_modules/netlify-cli/node_modules/fdir": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.0.1.tgz", - "integrity": "sha512-bdrUUb0eYQrPRlaAtlSRoLs7sp6yKEwbMQuUgwvi/14TnaqhM/deSZUrC5ic+yjm5nEPPWE61oWpTTxQFQMmLA==", - "dev": true, - "peerDependencies": { - "picomatch": "2.x" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/fecha": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", - "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fetch-blob": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", - "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/fetch-node-website/-/fetch-node-website-7.3.0.tgz", - "integrity": "sha512-/wayUHbdVUWrD72aqRNNrr6+MHnCkumZgNugN0RfiWJpbNJUdAkMk4Z18MGayGZVVqYXR1RWrV+bIFEt5HuBZg==", - "dev": true, - "dependencies": { - "cli-progress": "^3.11.2", - "colors-option": "^4.4.0", - "figures": "^5.0.0", - "got": "^12.3.1", - "is-plain-obj": "^4.1.0" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/colors-option": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-4.5.0.tgz", - "integrity": "sha512-Soe5lerRg3erMRgYC0EC696/8dMCGpBzcQchFfi55Yrkja8F+P7cUt0LVTIg7u5ob5BexLZ/F1kO+ejmv+nq8w==", - "dev": true, - "dependencies": { - "chalk": "^5.0.1", - "is-plain-obj": "^4.1.0" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/figures": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", - "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/file-type": { - "version": "18.5.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz", - "integrity": "sha512-yvpl5U868+V6PqXHMmsESpg6unQ5GfnPssl4dxdJudBrr9qy7Fddt7EVX1VLlddFfe8Gj9N7goCZH22FXuSQXQ==", - "dev": true, - "dependencies": { - "readable-web-to-node-stream": "^3.0.2", - "strtok3": "^7.0.0", - "token-types": "^5.0.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/file-type?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/filter-obj": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", - "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/find-my-way": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.2.tgz", - "integrity": "sha512-0OjHn1b1nCX3eVbm9ByeEHiscPYiHLfhei1wOUU9qffQkk98wE0Lo8VrVYfSGMgnSnDh86DxedduAnBf4nwUEw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-querystring": "^1.0.0", - "safe-regex2": "^2.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", - "dev": true, - "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/find-up/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/flush-write-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-2.0.0.tgz", - "integrity": "sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "node_modules/netlify-cli/node_modules/fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/folder-walker": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/folder-walker/-/folder-walker-3.2.0.tgz", - "integrity": "sha512-VjAQdSLsl6AkpZNyrQJfO7BXLo4chnStqb055bumZMbRUPpVuPN3a4ktsnRCmrFZjtMlYLkyXiR5rAs4WOpC4Q==", - "dev": true, - "dependencies": { - "from2": "^2.1.0" - } - }, - "node_modules/netlify-cli/node_modules/follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/netlify-cli/node_modules/form-data-encoder": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", - "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", - "dev": true, - "engines": { - "node": ">= 14.17" - } - }, - "node_modules/netlify-cli/node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dev": true, - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/from2-array": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/from2-array/-/from2-array-0.0.4.tgz", - "integrity": "sha512-0G0cAp7sYLobH7ALsr835x98PU/YeVF7wlwxdWbCUaea7wsa7lJfKZUAo6p2YZGZ8F94luCuqHZS3JtFER6uPg==", - "dev": true, - "dependencies": { - "from2": "^2.0.3" - } - }, - "node_modules/netlify-cli/node_modules/from2/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/netlify-cli/node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/fuzzy": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz", - "integrity": "sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/netlify-cli/node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "dev": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/gauge/node_modules/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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/get-amd-module-type": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-5.0.1.tgz", - "integrity": "sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/netlify-cli/node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/get-package-name": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/get-package-name/-/get-package-name-2.2.0.tgz", - "integrity": "sha512-LmCKVxioe63Fy6KDAQ/mmCSOSSRUE/x4zdrMD+7dU8quF3bGpzvP8mOmq4Dgce3nzU9AgkVDotucNOOg7c27BQ==", - "dev": true, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/get-port": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", - "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/get-port-please": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.1.tgz", - "integrity": "sha512-3UBAyM3u4ZBVYDsxOQfJDxEa6XTbpBDrOjp4mf7ExFRt5BKs/QywQQiJsh2B+hxcZLSapWqCRvElUe8DnKcFHA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/gh-release-fetch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-4.0.3.tgz", - "integrity": "sha512-TOiP1nwLsH5shG85Yt6v6Kjq5JU/44jXyEpbcfPgmj3C829yeXIlx9nAEwQRaxtRF3SJinn2lz7XUkfG9W/U4g==", - "dev": true, - "dependencies": { - "@xhmikosr/downloader": "^13.0.0", - "node-fetch": "^3.3.1", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.18.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/netlify-cli/node_modules/gh-release-fetch/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/git-repo-info": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/git-repo-info/-/git-repo-info-2.1.1.tgz", - "integrity": "sha512-8aCohiDo4jwjOwma4FmYFd3i97urZulL8XL24nIPxuE+GZnfsAyy/g2Shqx6OjUiFKUXZM+Yy+KHnOmmA3FVcg==", - "dev": true, - "engines": { - "node": ">= 4.0" - } - }, - "node_modules/netlify-cli/node_modules/gitconfiglocal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-2.1.0.tgz", - "integrity": "sha512-qoerOEliJn3z+Zyn1HW2F6eoYJqKwS6MgC9cztTLUB/xLWX8gD/6T60pKn4+t/d6tP7JlybI7Z3z+I572CR/Vg==", - "dev": true, - "dependencies": { - "ini": "^1.3.2" - } - }, - "node_modules/netlify-cli/node_modules/gitconfiglocal/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/netlify-cli/node_modules/global-cache-dir": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/global-cache-dir/-/global-cache-dir-4.4.0.tgz", - "integrity": "sha512-bk0gI6IbbphRjAaCJJn5H+T/CcEck5B3a5KBO2BXSDzjFSV+API17w8GA7YPJ6IXJiasW8M0VsEIig1PCHdfOQ==", - "dev": true, - "dependencies": { - "cachedir": "^2.3.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/netlify-cli/node_modules/global-cache-dir/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/gonzales-pe": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", - "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "gonzales": "bin/gonzales.js" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/netlify-cli/node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/h3": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/h3/-/h3-1.8.2.tgz", - "integrity": "sha512-1Ca0orJJlCaiFY68BvzQtP2lKLk46kcLAxVM8JgYbtm2cUg6IY7pjpYgWMwUvDO9QI30N5JAukOKoT8KD3Q0PQ==", - "dev": true, - "dependencies": { - "cookie-es": "^1.0.0", - "defu": "^6.1.2", - "destr": "^2.0.1", - "iron-webcrypto": "^0.10.1", - "radix3": "^1.1.0", - "ufo": "^1.3.0", - "uncrypto": "^0.1.3", - "unenv": "^1.7.4" - } - }, - "node_modules/netlify-cli/node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/has-own-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", - "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", - "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-yarn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", - "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/hasbin": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz", - "integrity": "sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==", - "dev": true, - "dependencies": { - "async": "~1.5" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/hasbin/node_modules/async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "dev": true, - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/hasha/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/hexer": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/hexer/-/hexer-1.5.0.tgz", - "integrity": "sha512-dyrPC8KzBzUJ19QTIo1gXNqIISRXQ0NwteW6OeQHRN4ZuZeHkdODfj0zHBdOlHbRY8GqbqK57C9oWSvQZizFsg==", - "dev": true, - "dependencies": { - "ansi-color": "^0.2.1", - "minimist": "^1.1.0", - "process": "^0.10.0", - "xtend": "^4.0.0" - }, - "bin": { - "hexer": "cli.js" - }, - "engines": { - "node": ">= 0.10.x" - } - }, - "node_modules/netlify-cli/node_modules/hexer/node_modules/process": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", - "integrity": "sha512-dyIett8dgGIZ/TXKUzeYExt7WA6ldDzys9vTDU/cCA9L17Ypme+KzS+NjQCjpn9xsvi/shbMC+yP/BcFMBz0NA==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/netlify-cli/node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/hot-shots": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/hot-shots/-/hot-shots-10.0.0.tgz", - "integrity": "sha512-uy/uGpuJk7yuyiKRfZMBNkF1GAOX5O2ifO9rDCaX9jw8fu6eW9QeWC7WRPDI+O98frW1HQgV3+xwjWsZPECIzQ==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "unix-dgram": "2.x" - } - }, - "node_modules/netlify-cli/node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/http-errors/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/http-proxy-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", - "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", - "dev": true, - "dependencies": { - "@types/http-proxy": "^1.17.8", - "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.2" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "@types/express": "^4.17.13" - }, - "peerDependenciesMeta": { - "@types/express": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/http-proxy-middleware/node_modules/is-plain-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", - "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/http-shutdown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/http-shutdown/-/http-shutdown-1.2.2.tgz", - "integrity": "sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==", - "dev": true, - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/netlify-cli/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/netlify-cli/node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/netlify-cli/node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/netlify-cli/node_modules/image-meta": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/image-meta/-/image-meta-0.2.0.tgz", - "integrity": "sha512-ZBGjl0ZMEMeOC3Ns0wUF/5UdUmr3qQhBSCniT0LxOgGGIRHiNFOkMtIHB7EOznRU47V2AxPgiVP+s+0/UCU0Hg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/netlify-cli/node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/netlify-cli/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, - "dependencies": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-1.4.0.tgz", - "integrity": "sha512-qHgHyJmbULt4hI+kCmwX92MnSxDs/Yhdt4wPA30qnoa01OF6uTXV8yvH4hKXgdaTNmkZ9D01MHjqKYEuJN+ONw==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.3.1", - "chalk": "^4.0.0", - "figures": "^3.2.0", - "run-async": "^2.4.0", - "rxjs": "^6.6.2" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "inquirer": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/inquirer/node_modules/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, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/inspect-with-kind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/inspect-with-kind/-/inspect-with-kind-1.0.5.tgz", - "integrity": "sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - } - }, - "node_modules/netlify-cli/node_modules/ioredis": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", - "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", - "dev": true, - "dependencies": { - "@ioredis/commands": "^1.1.1", - "cluster-key-slot": "^1.1.0", - "debug": "^4.3.4", - "denque": "^2.1.0", - "lodash.defaults": "^4.2.0", - "lodash.isarguments": "^3.1.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0", - "standard-as-callback": "^2.1.0" - }, - "engines": { - "node": ">=12.22.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/ioredis" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/netlify-cli/node_modules/ipx": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipx/-/ipx-2.0.1.tgz", - "integrity": "sha512-+EyZiVNosYr3hu3F5+5GripTBLjKmSPTvcy3YdT4zxlhqHQJ2gUopLGxpfv9Wd11YgeiPh53ysbtG+ZNIOVF4A==", - "dev": true, - "dependencies": { - "@fastify/accept-negotiator": "^1.1.0", - "citty": "^0.1.4", - "consola": "^3.2.3", - "defu": "^6.1.3", - "destr": "^2.0.2", - "etag": "^1.8.1", - "h3": "^1.8.2", - "image-meta": "^0.2.0", - "listhen": "^1.5.5", - "ofetch": "^1.3.3", - "pathe": "^1.1.1", - "sharp": "^0.32.6", - "svgo": "^3.0.2", - "ufo": "^1.3.1", - "unstorage": "^1.9.0", - "xss": "^1.0.14" - }, - "bin": { - "ipx": "bin/ipx.mjs" - } - }, - "node_modules/netlify-cli/node_modules/iron-webcrypto": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-0.10.1.tgz", - "integrity": "sha512-QGOS8MRMnj/UiOa+aMIgfyHcvkhqNUsUxb1XzskENvbo+rEfp6TOwqd1KPuDzXC4OnGHcMSVxDGRoilqB8ViqA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/brc-dd" - } - }, - "node_modules/netlify-cli/node_modules/is-accessor-descriptor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", - "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/netlify-cli/node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/is-builtin-module": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", - "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", - "dev": true, - "dependencies": { - "builtin-modules": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/netlify-cli/node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/is-data-descriptor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", - "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/is-descriptor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", - "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/is-docker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/is-extendable/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-installed-globally/node_modules/global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", - "dev": true, - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-npm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", - "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/is-url-superb": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", - "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/is-wsl/node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/is-yarn-global": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", - "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/iserror": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz", - "integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/jaeger-client": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/jaeger-client/-/jaeger-client-3.19.0.tgz", - "integrity": "sha512-M0c7cKHmdyEUtjemnJyx/y9uX16XHocL46yQvyqDlPdvAcwPDbHrIbKjQdBqtiE4apQ/9dmr+ZLJYYPGnurgpw==", - "dev": true, - "dependencies": { - "node-int64": "^0.4.0", - "opentracing": "^0.14.4", - "thriftrw": "^3.5.0", - "uuid": "^8.3.2", - "xorshift": "^1.1.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/jaeger-client/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/netlify-cli/node_modules/jest-get-type": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", - "dev": true, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/netlify-cli/node_modules/jest-validate": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz", - "integrity": "sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==", - "dev": true, - "dependencies": { - "@jest/types": "^27.5.1", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^27.5.1", - "leven": "^3.1.0", - "pretty-format": "^27.5.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/jest-validate/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/jiti": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", - "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", - "dev": true, - "bin": { - "jiti": "bin/jiti.js" - } - }, - "node_modules/netlify-cli/node_modules/js-string-escape": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", - "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/netlify-cli/node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "peer": true - }, - "node_modules/netlify-cli/node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/jsonpointer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", - "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/jsonwebtoken": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.1.tgz", - "integrity": "sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==", - "dev": true, - "dependencies": { - "jws": "^3.2.2", - "lodash": "^4.17.21", - "ms": "^2.1.1", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/junk": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", - "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dev": true, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/netlify-cli/node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dev": true, - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/netlify-cli/node_modules/jwt-decode": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/keep-func-props": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/keep-func-props/-/keep-func-props-4.0.1.tgz", - "integrity": "sha512-87ftOIICfdww3SxR5P1veq3ThBNyRPG0JGL//oaR08v0k2yTicEIHd7s0GqSJfQvlb+ybC3GiDepOweo0LDhvw==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/netlify-cli/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lambda-local": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/lambda-local/-/lambda-local-2.1.2.tgz", - "integrity": "sha512-nGTJn2JxZWcLGpNwXFmXC7UEXL7QCLieQWDiXs46vIv9y/gSPm/uHygEMCaym+HIziniAw0XIm+1VTrXCvG1Zw==", - "dev": true, - "dependencies": { - "commander": "^10.0.1", - "dotenv": "^16.3.1", - "winston": "^3.10.0" - }, - "bin": { - "lambda-local": "build/cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/winston": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", - "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", - "dev": true, - "dependencies": { - "@colors/colors": "^1.6.0", - "@dabh/diagnostics": "^2.0.2", - "async": "^3.2.3", - "is-stream": "^2.0.0", - "logform": "^2.4.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "safe-stable-stringify": "^2.3.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.5.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/latest-version": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", - "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", - "dev": true, - "dependencies": { - "package-json": "^8.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/lazystream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.5" - }, - "engines": { - "node": ">= 0.6.3" - } - }, - "node_modules/netlify-cli/node_modules/lazystream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/light-my-request": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.8.0.tgz", - "integrity": "sha512-4BtD5C+VmyTpzlDPCZbsatZMJVgUIciSOwYhJDCbLffPZ35KoDkDj4zubLeHDEb35b4kkPeEv5imbh+RJxK/Pg==", - "dev": true, - "dependencies": { - "cookie": "^0.5.0", - "process-warning": "^2.0.0", - "set-cookie-parser": "^2.4.1" - } - }, - "node_modules/netlify-cli/node_modules/light-my-request/node_modules/process-warning": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", - "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/listhen": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.5.5.tgz", - "integrity": "sha512-LXe8Xlyh3gnxdv4tSjTjscD1vpr/2PRpzq8YIaMJgyKzRG8wdISlWVWnGThJfHnlJ6hmLt2wq1yeeix0TEbuoA==", - "dev": true, - "dependencies": { - "@parcel/watcher": "^2.3.0", - "@parcel/watcher-wasm": "2.3.0", - "citty": "^0.1.4", - "clipboardy": "^3.0.0", - "consola": "^3.2.3", - "defu": "^6.1.2", - "get-port-please": "^3.1.1", - "h3": "^1.8.1", - "http-shutdown": "^1.2.2", - "jiti": "^1.20.0", - "mlly": "^1.4.2", - "node-forge": "^1.3.1", - "pathe": "^1.1.1", - "std-env": "^3.4.3", - "ufo": "^1.3.0", - "untun": "^0.1.2", - "uqr": "^0.1.2" - }, - "bin": { - "listen": "bin/listhen.mjs", - "listhen": "bin/listhen.mjs" - } - }, - "node_modules/netlify-cli/node_modules/listr2": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", - "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", - "dev": true, - "dependencies": { - "cli-truncate": "^3.1.0", - "colorette": "^2.0.20", - "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", - "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/listr2/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/listr2/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/listr2/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/listr2/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "dev": true, - "dependencies": { - "p-locate": "^6.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/locate-path/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/locate-path/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/locate-path/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.deburr": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", - "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.isempty": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", - "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/lodash.transform": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", - "integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/log-process-errors": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/log-process-errors/-/log-process-errors-8.0.0.tgz", - "integrity": "sha512-+SNGqNC1gCMJfhwYzAHr/YgNT/ZJc+V2nCkvtPnjrENMeCe+B/jgShBW0lmWoh6uVV2edFAPc/IUOkDdsjTbTg==", - "dev": true, - "dependencies": { - "colors-option": "^3.0.0", - "figures": "^4.0.0", - "filter-obj": "^3.0.0", - "jest-validate": "^27.4.2", - "map-obj": "^5.0.0", - "moize": "^6.1.0", - "semver": "^7.3.5" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/figures": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", - "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/filter-obj": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", - "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", - "dev": true, - "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", - "dev": true, - "dependencies": { - "ansi-escapes": "^5.0.0", - "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", - "dev": true, - "dependencies": { - "type-fest": "^1.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dev": true, - "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/logform": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", - "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", - "dev": true, - "dependencies": { - "@colors/colors": "1.5.0", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "safe-stable-stringify": "^2.3.1", - "triple-beam": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/luxon": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", - "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/macos-release": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.0.1.tgz", - "integrity": "sha512-3l6OrhdDg2H2SigtuN3jBh+5dRJRWxNKuJTPBbGeNJTsmt/pj9PO25wYaNb05NuNmAsl435j4rDP6rgNXz7s7g==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/netlify-cli/node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/maxstache": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/maxstache/-/maxstache-1.0.7.tgz", - "integrity": "sha1-IjHVGAung9Xs/DHEX+2seuQnaYQ=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/maxstache-stream": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/maxstache-stream/-/maxstache-stream-1.0.4.tgz", - "integrity": "sha1-nH9cq35f3S2Q2oYUO06WMeoygEA=", - "dev": true, - "dependencies": { - "maxstache": "^1.0.0", - "pump": "^1.0.0", - "split2": "^1.0.0", - "through2": "^2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/split2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/split2/-/split2-1.1.1.tgz", - "integrity": "sha512-cfurE2q8LamExY+lJ9Ex3ZfBwqAPduzOKVscPDXNCLLMvyaeD3DTz1yk7fVIs6Chco+12XeD0BB6HEoYzPYbXA==", - "dev": true, - "dependencies": { - "through2": "~2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/netlify-cli/node_modules/md5-hex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", - "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", - "dev": true, - "dependencies": { - "blueimp-md5": "^2.10.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/memoize-one": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", - "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "dev": true, - "dependencies": { - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/merge-options/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/micro-api-client": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/micro-api-client/-/micro-api-client-3.3.0.tgz", - "integrity": "sha512-y0y6CUB9RLVsy3kfgayU28746QrNMpSm9O/AYGNsBgOkJr/X/Jk0VLGoO8Ude7Bpa8adywzF+MzXNZRFRsNPhg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/micro-memoize": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/micro-memoize/-/micro-memoize-4.0.11.tgz", - "integrity": "sha512-CjxsaYe4j43df32DtzzNCwanPqZjZDwuQAZilsCYpa2ZVtSPDjHXbTlR4gsEZRyO9/twHs0b7HLjvy/sowl7sA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/netlify-cli/node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "mime-db": "1.51.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/netlify-cli/node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", - "dev": true, - "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", - "pkg-types": "^1.0.3", - "ufo": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/module-definition": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-5.0.1.tgz", - "integrity": "sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==", - "dev": true, - "dependencies": { - "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.1" - }, - "bin": { - "module-definition": "bin/cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/module-details-from-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", - "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/moize": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/moize/-/moize-6.1.3.tgz", - "integrity": "sha512-Cn+1T5Ypieeo46fn8X98V2gHj2VSRohVPjvT8BRvNANJJC3UOeege/G84xA/3S9c5qA4p9jOdSB1jfhumwe8qw==", - "dev": true, - "dependencies": { - "fast-equals": "^3.0.1", - "micro-memoize": "^4.0.11" - } - }, - "node_modules/netlify-cli/node_modules/move-file": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/move-file/-/move-file-3.0.0.tgz", - "integrity": "sha512-v6u4XjX3MFW6Jo1V/YfbhC7eiGSgvYPJ/NM+aGtTtB9/Y6IYj7YViaHu6dkgDsZFB7MbnAoSI5+Z26XZXnP0vg==", - "dev": true, - "dependencies": { - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/move-file/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/multiparty": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.2.3.tgz", - "integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==", - "dev": true, - "dependencies": { - "http-errors": "~1.8.1", - "safe-buffer": "5.2.1", - "uid-safe": "2.1.5" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/netlify-cli/node_modules/multiparty/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", - "dev": true, - "optional": true - }, - "node_modules/netlify-cli/node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/netlify-cli/node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/nested-error-stacks": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", - "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.11", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.11.tgz", - "integrity": "sha512-exrD6cqwo5avDNtU7YT9iuN0+yoW+aaEUxvr/39oP36wZRKreoPm6KNVisTR9d4lXrPeUG8XI+rERuLhwMQmdw==", - "dev": true, - "dependencies": { - "@netlify/open-api": "^2.26.0", - "lodash-es": "^4.17.21", - "micro-api-client": "^3.3.0", - "node-fetch": "^3.0.0", - "omit.js": "^2.0.2", - "p-wait-for": "^4.0.0", - "qs": "^6.9.6" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/netlify-headers-parser": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.2.tgz", - "integrity": "sha512-DfoboA8PrcLXMan3jIVyLsQtKS+nepKDx6WwZKk5EQDMr2AJoBPCtSHTOLuABzkde1UXdOITf3snmcAmzlNLqw==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "fast-safe-stringify": "^2.0.7", - "is-plain-obj": "^4.0.0", - "map-obj": "^5.0.0", - "path-exists": "^5.0.0", - "toml": "^3.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/netlify-redirect-parser": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.0.tgz", - "integrity": "sha512-3Mi7sMH7XXZhjvXx/5RtJ/rU/E6zKkE4etcYQbEu8B3r872D0opoYyGdPW/MvaYQyVdfg23XEFaEI4zzQTupaw==", - "dev": true, - "dependencies": { - "fast-safe-stringify": "^2.1.1", - "filter-obj": "^5.0.0", - "is-plain-obj": "^4.0.0", - "path-exists": "^5.0.0", - "toml": "^3.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/netlify-redirect-parser/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/netlify-redirector": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.5.0.tgz", - "integrity": "sha512-4zdzIP+6muqPCuE8avnrgDJ6KW/2+UpHTRcTbMXCIRxiRmyrX+IZ4WSJGZdHPWF3WmQpXpy603XxecZ9iygN7w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/netlify/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/netlify-cli/node_modules/netlify/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/netlify/node_modules/p-wait-for": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", - "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", - "dev": true, - "dependencies": { - "p-timeout": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/node-abi": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", - "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", - "dev": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/node-addon-api": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", - "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/netlify-cli/node_modules/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/node-fetch-native": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.4.1.tgz", - "integrity": "sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", - "dev": true, - "engines": { - "node": ">= 6.13.0" - } - }, - "node_modules/netlify-cli/node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", - "dev": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/netlify-cli/node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/node-source-walk": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.1.tgz", - "integrity": "sha512-QUlkJYzrNewUCp4c7CCPN8Mh8c+pwNs23JsQfHKUwIkCxYa6c0AFLuUJIZxU6BdnarfytPSGKm1YMAz06hj9cw==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.21.8" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/node-stream-zip": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", - "integrity": "sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==", - "dev": true, - "engines": { - "node": ">=0.12.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/antelle" - } - }, - "node_modules/netlify-cli/node_modules/node-version-alias": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/node-version-alias/-/node-version-alias-3.4.1.tgz", - "integrity": "sha512-Kf3L9spAL6lEHMPyqpwHSTNG3LPkOXBfSUnBMG/YE2TdoC8Qoqf0+qg01nr6K9MFQEcXtWUyTQzLJByRixSBsA==", - "dev": true, - "dependencies": { - "all-node-versions": "^11.3.0", - "filter-obj": "^5.1.0", - "is-plain-obj": "^4.1.0", - "normalize-node-version": "^12.4.0", - "path-exists": "^5.0.0", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/netlify-cli/node_modules/node-version-alias/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/noop2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/noop2/-/noop2-2.0.0.tgz", - "integrity": "sha1-S2NgFemIK1R4PAK0EvaZ2MXNCls=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/normalize-node-version": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/normalize-node-version/-/normalize-node-version-12.4.0.tgz", - "integrity": "sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==", - "dev": true, - "dependencies": { - "all-node-versions": "^11.3.0", - "filter-obj": "^5.1.0", - "semver": "^7.3.7" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/netlify-cli/node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/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, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/npm-run-path/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "dev": true, - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/ofetch": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", - "integrity": "sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==", - "dev": true, - "dependencies": { - "destr": "^2.0.1", - "node-fetch-native": "^1.4.0", - "ufo": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/omit.js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-2.0.2.tgz", - "integrity": "sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/on-exit-leak-free": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", - "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/netlify-cli/node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/netlify-cli/node_modules/one-time": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "dev": true, - "dependencies": { - "fn.name": "1.x.x" - } - }, - "node_modules/netlify-cli/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/onetime/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/open": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", - "dev": true, - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/open/node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/opentracing": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.7.tgz", - "integrity": "sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/ora": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", - "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", - "dev": true, - "dependencies": { - "chalk": "^5.0.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.6.1", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.1.0", - "log-symbols": "^5.1.0", - "stdin-discarder": "^0.1.0", - "strip-ansi": "^7.0.1", - "wcwidth": "^1.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/ora/node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dev": true, - "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/ora/node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/os-name": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", - "integrity": "sha512-0EQpaHUHq7olp2/YFUr+0vZi9tMpDTblHGz+Ch5RntKxiRXOAY0JOz1UlxhSjMSksHvkm13eD6elJj3M8Ht/kw==", - "dev": true, - "dependencies": { - "macos-release": "^3.0.1", - "windows-release": "^5.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/p-event": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", - "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", - "dev": true, - "dependencies": { - "p-timeout": "^5.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-event/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-every": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-every/-/p-every-2.0.0.tgz", - "integrity": "sha512-MCz9DqD5opPC48Zsd+BHm56O/HfhYIQQtupfDzhXoVgQdg/Ux4F8/JcdRuQ+arq7zD5fB6zP3axbH3d9Nr8dlw==", - "dev": true, - "dependencies": { - "p-map": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/p-every/node_modules/p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/p-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", - "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", - "dev": true, - "dependencies": { - "p-map": "^5.1.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-map": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", - "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", - "dev": true, - "dependencies": { - "aggregate-error": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-reduce": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", - "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-retry": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", - "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", - "dev": true, - "dependencies": { - "@types/retry": "0.12.1", - "retry": "^0.13.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-wait-for": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-5.0.2.tgz", - "integrity": "sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==", - "dev": true, - "dependencies": { - "p-timeout": "^6.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-wait-for/node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", - "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", - "dev": true, - "dependencies": { - "got": "^12.1.0", - "registry-auth-token": "^5.0.1", - "registry-url": "^6.0.0", - "semver": "^7.3.7" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "dependencies": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "node_modules/netlify-cli/node_modules/parallel-transform/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/parse-github-url": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", - "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", - "dev": true, - "bin": { - "parse-github-url": "cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/parse-gitignore": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parse-gitignore/-/parse-gitignore-2.0.0.tgz", - "integrity": "sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/parse-ms": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", - "integrity": "sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/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=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/peek-readable": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", - "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/netlify-cli/node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/netlify-cli/node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/postcss": { - "version": "8.4.31", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", - "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/netlify-cli/node_modules/postcss-values-parser": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", - "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", - "dev": true, - "dependencies": { - "color-name": "^1.1.4", - "is-url-superb": "^4.0.0", - "quote-unquote": "^1.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "postcss": "^8.2.9" - } - }, - "node_modules/netlify-cli/node_modules/postcss-values-parser/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", - "dev": true, - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "dev": true, - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/precinct": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.2.tgz", - "integrity": "sha512-UuhB1q0nEFf80iMGcs7IoT0o1GnNFWT4CjZjcMsHDXAIsW/aiLovOSbeMJ2Ejg6raRsplsriZZkoBUh0h/IHlw==", - "dev": true, - "dependencies": { - "@dependents/detective-less": "^4.0.0", - "commander": "^10.0.1", - "detective-amd": "^5.0.1", - "detective-cjs": "^5.0.1", - "detective-es6": "^4.0.0", - "detective-postcss": "^6.1.3", - "detective-sass": "^5.0.0", - "detective-scss": "^4.0.0", - "detective-stylus": "^4.0.0", - "detective-typescript": "^11.0.1", - "module-definition": "^5.0.0", - "node-source-walk": "^6.0.1" - }, - "bin": { - "precinct": "bin/cli.js" - }, - "engines": { - "node": "^14.14.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/precond": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", - "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/netlify-cli/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/pretty-ms": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-8.0.0.tgz", - "integrity": "sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==", - "dev": true, - "dependencies": { - "parse-ms": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/prettyjson": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.5.tgz", - "integrity": "sha512-rksPWtoZb2ZpT5OVgtmy0KHVM+Dca3iVwWY9ifwhcexfjebtgjg3wmrUt9PvJ59XIYBcknQeYHD8IAnVlh9lAw==", - "dev": true, - "dependencies": { - "colors": "1.4.0", - "minimist": "^1.2.0" - }, - "bin": { - "prettyjson": "bin/prettyjson" - } - }, - "node_modules/netlify-cli/node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/netlify-cli/node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/protobufjs": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", - "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/netlify-cli/node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/ps-list": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-8.1.0.tgz", - "integrity": "sha512-NoGBqJe7Ou3kfQxEvDzDyKGAyEgwIuD3YrfXinjcCmBRv0hTld0Xb71hrXvtsNPj7HSFATfemvzB8PPJtq6Yag==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/netlify-cli/node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/pupa": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", - "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", - "dev": true, - "dependencies": { - "escape-goat": "^4.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/queue-tick": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", - "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/quote-unquote": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", - "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/radix3": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.0.tgz", - "integrity": "sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/raw-body/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/raw-body/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/netlify-cli/node_modules/rc/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/read-pkg-up": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", - "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", - "dev": true, - "dependencies": { - "find-up": "^6.3.0", - "read-pkg": "^7.1.0", - "type-fest": "^2.5.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/read-pkg": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", - "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.1", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^2.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/netlify-cli/node_modules/readable-web-to-node-stream": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", - "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", - "dev": true, - "dependencies": { - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/netlify-cli/node_modules/readdir-glob": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", - "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", - "dev": true, - "dependencies": { - "minimatch": "^5.1.0" - } - }, - "node_modules/netlify-cli/node_modules/readdir-glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/readdir-glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/netlify-cli/node_modules/real-require": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", - "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", - "dev": true, - "engines": { - "node": ">= 12.13.0" - } - }, - "node_modules/netlify-cli/node_modules/redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", - "dev": true, - "dependencies": { - "redis-errors": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/regex-not/node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, - "node_modules/netlify-cli/node_modules/regexp-tree": { - "version": "0.1.24", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz", - "integrity": "sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==", - "dev": true, - "bin": { - "regexp-tree": "bin/regexp-tree" - } - }, - "node_modules/netlify-cli/node_modules/registry-auth-token": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", - "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", - "dev": true, - "dependencies": { - "@pnpm/npm-conf": "^2.1.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/registry-url": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", - "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", - "dev": true, - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/require-in-the-middle": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", - "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "module-details-from-path": "^1.0.3", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/netlify-cli/node_modules/require-in-the-middle/node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/require-package-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", - "integrity": "sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/resolve": { - "version": "2.0.0-next.5", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", - "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, - "node_modules/netlify-cli/node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", - "dev": true, - "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/restore-cursor/node_modules/onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/netlify-cli/node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/netlify-cli/node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/netlify-cli/node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/netlify-cli/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/safe-json-stringify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", - "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "ret": "~0.2.0" - } - }, - "node_modules/netlify-cli/node_modules/safe-regex2/node_modules/ret": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", - "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/safe-stable-stringify": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", - "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/secure-json-parse": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.6.0.tgz", - "integrity": "sha512-B9osKohb6L+EZ6Kve3wHKfsAClzOC/iISA2vSuCe5Jx5NAKiwitfxx8ZKYapHXr0sYRj7UZInT7pLb3rp2Yx6A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/seek-bzip": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", - "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", - "dev": true, - "dependencies": { - "commander": "^2.8.1" - }, - "bin": { - "seek-bunzip": "bin/seek-bunzip", - "seek-table": "bin/seek-bzip-table" - } - }, - "node_modules/netlify-cli/node_modules/seek-bzip/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/semver-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", - "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", - "dev": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/send/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/send/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dev": true, - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/set-cookie-parser": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz", - "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/set-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/set-value/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/sharp": { - "version": "0.32.6", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", - "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "color": "^4.2.3", - "detect-libc": "^2.0.2", - "node-addon-api": "^6.1.0", - "prebuild-install": "^7.1.1", - "semver": "^7.5.4", - "simple-get": "^4.0.1", - "tar-fs": "^3.0.4", - "tunnel-agent": "^0.6.0" - }, - "engines": { - "node": ">=14.15.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/netlify-cli/node_modules/sharp/node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" - }, - "engines": { - "node": ">=12.5.0" - } - }, - "node_modules/netlify-cli/node_modules/sharp/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/sharp/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/sharp/node_modules/node-addon-api": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", - "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", - "dev": true, - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, - "node_modules/netlify-cli/node_modules/simple-swizzle/node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==", - "dev": true, - "dependencies": { - "is-plain-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/sort-keys-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz", - "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", - "dev": true, - "dependencies": { - "sort-keys": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/sort-keys/node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/netlify-cli/node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated", - "dev": true - }, - "node_modules/netlify-cli/node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/netlify-cli/node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/netlify-cli/node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/stack-generator": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", - "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", - "dev": true, - "dependencies": { - "stackframe": "^1.3.4" - } - }, - "node_modules/netlify-cli/node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/stackframe": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", - "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/standard-as-callback": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", - "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/std-env": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", - "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/stdin-discarder": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", - "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", - "dev": true, - "dependencies": { - "bl": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/netlify-cli/node_modules/streamx": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", - "integrity": "sha512-HcxY6ncGjjklGs1xsP1aR71INYcsXFJet5CU1CHqihQ2J5nOsbd4OjgjHO42w/4QNv9gZb3BueV+Vxok5pLEXg==", - "dev": true, - "dependencies": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/netlify-cli/node_modules/string-template": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", - "integrity": "sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/string-width/node_modules/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, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/string-width/node_modules/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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/strip-ansi-control-characters": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi-control-characters/-/strip-ansi-control-characters-2.0.0.tgz", - "integrity": "sha512-Q0/k5orrVGeaOlIOUn1gybGU0IcAbgHQT1faLo5hik4DqClKVSaka5xOhNNoRgtfztHVxCYxi7j71mrWom0bIw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/strip-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-3.0.0.tgz", - "integrity": "sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ==", - "dev": true, - "dependencies": { - "inspect-with-kind": "^1.0.5", - "is-plain-obj": "^1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/strip-dirs/node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/strtok3": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", - "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", - "dev": true, - "dependencies": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^5.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/netlify-cli/node_modules/supports-color": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", - "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/supports-hyperlinks/node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/netlify-cli/node_modules/svgo": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", - "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", - "dev": true, - "dependencies": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^5.1.0", - "css-tree": "^2.2.1", - "csso": "^5.0.5", - "picocolors": "^1.0.0" - }, - "bin": { - "svgo": "bin/svgo" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/svgo" - } - }, - "node_modules/netlify-cli/node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/netlify-cli/node_modules/tabtab": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-3.0.2.tgz", - "integrity": "sha512-jANKmUe0sIQc/zTALTBy186PoM/k6aPrh3A7p6AaAfF6WPSbTx1JYeGIGH162btpH+mmVEXln+UxwViZHO2Jhg==", - "dev": true, - "dependencies": { - "debug": "^4.0.1", - "es6-promisify": "^6.0.0", - "inquirer": "^6.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "untildify": "^3.0.3" - } - }, - "node_modules/netlify-cli/node_modules/tar": { - "version": "6.1.15", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", - "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", - "dev": true, - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", - "dev": true, - "dependencies": { - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - } - }, - "node_modules/netlify-cli/node_modules/tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", - "dev": true, - "dependencies": { - "b4a": "^1.6.4", - "fast-fifo": "^1.2.0", - "streamx": "^2.15.0" - } - }, - "node_modules/netlify-cli/node_modules/tar/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/tempy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", - "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", - "dev": true, - "dependencies": { - "is-stream": "^3.0.0", - "temp-dir": "^2.0.0", - "type-fest": "^2.12.2", - "unique-string": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/tempy/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/terminal-link": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-3.0.0.tgz", - "integrity": "sha512-flFL3m4wuixmf6IfhFJd1YPiLiMuxEc8uHRM1buzIeZPm22Au2pDqBJQgdo7n1WfPU1ONFGv7YDwpFBmHGF6lg==", - "dev": true, - "dependencies": { - "ansi-escapes": "^5.0.0", - "supports-hyperlinks": "^2.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/terminal-link/node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", - "dev": true, - "dependencies": { - "type-fest": "^1.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/terminal-link/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/thread-stream": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", - "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", - "dev": true, - "dependencies": { - "real-require": "^0.2.0" - } - }, - "node_modules/netlify-cli/node_modules/thriftrw": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/thriftrw/-/thriftrw-3.11.4.tgz", - "integrity": "sha512-UcuBd3eanB3T10nXWRRMwfwoaC6VMk7qe3/5YIWP2Jtw+EbHqJ0p1/K3x8ixiR5dozKSSfcg1W+0e33G1Di3XA==", - "dev": true, - "dependencies": { - "bufrw": "^1.2.1", - "error": "7.0.2", - "long": "^2.4.0" - }, - "bin": { - "thrift2json": "thrift2json.js" - }, - "engines": { - "node": ">= 0.10.x" - } - }, - "node_modules/netlify-cli/node_modules/thriftrw/node_modules/long": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", - "integrity": "sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/netlify-cli/node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/through2-filter/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/through2-filter/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/netlify-cli/node_modules/through2-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-map/-/through2-map-3.0.0.tgz", - "integrity": "sha512-Ms68QPbSJKjRYY7fmqZHB0VGt+vD0/tjmDHUWgxltjifCof6hZWWeQAEi27Wjbs7jyNlIIyerQw/TVj7gHkd/Q==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/through2-map/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/through2-map/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/netlify-cli/node_modules/time-zone": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", - "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/tiny-lru": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-11.0.1.tgz", - "integrity": "sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/netlify-cli/node_modules/tmp-promise": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", - "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", - "dev": true, - "dependencies": { - "tmp": "^0.2.0" - } - }, - "node_modules/netlify-cli/node_modules/tmp-promise/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/netlify-cli/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/to-readable-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-3.0.0.tgz", - "integrity": "sha512-vD2LytT6DxPynBa1xbMtswY9gGqj27wNbh2uvI5OhBe+mrGLurRWRQZyQn3812sqlQRtUJwaKVshG+PoGwbPDQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/netlify-cli/node_modules/to-regex/node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, - "node_modules/netlify-cli/node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/netlify-cli/node_modules/token-types": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", - "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", - "dev": true, - "dependencies": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/netlify-cli/node_modules/toml": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", - "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/tomlify-j0.4": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tomlify-j0.4/-/tomlify-j0.4-3.0.0.tgz", - "integrity": "sha512-2Ulkc8T7mXJ2l0W476YC/A209PR38Nw8PuaCNtk9uI3t1zzFdGQeWYGQvmj2PZkVvRC/Yoi4xQKMRnWc/N29tQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/netlify-cli/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/netlify-cli/node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/netlify-cli/node_modules/ufo": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", - "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "dev": true, - "dependencies": { - "random-bytes": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/ulid": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/ulid/-/ulid-2.3.0.tgz", - "integrity": "sha512-keqHubrlpvT6G2wH0OEfSW4mquYRcbe/J8NMmveoQOjUqmo+hXtO+ORCpWhdbZ7k72UtY61BL7haGxW6enBnjw==", - "dev": true, - "bin": { - "ulid": "bin/cli.js" - } - }, - "node_modules/netlify-cli/node_modules/unbzip2-stream": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", - "dev": true, - "dependencies": { - "buffer": "^5.2.1", - "through": "^2.3.8" - } - }, - "node_modules/netlify-cli/node_modules/uncrypto": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", - "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/unenv": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.7.4.tgz", - "integrity": "sha512-fjYsXYi30It0YCQYqLOcT6fHfMXsBr2hw9XC7ycf8rTG7Xxpe3ZssiqUnD0khrjiZEmkBXWLwm42yCSCH46fMw==", - "dev": true, - "dependencies": { - "consola": "^3.2.3", - "defu": "^6.1.2", - "mime": "^3.0.0", - "node-fetch-native": "^1.4.0", - "pathe": "^1.1.1" - } - }, - "node_modules/netlify-cli/node_modules/unenv/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/netlify-cli/node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/union-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unique-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", - "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", - "dev": true, - "dependencies": { - "crypto-random-string": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/unix-dgram": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/unix-dgram/-/unix-dgram-2.0.6.tgz", - "integrity": "sha512-AURroAsb73BZ6CdAyMrTk/hYKNj3DuYYEuOaB8bYMOHGKupRNScw90Q5C71tWJc3uE7dIeXRyuwN0xLLq3vDTg==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.16.0" - }, - "engines": { - "node": ">=0.10.48" - } - }, - "node_modules/netlify-cli/node_modules/unixify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unixify/-/unixify-1.0.0.tgz", - "integrity": "sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==", - "dev": true, - "dependencies": { - "normalize-path": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unixify/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unstorage": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.9.0.tgz", - "integrity": "sha512-VpD8ZEYc/le8DZCrny3bnqKE4ZjioQxBRnWE+j5sGNvziPjeDlaS1NaFFHzl/kkXaO3r7UaF8MGQrs14+1B4pQ==", - "dev": true, - "dependencies": { - "anymatch": "^3.1.3", - "chokidar": "^3.5.3", - "destr": "^2.0.1", - "h3": "^1.7.1", - "ioredis": "^5.3.2", - "listhen": "^1.2.2", - "lru-cache": "^10.0.0", - "mri": "^1.2.0", - "node-fetch-native": "^1.2.0", - "ofetch": "^1.1.1", - "ufo": "^1.2.0" - }, - "peerDependencies": { - "@azure/app-configuration": "^1.4.1", - "@azure/cosmos": "^3.17.3", - "@azure/data-tables": "^13.2.2", - "@azure/identity": "^3.2.3", - "@azure/keyvault-secrets": "^4.7.0", - "@azure/storage-blob": "^12.14.0", - "@capacitor/preferences": "^5.0.0", - "@planetscale/database": "^1.8.0", - "@upstash/redis": "^1.22.0", - "@vercel/kv": "^0.2.2", - "idb-keyval": "^6.2.1" - }, - "peerDependenciesMeta": { - "@azure/app-configuration": { - "optional": true - }, - "@azure/cosmos": { - "optional": true - }, - "@azure/data-tables": { - "optional": true - }, - "@azure/identity": { - "optional": true - }, - "@azure/keyvault-secrets": { - "optional": true - }, - "@azure/storage-blob": { - "optional": true - }, - "@capacitor/preferences": { - "optional": true - }, - "@planetscale/database": { - "optional": true - }, - "@upstash/redis": { - "optional": true - }, - "@vercel/kv": { - "optional": true - }, - "idb-keyval": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/unstorage/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/netlify-cli/node_modules/untildify": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", - "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/untun": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.2.tgz", - "integrity": "sha512-wLAMWvxfqyTiBODA1lg3IXHQtjggYLeTK7RnSfqtOXixWJ3bAa2kK/HHmOOg19upteqO3muLvN6O/icbyQY33Q==", - "dev": true, - "dependencies": { - "citty": "^0.1.3", - "consola": "^3.2.3", - "pathe": "^1.1.1" - }, - "bin": { - "untun": "bin/untun.mjs" - } - }, - "node_modules/netlify-cli/node_modules/update-notifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", - "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", - "dev": true, - "dependencies": { - "boxen": "^7.0.0", - "chalk": "^5.0.1", - "configstore": "^6.0.0", - "has-yarn": "^3.0.0", - "import-lazy": "^4.0.0", - "is-ci": "^3.0.1", - "is-installed-globally": "^0.4.0", - "is-npm": "^6.0.0", - "is-yarn-global": "^0.4.0", - "latest-version": "^7.0.0", - "pupa": "^3.1.0", - "semver": "^7.3.7", - "semver-diff": "^4.0.0", - "xdg-basedir": "^5.1.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/uqr": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/uqr/-/uqr-0.1.2.tgz", - "integrity": "sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/netlify-cli/node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, - "node_modules/netlify-cli/node_modules/urlpattern-polyfill": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz", - "integrity": "sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/netlify-cli/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/netlify-cli/node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/netlify-cli/node_modules/validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", - "dev": true, - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/wait-port": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.0.4.tgz", - "integrity": "sha512-w8Ftna3h6XSFWWc2JC5gZEgp64nz8bnaTp5cvzbJSZ53j+omktWTDdwXxEF0jM8YveviLgFWvNGrSvRHnkyHyw==", - "dev": true, - "dependencies": { - "chalk": "^4.1.2", - "commander": "^9.3.0", - "debug": "^4.3.4" - }, - "bin": { - "wait-port": "bin/wait-port.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/wait-port/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/wait-port/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/wait-port/node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || >=14" - } - }, - "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" - } - }, - "node_modules/netlify-cli/node_modules/web-streams-polyfill": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", - "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/well-known-symbols": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", - "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/netlify-cli/node_modules/whatwg-url/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/netlify-cli/node_modules/widest-line": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", - "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", - "dev": true, - "dependencies": { - "string-width": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/widest-line/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/widest-line/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/windows-release": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.0.1.tgz", - "integrity": "sha512-y1xFdFvdMiDXI3xiOhMbJwt1Y7dUxidha0CWPs1NgjZIjZANTcX7+7bMqNjuezhzb8s5JGEiBAbQjQQYYy7ulw==", - "dev": true, - "dependencies": { - "execa": "^5.1.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/winston-transport": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", - "dev": true, - "dependencies": { - "logform": "^2.3.2", - "readable-stream": "^3.6.0", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 6.4.0" - } - }, - "node_modules/netlify-cli/node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/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, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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 - }, - "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/netlify-cli/node_modules/write-file-atomic": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/netlify-cli/node_modules/write-file-atomic/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/xdg-basedir": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", - "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/xorshift": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/xorshift/-/xorshift-1.2.0.tgz", - "integrity": "sha512-iYgNnGyeeJ4t6U11NpA/QiKy+PXn5Aa3Azg5qkwIFz1tBLllQrjjsk9yzD7IAK0naNU4JxdeDgqW9ov4u/hc4g==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/xss": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", - "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", - "dev": true, - "dependencies": { - "commander": "^2.20.3", - "cssfilter": "0.0.10" - }, - "bin": { - "xss": "bin/xss" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/xss/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/netlify-cli/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/yargs/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/yargs/node_modules/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, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/yargs/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/netlify-cli/node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/zip-stream": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz", - "integrity": "sha512-UfZ0oa0C8LI58wJ+moL46BDIMgCQbnsb+2PoiJYtonhBsMh2bq1eRBVkvjfVsqbEHd9/EgKPUuL9saSSsec8OA==", - "dev": true, - "dependencies": { - "archiver-utils": "^4.0.1", - "compress-commons": "^5.0.1", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/netlify-cli/tools/lint-rules": { - "name": "eslint-plugin-workspace", - "extraneous": true - }, - "node_modules/nlcst-to-string": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", - "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", - "dependencies": { - "@types/nlcst": "^1.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/node-emoji": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", - "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", - "dev": true, - "peer": true, - "dependencies": { - "@sindresorhus/is": "^4.6.0", - "char-regex": "^1.0.2", - "emojilib": "^2.4.0", - "skin-tone": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" - }, - "node_modules/normalize-package-data": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", - "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", - "dev": true, - "dependencies": { - "hosted-git-info": "^7.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/npm/-/npm-10.4.0.tgz", - "integrity": "sha512-RS7Mx0OVfXlOcQLRePuDIYdFCVBPCNapWHplDK+mh7GDdP/Tvor4ocuybRRPSvfcRb2vjRJt1fHCqw3cr8qACQ==", - "bundleDependencies": [ - "@isaacs/string-locale-compare", - "@npmcli/arborist", - "@npmcli/config", - "@npmcli/fs", - "@npmcli/map-workspaces", - "@npmcli/package-json", - "@npmcli/promise-spawn", - "@npmcli/run-script", - "@sigstore/tuf", - "abbrev", - "archy", - "cacache", - "chalk", - "ci-info", - "cli-columns", - "cli-table3", - "columnify", - "fastest-levenshtein", - "fs-minipass", - "glob", - "graceful-fs", - "hosted-git-info", - "ini", - "init-package-json", - "is-cidr", - "json-parse-even-better-errors", - "libnpmaccess", - "libnpmdiff", - "libnpmexec", - "libnpmfund", - "libnpmhook", - "libnpmorg", - "libnpmpack", - "libnpmpublish", - "libnpmsearch", - "libnpmteam", - "libnpmversion", - "make-fetch-happen", - "minimatch", - "minipass", - "minipass-pipeline", - "ms", - "node-gyp", - "nopt", - "normalize-package-data", - "npm-audit-report", - "npm-install-checks", - "npm-package-arg", - "npm-pick-manifest", - "npm-profile", - "npm-registry-fetch", - "npm-user-validate", - "npmlog", - "p-map", - "pacote", - "parse-conflict-json", - "proc-log", - "qrcode-terminal", - "read", - "semver", - "spdx-expression-parse", - "ssri", - "supports-color", - "tar", - "text-table", - "tiny-relative-date", - "treeverse", - "validate-npm-package-name", - "which", - "write-file-atomic" - ], - "dev": true, - "dependencies": { - "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^7.2.1", - "@npmcli/config": "^8.0.2", - "@npmcli/fs": "^3.1.0", - "@npmcli/map-workspaces": "^3.0.4", - "@npmcli/package-json": "^5.0.0", - "@npmcli/promise-spawn": "^7.0.1", - "@npmcli/run-script": "^7.0.4", - "@sigstore/tuf": "^2.3.0", - "abbrev": "^2.0.0", - "archy": "~1.0.0", - "cacache": "^18.0.2", - "chalk": "^5.3.0", - "ci-info": "^4.0.0", - "cli-columns": "^4.0.0", - "cli-table3": "^0.6.3", - "columnify": "^1.6.0", - "fastest-levenshtein": "^1.0.16", - "fs-minipass": "^3.0.3", - "glob": "^10.3.10", - "graceful-fs": "^4.2.11", - "hosted-git-info": "^7.0.1", - "ini": "^4.1.1", - "init-package-json": "^6.0.0", - "is-cidr": "^5.0.3", - "json-parse-even-better-errors": "^3.0.1", - "libnpmaccess": "^8.0.1", - "libnpmdiff": "^6.0.3", - "libnpmexec": "^7.0.4", - "libnpmfund": "^5.0.1", - "libnpmhook": "^10.0.0", - "libnpmorg": "^6.0.1", - "libnpmpack": "^6.0.3", - "libnpmpublish": "^9.0.2", - "libnpmsearch": "^7.0.0", - "libnpmteam": "^6.0.0", - "libnpmversion": "^5.0.1", - "make-fetch-happen": "^13.0.0", - "minimatch": "^9.0.3", - "minipass": "^7.0.4", - "minipass-pipeline": "^1.2.4", - "ms": "^2.1.2", - "node-gyp": "^10.0.1", - "nopt": "^7.2.0", - "normalize-package-data": "^6.0.0", - "npm-audit-report": "^5.0.0", - "npm-install-checks": "^6.3.0", - "npm-package-arg": "^11.0.1", - "npm-pick-manifest": "^9.0.0", - "npm-profile": "^9.0.0", - "npm-registry-fetch": "^16.1.0", - "npm-user-validate": "^2.0.0", - "npmlog": "^7.0.1", - "p-map": "^4.0.0", - "pacote": "^17.0.6", - "parse-conflict-json": "^3.0.1", - "proc-log": "^3.0.0", - "qrcode-terminal": "^0.12.0", - "read": "^2.1.0", - "semver": "^7.5.4", - "spdx-expression-parse": "^3.0.1", - "ssri": "^10.0.5", - "supports-color": "^9.4.0", - "tar": "^6.2.0", - "text-table": "~0.2.0", - "tiny-relative-date": "^1.3.0", - "treeverse": "^3.0.0", - "validate-npm-package-name": "^5.0.0", - "which": "^4.0.0", - "write-file-atomic": "^5.0.1" - }, - "bin": { - "npm": "bin/npm-cli.js", - "npx": "bin/npx-cli.js" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/@colors/colors": { - "version": "1.5.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/npm/node_modules/@isaacs/cliui": { - "version": "8.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/npm/node_modules/@isaacs/string-locale-compare": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/@npmcli/agent": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "agent-base": "^7.1.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.1", - "lru-cache": "^10.0.1", - "socks-proxy-agent": "^8.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "7.3.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/fs": "^3.1.0", - "@npmcli/installed-package-contents": "^2.0.2", - "@npmcli/map-workspaces": "^3.0.2", - "@npmcli/metavuln-calculator": "^7.0.0", - "@npmcli/name-from-folder": "^2.0.0", - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/package-json": "^5.0.0", - "@npmcli/query": "^3.0.1", - "@npmcli/run-script": "^7.0.2", - "bin-links": "^4.0.1", - "cacache": "^18.0.0", - "common-ancestor-path": "^1.0.1", - "hosted-git-info": "^7.0.1", - "json-parse-even-better-errors": "^3.0.0", - "json-stringify-nice": "^1.1.4", - "minimatch": "^9.0.0", - "nopt": "^7.0.0", - "npm-install-checks": "^6.2.0", - "npm-package-arg": "^11.0.1", - "npm-pick-manifest": "^9.0.0", - "npm-registry-fetch": "^16.0.0", - "npmlog": "^7.0.1", - "pacote": "^17.0.4", - "parse-conflict-json": "^3.0.0", - "proc-log": "^3.0.0", - "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^3.0.1", - "read-package-json-fast": "^3.0.2", - "semver": "^7.3.7", - "ssri": "^10.0.5", - "treeverse": "^3.0.0", - "walk-up-path": "^3.0.1" - }, - "bin": { - "arborist": "bin/index.js" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/config": { - "version": "8.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/map-workspaces": "^3.0.2", - "ci-info": "^4.0.0", - "ini": "^4.1.0", - "nopt": "^7.0.0", - "proc-log": "^3.0.0", - "read-package-json-fast": "^3.0.2", - "semver": "^7.3.5", - "walk-up-path": "^3.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/disparity-colors": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "ansi-styles": "^4.3.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/npm/node_modules/@npmcli/fs": { - "version": "3.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/git": { - "version": "5.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/promise-spawn": "^7.0.0", - "lru-cache": "^10.0.1", - "npm-pick-manifest": "^9.0.0", - "proc-log": "^3.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^4.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/installed-package-contents": { - "version": "2.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-bundled": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "bin": { - "installed-package-contents": "lib/index.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/map-workspaces": { - "version": "3.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/name-from-folder": "^2.0.0", - "glob": "^10.2.2", - "minimatch": "^9.0.0", - "read-package-json-fast": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { - "version": "7.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "cacache": "^18.0.0", - "json-parse-even-better-errors": "^3.0.0", - "pacote": "^17.0.0", - "semver": "^7.3.5" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/name-from-folder": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/node-gyp": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/package-json": { - "version": "5.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/git": "^5.0.0", - "glob": "^10.2.2", - "hosted-git-info": "^7.0.0", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^6.0.0", - "proc-log": "^3.0.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "7.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "which": "^4.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/query": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "postcss-selector-parser": "^6.0.10" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "7.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/package-json": "^5.0.0", - "@npmcli/promise-spawn": "^7.0.0", - "node-gyp": "^10.0.0", - "which": "^4.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/npm/node_modules/@sigstore/bundle": { - "version": "2.1.1", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "@sigstore/protobuf-specs": "^0.2.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@sigstore/core": { - "version": "0.2.0", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@sigstore/protobuf-specs": { - "version": "0.2.1", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@sigstore/sign": { - "version": "2.2.1", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "@sigstore/bundle": "^2.1.1", - "@sigstore/core": "^0.2.0", - "@sigstore/protobuf-specs": "^0.2.1", - "make-fetch-happen": "^13.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "2.3.0", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "@sigstore/protobuf-specs": "^0.2.1", - "tuf-js": "^2.2.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@sigstore/verify": { - "version": "0.1.0", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "@sigstore/bundle": "^2.1.1", - "@sigstore/core": "^0.2.0", - "@sigstore/protobuf-specs": "^0.2.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@tufjs/canonical-json": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@tufjs/models": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "@tufjs/canonical-json": "2.0.0", - "minimatch": "^9.0.3" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/abbrev": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/agent-base": { - "version": "7.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/aggregate-error": { - "version": "3.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/ansi-regex": { - "version": "5.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/ansi-styles": { - "version": "6.2.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/npm/node_modules/aproba": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/archy": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/are-we-there-yet": { - "version": "4.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/balanced-match": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/bin-links": { - "version": "4.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "cmd-shim": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "read-cmd-shim": "^4.0.0", - "write-file-atomic": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/binary-extensions": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/brace-expansion": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/npm/node_modules/builtins": { - "version": "5.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "semver": "^7.0.0" - } - }, - "node_modules/npm/node_modules/cacache": { - "version": "18.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/fs": "^3.1.0", - "fs-minipass": "^3.0.0", - "glob": "^10.2.2", - "lru-cache": "^10.0.1", - "minipass": "^7.0.3", - "minipass-collect": "^2.0.1", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "p-map": "^4.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11", - "unique-filename": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/chalk": { - "version": "5.3.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/npm/node_modules/chownr": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/ci-info": { - "version": "4.0.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/cidr-regex": { - "version": "4.0.3", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "dependencies": { - "ip-regex": "^5.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/npm/node_modules/clean-stack": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/npm/node_modules/cli-columns": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/npm/node_modules/cli-table3": { - "version": "0.6.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/npm/node_modules/clone": { - "version": "1.0.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/npm/node_modules/cmd-shim": { - "version": "6.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/npm/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/color-support": { - "version": "1.1.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/npm/node_modules/columnify": { - "version": "1.6.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "strip-ansi": "^6.0.1", - "wcwidth": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/npm/node_modules/common-ancestor-path": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/console-control-strings": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/cross-spawn": { - "version": "7.0.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/cross-spawn/node_modules/which": { - "version": "2.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/cssesc": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/npm/node_modules/debug": { - "version": "4.3.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/npm/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/defaults": { - "version": "1.0.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm/node_modules/diff": { - "version": "5.1.0", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/npm/node_modules/eastasianwidth": { - "version": "0.2.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/emoji-regex": { - "version": "8.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/encoding": { - "version": "0.1.13", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/npm/node_modules/env-paths": { - "version": "2.2.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/npm/node_modules/err-code": { - "version": "2.0.3", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/exponential-backoff": { - "version": "3.1.1", - "dev": true, - "inBundle": true, - "license": "Apache-2.0" - }, - "node_modules/npm/node_modules/fastest-levenshtein": { - "version": "1.0.16", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/npm/node_modules/foreground-child": { - "version": "3.1.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/fs-minipass": { - "version": "3.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/function-bind": { - "version": "1.1.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/npm/node_modules/gauge": { - "version": "5.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^4.0.1", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/glob": { - "version": "10.3.10", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/graceful-fs": { - "version": "4.2.11", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/has-unicode": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/hasown": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/npm/node_modules/hosted-git-info": { - "version": "7.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^10.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/http-cache-semantics": { - "version": "4.1.1", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause" - }, - "node_modules/npm/node_modules/http-proxy-agent": { - "version": "7.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/https-proxy-agent": { - "version": "7.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/iconv-lite": { - "version": "0.6.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm/node_modules/ignore-walk": { - "version": "6.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minimatch": "^9.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/imurmurhash": { - "version": "0.1.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/npm/node_modules/indent-string": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/ini": { - "version": "4.1.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/init-package-json": { - "version": "6.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-package-arg": "^11.0.0", - "promzard": "^1.0.0", - "read": "^2.0.0", - "read-package-json": "^7.0.0", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^5.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/ip": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/ip-regex": { - "version": "5.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm/node_modules/is-cidr": { - "version": "5.0.3", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "dependencies": { - "cidr-regex": "4.0.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/npm/node_modules/is-core-module": { - "version": "2.13.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/npm/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/is-lambda": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/isexe": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/jackspeak": { - "version": "2.3.6", - "dev": true, - "inBundle": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/npm/node_modules/json-parse-even-better-errors": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/json-stringify-nice": { - "version": "1.1.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/jsonparse": { - "version": "1.3.1", - "dev": true, - "engines": [ - "node >= 0.2.0" - ], - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/just-diff": { - "version": "6.0.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/just-diff-apply": { - "version": "5.5.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/libnpmaccess": { - "version": "8.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-package-arg": "^11.0.1", - "npm-registry-fetch": "^16.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmdiff": { - "version": "6.0.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/arborist": "^7.2.1", - "@npmcli/disparity-colors": "^3.0.0", - "@npmcli/installed-package-contents": "^2.0.2", - "binary-extensions": "^2.2.0", - "diff": "^5.1.0", - "minimatch": "^9.0.0", - "npm-package-arg": "^11.0.1", - "pacote": "^17.0.4", - "tar": "^6.2.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmexec": { - "version": "7.0.7", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/arborist": "^7.2.1", - "@npmcli/run-script": "^7.0.2", - "ci-info": "^4.0.0", - "npm-package-arg": "^11.0.1", - "npmlog": "^7.0.1", - "pacote": "^17.0.4", - "proc-log": "^3.0.0", - "read": "^2.0.0", - "read-package-json-fast": "^3.0.2", - "semver": "^7.3.7", - "walk-up-path": "^3.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmfund": { - "version": "5.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/arborist": "^7.2.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmhook": { - "version": "10.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmorg": { - "version": "6.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmpack": { - "version": "6.0.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/arborist": "^7.2.1", - "@npmcli/run-script": "^7.0.2", - "npm-package-arg": "^11.0.1", - "pacote": "^17.0.4" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmpublish": { - "version": "9.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "ci-info": "^4.0.0", - "normalize-package-data": "^6.0.0", - "npm-package-arg": "^11.0.1", - "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.7", - "sigstore": "^2.2.0", - "ssri": "^10.0.5" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmsearch": { - "version": "7.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-registry-fetch": "^16.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmteam": { - "version": "6.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/libnpmversion": { - "version": "5.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/git": "^5.0.3", - "@npmcli/run-script": "^7.0.2", - "json-parse-even-better-errors": "^3.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.7" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/lru-cache": { - "version": "10.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/npm/node_modules/make-fetch-happen": { - "version": "13.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/agent": "^2.0.0", - "cacache": "^18.0.0", - "http-cache-semantics": "^4.1.1", - "is-lambda": "^1.0.1", - "minipass": "^7.0.2", - "minipass-fetch": "^3.0.0", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "ssri": "^10.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/minimatch": { - "version": "9.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/minipass": { - "version": "7.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/npm/node_modules/minipass-collect": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/npm/node_modules/minipass-fetch": { - "version": "3.0.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "minipass": "^7.0.3", - "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "optionalDependencies": { - "encoding": "^0.1.13" - } - }, - "node_modules/npm/node_modules/minipass-flush": { - "version": "1.0.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { - "version": "3.3.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/minipass-json-stream": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "jsonparse": "^1.3.1", - "minipass": "^3.0.0" - } - }, - "node_modules/npm/node_modules/minipass-json-stream/node_modules/minipass": { - "version": "3.3.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/minipass-pipeline": { - "version": "1.2.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { - "version": "3.3.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/minipass-sized": { - "version": "1.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { - "version": "3.3.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/minizlib": { - "version": "2.1.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/mkdirp": { - "version": "1.0.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/ms": { - "version": "2.1.3", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/mute-stream": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/negotiator": { - "version": "0.6.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/npm/node_modules/node-gyp": { - "version": "10.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "env-paths": "^2.2.0", - "exponential-backoff": "^3.1.1", - "glob": "^10.3.10", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^13.0.0", - "nopt": "^7.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^4.0.0" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/nopt": { - "version": "7.2.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "abbrev": "^2.0.0" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/normalize-package-data": { - "version": "6.0.0", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "dependencies": { - "hosted-git-info": "^7.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-audit-report": { - "version": "5.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-bundled": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-install-checks": { - "version": "6.3.0", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "dependencies": { - "semver": "^7.1.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-normalize-package-bin": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-package-arg": { - "version": "11.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "hosted-git-info": "^7.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-packlist": { - "version": "8.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "ignore-walk": "^6.0.4" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-pick-manifest": { - "version": "9.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-install-checks": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^11.0.0", - "semver": "^7.3.5" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-profile": { - "version": "9.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "16.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "make-fetch-happen": "^13.0.0", - "minipass": "^7.0.2", - "minipass-fetch": "^3.0.0", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.1.2", - "npm-package-arg": "^11.0.0", - "proc-log": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npm-user-validate": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npmlog": { - "version": "7.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "are-we-there-yet": "^4.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^5.0.0", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/p-map": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm/node_modules/pacote": { - "version": "17.0.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/git": "^5.0.0", - "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^7.0.0", - "@npmcli/run-script": "^7.0.0", - "cacache": "^18.0.0", - "fs-minipass": "^3.0.0", - "minipass": "^7.0.2", - "npm-package-arg": "^11.0.0", - "npm-packlist": "^8.0.0", - "npm-pick-manifest": "^9.0.0", - "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0", - "promise-retry": "^2.0.1", - "read-package-json": "^7.0.0", - "read-package-json-fast": "^3.0.0", - "sigstore": "^2.2.0", - "ssri": "^10.0.0", - "tar": "^6.1.11" - }, - "bin": { - "pacote": "lib/bin.js" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/parse-conflict-json": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "json-parse-even-better-errors": "^3.0.0", - "just-diff": "^6.0.0", - "just-diff-apply": "^5.2.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/path-key": { - "version": "3.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/path-scurry": { - "version": "1.10.1", - "dev": true, - "inBundle": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/postcss-selector-parser": { - "version": "6.0.15", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/npm/node_modules/proc-log": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/promise-all-reject-late": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/promise-call-limit": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/promise-inflight": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/promise-retry": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/promzard": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "read": "^2.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/qrcode-terminal": { - "version": "0.12.0", - "dev": true, - "inBundle": true, - "bin": { - "qrcode-terminal": "bin/qrcode-terminal.js" - } - }, - "node_modules/npm/node_modules/read": { - "version": "2.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "mute-stream": "~1.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/read-cmd-shim": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/read-package-json": { - "version": "7.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "glob": "^10.2.2", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/read-package-json-fast": { - "version": "3.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "json-parse-even-better-errors": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/retry": { - "version": "0.12.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/npm/node_modules/safer-buffer": { - "version": "2.1.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/npm/node_modules/semver": { - "version": "7.5.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/set-blocking": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/shebang-command": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/shebang-regex": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/signal-exit": { - "version": "4.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/sigstore": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "@sigstore/bundle": "^2.1.1", - "@sigstore/core": "^0.2.0", - "@sigstore/protobuf-specs": "^0.2.1", - "@sigstore/sign": "^2.2.1", - "@sigstore/tuf": "^2.3.0", - "@sigstore/verify": "^0.1.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/smart-buffer": { - "version": "4.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/npm/node_modules/socks": { - "version": "2.7.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ip": "^2.0.0", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/npm/node_modules/socks-proxy-agent": { - "version": "8.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.0.2", - "debug": "^4.3.4", - "socks": "^2.7.1" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/npm/node_modules/spdx-correct": { - "version": "3.2.0", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/npm/node_modules/spdx-exceptions": { - "version": "2.3.0", - "dev": true, - "inBundle": true, - "license": "CC-BY-3.0" - }, - "node_modules/npm/node_modules/spdx-expression-parse": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/npm/node_modules/spdx-license-ids": { - "version": "3.0.16", - "dev": true, - "inBundle": true, - "license": "CC0-1.0" - }, - "node_modules/npm/node_modules/ssri": { - "version": "10.0.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/string-width": { - "version": "4.2.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/strip-ansi": { - "version": "6.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/supports-color": { - "version": "9.4.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/npm/node_modules/tar": { - "version": "6.2.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { - "version": "2.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/tar/node_modules/minipass": { - "version": "5.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/text-table": { - "version": "0.2.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/tiny-relative-date": { - "version": "1.3.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/treeverse": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/tuf-js": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "@tufjs/models": "2.0.0", - "debug": "^4.3.4", - "make-fetch-happen": "^13.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/unique-filename": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "unique-slug": "^4.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/unique-slug": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/util-deprecate": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/validate-npm-package-license": { - "version": "3.0.4", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/npm/node_modules/validate-npm-package-name": { - "version": "5.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "builtins": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/walk-up-path": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/wcwidth": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "defaults": "^1.0.3" - } - }, - "node_modules/npm/node_modules/which": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "isexe": "^3.1.1" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/which/node_modules/isexe": { - "version": "3.1.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=16" - } - }, - "node_modules/npm/node_modules/wide-align": { - "version": "1.1.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/npm/node_modules/wrap-ansi": { - "version": "8.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/npm/node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { - "version": "9.2.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { - "version": "5.1.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/npm/node_modules/write-file-atomic": { - "version": "5.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/yallist": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", - "dev": true - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", - "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", - "dependencies": { - "chalk": "^5.3.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.9.0", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.3.0", - "log-symbols": "^5.1.0", - "stdin-discarder": "^0.1.0", - "string-width": "^6.1.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ora/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ora/node_modules/string-width": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", - "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^10.2.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-each-series": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", - "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", - "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", - "dev": true, - "dependencies": { - "p-map": "^5.1.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate/node_modules/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==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", - "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", - "dev": true, - "dependencies": { - "aggregate-error": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map/node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", - "dev": true, - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map/node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-queue": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", - "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", - "dependencies": { - "eventemitter3": "^5.0.1", - "p-timeout": "^6.1.2" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-reduce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", - "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/p5": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/p5/-/p5-1.9.0.tgz", - "integrity": "sha512-+5/hz0ZokCDf7BMMAeemE7FIo7gFZK7ImL62acHLXZwerGjqj+171bnaAWj4aCFCx6fwysAr2U7/AKuPyPhehA==" - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "peer": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.1.tgz", - "integrity": "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.21.4", - "error-ex": "^1.3.2", - "json-parse-even-better-errors": "^3.0.0", - "lines-and-columns": "^2.0.3", - "type-fest": "^3.8.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parse-json/node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parse-latin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz", - "integrity": "sha512-b/K8ExXaWC9t34kKeDV8kGXBkXZ1HCSAZRYE7HR14eA1GlXX5L8iWhs8USJNhQU9q5ci413jCKF0gOyovvyRBg==", - "dependencies": { - "nlcst-to-string": "^3.0.0", - "unist-util-modify-children": "^3.0.0", - "unist-util-visit-children": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dependencies": { - "entities": "^4.4.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "dev": true, - "peer": true, - "dependencies": { - "parse5": "^6.0.1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true, - "peer": true - }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", - "dev": true, - "peer": true, - "dependencies": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "peer": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "peer": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, - "peer": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, - "node_modules/playwright": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", - "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", - "dev": true, - "dependencies": { - "playwright-core": "1.40.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", - "dev": true, - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/playwright/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/preferred-pm": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.3.tgz", - "integrity": "sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==", - "dependencies": { - "find-up": "^5.0.0", - "find-yarn-workspace-root2": "1.2.16", - "path-exists": "^4.0.0", - "which-pm": "2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/preferred-pm/node_modules/which-pm": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", - "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", - "dependencies": { - "load-yaml-file": "^0.2.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8.15" - } - }, - "node_modules/prettier": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", - "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/prismjs": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", - "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", - "engines": { - "node": ">=6" - } - }, - "node_modules/probe-image-size": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", - "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", - "dependencies": { - "lodash.merge": "^4.6.2", - "needle": "^2.5.2", - "stream-parser": "~0.3.1" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/prompts/node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "engines": { - "node": ">=6" - } - }, - "node_modules/property-information": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz", - "integrity": "sha512-OHYtXfu5aI2sS2LWFSN5rgJjrQ4pCy8i1jubJLe2QvMF8JJ++HXTUIVWFLfXJoaOfvYYjk2SN8J2wFUWIGXT4w==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" - }, - "peerDependencies": { - "react": "^18.2.0" - } - }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, - "node_modules/react-refresh": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", - "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/read-pkg": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", - "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.1", - "normalize-package-data": "^6.0.0", - "parse-json": "^7.0.0", - "type-fest": "^4.2.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-10.1.0.tgz", - "integrity": "sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==", - "dev": true, - "dependencies": { - "find-up": "^6.3.0", - "read-pkg": "^8.1.0", - "type-fest": "^4.2.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", - "dev": true, - "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", - "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", - "dev": true, - "dependencies": { - "p-locate": "^6.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", - "dev": true, - "dependencies": { - "p-limit": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", - "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", - "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", - "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/registry-auth-token": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", - "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", - "dev": true, - "dependencies": { - "@pnpm/npm-conf": "^2.1.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/rehype": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", - "integrity": "sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg==", - "dependencies": { - "@types/hast": "^3.0.0", - "rehype-parse": "^9.0.0", - "rehype-stringify": "^10.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/rehype-parse": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz", - "integrity": "sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==", - "dependencies": { - "@types/hast": "^3.0.0", - "hast-util-from-html": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/rehype-raw": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", - "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", - "dependencies": { - "@types/hast": "^3.0.0", - "hast-util-raw": "^9.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/rehype-stringify": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz", - "integrity": "sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ==", - "dependencies": { - "@types/hast": "^3.0.0", - "hast-util-to-html": "^9.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-gfm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", - "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-gfm": "^3.0.0", - "micromark-extension-gfm": "^3.0.0", - "remark-parse": "^11.0.0", - "remark-stringify": "^11.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-parse": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", - "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-rehype": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", - "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "mdast-util-to-hast": "^13.0.0", - "unified": "^11.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-smartypants": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.1.0.tgz", - "integrity": "sha512-qoF6Vz3BjU2tP6OfZqHOvCU0ACmu/6jhGaINSQRI9mM7wCxNQTKB3JUAN4SVoN2ybElEDTxBIABRep7e569iJw==", - "dependencies": { - "retext": "^8.1.0", - "retext-smartypants": "^5.2.0", - "unist-util-visit": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/remark-stringify": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", - "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-to-markdown": "^2.0.0", - "unified": "^11.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/request-light": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", - "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==" - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/retext": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/retext/-/retext-8.1.0.tgz", - "integrity": "sha512-N9/Kq7YTn6ZpzfiGW45WfEGJqFf1IM1q8OsRa1CGzIebCJBNCANDRmOrholiDRGKo/We7ofKR4SEvcGAWEMD3Q==", - "dependencies": { - "@types/nlcst": "^1.0.0", - "retext-latin": "^3.0.0", - "retext-stringify": "^3.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-latin": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-3.1.0.tgz", - "integrity": "sha512-5MrD1tuebzO8ppsja5eEu+ZbBeUNCjoEarn70tkXOS7Bdsdf6tNahsv2bY0Z8VooFF6cw7/6S+d3yI/TMlMVVQ==", - "dependencies": { - "@types/nlcst": "^1.0.0", - "parse-latin": "^5.0.0", - "unherit": "^3.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-latin/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/retext-latin/node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-latin/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-latin/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-latin/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-5.2.0.tgz", - "integrity": "sha512-Do8oM+SsjrbzT2UNIKgheP0hgUQTDDQYyZaIY3kfq0pdFzoPk+ZClYJ+OERNXveog4xf1pZL4PfRxNoVL7a/jw==", - "dependencies": { - "@types/nlcst": "^1.0.0", - "nlcst-to-string": "^3.0.0", - "unified": "^10.0.0", - "unist-util-visit": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/retext-smartypants/node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/unist-util-is": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", - "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/unist-util-visit": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", - "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.1.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/unist-util-visit-parents": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", - "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-smartypants/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-stringify": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", - "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", - "dependencies": { - "@types/nlcst": "^1.0.0", - "nlcst-to-string": "^3.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-stringify/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/retext-stringify/node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-stringify/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-stringify/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext-stringify/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/retext/node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/retext/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rollup": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", - "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", - "dependencies": { - "@types/estree": "1.0.5" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.0", - "@rollup/rollup-android-arm64": "4.12.0", - "@rollup/rollup-darwin-arm64": "4.12.0", - "@rollup/rollup-darwin-x64": "4.12.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", - "@rollup/rollup-linux-arm64-gnu": "4.12.0", - "@rollup/rollup-linux-arm64-musl": "4.12.0", - "@rollup/rollup-linux-riscv64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-musl": "4.12.0", - "@rollup/rollup-win32-arm64-msvc": "4.12.0", - "@rollup/rollup-win32-ia32-msvc": "4.12.0", - "@rollup/rollup-win32-x64-msvc": "4.12.0", - "fsevents": "~2.3.2" - } - }, - "node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", - "dev": true - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sax": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" - }, - "node_modules/saxes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=v12.22.7" - } - }, - "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dependencies": { - "loose-envify": "^1.1.0" - } - }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/semantic-release": { - "version": "23.0.2", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-23.0.2.tgz", - "integrity": "sha512-OnVYJ6Xgzwe1x8MKswba7RU9+5djS1MWRTrTn5qsq3xZYpslroZkV9Pt0dA2YcIuieeuSZWJhn+yUWoBUHO5Fw==", - "dev": true, - "peer": true, - "dependencies": { - "@semantic-release/commit-analyzer": "^11.0.0", - "@semantic-release/error": "^4.0.0", - "@semantic-release/github": "^9.0.0", - "@semantic-release/npm": "^11.0.0", - "@semantic-release/release-notes-generator": "^12.0.0", - "aggregate-error": "^5.0.0", - "cosmiconfig": "^9.0.0", - "debug": "^4.0.0", - "env-ci": "^11.0.0", - "execa": "^8.0.0", - "figures": "^6.0.0", - "find-versions": "^5.1.0", - "get-stream": "^6.0.0", - "git-log-parser": "^1.2.0", - "hook-std": "^3.0.0", - "hosted-git-info": "^7.0.0", - "import-from-esm": "^1.3.1", - "lodash-es": "^4.17.21", - "marked": "^12.0.0", - "marked-terminal": "^7.0.0", - "micromatch": "^4.0.2", - "p-each-series": "^3.0.0", - "p-reduce": "^3.0.0", - "read-pkg-up": "^11.0.0", - "resolve-from": "^5.0.0", - "semver": "^7.3.2", - "semver-diff": "^4.0.0", - "signale": "^1.2.1", - "yargs": "^17.5.1" - }, - "bin": { - "semantic-release": "bin/semantic-release.js" - }, - "engines": { - "node": ">=20.8.1" - } - }, - "node_modules/semantic-release/node_modules/@semantic-release/error": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", - "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/semantic-release/node_modules/aggregate-error": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", - "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", - "dev": true, - "peer": true, - "dependencies": { - "clean-stack": "^5.2.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/clean-stack": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", - "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", - "dev": true, - "peer": true, - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "peer": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/semantic-release/node_modules/execa/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/semantic-release/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "peer": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "peer": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/p-reduce": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", - "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/parse-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", - "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", - "dev": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "index-to-position": "^0.1.2", - "type-fest": "^4.7.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/read-pkg": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", - "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", - "dev": true, - "peer": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.3", - "normalize-package-data": "^6.0.0", - "parse-json": "^8.0.0", - "type-fest": "^4.6.0", - "unicorn-magic": "^0.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/read-pkg-up": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-11.0.0.tgz", - "integrity": "sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==", - "deprecated": "Renamed to read-package-up", - "dev": true, - "peer": true, - "dependencies": { - "find-up-simple": "^1.0.0", - "read-pkg": "^9.0.0", - "type-fest": "^4.6.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/semantic-release/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semantic-release/node_modules/type-fest": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", - "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", - "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", - "dev": true, - "peer": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semver-regex": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", - "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semver/node_modules/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==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/server-destroy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", - "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==" - }, - "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.2", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/sharp": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", - "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==", - "hasInstallScript": true, - "optional": true, - "dependencies": { - "color": "^4.2.3", - "detect-libc": "^2.0.2", - "semver": "^7.5.4" - }, - "engines": { - "libvips": ">=8.15.1", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.33.2", - "@img/sharp-darwin-x64": "0.33.2", - "@img/sharp-libvips-darwin-arm64": "1.0.1", - "@img/sharp-libvips-darwin-x64": "1.0.1", - "@img/sharp-libvips-linux-arm": "1.0.1", - "@img/sharp-libvips-linux-arm64": "1.0.1", - "@img/sharp-libvips-linux-s390x": "1.0.1", - "@img/sharp-libvips-linux-x64": "1.0.1", - "@img/sharp-libvips-linuxmusl-arm64": "1.0.1", - "@img/sharp-libvips-linuxmusl-x64": "1.0.1", - "@img/sharp-linux-arm": "0.33.2", - "@img/sharp-linux-arm64": "0.33.2", - "@img/sharp-linux-s390x": "0.33.2", - "@img/sharp-linux-x64": "0.33.2", - "@img/sharp-linuxmusl-arm64": "0.33.2", - "@img/sharp-linuxmusl-x64": "0.33.2", - "@img/sharp-wasm32": "0.33.2", - "@img/sharp-win32-ia32": "0.33.2", - "@img/sharp-win32-x64": "0.33.2" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/shikiji": { - "version": "0.6.13", - "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.13.tgz", - "integrity": "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA==", - "dependencies": { - "hast-util-to-html": "^9.0.0" - } - }, - "node_modules/shx": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", - "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", - "dev": true, - "dependencies": { - "minimist": "^1.2.3", - "shelljs": "^0.8.5" - }, - "bin": { - "shx": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/side-channel": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", - "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "node_modules/signale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", - "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", - "dev": true, - "peer": true, - "dependencies": { - "chalk": "^2.3.2", - "figures": "^2.0.0", - "pkg-conf": "^2.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/signale/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/signale/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/signale/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/signale/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/signale/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/signale/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, - "peer": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/signale/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/signale/node_modules/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, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "optional": true, - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, - "node_modules/simple-swizzle/node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "optional": true - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" - }, - "node_modules/skin-tone": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", - "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", - "dev": true, - "peer": true, - "dependencies": { - "unicode-emoji-modifier-base": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/space-separated-tokens": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", - "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/spawn-error-forwarder": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", - "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", - "dev": true, - "peer": true - }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", - "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", - "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", - "dev": true - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "dev": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, - "node_modules/state-local": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", - "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==" - }, - "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true - }, - "node_modules/stdin-discarder": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", - "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", - "dependencies": { - "bl": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", - "dev": true, - "peer": true, - "dependencies": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-parser": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", - "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", - "dependencies": { - "debug": "2" - } - }, - "node_modules/stream-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/stream-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string-width": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", - "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/stringify-entities": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", - "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", - "dependencies": { - "character-entities-html4": "^2.0.0", - "character-entities-legacy": "^3.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", - "dev": true, - "dependencies": { - "acorn": "^8.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/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, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", - "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "node_modules/temp-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", - "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/tempy": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", - "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", - "dev": true, - "dependencies": { - "is-stream": "^3.0.0", - "temp-dir": "^3.0.0", - "type-fest": "^2.12.2", - "unique-string": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/tempy/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/text-extensions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", - "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "peer": true, - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, - "peer": true, - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "peer": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/tinybench": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", - "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "engines": { - "node": ">=4" - } - }, - "node_modules/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==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", - "dev": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/tr46": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", - "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", - "dev": true, - "dependencies": { - "punycode": "^2.3.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/traverse": { - "version": "0.6.8", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", - "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/trim-lines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", - "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/trough": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", - "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/tsconfck": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", - "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", - "bin": { - "tsconfck": "bin/tsconfck.js" - }, - "engines": { - "node": "^18 || >=20" - }, - "peerDependencies": { - "typescript": "^5.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "optional": true - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typesafe-path": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", - "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" - }, - "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/typescript-auto-import-cache": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.2.tgz", - "integrity": "sha512-+laqe5SFL1vN62FPOOJSUDTZxtgsoOXjneYOXIpx5rQ4UMiN89NAtJLpqLqyebv9fgQ/IMeeTX+mQyRnwvJzvg==", - "dependencies": { - "semver": "^7.3.8" - } - }, - "node_modules/ufo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", - "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", - "dev": true - }, - "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", - "dev": true, - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ultrahtml": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.3.tgz", - "integrity": "sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==" - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true - }, - "node_modules/unherit": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", - "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/unicode-emoji-modifier-base": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", - "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/unified": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", - "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", - "dependencies": { - "@types/unist": "^3.0.0", - "bail": "^2.0.0", - "devlop": "^1.0.0", - "extend": "^3.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unique-string": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", - "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", - "dev": true, - "dependencies": { - "crypto-random-string": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/unist-util-is": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", - "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-modify-children": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", - "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", - "dependencies": { - "@types/unist": "^2.0.0", - "array-iterate": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-modify-children/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/unist-util-position": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", - "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-children": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", - "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-children/node_modules/@types/unist": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", - "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" - }, - "node_modules/unist-util-visit-parents": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", - "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/universal-user-agent": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", - "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", - "dev": true - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/url-join": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", - "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/vfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", - "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0", - "vfile-message": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-location": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", - "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", - "dependencies": { - "@types/unist": "^3.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vfile-message": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", - "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/vite": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", - "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", - "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.1.1.tgz", - "integrity": "sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==", - "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vitefu": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", - "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", - "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, - "node_modules/vitest": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.1.1.tgz", - "integrity": "sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.1.1", - "@vitest/runner": "1.1.1", - "@vitest/snapshot": "1.1.1", - "@vitest/spy": "1.1.1", - "@vitest/utils": "1.1.1", - "acorn-walk": "^8.3.0", - "cac": "^6.7.14", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^1.3.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.1", - "vite": "^5.0.0", - "vite-node": "1.1.1", - "why-is-node-running": "^2.2.2" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "^1.0.0", - "@vitest/ui": "^1.0.0", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/vitest/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/vitest/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/vitest/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/vitest/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/volar-service-css": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/volar-service-css/-/volar-service-css-0.0.30.tgz", - "integrity": "sha512-jui+1N0HBfjW43tRfhyZp0axhBee4997BRyX4os8xQm/7cjD2KjAuyz92nMIPRt1QDoG4/7uQT28xNhy0TPJTA==", - "dependencies": { - "vscode-css-languageservice": "^6.2.10", - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "@volar/language-service": "~2.0.1" - }, - "peerDependenciesMeta": { - "@volar/language-service": { - "optional": true - } - } - }, - "node_modules/volar-service-emmet": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/volar-service-emmet/-/volar-service-emmet-0.0.30.tgz", - "integrity": "sha512-HEeIrmqQ/DTfuQDI9ER5+YReXXjE9f7W6MlBmn5biUuPyizVTGfuILN8pJhmYvmPHCA7qHhU7CJqwE9DAh9AJg==", - "dependencies": { - "@vscode/emmet-helper": "^2.9.2", - "volar-service-html": "0.0.30" - }, - "peerDependencies": { - "@volar/language-service": "~2.0.1" - }, - "peerDependenciesMeta": { - "@volar/language-service": { - "optional": true - } - } - }, - "node_modules/volar-service-html": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/volar-service-html/-/volar-service-html-0.0.30.tgz", - "integrity": "sha512-wW3TEeRTeHv/3mC8Ik6T62SwewMWFungb8ydyEK/2GDHEntBEG/J9wtuh01/J0kYqPerhlT9zhdGB6PGYHAGuA==", - "dependencies": { - "vscode-html-languageservice": "^5.1.0", - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "@volar/language-service": "~2.0.1" - }, - "peerDependenciesMeta": { - "@volar/language-service": { - "optional": true - } - } - }, - "node_modules/volar-service-prettier": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/volar-service-prettier/-/volar-service-prettier-0.0.30.tgz", - "integrity": "sha512-Qdc5Zc0y4hJmJbpIQ52cSDjs0uvVug/e2nuL/XZWPJM6Cr5/3RjjoRVKtDQbKItFYlGk+JH+LSXvwQeD5TXZqg==", - "dependencies": { - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "@volar/language-service": "~2.0.1", - "prettier": "^2.2 || ^3.0" - }, - "peerDependenciesMeta": { - "@volar/language-service": { - "optional": true - }, - "prettier": { - "optional": true - } - } - }, - "node_modules/volar-service-typescript": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/volar-service-typescript/-/volar-service-typescript-0.0.30.tgz", - "integrity": "sha512-jA8c0Mhy9rgAsrgtwocK95Smws1M2E0MxlQ/SVo/rmOGH32cX9UGgI0IENWKa3yagp/khfoemOIQDz/KNhI3zg==", - "dependencies": { - "path-browserify": "^1.0.1", - "semver": "^7.5.4", - "typescript-auto-import-cache": "^0.3.1", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-nls": "^5.2.0", - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "@volar/language-service": "~2.0.1", - "@volar/typescript": "~2.0.1" - }, - "peerDependenciesMeta": { - "@volar/language-service": { - "optional": true - } - } - }, - "node_modules/volar-service-typescript-twoslash-queries": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/volar-service-typescript-twoslash-queries/-/volar-service-typescript-twoslash-queries-0.0.30.tgz", - "integrity": "sha512-ahj6woBxhkZu7icQR58x5TnUaS8ZRKn7a+UvY+andmiTWsOaSu85zj36+LPZgZQi1MG+BtjNwUjKoxtZiN51PA==", - "peerDependencies": { - "@volar/language-service": "~2.0.1" - }, - "peerDependenciesMeta": { - "@volar/language-service": { - "optional": true - } - } - }, - "node_modules/vscode-css-languageservice": { - "version": "6.2.12", - "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.2.12.tgz", - "integrity": "sha512-PS9r7HgNjqzRl3v91sXpCyZPc8UDotNo6gntFNtGCKPhGA9Frk7g/VjX1Mbv3F00pn56D+rxrFzR9ep4cawOgA==", - "dependencies": { - "@vscode/l10n": "^0.0.18", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-languageserver-types": "3.17.5", - "vscode-uri": "^3.0.8" - } - }, - "node_modules/vscode-css-languageservice/node_modules/@vscode/l10n": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", - "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" - }, - "node_modules/vscode-html-languageservice": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.1.2.tgz", - "integrity": "sha512-wkWfEx/IIR3s2P5yD4aTGHiOb8IAzFxgkSt1uSC3itJ4oDAm23yG7o0L29JljUdnXDDgLafPAvhv8A2I/8riHw==", - "dependencies": { - "@vscode/l10n": "^0.0.18", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-languageserver-types": "^3.17.5", - "vscode-uri": "^3.0.8" - } - }, - "node_modules/vscode-html-languageservice/node_modules/@vscode/l10n": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", - "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" - }, - "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/vscode-languageserver": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", - "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", - "dependencies": { - "vscode-languageserver-protocol": "3.17.5" - }, - "bin": { - "installServerIntoExtension": "bin/installServerIntoExtension" - } - }, - "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", - "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" - } - }, - "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", - "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" - }, - "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" - }, - "node_modules/vscode-nls": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", - "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==" - }, - "node_modules/vscode-uri": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", - "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" - }, - "node_modules/w3c-xmlserializer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", - "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", - "dev": true, - "dependencies": { - "xml-name-validator": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/web-namespaces": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", - "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-encoding": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", - "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", - "dev": true, - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/whatwg-mimetype": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", - "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-url": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", - "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", - "dev": true, - "dependencies": { - "tr46": "^5.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dev": true, - "dependencies": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-pm": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", - "integrity": "sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ==", - "dependencies": { - "load-yaml-file": "^0.2.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8.15" - } - }, - "node_modules/which-pm-runs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", - "dev": true, - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/widest-line": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", - "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", - "dependencies": { - "string-width": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/widest-line/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "node_modules/widest-line/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", - "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs/node_modules/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==" - }, - "node_modules/yargs/node_modules/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==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/zwitch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", - "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - } - } + "name": "@ff6347/p5-sandbox", + "version": "1.4.5", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@ff6347/p5-sandbox", + "version": "1.4.5", + "hasInstallScript": true, + "dependencies": { + "@astrojs/check": "0.3.4", + "@astrojs/react": "3.0.9", + "@monaco-editor/react": "4.6.0", + "@types/p5": "1.7.6", + "@types/react": "18.2.45", + "@types/react-dom": "18.2.18", + "astro": "4.1.0", + "lodash.debounce": "4.0.8", + "p5": "1.9.0", + "prettier": "3.1.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "typescript": "5.3.3" + }, + "devDependencies": { + "@playwright/test": "1.40.1", + "@technologiestiftung/semantic-release-config": "1.2.4", + "@testing-library/react": "14.1.2", + "@types/lodash.debounce": "4.0.9", + "@types/node": "20.10.6", + "jsdom": "23.0.1", + "mkdirp": "3.0.1", + "netlify-cli": "17.10.2", + "shx": "0.3.4", + "vitest": "1.1.1" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@astrojs/check": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.3.4.tgz", + "integrity": "sha512-Wi4KwW38J3GCd/U6LH2UuU4uc4P/K1WYaqhoKm2o7rVoGhQfO+RWrSO26rUPRXYbmae8JugAgpCmsHC8bt5RlA==", + "dependencies": { + "@astrojs/language-server": "^2.5.5", + "chokidar": "^3.5.3", + "fast-glob": "^3.3.1", + "kleur": "^4.1.5", + "yargs": "^17.7.2" + }, + "bin": { + "astro-check": "dist/bin.js" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } + }, + "node_modules/@astrojs/compiler": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.6.0.tgz", + "integrity": "sha512-c74k8iGHL3DzkosSJ0tGcHIEBEiIfBhr7eadSaPyvWlVKaieDVzVs8OW1tnRSQyBsfMc8DZQ4RcN2KAcESD8UQ==" + }, + "node_modules/@astrojs/internal-helpers": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.2.1.tgz", + "integrity": "sha512-06DD2ZnItMwUnH81LBLco3tWjcZ1lGU9rLCCBaeUCGYe9cI0wKyY2W3kDyoW1I6GmcWgt1fu+D1CTvz+FIKf8A==" + }, + "node_modules/@astrojs/language-server": { + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/@astrojs/language-server/-/language-server-2.7.6.tgz", + "integrity": "sha512-NhMSmMAuKBMXnvpfn9eYPR7R6zOasAjRb+ta8L+rCHHuKzUc0lBgAF5M6rx01FJqlpGqeqao13eYt4287Ze49g==", + "dependencies": { + "@astrojs/compiler": "^2.4.0", + "@jridgewell/sourcemap-codec": "^1.4.15", + "@volar/kit": "~2.0.4", + "@volar/language-core": "~2.0.4", + "@volar/language-server": "~2.0.4", + "@volar/language-service": "~2.0.4", + "@volar/typescript": "~2.0.4", + "fast-glob": "^3.2.12", + "volar-service-css": "0.0.30", + "volar-service-emmet": "0.0.30", + "volar-service-html": "0.0.30", + "volar-service-prettier": "0.0.30", + "volar-service-typescript": "0.0.30", + "volar-service-typescript-twoslash-queries": "0.0.30", + "vscode-html-languageservice": "^5.1.2", + "vscode-uri": "^3.0.8" + }, + "bin": { + "astro-ls": "bin/nodeServer.js" + }, + "peerDependencies": { + "prettier": "^3.0.0", + "prettier-plugin-astro": ">=0.11.0" + }, + "peerDependenciesMeta": { + "prettier": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + } + } + }, + "node_modules/@astrojs/markdown-remark": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-4.0.1.tgz", + "integrity": "sha512-RU4ESnqvyLpj8WZs0n5elS6idaDdtIIm7mIpMaRNPCebpxMjfcfdwcmBwz83ktAj5d2eO5bC3z92TcGdli+lRw==", + "dependencies": { + "@astrojs/prism": "^3.0.0", + "github-slugger": "^2.0.0", + "import-meta-resolve": "^4.0.0", + "mdast-util-definitions": "^6.0.0", + "rehype-raw": "^7.0.0", + "rehype-stringify": "^10.0.0", + "remark-gfm": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "remark-smartypants": "^2.0.0", + "shikiji": "^0.6.13", + "unified": "^11.0.4", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1" + } + }, + "node_modules/@astrojs/prism": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.0.0.tgz", + "integrity": "sha512-g61lZupWq1bYbcBnYZqdjndShr/J3l/oFobBKPA3+qMat146zce3nz2kdO4giGbhYDt4gYdhmoBz0vZJ4sIurQ==", + "dependencies": { + "prismjs": "^1.29.0" + }, + "engines": { + "node": ">=18.14.1" + } + }, + "node_modules/@astrojs/react": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-3.0.9.tgz", + "integrity": "sha512-31J5yF5p9yBFV1axBooLA9PB4B2+MYm7swWhtlezSsJiUNXRFo5Is9qI3teJ7cKgmaCv+ZA593Smskko0NGaDQ==", + "dependencies": { + "@vitejs/plugin-react": "^4.2.0", + "ultrahtml": "^1.3.0" + }, + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "@types/react": "^17.0.50 || ^18.0.21", + "@types/react-dom": "^17.0.17 || ^18.0.6", + "react": "^17.0.2 || ^18.0.0", + "react-dom": "^17.0.2 || ^18.0.0" + } + }, + "node_modules/@astrojs/telemetry": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.0.4.tgz", + "integrity": "sha512-A+0c7k/Xy293xx6odsYZuXiaHO0PL+bnDoXOc47sGDF5ffIKdKQGRPFl2NMlCF4L0NqN4Ynbgnaip+pPF0s7pQ==", + "dependencies": { + "ci-info": "^3.8.0", + "debug": "^4.3.4", + "dlv": "^1.1.3", + "dset": "^3.1.2", + "is-docker": "^3.0.0", + "is-wsl": "^3.0.0", + "which-pm-runs": "^1.1.0" + }, + "engines": { + "node": ">=18.14.1" + } + }, + "node_modules/@astrojs/telemetry/node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", + "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.9", + "@babel/parser": "^7.23.9", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "dependencies": { + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "dependencies": { + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dependencies": { + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", + "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", + "dependencies": { + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", + "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/types": "^7.23.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", + "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", + "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", + "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@emmetio/abbreviation": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz", + "integrity": "sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==", + "dependencies": { + "@emmetio/scanner": "^1.0.4" + } + }, + "node_modules/@emmetio/css-abbreviation": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz", + "integrity": "sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==", + "dependencies": { + "@emmetio/scanner": "^1.0.4" + } + }, + "node_modules/@emmetio/scanner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz", + "integrity": "sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==" + }, + "node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz", + "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz", + "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz", + "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz", + "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz", + "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz", + "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz", + "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz", + "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz", + "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz", + "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz", + "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz", + "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz", + "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz", + "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz", + "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz", + "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.45.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz", + "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz", + "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", + "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", + "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@monaco-editor/loader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.4.0.tgz", + "integrity": "sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==", + "dependencies": { + "state-local": "^1.0.6" + }, + "peerDependencies": { + "monaco-editor": ">= 0.21.0 < 1" + } + }, + "node_modules/@monaco-editor/react": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.6.0.tgz", + "integrity": "sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==", + "dependencies": { + "@monaco-editor/loader": "^1.4.0" + }, + "peerDependencies": { + "monaco-editor": ">= 0.25.0 < 1", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", + "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", + "dev": true, + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.0.0", + "@octokit/request": "^8.0.2", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", + "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", + "dev": true, + "dependencies": { + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", + "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", + "dev": true, + "dependencies": { + "@octokit/request": "^8.0.1", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-8.0.0.tgz", + "integrity": "sha512-2xZ+baZWUg+qudVXnnvXz7qfrTmDeYPCzangBVq/1gXxii/OiS//4shJp9dnCCvj1x+JAm9ji1Egwm1BA47lPQ==", + "dev": true, + "dependencies": { + "@octokit/types": "^11.0.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", + "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/@octokit/plugin-retry": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", + "dev": true, + "dependencies": { + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "bottleneck": "^2.15.3" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/plugin-throttling": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-7.0.0.tgz", + "integrity": "sha512-KL2k/d0uANc8XqP5S64YcNFCudR3F5AaKO39XWdUtlJIjT9Ni79ekWJ6Kj5xvAw87udkOMEPcVf9xEge2+ahew==", + "dev": true, + "dependencies": { + "@octokit/types": "^11.0.0", + "bottleneck": "^2.15.3" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "^5.0.0" + } + }, + "node_modules/@octokit/plugin-throttling/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/@octokit/plugin-throttling/node_modules/@octokit/types": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", + "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/@octokit/request": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", + "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "dev": true, + "dependencies": { + "@octokit/endpoint": "^9.0.0", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", + "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", + "dev": true, + "dependencies": { + "@octokit/types": "^12.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", + "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "dev": true, + "dependencies": { + "playwright": "1.40.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", + "dev": true, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", + "dev": true, + "dependencies": { + "graceful-fs": "4.2.10" + }, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "node_modules/@pnpm/npm-conf": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", + "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", + "dev": true, + "dependencies": { + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@semantic-release/changelog": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", + "dev": true, + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "fs-extra": "^11.0.0", + "lodash": "^4.17.4" + }, + "engines": { + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" + } + }, + "node_modules/@semantic-release/commit-analyzer": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-11.0.0.tgz", + "integrity": "sha512-uEXyf4Z0AWJuxI9TbSQP5kkIYqus1/E1NcmE7pIv6d6/m/5EJcNWAGR4FOo34vrV26FhEaRVkxFfYzp/M7BKIg==", + "dev": true, + "dependencies": { + "conventional-changelog-angular": "^7.0.0", + "conventional-commits-filter": "^4.0.0", + "conventional-commits-parser": "^5.0.0", + "debug": "^4.0.0", + "import-from": "^4.0.0", + "lodash-es": "^4.17.21", + "micromatch": "^4.0.2" + }, + "engines": { + "node": "^18.17 || >=20.6.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" + } + }, + "node_modules/@semantic-release/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "dev": true, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@semantic-release/git": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", + "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", + "dev": true, + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "debug": "^4.0.0", + "dir-glob": "^3.0.0", + "execa": "^5.0.0", + "lodash": "^4.17.4", + "micromatch": "^4.0.0", + "p-reduce": "^2.0.0" + }, + "engines": { + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" + } + }, + "node_modules/@semantic-release/github": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-9.0.5.tgz", + "integrity": "sha512-d1ZZjMvXpSa4E1L3XjdNOqgUy00o9QZX55L75pMsb/w+1NV6CCfDYOvH8qwKygHS/rKzI3FkBTcR40ahOodsgg==", + "dev": true, + "dependencies": { + "@octokit/core": "^5.0.0", + "@octokit/plugin-paginate-rest": "^8.0.0", + "@octokit/plugin-retry": "^6.0.0", + "@octokit/plugin-throttling": "^7.0.0", + "@semantic-release/error": "^4.0.0", + "aggregate-error": "^4.0.1", + "debug": "^4.3.4", + "dir-glob": "^3.0.1", + "globby": "^13.1.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "issue-parser": "^6.0.0", + "lodash-es": "^4.17.21", + "mime": "^3.0.0", + "p-filter": "^3.0.0", + "url-join": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" + } + }, + "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@semantic-release/github/node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/github/node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/github/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-11.0.0.tgz", + "integrity": "sha512-ozNCiPUp14Xp2rgeY7j96yFTEhDncLSWOJr0IAUr888+ax6fH5xgYkNVv08vpkV8C5GIXBgnGd9coRiOCD6oqQ==", + "dev": true, + "dependencies": { + "@semantic-release/error": "^4.0.0", + "aggregate-error": "^5.0.0", + "execa": "^8.0.0", + "fs-extra": "^11.0.0", + "lodash-es": "^4.17.21", + "nerf-dart": "^1.0.0", + "normalize-url": "^8.0.0", + "npm": "^10.0.0", + "rc": "^1.2.8", + "read-pkg": "^8.0.0", + "registry-auth-token": "^5.0.0", + "semver": "^7.1.2", + "tempy": "^3.0.0" + }, + "engines": { + "node": "^18.17 || >=20" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" + } + }, + "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@semantic-release/npm/node_modules/aggregate-error": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", + "dev": true, + "dependencies": { + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/clean-stack": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/@semantic-release/npm/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/@semantic-release/npm/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/npm/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/release-notes-generator": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-12.0.0.tgz", + "integrity": "sha512-m7Ds8ComP1KJgA2Lke2xMwE1TOOU40U7AzP4lT8hJ2tUAeicziPz/1GeDFmRkTOkMFlfHvE6kuvMkvU+mIzIDQ==", + "dev": true, + "dependencies": { + "conventional-changelog-angular": "^7.0.0", + "conventional-changelog-writer": "^7.0.0", + "conventional-commits-filter": "^4.0.0", + "conventional-commits-parser": "^5.0.0", + "debug": "^4.0.0", + "get-stream": "^7.0.0", + "import-from": "^4.0.0", + "into-stream": "^7.0.0", + "lodash-es": "^4.17.21", + "read-pkg-up": "^10.0.0" + }, + "engines": { + "node": "^18.17 || >=20.6.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@technologiestiftung/semantic-release-config": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@technologiestiftung/semantic-release-config/-/semantic-release-config-1.2.4.tgz", + "integrity": "sha512-MlZmQJEXbHjJN3uPnu4I2cIAmIQy94TVUamxLka9vRVKZrCKACMNp7dkmXEL++roj9SK5X2DAh+GvHn/LkaWgQ==", + "dev": true, + "dependencies": { + "@semantic-release/changelog": "6.0.3", + "@semantic-release/commit-analyzer": "11.0.0", + "@semantic-release/git": "10.0.1", + "@semantic-release/github": "9.0.5", + "@semantic-release/npm": "11.0.0", + "@semantic-release/release-notes-generator": "12.0.0", + "@technologiestiftung/semantic-release-config": "^1.0.0", + "lodash.merge": "4.6.2" + } + }, + "node_modules/@testing-library/dom": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", + "integrity": "sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.1.3", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@testing-library/react": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", + "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.12.5", + "@testing-library/dom": "^9.0.0", + "@types/react-dom": "^18.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dev": true + }, + "node_modules/@types/lodash.debounce": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.9.tgz", + "integrity": "sha512-Ma5JcgTREwpLRwMM+XwBR7DaWe96nC38uCBDFKZWbNKD+osjVzdpnUSwBcqCptrp16sSOLBAUb50Car5I0TCsQ==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" + }, + "node_modules/@types/nlcst": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.4.tgz", + "integrity": "sha512-ABoYdNQ/kBSsLvZAekMhIPMQ3YUZvavStpKYs7BjLLuKVmIMA0LUgZ7b54zzuWJRbHF80v1cNf4r90Vd6eMQDg==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@types/nlcst/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/@types/node": { + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", + "devOptional": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, + "node_modules/@types/p5": { + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/@types/p5/-/p5-1.7.6.tgz", + "integrity": "sha512-6pLTOo0V3N5jZb5nTwjiv3lPHLK3Z/TjbhQUj8CTWXocUk1Z/f6OHTp3Pcwi1BhWnf5gqKUcyEb1gP0KIJuQgw==" + }, + "node_modules/@types/prop-types": { + "version": "15.7.11", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", + "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" + }, + "node_modules/@types/react": { + "version": "18.2.45", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz", + "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.2.18", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz", + "integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", + "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" + }, + "node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", + "integrity": "sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==", + "dependencies": { + "@babel/core": "^7.23.5", + "@babel/plugin-transform-react-jsx-self": "^7.23.3", + "@babel/plugin-transform-react-jsx-source": "^7.23.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0" + } + }, + "node_modules/@vitest/expect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.1.1.tgz", + "integrity": "sha512-Qpw01C2Hyb3085jBkOJLQ7HRX0Ncnh2qV4p+xWmmhcIUlMykUF69zsnZ1vPmAjZpomw9+5tWEGOQ0GTfR8U+kA==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.1.1", + "@vitest/utils": "1.1.1", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.1.1.tgz", + "integrity": "sha512-8HokyJo1SnSi3uPFKfWm/Oq1qDwLC4QDcVsqpXIXwsRPAg3gIDh8EbZ1ri8cmQkBxdOu62aOF9B4xcqJhvt4xQ==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.1.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.1.1.tgz", + "integrity": "sha512-WnMHjv4VdHLbFGgCdVVvyRkRPnOKN75JJg+LLTdr6ah7YnL75W+7CTIMdzPEPzaDxA8r5yvSVlc1d8lH3yE28w==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@vitest/snapshot/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@vitest/snapshot/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/@vitest/spy": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.1.1.tgz", + "integrity": "sha512-hDU2KkOTfFp4WFFPWwHFauddwcKuGQ7gF6Un/ZZkCogoAiTMN7/7YKvUDbywPZZ754iCQGjdUmXN3t4k0jm1IQ==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.1.1.tgz", + "integrity": "sha512-E9LedH093vST/JuBSyHLFMpxJKW3dLhe/flUSPFedoyj4wKiFX7Jm8gYLtOIiin59dgrssfmFv0BJ1u8P/LC/A==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@vitest/utils/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@vitest/utils/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/@volar/kit": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.4.tgz", + "integrity": "sha512-USRx/o0jKz7o8+lEKWMxWqbqvC46XFrf3IE6CZBYzRo9kM7RERQLwUYaoT2bOcHt5DQWublpnTgdgHMm37Gysg==", + "dependencies": { + "@volar/language-service": "2.0.4", + "@volar/typescript": "2.0.4", + "typesafe-path": "^0.2.2", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/@volar/language-core": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.0.4.tgz", + "integrity": "sha512-VhC8i03P0x9LKGLTBi81xNTNWm40yxQ/Iba8IpH+LFr+Yb7c/D7fF90Cvf31MzPDM4G5rjIOlCfs+eQKPBkwQw==", + "dependencies": { + "@volar/source-map": "2.0.4" + } + }, + "node_modules/@volar/language-server": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-server/-/language-server-2.0.4.tgz", + "integrity": "sha512-VnljhooQjT6RhmvwwJK9+3YYs2ovFmav4IVNHiQgnTMfiOiyABzcghwvJrJrI39rJDI6LNOWF7BYUJq7K07BKQ==", + "dependencies": { + "@volar/language-core": "2.0.4", + "@volar/language-service": "2.0.4", + "@volar/snapshot-document": "2.0.4", + "@volar/typescript": "2.0.4", + "@vscode/l10n": "^0.0.16", + "path-browserify": "^1.0.1", + "request-light": "^0.7.0", + "vscode-languageserver": "^9.0.1", + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@volar/language-service": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.0.4.tgz", + "integrity": "sha512-DoanyU9I9Nl85lUytDl8jgyk+nrUDR5CFNVMrxWXGXclP4WTqBayBgSFAeF1L/5AwP3MywmWoK4GLAEVvl8D+Q==", + "dependencies": { + "@volar/language-core": "2.0.4", + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@volar/snapshot-document": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/snapshot-document/-/snapshot-document-2.0.4.tgz", + "integrity": "sha512-YzgdmvpdRFxiBFCOVWga67naAtbPtKmPaFtGnmxWx+KXrjGkpUXT/2tzeKn5FLdtoYV+DRTdpMdP/45ArnVwZQ==", + "dependencies": { + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11" + } + }, + "node_modules/@volar/source-map": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.0.4.tgz", + "integrity": "sha512-BbxUinEMoJZqrHsSj1aBa0boCBnN3BoXnf7j9IBwjxosxGXOhCvqmH2L9raJemadaKjeVR8ZQLhV7AOhyoHt/Q==", + "dependencies": { + "muggle-string": "^0.4.0" + } + }, + "node_modules/@volar/typescript": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.0.4.tgz", + "integrity": "sha512-KF7yh7GIo4iWuAQOKf/ONeFHdQA+wFriitW8LtGZB4iOOT6MdlRlYNsRL8do7XxmXvsBKcs4jTMtGn+uZRwlWg==", + "dependencies": { + "@volar/language-core": "2.0.4", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@vscode/emmet-helper": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.9.2.tgz", + "integrity": "sha512-MaGuyW+fa13q3aYsluKqclmh62Hgp0BpKIqS66fCxfOaBcVQ1OnMQxRRgQUYnCkxFISAQlkJ0qWWPyXjro1Qrg==", + "dependencies": { + "emmet": "^2.4.3", + "jsonc-parser": "^2.3.0", + "vscode-languageserver-textdocument": "^1.0.1", + "vscode-languageserver-types": "^3.15.1", + "vscode-uri": "^2.1.2" + } + }, + "node_modules/@vscode/emmet-helper/node_modules/jsonc-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", + "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" + }, + "node_modules/@vscode/emmet-helper/node_modules/vscode-uri": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", + "integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==" + }, + "node_modules/@vscode/l10n": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.16.tgz", + "integrity": "sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==" + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/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==", + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/ansi-align/node_modules/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==" + }, + "node_modules/ansi-align/node_modules/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==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-align/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-escapes": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "peer": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/argv-formatter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", + "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", + "dev": true, + "peer": true + }, + "node_modules/aria-query": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", + "dev": true, + "dependencies": { + "deep-equal": "^2.0.5" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true + }, + "node_modules/array-iterate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/astro": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.1.0.tgz", + "integrity": "sha512-xbLWqvMn2JFyv7FpzHiXFn17bRS0P/b4cdEPXMMZOpBI9V8ZC33o6Xs+c59/pYSZpYiNd1HTg778XT5MhcpyKw==", + "dependencies": { + "@astrojs/compiler": "^2.3.4", + "@astrojs/internal-helpers": "0.2.1", + "@astrojs/markdown-remark": "4.0.1", + "@astrojs/telemetry": "3.0.4", + "@babel/core": "^7.23.3", + "@babel/generator": "^7.23.3", + "@babel/parser": "^7.23.3", + "@babel/plugin-transform-react-jsx": "^7.22.5", + "@babel/traverse": "^7.23.3", + "@babel/types": "^7.23.3", + "@types/babel__core": "^7.20.4", + "acorn": "^8.11.2", + "aria-query": "^5.3.0", + "axobject-query": "^4.0.0", + "boxen": "^7.1.1", + "chokidar": "^3.5.3", + "ci-info": "^4.0.0", + "clsx": "^2.0.0", + "common-ancestor-path": "^1.0.1", + "cookie": "^0.6.0", + "debug": "^4.3.4", + "deterministic-object-hash": "^2.0.1", + "devalue": "^4.3.2", + "diff": "^5.1.0", + "dlv": "^1.1.3", + "dset": "^3.1.3", + "es-module-lexer": "^1.4.1", + "esbuild": "^0.19.6", + "estree-walker": "^3.0.3", + "execa": "^8.0.1", + "fast-glob": "^3.3.2", + "flattie": "^1.1.0", + "github-slugger": "^2.0.0", + "gray-matter": "^4.0.3", + "html-escaper": "^3.0.3", + "http-cache-semantics": "^4.1.1", + "js-yaml": "^4.1.0", + "kleur": "^4.1.4", + "magic-string": "^0.30.3", + "mdast-util-to-hast": "13.0.2", + "mime": "^3.0.0", + "ora": "^7.0.1", + "p-limit": "^5.0.0", + "p-queue": "^8.0.1", + "path-to-regexp": "^6.2.1", + "preferred-pm": "^3.1.2", + "probe-image-size": "^7.2.3", + "prompts": "^2.4.2", + "rehype": "^13.0.1", + "resolve": "^1.22.4", + "semver": "^7.5.4", + "server-destroy": "^1.0.1", + "shikiji": "^0.6.13", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0", + "tsconfck": "^3.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1", + "vite": "^5.0.10", + "vitefu": "^0.2.5", + "which-pm": "^2.1.1", + "yargs-parser": "^21.1.1", + "zod": "^3.22.4" + }, + "bin": { + "astro": "astro.js" + }, + "engines": { + "node": ">=18.14.1", + "npm": ">=6.14.0" + }, + "optionalDependencies": { + "sharp": "^0.33.1" + } + }, + "node_modules/astro/node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/astro/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/astro/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/astro/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/astro/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/astro/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axobject-query": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", + "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base-64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dev": true + }, + "node_modules/boxen": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", + "dependencies": { + "ansi-align": "^3.0.1", + "camelcase": "^7.0.1", + "chalk": "^5.2.0", + "cli-boxes": "^3.0.0", + "string-width": "^5.1.2", + "type-fest": "^2.13.0", + "widest-line": "^4.0.1", + "wrap-ansi": "^8.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/boxen/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/boxen/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001591", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", + "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.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" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cli-highlight/node_modules/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, + "peer": true + }, + "node_modules/cli-highlight/node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true, + "peer": true + }, + "node_modules/cli-highlight/node_modules/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, + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/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, + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-highlight/node_modules/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, + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "peer": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "dev": true, + "peer": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-table3/node_modules/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, + "peer": true + }, + "node_modules/cli-table3/node_modules/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, + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3/node_modules/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, + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/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==" + }, + "node_modules/cliui/node_modules/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==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/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==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "optional": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/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==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/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==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "optional": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/common-ancestor-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==" + }, + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/conventional-changelog-angular": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-changelog-writer": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.1.tgz", + "integrity": "sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==", + "dev": true, + "dependencies": { + "conventional-commits-filter": "^4.0.0", + "handlebars": "^4.7.7", + "json-stringify-safe": "^5.0.1", + "meow": "^12.0.1", + "semver": "^7.5.2", + "split2": "^4.0.0" + }, + "bin": { + "conventional-changelog-writer": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-commits-filter": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-4.0.0.tgz", + "integrity": "sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-commits-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", + "dev": true, + "dependencies": { + "is-text-path": "^2.0.0", + "JSONStream": "^1.3.5", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "conventional-commits-parser": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dev": true, + "peer": true, + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cosmiconfig/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "peer": true + }, + "node_modules/cosmiconfig/node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "peer": true + }, + "node_modules/cosmiconfig/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cssstyle": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "dev": true, + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "node_modules/decode-named-character-reference": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", + "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-equal": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/deterministic-object-hash": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", + "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", + "dependencies": { + "base-64": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/devalue": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.2.tgz", + "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==" + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true + }, + "node_modules/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, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dset": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "dev": true, + "peer": true, + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/electron-to-chromium": { + "version": "1.4.685", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.685.tgz", + "integrity": "sha512-yDYeobbTEe4TNooEzOQO6xFqg9XnAkVy2Lod1C1B2it8u47JNLYvl9nLDWBamqUakWB8Jc1hhS1uHUNYTNQdfw==" + }, + "node_modules/emmet": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.6.tgz", + "integrity": "sha512-dJfbdY/hfeTyf/Ef7Y7ubLYzkBvPQ912wPaeVYpAxvFxkEBf/+hJu4H6vhAvFN6HlxqedlfVn2x1S44FfQ97pg==", + "dependencies": { + "@emmetio/abbreviation": "^2.3.3", + "@emmetio/css-abbreviation": "^2.1.8" + } + }, + "node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" + }, + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", + "dev": true, + "peer": true + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-ci": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.0.0.tgz", + "integrity": "sha512-apikxMgkipkgTvMdRT9MNqWx5VLOci79F4VBd7Op/7OPjjoanjdAvn6fglMCCEf/1bAh8eOiuEVCUs4V3qP3nQ==", + "dev": true, + "peer": true, + "dependencies": { + "execa": "^8.0.0", + "java-properties": "^1.0.2" + }, + "engines": { + "node": "^18.17 || >=20.6.1" + } + }, + "node_modules/env-ci/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/env-ci/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/env-ci/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "peer": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/env-ci/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-module-lexer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" + }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figures": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", + "integrity": "sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==", + "dev": true, + "peer": true, + "dependencies": { + "is-unicode-supported": "^2.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/is-unicode-supported": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", + "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/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==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-versions": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", + "dev": true, + "peer": true, + "dependencies": { + "semver-regex": "^4.0.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-yarn-workspace-root2": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", + "dependencies": { + "micromatch": "^4.0.2", + "pkg-dir": "^4.2.0" + } + }, + "node_modules/flattie": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.0.tgz", + "integrity": "sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", + "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/git-log-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", + "integrity": "sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==", + "dev": true, + "peer": true, + "dependencies": { + "argv-formatter": "~1.0.0", + "spawn-error-forwarder": "~1.0.0", + "split2": "~1.0.0", + "stream-combiner2": "~1.1.1", + "through2": "~2.0.0", + "traverse": "~0.6.6" + } + }, + "node_modules/git-log-parser/node_modules/split2": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", + "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", + "dev": true, + "peer": true, + "dependencies": { + "through2": "~2.0.0" + } + }, + "node_modules/github-slugger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/gray-matter": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "dependencies": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/gray-matter/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/gray-matter/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hast-util-from-html": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz", + "integrity": "sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^8.0.0", + "property-information": "^6.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.2.tgz", + "integrity": "sha512-PldBy71wO9Uq1kyaMch9AHIghtQvIwxBUkv823pKmkTM3oV1JxtsTNYdevMxvUHqcnOAuO65JKU2+0NOxc2ksA==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-html": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", + "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-raw": "^9.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-parse5": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", + "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/hook-std": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/html-escaper": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", + "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" + }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "peer": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/import-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", + "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", + "dev": true, + "engines": { + "node": ">=12.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-from-esm": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.3.tgz", + "integrity": "sha512-U3Qt/CyfFpTUv6LOP2jRTLYjphH6zg3okMfHbyqRa/W2w6hr8OsJWVggNlR4jxuojQy81TgTJTxgSkyoteRGMQ==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^4.3.4", + "import-meta-resolve": "^4.0.0" + }, + "engines": { + "node": ">=16.20" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/index-to-position": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/into-stream": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", + "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", + "dev": true, + "dependencies": { + "from2": "^2.3.0", + "p-is-promise": "^3.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-text-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", + "dev": true, + "dependencies": { + "text-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/issue-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", + "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", + "dev": true, + "dependencies": { + "lodash.capitalize": "^4.2.1", + "lodash.escaperegexp": "^4.1.2", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.uniqby": "^4.7.0" + }, + "engines": { + "node": ">=10.13" + } + }, + "node_modules/java-properties": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", + "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdom": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz", + "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==", + "dev": true, + "dependencies": { + "cssstyle": "^3.0.0", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.7", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.3", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.14.2", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true, + "peer": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz", + "integrity": "sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "peer": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/load-yaml-file/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/load-yaml-file/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/load-yaml-file/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "engines": { + "node": ">=6" + } + }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/lodash.capitalize": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", + "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", + "dev": true + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, + "node_modules/lodash.uniqby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", + "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, + "node_modules/magic-string": { + "version": "0.30.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", + "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/markdown-table": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/marked": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", + "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", + "dev": true, + "peer": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/marked-terminal": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.0.0.tgz", + "integrity": "sha512-sNEx8nn9Ktcm6pL0TnRz8tnXq/mSS0Q1FRSwJOAqw4lAB4l49UeDf85Gm1n9RPFm5qurCPjwi1StAQT2XExhZw==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-escapes": "^6.2.0", + "chalk": "^5.3.0", + "cli-highlight": "^2.1.11", + "cli-table3": "^0.6.3", + "node-emoji": "^2.1.3", + "supports-hyperlinks": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "marked": ">=1 <13" + } + }, + "node_modules/marked-terminal/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mdast-util-definitions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", + "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", + "dependencies": { + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true, + "engines": { + "node": ">=16.10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromark": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", + "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", + "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mlly": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" + } + }, + "node_modules/monaco-editor": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.46.0.tgz", + "integrity": "sha512-ADwtLIIww+9FKybWscd7OCfm9odsFYHImBRI1v9AviGce55QY8raT+9ihH8jX/E/e6QVSGM+pKj4jSUSRmALNQ==", + "peer": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "peer": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/needle": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/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==", + "dev": true + }, + "node_modules/nerf-dart": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", + "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", + "dev": true + }, + "node_modules/netlify-cli": { + "version": "17.10.2", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.10.2.tgz", + "integrity": "sha512-pKXL+w5/vm4ld6IUotBEse3KvN4+WCComLP6a73OiOvy8uM6uxtDUiuL+uAhRaozohjjaU/Ym4q1TqwbqWF5rA==", + "dev": true, + "hasInstallScript": true, + "hasShrinkwrap": true, + "dependencies": { + "@bugsnag/js": "7.20.2", + "@fastify/static": "6.10.2", + "@netlify/blobs": "6.3.1", + "@netlify/build": "29.31.0", + "@netlify/build-info": "7.11.3", + "@netlify/config": "20.10.0", + "@netlify/edge-bundler": "10.1.3", + "@netlify/local-functions-proxy": "1.1.1", + "@netlify/zip-it-and-ship-it": "9.28.1", + "@octokit/rest": "19.0.13", + "ansi-escapes": "6.2.0", + "ansi-styles": "6.2.1", + "ansi-to-html": "0.7.2", + "ascii-table": "0.0.9", + "backoff": "2.5.0", + "better-opn": "3.0.2", + "boxen": "7.1.1", + "chalk": "5.2.0", + "chokidar": "3.5.3", + "ci-info": "3.8.0", + "clean-deep": "3.4.0", + "commander": "10.0.1", + "comment-json": "4.2.3", + "concordance": "5.0.4", + "configstore": "6.0.0", + "content-type": "1.0.5", + "cookie": "0.5.0", + "copy-template-dir": "1.4.0", + "cron-parser": "4.8.1", + "debug": "4.3.4", + "decache": "4.6.2", + "dot-prop": "7.2.0", + "dotenv": "16.0.3", + "env-paths": "3.0.0", + "envinfo": "7.8.1", + "etag": "1.8.1", + "execa": "5.1.1", + "express": "4.18.2", + "express-logging": "1.1.1", + "extract-zip": "2.0.1", + "fastest-levenshtein": "1.0.16", + "fastify": "4.17.0", + "find-up": "6.3.0", + "flush-write-stream": "2.0.0", + "folder-walker": "3.2.0", + "from2-array": "0.0.4", + "fuzzy": "0.1.3", + "get-port": "5.1.1", + "gh-release-fetch": "4.0.3", + "git-repo-info": "2.1.1", + "gitconfiglocal": "2.1.0", + "hasbin": "1.2.3", + "hasha": "5.2.2", + "http-proxy": "1.18.1", + "http-proxy-middleware": "2.0.6", + "https-proxy-agent": "5.0.1", + "inquirer": "6.5.2", + "inquirer-autocomplete-prompt": "1.4.0", + "ipx": "2.0.1", + "is-docker": "3.0.0", + "is-stream": "3.0.0", + "is-wsl": "2.2.0", + "isexe": "2.0.0", + "js-yaml": "4.1.0", + "jsonwebtoken": "9.0.1", + "jwt-decode": "3.1.2", + "lambda-local": "2.1.2", + "listr2": "7.0.2", + "locate-path": "7.2.0", + "lodash": "4.17.21", + "log-symbols": "5.1.0", + "log-update": "5.0.1", + "multiparty": "4.2.3", + "netlify": "13.1.11", + "netlify-headers-parser": "7.1.2", + "netlify-redirect-parser": "14.2.0", + "netlify-redirector": "0.5.0", + "node-fetch": "2.6.12", + "node-version-alias": "3.4.1", + "ora": "6.3.1", + "p-filter": "3.0.0", + "p-map": "5.5.0", + "p-wait-for": "5.0.2", + "parallel-transform": "1.2.0", + "parse-github-url": "1.0.2", + "parse-gitignore": "2.0.0", + "path-key": "4.0.0", + "prettyjson": "1.2.5", + "pump": "3.0.0", + "raw-body": "2.5.2", + "read-pkg-up": "9.1.0", + "semver": "7.5.4", + "source-map-support": "0.5.21", + "strip-ansi-control-characters": "2.0.0", + "tabtab": "3.0.2", + "tempy": "3.0.0", + "terminal-link": "3.0.0", + "through2-filter": "3.0.0", + "through2-map": "3.0.0", + "to-readable-stream": "3.0.0", + "toml": "3.0.0", + "tomlify-j0.4": "3.0.0", + "ulid": "2.3.0", + "unixify": "1.0.0", + "update-notifier": "6.0.2", + "uuid": "9.0.0", + "wait-port": "1.0.4", + "write-file-atomic": "5.0.1", + "ws": "8.14.2", + "zod": "3.22.4" + }, + "bin": { + "netlify": "bin/run.js", + "ntl": "bin/run.js" + }, + "engines": { + "node": ">=18.14.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", + "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/highlight/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@babel/types": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", + "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/browser": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz", + "integrity": "sha512-4J4s53ZpYr3hHA+QjxUjOI6U+A8+XuUVH45UshE87Jp2Y4mV8ML2DovejqJS8J8yjdbnh2z1Wtg/v3WUNt4ayQ==", + "dev": true, + "dependencies": { + "@bugsnag/core": "^7.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/core": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz", + "integrity": "sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==", + "dev": true, + "dependencies": { + "@bugsnag/cuid": "^3.0.0", + "@bugsnag/safe-json-stringify": "^6.0.0", + "error-stack-parser": "^2.0.3", + "iserror": "0.0.2", + "stack-generator": "^2.0.3" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/cuid": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz", + "integrity": "sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@bugsnag/js": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.2.tgz", + "integrity": "sha512-Q08k0h0h6NFwFGkFmib39Uln2WpvJdqT1EGF1JlyYiGW03Y+VopVb9r37pZrRrN9IY08mxaIEO8la5xeaWAs6A==", + "dev": true, + "dependencies": { + "@bugsnag/browser": "^7.20.2", + "@bugsnag/node": "^7.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/node": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.19.0.tgz", + "integrity": "sha512-c4snyxx5d/fsMogmgehFBGc//daH6+4XCplia4zrEQYltjaQ+l8ud0dPx623DgJl/2j1+2zlRc7y7IHSd7Gm5w==", + "dev": true, + "dependencies": { + "@bugsnag/core": "^7.19.0", + "byline": "^5.0.0", + "error-stack-parser": "^2.0.2", + "iserror": "^0.0.2", + "pump": "^3.0.0", + "stack-generator": "^2.0.3" + } + }, + "node_modules/netlify-cli/node_modules/@bugsnag/safe-json-stringify": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz", + "integrity": "sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/netlify-cli/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@dabh/diagnostics": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", + "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", + "dev": true, + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@dependents/detective-less": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.0.0.tgz", + "integrity": "sha512-0udn+HKjGUzTX4Z+0vXdEJVsO28gxy5QxWjeChK4ZH+bwdvIXLuztiGZk8wLyAG1+LNZ5haVHKr5j1XfJnAkyQ==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^6.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/accept-negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", + "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", + "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==", + "dev": true, + "dependencies": { + "ajv": "^8.11.0", + "ajv-formats": "^2.1.1", + "fast-uri": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/ajv-compiler/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", + "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/error": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", + "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", + "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", + "dev": true, + "dependencies": { + "fast-json-stringify": "^5.7.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/send": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.0.1.tgz", + "integrity": "sha512-8jdouu0o5d0FMq1+zCKeKXc1tmOQ5tTGYdQP3MpyF9+WWrZT1KCBdh6hvoEYxOm3oJG/akdE9BpehLiJgYRvGw==", + "dev": true, + "dependencies": { + "@lukeed/ms": "^2.0.1", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "2.0.0", + "mime": "^3.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/send/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.10.2.tgz", + "integrity": "sha512-UoaMvIHSBLCZBYOVZwFRYqX2ufUhd7FFMYGDeSf0Z+D8jhYtwljjmuQGuanUP8kS4y/ZEV1a8mfLha3zNwsnnQ==", + "dev": true, + "dependencies": { + "@fastify/accept-negotiator": "^1.0.0", + "@fastify/send": "^2.0.0", + "content-disposition": "^0.5.3", + "fastify-plugin": "^4.0.0", + "glob": "^8.0.1", + "p-limit": "^3.1.0", + "readable-stream": "^4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", + "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.2.tgz", + "integrity": "sha512-Lf2pUhNTaviEdEaGgjU+29qw3arX7Qd/45q66F3z1EV5hroE6wM9xSHPvjB8EY+b1RmKZgwnLWXQorC6fZ9g5g==", + "dev": true, + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.9.tgz", + "integrity": "sha512-YJsOehVXzgurc+lLAxYnlSMc1p/Gu6VAvnfx0ATi2nzvr0YZcjhmZDeY8SeAKv1M7zE3aEJH0Xo9mK1iZ8GYoQ==", + "dev": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.4", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/@honeycombio/opentelemetry-node": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@honeycombio/opentelemetry-node/-/opentelemetry-node-0.5.0.tgz", + "integrity": "sha512-bAg//j0Lh0SFC0LhUrrgpO4FVScOBDt+my4YXeIo9lHi1aXXn6meaB/ycecjVfjyQLaGYWKPKu2C66rTgKIzMQ==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.3", + "@opentelemetry/api": "^1.4.1", + "@opentelemetry/core": "^1.13.0", + "@opentelemetry/exporter-metrics-otlp-grpc": "^0.41.0", + "@opentelemetry/exporter-metrics-otlp-proto": "^0.39.1", + "@opentelemetry/exporter-trace-otlp-grpc": "^0.41.0", + "@opentelemetry/exporter-trace-otlp-proto": "^0.41.0", + "@opentelemetry/resources": "^1.13.0", + "@opentelemetry/sdk-metrics": "^1.13.0", + "@opentelemetry/sdk-node": "^0.39.1", + "@opentelemetry/sdk-trace-base": "^1.13.0", + "axios": "^1.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", + "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", + "dev": true, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/netlify-cli/node_modules/@import-maps/resolve": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@import-maps/resolve/-/resolve-1.0.1.tgz", + "integrity": "sha512-tWZNBIS1CoekcwlMuyG2mr0a1Wo5lb5lEHwwWvZo+5GLgr3e9LLDTtmgtCWEwBpXMkxn9D+2W9j2FY6eZQq0tA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/@jest/types/node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/netlify-cli/node_modules/@lukeed/ms": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", + "integrity": "sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/binary-info": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@netlify/binary-info/-/binary-info-1.0.0.tgz", + "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/blobs": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.1.tgz", + "integrity": "sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg==", + "dev": true, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build": { + "version": "29.31.0", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.31.0.tgz", + "integrity": "sha512-XtUXnj3LtdWxcgP4kz1k0creF9bZa7eGNh85B89sw4V99Mtsn1Sl89yAZJkEH6rtuGJIs1eiQ261nlhUZ6+C6Q==", + "dev": true, + "dependencies": { + "@bugsnag/js": "^7.0.0", + "@honeycombio/opentelemetry-node": "^0.5.0", + "@netlify/blobs": "^6.3.1", + "@netlify/cache-utils": "^5.1.5", + "@netlify/config": "^20.10.0", + "@netlify/edge-bundler": "10.1.3", + "@netlify/framework-info": "^9.8.10", + "@netlify/functions-utils": "^5.2.45", + "@netlify/git-utils": "^5.1.1", + "@netlify/plugins-list": "^6.72.0", + "@netlify/run-utils": "^5.1.1", + "@netlify/zip-it-and-ship-it": "9.28.1", + "@opentelemetry/api": "^1.4.1", + "@opentelemetry/core": "^1.17.1", + "@sindresorhus/slugify": "^2.0.0", + "ansi-escapes": "^6.0.0", + "chalk": "^5.0.0", + "clean-stack": "^4.0.0", + "execa": "^6.0.0", + "fdir": "^6.0.1", + "figures": "^5.0.0", + "filter-obj": "^5.0.0", + "got": "^12.0.0", + "hot-shots": "10.0.0", + "indent-string": "^5.0.0", + "is-plain-obj": "^4.0.0", + "js-yaml": "^4.0.0", + "keep-func-props": "^4.0.0", + "locate-path": "^7.0.0", + "log-process-errors": "^8.0.0", + "map-obj": "^5.0.0", + "memoize-one": "^6.0.0", + "node-fetch": "^3.3.2", + "os-name": "^5.0.0", + "p-event": "^5.0.0", + "p-every": "^2.0.0", + "p-filter": "^3.0.0", + "p-locate": "^6.0.0", + "p-map": "^6.0.0", + "p-reduce": "^3.0.0", + "path-exists": "^5.0.0", + "path-type": "^5.0.0", + "pkg-dir": "^7.0.0", + "pretty-ms": "^8.0.0", + "ps-list": "^8.0.0", + "read-pkg-up": "^9.0.0", + "readdirp": "^3.4.0", + "resolve": "^2.0.0-next.1", + "rfdc": "^1.3.0", + "safe-json-stringify": "^1.2.0", + "semver": "^7.3.8", + "string-width": "^5.0.0", + "strip-ansi": "^7.0.0", + "supports-color": "^9.0.0", + "terminal-link": "^3.0.0", + "ts-node": "^10.9.1", + "typescript": "^5.0.0", + "uuid": "^9.0.0", + "yargs": "^17.6.0" + }, + "bin": { + "netlify-build": "bin.js" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + }, + "peerDependencies": { + "@netlify/opentelemetry-sdk-setup": "^1.0.1" + }, + "peerDependenciesMeta": { + "@netlify/opentelemetry-sdk-setup": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info": { + "version": "7.11.3", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.11.3.tgz", + "integrity": "sha512-lnJsJcoFSZIIB+4tOU/rdPjPn2+TP896B9y23z5THyACeN/e2I0Y7Y+d+BzHgFDcJBwqFpIehEs2jf8wPb9CHw==", + "dev": true, + "dependencies": { + "@bugsnag/js": "^7.20.0", + "dot-prop": "^7.2.0", + "find-up": "^6.3.0", + "minimatch": "^9.0.0", + "read-pkg": "^7.1.0", + "semver": "^7.3.8", + "toml": "^3.0.0", + "yaml": "^2.1.3", + "yargs": "^17.6.0" + }, + "bin": { + "build-info": "bin.js" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/core": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.18.1.tgz", + "integrity": "sha512-kvnUqezHMhsQvdsnhnqTNfAJs3ox/isB0SVrM1dhVFw7SsB7TstuVa6fgWnN2GdPyilIFLUvvbTZoVRmx6eiRg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.18.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.8.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.18.1.tgz", + "integrity": "sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "dev": true, + "dependencies": { + "find-up": "^6.3.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.5.tgz", + "integrity": "sha512-lMNdFmy2Yu3oVquSPooRDLxJ8QOsIX6X6vzA2pKz/9V2LQFJiqBukggXM+Rnqzk1regPpdJ0jK3dPGvOKaRQgg==", + "dev": true, + "dependencies": { + "cpy": "^9.0.0", + "get-stream": "^6.0.0", + "globby": "^13.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "move-file": "^3.0.0", + "path-exists": "^5.0.0", + "readdirp": "^3.4.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/cache-utils/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config": { + "version": "20.10.0", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.10.0.tgz", + "integrity": "sha512-7CNoL5IPSRBzDVzxuQgltZ71D/vZ/oYR29sfN8EXjAFOZPSLtnZgborcPa9V9BXLN4N5h0hFp2A26lnnCttEFg==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "cron-parser": "^4.1.0", + "deepmerge": "^4.2.2", + "dot-prop": "^7.0.0", + "execa": "^6.0.0", + "fast-safe-stringify": "^2.0.7", + "figures": "^5.0.0", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "indent-string": "^5.0.0", + "is-plain-obj": "^4.0.0", + "js-yaml": "^4.0.0", + "map-obj": "^5.0.0", + "netlify": "^13.1.11", + "netlify-headers-parser": "^7.1.2", + "netlify-redirect-parser": "^14.2.0", + "node-fetch": "^3.3.1", + "omit.js": "^2.0.2", + "p-locate": "^6.0.0", + "path-type": "^5.0.0", + "toml": "^3.0.0", + "tomlify-j0.4": "^3.0.0", + "validate-npm-package-name": "^4.0.0", + "yargs": "^17.6.0" + }, + "bin": { + "netlify-config": "bin.js" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-10.1.3.tgz", + "integrity": "sha512-+cFFUrdbkhbtmpvQlRam4CmNguKBjte7usNXO1IxDmExeYxdwkDWWBCjOO4zd/D12TIC3HSJGJjT76GkF+RwTg==", + "dev": true, + "dependencies": { + "@import-maps/resolve": "^1.0.1", + "@vercel/nft": "^0.24.3", + "ajv": "^8.11.2", + "ajv-errors": "^3.0.0", + "better-ajv-errors": "^1.2.0", + "common-path-prefix": "^3.0.0", + "env-paths": "^3.0.0", + "esbuild": "0.19.6", + "execa": "^6.0.0", + "find-up": "^6.3.0", + "get-package-name": "^2.2.0", + "get-port": "^6.1.2", + "is-path-inside": "^4.0.0", + "jsonc-parser": "^3.2.0", + "node-fetch": "^3.1.1", + "node-stream-zip": "^1.15.0", + "p-retry": "^5.1.1", + "p-wait-for": "^4.1.0", + "path-key": "^4.0.0", + "regexp-tree": "^0.1.24", + "semver": "^7.3.8", + "tmp-promise": "^3.0.3", + "urlpattern-polyfill": "8.0.2", + "uuid": "^9.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", + "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", + "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", + "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", + "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", + "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", + "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", + "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", + "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", + "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", + "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", + "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", + "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", + "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", + "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", + "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", + "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", + "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", + "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", + "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", + "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", + "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", + "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { + "version": "0.24.3", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.24.3.tgz", + "integrity": "sha512-IyBdIxmFAeGZnEfMgt4QrGK7XX4lWazlQj34HEi9dw04/WeDBJ7r1yaOIO5tTf9pbfvwUFodj9b0H+NDGGoOMg==", + "dev": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" + }, + "bin": { + "nft": "out/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "dev": true, + "peerDependencies": { + "ajv": "^8.0.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", + "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.6", + "@esbuild/android-arm64": "0.19.6", + "@esbuild/android-x64": "0.19.6", + "@esbuild/darwin-arm64": "0.19.6", + "@esbuild/darwin-x64": "0.19.6", + "@esbuild/freebsd-arm64": "0.19.6", + "@esbuild/freebsd-x64": "0.19.6", + "@esbuild/linux-arm": "0.19.6", + "@esbuild/linux-arm64": "0.19.6", + "@esbuild/linux-ia32": "0.19.6", + "@esbuild/linux-loong64": "0.19.6", + "@esbuild/linux-mips64el": "0.19.6", + "@esbuild/linux-ppc64": "0.19.6", + "@esbuild/linux-riscv64": "0.19.6", + "@esbuild/linux-s390x": "0.19.6", + "@esbuild/linux-x64": "0.19.6", + "@esbuild/netbsd-x64": "0.19.6", + "@esbuild/openbsd-x64": "0.19.6", + "@esbuild/sunos-x64": "0.19.6", + "@esbuild/win32-arm64": "0.19.6", + "@esbuild/win32-ia32": "0.19.6", + "@esbuild/win32-x64": "0.19.6" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "dev": true, + "dependencies": { + "p-timeout": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info": { + "version": "9.8.10", + "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.10.tgz", + "integrity": "sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==", + "dev": true, + "dependencies": { + "ajv": "^8.12.0", + "filter-obj": "^5.0.0", + "find-up": "^6.3.0", + "is-plain-obj": "^4.0.0", + "locate-path": "^7.0.0", + "p-filter": "^3.0.0", + "p-locate": "^6.0.0", + "process": "^0.11.10", + "read-pkg-up": "^9.0.0", + "semver": "^7.3.8" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { + "version": "5.2.45", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.45.tgz", + "integrity": "sha512-p7NQwOUmDbOG8G+J0UlMOKtTnEoaQemMCM8DgzFd4aOvlzZP870ociP/e6hfaxrq1cFB/cFGax+xfuRWAX66pA==", + "dev": true, + "dependencies": { + "@netlify/zip-it-and-ship-it": "9.28.1", + "cpy": "^9.0.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", + "integrity": "sha512-oyHieuTZH3rKTmg7EKpGEGa28IFxta2oXuVwpPJI/FJAtBje3UE+yko0eDjNufgm3AyGa8G77trUxgBhInAYuw==", + "dev": true, + "dependencies": { + "execa": "^6.0.0", + "map-obj": "^5.0.0", + "micromatch": "^4.0.2", + "moize": "^6.1.3", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy/-/local-functions-proxy-1.1.1.tgz", + "integrity": "sha512-eXSsayLT6PMvjzFQpjC9nkg2Otc3lZ5GoYele9M6f8PmsvWpaXRhwjNQ0NYhQQ2UZbLMIiO2dH8dbRsT3bMkFw==", + "dev": true, + "optionalDependencies": { + "@netlify/local-functions-proxy-darwin-arm64": "1.1.1", + "@netlify/local-functions-proxy-darwin-x64": "1.1.1", + "@netlify/local-functions-proxy-freebsd-arm64": "1.1.1", + "@netlify/local-functions-proxy-freebsd-x64": "1.1.1", + "@netlify/local-functions-proxy-linux-arm": "1.1.1", + "@netlify/local-functions-proxy-linux-arm64": "1.1.1", + "@netlify/local-functions-proxy-linux-ia32": "1.1.1", + "@netlify/local-functions-proxy-linux-ppc64": "1.1.1", + "@netlify/local-functions-proxy-linux-x64": "1.1.1", + "@netlify/local-functions-proxy-openbsd-x64": "1.1.1", + "@netlify/local-functions-proxy-win32-ia32": "1.1.1", + "@netlify/local-functions-proxy-win32-x64": "1.1.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-arm64/-/local-functions-proxy-darwin-arm64-1.1.1.tgz", + "integrity": "sha512-lphJ9qqZ3glnKWEqlemU1LMqXxtJ/tKf7VzakqqyjigwLscXSZSb6fupSjQfd4tR1xqxA76ylws/2HDhc/gs+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-darwin-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-darwin-x64/-/local-functions-proxy-darwin-x64-1.1.1.tgz", + "integrity": "sha512-4CRB0H+dXZzoEklq5Jpmg+chizXlVwCko94d8+UHWCgy/bA3M/rU/BJ8OLZisnJaAktHoeLABKtcLOhtRHpxZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-arm64/-/local-functions-proxy-freebsd-arm64-1.1.1.tgz", + "integrity": "sha512-u13lWTVMJDF0A6jX7V4N3HYGTIHLe5d1Z2wT43fSIHwXkTs6UXi72cGSraisajG+5JFIwHfPr7asw5vxFC0P9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-freebsd-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-freebsd-x64/-/local-functions-proxy-freebsd-x64-1.1.1.tgz", + "integrity": "sha512-g5xw4xATK5YDzvXtzJ8S1qSkWBiyF8VVRehXPMOAMzpGjCX86twYhWp8rbAk7yA1zBWmmWrWNA2Odq/MgpKJJg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm/-/local-functions-proxy-linux-arm-1.1.1.tgz", + "integrity": "sha512-YsTpL+AbHwQrfHWXmKnwUrJBjoUON363nr6jUG1ueYnpbbv6wTUA7gI5snMi/gkGpqFusBthAA7C30e6bixfiA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-arm64/-/local-functions-proxy-linux-arm64-1.1.1.tgz", + "integrity": "sha512-dPGu1H5n8na7mBKxiXQ+FNmthDAiA57wqgpm5JMAHtcdcmRvcXwJkwWVGvwfj8ShhYJHQaSaS9oPgO+mpKkgmA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ia32": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ia32/-/local-functions-proxy-linux-ia32-1.1.1.tgz", + "integrity": "sha512-Ra0FlXDrmPRaq+rYH3/ttkXSrwk1D5Zx/Na7UPfJZxMY7Qo5iY4bgi/FuzjzWzlp0uuKZOhYOYzYzsIIyrSvmw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-ppc64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-ppc64/-/local-functions-proxy-linux-ppc64-1.1.1.tgz", + "integrity": "sha512-oXf1satwqwUUxz7LHS1BxbRqc4FFEKIDFTls04eXiLReFR3sqv9H/QuYNTCCDMuRcCOd92qKyDfATdnxT4HR8w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-linux-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-linux-x64/-/local-functions-proxy-linux-x64-1.1.1.tgz", + "integrity": "sha512-bS3u4JuDg/eC0y4Na3i/29JBOxrdUvsK5JSjHfzUeZEbOcuXYf4KavTpHS5uikdvTgyczoSrvbmQJ5m0FLXfLA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-openbsd-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-openbsd-x64/-/local-functions-proxy-openbsd-x64-1.1.1.tgz", + "integrity": "sha512-1xLef/kLRNkBTXJ+ZGoRFcwsFxd/B2H3oeJZyXaZ3CN5umd9Mv9wZuAD74NuMt/535yRva8jtAJqvEgl9xMSdA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "bin": { + "local-functions-proxy": "bin/local-functions-proxy" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-ia32": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-ia32/-/local-functions-proxy-win32-ia32-1.1.1.tgz", + "integrity": "sha512-4IOMDBxp2f8VbIkhZ85zGNDrZR4ey8d68fCMSOIwitjsnKav35YrCf8UmAh3UR6CNIRJdJL4MW1GYePJ7iJ8uA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "bin": { + "local-functions-proxy.exe": "bin/local-functions-proxy.exe" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/local-functions-proxy-win32-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@netlify/local-functions-proxy-win32-x64/-/local-functions-proxy-win32-x64-1.1.1.tgz", + "integrity": "sha512-VCBXBJWBujVxyo5f+3r8ovLc9I7wJqpmgDn3ixs1fvdrER5Ac+SzYwYH4mUug9HI08mzTSAKZErzKeuadSez3w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "bin": { + "local-functions-proxy.exe": "bin/local-functions-proxy.exe" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/node-cookies": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@netlify/node-cookies/-/node-cookies-0.1.0.tgz", + "integrity": "sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==", + "dev": true, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/open-api": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.26.0.tgz", + "integrity": "sha512-B7q+ySzQm6rJhaGbY0Pzqnb1p3FsBqwiPLnLtA17JgTsqmXgQ7j6OQImW9fRJy/Al1ob9M6Oxng/FA2c7aIW1g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { + "version": "6.72.0", + "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.72.0.tgz", + "integrity": "sha512-GB3HxvUmOAkB6V3Tau7iQT7aH2NssmQHAgHWMrdD7pDfjcU6Vg0WcQfOWovjx2Bh6M0urOsJkBboX2egCuicEQ==", + "dev": true, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@netlify/run-utils/-/run-utils-5.1.1.tgz", + "integrity": "sha512-V2B8ZB19heVKa715uOeDkztxLH7uaqZ+9U5fV7BRzbQ2514DO5Vxj9hG0irzuRLfZXZZjp/chPUesv4VVsce/A==", + "dev": true, + "dependencies": { + "execa": "^6.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.1.tgz", + "integrity": "sha512-+G9cTltqfH54dF4dLqoEOV2P4qTIY8dM9blUVqg+NtVTXyuadzgpHqtffhVeyeLytVnTx1238kWJUe+sV3bnlg==", + "dev": true, + "dependencies": { + "@netlify/node-cookies": "^0.1.0", + "urlpattern-polyfill": "8.0.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { + "version": "9.28.1", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.28.1.tgz", + "integrity": "sha512-cihW7K9JvlhcrhbdUO9Rhe0r5pydKr8HL++4A2/J7S4Vzl3KftBHyS7O/2Vh54+u3aMon6m4CDXWwErSwjjLNQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.22.5", + "@babel/types": "7.23.4", + "@netlify/binary-info": "^1.0.0", + "@netlify/serverless-functions-api": "^1.12.1", + "@vercel/nft": "^0.23.0", + "archiver": "^6.0.0", + "common-path-prefix": "^3.0.0", + "cp-file": "^10.0.0", + "es-module-lexer": "^1.0.0", + "esbuild": "0.19.6", + "execa": "^6.0.0", + "fast-glob": "^3.3.2", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "glob": "^8.0.3", + "is-builtin-module": "^3.1.0", + "is-path-inside": "^4.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "merge-options": "^3.0.4", + "minimatch": "^9.0.0", + "normalize-path": "^3.0.0", + "p-map": "^5.0.0", + "path-exists": "^5.0.0", + "precinct": "^11.0.0", + "require-package-name": "^2.0.1", + "resolve": "^2.0.0-next.1", + "semver": "^7.3.8", + "tmp-promise": "^3.0.2", + "toml": "^3.0.0", + "unixify": "^1.0.0", + "urlpattern-polyfill": "8.0.2", + "yargs": "^17.0.0" + }, + "bin": { + "zip-it-and-ship-it": "dist/bin.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", + "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", + "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", + "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", + "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/darwin-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", + "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", + "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", + "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", + "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", + "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", + "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-loong64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", + "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", + "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", + "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", + "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-s390x": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", + "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/linux-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", + "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", + "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", + "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/sunos-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", + "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-arm64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", + "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-ia32": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", + "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/win32-x64": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", + "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/esbuild": { + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", + "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.6", + "@esbuild/android-arm64": "0.19.6", + "@esbuild/android-x64": "0.19.6", + "@esbuild/darwin-arm64": "0.19.6", + "@esbuild/darwin-x64": "0.19.6", + "@esbuild/freebsd-arm64": "0.19.6", + "@esbuild/freebsd-x64": "0.19.6", + "@esbuild/linux-arm": "0.19.6", + "@esbuild/linux-arm64": "0.19.6", + "@esbuild/linux-ia32": "0.19.6", + "@esbuild/linux-loong64": "0.19.6", + "@esbuild/linux-mips64el": "0.19.6", + "@esbuild/linux-ppc64": "0.19.6", + "@esbuild/linux-riscv64": "0.19.6", + "@esbuild/linux-s390x": "0.19.6", + "@esbuild/linux-x64": "0.19.6", + "@esbuild/netbsd-x64": "0.19.6", + "@esbuild/openbsd-x64": "0.19.6", + "@esbuild/sunos-x64": "0.19.6", + "@esbuild/win32-arm64": "0.19.6", + "@esbuild/win32-ia32": "0.19.6", + "@esbuild/win32-x64": "0.19.6" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/auth-token": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/core": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz", + "integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==", + "dev": true, + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/endpoint": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", + "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/graphql": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", + "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", + "dev": true, + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^7.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { + "version": "13.13.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", + "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", + "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", + "dev": true, + "dependencies": { + "@octokit/tsconfig": "^1.0.2", + "@octokit/types": "^9.2.3" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "dev": true, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz", + "integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==", + "dev": true, + "dependencies": { + "@octokit/types": "^9.2.3", + "deprecation": "^2.3.1" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/request": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "dev": true, + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/request-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/rest": { + "version": "19.0.13", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", + "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", + "dev": true, + "dependencies": { + "@octokit/core": "^4.2.1", + "@octokit/plugin-paginate-rest": "^6.1.2", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^7.1.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/tsconfig": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", + "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/types": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", + "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^13.11.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/api": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", + "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/api-logs": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.41.2.tgz", + "integrity": "sha512-JEV2RAqijAFdWeT6HddYymfnkiRu2ASxoTBr4WsnGJhOjWZkEy6vp+Sx9ozr1NaIODOa2HUyckExIqQjn6qywQ==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/context-async-hooks": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.13.0.tgz", + "integrity": "sha512-pS5fU4lrRjOIPZQqA2V1SUM9QUFXbO+8flubAiy6ntLjnAjJJUdRFOUOxK6v86ZHI2p2S8A0vD0BTu95FZYvjA==", + "dev": true, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/core": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.13.0.tgz", + "integrity": "sha512-2dBX3Sj99H96uwJKvc2w9NOiNgbvAO6mOFJFramNkKfS9O4Um+VWgpnlAazoYjT6kUJ1MP70KQ5ngD4ed+4NUw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-jaeger": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-jaeger/-/exporter-jaeger-1.13.0.tgz", + "integrity": "sha512-ke/STs/erRDqKmNv6Dv+5SetXsVD+Zm1/Wo8cLdAGrZn6kG6Fyp5EXVO/BJuzx6q+jHCdODm8jV4veXl4m71nQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0", + "@opentelemetry/semantic-conventions": "1.13.0", + "jaeger-client": "^3.15.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-grpc/-/exporter-metrics-otlp-grpc-0.41.2.tgz", + "integrity": "sha512-gQuCcd5QSMkfi1XIriWAoak/vaRvFzpvtzh2hjziIvbnA3VtoGD3bDb2dzEzOA1iSWO0/tHwnBsSmmUZsETyOA==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.15.2", + "@opentelemetry/exporter-metrics-otlp-http": "0.41.2", + "@opentelemetry/otlp-grpc-exporter-base": "0.41.2", + "@opentelemetry/otlp-transformer": "0.41.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/sdk-metrics": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.41.2.tgz", + "integrity": "sha512-+YeIcL4nuldWE89K8NBLImpXCvih04u1MBnn8EzvoywG2TKR5JC3CZEPepODIxlsfGSgP8W5khCEP1NHZzftYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/otlp-exporter-base": "0.41.2", + "@opentelemetry/otlp-transformer": "0.41.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/sdk-metrics": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-proto/-/exporter-metrics-otlp-proto-0.39.1.tgz", + "integrity": "sha512-S+FgIhmZiFMsUivtAlCyzf3L5ezPyCqvlzt4hSZmiKs0kqapau1HS4cSpGacs9Jy499TRSNtqfjj7GxZrNIevw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/exporter-metrics-otlp-http": "0.39.1", + "@opentelemetry/otlp-exporter-base": "0.39.1", + "@opentelemetry/otlp-proto-exporter-base": "0.39.1", + "@opentelemetry/otlp-transformer": "0.39.1", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-metrics": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/api-logs": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", + "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/exporter-metrics-otlp-http": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.39.1.tgz", + "integrity": "sha512-Uj2i6t5v9aexV03xvVobwLV0Yxn7lQcCxBGN5KKxcs8BTZYSfjdwhrFjsOxvEQ2cXugL0aIzCuTKxrlXYTmFwA==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/otlp-exporter-base": "0.39.1", + "@opentelemetry/otlp-transformer": "0.39.1", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-metrics": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", + "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.39.1", + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-logs": "0.39.1", + "@opentelemetry/sdk-metrics": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-logs": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", + "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.5.0", + "@opentelemetry/api-logs": ">=0.38.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-metrics-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", + "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "lodash.merge": "4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.41.2.tgz", + "integrity": "sha512-tRM/mq7PFj7mXCws5ICMVp/rmgU93JvZdoLE0uLj4tugNz231u2ZgeRYXulBjdeHM88ZQSsWTJMu2mvr/3JV1A==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.15.2", + "@opentelemetry/otlp-grpc-exporter-base": "0.41.2", + "@opentelemetry/otlp-transformer": "0.41.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/sdk-trace-base": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", + "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.39.1.tgz", + "integrity": "sha512-AEhnJfVmo1g+7NxszAuf3c6vddld2DGH2+IM4XrPxCklucCsIpuStuC5EVZbCXXXBMpAY+n3t04QMxIQqNrcSw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/otlp-exporter-base": "0.39.1", + "@opentelemetry/otlp-transformer": "0.39.1", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/api-logs": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", + "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", + "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.39.1", + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-logs": "0.39.1", + "@opentelemetry/sdk-metrics": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-logs": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", + "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.5.0", + "@opentelemetry/api-logs": ">=0.38.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", + "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "lodash.merge": "4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.41.2.tgz", + "integrity": "sha512-IGZga9IIckqYE3IpRE9FO9G5umabObIrChlXUHYpMJtDgx797dsb3qXCvLeuAwB+HoB8NsEZstlzmLnoa6/HmA==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/otlp-exporter-base": "0.41.2", + "@opentelemetry/otlp-proto-exporter-base": "0.41.2", + "@opentelemetry/otlp-transformer": "0.41.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/sdk-trace-base": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-proto-exporter-base": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.41.2.tgz", + "integrity": "sha512-BxmEMiP6tHiFroe5/dTt9BsxCci7BTLtF7A6d4DKHLiLweWWZxQ9l7hON7qt/IhpKrQcAFD1OzZ1Gq2ZkNzhCw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/otlp-exporter-base": "0.41.2", + "protobufjs": "^7.2.3" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", + "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.13.0.tgz", + "integrity": "sha512-4IuUmYEhlHm8tAGtd6KKkktEO9Bt7dpdBdAPVAzhmXsPwGi0yExo7E5qfi9HtHQcdfP9SnrGRkeorVtrZkGlhg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0", + "@opentelemetry/semantic-conventions": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.39.1.tgz", + "integrity": "sha512-s7/9tPmM0l5KCd07VQizC4AO2/5UJdkXq5gMSHPdCeiMKSeBEdyDyQX7A+Cq+RYZM452qzFmrJ4ut628J5bnSg==", + "dev": true, + "dependencies": { + "require-in-the-middle": "^7.1.0", + "semver": "^7.3.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.41.2.tgz", + "integrity": "sha512-pfwa6d+Dax3itZcGWiA0AoXeVaCuZbbqUTsCtOysd2re8C2PWXNxDONUfBWsn+KgxAdi+ljwTjJGiaVLDaIEvQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.41.2.tgz", + "integrity": "sha512-OErK8dYjXG01XIMIpmOV2SzL9ctkZ0Nyhf2UumICOAKtgLvR5dG1JMlsNVp8Jn0RzpsKc6Urv7JpP69wzRXN+A==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.15.2", + "@opentelemetry/otlp-exporter-base": "0.41.2", + "protobufjs": "^7.2.3" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.39.1.tgz", + "integrity": "sha512-VssdfGYu6LkSliQATdkvoP8lPSQuNLENRdHTUOV2veF4iqY/UpxBFFlkarY29W+MYjWXIBfYntgNjQvcn78A+w==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/otlp-exporter-base": "0.39.1", + "protobufjs": "^7.1.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.41.2.tgz", + "integrity": "sha512-jJbPwB0tNu2v+Xi0c/v/R3YBLJKLonw1p+v3RVjT2VfzeUyzSp/tBeVdY7RZtL6dzZpA9XSmp8UEfWIFQo33yA==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.41.2", + "@opentelemetry/core": "1.15.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/sdk-logs": "0.41.2", + "@opentelemetry/sdk-metrics": "1.15.2", + "@opentelemetry/sdk-trace-base": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.2.tgz", + "integrity": "sha512-BEaxGZbWtvnSPchV98qqqqa96AOcb41pjgvhfzDij10tkBhIu9m0Jd6tZ1tJB5ZHfHbTffqYVYE0AOGobec/EQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/resources": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.13.0.tgz", + "integrity": "sha512-HOo91EI4UbuG8xQVLFziTzrcIn0MJQhy8m9jorh8aonb94jFVFi3CFNIiAnIGOabmnshJLOABxpYXsiPB8Xnzg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.13.0.tgz", + "integrity": "sha512-IV9TO+u1Jzm9mUDAD3gyXf89eyvgEJUY1t+GB5QmS4wjVeWrSMUtD0JjH3yG9SNqkrQOqOGJq7YUSSetW+Lf5Q==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/resources": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.13.0.tgz", + "integrity": "sha512-euqjOkiN6xhjE//0vQYGvbStxoD/WWQRhDiO0OTLlnLBO9Yw2Gd/VoSx2H+svsebjzYk5OxLuREBmcdw6rbUNg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/semantic-conventions": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.41.2.tgz", + "integrity": "sha512-smqKIw0tTW15waj7BAPHFomii5c3aHnSE4LQYTszGoK5P9nZs8tEAIpu15UBxi3aG31ZfsLmm4EUQkjckdlFrw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/resources": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.5.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.2.tgz", + "integrity": "sha512-9aIlcX8GnhcsAHW/Wl8bzk4ZnWTpNlLtud+fxUfBtFATu6OZ6TrGrF4JkT9EVrnoxwtPIDtjHdEsSjOqisY/iA==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/resources": "1.15.2", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", + "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.2.tgz", + "integrity": "sha512-xmMRLenT9CXmm5HMbzpZ1hWhaUowQf8UB4jMjFlAxx1QzQcsD3KFNAVX/CAWzFPtllTyTplrA4JrQ7sCH3qmYw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.15.2", + "@opentelemetry/semantic-conventions": "1.15.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", + "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.39.1.tgz", + "integrity": "sha512-qODReBGNSdfRS5gvCFj1SdiIi/3ZFTZb0H1KvWE/OrTkklyL5RhIs7vDwvEGHmha+YpUu0Y2+R2+itSBSu/jCA==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/exporter-jaeger": "1.13.0", + "@opentelemetry/exporter-trace-otlp-grpc": "0.39.1", + "@opentelemetry/exporter-trace-otlp-http": "0.39.1", + "@opentelemetry/exporter-trace-otlp-proto": "0.39.1", + "@opentelemetry/exporter-zipkin": "1.13.0", + "@opentelemetry/instrumentation": "0.39.1", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-metrics": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0", + "@opentelemetry/sdk-trace-node": "1.13.0", + "@opentelemetry/semantic-conventions": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/api-logs": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.39.1.tgz", + "integrity": "sha512-9BJ8lMcOzEN0lu+Qji801y707oFO4xT3db6cosPvl+k7ItUHKN5ofWqtSbM9gbt1H4JJ/4/2TVrqI9Rq7hNv6Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.39.1.tgz", + "integrity": "sha512-l5RhLKx6U+yuLhMrtgavTDthX50E1mZM3/SSySC7OPZiArFHV/b/9x9jxAzrOgIQUDxyj4N0V9aLKSA2t7Qzxg==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.13.0", + "@opentelemetry/otlp-grpc-exporter-base": "0.39.1", + "@opentelemetry/otlp-transformer": "0.39.1", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/exporter-trace-otlp-proto": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.39.1.tgz", + "integrity": "sha512-oJQC7a67iwExRYynKqn/O9Fl5gUjDa43ZQsZu2iKAADs/6YJ+u5MJ/wcq3CpJsn2KU/8j8HWAKOcDkkQXPuJ9A==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/otlp-exporter-base": "0.39.1", + "@opentelemetry/otlp-proto-exporter-base": "0.39.1", + "@opentelemetry/otlp-transformer": "0.39.1", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.39.1.tgz", + "integrity": "sha512-Pv5X8fbi6jD/RJBePyn7MnCSuE6MbPB6dl+7YYBWJ5RcMGYMwvLXjd4h2jWsPV2TSUg38H/RoSP0aXvQ06Y7iw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-grpc-exporter-base": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.39.1.tgz", + "integrity": "sha512-u3ErFRQqQFKjjIMuwLWxz/tLPYInfmiAmSy//fGSCzCh2ZdJgqQjMOAxBgqFtCF2xFL+OmMhyuC2ThMzceGRWA==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.13.0", + "@opentelemetry/otlp-exporter-base": "0.39.1", + "protobufjs": "^7.2.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.39.1.tgz", + "integrity": "sha512-0hgVnXXz5efI382B/24NxD4b6Zxlh7nxCdJkxkdmQMbn0yRiwoq/ZT+QG8eUL6JNzsBAV1WJlF5aJNsL8skHvw==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.39.1", + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/sdk-logs": "0.39.1", + "@opentelemetry/sdk-metrics": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-logs": { + "version": "0.39.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.39.1.tgz", + "integrity": "sha512-/gmgKfZ1ZVFporKuwsewqIyvaUIGpv76JZ7lBpHQQPb37IMpaXO6pdqFI4ebHAWfNIm3akMyhmdtzivcgF3lgw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.5.0", + "@opentelemetry/api-logs": ">=0.38.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz", + "integrity": "sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "lodash.merge": "4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.13.0.tgz", + "integrity": "sha512-moTiQtc0uPR1hQLt6gLDJH9IIkeBhgRb71OKjNHZPE1VF45fHtD6nBDi5J/DkTHTwYP5X3kBJLa3xN7ub6J4eg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.13.0", + "@opentelemetry/resources": "1.13.0", + "@opentelemetry/semantic-conventions": "1.13.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.13.0.tgz", + "integrity": "sha512-FXA85lXKTsnbOflA/TBuBf2pmhD3c8uDjNjG0YqK+ap8UayfALmfJhf+aG1yBOUHevCY0JXJ4/xtbXExxpsMog==", + "dev": true, + "dependencies": { + "@opentelemetry/context-async-hooks": "1.13.0", + "@opentelemetry/core": "1.13.0", + "@opentelemetry/propagator-b3": "1.13.0", + "@opentelemetry/propagator-jaeger": "1.13.0", + "@opentelemetry/sdk-trace-base": "1.13.0", + "semver": "^7.3.5" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.5.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.13.0.tgz", + "integrity": "sha512-LMGqfSZkaMQXqewO0o1wvWr/2fQdCh4a3Sqlxka/UsJCe0cfLulh6x2aqnKLnsrSGiCq5rSCwvINd152i0nCqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.3.0.tgz", + "integrity": "sha512-pW7QaFiL11O0BphO+bq3MgqeX/INAk9jgBldVDYjlQPO4VddoZnF22TcF9onMhnLVHuNqBJeRf+Fj7eezi/+rQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.3.0", + "@parcel/watcher-darwin-arm64": "2.3.0", + "@parcel/watcher-darwin-x64": "2.3.0", + "@parcel/watcher-freebsd-x64": "2.3.0", + "@parcel/watcher-linux-arm-glibc": "2.3.0", + "@parcel/watcher-linux-arm64-glibc": "2.3.0", + "@parcel/watcher-linux-arm64-musl": "2.3.0", + "@parcel/watcher-linux-x64-glibc": "2.3.0", + "@parcel/watcher-linux-x64-musl": "2.3.0", + "@parcel/watcher-win32-arm64": "2.3.0", + "@parcel/watcher-win32-ia32": "2.3.0", + "@parcel/watcher-win32-x64": "2.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-android-arm64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.3.0.tgz", + "integrity": "sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.3.0.tgz", + "integrity": "sha512-mKY+oijI4ahBMc/GygVGvEdOq0L4DxhYgwQqYAz/7yPzuGi79oXrZG52WdpGA1wLBPrYb0T8uBaGFo7I6rvSKw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-x64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.3.0.tgz", + "integrity": "sha512-20oBj8LcEOnLE3mgpy6zuOq8AplPu9NcSSSfyVKgfOhNAc4eF4ob3ldj0xWjGGbOF7Dcy1Tvm6ytvgdjlfUeow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.3.0.tgz", + "integrity": "sha512-7LftKlaHunueAEiojhCn+Ef2CTXWsLgTl4hq0pkhkTBFI3ssj2bJXmH2L67mKpiAD5dz66JYk4zS66qzdnIOgw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.3.0.tgz", + "integrity": "sha512-1apPw5cD2xBv1XIHPUlq0cO6iAaEUQ3BcY0ysSyD9Kuyw4MoWm1DV+W9mneWI+1g6OeP6dhikiFE6BlU+AToTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.3.0.tgz", + "integrity": "sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.3.0.tgz", + "integrity": "sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.3.0.tgz", + "integrity": "sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.3.0.tgz", + "integrity": "sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.3.0.tgz", + "integrity": "sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==", + "bundleDependencies": [ + "napi-wasm" + ], + "dev": true, + "dependencies": { + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "napi-wasm": "^1.1.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-arm64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.3.0.tgz", + "integrity": "sha512-35gXCnaz1AqIXpG42evcoP2+sNL62gZTMZne3IackM+6QlfMcJLy3DrjuL6Iks7Czpd3j4xRBzez3ADCj1l7Aw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-ia32": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.3.0.tgz", + "integrity": "sha512-FJS/IBQHhRpZ6PiCjFt1UAcPr0YmCLHRbTc00IBTrelEjlmmgIVLeOx4MSXzx2HFEy5Jo5YdhGpxCuqCyDJ5ow==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-x64": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.3.0.tgz", + "integrity": "sha512-dLx+0XRdMnVI62kU3wbXvbIRhLck4aE28bIGKbRGS7BJNt54IIj9+c/Dkqb+7DJEbHUZAX1bwaoM8PqVlHJmCA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", + "dev": true, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/netlify-cli/node_modules/@pnpm/network.ca-file": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", + "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", + "dev": true, + "dependencies": { + "graceful-fs": "4.2.10" + }, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/netlify-cli/node_modules/@pnpm/npm-conf": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.0.tgz", + "integrity": "sha512-roLI1ul/GwzwcfcVpZYPdrgW2W/drLriObl1h+yLF5syc8/5ULWw2ALbCHUWF+4YltIqA3xFSbG4IwyJz37e9g==", + "dev": true, + "dependencies": { + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dev": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/netlify-cli/node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dev": true, + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@sindresorhus/slugify": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", + "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", + "dev": true, + "dependencies": { + "@sindresorhus/transliterate": "^1.0.0", + "escape-string-regexp": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@sindresorhus/transliterate": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.5.0.tgz", + "integrity": "sha512-/sfSkoNelLq5riqNRp5uBjHIKBi1MWZk9ubRT1WiBQuTfmDf7BeQkph2DJzRB83QagMPHk2VDjuvpy0VuwyzdA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "lodash.deburr": "^4.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@trysound/sax": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", + "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/netlify-cli/node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/http-cache-semantics": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.2.tgz", + "integrity": "sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@types/http-proxy": { + "version": "1.17.8", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.8.tgz", + "integrity": "sha512-5kPLG5BKpWYkw/LVOGWpiq3nEVqxiN32rTgI53Sk12/xHFQ2rG3ehI9IO+O3W2QoKeyB92dJkoka8SUm6BX1pA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/netlify-cli/node_modules/@types/node": { + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/netlify-cli/node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/netlify-cli/node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/netlify-cli/node_modules/@types/retry": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", + "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@types/serve-static": { + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/netlify-cli/node_modules/@types/yargs-parser": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@types/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/netlify-cli/node_modules/@vercel/nft": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.23.1.tgz", + "integrity": "sha512-NE0xSmGWVhgHF1OIoir71XAd0W0C1UE3nzFyhpFiMr3rVhetww7NvM1kc41trBsPG37Bh+dE5FYCTMzM/gBu0w==", + "dev": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" + }, + "bin": { + "nft": "out/cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/archive-type": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@xhmikosr/archive-type/-/archive-type-6.0.1.tgz", + "integrity": "sha512-PB3NeJL8xARZt52yDBupK0dNPn8uIVQDe15qNehUpoeeLWCZyAOam4vGXnoZGz2N9D1VXtjievJuCsXam2TmbQ==", + "dev": true, + "dependencies": { + "file-type": "^18.5.0" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress/-/decompress-9.0.1.tgz", + "integrity": "sha512-9Lvlt6Qdpo9SaRQyRIXCo3lgU++eMZ68lzgjcTwtuKDrlwT635+5zsHZ1yrSx/Blc5IDuVLlPkBPj5CZkx+2+Q==", + "dev": true, + "dependencies": { + "@xhmikosr/decompress-tar": "^7.0.0", + "@xhmikosr/decompress-tarbz2": "^7.0.0", + "@xhmikosr/decompress-targz": "^7.0.0", + "@xhmikosr/decompress-unzip": "^6.0.0", + "graceful-fs": "^4.2.11", + "make-dir": "^4.0.0", + "strip-dirs": "^3.0.0" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tar": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tar/-/decompress-tar-7.0.0.tgz", + "integrity": "sha512-kyWf2hybtQVbWtB+FdRyOT+jyR5jxCNZPLqvQGB7djZj75lrpLUPEmRbyo86AtJ5OEtivpYaNWjCkqSJ8xtRWw==", + "dev": true, + "dependencies": { + "file-type": "^18.5.0", + "is-stream": "^3.0.0", + "tar-stream": "^3.1.4" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tarbz2": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tarbz2/-/decompress-tarbz2-7.0.0.tgz", + "integrity": "sha512-3QnjipYkRgh3Dee1MWDgKmANWxOQBVN4e1IwiGNe2fHYfMYTeSkVvWREt87UIoSucKUh3E95v8uGFttgTknZcA==", + "dev": true, + "dependencies": { + "@xhmikosr/decompress-tar": "^7.0.0", + "file-type": "^18.5.0", + "is-stream": "^3.0.0", + "seek-bzip": "^1.0.6", + "unbzip2-stream": "^1.4.3" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-targz": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-targz/-/decompress-targz-7.0.0.tgz", + "integrity": "sha512-7BNHJl92g9OLhw89zqcFS67V1LAtm4Ex02j6OiQzuE8P7Yy9lQcyBuEL3x6v436grLdL+BcFjgbmhWxnem4GHw==", + "dev": true, + "dependencies": { + "@xhmikosr/decompress-tar": "^7.0.0", + "file-type": "^18.5.0", + "is-stream": "^3.0.0" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-unzip": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-unzip/-/decompress-unzip-6.0.0.tgz", + "integrity": "sha512-R1HAkjXLS7RAL74YFLxYY9zYflCcYGssld9KKFDu87PnJ4h4btdhzXfSC8J5i5A2njH3oYIoCzx03RIGTH07Sg==", + "dev": true, + "dependencies": { + "file-type": "^18.5.0", + "get-stream": "^6.0.1", + "yauzl": "^2.10.0" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress/node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@xhmikosr/downloader/-/downloader-13.0.1.tgz", + "integrity": "sha512-mBvWew1kZJHfNQVVfVllMjUDwCGN9apPa0t4/z1zaUJ9MzpXjRL3w8fsfJKB8gHN/h4rik9HneKfDbh2fErN+w==", + "dev": true, + "dependencies": { + "@xhmikosr/archive-type": "^6.0.1", + "@xhmikosr/decompress": "^9.0.1", + "content-disposition": "^0.5.4", + "ext-name": "^5.0.0", + "file-type": "^18.5.0", + "filenamify": "^5.1.1", + "get-stream": "^6.0.1", + "got": "^12.6.1", + "merge-options": "^3.0.4", + "p-event": "^5.0.1" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filename-reserved-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz", + "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filenamify": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-5.1.1.tgz", + "integrity": "sha512-M45CbrJLGACfrPOkrTp3j2EcO9OBkKUYME0eiqOCa7i2poaklU0jhlIaMlr8ijLorT0uLAzrn3qXOp5684CkfA==", + "dev": true, + "dependencies": { + "filename-reserved-regex": "^3.0.0", + "strip-outer": "^2.0.0", + "trim-repeated": "^2.0.0" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/http2-wrapper": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/strip-outer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-2.0.0.tgz", + "integrity": "sha512-A21Xsm1XzUkK0qK1ZrytDUvqsQWict2Cykhvi0fBQntGG5JSprESasEyV1EZ/4CiR5WB5KjzLTrP/bO37B0wPg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/trim-repeated": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-2.0.0.tgz", + "integrity": "sha512-QUHBFTJGdOwmp0tbOG505xAgOp/YliZP/6UgafFXYZ26WT1bvQmSMJUvkeVSASuJJHbqsFbynTvkd5W8RBTipg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/netlify-cli/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/netlify-cli/node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/aggregate-error/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/ajv-formats/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/ajv-formats/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/all-node-versions": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/all-node-versions/-/all-node-versions-11.3.0.tgz", + "integrity": "sha512-psMkc5s3qpr+QMfires9bC4azRYciPWql1wqZKMsYRh1731qefQDH2X4+O19xSBX6u0Ra/8Y5diG6y/fEmqKsw==", + "dev": true, + "dependencies": { + "fetch-node-website": "^7.3.0", + "filter-obj": "^5.1.0", + "get-stream": "^6.0.0", + "global-cache-dir": "^4.3.1", + "is-plain-obj": "^4.1.0", + "path-exists": "^5.0.0", + "semver": "^7.3.7", + "write-file-atomic": "^4.0.1" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/netlify-cli/node_modules/all-node-versions/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/all-node-versions/node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/netlify-cli/node_modules/ansi-color": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", + "integrity": "sha512-bF6xLaZBLpOQzgYUtYEhJx090nPSZk1BQ/q2oyBK9aMMcJHzx9uXGCjI2Y+LebsN4Jwoykr0V9whbPiogdyHoQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/ansi-escapes": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "dev": true, + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/ansi-to-html": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.7.2.tgz", + "integrity": "sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==", + "dev": true, + "dependencies": { + "entities": "^2.2.0" + }, + "bin": { + "ansi-to-html": "bin/ansi-to-html" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/ansi-to-html/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/archiver": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.1.tgz", + "integrity": "sha512-CXGy4poOLBKptiZH//VlWdFuUC1RESbdZjGjILwBuZ73P7WkAUN0htfSfBq/7k6FRFlpu7bg4JOkj1vU9G6jcQ==", + "dev": true, + "dependencies": { + "archiver-utils": "^4.0.1", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^5.0.1" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver-utils": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-4.0.1.tgz", + "integrity": "sha512-Q4Q99idbvzmgCTEAAhi32BkOyq8iVI5EwdO0PmBDSGIzzjYNdcFn7Q7k3OzbLy4kLUPXfJtG6fO2RjftXbobBg==", + "dev": true, + "dependencies": { + "glob": "^8.0.0", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/ascii-table": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", + "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/ast-module-types": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-5.0.0.tgz", + "integrity": "sha512-JvqziE0Wc0rXQfma0HZC/aY7URXHFuZV84fJRtP8u+lhp0JYCNd5wJzVXP45t0PH0Mej3ynlzvdyITYIu0G4LQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/async-sema": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz", + "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/avvio": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", + "integrity": "sha512-bbCQdg7bpEv6kGH41RO/3B2/GMMmJSo2iBK+X8AWN9mujtfUipMDfIjsgHCfpnKqoGEQrrmCDKSa5OQ19+fDmg==", + "dev": true, + "dependencies": { + "archy": "^1.0.0", + "debug": "^4.0.0", + "fastq": "^1.6.1" + } + }, + "node_modules/netlify-cli/node_modules/axios": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/netlify-cli/node_modules/b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/backoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==", + "dev": true, + "dependencies": { + "precond": "0.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/better-ajv-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/better-ajv-errors/-/better-ajv-errors-1.2.0.tgz", + "integrity": "sha512-UW+IsFycygIo7bclP9h5ugkNH8EjCSgqyFB/yQ4Hqqa1OEYDtb0uFIkYE0b6+CjkgJYVM5UKI/pJPxjYe9EZlA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@humanwhocodes/momoa": "^2.0.2", + "chalk": "^4.1.2", + "jsonpointer": "^5.0.0", + "leven": "^3.1.0 < 4" + }, + "engines": { + "node": ">= 12.13.0" + }, + "peerDependencies": { + "ajv": "4.11.8 - 8" + } + }, + "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/better-ajv-errors/node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/better-opn": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.2.tgz", + "integrity": "sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==", + "dev": true, + "dependencies": { + "open": "^8.0.4" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/netlify-cli/node_modules/blueimp-md5": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/boxen": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", + "dev": true, + "dependencies": { + "ansi-align": "^3.0.1", + "camelcase": "^7.0.1", + "chalk": "^5.2.0", + "cli-boxes": "^3.0.0", + "string-width": "^5.1.2", + "type-fest": "^2.13.0", + "widest-line": "^4.0.1", + "wrap-ansi": "^8.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/boxen/node_modules/camelcase": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/boxen/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/boxen/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/boxen/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/boxen/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/netlify-cli/node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/netlify-cli/node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/bufrw": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bufrw/-/bufrw-1.3.0.tgz", + "integrity": "sha512-jzQnSbdJqhIltU9O5KUiTtljP9ccw2u5ix59McQy4pV2xGhVLhRZIndY8GIrgh5HjXa6+QJ9AQhOd2QWQizJFQ==", + "dev": true, + "dependencies": { + "ansi-color": "^0.2.1", + "error": "^7.0.0", + "hexer": "^1.5.0", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.10.x" + } + }, + "node_modules/netlify-cli/node_modules/builtin-modules": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/builtins": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", + "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/byline": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/cachedir": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/chalk": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.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" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/netlify-cli/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/citty": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.4.tgz", + "integrity": "sha512-Q3bK1huLxzQrvj7hImJ7Z1vKYJRPQCDnd0EjXfHMidcjecGOMuLrmuQmtWmFkuKLcMThlGh1yCKG8IEc6VeNXQ==", + "dev": true, + "dependencies": { + "consola": "^3.2.3" + } + }, + "node_modules/netlify-cli/node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/clean-deep": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", + "integrity": "sha512-Lo78NV5ItJL/jl+B5w0BycAisaieJGXK1qYi/9m4SjR8zbqmrUtO7Yhro40wEShGmmxs/aJLI/A+jNhdkXK8mw==", + "dev": true, + "dependencies": { + "lodash.isempty": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.transform": "^4.6.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/clean-stack/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dev": true, + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/cli-progress": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz", + "integrity": "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==", + "dev": true, + "dependencies": { + "string-width": "^4.2.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cli-truncate": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/clipboardy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-3.0.0.tgz", + "integrity": "sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==", + "dev": true, + "dependencies": { + "arch": "^2.2.0", + "execa": "^5.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/netlify-cli/node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "node_modules/netlify-cli/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/netlify-cli/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/color-string": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", + "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", + "dev": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/netlify-cli/node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/netlify-cli/node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/netlify-cli/node_modules/colors-option": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-3.0.0.tgz", + "integrity": "sha512-DP3FpjsiDDvnQC1OJBsdOJZPuy7r0o6sepY2T5M3L/d2nrE23O/ErFkEqyY3ngVL1ZhTj/H0pCMNObZGkEOaaQ==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "filter-obj": "^3.0.0", + "is-plain-obj": "^4.0.0", + "jest-validate": "^27.3.1" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/colors-option/node_modules/filter-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", + "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "dev": true, + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/netlify-cli/node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/comment-json": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", + "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", + "dev": true, + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/netlify-cli/node_modules/comment-json/node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/compress-commons": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-5.0.1.tgz", + "integrity": "sha512-MPh//1cERdLtqwO3pOFLeXtpuai0Y2WCd5AhtKxznqM7WtaMYaOEMSgn45d9D10sIHSfIKE603HlOp8OPGrvag==", + "dev": true, + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^5.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/concordance": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", + "dev": true, + "dependencies": { + "date-time": "^3.1.0", + "esutils": "^2.0.3", + "fast-diff": "^1.2.0", + "js-string-escape": "^1.0.1", + "lodash": "^4.17.15", + "md5-hex": "^3.0.1", + "semver": "^7.3.2", + "well-known-symbols": "^2.0.0" + }, + "engines": { + "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" + } + }, + "node_modules/netlify-cli/node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/config-chain/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/configstore": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", + "dev": true, + "dependencies": { + "dot-prop": "^6.0.1", + "graceful-fs": "^4.2.6", + "unique-string": "^3.0.0", + "write-file-atomic": "^3.0.3", + "xdg-basedir": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/yeoman/configstore?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/configstore/node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/configstore/node_modules/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, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/netlify-cli/node_modules/consola": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", + "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==", + "dev": true, + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/netlify-cli/node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/content-disposition/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/cookie-es": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.0.0.tgz", + "integrity": "sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/copy-template-dir/-/copy-template-dir-1.4.0.tgz", + "integrity": "sha512-xkXSJhvKz4MfLbVkZ7GyCaFo4ciB3uKI/HHzkGwj1eyTH5+7RTFxW5CE0irWAZgV5oFcO9hd6+NVXAtY9hlo7Q==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "graceful-fs": "^4.1.3", + "maxstache": "^1.0.0", + "maxstache-stream": "^1.0.0", + "mkdirp": "^0.5.1", + "noop2": "^2.0.0", + "pump": "^1.0.0", + "readdirp": "^2.0.0", + "run-parallel": "^1.1.4" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/cp-file": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.10", + "nested-error-stacks": "^2.1.1", + "p-event": "^5.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cpy": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", + "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", + "dev": true, + "dependencies": { + "arrify": "^3.0.0", + "cp-file": "^9.1.0", + "globby": "^13.1.1", + "junk": "^4.0.0", + "micromatch": "^4.0.4", + "nested-error-stacks": "^2.1.0", + "p-filter": "^3.0.0", + "p-map": "^5.3.0" + }, + "engines": { + "node": "^12.20.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cpy/node_modules/cp-file": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", + "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "nested-error-stacks": "^2.0.0", + "p-event": "^4.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cpy/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cpy/node_modules/p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "dev": true, + "dependencies": { + "p-timeout": "^3.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cpy/node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "dev": true, + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/cpy/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/netlify-cli/node_modules/crc32-stream": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-5.0.0.tgz", + "integrity": "sha512-B0EPa1UK+qnpBZpG+7FgPCu0J2ETLpXq09o9BkLkEAhdB6Z61Qo4pJ3JYu0c+Qi+/SAL7QThqnzS06pmSSyZaw==", + "dev": true, + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/cron-parser": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.8.1.tgz", + "integrity": "sha512-jbokKWGcyU4gl6jAfX97E1gDpY12DJ1cLJZmoDzaAln/shZ+S3KBFBuA2Q6WeUN4gJf/8klnV1EfvhA2lK5IRQ==", + "dev": true, + "dependencies": { + "luxon": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/cross-spawn/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/netlify-cli/node_modules/css-select/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/css-select/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/css-select/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/css-select/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/netlify-cli/node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/netlify-cli/node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", + "dev": true, + "dependencies": { + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/netlify-cli/node_modules/date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "dependencies": { + "time-zone": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/decache": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.2.tgz", + "integrity": "sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==", + "dev": true, + "dependencies": { + "callsite": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "dependencies": { + "clone": "^1.0.2" + } + }, + "node_modules/netlify-cli/node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/defu": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.3.tgz", + "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/netlify-cli/node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/destr": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.2.tgz", + "integrity": "sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/netlify-cli/node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/detective-amd": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.1.tgz", + "integrity": "sha512-e7n0E0Wte78U9lcpl3hsTh1ZJ+zp/rgEbdbzGLgTowSbbSemuHnM8olp4KHMF1eCaurrCE50IU9VkoV13ezK4A==", + "dev": true, + "dependencies": { + "ast-module-types": "^5.0.0", + "escodegen": "^2.0.0", + "get-amd-module-type": "^5.0.0", + "node-source-walk": "^6.0.0" + }, + "bin": { + "detective-amd": "bin/cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/detective-cjs": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-5.0.1.tgz", + "integrity": "sha512-6nTvAZtpomyz/2pmEmGX1sXNjaqgMplhQkskq2MLrar0ZAIkHMrDhLXkRiK2mvbu9wSWr0V5/IfiTrZqAQMrmQ==", + "dev": true, + "dependencies": { + "ast-module-types": "^5.0.0", + "node-source-walk": "^6.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/detective-es6": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-4.0.1.tgz", + "integrity": "sha512-k3Z5tB4LQ8UVHkuMrFOlvb3GgFWdJ9NqAa2YLUU/jTaWJIm+JJnEh4PsMc+6dfT223Y8ACKOaC0qcj7diIhBKw==", + "dev": true, + "dependencies": { + "node-source-walk": "^6.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/detective-postcss": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", + "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", + "dev": true, + "dependencies": { + "is-url": "^1.2.4", + "postcss": "^8.4.23", + "postcss-values-parser": "^6.0.2" + }, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/detective-sass": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-5.0.3.tgz", + "integrity": "sha512-YsYT2WuA8YIafp2RVF5CEfGhhyIVdPzlwQgxSjK+TUm3JoHP+Tcorbk3SfG0cNZ7D7+cYWa0ZBcvOaR0O8+LlA==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^6.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/detective-scss": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-4.0.3.tgz", + "integrity": "sha512-VYI6cHcD0fLokwqqPFFtDQhhSnlFWvU614J42eY6G0s8c+MBhi9QAWycLwIOGxlmD8I/XvGSOUV1kIDhJ70ZPg==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^6.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/detective-stylus": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-4.0.0.tgz", + "integrity": "sha512-TfPotjhszKLgFBzBhTOxNHDsutIxx9GTWjrL5Wh7Qx/ydxKhwUrlSFeLIn+ZaHPF+h0siVBkAQSuy6CADyTxgQ==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/detective-typescript": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.0.1.tgz", + "integrity": "sha512-pVCuFWdEAyHI16zO3NBWSAULV8pevSkX3gwK8w3y9RrBGUrig6wDvwv6vUpnu+HfOr0MDmjMkmJGNWaTb6+HkA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "^5.59.2", + "ast-module-types": "^5.0.0", + "node-source-walk": "^6.0.0", + "typescript": "^5.0.4" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/netlify-cli/node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/netlify-cli/node_modules/dot-prop": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz", + "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==", + "dev": true, + "dependencies": { + "type-fest": "^2.11.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/dot-prop/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/netlify-cli/node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/netlify-cli/node_modules/env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/error": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", + "integrity": "sha512-UtVv4l5MhijsYUxPJo4390gzfZvAnTHreNnDjnTZaKIiZ/SemXxAhBkYSKtWa5RtBXbLP8tMgn/n0RUa/H7jXw==", + "dev": true, + "dependencies": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/netlify-cli/node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "dev": true, + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/netlify-cli/node_modules/es-module-lexer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.3.tgz", + "integrity": "sha512-iC67eXHToclrlVhQfpRawDiF8D8sQxNxmbqw5oebegOaJkyx/w9C/k57/5e6yJR2zIByRt9OXdqX50DV2t6ZKw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/es6-promisify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/escape-goat": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", + "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/netlify-cli/node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/netlify-cli/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/netlify-cli/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/execa/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/express-logging": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/express-logging/-/express-logging-1.1.1.tgz", + "integrity": "sha512-1KboYwxxCG5kwkJHR5LjFDTD1Mgl8n4PIMcCuhhd/1OqaxlC68P3QKbvvAbZVUtVgtlxEdTgSUwf6yxwzRCuuA==", + "dev": true, + "dependencies": { + "on-headers": "^1.0.0" + }, + "engines": { + "node": ">= 0.10.26" + } + }, + "node_modules/netlify-cli/node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/express/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/express/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/express/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/ext-list": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", + "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==", + "dev": true, + "dependencies": { + "mime-db": "^1.28.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/ext-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz", + "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==", + "dev": true, + "dependencies": { + "ext-list": "^2.0.0", + "sort-keys-length": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dev": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/extglob/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/netlify-cli/node_modules/extract-zip/node_modules/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, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/fast-content-type-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.0.0.tgz", + "integrity": "sha512-Xbc4XcysUXcsP5aHUU7Nq3OwvHq97C+WnbkeIefpeYLX+ryzFJlU6OStFJhs6Ol0LkUGpcK+wL0JwfM+FCU5IA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-equals": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-3.0.3.tgz", + "integrity": "sha512-NCe8qxnZFARSHGztGMZOO/PC1qa5MIFB5Hp66WdzbCRAz8U8US3bx1UTgLS49efBQPcUtO9gf5oVEY8o7y/7Kg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-fifo": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.0.tgz", + "integrity": "sha512-IgfweLvEpwyA4WgiQe9Nx6VV2QkML2NkvZnk1oKnIzXgXdWxuhF7zw4DvLTPZJn6PIUneiAXPF24QmoEqHTjyw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "peer": true + }, + "node_modules/netlify-cli/node_modules/fast-json-stringify": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.7.0.tgz", + "integrity": "sha512-sBVPTgnAZseLu1Qgj6lUbQ0HfjFhZWXAmpZ5AaSGkyLh5gAXBga/uPJjQPHpDFjC9adWIpdOcCLSDTgrZ7snoQ==", + "dev": true, + "dependencies": { + "@fastify/deepmerge": "^1.0.0", + "ajv": "^8.10.0", + "ajv-formats": "^2.1.1", + "fast-deep-equal": "^3.1.3", + "fast-uri": "^2.1.0", + "rfdc": "^1.2.0" + } + }, + "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-querystring": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", + "integrity": "sha512-3LQi62IhQoDlmt4ULCYmh17vRO2EtS7hTSsG4WwoKWgV7GLMKBOecEh+aiavASnLx8I2y89OD33AGLo0ccRhzA==", + "dev": true, + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/fast-redact": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.2.tgz", + "integrity": "sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fast-uri": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.2.0.tgz", + "integrity": "sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/netlify-cli/node_modules/fastify": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.17.0.tgz", + "integrity": "sha512-tzuY1tgWJo2Y6qEKwmLhFvACUmr68Io2pqP/sDKU71KRM6A6R3DrCDqLGqANbeLZcKUfdfY58ut35CGqemcTgg==", + "dev": true, + "dependencies": { + "@fastify/ajv-compiler": "^3.5.0", + "@fastify/error": "^3.0.0", + "@fastify/fast-json-stringify-compiler": "^4.3.0", + "abstract-logging": "^2.0.1", + "avvio": "^8.2.0", + "fast-content-type-parse": "^1.0.0", + "fast-json-stringify": "^5.7.0", + "find-my-way": "^7.6.0", + "light-my-request": "^5.6.1", + "pino": "^8.5.0", + "process-warning": "^2.0.0", + "proxy-addr": "^2.0.7", + "rfdc": "^1.3.0", + "secure-json-parse": "^2.5.0", + "semver": "^7.3.7", + "tiny-lru": "^11.0.1" + } + }, + "node_modules/netlify-cli/node_modules/fastify-plugin": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-4.4.0.tgz", + "integrity": "sha512-ovwFQG2qNy3jcCROiWpr94Hs0le+c7N/3t7m9aVwbFhkxcR/esp2xu25dP8e617HpQdmeDv+gFX4zagdUhDByw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/pino": { + "version": "8.16.1", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz", + "integrity": "sha512-3bKsVhBmgPjGV9pyn4fO/8RtoVDR8ssW1ev819FsRXlRNgW8gR/9Kx+gCK4UPWd4JjrRDLWpzd/pb1AyWm3MGA==", + "dev": true, + "dependencies": { + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.1.1", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "v1.1.0", + "pino-std-serializers": "^6.0.0", + "process-warning": "^2.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^3.7.0", + "thread-stream": "^2.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-abstract-transport": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", + "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", + "dev": true, + "dependencies": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-std-serializers": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/process-warning": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", + "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/readable-stream": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", + "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/sonic-boom": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.7.0.tgz", + "integrity": "sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==", + "dev": true, + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/netlify-cli/node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/netlify-cli/node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/netlify-cli/node_modules/fdir": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.0.1.tgz", + "integrity": "sha512-bdrUUb0eYQrPRlaAtlSRoLs7sp6yKEwbMQuUgwvi/14TnaqhM/deSZUrC5ic+yjm5nEPPWE61oWpTTxQFQMmLA==", + "dev": true, + "peerDependencies": { + "picomatch": "2.x" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/fecha": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", + "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/fetch-node-website/-/fetch-node-website-7.3.0.tgz", + "integrity": "sha512-/wayUHbdVUWrD72aqRNNrr6+MHnCkumZgNugN0RfiWJpbNJUdAkMk4Z18MGayGZVVqYXR1RWrV+bIFEt5HuBZg==", + "dev": true, + "dependencies": { + "cli-progress": "^3.11.2", + "colors-option": "^4.4.0", + "figures": "^5.0.0", + "got": "^12.3.1", + "is-plain-obj": "^4.1.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/colors-option": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-4.5.0.tgz", + "integrity": "sha512-Soe5lerRg3erMRgYC0EC696/8dMCGpBzcQchFfi55Yrkja8F+P7cUt0LVTIg7u5ob5BexLZ/F1kO+ejmv+nq8w==", + "dev": true, + "dependencies": { + "chalk": "^5.0.1", + "is-plain-obj": "^4.1.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/http2-wrapper": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/file-type": { + "version": "18.5.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-18.5.0.tgz", + "integrity": "sha512-yvpl5U868+V6PqXHMmsESpg6unQ5GfnPssl4dxdJudBrr9qy7Fddt7EVX1VLlddFfe8Gj9N7goCZH22FXuSQXQ==", + "dev": true, + "dependencies": { + "readable-web-to-node-stream": "^3.0.2", + "strtok3": "^7.0.0", + "token-types": "^5.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/filter-obj": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", + "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/find-my-way": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.2.tgz", + "integrity": "sha512-0OjHn1b1nCX3eVbm9ByeEHiscPYiHLfhei1wOUU9qffQkk98wE0Lo8VrVYfSGMgnSnDh86DxedduAnBf4nwUEw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^2.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/find-up/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/flush-write-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-2.0.0.tgz", + "integrity": "sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, + "node_modules/netlify-cli/node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/folder-walker": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/folder-walker/-/folder-walker-3.2.0.tgz", + "integrity": "sha512-VjAQdSLsl6AkpZNyrQJfO7BXLo4chnStqb055bumZMbRUPpVuPN3a4ktsnRCmrFZjtMlYLkyXiR5rAs4WOpC4Q==", + "dev": true, + "dependencies": { + "from2": "^2.1.0" + } + }, + "node_modules/netlify-cli/node_modules/follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/netlify-cli/node_modules/form-data-encoder": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.3.tgz", + "integrity": "sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==", + "dev": true, + "engines": { + "node": ">= 14.17" + } + }, + "node_modules/netlify-cli/node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/from2-array": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/from2-array/-/from2-array-0.0.4.tgz", + "integrity": "sha512-0G0cAp7sYLobH7ALsr835x98PU/YeVF7wlwxdWbCUaea7wsa7lJfKZUAo6p2YZGZ8F94luCuqHZS3JtFER6uPg==", + "dev": true, + "dependencies": { + "from2": "^2.0.3" + } + }, + "node_modules/netlify-cli/node_modules/from2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/netlify-cli/node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/fuzzy": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz", + "integrity": "sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/netlify-cli/node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/gauge/node_modules/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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/get-amd-module-type": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-5.0.1.tgz", + "integrity": "sha512-jb65zDeHyDjFR1loOVk0HQGM5WNwoGB8aLWy3LKCieMKol0/ProHkhO2X1JxojuN10vbz1qNn09MJ7tNp7qMzw==", + "dev": true, + "dependencies": { + "ast-module-types": "^5.0.0", + "node-source-walk": "^6.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/netlify-cli/node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/get-package-name": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/get-package-name/-/get-package-name-2.2.0.tgz", + "integrity": "sha512-LmCKVxioe63Fy6KDAQ/mmCSOSSRUE/x4zdrMD+7dU8quF3bGpzvP8mOmq4Dgce3nzU9AgkVDotucNOOg7c27BQ==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/get-port": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/get-port-please": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.1.tgz", + "integrity": "sha512-3UBAyM3u4ZBVYDsxOQfJDxEa6XTbpBDrOjp4mf7ExFRt5BKs/QywQQiJsh2B+hxcZLSapWqCRvElUe8DnKcFHA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/gh-release-fetch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-4.0.3.tgz", + "integrity": "sha512-TOiP1nwLsH5shG85Yt6v6Kjq5JU/44jXyEpbcfPgmj3C829yeXIlx9nAEwQRaxtRF3SJinn2lz7XUkfG9W/U4g==", + "dev": true, + "dependencies": { + "@xhmikosr/downloader": "^13.0.0", + "node-fetch": "^3.3.1", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.18.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/gh-release-fetch/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/netlify-cli/node_modules/git-repo-info": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/git-repo-info/-/git-repo-info-2.1.1.tgz", + "integrity": "sha512-8aCohiDo4jwjOwma4FmYFd3i97urZulL8XL24nIPxuE+GZnfsAyy/g2Shqx6OjUiFKUXZM+Yy+KHnOmmA3FVcg==", + "dev": true, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/netlify-cli/node_modules/gitconfiglocal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-2.1.0.tgz", + "integrity": "sha512-qoerOEliJn3z+Zyn1HW2F6eoYJqKwS6MgC9cztTLUB/xLWX8gD/6T60pKn4+t/d6tP7JlybI7Z3z+I572CR/Vg==", + "dev": true, + "dependencies": { + "ini": "^1.3.2" + } + }, + "node_modules/netlify-cli/node_modules/gitconfiglocal/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/netlify-cli/node_modules/global-cache-dir": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global-cache-dir/-/global-cache-dir-4.4.0.tgz", + "integrity": "sha512-bk0gI6IbbphRjAaCJJn5H+T/CcEck5B3a5KBO2BXSDzjFSV+API17w8GA7YPJ6IXJiasW8M0VsEIig1PCHdfOQ==", + "dev": true, + "dependencies": { + "cachedir": "^2.3.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/netlify-cli/node_modules/global-cache-dir/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/gonzales-pe": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", + "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "gonzales": "bin/gonzales.js" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/netlify-cli/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/h3": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.8.2.tgz", + "integrity": "sha512-1Ca0orJJlCaiFY68BvzQtP2lKLk46kcLAxVM8JgYbtm2cUg6IY7pjpYgWMwUvDO9QI30N5JAukOKoT8KD3Q0PQ==", + "dev": true, + "dependencies": { + "cookie-es": "^1.0.0", + "defu": "^6.1.2", + "destr": "^2.0.1", + "iron-webcrypto": "^0.10.1", + "radix3": "^1.1.0", + "ufo": "^1.3.0", + "uncrypto": "^0.1.3", + "unenv": "^1.7.4" + } + }, + "node_modules/netlify-cli/node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "dev": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/has-yarn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", + "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/hasbin": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz", + "integrity": "sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==", + "dev": true, + "dependencies": { + "async": "~1.5" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/hasbin/node_modules/async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/hasha/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/hasha/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/hexer": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/hexer/-/hexer-1.5.0.tgz", + "integrity": "sha512-dyrPC8KzBzUJ19QTIo1gXNqIISRXQ0NwteW6OeQHRN4ZuZeHkdODfj0zHBdOlHbRY8GqbqK57C9oWSvQZizFsg==", + "dev": true, + "dependencies": { + "ansi-color": "^0.2.1", + "minimist": "^1.1.0", + "process": "^0.10.0", + "xtend": "^4.0.0" + }, + "bin": { + "hexer": "cli.js" + }, + "engines": { + "node": ">= 0.10.x" + } + }, + "node_modules/netlify-cli/node_modules/hexer/node_modules/process": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", + "integrity": "sha512-dyIett8dgGIZ/TXKUzeYExt7WA6ldDzys9vTDU/cCA9L17Ypme+KzS+NjQCjpn9xsvi/shbMC+yP/BcFMBz0NA==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/netlify-cli/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/hot-shots": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/hot-shots/-/hot-shots-10.0.0.tgz", + "integrity": "sha512-uy/uGpuJk7yuyiKRfZMBNkF1GAOX5O2ifO9rDCaX9jw8fu6eW9QeWC7WRPDI+O98frW1HQgV3+xwjWsZPECIzQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "unix-dgram": "2.x" + } + }, + "node_modules/netlify-cli/node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/http-errors/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/http-proxy-middleware": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "dev": true, + "dependencies": { + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/express": "^4.17.13" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/http-proxy-middleware/node_modules/is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/http-shutdown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/http-shutdown/-/http-shutdown-1.2.2.tgz", + "integrity": "sha512-S9wWkJ/VSY9/k4qcjG318bqJNruzE4HySUhFYknwmu6LBP97KLLfwNf+n4V1BHurvFNkSKLFnK/RsuUnRTf9Vw==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/netlify-cli/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/netlify-cli/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/netlify-cli/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/netlify-cli/node_modules/image-meta": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/image-meta/-/image-meta-0.2.0.tgz", + "integrity": "sha512-ZBGjl0ZMEMeOC3Ns0wUF/5UdUmr3qQhBSCniT0LxOgGGIRHiNFOkMtIHB7EOznRU47V2AxPgiVP+s+0/UCU0Hg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/netlify-cli/node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/netlify-cli/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-1.4.0.tgz", + "integrity": "sha512-qHgHyJmbULt4hI+kCmwX92MnSxDs/Yhdt4wPA30qnoa01OF6uTXV8yvH4hKXgdaTNmkZ9D01MHjqKYEuJN+ONw==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.1", + "chalk": "^4.0.0", + "figures": "^3.2.0", + "run-async": "^2.4.0", + "rxjs": "^6.6.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "inquirer": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/inquirer-autocomplete-prompt/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/inquirer/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/inspect-with-kind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/inspect-with-kind/-/inspect-with-kind-1.0.5.tgz", + "integrity": "sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + } + }, + "node_modules/netlify-cli/node_modules/ioredis": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", + "dev": true, + "dependencies": { + "@ioredis/commands": "^1.1.1", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.4", + "denque": "^2.1.0", + "lodash.defaults": "^4.2.0", + "lodash.isarguments": "^3.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/netlify-cli/node_modules/ipx": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ipx/-/ipx-2.0.1.tgz", + "integrity": "sha512-+EyZiVNosYr3hu3F5+5GripTBLjKmSPTvcy3YdT4zxlhqHQJ2gUopLGxpfv9Wd11YgeiPh53ysbtG+ZNIOVF4A==", + "dev": true, + "dependencies": { + "@fastify/accept-negotiator": "^1.1.0", + "citty": "^0.1.4", + "consola": "^3.2.3", + "defu": "^6.1.3", + "destr": "^2.0.2", + "etag": "^1.8.1", + "h3": "^1.8.2", + "image-meta": "^0.2.0", + "listhen": "^1.5.5", + "ofetch": "^1.3.3", + "pathe": "^1.1.1", + "sharp": "^0.32.6", + "svgo": "^3.0.2", + "ufo": "^1.3.1", + "unstorage": "^1.9.0", + "xss": "^1.0.14" + }, + "bin": { + "ipx": "bin/ipx.mjs" + } + }, + "node_modules/netlify-cli/node_modules/iron-webcrypto": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-0.10.1.tgz", + "integrity": "sha512-QGOS8MRMnj/UiOa+aMIgfyHcvkhqNUsUxb1XzskENvbo+rEfp6TOwqd1KPuDzXC4OnGHcMSVxDGRoilqB8ViqA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/brc-dd" + } + }, + "node_modules/netlify-cli/node_modules/is-accessor-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", + "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/netlify-cli/node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/is-builtin-module": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dev": true, + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/netlify-cli/node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/is-data-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", + "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/is-extendable/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-installed-globally/node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "dev": true, + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-npm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", + "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/is-url-superb": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", + "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/is-wsl/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/is-yarn-global": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", + "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/iserror": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz", + "integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/jaeger-client": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/jaeger-client/-/jaeger-client-3.19.0.tgz", + "integrity": "sha512-M0c7cKHmdyEUtjemnJyx/y9uX16XHocL46yQvyqDlPdvAcwPDbHrIbKjQdBqtiE4apQ/9dmr+ZLJYYPGnurgpw==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0", + "opentracing": "^0.14.4", + "thriftrw": "^3.5.0", + "uuid": "^8.3.2", + "xorshift": "^1.1.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/jaeger-client/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/netlify-cli/node_modules/jest-get-type": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", + "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/netlify-cli/node_modules/jest-validate": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz", + "integrity": "sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==", + "dev": true, + "dependencies": { + "@jest/types": "^27.5.1", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^27.5.1", + "leven": "^3.1.0", + "pretty-format": "^27.5.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/jest-validate/node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/jiti": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/netlify-cli/node_modules/js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/netlify-cli/node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "peer": true + }, + "node_modules/netlify-cli/node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/jsonwebtoken": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.1.tgz", + "integrity": "sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==", + "dev": true, + "dependencies": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/junk": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", + "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dev": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/netlify-cli/node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dev": true, + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/netlify-cli/node_modules/jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/keep-func-props": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/keep-func-props/-/keep-func-props-4.0.1.tgz", + "integrity": "sha512-87ftOIICfdww3SxR5P1veq3ThBNyRPG0JGL//oaR08v0k2yTicEIHd7s0GqSJfQvlb+ybC3GiDepOweo0LDhvw==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/netlify-cli/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lambda-local": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/lambda-local/-/lambda-local-2.1.2.tgz", + "integrity": "sha512-nGTJn2JxZWcLGpNwXFmXC7UEXL7QCLieQWDiXs46vIv9y/gSPm/uHygEMCaym+HIziniAw0XIm+1VTrXCvG1Zw==", + "dev": true, + "dependencies": { + "commander": "^10.0.1", + "dotenv": "^16.3.1", + "winston": "^3.10.0" + }, + "bin": { + "lambda-local": "build/cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/lambda-local/node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/netlify-cli/node_modules/lambda-local/node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/lambda-local/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/lambda-local/node_modules/winston": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", + "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", + "dev": true, + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.4.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.5.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/latest-version": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", + "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", + "dev": true, + "dependencies": { + "package-json": "^8.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/netlify-cli/node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/light-my-request": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.8.0.tgz", + "integrity": "sha512-4BtD5C+VmyTpzlDPCZbsatZMJVgUIciSOwYhJDCbLffPZ35KoDkDj4zubLeHDEb35b4kkPeEv5imbh+RJxK/Pg==", + "dev": true, + "dependencies": { + "cookie": "^0.5.0", + "process-warning": "^2.0.0", + "set-cookie-parser": "^2.4.1" + } + }, + "node_modules/netlify-cli/node_modules/light-my-request/node_modules/process-warning": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", + "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/listhen": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.5.5.tgz", + "integrity": "sha512-LXe8Xlyh3gnxdv4tSjTjscD1vpr/2PRpzq8YIaMJgyKzRG8wdISlWVWnGThJfHnlJ6hmLt2wq1yeeix0TEbuoA==", + "dev": true, + "dependencies": { + "@parcel/watcher": "^2.3.0", + "@parcel/watcher-wasm": "2.3.0", + "citty": "^0.1.4", + "clipboardy": "^3.0.0", + "consola": "^3.2.3", + "defu": "^6.1.2", + "get-port-please": "^3.1.1", + "h3": "^1.8.1", + "http-shutdown": "^1.2.2", + "jiti": "^1.20.0", + "mlly": "^1.4.2", + "node-forge": "^1.3.1", + "pathe": "^1.1.1", + "std-env": "^3.4.3", + "ufo": "^1.3.0", + "untun": "^0.1.2", + "uqr": "^0.1.2" + }, + "bin": { + "listen": "bin/listhen.mjs", + "listhen": "bin/listhen.mjs" + } + }, + "node_modules/netlify-cli/node_modules/listr2": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", + "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", + "dev": true, + "dependencies": { + "cli-truncate": "^3.1.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^5.0.1", + "rfdc": "^1.3.0", + "wrap-ansi": "^8.1.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/locate-path/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/locate-path/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/locate-path/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.deburr": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", + "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.isempty": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.transform": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", + "integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/log-process-errors": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/log-process-errors/-/log-process-errors-8.0.0.tgz", + "integrity": "sha512-+SNGqNC1gCMJfhwYzAHr/YgNT/ZJc+V2nCkvtPnjrENMeCe+B/jgShBW0lmWoh6uVV2edFAPc/IUOkDdsjTbTg==", + "dev": true, + "dependencies": { + "colors-option": "^3.0.0", + "figures": "^4.0.0", + "filter-obj": "^3.0.0", + "jest-validate": "^27.4.2", + "map-obj": "^5.0.0", + "moize": "^6.1.0", + "semver": "^7.3.5" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/figures": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", + "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/filter-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", + "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-process-errors/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "dev": true, + "dependencies": { + "ansi-escapes": "^5.0.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^5.0.0", + "strip-ansi": "^7.0.1", + "wrap-ansi": "^8.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/ansi-escapes": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/logform": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", + "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", + "dev": true, + "dependencies": { + "@colors/colors": "1.5.0", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/luxon": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", + "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/macos-release": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.0.1.tgz", + "integrity": "sha512-3l6OrhdDg2H2SigtuN3jBh+5dRJRWxNKuJTPBbGeNJTsmt/pj9PO25wYaNb05NuNmAsl435j4rDP6rgNXz7s7g==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/netlify-cli/node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/maxstache": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/maxstache/-/maxstache-1.0.7.tgz", + "integrity": "sha1-IjHVGAung9Xs/DHEX+2seuQnaYQ=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/maxstache-stream": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/maxstache-stream/-/maxstache-stream-1.0.4.tgz", + "integrity": "sha1-nH9cq35f3S2Q2oYUO06WMeoygEA=", + "dev": true, + "dependencies": { + "maxstache": "^1.0.0", + "pump": "^1.0.0", + "split2": "^1.0.0", + "through2": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/split2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.1.1.tgz", + "integrity": "sha512-cfurE2q8LamExY+lJ9Ex3ZfBwqAPduzOKVscPDXNCLLMvyaeD3DTz1yk7fVIs6Chco+12XeD0BB6HEoYzPYbXA==", + "dev": true, + "dependencies": { + "through2": "~2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/maxstache-stream/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/netlify-cli/node_modules/md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "dependencies": { + "blueimp-md5": "^2.10.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/merge-options": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "dev": true, + "dependencies": { + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/merge-options/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/micro-api-client": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/micro-api-client/-/micro-api-client-3.3.0.tgz", + "integrity": "sha512-y0y6CUB9RLVsy3kfgayU28746QrNMpSm9O/AYGNsBgOkJr/X/Jk0VLGoO8Ude7Bpa8adywzF+MzXNZRFRsNPhg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/micro-memoize": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/micro-memoize/-/micro-memoize-4.0.11.tgz", + "integrity": "sha512-CjxsaYe4j43df32DtzzNCwanPqZjZDwuQAZilsCYpa2ZVtSPDjHXbTlR4gsEZRyO9/twHs0b7HLjvy/sowl7sA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/netlify-cli/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "mime-db": "1.51.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/netlify-cli/node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/mlly": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", + "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0", + "pathe": "^1.1.1", + "pkg-types": "^1.0.3", + "ufo": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/module-definition": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-5.0.1.tgz", + "integrity": "sha512-kvw3B4G19IXk+BOXnYq/D/VeO9qfHaapMeuS7w7sNUqmGaA6hywdFHMi+VWeR9wUScXM7XjoryTffCZ5B0/8IA==", + "dev": true, + "dependencies": { + "ast-module-types": "^5.0.0", + "node-source-walk": "^6.0.1" + }, + "bin": { + "module-definition": "bin/cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/module-details-from-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", + "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/moize": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/moize/-/moize-6.1.3.tgz", + "integrity": "sha512-Cn+1T5Ypieeo46fn8X98V2gHj2VSRohVPjvT8BRvNANJJC3UOeege/G84xA/3S9c5qA4p9jOdSB1jfhumwe8qw==", + "dev": true, + "dependencies": { + "fast-equals": "^3.0.1", + "micro-memoize": "^4.0.11" + } + }, + "node_modules/netlify-cli/node_modules/move-file": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/move-file/-/move-file-3.0.0.tgz", + "integrity": "sha512-v6u4XjX3MFW6Jo1V/YfbhC7eiGSgvYPJ/NM+aGtTtB9/Y6IYj7YViaHu6dkgDsZFB7MbnAoSI5+Z26XZXnP0vg==", + "dev": true, + "dependencies": { + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/move-file/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/multiparty": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.2.3.tgz", + "integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==", + "dev": true, + "dependencies": { + "http-errors": "~1.8.1", + "safe-buffer": "5.2.1", + "uid-safe": "2.1.5" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/netlify-cli/node_modules/multiparty/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/nan": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "dev": true, + "optional": true + }, + "node_modules/netlify-cli/node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/netlify-cli/node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/netlify": { + "version": "13.1.11", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.11.tgz", + "integrity": "sha512-exrD6cqwo5avDNtU7YT9iuN0+yoW+aaEUxvr/39oP36wZRKreoPm6KNVisTR9d4lXrPeUG8XI+rERuLhwMQmdw==", + "dev": true, + "dependencies": { + "@netlify/open-api": "^2.26.0", + "lodash-es": "^4.17.21", + "micro-api-client": "^3.3.0", + "node-fetch": "^3.0.0", + "omit.js": "^2.0.2", + "p-wait-for": "^4.0.0", + "qs": "^6.9.6" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/netlify-headers-parser": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-7.1.2.tgz", + "integrity": "sha512-DfoboA8PrcLXMan3jIVyLsQtKS+nepKDx6WwZKk5EQDMr2AJoBPCtSHTOLuABzkde1UXdOITf3snmcAmzlNLqw==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "fast-safe-stringify": "^2.0.7", + "is-plain-obj": "^4.0.0", + "map-obj": "^5.0.0", + "path-exists": "^5.0.0", + "toml": "^3.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/netlify-headers-parser/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/netlify-redirect-parser": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.0.tgz", + "integrity": "sha512-3Mi7sMH7XXZhjvXx/5RtJ/rU/E6zKkE4etcYQbEu8B3r872D0opoYyGdPW/MvaYQyVdfg23XEFaEI4zzQTupaw==", + "dev": true, + "dependencies": { + "fast-safe-stringify": "^2.1.1", + "filter-obj": "^5.0.0", + "is-plain-obj": "^4.0.0", + "path-exists": "^5.0.0", + "toml": "^3.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/netlify-redirect-parser/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/netlify-redirector": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.5.0.tgz", + "integrity": "sha512-4zdzIP+6muqPCuE8avnrgDJ6KW/2+UpHTRcTbMXCIRxiRmyrX+IZ4WSJGZdHPWF3WmQpXpy603XxecZ9iygN7w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/netlify/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/netlify-cli/node_modules/netlify/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/netlify/node_modules/p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "dev": true, + "dependencies": { + "p-timeout": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/node-abi": { + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", + "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", + "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/node-addon-api": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", + "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/netlify-cli/node_modules/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/node-fetch-native": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.4.1.tgz", + "integrity": "sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "dev": true, + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/netlify-cli/node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "dev": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/netlify-cli/node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/node-source-walk": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.1.tgz", + "integrity": "sha512-QUlkJYzrNewUCp4c7CCPN8Mh8c+pwNs23JsQfHKUwIkCxYa6c0AFLuUJIZxU6BdnarfytPSGKm1YMAz06hj9cw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.21.8" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/node-stream-zip": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", + "integrity": "sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==", + "dev": true, + "engines": { + "node": ">=0.12.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/antelle" + } + }, + "node_modules/netlify-cli/node_modules/node-version-alias": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/node-version-alias/-/node-version-alias-3.4.1.tgz", + "integrity": "sha512-Kf3L9spAL6lEHMPyqpwHSTNG3LPkOXBfSUnBMG/YE2TdoC8Qoqf0+qg01nr6K9MFQEcXtWUyTQzLJByRixSBsA==", + "dev": true, + "dependencies": { + "all-node-versions": "^11.3.0", + "filter-obj": "^5.1.0", + "is-plain-obj": "^4.1.0", + "normalize-node-version": "^12.4.0", + "path-exists": "^5.0.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/netlify-cli/node_modules/node-version-alias/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/noop2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/noop2/-/noop2-2.0.0.tgz", + "integrity": "sha1-S2NgFemIK1R4PAK0EvaZ2MXNCls=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/normalize-node-version": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/normalize-node-version/-/normalize-node-version-12.4.0.tgz", + "integrity": "sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==", + "dev": true, + "dependencies": { + "all-node-versions": "^11.3.0", + "filter-obj": "^5.1.0", + "semver": "^7.3.7" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/netlify-cli/node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/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, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/npm-run-path/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dev": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/ofetch": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", + "integrity": "sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==", + "dev": true, + "dependencies": { + "destr": "^2.0.1", + "node-fetch-native": "^1.4.0", + "ufo": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/omit.js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-2.0.2.tgz", + "integrity": "sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/netlify-cli/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/netlify-cli/node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "dev": true, + "dependencies": { + "fn.name": "1.x.x" + } + }, + "node_modules/netlify-cli/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/onetime/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/open/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/opentracing": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.7.tgz", + "integrity": "sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/ora": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", + "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", + "dev": true, + "dependencies": { + "chalk": "^5.0.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.1", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/ora/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/os-name": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", + "integrity": "sha512-0EQpaHUHq7olp2/YFUr+0vZi9tMpDTblHGz+Ch5RntKxiRXOAY0JOz1UlxhSjMSksHvkm13eD6elJj3M8Ht/kw==", + "dev": true, + "dependencies": { + "macos-release": "^3.0.1", + "windows-release": "^5.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/p-event": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", + "dev": true, + "dependencies": { + "p-timeout": "^5.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-event/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-every": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-every/-/p-every-2.0.0.tgz", + "integrity": "sha512-MCz9DqD5opPC48Zsd+BHm56O/HfhYIQQtupfDzhXoVgQdg/Ux4F8/JcdRuQ+arq7zD5fB6zP3axbH3d9Nr8dlw==", + "dev": true, + "dependencies": { + "p-map": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/p-every/node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "dependencies": { + "p-map": "^5.1.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-reduce": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-retry": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", + "dev": true, + "dependencies": { + "@types/retry": "0.12.1", + "retry": "^0.13.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-wait-for": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-5.0.2.tgz", + "integrity": "sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==", + "dev": true, + "dependencies": { + "p-timeout": "^6.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/p-wait-for/node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/package-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", + "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", + "dev": true, + "dependencies": { + "got": "^12.1.0", + "registry-auth-token": "^5.0.1", + "registry-url": "^6.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/http2-wrapper": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/netlify-cli/node_modules/package-json/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "dependencies": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "node_modules/netlify-cli/node_modules/parallel-transform/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true, + "bin": { + "parse-github-url": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/parse-gitignore": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-gitignore/-/parse-gitignore-2.0.0.tgz", + "integrity": "sha512-RmVuCHWsfu0QPNW+mraxh/xjQVw/lhUCUru8Zni3Ctq3AoMhpDTq0OVdKS6iesd6Kqb7viCV3isAL43dciOSog==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/parse-ms": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", + "integrity": "sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/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=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/pathe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/peek-readable": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/netlify-cli/node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/netlify-cli/node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "node_modules/netlify-cli/node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/netlify-cli/node_modules/postcss-values-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", + "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", + "dev": true, + "dependencies": { + "color-name": "^1.1.4", + "is-url-superb": "^4.0.0", + "quote-unquote": "^1.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "postcss": "^8.2.9" + } + }, + "node_modules/netlify-cli/node_modules/postcss-values-parser/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/netlify-cli/node_modules/prebuild-install/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/precinct": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.2.tgz", + "integrity": "sha512-UuhB1q0nEFf80iMGcs7IoT0o1GnNFWT4CjZjcMsHDXAIsW/aiLovOSbeMJ2Ejg6raRsplsriZZkoBUh0h/IHlw==", + "dev": true, + "dependencies": { + "@dependents/detective-less": "^4.0.0", + "commander": "^10.0.1", + "detective-amd": "^5.0.1", + "detective-cjs": "^5.0.1", + "detective-es6": "^4.0.0", + "detective-postcss": "^6.1.3", + "detective-sass": "^5.0.0", + "detective-scss": "^4.0.0", + "detective-stylus": "^4.0.0", + "detective-typescript": "^11.0.1", + "module-definition": "^5.0.0", + "node-source-walk": "^6.0.1" + }, + "bin": { + "precinct": "bin/cli.js" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/precond": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/netlify-cli/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/pretty-ms": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-8.0.0.tgz", + "integrity": "sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==", + "dev": true, + "dependencies": { + "parse-ms": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/prettyjson": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.5.tgz", + "integrity": "sha512-rksPWtoZb2ZpT5OVgtmy0KHVM+Dca3iVwWY9ifwhcexfjebtgjg3wmrUt9PvJ59XIYBcknQeYHD8IAnVlh9lAw==", + "dev": true, + "dependencies": { + "colors": "1.4.0", + "minimist": "^1.2.0" + }, + "bin": { + "prettyjson": "bin/prettyjson" + } + }, + "node_modules/netlify-cli/node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/netlify-cli/node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/protobufjs": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz", + "integrity": "sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/netlify-cli/node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/ps-list": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-8.1.0.tgz", + "integrity": "sha512-NoGBqJe7Ou3kfQxEvDzDyKGAyEgwIuD3YrfXinjcCmBRv0hTld0Xb71hrXvtsNPj7HSFATfemvzB8PPJtq6Yag==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/netlify-cli/node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/pupa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", + "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", + "dev": true, + "dependencies": { + "escape-goat": "^4.0.0" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/quote-unquote": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", + "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/radix3": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.0.tgz", + "integrity": "sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/raw-body/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/raw-body/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/netlify-cli/node_modules/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/read-pkg-up": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", + "dev": true, + "dependencies": { + "find-up": "^6.3.0", + "read-pkg": "^7.1.0", + "type-fest": "^2.5.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/netlify-cli/node_modules/readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dev": true, + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/netlify-cli/node_modules/readdir-glob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", + "dev": true, + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/netlify-cli/node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/readdir-glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/netlify-cli/node_modules/real-require": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "dev": true, + "engines": { + "node": ">= 12.13.0" + } + }, + "node_modules/netlify-cli/node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "dev": true, + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/regex-not/node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/netlify-cli/node_modules/regexp-tree": { + "version": "0.1.24", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz", + "integrity": "sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==", + "dev": true, + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/netlify-cli/node_modules/registry-auth-token": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", + "dev": true, + "dependencies": { + "@pnpm/npm-conf": "^2.1.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/registry-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", + "dev": true, + "dependencies": { + "rc": "1.2.8" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/netlify-cli/node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/require-in-the-middle": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", + "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "module-details-from-path": "^1.0.3", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/netlify-cli/node_modules/require-in-the-middle/node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/require-package-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", + "integrity": "sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/netlify-cli/node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dev": true, + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/restore-cursor/node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/netlify-cli/node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/netlify-cli/node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/rfdc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/netlify-cli/node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/netlify-cli/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "ret": "~0.2.0" + } + }, + "node_modules/netlify-cli/node_modules/safe-regex2/node_modules/ret": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", + "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/safe-stable-stringify": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", + "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/secure-json-parse": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.6.0.tgz", + "integrity": "sha512-B9osKohb6L+EZ6Kve3wHKfsAClzOC/iISA2vSuCe5Jx5NAKiwitfxx8ZKYapHXr0sYRj7UZInT7pLb3rp2Yx6A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/seek-bzip": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", + "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", + "dev": true, + "dependencies": { + "commander": "^2.8.1" + }, + "bin": { + "seek-bunzip": "bin/seek-bunzip", + "seek-table": "bin/seek-bzip-table" + } + }, + "node_modules/netlify-cli/node_modules/seek-bzip/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/semver-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", + "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/send/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/send/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dev": true, + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/netlify-cli/node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/set-cookie-parser": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz", + "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/set-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/set-value/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/sharp": { + "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.4", + "simple-get": "^4.0.1", + "tar-fs": "^3.0.4", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/netlify-cli/node_modules/sharp/node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/netlify-cli/node_modules/sharp/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/sharp/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/sharp/node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/netlify-cli/node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==", + "dev": true, + "dependencies": { + "is-plain-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/sort-keys-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz", + "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", + "dev": true, + "dependencies": { + "sort-keys": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/sort-keys/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/netlify-cli/node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "dev": true + }, + "node_modules/netlify-cli/node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/netlify-cli/node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/netlify-cli/node_modules/spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/stack-generator": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", + "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", + "dev": true, + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/netlify-cli/node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/netlify-cli/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/std-env": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", + "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/streamx": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", + "integrity": "sha512-HcxY6ncGjjklGs1xsP1aR71INYcsXFJet5CU1CHqihQ2J5nOsbd4OjgjHO42w/4QNv9gZb3BueV+Vxok5pLEXg==", + "dev": true, + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/netlify-cli/node_modules/string-template": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/string-width/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/string-width/node_modules/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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/strip-ansi-control-characters": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi-control-characters/-/strip-ansi-control-characters-2.0.0.tgz", + "integrity": "sha512-Q0/k5orrVGeaOlIOUn1gybGU0IcAbgHQT1faLo5hik4DqClKVSaka5xOhNNoRgtfztHVxCYxi7j71mrWom0bIw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/strip-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-3.0.0.tgz", + "integrity": "sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ==", + "dev": true, + "dependencies": { + "inspect-with-kind": "^1.0.5", + "is-plain-obj": "^1.1.0" + } + }, + "node_modules/netlify-cli/node_modules/strip-dirs/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/strtok3": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", + "dev": true, + "dependencies": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^5.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/netlify-cli/node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/supports-hyperlinks/node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/netlify-cli/node_modules/svgo": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", + "dev": true, + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "csso": "^5.0.5", + "picocolors": "^1.0.0" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" + } + }, + "node_modules/netlify-cli/node_modules/svgo/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/netlify-cli/node_modules/tabtab": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-3.0.2.tgz", + "integrity": "sha512-jANKmUe0sIQc/zTALTBy186PoM/k6aPrh3A7p6AaAfF6WPSbTx1JYeGIGH162btpH+mmVEXln+UxwViZHO2Jhg==", + "dev": true, + "dependencies": { + "debug": "^4.0.1", + "es6-promisify": "^6.0.0", + "inquirer": "^6.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "untildify": "^3.0.3" + } + }, + "node_modules/netlify-cli/node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/tar-fs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "dev": true, + "dependencies": { + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + } + }, + "node_modules/netlify-cli/node_modules/tar-stream": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/netlify-cli/node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/temp-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/tempy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", + "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", + "dev": true, + "dependencies": { + "is-stream": "^3.0.0", + "temp-dir": "^2.0.0", + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/tempy/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/terminal-link": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-3.0.0.tgz", + "integrity": "sha512-flFL3m4wuixmf6IfhFJd1YPiLiMuxEc8uHRM1buzIeZPm22Au2pDqBJQgdo7n1WfPU1ONFGv7YDwpFBmHGF6lg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^5.0.0", + "supports-hyperlinks": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/terminal-link/node_modules/ansi-escapes": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/terminal-link/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/thread-stream": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", + "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", + "dev": true, + "dependencies": { + "real-require": "^0.2.0" + } + }, + "node_modules/netlify-cli/node_modules/thriftrw": { + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/thriftrw/-/thriftrw-3.11.4.tgz", + "integrity": "sha512-UcuBd3eanB3T10nXWRRMwfwoaC6VMk7qe3/5YIWP2Jtw+EbHqJ0p1/K3x8ixiR5dozKSSfcg1W+0e33G1Di3XA==", + "dev": true, + "dependencies": { + "bufrw": "^1.2.1", + "error": "7.0.2", + "long": "^2.4.0" + }, + "bin": { + "thrift2json": "thrift2json.js" + }, + "engines": { + "node": ">= 0.10.x" + } + }, + "node_modules/netlify-cli/node_modules/thriftrw/node_modules/long": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", + "integrity": "sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/netlify-cli/node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "dependencies": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/through2-filter/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/through2-filter/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/netlify-cli/node_modules/through2-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-map/-/through2-map-3.0.0.tgz", + "integrity": "sha512-Ms68QPbSJKjRYY7fmqZHB0VGt+vD0/tjmDHUWgxltjifCof6hZWWeQAEi27Wjbs7jyNlIIyerQw/TVj7gHkd/Q==", + "dev": true, + "dependencies": { + "through2": "~2.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/through2-map/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/netlify-cli/node_modules/through2-map/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/netlify-cli/node_modules/time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/tiny-lru": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-11.0.1.tgz", + "integrity": "sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/netlify-cli/node_modules/tmp-promise": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", + "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", + "dev": true, + "dependencies": { + "tmp": "^0.2.0" + } + }, + "node_modules/netlify-cli/node_modules/tmp-promise/node_modules/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "dependencies": { + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" + } + }, + "node_modules/netlify-cli/node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/to-readable-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-3.0.0.tgz", + "integrity": "sha512-vD2LytT6DxPynBa1xbMtswY9gGqj27wNbh2uvI5OhBe+mrGLurRWRQZyQn3812sqlQRtUJwaKVshG+PoGwbPDQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/netlify-cli/node_modules/to-regex/node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/netlify-cli/node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/netlify-cli/node_modules/token-types": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", + "dev": true, + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/netlify-cli/node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/tomlify-j0.4": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tomlify-j0.4/-/tomlify-j0.4-3.0.0.tgz", + "integrity": "sha512-2Ulkc8T7mXJ2l0W476YC/A209PR38Nw8PuaCNtk9uI3t1zzFdGQeWYGQvmj2PZkVvRC/Yoi4xQKMRnWc/N29tQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/triple-beam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/netlify-cli/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/netlify-cli/node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/netlify-cli/node_modules/ufo": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", + "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "dev": true, + "dependencies": { + "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/ulid": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ulid/-/ulid-2.3.0.tgz", + "integrity": "sha512-keqHubrlpvT6G2wH0OEfSW4mquYRcbe/J8NMmveoQOjUqmo+hXtO+ORCpWhdbZ7k72UtY61BL7haGxW6enBnjw==", + "dev": true, + "bin": { + "ulid": "bin/cli.js" + } + }, + "node_modules/netlify-cli/node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dev": true, + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/netlify-cli/node_modules/uncrypto": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", + "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/unenv": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.7.4.tgz", + "integrity": "sha512-fjYsXYi30It0YCQYqLOcT6fHfMXsBr2hw9XC7ycf8rTG7Xxpe3ZssiqUnD0khrjiZEmkBXWLwm42yCSCH46fMw==", + "dev": true, + "dependencies": { + "consola": "^3.2.3", + "defu": "^6.1.2", + "mime": "^3.0.0", + "node-fetch-native": "^1.4.0", + "pathe": "^1.1.1" + } + }, + "node_modules/netlify-cli/node_modules/unenv/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/netlify-cli/node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/union-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/unix-dgram": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/unix-dgram/-/unix-dgram-2.0.6.tgz", + "integrity": "sha512-AURroAsb73BZ6CdAyMrTk/hYKNj3DuYYEuOaB8bYMOHGKupRNScw90Q5C71tWJc3uE7dIeXRyuwN0xLLq3vDTg==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.16.0" + }, + "engines": { + "node": ">=0.10.48" + } + }, + "node_modules/netlify-cli/node_modules/unixify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unixify/-/unixify-1.0.0.tgz", + "integrity": "sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==", + "dev": true, + "dependencies": { + "normalize-path": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unixify/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", + "dev": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/unstorage": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.9.0.tgz", + "integrity": "sha512-VpD8ZEYc/le8DZCrny3bnqKE4ZjioQxBRnWE+j5sGNvziPjeDlaS1NaFFHzl/kkXaO3r7UaF8MGQrs14+1B4pQ==", + "dev": true, + "dependencies": { + "anymatch": "^3.1.3", + "chokidar": "^3.5.3", + "destr": "^2.0.1", + "h3": "^1.7.1", + "ioredis": "^5.3.2", + "listhen": "^1.2.2", + "lru-cache": "^10.0.0", + "mri": "^1.2.0", + "node-fetch-native": "^1.2.0", + "ofetch": "^1.1.1", + "ufo": "^1.2.0" + }, + "peerDependencies": { + "@azure/app-configuration": "^1.4.1", + "@azure/cosmos": "^3.17.3", + "@azure/data-tables": "^13.2.2", + "@azure/identity": "^3.2.3", + "@azure/keyvault-secrets": "^4.7.0", + "@azure/storage-blob": "^12.14.0", + "@capacitor/preferences": "^5.0.0", + "@planetscale/database": "^1.8.0", + "@upstash/redis": "^1.22.0", + "@vercel/kv": "^0.2.2", + "idb-keyval": "^6.2.1" + }, + "peerDependenciesMeta": { + "@azure/app-configuration": { + "optional": true + }, + "@azure/cosmos": { + "optional": true + }, + "@azure/data-tables": { + "optional": true + }, + "@azure/identity": { + "optional": true + }, + "@azure/keyvault-secrets": { + "optional": true + }, + "@azure/storage-blob": { + "optional": true + }, + "@capacitor/preferences": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/kv": { + "optional": true + }, + "idb-keyval": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/unstorage/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/netlify-cli/node_modules/untildify": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/netlify-cli/node_modules/untun": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.2.tgz", + "integrity": "sha512-wLAMWvxfqyTiBODA1lg3IXHQtjggYLeTK7RnSfqtOXixWJ3bAa2kK/HHmOOg19upteqO3muLvN6O/icbyQY33Q==", + "dev": true, + "dependencies": { + "citty": "^0.1.3", + "consola": "^3.2.3", + "pathe": "^1.1.1" + }, + "bin": { + "untun": "bin/untun.mjs" + } + }, + "node_modules/netlify-cli/node_modules/update-notifier": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", + "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", + "dev": true, + "dependencies": { + "boxen": "^7.0.0", + "chalk": "^5.0.1", + "configstore": "^6.0.0", + "has-yarn": "^3.0.0", + "import-lazy": "^4.0.0", + "is-ci": "^3.0.1", + "is-installed-globally": "^0.4.0", + "is-npm": "^6.0.0", + "is-yarn-global": "^0.4.0", + "latest-version": "^7.0.0", + "pupa": "^3.1.0", + "semver": "^7.3.7", + "semver-diff": "^4.0.0", + "xdg-basedir": "^5.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/yeoman/update-notifier?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/uqr": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/uqr/-/uqr-0.1.2.tgz", + "integrity": "sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/netlify-cli/node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true + }, + "node_modules/netlify-cli/node_modules/urlpattern-polyfill": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz", + "integrity": "sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/netlify-cli/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/netlify-cli/node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/netlify-cli/node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "dev": true, + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/wait-port": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.0.4.tgz", + "integrity": "sha512-w8Ftna3h6XSFWWc2JC5gZEgp64nz8bnaTp5cvzbJSZ53j+omktWTDdwXxEF0jM8YveviLgFWvNGrSvRHnkyHyw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "commander": "^9.3.0", + "debug": "^4.3.4" + }, + "bin": { + "wait-port": "bin/wait-port.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/wait-port/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/wait-port/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/wait-port/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/netlify-cli/node_modules/wait-port/node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/netlify-cli/node_modules/web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/netlify-cli/node_modules/whatwg-url/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/netlify-cli/node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/netlify-cli/node_modules/widest-line": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", + "dev": true, + "dependencies": { + "string-width": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/widest-line/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/widest-line/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/windows-release": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.0.1.tgz", + "integrity": "sha512-y1xFdFvdMiDXI3xiOhMbJwt1Y7dUxidha0CWPs1NgjZIjZANTcX7+7bMqNjuezhzb8s5JGEiBAbQjQQYYy7ulw==", + "dev": true, + "dependencies": { + "execa": "^5.1.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/winston-transport": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "dev": true, + "dependencies": { + "logform": "^2.3.2", + "readable-stream": "^3.6.0", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 6.4.0" + } + }, + "node_modules/netlify-cli/node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/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, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/netlify-cli/node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/ws": { + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/netlify-cli/node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/xorshift": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/xorshift/-/xorshift-1.2.0.tgz", + "integrity": "sha512-iYgNnGyeeJ4t6U11NpA/QiKy+PXn5Aa3Azg5qkwIFz1tBLllQrjjsk9yzD7IAK0naNU4JxdeDgqW9ov4u/hc4g==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/xss": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", + "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", + "dev": true, + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/netlify-cli/node_modules/xss/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/netlify-cli/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/netlify-cli/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/yargs/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/yargs/node_modules/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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/netlify-cli/node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/netlify-cli/node_modules/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==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/zip-stream": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz", + "integrity": "sha512-UfZ0oa0C8LI58wJ+moL46BDIMgCQbnsb+2PoiJYtonhBsMh2bq1eRBVkvjfVsqbEHd9/EgKPUuL9saSSsec8OA==", + "dev": true, + "dependencies": { + "archiver-utils": "^4.0.1", + "compress-commons": "^5.0.1", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/netlify-cli/tools/lint-rules": { + "name": "eslint-plugin-workspace", + "extraneous": true + }, + "node_modules/nlcst-to-string": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", + "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", + "dependencies": { + "@types/nlcst": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/node-emoji": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", + "dev": true, + "peer": true, + "dependencies": { + "@sindresorhus/is": "^4.6.0", + "char-regex": "^1.0.2", + "emojilib": "^2.4.0", + "skin-tone": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" + }, + "node_modules/normalize-package-data": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.4.0.tgz", + "integrity": "sha512-RS7Mx0OVfXlOcQLRePuDIYdFCVBPCNapWHplDK+mh7GDdP/Tvor4ocuybRRPSvfcRb2vjRJt1fHCqw3cr8qACQ==", + "bundleDependencies": [ + "@isaacs/string-locale-compare", + "@npmcli/arborist", + "@npmcli/config", + "@npmcli/fs", + "@npmcli/map-workspaces", + "@npmcli/package-json", + "@npmcli/promise-spawn", + "@npmcli/run-script", + "@sigstore/tuf", + "abbrev", + "archy", + "cacache", + "chalk", + "ci-info", + "cli-columns", + "cli-table3", + "columnify", + "fastest-levenshtein", + "fs-minipass", + "glob", + "graceful-fs", + "hosted-git-info", + "ini", + "init-package-json", + "is-cidr", + "json-parse-even-better-errors", + "libnpmaccess", + "libnpmdiff", + "libnpmexec", + "libnpmfund", + "libnpmhook", + "libnpmorg", + "libnpmpack", + "libnpmpublish", + "libnpmsearch", + "libnpmteam", + "libnpmversion", + "make-fetch-happen", + "minimatch", + "minipass", + "minipass-pipeline", + "ms", + "node-gyp", + "nopt", + "normalize-package-data", + "npm-audit-report", + "npm-install-checks", + "npm-package-arg", + "npm-pick-manifest", + "npm-profile", + "npm-registry-fetch", + "npm-user-validate", + "npmlog", + "p-map", + "pacote", + "parse-conflict-json", + "proc-log", + "qrcode-terminal", + "read", + "semver", + "spdx-expression-parse", + "ssri", + "supports-color", + "tar", + "text-table", + "tiny-relative-date", + "treeverse", + "validate-npm-package-name", + "which", + "write-file-atomic" + ], + "dev": true, + "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/arborist": "^7.2.1", + "@npmcli/config": "^8.0.2", + "@npmcli/fs": "^3.1.0", + "@npmcli/map-workspaces": "^3.0.4", + "@npmcli/package-json": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.1", + "@npmcli/run-script": "^7.0.4", + "@sigstore/tuf": "^2.3.0", + "abbrev": "^2.0.0", + "archy": "~1.0.0", + "cacache": "^18.0.2", + "chalk": "^5.3.0", + "ci-info": "^4.0.0", + "cli-columns": "^4.0.0", + "cli-table3": "^0.6.3", + "columnify": "^1.6.0", + "fastest-levenshtein": "^1.0.16", + "fs-minipass": "^3.0.3", + "glob": "^10.3.10", + "graceful-fs": "^4.2.11", + "hosted-git-info": "^7.0.1", + "ini": "^4.1.1", + "init-package-json": "^6.0.0", + "is-cidr": "^5.0.3", + "json-parse-even-better-errors": "^3.0.1", + "libnpmaccess": "^8.0.1", + "libnpmdiff": "^6.0.3", + "libnpmexec": "^7.0.4", + "libnpmfund": "^5.0.1", + "libnpmhook": "^10.0.0", + "libnpmorg": "^6.0.1", + "libnpmpack": "^6.0.3", + "libnpmpublish": "^9.0.2", + "libnpmsearch": "^7.0.0", + "libnpmteam": "^6.0.0", + "libnpmversion": "^5.0.1", + "make-fetch-happen": "^13.0.0", + "minimatch": "^9.0.3", + "minipass": "^7.0.4", + "minipass-pipeline": "^1.2.4", + "ms": "^2.1.2", + "node-gyp": "^10.0.1", + "nopt": "^7.2.0", + "normalize-package-data": "^6.0.0", + "npm-audit-report": "^5.0.0", + "npm-install-checks": "^6.3.0", + "npm-package-arg": "^11.0.1", + "npm-pick-manifest": "^9.0.0", + "npm-profile": "^9.0.0", + "npm-registry-fetch": "^16.1.0", + "npm-user-validate": "^2.0.0", + "npmlog": "^7.0.1", + "p-map": "^4.0.0", + "pacote": "^17.0.6", + "parse-conflict-json": "^3.0.1", + "proc-log": "^3.0.0", + "qrcode-terminal": "^0.12.0", + "read": "^2.1.0", + "semver": "^7.5.4", + "spdx-expression-parse": "^3.0.1", + "ssri": "^10.0.5", + "supports-color": "^9.4.0", + "tar": "^6.2.0", + "text-table": "~0.2.0", + "tiny-relative-date": "^1.3.0", + "treeverse": "^3.0.0", + "validate-npm-package-name": "^5.0.0", + "which": "^4.0.0", + "write-file-atomic": "^5.0.1" + }, + "bin": { + "npm": "bin/npm-cli.js", + "npx": "bin/npx-cli.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@colors/colors": { + "version": "1.5.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui": { + "version": "8.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/npm/node_modules/@isaacs/string-locale-compare": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/@npmcli/agent": { + "version": "2.2.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/arborist": { + "version": "7.3.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/fs": "^3.1.0", + "@npmcli/installed-package-contents": "^2.0.2", + "@npmcli/map-workspaces": "^3.0.2", + "@npmcli/metavuln-calculator": "^7.0.0", + "@npmcli/name-from-folder": "^2.0.0", + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/package-json": "^5.0.0", + "@npmcli/query": "^3.0.1", + "@npmcli/run-script": "^7.0.2", + "bin-links": "^4.0.1", + "cacache": "^18.0.0", + "common-ancestor-path": "^1.0.1", + "hosted-git-info": "^7.0.1", + "json-parse-even-better-errors": "^3.0.0", + "json-stringify-nice": "^1.1.4", + "minimatch": "^9.0.0", + "nopt": "^7.0.0", + "npm-install-checks": "^6.2.0", + "npm-package-arg": "^11.0.1", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", + "npmlog": "^7.0.1", + "pacote": "^17.0.4", + "parse-conflict-json": "^3.0.0", + "proc-log": "^3.0.0", + "promise-all-reject-late": "^1.0.0", + "promise-call-limit": "^3.0.1", + "read-package-json-fast": "^3.0.2", + "semver": "^7.3.7", + "ssri": "^10.0.5", + "treeverse": "^3.0.0", + "walk-up-path": "^3.0.1" + }, + "bin": { + "arborist": "bin/index.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/config": { + "version": "8.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/map-workspaces": "^3.0.2", + "ci-info": "^4.0.0", + "ini": "^4.1.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", + "read-package-json-fast": "^3.0.2", + "semver": "^7.3.5", + "walk-up-path": "^3.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/disparity-colors": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "ansi-styles": "^4.3.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/npm/node_modules/@npmcli/fs": { + "version": "3.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/git": { + "version": "5.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/promise-spawn": "^7.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/installed-package-contents": { + "version": "2.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "lib/index.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/map-workspaces": { + "version": "3.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/name-from-folder": "^2.0.0", + "glob": "^10.2.2", + "minimatch": "^9.0.0", + "read-package-json-fast": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { + "version": "7.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "cacache": "^18.0.0", + "json-parse-even-better-errors": "^3.0.0", + "pacote": "^17.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/name-from-folder": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/node-gyp": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/package-json": { + "version": "5.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^5.0.0", + "glob": "^10.2.2", + "hosted-git-info": "^7.0.0", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/promise-spawn": { + "version": "7.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/query": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "postcss-selector-parser": "^6.0.10" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/run-script": { + "version": "7.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/package-json": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "node-gyp": "^10.0.0", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/npm/node_modules/@sigstore/bundle": { + "version": "2.1.1", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.2.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/core": { + "version": "0.2.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/protobuf-specs": { + "version": "0.2.1", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/sign": { + "version": "2.2.1", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.1.1", + "@sigstore/core": "^0.2.0", + "@sigstore/protobuf-specs": "^0.2.1", + "make-fetch-happen": "^13.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/tuf": { + "version": "2.3.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.2.1", + "tuf-js": "^2.2.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/verify": { + "version": "0.1.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.1.1", + "@sigstore/core": "^0.2.0", + "@sigstore/protobuf-specs": "^0.2.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@tufjs/canonical-json": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@tufjs/models": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/abbrev": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/agent-base": { + "version": "7.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/aggregate-error": { + "version": "3.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/ansi-styles": { + "version": "6.2.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/npm/node_modules/aproba": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/archy": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/are-we-there-yet": { + "version": "4.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/balanced-match": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/bin-links": { + "version": "4.0.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "cmd-shim": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "read-cmd-shim": "^4.0.0", + "write-file-atomic": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/binary-extensions": { + "version": "2.2.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/npm/node_modules/builtins": { + "version": "5.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/npm/node_modules/cacache": { + "version": "18.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/chalk": { + "version": "5.3.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/npm/node_modules/chownr": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/npm/node_modules/ci-info": { + "version": "4.0.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/cidr-regex": { + "version": "4.0.3", + "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", + "dependencies": { + "ip-regex": "^5.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/npm/node_modules/clean-stack": { + "version": "2.2.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/npm/node_modules/cli-columns": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/npm/node_modules/cli-table3": { + "version": "0.6.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/npm/node_modules/clone": { + "version": "1.0.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/npm/node_modules/cmd-shim": { + "version": "6.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/npm/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/color-support": { + "version": "1.1.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/npm/node_modules/columnify": { + "version": "1.6.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "strip-ansi": "^6.0.1", + "wcwidth": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/npm/node_modules/common-ancestor-path": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/console-control-strings": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/npm/node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/npm/node_modules/cssesc": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/npm/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/defaults": { + "version": "1.0.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm/node_modules/diff": { + "version": "5.1.0", + "dev": true, + "inBundle": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/npm/node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/encoding": { + "version": "0.1.13", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/npm/node_modules/env-paths": { + "version": "2.2.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/npm/node_modules/err-code": { + "version": "2.0.3", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/exponential-backoff": { + "version": "3.1.1", + "dev": true, + "inBundle": true, + "license": "Apache-2.0" + }, + "node_modules/npm/node_modules/fastest-levenshtein": { + "version": "1.0.16", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/npm/node_modules/foreground-child": { + "version": "3.1.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/fs-minipass": { + "version": "3.0.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/function-bind": { + "version": "1.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/npm/node_modules/gauge": { + "version": "5.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^4.0.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/glob": { + "version": "10.3.10", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/graceful-fs": { + "version": "4.2.11", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/has-unicode": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/hasown": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/npm/node_modules/hosted-git-info": { + "version": "7.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/http-cache-semantics": { + "version": "4.1.1", + "dev": true, + "inBundle": true, + "license": "BSD-2-Clause" + }, + "node_modules/npm/node_modules/http-proxy-agent": { + "version": "7.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/https-proxy-agent": { + "version": "7.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/iconv-lite": { + "version": "0.6.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm/node_modules/ignore-walk": { + "version": "6.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/npm/node_modules/indent-string": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/ini": { + "version": "4.1.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/init-package-json": { + "version": "6.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-package-arg": "^11.0.0", + "promzard": "^1.0.0", + "read": "^2.0.0", + "read-package-json": "^7.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/ip": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/ip-regex": { + "version": "5.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm/node_modules/is-cidr": { + "version": "5.0.3", + "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", + "dependencies": { + "cidr-regex": "4.0.3" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/npm/node_modules/is-core-module": { + "version": "2.13.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/npm/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/is-lambda": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/jackspeak": { + "version": "2.3.6", + "dev": true, + "inBundle": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/npm/node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/json-stringify-nice": { + "version": "1.1.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/jsonparse": { + "version": "1.3.1", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/just-diff": { + "version": "6.0.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/just-diff-apply": { + "version": "5.5.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/libnpmaccess": { + "version": "8.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-package-arg": "^11.0.1", + "npm-registry-fetch": "^16.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmdiff": { + "version": "6.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/arborist": "^7.2.1", + "@npmcli/disparity-colors": "^3.0.0", + "@npmcli/installed-package-contents": "^2.0.2", + "binary-extensions": "^2.2.0", + "diff": "^5.1.0", + "minimatch": "^9.0.0", + "npm-package-arg": "^11.0.1", + "pacote": "^17.0.4", + "tar": "^6.2.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmexec": { + "version": "7.0.7", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/arborist": "^7.2.1", + "@npmcli/run-script": "^7.0.2", + "ci-info": "^4.0.0", + "npm-package-arg": "^11.0.1", + "npmlog": "^7.0.1", + "pacote": "^17.0.4", + "proc-log": "^3.0.0", + "read": "^2.0.0", + "read-package-json-fast": "^3.0.2", + "semver": "^7.3.7", + "walk-up-path": "^3.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmfund": { + "version": "5.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/arborist": "^7.2.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmhook": { + "version": "10.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^16.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmorg": { + "version": "6.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^16.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmpack": { + "version": "6.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/arborist": "^7.2.1", + "@npmcli/run-script": "^7.0.2", + "npm-package-arg": "^11.0.1", + "pacote": "^17.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmpublish": { + "version": "9.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "ci-info": "^4.0.0", + "normalize-package-data": "^6.0.0", + "npm-package-arg": "^11.0.1", + "npm-registry-fetch": "^16.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.7", + "sigstore": "^2.2.0", + "ssri": "^10.0.5" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmsearch": { + "version": "7.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-registry-fetch": "^16.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmteam": { + "version": "6.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^16.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/libnpmversion": { + "version": "5.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^5.0.3", + "@npmcli/run-script": "^7.0.2", + "json-parse-even-better-errors": "^3.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/lru-cache": { + "version": "10.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/npm/node_modules/make-fetch-happen": { + "version": "13.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/minipass": { + "version": "7.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/npm/node_modules/minipass-collect": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/npm/node_modules/minipass-fetch": { + "version": "3.0.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/npm/node_modules/minipass-flush": { + "version": "1.0.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/minipass-json-stream": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "node_modules/npm/node_modules/minipass-json-stream/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/minipass-pipeline": { + "version": "1.2.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/minipass-sized": { + "version": "1.0.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/minizlib": { + "version": "2.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/npm/node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/mkdirp": { + "version": "1.0.4", + "dev": true, + "inBundle": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/mute-stream": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/negotiator": { + "version": "0.6.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/npm/node_modules/node-gyp": { + "version": "10.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^4.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/nopt": { + "version": "7.2.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/normalize-package-data": { + "version": "6.0.0", + "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-audit-report": { + "version": "5.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-bundled": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-install-checks": { + "version": "6.3.0", + "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-package-arg": { + "version": "11.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-packlist": { + "version": "8.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "ignore-walk": "^6.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-pick-manifest": { + "version": "9.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^11.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-profile": { + "version": "9.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "npm-registry-fetch": "^16.0.0", + "proc-log": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-registry-fetch": { + "version": "16.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "make-fetch-happen": "^13.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^11.0.0", + "proc-log": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npm-user-validate": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "BSD-2-Clause", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/npmlog": { + "version": "7.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^4.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^5.0.0", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/p-map": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm/node_modules/pacote": { + "version": "17.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^5.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^7.0.0", + "cacache": "^18.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^11.0.0", + "npm-packlist": "^8.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", + "proc-log": "^3.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^7.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^2.2.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "lib/bin.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/parse-conflict-json": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^3.0.0", + "just-diff": "^6.0.0", + "just-diff-apply": "^5.2.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/path-scurry": { + "version": "1.10.1", + "dev": true, + "inBundle": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/postcss-selector-parser": { + "version": "6.0.15", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm/node_modules/proc-log": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/promise-all-reject-late": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/promise-call-limit": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/promise-inflight": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/promise-retry": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm/node_modules/promzard": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "read": "^2.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/qrcode-terminal": { + "version": "0.12.0", + "dev": true, + "inBundle": true, + "bin": { + "qrcode-terminal": "bin/qrcode-terminal.js" + } + }, + "node_modules/npm/node_modules/read": { + "version": "2.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "mute-stream": "~1.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/read-cmd-shim": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/read-package-json": { + "version": "7.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/read-package-json-fast": { + "version": "3.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/retry": { + "version": "0.12.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm/node_modules/safer-buffer": { + "version": "2.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/npm/node_modules/semver": { + "version": "7.5.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm/node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm/node_modules/set-blocking": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/sigstore": { + "version": "2.2.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.1.1", + "@sigstore/core": "^0.2.0", + "@sigstore/protobuf-specs": "^0.2.1", + "@sigstore/sign": "^2.2.1", + "@sigstore/tuf": "^2.3.0", + "@sigstore/verify": "^0.1.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/smart-buffer": { + "version": "4.2.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/npm/node_modules/socks": { + "version": "2.7.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/npm/node_modules/socks-proxy-agent": { + "version": "8.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/npm/node_modules/spdx-correct": { + "version": "3.2.0", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/npm/node_modules/spdx-exceptions": { + "version": "2.3.0", + "dev": true, + "inBundle": true, + "license": "CC-BY-3.0" + }, + "node_modules/npm/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/npm/node_modules/spdx-license-ids": { + "version": "3.0.16", + "dev": true, + "inBundle": true, + "license": "CC0-1.0" + }, + "node_modules/npm/node_modules/ssri": { + "version": "10.0.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/supports-color": { + "version": "9.4.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/npm/node_modules/tar": { + "version": "6.2.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/text-table": { + "version": "0.2.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/tiny-relative-date": { + "version": "1.3.0", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/treeverse": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js": { + "version": "2.2.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@tufjs/models": "2.0.0", + "debug": "^4.3.4", + "make-fetch-happen": "^13.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/unique-filename": { + "version": "3.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/unique-slug": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/util-deprecate": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/validate-npm-package-license": { + "version": "3.0.4", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/npm/node_modules/validate-npm-package-name": { + "version": "5.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/walk-up-path": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/wcwidth": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/npm/node_modules/which": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/which/node_modules/isexe": { + "version": "3.1.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/npm/node_modules/wide-align": { + "version": "1.1.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/npm/node_modules/wrap-ansi": { + "version": "8.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/npm/node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "9.2.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/npm/node_modules/write-file-atomic": { + "version": "5.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/nwsapi": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.9.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.3.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "string-width": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-each-series": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "dependencies": { + "p-map": "^5.1.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-is-promise": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/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==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map/node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map/node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-reduce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p5": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/p5/-/p5-1.9.0.tgz", + "integrity": "sha512-+5/hz0ZokCDf7BMMAeemE7FIo7gFZK7ImL62acHLXZwerGjqj+171bnaAWj4aCFCx6fwysAr2U7/AKuPyPhehA==" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "peer": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.1.tgz", + "integrity": "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.21.4", + "error-ex": "^1.3.2", + "json-parse-even-better-errors": "^3.0.0", + "lines-and-columns": "^2.0.3", + "type-fest": "^3.8.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-json/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-latin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz", + "integrity": "sha512-b/K8ExXaWC9t34kKeDV8kGXBkXZ1HCSAZRYE7HR14eA1GlXX5L8iWhs8USJNhQU9q5ci413jCKF0gOyovvyRBg==", + "dependencies": { + "nlcst-to-string": "^3.0.0", + "unist-util-modify-children": "^3.0.0", + "unist-util-visit-children": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dev": true, + "peer": true, + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true, + "peer": true + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-to-regexp": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", + "dev": true, + "peer": true, + "dependencies": { + "find-up": "^2.0.0", + "load-json-file": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-conf/node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "peer": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-conf/node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "peer": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-conf/node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "peer": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-conf/node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "peer": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-conf/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "node_modules/playwright": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", + "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "dev": true, + "dependencies": { + "playwright-core": "1.40.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", + "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/preferred-pm": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.3.tgz", + "integrity": "sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==", + "dependencies": { + "find-up": "^5.0.0", + "find-yarn-workspace-root2": "1.2.16", + "path-exists": "^4.0.0", + "which-pm": "2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/preferred-pm/node_modules/which-pm": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", + "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/prettier": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "engines": { + "node": ">=6" + } + }, + "node_modules/probe-image-size": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", + "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", + "dependencies": { + "lodash.merge": "^4.6.2", + "needle": "^2.5.2", + "stream-parser": "~0.3.1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prompts/node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/property-information": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz", + "integrity": "sha512-OHYtXfu5aI2sS2LWFSN5rgJjrQ4pCy8i1jubJLe2QvMF8JJ++HXTUIVWFLfXJoaOfvYYjk2SN8J2wFUWIGXT4w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "node_modules/react-refresh": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", + "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", + "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^6.0.0", + "parse-json": "^7.0.0", + "type-fest": "^4.2.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-10.1.0.tgz", + "integrity": "sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==", + "dev": true, + "dependencies": { + "find-up": "^6.3.0", + "read-pkg": "^8.1.0", + "type-fest": "^4.2.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/registry-auth-token": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", + "dev": true, + "dependencies": { + "@pnpm/npm-conf": "^2.1.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/rehype": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", + "integrity": "sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg==", + "dependencies": { + "@types/hast": "^3.0.0", + "rehype-parse": "^9.0.0", + "rehype-stringify": "^10.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz", + "integrity": "sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-from-html": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-raw": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-stringify": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz", + "integrity": "sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ==", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-to-html": "^9.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-gfm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", + "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-smartypants": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.1.0.tgz", + "integrity": "sha512-qoF6Vz3BjU2tP6OfZqHOvCU0ACmu/6jhGaINSQRI9mM7wCxNQTKB3JUAN4SVoN2ybElEDTxBIABRep7e569iJw==", + "dependencies": { + "retext": "^8.1.0", + "retext-smartypants": "^5.2.0", + "unist-util-visit": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/request-light": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", + "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/retext": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/retext/-/retext-8.1.0.tgz", + "integrity": "sha512-N9/Kq7YTn6ZpzfiGW45WfEGJqFf1IM1q8OsRa1CGzIebCJBNCANDRmOrholiDRGKo/We7ofKR4SEvcGAWEMD3Q==", + "dependencies": { + "@types/nlcst": "^1.0.0", + "retext-latin": "^3.0.0", + "retext-stringify": "^3.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-3.1.0.tgz", + "integrity": "sha512-5MrD1tuebzO8ppsja5eEu+ZbBeUNCjoEarn70tkXOS7Bdsdf6tNahsv2bY0Z8VooFF6cw7/6S+d3yI/TMlMVVQ==", + "dependencies": { + "@types/nlcst": "^1.0.0", + "parse-latin": "^5.0.0", + "unherit": "^3.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-latin/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-5.2.0.tgz", + "integrity": "sha512-Do8oM+SsjrbzT2UNIKgheP0hgUQTDDQYyZaIY3kfq0pdFzoPk+ZClYJ+OERNXveog4xf1pZL4PfRxNoVL7a/jw==", + "dependencies": { + "@types/nlcst": "^1.0.0", + "nlcst-to-string": "^3.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-smartypants/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", + "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", + "dependencies": { + "@types/nlcst": "^1.0.0", + "nlcst-to-string": "^3.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-stringify/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sax": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/section-matter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "dependencies": { + "extend-shallow": "^2.0.1", + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/semantic-release": { + "version": "23.0.2", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-23.0.2.tgz", + "integrity": "sha512-OnVYJ6Xgzwe1x8MKswba7RU9+5djS1MWRTrTn5qsq3xZYpslroZkV9Pt0dA2YcIuieeuSZWJhn+yUWoBUHO5Fw==", + "dev": true, + "peer": true, + "dependencies": { + "@semantic-release/commit-analyzer": "^11.0.0", + "@semantic-release/error": "^4.0.0", + "@semantic-release/github": "^9.0.0", + "@semantic-release/npm": "^11.0.0", + "@semantic-release/release-notes-generator": "^12.0.0", + "aggregate-error": "^5.0.0", + "cosmiconfig": "^9.0.0", + "debug": "^4.0.0", + "env-ci": "^11.0.0", + "execa": "^8.0.0", + "figures": "^6.0.0", + "find-versions": "^5.1.0", + "get-stream": "^6.0.0", + "git-log-parser": "^1.2.0", + "hook-std": "^3.0.0", + "hosted-git-info": "^7.0.0", + "import-from-esm": "^1.3.1", + "lodash-es": "^4.17.21", + "marked": "^12.0.0", + "marked-terminal": "^7.0.0", + "micromatch": "^4.0.2", + "p-each-series": "^3.0.0", + "p-reduce": "^3.0.0", + "read-pkg-up": "^11.0.0", + "resolve-from": "^5.0.0", + "semver": "^7.3.2", + "semver-diff": "^4.0.0", + "signale": "^1.2.1", + "yargs": "^17.5.1" + }, + "bin": { + "semantic-release": "bin/semantic-release.js" + }, + "engines": { + "node": ">=20.8.1" + } + }, + "node_modules/semantic-release/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/semantic-release/node_modules/aggregate-error": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", + "dev": true, + "peer": true, + "dependencies": { + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/clean-stack": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", + "dev": true, + "peer": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/semantic-release/node_modules/execa/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/semantic-release/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "peer": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-reduce": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/parse-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "index-to-position": "^0.1.2", + "type-fest": "^4.7.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/read-pkg": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.3", + "normalize-package-data": "^6.0.0", + "parse-json": "^8.0.0", + "type-fest": "^4.6.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/read-pkg-up": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-11.0.0.tgz", + "integrity": "sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==", + "deprecated": "Renamed to read-package-up", + "dev": true, + "peer": true, + "dependencies": { + "find-up-simple": "^1.0.0", + "read-pkg": "^9.0.0", + "type-fest": "^4.6.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/semantic-release/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/type-fest": { + "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", + "dev": true, + "peer": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver-regex": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver/node_modules/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==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/server-destroy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==" + }, + "node_modules/set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/sharp": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", + "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "semver": "^7.5.4" + }, + "engines": { + "libvips": ">=8.15.1", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.2", + "@img/sharp-darwin-x64": "0.33.2", + "@img/sharp-libvips-darwin-arm64": "1.0.1", + "@img/sharp-libvips-darwin-x64": "1.0.1", + "@img/sharp-libvips-linux-arm": "1.0.1", + "@img/sharp-libvips-linux-arm64": "1.0.1", + "@img/sharp-libvips-linux-s390x": "1.0.1", + "@img/sharp-libvips-linux-x64": "1.0.1", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1", + "@img/sharp-libvips-linuxmusl-x64": "1.0.1", + "@img/sharp-linux-arm": "0.33.2", + "@img/sharp-linux-arm64": "0.33.2", + "@img/sharp-linux-s390x": "0.33.2", + "@img/sharp-linux-x64": "0.33.2", + "@img/sharp-linuxmusl-arm64": "0.33.2", + "@img/sharp-linuxmusl-x64": "0.33.2", + "@img/sharp-wasm32": "0.33.2", + "@img/sharp-win32-ia32": "0.33.2", + "@img/sharp-win32-x64": "0.33.2" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/shikiji": { + "version": "0.6.13", + "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.13.tgz", + "integrity": "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA==", + "dependencies": { + "hast-util-to-html": "^9.0.0" + } + }, + "node_modules/shx": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", + "dev": true, + "dependencies": { + "minimist": "^1.2.3", + "shelljs": "^0.8.5" + }, + "bin": { + "shx": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/side-channel": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", + "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/signale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", + "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^2.3.2", + "figures": "^2.0.0", + "pkg-conf": "^2.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/signale/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/signale/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/signale/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/signale/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": true + }, + "node_modules/signale/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/signale/node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "peer": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/signale/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/signale/node_modules/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, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "optional": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "optional": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/skin-tone": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", + "dev": true, + "peer": true, + "dependencies": { + "unicode-emoji-modifier-base": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/spawn-error-forwarder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", + "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", + "dev": true, + "peer": true + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/state-local": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", + "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==" + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", + "dev": true, + "peer": true, + "dependencies": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "node_modules/stream-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", + "dependencies": { + "debug": "2" + } + }, + "node_modules/stream-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/stream-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/temp-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/tempy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", + "dev": true, + "dependencies": { + "is-stream": "^3.0.0", + "temp-dir": "^3.0.0", + "type-fest": "^2.12.2", + "unique-string": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tempy/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/text-extensions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "peer": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "peer": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "peer": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/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==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dev": true, + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/traverse": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/tsconfck": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", + "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", + "bin": { + "tsconfck": "bin/tsconfck.js" + }, + "engines": { + "node": "^18 || >=20" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "optional": true + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typesafe-path": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", + "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-auto-import-cache": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.2.tgz", + "integrity": "sha512-+laqe5SFL1vN62FPOOJSUDTZxtgsoOXjneYOXIpx5rQ4UMiN89NAtJLpqLqyebv9fgQ/IMeeTX+mQyRnwvJzvg==", + "dependencies": { + "semver": "^7.3.8" + } + }, + "node_modules/ufo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", + "dev": true + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/ultrahtml": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.3.tgz", + "integrity": "sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "devOptional": true + }, + "node_modules/unherit": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", + "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unicode-emoji-modifier-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", + "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", + "dependencies": { + "@types/unist": "^2.0.0", + "array-iterate": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-children": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", + "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-children/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/url-join": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.35", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.1.1.tgz", + "integrity": "sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitefu": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", + "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.1.1.tgz", + "integrity": "sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.1.1", + "@vitest/runner": "1.1.1", + "@vitest/snapshot": "1.1.1", + "@vitest/spy": "1.1.1", + "@vitest/utils": "1.1.1", + "acorn-walk": "^8.3.0", + "cac": "^6.7.14", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^1.3.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.1", + "vite": "^5.0.0", + "vite-node": "1.1.1", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "^1.0.0", + "@vitest/ui": "^1.0.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/vitest/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/vitest/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vitest/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/vitest/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/volar-service-css": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-css/-/volar-service-css-0.0.30.tgz", + "integrity": "sha512-jui+1N0HBfjW43tRfhyZp0axhBee4997BRyX4os8xQm/7cjD2KjAuyz92nMIPRt1QDoG4/7uQT28xNhy0TPJTA==", + "dependencies": { + "vscode-css-languageservice": "^6.2.10", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "@volar/language-service": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } + } + }, + "node_modules/volar-service-emmet": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-emmet/-/volar-service-emmet-0.0.30.tgz", + "integrity": "sha512-HEeIrmqQ/DTfuQDI9ER5+YReXXjE9f7W6MlBmn5biUuPyizVTGfuILN8pJhmYvmPHCA7qHhU7CJqwE9DAh9AJg==", + "dependencies": { + "@vscode/emmet-helper": "^2.9.2", + "volar-service-html": "0.0.30" + }, + "peerDependencies": { + "@volar/language-service": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } + } + }, + "node_modules/volar-service-html": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-html/-/volar-service-html-0.0.30.tgz", + "integrity": "sha512-wW3TEeRTeHv/3mC8Ik6T62SwewMWFungb8ydyEK/2GDHEntBEG/J9wtuh01/J0kYqPerhlT9zhdGB6PGYHAGuA==", + "dependencies": { + "vscode-html-languageservice": "^5.1.0", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "@volar/language-service": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } + } + }, + "node_modules/volar-service-prettier": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-prettier/-/volar-service-prettier-0.0.30.tgz", + "integrity": "sha512-Qdc5Zc0y4hJmJbpIQ52cSDjs0uvVug/e2nuL/XZWPJM6Cr5/3RjjoRVKtDQbKItFYlGk+JH+LSXvwQeD5TXZqg==", + "dependencies": { + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "@volar/language-service": "~2.0.1", + "prettier": "^2.2 || ^3.0" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + }, + "prettier": { + "optional": true + } + } + }, + "node_modules/volar-service-typescript": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-typescript/-/volar-service-typescript-0.0.30.tgz", + "integrity": "sha512-jA8c0Mhy9rgAsrgtwocK95Smws1M2E0MxlQ/SVo/rmOGH32cX9UGgI0IENWKa3yagp/khfoemOIQDz/KNhI3zg==", + "dependencies": { + "path-browserify": "^1.0.1", + "semver": "^7.5.4", + "typescript-auto-import-cache": "^0.3.1", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-nls": "^5.2.0", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "@volar/language-service": "~2.0.1", + "@volar/typescript": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } + } + }, + "node_modules/volar-service-typescript-twoslash-queries": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-typescript-twoslash-queries/-/volar-service-typescript-twoslash-queries-0.0.30.tgz", + "integrity": "sha512-ahj6woBxhkZu7icQR58x5TnUaS8ZRKn7a+UvY+andmiTWsOaSu85zj36+LPZgZQi1MG+BtjNwUjKoxtZiN51PA==", + "peerDependencies": { + "@volar/language-service": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } + } + }, + "node_modules/vscode-css-languageservice": { + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.2.12.tgz", + "integrity": "sha512-PS9r7HgNjqzRl3v91sXpCyZPc8UDotNo6gntFNtGCKPhGA9Frk7g/VjX1Mbv3F00pn56D+rxrFzR9ep4cawOgA==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-languageserver-types": "3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-css-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/vscode-html-languageservice": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.1.2.tgz", + "integrity": "sha512-wkWfEx/IIR3s2P5yD4aTGHiOb8IAzFxgkSt1uSC3itJ4oDAm23yG7o0L29JljUdnXDDgLafPAvhv8A2I/8riHw==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-languageserver-types": "^3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-html-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.5" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "dependencies": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-nls": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", + "dev": true, + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-pm": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", + "integrity": "sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ==", + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/widest-line": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", + "dependencies": { + "string-width": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/widest-line/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/widest-line/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/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==" + }, + "node_modules/yargs/node_modules/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==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } } diff --git a/package.json b/package.json index 02cb2b0..8ba609e 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,65 @@ { - "name": "@ff6347/p5-sandbox", - "private": true, - "version": "1.4.5", - "type": "module", - "scripts": { - "copy:p5": "mkdirp ./public/lib && shx cp -r ./node_modules/p5/lib ./public/", - "dev": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro dev", - "start": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro dev", - "prebuild": "npm run copy:p5", - "postinstall": "npm run copy:p5", - "build": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro build", - "build:netlify": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro build", - - "check": "astro check", - "preview": "astro preview", - "astro": "astro", - "test": "vitest", - "test:e2e": "playwright test" - }, - "dependencies": { - "@astrojs/check": "0.3.4", - "@astrojs/react": "3.0.9", - "@monaco-editor/react": "4.6.0", - "@types/p5": "1.7.6", - "@types/react": "18.2.45", - "@types/react-dom": "18.2.18", - "astro": "4.1.0", - "lodash.debounce": "4.0.8", - "p5": "1.9.0", - "prettier": "3.1.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "typescript": "5.3.3" - }, - "devDependencies": { - "@playwright/test": "1.40.1", - "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", - "@types/lodash.debounce": "4.0.9", - "@types/node": "20.10.6", - "jsdom": "23.0.1", - "mkdirp": "3.0.1", - "netlify-cli": "17.10.2", - "shx": "0.3.4", - "vitest": "1.1.1" - } + "name": "@ff6347/p5-sandbox", + "private": true, + "version": "1.4.5", + "type": "module", + "scripts": { + "copy:p5": "mkdirp ./public/lib && shx cp -r ./node_modules/p5/lib ./public/", + "dev": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro dev", + "start": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro dev", + "prebuild": "npm run copy:p5", + "postinstall": "npm run copy:p5", + "build": "export PUBLIC_BASE_URL=$CF_PAGES_URL && astro build", + "build:netlify": "export PUBLIC_BASE_URL=$DEPLOY_URL && astro build", + "check": "astro check", + "preview": "astro preview", + "astro": "astro", + "test": "vitest", + "test:e2e": "playwright test" + }, + "dependencies": { + "@astrojs/check": "0.3.4", + "@astrojs/react": "3.0.9", + "@monaco-editor/react": "4.6.0", + "@types/p5": "1.7.6", + "@types/react": "18.2.45", + "@types/react-dom": "18.2.18", + "astro": "4.1.0", + "lodash.debounce": "4.0.8", + "p5": "1.9.0", + "prettier": "3.1.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "typescript": "5.3.3" + }, + "devDependencies": { + "@playwright/test": "1.40.1", + "@technologiestiftung/semantic-release-config": "1.2.4", + "@testing-library/react": "14.1.2", + "@types/lodash.debounce": "4.0.9", + "@types/node": "20.10.6", + "jsdom": "23.0.1", + "mkdirp": "3.0.1", + "netlify-cli": "17.10.2", + "shx": "0.3.4", + "vitest": "1.1.1" + }, + "prettier": { + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "useTabs": true, + "printWidth": 80, + "overrides": [ + { + "files": [ + "*.yml", + "*.yaml" + ], + "options": { + "useTabs": false + } + } + ] + } } diff --git a/playwright.config.ts b/playwright.config.ts index faba95e..c3f1f4a 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -86,6 +86,6 @@ export default defineConfig({ reuseExistingServer: !process.env.CI, stdout: "ignore", stderr: "pipe", - } + } : undefined, }); diff --git a/public/lib/addons/p5.sound.js b/public/lib/addons/p5.sound.js index a8a7e3f..b293d62 100644 --- a/public/lib/addons/p5.sound.js +++ b/public/lib/addons/p5.sound.js @@ -1,5 +1,5 @@ -/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ - /** +/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ +/** *

            p5.sound extends p5 with Web Audio functionality including audio input, * playback, analysis and synthesis. @@ -50,7 +50,7 @@ */ /** - * p5.sound + * p5.sound * https://p5js.org/reference/#/libraries/p5.sound * * From the Processing Foundation and contributors @@ -70,12199 +70,17267 @@ * Web Audio API: http://w3.org/TR/webaudio/ */ - (function(modules) { - var installedModules = {}; - function __webpack_require__(moduleId) { - if(installedModules[moduleId]) { - return installedModules[moduleId].exports; - } - var module = installedModules[moduleId] = { - i: moduleId, - l: false, - exports: {} - }; - modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - module.l = true; - return module.exports; - } - __webpack_require__.m = modules; - __webpack_require__.c = installedModules; - __webpack_require__.d = function(exports, name, getter) { - if(!__webpack_require__.o(exports, name)) { - Object.defineProperty(exports, name, { enumerable: true, get: getter }); - } - }; - __webpack_require__.r = function(exports) { - if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { - Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - } - Object.defineProperty(exports, '__esModule', { value: true }); - }; - __webpack_require__.t = function(value, mode) { - if(mode & 1) value = __webpack_require__(value); - if(mode & 8) return value; - if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; - var ns = Object.create(null); - __webpack_require__.r(ns); - Object.defineProperty(ns, 'default', { enumerable: true, value: value }); - if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); - return ns; - }; - __webpack_require__.n = function(module) { - var getter = module && module.__esModule ? - function getDefault() { return module['default']; } : - function getModuleExports() { return module; }; - __webpack_require__.d(getter, 'a', getter); - return getter; - }; - __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; - __webpack_require__.p = ""; - return __webpack_require__(__webpack_require__.s = 40); - }) - ([ - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){"use strict";function a(t,e){this.isUndef(t)||1===t?this.input=this.context.createGain():1Returns the Audio Context for this sketch. Useful for users - * who would like to dig deeper into the Web Audio API - * .

            - * - *

            Some browsers require users to startAudioContext - * with a user gesture, such as touchStarted in the example below.

            - * - * @for p5 - * @method getAudioContext - * @return {Object} AudioContext for this sketch - * @example - *
            - * function draw() { - * background(255); - * textAlign(CENTER); - * - * if (getAudioContext().state !== 'running') { - * text('click to start audio', width/2, height/2); - * } else { - * text('audio is enabled', width/2, height/2); - * } - * } - * - * function touchStarted() { - * if (getAudioContext().state !== 'running') { - * getAudioContext().resume(); - * } - * var synth = new p5.MonoSynth(); - * synth.play('A4', 0.5, 0, 0.2); - * } - * - *
            - */ - -function getAudioContext() { - return audiocontext; -} -/** - *

            It is not only a good practice to give users control over starting - * audio. This policy is enforced by many web browsers, including iOS and - * Google Chrome, which create the Web Audio API's - * Audio Context - * in a suspended state.

            - * - *

            In these browser-specific policies, sound will not play until a user - * interaction event (i.e. mousePressed()) explicitly resumes - * the AudioContext, or starts an audio node. This can be accomplished by - * calling start() on a p5.Oscillator, - * play() on a p5.SoundFile, or simply - * userStartAudio().

            - * - *

            userStartAudio() starts the AudioContext on a user - * gesture. The default behavior will enable audio on any - * mouseUp or touchEnd event. It can also be placed in a specific - * interaction function, such as mousePressed() as in the - * example below. This method utilizes - * StartAudioContext - * , a library by Yotam Mann (MIT Licence, 2016).

            - * @param {Element|Array} [elements] This argument can be an Element, - * Selector String, NodeList, p5.Element, - * jQuery Element, or an Array of any of those. - * @param {Function} [callback] Callback to invoke when the AudioContext - * has started - * @return {Promise} Returns a Promise that resolves when - * the AudioContext state is 'running' - * @method userStartAudio - * @for p5 - * @example - *
            - * function setup() { - * // mimics the autoplay policy - * getAudioContext().suspend(); - * - * let mySynth = new p5.MonoSynth(); - * - * // This won't play until the context has resumed - * mySynth.play('A6'); - * } - * function draw() { - * background(220); - * textAlign(CENTER, CENTER); - * text(getAudioContext().state, width/2, height/2); - * } - * function mousePressed() { - * userStartAudio(); - * } - *
            - */ - -function userStartAudio(elements, callback) { - var elt = elements; - - if (elements instanceof p5.Element) { - elt = elements.elt; - } else if (elements instanceof Array && elements[0] instanceof p5.Element) { - elt = elements.map(function (e) { - return e.elt; - }); - } - - return startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default()(audiocontext, elt, callback); -} - __webpack_exports__["a"] = (audiocontext); -}.call(this, __webpack_require__(26))) - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(2),__webpack_require__(10)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(i){"use strict";return i.Add=function(t){this.createInsOuts(2,0),this._sum=this.input[0]=this.input[1]=this.output=new i.Gain,this._param=this.input[1]=new i.Signal(t),this._param.connect(this._sum)},i.extend(i.Add,i.Signal),i.Add.prototype.dispose=function(){return i.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this._param.dispose(),this._param=null,this},i.Add}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports) { - -module.exports = { - recorderProcessor: 'recorder-processor', - soundFileProcessor: 'sound-file-processor', - amplitudeProcessor: 'amplitude-processor' -}; - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(15)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){"use strict";return e.WaveShaper=function(e,t){this._shaper=this.input=this.output=this.context.createWaveShaper(),this._curve=null,Array.isArray(e)?this.curve=e:isFinite(e)||this.isUndef(e)?this._curve=new Float32Array(this.defaultArg(e,1024)):this.isFunction(e)&&(this._curve=new Float32Array(this.defaultArg(t,1024)),this.setMap(e))},e.extend(e.WaveShaper,e.SignalBase),e.WaveShaper.prototype.setMap=function(e){for(var t=0,r=this._curve.length;te)this.cancelScheduledValues(e),this.linearRampToValueAtTime(t,e);else{var n=this._searchAfter(e);n&&(this.cancelScheduledValues(e),n.type===o.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(t,e):n.type===o.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(t,e)),this.setValueAtTime(t,e)}return this},o.TimelineSignal.prototype.linearRampToValueBetween=function(e,t,i){return this.setRampPoint(t),this.linearRampToValueAtTime(e,i),this},o.TimelineSignal.prototype.exponentialRampToValueBetween=function(e,t,i){return this.setRampPoint(t),this.exponentialRampToValueAtTime(e,i),this},o.TimelineSignal.prototype._searchBefore=function(e){return this._events.get(e)},o.TimelineSignal.prototype._searchAfter=function(e){return this._events.getAfter(e)},o.TimelineSignal.prototype.getValueAtTime=function(e){e=this.toSeconds(e);var t=this._searchAfter(e),i=this._searchBefore(e),n=this._initial;if(null===i)n=this._initial;else if(i.type===o.TimelineSignal.Type.Target){var a,l=this._events.getBefore(i.time);a=null===l?this._initial:l.value,n=this._exponentialApproach(i.time,a,i.value,i.constant,e)}else n=i.type===o.TimelineSignal.Type.Curve?this._curveInterpolate(i.time,i.value,i.duration,e):null===t?i.value:t.type===o.TimelineSignal.Type.Linear?this._linearInterpolate(i.time,i.value,t.time,t.value,e):t.type===o.TimelineSignal.Type.Exponential?this._exponentialInterpolate(i.time,i.value,t.time,t.value,e):i.value;return n},o.TimelineSignal.prototype.connect=o.SignalBase.prototype.connect,o.TimelineSignal.prototype._exponentialApproach=function(e,t,i,n,a){return i+(t-i)*Math.exp(-(a-e)/n)},o.TimelineSignal.prototype._linearInterpolate=function(e,t,i,n,a){return t+(a-e)/(i-e)*(n-t)},o.TimelineSignal.prototype._exponentialInterpolate=function(e,t,i,n,a){return(t=Math.max(this._minOutput,t))*Math.pow(n/t,(a-e)/(i-e))},o.TimelineSignal.prototype._curveInterpolate=function(e,t,i,n){var a=t.length;if(e+i<=n)return t[a-1];if(n<=e)return t[0];var l=(n-e)/i,s=Math.floor((a-1)*l),r=Math.ceil((a-1)*l),o=t[s],p=t[r];return r===s?o:this._linearInterpolate(s,o,r,p,l*(a-1))},o.TimelineSignal.prototype.dispose=function(){o.Signal.prototype.dispose.call(this),o.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},o.TimelineSignal}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(4),__webpack_require__(1),__webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(i){"use strict";return i.Scale=function(t,e){this._outputMin=this.defaultArg(t,0),this._outputMax=this.defaultArg(e,1),this._scale=this.input=new i.Multiply(1),this._add=this.output=new i.Add(0),this._scale.connect(this._add),this._setRange()},i.extend(i.Scale,i.SignalBase),Object.defineProperty(i.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(i.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),i.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},i.Scale.prototype.dispose=function(){return i.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},i.Scale}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(16),__webpack_require__(30),__webpack_require__(31),__webpack_require__(12)], __WEBPACK_AMD_DEFINE_RESULT__ = (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}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(18),__webpack_require__(9)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(i){"use strict";return window.GainNode&&!AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),i.Gain=function(){var t=this.optionsObject(arguments,["gain","units"],i.Gain.defaults);this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new i.Param({param:this._gainNode.gain,units:t.units,value:t.gain,convert:t.convert}),this._readOnly("gain")},i.extend(i.Gain),i.Gain.defaults={gain:1,convert:!0},i.Gain.prototype.dispose=function(){i.Param.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},i.prototype.createInsOuts=function(t,n){1===t?this.input=new i.Gain:1this._nextTick&&this._state;){var e=this._state.getValueAtTime(this._nextTick);if(e!==this._lastState){this._lastState=e;var i=this._state.get(this._nextTick);e===o.State.Started?(this._nextTick=i.time,this.isUndef(i.offset)||(this.ticks=i.offset),this.emit("start",i.time,this.ticks)):e===o.State.Stopped?(this.ticks=0,this.emit("stop",i.time)):e===o.State.Paused&&this.emit("pause",i.time)}var s=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),e===o.State.Started&&(this.callback(s),this.ticks++))}},o.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},o.Clock.prototype.dispose=function(){o.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},o.Clock}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(14)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(o){function t(e,t,n){if(e.input)Array.isArray(e.input)?(o.prototype.isUndef(n)&&(n=0),this.connect(e.input[n])):this.connect(e.input,t,n);else try{e instanceof AudioNode?i.call(this,e,t,n):i.call(this,e,t)}catch(t){throw new Error("error connecting to node: "+e+"\n"+t)}}var i,r;return!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),o.Context=function(t){for(var e in o.Emitter.call(this),t=t||new window.AudioContext,this._context=t,this._context)this._defineProperty(this._context,e);this._latencyHint="interactive",this._lookAhead=.1,this._updateInterval=this._lookAhead/3,this._computedUpdateInterval=0,this._worker=this._createWorker(),this._constants={}},o.extend(o.Context,o.Emitter),o.Emitter.mixin(o.Context),o.Context.prototype._defineProperty=function(e,n){this.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},o.Context.prototype.now=function(){return this._context.currentTime},o.Context.prototype._createWorker=function(){window.URL=window.URL||window.webkitURL;var t=new Blob(["var timeoutTime = "+(1e3*this._updateInterval).toFixed(1)+";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();"]),e=URL.createObjectURL(t),n=new Worker(e);return n.addEventListener("message",function(){this.emit("tick")}.bind(this)),n.addEventListener("message",function(){var t=this.now();if(this.isNumber(this._lastUpdate)){var e=t-this._lastUpdate;this._computedUpdateInterval=Math.max(e,.97*this._computedUpdateInterval)}this._lastUpdate=t}.bind(this)),n},o.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),o=0;othis.memory){var t=this.length-this.memory;this._timeline.splice(0,t)}return this},i.Timeline.prototype.remove=function(e){if(this._iterating)this._toRemove.push(e);else{var i=this._timeline.indexOf(e);-1!==i&&this._timeline.splice(i,1)}return this},i.Timeline.prototype.get=function(e){var i=this._search(e);return-1!==i?this._timeline[i]:null},i.Timeline.prototype.peek=function(){return this._timeline[0]},i.Timeline.prototype.shift=function(){return this._timeline.shift()},i.Timeline.prototype.getAfter=function(e){var i=this._search(e);return i+1=e&&(this._timeline=[]);return this},i.Timeline.prototype.cancelBefore=function(e){if(this._timeline.length){var i=this._search(e);0<=i&&(this._timeline=this._timeline.slice(i+1))}return this},i.Timeline.prototype._search=function(e){var i=0,t=this._timeline.length,n=t;if(0e)return r;s.time>e?n=r:s.time=e;)t--;return this._iterate(i,t+1),this},i.Timeline.prototype.forEachAtTime=function(i,t){var e=this._search(i);return-1!==e&&this._iterate(function(e){e.time===i&&t(e)},0,e),this},i.Timeline.prototype.dispose=function(){i.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},i.Timeline}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(1),__webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(t){"use strict";return t.Negate=function(){this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(2),__webpack_require__(1),__webpack_require__(6)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){"use strict";return e.GreaterThanZero=function(){this._thresh=this.output=new e.WaveShaper(function(e){return e<=0?0:1},127),this._scale=this.input=new e.Multiply(1e4),this._scale.connect(this._thresh)},e.extend(e.GreaterThanZero,e.SignalBase),e.GreaterThanZero.prototype.dispose=function(){return e.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},e.GreaterThanZero}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (t), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):undefined}(this,function(){var r=function(e,t){this._dragged=!1,this._element=e,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this,t),e.addEventListener("touchstart",this._bindedEnd),e.addEventListener("touchmove",this._bindedMove),e.addEventListener("touchend",this._bindedEnd),e.addEventListener("mouseup",this._bindedEnd)};function o(e){return"running"===e.state}return r.prototype._moved=function(e){this._dragged=!0},r.prototype._ended=function(e){this._dragged||function(e){var t=e.createBuffer(1,1,e.sampleRate),n=e.createBufferSource();n.buffer=t,n.connect(e.destination),n.start(0),e.resume&&e.resume()}(e),this._dragged=!1},r.prototype.dispose=function(){this._element.removeEventListener("touchstart",this._bindedEnd),this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},function(t,e,n){var i=new Promise(function(e){!function(t,n){o(t)?n():function e(){o(t)?n():(requestAnimationFrame(e),t.resume&&t.resume())}()}(t,e)}),d=[];return function e(t,n,i){if(Array.isArray(t)||NodeList&&t instanceof NodeList)for(var d=0;d= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: \"pull\",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: \"framesAvailable\",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}[\"default\"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === 'start') {\n _this.record(data.duration);\n } else if (data.name === 'stop') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: \"process\",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: \"record\",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: 'buffers',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: \"getBuffers\",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: \"mergeBuffers\",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);"); - - }), - (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); - __webpack_exports__["default"] = ("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they're available as values at compile time\nvar processorNames = {\n \"recorderProcessor\": \"recorder-processor\",\n \"soundFileProcessor\": \"sound-file-processor\",\n \"amplitudeProcessor\": \"amplitude-processor\"\n};\nvar RingBuffer = {\n \"default\":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: \"push\",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: \"pull\",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: \"framesAvailable\",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}[\"default\"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: \"process\",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: 'position',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);"); - - }), - (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); - __webpack_exports__["default"] = ("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they're available as values at compile time\nvar processorNames = {\n \"recorderProcessor\": \"recorder-processor\",\n \"soundFileProcessor\": \"sound-file-processor\",\n \"amplitudeProcessor\": \"amplitude-processor\"\n};\nvar RingBuffer = {\n \"default\":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: \"push\",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: \"pull\",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: \"framesAvailable\",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}[\"default\"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === 'toggleNormalize') {\n _this.normalize = data.normalize;\n } else if (data.name === 'smoothing') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: \"process\",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: 'amplitude',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);"); - - }), - (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(17)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(o){o.Frequency=function(e,t){if(!(this instanceof o.Frequency))return new o.Frequency(e,t);o.TimeBase.call(this,e,t)},o.extend(o.Frequency,o.TimeBase),o.Frequency.prototype._primaryExpressions=Object.create(o.TimeBase.prototype._primaryExpressions),o.Frequency.prototype._primaryExpressions.midi={regexp:/^(\d+(?:\.\d+)?midi)/,method:function(e){return this.midiToFrequency(e)}},o.Frequency.prototype._primaryExpressions.note={regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(e,t){var r=n[e.toLowerCase()]+12*(parseInt(t)+1);return this.midiToFrequency(r)}},o.Frequency.prototype._primaryExpressions.tr={regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(e,t,r){var n=1;return e&&"0"!==e&&(n*=this._beatsToUnits(this._timeSignature()*parseFloat(e))),t&&"0"!==t&&(n*=this._beatsToUnits(parseFloat(t))),r&&"0"!==r&&(n*=this._beatsToUnits(parseFloat(r)/4)),n}},o.Frequency.prototype.transpose=function(e){return this._expr=function(e,t){return e()*this.intervalToFrequencyRatio(t)}.bind(this,this._expr,e),this},o.Frequency.prototype.harmonize=function(e){return this._expr=function(e,t){for(var r=e(),n=[],o=0;oScale the output of all sound in this sketch

            - * Scaled between 0.0 (silence) and 1.0 (full volume). - * 1.0 is the maximum amplitude of a digital sound, so multiplying - * by greater than 1.0 may cause digital distortion. To - * fade, provide a rampTime parameter. For more - * complex fades, see the Envelope class. - * - * Alternately, you can pass in a signal source such as an - * oscillator to modulate the amplitude with an audio signal. - * - *

            How This Works: When you load the p5.sound module, it - * creates a single instance of p5sound. All sound objects in this - * module output to p5sound before reaching your computer's output. - * So if you change the amplitude of p5sound, it impacts all of the - * sound in this module.

            - * - *

            If no value is provided, returns a Web Audio API Gain Node

            - * - * @method outputVolume - * @param {Number|Object} volume Volume (amplitude) between 0.0 - * and 1.0 or modulating signal/oscillator - * @param {Number} [rampTime] Fade for t seconds - * @param {Number} [timeFromNow] Schedule this event to happen at - * t seconds in the future - */ - - -p5.prototype.outputVolume = function (vol) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - if (typeof vol === 'number') { - var now = p5sound.audiocontext.currentTime; - var currentVol = p5sound.output.gain.value; - p5sound.output.gain.cancelScheduledValues(now + tFromNow); - p5sound.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); - p5sound.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); - } else if (vol) { - vol.connect(p5sound.output.gain); - } else { - return p5sound.output.gain; - } -}; -/** - * `p5.soundOut` is the p5.sound final output bus. It sends output to - * the destination of this window's web audio context. It contains - * Web Audio API nodes including a dyanmicsCompressor (.limiter), - * and Gain Nodes for .input and .output. - * - * @property {Object} soundOut - */ - - -p5.prototype.soundOut = p5.soundOut = p5sound; - -p5.soundOut._silentNode = p5sound.audiocontext.createGain(); -p5.soundOut._silentNode.gain.value = 0; - -p5.soundOut._silentNode.connect(p5sound.audiocontext.destination); - - var main = (p5sound); -var processorNames = __webpack_require__(5); -var processorNames_default = __webpack_require__.n(processorNames); - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - - -/** - * @for p5 - */ - -/** - * Returns a number representing the sample rate, in samples per second, - * of all sound objects in this audio context. It is determined by the - * sampling rate of your operating system's sound card, and it is not - * currently possile to change. - * It is often 44100, or twice the range of human hearing. - * - * @method sampleRate - * @return {Number} samplerate samples per second - */ - -function sampleRate() { - return main.audiocontext.sampleRate; -} -/** - * Returns the closest MIDI note value for - * a given frequency. - * - * @method freqToMidi - * @param {Number} frequency A freqeuncy, for example, the "A" - * above Middle C is 440Hz - * @return {Number} MIDI note value - */ - - -function freqToMidi(f) { - var mathlog2 = Math.log(f / 440) / Math.log(2); - var m = Math.round(12 * mathlog2) + 69; - return m; -} -/** - * Returns the frequency value of a MIDI note value. - * General MIDI treats notes as integers where middle C - * is 60, C# is 61, D is 62 etc. Useful for generating - * musical frequencies with oscillators. - * - * @method midiToFreq - * @param {Number} midiNote The number of a MIDI note - * @return {Number} Frequency value of the given MIDI note - * @example - *
            - * let midiNotes = [60, 64, 67, 72]; - * let noteIndex = 0; - * let midiVal, freq; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(startSound); - * osc = new p5.TriOsc(); - * env = new p5.Envelope(); - * } - * - * function draw() { - * background(220); - * text('tap to play', 10, 20); - * if (midiVal) { - * text('MIDI: ' + midiVal, 10, 40); - * text('Freq: ' + freq, 10, 60); - * } - * } - * - * function startSound() { - * // see also: userStartAudio(); - * osc.start(); - * - * midiVal = midiNotes[noteIndex % midiNotes.length]; - * freq = midiToFreq(midiVal); - * osc.freq(freq); - * env.ramp(osc, 0, 1.0, 0); - * - * noteIndex++; - * } - *
            - */ - - -function midiToFreq(m) { - return 440 * Math.pow(2, (m - 69) / 12.0); -} - - -function noteToFreq(note) { - if (typeof note !== 'string') { - return note; - } - - var wholeNotes = { - A: 21, - B: 23, - C: 24, - D: 26, - E: 28, - F: 29, - G: 31 - }; - var value = wholeNotes[note[0].toUpperCase()]; - var octave = ~~note.slice(-1); - value += 12 * (octave - 1); - - switch (note[1]) { - case '#': - value += 1; - break; - - case 'b': - value -= 1; - break; - - default: - break; - } - - return midiToFreq(value); -} -/** - * List the SoundFile formats that you will include. LoadSound - * will search your directory for these extensions, and will pick - * a format that is compatable with the client's web browser. - * Here is a free online file - * converter. - * - * @method soundFormats - * @param {String} [...formats] i.e. 'mp3', 'wav', 'ogg' - * @example - *
            - * function preload() { - * // set the global sound formats - * soundFormats('mp3', 'ogg'); - * - * // load either beatbox.mp3, or .ogg, depending on browser - * mySound = loadSound('assets/beatbox.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * text('sound loaded! tap to play', 10, 20, width - 20); - * cnv.mousePressed(function() { - * mySound.play(); - * }); - * } - *
            - */ - - -function soundFormats() { - main.extensions = []; - - for (var i = 0; i < arguments.length; i++) { - arguments[i] = arguments[i].toLowerCase(); - - if (['mp3', 'wav', 'ogg', 'm4a', 'aac'].indexOf(arguments[i]) > -1) { - main.extensions.push(arguments[i]); - } else { - throw arguments[i] + ' is not a valid sound format!'; - } - } -} - -function disposeSound() { - for (var i = 0; i < main.soundArray.length; i++) { - main.soundArray[i].dispose(); - } -} - -function _checkFileFormats(paths) { - var path; - - if (typeof paths === 'string') { - path = paths; - - var extTest = path.split('.').pop(); - - if (['mp3', 'wav', 'ogg', 'm4a', 'aac'].indexOf(extTest) > -1) { - if (!p5.prototype.isFileSupported(extTest)) { - var pathSplit = path.split('.'); - var pathCore = pathSplit[pathSplit.length - 1]; - - for (var _i = 0; _i < main.extensions.length; _i++) { - var _extension = main.extensions[_i]; - - var _supported = p5.prototype.isFileSupported(_extension); - - if (_supported) { - pathCore = ''; - - if (pathSplit.length === 2) { - pathCore += pathSplit[0]; - } - - for (var _i2 = 1; _i2 <= pathSplit.length - 2; _i2++) { - var p = pathSplit[_i2]; - pathCore += '.' + p; - } - - path = pathCore += '.'; - path = path += _extension; - break; - } - } - } - } - else { - for (var _i3 = 0; _i3 < main.extensions.length; _i3++) { - var _extension2 = main.extensions[_i3]; - - var _supported2 = p5.prototype.isFileSupported(_extension2); - - if (_supported2) { - path = path + '.' + _extension2; - break; - } - } - } - } - else if (_typeof(paths) === 'object') { - for (var i = 0; i < paths.length; i++) { - var extension = paths[i].split('.').pop(); - var supported = p5.prototype.isFileSupported(extension); - - if (supported) { - path = paths[i]; - break; - } - } - } - - return path; -} -/** - * Used by Osc and Envelope to chain signal math - */ - - -function _mathChain(o, math, thisChain, nextChain, type) { - for (var i in o.mathOps) { - if (o.mathOps[i] instanceof type) { - o.mathOps[i].dispose(); - thisChain = i; - - if (thisChain < o.mathOps.length - 1) { - nextChain = o.mathOps[i + 1]; - } - } - } - - o.mathOps[thisChain - 1].disconnect(); - o.mathOps[thisChain - 1].connect(math); - math.connect(nextChain); - o.mathOps[thisChain] = math; - return o; -} - - -function convertToWav(audioBuffer) { - var leftChannel, rightChannel; - leftChannel = audioBuffer.getChannelData(0); - - if (audioBuffer.numberOfChannels > 1) { - rightChannel = audioBuffer.getChannelData(1); - } else { - rightChannel = leftChannel; - } - - var interleaved = interleave(leftChannel, rightChannel); - - var buffer = new window.ArrayBuffer(44 + interleaved.length * 2); - var view = new window.DataView(buffer); - - writeUTFBytes(view, 0, 'RIFF'); - view.setUint32(4, 36 + interleaved.length * 2, true); - writeUTFBytes(view, 8, 'WAVE'); - - writeUTFBytes(view, 12, 'fmt '); - view.setUint32(16, 16, true); - view.setUint16(20, 1, true); - - view.setUint16(22, 2, true); - view.setUint32(24, main.audiocontext.sampleRate, true); - view.setUint32(28, main.audiocontext.sampleRate * 4, true); - view.setUint16(32, 4, true); - view.setUint16(34, 16, true); - - writeUTFBytes(view, 36, 'data'); - view.setUint32(40, interleaved.length * 2, true); - - var lng = interleaved.length; - var index = 44; - var volume = 1; - - for (var i = 0; i < lng; i++) { - view.setInt16(index, interleaved[i] * (0x7fff * volume), true); - index += 2; - } - - return view; -} - - -function interleave(leftChannel, rightChannel) { - var length = leftChannel.length + rightChannel.length; - var result = new Float32Array(length); - var inputIndex = 0; - - for (var index = 0; index < length;) { - result[index++] = leftChannel[inputIndex]; - result[index++] = rightChannel[inputIndex]; - inputIndex++; - } - - return result; -} - -function writeUTFBytes(view, offset, string) { - var lng = string.length; - - for (var i = 0; i < lng; i++) { - view.setUint8(offset + i, string.charCodeAt(i)); - } -} - -function safeBufferSize(idealBufferSize) { - var bufferSize = idealBufferSize; - - var tempAudioWorkletNode = new AudioWorkletNode(main.audiocontext, processorNames_default.a.soundFileProcessor); - - if (tempAudioWorkletNode instanceof ScriptProcessorNode) { - bufferSize = tempAudioWorkletNode.bufferSize; - } - - tempAudioWorkletNode.disconnect(); - tempAudioWorkletNode = null; - return bufferSize; -} -/** - * Save a p5.SoundFile as a .wav file. The browser will prompt the user - * to download the file to their device. - * For uploading audio to a server, use - * `p5.SoundFile.saveBlob`. - * - * @for p5 - * @method saveSound - * @param {p5.SoundFile} soundFile p5.SoundFile that you wish to save - * @param {String} fileName name of the resulting .wav file. - */ - - -function saveSound(soundFile, fileName) { - var dataView = convertToWav(soundFile.buffer); - p5.prototype.writeFile([dataView], fileName, 'wav'); -} - - -var CustomError = function CustomError(name, errorTrace, failedPath) { - var err = new Error(); - var tempStack, splitStack; - err.name = name; - err.originalStack = err.stack + errorTrace; - tempStack = err.stack + errorTrace; - err.failedPath = failedPath; - - splitStack = tempStack.split('\n').filter(function (ln) { - return !ln.match(/(p5.|native code|globalInit)/g); - }); - err.stack = splitStack.join('\n'); - return err; -}; - - var errorHandler = (CustomError); - -var moduleSources = [__webpack_require__(27)["default"], __webpack_require__(28)["default"], __webpack_require__(29)["default"]]; -var audioWorklet_ac = main.audiocontext; -var initializedAudioWorklets = false; - -function loadAudioWorkletModules() { - return Promise.all(moduleSources.map(function (moduleSrc) { - var blob = new Blob([moduleSrc], { - type: 'application/javascript' - }); - var objectURL = URL.createObjectURL(blob); - return audioWorklet_ac.audioWorklet.addModule(objectURL); - })); -} - -p5.prototype.registerMethod('init', function () { - if (initializedAudioWorklets) return; - - if (!this.preload && !window.preload) { - this.preload = function () {}; - } - - - this._incrementPreload(); - - var onWorkletModulesLoad = function () { - initializedAudioWorklets = true; - - this._decrementPreload(); - }.bind(this); - - loadAudioWorkletModules().then(onWorkletModulesLoad); -}); -function panner_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - -var panner_ac = main.audiocontext; -var panner; - -if (typeof panner_ac.createStereoPanner !== 'undefined') { - var Panner = - function () { - function Panner(input, output) { - panner_classCallCheck(this, Panner); - - this.stereoPanner = this.input = panner_ac.createStereoPanner(); - input.connect(this.stereoPanner); - this.stereoPanner.connect(output); - } - - _createClass(Panner, [{ - key: "pan", - value: function pan(val, tFromNow) { - var time = tFromNow || 0; - var t = panner_ac.currentTime + time; - this.stereoPanner.pan.linearRampToValueAtTime(val, t); - } - - }, { - key: "inputChannels", - value: function inputChannels() {} - }, { - key: "connect", - value: function connect(obj) { - this.stereoPanner.connect(obj); - } - }, { - key: "disconnect", - value: function disconnect() { - if (this.stereoPanner) { - this.stereoPanner.disconnect(); - } - } - }]); - - return Panner; - }(); - - panner = Panner; -} else { - var _Panner = - function () { - function _Panner(input, output, numInputChannels) { - panner_classCallCheck(this, _Panner); - - this.input = panner_ac.createGain(); - input.connect(this.input); - this.left = panner_ac.createGain(); - this.right = panner_ac.createGain(); - this.left.channelInterpretation = 'discrete'; - this.right.channelInterpretation = 'discrete'; - - if (numInputChannels > 1) { - this.splitter = panner_ac.createChannelSplitter(2); - this.input.connect(this.splitter); - this.splitter.connect(this.left, 1); - this.splitter.connect(this.right, 0); - } else { - this.input.connect(this.left); - this.input.connect(this.right); - } - - this.output = panner_ac.createChannelMerger(2); - this.left.connect(this.output, 0, 1); - this.right.connect(this.output, 0, 0); - this.output.connect(output); - } - - - _createClass(_Panner, [{ - key: "pan", - value: function pan(val, tFromNow) { - var time = tFromNow || 0; - var t = panner_ac.currentTime + time; - var v = (val + 1) / 2; - var rightVal = Math.cos(v * Math.PI / 2); - var leftVal = Math.sin(v * Math.PI / 2); - this.left.gain.linearRampToValueAtTime(leftVal, t); - this.right.gain.linearRampToValueAtTime(rightVal, t); - } - }, { - key: "inputChannels", - value: function inputChannels(numChannels) { - if (numChannels === 1) { - this.input.disconnect(); - this.input.connect(this.left); - this.input.connect(this.right); - } else if (numChannels === 2) { - if (typeof this.splitter === 'undefined') { - this.splitter = panner_ac.createChannelSplitter(2); - } - - this.input.disconnect(); - this.input.connect(this.splitter); - this.splitter.connect(this.left, 1); - this.splitter.connect(this.right, 0); - } - } - }, { - key: "connect", - value: function connect(obj) { - this.output.connect(obj); - } - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - } - }]); - - return _Panner; - }(); - - panner = _Panner; -} - - var panner_0 = (panner); -function soundfile_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { soundfile_typeof = function _typeof(obj) { return typeof obj; }; } else { soundfile_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return soundfile_typeof(obj); } - -function soundfile_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function soundfile_createClass(Constructor, protoProps, staticProps) { if (protoProps) soundfile_defineProperties(Constructor.prototype, protoProps); if (staticProps) soundfile_defineProperties(Constructor, staticProps); return Constructor; } - -function soundfile_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - - - - -var soundfile_ac = main.audiocontext; - -var _createCounterBuffer = function _createCounterBuffer(buffer) { - var len = buffer.length; - var audioBuf = soundfile_ac.createBuffer(1, buffer.length, soundfile_ac.sampleRate); - var arrayBuffer = audioBuf.getChannelData(0); - - for (var index = 0; index < len; index++) { - arrayBuffer[index] = index; - } - - return audioBuf; -}; - - -var Cue = function Cue(callback, time, id, val) { - soundfile_classCallCheck(this, Cue); - - this.callback = callback; - this.time = time; - this.id = id; - this.val = val; -}; - - -function _clearOnEnd(e) { - var thisBufferSourceNode = e.target; - var soundFile = this; - - thisBufferSourceNode._playing = false; - thisBufferSourceNode.removeEventListener('ended', soundFile._clearOnEnd); - - soundFile._onended(soundFile); - - - soundFile.bufferSourceNodes.map(function (_, i) { - return i; - }).reverse().forEach(function (i) { - var n = soundFile.bufferSourceNodes[i]; - - if (n._playing === false) { - soundFile.bufferSourceNodes.splice(i, 1); - } - }); - - if (soundFile.bufferSourceNodes.length === 0) { - soundFile._playing = false; - } -} -/** - *

            SoundFile object with a path to a file.

            - * - *

            The p5.SoundFile may not be available immediately because - * it loads the file information asynchronously.

            - * - *

            To do something with the sound as soon as it loads - * pass the name of a function as the second parameter.

            - * - *

            Only one file path is required. However, audio file formats - * (i.e. mp3, ogg, wav and m4a/aac) are not supported by all - * web browsers. If you want to ensure compatability, instead of a single - * file path, you may include an Array of filepaths, and the browser will - * choose a format that works.

            - * - * @class p5.SoundFile - * @constructor - * @param {String|Array} path path to a sound file (String). Optionally, - * you may include multiple file formats in - * an array. Alternately, accepts an object - * from the HTML5 File API, or a p5.File. - * @param {Function} [successCallback] Name of a function to call once file loads - * @param {Function} [errorCallback] Name of a function to call if file fails to - * load. This function will receive an error or - * XMLHttpRequest object with information - * about what went wrong. - * @param {Function} [whileLoadingCallback] Name of a function to call while file - * is loading. That function will - * receive progress of the request to - * load the sound file - * (between 0 and 1) as its first - * parameter. This progress - * does not account for the additional - * time needed to decode the audio data. - * - * @example - *
            - * let mySound; - * function preload() { - * soundFormats('mp3', 'ogg'); - * mySound = loadSound('assets/doorbell'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap here to play', 10, 20); - * } - * - * function canvasPressed() { - * // playing a sound file on a user gesture - * // is equivalent to `userStartAudio()` - * mySound.play(); - * } - *
            - */ - - -var soundfile_SoundFile = -function () { - function SoundFile(paths, onload, onerror, whileLoading) { - soundfile_classCallCheck(this, SoundFile); - - if (typeof paths !== 'undefined') { - if (typeof paths === 'string' || typeof paths[0] === 'string') { - var path = p5.prototype._checkFileFormats(paths); - - this.url = path; - } else if (soundfile_typeof(paths) === 'object') { - if (!(window.File && window.FileReader && window.FileList && window.Blob)) { - throw 'Unable to load file because the File API is not supported'; - } - } - - - if (paths.file) { - paths = paths.file; - } - - this.file = paths; - } - - - this._onended = function () {}; - - this._looping = false; - this._playing = false; - this._paused = false; - this._pauseTime = 0; - - this._cues = []; - this._cueIDCounter = 0; - - this._lastPos = 0; - this._counterNode = null; - this._workletNode = null; - - this.bufferSourceNodes = []; - - this.bufferSourceNode = null; - this.buffer = null; - this.playbackRate = 1; - this.input = main.audiocontext.createGain(); - this.output = main.audiocontext.createGain(); - this.reversed = false; - - this.startTime = 0; - this.endTime = null; - this.pauseTime = 0; - - this.mode = 'sustain'; - - this.startMillis = null; - - this.panPosition = 0.0; - this.panner = new panner_0(this.output, main.input, 2); - - if (this.url || this.file) { - this.load(onload, onerror); - } - - - main.soundArray.push(this); - - if (typeof whileLoading === 'function') { - this._whileLoading = whileLoading; - } else { - this._whileLoading = function () {}; - } - - this._clearOnEnd = _clearOnEnd.bind(this); - - this.amp = this.setVolume; - - this.fade = this.setVolume; - } - /** - * This is a helper function that the p5.SoundFile calls to load - * itself. Accepts a callback (the name of another function) - * as an optional parameter. - * - * @private - * @for p5.SoundFile - * @param {Function} [successCallback] Name of a function to call once file loads - * @param {Function} [errorCallback] Name of a function to call if there is an error - */ - - - soundfile_createClass(SoundFile, [{ - key: "load", - value: function load(callback, errorCallback) { - var self = this; - var errorTrace = new Error().stack; - - if (this.url !== undefined && this.url !== '') { - var request = new XMLHttpRequest(); - request.addEventListener('progress', function (evt) { - self._updateProgress(evt); - }, false); - request.open('GET', this.url, true); - request.responseType = 'arraybuffer'; - - request.onload = function () { - if (request.status === 200) { - if (!self.panner) return; - soundfile_ac.decodeAudioData(request.response, - function (buff) { - if (!self.panner) return; - self.buffer = buff; - self.panner.inputChannels(buff.numberOfChannels); - - if (callback) { - callback(self); - } - }, - function () { - if (!self.panner) return; - var err = new errorHandler('decodeAudioData', errorTrace, self.url); - var msg = 'AudioContext error at decodeAudioData for ' + self.url; - - if (errorCallback) { - err.msg = msg; - errorCallback(err); - } else { - console.error(msg + '\n The error stack trace includes: \n' + err.stack); - } - }); - } - else { - if (!self.panner) return; - var err = new errorHandler('loadSound', errorTrace, self.url); - var msg = 'Unable to load ' + self.url + '. The request status was: ' + request.status + ' (' + request.statusText + ')'; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error(msg + '\n The error stack trace includes: \n' + err.stack); - } - } - }; - - - request.onerror = function () { - var err = new errorHandler('loadSound', errorTrace, self.url); - var msg = 'There was no response from the server at ' + self.url + '. Check the url and internet connectivity.'; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error(msg + '\n The error stack trace includes: \n' + err.stack); - } - }; - - request.send(); - } else if (this.file !== undefined) { - var reader = new FileReader(); - - reader.onload = function () { - if (!self.panner) return; - soundfile_ac.decodeAudioData(reader.result, function (buff) { - if (!self.panner) return; - self.buffer = buff; - self.panner.inputChannels(buff.numberOfChannels); - - if (callback) { - callback(self); - } - }); - }; - - reader.onerror = function (e) { - if (!self.panner) return; - - if (onerror) { - onerror(e); - } - }; - - reader.readAsArrayBuffer(this.file); - } - } - - }, { - key: "_updateProgress", - value: function _updateProgress(evt) { - if (evt.lengthComputable) { - var percentComplete = evt.loaded / evt.total * 0.99; - - this._whileLoading(percentComplete, evt); - - } else { - this._whileLoading('size unknown'); - } - } - /** - * Returns true if the sound file finished loading successfully. - * - * @method isLoaded - * @for p5.SoundFile - * @return {Boolean} - */ - - }, { - key: "isLoaded", - value: function isLoaded() { - if (this.buffer) { - return true; - } else { - return false; - } - } - /** - * Play the p5.SoundFile - * - * @method play - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule playback to start (in seconds from now). - * @param {Number} [rate] (optional) playback rate - * @param {Number} [amp] (optional) amplitude (volume) - * of playback - * @param {Number} [cueStart] (optional) cue start time in seconds - * @param {Number} [duration] (optional) duration of playback in seconds - */ - - }, { - key: "play", - value: function play(startTime, rate, amp, _cueStart, duration) { - if (!this.output) { - console.warn('SoundFile.play() called after dispose'); - return; - } - - var now = main.audiocontext.currentTime; - var cueStart, cueEnd; - var time = startTime || 0; - - if (time < 0) { - time = 0; - } - - time = time + now; - - if (typeof rate !== 'undefined') { - this.rate(rate); - } - - if (typeof amp !== 'undefined') { - this.setVolume(amp); - } - - - if (this.buffer) { - this._pauseTime = 0; - - if (this.mode === 'restart' && this.buffer && this.bufferSourceNode) { - this.bufferSourceNode.stop(time); - - this._counterNode.stop(time); - } - - - if (this.mode === 'untildone' && this.isPlaying()) { - return; - } - - - this.bufferSourceNode = this._initSourceNode(); - - delete this._counterNode; - this._counterNode = this._initCounterNode(); - - if (_cueStart) { - if (_cueStart >= 0 && _cueStart < this.buffer.duration) { - cueStart = _cueStart; - } else { - throw 'start time out of range'; - } - } else { - cueStart = 0; - } - - if (duration) { - duration = duration <= this.buffer.duration - cueStart ? duration : this.buffer.duration; - } - - - if (this._paused) { - this.bufferSourceNode.start(time, this.pauseTime, duration); - - this._counterNode.start(time, this.pauseTime, duration); - } else { - this.bufferSourceNode.start(time, cueStart, duration); - - this._counterNode.start(time, cueStart, duration); - } - - this._playing = true; - this._paused = false; - - this.bufferSourceNodes.push(this.bufferSourceNode); - this.bufferSourceNode._arrayIndex = this.bufferSourceNodes.length - 1; - this.bufferSourceNode.addEventListener('ended', this._clearOnEnd); - } - else { - throw 'not ready to play file, buffer has yet to load. Try preload()'; - } - - - this.bufferSourceNode.loop = this._looping; - this._counterNode.loop = this._looping; - - if (this._looping === true) { - cueEnd = duration ? duration : cueStart - 0.000000000000001; - this.bufferSourceNode.loopStart = cueStart; - this.bufferSourceNode.loopEnd = cueEnd; - this._counterNode.loopStart = cueStart; - this._counterNode.loopEnd = cueEnd; - } - } - /** - * p5.SoundFile has two play modes: restart and - * sustain. Play Mode determines what happens to a - * p5.SoundFile if it is triggered while in the middle of playback. - * In sustain mode, playback will continue simultaneous to the - * new playback. In restart mode, play() will stop playback - * and start over. With untilDone, a sound will play only if it's - * not already playing. Sustain is the default mode. - * - * @method playMode - * @for p5.SoundFile - * @param {String} str 'restart' or 'sustain' or 'untilDone' - * @example - *
            - * let mySound; - * function preload(){ - * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * noFill(); - * rect(0, height/2, width - 1, height/2 - 1); - * rect(0, 0, width - 1, height/2); - * textAlign(CENTER, CENTER); - * fill(20); - * text('restart', width/2, 1 * height/4); - * text('sustain', width/2, 3 * height/4); - * } - * function canvasPressed() { - * if (mouseX < height/2) { - * mySound.playMode('restart'); - * } else { - * mySound.playMode('sustain'); - * } - * mySound.play(); - * } - * - *
            - */ - - }, { - key: "playMode", - value: function playMode(str) { - var s = str.toLowerCase(); - - if (s === 'restart' && this.buffer && this.bufferSourceNode) { - for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { - var now = main.audiocontext.currentTime; - this.bufferSourceNodes[i].stop(now); - } - } - - - if (s === 'restart' || s === 'sustain' || s === 'untildone') { - this.mode = s; - } else { - throw 'Invalid play mode. Must be either "restart" or "sustain"'; - } - } - /** - * Pauses a file that is currently playing. If the file is not - * playing, then nothing will happen. - * - * After pausing, .play() will resume from the paused - * position. - * If p5.SoundFile had been set to loop before it was paused, - * it will continue to loop after it is unpaused with .play(). - * - * @method pause - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule event to occur - * seconds from now - * @example - *
            - * let soundFile; - * function preload() { - * soundFormats('ogg', 'mp3'); - * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play, release to pause', 10, 20, width - 20); - * } - * function canvasPressed() { - * soundFile.loop(); - * background(0, 200, 50); - * } - * function mouseReleased() { - * soundFile.pause(); - * background(220); - * } - * - *
            - */ - - }, { - key: "pause", - value: function pause(startTime) { - var now = main.audiocontext.currentTime; - var time = startTime || 0; - var pTime = time + now; - - if (this.isPlaying() && this.buffer && this.bufferSourceNode) { - this._paused = true; - this._playing = false; - this.pauseTime = this.currentTime(); - this.bufferSourceNode.stop(pTime); - - this._counterNode.stop(pTime); - - this._pauseTime = this.currentTime(); - } else { - this._pauseTime = 0; - } - } - /** - * Loop the p5.SoundFile. Accepts optional parameters to set the - * playback rate, playback volume, loopStart, loopEnd. - * - * @method loop - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule event to occur - * seconds from now - * @param {Number} [rate] (optional) playback rate - * @param {Number} [amp] (optional) playback volume - * @param {Number} [cueLoopStart] (optional) startTime in seconds - * @param {Number} [duration] (optional) loop duration in seconds - * @example - *
            - * let soundFile; - * let loopStart = 0.5; - * let loopDuration = 0.2; - * function preload() { - * soundFormats('ogg', 'mp3'); - * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play, release to pause', 10, 20, width - 20); - * } - * function canvasPressed() { - * soundFile.loop(); - * background(0, 200, 50); - * } - * function mouseReleased() { - * soundFile.pause(); - * background(220); - * } - * - *
            - */ - - }, { - key: "loop", - value: function loop(startTime, rate, amp, loopStart, duration) { - this._looping = true; - this.play(startTime, rate, amp, loopStart, duration); - } - /** - * Set a p5.SoundFile's looping flag to true or false. If the sound - * is currently playing, this change will take effect when it - * reaches the end of the current playback. - * - * @method setLoop - * @for p5.SoundFile - * @param {Boolean} Boolean set looping to true or false - */ - - }, { - key: "setLoop", - value: function setLoop(bool) { - if (bool === true) { - this._looping = true; - } else if (bool === false) { - this._looping = false; - } else { - throw 'Error: setLoop accepts either true or false'; - } - - if (this.bufferSourceNode) { - this.bufferSourceNode.loop = this._looping; - this._counterNode.loop = this._looping; - } - } - /** - * Returns 'true' if a p5.SoundFile is currently looping and playing, 'false' if not. - * - * @method isLooping - * @for p5.SoundFile - * @return {Boolean} - */ - - }, { - key: "isLooping", - value: function isLooping() { - if (!this.bufferSourceNode) { - return false; - } - - if (this._looping === true && this.isPlaying() === true) { - return true; - } - - return false; - } - /** - * Returns true if a p5.SoundFile is playing, false if not (i.e. - * paused or stopped). - * - * @method isPlaying - * @for p5.SoundFile - * @return {Boolean} - */ - - }, { - key: "isPlaying", - value: function isPlaying() { - return this._playing; - } - /** - * Returns true if a p5.SoundFile is paused, false if not (i.e. - * playing or stopped). - * - * @method isPaused - * @for p5.SoundFile - * @return {Boolean} - */ - - }, { - key: "isPaused", - value: function isPaused() { - return this._paused; - } - /** - * Stop soundfile playback. - * - * @method stop - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule event to occur - * in seconds from now - */ - - }, { - key: "stop", - value: function stop(timeFromNow) { - var time = timeFromNow || 0; - - if (this.mode === 'sustain' || this.mode === 'untildone') { - this.stopAll(time); - this._playing = false; - this.pauseTime = 0; - this._paused = false; - } else if (this.buffer && this.bufferSourceNode) { - var now = main.audiocontext.currentTime; - var t = time || 0; - this.pauseTime = 0; - this.bufferSourceNode.stop(now + t); - - this._counterNode.stop(now + t); - - this._playing = false; - this._paused = false; - } - } - /** - * Stop playback on all of this soundfile's sources. - * @private - */ - - }, { - key: "stopAll", - value: function stopAll(_time) { - var now = main.audiocontext.currentTime; - var time = _time || 0; - - if (this.buffer && this.bufferSourceNode) { - for (var i in this.bufferSourceNodes) { - var bufferSourceNode = this.bufferSourceNodes[i]; - - if (bufferSourceNode) { - try { - bufferSourceNode.stop(now + time); - } catch (e) { - } - } - } - - this._counterNode.stop(now + time); - } - } - }, { - key: "getVolume", - value: function getVolume() { - return this.output.gain.value; - } - /** - * Set the stereo panning of a p5.sound object to - * a floating point number between -1.0 (left) and 1.0 (right). - * Default is 0.0 (center). - * - * @method pan - * @for p5.SoundFile - * @param {Number} [panValue] Set the stereo panner - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @example - *
            - * let ballX = 0; - * let soundFile; - * - * function preload() { - * soundFormats('ogg', 'mp3'); - * soundFile = loadSound('assets/beatbox.mp3'); - * } - * - * function draw() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * ballX = constrain(mouseX, 0, width); - * ellipse(ballX, height/2, 20, 20); - * } - * - * function canvasPressed(){ - * // map the ball's x location to a panning degree - * // between -1.0 (left) and 1.0 (right) - * let panning = map(ballX, 0., width,-1.0, 1.0); - * soundFile.pan(panning); - * soundFile.play(); - * } - *
            - */ - - }, { - key: "pan", - value: function pan(pval, tFromNow) { - this.panPosition = pval; - this.panner.pan(pval, tFromNow); - } - /** - * Returns the current stereo pan position (-1.0 to 1.0) - * - * @method getPan - * @for p5.SoundFile - * @return {Number} Returns the stereo pan setting of the Oscillator - * as a number between -1.0 (left) and 1.0 (right). - * 0.0 is center and default. - */ - - }, { - key: "getPan", - value: function getPan() { - return this.panPosition; - } - /** - * Set the playback rate of a sound file. Will change the speed and the pitch. - * Values less than zero will reverse the audio buffer. - * - * @method rate - * @for p5.SoundFile - * @param {Number} [playbackRate] Set the playback rate. 1.0 is normal, - * .5 is half-speed, 2.0 is twice as fast. - * Values less than zero play backwards. - * @example - *
            - * let mySound; - * - * function preload() { - * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * } - * function canvasPressed() { - * mySound.loop(); - * } - * function mouseReleased() { - * mySound.pause(); - * } - * function draw() { - * background(220); - * - * // Set the rate to a range between 0.1 and 4 - * // Changing the rate also alters the pitch - * let playbackRate = map(mouseY, 0.1, height, 2, 0); - * playbackRate = constrain(playbackRate, 0.01, 4); - * mySound.rate(playbackRate); - * - * line(0, mouseY, width, mouseY); - * text('rate: ' + round(playbackRate * 100) + '%', 10, 20); - * } - * - * - *
            - * - */ - - }, { - key: "rate", - value: function rate(playbackRate) { - var reverse = false; - - if (typeof playbackRate === 'undefined') { - return this.playbackRate; - } - - this.playbackRate = playbackRate; - - if (playbackRate === 0) { - playbackRate = 0.0000000000001; - } else if (playbackRate < 0 && !this.reversed) { - playbackRate = Math.abs(playbackRate); - reverse = true; - } else if (playbackRate > 0 && this.reversed) { - reverse = true; - } - - if (this.bufferSourceNode) { - var now = main.audiocontext.currentTime; - this.bufferSourceNode.playbackRate.cancelScheduledValues(now); - this.bufferSourceNode.playbackRate.linearRampToValueAtTime(Math.abs(playbackRate), now); - - this._counterNode.playbackRate.cancelScheduledValues(now); - - this._counterNode.playbackRate.linearRampToValueAtTime(Math.abs(playbackRate), now); - } - - if (reverse) { - this.reverseBuffer(); - } - - return this.playbackRate; - } - - }, { - key: "setPitch", - value: function setPitch(num) { - var newPlaybackRate = midiToFreq(num) / midiToFreq(60); - this.rate(newPlaybackRate); - } - }, { - key: "getPlaybackRate", - value: function getPlaybackRate() { - return this.playbackRate; - } - /** - * Multiply the output volume (amplitude) of a sound file - * between 0.0 (silence) and 1.0 (full volume). - * 1.0 is the maximum amplitude of a digital sound, so multiplying - * by greater than 1.0 may cause digital distortion. To - * fade, provide a rampTime parameter. For more - * complex fades, see the Envelope class. - * - * Alternately, you can pass in a signal source such as an - * oscillator to modulate the amplitude with an audio signal. - * - * @method setVolume - * @for p5.SoundFile - * @param {Number|Object} volume Volume (amplitude) between 0.0 - * and 1.0 or modulating signal/oscillator - * @param {Number} [rampTime] Fade for t seconds - * @param {Number} [timeFromNow] Schedule this event to happen at - * t seconds in the future - */ - - }, { - key: "setVolume", - value: function setVolume(vol, _rampTime, _tFromNow) { - if (typeof vol === 'number') { - var rampTime = _rampTime || 0; - var tFromNow = _tFromNow || 0; - var now = main.audiocontext.currentTime; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(now + tFromNow); - this.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); - this.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); - } else if (vol) { - vol.connect(this.output.gain); - } else { - return this.output.gain; - } - } - /** - * Returns the duration of a sound file in seconds. - * - * @method duration - * @for p5.SoundFile - * @return {Number} The duration of the soundFile in seconds. - */ - - }, { - key: "duration", - value: function duration() { - if (this.buffer) { - return this.buffer.duration; - } else { - return 0; - } - } - /** - * Return the current position of the p5.SoundFile playhead, in seconds. - * Time is relative to the normal buffer direction, so if `reverseBuffer` - * has been called, currentTime will count backwards. - * - * @method currentTime - * @for p5.SoundFile - * @return {Number} currentTime of the soundFile in seconds. - */ - - }, { - key: "currentTime", - value: function currentTime() { - return this.reversed ? Math.abs(this._lastPos - this.buffer.length) / soundfile_ac.sampleRate : this._lastPos / soundfile_ac.sampleRate; - } - /** - * Move the playhead of a soundfile that is currently playing to a - * new position and a new duration, in seconds. - * If none are given, will reset the file to play entire duration - * from start to finish. To set the position of a soundfile that is - * not currently playing, use the `play` or `loop` methods. - * - * @method jump - * @for p5.SoundFile - * @param {Number} cueTime cueTime of the soundFile in seconds. - * @param {Number} duration duration in seconds. - */ - - }, { - key: "jump", - value: function jump(cueTime, duration) { - if (cueTime < 0 || cueTime > this.buffer.duration) { - throw 'jump time out of range'; - } - - if (duration > this.buffer.duration - cueTime) { - throw 'end time out of range'; - } - - var cTime = cueTime || 0; - var dur = duration || undefined; - - if (this.isPlaying()) { - this.stop(0); - this.play(0, this.playbackRate, this.output.gain.value, cTime, dur); - } - } - /** - * Return the number of channels in a sound file. - * For example, Mono = 1, Stereo = 2. - * - * @method channels - * @for p5.SoundFile - * @return {Number} [channels] - */ - - }, { - key: "channels", - value: function channels() { - return this.buffer.numberOfChannels; - } - /** - * Return the sample rate of the sound file. - * - * @method sampleRate - * @for p5.SoundFile - * @return {Number} [sampleRate] - */ - - }, { - key: "sampleRate", - value: function sampleRate() { - return this.buffer.sampleRate; - } - /** - * Return the number of samples in a sound file. - * Equal to sampleRate * duration. - * - * @method frames - * @for p5.SoundFile - * @return {Number} [sampleCount] - */ - - }, { - key: "frames", - value: function frames() { - return this.buffer.length; - } - /** - * Returns an array of amplitude peaks in a p5.SoundFile that can be - * used to draw a static waveform. Scans through the p5.SoundFile's - * audio buffer to find the greatest amplitudes. Accepts one - * parameter, 'length', which determines size of the array. - * Larger arrays result in more precise waveform visualizations. - * - * Inspired by Wavesurfer.js. - * - * @method getPeaks - * @for p5.SoundFile - * @params {Number} [length] length is the size of the returned array. - * Larger length results in more precision. - * Defaults to 5*width of the browser window. - * @returns {Float32Array} Array of peaks. - */ - - }, { - key: "getPeaks", - value: function getPeaks(length) { - if (this.buffer) { - if (!length) { - length = window.width * 5; - } - - if (this.buffer) { - var buffer = this.buffer; - var sampleSize = buffer.length / length; - var sampleStep = ~~(sampleSize / 10) || 1; - var channels = buffer.numberOfChannels; - var peaks = new Float32Array(Math.round(length)); - - for (var c = 0; c < channels; c++) { - var chan = buffer.getChannelData(c); - - for (var i = 0; i < length; i++) { - var start = ~~(i * sampleSize); - var end = ~~(start + sampleSize); - var max = 0; - - for (var j = start; j < end; j += sampleStep) { - var value = chan[j]; - - if (value > max) { - max = value; - } else if (-value > max) { - max = value; - } - } - - if (c === 0 || Math.abs(max) > peaks[i]) { - peaks[i] = max; - } - } - } - - return peaks; - } - } else { - throw 'Cannot load peaks yet, buffer is not loaded'; - } - } - /** - * Reverses the p5.SoundFile's buffer source. - * Playback must be handled separately (see example). - * - * @method reverseBuffer - * @for p5.SoundFile - * @example - *
            - * let drum; - * function preload() { - * drum = loadSound('assets/drum.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function canvasPressed() { - * drum.stop(); - * drum.reverseBuffer(); - * drum.play(); - * } - * - *
            - */ - - }, { - key: "reverseBuffer", - value: function reverseBuffer() { - if (this.buffer) { - var currentPos = this._lastPos / soundfile_ac.sampleRate; - var curVol = this.getVolume(); - this.setVolume(0, 0.001); - var numChannels = this.buffer.numberOfChannels; - - for (var i = 0; i < numChannels; i++) { - this.buffer.getChannelData(i).reverse(); - } - - - this.reversed = !this.reversed; - - if (this.isPlaying() && currentPos) { - this.jump(this.duration() - currentPos); - } - - this.setVolume(curVol, 0.001); - } else { - throw 'SoundFile is not done loading'; - } - } - /** - * Schedule an event to be called when the soundfile - * reaches the end of a buffer. If the soundfile is - * playing through once, this will be called when it - * ends. If it is looping, it will be called when - * stop is called. - * - * @method onended - * @for p5.SoundFile - * @param {Function} callback function to call when the - * soundfile has ended. - */ - - }, { - key: "onended", - value: function onended(callback) { - this._onended = callback; - return this; - } - }, { - key: "add", - value: function add() { - } - }, { - key: "dispose", - value: function dispose() { - var now = main.audiocontext.currentTime; - - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.stop(now); - - if (this.buffer && this.bufferSourceNode) { - for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { - if (this.bufferSourceNodes[i] !== null) { - this.bufferSourceNodes[i].disconnect(); - - try { - this.bufferSourceNodes[i].stop(now); - } catch (e) { - console.warn('no buffer source node to dispose'); - } - - this.bufferSourceNodes[i] = null; - } - } - - if (this.isPlaying()) { - try { - this._counterNode.stop(now); - } catch (e) { - console.log(e); - } - - this._counterNode = null; - } - } - - if (this.output) { - this.output.disconnect(); - this.output = null; - } - - if (this.panner) { - this.panner.disconnect(); - this.panner = null; - } - } - /** - * Connects the output of a p5sound object to input of another - * p5.sound object. For example, you may connect a p5.SoundFile to an - * FFT or an Effect. If no parameter is given, it will connect to - * the main output. Most p5sound objects connect to the master - * output when they are created. - * - * @method connect - * @for p5.SoundFile - * @param {Object} [object] Audio object that accepts an input - */ - - }, { - key: "connect", - value: function connect(unit) { - if (!unit) { - this.panner.connect(main.input); - } else { - if (unit.hasOwnProperty('input')) { - this.panner.connect(unit.input); - } else { - this.panner.connect(unit); - } - } - } - /** - * Disconnects the output of this p5sound object. - * - * @method disconnect - * @for p5.SoundFile - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.panner) { - this.panner.disconnect(); - } - } - /** - */ - - }, { - key: "getLevel", - value: function getLevel() { - console.warn('p5.SoundFile.getLevel has been removed from the library. Use p5.Amplitude instead'); - } - /** - * Reset the source for this SoundFile to a - * new path (URL). - * - * @method setPath - * @for p5.SoundFile - * @param {String} path path to audio file - * @param {Function} callback Callback - */ - - }, { - key: "setPath", - value: function setPath(p, callback) { - var path = p5.prototype._checkFileFormats(p); - - this.url = path; - this.load(callback); - } - /** - * Replace the current Audio Buffer with a new Buffer. - * - * @method setBuffer - * @for p5.SoundFile - * @param {Array} buf Array of Float32 Array(s). 2 Float32 Arrays - * will create a stereo source. 1 will create - * a mono source. - */ - - }, { - key: "setBuffer", - value: function setBuffer(buf) { - var numChannels = buf.length; - var size = buf[0].length; - var newBuffer = soundfile_ac.createBuffer(numChannels, size, soundfile_ac.sampleRate); - - if (!(buf[0] instanceof Float32Array)) { - buf[0] = new Float32Array(buf[0]); - } - - for (var channelNum = 0; channelNum < numChannels; channelNum++) { - var channel = newBuffer.getChannelData(channelNum); - channel.set(buf[channelNum]); - } - - this.buffer = newBuffer; - - this.panner.inputChannels(numChannels); - } - - }, { - key: "_initCounterNode", - value: function _initCounterNode() { - var _this = this; - - var self = this; - var now = soundfile_ac.currentTime; - var cNode = soundfile_ac.createBufferSource(); - var workletBufferSize = safeBufferSize(256); - - if (self._workletNode) { - self._workletNode.disconnect(); - - delete self._workletNode; - } - - self._workletNode = new AudioWorkletNode(soundfile_ac, processorNames_default.a.soundFileProcessor, { - processorOptions: { - bufferSize: workletBufferSize - } - }); - - self._workletNode.port.onmessage = function (event) { - if (event.data.name === 'position') { - if (event.data.position === 0) { - return; - } - - _this._lastPos = event.data.position; - - _this._onTimeUpdate(self._lastPos); - } - }; - - - cNode.buffer = _createCounterBuffer(self.buffer); - cNode.playbackRate.setValueAtTime(self.playbackRate, now); - cNode.connect(self._workletNode); - - self._workletNode.connect(p5.soundOut._silentNode); - - return cNode; - } - - }, { - key: "_initSourceNode", - value: function _initSourceNode() { - var bufferSourceNode = soundfile_ac.createBufferSource(); - bufferSourceNode.buffer = this.buffer; - bufferSourceNode.playbackRate.value = this.playbackRate; - bufferSourceNode.connect(this.output); - return bufferSourceNode; - } - }, { - key: "processPeaks", - value: function processPeaks(callback, _initThreshold, _minThreshold, _minPeaks) { - console.warn('processPeaks is deprecated'); - } - /** - * Schedule events to trigger every time a MediaElement - * (audio/video) reaches a playback cue point. - * - * Accepts a callback function, a time (in seconds) at which to trigger - * the callback, and an optional parameter for the callback. - * - * Time will be passed as the first parameter to the callback function, - * and param will be the second parameter. - * - * - * @method addCue - * @for p5.SoundFile - * @param {Number} time Time in seconds, relative to this media - * element's playback. For example, to trigger - * an event every time playback reaches two - * seconds, pass in the number 2. This will be - * passed as the first parameter to - * the callback function. - * @param {Function} callback Name of a function that will be - * called at the given time. The callback will - * receive time and (optionally) param as its - * two parameters. - * @param {Object} [value] An object to be passed as the - * second parameter to the - * callback function. - * @return {Number} id ID of this cue, - * useful for removeCue(id) - * @example - *
            - * let mySound; - * function preload() { - * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play', 10, 20); - * - * // schedule calls to changeText - * mySound.addCue(0, changeText, "hello" ); - * mySound.addCue(0.5, changeText, "hello," ); - * mySound.addCue(1, changeText, "hello, p5!"); - * mySound.addCue(1.5, changeText, "hello, p5!!"); - * mySound.addCue(2, changeText, "hello, p5!!!!!"); - * } - * - * function changeText(val) { - * background(220); - * text(val, 10, 20); - * } - * - * function canvasPressed() { - * mySound.play(); - * } - *
            - */ - - }, { - key: "addCue", - value: function addCue(time, callback, val) { - var id = this._cueIDCounter++; - var cue = new Cue(callback, time, id, val); - - this._cues.push(cue); - - - return id; - } - /** - * Remove a callback based on its ID. The ID is returned by the - * addCue method. - * - * @method removeCue - * @for p5.SoundFile - * @param {Number} id ID of the cue, as returned by addCue - */ - - }, { - key: "removeCue", - value: function removeCue(id) { - var cueLength = this._cues.length; - - for (var i = 0; i < cueLength; i++) { - var cue = this._cues[i]; - - if (cue.id === id) { - this._cues.splice(i, 1); - - break; - } - } - - if (this._cues.length === 0) { - } - } - /** - * Remove all of the callbacks that had originally been scheduled - * via the addCue method. - * - * @method clearCues - */ - - }, { - key: "clearCues", - value: function clearCues() { - this._cues = []; - } - - }, { - key: "_onTimeUpdate", - value: function _onTimeUpdate(position) { - var playbackTime = position / this.buffer.sampleRate; - var cueLength = this._cues.length; - - for (var i = 0; i < cueLength; i++) { - var cue = this._cues[i]; - var callbackTime = cue.time; - var val = cue.val; - var leftLimit = this._prevUpdateTime || 0; - var rightLimit = playbackTime; - - if (leftLimit <= callbackTime && callbackTime <= rightLimit) { - cue.callback(val); - } - } - - this._prevUpdateTime = playbackTime; - } - /** - * Save a p5.SoundFile as a .wav file. The browser will prompt the user - * to download the file to their device. To upload a file to a server, see - * getBlob - * - * @method save - * @for p5.SoundFile - * @param {String} [fileName] name of the resulting .wav file. - * @example - *
            - * let mySound; - * function preload() { - * mySound = loadSound('assets/doorbell.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to download', 10, 20); - * } - * - * function canvasPressed() { - * mySound.save('my cool filename'); - * } - *
            - */ - - }, { - key: "save", - value: function save(fileName) { - p5.prototype.saveSound(this, fileName, 'wav'); - } - /** - * This method is useful for sending a SoundFile to a server. It returns the - * .wav-encoded audio data as a "Blob". - * A Blob is a file-like data object that can be uploaded to a server - * with an http request. We'll - * use the `httpDo` options object to send a POST request with some - * specific options: we encode the request as `multipart/form-data`, - * and attach the blob as one of the form values using `FormData`. - * - * - * @method getBlob - * @for p5.SoundFile - * @returns {Blob} A file-like data object - * @example - *
            - * function preload() { - * mySound = loadSound('assets/doorbell.mp3'); - * } - * - * function setup() { - * noCanvas(); - * let soundBlob = mySound.getBlob(); - * - * // Now we can send the blob to a server... - * let serverUrl = 'https://jsonplaceholder.typicode.com/posts'; - * let httpRequestOptions = { - * method: 'POST', - * body: new FormData().append('soundBlob', soundBlob), - * headers: new Headers({ - * 'Content-Type': 'multipart/form-data' - * }) - * }; - * httpDo(serverUrl, httpRequestOptions); - * - * // We can also create an `ObjectURL` pointing to the Blob - * let blobUrl = URL.createObjectURL(soundBlob); - * - * // The `
            - */ - - }, { - key: "getBlob", - value: function getBlob() { - var dataView = convertToWav(this.buffer); - return new Blob([dataView], { - type: 'audio/wav' - }); - } - }]); - - return SoundFile; -}(); -/** - * loadSound() returns a new p5.SoundFile from a specified - * path. If called during preload(), the p5.SoundFile will be ready - * to play in time for setup() and draw(). If called outside of - * preload, the p5.SoundFile will not be ready immediately, so - * loadSound accepts a callback as the second parameter. Using a - * - * local server is recommended when loading external files. - * - * @method loadSound - * @for p5 - * @param {String|Array} path Path to the sound file, or an array with - * paths to soundfiles in multiple formats - * i.e. ['sound.ogg', 'sound.mp3']. - * Alternately, accepts an object: either - * from the HTML5 File API, or a p5.File. - * @param {Function} [successCallback] Name of a function to call once file loads - * @param {Function} [errorCallback] Name of a function to call if there is - * an error loading the file. - * @param {Function} [whileLoading] Name of a function to call while file is loading. - * This function will receive the percentage loaded - * so far, from 0.0 to 1.0. - * @return {SoundFile} Returns a p5.SoundFile - * @example - *
            - * let mySound; - * function preload() { - * soundFormats('mp3', 'ogg'); - * mySound = loadSound('assets/doorbell'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap here to play', 10, 20); - * } - * - * function canvasPressed() { - * // playing a sound file on a user gesture - * // is equivalent to `userStartAudio()` - * mySound.play(); - * } - *
            - */ - - -function loadSound(path, callback, onerror, whileLoading) { - if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { - window.alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); - } - - var self = this; - var s = new soundfile_SoundFile(path, function () { - if (typeof callback === 'function') { - callback.apply(self, arguments); - } - - if (typeof self._decrementPreload === 'function') { - self._decrementPreload(); - } - }, onerror, whileLoading); - return s; -} - - var soundfile = (soundfile_SoundFile); - -function amplitude_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function amplitude_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function amplitude_createClass(Constructor, protoProps, staticProps) { if (protoProps) amplitude_defineProperties(Constructor.prototype, protoProps); if (staticProps) amplitude_defineProperties(Constructor, staticProps); return Constructor; } - - - - -/** - * Amplitude measures volume between 0.0 and 1.0. - * Listens to all p5sound by default, or use setInput() - * to listen to a specific sound source. Accepts an optional - * smoothing value, which defaults to 0. - * - * @class p5.Amplitude - * @constructor - * @param {Number} [smoothing] between 0.0 and .999 to smooth - * amplitude readings (defaults to 0) - * @example - *
            - * let sound, amplitude; - * - * function preload(){ - * sound = loadSound('assets/beat.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100,100); - * cnv.mouseClicked(togglePlay); - * amplitude = new p5.Amplitude(); - * } - * - * function draw() { - * background(220); - * text('tap to play', 20, 20); - * - * let level = amplitude.getLevel(); - * let size = map(level, 0, 1, 0, 200); - * ellipse(width/2, height/2, size, size); - * } - * - * function togglePlay() { - * if (sound.isPlaying() ){ - * sound.pause(); - * } else { - * sound.loop(); - * amplitude = new p5.Amplitude(); - * amplitude.setInput(sound); - * } - * } - * - *
            - */ - -var amplitude_Amplitude = -function () { - function Amplitude(smoothing) { - amplitude_classCallCheck(this, Amplitude); - - this.bufferSize = safeBufferSize(2048); - - this.audiocontext = main.audiocontext; - this._workletNode = new AudioWorkletNode(this.audiocontext, processorNames_default.a.amplitudeProcessor, { - outputChannelCount: [1], - parameterData: { - smoothing: smoothing || 0 - }, - processorOptions: { - normalize: false, - smoothing: smoothing || 0, - numInputChannels: 2, - bufferSize: this.bufferSize - } - }); - - this._workletNode.port.onmessage = function (event) { - if (event.data.name === 'amplitude') { - this.volume = event.data.volume; - this.volNorm = event.data.volNorm; - this.stereoVol = event.data.stereoVol; - this.stereoVolNorm = event.data.stereoVolNorm; - } - }.bind(this); - - - this.input = this._workletNode; - this.output = this.audiocontext.createGain(); - - this.volume = 0; - this.volNorm = 0; - this.stereoVol = [0, 0]; - this.stereoVolNorm = [0, 0]; - this.normalize = false; - - this._workletNode.connect(this.output); - - this.output.gain.value = 0; - - this.output.connect(this.audiocontext.destination); - - main.meter.connect(this._workletNode); - - main.soundArray.push(this); - } - /** - * Connects to the p5sound instance (main output) by default. - * Optionally, you can pass in a specific source (i.e. a soundfile). - * - * @method setInput - * @for p5.Amplitude - * @param {soundObject|undefined} [snd] set the sound source - * (optional, defaults to - * main output) - * @param {Number|undefined} [smoothing] a range between 0.0 and 1.0 - * to smooth amplitude readings - * @example - *
            - * function preload(){ - * sound1 = loadSound('assets/beat.mp3'); - * sound2 = loadSound('assets/drum.mp3'); - * } - * function setup(){ - * cnv = createCanvas(100, 100); - * cnv.mouseClicked(toggleSound); - * - * amplitude = new p5.Amplitude(); - * amplitude.setInput(sound2); - * } - * - * function draw() { - * background(220); - * text('tap to play', 20, 20); - * - * let level = amplitude.getLevel(); - * let size = map(level, 0, 1, 0, 200); - * ellipse(width/2, height/2, size, size); - * } - * - * function toggleSound(){ - * if (sound1.isPlaying() && sound2.isPlaying()) { - * sound1.stop(); - * sound2.stop(); - * } else { - * sound1.play(); - * sound2.play(); - * } - * } - *
            - */ - - - amplitude_createClass(Amplitude, [{ - key: "setInput", - value: function setInput(source, smoothing) { - main.meter.disconnect(); - - if (smoothing) { - this._workletNode.parameters.get('smoothing').value = smoothing; - } - - - if (source == null) { - console.log('Amplitude input source is not ready! Connecting to main output instead'); - main.meter.connect(this._workletNode); - } - else if (source) { - source.connect(this._workletNode); - - this._workletNode.disconnect(); - - this._workletNode.connect(this.output); - } - else { - main.meter.connect(this._workletNode); - } - } - }, { - key: "connect", - value: function connect(unit) { - if (unit) { - if (unit.hasOwnProperty('input')) { - this.output.connect(unit.input); - } else { - this.output.connect(unit); - } - } else { - this.output.connect(this.panner.connect(main.input)); - } - } - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - } - /** - * Returns a single Amplitude reading at the moment it is called. - * For continuous readings, run in the draw loop. - * - * @method getLevel - * @for p5.Amplitude - * @param {Number} [channel] Optionally return only channel 0 (left) or 1 (right) - * @return {Number} Amplitude as a number between 0.0 and 1.0 - * @example - *
            - * function preload(){ - * sound = loadSound('assets/beat.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mouseClicked(toggleSound); - * amplitude = new p5.Amplitude(); - * } - * - * function draw() { - * background(220, 150); - * textAlign(CENTER); - * text('tap to play', width/2, 20); - * - * let level = amplitude.getLevel(); - * let size = map(level, 0, 1, 0, 200); - * ellipse(width/2, height/2, size, size); - * } - * - * function toggleSound(){ - * if (sound.isPlaying()) { - * sound.stop(); - * } else { - * sound.play(); - * } - * } - *
            - */ - - }, { - key: "getLevel", - value: function getLevel(channel) { - if (typeof channel !== 'undefined') { - if (this.normalize) { - return this.stereoVolNorm[channel]; - } else { - return this.stereoVol[channel]; - } - } else if (this.normalize) { - return this.volNorm; - } else { - return this.volume; - } - } - /** - * Determines whether the results of Amplitude.process() will be - * Normalized. To normalize, Amplitude finds the difference the - * loudest reading it has processed and the maximum amplitude of - * 1.0. Amplitude adds this difference to all values to produce - * results that will reliably map between 0.0 and 1.0. However, - * if a louder moment occurs, the amount that Normalize adds to - * all the values will change. Accepts an optional boolean parameter - * (true or false). Normalizing is off by default. - * - * @method toggleNormalize - * @for p5.Amplitude - * @param {boolean} [boolean] set normalize to true (1) or false (0) - */ - - }, { - key: "toggleNormalize", - value: function toggleNormalize(bool) { - if (typeof bool === 'boolean') { - this.normalize = bool; - } else { - this.normalize = !this.normalize; - } - - this._workletNode.port.postMessage({ - name: 'toggleNormalize', - normalize: this.normalize - }); - } - /** - * Smooth Amplitude analysis by averaging with the last analysis - * frame. Off by default. - * - * @method smooth - * @for p5.Amplitude - * @param {Number} set smoothing from 0.0 <= 1 - */ - - }, { - key: "smooth", - value: function smooth(s) { - if (s >= 0 && s < 1) { - this._workletNode.port.postMessage({ - name: 'smoothing', - smoothing: s - }); - } else { - console.log('Error: smoothing must be between 0 and 1'); - } - } - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.input) { - this.input.disconnect(); - delete this.input; - } - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - - this._workletNode.disconnect(); - - delete this._workletNode; - } - }]); - - return Amplitude; -}(); - - var amplitude = (amplitude_Amplitude); -function fft_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function fft_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function fft_createClass(Constructor, protoProps, staticProps) { if (protoProps) fft_defineProperties(Constructor.prototype, protoProps); if (staticProps) fft_defineProperties(Constructor, staticProps); return Constructor; } - - -/** - *

            FFT (Fast Fourier Transform) is an analysis algorithm that - * isolates individual - * - * audio frequencies within a waveform.

            - * - *

            Once instantiated, a p5.FFT object can return an array based on - * two types of analyses:
            FFT.waveform() computes - * amplitude values along the time domain. The array indices correspond - * to samples across a brief moment in time. Each value represents - * amplitude of the waveform at that sample of time.
            - * • FFT.analyze() computes amplitude values along the - * frequency domain. The array indices correspond to frequencies (i.e. - * pitches), from the lowest to the highest that humans can hear. Each - * value represents amplitude at that slice of the frequency spectrum. - * Use with getEnergy() to measure amplitude at specific - * frequencies, or within a range of frequencies.

            - * - *

            FFT analyzes a very short snapshot of sound called a sample - * buffer. It returns an array of amplitude measurements, referred - * to as bins. The array is 1024 bins long by default. - * You can change the bin array length, but it must be a power of 2 - * between 16 and 1024 in order for the FFT algorithm to function - * correctly. The actual size of the FFT buffer is twice the - * number of bins, so given a standard sample rate, the buffer is - * 2048/44100 seconds long.

            - * - * - * @class p5.FFT - * @constructor - * @param {Number} [smoothing] Smooth results of Freq Spectrum. - * 0.0 < smoothing < 1.0. - * Defaults to 0.8. - * @param {Number} [bins] Length of resulting array. - * Must be a power of two between - * 16 and 1024. Defaults to 1024. - * @example - *
            - * function preload(){ - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup(){ - * let cnv = createCanvas(100,100); - * cnv.mouseClicked(togglePlay); - * fft = new p5.FFT(); - * sound.amp(0.2); - * } - * - * function draw(){ - * background(220); - * - * let spectrum = fft.analyze(); - * noStroke(); - * fill(255, 0, 255); - * for (let i = 0; i< spectrum.length; i++){ - * let x = map(i, 0, spectrum.length, 0, width); - * let h = -height + map(spectrum[i], 0, 255, height, 0); - * rect(x, height, width / spectrum.length, h ) - * } - * - * let waveform = fft.waveform(); - * noFill(); - * beginShape(); - * stroke(20); - * for (let i = 0; i < waveform.length; i++){ - * let x = map(i, 0, waveform.length, 0, width); - * let y = map( waveform[i], -1, 1, 0, height); - * vertex(x,y); - * } - * endShape(); - * - * text('tap to play', 20, 20); - * } - * - * function togglePlay() { - * if (sound.isPlaying()) { - * sound.pause(); - * } else { - * sound.loop(); - * } - * } - *
            - */ - -var fft_FFT = -function () { - function FFT(smoothing, bins) { - fft_classCallCheck(this, FFT); - - this.input = this.analyser = main.audiocontext.createAnalyser(); - Object.defineProperties(this, { - bins: { - get: function get() { - return this.analyser.fftSize / 2; - }, - set: function set(b) { - this.analyser.fftSize = b * 2; - }, - configurable: true, - enumerable: true - }, - smoothing: { - get: function get() { - return this.analyser.smoothingTimeConstant; - }, - set: function set(s) { - this.analyser.smoothingTimeConstant = s; - }, - configurable: true, - enumerable: true - } - }); - - this.smooth(smoothing); - this.bins = bins || 1024; - - main.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, 14000]; - - main.soundArray.push(this); - } - /** - * Set the input source for the FFT analysis. If no source is - * provided, FFT will analyze all sound in the sketch. - * - * @method setInput - * @for p5.FFT - * @param {Object} [source] p5.sound object (or web audio API source node) - */ - - - fft_createClass(FFT, [{ - key: "setInput", - value: function setInput(source) { - if (!source) { - main.fftMeter.connect(this.analyser); - } else { - if (source.output) { - source.output.connect(this.analyser); - } else if (source.connect) { - source.connect(this.analyser); - } - - main.fftMeter.disconnect(); - } - } - /** - * Returns an array of amplitude values (between -1.0 and +1.0) that represent - * a snapshot of amplitude readings in a single buffer. Length will be - * equal to bins (defaults to 1024). Can be used to draw the waveform - * of a sound. - * - * @method waveform - * @for p5.FFT - * @param {Number} [bins] Must be a power of two between - * 16 and 1024. Defaults to 1024. - * @param {String} [precision] If any value is provided, will return results - * in a Float32 Array which is more precise - * than a regular array. - * @return {Array} Array Array of amplitude values (-1 to 1) - * over time. Array length = bins. - * - */ - - }, { - key: "waveform", - value: function waveform() { - var bins, mode; - var normalArray = new Array(); - - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] === 'number') { - bins = arguments[i]; - this.analyser.fftSize = bins * 2; - } - - if (typeof arguments[i] === 'string') { - mode = arguments[i]; - } - } - - - if (mode && !p5.prototype._isSafari()) { - timeToFloat(this, this.timeDomain); - this.analyser.getFloatTimeDomainData(this.timeDomain); - return this.timeDomain; - } else { - timeToInt(this, this.timeDomain); - this.analyser.getByteTimeDomainData(this.timeDomain); - - for (var j = 0; j < this.timeDomain.length; j++) { - var scaled = p5.prototype.map(this.timeDomain[j], 0, 255, -1, 1); - normalArray.push(scaled); - } - - return normalArray; - } - } - /** - * Returns an array of amplitude values (between 0 and 255) - * across the frequency spectrum. Length is equal to FFT bins - * (1024 by default). The array indices correspond to frequencies - * (i.e. pitches), from the lowest to the highest that humans can - * hear. Each value represents amplitude at that slice of the - * frequency spectrum. Must be called prior to using - * getEnergy(). - * - * @method analyze - * @for p5.FFT - * @param {Number} [bins] Must be a power of two between - * 16 and 1024. Defaults to 1024. - * @param {Number} [scale] If "dB," returns decibel - * float measurements between - * -140 and 0 (max). - * Otherwise returns integers from 0-255. - * @return {Array} spectrum Array of energy (amplitude/volume) - * values across the frequency spectrum. - * Lowest energy (silence) = 0, highest - * possible is 255. - * @example - *
            - * let osc, fft; - * - * function setup(){ - * let cnv = createCanvas(100,100); - * cnv.mousePressed(startSound); - * osc = new p5.Oscillator(); - * osc.amp(0); - * fft = new p5.FFT(); - * } - * - * function draw(){ - * background(220); - * - * let freq = map(mouseX, 0, windowWidth, 20, 10000); - * freq = constrain(freq, 1, 20000); - * osc.freq(freq); - * - * let spectrum = fft.analyze(); - * noStroke(); - * fill(255, 0, 255); - * for (let i = 0; i< spectrum.length; i++){ - * let x = map(i, 0, spectrum.length, 0, width); - * let h = -height + map(spectrum[i], 0, 255, height, 0); - * rect(x, height, width / spectrum.length, h ); - * } - * - * stroke(255); - * if (!osc.started) { - * text('tap here and drag to change frequency', 10, 20, width - 20); - * } else { - * text(round(freq)+'Hz', 10, 20); - * } - * } - * - * function startSound() { - * osc.start(); - * osc.amp(0.5, 0.2); - * } - * - * function mouseReleased() { - * osc.amp(0, 0.2); - * } - *
            - * - * - */ - - }, { - key: "analyze", - value: function analyze() { - var mode; - - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] === 'number') { - this.bins = arguments[i]; - this.analyser.fftSize = this.bins * 2; - } - - if (typeof arguments[i] === 'string') { - mode = arguments[i]; - } - } - - if (mode && mode.toLowerCase() === 'db') { - freqToFloat(this); - this.analyser.getFloatFrequencyData(this.freqDomain); - return this.freqDomain; - } else { - freqToInt(this, this.freqDomain); - this.analyser.getByteFrequencyData(this.freqDomain); - var normalArray = Array.apply([], this.freqDomain); - return normalArray; - } - } - /** - * Returns the amount of energy (volume) at a specific - * - * frequency, or the average amount of energy between two - * frequencies. Accepts Number(s) corresponding - * to frequency (in Hz), or a "string" corresponding to predefined - * frequency ranges ("bass", "lowMid", "mid", "highMid", "treble"). - * Returns a range between 0 (no energy/volume at that frequency) and - * 255 (maximum energy). - * NOTE: analyze() must be called prior to getEnergy(). analyze() - * tells the FFT to analyze frequency data, and getEnergy() uses - * the results to determine the value at a specific frequency or - * range of frequencies.

            - * - * @method getEnergy - * @for p5.FFT - * @param {Number|String} frequency1 Will return a value representing - * energy at this frequency. Alternately, - * the strings "bass", "lowMid" "mid", - * "highMid", and "treble" will return - * predefined frequency ranges. - * @param {Number} [frequency2] If a second frequency is given, - * will return average amount of - * energy that exists between the - * two frequencies. - * @return {Number} Energy Energy (volume/amplitude) from - * 0 and 255. - * - */ - - }, { - key: "getEnergy", - value: function getEnergy(frequency1, frequency2) { - var nyquist = main.audiocontext.sampleRate / 2; - - if (frequency1 === 'bass') { - frequency1 = this.bass[0]; - frequency2 = this.bass[1]; - } else if (frequency1 === 'lowMid') { - frequency1 = this.lowMid[0]; - frequency2 = this.lowMid[1]; - } else if (frequency1 === 'mid') { - frequency1 = this.mid[0]; - frequency2 = this.mid[1]; - } else if (frequency1 === 'highMid') { - frequency1 = this.highMid[0]; - frequency2 = this.highMid[1]; - } else if (frequency1 === 'treble') { - frequency1 = this.treble[0]; - frequency2 = this.treble[1]; - } - - if (typeof frequency1 !== 'number') { - throw 'invalid input for getEnergy()'; - } else if (!frequency2) { - var index = Math.round(frequency1 / nyquist * this.freqDomain.length); - return this.freqDomain[index]; - } else if (frequency1 && frequency2) { - if (frequency1 > frequency2) { - var swap = frequency2; - frequency2 = frequency1; - frequency1 = swap; - } - - var lowIndex = Math.round(frequency1 / nyquist * this.freqDomain.length); - var highIndex = Math.round(frequency2 / nyquist * this.freqDomain.length); - var total = 0; - var numFrequencies = 0; - - for (var i = lowIndex; i <= highIndex; i++) { - total += this.freqDomain[i]; - numFrequencies += 1; - } - - - var toReturn = total / numFrequencies; - return toReturn; - } else { - throw 'invalid input for getEnergy()'; - } - } - - }, { - key: "getFreq", - value: function getFreq(freq1, freq2) { - console.log('getFreq() is deprecated. Please use getEnergy() instead.'); - var x = this.getEnergy(freq1, freq2); - return x; - } - /** - * Returns the - * - * spectral centroid of the input signal. - * NOTE: analyze() must be called prior to getCentroid(). Analyze() - * tells the FFT to analyze frequency data, and getCentroid() uses - * the results determine the spectral centroid.

            - * - * @method getCentroid - * @for p5.FFT - * @return {Number} Spectral Centroid Frequency of the spectral centroid in Hz. - * - * - * @example - *
            - * function setup(){ - * cnv = createCanvas(100,100); - * cnv.mousePressed(userStartAudio); - * sound = new p5.AudioIn(); - * sound.start(); - * fft = new p5.FFT(); - * sound.connect(fft); - *} - * - *function draw() { - * if (getAudioContext().state !== 'running') { - * background(220); - * text('tap here and enable mic to begin', 10, 20, width - 20); - * return; - * } - * let centroidplot = 0.0; - * let spectralCentroid = 0; - * - * background(0); - * stroke(0,255,0); - * let spectrum = fft.analyze(); - * fill(0,255,0); // spectrum is green - * - * //draw the spectrum - * for (let i = 0; i < spectrum.length; i++){ - * let x = map(log(i), 0, log(spectrum.length), 0, width); - * let h = map(spectrum[i], 0, 255, 0, height); - * let rectangle_width = (log(i+1)-log(i))*(width/log(spectrum.length)); - * rect(x, height, rectangle_width, -h ) - * } - * let nyquist = 22050; - * - * // get the centroid - * spectralCentroid = fft.getCentroid(); - * - * // the mean_freq_index calculation is for the display. - * let mean_freq_index = spectralCentroid/(nyquist/spectrum.length); - * - * centroidplot = map(log(mean_freq_index), 0, log(spectrum.length), 0, width); - * - * stroke(255,0,0); // the line showing where the centroid is will be red - * - * rect(centroidplot, 0, width / spectrum.length, height) - * noStroke(); - * fill(255,255,255); // text is white - * text('centroid: ', 10, 20); - * text(round(spectralCentroid)+' Hz', 10, 40); - *} - *
            - */ - - }, { - key: "getCentroid", - value: function getCentroid() { - var nyquist = main.audiocontext.sampleRate / 2; - var cumulative_sum = 0; - var centroid_normalization = 0; - - for (var i = 0; i < this.freqDomain.length; i++) { - cumulative_sum += i * this.freqDomain[i]; - centroid_normalization += this.freqDomain[i]; - } - - var mean_freq_index = 0; - - if (centroid_normalization !== 0) { - mean_freq_index = cumulative_sum / centroid_normalization; - } - - var spec_centroid_freq = mean_freq_index * (nyquist / this.freqDomain.length); - return spec_centroid_freq; - } - /** - * Smooth FFT analysis by averaging with the last analysis frame. - * - * @method smooth - * @param {Number} smoothing 0.0 < smoothing < 1.0. - * Defaults to 0.8. - */ - - }, { - key: "smooth", - value: function smooth(s) { - if (typeof s !== 'undefined') { - this.smoothing = s; - } - - return this.smoothing; - } - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.analyser) { - this.analyser.disconnect(); - delete this.analyser; - } - } - /** - * Returns an array of average amplitude values for a given number - * of frequency bands split equally. N defaults to 16. - * NOTE: analyze() must be called prior to linAverages(). Analyze() - * tells the FFT to analyze frequency data, and linAverages() uses - * the results to group them into a smaller set of averages.

            - * - * @method linAverages - * @for p5.FFT - * @param {Number} N Number of returned frequency groups - * @return {Array} linearAverages Array of average amplitude values for each group - */ - - }, { - key: "linAverages", - value: function linAverages(_N) { - var N = _N || 16; - - var spectrum = this.freqDomain; - var spectrumLength = spectrum.length; - var spectrumStep = Math.floor(spectrumLength / N); - var linearAverages = new Array(N); - - var groupIndex = 0; - - for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { - linearAverages[groupIndex] = linearAverages[groupIndex] !== undefined ? (linearAverages[groupIndex] + spectrum[specIndex]) / 2 : spectrum[specIndex]; - - if (specIndex % spectrumStep === spectrumStep - 1) { - groupIndex++; - } - } - - return linearAverages; - } - /** - * Returns an array of average amplitude values of the spectrum, for a given - * set of - * Octave Bands - * NOTE: analyze() must be called prior to logAverages(). Analyze() - * tells the FFT to analyze frequency data, and logAverages() uses - * the results to group them into a smaller set of averages.

            - * - * @method logAverages - * @for p5.FFT - * @param {Array} octaveBands Array of Octave Bands objects for grouping - * @return {Array} logAverages Array of average amplitude values for each group - */ - - }, { - key: "logAverages", - value: function logAverages(octaveBands) { - var nyquist = main.audiocontext.sampleRate / 2; - var spectrum = this.freqDomain; - var spectrumLength = spectrum.length; - var logAverages = new Array(octaveBands.length); - - var octaveIndex = 0; - - for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { - var specIndexFrequency = Math.round(specIndex * nyquist / this.freqDomain.length); - - if (specIndexFrequency > octaveBands[octaveIndex].hi) { - octaveIndex++; - } - - logAverages[octaveIndex] = logAverages[octaveIndex] !== undefined ? (logAverages[octaveIndex] + spectrum[specIndex]) / 2 : spectrum[specIndex]; - } - - return logAverages; - } - /** - * Calculates and Returns the 1/N - * Octave Bands - * N defaults to 3 and minimum central frequency to 15.625Hz. - * (1/3 Octave Bands ~= 31 Frequency Bands) - * Setting fCtr0 to a central value of a higher octave will ignore the lower bands - * and produce less frequency groups. - * - * @method getOctaveBands - * @for p5.FFT - * @param {Number} N Specifies the 1/N type of generated octave bands - * @param {Number} fCtr0 Minimum central frequency for the lowest band - * @return {Array} octaveBands Array of octave band objects with their bounds - */ - - }, { - key: "getOctaveBands", - value: function getOctaveBands(_N, _fCtr0) { - var N = _N || 3; - - var fCtr0 = _fCtr0 || 15.625; - - var octaveBands = []; - var lastFrequencyBand = { - lo: fCtr0 / Math.pow(2, 1 / (2 * N)), - ctr: fCtr0, - hi: fCtr0 * Math.pow(2, 1 / (2 * N)) - }; - octaveBands.push(lastFrequencyBand); - var nyquist = main.audiocontext.sampleRate / 2; - - while (lastFrequencyBand.hi < nyquist) { - var newFrequencyBand = {}; - newFrequencyBand.lo = lastFrequencyBand.hi; - newFrequencyBand.ctr = lastFrequencyBand.ctr * Math.pow(2, 1 / N); - newFrequencyBand.hi = newFrequencyBand.ctr * Math.pow(2, 1 / (2 * N)); - octaveBands.push(newFrequencyBand); - lastFrequencyBand = newFrequencyBand; - } - - return octaveBands; - } - }]); - - return FFT; -}(); - - -function freqToFloat(fft) { - if (fft.freqDomain instanceof Float32Array === false) { - fft.freqDomain = new Float32Array(fft.analyser.frequencyBinCount); - } -} - -function freqToInt(fft) { - if (fft.freqDomain instanceof Uint8Array === false) { - fft.freqDomain = new Uint8Array(fft.analyser.frequencyBinCount); - } -} - -function timeToFloat(fft) { - if (fft.timeDomain instanceof Float32Array === false) { - fft.timeDomain = new Float32Array(fft.analyser.frequencyBinCount); - } -} - -function timeToInt(fft) { - if (fft.timeDomain instanceof Uint8Array === false) { - fft.timeDomain = new Uint8Array(fft.analyser.frequencyBinCount); - } -} - - var fft = (fft_FFT); -var Add = __webpack_require__(4); -var Add_default = __webpack_require__.n(Add); - -var Multiply = __webpack_require__(1); -var Multiply_default = __webpack_require__.n(Multiply); - -var Scale = __webpack_require__(8); -var Scale_default = __webpack_require__.n(Scale); - -function oscillator_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { oscillator_typeof = function _typeof(obj) { return typeof obj; }; } else { oscillator_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return oscillator_typeof(obj); } - -function _possibleConstructorReturn(self, call) { if (call && (oscillator_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function oscillator_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function oscillator_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function oscillator_createClass(Constructor, protoProps, staticProps) { if (protoProps) oscillator_defineProperties(Constructor.prototype, protoProps); if (staticProps) oscillator_defineProperties(Constructor, staticProps); return Constructor; } - - - - - - -function sigChain(o, mathObj, thisChain, nextChain, type) { - var chainSource = o.oscillator; - - for (var i in o.mathOps) { - if (o.mathOps[i] instanceof type) { - chainSource.disconnect(); - o.mathOps[i].dispose(); - thisChain = i; - - if (thisChain < o.mathOps.length - 2) { - nextChain = o.mathOps[i + 1]; - } - } - } - - if (thisChain === o.mathOps.length - 1) { - o.mathOps.push(nextChain); - } - - - if (i > 0) { - chainSource = o.mathOps[i - 1]; - } - - chainSource.disconnect(); - chainSource.connect(mathObj); - mathObj.connect(nextChain); - o.mathOps[thisChain] = mathObj; - return o; -} -/** - *

            Creates a signal that oscillates between -1.0 and 1.0. - * By default, the oscillation takes the form of a sinusoidal - * shape ('sine'). Additional types include 'triangle', - * 'sawtooth' and 'square'. The frequency defaults to - * 440 oscillations per second (440Hz, equal to the pitch of an - * 'A' note).

            - * - *

            Set the type of oscillation with setType(), or by instantiating a - * specific oscillator: p5.SinOsc, p5.TriOsc, p5.SqrOsc, or p5.SawOsc. - *

            - * - * @class p5.Oscillator - * @constructor - * @param {Number} [freq] frequency defaults to 440Hz - * @param {String} [type] type of oscillator. Options: - * 'sine' (default), 'triangle', - * 'sawtooth', 'square' - * @example - *
            - * let osc, playing, freq, amp; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playOscillator); - * osc = new p5.Oscillator('sine'); - * } - * - * function draw() { - * background(220) - * freq = constrain(map(mouseX, 0, width, 100, 500), 100, 500); - * amp = constrain(map(mouseY, height, 0, 0, 1), 0, 1); - * - * text('tap to play', 20, 20); - * text('freq: ' + freq, 20, 40); - * text('amp: ' + amp, 20, 60); - * - * if (playing) { - * // smooth the transitions by 0.1 seconds - * osc.freq(freq, 0.1); - * osc.amp(amp, 0.1); - * } - * } - * - * function playOscillator() { - * // starting an oscillator on a user gesture will enable audio - * // in browsers that have a strict autoplay policy. - * // See also: userStartAudio(); - * osc.start(); - * playing = true; - * } - * - * function mouseReleased() { - * // ramp amplitude to 0 over 0.5 seconds - * osc.amp(0, 0.5); - * playing = false; - * } - *
            - */ - - -var oscillator_Oscillator = -function () { - function Oscillator(freq, type) { - oscillator_classCallCheck(this, Oscillator); - - if (typeof freq === 'string') { - var f = type; - type = freq; - freq = f; - } - - if (typeof type === 'number') { - var _f = type; - type = freq; - freq = _f; - } - - this.started = false; - - this.phaseAmount = undefined; - this.oscillator = main.audiocontext.createOscillator(); - this.f = freq || 440.0; - - this.oscillator.type = type || 'sine'; - this.oscillator.frequency.setValueAtTime(this.f, main.audiocontext.currentTime); - - this.output = main.audiocontext.createGain(); - this._freqMods = []; - - this.output.gain.value = 0.5; - this.output.gain.setValueAtTime(0.5, main.audiocontext.currentTime); - this.oscillator.connect(this.output); - - this.panPosition = 0.0; - this.connection = main.input; - - this.panner = new panner_0(this.output, this.connection, 1); - - this.mathOps = [this.output]; - - main.soundArray.push(this); - - this.fade = this.amp; - } - /** - * Start an oscillator. - * - * Starting an oscillator on a user gesture will enable audio in browsers - * that have a strict autoplay policy, including Chrome and most mobile - * devices. See also: `userStartAudio()`. - * - * @method start - * @for p5.Oscillator - * @param {Number} [time] startTime in seconds from now. - * @param {Number} [frequency] frequency in Hz. - */ - - - oscillator_createClass(Oscillator, [{ - key: "start", - value: function start(time, f) { - if (this.started) { - var now = main.audiocontext.currentTime; - this.stop(now); - } - - if (!this.started) { - var freq = f || this.f; - var type = this.oscillator.type; - - if (this.oscillator) { - this.oscillator.disconnect(); - delete this.oscillator; - } - - - this.oscillator = main.audiocontext.createOscillator(); - this.oscillator.frequency.value = Math.abs(freq); - this.oscillator.type = type; - - this.oscillator.connect(this.output); - time = time || 0; - this.oscillator.start(time + main.audiocontext.currentTime); - this.freqNode = this.oscillator.frequency; - - for (var i in this._freqMods) { - if (typeof this._freqMods[i].connect !== 'undefined') { - this._freqMods[i].connect(this.oscillator.frequency); - } - } - - this.started = true; - } - } - /** - * Stop an oscillator. Accepts an optional parameter - * to determine how long (in seconds from now) until the - * oscillator stops. - * - * @method stop - * @for p5.Oscillator - * @param {Number} secondsFromNow Time, in seconds from now. - */ - - }, { - key: "stop", - value: function stop(time) { - if (this.started) { - var t = time || 0; - var now = main.audiocontext.currentTime; - this.oscillator.stop(t + now); - this.started = false; - } - } - /** - * Set the amplitude between 0 and 1.0. Or, pass in an object - * such as an oscillator to modulate amplitude with an audio signal. - * - * @method amp - * @for p5.Oscillator - * @param {Number|Object} vol between 0 and 1.0 - * or a modulating signal/oscillator - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @return {AudioParam} gain If no value is provided, - * returns the Web Audio API - * AudioParam that controls - * this oscillator's - * gain/amplitude/volume) - */ - - }, { - key: "amp", - value: function amp(vol) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - if (typeof vol === 'number') { - var now = main.audiocontext.currentTime; - this.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); - } else if (vol) { - vol.connect(this.output.gain); - } else { - return this.output.gain; - } - } - /** - * Returns the value of output gain - * - * @method getAmp - * @for p5.Oscillator - * - * @returns {number} Amplitude value between 0.0 and 1.0 - */ - - }, { - key: "getAmp", - value: function getAmp() { - return this.output.gain.value; - } - /** - * Set frequency of an oscillator to a value. Or, pass in an object - * such as an oscillator to modulate the frequency with an audio signal. - * - * @method freq - * @for p5.Oscillator - * @param {Number|Object} Frequency Frequency in Hz - * or modulating signal/oscillator - * @param {Number} [rampTime] Ramp time (in seconds) - * @param {Number} [timeFromNow] Schedule this event to happen - * at x seconds from now - * @return {AudioParam} Frequency If no value is provided, - * returns the Web Audio API - * AudioParam that controls - * this oscillator's frequency - * @example - *
            - * let osc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playOscillator); - * osc = new p5.Oscillator(300); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function playOscillator() { - * osc.start(); - * osc.amp(0.5); - * // start at 700Hz - * osc.freq(700); - * // ramp to 60Hz over 0.7 seconds - * osc.freq(60, 0.7); - * osc.amp(0, 0.1, 0.7); - * } - *
            - */ - - }, { - key: "freq", - value: function freq(val) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - if (typeof val === 'number' && !isNaN(val)) { - this.f = val; - var now = main.audiocontext.currentTime; - - if (rampTime === 0) { - this.oscillator.frequency.setValueAtTime(val, tFromNow + now); - } else { - if (val > 0) { - this.oscillator.frequency.exponentialRampToValueAtTime(val, tFromNow + rampTime + now); - } else { - this.oscillator.frequency.linearRampToValueAtTime(val, tFromNow + rampTime + now); - } - } - - - if (this.phaseAmount) { - this.phase(this.phaseAmount); - } - } else if (val) { - if (val.output) { - val = val.output; - } - - val.connect(this.oscillator.frequency); - - this._freqMods.push(val); - } else { - return this.oscillator.frequency; - } - } - /** - * Returns the value of frequency of oscillator - * - * @method getFreq - * @for p5.Oscillator - * @returns {number} Frequency of oscillator in Hertz - */ - - }, { - key: "getFreq", - value: function getFreq() { - return this.oscillator.frequency.value; - } - /** - * Set type to 'sine', 'triangle', 'sawtooth' or 'square'. - * - * @method setType - * @for p5.Oscillator - * @param {String} type 'sine', 'triangle', 'sawtooth' or 'square'. - */ - - }, { - key: "setType", - value: function setType(type) { - this.oscillator.type = type; - } - /** - * Returns current type of oscillator eg. 'sine', 'triangle', 'sawtooth' or 'square'. - * - * @method getType - * @for p5.Oscillator - * @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'. - */ - - }, { - key: "getType", - value: function getType() { - return this.oscillator.type; - } - /** - * Connect to a p5.sound / Web Audio object. - * - * @method connect - * @for p5.Oscillator - * @param {Object} unit A p5.sound or Web Audio object - */ - - }, { - key: "connect", - value: function connect(unit) { - if (!unit) { - this.panner.connect(main.input); - } else if (unit.hasOwnProperty('input')) { - this.panner.connect(unit.input); - this.connection = unit.input; - } else { - this.panner.connect(unit); - this.connection = unit; - } - } - /** - * Disconnect all outputs - * - * @method disconnect - * @for p5.Oscillator - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - - if (this.panner) { - this.panner.disconnect(); - - if (this.output) { - this.output.connect(this.panner); - } - } - - this.oscMods = []; - } - /** - * Pan between Left (-1) and Right (1) - * - * @method pan - * @for p5.Oscillator - * @param {Number} panning Number between -1 and 1 - * @param {Number} timeFromNow schedule this event to happen - * seconds from now - */ - - }, { - key: "pan", - value: function pan(pval, tFromNow) { - this.panPosition = pval; - this.panner.pan(pval, tFromNow); - } - /** - * Returns the current value of panPosition , between Left (-1) and Right (1) - * - * @method getPan - * @for p5.Oscillator - * - * @returns {number} panPosition of oscillator , between Left (-1) and Right (1) - */ - - }, { - key: "getPan", - value: function getPan() { - return this.panPosition; - } - - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.oscillator) { - var now = main.audiocontext.currentTime; - this.stop(now); - this.disconnect(); - this.panner = null; - this.oscillator = null; - } - - - if (this.osc2) { - this.osc2.dispose(); - } - } - /** - * Set the phase of an oscillator between 0.0 and 1.0. - * In this implementation, phase is a delay time - * based on the oscillator's current frequency. - * - * @method phase - * @for p5.Oscillator - * @param {Number} phase float between 0.0 and 1.0 - */ - - }, { - key: "phase", - value: function phase(p) { - var delayAmt = p5.prototype.map(p, 0, 1.0, 0, 1 / this.f); - var now = main.audiocontext.currentTime; - this.phaseAmount = p; - - if (!this.dNode) { - this.dNode = main.audiocontext.createDelay(); - - this.oscillator.disconnect(); - this.oscillator.connect(this.dNode); - this.dNode.connect(this.output); - } - - - this.dNode.delayTime.setValueAtTime(delayAmt, now); - } - /** - * Add a value to the p5.Oscillator's output amplitude, - * and return the oscillator. Calling this method again - * will override the initial add() with a new value. - * - * @method add - * @for p5.Oscillator - * @param {Number} number Constant number to add - * @return {p5.Oscillator} Oscillator Returns this oscillator - * with scaled output - * - */ - - }, { - key: "add", - value: function add(num) { - var add = new Add_default.a(num); - var thisChain = this.mathOps.length - 1; - var nextChain = this.output; - return sigChain(this, add, thisChain, nextChain, Add_default.a); - } - /** - * Multiply the p5.Oscillator's output amplitude - * by a fixed value (i.e. turn it up!). Calling this method - * again will override the initial mult() with a new value. - * - * @method mult - * @for p5.Oscillator - * @param {Number} number Constant number to multiply - * @return {p5.Oscillator} Oscillator Returns this oscillator - * with multiplied output - */ - - }, { - key: "mult", - value: function mult(num) { - var mult = new Multiply_default.a(num); - var thisChain = this.mathOps.length - 1; - var nextChain = this.output; - return sigChain(this, mult, thisChain, nextChain, Multiply_default.a); - } - /** - * Scale this oscillator's amplitude values to a given - * range, and return the oscillator. Calling this method - * again will override the initial scale() with new values. - * - * @method scale - * @for p5.Oscillator - * @param {Number} inMin input range minumum - * @param {Number} inMax input range maximum - * @param {Number} outMin input range minumum - * @param {Number} outMax input range maximum - * @return {p5.Oscillator} Oscillator Returns this oscillator - * with scaled output - */ - - }, { - key: "scale", - value: function scale(inMin, inMax, outMin, outMax) { - var mapOutMin, mapOutMax; - - if (arguments.length === 4) { - mapOutMin = p5.prototype.map(outMin, inMin, inMax, 0, 1) - 0.5; - - mapOutMax = p5.prototype.map(outMax, inMin, inMax, 0, 1) - 0.5; - } else { - mapOutMin = arguments[0]; - mapOutMax = arguments[1]; - } - - var scale = new Scale_default.a(mapOutMin, mapOutMax); - var thisChain = this.mathOps.length - 1; - var nextChain = this.output; - return sigChain(this, scale, thisChain, nextChain, Scale_default.a); - } - }]); - - return Oscillator; -}(); - -/** - * Constructor: new p5.SinOsc(). - * This creates a Sine Wave Oscillator and is - * equivalent to new p5.Oscillator('sine') - * or creating a p5.Oscillator and then calling - * its method setType('sine'). - * See p5.Oscillator for methods. - * - * @class p5.SinOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - -var SinOsc = -function (_Oscillator) { - _inherits(SinOsc, _Oscillator); - - function SinOsc(freq) { - oscillator_classCallCheck(this, SinOsc); - - return _possibleConstructorReturn(this, _getPrototypeOf(SinOsc).call(this, freq, 'sine')); - } - - return SinOsc; -}(oscillator_Oscillator); -/** - * Constructor: new p5.TriOsc(). - * This creates a Triangle Wave Oscillator and is - * equivalent to new p5.Oscillator('triangle') - * or creating a p5.Oscillator and then calling - * its method setType('triangle'). - * See p5.Oscillator for methods. - * - * @class p5.TriOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - -var TriOsc = -function (_Oscillator2) { - _inherits(TriOsc, _Oscillator2); - - function TriOsc(freq) { - oscillator_classCallCheck(this, TriOsc); - - return _possibleConstructorReturn(this, _getPrototypeOf(TriOsc).call(this, freq, 'triangle')); - } - - return TriOsc; -}(oscillator_Oscillator); -/** - * Constructor: new p5.SawOsc(). - * This creates a SawTooth Wave Oscillator and is - * equivalent to new p5.Oscillator('sawtooth') - * or creating a p5.Oscillator and then calling - * its method setType('sawtooth'). - * See p5.Oscillator for methods. - * - * @class p5.SawOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - -var SawOsc = -function (_Oscillator3) { - _inherits(SawOsc, _Oscillator3); - - function SawOsc(freq) { - oscillator_classCallCheck(this, SawOsc); - - return _possibleConstructorReturn(this, _getPrototypeOf(SawOsc).call(this, freq, 'sawtooth')); - } - - return SawOsc; -}(oscillator_Oscillator); -/** - * Constructor: new p5.SqrOsc(). - * This creates a Square Wave Oscillator and is - * equivalent to new p5.Oscillator('square') - * or creating a p5.Oscillator and then calling - * its method setType('square'). - * See p5.Oscillator for methods. - * - * @class p5.SqrOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - -var SqrOsc = -function (_Oscillator4) { - _inherits(SqrOsc, _Oscillator4); - - function SqrOsc(freq) { - oscillator_classCallCheck(this, SqrOsc); - - return _possibleConstructorReturn(this, _getPrototypeOf(SqrOsc).call(this, freq, 'square')); - } - - return SqrOsc; -}(oscillator_Oscillator); - - var oscillator = (oscillator_Oscillator); - -var TimelineSignal = __webpack_require__(7); -var TimelineSignal_default = __webpack_require__.n(TimelineSignal); - - - - - - -/** - *

            Envelopes are pre-defined amplitude distribution over time. - * Typically, envelopes are used to control the output volume - * of an object, a series of fades referred to as Attack, Decay, - * Sustain and Release ( - * ADSR - * ). Envelopes can also control other Web Audio Parameters—for example, a p5.Envelope can - * control an Oscillator's frequency like this: osc.freq(env).

            - *

            Use setRange to change the attack/release level. - * Use setADSR to change attackTime, decayTime, sustainPercent and releaseTime.

            - *

            Use the play method to play the entire envelope, - * the ramp method for a pingable trigger, - * or triggerAttack/ - * triggerRelease to trigger noteOn/noteOff.

            - * - * @class p5.Envelope - * @constructor - * @example - *
            - * let t1 = 0.1; // attack time in seconds - * let l1 = 0.7; // attack level 0.0 to 1.0 - * let t2 = 0.3; // decay time in seconds - * let l2 = 0.1; // decay level 0.0 to 1.0 - * - * let env; - * let triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * text('tap to play', 20, 20); - * cnv.mousePressed(playSound); - * - * env = new p5.Envelope(t1, l1, t2, l2); - * triOsc = new p5.Oscillator('triangle'); - * } - * - * function playSound() { - * // starting the oscillator ensures that audio is enabled. - * triOsc.start(); - * env.play(triOsc); - * } - *
            - */ - -p5.Envelope = function (t1, l1, t2, l2, t3, l3) { - /** - * Time until envelope reaches attackLevel - * @property attackTime - */ - this.aTime = t1 || 0.1; - /** - * Level once attack is complete. - * @property attackLevel - */ - - this.aLevel = l1 || 1; - /** - * Time until envelope reaches decayLevel. - * @property decayTime - */ - - this.dTime = t2 || 0.5; - /** - * Level after decay. The envelope will sustain here until it is released. - * @property decayLevel - */ - - this.dLevel = l2 || 0; - /** - * Duration of the release portion of the envelope. - * @property releaseTime - */ - - this.rTime = t3 || 0; - /** - * Level at the end of the release. - * @property releaseLevel - */ - - this.rLevel = l3 || 0; - this._rampHighPercentage = 0.98; - this._rampLowPercentage = 0.02; - this.output = main.audiocontext.createGain(); - this.control = new TimelineSignal_default.a(); - - this._init(); - - - this.control.connect(this.output); - - this.connection = null; - - this.mathOps = [this.control]; - - this.isExponential = false; - - this.sourceToClear = null; - - this.wasTriggered = false; - - main.soundArray.push(this); -}; - - -p5.Envelope.prototype._init = function () { - var now = main.audiocontext.currentTime; - var t = now; - this.control.setTargetAtTime(0.00001, t, 0.001); - - this._setRampAD(this.aTime, this.dTime); -}; -/** - * Reset the envelope with a series of time/value pairs. - * - * @method set - * @for p5.Envelope - * @param {Number} attackTime Time (in seconds) before level - * reaches attackLevel - * @param {Number} attackLevel Typically an amplitude between - * 0.0 and 1.0 - * @param {Number} decayTime Time - * @param {Number} decayLevel Amplitude (In a standard ADSR envelope, - * decayLevel = sustainLevel) - * @param {Number} releaseTime Release Time (in seconds) - * @param {Number} releaseLevel Amplitude - * @example - *
            - * let attackTime; - * let l1 = 0.7; // attack level 0.0 to 1.0 - * let t2 = 0.3; // decay time in seconds - * let l2 = 0.1; // decay level 0.0 to 1.0 - * let l3 = 0.2; // release time in seconds - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * - * attackTime = map(mouseX, 0, width, 0.0, 1.0); - * text('attack time: ' + attackTime, 5, height - 20); - * } - * - * // mouseClick triggers envelope if over canvas - * function playSound() { - * env.set(attackTime, l1, t2, l2, l3); - * - * triOsc.start(); - * env.play(triOsc); - * } - *
            - * - */ - - -p5.Envelope.prototype.set = function (t1, l1, t2, l2, t3, l3) { - this.aTime = t1; - this.aLevel = l1; - this.dTime = t2 || 0; - this.dLevel = l2 || 0; - this.rTime = t3 || 0; - this.rLevel = l3 || 0; - - this._setRampAD(t1, t2); -}; -/** - * Set values like a traditional - * - * ADSR envelope - * . - * - * @method setADSR - * @for p5.Envelope - * @param {Number} attackTime Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - * @example - *
            - * let attackLevel = 1.0; - * let releaseLevel = 0; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.2; - * let releaseTime = 0.5; - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playEnv); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.amp(env); - * triOsc.freq(220); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * attackTime = map(mouseX, 0, width, 0, 1.0); - * text('attack time: ' + attackTime, 5, height - 40); - * } - * - * function playEnv() { - * triOsc.start(); - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.play(); - * } - *
            - */ - - -p5.Envelope.prototype.setADSR = function (aTime, dTime, sPercent, rTime) { - this.aTime = aTime; - this.dTime = dTime || 0; - - this.sPercent = sPercent || 0; - this.dLevel = typeof sPercent !== 'undefined' ? sPercent * (this.aLevel - this.rLevel) + this.rLevel : 0; - this.rTime = rTime || 0; - - this._setRampAD(aTime, dTime); -}; -/** - * Set max (attackLevel) and min (releaseLevel) of envelope. - * - * @method setRange - * @for p5.Envelope - * @param {Number} aLevel attack level (defaults to 1) - * @param {Number} rLevel release level (defaults to 0) - * @example - *
            - * let attackLevel = 1.0; - * let releaseLevel = 0; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.2; - * let releaseTime = 0.5; - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playEnv); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.amp(env); - * triOsc.freq(220); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * attackLevel = map(mouseY, height, 0, 0, 1.0); - * text('attack level: ' + attackLevel, 5, height - 20); - * } - * - * function playEnv() { - * triOsc.start(); - * env.setRange(attackLevel, releaseLevel); - * env.play(); - * } - *
            - */ - - -p5.Envelope.prototype.setRange = function (aLevel, rLevel) { - this.aLevel = aLevel || 1; - this.rLevel = rLevel || 0; -}; - - -p5.Envelope.prototype._setRampAD = function (t1, t2) { - this._rampAttackTime = this.checkExpInput(t1); - this._rampDecayTime = this.checkExpInput(t2); - var TCDenominator = 1.0; - - TCDenominator = Math.log(1.0 / this.checkExpInput(1.0 - this._rampHighPercentage)); - this._rampAttackTC = t1 / this.checkExpInput(TCDenominator); - TCDenominator = Math.log(1.0 / this._rampLowPercentage); - this._rampDecayTC = t2 / this.checkExpInput(TCDenominator); -}; - - -p5.Envelope.prototype.setRampPercentages = function (p1, p2) { - this._rampHighPercentage = this.checkExpInput(p1); - this._rampLowPercentage = this.checkExpInput(p2); - var TCDenominator = 1.0; - - TCDenominator = Math.log(1.0 / this.checkExpInput(1.0 - this._rampHighPercentage)); - this._rampAttackTC = this._rampAttackTime / this.checkExpInput(TCDenominator); - TCDenominator = Math.log(1.0 / this._rampLowPercentage); - this._rampDecayTC = this._rampDecayTime / this.checkExpInput(TCDenominator); -}; -/** - * Assign a parameter to be controlled by this envelope. - * If a p5.Sound object is given, then the p5.Envelope will control its - * output gain. If multiple inputs are provided, the env will - * control all of them. - * - * @method setInput - * @for p5.Envelope - * @param {Object} [...inputs] A p5.sound object or - * Web Audio Param. - */ - - -p5.Envelope.prototype.setInput = function () { - for (var i = 0; i < arguments.length; i++) { - this.connect(arguments[i]); - } -}; -/** - * Set whether the envelope ramp is linear (default) or exponential. - * Exponential ramps can be useful because we perceive amplitude - * and frequency logarithmically. - * - * @method setExp - * @for p5.Envelope - * @param {Boolean} isExp true is exponential, false is linear - */ - - -p5.Envelope.prototype.setExp = function (isExp) { - this.isExponential = isExp; -}; - - -p5.Envelope.prototype.checkExpInput = function (value) { - if (value <= 0) { - value = 0.00000001; - } - - return value; -}; -/** - *

            Play tells the envelope to start acting on a given input. - * If the input is a p5.sound object (i.e. AudioIn, Oscillator, - * SoundFile), then Envelope will control its output volume. - * Envelopes can also be used to control any - * Web Audio Audio Param.

            - * - * @method play - * @for p5.Envelope - * @param {Object} unit A p5.sound object or - * Web Audio Param. - * @param {Number} [startTime] time from now (in seconds) at which to play - * @param {Number} [sustainTime] time to sustain before releasing the envelope - * @example - *
            - * let attackLevel = 1.0; - * let releaseLevel = 0; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.2; - * let releaseTime = 0.5; - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playEnv); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.amp(env); - * triOsc.freq(220); - * triOsc.start(); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * attackTime = map(mouseX, 0, width, 0, 1.0); - * attackLevel = map(mouseY, height, 0, 0, 1.0); - * text('attack time: ' + attackTime, 5, height - 40); - * text('attack level: ' + attackLevel, 5, height - 20); - * } - * - * function playEnv() { - * // ensure that audio is enabled - * userStartAudio(); - * - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.setRange(attackLevel, releaseLevel); - * env.play(); - * } - *
            - */ - - -p5.Envelope.prototype.play = function (unit, secondsFromNow, susTime) { - var tFromNow = secondsFromNow || 0; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - this.triggerAttack(unit, tFromNow); - this.triggerRelease(unit, tFromNow + this.aTime + this.dTime + ~~susTime); -}; -/** - * Trigger the Attack, and Decay portion of the Envelope. - * Similar to holding down a key on a piano, but it will - * hold the sustain level until you let go. Input can be - * any p5.sound object, or a - * Web Audio Param. - * - * @method triggerAttack - * @for p5.Envelope - * @param {Object} unit p5.sound Object or Web Audio Param - * @param {Number} secondsFromNow time from now (in seconds) - * @example - *
            - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.3; - * let releaseTime = 0.4; - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * textAlign(CENTER); - * textSize(10); - * text('tap to triggerAttack', width/2, height/2); - * - * env = new p5.Envelope(); - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.setRange(1.0, 0.0); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.freq(220); - * - * cnv.mousePressed(envAttack); - * } - * - * function envAttack() { - * background(0, 255, 255); - * text('release to release', width/2, height/2); - * - * // ensures audio is enabled. See also: `userStartAudio` - * triOsc.start(); - * - * env.triggerAttack(triOsc); - * } - * - * function mouseReleased() { - * background(220); - * text('tap to triggerAttack', width/2, height/2); - * - * env.triggerRelease(triOsc); - * } - *
            - */ - - -p5.Envelope.prototype.triggerAttack = function (unit, secondsFromNow) { - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - this.lastAttack = t; - this.wasTriggered = true; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - - var valToSet = this.control.getValueAtTime(t); - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime(this.checkExpInput(valToSet), t); - } else { - this.control.linearRampToValueAtTime(valToSet, t); - } - - - t += this.aTime; - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime(this.checkExpInput(this.aLevel), t); - valToSet = this.checkExpInput(this.control.getValueAtTime(t)); - this.control.cancelScheduledValues(t); - this.control.exponentialRampToValueAtTime(valToSet, t); - } else { - this.control.linearRampToValueAtTime(this.aLevel, t); - valToSet = this.control.getValueAtTime(t); - this.control.cancelScheduledValues(t); - this.control.linearRampToValueAtTime(valToSet, t); - } - - - t += this.dTime; - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime(this.checkExpInput(this.dLevel), t); - valToSet = this.checkExpInput(this.control.getValueAtTime(t)); - this.control.cancelScheduledValues(t); - this.control.exponentialRampToValueAtTime(valToSet, t); - } else { - this.control.linearRampToValueAtTime(this.dLevel, t); - valToSet = this.control.getValueAtTime(t); - this.control.cancelScheduledValues(t); - this.control.linearRampToValueAtTime(valToSet, t); - } -}; -/** - * Trigger the Release of the Envelope. This is similar to releasing - * the key on a piano and letting the sound fade according to the - * release level and release time. - * - * @method triggerRelease - * @for p5.Envelope - * @param {Object} unit p5.sound Object or Web Audio Param - * @param {Number} secondsFromNow time to trigger the release - * @example - *
            - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.3; - * let releaseTime = 0.4; - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * textAlign(CENTER); - * textSize(10); - * text('tap to triggerAttack', width/2, height/2); - * - * env = new p5.Envelope(); - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.setRange(1.0, 0.0); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.freq(220); - * - * cnv.mousePressed(envAttack); - * } - * - * function envAttack() { - * background(0, 255, 255); - * text('release to release', width/2, height/2); - * - * // ensures audio is enabled. See also: `userStartAudio` - * triOsc.start(); - * - * env.triggerAttack(triOsc); - * } - * - * function mouseReleased() { - * background(220); - * text('tap to triggerAttack', width/2, height/2); - * - * env.triggerRelease(triOsc); - * } - *
            - */ - - -p5.Envelope.prototype.triggerRelease = function (unit, secondsFromNow) { - if (!this.wasTriggered) { - return; - } - - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - - var valToSet = this.control.getValueAtTime(t); - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime(this.checkExpInput(valToSet), t); - } else { - this.control.linearRampToValueAtTime(valToSet, t); - } - - - t += this.rTime; - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime(this.checkExpInput(this.rLevel), t); - valToSet = this.checkExpInput(this.control.getValueAtTime(t)); - this.control.cancelScheduledValues(t); - this.control.exponentialRampToValueAtTime(valToSet, t); - } else { - this.control.linearRampToValueAtTime(this.rLevel, t); - valToSet = this.control.getValueAtTime(t); - this.control.cancelScheduledValues(t); - this.control.linearRampToValueAtTime(valToSet, t); - } - - this.wasTriggered = false; -}; -/** - * Exponentially ramp to a value using the first two - * values from setADSR(attackTime, decayTime) - * as - * time constants for simple exponential ramps. - * If the value is higher than current value, it uses attackTime, - * while a decrease uses decayTime. - * - * @method ramp - * @for p5.Envelope - * @param {Object} unit p5.sound Object or Web Audio Param - * @param {Number} secondsFromNow When to trigger the ramp - * @param {Number} v Target value - * @param {Number} [v2] Second target value - * @example - *
            - * let env, osc, amp; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let attackLevel = 1; - * let decayLevel = 0; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * fill(0,255,0); - * noStroke(); - * - * env = new p5.Envelope(); - * env.setADSR(attackTime, decayTime); - * osc = new p5.Oscillator(); - * osc.amp(env); - * amp = new p5.Amplitude(); - * - * cnv.mousePressed(triggerRamp); - * } - * - * function triggerRamp() { - * // ensures audio is enabled. See also: `userStartAudio` - * osc.start(); - * - * env.ramp(osc, 0, attackLevel, decayLevel); - * } - * - * function draw() { - * background(20); - * text('tap to play', 10, 20); - * let h = map(amp.getLevel(), 0, 0.4, 0, height);; - * rect(0, height, width, -h); - * } - *
            - */ - - -p5.Envelope.prototype.ramp = function (unit, secondsFromNow, v1, v2) { - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - var destination1 = this.checkExpInput(v1); - var destination2 = typeof v2 !== 'undefined' ? this.checkExpInput(v2) : undefined; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - - var currentVal = this.checkExpInput(this.control.getValueAtTime(t)); - - if (destination1 > currentVal) { - this.control.setTargetAtTime(destination1, t, this._rampAttackTC); - t += this._rampAttackTime; - } - else if (destination1 < currentVal) { - this.control.setTargetAtTime(destination1, t, this._rampDecayTC); - t += this._rampDecayTime; - } - - - if (destination2 === undefined) return; - - if (destination2 > destination1) { - this.control.setTargetAtTime(destination2, t, this._rampAttackTC); - } - else if (destination2 < destination1) { - this.control.setTargetAtTime(destination2, t, this._rampDecayTC); - } -}; - -p5.Envelope.prototype.connect = function (unit) { - this.connection = unit; - - if (unit instanceof p5.Oscillator || unit instanceof p5.SoundFile || unit instanceof p5.AudioIn || unit instanceof p5.Reverb || unit instanceof p5.Noise || unit instanceof p5.Filter || unit instanceof p5.Delay) { - unit = unit.output.gain; - } - - if (unit instanceof AudioParam) { - unit.setValueAtTime(0, main.audiocontext.currentTime); - } - - this.output.connect(unit); -}; - -p5.Envelope.prototype.disconnect = function () { - if (this.output) { - this.output.disconnect(); - } -}; - -/** - * Add a value to the p5.Oscillator's output amplitude, - * and return the oscillator. Calling this method - * again will override the initial add() with new values. - * - * @method add - * @for p5.Envelope - * @param {Number} number Constant number to add - * @return {p5.Envelope} Envelope Returns this envelope - * with scaled output - */ - - -p5.Envelope.prototype.add = function (num) { - var add = new Add_default.a(num); - var thisChain = this.mathOps.length; - var nextChain = this.output; - return p5.prototype._mathChain(this, add, thisChain, nextChain, Add_default.a); -}; -/** - * Multiply the p5.Envelope's output amplitude - * by a fixed value. Calling this method - * again will override the initial mult() with new values. - * - * @method mult - * @for p5.Envelope - * @param {Number} number Constant number to multiply - * @return {p5.Envelope} Envelope Returns this envelope - * with scaled output - */ - - -p5.Envelope.prototype.mult = function (num) { - var mult = new Multiply_default.a(num); - var thisChain = this.mathOps.length; - var nextChain = this.output; - return p5.prototype._mathChain(this, mult, thisChain, nextChain, Multiply_default.a); -}; -/** - * Scale this envelope's amplitude values to a given - * range, and return the envelope. Calling this method - * again will override the initial scale() with new values. - * - * @method scale - * @for p5.Envelope - * @param {Number} inMin input range minumum - * @param {Number} inMax input range maximum - * @param {Number} outMin input range minumum - * @param {Number} outMax input range maximum - * @return {p5.Envelope} Envelope Returns this envelope - * with scaled output - */ - - -p5.Envelope.prototype.scale = function (inMin, inMax, outMin, outMax) { - var scale = new Scale_default.a(inMin, inMax, outMin, outMax); - var thisChain = this.mathOps.length; - var nextChain = this.output; - return p5.prototype._mathChain(this, scale, thisChain, nextChain, Scale_default.a); -}; - - -p5.Envelope.prototype.dispose = function () { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.disconnect(); - - if (this.control) { - this.control.dispose(); - this.control = null; - } - - for (var i = 1; i < this.mathOps.length; i++) { - this.mathOps[i].dispose(); - } -}; - - -p5.Env = function (t1, l1, t2, l2, t3, l3) { - console.warn('WARNING: p5.Env is now deprecated and may be removed in future versions. ' + 'Please use the new p5.Envelope instead.'); - p5.Envelope.call(this, t1, l1, t2, l2, t3, l3); -}; - -p5.Env.prototype = Object.create(p5.Envelope.prototype); -var Envelope = p5.Envelope; - var envelope = (Envelope); -function noise_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { noise_typeof = function _typeof(obj) { return typeof obj; }; } else { noise_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return noise_typeof(obj); } - -function noise_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function noise_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function noise_createClass(Constructor, protoProps, staticProps) { if (protoProps) noise_defineProperties(Constructor.prototype, protoProps); if (staticProps) noise_defineProperties(Constructor, staticProps); return Constructor; } - -function noise_possibleConstructorReturn(self, call) { if (call && (noise_typeof(call) === "object" || typeof call === "function")) { return call; } return noise_assertThisInitialized(self); } - -function noise_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function noise_getPrototypeOf(o) { noise_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return noise_getPrototypeOf(o); } - -function noise_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) noise_setPrototypeOf(subClass, superClass); } - -function noise_setPrototypeOf(o, p) { noise_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return noise_setPrototypeOf(o, p); } - - - -var _whiteNoiseBuffer = function () { - var bufferSize = 2 * main.audiocontext.sampleRate; - var whiteBuffer = main.audiocontext.createBuffer(1, bufferSize, main.audiocontext.sampleRate); - var noiseData = whiteBuffer.getChannelData(0); - - for (var i = 0; i < bufferSize; i++) { - noiseData[i] = Math.random() * 2 - 1; - } - - whiteBuffer.type = 'white'; - return whiteBuffer; -}(); - -var _pinkNoiseBuffer = function () { - var bufferSize = 2 * main.audiocontext.sampleRate; - var pinkBuffer = main.audiocontext.createBuffer(1, bufferSize, main.audiocontext.sampleRate); - var noiseData = pinkBuffer.getChannelData(0); - var b0, b1, b2, b3, b4, b5, b6; - b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0.0; - - for (var i = 0; i < bufferSize; i++) { - var white = Math.random() * 2 - 1; - b0 = 0.99886 * b0 + white * 0.0555179; - b1 = 0.99332 * b1 + white * 0.0750759; - b2 = 0.969 * b2 + white * 0.153852; - b3 = 0.8665 * b3 + white * 0.3104856; - b4 = 0.55 * b4 + white * 0.5329522; - b5 = -0.7616 * b5 - white * 0.016898; - noiseData[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362; - noiseData[i] *= 0.11; - - b6 = white * 0.115926; - } - - pinkBuffer.type = 'pink'; - return pinkBuffer; -}(); - -var _brownNoiseBuffer = function () { - var bufferSize = 2 * main.audiocontext.sampleRate; - var brownBuffer = main.audiocontext.createBuffer(1, bufferSize, main.audiocontext.sampleRate); - var noiseData = brownBuffer.getChannelData(0); - var lastOut = 0.0; - - for (var i = 0; i < bufferSize; i++) { - var white = Math.random() * 2 - 1; - noiseData[i] = (lastOut + 0.02 * white) / 1.02; - lastOut = noiseData[i]; - noiseData[i] *= 3.5; - } - - brownBuffer.type = 'brown'; - return brownBuffer; -}(); -/** - * Noise is a type of oscillator that generates a buffer with random values. - * - * @class p5.Noise - * @extends p5.Oscillator - * @constructor - * @param {String} type Type of noise can be 'white' (default), - * 'brown' or 'pink'. - */ - - -var noise_Noise = -function (_Oscillator) { - noise_inherits(Noise, _Oscillator); - - function Noise(type) { - var _this; - - noise_classCallCheck(this, Noise); - - _this = noise_possibleConstructorReturn(this, noise_getPrototypeOf(Noise).call(this)); - var assignType; - delete _this.f; - delete _this.freq; - delete _this.oscillator; - - if (type === 'brown') { - assignType = _brownNoiseBuffer; - } else if (type === 'pink') { - assignType = _pinkNoiseBuffer; - } else { - assignType = _whiteNoiseBuffer; - } - - _this.buffer = assignType; - return _this; - } - /** - * Set type of noise to 'white', 'pink' or 'brown'. - * White is the default. - * - * @method setType - * @param {String} [type] 'white', 'pink' or 'brown' - */ - - - noise_createClass(Noise, [{ - key: "setType", - value: function setType(type) { - switch (type) { - case 'white': - this.buffer = _whiteNoiseBuffer; - break; - - case 'pink': - this.buffer = _pinkNoiseBuffer; - break; - - case 'brown': - this.buffer = _brownNoiseBuffer; - break; - - default: - this.buffer = _whiteNoiseBuffer; - } - - if (this.started) { - var now = main.audiocontext.currentTime; - this.stop(now); - this.start(now + 0.01); - } - } - }, { - key: "getType", - value: function getType() { - return this.buffer.type; - } - }, { - key: "start", - value: function start() { - if (this.started) { - this.stop(); - } - - this.noise = main.audiocontext.createBufferSource(); - this.noise.buffer = this.buffer; - this.noise.loop = true; - this.noise.connect(this.output); - var now = main.audiocontext.currentTime; - this.noise.start(now); - this.started = true; - } - }, { - key: "stop", - value: function stop() { - var now = main.audiocontext.currentTime; - - if (this.noise) { - this.noise.stop(now); - this.started = false; - } - } - }, { - key: "dispose", - value: function dispose() { - var now = main.audiocontext.currentTime; - - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.noise) { - this.noise.disconnect(); - this.stop(now); - } - - if (this.output) { - this.output.disconnect(); - } - - if (this.panner) { - this.panner.disconnect(); - } - - this.output = null; - this.panner = null; - this.buffer = null; - this.noise = null; - } - }]); - - return Noise; -}(oscillator); - - var noise = (noise_Noise); -var Signal = __webpack_require__(2); -var Signal_default = __webpack_require__.n(Signal); - -function pulse_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { pulse_typeof = function _typeof(obj) { return typeof obj; }; } else { pulse_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return pulse_typeof(obj); } - -function pulse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function pulse_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function pulse_createClass(Constructor, protoProps, staticProps) { if (protoProps) pulse_defineProperties(Constructor.prototype, protoProps); if (staticProps) pulse_defineProperties(Constructor, staticProps); return Constructor; } - -function pulse_possibleConstructorReturn(self, call) { if (call && (pulse_typeof(call) === "object" || typeof call === "function")) { return call; } return pulse_assertThisInitialized(self); } - -function pulse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function pulse_getPrototypeOf(o) { pulse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return pulse_getPrototypeOf(o); } - -function pulse_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) pulse_setPrototypeOf(subClass, superClass); } - -function pulse_setPrototypeOf(o, p) { pulse_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return pulse_setPrototypeOf(o, p); } - - - - - -/** - * Creates a Pulse object, an oscillator that implements - * Pulse Width Modulation. - * The pulse is created with two oscillators. - * Accepts a parameter for frequency, and to set the - * width between the pulses. See - * p5.Oscillator for a full list of methods. - * - * @class p5.Pulse - * @extends p5.Oscillator - * @constructor - * @param {Number} [freq] Frequency in oscillations per second (Hz) - * @param {Number} [w] Width between the pulses (0 to 1.0, - * defaults to 0) - * @example - *
            - * let pulse; - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(startPulse); - * background(220); - * - * pulse = new p5.Pulse(); - * pulse.amp(0.5); - * pulse.freq(220); - * } - * function startPulse() { - * pulse.start(); - * pulse.amp(0.5, 0.02); - * } - * function mouseReleased() { - * pulse.amp(0, 0.2); - * } - * function draw() { - * background(220); - * text('tap to play', 5, 20, width - 20); - * let w = map(mouseX, 0, width, 0, 1); - * w = constrain(w, 0, 1); - * pulse.width(w); - * text('pulse width: ' + w, 5, height - 20); - * } - *
            - */ - -var pulse_Pulse = -function (_Oscillator) { - pulse_inherits(Pulse, _Oscillator); - - function Pulse(freq, w) { - var _this; - - pulse_classCallCheck(this, Pulse); - - _this = pulse_possibleConstructorReturn(this, pulse_getPrototypeOf(Pulse).call(this, freq, 'sawtooth')); - - _this.w = w || 0; - - _this.osc2 = new SawOsc(freq); - - _this.dNode = main.audiocontext.createDelay(); - - _this.dcOffset = createDCOffset(); - _this.dcGain = main.audiocontext.createGain(); - - _this.dcOffset.connect(_this.dcGain); - - _this.dcGain.connect(_this.output); - - - _this.f = freq || 440; - var mW = _this.w / _this.oscillator.frequency.value; - _this.dNode.delayTime.value = mW; - _this.dcGain.gain.value = 1.7 * (0.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); - - return _this; - } - /** - * Set the width of a Pulse object (an oscillator that implements - * Pulse Width Modulation). - * - * @method width - * @param {Number} [width] Width between the pulses (0 to 1.0, - * defaults to 0) - */ - - - pulse_createClass(Pulse, [{ - key: "width", - value: function width(w) { - if (typeof w === 'number') { - if (w <= 1.0 && w >= 0.0) { - this.w = w; - - var mW = this.w / this.oscillator.frequency.value; - this.dNode.delayTime.value = mW; - } - - this.dcGain.gain.value = 1.7 * (0.5 - this.w); - } else { - w.connect(this.dNode.delayTime); - var sig = new Signal_default.a(-0.5); - - w.connect(sig); - var mult1 = new Multiply_default.a(-1); - var mult2 = new Multiply_default.a(1.7); - sig = sig.connect(mult1).connect(mult2); - sig.connect(this.dcGain.gain); - } - } - }, { - key: "start", - value: function start(f, time) { - var now = main.audiocontext.currentTime; - var t = time || 0; - - if (!this.started) { - var freq = f || this.f; - var type = this.oscillator.type; - this.oscillator = main.audiocontext.createOscillator(); - this.oscillator.frequency.setValueAtTime(freq, now); - this.oscillator.type = type; - this.oscillator.connect(this.output); - this.oscillator.start(t + now); - - this.osc2.oscillator = main.audiocontext.createOscillator(); - this.osc2.oscillator.frequency.setValueAtTime(freq, t + now); - this.osc2.oscillator.type = type; - this.osc2.oscillator.connect(this.osc2.output); - this.osc2.start(t + now); - this.freqNode = [this.oscillator.frequency, this.osc2.oscillator.frequency]; - - this.dcOffset = createDCOffset(); - this.dcOffset.connect(this.dcGain); - this.dcOffset.start(t + now); - - if (this.mods !== undefined && this.mods.frequency !== undefined) { - this.mods.frequency.connect(this.freqNode[0]); - this.mods.frequency.connect(this.freqNode[1]); - } - - this.started = true; - this.osc2.started = true; - } - } - }, { - key: "stop", - value: function stop(time) { - if (this.started) { - var t = time || 0; - var now = main.audiocontext.currentTime; - this.oscillator.stop(t + now); - - if (this.osc2.oscillator) { - this.osc2.oscillator.stop(t + now); - } - - this.dcOffset.stop(t + now); - this.started = false; - this.osc2.started = false; - } - } - }, { - key: "freq", - value: function freq(val) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - if (typeof val === 'number') { - this.f = val; - var now = main.audiocontext.currentTime; - var currentFreq = this.oscillator.frequency.value; - this.oscillator.frequency.cancelScheduledValues(now); - this.oscillator.frequency.setValueAtTime(currentFreq, now + tFromNow); - this.oscillator.frequency.exponentialRampToValueAtTime(val, tFromNow + rampTime + now); - this.osc2.oscillator.frequency.cancelScheduledValues(now); - this.osc2.oscillator.frequency.setValueAtTime(currentFreq, now + tFromNow); - this.osc2.oscillator.frequency.exponentialRampToValueAtTime(val, tFromNow + rampTime + now); - - if (this.freqMod) { - this.freqMod.output.disconnect(); - this.freqMod = null; - } - } else if (val.output) { - val.output.disconnect(); - val.output.connect(this.oscillator.frequency); - val.output.connect(this.osc2.oscillator.frequency); - this.freqMod = val; - } - } - }]); - - return Pulse; -}(oscillator); - - -function createDCOffset() { - var ac = main.audiocontext; - var buffer = ac.createBuffer(1, 2048, ac.sampleRate); - var data = buffer.getChannelData(0); - - for (var i = 0; i < 2048; i++) { - data[i] = 1.0; - } - - var bufferSource = ac.createBufferSource(); - bufferSource.buffer = buffer; - bufferSource.loop = true; - return bufferSource; -} - - var pulse = (pulse_Pulse); -function audioin_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function audioin_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function audioin_createClass(Constructor, protoProps, staticProps) { if (protoProps) audioin_defineProperties(Constructor.prototype, protoProps); if (staticProps) audioin_defineProperties(Constructor, staticProps); return Constructor; } - - - -main.inputSources = []; -/** - *

            Get audio from an input, i.e. your computer's microphone.

            - * - *

            Turn the mic on/off with the start() and stop() methods. When the mic - * is on, its volume can be measured with getLevel or by connecting an - * FFT object.

            - * - *

            If you want to hear the AudioIn, use the .connect() method. - * AudioIn does not connect to p5.sound output by default to prevent - * feedback.

            - * - *

            Note: This uses the getUserMedia/ - * Stream API, which is not supported by certain browsers. Access in Chrome browser - * is limited to localhost and https, but access over http may be limited.

            - * - * @class p5.AudioIn - * @constructor - * @param {Function} [errorCallback] A function to call if there is an error - * accessing the AudioIn. For example, - * Safari and iOS devices do not - * currently allow microphone access. - * @example - *
            - * let mic; - * - * function setup(){ - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(userStartAudio); - * textAlign(CENTER); - * mic = new p5.AudioIn(); - * mic.start(); - * } - * - * function draw(){ - * background(0); - * fill(255); - * text('tap to start', width/2, 20); - * - * micLevel = mic.getLevel(); - * let y = height - micLevel * height; - * ellipse(width/2, y, 10, 10); - * } - *
            - */ - -var audioin_AudioIn = -function () { - function AudioIn(errorCallback) { - audioin_classCallCheck(this, AudioIn); - - - /** - * @property {GainNode} input - */ - this.input = main.audiocontext.createGain(); - /** - * @property {GainNode} output - */ - - this.output = main.audiocontext.createGain(); - /** - * @property {MediaStream|null} stream - */ - - this.stream = null; - /** - * @property {MediaStreamAudioSourceNode|null} mediaStream - */ - - this.mediaStream = null; - /** - * @property {Number|null} currentSource - */ - - this.currentSource = null; - /** - * Client must allow browser to access their microphone / audioin source. - * Default: false. Will become true when the client enables access. - * - * @property {Boolean} enabled - */ - - this.enabled = false; - /** - * Input amplitude, connect to it by default but not to master out - * - * @property {p5.Amplitude} amplitude - */ - - this.amplitude = new amplitude(); - this.output.connect(this.amplitude.input); - - if (!window.MediaStreamTrack || !window.navigator.mediaDevices || !window.navigator.mediaDevices.getUserMedia) { - errorCallback ? errorCallback() : window.alert('This browser does not support MediaStreamTrack and mediaDevices'); - } - - - main.soundArray.push(this); - } - /** - * Start processing audio input. This enables the use of other - * AudioIn methods like getLevel(). Note that by default, AudioIn - * is not connected to p5.sound's output. So you won't hear - * anything unless you use the connect() method.
            - * - * Certain browsers limit access to the user's microphone. For example, - * Chrome only allows access from localhost and over https. For this reason, - * you may want to include an errorCallback—a function that is called in case - * the browser won't provide mic access. - * - * @method start - * @for p5.AudioIn - * @param {Function} [successCallback] Name of a function to call on - * success. - * @param {Function} [errorCallback] Name of a function to call if - * there was an error. For example, - * some browsers do not support - * getUserMedia. - */ - - - audioin_createClass(AudioIn, [{ - key: "start", - value: function start(successCallback, errorCallback) { - var self = this; - - if (this.stream) { - this.stop(); - } - - - var audioSource = main.inputSources[self.currentSource]; - var constraints = { - audio: { - sampleRate: main.audiocontext.sampleRate, - echoCancellation: false - } - }; - - if (main.inputSources[this.currentSource]) { - constraints.audio.deviceId = audioSource.deviceId; - } - - window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { - self.stream = stream; - self.enabled = true; - - self.mediaStream = main.audiocontext.createMediaStreamSource(stream); - self.mediaStream.connect(self.output); - - self.amplitude.setInput(self.output); - if (successCallback) successCallback(); - })["catch"](function (err) { - if (errorCallback) errorCallback(err);else console.error(err); - }); - } - /** - * Turn the AudioIn off. If the AudioIn is stopped, it cannot getLevel(). - * If re-starting, the user may be prompted for permission access. - * - * @method stop - * @for p5.AudioIn - */ - - }, { - key: "stop", - value: function stop() { - if (this.stream) { - this.stream.getTracks().forEach(function (track) { - track.stop(); - }); - this.mediaStream.disconnect(); - delete this.mediaStream; - delete this.stream; - } - } - /** - * Connect to an audio unit. If no parameter is provided, will - * connect to the main output (i.e. your speakers).
            - * - * @method connect - * @for p5.AudioIn - * @param {Object} [unit] An object that accepts audio input, - * such as an FFT - */ - - }, { - key: "connect", - value: function connect(unit) { - if (unit) { - if (unit.hasOwnProperty('input')) { - this.output.connect(unit.input); - } else if (unit.hasOwnProperty('analyser')) { - this.output.connect(unit.analyser); - } else { - this.output.connect(unit); - } - } else { - this.output.connect(main.input); - } - } - /** - * Disconnect the AudioIn from all audio units. For example, if - * connect() had been called, disconnect() will stop sending - * signal to your speakers.
            - * - * @method disconnect - * @for p5.AudioIn - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - - this.output.connect(this.amplitude.input); - } - } - /** - * Read the Amplitude (volume level) of an AudioIn. The AudioIn - * class contains its own instance of the Amplitude class to help - * make it easy to get a microphone's volume level. Accepts an - * optional smoothing value (0.0 < 1.0). NOTE: AudioIn must - * .start() before using .getLevel().
            - * - * @method getLevel - * @for p5.AudioIn - * @param {Number} [smoothing] Smoothing is 0.0 by default. - * Smooths values based on previous values. - * @return {Number} Volume level (between 0.0 and 1.0) - */ - - }, { - key: "getLevel", - value: function getLevel(smoothing) { - if (smoothing) { - this.amplitude.smoothing = smoothing; - } - - return this.amplitude.getLevel(); - } - /** - * Set amplitude (volume) of a mic input between 0 and 1.0.
            - * - * @method amp - * @for p5.AudioIn - * @param {Number} vol between 0 and 1.0 - * @param {Number} [time] ramp time (optional) - */ - - }, { - key: "amp", - value: function amp(vol, t) { - if (t) { - var rampTime = t || 0; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(main.audiocontext.currentTime); - this.output.gain.setValueAtTime(currentVol, main.audiocontext.currentTime); - this.output.gain.linearRampToValueAtTime(vol, rampTime + main.audiocontext.currentTime); - } else { - this.output.gain.cancelScheduledValues(main.audiocontext.currentTime); - this.output.gain.setValueAtTime(vol, main.audiocontext.currentTime); - } - } - /** - * Returns a list of available input sources. This is a wrapper - * for - * MediaDevices.enumerateDevices() - Web APIs | MDN - * and it returns a Promise. - * @method getSources - * @for p5.AudioIn - * @param {Function} [successCallback] This callback function handles the sources when they - * have been enumerated. The callback function - * receives the deviceList array as its only argument - * @param {Function} [errorCallback] This optional callback receives the error - * message as its argument. - * @returns {Promise} Returns a Promise that can be used in place of the callbacks, similar - * to the enumerateDevices() method - * @example - *
            - * let audioIn; - * - * function setup(){ - * text('getting sources...', 0, 20); - * audioIn = new p5.AudioIn(); - * audioIn.getSources(gotSources); - * } - * - * function gotSources(deviceList) { - * if (deviceList.length > 0) { - * //set the source to the first item in the deviceList array - * audioIn.setSource(0); - * let currentSource = deviceList[audioIn.currentSource]; - * text('set source to: ' + currentSource.deviceId, 5, 20, width); - * } - * } - *
            - */ - - }, { - key: "getSources", - value: function getSources(onSuccess, onError) { - return new Promise(function (resolve, reject) { - window.navigator.mediaDevices.enumerateDevices().then(function (devices) { - main.inputSources = devices.filter(function (device) { - return device.kind === 'audioinput'; - }); - resolve(main.inputSources); - - if (onSuccess) { - onSuccess(main.inputSources); - } - })["catch"](function (error) { - reject(error); - - if (onError) { - onError(error); - } else { - console.error('This browser does not support MediaStreamTrack.getSources()'); - } - }); - }); - } - /** - * Set the input source. Accepts a number representing a - * position in the array returned by getSources(). - * This is only available in browsers that support - * - * navigator.mediaDevices.enumerateDevices() - * - * @method setSource - * @for p5.AudioIn - * @param {number} num position of input source in the array - * @example - *
            - * let audioIn; - * - * function setup(){ - * text('getting sources...', 0, 20); - * audioIn = new p5.AudioIn(); - * audioIn.getSources(gotSources); - * } - * - * function gotSources(deviceList) { - * if (deviceList.length > 0) { - * //set the source to the first item in the deviceList array - * audioIn.setSource(0); - * let currentSource = deviceList[audioIn.currentSource]; - * text('set source to: ' + currentSource.deviceId, 5, 20, width); - * } - * } - *
            - */ - - }, { - key: "setSource", - value: function setSource(num) { - if (main.inputSources.length > 0 && num < main.inputSources.length) { - this.currentSource = num; - console.log('set source to ', main.inputSources[this.currentSource]); - } else { - console.log('unable to set input source'); - } - - - if (this.stream && this.stream.active) { - this.start(); - } - } - - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.stop(); - - if (this.output) { - this.output.disconnect(); - } - - if (this.amplitude) { - this.amplitude.disconnect(); - } - - delete this.amplitude; - delete this.output; - } - }]); - - return AudioIn; -}(); - - var audioin = (audioin_AudioIn); -var CrossFade = __webpack_require__(23); -var CrossFade_default = __webpack_require__.n(CrossFade); - -function effect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function effect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function effect_createClass(Constructor, protoProps, staticProps) { if (protoProps) effect_defineProperties(Constructor.prototype, protoProps); if (staticProps) effect_defineProperties(Constructor, staticProps); return Constructor; } - - - -/** - * Effect is a base class for audio effects in p5.
            - * This module handles the nodes and methods that are - * common and useful for current and future effects. - * - * - * This class is extended by p5.Distortion, - * p5.Compressor, - * p5.Delay, - * p5.Filter, - * p5.Reverb. - * - * @class p5.Effect - * @constructor - * - * @param {Object} [ac] Reference to the audio context of the p5 object - * @param {AudioNode} [input] Gain Node effect wrapper - * @param {AudioNode} [output] Gain Node effect wrapper - * @param {Object} [_drywet] Tone.JS CrossFade node (defaults to value: 1) - * @param {AudioNode} [wet] Effects that extend this class should connect - * to the wet signal to this gain node, so that dry and wet - * signals are mixed properly. - */ - -var effect_Effect = -function () { - function Effect() { - effect_classCallCheck(this, Effect); - - this.ac = main.audiocontext; - this.input = this.ac.createGain(); - this.output = this.ac.createGain(); - /** - * The p5.Effect class is built - * using Tone.js CrossFade - * @private - */ - - this._drywet = new CrossFade_default.a(1); - /** - * In classes that extend - * p5.Effect, connect effect nodes - * to the wet parameter - */ - - this.wet = this.ac.createGain(); - this.input.connect(this._drywet.a); - this.wet.connect(this._drywet.b); - - this._drywet.connect(this.output); - - this.connect(); - - main.soundArray.push(this); - } - /** - * Set the output volume of the filter. - * - * @method amp - * @for p5.Effect - * @param {Number} [vol] amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts until rampTime - * @param {Number} [tFromNow] schedule this event to happen in tFromNow seconds - */ - - - effect_createClass(Effect, [{ - key: "amp", - value: function amp(vol) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var now = main.audiocontext.currentTime; - var startTime = now + tFromNow; - var endTime = startTime + rampTime + 0.001; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(now); - this.output.gain.linearRampToValueAtTime(currentVol, startTime + 0.001); - this.output.gain.linearRampToValueAtTime(vol, endTime); - } - /** - * Link effects together in a chain - * Example usage: filter.chain(reverb, delay, panner); - * May be used with an open-ended number of arguments - * - * @method chain - * @for p5.Effect - * @param {Object} [arguments] Chain together multiple sound objects - */ - - }, { - key: "chain", - value: function chain() { - if (arguments.length > 0) { - this.connect(arguments[0]); - - for (var i = 1; i < arguments.length; i += 1) { - arguments[i - 1].connect(arguments[i]); - } - } - - return this; - } - /** - * Adjust the dry/wet value. - * - * @method drywet - * @for p5.Effect - * @param {Number} [fade] The desired drywet value (0 - 1.0) - */ - - }, { - key: "drywet", - value: function drywet(fade) { - if (typeof fade !== 'undefined') { - this._drywet.fade.value = fade; - } - - return this._drywet.fade.value; - } - /** - * Send output to a p5.js-sound, Web Audio Node, or use signal to - * control an AudioParam - * - * @method connect - * @for p5.Effect - * @param {Object} unit - */ - - }, { - key: "connect", - value: function connect(unit) { - var u = unit || p5.soundOut.input; - this.output.connect(u.input ? u.input : u); - } - /** - * Disconnect all output. - * @method disconnect - * @for p5.Effect - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - } - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.input) { - this.input.disconnect(); - delete this.input; - } - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - - if (this._drywet) { - this._drywet.disconnect(); - - delete this._drywet; - } - - if (this.wet) { - this.wet.disconnect(); - delete this.wet; - } - - this.ac = undefined; - } - }]); - - return Effect; -}(); - - var effect = (effect_Effect); -function filter_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { filter_typeof = function _typeof(obj) { return typeof obj; }; } else { filter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return filter_typeof(obj); } - -function filter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function filter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function filter_createClass(Constructor, protoProps, staticProps) { if (protoProps) filter_defineProperties(Constructor.prototype, protoProps); if (staticProps) filter_defineProperties(Constructor, staticProps); return Constructor; } - -function filter_possibleConstructorReturn(self, call) { if (call && (filter_typeof(call) === "object" || typeof call === "function")) { return call; } return filter_assertThisInitialized(self); } - -function filter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } - -function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = filter_getPrototypeOf(object); if (object === null) break; } return object; } - -function filter_getPrototypeOf(o) { filter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return filter_getPrototypeOf(o); } - -function filter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) filter_setPrototypeOf(subClass, superClass); } - -function filter_setPrototypeOf(o, p) { filter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return filter_setPrototypeOf(o, p); } - - -/** - *

            A p5.Filter uses a Web Audio Biquad Filter to filter - * the frequency response of an input source. Subclasses - * include:

            - * p5.LowPass: - * Allows frequencies below the cutoff frequency to pass through, - * and attenuates frequencies above the cutoff.
            - * p5.HighPass: - * The opposite of a lowpass filter.
            - * p5.BandPass: - * Allows a range of frequencies to pass through and attenuates - * the frequencies below and above this frequency range.
            - * - * The .res() method controls either width of the - * bandpass, or resonance of the low/highpass cutoff frequency. - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Filter - * @extends p5.Effect - * @constructor - * @param {String} [type] 'lowpass' (default), 'highpass', 'bandpass' - * @example - *
            - * let fft, noise, filter; - * - * function setup() { - * let cnv = createCanvas(100,100); - * cnv.mousePressed(makeNoise); - * fill(255, 0, 255); - * - * filter = new p5.BandPass(); - * noise = new p5.Noise(); - * noise.disconnect(); - * noise.connect(filter); - * - * fft = new p5.FFT(); - * } - * - * function draw() { - * background(220); - * - * // set the BandPass frequency based on mouseX - * let freq = map(mouseX, 0, width, 20, 10000); - * freq = constrain(freq, 0, 22050); - * filter.freq(freq); - * // give the filter a narrow band (lower res = wider bandpass) - * filter.res(50); - * - * // draw filtered spectrum - * let spectrum = fft.analyze(); - * noStroke(); - * for (let i = 0; i < spectrum.length; i++) { - * let x = map(i, 0, spectrum.length, 0, width); - * let h = -height + map(spectrum[i], 0, 255, height, 0); - * rect(x, height, width/spectrum.length, h); - * } - * if (!noise.started) { - * text('tap here and drag to change frequency', 10, 20, width - 20); - * } else { - * text('Frequency: ' + round(freq)+'Hz', 20, 20, width - 20); - * } - * } - * - * function makeNoise() { - * // see also: `userStartAudio()` - * noise.start(); - * noise.amp(0.5, 0.2); - * } - * - * function mouseReleased() { - * noise.amp(0, 0.2); - * } - * - *
            - */ - -var Filter = -function (_Effect) { - filter_inherits(Filter, _Effect); - - function Filter(type) { - var _this; - - filter_classCallCheck(this, Filter); - - _this = filter_possibleConstructorReturn(this, filter_getPrototypeOf(Filter).call(this)); - - /** - * The p5.Filter is built with a - * - * Web Audio BiquadFilter Node. - * - * @property {DelayNode} biquadFilter - */ - - _this.biquad = _this.ac.createBiquadFilter(); - - _this.input.connect(_this.biquad); - - _this.biquad.connect(_this.wet); - - if (type) { - _this.setType(type); - } - - - _this._on = true; - _this._untoggledType = _this.biquad.type; - return _this; - } - /** - * Filter an audio signal according to a set - * of filter parameters. - * - * @method process - * @param {Object} Signal An object that outputs audio - * @param {Number} [freq] Frequency in Hz, from 10 to 22050 - * @param {Number} [res] Resonance/Width of the filter frequency - * from 0.001 to 1000 - */ - - - filter_createClass(Filter, [{ - key: "process", - value: function process(src, freq, res, time) { - src.connect(this.input); - this.set(freq, res, time); - } - /** - * Set the frequency and the resonance of the filter. - * - * @method set - * @param {Number} [freq] Frequency in Hz, from 10 to 22050 - * @param {Number} [res] Resonance (Q) from 0.001 to 1000 - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - - }, { - key: "set", - value: function set(freq, res, time) { - if (freq) { - this.freq(freq, time); - } - - if (res) { - this.res(res, time); - } - } - /** - * Set the filter frequency, in Hz, from 10 to 22050 (the range of - * human hearing, although in reality most people hear in a narrower - * range). - * - * @method freq - * @param {Number} freq Filter Frequency - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @return {Number} value Returns the current frequency value - */ - - }, { - key: "freq", - value: function freq(_freq, time) { - var t = time || 0; - - if (_freq <= 0) { - _freq = 1; - } - - if (typeof _freq === 'number') { - this.biquad.frequency.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.biquad.frequency.exponentialRampToValueAtTime(_freq, this.ac.currentTime + 0.02 + t); - } else if (_freq) { - _freq.connect(this.biquad.frequency); - } - - return this.biquad.frequency.value; - } - /** - * Controls either width of a bandpass frequency, - * or the resonance of a low/highpass cutoff frequency. - * - * @method res - * @param {Number} res Resonance/Width of filter freq - * from 0.001 to 1000 - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @return {Number} value Returns the current res value - */ - - }, { - key: "res", - value: function res(_res, time) { - var t = time || 0; - - if (typeof _res === 'number') { - this.biquad.Q.value = _res; - this.biquad.Q.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.biquad.Q.linearRampToValueAtTime(_res, this.ac.currentTime + 0.02 + t); - } else if (_res) { - _res.connect(this.biquad.Q); - } - - return this.biquad.Q.value; - } - /** - * Controls the gain attribute of a Biquad Filter. - * This is distinctly different from .amp() which is inherited from p5.Effect - * .amp() controls the volume via the output gain node - * p5.Filter.gain() controls the gain parameter of a Biquad Filter node. - * - * @method gain - * @param {Number} gain - * @return {Number} Returns the current or updated gain value - */ - - }, { - key: "gain", - value: function gain(_gain, time) { - var t = time || 0; - - if (typeof _gain === 'number') { - this.biquad.gain.value = _gain; - this.biquad.gain.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.biquad.gain.linearRampToValueAtTime(_gain, this.ac.currentTime + 0.02 + t); - } else if (_gain) { - _gain.connect(this.biquad.gain); - } - - return this.biquad.gain.value; - } - /** - * Toggle function. Switches between the specified type and allpass - * - * @method toggle - * @return {boolean} [Toggle value] - */ - - }, { - key: "toggle", - value: function toggle() { - this._on = !this._on; - - if (this._on === true) { - this.biquad.type = this._untoggledType; - } else if (this._on === false) { - this.biquad.type = 'allpass'; - } - - return this._on; - } - /** - * Set the type of a p5.Filter. Possible types include: - * "lowpass" (default), "highpass", "bandpass", - * "lowshelf", "highshelf", "peaking", "notch", - * "allpass". - * - * @method setType - * @param {String} t - */ - - }, { - key: "setType", - value: function setType(t) { - this.biquad.type = t; - this._untoggledType = this.biquad.type; - } - }, { - key: "dispose", - value: function dispose() { - _get(filter_getPrototypeOf(Filter.prototype), "dispose", this).call(this); - - if (this.biquad) { - this.biquad.disconnect(); - delete this.biquad; - } - } - }]); - - return Filter; -}(effect); -/** - * Constructor: new p5.LowPass() Filter. - * This is the same as creating a p5.Filter and then calling - * its method setType('lowpass'). - * See p5.Filter for methods. - * - * @class p5.LowPass - * @constructor - * @extends p5.Filter - */ - - -var LowPass = -function (_Filter) { - filter_inherits(LowPass, _Filter); - - function LowPass() { - filter_classCallCheck(this, LowPass); - - return filter_possibleConstructorReturn(this, filter_getPrototypeOf(LowPass).call(this, 'lowpass')); - } - - return LowPass; -}(Filter); -/** - * Constructor: new p5.HighPass() Filter. - * This is the same as creating a p5.Filter and then calling - * its method setType('highpass'). - * See p5.Filter for methods. - * - * @class p5.HighPass - * @constructor - * @extends p5.Filter - */ - - -var HighPass = -function (_Filter2) { - filter_inherits(HighPass, _Filter2); - - function HighPass() { - filter_classCallCheck(this, HighPass); - - return filter_possibleConstructorReturn(this, filter_getPrototypeOf(HighPass).call(this, 'highpass')); - } - - return HighPass; -}(Filter); -/** - * Constructor: new p5.BandPass() Filter. - * This is the same as creating a p5.Filter and then calling - * its method setType('bandpass'). - * See p5.Filter for methods. - * - * @class p5.BandPass - * @constructor - * @extends p5.Filter - */ - - -var BandPass = -function (_Filter3) { - filter_inherits(BandPass, _Filter3); - - function BandPass() { - filter_classCallCheck(this, BandPass); - - return filter_possibleConstructorReturn(this, filter_getPrototypeOf(BandPass).call(this, 'bandpass')); - } - - return BandPass; -}(Filter); - - var filter = (Filter); - -function eqFilter_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { eqFilter_typeof = function _typeof(obj) { return typeof obj; }; } else { eqFilter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return eqFilter_typeof(obj); } - -function eqFilter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function eqFilter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function eqFilter_createClass(Constructor, protoProps, staticProps) { if (protoProps) eqFilter_defineProperties(Constructor.prototype, protoProps); if (staticProps) eqFilter_defineProperties(Constructor, staticProps); return Constructor; } - -function eqFilter_possibleConstructorReturn(self, call) { if (call && (eqFilter_typeof(call) === "object" || typeof call === "function")) { return call; } return eqFilter_assertThisInitialized(self); } - -function eqFilter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function eqFilter_getPrototypeOf(o) { eqFilter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return eqFilter_getPrototypeOf(o); } - -function eqFilter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) eqFilter_setPrototypeOf(subClass, superClass); } - -function eqFilter_setPrototypeOf(o, p) { eqFilter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return eqFilter_setPrototypeOf(o, p); } - - - -/** - * EQFilter extends p5.Filter with constraints - * necessary for the p5.EQ - * - * @private - */ - -var eqFilter_EQFilter = -function (_Filter) { - eqFilter_inherits(EQFilter, _Filter); - - function EQFilter(freq, res) { - var _this; - - eqFilter_classCallCheck(this, EQFilter); - - _this = eqFilter_possibleConstructorReturn(this, eqFilter_getPrototypeOf(EQFilter).call(this, 'peaking')); - - _this.disconnect(); - - _this.set(freq, res); - - _this.biquad.gain.value = 0; - delete _this.input; - delete _this.output; - delete _this._drywet; - delete _this.wet; - return _this; - } - - eqFilter_createClass(EQFilter, [{ - key: "amp", - value: function amp() { - console.warn('`amp()` is not available for p5.EQ bands. Use `.gain()`'); - } - }, { - key: "drywet", - value: function drywet() { - console.warn('`drywet()` is not available for p5.EQ bands.'); - } - }, { - key: "connect", - value: function connect(unit) { - var u = unit || p5.soundOut.input; - - if (this.biquad) { - this.biquad.connect(u.input ? u.input : u); - } else { - this.output.connect(u.input ? u.input : u); - } - } - }, { - key: "disconnect", - value: function disconnect() { - if (this.biquad) { - this.biquad.disconnect(); - } - } - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.disconnect(); - delete this.biquad; - } - }]); - - return EQFilter; -}(filter); - - var eqFilter = (eqFilter_EQFilter); -function eq_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { eq_typeof = function _typeof(obj) { return typeof obj; }; } else { eq_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return eq_typeof(obj); } - -function eq_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function eq_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function eq_createClass(Constructor, protoProps, staticProps) { if (protoProps) eq_defineProperties(Constructor.prototype, protoProps); if (staticProps) eq_defineProperties(Constructor, staticProps); return Constructor; } - -function eq_possibleConstructorReturn(self, call) { if (call && (eq_typeof(call) === "object" || typeof call === "function")) { return call; } return eq_assertThisInitialized(self); } - -function eq_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function eq_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { eq_get = Reflect.get; } else { eq_get = function _get(target, property, receiver) { var base = eq_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return eq_get(target, property, receiver || target); } - -function eq_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = eq_getPrototypeOf(object); if (object === null) break; } return object; } - -function eq_getPrototypeOf(o) { eq_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return eq_getPrototypeOf(o); } - -function eq_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) eq_setPrototypeOf(subClass, superClass); } - -function eq_setPrototypeOf(o, p) { eq_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return eq_setPrototypeOf(o, p); } - - - -/** - * p5.EQ is an audio effect that performs the function of a multiband - * audio equalizer. Equalization is used to adjust the balance of - * frequency compoenents of an audio signal. This process is commonly used - * in sound production and recording to change the waveform before it reaches - * a sound output device. EQ can also be used as an audio effect to create - * interesting distortions by filtering out parts of the spectrum. p5.EQ is - * built using a chain of Web Audio Biquad Filter Nodes and can be - * instantiated with 3 or 8 bands. Bands can be added or removed from - * the EQ by directly modifying p5.EQ.bands (the array that stores filters). - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.EQ - * @constructor - * @extends p5.Effect - * @param {Number} [_eqsize] Constructor will accept 3 or 8, defaults to 3 - * @return {Object} p5.EQ object - * - * @example - *
            - * let eq, soundFile - * let eqBandIndex = 0; - * let eqBandNames = ['lows', 'mids', 'highs']; - * - * function preload() { - * soundFormats('mp3', 'ogg'); - * soundFile = loadSound('assets/beat'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(toggleSound); - * - * eq = new p5.EQ(eqBandNames.length); - * soundFile.disconnect(); - * eq.process(soundFile); - * } - * - * function draw() { - * background(30); - * noStroke(); - * fill(255); - * textAlign(CENTER); - * text('filtering ', 50, 25); - * - * fill(255, 40, 255); - * textSize(26); - * text(eqBandNames[eqBandIndex], 50, 55); - * - * fill(255); - * textSize(9); - * - * if (!soundFile.isPlaying()) { - * text('tap to play', 50, 80); - * } else { - * text('tap to filter next band', 50, 80) - * } - * } - * - * function toggleSound() { - * if (!soundFile.isPlaying()) { - * soundFile.play(); - * } else { - * eqBandIndex = (eqBandIndex + 1) % eq.bands.length; - * } - * - * for (let i = 0; i < eq.bands.length; i++) { - * eq.bands[i].gain(0); - * } - * // filter the band we want to filter - * eq.bands[eqBandIndex].gain(-40); - * } - *
            - */ - -var eq_EQ = -function (_Effect) { - eq_inherits(EQ, _Effect); - - function EQ(_eqsize) { - var _this; - - eq_classCallCheck(this, EQ); - - _this = eq_possibleConstructorReturn(this, eq_getPrototypeOf(EQ).call(this)); - - _eqsize = _eqsize === 3 || _eqsize === 8 ? _eqsize : 3; - var factor; - _eqsize === 3 ? factor = Math.pow(2, 3) : factor = 2; - /** - * The p5.EQ is built with abstracted p5.Filter objects. - * To modify any bands, use methods of the - * p5.Filter API, especially `gain` and `freq`. - * Bands are stored in an array, with indices 0 - 3, or 0 - 7 - * @property {Array} bands - * - */ - - _this.bands = []; - var freq, res; - - for (var i = 0; i < _eqsize; i++) { - if (i === _eqsize - 1) { - freq = 21000; - res = 0.01; - } else if (i === 0) { - freq = 100; - res = 0.1; - } else if (i === 1) { - freq = _eqsize === 3 ? 360 * factor : 360; - res = 1; - } else { - freq = _this.bands[i - 1].freq() * factor; - res = 1; - } - - _this.bands[i] = _this._newBand(freq, res); - - if (i > 0) { - _this.bands[i - 1].connect(_this.bands[i].biquad); - } else { - _this.input.connect(_this.bands[i].biquad); - } - } - - _this.bands[_eqsize - 1].connect(_this.output); - - return _this; - } - /** - * Process an input by connecting it to the EQ - * @method process - * @param {Object} src Audio source - */ - - - eq_createClass(EQ, [{ - key: "process", - value: function process(src) { - src.connect(this.input); - } - // * Set the frequency and gain of each band in the EQ. This method should be - // * called with 3 or 8 frequency and gain pairs, depending on the size of the EQ. - // * ex. eq.set(freq0, gain0, freq1, gain1, freq2, gain2); - // * - // * @method set - // * @for p5.EQ - // * @param {Number} [freq0] Frequency value for band with index 0 - // * @param {Number} [gain0] Gain value for band with index 0 - // * @param {Number} [freq1] Frequency value for band with index 1 - // * @param {Number} [gain1] Gain value for band with index 1 - // * @param {Number} [freq2] Frequency value for band with index 2 - // * @param {Number} [gain2] Gain value for band with index 2 - // * @param {Number} [freq3] Frequency value for band with index 3 - // * @param {Number} [gain3] Gain value for band with index 3 - // * @param {Number} [freq4] Frequency value for band with index 4 - // * @param {Number} [gain4] Gain value for band with index 4 - // * @param {Number} [freq5] Frequency value for band with index 5 - // * @param {Number} [gain5] Gain value for band with index 5 - // * @param {Number} [freq6] Frequency value for band with index 6 - // * @param {Number} [gain6] Gain value for band with index 6 - // * @param {Number} [freq7] Frequency value for band with index 7 - // * @param {Number} [gain7] Gain value for band with index 7 - // */ - - }, { - key: "set", - value: function set() { - if (arguments.length === this.bands.length * 2) { - for (var i = 0; i < arguments.length; i += 2) { - this.bands[i / 2].freq(arguments[i]); - this.bands[i / 2].gain(arguments[i + 1]); - } - } else { - console.error('Argument mismatch. .set() should be called with ' + this.bands.length * 2 + ' arguments. (one frequency and gain value pair for each band of the eq)'); - } - } - /** - * Add a new band. Creates a p5.Filter and strips away everything but - * the raw biquad filter. This method returns an abstracted p5.Filter, - * which can be added to p5.EQ.bands, in order to create new EQ bands. - * @private - * @for p5.EQ - * @method _newBand - * @param {Number} freq - * @param {Number} res - * @return {Object} Abstracted Filter - */ - - }, { - key: "_newBand", - value: function _newBand(freq, res) { - return new eqFilter(freq, res); - } - }, { - key: "dispose", - value: function dispose() { - eq_get(eq_getPrototypeOf(EQ.prototype), "dispose", this).call(this); - - if (this.bands) { - while (this.bands.length > 0) { - delete this.bands.pop().dispose(); - } - - delete this.bands; - } - } - }]); - - return EQ; -}(effect); - - var eq = (eq_EQ); -function listener3d_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function listener3d_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function listener3d_createClass(Constructor, protoProps, staticProps) { if (protoProps) listener3d_defineProperties(Constructor.prototype, protoProps); if (staticProps) listener3d_defineProperties(Constructor, staticProps); return Constructor; } - -// * listener is a class that can construct both a Spatial Panner -// * and a Spatial Listener. The panner is based on the -// * Web Audio Spatial Panner Node -// * https://www.w3.org/TR/webaudio/#the-listenernode-interface -// * This panner is a spatial processing node that allows audio to be positioned -// * and oriented in 3D space. -// * -// * The Listener modifies the properties of the Audio Context Listener. -// * Both objects types use the same methods. The default is a spatial panner. -// * -// * p5.Panner3D - Constructs a Spatial Panner
            -// * p5.Listener3D - Constructs a Spatial Listener
            -// * -// * @class listener -// * @constructor -// * @return {Object} p5.Listener3D Object -// * -// * @param {Web Audio Node} listener Web Audio Spatial Panning Node -// * @param {AudioParam} listener.panningModel "equal power" or "HRTF" -// * @param {AudioParam} listener.distanceModel "linear", "inverse", or "exponential" -// * @param {String} [type] [Specify construction of a spatial panner or listener] -// */ - -var listener3d_Listener3D = -function () { - function Listener3D(type) { - listener3d_classCallCheck(this, Listener3D); - - this.ac = main.audiocontext; - this.listener = this.ac.listener; - } - // * Connect an audio sorce - // * @param {Object} src Input source - // */ - - - listener3d_createClass(Listener3D, [{ - key: "process", - value: function process(src) { - src.connect(this.input); - } - // * Set the X,Y,Z position of the Panner - // * @param {[Number]} xVal - // * @param {[Number]} yVal - // * @param {[Number]} zVal - // * @param {[Number]} time - // * @return {[Array]} [Updated x, y, z values as an array] - // */ - - }, { - key: "position", - value: function position(xVal, yVal, zVal, time) { - this.positionX(xVal, time); - this.positionY(yVal, time); - this.positionZ(zVal, time); - return [this.listener.positionX.value, this.listener.positionY.value, this.listener.positionZ.value]; - } - // * Getter and setter methods for position coordinates - // * @return {Number} [updated coordinate value] - // */ - - }, { - key: "positionX", - value: function positionX(xVal, time) { - var t = time || 0; - - if (typeof xVal === 'number') { - this.listener.positionX.value = xVal; - this.listener.positionX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.positionX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); - } else if (xVal) { - xVal.connect(this.listener.positionX); - } - - return this.listener.positionX.value; - } - }, { - key: "positionY", - value: function positionY(yVal, time) { - var t = time || 0; - - if (typeof yVal === 'number') { - this.listener.positionY.value = yVal; - this.listener.positionY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.positionY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); - } else if (yVal) { - yVal.connect(this.listener.positionY); - } - - return this.listener.positionY.value; - } - }, { - key: "positionZ", - value: function positionZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === 'number') { - this.listener.positionZ.value = zVal; - this.listener.positionZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.positionZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); - } else if (zVal) { - zVal.connect(this.listener.positionZ); - } - - return this.listener.positionZ.value; - } - // * Overrides the listener orient() method because Listener has slightly - // * different params. In human terms, Forward vectors are the direction the - // * nose is pointing. Up vectors are the direction of the top of the head. - // * - // * @method orient - // * @param {Number} xValF Forward vector X direction - // * @param {Number} yValF Forward vector Y direction - // * @param {Number} zValF Forward vector Z direction - // * @param {Number} xValU Up vector X direction - // * @param {Number} yValU Up vector Y direction - // * @param {Number} zValU Up vector Z direction - // * @param {Number} time - // * @return {Array} All orienation params - // */ - - }, { - key: "orient", - value: function orient(xValF, yValF, zValF, xValU, yValU, zValU, time) { - if (arguments.length === 3 || arguments.length === 4) { - time = arguments[3]; - this.orientForward(xValF, yValF, zValF, time); - } else if (arguments.length === 6 || arguments === 7) { - this.orientForward(xValF, yValF, zValF); - this.orientUp(xValU, yValU, zValU, time); - } - - return [this.listener.forwardX.value, this.listener.forwardY.value, this.listener.forwardZ.value, this.listener.upX.value, this.listener.upY.value, this.listener.upZ.value]; - } - }, { - key: "orientForward", - value: function orientForward(xValF, yValF, zValF, time) { - this.forwardX(xValF, time); - this.forwardY(yValF, time); - this.forwardZ(zValF, time); - return [this.listener.forwardX, this.listener.forwardY, this.listener.forwardZ]; - } - }, { - key: "orientUp", - value: function orientUp(xValU, yValU, zValU, time) { - this.upX(xValU, time); - this.upY(yValU, time); - this.upZ(zValU, time); - return [this.listener.upX, this.listener.upY, this.listener.upZ]; - } - // * Getter and setter methods for orient coordinates - // * @return {Number} [updated coordinate value] - // */ - - }, { - key: "forwardX", - value: function forwardX(xVal, time) { - var t = time || 0; - - if (typeof xVal === 'number') { - this.listener.forwardX.value = xVal; - this.listener.forwardX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.forwardX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); - } else if (xVal) { - xVal.connect(this.listener.forwardX); - } - - return this.listener.forwardX.value; - } - }, { - key: "forwardY", - value: function forwardY(yVal, time) { - var t = time || 0; - - if (typeof yVal === 'number') { - this.listener.forwardY.value = yVal; - this.listener.forwardY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.forwardY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); - } else if (yVal) { - yVal.connect(this.listener.forwardY); - } - - return this.listener.forwardY.value; - } - }, { - key: "forwardZ", - value: function forwardZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === 'number') { - this.listener.forwardZ.value = zVal; - this.listener.forwardZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.forwardZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); - } else if (zVal) { - zVal.connect(this.listener.forwardZ); - } - - return this.listener.forwardZ.value; - } - }, { - key: "upX", - value: function upX(xVal, time) { - var t = time || 0; - - if (typeof xVal === 'number') { - this.listener.upX.value = xVal; - this.listener.upX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.upX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); - } else if (xVal) { - xVal.connect(this.listener.upX); - } - - return this.listener.upX.value; - } - }, { - key: "upY", - value: function upY(yVal, time) { - var t = time || 0; - - if (typeof yVal === 'number') { - this.listener.upY.value = yVal; - this.listener.upY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.upY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); - } else if (yVal) { - yVal.connect(this.listener.upY); - } - - return this.listener.upY.value; - } - }, { - key: "upZ", - value: function upZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === 'number') { - this.listener.upZ.value = zVal; - this.listener.upZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.listener.upZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); - } else if (zVal) { - zVal.connect(this.listener.upZ); - } - - return this.listener.upZ.value; - } - }]); - - return Listener3D; -}(); - - var listener3d = (listener3d_Listener3D); -function panner3d_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { panner3d_typeof = function _typeof(obj) { return typeof obj; }; } else { panner3d_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return panner3d_typeof(obj); } - -function panner3d_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function panner3d_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function panner3d_createClass(Constructor, protoProps, staticProps) { if (protoProps) panner3d_defineProperties(Constructor.prototype, protoProps); if (staticProps) panner3d_defineProperties(Constructor, staticProps); return Constructor; } - -function panner3d_possibleConstructorReturn(self, call) { if (call && (panner3d_typeof(call) === "object" || typeof call === "function")) { return call; } return panner3d_assertThisInitialized(self); } - -function panner3d_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function panner3d_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { panner3d_get = Reflect.get; } else { panner3d_get = function _get(target, property, receiver) { var base = panner3d_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return panner3d_get(target, property, receiver || target); } - -function panner3d_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = panner3d_getPrototypeOf(object); if (object === null) break; } return object; } - -function panner3d_getPrototypeOf(o) { panner3d_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return panner3d_getPrototypeOf(o); } - -function panner3d_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) panner3d_setPrototypeOf(subClass, superClass); } - -function panner3d_setPrototypeOf(o, p) { panner3d_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return panner3d_setPrototypeOf(o, p); } - - -/** - * Panner3D is based on the - * Web Audio Spatial Panner Node. - * This panner is a spatial processing node that allows audio to be positioned - * and oriented in 3D space. - * - * The position is relative to an - * Audio Context Listener, which can be accessed - * by p5.soundOut.audiocontext.listener - * - * - * @class p5.Panner3D - * @constructor - */ - -var Panner3D = -function (_Effect) { - panner3d_inherits(Panner3D, _Effect); - - function Panner3D() { - var _this; - - panner3d_classCallCheck(this, Panner3D); - - _this = panner3d_possibleConstructorReturn(this, panner3d_getPrototypeOf(Panner3D).call(this)); - /** - * - * Web Audio Spatial Panner Node - * - * Properties include
            - * [Panning Model](https://www.w3.org/TR/webaudio/#idl-def-PanningModelType) - * : "equal power" or "HRTF"
            - * [DistanceModel](https://www.w3.org/TR/webaudio/#idl-def-DistanceModelType) - * : "linear", "inverse", or "exponential" - * - * @property {AudioNode} panner - * - */ - - _this.panner = _this.ac.createPanner(); - _this.panner.panningModel = 'HRTF'; - _this.panner.distanceModel = 'linear'; - - _this.panner.connect(_this.output); - - _this.input.connect(_this.panner); - - return _this; - } - /** - * Connect an audio sorce - * - * @method process - * @for p5.Panner3D - * @param {Object} src Input source - */ - - - panner3d_createClass(Panner3D, [{ - key: "process", - value: function process(src) { - src.connect(this.input); - } - /** - * Set the X,Y,Z position of the Panner - * @method set - * @for p5.Panner3D - * @param {Number} xVal - * @param {Number} yVal - * @param {Number} zVal - * @param {Number} time - * @return {Array} Updated x, y, z values as an array - */ - - }, { - key: "set", - value: function set(xVal, yVal, zVal, time) { - this.positionX(xVal, time); - this.positionY(yVal, time); - this.positionZ(zVal, time); - return [this.panner.positionX.value, this.panner.positionY.value, this.panner.positionZ.value]; - } - /** - * Getter and setter methods for position coordinates - * @method positionX - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for position coordinates - * @method positionY - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for position coordinates - * @method positionZ - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - }, { - key: "positionX", - value: function positionX(xVal, time) { - var t = time || 0; - - if (typeof xVal === 'number') { - this.panner.positionX.value = xVal; - this.panner.positionX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.panner.positionX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); - } else if (xVal) { - xVal.connect(this.panner.positionX); - } - - return this.panner.positionX.value; - } - }, { - key: "positionY", - value: function positionY(yVal, time) { - var t = time || 0; - - if (typeof yVal === 'number') { - this.panner.positionY.value = yVal; - this.panner.positionY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.panner.positionY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); - } else if (yVal) { - yVal.connect(this.panner.positionY); - } - - return this.panner.positionY.value; - } - }, { - key: "positionZ", - value: function positionZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === 'number') { - this.panner.positionZ.value = zVal; - this.panner.positionZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.panner.positionZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); - } else if (zVal) { - zVal.connect(this.panner.positionZ); - } - - return this.panner.positionZ.value; - } - /** - * Set the X,Y,Z position of the Panner - * @method orient - * @for p5.Panner3D - * @param {Number} xVal - * @param {Number} yVal - * @param {Number} zVal - * @param {Number} time - * @return {Array} Updated x, y, z values as an array - */ - - }, { - key: "orient", - value: function orient(xVal, yVal, zVal, time) { - this.orientX(xVal, time); - this.orientY(yVal, time); - this.orientZ(zVal, time); - return [this.panner.orientationX.value, this.panner.orientationY.value, this.panner.orientationZ.value]; - } - /** - * Getter and setter methods for orient coordinates - * @method orientX - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for orient coordinates - * @method orientY - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for orient coordinates - * @method orientZ - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - }, { - key: "orientX", - value: function orientX(xVal, time) { - var t = time || 0; - - if (typeof xVal === 'number') { - this.panner.orientationX.value = xVal; - this.panner.orientationX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.panner.orientationX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); - } else if (xVal) { - xVal.connect(this.panner.orientationX); - } - - return this.panner.orientationX.value; - } - }, { - key: "orientY", - value: function orientY(yVal, time) { - var t = time || 0; - - if (typeof yVal === 'number') { - this.panner.orientationY.value = yVal; - this.panner.orientationY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.panner.orientationY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); - } else if (yVal) { - yVal.connect(this.panner.orientationY); - } - - return this.panner.orientationY.value; - } - }, { - key: "orientZ", - value: function orientZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === 'number') { - this.panner.orientationZ.value = zVal; - this.panner.orientationZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.panner.orientationZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); - } else if (zVal) { - zVal.connect(this.panner.orientationZ); - } - - return this.panner.orientationZ.value; - } - /** - * Set the rolloff factor and max distance - * @method setFalloff - * @for p5.Panner3D - * @param {Number} [maxDistance] - * @param {Number} [rolloffFactor] - */ - - }, { - key: "setFalloff", - value: function setFalloff(maxDistance, rolloffFactor) { - this.maxDist(maxDistance); - this.rolloff(rolloffFactor); - } - /** - * Maxium distance between the source and the listener - * @method maxDist - * @for p5.Panner3D - * @param {Number} maxDistance - * @return {Number} updated value - */ - - }, { - key: "maxDist", - value: function maxDist(maxDistance) { - if (typeof maxDistance === 'number') { - this.panner.maxDistance = maxDistance; - } - - return this.panner.maxDistance; - } - /** - * How quickly the volume is reduced as the source moves away from the listener - * @method rollof - * @for p5.Panner3D - * @param {Number} rolloffFactor - * @return {Number} updated value - */ - - }, { - key: "rolloff", - value: function rolloff(rolloffFactor) { - if (typeof rolloffFactor === 'number') { - this.panner.rolloffFactor = rolloffFactor; - } - - return this.panner.rolloffFactor; - } - }, { - key: "dispose", - value: function dispose() { - panner3d_get(panner3d_getPrototypeOf(Panner3D.prototype), "dispose", this).call(this); - - if (this.panner) { - this.panner.disconnect(); - delete this.panner; - } - } - }]); - - return Panner3D; -}(effect); - - var panner3d = (Panner3D); -function delay_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { delay_typeof = function _typeof(obj) { return typeof obj; }; } else { delay_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return delay_typeof(obj); } - -function delay_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function delay_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function delay_createClass(Constructor, protoProps, staticProps) { if (protoProps) delay_defineProperties(Constructor.prototype, protoProps); if (staticProps) delay_defineProperties(Constructor, staticProps); return Constructor; } - -function delay_possibleConstructorReturn(self, call) { if (call && (delay_typeof(call) === "object" || typeof call === "function")) { return call; } return delay_assertThisInitialized(self); } - -function delay_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function delay_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { delay_get = Reflect.get; } else { delay_get = function _get(target, property, receiver) { var base = delay_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return delay_get(target, property, receiver || target); } - -function delay_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = delay_getPrototypeOf(object); if (object === null) break; } return object; } - -function delay_getPrototypeOf(o) { delay_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return delay_getPrototypeOf(o); } - -function delay_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) delay_setPrototypeOf(subClass, superClass); } - -function delay_setPrototypeOf(o, p) { delay_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return delay_setPrototypeOf(o, p); } - - - -/** - * Delay is an echo effect. It processes an existing sound source, - * and outputs a delayed version of that sound. The p5.Delay can - * produce different effects depending on the delayTime, feedback, - * filter, and type. In the example below, a feedback of 0.5 (the - * default value) will produce a looping delay that decreases in - * volume by 50% each repeat. A filter will cut out the high - * frequencies so that the delay does not sound as piercing as the - * original source. - * - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * @class p5.Delay - * @extends p5.Effect - * @constructor - * @example - *
            - * let osc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * textAlign(CENTER); - * text('tap to play', width/2, height/2); - * - * osc = new p5.Oscillator('square'); - * osc.amp(0.5); - * delay = new p5.Delay(); - * - * // delay.process() accepts 4 parameters: - * // source, delayTime (in seconds), feedback, filter frequency - * delay.process(osc, 0.12, .7, 2300); - * - * cnv.mousePressed(oscStart); - * } - * - * function oscStart() { - * osc.start(); - * } - * - * function mouseReleased() { - * osc.stop(); - * } - *
            - */ - -var delay_Delay = -function (_Effect) { - delay_inherits(Delay, _Effect); - - function Delay() { - var _this; - - delay_classCallCheck(this, Delay); - - _this = delay_possibleConstructorReturn(this, delay_getPrototypeOf(Delay).call(this)); - _this._split = _this.ac.createChannelSplitter(2); - _this._merge = _this.ac.createChannelMerger(2); - _this._leftGain = _this.ac.createGain(); - _this._rightGain = _this.ac.createGain(); - /** - * The p5.Delay is built with two - * - * Web Audio Delay Nodes, one for each stereo channel. - * - * @for p5.Delay - * @property {DelayNode} leftDelay - */ - - _this.leftDelay = _this.ac.createDelay(); - /** - * The p5.Delay is built with two - * - * Web Audio Delay Nodes, one for each stereo channel. - * @for p5.Delay - * @property {DelayNode} rightDelay - */ - - _this.rightDelay = _this.ac.createDelay(); - _this._leftFilter = new filter(); - _this._rightFilter = new filter(); - - _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(0.3, _this.ac.currentTime); - - _this._rightFilter.biquad.Q.setValueAtTime(0.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(0.5); - - return _this; - } - /** - * Add delay to an audio signal according to a set - * of delay parameters. - * - * @method process - * @for p5.Delay - * @param {Object} Signal An object that outputs audio - * @param {Number} [delayTime] Time (in seconds) of the delay/echo. - * Some browsers limit delayTime to - * 1 second. - * @param {Number} [feedback] sends the delay back through itself - * in a loop that decreases in volume - * each time. - * @param {Number} [lowPass] Cutoff frequency. Only frequencies - * below the lowPass will be part of the - * delay. - */ - - - delay_createClass(Delay, [{ - key: "process", - value: function process(src, _delayTime, _feedback, _filter) { - var feedback = _feedback || 0; - var delayTime = _delayTime || 0; - - if (feedback >= 1.0) { - throw new Error('Feedback value will force a positive feedback loop.'); - } - - if (delayTime >= this._maxDelay) { - throw new Error('Delay Time exceeds maximum delay time of ' + this._maxDelay + ' second.'); - } - - src.connect(this.input); - this.leftDelay.delayTime.setValueAtTime(delayTime, this.ac.currentTime); - this.rightDelay.delayTime.setValueAtTime(delayTime, this.ac.currentTime); - this._leftGain.gain.value = feedback; - this._rightGain.gain.value = feedback; - - if (_filter) { - this._leftFilter.freq(_filter); - - this._rightFilter.freq(_filter); - } - } - /** - * Set the delay (echo) time, in seconds. Usually this value will be - * a floating point number between 0.0 and 1.0. - * - * @method delayTime - * @for p5.Delay - * @param {Number} delayTime Time (in seconds) of the delay - */ - - }, { - key: "delayTime", - value: function delayTime(t) { - if (typeof t !== 'number') { - t.connect(this.leftDelay.delayTime); - t.connect(this.rightDelay.delayTime); - } else { - 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); - } - } - /** - * Feedback occurs when Delay sends its signal back through its input - * in a loop. The feedback amount determines how much signal to send each - * time through the loop. A feedback greater than 1.0 is not desirable because - * it will increase the overall output each time through the loop, - * creating an infinite feedback loop. The default value is 0.5 - * - * @method feedback - * @for p5.Delay - * @param {Number|Object} feedback 0.0 to 1.0, or an object such as an - * Oscillator that can be used to - * modulate this param - * @returns {Number} Feedback value - * - */ - - }, { - key: "feedback", - value: function feedback(f) { - if (f && typeof f !== 'number') { - f.connect(this._leftGain.gain); - f.connect(this._rightGain.gain); - } else if (f >= 1.0) { - throw new Error('Feedback value will force a positive feedback loop.'); - } else if (typeof f === 'number') { - this._leftGain.gain.value = f; - this._rightGain.gain.value = f; - } - - - return this._leftGain.gain.value; - } - /** - * Set a lowpass filter frequency for the delay. A lowpass filter - * will cut off any frequencies higher than the filter frequency. - * - * @method filter - * @for p5.Delay - * @param {Number|Object} cutoffFreq A lowpass filter will cut off any - * frequencies higher than the filter frequency. - * @param {Number|Object} res Resonance of the filter frequency - * cutoff, or an object (i.e. a p5.Oscillator) - * that can be used to modulate this parameter. - * High numbers (i.e. 15) will produce a resonance, - * low numbers (i.e. .2) will produce a slope. - */ - - }, { - key: "filter", - value: function filter(freq, q) { - this._leftFilter.set(freq, q); - - this._rightFilter.set(freq, q); - } - /** - * Choose a preset type of delay. 'pingPong' bounces the signal - * from the left to the right channel to produce a stereo effect. - * Any other parameter will revert to the default delay setting. - * - * @method setType - * @for p5.Delay - * @param {String|Number} type 'pingPong' (1) or 'default' (0) - */ - - }, { - key: "setType", - value: function setType(t) { - if (t === 1) { - t = 'pingPong'; - } - - this._split.disconnect(); - - this._leftFilter.disconnect(); - - this._rightFilter.disconnect(); - - this._split.connect(this.leftDelay, 0); - - this._split.connect(this.rightDelay, 1); - - switch (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); - - } - } - - /** - * Set the output level of the delay effect. - * - * @method amp - * @for p5.Delay - * @param {Number} volume amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - - /** - * Send output to a p5.sound or web audio object - * - * @method connect - * @for p5.Delay - * @param {Object} unit - */ - - /** - * Disconnect all output. - * - * @method disconnect - * @for p5.Delay - */ - - }, { - key: "dispose", - value: function dispose() { - delay_get(delay_getPrototypeOf(Delay.prototype), "dispose", this).call(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 = undefined; - this._leftFilter = undefined; - this._rightFilter = undefined; - this._merge = undefined; - this._leftGain = undefined; - this._rightGain = undefined; - this.leftDelay = undefined; - this.rightDelay = undefined; - } - }]); - - return Delay; -}(effect); - - var delay = (delay_Delay); -function reverb_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { reverb_typeof = function _typeof(obj) { return typeof obj; }; } else { reverb_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return reverb_typeof(obj); } - -function reverb_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function reverb_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function reverb_createClass(Constructor, protoProps, staticProps) { if (protoProps) reverb_defineProperties(Constructor.prototype, protoProps); if (staticProps) reverb_defineProperties(Constructor, staticProps); return Constructor; } - -function reverb_possibleConstructorReturn(self, call) { if (call && (reverb_typeof(call) === "object" || typeof call === "function")) { return call; } return reverb_assertThisInitialized(self); } - -function reverb_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function reverb_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { reverb_get = Reflect.get; } else { reverb_get = function _get(target, property, receiver) { var base = reverb_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return reverb_get(target, property, receiver || target); } - -function reverb_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = reverb_getPrototypeOf(object); if (object === null) break; } return object; } - -function reverb_getPrototypeOf(o) { reverb_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return reverb_getPrototypeOf(o); } - -function reverb_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) reverb_setPrototypeOf(subClass, superClass); } - -function reverb_setPrototypeOf(o, p) { reverb_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return reverb_setPrototypeOf(o, p); } - - - - -/** - * Reverb adds depth to a sound through a large number of decaying - * echoes. It creates the perception that sound is occurring in a - * physical space. The p5.Reverb has paramters for Time (how long does the - * reverb last) and decayRate (how much the sound decays with each echo) - * that can be set with the .set() or .process() methods. The p5.Convolver - * extends p5.Reverb allowing you to recreate the sound of actual physical - * spaces through convolution. - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Reverb - * @extends p5.Effect - * @constructor - * @example - *
            - * let soundFile, reverb; - * function preload() { - * soundFile = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * - * reverb = new p5.Reverb(); - * soundFile.disconnect(); // so we'll only hear reverb... - * - * // connect soundFile to reverb, process w/ - * // 3 second reverbTime, decayRate of 2% - * reverb.process(soundFile, 3, 2); - * } - * - * function draw() { - * let dryWet = constrain(map(mouseX, 0, width, 0, 1), 0, 1); - * // 1 = all reverb, 0 = no reverb - * reverb.drywet(dryWet); - * - * background(220); - * text('tap to play', 10, 20); - * text('dry/wet: ' + round(dryWet * 100) + '%', 10, height - 20); - * } - * - * function playSound() { - * soundFile.play(); - * } - *
            - */ - -var Reverb = -function (_Effect) { - reverb_inherits(Reverb, _Effect); - - function Reverb() { - var _this; - - reverb_classCallCheck(this, Reverb); - - _this = reverb_possibleConstructorReturn(this, reverb_getPrototypeOf(Reverb).call(this)); - - _this._initConvolverNode(); - - - _this.input.gain.value = 0.5; - - _this._seconds = 3; - _this._decay = 2; - _this._reverse = false; - - _this._buildImpulse(); - - return _this; - } - - reverb_createClass(Reverb, [{ - key: "_initConvolverNode", - value: function _initConvolverNode() { - this.convolverNode = this.ac.createConvolver(); - this.input.connect(this.convolverNode); - this.convolverNode.connect(this.wet); - } - }, { - key: "_teardownConvolverNode", - value: function _teardownConvolverNode() { - if (this.convolverNode) { - this.convolverNode.disconnect(); - delete this.convolverNode; - } - } - }, { - key: "_setBuffer", - value: function _setBuffer(audioBuffer) { - this._teardownConvolverNode(); - - this._initConvolverNode(); - - this.convolverNode.buffer = audioBuffer; - } - /** - * Connect a source to the reverb, and assign reverb parameters. - * - * @method process - * @for p5.Reverb - * @param {Object} src p5.sound / Web Audio object with a sound - * output. - * @param {Number} [seconds] Duration of the reverb, in seconds. - * Min: 0, Max: 10. Defaults to 3. - * @param {Number} [decayRate] Percentage of decay with each echo. - * Min: 0, Max: 100. Defaults to 2. - * @param {Boolean} [reverse] Play the reverb backwards or forwards. - */ - - }, { - key: "process", - value: function process(src, seconds, decayRate, reverse) { - src.connect(this.input); - var rebuild = false; - - if (seconds) { - this._seconds = seconds; - rebuild = true; - } - - if (decayRate) { - this._decay = decayRate; - } - - if (reverse) { - this._reverse = reverse; - } - - if (rebuild) { - this._buildImpulse(); - } - } - /** - * Set the reverb settings. Similar to .process(), but without - * assigning a new input. - * - * @method set - * @for p5.Reverb - * @param {Number} [seconds] Duration of the reverb, in seconds. - * Min: 0, Max: 10. Defaults to 3. - * @param {Number} [decayRate] Percentage of decay with each echo. - * Min: 0, Max: 100. Defaults to 2. - * @param {Boolean} [reverse] Play the reverb backwards or forwards. - */ - - }, { - key: "set", - value: function set(seconds, decayRate, reverse) { - var rebuild = false; - - if (seconds) { - this._seconds = seconds; - rebuild = true; - } - - if (decayRate) { - this._decay = decayRate; - } - - if (reverse) { - this._reverse = reverse; - } - - if (rebuild) { - this._buildImpulse(); - } - } - - /** - * Set the output level of the reverb effect. - * - * @method amp - * @for p5.Reverb - * @param {Number} volume amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - - /** - * Send output to a p5.sound or web audio object - * - * @method connect - * @for p5.Reverb - * @param {Object} unit - */ - - /** - * Disconnect all output. - * - * @method disconnect - * @for p5.Reverb - */ - - /** - * Inspired by Simple Reverb by Jordan Santell - * https://github.com/web-audio-components/simple-reverb/blob/master/index.js - * - * Utility function for building an impulse response - * based on the module parameters. - * - * @private - */ - - }, { - key: "_buildImpulse", - value: function _buildImpulse() { - var rate = this.ac.sampleRate; - var length = rate * this._seconds; - var decay = this._decay; - var impulse = this.ac.createBuffer(2, length, rate); - var impulseL = impulse.getChannelData(0); - var impulseR = impulse.getChannelData(1); - var n, i; - - for (i = 0; i < length; i++) { - n = this._reverse ? length - i : i; - impulseL[i] = (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); - impulseR[i] = (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); - } - - this._setBuffer(impulse); - } - }, { - key: "dispose", - value: function dispose() { - reverb_get(reverb_getPrototypeOf(Reverb.prototype), "dispose", this).call(this); - - this._teardownConvolverNode(); - } - }]); - - return Reverb; -}(effect); - -/** - *

            p5.Convolver extends p5.Reverb. It can emulate the sound of real - * physical spaces through a process called - * convolution.

            - * - *

            Convolution multiplies any audio input by an "impulse response" - * to simulate the dispersion of sound over time. The impulse response is - * generated from an audio file that you provide. One way to - * generate an impulse response is to pop a balloon in a reverberant space - * and record the echo. Convolution can also be used to experiment with - * sound.

            - * - *

            Use the method createConvolution(path) to instantiate a - * p5.Convolver with a path to your impulse response audio file.

            - * - * @class p5.Convolver - * @extends p5.Effect - * @constructor - * @param {String} path path to a sound file - * @param {Function} [callback] function to call when loading succeeds - * @param {Function} [errorCallback] function to call if loading fails. - * This function will receive an error or - * XMLHttpRequest object with information - * about what went wrong. - * @example - *
            - * let cVerb, sound; - * function preload() { - * // We have both MP3 and OGG versions of all sound assets - * soundFormats('ogg', 'mp3'); - * - * // Try replacing 'bx-spring' with other soundfiles like - * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' - * cVerb = createConvolver('assets/bx-spring.mp3'); - * - * // Try replacing 'Damscray_DancingTiger' with - * // 'beat', 'doorbell', lucky_dragons_-_power_melody' - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * background(220); - * text('tap to play', 20, 20); - * - * // disconnect from main output... - * sound.disconnect(); - * - * // ...and process with cVerb - * // so that we only hear the convolution - * cVerb.process(sound); - * } - * - * function playSound() { - * sound.play(); - * } - *
            - */ - - -var reverb_Convolver = -function (_Reverb) { - reverb_inherits(Convolver, _Reverb); - - function Convolver(path, callback, errorCallback) { - var _this2; - - reverb_classCallCheck(this, Convolver); - - _this2 = reverb_possibleConstructorReturn(this, reverb_getPrototypeOf(Convolver).call(this)); - /** - * Internally, the p5.Convolver uses the a - * - * Web Audio Convolver Node. - * - * @property {ConvolverNode} convolverNode - */ - - _this2._initConvolverNode(); - - - _this2.input.gain.value = 0.5; - - if (path) { - _this2.impulses = []; - - _this2._loadBuffer(path, callback, errorCallback); - } else { - _this2._seconds = 3; - _this2._decay = 2; - _this2._reverse = false; - - _this2._buildImpulse(); - } - /** - * If you load multiple impulse files using the .addImpulse method, - * they will be stored as Objects in this Array. Toggle between them - * with the toggleImpulse(id) method. - * - * @property {Array} impulses - * @for p5.Convolver - */ - - - _this2.impulses = []; - _this2.set = null; - return _this2; - } - /** - * Private method to load a buffer as an Impulse Response, - * assign it to the convolverNode, and add to the Array of .impulses. - * - * @param {String} path - * @param {Function} callback - * @param {Function} errorCallback - * @private - */ - - - reverb_createClass(Convolver, [{ - key: "_loadBuffer", - value: function _loadBuffer(_path, callback, errorCallback) { - var path = p5.prototype._checkFileFormats(_path); - - var self = this; - var errorTrace = new Error().stack; - var ac = Object(audiocontext["b" ])(); - var request = new XMLHttpRequest(); - request.open('GET', path, true); - request.responseType = 'arraybuffer'; - - request.onload = function () { - if (request.status === 200) { - ac.decodeAudioData(request.response, function (buff) { - var buffer = {}; - var chunks = path.split('/'); - buffer.name = chunks[chunks.length - 1]; - buffer.audioBuffer = buff; - self.impulses.push(buffer); - - self._setBuffer(buffer.audioBuffer); - - if (callback) { - callback(buffer); - } - }, - function () { - var err = new errorHandler('decodeAudioData', errorTrace, self.url); - var msg = 'AudioContext error at decodeAudioData for ' + self.url; - - if (errorCallback) { - err.msg = msg; - errorCallback(err); - } else { - console.error(msg + '\n The error stack trace includes: \n' + err.stack); - } - }); - } - else { - var err = new errorHandler('loadConvolver', errorTrace, self.url); - var msg = 'Unable to load ' + self.url + '. The request status was: ' + request.status + ' (' + request.statusText + ')'; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error(msg + '\n The error stack trace includes: \n' + err.stack); - } - } - }; - - - request.onerror = function () { - var err = new errorHandler('loadConvolver', errorTrace, self.url); - var msg = 'There was no response from the server at ' + self.url + '. Check the url and internet connectivity.'; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error(msg + '\n The error stack trace includes: \n' + err.stack); - } - }; - - request.send(); - } - /** - * Connect a source to the convolver. - * - * @method process - * @for p5.Convolver - * @param {Object} src p5.sound / Web Audio object with a sound - * output. - * @example - *
            - * let cVerb, sound; - * function preload() { - * // We have both MP3 and OGG versions of all sound assets - * soundFormats('ogg', 'mp3'); - * - * // Try replacing 'bx-spring' with other soundfiles like - * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' - * cVerb = createConvolver('assets/bx-spring.mp3'); - * - * // Try replacing 'Damscray_DancingTiger' with - * // 'beat', 'doorbell', lucky_dragons_-_power_melody' - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * background(220); - * text('tap to play', 20, 20); - * - * // disconnect from main output... - * sound.disconnect(); - * - * // ...and process with cVerb - * // so that we only hear the convolution - * cVerb.process(sound); - * } - * - * function playSound() { - * sound.play(); - * } - * - *
            - */ - - }, { - key: "process", - value: function process(src) { - src.connect(this.input); - } - /** - * Load and assign a new Impulse Response to the p5.Convolver. - * The impulse is added to the .impulses array. Previous - * impulses can be accessed with the .toggleImpulse(id) - * method. - * - * @method addImpulse - * @for p5.Convolver - * @param {String} path path to a sound file - * @param {Function} callback function (optional) - * @param {Function} errorCallback function (optional) - */ - - }, { - key: "addImpulse", - value: function addImpulse(path, callback, errorCallback) { - if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { - alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); - } - - this._loadBuffer(path, callback, errorCallback); - } - /** - * Similar to .addImpulse, except that the .impulses - * Array is reset to save memory. A new .impulses - * array is created with this impulse as the only item. - * - * @method resetImpulse - * @for p5.Convolver - * @param {String} path path to a sound file - * @param {Function} callback function (optional) - * @param {Function} errorCallback function (optional) - */ - - }, { - key: "resetImpulse", - value: function resetImpulse(path, callback, errorCallback) { - if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { - alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); - } - - this.impulses = []; - - this._loadBuffer(path, callback, errorCallback); - } - /** - * If you have used .addImpulse() to add multiple impulses - * to a p5.Convolver, then you can use this method to toggle between - * the items in the .impulses Array. Accepts a parameter - * to identify which impulse you wish to use, identified either by its - * original filename (String) or by its position in the .impulses - * Array (Number).
            - * You can access the objects in the .impulses Array directly. Each - * Object has two attributes: an .audioBuffer (type: - * Web Audio - * AudioBuffer) and a .name, a String that corresponds - * with the original filename. - * - * @method toggleImpulse - * @for p5.Convolver - * @param {String|Number} id Identify the impulse by its original filename - * (String), or by its position in the - * .impulses Array (Number). - */ - - }, { - key: "toggleImpulse", - value: function toggleImpulse(id) { - if (typeof id === 'number' && id < this.impulses.length) { - this._setBuffer(this.impulses[id].audioBuffer); - } - - if (typeof id === 'string') { - for (var i = 0; i < this.impulses.length; i++) { - if (this.impulses[i].name === id) { - this._setBuffer(this.impulses[i].audioBuffer); - - break; - } - } - } - } - }, { - key: "dispose", - value: function dispose() { - reverb_get(reverb_getPrototypeOf(Convolver.prototype), "dispose", this).call(this); - - - for (var i in this.impulses) { - if (this.impulses[i]) { - this.impulses[i] = null; - } - } - } - }]); - - return Convolver; -}(Reverb); -/** - * Create a p5.Convolver. Accepts a path to a soundfile - * that will be used to generate an impulse response. - * - * @method createConvolver - * @for p5 - * @param {String} path path to a sound file - * @param {Function} [callback] function to call if loading is successful. - * The object will be passed in as the argument - * to the callback function. - * @param {Function} [errorCallback] function to call if loading is not successful. - * A custom error will be passed in as the argument - * to the callback function. - * @return {p5.Convolver} - * @example - *
            - * let cVerb, sound; - * function preload() { - * // We have both MP3 and OGG versions of all sound assets - * soundFormats('ogg', 'mp3'); - * - * // Try replacing 'bx-spring' with other soundfiles like - * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' - * cVerb = createConvolver('assets/bx-spring.mp3'); - * - * // Try replacing 'Damscray_DancingTiger' with - * // 'beat', 'doorbell', lucky_dragons_-_power_melody' - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * background(220); - * text('tap to play', 20, 20); - * - * // disconnect from main output... - * sound.disconnect(); - * - * // ...and process with cVerb - * // so that we only hear the convolution - * cVerb.process(sound); - * } - * - * function playSound() { - * sound.play(); - * } - *
            - */ - - -function createConvolver(path, callback, errorCallback) { - if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { - alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); - } - - var self = this; - var cReverb = new reverb_Convolver(path, function (buffer) { - if (typeof callback === 'function') { - callback(buffer); - } - - if (typeof self._decrementPreload === 'function') { - self._decrementPreload(); - } - }, errorCallback); - cReverb.impulses = []; - return cReverb; -} - - -var Clock = __webpack_require__(11); -var Clock_default = __webpack_require__.n(Clock); - -function metro_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function metro_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function metro_createClass(Constructor, protoProps, staticProps) { if (protoProps) metro_defineProperties(Constructor.prototype, protoProps); if (staticProps) metro_defineProperties(Constructor, staticProps); return Constructor; } - - - - -var metro_Metro = -function () { - function Metro() { - metro_classCallCheck(this, Metro); - - this.clock = new Clock_default.a({ - callback: this.ontick.bind(this) - }); - this.syncedParts = []; - this.bpm = 120; - - this._init(); - - this.prevTick = 0; - this.tatumTime = 0; - - this.tickCallback = function () {}; - } - - metro_createClass(Metro, [{ - key: "ontick", - value: function ontick(tickTime) { - var elapsedTime = tickTime - this.prevTick; - var secondsFromNow = tickTime - main.audiocontext.currentTime; - - if (elapsedTime - this.tatumTime <= -0.02) { - return; - } else { - this.prevTick = tickTime; - - var self = this; - this.syncedParts.forEach(function (thisPart) { - if (!thisPart.isPlaying) return; - thisPart.incrementStep(secondsFromNow); - - thisPart.phrases.forEach(function (thisPhrase) { - var phraseArray = thisPhrase.sequence; - var bNum = self.metroTicks % phraseArray.length; - - if (phraseArray[bNum] !== 0 && (self.metroTicks < phraseArray.length || !thisPhrase.looping)) { - thisPhrase.callback(secondsFromNow, phraseArray[bNum]); - } - }); - }); - this.metroTicks += 1; - this.tickCallback(secondsFromNow); - } - } - }, { - key: "setBPM", - value: function setBPM(bpm) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var beatTime = 60 / (bpm * this.tatums); - var now = main.audiocontext.currentTime; - this.tatumTime = beatTime; - this.clock.frequency.setValueAtTime(this.clock.frequency.value, now); - this.clock.frequency.linearRampToValueAtTime(bpm, now + rampTime); - this.bpm = bpm; - } - }, { - key: "getBPM", - value: function getBPM() { - return this.clock.getRate() / this.tatums * 60; - } - }, { - key: "_init", - value: function _init() { - this.metroTicks = 0; - } - - }, { - key: "resetSync", - value: function resetSync(part) { - this.syncedParts = [part]; - } - - }, { - key: "pushSync", - value: function pushSync(part) { - this.syncedParts.push(part); - } - }, { - key: "start", - value: function start(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - this.clock.start(now + t); - this.setBPM(this.bpm); - } - }, { - key: "stop", - value: function stop(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - this.clock.stop(now + t); - } - }, { - key: "beatLength", - value: function beatLength(tatums) { - this.tatums = 1 / tatums / 4; - } - }]); - - return Metro; -}(); - - var metro = (metro_Metro); -function looper_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function looper_createClass(Constructor, protoProps, staticProps) { if (protoProps) looper_defineProperties(Constructor.prototype, protoProps); if (staticProps) looper_defineProperties(Constructor, staticProps); return Constructor; } - -function looper_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - -var BPM = 120; -/** - * Set the global tempo, in beats per minute, for all - * p5.Parts. This method will impact all active p5.Parts. - * - * @method setBPM - * @for p5 - * @param {Number} BPM Beats Per Minute - * @param {Number} rampTime Seconds from now - */ - -p5.prototype.setBPM = function (bpm, rampTime) { - BPM = bpm; - - for (var i in main.parts) { - if (main.parts[i]) { - main.parts[i].setBPM(bpm, rampTime); - } - } -}; -/** - *

            A phrase is a pattern of musical events over time, i.e. - * a series of notes and rests.

            - * - *

            Phrases must be added to a p5.Part for playback, and - * each part can play multiple phrases at the same time. - * For example, one Phrase might be a kick drum, another - * could be a snare, and another could be the bassline.

            - * - *

            The first parameter is a name so that the phrase can be - * modified or deleted later. The callback is a a function that - * this phrase will call at every step—for example it might be - * called playNote(value){}. The array determines - * which value is passed into the callback at each step of the - * phrase. It can be numbers, an object with multiple numbers, - * or a zero (0) indicates a rest so the callback won't be called).

            - * - * @class p5.Phrase - * @constructor - * @param {String} name Name so that you can access the Phrase. - * @param {Function} callback The name of a function that this phrase - * will call. Typically it will play a sound, - * and accept two parameters: a time at which - * to play the sound (in seconds from now), - * and a value from the sequence array. The - * time should be passed into the play() or - * start() method to ensure precision. - * @param {Array} sequence Array of values to pass into the callback - * at each step of the phrase. - * @example - *
            - * let mySound, myPhrase, myPart; - * let pattern = [1,0,0,2,0,2,0,0]; - * - * function preload() { - * mySound = loadSound('assets/beatbox.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playMyPart); - * background(220); - * text('tap to play', width/2, height/2); - * textAlign(CENTER, CENTER); - * - * myPhrase = new p5.Phrase('bbox', onEachStep, pattern); - * myPart = new p5.Part(); - * myPart.addPhrase(myPhrase); - * myPart.setBPM(60); - * } - * - * function onEachStep(time, playbackRate) { - * mySound.rate(playbackRate); - * mySound.play(time); - * } - * - * function playMyPart() { - * userStartAudio(); - * myPart.start(); - * } - *
            - */ - - -var Phrase = function Phrase(name, callback, sequence) { - looper_classCallCheck(this, Phrase); - - this.phraseStep = 0; - this.name = name; - this.callback = callback; - /** - * Array of values to pass into the callback - * at each step of the phrase. Depending on the callback - * function's requirements, these values may be numbers, - * strings, or an object with multiple parameters. - * Zero (0) indicates a rest. - * - * @property {Array} sequence - */ - - this.sequence = sequence; -}; -/** - *

            A p5.Part plays back one or more p5.Phrases. Instantiate a part - * with steps and tatums. By default, each step represents a 1/16th note.

            - * - *

            See p5.Phrase for more about musical timing.

            - * - * @class p5.Part - * @constructor - * @param {Number} [steps] Steps in the part - * @param {Number} [tatums] Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note) - * @example - *
            - * let box, drum, myPart; - * let boxPat = [1,0,0,2,0,2,0,0]; - * let drumPat = [0,1,1,0,2,0,1,0]; - * - * function preload() { - * box = loadSound('assets/beatbox.mp3'); - * drum = loadSound('assets/drum.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playMyPart); - * background(220); - * textAlign(CENTER, CENTER); - * text('tap to play', width/2, height/2); - * - * let boxPhrase = new p5.Phrase('box', playBox, boxPat); - * let drumPhrase = new p5.Phrase('drum', playDrum, drumPat); - * myPart = new p5.Part(); - * myPart.addPhrase(boxPhrase); - * myPart.addPhrase(drumPhrase); - * myPart.setBPM(60); - * } - * - * function playBox(time, playbackRate) { - * box.rate(playbackRate); - * box.play(time); - * } - * - * function playDrum(time, playbackRate) { - * drum.rate(playbackRate); - * drum.play(time); - * } - * - * function playMyPart() { - * userStartAudio(); - * - * myPart.start(); - * } - *
            - */ - - -var looper_Part = -function () { - function Part(steps, bLength) { - looper_classCallCheck(this, Part); - - this.length = steps || 0; - - this.partStep = 0; - this.phrases = []; - this.isPlaying = false; - this.noLoop(); - this.tatums = bLength || 0.0625; - - this.metro = new metro(); - - this.metro._init(); - - this.metro.beatLength(this.tatums); - this.metro.setBPM(BPM); - main.parts.push(this); - - this.callback = function () {}; - } - /** - * Set the tempo of this part, in Beats Per Minute. - * - * @method setBPM - * @for p5.Part - * @param {Number} BPM Beats Per Minute - * @param {Number} [rampTime] Seconds from now - */ - - - looper_createClass(Part, [{ - key: "setBPM", - value: function setBPM(tempo, rampTime) { - this.metro.setBPM(tempo, rampTime); - } - /** - * Returns the tempo, in Beats Per Minute, of this part. - * - * @method getBPM - * @for p5.Part - * @return {Number} - */ - - }, { - key: "getBPM", - value: function getBPM() { - return this.metro.getBPM(); - } - /** - * Start playback of this part. It will play - * through all of its phrases at a speed - * determined by setBPM. - * - * @method start - * @for p5.Part - * @param {Number} [time] seconds from now - */ - - }, { - key: "start", - value: function start(time) { - if (!this.isPlaying) { - this.isPlaying = true; - this.metro.resetSync(this); - var t = time || 0; - this.metro.start(t); - } - } - /** - * Loop playback of this part. It will begin - * looping through all of its phrases at a speed - * determined by setBPM. - * - * @method loop - * @for p5.Part - * @param {Number} [time] seconds from now - */ - - }, { - key: "loop", - value: function loop(time) { - this.looping = true; - - this.onended = function () { - this.partStep = 0; - }; - - var t = time || 0; - this.start(t); - } - /** - * Tell the part to stop looping. - * - * @method noLoop - * @for p5.Part - */ - - }, { - key: "noLoop", - value: function noLoop() { - this.looping = false; - - this.onended = function () { - this.stop(); - }; - } - /** - * Stop the part and cue it to step 0. Playback will resume from the begining of the Part when it is played again. - * - * @method stop - * @for p5.Part - * @param {Number} [time] seconds from now - */ - - }, { - key: "stop", - value: function stop(time) { - this.partStep = 0; - this.pause(time); - } - /** - * Pause the part. Playback will resume - * from the current step. - * - * @method pause - * @for p5.Part - * @param {Number} time seconds from now - */ - - }, { - key: "pause", - value: function pause(time) { - this.isPlaying = false; - var t = time || 0; - this.metro.stop(t); - } - /** - * Add a p5.Phrase to this Part. - * - * @method addPhrase - * @for p5.Part - * @param {p5.Phrase} phrase reference to a p5.Phrase - */ - - }, { - key: "addPhrase", - value: function addPhrase(name, callback, array) { - var p; - - if (arguments.length === 3) { - p = new Phrase(name, callback, array); - } else if (arguments[0] instanceof Phrase) { - p = arguments[0]; - } else { - throw 'invalid input. addPhrase accepts name, callback, array or a p5.Phrase'; - } - - this.phrases.push(p); - - if (p.sequence.length > this.length) { - this.length = p.sequence.length; - } - } - /** - * Remove a phrase from this part, based on the name it was - * given when it was created. - * - * @method removePhrase - * @for p5.Part - * @param {String} phraseName - */ - - }, { - key: "removePhrase", - value: function removePhrase(name) { - for (var i in this.phrases) { - if (this.phrases[i].name === name) { - this.phrases.splice(i, 1); - } - } - } - /** - * Get a phrase from this part, based on the name it was - * given when it was created. Now you can modify its array. - * - * @method getPhrase - * @for p5.Part - * @param {String} phraseName - */ - - }, { - key: "getPhrase", - value: function getPhrase(name) { - for (var i in this.phrases) { - if (this.phrases[i].name === name) { - return this.phrases[i]; - } - } - } - /** - * Find all sequences with the specified name, and replace their patterns with the specified array. - * - * @method replaceSequence - * @for p5.Part - * @param {String} phraseName - * @param {Array} sequence Array of values to pass into the callback - * at each step of the phrase. - */ - - }, { - key: "replaceSequence", - value: function replaceSequence(name, array) { - for (var i in this.phrases) { - if (this.phrases[i].name === name) { - this.phrases[i].sequence = array; - } - } - } - }, { - key: "incrementStep", - value: function incrementStep(time) { - if (this.partStep < this.length - 1) { - this.callback(time); - this.partStep += 1; - } else { - if (!this.looping && this.partStep === this.length - 1) { - this.onended(); - } - } - } - /** - * Set the function that will be called at every step. This will clear the previous function. - * - * @method onStep - * @for p5.Part - * @param {Function} callback The name of the callback - * you want to fire - * on every beat/tatum. - */ - - }, { - key: "onStep", - value: function onStep(callback) { - this.callback = callback; - } - }]); - - return Part; -}(); - -/** - * A Score consists of a series of Parts. The parts will - * be played back in order. For example, you could have an - * A part, a B part, and a C part, and play them back in this order - * new p5.Score(a, a, b, a, c) - * - * @class p5.Score - * @constructor - * @param {p5.Part} [...parts] One or multiple parts, to be played in sequence. - */ - - -var Score = -function () { - function Score() { - looper_classCallCheck(this, Score); - - this.parts = []; - this.currentPart = new Array(arguments.length); - ; - var thisScore = this; - - for (var i in arguments) { - this.parts[i] = arguments[i]; - this.parts[i].nextPart = this.parts[i + 1]; - - this.parts[i].onended = function () { - thisScore.resetPart(i); - playNextPart(thisScore); - }; - } - - this.looping = false; - } - - looper_createClass(Score, [{ - key: "onended", - value: function onended() { - if (this.looping) { - this.parts[0].start(); - } else { - this.parts[this.parts.length - 1].onended = function () { - this.stop(); - this.resetParts(); - }; - } - - this.currentPart = 0; - } - /** - * Start playback of the score. - * - * @method start - * @for p5.Score - */ - - }, { - key: "start", - value: function start() { - this.parts[this.currentPart].start(); - this.scoreStep = 0; - } - /** - * Stop playback of the score. - * - * @method stop - * @for p5.Score - */ - - }, { - key: "stop", - value: function stop() { - this.parts[this.currentPart].stop(); - this.currentPart = 0; - this.scoreStep = 0; - } - /** - * Pause playback of the score. - * - * @method pause - * @for p5.Score - */ - - }, { - key: "pause", - value: function pause() { - this.parts[this.currentPart].stop(); - } - /** - * Loop playback of the score. - * - * @method loop - * @for p5.Score - */ - - }, { - key: "loop", - value: function loop() { - this.looping = true; - this.start(); - } - /** - * Stop looping playback of the score. If it - * is currently playing, this will go into effect - * after the current round of playback completes. - * - * @method noLoop - * @for p5.Score - */ - - }, { - key: "noLoop", - value: function noLoop() { - this.looping = false; - } - }, { - key: "resetParts", - value: function resetParts() { - var self = this; - this.parts.forEach(function (part) { - self.resetParts[part]; - }); - } - }, { - key: "resetPart", - value: function resetPart(i) { - this.parts[i].stop(); - this.parts[i].partStep = 0; - - for (var p in this.parts[i].phrases) { - if (this.parts[i]) { - this.parts[i].phrases[p].phraseStep = 0; - } - } - } - /** - * Set the tempo for all parts in the score - * - * @method setBPM - * @for p5.Score - * @param {Number} BPM Beats Per Minute - * @param {Number} rampTime Seconds from now - */ - - }, { - key: "setBPM", - value: function setBPM(bpm, rampTime) { - for (var i in this.parts) { - if (this.parts[i]) { - this.parts[i].setBPM(bpm, rampTime); - } - } - } - }]); - - return Score; -}(); - -function playNextPart(aScore) { - aScore.currentPart++; - - if (aScore.currentPart >= aScore.parts.length) { - aScore.scoreStep = 0; - aScore.onended(); - } else { - aScore.scoreStep = 0; - aScore.parts[aScore.currentPart - 1].stop(); - aScore.parts[aScore.currentPart].start(); - } -} - - -function soundLoop_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function soundLoop_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function soundLoop_createClass(Constructor, protoProps, staticProps) { if (protoProps) soundLoop_defineProperties(Constructor.prototype, protoProps); if (staticProps) soundLoop_defineProperties(Constructor, staticProps); return Constructor; } - - - -/** - * SoundLoop - * - * @class p5.SoundLoop - * @constructor - * - * @param {Function} callback this function will be called on each iteration of theloop - * @param {Number|String} [interval] amount of time (if a number) or beats (if a string, following Tone.Time convention) for each iteration of the loop. Defaults to 1 second. - * - * @example - *
            - * let synth, soundLoop; - * let notePattern = [60, 62, 64, 67, 69, 72]; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * colorMode(HSB); - * background(0, 0, 86); - * text('tap to start/stop', 10, 20); - * - * //the looper's callback is passed the timeFromNow - * //this value should be used as a reference point from - * //which to schedule sounds - * let intervalInSeconds = 0.2; - * soundLoop = new p5.SoundLoop(onSoundLoop, intervalInSeconds); - * - * synth = new p5.MonoSynth(); - * } - * - * function canvasPressed() { - * // ensure audio is enabled - * userStartAudio(); - * - * if (soundLoop.isPlaying) { - * soundLoop.stop(); - * } else { - * // start the loop - * soundLoop.start(); - * } - * } - * - * function onSoundLoop(timeFromNow) { - * let noteIndex = (soundLoop.iterations - 1) % notePattern.length; - * let note = midiToFreq(notePattern[noteIndex]); - * synth.play(note, 0.5, timeFromNow); - * background(noteIndex * 360 / notePattern.length, 50, 100); - * } - *
            - */ - -var soundLoop_SoundLoop = -function () { - function SoundLoop(callback, interval) { - soundLoop_classCallCheck(this, SoundLoop); - - /** - * Getters and Setters, setting any paramter will result in a change in the clock's - * frequency, that will be reflected after the next callback - * beats per minute (defaults to 60) - * @property {Number} bpm - * @for p5.SoundLoop - */ - Object.defineProperty(this, 'bpm', { - get: function get() { - return this._bpm; - }, - set: function set(bpm) { - if (!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 = bpm; - - this._update(); - } - }); - /** - * number of quarter notes in a measure (defaults to 4) - * @property {Number} timeSignature - * @for p5.SoundLoop - */ - - Object.defineProperty(this, 'timeSignature', { - get: function get() { - return this._timeSignature; - }, - set: function set(timeSig) { - if (!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 = timeSig; - - this._update(); - } - }); - /** - * length of the loops interval - * @property {Number|String} interval - * @for p5.SoundLoop - */ - - Object.defineProperty(this, 'interval', { - get: function get() { - return this._interval; - }, - set: function set(interval) { - this.musicalTimeMode = typeof interval === 'number' ? false : true; - this._interval = interval; - - this._update(); - } - }); - /** - * how many times the callback has been called so far - * @property {Number} iterations - * @for p5.SoundLoop - * @readonly - */ - - Object.defineProperty(this, 'iterations', { - get: function get() { - return this.clock.ticks; - } - }); - this.callback = callback; - /** - * musicalTimeMode uses Tone.Time convention - * true if string, false if number - * @property {Boolean} musicalTimeMode - */ - - this.musicalTimeMode = typeof this._interval === 'number' ? false : true; - this._interval = interval || 1; - /** - * musicalTimeMode variables - * modify these only when the interval is specified in musicalTime format as a string - */ - - this._timeSignature = 4; - this._bpm = 60; - this.isPlaying = false; - /** - * Set a limit to the number of loops to play. defaults to Infinity - * @property {Number} maxIterations - */ - - this.maxIterations = Infinity; - var self = this; - this.clock = new Clock_default.a({ - callback: function callback(time) { - var timeFromNow = time - main.audiocontext.currentTime; - /** - * Do not initiate the callback if timeFromNow is < 0 - * This ususually occurs for a few milliseconds when the page - * is not fully loaded - * - * The callback should only be called until maxIterations is reached - */ - - if (timeFromNow > 0 && self.iterations <= self.maxIterations) { - self.callback(timeFromNow); - } - }, - frequency: this._calcFreq() - }); - } - /** - * Start the loop - * @method start - * @for p5.SoundLoop - * @param {Number} [timeFromNow] schedule a starting time - */ - - - soundLoop_createClass(SoundLoop, [{ - key: "start", - value: function start(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (!this.isPlaying) { - this.clock.start(now + t); - this.isPlaying = true; - } - } - /** - * Stop the loop - * @method stop - * @for p5.SoundLoop - * @param {Number} [timeFromNow] schedule a stopping time - */ - - }, { - key: "stop", - value: function stop(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (this.isPlaying) { - this.clock.stop(now + t); - this.isPlaying = false; - } - } - /** - * Pause the loop - * @method pause - * @for p5.SoundLoop - * @param {Number} [timeFromNow] schedule a pausing time - */ - - }, { - key: "pause", - value: function pause(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (this.isPlaying) { - this.clock.pause(now + t); - this.isPlaying = false; - } - } - /** - * Synchronize loops. Use this method to start two or more loops in synchronization - * or to start a loop in synchronization with a loop that is already playing - * This method will schedule the implicit loop in sync with the explicit master loop - * i.e. loopToStart.syncedStart(loopToSyncWith) - * - * @method syncedStart - * @for p5.SoundLoop - * @param {Object} otherLoop a p5.SoundLoop to sync with - * @param {Number} [timeFromNow] Start the loops in sync after timeFromNow seconds - */ - - }, { - key: "syncedStart", - value: function syncedStart(otherLoop, timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (!otherLoop.isPlaying) { - otherLoop.clock.start(now + t); - otherLoop.isPlaying = true; - this.clock.start(now + t); - this.isPlaying = true; - } else if (otherLoop.isPlaying) { - var time = otherLoop.clock._nextTick - main.audiocontext.currentTime; - this.clock.start(now + time); - this.isPlaying = true; - } - } - /** - * Updates frequency value, reflected in next callback - * @private - * @for p5.SoundLoop - * @method _update - */ - - }, { - key: "_update", - value: function _update() { - this.clock.frequency.value = this._calcFreq(); - } - /** - * Calculate the frequency of the clock's callback based on bpm, interval, and timesignature - * @private - * @for p5.SoundLoop - * @method _calcFreq - * @return {Number} new clock frequency value - */ - - }, { - key: "_calcFreq", - value: function _calcFreq() { - if (typeof this._interval === 'number') { - this.musicalTimeMode = false; - return 1 / this._interval; - } - else if (typeof this._interval === 'string') { - this.musicalTimeMode = true; - return this._bpm / 60 / this._convertNotation(this._interval) * (this._timeSignature / 4); - } - } - /** - * Convert notation from musical time format to seconds - * Uses Tone.Time convention - * @private - * @for p5.SoundLoop - * @method _convertNotation - * @param {String} value value to be converted - * @return {Number} converted value in seconds - */ - - }, { - key: "_convertNotation", - value: function _convertNotation(value) { - var type = value.slice(-1); - value = Number(value.slice(0, -1)); - - switch (type) { - case 'm': - return this._measure(value); - - case 'n': - return this._note(value); - - 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'); - } - } - /** - * Helper conversion methods of measure and note - * @private - * @for p5.SoundLoop - * @method _measure - */ - - }, { - key: "_measure", - value: function _measure(value) { - return value * this._timeSignature; - } - /** - * @private - * @method _note - * @for p5.SoundLoop - */ - - }, { - key: "_note", - value: function _note(value) { - return this._timeSignature / value; - } - }]); - - return SoundLoop; -}(); - - var soundLoop = (soundLoop_SoundLoop); -function compressor_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { compressor_typeof = function _typeof(obj) { return typeof obj; }; } else { compressor_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return compressor_typeof(obj); } - -function compressor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function compressor_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function compressor_createClass(Constructor, protoProps, staticProps) { if (protoProps) compressor_defineProperties(Constructor.prototype, protoProps); if (staticProps) compressor_defineProperties(Constructor, staticProps); return Constructor; } - -function compressor_possibleConstructorReturn(self, call) { if (call && (compressor_typeof(call) === "object" || typeof call === "function")) { return call; } return compressor_assertThisInitialized(self); } - -function compressor_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function compressor_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { compressor_get = Reflect.get; } else { compressor_get = function _get(target, property, receiver) { var base = compressor_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return compressor_get(target, property, receiver || target); } - -function compressor_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = compressor_getPrototypeOf(object); if (object === null) break; } return object; } - -function compressor_getPrototypeOf(o) { compressor_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return compressor_getPrototypeOf(o); } - -function compressor_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) compressor_setPrototypeOf(subClass, superClass); } - -function compressor_setPrototypeOf(o, p) { compressor_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return compressor_setPrototypeOf(o, p); } - - -/** - * Compressor is an audio effect class that performs dynamics compression - * on an audio input source. This is a very commonly used technique in music - * and sound production. Compression creates an overall louder, richer, - * and fuller sound by lowering the volume of louds and raising that of softs. - * Compression can be used to avoid clipping (sound distortion due to - * peaks in volume) and is especially useful when many sounds are played - * at once. Compression can be used on indivudal sound sources in addition - * to the main output. - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Compressor - * @constructor - * @extends p5.Effect - * - * - */ - -var Compressor = -function (_Effect) { - compressor_inherits(Compressor, _Effect); - - function Compressor() { - var _this; - - compressor_classCallCheck(this, Compressor); - - _this = compressor_possibleConstructorReturn(this, compressor_getPrototypeOf(Compressor).call(this)); - /** - * - * The p5.Compressor is built with a Web Audio Dynamics Compressor Node - * - * @property {AudioNode} compressor - */ - - _this.compressor = _this.ac.createDynamicsCompressor(); - - _this.input.connect(_this.compressor); - - _this.compressor.connect(_this.wet); - - return _this; - } - /** - * Performs the same function as .connect, but also accepts - * optional parameters to set compressor's audioParams - * @method process - * @for p5.Compressor - * - * @param {Object} src Sound source to be connected - * - * @param {Number} [attack] The amount of time (in seconds) to reduce the gain by 10dB, - * default = .003, range 0 - 1 - * @param {Number} [knee] A decibel value representing the range above the - * threshold where the curve smoothly transitions to the "ratio" portion. - * default = 30, range 0 - 40 - * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output - * default = 12, range 1 - 20 - * @param {Number} [threshold] The decibel value above which the compression will start taking effect - * default = -24, range -100 - 0 - * @param {Number} [release] The amount of time (in seconds) to increase the gain by 10dB - * default = .25, range 0 - 1 - */ - - - compressor_createClass(Compressor, [{ - key: "process", - value: function process(src, attack, knee, ratio, threshold, release) { - src.connect(this.input); - this.set(attack, knee, ratio, threshold, release); - } - /** - * Set the paramters of a compressor. - * @method set - * @for p5.Compressor - * @param {Number} attack The amount of time (in seconds) to reduce the gain by 10dB, - * default = .003, range 0 - 1 - * @param {Number} knee A decibel value representing the range above the - * threshold where the curve smoothly transitions to the "ratio" portion. - * default = 30, range 0 - 40 - * @param {Number} ratio The amount of dB change in input for a 1 dB change in output - * default = 12, range 1 - 20 - * @param {Number} threshold The decibel value above which the compression will start taking effect - * default = -24, range -100 - 0 - * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB - * default = .25, range 0 - 1 - */ - - }, { - key: "set", - value: function set(attack, knee, ratio, threshold, release) { - if (typeof attack !== 'undefined') { - this.attack(attack); - } - - if (typeof knee !== 'undefined') { - this.knee(knee); - } - - if (typeof ratio !== 'undefined') { - this.ratio(ratio); - } - - if (typeof threshold !== 'undefined') { - this.threshold(threshold); - } - - if (typeof release !== 'undefined') { - this.release(release); - } - } - /** - * Get current attack or set value w/ time ramp - * - * - * @method attack - * @for p5.Compressor - * @param {Number} [attack] Attack is the amount of time (in seconds) to reduce the gain by 10dB, - * default = .003, range 0 - 1 - * @param {Number} [time] Assign time value to schedule the change in value - */ - - }, { - key: "attack", - value: function attack(_attack, time) { - var t = time || 0; - - if (typeof _attack === 'number') { - this.compressor.attack.value = _attack; - this.compressor.attack.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.compressor.attack.linearRampToValueAtTime(_attack, this.ac.currentTime + 0.02 + t); - } else if (typeof _attack !== 'undefined') { - _attack.connect(this.compressor.attack); - } - - return this.compressor.attack.value; - } - /** - * Get current knee or set value w/ time ramp - * - * @method knee - * @for p5.Compressor - * @param {Number} [knee] A decibel value representing the range above the - * threshold where the curve smoothly transitions to the "ratio" portion. - * default = 30, range 0 - 40 - * @param {Number} [time] Assign time value to schedule the change in value - */ - - }, { - key: "knee", - value: function knee(_knee, time) { - var t = time || 0; - - if (typeof _knee === 'number') { - this.compressor.knee.value = _knee; - this.compressor.knee.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.compressor.knee.linearRampToValueAtTime(_knee, this.ac.currentTime + 0.02 + t); - } else if (typeof _knee !== 'undefined') { - _knee.connect(this.compressor.knee); - } - - return this.compressor.knee.value; - } - /** - * Get current ratio or set value w/ time ramp - * @method ratio - * @for p5.Compressor - * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output - * default = 12, range 1 - 20 - * @param {Number} [time] Assign time value to schedule the change in value - */ - - }, { - key: "ratio", - value: function ratio(_ratio, time) { - var t = time || 0; - - if (typeof _ratio === 'number') { - this.compressor.ratio.value = _ratio; - this.compressor.ratio.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.compressor.ratio.linearRampToValueAtTime(_ratio, this.ac.currentTime + 0.02 + t); - } else if (typeof _ratio !== 'undefined') { - _ratio.connect(this.compressor.ratio); - } - - return this.compressor.ratio.value; - } - /** - * Get current threshold or set value w/ time ramp - * @method threshold - * @for p5.Compressor - * @param {Number} threshold The decibel value above which the compression will start taking effect - * default = -24, range -100 - 0 - * @param {Number} [time] Assign time value to schedule the change in value - */ - - }, { - key: "threshold", - value: function threshold(_threshold, time) { - var t = time || 0; - - if (typeof _threshold === 'number') { - this.compressor.threshold.value = _threshold; - this.compressor.threshold.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.compressor.threshold.linearRampToValueAtTime(_threshold, this.ac.currentTime + 0.02 + t); - } else if (typeof _threshold !== 'undefined') { - _threshold.connect(this.compressor.threshold); - } - - return this.compressor.threshold.value; - } - /** - * Get current release or set value w/ time ramp - * @method release - * @for p5.Compressor - * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB - * default = .25, range 0 - 1 - * - * @param {Number} [time] Assign time value to schedule the change in value - */ - - }, { - key: "release", - value: function release(_release, time) { - var t = time || 0; - - if (typeof _release === 'number') { - this.compressor.release.value = _release; - this.compressor.release.cancelScheduledValues(this.ac.currentTime + 0.01 + t); - this.compressor.release.linearRampToValueAtTime(_release, this.ac.currentTime + 0.02 + t); - } else if (typeof number !== 'undefined') { - _release.connect(this.compressor.release); - } - - return this.compressor.release.value; - } - /** - * Return the current reduction value - * - * @method reduction - * @for p5.Compressor - * @return {Number} Value of the amount of gain reduction that is applied to the signal - */ - - }, { - key: "reduction", - value: function reduction() { - return this.compressor.reduction.value; - } - }, { - key: "dispose", - value: function dispose() { - compressor_get(compressor_getPrototypeOf(Compressor.prototype), "dispose", this).call(this); - - if (this.compressor) { - this.compressor.disconnect(); - delete this.compressor; - } - } - }]); - - return Compressor; -}(effect); - - var compressor = (Compressor); -function peakDetect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function peakDetect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function peakDetect_createClass(Constructor, protoProps, staticProps) { if (protoProps) peakDetect_defineProperties(Constructor.prototype, protoProps); if (staticProps) peakDetect_defineProperties(Constructor, staticProps); return Constructor; } - -/** - *

            PeakDetect works in conjunction with p5.FFT to - * look for onsets in some or all of the frequency spectrum. - *

            - *

            - * To use p5.PeakDetect, call update in the draw loop - * and pass in a p5.FFT object. - *

            - *

            - * You can listen for a specific part of the frequency spectrum by - * setting the range between freq1 and freq2. - *

            - * - *

            threshold is the threshold for detecting a peak, - * scaled between 0 and 1. It is logarithmic, so 0.1 is half as loud - * as 1.0.

            - * - *

            - * The update method is meant to be run in the draw loop, and - * frames determines how many loops must pass before - * another peak can be detected. - * For example, if the frameRate() = 60, you could detect the beat of a - * 120 beat-per-minute song with this equation: - * framesPerPeak = 60 / (estimatedBPM / 60 ); - *

            - * - *

            - * Based on example contribtued by @b2renger, and a simple beat detection - * explanation by Felix Turner. - *

            - * - * @class p5.PeakDetect - * @constructor - * @param {Number} [freq1] lowFrequency - defaults to 20Hz - * @param {Number} [freq2] highFrequency - defaults to 20000 Hz - * @param {Number} [threshold] Threshold for detecting a beat between 0 and 1 - * scaled logarithmically where 0.1 is 1/2 the loudness - * of 1.0. Defaults to 0.35. - * @param {Number} [framesPerPeak] Defaults to 20. - * @example - *
            - * - * var cnv, soundFile, fft, peakDetect; - * var ellipseWidth = 10; - * - * function preload() { - * soundFile = loadSound('assets/beat.mp3'); - * } - * - * function setup() { - * background(0); - * noStroke(); - * fill(255); - * textAlign(CENTER); - * - * // p5.PeakDetect requires a p5.FFT - * fft = new p5.FFT(); - * peakDetect = new p5.PeakDetect(); - * } - * - * function draw() { - * background(0); - * text('click to play/pause', width/2, height/2); - * - * // peakDetect accepts an fft post-analysis - * fft.analyze(); - * peakDetect.update(fft); - * - * if ( peakDetect.isDetected ) { - * ellipseWidth = 50; - * } else { - * ellipseWidth *= 0.95; - * } - * - * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); - * } - * - * // toggle play/stop when canvas is clicked - * function mouseClicked() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * if (soundFile.isPlaying() ) { - * soundFile.stop(); - * } else { - * soundFile.play(); - * } - * } - * } - *
            - */ -var PeakDetect = -function () { - function PeakDetect(freq1, freq2, threshold, _framesPerPeak) { - peakDetect_classCallCheck(this, PeakDetect); - - this.framesPerPeak = _framesPerPeak || 20; - this.framesSinceLastPeak = 0; - this.decayRate = 0.95; - this.threshold = threshold || 0.35; - this.cutoff = 0; - - this.cutoffMult = 1.5; - this.energy = 0; - this.penergy = 0; - - this.currentValue = 0; - /** - * isDetected is set to true when a peak is detected. - * - * @attribute isDetected {Boolean} - * @default false - */ - - this.isDetected = false; - this.f1 = freq1 || 40; - this.f2 = freq2 || 20000; - - this._onPeak = function () {}; - } - /** - * The update method is run in the draw loop. - * - * Accepts an FFT object. You must call .analyze() - * on the FFT object prior to updating the peakDetect - * because it relies on a completed FFT analysis. - * - * @method update - * @param {p5.FFT} fftObject A p5.FFT object - */ - - - peakDetect_createClass(PeakDetect, [{ - key: "update", - value: function update(fftObject) { - var nrg = this.energy = fftObject.getEnergy(this.f1, this.f2) / 255; - - if (nrg > this.cutoff && nrg > this.threshold && nrg - this.penergy > 0) { - this._onPeak(); - - this.isDetected = true; - - this.cutoff = nrg * this.cutoffMult; - this.framesSinceLastPeak = 0; - } else { - this.isDetected = false; - - if (this.framesSinceLastPeak <= this.framesPerPeak) { - this.framesSinceLastPeak++; - } else { - this.cutoff *= this.decayRate; - this.cutoff = Math.max(this.cutoff, this.threshold); - } - } - - this.currentValue = nrg; - this.penergy = nrg; - } - /** - * onPeak accepts two arguments: a function to call when - * a peak is detected. The value of the peak, - * between 0.0 and 1.0, is passed to the callback. - * - * @method onPeak - * @param {Function} callback Name of a function that will - * be called when a peak is - * detected. - * @param {Object} [val] Optional value to pass - * into the function when - * a peak is detected. - * @example - *
            - * var cnv, soundFile, fft, peakDetect; - * var ellipseWidth = 0; - * - * function preload() { - * soundFile = loadSound('assets/beat.mp3'); - * } - * - * function setup() { - * cnv = createCanvas(100,100); - * textAlign(CENTER); - * - * fft = new p5.FFT(); - * peakDetect = new p5.PeakDetect(); - * - * setupSound(); - * - * // when a beat is detected, call triggerBeat() - * peakDetect.onPeak(triggerBeat); - * } - * - * function draw() { - * background(0); - * fill(255); - * text('click to play', width/2, height/2); - * - * fft.analyze(); - * peakDetect.update(fft); - * - * ellipseWidth *= 0.95; - * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); - * } - * - * // this function is called by peakDetect.onPeak - * function triggerBeat() { - * ellipseWidth = 50; - * } - * - * // mouseclick starts/stops sound - * function setupSound() { - * cnv.mouseClicked( function() { - * if (soundFile.isPlaying() ) { - * soundFile.stop(); - * } else { - * soundFile.play(); - * } - * }); - * } - *
            - */ - - }, { - key: "onPeak", - value: function onPeak(callback, val) { - var self = this; - - self._onPeak = function () { - callback(self.energy, val); - }; - } - }]); - - return PeakDetect; -}(); - - var peakDetect = (PeakDetect); -function soundRecorder_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function soundRecorder_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function soundRecorder_createClass(Constructor, protoProps, staticProps) { if (protoProps) soundRecorder_defineProperties(Constructor.prototype, protoProps); if (staticProps) soundRecorder_defineProperties(Constructor, staticProps); return Constructor; } - - - - -var soundRecorder_ac = main.audiocontext; -/** - *

            Record sounds for playback and/or to save as a .wav file. - * The p5.SoundRecorder records all sound output from your sketch, - * or can be assigned a specific source with setInput().

            - *

            The record() method accepts a p5.SoundFile as a parameter. - * When playback is stopped (either after the given amount of time, - * or with the stop() method), the p5.SoundRecorder will send its - * recording to that p5.SoundFile for playback.

            - * - * @class p5.SoundRecorder - * @constructor - * @example - *
            - * let mic, recorder, soundFile; - * let state = 0; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * textAlign(CENTER, CENTER); - * - * // create an audio in - * mic = new p5.AudioIn(); - * - * // prompts user to enable their browser mic - * mic.start(); - * - * // create a sound recorder - * recorder = new p5.SoundRecorder(); - * - * // connect the mic to the recorder - * recorder.setInput(mic); - * - * // this sound file will be used to - * // playback & save the recording - * soundFile = new p5.SoundFile(); - * - * text('tap to record', width/2, height/2); - * } - * - * function canvasPressed() { - * // ensure audio is enabled - * userStartAudio(); - * - * // make sure user enabled the mic - * if (state === 0 && mic.enabled) { - * - * // record to our p5.SoundFile - * recorder.record(soundFile); - * - * background(255,0,0); - * text('Recording!', width/2, height/2); - * state++; - * } - * else if (state === 1) { - * background(0,255,0); - * - * // stop recorder and - * // send result to soundFile - * recorder.stop(); - * - * text('Done! Tap to play and download', width/2, height/2, width - 20); - * state++; - * } - * - * else if (state === 2) { - * soundFile.play(); // play the result! - * save(soundFile, 'mySound.wav'); - * state++; - * } - * } - *
            - */ - -var soundRecorder_SoundRecorder = -function () { - function SoundRecorder() { - soundRecorder_classCallCheck(this, SoundRecorder); - - this.input = soundRecorder_ac.createGain(); - this.output = soundRecorder_ac.createGain(); - this._inputChannels = 2; - this._outputChannels = 2; - - var workletBufferSize = safeBufferSize(1024); - this._workletNode = new AudioWorkletNode(soundRecorder_ac, processorNames_default.a.recorderProcessor, { - outputChannelCount: [this._outputChannels], - processorOptions: { - numInputChannels: this._inputChannels, - bufferSize: workletBufferSize - } - }); - - this._workletNode.port.onmessage = function (event) { - if (event.data.name === 'buffers') { - var buffers = [new Float32Array(event.data.leftBuffer), new Float32Array(event.data.rightBuffer)]; - - this._callback(buffers); - } - }.bind(this); - /** - * callback invoked when the recording is over - * @private - * @type Function(Float32Array) - */ - - - this._callback = function () {}; - - - this._workletNode.connect(p5.soundOut._silentNode); - - this.setInput(); - - main.soundArray.push(this); - } - /** - * Connect a specific device to the p5.SoundRecorder. - * If no parameter is given, p5.SoundRecorer will record - * all audible p5.sound from your sketch. - * - * @method setInput - * @for p5.SoundRecorder - * @param {Object} [unit] p5.sound object or a web audio unit - * that outputs sound - */ - - - soundRecorder_createClass(SoundRecorder, [{ - key: "setInput", - value: function setInput(unit) { - this.input.disconnect(); - this.input = null; - this.input = soundRecorder_ac.createGain(); - this.input.connect(this._workletNode); - this.input.connect(this.output); - - if (unit) { - unit.connect(this.input); - } else { - p5.soundOut.output.connect(this.input); - } - } - /** - * Start recording. To access the recording, provide - * a p5.SoundFile as the first parameter. The p5.SoundRecorder - * will send its recording to that p5.SoundFile for playback once - * recording is complete. Optional parameters include duration - * (in seconds) of the recording, and a callback function that - * will be called once the complete recording has been - * transfered to the p5.SoundFile. - * - * @method record - * @for p5.SoundRecorder - * @param {p5.SoundFile} soundFile p5.SoundFile - * @param {Number} [duration] Time (in seconds) - * @param {Function} [callback] The name of a function that will be - * called once the recording completes - */ - - }, { - key: "record", - value: function record(sFile, duration, callback) { - this._workletNode.port.postMessage({ - name: 'start', - duration: duration - }); - - if (sFile && callback) { - this._callback = function (buffer) { - sFile.setBuffer(buffer); - callback(); - }; - } else if (sFile) { - this._callback = function (buffer) { - sFile.setBuffer(buffer); - }; - } - } - /** - * Stop the recording. Once the recording is stopped, - * the results will be sent to the p5.SoundFile that - * was given on .record(), and if a callback function - * was provided on record, that function will be called. - * - * @method stop - * @for p5.SoundRecorder - */ - - }, { - key: "stop", - value: function stop() { - this._workletNode.port.postMessage({ - name: 'stop' - }); - } - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - this._callback = function () {}; - - if (this.input) { - this.input.disconnect(); - } - - this.input = null; - this._workletNode = null; - } - }]); - - return SoundRecorder; -}(); - - var soundRecorder = (soundRecorder_SoundRecorder); -function distortion_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { distortion_typeof = function _typeof(obj) { return typeof obj; }; } else { distortion_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return distortion_typeof(obj); } - -function distortion_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function distortion_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function distortion_createClass(Constructor, protoProps, staticProps) { if (protoProps) distortion_defineProperties(Constructor.prototype, protoProps); if (staticProps) distortion_defineProperties(Constructor, staticProps); return Constructor; } - -function distortion_possibleConstructorReturn(self, call) { if (call && (distortion_typeof(call) === "object" || typeof call === "function")) { return call; } return distortion_assertThisInitialized(self); } - -function distortion_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function distortion_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { distortion_get = Reflect.get; } else { distortion_get = function _get(target, property, receiver) { var base = distortion_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return distortion_get(target, property, receiver || target); } - -function distortion_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = distortion_getPrototypeOf(object); if (object === null) break; } return object; } - -function distortion_getPrototypeOf(o) { distortion_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return distortion_getPrototypeOf(o); } - -function distortion_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) distortion_setPrototypeOf(subClass, superClass); } - -function distortion_setPrototypeOf(o, p) { distortion_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return distortion_setPrototypeOf(o, p); } - - - -function makeDistortionCurve(amount) { - var k = typeof amount === 'number' ? amount : 50; - var numSamples = 44100; - var curve = new Float32Array(numSamples); - var deg = Math.PI / 180; - var i = 0; - var x; - - for (; i < numSamples; ++i) { - x = i * 2 / numSamples - 1; - curve[i] = (3 + k) * x * 20 * deg / (Math.PI + k * Math.abs(x)); - } - - return curve; -} -/** - * A Distortion effect created with a Waveshaper Node, - * with an approach adapted from - * [Kevin Ennis](http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion) - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Distortion - * @extends p5.Effect - * @constructor - * @param {Number} [amount=0.25] Unbounded distortion amount. - * Normal values range from 0-1. - * @param {String} [oversample='none'] 'none', '2x', or '4x'. - * - */ - - -var Distortion = -function (_Effect) { - distortion_inherits(Distortion, _Effect); - - function Distortion(amount, oversample) { - var _this; - - distortion_classCallCheck(this, Distortion); - - _this = distortion_possibleConstructorReturn(this, distortion_getPrototypeOf(Distortion).call(this)); - - if (typeof amount === 'undefined') { - amount = 0.25; - } - - if (typeof amount !== 'number') { - throw new Error('amount must be a number'); - } - - if (typeof oversample === 'undefined') { - oversample = '2x'; - } - - if (typeof oversample !== 'string') { - throw new Error('oversample must be a String'); - } - - var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); - /** - * The p5.Distortion is built with a - * - * Web Audio WaveShaper Node. - * - * @property {AudioNode} WaveShaperNode - */ - - _this.waveShaperNode = _this.ac.createWaveShaper(); - _this.amount = curveAmount; - _this.waveShaperNode.curve = makeDistortionCurve(curveAmount); - _this.waveShaperNode.oversample = oversample; - - _this.input.connect(_this.waveShaperNode); - - _this.waveShaperNode.connect(_this.wet); - - return _this; - } - /** - * Process a sound source, optionally specify amount and oversample values. - * - * @method process - * @for p5.Distortion - * @param {Number} [amount=0.25] Unbounded distortion amount. - * Normal values range from 0-1. - * @param {String} [oversample='none'] 'none', '2x', or '4x'. - */ - - - distortion_createClass(Distortion, [{ - key: "process", - value: function process(src, amount, oversample) { - src.connect(this.input); - this.set(amount, oversample); - } - /** - * Set the amount and oversample of the waveshaper distortion. - * - * @method set - * @for p5.Distortion - * @param {Number} [amount=0.25] Unbounded distortion amount. - * Normal values range from 0-1. - * @param {String} [oversample='none'] 'none', '2x', or '4x'. - */ - - }, { - key: "set", - value: function set(amount, oversample) { - if (amount) { - var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); - this.amount = curveAmount; - this.waveShaperNode.curve = makeDistortionCurve(curveAmount); - } - - if (oversample) { - this.waveShaperNode.oversample = oversample; - } - } - /** - * Return the distortion amount, typically between 0-1. - * - * @method getAmount - * @for p5.Distortion - * @return {Number} Unbounded distortion amount. - * Normal values range from 0-1. - */ - - }, { - key: "getAmount", - value: function getAmount() { - return this.amount; - } - /** - * Return the oversampling. - * - * @method getOversample - * @for p5.Distortion - * @return {String} Oversample can either be 'none', '2x', or '4x'. - */ - - }, { - key: "getOversample", - value: function getOversample() { - return this.waveShaperNode.oversample; - } - }, { - key: "dispose", - value: function dispose() { - distortion_get(distortion_getPrototypeOf(Distortion.prototype), "dispose", this).call(this); - - if (this.waveShaperNode) { - this.waveShaperNode.disconnect(); - this.waveShaperNode = null; - } - } - }]); - - return Distortion; -}(effect); - - var distortion = (Distortion); -function gain_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function gain_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function gain_createClass(Constructor, protoProps, staticProps) { if (protoProps) gain_defineProperties(Constructor.prototype, protoProps); if (staticProps) gain_defineProperties(Constructor, staticProps); return Constructor; } - - -/** - * A gain node is usefull to set the relative volume of sound. - * It's typically used to build mixers. - * - * @class p5.Gain - * @constructor - * @example - *
            - * - * // load two soundfile and crossfade beetween them - * let sound1,sound2; - * let sound1Gain, sound2Gain, mixGain; - * function preload(){ - * soundFormats('ogg', 'mp3'); - * sound1 = loadSound('assets/Damscray_-_Dancing_Tiger_01'); - * sound2 = loadSound('assets/beat'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(startSound); - * // create a 'mix' gain bus to which we will connect both soundfiles - * mixGain = new p5.Gain(); - * mixGain.connect(); - * sound1.disconnect(); // diconnect from p5 output - * sound1Gain = new p5.Gain(); // setup a gain node - * sound1Gain.setInput(sound1); // connect the first sound to its input - * sound1Gain.connect(mixGain); // connect its output to the final mix bus - * sound2.disconnect(); - * sound2Gain = new p5.Gain(); - * sound2Gain.setInput(sound2); - * sound2Gain.connect(mixGain); - * } - * function startSound() { - * sound1.loop(); - * sound2.loop(); - * loop(); - * } - * function mouseReleased() { - * sound1.stop(); - * sound2.stop(); - * } - * function draw(){ - * background(220); - * textAlign(CENTER); - * textSize(11); - * fill(0); - * if (!sound1.isPlaying()) { - * text('tap and drag to play', width/2, height/2); - * return; - * } - * // map the horizontal position of the mouse to values useable for volume * control of sound1 - * var sound1Volume = constrain(map(mouseX,width,0,0,1), 0, 1); - * var sound2Volume = 1-sound1Volume; - * sound1Gain.amp(sound1Volume); - * sound2Gain.amp(sound2Volume); - * // map the vertical position of the mouse to values useable for 'output * volume control' - * var outputVolume = constrain(map(mouseY,height,0,0,1), 0, 1); - * mixGain.amp(outputVolume); - * text('output', width/2, height - outputVolume * height * 0.9) - * fill(255, 0, 255); - * textAlign(LEFT); - * text('sound1', 5, height - sound1Volume * height * 0.9); - * textAlign(RIGHT); - * text('sound2', width - 5, height - sound2Volume * height * 0.9); - * } - *
            - */ - -var gain_Gain = -function () { - function Gain() { - gain_classCallCheck(this, Gain); - - this.ac = main.audiocontext; - this.input = this.ac.createGain(); - this.output = this.ac.createGain(); - - this.input.gain.value = 0.5; - this.input.connect(this.output); - - main.soundArray.push(this); - } - /** - * Connect a source to the gain node. - * - * @method setInput - * @for p5.Gain - * @param {Object} src p5.sound / Web Audio object with a sound - * output. - */ - - - gain_createClass(Gain, [{ - key: "setInput", - value: function setInput(src) { - src.connect(this.input); - } - /** - * Send output to a p5.sound or web audio object - * - * @method connect - * @for p5.Gain - * @param {Object} unit - */ - - }, { - key: "connect", - value: function connect(unit) { - var u = unit || p5.soundOut.input; - this.output.connect(u.input ? u.input : u); - } - /** - * Disconnect all output. - * - * @method disconnect - * @for p5.Gain - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - } - /** - * Set the output level of the gain node. - * - * @method amp - * @for p5.Gain - * @param {Number} volume amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - - }, { - key: "amp", - value: function amp(vol) { - var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var now = main.audiocontext.currentTime; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(now); - this.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); - this.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); - } - }, { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - - if (this.input) { - this.input.disconnect(); - delete this.input; - } - } - }]); - - return Gain; -}(); - - var gain = (gain_Gain); -function audioVoice_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function audioVoice_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function audioVoice_createClass(Constructor, protoProps, staticProps) { if (protoProps) audioVoice_defineProperties(Constructor.prototype, protoProps); if (staticProps) audioVoice_defineProperties(Constructor, staticProps); return Constructor; } - - -/** - * Base class for monophonic synthesizers. Any extensions of this class - * should follow the API and implement the methods below in order to - * remain compatible with p5.PolySynth(); - * - * @class p5.AudioVoice - * @constructor - */ - -var audioVoice_AudioVoice = -function () { - function AudioVoice() { - audioVoice_classCallCheck(this, AudioVoice); - - this.ac = main.audiocontext; - this.output = this.ac.createGain(); - this.connect(); - main.soundArray.push(this); - } - - audioVoice_createClass(AudioVoice, [{ - key: "play", - value: function play(note, velocity, secondsFromNow, sustime) {} - }, { - key: "triggerAttack", - value: function triggerAttack(note, velocity, secondsFromNow) {} - }, { - key: "triggerRelease", - value: function triggerRelease(secondsFromNow) {} - }, { - key: "amp", - value: function amp(vol, rampTime) {} - /** - * Connect to p5 objects or Web Audio Nodes - * @method connect - * @for p5.AudioVoice - * @param {Object} unit - */ - - }, { - key: "connect", - value: function connect(unit) { - var u = unit || main.input; - this.output.connect(u.input ? u.input : u); - } - /** - * Disconnect from soundOut - * @method disconnect - * @for p5.AudioVoice - */ - - }, { - key: "disconnect", - value: function disconnect() { - this.output.disconnect(); - } - }, { - key: "dispose", - value: function dispose() { - if (this.output) { - this.output.disconnect(); - delete this.output; - } - } - }]); - - return AudioVoice; -}(); - - var audioVoice_0 = (audioVoice_AudioVoice); -function monosynth_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { monosynth_typeof = function _typeof(obj) { return typeof obj; }; } else { monosynth_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return monosynth_typeof(obj); } - -function monosynth_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function monosynth_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function monosynth_createClass(Constructor, protoProps, staticProps) { if (protoProps) monosynth_defineProperties(Constructor.prototype, protoProps); if (staticProps) monosynth_defineProperties(Constructor, staticProps); return Constructor; } - -function monosynth_possibleConstructorReturn(self, call) { if (call && (monosynth_typeof(call) === "object" || typeof call === "function")) { return call; } return monosynth_assertThisInitialized(self); } - -function monosynth_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function monosynth_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { monosynth_get = Reflect.get; } else { monosynth_get = function _get(target, property, receiver) { var base = monosynth_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return monosynth_get(target, property, receiver || target); } - -function monosynth_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = monosynth_getPrototypeOf(object); if (object === null) break; } return object; } - -function monosynth_getPrototypeOf(o) { monosynth_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return monosynth_getPrototypeOf(o); } - -function monosynth_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) monosynth_setPrototypeOf(subClass, superClass); } - -function monosynth_setPrototypeOf(o, p) { monosynth_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return monosynth_setPrototypeOf(o, p); } - - - - - - -var DEFAULT_SUSTAIN = 0.15; -/** - * A MonoSynth is used as a single voice for sound synthesis. - * This is a class to be used in conjunction with the PolySynth - * class. Custom synthetisers should be built inheriting from - * this class. - * - * @class p5.MonoSynth - * @constructor - * @example - *
            - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * textAlign(CENTER); - * text('tap to play', width/2, height/2); - * - * monoSynth = new p5.MonoSynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * let note = random(['Fb4', 'G4']); - * // note velocity (volume, from 0 to 1) - * let velocity = random(); - * // time from now (in seconds) - * let time = 0; - * // note duration (in seconds) - * let dur = 1/6; - * - * monoSynth.play(note, velocity, time, dur); - * } - *
            - **/ - -var monosynth_MonoSynth = -function (_AudioVoice) { - monosynth_inherits(MonoSynth, _AudioVoice); - - function MonoSynth() { - var _this; - - monosynth_classCallCheck(this, MonoSynth); - - _this = monosynth_possibleConstructorReturn(this, monosynth_getPrototypeOf(MonoSynth).call(this)); - _this.oscillator = new oscillator(); - _this.env = new envelope(); - - _this.env.setRange(1, 0); - - _this.env.setExp(true); - - - _this.setADSR(0.02, 0.25, 0.05, 0.35); - - - _this.oscillator.disconnect(); - - _this.oscillator.connect(_this.output); - - _this.env.disconnect(); - - _this.env.setInput(_this.output.gain); - - - _this.oscillator.output.gain.value = 1.0; - - _this.oscillator.start(); - - _this.connect(); - - main.soundArray.push(monosynth_assertThisInitialized(_this)); - /** - * Getters and Setters - * @property {Number} attack - * @for p5.MonoSynth - */ - - /** - * @property {Number} decay - * @for p5.MonoSynth - */ - - /** - * @property {Number} sustain - * @for p5.MonoSynth - */ - - /** - * @property {Number} release - * @for p5.MonoSynth - */ - - Object.defineProperties(monosynth_assertThisInitialized(_this), { - attack: { - get: function get() { - return this.env.aTime; - }, - set: function set(attack) { - this.env.setADSR(attack, this.env.dTime, this.env.sPercent, this.env.rTime); - } - }, - decay: { - get: function get() { - return this.env.dTime; - }, - set: function set(decay) { - this.env.setADSR(this.env.aTime, decay, this.env.sPercent, this.env.rTime); - } - }, - sustain: { - get: function get() { - return this.env.sPercent; - }, - set: function set(sustain) { - this.env.setADSR(this.env.aTime, this.env.dTime, sustain, this.env.rTime); - } - }, - release: { - get: function get() { - return this.env.rTime; - }, - set: function set(release) { - this.env.setADSR(this.env.aTime, this.env.dTime, this.env.sPercent, release); - } - } - }); - return _this; - } - /** - * Play tells the MonoSynth to start playing a note. This method schedules - * the calling of .triggerAttack and .triggerRelease. - * - * @method play - * @for p5.MonoSynth - * @param {String | Number} note the note you want to play, specified as a - * frequency in Hertz (Number) or as a midi - * value in Note/Octave format ("C4", "Eb3"...etc") - * See - * Tone. Defaults to 440 hz. - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) - * @param {Number} [secondsFromNow] time from now (in seconds) at which to play - * @param {Number} [sustainTime] time to sustain before releasing the envelope. Defaults to 0.15 seconds. - * @example - *
            - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * textAlign(CENTER); - * text('tap to play', width/2, height/2); - * - * monoSynth = new p5.MonoSynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * let note = random(['Fb4', 'G4']); - * // note velocity (volume, from 0 to 1) - * let velocity = random(); - * // time from now (in seconds) - * let time = 0; - * // note duration (in seconds) - * let dur = 1/6; - * - * monoSynth.play(note, velocity, time, dur); - * } - *
            - * - */ - - - monosynth_createClass(MonoSynth, [{ - key: "play", - value: function play(note, velocity, secondsFromNow, susTime) { - this.triggerAttack(note, velocity, ~~secondsFromNow); - this.triggerRelease(~~secondsFromNow + (susTime || DEFAULT_SUSTAIN)); - } - /** - * Trigger the Attack, and Decay portion of the Envelope. - * Similar to holding down a key on a piano, but it will - * hold the sustain level until you let go. - * - * @param {String | Number} note the note you want to play, specified as a - * frequency in Hertz (Number) or as a midi - * value in Note/Octave format ("C4", "Eb3"...etc") - * See - * Tone. Defaults to 440 hz - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) - * @param {Number} [secondsFromNow] time from now (in seconds) at which to play - * @method triggerAttack - * @for p5.MonoSynth - * @example - *
            - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(triggerAttack); - * background(220); - * text('tap here for attack, let go to release', 5, 20, width - 20); - * monoSynth = new p5.MonoSynth(); - * } - * - * function triggerAttack() { - * userStartAudio(); - * - * monoSynth.triggerAttack("E3"); - * } - * - * function mouseReleased() { - * monoSynth.triggerRelease(); - * } - *
            - */ - - }, { - key: "triggerAttack", - value: function triggerAttack(note, velocity) { - var secondsFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var freq = noteToFreq(note); - var vel = velocity || 0.1; - this.oscillator.freq(freq, 0, secondsFromNow); - this.env.ramp(this.output.gain, secondsFromNow, vel); - } - /** - * Trigger the release of the Envelope. This is similar to releasing - * the key on a piano and letting the sound fade according to the - * release level and release time. - * - * @param {Number} secondsFromNow time to trigger the release - * @method triggerRelease - * @for p5.MonoSynth - * @example - *
            - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(triggerAttack); - * background(220); - * text('tap here for attack, let go to release', 5, 20, width - 20); - * monoSynth = new p5.MonoSynth(); - * } - * - * function triggerAttack() { - * userStartAudio(); - * - * monoSynth.triggerAttack("E3"); - * } - * - * function mouseReleased() { - * monoSynth.triggerRelease(); - * } - *
            - */ - - }, { - key: "triggerRelease", - value: function triggerRelease() { - var secondsFromNow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - this.env.ramp(this.output.gain, secondsFromNow, 0); - } - /** - * Set values like a traditional - * - * ADSR envelope - * . - * - * @method setADSR - * @for p5.MonoSynth - * @param {Number} attackTime Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - */ - - }, { - key: "setADSR", - value: function setADSR(attack, decay, sustain, release) { - this.env.setADSR(attack, decay, sustain, release); - } - /** - * MonoSynth amp - * @method amp - * @for p5.MonoSynth - * @param {Number} vol desired volume - * @param {Number} [rampTime] Time to reach new volume - * @return {Number} new volume value - */ - - }, { - key: "amp", - value: function amp(vol, rampTime) { - var t = rampTime || 0; - - if (typeof vol !== 'undefined') { - this.oscillator.amp(vol, t); - } - - return this.oscillator.amp().value; - } - /** - * Connect to a p5.sound / Web Audio object. - * - * @method connect - * @for p5.MonoSynth - * @param {Object} unit A p5.sound or Web Audio object - */ - - }, { - key: "connect", - value: function connect(unit) { - var u = unit || main.input; - this.output.connect(u.input ? u.input : u); - } - /** - * Disconnect all outputs - * - * @method disconnect - * @for p5.MonoSynth - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - } - /** - * Get rid of the MonoSynth and free up its resources / memory. - * - * @method dispose - * @for p5.MonoSynth - */ - - }, { - key: "dispose", - value: function dispose() { - monosynth_get(monosynth_getPrototypeOf(MonoSynth.prototype), "dispose", this).call(this); - - if (this.env) { - this.env.dispose(); - } - - if (this.oscillator) { - this.oscillator.dispose(); - } - } - }]); - - return MonoSynth; -}(audioVoice_0); - - var monosynth = (monosynth_MonoSynth); -function onsetDetect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function onsetDetect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function onsetDetect_createClass(Constructor, protoProps, staticProps) { if (protoProps) onsetDetect_defineProperties(Constructor.prototype, protoProps); if (staticProps) onsetDetect_defineProperties(Constructor, staticProps); return Constructor; } - -/** - * Listen for onsets (a sharp increase in volume) within a given - * frequency range. - * - * @class p5.OnsetDetect - * @constructor - * @param {Number} freqLow Low frequency - * @param {Number} freqHigh High frequency - * @param {Number} threshold Amplitude threshold between 0 (no energy) and 1 (maximum) - * @param {Function} callback Function to call when an onset is detected - */ -var OnsetDetect = -function () { - function OnsetDetect(freqLow, freqHigh, threshold, callback) { - onsetDetect_classCallCheck(this, OnsetDetect); - - this.isDetected = false; - this.freqLow = freqLow; - this.freqHigh = freqHigh; - this.treshold = threshold; - this.energy = 0; - this.penergy = 0; - - this.sensitivity = 500; - this.callback = callback; - } - - - onsetDetect_createClass(OnsetDetect, [{ - key: "update", - value: function update(fftObject, callback) { - this.energy = fftObject.getEnergy(this.freqLow, this.freqHigh) / 255; - - if (this.isDetected === false) { - if (this.energy - this.penergy > this.treshold) { - this.isDetected = true; - - if (this.callback) { - this.callback(this.energy); - } else if (callback) { - callback(this.energy); - } - - var self = this; - setTimeout(function () { - self.isDetected = false; - }, this.sensitivity); - } - } - - this.penergy = this.energy; - } - }]); - - return OnsetDetect; -}(); - - var onsetDetect = (OnsetDetect); -function polysynth_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function polysynth_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function polysynth_createClass(Constructor, protoProps, staticProps) { if (protoProps) polysynth_defineProperties(Constructor.prototype, protoProps); if (staticProps) polysynth_defineProperties(Constructor, staticProps); return Constructor; } - - - - -/** - * An AudioVoice is used as a single voice for sound synthesis. - * The PolySynth class holds an array of AudioVoice, and deals - * with voices allocations, with setting notes to be played, and - * parameters to be set. - * - * @class p5.PolySynth - * @constructor - * - * @param {Number} [synthVoice] A monophonic synth voice inheriting - * the AudioVoice class. Defaults to p5.MonoSynth - * @param {Number} [maxVoices] Number of voices, defaults to 8; - * @example - *
            - * let polySynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * text('click to play', 20, 20); - * - * polySynth = new p5.PolySynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * // note duration (in seconds) - * let dur = 1.5; - * - * // time from now (in seconds) - * let time = 0; - * - * // velocity (volume, from 0 to 1) - * let vel = 0.1; - * - * // notes can overlap with each other - * polySynth.play('G2', vel, 0, dur); - * polySynth.play('C3', vel, time += 1/3, dur); - * polySynth.play('G3', vel, time += 1/3, dur); - * } - *
            - **/ - -var polysynth_PolySynth = -function () { - function PolySynth(audioVoice, maxVoices) { - polysynth_classCallCheck(this, PolySynth); - - this.audiovoices = []; - /** - * An object that holds information about which notes have been played and - * which notes are currently being played. New notes are added as keys - * on the fly. While a note has been attacked, but not released, the value of the - * key is the audiovoice which is generating that note. When notes are released, - * the value of the key becomes undefined. - * @property notes - */ - - this.notes = {}; - - this._newest = 0; - this._oldest = 0; - /** - * A PolySynth must have at least 1 voice, defaults to 8 - * @property polyvalue - */ - - this.maxVoices = maxVoices || 8; - /** - * Monosynth that generates the sound for each note that is triggered. The - * p5.PolySynth defaults to using the p5.MonoSynth as its voice. - * @property AudioVoice - */ - - this.AudioVoice = audioVoice === undefined ? p5.MonoSynth : audioVoice; - /** - * This value must only change as a note is attacked or released. Due to delay - * and sustain times, Tone.TimelineSignal is required to schedule the change in value. - * @private - * @property {Tone.TimelineSignal} _voicesInUse - */ - - this._voicesInUse = new TimelineSignal_default.a(0); - this.output = main.audiocontext.createGain(); - this.connect(); - - this._allocateVoices(); - - main.soundArray.push(this); - } - /** - * Construct the appropriate number of audiovoices - * @private - * @for p5.PolySynth - * @method _allocateVoices - */ - - - polysynth_createClass(PolySynth, [{ - key: "_allocateVoices", - value: function _allocateVoices() { - for (var i = 0; i < this.maxVoices; i++) { - this.audiovoices.push(new this.AudioVoice()); - this.audiovoices[i].disconnect(); - this.audiovoices[i].connect(this.output); - } - } - /** - * Play a note by triggering noteAttack and noteRelease with sustain time - * - * @method play - * @for p5.PolySynth - * @param {Number} [note] midi note to play (ranging from 0 to 127 - 60 being a middle C) - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) - * @param {Number} [secondsFromNow] time from now (in seconds) at which to play - * @param {Number} [sustainTime] time to sustain before releasing the envelope - * @example - *
            - * let polySynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * text('click to play', 20, 20); - * - * polySynth = new p5.PolySynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * // note duration (in seconds) - * let dur = 1.5; - * - * // time from now (in seconds) - * let time = 0; - * - * // velocity (volume, from 0 to 1) - * let vel = 0.1; - * - * // notes can overlap with each other - * polySynth.play('G2', vel, 0, dur); - * polySynth.play('C3', vel, time += 1/3, dur); - * polySynth.play('G3', vel, time += 1/3, dur); - * } - *
            - */ - - }, { - key: "play", - value: function play(note, velocity, secondsFromNow) { - var susTime = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - this.noteAttack(note, velocity, secondsFromNow); - this.noteRelease(note, secondsFromNow + susTime); - } - /** - * noteADSR sets the envelope for a specific note that has just been triggered. - * Using this method modifies the envelope of whichever audiovoice is being used - * to play the desired note. The envelope should be reset before noteRelease is called - * in order to prevent the modified envelope from being used on other notes. - * - * @method noteADSR - * @for p5.PolySynth - * @param {Number} [note] Midi note on which ADSR should be set. - * @param {Number} [attackTime] Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - **/ - - }, { - key: "noteADSR", - value: function noteADSR(note, a, d, s, r) { - var timeFromNow = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; - var now = main.audiocontext.currentTime; - var t = now + timeFromNow; - this.audiovoices[this.notes[note].getValueAtTime(t)].setADSR(a, d, s, r); - } - /** - * Set the PolySynths global envelope. This method modifies the envelopes of each - * monosynth so that all notes are played with this envelope. - * - * @method setADSR - * @for p5.PolySynth - * @param {Number} [attackTime] Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - **/ - - }, { - key: "setADSR", - value: function setADSR(a, d, s, r) { - this.audiovoices.forEach(function (voice) { - voice.setADSR(a, d, s, r); - }); - } - /** - * Trigger the Attack, and Decay portion of a MonoSynth. - * Similar to holding down a key on a piano, but it will - * hold the sustain level until you let go. - * - * @method noteAttack - * @for p5.PolySynth - * @param {Number} [note] midi note on which attack should be triggered. - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1)/ - * @param {Number} [secondsFromNow] time from now (in seconds) - * @example - *
            - * let polySynth = new p5.PolySynth(); - * let pitches = ['G', 'D', 'G', 'C']; - * let octaves = [2, 3, 4]; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playChord); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function playChord() { - * userStartAudio(); - * - * // play a chord: multiple notes at the same time - * for (let i = 0; i < 4; i++) { - * let note = random(pitches) + random(octaves); - * polySynth.noteAttack(note, 0.1); - * } - * } - * - * function mouseReleased() { - * // release all voices - * polySynth.noteRelease(); - * } - *
            - */ - - }, { - key: "noteAttack", - value: function noteAttack(_note, _velocity) { - var secondsFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var acTime = main.audiocontext.currentTime + secondsFromNow; - - var note = noteToFreq(_note); - var velocity = _velocity || 0.1; - var currentVoice; - - if (this.notes[note] && this.notes[note].getValueAtTime(acTime) !== null) { - this.noteRelease(note, 0); - } - - - if (this._voicesInUse.getValueAtTime(acTime) < this.maxVoices) { - currentVoice = Math.max(~~this._voicesInUse.getValueAtTime(acTime), 0); - } - else { - currentVoice = this._oldest; - oldestNote = freqToMidi(this.audiovoices[this._oldest].oscillator.freq().value); - this.noteRelease(oldestNote); - this._oldest = (this._oldest + 1) % (this.maxVoices - 1); - } - - - this.notes[note] = new TimelineSignal_default.a(); - this.notes[note].setValueAtTime(currentVoice, acTime); - - var previousVal = this._voicesInUse._searchBefore(acTime) === null ? 0 : this._voicesInUse._searchBefore(acTime).value; - - this._voicesInUse.setValueAtTime(previousVal + 1, acTime); - - - this._updateAfter(acTime, 1); - - this._newest = currentVoice; - - if (typeof velocity === 'number') { - var maxRange = 1 / this._voicesInUse.getValueAtTime(acTime) * 2; - velocity = velocity > maxRange ? maxRange : velocity; - } - - - this.audiovoices[currentVoice].triggerAttack(note, velocity, secondsFromNow); - } - /** - * Private method to ensure accurate values of this._voicesInUse - * Any time a new value is scheduled, it is necessary to increment all subsequent - * scheduledValues after attack, and decrement all subsequent - * scheduledValues after release - * - * @private - * @for p5.PolySynth - * @param {[type]} time [description] - * @param {[type]} value [description] - * @return {[type]} [description] - */ - - }, { - key: "_updateAfter", - value: function _updateAfter(time, value) { - if (this._voicesInUse._searchAfter(time) === null) { - return; - } else { - this._voicesInUse._searchAfter(time).value += value; - - var nextTime = this._voicesInUse._searchAfter(time).time; - - this._updateAfter(nextTime, value); - } - } - /** - * Trigger the Release of an AudioVoice note. This is similar to releasing - * the key on a piano and letting the sound fade according to the - * release level and release time. - * - * @method noteRelease - * @for p5.PolySynth - * @param {Number} [note] midi note on which attack should be triggered. - * If no value is provided, all notes will be released. - * @param {Number} [secondsFromNow] time to trigger the release - * @example - *
            - * let polySynth = new p5.PolySynth(); - * let pitches = ['G', 'D', 'G', 'C']; - * let octaves = [2, 3, 4]; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playChord); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function playChord() { - * userStartAudio(); - * - * // play a chord: multiple notes at the same time - * for (let i = 0; i < 4; i++) { - * let note = random(pitches) + random(octaves); - * polySynth.noteAttack(note, 0.1); - * } - * } - * - * function mouseReleased() { - * // release all voices - * polySynth.noteRelease(); - * } - *
            - * - */ - - }, { - key: "noteRelease", - value: function noteRelease(_note, secondsFromNow) { - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - - if (!_note) { - this.audiovoices.forEach(function (voice) { - voice.triggerRelease(tFromNow); - }); - - this._voicesInUse.setValueAtTime(0, t); - - for (var n in this.notes) { - this.notes[n].dispose(); - delete this.notes[n]; - } - - return; - } - - - var note = noteToFreq(_note); - - if (!this.notes[note] || this.notes[note].getValueAtTime(t) === null) { - console.warn('Cannot release a note that is not already playing'); - } else { - var previousVal = Math.max(~~this._voicesInUse.getValueAtTime(t).value, 1); - - this._voicesInUse.setValueAtTime(previousVal - 1, t); - - - if (previousVal > 0) { - this._updateAfter(t, -1); - } - - this.audiovoices[this.notes[note].getValueAtTime(t)].triggerRelease(tFromNow); - this.notes[note].dispose(); - delete this.notes[note]; - this._newest = this._newest === 0 ? 0 : (this._newest - 1) % (this.maxVoices - 1); - } - } - /** - * Connect to a p5.sound / Web Audio object. - * - * @method connect - * @for p5.PolySynth - * @param {Object} unit A p5.sound or Web Audio object - */ - - }, { - key: "connect", - value: function connect(unit) { - var u = unit || main.input; - this.output.connect(u.input ? u.input : u); - } - /** - * Disconnect all outputs - * - * @method disconnect - * @for p5.PolySynth - */ - - }, { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - } - /** - * Get rid of the MonoSynth and free up its resources / memory. - * - * @method dispose - * @for p5.PolySynth - */ - - }, { - key: "dispose", - value: function dispose() { - this.audiovoices.forEach(function (voice) { - voice.dispose(); - }); - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - } - }]); - - return PolySynth; -}(); - - var polysynth = (polysynth_PolySynth); -function Signal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Signal_Signal = function Signal() { - Signal_classCallCheck(this, Signal); - - console.warn('p5.Signal is deprecated , Use Tone.js Signal instead '); -}; - - var deprecations_Signal = (Signal_Signal); - - - -p5.prototype.getAudioContext = audiocontext["b" ]; -p5.prototype.userStartAudio = audiocontext["c" ]; - - -p5.prototype.sampleRate = sampleRate; -p5.prototype.freqToMidi = freqToMidi; -p5.prototype.midiToFreq = midiToFreq; -p5.prototype.noteToFreq = noteToFreq; -p5.prototype.soundFormats = soundFormats; -p5.prototype.disposeSound = disposeSound; -p5.prototype._checkFileFormats = _checkFileFormats; -p5.prototype._mathChain = _mathChain; -p5.prototype.convertToWav = convertToWav; -p5.prototype.interleave = interleave; -p5.prototype.writeUTFBytes = writeUTFBytes; -p5.prototype.safeBufferSize = safeBufferSize; -p5.prototype.saveSound = saveSound; - -p5.prototype.registerMethod('remove', p5.prototype.disposeSound); - - - -p5.Panner = panner_0; - -p5.SoundFile = soundfile; -p5.prototype.loadSound = loadSound; - -p5.prototype.registerPreloadMethod('loadSound', p5.prototype); - -p5.Amplitude = amplitude; - -p5.FFT = fft; - -p5.Oscillator = oscillator; -p5.SinOsc = SinOsc; -p5.TriOsc = TriOsc; -p5.SawOsc = SawOsc; -p5.SqrOsc = SqrOsc; - - -p5.Noise = noise; - -p5.Pulse = pulse; +(function (modules) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if (installedModules[moduleId]) { + return installedModules[moduleId].exports; + } + var module = (installedModules[moduleId] = { + i: moduleId, + l: false, + exports: {}, + }); + modules[moduleId].call( + module.exports, + module, + module.exports, + __webpack_require__, + ); + module.l = true; + return module.exports; + } + __webpack_require__.m = modules; + __webpack_require__.c = installedModules; + __webpack_require__.d = function (exports, name, getter) { + if (!__webpack_require__.o(exports, name)) { + Object.defineProperty(exports, name, { enumerable: true, get: getter }); + } + }; + __webpack_require__.r = function (exports) { + if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); + } + Object.defineProperty(exports, "__esModule", { value: true }); + }; + __webpack_require__.t = function (value, mode) { + if (mode & 1) value = __webpack_require__(value); + if (mode & 8) return value; + if (mode & 4 && typeof value === "object" && value && value.__esModule) + return value; + var ns = Object.create(null); + __webpack_require__.r(ns); + Object.defineProperty(ns, "default", { enumerable: true, value: value }); + if (mode & 2 && typeof value != "string") + for (var key in value) + __webpack_require__.d( + ns, + key, + function (key) { + return value[key]; + }.bind(null, key), + ); + return ns; + }; + __webpack_require__.n = function (module) { + var getter = + module && module.__esModule + ? function getDefault() { + return module["default"]; + } + : function getModuleExports() { + return module; + }; + __webpack_require__.d(getter, "a", getter); + return getter; + }; + __webpack_require__.o = function (object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + __webpack_require__.p = ""; + return __webpack_require__((__webpack_require__.s = 40)); +})([ + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_RESULT__ = function () { + "use strict"; + function a(t, e) { + this.isUndef(t) || 1 === t + ? (this.input = this.context.createGain()) + : 1 < t && (this.input = new Array(t)), + this.isUndef(e) || 1 === e + ? (this.output = this.context.createGain()) + : 1 < e && (this.output = new Array(t)); + } + var e; + return ( + (a.prototype.set = function (t, e, n) { + if (this.isObject(t)) n = e; + else if (this.isString(t)) { + var o = {}; + (o[t] = e), (t = o); + } + t: for (var i in t) { + e = t[i]; + var r = this; + if (-1 !== i.indexOf(".")) { + for (var s = i.split("."), u = 0; u < s.length - 1; u++) + if ((r = r[s[u]]) instanceof a) { + s.splice(0, u + 1); + var p = s.join("."); + r.set(p, e); + continue t; + } + i = s[s.length - 1]; + } + var c = r[i]; + this.isUndef(c) || + ((a.Signal && c instanceof a.Signal) || + (a.Param && c instanceof a.Param) + ? c.value !== e && + (this.isUndef(n) ? (c.value = e) : c.rampTo(e, n)) + : c instanceof AudioParam + ? c.value !== e && (c.value = e) + : c instanceof a + ? c.set(e) + : c !== e && (r[i] = e)); + } + return this; + }), + (a.prototype.get = function (t) { + this.isUndef(t) + ? (t = this._collectDefaults(this.constructor)) + : this.isString(t) && (t = [t]); + for (var e = {}, n = 0; n < t.length; n++) { + var o = t[n], + i = this, + r = e; + if (-1 !== o.indexOf(".")) { + for (var s = o.split("."), u = 0; u < s.length - 1; u++) { + var p = s[u]; + (r[p] = r[p] || {}), (r = r[p]), (i = i[p]); + } + o = s[s.length - 1]; + } + var c = i[o]; + this.isObject(t[o]) + ? (r[o] = c.get()) + : a.Signal && c instanceof a.Signal + ? (r[o] = c.value) + : a.Param && c instanceof a.Param + ? (r[o] = c.value) + : c instanceof AudioParam + ? (r[o] = c.value) + : c instanceof a + ? (r[o] = c.get()) + : this.isFunction(c) || this.isUndef(c) || (r[o] = c); + } + return e; + }), + (a.prototype._collectDefaults = function (t) { + var e = []; + if ( + (this.isUndef(t.defaults) || (e = Object.keys(t.defaults)), + !this.isUndef(t._super)) + ) + for ( + var n = this._collectDefaults(t._super), o = 0; + o < n.length; + o++ + ) + -1 === e.indexOf(n[o]) && e.push(n[o]); + return e; + }), + (a.prototype.toString = function () { + for (var t in a) { + var e = t[0].match(/^[A-Z]$/), + n = a[t] === this.constructor; + if (this.isFunction(a[t]) && e && n) return t; + } + return "Tone"; + }), + Object.defineProperty(a.prototype, "numberOfInputs", { + get: function () { + return this.input + ? this.isArray(this.input) + ? this.input.length + : 1 + : 0; + }, + }), + Object.defineProperty(a.prototype, "numberOfOutputs", { + get: function () { + return this.output + ? this.isArray(this.output) + ? this.output.length + : 1 + : 0; + }, + }), + (a.prototype.dispose = function () { + return ( + this.isUndef(this.input) || + (this.input instanceof AudioNode && this.input.disconnect(), + (this.input = null)), + this.isUndef(this.output) || + (this.output instanceof AudioNode && this.output.disconnect(), + (this.output = null)), + this + ); + }), + (a.prototype.connect = function (t, e, n) { + return ( + Array.isArray(this.output) + ? ((e = this.defaultArg(e, 0)), this.output[e].connect(t, 0, n)) + : this.output.connect(t, e, n), + this + ); + }), + (a.prototype.disconnect = function (t, e, n) { + this.isArray(this.output) + ? this.isNumber(t) + ? this.output[t].disconnect() + : ((e = this.defaultArg(e, 0)), + this.output[e].disconnect(t, 0, n)) + : this.output.disconnect.apply(this.output, arguments); + }), + (a.prototype.connectSeries = function () { + if (1 < arguments.length) + for (var t = arguments[0], e = 1; e < arguments.length; e++) { + var n = arguments[e]; + t.connect(n), (t = n); + } + return this; + }), + (a.prototype.chain = function () { + if (0 < arguments.length) + for (var t = this, e = 0; e < arguments.length; e++) { + var n = arguments[e]; + t.connect(n), (t = n); + } + return this; + }), + (a.prototype.fan = function () { + if (0 < arguments.length) + for (var t = 0; t < arguments.length; t++) + this.connect(arguments[t]); + return this; + }), + (AudioNode.prototype.chain = a.prototype.chain), + (AudioNode.prototype.fan = a.prototype.fan), + (a.prototype.defaultArg = function (t, e) { + if (this.isObject(t) && this.isObject(e)) { + var n = {}; + for (var o in t) n[o] = this.defaultArg(e[o], t[o]); + for (var i in e) n[i] = this.defaultArg(t[i], e[i]); + return n; + } + return this.isUndef(t) ? e : t; + }), + (a.prototype.optionsObject = function (t, e, n) { + var o = {}; + if (1 === t.length && this.isObject(t[0])) o = t[0]; + else for (var i = 0; i < e.length; i++) o[e[i]] = t[i]; + return this.isUndef(n) ? o : this.defaultArg(o, n); + }), + (a.prototype.isUndef = function (t) { + return void 0 === t; + }), + (a.prototype.isFunction = function (t) { + return "function" == typeof t; + }), + (a.prototype.isNumber = function (t) { + return "number" == typeof t; + }), + (a.prototype.isObject = function (t) { + return ( + "[object Object]" === Object.prototype.toString.call(t) && + t.constructor === Object + ); + }), + (a.prototype.isBoolean = function (t) { + return "boolean" == typeof t; + }), + (a.prototype.isArray = function (t) { + return Array.isArray(t); + }), + (a.prototype.isString = function (t) { + return "string" == typeof t; + }), + (a.noOp = function () {}), + (a.prototype._readOnly = function (t) { + if (Array.isArray(t)) + for (var e = 0; e < t.length; e++) this._readOnly(t[e]); + else Object.defineProperty(this, t, { writable: !1, enumerable: !0 }); + }), + (a.prototype._writable = function (t) { + if (Array.isArray(t)) + for (var e = 0; e < t.length; e++) this._writable(t[e]); + else Object.defineProperty(this, t, { writable: !0 }); + }), + (a.State = { + Started: "started", + Stopped: "stopped", + Paused: "paused", + }), + (a.prototype.equalPowerScale = function (t) { + var e = 0.5 * Math.PI; + return Math.sin(t * e); + }), + (a.prototype.dbToGain = function (t) { + return Math.pow(2, t / 6); + }), + (a.prototype.gainToDb = function (t) { + return (Math.log(t) / Math.LN10) * 20; + }), + (a.prototype.intervalToFrequencyRatio = function (t) { + return Math.pow(2, t / 12); + }), + (a.prototype.now = function () { + return a.context.now(); + }), + (a.now = function () { + return a.context.now(); + }), + (a.extend = function (t, e) { + function n() {} + a.prototype.isUndef(e) && (e = a), + (n.prototype = e.prototype), + (t.prototype = new n()), + ((t.prototype.constructor = t)._super = e); + }), + Object.defineProperty(a, "context", { + get: function () { + return e; + }, + set: function (t) { + (e = a.Context && t instanceof a.Context ? t : new a.Context(t)), + a.Context && a.Context.emit("init", e); + }, + }), + Object.defineProperty(a.prototype, "context", { + get: function () { + return a.context; + }, + }), + (a.setContext = function (t) { + a.context = t; + }), + Object.defineProperty(a.prototype, "blockTime", { + get: function () { + return 128 / this.context.sampleRate; + }, + }), + Object.defineProperty(a.prototype, "sampleTime", { + get: function () { + return 1 / this.context.sampleRate; + }, + }), + Object.defineProperty(a, "supported", { + get: function () { + var t = + window.hasOwnProperty("AudioContext") || + window.hasOwnProperty("webkitAudioContext"), + e = window.hasOwnProperty("Promise"), + n = window.hasOwnProperty("Worker"); + return t && e && n; + }, + }), + (a.version = "r10"), + window.TONE_SILENCE_VERSION_LOGGING || + console.log( + "%c * Tone.js " + a.version + " * ", + "background: #000; color: #fff", + ), + a + ); + }.call(exports, __webpack_require__, exports, module)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(2), + __webpack_require__(10), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + (i.Multiply = function (t) { + this.createInsOuts(2, 0), + (this._mult = this.input[0] = this.output = new i.Gain()), + (this._param = this.input[1] = this.output.gain), + (this._param.value = this.defaultArg(t, 0)); + }), + i.extend(i.Multiply, i.Signal), + (i.Multiply.prototype.dispose = function () { + return ( + i.prototype.dispose.call(this), + this._mult.dispose(), + (this._mult = null), + (this._param = null), + this + ); + }), + i.Multiply + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(6), + __webpack_require__(9), + __webpack_require__(18), + __webpack_require__(10), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { + "use strict"; + return ( + (n.Signal = function () { + var t = this.optionsObject( + arguments, + ["value", "units"], + n.Signal.defaults, + ); + (this.output = this._gain = this.context.createGain()), + (t.param = this._gain.gain), + n.Param.call(this, t), + (this.input = this._param = this._gain.gain), + this.context.getConstant(1).chain(this._gain); + }), + n.extend(n.Signal, n.Param), + (n.Signal.defaults = { value: 0, units: n.Type.Default, convert: !0 }), + (n.Signal.prototype.connect = n.SignalBase.prototype.connect), + (n.Signal.prototype.dispose = function () { + return ( + n.Param.prototype.dispose.call(this), + (this._param = null), + this._gain.disconnect(), + (this._gain = null), + this + ); + }), + n.Signal + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + (function (global) { + __webpack_require__.d(__webpack_exports__, "b", function () { + return getAudioContext; + }); + __webpack_require__.d(__webpack_exports__, "c", function () { + return userStartAudio; + }); + var startaudiocontext__WEBPACK_IMPORTED_MODULE_0__ = + __webpack_require__(22); + var startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default = + __webpack_require__.n(startaudiocontext__WEBPACK_IMPORTED_MODULE_0__); + var Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); + var Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1___default = + __webpack_require__.n(Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1__); + var Tone_core_Context__WEBPACK_IMPORTED_MODULE_2__ = + __webpack_require__(12); + var Tone_core_Context__WEBPACK_IMPORTED_MODULE_2___default = + __webpack_require__.n(Tone_core_Context__WEBPACK_IMPORTED_MODULE_2__); + global.TONE_SILENCE_VERSION_LOGGING = true; + + var audiocontext = new window.AudioContext(); + + Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1___default.a.setContext( + audiocontext, + ); + /** + *

            Returns the Audio Context for this sketch. Useful for users + * who would like to dig deeper into the Web Audio API + * .

            + * + *

            Some browsers require users to startAudioContext + * with a user gesture, such as touchStarted in the example below.

            + * + * @for p5 + * @method getAudioContext + * @return {Object} AudioContext for this sketch + * @example + *
            + * function draw() { + * background(255); + * textAlign(CENTER); + * + * if (getAudioContext().state !== 'running') { + * text('click to start audio', width/2, height/2); + * } else { + * text('audio is enabled', width/2, height/2); + * } + * } + * + * function touchStarted() { + * if (getAudioContext().state !== 'running') { + * getAudioContext().resume(); + * } + * var synth = new p5.MonoSynth(); + * synth.play('A4', 0.5, 0, 0.2); + * } + * + *
            + */ + + function getAudioContext() { + return audiocontext; + } + /** + *

            It is not only a good practice to give users control over starting + * audio. This policy is enforced by many web browsers, including iOS and + * Google Chrome, which create the Web Audio API's + * Audio Context + * in a suspended state.

            + * + *

            In these browser-specific policies, sound will not play until a user + * interaction event (i.e. mousePressed()) explicitly resumes + * the AudioContext, or starts an audio node. This can be accomplished by + * calling start() on a p5.Oscillator, + * play() on a p5.SoundFile, or simply + * userStartAudio().

            + * + *

            userStartAudio() starts the AudioContext on a user + * gesture. The default behavior will enable audio on any + * mouseUp or touchEnd event. It can also be placed in a specific + * interaction function, such as mousePressed() as in the + * example below. This method utilizes + * StartAudioContext + * , a library by Yotam Mann (MIT Licence, 2016).

            + * @param {Element|Array} [elements] This argument can be an Element, + * Selector String, NodeList, p5.Element, + * jQuery Element, or an Array of any of those. + * @param {Function} [callback] Callback to invoke when the AudioContext + * has started + * @return {Promise} Returns a Promise that resolves when + * the AudioContext state is 'running' + * @method userStartAudio + * @for p5 + * @example + *
            + * function setup() { + * // mimics the autoplay policy + * getAudioContext().suspend(); + * + * let mySynth = new p5.MonoSynth(); + * + * // This won't play until the context has resumed + * mySynth.play('A6'); + * } + * function draw() { + * background(220); + * textAlign(CENTER, CENTER); + * text(getAudioContext().state, width/2, height/2); + * } + * function mousePressed() { + * userStartAudio(); + * } + *
            + */ + + function userStartAudio(elements, callback) { + var elt = elements; + + if (elements instanceof p5.Element) { + elt = elements.elt; + } else if ( + elements instanceof Array && + elements[0] instanceof p5.Element + ) { + elt = elements.map(function (e) { + return e.elt; + }); + } + + return startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default()( + audiocontext, + elt, + callback, + ); + } + __webpack_exports__["a"] = audiocontext; + }).call(this, __webpack_require__(26)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(2), + __webpack_require__(10), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + (i.Add = function (t) { + this.createInsOuts(2, 0), + (this._sum = + this.input[0] = + this.input[1] = + this.output = + new i.Gain()), + (this._param = this.input[1] = new i.Signal(t)), + this._param.connect(this._sum); + }), + i.extend(i.Add, i.Signal), + (i.Add.prototype.dispose = function () { + return ( + i.prototype.dispose.call(this), + this._sum.dispose(), + (this._sum = null), + this._param.dispose(), + (this._param = null), + this + ); + }), + i.Add + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports) { + module.exports = { + recorderProcessor: "recorder-processor", + soundFileProcessor: "sound-file-processor", + amplitudeProcessor: "amplitude-processor", + }; + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(15), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { + "use strict"; + return ( + (e.WaveShaper = function (e, t) { + (this._shaper = + this.input = + this.output = + this.context.createWaveShaper()), + (this._curve = null), + Array.isArray(e) + ? (this.curve = e) + : isFinite(e) || this.isUndef(e) + ? (this._curve = new Float32Array(this.defaultArg(e, 1024))) + : this.isFunction(e) && + ((this._curve = new Float32Array(this.defaultArg(t, 1024))), + this.setMap(e)); + }), + e.extend(e.WaveShaper, e.SignalBase), + (e.WaveShaper.prototype.setMap = function (e) { + for (var t = 0, r = this._curve.length; t < r; t++) { + var s = (t / (r - 1)) * 2 - 1; + this._curve[t] = e(s, t); + } + return (this._shaper.curve = this._curve), this; + }), + Object.defineProperty(e.WaveShaper.prototype, "curve", { + get: function () { + return this._shaper.curve; + }, + set: function (e) { + (this._curve = new Float32Array(e)), + (this._shaper.curve = this._curve); + }, + }), + Object.defineProperty(e.WaveShaper.prototype, "oversample", { + get: function () { + return this._shaper.oversample; + }, + set: function (e) { + if (-1 === ["none", "2x", "4x"].indexOf(e)) + throw new RangeError( + "Tone.WaveShaper: oversampling must be either 'none', '2x', or '4x'", + ); + this._shaper.oversample = e; + }, + }), + (e.WaveShaper.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._shaper.disconnect(), + (this._shaper = null), + (this._curve = null), + this + ); + }), + e.WaveShaper + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(2), + __webpack_require__(19), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + "use strict"; + return ( + (o.TimelineSignal = function () { + var e = this.optionsObject( + arguments, + ["value", "units"], + o.Signal.defaults, + ); + (this._events = new o.Timeline(10)), + o.Signal.apply(this, e), + (e.param = this._param), + o.Param.call(this, e), + (this._initial = this._fromUnits(this._param.value)); + }), + o.extend(o.TimelineSignal, o.Param), + (o.TimelineSignal.Type = { + Linear: "linear", + Exponential: "exponential", + Target: "target", + Curve: "curve", + Set: "set", + }), + Object.defineProperty(o.TimelineSignal.prototype, "value", { + get: function () { + var e = this.now(), + t = this.getValueAtTime(e); + return this._toUnits(t); + }, + set: function (e) { + var t = this._fromUnits(e); + (this._initial = t), + this.cancelScheduledValues(), + (this._param.value = t); + }, + }), + (o.TimelineSignal.prototype.setValueAtTime = function (e, t) { + return ( + (e = this._fromUnits(e)), + (t = this.toSeconds(t)), + this._events.add({ + type: o.TimelineSignal.Type.Set, + value: e, + time: t, + }), + this._param.setValueAtTime(e, t), + this + ); + }), + (o.TimelineSignal.prototype.linearRampToValueAtTime = function (e, t) { + return ( + (e = this._fromUnits(e)), + (t = this.toSeconds(t)), + this._events.add({ + type: o.TimelineSignal.Type.Linear, + value: e, + time: t, + }), + this._param.linearRampToValueAtTime(e, t), + this + ); + }), + (o.TimelineSignal.prototype.exponentialRampToValueAtTime = function ( + e, + t, + ) { + t = this.toSeconds(t); + var i = this._searchBefore(t); + i && 0 === i.value && this.setValueAtTime(this._minOutput, i.time), + (e = this._fromUnits(e)); + var n = Math.max(e, this._minOutput); + return ( + this._events.add({ + type: o.TimelineSignal.Type.Exponential, + value: n, + time: t, + }), + e < this._minOutput + ? (this._param.exponentialRampToValueAtTime( + this._minOutput, + t - this.sampleTime, + ), + this.setValueAtTime(0, t)) + : this._param.exponentialRampToValueAtTime(e, t), + this + ); + }), + (o.TimelineSignal.prototype.setTargetAtTime = function (e, t, i) { + return ( + (e = this._fromUnits(e)), + (e = Math.max(this._minOutput, e)), + (i = Math.max(this._minOutput, i)), + (t = this.toSeconds(t)), + this._events.add({ + type: o.TimelineSignal.Type.Target, + value: e, + time: t, + constant: i, + }), + this._param.setTargetAtTime(e, t, i), + this + ); + }), + (o.TimelineSignal.prototype.setValueCurveAtTime = function ( + e, + t, + i, + n, + ) { + n = this.defaultArg(n, 1); + for (var a = new Array(e.length), l = 0; l < a.length; l++) + a[l] = this._fromUnits(e[l]) * n; + (t = this.toSeconds(t)), + (i = this.toSeconds(i)), + this._events.add({ + type: o.TimelineSignal.Type.Curve, + value: a, + time: t, + duration: i, + }), + this._param.setValueAtTime(a[0], t); + for (var s = 1; s < a.length; s++) { + var r = t + (s / (a.length - 1)) * i; + this._param.linearRampToValueAtTime(a[s], r); + } + return this; + }), + (o.TimelineSignal.prototype.cancelScheduledValues = function (e) { + return ( + (e = this.toSeconds(e)), + this._events.cancel(e), + this._param.cancelScheduledValues(e), + this + ); + }), + (o.TimelineSignal.prototype.setRampPoint = function (e) { + e = this.toSeconds(e); + var t = this._toUnits(this.getValueAtTime(e)), + i = this._searchBefore(e); + if (i && i.time === e) + this.cancelScheduledValues(e + this.sampleTime); + else if ( + i && + i.type === o.TimelineSignal.Type.Curve && + i.time + i.duration > e + ) + this.cancelScheduledValues(e), this.linearRampToValueAtTime(t, e); + else { + var n = this._searchAfter(e); + n && + (this.cancelScheduledValues(e), + n.type === o.TimelineSignal.Type.Linear + ? this.linearRampToValueAtTime(t, e) + : n.type === o.TimelineSignal.Type.Exponential && + this.exponentialRampToValueAtTime(t, e)), + this.setValueAtTime(t, e); + } + return this; + }), + (o.TimelineSignal.prototype.linearRampToValueBetween = function ( + e, + t, + i, + ) { + return this.setRampPoint(t), this.linearRampToValueAtTime(e, i), this; + }), + (o.TimelineSignal.prototype.exponentialRampToValueBetween = function ( + e, + t, + i, + ) { + return ( + this.setRampPoint(t), this.exponentialRampToValueAtTime(e, i), this + ); + }), + (o.TimelineSignal.prototype._searchBefore = function (e) { + return this._events.get(e); + }), + (o.TimelineSignal.prototype._searchAfter = function (e) { + return this._events.getAfter(e); + }), + (o.TimelineSignal.prototype.getValueAtTime = function (e) { + e = this.toSeconds(e); + var t = this._searchAfter(e), + i = this._searchBefore(e), + n = this._initial; + if (null === i) n = this._initial; + else if (i.type === o.TimelineSignal.Type.Target) { + var a, + l = this._events.getBefore(i.time); + (a = null === l ? this._initial : l.value), + (n = this._exponentialApproach( + i.time, + a, + i.value, + i.constant, + e, + )); + } else + n = + i.type === o.TimelineSignal.Type.Curve + ? this._curveInterpolate(i.time, i.value, i.duration, e) + : null === t + ? i.value + : t.type === o.TimelineSignal.Type.Linear + ? this._linearInterpolate( + i.time, + i.value, + t.time, + t.value, + e, + ) + : t.type === o.TimelineSignal.Type.Exponential + ? this._exponentialInterpolate( + i.time, + i.value, + t.time, + t.value, + e, + ) + : i.value; + return n; + }), + (o.TimelineSignal.prototype.connect = o.SignalBase.prototype.connect), + (o.TimelineSignal.prototype._exponentialApproach = function ( + e, + t, + i, + n, + a, + ) { + return i + (t - i) * Math.exp(-(a - e) / n); + }), + (o.TimelineSignal.prototype._linearInterpolate = function ( + e, + t, + i, + n, + a, + ) { + return t + ((a - e) / (i - e)) * (n - t); + }), + (o.TimelineSignal.prototype._exponentialInterpolate = function ( + e, + t, + i, + n, + a, + ) { + return ( + (t = Math.max(this._minOutput, t)) * + Math.pow(n / t, (a - e) / (i - e)) + ); + }), + (o.TimelineSignal.prototype._curveInterpolate = function (e, t, i, n) { + var a = t.length; + if (e + i <= n) return t[a - 1]; + if (n <= e) return t[0]; + var l = (n - e) / i, + s = Math.floor((a - 1) * l), + r = Math.ceil((a - 1) * l), + o = t[s], + p = t[r]; + return r === s ? o : this._linearInterpolate(s, o, r, p, l * (a - 1)); + }), + (o.TimelineSignal.prototype.dispose = function () { + o.Signal.prototype.dispose.call(this), + o.Param.prototype.dispose.call(this), + this._events.dispose(), + (this._events = null); + }), + o.TimelineSignal + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(4), + __webpack_require__(1), + __webpack_require__(2), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + (i.Scale = function (t, e) { + (this._outputMin = this.defaultArg(t, 0)), + (this._outputMax = this.defaultArg(e, 1)), + (this._scale = this.input = new i.Multiply(1)), + (this._add = this.output = new i.Add(0)), + this._scale.connect(this._add), + this._setRange(); + }), + i.extend(i.Scale, i.SignalBase), + Object.defineProperty(i.Scale.prototype, "min", { + get: function () { + return this._outputMin; + }, + set: function (t) { + (this._outputMin = t), this._setRange(); + }, + }), + Object.defineProperty(i.Scale.prototype, "max", { + get: function () { + return this._outputMax; + }, + set: function (t) { + (this._outputMax = t), this._setRange(); + }, + }), + (i.Scale.prototype._setRange = function () { + (this._add.value = this._outputMin), + (this._scale.value = this._outputMax - this._outputMin); + }), + (i.Scale.prototype.dispose = function () { + return ( + i.prototype.dispose.call(this), + this._add.dispose(), + (this._add = null), + this._scale.dispose(), + (this._scale = null), + this + ); + }), + i.Scale + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(16), + __webpack_require__(30), + __webpack_require__(31), + __webpack_require__(12), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = 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 + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(18), + __webpack_require__(9), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + window.GainNode && + !AudioContext.prototype.createGain && + (AudioContext.prototype.createGain = + AudioContext.prototype.createGainNode), + (i.Gain = function () { + var t = this.optionsObject( + arguments, + ["gain", "units"], + i.Gain.defaults, + ); + (this.input = + this.output = + this._gainNode = + this.context.createGain()), + (this.gain = new i.Param({ + param: this._gainNode.gain, + units: t.units, + value: t.gain, + convert: t.convert, + })), + this._readOnly("gain"); + }), + i.extend(i.Gain), + (i.Gain.defaults = { gain: 1, convert: !0 }), + (i.Gain.prototype.dispose = function () { + i.Param.prototype.dispose.call(this), + this._gainNode.disconnect(), + (this._gainNode = null), + this._writable("gain"), + this.gain.dispose(), + (this.gain = null); + }), + (i.prototype.createInsOuts = function (t, n) { + 1 === t + ? (this.input = new i.Gain()) + : 1 < t && (this.input = new Array(t)), + 1 === n + ? (this.output = new i.Gain()) + : 1 < n && (this.output = new Array(t)); + }), + i.Gain + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(7), + __webpack_require__(39), + __webpack_require__(14), + __webpack_require__(12), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + "use strict"; + return ( + (o.Clock = function () { + o.Emitter.call(this); + var t = this.optionsObject( + arguments, + ["callback", "frequency"], + o.Clock.defaults, + ); + (this.callback = t.callback), + (this._nextTick = 0), + (this._lastState = o.State.Stopped), + (this.frequency = new o.TimelineSignal( + t.frequency, + o.Type.Frequency, + )), + this._readOnly("frequency"), + (this.ticks = 0), + (this._state = new o.TimelineState(o.State.Stopped)), + (this._boundLoop = this._loop.bind(this)), + this.context.on("tick", this._boundLoop); + }), + o.extend(o.Clock, o.Emitter), + (o.Clock.defaults = { + callback: o.noOp, + frequency: 1, + lookAhead: "auto", + }), + Object.defineProperty(o.Clock.prototype, "state", { + get: function () { + return this._state.getValueAtTime(this.now()); + }, + }), + (o.Clock.prototype.start = function (t, e) { + return ( + (t = this.toSeconds(t)), + this._state.getValueAtTime(t) !== o.State.Started && + this._state.add({ state: o.State.Started, time: t, offset: e }), + this + ); + }), + (o.Clock.prototype.stop = function (t) { + return ( + (t = this.toSeconds(t)), + this._state.cancel(t), + this._state.setStateAtTime(o.State.Stopped, t), + this + ); + }), + (o.Clock.prototype.pause = function (t) { + return ( + (t = this.toSeconds(t)), + this._state.getValueAtTime(t) === o.State.Started && + this._state.setStateAtTime(o.State.Paused, t), + this + ); + }), + (o.Clock.prototype._loop = function () { + for ( + var t = + this.now() + + this.context.lookAhead + + this.context.updateInterval + + 2 * this.context.lag; + t > this._nextTick && this._state; + + ) { + var e = this._state.getValueAtTime(this._nextTick); + if (e !== this._lastState) { + this._lastState = e; + var i = this._state.get(this._nextTick); + e === o.State.Started + ? ((this._nextTick = i.time), + this.isUndef(i.offset) || (this.ticks = i.offset), + this.emit("start", i.time, this.ticks)) + : e === o.State.Stopped + ? ((this.ticks = 0), this.emit("stop", i.time)) + : e === o.State.Paused && this.emit("pause", i.time); + } + var s = this._nextTick; + this.frequency && + ((this._nextTick += + 1 / this.frequency.getValueAtTime(this._nextTick)), + e === o.State.Started && (this.callback(s), this.ticks++)); + } + }), + (o.Clock.prototype.getStateAtTime = function (t) { + return (t = this.toSeconds(t)), this._state.getValueAtTime(t); + }), + (o.Clock.prototype.dispose = function () { + o.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); + }), + o.Clock + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(14), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + function t(e, t, n) { + if (e.input) + Array.isArray(e.input) + ? (o.prototype.isUndef(n) && (n = 0), this.connect(e.input[n])) + : this.connect(e.input, t, n); + else + try { + e instanceof AudioNode ? i.call(this, e, t, n) : i.call(this, e, t); + } catch (t) { + throw new Error("error connecting to node: " + e + "\n" + t); + } + } + var i, r; + return ( + !window.hasOwnProperty("AudioContext") && + window.hasOwnProperty("webkitAudioContext") && + (window.AudioContext = window.webkitAudioContext), + (o.Context = function (t) { + for (var e in (o.Emitter.call(this), + (t = t || new window.AudioContext()), + (this._context = t), + this._context)) + this._defineProperty(this._context, e); + (this._latencyHint = "interactive"), + (this._lookAhead = 0.1), + (this._updateInterval = this._lookAhead / 3), + (this._computedUpdateInterval = 0), + (this._worker = this._createWorker()), + (this._constants = {}); + }), + o.extend(o.Context, o.Emitter), + o.Emitter.mixin(o.Context), + (o.Context.prototype._defineProperty = function (e, n) { + this.isUndef(this[n]) && + Object.defineProperty(this, n, { + get: function () { + return "function" == typeof e[n] ? e[n].bind(e) : e[n]; + }, + set: function (t) { + e[n] = t; + }, + }); + }), + (o.Context.prototype.now = function () { + return this._context.currentTime; + }), + (o.Context.prototype._createWorker = function () { + window.URL = window.URL || window.webkitURL; + var t = new Blob([ + "var timeoutTime = " + + (1e3 * this._updateInterval).toFixed(1) + + ";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();", + ]), + e = URL.createObjectURL(t), + n = new Worker(e); + return ( + n.addEventListener( + "message", + function () { + this.emit("tick"); + }.bind(this), + ), + n.addEventListener( + "message", + function () { + var t = this.now(); + if (this.isNumber(this._lastUpdate)) { + var e = t - this._lastUpdate; + this._computedUpdateInterval = Math.max( + e, + 0.97 * this._computedUpdateInterval, + ); + } + this._lastUpdate = t; + }.bind(this), + ), + n + ); + }), + (o.Context.prototype.getConstant = function (t) { + if (this._constants[t]) return this._constants[t]; + for ( + var e = this._context.createBuffer( + 1, + 128, + this._context.sampleRate, + ), + n = e.getChannelData(0), + o = 0; + o < n.length; + o++ + ) + n[o] = t; + var i = this._context.createBufferSource(); + return ( + (i.channelCount = 1), + (i.channelCountMode = "explicit"), + (i.buffer = e), + (i.loop = !0), + i.start(0), + (this._constants[t] = i) + ); + }), + Object.defineProperty(o.Context.prototype, "lag", { + get: function () { + var t = this._computedUpdateInterval - this._updateInterval; + return (t = Math.max(t, 0)); + }, + }), + Object.defineProperty(o.Context.prototype, "lookAhead", { + get: function () { + return this._lookAhead; + }, + set: function (t) { + this._lookAhead = t; + }, + }), + Object.defineProperty(o.Context.prototype, "updateInterval", { + get: function () { + return this._updateInterval; + }, + set: function (t) { + (this._updateInterval = Math.max(t, o.prototype.blockTime)), + this._worker.postMessage(Math.max(1e3 * t, 1)); + }, + }), + Object.defineProperty(o.Context.prototype, "latencyHint", { + get: function () { + return this._latencyHint; + }, + set: function (t) { + var e = t; + if (((this._latencyHint = t), this.isString(t))) + switch (t) { + case "interactive": + (e = 0.1), (this._context.latencyHint = t); + break; + case "playback": + (e = 0.8), (this._context.latencyHint = t); + break; + case "balanced": + (e = 0.25), (this._context.latencyHint = t); + break; + case "fastest": + e = 0.01; + } + (this.lookAhead = e), (this.updateInterval = e / 3); + }, + }), + o.supported + ? ((i = AudioNode.prototype.connect), + (r = AudioNode.prototype.disconnect), + AudioNode.prototype.connect !== t && + ((AudioNode.prototype.connect = t), + (AudioNode.prototype.disconnect = function (e, t, n) { + if (e && e.input && Array.isArray(e.input)) + o.prototype.isUndef(n) && (n = 0), + this.disconnect(e.input[n], t, n); + else if (e && e.input) this.disconnect(e.input, t, n); + else + try { + r.apply(this, arguments); + } catch (t) { + throw new Error( + "error disconnecting node: " + e + "\n" + t, + ); + } + })), + (o.context = new o.Context())) + : console.warn("This browser does not support Tone.js"), + o.Context + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(4), + __webpack_require__(20), + __webpack_require__(2), + __webpack_require__(10), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { + "use strict"; + return ( + (n.Subtract = function (t) { + this.createInsOuts(2, 0), + (this._sum = this.input[0] = this.output = new n.Gain()), + (this._neg = new n.Negate()), + (this._param = this.input[1] = new n.Signal(t)), + this._param.chain(this._neg, this._sum); + }), + n.extend(n.Subtract, n.Signal), + (n.Subtract.prototype.dispose = function () { + return ( + n.prototype.dispose.call(this), + this._neg.dispose(), + (this._neg = null), + this._sum.disconnect(), + (this._sum = null), + this._param.dispose(), + (this._param = null), + this + ); + }), + n.Subtract + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + "use strict"; + return ( + (o.Emitter = function () { + this._events = {}; + }), + o.extend(o.Emitter), + (o.Emitter.prototype.on = function (t, e) { + for (var i = t.split(/\W+/), r = 0; r < i.length; r++) { + var n = i[r]; + this._events.hasOwnProperty(n) || (this._events[n] = []), + this._events[n].push(e); + } + return this; + }), + (o.Emitter.prototype.off = function (t, e) { + for (var i = t.split(/\W+/), r = 0; r < i.length; r++) + if (((t = i[r]), this._events.hasOwnProperty(t))) + if (o.prototype.isUndef(e)) this._events[t] = []; + else + for (var n = this._events[t], s = 0; s < n.length; s++) + n[s] === e && n.splice(s, 1); + return this; + }), + (o.Emitter.prototype.emit = function (t) { + if (this._events) { + var e = Array.apply(null, arguments).slice(1); + if (this._events.hasOwnProperty(t)) + for (var i = this._events[t], r = 0, n = i.length; r < n; r++) + i[r].apply(this, e); + } + return this; + }), + (o.Emitter.mixin = function (t) { + var e = ["on", "off", "emit"]; + t._events = {}; + for (var i = 0; i < e.length; i++) { + var r = e[i], + n = o.Emitter.prototype[r]; + t[r] = n; + } + }), + (o.Emitter.prototype.dispose = function () { + return o.prototype.dispose.call(this), (this._events = null), this; + }), + o.Emitter + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (c) { + "use strict"; + return ( + (c.SignalBase = function () {}), + c.extend(c.SignalBase), + (c.SignalBase.prototype.connect = function (e, n, a) { + return ( + (c.Signal && c.Signal === e.constructor) || + (c.Param && c.Param === e.constructor) || + (c.TimelineSignal && c.TimelineSignal === e.constructor) + ? (e._param.cancelScheduledValues(0), + (e._param.value = 0), + (e.overridden = !0)) + : e instanceof AudioParam && + (e.cancelScheduledValues(0), (e.value = 0)), + c.prototype.connect.call(this, e, n, a), + this + ); + }), + c.SignalBase + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(17), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + return ( + (o.Time = function (t, e) { + if (!(this instanceof o.Time)) return new o.Time(t, e); + (this._plusNow = !1), o.TimeBase.call(this, t, e); + }), + o.extend(o.Time, o.TimeBase), + (o.Time.prototype._unaryExpressions = Object.create( + o.TimeBase.prototype._unaryExpressions, + )), + (o.Time.prototype._unaryExpressions.quantize = { + regexp: /^@/, + method: function (t) { + return o.Transport.nextSubdivision(t()); + }, + }), + (o.Time.prototype._unaryExpressions.now = { + regexp: /^\+/, + method: function (t) { + return (this._plusNow = !0), t(); + }, + }), + (o.Time.prototype.quantize = function (t, e) { + return ( + (e = this.defaultArg(e, 1)), + (this._expr = function (t, e, o) { + return ( + (t = t()), + (e = e.toSeconds()), + t + (Math.round(t / e) * e - t) * o + ); + }.bind(this, this._expr, new this.constructor(t), e)), + this + ); + }), + (o.Time.prototype.addNow = function () { + return (this._plusNow = !0), this; + }), + (o.Time.prototype._defaultExpr = function () { + return (this._plusNow = !0), this._noOp; + }), + (o.Time.prototype.copy = function (t) { + return ( + o.TimeBase.prototype.copy.call(this, t), + (this._plusNow = t._plusNow), + this + ); + }), + (o.Time.prototype.toNotation = function () { + var t = this.toSeconds(), + e = this._toNotationHelper(t, [ + "1m", + "2n", + "4n", + "8n", + "16n", + "32n", + "64n", + "128n", + ]), + o = this._toNotationHelper(t, [ + "1m", + "2n", + "2t", + "4n", + "4t", + "8n", + "8t", + "16n", + "16t", + "32n", + "32t", + "64n", + "64t", + "128n", + ]); + return o.split("+").length < e.split("+").length ? o : e; + }), + (o.Time.prototype._toNotationHelper = function (t, e) { + for ( + var o = this._notationToUnits(e[e.length - 1]), n = "", i = 0; + i < e.length; + i++ + ) { + var r = this._notationToUnits(e[i]), + s = t / r; + if ((1 - (s % 1) < 1e-6 && (s += 1e-6), 0 < (s = Math.floor(s)))) { + if ( + ((n += 1 === s ? e[i] : s.toString() + "*" + e[i]), + (t -= s * r) < o) + ) + break; + n += " + "; + } + } + return "" === n && (n = "0"), n; + }), + (o.Time.prototype._notationToUnits = function (t) { + for ( + var e = this._primaryExpressions, o = [e.n, e.t, e.m], n = 0; + n < o.length; + n++ + ) { + var i = o[n], + r = t.match(i.regexp); + if (r) return i.method.call(this, r[1]); + } + }), + (o.Time.prototype.toBarsBeatsSixteenths = function () { + var t = this._beatsToUnits(1), + e = this.toSeconds() / t, + o = Math.floor(e / this._timeSignature()), + n = (e % 1) * 4; + return ( + (e = Math.floor(e) % this._timeSignature()), + 3 < (n = n.toString()).length && (n = parseFloat(n).toFixed(3)), + [o, e, n].join(":") + ); + }), + (o.Time.prototype.toTicks = function () { + var t = this._beatsToUnits(1), + e = this.valueOf() / t; + return Math.floor(e * o.Transport.PPQ); + }), + (o.Time.prototype.toSamples = function () { + return this.toSeconds() * this.context.sampleRate; + }), + (o.Time.prototype.toFrequency = function () { + return 1 / this.toSeconds(); + }), + (o.Time.prototype.toSeconds = function () { + return this.valueOf(); + }), + (o.Time.prototype.toMilliseconds = function () { + return 1e3 * this.toSeconds(); + }), + (o.Time.prototype.valueOf = function () { + return this._expr() + (this._plusNow ? this.now() : 0); + }), + o.Time + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { + return ( + (n.TimeBase = function (e, t) { + if (!(this instanceof n.TimeBase)) return new n.TimeBase(e, t); + if (((this._expr = this._noOp), e instanceof n.TimeBase)) + this.copy(e); + else if (!this.isUndef(t) || this.isNumber(e)) { + t = this.defaultArg(t, this._defaultUnits); + var r = this._primaryExpressions[t].method; + this._expr = r.bind(this, e); + } else + this.isString(e) + ? this.set(e) + : this.isUndef(e) && (this._expr = this._defaultExpr()); + }), + n.extend(n.TimeBase), + (n.TimeBase.prototype.set = function (e) { + return (this._expr = this._parseExprString(e)), this; + }), + (n.TimeBase.prototype.clone = function () { + var e = new this.constructor(); + return e.copy(this), e; + }), + (n.TimeBase.prototype.copy = function (e) { + var t = e._expr(); + return this.set(t); + }), + (n.TimeBase.prototype._primaryExpressions = { + n: { + regexp: /^(\d+)n/i, + method: function (e) { + return 1 === (e = parseInt(e)) + ? this._beatsToUnits(this._timeSignature()) + : this._beatsToUnits(4 / e); + }, + }, + t: { + regexp: /^(\d+)t/i, + method: function (e) { + return ( + (e = parseInt(e)), this._beatsToUnits(8 / (3 * parseInt(e))) + ); + }, + }, + m: { + regexp: /^(\d+)m/i, + method: function (e) { + return this._beatsToUnits(parseInt(e) * this._timeSignature()); + }, + }, + i: { + regexp: /^(\d+)i/i, + method: function (e) { + return this._ticksToUnits(parseInt(e)); + }, + }, + hz: { + regexp: /^(\d+(?:\.\d+)?)hz/i, + method: function (e) { + return this._frequencyToUnits(parseFloat(e)); + }, + }, + tr: { + regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, + method: function (e, t, r) { + var n = 0; + return ( + e && + "0" !== e && + (n += this._beatsToUnits( + this._timeSignature() * parseFloat(e), + )), + t && "0" !== t && (n += this._beatsToUnits(parseFloat(t))), + r && "0" !== r && (n += this._beatsToUnits(parseFloat(r) / 4)), + n + ); + }, + }, + s: { + regexp: /^(\d+(?:\.\d+)?s)/, + method: function (e) { + return this._secondsToUnits(parseFloat(e)); + }, + }, + samples: { + regexp: /^(\d+)samples/, + method: function (e) { + return parseInt(e) / this.context.sampleRate; + }, + }, + default: { + regexp: /^(\d+(?:\.\d+)?)/, + method: function (e) { + return this._primaryExpressions[this._defaultUnits].method.call( + this, + e, + ); + }, + }, + }), + (n.TimeBase.prototype._binaryExpressions = { + "+": { + regexp: /^\+/, + precedence: 2, + method: function (e, t) { + return e() + t(); + }, + }, + "-": { + regexp: /^\-/, + precedence: 2, + method: function (e, t) { + return e() - t(); + }, + }, + "*": { + regexp: /^\*/, + precedence: 1, + method: function (e, t) { + return e() * t(); + }, + }, + "/": { + regexp: /^\//, + precedence: 1, + method: function (e, t) { + return e() / t(); + }, + }, + }), + (n.TimeBase.prototype._unaryExpressions = { + neg: { + regexp: /^\-/, + method: function (e) { + return -e(); + }, + }, + }), + (n.TimeBase.prototype._syntaxGlue = { + "(": { regexp: /^\(/ }, + ")": { regexp: /^\)/ }, + }), + (n.TimeBase.prototype._tokenize = function (e) { + for (var t = -1, r = []; 0 < e.length; ) { + var n = i((e = e.trim()), this); + r.push(n), (e = e.substr(n.value.length)); + } + function i(e, t) { + for ( + var r = [ + "_binaryExpressions", + "_unaryExpressions", + "_primaryExpressions", + "_syntaxGlue", + ], + n = 0; + n < r.length; + n++ + ) { + var i = t[r[n]]; + for (var s in i) { + var o = i[s], + p = o.regexp, + a = e.match(p); + if (null !== a) + return { + method: o.method, + precedence: o.precedence, + regexp: o.regexp, + value: a[0], + }; + } + } + throw new SyntaxError("Tone.TimeBase: Unexpected token " + e); + } + return { + next: function () { + return r[++t]; + }, + peek: function () { + return r[t + 1]; + }, + }; + }), + (n.TimeBase.prototype._matchGroup = function (e, t, r) { + if (!this.isUndef(e)) + for (var n in t) { + var i = t[n]; + if (i.regexp.test(e.value)) { + if (this.isUndef(r)) return i; + if (i.precedence === r) return i; + } + } + return !1; + }), + (n.TimeBase.prototype._parseBinary = function (e, t) { + var r; + this.isUndef(t) && (t = 2), + (r = t < 0 ? this._parseUnary(e) : this._parseBinary(e, t - 1)); + for ( + var n = e.peek(); + n && this._matchGroup(n, this._binaryExpressions, t); + + ) + (r = (n = e.next()).method.bind( + this, + r, + this._parseBinary(e, t - 1), + )), + (n = e.peek()); + return r; + }), + (n.TimeBase.prototype._parseUnary = function (e) { + var t, r; + t = e.peek(); + var n = this._matchGroup(t, this._unaryExpressions); + return n + ? ((t = e.next()), + (r = this._parseUnary(e)), + n.method.bind(this, r)) + : this._parsePrimary(e); + }), + (n.TimeBase.prototype._parsePrimary = function (e) { + var t, r; + if (((t = e.peek()), this.isUndef(t))) + throw new SyntaxError( + "Tone.TimeBase: Unexpected end of expression", + ); + if (this._matchGroup(t, this._primaryExpressions)) { + var n = (t = e.next()).value.match(t.regexp); + return t.method.bind(this, n[1], n[2], n[3]); + } + if (t && "(" === t.value) { + if ( + (e.next(), + (r = this._parseBinary(e)), + !(t = e.next()) || ")" !== t.value) + ) + throw new SyntaxError("Expected )"); + return r; + } + throw new SyntaxError( + "Tone.TimeBase: Cannot process token " + t.value, + ); + }), + (n.TimeBase.prototype._parseExprString = function (e) { + this.isString(e) || (e = e.toString()); + var t = this._tokenize(e); + return this._parseBinary(t); + }), + (n.TimeBase.prototype._noOp = function () { + return 0; + }), + (n.TimeBase.prototype._defaultExpr = function () { + return this._noOp; + }), + (n.TimeBase.prototype._defaultUnits = "s"), + (n.TimeBase.prototype._frequencyToUnits = function (e) { + return 1 / e; + }), + (n.TimeBase.prototype._beatsToUnits = function (e) { + return (60 / n.Transport.bpm.value) * e; + }), + (n.TimeBase.prototype._secondsToUnits = function (e) { + return e; + }), + (n.TimeBase.prototype._ticksToUnits = function (e) { + return e * (this._beatsToUnits(1) / n.Transport.PPQ); + }), + (n.TimeBase.prototype._timeSignature = function () { + return n.Transport.timeSignature; + }), + (n.TimeBase.prototype._pushExpr = function (e, t, r) { + return ( + e instanceof n.TimeBase || (e = new this.constructor(e, r)), + (this._expr = this._binaryExpressions[t].method.bind( + this, + this._expr, + e._expr, + )), + this + ); + }), + (n.TimeBase.prototype.add = function (e, t) { + return this._pushExpr(e, "+", t); + }), + (n.TimeBase.prototype.sub = function (e, t) { + return this._pushExpr(e, "-", t); + }), + (n.TimeBase.prototype.mult = function (e, t) { + return this._pushExpr(e, "*", t); + }), + (n.TimeBase.prototype.div = function (e, t) { + return this._pushExpr(e, "/", t); + }), + (n.TimeBase.prototype.valueOf = function () { + return this._expr(); + }), + (n.TimeBase.prototype.dispose = function () { + this._expr = null; + }), + n.TimeBase + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(9), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (a) { + "use strict"; + return ( + (a.Param = function () { + var t = this.optionsObject( + arguments, + ["param", "units", "convert"], + a.Param.defaults, + ); + (this._param = this.input = t.param), + (this.units = t.units), + (this.convert = t.convert), + (this.overridden = !1), + (this._lfo = null), + this.isObject(t.lfo) + ? (this.value = t.lfo) + : this.isUndef(t.value) || (this.value = t.value); + }), + a.extend(a.Param), + (a.Param.defaults = { + units: a.Type.Default, + convert: !0, + param: void 0, + }), + Object.defineProperty(a.Param.prototype, "value", { + get: function () { + return this._toUnits(this._param.value); + }, + set: function (t) { + if (this.isObject(t)) { + if (this.isUndef(a.LFO)) + throw new Error( + "Include 'Tone.LFO' to use an LFO as a Param value.", + ); + this._lfo && this._lfo.dispose(), + (this._lfo = new a.LFO(t).start()), + this._lfo.connect(this.input); + } else { + var e = this._fromUnits(t); + this._param.cancelScheduledValues(0), (this._param.value = e); + } + }, + }), + (a.Param.prototype._fromUnits = function (t) { + if (!this.convert && !this.isUndef(this.convert)) return t; + switch (this.units) { + case a.Type.Time: + return this.toSeconds(t); + case a.Type.Frequency: + return this.toFrequency(t); + case a.Type.Decibels: + return this.dbToGain(t); + case a.Type.NormalRange: + return Math.min(Math.max(t, 0), 1); + case a.Type.AudioRange: + return Math.min(Math.max(t, -1), 1); + case a.Type.Positive: + return Math.max(t, 0); + default: + return t; + } + }), + (a.Param.prototype._toUnits = function (t) { + if (!this.convert && !this.isUndef(this.convert)) return t; + switch (this.units) { + case a.Type.Decibels: + return this.gainToDb(t); + default: + return t; + } + }), + (a.Param.prototype._minOutput = 1e-5), + (a.Param.prototype.setValueAtTime = function (t, e) { + return ( + (t = this._fromUnits(t)), + (e = this.toSeconds(e)) <= this.now() + this.blockTime + ? (this._param.value = t) + : this._param.setValueAtTime(t, e), + this + ); + }), + (a.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 + ); + }), + (a.Param.prototype.linearRampToValueAtTime = function (t, e) { + return ( + (t = this._fromUnits(t)), + this._param.linearRampToValueAtTime(t, this.toSeconds(e)), + this + ); + }), + (a.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 + ); + }), + (a.Param.prototype.exponentialRampToValue = function (t, e, i) { + return ( + (i = this.toSeconds(i)), + this.setRampPoint(i), + this.exponentialRampToValueAtTime(t, i + this.toSeconds(e)), + this + ); + }), + (a.Param.prototype.linearRampToValue = function (t, e, i) { + return ( + (i = this.toSeconds(i)), + this.setRampPoint(i), + this.linearRampToValueAtTime(t, i + this.toSeconds(e)), + this + ); + }), + (a.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 + ); + }), + (a.Param.prototype.setValueCurveAtTime = function (t, e, i) { + for (var a = 0; a < t.length; a++) t[a] = this._fromUnits(t[a]); + return ( + this._param.setValueCurveAtTime( + t, + this.toSeconds(e), + this.toSeconds(i), + ), + this + ); + }), + (a.Param.prototype.cancelScheduledValues = function (t) { + return this._param.cancelScheduledValues(this.toSeconds(t)), this; + }), + (a.Param.prototype.rampTo = function (t, e, i) { + return ( + (e = this.defaultArg(e, 0)), + this.units === a.Type.Frequency || + this.units === a.Type.BPM || + this.units === a.Type.Decibels + ? this.exponentialRampToValue(t, e, i) + : this.linearRampToValue(t, e, i), + this + ); + }), + Object.defineProperty(a.Param.prototype, "lfo", { + get: function () { + return this._lfo; + }, + }), + (a.Param.prototype.dispose = function () { + return ( + a.prototype.dispose.call(this), + (this._param = null), + this._lfo && (this._lfo.dispose(), (this._lfo = null)), + this + ); + }), + a.Param + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(9), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + (i.Timeline = function () { + var e = this.optionsObject( + arguments, + ["memory"], + i.Timeline.defaults, + ); + (this._timeline = []), + (this._toRemove = []), + (this._iterating = !1), + (this.memory = e.memory); + }), + i.extend(i.Timeline), + (i.Timeline.defaults = { memory: 1 / 0 }), + Object.defineProperty(i.Timeline.prototype, "length", { + get: function () { + return this._timeline.length; + }, + }), + (i.Timeline.prototype.add = function (e) { + if (this.isUndef(e.time)) + throw new Error("Tone.Timeline: events must have a time attribute"); + if (this._timeline.length) { + var i = this._search(e.time); + this._timeline.splice(i + 1, 0, e); + } else this._timeline.push(e); + if (this.length > this.memory) { + var t = this.length - this.memory; + this._timeline.splice(0, t); + } + return this; + }), + (i.Timeline.prototype.remove = function (e) { + if (this._iterating) this._toRemove.push(e); + else { + var i = this._timeline.indexOf(e); + -1 !== i && this._timeline.splice(i, 1); + } + return this; + }), + (i.Timeline.prototype.get = function (e) { + var i = this._search(e); + return -1 !== i ? this._timeline[i] : null; + }), + (i.Timeline.prototype.peek = function () { + return this._timeline[0]; + }), + (i.Timeline.prototype.shift = function () { + return this._timeline.shift(); + }), + (i.Timeline.prototype.getAfter = function (e) { + var i = this._search(e); + return i + 1 < this._timeline.length ? this._timeline[i + 1] : null; + }), + (i.Timeline.prototype.getBefore = function (e) { + var i = this._timeline.length; + if (0 < i && this._timeline[i - 1].time < e) + return this._timeline[i - 1]; + var t = this._search(e); + return 0 <= t - 1 ? this._timeline[t - 1] : null; + }), + (i.Timeline.prototype.cancel = function (e) { + if (1 < this._timeline.length) { + var i = this._search(e); + if (0 <= i) + if (this._timeline[i].time === e) { + for (var t = i; 0 <= t && this._timeline[t].time === e; t--) + i = t; + this._timeline = this._timeline.slice(0, i); + } else this._timeline = this._timeline.slice(0, i + 1); + else this._timeline = []; + } else + 1 === this._timeline.length && + this._timeline[0].time >= e && + (this._timeline = []); + return this; + }), + (i.Timeline.prototype.cancelBefore = function (e) { + if (this._timeline.length) { + var i = this._search(e); + 0 <= i && (this._timeline = this._timeline.slice(i + 1)); + } + return this; + }), + (i.Timeline.prototype._search = function (e) { + var i = 0, + t = this._timeline.length, + n = t; + if (0 < t && this._timeline[t - 1].time <= e) return t - 1; + for (; i < n; ) { + var r = Math.floor(i + (n - i) / 2), + s = this._timeline[r], + h = this._timeline[r + 1]; + if (s.time === e) { + for (var l = r; l < this._timeline.length; l++) { + this._timeline[l].time === e && (r = l); + } + return r; + } + if (s.time < e && h.time > e) return r; + s.time > e ? (n = r) : s.time < e && (i = r + 1); + } + return -1; + }), + (i.Timeline.prototype._iterate = function (e, i, t) { + (this._iterating = !0), + (i = this.defaultArg(i, 0)), + (t = this.defaultArg(t, this._timeline.length - 1)); + for (var n = i; n <= t; n++) e(this._timeline[n]); + if (((this._iterating = !1), 0 < this._toRemove.length)) { + for (var r = 0; r < this._toRemove.length; r++) { + var s = this._timeline.indexOf(this._toRemove[r]); + -1 !== s && this._timeline.splice(s, 1); + } + this._toRemove = []; + } + }), + (i.Timeline.prototype.forEach = function (e) { + return this._iterate(e), this; + }), + (i.Timeline.prototype.forEachBefore = function (e, i) { + var t = this._search(e); + return -1 !== t && this._iterate(i, 0, t), this; + }), + (i.Timeline.prototype.forEachAfter = function (e, i) { + var t = this._search(e); + return this._iterate(i, t + 1), this; + }), + (i.Timeline.prototype.forEachFrom = function (e, i) { + for (var t = this._search(e); 0 <= t && this._timeline[t].time >= e; ) + t--; + return this._iterate(i, t + 1), this; + }), + (i.Timeline.prototype.forEachAtTime = function (i, t) { + var e = this._search(i); + return ( + -1 !== e && + this._iterate( + function (e) { + e.time === i && t(e); + }, + 0, + e, + ), + this + ); + }), + (i.Timeline.prototype.dispose = function () { + i.prototype.dispose.call(this), + (this._timeline = null), + (this._toRemove = null); + }), + i.Timeline + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(1), + __webpack_require__(2), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (t) { + "use strict"; + return ( + (t.Negate = function () { + this._multiply = this.input = this.output = new t.Multiply(-1); + }), + t.extend(t.Negate, t.SignalBase), + (t.Negate.prototype.dispose = function () { + return ( + t.prototype.dispose.call(this), + this._multiply.dispose(), + (this._multiply = null), + this + ); + }), + t.Negate + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(2), + __webpack_require__(1), + __webpack_require__(6), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { + "use strict"; + return ( + (e.GreaterThanZero = function () { + (this._thresh = this.output = + new e.WaveShaper(function (e) { + return e <= 0 ? 0 : 1; + }, 127)), + (this._scale = this.input = new e.Multiply(1e4)), + this._scale.connect(this._thresh); + }), + e.extend(e.GreaterThanZero, e.SignalBase), + (e.GreaterThanZero.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._scale.dispose(), + (this._scale = null), + this._thresh.dispose(), + (this._thresh = null), + this + ); + }), + e.GreaterThanZero + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_FACTORY__, + __WEBPACK_AMD_DEFINE_ARRAY__, + __WEBPACK_AMD_DEFINE_RESULT__; + !(function (e, t) { + true + ? !((__WEBPACK_AMD_DEFINE_ARRAY__ = []), + (__WEBPACK_AMD_DEFINE_FACTORY__ = t), + (__WEBPACK_AMD_DEFINE_RESULT__ = + typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" + ? __WEBPACK_AMD_DEFINE_FACTORY__.apply( + exports, + __WEBPACK_AMD_DEFINE_ARRAY__, + ) + : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) + : undefined; + })(this, function () { + var r = function (e, t) { + (this._dragged = !1), + (this._element = e), + (this._bindedMove = this._moved.bind(this)), + (this._bindedEnd = this._ended.bind(this, t)), + e.addEventListener("touchstart", this._bindedEnd), + e.addEventListener("touchmove", this._bindedMove), + e.addEventListener("touchend", this._bindedEnd), + e.addEventListener("mouseup", this._bindedEnd); + }; + function o(e) { + return "running" === e.state; + } + return ( + (r.prototype._moved = function (e) { + this._dragged = !0; + }), + (r.prototype._ended = function (e) { + this._dragged || + (function (e) { + var t = e.createBuffer(1, 1, e.sampleRate), + n = e.createBufferSource(); + (n.buffer = t), + n.connect(e.destination), + n.start(0), + e.resume && e.resume(); + })(e), + (this._dragged = !1); + }), + (r.prototype.dispose = function () { + this._element.removeEventListener("touchstart", this._bindedEnd), + this._element.removeEventListener("touchmove", this._bindedMove), + this._element.removeEventListener("touchend", this._bindedEnd), + this._element.removeEventListener("mouseup", this._bindedEnd), + (this._bindedMove = null), + (this._bindedEnd = null), + (this._element = null); + }), + function (t, e, n) { + var i = new Promise(function (e) { + !(function (t, n) { + o(t) + ? n() + : (function e() { + o(t) + ? n() + : (requestAnimationFrame(e), t.resume && t.resume()); + })(); + })(t, e); + }), + d = []; + return ( + (function e(t, n, i) { + if (Array.isArray(t) || (NodeList && t instanceof NodeList)) + for (var d = 0; d < t.length; d++) e(t[d], n, i); + else if ("string" == typeof t) + e(document.querySelectorAll(t), n, i); + else if (t.jquery && "function" == typeof t.toArray) + e(t.toArray(), n, i); + else if (Element && t instanceof Element) { + var o = new r(t, i); + n.push(o); + } + })((e = e || document.body), d, t), + i.then(function () { + for (var e = 0; e < d.length; e++) d[e].dispose(); + (d = null), n && n(); + }), + i + ); + } + ); + }); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(2), + __webpack_require__(32), + __webpack_require__(38), + __webpack_require__(10), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + (i.CrossFade = function (e) { + this.createInsOuts(2, 1), + (this.a = this.input[0] = new i.Gain()), + (this.b = this.input[1] = new i.Gain()), + (this.fade = new i.Signal( + this.defaultArg(e, 0.5), + i.Type.NormalRange, + )), + (this._equalPowerA = new i.EqualPowerGain()), + (this._equalPowerB = new i.EqualPowerGain()), + (this._invert = new i.Expr("1 - $0")), + this.a.connect(this.output), + this.b.connect(this.output), + this.fade.chain(this._equalPowerB, this.b.gain), + this.fade.chain(this._invert, this._equalPowerA, this.a.gain), + this._readOnly("fade"); + }), + i.extend(i.CrossFade), + (i.CrossFade.prototype.dispose = function () { + return ( + i.prototype.dispose.call(this), + this._writable("fade"), + this._equalPowerA.dispose(), + (this._equalPowerA = null), + this._equalPowerB.dispose(), + (this._equalPowerB = null), + this.fade.dispose(), + (this.fade = null), + this._invert.dispose(), + (this._invert = null), + this.a.dispose(), + (this.a = null), + this.b.dispose(), + (this.b = null), + this + ); + }), + i.CrossFade + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports) { + !(function () { + var l, + s = []; + function p(e) { + var o = this, + n = {}, + i = -1; + this.parameters.forEach(function (e, t) { + var r = s[++i] || (s[i] = new Float32Array(o.bufferSize)); + r.fill(e.value), (n[t] = r); + }), + this.processor.realm.exec( + "self.sampleRate=sampleRate=" + + this.context.sampleRate + + ";self.currentTime=currentTime=" + + this.context.currentTime, + ); + var t = a(e.inputBuffer), + r = a(e.outputBuffer); + this.instance.process([t], [r], n); + } + function a(e) { + for (var t = [], r = 0; r < e.numberOfChannels; r++) + t[r] = e.getChannelData(r); + return t; + } + function f(e) { + return e.$$processors || (e.$$processors = {}); + } + function e(e) { + this.$$context = e; + } + "function" != typeof AudioWorkletNode && + ((self.AudioWorkletNode = function (e, t, r) { + var o = f(e)[t], + n = e.createScriptProcessor( + void 0, + 2, + r && r.outputChannelCount ? r.outputChannelCount[0] : 2, + ); + if (((n.parameters = new Map()), o.properties)) + for (var i = 0; i < o.properties.length; i++) { + var s = o.properties[i], + a = e.createGain().gain; + (a.value = s.defaultValue), n.parameters.set(s.name, a); + } + var u = new MessageChannel(); + l = u.port2; + var c = new o.Processor(r || {}); + return ( + (l = null), + (n.port = u.port1), + (n.processor = o), + (n.instance = c), + (n.onaudioprocess = p), + n + ); + }), + Object.defineProperty( + (self.AudioContext || self.webkitAudioContext).prototype, + "audioWorklet", + { + get: function () { + return ( + this.$$audioWorklet || + (this.$$audioWorklet = new self.AudioWorklet(this)) + ); + }, + }, + ), + (self.AudioWorklet = + ((e.prototype.addModule = function (e, t) { + var n = this; + return fetch(e) + .then(function (e) { + if (!e.ok) throw Error(e.status); + return e.text(); + }) + .then(function (e) { + var r = { + sampleRate: 0, + currentTime: 0, + AudioWorkletProcessor: function () { + this.port = l; + }, + registerProcessor: function (e, t) { + f(n.$$context)[e] = { + realm: o, + context: r, + Processor: t, + properties: t.parameterDescriptors || [], + }; + }, + }, + o = new (function (e, t) { + var r = document.createElement("iframe"); + (r.style.cssText = + "position:absolute;left:0;top:-999px;width:1px;height:1px;"), + t.appendChild(r); + var o = r.contentWindow, + n = o.document, + i = "var window,$hook"; + for (var s in o) + s in e || "eval" === s || ((i += ","), (i += s)); + for (var a in e) + (i += ","), (i += a), (i += "=self."), (i += a); + var u = n.createElement("script"); + u.appendChild( + n.createTextNode( + 'function $hook(self,console) {"use strict";\n ' + + i + + ";return function() {return eval(arguments[0])}}", + ), + ), + n.body.appendChild(u), + (this.exec = o.$hook(e, console)); + })((r.self = r), document.documentElement); + return o.exec(((t && t.transpile) || String)(e)), null; + }); + }), + e))); + })(); + }, + function (module, exports) { + /** + * This module has shims + */ + + (function () { + function fixSetTarget(param) { + if (!param) return; + if (!param.setTargetAtTime) + param.setTargetAtTime = param.setTargetValueAtTime; + } + + if ( + window.hasOwnProperty("webkitAudioContext") && + !window.hasOwnProperty("AudioContext") + ) { + window.AudioContext = window.webkitAudioContext; + if (typeof AudioContext.prototype.createGain !== "function") + AudioContext.prototype.createGain = + AudioContext.prototype.createGainNode; + if (typeof AudioContext.prototype.createDelay !== "function") + AudioContext.prototype.createDelay = + AudioContext.prototype.createDelayNode; + if (typeof AudioContext.prototype.createScriptProcessor !== "function") + AudioContext.prototype.createScriptProcessor = + AudioContext.prototype.createJavaScriptNode; + if (typeof AudioContext.prototype.createPeriodicWave !== "function") + AudioContext.prototype.createPeriodicWave = + AudioContext.prototype.createWaveTable; + AudioContext.prototype.internal_createGain = + AudioContext.prototype.createGain; + + AudioContext.prototype.createGain = function () { + var node = this.internal_createGain(); + fixSetTarget(node.gain); + return node; + }; + + AudioContext.prototype.internal_createDelay = + AudioContext.prototype.createDelay; + + AudioContext.prototype.createDelay = function (maxDelayTime) { + var node = maxDelayTime + ? this.internal_createDelay(maxDelayTime) + : this.internal_createDelay(); + fixSetTarget(node.delayTime); + return node; + }; + + AudioContext.prototype.internal_createBufferSource = + AudioContext.prototype.createBufferSource; + + AudioContext.prototype.createBufferSource = function () { + var node = this.internal_createBufferSource(); + + if (!node.start) { + node.start = function (when, offset, duration) { + if (offset || duration) + this.noteGrainOn(when || 0, offset, duration); + else this.noteOn(when || 0); + }; + } else { + node.internal_start = node.start; + + node.start = function (when, offset, duration) { + if (typeof duration !== "undefined") + node.internal_start(when || 0, offset, duration); + else node.internal_start(when || 0, offset || 0); + }; + } + + if (!node.stop) { + node.stop = function (when) { + this.noteOff(when || 0); + }; + } else { + node.internal_stop = node.stop; + + node.stop = function (when) { + node.internal_stop(when || 0); + }; + } + + fixSetTarget(node.playbackRate); + return node; + }; + + AudioContext.prototype.internal_createDynamicsCompressor = + AudioContext.prototype.createDynamicsCompressor; + + AudioContext.prototype.createDynamicsCompressor = function () { + var node = this.internal_createDynamicsCompressor(); + fixSetTarget(node.threshold); + fixSetTarget(node.knee); + fixSetTarget(node.ratio); + fixSetTarget(node.reduction); + fixSetTarget(node.attack); + fixSetTarget(node.release); + return node; + }; + + AudioContext.prototype.internal_createBiquadFilter = + AudioContext.prototype.createBiquadFilter; + + AudioContext.prototype.createBiquadFilter = function () { + var node = this.internal_createBiquadFilter(); + fixSetTarget(node.frequency); + fixSetTarget(node.detune); + fixSetTarget(node.Q); + fixSetTarget(node.gain); + return node; + }; + + if (typeof AudioContext.prototype.createOscillator !== "function") { + AudioContext.prototype.internal_createOscillator = + AudioContext.prototype.createOscillator; + + AudioContext.prototype.createOscillator = function () { + var node = this.internal_createOscillator(); + + if (!node.start) { + node.start = function (when) { + this.noteOn(when || 0); + }; + } else { + node.internal_start = node.start; + + node.start = function (when) { + node.internal_start(when || 0); + }; + } + + if (!node.stop) { + node.stop = function (when) { + this.noteOff(when || 0); + }; + } else { + node.internal_stop = node.stop; + + node.stop = function (when) { + node.internal_stop(when || 0); + }; + } + + if (!node.setPeriodicWave) node.setPeriodicWave = node.setWaveTable; + fixSetTarget(node.frequency); + fixSetTarget(node.detune); + return node; + }; + } + } + + if ( + window.hasOwnProperty("webkitOfflineAudioContext") && + !window.hasOwnProperty("OfflineAudioContext") + ) { + window.OfflineAudioContext = window.webkitOfflineAudioContext; + } + })(window); + + navigator.getUserMedia = + navigator.getUserMedia || + navigator.webkitGetUserMedia || + navigator.mozGetUserMedia || + navigator.msGetUserMedia; + /** + * Determine which filetypes are supported (inspired by buzz.js) + * The audio element (el) will only be used to test browser support for various audio formats + */ + + var el = document.createElement("audio"); + + p5.prototype.isSupported = function () { + return !!el.canPlayType; + }; + + var isOGGSupported = function isOGGSupported() { + return !!el.canPlayType && el.canPlayType('audio/ogg; codecs="vorbis"'); + }; + + var isMP3Supported = function isMP3Supported() { + return !!el.canPlayType && el.canPlayType("audio/mpeg;"); + }; + + var isWAVSupported = function isWAVSupported() { + return !!el.canPlayType && el.canPlayType('audio/wav; codecs="1"'); + }; + + var isAACSupported = function isAACSupported() { + return ( + !!el.canPlayType && + (el.canPlayType("audio/x-m4a;") || el.canPlayType("audio/aac;")) + ); + }; + + var isAIFSupported = function isAIFSupported() { + return !!el.canPlayType && el.canPlayType("audio/x-aiff;"); + }; + + p5.prototype.isFileSupported = function (extension) { + switch (extension.toLowerCase()) { + case "mp3": + return isMP3Supported(); + + case "wav": + return isWAVSupported(); + + case "ogg": + return isOGGSupported(); + + case "aac": + case "m4a": + case "mp4": + return isAACSupported(); + + case "aif": + case "aiff": + return isAIFSupported(); + + default: + return false; + } + }; + }, + function (module, exports) { + var g; + g = (function () { + return this; + })(); + try { + g = g || new Function("return this")(); + } catch (t) { + "object" == typeof window && (g = window); + } + module.exports = g; + }, + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + __webpack_require__.r(__webpack_exports__); + __webpack_exports__["default"] = + 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'start\') {\n _this.record(data.duration);\n } else if (data.name === \'stop\') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: "process",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: "record",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: "stop",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: \'buffers\',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: "getBuffers",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: "mergeBuffers",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: "clear",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);'; + }, + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + __webpack_require__.r(__webpack_exports__); + __webpack_exports__["default"] = + 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: "process",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: \'position\',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);'; + }, + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + __webpack_require__.r(__webpack_exports__); + __webpack_exports__["default"] = + 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'toggleNormalize\') {\n _this.normalize = data.normalize;\n } else if (data.name === \'smoothing\') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: "process",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: \'amplitude\',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);'; + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(17), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + (o.Frequency = function (e, t) { + if (!(this instanceof o.Frequency)) return new o.Frequency(e, t); + o.TimeBase.call(this, e, t); + }), + o.extend(o.Frequency, o.TimeBase), + (o.Frequency.prototype._primaryExpressions = Object.create( + o.TimeBase.prototype._primaryExpressions, + )), + (o.Frequency.prototype._primaryExpressions.midi = { + regexp: /^(\d+(?:\.\d+)?midi)/, + method: function (e) { + return this.midiToFrequency(e); + }, + }), + (o.Frequency.prototype._primaryExpressions.note = { + regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i, + method: function (e, t) { + var r = n[e.toLowerCase()] + 12 * (parseInt(t) + 1); + return this.midiToFrequency(r); + }, + }), + (o.Frequency.prototype._primaryExpressions.tr = { + regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, + method: function (e, t, r) { + var n = 1; + return ( + e && + "0" !== e && + (n *= this._beatsToUnits( + this._timeSignature() * parseFloat(e), + )), + t && "0" !== t && (n *= this._beatsToUnits(parseFloat(t))), + r && "0" !== r && (n *= this._beatsToUnits(parseFloat(r) / 4)), + n + ); + }, + }), + (o.Frequency.prototype.transpose = function (e) { + return ( + (this._expr = function (e, t) { + return e() * this.intervalToFrequencyRatio(t); + }.bind(this, this._expr, e)), + this + ); + }), + (o.Frequency.prototype.harmonize = function (e) { + return ( + (this._expr = function (e, t) { + for (var r = e(), n = [], o = 0; o < t.length; o++) + n[o] = r * this.intervalToFrequencyRatio(t[o]); + return n; + }.bind(this, this._expr, e)), + this + ); + }), + (o.Frequency.prototype.toMidi = function () { + return this.frequencyToMidi(this.valueOf()); + }), + (o.Frequency.prototype.toNote = function () { + var e = this.valueOf(), + t = Math.log(e / o.Frequency.A4) / Math.LN2, + r = Math.round(12 * t) + 57, + n = Math.floor(r / 12); + return n < 0 && (r += -12 * n), i[r % 12] + n.toString(); + }), + (o.Frequency.prototype.toSeconds = function () { + return 1 / this.valueOf(); + }), + (o.Frequency.prototype.toFrequency = function () { + return this.valueOf(); + }), + (o.Frequency.prototype.toTicks = function () { + var e = this._beatsToUnits(1), + t = this.valueOf() / e; + return Math.floor(t * o.Transport.PPQ); + }), + (o.Frequency.prototype._frequencyToUnits = function (e) { + return e; + }), + (o.Frequency.prototype._ticksToUnits = function (e) { + return 1 / ((60 * e) / (o.Transport.bpm.value * o.Transport.PPQ)); + }), + (o.Frequency.prototype._beatsToUnits = function (e) { + return 1 / o.TimeBase.prototype._beatsToUnits.call(this, e); + }), + (o.Frequency.prototype._secondsToUnits = function (e) { + return 1 / e; + }), + (o.Frequency.prototype._defaultUnits = "hz"); + var n = { + 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 ( + (o.Frequency.A4 = 440), + (o.Frequency.prototype.midiToFrequency = function (e) { + return o.Frequency.A4 * Math.pow(2, (e - 69) / 12); + }), + (o.Frequency.prototype.frequencyToMidi = function (e) { + return 69 + (12 * Math.log(e / o.Frequency.A4)) / Math.LN2; + }), + o.Frequency + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(16), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { + return ( + (o.TransportTime = function (t, r) { + if (!(this instanceof o.TransportTime)) + return new o.TransportTime(t, r); + o.Time.call(this, t, r); + }), + o.extend(o.TransportTime, o.Time), + (o.TransportTime.prototype._unaryExpressions = Object.create( + o.Time.prototype._unaryExpressions, + )), + (o.TransportTime.prototype._unaryExpressions.quantize = { + regexp: /^@/, + method: function (t) { + var r = this._secondsToTicks(t()), + e = Math.ceil(o.Transport.ticks / r); + return this._ticksToUnits(e * r); + }, + }), + (o.TransportTime.prototype._secondsToTicks = function (t) { + var r = t / this._beatsToUnits(1); + return Math.round(r * o.Transport.PPQ); + }), + (o.TransportTime.prototype.valueOf = function () { + return ( + this._secondsToTicks(this._expr()) + + (this._plusNow ? o.Transport.ticks : 0) + ); + }), + (o.TransportTime.prototype.toTicks = function () { + return this.valueOf(); + }), + (o.TransportTime.prototype.toSeconds = function () { + return this._expr() + (this._plusNow ? o.Transport.seconds : 0); + }), + (o.TransportTime.prototype.toFrequency = function () { + return 1 / this.toSeconds(); + }), + o.TransportTime + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(4), + __webpack_require__(13), + __webpack_require__(1), + __webpack_require__(33), + __webpack_require__(21), + __webpack_require__(34), + __webpack_require__(20), + __webpack_require__(35), + __webpack_require__(36), + __webpack_require__(37), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (p) { + "use strict"; + function r(e, n, r) { + var t = new e(); + return ( + r._eval(n[0]).connect(t, 0, 0), r._eval(n[1]).connect(t, 0, 1), t + ); + } + function t(e, n, r) { + var t = new e(); + return r._eval(n[0]).connect(t, 0, 0), t; + } + function o(e) { + return e ? parseFloat(e) : void 0; + } + function i(e) { + return e && e.args ? parseFloat(e.args) : void 0; + } + return ( + (p.Expr = function () { + var n = this._replacements(Array.prototype.slice.call(arguments)), + e = this._parseInputs(n); + (this._nodes = []), (this.input = new Array(e)); + for (var r = 0; r < e; r++) this.input[r] = this.context.createGain(); + var t, + o = this._parseTree(n); + try { + t = this._eval(o); + } catch (e) { + throw ( + (this._disposeNodes(), + new Error("Tone.Expr: Could evaluate expression: " + n)) + ); + } + this.output = t; + }), + p.extend(p.Expr, p.SignalBase), + (p.Expr._Expressions = { + value: { + signal: { + regexp: /^\d+\.\d+|^\d+/, + method: function (e) { + return new p.Signal(o(e)); + }, + }, + input: { + regexp: /^\$\d/, + method: function (e, n) { + return n.input[o(e.substr(1))]; + }, + }, + }, + glue: { + "(": { regexp: /^\(/ }, + ")": { regexp: /^\)/ }, + ",": { regexp: /^,/ }, + }, + func: { + abs: { regexp: /^abs/, method: t.bind(this, p.Abs) }, + mod: { + regexp: /^mod/, + method: function (e, n) { + var r = i(e[1]), + t = new p.Modulo(r); + return n._eval(e[0]).connect(t), t; + }, + }, + pow: { + regexp: /^pow/, + method: function (e, n) { + var r = i(e[1]), + t = new p.Pow(r); + return n._eval(e[0]).connect(t), t; + }, + }, + a2g: { + regexp: /^a2g/, + method: function (e, n) { + var r = new p.AudioToGain(); + return n._eval(e[0]).connect(r), r; + }, + }, + }, + binary: { + "+": { regexp: /^\+/, precedence: 1, method: r.bind(this, p.Add) }, + "-": { + regexp: /^\-/, + precedence: 1, + method: function (e, n) { + return 1 === e.length ? t(p.Negate, e, n) : r(p.Subtract, e, n); + }, + }, + "*": { + regexp: /^\*/, + precedence: 0, + method: r.bind(this, p.Multiply), + }, + }, + unary: { + "-": { regexp: /^\-/, method: t.bind(this, p.Negate) }, + "!": { regexp: /^\!/, method: t.bind(this, p.NOT) }, + }, + }), + (p.Expr.prototype._parseInputs = function (e) { + var n = e.match(/\$\d/g), + r = 0; + if (null !== n) + for (var t = 0; t < n.length; t++) { + var o = parseInt(n[t].substr(1)) + 1; + r = Math.max(r, o); + } + return r; + }), + (p.Expr.prototype._replacements = function (e) { + for (var n = e.shift(), r = 0; r < e.length; r++) + n = n.replace(/\%/i, e[r]); + return n; + }), + (p.Expr.prototype._tokenize = function (e) { + for (var n = -1, r = []; 0 < e.length; ) { + var t = o((e = e.trim())); + r.push(t), (e = e.substr(t.value.length)); + } + function o(e) { + for (var n in p.Expr._Expressions) { + var r = p.Expr._Expressions[n]; + for (var t in r) { + var o = r[t], + i = o.regexp, + a = e.match(i); + if (null !== a) + return { type: n, value: a[0], method: o.method }; + } + } + throw new SyntaxError("Tone.Expr: Unexpected token " + e); + } + return { + next: function () { + return r[++n]; + }, + peek: function () { + return r[n + 1]; + }, + }; + }), + (p.Expr.prototype._parseTree = function (e) { + var t = this._tokenize(e), + a = this.isUndef.bind(this); + function r(e, n) { + return !a(e) && "glue" === e.type && e.value === n; + } + function o(e, n, r) { + var t = p.Expr._Expressions[n]; + if (!a(e)) + for (var o in t) { + var i = t[o]; + if (i.regexp.test(e.value)) { + if (a(r)) return !0; + if (i.precedence === r) return !0; + } + } + return !1; + } + function i(e) { + var n; + a(e) && (e = 5), + (n = + e < 0 + ? (function e() { + var n, r; + n = t.peek(); + if (o(n, "unary")) + return ( + (n = t.next()), + (r = e()), + { operator: n.value, method: n.method, args: [r] } + ); + return s(); + })() + : i(e - 1)); + for (var r = t.peek(); o(r, "binary", e); ) + (n = { + operator: (r = t.next()).value, + method: r.method, + args: [n, i(e - 1)], + }), + (r = t.peek()); + return n; + } + function s() { + var e, n; + if (((e = t.peek()), a(e))) + throw new SyntaxError( + "Tone.Expr: Unexpected termination of expression", + ); + if ("func" === e.type) + return (function (e) { + var n = []; + if (!r(t.next(), "(")) + throw new SyntaxError( + 'Tone.Expr: Expected ( in a function call "' + + e.value + + '"', + ); + r(t.peek(), ")") || + (n = (function () { + var e, + n = []; + for (; (e = i()), !a(e) && (n.push(e), r(t.peek(), ",")); ) + t.next(); + return n; + })()); + if (r(t.next(), ")")) + return { method: e.method, args: n, name: name }; + throw new SyntaxError( + 'Tone.Expr: Expected ) in a function call "' + e.value + '"', + ); + })((e = t.next())); + if ("value" === e.type) + return { method: (e = t.next()).method, args: e.value }; + if (r(e, "(")) { + if ((t.next(), (n = i()), !r((e = t.next()), ")"))) + throw new SyntaxError("Expected )"); + return n; + } + throw new SyntaxError( + "Tone.Expr: Parse error, cannot process token " + e.value, + ); + } + return i(); + }), + (p.Expr.prototype._eval = function (e) { + if (!this.isUndef(e)) { + var n = e.method(e.args, this); + return this._nodes.push(n), n; + } + }), + (p.Expr.prototype._disposeNodes = function () { + for (var e = 0; e < this._nodes.length; e++) { + var n = this._nodes[e]; + this.isFunction(n.dispose) + ? n.dispose() + : this.isFunction(n.disconnect) && n.disconnect(), + (n = null), + (this._nodes[e] = null); + } + this._nodes = null; + }), + (p.Expr.prototype.dispose = function () { + p.prototype.dispose.call(this), this._disposeNodes(); + }), + p.Expr + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(21), + __webpack_require__(13), + __webpack_require__(2), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { + "use strict"; + return ( + (e.GreaterThan = function (t) { + this.createInsOuts(2, 0), + (this._param = this.input[0] = new e.Subtract(t)), + (this.input[1] = this._param.input[1]), + (this._gtz = this.output = new e.GreaterThanZero()), + this._param.connect(this._gtz); + }), + e.extend(e.GreaterThan, e.Signal), + (e.GreaterThan.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._param.dispose(), + (this._param = null), + this._gtz.dispose(), + (this._gtz = null), + this + ); + }), + e.GreaterThan + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(6), + __webpack_require__(15), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (s) { + "use strict"; + return ( + (s.Abs = function () { + this._abs = + this.input = + this.output = + new s.WaveShaper(function (s) { + return 0 === s ? 0 : Math.abs(s); + }, 127); + }), + s.extend(s.Abs, s.SignalBase), + (s.Abs.prototype.dispose = function () { + return ( + s.prototype.dispose.call(this), + this._abs.dispose(), + (this._abs = null), + this + ); + }), + s.Abs + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(6), + __webpack_require__(1), + __webpack_require__(13), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { + "use strict"; + return ( + (i.Modulo = function (t) { + this.createInsOuts(1, 0), + (this._shaper = new i.WaveShaper(Math.pow(2, 16))), + (this._multiply = new i.Multiply()), + (this._subtract = this.output = new i.Subtract()), + (this._modSignal = new i.Signal(t)), + 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(t); + }), + i.extend(i.Modulo, i.SignalBase), + (i.Modulo.prototype._setWaveShaper = function (i) { + this._shaper.setMap(function (t) { + return Math.floor((t + 1e-4) / i); + }); + }), + Object.defineProperty(i.Modulo.prototype, "value", { + get: function () { + return this._modSignal.value; + }, + set: function (t) { + (this._modSignal.value = t), this._setWaveShaper(t); + }, + }), + (i.Modulo.prototype.dispose = function () { + return ( + i.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 + ); + }), + i.Modulo + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(6), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = 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 (e) { + (this._exp = e), 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 + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(6), + __webpack_require__(2), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { + "use strict"; + return ( + (n.AudioToGain = function () { + this._norm = + this.input = + this.output = + new n.WaveShaper(function (n) { + return (n + 1) / 2; + }); + }), + n.extend(n.AudioToGain, n.SignalBase), + (n.AudioToGain.prototype.dispose = function () { + return ( + n.prototype.dispose.call(this), + this._norm.dispose(), + (this._norm = null), + this + ); + }), + n.AudioToGain + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(6), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { + "use strict"; + return ( + (e.EqualPowerGain = function () { + this._eqPower = + this.input = + this.output = + new e.WaveShaper( + function (e) { + return Math.abs(e) < 0.001 ? 0 : this.equalPowerScale(e); + }.bind(this), + 4096, + ); + }), + e.extend(e.EqualPowerGain, e.SignalBase), + (e.EqualPowerGain.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._eqPower.dispose(), + (this._eqPower = null), + this + ); + }), + e.EqualPowerGain + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(19), + __webpack_require__(9), + ]), + (__WEBPACK_AMD_DEFINE_RESULT__ = function (t) { + "use strict"; + return ( + (t.TimelineState = function (e) { + t.Timeline.call(this), (this._initial = e); + }), + t.extend(t.TimelineState, t.Timeline), + (t.TimelineState.prototype.getValueAtTime = function (e) { + var t = this.get(e); + return null !== t ? t.state : this._initial; + }), + (t.TimelineState.prototype.setStateAtTime = function (e, t) { + this.add({ state: e, time: t }); + }), + t.TimelineState + ); + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && + (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + }, + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + __webpack_require__.r(__webpack_exports__); + + var audioworklet_polyfill = __webpack_require__(24); + + var shims = __webpack_require__(25); + + var audiocontext = __webpack_require__(3); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var main_Main = function Main() { + _classCallCheck(this, Main); + + this.input = audiocontext["a"].createGain(); + this.output = audiocontext["a"].createGain(); + + this.limiter = audiocontext["a"].createDynamicsCompressor(); + this.limiter.threshold.value = -3; + this.limiter.ratio.value = 20; + this.limiter.knee.value = 1; + this.audiocontext = audiocontext["a"]; + this.output.disconnect(); + + this.input.connect(this.limiter); + + this.limiter.connect(this.output); + + this.meter = audiocontext["a"].createGain(); + this.fftMeter = audiocontext["a"].createGain(); + this.output.connect(this.meter); + this.output.connect(this.fftMeter); + + this.output.connect(this.audiocontext.destination); + + this.soundArray = []; + + this.parts = []; + + this.extensions = []; + }; + + var p5sound = new main_Main(); + /** + * Returns a number representing the output volume for sound + * in this sketch. + * + * @method getOutputVolume + * @return {Number} Output volume for sound in this sketch. + * Should be between 0.0 (silence) and 1.0. + */ + + p5.prototype.getOutputVolume = function () { + return p5sound.output.gain.value; + }; + /** + *

            Scale the output of all sound in this sketch

            + * Scaled between 0.0 (silence) and 1.0 (full volume). + * 1.0 is the maximum amplitude of a digital sound, so multiplying + * by greater than 1.0 may cause digital distortion. To + * fade, provide a rampTime parameter. For more + * complex fades, see the Envelope class. + * + * Alternately, you can pass in a signal source such as an + * oscillator to modulate the amplitude with an audio signal. + * + *

            How This Works: When you load the p5.sound module, it + * creates a single instance of p5sound. All sound objects in this + * module output to p5sound before reaching your computer's output. + * So if you change the amplitude of p5sound, it impacts all of the + * sound in this module.

            + * + *

            If no value is provided, returns a Web Audio API Gain Node

            + * + * @method outputVolume + * @param {Number|Object} volume Volume (amplitude) between 0.0 + * and 1.0 or modulating signal/oscillator + * @param {Number} [rampTime] Fade for t seconds + * @param {Number} [timeFromNow] Schedule this event to happen at + * t seconds in the future + */ + + p5.prototype.outputVolume = function (vol) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = + arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (typeof vol === "number") { + var now = p5sound.audiocontext.currentTime; + var currentVol = p5sound.output.gain.value; + p5sound.output.gain.cancelScheduledValues(now + tFromNow); + p5sound.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); + p5sound.output.gain.linearRampToValueAtTime( + vol, + now + tFromNow + rampTime, + ); + } else if (vol) { + vol.connect(p5sound.output.gain); + } else { + return p5sound.output.gain; + } + }; + /** + * `p5.soundOut` is the p5.sound final output bus. It sends output to + * the destination of this window's web audio context. It contains + * Web Audio API nodes including a dyanmicsCompressor (.limiter), + * and Gain Nodes for .input and .output. + * + * @property {Object} soundOut + */ + + p5.prototype.soundOut = p5.soundOut = p5sound; + + p5.soundOut._silentNode = p5sound.audiocontext.createGain(); + p5.soundOut._silentNode.gain.value = 0; + + p5.soundOut._silentNode.connect(p5sound.audiocontext.destination); + + var main = p5sound; + var processorNames = __webpack_require__(5); + var processorNames_default = __webpack_require__.n(processorNames); + + function _typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof(obj); + } + + /** + * @for p5 + */ + + /** + * Returns a number representing the sample rate, in samples per second, + * of all sound objects in this audio context. It is determined by the + * sampling rate of your operating system's sound card, and it is not + * currently possile to change. + * It is often 44100, or twice the range of human hearing. + * + * @method sampleRate + * @return {Number} samplerate samples per second + */ + + function sampleRate() { + return main.audiocontext.sampleRate; + } + /** + * Returns the closest MIDI note value for + * a given frequency. + * + * @method freqToMidi + * @param {Number} frequency A freqeuncy, for example, the "A" + * above Middle C is 440Hz + * @return {Number} MIDI note value + */ + + function freqToMidi(f) { + var mathlog2 = Math.log(f / 440) / Math.log(2); + var m = Math.round(12 * mathlog2) + 69; + return m; + } + /** + * Returns the frequency value of a MIDI note value. + * General MIDI treats notes as integers where middle C + * is 60, C# is 61, D is 62 etc. Useful for generating + * musical frequencies with oscillators. + * + * @method midiToFreq + * @param {Number} midiNote The number of a MIDI note + * @return {Number} Frequency value of the given MIDI note + * @example + *
            + * let midiNotes = [60, 64, 67, 72]; + * let noteIndex = 0; + * let midiVal, freq; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(startSound); + * osc = new p5.TriOsc(); + * env = new p5.Envelope(); + * } + * + * function draw() { + * background(220); + * text('tap to play', 10, 20); + * if (midiVal) { + * text('MIDI: ' + midiVal, 10, 40); + * text('Freq: ' + freq, 10, 60); + * } + * } + * + * function startSound() { + * // see also: userStartAudio(); + * osc.start(); + * + * midiVal = midiNotes[noteIndex % midiNotes.length]; + * freq = midiToFreq(midiVal); + * osc.freq(freq); + * env.ramp(osc, 0, 1.0, 0); + * + * noteIndex++; + * } + *
            + */ + + function midiToFreq(m) { + return 440 * Math.pow(2, (m - 69) / 12.0); + } + + function noteToFreq(note) { + if (typeof note !== "string") { + return note; + } + + var wholeNotes = { + A: 21, + B: 23, + C: 24, + D: 26, + E: 28, + F: 29, + G: 31, + }; + var value = wholeNotes[note[0].toUpperCase()]; + var octave = ~~note.slice(-1); + value += 12 * (octave - 1); + + switch (note[1]) { + case "#": + value += 1; + break; + + case "b": + value -= 1; + break; + + default: + break; + } + + return midiToFreq(value); + } + /** + * List the SoundFile formats that you will include. LoadSound + * will search your directory for these extensions, and will pick + * a format that is compatable with the client's web browser. + * Here is a free online file + * converter. + * + * @method soundFormats + * @param {String} [...formats] i.e. 'mp3', 'wav', 'ogg' + * @example + *
            + * function preload() { + * // set the global sound formats + * soundFormats('mp3', 'ogg'); + * + * // load either beatbox.mp3, or .ogg, depending on browser + * mySound = loadSound('assets/beatbox.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * text('sound loaded! tap to play', 10, 20, width - 20); + * cnv.mousePressed(function() { + * mySound.play(); + * }); + * } + *
            + */ + + function soundFormats() { + main.extensions = []; + + for (var i = 0; i < arguments.length; i++) { + arguments[i] = arguments[i].toLowerCase(); + + if (["mp3", "wav", "ogg", "m4a", "aac"].indexOf(arguments[i]) > -1) { + main.extensions.push(arguments[i]); + } else { + throw arguments[i] + " is not a valid sound format!"; + } + } + } + + function disposeSound() { + for (var i = 0; i < main.soundArray.length; i++) { + main.soundArray[i].dispose(); + } + } + + function _checkFileFormats(paths) { + var path; + + if (typeof paths === "string") { + path = paths; + + var extTest = path.split(".").pop(); + + if (["mp3", "wav", "ogg", "m4a", "aac"].indexOf(extTest) > -1) { + if (!p5.prototype.isFileSupported(extTest)) { + var pathSplit = path.split("."); + var pathCore = pathSplit[pathSplit.length - 1]; + + for (var _i = 0; _i < main.extensions.length; _i++) { + var _extension = main.extensions[_i]; + + var _supported = p5.prototype.isFileSupported(_extension); + + if (_supported) { + pathCore = ""; + + if (pathSplit.length === 2) { + pathCore += pathSplit[0]; + } + + for (var _i2 = 1; _i2 <= pathSplit.length - 2; _i2++) { + var p = pathSplit[_i2]; + pathCore += "." + p; + } + + path = pathCore += "."; + path = path += _extension; + break; + } + } + } + } else { + for (var _i3 = 0; _i3 < main.extensions.length; _i3++) { + var _extension2 = main.extensions[_i3]; + + var _supported2 = p5.prototype.isFileSupported(_extension2); + + if (_supported2) { + path = path + "." + _extension2; + break; + } + } + } + } else if (_typeof(paths) === "object") { + for (var i = 0; i < paths.length; i++) { + var extension = paths[i].split(".").pop(); + var supported = p5.prototype.isFileSupported(extension); + + if (supported) { + path = paths[i]; + break; + } + } + } + + return path; + } + /** + * Used by Osc and Envelope to chain signal math + */ + + function _mathChain(o, math, thisChain, nextChain, type) { + for (var i in o.mathOps) { + if (o.mathOps[i] instanceof type) { + o.mathOps[i].dispose(); + thisChain = i; + + if (thisChain < o.mathOps.length - 1) { + nextChain = o.mathOps[i + 1]; + } + } + } + + o.mathOps[thisChain - 1].disconnect(); + o.mathOps[thisChain - 1].connect(math); + math.connect(nextChain); + o.mathOps[thisChain] = math; + return o; + } + + function convertToWav(audioBuffer) { + var leftChannel, rightChannel; + leftChannel = audioBuffer.getChannelData(0); + + if (audioBuffer.numberOfChannels > 1) { + rightChannel = audioBuffer.getChannelData(1); + } else { + rightChannel = leftChannel; + } + + var interleaved = interleave(leftChannel, rightChannel); + + var buffer = new window.ArrayBuffer(44 + interleaved.length * 2); + var view = new window.DataView(buffer); + + writeUTFBytes(view, 0, "RIFF"); + view.setUint32(4, 36 + interleaved.length * 2, true); + writeUTFBytes(view, 8, "WAVE"); + + writeUTFBytes(view, 12, "fmt "); + view.setUint32(16, 16, true); + view.setUint16(20, 1, true); + + view.setUint16(22, 2, true); + view.setUint32(24, main.audiocontext.sampleRate, true); + view.setUint32(28, main.audiocontext.sampleRate * 4, true); + view.setUint16(32, 4, true); + view.setUint16(34, 16, true); + + writeUTFBytes(view, 36, "data"); + view.setUint32(40, interleaved.length * 2, true); + + var lng = interleaved.length; + var index = 44; + var volume = 1; + + for (var i = 0; i < lng; i++) { + view.setInt16(index, interleaved[i] * (0x7fff * volume), true); + index += 2; + } + + return view; + } + + function interleave(leftChannel, rightChannel) { + var length = leftChannel.length + rightChannel.length; + var result = new Float32Array(length); + var inputIndex = 0; + + for (var index = 0; index < length; ) { + result[index++] = leftChannel[inputIndex]; + result[index++] = rightChannel[inputIndex]; + inputIndex++; + } + + return result; + } + + function writeUTFBytes(view, offset, string) { + var lng = string.length; + + for (var i = 0; i < lng; i++) { + view.setUint8(offset + i, string.charCodeAt(i)); + } + } + + function safeBufferSize(idealBufferSize) { + var bufferSize = idealBufferSize; + + var tempAudioWorkletNode = new AudioWorkletNode( + main.audiocontext, + processorNames_default.a.soundFileProcessor, + ); + + if (tempAudioWorkletNode instanceof ScriptProcessorNode) { + bufferSize = tempAudioWorkletNode.bufferSize; + } + + tempAudioWorkletNode.disconnect(); + tempAudioWorkletNode = null; + return bufferSize; + } + /** + * Save a p5.SoundFile as a .wav file. The browser will prompt the user + * to download the file to their device. + * For uploading audio to a server, use + * `p5.SoundFile.saveBlob`. + * + * @for p5 + * @method saveSound + * @param {p5.SoundFile} soundFile p5.SoundFile that you wish to save + * @param {String} fileName name of the resulting .wav file. + */ + + function saveSound(soundFile, fileName) { + var dataView = convertToWav(soundFile.buffer); + p5.prototype.writeFile([dataView], fileName, "wav"); + } + + var CustomError = function CustomError(name, errorTrace, failedPath) { + var err = new Error(); + var tempStack, splitStack; + err.name = name; + err.originalStack = err.stack + errorTrace; + tempStack = err.stack + errorTrace; + err.failedPath = failedPath; + + splitStack = tempStack.split("\n").filter(function (ln) { + return !ln.match(/(p5.|native code|globalInit)/g); + }); + err.stack = splitStack.join("\n"); + return err; + }; + + var errorHandler = CustomError; + + var moduleSources = [ + __webpack_require__(27)["default"], + __webpack_require__(28)["default"], + __webpack_require__(29)["default"], + ]; + var audioWorklet_ac = main.audiocontext; + var initializedAudioWorklets = false; + + function loadAudioWorkletModules() { + return Promise.all( + moduleSources.map(function (moduleSrc) { + var blob = new Blob([moduleSrc], { + type: "application/javascript", + }); + var objectURL = URL.createObjectURL(blob); + return audioWorklet_ac.audioWorklet.addModule(objectURL); + }), + ); + } + + p5.prototype.registerMethod("init", function () { + if (initializedAudioWorklets) return; + + if (!this.preload && !window.preload) { + this.preload = function () {}; + } + + this._incrementPreload(); + + var onWorkletModulesLoad = function () { + initializedAudioWorklets = true; + + this._decrementPreload(); + }.bind(this); + + loadAudioWorkletModules().then(onWorkletModulesLoad); + }); + function panner_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + var panner_ac = main.audiocontext; + var panner; + + if (typeof panner_ac.createStereoPanner !== "undefined") { + var Panner = (function () { + function Panner(input, output) { + panner_classCallCheck(this, Panner); + + this.stereoPanner = this.input = panner_ac.createStereoPanner(); + input.connect(this.stereoPanner); + this.stereoPanner.connect(output); + } + + _createClass(Panner, [ + { + key: "pan", + value: function pan(val, tFromNow) { + var time = tFromNow || 0; + var t = panner_ac.currentTime + time; + this.stereoPanner.pan.linearRampToValueAtTime(val, t); + }, + }, + { + key: "inputChannels", + value: function inputChannels() {}, + }, + { + key: "connect", + value: function connect(obj) { + this.stereoPanner.connect(obj); + }, + }, + { + key: "disconnect", + value: function disconnect() { + if (this.stereoPanner) { + this.stereoPanner.disconnect(); + } + }, + }, + ]); + + return Panner; + })(); + + panner = Panner; + } else { + var _Panner = (function () { + function _Panner(input, output, numInputChannels) { + panner_classCallCheck(this, _Panner); + + this.input = panner_ac.createGain(); + input.connect(this.input); + this.left = panner_ac.createGain(); + this.right = panner_ac.createGain(); + this.left.channelInterpretation = "discrete"; + this.right.channelInterpretation = "discrete"; + + if (numInputChannels > 1) { + this.splitter = panner_ac.createChannelSplitter(2); + this.input.connect(this.splitter); + this.splitter.connect(this.left, 1); + this.splitter.connect(this.right, 0); + } else { + this.input.connect(this.left); + this.input.connect(this.right); + } + + this.output = panner_ac.createChannelMerger(2); + this.left.connect(this.output, 0, 1); + this.right.connect(this.output, 0, 0); + this.output.connect(output); + } + + _createClass(_Panner, [ + { + key: "pan", + value: function pan(val, tFromNow) { + var time = tFromNow || 0; + var t = panner_ac.currentTime + time; + var v = (val + 1) / 2; + var rightVal = Math.cos((v * Math.PI) / 2); + var leftVal = Math.sin((v * Math.PI) / 2); + this.left.gain.linearRampToValueAtTime(leftVal, t); + this.right.gain.linearRampToValueAtTime(rightVal, t); + }, + }, + { + key: "inputChannels", + value: function inputChannels(numChannels) { + if (numChannels === 1) { + this.input.disconnect(); + this.input.connect(this.left); + this.input.connect(this.right); + } else if (numChannels === 2) { + if (typeof this.splitter === "undefined") { + this.splitter = panner_ac.createChannelSplitter(2); + } + + this.input.disconnect(); + this.input.connect(this.splitter); + this.splitter.connect(this.left, 1); + this.splitter.connect(this.right, 0); + } + }, + }, + { + key: "connect", + value: function connect(obj) { + this.output.connect(obj); + }, + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + }, + }, + ]); + + return _Panner; + })(); + + panner = _Panner; + } + + var panner_0 = panner; + function soundfile_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + soundfile_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + soundfile_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return soundfile_typeof(obj); + } + + function soundfile_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function soundfile_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + soundfile_defineProperties(Constructor.prototype, protoProps); + if (staticProps) soundfile_defineProperties(Constructor, staticProps); + return Constructor; + } + + function soundfile_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var soundfile_ac = main.audiocontext; + + var _createCounterBuffer = function _createCounterBuffer(buffer) { + var len = buffer.length; + var audioBuf = soundfile_ac.createBuffer( + 1, + buffer.length, + soundfile_ac.sampleRate, + ); + var arrayBuffer = audioBuf.getChannelData(0); + + for (var index = 0; index < len; index++) { + arrayBuffer[index] = index; + } + + return audioBuf; + }; + + var Cue = function Cue(callback, time, id, val) { + soundfile_classCallCheck(this, Cue); + + this.callback = callback; + this.time = time; + this.id = id; + this.val = val; + }; + + function _clearOnEnd(e) { + var thisBufferSourceNode = e.target; + var soundFile = this; + + thisBufferSourceNode._playing = false; + thisBufferSourceNode.removeEventListener("ended", soundFile._clearOnEnd); + + soundFile._onended(soundFile); + + soundFile.bufferSourceNodes + .map(function (_, i) { + return i; + }) + .reverse() + .forEach(function (i) { + var n = soundFile.bufferSourceNodes[i]; + + if (n._playing === false) { + soundFile.bufferSourceNodes.splice(i, 1); + } + }); + + if (soundFile.bufferSourceNodes.length === 0) { + soundFile._playing = false; + } + } + /** + *

            SoundFile object with a path to a file.

            + * + *

            The p5.SoundFile may not be available immediately because + * it loads the file information asynchronously.

            + * + *

            To do something with the sound as soon as it loads + * pass the name of a function as the second parameter.

            + * + *

            Only one file path is required. However, audio file formats + * (i.e. mp3, ogg, wav and m4a/aac) are not supported by all + * web browsers. If you want to ensure compatability, instead of a single + * file path, you may include an Array of filepaths, and the browser will + * choose a format that works.

            + * + * @class p5.SoundFile + * @constructor + * @param {String|Array} path path to a sound file (String). Optionally, + * you may include multiple file formats in + * an array. Alternately, accepts an object + * from the HTML5 File API, or a p5.File. + * @param {Function} [successCallback] Name of a function to call once file loads + * @param {Function} [errorCallback] Name of a function to call if file fails to + * load. This function will receive an error or + * XMLHttpRequest object with information + * about what went wrong. + * @param {Function} [whileLoadingCallback] Name of a function to call while file + * is loading. That function will + * receive progress of the request to + * load the sound file + * (between 0 and 1) as its first + * parameter. This progress + * does not account for the additional + * time needed to decode the audio data. + * + * @example + *
            + * let mySound; + * function preload() { + * soundFormats('mp3', 'ogg'); + * mySound = loadSound('assets/doorbell'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap here to play', 10, 20); + * } + * + * function canvasPressed() { + * // playing a sound file on a user gesture + * // is equivalent to `userStartAudio()` + * mySound.play(); + * } + *
            + */ + + var soundfile_SoundFile = (function () { + function SoundFile(paths, onload, onerror, whileLoading) { + soundfile_classCallCheck(this, SoundFile); + + if (typeof paths !== "undefined") { + if (typeof paths === "string" || typeof paths[0] === "string") { + var path = p5.prototype._checkFileFormats(paths); + + this.url = path; + } else if (soundfile_typeof(paths) === "object") { + if ( + !( + window.File && + window.FileReader && + window.FileList && + window.Blob + ) + ) { + throw "Unable to load file because the File API is not supported"; + } + } + + if (paths.file) { + paths = paths.file; + } + + this.file = paths; + } + + this._onended = function () {}; + + this._looping = false; + this._playing = false; + this._paused = false; + this._pauseTime = 0; + + this._cues = []; + this._cueIDCounter = 0; + + this._lastPos = 0; + this._counterNode = null; + this._workletNode = null; + + this.bufferSourceNodes = []; + + this.bufferSourceNode = null; + this.buffer = null; + this.playbackRate = 1; + this.input = main.audiocontext.createGain(); + this.output = main.audiocontext.createGain(); + this.reversed = false; + + this.startTime = 0; + this.endTime = null; + this.pauseTime = 0; + + this.mode = "sustain"; + + this.startMillis = null; + + this.panPosition = 0.0; + this.panner = new panner_0(this.output, main.input, 2); + + if (this.url || this.file) { + this.load(onload, onerror); + } + + main.soundArray.push(this); + + if (typeof whileLoading === "function") { + this._whileLoading = whileLoading; + } else { + this._whileLoading = function () {}; + } + + this._clearOnEnd = _clearOnEnd.bind(this); + + this.amp = this.setVolume; + + this.fade = this.setVolume; + } + /** + * This is a helper function that the p5.SoundFile calls to load + * itself. Accepts a callback (the name of another function) + * as an optional parameter. + * + * @private + * @for p5.SoundFile + * @param {Function} [successCallback] Name of a function to call once file loads + * @param {Function} [errorCallback] Name of a function to call if there is an error + */ + + soundfile_createClass(SoundFile, [ + { + key: "load", + value: function load(callback, errorCallback) { + var self = this; + var errorTrace = new Error().stack; + + if (this.url !== undefined && this.url !== "") { + var request = new XMLHttpRequest(); + request.addEventListener( + "progress", + function (evt) { + self._updateProgress(evt); + }, + false, + ); + request.open("GET", this.url, true); + request.responseType = "arraybuffer"; + + request.onload = function () { + if (request.status === 200) { + if (!self.panner) return; + soundfile_ac.decodeAudioData( + request.response, + function (buff) { + if (!self.panner) return; + self.buffer = buff; + self.panner.inputChannels(buff.numberOfChannels); + + if (callback) { + callback(self); + } + }, + function () { + if (!self.panner) return; + var err = new errorHandler( + "decodeAudioData", + errorTrace, + self.url, + ); + var msg = + "AudioContext error at decodeAudioData for " + self.url; + + if (errorCallback) { + err.msg = msg; + errorCallback(err); + } else { + console.error( + msg + + "\n The error stack trace includes: \n" + + err.stack, + ); + } + }, + ); + } else { + if (!self.panner) return; + var err = new errorHandler("loadSound", errorTrace, self.url); + var msg = + "Unable to load " + + self.url + + ". The request status was: " + + request.status + + " (" + + request.statusText + + ")"; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error( + msg + "\n The error stack trace includes: \n" + err.stack, + ); + } + } + }; + + request.onerror = function () { + var err = new errorHandler("loadSound", errorTrace, self.url); + var msg = + "There was no response from the server at " + + self.url + + ". Check the url and internet connectivity."; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error( + msg + "\n The error stack trace includes: \n" + err.stack, + ); + } + }; + + request.send(); + } else if (this.file !== undefined) { + var reader = new FileReader(); + + reader.onload = function () { + if (!self.panner) return; + soundfile_ac.decodeAudioData(reader.result, function (buff) { + if (!self.panner) return; + self.buffer = buff; + self.panner.inputChannels(buff.numberOfChannels); + + if (callback) { + callback(self); + } + }); + }; + + reader.onerror = function (e) { + if (!self.panner) return; + + if (onerror) { + onerror(e); + } + }; + + reader.readAsArrayBuffer(this.file); + } + }, + }, + { + key: "_updateProgress", + value: function _updateProgress(evt) { + if (evt.lengthComputable) { + var percentComplete = (evt.loaded / evt.total) * 0.99; + + this._whileLoading(percentComplete, evt); + } else { + this._whileLoading("size unknown"); + } + }, + /** + * Returns true if the sound file finished loading successfully. + * + * @method isLoaded + * @for p5.SoundFile + * @return {Boolean} + */ + }, + { + key: "isLoaded", + value: function isLoaded() { + if (this.buffer) { + return true; + } else { + return false; + } + }, + /** + * Play the p5.SoundFile + * + * @method play + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule playback to start (in seconds from now). + * @param {Number} [rate] (optional) playback rate + * @param {Number} [amp] (optional) amplitude (volume) + * of playback + * @param {Number} [cueStart] (optional) cue start time in seconds + * @param {Number} [duration] (optional) duration of playback in seconds + */ + }, + { + key: "play", + value: function play(startTime, rate, amp, _cueStart, duration) { + if (!this.output) { + console.warn("SoundFile.play() called after dispose"); + return; + } + + var now = main.audiocontext.currentTime; + var cueStart, cueEnd; + var time = startTime || 0; + + if (time < 0) { + time = 0; + } + + time = time + now; + + if (typeof rate !== "undefined") { + this.rate(rate); + } + + if (typeof amp !== "undefined") { + this.setVolume(amp); + } + + if (this.buffer) { + this._pauseTime = 0; + + if ( + this.mode === "restart" && + this.buffer && + this.bufferSourceNode + ) { + this.bufferSourceNode.stop(time); + + this._counterNode.stop(time); + } + + if (this.mode === "untildone" && this.isPlaying()) { + return; + } + + this.bufferSourceNode = this._initSourceNode(); + + delete this._counterNode; + this._counterNode = this._initCounterNode(); + + if (_cueStart) { + if (_cueStart >= 0 && _cueStart < this.buffer.duration) { + cueStart = _cueStart; + } else { + throw "start time out of range"; + } + } else { + cueStart = 0; + } + + if (duration) { + duration = + duration <= this.buffer.duration - cueStart + ? duration + : this.buffer.duration; + } + + if (this._paused) { + this.bufferSourceNode.start(time, this.pauseTime, duration); + + this._counterNode.start(time, this.pauseTime, duration); + } else { + this.bufferSourceNode.start(time, cueStart, duration); + + this._counterNode.start(time, cueStart, duration); + } + + this._playing = true; + this._paused = false; + + this.bufferSourceNodes.push(this.bufferSourceNode); + this.bufferSourceNode._arrayIndex = + this.bufferSourceNodes.length - 1; + this.bufferSourceNode.addEventListener("ended", this._clearOnEnd); + } else { + throw "not ready to play file, buffer has yet to load. Try preload()"; + } + + this.bufferSourceNode.loop = this._looping; + this._counterNode.loop = this._looping; + + if (this._looping === true) { + cueEnd = duration ? duration : cueStart - 0.000000000000001; + this.bufferSourceNode.loopStart = cueStart; + this.bufferSourceNode.loopEnd = cueEnd; + this._counterNode.loopStart = cueStart; + this._counterNode.loopEnd = cueEnd; + } + }, + /** + * p5.SoundFile has two play modes: restart and + * sustain. Play Mode determines what happens to a + * p5.SoundFile if it is triggered while in the middle of playback. + * In sustain mode, playback will continue simultaneous to the + * new playback. In restart mode, play() will stop playback + * and start over. With untilDone, a sound will play only if it's + * not already playing. Sustain is the default mode. + * + * @method playMode + * @for p5.SoundFile + * @param {String} str 'restart' or 'sustain' or 'untilDone' + * @example + *
            + * let mySound; + * function preload(){ + * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * noFill(); + * rect(0, height/2, width - 1, height/2 - 1); + * rect(0, 0, width - 1, height/2); + * textAlign(CENTER, CENTER); + * fill(20); + * text('restart', width/2, 1 * height/4); + * text('sustain', width/2, 3 * height/4); + * } + * function canvasPressed() { + * if (mouseX < height/2) { + * mySound.playMode('restart'); + * } else { + * mySound.playMode('sustain'); + * } + * mySound.play(); + * } + * + *
            + */ + }, + { + key: "playMode", + value: function playMode(str) { + var s = str.toLowerCase(); + + if (s === "restart" && this.buffer && this.bufferSourceNode) { + for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { + var now = main.audiocontext.currentTime; + this.bufferSourceNodes[i].stop(now); + } + } + + if (s === "restart" || s === "sustain" || s === "untildone") { + this.mode = s; + } else { + throw 'Invalid play mode. Must be either "restart" or "sustain"'; + } + }, + /** + * Pauses a file that is currently playing. If the file is not + * playing, then nothing will happen. + * + * After pausing, .play() will resume from the paused + * position. + * If p5.SoundFile had been set to loop before it was paused, + * it will continue to loop after it is unpaused with .play(). + * + * @method pause + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule event to occur + * seconds from now + * @example + *
            + * let soundFile; + * function preload() { + * soundFormats('ogg', 'mp3'); + * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play, release to pause', 10, 20, width - 20); + * } + * function canvasPressed() { + * soundFile.loop(); + * background(0, 200, 50); + * } + * function mouseReleased() { + * soundFile.pause(); + * background(220); + * } + * + *
            + */ + }, + { + key: "pause", + value: function pause(startTime) { + var now = main.audiocontext.currentTime; + var time = startTime || 0; + var pTime = time + now; + + if (this.isPlaying() && this.buffer && this.bufferSourceNode) { + this._paused = true; + this._playing = false; + this.pauseTime = this.currentTime(); + this.bufferSourceNode.stop(pTime); + + this._counterNode.stop(pTime); + + this._pauseTime = this.currentTime(); + } else { + this._pauseTime = 0; + } + }, + /** + * Loop the p5.SoundFile. Accepts optional parameters to set the + * playback rate, playback volume, loopStart, loopEnd. + * + * @method loop + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule event to occur + * seconds from now + * @param {Number} [rate] (optional) playback rate + * @param {Number} [amp] (optional) playback volume + * @param {Number} [cueLoopStart] (optional) startTime in seconds + * @param {Number} [duration] (optional) loop duration in seconds + * @example + *
            + * let soundFile; + * let loopStart = 0.5; + * let loopDuration = 0.2; + * function preload() { + * soundFormats('ogg', 'mp3'); + * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play, release to pause', 10, 20, width - 20); + * } + * function canvasPressed() { + * soundFile.loop(); + * background(0, 200, 50); + * } + * function mouseReleased() { + * soundFile.pause(); + * background(220); + * } + * + *
            + */ + }, + { + key: "loop", + value: function loop(startTime, rate, amp, loopStart, duration) { + this._looping = true; + this.play(startTime, rate, amp, loopStart, duration); + }, + /** + * Set a p5.SoundFile's looping flag to true or false. If the sound + * is currently playing, this change will take effect when it + * reaches the end of the current playback. + * + * @method setLoop + * @for p5.SoundFile + * @param {Boolean} Boolean set looping to true or false + */ + }, + { + key: "setLoop", + value: function setLoop(bool) { + if (bool === true) { + this._looping = true; + } else if (bool === false) { + this._looping = false; + } else { + throw "Error: setLoop accepts either true or false"; + } + + if (this.bufferSourceNode) { + this.bufferSourceNode.loop = this._looping; + this._counterNode.loop = this._looping; + } + }, + /** + * Returns 'true' if a p5.SoundFile is currently looping and playing, 'false' if not. + * + * @method isLooping + * @for p5.SoundFile + * @return {Boolean} + */ + }, + { + key: "isLooping", + value: function isLooping() { + if (!this.bufferSourceNode) { + return false; + } + + if (this._looping === true && this.isPlaying() === true) { + return true; + } + + return false; + }, + /** + * Returns true if a p5.SoundFile is playing, false if not (i.e. + * paused or stopped). + * + * @method isPlaying + * @for p5.SoundFile + * @return {Boolean} + */ + }, + { + key: "isPlaying", + value: function isPlaying() { + return this._playing; + }, + /** + * Returns true if a p5.SoundFile is paused, false if not (i.e. + * playing or stopped). + * + * @method isPaused + * @for p5.SoundFile + * @return {Boolean} + */ + }, + { + key: "isPaused", + value: function isPaused() { + return this._paused; + }, + /** + * Stop soundfile playback. + * + * @method stop + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule event to occur + * in seconds from now + */ + }, + { + key: "stop", + value: function stop(timeFromNow) { + var time = timeFromNow || 0; + + if (this.mode === "sustain" || this.mode === "untildone") { + this.stopAll(time); + this._playing = false; + this.pauseTime = 0; + this._paused = false; + } else if (this.buffer && this.bufferSourceNode) { + var now = main.audiocontext.currentTime; + var t = time || 0; + this.pauseTime = 0; + this.bufferSourceNode.stop(now + t); + + this._counterNode.stop(now + t); + + this._playing = false; + this._paused = false; + } + }, + /** + * Stop playback on all of this soundfile's sources. + * @private + */ + }, + { + key: "stopAll", + value: function stopAll(_time) { + var now = main.audiocontext.currentTime; + var time = _time || 0; + + if (this.buffer && this.bufferSourceNode) { + for (var i in this.bufferSourceNodes) { + var bufferSourceNode = this.bufferSourceNodes[i]; + + if (bufferSourceNode) { + try { + bufferSourceNode.stop(now + time); + } catch (e) {} + } + } + + this._counterNode.stop(now + time); + } + }, + }, + { + key: "getVolume", + value: function getVolume() { + return this.output.gain.value; + }, + /** + * Set the stereo panning of a p5.sound object to + * a floating point number between -1.0 (left) and 1.0 (right). + * Default is 0.0 (center). + * + * @method pan + * @for p5.SoundFile + * @param {Number} [panValue] Set the stereo panner + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @example + *
            + * let ballX = 0; + * let soundFile; + * + * function preload() { + * soundFormats('ogg', 'mp3'); + * soundFile = loadSound('assets/beatbox.mp3'); + * } + * + * function draw() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * ballX = constrain(mouseX, 0, width); + * ellipse(ballX, height/2, 20, 20); + * } + * + * function canvasPressed(){ + * // map the ball's x location to a panning degree + * // between -1.0 (left) and 1.0 (right) + * let panning = map(ballX, 0., width,-1.0, 1.0); + * soundFile.pan(panning); + * soundFile.play(); + * } + *
            + */ + }, + { + key: "pan", + value: function pan(pval, tFromNow) { + this.panPosition = pval; + this.panner.pan(pval, tFromNow); + }, + /** + * Returns the current stereo pan position (-1.0 to 1.0) + * + * @method getPan + * @for p5.SoundFile + * @return {Number} Returns the stereo pan setting of the Oscillator + * as a number between -1.0 (left) and 1.0 (right). + * 0.0 is center and default. + */ + }, + { + key: "getPan", + value: function getPan() { + return this.panPosition; + }, + /** + * Set the playback rate of a sound file. Will change the speed and the pitch. + * Values less than zero will reverse the audio buffer. + * + * @method rate + * @for p5.SoundFile + * @param {Number} [playbackRate] Set the playback rate. 1.0 is normal, + * .5 is half-speed, 2.0 is twice as fast. + * Values less than zero play backwards. + * @example + *
            + * let mySound; + * + * function preload() { + * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * } + * function canvasPressed() { + * mySound.loop(); + * } + * function mouseReleased() { + * mySound.pause(); + * } + * function draw() { + * background(220); + * + * // Set the rate to a range between 0.1 and 4 + * // Changing the rate also alters the pitch + * let playbackRate = map(mouseY, 0.1, height, 2, 0); + * playbackRate = constrain(playbackRate, 0.01, 4); + * mySound.rate(playbackRate); + * + * line(0, mouseY, width, mouseY); + * text('rate: ' + round(playbackRate * 100) + '%', 10, 20); + * } + * + * + *
            + * + */ + }, + { + key: "rate", + value: function rate(playbackRate) { + var reverse = false; + + if (typeof playbackRate === "undefined") { + return this.playbackRate; + } + + this.playbackRate = playbackRate; + + if (playbackRate === 0) { + playbackRate = 0.0000000000001; + } else if (playbackRate < 0 && !this.reversed) { + playbackRate = Math.abs(playbackRate); + reverse = true; + } else if (playbackRate > 0 && this.reversed) { + reverse = true; + } + + if (this.bufferSourceNode) { + var now = main.audiocontext.currentTime; + this.bufferSourceNode.playbackRate.cancelScheduledValues(now); + this.bufferSourceNode.playbackRate.linearRampToValueAtTime( + Math.abs(playbackRate), + now, + ); + + this._counterNode.playbackRate.cancelScheduledValues(now); + + this._counterNode.playbackRate.linearRampToValueAtTime( + Math.abs(playbackRate), + now, + ); + } + + if (reverse) { + this.reverseBuffer(); + } + + return this.playbackRate; + }, + }, + { + key: "setPitch", + value: function setPitch(num) { + var newPlaybackRate = midiToFreq(num) / midiToFreq(60); + this.rate(newPlaybackRate); + }, + }, + { + key: "getPlaybackRate", + value: function getPlaybackRate() { + return this.playbackRate; + }, + /** + * Multiply the output volume (amplitude) of a sound file + * between 0.0 (silence) and 1.0 (full volume). + * 1.0 is the maximum amplitude of a digital sound, so multiplying + * by greater than 1.0 may cause digital distortion. To + * fade, provide a rampTime parameter. For more + * complex fades, see the Envelope class. + * + * Alternately, you can pass in a signal source such as an + * oscillator to modulate the amplitude with an audio signal. + * + * @method setVolume + * @for p5.SoundFile + * @param {Number|Object} volume Volume (amplitude) between 0.0 + * and 1.0 or modulating signal/oscillator + * @param {Number} [rampTime] Fade for t seconds + * @param {Number} [timeFromNow] Schedule this event to happen at + * t seconds in the future + */ + }, + { + key: "setVolume", + value: function setVolume(vol, _rampTime, _tFromNow) { + if (typeof vol === "number") { + var rampTime = _rampTime || 0; + var tFromNow = _tFromNow || 0; + var now = main.audiocontext.currentTime; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(now + tFromNow); + this.output.gain.linearRampToValueAtTime( + currentVol, + now + tFromNow, + ); + this.output.gain.linearRampToValueAtTime( + vol, + now + tFromNow + rampTime, + ); + } else if (vol) { + vol.connect(this.output.gain); + } else { + return this.output.gain; + } + }, + /** + * Returns the duration of a sound file in seconds. + * + * @method duration + * @for p5.SoundFile + * @return {Number} The duration of the soundFile in seconds. + */ + }, + { + key: "duration", + value: function duration() { + if (this.buffer) { + return this.buffer.duration; + } else { + return 0; + } + }, + /** + * Return the current position of the p5.SoundFile playhead, in seconds. + * Time is relative to the normal buffer direction, so if `reverseBuffer` + * has been called, currentTime will count backwards. + * + * @method currentTime + * @for p5.SoundFile + * @return {Number} currentTime of the soundFile in seconds. + */ + }, + { + key: "currentTime", + value: function currentTime() { + return this.reversed + ? Math.abs(this._lastPos - this.buffer.length) / + soundfile_ac.sampleRate + : this._lastPos / soundfile_ac.sampleRate; + }, + /** + * Move the playhead of a soundfile that is currently playing to a + * new position and a new duration, in seconds. + * If none are given, will reset the file to play entire duration + * from start to finish. To set the position of a soundfile that is + * not currently playing, use the `play` or `loop` methods. + * + * @method jump + * @for p5.SoundFile + * @param {Number} cueTime cueTime of the soundFile in seconds. + * @param {Number} duration duration in seconds. + */ + }, + { + key: "jump", + value: function jump(cueTime, duration) { + if (cueTime < 0 || cueTime > this.buffer.duration) { + throw "jump time out of range"; + } + + if (duration > this.buffer.duration - cueTime) { + throw "end time out of range"; + } + + var cTime = cueTime || 0; + var dur = duration || undefined; + + if (this.isPlaying()) { + this.stop(0); + this.play( + 0, + this.playbackRate, + this.output.gain.value, + cTime, + dur, + ); + } + }, + /** + * Return the number of channels in a sound file. + * For example, Mono = 1, Stereo = 2. + * + * @method channels + * @for p5.SoundFile + * @return {Number} [channels] + */ + }, + { + key: "channels", + value: function channels() { + return this.buffer.numberOfChannels; + }, + /** + * Return the sample rate of the sound file. + * + * @method sampleRate + * @for p5.SoundFile + * @return {Number} [sampleRate] + */ + }, + { + key: "sampleRate", + value: function sampleRate() { + return this.buffer.sampleRate; + }, + /** + * Return the number of samples in a sound file. + * Equal to sampleRate * duration. + * + * @method frames + * @for p5.SoundFile + * @return {Number} [sampleCount] + */ + }, + { + key: "frames", + value: function frames() { + return this.buffer.length; + }, + /** + * Returns an array of amplitude peaks in a p5.SoundFile that can be + * used to draw a static waveform. Scans through the p5.SoundFile's + * audio buffer to find the greatest amplitudes. Accepts one + * parameter, 'length', which determines size of the array. + * Larger arrays result in more precise waveform visualizations. + * + * Inspired by Wavesurfer.js. + * + * @method getPeaks + * @for p5.SoundFile + * @params {Number} [length] length is the size of the returned array. + * Larger length results in more precision. + * Defaults to 5*width of the browser window. + * @returns {Float32Array} Array of peaks. + */ + }, + { + key: "getPeaks", + value: function getPeaks(length) { + if (this.buffer) { + if (!length) { + length = window.width * 5; + } + + if (this.buffer) { + var buffer = this.buffer; + var sampleSize = buffer.length / length; + var sampleStep = ~~(sampleSize / 10) || 1; + var channels = buffer.numberOfChannels; + var peaks = new Float32Array(Math.round(length)); + + for (var c = 0; c < channels; c++) { + var chan = buffer.getChannelData(c); + + for (var i = 0; i < length; i++) { + var start = ~~(i * sampleSize); + var end = ~~(start + sampleSize); + var max = 0; + + for (var j = start; j < end; j += sampleStep) { + var value = chan[j]; + + if (value > max) { + max = value; + } else if (-value > max) { + max = value; + } + } + + if (c === 0 || Math.abs(max) > peaks[i]) { + peaks[i] = max; + } + } + } + + return peaks; + } + } else { + throw "Cannot load peaks yet, buffer is not loaded"; + } + }, + /** + * Reverses the p5.SoundFile's buffer source. + * Playback must be handled separately (see example). + * + * @method reverseBuffer + * @for p5.SoundFile + * @example + *
            + * let drum; + * function preload() { + * drum = loadSound('assets/drum.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function canvasPressed() { + * drum.stop(); + * drum.reverseBuffer(); + * drum.play(); + * } + * + *
            + */ + }, + { + key: "reverseBuffer", + value: function reverseBuffer() { + if (this.buffer) { + var currentPos = this._lastPos / soundfile_ac.sampleRate; + var curVol = this.getVolume(); + this.setVolume(0, 0.001); + var numChannels = this.buffer.numberOfChannels; + + for (var i = 0; i < numChannels; i++) { + this.buffer.getChannelData(i).reverse(); + } + + this.reversed = !this.reversed; + + if (this.isPlaying() && currentPos) { + this.jump(this.duration() - currentPos); + } + + this.setVolume(curVol, 0.001); + } else { + throw "SoundFile is not done loading"; + } + }, + /** + * Schedule an event to be called when the soundfile + * reaches the end of a buffer. If the soundfile is + * playing through once, this will be called when it + * ends. If it is looping, it will be called when + * stop is called. + * + * @method onended + * @for p5.SoundFile + * @param {Function} callback function to call when the + * soundfile has ended. + */ + }, + { + key: "onended", + value: function onended(callback) { + this._onended = callback; + return this; + }, + }, + { + key: "add", + value: function add() {}, + }, + { + key: "dispose", + value: function dispose() { + var now = main.audiocontext.currentTime; + + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.stop(now); + + if (this.buffer && this.bufferSourceNode) { + for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { + if (this.bufferSourceNodes[i] !== null) { + this.bufferSourceNodes[i].disconnect(); + + try { + this.bufferSourceNodes[i].stop(now); + } catch (e) { + console.warn("no buffer source node to dispose"); + } + + this.bufferSourceNodes[i] = null; + } + } + + if (this.isPlaying()) { + try { + this._counterNode.stop(now); + } catch (e) { + console.log(e); + } + + this._counterNode = null; + } + } + + if (this.output) { + this.output.disconnect(); + this.output = null; + } + + if (this.panner) { + this.panner.disconnect(); + this.panner = null; + } + }, + /** + * Connects the output of a p5sound object to input of another + * p5.sound object. For example, you may connect a p5.SoundFile to an + * FFT or an Effect. If no parameter is given, it will connect to + * the main output. Most p5sound objects connect to the master + * output when they are created. + * + * @method connect + * @for p5.SoundFile + * @param {Object} [object] Audio object that accepts an input + */ + }, + { + key: "connect", + value: function connect(unit) { + if (!unit) { + this.panner.connect(main.input); + } else { + if (unit.hasOwnProperty("input")) { + this.panner.connect(unit.input); + } else { + this.panner.connect(unit); + } + } + }, + /** + * Disconnects the output of this p5sound object. + * + * @method disconnect + * @for p5.SoundFile + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.panner) { + this.panner.disconnect(); + } + }, + /** + */ + }, + { + key: "getLevel", + value: function getLevel() { + console.warn( + "p5.SoundFile.getLevel has been removed from the library. Use p5.Amplitude instead", + ); + }, + /** + * Reset the source for this SoundFile to a + * new path (URL). + * + * @method setPath + * @for p5.SoundFile + * @param {String} path path to audio file + * @param {Function} callback Callback + */ + }, + { + key: "setPath", + value: function setPath(p, callback) { + var path = p5.prototype._checkFileFormats(p); + + this.url = path; + this.load(callback); + }, + /** + * Replace the current Audio Buffer with a new Buffer. + * + * @method setBuffer + * @for p5.SoundFile + * @param {Array} buf Array of Float32 Array(s). 2 Float32 Arrays + * will create a stereo source. 1 will create + * a mono source. + */ + }, + { + key: "setBuffer", + value: function setBuffer(buf) { + var numChannels = buf.length; + var size = buf[0].length; + var newBuffer = soundfile_ac.createBuffer( + numChannels, + size, + soundfile_ac.sampleRate, + ); + + if (!(buf[0] instanceof Float32Array)) { + buf[0] = new Float32Array(buf[0]); + } + + for (var channelNum = 0; channelNum < numChannels; channelNum++) { + var channel = newBuffer.getChannelData(channelNum); + channel.set(buf[channelNum]); + } + + this.buffer = newBuffer; + + this.panner.inputChannels(numChannels); + }, + }, + { + key: "_initCounterNode", + value: function _initCounterNode() { + var _this = this; + + var self = this; + var now = soundfile_ac.currentTime; + var cNode = soundfile_ac.createBufferSource(); + var workletBufferSize = safeBufferSize(256); + + if (self._workletNode) { + self._workletNode.disconnect(); + + delete self._workletNode; + } + + self._workletNode = new AudioWorkletNode( + soundfile_ac, + processorNames_default.a.soundFileProcessor, + { + processorOptions: { + bufferSize: workletBufferSize, + }, + }, + ); + + self._workletNode.port.onmessage = function (event) { + if (event.data.name === "position") { + if (event.data.position === 0) { + return; + } + + _this._lastPos = event.data.position; + + _this._onTimeUpdate(self._lastPos); + } + }; + + cNode.buffer = _createCounterBuffer(self.buffer); + cNode.playbackRate.setValueAtTime(self.playbackRate, now); + cNode.connect(self._workletNode); + + self._workletNode.connect(p5.soundOut._silentNode); + + return cNode; + }, + }, + { + key: "_initSourceNode", + value: function _initSourceNode() { + var bufferSourceNode = soundfile_ac.createBufferSource(); + bufferSourceNode.buffer = this.buffer; + bufferSourceNode.playbackRate.value = this.playbackRate; + bufferSourceNode.connect(this.output); + return bufferSourceNode; + }, + }, + { + key: "processPeaks", + value: function processPeaks( + callback, + _initThreshold, + _minThreshold, + _minPeaks, + ) { + console.warn("processPeaks is deprecated"); + }, + /** + * Schedule events to trigger every time a MediaElement + * (audio/video) reaches a playback cue point. + * + * Accepts a callback function, a time (in seconds) at which to trigger + * the callback, and an optional parameter for the callback. + * + * Time will be passed as the first parameter to the callback function, + * and param will be the second parameter. + * + * + * @method addCue + * @for p5.SoundFile + * @param {Number} time Time in seconds, relative to this media + * element's playback. For example, to trigger + * an event every time playback reaches two + * seconds, pass in the number 2. This will be + * passed as the first parameter to + * the callback function. + * @param {Function} callback Name of a function that will be + * called at the given time. The callback will + * receive time and (optionally) param as its + * two parameters. + * @param {Object} [value] An object to be passed as the + * second parameter to the + * callback function. + * @return {Number} id ID of this cue, + * useful for removeCue(id) + * @example + *
            + * let mySound; + * function preload() { + * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play', 10, 20); + * + * // schedule calls to changeText + * mySound.addCue(0, changeText, "hello" ); + * mySound.addCue(0.5, changeText, "hello," ); + * mySound.addCue(1, changeText, "hello, p5!"); + * mySound.addCue(1.5, changeText, "hello, p5!!"); + * mySound.addCue(2, changeText, "hello, p5!!!!!"); + * } + * + * function changeText(val) { + * background(220); + * text(val, 10, 20); + * } + * + * function canvasPressed() { + * mySound.play(); + * } + *
            + */ + }, + { + key: "addCue", + value: function addCue(time, callback, val) { + var id = this._cueIDCounter++; + var cue = new Cue(callback, time, id, val); + + this._cues.push(cue); + + return id; + }, + /** + * Remove a callback based on its ID. The ID is returned by the + * addCue method. + * + * @method removeCue + * @for p5.SoundFile + * @param {Number} id ID of the cue, as returned by addCue + */ + }, + { + key: "removeCue", + value: function removeCue(id) { + var cueLength = this._cues.length; + + for (var i = 0; i < cueLength; i++) { + var cue = this._cues[i]; + + if (cue.id === id) { + this._cues.splice(i, 1); + + break; + } + } + + if (this._cues.length === 0) { + } + }, + /** + * Remove all of the callbacks that had originally been scheduled + * via the addCue method. + * + * @method clearCues + */ + }, + { + key: "clearCues", + value: function clearCues() { + this._cues = []; + }, + }, + { + key: "_onTimeUpdate", + value: function _onTimeUpdate(position) { + var playbackTime = position / this.buffer.sampleRate; + var cueLength = this._cues.length; + + for (var i = 0; i < cueLength; i++) { + var cue = this._cues[i]; + var callbackTime = cue.time; + var val = cue.val; + var leftLimit = this._prevUpdateTime || 0; + var rightLimit = playbackTime; + + if (leftLimit <= callbackTime && callbackTime <= rightLimit) { + cue.callback(val); + } + } + + this._prevUpdateTime = playbackTime; + }, + /** + * Save a p5.SoundFile as a .wav file. The browser will prompt the user + * to download the file to their device. To upload a file to a server, see + * getBlob + * + * @method save + * @for p5.SoundFile + * @param {String} [fileName] name of the resulting .wav file. + * @example + *
            + * let mySound; + * function preload() { + * mySound = loadSound('assets/doorbell.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to download', 10, 20); + * } + * + * function canvasPressed() { + * mySound.save('my cool filename'); + * } + *
            + */ + }, + { + key: "save", + value: function save(fileName) { + p5.prototype.saveSound(this, fileName, "wav"); + }, + /** + * This method is useful for sending a SoundFile to a server. It returns the + * .wav-encoded audio data as a "Blob". + * A Blob is a file-like data object that can be uploaded to a server + * with an http request. We'll + * use the `httpDo` options object to send a POST request with some + * specific options: we encode the request as `multipart/form-data`, + * and attach the blob as one of the form values using `FormData`. + * + * + * @method getBlob + * @for p5.SoundFile + * @returns {Blob} A file-like data object + * @example + *
            + * function preload() { + * mySound = loadSound('assets/doorbell.mp3'); + * } + * + * function setup() { + * noCanvas(); + * let soundBlob = mySound.getBlob(); + * + * // Now we can send the blob to a server... + * let serverUrl = 'https://jsonplaceholder.typicode.com/posts'; + * let httpRequestOptions = { + * method: 'POST', + * body: new FormData().append('soundBlob', soundBlob), + * headers: new Headers({ + * 'Content-Type': 'multipart/form-data' + * }) + * }; + * httpDo(serverUrl, httpRequestOptions); + * + * // We can also create an `ObjectURL` pointing to the Blob + * let blobUrl = URL.createObjectURL(soundBlob); + * + * // The `
            + */ + }, + { + key: "getBlob", + value: function getBlob() { + var dataView = convertToWav(this.buffer); + return new Blob([dataView], { + type: "audio/wav", + }); + }, + }, + ]); + + return SoundFile; + })(); + /** + * loadSound() returns a new p5.SoundFile from a specified + * path. If called during preload(), the p5.SoundFile will be ready + * to play in time for setup() and draw(). If called outside of + * preload, the p5.SoundFile will not be ready immediately, so + * loadSound accepts a callback as the second parameter. Using a + * + * local server is recommended when loading external files. + * + * @method loadSound + * @for p5 + * @param {String|Array} path Path to the sound file, or an array with + * paths to soundfiles in multiple formats + * i.e. ['sound.ogg', 'sound.mp3']. + * Alternately, accepts an object: either + * from the HTML5 File API, or a p5.File. + * @param {Function} [successCallback] Name of a function to call once file loads + * @param {Function} [errorCallback] Name of a function to call if there is + * an error loading the file. + * @param {Function} [whileLoading] Name of a function to call while file is loading. + * This function will receive the percentage loaded + * so far, from 0.0 to 1.0. + * @return {SoundFile} Returns a p5.SoundFile + * @example + *
            + * let mySound; + * function preload() { + * soundFormats('mp3', 'ogg'); + * mySound = loadSound('assets/doorbell'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap here to play', 10, 20); + * } + * + * function canvasPressed() { + * // playing a sound file on a user gesture + * // is equivalent to `userStartAudio()` + * mySound.play(); + * } + *
            + */ + + function loadSound(path, callback, onerror, whileLoading) { + if ( + window.location.origin.indexOf("file://") > -1 && + window.cordova === "undefined" + ) { + window.alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ); + } + + var self = this; + var s = new soundfile_SoundFile( + path, + function () { + if (typeof callback === "function") { + callback.apply(self, arguments); + } + + if (typeof self._decrementPreload === "function") { + self._decrementPreload(); + } + }, + onerror, + whileLoading, + ); + return s; + } + + var soundfile = soundfile_SoundFile; + + function amplitude_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function amplitude_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function amplitude_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + amplitude_defineProperties(Constructor.prototype, protoProps); + if (staticProps) amplitude_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * Amplitude measures volume between 0.0 and 1.0. + * Listens to all p5sound by default, or use setInput() + * to listen to a specific sound source. Accepts an optional + * smoothing value, which defaults to 0. + * + * @class p5.Amplitude + * @constructor + * @param {Number} [smoothing] between 0.0 and .999 to smooth + * amplitude readings (defaults to 0) + * @example + *
            + * let sound, amplitude; + * + * function preload(){ + * sound = loadSound('assets/beat.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100,100); + * cnv.mouseClicked(togglePlay); + * amplitude = new p5.Amplitude(); + * } + * + * function draw() { + * background(220); + * text('tap to play', 20, 20); + * + * let level = amplitude.getLevel(); + * let size = map(level, 0, 1, 0, 200); + * ellipse(width/2, height/2, size, size); + * } + * + * function togglePlay() { + * if (sound.isPlaying() ){ + * sound.pause(); + * } else { + * sound.loop(); + * amplitude = new p5.Amplitude(); + * amplitude.setInput(sound); + * } + * } + * + *
            + */ + + var amplitude_Amplitude = (function () { + function Amplitude(smoothing) { + amplitude_classCallCheck(this, Amplitude); + + this.bufferSize = safeBufferSize(2048); + + this.audiocontext = main.audiocontext; + this._workletNode = new AudioWorkletNode( + this.audiocontext, + processorNames_default.a.amplitudeProcessor, + { + outputChannelCount: [1], + parameterData: { + smoothing: smoothing || 0, + }, + processorOptions: { + normalize: false, + smoothing: smoothing || 0, + numInputChannels: 2, + bufferSize: this.bufferSize, + }, + }, + ); + + this._workletNode.port.onmessage = function (event) { + if (event.data.name === "amplitude") { + this.volume = event.data.volume; + this.volNorm = event.data.volNorm; + this.stereoVol = event.data.stereoVol; + this.stereoVolNorm = event.data.stereoVolNorm; + } + }.bind(this); + + this.input = this._workletNode; + this.output = this.audiocontext.createGain(); + + this.volume = 0; + this.volNorm = 0; + this.stereoVol = [0, 0]; + this.stereoVolNorm = [0, 0]; + this.normalize = false; + + this._workletNode.connect(this.output); + + this.output.gain.value = 0; + + this.output.connect(this.audiocontext.destination); + + main.meter.connect(this._workletNode); + + main.soundArray.push(this); + } + /** + * Connects to the p5sound instance (main output) by default. + * Optionally, you can pass in a specific source (i.e. a soundfile). + * + * @method setInput + * @for p5.Amplitude + * @param {soundObject|undefined} [snd] set the sound source + * (optional, defaults to + * main output) + * @param {Number|undefined} [smoothing] a range between 0.0 and 1.0 + * to smooth amplitude readings + * @example + *
            + * function preload(){ + * sound1 = loadSound('assets/beat.mp3'); + * sound2 = loadSound('assets/drum.mp3'); + * } + * function setup(){ + * cnv = createCanvas(100, 100); + * cnv.mouseClicked(toggleSound); + * + * amplitude = new p5.Amplitude(); + * amplitude.setInput(sound2); + * } + * + * function draw() { + * background(220); + * text('tap to play', 20, 20); + * + * let level = amplitude.getLevel(); + * let size = map(level, 0, 1, 0, 200); + * ellipse(width/2, height/2, size, size); + * } + * + * function toggleSound(){ + * if (sound1.isPlaying() && sound2.isPlaying()) { + * sound1.stop(); + * sound2.stop(); + * } else { + * sound1.play(); + * sound2.play(); + * } + * } + *
            + */ + + amplitude_createClass(Amplitude, [ + { + key: "setInput", + value: function setInput(source, smoothing) { + main.meter.disconnect(); + + if (smoothing) { + this._workletNode.parameters.get("smoothing").value = smoothing; + } + + if (source == null) { + console.log( + "Amplitude input source is not ready! Connecting to main output instead", + ); + main.meter.connect(this._workletNode); + } else if (source) { + source.connect(this._workletNode); + + this._workletNode.disconnect(); + + this._workletNode.connect(this.output); + } else { + main.meter.connect(this._workletNode); + } + }, + }, + { + key: "connect", + value: function connect(unit) { + if (unit) { + if (unit.hasOwnProperty("input")) { + this.output.connect(unit.input); + } else { + this.output.connect(unit); + } + } else { + this.output.connect(this.panner.connect(main.input)); + } + }, + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + }, + /** + * Returns a single Amplitude reading at the moment it is called. + * For continuous readings, run in the draw loop. + * + * @method getLevel + * @for p5.Amplitude + * @param {Number} [channel] Optionally return only channel 0 (left) or 1 (right) + * @return {Number} Amplitude as a number between 0.0 and 1.0 + * @example + *
            + * function preload(){ + * sound = loadSound('assets/beat.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mouseClicked(toggleSound); + * amplitude = new p5.Amplitude(); + * } + * + * function draw() { + * background(220, 150); + * textAlign(CENTER); + * text('tap to play', width/2, 20); + * + * let level = amplitude.getLevel(); + * let size = map(level, 0, 1, 0, 200); + * ellipse(width/2, height/2, size, size); + * } + * + * function toggleSound(){ + * if (sound.isPlaying()) { + * sound.stop(); + * } else { + * sound.play(); + * } + * } + *
            + */ + }, + { + key: "getLevel", + value: function getLevel(channel) { + if (typeof channel !== "undefined") { + if (this.normalize) { + return this.stereoVolNorm[channel]; + } else { + return this.stereoVol[channel]; + } + } else if (this.normalize) { + return this.volNorm; + } else { + return this.volume; + } + }, + /** + * Determines whether the results of Amplitude.process() will be + * Normalized. To normalize, Amplitude finds the difference the + * loudest reading it has processed and the maximum amplitude of + * 1.0. Amplitude adds this difference to all values to produce + * results that will reliably map between 0.0 and 1.0. However, + * if a louder moment occurs, the amount that Normalize adds to + * all the values will change. Accepts an optional boolean parameter + * (true or false). Normalizing is off by default. + * + * @method toggleNormalize + * @for p5.Amplitude + * @param {boolean} [boolean] set normalize to true (1) or false (0) + */ + }, + { + key: "toggleNormalize", + value: function toggleNormalize(bool) { + if (typeof bool === "boolean") { + this.normalize = bool; + } else { + this.normalize = !this.normalize; + } + + this._workletNode.port.postMessage({ + name: "toggleNormalize", + normalize: this.normalize, + }); + }, + /** + * Smooth Amplitude analysis by averaging with the last analysis + * frame. Off by default. + * + * @method smooth + * @for p5.Amplitude + * @param {Number} set smoothing from 0.0 <= 1 + */ + }, + { + key: "smooth", + value: function smooth(s) { + if (s >= 0 && s < 1) { + this._workletNode.port.postMessage({ + name: "smoothing", + smoothing: s, + }); + } else { + console.log("Error: smoothing must be between 0 and 1"); + } + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.input) { + this.input.disconnect(); + delete this.input; + } + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + + this._workletNode.disconnect(); + + delete this._workletNode; + }, + }, + ]); + + return Amplitude; + })(); + + var amplitude = amplitude_Amplitude; + function fft_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function fft_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function fft_createClass(Constructor, protoProps, staticProps) { + if (protoProps) fft_defineProperties(Constructor.prototype, protoProps); + if (staticProps) fft_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + *

            FFT (Fast Fourier Transform) is an analysis algorithm that + * isolates individual + * + * audio frequencies within a waveform.

            + * + *

            Once instantiated, a p5.FFT object can return an array based on + * two types of analyses:
            FFT.waveform() computes + * amplitude values along the time domain. The array indices correspond + * to samples across a brief moment in time. Each value represents + * amplitude of the waveform at that sample of time.
            + * • FFT.analyze() computes amplitude values along the + * frequency domain. The array indices correspond to frequencies (i.e. + * pitches), from the lowest to the highest that humans can hear. Each + * value represents amplitude at that slice of the frequency spectrum. + * Use with getEnergy() to measure amplitude at specific + * frequencies, or within a range of frequencies.

            + * + *

            FFT analyzes a very short snapshot of sound called a sample + * buffer. It returns an array of amplitude measurements, referred + * to as bins. The array is 1024 bins long by default. + * You can change the bin array length, but it must be a power of 2 + * between 16 and 1024 in order for the FFT algorithm to function + * correctly. The actual size of the FFT buffer is twice the + * number of bins, so given a standard sample rate, the buffer is + * 2048/44100 seconds long.

            + * + * + * @class p5.FFT + * @constructor + * @param {Number} [smoothing] Smooth results of Freq Spectrum. + * 0.0 < smoothing < 1.0. + * Defaults to 0.8. + * @param {Number} [bins] Length of resulting array. + * Must be a power of two between + * 16 and 1024. Defaults to 1024. + * @example + *
            + * function preload(){ + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup(){ + * let cnv = createCanvas(100,100); + * cnv.mouseClicked(togglePlay); + * fft = new p5.FFT(); + * sound.amp(0.2); + * } + * + * function draw(){ + * background(220); + * + * let spectrum = fft.analyze(); + * noStroke(); + * fill(255, 0, 255); + * for (let i = 0; i< spectrum.length; i++){ + * let x = map(i, 0, spectrum.length, 0, width); + * let h = -height + map(spectrum[i], 0, 255, height, 0); + * rect(x, height, width / spectrum.length, h ) + * } + * + * let waveform = fft.waveform(); + * noFill(); + * beginShape(); + * stroke(20); + * for (let i = 0; i < waveform.length; i++){ + * let x = map(i, 0, waveform.length, 0, width); + * let y = map( waveform[i], -1, 1, 0, height); + * vertex(x,y); + * } + * endShape(); + * + * text('tap to play', 20, 20); + * } + * + * function togglePlay() { + * if (sound.isPlaying()) { + * sound.pause(); + * } else { + * sound.loop(); + * } + * } + *
            + */ + + var fft_FFT = (function () { + function FFT(smoothing, bins) { + fft_classCallCheck(this, FFT); + + this.input = this.analyser = main.audiocontext.createAnalyser(); + Object.defineProperties(this, { + bins: { + get: function get() { + return this.analyser.fftSize / 2; + }, + set: function set(b) { + this.analyser.fftSize = b * 2; + }, + configurable: true, + enumerable: true, + }, + smoothing: { + get: function get() { + return this.analyser.smoothingTimeConstant; + }, + set: function set(s) { + this.analyser.smoothingTimeConstant = s; + }, + configurable: true, + enumerable: true, + }, + }); + + this.smooth(smoothing); + this.bins = bins || 1024; + + main.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, 14000]; + + main.soundArray.push(this); + } + /** + * Set the input source for the FFT analysis. If no source is + * provided, FFT will analyze all sound in the sketch. + * + * @method setInput + * @for p5.FFT + * @param {Object} [source] p5.sound object (or web audio API source node) + */ + + fft_createClass(FFT, [ + { + key: "setInput", + value: function setInput(source) { + if (!source) { + main.fftMeter.connect(this.analyser); + } else { + if (source.output) { + source.output.connect(this.analyser); + } else if (source.connect) { + source.connect(this.analyser); + } + + main.fftMeter.disconnect(); + } + }, + /** + * Returns an array of amplitude values (between -1.0 and +1.0) that represent + * a snapshot of amplitude readings in a single buffer. Length will be + * equal to bins (defaults to 1024). Can be used to draw the waveform + * of a sound. + * + * @method waveform + * @for p5.FFT + * @param {Number} [bins] Must be a power of two between + * 16 and 1024. Defaults to 1024. + * @param {String} [precision] If any value is provided, will return results + * in a Float32 Array which is more precise + * than a regular array. + * @return {Array} Array Array of amplitude values (-1 to 1) + * over time. Array length = bins. + * + */ + }, + { + key: "waveform", + value: function waveform() { + var bins, mode; + var normalArray = new Array(); + + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] === "number") { + bins = arguments[i]; + this.analyser.fftSize = bins * 2; + } + + if (typeof arguments[i] === "string") { + mode = arguments[i]; + } + } + + if (mode && !p5.prototype._isSafari()) { + timeToFloat(this, this.timeDomain); + this.analyser.getFloatTimeDomainData(this.timeDomain); + return this.timeDomain; + } else { + timeToInt(this, this.timeDomain); + this.analyser.getByteTimeDomainData(this.timeDomain); + + for (var j = 0; j < this.timeDomain.length; j++) { + var scaled = p5.prototype.map( + this.timeDomain[j], + 0, + 255, + -1, + 1, + ); + normalArray.push(scaled); + } + + return normalArray; + } + }, + /** + * Returns an array of amplitude values (between 0 and 255) + * across the frequency spectrum. Length is equal to FFT bins + * (1024 by default). The array indices correspond to frequencies + * (i.e. pitches), from the lowest to the highest that humans can + * hear. Each value represents amplitude at that slice of the + * frequency spectrum. Must be called prior to using + * getEnergy(). + * + * @method analyze + * @for p5.FFT + * @param {Number} [bins] Must be a power of two between + * 16 and 1024. Defaults to 1024. + * @param {Number} [scale] If "dB," returns decibel + * float measurements between + * -140 and 0 (max). + * Otherwise returns integers from 0-255. + * @return {Array} spectrum Array of energy (amplitude/volume) + * values across the frequency spectrum. + * Lowest energy (silence) = 0, highest + * possible is 255. + * @example + *
            + * let osc, fft; + * + * function setup(){ + * let cnv = createCanvas(100,100); + * cnv.mousePressed(startSound); + * osc = new p5.Oscillator(); + * osc.amp(0); + * fft = new p5.FFT(); + * } + * + * function draw(){ + * background(220); + * + * let freq = map(mouseX, 0, windowWidth, 20, 10000); + * freq = constrain(freq, 1, 20000); + * osc.freq(freq); + * + * let spectrum = fft.analyze(); + * noStroke(); + * fill(255, 0, 255); + * for (let i = 0; i< spectrum.length; i++){ + * let x = map(i, 0, spectrum.length, 0, width); + * let h = -height + map(spectrum[i], 0, 255, height, 0); + * rect(x, height, width / spectrum.length, h ); + * } + * + * stroke(255); + * if (!osc.started) { + * text('tap here and drag to change frequency', 10, 20, width - 20); + * } else { + * text(round(freq)+'Hz', 10, 20); + * } + * } + * + * function startSound() { + * osc.start(); + * osc.amp(0.5, 0.2); + * } + * + * function mouseReleased() { + * osc.amp(0, 0.2); + * } + *
            + * + * + */ + }, + { + key: "analyze", + value: function analyze() { + var mode; + + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] === "number") { + this.bins = arguments[i]; + this.analyser.fftSize = this.bins * 2; + } + + if (typeof arguments[i] === "string") { + mode = arguments[i]; + } + } + + if (mode && mode.toLowerCase() === "db") { + freqToFloat(this); + this.analyser.getFloatFrequencyData(this.freqDomain); + return this.freqDomain; + } else { + freqToInt(this, this.freqDomain); + this.analyser.getByteFrequencyData(this.freqDomain); + var normalArray = Array.apply([], this.freqDomain); + return normalArray; + } + }, + /** + * Returns the amount of energy (volume) at a specific + * + * frequency, or the average amount of energy between two + * frequencies. Accepts Number(s) corresponding + * to frequency (in Hz), or a "string" corresponding to predefined + * frequency ranges ("bass", "lowMid", "mid", "highMid", "treble"). + * Returns a range between 0 (no energy/volume at that frequency) and + * 255 (maximum energy). + * NOTE: analyze() must be called prior to getEnergy(). analyze() + * tells the FFT to analyze frequency data, and getEnergy() uses + * the results to determine the value at a specific frequency or + * range of frequencies.

            + * + * @method getEnergy + * @for p5.FFT + * @param {Number|String} frequency1 Will return a value representing + * energy at this frequency. Alternately, + * the strings "bass", "lowMid" "mid", + * "highMid", and "treble" will return + * predefined frequency ranges. + * @param {Number} [frequency2] If a second frequency is given, + * will return average amount of + * energy that exists between the + * two frequencies. + * @return {Number} Energy Energy (volume/amplitude) from + * 0 and 255. + * + */ + }, + { + key: "getEnergy", + value: function getEnergy(frequency1, frequency2) { + var nyquist = main.audiocontext.sampleRate / 2; + + if (frequency1 === "bass") { + frequency1 = this.bass[0]; + frequency2 = this.bass[1]; + } else if (frequency1 === "lowMid") { + frequency1 = this.lowMid[0]; + frequency2 = this.lowMid[1]; + } else if (frequency1 === "mid") { + frequency1 = this.mid[0]; + frequency2 = this.mid[1]; + } else if (frequency1 === "highMid") { + frequency1 = this.highMid[0]; + frequency2 = this.highMid[1]; + } else if (frequency1 === "treble") { + frequency1 = this.treble[0]; + frequency2 = this.treble[1]; + } + + if (typeof frequency1 !== "number") { + throw "invalid input for getEnergy()"; + } else if (!frequency2) { + var index = Math.round( + (frequency1 / nyquist) * this.freqDomain.length, + ); + return this.freqDomain[index]; + } else if (frequency1 && frequency2) { + if (frequency1 > frequency2) { + var swap = frequency2; + frequency2 = frequency1; + frequency1 = swap; + } + + var lowIndex = Math.round( + (frequency1 / nyquist) * this.freqDomain.length, + ); + var highIndex = Math.round( + (frequency2 / nyquist) * this.freqDomain.length, + ); + var total = 0; + var numFrequencies = 0; + + for (var i = lowIndex; i <= highIndex; i++) { + total += this.freqDomain[i]; + numFrequencies += 1; + } + + var toReturn = total / numFrequencies; + return toReturn; + } else { + throw "invalid input for getEnergy()"; + } + }, + }, + { + key: "getFreq", + value: function getFreq(freq1, freq2) { + console.log( + "getFreq() is deprecated. Please use getEnergy() instead.", + ); + var x = this.getEnergy(freq1, freq2); + return x; + }, + /** + * Returns the + * + * spectral centroid of the input signal. + * NOTE: analyze() must be called prior to getCentroid(). Analyze() + * tells the FFT to analyze frequency data, and getCentroid() uses + * the results determine the spectral centroid.

            + * + * @method getCentroid + * @for p5.FFT + * @return {Number} Spectral Centroid Frequency of the spectral centroid in Hz. + * + * + * @example + *
            + * function setup(){ + * cnv = createCanvas(100,100); + * cnv.mousePressed(userStartAudio); + * sound = new p5.AudioIn(); + * sound.start(); + * fft = new p5.FFT(); + * sound.connect(fft); + *} + * + *function draw() { + * if (getAudioContext().state !== 'running') { + * background(220); + * text('tap here and enable mic to begin', 10, 20, width - 20); + * return; + * } + * let centroidplot = 0.0; + * let spectralCentroid = 0; + * + * background(0); + * stroke(0,255,0); + * let spectrum = fft.analyze(); + * fill(0,255,0); // spectrum is green + * + * //draw the spectrum + * for (let i = 0; i < spectrum.length; i++){ + * let x = map(log(i), 0, log(spectrum.length), 0, width); + * let h = map(spectrum[i], 0, 255, 0, height); + * let rectangle_width = (log(i+1)-log(i))*(width/log(spectrum.length)); + * rect(x, height, rectangle_width, -h ) + * } + * let nyquist = 22050; + * + * // get the centroid + * spectralCentroid = fft.getCentroid(); + * + * // the mean_freq_index calculation is for the display. + * let mean_freq_index = spectralCentroid/(nyquist/spectrum.length); + * + * centroidplot = map(log(mean_freq_index), 0, log(spectrum.length), 0, width); + * + * stroke(255,0,0); // the line showing where the centroid is will be red + * + * rect(centroidplot, 0, width / spectrum.length, height) + * noStroke(); + * fill(255,255,255); // text is white + * text('centroid: ', 10, 20); + * text(round(spectralCentroid)+' Hz', 10, 40); + *} + *
            + */ + }, + { + key: "getCentroid", + value: function getCentroid() { + var nyquist = main.audiocontext.sampleRate / 2; + var cumulative_sum = 0; + var centroid_normalization = 0; + + for (var i = 0; i < this.freqDomain.length; i++) { + cumulative_sum += i * this.freqDomain[i]; + centroid_normalization += this.freqDomain[i]; + } + + var mean_freq_index = 0; + + if (centroid_normalization !== 0) { + mean_freq_index = cumulative_sum / centroid_normalization; + } + + var spec_centroid_freq = + mean_freq_index * (nyquist / this.freqDomain.length); + return spec_centroid_freq; + }, + /** + * Smooth FFT analysis by averaging with the last analysis frame. + * + * @method smooth + * @param {Number} smoothing 0.0 < smoothing < 1.0. + * Defaults to 0.8. + */ + }, + { + key: "smooth", + value: function smooth(s) { + if (typeof s !== "undefined") { + this.smoothing = s; + } + + return this.smoothing; + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.analyser) { + this.analyser.disconnect(); + delete this.analyser; + } + }, + /** + * Returns an array of average amplitude values for a given number + * of frequency bands split equally. N defaults to 16. + * NOTE: analyze() must be called prior to linAverages(). Analyze() + * tells the FFT to analyze frequency data, and linAverages() uses + * the results to group them into a smaller set of averages.

            + * + * @method linAverages + * @for p5.FFT + * @param {Number} N Number of returned frequency groups + * @return {Array} linearAverages Array of average amplitude values for each group + */ + }, + { + key: "linAverages", + value: function linAverages(_N) { + var N = _N || 16; + + var spectrum = this.freqDomain; + var spectrumLength = spectrum.length; + var spectrumStep = Math.floor(spectrumLength / N); + var linearAverages = new Array(N); + + var groupIndex = 0; + + for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { + linearAverages[groupIndex] = + linearAverages[groupIndex] !== undefined + ? (linearAverages[groupIndex] + spectrum[specIndex]) / 2 + : spectrum[specIndex]; + + if (specIndex % spectrumStep === spectrumStep - 1) { + groupIndex++; + } + } + + return linearAverages; + }, + /** + * Returns an array of average amplitude values of the spectrum, for a given + * set of + * Octave Bands + * NOTE: analyze() must be called prior to logAverages(). Analyze() + * tells the FFT to analyze frequency data, and logAverages() uses + * the results to group them into a smaller set of averages.

            + * + * @method logAverages + * @for p5.FFT + * @param {Array} octaveBands Array of Octave Bands objects for grouping + * @return {Array} logAverages Array of average amplitude values for each group + */ + }, + { + key: "logAverages", + value: function logAverages(octaveBands) { + var nyquist = main.audiocontext.sampleRate / 2; + var spectrum = this.freqDomain; + var spectrumLength = spectrum.length; + var logAverages = new Array(octaveBands.length); + + var octaveIndex = 0; + + for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { + var specIndexFrequency = Math.round( + (specIndex * nyquist) / this.freqDomain.length, + ); + + if (specIndexFrequency > octaveBands[octaveIndex].hi) { + octaveIndex++; + } + + logAverages[octaveIndex] = + logAverages[octaveIndex] !== undefined + ? (logAverages[octaveIndex] + spectrum[specIndex]) / 2 + : spectrum[specIndex]; + } + + return logAverages; + }, + /** + * Calculates and Returns the 1/N + * Octave Bands + * N defaults to 3 and minimum central frequency to 15.625Hz. + * (1/3 Octave Bands ~= 31 Frequency Bands) + * Setting fCtr0 to a central value of a higher octave will ignore the lower bands + * and produce less frequency groups. + * + * @method getOctaveBands + * @for p5.FFT + * @param {Number} N Specifies the 1/N type of generated octave bands + * @param {Number} fCtr0 Minimum central frequency for the lowest band + * @return {Array} octaveBands Array of octave band objects with their bounds + */ + }, + { + key: "getOctaveBands", + value: function getOctaveBands(_N, _fCtr0) { + var N = _N || 3; + + var fCtr0 = _fCtr0 || 15.625; + + var octaveBands = []; + var lastFrequencyBand = { + lo: fCtr0 / Math.pow(2, 1 / (2 * N)), + ctr: fCtr0, + hi: fCtr0 * Math.pow(2, 1 / (2 * N)), + }; + octaveBands.push(lastFrequencyBand); + var nyquist = main.audiocontext.sampleRate / 2; + + while (lastFrequencyBand.hi < nyquist) { + var newFrequencyBand = {}; + newFrequencyBand.lo = lastFrequencyBand.hi; + newFrequencyBand.ctr = lastFrequencyBand.ctr * Math.pow(2, 1 / N); + newFrequencyBand.hi = + newFrequencyBand.ctr * Math.pow(2, 1 / (2 * N)); + octaveBands.push(newFrequencyBand); + lastFrequencyBand = newFrequencyBand; + } + + return octaveBands; + }, + }, + ]); + + return FFT; + })(); + + function freqToFloat(fft) { + if (fft.freqDomain instanceof Float32Array === false) { + fft.freqDomain = new Float32Array(fft.analyser.frequencyBinCount); + } + } + + function freqToInt(fft) { + if (fft.freqDomain instanceof Uint8Array === false) { + fft.freqDomain = new Uint8Array(fft.analyser.frequencyBinCount); + } + } + + function timeToFloat(fft) { + if (fft.timeDomain instanceof Float32Array === false) { + fft.timeDomain = new Float32Array(fft.analyser.frequencyBinCount); + } + } + + function timeToInt(fft) { + if (fft.timeDomain instanceof Uint8Array === false) { + fft.timeDomain = new Uint8Array(fft.analyser.frequencyBinCount); + } + } + + var fft = fft_FFT; + var Add = __webpack_require__(4); + var Add_default = __webpack_require__.n(Add); + + var Multiply = __webpack_require__(1); + var Multiply_default = __webpack_require__.n(Multiply); + + var Scale = __webpack_require__(8); + var Scale_default = __webpack_require__.n(Scale); + + function oscillator_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + oscillator_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + oscillator_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return oscillator_typeof(obj); + } + + function _possibleConstructorReturn(self, call) { + if ( + call && + (oscillator_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + + function oscillator_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function oscillator_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function oscillator_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + oscillator_defineProperties(Constructor.prototype, protoProps); + if (staticProps) oscillator_defineProperties(Constructor, staticProps); + return Constructor; + } + + function sigChain(o, mathObj, thisChain, nextChain, type) { + var chainSource = o.oscillator; + + for (var i in o.mathOps) { + if (o.mathOps[i] instanceof type) { + chainSource.disconnect(); + o.mathOps[i].dispose(); + thisChain = i; + + if (thisChain < o.mathOps.length - 2) { + nextChain = o.mathOps[i + 1]; + } + } + } + + if (thisChain === o.mathOps.length - 1) { + o.mathOps.push(nextChain); + } + + if (i > 0) { + chainSource = o.mathOps[i - 1]; + } + + chainSource.disconnect(); + chainSource.connect(mathObj); + mathObj.connect(nextChain); + o.mathOps[thisChain] = mathObj; + return o; + } + /** + *

            Creates a signal that oscillates between -1.0 and 1.0. + * By default, the oscillation takes the form of a sinusoidal + * shape ('sine'). Additional types include 'triangle', + * 'sawtooth' and 'square'. The frequency defaults to + * 440 oscillations per second (440Hz, equal to the pitch of an + * 'A' note).

            + * + *

            Set the type of oscillation with setType(), or by instantiating a + * specific oscillator: p5.SinOsc, p5.TriOsc, p5.SqrOsc, or p5.SawOsc. + *

            + * + * @class p5.Oscillator + * @constructor + * @param {Number} [freq] frequency defaults to 440Hz + * @param {String} [type] type of oscillator. Options: + * 'sine' (default), 'triangle', + * 'sawtooth', 'square' + * @example + *
            + * let osc, playing, freq, amp; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playOscillator); + * osc = new p5.Oscillator('sine'); + * } + * + * function draw() { + * background(220) + * freq = constrain(map(mouseX, 0, width, 100, 500), 100, 500); + * amp = constrain(map(mouseY, height, 0, 0, 1), 0, 1); + * + * text('tap to play', 20, 20); + * text('freq: ' + freq, 20, 40); + * text('amp: ' + amp, 20, 60); + * + * if (playing) { + * // smooth the transitions by 0.1 seconds + * osc.freq(freq, 0.1); + * osc.amp(amp, 0.1); + * } + * } + * + * function playOscillator() { + * // starting an oscillator on a user gesture will enable audio + * // in browsers that have a strict autoplay policy. + * // See also: userStartAudio(); + * osc.start(); + * playing = true; + * } + * + * function mouseReleased() { + * // ramp amplitude to 0 over 0.5 seconds + * osc.amp(0, 0.5); + * playing = false; + * } + *
            + */ + + var oscillator_Oscillator = (function () { + function Oscillator(freq, type) { + oscillator_classCallCheck(this, Oscillator); + + if (typeof freq === "string") { + var f = type; + type = freq; + freq = f; + } + + if (typeof type === "number") { + var _f = type; + type = freq; + freq = _f; + } + + this.started = false; + + this.phaseAmount = undefined; + this.oscillator = main.audiocontext.createOscillator(); + this.f = freq || 440.0; + + this.oscillator.type = type || "sine"; + this.oscillator.frequency.setValueAtTime( + this.f, + main.audiocontext.currentTime, + ); + + this.output = main.audiocontext.createGain(); + this._freqMods = []; + + this.output.gain.value = 0.5; + this.output.gain.setValueAtTime(0.5, main.audiocontext.currentTime); + this.oscillator.connect(this.output); + + this.panPosition = 0.0; + this.connection = main.input; + + this.panner = new panner_0(this.output, this.connection, 1); + + this.mathOps = [this.output]; + + main.soundArray.push(this); + + this.fade = this.amp; + } + /** + * Start an oscillator. + * + * Starting an oscillator on a user gesture will enable audio in browsers + * that have a strict autoplay policy, including Chrome and most mobile + * devices. See also: `userStartAudio()`. + * + * @method start + * @for p5.Oscillator + * @param {Number} [time] startTime in seconds from now. + * @param {Number} [frequency] frequency in Hz. + */ + + oscillator_createClass(Oscillator, [ + { + key: "start", + value: function start(time, f) { + if (this.started) { + var now = main.audiocontext.currentTime; + this.stop(now); + } + + if (!this.started) { + var freq = f || this.f; + var type = this.oscillator.type; + + if (this.oscillator) { + this.oscillator.disconnect(); + delete this.oscillator; + } + + this.oscillator = main.audiocontext.createOscillator(); + this.oscillator.frequency.value = Math.abs(freq); + this.oscillator.type = type; + + this.oscillator.connect(this.output); + time = time || 0; + this.oscillator.start(time + main.audiocontext.currentTime); + this.freqNode = this.oscillator.frequency; + + for (var i in this._freqMods) { + if (typeof this._freqMods[i].connect !== "undefined") { + this._freqMods[i].connect(this.oscillator.frequency); + } + } + + this.started = true; + } + }, + /** + * Stop an oscillator. Accepts an optional parameter + * to determine how long (in seconds from now) until the + * oscillator stops. + * + * @method stop + * @for p5.Oscillator + * @param {Number} secondsFromNow Time, in seconds from now. + */ + }, + { + key: "stop", + value: function stop(time) { + if (this.started) { + var t = time || 0; + var now = main.audiocontext.currentTime; + this.oscillator.stop(t + now); + this.started = false; + } + }, + /** + * Set the amplitude between 0 and 1.0. Or, pass in an object + * such as an oscillator to modulate amplitude with an audio signal. + * + * @method amp + * @for p5.Oscillator + * @param {Number|Object} vol between 0 and 1.0 + * or a modulating signal/oscillator + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @return {AudioParam} gain If no value is provided, + * returns the Web Audio API + * AudioParam that controls + * this oscillator's + * gain/amplitude/volume) + */ + }, + { + key: "amp", + value: function amp(vol) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var tFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + + if (typeof vol === "number") { + var now = main.audiocontext.currentTime; + this.output.gain.linearRampToValueAtTime( + vol, + now + tFromNow + rampTime, + ); + } else if (vol) { + vol.connect(this.output.gain); + } else { + return this.output.gain; + } + }, + /** + * Returns the value of output gain + * + * @method getAmp + * @for p5.Oscillator + * + * @returns {number} Amplitude value between 0.0 and 1.0 + */ + }, + { + key: "getAmp", + value: function getAmp() { + return this.output.gain.value; + }, + /** + * Set frequency of an oscillator to a value. Or, pass in an object + * such as an oscillator to modulate the frequency with an audio signal. + * + * @method freq + * @for p5.Oscillator + * @param {Number|Object} Frequency Frequency in Hz + * or modulating signal/oscillator + * @param {Number} [rampTime] Ramp time (in seconds) + * @param {Number} [timeFromNow] Schedule this event to happen + * at x seconds from now + * @return {AudioParam} Frequency If no value is provided, + * returns the Web Audio API + * AudioParam that controls + * this oscillator's frequency + * @example + *
            + * let osc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playOscillator); + * osc = new p5.Oscillator(300); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function playOscillator() { + * osc.start(); + * osc.amp(0.5); + * // start at 700Hz + * osc.freq(700); + * // ramp to 60Hz over 0.7 seconds + * osc.freq(60, 0.7); + * osc.amp(0, 0.1, 0.7); + * } + *
            + */ + }, + { + key: "freq", + value: function freq(val) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var tFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + + if (typeof val === "number" && !isNaN(val)) { + this.f = val; + var now = main.audiocontext.currentTime; + + if (rampTime === 0) { + this.oscillator.frequency.setValueAtTime(val, tFromNow + now); + } else { + if (val > 0) { + this.oscillator.frequency.exponentialRampToValueAtTime( + val, + tFromNow + rampTime + now, + ); + } else { + this.oscillator.frequency.linearRampToValueAtTime( + val, + tFromNow + rampTime + now, + ); + } + } + + if (this.phaseAmount) { + this.phase(this.phaseAmount); + } + } else if (val) { + if (val.output) { + val = val.output; + } + + val.connect(this.oscillator.frequency); + + this._freqMods.push(val); + } else { + return this.oscillator.frequency; + } + }, + /** + * Returns the value of frequency of oscillator + * + * @method getFreq + * @for p5.Oscillator + * @returns {number} Frequency of oscillator in Hertz + */ + }, + { + key: "getFreq", + value: function getFreq() { + return this.oscillator.frequency.value; + }, + /** + * Set type to 'sine', 'triangle', 'sawtooth' or 'square'. + * + * @method setType + * @for p5.Oscillator + * @param {String} type 'sine', 'triangle', 'sawtooth' or 'square'. + */ + }, + { + key: "setType", + value: function setType(type) { + this.oscillator.type = type; + }, + /** + * Returns current type of oscillator eg. 'sine', 'triangle', 'sawtooth' or 'square'. + * + * @method getType + * @for p5.Oscillator + * @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'. + */ + }, + { + key: "getType", + value: function getType() { + return this.oscillator.type; + }, + /** + * Connect to a p5.sound / Web Audio object. + * + * @method connect + * @for p5.Oscillator + * @param {Object} unit A p5.sound or Web Audio object + */ + }, + { + key: "connect", + value: function connect(unit) { + if (!unit) { + this.panner.connect(main.input); + } else if (unit.hasOwnProperty("input")) { + this.panner.connect(unit.input); + this.connection = unit.input; + } else { + this.panner.connect(unit); + this.connection = unit; + } + }, + /** + * Disconnect all outputs + * + * @method disconnect + * @for p5.Oscillator + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + + if (this.panner) { + this.panner.disconnect(); + + if (this.output) { + this.output.connect(this.panner); + } + } + + this.oscMods = []; + }, + /** + * Pan between Left (-1) and Right (1) + * + * @method pan + * @for p5.Oscillator + * @param {Number} panning Number between -1 and 1 + * @param {Number} timeFromNow schedule this event to happen + * seconds from now + */ + }, + { + key: "pan", + value: function pan(pval, tFromNow) { + this.panPosition = pval; + this.panner.pan(pval, tFromNow); + }, + /** + * Returns the current value of panPosition , between Left (-1) and Right (1) + * + * @method getPan + * @for p5.Oscillator + * + * @returns {number} panPosition of oscillator , between Left (-1) and Right (1) + */ + }, + { + key: "getPan", + value: function getPan() { + return this.panPosition; + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.oscillator) { + var now = main.audiocontext.currentTime; + this.stop(now); + this.disconnect(); + this.panner = null; + this.oscillator = null; + } + + if (this.osc2) { + this.osc2.dispose(); + } + }, + /** + * Set the phase of an oscillator between 0.0 and 1.0. + * In this implementation, phase is a delay time + * based on the oscillator's current frequency. + * + * @method phase + * @for p5.Oscillator + * @param {Number} phase float between 0.0 and 1.0 + */ + }, + { + key: "phase", + value: function phase(p) { + var delayAmt = p5.prototype.map(p, 0, 1.0, 0, 1 / this.f); + var now = main.audiocontext.currentTime; + this.phaseAmount = p; + + if (!this.dNode) { + this.dNode = main.audiocontext.createDelay(); + + this.oscillator.disconnect(); + this.oscillator.connect(this.dNode); + this.dNode.connect(this.output); + } + + this.dNode.delayTime.setValueAtTime(delayAmt, now); + }, + /** + * Add a value to the p5.Oscillator's output amplitude, + * and return the oscillator. Calling this method again + * will override the initial add() with a new value. + * + * @method add + * @for p5.Oscillator + * @param {Number} number Constant number to add + * @return {p5.Oscillator} Oscillator Returns this oscillator + * with scaled output + * + */ + }, + { + key: "add", + value: function add(num) { + var add = new Add_default.a(num); + var thisChain = this.mathOps.length - 1; + var nextChain = this.output; + return sigChain(this, add, thisChain, nextChain, Add_default.a); + }, + /** + * Multiply the p5.Oscillator's output amplitude + * by a fixed value (i.e. turn it up!). Calling this method + * again will override the initial mult() with a new value. + * + * @method mult + * @for p5.Oscillator + * @param {Number} number Constant number to multiply + * @return {p5.Oscillator} Oscillator Returns this oscillator + * with multiplied output + */ + }, + { + key: "mult", + value: function mult(num) { + var mult = new Multiply_default.a(num); + var thisChain = this.mathOps.length - 1; + var nextChain = this.output; + return sigChain( + this, + mult, + thisChain, + nextChain, + Multiply_default.a, + ); + }, + /** + * Scale this oscillator's amplitude values to a given + * range, and return the oscillator. Calling this method + * again will override the initial scale() with new values. + * + * @method scale + * @for p5.Oscillator + * @param {Number} inMin input range minumum + * @param {Number} inMax input range maximum + * @param {Number} outMin input range minumum + * @param {Number} outMax input range maximum + * @return {p5.Oscillator} Oscillator Returns this oscillator + * with scaled output + */ + }, + { + key: "scale", + value: function scale(inMin, inMax, outMin, outMax) { + var mapOutMin, mapOutMax; + + if (arguments.length === 4) { + mapOutMin = p5.prototype.map(outMin, inMin, inMax, 0, 1) - 0.5; + + mapOutMax = p5.prototype.map(outMax, inMin, inMax, 0, 1) - 0.5; + } else { + mapOutMin = arguments[0]; + mapOutMax = arguments[1]; + } + + var scale = new Scale_default.a(mapOutMin, mapOutMax); + var thisChain = this.mathOps.length - 1; + var nextChain = this.output; + return sigChain(this, scale, thisChain, nextChain, Scale_default.a); + }, + }, + ]); + + return Oscillator; + })(); + + /** + * Constructor: new p5.SinOsc(). + * This creates a Sine Wave Oscillator and is + * equivalent to new p5.Oscillator('sine') + * or creating a p5.Oscillator and then calling + * its method setType('sine'). + * See p5.Oscillator for methods. + * + * @class p5.SinOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + var SinOsc = (function (_Oscillator) { + _inherits(SinOsc, _Oscillator); + + function SinOsc(freq) { + oscillator_classCallCheck(this, SinOsc); + + return _possibleConstructorReturn( + this, + _getPrototypeOf(SinOsc).call(this, freq, "sine"), + ); + } + + return SinOsc; + })(oscillator_Oscillator); + /** + * Constructor: new p5.TriOsc(). + * This creates a Triangle Wave Oscillator and is + * equivalent to new p5.Oscillator('triangle') + * or creating a p5.Oscillator and then calling + * its method setType('triangle'). + * See p5.Oscillator for methods. + * + * @class p5.TriOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + var TriOsc = (function (_Oscillator2) { + _inherits(TriOsc, _Oscillator2); + + function TriOsc(freq) { + oscillator_classCallCheck(this, TriOsc); + + return _possibleConstructorReturn( + this, + _getPrototypeOf(TriOsc).call(this, freq, "triangle"), + ); + } + + return TriOsc; + })(oscillator_Oscillator); + /** + * Constructor: new p5.SawOsc(). + * This creates a SawTooth Wave Oscillator and is + * equivalent to new p5.Oscillator('sawtooth') + * or creating a p5.Oscillator and then calling + * its method setType('sawtooth'). + * See p5.Oscillator for methods. + * + * @class p5.SawOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + var SawOsc = (function (_Oscillator3) { + _inherits(SawOsc, _Oscillator3); + + function SawOsc(freq) { + oscillator_classCallCheck(this, SawOsc); + + return _possibleConstructorReturn( + this, + _getPrototypeOf(SawOsc).call(this, freq, "sawtooth"), + ); + } + + return SawOsc; + })(oscillator_Oscillator); + /** + * Constructor: new p5.SqrOsc(). + * This creates a Square Wave Oscillator and is + * equivalent to new p5.Oscillator('square') + * or creating a p5.Oscillator and then calling + * its method setType('square'). + * See p5.Oscillator for methods. + * + * @class p5.SqrOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + var SqrOsc = (function (_Oscillator4) { + _inherits(SqrOsc, _Oscillator4); + + function SqrOsc(freq) { + oscillator_classCallCheck(this, SqrOsc); + + return _possibleConstructorReturn( + this, + _getPrototypeOf(SqrOsc).call(this, freq, "square"), + ); + } + + return SqrOsc; + })(oscillator_Oscillator); + + var oscillator = oscillator_Oscillator; + + var TimelineSignal = __webpack_require__(7); + var TimelineSignal_default = __webpack_require__.n(TimelineSignal); + + /** + *

            Envelopes are pre-defined amplitude distribution over time. + * Typically, envelopes are used to control the output volume + * of an object, a series of fades referred to as Attack, Decay, + * Sustain and Release ( + * ADSR + * ). Envelopes can also control other Web Audio Parameters—for example, a p5.Envelope can + * control an Oscillator's frequency like this: osc.freq(env).

            + *

            Use setRange to change the attack/release level. + * Use setADSR to change attackTime, decayTime, sustainPercent and releaseTime.

            + *

            Use the play method to play the entire envelope, + * the ramp method for a pingable trigger, + * or triggerAttack/ + * triggerRelease to trigger noteOn/noteOff.

            + * + * @class p5.Envelope + * @constructor + * @example + *
            + * let t1 = 0.1; // attack time in seconds + * let l1 = 0.7; // attack level 0.0 to 1.0 + * let t2 = 0.3; // decay time in seconds + * let l2 = 0.1; // decay level 0.0 to 1.0 + * + * let env; + * let triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * text('tap to play', 20, 20); + * cnv.mousePressed(playSound); + * + * env = new p5.Envelope(t1, l1, t2, l2); + * triOsc = new p5.Oscillator('triangle'); + * } + * + * function playSound() { + * // starting the oscillator ensures that audio is enabled. + * triOsc.start(); + * env.play(triOsc); + * } + *
            + */ + + p5.Envelope = function (t1, l1, t2, l2, t3, l3) { + /** + * Time until envelope reaches attackLevel + * @property attackTime + */ + this.aTime = t1 || 0.1; + /** + * Level once attack is complete. + * @property attackLevel + */ + + this.aLevel = l1 || 1; + /** + * Time until envelope reaches decayLevel. + * @property decayTime + */ + + this.dTime = t2 || 0.5; + /** + * Level after decay. The envelope will sustain here until it is released. + * @property decayLevel + */ + + this.dLevel = l2 || 0; + /** + * Duration of the release portion of the envelope. + * @property releaseTime + */ + + this.rTime = t3 || 0; + /** + * Level at the end of the release. + * @property releaseLevel + */ + + this.rLevel = l3 || 0; + this._rampHighPercentage = 0.98; + this._rampLowPercentage = 0.02; + this.output = main.audiocontext.createGain(); + this.control = new TimelineSignal_default.a(); + + this._init(); + + this.control.connect(this.output); + + this.connection = null; + + this.mathOps = [this.control]; + + this.isExponential = false; + + this.sourceToClear = null; + + this.wasTriggered = false; + + main.soundArray.push(this); + }; + + p5.Envelope.prototype._init = function () { + var now = main.audiocontext.currentTime; + var t = now; + this.control.setTargetAtTime(0.00001, t, 0.001); + + this._setRampAD(this.aTime, this.dTime); + }; + /** + * Reset the envelope with a series of time/value pairs. + * + * @method set + * @for p5.Envelope + * @param {Number} attackTime Time (in seconds) before level + * reaches attackLevel + * @param {Number} attackLevel Typically an amplitude between + * 0.0 and 1.0 + * @param {Number} decayTime Time + * @param {Number} decayLevel Amplitude (In a standard ADSR envelope, + * decayLevel = sustainLevel) + * @param {Number} releaseTime Release Time (in seconds) + * @param {Number} releaseLevel Amplitude + * @example + *
            + * let attackTime; + * let l1 = 0.7; // attack level 0.0 to 1.0 + * let t2 = 0.3; // decay time in seconds + * let l2 = 0.1; // decay level 0.0 to 1.0 + * let l3 = 0.2; // release time in seconds + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * + * attackTime = map(mouseX, 0, width, 0.0, 1.0); + * text('attack time: ' + attackTime, 5, height - 20); + * } + * + * // mouseClick triggers envelope if over canvas + * function playSound() { + * env.set(attackTime, l1, t2, l2, l3); + * + * triOsc.start(); + * env.play(triOsc); + * } + *
            + * + */ + + p5.Envelope.prototype.set = function (t1, l1, t2, l2, t3, l3) { + this.aTime = t1; + this.aLevel = l1; + this.dTime = t2 || 0; + this.dLevel = l2 || 0; + this.rTime = t3 || 0; + this.rLevel = l3 || 0; + + this._setRampAD(t1, t2); + }; + /** + * Set values like a traditional + * + * ADSR envelope + * . + * + * @method setADSR + * @for p5.Envelope + * @param {Number} attackTime Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + * @example + *
            + * let attackLevel = 1.0; + * let releaseLevel = 0; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.2; + * let releaseTime = 0.5; + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playEnv); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.amp(env); + * triOsc.freq(220); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * attackTime = map(mouseX, 0, width, 0, 1.0); + * text('attack time: ' + attackTime, 5, height - 40); + * } + * + * function playEnv() { + * triOsc.start(); + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.play(); + * } + *
            + */ + + p5.Envelope.prototype.setADSR = function (aTime, dTime, sPercent, rTime) { + this.aTime = aTime; + this.dTime = dTime || 0; + + this.sPercent = sPercent || 0; + this.dLevel = + typeof sPercent !== "undefined" + ? sPercent * (this.aLevel - this.rLevel) + this.rLevel + : 0; + this.rTime = rTime || 0; + + this._setRampAD(aTime, dTime); + }; + /** + * Set max (attackLevel) and min (releaseLevel) of envelope. + * + * @method setRange + * @for p5.Envelope + * @param {Number} aLevel attack level (defaults to 1) + * @param {Number} rLevel release level (defaults to 0) + * @example + *
            + * let attackLevel = 1.0; + * let releaseLevel = 0; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.2; + * let releaseTime = 0.5; + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playEnv); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.amp(env); + * triOsc.freq(220); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * attackLevel = map(mouseY, height, 0, 0, 1.0); + * text('attack level: ' + attackLevel, 5, height - 20); + * } + * + * function playEnv() { + * triOsc.start(); + * env.setRange(attackLevel, releaseLevel); + * env.play(); + * } + *
            + */ + + p5.Envelope.prototype.setRange = function (aLevel, rLevel) { + this.aLevel = aLevel || 1; + this.rLevel = rLevel || 0; + }; + + p5.Envelope.prototype._setRampAD = function (t1, t2) { + this._rampAttackTime = this.checkExpInput(t1); + this._rampDecayTime = this.checkExpInput(t2); + var TCDenominator = 1.0; + + TCDenominator = Math.log( + 1.0 / this.checkExpInput(1.0 - this._rampHighPercentage), + ); + this._rampAttackTC = t1 / this.checkExpInput(TCDenominator); + TCDenominator = Math.log(1.0 / this._rampLowPercentage); + this._rampDecayTC = t2 / this.checkExpInput(TCDenominator); + }; + + p5.Envelope.prototype.setRampPercentages = function (p1, p2) { + this._rampHighPercentage = this.checkExpInput(p1); + this._rampLowPercentage = this.checkExpInput(p2); + var TCDenominator = 1.0; + + TCDenominator = Math.log( + 1.0 / this.checkExpInput(1.0 - this._rampHighPercentage), + ); + this._rampAttackTC = + this._rampAttackTime / this.checkExpInput(TCDenominator); + TCDenominator = Math.log(1.0 / this._rampLowPercentage); + this._rampDecayTC = + this._rampDecayTime / this.checkExpInput(TCDenominator); + }; + /** + * Assign a parameter to be controlled by this envelope. + * If a p5.Sound object is given, then the p5.Envelope will control its + * output gain. If multiple inputs are provided, the env will + * control all of them. + * + * @method setInput + * @for p5.Envelope + * @param {Object} [...inputs] A p5.sound object or + * Web Audio Param. + */ + + p5.Envelope.prototype.setInput = function () { + for (var i = 0; i < arguments.length; i++) { + this.connect(arguments[i]); + } + }; + /** + * Set whether the envelope ramp is linear (default) or exponential. + * Exponential ramps can be useful because we perceive amplitude + * and frequency logarithmically. + * + * @method setExp + * @for p5.Envelope + * @param {Boolean} isExp true is exponential, false is linear + */ + + p5.Envelope.prototype.setExp = function (isExp) { + this.isExponential = isExp; + }; + + p5.Envelope.prototype.checkExpInput = function (value) { + if (value <= 0) { + value = 0.00000001; + } + + return value; + }; + /** + *

            Play tells the envelope to start acting on a given input. + * If the input is a p5.sound object (i.e. AudioIn, Oscillator, + * SoundFile), then Envelope will control its output volume. + * Envelopes can also be used to control any + * Web Audio Audio Param.

            + * + * @method play + * @for p5.Envelope + * @param {Object} unit A p5.sound object or + * Web Audio Param. + * @param {Number} [startTime] time from now (in seconds) at which to play + * @param {Number} [sustainTime] time to sustain before releasing the envelope + * @example + *
            + * let attackLevel = 1.0; + * let releaseLevel = 0; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.2; + * let releaseTime = 0.5; + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playEnv); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.amp(env); + * triOsc.freq(220); + * triOsc.start(); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * attackTime = map(mouseX, 0, width, 0, 1.0); + * attackLevel = map(mouseY, height, 0, 0, 1.0); + * text('attack time: ' + attackTime, 5, height - 40); + * text('attack level: ' + attackLevel, 5, height - 20); + * } + * + * function playEnv() { + * // ensure that audio is enabled + * userStartAudio(); + * + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.setRange(attackLevel, releaseLevel); + * env.play(); + * } + *
            + */ + + p5.Envelope.prototype.play = function (unit, secondsFromNow, susTime) { + var tFromNow = secondsFromNow || 0; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + this.triggerAttack(unit, tFromNow); + this.triggerRelease(unit, tFromNow + this.aTime + this.dTime + ~~susTime); + }; + /** + * Trigger the Attack, and Decay portion of the Envelope. + * Similar to holding down a key on a piano, but it will + * hold the sustain level until you let go. Input can be + * any p5.sound object, or a + * Web Audio Param. + * + * @method triggerAttack + * @for p5.Envelope + * @param {Object} unit p5.sound Object or Web Audio Param + * @param {Number} secondsFromNow time from now (in seconds) + * @example + *
            + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.3; + * let releaseTime = 0.4; + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * textAlign(CENTER); + * textSize(10); + * text('tap to triggerAttack', width/2, height/2); + * + * env = new p5.Envelope(); + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.setRange(1.0, 0.0); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.freq(220); + * + * cnv.mousePressed(envAttack); + * } + * + * function envAttack() { + * background(0, 255, 255); + * text('release to release', width/2, height/2); + * + * // ensures audio is enabled. See also: `userStartAudio` + * triOsc.start(); + * + * env.triggerAttack(triOsc); + * } + * + * function mouseReleased() { + * background(220); + * text('tap to triggerAttack', width/2, height/2); + * + * env.triggerRelease(triOsc); + * } + *
            + */ + + p5.Envelope.prototype.triggerAttack = function (unit, secondsFromNow) { + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + this.lastAttack = t; + this.wasTriggered = true; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + var valToSet = this.control.getValueAtTime(t); + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime( + this.checkExpInput(valToSet), + t, + ); + } else { + this.control.linearRampToValueAtTime(valToSet, t); + } + + t += this.aTime; + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime( + this.checkExpInput(this.aLevel), + t, + ); + valToSet = this.checkExpInput(this.control.getValueAtTime(t)); + this.control.cancelScheduledValues(t); + this.control.exponentialRampToValueAtTime(valToSet, t); + } else { + this.control.linearRampToValueAtTime(this.aLevel, t); + valToSet = this.control.getValueAtTime(t); + this.control.cancelScheduledValues(t); + this.control.linearRampToValueAtTime(valToSet, t); + } + + t += this.dTime; + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime( + this.checkExpInput(this.dLevel), + t, + ); + valToSet = this.checkExpInput(this.control.getValueAtTime(t)); + this.control.cancelScheduledValues(t); + this.control.exponentialRampToValueAtTime(valToSet, t); + } else { + this.control.linearRampToValueAtTime(this.dLevel, t); + valToSet = this.control.getValueAtTime(t); + this.control.cancelScheduledValues(t); + this.control.linearRampToValueAtTime(valToSet, t); + } + }; + /** + * Trigger the Release of the Envelope. This is similar to releasing + * the key on a piano and letting the sound fade according to the + * release level and release time. + * + * @method triggerRelease + * @for p5.Envelope + * @param {Object} unit p5.sound Object or Web Audio Param + * @param {Number} secondsFromNow time to trigger the release + * @example + *
            + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.3; + * let releaseTime = 0.4; + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * textAlign(CENTER); + * textSize(10); + * text('tap to triggerAttack', width/2, height/2); + * + * env = new p5.Envelope(); + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.setRange(1.0, 0.0); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.freq(220); + * + * cnv.mousePressed(envAttack); + * } + * + * function envAttack() { + * background(0, 255, 255); + * text('release to release', width/2, height/2); + * + * // ensures audio is enabled. See also: `userStartAudio` + * triOsc.start(); + * + * env.triggerAttack(triOsc); + * } + * + * function mouseReleased() { + * background(220); + * text('tap to triggerAttack', width/2, height/2); + * + * env.triggerRelease(triOsc); + * } + *
            + */ + + p5.Envelope.prototype.triggerRelease = function (unit, secondsFromNow) { + if (!this.wasTriggered) { + return; + } + + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + var valToSet = this.control.getValueAtTime(t); + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime( + this.checkExpInput(valToSet), + t, + ); + } else { + this.control.linearRampToValueAtTime(valToSet, t); + } + + t += this.rTime; + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime( + this.checkExpInput(this.rLevel), + t, + ); + valToSet = this.checkExpInput(this.control.getValueAtTime(t)); + this.control.cancelScheduledValues(t); + this.control.exponentialRampToValueAtTime(valToSet, t); + } else { + this.control.linearRampToValueAtTime(this.rLevel, t); + valToSet = this.control.getValueAtTime(t); + this.control.cancelScheduledValues(t); + this.control.linearRampToValueAtTime(valToSet, t); + } + + this.wasTriggered = false; + }; + /** + * Exponentially ramp to a value using the first two + * values from setADSR(attackTime, decayTime) + * as + * time constants for simple exponential ramps. + * If the value is higher than current value, it uses attackTime, + * while a decrease uses decayTime. + * + * @method ramp + * @for p5.Envelope + * @param {Object} unit p5.sound Object or Web Audio Param + * @param {Number} secondsFromNow When to trigger the ramp + * @param {Number} v Target value + * @param {Number} [v2] Second target value + * @example + *
            + * let env, osc, amp; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let attackLevel = 1; + * let decayLevel = 0; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * fill(0,255,0); + * noStroke(); + * + * env = new p5.Envelope(); + * env.setADSR(attackTime, decayTime); + * osc = new p5.Oscillator(); + * osc.amp(env); + * amp = new p5.Amplitude(); + * + * cnv.mousePressed(triggerRamp); + * } + * + * function triggerRamp() { + * // ensures audio is enabled. See also: `userStartAudio` + * osc.start(); + * + * env.ramp(osc, 0, attackLevel, decayLevel); + * } + * + * function draw() { + * background(20); + * text('tap to play', 10, 20); + * let h = map(amp.getLevel(), 0, 0.4, 0, height);; + * rect(0, height, width, -h); + * } + *
            + */ + + p5.Envelope.prototype.ramp = function (unit, secondsFromNow, v1, v2) { + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + var destination1 = this.checkExpInput(v1); + var destination2 = + typeof v2 !== "undefined" ? this.checkExpInput(v2) : undefined; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + var currentVal = this.checkExpInput(this.control.getValueAtTime(t)); + + if (destination1 > currentVal) { + this.control.setTargetAtTime(destination1, t, this._rampAttackTC); + t += this._rampAttackTime; + } else if (destination1 < currentVal) { + this.control.setTargetAtTime(destination1, t, this._rampDecayTC); + t += this._rampDecayTime; + } + + if (destination2 === undefined) return; + + if (destination2 > destination1) { + this.control.setTargetAtTime(destination2, t, this._rampAttackTC); + } else if (destination2 < destination1) { + this.control.setTargetAtTime(destination2, t, this._rampDecayTC); + } + }; + + p5.Envelope.prototype.connect = function (unit) { + this.connection = unit; + + if ( + unit instanceof p5.Oscillator || + unit instanceof p5.SoundFile || + unit instanceof p5.AudioIn || + unit instanceof p5.Reverb || + unit instanceof p5.Noise || + unit instanceof p5.Filter || + unit instanceof p5.Delay + ) { + unit = unit.output.gain; + } + + if (unit instanceof AudioParam) { + unit.setValueAtTime(0, main.audiocontext.currentTime); + } + + this.output.connect(unit); + }; + + p5.Envelope.prototype.disconnect = function () { + if (this.output) { + this.output.disconnect(); + } + }; + + /** + * Add a value to the p5.Oscillator's output amplitude, + * and return the oscillator. Calling this method + * again will override the initial add() with new values. + * + * @method add + * @for p5.Envelope + * @param {Number} number Constant number to add + * @return {p5.Envelope} Envelope Returns this envelope + * with scaled output + */ + + p5.Envelope.prototype.add = function (num) { + var add = new Add_default.a(num); + var thisChain = this.mathOps.length; + var nextChain = this.output; + return p5.prototype._mathChain( + this, + add, + thisChain, + nextChain, + Add_default.a, + ); + }; + /** + * Multiply the p5.Envelope's output amplitude + * by a fixed value. Calling this method + * again will override the initial mult() with new values. + * + * @method mult + * @for p5.Envelope + * @param {Number} number Constant number to multiply + * @return {p5.Envelope} Envelope Returns this envelope + * with scaled output + */ + + p5.Envelope.prototype.mult = function (num) { + var mult = new Multiply_default.a(num); + var thisChain = this.mathOps.length; + var nextChain = this.output; + return p5.prototype._mathChain( + this, + mult, + thisChain, + nextChain, + Multiply_default.a, + ); + }; + /** + * Scale this envelope's amplitude values to a given + * range, and return the envelope. Calling this method + * again will override the initial scale() with new values. + * + * @method scale + * @for p5.Envelope + * @param {Number} inMin input range minumum + * @param {Number} inMax input range maximum + * @param {Number} outMin input range minumum + * @param {Number} outMax input range maximum + * @return {p5.Envelope} Envelope Returns this envelope + * with scaled output + */ + + p5.Envelope.prototype.scale = function (inMin, inMax, outMin, outMax) { + var scale = new Scale_default.a(inMin, inMax, outMin, outMax); + var thisChain = this.mathOps.length; + var nextChain = this.output; + return p5.prototype._mathChain( + this, + scale, + thisChain, + nextChain, + Scale_default.a, + ); + }; + + p5.Envelope.prototype.dispose = function () { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.disconnect(); + + if (this.control) { + this.control.dispose(); + this.control = null; + } + + for (var i = 1; i < this.mathOps.length; i++) { + this.mathOps[i].dispose(); + } + }; + + p5.Env = function (t1, l1, t2, l2, t3, l3) { + console.warn( + "WARNING: p5.Env is now deprecated and may be removed in future versions. " + + "Please use the new p5.Envelope instead.", + ); + p5.Envelope.call(this, t1, l1, t2, l2, t3, l3); + }; + + p5.Env.prototype = Object.create(p5.Envelope.prototype); + var Envelope = p5.Envelope; + var envelope = Envelope; + function noise_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + noise_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + noise_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return noise_typeof(obj); + } + + function noise_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function noise_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function noise_createClass(Constructor, protoProps, staticProps) { + if (protoProps) noise_defineProperties(Constructor.prototype, protoProps); + if (staticProps) noise_defineProperties(Constructor, staticProps); + return Constructor; + } + + function noise_possibleConstructorReturn(self, call) { + if ( + call && + (noise_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return noise_assertThisInitialized(self); + } + + function noise_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function noise_getPrototypeOf(o) { + noise_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return noise_getPrototypeOf(o); + } + + function noise_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) noise_setPrototypeOf(subClass, superClass); + } + + function noise_setPrototypeOf(o, p) { + noise_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return noise_setPrototypeOf(o, p); + } + + var _whiteNoiseBuffer = (function () { + var bufferSize = 2 * main.audiocontext.sampleRate; + var whiteBuffer = main.audiocontext.createBuffer( + 1, + bufferSize, + main.audiocontext.sampleRate, + ); + var noiseData = whiteBuffer.getChannelData(0); + + for (var i = 0; i < bufferSize; i++) { + noiseData[i] = Math.random() * 2 - 1; + } + + whiteBuffer.type = "white"; + return whiteBuffer; + })(); + + var _pinkNoiseBuffer = (function () { + var bufferSize = 2 * main.audiocontext.sampleRate; + var pinkBuffer = main.audiocontext.createBuffer( + 1, + bufferSize, + main.audiocontext.sampleRate, + ); + var noiseData = pinkBuffer.getChannelData(0); + var b0, b1, b2, b3, b4, b5, b6; + b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0.0; + + for (var i = 0; i < bufferSize; i++) { + var white = Math.random() * 2 - 1; + b0 = 0.99886 * b0 + white * 0.0555179; + b1 = 0.99332 * b1 + white * 0.0750759; + b2 = 0.969 * b2 + white * 0.153852; + b3 = 0.8665 * b3 + white * 0.3104856; + b4 = 0.55 * b4 + white * 0.5329522; + b5 = -0.7616 * b5 - white * 0.016898; + noiseData[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362; + noiseData[i] *= 0.11; + + b6 = white * 0.115926; + } + + pinkBuffer.type = "pink"; + return pinkBuffer; + })(); + + var _brownNoiseBuffer = (function () { + var bufferSize = 2 * main.audiocontext.sampleRate; + var brownBuffer = main.audiocontext.createBuffer( + 1, + bufferSize, + main.audiocontext.sampleRate, + ); + var noiseData = brownBuffer.getChannelData(0); + var lastOut = 0.0; + + for (var i = 0; i < bufferSize; i++) { + var white = Math.random() * 2 - 1; + noiseData[i] = (lastOut + 0.02 * white) / 1.02; + lastOut = noiseData[i]; + noiseData[i] *= 3.5; + } + + brownBuffer.type = "brown"; + return brownBuffer; + })(); + /** + * Noise is a type of oscillator that generates a buffer with random values. + * + * @class p5.Noise + * @extends p5.Oscillator + * @constructor + * @param {String} type Type of noise can be 'white' (default), + * 'brown' or 'pink'. + */ + + var noise_Noise = (function (_Oscillator) { + noise_inherits(Noise, _Oscillator); + + function Noise(type) { + var _this; + + noise_classCallCheck(this, Noise); + + _this = noise_possibleConstructorReturn( + this, + noise_getPrototypeOf(Noise).call(this), + ); + var assignType; + delete _this.f; + delete _this.freq; + delete _this.oscillator; + + if (type === "brown") { + assignType = _brownNoiseBuffer; + } else if (type === "pink") { + assignType = _pinkNoiseBuffer; + } else { + assignType = _whiteNoiseBuffer; + } + + _this.buffer = assignType; + return _this; + } + /** + * Set type of noise to 'white', 'pink' or 'brown'. + * White is the default. + * + * @method setType + * @param {String} [type] 'white', 'pink' or 'brown' + */ + + noise_createClass(Noise, [ + { + key: "setType", + value: function setType(type) { + switch (type) { + case "white": + this.buffer = _whiteNoiseBuffer; + break; + + case "pink": + this.buffer = _pinkNoiseBuffer; + break; + + case "brown": + this.buffer = _brownNoiseBuffer; + break; + + default: + this.buffer = _whiteNoiseBuffer; + } + + if (this.started) { + var now = main.audiocontext.currentTime; + this.stop(now); + this.start(now + 0.01); + } + }, + }, + { + key: "getType", + value: function getType() { + return this.buffer.type; + }, + }, + { + key: "start", + value: function start() { + if (this.started) { + this.stop(); + } + + this.noise = main.audiocontext.createBufferSource(); + this.noise.buffer = this.buffer; + this.noise.loop = true; + this.noise.connect(this.output); + var now = main.audiocontext.currentTime; + this.noise.start(now); + this.started = true; + }, + }, + { + key: "stop", + value: function stop() { + var now = main.audiocontext.currentTime; + + if (this.noise) { + this.noise.stop(now); + this.started = false; + } + }, + }, + { + key: "dispose", + value: function dispose() { + var now = main.audiocontext.currentTime; + + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.noise) { + this.noise.disconnect(); + this.stop(now); + } + + if (this.output) { + this.output.disconnect(); + } + + if (this.panner) { + this.panner.disconnect(); + } + + this.output = null; + this.panner = null; + this.buffer = null; + this.noise = null; + }, + }, + ]); + + return Noise; + })(oscillator); + + var noise = noise_Noise; + var Signal = __webpack_require__(2); + var Signal_default = __webpack_require__.n(Signal); + + function pulse_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + pulse_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + pulse_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return pulse_typeof(obj); + } + + function pulse_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function pulse_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function pulse_createClass(Constructor, protoProps, staticProps) { + if (protoProps) pulse_defineProperties(Constructor.prototype, protoProps); + if (staticProps) pulse_defineProperties(Constructor, staticProps); + return Constructor; + } + + function pulse_possibleConstructorReturn(self, call) { + if ( + call && + (pulse_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return pulse_assertThisInitialized(self); + } + + function pulse_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function pulse_getPrototypeOf(o) { + pulse_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return pulse_getPrototypeOf(o); + } + + function pulse_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) pulse_setPrototypeOf(subClass, superClass); + } + + function pulse_setPrototypeOf(o, p) { + pulse_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return pulse_setPrototypeOf(o, p); + } + + /** + * Creates a Pulse object, an oscillator that implements + * Pulse Width Modulation. + * The pulse is created with two oscillators. + * Accepts a parameter for frequency, and to set the + * width between the pulses. See + * p5.Oscillator for a full list of methods. + * + * @class p5.Pulse + * @extends p5.Oscillator + * @constructor + * @param {Number} [freq] Frequency in oscillations per second (Hz) + * @param {Number} [w] Width between the pulses (0 to 1.0, + * defaults to 0) + * @example + *
            + * let pulse; + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(startPulse); + * background(220); + * + * pulse = new p5.Pulse(); + * pulse.amp(0.5); + * pulse.freq(220); + * } + * function startPulse() { + * pulse.start(); + * pulse.amp(0.5, 0.02); + * } + * function mouseReleased() { + * pulse.amp(0, 0.2); + * } + * function draw() { + * background(220); + * text('tap to play', 5, 20, width - 20); + * let w = map(mouseX, 0, width, 0, 1); + * w = constrain(w, 0, 1); + * pulse.width(w); + * text('pulse width: ' + w, 5, height - 20); + * } + *
            + */ + + var pulse_Pulse = (function (_Oscillator) { + pulse_inherits(Pulse, _Oscillator); + + function Pulse(freq, w) { + var _this; + + pulse_classCallCheck(this, Pulse); + + _this = pulse_possibleConstructorReturn( + this, + pulse_getPrototypeOf(Pulse).call(this, freq, "sawtooth"), + ); + + _this.w = w || 0; + + _this.osc2 = new SawOsc(freq); + + _this.dNode = main.audiocontext.createDelay(); + + _this.dcOffset = createDCOffset(); + _this.dcGain = main.audiocontext.createGain(); + + _this.dcOffset.connect(_this.dcGain); + + _this.dcGain.connect(_this.output); + + _this.f = freq || 440; + var mW = _this.w / _this.oscillator.frequency.value; + _this.dNode.delayTime.value = mW; + _this.dcGain.gain.value = 1.7 * (0.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); + + return _this; + } + /** + * Set the width of a Pulse object (an oscillator that implements + * Pulse Width Modulation). + * + * @method width + * @param {Number} [width] Width between the pulses (0 to 1.0, + * defaults to 0) + */ + + pulse_createClass(Pulse, [ + { + key: "width", + value: function width(w) { + if (typeof w === "number") { + if (w <= 1.0 && w >= 0.0) { + this.w = w; + + var mW = this.w / this.oscillator.frequency.value; + this.dNode.delayTime.value = mW; + } + + this.dcGain.gain.value = 1.7 * (0.5 - this.w); + } else { + w.connect(this.dNode.delayTime); + var sig = new Signal_default.a(-0.5); + + w.connect(sig); + var mult1 = new Multiply_default.a(-1); + var mult2 = new Multiply_default.a(1.7); + sig = sig.connect(mult1).connect(mult2); + sig.connect(this.dcGain.gain); + } + }, + }, + { + key: "start", + value: function start(f, time) { + var now = main.audiocontext.currentTime; + var t = time || 0; + + if (!this.started) { + var freq = f || this.f; + var type = this.oscillator.type; + this.oscillator = main.audiocontext.createOscillator(); + this.oscillator.frequency.setValueAtTime(freq, now); + this.oscillator.type = type; + this.oscillator.connect(this.output); + this.oscillator.start(t + now); + + this.osc2.oscillator = main.audiocontext.createOscillator(); + this.osc2.oscillator.frequency.setValueAtTime(freq, t + now); + this.osc2.oscillator.type = type; + this.osc2.oscillator.connect(this.osc2.output); + this.osc2.start(t + now); + this.freqNode = [ + this.oscillator.frequency, + this.osc2.oscillator.frequency, + ]; + + this.dcOffset = createDCOffset(); + this.dcOffset.connect(this.dcGain); + this.dcOffset.start(t + now); + + if ( + this.mods !== undefined && + this.mods.frequency !== undefined + ) { + this.mods.frequency.connect(this.freqNode[0]); + this.mods.frequency.connect(this.freqNode[1]); + } + + this.started = true; + this.osc2.started = true; + } + }, + }, + { + key: "stop", + value: function stop(time) { + if (this.started) { + var t = time || 0; + var now = main.audiocontext.currentTime; + this.oscillator.stop(t + now); + + if (this.osc2.oscillator) { + this.osc2.oscillator.stop(t + now); + } + + this.dcOffset.stop(t + now); + this.started = false; + this.osc2.started = false; + } + }, + }, + { + key: "freq", + value: function freq(val) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var tFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + + if (typeof val === "number") { + this.f = val; + var now = main.audiocontext.currentTime; + var currentFreq = this.oscillator.frequency.value; + this.oscillator.frequency.cancelScheduledValues(now); + this.oscillator.frequency.setValueAtTime( + currentFreq, + now + tFromNow, + ); + this.oscillator.frequency.exponentialRampToValueAtTime( + val, + tFromNow + rampTime + now, + ); + this.osc2.oscillator.frequency.cancelScheduledValues(now); + this.osc2.oscillator.frequency.setValueAtTime( + currentFreq, + now + tFromNow, + ); + this.osc2.oscillator.frequency.exponentialRampToValueAtTime( + val, + tFromNow + rampTime + now, + ); + + if (this.freqMod) { + this.freqMod.output.disconnect(); + this.freqMod = null; + } + } else if (val.output) { + val.output.disconnect(); + val.output.connect(this.oscillator.frequency); + val.output.connect(this.osc2.oscillator.frequency); + this.freqMod = val; + } + }, + }, + ]); + + return Pulse; + })(oscillator); + + function createDCOffset() { + var ac = main.audiocontext; + var buffer = ac.createBuffer(1, 2048, ac.sampleRate); + var data = buffer.getChannelData(0); + + for (var i = 0; i < 2048; i++) { + data[i] = 1.0; + } + + var bufferSource = ac.createBufferSource(); + bufferSource.buffer = buffer; + bufferSource.loop = true; + return bufferSource; + } + + var pulse = pulse_Pulse; + function audioin_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function audioin_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function audioin_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + audioin_defineProperties(Constructor.prototype, protoProps); + if (staticProps) audioin_defineProperties(Constructor, staticProps); + return Constructor; + } + + main.inputSources = []; + /** + *

            Get audio from an input, i.e. your computer's microphone.

            + * + *

            Turn the mic on/off with the start() and stop() methods. When the mic + * is on, its volume can be measured with getLevel or by connecting an + * FFT object.

            + * + *

            If you want to hear the AudioIn, use the .connect() method. + * AudioIn does not connect to p5.sound output by default to prevent + * feedback.

            + * + *

            Note: This uses the getUserMedia/ + * Stream API, which is not supported by certain browsers. Access in Chrome browser + * is limited to localhost and https, but access over http may be limited.

            + * + * @class p5.AudioIn + * @constructor + * @param {Function} [errorCallback] A function to call if there is an error + * accessing the AudioIn. For example, + * Safari and iOS devices do not + * currently allow microphone access. + * @example + *
            + * let mic; + * + * function setup(){ + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(userStartAudio); + * textAlign(CENTER); + * mic = new p5.AudioIn(); + * mic.start(); + * } + * + * function draw(){ + * background(0); + * fill(255); + * text('tap to start', width/2, 20); + * + * micLevel = mic.getLevel(); + * let y = height - micLevel * height; + * ellipse(width/2, y, 10, 10); + * } + *
            + */ + + var audioin_AudioIn = (function () { + function AudioIn(errorCallback) { + audioin_classCallCheck(this, AudioIn); + + /** + * @property {GainNode} input + */ + this.input = main.audiocontext.createGain(); + /** + * @property {GainNode} output + */ + + this.output = main.audiocontext.createGain(); + /** + * @property {MediaStream|null} stream + */ + + this.stream = null; + /** + * @property {MediaStreamAudioSourceNode|null} mediaStream + */ + + this.mediaStream = null; + /** + * @property {Number|null} currentSource + */ + + this.currentSource = null; + /** + * Client must allow browser to access their microphone / audioin source. + * Default: false. Will become true when the client enables access. + * + * @property {Boolean} enabled + */ + + this.enabled = false; + /** + * Input amplitude, connect to it by default but not to master out + * + * @property {p5.Amplitude} amplitude + */ + + this.amplitude = new amplitude(); + this.output.connect(this.amplitude.input); + + if ( + !window.MediaStreamTrack || + !window.navigator.mediaDevices || + !window.navigator.mediaDevices.getUserMedia + ) { + errorCallback + ? errorCallback() + : window.alert( + "This browser does not support MediaStreamTrack and mediaDevices", + ); + } + + main.soundArray.push(this); + } + /** + * Start processing audio input. This enables the use of other + * AudioIn methods like getLevel(). Note that by default, AudioIn + * is not connected to p5.sound's output. So you won't hear + * anything unless you use the connect() method.
            + * + * Certain browsers limit access to the user's microphone. For example, + * Chrome only allows access from localhost and over https. For this reason, + * you may want to include an errorCallback—a function that is called in case + * the browser won't provide mic access. + * + * @method start + * @for p5.AudioIn + * @param {Function} [successCallback] Name of a function to call on + * success. + * @param {Function} [errorCallback] Name of a function to call if + * there was an error. For example, + * some browsers do not support + * getUserMedia. + */ + + audioin_createClass(AudioIn, [ + { + key: "start", + value: function start(successCallback, errorCallback) { + var self = this; + + if (this.stream) { + this.stop(); + } + + var audioSource = main.inputSources[self.currentSource]; + var constraints = { + audio: { + sampleRate: main.audiocontext.sampleRate, + echoCancellation: false, + }, + }; + + if (main.inputSources[this.currentSource]) { + constraints.audio.deviceId = audioSource.deviceId; + } + + window.navigator.mediaDevices + .getUserMedia(constraints) + .then(function (stream) { + self.stream = stream; + self.enabled = true; + + self.mediaStream = + main.audiocontext.createMediaStreamSource(stream); + self.mediaStream.connect(self.output); + + self.amplitude.setInput(self.output); + if (successCallback) successCallback(); + }) + ["catch"](function (err) { + if (errorCallback) errorCallback(err); + else console.error(err); + }); + }, + /** + * Turn the AudioIn off. If the AudioIn is stopped, it cannot getLevel(). + * If re-starting, the user may be prompted for permission access. + * + * @method stop + * @for p5.AudioIn + */ + }, + { + key: "stop", + value: function stop() { + if (this.stream) { + this.stream.getTracks().forEach(function (track) { + track.stop(); + }); + this.mediaStream.disconnect(); + delete this.mediaStream; + delete this.stream; + } + }, + /** + * Connect to an audio unit. If no parameter is provided, will + * connect to the main output (i.e. your speakers).
            + * + * @method connect + * @for p5.AudioIn + * @param {Object} [unit] An object that accepts audio input, + * such as an FFT + */ + }, + { + key: "connect", + value: function connect(unit) { + if (unit) { + if (unit.hasOwnProperty("input")) { + this.output.connect(unit.input); + } else if (unit.hasOwnProperty("analyser")) { + this.output.connect(unit.analyser); + } else { + this.output.connect(unit); + } + } else { + this.output.connect(main.input); + } + }, + /** + * Disconnect the AudioIn from all audio units. For example, if + * connect() had been called, disconnect() will stop sending + * signal to your speakers.
            + * + * @method disconnect + * @for p5.AudioIn + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + + this.output.connect(this.amplitude.input); + } + }, + /** + * Read the Amplitude (volume level) of an AudioIn. The AudioIn + * class contains its own instance of the Amplitude class to help + * make it easy to get a microphone's volume level. Accepts an + * optional smoothing value (0.0 < 1.0). NOTE: AudioIn must + * .start() before using .getLevel().
            + * + * @method getLevel + * @for p5.AudioIn + * @param {Number} [smoothing] Smoothing is 0.0 by default. + * Smooths values based on previous values. + * @return {Number} Volume level (between 0.0 and 1.0) + */ + }, + { + key: "getLevel", + value: function getLevel(smoothing) { + if (smoothing) { + this.amplitude.smoothing = smoothing; + } + + return this.amplitude.getLevel(); + }, + /** + * Set amplitude (volume) of a mic input between 0 and 1.0.
            + * + * @method amp + * @for p5.AudioIn + * @param {Number} vol between 0 and 1.0 + * @param {Number} [time] ramp time (optional) + */ + }, + { + key: "amp", + value: function amp(vol, t) { + if (t) { + var rampTime = t || 0; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues( + main.audiocontext.currentTime, + ); + this.output.gain.setValueAtTime( + currentVol, + main.audiocontext.currentTime, + ); + this.output.gain.linearRampToValueAtTime( + vol, + rampTime + main.audiocontext.currentTime, + ); + } else { + this.output.gain.cancelScheduledValues( + main.audiocontext.currentTime, + ); + this.output.gain.setValueAtTime( + vol, + main.audiocontext.currentTime, + ); + } + }, + /** + * Returns a list of available input sources. This is a wrapper + * for + * MediaDevices.enumerateDevices() - Web APIs | MDN + * and it returns a Promise. + * @method getSources + * @for p5.AudioIn + * @param {Function} [successCallback] This callback function handles the sources when they + * have been enumerated. The callback function + * receives the deviceList array as its only argument + * @param {Function} [errorCallback] This optional callback receives the error + * message as its argument. + * @returns {Promise} Returns a Promise that can be used in place of the callbacks, similar + * to the enumerateDevices() method + * @example + *
            + * let audioIn; + * + * function setup(){ + * text('getting sources...', 0, 20); + * audioIn = new p5.AudioIn(); + * audioIn.getSources(gotSources); + * } + * + * function gotSources(deviceList) { + * if (deviceList.length > 0) { + * //set the source to the first item in the deviceList array + * audioIn.setSource(0); + * let currentSource = deviceList[audioIn.currentSource]; + * text('set source to: ' + currentSource.deviceId, 5, 20, width); + * } + * } + *
            + */ + }, + { + key: "getSources", + value: function getSources(onSuccess, onError) { + return new Promise(function (resolve, reject) { + window.navigator.mediaDevices + .enumerateDevices() + .then(function (devices) { + main.inputSources = devices.filter(function (device) { + return device.kind === "audioinput"; + }); + resolve(main.inputSources); + + if (onSuccess) { + onSuccess(main.inputSources); + } + }) + ["catch"](function (error) { + reject(error); + + if (onError) { + onError(error); + } else { + console.error( + "This browser does not support MediaStreamTrack.getSources()", + ); + } + }); + }); + }, + /** + * Set the input source. Accepts a number representing a + * position in the array returned by getSources(). + * This is only available in browsers that support + * + * navigator.mediaDevices.enumerateDevices() + * + * @method setSource + * @for p5.AudioIn + * @param {number} num position of input source in the array + * @example + *
            + * let audioIn; + * + * function setup(){ + * text('getting sources...', 0, 20); + * audioIn = new p5.AudioIn(); + * audioIn.getSources(gotSources); + * } + * + * function gotSources(deviceList) { + * if (deviceList.length > 0) { + * //set the source to the first item in the deviceList array + * audioIn.setSource(0); + * let currentSource = deviceList[audioIn.currentSource]; + * text('set source to: ' + currentSource.deviceId, 5, 20, width); + * } + * } + *
            + */ + }, + { + key: "setSource", + value: function setSource(num) { + if ( + main.inputSources.length > 0 && + num < main.inputSources.length + ) { + this.currentSource = num; + console.log( + "set source to ", + main.inputSources[this.currentSource], + ); + } else { + console.log("unable to set input source"); + } + + if (this.stream && this.stream.active) { + this.start(); + } + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.stop(); + + if (this.output) { + this.output.disconnect(); + } + + if (this.amplitude) { + this.amplitude.disconnect(); + } + + delete this.amplitude; + delete this.output; + }, + }, + ]); + + return AudioIn; + })(); + + var audioin = audioin_AudioIn; + var CrossFade = __webpack_require__(23); + var CrossFade_default = __webpack_require__.n(CrossFade); + + function effect_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function effect_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function effect_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + effect_defineProperties(Constructor.prototype, protoProps); + if (staticProps) effect_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * Effect is a base class for audio effects in p5.
            + * This module handles the nodes and methods that are + * common and useful for current and future effects. + * + * + * This class is extended by p5.Distortion, + * p5.Compressor, + * p5.Delay, + * p5.Filter, + * p5.Reverb. + * + * @class p5.Effect + * @constructor + * + * @param {Object} [ac] Reference to the audio context of the p5 object + * @param {AudioNode} [input] Gain Node effect wrapper + * @param {AudioNode} [output] Gain Node effect wrapper + * @param {Object} [_drywet] Tone.JS CrossFade node (defaults to value: 1) + * @param {AudioNode} [wet] Effects that extend this class should connect + * to the wet signal to this gain node, so that dry and wet + * signals are mixed properly. + */ + + var effect_Effect = (function () { + function Effect() { + effect_classCallCheck(this, Effect); + + this.ac = main.audiocontext; + this.input = this.ac.createGain(); + this.output = this.ac.createGain(); + /** + * The p5.Effect class is built + * using Tone.js CrossFade + * @private + */ + + this._drywet = new CrossFade_default.a(1); + /** + * In classes that extend + * p5.Effect, connect effect nodes + * to the wet parameter + */ + + this.wet = this.ac.createGain(); + this.input.connect(this._drywet.a); + this.wet.connect(this._drywet.b); + + this._drywet.connect(this.output); + + this.connect(); + + main.soundArray.push(this); + } + /** + * Set the output volume of the filter. + * + * @method amp + * @for p5.Effect + * @param {Number} [vol] amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts until rampTime + * @param {Number} [tFromNow] schedule this event to happen in tFromNow seconds + */ + + effect_createClass(Effect, [ + { + key: "amp", + value: function amp(vol) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var tFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + var now = main.audiocontext.currentTime; + var startTime = now + tFromNow; + var endTime = startTime + rampTime + 0.001; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(now); + this.output.gain.linearRampToValueAtTime( + currentVol, + startTime + 0.001, + ); + this.output.gain.linearRampToValueAtTime(vol, endTime); + }, + /** + * Link effects together in a chain + * Example usage: filter.chain(reverb, delay, panner); + * May be used with an open-ended number of arguments + * + * @method chain + * @for p5.Effect + * @param {Object} [arguments] Chain together multiple sound objects + */ + }, + { + key: "chain", + value: function chain() { + if (arguments.length > 0) { + this.connect(arguments[0]); + + for (var i = 1; i < arguments.length; i += 1) { + arguments[i - 1].connect(arguments[i]); + } + } + + return this; + }, + /** + * Adjust the dry/wet value. + * + * @method drywet + * @for p5.Effect + * @param {Number} [fade] The desired drywet value (0 - 1.0) + */ + }, + { + key: "drywet", + value: function drywet(fade) { + if (typeof fade !== "undefined") { + this._drywet.fade.value = fade; + } + + return this._drywet.fade.value; + }, + /** + * Send output to a p5.js-sound, Web Audio Node, or use signal to + * control an AudioParam + * + * @method connect + * @for p5.Effect + * @param {Object} unit + */ + }, + { + key: "connect", + value: function connect(unit) { + var u = unit || p5.soundOut.input; + this.output.connect(u.input ? u.input : u); + }, + /** + * Disconnect all output. + * @method disconnect + * @for p5.Effect + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.input) { + this.input.disconnect(); + delete this.input; + } + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + + if (this._drywet) { + this._drywet.disconnect(); + + delete this._drywet; + } + + if (this.wet) { + this.wet.disconnect(); + delete this.wet; + } + + this.ac = undefined; + }, + }, + ]); + + return Effect; + })(); + + var effect = effect_Effect; + function filter_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + filter_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + filter_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return filter_typeof(obj); + } + + function filter_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function filter_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function filter_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + filter_defineProperties(Constructor.prototype, protoProps); + if (staticProps) filter_defineProperties(Constructor, staticProps); + return Constructor; + } + + function filter_possibleConstructorReturn(self, call) { + if ( + call && + (filter_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return filter_assertThisInitialized(self); + } + + function filter_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return _get(target, property, receiver || target); + } + + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = filter_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function filter_getPrototypeOf(o) { + filter_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return filter_getPrototypeOf(o); + } + + function filter_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) filter_setPrototypeOf(subClass, superClass); + } + + function filter_setPrototypeOf(o, p) { + filter_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return filter_setPrototypeOf(o, p); + } + + /** + *

            A p5.Filter uses a Web Audio Biquad Filter to filter + * the frequency response of an input source. Subclasses + * include:

            + * p5.LowPass: + * Allows frequencies below the cutoff frequency to pass through, + * and attenuates frequencies above the cutoff.
            + * p5.HighPass: + * The opposite of a lowpass filter.
            + * p5.BandPass: + * Allows a range of frequencies to pass through and attenuates + * the frequencies below and above this frequency range.
            + * + * The .res() method controls either width of the + * bandpass, or resonance of the low/highpass cutoff frequency. + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Filter + * @extends p5.Effect + * @constructor + * @param {String} [type] 'lowpass' (default), 'highpass', 'bandpass' + * @example + *
            + * let fft, noise, filter; + * + * function setup() { + * let cnv = createCanvas(100,100); + * cnv.mousePressed(makeNoise); + * fill(255, 0, 255); + * + * filter = new p5.BandPass(); + * noise = new p5.Noise(); + * noise.disconnect(); + * noise.connect(filter); + * + * fft = new p5.FFT(); + * } + * + * function draw() { + * background(220); + * + * // set the BandPass frequency based on mouseX + * let freq = map(mouseX, 0, width, 20, 10000); + * freq = constrain(freq, 0, 22050); + * filter.freq(freq); + * // give the filter a narrow band (lower res = wider bandpass) + * filter.res(50); + * + * // draw filtered spectrum + * let spectrum = fft.analyze(); + * noStroke(); + * for (let i = 0; i < spectrum.length; i++) { + * let x = map(i, 0, spectrum.length, 0, width); + * let h = -height + map(spectrum[i], 0, 255, height, 0); + * rect(x, height, width/spectrum.length, h); + * } + * if (!noise.started) { + * text('tap here and drag to change frequency', 10, 20, width - 20); + * } else { + * text('Frequency: ' + round(freq)+'Hz', 20, 20, width - 20); + * } + * } + * + * function makeNoise() { + * // see also: `userStartAudio()` + * noise.start(); + * noise.amp(0.5, 0.2); + * } + * + * function mouseReleased() { + * noise.amp(0, 0.2); + * } + * + *
            + */ + + var Filter = (function (_Effect) { + filter_inherits(Filter, _Effect); + + function Filter(type) { + var _this; + + filter_classCallCheck(this, Filter); + + _this = filter_possibleConstructorReturn( + this, + filter_getPrototypeOf(Filter).call(this), + ); + + /** + * The p5.Filter is built with a + * + * Web Audio BiquadFilter Node. + * + * @property {DelayNode} biquadFilter + */ + + _this.biquad = _this.ac.createBiquadFilter(); + + _this.input.connect(_this.biquad); + + _this.biquad.connect(_this.wet); + + if (type) { + _this.setType(type); + } + + _this._on = true; + _this._untoggledType = _this.biquad.type; + return _this; + } + /** + * Filter an audio signal according to a set + * of filter parameters. + * + * @method process + * @param {Object} Signal An object that outputs audio + * @param {Number} [freq] Frequency in Hz, from 10 to 22050 + * @param {Number} [res] Resonance/Width of the filter frequency + * from 0.001 to 1000 + */ + + filter_createClass(Filter, [ + { + key: "process", + value: function process(src, freq, res, time) { + src.connect(this.input); + this.set(freq, res, time); + }, + /** + * Set the frequency and the resonance of the filter. + * + * @method set + * @param {Number} [freq] Frequency in Hz, from 10 to 22050 + * @param {Number} [res] Resonance (Q) from 0.001 to 1000 + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + }, + { + key: "set", + value: function set(freq, res, time) { + if (freq) { + this.freq(freq, time); + } + + if (res) { + this.res(res, time); + } + }, + /** + * Set the filter frequency, in Hz, from 10 to 22050 (the range of + * human hearing, although in reality most people hear in a narrower + * range). + * + * @method freq + * @param {Number} freq Filter Frequency + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @return {Number} value Returns the current frequency value + */ + }, + { + key: "freq", + value: function freq(_freq, time) { + var t = time || 0; + + if (_freq <= 0) { + _freq = 1; + } + + if (typeof _freq === "number") { + this.biquad.frequency.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.biquad.frequency.exponentialRampToValueAtTime( + _freq, + this.ac.currentTime + 0.02 + t, + ); + } else if (_freq) { + _freq.connect(this.biquad.frequency); + } + + return this.biquad.frequency.value; + }, + /** + * Controls either width of a bandpass frequency, + * or the resonance of a low/highpass cutoff frequency. + * + * @method res + * @param {Number} res Resonance/Width of filter freq + * from 0.001 to 1000 + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @return {Number} value Returns the current res value + */ + }, + { + key: "res", + value: function res(_res, time) { + var t = time || 0; + + if (typeof _res === "number") { + this.biquad.Q.value = _res; + this.biquad.Q.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.biquad.Q.linearRampToValueAtTime( + _res, + this.ac.currentTime + 0.02 + t, + ); + } else if (_res) { + _res.connect(this.biquad.Q); + } + + return this.biquad.Q.value; + }, + /** + * Controls the gain attribute of a Biquad Filter. + * This is distinctly different from .amp() which is inherited from p5.Effect + * .amp() controls the volume via the output gain node + * p5.Filter.gain() controls the gain parameter of a Biquad Filter node. + * + * @method gain + * @param {Number} gain + * @return {Number} Returns the current or updated gain value + */ + }, + { + key: "gain", + value: function gain(_gain, time) { + var t = time || 0; + + if (typeof _gain === "number") { + this.biquad.gain.value = _gain; + this.biquad.gain.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.biquad.gain.linearRampToValueAtTime( + _gain, + this.ac.currentTime + 0.02 + t, + ); + } else if (_gain) { + _gain.connect(this.biquad.gain); + } + + return this.biquad.gain.value; + }, + /** + * Toggle function. Switches between the specified type and allpass + * + * @method toggle + * @return {boolean} [Toggle value] + */ + }, + { + key: "toggle", + value: function toggle() { + this._on = !this._on; + + if (this._on === true) { + this.biquad.type = this._untoggledType; + } else if (this._on === false) { + this.biquad.type = "allpass"; + } + + return this._on; + }, + /** + * Set the type of a p5.Filter. Possible types include: + * "lowpass" (default), "highpass", "bandpass", + * "lowshelf", "highshelf", "peaking", "notch", + * "allpass". + * + * @method setType + * @param {String} t + */ + }, + { + key: "setType", + value: function setType(t) { + this.biquad.type = t; + this._untoggledType = this.biquad.type; + }, + }, + { + key: "dispose", + value: function dispose() { + _get(filter_getPrototypeOf(Filter.prototype), "dispose", this).call( + this, + ); + + if (this.biquad) { + this.biquad.disconnect(); + delete this.biquad; + } + }, + }, + ]); + + return Filter; + })(effect); + /** + * Constructor: new p5.LowPass() Filter. + * This is the same as creating a p5.Filter and then calling + * its method setType('lowpass'). + * See p5.Filter for methods. + * + * @class p5.LowPass + * @constructor + * @extends p5.Filter + */ + + var LowPass = (function (_Filter) { + filter_inherits(LowPass, _Filter); + + function LowPass() { + filter_classCallCheck(this, LowPass); + + return filter_possibleConstructorReturn( + this, + filter_getPrototypeOf(LowPass).call(this, "lowpass"), + ); + } + + return LowPass; + })(Filter); + /** + * Constructor: new p5.HighPass() Filter. + * This is the same as creating a p5.Filter and then calling + * its method setType('highpass'). + * See p5.Filter for methods. + * + * @class p5.HighPass + * @constructor + * @extends p5.Filter + */ + + var HighPass = (function (_Filter2) { + filter_inherits(HighPass, _Filter2); + + function HighPass() { + filter_classCallCheck(this, HighPass); + + return filter_possibleConstructorReturn( + this, + filter_getPrototypeOf(HighPass).call(this, "highpass"), + ); + } + + return HighPass; + })(Filter); + /** + * Constructor: new p5.BandPass() Filter. + * This is the same as creating a p5.Filter and then calling + * its method setType('bandpass'). + * See p5.Filter for methods. + * + * @class p5.BandPass + * @constructor + * @extends p5.Filter + */ + + var BandPass = (function (_Filter3) { + filter_inherits(BandPass, _Filter3); + + function BandPass() { + filter_classCallCheck(this, BandPass); + + return filter_possibleConstructorReturn( + this, + filter_getPrototypeOf(BandPass).call(this, "bandpass"), + ); + } + + return BandPass; + })(Filter); + + var filter = Filter; + + function eqFilter_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + eqFilter_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + eqFilter_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return eqFilter_typeof(obj); + } + + function eqFilter_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function eqFilter_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function eqFilter_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + eqFilter_defineProperties(Constructor.prototype, protoProps); + if (staticProps) eqFilter_defineProperties(Constructor, staticProps); + return Constructor; + } + + function eqFilter_possibleConstructorReturn(self, call) { + if ( + call && + (eqFilter_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return eqFilter_assertThisInitialized(self); + } + + function eqFilter_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function eqFilter_getPrototypeOf(o) { + eqFilter_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return eqFilter_getPrototypeOf(o); + } + + function eqFilter_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) eqFilter_setPrototypeOf(subClass, superClass); + } + + function eqFilter_setPrototypeOf(o, p) { + eqFilter_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return eqFilter_setPrototypeOf(o, p); + } + + /** + * EQFilter extends p5.Filter with constraints + * necessary for the p5.EQ + * + * @private + */ + + var eqFilter_EQFilter = (function (_Filter) { + eqFilter_inherits(EQFilter, _Filter); + + function EQFilter(freq, res) { + var _this; + + eqFilter_classCallCheck(this, EQFilter); + + _this = eqFilter_possibleConstructorReturn( + this, + eqFilter_getPrototypeOf(EQFilter).call(this, "peaking"), + ); + + _this.disconnect(); + + _this.set(freq, res); + + _this.biquad.gain.value = 0; + delete _this.input; + delete _this.output; + delete _this._drywet; + delete _this.wet; + return _this; + } + + eqFilter_createClass(EQFilter, [ + { + key: "amp", + value: function amp() { + console.warn( + "`amp()` is not available for p5.EQ bands. Use `.gain()`", + ); + }, + }, + { + key: "drywet", + value: function drywet() { + console.warn("`drywet()` is not available for p5.EQ bands."); + }, + }, + { + key: "connect", + value: function connect(unit) { + var u = unit || p5.soundOut.input; + + if (this.biquad) { + this.biquad.connect(u.input ? u.input : u); + } else { + this.output.connect(u.input ? u.input : u); + } + }, + }, + { + key: "disconnect", + value: function disconnect() { + if (this.biquad) { + this.biquad.disconnect(); + } + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.disconnect(); + delete this.biquad; + }, + }, + ]); + + return EQFilter; + })(filter); + + var eqFilter = eqFilter_EQFilter; + function eq_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + eq_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + eq_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return eq_typeof(obj); + } + + function eq_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function eq_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function eq_createClass(Constructor, protoProps, staticProps) { + if (protoProps) eq_defineProperties(Constructor.prototype, protoProps); + if (staticProps) eq_defineProperties(Constructor, staticProps); + return Constructor; + } + + function eq_possibleConstructorReturn(self, call) { + if ( + call && + (eq_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return eq_assertThisInitialized(self); + } + + function eq_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function eq_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + eq_get = Reflect.get; + } else { + eq_get = function _get(target, property, receiver) { + var base = eq_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return eq_get(target, property, receiver || target); + } + + function eq_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = eq_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function eq_getPrototypeOf(o) { + eq_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return eq_getPrototypeOf(o); + } + + function eq_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) eq_setPrototypeOf(subClass, superClass); + } + + function eq_setPrototypeOf(o, p) { + eq_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return eq_setPrototypeOf(o, p); + } + + /** + * p5.EQ is an audio effect that performs the function of a multiband + * audio equalizer. Equalization is used to adjust the balance of + * frequency compoenents of an audio signal. This process is commonly used + * in sound production and recording to change the waveform before it reaches + * a sound output device. EQ can also be used as an audio effect to create + * interesting distortions by filtering out parts of the spectrum. p5.EQ is + * built using a chain of Web Audio Biquad Filter Nodes and can be + * instantiated with 3 or 8 bands. Bands can be added or removed from + * the EQ by directly modifying p5.EQ.bands (the array that stores filters). + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.EQ + * @constructor + * @extends p5.Effect + * @param {Number} [_eqsize] Constructor will accept 3 or 8, defaults to 3 + * @return {Object} p5.EQ object + * + * @example + *
            + * let eq, soundFile + * let eqBandIndex = 0; + * let eqBandNames = ['lows', 'mids', 'highs']; + * + * function preload() { + * soundFormats('mp3', 'ogg'); + * soundFile = loadSound('assets/beat'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(toggleSound); + * + * eq = new p5.EQ(eqBandNames.length); + * soundFile.disconnect(); + * eq.process(soundFile); + * } + * + * function draw() { + * background(30); + * noStroke(); + * fill(255); + * textAlign(CENTER); + * text('filtering ', 50, 25); + * + * fill(255, 40, 255); + * textSize(26); + * text(eqBandNames[eqBandIndex], 50, 55); + * + * fill(255); + * textSize(9); + * + * if (!soundFile.isPlaying()) { + * text('tap to play', 50, 80); + * } else { + * text('tap to filter next band', 50, 80) + * } + * } + * + * function toggleSound() { + * if (!soundFile.isPlaying()) { + * soundFile.play(); + * } else { + * eqBandIndex = (eqBandIndex + 1) % eq.bands.length; + * } + * + * for (let i = 0; i < eq.bands.length; i++) { + * eq.bands[i].gain(0); + * } + * // filter the band we want to filter + * eq.bands[eqBandIndex].gain(-40); + * } + *
            + */ + + var eq_EQ = (function (_Effect) { + eq_inherits(EQ, _Effect); + + function EQ(_eqsize) { + var _this; + + eq_classCallCheck(this, EQ); + + _this = eq_possibleConstructorReturn( + this, + eq_getPrototypeOf(EQ).call(this), + ); + + _eqsize = _eqsize === 3 || _eqsize === 8 ? _eqsize : 3; + var factor; + _eqsize === 3 ? (factor = Math.pow(2, 3)) : (factor = 2); + /** + * The p5.EQ is built with abstracted p5.Filter objects. + * To modify any bands, use methods of the + * p5.Filter API, especially `gain` and `freq`. + * Bands are stored in an array, with indices 0 - 3, or 0 - 7 + * @property {Array} bands + * + */ + + _this.bands = []; + var freq, res; + + for (var i = 0; i < _eqsize; i++) { + if (i === _eqsize - 1) { + freq = 21000; + res = 0.01; + } else if (i === 0) { + freq = 100; + res = 0.1; + } else if (i === 1) { + freq = _eqsize === 3 ? 360 * factor : 360; + res = 1; + } else { + freq = _this.bands[i - 1].freq() * factor; + res = 1; + } + + _this.bands[i] = _this._newBand(freq, res); + + if (i > 0) { + _this.bands[i - 1].connect(_this.bands[i].biquad); + } else { + _this.input.connect(_this.bands[i].biquad); + } + } + + _this.bands[_eqsize - 1].connect(_this.output); + + return _this; + } + /** + * Process an input by connecting it to the EQ + * @method process + * @param {Object} src Audio source + */ + + eq_createClass(EQ, [ + { + key: "process", + value: function process(src) { + src.connect(this.input); + }, + // * Set the frequency and gain of each band in the EQ. This method should be + // * called with 3 or 8 frequency and gain pairs, depending on the size of the EQ. + // * ex. eq.set(freq0, gain0, freq1, gain1, freq2, gain2); + // * + // * @method set + // * @for p5.EQ + // * @param {Number} [freq0] Frequency value for band with index 0 + // * @param {Number} [gain0] Gain value for band with index 0 + // * @param {Number} [freq1] Frequency value for band with index 1 + // * @param {Number} [gain1] Gain value for band with index 1 + // * @param {Number} [freq2] Frequency value for band with index 2 + // * @param {Number} [gain2] Gain value for band with index 2 + // * @param {Number} [freq3] Frequency value for band with index 3 + // * @param {Number} [gain3] Gain value for band with index 3 + // * @param {Number} [freq4] Frequency value for band with index 4 + // * @param {Number} [gain4] Gain value for band with index 4 + // * @param {Number} [freq5] Frequency value for band with index 5 + // * @param {Number} [gain5] Gain value for band with index 5 + // * @param {Number} [freq6] Frequency value for band with index 6 + // * @param {Number} [gain6] Gain value for band with index 6 + // * @param {Number} [freq7] Frequency value for band with index 7 + // * @param {Number} [gain7] Gain value for band with index 7 + // */ + }, + { + key: "set", + value: function set() { + if (arguments.length === this.bands.length * 2) { + for (var i = 0; i < arguments.length; i += 2) { + this.bands[i / 2].freq(arguments[i]); + this.bands[i / 2].gain(arguments[i + 1]); + } + } else { + console.error( + "Argument mismatch. .set() should be called with " + + this.bands.length * 2 + + " arguments. (one frequency and gain value pair for each band of the eq)", + ); + } + }, + /** + * Add a new band. Creates a p5.Filter and strips away everything but + * the raw biquad filter. This method returns an abstracted p5.Filter, + * which can be added to p5.EQ.bands, in order to create new EQ bands. + * @private + * @for p5.EQ + * @method _newBand + * @param {Number} freq + * @param {Number} res + * @return {Object} Abstracted Filter + */ + }, + { + key: "_newBand", + value: function _newBand(freq, res) { + return new eqFilter(freq, res); + }, + }, + { + key: "dispose", + value: function dispose() { + eq_get(eq_getPrototypeOf(EQ.prototype), "dispose", this).call(this); + + if (this.bands) { + while (this.bands.length > 0) { + delete this.bands.pop().dispose(); + } + + delete this.bands; + } + }, + }, + ]); + + return EQ; + })(effect); + + var eq = eq_EQ; + function listener3d_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function listener3d_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function listener3d_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + listener3d_defineProperties(Constructor.prototype, protoProps); + if (staticProps) listener3d_defineProperties(Constructor, staticProps); + return Constructor; + } + + // * listener is a class that can construct both a Spatial Panner + // * and a Spatial Listener. The panner is based on the + // * Web Audio Spatial Panner Node + // * https://www.w3.org/TR/webaudio/#the-listenernode-interface + // * This panner is a spatial processing node that allows audio to be positioned + // * and oriented in 3D space. + // * + // * The Listener modifies the properties of the Audio Context Listener. + // * Both objects types use the same methods. The default is a spatial panner. + // * + // * p5.Panner3D - Constructs a Spatial Panner
            + // * p5.Listener3D - Constructs a Spatial Listener
            + // * + // * @class listener + // * @constructor + // * @return {Object} p5.Listener3D Object + // * + // * @param {Web Audio Node} listener Web Audio Spatial Panning Node + // * @param {AudioParam} listener.panningModel "equal power" or "HRTF" + // * @param {AudioParam} listener.distanceModel "linear", "inverse", or "exponential" + // * @param {String} [type] [Specify construction of a spatial panner or listener] + // */ + + var listener3d_Listener3D = (function () { + function Listener3D(type) { + listener3d_classCallCheck(this, Listener3D); + + this.ac = main.audiocontext; + this.listener = this.ac.listener; + } + // * Connect an audio sorce + // * @param {Object} src Input source + // */ + + listener3d_createClass(Listener3D, [ + { + key: "process", + value: function process(src) { + src.connect(this.input); + }, + // * Set the X,Y,Z position of the Panner + // * @param {[Number]} xVal + // * @param {[Number]} yVal + // * @param {[Number]} zVal + // * @param {[Number]} time + // * @return {[Array]} [Updated x, y, z values as an array] + // */ + }, + { + key: "position", + value: function position(xVal, yVal, zVal, time) { + this.positionX(xVal, time); + this.positionY(yVal, time); + this.positionZ(zVal, time); + return [ + this.listener.positionX.value, + this.listener.positionY.value, + this.listener.positionZ.value, + ]; + }, + // * Getter and setter methods for position coordinates + // * @return {Number} [updated coordinate value] + // */ + }, + { + key: "positionX", + value: function positionX(xVal, time) { + var t = time || 0; + + if (typeof xVal === "number") { + this.listener.positionX.value = xVal; + this.listener.positionX.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.positionX.linearRampToValueAtTime( + xVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (xVal) { + xVal.connect(this.listener.positionX); + } + + return this.listener.positionX.value; + }, + }, + { + key: "positionY", + value: function positionY(yVal, time) { + var t = time || 0; + + if (typeof yVal === "number") { + this.listener.positionY.value = yVal; + this.listener.positionY.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.positionY.linearRampToValueAtTime( + yVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (yVal) { + yVal.connect(this.listener.positionY); + } + + return this.listener.positionY.value; + }, + }, + { + key: "positionZ", + value: function positionZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === "number") { + this.listener.positionZ.value = zVal; + this.listener.positionZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.positionZ.linearRampToValueAtTime( + zVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (zVal) { + zVal.connect(this.listener.positionZ); + } + + return this.listener.positionZ.value; + }, + // * Overrides the listener orient() method because Listener has slightly + // * different params. In human terms, Forward vectors are the direction the + // * nose is pointing. Up vectors are the direction of the top of the head. + // * + // * @method orient + // * @param {Number} xValF Forward vector X direction + // * @param {Number} yValF Forward vector Y direction + // * @param {Number} zValF Forward vector Z direction + // * @param {Number} xValU Up vector X direction + // * @param {Number} yValU Up vector Y direction + // * @param {Number} zValU Up vector Z direction + // * @param {Number} time + // * @return {Array} All orienation params + // */ + }, + { + key: "orient", + value: function orient( + xValF, + yValF, + zValF, + xValU, + yValU, + zValU, + time, + ) { + if (arguments.length === 3 || arguments.length === 4) { + time = arguments[3]; + this.orientForward(xValF, yValF, zValF, time); + } else if (arguments.length === 6 || arguments === 7) { + this.orientForward(xValF, yValF, zValF); + this.orientUp(xValU, yValU, zValU, time); + } + + return [ + this.listener.forwardX.value, + this.listener.forwardY.value, + this.listener.forwardZ.value, + this.listener.upX.value, + this.listener.upY.value, + this.listener.upZ.value, + ]; + }, + }, + { + key: "orientForward", + value: function orientForward(xValF, yValF, zValF, time) { + this.forwardX(xValF, time); + this.forwardY(yValF, time); + this.forwardZ(zValF, time); + return [ + this.listener.forwardX, + this.listener.forwardY, + this.listener.forwardZ, + ]; + }, + }, + { + key: "orientUp", + value: function orientUp(xValU, yValU, zValU, time) { + this.upX(xValU, time); + this.upY(yValU, time); + this.upZ(zValU, time); + return [this.listener.upX, this.listener.upY, this.listener.upZ]; + }, + // * Getter and setter methods for orient coordinates + // * @return {Number} [updated coordinate value] + // */ + }, + { + key: "forwardX", + value: function forwardX(xVal, time) { + var t = time || 0; + + if (typeof xVal === "number") { + this.listener.forwardX.value = xVal; + this.listener.forwardX.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.forwardX.linearRampToValueAtTime( + xVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (xVal) { + xVal.connect(this.listener.forwardX); + } + + return this.listener.forwardX.value; + }, + }, + { + key: "forwardY", + value: function forwardY(yVal, time) { + var t = time || 0; + + if (typeof yVal === "number") { + this.listener.forwardY.value = yVal; + this.listener.forwardY.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.forwardY.linearRampToValueAtTime( + yVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (yVal) { + yVal.connect(this.listener.forwardY); + } + + return this.listener.forwardY.value; + }, + }, + { + key: "forwardZ", + value: function forwardZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === "number") { + this.listener.forwardZ.value = zVal; + this.listener.forwardZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.forwardZ.linearRampToValueAtTime( + zVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (zVal) { + zVal.connect(this.listener.forwardZ); + } + + return this.listener.forwardZ.value; + }, + }, + { + key: "upX", + value: function upX(xVal, time) { + var t = time || 0; + + if (typeof xVal === "number") { + this.listener.upX.value = xVal; + this.listener.upX.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.upX.linearRampToValueAtTime( + xVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (xVal) { + xVal.connect(this.listener.upX); + } + + return this.listener.upX.value; + }, + }, + { + key: "upY", + value: function upY(yVal, time) { + var t = time || 0; + + if (typeof yVal === "number") { + this.listener.upY.value = yVal; + this.listener.upY.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.upY.linearRampToValueAtTime( + yVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (yVal) { + yVal.connect(this.listener.upY); + } + + return this.listener.upY.value; + }, + }, + { + key: "upZ", + value: function upZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === "number") { + this.listener.upZ.value = zVal; + this.listener.upZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.listener.upZ.linearRampToValueAtTime( + zVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (zVal) { + zVal.connect(this.listener.upZ); + } + + return this.listener.upZ.value; + }, + }, + ]); + + return Listener3D; + })(); + + var listener3d = listener3d_Listener3D; + function panner3d_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + panner3d_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + panner3d_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return panner3d_typeof(obj); + } + + function panner3d_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function panner3d_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function panner3d_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + panner3d_defineProperties(Constructor.prototype, protoProps); + if (staticProps) panner3d_defineProperties(Constructor, staticProps); + return Constructor; + } + + function panner3d_possibleConstructorReturn(self, call) { + if ( + call && + (panner3d_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return panner3d_assertThisInitialized(self); + } + + function panner3d_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function panner3d_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + panner3d_get = Reflect.get; + } else { + panner3d_get = function _get(target, property, receiver) { + var base = panner3d_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return panner3d_get(target, property, receiver || target); + } + + function panner3d_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = panner3d_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function panner3d_getPrototypeOf(o) { + panner3d_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return panner3d_getPrototypeOf(o); + } + + function panner3d_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) panner3d_setPrototypeOf(subClass, superClass); + } + + function panner3d_setPrototypeOf(o, p) { + panner3d_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return panner3d_setPrototypeOf(o, p); + } + + /** + * Panner3D is based on the + * Web Audio Spatial Panner Node. + * This panner is a spatial processing node that allows audio to be positioned + * and oriented in 3D space. + * + * The position is relative to an + * Audio Context Listener, which can be accessed + * by p5.soundOut.audiocontext.listener + * + * + * @class p5.Panner3D + * @constructor + */ + + var Panner3D = (function (_Effect) { + panner3d_inherits(Panner3D, _Effect); + + function Panner3D() { + var _this; + + panner3d_classCallCheck(this, Panner3D); + + _this = panner3d_possibleConstructorReturn( + this, + panner3d_getPrototypeOf(Panner3D).call(this), + ); + /** + * + * Web Audio Spatial Panner Node + * + * Properties include
            + * [Panning Model](https://www.w3.org/TR/webaudio/#idl-def-PanningModelType) + * : "equal power" or "HRTF"
            + * [DistanceModel](https://www.w3.org/TR/webaudio/#idl-def-DistanceModelType) + * : "linear", "inverse", or "exponential" + * + * @property {AudioNode} panner + * + */ + + _this.panner = _this.ac.createPanner(); + _this.panner.panningModel = "HRTF"; + _this.panner.distanceModel = "linear"; + + _this.panner.connect(_this.output); + + _this.input.connect(_this.panner); + + return _this; + } + /** + * Connect an audio sorce + * + * @method process + * @for p5.Panner3D + * @param {Object} src Input source + */ + + panner3d_createClass(Panner3D, [ + { + key: "process", + value: function process(src) { + src.connect(this.input); + }, + /** + * Set the X,Y,Z position of the Panner + * @method set + * @for p5.Panner3D + * @param {Number} xVal + * @param {Number} yVal + * @param {Number} zVal + * @param {Number} time + * @return {Array} Updated x, y, z values as an array + */ + }, + { + key: "set", + value: function set(xVal, yVal, zVal, time) { + this.positionX(xVal, time); + this.positionY(yVal, time); + this.positionZ(zVal, time); + return [ + this.panner.positionX.value, + this.panner.positionY.value, + this.panner.positionZ.value, + ]; + }, + /** + * Getter and setter methods for position coordinates + * @method positionX + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for position coordinates + * @method positionY + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for position coordinates + * @method positionZ + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + }, + { + key: "positionX", + value: function positionX(xVal, time) { + var t = time || 0; + + if (typeof xVal === "number") { + this.panner.positionX.value = xVal; + this.panner.positionX.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.panner.positionX.linearRampToValueAtTime( + xVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (xVal) { + xVal.connect(this.panner.positionX); + } + + return this.panner.positionX.value; + }, + }, + { + key: "positionY", + value: function positionY(yVal, time) { + var t = time || 0; + + if (typeof yVal === "number") { + this.panner.positionY.value = yVal; + this.panner.positionY.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.panner.positionY.linearRampToValueAtTime( + yVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (yVal) { + yVal.connect(this.panner.positionY); + } + + return this.panner.positionY.value; + }, + }, + { + key: "positionZ", + value: function positionZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === "number") { + this.panner.positionZ.value = zVal; + this.panner.positionZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.panner.positionZ.linearRampToValueAtTime( + zVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (zVal) { + zVal.connect(this.panner.positionZ); + } + + return this.panner.positionZ.value; + }, + /** + * Set the X,Y,Z position of the Panner + * @method orient + * @for p5.Panner3D + * @param {Number} xVal + * @param {Number} yVal + * @param {Number} zVal + * @param {Number} time + * @return {Array} Updated x, y, z values as an array + */ + }, + { + key: "orient", + value: function orient(xVal, yVal, zVal, time) { + this.orientX(xVal, time); + this.orientY(yVal, time); + this.orientZ(zVal, time); + return [ + this.panner.orientationX.value, + this.panner.orientationY.value, + this.panner.orientationZ.value, + ]; + }, + /** + * Getter and setter methods for orient coordinates + * @method orientX + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for orient coordinates + * @method orientY + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for orient coordinates + * @method orientZ + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + }, + { + key: "orientX", + value: function orientX(xVal, time) { + var t = time || 0; + + if (typeof xVal === "number") { + this.panner.orientationX.value = xVal; + this.panner.orientationX.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.panner.orientationX.linearRampToValueAtTime( + xVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (xVal) { + xVal.connect(this.panner.orientationX); + } + + return this.panner.orientationX.value; + }, + }, + { + key: "orientY", + value: function orientY(yVal, time) { + var t = time || 0; + + if (typeof yVal === "number") { + this.panner.orientationY.value = yVal; + this.panner.orientationY.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.panner.orientationY.linearRampToValueAtTime( + yVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (yVal) { + yVal.connect(this.panner.orientationY); + } + + return this.panner.orientationY.value; + }, + }, + { + key: "orientZ", + value: function orientZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === "number") { + this.panner.orientationZ.value = zVal; + this.panner.orientationZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.panner.orientationZ.linearRampToValueAtTime( + zVal, + this.ac.currentTime + 0.02 + t, + ); + } else if (zVal) { + zVal.connect(this.panner.orientationZ); + } + + return this.panner.orientationZ.value; + }, + /** + * Set the rolloff factor and max distance + * @method setFalloff + * @for p5.Panner3D + * @param {Number} [maxDistance] + * @param {Number} [rolloffFactor] + */ + }, + { + key: "setFalloff", + value: function setFalloff(maxDistance, rolloffFactor) { + this.maxDist(maxDistance); + this.rolloff(rolloffFactor); + }, + /** + * Maxium distance between the source and the listener + * @method maxDist + * @for p5.Panner3D + * @param {Number} maxDistance + * @return {Number} updated value + */ + }, + { + key: "maxDist", + value: function maxDist(maxDistance) { + if (typeof maxDistance === "number") { + this.panner.maxDistance = maxDistance; + } + + return this.panner.maxDistance; + }, + /** + * How quickly the volume is reduced as the source moves away from the listener + * @method rollof + * @for p5.Panner3D + * @param {Number} rolloffFactor + * @return {Number} updated value + */ + }, + { + key: "rolloff", + value: function rolloff(rolloffFactor) { + if (typeof rolloffFactor === "number") { + this.panner.rolloffFactor = rolloffFactor; + } + + return this.panner.rolloffFactor; + }, + }, + { + key: "dispose", + value: function dispose() { + panner3d_get( + panner3d_getPrototypeOf(Panner3D.prototype), + "dispose", + this, + ).call(this); + + if (this.panner) { + this.panner.disconnect(); + delete this.panner; + } + }, + }, + ]); + + return Panner3D; + })(effect); + + var panner3d = Panner3D; + function delay_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + delay_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + delay_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return delay_typeof(obj); + } + + function delay_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function delay_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function delay_createClass(Constructor, protoProps, staticProps) { + if (protoProps) delay_defineProperties(Constructor.prototype, protoProps); + if (staticProps) delay_defineProperties(Constructor, staticProps); + return Constructor; + } + + function delay_possibleConstructorReturn(self, call) { + if ( + call && + (delay_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return delay_assertThisInitialized(self); + } + + function delay_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function delay_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + delay_get = Reflect.get; + } else { + delay_get = function _get(target, property, receiver) { + var base = delay_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return delay_get(target, property, receiver || target); + } + + function delay_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = delay_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function delay_getPrototypeOf(o) { + delay_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return delay_getPrototypeOf(o); + } + + function delay_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) delay_setPrototypeOf(subClass, superClass); + } + + function delay_setPrototypeOf(o, p) { + delay_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return delay_setPrototypeOf(o, p); + } + + /** + * Delay is an echo effect. It processes an existing sound source, + * and outputs a delayed version of that sound. The p5.Delay can + * produce different effects depending on the delayTime, feedback, + * filter, and type. In the example below, a feedback of 0.5 (the + * default value) will produce a looping delay that decreases in + * volume by 50% each repeat. A filter will cut out the high + * frequencies so that the delay does not sound as piercing as the + * original source. + * + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * @class p5.Delay + * @extends p5.Effect + * @constructor + * @example + *
            + * let osc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * textAlign(CENTER); + * text('tap to play', width/2, height/2); + * + * osc = new p5.Oscillator('square'); + * osc.amp(0.5); + * delay = new p5.Delay(); + * + * // delay.process() accepts 4 parameters: + * // source, delayTime (in seconds), feedback, filter frequency + * delay.process(osc, 0.12, .7, 2300); + * + * cnv.mousePressed(oscStart); + * } + * + * function oscStart() { + * osc.start(); + * } + * + * function mouseReleased() { + * osc.stop(); + * } + *
            + */ + + var delay_Delay = (function (_Effect) { + delay_inherits(Delay, _Effect); + + function Delay() { + var _this; + + delay_classCallCheck(this, Delay); + + _this = delay_possibleConstructorReturn( + this, + delay_getPrototypeOf(Delay).call(this), + ); + _this._split = _this.ac.createChannelSplitter(2); + _this._merge = _this.ac.createChannelMerger(2); + _this._leftGain = _this.ac.createGain(); + _this._rightGain = _this.ac.createGain(); + /** + * The p5.Delay is built with two + * + * Web Audio Delay Nodes, one for each stereo channel. + * + * @for p5.Delay + * @property {DelayNode} leftDelay + */ + + _this.leftDelay = _this.ac.createDelay(); + /** + * The p5.Delay is built with two + * + * Web Audio Delay Nodes, one for each stereo channel. + * @for p5.Delay + * @property {DelayNode} rightDelay + */ + + _this.rightDelay = _this.ac.createDelay(); + _this._leftFilter = new filter(); + _this._rightFilter = new filter(); + + _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(0.3, _this.ac.currentTime); + + _this._rightFilter.biquad.Q.setValueAtTime(0.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(0.5); + + return _this; + } + /** + * Add delay to an audio signal according to a set + * of delay parameters. + * + * @method process + * @for p5.Delay + * @param {Object} Signal An object that outputs audio + * @param {Number} [delayTime] Time (in seconds) of the delay/echo. + * Some browsers limit delayTime to + * 1 second. + * @param {Number} [feedback] sends the delay back through itself + * in a loop that decreases in volume + * each time. + * @param {Number} [lowPass] Cutoff frequency. Only frequencies + * below the lowPass will be part of the + * delay. + */ + + delay_createClass(Delay, [ + { + key: "process", + value: function process(src, _delayTime, _feedback, _filter) { + var feedback = _feedback || 0; + var delayTime = _delayTime || 0; + + if (feedback >= 1.0) { + throw new Error( + "Feedback value will force a positive feedback loop.", + ); + } + + if (delayTime >= this._maxDelay) { + throw new Error( + "Delay Time exceeds maximum delay time of " + + this._maxDelay + + " second.", + ); + } + + src.connect(this.input); + this.leftDelay.delayTime.setValueAtTime( + delayTime, + this.ac.currentTime, + ); + this.rightDelay.delayTime.setValueAtTime( + delayTime, + this.ac.currentTime, + ); + this._leftGain.gain.value = feedback; + this._rightGain.gain.value = feedback; + + if (_filter) { + this._leftFilter.freq(_filter); + + this._rightFilter.freq(_filter); + } + }, + /** + * Set the delay (echo) time, in seconds. Usually this value will be + * a floating point number between 0.0 and 1.0. + * + * @method delayTime + * @for p5.Delay + * @param {Number} delayTime Time (in seconds) of the delay + */ + }, + { + key: "delayTime", + value: function delayTime(t) { + if (typeof t !== "number") { + t.connect(this.leftDelay.delayTime); + t.connect(this.rightDelay.delayTime); + } else { + 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, + ); + } + }, + /** + * Feedback occurs when Delay sends its signal back through its input + * in a loop. The feedback amount determines how much signal to send each + * time through the loop. A feedback greater than 1.0 is not desirable because + * it will increase the overall output each time through the loop, + * creating an infinite feedback loop. The default value is 0.5 + * + * @method feedback + * @for p5.Delay + * @param {Number|Object} feedback 0.0 to 1.0, or an object such as an + * Oscillator that can be used to + * modulate this param + * @returns {Number} Feedback value + * + */ + }, + { + key: "feedback", + value: function feedback(f) { + if (f && typeof f !== "number") { + f.connect(this._leftGain.gain); + f.connect(this._rightGain.gain); + } else if (f >= 1.0) { + throw new Error( + "Feedback value will force a positive feedback loop.", + ); + } else if (typeof f === "number") { + this._leftGain.gain.value = f; + this._rightGain.gain.value = f; + } + + return this._leftGain.gain.value; + }, + /** + * Set a lowpass filter frequency for the delay. A lowpass filter + * will cut off any frequencies higher than the filter frequency. + * + * @method filter + * @for p5.Delay + * @param {Number|Object} cutoffFreq A lowpass filter will cut off any + * frequencies higher than the filter frequency. + * @param {Number|Object} res Resonance of the filter frequency + * cutoff, or an object (i.e. a p5.Oscillator) + * that can be used to modulate this parameter. + * High numbers (i.e. 15) will produce a resonance, + * low numbers (i.e. .2) will produce a slope. + */ + }, + { + key: "filter", + value: function filter(freq, q) { + this._leftFilter.set(freq, q); + + this._rightFilter.set(freq, q); + }, + /** + * Choose a preset type of delay. 'pingPong' bounces the signal + * from the left to the right channel to produce a stereo effect. + * Any other parameter will revert to the default delay setting. + * + * @method setType + * @for p5.Delay + * @param {String|Number} type 'pingPong' (1) or 'default' (0) + */ + }, + { + key: "setType", + value: function setType(t) { + if (t === 1) { + t = "pingPong"; + } + + this._split.disconnect(); + + this._leftFilter.disconnect(); + + this._rightFilter.disconnect(); + + this._split.connect(this.leftDelay, 0); + + this._split.connect(this.rightDelay, 1); + + switch (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); + } + }, + + /** + * Set the output level of the delay effect. + * + * @method amp + * @for p5.Delay + * @param {Number} volume amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + + /** + * Send output to a p5.sound or web audio object + * + * @method connect + * @for p5.Delay + * @param {Object} unit + */ + + /** + * Disconnect all output. + * + * @method disconnect + * @for p5.Delay + */ + }, + { + key: "dispose", + value: function dispose() { + delay_get( + delay_getPrototypeOf(Delay.prototype), + "dispose", + this, + ).call(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 = undefined; + this._leftFilter = undefined; + this._rightFilter = undefined; + this._merge = undefined; + this._leftGain = undefined; + this._rightGain = undefined; + this.leftDelay = undefined; + this.rightDelay = undefined; + }, + }, + ]); + + return Delay; + })(effect); + + var delay = delay_Delay; + function reverb_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + reverb_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + reverb_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return reverb_typeof(obj); + } + + function reverb_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function reverb_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function reverb_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + reverb_defineProperties(Constructor.prototype, protoProps); + if (staticProps) reverb_defineProperties(Constructor, staticProps); + return Constructor; + } + + function reverb_possibleConstructorReturn(self, call) { + if ( + call && + (reverb_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return reverb_assertThisInitialized(self); + } + + function reverb_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function reverb_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + reverb_get = Reflect.get; + } else { + reverb_get = function _get(target, property, receiver) { + var base = reverb_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return reverb_get(target, property, receiver || target); + } + + function reverb_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = reverb_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function reverb_getPrototypeOf(o) { + reverb_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return reverb_getPrototypeOf(o); + } + + function reverb_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) reverb_setPrototypeOf(subClass, superClass); + } + + function reverb_setPrototypeOf(o, p) { + reverb_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return reverb_setPrototypeOf(o, p); + } + + /** + * Reverb adds depth to a sound through a large number of decaying + * echoes. It creates the perception that sound is occurring in a + * physical space. The p5.Reverb has paramters for Time (how long does the + * reverb last) and decayRate (how much the sound decays with each echo) + * that can be set with the .set() or .process() methods. The p5.Convolver + * extends p5.Reverb allowing you to recreate the sound of actual physical + * spaces through convolution. + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Reverb + * @extends p5.Effect + * @constructor + * @example + *
            + * let soundFile, reverb; + * function preload() { + * soundFile = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * + * reverb = new p5.Reverb(); + * soundFile.disconnect(); // so we'll only hear reverb... + * + * // connect soundFile to reverb, process w/ + * // 3 second reverbTime, decayRate of 2% + * reverb.process(soundFile, 3, 2); + * } + * + * function draw() { + * let dryWet = constrain(map(mouseX, 0, width, 0, 1), 0, 1); + * // 1 = all reverb, 0 = no reverb + * reverb.drywet(dryWet); + * + * background(220); + * text('tap to play', 10, 20); + * text('dry/wet: ' + round(dryWet * 100) + '%', 10, height - 20); + * } + * + * function playSound() { + * soundFile.play(); + * } + *
            + */ + + var Reverb = (function (_Effect) { + reverb_inherits(Reverb, _Effect); + + function Reverb() { + var _this; + + reverb_classCallCheck(this, Reverb); + + _this = reverb_possibleConstructorReturn( + this, + reverb_getPrototypeOf(Reverb).call(this), + ); + + _this._initConvolverNode(); + + _this.input.gain.value = 0.5; + + _this._seconds = 3; + _this._decay = 2; + _this._reverse = false; + + _this._buildImpulse(); + + return _this; + } + + reverb_createClass(Reverb, [ + { + key: "_initConvolverNode", + value: function _initConvolverNode() { + this.convolverNode = this.ac.createConvolver(); + this.input.connect(this.convolverNode); + this.convolverNode.connect(this.wet); + }, + }, + { + key: "_teardownConvolverNode", + value: function _teardownConvolverNode() { + if (this.convolverNode) { + this.convolverNode.disconnect(); + delete this.convolverNode; + } + }, + }, + { + key: "_setBuffer", + value: function _setBuffer(audioBuffer) { + this._teardownConvolverNode(); + + this._initConvolverNode(); + + this.convolverNode.buffer = audioBuffer; + }, + /** + * Connect a source to the reverb, and assign reverb parameters. + * + * @method process + * @for p5.Reverb + * @param {Object} src p5.sound / Web Audio object with a sound + * output. + * @param {Number} [seconds] Duration of the reverb, in seconds. + * Min: 0, Max: 10. Defaults to 3. + * @param {Number} [decayRate] Percentage of decay with each echo. + * Min: 0, Max: 100. Defaults to 2. + * @param {Boolean} [reverse] Play the reverb backwards or forwards. + */ + }, + { + key: "process", + value: function process(src, seconds, decayRate, reverse) { + src.connect(this.input); + var rebuild = false; + + if (seconds) { + this._seconds = seconds; + rebuild = true; + } + + if (decayRate) { + this._decay = decayRate; + } + + if (reverse) { + this._reverse = reverse; + } + + if (rebuild) { + this._buildImpulse(); + } + }, + /** + * Set the reverb settings. Similar to .process(), but without + * assigning a new input. + * + * @method set + * @for p5.Reverb + * @param {Number} [seconds] Duration of the reverb, in seconds. + * Min: 0, Max: 10. Defaults to 3. + * @param {Number} [decayRate] Percentage of decay with each echo. + * Min: 0, Max: 100. Defaults to 2. + * @param {Boolean} [reverse] Play the reverb backwards or forwards. + */ + }, + { + key: "set", + value: function set(seconds, decayRate, reverse) { + var rebuild = false; + + if (seconds) { + this._seconds = seconds; + rebuild = true; + } + + if (decayRate) { + this._decay = decayRate; + } + + if (reverse) { + this._reverse = reverse; + } + + if (rebuild) { + this._buildImpulse(); + } + }, + + /** + * Set the output level of the reverb effect. + * + * @method amp + * @for p5.Reverb + * @param {Number} volume amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + + /** + * Send output to a p5.sound or web audio object + * + * @method connect + * @for p5.Reverb + * @param {Object} unit + */ + + /** + * Disconnect all output. + * + * @method disconnect + * @for p5.Reverb + */ + + /** + * Inspired by Simple Reverb by Jordan Santell + * https://github.com/web-audio-components/simple-reverb/blob/master/index.js + * + * Utility function for building an impulse response + * based on the module parameters. + * + * @private + */ + }, + { + key: "_buildImpulse", + value: function _buildImpulse() { + var rate = this.ac.sampleRate; + var length = rate * this._seconds; + var decay = this._decay; + var impulse = this.ac.createBuffer(2, length, rate); + var impulseL = impulse.getChannelData(0); + var impulseR = impulse.getChannelData(1); + var n, i; + + for (i = 0; i < length; i++) { + n = this._reverse ? length - i : i; + impulseL[i] = + (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); + impulseR[i] = + (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); + } + + this._setBuffer(impulse); + }, + }, + { + key: "dispose", + value: function dispose() { + reverb_get( + reverb_getPrototypeOf(Reverb.prototype), + "dispose", + this, + ).call(this); + + this._teardownConvolverNode(); + }, + }, + ]); + + return Reverb; + })(effect); + + /** + *

            p5.Convolver extends p5.Reverb. It can emulate the sound of real + * physical spaces through a process called + * convolution.

            + * + *

            Convolution multiplies any audio input by an "impulse response" + * to simulate the dispersion of sound over time. The impulse response is + * generated from an audio file that you provide. One way to + * generate an impulse response is to pop a balloon in a reverberant space + * and record the echo. Convolution can also be used to experiment with + * sound.

            + * + *

            Use the method createConvolution(path) to instantiate a + * p5.Convolver with a path to your impulse response audio file.

            + * + * @class p5.Convolver + * @extends p5.Effect + * @constructor + * @param {String} path path to a sound file + * @param {Function} [callback] function to call when loading succeeds + * @param {Function} [errorCallback] function to call if loading fails. + * This function will receive an error or + * XMLHttpRequest object with information + * about what went wrong. + * @example + *
            + * let cVerb, sound; + * function preload() { + * // We have both MP3 and OGG versions of all sound assets + * soundFormats('ogg', 'mp3'); + * + * // Try replacing 'bx-spring' with other soundfiles like + * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' + * cVerb = createConvolver('assets/bx-spring.mp3'); + * + * // Try replacing 'Damscray_DancingTiger' with + * // 'beat', 'doorbell', lucky_dragons_-_power_melody' + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * background(220); + * text('tap to play', 20, 20); + * + * // disconnect from main output... + * sound.disconnect(); + * + * // ...and process with cVerb + * // so that we only hear the convolution + * cVerb.process(sound); + * } + * + * function playSound() { + * sound.play(); + * } + *
            + */ + + var reverb_Convolver = (function (_Reverb) { + reverb_inherits(Convolver, _Reverb); + + function Convolver(path, callback, errorCallback) { + var _this2; + + reverb_classCallCheck(this, Convolver); + + _this2 = reverb_possibleConstructorReturn( + this, + reverb_getPrototypeOf(Convolver).call(this), + ); + /** + * Internally, the p5.Convolver uses the a + * + * Web Audio Convolver Node. + * + * @property {ConvolverNode} convolverNode + */ + + _this2._initConvolverNode(); + + _this2.input.gain.value = 0.5; + + if (path) { + _this2.impulses = []; + + _this2._loadBuffer(path, callback, errorCallback); + } else { + _this2._seconds = 3; + _this2._decay = 2; + _this2._reverse = false; + + _this2._buildImpulse(); + } + /** + * If you load multiple impulse files using the .addImpulse method, + * they will be stored as Objects in this Array. Toggle between them + * with the toggleImpulse(id) method. + * + * @property {Array} impulses + * @for p5.Convolver + */ + + _this2.impulses = []; + _this2.set = null; + return _this2; + } + /** + * Private method to load a buffer as an Impulse Response, + * assign it to the convolverNode, and add to the Array of .impulses. + * + * @param {String} path + * @param {Function} callback + * @param {Function} errorCallback + * @private + */ + + reverb_createClass(Convolver, [ + { + key: "_loadBuffer", + value: function _loadBuffer(_path, callback, errorCallback) { + var path = p5.prototype._checkFileFormats(_path); + + var self = this; + var errorTrace = new Error().stack; + var ac = Object(audiocontext["b"])(); + var request = new XMLHttpRequest(); + request.open("GET", path, true); + request.responseType = "arraybuffer"; + + request.onload = function () { + if (request.status === 200) { + ac.decodeAudioData( + request.response, + function (buff) { + var buffer = {}; + var chunks = path.split("/"); + buffer.name = chunks[chunks.length - 1]; + buffer.audioBuffer = buff; + self.impulses.push(buffer); + + self._setBuffer(buffer.audioBuffer); + + if (callback) { + callback(buffer); + } + }, + function () { + var err = new errorHandler( + "decodeAudioData", + errorTrace, + self.url, + ); + var msg = + "AudioContext error at decodeAudioData for " + self.url; + + if (errorCallback) { + err.msg = msg; + errorCallback(err); + } else { + console.error( + msg + + "\n The error stack trace includes: \n" + + err.stack, + ); + } + }, + ); + } else { + var err = new errorHandler( + "loadConvolver", + errorTrace, + self.url, + ); + var msg = + "Unable to load " + + self.url + + ". The request status was: " + + request.status + + " (" + + request.statusText + + ")"; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error( + msg + "\n The error stack trace includes: \n" + err.stack, + ); + } + } + }; + + request.onerror = function () { + var err = new errorHandler("loadConvolver", errorTrace, self.url); + var msg = + "There was no response from the server at " + + self.url + + ". Check the url and internet connectivity."; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error( + msg + "\n The error stack trace includes: \n" + err.stack, + ); + } + }; + + request.send(); + }, + /** + * Connect a source to the convolver. + * + * @method process + * @for p5.Convolver + * @param {Object} src p5.sound / Web Audio object with a sound + * output. + * @example + *
            + * let cVerb, sound; + * function preload() { + * // We have both MP3 and OGG versions of all sound assets + * soundFormats('ogg', 'mp3'); + * + * // Try replacing 'bx-spring' with other soundfiles like + * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' + * cVerb = createConvolver('assets/bx-spring.mp3'); + * + * // Try replacing 'Damscray_DancingTiger' with + * // 'beat', 'doorbell', lucky_dragons_-_power_melody' + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * background(220); + * text('tap to play', 20, 20); + * + * // disconnect from main output... + * sound.disconnect(); + * + * // ...and process with cVerb + * // so that we only hear the convolution + * cVerb.process(sound); + * } + * + * function playSound() { + * sound.play(); + * } + * + *
            + */ + }, + { + key: "process", + value: function process(src) { + src.connect(this.input); + }, + /** + * Load and assign a new Impulse Response to the p5.Convolver. + * The impulse is added to the .impulses array. Previous + * impulses can be accessed with the .toggleImpulse(id) + * method. + * + * @method addImpulse + * @for p5.Convolver + * @param {String} path path to a sound file + * @param {Function} callback function (optional) + * @param {Function} errorCallback function (optional) + */ + }, + { + key: "addImpulse", + value: function addImpulse(path, callback, errorCallback) { + if ( + window.location.origin.indexOf("file://") > -1 && + window.cordova === "undefined" + ) { + alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ); + } + + this._loadBuffer(path, callback, errorCallback); + }, + /** + * Similar to .addImpulse, except that the .impulses + * Array is reset to save memory. A new .impulses + * array is created with this impulse as the only item. + * + * @method resetImpulse + * @for p5.Convolver + * @param {String} path path to a sound file + * @param {Function} callback function (optional) + * @param {Function} errorCallback function (optional) + */ + }, + { + key: "resetImpulse", + value: function resetImpulse(path, callback, errorCallback) { + if ( + window.location.origin.indexOf("file://") > -1 && + window.cordova === "undefined" + ) { + alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ); + } + + this.impulses = []; + + this._loadBuffer(path, callback, errorCallback); + }, + /** + * If you have used .addImpulse() to add multiple impulses + * to a p5.Convolver, then you can use this method to toggle between + * the items in the .impulses Array. Accepts a parameter + * to identify which impulse you wish to use, identified either by its + * original filename (String) or by its position in the .impulses + * Array (Number).
            + * You can access the objects in the .impulses Array directly. Each + * Object has two attributes: an .audioBuffer (type: + * Web Audio + * AudioBuffer) and a .name, a String that corresponds + * with the original filename. + * + * @method toggleImpulse + * @for p5.Convolver + * @param {String|Number} id Identify the impulse by its original filename + * (String), or by its position in the + * .impulses Array (Number). + */ + }, + { + key: "toggleImpulse", + value: function toggleImpulse(id) { + if (typeof id === "number" && id < this.impulses.length) { + this._setBuffer(this.impulses[id].audioBuffer); + } + + if (typeof id === "string") { + for (var i = 0; i < this.impulses.length; i++) { + if (this.impulses[i].name === id) { + this._setBuffer(this.impulses[i].audioBuffer); + + break; + } + } + } + }, + }, + { + key: "dispose", + value: function dispose() { + reverb_get( + reverb_getPrototypeOf(Convolver.prototype), + "dispose", + this, + ).call(this); + + for (var i in this.impulses) { + if (this.impulses[i]) { + this.impulses[i] = null; + } + } + }, + }, + ]); + + return Convolver; + })(Reverb); + /** + * Create a p5.Convolver. Accepts a path to a soundfile + * that will be used to generate an impulse response. + * + * @method createConvolver + * @for p5 + * @param {String} path path to a sound file + * @param {Function} [callback] function to call if loading is successful. + * The object will be passed in as the argument + * to the callback function. + * @param {Function} [errorCallback] function to call if loading is not successful. + * A custom error will be passed in as the argument + * to the callback function. + * @return {p5.Convolver} + * @example + *
            + * let cVerb, sound; + * function preload() { + * // We have both MP3 and OGG versions of all sound assets + * soundFormats('ogg', 'mp3'); + * + * // Try replacing 'bx-spring' with other soundfiles like + * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' + * cVerb = createConvolver('assets/bx-spring.mp3'); + * + * // Try replacing 'Damscray_DancingTiger' with + * // 'beat', 'doorbell', lucky_dragons_-_power_melody' + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * background(220); + * text('tap to play', 20, 20); + * + * // disconnect from main output... + * sound.disconnect(); + * + * // ...and process with cVerb + * // so that we only hear the convolution + * cVerb.process(sound); + * } + * + * function playSound() { + * sound.play(); + * } + *
            + */ + + function createConvolver(path, callback, errorCallback) { + if ( + window.location.origin.indexOf("file://") > -1 && + window.cordova === "undefined" + ) { + alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ); + } + + var self = this; + var cReverb = new reverb_Convolver( + path, + function (buffer) { + if (typeof callback === "function") { + callback(buffer); + } + + if (typeof self._decrementPreload === "function") { + self._decrementPreload(); + } + }, + errorCallback, + ); + cReverb.impulses = []; + return cReverb; + } + + var Clock = __webpack_require__(11); + var Clock_default = __webpack_require__.n(Clock); + + function metro_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function metro_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function metro_createClass(Constructor, protoProps, staticProps) { + if (protoProps) metro_defineProperties(Constructor.prototype, protoProps); + if (staticProps) metro_defineProperties(Constructor, staticProps); + return Constructor; + } + + var metro_Metro = (function () { + function Metro() { + metro_classCallCheck(this, Metro); + + this.clock = new Clock_default.a({ + callback: this.ontick.bind(this), + }); + this.syncedParts = []; + this.bpm = 120; + + this._init(); + + this.prevTick = 0; + this.tatumTime = 0; + + this.tickCallback = function () {}; + } + + metro_createClass(Metro, [ + { + key: "ontick", + value: function ontick(tickTime) { + var elapsedTime = tickTime - this.prevTick; + var secondsFromNow = tickTime - main.audiocontext.currentTime; + + if (elapsedTime - this.tatumTime <= -0.02) { + return; + } else { + this.prevTick = tickTime; + + var self = this; + this.syncedParts.forEach(function (thisPart) { + if (!thisPart.isPlaying) return; + thisPart.incrementStep(secondsFromNow); + + thisPart.phrases.forEach(function (thisPhrase) { + var phraseArray = thisPhrase.sequence; + var bNum = self.metroTicks % phraseArray.length; + + if ( + phraseArray[bNum] !== 0 && + (self.metroTicks < phraseArray.length || + !thisPhrase.looping) + ) { + thisPhrase.callback(secondsFromNow, phraseArray[bNum]); + } + }); + }); + this.metroTicks += 1; + this.tickCallback(secondsFromNow); + } + }, + }, + { + key: "setBPM", + value: function setBPM(bpm) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var beatTime = 60 / (bpm * this.tatums); + var now = main.audiocontext.currentTime; + this.tatumTime = beatTime; + this.clock.frequency.setValueAtTime( + this.clock.frequency.value, + now, + ); + this.clock.frequency.linearRampToValueAtTime(bpm, now + rampTime); + this.bpm = bpm; + }, + }, + { + key: "getBPM", + value: function getBPM() { + return (this.clock.getRate() / this.tatums) * 60; + }, + }, + { + key: "_init", + value: function _init() { + this.metroTicks = 0; + }, + }, + { + key: "resetSync", + value: function resetSync(part) { + this.syncedParts = [part]; + }, + }, + { + key: "pushSync", + value: function pushSync(part) { + this.syncedParts.push(part); + }, + }, + { + key: "start", + value: function start(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + this.clock.start(now + t); + this.setBPM(this.bpm); + }, + }, + { + key: "stop", + value: function stop(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + this.clock.stop(now + t); + }, + }, + { + key: "beatLength", + value: function beatLength(tatums) { + this.tatums = 1 / tatums / 4; + }, + }, + ]); + + return Metro; + })(); + + var metro = metro_Metro; + function looper_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function looper_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + looper_defineProperties(Constructor.prototype, protoProps); + if (staticProps) looper_defineProperties(Constructor, staticProps); + return Constructor; + } + + function looper_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var BPM = 120; + /** + * Set the global tempo, in beats per minute, for all + * p5.Parts. This method will impact all active p5.Parts. + * + * @method setBPM + * @for p5 + * @param {Number} BPM Beats Per Minute + * @param {Number} rampTime Seconds from now + */ + + p5.prototype.setBPM = function (bpm, rampTime) { + BPM = bpm; + + for (var i in main.parts) { + if (main.parts[i]) { + main.parts[i].setBPM(bpm, rampTime); + } + } + }; + /** + *

            A phrase is a pattern of musical events over time, i.e. + * a series of notes and rests.

            + * + *

            Phrases must be added to a p5.Part for playback, and + * each part can play multiple phrases at the same time. + * For example, one Phrase might be a kick drum, another + * could be a snare, and another could be the bassline.

            + * + *

            The first parameter is a name so that the phrase can be + * modified or deleted later. The callback is a a function that + * this phrase will call at every step—for example it might be + * called playNote(value){}. The array determines + * which value is passed into the callback at each step of the + * phrase. It can be numbers, an object with multiple numbers, + * or a zero (0) indicates a rest so the callback won't be called).

            + * + * @class p5.Phrase + * @constructor + * @param {String} name Name so that you can access the Phrase. + * @param {Function} callback The name of a function that this phrase + * will call. Typically it will play a sound, + * and accept two parameters: a time at which + * to play the sound (in seconds from now), + * and a value from the sequence array. The + * time should be passed into the play() or + * start() method to ensure precision. + * @param {Array} sequence Array of values to pass into the callback + * at each step of the phrase. + * @example + *
            + * let mySound, myPhrase, myPart; + * let pattern = [1,0,0,2,0,2,0,0]; + * + * function preload() { + * mySound = loadSound('assets/beatbox.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playMyPart); + * background(220); + * text('tap to play', width/2, height/2); + * textAlign(CENTER, CENTER); + * + * myPhrase = new p5.Phrase('bbox', onEachStep, pattern); + * myPart = new p5.Part(); + * myPart.addPhrase(myPhrase); + * myPart.setBPM(60); + * } + * + * function onEachStep(time, playbackRate) { + * mySound.rate(playbackRate); + * mySound.play(time); + * } + * + * function playMyPart() { + * userStartAudio(); + * myPart.start(); + * } + *
            + */ + + var Phrase = function Phrase(name, callback, sequence) { + looper_classCallCheck(this, Phrase); + + this.phraseStep = 0; + this.name = name; + this.callback = callback; + /** + * Array of values to pass into the callback + * at each step of the phrase. Depending on the callback + * function's requirements, these values may be numbers, + * strings, or an object with multiple parameters. + * Zero (0) indicates a rest. + * + * @property {Array} sequence + */ + + this.sequence = sequence; + }; + /** + *

            A p5.Part plays back one or more p5.Phrases. Instantiate a part + * with steps and tatums. By default, each step represents a 1/16th note.

            + * + *

            See p5.Phrase for more about musical timing.

            + * + * @class p5.Part + * @constructor + * @param {Number} [steps] Steps in the part + * @param {Number} [tatums] Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note) + * @example + *
            + * let box, drum, myPart; + * let boxPat = [1,0,0,2,0,2,0,0]; + * let drumPat = [0,1,1,0,2,0,1,0]; + * + * function preload() { + * box = loadSound('assets/beatbox.mp3'); + * drum = loadSound('assets/drum.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playMyPart); + * background(220); + * textAlign(CENTER, CENTER); + * text('tap to play', width/2, height/2); + * + * let boxPhrase = new p5.Phrase('box', playBox, boxPat); + * let drumPhrase = new p5.Phrase('drum', playDrum, drumPat); + * myPart = new p5.Part(); + * myPart.addPhrase(boxPhrase); + * myPart.addPhrase(drumPhrase); + * myPart.setBPM(60); + * } + * + * function playBox(time, playbackRate) { + * box.rate(playbackRate); + * box.play(time); + * } + * + * function playDrum(time, playbackRate) { + * drum.rate(playbackRate); + * drum.play(time); + * } + * + * function playMyPart() { + * userStartAudio(); + * + * myPart.start(); + * } + *
            + */ + + var looper_Part = (function () { + function Part(steps, bLength) { + looper_classCallCheck(this, Part); + + this.length = steps || 0; + + this.partStep = 0; + this.phrases = []; + this.isPlaying = false; + this.noLoop(); + this.tatums = bLength || 0.0625; + + this.metro = new metro(); + + this.metro._init(); + + this.metro.beatLength(this.tatums); + this.metro.setBPM(BPM); + main.parts.push(this); + + this.callback = function () {}; + } + /** + * Set the tempo of this part, in Beats Per Minute. + * + * @method setBPM + * @for p5.Part + * @param {Number} BPM Beats Per Minute + * @param {Number} [rampTime] Seconds from now + */ + + looper_createClass(Part, [ + { + key: "setBPM", + value: function setBPM(tempo, rampTime) { + this.metro.setBPM(tempo, rampTime); + }, + /** + * Returns the tempo, in Beats Per Minute, of this part. + * + * @method getBPM + * @for p5.Part + * @return {Number} + */ + }, + { + key: "getBPM", + value: function getBPM() { + return this.metro.getBPM(); + }, + /** + * Start playback of this part. It will play + * through all of its phrases at a speed + * determined by setBPM. + * + * @method start + * @for p5.Part + * @param {Number} [time] seconds from now + */ + }, + { + key: "start", + value: function start(time) { + if (!this.isPlaying) { + this.isPlaying = true; + this.metro.resetSync(this); + var t = time || 0; + this.metro.start(t); + } + }, + /** + * Loop playback of this part. It will begin + * looping through all of its phrases at a speed + * determined by setBPM. + * + * @method loop + * @for p5.Part + * @param {Number} [time] seconds from now + */ + }, + { + key: "loop", + value: function loop(time) { + this.looping = true; + + this.onended = function () { + this.partStep = 0; + }; + + var t = time || 0; + this.start(t); + }, + /** + * Tell the part to stop looping. + * + * @method noLoop + * @for p5.Part + */ + }, + { + key: "noLoop", + value: function noLoop() { + this.looping = false; + + this.onended = function () { + this.stop(); + }; + }, + /** + * Stop the part and cue it to step 0. Playback will resume from the begining of the Part when it is played again. + * + * @method stop + * @for p5.Part + * @param {Number} [time] seconds from now + */ + }, + { + key: "stop", + value: function stop(time) { + this.partStep = 0; + this.pause(time); + }, + /** + * Pause the part. Playback will resume + * from the current step. + * + * @method pause + * @for p5.Part + * @param {Number} time seconds from now + */ + }, + { + key: "pause", + value: function pause(time) { + this.isPlaying = false; + var t = time || 0; + this.metro.stop(t); + }, + /** + * Add a p5.Phrase to this Part. + * + * @method addPhrase + * @for p5.Part + * @param {p5.Phrase} phrase reference to a p5.Phrase + */ + }, + { + key: "addPhrase", + value: function addPhrase(name, callback, array) { + var p; + + if (arguments.length === 3) { + p = new Phrase(name, callback, array); + } else if (arguments[0] instanceof Phrase) { + p = arguments[0]; + } else { + throw "invalid input. addPhrase accepts name, callback, array or a p5.Phrase"; + } + + this.phrases.push(p); + + if (p.sequence.length > this.length) { + this.length = p.sequence.length; + } + }, + /** + * Remove a phrase from this part, based on the name it was + * given when it was created. + * + * @method removePhrase + * @for p5.Part + * @param {String} phraseName + */ + }, + { + key: "removePhrase", + value: function removePhrase(name) { + for (var i in this.phrases) { + if (this.phrases[i].name === name) { + this.phrases.splice(i, 1); + } + } + }, + /** + * Get a phrase from this part, based on the name it was + * given when it was created. Now you can modify its array. + * + * @method getPhrase + * @for p5.Part + * @param {String} phraseName + */ + }, + { + key: "getPhrase", + value: function getPhrase(name) { + for (var i in this.phrases) { + if (this.phrases[i].name === name) { + return this.phrases[i]; + } + } + }, + /** + * Find all sequences with the specified name, and replace their patterns with the specified array. + * + * @method replaceSequence + * @for p5.Part + * @param {String} phraseName + * @param {Array} sequence Array of values to pass into the callback + * at each step of the phrase. + */ + }, + { + key: "replaceSequence", + value: function replaceSequence(name, array) { + for (var i in this.phrases) { + if (this.phrases[i].name === name) { + this.phrases[i].sequence = array; + } + } + }, + }, + { + key: "incrementStep", + value: function incrementStep(time) { + if (this.partStep < this.length - 1) { + this.callback(time); + this.partStep += 1; + } else { + if (!this.looping && this.partStep === this.length - 1) { + this.onended(); + } + } + }, + /** + * Set the function that will be called at every step. This will clear the previous function. + * + * @method onStep + * @for p5.Part + * @param {Function} callback The name of the callback + * you want to fire + * on every beat/tatum. + */ + }, + { + key: "onStep", + value: function onStep(callback) { + this.callback = callback; + }, + }, + ]); + + return Part; + })(); + + /** + * A Score consists of a series of Parts. The parts will + * be played back in order. For example, you could have an + * A part, a B part, and a C part, and play them back in this order + * new p5.Score(a, a, b, a, c) + * + * @class p5.Score + * @constructor + * @param {p5.Part} [...parts] One or multiple parts, to be played in sequence. + */ + + var Score = (function () { + function Score() { + looper_classCallCheck(this, Score); + + this.parts = []; + this.currentPart = new Array(arguments.length); + var thisScore = this; + + for (var i in arguments) { + this.parts[i] = arguments[i]; + this.parts[i].nextPart = this.parts[i + 1]; + + this.parts[i].onended = function () { + thisScore.resetPart(i); + playNextPart(thisScore); + }; + } + + this.looping = false; + } + + looper_createClass(Score, [ + { + key: "onended", + value: function onended() { + if (this.looping) { + this.parts[0].start(); + } else { + this.parts[this.parts.length - 1].onended = function () { + this.stop(); + this.resetParts(); + }; + } + + this.currentPart = 0; + }, + /** + * Start playback of the score. + * + * @method start + * @for p5.Score + */ + }, + { + key: "start", + value: function start() { + this.parts[this.currentPart].start(); + this.scoreStep = 0; + }, + /** + * Stop playback of the score. + * + * @method stop + * @for p5.Score + */ + }, + { + key: "stop", + value: function stop() { + this.parts[this.currentPart].stop(); + this.currentPart = 0; + this.scoreStep = 0; + }, + /** + * Pause playback of the score. + * + * @method pause + * @for p5.Score + */ + }, + { + key: "pause", + value: function pause() { + this.parts[this.currentPart].stop(); + }, + /** + * Loop playback of the score. + * + * @method loop + * @for p5.Score + */ + }, + { + key: "loop", + value: function loop() { + this.looping = true; + this.start(); + }, + /** + * Stop looping playback of the score. If it + * is currently playing, this will go into effect + * after the current round of playback completes. + * + * @method noLoop + * @for p5.Score + */ + }, + { + key: "noLoop", + value: function noLoop() { + this.looping = false; + }, + }, + { + key: "resetParts", + value: function resetParts() { + var self = this; + this.parts.forEach(function (part) { + self.resetParts[part]; + }); + }, + }, + { + key: "resetPart", + value: function resetPart(i) { + this.parts[i].stop(); + this.parts[i].partStep = 0; + + for (var p in this.parts[i].phrases) { + if (this.parts[i]) { + this.parts[i].phrases[p].phraseStep = 0; + } + } + }, + /** + * Set the tempo for all parts in the score + * + * @method setBPM + * @for p5.Score + * @param {Number} BPM Beats Per Minute + * @param {Number} rampTime Seconds from now + */ + }, + { + key: "setBPM", + value: function setBPM(bpm, rampTime) { + for (var i in this.parts) { + if (this.parts[i]) { + this.parts[i].setBPM(bpm, rampTime); + } + } + }, + }, + ]); + + return Score; + })(); + + function playNextPart(aScore) { + aScore.currentPart++; + + if (aScore.currentPart >= aScore.parts.length) { + aScore.scoreStep = 0; + aScore.onended(); + } else { + aScore.scoreStep = 0; + aScore.parts[aScore.currentPart - 1].stop(); + aScore.parts[aScore.currentPart].start(); + } + } + + function soundLoop_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function soundLoop_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function soundLoop_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + soundLoop_defineProperties(Constructor.prototype, protoProps); + if (staticProps) soundLoop_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * SoundLoop + * + * @class p5.SoundLoop + * @constructor + * + * @param {Function} callback this function will be called on each iteration of theloop + * @param {Number|String} [interval] amount of time (if a number) or beats (if a string, following Tone.Time convention) for each iteration of the loop. Defaults to 1 second. + * + * @example + *
            + * let synth, soundLoop; + * let notePattern = [60, 62, 64, 67, 69, 72]; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * colorMode(HSB); + * background(0, 0, 86); + * text('tap to start/stop', 10, 20); + * + * //the looper's callback is passed the timeFromNow + * //this value should be used as a reference point from + * //which to schedule sounds + * let intervalInSeconds = 0.2; + * soundLoop = new p5.SoundLoop(onSoundLoop, intervalInSeconds); + * + * synth = new p5.MonoSynth(); + * } + * + * function canvasPressed() { + * // ensure audio is enabled + * userStartAudio(); + * + * if (soundLoop.isPlaying) { + * soundLoop.stop(); + * } else { + * // start the loop + * soundLoop.start(); + * } + * } + * + * function onSoundLoop(timeFromNow) { + * let noteIndex = (soundLoop.iterations - 1) % notePattern.length; + * let note = midiToFreq(notePattern[noteIndex]); + * synth.play(note, 0.5, timeFromNow); + * background(noteIndex * 360 / notePattern.length, 50, 100); + * } + *
            + */ + + var soundLoop_SoundLoop = (function () { + function SoundLoop(callback, interval) { + soundLoop_classCallCheck(this, SoundLoop); + + /** + * Getters and Setters, setting any paramter will result in a change in the clock's + * frequency, that will be reflected after the next callback + * beats per minute (defaults to 60) + * @property {Number} bpm + * @for p5.SoundLoop + */ + Object.defineProperty(this, "bpm", { + get: function get() { + return this._bpm; + }, + set: function set(bpm) { + if (!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 = bpm; + + this._update(); + }, + }); + /** + * number of quarter notes in a measure (defaults to 4) + * @property {Number} timeSignature + * @for p5.SoundLoop + */ + + Object.defineProperty(this, "timeSignature", { + get: function get() { + return this._timeSignature; + }, + set: function set(timeSig) { + if (!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 = timeSig; + + this._update(); + }, + }); + /** + * length of the loops interval + * @property {Number|String} interval + * @for p5.SoundLoop + */ + + Object.defineProperty(this, "interval", { + get: function get() { + return this._interval; + }, + set: function set(interval) { + this.musicalTimeMode = typeof interval === "number" ? false : true; + this._interval = interval; + + this._update(); + }, + }); + /** + * how many times the callback has been called so far + * @property {Number} iterations + * @for p5.SoundLoop + * @readonly + */ + + Object.defineProperty(this, "iterations", { + get: function get() { + return this.clock.ticks; + }, + }); + this.callback = callback; + /** + * musicalTimeMode uses Tone.Time convention + * true if string, false if number + * @property {Boolean} musicalTimeMode + */ + + this.musicalTimeMode = + typeof this._interval === "number" ? false : true; + this._interval = interval || 1; + /** + * musicalTimeMode variables + * modify these only when the interval is specified in musicalTime format as a string + */ + + this._timeSignature = 4; + this._bpm = 60; + this.isPlaying = false; + /** + * Set a limit to the number of loops to play. defaults to Infinity + * @property {Number} maxIterations + */ + + this.maxIterations = Infinity; + var self = this; + this.clock = new Clock_default.a({ + callback: function callback(time) { + var timeFromNow = time - main.audiocontext.currentTime; + /** + * Do not initiate the callback if timeFromNow is < 0 + * This ususually occurs for a few milliseconds when the page + * is not fully loaded + * + * The callback should only be called until maxIterations is reached + */ + + if (timeFromNow > 0 && self.iterations <= self.maxIterations) { + self.callback(timeFromNow); + } + }, + frequency: this._calcFreq(), + }); + } + /** + * Start the loop + * @method start + * @for p5.SoundLoop + * @param {Number} [timeFromNow] schedule a starting time + */ + + soundLoop_createClass(SoundLoop, [ + { + key: "start", + value: function start(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (!this.isPlaying) { + this.clock.start(now + t); + this.isPlaying = true; + } + }, + /** + * Stop the loop + * @method stop + * @for p5.SoundLoop + * @param {Number} [timeFromNow] schedule a stopping time + */ + }, + { + key: "stop", + value: function stop(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (this.isPlaying) { + this.clock.stop(now + t); + this.isPlaying = false; + } + }, + /** + * Pause the loop + * @method pause + * @for p5.SoundLoop + * @param {Number} [timeFromNow] schedule a pausing time + */ + }, + { + key: "pause", + value: function pause(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (this.isPlaying) { + this.clock.pause(now + t); + this.isPlaying = false; + } + }, + /** + * Synchronize loops. Use this method to start two or more loops in synchronization + * or to start a loop in synchronization with a loop that is already playing + * This method will schedule the implicit loop in sync with the explicit master loop + * i.e. loopToStart.syncedStart(loopToSyncWith) + * + * @method syncedStart + * @for p5.SoundLoop + * @param {Object} otherLoop a p5.SoundLoop to sync with + * @param {Number} [timeFromNow] Start the loops in sync after timeFromNow seconds + */ + }, + { + key: "syncedStart", + value: function syncedStart(otherLoop, timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (!otherLoop.isPlaying) { + otherLoop.clock.start(now + t); + otherLoop.isPlaying = true; + this.clock.start(now + t); + this.isPlaying = true; + } else if (otherLoop.isPlaying) { + var time = + otherLoop.clock._nextTick - main.audiocontext.currentTime; + this.clock.start(now + time); + this.isPlaying = true; + } + }, + /** + * Updates frequency value, reflected in next callback + * @private + * @for p5.SoundLoop + * @method _update + */ + }, + { + key: "_update", + value: function _update() { + this.clock.frequency.value = this._calcFreq(); + }, + /** + * Calculate the frequency of the clock's callback based on bpm, interval, and timesignature + * @private + * @for p5.SoundLoop + * @method _calcFreq + * @return {Number} new clock frequency value + */ + }, + { + key: "_calcFreq", + value: function _calcFreq() { + if (typeof this._interval === "number") { + this.musicalTimeMode = false; + return 1 / this._interval; + } else if (typeof this._interval === "string") { + this.musicalTimeMode = true; + return ( + (this._bpm / 60 / this._convertNotation(this._interval)) * + (this._timeSignature / 4) + ); + } + }, + /** + * Convert notation from musical time format to seconds + * Uses Tone.Time convention + * @private + * @for p5.SoundLoop + * @method _convertNotation + * @param {String} value value to be converted + * @return {Number} converted value in seconds + */ + }, + { + key: "_convertNotation", + value: function _convertNotation(value) { + var type = value.slice(-1); + value = Number(value.slice(0, -1)); + + switch (type) { + case "m": + return this._measure(value); + + case "n": + return this._note(value); + + 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", + ); + } + }, + /** + * Helper conversion methods of measure and note + * @private + * @for p5.SoundLoop + * @method _measure + */ + }, + { + key: "_measure", + value: function _measure(value) { + return value * this._timeSignature; + }, + /** + * @private + * @method _note + * @for p5.SoundLoop + */ + }, + { + key: "_note", + value: function _note(value) { + return this._timeSignature / value; + }, + }, + ]); + + return SoundLoop; + })(); + + var soundLoop = soundLoop_SoundLoop; + function compressor_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + compressor_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + compressor_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return compressor_typeof(obj); + } + + function compressor_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function compressor_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function compressor_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + compressor_defineProperties(Constructor.prototype, protoProps); + if (staticProps) compressor_defineProperties(Constructor, staticProps); + return Constructor; + } + + function compressor_possibleConstructorReturn(self, call) { + if ( + call && + (compressor_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return compressor_assertThisInitialized(self); + } + + function compressor_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function compressor_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + compressor_get = Reflect.get; + } else { + compressor_get = function _get(target, property, receiver) { + var base = compressor_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return compressor_get(target, property, receiver || target); + } + + function compressor_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = compressor_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function compressor_getPrototypeOf(o) { + compressor_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return compressor_getPrototypeOf(o); + } + + function compressor_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) compressor_setPrototypeOf(subClass, superClass); + } + + function compressor_setPrototypeOf(o, p) { + compressor_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return compressor_setPrototypeOf(o, p); + } + + /** + * Compressor is an audio effect class that performs dynamics compression + * on an audio input source. This is a very commonly used technique in music + * and sound production. Compression creates an overall louder, richer, + * and fuller sound by lowering the volume of louds and raising that of softs. + * Compression can be used to avoid clipping (sound distortion due to + * peaks in volume) and is especially useful when many sounds are played + * at once. Compression can be used on indivudal sound sources in addition + * to the main output. + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Compressor + * @constructor + * @extends p5.Effect + * + * + */ + + var Compressor = (function (_Effect) { + compressor_inherits(Compressor, _Effect); + + function Compressor() { + var _this; + + compressor_classCallCheck(this, Compressor); + + _this = compressor_possibleConstructorReturn( + this, + compressor_getPrototypeOf(Compressor).call(this), + ); + /** + * + * The p5.Compressor is built with a Web Audio Dynamics Compressor Node + * + * @property {AudioNode} compressor + */ + + _this.compressor = _this.ac.createDynamicsCompressor(); + + _this.input.connect(_this.compressor); + + _this.compressor.connect(_this.wet); + + return _this; + } + /** + * Performs the same function as .connect, but also accepts + * optional parameters to set compressor's audioParams + * @method process + * @for p5.Compressor + * + * @param {Object} src Sound source to be connected + * + * @param {Number} [attack] The amount of time (in seconds) to reduce the gain by 10dB, + * default = .003, range 0 - 1 + * @param {Number} [knee] A decibel value representing the range above the + * threshold where the curve smoothly transitions to the "ratio" portion. + * default = 30, range 0 - 40 + * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output + * default = 12, range 1 - 20 + * @param {Number} [threshold] The decibel value above which the compression will start taking effect + * default = -24, range -100 - 0 + * @param {Number} [release] The amount of time (in seconds) to increase the gain by 10dB + * default = .25, range 0 - 1 + */ + + compressor_createClass(Compressor, [ + { + key: "process", + value: function process( + src, + attack, + knee, + ratio, + threshold, + release, + ) { + src.connect(this.input); + this.set(attack, knee, ratio, threshold, release); + }, + /** + * Set the paramters of a compressor. + * @method set + * @for p5.Compressor + * @param {Number} attack The amount of time (in seconds) to reduce the gain by 10dB, + * default = .003, range 0 - 1 + * @param {Number} knee A decibel value representing the range above the + * threshold where the curve smoothly transitions to the "ratio" portion. + * default = 30, range 0 - 40 + * @param {Number} ratio The amount of dB change in input for a 1 dB change in output + * default = 12, range 1 - 20 + * @param {Number} threshold The decibel value above which the compression will start taking effect + * default = -24, range -100 - 0 + * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB + * default = .25, range 0 - 1 + */ + }, + { + key: "set", + value: function set(attack, knee, ratio, threshold, release) { + if (typeof attack !== "undefined") { + this.attack(attack); + } + + if (typeof knee !== "undefined") { + this.knee(knee); + } + + if (typeof ratio !== "undefined") { + this.ratio(ratio); + } + + if (typeof threshold !== "undefined") { + this.threshold(threshold); + } + + if (typeof release !== "undefined") { + this.release(release); + } + }, + /** + * Get current attack or set value w/ time ramp + * + * + * @method attack + * @for p5.Compressor + * @param {Number} [attack] Attack is the amount of time (in seconds) to reduce the gain by 10dB, + * default = .003, range 0 - 1 + * @param {Number} [time] Assign time value to schedule the change in value + */ + }, + { + key: "attack", + value: function attack(_attack, time) { + var t = time || 0; + + if (typeof _attack === "number") { + this.compressor.attack.value = _attack; + this.compressor.attack.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.compressor.attack.linearRampToValueAtTime( + _attack, + this.ac.currentTime + 0.02 + t, + ); + } else if (typeof _attack !== "undefined") { + _attack.connect(this.compressor.attack); + } + + return this.compressor.attack.value; + }, + /** + * Get current knee or set value w/ time ramp + * + * @method knee + * @for p5.Compressor + * @param {Number} [knee] A decibel value representing the range above the + * threshold where the curve smoothly transitions to the "ratio" portion. + * default = 30, range 0 - 40 + * @param {Number} [time] Assign time value to schedule the change in value + */ + }, + { + key: "knee", + value: function knee(_knee, time) { + var t = time || 0; + + if (typeof _knee === "number") { + this.compressor.knee.value = _knee; + this.compressor.knee.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.compressor.knee.linearRampToValueAtTime( + _knee, + this.ac.currentTime + 0.02 + t, + ); + } else if (typeof _knee !== "undefined") { + _knee.connect(this.compressor.knee); + } + + return this.compressor.knee.value; + }, + /** + * Get current ratio or set value w/ time ramp + * @method ratio + * @for p5.Compressor + * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output + * default = 12, range 1 - 20 + * @param {Number} [time] Assign time value to schedule the change in value + */ + }, + { + key: "ratio", + value: function ratio(_ratio, time) { + var t = time || 0; + + if (typeof _ratio === "number") { + this.compressor.ratio.value = _ratio; + this.compressor.ratio.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.compressor.ratio.linearRampToValueAtTime( + _ratio, + this.ac.currentTime + 0.02 + t, + ); + } else if (typeof _ratio !== "undefined") { + _ratio.connect(this.compressor.ratio); + } + + return this.compressor.ratio.value; + }, + /** + * Get current threshold or set value w/ time ramp + * @method threshold + * @for p5.Compressor + * @param {Number} threshold The decibel value above which the compression will start taking effect + * default = -24, range -100 - 0 + * @param {Number} [time] Assign time value to schedule the change in value + */ + }, + { + key: "threshold", + value: function threshold(_threshold, time) { + var t = time || 0; + + if (typeof _threshold === "number") { + this.compressor.threshold.value = _threshold; + this.compressor.threshold.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.compressor.threshold.linearRampToValueAtTime( + _threshold, + this.ac.currentTime + 0.02 + t, + ); + } else if (typeof _threshold !== "undefined") { + _threshold.connect(this.compressor.threshold); + } + + return this.compressor.threshold.value; + }, + /** + * Get current release or set value w/ time ramp + * @method release + * @for p5.Compressor + * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB + * default = .25, range 0 - 1 + * + * @param {Number} [time] Assign time value to schedule the change in value + */ + }, + { + key: "release", + value: function release(_release, time) { + var t = time || 0; + + if (typeof _release === "number") { + this.compressor.release.value = _release; + this.compressor.release.cancelScheduledValues( + this.ac.currentTime + 0.01 + t, + ); + this.compressor.release.linearRampToValueAtTime( + _release, + this.ac.currentTime + 0.02 + t, + ); + } else if (typeof number !== "undefined") { + _release.connect(this.compressor.release); + } + + return this.compressor.release.value; + }, + /** + * Return the current reduction value + * + * @method reduction + * @for p5.Compressor + * @return {Number} Value of the amount of gain reduction that is applied to the signal + */ + }, + { + key: "reduction", + value: function reduction() { + return this.compressor.reduction.value; + }, + }, + { + key: "dispose", + value: function dispose() { + compressor_get( + compressor_getPrototypeOf(Compressor.prototype), + "dispose", + this, + ).call(this); + + if (this.compressor) { + this.compressor.disconnect(); + delete this.compressor; + } + }, + }, + ]); + + return Compressor; + })(effect); + + var compressor = Compressor; + function peakDetect_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function peakDetect_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function peakDetect_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + peakDetect_defineProperties(Constructor.prototype, protoProps); + if (staticProps) peakDetect_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + *

            PeakDetect works in conjunction with p5.FFT to + * look for onsets in some or all of the frequency spectrum. + *

            + *

            + * To use p5.PeakDetect, call update in the draw loop + * and pass in a p5.FFT object. + *

            + *

            + * You can listen for a specific part of the frequency spectrum by + * setting the range between freq1 and freq2. + *

            + * + *

            threshold is the threshold for detecting a peak, + * scaled between 0 and 1. It is logarithmic, so 0.1 is half as loud + * as 1.0.

            + * + *

            + * The update method is meant to be run in the draw loop, and + * frames determines how many loops must pass before + * another peak can be detected. + * For example, if the frameRate() = 60, you could detect the beat of a + * 120 beat-per-minute song with this equation: + * framesPerPeak = 60 / (estimatedBPM / 60 ); + *

            + * + *

            + * Based on example contribtued by @b2renger, and a simple beat detection + * explanation by Felix Turner. + *

            + * + * @class p5.PeakDetect + * @constructor + * @param {Number} [freq1] lowFrequency - defaults to 20Hz + * @param {Number} [freq2] highFrequency - defaults to 20000 Hz + * @param {Number} [threshold] Threshold for detecting a beat between 0 and 1 + * scaled logarithmically where 0.1 is 1/2 the loudness + * of 1.0. Defaults to 0.35. + * @param {Number} [framesPerPeak] Defaults to 20. + * @example + *
            + * + * var cnv, soundFile, fft, peakDetect; + * var ellipseWidth = 10; + * + * function preload() { + * soundFile = loadSound('assets/beat.mp3'); + * } + * + * function setup() { + * background(0); + * noStroke(); + * fill(255); + * textAlign(CENTER); + * + * // p5.PeakDetect requires a p5.FFT + * fft = new p5.FFT(); + * peakDetect = new p5.PeakDetect(); + * } + * + * function draw() { + * background(0); + * text('click to play/pause', width/2, height/2); + * + * // peakDetect accepts an fft post-analysis + * fft.analyze(); + * peakDetect.update(fft); + * + * if ( peakDetect.isDetected ) { + * ellipseWidth = 50; + * } else { + * ellipseWidth *= 0.95; + * } + * + * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); + * } + * + * // toggle play/stop when canvas is clicked + * function mouseClicked() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * if (soundFile.isPlaying() ) { + * soundFile.stop(); + * } else { + * soundFile.play(); + * } + * } + * } + *
            + */ + var PeakDetect = (function () { + function PeakDetect(freq1, freq2, threshold, _framesPerPeak) { + peakDetect_classCallCheck(this, PeakDetect); + + this.framesPerPeak = _framesPerPeak || 20; + this.framesSinceLastPeak = 0; + this.decayRate = 0.95; + this.threshold = threshold || 0.35; + this.cutoff = 0; + + this.cutoffMult = 1.5; + this.energy = 0; + this.penergy = 0; + + this.currentValue = 0; + /** + * isDetected is set to true when a peak is detected. + * + * @attribute isDetected {Boolean} + * @default false + */ + + this.isDetected = false; + this.f1 = freq1 || 40; + this.f2 = freq2 || 20000; + + this._onPeak = function () {}; + } + /** + * The update method is run in the draw loop. + * + * Accepts an FFT object. You must call .analyze() + * on the FFT object prior to updating the peakDetect + * because it relies on a completed FFT analysis. + * + * @method update + * @param {p5.FFT} fftObject A p5.FFT object + */ + + peakDetect_createClass(PeakDetect, [ + { + key: "update", + value: function update(fftObject) { + var nrg = (this.energy = + fftObject.getEnergy(this.f1, this.f2) / 255); + + if ( + nrg > this.cutoff && + nrg > this.threshold && + nrg - this.penergy > 0 + ) { + this._onPeak(); + + this.isDetected = true; + + this.cutoff = nrg * this.cutoffMult; + this.framesSinceLastPeak = 0; + } else { + this.isDetected = false; + + if (this.framesSinceLastPeak <= this.framesPerPeak) { + this.framesSinceLastPeak++; + } else { + this.cutoff *= this.decayRate; + this.cutoff = Math.max(this.cutoff, this.threshold); + } + } + + this.currentValue = nrg; + this.penergy = nrg; + }, + /** + * onPeak accepts two arguments: a function to call when + * a peak is detected. The value of the peak, + * between 0.0 and 1.0, is passed to the callback. + * + * @method onPeak + * @param {Function} callback Name of a function that will + * be called when a peak is + * detected. + * @param {Object} [val] Optional value to pass + * into the function when + * a peak is detected. + * @example + *
            + * var cnv, soundFile, fft, peakDetect; + * var ellipseWidth = 0; + * + * function preload() { + * soundFile = loadSound('assets/beat.mp3'); + * } + * + * function setup() { + * cnv = createCanvas(100,100); + * textAlign(CENTER); + * + * fft = new p5.FFT(); + * peakDetect = new p5.PeakDetect(); + * + * setupSound(); + * + * // when a beat is detected, call triggerBeat() + * peakDetect.onPeak(triggerBeat); + * } + * + * function draw() { + * background(0); + * fill(255); + * text('click to play', width/2, height/2); + * + * fft.analyze(); + * peakDetect.update(fft); + * + * ellipseWidth *= 0.95; + * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); + * } + * + * // this function is called by peakDetect.onPeak + * function triggerBeat() { + * ellipseWidth = 50; + * } + * + * // mouseclick starts/stops sound + * function setupSound() { + * cnv.mouseClicked( function() { + * if (soundFile.isPlaying() ) { + * soundFile.stop(); + * } else { + * soundFile.play(); + * } + * }); + * } + *
            + */ + }, + { + key: "onPeak", + value: function onPeak(callback, val) { + var self = this; + + self._onPeak = function () { + callback(self.energy, val); + }; + }, + }, + ]); + + return PeakDetect; + })(); + + var peakDetect = PeakDetect; + function soundRecorder_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function soundRecorder_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function soundRecorder_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + soundRecorder_defineProperties(Constructor.prototype, protoProps); + if (staticProps) soundRecorder_defineProperties(Constructor, staticProps); + return Constructor; + } + + var soundRecorder_ac = main.audiocontext; + /** + *

            Record sounds for playback and/or to save as a .wav file. + * The p5.SoundRecorder records all sound output from your sketch, + * or can be assigned a specific source with setInput().

            + *

            The record() method accepts a p5.SoundFile as a parameter. + * When playback is stopped (either after the given amount of time, + * or with the stop() method), the p5.SoundRecorder will send its + * recording to that p5.SoundFile for playback.

            + * + * @class p5.SoundRecorder + * @constructor + * @example + *
            + * let mic, recorder, soundFile; + * let state = 0; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * textAlign(CENTER, CENTER); + * + * // create an audio in + * mic = new p5.AudioIn(); + * + * // prompts user to enable their browser mic + * mic.start(); + * + * // create a sound recorder + * recorder = new p5.SoundRecorder(); + * + * // connect the mic to the recorder + * recorder.setInput(mic); + * + * // this sound file will be used to + * // playback & save the recording + * soundFile = new p5.SoundFile(); + * + * text('tap to record', width/2, height/2); + * } + * + * function canvasPressed() { + * // ensure audio is enabled + * userStartAudio(); + * + * // make sure user enabled the mic + * if (state === 0 && mic.enabled) { + * + * // record to our p5.SoundFile + * recorder.record(soundFile); + * + * background(255,0,0); + * text('Recording!', width/2, height/2); + * state++; + * } + * else if (state === 1) { + * background(0,255,0); + * + * // stop recorder and + * // send result to soundFile + * recorder.stop(); + * + * text('Done! Tap to play and download', width/2, height/2, width - 20); + * state++; + * } + * + * else if (state === 2) { + * soundFile.play(); // play the result! + * save(soundFile, 'mySound.wav'); + * state++; + * } + * } + *
            + */ + + var soundRecorder_SoundRecorder = (function () { + function SoundRecorder() { + soundRecorder_classCallCheck(this, SoundRecorder); + + this.input = soundRecorder_ac.createGain(); + this.output = soundRecorder_ac.createGain(); + this._inputChannels = 2; + this._outputChannels = 2; + + var workletBufferSize = safeBufferSize(1024); + this._workletNode = new AudioWorkletNode( + soundRecorder_ac, + processorNames_default.a.recorderProcessor, + { + outputChannelCount: [this._outputChannels], + processorOptions: { + numInputChannels: this._inputChannels, + bufferSize: workletBufferSize, + }, + }, + ); + + this._workletNode.port.onmessage = function (event) { + if (event.data.name === "buffers") { + var buffers = [ + new Float32Array(event.data.leftBuffer), + new Float32Array(event.data.rightBuffer), + ]; + + this._callback(buffers); + } + }.bind(this); + /** + * callback invoked when the recording is over + * @private + * @type Function(Float32Array) + */ + + this._callback = function () {}; + + this._workletNode.connect(p5.soundOut._silentNode); + + this.setInput(); + + main.soundArray.push(this); + } + /** + * Connect a specific device to the p5.SoundRecorder. + * If no parameter is given, p5.SoundRecorer will record + * all audible p5.sound from your sketch. + * + * @method setInput + * @for p5.SoundRecorder + * @param {Object} [unit] p5.sound object or a web audio unit + * that outputs sound + */ + + soundRecorder_createClass(SoundRecorder, [ + { + key: "setInput", + value: function setInput(unit) { + this.input.disconnect(); + this.input = null; + this.input = soundRecorder_ac.createGain(); + this.input.connect(this._workletNode); + this.input.connect(this.output); + + if (unit) { + unit.connect(this.input); + } else { + p5.soundOut.output.connect(this.input); + } + }, + /** + * Start recording. To access the recording, provide + * a p5.SoundFile as the first parameter. The p5.SoundRecorder + * will send its recording to that p5.SoundFile for playback once + * recording is complete. Optional parameters include duration + * (in seconds) of the recording, and a callback function that + * will be called once the complete recording has been + * transfered to the p5.SoundFile. + * + * @method record + * @for p5.SoundRecorder + * @param {p5.SoundFile} soundFile p5.SoundFile + * @param {Number} [duration] Time (in seconds) + * @param {Function} [callback] The name of a function that will be + * called once the recording completes + */ + }, + { + key: "record", + value: function record(sFile, duration, callback) { + this._workletNode.port.postMessage({ + name: "start", + duration: duration, + }); + + if (sFile && callback) { + this._callback = function (buffer) { + sFile.setBuffer(buffer); + callback(); + }; + } else if (sFile) { + this._callback = function (buffer) { + sFile.setBuffer(buffer); + }; + } + }, + /** + * Stop the recording. Once the recording is stopped, + * the results will be sent to the p5.SoundFile that + * was given on .record(), and if a callback function + * was provided on record, that function will be called. + * + * @method stop + * @for p5.SoundRecorder + */ + }, + { + key: "stop", + value: function stop() { + this._workletNode.port.postMessage({ + name: "stop", + }); + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + this._callback = function () {}; + + if (this.input) { + this.input.disconnect(); + } + + this.input = null; + this._workletNode = null; + }, + }, + ]); + + return SoundRecorder; + })(); + + var soundRecorder = soundRecorder_SoundRecorder; + function distortion_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + distortion_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + distortion_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return distortion_typeof(obj); + } + + function distortion_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function distortion_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function distortion_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + distortion_defineProperties(Constructor.prototype, protoProps); + if (staticProps) distortion_defineProperties(Constructor, staticProps); + return Constructor; + } + + function distortion_possibleConstructorReturn(self, call) { + if ( + call && + (distortion_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return distortion_assertThisInitialized(self); + } + + function distortion_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function distortion_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + distortion_get = Reflect.get; + } else { + distortion_get = function _get(target, property, receiver) { + var base = distortion_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return distortion_get(target, property, receiver || target); + } + + function distortion_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = distortion_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function distortion_getPrototypeOf(o) { + distortion_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return distortion_getPrototypeOf(o); + } + + function distortion_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) distortion_setPrototypeOf(subClass, superClass); + } + + function distortion_setPrototypeOf(o, p) { + distortion_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return distortion_setPrototypeOf(o, p); + } + + function makeDistortionCurve(amount) { + var k = typeof amount === "number" ? amount : 50; + var numSamples = 44100; + var curve = new Float32Array(numSamples); + var deg = Math.PI / 180; + var i = 0; + var x; + + for (; i < numSamples; ++i) { + x = (i * 2) / numSamples - 1; + curve[i] = ((3 + k) * x * 20 * deg) / (Math.PI + k * Math.abs(x)); + } + + return curve; + } + /** + * A Distortion effect created with a Waveshaper Node, + * with an approach adapted from + * [Kevin Ennis](http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion) + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Distortion + * @extends p5.Effect + * @constructor + * @param {Number} [amount=0.25] Unbounded distortion amount. + * Normal values range from 0-1. + * @param {String} [oversample='none'] 'none', '2x', or '4x'. + * + */ + + var Distortion = (function (_Effect) { + distortion_inherits(Distortion, _Effect); + + function Distortion(amount, oversample) { + var _this; + + distortion_classCallCheck(this, Distortion); + + _this = distortion_possibleConstructorReturn( + this, + distortion_getPrototypeOf(Distortion).call(this), + ); + + if (typeof amount === "undefined") { + amount = 0.25; + } + + if (typeof amount !== "number") { + throw new Error("amount must be a number"); + } + + if (typeof oversample === "undefined") { + oversample = "2x"; + } + + if (typeof oversample !== "string") { + throw new Error("oversample must be a String"); + } + + var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); + /** + * The p5.Distortion is built with a + * + * Web Audio WaveShaper Node. + * + * @property {AudioNode} WaveShaperNode + */ + + _this.waveShaperNode = _this.ac.createWaveShaper(); + _this.amount = curveAmount; + _this.waveShaperNode.curve = makeDistortionCurve(curveAmount); + _this.waveShaperNode.oversample = oversample; + + _this.input.connect(_this.waveShaperNode); + + _this.waveShaperNode.connect(_this.wet); + + return _this; + } + /** + * Process a sound source, optionally specify amount and oversample values. + * + * @method process + * @for p5.Distortion + * @param {Number} [amount=0.25] Unbounded distortion amount. + * Normal values range from 0-1. + * @param {String} [oversample='none'] 'none', '2x', or '4x'. + */ + + distortion_createClass(Distortion, [ + { + key: "process", + value: function process(src, amount, oversample) { + src.connect(this.input); + this.set(amount, oversample); + }, + /** + * Set the amount and oversample of the waveshaper distortion. + * + * @method set + * @for p5.Distortion + * @param {Number} [amount=0.25] Unbounded distortion amount. + * Normal values range from 0-1. + * @param {String} [oversample='none'] 'none', '2x', or '4x'. + */ + }, + { + key: "set", + value: function set(amount, oversample) { + if (amount) { + var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); + this.amount = curveAmount; + this.waveShaperNode.curve = makeDistortionCurve(curveAmount); + } + + if (oversample) { + this.waveShaperNode.oversample = oversample; + } + }, + /** + * Return the distortion amount, typically between 0-1. + * + * @method getAmount + * @for p5.Distortion + * @return {Number} Unbounded distortion amount. + * Normal values range from 0-1. + */ + }, + { + key: "getAmount", + value: function getAmount() { + return this.amount; + }, + /** + * Return the oversampling. + * + * @method getOversample + * @for p5.Distortion + * @return {String} Oversample can either be 'none', '2x', or '4x'. + */ + }, + { + key: "getOversample", + value: function getOversample() { + return this.waveShaperNode.oversample; + }, + }, + { + key: "dispose", + value: function dispose() { + distortion_get( + distortion_getPrototypeOf(Distortion.prototype), + "dispose", + this, + ).call(this); + + if (this.waveShaperNode) { + this.waveShaperNode.disconnect(); + this.waveShaperNode = null; + } + }, + }, + ]); + + return Distortion; + })(effect); + + var distortion = Distortion; + function gain_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function gain_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function gain_createClass(Constructor, protoProps, staticProps) { + if (protoProps) gain_defineProperties(Constructor.prototype, protoProps); + if (staticProps) gain_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * A gain node is usefull to set the relative volume of sound. + * It's typically used to build mixers. + * + * @class p5.Gain + * @constructor + * @example + *
            + * + * // load two soundfile and crossfade beetween them + * let sound1,sound2; + * let sound1Gain, sound2Gain, mixGain; + * function preload(){ + * soundFormats('ogg', 'mp3'); + * sound1 = loadSound('assets/Damscray_-_Dancing_Tiger_01'); + * sound2 = loadSound('assets/beat'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(startSound); + * // create a 'mix' gain bus to which we will connect both soundfiles + * mixGain = new p5.Gain(); + * mixGain.connect(); + * sound1.disconnect(); // diconnect from p5 output + * sound1Gain = new p5.Gain(); // setup a gain node + * sound1Gain.setInput(sound1); // connect the first sound to its input + * sound1Gain.connect(mixGain); // connect its output to the final mix bus + * sound2.disconnect(); + * sound2Gain = new p5.Gain(); + * sound2Gain.setInput(sound2); + * sound2Gain.connect(mixGain); + * } + * function startSound() { + * sound1.loop(); + * sound2.loop(); + * loop(); + * } + * function mouseReleased() { + * sound1.stop(); + * sound2.stop(); + * } + * function draw(){ + * background(220); + * textAlign(CENTER); + * textSize(11); + * fill(0); + * if (!sound1.isPlaying()) { + * text('tap and drag to play', width/2, height/2); + * return; + * } + * // map the horizontal position of the mouse to values useable for volume * control of sound1 + * var sound1Volume = constrain(map(mouseX,width,0,0,1), 0, 1); + * var sound2Volume = 1-sound1Volume; + * sound1Gain.amp(sound1Volume); + * sound2Gain.amp(sound2Volume); + * // map the vertical position of the mouse to values useable for 'output * volume control' + * var outputVolume = constrain(map(mouseY,height,0,0,1), 0, 1); + * mixGain.amp(outputVolume); + * text('output', width/2, height - outputVolume * height * 0.9) + * fill(255, 0, 255); + * textAlign(LEFT); + * text('sound1', 5, height - sound1Volume * height * 0.9); + * textAlign(RIGHT); + * text('sound2', width - 5, height - sound2Volume * height * 0.9); + * } + *
            + */ + + var gain_Gain = (function () { + function Gain() { + gain_classCallCheck(this, Gain); + + this.ac = main.audiocontext; + this.input = this.ac.createGain(); + this.output = this.ac.createGain(); + + this.input.gain.value = 0.5; + this.input.connect(this.output); + + main.soundArray.push(this); + } + /** + * Connect a source to the gain node. + * + * @method setInput + * @for p5.Gain + * @param {Object} src p5.sound / Web Audio object with a sound + * output. + */ + + gain_createClass(Gain, [ + { + key: "setInput", + value: function setInput(src) { + src.connect(this.input); + }, + /** + * Send output to a p5.sound or web audio object + * + * @method connect + * @for p5.Gain + * @param {Object} unit + */ + }, + { + key: "connect", + value: function connect(unit) { + var u = unit || p5.soundOut.input; + this.output.connect(u.input ? u.input : u); + }, + /** + * Disconnect all output. + * + * @method disconnect + * @for p5.Gain + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + }, + /** + * Set the output level of the gain node. + * + * @method amp + * @for p5.Gain + * @param {Number} volume amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + }, + { + key: "amp", + value: function amp(vol) { + var rampTime = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var tFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + var now = main.audiocontext.currentTime; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(now); + this.output.gain.linearRampToValueAtTime( + currentVol, + now + tFromNow, + ); + this.output.gain.linearRampToValueAtTime( + vol, + now + tFromNow + rampTime, + ); + }, + }, + { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + + if (this.input) { + this.input.disconnect(); + delete this.input; + } + }, + }, + ]); + + return Gain; + })(); + + var gain = gain_Gain; + function audioVoice_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function audioVoice_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function audioVoice_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + audioVoice_defineProperties(Constructor.prototype, protoProps); + if (staticProps) audioVoice_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * Base class for monophonic synthesizers. Any extensions of this class + * should follow the API and implement the methods below in order to + * remain compatible with p5.PolySynth(); + * + * @class p5.AudioVoice + * @constructor + */ + + var audioVoice_AudioVoice = (function () { + function AudioVoice() { + audioVoice_classCallCheck(this, AudioVoice); + + this.ac = main.audiocontext; + this.output = this.ac.createGain(); + this.connect(); + main.soundArray.push(this); + } + + audioVoice_createClass(AudioVoice, [ + { + key: "play", + value: function play(note, velocity, secondsFromNow, sustime) {}, + }, + { + key: "triggerAttack", + value: function triggerAttack(note, velocity, secondsFromNow) {}, + }, + { + key: "triggerRelease", + value: function triggerRelease(secondsFromNow) {}, + }, + { + key: "amp", + value: function amp(vol, rampTime) {}, + /** + * Connect to p5 objects or Web Audio Nodes + * @method connect + * @for p5.AudioVoice + * @param {Object} unit + */ + }, + { + key: "connect", + value: function connect(unit) { + var u = unit || main.input; + this.output.connect(u.input ? u.input : u); + }, + /** + * Disconnect from soundOut + * @method disconnect + * @for p5.AudioVoice + */ + }, + { + key: "disconnect", + value: function disconnect() { + this.output.disconnect(); + }, + }, + { + key: "dispose", + value: function dispose() { + if (this.output) { + this.output.disconnect(); + delete this.output; + } + }, + }, + ]); + + return AudioVoice; + })(); + + var audioVoice_0 = audioVoice_AudioVoice; + function monosynth_typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + monosynth_typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + monosynth_typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return monosynth_typeof(obj); + } + + function monosynth_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function monosynth_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function monosynth_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + monosynth_defineProperties(Constructor.prototype, protoProps); + if (staticProps) monosynth_defineProperties(Constructor, staticProps); + return Constructor; + } + + function monosynth_possibleConstructorReturn(self, call) { + if ( + call && + (monosynth_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return monosynth_assertThisInitialized(self); + } + + function monosynth_assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + + function monosynth_get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + monosynth_get = Reflect.get; + } else { + monosynth_get = function _get(target, property, receiver) { + var base = monosynth_superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return monosynth_get(target, property, receiver || target); + } + + function monosynth_superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = monosynth_getPrototypeOf(object); + if (object === null) break; + } + return object; + } + + function monosynth_getPrototypeOf(o) { + monosynth_getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return monosynth_getPrototypeOf(o); + } + + function monosynth_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true }, + }); + if (superClass) monosynth_setPrototypeOf(subClass, superClass); + } + + function monosynth_setPrototypeOf(o, p) { + monosynth_setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return monosynth_setPrototypeOf(o, p); + } + + var DEFAULT_SUSTAIN = 0.15; + /** + * A MonoSynth is used as a single voice for sound synthesis. + * This is a class to be used in conjunction with the PolySynth + * class. Custom synthetisers should be built inheriting from + * this class. + * + * @class p5.MonoSynth + * @constructor + * @example + *
            + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * textAlign(CENTER); + * text('tap to play', width/2, height/2); + * + * monoSynth = new p5.MonoSynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * let note = random(['Fb4', 'G4']); + * // note velocity (volume, from 0 to 1) + * let velocity = random(); + * // time from now (in seconds) + * let time = 0; + * // note duration (in seconds) + * let dur = 1/6; + * + * monoSynth.play(note, velocity, time, dur); + * } + *
            + **/ + + var monosynth_MonoSynth = (function (_AudioVoice) { + monosynth_inherits(MonoSynth, _AudioVoice); + + function MonoSynth() { + var _this; + + monosynth_classCallCheck(this, MonoSynth); + + _this = monosynth_possibleConstructorReturn( + this, + monosynth_getPrototypeOf(MonoSynth).call(this), + ); + _this.oscillator = new oscillator(); + _this.env = new envelope(); + + _this.env.setRange(1, 0); + + _this.env.setExp(true); + + _this.setADSR(0.02, 0.25, 0.05, 0.35); + + _this.oscillator.disconnect(); + + _this.oscillator.connect(_this.output); + + _this.env.disconnect(); + + _this.env.setInput(_this.output.gain); + + _this.oscillator.output.gain.value = 1.0; + + _this.oscillator.start(); + + _this.connect(); + + main.soundArray.push(monosynth_assertThisInitialized(_this)); + /** + * Getters and Setters + * @property {Number} attack + * @for p5.MonoSynth + */ + + /** + * @property {Number} decay + * @for p5.MonoSynth + */ + + /** + * @property {Number} sustain + * @for p5.MonoSynth + */ + + /** + * @property {Number} release + * @for p5.MonoSynth + */ + + Object.defineProperties(monosynth_assertThisInitialized(_this), { + attack: { + get: function get() { + return this.env.aTime; + }, + set: function set(attack) { + this.env.setADSR( + attack, + this.env.dTime, + this.env.sPercent, + this.env.rTime, + ); + }, + }, + decay: { + get: function get() { + return this.env.dTime; + }, + set: function set(decay) { + this.env.setADSR( + this.env.aTime, + decay, + this.env.sPercent, + this.env.rTime, + ); + }, + }, + sustain: { + get: function get() { + return this.env.sPercent; + }, + set: function set(sustain) { + this.env.setADSR( + this.env.aTime, + this.env.dTime, + sustain, + this.env.rTime, + ); + }, + }, + release: { + get: function get() { + return this.env.rTime; + }, + set: function set(release) { + this.env.setADSR( + this.env.aTime, + this.env.dTime, + this.env.sPercent, + release, + ); + }, + }, + }); + return _this; + } + /** + * Play tells the MonoSynth to start playing a note. This method schedules + * the calling of .triggerAttack and .triggerRelease. + * + * @method play + * @for p5.MonoSynth + * @param {String | Number} note the note you want to play, specified as a + * frequency in Hertz (Number) or as a midi + * value in Note/Octave format ("C4", "Eb3"...etc") + * See + * Tone. Defaults to 440 hz. + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) + * @param {Number} [secondsFromNow] time from now (in seconds) at which to play + * @param {Number} [sustainTime] time to sustain before releasing the envelope. Defaults to 0.15 seconds. + * @example + *
            + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * textAlign(CENTER); + * text('tap to play', width/2, height/2); + * + * monoSynth = new p5.MonoSynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * let note = random(['Fb4', 'G4']); + * // note velocity (volume, from 0 to 1) + * let velocity = random(); + * // time from now (in seconds) + * let time = 0; + * // note duration (in seconds) + * let dur = 1/6; + * + * monoSynth.play(note, velocity, time, dur); + * } + *
            + * + */ + + monosynth_createClass(MonoSynth, [ + { + key: "play", + value: function play(note, velocity, secondsFromNow, susTime) { + this.triggerAttack(note, velocity, ~~secondsFromNow); + this.triggerRelease( + ~~secondsFromNow + (susTime || DEFAULT_SUSTAIN), + ); + }, + /** + * Trigger the Attack, and Decay portion of the Envelope. + * Similar to holding down a key on a piano, but it will + * hold the sustain level until you let go. + * + * @param {String | Number} note the note you want to play, specified as a + * frequency in Hertz (Number) or as a midi + * value in Note/Octave format ("C4", "Eb3"...etc") + * See + * Tone. Defaults to 440 hz + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) + * @param {Number} [secondsFromNow] time from now (in seconds) at which to play + * @method triggerAttack + * @for p5.MonoSynth + * @example + *
            + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(triggerAttack); + * background(220); + * text('tap here for attack, let go to release', 5, 20, width - 20); + * monoSynth = new p5.MonoSynth(); + * } + * + * function triggerAttack() { + * userStartAudio(); + * + * monoSynth.triggerAttack("E3"); + * } + * + * function mouseReleased() { + * monoSynth.triggerRelease(); + * } + *
            + */ + }, + { + key: "triggerAttack", + value: function triggerAttack(note, velocity) { + var secondsFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + var freq = noteToFreq(note); + var vel = velocity || 0.1; + this.oscillator.freq(freq, 0, secondsFromNow); + this.env.ramp(this.output.gain, secondsFromNow, vel); + }, + /** + * Trigger the release of the Envelope. This is similar to releasing + * the key on a piano and letting the sound fade according to the + * release level and release time. + * + * @param {Number} secondsFromNow time to trigger the release + * @method triggerRelease + * @for p5.MonoSynth + * @example + *
            + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(triggerAttack); + * background(220); + * text('tap here for attack, let go to release', 5, 20, width - 20); + * monoSynth = new p5.MonoSynth(); + * } + * + * function triggerAttack() { + * userStartAudio(); + * + * monoSynth.triggerAttack("E3"); + * } + * + * function mouseReleased() { + * monoSynth.triggerRelease(); + * } + *
            + */ + }, + { + key: "triggerRelease", + value: function triggerRelease() { + var secondsFromNow = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : 0; + this.env.ramp(this.output.gain, secondsFromNow, 0); + }, + /** + * Set values like a traditional + * + * ADSR envelope + * . + * + * @method setADSR + * @for p5.MonoSynth + * @param {Number} attackTime Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + */ + }, + { + key: "setADSR", + value: function setADSR(attack, decay, sustain, release) { + this.env.setADSR(attack, decay, sustain, release); + }, + /** + * MonoSynth amp + * @method amp + * @for p5.MonoSynth + * @param {Number} vol desired volume + * @param {Number} [rampTime] Time to reach new volume + * @return {Number} new volume value + */ + }, + { + key: "amp", + value: function amp(vol, rampTime) { + var t = rampTime || 0; + + if (typeof vol !== "undefined") { + this.oscillator.amp(vol, t); + } + + return this.oscillator.amp().value; + }, + /** + * Connect to a p5.sound / Web Audio object. + * + * @method connect + * @for p5.MonoSynth + * @param {Object} unit A p5.sound or Web Audio object + */ + }, + { + key: "connect", + value: function connect(unit) { + var u = unit || main.input; + this.output.connect(u.input ? u.input : u); + }, + /** + * Disconnect all outputs + * + * @method disconnect + * @for p5.MonoSynth + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + }, + /** + * Get rid of the MonoSynth and free up its resources / memory. + * + * @method dispose + * @for p5.MonoSynth + */ + }, + { + key: "dispose", + value: function dispose() { + monosynth_get( + monosynth_getPrototypeOf(MonoSynth.prototype), + "dispose", + this, + ).call(this); + + if (this.env) { + this.env.dispose(); + } + + if (this.oscillator) { + this.oscillator.dispose(); + } + }, + }, + ]); + + return MonoSynth; + })(audioVoice_0); + + var monosynth = monosynth_MonoSynth; + function onsetDetect_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function onsetDetect_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function onsetDetect_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + onsetDetect_defineProperties(Constructor.prototype, protoProps); + if (staticProps) onsetDetect_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * Listen for onsets (a sharp increase in volume) within a given + * frequency range. + * + * @class p5.OnsetDetect + * @constructor + * @param {Number} freqLow Low frequency + * @param {Number} freqHigh High frequency + * @param {Number} threshold Amplitude threshold between 0 (no energy) and 1 (maximum) + * @param {Function} callback Function to call when an onset is detected + */ + var OnsetDetect = (function () { + function OnsetDetect(freqLow, freqHigh, threshold, callback) { + onsetDetect_classCallCheck(this, OnsetDetect); + + this.isDetected = false; + this.freqLow = freqLow; + this.freqHigh = freqHigh; + this.treshold = threshold; + this.energy = 0; + this.penergy = 0; + + this.sensitivity = 500; + this.callback = callback; + } + + onsetDetect_createClass(OnsetDetect, [ + { + key: "update", + value: function update(fftObject, callback) { + this.energy = + fftObject.getEnergy(this.freqLow, this.freqHigh) / 255; + + if (this.isDetected === false) { + if (this.energy - this.penergy > this.treshold) { + this.isDetected = true; + + if (this.callback) { + this.callback(this.energy); + } else if (callback) { + callback(this.energy); + } + + var self = this; + setTimeout(function () { + self.isDetected = false; + }, this.sensitivity); + } + } + + this.penergy = this.energy; + }, + }, + ]); + + return OnsetDetect; + })(); + + var onsetDetect = OnsetDetect; + function polysynth_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function polysynth_defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function polysynth_createClass(Constructor, protoProps, staticProps) { + if (protoProps) + polysynth_defineProperties(Constructor.prototype, protoProps); + if (staticProps) polysynth_defineProperties(Constructor, staticProps); + return Constructor; + } + + /** + * An AudioVoice is used as a single voice for sound synthesis. + * The PolySynth class holds an array of AudioVoice, and deals + * with voices allocations, with setting notes to be played, and + * parameters to be set. + * + * @class p5.PolySynth + * @constructor + * + * @param {Number} [synthVoice] A monophonic synth voice inheriting + * the AudioVoice class. Defaults to p5.MonoSynth + * @param {Number} [maxVoices] Number of voices, defaults to 8; + * @example + *
            + * let polySynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * text('click to play', 20, 20); + * + * polySynth = new p5.PolySynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * // note duration (in seconds) + * let dur = 1.5; + * + * // time from now (in seconds) + * let time = 0; + * + * // velocity (volume, from 0 to 1) + * let vel = 0.1; + * + * // notes can overlap with each other + * polySynth.play('G2', vel, 0, dur); + * polySynth.play('C3', vel, time += 1/3, dur); + * polySynth.play('G3', vel, time += 1/3, dur); + * } + *
            + **/ + + var polysynth_PolySynth = (function () { + function PolySynth(audioVoice, maxVoices) { + polysynth_classCallCheck(this, PolySynth); + + this.audiovoices = []; + /** + * An object that holds information about which notes have been played and + * which notes are currently being played. New notes are added as keys + * on the fly. While a note has been attacked, but not released, the value of the + * key is the audiovoice which is generating that note. When notes are released, + * the value of the key becomes undefined. + * @property notes + */ + + this.notes = {}; + + this._newest = 0; + this._oldest = 0; + /** + * A PolySynth must have at least 1 voice, defaults to 8 + * @property polyvalue + */ + + this.maxVoices = maxVoices || 8; + /** + * Monosynth that generates the sound for each note that is triggered. The + * p5.PolySynth defaults to using the p5.MonoSynth as its voice. + * @property AudioVoice + */ + + this.AudioVoice = audioVoice === undefined ? p5.MonoSynth : audioVoice; + /** + * This value must only change as a note is attacked or released. Due to delay + * and sustain times, Tone.TimelineSignal is required to schedule the change in value. + * @private + * @property {Tone.TimelineSignal} _voicesInUse + */ + + this._voicesInUse = new TimelineSignal_default.a(0); + this.output = main.audiocontext.createGain(); + this.connect(); + + this._allocateVoices(); + + main.soundArray.push(this); + } + /** + * Construct the appropriate number of audiovoices + * @private + * @for p5.PolySynth + * @method _allocateVoices + */ + + polysynth_createClass(PolySynth, [ + { + key: "_allocateVoices", + value: function _allocateVoices() { + for (var i = 0; i < this.maxVoices; i++) { + this.audiovoices.push(new this.AudioVoice()); + this.audiovoices[i].disconnect(); + this.audiovoices[i].connect(this.output); + } + }, + /** + * Play a note by triggering noteAttack and noteRelease with sustain time + * + * @method play + * @for p5.PolySynth + * @param {Number} [note] midi note to play (ranging from 0 to 127 - 60 being a middle C) + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) + * @param {Number} [secondsFromNow] time from now (in seconds) at which to play + * @param {Number} [sustainTime] time to sustain before releasing the envelope + * @example + *
            + * let polySynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * text('click to play', 20, 20); + * + * polySynth = new p5.PolySynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * // note duration (in seconds) + * let dur = 1.5; + * + * // time from now (in seconds) + * let time = 0; + * + * // velocity (volume, from 0 to 1) + * let vel = 0.1; + * + * // notes can overlap with each other + * polySynth.play('G2', vel, 0, dur); + * polySynth.play('C3', vel, time += 1/3, dur); + * polySynth.play('G3', vel, time += 1/3, dur); + * } + *
            + */ + }, + { + key: "play", + value: function play(note, velocity, secondsFromNow) { + var susTime = + arguments.length > 3 && arguments[3] !== undefined + ? arguments[3] + : 1; + this.noteAttack(note, velocity, secondsFromNow); + this.noteRelease(note, secondsFromNow + susTime); + }, + /** + * noteADSR sets the envelope for a specific note that has just been triggered. + * Using this method modifies the envelope of whichever audiovoice is being used + * to play the desired note. The envelope should be reset before noteRelease is called + * in order to prevent the modified envelope from being used on other notes. + * + * @method noteADSR + * @for p5.PolySynth + * @param {Number} [note] Midi note on which ADSR should be set. + * @param {Number} [attackTime] Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + **/ + }, + { + key: "noteADSR", + value: function noteADSR(note, a, d, s, r) { + var timeFromNow = + arguments.length > 5 && arguments[5] !== undefined + ? arguments[5] + : 0; + var now = main.audiocontext.currentTime; + var t = now + timeFromNow; + this.audiovoices[this.notes[note].getValueAtTime(t)].setADSR( + a, + d, + s, + r, + ); + }, + /** + * Set the PolySynths global envelope. This method modifies the envelopes of each + * monosynth so that all notes are played with this envelope. + * + * @method setADSR + * @for p5.PolySynth + * @param {Number} [attackTime] Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + **/ + }, + { + key: "setADSR", + value: function setADSR(a, d, s, r) { + this.audiovoices.forEach(function (voice) { + voice.setADSR(a, d, s, r); + }); + }, + /** + * Trigger the Attack, and Decay portion of a MonoSynth. + * Similar to holding down a key on a piano, but it will + * hold the sustain level until you let go. + * + * @method noteAttack + * @for p5.PolySynth + * @param {Number} [note] midi note on which attack should be triggered. + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1)/ + * @param {Number} [secondsFromNow] time from now (in seconds) + * @example + *
            + * let polySynth = new p5.PolySynth(); + * let pitches = ['G', 'D', 'G', 'C']; + * let octaves = [2, 3, 4]; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playChord); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function playChord() { + * userStartAudio(); + * + * // play a chord: multiple notes at the same time + * for (let i = 0; i < 4; i++) { + * let note = random(pitches) + random(octaves); + * polySynth.noteAttack(note, 0.1); + * } + * } + * + * function mouseReleased() { + * // release all voices + * polySynth.noteRelease(); + * } + *
            + */ + }, + { + key: "noteAttack", + value: function noteAttack(_note, _velocity) { + var secondsFromNow = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + var acTime = main.audiocontext.currentTime + secondsFromNow; + + var note = noteToFreq(_note); + var velocity = _velocity || 0.1; + var currentVoice; + + if ( + this.notes[note] && + this.notes[note].getValueAtTime(acTime) !== null + ) { + this.noteRelease(note, 0); + } + + if (this._voicesInUse.getValueAtTime(acTime) < this.maxVoices) { + currentVoice = Math.max( + ~~this._voicesInUse.getValueAtTime(acTime), + 0, + ); + } else { + currentVoice = this._oldest; + oldestNote = freqToMidi( + this.audiovoices[this._oldest].oscillator.freq().value, + ); + this.noteRelease(oldestNote); + this._oldest = (this._oldest + 1) % (this.maxVoices - 1); + } + + this.notes[note] = new TimelineSignal_default.a(); + this.notes[note].setValueAtTime(currentVoice, acTime); + + var previousVal = + this._voicesInUse._searchBefore(acTime) === null + ? 0 + : this._voicesInUse._searchBefore(acTime).value; + + this._voicesInUse.setValueAtTime(previousVal + 1, acTime); + + this._updateAfter(acTime, 1); + + this._newest = currentVoice; + + if (typeof velocity === "number") { + var maxRange = (1 / this._voicesInUse.getValueAtTime(acTime)) * 2; + velocity = velocity > maxRange ? maxRange : velocity; + } + + this.audiovoices[currentVoice].triggerAttack( + note, + velocity, + secondsFromNow, + ); + }, + /** + * Private method to ensure accurate values of this._voicesInUse + * Any time a new value is scheduled, it is necessary to increment all subsequent + * scheduledValues after attack, and decrement all subsequent + * scheduledValues after release + * + * @private + * @for p5.PolySynth + * @param {[type]} time [description] + * @param {[type]} value [description] + * @return {[type]} [description] + */ + }, + { + key: "_updateAfter", + value: function _updateAfter(time, value) { + if (this._voicesInUse._searchAfter(time) === null) { + return; + } else { + this._voicesInUse._searchAfter(time).value += value; + + var nextTime = this._voicesInUse._searchAfter(time).time; + + this._updateAfter(nextTime, value); + } + }, + /** + * Trigger the Release of an AudioVoice note. This is similar to releasing + * the key on a piano and letting the sound fade according to the + * release level and release time. + * + * @method noteRelease + * @for p5.PolySynth + * @param {Number} [note] midi note on which attack should be triggered. + * If no value is provided, all notes will be released. + * @param {Number} [secondsFromNow] time to trigger the release + * @example + *
            + * let polySynth = new p5.PolySynth(); + * let pitches = ['G', 'D', 'G', 'C']; + * let octaves = [2, 3, 4]; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playChord); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function playChord() { + * userStartAudio(); + * + * // play a chord: multiple notes at the same time + * for (let i = 0; i < 4; i++) { + * let note = random(pitches) + random(octaves); + * polySynth.noteAttack(note, 0.1); + * } + * } + * + * function mouseReleased() { + * // release all voices + * polySynth.noteRelease(); + * } + *
            + * + */ + }, + { + key: "noteRelease", + value: function noteRelease(_note, secondsFromNow) { + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + + if (!_note) { + this.audiovoices.forEach(function (voice) { + voice.triggerRelease(tFromNow); + }); + + this._voicesInUse.setValueAtTime(0, t); + + for (var n in this.notes) { + this.notes[n].dispose(); + delete this.notes[n]; + } + + return; + } + + var note = noteToFreq(_note); + + if ( + !this.notes[note] || + this.notes[note].getValueAtTime(t) === null + ) { + console.warn("Cannot release a note that is not already playing"); + } else { + var previousVal = Math.max( + ~~this._voicesInUse.getValueAtTime(t).value, + 1, + ); + + this._voicesInUse.setValueAtTime(previousVal - 1, t); + + if (previousVal > 0) { + this._updateAfter(t, -1); + } + + this.audiovoices[ + this.notes[note].getValueAtTime(t) + ].triggerRelease(tFromNow); + this.notes[note].dispose(); + delete this.notes[note]; + this._newest = + this._newest === 0 + ? 0 + : (this._newest - 1) % (this.maxVoices - 1); + } + }, + /** + * Connect to a p5.sound / Web Audio object. + * + * @method connect + * @for p5.PolySynth + * @param {Object} unit A p5.sound or Web Audio object + */ + }, + { + key: "connect", + value: function connect(unit) { + var u = unit || main.input; + this.output.connect(u.input ? u.input : u); + }, + /** + * Disconnect all outputs + * + * @method disconnect + * @for p5.PolySynth + */ + }, + { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + }, + /** + * Get rid of the MonoSynth and free up its resources / memory. + * + * @method dispose + * @for p5.PolySynth + */ + }, + { + key: "dispose", + value: function dispose() { + this.audiovoices.forEach(function (voice) { + voice.dispose(); + }); + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + }, + }, + ]); + + return PolySynth; + })(); + + var polysynth = polysynth_PolySynth; + function Signal_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var Signal_Signal = function Signal() { + Signal_classCallCheck(this, Signal); + + console.warn("p5.Signal is deprecated , Use Tone.js Signal instead "); + }; + + var deprecations_Signal = Signal_Signal; + + p5.prototype.getAudioContext = audiocontext["b"]; + p5.prototype.userStartAudio = audiocontext["c"]; + + p5.prototype.sampleRate = sampleRate; + p5.prototype.freqToMidi = freqToMidi; + p5.prototype.midiToFreq = midiToFreq; + p5.prototype.noteToFreq = noteToFreq; + p5.prototype.soundFormats = soundFormats; + p5.prototype.disposeSound = disposeSound; + p5.prototype._checkFileFormats = _checkFileFormats; + p5.prototype._mathChain = _mathChain; + p5.prototype.convertToWav = convertToWav; + p5.prototype.interleave = interleave; + p5.prototype.writeUTFBytes = writeUTFBytes; + p5.prototype.safeBufferSize = safeBufferSize; + p5.prototype.saveSound = saveSound; + + p5.prototype.registerMethod("remove", p5.prototype.disposeSound); + + p5.Panner = panner_0; + + p5.SoundFile = soundfile; + p5.prototype.loadSound = loadSound; + + p5.prototype.registerPreloadMethod("loadSound", p5.prototype); + + p5.Amplitude = amplitude; + + p5.FFT = fft; + + p5.Oscillator = oscillator; + p5.SinOsc = SinOsc; + p5.TriOsc = TriOsc; + p5.SawOsc = SawOsc; + p5.SqrOsc = SqrOsc; -p5.AudioIn = audioin; + p5.Noise = noise; -p5.Effect = effect; + p5.Pulse = pulse; -p5.Filter = filter; -p5.LowPass = LowPass; -p5.HighPass = HighPass; -p5.BandPass = BandPass; + p5.AudioIn = audioin; -p5.EQ = eq; + p5.Effect = effect; -p5.listener3D = listener3d; + p5.Filter = filter; + p5.LowPass = LowPass; + p5.HighPass = HighPass; + p5.BandPass = BandPass; -p5.Panner3D = panner3d; + p5.EQ = eq; -p5.Delay = delay; + p5.listener3D = listener3d; -p5.Reverb = Reverb; -p5.Convolver = reverb_Convolver; -p5.prototype.createConvolver = createConvolver; -p5.prototype.registerPreloadMethod('createConvolver', p5.prototype); + p5.Panner3D = panner3d; -p5.Metro = metro; + p5.Delay = delay; -p5.Phrase = Phrase; -p5.Part = looper_Part; -p5.Score = Score; + p5.Reverb = Reverb; + p5.Convolver = reverb_Convolver; + p5.prototype.createConvolver = createConvolver; + p5.prototype.registerPreloadMethod("createConvolver", p5.prototype); -p5.SoundLoop = soundLoop; + p5.Metro = metro; -p5.Compressor = compressor; + p5.Phrase = Phrase; + p5.Part = looper_Part; + p5.Score = Score; -p5.peakDetect = peakDetect; + p5.SoundLoop = soundLoop; -p5.SoundRecorder = soundRecorder; + p5.Compressor = compressor; -p5.Distortion = distortion; + p5.peakDetect = peakDetect; -p5.Gain = gain; + p5.SoundRecorder = soundRecorder; -p5.AudioVoice = audioVoice_0; + p5.Distortion = distortion; -p5.MonoSynth = monosynth; + p5.Gain = gain; -p5.OnsetDetect = onsetDetect; + p5.AudioVoice = audioVoice_0; -p5.PolySynth = polysynth; + p5.MonoSynth = monosynth; -p5.PeakDetect = peakDetect; + p5.OnsetDetect = onsetDetect; + p5.PolySynth = polysynth; -p5.Signal = deprecations_Signal; + p5.PeakDetect = peakDetect; - }) - ]); + p5.Signal = deprecations_Signal; + }, +]); diff --git a/public/lib/addons/p5.sound.min.js b/public/lib/addons/p5.sound.min.js index 44f2523..c7bb085 100644 --- a/public/lib/addons/p5.sound.min.js +++ b/public/lib/addons/p5.sound.min.js @@ -1,3 +1,9485 @@ -/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ - !function(n){var i={};function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}r.m=n,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=40)}([function(t,e,n){var i;void 0===(i=function(){"use strict";function l(t,e){this.isUndef(t)||1===t?this.input=this.context.createGain():1t)this.cancelScheduledValues(t),this.linearRampToValueAtTime(e,t);else{var i=this._searchAfter(t);i&&(this.cancelScheduledValues(t),i.type===u.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(e,t):i.type===u.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(e,t)),this.setValueAtTime(e,t)}return this},u.TimelineSignal.prototype.linearRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.linearRampToValueAtTime(t,n),this},u.TimelineSignal.prototype.exponentialRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.exponentialRampToValueAtTime(t,n),this},u.TimelineSignal.prototype._searchBefore=function(t){return this._events.get(t)},u.TimelineSignal.prototype._searchAfter=function(t){return this._events.getAfter(t)},u.TimelineSignal.prototype.getValueAtTime=function(t){t=this.toSeconds(t);var e=this._searchAfter(t),n=this._searchBefore(t),i=this._initial;if(null===n)i=this._initial;else if(n.type===u.TimelineSignal.Type.Target){var r,o=this._events.getBefore(n.time);r=null===o?this._initial:o.value,i=this._exponentialApproach(n.time,r,n.value,n.constant,t)}else i=n.type===u.TimelineSignal.Type.Curve?this._curveInterpolate(n.time,n.value,n.duration,t):null===e?n.value:e.type===u.TimelineSignal.Type.Linear?this._linearInterpolate(n.time,n.value,e.time,e.value,t):e.type===u.TimelineSignal.Type.Exponential?this._exponentialInterpolate(n.time,n.value,e.time,e.value,t):n.value;return i},u.TimelineSignal.prototype.connect=u.SignalBase.prototype.connect,u.TimelineSignal.prototype._exponentialApproach=function(t,e,n,i,r){return n+(e-n)*Math.exp(-(r-t)/i)},u.TimelineSignal.prototype._linearInterpolate=function(t,e,n,i,r){return e+(r-t)/(n-t)*(i-e)},u.TimelineSignal.prototype._exponentialInterpolate=function(t,e,n,i,r){return(e=Math.max(this._minOutput,e))*Math.pow(i/e,(r-t)/(n-t))},u.TimelineSignal.prototype._curveInterpolate=function(t,e,n,i){var r=e.length;if(t+n<=i)return e[r-1];if(i<=t)return e[0];var o=(i-t)/n,s=Math.floor((r-1)*o),a=Math.ceil((r-1)*o),u=e[s],c=e[a];return a===s?u:this._linearInterpolate(s,u,a,c,o*(r-1))},u.TimelineSignal.prototype.dispose=function(){u.Signal.prototype.dispose.call(this),u.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},u.TimelineSignal}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(4),n(1),n(2)],void 0===(r=function(n){"use strict";return n.Scale=function(t,e){this._outputMin=this.defaultArg(t,0),this._outputMax=this.defaultArg(e,1),this._scale=this.input=new n.Multiply(1),this._add=this.output=new n.Add(0),this._scale.connect(this._add),this._setRange()},n.extend(n.Scale,n.SignalBase),Object.defineProperty(n.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(n.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),n.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},n.Scale.prototype.dispose=function(){return n.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},n.Scale}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(16),n(30),n(31),n(12)],void 0===(r=function(e){return e.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"},e.prototype.toSeconds=function(t){return this.isNumber(t)?t:this.isUndef(t)?this.now():this.isString(t)?new e.Time(t).toSeconds():t instanceof e.TimeBase?t.toSeconds():void 0},e.prototype.toFrequency=function(t){return this.isNumber(t)?t:this.isString(t)||this.isUndef(t)?new e.Frequency(t).valueOf():t instanceof e.TimeBase?t.toFrequency():void 0},e.prototype.toTicks=function(t){return this.isNumber(t)||this.isString(t)?new e.TransportTime(t).toTicks():this.isUndef(t)?e.Transport.ticks:t instanceof e.TimeBase?t.toTicks():void 0},e}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(18),n(9)],void 0===(r=function(n){"use strict";return window.GainNode&&!AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),n.Gain=function(){var t=this.optionsObject(arguments,["gain","units"],n.Gain.defaults);this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new n.Param({param:this._gainNode.gain,units:t.units,value:t.gain,convert:t.convert}),this._readOnly("gain")},n.extend(n.Gain),n.Gain.defaults={gain:1,convert:!0},n.Gain.prototype.dispose=function(){n.Param.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},n.prototype.createInsOuts=function(t,e){1===t?this.input=new n.Gain:1this._nextTick&&this._state;){var e=this._state.getValueAtTime(this._nextTick);if(e!==this._lastState){this._lastState=e;var n=this._state.get(this._nextTick);e===r.State.Started?(this._nextTick=n.time,this.isUndef(n.offset)||(this.ticks=n.offset),this.emit("start",n.time,this.ticks)):e===r.State.Stopped?(this.ticks=0,this.emit("stop",n.time)):e===r.State.Paused&&this.emit("pause",n.time)}var i=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),e===r.State.Started&&(this.callback(i),this.ticks++))}},r.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},r.Clock.prototype.dispose=function(){r.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},r.Clock}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(14)],void 0===(r=function(i){function t(t,e,n){if(t.input)Array.isArray(t.input)?(i.prototype.isUndef(n)&&(n=0),this.connect(t.input[n])):this.connect(t.input,e,n);else try{t instanceof AudioNode?r.call(this,t,e,n):r.call(this,t,e)}catch(e){throw new Error("error connecting to node: "+t+"\n"+e)}}var r,o;return!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),i.Context=function(t){for(var e in i.Emitter.call(this),t=t||new window.AudioContext,this._context=t,this._context)this._defineProperty(this._context,e);this._latencyHint="interactive",this._lookAhead=.1,this._updateInterval=this._lookAhead/3,this._computedUpdateInterval=0,this._worker=this._createWorker(),this._constants={}},i.extend(i.Context,i.Emitter),i.Emitter.mixin(i.Context),i.Context.prototype._defineProperty=function(e,n){this.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},i.Context.prototype.now=function(){return this._context.currentTime},i.Context.prototype._createWorker=function(){window.URL=window.URL||window.webkitURL;var t=new Blob(["var timeoutTime = "+(1e3*this._updateInterval).toFixed(1)+";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();"]),e=URL.createObjectURL(t),n=new Worker(e);return n.addEventListener("message",function(){this.emit("tick")}.bind(this)),n.addEventListener("message",function(){var t=this.now();if(this.isNumber(this._lastUpdate)){var e=t-this._lastUpdate;this._computedUpdateInterval=Math.max(e,.97*this._computedUpdateInterval)}this._lastUpdate=t}.bind(this)),n},i.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),i=0;ithis.memory){var n=this.length-this.memory;this._timeline.splice(0,n)}return this},e.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},e.Timeline.prototype.get=function(t){var e=this._search(t);return-1!==e?this._timeline[e]:null},e.Timeline.prototype.peek=function(){return this._timeline[0]},e.Timeline.prototype.shift=function(){return this._timeline.shift()},e.Timeline.prototype.getAfter=function(t){var e=this._search(t);return e+1=t&&(this._timeline=[]);return this},e.Timeline.prototype.cancelBefore=function(t){if(this._timeline.length){var e=this._search(t);0<=e&&(this._timeline=this._timeline.slice(e+1))}return this},e.Timeline.prototype._search=function(t){var e=0,n=this._timeline.length,i=n;if(0t)return r;o.time>t?i=r:o.time=t;)n--;return this._iterate(e,n+1),this},e.Timeline.prototype.forEachAtTime=function(e,n){var t=this._search(e);return-1!==t&&this._iterate(function(t){t.time===e&&n(t)},0,t),this},e.Timeline.prototype.dispose=function(){e.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},e.Timeline}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(1),n(2)],void 0===(r=function(t){"use strict";return t.Negate=function(){this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(1),n(6)],void 0===(r=function(t){"use strict";return t.GreaterThanZero=function(){this._thresh=this.output=new t.WaveShaper(function(t){return t<=0?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}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r,o;r=[],void 0===(o="function"==typeof(i=function(){var s=function(t,e){this._dragged=!1,this._element=t,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this,e),t.addEventListener("touchstart",this._bindedEnd),t.addEventListener("touchmove",this._bindedMove),t.addEventListener("touchend",this._bindedEnd),t.addEventListener("mouseup",this._bindedEnd)};function o(t){return"running"===t.state}return s.prototype._moved=function(t){this._dragged=!0},s.prototype._ended=function(t){this._dragged||function(t){var e=t.createBuffer(1,1,t.sampleRate),n=t.createBufferSource();n.buffer=e,n.connect(t.destination),n.start(0),t.resume&&t.resume()}(t),this._dragged=!1},s.prototype.dispose=function(){this._element.removeEventListener("touchstart",this._bindedEnd),this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},function(e,t,n){var i=new Promise(function(t){!function(e,n){o(e)?n():function t(){o(e)?n():(requestAnimationFrame(t),e.resume&&e.resume())}()}(e,t)}),r=[];return function t(e,n,i){if(Array.isArray(e)||NodeList&&e instanceof NodeList)for(var r=0;r= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'start\') {\n _this.record(data.duration);\n } else if (data.name === \'stop\') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: "process",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: "record",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: "stop",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: \'buffers\',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: "getBuffers",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: "mergeBuffers",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: "clear",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);'},function(t,e,n){"use strict";n.r(e),e.default='function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: "process",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: \'position\',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);'},function(t,e,n){"use strict";n.r(e),e.default='function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'toggleNormalize\') {\n _this.normalize = data.normalize;\n } else if (data.name === \'smoothing\') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: "process",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: \'amplitude\',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);'},function(t,e,n){var i,r;i=[n(0),n(17)],void 0===(r=function(r){r.Frequency=function(t,e){if(!(this instanceof r.Frequency))return new r.Frequency(t,e);r.TimeBase.call(this,t,e)},r.extend(r.Frequency,r.TimeBase),r.Frequency.prototype._primaryExpressions=Object.create(r.TimeBase.prototype._primaryExpressions),r.Frequency.prototype._primaryExpressions.midi={regexp:/^(\d+(?:\.\d+)?midi)/,method:function(t){return this.midiToFrequency(t)}},r.Frequency.prototype._primaryExpressions.note={regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(t,e){var n=i[t.toLowerCase()]+12*(parseInt(e)+1);return this.midiToFrequency(n)}},r.Frequency.prototype._primaryExpressions.tr={regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,n){var i=1;return t&&"0"!==t&&(i*=this._beatsToUnits(this._timeSignature()*parseFloat(t))),e&&"0"!==e&&(i*=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(i*=this._beatsToUnits(parseFloat(n)/4)),i}},r.Frequency.prototype.transpose=function(t){return this._expr=function(t,e){return t()*this.intervalToFrequencyRatio(e)}.bind(this,this._expr,t),this},r.Frequency.prototype.harmonize=function(t){return this._expr=function(t,e){for(var n=t(),i=[],r=0;rthis.buffer.duration)throw"jump time out of range";if(e>this.buffer.duration-t)throw"end time out of range";var n=t||0,i=e||void 0;this.isPlaying()&&(this.stop(0),this.play(0,this.playbackRate,this.output.gain.value,n,i))}},{key:"channels",value:function(){return this.buffer.numberOfChannels}},{key:"sampleRate",value:function(){return this.buffer.sampleRate}},{key:"frames",value:function(){return this.buffer.length}},{key:"getPeaks",value: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,n=e.length/t,i=~~(n/10)||1,r=e.numberOfChannels,o=new Float32Array(Math.round(t)),s=0;so[u])&&(o[u]=h)}return o}}},{key:"reverseBuffer",value:function(){if(!this.buffer)throw"SoundFile is not done loading";var t=this._lastPos/R.sampleRate,e=this.getVolume();this.setVolume(0,.001);for(var n=this.buffer.numberOfChannels,i=0;it[o].hi&&o++,r[o]=void 0!==r[o]?(r[o]+n[s])/2:n[s]}return r}},{key:"getOctaveBands",value:function(t,e){var n=t||3,i=e||15.625,r=[],o={lo:i/Math.pow(2,1/(2*n)),ctr:i,hi:i*Math.pow(2,1/(2*n))};r.push(o);for(var s=p.audiocontext.sampleRate/2;o.hi=this._maxDelay)throw new Error("Delay Time exceeds maximum delay time of "+this._maxDelay+" second.");t.connect(this.input),this.leftDelay.delayTime.setValueAtTime(o,this.ac.currentTime),this.rightDelay.delayTime.setValueAtTime(o,this.ac.currentTime),this._leftGain.gain.value=r,this._rightGain.gain.value=r,i&&(this._leftFilter.freq(i),this._rightFilter.freq(i))}},{key:"delayTime",value: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))}},{key:"feedback",value:function(t){if(t&&"number"!=typeof t)t.connect(this._leftGain.gain),t.connect(this._rightGain.gain);else{if(1<=t)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}},{key:"filter",value:function(t,e){this._leftFilter.set(t,e),this._rightFilter.set(t,e)}},{key:"setType",value: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)}}},{key:"dispose",value:function(){de(ye(e.prototype),"dispose",this).call(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}}]),e}();function _e(t){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ge(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function be(t,e){for(var n=0;nthis.length&&(this.length=i.sequence.length)}},{key:"removePhrase",value:function(t){for(var e in this.phrases)this.phrases[e].name===t&&this.phrases.splice(e,1)}},{key:"getPhrase",value:function(t){for(var e in this.phrases)if(this.phrases[e].name===t)return this.phrases[e]}},{key:"replaceSequence",value:function(t,e){for(var n in this.phrases)this.phrases[n].name===t&&(this.phrases[n].sequence=e)}},{key:"incrementStep",value:function(t){this.partStep=t.parts.length?(t.scoreStep=0,t.onended()):(t.scoreStep=0,t.parts[t.currentPart-1].stop(),t.parts[t.currentPart].start())}function Ue(t,e){for(var n=0;nthis.cutoff&&e>this.threshold&&0this.treshold){this.isDetected=!0,this.callback?this.callback(this.energy):e&&e(this.energy);var n=this;setTimeout(function(){n.isDetected=!1},this.sensitivity)}this.penergy=this.energy}}]),r}();function xn(t,e){for(var n=0;n t + ) + this.cancelScheduledValues(t), + this.linearRampToValueAtTime(e, t); + else { + var i = this._searchAfter(t); + i && + (this.cancelScheduledValues(t), + i.type === u.TimelineSignal.Type.Linear + ? this.linearRampToValueAtTime(e, t) + : i.type === u.TimelineSignal.Type.Exponential && + this.exponentialRampToValueAtTime(e, t)), + this.setValueAtTime(e, t); + } + return this; + }), + (u.TimelineSignal.prototype.linearRampToValueBetween = function ( + t, + e, + n, + ) { + return ( + this.setRampPoint(e), this.linearRampToValueAtTime(t, n), this + ); + }), + (u.TimelineSignal.prototype.exponentialRampToValueBetween = + function (t, e, n) { + return ( + this.setRampPoint(e), + this.exponentialRampToValueAtTime(t, n), + this + ); + }), + (u.TimelineSignal.prototype._searchBefore = function (t) { + return this._events.get(t); + }), + (u.TimelineSignal.prototype._searchAfter = function (t) { + return this._events.getAfter(t); + }), + (u.TimelineSignal.prototype.getValueAtTime = function (t) { + t = this.toSeconds(t); + var e = this._searchAfter(t), + n = this._searchBefore(t), + i = this._initial; + if (null === n) i = this._initial; + else if (n.type === u.TimelineSignal.Type.Target) { + var r, + o = this._events.getBefore(n.time); + (r = null === o ? this._initial : o.value), + (i = this._exponentialApproach( + n.time, + r, + n.value, + n.constant, + t, + )); + } else + i = + n.type === u.TimelineSignal.Type.Curve + ? this._curveInterpolate(n.time, n.value, n.duration, t) + : null === e + ? n.value + : e.type === u.TimelineSignal.Type.Linear + ? this._linearInterpolate( + n.time, + n.value, + e.time, + e.value, + t, + ) + : e.type === u.TimelineSignal.Type.Exponential + ? this._exponentialInterpolate( + n.time, + n.value, + e.time, + e.value, + t, + ) + : n.value; + return i; + }), + (u.TimelineSignal.prototype.connect = + u.SignalBase.prototype.connect), + (u.TimelineSignal.prototype._exponentialApproach = function ( + t, + e, + n, + i, + r, + ) { + return n + (e - n) * Math.exp(-(r - t) / i); + }), + (u.TimelineSignal.prototype._linearInterpolate = function ( + t, + e, + n, + i, + r, + ) { + return e + ((r - t) / (n - t)) * (i - e); + }), + (u.TimelineSignal.prototype._exponentialInterpolate = function ( + t, + e, + n, + i, + r, + ) { + return ( + (e = Math.max(this._minOutput, e)) * + Math.pow(i / e, (r - t) / (n - t)) + ); + }), + (u.TimelineSignal.prototype._curveInterpolate = function ( + t, + e, + n, + i, + ) { + var r = e.length; + if (t + n <= i) return e[r - 1]; + if (i <= t) return e[0]; + var o = (i - t) / n, + s = Math.floor((r - 1) * o), + a = Math.ceil((r - 1) * o), + u = e[s], + c = e[a]; + return a === s + ? u + : this._linearInterpolate(s, u, a, c, o * (r - 1)); + }), + (u.TimelineSignal.prototype.dispose = function () { + u.Signal.prototype.dispose.call(this), + u.Param.prototype.dispose.call(this), + this._events.dispose(), + (this._events = null); + }), + u.TimelineSignal + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(4), n(1), n(2)]), + void 0 === + (r = function (n) { + "use strict"; + return ( + (n.Scale = function (t, e) { + (this._outputMin = this.defaultArg(t, 0)), + (this._outputMax = this.defaultArg(e, 1)), + (this._scale = this.input = new n.Multiply(1)), + (this._add = this.output = new n.Add(0)), + this._scale.connect(this._add), + this._setRange(); + }), + n.extend(n.Scale, n.SignalBase), + Object.defineProperty(n.Scale.prototype, "min", { + get: function () { + return this._outputMin; + }, + set: function (t) { + (this._outputMin = t), this._setRange(); + }, + }), + Object.defineProperty(n.Scale.prototype, "max", { + get: function () { + return this._outputMax; + }, + set: function (t) { + (this._outputMax = t), this._setRange(); + }, + }), + (n.Scale.prototype._setRange = function () { + (this._add.value = this._outputMin), + (this._scale.value = this._outputMax - this._outputMin); + }), + (n.Scale.prototype.dispose = function () { + return ( + n.prototype.dispose.call(this), + this._add.dispose(), + (this._add = null), + this._scale.dispose(), + (this._scale = null), + this + ); + }), + n.Scale + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(16), n(30), n(31), n(12)]), + void 0 === + (r = function (e) { + return ( + (e.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", + }), + (e.prototype.toSeconds = function (t) { + return this.isNumber(t) + ? t + : this.isUndef(t) + ? this.now() + : this.isString(t) + ? new e.Time(t).toSeconds() + : t instanceof e.TimeBase + ? t.toSeconds() + : void 0; + }), + (e.prototype.toFrequency = function (t) { + return this.isNumber(t) + ? t + : this.isString(t) || this.isUndef(t) + ? new e.Frequency(t).valueOf() + : t instanceof e.TimeBase + ? t.toFrequency() + : void 0; + }), + (e.prototype.toTicks = function (t) { + return this.isNumber(t) || this.isString(t) + ? new e.TransportTime(t).toTicks() + : this.isUndef(t) + ? e.Transport.ticks + : t instanceof e.TimeBase + ? t.toTicks() + : void 0; + }), + e + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(18), n(9)]), + void 0 === + (r = function (n) { + "use strict"; + return ( + window.GainNode && + !AudioContext.prototype.createGain && + (AudioContext.prototype.createGain = + AudioContext.prototype.createGainNode), + (n.Gain = function () { + var t = this.optionsObject( + arguments, + ["gain", "units"], + n.Gain.defaults, + ); + (this.input = + this.output = + this._gainNode = + this.context.createGain()), + (this.gain = new n.Param({ + param: this._gainNode.gain, + units: t.units, + value: t.gain, + convert: t.convert, + })), + this._readOnly("gain"); + }), + n.extend(n.Gain), + (n.Gain.defaults = { gain: 1, convert: !0 }), + (n.Gain.prototype.dispose = function () { + n.Param.prototype.dispose.call(this), + this._gainNode.disconnect(), + (this._gainNode = null), + this._writable("gain"), + this.gain.dispose(), + (this.gain = null); + }), + (n.prototype.createInsOuts = function (t, e) { + 1 === t + ? (this.input = new n.Gain()) + : 1 < t && (this.input = new Array(t)), + 1 === e + ? (this.output = new n.Gain()) + : 1 < e && (this.output = new Array(t)); + }), + n.Gain + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(7), n(39), n(14), n(12)]), + void 0 === + (r = function (r) { + "use strict"; + return ( + (r.Clock = function () { + r.Emitter.call(this); + var t = this.optionsObject( + arguments, + ["callback", "frequency"], + r.Clock.defaults, + ); + (this.callback = t.callback), + (this._nextTick = 0), + (this._lastState = r.State.Stopped), + (this.frequency = new r.TimelineSignal( + t.frequency, + r.Type.Frequency, + )), + this._readOnly("frequency"), + (this.ticks = 0), + (this._state = new r.TimelineState(r.State.Stopped)), + (this._boundLoop = this._loop.bind(this)), + this.context.on("tick", this._boundLoop); + }), + r.extend(r.Clock, r.Emitter), + (r.Clock.defaults = { + callback: r.noOp, + frequency: 1, + lookAhead: "auto", + }), + Object.defineProperty(r.Clock.prototype, "state", { + get: function () { + return this._state.getValueAtTime(this.now()); + }, + }), + (r.Clock.prototype.start = function (t, e) { + return ( + (t = this.toSeconds(t)), + this._state.getValueAtTime(t) !== r.State.Started && + this._state.add({ + state: r.State.Started, + time: t, + offset: e, + }), + this + ); + }), + (r.Clock.prototype.stop = function (t) { + return ( + (t = this.toSeconds(t)), + this._state.cancel(t), + this._state.setStateAtTime(r.State.Stopped, t), + this + ); + }), + (r.Clock.prototype.pause = function (t) { + return ( + (t = this.toSeconds(t)), + this._state.getValueAtTime(t) === r.State.Started && + this._state.setStateAtTime(r.State.Paused, t), + this + ); + }), + (r.Clock.prototype._loop = function () { + for ( + var t = + this.now() + + this.context.lookAhead + + this.context.updateInterval + + 2 * this.context.lag; + t > this._nextTick && this._state; + + ) { + var e = this._state.getValueAtTime(this._nextTick); + if (e !== this._lastState) { + this._lastState = e; + var n = this._state.get(this._nextTick); + e === r.State.Started + ? ((this._nextTick = n.time), + this.isUndef(n.offset) || (this.ticks = n.offset), + this.emit("start", n.time, this.ticks)) + : e === r.State.Stopped + ? ((this.ticks = 0), this.emit("stop", n.time)) + : e === r.State.Paused && this.emit("pause", n.time); + } + var i = this._nextTick; + this.frequency && + ((this._nextTick += + 1 / this.frequency.getValueAtTime(this._nextTick)), + e === r.State.Started && (this.callback(i), this.ticks++)); + } + }), + (r.Clock.prototype.getStateAtTime = function (t) { + return (t = this.toSeconds(t)), this._state.getValueAtTime(t); + }), + (r.Clock.prototype.dispose = function () { + r.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); + }), + r.Clock + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(14)]), + void 0 === + (r = function (i) { + function t(t, e, n) { + if (t.input) + Array.isArray(t.input) + ? (i.prototype.isUndef(n) && (n = 0), this.connect(t.input[n])) + : this.connect(t.input, e, n); + else + try { + t instanceof AudioNode + ? r.call(this, t, e, n) + : r.call(this, t, e); + } catch (e) { + throw new Error("error connecting to node: " + t + "\n" + e); + } + } + var r, o; + return ( + !window.hasOwnProperty("AudioContext") && + window.hasOwnProperty("webkitAudioContext") && + (window.AudioContext = window.webkitAudioContext), + (i.Context = function (t) { + for (var e in (i.Emitter.call(this), + (t = t || new window.AudioContext()), + (this._context = t), + this._context)) + this._defineProperty(this._context, e); + (this._latencyHint = "interactive"), + (this._lookAhead = 0.1), + (this._updateInterval = this._lookAhead / 3), + (this._computedUpdateInterval = 0), + (this._worker = this._createWorker()), + (this._constants = {}); + }), + i.extend(i.Context, i.Emitter), + i.Emitter.mixin(i.Context), + (i.Context.prototype._defineProperty = function (e, n) { + this.isUndef(this[n]) && + Object.defineProperty(this, n, { + get: function () { + return "function" == typeof e[n] ? e[n].bind(e) : e[n]; + }, + set: function (t) { + e[n] = t; + }, + }); + }), + (i.Context.prototype.now = function () { + return this._context.currentTime; + }), + (i.Context.prototype._createWorker = function () { + window.URL = window.URL || window.webkitURL; + var t = new Blob([ + "var timeoutTime = " + + (1e3 * this._updateInterval).toFixed(1) + + ";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();", + ]), + e = URL.createObjectURL(t), + n = new Worker(e); + return ( + n.addEventListener( + "message", + function () { + this.emit("tick"); + }.bind(this), + ), + n.addEventListener( + "message", + function () { + var t = this.now(); + if (this.isNumber(this._lastUpdate)) { + var e = t - this._lastUpdate; + this._computedUpdateInterval = Math.max( + e, + 0.97 * this._computedUpdateInterval, + ); + } + this._lastUpdate = t; + }.bind(this), + ), + n + ); + }), + (i.Context.prototype.getConstant = function (t) { + if (this._constants[t]) return this._constants[t]; + for ( + var e = this._context.createBuffer( + 1, + 128, + this._context.sampleRate, + ), + n = e.getChannelData(0), + i = 0; + i < n.length; + i++ + ) + n[i] = t; + var r = this._context.createBufferSource(); + return ( + (r.channelCount = 1), + (r.channelCountMode = "explicit"), + (r.buffer = e), + (r.loop = !0), + r.start(0), + (this._constants[t] = r) + ); + }), + Object.defineProperty(i.Context.prototype, "lag", { + get: function () { + var t = this._computedUpdateInterval - this._updateInterval; + return Math.max(t, 0); + }, + }), + Object.defineProperty(i.Context.prototype, "lookAhead", { + get: function () { + return this._lookAhead; + }, + set: function (t) { + this._lookAhead = t; + }, + }), + Object.defineProperty(i.Context.prototype, "updateInterval", { + get: function () { + return this._updateInterval; + }, + set: function (t) { + (this._updateInterval = Math.max(t, i.prototype.blockTime)), + this._worker.postMessage(Math.max(1e3 * t, 1)); + }, + }), + Object.defineProperty(i.Context.prototype, "latencyHint", { + get: function () { + return this._latencyHint; + }, + set: function (t) { + var e = t; + if (((this._latencyHint = t), this.isString(t))) + switch (t) { + case "interactive": + (e = 0.1), (this._context.latencyHint = t); + break; + case "playback": + (e = 0.8), (this._context.latencyHint = t); + break; + case "balanced": + (e = 0.25), (this._context.latencyHint = t); + break; + case "fastest": + e = 0.01; + } + (this.lookAhead = e), (this.updateInterval = e / 3); + }, + }), + i.supported && + ((r = AudioNode.prototype.connect), + (o = AudioNode.prototype.disconnect), + AudioNode.prototype.connect !== t && + ((AudioNode.prototype.connect = t), + (AudioNode.prototype.disconnect = function (t, e, n) { + if (t && t.input && Array.isArray(t.input)) + i.prototype.isUndef(n) && (n = 0), + this.disconnect(t.input[n], e, n); + else if (t && t.input) this.disconnect(t.input, e, n); + else + try { + o.apply(this, arguments); + } catch (e) { + throw new Error( + "error disconnecting node: " + t + "\n" + e, + ); + } + })), + (i.context = new i.Context())), + i.Context + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(4), n(20), n(2), n(10)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.Subtract = function (t) { + this.createInsOuts(2, 0), + (this._sum = this.input[0] = this.output = new e.Gain()), + (this._neg = new e.Negate()), + (this._param = this.input[1] = new e.Signal(t)), + this._param.chain(this._neg, this._sum); + }), + e.extend(e.Subtract, e.Signal), + (e.Subtract.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._neg.dispose(), + (this._neg = null), + this._sum.disconnect(), + (this._sum = null), + this._param.dispose(), + (this._param = null), + this + ); + }), + e.Subtract + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0)]), + void 0 === + (r = function (s) { + "use strict"; + return ( + (s.Emitter = function () { + this._events = {}; + }), + s.extend(s.Emitter), + (s.Emitter.prototype.on = function (t, e) { + for (var n = t.split(/\W+/), i = 0; i < n.length; i++) { + var r = n[i]; + this._events.hasOwnProperty(r) || (this._events[r] = []), + this._events[r].push(e); + } + return this; + }), + (s.Emitter.prototype.off = function (t, e) { + for (var n = t.split(/\W+/), i = 0; i < n.length; i++) + if (((t = n[i]), this._events.hasOwnProperty(t))) + if (s.prototype.isUndef(e)) this._events[t] = []; + else + for (var r = this._events[t], o = 0; o < r.length; o++) + r[o] === e && r.splice(o, 1); + return this; + }), + (s.Emitter.prototype.emit = function (t) { + if (this._events) { + var e = Array.apply(null, arguments).slice(1); + if (this._events.hasOwnProperty(t)) + for (var n = this._events[t], i = 0, r = n.length; i < r; i++) + n[i].apply(this, e); + } + return this; + }), + (s.Emitter.mixin = function (t) { + var e = ["on", "off", "emit"]; + t._events = {}; + for (var n = 0; n < e.length; n++) { + var i = e[n], + r = s.Emitter.prototype[i]; + t[i] = r; + } + }), + (s.Emitter.prototype.dispose = function () { + return ( + s.prototype.dispose.call(this), (this._events = null), this + ); + }), + s.Emitter + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0)]), + void 0 === + (r = function (i) { + "use strict"; + return ( + (i.SignalBase = function () {}), + i.extend(i.SignalBase), + (i.SignalBase.prototype.connect = function (t, e, n) { + return ( + (i.Signal && i.Signal === t.constructor) || + (i.Param && i.Param === t.constructor) || + (i.TimelineSignal && i.TimelineSignal === t.constructor) + ? (t._param.cancelScheduledValues(0), + (t._param.value = 0), + (t.overridden = !0)) + : t instanceof AudioParam && + (t.cancelScheduledValues(0), (t.value = 0)), + i.prototype.connect.call(this, t, e, n), + this + ); + }), + i.SignalBase + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(17)]), + void 0 === + (r = function (n) { + return ( + (n.Time = function (t, e) { + if (!(this instanceof n.Time)) return new n.Time(t, e); + (this._plusNow = !1), n.TimeBase.call(this, t, e); + }), + n.extend(n.Time, n.TimeBase), + (n.Time.prototype._unaryExpressions = Object.create( + n.TimeBase.prototype._unaryExpressions, + )), + (n.Time.prototype._unaryExpressions.quantize = { + regexp: /^@/, + method: function (t) { + return n.Transport.nextSubdivision(t()); + }, + }), + (n.Time.prototype._unaryExpressions.now = { + regexp: /^\+/, + method: function (t) { + return (this._plusNow = !0), t(); + }, + }), + (n.Time.prototype.quantize = function (t, e) { + return ( + (e = this.defaultArg(e, 1)), + (this._expr = function (t, e, n) { + return ( + (t = t()), + (e = e.toSeconds()), + t + (Math.round(t / e) * e - t) * n + ); + }.bind(this, this._expr, new this.constructor(t), e)), + this + ); + }), + (n.Time.prototype.addNow = function () { + return (this._plusNow = !0), this; + }), + (n.Time.prototype._defaultExpr = function () { + return (this._plusNow = !0), this._noOp; + }), + (n.Time.prototype.copy = function (t) { + return ( + n.TimeBase.prototype.copy.call(this, t), + (this._plusNow = t._plusNow), + this + ); + }), + (n.Time.prototype.toNotation = function () { + var t = this.toSeconds(), + e = this._toNotationHelper(t, [ + "1m", + "2n", + "4n", + "8n", + "16n", + "32n", + "64n", + "128n", + ]), + n = this._toNotationHelper(t, [ + "1m", + "2n", + "2t", + "4n", + "4t", + "8n", + "8t", + "16n", + "16t", + "32n", + "32t", + "64n", + "64t", + "128n", + ]); + return n.split("+").length < e.split("+").length ? n : e; + }), + (n.Time.prototype._toNotationHelper = function (t, e) { + for ( + var n = this._notationToUnits(e[e.length - 1]), i = "", r = 0; + r < e.length; + r++ + ) { + var o = this._notationToUnits(e[r]), + s = t / o; + if ( + (1 - (s % 1) < 1e-6 && (s += 1e-6), 0 < (s = Math.floor(s))) + ) { + if ( + ((i += 1 === s ? e[r] : s.toString() + "*" + e[r]), + (t -= s * o) < n) + ) + break; + i += " + "; + } + } + return "" === i && (i = "0"), i; + }), + (n.Time.prototype._notationToUnits = function (t) { + for ( + var e = this._primaryExpressions, n = [e.n, e.t, e.m], i = 0; + i < n.length; + i++ + ) { + var r = n[i], + o = t.match(r.regexp); + if (o) return r.method.call(this, o[1]); + } + }), + (n.Time.prototype.toBarsBeatsSixteenths = function () { + var t = this._beatsToUnits(1), + e = this.toSeconds() / t, + n = Math.floor(e / this._timeSignature()), + i = (e % 1) * 4; + return ( + (e = Math.floor(e) % this._timeSignature()), + 3 < (i = i.toString()).length && (i = parseFloat(i).toFixed(3)), + [n, e, i].join(":") + ); + }), + (n.Time.prototype.toTicks = function () { + var t = this._beatsToUnits(1), + e = this.valueOf() / t; + return Math.floor(e * n.Transport.PPQ); + }), + (n.Time.prototype.toSamples = function () { + return this.toSeconds() * this.context.sampleRate; + }), + (n.Time.prototype.toFrequency = function () { + return 1 / this.toSeconds(); + }), + (n.Time.prototype.toSeconds = function () { + return this.valueOf(); + }), + (n.Time.prototype.toMilliseconds = function () { + return 1e3 * this.toSeconds(); + }), + (n.Time.prototype.valueOf = function () { + return this._expr() + (this._plusNow ? this.now() : 0); + }), + n.Time + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0)]), + void 0 === + (r = function (i) { + return ( + (i.TimeBase = function (t, e) { + if (!(this instanceof i.TimeBase)) return new i.TimeBase(t, e); + if (((this._expr = this._noOp), t instanceof i.TimeBase)) + this.copy(t); + else if (!this.isUndef(e) || this.isNumber(t)) { + e = this.defaultArg(e, this._defaultUnits); + var n = this._primaryExpressions[e].method; + this._expr = n.bind(this, t); + } else + this.isString(t) + ? this.set(t) + : this.isUndef(t) && (this._expr = this._defaultExpr()); + }), + i.extend(i.TimeBase), + (i.TimeBase.prototype.set = function (t) { + return (this._expr = this._parseExprString(t)), this; + }), + (i.TimeBase.prototype.clone = function () { + var t = new this.constructor(); + return t.copy(this), t; + }), + (i.TimeBase.prototype.copy = function (t) { + var e = t._expr(); + return this.set(e); + }), + (i.TimeBase.prototype._primaryExpressions = { + n: { + regexp: /^(\d+)n/i, + method: function (t) { + return 1 === (t = parseInt(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, n) { + var i = 0; + return ( + t && + "0" !== t && + (i += this._beatsToUnits( + this._timeSignature() * parseFloat(t), + )), + e && "0" !== e && (i += this._beatsToUnits(parseFloat(e))), + n && + "0" !== n && + (i += this._beatsToUnits(parseFloat(n) / 4)), + i + ); + }, + }, + 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); + }, + }, + }), + (i.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(); + }, + }, + }), + (i.TimeBase.prototype._unaryExpressions = { + neg: { + regexp: /^\-/, + method: function (t) { + return -t(); + }, + }, + }), + (i.TimeBase.prototype._syntaxGlue = { + "(": { regexp: /^\(/ }, + ")": { regexp: /^\)/ }, + }), + (i.TimeBase.prototype._tokenize = function (t) { + for (var e = -1, n = []; 0 < t.length; ) { + var i = r((t = t.trim()), this); + n.push(i), (t = t.substr(i.value.length)); + } + function r(t, e) { + for ( + var n = [ + "_binaryExpressions", + "_unaryExpressions", + "_primaryExpressions", + "_syntaxGlue", + ], + i = 0; + i < n.length; + i++ + ) { + var r = e[n[i]]; + for (var o in r) { + var s = r[o], + a = s.regexp, + u = t.match(a); + if (null !== u) + return { + method: s.method, + precedence: s.precedence, + regexp: s.regexp, + value: u[0], + }; + } + } + throw new SyntaxError("Tone.TimeBase: Unexpected token " + t); + } + return { + next: function () { + return n[++e]; + }, + peek: function () { + return n[e + 1]; + }, + }; + }), + (i.TimeBase.prototype._matchGroup = function (t, e, n) { + if (!this.isUndef(t)) + for (var i in e) { + var r = e[i]; + if (r.regexp.test(t.value)) { + if (this.isUndef(n)) return r; + if (r.precedence === n) return r; + } + } + return !1; + }), + (i.TimeBase.prototype._parseBinary = function (t, e) { + var n; + this.isUndef(e) && (e = 2), + (n = e < 0 ? this._parseUnary(t) : this._parseBinary(t, e - 1)); + for ( + var i = t.peek(); + i && this._matchGroup(i, this._binaryExpressions, e); + + ) + (n = (i = t.next()).method.bind( + this, + n, + this._parseBinary(t, e - 1), + )), + (i = t.peek()); + return n; + }), + (i.TimeBase.prototype._parseUnary = function (t) { + var e, n; + e = t.peek(); + var i = this._matchGroup(e, this._unaryExpressions); + return i + ? ((e = t.next()), + (n = this._parseUnary(t)), + i.method.bind(this, n)) + : this._parsePrimary(t); + }), + (i.TimeBase.prototype._parsePrimary = function (t) { + var e, n; + if (((e = t.peek()), this.isUndef(e))) + throw new SyntaxError( + "Tone.TimeBase: Unexpected end of expression", + ); + if (this._matchGroup(e, this._primaryExpressions)) { + var i = (e = t.next()).value.match(e.regexp); + return e.method.bind(this, i[1], i[2], i[3]); + } + if (e && "(" === e.value) { + if ( + (t.next(), + (n = this._parseBinary(t)), + !(e = t.next()) || ")" !== e.value) + ) + throw new SyntaxError("Expected )"); + return n; + } + throw new SyntaxError( + "Tone.TimeBase: Cannot process token " + e.value, + ); + }), + (i.TimeBase.prototype._parseExprString = function (t) { + this.isString(t) || (t = t.toString()); + var e = this._tokenize(t); + return this._parseBinary(e); + }), + (i.TimeBase.prototype._noOp = function () { + return 0; + }), + (i.TimeBase.prototype._defaultExpr = function () { + return this._noOp; + }), + (i.TimeBase.prototype._defaultUnits = "s"), + (i.TimeBase.prototype._frequencyToUnits = function (t) { + return 1 / t; + }), + (i.TimeBase.prototype._beatsToUnits = function (t) { + return (60 / i.Transport.bpm.value) * t; + }), + (i.TimeBase.prototype._secondsToUnits = function (t) { + return t; + }), + (i.TimeBase.prototype._ticksToUnits = function (t) { + return t * (this._beatsToUnits(1) / i.Transport.PPQ); + }), + (i.TimeBase.prototype._timeSignature = function () { + return i.Transport.timeSignature; + }), + (i.TimeBase.prototype._pushExpr = function (t, e, n) { + return ( + t instanceof i.TimeBase || (t = new this.constructor(t, n)), + (this._expr = this._binaryExpressions[e].method.bind( + this, + this._expr, + t._expr, + )), + this + ); + }), + (i.TimeBase.prototype.add = function (t, e) { + return this._pushExpr(t, "+", e); + }), + (i.TimeBase.prototype.sub = function (t, e) { + return this._pushExpr(t, "-", e); + }), + (i.TimeBase.prototype.mult = function (t, e) { + return this._pushExpr(t, "*", e); + }), + (i.TimeBase.prototype.div = function (t, e) { + return this._pushExpr(t, "/", e); + }), + (i.TimeBase.prototype.valueOf = function () { + return this._expr(); + }), + (i.TimeBase.prototype.dispose = function () { + this._expr = null; + }), + i.TimeBase + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(9)]), + void 0 === + (r = function (i) { + "use strict"; + return ( + (i.Param = function () { + var t = this.optionsObject( + arguments, + ["param", "units", "convert"], + i.Param.defaults, + ); + (this._param = this.input = t.param), + (this.units = t.units), + (this.convert = t.convert), + (this.overridden = !1), + (this._lfo = null), + this.isObject(t.lfo) + ? (this.value = t.lfo) + : this.isUndef(t.value) || (this.value = t.value); + }), + i.extend(i.Param), + (i.Param.defaults = { + units: i.Type.Default, + convert: !0, + param: void 0, + }), + Object.defineProperty(i.Param.prototype, "value", { + get: function () { + return this._toUnits(this._param.value); + }, + set: function (t) { + if (this.isObject(t)) { + if (this.isUndef(i.LFO)) + throw new Error( + "Include 'Tone.LFO' to use an LFO as a Param value.", + ); + this._lfo && this._lfo.dispose(), + (this._lfo = new i.LFO(t).start()), + this._lfo.connect(this.input); + } else { + var e = this._fromUnits(t); + this._param.cancelScheduledValues(0), (this._param.value = e); + } + }, + }), + (i.Param.prototype._fromUnits = function (t) { + if (!this.convert && !this.isUndef(this.convert)) return t; + switch (this.units) { + case i.Type.Time: + return this.toSeconds(t); + case i.Type.Frequency: + return this.toFrequency(t); + case i.Type.Decibels: + return this.dbToGain(t); + case i.Type.NormalRange: + return Math.min(Math.max(t, 0), 1); + case i.Type.AudioRange: + return Math.min(Math.max(t, -1), 1); + case i.Type.Positive: + return Math.max(t, 0); + default: + return t; + } + }), + (i.Param.prototype._toUnits = function (t) { + if (!this.convert && !this.isUndef(this.convert)) return t; + switch (this.units) { + case i.Type.Decibels: + return this.gainToDb(t); + default: + return t; + } + }), + (i.Param.prototype._minOutput = 1e-5), + (i.Param.prototype.setValueAtTime = function (t, e) { + return ( + (t = this._fromUnits(t)), + (e = this.toSeconds(e)) <= this.now() + this.blockTime + ? (this._param.value = t) + : this._param.setValueAtTime(t, e), + this + ); + }), + (i.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 + ); + }), + (i.Param.prototype.linearRampToValueAtTime = function (t, e) { + return ( + (t = this._fromUnits(t)), + this._param.linearRampToValueAtTime(t, this.toSeconds(e)), + this + ); + }), + (i.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 + ); + }), + (i.Param.prototype.exponentialRampToValue = function (t, e, n) { + return ( + (n = this.toSeconds(n)), + this.setRampPoint(n), + this.exponentialRampToValueAtTime(t, n + this.toSeconds(e)), + this + ); + }), + (i.Param.prototype.linearRampToValue = function (t, e, n) { + return ( + (n = this.toSeconds(n)), + this.setRampPoint(n), + this.linearRampToValueAtTime(t, n + this.toSeconds(e)), + this + ); + }), + (i.Param.prototype.setTargetAtTime = function (t, e, n) { + return ( + (t = this._fromUnits(t)), + (t = Math.max(this._minOutput, t)), + (n = Math.max(this._minOutput, n)), + this._param.setTargetAtTime(t, this.toSeconds(e), n), + this + ); + }), + (i.Param.prototype.setValueCurveAtTime = function (t, e, n) { + for (var i = 0; i < t.length; i++) t[i] = this._fromUnits(t[i]); + return ( + this._param.setValueCurveAtTime( + t, + this.toSeconds(e), + this.toSeconds(n), + ), + this + ); + }), + (i.Param.prototype.cancelScheduledValues = function (t) { + return this._param.cancelScheduledValues(this.toSeconds(t)), this; + }), + (i.Param.prototype.rampTo = function (t, e, n) { + return ( + (e = this.defaultArg(e, 0)), + this.units === i.Type.Frequency || + this.units === i.Type.BPM || + this.units === i.Type.Decibels + ? this.exponentialRampToValue(t, e, n) + : this.linearRampToValue(t, e, n), + this + ); + }), + Object.defineProperty(i.Param.prototype, "lfo", { + get: function () { + return this._lfo; + }, + }), + (i.Param.prototype.dispose = function () { + return ( + i.prototype.dispose.call(this), + (this._param = null), + this._lfo && (this._lfo.dispose(), (this._lfo = null)), + this + ); + }), + i.Param + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(9)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.Timeline = function () { + var t = this.optionsObject( + arguments, + ["memory"], + e.Timeline.defaults, + ); + (this._timeline = []), + (this._toRemove = []), + (this._iterating = !1), + (this.memory = t.memory); + }), + e.extend(e.Timeline), + (e.Timeline.defaults = { memory: 1 / 0 }), + Object.defineProperty(e.Timeline.prototype, "length", { + get: function () { + return this._timeline.length; + }, + }), + (e.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 n = this.length - this.memory; + this._timeline.splice(0, n); + } + return this; + }), + (e.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; + }), + (e.Timeline.prototype.get = function (t) { + var e = this._search(t); + return -1 !== e ? this._timeline[e] : null; + }), + (e.Timeline.prototype.peek = function () { + return this._timeline[0]; + }), + (e.Timeline.prototype.shift = function () { + return this._timeline.shift(); + }), + (e.Timeline.prototype.getAfter = function (t) { + var e = this._search(t); + return e + 1 < this._timeline.length + ? this._timeline[e + 1] + : null; + }), + (e.Timeline.prototype.getBefore = function (t) { + var e = this._timeline.length; + if (0 < e && this._timeline[e - 1].time < t) + return this._timeline[e - 1]; + var n = this._search(t); + return 0 <= n - 1 ? this._timeline[n - 1] : null; + }), + (e.Timeline.prototype.cancel = function (t) { + if (1 < this._timeline.length) { + var e = this._search(t); + if (0 <= e) + if (this._timeline[e].time === t) { + for (var n = e; 0 <= n && this._timeline[n].time === t; n--) + e = n; + 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; + }), + (e.Timeline.prototype.cancelBefore = function (t) { + if (this._timeline.length) { + var e = this._search(t); + 0 <= e && (this._timeline = this._timeline.slice(e + 1)); + } + return this; + }), + (e.Timeline.prototype._search = function (t) { + var e = 0, + n = this._timeline.length, + i = n; + if (0 < n && this._timeline[n - 1].time <= t) return n - 1; + for (; e < i; ) { + var r = Math.floor(e + (i - e) / 2), + o = this._timeline[r], + s = this._timeline[r + 1]; + if (o.time === t) { + for (var a = r; a < this._timeline.length; a++) + this._timeline[a].time === t && (r = a); + return r; + } + if (o.time < t && s.time > t) return r; + o.time > t ? (i = r) : o.time < t && (e = r + 1); + } + return -1; + }), + (e.Timeline.prototype._iterate = function (t, e, n) { + (this._iterating = !0), + (e = this.defaultArg(e, 0)), + (n = this.defaultArg(n, this._timeline.length - 1)); + for (var i = e; i <= n; i++) t(this._timeline[i]); + if (((this._iterating = !1), 0 < this._toRemove.length)) { + for (var r = 0; r < this._toRemove.length; r++) { + var o = this._timeline.indexOf(this._toRemove[r]); + -1 !== o && this._timeline.splice(o, 1); + } + this._toRemove = []; + } + }), + (e.Timeline.prototype.forEach = function (t) { + return this._iterate(t), this; + }), + (e.Timeline.prototype.forEachBefore = function (t, e) { + var n = this._search(t); + return -1 !== n && this._iterate(e, 0, n), this; + }), + (e.Timeline.prototype.forEachAfter = function (t, e) { + var n = this._search(t); + return this._iterate(e, n + 1), this; + }), + (e.Timeline.prototype.forEachFrom = function (t, e) { + for ( + var n = this._search(t); + 0 <= n && this._timeline[n].time >= t; + + ) + n--; + return this._iterate(e, n + 1), this; + }), + (e.Timeline.prototype.forEachAtTime = function (e, n) { + var t = this._search(e); + return ( + -1 !== t && + this._iterate( + function (t) { + t.time === e && n(t); + }, + 0, + t, + ), + this + ); + }), + (e.Timeline.prototype.dispose = function () { + e.prototype.dispose.call(this), + (this._timeline = null), + (this._toRemove = null); + }), + e.Timeline + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(1), n(2)]), + void 0 === + (r = function (t) { + "use strict"; + return ( + (t.Negate = function () { + this._multiply = this.input = this.output = new t.Multiply(-1); + }), + t.extend(t.Negate, t.SignalBase), + (t.Negate.prototype.dispose = function () { + return ( + t.prototype.dispose.call(this), + this._multiply.dispose(), + (this._multiply = null), + this + ); + }), + t.Negate + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(2), n(1), n(6)]), + void 0 === + (r = function (t) { + "use strict"; + return ( + (t.GreaterThanZero = function () { + (this._thresh = this.output = + new t.WaveShaper(function (t) { + return t <= 0 ? 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 + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r, o; + (r = []), + void 0 === + (o = + "function" == + typeof (i = function () { + var s = function (t, e) { + (this._dragged = !1), + (this._element = t), + (this._bindedMove = this._moved.bind(this)), + (this._bindedEnd = this._ended.bind(this, e)), + t.addEventListener("touchstart", this._bindedEnd), + t.addEventListener("touchmove", this._bindedMove), + t.addEventListener("touchend", this._bindedEnd), + t.addEventListener("mouseup", this._bindedEnd); + }; + function o(t) { + return "running" === t.state; + } + return ( + (s.prototype._moved = function (t) { + this._dragged = !0; + }), + (s.prototype._ended = function (t) { + this._dragged || + (function (t) { + var e = t.createBuffer(1, 1, t.sampleRate), + n = t.createBufferSource(); + (n.buffer = e), + n.connect(t.destination), + n.start(0), + t.resume && t.resume(); + })(t), + (this._dragged = !1); + }), + (s.prototype.dispose = function () { + this._element.removeEventListener( + "touchstart", + this._bindedEnd, + ), + this._element.removeEventListener( + "touchmove", + this._bindedMove, + ), + this._element.removeEventListener( + "touchend", + this._bindedEnd, + ), + this._element.removeEventListener("mouseup", this._bindedEnd), + (this._bindedMove = null), + (this._bindedEnd = null), + (this._element = null); + }), + function (e, t, n) { + var i = new Promise(function (t) { + !(function (e, n) { + o(e) + ? n() + : (function t() { + o(e) + ? n() + : (requestAnimationFrame(t), + e.resume && e.resume()); + })(); + })(e, t); + }), + r = []; + return ( + (function t(e, n, i) { + if (Array.isArray(e) || (NodeList && e instanceof NodeList)) + for (var r = 0; r < e.length; r++) t(e[r], n, i); + else if ("string" == typeof e) + t(document.querySelectorAll(e), n, i); + else if (e.jquery && "function" == typeof e.toArray) + t(e.toArray(), n, i); + else if (Element && e instanceof Element) { + var o = new s(e, i); + n.push(o); + } + })((t = t || document.body), r, e), + i.then(function () { + for (var t = 0; t < r.length; t++) r[t].dispose(); + (r = null), n && n(); + }), + i + ); + } + ); + }) + ? i.apply(e, r) + : i) || (t.exports = o); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(2), n(32), n(38), n(10)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.CrossFade = function (t) { + this.createInsOuts(2, 1), + (this.a = this.input[0] = new e.Gain()), + (this.b = this.input[1] = new e.Gain()), + (this.fade = new e.Signal( + this.defaultArg(t, 0.5), + e.Type.NormalRange, + )), + (this._equalPowerA = new e.EqualPowerGain()), + (this._equalPowerB = new e.EqualPowerGain()), + (this._invert = new e.Expr("1 - $0")), + this.a.connect(this.output), + this.b.connect(this.output), + this.fade.chain(this._equalPowerB, this.b.gain), + this.fade.chain(this._invert, this._equalPowerA, this.a.gain), + this._readOnly("fade"); + }), + e.extend(e.CrossFade), + (e.CrossFade.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._writable("fade"), + this._equalPowerA.dispose(), + (this._equalPowerA = null), + this._equalPowerB.dispose(), + (this._equalPowerB = null), + this.fade.dispose(), + (this.fade = null), + this._invert.dispose(), + (this._invert = null), + this.a.dispose(), + (this.a = null), + this.b.dispose(), + (this.b = null), + this + ); + }), + e.CrossFade + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e) { + function l(t) { + var i = this, + r = {}, + o = -1; + this.parameters.forEach(function (t, e) { + var n = a[++o] || (a[o] = new Float32Array(i.bufferSize)); + n.fill(t.value), (r[e] = n); + }), + this.processor.realm.exec( + "self.sampleRate=sampleRate=" + + this.context.sampleRate + + ";self.currentTime=currentTime=" + + this.context.currentTime, + ); + var e = s(t.inputBuffer), + n = s(t.outputBuffer); + this.instance.process([e], [n], r); + } + function s(t) { + for (var e = [], n = 0; n < t.numberOfChannels; n++) + e[n] = t.getChannelData(n); + return e; + } + function h(t) { + return t.$$processors || (t.$$processors = {}); + } + function n(t) { + this.$$context = t; + } + var p, a; + (a = []), + "function" != typeof AudioWorkletNode && + ((self.AudioWorkletNode = function (t, e, n) { + var i = h(t)[e], + r = t.createScriptProcessor( + void 0, + 2, + n && n.outputChannelCount ? n.outputChannelCount[0] : 2, + ); + if (((r.parameters = new Map()), i.properties)) + for (var o = 0; o < i.properties.length; o++) { + var s = i.properties[o], + a = t.createGain().gain; + (a.value = s.defaultValue), r.parameters.set(s.name, a); + } + var u = new MessageChannel(); + p = u.port2; + var c = new i.Processor(n || {}); + return ( + (p = null), + (r.port = u.port1), + (r.processor = i), + (r.instance = c), + (r.onaudioprocess = l), + r + ); + }), + Object.defineProperty( + (self.AudioContext || self.webkitAudioContext).prototype, + "audioWorklet", + { + get: function () { + return ( + this.$$audioWorklet || + (this.$$audioWorklet = new self.AudioWorklet(this)) + ); + }, + }, + ), + (self.AudioWorklet = + ((n.prototype.addModule = function (t, e) { + var r = this; + return fetch(t) + .then(function (t) { + if (!t.ok) throw Error(t.status); + return t.text(); + }) + .then(function (t) { + var n = { + sampleRate: 0, + currentTime: 0, + AudioWorkletProcessor: function () { + this.port = p; + }, + registerProcessor: function (t, e) { + h(r.$$context)[t] = { + realm: i, + context: n, + Processor: e, + properties: e.parameterDescriptors || [], + }; + }, + }, + i = new (function (t, e) { + var n = document.createElement("iframe"); + (n.style.cssText = + "position:absolute;left:0;top:-999px;width:1px;height:1px;"), + e.appendChild(n); + var i = n.contentWindow, + r = i.document, + o = "var window,$hook"; + for (var s in i) + s in t || "eval" === s || ((o += ","), (o += s)); + for (var a in t) + (o += ","), (o += a), (o += "=self."), (o += a); + var u = r.createElement("script"); + u.appendChild( + r.createTextNode( + 'function $hook(self,console) {"use strict";\n ' + + o + + ";return function() {return eval(arguments[0])}}", + ), + ), + r.body.appendChild(u), + (this.exec = i.$hook(t, console)); + })((n.self = n), document.documentElement); + return i.exec(((e && e.transpile) || String)(t)), null; + }); + }), + n))); + }, + function (t, e) { + function n(t) { + t && (t.setTargetAtTime || (t.setTargetAtTime = t.setTargetValueAtTime)); + } + window, + 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 t = this.internal_createGain(); + return n(t.gain), t; + }), + (AudioContext.prototype.internal_createDelay = + AudioContext.prototype.createDelay), + (AudioContext.prototype.createDelay = function (t) { + var e = t + ? this.internal_createDelay(t) + : this.internal_createDelay(); + return n(e.delayTime), e; + }), + (AudioContext.prototype.internal_createBufferSource = + AudioContext.prototype.createBufferSource), + (AudioContext.prototype.createBufferSource = function () { + var i = this.internal_createBufferSource(); + return ( + i.start + ? ((i.internal_start = i.start), + (i.start = function (t, e, n) { + void 0 !== n + ? i.internal_start(t || 0, e, n) + : i.internal_start(t || 0, e || 0); + })) + : (i.start = function (t, e, n) { + e || n ? this.noteGrainOn(t || 0, e, n) : this.noteOn(t || 0); + }), + i.stop + ? ((i.internal_stop = i.stop), + (i.stop = function (t) { + i.internal_stop(t || 0); + })) + : (i.stop = function (t) { + this.noteOff(t || 0); + }), + n(i.playbackRate), + i + ); + }), + (AudioContext.prototype.internal_createDynamicsCompressor = + AudioContext.prototype.createDynamicsCompressor), + (AudioContext.prototype.createDynamicsCompressor = function () { + var t = this.internal_createDynamicsCompressor(); + return ( + n(t.threshold), + n(t.knee), + n(t.ratio), + n(t.reduction), + n(t.attack), + n(t.release), + t + ); + }), + (AudioContext.prototype.internal_createBiquadFilter = + AudioContext.prototype.createBiquadFilter), + (AudioContext.prototype.createBiquadFilter = function () { + var t = this.internal_createBiquadFilter(); + return n(t.frequency), n(t.detune), n(t.Q), n(t.gain), t; + }), + "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), + n(e.frequency), + n(e.detune), + e + ); + }))), + window.hasOwnProperty("webkitOfflineAudioContext") && + !window.hasOwnProperty("OfflineAudioContext") && + (window.OfflineAudioContext = window.webkitOfflineAudioContext), + (navigator.getUserMedia = + navigator.getUserMedia || + navigator.webkitGetUserMedia || + navigator.mozGetUserMedia || + navigator.msGetUserMedia); + var i = document.createElement("audio"); + p5.prototype.isSupported = function () { + return !!i.canPlayType; + }; + p5.prototype.isFileSupported = function (t) { + switch (t.toLowerCase()) { + case "mp3": + return !!i.canPlayType && i.canPlayType("audio/mpeg;"); + case "wav": + return !!i.canPlayType && i.canPlayType('audio/wav; codecs="1"'); + case "ogg": + return !!i.canPlayType && i.canPlayType('audio/ogg; codecs="vorbis"'); + case "aac": + case "m4a": + case "mp4": + return ( + !!i.canPlayType && + (i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/aac;")) + ); + case "aif": + case "aiff": + return !!i.canPlayType && i.canPlayType("audio/x-aiff;"); + default: + return !1; + } + }; + }, + function (t, e) { + var n; + n = (function () { + return this; + })(); + try { + n = n || new Function("return this")(); + } catch (t) { + "object" == typeof window && (n = window); + } + t.exports = n; + }, + function (t, e, n) { + "use strict"; + n.r(e), + (e.default = + 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'start\') {\n _this.record(data.duration);\n } else if (data.name === \'stop\') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: "process",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: "record",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: "stop",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: \'buffers\',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: "getBuffers",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: "mergeBuffers",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: "clear",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);'); + }, + function (t, e, n) { + "use strict"; + n.r(e), + (e.default = + 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: "process",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: \'position\',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);'); + }, + function (t, e, n) { + "use strict"; + n.r(e), + (e.default = + 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'toggleNormalize\') {\n _this.normalize = data.normalize;\n } else if (data.name === \'smoothing\') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: "process",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: \'amplitude\',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);'); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(17)]), + void 0 === + (r = function (r) { + (r.Frequency = function (t, e) { + if (!(this instanceof r.Frequency)) return new r.Frequency(t, e); + r.TimeBase.call(this, t, e); + }), + r.extend(r.Frequency, r.TimeBase), + (r.Frequency.prototype._primaryExpressions = Object.create( + r.TimeBase.prototype._primaryExpressions, + )), + (r.Frequency.prototype._primaryExpressions.midi = { + regexp: /^(\d+(?:\.\d+)?midi)/, + method: function (t) { + return this.midiToFrequency(t); + }, + }), + (r.Frequency.prototype._primaryExpressions.note = { + regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i, + method: function (t, e) { + var n = i[t.toLowerCase()] + 12 * (parseInt(e) + 1); + return this.midiToFrequency(n); + }, + }), + (r.Frequency.prototype._primaryExpressions.tr = { + regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, + method: function (t, e, n) { + var i = 1; + return ( + t && + "0" !== t && + (i *= this._beatsToUnits( + this._timeSignature() * parseFloat(t), + )), + e && "0" !== e && (i *= this._beatsToUnits(parseFloat(e))), + n && + "0" !== n && + (i *= this._beatsToUnits(parseFloat(n) / 4)), + i + ); + }, + }), + (r.Frequency.prototype.transpose = function (t) { + return ( + (this._expr = function (t, e) { + return t() * this.intervalToFrequencyRatio(e); + }.bind(this, this._expr, t)), + this + ); + }), + (r.Frequency.prototype.harmonize = function (t) { + return ( + (this._expr = function (t, e) { + for (var n = t(), i = [], r = 0; r < e.length; r++) + i[r] = n * this.intervalToFrequencyRatio(e[r]); + return i; + }.bind(this, this._expr, t)), + this + ); + }), + (r.Frequency.prototype.toMidi = function () { + return this.frequencyToMidi(this.valueOf()); + }), + (r.Frequency.prototype.toNote = function () { + var t = this.valueOf(), + e = Math.log(t / r.Frequency.A4) / Math.LN2, + n = Math.round(12 * e) + 57, + i = Math.floor(n / 12); + return i < 0 && (n += -12 * i), o[n % 12] + i.toString(); + }), + (r.Frequency.prototype.toSeconds = function () { + return 1 / this.valueOf(); + }), + (r.Frequency.prototype.toFrequency = function () { + return this.valueOf(); + }), + (r.Frequency.prototype.toTicks = function () { + var t = this._beatsToUnits(1), + e = this.valueOf() / t; + return Math.floor(e * r.Transport.PPQ); + }), + (r.Frequency.prototype._frequencyToUnits = function (t) { + return t; + }), + (r.Frequency.prototype._ticksToUnits = function (t) { + return 1 / ((60 * t) / (r.Transport.bpm.value * r.Transport.PPQ)); + }), + (r.Frequency.prototype._beatsToUnits = function (t) { + return 1 / r.TimeBase.prototype._beatsToUnits.call(this, t); + }), + (r.Frequency.prototype._secondsToUnits = function (t) { + return 1 / t; + }), + (r.Frequency.prototype._defaultUnits = "hz"); + var i = { + 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, + }, + o = [ + "C", + "C#", + "D", + "D#", + "E", + "F", + "F#", + "G", + "G#", + "A", + "A#", + "B", + ]; + return ( + (r.Frequency.A4 = 440), + (r.Frequency.prototype.midiToFrequency = function (t) { + return r.Frequency.A4 * Math.pow(2, (t - 69) / 12); + }), + (r.Frequency.prototype.frequencyToMidi = function (t) { + return 69 + (12 * Math.log(t / r.Frequency.A4)) / Math.LN2; + }), + r.Frequency + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(16)]), + void 0 === + (r = function (i) { + return ( + (i.TransportTime = function (t, e) { + if (!(this instanceof i.TransportTime)) + return new i.TransportTime(t, e); + i.Time.call(this, t, e); + }), + i.extend(i.TransportTime, i.Time), + (i.TransportTime.prototype._unaryExpressions = Object.create( + i.Time.prototype._unaryExpressions, + )), + (i.TransportTime.prototype._unaryExpressions.quantize = { + regexp: /^@/, + method: function (t) { + var e = this._secondsToTicks(t()), + n = Math.ceil(i.Transport.ticks / e); + return this._ticksToUnits(n * e); + }, + }), + (i.TransportTime.prototype._secondsToTicks = function (t) { + var e = t / this._beatsToUnits(1); + return Math.round(e * i.Transport.PPQ); + }), + (i.TransportTime.prototype.valueOf = function () { + return ( + this._secondsToTicks(this._expr()) + + (this._plusNow ? i.Transport.ticks : 0) + ); + }), + (i.TransportTime.prototype.toTicks = function () { + return this.valueOf(); + }), + (i.TransportTime.prototype.toSeconds = function () { + return this._expr() + (this._plusNow ? i.Transport.seconds : 0); + }), + (i.TransportTime.prototype.toFrequency = function () { + return 1 / this.toSeconds(); + }), + i.TransportTime + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [ + n(0), + n(4), + n(13), + n(1), + n(33), + n(21), + n(34), + n(20), + n(35), + n(36), + n(37), + ]), + void 0 === + (r = function (u) { + "use strict"; + function n(t, e, n) { + var i = new t(); + return ( + n._eval(e[0]).connect(i, 0, 0), n._eval(e[1]).connect(i, 0, 1), i + ); + } + function i(t, e, n) { + var i = new t(); + return n._eval(e[0]).connect(i, 0, 0), i; + } + function r(t) { + return t ? parseFloat(t) : void 0; + } + function o(t) { + return t && t.args ? parseFloat(t.args) : void 0; + } + return ( + (u.Expr = function () { + var t = this._replacements(Array.prototype.slice.call(arguments)), + e = this._parseInputs(t); + (this._nodes = []), (this.input = new Array(e)); + for (var n = 0; n < e; n++) + this.input[n] = this.context.createGain(); + var i, + r = this._parseTree(t); + try { + i = this._eval(r); + } catch (e) { + throw ( + (this._disposeNodes(), + new Error("Tone.Expr: Could evaluate expression: " + t)) + ); + } + this.output = i; + }), + u.extend(u.Expr, u.SignalBase), + (u.Expr._Expressions = { + value: { + signal: { + regexp: /^\d+\.\d+|^\d+/, + method: function (t) { + return new u.Signal(r(t)); + }, + }, + input: { + regexp: /^\$\d/, + method: function (t, e) { + return e.input[r(t.substr(1))]; + }, + }, + }, + glue: { + "(": { regexp: /^\(/ }, + ")": { regexp: /^\)/ }, + ",": { regexp: /^,/ }, + }, + func: { + abs: { regexp: /^abs/, method: i.bind(this, u.Abs) }, + mod: { + regexp: /^mod/, + method: function (t, e) { + var n = o(t[1]), + i = new u.Modulo(n); + return e._eval(t[0]).connect(i), i; + }, + }, + pow: { + regexp: /^pow/, + method: function (t, e) { + var n = o(t[1]), + i = new u.Pow(n); + return e._eval(t[0]).connect(i), i; + }, + }, + a2g: { + regexp: /^a2g/, + method: function (t, e) { + var n = new u.AudioToGain(); + return e._eval(t[0]).connect(n), n; + }, + }, + }, + binary: { + "+": { + regexp: /^\+/, + precedence: 1, + method: n.bind(this, u.Add), + }, + "-": { + regexp: /^\-/, + precedence: 1, + method: function (t, e) { + return 1 === t.length + ? i(u.Negate, t, e) + : n(u.Subtract, t, e); + }, + }, + "*": { + regexp: /^\*/, + precedence: 0, + method: n.bind(this, u.Multiply), + }, + }, + unary: { + "-": { regexp: /^\-/, method: i.bind(this, u.Negate) }, + "!": { regexp: /^\!/, method: i.bind(this, u.NOT) }, + }, + }), + (u.Expr.prototype._parseInputs = function (t) { + var e = t.match(/\$\d/g), + n = 0; + if (null !== e) + for (var i = 0; i < e.length; i++) { + var r = parseInt(e[i].substr(1)) + 1; + n = Math.max(n, r); + } + return n; + }), + (u.Expr.prototype._replacements = function (t) { + for (var e = t.shift(), n = 0; n < t.length; n++) + e = e.replace(/\%/i, t[n]); + return e; + }), + (u.Expr.prototype._tokenize = function (t) { + for (var e = -1, n = []; 0 < t.length; ) { + var i = r((t = t.trim())); + n.push(i), (t = t.substr(i.value.length)); + } + function r(t) { + for (var e in u.Expr._Expressions) { + var n = u.Expr._Expressions[e]; + for (var i in n) { + var r = n[i], + o = r.regexp, + s = t.match(o); + if (null !== s) + return { type: e, value: s[0], method: r.method }; + } + } + throw new SyntaxError("Tone.Expr: Unexpected token " + t); + } + return { + next: function () { + return n[++e]; + }, + peek: function () { + return n[e + 1]; + }, + }; + }), + (u.Expr.prototype._parseTree = function (t) { + var i = this._tokenize(t), + s = this.isUndef.bind(this); + function r(t, e) { + return !s(t) && "glue" === t.type && t.value === e; + } + function o(t, e, n) { + var i = u.Expr._Expressions[e]; + if (!s(t)) + for (var r in i) { + var o = i[r]; + if (o.regexp.test(t.value)) { + if (s(n)) return !0; + if (o.precedence === n) return !0; + } + } + return !1; + } + function a(t) { + var e; + s(t) && (t = 5), + (e = + t < 0 + ? (function t() { + var e, n; + return o((e = i.peek()), "unary") + ? ((e = i.next()), + (n = t()), + { + operator: e.value, + method: e.method, + args: [n], + }) + : (function () { + var t, e; + if (((t = i.peek()), s(t))) + throw new SyntaxError( + "Tone.Expr: Unexpected termination of expression", + ); + if ("func" === t.type) + return (function (t) { + var e = []; + if (!r(i.next(), "(")) + throw new SyntaxError( + 'Tone.Expr: Expected ( in a function call "' + + t.value + + '"', + ); + if ( + (r(i.peek(), ")") || + (e = (function () { + for ( + var t, e = []; + (t = a()), + !s(t) && + (e.push(t), r(i.peek(), ",")); + + ) + i.next(); + return e; + })()), + r(i.next(), ")")) + ) + return { + method: t.method, + args: e, + name: name, + }; + throw new SyntaxError( + 'Tone.Expr: Expected ) in a function call "' + + t.value + + '"', + ); + })((t = i.next())); + if ("value" === t.type) + return { + method: (t = i.next()).method, + args: t.value, + }; + if (r(t, "(")) { + if ( + (i.next(), + (e = a()), + !r((t = i.next()), ")")) + ) + throw new SyntaxError("Expected )"); + return e; + } + throw new SyntaxError( + "Tone.Expr: Parse error, cannot process token " + + t.value, + ); + })(); + })() + : a(t - 1)); + for (var n = i.peek(); o(n, "binary", t); ) + (e = { + operator: (n = i.next()).value, + method: n.method, + args: [e, a(t - 1)], + }), + (n = i.peek()); + return e; + } + return a(); + }), + (u.Expr.prototype._eval = function (t) { + if (!this.isUndef(t)) { + var e = t.method(t.args, this); + return this._nodes.push(e), e; + } + }), + (u.Expr.prototype._disposeNodes = function () { + for (var t = 0; t < this._nodes.length; t++) { + var e = this._nodes[t]; + this.isFunction(e.dispose) + ? e.dispose() + : this.isFunction(e.disconnect) && e.disconnect(), + (e = null), + (this._nodes[t] = null); + } + this._nodes = null; + }), + (u.Expr.prototype.dispose = function () { + u.prototype.dispose.call(this), this._disposeNodes(); + }), + u.Expr + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(21), n(13), n(2)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.GreaterThan = function (t) { + this.createInsOuts(2, 0), + (this._param = this.input[0] = new e.Subtract(t)), + (this.input[1] = this._param.input[1]), + (this._gtz = this.output = new e.GreaterThanZero()), + this._param.connect(this._gtz); + }), + e.extend(e.GreaterThan, e.Signal), + (e.GreaterThan.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._param.dispose(), + (this._param = null), + this._gtz.dispose(), + (this._gtz = null), + this + ); + }), + e.GreaterThan + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(6), n(15)]), + void 0 === + (r = 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 + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(6), n(1), n(13)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.Modulo = function (t) { + this.createInsOuts(1, 0), + (this._shaper = new e.WaveShaper(Math.pow(2, 16))), + (this._multiply = new e.Multiply()), + (this._subtract = this.output = new e.Subtract()), + (this._modSignal = new e.Signal(t)), + 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(t); + }), + e.extend(e.Modulo, e.SignalBase), + (e.Modulo.prototype._setWaveShaper = function (e) { + this._shaper.setMap(function (t) { + return Math.floor((t + 1e-4) / e); + }); + }), + Object.defineProperty(e.Modulo.prototype, "value", { + get: function () { + return this._modSignal.value; + }, + set: function (t) { + (this._modSignal.value = t), this._setWaveShaper(t); + }, + }), + (e.Modulo.prototype.dispose = function () { + return ( + e.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 + ); + }), + e.Modulo + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(6)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.Pow = function (t) { + (this._exp = this.defaultArg(t, 1)), + (this._expScaler = + this.input = + this.output = + new e.WaveShaper(this._expFunc(this._exp), 8192)); + }), + e.extend(e.Pow, e.SignalBase), + Object.defineProperty(e.Pow.prototype, "value", { + get: function () { + return this._exp; + }, + set: function (t) { + (this._exp = t), + this._expScaler.setMap(this._expFunc(this._exp)); + }, + }), + (e.Pow.prototype._expFunc = function (e) { + return function (t) { + return Math.pow(Math.abs(t), e); + }; + }), + (e.Pow.prototype.dispose = function () { + return ( + e.prototype.dispose.call(this), + this._expScaler.dispose(), + (this._expScaler = null), + this + ); + }), + e.Pow + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(6), n(2)]), + void 0 === + (r = 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 + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(6)]), + void 0 === + (r = function (t) { + "use strict"; + return ( + (t.EqualPowerGain = function () { + this._eqPower = + this.input = + this.output = + new t.WaveShaper( + function (t) { + return Math.abs(t) < 0.001 ? 0 : this.equalPowerScale(t); + }.bind(this), + 4096, + ); + }), + t.extend(t.EqualPowerGain, t.SignalBase), + (t.EqualPowerGain.prototype.dispose = function () { + return ( + t.prototype.dispose.call(this), + this._eqPower.dispose(), + (this._eqPower = null), + this + ); + }), + t.EqualPowerGain + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + var i, r; + (i = [n(0), n(19), n(9)]), + void 0 === + (r = function (e) { + "use strict"; + return ( + (e.TimelineState = function (t) { + e.Timeline.call(this), (this._initial = t); + }), + e.extend(e.TimelineState, e.Timeline), + (e.TimelineState.prototype.getValueAtTime = function (t) { + var e = this.get(t); + return null !== e ? e.state : this._initial; + }), + (e.TimelineState.prototype.setStateAtTime = function (t, e) { + this.add({ state: t, time: e }); + }), + e.TimelineState + ); + }.apply(e, i)) || (t.exports = r); + }, + function (t, e, n) { + "use strict"; + n.r(e); + n(24), n(25); + var c = n(3); + var o = new (function t() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, t), + (this.input = c.a.createGain()), + (this.output = c.a.createGain()), + (this.limiter = c.a.createDynamicsCompressor()), + (this.limiter.threshold.value = -3), + (this.limiter.ratio.value = 20), + (this.limiter.knee.value = 1), + (this.audiocontext = c.a), + this.output.disconnect(), + this.input.connect(this.limiter), + this.limiter.connect(this.output), + (this.meter = c.a.createGain()), + (this.fftMeter = c.a.createGain()), + this.output.connect(this.meter), + this.output.connect(this.fftMeter), + this.output.connect(this.audiocontext.destination), + (this.soundArray = []), + (this.parts = []), + (this.extensions = []); + })(); + (p5.prototype.getOutputVolume = function () { + return o.output.gain.value; + }), + (p5.prototype.outputVolume = function (t) { + var e = + 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, + n = + 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 0; + if ("number" == typeof t) { + var i = o.audiocontext.currentTime, + r = o.output.gain.value; + o.output.gain.cancelScheduledValues(i + n), + o.output.gain.linearRampToValueAtTime(r, i + n), + o.output.gain.linearRampToValueAtTime(t, i + n + e); + } else { + if (!t) return o.output.gain; + t.connect(o.output.gain); + } + }), + (p5.prototype.soundOut = p5.soundOut = o), + (p5.soundOut._silentNode = o.audiocontext.createGain()), + (p5.soundOut._silentNode.gain.value = 0), + p5.soundOut._silentNode.connect(o.audiocontext.destination); + var p = o, + i = n(5), + s = n.n(i); + function f(t) { + return (f = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function l(t) { + var e = Math.log(t / 440) / Math.log(2); + return Math.round(12 * e) + 69; + } + function r(t) { + return 440 * Math.pow(2, (t - 69) / 12); + } + function h(t) { + if ("string" != typeof t) return t; + var e = { A: 21, B: 23, C: 24, D: 26, E: 28, F: 29, G: 31 }[ + t[0].toUpperCase() + ]; + switch (((e += 12 * (~~t.slice(-1) - 1)), t[1])) { + case "#": + e += 1; + break; + case "b": + e -= 1; + } + return r(e); + } + function a(t) { + var e, + n = u( + (e = t.getChannelData(0)), + 1 < t.numberOfChannels ? t.getChannelData(1) : e, + ), + i = new window.ArrayBuffer(44 + 2 * n.length), + r = new window.DataView(i); + d(r, 0, "RIFF"), + r.setUint32(4, 36 + 2 * n.length, !0), + d(r, 8, "WAVE"), + d(r, 12, "fmt "), + r.setUint32(16, 16, !0), + r.setUint16(20, 1, !0), + r.setUint16(22, 2, !0), + r.setUint32(24, p.audiocontext.sampleRate, !0), + r.setUint32(28, 4 * p.audiocontext.sampleRate, !0), + r.setUint16(32, 4, !0), + r.setUint16(34, 16, !0), + d(r, 36, "data"), + r.setUint32(40, 2 * n.length, !0); + for (var o = n.length, s = 44, a = 0; a < o; a++) + r.setInt16(s, 32767 * n[a], !0), (s += 2); + return r; + } + function u(t, e) { + for ( + var n = t.length + e.length, i = new Float32Array(n), r = 0, o = 0; + o < n; + + ) + (i[o++] = t[r]), (i[o++] = e[r]), r++; + return i; + } + function d(t, e, n) { + for (var i = n.length, r = 0; r < i; r++) + t.setUint8(e + r, n.charCodeAt(r)); + } + function y(t) { + var e = t, + n = new AudioWorkletNode(p.audiocontext, s.a.soundFileProcessor); + return ( + n instanceof ScriptProcessorNode && (e = n.bufferSize), + n.disconnect(), + (n = null), + e + ); + } + var m = function (t, e, n) { + var i, + r, + o = new Error(); + return ( + (o.name = t), + (o.originalStack = o.stack + e), + (i = o.stack + e), + (o.failedPath = n), + (r = i.split("\n").filter(function (t) { + return !t.match(/(p5.|native code|globalInit)/g); + })), + (o.stack = r.join("\n")), + o + ); + }, + v = [n(27).default, n(28).default, n(29).default], + _ = p.audiocontext, + g = !1; + function b(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function T(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function w(t, e, n) { + return e && T(t.prototype, e), n && T(t, n), t; + } + p5.prototype.registerMethod("init", function () { + if (!g) { + this.preload || window.preload || (this.preload = function () {}), + this._incrementPreload(); + var t = function () { + (g = !0), this._decrementPreload(); + }.bind(this); + Promise.all( + v.map(function (t) { + var e = new Blob([t], { type: "application/javascript" }), + n = URL.createObjectURL(e); + return _.audioWorklet.addModule(n); + }), + ).then(t); + } + }); + var x, + S = p.audiocontext; + void 0 !== S.createStereoPanner + ? (x = (function () { + function n(t, e) { + b(this, n), + (this.stereoPanner = this.input = S.createStereoPanner()), + t.connect(this.stereoPanner), + this.stereoPanner.connect(e); + } + return ( + w(n, [ + { + key: "pan", + value: function (t, e) { + var n = e || 0, + i = S.currentTime + n; + this.stereoPanner.pan.linearRampToValueAtTime(t, i); + }, + }, + { key: "inputChannels", value: function () {} }, + { + key: "connect", + value: function (t) { + this.stereoPanner.connect(t); + }, + }, + { + key: "disconnect", + value: function () { + this.stereoPanner && this.stereoPanner.disconnect(); + }, + }, + ]), + n + ); + })()) + : (x = (function () { + function i(t, e, n) { + b(this, i), + (this.input = S.createGain()), + t.connect(this.input), + (this.left = S.createGain()), + (this.right = S.createGain()), + (this.left.channelInterpretation = "discrete"), + (this.right.channelInterpretation = "discrete"), + 1 < n + ? ((this.splitter = S.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 = S.createChannelMerger(2)), + this.left.connect(this.output, 0, 1), + this.right.connect(this.output, 0, 0), + this.output.connect(e); + } + return ( + w(i, [ + { + key: "pan", + value: function (t, e) { + var n = e || 0, + i = S.currentTime + n, + r = (t + 1) / 2, + o = Math.cos((r * Math.PI) / 2), + s = Math.sin((r * Math.PI) / 2); + this.left.gain.linearRampToValueAtTime(s, i), + this.right.gain.linearRampToValueAtTime(o, i); + }, + }, + { + key: "inputChannels", + value: function (t) { + 1 === t + ? (this.input.disconnect(), + this.input.connect(this.left), + this.input.connect(this.right)) + : 2 === t && + (void 0 === this.splitter && + (this.splitter = S.createChannelSplitter(2)), + this.input.disconnect(), + this.input.connect(this.splitter), + this.splitter.connect(this.left, 1), + this.splitter.connect(this.right, 0)); + }, + }, + { + key: "connect", + value: function (t) { + this.output.connect(t); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(); + }, + }, + ]), + i + ); + })()); + var k = x; + function P(t) { + return (P = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function A(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function O(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function C(t, e, n, i) { + O(this, C), + (this.callback = t), + (this.time = e), + (this.id = n), + (this.val = i); + } + var R = p.audiocontext; + var q = (function () { + function o(t, e, n, i) { + if ((O(this, o), void 0 !== t)) { + if ("string" == typeof t || "string" == typeof t[0]) { + var r = p5.prototype._checkFileFormats(t); + this.url = r; + } else if ( + "object" === P(t) && + !( + window.File && + window.FileReader && + window.FileList && + window.Blob + ) + ) + throw "Unable to load file because the File API is not supported"; + t.file && (t = t.file), (this.file = t); + } + (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._workletNode = null), + (this.bufferSourceNodes = []), + (this.bufferSourceNode = null), + (this.buffer = null), + (this.playbackRate = 1), + (this.input = p.audiocontext.createGain()), + (this.output = p.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 k(this.output, p.input, 2)), + (this.url || this.file) && this.load(e, n), + p.soundArray.push(this), + (this._whileLoading = "function" == typeof i ? i : function () {}), + (this._clearOnEnd = function (t) { + var e = t.target, + n = this; + (e._playing = !1), + e.removeEventListener("ended", n._clearOnEnd), + n._onended(n), + n.bufferSourceNodes + .map(function (t, e) { + return e; + }) + .reverse() + .forEach(function (t) { + !1 === n.bufferSourceNodes[t]._playing && + n.bufferSourceNodes.splice(t, 1); + }), + 0 === n.bufferSourceNodes.length && (n._playing = !1); + }.bind(this)), + (this.amp = this.setVolume), + (this.fade = this.setVolume); + } + return ( + (function (t, e, n) { + e && A(t.prototype, e), n && A(t, n); + })(o, [ + { + key: "load", + value: function (n, i) { + var r = this, + o = new Error().stack; + if (void 0 !== this.url && "" !== this.url) { + var s = new XMLHttpRequest(); + s.addEventListener( + "progress", + function (t) { + r._updateProgress(t); + }, + !1, + ), + s.open("GET", this.url, !0), + (s.responseType = "arraybuffer"), + (s.onload = function () { + if (200 === s.status) { + if (!r.panner) return; + R.decodeAudioData( + s.response, + function (t) { + r.panner && + ((r.buffer = t), + r.panner.inputChannels(t.numberOfChannels), + n && n(r)); + }, + function () { + if (r.panner) { + var t = new m("decodeAudioData", o, r.url), + e = + "AudioContext error at decodeAudioData for " + + r.url; + i && ((t.msg = e), i(t)); + } + }, + ); + } else { + if (!r.panner) return; + var t = new m("loadSound", o, r.url), + e = + "Unable to load " + + r.url + + ". The request status was: " + + s.status + + " (" + + s.statusText + + ")"; + i && ((t.message = e), i(t)); + } + }), + (s.onerror = function () { + var t = new m("loadSound", o, r.url), + e = + "There was no response from the server at " + + r.url + + ". Check the url and internet connectivity."; + i && ((t.message = e), i(t)); + }), + s.send(); + } else if (void 0 !== this.file) { + var t = new FileReader(); + (t.onload = function () { + r.panner && + R.decodeAudioData(t.result, function (t) { + r.panner && + ((r.buffer = t), + r.panner.inputChannels(t.numberOfChannels), + n && n(r)); + }); + }), + (t.onerror = function (t) { + r.panner && onerror && onerror(t); + }), + t.readAsArrayBuffer(this.file); + } + }, + }, + { + key: "_updateProgress", + value: function (t) { + if (t.lengthComputable) { + var e = (t.loaded / t.total) * 0.99; + this._whileLoading(e, t); + } else this._whileLoading("size unknown"); + }, + }, + { + key: "isLoaded", + value: function () { + return !!this.buffer; + }, + }, + { + key: "play", + value: function (t, e, n, i, r) { + if (this.output) { + var o, + s, + a = t || 0; + if ( + (a < 0 && (a = 0), + (a += p.audiocontext.currentTime), + void 0 !== e && this.rate(e), + void 0 !== n && this.setVolume(n), + !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(a), this._counterNode.stop(a)), + "untildone" !== this.mode || !this.isPlaying()) + ) { + if ( + ((this.bufferSourceNode = this._initSourceNode()), + delete this._counterNode, + (this._counterNode = this._initCounterNode()), + i) + ) { + if (!(0 <= i && i < this.buffer.duration)) + throw "start time out of range"; + o = i; + } else o = 0; + (r = + r && + (r <= this.buffer.duration - o ? r : this.buffer.duration)), + this._paused + ? (this.bufferSourceNode.start(a, this.pauseTime, r), + this._counterNode.start(a, this.pauseTime, r)) + : (this.bufferSourceNode.start(a, o, r), + this._counterNode.start(a, o, r)), + (this._playing = !0), + (this._paused = !1), + this.bufferSourceNodes.push(this.bufferSourceNode), + (this.bufferSourceNode._arrayIndex = + this.bufferSourceNodes.length - 1), + this.bufferSourceNode.addEventListener( + "ended", + this._clearOnEnd, + ), + (this.bufferSourceNode.loop = this._looping), + (this._counterNode.loop = this._looping), + !0 === this._looping && + ((s = r || o - 1e-15), + (this.bufferSourceNode.loopStart = o), + (this.bufferSourceNode.loopEnd = s), + (this._counterNode.loopStart = o), + (this._counterNode.loopEnd = s)); + } + } + }, + }, + { + key: "playMode", + value: function (t) { + var e = t.toLowerCase(); + if ("restart" === e && this.buffer && this.bufferSourceNode) + for (var n = 0; n < this.bufferSourceNodes.length - 1; n++) { + var i = p.audiocontext.currentTime; + this.bufferSourceNodes[n].stop(i); + } + if ("restart" !== e && "sustain" !== e && "untildone" !== e) + throw 'Invalid play mode. Must be either "restart" or "sustain"'; + this.mode = e; + }, + }, + { + key: "pause", + value: function (t) { + var e = (t || 0) + p.audiocontext.currentTime; + this.isPlaying() && this.buffer && this.bufferSourceNode + ? ((this._paused = !0), + (this._playing = !1), + (this.pauseTime = this.currentTime()), + this.bufferSourceNode.stop(e), + this._counterNode.stop(e), + (this._pauseTime = this.currentTime())) + : (this._pauseTime = 0); + }, + }, + { + key: "loop", + value: function (t, e, n, i, r) { + (this._looping = !0), this.play(t, e, n, i, r); + }, + }, + { + key: "setLoop", + value: function (t) { + if (!0 === t) this._looping = !0; + else { + if (!1 !== t) + throw "Error: setLoop accepts either true or false"; + this._looping = !1; + } + this.bufferSourceNode && + ((this.bufferSourceNode.loop = this._looping), + (this._counterNode.loop = this._looping)); + }, + }, + { + key: "isLooping", + value: function () { + return ( + !!this.bufferSourceNode && + !0 === this._looping && + !0 === this.isPlaying() + ); + }, + }, + { + key: "isPlaying", + value: function () { + return this._playing; + }, + }, + { + key: "isPaused", + value: function () { + return this._paused; + }, + }, + { + key: "stop", + value: function (t) { + var e = t || 0; + if ("sustain" === this.mode || "untildone" === this.mode) + this.stopAll(e), + (this._playing = !1), + (this.pauseTime = 0), + (this._paused = !1); + else if (this.buffer && this.bufferSourceNode) { + var n = p.audiocontext.currentTime, + i = e || 0; + (this.pauseTime = 0), + this.bufferSourceNode.stop(n + i), + this._counterNode.stop(n + i), + (this._playing = !1), + (this._paused = !1); + } + }, + }, + { + key: "stopAll", + value: function (t) { + var e = p.audiocontext.currentTime, + n = t || 0; + if (this.buffer && this.bufferSourceNode) { + for (var i in this.bufferSourceNodes) { + var r = this.bufferSourceNodes[i]; + if (r) + try { + r.stop(e + n); + } catch (t) {} + } + this._counterNode.stop(e + n); + } + }, + }, + { + key: "getVolume", + value: function () { + return this.output.gain.value; + }, + }, + { + key: "pan", + value: function (t, e) { + (this.panPosition = t), this.panner.pan(t, e); + }, + }, + { + key: "getPan", + value: function () { + return this.panPosition; + }, + }, + { + key: "rate", + value: function (t) { + var e = !1; + if (void 0 === t) return this.playbackRate; + if ( + (0 === (this.playbackRate = t) + ? (t = 1e-13) + : t < 0 && !this.reversed + ? ((t = Math.abs(t)), (e = !0)) + : 0 < t && this.reversed && (e = !0), + this.bufferSourceNode) + ) { + var n = p.audiocontext.currentTime; + this.bufferSourceNode.playbackRate.cancelScheduledValues(n), + this.bufferSourceNode.playbackRate.linearRampToValueAtTime( + Math.abs(t), + n, + ), + this._counterNode.playbackRate.cancelScheduledValues(n), + this._counterNode.playbackRate.linearRampToValueAtTime( + Math.abs(t), + n, + ); + } + return e && this.reverseBuffer(), this.playbackRate; + }, + }, + { + key: "setPitch", + value: function (t) { + var e = r(t) / r(60); + this.rate(e); + }, + }, + { + key: "getPlaybackRate", + value: function () { + return this.playbackRate; + }, + }, + { + key: "setVolume", + value: function (t, e, n) { + if ("number" == typeof t) { + var i = e || 0, + r = n || 0, + o = p.audiocontext.currentTime, + s = this.output.gain.value; + this.output.gain.cancelScheduledValues(o + r), + this.output.gain.linearRampToValueAtTime(s, o + r), + this.output.gain.linearRampToValueAtTime(t, o + r + i); + } else { + if (!t) return this.output.gain; + t.connect(this.output.gain); + } + }, + }, + { + key: "duration", + value: function () { + return this.buffer ? this.buffer.duration : 0; + }, + }, + { + key: "currentTime", + value: function () { + return this.reversed + ? Math.abs(this._lastPos - this.buffer.length) / R.sampleRate + : this._lastPos / R.sampleRate; + }, + }, + { + key: "jump", + value: function (t, e) { + if (t < 0 || t > this.buffer.duration) + throw "jump time out of range"; + if (e > this.buffer.duration - t) throw "end time out of range"; + var n = t || 0, + i = e || void 0; + this.isPlaying() && + (this.stop(0), + this.play(0, this.playbackRate, this.output.gain.value, n, i)); + }, + }, + { + key: "channels", + value: function () { + return this.buffer.numberOfChannels; + }, + }, + { + key: "sampleRate", + value: function () { + return this.buffer.sampleRate; + }, + }, + { + key: "frames", + value: function () { + return this.buffer.length; + }, + }, + { + key: "getPeaks", + value: 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, + n = e.length / t, + i = ~~(n / 10) || 1, + r = e.numberOfChannels, + o = new Float32Array(Math.round(t)), + s = 0; + s < r; + s++ + ) + for (var a = e.getChannelData(s), u = 0; u < t; u++) { + for ( + var c = ~~(u * n), l = ~~(c + n), h = 0, p = c; + p < l; + p += i + ) { + var f = a[p]; + h < f ? (h = f) : h < -f && (h = f); + } + (0 === s || Math.abs(h) > o[u]) && (o[u] = h); + } + return o; + } + }, + }, + { + key: "reverseBuffer", + value: function () { + if (!this.buffer) throw "SoundFile is not done loading"; + var t = this._lastPos / R.sampleRate, + e = this.getVolume(); + this.setVolume(0, 0.001); + for (var n = this.buffer.numberOfChannels, i = 0; i < n; i++) + this.buffer.getChannelData(i).reverse(); + (this.reversed = !this.reversed), + this.isPlaying() && t && this.jump(this.duration() - t), + this.setVolume(e, 0.001); + }, + }, + { + key: "onended", + value: function (t) { + return (this._onended = t), this; + }, + }, + { key: "add", value: function () {} }, + { + key: "dispose", + value: function () { + var t = p.audiocontext.currentTime, + e = p.soundArray.indexOf(this); + if ( + (p.soundArray.splice(e, 1), + this.stop(t), + this.buffer && this.bufferSourceNode) + ) { + for (var n = 0; n < this.bufferSourceNodes.length - 1; n++) + if (null !== this.bufferSourceNodes[n]) { + this.bufferSourceNodes[n].disconnect(); + try { + this.bufferSourceNodes[n].stop(t); + } catch (t) {} + this.bufferSourceNodes[n] = null; + } + if (this.isPlaying()) { + try { + this._counterNode.stop(t); + } catch (t) {} + this._counterNode = null; + } + } + this.output && (this.output.disconnect(), (this.output = null)), + this.panner && (this.panner.disconnect(), (this.panner = null)); + }, + }, + { + key: "connect", + value: function (t) { + t + ? t.hasOwnProperty("input") + ? this.panner.connect(t.input) + : this.panner.connect(t) + : this.panner.connect(p.input); + }, + }, + { + key: "disconnect", + value: function () { + this.panner && this.panner.disconnect(); + }, + }, + { key: "getLevel", value: function () {} }, + { + key: "setPath", + value: function (t, e) { + var n = p5.prototype._checkFileFormats(t); + (this.url = n), this.load(e); + }, + }, + { + key: "setBuffer", + value: function (t) { + var e = t.length, + n = t[0].length, + i = R.createBuffer(e, n, R.sampleRate); + t[0] instanceof Float32Array || (t[0] = new Float32Array(t[0])); + for (var r = 0; r < e; r++) { + i.getChannelData(r).set(t[r]); + } + (this.buffer = i), this.panner.inputChannels(e); + }, + }, + { + key: "_initCounterNode", + value: function () { + var e = this, + n = this, + t = R.currentTime, + i = R.createBufferSource(), + r = y(256); + return ( + n._workletNode && + (n._workletNode.disconnect(), delete n._workletNode), + (n._workletNode = new AudioWorkletNode( + R, + s.a.soundFileProcessor, + { processorOptions: { bufferSize: r } }, + )), + (n._workletNode.port.onmessage = function (t) { + if ("position" === t.data.name) { + if (0 === t.data.position) return; + (e._lastPos = t.data.position), e._onTimeUpdate(n._lastPos); + } + }), + (i.buffer = (function (t) { + for ( + var e = t.length, + n = R.createBuffer(1, t.length, R.sampleRate), + i = n.getChannelData(0), + r = 0; + r < e; + r++ + ) + i[r] = r; + return n; + })(n.buffer)), + i.playbackRate.setValueAtTime(n.playbackRate, t), + i.connect(n._workletNode), + n._workletNode.connect(p5.soundOut._silentNode), + i + ); + }, + }, + { + key: "_initSourceNode", + value: function () { + var t = R.createBufferSource(); + return ( + (t.buffer = this.buffer), + (t.playbackRate.value = this.playbackRate), + t.connect(this.output), + t + ); + }, + }, + { key: "processPeaks", value: function (t, e, n, i) {} }, + { + key: "addCue", + value: function (t, e, n) { + var i = this._cueIDCounter++, + r = new C(e, t, i, n); + return this._cues.push(r), i; + }, + }, + { + key: "removeCue", + value: function (t) { + for (var e = this._cues.length, n = 0; n < e; n++) { + if (this._cues[n].id === t) { + this._cues.splice(n, 1); + break; + } + } + this._cues.length; + }, + }, + { + key: "clearCues", + value: function () { + this._cues = []; + }, + }, + { + key: "_onTimeUpdate", + value: function (t) { + for ( + var e = t / this.buffer.sampleRate, + n = this._cues.length, + i = 0; + i < n; + i++ + ) { + var r = this._cues[i], + o = r.time, + s = r.val; + (this._prevUpdateTime || 0) <= o && o <= e && r.callback(s); + } + this._prevUpdateTime = e; + }, + }, + { + key: "save", + value: function (t) { + p5.prototype.saveSound(this, t, "wav"); + }, + }, + { + key: "getBlob", + value: function () { + var t = a(this.buffer); + return new Blob([t], { type: "audio/wav" }); + }, + }, + ]), + o + ); + })(); + var E = q; + function N(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var B = (function () { + function e(t) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + (this.bufferSize = y(2048)), + (this.audiocontext = p.audiocontext), + (this._workletNode = new AudioWorkletNode( + this.audiocontext, + s.a.amplitudeProcessor, + { + outputChannelCount: [1], + parameterData: { smoothing: t || 0 }, + processorOptions: { + normalize: !1, + smoothing: t || 0, + numInputChannels: 2, + bufferSize: this.bufferSize, + }, + }, + )), + (this._workletNode.port.onmessage = function (t) { + "amplitude" === t.data.name && + ((this.volume = t.data.volume), + (this.volNorm = t.data.volNorm), + (this.stereoVol = t.data.stereoVol), + (this.stereoVolNorm = t.data.stereoVolNorm)); + }.bind(this)), + (this.input = this._workletNode), + (this.output = this.audiocontext.createGain()), + (this.volume = 0), + (this.volNorm = 0), + (this.stereoVol = [0, 0]), + (this.stereoVolNorm = [0, 0]), + (this.normalize = !1), + this._workletNode.connect(this.output), + (this.output.gain.value = 0), + this.output.connect(this.audiocontext.destination), + p.meter.connect(this._workletNode), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && N(t.prototype, e), n && N(t, n); + })(e, [ + { + key: "setInput", + value: function (t, e) { + p.meter.disconnect(), + e && (this._workletNode.parameters.get("smoothing").value = e), + null == t + ? p.meter.connect(this._workletNode) + : t + ? (t.connect(this._workletNode), + this._workletNode.disconnect(), + this._workletNode.connect(this.output)) + : p.meter.connect(this._workletNode); + }, + }, + { + key: "connect", + value: function (t) { + t + ? t.hasOwnProperty("input") + ? this.output.connect(t.input) + : this.output.connect(t) + : this.output.connect(this.panner.connect(p.input)); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(); + }, + }, + { + key: "getLevel", + value: function (t) { + return void 0 !== t + ? this.normalize + ? this.stereoVolNorm[t] + : this.stereoVol[t] + : this.normalize + ? this.volNorm + : this.volume; + }, + }, + { + key: "toggleNormalize", + value: function (t) { + (this.normalize = "boolean" == typeof t ? t : !this.normalize), + this._workletNode.port.postMessage({ + name: "toggleNormalize", + normalize: this.normalize, + }); + }, + }, + { + key: "smooth", + value: function (t) { + 0 <= t && + t < 1 && + this._workletNode.port.postMessage({ + name: "smoothing", + smoothing: t, + }); + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + this.input && (this.input.disconnect(), delete this.input), + this.output && (this.output.disconnect(), delete this.output), + this._workletNode.disconnect(), + delete this._workletNode; + }, + }, + ]), + e + ); + })(); + function V(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var j = (function () { + function n(t, e) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, n), + (this.input = this.analyser = p.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 = e || 1024), + p.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]), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && V(t.prototype, e), n && V(t, n); + })(n, [ + { + key: "setInput", + value: function (t) { + t + ? (t.output + ? t.output.connect(this.analyser) + : t.connect && t.connect(this.analyser), + p.fftMeter.disconnect()) + : p.fftMeter.connect(this.analyser); + }, + }, + { + key: "waveform", + value: function () { + for ( + var t, e, n = new Array(), i = 0; + i < arguments.length; + i++ + ) + "number" == typeof arguments[i] && + ((t = arguments[i]), (this.analyser.fftSize = 2 * t)), + "string" == typeof arguments[i] && (e = arguments[i]); + if (e && !p5.prototype._isSafari()) + return ( + (function (t) { + t.timeDomain instanceof Float32Array == !1 && + (t.timeDomain = new Float32Array( + t.analyser.frequencyBinCount, + )); + })(this, this.timeDomain), + this.analyser.getFloatTimeDomainData(this.timeDomain), + this.timeDomain + ); + !(function (t) { + t.timeDomain instanceof Uint8Array == !1 && + (t.timeDomain = new Uint8Array( + t.analyser.frequencyBinCount, + )); + })(this, this.timeDomain), + this.analyser.getByteTimeDomainData(this.timeDomain); + for (var r = 0; r < this.timeDomain.length; r++) { + var o = p5.prototype.map(this.timeDomain[r], 0, 255, -1, 1); + n.push(o); + } + return n; + }, + }, + { + key: "analyze", + value: function () { + for (var t, e = 0; e < arguments.length; e++) + "number" == typeof arguments[e] && + ((this.bins = arguments[e]), + (this.analyser.fftSize = 2 * this.bins)), + "string" == typeof arguments[e] && (t = arguments[e]); + return t && "db" === t.toLowerCase() + ? ((function (t) { + t.freqDomain instanceof Float32Array == !1 && + (t.freqDomain = new Float32Array( + t.analyser.frequencyBinCount, + )); + })(this), + this.analyser.getFloatFrequencyData(this.freqDomain), + this.freqDomain) + : ((function (t) { + t.freqDomain instanceof Uint8Array == !1 && + (t.freqDomain = new Uint8Array( + t.analyser.frequencyBinCount, + )); + })(this, this.freqDomain), + this.analyser.getByteFrequencyData(this.freqDomain), + Array.apply([], this.freqDomain)); + }, + }, + { + key: "getEnergy", + value: function (t, e) { + var n = p.audiocontext.sampleRate / 2; + if ( + ("bass" === t + ? ((t = this.bass[0]), (e = this.bass[1])) + : "lowMid" === t + ? ((t = this.lowMid[0]), (e = this.lowMid[1])) + : "mid" === t + ? ((t = this.mid[0]), (e = this.mid[1])) + : "highMid" === t + ? ((t = this.highMid[0]), (e = this.highMid[1])) + : "treble" === t && + ((t = this.treble[0]), (e = this.treble[1])), + "number" != typeof t) + ) + throw "invalid input for getEnergy()"; + if (e) { + if (t && e) { + if (e < t) { + var i = e; + (e = t), (t = i); + } + for ( + var r = Math.round((t / n) * this.freqDomain.length), + o = Math.round((e / n) * this.freqDomain.length), + s = 0, + a = 0, + u = r; + u <= o; + u++ + ) + (s += this.freqDomain[u]), (a += 1); + return s / a; + } + throw "invalid input for getEnergy()"; + } + var c = Math.round((t / n) * this.freqDomain.length); + return this.freqDomain[c]; + }, + }, + { + key: "getFreq", + value: function (t, e) { + return this.getEnergy(t, e); + }, + }, + { + key: "getCentroid", + value: function () { + for ( + var t = p.audiocontext.sampleRate / 2, e = 0, n = 0, i = 0; + i < this.freqDomain.length; + i++ + ) + (e += i * this.freqDomain[i]), (n += this.freqDomain[i]); + var r = 0; + return 0 !== n && (r = e / n), r * (t / this.freqDomain.length); + }, + }, + { + key: "smooth", + value: function (t) { + return void 0 !== t && (this.smoothing = t), this.smoothing; + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + this.analyser && + (this.analyser.disconnect(), delete this.analyser); + }, + }, + { + key: "linAverages", + value: function (t) { + for ( + var e = t || 16, + n = this.freqDomain, + i = n.length, + r = Math.floor(i / e), + o = new Array(e), + s = 0, + a = 0; + a < i; + a++ + ) + (o[s] = void 0 !== o[s] ? (o[s] + n[a]) / 2 : n[a]), + a % r == r - 1 && s++; + return o; + }, + }, + { + key: "logAverages", + value: function (t) { + for ( + var e = p.audiocontext.sampleRate / 2, + n = this.freqDomain, + i = n.length, + r = new Array(t.length), + o = 0, + s = 0; + s < i; + s++ + ) { + Math.round((s * e) / this.freqDomain.length) > t[o].hi && o++, + (r[o] = void 0 !== r[o] ? (r[o] + n[s]) / 2 : n[s]); + } + return r; + }, + }, + { + key: "getOctaveBands", + value: function (t, e) { + var n = t || 3, + i = e || 15.625, + r = [], + o = { + lo: i / Math.pow(2, 1 / (2 * n)), + ctr: i, + hi: i * Math.pow(2, 1 / (2 * n)), + }; + r.push(o); + for (var s = p.audiocontext.sampleRate / 2; o.hi < s; ) { + var a = {}; + (a.lo = o.hi), + (a.ctr = o.ctr * Math.pow(2, 1 / n)), + (a.hi = a.ctr * Math.pow(2, 1 / (2 * n))), + r.push(a), + (o = a); + } + return r; + }, + }, + ]), + n + ); + })(), + M = n(4), + F = n.n(M), + D = n(1), + I = n.n(D), + U = n(8), + G = n.n(U); + function L(t) { + return (L = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function z(t, e) { + return !e || ("object" !== L(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function W(t) { + return (W = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function Z(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && X(t, e); + } + function X(t, e) { + return (X = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + function Y(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function H(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function $(t, e, n, i, r) { + var o = t.oscillator; + for (var s in t.mathOps) + t.mathOps[s] instanceof r && + (o.disconnect(), + t.mathOps[s].dispose(), + (n = s) < t.mathOps.length - 2 && (i = t.mathOps[s + 1])); + return ( + n === t.mathOps.length - 1 && t.mathOps.push(i), + 0 < s && (o = t.mathOps[s - 1]), + o.disconnect(), + o.connect(e), + e.connect(i), + (t.mathOps[n] = e), + t + ); + } + var Q = (function () { + function r(t, e) { + if ((Y(this, r), "string" == typeof t)) { + var n = e; + (e = t), (t = n); + } + if ("number" == typeof e) { + var i = e; + (e = t), (t = i); + } + (this.started = !1), + (this.phaseAmount = void 0), + (this.oscillator = p.audiocontext.createOscillator()), + (this.f = t || 440), + (this.oscillator.type = e || "sine"), + this.oscillator.frequency.setValueAtTime( + this.f, + p.audiocontext.currentTime, + ), + (this.output = p.audiocontext.createGain()), + (this._freqMods = []), + (this.output.gain.value = 0.5), + this.output.gain.setValueAtTime(0.5, p.audiocontext.currentTime), + this.oscillator.connect(this.output), + (this.panPosition = 0), + (this.connection = p.input), + (this.panner = new k(this.output, this.connection, 1)), + (this.mathOps = [this.output]), + p.soundArray.push(this), + (this.fade = this.amp); + } + return ( + (function (t, e, n) { + e && H(t.prototype, e), n && H(t, n); + })(r, [ + { + key: "start", + value: function (t, e) { + if (this.started) { + var n = p.audiocontext.currentTime; + this.stop(n); + } + if (!this.started) { + var i = e || this.f, + r = this.oscillator.type; + for (var o in (this.oscillator && + (this.oscillator.disconnect(), delete this.oscillator), + (this.oscillator = p.audiocontext.createOscillator()), + (this.oscillator.frequency.value = Math.abs(i)), + (this.oscillator.type = r), + this.oscillator.connect(this.output), + (t = t || 0), + this.oscillator.start(t + p.audiocontext.currentTime), + (this.freqNode = this.oscillator.frequency), + this._freqMods)) + void 0 !== this._freqMods[o].connect && + this._freqMods[o].connect(this.oscillator.frequency); + this.started = !0; + } + }, + }, + { + key: "stop", + value: function (t) { + if (this.started) { + var e = t || 0, + n = p.audiocontext.currentTime; + this.oscillator.stop(e + n), (this.started = !1); + } + }, + }, + { + key: "amp", + value: function (t, e, n) { + var i = 1 < arguments.length && void 0 !== e ? e : 0, + r = 2 < arguments.length && void 0 !== n ? n : 0; + if ("number" == typeof t) { + var o = p.audiocontext.currentTime; + this.output.gain.linearRampToValueAtTime(t, o + r + i); + } else { + if (!t) return this.output.gain; + t.connect(this.output.gain); + } + }, + }, + { + key: "getAmp", + value: function () { + return this.output.gain.value; + }, + }, + { + key: "freq", + value: function (t, e, n) { + var i = 1 < arguments.length && void 0 !== e ? e : 0, + r = 2 < arguments.length && void 0 !== n ? n : 0; + 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 = p.audiocontext.currentTime; + 0 === i + ? this.oscillator.frequency.setValueAtTime(t, r + o) + : 0 < t + ? this.oscillator.frequency.exponentialRampToValueAtTime( + t, + r + i + o, + ) + : this.oscillator.frequency.linearRampToValueAtTime( + t, + r + i + o, + ), + this.phaseAmount && this.phase(this.phaseAmount); + } + }, + }, + { + key: "getFreq", + value: function () { + return this.oscillator.frequency.value; + }, + }, + { + key: "setType", + value: function (t) { + this.oscillator.type = t; + }, + }, + { + key: "getType", + value: function () { + return this.oscillator.type; + }, + }, + { + key: "connect", + value: 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(p.input); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(), + this.panner && + (this.panner.disconnect(), + this.output && this.output.connect(this.panner)), + (this.oscMods = []); + }, + }, + { + key: "pan", + value: function (t, e) { + (this.panPosition = t), this.panner.pan(t, e); + }, + }, + { + key: "getPan", + value: function () { + return this.panPosition; + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + if ((p.soundArray.splice(t, 1), this.oscillator)) { + var e = p.audiocontext.currentTime; + this.stop(e), + this.disconnect(), + (this.panner = null), + (this.oscillator = null); + } + this.osc2 && this.osc2.dispose(); + }, + }, + { + key: "phase", + value: function (t) { + var e = p5.prototype.map(t, 0, 1, 0, 1 / this.f), + n = p.audiocontext.currentTime; + (this.phaseAmount = t), + this.dNode || + ((this.dNode = p.audiocontext.createDelay()), + this.oscillator.disconnect(), + this.oscillator.connect(this.dNode), + this.dNode.connect(this.output)), + this.dNode.delayTime.setValueAtTime(e, n); + }, + }, + { + key: "add", + value: function (t) { + var e = new F.a(t); + return $(this, e, this.mathOps.length - 1, this.output, F.a); + }, + }, + { + key: "mult", + value: function (t) { + var e = new I.a(t); + return $(this, e, this.mathOps.length - 1, this.output, I.a); + }, + }, + { + key: "scale", + value: function (t, e, n, i) { + var r, o; + o = + 4 === arguments.length + ? ((r = p5.prototype.map(n, t, e, 0, 1) - 0.5), + p5.prototype.map(i, t, e, 0, 1) - 0.5) + : ((r = t), e); + var s = new G.a(r, o); + return $(this, s, this.mathOps.length - 1, this.output, G.a); + }, + }, + ]), + r + ); + })(), + J = (function () { + function e(t) { + return Y(this, e), z(this, W(e).call(this, t, "sine")); + } + return Z(e, Q), e; + })(), + K = (function () { + function e(t) { + return Y(this, e), z(this, W(e).call(this, t, "triangle")); + } + return Z(e, Q), e; + })(), + tt = (function () { + function e(t) { + return Y(this, e), z(this, W(e).call(this, t, "sawtooth")); + } + return Z(e, Q), e; + })(), + et = (function () { + function e(t) { + return Y(this, e), z(this, W(e).call(this, t, "square")); + } + return Z(e, Q), e; + })(), + nt = Q, + it = n(7), + rt = n.n(it); + (p5.Envelope = function (t, e, n, i, r, o) { + (this.aTime = t || 0.1), + (this.aLevel = e || 1), + (this.dTime = n || 0.5), + (this.dLevel = i || 0), + (this.rTime = r || 0), + (this.rLevel = o || 0), + (this._rampHighPercentage = 0.98), + (this._rampLowPercentage = 0.02), + (this.output = p.audiocontext.createGain()), + (this.control = new rt.a()), + this._init(), + this.control.connect(this.output), + (this.connection = null), + (this.mathOps = [this.control]), + (this.isExponential = !1), + (this.sourceToClear = null), + (this.wasTriggered = !1), + p.soundArray.push(this); + }), + (p5.Envelope.prototype._init = function () { + var t = p.audiocontext.currentTime; + this.control.setTargetAtTime(1e-5, t, 0.001), + this._setRampAD(this.aTime, this.dTime); + }), + (p5.Envelope.prototype.set = function (t, e, n, i, r, o) { + (this.aTime = t), + (this.aLevel = e), + (this.dTime = n || 0), + (this.dLevel = i || 0), + (this.rTime = r || 0), + (this.rLevel = o || 0), + this._setRampAD(t, n); + }), + (p5.Envelope.prototype.setADSR = function (t, e, n, i) { + (this.aTime = t), + (this.dTime = e || 0), + (this.sPercent = n || 0), + (this.dLevel = + void 0 !== n ? n * (this.aLevel - this.rLevel) + this.rLevel : 0), + (this.rTime = i || 0), + this._setRampAD(t, e); + }), + (p5.Envelope.prototype.setRange = function (t, e) { + (this.aLevel = t || 1), (this.rLevel = e || 0); + }), + (p5.Envelope.prototype._setRampAD = function (t, e) { + (this._rampAttackTime = this.checkExpInput(t)), + (this._rampDecayTime = this.checkExpInput(e)); + var n = 1; + (n = Math.log(1 / this.checkExpInput(1 - this._rampHighPercentage))), + (this._rampAttackTC = t / this.checkExpInput(n)), + (n = Math.log(1 / this._rampLowPercentage)), + (this._rampDecayTC = e / this.checkExpInput(n)); + }), + (p5.Envelope.prototype.setRampPercentages = function (t, e) { + (this._rampHighPercentage = this.checkExpInput(t)), + (this._rampLowPercentage = this.checkExpInput(e)); + var n = 1; + (n = Math.log(1 / this.checkExpInput(1 - this._rampHighPercentage))), + (this._rampAttackTC = this._rampAttackTime / this.checkExpInput(n)), + (n = Math.log(1 / this._rampLowPercentage)), + (this._rampDecayTC = this._rampDecayTime / this.checkExpInput(n)); + }), + (p5.Envelope.prototype.setInput = function () { + for (var t = 0; t < arguments.length; t++) this.connect(arguments[t]); + }), + (p5.Envelope.prototype.setExp = function (t) { + this.isExponential = t; + }), + (p5.Envelope.prototype.checkExpInput = function (t) { + return t <= 0 && (t = 1e-8), t; + }), + (p5.Envelope.prototype.play = function (t, e, n) { + var i = e || 0; + t && this.connection !== t && this.connect(t), + this.triggerAttack(t, i), + this.triggerRelease(t, i + this.aTime + this.dTime + ~~n); + }), + (p5.Envelope.prototype.triggerAttack = function (t, e) { + var n = p.audiocontext.currentTime + (e || 0); + (this.lastAttack = n), + (this.wasTriggered = !0), + t && this.connection !== t && this.connect(t); + var i = this.control.getValueAtTime(n); + !0 === this.isExponential + ? this.control.exponentialRampToValueAtTime(this.checkExpInput(i), n) + : this.control.linearRampToValueAtTime(i, n), + (n += this.aTime), + !0 === this.isExponential + ? (this.control.exponentialRampToValueAtTime( + this.checkExpInput(this.aLevel), + n, + ), + (i = this.checkExpInput(this.control.getValueAtTime(n))), + this.control.cancelScheduledValues(n), + this.control.exponentialRampToValueAtTime(i, n)) + : (this.control.linearRampToValueAtTime(this.aLevel, n), + (i = this.control.getValueAtTime(n)), + this.control.cancelScheduledValues(n), + this.control.linearRampToValueAtTime(i, n)), + (n += this.dTime), + !0 === this.isExponential + ? (this.control.exponentialRampToValueAtTime( + this.checkExpInput(this.dLevel), + n, + ), + (i = this.checkExpInput(this.control.getValueAtTime(n))), + this.control.cancelScheduledValues(n), + this.control.exponentialRampToValueAtTime(i, n)) + : (this.control.linearRampToValueAtTime(this.dLevel, n), + (i = this.control.getValueAtTime(n)), + this.control.cancelScheduledValues(n), + this.control.linearRampToValueAtTime(i, n)); + }), + (p5.Envelope.prototype.triggerRelease = function (t, e) { + if (this.wasTriggered) { + var n = p.audiocontext.currentTime + (e || 0); + t && this.connection !== t && this.connect(t); + var i = this.control.getValueAtTime(n); + !0 === this.isExponential + ? this.control.exponentialRampToValueAtTime( + this.checkExpInput(i), + n, + ) + : this.control.linearRampToValueAtTime(i, n), + (n += this.rTime), + !0 === this.isExponential + ? (this.control.exponentialRampToValueAtTime( + this.checkExpInput(this.rLevel), + n, + ), + (i = this.checkExpInput(this.control.getValueAtTime(n))), + this.control.cancelScheduledValues(n), + this.control.exponentialRampToValueAtTime(i, n)) + : (this.control.linearRampToValueAtTime(this.rLevel, n), + (i = this.control.getValueAtTime(n)), + this.control.cancelScheduledValues(n), + this.control.linearRampToValueAtTime(i, n)), + (this.wasTriggered = !1); + } + }), + (p5.Envelope.prototype.ramp = function (t, e, n, i) { + var r = p.audiocontext.currentTime + (e || 0), + o = this.checkExpInput(n), + s = void 0 !== i ? this.checkExpInput(i) : void 0; + t && this.connection !== t && this.connect(t); + var a = this.checkExpInput(this.control.getValueAtTime(r)); + a < o + ? (this.control.setTargetAtTime(o, r, this._rampAttackTC), + (r += this._rampAttackTime)) + : o < a && + (this.control.setTargetAtTime(o, r, this._rampDecayTC), + (r += this._rampDecayTime)), + void 0 !== s && + (o < s + ? this.control.setTargetAtTime(s, r, this._rampAttackTC) + : s < o && this.control.setTargetAtTime(s, r, this._rampDecayTC)); + }), + (p5.Envelope.prototype.connect = function (t) { + ((this.connection = t) instanceof p5.Oscillator || + t instanceof p5.SoundFile || + t instanceof p5.AudioIn || + t instanceof p5.Reverb || + t instanceof p5.Noise || + t instanceof p5.Filter || + t instanceof p5.Delay) && + (t = t.output.gain), + t instanceof AudioParam && + t.setValueAtTime(0, p.audiocontext.currentTime), + this.output.connect(t); + }), + (p5.Envelope.prototype.disconnect = function () { + this.output && this.output.disconnect(); + }), + (p5.Envelope.prototype.add = function (t) { + var e = new F.a(t), + n = this.mathOps.length, + i = this.output; + return p5.prototype._mathChain(this, e, n, i, F.a); + }), + (p5.Envelope.prototype.mult = function (t) { + var e = new I.a(t), + n = this.mathOps.length, + i = this.output; + return p5.prototype._mathChain(this, e, n, i, I.a); + }), + (p5.Envelope.prototype.scale = function (t, e, n, i) { + var r = new G.a(t, e, n, i), + o = this.mathOps.length, + s = this.output; + return p5.prototype._mathChain(this, r, o, s, G.a); + }), + (p5.Envelope.prototype.dispose = function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + this.disconnect(), + this.control && (this.control.dispose(), (this.control = null)); + for (var e = 1; e < this.mathOps.length; e++) this.mathOps[e].dispose(); + }), + (p5.Env = function (t, e, n, i, r, o) { + p5.Envelope.call(this, t, e, n, i, r, o); + }), + (p5.Env.prototype = Object.create(p5.Envelope.prototype)); + var ot = p5.Envelope; + function st(t) { + return (st = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function at(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function ut(t, e) { + return !e || ("object" !== st(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function ct(t) { + return (ct = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function lt(t, e) { + return (lt = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var ht = (function () { + for ( + var t = 2 * p.audiocontext.sampleRate, + e = p.audiocontext.createBuffer(1, t, p.audiocontext.sampleRate), + n = e.getChannelData(0), + i = 0; + i < t; + i++ + ) + n[i] = 2 * Math.random() - 1; + return (e.type = "white"), e; + })(), + pt = (function () { + var t, + e, + n, + i, + r, + o, + s, + a = 2 * p.audiocontext.sampleRate, + u = p.audiocontext.createBuffer(1, a, p.audiocontext.sampleRate), + c = u.getChannelData(0); + t = e = n = i = r = o = s = 0; + for (var l = 0; l < a; l++) { + var h = 2 * Math.random() - 1; + (t = 0.99886 * t + 0.0555179 * h), + (e = 0.99332 * e + 0.0750759 * h), + (n = 0.969 * n + 0.153852 * h), + (i = 0.8665 * i + 0.3104856 * h), + (r = 0.55 * r + 0.5329522 * h), + (o = -0.7616 * o - 0.016898 * h), + (c[l] = t + e + n + i + r + o + s + 0.5362 * h), + (c[l] *= 0.11), + (s = 0.115926 * h); + } + return (u.type = "pink"), u; + })(), + ft = (function () { + for ( + var t = 2 * p.audiocontext.sampleRate, + e = p.audiocontext.createBuffer(1, t, p.audiocontext.sampleRate), + n = e.getChannelData(0), + i = 0, + r = 0; + r < t; + r++ + ) { + var o = 2 * Math.random() - 1; + (n[r] = (i + 0.02 * o) / 1.02), (i = n[r]), (n[r] *= 3.5); + } + return (e.type = "brown"), e; + })(), + dt = (function () { + function i(t) { + var e, n; + return ( + (function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, i), + delete (e = ut(this, ct(i).call(this))).f, + delete e.freq, + delete e.oscillator, + (n = "brown" === t ? ft : "pink" === t ? pt : ht), + (e.buffer = n), + e + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && lt(t, e); + })(i, nt), + (function (t, e, n) { + e && at(t.prototype, e), n && at(t, n); + })(i, [ + { + key: "setType", + value: function (t) { + switch (t) { + case "white": + this.buffer = ht; + break; + case "pink": + this.buffer = pt; + break; + case "brown": + this.buffer = ft; + break; + default: + this.buffer = ht; + } + if (this.started) { + var e = p.audiocontext.currentTime; + this.stop(e), this.start(e + 0.01); + } + }, + }, + { + key: "getType", + value: function () { + return this.buffer.type; + }, + }, + { + key: "start", + value: function () { + this.started && this.stop(), + (this.noise = p.audiocontext.createBufferSource()), + (this.noise.buffer = this.buffer), + (this.noise.loop = !0), + this.noise.connect(this.output); + var t = p.audiocontext.currentTime; + this.noise.start(t), (this.started = !0); + }, + }, + { + key: "stop", + value: function () { + var t = p.audiocontext.currentTime; + this.noise && (this.noise.stop(t), (this.started = !1)); + }, + }, + { + key: "dispose", + value: function () { + var t = p.audiocontext.currentTime, + e = p.soundArray.indexOf(this); + p.soundArray.splice(e, 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); + }, + }, + ]), + i + ); + })(), + yt = n(2), + mt = n.n(yt); + function vt(t) { + return (vt = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function _t(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function gt(t, e) { + return !e || ("object" !== vt(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function bt(t) { + return (bt = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function Tt(t, e) { + return (Tt = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + function wt() { + for ( + var t = p.audiocontext, + e = t.createBuffer(1, 2048, t.sampleRate), + n = e.getChannelData(0), + i = 0; + i < 2048; + i++ + ) + n[i] = 1; + var r = t.createBufferSource(); + return (r.buffer = e), (r.loop = !0), r; + } + var xt = (function () { + function r(t, e) { + var n; + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, r), + ((n = gt(this, bt(r).call(this, t, "sawtooth"))).w = e || 0), + (n.osc2 = new tt(t)), + (n.dNode = p.audiocontext.createDelay()), + (n.dcOffset = wt()), + (n.dcGain = p.audiocontext.createGain()), + n.dcOffset.connect(n.dcGain), + n.dcGain.connect(n.output), + (n.f = t || 440); + var i = n.w / n.oscillator.frequency.value; + return ( + (n.dNode.delayTime.value = i), + (n.dcGain.gain.value = 1.7 * (0.5 - n.w)), + n.osc2.disconnect(), + n.osc2.panner.disconnect(), + n.osc2.amp(-1), + n.osc2.output.connect(n.dNode), + n.dNode.connect(n.output), + (n.output.gain.value = 1), + n.output.connect(n.panner), + n + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && Tt(t, e); + })(r, nt), + (function (t, e, n) { + e && _t(t.prototype, e), n && _t(t, n); + })(r, [ + { + key: "width", + value: function (t) { + if ("number" == typeof t) { + if (t <= 1 && 0 <= t) { + this.w = t; + var e = this.w / this.oscillator.frequency.value; + this.dNode.delayTime.value = e; + } + this.dcGain.gain.value = 1.7 * (0.5 - this.w); + } else { + t.connect(this.dNode.delayTime); + var n = new mt.a(-0.5); + t.connect(n); + var i = new I.a(-1), + r = new I.a(1.7); + (n = n.connect(i).connect(r)).connect(this.dcGain.gain); + } + }, + }, + { + key: "start", + value: function (t, e) { + var n = p.audiocontext.currentTime, + i = e || 0; + if (!this.started) { + var r = t || this.f, + o = this.oscillator.type; + (this.oscillator = p.audiocontext.createOscillator()), + this.oscillator.frequency.setValueAtTime(r, n), + (this.oscillator.type = o), + this.oscillator.connect(this.output), + this.oscillator.start(i + n), + (this.osc2.oscillator = p.audiocontext.createOscillator()), + this.osc2.oscillator.frequency.setValueAtTime(r, i + n), + (this.osc2.oscillator.type = o), + this.osc2.oscillator.connect(this.osc2.output), + this.osc2.start(i + n), + (this.freqNode = [ + this.oscillator.frequency, + this.osc2.oscillator.frequency, + ]), + (this.dcOffset = wt()), + this.dcOffset.connect(this.dcGain), + this.dcOffset.start(i + n), + 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); + } + }, + }, + { + key: "stop", + value: function (t) { + if (this.started) { + var e = t || 0, + n = p.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); + } + }, + }, + { + key: "freq", + value: function (t, e, n) { + var i = 1 < arguments.length && void 0 !== e ? e : 0, + r = 2 < arguments.length && void 0 !== n ? n : 0; + if ("number" == typeof t) { + this.f = t; + var o = p.audiocontext.currentTime, + s = this.oscillator.frequency.value; + this.oscillator.frequency.cancelScheduledValues(o), + this.oscillator.frequency.setValueAtTime(s, o + r), + this.oscillator.frequency.exponentialRampToValueAtTime( + t, + r + i + o, + ), + this.osc2.oscillator.frequency.cancelScheduledValues(o), + this.osc2.oscillator.frequency.setValueAtTime(s, o + r), + this.osc2.oscillator.frequency.exponentialRampToValueAtTime( + t, + r + i + 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)); + }, + }, + ]), + r + ); + })(); + function St(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + p.inputSources = []; + var kt = (function () { + function e(t) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + (this.input = p.audiocontext.createGain()), + (this.output = p.audiocontext.createGain()), + (this.stream = null), + (this.mediaStream = null), + (this.currentSource = null), + (this.enabled = !1), + (this.amplitude = new B()), + this.output.connect(this.amplitude.input), + (window.MediaStreamTrack && + window.navigator.mediaDevices && + window.navigator.mediaDevices.getUserMedia) || + (t + ? t() + : window.alert( + "This browser does not support MediaStreamTrack and mediaDevices", + )), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && St(t.prototype, e), n && St(t, n); + })(e, [ + { + key: "start", + value: function (e, n) { + var i = this; + this.stream && this.stop(); + var t = p.inputSources[i.currentSource], + r = { + audio: { + sampleRate: p.audiocontext.sampleRate, + echoCancellation: !1, + }, + }; + p.inputSources[this.currentSource] && + (r.audio.deviceId = t.deviceId), + window.navigator.mediaDevices + .getUserMedia(r) + .then(function (t) { + (i.stream = t), + (i.enabled = !0), + (i.mediaStream = + p.audiocontext.createMediaStreamSource(t)), + i.mediaStream.connect(i.output), + i.amplitude.setInput(i.output), + e && e(); + }) + .catch(function (t) { + n && n(t); + }); + }, + }, + { + key: "stop", + value: function () { + this.stream && + (this.stream.getTracks().forEach(function (t) { + t.stop(); + }), + this.mediaStream.disconnect(), + delete this.mediaStream, + delete this.stream); + }, + }, + { + key: "connect", + value: 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(p.input); + }, + }, + { + key: "disconnect", + value: function () { + this.output && + (this.output.disconnect(), + this.output.connect(this.amplitude.input)); + }, + }, + { + key: "getLevel", + value: function (t) { + return ( + t && (this.amplitude.smoothing = t), this.amplitude.getLevel() + ); + }, + }, + { + key: "amp", + value: function (t, e) { + if (e) { + var n = e || 0, + i = this.output.gain.value; + this.output.gain.cancelScheduledValues( + p.audiocontext.currentTime, + ), + this.output.gain.setValueAtTime( + i, + p.audiocontext.currentTime, + ), + this.output.gain.linearRampToValueAtTime( + t, + n + p.audiocontext.currentTime, + ); + } else + this.output.gain.cancelScheduledValues( + p.audiocontext.currentTime, + ), + this.output.gain.setValueAtTime( + t, + p.audiocontext.currentTime, + ); + }, + }, + { + key: "getSources", + value: function (i, r) { + return new Promise(function (e, n) { + window.navigator.mediaDevices + .enumerateDevices() + .then(function (t) { + (p.inputSources = t.filter(function (t) { + return "audioinput" === t.kind; + })), + e(p.inputSources), + i && i(p.inputSources); + }) + .catch(function (t) { + n(t), r && r(t); + }); + }); + }, + }, + { + key: "setSource", + value: function (t) { + 0 < p.inputSources.length && + t < p.inputSources.length && + (this.currentSource = t), + this.stream && this.stream.active && this.start(); + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + this.stop(), + this.output && this.output.disconnect(), + this.amplitude && this.amplitude.disconnect(), + delete this.amplitude, + delete this.output; + }, + }, + ]), + e + ); + })(), + Pt = n(23), + At = n.n(Pt); + function Ot(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var Ct = (function () { + function t() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, t), + (this.ac = p.audiocontext), + (this.input = this.ac.createGain()), + (this.output = this.ac.createGain()), + (this._drywet = new At.a(1)), + (this.wet = this.ac.createGain()), + this.input.connect(this._drywet.a), + this.wet.connect(this._drywet.b), + this._drywet.connect(this.output), + this.connect(), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && Ot(t.prototype, e), n && Ot(t, n); + })(t, [ + { + key: "amp", + value: function (t, e, n) { + var i = 1 < arguments.length && void 0 !== e ? e : 0, + r = 2 < arguments.length && void 0 !== n ? n : 0, + o = p.audiocontext.currentTime, + s = o + r, + a = s + i + 0.001, + u = this.output.gain.value; + this.output.gain.cancelScheduledValues(o), + this.output.gain.linearRampToValueAtTime(u, s + 0.001), + this.output.gain.linearRampToValueAtTime(t, a); + }, + }, + { + key: "chain", + value: function (t) { + if (0 < arguments.length) { + this.connect(t); + for (var e = 1; e < arguments.length; e += 1) + arguments[e - 1].connect(arguments[e]); + } + return this; + }, + }, + { + key: "drywet", + value: function (t) { + return ( + void 0 !== t && (this._drywet.fade.value = t), + this._drywet.fade.value + ); + }, + }, + { + key: "connect", + value: function (t) { + var e = t || p5.soundOut.input; + this.output.connect(e.input ? e.input : e); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(); + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + this.input && (this.input.disconnect(), delete this.input), + this.output && (this.output.disconnect(), delete this.output), + this._drywet && + (this._drywet.disconnect(), delete this._drywet), + this.wet && (this.wet.disconnect(), delete this.wet), + (this.ac = void 0); + }, + }, + ]), + t + ); + })(); + function Rt(t) { + return (Rt = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function qt(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function Et(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function Nt(t, e) { + return !e || ("object" !== Rt(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function Bt(t, e, n) { + return (Bt = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = Vt(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function Vt(t) { + return (Vt = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function jt(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && Mt(t, e); + } + function Mt(t, e) { + return (Mt = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var Ft = (function () { + function n(t) { + var e; + return ( + qt(this, n), + ((e = Nt(this, Vt(n).call(this))).biquad = + e.ac.createBiquadFilter()), + e.input.connect(e.biquad), + e.biquad.connect(e.wet), + t && e.setType(t), + (e._on = !0), + (e._untoggledType = e.biquad.type), + e + ); + } + return ( + jt(n, Ct), + (function (t, e, n) { + e && Et(t.prototype, e), n && Et(t, n); + })(n, [ + { + key: "process", + value: function (t, e, n, i) { + t.connect(this.input), this.set(e, n, i); + }, + }, + { + key: "set", + value: function (t, e, n) { + t && this.freq(t, n), e && this.res(e, n); + }, + }, + { + key: "freq", + value: function (t, e) { + var n = e || 0; + return ( + t <= 0 && (t = 1), + "number" == typeof t + ? (this.biquad.frequency.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.biquad.frequency.exponentialRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.biquad.frequency), + this.biquad.frequency.value + ); + }, + }, + { + key: "res", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.biquad.Q.value = t), + this.biquad.Q.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.biquad.Q.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.biquad.Q), + this.biquad.Q.value + ); + }, + }, + { + key: "gain", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.biquad.gain.value = t), + this.biquad.gain.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.biquad.gain.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.biquad.gain), + this.biquad.gain.value + ); + }, + }, + { + key: "toggle", + value: function () { + return ( + (this._on = !this._on), + !0 === this._on + ? (this.biquad.type = this._untoggledType) + : !1 === this._on && (this.biquad.type = "allpass"), + this._on + ); + }, + }, + { + key: "setType", + value: function (t) { + (this.biquad.type = t), + (this._untoggledType = this.biquad.type); + }, + }, + { + key: "dispose", + value: function () { + Bt(Vt(n.prototype), "dispose", this).call(this), + this.biquad && (this.biquad.disconnect(), delete this.biquad); + }, + }, + ]), + n + ); + })(), + Dt = (function () { + function t() { + return qt(this, t), Nt(this, Vt(t).call(this, "lowpass")); + } + return jt(t, Ft), t; + })(), + It = (function () { + function t() { + return qt(this, t), Nt(this, Vt(t).call(this, "highpass")); + } + return jt(t, Ft), t; + })(), + Ut = (function () { + function t() { + return qt(this, t), Nt(this, Vt(t).call(this, "bandpass")); + } + return jt(t, Ft), t; + })(), + Gt = Ft; + function Lt(t) { + return (Lt = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function zt(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function Wt(t, e) { + return !e || ("object" !== Lt(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function Zt(t) { + return (Zt = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function Xt(t, e) { + return (Xt = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var Yt = (function () { + function i(t, e) { + var n; + return ( + (function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, i), + (n = Wt(this, Zt(i).call(this, "peaking"))).disconnect(), + n.set(t, e), + (n.biquad.gain.value = 0), + delete n.input, + delete n.output, + delete n._drywet, + delete n.wet, + n + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && Xt(t, e); + })(i, Gt), + (function (t, e, n) { + e && zt(t.prototype, e), n && zt(t, n); + })(i, [ + { key: "amp", value: function () {} }, + { key: "drywet", value: function () {} }, + { + key: "connect", + value: function (t) { + var e = t || p5.soundOut.input; + this.biquad + ? this.biquad.connect(e.input ? e.input : e) + : this.output.connect(e.input ? e.input : e); + }, + }, + { + key: "disconnect", + value: function () { + this.biquad && this.biquad.disconnect(); + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), this.disconnect(), delete this.biquad; + }, + }, + ]), + i + ); + })(); + function Ht(t) { + return (Ht = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function $t(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function Qt(t, e) { + return !e || ("object" !== Ht(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function Jt(t, e, n) { + return (Jt = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = Kt(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function Kt(t) { + return (Kt = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function te(t, e) { + return (te = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var ee = (function () { + function s(t) { + var e, n, i, r; + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, s), + (e = Qt(this, Kt(s).call(this))), + (n = 3 === (t = 3 === t || 8 === t ? t : 3) ? Math.pow(2, 3) : 2), + (e.bands = []); + for (var o = 0; o < t; o++) + (r = + o === t - 1 + ? ((i = 21e3), 0.01) + : 0 === o + ? ((i = 100), 0.1) + : ((i = + 1 === o + ? 3 === t + ? 360 * n + : 360 + : e.bands[o - 1].freq() * n), + 1)), + (e.bands[o] = e._newBand(i, r)), + 0 < o + ? e.bands[o - 1].connect(e.bands[o].biquad) + : e.input.connect(e.bands[o].biquad); + return e.bands[t - 1].connect(e.output), e; + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && te(t, e); + })(s, Ct), + (function (t, e, n) { + e && $t(t.prototype, e), n && $t(t, n); + })(s, [ + { + key: "process", + value: function (t) { + t.connect(this.input); + }, + }, + { + key: "set", + value: function () { + if (arguments.length === 2 * this.bands.length) + for (var t = 0; t < arguments.length; t += 2) + this.bands[t / 2].freq(arguments[t]), + this.bands[t / 2].gain(arguments[t + 1]); + }, + }, + { + key: "_newBand", + value: function (t, e) { + return new Yt(t, e); + }, + }, + { + key: "dispose", + value: function () { + if ( + (Jt(Kt(s.prototype), "dispose", this).call(this), this.bands) + ) { + for (; 0 < this.bands.length; ) this.bands.pop().dispose(); + delete this.bands; + } + }, + }, + ]), + s + ); + })(); + function ne(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var ie = (function () { + function e(t) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + (this.ac = p.audiocontext), + (this.listener = this.ac.listener); + } + return ( + (function (t, e, n) { + e && ne(t.prototype, e), n && ne(t, n); + })(e, [ + { + key: "process", + value: function (t) { + t.connect(this.input); + }, + }, + { + key: "position", + value: function (t, e, n, i) { + return ( + this.positionX(t, i), + this.positionY(e, i), + this.positionZ(n, i), + [ + this.listener.positionX.value, + this.listener.positionY.value, + this.listener.positionZ.value, + ] + ); + }, + }, + { + key: "positionX", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.positionX.value = t), + this.listener.positionX.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.positionX.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.positionX), + this.listener.positionX.value + ); + }, + }, + { + key: "positionY", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.positionY.value = t), + this.listener.positionY.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.positionY.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.positionY), + this.listener.positionY.value + ); + }, + }, + { + key: "positionZ", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.positionZ.value = t), + this.listener.positionZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.positionZ.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.positionZ), + this.listener.positionZ.value + ); + }, + }, + { + key: "orient", + value: function (t, e, n, i, r, o, s) { + return ( + 3 === arguments.length || 4 === arguments.length + ? ((s = i), this.orientForward(t, e, n, s)) + : (6 !== arguments.length && 7 !== arguments) || + (this.orientForward(t, e, n), this.orientUp(i, r, o, 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, + ] + ); + }, + }, + { + key: "orientForward", + value: function (t, e, n, i) { + return ( + this.forwardX(t, i), + this.forwardY(e, i), + this.forwardZ(n, i), + [ + this.listener.forwardX, + this.listener.forwardY, + this.listener.forwardZ, + ] + ); + }, + }, + { + key: "orientUp", + value: function (t, e, n, i) { + return ( + this.upX(t, i), + this.upY(e, i), + this.upZ(n, i), + [this.listener.upX, this.listener.upY, this.listener.upZ] + ); + }, + }, + { + key: "forwardX", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.forwardX.value = t), + this.listener.forwardX.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.forwardX.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.forwardX), + this.listener.forwardX.value + ); + }, + }, + { + key: "forwardY", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.forwardY.value = t), + this.listener.forwardY.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.forwardY.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.forwardY), + this.listener.forwardY.value + ); + }, + }, + { + key: "forwardZ", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.forwardZ.value = t), + this.listener.forwardZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.forwardZ.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.forwardZ), + this.listener.forwardZ.value + ); + }, + }, + { + key: "upX", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.upX.value = t), + this.listener.upX.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.upX.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.upX), + this.listener.upX.value + ); + }, + }, + { + key: "upY", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.upY.value = t), + this.listener.upY.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.upY.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.upY), + this.listener.upY.value + ); + }, + }, + { + key: "upZ", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.listener.upZ.value = t), + this.listener.upZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.listener.upZ.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.listener.upZ), + this.listener.upZ.value + ); + }, + }, + ]), + e + ); + })(); + function re(t) { + return (re = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function oe(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function se(t, e) { + return !e || ("object" !== re(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function ae(t, e, n) { + return (ae = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = ue(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function ue(t) { + return (ue = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function ce(t, e) { + return (ce = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var le = (function () { + function e() { + var t; + return ( + (function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + ((t = se(this, ue(e).call(this))).panner = t.ac.createPanner()), + (t.panner.panningModel = "HRTF"), + (t.panner.distanceModel = "linear"), + t.panner.connect(t.output), + t.input.connect(t.panner), + t + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && ce(t, e); + })(e, Ct), + (function (t, e, n) { + e && oe(t.prototype, e), n && oe(t, n); + })(e, [ + { + key: "process", + value: function (t) { + t.connect(this.input); + }, + }, + { + key: "set", + value: function (t, e, n, i) { + return ( + this.positionX(t, i), + this.positionY(e, i), + this.positionZ(n, i), + [ + this.panner.positionX.value, + this.panner.positionY.value, + this.panner.positionZ.value, + ] + ); + }, + }, + { + key: "positionX", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.panner.positionX.value = t), + this.panner.positionX.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.panner.positionX.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.panner.positionX), + this.panner.positionX.value + ); + }, + }, + { + key: "positionY", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.panner.positionY.value = t), + this.panner.positionY.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.panner.positionY.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.panner.positionY), + this.panner.positionY.value + ); + }, + }, + { + key: "positionZ", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.panner.positionZ.value = t), + this.panner.positionZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.panner.positionZ.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.panner.positionZ), + this.panner.positionZ.value + ); + }, + }, + { + key: "orient", + value: function (t, e, n, i) { + return ( + this.orientX(t, i), + this.orientY(e, i), + this.orientZ(n, i), + [ + this.panner.orientationX.value, + this.panner.orientationY.value, + this.panner.orientationZ.value, + ] + ); + }, + }, + { + key: "orientX", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.panner.orientationX.value = t), + this.panner.orientationX.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.panner.orientationX.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.panner.orientationX), + this.panner.orientationX.value + ); + }, + }, + { + key: "orientY", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.panner.orientationY.value = t), + this.panner.orientationY.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.panner.orientationY.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.panner.orientationY), + this.panner.orientationY.value + ); + }, + }, + { + key: "orientZ", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.panner.orientationZ.value = t), + this.panner.orientationZ.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.panner.orientationZ.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : t && t.connect(this.panner.orientationZ), + this.panner.orientationZ.value + ); + }, + }, + { + key: "setFalloff", + value: function (t, e) { + this.maxDist(t), this.rolloff(e); + }, + }, + { + key: "maxDist", + value: function (t) { + return ( + "number" == typeof t && (this.panner.maxDistance = t), + this.panner.maxDistance + ); + }, + }, + { + key: "rolloff", + value: function (t) { + return ( + "number" == typeof t && (this.panner.rolloffFactor = t), + this.panner.rolloffFactor + ); + }, + }, + { + key: "dispose", + value: function () { + ae(ue(e.prototype), "dispose", this).call(this), + this.panner && (this.panner.disconnect(), delete this.panner); + }, + }, + ]), + e + ); + })(); + function he(t) { + return (he = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function pe(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function fe(t, e) { + return !e || ("object" !== he(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function de(t, e, n) { + return (de = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = ye(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function ye(t) { + return (ye = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function me(t, e) { + return (me = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var ve = (function () { + function e() { + var t; + return ( + (function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + ((t = fe(this, ye(e).call(this)))._split = + t.ac.createChannelSplitter(2)), + (t._merge = t.ac.createChannelMerger(2)), + (t._leftGain = t.ac.createGain()), + (t._rightGain = t.ac.createGain()), + (t.leftDelay = t.ac.createDelay()), + (t.rightDelay = t.ac.createDelay()), + (t._leftFilter = new Gt()), + (t._rightFilter = new Gt()), + t._leftFilter.disconnect(), + t._rightFilter.disconnect(), + t._leftFilter.biquad.frequency.setValueAtTime(1200, t.ac.currentTime), + t._rightFilter.biquad.frequency.setValueAtTime( + 1200, + t.ac.currentTime, + ), + t._leftFilter.biquad.Q.setValueAtTime(0.3, t.ac.currentTime), + t._rightFilter.biquad.Q.setValueAtTime(0.3, t.ac.currentTime), + t.input.connect(t._split), + t.leftDelay.connect(t._leftGain), + t.rightDelay.connect(t._rightGain), + t._leftGain.connect(t._leftFilter.input), + t._rightGain.connect(t._rightFilter.input), + t._merge.connect(t.wet), + t._leftFilter.biquad.gain.setValueAtTime(1, t.ac.currentTime), + t._rightFilter.biquad.gain.setValueAtTime(1, t.ac.currentTime), + t.setType(0), + (t._maxDelay = t.leftDelay.delayTime.maxValue), + t.feedback(0.5), + t + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && me(t, e); + })(e, Ct), + (function (t, e, n) { + e && pe(t.prototype, e), n && pe(t, n); + })(e, [ + { + key: "process", + value: function (t, e, n, i) { + var r = n || 0, + o = e || 0; + if (1 <= r) + throw new Error( + "Feedback value will force a positive feedback loop.", + ); + if (o >= this._maxDelay) + throw new Error( + "Delay Time exceeds maximum delay time of " + + this._maxDelay + + " second.", + ); + t.connect(this.input), + this.leftDelay.delayTime.setValueAtTime(o, this.ac.currentTime), + this.rightDelay.delayTime.setValueAtTime( + o, + this.ac.currentTime, + ), + (this._leftGain.gain.value = r), + (this._rightGain.gain.value = r), + i && (this._leftFilter.freq(i), this._rightFilter.freq(i)); + }, + }, + { + key: "delayTime", + value: 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, + )); + }, + }, + { + key: "feedback", + value: function (t) { + if (t && "number" != typeof t) + t.connect(this._leftGain.gain), t.connect(this._rightGain.gain); + else { + if (1 <= t) + 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; + }, + }, + { + key: "filter", + value: function (t, e) { + this._leftFilter.set(t, e), this._rightFilter.set(t, e); + }, + }, + { + key: "setType", + value: 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); + } + }, + }, + { + key: "dispose", + value: function () { + de(ye(e.prototype), "dispose", this).call(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); + }, + }, + ]), + e + ); + })(); + function _e(t) { + return (_e = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function ge(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + function be(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function Te(t, e, n) { + return e && be(t.prototype, e), n && be(t, n), t; + } + function we(t, e) { + return !e || ("object" !== _e(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function xe(t, e, n) { + return (xe = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = Se(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function Se(t) { + return (Se = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function ke(t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && Pe(t, e); + } + function Pe(t, e) { + return (Pe = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var Ae = (function () { + function e() { + var t; + return ( + ge(this, e), + (t = we(this, Se(e).call(this)))._initConvolverNode(), + (t.input.gain.value = 0.5), + (t._seconds = 3), + (t._decay = 2), + (t._reverse = !1), + t._buildImpulse(), + t + ); + } + return ( + ke(e, Ct), + Te(e, [ + { + key: "_initConvolverNode", + value: function () { + (this.convolverNode = this.ac.createConvolver()), + this.input.connect(this.convolverNode), + this.convolverNode.connect(this.wet); + }, + }, + { + key: "_teardownConvolverNode", + value: function () { + this.convolverNode && + (this.convolverNode.disconnect(), delete this.convolverNode); + }, + }, + { + key: "_setBuffer", + value: function (t) { + this._teardownConvolverNode(), + this._initConvolverNode(), + (this.convolverNode.buffer = t); + }, + }, + { + key: "process", + value: function (t, e, n, i) { + t.connect(this.input); + var r = !1; + e && ((this._seconds = e), (r = !0)), + n && (this._decay = n), + i && (this._reverse = i), + r && this._buildImpulse(); + }, + }, + { + key: "set", + value: function (t, e, n) { + var i = !1; + t && ((this._seconds = t), (i = !0)), + e && (this._decay = e), + n && (this._reverse = n), + i && this._buildImpulse(); + }, + }, + { + key: "_buildImpulse", + value: function () { + var t, + e, + n = this.ac.sampleRate, + i = n * this._seconds, + r = this._decay, + o = this.ac.createBuffer(2, i, n), + s = o.getChannelData(0), + a = o.getChannelData(1); + for (e = 0; e < i; e++) + (t = this._reverse ? i - e : e), + (s[e] = (2 * Math.random() - 1) * Math.pow(1 - t / i, r)), + (a[e] = (2 * Math.random() - 1) * Math.pow(1 - t / i, r)); + this._setBuffer(o); + }, + }, + { + key: "dispose", + value: function () { + xe(Se(e.prototype), "dispose", this).call(this), + this._teardownConvolverNode(); + }, + }, + ]), + e + ); + })(), + Oe = (function () { + function r(t, e, n) { + var i; + return ( + ge(this, r), + (i = we(this, Se(r).call(this)))._initConvolverNode(), + (i.input.gain.value = 0.5), + t + ? ((i.impulses = []), i._loadBuffer(t, e, n)) + : ((i._seconds = 3), + (i._decay = 2), + (i._reverse = !1), + i._buildImpulse()), + (i.impulses = []), + (i.set = null), + i + ); + } + return ( + ke(r, Ae), + Te(r, [ + { + key: "_loadBuffer", + value: function (t, i, n) { + var r = p5.prototype._checkFileFormats(t), + o = this, + s = new Error().stack, + a = Object(c.b)(), + u = new XMLHttpRequest(); + u.open("GET", r, !0), + (u.responseType = "arraybuffer"), + (u.onload = function () { + if (200 === u.status) + a.decodeAudioData( + u.response, + function (t) { + var e = {}, + n = r.split("/"); + (e.name = n[n.length - 1]), + (e.audioBuffer = t), + o.impulses.push(e), + o._setBuffer(e.audioBuffer), + i && i(e); + }, + function () { + var t = new m("decodeAudioData", s, o.url), + e = + "AudioContext error at decodeAudioData for " + + o.url; + n && ((t.msg = e), n(t)); + }, + ); + else { + var t = new m("loadConvolver", s, o.url), + e = + "Unable to load " + + o.url + + ". The request status was: " + + u.status + + " (" + + u.statusText + + ")"; + n && ((t.message = e), n(t)); + } + }), + (u.onerror = function () { + var t = new m("loadConvolver", s, o.url), + e = + "There was no response from the server at " + + o.url + + ". Check the url and internet connectivity."; + n && ((t.message = e), n(t)); + }), + u.send(); + }, + }, + { + key: "process", + value: function (t) { + t.connect(this.input); + }, + }, + { + key: "addImpulse", + value: function (t, e, n) { + -1 < window.location.origin.indexOf("file://") && + "undefined" === window.cordova && + alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ), + this._loadBuffer(t, e, n); + }, + }, + { + key: "resetImpulse", + value: function (t, e, n) { + -1 < window.location.origin.indexOf("file://") && + "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, n); + }, + }, + { + key: "toggleImpulse", + value: function (t) { + if ( + ("number" == typeof t && + t < this.impulses.length && + this._setBuffer(this.impulses[t].audioBuffer), + "string" == typeof t) + ) + for (var e = 0; e < this.impulses.length; e++) + if (this.impulses[e].name === t) { + this._setBuffer(this.impulses[e].audioBuffer); + break; + } + }, + }, + { + key: "dispose", + value: function () { + for (var t in (xe(Se(r.prototype), "dispose", this).call(this), + this.impulses)) + this.impulses[t] && (this.impulses[t] = null); + }, + }, + ]), + r + ); + })(); + var Ce = n(11), + Re = n.n(Ce); + function qe(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var Ee = (function () { + function t() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, t), + (this.clock = new Re.a({ callback: this.ontick.bind(this) })), + (this.syncedParts = []), + (this.bpm = 120), + this._init(), + (this.prevTick = 0), + (this.tatumTime = 0), + (this.tickCallback = function () {}); + } + return ( + (function (t, e, n) { + e && qe(t.prototype, e), n && qe(t, n); + })(t, [ + { + key: "ontick", + value: function (t) { + var e = t - this.prevTick, + i = t - p.audiocontext.currentTime; + if (!(e - this.tatumTime <= -0.02)) { + this.prevTick = t; + var r = this; + this.syncedParts.forEach(function (t) { + t.isPlaying && + (t.incrementStep(i), + t.phrases.forEach(function (t) { + var e = t.sequence, + n = r.metroTicks % e.length; + 0 !== e[n] && + (r.metroTicks < e.length || !t.looping) && + t.callback(i, e[n]); + })); + }), + (this.metroTicks += 1), + this.tickCallback(i); + } + }, + }, + { + key: "setBPM", + value: function (t, e) { + var n = 1 < arguments.length && void 0 !== e ? e : 0, + i = 60 / (t * this.tatums), + r = p.audiocontext.currentTime; + (this.tatumTime = i), + this.clock.frequency.setValueAtTime( + this.clock.frequency.value, + r, + ), + this.clock.frequency.linearRampToValueAtTime(t, r + n), + (this.bpm = t); + }, + }, + { + key: "getBPM", + value: function () { + return (this.clock.getRate() / this.tatums) * 60; + }, + }, + { + key: "_init", + value: function () { + this.metroTicks = 0; + }, + }, + { + key: "resetSync", + value: function (t) { + this.syncedParts = [t]; + }, + }, + { + key: "pushSync", + value: function (t) { + this.syncedParts.push(t); + }, + }, + { + key: "start", + value: function (t) { + var e = t || 0, + n = p.audiocontext.currentTime; + this.clock.start(n + e), this.setBPM(this.bpm); + }, + }, + { + key: "stop", + value: function (t) { + var e = t || 0, + n = p.audiocontext.currentTime; + this.clock.stop(n + e); + }, + }, + { + key: "beatLength", + value: function (t) { + this.tatums = 1 / t / 4; + }, + }, + ]), + t + ); + })(); + function Ne(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function Be(t, e, n) { + return e && Ne(t.prototype, e), n && Ne(t, n), t; + } + function Ve(t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + } + var je = 120; + p5.prototype.setBPM = function (t, e) { + for (var n in ((je = t), p.parts)) p.parts[n] && p.parts[n].setBPM(t, e); + }; + function Me(t, e, n) { + Ve(this, Me), + (this.phraseStep = 0), + (this.name = t), + (this.callback = e), + (this.sequence = n); + } + var Fe = (function () { + function n(t, e) { + Ve(this, n), + (this.length = t || 0), + (this.partStep = 0), + (this.phrases = []), + (this.isPlaying = !1), + this.noLoop(), + (this.tatums = e || 0.0625), + (this.metro = new Ee()), + this.metro._init(), + this.metro.beatLength(this.tatums), + this.metro.setBPM(je), + p.parts.push(this), + (this.callback = function () {}); + } + return ( + Be(n, [ + { + key: "setBPM", + value: function (t, e) { + this.metro.setBPM(t, e); + }, + }, + { + key: "getBPM", + value: function () { + return this.metro.getBPM(); + }, + }, + { + key: "start", + value: function (t) { + if (!this.isPlaying) { + (this.isPlaying = !0), this.metro.resetSync(this); + var e = t || 0; + this.metro.start(e); + } + }, + }, + { + key: "loop", + value: function (t) { + (this.looping = !0), + (this.onended = function () { + this.partStep = 0; + }); + var e = t || 0; + this.start(e); + }, + }, + { + key: "noLoop", + value: function () { + (this.looping = !1), + (this.onended = function () { + this.stop(); + }); + }, + }, + { + key: "stop", + value: function (t) { + (this.partStep = 0), this.pause(t); + }, + }, + { + key: "pause", + value: function (t) { + this.isPlaying = !1; + var e = t || 0; + this.metro.stop(e); + }, + }, + { + key: "addPhrase", + value: function (t, e, n) { + var i; + if (3 === arguments.length) i = new Me(t, e, n); + else { + if (!(t instanceof Me)) + throw "invalid input. addPhrase accepts name, callback, array or a p5.Phrase"; + i = t; + } + this.phrases.push(i), + i.sequence.length > this.length && + (this.length = i.sequence.length); + }, + }, + { + key: "removePhrase", + value: function (t) { + for (var e in this.phrases) + this.phrases[e].name === t && this.phrases.splice(e, 1); + }, + }, + { + key: "getPhrase", + value: function (t) { + for (var e in this.phrases) + if (this.phrases[e].name === t) return this.phrases[e]; + }, + }, + { + key: "replaceSequence", + value: function (t, e) { + for (var n in this.phrases) + this.phrases[n].name === t && (this.phrases[n].sequence = e); + }, + }, + { + key: "incrementStep", + value: function (t) { + this.partStep < this.length - 1 + ? (this.callback(t), (this.partStep += 1)) + : this.looping || + this.partStep !== this.length - 1 || + this.onended(); + }, + }, + { + key: "onStep", + value: function (t) { + this.callback = t; + }, + }, + ]), + n + ); + })(), + De = (function () { + function n() { + Ve(this, n), + (this.parts = []), + (this.currentPart = new Array(arguments.length)); + var t = this; + for (var e in arguments) + (this.parts[e] = arguments[e]), + (this.parts[e].nextPart = this.parts[e + 1]), + (this.parts[e].onended = function () { + t.resetPart(e), Ie(t); + }); + this.looping = !1; + } + return ( + Be(n, [ + { + key: "onended", + value: function () { + this.looping + ? this.parts[0].start() + : (this.parts[this.parts.length - 1].onended = function () { + this.stop(), this.resetParts(); + }), + (this.currentPart = 0); + }, + }, + { + key: "start", + value: function () { + this.parts[this.currentPart].start(), (this.scoreStep = 0); + }, + }, + { + key: "stop", + value: function () { + this.parts[this.currentPart].stop(), + (this.currentPart = 0), + (this.scoreStep = 0); + }, + }, + { + key: "pause", + value: function () { + this.parts[this.currentPart].stop(); + }, + }, + { + key: "loop", + value: function () { + (this.looping = !0), this.start(); + }, + }, + { + key: "noLoop", + value: function () { + this.looping = !1; + }, + }, + { + key: "resetParts", + value: function () { + var e = this; + this.parts.forEach(function (t) { + e.resetParts[t]; + }); + }, + }, + { + key: "resetPart", + value: function (t) { + for (var e in (this.parts[t].stop(), + (this.parts[t].partStep = 0), + this.parts[t].phrases)) + this.parts[t] && (this.parts[t].phrases[e].phraseStep = 0); + }, + }, + { + key: "setBPM", + value: function (t, e) { + for (var n in this.parts) + this.parts[n] && this.parts[n].setBPM(t, e); + }, + }, + ]), + n + ); + })(); + function Ie(t) { + t.currentPart++, + t.currentPart >= t.parts.length + ? ((t.scoreStep = 0), t.onended()) + : ((t.scoreStep = 0), + t.parts[t.currentPart - 1].stop(), + t.parts[t.currentPart].start()); + } + function Ue(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var Ge = (function () { + function i(t, e) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, i), + Object.defineProperty(this, "bpm", { + get: function () { + return this._bpm; + }, + set: function (t) { + this.musicalTimeMode, (this._bpm = t), this._update(); + }, + }), + Object.defineProperty(this, "timeSignature", { + get: function () { + return this._timeSignature; + }, + set: function (t) { + this.musicalTimeMode, (this._timeSignature = t), this._update(); + }, + }), + Object.defineProperty(this, "interval", { + get: function () { + return this._interval; + }, + set: function (t) { + (this.musicalTimeMode = "number" != typeof t), + (this._interval = t), + this._update(); + }, + }), + Object.defineProperty(this, "iterations", { + get: function () { + return this.clock.ticks; + }, + }), + (this.callback = t), + (this.musicalTimeMode = "number" != typeof this._interval), + (this._interval = e || 1), + (this._timeSignature = 4), + (this._bpm = 60), + (this.isPlaying = !1), + (this.maxIterations = 1 / 0); + var n = this; + this.clock = new Re.a({ + callback: function (t) { + var e = t - p.audiocontext.currentTime; + 0 < e && n.iterations <= n.maxIterations && n.callback(e); + }, + frequency: this._calcFreq(), + }); + } + return ( + (function (t, e, n) { + e && Ue(t.prototype, e), n && Ue(t, n); + })(i, [ + { + key: "start", + value: function (t) { + var e = t || 0, + n = p.audiocontext.currentTime; + this.isPlaying || + (this.clock.start(n + e), (this.isPlaying = !0)); + }, + }, + { + key: "stop", + value: function (t) { + var e = t || 0, + n = p.audiocontext.currentTime; + this.isPlaying && (this.clock.stop(n + e), (this.isPlaying = !1)); + }, + }, + { + key: "pause", + value: function (t) { + var e = t || 0, + n = p.audiocontext.currentTime; + this.isPlaying && + (this.clock.pause(n + e), (this.isPlaying = !1)); + }, + }, + { + key: "syncedStart", + value: function (t, e) { + var n = e || 0, + i = p.audiocontext.currentTime; + if (t.isPlaying) { + if (t.isPlaying) { + var r = t.clock._nextTick - p.audiocontext.currentTime; + this.clock.start(i + r), (this.isPlaying = !0); + } + } else + t.clock.start(i + n), + (t.isPlaying = !0), + this.clock.start(i + n), + (this.isPlaying = !0); + }, + }, + { + key: "_update", + value: function () { + this.clock.frequency.value = this._calcFreq(); + }, + }, + { + key: "_calcFreq", + value: 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; + }, + }, + { + key: "_convertNotation", + value: 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); + } + }, + }, + { + key: "_measure", + value: function (t) { + return t * this._timeSignature; + }, + }, + { + key: "_note", + value: function (t) { + return this._timeSignature / t; + }, + }, + ]), + i + ); + })(); + function Le(t) { + return (Le = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function ze(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function We(t, e) { + return !e || ("object" !== Le(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function Ze(t, e, n) { + return (Ze = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = Xe(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function Xe(t) { + return (Xe = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function Ye(t, e) { + return (Ye = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var He = (function () { + function e() { + var t; + return ( + (function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + ((t = We(this, Xe(e).call(this))).compressor = + t.ac.createDynamicsCompressor()), + t.input.connect(t.compressor), + t.compressor.connect(t.wet), + t + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && Ye(t, e); + })(e, Ct), + (function (t, e, n) { + e && ze(t.prototype, e), n && ze(t, n); + })(e, [ + { + key: "process", + value: function (t, e, n, i, r, o) { + t.connect(this.input), this.set(e, n, i, r, o); + }, + }, + { + key: "set", + value: function (t, e, n, i, r) { + void 0 !== t && this.attack(t), + void 0 !== e && this.knee(e), + void 0 !== n && this.ratio(n), + void 0 !== i && this.threshold(i), + void 0 !== r && this.release(r); + }, + }, + { + key: "attack", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.compressor.attack.value = t), + this.compressor.attack.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.compressor.attack.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : void 0 !== t && t.connect(this.compressor.attack), + this.compressor.attack.value + ); + }, + }, + { + key: "knee", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.compressor.knee.value = t), + this.compressor.knee.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.compressor.knee.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : void 0 !== t && t.connect(this.compressor.knee), + this.compressor.knee.value + ); + }, + }, + { + key: "ratio", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.compressor.ratio.value = t), + this.compressor.ratio.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.compressor.ratio.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : void 0 !== t && t.connect(this.compressor.ratio), + this.compressor.ratio.value + ); + }, + }, + { + key: "threshold", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.compressor.threshold.value = t), + this.compressor.threshold.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.compressor.threshold.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : void 0 !== t && t.connect(this.compressor.threshold), + this.compressor.threshold.value + ); + }, + }, + { + key: "release", + value: function (t, e) { + var n = e || 0; + return ( + "number" == typeof t + ? ((this.compressor.release.value = t), + this.compressor.release.cancelScheduledValues( + this.ac.currentTime + 0.01 + n, + ), + this.compressor.release.linearRampToValueAtTime( + t, + this.ac.currentTime + 0.02 + n, + )) + : "undefined" != typeof number && + t.connect(this.compressor.release), + this.compressor.release.value + ); + }, + }, + { + key: "reduction", + value: function () { + return this.compressor.reduction.value; + }, + }, + { + key: "dispose", + value: function () { + Ze(Xe(e.prototype), "dispose", this).call(this), + this.compressor && + (this.compressor.disconnect(), delete this.compressor); + }, + }, + ]), + e + ); + })(); + function $e(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var Qe = (function () { + function r(t, e, n, i) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, r), + (this.framesPerPeak = i || 20), + (this.framesSinceLastPeak = 0), + (this.decayRate = 0.95), + (this.threshold = n || 0.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 () {}); + } + return ( + (function (t, e, n) { + e && $e(t.prototype, e), n && $e(t, n); + })(r, [ + { + key: "update", + value: function (t) { + var e = (this.energy = t.getEnergy(this.f1, this.f2) / 255); + e > this.cutoff && e > this.threshold && 0 < e - this.penergy + ? (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); + }, + }, + { + key: "onPeak", + value: function (t, e) { + var n = this; + n._onPeak = function () { + t(n.energy, e); + }; + }, + }, + ]), + r + ); + })(); + function Je(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var Ke = p.audiocontext, + tn = (function () { + function e() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + (this.input = Ke.createGain()), + (this.output = Ke.createGain()), + (this._inputChannels = 2), + (this._outputChannels = 2); + var t = y(1024); + (this._workletNode = new AudioWorkletNode(Ke, s.a.recorderProcessor, { + outputChannelCount: [this._outputChannels], + processorOptions: { + numInputChannels: this._inputChannels, + bufferSize: t, + }, + })), + (this._workletNode.port.onmessage = function (t) { + if ("buffers" === t.data.name) { + var e = [ + new Float32Array(t.data.leftBuffer), + new Float32Array(t.data.rightBuffer), + ]; + this._callback(e); + } + }.bind(this)), + (this._callback = function () {}), + this._workletNode.connect(p5.soundOut._silentNode), + this.setInput(), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && Je(t.prototype, e), n && Je(t, n); + })(e, [ + { + key: "setInput", + value: function (t) { + this.input.disconnect(), + (this.input = null), + (this.input = Ke.createGain()), + this.input.connect(this._workletNode), + this.input.connect(this.output), + t + ? t.connect(this.input) + : p5.soundOut.output.connect(this.input); + }, + }, + { + key: "record", + value: function (e, t, n) { + this._workletNode.port.postMessage({ + name: "start", + duration: t, + }), + e && n + ? (this._callback = function (t) { + e.setBuffer(t), n(); + }) + : e && + (this._callback = function (t) { + e.setBuffer(t); + }); + }, + }, + { + key: "stop", + value: function () { + this._workletNode.port.postMessage({ name: "stop" }); + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + (this._callback = function () {}), + this.input && this.input.disconnect(), + (this.input = null), + (this._workletNode = null); + }, + }, + ]), + e + ); + })(); + function en(t) { + return (en = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function nn(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function rn(t, e) { + return !e || ("object" !== en(e) && "function" != typeof e) + ? (function (t) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + })(t) + : e; + } + function on(t, e, n) { + return (on = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = sn(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function sn(t) { + return (sn = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function an(t, e) { + return (an = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + function un(t) { + for ( + var e, + n = "number" == typeof t ? t : 50, + i = new Float32Array(44100), + r = Math.PI / 180, + o = 0; + o < 44100; + ++o + ) + (e = (2 * o) / 44100 - 1), + (i[o] = ((3 + n) * e * 20 * r) / (Math.PI + n * Math.abs(e))); + return i; + } + var cn = (function () { + function r(t, e) { + var n; + if ( + ((function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, r), + (n = rn(this, sn(r).call(this))), + void 0 === t && (t = 0.25), + "number" != typeof t) + ) + throw new Error("amount must be a number"); + if ((void 0 === e && (e = "2x"), "string" != typeof e)) + throw new Error("oversample must be a String"); + var i = p5.prototype.map(t, 0, 1, 0, 2e3); + return ( + (n.waveShaperNode = n.ac.createWaveShaper()), + (n.amount = i), + (n.waveShaperNode.curve = un(i)), + (n.waveShaperNode.oversample = e), + n.input.connect(n.waveShaperNode), + n.waveShaperNode.connect(n.wet), + n + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && an(t, e); + })(r, Ct), + (function (t, e, n) { + e && nn(t.prototype, e), n && nn(t, n); + })(r, [ + { + key: "process", + value: function (t, e, n) { + t.connect(this.input), this.set(e, n); + }, + }, + { + key: "set", + value: function (t, e) { + if (t) { + var n = p5.prototype.map(t, 0, 1, 0, 2e3); + (this.amount = n), (this.waveShaperNode.curve = un(n)); + } + e && (this.waveShaperNode.oversample = e); + }, + }, + { + key: "getAmount", + value: function () { + return this.amount; + }, + }, + { + key: "getOversample", + value: function () { + return this.waveShaperNode.oversample; + }, + }, + { + key: "dispose", + value: function () { + on(sn(r.prototype), "dispose", this).call(this), + this.waveShaperNode && + (this.waveShaperNode.disconnect(), + (this.waveShaperNode = null)); + }, + }, + ]), + r + ); + })(); + function ln(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var hn = (function () { + function t() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, t), + (this.ac = p.audiocontext), + (this.input = this.ac.createGain()), + (this.output = this.ac.createGain()), + (this.input.gain.value = 0.5), + this.input.connect(this.output), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && ln(t.prototype, e), n && ln(t, n); + })(t, [ + { + key: "setInput", + value: function (t) { + t.connect(this.input); + }, + }, + { + key: "connect", + value: function (t) { + var e = t || p5.soundOut.input; + this.output.connect(e.input ? e.input : e); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(); + }, + }, + { + key: "amp", + value: function (t, e, n) { + var i = 1 < arguments.length && void 0 !== e ? e : 0, + r = 2 < arguments.length && void 0 !== n ? n : 0, + o = p.audiocontext.currentTime, + s = this.output.gain.value; + this.output.gain.cancelScheduledValues(o), + this.output.gain.linearRampToValueAtTime(s, o + r), + this.output.gain.linearRampToValueAtTime(t, o + r + i); + }, + }, + { + key: "dispose", + value: function () { + var t = p.soundArray.indexOf(this); + p.soundArray.splice(t, 1), + this.output && (this.output.disconnect(), delete this.output), + this.input && (this.input.disconnect(), delete this.input); + }, + }, + ]), + t + ); + })(); + function pn(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var fn = (function () { + function t() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, t), + (this.ac = p.audiocontext), + (this.output = this.ac.createGain()), + this.connect(), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && pn(t.prototype, e), n && pn(t, n); + })(t, [ + { key: "play", value: function (t, e, n, i) {} }, + { key: "triggerAttack", value: function (t, e, n) {} }, + { key: "triggerRelease", value: function (t) {} }, + { key: "amp", value: function (t, e) {} }, + { + key: "connect", + value: function (t) { + var e = t || p.input; + this.output.connect(e.input ? e.input : e); + }, + }, + { + key: "disconnect", + value: function () { + this.output.disconnect(); + }, + }, + { + key: "dispose", + value: function () { + this.output && (this.output.disconnect(), delete this.output); + }, + }, + ]), + t + ); + })(); + function dn(t) { + return (dn = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && + "function" == typeof Symbol && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + })(t); + } + function yn(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + function mn(t) { + if (void 0 === t) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return t; + } + function vn(t, e, n) { + return (vn = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (t, e, n) { + var i = (function (t, e) { + for ( + ; + !Object.prototype.hasOwnProperty.call(t, e) && + null !== (t = _n(t)); + + ); + return t; + })(t, e); + if (i) { + var r = Object.getOwnPropertyDescriptor(i, e); + return r.get ? r.get.call(n) : r.value; + } + })(t, e, n || t); + } + function _n(t) { + return (_n = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + })(t); + } + function gn(t, e) { + return (gn = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + })(t, e); + } + var bn = (function () { + function e() { + var t; + return ( + (function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, e), + ((t = (function (t, e) { + return !e || ("object" !== dn(e) && "function" != typeof e) + ? mn(t) + : e; + })(this, _n(e).call(this))).oscillator = new nt()), + (t.env = new ot()), + t.env.setRange(1, 0), + t.env.setExp(!0), + t.setADSR(0.02, 0.25, 0.05, 0.35), + t.oscillator.disconnect(), + t.oscillator.connect(t.output), + t.env.disconnect(), + t.env.setInput(t.output.gain), + (t.oscillator.output.gain.value = 1), + t.oscillator.start(), + t.connect(), + p.soundArray.push(mn(t)), + Object.defineProperties(mn(t), { + 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 + ); + } + return ( + (function (t, e) { + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && gn(t, e); + })(e, fn), + (function (t, e, n) { + e && yn(t.prototype, e), n && yn(t, n); + })(e, [ + { + key: "play", + value: function (t, e, n, i) { + this.triggerAttack(t, e, ~~n), + this.triggerRelease(~~n + (i || 0.15)); + }, + }, + { + key: "triggerAttack", + value: function (t, e, n) { + var i = 2 < arguments.length && void 0 !== n ? n : 0, + r = h(t), + o = e || 0.1; + this.oscillator.freq(r, 0, i), + this.env.ramp(this.output.gain, i, o); + }, + }, + { + key: "triggerRelease", + value: function (t) { + var e = 0 < arguments.length && void 0 !== t ? t : 0; + this.env.ramp(this.output.gain, e, 0); + }, + }, + { + key: "setADSR", + value: function (t, e, n, i) { + this.env.setADSR(t, e, n, i); + }, + }, + { + key: "amp", + value: function (t, e) { + var n = e || 0; + return ( + void 0 !== t && this.oscillator.amp(t, n), + this.oscillator.amp().value + ); + }, + }, + { + key: "connect", + value: function (t) { + var e = t || p.input; + this.output.connect(e.input ? e.input : e); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(); + }, + }, + { + key: "dispose", + value: function () { + vn(_n(e.prototype), "dispose", this).call(this), + this.env && this.env.dispose(), + this.oscillator && this.oscillator.dispose(); + }, + }, + ]), + e + ); + })(); + function Tn(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var wn = (function () { + function r(t, e, n, i) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, r), + (this.isDetected = !1), + (this.freqLow = t), + (this.freqHigh = e), + (this.treshold = n), + (this.energy = 0), + (this.penergy = 0), + (this.sensitivity = 500), + (this.callback = i); + } + return ( + (function (t, e, n) { + e && Tn(t.prototype, e), n && Tn(t, n); + })(r, [ + { + key: "update", + value: function (t, e) { + if ( + ((this.energy = t.getEnergy(this.freqLow, this.freqHigh) / 255), + !1 === this.isDetected && + this.energy - this.penergy > this.treshold) + ) { + (this.isDetected = !0), + this.callback + ? this.callback(this.energy) + : e && e(this.energy); + var n = this; + setTimeout(function () { + n.isDetected = !1; + }, this.sensitivity); + } + this.penergy = this.energy; + }, + }, + ]), + r + ); + })(); + function xn(t, e) { + for (var n = 0; n < e.length; n++) { + var i = e[n]; + (i.enumerable = i.enumerable || !1), + (i.configurable = !0), + "value" in i && (i.writable = !0), + Object.defineProperty(t, i.key, i); + } + } + var Sn = (function () { + function n(t, e) { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, n), + (this.audiovoices = []), + (this.notes = {}), + (this._newest = 0), + (this._oldest = 0), + (this.maxVoices = e || 8), + (this.AudioVoice = void 0 === t ? p5.MonoSynth : t), + (this._voicesInUse = new rt.a(0)), + (this.output = p.audiocontext.createGain()), + this.connect(), + this._allocateVoices(), + p.soundArray.push(this); + } + return ( + (function (t, e, n) { + e && xn(t.prototype, e), n && xn(t, n); + })(n, [ + { + key: "_allocateVoices", + value: function () { + for (var t = 0; t < this.maxVoices; t++) + this.audiovoices.push(new this.AudioVoice()), + this.audiovoices[t].disconnect(), + this.audiovoices[t].connect(this.output); + }, + }, + { + key: "play", + value: function (t, e, n, i) { + var r = 3 < arguments.length && void 0 !== i ? i : 1; + this.noteAttack(t, e, n), this.noteRelease(t, n + r); + }, + }, + { + key: "noteADSR", + value: function (t, e, n, i, r, o) { + var s = 5 < arguments.length && void 0 !== o ? o : 0, + a = p.audiocontext.currentTime + s; + this.audiovoices[this.notes[t].getValueAtTime(a)].setADSR( + e, + n, + i, + r, + ); + }, + }, + { + key: "setADSR", + value: function (e, n, i, r) { + this.audiovoices.forEach(function (t) { + t.setADSR(e, n, i, r); + }); + }, + }, + { + key: "noteAttack", + value: function (t, e, n) { + var i, + r = 2 < arguments.length && void 0 !== n ? n : 0, + o = p.audiocontext.currentTime + r, + s = h(t), + a = e || 0.1; + this.notes[s] && + null !== this.notes[s].getValueAtTime(o) && + this.noteRelease(s, 0), + this._voicesInUse.getValueAtTime(o) < this.maxVoices + ? (i = Math.max(~~this._voicesInUse.getValueAtTime(o), 0)) + : ((i = this._oldest), + (oldestNote = l( + this.audiovoices[this._oldest].oscillator.freq().value, + )), + this.noteRelease(oldestNote), + (this._oldest = (this._oldest + 1) % (this.maxVoices - 1))), + (this.notes[s] = new rt.a()), + this.notes[s].setValueAtTime(i, o); + var u = + null === this._voicesInUse._searchBefore(o) + ? 0 + : this._voicesInUse._searchBefore(o).value; + if ( + (this._voicesInUse.setValueAtTime(u + 1, o), + this._updateAfter(o, 1), + (this._newest = i), + "number" == typeof a) + ) { + var c = (1 / this._voicesInUse.getValueAtTime(o)) * 2; + a = c < a ? c : a; + } + this.audiovoices[i].triggerAttack(s, a, r); + }, + }, + { + key: "_updateAfter", + value: function (t, e) { + if (null !== this._voicesInUse._searchAfter(t)) { + this._voicesInUse._searchAfter(t).value += e; + var n = this._voicesInUse._searchAfter(t).time; + this._updateAfter(n, e); + } + }, + }, + { + key: "noteRelease", + value: function (t, e) { + var n = p.audiocontext.currentTime, + i = e || 0, + r = n + i; + if (t) { + var o = h(t); + if (this.notes[o] && null !== this.notes[o].getValueAtTime(r)) { + var s = Math.max( + ~~this._voicesInUse.getValueAtTime(r).value, + 1, + ); + this._voicesInUse.setValueAtTime(s - 1, r), + 0 < s && this._updateAfter(r, -1), + this.audiovoices[ + this.notes[o].getValueAtTime(r) + ].triggerRelease(i), + this.notes[o].dispose(), + delete this.notes[o], + (this._newest = + 0 === this._newest + ? 0 + : (this._newest - 1) % (this.maxVoices - 1)); + } else; + } else + for (var a in (this.audiovoices.forEach(function (t) { + t.triggerRelease(i); + }), + this._voicesInUse.setValueAtTime(0, r), + this.notes)) + this.notes[a].dispose(), delete this.notes[a]; + }, + }, + { + key: "connect", + value: function (t) { + var e = t || p.input; + this.output.connect(e.input ? e.input : e); + }, + }, + { + key: "disconnect", + value: function () { + this.output && this.output.disconnect(); + }, + }, + { + key: "dispose", + value: function () { + this.audiovoices.forEach(function (t) { + t.dispose(); + }), + this.output && (this.output.disconnect(), delete this.output); + }, + }, + ]), + n + ); + })(); + function kn() { + !(function (t, e) { + if (!(t instanceof e)) + throw new TypeError("Cannot call a class as a function"); + })(this, kn); + } + (p5.prototype.getAudioContext = c.b), + (p5.prototype.userStartAudio = c.c), + (p5.prototype.sampleRate = function () { + return p.audiocontext.sampleRate; + }), + (p5.prototype.freqToMidi = l), + (p5.prototype.midiToFreq = r), + (p5.prototype.noteToFreq = h), + (p5.prototype.soundFormats = function () { + p.extensions = []; + for (var t = 0; t < arguments.length; t++) { + if ( + ((arguments[t] = arguments[t].toLowerCase()), + !(-1 < ["mp3", "wav", "ogg", "m4a", "aac"].indexOf(arguments[t]))) + ) + throw arguments[t] + " is not a valid sound format!"; + p.extensions.push(arguments[t]); + } + }), + (p5.prototype.disposeSound = function () { + for (var t = 0; t < p.soundArray.length; t++) p.soundArray[t].dispose(); + }), + (p5.prototype._checkFileFormats = function (t) { + var e; + if ("string" == typeof t) { + var n = (e = t).split(".").pop(); + if (-1 < ["mp3", "wav", "ogg", "m4a", "aac"].indexOf(n)) { + if (!p5.prototype.isFileSupported(n)) + for ( + var i = e.split("."), r = i[i.length - 1], o = 0; + o < p.extensions.length; + o++ + ) { + var s = p.extensions[o]; + if (p5.prototype.isFileSupported(s)) { + (r = ""), 2 === i.length && (r += i[0]); + for (var a = 1; a <= i.length - 2; a++) { + r += "." + i[a]; + } + (e = r += "."), (e = e += s); + break; + } + } + } else + for (var u = 0; u < p.extensions.length; u++) { + var c = p.extensions[u]; + if (p5.prototype.isFileSupported(c)) { + e = e + "." + c; + break; + } + } + } else if ("object" === f(t)) + for (var l = 0; l < t.length; l++) { + var h = t[l].split(".").pop(); + if (p5.prototype.isFileSupported(h)) { + e = t[l]; + break; + } + } + return e; + }), + (p5.prototype._mathChain = function (t, e, n, i, r) { + for (var o in t.mathOps) + t.mathOps[o] instanceof r && + (t.mathOps[o].dispose(), + (n = o) < t.mathOps.length - 1 && (i = t.mathOps[o + 1])); + return ( + t.mathOps[n - 1].disconnect(), + t.mathOps[n - 1].connect(e), + e.connect(i), + (t.mathOps[n] = e), + t + ); + }), + (p5.prototype.convertToWav = a), + (p5.prototype.interleave = u), + (p5.prototype.writeUTFBytes = d), + (p5.prototype.safeBufferSize = y), + (p5.prototype.saveSound = function (t, e) { + var n = a(t.buffer); + p5.prototype.writeFile([n], e, "wav"); + }), + p5.prototype.registerMethod("remove", p5.prototype.disposeSound), + (p5.Panner = k), + (p5.SoundFile = E), + (p5.prototype.loadSound = function (t, e, n, i) { + -1 < window.location.origin.indexOf("file://") && + "undefined" === window.cordova && + window.alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ); + var r = this; + return new q( + t, + function () { + "function" == typeof e && e.apply(r, arguments), + "function" == typeof r._decrementPreload && r._decrementPreload(); + }, + n, + i, + ); + }), + p5.prototype.registerPreloadMethod("loadSound", p5.prototype), + (p5.Amplitude = B), + (p5.FFT = j), + (p5.Oscillator = nt), + (p5.SinOsc = J), + (p5.TriOsc = K), + (p5.SawOsc = tt), + (p5.SqrOsc = et), + (p5.Noise = dt), + (p5.Pulse = xt), + (p5.AudioIn = kt), + (p5.Effect = Ct), + (p5.Filter = Gt), + (p5.LowPass = Dt), + (p5.HighPass = It), + (p5.BandPass = Ut), + (p5.EQ = ee), + (p5.listener3D = ie), + (p5.Panner3D = le), + (p5.Delay = ve), + (p5.Reverb = Ae), + (p5.Convolver = Oe), + (p5.prototype.createConvolver = function (t, e, n) { + -1 < window.location.origin.indexOf("file://") && + "undefined" === window.cordova && + alert( + "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", + ); + var i = this, + r = new Oe( + t, + function (t) { + "function" == typeof e && e(t), + "function" == typeof i._decrementPreload && + i._decrementPreload(); + }, + n, + ); + return (r.impulses = []), r; + }), + p5.prototype.registerPreloadMethod("createConvolver", p5.prototype), + (p5.Metro = Ee), + (p5.Phrase = Me), + (p5.Part = Fe), + (p5.Score = De), + (p5.SoundLoop = Ge), + (p5.Compressor = He), + (p5.peakDetect = Qe), + (p5.SoundRecorder = tn), + (p5.Distortion = cn), + (p5.Gain = hn), + (p5.AudioVoice = fn), + (p5.MonoSynth = bn), + (p5.OnsetDetect = wn), + (p5.PolySynth = Sn), + (p5.PeakDetect = Qe), + (p5.Signal = kn); + }, +]); +//# sourceMappingURL=p5.sound.min.js.map diff --git a/public/lib/p5.js b/public/lib/p5.js index 6c470be..458bc81 100644 --- a/public/lib/p5.js +++ b/public/lib/p5.js @@ -1,121501 +1,134739 @@ /*! p5.js v1.9.0 November 28, 2023 */ (function (f) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = f() - } else if (typeof define === 'function' && define.amd) { - define([], f) - } else { - var g; - if (typeof window !== 'undefined') { - g = window - } else if (typeof global !== 'undefined') { - g = global - } else if (typeof self !== 'undefined') { - g = self - } else { - g = this - } - g.p5 = f() - } -}) (function () { - var define, - module, - exports; - return (function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = 'function' == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error('Cannot find module \'' + i + '\''); - throw a.code = 'MODULE_NOT_FOUND', - a - } - var p = n[i] = { - exports: { - } - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r) - }, p, p.exports, r, e, n, t) - } - return n[i].exports - } - for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) o(t[i]); - return o - } - return r - }) () ({ - 1: [ - function (_dereq_, module, exports) { - module.exports = { - 'p5': { - 'describe': { - 'name': 'describe', - 'params': [ - { - 'name': 'text', - 'description': '

            description of the canvas.

            \n', - 'type': 'String' - }, - { - 'name': 'display', - 'description': '

            either LABEL or FALLBACK.

            \n', - 'type': 'Constant', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Environment' - }, - 'describeElement': { - 'name': 'describeElement', - 'params': [ - { - 'name': 'name', - 'description': '

            name of the element.

            \n', - 'type': 'String' - }, - { - 'name': 'text', - 'description': '

            description of the element.

            \n', - 'type': 'String' - }, - { - 'name': 'display', - 'description': '

            either LABEL or FALLBACK.

            \n', - 'type': 'Constant', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Environment' - }, - 'textOutput': { - 'name': 'textOutput', - 'params': [ - { - 'name': 'display', - 'description': '

            either FALLBACK or LABEL.

            \n', - 'type': 'Constant', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Environment' - }, - 'gridOutput': { - 'name': 'gridOutput', - 'params': [ - { - 'name': 'display', - 'description': '

            either FALLBACK or LABEL.

            \n', - 'type': 'Constant', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Environment' - }, - 'alpha': { - 'name': 'alpha', - 'params': [ - { - 'name': 'color', - 'description': '

            p5.Color object, array of\n color components, or CSS color string.

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'blue': { - 'name': 'blue', - 'params': [ - { - 'name': 'color', - 'description': '

            p5.Color object, array of\n color components, or CSS color string.

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'brightness': { - 'name': 'brightness', - 'params': [ - { - 'name': 'color', - 'description': '

            p5.Color object, array of\n color components, or CSS color string.

            \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': true - } - ] - }, - { - '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': true - } - ] - }, - { - '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, array of\n color components, or CSS color string.

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'hue': { - 'name': 'hue', - 'params': [ - { - 'name': 'color', - 'description': '

            p5.Color object, array of\n color components, or CSS color string.

            \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, array of\n color components, or CSS color string.

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'red': { - 'name': 'red', - 'params': [ - { - 'name': 'color', - 'description': '

            p5.Color object, array of\n color components, or CSS color string.

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'saturation': { - 'name': 'saturation', - 'params': [ - { - 'name': 'color', - 'description': '

            p5.Color object, array of\n color components, or CSS color string.

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'beginClip': { - 'name': 'beginClip', - 'params': [ - { - 'name': 'options', - 'description': '

            An object containing clip settings.

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Color' - }, - 'endClip': { - 'name': 'endClip', - 'class': 'p5', - 'module': 'Color' - }, - 'clip': { - 'name': 'clip', - 'params': [ - { - 'name': 'callback', - 'description': '

            A function that draws the mask shape.

            \n', - 'type': 'Function' - }, - { - 'name': 'options', - 'description': '

            An object containing clip settings.

            \n', - 'type': 'Object', - 'optional': true - } - ], - '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': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            specifies a value between white and black.

            \n', - 'type': 'Number' - }, - { - 'name': 'a', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red value if color mode is RGB, or hue value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green value if color mode is RGB, or saturation value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue value if color mode is RGB, or brightness value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'a', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - '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()\n 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': true - } - ], - 'chainable': 1 - } - ] - }, - 'clear': { - 'name': 'clear', - 'params': [ - { - 'name': 'r', - 'description': '

            normalized red value.

            \n', - 'type': 'Number' - }, - { - 'name': 'g', - 'description': '

            normalized green value.

            \n', - 'type': 'Number' - }, - { - 'name': 'b', - 'description': '

            normalized blue value.

            \n', - 'type': 'Number' - }, - { - 'name': 'a', - 'description': '

            normalized alpha value.

            \n', - 'type': 'Number' - } - ], - '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': true - } - ], - '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': true - } - ], - 'chainable': 1 - } - ] - }, - 'fill': { - 'name': 'fill', - 'class': 'p5', - 'module': 'Color', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red value if color mode is RGB or hue value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green value if color mode is RGB or saturation value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue value if color mode is RGB or brightness value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            a color string.

            \n', - 'type': 'String' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            a grayscale value.

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - '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 value if color mode is RGB or hue value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green value if color mode is RGB or saturation value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue value if color mode is RGB or brightness value if color mode is HSB.

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            a color string.

            \n', - 'type': 'String' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            a grayscale value.

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - '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 under a shape\'s interior.\n Defaults to 255, which is full strength.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'strengthStroke', - 'description': '

            a number (0-255) for the strength of erasing under a shape\'s edge.\n Defaults to 255, which is full strength.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - '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. Won\'t\n draw a stroke for a detail of more than 50.

            \n', - 'type': 'Integer', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'ellipse': { - 'name': 'ellipse', - 'class': 'p5', - 'module': 'Shape', - 'overloads': [ - { - 'params': [ - { - 'name': 'x', - 'description': '

            x-coordinate of the center of the ellipse.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the center of the 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': true - } - ], - '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': '

            optional parameter for WebGL mode only. This is to\n specify the number of vertices that makes up the\n perimeter of the ellipse. Default value is 25. Won\'t\n draw a stroke for a detail of more than 50.

            \n', - 'type': 'Integer', - 'optional': true - } - ] - } - ] - }, - 'circle': { - 'name': 'circle', - 'params': [ - { - 'name': 'x', - 'description': '

            x-coordinate of the center of the circle.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the center 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': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'coordinateVector', - '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' - }, - { - 'name': 'detailX', - 'description': '

            number of segments in the x-direction.

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            number of segments in the y-direction.

            \n', - 'type': 'Integer', - 'optional': true - } - ], - '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' - }, - { - 'name': 'detailX', - 'description': '', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '', - 'type': 'Integer', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'tl', - 'description': '

            optional radius of top-left corner.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'tr', - 'description': '

            optional radius of top-right corner.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'br', - 'description': '

            optional radius of bottom-right corner.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'bl', - 'description': '

            optional radius of bottom-left corner.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'detailY', - 'description': '

            number of segments in the y-direction (for WebGL mode).

            \n', - 'type': 'Integer', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'tr', - 'description': '

            optional radius of top-right corner.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'br', - 'description': '

            optional radius of bottom-right corner.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'bl', - 'description': '

            optional radius of bottom-left corner.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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, or 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': true - } - ], - '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': true - } - ], - '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': true - }, - { - 'name': 'count', - 'description': '

            number of times you want to draw/instance the shape (for WebGL mode).

            \n', - 'type': 'Integer', - 'optional': true - } - ], - '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 Defaults to 0 if not specified.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'x', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'u', - 'description': '

            the vertex\'s texture u-coordinate

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'v', - 'description': '

            the vertex\'s texture v-coordinate

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - } - ] - }, - 'normal': { - 'name': 'normal', - 'class': 'p5', - 'module': 'Shape', - 'overloads': [ - { - 'params': [ - { - 'name': 'vector', - 'description': '

            A p5.Vector representing the vertex normal.

            \n', - 'type': 'Vector' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'x', - 'description': '

            The x component of the vertex normal.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            The y component of the vertex normal.

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            The z component of the vertex normal.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - } - ] - }, - 'VERSION': { - 'name': 'VERSION', - 'class': 'p5', - 'module': 'Constants' - }, - 'P2D': { - 'name': 'P2D', - 'class': 'p5', - 'module': 'Constants' - }, - 'WEBGL': { - 'name': 'WEBGL', - 'class': 'p5', - 'module': 'Constants' - }, - 'WEBGL2': { - 'name': 'WEBGL2', - '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' - }, - 'CHAR': { - 'name': 'CHAR', - 'class': 'p5', - 'module': 'Constants' - }, - 'WORD': { - 'name': 'WORD', - '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' - }, - 'FLAT': { - 'name': 'FLAT', - 'class': 'p5', - 'module': 'Constants' - }, - 'SMOOTH': { - 'name': 'SMOOTH', - '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' - }, - 'LABEL': { - 'name': 'LABEL', - 'class': 'p5', - 'module': 'Constants' - }, - 'FALLBACK': { - 'name': 'FALLBACK', - 'class': 'p5', - 'module': 'Constants' - }, - 'CONTAIN': { - 'name': 'CONTAIN', - 'class': 'p5', - 'module': 'Constants' - }, - 'COVER': { - 'name': 'COVER', - 'class': 'p5', - 'module': 'Constants' - }, - 'UNSIGNED_BYTE': { - 'name': 'UNSIGNED_BYTE', - 'class': 'p5', - 'module': 'Constants' - }, - 'UNSIGNED_INT': { - 'name': 'UNSIGNED_INT', - 'class': 'p5', - 'module': 'Constants' - }, - 'FLOAT': { - 'name': 'FLOAT', - 'class': 'p5', - 'module': 'Constants' - }, - 'HALF_FLOAT': { - 'name': 'HALF_FLOAT', - 'class': 'p5', - 'module': 'Constants' - }, - 'RGBA': { - 'name': 'RGBA', - 'class': 'p5', - 'module': 'Constants' - }, - 'print': { - 'name': 'print', - 'params': [ - { - 'name': 'contents', - 'description': '

            content to print to the console.

            \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, or WAIT.\n Native CSS properties: \'grab\', \'progress\', and so on.\n Path to cursor image.

            \n', - 'type': 'String|Constant' - }, - { - 'name': 'x', - 'description': '

            horizontal active spot of the cursor.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'y', - 'description': '

            vertical active spot of the cursor.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Environment' - }, - 'frameRate': { - 'name': 'frameRate', - 'class': 'p5', - 'module': 'Environment', - 'overloads': [ - { - 'params': [ - { - 'name': 'fps', - 'description': '

            number of frames to draw per second.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - ] - } - ] - }, - 'getTargetFrameRate': { - 'name': 'getTargetFrameRate', - 'class': 'p5', - 'module': 'Environment' - }, - 'noCursor': { - 'name': 'noCursor', - 'class': 'p5', - 'module': 'Environment' - }, - 'webglVersion': { - 'name': 'webglVersion', - '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', - 'params': [ - { - 'name': 'event', - 'description': '

            optional resize Event.

            \n', - 'type': 'UIEvent', - 'optional': true - } - ], - '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.

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Environment' - }, - 'pixelDensity': { - 'name': 'pixelDensity', - 'class': 'p5', - 'module': 'Environment', - 'overloads': [ - { - 'params': [ - { - 'name': 'val', - 'description': '

            desired pixel density.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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', - 'class': 'p5', - 'module': 'Rendering', - 'overloads': [ - { - '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': true - }, - { - 'name': 'canvas', - 'description': '

            existing html canvas element

            \n', - 'type': 'HTMLCanvasElement', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'w', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'h', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'canvas', - 'description': '', - 'type': 'HTMLCanvasElement', - 'optional': true - } - ] - } - ] - }, - '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': true - } - ], - 'class': 'p5', - 'module': 'Rendering' - }, - 'noCanvas': { - 'name': 'noCanvas', - 'class': 'p5', - 'module': 'Rendering' - }, - 'createGraphics': { - 'name': 'createGraphics', - 'class': 'p5', - 'module': 'Rendering', - 'overloads': [ - { - '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': true - }, - { - 'name': 'canvas', - 'description': '

            existing html canvas element

            \n', - 'type': 'HTMLCanvasElement', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'w', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'h', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'canvas', - 'description': '', - 'type': 'HTMLCanvasElement', - 'optional': true - } - ] - } - ] - }, - 'createFramebuffer': { - 'name': 'createFramebuffer', - 'params': [ - { - 'name': 'options', - 'description': '

            An optional object with configuration

            \n', - 'type': 'Object', - 'optional': true - } - ], - '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': true - } - ], - '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', - 'class': 'p5', - 'module': 'Transform', - 'overloads': [ - { - 'params': [ - { - 'name': 'arr', - 'description': '

            an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values)

            \n', - 'type': 'Array' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'a', - 'description': '

            numbers which define the 2×3 or 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'b', - 'description': '

            numbers which define the 2×3 or 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'c', - 'description': '

            numbers which define the 2×3 or 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'd', - 'description': '

            numbers which define the 2×3 or 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'e', - 'description': '

            numbers which define the 2×3 or 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'f', - 'description': '

            numbers which define the 2×3 or 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'a', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'b', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'c', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'd', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'e', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'f', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'g', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'h', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'i', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'j', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'k', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'l', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'm', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'n', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'o', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - }, - { - 'name': 'p', - 'description': '

            numbers which define the 4×4 matrix to be multiplied

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - } - ] - }, - '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': true - } - ], - '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': true - }, - { - 'name': 'z', - 'description': '

            percent to scale the object in the z-axis (webgl only)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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 HTMLElement to search within.

            \n', - 'type': 'String|p5.Element|HTMLElement', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'selectAll': { - 'name': 'selectAll', - '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 HTMLElement to search within.

            \n', - 'type': 'String|p5.Element|HTMLElement', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'removeElements': { - 'name': 'removeElements', - 'class': 'p5', - 'module': 'DOM' - }, - 'changed': { - 'name': 'changed', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the element changes.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'input': { - 'name': 'input', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when input is detected within\n the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createDiv': { - 'name': 'createDiv', - 'params': [ - { - 'name': 'html', - 'description': '

            inner HTML for the new <div></div> element.

            \n', - 'type': 'String', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createP': { - 'name': 'createP', - 'params': [ - { - 'name': 'html', - 'description': '

            inner HTML for the new <p></p> element.

            \n', - 'type': 'String', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createSpan': { - 'name': 'createSpan', - 'params': [ - { - 'name': 'html', - 'description': '

            inner HTML for the new <span></span> element.

            \n', - 'type': 'String', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createImg': { - 'name': 'createImg', - 'class': 'p5', - 'module': 'DOM', - 'overloads': [ - { - 'params': [ - { - 'name': 'src', - 'description': '

            relative path or URL for the image.

            \n', - 'type': 'String' - }, - { - 'name': 'alt', - 'description': '

            alternate text for the image.

            \n', - 'type': 'String' - } - ] - }, - { - 'params': [ - { - 'name': 'src', - 'description': '', - 'type': 'String' - }, - { - 'name': 'alt', - 'description': '', - 'type': 'String' - }, - { - 'name': 'crossOrigin', - 'description': '

            crossOrigin property to use when fetching the image.

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'successCallback', - 'description': '

            function to call once the image loads. The new image will be passed\n to the function as a p5.Element object.

            \n', - 'type': 'Function', - 'optional': true - } - ] - } - ] - }, - 'createA': { - 'name': 'createA', - 'params': [ - { - 'name': 'href', - 'description': '

            URL of linked page.

            \n', - 'type': 'String' - }, - { - 'name': 'html', - 'description': '

            inner HTML of link element to display.

            \n', - 'type': 'String' - }, - { - 'name': 'target', - 'description': '

            target where the new link should open,\n either \'_blank\', \'_self\', \'_parent\', or \'_top\'.

            \n', - 'type': 'String', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'step', - 'description': '

            size for each step in the slider\'s range.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createCheckbox': { - 'name': 'createCheckbox', - 'params': [ - { - 'name': 'label', - 'description': '

            label displayed after the checkbox.

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'value', - 'description': '

            value of the checkbox. Checked is true and unchecked is false.

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createSelect': { - 'name': 'createSelect', - 'class': 'p5', - 'module': 'DOM', - 'overloads': [ - { - 'params': [ - { - 'name': 'multiple', - 'description': '

            support multiple selections.

            \n', - 'type': 'Boolean', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'existing', - 'description': '

            select element to wrap, either as a p5.Element or\n a HTMLSelectElement.

            \n', - 'type': 'Object' - } - ] - } - ] - }, - 'createRadio': { - 'name': 'createRadio', - 'class': 'p5', - 'module': 'DOM', - 'overloads': [ - { - 'params': [ - { - 'name': 'containerElement', - 'description': '

            container HTML Element, either a <div></div>\nor <span></span>.

            \n', - 'type': 'Object', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'name', - 'description': '

            name parameter assigned to each option\'s <input></input> element.

            \n', - 'type': 'String', - 'optional': true - } - ] - }, - { - 'params': [ - ] - } - ] - }, - 'createColorPicker': { - 'name': 'createColorPicker', - 'params': [ - { - 'name': 'value', - 'description': '

            default color as a CSS color string.

            \n', - 'type': 'String|p5.Color', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createInput': { - 'name': 'createInput', - 'class': 'p5', - 'module': 'DOM', - 'overloads': [ - { - 'params': [ - { - 'name': 'value', - 'description': '

            default value of the input box. Defaults to an empty string \'\'.

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'type', - 'description': '

            type of input. Defaults to \'text\'.

            \n', - 'type': 'String', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'value', - 'description': '', - 'type': 'String', - 'optional': true - } - ] - } - ] - }, - 'createFileInput': { - 'name': 'createFileInput', - 'params': [ - { - 'name': 'callback', - 'description': '

            function to call once the file loads.

            \n', - 'type': 'Function' - }, - { - 'name': 'multiple', - 'description': '

            allow multiple files to be selected.

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createVideo': { - 'name': 'createVideo', - 'params': [ - { - 'name': 'src', - 'description': '

            path to a video file, or an array of paths for\n supporting different browsers.

            \n', - 'type': 'String|String[]' - }, - { - 'name': 'callback', - 'description': '

            function to call once the video is ready to play.

            \n', - 'type': 'Function', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createAudio': { - 'name': 'createAudio', - 'params': [ - { - 'name': 'src', - 'description': '

            path to an audio file, or an array of paths\n for supporting different browsers.

            \n', - 'type': 'String|String[]', - 'optional': true - }, - { - 'name': 'callback', - 'description': '

            function to call once the audio is ready to play.

            \n', - 'type': 'Function', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'DOM' - }, - 'createCapture': { - 'name': 'createCapture', - 'params': [ - { - 'name': 'type', - 'description': '

            type of capture, either AUDIO or VIDEO,\n or a constraints object. Both video and audio\n audio streams are captured by default.

            \n', - 'type': 'String|Constant|Object', - 'optional': true - }, - { - 'name': 'callback', - 'description': '

            function to call once the stream\n has loaded.

            \n', - 'type': 'Function', - 'optional': true - } - ], - '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 insert into the element.

            \n', - 'type': 'String', - 'optional': true - } - ], - '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', - 'params': [ - { - 'name': 'event', - 'description': '

            optional KeyboardEvent callback argument.

            \n', - 'type': 'KeyboardEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'keyReleased': { - 'name': 'keyReleased', - 'params': [ - { - 'name': 'event', - 'description': '

            optional KeyboardEvent callback argument.

            \n', - 'type': 'KeyboardEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'keyTyped': { - 'name': 'keyTyped', - 'params': [ - { - 'name': 'event', - 'description': '

            optional KeyboardEvent callback argument.

            \n', - 'type': 'KeyboardEvent', - 'optional': true - } - ], - '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': 'MouseEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'mouseDragged': { - 'name': 'mouseDragged', - 'params': [ - { - 'name': 'event', - 'description': '

            optional MouseEvent callback argument.

            \n', - 'type': 'MouseEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'mousePressed': { - 'name': 'mousePressed', - 'params': [ - { - 'name': 'event', - 'description': '

            optional MouseEvent callback argument.

            \n', - 'type': 'MouseEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'mouseReleased': { - 'name': 'mouseReleased', - 'params': [ - { - 'name': 'event', - 'description': '

            optional MouseEvent callback argument.

            \n', - 'type': 'MouseEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'mouseClicked': { - 'name': 'mouseClicked', - 'params': [ - { - 'name': 'event', - 'description': '

            optional MouseEvent callback argument.

            \n', - 'type': 'MouseEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'doubleClicked': { - 'name': 'doubleClicked', - 'params': [ - { - 'name': 'event', - 'description': '

            optional MouseEvent callback argument.

            \n', - 'type': 'MouseEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'mouseWheel': { - 'name': 'mouseWheel', - 'params': [ - { - 'name': 'event', - 'description': '

            optional WheelEvent callback argument.

            \n', - 'type': 'WheelEvent', - 'optional': true - } - ], - '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': 'TouchEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'touchMoved': { - 'name': 'touchMoved', - 'params': [ - { - 'name': 'event', - 'description': '

            optional TouchEvent callback argument.

            \n', - 'type': 'TouchEvent', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Events' - }, - 'touchEnded': { - 'name': 'touchEnded', - 'params': [ - { - 'name': 'event', - 'description': '

            optional TouchEvent callback argument.

            \n', - 'type': 'TouchEvent', - 'optional': true - } - ], - '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': '

            reference to a\n specific HTML5 canvas element.

            \n', - 'type': 'p5.Framebuffer|p5.Element|HTMLCanvasElement' - }, - { - 'name': 'filename', - 'description': '

            file name. Defaults to \'untitled\'.

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'extension', - 'description': '

            file extension, either \'jpg\' or \'png\'. Defaults to \'png\'.

            \n', - 'type': 'String', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'filename', - 'description': '', - 'type': 'String', - 'optional': true - }, - { - 'name': 'extension', - 'description': '', - 'type': 'String', - 'optional': true - } - ] - } - ] - }, - 'saveFrames': { - 'name': 'saveFrames', - 'params': [ - { - 'name': 'filename', - 'description': '

            prefix of file name.

            \n', - 'type': 'String' - }, - { - 'name': 'extension', - 'description': '

            file extension, either \'jpg\' or \'png\'.

            \n', - 'type': 'String' - }, - { - 'name': 'duration', - 'description': '

            duration in seconds to record. This parameter will be constrained to be less or equal to 15.

            \n', - 'type': 'Number' - }, - { - 'name': 'framerate', - 'description': '

            number of frames to save per second. This parameter will be constrained to be less or equal to 22.

            \n', - 'type': 'Number' - }, - { - 'name': 'callback', - 'description': '

            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, filename, and extension.

            \n', - 'type': 'Function(Array)', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Image' - }, - 'loadImage': { - 'name': 'loadImage', - 'params': [ - { - 'name': 'path', - 'description': '

            path of the image to be loaded or base64 encoded image.

            \n', - 'type': 'String' - }, - { - 'name': 'successCallback', - 'description': '

            function called with\n p5.Image once it\n loads.

            \n', - 'type': 'function(p5.Image)', - 'optional': true - }, - { - 'name': 'failureCallback', - 'description': '

            function called with event\n error if the image fails to load.

            \n', - 'type': 'Function(Event)', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Image' - }, - 'saveGif': { - 'name': 'saveGif', - 'params': [ - { - 'name': 'filename', - 'description': '

            file name of gif.

            \n', - 'type': 'String' - }, - { - 'name': 'duration', - 'description': '

            duration in seconds to capture from the sketch.

            \n', - 'type': 'Number' - }, - { - 'name': 'options', - 'description': '

            an object that can contain five more properties:\n delay, a Number specifying how much time to wait before recording;\n units, a String that can be either \'seconds\' or \'frames\'. By default it\'s \'seconds’;\n silent, a Boolean that defines presence of progress notifications. By default it’s false;\n notificationDuration, a Number that defines how long in seconds the final notification\n will live. By default it\'s 0, meaning the notification will never be removed;\n notificationID, a String that specifies the id of the notification\'s DOM element. By default it’s \'progressBar’.

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Image' - }, - 'image': { - 'name': 'image', - 'class': 'p5', - 'module': 'Image', - 'overloads': [ - { - 'params': [ - { - 'name': 'img', - 'description': '

            image to display.

            \n', - 'type': 'p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture' - }, - { - 'name': 'x', - 'description': '

            x-coordinate of the top-left corner of the image.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the top-left corner of the image.

            \n', - 'type': 'Number' - }, - { - 'name': 'width', - 'description': '

            width to draw the image.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'height', - 'description': '

            height to draw the image.

            \n', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'img', - 'description': '', - 'type': 'p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture' - }, - { - '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': true - }, - { - 'name': 'sHeight', - 'description': '

            the height of the subsection of the\n source image to draw into the destination rectangle

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'fit', - 'description': '

            either CONTAIN or COVER

            \n', - 'type': 'Constant', - 'optional': true - }, - { - 'name': 'xAlign', - 'description': '

            either LEFT, RIGHT or CENTER default is CENTER

            \n', - 'type': 'Constant', - 'optional': true - }, - { - 'name': 'yAlign', - 'description': '

            either TOP, BOTTOM or CENTER default is CENTER

            \n', - 'type': 'Constant', - 'optional': true - } - ] - } - ] - }, - 'tint': { - 'name': 'tint', - 'class': 'p5', - 'module': 'Image', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red or hue value.

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green or saturation value.

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue or brightness.

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            CSS color string.

            \n', - 'type': 'String' - } - ] - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            grayscale value.

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'values', - 'description': '

            array containing the red, green, blue &\n 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', - 'class': 'p5', - 'module': 'Image', - 'overloads': [ - { - 'params': [ - { - 'name': 'filterType', - 'description': '

            either THRESHOLD, GRAY, OPAQUE, INVERT,\n POSTERIZE, BLUR, ERODE, DILATE or BLUR.

            \n', - 'type': 'Constant' - }, - { - 'name': 'filterParam', - 'description': '

            parameter unique to each filter.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'useWebGL', - 'description': '

            flag to control whether to use fast\n WebGL filters (GPU) or original image\n filters (CPU); defaults to true.

            \n', - 'type': 'Boolean', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'filterType', - 'description': '', - 'type': 'Constant' - }, - { - 'name': 'useWebGL', - 'description': '', - 'type': 'Boolean', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'shaderFilter', - 'description': '

            shader that\'s been loaded, with the\n frag shader using a tex0 uniform.

            \n', - 'type': 'p5.Shader' - } - ] - } - ] - }, - '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 of the subsection to be returned.

            \n', - 'type': 'Number' - }, - { - 'name': 'h', - 'description': '

            height of the subsection to be returned.

            \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': '

            grayscale value | pixel array |\n p5.Color object | 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': true - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the upper-left corner of region\n to update.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'w', - 'description': '

            width of region to update.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'h', - 'description': '

            height of region to update.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'datatype', - 'description': '

            "json" or "jsonp"

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'callback', - 'description': '

            function to be executed after\n loadJSON() completes, data is passed\n in as first argument

            \n', - 'type': 'Function', - 'optional': true - }, - { - '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': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'datatype', - 'description': '', - 'type': 'String' - }, - { - 'name': 'callback', - 'description': '', - 'type': 'Function', - 'optional': true - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'callback', - 'description': '', - 'type': 'Function' - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - } - ] - }, - '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': true - }, - { - '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': true - } - ], - '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': true - }, - { - 'name': 'header', - 'description': '

            "header" to indicate table has header row

            \n', - 'type': 'String', - 'optional': true - }, - { - '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': true - }, - { - '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': true - } - ], - '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': true - }, - { - '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': true - } - ], - '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': true - }, - { - 'name': 'errorCallback', - 'description': '

            function to be executed if there\n is an error

            \n', - 'type': 'Function', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'data', - 'description': '

            param data passed sent with request

            \n', - 'type': 'Object|Boolean', - 'optional': true - }, - { - 'name': 'callback', - 'description': '

            function to be executed after\n httpGet() completes, data is passed in\n as first argument

            \n', - 'type': 'Function', - 'optional': true - }, - { - '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': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'data', - 'description': '', - 'type': 'Object|Boolean' - }, - { - 'name': 'callback', - 'description': '', - 'type': 'Function', - 'optional': true - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'callback', - 'description': '', - 'type': 'Function' - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - } - ] - }, - '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': true - }, - { - 'name': 'data', - 'description': '

            param data passed sent with request

            \n', - 'type': 'Object|Boolean', - 'optional': true - }, - { - 'name': 'callback', - 'description': '

            function to be executed after\n httpPost() completes, data is passed in\n as first argument

            \n', - 'type': 'Function', - 'optional': true - }, - { - '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': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'data', - 'description': '', - 'type': 'Object|Boolean' - }, - { - 'name': 'callback', - 'description': '', - 'type': 'Function', - 'optional': true - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'callback', - 'description': '', - 'type': 'Function' - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - } - ] - }, - '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': true - }, - { - 'name': 'datatype', - 'description': '

            "json", "jsonp", "xml", or "text"

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'data', - 'description': '

            param data passed sent with request

            \n', - 'type': 'Object', - 'optional': true - }, - { - 'name': 'callback', - 'description': '

            function to be executed after\n httpGet() completes, data is passed in\n as first argument

            \n', - 'type': 'Function', - 'optional': true - }, - { - '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': true - } - ] - }, - { - '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': true - }, - { - 'name': 'errorCallback', - 'description': '', - 'type': 'Function', - 'optional': true - } - ] - } - ] - }, - 'createWriter': { - 'name': 'createWriter', - 'params': [ - { - 'name': 'name', - 'description': '

            name of the file to be created

            \n', - 'type': 'String' - }, - { - 'name': 'extension', - 'description': '', - 'type': 'String', - 'optional': true - } - ], - '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': true - }, - { - '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': true - }, - { - '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': true - } - ], - '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': true - } - ], - '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': true - }, - { - 'name': 'isCRLF', - 'description': '

            if true, change line-break to CRLF

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - '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': true - } - ], - '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': 'x', - 'description': '

            first component.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            second component.

            \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': true - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'max': { - 'name': 'max', - 'class': 'p5', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'n0', - 'description': '

            first number to compare.

            \n', - 'type': 'Number' - }, - { - 'name': 'n1', - 'description': '

            second 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': '

            first number to compare.

            \n', - 'type': 'Number' - }, - { - 'name': 'n1', - 'description': '

            second 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': true - } - ], - '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': 'n', - 'description': '

            number whose fractional part will be found.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'createVector': { - 'name': 'createVector', - 'params': [ - { - 'name': 'x', - 'description': '

            x component of the vector.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'y', - 'description': '

            y component of the vector.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'z', - 'description': '

            z component of the vector.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'z', - 'description': '

            z-coordinate in noise space.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': '

            seed value.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'randomSeed': { - 'name': 'randomSeed', - 'params': [ - { - 'name': 'seed', - 'description': '

            seed value.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'random': { - 'name': 'random', - 'class': 'p5', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'min', - 'description': '

            lower bound (inclusive).

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'max', - 'description': '

            upper bound (exclusive).

            \n', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'choices', - 'description': '

            array to choose from.

            \n', - 'type': 'Array' - } - ] - } - ] - }, - 'randomGaussian': { - 'name': 'randomGaussian', - 'params': [ - { - 'name': 'mean', - 'description': '

            mean.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'sd', - 'description': '

            standard deviation.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'acos': { - 'name': 'acos', - 'params': [ - { - 'name': 'value', - 'description': '

            value whose arc cosine is to be returned.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'asin': { - 'name': 'asin', - 'params': [ - { - 'name': 'value', - 'description': '

            value whose arc sine is to be returned.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'atan': { - 'name': 'atan', - 'params': [ - { - 'name': 'value', - 'description': '

            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': '

            radians value to convert to degrees.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'radians': { - 'name': 'radians', - 'params': [ - { - 'name': 'degrees', - 'description': '

            degree value to convert to radians.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': 'Math' - }, - 'angleMode': { - 'name': 'angleMode', - 'class': 'p5', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'mode', - 'description': '

            either RADIANS or DEGREES.

            \n', - 'type': 'Constant' - } - ] - }, - { - 'params': [ - ] - } - ] - }, - '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': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - ] - } - ] - }, - 'textLeading': { - 'name': 'textLeading', - 'class': 'p5', - 'module': 'Typography', - 'overloads': [ - { - 'params': [ - { - 'name': 'leading', - 'description': '

            spacing between lines of text in units of pixels.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - ] - } - ] - }, - 'textSize': { - 'name': 'textSize', - 'class': 'p5', - 'module': 'Typography', - 'overloads': [ - { - 'params': [ - { - 'name': 'size', - 'description': '

            size of the letters in units of pixels

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - ] - } - ] - }, - 'textStyle': { - 'name': 'textStyle', - 'class': 'p5', - 'module': 'Typography', - 'overloads': [ - { - 'params': [ - { - 'name': 'style', - 'description': '

            styling for text, either NORMAL,\n ITALIC, BOLD or BOLDITALIC

            \n', - 'type': 'Constant' - } - ], - 'chainable': 1 - }, - { - 'params': [ - ] - } - ] - }, - 'textWidth': { - 'name': 'textWidth', - 'params': [ - { - 'name': 'str', - 'description': '

            string of text to measure.

            \n', - 'type': 'String' - } - ], - 'class': 'p5', - 'module': 'Typography' - }, - 'textAscent': { - 'name': 'textAscent', - 'class': 'p5', - 'module': 'Typography' - }, - 'textDescent': { - 'name': 'textDescent', - 'class': 'p5', - 'module': 'Typography' - }, - 'textWrap': { - 'name': 'textWrap', - 'params': [ - { - 'name': 'style', - 'description': '

            text wrapping style, either WORD or CHAR.

            \n', - 'type': 'Constant' - } - ], - 'class': 'p5', - 'module': 'Typography' - }, - 'loadFont': { - 'name': 'loadFont', - 'params': [ - { - 'name': 'path', - 'description': '

            path of the font to be loaded.

            \n', - 'type': 'String' - }, - { - 'name': 'successCallback', - 'description': '

            function called with the\n p5.Font object after it\n loads.

            \n', - 'type': 'Function', - 'optional': true - }, - { - 'name': 'failureCallback', - 'description': '

            function called with the error\n Event\n object if the font fails to load.

            \n', - 'type': 'Function', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Typography' - }, - 'text': { - 'name': 'text', - 'params': [ - { - 'name': 'str', - 'description': '

            text to be displayed.

            \n', - 'type': 'String|Object|Array|Number|Boolean' - }, - { - 'name': 'x', - 'description': '

            x-coordinate of the text box.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the text box.

            \n', - 'type': 'Number' - }, - { - 'name': 'maxWidth', - 'description': '

            maximum width of the text box. See\n rectMode() for\n other options.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'maxHeight', - 'description': '

            maximum height of the text box. See\n rectMode() for\n other options.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Typography' - }, - 'textFont': { - 'name': 'textFont', - 'class': 'p5', - 'module': 'Typography', - 'overloads': [ - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'font', - 'description': '

            font as a p5.Font object or a string.

            \n', - 'type': 'Object|String' - }, - { - 'name': 'size', - 'description': '

            font size in pixels.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ] - } - ] - }, - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ] - }, - { - 'params': [ - { - 'name': 'ns', - 'description': '

            values to parse

            \n', - 'type': 'Array' - }, - { - 'name': 'radix', - 'description': '', - 'type': 'Integer', - 'optional': true - } - ] - } - ] - }, - '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': true - } - ] - }, - { - 'params': [ - { - 'name': 'ns', - 'description': '

            array of values to parse

            \n', - 'type': 'Number[]' - }, - { - 'name': 'digits', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - } - ] - }, - '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': true - }, - { - 'name': 'right', - 'description': '

            number of digits to the right of the\n decimal point

            \n', - 'type': 'Integer|String', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'nums', - 'description': '

            the Numbers to format

            \n', - 'type': 'Array' - }, - { - 'name': 'left', - 'description': '', - 'type': 'Integer|String', - 'optional': true - }, - { - 'name': 'right', - 'description': '', - 'type': 'Integer|String', - 'optional': true - } - ] - } - ] - }, - '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': true - } - ] - }, - { - 'params': [ - { - 'name': 'nums', - 'description': '

            the Numbers to format

            \n', - 'type': 'Array' - }, - { - 'name': 'right', - 'description': '', - 'type': 'Integer|String', - 'optional': true - } - ] - } - ] - }, - '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': true - }, - { - 'name': 'right', - 'description': '

            number of digits to the right of the\n decimal point

            \n', - 'type': 'Integer', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'nums', - 'description': '

            the Numbers to format

            \n', - 'type': 'Number[]' - }, - { - 'name': 'left', - 'description': '', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'right', - 'description': '', - 'type': 'Integer', - 'optional': true - } - ] - } - ] - }, - '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': true - }, - { - 'name': 'right', - 'description': '

            number of digits to the right of the\n decimal point

            \n', - 'type': 'Integer', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'nums', - 'description': '

            the Numbers to format

            \n', - 'type': 'Array' - }, - { - 'name': 'left', - 'description': '', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'right', - 'description': '', - 'type': 'Integer', - 'optional': true - } - ] - } - ] - }, - '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': true - } - ], - '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' - }, - 'beginGeometry': { - 'name': 'beginGeometry', - 'class': 'p5', - 'module': 'Shape' - }, - 'endGeometry': { - 'name': 'endGeometry', - 'class': 'p5', - 'module': 'Shape' - }, - 'buildGeometry': { - 'name': 'buildGeometry', - 'params': [ - { - 'name': 'callback', - 'description': '

            A function that draws shapes.

            \n', - 'type': 'Function' - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'freeGeometry': { - 'name': 'freeGeometry', - 'params': [ - { - 'name': 'geometry', - 'description': '

            The geometry whose resources should be freed

            \n', - 'type': 'p5.Geometry' - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'plane': { - 'name': 'plane', - 'params': [ - { - 'name': 'width', - 'description': '

            width of the plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'height', - 'description': '

            height of the plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'detailX', - 'description': '

            Optional number of triangle\n subdivisions in x-dimension

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            Optional number of triangle\n subdivisions in y-dimension

            \n', - 'type': 'Integer', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'box': { - 'name': 'box', - 'params': [ - { - 'name': 'width', - 'description': '

            width of the box

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'height', - 'description': '

            height of the box

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'depth', - 'description': '

            depth of the box

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'detailX', - 'description': '

            Optional number of triangle\n subdivisions in x-dimension

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            Optional number of triangle\n subdivisions in y-dimension

            \n', - 'type': 'Integer', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'sphere': { - 'name': 'sphere', - 'params': [ - { - 'name': 'radius', - 'description': '

            radius of circle

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'detailX', - 'description': '

            optional number of subdivisions in x-dimension

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            optional number of subdivisions in y-dimension

            \n', - 'type': 'Integer', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'cylinder': { - 'name': 'cylinder', - 'params': [ - { - 'name': 'radius', - 'description': '

            radius of the surface

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'height', - 'description': '

            height of the cylinder

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'detailX', - 'description': '

            number of subdivisions in x-dimension;\n default is 24

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            number of subdivisions in y-dimension;\n default is 1

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'bottomCap', - 'description': '

            whether to draw the bottom of the cylinder

            \n', - 'type': 'Boolean', - 'optional': true - }, - { - 'name': 'topCap', - 'description': '

            whether to draw the top of the cylinder

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'cone': { - 'name': 'cone', - 'params': [ - { - 'name': 'radius', - 'description': '

            radius of the bottom surface

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'height', - 'description': '

            height of the cone

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'detailX', - 'description': '

            number of segments,\n the more segments the smoother geometry\n default is 24

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            number of segments,\n the more segments the smoother geometry\n default is 1

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'cap', - 'description': '

            whether to draw the base of the cone

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'ellipsoid': { - 'name': 'ellipsoid', - 'params': [ - { - 'name': 'radiusx', - 'description': '

            x-radius of ellipsoid

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'radiusy', - 'description': '

            y-radius of ellipsoid

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'radiusz', - 'description': '

            z-radius of ellipsoid

            \n', - 'type': 'Number', - 'optional': true - }, - { - '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': true - }, - { - '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': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'torus': { - 'name': 'torus', - 'params': [ - { - 'name': 'radius', - 'description': '

            radius of the whole ring

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'tubeRadius', - 'description': '

            radius of the tube

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'detailX', - 'description': '

            number of segments in x-dimension,\n the more segments the smoother geometry\n default is 24

            \n', - 'type': 'Integer', - 'optional': true - }, - { - 'name': 'detailY', - 'description': '

            number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16

            \n', - 'type': 'Integer', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - 'orbitControl': { - 'name': 'orbitControl', - 'params': [ - { - 'name': 'sensitivityX', - 'description': '

            sensitivity to mouse movement along X axis

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'sensitivityY', - 'description': '

            sensitivity to mouse movement along Y axis

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'sensitivityZ', - 'description': '

            sensitivity to scroll movement along Z axis

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'options', - 'description': '

            An optional object that can contain additional settings,\ndisableTouchActions - Boolean, default value is true.\nSetting this to true makes mobile interactions smoother by preventing\naccidental interactions with the page while orbiting. But if you\'re already\ndoing it via css or want the default touch actions, consider setting it to false.\nfreeRotation - Boolean, default value is false.\nBy default, horizontal movement of the mouse or touch pointer rotates the camera\naround the y-axis, and vertical movement rotates the camera around the x-axis.\nBut if setting this option to true, the camera always rotates in the direction\nthe pointer is moving. For zoom and move, the behavior is the same regardless of\ntrue/false.

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'debugMode': { - 'name': 'debugMode', - 'class': 'p5', - 'module': '3D', - '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': true - }, - { - 'name': 'gridDivisions', - 'description': '

            number of divisions in the grid

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'xOff', - 'description': '

            X axis offset from origin (0,0,0)

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'yOff', - 'description': '

            Y axis offset from origin (0,0,0)

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'zOff', - 'description': '

            Z axis offset from origin (0,0,0)

            \n', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'mode', - 'description': '', - 'type': 'Constant' - }, - { - 'name': 'axesSize', - 'description': '

            size of axes icon

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'xOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'yOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'zOff', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'gridSize', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'gridDivisions', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'gridXOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'gridYOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'gridZOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'axesSize', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'axesXOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'axesYOff', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'axesZOff', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - } - ] - }, - 'noDebugMode': { - 'name': 'noDebugMode', - 'class': 'p5', - 'module': '3D' - }, - 'ambientLight': { - 'name': 'ambientLight', - 'class': 'p5', - 'module': '3D', - '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': '

            alpha value relative to current\n color range (default is 0-255)

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            number specifying value between\n white and black

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            a color string

            \n', - 'type': 'String' - } - ], - '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': '

            color as a p5.Color

            \n', - 'type': 'p5.Color' - } - ], - 'chainable': 1 - } - ] - }, - 'specularColor': { - 'name': 'specularColor', - 'class': 'p5', - 'module': '3D', - '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': 'gray', - 'description': '

            number specifying value between\n white and black

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            color as a CSS string

            \n', - 'type': 'String' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'values', - 'description': '

            color as an array containing the\n red, green, and blue components

            \n', - 'type': 'Number[]' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color

            \n', - 'type': 'p5.Color' - } - ], - 'chainable': 1 - } - ] - }, - 'directionalLight': { - 'name': 'directionalLight', - 'class': 'p5', - 'module': '3D', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red or hue value relative to the current\n color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green or saturation value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue or brightness value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'x', - 'description': '

            x component of direction (inclusive range of -1 to 1)

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component of direction (inclusive range of -1 to 1)

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            z component of direction (inclusive range of -1 to 1)

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v1', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'direction', - 'description': '

            direction of light as a\n p5.Vector

            \n', - 'type': 'p5.Vector' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color,\n as an array, or as a CSS string

            \n', - 'type': 'p5.Color|Number[]|String' - }, - { - 'name': 'x', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '', - 'type': 'p5.Color|Number[]|String' - }, - { - 'name': 'direction', - 'description': '', - 'type': 'p5.Vector' - } - ], - 'chainable': 1 - } - ] - }, - 'pointLight': { - 'name': 'pointLight', - 'class': 'p5', - 'module': '3D', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red or hue value relative to the current\n color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green or saturation value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue or brightness value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'x', - 'description': '

            x component of position

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component of position

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            z component of 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': '

            of light as a p5.Vector

            \n', - 'type': 'p5.Vector' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color,\n as an array, or as a CSS string

            \n', - 'type': 'p5.Color|Number[]|String' - }, - { - 'name': 'x', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '', - 'type': 'p5.Color|Number[]|String' - }, - { - 'name': 'position', - 'description': '', - 'type': 'p5.Vector' - } - ], - 'chainable': 1 - } - ] - }, - 'imageLight': { - 'name': 'imageLight', - 'params': [ - { - 'name': 'img', - 'description': '

            image for the background

            \n', - 'type': 'p5.image' - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'lights': { - 'name': 'lights', - 'class': 'p5', - 'module': '3D' - }, - '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': '3D' - }, - 'spotLight': { - 'name': 'spotLight', - 'class': 'p5', - 'module': '3D', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red or hue value relative to the current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green or saturation value relative to the current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue or brightness value relative to the current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'x', - 'description': '

            x component of position

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component of position

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            z component of position

            \n', - 'type': 'Number' - }, - { - 'name': 'rx', - 'description': '

            x component of light direction (inclusive range of -1 to 1)

            \n', - 'type': 'Number' - }, - { - 'name': 'ry', - 'description': '

            y component of light direction (inclusive range of -1 to 1)

            \n', - 'type': 'Number' - }, - { - 'name': 'rz', - 'description': '

            z component of light direction (inclusive range of -1 to 1)

            \n', - 'type': 'Number' - }, - { - 'name': 'angle', - 'description': '

            angle of cone. Defaults to PI/3

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'concentration', - 'description': '

            concentration of cone. Defaults to 100

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color,\n as an array, or as a CSS string

            \n', - 'type': 'p5.Color|Number[]|String' - }, - { - 'name': 'position', - 'description': '

            position of light as a p5.Vector

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'direction', - 'description': '

            direction of light as a p5.Vector

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'angle', - 'description': '', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - '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': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'color', - 'description': '', - 'type': 'p5.Color|Number[]|String' - }, - { - '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': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'color', - 'description': '', - 'type': 'p5.Color|Number[]|String' - }, - { - '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': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - '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': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - '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': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'color', - 'description': '', - 'type': 'p5.Color|Number[]|String' - }, - { - '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': true - }, - { - 'name': 'concentration', - 'description': '', - 'type': 'Number', - 'optional': true - } - ] - } - ] - }, - 'noLights': { - 'name': 'noLights', - 'class': 'p5', - 'module': '3D' - }, - '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': true - }, - { - 'name': 'failureCallback', - 'description': '

            called with event error if\n the model fails to load.

            \n', - 'type': 'Function(Event)', - 'optional': true - }, - { - 'name': 'fileType', - 'description': '

            The file extension of the model\n (.stl, .obj).

            \n', - 'type': 'String', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'path', - 'description': '', - 'type': 'String' - }, - { - 'name': 'successCallback', - 'description': '', - 'type': 'function(p5.Geometry)', - 'optional': true - }, - { - 'name': 'failureCallback', - 'description': '', - 'type': 'Function(Event)', - 'optional': true - }, - { - 'name': 'fileType', - 'description': '', - 'type': 'String', - 'optional': true - } - ] - } - ] - }, - '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 p5.Shader object is passed as the first argument.

            \n', - 'type': 'Function', - 'optional': true - }, - { - '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': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - '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': '3D' - }, - 'createFilterShader': { - 'name': 'createFilterShader', - 'params': [ - { - 'name': 'fragSrc', - 'description': '

            source code for the fragment shader

            \n', - 'type': 'String' - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'shader': { - 'name': 'shader', - 'params': [ - { - 'name': 's', - 'description': '

            the p5.Shader object\nto use for rendering shapes.

            \n', - 'type': 'p5.Shader' - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'resetShader': { - 'name': 'resetShader', - 'class': 'p5', - 'module': '3D' - }, - 'texture': { - 'name': 'texture', - 'params': [ - { - 'name': 'tex', - 'description': '

            image to use as texture

            \n', - 'type': 'p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture' - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'textureMode': { - 'name': 'textureMode', - 'params': [ - { - 'name': 'mode', - 'description': '

            either IMAGE or NORMAL

            \n', - 'type': 'Constant' - } - ], - 'class': 'p5', - 'module': '3D' - }, - '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': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'normalMaterial': { - 'name': 'normalMaterial', - 'class': 'p5', - 'module': '3D' - }, - 'ambientMaterial': { - 'name': 'ambientMaterial', - 'class': 'p5', - 'module': '3D', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red or hue value relative to the current\n color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green or saturation value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue or brightness value relative to the\n current color range

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            number specifying value between\n white and black

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color,\n as an array, or as a CSS string

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'chainable': 1 - } - ] - }, - 'emissiveMaterial': { - 'name': 'emissiveMaterial', - 'class': 'p5', - 'module': '3D', - 'overloads': [ - { - 'params': [ - { - 'name': 'v1', - 'description': '

            red or hue value relative to the current\n color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v2', - 'description': '

            green or saturation value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'v3', - 'description': '

            blue or brightness value relative to the\n current color range

            \n', - 'type': 'Number' - }, - { - 'name': 'alpha', - 'description': '

            alpha value relative to current color\n range (default is 0-255)

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'gray', - 'description': '

            number specifying value between\n white and black

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color,\n as an array, or as a CSS string

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'chainable': 1 - } - ] - }, - 'specularMaterial': { - 'name': 'specularMaterial', - 'class': 'p5', - 'module': '3D', - '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': true - } - ], - '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': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'color', - 'description': '

            color as a p5.Color,\n as an array, or as a CSS string

            \n', - 'type': 'p5.Color|Number[]|String' - } - ], - 'chainable': 1 - } - ] - }, - 'shininess': { - 'name': 'shininess', - 'params': [ - { - 'name': 'shine', - 'description': '

            degree of shininess

            \n', - 'type': 'Number' - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'camera': { - 'name': 'camera', - 'params': [ - { - 'name': 'x', - 'description': '

            camera position value on x axis

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'y', - 'description': '

            camera position value on y axis

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'z', - 'description': '

            camera position value on z axis

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'centerX', - 'description': '

            x coordinate representing center of the sketch

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'centerY', - 'description': '

            y coordinate representing center of the sketch

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'centerZ', - 'description': '

            z coordinate representing center of the sketch

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'upX', - 'description': '

            x component of direction \'up\' from camera

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'upY', - 'description': '

            y component of direction \'up\' from camera

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'upZ', - 'description': '

            z component of direction \'up\' from camera

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - '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': true - }, - { - 'name': 'aspect', - 'description': '

            camera frustum aspect ratio

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'near', - 'description': '

            frustum near plane length

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'far', - 'description': '

            frustum far plane length

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'ortho': { - 'name': 'ortho', - 'params': [ - { - 'name': 'left', - 'description': '

            camera frustum left plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'right', - 'description': '

            camera frustum right plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'bottom', - 'description': '

            camera frustum bottom plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'top', - 'description': '

            camera frustum top plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'near', - 'description': '

            camera frustum near plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'far', - 'description': '

            camera frustum far plane

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'frustum': { - 'name': 'frustum', - 'params': [ - { - 'name': 'left', - 'description': '

            camera frustum left plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'right', - 'description': '

            camera frustum right plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'bottom', - 'description': '

            camera frustum bottom plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'top', - 'description': '

            camera frustum top plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'near', - 'description': '

            camera frustum near plane

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'far', - 'description': '

            camera frustum far plane

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'createCamera': { - 'name': 'createCamera', - 'class': 'p5', - 'module': '3D' - }, - 'setCamera': { - 'name': 'setCamera', - 'params': [ - { - 'name': 'cam', - 'description': '

            p5.Camera object

            \n', - 'type': 'p5.Camera' - } - ], - 'class': 'p5', - 'module': '3D' - }, - 'vertexNormal': { - 'name': 'vertexNormal', - 'params': [ - { - 'name': 'x', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'v', - 'description': '', - 'type': 'Vector' - } - ], - 'class': 'p5', - 'module': 'Shape' - }, - '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' - } - ] - } - ] - }, - 'getAudioContext': { - 'name': 'getAudioContext', - 'class': 'p5', - 'module': 'p5.sound' - }, - 'userStartAudio': { - 'params': [ - { - 'name': 'elements', - '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': true - }, - { - 'name': 'callback', - 'description': '

            Callback to invoke when the AudioContext\n has started

            \n', - 'type': 'Function', - 'optional': true - } - ], - 'name': 'userStartAudio', - 'class': 'p5', - 'module': 'p5.sound' - }, - 'getOutputVolume': { - 'name': 'getOutputVolume', - 'class': 'p5', - 'module': 'p5.sound' - }, - 'outputVolume': { - 'name': 'outputVolume', - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            Schedule this event to happen at\n t seconds in the future

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5', - 'module': 'p5.sound' - }, - 'soundOut': { - 'name': 'soundOut', - 'class': 'p5', - 'module': 'p5.sound' - }, - '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': true, - 'multiple': true - } - ], - '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' - }, - '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': true - }, - { - 'name': 'errorCallback', - 'description': '

            Name of a function to call if there is\n an error loading the file.

            \n', - 'type': 'Function', - 'optional': true - }, - { - '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': true - } - ], - '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': true - }, - { - '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': true - } - ], - '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' - } - }, - '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': true - } - ], - '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' - }, - 'width': { - 'name': 'width', - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'height': { - 'name': 'height', - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'parent': { - 'name': 'parent', - 'class': 'p5.Element', - 'module': 'DOM', - 'overloads': [ - { - 'params': [ - { - 'name': 'parent', - 'description': '

            ID, p5.Element,\n or HTMLElement 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 call when the mouse is\n pressed over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'doubleClicked': { - 'name': 'doubleClicked', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse is\n double clicked over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'mouseWheel': { - 'name': 'mouseWheel', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse wheel is\n scrolled over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'mouseReleased': { - 'name': 'mouseReleased', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse is\n pressed over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'mouseClicked': { - 'name': 'mouseClicked', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse is\n pressed and released over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'mouseMoved': { - 'name': 'mouseMoved', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse\n moves over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'mouseOver': { - 'name': 'mouseOver', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse\n moves onto the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'mouseOut': { - 'name': 'mouseOut', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the mouse\n moves off the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'touchStarted': { - 'name': 'touchStarted', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the touch\n starts.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'touchMoved': { - 'name': 'touchMoved', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the touch\n moves over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'touchEnded': { - 'name': 'touchEnded', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the touch\n ends.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'dragOver': { - 'name': 'dragOver', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the file is\n dragged over the element.\n false disables the function.

            \n', - 'type': 'Function|Boolean' - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'dragLeave': { - 'name': 'dragLeave', - 'params': [ - { - 'name': 'fxn', - 'description': '

            function to call when the file is\n dragged off the element.\n false disables the function.

            \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': true - } - ], - 'chainable': 1 - } - ] - }, - 'center': { - 'name': 'center', - 'params': [ - { - 'name': 'align', - 'description': '

            passing \'vertical\', \'horizontal\' aligns element accordingly

            \n', - 'type': 'String', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'append', - 'description': '

            whether to append HTML to existing

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'y', - 'description': '

            y-position relative to upper left of window (optional)

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'positionType', - 'description': '

            it can be static, fixed, relative, sticky, initial or inherit (optional)

            \n', - 'type': 'String', - 'optional': true - } - ], - 'chainable': 1 - } - ] - }, - 'style': { - 'name': 'style', - 'class': 'p5.Element', - 'module': 'DOM', - 'overloads': [ - { - 'params': [ - { - 'name': 'property', - 'description': '

            style property to set.

            \n', - 'type': 'String' - } - ] - }, - { - 'params': [ - { - 'name': 'property', - 'description': '', - 'type': 'String' - }, - { - 'name': 'value', - 'description': '

            value to assign to the 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 the 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': true - } - ], - 'chainable': 1 - } - ] - }, - 'remove': { - 'name': 'remove', - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'drop': { - 'name': 'drop', - 'params': [ - { - 'name': 'callback', - 'description': '

            called when a file loads. Called once for each file dropped.

            \n', - 'type': 'Function' - }, - { - 'name': 'fxn', - 'description': '

            called once when any files are dropped.

            \n', - 'type': 'Function', - 'optional': true - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - }, - 'draggable': { - 'name': 'draggable', - 'params': [ - { - 'name': 'elmnt', - 'description': '

            pass another p5.Element

            \n', - 'type': 'p5.Element', - 'optional': true - } - ], - 'class': 'p5.Element', - 'module': 'DOM' - } - }, - 'p5.Graphics': { - 'reset': { - 'name': 'reset', - 'class': 'p5.Graphics', - 'module': 'Rendering' - }, - 'remove': { - 'name': 'remove', - 'class': 'p5.Graphics', - 'module': 'Rendering' - }, - 'createFramebuffer': { - 'name': 'createFramebuffer', - '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', - 'optional': true - } - ], - '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 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 playback ends.\n The p5.MediaElement is passed as\n the argument.

            \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': '

            cue time to run the callback function.

            \n', - 'type': 'Number' - }, - { - 'name': 'callback', - 'description': '

            function to call at the cue time.

            \n', - 'type': 'Function' - }, - { - 'name': 'value', - 'description': '

            object to pass as the argument to\n callback.

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5.MediaElement', - 'module': 'DOM' - }, - 'removeCue': { - 'name': 'removeCue', - 'params': [ - { - 'name': 'id', - 'description': '

            ID of the cue, created by media.addCue().

            \n', - 'type': 'Number' - } - ], - 'class': 'p5.MediaElement', - 'module': 'DOM' - }, - 'clearCues': { - 'name': 'clearCues', - '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' - }, - 'pixelDensity': { - 'name': 'pixelDensity', - 'params': [ - { - 'name': 'density', - 'description': '

            A scaling factor for the number of pixels per\nside

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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-coordinate of the upper-left corner\n of the subsection to update.

            \n', - 'type': 'Integer' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the upper-left corner\n of the subsection to update.

            \n', - 'type': 'Integer' - }, - { - 'name': 'w', - 'description': '

            width of the subsection to update.

            \n', - 'type': 'Integer' - }, - { - 'name': 'h', - 'description': '

            height of the subsection to update.

            \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 of the subsection to be returned.

            \n', - 'type': 'Number' - }, - { - 'name': 'h', - 'description': '

            height of the subsection to be returned.

            \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 p5.Color object |\n p5.Image to copy.

            \n', - 'type': 'Number|Number[]|Object' - } - ], - 'class': 'p5.Image', - 'module': 'Image' - }, - 'resize': { - 'name': 'resize', - 'params': [ - { - 'name': 'width', - 'description': '

            resized image width.

            \n', - 'type': 'Number' - }, - { - 'name': 'height', - 'description': '

            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, ERODE, DILATE or BLUR.

            \n', - 'type': 'Constant' - }, - { - 'name': 'filterParam', - 'description': '

            parameter unique to each filter.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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.

            \n

            Available 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

            \n

            http://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': '

            filename. Defaults to \'untitled\'.

            \n', - 'type': 'String' - }, - { - 'name': 'extension', - 'description': '

            file extension, either \'png\' or \'jpg\'.\n Defaults to \'png\'.

            \n', - 'type': 'String', - 'optional': true - } - ], - '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': '

            index of the frame to display.

            \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': '

            delay in milliseconds between switching frames.

            \n', - 'type': 'Number' - }, - { - 'name': 'index', - 'description': '

            index of the frame that will have its delay modified.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - 'class': 'p5.Table', - 'module': 'IO' - }, - 'trim': { - 'name': 'trim', - 'params': [ - { - 'name': 'column', - 'description': '

            Column ID (number)\n or name (string)

            \n', - 'type': 'String|Integer', - 'optional': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': '

            x component of the vector.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'y', - 'description': '

            y component of the vector.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'z', - 'description': '

            z component of the vector.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            vector to set.

            \n', - 'type': 'p5.Vector|Number[]' - } - ], - 'chainable': 1 - } - ] - }, - 'copy': { - 'name': 'copy', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            the p5.Vector to create a copy of

            \n', - 'type': 'p5.Vector' - } - ], - 'static': 1 - } - ] - }, - 'add': { - 'name': 'add', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'x', - 'description': '

            x component of the vector to be added.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component of the vector to be added.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'z', - 'description': '

            z component of the vector to be added.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': '

            vector to receive the result.

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'rem': { - 'name': 'rem', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'x', - 'description': '

            x component of divisor vector.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component of divisor vector.

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            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': '

            The dividend p5.Vector

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'v2', - 'description': '

            The 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': '

            x component of the vector to subtract.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component of the vector to subtract.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'z', - 'description': '

            z component of the vector to subtract.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': '

            vector to receive the result.

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - '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': '

            number to multiply with the x component of the vector.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            number to multiply with the y component of the vector.

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            number to multiply with the z component of the vector.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'arr', - 'description': '

            array to multiply with the components of the vector.

            \n', - 'type': 'Number[]' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            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': true - } - ], - 'static': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'n', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'target', - 'description': '

            vector to receive the result.

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - }, - { - 'params': [ - { - 'name': 'v0', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'v1', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'target', - 'description': '', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - }, - { - 'params': [ - { - 'name': 'v0', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'arr', - 'description': '', - 'type': 'Number[]' - }, - { - 'name': 'target', - 'description': '', - 'type': 'p5.Vector', - 'optional': true - } - ], - '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': '

            number to divide with the x component of the vector.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            number to divide with the y component of the vector.

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            number to divide with the z component of the vector.

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'arr', - 'description': '

            array to divide the components of the vector by.

            \n', - 'type': 'Number[]' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            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': true - } - ], - 'static': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'n', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'target', - 'description': '

            The vector to receive the result

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - }, - { - 'params': [ - { - 'name': 'v0', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'v1', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'target', - 'description': '', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - }, - { - 'params': [ - { - 'name': 'v0', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'arr', - 'description': '', - 'type': 'Number[]' - }, - { - 'name': 'target', - 'description': '', - 'type': 'p5.Vector', - 'optional': true - } - ], - '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', - 'overloads': [ - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'vecT', - 'description': '

            the vector to return the squared magnitude of

            \n', - 'type': 'p5.Vector' - } - ], - 'static': 1 - } - ] - }, - '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': true - }, - { - 'name': 'z', - 'description': '

            z component of the vector.

            \n', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            p5.Vector to be dotted.

            \n', - 'type': 'p5.Vector' - } - ] - }, - { - 'params': [ - { - 'name': 'v1', - 'description': '

            first p5.Vector.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'v2', - 'description': '

            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': '

            first p5.Vector.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'v2', - 'description': '

            second p5.Vector.

            \n', - 'type': 'p5.Vector' - } - ], - 'static': 1 - } - ] - }, - 'dist': { - 'name': 'dist', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'v', - 'description': '

            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', - 'overloads': [ - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            The vector to normalize

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'target', - 'description': '

            The vector to receive the result

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'limit': { - 'name': 'limit', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'max', - 'description': '

            maximum magnitude for the vector.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            the vector to limit

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'max', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'target', - 'description': '

            the vector to receive the result (Optional)

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'setMag': { - 'name': 'setMag', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'len', - 'description': '

            new length for this vector.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            the vector to set the magnitude of

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'len', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'target', - 'description': '

            the vector to receive the result (Optional)

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'heading': { - 'name': 'heading', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            the vector to find the angle of

            \n', - 'type': 'p5.Vector' - } - ], - 'static': 1 - } - ] - }, - 'setHeading': { - 'name': 'setHeading', - 'params': [ - { - 'name': 'angle', - 'description': '

            angle of rotation.

            \n', - 'type': 'Number' - } - ], - 'class': 'p5.Vector', - 'module': 'Math' - }, - 'rotate': { - 'name': 'rotate', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'angle', - 'description': '

            angle of rotation.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'angle', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'target', - 'description': '

            The vector to receive the result

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'angleBetween': { - 'name': 'angleBetween', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'value', - 'description': '

            x, y, and z components of a p5.Vector.

            \n', - 'type': 'p5.Vector' - } - ] - }, - { - 'params': [ - { - 'name': 'v1', - 'description': '

            the first vector.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'v2', - 'description': '

            the second vector.

            \n', - 'type': 'p5.Vector' - } - ], - 'static': 1 - } - ] - }, - 'lerp': { - 'name': 'lerp', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'x', - 'description': '

            x component.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y component.

            \n', - 'type': 'Number' - }, - { - 'name': 'z', - 'description': '

            z component.

            \n', - 'type': 'Number' - }, - { - 'name': 'amt', - 'description': '

            amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

            \n', - 'type': 'Number' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            p5.Vector to lerp toward.

            \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

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'slerp': { - 'name': 'slerp', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'v', - 'description': '

            p5.Vector to slerp toward.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'amt', - 'description': '

            amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

            \n', - 'type': 'Number' - } - ] - }, - { - 'params': [ - { - 'name': 'v1', - 'description': '

            old vector.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'v2', - 'description': '

            new vector.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'amt', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'target', - 'description': '

            vector to receive the result.

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'reflect': { - 'name': 'reflect', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'surfaceNormal', - 'description': '

            p5.Vector\n to reflect about.

            \n', - 'type': 'p5.Vector' - } - ], - 'chainable': 1 - }, - { - 'params': [ - { - 'name': 'incidentVector', - 'description': '

            vector to be reflected.

            \n', - 'type': 'p5.Vector' - }, - { - 'name': 'surfaceNormal', - 'description': '', - 'type': 'p5.Vector' - }, - { - 'name': 'target', - 'description': '

            vector to receive the result.

            \n', - 'type': 'p5.Vector', - 'optional': true - } - ], - 'static': 1 - } - ] - }, - 'array': { - 'name': 'array', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'v', - 'description': '

            the vector to convert to an array

            \n', - 'type': 'p5.Vector' - } - ], - 'static': 1 - } - ] - }, - 'equals': { - 'name': 'equals', - 'class': 'p5.Vector', - 'module': 'Math', - 'overloads': [ - { - 'params': [ - { - 'name': 'x', - 'description': '

            x component of the vector.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'y', - 'description': '

            y component of the vector.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'z', - 'description': '

            z component of the vector.

            \n', - 'type': 'Number', - 'optional': true - } - ] - }, - { - 'params': [ - { - 'name': 'value', - 'description': '

            vector to compare.

            \n', - 'type': 'p5.Vector|Array' - } - ] - }, - { - 'params': [ - { - 'name': 'v1', - 'description': '

            the first vector to compare

            \n', - 'type': 'p5.Vector|Array' - }, - { - 'name': 'v2', - 'description': '

            the second vector to compare

            \n', - 'type': 'p5.Vector|Array' - } - ], - 'static': 1 - } - ] - }, - 'fromAngle': { - 'name': 'fromAngle', - 'params': [ - { - 'name': 'angle', - 'description': '

            desired angle, in radians. Unaffected by angleMode().

            \n', - 'type': 'Number' - }, - { - 'name': 'length', - 'description': '

            length of the new vector (defaults to 1).

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Vector', - 'module': 'Math' - }, - 'fromAngles': { - 'name': 'fromAngles', - 'params': [ - { - 'name': 'theta', - 'description': '

            polar angle in radians (zero is up).

            \n', - 'type': 'Number' - }, - { - 'name': 'phi', - 'description': '

            azimuthal angle in radians\n (zero is out of the screen).

            \n', - 'type': 'Number' - }, - { - 'name': 'length', - 'description': '

            length of the new vector (defaults to 1).

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': 'str', - 'description': '

            string of text.

            \n', - 'type': 'String' - }, - { - 'name': 'x', - 'description': '

            x-coordinate of the text.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the text.

            \n', - 'type': 'Number' - }, - { - 'name': 'fontSize', - 'description': '

            font size. Defaults to the current\n textSize().

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Font', - 'module': 'Typography' - }, - 'textToPoints': { - 'name': 'textToPoints', - 'params': [ - { - 'name': 'str', - 'description': '

            string of text.

            \n', - 'type': 'String' - }, - { - 'name': 'x', - 'description': '

            x-coordinate of the text.

            \n', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '

            y-coordinate of the text.

            \n', - 'type': 'Number' - }, - { - 'name': 'fontSize', - 'description': '

            font size. Defaults to the current\n textSize().

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'options', - 'description': '

            object with sampleFactor and simplifyThreshold\n properties.

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5.Font', - 'module': 'Typography' - } - }, - 'p5.Camera': { - 'eyeX': { - 'name': 'eyeX', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'eyeY': { - 'name': 'eyeY', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'eyeZ': { - 'name': 'eyeZ', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'centerX': { - 'name': 'centerX', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'centerY': { - 'name': 'centerY', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'centerZ': { - 'name': 'centerZ', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'upX': { - 'name': 'upX', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'upY': { - 'name': 'upY', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'upZ': { - 'name': 'upZ', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'perspective': { - 'name': 'perspective', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'ortho': { - 'name': 'ortho', - 'class': 'p5.Camera', - 'module': '3D' - }, - 'frustum': { - 'name': 'frustum', - 'class': 'p5.Camera', - 'module': '3D' - }, - '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': '3D' - }, - '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': '3D' - }, - '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': '3D' - }, - 'camera': { - 'name': 'camera', - 'class': 'p5.Camera', - 'module': '3D' - }, - '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': '3D' - }, - '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': '3D' - }, - 'set': { - 'name': 'set', - 'params': [ - { - 'name': 'cam', - 'description': '

            source camera

            \n', - 'type': 'p5.Camera' - } - ], - 'class': 'p5.Camera', - 'module': '3D' - }, - 'slerp': { - 'name': 'slerp', - 'params': [ - { - 'name': 'cam0', - 'description': '

            first p5.Camera

            \n', - 'type': 'p5.Camera' - }, - { - 'name': 'cam1', - 'description': '

            second p5.Camera

            \n', - 'type': 'p5.Camera' - }, - { - 'name': 'amt', - 'description': '

            amount to use for interpolation during slerp

            \n', - 'type': 'Number' - } - ], - 'class': 'p5.Camera', - 'module': '3D' - } - }, - 'p5.Framebuffer': { - 'pixels': { - 'name': 'pixels', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'resize': { - 'name': 'resize', - 'params': [ - { - 'name': 'width', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'height', - 'description': '', - 'type': 'Number' - } - ], - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'pixelDensity': { - 'name': 'pixelDensity', - 'params': [ - { - 'name': 'density', - 'description': '

            A scaling factor for the number of pixels per\nside of the framebuffer

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'autoSized': { - 'name': 'autoSized', - 'params': [ - { - 'name': 'autoSized', - 'description': '

            Whether or not the framebuffer should resize\nalong with the canvas it\'s attached to

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'createCamera': { - 'name': 'createCamera', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'remove': { - 'name': 'remove', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'begin': { - 'name': 'begin', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'end': { - 'name': 'end', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'draw': { - 'name': 'draw', - 'params': [ - { - 'name': 'callback', - 'description': '

            A function to run that draws to the canvas. The\nfunction will immediately be run, but it will draw to the framebuffer\ninstead of the canvas.

            \n', - 'type': 'Function' - } - ], - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'get': { - 'name': 'get', - 'class': 'p5.Framebuffer', - 'module': 'Rendering', - '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 of the section to be returned

            \n', - 'type': 'Number' - }, - { - 'name': 'h', - 'description': '

            height of the section to be returned

            \n', - 'type': 'Number' - } - ] - }, - { - 'params': [ - ] - }, - { - 'params': [ - { - 'name': 'x', - 'description': '', - 'type': 'Number' - }, - { - 'name': 'y', - 'description': '', - 'type': 'Number' - } - ] - } - ] - }, - 'color': { - 'name': 'color', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - }, - 'depth': { - 'name': 'depth', - 'class': 'p5.Framebuffer', - 'module': 'Rendering' - } - }, - 'p5.Geometry': { - 'clearColors': { - 'name': 'clearColors', - 'class': 'p5.Geometry', - 'module': 'Shape' - }, - 'computeFaces': { - 'name': 'computeFaces', - 'class': 'p5.Geometry', - 'module': 'Shape' - }, - 'computeNormals': { - 'name': 'computeNormals', - 'params': [ - { - 'name': 'shadingType', - 'description': '

            shading type (FLAT for flat shading or SMOOTH for smooth shading) for buildGeometry() outputs. Defaults to FLAT.

            \n', - 'type': 'String', - 'optional': true - }, - { - 'name': 'options', - 'description': '

            An optional object with configuration.

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5.Geometry', - 'module': 'Shape' - }, - 'averageNormals': { - 'name': 'averageNormals', - 'class': 'p5.Geometry', - 'module': 'Shape' - }, - 'averagePoleNormals': { - 'name': 'averagePoleNormals', - 'class': 'p5.Geometry', - 'module': 'Shape' - }, - 'normalize': { - 'name': 'normalize', - 'class': 'p5.Geometry', - 'module': 'Shape' - } - }, - 'p5.Shader': { - 'copyToContext': { - 'name': 'copyToContext', - 'params': [ - { - 'name': 'context', - 'description': '

            The graphic or instance to copy this shader to.\nPass window if you need to copy to the main canvas.

            \n', - 'type': 'p5|p5.Graphics' - } - ], - 'class': 'p5.Shader', - 'module': '3D' - }, - 'setUniform': { - 'name': 'setUniform', - 'params': [ - { - 'name': 'uniformName', - 'description': '

            the name of the uniform.\nMust correspond to the name used in the vertex and fragment shaders

            \n', - 'type': 'String' - }, - { - 'name': 'data', - 'description': '

            the data to associate with the uniform. The type can be\na boolean (true/false), a number, an array of numbers, or\nan image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture)

            \n', - 'type': 'Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture' - } - ], - 'class': 'p5.Shader', - 'module': '3D' - } - }, - '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': true - }, - { - 'name': 'rate', - 'description': '

            (optional) playback rate

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'amp', - 'description': '

            (optional) amplitude (volume)\n of playback

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'cueStart', - 'description': '

            (optional) cue start time in seconds

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'duration', - 'description': '

            (optional) duration of playback in seconds

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - }, - { - 'name': 'rate', - 'description': '

            (optional) playback rate

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'amp', - 'description': '

            (optional) playback volume

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'cueLoopStart', - 'description': '

            (optional) startTime in seconds

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'duration', - 'description': '

            (optional) loop duration in seconds

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - 'class': 'p5.SoundFile', - 'module': 'p5.sound' - }, - 'pan': { - 'name': 'pan', - 'params': [ - { - 'name': 'panValue', - 'description': '

            Set the stereo panner

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'timeFromNow', - 'description': '

            schedule this event to happen\n seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            Schedule this event to happen at\n t seconds in the future

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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' - }, - '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': true - } - ], - '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': true - } - ], - '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 main output)

            \n', - 'type': 'SoundObject|undefined', - 'optional': true - }, - { - 'name': 'smoothing', - 'description': '

            a range between 0.0 and 1.0\n to smooth amplitude readings

            \n', - 'type': 'Number|undefined', - 'optional': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - }, - { - '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': true - } - ], - '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': true - }, - { - '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': true - } - ], - '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': true - } - ], - '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.Oscillator': { - 'start': { - 'name': 'start', - 'params': [ - { - 'name': 'time', - 'description': '

            startTime in seconds from now.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'frequency', - 'description': '

            frequency in Hz.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            schedule this event to happen\n seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Oscillator', - 'module': 'p5.sound' - }, - 'getAmp': { - 'name': 'getAmp', - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            Schedule this event to happen\n at x seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Oscillator', - 'module': 'p5.sound' - }, - 'getFreq': { - 'name': 'getFreq', - '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' - }, - 'getType': { - 'name': 'getType', - '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' - }, - 'getPan': { - 'name': 'getPan', - '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.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': true - }, - { - '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': true - }, - { - 'name': 'releaseTime', - 'description': '

            Time in seconds from now (defaults to 0)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true, - 'multiple': true - } - ], - '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': true - }, - { - 'name': 'sustainTime', - 'description': '

            time to sustain before releasing the envelope

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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.Noise': { - 'setType': { - 'name': 'setType', - 'params': [ - { - 'name': 'type', - 'description': '

            \'white\', \'pink\' or \'brown\'

            \n', - 'type': 'String', - 'optional': true - } - ], - 'class': 'p5.Noise', - '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': true - } - ], - 'class': 'p5.Pulse', - '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': true - }, - { - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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': true - }, - { - 'name': 'errorCallback', - 'description': '

            This optional callback receives the error\n message as its argument.

            \n', - 'type': 'Function', - 'optional': true - } - ], - '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.Effect': { - 'amp': { - 'name': 'amp', - 'params': [ - { - 'name': 'vol', - 'description': '

            amplitude between 0 and 1.0

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'rampTime', - 'description': '

            create a fade that lasts until rampTime

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'tFromNow', - 'description': '

            schedule this event to happen in tFromNow seconds

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Effect', - 'module': 'p5.sound' - }, - 'chain': { - 'name': 'chain', - 'params': [ - { - 'name': 'arguments', - 'description': '

            Chain together multiple sound objects

            \n', - 'type': 'Object', - 'optional': true - } - ], - 'class': 'p5.Effect', - 'module': 'p5.sound' - }, - 'drywet': { - 'name': 'drywet', - 'params': [ - { - 'name': 'fade', - 'description': '

            The desired drywet value (0 - 1.0)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'res', - 'description': '

            Resonance/Width of the filter frequency\n from 0.001 to 1000

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Filter', - 'module': 'p5.sound' - }, - 'set': { - 'name': 'set', - 'params': [ - { - 'name': 'freq', - 'description': '

            Frequency in Hz, from 10 to 22050

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'res', - 'description': '

            Resonance (Q) from 0.001 to 1000

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'timeFromNow', - 'description': '

            schedule this event to happen\n seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - } - ], - '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.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': true - }, - { - 'name': 'rolloffFactor', - 'description': '', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'feedback', - 'description': '

            sends the delay back through itself\n in a loop that decreases in volume\n each time.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'lowPass', - 'description': '

            Cutoff frequency. Only frequencies\n below the lowPass will be part of the\n delay.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            schedule this event to happen\n seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'decayRate', - 'description': '

            Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'reverse', - 'description': '

            Play the reverb backwards or forwards.

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'decayRate', - 'description': '

            Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'reverse', - 'description': '

            Play the reverb backwards or forwards.

            \n', - 'type': 'Boolean', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            schedule this event to happen\n seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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' - }, - 'impulses': { - 'name': 'impulses', - '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' - }, - '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': true - } - ], - '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': true - } - ], - 'class': 'p5.Part', - 'module': 'p5.sound' - }, - 'loop': { - 'name': 'loop', - 'params': [ - { - 'name': 'time', - 'description': '

            seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': { - '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' - }, - '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': true - } - ], - 'class': 'p5.SoundLoop', - 'module': 'p5.sound' - }, - 'stop': { - 'name': 'stop', - 'params': [ - { - 'name': 'timeFromNow', - 'description': '

            schedule a stopping time

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.SoundLoop', - 'module': 'p5.sound' - }, - 'pause': { - 'name': 'pause', - 'params': [ - { - 'name': 'timeFromNow', - 'description': '

            schedule a pausing time

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - }, - { - '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': true - }, - { - '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': true - }, - { - 'name': 'threshold', - 'description': '

            The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0

            \n', - 'type': 'Number', - 'optional': true - }, - { - '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': true - } - ], - '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': true - }, - { - 'name': 'time', - 'description': '

            Assign time value to schedule the change in value

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'time', - 'description': '

            Assign time value to schedule the change in value

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'time', - 'description': '

            Assign time value to schedule the change in value

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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': true - } - ], - 'class': 'p5.Compressor', - 'module': 'p5.sound' - }, - 'reduction': { - 'name': 'reduction', - 'class': 'p5.Compressor', - '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': true - } - ], - 'class': 'p5.PeakDetect', - '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': true - } - ], - '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': true - }, - { - 'name': 'callback', - 'description': '

            The name of a function that will be\n called once the recording completes

            \n', - 'type': 'Function', - 'optional': true - } - ], - 'class': 'p5.SoundRecorder', - 'module': 'p5.sound' - }, - 'stop': { - 'name': 'stop', - 'class': 'p5.SoundRecorder', - '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': true, - 'optdefault': '0.25' - }, - { - 'name': 'oversample', - 'description': '

            \'none\', \'2x\', or \'4x\'.

            \n', - 'type': 'String', - 'optional': true, - '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': true, - 'optdefault': '0.25' - }, - { - 'name': 'oversample', - 'description': '

            \'none\', \'2x\', or \'4x\'.

            \n', - 'type': 'String', - 'optional': true, - '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' - } - }, - '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': true - }, - { - 'name': 'timeFromNow', - 'description': '

            schedule this event to happen\n seconds from now

            \n', - 'type': 'Number', - 'optional': true - } - ], - 'class': 'p5.Gain', - '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.MonoSynth': { - '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' - }, - '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': true - }, - { - 'name': 'secondsFromNow', - 'description': '

            time from now (in seconds) at which to play

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'sustainTime', - 'description': '

            time to sustain before releasing the envelope. Defaults to 0.15 seconds.

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'secondsFromNow', - 'description': '

            time from now (in seconds) at which to play

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - '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': true - }, - { - 'name': 'releaseTime', - 'description': '

            Time in seconds from now (defaults to 0)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - } - ], - '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.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': true - }, - { - 'name': 'velocity', - 'description': '

            velocity of the note to play (ranging from 0 to 1)

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'secondsFromNow', - 'description': '

            time from now (in seconds) at which to play

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'sustainTime', - 'description': '

            time to sustain before releasing the envelope

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'attackTime', - 'description': '

            Time (in seconds before envelope\n reaches Attack Level

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'decayTime', - 'description': '

            Time (in seconds) before envelope\n reaches Decay/Sustain Level

            \n', - 'type': 'Number', - 'optional': true - }, - { - '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': true - }, - { - 'name': 'releaseTime', - 'description': '

            Time in seconds from now (defaults to 0)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'decayTime', - 'description': '

            Time (in seconds) before envelope\n reaches Decay/Sustain Level

            \n', - 'type': 'Number', - 'optional': true - }, - { - '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': true - }, - { - 'name': 'releaseTime', - 'description': '

            Time in seconds from now (defaults to 0)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'velocity', - 'description': '

            velocity of the note to play (ranging from 0 to 1)/

            \n', - 'type': 'Number', - 'optional': true - }, - { - 'name': 'secondsFromNow', - 'description': '

            time from now (in seconds)

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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': true - }, - { - 'name': 'secondsFromNow', - 'description': '

            time to trigger the release

            \n', - 'type': 'Number', - 'optional': true - } - ], - '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' - } - } - } - }, - { - } - ], - 2: [ - function (_dereq_, module, exports) { - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - module.exports = _arrayWithHoles; - }, - { - } - ], - 3: [ - function (_dereq_, module, exports) { - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } - module.exports = _arrayWithoutHoles; - }, - { - } - ], - 4: [ - function (_dereq_, module, exports) { - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - module.exports = _assertThisInitialized; - }, - { - } - ], - 5: [ - function (_dereq_, module, exports) { - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - module.exports = _classCallCheck; - }, - { - } - ], - 6: [ - function (_dereq_, module, exports) { - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - module.exports = _createClass; - }, - { - } - ], - 7: [ - function (_dereq_, module, exports) { - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - module.exports = _defineProperty; - }, - { - } - ], - 8: [ - function (_dereq_, module, exports) { - function _getPrototypeOf(o) { - module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - module.exports = _getPrototypeOf; - }, - { - } - ], - 9: [ - function (_dereq_, module, exports) { - var setPrototypeOf = _dereq_('./setPrototypeOf'); - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) setPrototypeOf(subClass, superClass); - } - module.exports = _inherits; - }, - { - './setPrototypeOf': 16 - } - ], - 10: [ - function (_dereq_, module, exports) { - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - module.exports = _iterableToArray; - }, - { - } - ], - 11: [ - function (_dereq_, module, exports) { - function _iterableToArrayLimit(arr, i) { - var _arr = [ - ]; - var _n = true; - var _d = false; - var _e = undefined; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i['return'] != null) _i['return'](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - module.exports = _iterableToArrayLimit; - }, - { - } - ], - 12: [ - function (_dereq_, module, exports) { - function _nonIterableRest() { - throw new TypeError('Invalid attempt to destructure non-iterable instance'); - } - module.exports = _nonIterableRest; - }, - { - } - ], - 13: [ - function (_dereq_, module, exports) { - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - module.exports = _nonIterableSpread; - }, - { - } - ], - 14: [ - function (_dereq_, module, exports) { - var defineProperty = _dereq_('./defineProperty'); - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : { - }; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - ownKeys.forEach(function (key) { - defineProperty(target, key, source[key]); - }); - } - return target; - } - module.exports = _objectSpread; - }, - { - './defineProperty': 7 - } - ], - 15: [ - function (_dereq_, module, exports) { - var _typeof = _dereq_('../helpers/typeof'); - var assertThisInitialized = _dereq_('./assertThisInitialized'); - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return assertThisInitialized(self); - } - module.exports = _possibleConstructorReturn; - }, - { - '../helpers/typeof': 19, - './assertThisInitialized': 4 - } - ], - 16: [ - function (_dereq_, module, exports) { - function _setPrototypeOf(o, p) { - module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - module.exports = _setPrototypeOf; - }, - { - } - ], - 17: [ - function (_dereq_, module, exports) { - var arrayWithHoles = _dereq_('./arrayWithHoles'); - var iterableToArrayLimit = _dereq_('./iterableToArrayLimit'); - var nonIterableRest = _dereq_('./nonIterableRest'); - function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); - } - module.exports = _slicedToArray; - }, - { - './arrayWithHoles': 2, - './iterableToArrayLimit': 11, - './nonIterableRest': 12 - } - ], - 18: [ - function (_dereq_, module, exports) { - var arrayWithoutHoles = _dereq_('./arrayWithoutHoles'); - var iterableToArray = _dereq_('./iterableToArray'); - var nonIterableSpread = _dereq_('./nonIterableSpread'); - function _toConsumableArray(arr) { - return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); - } - module.exports = _toConsumableArray; - }, - { - './arrayWithoutHoles': 3, - './iterableToArray': 10, - './nonIterableSpread': 13 - } - ], - 19: [ - function (_dereq_, module, exports) { - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - module.exports = _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - module.exports = _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - module.exports = _typeof; - }, - { - } - ], - 20: [ - function (_dereq_, module, exports) { - 'use strict'; - exports.byteLength = byteLength; - exports.toByteArray = toByteArray; - exports.fromByteArray = fromByteArray; - var lookup = [ - ]; - var revLookup = [ - ]; - var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } // Support decoding URL-safe base64 strings, as Node.js does. - // See: https://en.wikipedia.org/wiki/Base64#URL_applications - - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; - function getLens(b64) { - var len = b64.length; - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4'); - } // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - - var validLen = b64.indexOf('='); - if (validLen === - 1) validLen = len; - var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; - return [validLen, - placeHoldersLen]; - } // base64 is 4/3 + up to two characters of the original data - - function byteLength(b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; - } - function _byteLength(b64, validLen, placeHoldersLen) { - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; - } - function toByteArray(b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - var curByte = 0; - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 ? validLen - 4 : validLen; - var i; - for (i = 0; i < len; i += 4) { - tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; - arr[curByte++] = tmp >> 16 & 255; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 2) { - tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 1) { - tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; - } - return arr; - } - function tripletToBase64(num) { - return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; - } - function encodeChunk(uint8, start, end) { - var tmp; - var output = [ - ]; - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255); - output.push(tripletToBase64(tmp)); - } - return output.join(''); - } - function fromByteArray(uint8) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var parts = [ - ]; - var maxChunkLength = 16383; // must be multiple of 3 - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); - } // pad the end with zeros, but make sure to not forget the extra bytes - - if (extraBytes === 1) { - tmp = uint8[len - 1]; - parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + '=='); - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1]; - parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + '='); - } - return parts.join(''); - } - }, - { - } - ], - 21: [ - function (_dereq_, module, exports) { - }, - { - } - ], - 22: [ - function (_dereq_, module, exports) { - (function (Buffer) { - /*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - /* eslint-disable no-proto */ - 'use strict'; - var base64 = _dereq_('base64-js'); - var ieee754 = _dereq_('ieee754'); - var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : null; - exports.Buffer = Buffer; - exports.SlowBuffer = SlowBuffer; - exports.INSPECT_MAX_BYTES = 50; - var K_MAX_LENGTH = 2147483647; - exports.kMaxLength = K_MAX_LENGTH; - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ - Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); - if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { - console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); - } - function typedArraySupport() { - // Can typed array instances can be augmented? - try { - var arr = new Uint8Array(1); - var proto = { - foo: function () { - return 42; - } - }; - Object.setPrototypeOf(proto, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto); - return arr.foo() === 42; - } catch (e) { - return false; - } - } - Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined; - return this.buffer; - } - }); - Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined; - return this.byteOffset; - } - }); - function createBuffer(length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"'); - } // Return an augmented `Uint8Array` instance - - var buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer.prototype); - return buf; - } /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer(arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError('The "string" argument must be of type string. Received type number'); - } - return allocUnsafe(arg); - } - return from(arg, encodingOrOffset, length); - } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - - if (typeof Symbol !== 'undefined' && Symbol.species != null && Buffer[Symbol.species] === Buffer) { - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true, - enumerable: false, - writable: false - }); - } - Buffer.poolSize = 8192; // not used by this implementation - function from(value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset); - } - if (ArrayBuffer.isView(value)) { - return fromArrayLike(value); - } - if (value == null) { - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value); - } - if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { - return fromArrayBuffer(value, encodingOrOffset, length); - } - if (typeof value === 'number') { - throw new TypeError('The "value" argument must not be of type number. Received type number'); - } - var valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length); - } - var b = fromObject(value); - if (b) return b; - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); - } - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value); - } /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - - Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length); - }; - // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: - // https://github.com/feross/buffer/pull/148 - Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer, Uint8Array); - function assertSize(size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number'); - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"'); - } - } - function alloc(size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(size); - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); - } - return createBuffer(size); - } /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - - Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding); - }; - function allocUnsafe(size) { - assertSize(size); - return createBuffer(size < 0 ? 0 : checked(size) | 0); - } /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - - Buffer.allocUnsafe = function (size) { - return allocUnsafe(size); - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size); - }; - function fromString(string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding); - } - var length = byteLength(string, encoding) | 0; - var buf = createBuffer(length); - var actual = buf.write(string, encoding); - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual); - } - return buf; - } - function fromArrayLike(array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0; - var buf = createBuffer(length); - for (var i = 0; i < length; i += 1) { - buf[i] = array[i] & 255; - } - return buf; - } - function fromArrayBuffer(array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds'); - } - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds'); - } - var buf; - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array); - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset); - } else { - buf = new Uint8Array(array, byteOffset, length); - } // Return an augmented `Uint8Array` instance - - Object.setPrototypeOf(buf, Buffer.prototype); - return buf; - } - function fromObject(obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0; - var buf = createBuffer(len); - if (buf.length === 0) { - return buf; - } - obj.copy(buf, 0, 0, len); - return buf; - } - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0); - } - return fromArrayLike(obj); - } - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data); - } - } - function checked(length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); - } - return length | 0; - } - function SlowBuffer(length) { - if ( + length != length) { - // eslint-disable-line eqeqeq - length = 0; - } - return Buffer.alloc( + length); - } - Buffer.isBuffer = function isBuffer(b) { - return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false - }; - Buffer.compare = function compare(a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); - } - if (a === b) return 0; - var x = a.length; - var y = b.length; - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break; - } - } - if (x < y) return - 1; - if (y < x) return 1; - return 0; - }; - Buffer.isEncoding = function isEncoding(encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true; - default: - return false; - } - }; - Buffer.concat = function concat(list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers'); - } - if (list.length === 0) { - return Buffer.alloc(0); - } - var i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - var buffer = Buffer.allocUnsafe(length); - var pos = 0; - for (i = 0; i < list.length; ++i) { - var buf = list[i]; - if (isInstance(buf, Uint8Array)) { - buf = Buffer.from(buf); - } - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers'); - } - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer; - }; - function byteLength(string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length; - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength; - } - if (typeof string !== 'string') { - throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string); - } - var len = string.length; - var mustMatch = arguments.length > 2 && arguments[2] === true; - if (!mustMatch && len === 0) return 0; - // Use a for loop to avoid recursion - var loweredCase = false; - for (; ; ) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len; - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2; - case 'hex': - return len >>> 1; - case 'base64': - return base64ToBytes(string).length; - default: - if (loweredCase) { - return mustMatch ? - 1 : utf8ToBytes(string).length; // assume utf8 - } - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - function slowToString(encoding, start, end) { - var loweredCase = false; - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - - if (start > this.length) { - return ''; - } - if (end === undefined || end > this.length) { - end = this.length; - } - if (end <= 0) { - return ''; - } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - - end >>>= 0; - start >>>= 0; - if (end <= start) { - return ''; - } - if (!encoding) encoding = 'utf8'; - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end); - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end); - case 'ascii': - return asciiSlice(this, start, end); - case 'latin1': - case 'binary': - return latin1Slice(this, start, end); - case 'base64': - return base64Slice(this, start, end); - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end); - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } - } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) - // to detect a Buffer instance. It's not possible to use `instanceof Buffer` - // reliably in a browserify context because there could be multiple different - // copies of the 'buffer' package in use. This method works even for Buffer - // instances that were created from another copy of the `buffer` package. - // See: https://github.com/feross/buffer/issues/154 - - Buffer.prototype._isBuffer = true; - function swap(b, n, m) { - var i = b[n]; - b[n] = b[m]; - b[m] = i; - } - Buffer.prototype.swap16 = function swap16() { - var len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits'); - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this; - }; - Buffer.prototype.swap32 = function swap32() { - var len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits'); - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this; - }; - Buffer.prototype.swap64 = function swap64() { - var len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits'); - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this; - }; - Buffer.prototype.toString = function toString() { - var length = this.length; - if (length === 0) return ''; - if (arguments.length === 0) return utf8Slice(this, 0, length); - return slowToString.apply(this, arguments); - }; - Buffer.prototype.toLocaleString = Buffer.prototype.toString; - Buffer.prototype.equals = function equals(b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); - if (this === b) return true; - return Buffer.compare(this, b) === 0; - }; - Buffer.prototype.inspect = function inspect() { - var str = ''; - var max = exports.INSPECT_MAX_BYTES; - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); - if (this.length > max) str += ' ... '; - return ''; - }; - if (customInspectSymbol) { - Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; - } - Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength); - } - if (!Buffer.isBuffer(target)) { - throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + typeof target); - } - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index'); - } - if (thisStart >= thisEnd && start >= end) { - return 0; - } - if (thisStart >= thisEnd) { - return - 1; - } - if (start >= end) { - return 1; - } - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - if (this === target) return 0; - var x = thisEnd - thisStart; - var y = end - start; - var len = Math.min(x, y); - var thisCopy = this.slice(thisStart, thisEnd); - var targetCopy = target.slice(start, end); - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break; - } - } - if (x < y) return - 1; - if (y < x) return 1; - return 0; - }; - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return - 1; - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 2147483647) { - byteOffset = 2147483647; - } else if (byteOffset < - 2147483648) { - byteOffset = - 2147483648; - } - byteOffset = + byteOffset; // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : buffer.length - 1; - } // Normalize byteOffset: negative offsets start from the end of the buffer - - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return - 1; - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return - 1; - } // Normalize val - - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } // Finally, search either indexOf (if dir is true) or lastIndexOf - - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return - 1; - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir); - } else if (typeof val === 'number') { - val = val & 255; // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); - } - } - return arrayIndexOf(buffer, [ - val - ], byteOffset, encoding, dir); - } - throw new TypeError('val must be string, number or Buffer'); - } - function arrayIndexOf(arr, val, byteOffset, encoding, dir) { - var indexSize = 1; - var arrLength = arr.length; - var valLength = val.length; - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return - 1; - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - function read(buf, i) { - if (indexSize === 1) { - return buf[i]; - } else { - return buf.readUInt16BE(i * indexSize); - } - } - var i; - if (dir) { - var foundIndex = - 1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === - 1 ? 0 : i - foundIndex)) { - if (foundIndex === - 1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; - } else { - if (foundIndex !== - 1) i -= i - foundIndex; - foundIndex = - 1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - var found = true; - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break; - } - } - if (found) return i; - } - } - return - 1; - } - Buffer.prototype.includes = function includes(val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== - 1; - }; - Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true); - }; - Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false); - }; - function hexWrite(buf, string, offset, length) { - offset = Number(offset) || 0; - var remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - var strLen = string.length; - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16); - if (numberIsNaN(parsed)) return i; - buf[offset + i] = parsed; - } - return i; - } - function utf8Write(buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); - } - function asciiWrite(buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length); - } - function latin1Write(buf, string, offset, length) { - return asciiWrite(buf, string, offset, length); - } - function base64Write(buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length); - } - function ucs2Write(buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); - } - Buffer.prototype.write = function write(string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - } else { - throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); - } - var remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds'); - } - if (!encoding) encoding = 'utf8'; - var loweredCase = false; - for (; ; ) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length); - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length); - case 'ascii': - return asciiWrite(this, string, offset, length); - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length); - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length); - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length); - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - Buffer.prototype.toJSON = function toJSON() { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - }; - }; - function base64Slice(buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf); - } else { - return base64.fromByteArray(buf.slice(start, end)); - } - } - function utf8Slice(buf, start, end) { - end = Math.min(buf.length, end); - var res = [ - ]; - var i = start; - while (i < end) { - var firstByte = buf[i]; - var codePoint = null; - var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; - if (i + bytesPerSequence <= end) { - var secondByte, - thirdByte, - fourthByte, - tempCodePoint; - switch (bytesPerSequence) { - case 1: - if (firstByte < 128) { - codePoint = firstByte; - } - break; - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 192) === 128) { - tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; - if (tempCodePoint > 127) { - codePoint = tempCodePoint; - } - } - break; - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; - if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { - codePoint = tempCodePoint; - } - } - break; - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; - if (tempCodePoint > 65535 && tempCodePoint < 1114112) { - codePoint = tempCodePoint; - } - } - } - } - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 65533; - bytesPerSequence = 1; - } else if (codePoint > 65535) { - // encode to utf16 (surrogate pair dance) - codePoint -= 65536; - res.push(codePoint >>> 10 & 1023 | 55296); - codePoint = 56320 | codePoint & 1023; - } - res.push(codePoint); - i += bytesPerSequence; - } - return decodeCodePointsArray(res); - } // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - - var MAX_ARGUMENTS_LENGTH = 4096; - function decodeCodePointsArray(codePoints) { - var len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints); // avoid extra slice() - } // Decode in chunks to avoid "call stack size exceeded". - - var res = ''; - var i = 0; - while (i < len) { - res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); - } - return res; - } - function asciiSlice(buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 127); - } - return ret; - } - function latin1Slice(buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret; - } - function hexSlice(buf, start, end) { - var len = buf.length; - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - var out = ''; - for (var i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]]; - } - return out; - } - function utf16leSlice(buf, start, end) { - var bytes = buf.slice(start, end); - var res = ''; - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res; - } - Buffer.prototype.slice = function slice(start, end) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - if (end < start) end = start; - var newBuf = this.subarray(start, end); - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(newBuf, Buffer.prototype); - return newBuf; - }; - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset(offset, ext, length) { - if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); - } - Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 256)) { - val += this[offset + i] * mul; - } - return val; - }; - Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - var val = this[offset + --byteLength]; - var mul = 1; - while (byteLength > 0 && (mul *= 256)) { - val += this[offset + --byteLength] * mul; - } - return val; - }; - Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset]; - }; - Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | this[offset + 1] << 8; - }; - Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] << 8 | this[offset + 1]; - }; - Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; - }; - Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); - }; - Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 256)) { - val += this[offset + i] * mul; - } - mul *= 128; - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - return val; - }; - Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - var i = byteLength; - var mul = 1; - var val = this[offset + --i]; - while (i > 0 && (mul *= 256)) { - val += this[offset + --i] * mul; - } - mul *= 128; - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - return val; - }; - Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 128)) return this[offset]; - return (255 - this[offset] + 1) * - 1; - }; - Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset] | this[offset + 1] << 8; - return val & 32768 ? val | 4294901760 : val; - }; - Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset + 1] | this[offset] << 8; - return val & 32768 ? val | 4294901760 : val; - }; - Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; - }; - Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; - }; - Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, true, 23, 4); - }; - Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, false, 23, 4); - }; - Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, true, 52, 8); - }; - Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, false, 52, 8); - }; - function checkInt(buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); - if (offset + ext > buf.length) throw new RangeError('Index out of range'); - } - Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { - value = + value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - var mul = 1; - var i = 0; - this[offset] = value & 255; - while (++i < byteLength && (mul *= 256)) { - this[offset + i] = value / mul & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { - value = + value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - var i = byteLength - 1; - var mul = 1; - this[offset + i] = value & 255; - while (--i >= 0 && (mul *= 256)) { - this[offset + i] = value / mul & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 255, 0); - this[offset] = value & 255; - return offset + 1; - }; - Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - return offset + 2; - }; - Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); - this[offset] = value >>> 8; - this[offset + 1] = value & 255; - return offset + 2; - }; - Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); - this[offset + 3] = value >>> 24; - this[offset + 2] = value >>> 16; - this[offset + 1] = value >>> 8; - this[offset] = value & 255; - return offset + 4; - }; - Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); - this[offset] = value >>> 24; - this[offset + 1] = value >>> 16; - this[offset + 2] = value >>> 8; - this[offset + 3] = value & 255; - return offset + 4; - }; - Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - checkInt(this, value, offset, byteLength, limit - 1, - limit); - } - var i = 0; - var mul = 1; - var sub = 0; - this[offset] = value & 255; - while (++i < byteLength && (mul *= 256)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = (value / mul >> 0) - sub & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - checkInt(this, value, offset, byteLength, limit - 1, - limit); - } - var i = byteLength - 1; - var mul = 1; - var sub = 0; - this[offset + i] = value & 255; - while (--i >= 0 && (mul *= 256)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = (value / mul >> 0) - sub & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 127, - 128); - if (value < 0) value = 255 + value + 1; - this[offset] = value & 255; - return offset + 1; - }; - Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 32767, - 32768); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - return offset + 2; - }; - Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 32767, - 32768); - this[offset] = value >>> 8; - this[offset + 1] = value & 255; - return offset + 2; - }; - Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 2147483647, - 2147483648); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - this[offset + 2] = value >>> 16; - this[offset + 3] = value >>> 24; - return offset + 4; - }; - Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 2147483647, - 2147483648); - if (value < 0) value = 4294967295 + value + 1; - this[offset] = value >>> 24; - this[offset + 1] = value >>> 16; - this[offset + 2] = value >>> 8; - this[offset + 3] = value & 255; - return offset + 4; - }; - function checkIEEE754(buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range'); - if (offset < 0) throw new RangeError('Index out of range'); - } - function writeFloat(buf, value, offset, littleEndian, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, - 3.4028234663852886e+38); - } - ieee754.write(buf, value, offset, littleEndian, 23, 4); - return offset + 4; - } - Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert); - }; - Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert); - }; - function writeDouble(buf, value, offset, littleEndian, noAssert) { - value = + value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157e+308, - 1.7976931348623157e+308); - } - ieee754.write(buf, value, offset, littleEndian, 52, 8); - return offset + 8; - } - Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert); - }; - Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert); - }; - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy(target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - // Copy 0 bytes; we're done - if (end === start) return 0; - if (target.length === 0 || this.length === 0) return 0; - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds'); - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); - if (end < 0) throw new RangeError('sourceEnd out of bounds'); - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - var len = end - start; - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end); - } else if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (var i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start]; - } - } else { - Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); - } - return len; - }; - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill(val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string'); - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding); - } - if (val.length === 1) { - var code = val.charCodeAt(0); - if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code; - } - } - } else if (typeof val === 'number') { - val = val & 255; - } else if (typeof val === 'boolean') { - val = Number(val); - } // Invalid ranges are not set to a default, so can range check early. - - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index'); - } - if (end <= start) { - return this; - } - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - if (!val) val = 0; - var i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); - var len = bytes.length; - if (len === 0) { - throw new TypeError('The value "' + val + '" is invalid for argument "value"'); - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - return this; - }; - // HELPER FUNCTIONS - // ================ - var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - function base64clean(str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=') [0]; - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return ''; - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str; - } - function utf8ToBytes(string, units) { - units = units || Infinity; - var codePoint; - var length = string.length; - var leadSurrogate = null; - var bytes = [ - ]; - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - // is surrogate component - if (codePoint > 55295 && codePoint < 57344) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 56319) { - // unexpected trail - if ((units -= 3) > - 1) bytes.push(239, 191, 189); - continue; - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > - 1) bytes.push(239, 191, 189); - continue; - } // valid lead - - leadSurrogate = codePoint; - continue; - } // 2 leads in a row - - if (codePoint < 56320) { - if ((units -= 3) > - 1) bytes.push(239, 191, 189); - leadSurrogate = codePoint; - continue; - } // valid surrogate pair - - codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > - 1) bytes.push(239, 191, 189); - } - leadSurrogate = null; - // encode utf8 - if (codePoint < 128) { - if ((units -= 1) < 0) break; - bytes.push(codePoint); - } else if (codePoint < 2048) { - if ((units -= 2) < 0) break; - bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); - } else if (codePoint < 65536) { - if ((units -= 3) < 0) break; - bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); - } else if (codePoint < 1114112) { - if ((units -= 4) < 0) break; - bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); - } else { - throw new Error('Invalid code point'); - } - } - return bytes; - } - function asciiToBytes(str) { - var byteArray = [ - ]; - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 255); - } - return byteArray; - } - function utf16leToBytes(str, units) { - var c, - hi, - lo; - var byteArray = [ - ]; - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break; - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - return byteArray; - } - function base64ToBytes(str) { - return base64.toByteArray(base64clean(str)); - } - function blitBuffer(src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if (i + offset >= dst.length || i >= src.length) break; - dst[i + offset] = src[i]; - } - return i; - } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass - // the `instanceof` check but they should be treated as of that type. - // See: https://github.com/feross/buffer/issues/166 - - function isInstance(obj, type) { - return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; - } - function numberIsNaN(obj) { - // For IE11 support - return obj !== obj; // eslint-disable-line no-self-compare - } // Create lookup table for `toString('hex')` - // See: https://github.com/feross/buffer/issues/219 - - var hexSliceLookupTable = function () { - var alphabet = '0123456789abcdef'; - var table = new Array(256); - for (var i = 0; i < 16; ++i) { - var i16 = i * 16; - for (var j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j]; - } - } - return table; - }(); - }).call(this, _dereq_('buffer').Buffer) - }, - { - 'base64-js': 20, - 'buffer': 22, - 'ieee754': 268 - } - ], - 23: [ - function (_dereq_, module, exports) { - module.exports = function (it) { - if (typeof it != 'function') { - throw TypeError(String(it) + ' is not a function'); - } - return it; - }; - }, - { - } - ], - 24: [ - function (_dereq_, module, exports) { - var isObject = _dereq_('../internals/is-object'); - module.exports = function (it) { - if (!isObject(it) && it !== null) { - throw TypeError('Can\'t set ' + String(it) + ' as a prototype'); - } - return it; - }; - }, - { - '../internals/is-object': 92 - } - ], - 25: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var create = _dereq_('../internals/object-create'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var UNSCOPABLES = wellKnownSymbol('unscopables'); - var ArrayPrototype = Array.prototype; - // Array.prototype[@@unscopables] - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - if (ArrayPrototype[UNSCOPABLES] == undefined) { - definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { - configurable: true, - value: create(null) - }); - } // add a key to Array.prototype[@@unscopables] - - module.exports = function (key) { - ArrayPrototype[UNSCOPABLES][key] = true; - }; - }, - { - '../internals/object-create': 108, - '../internals/object-define-property': 110, - '../internals/well-known-symbol': 166 - } - ], - 26: [ - function (_dereq_, module, exports) { - 'use strict'; - var charAt = _dereq_('../internals/string-multibyte').charAt; - // `AdvanceStringIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-advancestringindex - module.exports = function (S, index, unicode) { - return index + (unicode ? charAt(S, index).length : 1); - }; - }, - { - '../internals/string-multibyte': 141 - } - ], - 27: [ - function (_dereq_, module, exports) { - module.exports = function (it, Constructor, name) { - if (!(it instanceof Constructor)) { - throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); - } - return it; - }; - }, - { - } - ], - 28: [ - function (_dereq_, module, exports) { - var isObject = _dereq_('../internals/is-object'); - module.exports = function (it) { - if (!isObject(it)) { - throw TypeError(String(it) + ' is not an object'); - } - return it; - }; - }, - { - '../internals/is-object': 92 - } - ], - 29: [ - function (_dereq_, module, exports) { - module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined'; - }, - { - } - ], - 30: [ - function (_dereq_, module, exports) { - 'use strict'; - var NATIVE_ARRAY_BUFFER = _dereq_('../internals/array-buffer-native'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var global = _dereq_('../internals/global'); - var isObject = _dereq_('../internals/is-object'); - var has = _dereq_('../internals/has'); - var classof = _dereq_('../internals/classof'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var redefine = _dereq_('../internals/redefine'); - var defineProperty = _dereq_('../internals/object-define-property').f; - var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); - var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var uid = _dereq_('../internals/uid'); - var Int8Array = global.Int8Array; - var Int8ArrayPrototype = Int8Array && Int8Array.prototype; - var Uint8ClampedArray = global.Uint8ClampedArray; - var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; - var TypedArray = Int8Array && getPrototypeOf(Int8Array); - var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); - var ObjectPrototype = Object.prototype; - var isPrototypeOf = ObjectPrototype.isPrototypeOf; - var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); - // Fixing native typed arrays in Opera Presto crashes the browser, see #595 - var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; - var TYPED_ARRAY_TAG_REQIRED = false; - var NAME; - var TypedArrayConstructorsList = { - Int8Array: 1, - Uint8Array: 1, - Uint8ClampedArray: 1, - Int16Array: 2, - Uint16Array: 2, - Int32Array: 4, - Uint32Array: 4, - Float32Array: 4, - Float64Array: 8 - }; - var isView = function isView(it) { - var klass = classof(it); - return klass === 'DataView' || has(TypedArrayConstructorsList, klass); - }; - var isTypedArray = function (it) { - return isObject(it) && has(TypedArrayConstructorsList, classof(it)); - }; - var aTypedArray = function (it) { - if (isTypedArray(it)) return it; - throw TypeError('Target is not a typed array'); - }; - var aTypedArrayConstructor = function (C) { - if (setPrototypeOf) { - if (isPrototypeOf.call(TypedArray, C)) return C; - } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) { - var TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) { - return C; - } - } - throw TypeError('Target is not a typed array constructor'); - }; - var exportTypedArrayMethod = function (KEY, property, forced) { - if (!DESCRIPTORS) return; - if (forced) for (var ARRAY in TypedArrayConstructorsList) { - var TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) { - delete TypedArrayConstructor.prototype[KEY]; - } - } - if (!TypedArrayPrototype[KEY] || forced) { - redefine(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property); - } - }; - var exportTypedArrayStaticMethod = function (KEY, property, forced) { - var ARRAY, - TypedArrayConstructor; - if (!DESCRIPTORS) return; - if (setPrototypeOf) { - if (forced) for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) { - delete TypedArrayConstructor[KEY]; - } - } - if (!TypedArray[KEY] || forced) { - // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable - try { - return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property); - } catch (error) { /* empty */ - } - } else return; - } - for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { - redefine(TypedArrayConstructor, KEY, property); - } - } - }; - for (NAME in TypedArrayConstructorsList) { - if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; - } // WebKit bug - typed arrays constructors prototype is Object.prototype - - if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) { - // eslint-disable-next-line no-shadow - TypedArray = function TypedArray() { - throw TypeError('Incorrect invocation'); - }; - if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); - } - } - if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { - TypedArrayPrototype = TypedArray.prototype; - if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); - } - } // WebKit bug - one more object in Uint8ClampedArray prototype chain - - if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { - setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); - } - if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { - TYPED_ARRAY_TAG_REQIRED = true; - defineProperty(TypedArrayPrototype, TO_STRING_TAG, { - get: function () { - return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; - } - }); - for (NAME in TypedArrayConstructorsList) if (global[NAME]) { - createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); - } - } - module.exports = { - NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, - TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, - aTypedArray: aTypedArray, - aTypedArrayConstructor: aTypedArrayConstructor, - exportTypedArrayMethod: exportTypedArrayMethod, - exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, - isView: isView, - isTypedArray: isTypedArray, - TypedArray: TypedArray, - TypedArrayPrototype: TypedArrayPrototype - }; - }, - { - '../internals/array-buffer-native': 29, - '../internals/classof': 47, - '../internals/create-non-enumerable-property': 56, - '../internals/descriptors': 61, - '../internals/global': 77, - '../internals/has': 78, - '../internals/is-object': 92, - '../internals/object-define-property': 110, - '../internals/object-get-prototype-of': 115, - '../internals/object-set-prototype-of': 119, - '../internals/redefine': 126, - '../internals/uid': 163, - '../internals/well-known-symbol': 166 - } - ], - 31: [ - function (_dereq_, module, exports) { - 'use strict'; - var global = _dereq_('../internals/global'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var NATIVE_ARRAY_BUFFER = _dereq_('../internals/array-buffer-native'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var redefineAll = _dereq_('../internals/redefine-all'); - var fails = _dereq_('../internals/fails'); - var anInstance = _dereq_('../internals/an-instance'); - var toInteger = _dereq_('../internals/to-integer'); - var toLength = _dereq_('../internals/to-length'); - var toIndex = _dereq_('../internals/to-index'); - var IEEE754 = _dereq_('../internals/ieee754'); - var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); - var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); - var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; - var defineProperty = _dereq_('../internals/object-define-property').f; - var arrayFill = _dereq_('../internals/array-fill'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var getInternalState = InternalStateModule.get; - var setInternalState = InternalStateModule.set; - var ARRAY_BUFFER = 'ArrayBuffer'; - var DATA_VIEW = 'DataView'; - var PROTOTYPE = 'prototype'; - var WRONG_LENGTH = 'Wrong length'; - var WRONG_INDEX = 'Wrong index'; - var NativeArrayBuffer = global[ARRAY_BUFFER]; - var $ArrayBuffer = NativeArrayBuffer; - var $DataView = global[DATA_VIEW]; - var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; - var ObjectPrototype = Object.prototype; - var RangeError = global.RangeError; - var packIEEE754 = IEEE754.pack; - var unpackIEEE754 = IEEE754.unpack; - var packInt8 = function (number) { - return [number & 255]; - }; - var packInt16 = function (number) { - return [number & 255, - number >> 8 & 255]; - }; - var packInt32 = function (number) { - return [number & 255, - number >> 8 & 255, - number >> 16 & 255, - number >> 24 & 255]; - }; - var unpackInt32 = function (buffer) { - return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; - }; - var packFloat32 = function (number) { - return packIEEE754(number, 23, 4); - }; - var packFloat64 = function (number) { - return packIEEE754(number, 52, 8); - }; - var addGetter = function (Constructor, key) { - defineProperty(Constructor[PROTOTYPE], key, { - get: function () { - return getInternalState(this) [key]; - } - }); - }; - var get = function (view, count, index, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; - var start = intIndex + store.byteOffset; - var pack = bytes.slice(start, start + count); - return isLittleEndian ? pack : pack.reverse(); - }; - var set = function (view, count, index, conversion, value, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; - var start = intIndex + store.byteOffset; - var pack = conversion( + value); - for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; - }; - if (!NATIVE_ARRAY_BUFFER) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - setInternalState(this, { - bytes: arrayFill.call(new Array(byteLength), 0), - byteLength: byteLength - }); - if (!DESCRIPTORS) this.byteLength = byteLength; - }; - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = getInternalState(buffer).byteLength; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - setInternalState(this, { - buffer: buffer, - byteLength: byteLength, - byteOffset: offset - }); - if (!DESCRIPTORS) { - this.buffer = buffer; - this.byteLength = byteLength; - this.byteOffset = offset; - } - }; - if (DESCRIPTORS) { - addGetter($ArrayBuffer, 'byteLength'); - addGetter($DataView, 'buffer'); - addGetter($DataView, 'byteLength'); - addGetter($DataView, 'byteOffset'); - } - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset) [0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset) [0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */ ) { - var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */ ) { - var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */ ) { - return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */ ) { - return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */ ) { - return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */ ) { - return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */ ) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */ ) { - set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */ ) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */ ) { - set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */ ) { - set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */ ) { - set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); - } - }); - } else { - if (!fails(function () { - NativeArrayBuffer(1); - }) || !fails(function () { - new NativeArrayBuffer( - 1); // eslint-disable-line no-new - }) || fails(function () { - new NativeArrayBuffer(); // eslint-disable-line no-new - new NativeArrayBuffer(1.5); // eslint-disable-line no-new - new NativeArrayBuffer(NaN); // eslint-disable-line no-new - return NativeArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new NativeArrayBuffer(toIndex(length)); - }; - var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE]; - for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j; ) { - if (!((key = keys[j++]) in $ArrayBuffer)) { - createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); - } - } - ArrayBufferPrototype.constructor = $ArrayBuffer; - } // WebKit bug - the same parent prototype for typed arrays and data view - - if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) { - setPrototypeOf($DataViewPrototype, ObjectPrototype); - } // iOS Safari 7.x bug - - var testView = new $DataView(new $ArrayBuffer(2)); - var nativeSetInt8 = $DataViewPrototype.setInt8; - testView.setInt8(0, 2147483648); - testView.setInt8(1, 2147483649); - if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, { - setInt8: function setInt8(byteOffset, value) { - nativeSetInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - nativeSetInt8.call(this, byteOffset, value << 24 >> 24); - } - }, { - unsafe: true - }); - } - setToStringTag($ArrayBuffer, ARRAY_BUFFER); - setToStringTag($DataView, DATA_VIEW); - module.exports = { - ArrayBuffer: $ArrayBuffer, - DataView: $DataView - }; - }, - { - '../internals/an-instance': 27, - '../internals/array-buffer-native': 29, - '../internals/array-fill': 33, - '../internals/create-non-enumerable-property': 56, - '../internals/descriptors': 61, - '../internals/fails': 69, - '../internals/global': 77, - '../internals/ieee754': 83, - '../internals/internal-state': 88, - '../internals/object-define-property': 110, - '../internals/object-get-own-property-names': 113, - '../internals/object-get-prototype-of': 115, - '../internals/object-set-prototype-of': 119, - '../internals/redefine-all': 125, - '../internals/set-to-string-tag': 135, - '../internals/to-index': 151, - '../internals/to-integer': 153, - '../internals/to-length': 154 - } - ], - 32: [ - function (_dereq_, module, exports) { - 'use strict'; - var toObject = _dereq_('../internals/to-object'); - var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); - var toLength = _dereq_('../internals/to-length'); - var min = Math.min; - // `Array.prototype.copyWithin` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin - module.exports = [ - ].copyWithin || function copyWithin(target /* = 0 */ , start /* = 0, end = @length */ ) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = - 1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } - return O; - }; - }, - { - '../internals/to-absolute-index': 150, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 33: [ - function (_dereq_, module, exports) { - 'use strict'; - var toObject = _dereq_('../internals/to-object'); - var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); - var toLength = _dereq_('../internals/to-length'); - // `Array.prototype.fill` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.fill - module.exports = function fill(value /* , start = 0, end = @length */ ) { - var O = toObject(this); - var length = toLength(O.length); - var argumentsLength = arguments.length; - var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); - var end = argumentsLength > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; - }; - }, - { - '../internals/to-absolute-index': 150, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 34: [ - function (_dereq_, module, exports) { - 'use strict'; - var $forEach = _dereq_('../internals/array-iteration').forEach; - var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var STRICT_METHOD = arrayMethodIsStrict('forEach'); - var USES_TO_LENGTH = arrayMethodUsesToLength('forEach'); - // `Array.prototype.forEach` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - module.exports = !STRICT_METHOD || !USES_TO_LENGTH ? function forEach(callbackfn /* , thisArg */ ) { - return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - : [ - ].forEach; - }, - { - '../internals/array-iteration': 37, - '../internals/array-method-is-strict': 40, - '../internals/array-method-uses-to-length': 41 - } - ], - 35: [ - function (_dereq_, module, exports) { - 'use strict'; - var bind = _dereq_('../internals/function-bind-context'); - var toObject = _dereq_('../internals/to-object'); - var callWithSafeIterationClosing = _dereq_('../internals/call-with-safe-iteration-closing'); - var isArrayIteratorMethod = _dereq_('../internals/is-array-iterator-method'); - var toLength = _dereq_('../internals/to-length'); - var createProperty = _dereq_('../internals/create-property'); - var getIteratorMethod = _dereq_('../internals/get-iterator-method'); - // `Array.from` method implementation - // https://tc39.github.io/ecma262/#sec-array.from - module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */ ) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var index = 0; - var length, - result, - step, - iterator, - next, - value; - if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); - // if the target is not iterable or it's an array with the default iterator - use a simple case - if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); - next = iterator.next; - result = new C(); - for (; !(step = next.call(iterator)).done; index++) { - value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [ - step.value, - index - ], true) : step.value; - createProperty(result, index, value); - } - } else { - length = toLength(O.length); - result = new C(length); - for (; length > index; index++) { - value = mapping ? mapfn(O[index], index) : O[index]; - createProperty(result, index, value); - } - } - result.length = index; - return result; - }; - }, - { - '../internals/call-with-safe-iteration-closing': 44, - '../internals/create-property': 58, - '../internals/function-bind-context': 72, - '../internals/get-iterator-method': 75, - '../internals/is-array-iterator-method': 89, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 36: [ - function (_dereq_, module, exports) { - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var toLength = _dereq_('../internals/to-length'); - var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); - // `Array.prototype.{ indexOf, includes }` methods implementation - var createMethod = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (; length > index; index++) { - if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; - } - return !IS_INCLUDES && - 1; - }; - }; - module.exports = { - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - includes: createMethod(true), - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - indexOf: createMethod(false) - }; - }, - { - '../internals/to-absolute-index': 150, - '../internals/to-indexed-object': 152, - '../internals/to-length': 154 - } - ], - 37: [ - function (_dereq_, module, exports) { - var bind = _dereq_('../internals/function-bind-context'); - var IndexedObject = _dereq_('../internals/indexed-object'); - var toObject = _dereq_('../internals/to-object'); - var toLength = _dereq_('../internals/to-length'); - var arraySpeciesCreate = _dereq_('../internals/array-species-create'); - var push = [ - ].push; - // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation - var createMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - return function ($this, callbackfn, that, specificCreate) { - var O = toObject($this); - var self = IndexedObject(O); - var boundFunction = bind(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var value, - result; - for (; length > index; index++) if (NO_HOLES || index in self) { - value = self[index]; - result = boundFunction(value, index, O); - if (TYPE) { - if (IS_MAP) target[index] = result; // map - else if (result) switch (TYPE) { - case 3: - return true; - // some - case 5: - return value; - // find - case 6: - return index; - // findIndex - case 2: - push.call(target, value); - // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? - 1 : IS_SOME || IS_EVERY ? IS_EVERY : target; - }; - }; - module.exports = { - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - forEach: createMethod(0), - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - map: createMethod(1), - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - filter: createMethod(2), - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - some: createMethod(3), - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - every: createMethod(4), - // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find - find: createMethod(5), - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - findIndex: createMethod(6) - }; - }, - { - '../internals/array-species-create': 43, - '../internals/function-bind-context': 72, - '../internals/indexed-object': 84, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 38: [ - function (_dereq_, module, exports) { - 'use strict'; - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var toInteger = _dereq_('../internals/to-integer'); - var toLength = _dereq_('../internals/to-length'); - var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var min = Math.min; - var nativeLastIndexOf = [ - ].lastIndexOf; - var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [ - 1 - ].lastIndexOf(1, - 0) < 0; - var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); - // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method - var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { - ACCESSORS: true, - 1: 0 - }); - var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH; - // `Array.prototype.lastIndexOf` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof - module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */ ) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0; - var O = toIndexedObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (; index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; - return - 1; - } - : nativeLastIndexOf; - }, - { - '../internals/array-method-is-strict': 40, - '../internals/array-method-uses-to-length': 41, - '../internals/to-indexed-object': 152, - '../internals/to-integer': 153, - '../internals/to-length': 154 - } - ], - 39: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var V8_VERSION = _dereq_('../internals/engine-v8-version'); - var SPECIES = wellKnownSymbol('species'); - module.exports = function (METHOD_NAME) { - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/677 - return V8_VERSION >= 51 || !fails(function () { - var array = [ - ]; - var constructor = array.constructor = { - }; - constructor[SPECIES] = function () { - return { - foo: 1 - }; - }; - return array[METHOD_NAME](Boolean).foo !== 1; - }); - }; - }, - { - '../internals/engine-v8-version': 66, - '../internals/fails': 69, - '../internals/well-known-symbol': 166 - } - ], - 40: [ - function (_dereq_, module, exports) { - 'use strict'; - var fails = _dereq_('../internals/fails'); - module.exports = function (METHOD_NAME, argument) { - var method = [ - ][METHOD_NAME]; - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call,no-throw-literal - method.call(null, argument || function () { - throw 1; - }, 1); - }); - }; - }, - { - '../internals/fails': 69 - } - ], - 41: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var fails = _dereq_('../internals/fails'); - var has = _dereq_('../internals/has'); - var defineProperty = Object.defineProperty; - var cache = { - }; - var thrower = function (it) { - throw it; - }; - module.exports = function (METHOD_NAME, options) { - if (has(cache, METHOD_NAME)) return cache[METHOD_NAME]; - if (!options) options = { - }; - var method = [ - ][METHOD_NAME]; - var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false; - var argument0 = has(options, 0) ? options[0] : thrower; - var argument1 = has(options, 1) ? options[1] : undefined; - return cache[METHOD_NAME] = !!method && !fails(function () { - if (ACCESSORS && !DESCRIPTORS) return true; - var O = { - length: - 1 - }; - if (ACCESSORS) defineProperty(O, 1, { - enumerable: true, - get: thrower - }); - else O[1] = 1; - method.call(O, argument0, argument1); - }); - }; - }, - { - '../internals/descriptors': 61, - '../internals/fails': 69, - '../internals/has': 78 - } - ], - 42: [ - function (_dereq_, module, exports) { - var aFunction = _dereq_('../internals/a-function'); - var toObject = _dereq_('../internals/to-object'); - var IndexedObject = _dereq_('../internals/indexed-object'); - var toLength = _dereq_('../internals/to-length'); - // `Array.prototype.{ reduce, reduceRight }` methods implementation - var createMethod = function (IS_RIGHT) { - return function (that, callbackfn, argumentsLength, memo) { - aFunction(callbackfn); - var O = toObject(that); - var self = IndexedObject(O); - var length = toLength(O.length); - var index = IS_RIGHT ? length - 1 : 0; - var i = IS_RIGHT ? - 1 : 1; - if (argumentsLength < 2) while (true) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (IS_RIGHT ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; - }; - }; - module.exports = { - // `Array.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - left: createMethod(false), - // `Array.prototype.reduceRight` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright - right: createMethod(true) - }; - }, - { - '../internals/a-function': 23, - '../internals/indexed-object': 84, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 43: [ - function (_dereq_, module, exports) { - var isObject = _dereq_('../internals/is-object'); - var isArray = _dereq_('../internals/is-array'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var SPECIES = wellKnownSymbol('species'); - // `ArraySpeciesCreate` abstract operation - // https://tc39.github.io/ecma262/#sec-arrayspeciescreate - module.exports = function (originalArray, length) { - var C; - if (isArray(originalArray)) { - C = originalArray.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } - return new (C === undefined ? Array : C) (length === 0 ? 0 : length); - }; - }, - { - '../internals/is-array': 90, - '../internals/is-object': 92, - '../internals/well-known-symbol': 166 - } - ], - 44: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - // call something on iterator step with safe closing on error - module.exports = function (iterator, fn, value, ENTRIES) { - try { - return ENTRIES ? fn(anObject(value) [0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (error) { - var returnMethod = iterator['return']; - if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); - throw error; - } - }; - }, - { - '../internals/an-object': 28 - } - ], - 45: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var ITERATOR = wellKnownSymbol('iterator'); - var SAFE_CLOSING = false; - try { - var called = 0; - var iteratorWithReturn = { - next: function () { - return { - done: !!called++ - }; - }, - 'return': function () { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR] = function () { - return this; - }; - // eslint-disable-next-line no-throw-literal - Array.from(iteratorWithReturn, function () { - throw 2; - }); - } catch (error) { /* empty */ - } - module.exports = function (exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) return false; - var ITERATION_SUPPORT = false; - try { - var object = { - }; - object[ITERATOR] = function () { - return { - next: function () { - return { - done: ITERATION_SUPPORT = true - }; - } - }; - }; - exec(object); - } catch (error) { /* empty */ - } - return ITERATION_SUPPORT; - }; - }, - { - '../internals/well-known-symbol': 166 - } - ], - 46: [ - function (_dereq_, module, exports) { - var toString = { - }.toString; - module.exports = function (it) { - return toString.call(it).slice(8, - 1); - }; - }, - { - } - ], - 47: [ - function (_dereq_, module, exports) { - var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support'); - var classofRaw = _dereq_('../internals/classof-raw'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - // ES3 wrong here - var CORRECT_ARGUMENTS = classofRaw(function () { - return arguments; - }()) == 'Arguments'; - // fallback for IE11 Script Access Denied error - var tryGet = function (it, key) { - try { - return it[key]; - } catch (error) { /* empty */ - } - }; - // getting tag from ES6+ `Object.prototype.toString` - module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { - var O, - tag, - result; - return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case - : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case - : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback - : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; - }; - }, - { - '../internals/classof-raw': 46, - '../internals/to-string-tag-support': 159, - '../internals/well-known-symbol': 166 - } - ], - 48: [ - function (_dereq_, module, exports) { - 'use strict'; - var defineProperty = _dereq_('../internals/object-define-property').f; - var create = _dereq_('../internals/object-create'); - var redefineAll = _dereq_('../internals/redefine-all'); - var bind = _dereq_('../internals/function-bind-context'); - var anInstance = _dereq_('../internals/an-instance'); - var iterate = _dereq_('../internals/iterate'); - var defineIterator = _dereq_('../internals/define-iterator'); - var setSpecies = _dereq_('../internals/set-species'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var fastKey = _dereq_('../internals/internal-metadata').fastKey; - var InternalStateModule = _dereq_('../internals/internal-state'); - var setInternalState = InternalStateModule.set; - var internalStateGetterFor = InternalStateModule.getterFor; - module.exports = { - getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, CONSTRUCTOR_NAME); - setInternalState(that, { - type: CONSTRUCTOR_NAME, - index: create(null), - first: undefined, - last: undefined, - size: 0 - }); - if (!DESCRIPTORS) that.size = 0; - if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); - }); - var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function (that, key, value) { - var state = getInternalState(that); - var entry = getEntry(that, key); - var previous, - index; - // change existing entry - if (entry) { - entry.value = value; - // create new entry - } else { - state.last = entry = { - index: index = fastKey(key, true), - key: key, - value: value, - previous: previous = state.last, - next: undefined, - removed: false - }; - if (!state.first) state.first = entry; - if (previous) previous.next = entry; - if (DESCRIPTORS) state.size++; - else that.size++; - // add to index - if (index !== 'F') state.index[index] = entry; - } - return that; - }; - var getEntry = function (that, key) { - var state = getInternalState(that); - // fast case - var index = fastKey(key); - var entry; - if (index !== 'F') return state.index[index]; - // frozen object case - for (entry = state.first; entry; entry = entry.next) { - if (entry.key == key) return entry; - } - }; - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - var that = this; - var state = getInternalState(that); - var data = state.index; - var entry = state.first; - while (entry) { - entry.removed = true; - if (entry.previous) entry.previous = entry.previous.next = undefined; - delete data[entry.index]; - entry = entry.next; - } - state.first = state.last = undefined; - if (DESCRIPTORS) state.size = 0; - else that.size = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function (key) { - var that = this; - var state = getInternalState(that); - var entry = getEntry(that, key); - if (entry) { - var next = entry.next; - var prev = entry.previous; - delete state.index[entry.index]; - entry.removed = true; - if (prev) prev.next = next; - if (next) next.previous = prev; - if (state.first == entry) state.first = next; - if (state.last == entry) state.last = prev; - if (DESCRIPTORS) state.size--; - else that.size--; - } - return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */ ) { - var state = getInternalState(this); - var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - var entry; - while (entry = entry ? entry.next : state.first) { - boundFunction(entry.value, entry.key, this); - // revert to the last existing entry - while (entry && entry.removed) entry = entry.previous; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(this, key); - } - }); - redefineAll(C.prototype, IS_MAP ? { - // 23.1.3.6 Map.prototype.get(key) - get: function get(key) { - var entry = getEntry(this, key); - return entry && entry.value; - }, - // 23.1.3.9 Map.prototype.set(key, value) - set: function set(key, value) { - return define(this, key === 0 ? 0 : key, value); - } - } - : { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return define(this, value = value === 0 ? 0 : value, value); - } - }); - if (DESCRIPTORS) defineProperty(C.prototype, 'size', { - get: function () { - return getInternalState(this).size; - } - }); - return C; - }, - setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { - var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; - var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); - var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) { - setInternalState(this, { - type: ITERATOR_NAME, - target: iterated, - state: getInternalCollectionState(iterated), - kind: kind, - last: undefined - }); - }, function () { - var state = getInternalIteratorState(this); - var kind = state.kind; - var entry = state.last; - // revert to the last existing entry - while (entry && entry.removed) entry = entry.previous; - // get next entry - if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { - // or finish the iteration - state.target = undefined; - return { - value: undefined, - done: true - }; - } // return step by kind - - if (kind == 'keys') return { - value: entry.key, - done: false - }; - if (kind == 'values') return { - value: entry.value, - done: false - }; - return { - value: [ - entry.key, - entry.value - ], - done: false - }; - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(CONSTRUCTOR_NAME); - } - }; - }, - { - '../internals/an-instance': 27, - '../internals/define-iterator': 59, - '../internals/descriptors': 61, - '../internals/function-bind-context': 72, - '../internals/internal-metadata': 87, - '../internals/internal-state': 88, - '../internals/iterate': 95, - '../internals/object-create': 108, - '../internals/object-define-property': 110, - '../internals/redefine-all': 125, - '../internals/set-species': 134 - } - ], - 49: [ - function (_dereq_, module, exports) { - 'use strict'; - var redefineAll = _dereq_('../internals/redefine-all'); - var getWeakData = _dereq_('../internals/internal-metadata').getWeakData; - var anObject = _dereq_('../internals/an-object'); - var isObject = _dereq_('../internals/is-object'); - var anInstance = _dereq_('../internals/an-instance'); - var iterate = _dereq_('../internals/iterate'); - var ArrayIterationModule = _dereq_('../internals/array-iteration'); - var $has = _dereq_('../internals/has'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var setInternalState = InternalStateModule.set; - var internalStateGetterFor = InternalStateModule.getterFor; - var find = ArrayIterationModule.find; - var findIndex = ArrayIterationModule.findIndex; - var id = 0; - // fallback for uncaught frozen keys - var uncaughtFrozenStore = function (store) { - return store.frozen || (store.frozen = new UncaughtFrozenStore()); - }; - var UncaughtFrozenStore = function () { - this.entries = [ - ]; - }; - var findUncaughtFrozen = function (store, key) { - return find(store.entries, function (it) { - return it[0] === key; - }); - }; - UncaughtFrozenStore.prototype = { - get: function (key) { - var entry = findUncaughtFrozen(this, key); - if (entry) return entry[1]; - }, - has: function (key) { - return !!findUncaughtFrozen(this, key); - }, - set: function (key, value) { - var entry = findUncaughtFrozen(this, key); - if (entry) entry[1] = value; - else this.entries.push([key, - value]); - }, - 'delete': function (key) { - var index = findIndex(this.entries, function (it) { - return it[0] === key; - }); - if (~index) this.entries.splice(index, 1); - return !!~index; - } - }; - module.exports = { - getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, CONSTRUCTOR_NAME); - setInternalState(that, { - type: CONSTRUCTOR_NAME, - id: id++, - frozen: undefined - }); - if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); - }); - var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function (that, key, value) { - var state = getInternalState(that); - var data = getWeakData(anObject(key), true); - if (data === true) uncaughtFrozenStore(state).set(key, value); - else data[state.id] = value; - return that; - }; - redefineAll(C.prototype, { - // 23.3.3.2 WeakMap.prototype.delete(key) - // 23.4.3.3 WeakSet.prototype.delete(value) - 'delete': function (key) { - var state = getInternalState(this); - if (!isObject(key)) return false; - var data = getWeakData(key); - if (data === true) return uncaughtFrozenStore(state) ['delete'](key); - return data && $has(data, state.id) && delete data[state.id]; - }, - // 23.3.3.4 WeakMap.prototype.has(key) - // 23.4.3.4 WeakSet.prototype.has(value) - has: function has(key) { - var state = getInternalState(this); - if (!isObject(key)) return false; - var data = getWeakData(key); - if (data === true) return uncaughtFrozenStore(state).has(key); - return data && $has(data, state.id); - } - }); - redefineAll(C.prototype, IS_MAP ? { - // 23.3.3.3 WeakMap.prototype.get(key) - get: function get(key) { - var state = getInternalState(this); - if (isObject(key)) { - var data = getWeakData(key); - if (data === true) return uncaughtFrozenStore(state).get(key); - return data ? data[state.id] : undefined; - } - }, - // 23.3.3.5 WeakMap.prototype.set(key, value) - set: function set(key, value) { - return define(this, key, value); - } - } - : { - // 23.4.3.1 WeakSet.prototype.add(value) - add: function add(value) { - return define(this, value, true); - } - }); - return C; - } - }; - }, - { - '../internals/an-instance': 27, - '../internals/an-object': 28, - '../internals/array-iteration': 37, - '../internals/has': 78, - '../internals/internal-metadata': 87, - '../internals/internal-state': 88, - '../internals/is-object': 92, - '../internals/iterate': 95, - '../internals/redefine-all': 125 - } - ], - 50: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var global = _dereq_('../internals/global'); - var isForced = _dereq_('../internals/is-forced'); - var redefine = _dereq_('../internals/redefine'); - var InternalMetadataModule = _dereq_('../internals/internal-metadata'); - var iterate = _dereq_('../internals/iterate'); - var anInstance = _dereq_('../internals/an-instance'); - var isObject = _dereq_('../internals/is-object'); - var fails = _dereq_('../internals/fails'); - var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var inheritIfRequired = _dereq_('../internals/inherit-if-required'); - module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { - var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== - 1; - var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== - 1; - var ADDER = IS_MAP ? 'set' : 'add'; - var NativeConstructor = global[CONSTRUCTOR_NAME]; - var NativePrototype = NativeConstructor && NativeConstructor.prototype; - var Constructor = NativeConstructor; - var exported = { - }; - var fixMethod = function (KEY) { - var nativeMethod = NativePrototype[KEY]; - redefine(NativePrototype, KEY, KEY == 'add' ? function add(value) { - nativeMethod.call(this, value === 0 ? 0 : value); - return this; - } - : KEY == 'delete' ? function (key) { - return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); - } - : KEY == 'get' ? function get(key) { - return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); - } - : KEY == 'has' ? function has(key) { - return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); - } - : function set(key, value) { - nativeMethod.call(this, key === 0 ? 0 : key, value); - return this; - }); - }; - // eslint-disable-next-line max-len - if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { - new NativeConstructor().entries().next(); - })))) { - // create collection constructor - Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); - InternalMetadataModule.REQUIRED = true; - } else if (isForced(CONSTRUCTOR_NAME, true)) { - var instance = new Constructor(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? { - } - : - 0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { - instance.has(1); - }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - // eslint-disable-next-line no-new - var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { - new NativeConstructor(iterable); - }); - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new NativeConstructor(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has( - 0); - }); - if (!ACCEPT_ITERABLES) { - Constructor = wrapper(function (dummy, iterable) { - anInstance(dummy, Constructor, CONSTRUCTOR_NAME); - var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); - if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); - return that; - }); - Constructor.prototype = NativePrototype; - NativePrototype.constructor = Constructor; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; - } - exported[CONSTRUCTOR_NAME] = Constructor; - $({ - global: true, - forced: Constructor != NativeConstructor - }, exported); - setToStringTag(Constructor, CONSTRUCTOR_NAME); - if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); - return Constructor; - }; - }, - { - '../internals/an-instance': 27, - '../internals/check-correctness-of-iteration': 45, - '../internals/export': 68, - '../internals/fails': 69, - '../internals/global': 77, - '../internals/inherit-if-required': 85, - '../internals/internal-metadata': 87, - '../internals/is-forced': 91, - '../internals/is-object': 92, - '../internals/iterate': 95, - '../internals/redefine': 126, - '../internals/set-to-string-tag': 135 - } - ], - 51: [ - function (_dereq_, module, exports) { - var has = _dereq_('../internals/has'); - var ownKeys = _dereq_('../internals/own-keys'); - var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - module.exports = function (target, source) { - var keys = ownKeys(source); - var defineProperty = definePropertyModule.f; - var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); - } - }; - }, - { - '../internals/has': 78, - '../internals/object-define-property': 110, - '../internals/object-get-own-property-descriptor': 111, - '../internals/own-keys': 121 - } - ], - 52: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var MATCH = wellKnownSymbol('match'); - module.exports = function (METHOD_NAME) { - var regexp = /./; - try { - '/./'[METHOD_NAME](regexp); - } catch (e) { - try { - regexp[MATCH] = false; - return '/./'[METHOD_NAME](regexp); - } catch (f) { /* empty */ - } - } - return false; - }; - }, - { - '../internals/well-known-symbol': 166 - } - ], - 53: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - module.exports = !fails(function () { - function F() { /* empty */ - } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - }, - { - '../internals/fails': 69 - } - ], - 54: [ - function (_dereq_, module, exports) { - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var quot = /"/g; - // B.2.3.2.1 CreateHTML(string, tag, attribute, value) - // https://tc39.github.io/ecma262/#sec-createhtml - module.exports = function (string, tag, attribute, value) { - var S = String(requireObjectCoercible(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; - }; - }, - { - '../internals/require-object-coercible': 131 - } - ], - 55: [ - function (_dereq_, module, exports) { - 'use strict'; - var IteratorPrototype = _dereq_('../internals/iterators-core').IteratorPrototype; - var create = _dereq_('../internals/object-create'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var Iterators = _dereq_('../internals/iterators'); - var returnThis = function () { - return this; - }; - module.exports = function (IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + ' Iterator'; - IteratorConstructor.prototype = create(IteratorPrototype, { - next: createPropertyDescriptor(1, next) - }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; - }; - }, - { - '../internals/create-property-descriptor': 57, - '../internals/iterators': 97, - '../internals/iterators-core': 96, - '../internals/object-create': 108, - '../internals/set-to-string-tag': 135 - } - ], - 56: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - module.exports = DESCRIPTORS ? function (object, key, value) { - return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); - } - : function (object, key, value) { - object[key] = value; - return object; - }; - }, - { - '../internals/create-property-descriptor': 57, - '../internals/descriptors': 61, - '../internals/object-define-property': 110 - } - ], - 57: [ - function (_dereq_, module, exports) { - module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; - }; - }, - { - } - ], - 58: [ - function (_dereq_, module, exports) { - 'use strict'; - var toPrimitive = _dereq_('../internals/to-primitive'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - module.exports = function (object, key, value) { - var propertyKey = toPrimitive(key); - if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else object[propertyKey] = value; - }; - }, - { - '../internals/create-property-descriptor': 57, - '../internals/object-define-property': 110, - '../internals/to-primitive': 158 - } - ], - 59: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var createIteratorConstructor = _dereq_('../internals/create-iterator-constructor'); - var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); - var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var redefine = _dereq_('../internals/redefine'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var IS_PURE = _dereq_('../internals/is-pure'); - var Iterators = _dereq_('../internals/iterators'); - var IteratorsCore = _dereq_('../internals/iterators-core'); - var IteratorPrototype = IteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR = wellKnownSymbol('iterator'); - var KEYS = 'keys'; - var VALUES = 'values'; - var ENTRIES = 'entries'; - var returnThis = function () { - return this; - }; - module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function (KIND) { - if (KIND === DEFAULT && defaultIterator) return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: - return function keys() { - return new IteratorConstructor(this, KIND); - }; - case VALUES: - return function values() { - return new IteratorConstructor(this, KIND); - }; - case ENTRIES: - return function entries() { - return new IteratorConstructor(this, KIND); - }; - } - return function () { - return new IteratorConstructor(this); - }; - }; - var TO_STRING_TAG = NAME + ' Iterator'; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, - methods, - KEY; - // fix native - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { - if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { - createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); - } - } // Set @@toStringTag to native iterators - - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; - } - } // fix Array#{values, @@iterator}.name in V8 / FF - - if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { - return nativeIterator.call(this); - }; - } // define iterator - - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); - } - Iterators[NAME] = defaultIterator; - // export additional methods - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } else $({ - target: NAME, - proto: true, - forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME - }, methods); - } - return methods; - }; - }, - { - '../internals/create-iterator-constructor': 55, - '../internals/create-non-enumerable-property': 56, - '../internals/export': 68, - '../internals/is-pure': 93, - '../internals/iterators': 97, - '../internals/iterators-core': 96, - '../internals/object-get-prototype-of': 115, - '../internals/object-set-prototype-of': 119, - '../internals/redefine': 126, - '../internals/set-to-string-tag': 135, - '../internals/well-known-symbol': 166 - } - ], - 60: [ - function (_dereq_, module, exports) { - var path = _dereq_('../internals/path'); - var has = _dereq_('../internals/has'); - var wrappedWellKnownSymbolModule = _dereq_('../internals/well-known-symbol-wrapped'); - var defineProperty = _dereq_('../internals/object-define-property').f; - module.exports = function (NAME) { - var Symbol = path.Symbol || (path.Symbol = { - }); - if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { - value: wrappedWellKnownSymbolModule.f(NAME) - }); - }; - }, - { - '../internals/has': 78, - '../internals/object-define-property': 110, - '../internals/path': 122, - '../internals/well-known-symbol-wrapped': 165 - } - ], - 61: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - // Thank's IE8 for his funny defineProperty - module.exports = !fails(function () { - return Object.defineProperty({ - }, 1, { - get: function () { - return 7; - } - }) [1] != 7; - }); - }, - { - '../internals/fails': 69 - } - ], - 62: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var isObject = _dereq_('../internals/is-object'); - var document = global.document; - // typeof document.createElement is 'object' in old IE - var EXISTS = isObject(document) && isObject(document.createElement); - module.exports = function (it) { - return EXISTS ? document.createElement(it) : { - }; - }; - }, - { - '../internals/global': 77, - '../internals/is-object': 92 - } - ], - 63: [ - function (_dereq_, module, exports) { - // iterable DOM collections - // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods - module.exports = { - CSSRuleList: 0, - CSSStyleDeclaration: 0, - CSSValueList: 0, - ClientRectList: 0, - DOMRectList: 0, - DOMStringList: 0, - DOMTokenList: 1, - DataTransferItemList: 0, - FileList: 0, - HTMLAllCollection: 0, - HTMLCollection: 0, - HTMLFormElement: 0, - HTMLSelectElement: 0, - MediaList: 0, - MimeTypeArray: 0, - NamedNodeMap: 0, - NodeList: 1, - PaintRequestList: 0, - Plugin: 0, - PluginArray: 0, - SVGLengthList: 0, - SVGNumberList: 0, - SVGPathSegList: 0, - SVGPointList: 0, - SVGStringList: 0, - SVGTransformList: 0, - SourceBufferList: 0, - StyleSheetList: 0, - TextTrackCueList: 0, - TextTrackList: 0, - TouchList: 0 - }; - }, - { - } - ], - 64: [ - function (_dereq_, module, exports) { - var userAgent = _dereq_('../internals/engine-user-agent'); - module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent); - }, - { - '../internals/engine-user-agent': 65 - } - ], - 65: [ - function (_dereq_, module, exports) { - var getBuiltIn = _dereq_('../internals/get-built-in'); - module.exports = getBuiltIn('navigator', 'userAgent') || ''; - }, - { - '../internals/get-built-in': 74 - } - ], - 66: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var userAgent = _dereq_('../internals/engine-user-agent'); - var process = global.process; - var versions = process && process.versions; - var v8 = versions && versions.v8; - var match, - version; - if (v8) { - match = v8.split('.'); - version = match[0] + match[1]; - } else if (userAgent) { - match = userAgent.match(/Edge\/(\d+)/); - if (!match || match[1] >= 74) { - match = userAgent.match(/Chrome\/(\d+)/); - if (match) version = match[1]; - } - } - module.exports = version && + version; - }, - { - '../internals/engine-user-agent': 65, - '../internals/global': 77 - } - ], - 67: [ - function (_dereq_, module, exports) { - // IE8- don't enum bug keys - module.exports = [ - 'constructor', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'toLocaleString', - 'toString', - 'valueOf' - ]; - }, - { - } - ], - 68: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var redefine = _dereq_('../internals/redefine'); - var setGlobal = _dereq_('../internals/set-global'); - var copyConstructorProperties = _dereq_('../internals/copy-constructor-properties'); - var isForced = _dereq_('../internals/is-forced'); - /* - options.target - name of the target object - options.global - target is the global object - options.stat - export as static methods of target - options.proto - export as prototype methods of target - options.real - real prototype method for the `pure` version - options.forced - export even if the native feature is available - options.bind - bind methods to the target, required for the `pure` version - options.wrap - wrap constructors to preventing global pollution, required for the `pure` version - options.unsafe - use the simple assignment of property instead of delete + defineProperty - options.sham - add a flag to not completely full polyfills - options.enumerable - export as enumerable property - options.noTargetGet - prevent calling a getter on target -*/ - module.exports = function (options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, - target, - key, - targetProperty, - sourceProperty, - descriptor; - if (GLOBAL) { - target = global; - } else if (STATIC) { - target = global[TARGET] || setGlobal(TARGET, { - }); - } else { - target = (global[TARGET] || { - }).prototype; - } - if (target) for (key in source) { - sourceProperty = source[key]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key); - targetProperty = descriptor && descriptor.value; - } else targetProperty = target[key]; - FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); - // contained in target - if (!FORCED && targetProperty !== undefined) { - if (typeof sourceProperty === typeof targetProperty) continue; - copyConstructorProperties(sourceProperty, targetProperty); - } // add a flag to not completely full polyfills - - if (options.sham || targetProperty && targetProperty.sham) { - createNonEnumerableProperty(sourceProperty, 'sham', true); - } // extend global - - redefine(target, key, sourceProperty, options); - } - }; - }, - { - '../internals/copy-constructor-properties': 51, - '../internals/create-non-enumerable-property': 56, - '../internals/global': 77, - '../internals/is-forced': 91, - '../internals/object-get-own-property-descriptor': 111, - '../internals/redefine': 126, - '../internals/set-global': 133 - } - ], - 69: [ - function (_dereq_, module, exports) { - module.exports = function (exec) { - try { - return !!exec(); - } catch (error) { - return true; - } - }; - }, - { - } - ], - 70: [ - function (_dereq_, module, exports) { - 'use strict'; - // TODO: Remove from `core-js@4` since it's moved to entry points - _dereq_('../modules/es.regexp.exec'); - var redefine = _dereq_('../internals/redefine'); - var fails = _dereq_('../internals/fails'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var regexpExec = _dereq_('../internals/regexp-exec'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var SPECIES = wellKnownSymbol('species'); - var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = [ - ]; - result.groups = { - a: '7' - }; - return result; - }; - return ''.replace(re, '$') !== '7'; - }); - // IE <= 11 replaces $0 with the whole match, as if it was $& - // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 - var REPLACE_KEEPS_$0 = function () { - return 'a'.replace(/./, '$0') === '$0'; - }(); - var REPLACE = wellKnownSymbol('replace'); - // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string - var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function () { - if (/./[REPLACE]) { - return /./[REPLACE]('a', '$0') === ''; - } - return false; - }(); - // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec - // Weex JS has frozen built-in prototypes, so use try / catch wrapper - var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { - return originalExec.apply(this, arguments); - }; - var result = 'ab'.split(re); - return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; - }); - module.exports = function (KEY, length, exec, sham) { - var SYMBOL = wellKnownSymbol(KEY); - var DELEGATES_TO_SYMBOL = !fails(function () { - // String methods call symbol-named RegEp methods - var O = { - }; - O[SYMBOL] = function () { - return 7; - }; - return ''[KEY](O) != 7; - }); - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; - if (KEY === 'split') { - // We can't use real regex here since it causes deoptimization - // and serious performance degradation in V8 - // https://github.com/zloirock/core-js/issues/306 - re = { - }; - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = { - }; - re.constructor[SPECIES] = function () { - return re; - }; - re.flags = ''; - re[SYMBOL] = /./[SYMBOL]; - } - re.exec = function () { - execCalled = true; - return null; - }; - re[SYMBOL](''); - return !execCalled; - }); - if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0 && !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE) || KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) { - var nativeRegExpMethod = /./[SYMBOL]; - var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { - done: true, - value: nativeRegExpMethod.call(regexp, str, arg2) - }; - } - return { - done: true, - value: nativeMethod.call(str, regexp, arg2) - }; - } - return { - done: false - }; - }, { - REPLACE_KEEPS_$0: REPLACE_KEEPS_$0, - REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE - }); - var stringMethod = methods[0]; - var regexMethod = methods[1]; - redefine(String.prototype, KEY, stringMethod); - redefine(RegExp.prototype, SYMBOL, length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { - return regexMethod.call(string, this, arg); - } // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - - : function (string) { - return regexMethod.call(string, this); - }); - } - if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true); - }; - }, - { - '../internals/create-non-enumerable-property': 56, - '../internals/fails': 69, - '../internals/redefine': 126, - '../internals/regexp-exec': 128, - '../internals/well-known-symbol': 166, - '../modules/es.regexp.exec': 205 - } - ], - 71: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - module.exports = !fails(function () { - return Object.isExtensible(Object.preventExtensions({ - })); - }); - }, - { - '../internals/fails': 69 - } - ], - 72: [ - function (_dereq_, module, exports) { - var aFunction = _dereq_('../internals/a-function'); - // optional / simple context binding - module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 0: - return function () { - return fn.call(that); - }; - case 1: - return function (a) { - return fn.call(that, a); - }; - case 2: - return function (a, b) { - return fn.call(that, a, b); - }; - case 3: - return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function /* ...args */ - () { - return fn.apply(that, arguments); - }; - }; - }, - { - '../internals/a-function': 23 - } - ], - 73: [ - function (_dereq_, module, exports) { - 'use strict'; - var aFunction = _dereq_('../internals/a-function'); - var isObject = _dereq_('../internals/is-object'); - var slice = [ - ].slice; - var factories = { - }; - var construct = function (C, argsLength, args) { - if (!(argsLength in factories)) { - for (var list = [ - ], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); - } - return factories[argsLength](C, args); - }; - // `Function.prototype.bind` method implementation - // https://tc39.github.io/ecma262/#sec-function.prototype.bind - module.exports = Function.bind || function bind(that /* , ...args */ ) { - var fn = aFunction(this); - var partArgs = slice.call(arguments, 1); - var boundFunction = function bound( /* args... */ - ) { - var args = partArgs.concat(slice.call(arguments)); - return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); - }; - if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype; - return boundFunction; - }; - }, - { - '../internals/a-function': 23, - '../internals/is-object': 92 - } - ], - 74: [ - function (_dereq_, module, exports) { - var path = _dereq_('../internals/path'); - var global = _dereq_('../internals/global'); - var aFunction = function (variable) { - return typeof variable == 'function' ? variable : undefined; - }; - module.exports = function (namespace, method) { - return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; - }; - }, - { - '../internals/global': 77, - '../internals/path': 122 - } - ], - 75: [ - function (_dereq_, module, exports) { - var classof = _dereq_('../internals/classof'); - var Iterators = _dereq_('../internals/iterators'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var ITERATOR = wellKnownSymbol('iterator'); - module.exports = function (it) { - if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; - }; - }, - { - '../internals/classof': 47, - '../internals/iterators': 97, - '../internals/well-known-symbol': 166 - } - ], - 76: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - var getIteratorMethod = _dereq_('../internals/get-iterator-method'); - module.exports = function (it) { - var iteratorMethod = getIteratorMethod(it); - if (typeof iteratorMethod != 'function') { - throw TypeError(String(it) + ' is not iterable'); - } - return anObject(iteratorMethod.call(it)); - }; - }, - { - '../internals/an-object': 28, - '../internals/get-iterator-method': 75 - } - ], - 77: [ - function (_dereq_, module, exports) { - (function (global) { - var check = function (it) { - return it && it.Math == Math && it; - }; - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - module.exports = // eslint-disable-next-line no-undef - check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || // eslint-disable-next-line no-new-func - Function('return this') (); - }).call(this, typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : { - }) - }, - { - } - ], - 78: [ - function (_dereq_, module, exports) { - var hasOwnProperty = { - }.hasOwnProperty; - module.exports = function (it, key) { - return hasOwnProperty.call(it, key); - }; - }, - { - } - ], - 79: [ - function (_dereq_, module, exports) { - module.exports = { - }; - }, - { - } - ], - 80: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - module.exports = function (a, b) { - var console = global.console; - if (console && console.error) { - arguments.length === 1 ? console.error(a) : console.error(a, b); - } - }; - }, - { - '../internals/global': 77 - } - ], - 81: [ - function (_dereq_, module, exports) { - var getBuiltIn = _dereq_('../internals/get-built-in'); - module.exports = getBuiltIn('document', 'documentElement'); - }, - { - '../internals/get-built-in': 74 - } - ], - 82: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var fails = _dereq_('../internals/fails'); - var createElement = _dereq_('../internals/document-create-element'); - // Thank's IE8 for his funny defineProperty - module.exports = !DESCRIPTORS && !fails(function () { - return Object.defineProperty(createElement('div'), 'a', { - get: function () { - return 7; - } - }).a != 7; - }); - }, - { - '../internals/descriptors': 61, - '../internals/document-create-element': 62, - '../internals/fails': 69 - } - ], - 83: [ - function (_dereq_, module, exports) { - // IEEE754 conversions based on https://github.com/feross/ieee754 - // eslint-disable-next-line no-shadow-restricted-names - var Infinity = 1 / 0; - var abs = Math.abs; - var pow = Math.pow; - var floor = Math.floor; - var log = Math.log; - var LN2 = Math.LN2; - var pack = function (number, mantissaLength, bytes) { - var buffer = new Array(bytes); - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var rt = mantissaLength === 23 ? pow(2, - 24) - pow(2, - 77) : 0; - var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; - var index = 0; - var exponent, - mantissa, - c; - number = abs(number); - // eslint-disable-next-line no-self-compare - if (number != number || number === Infinity) { - // eslint-disable-next-line no-self-compare - mantissa = number != number ? 1 : 0; - exponent = eMax; - } else { - exponent = floor(log(number) / LN2); - if (number * (c = pow(2, - exponent)) < 1) { - exponent--; - c *= 2; - } - if (exponent + eBias >= 1) { - number += rt / c; - } else { - number += rt * pow(2, 1 - eBias); - } - if (number * c >= 2) { - exponent++; - c /= 2; - } - if (exponent + eBias >= eMax) { - mantissa = 0; - exponent = eMax; - } else if (exponent + eBias >= 1) { - mantissa = (number * c - 1) * pow(2, mantissaLength); - exponent = exponent + eBias; - } else { - mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); - exponent = 0; - } - } - for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); - exponent = exponent << mantissaLength | mantissa; - exponentLength += mantissaLength; - for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); - buffer[--index] |= sign * 128; - return buffer; - }; - var unpack = function (buffer, mantissaLength) { - var bytes = buffer.length; - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var nBits = exponentLength - 7; - var index = bytes - 1; - var sign = buffer[index--]; - var exponent = sign & 127; - var mantissa; - sign >>= 7; - for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); - mantissa = exponent & (1 << - nBits) - 1; - exponent >>= - nBits; - nBits += mantissaLength; - for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); - if (exponent === 0) { - exponent = 1 - eBias; - } else if (exponent === eMax) { - return mantissa ? NaN : sign ? - Infinity : Infinity; - } else { - mantissa = mantissa + pow(2, mantissaLength); - exponent = exponent - eBias; - } - return (sign ? - 1 : 1) * mantissa * pow(2, exponent - mantissaLength); - }; - module.exports = { - pack: pack, - unpack: unpack - }; - }, - { - } - ], - 84: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - var classof = _dereq_('../internals/classof-raw'); - var split = ''.split; - // fallback for non-array-like ES3 and non-enumerable old V8 strings - module.exports = fails(function () { - // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 - // eslint-disable-next-line no-prototype-builtins - return !Object('z').propertyIsEnumerable(0); - }) ? function (it) { - return classof(it) == 'String' ? split.call(it, '') : Object(it); - } - : Object; - }, - { - '../internals/classof-raw': 46, - '../internals/fails': 69 - } - ], - 85: [ - function (_dereq_, module, exports) { - var isObject = _dereq_('../internals/is-object'); - var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); - // makes subclassing work correct for wrapped built-ins - module.exports = function ($this, dummy, Wrapper) { - var NewTarget, - NewTargetPrototype; - if ( // it can work only with native `setPrototypeOf` - setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this - typeof (NewTarget = dummy.constructor) == 'function' && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype) setPrototypeOf($this, NewTargetPrototype); - return $this; - }; - }, - { - '../internals/is-object': 92, - '../internals/object-set-prototype-of': 119 - } - ], - 86: [ - function (_dereq_, module, exports) { - var store = _dereq_('../internals/shared-store'); - var functionToString = Function.toString; - // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper - if (typeof store.inspectSource != 'function') { - store.inspectSource = function (it) { - return functionToString.call(it); - }; - } - module.exports = store.inspectSource; - }, - { - '../internals/shared-store': 137 - } - ], - 87: [ - function (_dereq_, module, exports) { - var hiddenKeys = _dereq_('../internals/hidden-keys'); - var isObject = _dereq_('../internals/is-object'); - var has = _dereq_('../internals/has'); - var defineProperty = _dereq_('../internals/object-define-property').f; - var uid = _dereq_('../internals/uid'); - var FREEZING = _dereq_('../internals/freezing'); - var METADATA = uid('meta'); - var id = 0; - var isExtensible = Object.isExtensible || function () { - return true; - }; - var setMetadata = function (it) { - defineProperty(it, METADATA, { - value: { - objectID: 'O' + ++id, - // object ID - weakData: { - } // weak collections IDs - - } - }); - }; - var fastKey = function (it, create) { - // return a primitive with prefix - if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!has(it, METADATA)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMetadata(it); - // return object ID - } - return it[METADATA].objectID; - }; - var getWeakData = function (it, create) { - if (!has(it, METADATA)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMetadata(it); - // return the store of weak collections IDs - } - return it[METADATA].weakData; - }; - // add metadata on freeze-family methods calling - var onFreeze = function (it) { - if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); - return it; - }; - var meta = module.exports = { - REQUIRED: false, - fastKey: fastKey, - getWeakData: getWeakData, - onFreeze: onFreeze - }; - hiddenKeys[METADATA] = true; - }, - { - '../internals/freezing': 71, - '../internals/has': 78, - '../internals/hidden-keys': 79, - '../internals/is-object': 92, - '../internals/object-define-property': 110, - '../internals/uid': 163 - } - ], - 88: [ - function (_dereq_, module, exports) { - var NATIVE_WEAK_MAP = _dereq_('../internals/native-weak-map'); - var global = _dereq_('../internals/global'); - var isObject = _dereq_('../internals/is-object'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var objectHas = _dereq_('../internals/has'); - var sharedKey = _dereq_('../internals/shared-key'); - var hiddenKeys = _dereq_('../internals/hidden-keys'); - var WeakMap = global.WeakMap; - var set, - get, - has; - var enforce = function (it) { - return has(it) ? get(it) : set(it, { - }); - }; - var getterFor = function (TYPE) { - return function (it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError('Incompatible receiver, ' + TYPE + ' required'); - } - return state; - }; - }; - if (NATIVE_WEAK_MAP) { - var store = new WeakMap(); - var wmget = store.get; - var wmhas = store.has; - var wmset = store.set; - set = function (it, metadata) { - wmset.call(store, it, metadata); - return metadata; - }; - get = function (it) { - return wmget.call(store, it) || { - }; - }; - has = function (it) { - return wmhas.call(store, it); - }; - } else { - var STATE = sharedKey('state'); - hiddenKeys[STATE] = true; - set = function (it, metadata) { - createNonEnumerableProperty(it, STATE, metadata); - return metadata; - }; - get = function (it) { - return objectHas(it, STATE) ? it[STATE] : { - }; - }; - has = function (it) { - return objectHas(it, STATE); - }; - } - module.exports = { - set: set, - get: get, - has: has, - enforce: enforce, - getterFor: getterFor - }; - }, - { - '../internals/create-non-enumerable-property': 56, - '../internals/global': 77, - '../internals/has': 78, - '../internals/hidden-keys': 79, - '../internals/is-object': 92, - '../internals/native-weak-map': 103, - '../internals/shared-key': 136 - } - ], - 89: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var Iterators = _dereq_('../internals/iterators'); - var ITERATOR = wellKnownSymbol('iterator'); - var ArrayPrototype = Array.prototype; - // check on default Array iterator - module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); - }; - }, - { - '../internals/iterators': 97, - '../internals/well-known-symbol': 166 - } - ], - 90: [ - function (_dereq_, module, exports) { - var classof = _dereq_('../internals/classof-raw'); - // `IsArray` abstract operation - // https://tc39.github.io/ecma262/#sec-isarray - module.exports = Array.isArray || function isArray(arg) { - return classof(arg) == 'Array'; - }; - }, - { - '../internals/classof-raw': 46 - } - ], - 91: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - var replacement = /#|\.prototype\./; - var isForced = function (feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; - }; - var normalize = isForced.normalize = function (string) { - return String(string).replace(replacement, '.').toLowerCase(); - }; - var data = isForced.data = { - }; - var NATIVE = isForced.NATIVE = 'N'; - var POLYFILL = isForced.POLYFILL = 'P'; - module.exports = isForced; - }, - { - '../internals/fails': 69 - } - ], - 92: [ - function (_dereq_, module, exports) { - module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - }, - { - } - ], - 93: [ - function (_dereq_, module, exports) { - module.exports = false; - }, - { - } - ], - 94: [ - function (_dereq_, module, exports) { - var isObject = _dereq_('../internals/is-object'); - var classof = _dereq_('../internals/classof-raw'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var MATCH = wellKnownSymbol('match'); - // `IsRegExp` abstract operation - // https://tc39.github.io/ecma262/#sec-isregexp - module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); - }; - }, - { - '../internals/classof-raw': 46, - '../internals/is-object': 92, - '../internals/well-known-symbol': 166 - } - ], - 95: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - var isArrayIteratorMethod = _dereq_('../internals/is-array-iterator-method'); - var toLength = _dereq_('../internals/to-length'); - var bind = _dereq_('../internals/function-bind-context'); - var getIteratorMethod = _dereq_('../internals/get-iterator-method'); - var callWithSafeIterationClosing = _dereq_('../internals/call-with-safe-iteration-closing'); - var Result = function (stopped, result) { - this.stopped = stopped; - this.result = result; - }; - var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { - var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1); - var iterator, - iterFn, - index, - length, - result, - next, - step; - if (IS_ITERATOR) { - iterator = iterable; - } else { - iterFn = getIteratorMethod(iterable); - if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); - // optimisation for array iterators - if (isArrayIteratorMethod(iterFn)) { - for (index = 0, length = toLength(iterable.length); length > index; index++) { - result = AS_ENTRIES ? boundFunction(anObject(step = iterable[index]) [0], step[1]) : boundFunction(iterable[index]); - if (result && result instanceof Result) return result; - } - return new Result(false); - } - iterator = iterFn.call(iterable); - } - next = iterator.next; - while (!(step = next.call(iterator)).done) { - result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); - if (typeof result == 'object' && result && result instanceof Result) return result; - } - return new Result(false); - }; - iterate.stop = function (result) { - return new Result(true, result); - }; - }, - { - '../internals/an-object': 28, - '../internals/call-with-safe-iteration-closing': 44, - '../internals/function-bind-context': 72, - '../internals/get-iterator-method': 75, - '../internals/is-array-iterator-method': 89, - '../internals/to-length': 154 - } - ], - 96: [ - function (_dereq_, module, exports) { - 'use strict'; - var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var has = _dereq_('../internals/has'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var IS_PURE = _dereq_('../internals/is-pure'); - var ITERATOR = wellKnownSymbol('iterator'); - var BUGGY_SAFARI_ITERATORS = false; - var returnThis = function () { - return this; - }; - // `%IteratorPrototype%` object - // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object - var IteratorPrototype, - PrototypeOfArrayIteratorPrototype, - arrayIterator; - if ([].keys) { - arrayIterator = [ - ].keys(); - // Safari 8 has buggy iterators w/o `next` - if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } - } - if (IteratorPrototype == undefined) IteratorPrototype = { - }; - // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() - if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { - createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); - } - module.exports = { - IteratorPrototype: IteratorPrototype, - BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS - }; - }, - { - '../internals/create-non-enumerable-property': 56, - '../internals/has': 78, - '../internals/is-pure': 93, - '../internals/object-get-prototype-of': 115, - '../internals/well-known-symbol': 166 - } - ], - 97: [ - function (_dereq_, module, exports) { - module.exports = { - }; - }, - { - } - ], - 98: [ - function (_dereq_, module, exports) { - // `Math.sign` method implementation - // https://tc39.github.io/ecma262/#sec-math.sign - module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = + x) == 0 || x != x ? x : x < 0 ? - 1 : 1; - }; - }, - { - } - ], - 99: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; - var classof = _dereq_('../internals/classof-raw'); - var macrotask = _dereq_('../internals/task').set; - var IS_IOS = _dereq_('../internals/engine-is-ios'); - var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; - var process = global.process; - var Promise = global.Promise; - var IS_NODE = classof(process) == 'process'; - // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` - var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); - var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; - var flush, - head, - last, - notify, - toggle, - node, - promise, - then; - // modern engines have queueMicrotask method - if (!queueMicrotask) { - flush = function () { - var parent, - fn; - if (IS_NODE && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (error) { - if (head) notify(); - else last = undefined; - throw error; - } - } - last = undefined; - if (parent) parent.enter(); - }; - // Node.js - if (IS_NODE) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 - } else if (MutationObserver && !IS_IOS) { - toggle = true; - node = document.createTextNode(''); - new MutationObserver(flush).observe(node, { - characterData: true - }); - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - promise = Promise.resolve(undefined); - then = promise.then; - notify = function () { - then.call(promise, flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - } - module.exports = queueMicrotask || function (fn) { - var task = { - fn: fn, - next: undefined - }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } - last = task; - }; - }, - { - '../internals/classof-raw': 46, - '../internals/engine-is-ios': 64, - '../internals/global': 77, - '../internals/object-get-own-property-descriptor': 111, - '../internals/task': 148 - } - ], - 100: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - module.exports = global.Promise; - }, - { - '../internals/global': 77 - } - ], - 101: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - module.exports = !!Object.getOwnPropertySymbols && !fails(function () { - // Chrome 38 Symbol has incorrect toString conversion - // eslint-disable-next-line no-undef - return !String(Symbol()); - }); - }, - { - '../internals/fails': 69 - } - ], - 102: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var IS_PURE = _dereq_('../internals/is-pure'); - var ITERATOR = wellKnownSymbol('iterator'); - module.exports = !fails(function () { - var url = new URL('b?a=1&b=2&c=3', 'http://a'); - var searchParams = url.searchParams; - var result = ''; - url.pathname = 'c%20d'; - searchParams.forEach(function (value, key) { - searchParams['delete']('b'); - result += key + value; - }); - return IS_PURE && !url.toJSON || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[ITERATOR] // throws in Edge - || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge - || new URL('http://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- - || new URL('http://a#б').hash !== '#%D0%B1' // fails in Chrome 66- - || result !== 'a1c3' // throws in Safari - || new URL('http://x', undefined).host !== 'x'; - }); - }, - { - '../internals/fails': 69, - '../internals/is-pure': 93, - '../internals/well-known-symbol': 166 - } - ], - 103: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var inspectSource = _dereq_('../internals/inspect-source'); - var WeakMap = global.WeakMap; - module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); - }, - { - '../internals/global': 77, - '../internals/inspect-source': 86 - } - ], - 104: [ - function (_dereq_, module, exports) { - 'use strict'; - var aFunction = _dereq_('../internals/a-function'); - var PromiseCapability = function (C) { - var resolve, - reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); - }; - // 25.4.1.5 NewPromiseCapability(C) - module.exports.f = function (C) { - return new PromiseCapability(C); - }; - }, - { - '../internals/a-function': 23 - } - ], - 105: [ - function (_dereq_, module, exports) { - var isRegExp = _dereq_('../internals/is-regexp'); - module.exports = function (it) { - if (isRegExp(it)) { - throw TypeError('The method doesn\'t accept regular expressions'); - } - return it; - }; - }, - { - '../internals/is-regexp': 94 - } - ], - 106: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var globalIsFinite = global.isFinite; - // `Number.isFinite` method - // https://tc39.github.io/ecma262/#sec-number.isfinite - module.exports = Number.isFinite || function isFinite(it) { - return typeof it == 'number' && globalIsFinite(it); - }; - }, - { - '../internals/global': 77 - } - ], - 107: [ - function (_dereq_, module, exports) { - 'use strict'; - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var fails = _dereq_('../internals/fails'); - var objectKeys = _dereq_('../internals/object-keys'); - var getOwnPropertySymbolsModule = _dereq_('../internals/object-get-own-property-symbols'); - var propertyIsEnumerableModule = _dereq_('../internals/object-property-is-enumerable'); - var toObject = _dereq_('../internals/to-object'); - var IndexedObject = _dereq_('../internals/indexed-object'); - var nativeAssign = Object.assign; - var defineProperty = Object.defineProperty; - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - module.exports = !nativeAssign || fails(function () { - // should have correct order of operations (Edge bug) - if (DESCRIPTORS && nativeAssign({ - b: 1 - }, nativeAssign(defineProperty({ - }, 'a', { - enumerable: true, - get: function () { - defineProperty(this, 'b', { - value: 3, - enumerable: false - }); - } - }), { - b: 2 - })).b !== 1) return true; - // should work with symbols and should have deterministic property order (V8 bug) - var A = { - }; - var B = { - }; - // eslint-disable-next-line no-undef - var symbol = Symbol(); - var alphabet = 'abcdefghijklmnopqrst'; - A[symbol] = 7; - alphabet.split('').forEach(function (chr) { - B[chr] = chr; - }); - return nativeAssign({ - }, A) [symbol] != 7 || objectKeys(nativeAssign({ - }, B)).join('') != alphabet; - }) ? function assign(target, source) { - // eslint-disable-line no-unused-vars - var T = toObject(target); - var argumentsLength = arguments.length; - var index = 1; - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - var propertyIsEnumerable = propertyIsEnumerableModule.f; - while (argumentsLength > index) { - var S = IndexedObject(arguments[index++]); - var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; - } - } - return T; - } - : nativeAssign; - }, - { - '../internals/descriptors': 61, - '../internals/fails': 69, - '../internals/indexed-object': 84, - '../internals/object-get-own-property-symbols': 114, - '../internals/object-keys': 117, - '../internals/object-property-is-enumerable': 118, - '../internals/to-object': 155 - } - ], - 108: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - var defineProperties = _dereq_('../internals/object-define-properties'); - var enumBugKeys = _dereq_('../internals/enum-bug-keys'); - var hiddenKeys = _dereq_('../internals/hidden-keys'); - var html = _dereq_('../internals/html'); - var documentCreateElement = _dereq_('../internals/document-create-element'); - var sharedKey = _dereq_('../internals/shared-key'); - var GT = '>'; - var LT = '<'; - var PROTOTYPE = 'prototype'; - var SCRIPT = 'script'; - var IE_PROTO = sharedKey('IE_PROTO'); - var EmptyConstructor = function () { /* empty */ - }; - var scriptTag = function (content) { - return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; - }; - // Create object with fake `null` prototype: use ActiveX Object with cleared prototype - var NullProtoObjectViaActiveX = function (activeXDocument) { - activeXDocument.write(scriptTag('')); - activeXDocument.close(); - var temp = activeXDocument.parentWindow.Object; - activeXDocument = null; // avoid memory leak - return temp; - }; - // Create object with fake `null` prototype: use iframe Object with cleared prototype - var NullProtoObjectViaIFrame = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = documentCreateElement('iframe'); - var JS = 'java' + SCRIPT + ':'; - var iframeDocument; - iframe.style.display = 'none'; - html.appendChild(iframe); - // https://github.com/zloirock/core-js/issues/475 - iframe.src = String(JS); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(scriptTag('document.F=Object')); - iframeDocument.close(); - return iframeDocument.F; - }; - // Check for document.domain and active x support - // No need to use active x approach when document.domain is not set - // see https://github.com/es-shims/es5-shim/issues/150 - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 - // avoid IE GC bug - var activeXDocument; - var NullProtoObject = function () { - try { - /* global ActiveXObject */ - activeXDocument = document.domain && new ActiveXObject('htmlfile'); - } catch (error) { /* ignore */ - } - NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); - var length = enumBugKeys.length; - while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return NullProtoObject(); - }; - hiddenKeys[IE_PROTO] = true; - // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create - module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - EmptyConstructor[PROTOTYPE] = anObject(O); - result = new EmptyConstructor(); - EmptyConstructor[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = NullProtoObject(); - return Properties === undefined ? result : defineProperties(result, Properties); - }; - }, - { - '../internals/an-object': 28, - '../internals/document-create-element': 62, - '../internals/enum-bug-keys': 67, - '../internals/hidden-keys': 79, - '../internals/html': 81, - '../internals/object-define-properties': 109, - '../internals/shared-key': 136 - } - ], - 109: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var anObject = _dereq_('../internals/an-object'); - var objectKeys = _dereq_('../internals/object-keys'); - // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties - module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var index = 0; - var key; - while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); - return O; - }; - }, - { - '../internals/an-object': 28, - '../internals/descriptors': 61, - '../internals/object-define-property': 110, - '../internals/object-keys': 117 - } - ], - 110: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var IE8_DOM_DEFINE = _dereq_('../internals/ie8-dom-define'); - var anObject = _dereq_('../internals/an-object'); - var toPrimitive = _dereq_('../internals/to-primitive'); - var nativeDefineProperty = Object.defineProperty; - // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty - exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { /* empty */ - } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; - }; - }, - { - '../internals/an-object': 28, - '../internals/descriptors': 61, - '../internals/ie8-dom-define': 82, - '../internals/to-primitive': 158 - } - ], - 111: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var propertyIsEnumerableModule = _dereq_('../internals/object-property-is-enumerable'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var toPrimitive = _dereq_('../internals/to-primitive'); - var has = _dereq_('../internals/has'); - var IE8_DOM_DEFINE = _dereq_('../internals/ie8-dom-define'); - var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor - exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return nativeGetOwnPropertyDescriptor(O, P); - } catch (error) { /* empty */ - } - if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); - }; - }, - { - '../internals/create-property-descriptor': 57, - '../internals/descriptors': 61, - '../internals/has': 78, - '../internals/ie8-dom-define': 82, - '../internals/object-property-is-enumerable': 118, - '../internals/to-indexed-object': 152, - '../internals/to-primitive': 158 - } - ], - 112: [ - function (_dereq_, module, exports) { - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var nativeGetOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; - var toString = { - }.toString; - var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [ - ]; - var getWindowNames = function (it) { - try { - return nativeGetOwnPropertyNames(it); - } catch (error) { - return windowNames.slice(); - } - }; - // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window - module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it)); - }; - }, - { - '../internals/object-get-own-property-names': 113, - '../internals/to-indexed-object': 152 - } - ], - 113: [ - function (_dereq_, module, exports) { - var internalObjectKeys = _dereq_('../internals/object-keys-internal'); - var enumBugKeys = _dereq_('../internals/enum-bug-keys'); - var hiddenKeys = enumBugKeys.concat('length', 'prototype'); - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); - }; - }, - { - '../internals/enum-bug-keys': 67, - '../internals/object-keys-internal': 116 - } - ], - 114: [ - function (_dereq_, module, exports) { - exports.f = Object.getOwnPropertySymbols; - }, - { - } - ], - 115: [ - function (_dereq_, module, exports) { - var has = _dereq_('../internals/has'); - var toObject = _dereq_('../internals/to-object'); - var sharedKey = _dereq_('../internals/shared-key'); - var CORRECT_PROTOTYPE_GETTER = _dereq_('../internals/correct-prototype-getter'); - var IE_PROTO = sharedKey('IE_PROTO'); - var ObjectPrototype = Object.prototype; - // `Object.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.getprototypeof - module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } - return O instanceof Object ? ObjectPrototype : null; - }; - }, - { - '../internals/correct-prototype-getter': 53, - '../internals/has': 78, - '../internals/shared-key': 136, - '../internals/to-object': 155 - } - ], - 116: [ - function (_dereq_, module, exports) { - var has = _dereq_('../internals/has'); - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var indexOf = _dereq_('../internals/array-includes').indexOf; - var hiddenKeys = _dereq_('../internals/hidden-keys'); - module.exports = function (object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = [ - ]; - var key; - for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~indexOf(result, key) || result.push(key); - } - return result; - }; - }, - { - '../internals/array-includes': 36, - '../internals/has': 78, - '../internals/hidden-keys': 79, - '../internals/to-indexed-object': 152 - } - ], - 117: [ - function (_dereq_, module, exports) { - var internalObjectKeys = _dereq_('../internals/object-keys-internal'); - var enumBugKeys = _dereq_('../internals/enum-bug-keys'); - // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys - module.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); - }; - }, - { - '../internals/enum-bug-keys': 67, - '../internals/object-keys-internal': 116 - } - ], - 118: [ - function (_dereq_, module, exports) { - 'use strict'; - var nativePropertyIsEnumerable = { - }.propertyIsEnumerable; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - // Nashorn ~ JDK8 bug - var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ - 1: 2 - }, 1); - // `Object.prototype.propertyIsEnumerable` method implementation - // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable - exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } - : nativePropertyIsEnumerable; - }, - { - } - ], - 119: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - var aPossiblePrototype = _dereq_('../internals/a-possible-prototype'); - // `Object.setPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.setprototypeof - // Works with __proto__ only. Old v8 can't work with null proto objects. - /* eslint-disable no-proto */ - module.exports = Object.setPrototypeOf || ('__proto__' in { - } - ? function () { - var CORRECT_SETTER = false; - var test = { - }; - var setter; - try { - setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; - setter.call(test, [ - ]); - CORRECT_SETTER = test instanceof Array; - } catch (error) { /* empty */ - } - return function setPrototypeOf(O, proto) { - anObject(O); - aPossiblePrototype(proto); - if (CORRECT_SETTER) setter.call(O, proto); - else O.__proto__ = proto; - return O; - }; - }() : undefined); - }, - { - '../internals/a-possible-prototype': 24, - '../internals/an-object': 28 - } - ], - 120: [ - function (_dereq_, module, exports) { - 'use strict'; - var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support'); - var classof = _dereq_('../internals/classof'); - // `Object.prototype.toString` method implementation - // https://tc39.github.io/ecma262/#sec-object.prototype.tostring - module.exports = TO_STRING_TAG_SUPPORT ? { - }.toString : function toString() { - return '[object ' + classof(this) + ']'; - }; - }, - { - '../internals/classof': 47, - '../internals/to-string-tag-support': 159 - } - ], - 121: [ - function (_dereq_, module, exports) { - var getBuiltIn = _dereq_('../internals/get-built-in'); - var getOwnPropertyNamesModule = _dereq_('../internals/object-get-own-property-names'); - var getOwnPropertySymbolsModule = _dereq_('../internals/object-get-own-property-symbols'); - var anObject = _dereq_('../internals/an-object'); - // all object keys, includes non-enumerable and symbols - module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { - var keys = getOwnPropertyNamesModule.f(anObject(it)); - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; - }; - }, - { - '../internals/an-object': 28, - '../internals/get-built-in': 74, - '../internals/object-get-own-property-names': 113, - '../internals/object-get-own-property-symbols': 114 - } - ], - 122: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - module.exports = global; - }, - { - '../internals/global': 77 - } - ], - 123: [ - function (_dereq_, module, exports) { - module.exports = function (exec) { - try { - return { - error: false, - value: exec() - }; - } catch (error) { - return { - error: true, - value: error - }; - } - }; - }, - { - } - ], - 124: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - var isObject = _dereq_('../internals/is-object'); - var newPromiseCapability = _dereq_('../internals/new-promise-capability'); - module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; - }; - }, - { - '../internals/an-object': 28, - '../internals/is-object': 92, - '../internals/new-promise-capability': 104 - } - ], - 125: [ - function (_dereq_, module, exports) { - var redefine = _dereq_('../internals/redefine'); - module.exports = function (target, src, options) { - for (var key in src) redefine(target, key, src[key], options); - return target; - }; - }, - { - '../internals/redefine': 126 - } - ], - 126: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var has = _dereq_('../internals/has'); - var setGlobal = _dereq_('../internals/set-global'); - var inspectSource = _dereq_('../internals/inspect-source'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var getInternalState = InternalStateModule.get; - var enforceInternalState = InternalStateModule.enforce; - var TEMPLATE = String(String).split('String'); - (module.exports = function (O, key, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - if (typeof value == 'function') { - if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); - enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); - } - if (O === global) { - if (simple) O[key] = value; - else setGlobal(key, value); - return; - } else if (!unsafe) { - delete O[key]; - } else if (!noTargetGet && O[key]) { - simple = true; - } - if (simple) O[key] = value; - else createNonEnumerableProperty(O, key, value); - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - }) (Function.prototype, 'toString', function toString() { - return typeof this == 'function' && getInternalState(this).source || inspectSource(this); - }); - }, - { - '../internals/create-non-enumerable-property': 56, - '../internals/global': 77, - '../internals/has': 78, - '../internals/inspect-source': 86, - '../internals/internal-state': 88, - '../internals/set-global': 133 - } - ], - 127: [ - function (_dereq_, module, exports) { - var classof = _dereq_('./classof-raw'); - var regexpExec = _dereq_('./regexp-exec'); - // `RegExpExec` abstract operation - // https://tc39.github.io/ecma262/#sec-regexpexec - module.exports = function (R, S) { - var exec = R.exec; - if (typeof exec === 'function') { - var result = exec.call(R, S); - if (typeof result !== 'object') { - throw TypeError('RegExp exec method returned something other than an Object or null'); - } - return result; - } - if (classof(R) !== 'RegExp') { - throw TypeError('RegExp#exec called on incompatible receiver'); - } - return regexpExec.call(R, S); - }; - }, - { - './classof-raw': 46, - './regexp-exec': 128 - } - ], - 128: [ - function (_dereq_, module, exports) { - 'use strict'; - var regexpFlags = _dereq_('./regexp-flags'); - var stickyHelpers = _dereq_('./regexp-sticky-helpers'); - var nativeExec = RegExp.prototype.exec; - // This always refers to the native implementation, because the - // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, - // which loads this file before patching the method. - var nativeReplace = String.prototype.replace; - var patchedExec = nativeExec; - var UPDATES_LAST_INDEX_WRONG = function () { - var re1 = /a/; - var re2 = /b*/g; - nativeExec.call(re1, 'a'); - nativeExec.call(re2, 'a'); - return re1.lastIndex !== 0 || re2.lastIndex !== 0; - }(); - var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET; - // nonparticipating capturing group, copied from es5-shim's String#split patch. - var NPCG_INCLUDED = /()??/.exec('') [1] !== undefined; - var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y; - if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, - reCopy, - match, - i; - var sticky = UNSUPPORTED_Y && re.sticky; - var flags = regexpFlags.call(re); - var source = re.source; - var charsAdded = 0; - var strCopy = str; - if (sticky) { - flags = flags.replace('y', ''); - if (flags.indexOf('g') === - 1) { - flags += 'g'; - } - strCopy = String(str).slice(re.lastIndex); - // Support anchored sticky behavior. - if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) { - source = '(?: ' + source + ')'; - strCopy = ' ' + strCopy; - charsAdded++; - } // ^(? + rx + ) is needed, in combination with some str slicing, to - // simulate the 'y' flag. - - reCopy = new RegExp('^(?:' + source + ')', flags); - } - if (NPCG_INCLUDED) { - reCopy = new RegExp('^' + source + '$(?!\\s)', flags); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; - match = nativeExec.call(sticky ? reCopy : re, strCopy); - if (sticky) { - if (match) { - match.input = match.input.slice(charsAdded); - match[0] = match[0].slice(charsAdded); - match.index = re.lastIndex; - re.lastIndex += match[0].length; - } else re.lastIndex = 0; - } else if (UPDATES_LAST_INDEX_WRONG && match) { - re.lastIndex = re.global ? match.index + match[0].length : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } - return match; - }; - } - module.exports = patchedExec; - }, - { - './regexp-flags': 129, - './regexp-sticky-helpers': 130 - } - ], - 129: [ - function (_dereq_, module, exports) { - 'use strict'; - var anObject = _dereq_('../internals/an-object'); - // `RegExp.prototype.flags` getter implementation - // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags - module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.dotAll) result += 's'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; - }; - }, - { - '../internals/an-object': 28 - } - ], - 130: [ - function (_dereq_, module, exports) { - 'use strict'; - var fails = _dereq_('./fails'); - // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, - // so we use an intermediate function. - function RE(s, f) { - return RegExp(s, f); - } - exports.UNSUPPORTED_Y = fails(function () { - // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError - var re = RE('a', 'y'); - re.lastIndex = 2; - return re.exec('abcd') != null; - }); - exports.BROKEN_CARET = fails(function () { - // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 - var re = RE('^r', 'gy'); - re.lastIndex = 2; - return re.exec('str') != null; - }); - }, - { - './fails': 69 - } - ], - 131: [ - function (_dereq_, module, exports) { - // `RequireObjectCoercible` abstract operation - // https://tc39.github.io/ecma262/#sec-requireobjectcoercible - module.exports = function (it) { - if (it == undefined) throw TypeError('Can\'t call method on ' + it); - return it; - }; - }, - { - } - ], - 132: [ - function (_dereq_, module, exports) { - // `SameValue` abstract operation - // https://tc39.github.io/ecma262/#sec-samevalue - module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; - }; - }, - { - } - ], - 133: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - module.exports = function (key, value) { - try { - createNonEnumerableProperty(global, key, value); - } catch (error) { - global[key] = value; - } - return value; - }; - }, - { - '../internals/create-non-enumerable-property': 56, - '../internals/global': 77 - } - ], - 134: [ - function (_dereq_, module, exports) { - 'use strict'; - var getBuiltIn = _dereq_('../internals/get-built-in'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var SPECIES = wellKnownSymbol('species'); - module.exports = function (CONSTRUCTOR_NAME) { - var Constructor = getBuiltIn(CONSTRUCTOR_NAME); - var defineProperty = definePropertyModule.f; - if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { - defineProperty(Constructor, SPECIES, { - configurable: true, - get: function () { - return this; - } - }); - } - }; - }, - { - '../internals/descriptors': 61, - '../internals/get-built-in': 74, - '../internals/object-define-property': 110, - '../internals/well-known-symbol': 166 - } - ], - 135: [ - function (_dereq_, module, exports) { - var defineProperty = _dereq_('../internals/object-define-property').f; - var has = _dereq_('../internals/has'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - module.exports = function (it, TAG, STATIC) { - if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { - defineProperty(it, TO_STRING_TAG, { - configurable: true, - value: TAG - }); - } - }; - }, - { - '../internals/has': 78, - '../internals/object-define-property': 110, - '../internals/well-known-symbol': 166 - } - ], - 136: [ - function (_dereq_, module, exports) { - var shared = _dereq_('../internals/shared'); - var uid = _dereq_('../internals/uid'); - var keys = shared('keys'); - module.exports = function (key) { - return keys[key] || (keys[key] = uid(key)); - }; - }, - { - '../internals/shared': 138, - '../internals/uid': 163 - } - ], - 137: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var setGlobal = _dereq_('../internals/set-global'); - var SHARED = '__core-js_shared__'; - var store = global[SHARED] || setGlobal(SHARED, { - }); - module.exports = store; - }, - { - '../internals/global': 77, - '../internals/set-global': 133 - } - ], - 138: [ - function (_dereq_, module, exports) { - var IS_PURE = _dereq_('../internals/is-pure'); - var store = _dereq_('../internals/shared-store'); - (module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : { - }); - }) ('versions', [ - ]).push({ - version: '3.6.5', - mode: IS_PURE ? 'pure' : 'global', - copyright: '© 2020 Denis Pushkarev (zloirock.ru)' - }); - }, - { - '../internals/is-pure': 93, - '../internals/shared-store': 137 - } - ], - 139: [ - function (_dereq_, module, exports) { - var anObject = _dereq_('../internals/an-object'); - var aFunction = _dereq_('../internals/a-function'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var SPECIES = wellKnownSymbol('species'); - // `SpeciesConstructor` abstract operation - // https://tc39.github.io/ecma262/#sec-speciesconstructor - module.exports = function (O, defaultConstructor) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C) [SPECIES]) == undefined ? defaultConstructor : aFunction(S); - }; - }, - { - '../internals/a-function': 23, - '../internals/an-object': 28, - '../internals/well-known-symbol': 166 - } - ], - 140: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - // check the existence of a method, lowercase - // of a tag and escaping quotes in arguments - module.exports = function (METHOD_NAME) { - return fails(function () { - var test = ''[METHOD_NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }); - }; - }, - { - '../internals/fails': 69 - } - ], - 141: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_('../internals/to-integer'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - // `String.prototype.{ codePointAt, at }` methods implementation - var createMethod = function (CONVERT_TO_STRING) { - return function ($this, pos) { - var S = String(requireObjectCoercible($this)); - var position = toInteger(pos); - var size = S.length; - var first, - second; - if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; - first = S.charCodeAt(position); - return first < 55296 || first > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536; - }; - }; - module.exports = { - // `String.prototype.codePointAt` method - // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat - codeAt: createMethod(false), - // `String.prototype.at` method - // https://github.com/mathiasbynens/String.prototype.at - charAt: createMethod(true) - }; - }, - { - '../internals/require-object-coercible': 131, - '../internals/to-integer': 153 - } - ], - 142: [ - function (_dereq_, module, exports) { - // https://github.com/zloirock/core-js/issues/280 - var userAgent = _dereq_('../internals/engine-user-agent'); - // eslint-disable-next-line unicorn/no-unsafe-regex - module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); - }, - { - '../internals/engine-user-agent': 65 - } - ], - 143: [ - function (_dereq_, module, exports) { - // https://github.com/tc39/proposal-string-pad-start-end - var toLength = _dereq_('../internals/to-length'); - var repeat = _dereq_('../internals/string-repeat'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var ceil = Math.ceil; - // `String.prototype.{ padStart, padEnd }` methods implementation - var createMethod = function (IS_END) { - return function ($this, maxLength, fillString) { - var S = String(requireObjectCoercible($this)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - var fillLen, - stringFiller; - if (intMaxLength <= stringLength || fillStr == '') return S; - fillLen = intMaxLength - stringLength; - stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return IS_END ? S + stringFiller : stringFiller + S; - }; - }; - module.exports = { - // `String.prototype.padStart` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padstart - start: createMethod(false), - // `String.prototype.padEnd` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padend - end: createMethod(true) - }; - }, - { - '../internals/require-object-coercible': 131, - '../internals/string-repeat': 145, - '../internals/to-length': 154 - } - ], - 144: [ - function (_dereq_, module, exports) { - 'use strict'; - // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js - var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - var base = 36; - var tMin = 1; - var tMax = 26; - var skew = 38; - var damp = 700; - var initialBias = 72; - var initialN = 128; // 0x80 - var delimiter = '-'; // '\x2D' - var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars - var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; - var baseMinusTMin = base - tMin; - var floor = Math.floor; - var stringFromCharCode = String.fromCharCode; - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - */ - var ucs2decode = function (string) { - var output = [ - ]; - var counter = 0; - var length = string.length; - while (counter < length) { - var value = string.charCodeAt(counter++); - if (value >= 55296 && value <= 56319 && counter < length) { - // It's a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 64512) == 56320) { - // Low surrogate. - output.push(((value & 1023) << 10) + (extra & 1023) + 65536); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - }; - /** - * Converts a digit/integer into a basic code point. - */ - var digitToBasic = function (digit) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26); - }; - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - */ - var adapt = function (delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - }; - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - */ - // eslint-disable-next-line max-statements - var encode = function (input) { - var output = [ - ]; - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - // Cache the length. - var inputLength = input.length; - // Initialize the state. - var n = initialN; - var delta = 0; - var bias = initialBias; - var i, - currentValue; - // Handle the basic code points. - for (i = 0; i < input.length; i++) { - currentValue = input[i]; - if (currentValue < 128) { - output.push(stringFromCharCode(currentValue)); - } - } - var basicLength = output.length; // number of basic code points. - var handledCPCount = basicLength; // number of code points that have been handled; - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } // Main encoding loop: - - while (handledCPCount < inputLength) { - // All non-basic code points < n have been handled already. Find the next larger one: - var m = maxInt; - for (i = 0; i < input.length; i++) { - currentValue = input[i]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } // Increase `delta` enough to advance the decoder's state to , but guard against overflow. - - var handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - throw RangeError(OVERFLOW_ERROR); - } - delta += (m - n) * handledCPCountPlusOne; - n = m; - for (i = 0; i < input.length; i++) { - currentValue = input[i]; - if (currentValue < n && ++delta > maxInt) { - throw RangeError(OVERFLOW_ERROR); - } - if (currentValue == n) { - // Represent delta as a generalized variable-length integer. - var q = delta; - for /* no condition */ - (var k = base; ; k += base) { - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (q < t) break; - var qMinusT = q - t; - var baseMinusT = base - t; - output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); - q = floor(qMinusT / baseMinusT); - } - output.push(stringFromCharCode(digitToBasic(q))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - ++delta; - ++n; - } - return output.join(''); - }; - module.exports = function (input) { - var encoded = [ - ]; - var labels = input.toLowerCase().replace(regexSeparators, '.').split('.'); - var i, - label; - for (i = 0; i < labels.length; i++) { - label = labels[i]; - encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); - } - return encoded.join('.'); - }; - }, - { - } - ], - 145: [ - function (_dereq_, module, exports) { - 'use strict'; - var toInteger = _dereq_('../internals/to-integer'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - // `String.prototype.repeat` method implementation - // https://tc39.github.io/ecma262/#sec-string.prototype.repeat - module.exports = ''.repeat || function repeat(count) { - var str = String(requireObjectCoercible(this)); - var result = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions'); - for (; n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; - return result; - }; - }, - { - '../internals/require-object-coercible': 131, - '../internals/to-integer': 153 - } - ], - 146: [ - function (_dereq_, module, exports) { - var fails = _dereq_('../internals/fails'); - var whitespaces = _dereq_('../internals/whitespaces'); - var non = '​…᠎'; - // check that a method works with the correct list - // of whitespaces and has a correct name - module.exports = function (METHOD_NAME) { - return fails(function () { - return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; - }); - }; - }, - { - '../internals/fails': 69, - '../internals/whitespaces': 167 - } - ], - 147: [ - function (_dereq_, module, exports) { - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var whitespaces = _dereq_('../internals/whitespaces'); - var whitespace = '[' + whitespaces + ']'; - var ltrim = RegExp('^' + whitespace + whitespace + '*'); - var rtrim = RegExp(whitespace + whitespace + '*$'); - // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation - var createMethod = function (TYPE) { - return function ($this) { - var string = String(requireObjectCoercible($this)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; - }; - }; - module.exports = { - // `String.prototype.{ trimLeft, trimStart }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart - start: createMethod(1), - // `String.prototype.{ trimRight, trimEnd }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimend - end: createMethod(2), - // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim - trim: createMethod(3) - }; - }, - { - '../internals/require-object-coercible': 131, - '../internals/whitespaces': 167 - } - ], - 148: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var fails = _dereq_('../internals/fails'); - var classof = _dereq_('../internals/classof-raw'); - var bind = _dereq_('../internals/function-bind-context'); - var html = _dereq_('../internals/html'); - var createElement = _dereq_('../internals/document-create-element'); - var IS_IOS = _dereq_('../internals/engine-is-ios'); - var location = global.location; - var set = global.setImmediate; - var clear = global.clearImmediate; - var process = global.process; - var MessageChannel = global.MessageChannel; - var Dispatch = global.Dispatch; - var counter = 0; - var queue = { - }; - var ONREADYSTATECHANGE = 'onreadystatechange'; - var defer, - channel, - port; - var run = function (id) { - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } - }; - var runner = function (id) { - return function () { - run(id); - }; - }; - var listener = function (event) { - run(event.data); - }; - var post = function (id) { - // old engines have not location.origin - global.postMessage(id + '', location.protocol + '//' + location.host); - }; - // Node.js 0.9+ & IE10+ has setImmediate, otherwise: - if (!set || !clear) { - set = function setImmediate(fn) { - var args = [ - ]; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); - }; - defer(counter); - return counter; - }; - clear = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (classof(process) == 'process') { - defer = function (id) { - process.nextTick(runner(id)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(runner(id)); - }; - // Browsers with MessageChannel, includes WebWorkers - // except iOS - https://github.com/zloirock/core-js/issues/624 - } else if (MessageChannel && !IS_IOS) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = bind(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post) && location.protocol !== 'file:') { - defer = post; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in createElement('script')) { - defer = function (id) { - html.appendChild(createElement('script')) [ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(runner(id), 0); - }; - } - } - module.exports = { - set: set, - clear: clear - }; - }, - { - '../internals/classof-raw': 46, - '../internals/document-create-element': 62, - '../internals/engine-is-ios': 64, - '../internals/fails': 69, - '../internals/function-bind-context': 72, - '../internals/global': 77, - '../internals/html': 81 - } - ], - 149: [ - function (_dereq_, module, exports) { - var classof = _dereq_('../internals/classof-raw'); - // `thisNumberValue` abstract operation - // https://tc39.github.io/ecma262/#sec-thisnumbervalue - module.exports = function (value) { - if (typeof value != 'number' && classof(value) != 'Number') { - throw TypeError('Incorrect invocation'); - } - return + value; - }; - }, - { - '../internals/classof-raw': 46 - } - ], - 150: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_('../internals/to-integer'); - var max = Math.max; - var min = Math.min; - // Helper for a popular repeating case of the spec: - // Let integer be ? ToInteger(index). - // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). - module.exports = function (index, length) { - var integer = toInteger(index); - return integer < 0 ? max(integer + length, 0) : min(integer, length); - }; - }, - { - '../internals/to-integer': 153 - } - ], - 151: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_('../internals/to-integer'); - var toLength = _dereq_('../internals/to-length'); - // `ToIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-toindex - module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length or index'); - return length; - }; - }, - { - '../internals/to-integer': 153, - '../internals/to-length': 154 - } - ], - 152: [ - function (_dereq_, module, exports) { - // toObject with fallback for non-array-like ES3 strings - var IndexedObject = _dereq_('../internals/indexed-object'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - module.exports = function (it) { - return IndexedObject(requireObjectCoercible(it)); - }; - }, - { - '../internals/indexed-object': 84, - '../internals/require-object-coercible': 131 - } - ], - 153: [ - function (_dereq_, module, exports) { - var ceil = Math.ceil; - var floor = Math.floor; - // `ToInteger` abstract operation - // https://tc39.github.io/ecma262/#sec-tointeger - module.exports = function (argument) { - return isNaN(argument = + argument) ? 0 : (argument > 0 ? floor : ceil) (argument); - }; - }, - { - } - ], - 154: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_('../internals/to-integer'); - var min = Math.min; - // `ToLength` abstract operation - // https://tc39.github.io/ecma262/#sec-tolength - module.exports = function (argument) { - return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0; // 2 ** 53 - 1 == 9007199254740991 - }; - }, - { - '../internals/to-integer': 153 - } - ], - 155: [ - function (_dereq_, module, exports) { - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - // `ToObject` abstract operation - // https://tc39.github.io/ecma262/#sec-toobject - module.exports = function (argument) { - return Object(requireObjectCoercible(argument)); - }; - }, - { - '../internals/require-object-coercible': 131 - } - ], - 156: [ - function (_dereq_, module, exports) { - var toPositiveInteger = _dereq_('../internals/to-positive-integer'); - module.exports = function (it, BYTES) { - var offset = toPositiveInteger(it); - if (offset % BYTES) throw RangeError('Wrong offset'); - return offset; - }; - }, - { - '../internals/to-positive-integer': 157 - } - ], - 157: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_('../internals/to-integer'); - module.exports = function (it) { - var result = toInteger(it); - if (result < 0) throw RangeError('The argument can\'t be less than 0'); - return result; - }; - }, - { - '../internals/to-integer': 153 - } - ], - 158: [ - function (_dereq_, module, exports) { - var isObject = _dereq_('../internals/is-object'); - // `ToPrimitive` abstract operation - // https://tc39.github.io/ecma262/#sec-toprimitive - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - module.exports = function (input, PREFERRED_STRING) { - if (!isObject(input)) return input; - var fn, - val; - if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; - if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; - if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; - throw TypeError('Can\'t convert object to primitive value'); - }; - }, - { - '../internals/is-object': 92 - } - ], - 159: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - var test = { - }; - test[TO_STRING_TAG] = 'z'; - module.exports = String(test) === '[object z]'; - }, - { - '../internals/well-known-symbol': 166 - } - ], - 160: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var global = _dereq_('../internals/global'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = _dereq_('../internals/typed-array-constructors-require-wrappers'); - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var ArrayBufferModule = _dereq_('../internals/array-buffer'); - var anInstance = _dereq_('../internals/an-instance'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var toLength = _dereq_('../internals/to-length'); - var toIndex = _dereq_('../internals/to-index'); - var toOffset = _dereq_('../internals/to-offset'); - var toPrimitive = _dereq_('../internals/to-primitive'); - var has = _dereq_('../internals/has'); - var classof = _dereq_('../internals/classof'); - var isObject = _dereq_('../internals/is-object'); - var create = _dereq_('../internals/object-create'); - var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); - var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; - var typedArrayFrom = _dereq_('../internals/typed-array-from'); - var forEach = _dereq_('../internals/array-iteration').forEach; - var setSpecies = _dereq_('../internals/set-species'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var inheritIfRequired = _dereq_('../internals/inherit-if-required'); - var getInternalState = InternalStateModule.get; - var setInternalState = InternalStateModule.set; - var nativeDefineProperty = definePropertyModule.f; - var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - var round = Math.round; - var RangeError = global.RangeError; - var ArrayBuffer = ArrayBufferModule.ArrayBuffer; - var DataView = ArrayBufferModule.DataView; - var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; - var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; - var TypedArray = ArrayBufferViewCore.TypedArray; - var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; - var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; - var isTypedArray = ArrayBufferViewCore.isTypedArray; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var WRONG_LENGTH = 'Wrong length'; - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C)) (length); - while (length > index) result[index] = list[index++]; - return result; - }; - var addGetter = function (it, key) { - nativeDefineProperty(it, key, { - get: function () { - return getInternalState(this) [key]; - } - }); - }; - var isArrayBuffer = function (it) { - var klass; - return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; - }; - var isTypedArrayIndex = function (target, key) { - return isTypedArray(target) && typeof key != 'symbol' && key in target && String( + key) == String(key); - }; - var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { - return isTypedArrayIndex(target, key = toPrimitive(key, true)) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key); - }; - var wrappedDefineProperty = function defineProperty(target, key, descriptor) { - if (isTypedArrayIndex(target, key = toPrimitive(key, true)) && isObject(descriptor) && has(descriptor, 'value') && !has(descriptor, 'get') && !has(descriptor, 'set') // TODO: add validation descriptor w/o calling accessors - && !descriptor.configurable && (!has(descriptor, 'writable') || descriptor.writable) && (!has(descriptor, 'enumerable') || descriptor.enumerable)) { - target[key] = descriptor.value; - return target; - } - return nativeDefineProperty(target, key, descriptor); - }; - if (DESCRIPTORS) { - if (!NATIVE_ARRAY_BUFFER_VIEWS) { - getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; - definePropertyModule.f = wrappedDefineProperty; - addGetter(TypedArrayPrototype, 'buffer'); - addGetter(TypedArrayPrototype, 'byteOffset'); - addGetter(TypedArrayPrototype, 'byteLength'); - addGetter(TypedArrayPrototype, 'length'); - } - $({ - target: 'Object', - stat: true, - forced: !NATIVE_ARRAY_BUFFER_VIEWS - }, { - getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, - defineProperty: wrappedDefineProperty - }); - module.exports = function (TYPE, wrapper, CLAMPED) { - var BYTES = TYPE.match(/\d+$/) [0] / 8; - var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + TYPE; - var SETTER = 'set' + TYPE; - var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; - var TypedArrayConstructor = NativeTypedArrayConstructor; - var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; - var exported = { - }; - var getter = function (that, index) { - var data = getInternalState(that); - return data.view[GETTER](index * BYTES + data.byteOffset, true); - }; - var setter = function (that, index, value) { - var data = getInternalState(that); - if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 255 ? 255 : value & 255; - data.view[SETTER](index * BYTES + data.byteOffset, value, true); - }; - var addElement = function (that, index) { - nativeDefineProperty(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (!NATIVE_ARRAY_BUFFER_VIEWS) { - TypedArrayConstructor = wrapper(function (that, data, offset, $length) { - anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); - var index = 0; - var byteOffset = 0; - var buffer, - byteLength, - length; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new ArrayBuffer(byteLength); - } else if (isArrayBuffer(data)) { - buffer = data; - byteOffset = toOffset(offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - byteOffset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (isTypedArray(data)) { - return fromList(TypedArrayConstructor, data); - } else { - return typedArrayFrom.call(TypedArrayConstructor, data); - } - setInternalState(that, { - buffer: buffer, - byteOffset: byteOffset, - byteLength: byteLength, - length: length, - view: new DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); - TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); - } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { - TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { - anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); - return inheritIfRequired(function () { - if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); - if (isArrayBuffer(data)) return $length !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data); - if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); - return typedArrayFrom.call(TypedArrayConstructor, data); - }(), dummy, TypedArrayConstructor); - }); - if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); - forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { - if (!(key in TypedArrayConstructor)) { - createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); - } - }); - TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; - } - if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { - createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); - } - if (TYPED_ARRAY_TAG) { - createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); - } - exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; - $({ - global: true, - forced: TypedArrayConstructor != NativeTypedArrayConstructor, - sham: !NATIVE_ARRAY_BUFFER_VIEWS - }, exported); - if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { - createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); - } - if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { - createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); - } - setSpecies(CONSTRUCTOR_NAME); - }; - } else module.exports = function () { /* empty */ - }; - }, - { - '../internals/an-instance': 27, - '../internals/array-buffer': 31, - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37, - '../internals/classof': 47, - '../internals/create-non-enumerable-property': 56, - '../internals/create-property-descriptor': 57, - '../internals/descriptors': 61, - '../internals/export': 68, - '../internals/global': 77, - '../internals/has': 78, - '../internals/inherit-if-required': 85, - '../internals/internal-state': 88, - '../internals/is-object': 92, - '../internals/object-create': 108, - '../internals/object-define-property': 110, - '../internals/object-get-own-property-descriptor': 111, - '../internals/object-get-own-property-names': 113, - '../internals/object-set-prototype-of': 119, - '../internals/set-species': 134, - '../internals/to-index': 151, - '../internals/to-length': 154, - '../internals/to-offset': 156, - '../internals/to-primitive': 158, - '../internals/typed-array-constructors-require-wrappers': 161, - '../internals/typed-array-from': 162 - } - ], - 161: [ - function (_dereq_, module, exports) { - /* eslint-disable no-new */ - var global = _dereq_('../internals/global'); - var fails = _dereq_('../internals/fails'); - var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); - var NATIVE_ARRAY_BUFFER_VIEWS = _dereq_('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS; - var ArrayBuffer = global.ArrayBuffer; - var Int8Array = global.Int8Array; - module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { - Int8Array(1); - }) || !fails(function () { - new Int8Array( - 1); - }) || !checkCorrectnessOfIteration(function (iterable) { - new Int8Array(); - new Int8Array(null); - new Int8Array(1.5); - new Int8Array(iterable); - }, true) || fails(function () { - // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill - return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/check-correctness-of-iteration': 45, - '../internals/fails': 69, - '../internals/global': 77 - } - ], - 162: [ - function (_dereq_, module, exports) { - var toObject = _dereq_('../internals/to-object'); - var toLength = _dereq_('../internals/to-length'); - var getIteratorMethod = _dereq_('../internals/get-iterator-method'); - var isArrayIteratorMethod = _dereq_('../internals/is-array-iterator-method'); - var bind = _dereq_('../internals/function-bind-context'); - var aTypedArrayConstructor = _dereq_('../internals/array-buffer-view-core').aTypedArrayConstructor; - module.exports = function from(source /* , mapfn, thisArg */ ) { - var O = toObject(source); - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var i, - length, - result, - step, - iterator, - next; - if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) { - iterator = iteratorMethod.call(O); - next = iterator.next; - O = [ - ]; - while (!(step = next.call(iterator)).done) { - O.push(step.value); - } - } - if (mapping && argumentsLength > 2) { - mapfn = bind(mapfn, arguments[2], 2); - } - length = toLength(O.length); - result = new (aTypedArrayConstructor(this)) (length); - for (i = 0; length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/function-bind-context': 72, - '../internals/get-iterator-method': 75, - '../internals/is-array-iterator-method': 89, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 163: [ - function (_dereq_, module, exports) { - var id = 0; - var postfix = Math.random(); - module.exports = function (key) { - return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); - }; - }, - { - } - ], - 164: [ - function (_dereq_, module, exports) { - var NATIVE_SYMBOL = _dereq_('../internals/native-symbol'); - module.exports = NATIVE_SYMBOL // eslint-disable-next-line no-undef - && !Symbol.sham // eslint-disable-next-line no-undef - && typeof Symbol.iterator == 'symbol'; - }, - { - '../internals/native-symbol': 101 - } - ], - 165: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - exports.f = wellKnownSymbol; - }, - { - '../internals/well-known-symbol': 166 - } - ], - 166: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var shared = _dereq_('../internals/shared'); - var has = _dereq_('../internals/has'); - var uid = _dereq_('../internals/uid'); - var NATIVE_SYMBOL = _dereq_('../internals/native-symbol'); - var USE_SYMBOL_AS_UID = _dereq_('../internals/use-symbol-as-uid'); - var WellKnownSymbolsStore = shared('wks'); - var Symbol = global.Symbol; - var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; - module.exports = function (name) { - if (!has(WellKnownSymbolsStore, name)) { - if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; - else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); - } - return WellKnownSymbolsStore[name]; - }; - }, - { - '../internals/global': 77, - '../internals/has': 78, - '../internals/native-symbol': 101, - '../internals/shared': 138, - '../internals/uid': 163, - '../internals/use-symbol-as-uid': 164 - } - ], - 167: [ - function (_dereq_, module, exports) { - // a string of all valid unicode whitespaces - // eslint-disable-next-line max-len - module.exports = '\t\n\v\f\r                 \u2028\u2029'; - }, - { - } - ], - 168: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var global = _dereq_('../internals/global'); - var arrayBufferModule = _dereq_('../internals/array-buffer'); - var setSpecies = _dereq_('../internals/set-species'); - var ARRAY_BUFFER = 'ArrayBuffer'; - var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; - var NativeArrayBuffer = global[ARRAY_BUFFER]; - // `ArrayBuffer` constructor - // https://tc39.github.io/ecma262/#sec-arraybuffer-constructor - $({ - global: true, - forced: NativeArrayBuffer !== ArrayBuffer - }, { - ArrayBuffer: ArrayBuffer - }); - setSpecies(ARRAY_BUFFER); - }, - { - '../internals/array-buffer': 31, - '../internals/export': 68, - '../internals/global': 77, - '../internals/set-species': 134 - } - ], - 169: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var fails = _dereq_('../internals/fails'); - var isArray = _dereq_('../internals/is-array'); - var isObject = _dereq_('../internals/is-object'); - var toObject = _dereq_('../internals/to-object'); - var toLength = _dereq_('../internals/to-length'); - var createProperty = _dereq_('../internals/create-property'); - var arraySpeciesCreate = _dereq_('../internals/array-species-create'); - var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var V8_VERSION = _dereq_('../internals/engine-v8-version'); - var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); - var MAX_SAFE_INTEGER = 9007199254740991; - var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/679 - var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { - var array = [ - ]; - array[IS_CONCAT_SPREADABLE] = false; - return array.concat() [0] !== array; - }); - var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); - var isConcatSpreadable = function (O) { - if (!isObject(O)) return false; - var spreadable = O[IS_CONCAT_SPREADABLE]; - return spreadable !== undefined ? !!spreadable : isArray(O); - }; - var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; - // `Array.prototype.concat` method - // https://tc39.github.io/ecma262/#sec-array.prototype.concat - // with adding support of @@isConcatSpreadable and @@species - $({ - target: 'Array', - proto: true, - forced: FORCED - }, { - concat: function concat(arg) { - // eslint-disable-line no-unused-vars - var O = toObject(this); - var A = arraySpeciesCreate(O, 0); - var n = 0; - var i, - k, - length, - len, - E; - for (i = - 1, length = arguments.length; i < length; i++) { - E = i === - 1 ? O : arguments[i]; - if (isConcatSpreadable(E)) { - len = toLength(E.length); - if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); - for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); - } else { - if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); - createProperty(A, n++, E); - } - } - A.length = n; - return A; - } - }); - }, - { - '../internals/array-method-has-species-support': 39, - '../internals/array-species-create': 43, - '../internals/create-property': 58, - '../internals/engine-v8-version': 66, - '../internals/export': 68, - '../internals/fails': 69, - '../internals/is-array': 90, - '../internals/is-object': 92, - '../internals/to-length': 154, - '../internals/to-object': 155, - '../internals/well-known-symbol': 166 - } - ], - 170: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var copyWithin = _dereq_('../internals/array-copy-within'); - var addToUnscopables = _dereq_('../internals/add-to-unscopables'); - // `Array.prototype.copyWithin` method - // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin - $({ - target: 'Array', - proto: true - }, { - copyWithin: copyWithin - }); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('copyWithin'); - }, - { - '../internals/add-to-unscopables': 25, - '../internals/array-copy-within': 32, - '../internals/export': 68 - } - ], - 171: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $every = _dereq_('../internals/array-iteration').every; - var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var STRICT_METHOD = arrayMethodIsStrict('every'); - var USES_TO_LENGTH = arrayMethodUsesToLength('every'); - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - $({ - target: 'Array', - proto: true, - forced: !STRICT_METHOD || !USES_TO_LENGTH - }, { - every: function every(callbackfn /* , thisArg */ ) { - return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/array-iteration': 37, - '../internals/array-method-is-strict': 40, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 172: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var fill = _dereq_('../internals/array-fill'); - var addToUnscopables = _dereq_('../internals/add-to-unscopables'); - // `Array.prototype.fill` method - // https://tc39.github.io/ecma262/#sec-array.prototype.fill - $({ - target: 'Array', - proto: true - }, { - fill: fill - }); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('fill'); - }, - { - '../internals/add-to-unscopables': 25, - '../internals/array-fill': 33, - '../internals/export': 68 - } - ], - 173: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $filter = _dereq_('../internals/array-iteration').filter; - var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); - // Edge 14- issue - var USES_TO_LENGTH = arrayMethodUsesToLength('filter'); - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - // with adding support of @@species - $({ - target: 'Array', - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH - }, { - filter: function filter(callbackfn /* , thisArg */ ) { - return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/array-iteration': 37, - '../internals/array-method-has-species-support': 39, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 174: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $findIndex = _dereq_('../internals/array-iteration').findIndex; - var addToUnscopables = _dereq_('../internals/add-to-unscopables'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var FIND_INDEX = 'findIndex'; - var SKIPS_HOLES = true; - var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX); - // Shouldn't skip holes - if (FIND_INDEX in [ - ]) Array(1) [FIND_INDEX](function () { - SKIPS_HOLES = false; - }); - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findindex - $({ - target: 'Array', - proto: true, - forced: SKIPS_HOLES || !USES_TO_LENGTH - }, { - findIndex: function findIndex(callbackfn /* , that = undefined */ ) { - return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables(FIND_INDEX); - }, - { - '../internals/add-to-unscopables': 25, - '../internals/array-iteration': 37, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 175: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var forEach = _dereq_('../internals/array-for-each'); - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - $({ - target: 'Array', - proto: true, - forced: [ - ].forEach != forEach - }, { - forEach: forEach - }); - }, - { - '../internals/array-for-each': 34, - '../internals/export': 68 - } - ], - 176: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var from = _dereq_('../internals/array-from'); - var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { - Array.from(iterable); - }); - // `Array.from` method - // https://tc39.github.io/ecma262/#sec-array.from - $({ - target: 'Array', - stat: true, - forced: INCORRECT_ITERATION - }, { - from: from - }); - }, - { - '../internals/array-from': 35, - '../internals/check-correctness-of-iteration': 45, - '../internals/export': 68 - } - ], - 177: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $includes = _dereq_('../internals/array-includes').includes; - var addToUnscopables = _dereq_('../internals/add-to-unscopables'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { - ACCESSORS: true, - 1: 0 - }); - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - $({ - target: 'Array', - proto: true, - forced: !USES_TO_LENGTH - }, { - includes: function includes(el /* , fromIndex = 0 */ ) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } - }); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('includes'); - }, - { - '../internals/add-to-unscopables': 25, - '../internals/array-includes': 36, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 178: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $indexOf = _dereq_('../internals/array-includes').indexOf; - var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var nativeIndexOf = [ - ].indexOf; - var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [ - 1 - ].indexOf(1, - 0) < 0; - var STRICT_METHOD = arrayMethodIsStrict('indexOf'); - var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { - ACCESSORS: true, - 1: 0 - }); - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - $({ - target: 'Array', - proto: true, - forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH - }, { - indexOf: function indexOf(searchElement /* , fromIndex = 0 */ ) { - return NEGATIVE_ZERO // convert -0 to +0 - ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/array-includes': 36, - '../internals/array-method-is-strict': 40, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 179: [ - function (_dereq_, module, exports) { - 'use strict'; - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var addToUnscopables = _dereq_('../internals/add-to-unscopables'); - var Iterators = _dereq_('../internals/iterators'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var defineIterator = _dereq_('../internals/define-iterator'); - var ARRAY_ITERATOR = 'Array Iterator'; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); - // `Array.prototype.entries` method - // https://tc39.github.io/ecma262/#sec-array.prototype.entries - // `Array.prototype.keys` method - // https://tc39.github.io/ecma262/#sec-array.prototype.keys - // `Array.prototype.values` method - // https://tc39.github.io/ecma262/#sec-array.prototype.values - // `Array.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator - // `CreateArrayIterator` internal method - // https://tc39.github.io/ecma262/#sec-createarrayiterator - module.exports = defineIterator(Array, 'Array', function (iterated, kind) { - setInternalState(this, { - type: ARRAY_ITERATOR, - target: toIndexedObject(iterated), - // target - index: 0, - // next index - kind: kind // kind - }); - // `%ArrayIteratorPrototype%.next` method - // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next - }, function () { - var state = getInternalState(this); - var target = state.target; - var kind = state.kind; - var index = state.index++; - if (!target || index >= target.length) { - state.target = undefined; - return { - value: undefined, - done: true - }; - } - if (kind == 'keys') return { - value: index, - done: false - }; - if (kind == 'values') return { - value: target[index], - done: false - }; - return { - value: [ - index, - target[index] - ], - done: false - }; - }, 'values'); - // argumentsList[@@iterator] is %ArrayProto_values% - // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject - // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject - Iterators.Arguments = Iterators.Array; - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('keys'); - addToUnscopables('values'); - addToUnscopables('entries'); - }, - { - '../internals/add-to-unscopables': 25, - '../internals/define-iterator': 59, - '../internals/internal-state': 88, - '../internals/iterators': 97, - '../internals/to-indexed-object': 152 - } - ], - 180: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var IndexedObject = _dereq_('../internals/indexed-object'); - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); - var nativeJoin = [ - ].join; - var ES3_STRINGS = IndexedObject != Object; - var STRICT_METHOD = arrayMethodIsStrict('join', ','); - // `Array.prototype.join` method - // https://tc39.github.io/ecma262/#sec-array.prototype.join - $({ - target: 'Array', - proto: true, - forced: ES3_STRINGS || !STRICT_METHOD - }, { - join: function join(separator) { - return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); - } - }); - }, - { - '../internals/array-method-is-strict': 40, - '../internals/export': 68, - '../internals/indexed-object': 84, - '../internals/to-indexed-object': 152 - } - ], - 181: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var lastIndexOf = _dereq_('../internals/array-last-index-of'); - // `Array.prototype.lastIndexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof - $({ - target: 'Array', - proto: true, - forced: lastIndexOf !== [].lastIndexOf - }, { - lastIndexOf: lastIndexOf - }); - }, - { - '../internals/array-last-index-of': 38, - '../internals/export': 68 - } - ], - 182: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $map = _dereq_('../internals/array-iteration').map; - var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); - // FF49- issue - var USES_TO_LENGTH = arrayMethodUsesToLength('map'); - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - // with adding support of @@species - $({ - target: 'Array', - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH - }, { - map: function map(callbackfn /* , thisArg */ ) { - return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/array-iteration': 37, - '../internals/array-method-has-species-support': 39, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 183: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var isObject = _dereq_('../internals/is-object'); - var isArray = _dereq_('../internals/is-array'); - var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); - var toLength = _dereq_('../internals/to-length'); - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var createProperty = _dereq_('../internals/create-property'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); - var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { - ACCESSORS: true, - 0: 0, - 1: 2 - }); - var SPECIES = wellKnownSymbol('species'); - var nativeSlice = [ - ].slice; - var max = Math.max; - // `Array.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-array.prototype.slice - // fallback for not array-like ES3 strings and DOM objects - $({ - target: 'Array', - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH - }, { - slice: function slice(start, end) { - var O = toIndexedObject(this); - var length = toLength(O.length); - var k = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex(end === undefined ? length : end, length); - // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible - var Constructor, - result, - n; - if (isArray(O)) { - Constructor = O.constructor; - // cross-realm fallback - if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { - Constructor = undefined; - } else if (isObject(Constructor)) { - Constructor = Constructor[SPECIES]; - if (Constructor === null) Constructor = undefined; - } - if (Constructor === Array || Constructor === undefined) { - return nativeSlice.call(O, k, fin); - } - } - result = new (Constructor === undefined ? Array : Constructor) (max(fin - k, 0)); - for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); - result.length = n; - return result; - } - }); - }, - { - '../internals/array-method-has-species-support': 39, - '../internals/array-method-uses-to-length': 41, - '../internals/create-property': 58, - '../internals/export': 68, - '../internals/is-array': 90, - '../internals/is-object': 92, - '../internals/to-absolute-index': 150, - '../internals/to-indexed-object': 152, - '../internals/to-length': 154, - '../internals/well-known-symbol': 166 - } - ], - 184: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $some = _dereq_('../internals/array-iteration').some; - var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var STRICT_METHOD = arrayMethodIsStrict('some'); - var USES_TO_LENGTH = arrayMethodUsesToLength('some'); - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - $({ - target: 'Array', - proto: true, - forced: !STRICT_METHOD || !USES_TO_LENGTH - }, { - some: function some(callbackfn /* , thisArg */ ) { - return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/array-iteration': 37, - '../internals/array-method-is-strict': 40, - '../internals/array-method-uses-to-length': 41, - '../internals/export': 68 - } - ], - 185: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); - var toInteger = _dereq_('../internals/to-integer'); - var toLength = _dereq_('../internals/to-length'); - var toObject = _dereq_('../internals/to-object'); - var arraySpeciesCreate = _dereq_('../internals/array-species-create'); - var createProperty = _dereq_('../internals/create-property'); - var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); - var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); - var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { - ACCESSORS: true, - 0: 0, - 1: 2 - }); - var max = Math.max; - var min = Math.min; - var MAX_SAFE_INTEGER = 9007199254740991; - var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; - // `Array.prototype.splice` method - // https://tc39.github.io/ecma262/#sec-array.prototype.splice - // with adding support of @@species - $({ - target: 'Array', - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH - }, { - splice: function splice(start, deleteCount /* , ...items */ ) { - var O = toObject(this); - var len = toLength(O.length); - var actualStart = toAbsoluteIndex(start, len); - var argumentsLength = arguments.length; - var insertCount, - actualDeleteCount, - A, - k, - from, - to; - if (argumentsLength === 0) { - insertCount = actualDeleteCount = 0; - } else if (argumentsLength === 1) { - insertCount = 0; - actualDeleteCount = len - actualStart; - } else { - insertCount = argumentsLength - 2; - actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); - } - if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { - throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); - } - A = arraySpeciesCreate(O, actualDeleteCount); - for (k = 0; k < actualDeleteCount; k++) { - from = actualStart + k; - if (from in O) createProperty(A, k, O[from]); - } - A.length = actualDeleteCount; - if (insertCount < actualDeleteCount) { - for (k = actualStart; k < len - actualDeleteCount; k++) { - from = k + actualDeleteCount; - to = k + insertCount; - if (from in O) O[to] = O[from]; - else delete O[to]; - } - for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; - } else if (insertCount > actualDeleteCount) { - for (k = len - actualDeleteCount; k > actualStart; k--) { - from = k + actualDeleteCount - 1; - to = k + insertCount - 1; - if (from in O) O[to] = O[from]; - else delete O[to]; - } - } - for (k = 0; k < insertCount; k++) { - O[k + actualStart] = arguments[k + 2]; - } - O.length = len - actualDeleteCount + insertCount; - return A; - } - }); - }, - { - '../internals/array-method-has-species-support': 39, - '../internals/array-method-uses-to-length': 41, - '../internals/array-species-create': 43, - '../internals/create-property': 58, - '../internals/export': 68, - '../internals/to-absolute-index': 150, - '../internals/to-integer': 153, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 186: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var defineProperty = _dereq_('../internals/object-define-property').f; - var FunctionPrototype = Function.prototype; - var FunctionPrototypeToString = FunctionPrototype.toString; - var nameRE = /^\s*function ([^ (]*)/; - var NAME = 'name'; - // Function instances `.name` property - // https://tc39.github.io/ecma262/#sec-function-instances-name - if (DESCRIPTORS && !(NAME in FunctionPrototype)) { - defineProperty(FunctionPrototype, NAME, { - configurable: true, - get: function () { - try { - return FunctionPrototypeToString.call(this).match(nameRE) [1]; - } catch (error) { - return ''; - } - } - }); - } - }, - { - '../internals/descriptors': 61, - '../internals/object-define-property': 110 - } - ], - 187: [ - function (_dereq_, module, exports) { - 'use strict'; - var collection = _dereq_('../internals/collection'); - var collectionStrong = _dereq_('../internals/collection-strong'); - // `Map` constructor - // https://tc39.github.io/ecma262/#sec-map-objects - module.exports = collection('Map', function (init) { - return function Map() { - return init(this, arguments.length ? arguments[0] : undefined); - }; - }, collectionStrong); - }, - { - '../internals/collection': 50, - '../internals/collection-strong': 48 - } - ], - 188: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var $hypot = Math.hypot; - var abs = Math.abs; - var sqrt = Math.sqrt; - // Chrome 77 bug - // https://bugs.chromium.org/p/v8/issues/detail?id=9546 - var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; - // `Math.hypot` method - // https://tc39.github.io/ecma262/#sec-math.hypot - $({ - target: 'Math', - stat: true, - forced: BUGGY - }, { - hypot: function hypot(value1, value2) { - // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, - div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * sqrt(sum); - } - }); - }, - { - '../internals/export': 68 - } - ], - 189: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var log = Math.log; - var LN2 = Math.LN2; - // `Math.log2` method - // https://tc39.github.io/ecma262/#sec-math.log2 - $({ - target: 'Math', - stat: true - }, { - log2: function log2(x) { - return log(x) / LN2; - } - }); - }, - { - '../internals/export': 68 - } - ], - 190: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var sign = _dereq_('../internals/math-sign'); - // `Math.sign` method - // https://tc39.github.io/ecma262/#sec-math.sign - $({ - target: 'Math', - stat: true - }, { - sign: sign - }); - }, - { - '../internals/export': 68, - '../internals/math-sign': 98 - } - ], - 191: [ - function (_dereq_, module, exports) { - 'use strict'; - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var global = _dereq_('../internals/global'); - var isForced = _dereq_('../internals/is-forced'); - var redefine = _dereq_('../internals/redefine'); - var has = _dereq_('../internals/has'); - var classof = _dereq_('../internals/classof-raw'); - var inheritIfRequired = _dereq_('../internals/inherit-if-required'); - var toPrimitive = _dereq_('../internals/to-primitive'); - var fails = _dereq_('../internals/fails'); - var create = _dereq_('../internals/object-create'); - var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; - var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; - var defineProperty = _dereq_('../internals/object-define-property').f; - var trim = _dereq_('../internals/string-trim').trim; - var NUMBER = 'Number'; - var NativeNumber = global[NUMBER]; - var NumberPrototype = NativeNumber.prototype; - // Opera ~12 has broken Object#toString - var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; - // `ToNumber` abstract operation - // https://tc39.github.io/ecma262/#sec-tonumber - var toNumber = function (argument) { - var it = toPrimitive(argument, false); - var first, - third, - radix, - maxCode, - digits, - length, - index, - code; - if (typeof it == 'string' && it.length > 2) { - it = trim(it); - first = it.charCodeAt(0); - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: - case 98: - radix = 2; - maxCode = 49; - break; - // fast equal of /^0b[01]+$/i - case 79: - case 111: - radix = 8; - maxCode = 55; - break; - // fast equal of /^0o[0-7]+$/i - default: - return + it; - } - digits = it.slice(2); - length = digits.length; - for (index = 0; index < length; index++) { - code = digits.charCodeAt(index); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } - return parseInt(digits, radix); - } - } - return + it; - }; - // `Number` constructor - // https://tc39.github.io/ecma262/#sec-number-constructor - if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { - var NumberWrapper = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var dummy = this; - return dummy instanceof NumberWrapper // check on 1..constructor(foo) case - && (BROKEN_CLASSOF ? fails(function () { - NumberPrototype.valueOf.call(dummy); - }) : classof(dummy) != NUMBER) ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it); - }; - for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger').split(','), j = 0, key; keys.length > j; j++) { - if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) { - defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); - } - } - NumberWrapper.prototype = NumberPrototype; - NumberPrototype.constructor = NumberWrapper; - redefine(global, NUMBER, NumberWrapper); - } - }, - { - '../internals/classof-raw': 46, - '../internals/descriptors': 61, - '../internals/fails': 69, - '../internals/global': 77, - '../internals/has': 78, - '../internals/inherit-if-required': 85, - '../internals/is-forced': 91, - '../internals/object-create': 108, - '../internals/object-define-property': 110, - '../internals/object-get-own-property-descriptor': 111, - '../internals/object-get-own-property-names': 113, - '../internals/redefine': 126, - '../internals/string-trim': 147, - '../internals/to-primitive': 158 - } - ], - 192: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var numberIsFinite = _dereq_('../internals/number-is-finite'); - // `Number.isFinite` method - // https://tc39.github.io/ecma262/#sec-number.isfinite - $({ - target: 'Number', - stat: true - }, { - isFinite: numberIsFinite - }); - }, - { - '../internals/export': 68, - '../internals/number-is-finite': 106 - } - ], - 193: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var toInteger = _dereq_('../internals/to-integer'); - var thisNumberValue = _dereq_('../internals/this-number-value'); - var repeat = _dereq_('../internals/string-repeat'); - var fails = _dereq_('../internals/fails'); - var nativeToFixed = 1 .toFixed; - var floor = Math.floor; - var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); - }; - var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } - return n; - }; - var FORCED = nativeToFixed && (0.00008 .toFixed(3) !== '0.000' || 0.9 .toFixed(0) !== '1' || 1.255 .toFixed(2) !== '1.25' || 1000000000000000100 .toFixed(0) !== '1000000000000000128') || !fails(function () { - // V8 ~ Android 4.3- - nativeToFixed.call({ - }); - }); - // `Number.prototype.toFixed` method - // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed - $({ - target: 'Number', - proto: true, - forced: FORCED - }, { - // eslint-disable-next-line max-statements - toFixed: function toFixed(fractionDigits) { - var number = thisNumberValue(this); - var fractDigits = toInteger(fractionDigits); - var data = [ - 0, - 0, - 0, - 0, - 0, - 0 - ]; - var sign = ''; - var result = '0'; - var e, - z, - j, - k; - var multiply = function (n, c) { - var index = - 1; - var c2 = c; - while (++index < 6) { - c2 += n * data[index]; - data[index] = c2 % 10000000; - c2 = floor(c2 / 10000000); - } - }; - var divide = function (n) { - var index = 6; - var c = 0; - while (--index >= 0) { - c += data[index]; - data[index] = floor(c / n); - c = c % n * 10000000; - } - }; - var dataToString = function () { - var index = 6; - var s = ''; - while (--index >= 0) { - if (s !== '' || index === 0 || data[index] !== 0) { - var t = String(data[index]); - s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t; - } - } - return s; - }; - if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits'); - // eslint-disable-next-line no-self-compare - if (number != number) return 'NaN'; - if (number <= - 1e+21 || number >= 1e+21) return String(number); - if (number < 0) { - sign = '-'; - number = - number; - } - if (number > 1e-21) { - e = log(number * pow(2, 69, 1)) - 69; - z = e < 0 ? number * pow(2, - e, 1) : number / pow(2, e, 1); - z *= 4503599627370496; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = fractDigits; - while (j >= 7) { - multiply(10000000, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - result = dataToString(); - } else { - multiply(0, z); - multiply(1 << - e, 0); - result = dataToString() + repeat.call('0', fractDigits); - } - } - if (fractDigits > 0) { - k = result.length; - result = sign + (k <= fractDigits ? '0.' + repeat.call('0', fractDigits - k) + result : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits)); - } else { - result = sign + result; - } - return result; - } - }); - }, - { - '../internals/export': 68, - '../internals/fails': 69, - '../internals/string-repeat': 145, - '../internals/this-number-value': 149, - '../internals/to-integer': 153 - } - ], - 194: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var assign = _dereq_('../internals/object-assign'); - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - $({ - target: 'Object', - stat: true, - forced: Object.assign !== assign - }, { - assign: assign - }); - }, - { - '../internals/export': 68, - '../internals/object-assign': 107 - } - ], - 195: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var iterate = _dereq_('../internals/iterate'); - var createProperty = _dereq_('../internals/create-property'); - // `Object.fromEntries` method - // https://github.com/tc39/proposal-object-from-entries - $({ - target: 'Object', - stat: true - }, { - fromEntries: function fromEntries(iterable) { - var obj = { - }; - iterate(iterable, function (k, v) { - createProperty(obj, k, v); - }, undefined, true); - return obj; - } - }); - }, - { - '../internals/create-property': 58, - '../internals/export': 68, - '../internals/iterate': 95 - } - ], - 196: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var fails = _dereq_('../internals/fails'); - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var nativeGetOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var FAILS_ON_PRIMITIVES = fails(function () { - nativeGetOwnPropertyDescriptor(1); - }); - var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor - $({ - target: 'Object', - stat: true, - forced: FORCED, - sham: !DESCRIPTORS - }, { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { - return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); - } - }); - }, - { - '../internals/descriptors': 61, - '../internals/export': 68, - '../internals/fails': 69, - '../internals/object-get-own-property-descriptor': 111, - '../internals/to-indexed-object': 152 - } - ], - 197: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var fails = _dereq_('../internals/fails'); - var nativeGetOwnPropertyNames = _dereq_('../internals/object-get-own-property-names-external').f; - var FAILS_ON_PRIMITIVES = fails(function () { - return !Object.getOwnPropertyNames(1); - }); - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - $({ - target: 'Object', - stat: true, - forced: FAILS_ON_PRIMITIVES - }, { - getOwnPropertyNames: nativeGetOwnPropertyNames - }); - }, - { - '../internals/export': 68, - '../internals/fails': 69, - '../internals/object-get-own-property-names-external': 112 - } - ], - 198: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var fails = _dereq_('../internals/fails'); - var toObject = _dereq_('../internals/to-object'); - var nativeGetPrototypeOf = _dereq_('../internals/object-get-prototype-of'); - var CORRECT_PROTOTYPE_GETTER = _dereq_('../internals/correct-prototype-getter'); - var FAILS_ON_PRIMITIVES = fails(function () { - nativeGetPrototypeOf(1); - }); - // `Object.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.getprototypeof - $({ - target: 'Object', - stat: true, - forced: FAILS_ON_PRIMITIVES, - sham: !CORRECT_PROTOTYPE_GETTER - }, { - getPrototypeOf: function getPrototypeOf(it) { - return nativeGetPrototypeOf(toObject(it)); - } - }); - }, - { - '../internals/correct-prototype-getter': 53, - '../internals/export': 68, - '../internals/fails': 69, - '../internals/object-get-prototype-of': 115, - '../internals/to-object': 155 - } - ], - 199: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var toObject = _dereq_('../internals/to-object'); - var nativeKeys = _dereq_('../internals/object-keys'); - var fails = _dereq_('../internals/fails'); - var FAILS_ON_PRIMITIVES = fails(function () { - nativeKeys(1); - }); - // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys - $({ - target: 'Object', - stat: true, - forced: FAILS_ON_PRIMITIVES - }, { - keys: function keys(it) { - return nativeKeys(toObject(it)); - } - }); - }, - { - '../internals/export': 68, - '../internals/fails': 69, - '../internals/object-keys': 117, - '../internals/to-object': 155 - } - ], - 200: [ - function (_dereq_, module, exports) { - var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support'); - var redefine = _dereq_('../internals/redefine'); - var toString = _dereq_('../internals/object-to-string'); - // `Object.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-object.prototype.tostring - if (!TO_STRING_TAG_SUPPORT) { - redefine(Object.prototype, 'toString', toString, { - unsafe: true - }); - } - }, - { - '../internals/object-to-string': 120, - '../internals/redefine': 126, - '../internals/to-string-tag-support': 159 - } - ], - 201: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var IS_PURE = _dereq_('../internals/is-pure'); - var global = _dereq_('../internals/global'); - var getBuiltIn = _dereq_('../internals/get-built-in'); - var NativePromise = _dereq_('../internals/native-promise-constructor'); - var redefine = _dereq_('../internals/redefine'); - var redefineAll = _dereq_('../internals/redefine-all'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var setSpecies = _dereq_('../internals/set-species'); - var isObject = _dereq_('../internals/is-object'); - var aFunction = _dereq_('../internals/a-function'); - var anInstance = _dereq_('../internals/an-instance'); - var classof = _dereq_('../internals/classof-raw'); - var inspectSource = _dereq_('../internals/inspect-source'); - var iterate = _dereq_('../internals/iterate'); - var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); - var speciesConstructor = _dereq_('../internals/species-constructor'); - var task = _dereq_('../internals/task').set; - var microtask = _dereq_('../internals/microtask'); - var promiseResolve = _dereq_('../internals/promise-resolve'); - var hostReportErrors = _dereq_('../internals/host-report-errors'); - var newPromiseCapabilityModule = _dereq_('../internals/new-promise-capability'); - var perform = _dereq_('../internals/perform'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var isForced = _dereq_('../internals/is-forced'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var V8_VERSION = _dereq_('../internals/engine-v8-version'); - var SPECIES = wellKnownSymbol('species'); - var PROMISE = 'Promise'; - var getInternalState = InternalStateModule.get; - var setInternalState = InternalStateModule.set; - var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); - var PromiseConstructor = NativePromise; - var TypeError = global.TypeError; - var document = global.document; - var process = global.process; - var $fetch = getBuiltIn('fetch'); - var newPromiseCapability = newPromiseCapabilityModule.f; - var newGenericPromiseCapability = newPromiseCapability; - var IS_NODE = classof(process) == 'process'; - var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); - var UNHANDLED_REJECTION = 'unhandledrejection'; - var REJECTION_HANDLED = 'rejectionhandled'; - var PENDING = 0; - var FULFILLED = 1; - var REJECTED = 2; - var HANDLED = 1; - var UNHANDLED = 2; - var Internal, - OwnPromiseCapability, - PromiseWrapper, - nativeThen; - var FORCED = isForced(PROMISE, function () { - var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor); - if (!GLOBAL_CORE_JS_PROMISE) { - // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // We can't detect it synchronously, so just check versions - if (V8_VERSION === 66) return true; - // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test - if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true; - } // We need Promise#finally in the pure version for preventing prototype pollution - - if (IS_PURE && !PromiseConstructor.prototype['finally']) return true; - // We can't use @@species feature detection in V8 since it causes - // deoptimization and performance degradation - // https://github.com/zloirock/core-js/issues/679 - if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false; - // Detect correctness of subclassing with @@species support - var promise = PromiseConstructor.resolve(1); - var FakePromise = function (exec) { - exec(function () { /* empty */ - }, function () { /* empty */ - }); - }; - var constructor = promise.constructor = { - }; - constructor[SPECIES] = FakePromise; - return !(promise.then(function () { /* empty */ - }) instanceof FakePromise); - }); - var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { - PromiseConstructor.all(iterable) ['catch'](function () { /* empty */ - }); - }); - // helpers - var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; - }; - var notify = function (promise, state, isReject) { - if (state.notified) return; - state.notified = true; - var chain = state.reactions; - microtask(function () { - var value = state.value; - var ok = state.state == FULFILLED; - var index = 0; - // variable length - can't use forEach - while (chain.length > index) { - var reaction = chain[index++]; - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, - then, - exited; - try { - if (handler) { - if (!ok) { - if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state); - state.rejection = HANDLED; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // can throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (error) { - if (domain && !exited) domain.exit(); - reject(error); - } - } - state.reactions = [ - ]; - state.notified = false; - if (isReject && !state.rejection) onUnhandled(promise, state); - }); - }; - var dispatchEvent = function (name, promise, reason) { - var event, - handler; - if (DISPATCH_EVENT) { - event = document.createEvent('Event'); - event.promise = promise; - event.reason = reason; - event.initEvent(name, false, true); - global.dispatchEvent(event); - } else event = { - promise: promise, - reason: reason - }; - if (handler = global['on' + name]) handler(event); - else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); - }; - var onUnhandled = function (promise, state) { - task.call(global, function () { - var value = state.value; - var IS_UNHANDLED = isUnhandled(state); - var result; - if (IS_UNHANDLED) { - result = perform(function () { - if (IS_NODE) { - process.emit('unhandledRejection', value, promise); - } else dispatchEvent(UNHANDLED_REJECTION, promise, value); - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; - if (result.error) throw result.value; - } - }); - }; - var isUnhandled = function (state) { - return state.rejection !== HANDLED && !state.parent; - }; - var onHandleUnhandled = function (promise, state) { - task.call(global, function () { - if (IS_NODE) { - process.emit('rejectionHandled', promise); - } else dispatchEvent(REJECTION_HANDLED, promise, state.value); - }); - }; - var bind = function (fn, promise, state, unwrap) { - return function (value) { - fn(promise, state, value, unwrap); - }; - }; - var internalReject = function (promise, state, value, unwrap) { - if (state.done) return; - state.done = true; - if (unwrap) state = unwrap; - state.value = value; - state.state = REJECTED; - notify(promise, state, true); - }; - var internalResolve = function (promise, state, value, unwrap) { - if (state.done) return; - state.done = true; - if (unwrap) state = unwrap; - try { - if (promise === value) throw TypeError('Promise can\'t be resolved itself'); - var then = isThenable(value); - if (then) { - microtask(function () { - var wrapper = { - done: false - }; - try { - then.call(value, bind(internalResolve, promise, wrapper, state), bind(internalReject, promise, wrapper, state)); - } catch (error) { - internalReject(promise, wrapper, error, state); - } - }); - } else { - state.value = value; - state.state = FULFILLED; - notify(promise, state, false); - } - } catch (error) { - internalReject(promise, { - done: false - }, error, state); - } - }; - // constructor polyfill - if (FORCED) { - // 25.4.3.1 Promise(executor) - PromiseConstructor = function Promise(executor) { - anInstance(this, PromiseConstructor, PROMISE); - aFunction(executor); - Internal.call(this); - var state = getInternalState(this); - try { - executor(bind(internalResolve, this, state), bind(internalReject, this, state)); - } catch (error) { - internalReject(this, state, error); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - setInternalState(this, { - type: PROMISE, - done: false, - notified: false, - parent: false, - reactions: [ - ], - rejection: false, - state: PENDING, - value: undefined - }); - }; - Internal.prototype = redefineAll(PromiseConstructor.prototype, { - // `Promise.prototype.then` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.then - then: function then(onFulfilled, onRejected) { - var state = getInternalPromiseState(this); - var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = IS_NODE ? process.domain : undefined; - state.parent = true; - state.reactions.push(reaction); - if (state.state != PENDING) notify(this, state, false); - return reaction.promise; - }, - // `Promise.prototype.catch` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.catch - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - var state = getInternalState(promise); - this.promise = promise; - this.resolve = bind(internalResolve, promise, state); - this.reject = bind(internalReject, promise, state); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); - }; - if (!IS_PURE && typeof NativePromise == 'function') { - nativeThen = NativePromise.prototype.then; - // wrap native Promise#then for native async functions - redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) { - var that = this; - return new PromiseConstructor(function (resolve, reject) { - nativeThen.call(that, resolve, reject); - }).then(onFulfilled, onRejected); - // https://github.com/zloirock/core-js/issues/640 - }, { - unsafe: true - }); - // wrap fetch result - if (typeof $fetch == 'function') $({ - global: true, - enumerable: true, - forced: true - }, { - // eslint-disable-next-line no-unused-vars - fetch: function fetch(input /* , init */ ) { - return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments)); - } - }); - } - } - $({ - global: true, - wrap: true, - forced: FORCED - }, { - Promise: PromiseConstructor - }); - setToStringTag(PromiseConstructor, PROMISE, false, true); - setSpecies(PROMISE); - PromiseWrapper = getBuiltIn(PROMISE); - // statics - $({ - target: PROMISE, - stat: true, - forced: FORCED - }, { - // `Promise.reject` method - // https://tc39.github.io/ecma262/#sec-promise.reject - reject: function reject(r) { - var capability = newPromiseCapability(this); - capability.reject.call(undefined, r); - return capability.promise; - } - }); - $({ - target: PROMISE, - stat: true, - forced: IS_PURE || FORCED - }, { - // `Promise.resolve` method - // https://tc39.github.io/ecma262/#sec-promise.resolve - resolve: function resolve(x) { - return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x); - } - }); - $({ - target: PROMISE, - stat: true, - forced: INCORRECT_ITERATION - }, { - // `Promise.all` method - // https://tc39.github.io/ecma262/#sec-promise.all - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var $promiseResolve = aFunction(C.resolve); - var values = [ - ]; - var counter = 0; - var remaining = 1; - iterate(iterable, function (promise) { - var index = counter++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - $promiseResolve.call(C, promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.error) reject(result.value); - return capability.promise; - }, - // `Promise.race` method - // https://tc39.github.io/ecma262/#sec-promise.race - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - var $promiseResolve = aFunction(C.resolve); - iterate(iterable, function (promise) { - $promiseResolve.call(C, promise).then(capability.resolve, reject); - }); - }); - if (result.error) reject(result.value); - return capability.promise; - } - }); - }, - { - '../internals/a-function': 23, - '../internals/an-instance': 27, - '../internals/check-correctness-of-iteration': 45, - '../internals/classof-raw': 46, - '../internals/engine-v8-version': 66, - '../internals/export': 68, - '../internals/get-built-in': 74, - '../internals/global': 77, - '../internals/host-report-errors': 80, - '../internals/inspect-source': 86, - '../internals/internal-state': 88, - '../internals/is-forced': 91, - '../internals/is-object': 92, - '../internals/is-pure': 93, - '../internals/iterate': 95, - '../internals/microtask': 99, - '../internals/native-promise-constructor': 100, - '../internals/new-promise-capability': 104, - '../internals/perform': 123, - '../internals/promise-resolve': 124, - '../internals/redefine': 126, - '../internals/redefine-all': 125, - '../internals/set-species': 134, - '../internals/set-to-string-tag': 135, - '../internals/species-constructor': 139, - '../internals/task': 148, - '../internals/well-known-symbol': 166 - } - ], - 202: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var getBuiltIn = _dereq_('../internals/get-built-in'); - var aFunction = _dereq_('../internals/a-function'); - var anObject = _dereq_('../internals/an-object'); - var isObject = _dereq_('../internals/is-object'); - var create = _dereq_('../internals/object-create'); - var bind = _dereq_('../internals/function-bind'); - var fails = _dereq_('../internals/fails'); - var nativeConstruct = getBuiltIn('Reflect', 'construct'); - // `Reflect.construct` method - // https://tc39.github.io/ecma262/#sec-reflect.construct - // MS Edge supports only 2 arguments and argumentsList argument is optional - // FF Nightly sets third argument as `new.target`, but does not create `this` from it - var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ - } - return !(nativeConstruct(function () { /* empty */ - }, [ - ], F) instanceof F); - }); - var ARGS_BUG = !fails(function () { - nativeConstruct(function () { /* empty */ - }); - }); - var FORCED = NEW_TARGET_BUG || ARGS_BUG; - $({ - target: 'Reflect', - stat: true, - forced: FORCED, - sham: FORCED - }, { - construct: function construct(Target, args /* , newTarget */ ) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } // w/o altered newTarget, lot of arguments case - - var $args = [ - null - ]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args)) (); - } // with altered newTarget, not support built-in constructors - - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } - }); - }, - { - '../internals/a-function': 23, - '../internals/an-object': 28, - '../internals/export': 68, - '../internals/fails': 69, - '../internals/function-bind': 73, - '../internals/get-built-in': 74, - '../internals/is-object': 92, - '../internals/object-create': 108 - } - ], - 203: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var isObject = _dereq_('../internals/is-object'); - var anObject = _dereq_('../internals/an-object'); - var has = _dereq_('../internals/has'); - var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); - var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); - // `Reflect.get` method - // https://tc39.github.io/ecma262/#sec-reflect.get - function get(target, propertyKey /* , receiver */ ) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var descriptor, - prototype; - if (anObject(target) === receiver) return target[propertyKey]; - if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value') ? descriptor.value : descriptor.get === undefined ? undefined : descriptor.get.call(receiver); - if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver); - } - $({ - target: 'Reflect', - stat: true - }, { - get: get - }); - }, - { - '../internals/an-object': 28, - '../internals/export': 68, - '../internals/has': 78, - '../internals/is-object': 92, - '../internals/object-get-own-property-descriptor': 111, - '../internals/object-get-prototype-of': 115 - } - ], - 204: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var global = _dereq_('../internals/global'); - var isForced = _dereq_('../internals/is-forced'); - var inheritIfRequired = _dereq_('../internals/inherit-if-required'); - var defineProperty = _dereq_('../internals/object-define-property').f; - var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; - var isRegExp = _dereq_('../internals/is-regexp'); - var getFlags = _dereq_('../internals/regexp-flags'); - var stickyHelpers = _dereq_('../internals/regexp-sticky-helpers'); - var redefine = _dereq_('../internals/redefine'); - var fails = _dereq_('../internals/fails'); - var setInternalState = _dereq_('../internals/internal-state').set; - var setSpecies = _dereq_('../internals/set-species'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var MATCH = wellKnownSymbol('match'); - var NativeRegExp = global.RegExp; - var RegExpPrototype = NativeRegExp.prototype; - var re1 = /a/g; - var re2 = /a/g; - // "new" should create a new object, old webkit bug - var CORRECT_NEW = new NativeRegExp(re1) !== re1; - var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; - var FORCED = DESCRIPTORS && isForced('RegExp', !CORRECT_NEW || UNSUPPORTED_Y || fails(function () { - re2[MATCH] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; - })); - // `RegExp` constructor - // https://tc39.github.io/ecma262/#sec-regexp-constructor - if (FORCED) { - var RegExpWrapper = function RegExp(pattern, flags) { - var thisIsRegExp = this instanceof RegExpWrapper; - var patternIsRegExp = isRegExp(pattern); - var flagsAreUndefined = flags === undefined; - var sticky; - if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) { - return pattern; - } - if (CORRECT_NEW) { - if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source; - } else if (pattern instanceof RegExpWrapper) { - if (flagsAreUndefined) flags = getFlags.call(pattern); - pattern = pattern.source; - } - if (UNSUPPORTED_Y) { - sticky = !!flags && flags.indexOf('y') > - 1; - if (sticky) flags = flags.replace(/y/g, ''); - } - var result = inheritIfRequired(CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); - if (UNSUPPORTED_Y && sticky) setInternalState(result, { - sticky: sticky - }); - return result; - }; - var proxy = function (key) { - key in RegExpWrapper || defineProperty(RegExpWrapper, key, { - configurable: true, - get: function () { - return NativeRegExp[key]; - }, - set: function (it) { - NativeRegExp[key] = it; - } - }); - }; - var keys = getOwnPropertyNames(NativeRegExp); - var index = 0; - while (keys.length > index) proxy(keys[index++]); - RegExpPrototype.constructor = RegExpWrapper; - RegExpWrapper.prototype = RegExpPrototype; - redefine(global, 'RegExp', RegExpWrapper); - } // https://tc39.github.io/ecma262/#sec-get-regexp-@@species - - setSpecies('RegExp'); - }, - { - '../internals/descriptors': 61, - '../internals/fails': 69, - '../internals/global': 77, - '../internals/inherit-if-required': 85, - '../internals/internal-state': 88, - '../internals/is-forced': 91, - '../internals/is-regexp': 94, - '../internals/object-define-property': 110, - '../internals/object-get-own-property-names': 113, - '../internals/redefine': 126, - '../internals/regexp-flags': 129, - '../internals/regexp-sticky-helpers': 130, - '../internals/set-species': 134, - '../internals/well-known-symbol': 166 - } - ], - 205: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var exec = _dereq_('../internals/regexp-exec'); - $({ - target: 'RegExp', - proto: true, - forced: /./.exec !== exec - }, { - exec: exec - }); - }, - { - '../internals/export': 68, - '../internals/regexp-exec': 128 - } - ], - 206: [ - function (_dereq_, module, exports) { - 'use strict'; - var redefine = _dereq_('../internals/redefine'); - var anObject = _dereq_('../internals/an-object'); - var fails = _dereq_('../internals/fails'); - var flags = _dereq_('../internals/regexp-flags'); - var TO_STRING = 'toString'; - var RegExpPrototype = RegExp.prototype; - var nativeToString = RegExpPrototype[TO_STRING]; - var NOT_GENERIC = fails(function () { - return nativeToString.call({ - source: 'a', - flags: 'b' - }) != '/a/b'; - }); - // FF44- RegExp#toString has a wrong name - var INCORRECT_NAME = nativeToString.name != TO_STRING; - // `RegExp.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring - if (NOT_GENERIC || INCORRECT_NAME) { - redefine(RegExp.prototype, TO_STRING, function toString() { - var R = anObject(this); - var p = String(R.source); - var rf = R.flags; - var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); - return '/' + p + '/' + f; - }, { - unsafe: true - }); - } - }, - { - '../internals/an-object': 28, - '../internals/fails': 69, - '../internals/redefine': 126, - '../internals/regexp-flags': 129 - } - ], - 207: [ - function (_dereq_, module, exports) { - 'use strict'; - var collection = _dereq_('../internals/collection'); - var collectionStrong = _dereq_('../internals/collection-strong'); - // `Set` constructor - // https://tc39.github.io/ecma262/#sec-set-objects - module.exports = collection('Set', function (init) { - return function Set() { - return init(this, arguments.length ? arguments[0] : undefined); - }; - }, collectionStrong); - }, - { - '../internals/collection': 50, - '../internals/collection-strong': 48 - } - ], - 208: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; - var toLength = _dereq_('../internals/to-length'); - var notARegExp = _dereq_('../internals/not-a-regexp'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var correctIsRegExpLogic = _dereq_('../internals/correct-is-regexp-logic'); - var IS_PURE = _dereq_('../internals/is-pure'); - var nativeEndsWith = ''.endsWith; - var min = Math.min; - var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); - // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { - var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); - return descriptor && !descriptor.writable; - }(); - // `String.prototype.endsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.endswith - $({ - target: 'String', - proto: true, - forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC - }, { - endsWith: function endsWith(searchString /* , endPosition = @length */ ) { - var that = String(requireObjectCoercible(this)); - notARegExp(searchString); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : min(toLength(endPosition), len); - var search = String(searchString); - return nativeEndsWith ? nativeEndsWith.call(that, search, end) : that.slice(end - search.length, end) === search; - } - }); - }, - { - '../internals/correct-is-regexp-logic': 52, - '../internals/export': 68, - '../internals/is-pure': 93, - '../internals/not-a-regexp': 105, - '../internals/object-get-own-property-descriptor': 111, - '../internals/require-object-coercible': 131, - '../internals/to-length': 154 - } - ], - 209: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var notARegExp = _dereq_('../internals/not-a-regexp'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var correctIsRegExpLogic = _dereq_('../internals/correct-is-regexp-logic'); - // `String.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-string.prototype.includes - $({ - target: 'String', - proto: true, - forced: !correctIsRegExpLogic('includes') - }, { - includes: function includes(searchString /* , position = 0 */ ) { - return !!~String(requireObjectCoercible(this)).indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/correct-is-regexp-logic': 52, - '../internals/export': 68, - '../internals/not-a-regexp': 105, - '../internals/require-object-coercible': 131 - } - ], - 210: [ - function (_dereq_, module, exports) { - 'use strict'; - var charAt = _dereq_('../internals/string-multibyte').charAt; - var InternalStateModule = _dereq_('../internals/internal-state'); - var defineIterator = _dereq_('../internals/define-iterator'); - var STRING_ITERATOR = 'String Iterator'; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - // `String.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator - defineIterator(String, 'String', function (iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: String(iterated), - index: 0 - }); - // `%StringIteratorPrototype%.next` method - // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next - }, function next() { - var state = getInternalState(this); - var string = state.string; - var index = state.index; - var point; - if (index >= string.length) return { - value: undefined, - done: true - }; - point = charAt(string, index); - state.index += point.length; - return { - value: point, - done: false - }; - }); - }, - { - '../internals/define-iterator': 59, - '../internals/internal-state': 88, - '../internals/string-multibyte': 141 - } - ], - 211: [ - function (_dereq_, module, exports) { - 'use strict'; - var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); - var anObject = _dereq_('../internals/an-object'); - var toLength = _dereq_('../internals/to-length'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var advanceStringIndex = _dereq_('../internals/advance-string-index'); - var regExpExec = _dereq_('../internals/regexp-exec-abstract'); - // @@match logic - fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { - return [ // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match - function match(regexp) { - var O = requireObjectCoercible(this); - var matcher = regexp == undefined ? undefined : regexp[MATCH]; - return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp) [MATCH](String(O)); - }, - // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match - function (regexp) { - var res = maybeCallNative(nativeMatch, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - if (!rx.global) return regExpExec(rx, S); - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - var A = [ - ]; - var n = 0; - var result; - while ((result = regExpExec(rx, S)) !== null) { - var matchStr = String(result[0]); - A[n] = matchStr; - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - n++; - } - return n === 0 ? null : A; - } - ]; - }); - }, - { - '../internals/advance-string-index': 26, - '../internals/an-object': 28, - '../internals/fix-regexp-well-known-symbol-logic': 70, - '../internals/regexp-exec-abstract': 127, - '../internals/require-object-coercible': 131, - '../internals/to-length': 154 - } - ], - 212: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $padStart = _dereq_('../internals/string-pad').start; - var WEBKIT_BUG = _dereq_('../internals/string-pad-webkit-bug'); - // `String.prototype.padStart` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padstart - $({ - target: 'String', - proto: true, - forced: WEBKIT_BUG - }, { - padStart: function padStart(maxLength /* , fillString = ' ' */ ) { - return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); - } - }); - }, - { - '../internals/export': 68, - '../internals/string-pad': 143, - '../internals/string-pad-webkit-bug': 142 - } - ], - 213: [ - function (_dereq_, module, exports) { - var $ = _dereq_('../internals/export'); - var repeat = _dereq_('../internals/string-repeat'); - // `String.prototype.repeat` method - // https://tc39.github.io/ecma262/#sec-string.prototype.repeat - $({ - target: 'String', - proto: true - }, { - repeat: repeat - }); - }, - { - '../internals/export': 68, - '../internals/string-repeat': 145 - } - ], - 214: [ - function (_dereq_, module, exports) { - 'use strict'; - var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); - var anObject = _dereq_('../internals/an-object'); - var toObject = _dereq_('../internals/to-object'); - var toLength = _dereq_('../internals/to-length'); - var toInteger = _dereq_('../internals/to-integer'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var advanceStringIndex = _dereq_('../internals/advance-string-index'); - var regExpExec = _dereq_('../internals/regexp-exec-abstract'); - var max = Math.max; - var min = Math.min; - var floor = Math.floor; - var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; - var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; - var maybeToString = function (it) { - return it === undefined ? it : String(it); - }; - // @@replace logic - fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) { - var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE; - var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0; - var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; - return [ // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = requireObjectCoercible(this); - var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; - return replacer !== undefined ? replacer.call(searchValue, O, replaceValue) : nativeReplace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - if (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0 || typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === - 1) { - var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); - if (res.done) return res.value; - } - var rx = anObject(regexp); - var S = String(this); - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = [ - ]; - while (true) { - var result = regExpExec(rx, S); - if (result === null) break; - results.push(result); - if (!global) break; - var matchStr = String(result[0]); - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - } - var accumulatedResult = ''; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - var matched = String(result[0]); - var position = max(min(toInteger(result.index), S.length), 0); - var captures = [ - ]; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [ - matched - ].concat(captures, position, S); - if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); - } else { - replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); - } - if (position >= nextSourcePosition) { - accumulatedResult += S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - } - ]; - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return nativeReplace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': - return '$'; - case '&': - return matched; - case '`': - return str.slice(0, position); - case '\'': - return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, - 1)]; - break; - default: - // \d\d? - var n = + ch; - if (n === 0) return match; - if (n > m) { - var f = floor(n / 10); - if (f === 0) return match; - if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } - }); - }, - { - '../internals/advance-string-index': 26, - '../internals/an-object': 28, - '../internals/fix-regexp-well-known-symbol-logic': 70, - '../internals/regexp-exec-abstract': 127, - '../internals/require-object-coercible': 131, - '../internals/to-integer': 153, - '../internals/to-length': 154, - '../internals/to-object': 155 - } - ], - 215: [ - function (_dereq_, module, exports) { - 'use strict'; - var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); - var anObject = _dereq_('../internals/an-object'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var sameValue = _dereq_('../internals/same-value'); - var regExpExec = _dereq_('../internals/regexp-exec-abstract'); - // @@search logic - fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { - return [ // `String.prototype.search` method - // https://tc39.github.io/ecma262/#sec-string.prototype.search - function search(regexp) { - var O = requireObjectCoercible(this); - var searcher = regexp == undefined ? undefined : regexp[SEARCH]; - return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp) [SEARCH](String(O)); - }, - // `RegExp.prototype[@@search]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search - function (regexp) { - var res = maybeCallNative(nativeSearch, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - var previousLastIndex = rx.lastIndex; - if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; - var result = regExpExec(rx, S); - if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; - return result === null ? - 1 : result.index; - } - ]; - }); - }, - { - '../internals/an-object': 28, - '../internals/fix-regexp-well-known-symbol-logic': 70, - '../internals/regexp-exec-abstract': 127, - '../internals/require-object-coercible': 131, - '../internals/same-value': 132 - } - ], - 216: [ - function (_dereq_, module, exports) { - 'use strict'; - var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); - var isRegExp = _dereq_('../internals/is-regexp'); - var anObject = _dereq_('../internals/an-object'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var speciesConstructor = _dereq_('../internals/species-constructor'); - var advanceStringIndex = _dereq_('../internals/advance-string-index'); - var toLength = _dereq_('../internals/to-length'); - var callRegExpExec = _dereq_('../internals/regexp-exec-abstract'); - var regexpExec = _dereq_('../internals/regexp-exec'); - var fails = _dereq_('../internals/fails'); - var arrayPush = [ - ].push; - var min = Math.min; - var MAX_UINT32 = 4294967295; - // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError - var SUPPORTS_Y = !fails(function () { - return !RegExp(MAX_UINT32, 'y'); - }); - // @@split logic - fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) { - var internalSplit; - if ('abbc'.split(/(b)*/) [1] == 'c' || 'test'.split(/(?:)/, - 1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || '.'.split(/()()/).length > 1 || ''.split(/.?/).length) { - // based on es5-shim implementation, need to rework it - internalSplit = function (separator, limit) { - var string = String(requireObjectCoercible(this)); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (separator === undefined) return [string]; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) { - return nativeSplit.call(string, separator, lim); - } - var output = [ - ]; - var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var match, - lastIndex, - lastLength; - while (match = regexpExec.call(separatorCopy, string)) { - lastIndex = separatorCopy.lastIndex; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1)); - lastLength = match[0].length; - lastLastIndex = lastIndex; - if (output.length >= lim) break; - } - if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop - } - if (lastLastIndex === string.length) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output.length > lim ? output.slice(0, lim) : output; - }; - // Chakra, V8 - } else if ('0'.split(undefined, 0).length) { - internalSplit = function (separator, limit) { - return separator === undefined && limit === 0 ? [ - ] : nativeSplit.call(this, separator, limit); - }; - } else internalSplit = nativeSplit; - return [ // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split - function split(separator, limit) { - var O = requireObjectCoercible(this); - var splitter = separator == undefined ? undefined : separator[SPLIT]; - return splitter !== undefined ? splitter.call(separator, O, limit) : internalSplit.call(String(O), separator, limit); - }, - // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split - // - // NOTE: This cannot be properly polyfilled in engines that don't support - // the 'y' flag. - function (regexp, limit) { - var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - var C = speciesConstructor(rx, RegExp); - var unicodeMatching = rx.unicode; - var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (SUPPORTS_Y ? 'y' : 'g'); - // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. - var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (S.length === 0) return callRegExpExec(splitter, S) === null ? [ - S - ] : [ - ]; - var p = 0; - var q = 0; - var A = [ - ]; - while (q < S.length) { - splitter.lastIndex = SUPPORTS_Y ? q : 0; - var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); - var e; - if (z === null || (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p) { - q = advanceStringIndex(S, q, unicodeMatching); - } else { - A.push(S.slice(p, q)); - if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); - if (A.length === lim) return A; - } - q = p = e; - } - } - A.push(S.slice(p)); - return A; - } - ]; - }, !SUPPORTS_Y); - }, - { - '../internals/advance-string-index': 26, - '../internals/an-object': 28, - '../internals/fails': 69, - '../internals/fix-regexp-well-known-symbol-logic': 70, - '../internals/is-regexp': 94, - '../internals/regexp-exec': 128, - '../internals/regexp-exec-abstract': 127, - '../internals/require-object-coercible': 131, - '../internals/species-constructor': 139, - '../internals/to-length': 154 - } - ], - 217: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; - var toLength = _dereq_('../internals/to-length'); - var notARegExp = _dereq_('../internals/not-a-regexp'); - var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); - var correctIsRegExpLogic = _dereq_('../internals/correct-is-regexp-logic'); - var IS_PURE = _dereq_('../internals/is-pure'); - var nativeStartsWith = ''.startsWith; - var min = Math.min; - var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); - // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { - var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); - return descriptor && !descriptor.writable; - }(); - // `String.prototype.startsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.startswith - $({ - target: 'String', - proto: true, - forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC - }, { - startsWith: function startsWith(searchString /* , position = 0 */ ) { - var that = String(requireObjectCoercible(this)); - notARegExp(searchString); - var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return nativeStartsWith ? nativeStartsWith.call(that, search, index) : that.slice(index, index + search.length) === search; - } - }); - }, - { - '../internals/correct-is-regexp-logic': 52, - '../internals/export': 68, - '../internals/is-pure': 93, - '../internals/not-a-regexp': 105, - '../internals/object-get-own-property-descriptor': 111, - '../internals/require-object-coercible': 131, - '../internals/to-length': 154 - } - ], - 218: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var createHTML = _dereq_('../internals/create-html'); - var forcedStringHTMLMethod = _dereq_('../internals/string-html-forced'); - // `String.prototype.sub` method - // https://tc39.github.io/ecma262/#sec-string.prototype.sub - $({ - target: 'String', - proto: true, - forced: forcedStringHTMLMethod('sub') - }, { - sub: function sub() { - return createHTML(this, 'sub', '', ''); - } - }); - }, - { - '../internals/create-html': 54, - '../internals/export': 68, - '../internals/string-html-forced': 140 - } - ], - 219: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var $trim = _dereq_('../internals/string-trim').trim; - var forcedStringTrimMethod = _dereq_('../internals/string-trim-forced'); - // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim - $({ - target: 'String', - proto: true, - forced: forcedStringTrimMethod('trim') - }, { - trim: function trim() { - return $trim(this); - } - }); - }, - { - '../internals/export': 68, - '../internals/string-trim': 147, - '../internals/string-trim-forced': 146 - } - ], - 220: [ - function (_dereq_, module, exports) { - // `Symbol.prototype.description` getter - // https://tc39.github.io/ecma262/#sec-symbol.prototype.description - 'use strict'; - var $ = _dereq_('../internals/export'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var global = _dereq_('../internals/global'); - var has = _dereq_('../internals/has'); - var isObject = _dereq_('../internals/is-object'); - var defineProperty = _dereq_('../internals/object-define-property').f; - var copyConstructorProperties = _dereq_('../internals/copy-constructor-properties'); - var NativeSymbol = global.Symbol; - if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) || // Safari 12 bug - NativeSymbol().description !== undefined)) { - var EmptyStringDescriptionStore = { - }; - // wrap Symbol constructor for correct work with undefined description - var SymbolWrapper = function Symbol() { - var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]); - var result = this instanceof SymbolWrapper ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' - : description === undefined ? NativeSymbol() : NativeSymbol(description); - if (description === '') EmptyStringDescriptionStore[result] = true; - return result; - }; - copyConstructorProperties(SymbolWrapper, NativeSymbol); - var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; - symbolPrototype.constructor = SymbolWrapper; - var symbolToString = symbolPrototype.toString; - var native = String(NativeSymbol('test')) == 'Symbol(test)'; - var regexp = /^Symbol\((.*)\)[^)]+$/; - defineProperty(symbolPrototype, 'description', { - configurable: true, - get: function description() { - var symbol = isObject(this) ? this.valueOf() : this; - var string = symbolToString.call(symbol); - if (has(EmptyStringDescriptionStore, symbol)) return ''; - var desc = native ? string.slice(7, - 1) : string.replace(regexp, '$1'); - return desc === '' ? undefined : desc; - } - }); - $({ - global: true, - forced: true - }, { - Symbol: SymbolWrapper - }); - } - }, - { - '../internals/copy-constructor-properties': 51, - '../internals/descriptors': 61, - '../internals/export': 68, - '../internals/global': 77, - '../internals/has': 78, - '../internals/is-object': 92, - '../internals/object-define-property': 110 - } - ], - 221: [ - function (_dereq_, module, exports) { - var defineWellKnownSymbol = _dereq_('../internals/define-well-known-symbol'); - // `Symbol.iterator` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.iterator - defineWellKnownSymbol('iterator'); - }, - { - '../internals/define-well-known-symbol': 60 - } - ], - 222: [ - function (_dereq_, module, exports) { - 'use strict'; - var $ = _dereq_('../internals/export'); - var global = _dereq_('../internals/global'); - var getBuiltIn = _dereq_('../internals/get-built-in'); - var IS_PURE = _dereq_('../internals/is-pure'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var NATIVE_SYMBOL = _dereq_('../internals/native-symbol'); - var USE_SYMBOL_AS_UID = _dereq_('../internals/use-symbol-as-uid'); - var fails = _dereq_('../internals/fails'); - var has = _dereq_('../internals/has'); - var isArray = _dereq_('../internals/is-array'); - var isObject = _dereq_('../internals/is-object'); - var anObject = _dereq_('../internals/an-object'); - var toObject = _dereq_('../internals/to-object'); - var toIndexedObject = _dereq_('../internals/to-indexed-object'); - var toPrimitive = _dereq_('../internals/to-primitive'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - var nativeObjectCreate = _dereq_('../internals/object-create'); - var objectKeys = _dereq_('../internals/object-keys'); - var getOwnPropertyNamesModule = _dereq_('../internals/object-get-own-property-names'); - var getOwnPropertyNamesExternal = _dereq_('../internals/object-get-own-property-names-external'); - var getOwnPropertySymbolsModule = _dereq_('../internals/object-get-own-property-symbols'); - var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); - var definePropertyModule = _dereq_('../internals/object-define-property'); - var propertyIsEnumerableModule = _dereq_('../internals/object-property-is-enumerable'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var redefine = _dereq_('../internals/redefine'); - var shared = _dereq_('../internals/shared'); - var sharedKey = _dereq_('../internals/shared-key'); - var hiddenKeys = _dereq_('../internals/hidden-keys'); - var uid = _dereq_('../internals/uid'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var wrappedWellKnownSymbolModule = _dereq_('../internals/well-known-symbol-wrapped'); - var defineWellKnownSymbol = _dereq_('../internals/define-well-known-symbol'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var $forEach = _dereq_('../internals/array-iteration').forEach; - var HIDDEN = sharedKey('hidden'); - var SYMBOL = 'Symbol'; - var PROTOTYPE = 'prototype'; - var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(SYMBOL); - var ObjectPrototype = Object[PROTOTYPE]; - var $Symbol = global.Symbol; - var $stringify = getBuiltIn('JSON', 'stringify'); - var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - var nativeDefineProperty = definePropertyModule.f; - var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; - var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; - var AllSymbols = shared('symbols'); - var ObjectPrototypeSymbols = shared('op-symbols'); - var StringToSymbolRegistry = shared('string-to-symbol-registry'); - var SymbolToStringRegistry = shared('symbol-to-string-registry'); - var WellKnownSymbolsStore = shared('wks'); - var QObject = global.QObject; - // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 - var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 - var setSymbolDescriptor = DESCRIPTORS && fails(function () { - return nativeObjectCreate(nativeDefineProperty({ - }, 'a', { - get: function () { - return nativeDefineProperty(this, 'a', { - value: 7 - }).a; - } - })).a != 7; - }) ? function (O, P, Attributes) { - var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); - if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; - nativeDefineProperty(O, P, Attributes); - if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { - nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); - } - } - : nativeDefineProperty; - var wrap = function (tag, description) { - var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]); - setInternalState(symbol, { - type: SYMBOL, - tag: tag, - description: description - }); - if (!DESCRIPTORS) symbol.description = description; - return symbol; - }; - var isSymbol = USE_SYMBOL_AS_UID ? function (it) { - return typeof it == 'symbol'; - } - : function (it) { - return Object(it) instanceof $Symbol; - }; - var $defineProperty = function defineProperty(O, P, Attributes) { - if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); - anObject(O); - var key = toPrimitive(P, true); - anObject(Attributes); - if (has(AllSymbols, key)) { - if (!Attributes.enumerable) { - if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, { - })); - O[HIDDEN][key] = true; - } else { - if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; - Attributes = nativeObjectCreate(Attributes, { - enumerable: createPropertyDescriptor(0, false) - }); - } - return setSymbolDescriptor(O, key, Attributes); - } - return nativeDefineProperty(O, key, Attributes); - }; - var $defineProperties = function defineProperties(O, Properties) { - anObject(O); - var properties = toIndexedObject(Properties); - var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); - $forEach(keys, function (key) { - if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); - }); - return O; - }; - var $create = function create(O, Properties) { - return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); - }; - var $propertyIsEnumerable = function propertyIsEnumerable(V) { - var P = toPrimitive(V, true); - var enumerable = nativePropertyIsEnumerable.call(this, P); - if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; - return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; - }; - var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { - var it = toIndexedObject(O); - var key = toPrimitive(P, true); - if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; - var descriptor = nativeGetOwnPropertyDescriptor(it, key); - if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { - descriptor.enumerable = true; - } - return descriptor; - }; - var $getOwnPropertyNames = function getOwnPropertyNames(O) { - var names = nativeGetOwnPropertyNames(toIndexedObject(O)); - var result = [ - ]; - $forEach(names, function (key) { - if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); - }); - return result; - }; - var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { - var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; - var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); - var result = [ - ]; - $forEach(names, function (key) { - if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) { - result.push(AllSymbols[key]); - } - }); - return result; - }; - // `Symbol` constructor - // https://tc39.github.io/ecma262/#sec-symbol-constructor - if (!NATIVE_SYMBOL) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); - var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); - var tag = uid(description); - var setter = function (value) { - if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); - }; - if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { - configurable: true, - set: setter - }); - return wrap(tag, description); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return getInternalState(this).tag; - }); - redefine($Symbol, 'withoutSetter', function (description) { - return wrap(uid(description), description); - }); - propertyIsEnumerableModule.f = $propertyIsEnumerable; - definePropertyModule.f = $defineProperty; - getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; - getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; - getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; - wrappedWellKnownSymbolModule.f = function (name) { - return wrap(wellKnownSymbol(name), name); - }; - if (DESCRIPTORS) { - // https://github.com/tc39/proposal-Symbol-description - nativeDefineProperty($Symbol[PROTOTYPE], 'description', { - configurable: true, - get: function description() { - return getInternalState(this).description; - } - }); - if (!IS_PURE) { - redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { - unsafe: true - }); - } - } - } - $({ - global: true, - wrap: true, - forced: !NATIVE_SYMBOL, - sham: !NATIVE_SYMBOL - }, { - Symbol: $Symbol - }); - $forEach(objectKeys(WellKnownSymbolsStore), function (name) { - defineWellKnownSymbol(name); - }); - $({ - target: SYMBOL, - stat: true, - forced: !NATIVE_SYMBOL - }, { - // `Symbol.for` method - // https://tc39.github.io/ecma262/#sec-symbol.for - 'for': function (key) { - var string = String(key); - if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; - var symbol = $Symbol(string); - StringToSymbolRegistry[string] = symbol; - SymbolToStringRegistry[symbol] = string; - return symbol; - }, - // `Symbol.keyFor` method - // https://tc39.github.io/ecma262/#sec-symbol.keyfor - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); - if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; - }, - useSetter: function () { - USE_SETTER = true; - }, - useSimple: function () { - USE_SETTER = false; - } - }); - $({ - target: 'Object', - stat: true, - forced: !NATIVE_SYMBOL, - sham: !DESCRIPTORS - }, { - // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create - create: $create, - // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty - defineProperty: $defineProperty, - // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties - defineProperties: $defineProperties, - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors - getOwnPropertyDescriptor: $getOwnPropertyDescriptor - }); - $({ - target: 'Object', - stat: true, - forced: !NATIVE_SYMBOL - }, { - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - getOwnPropertyNames: $getOwnPropertyNames, - // `Object.getOwnPropertySymbols` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols - getOwnPropertySymbols: $getOwnPropertySymbols - }); - // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives - // https://bugs.chromium.org/p/v8/issues/detail?id=3443 - $({ - target: 'Object', - stat: true, - forced: fails(function () { - getOwnPropertySymbolsModule.f(1); - }) - }, { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - return getOwnPropertySymbolsModule.f(toObject(it)); - } - }); - // `JSON.stringify` method behavior with symbols - // https://tc39.github.io/ecma262/#sec-json.stringify - if ($stringify) { - var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () { - var symbol = $Symbol(); - // MS Edge converts symbol values to JSON as {} - return $stringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null - || $stringify({ - a: symbol - }) != '{}' // V8 throws on boxed symbols - || $stringify(Object(symbol)) != '{}'; - }); - $({ - target: 'JSON', - stat: true, - forced: FORCED_JSON_STRINGIFY - }, { - // eslint-disable-next-line no-unused-vars - stringify: function stringify(it, replacer, space) { - var args = [ - it - ]; - var index = 1; - var $replacer; - while (arguments.length > index) args.push(arguments[index++]); - $replacer = replacer; - if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - if (!isArray(replacer)) replacer = function (key, value) { - if (typeof $replacer == 'function') value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return $stringify.apply(null, args); - } - }); - } // `Symbol.prototype[@@toPrimitive]` method - // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive - - if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { - createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); - } // `Symbol.prototype[@@toStringTag]` property - // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag - - setToStringTag($Symbol, SYMBOL); - hiddenKeys[HIDDEN] = true; - }, - { - '../internals/an-object': 28, - '../internals/array-iteration': 37, - '../internals/create-non-enumerable-property': 56, - '../internals/create-property-descriptor': 57, - '../internals/define-well-known-symbol': 60, - '../internals/descriptors': 61, - '../internals/export': 68, - '../internals/fails': 69, - '../internals/get-built-in': 74, - '../internals/global': 77, - '../internals/has': 78, - '../internals/hidden-keys': 79, - '../internals/internal-state': 88, - '../internals/is-array': 90, - '../internals/is-object': 92, - '../internals/is-pure': 93, - '../internals/native-symbol': 101, - '../internals/object-create': 108, - '../internals/object-define-property': 110, - '../internals/object-get-own-property-descriptor': 111, - '../internals/object-get-own-property-names': 113, - '../internals/object-get-own-property-names-external': 112, - '../internals/object-get-own-property-symbols': 114, - '../internals/object-keys': 117, - '../internals/object-property-is-enumerable': 118, - '../internals/redefine': 126, - '../internals/set-to-string-tag': 135, - '../internals/shared': 138, - '../internals/shared-key': 136, - '../internals/to-indexed-object': 152, - '../internals/to-object': 155, - '../internals/to-primitive': 158, - '../internals/uid': 163, - '../internals/use-symbol-as-uid': 164, - '../internals/well-known-symbol': 166, - '../internals/well-known-symbol-wrapped': 165 - } - ], - 223: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $copyWithin = _dereq_('../internals/array-copy-within'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.copyWithin` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin - exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */ ) { - return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-copy-within': 32 - } - ], - 224: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $every = _dereq_('../internals/array-iteration').every; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.every` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every - exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */ ) { - return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37 - } - ], - 225: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $fill = _dereq_('../internals/array-fill'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.fill` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill - // eslint-disable-next-line no-unused-vars - exportTypedArrayMethod('fill', function fill(value /* , start, end */ ) { - return $fill.apply(aTypedArray(this), arguments); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-fill': 33 - } - ], - 226: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $filter = _dereq_('../internals/array-iteration').filter; - var speciesConstructor = _dereq_('../internals/species-constructor'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter - exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */ ) { - var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - var C = speciesConstructor(this, this.constructor); - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C)) (length); - while (length > index) result[index] = list[index++]; - return result; - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37, - '../internals/species-constructor': 139 - } - ], - 227: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $findIndex = _dereq_('../internals/array-iteration').findIndex; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex - exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */ ) { - return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37 - } - ], - 228: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $find = _dereq_('../internals/array-iteration').find; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.find` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find - exportTypedArrayMethod('find', function find(predicate /* , thisArg */ ) { - return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37 - } - ], - 229: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Float32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Float32', function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 230: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Float64Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Float64', function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 231: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $forEach = _dereq_('../internals/array-iteration').forEach; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach - exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */ ) { - $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37 - } - ], - 232: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $includes = _dereq_('../internals/array-includes').includes; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes - exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */ ) { - return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-includes': 36 - } - ], - 233: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $indexOf = _dereq_('../internals/array-includes').indexOf; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof - exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */ ) { - return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-includes': 36 - } - ], - 234: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Int16Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Int16', function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 235: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Int32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Int32', function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 236: [ - function (_dereq_, module, exports) { - 'use strict'; - var global = _dereq_('../internals/global'); - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var ArrayIterators = _dereq_('../modules/es.array.iterator'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var ITERATOR = wellKnownSymbol('iterator'); - var Uint8Array = global.Uint8Array; - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR]; - var CORRECT_ITER_NAME = !!nativeTypedArrayIterator && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined); - var typedArrayValues = function values() { - return arrayValues.call(aTypedArray(this)); - }; - // `%TypedArray%.prototype.entries` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries - exportTypedArrayMethod('entries', function entries() { - return arrayEntries.call(aTypedArray(this)); - }); - // `%TypedArray%.prototype.keys` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys - exportTypedArrayMethod('keys', function keys() { - return arrayKeys.call(aTypedArray(this)); - }); - // `%TypedArray%.prototype.values` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values - exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME); - // `%TypedArray%.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator - exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/global': 77, - '../internals/well-known-symbol': 166, - '../modules/es.array.iterator': 179 - } - ], - 237: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var $join = [ - ].join; - // `%TypedArray%.prototype.join` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join - // eslint-disable-next-line no-unused-vars - exportTypedArrayMethod('join', function join(separator) { - return $join.apply(aTypedArray(this), arguments); - }); - }, - { - '../internals/array-buffer-view-core': 30 - } - ], - 238: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $lastIndexOf = _dereq_('../internals/array-last-index-of'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.lastIndexOf` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof - // eslint-disable-next-line no-unused-vars - exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */ ) { - return $lastIndexOf.apply(aTypedArray(this), arguments); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-last-index-of': 38 - } - ], - 239: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $map = _dereq_('../internals/array-iteration').map; - var speciesConstructor = _dereq_('../internals/species-constructor'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.map` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map - exportTypedArrayMethod('map', function map(mapfn /* , thisArg */ ) { - return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { - return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor))) (length); - }); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37, - '../internals/species-constructor': 139 - } - ], - 240: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $reduceRight = _dereq_('../internals/array-reduce').right; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.reduceRicht` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright - exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */ ) { - return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-reduce': 42 - } - ], - 241: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $reduce = _dereq_('../internals/array-reduce').left; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce - exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */ ) { - return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-reduce': 42 - } - ], - 242: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var floor = Math.floor; - // `%TypedArray%.prototype.reverse` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse - exportTypedArrayMethod('reverse', function reverse() { - var that = this; - var length = aTypedArray(that).length; - var middle = floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } - return that; - }); - }, - { - '../internals/array-buffer-view-core': 30 - } - ], - 243: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var toLength = _dereq_('../internals/to-length'); - var toOffset = _dereq_('../internals/to-offset'); - var toObject = _dereq_('../internals/to-object'); - var fails = _dereq_('../internals/fails'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var FORCED = fails(function () { - // eslint-disable-next-line no-undef - new Int8Array(1).set({ - }); - }); - // `%TypedArray%.prototype.set` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set - exportTypedArrayMethod('set', function set(arrayLike /* , offset */ ) { - aTypedArray(this); - var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError('Wrong length'); - while (index < len) this[offset + index] = src[index++]; - }, FORCED); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/fails': 69, - '../internals/to-length': 154, - '../internals/to-object': 155, - '../internals/to-offset': 156 - } - ], - 244: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var speciesConstructor = _dereq_('../internals/species-constructor'); - var fails = _dereq_('../internals/fails'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var $slice = [ - ].slice; - var FORCED = fails(function () { - // eslint-disable-next-line no-undef - new Int8Array(1).slice(); - }); - // `%TypedArray%.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice - exportTypedArrayMethod('slice', function slice(start, end) { - var list = $slice.call(aTypedArray(this), start, end); - var C = speciesConstructor(this, this.constructor); - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C)) (length); - while (length > index) result[index] = list[index++]; - return result; - }, FORCED); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/fails': 69, - '../internals/species-constructor': 139 - } - ], - 245: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var $some = _dereq_('../internals/array-iteration').some; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.some` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some - exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */ ) { - return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/array-iteration': 37 - } - ], - 246: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var $sort = [ - ].sort; - // `%TypedArray%.prototype.sort` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort - exportTypedArrayMethod('sort', function sort(comparefn) { - return $sort.call(aTypedArray(this), comparefn); - }); - }, - { - '../internals/array-buffer-view-core': 30 - } - ], - 247: [ - function (_dereq_, module, exports) { - 'use strict'; - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var toLength = _dereq_('../internals/to-length'); - var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); - var speciesConstructor = _dereq_('../internals/species-constructor'); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.subarray` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray - exportTypedArrayMethod('subarray', function subarray(begin, end) { - var O = aTypedArray(this); - var length = O.length; - var beginIndex = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O.constructor)) (O.buffer, O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)); - }); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/species-constructor': 139, - '../internals/to-absolute-index': 150, - '../internals/to-length': 154 - } - ], - 248: [ - function (_dereq_, module, exports) { - 'use strict'; - var global = _dereq_('../internals/global'); - var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); - var fails = _dereq_('../internals/fails'); - var Int8Array = global.Int8Array; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; - var $toLocaleString = [ - ].toLocaleString; - var $slice = [ - ].slice; - // iOS Safari 6.x fails here - var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { - $toLocaleString.call(new Int8Array(1)); - }); - var FORCED = fails(function () { - return [1, - 2].toLocaleString() != new Int8Array([1, - 2]).toLocaleString(); - }) || !fails(function () { - Int8Array.prototype.toLocaleString.call([1, - 2]); - }); - // `%TypedArray%.prototype.toLocaleString` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring - exportTypedArrayMethod('toLocaleString', function toLocaleString() { - return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments); - }, FORCED); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/fails': 69, - '../internals/global': 77 - } - ], - 249: [ - function (_dereq_, module, exports) { - 'use strict'; - var exportTypedArrayMethod = _dereq_('../internals/array-buffer-view-core').exportTypedArrayMethod; - var fails = _dereq_('../internals/fails'); - var global = _dereq_('../internals/global'); - var Uint8Array = global.Uint8Array; - var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || { - }; - var arrayToString = [ - ].toString; - var arrayJoin = [ - ].join; - if (fails(function () { - arrayToString.call({ - }); - })) { - arrayToString = function toString() { - return arrayJoin.call(this); - }; - } - var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; - // `%TypedArray%.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring - exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); - }, - { - '../internals/array-buffer-view-core': 30, - '../internals/fails': 69, - '../internals/global': 77 - } - ], - 250: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Uint16Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Uint16', function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 251: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Uint32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Uint32', function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 252: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Uint8Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Uint8', function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 253: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); - // `Uint8ClampedArray` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor('Uint8', function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }, true); - }, - { - '../internals/typed-array-constructor': 160 - } - ], - 254: [ - function (_dereq_, module, exports) { - 'use strict'; - var global = _dereq_('../internals/global'); - var redefineAll = _dereq_('../internals/redefine-all'); - var InternalMetadataModule = _dereq_('../internals/internal-metadata'); - var collection = _dereq_('../internals/collection'); - var collectionWeak = _dereq_('../internals/collection-weak'); - var isObject = _dereq_('../internals/is-object'); - var enforceIternalState = _dereq_('../internals/internal-state').enforce; - var NATIVE_WEAK_MAP = _dereq_('../internals/native-weak-map'); - var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; - var isExtensible = Object.isExtensible; - var InternalWeakMap; - var wrapper = function (init) { - return function WeakMap() { - return init(this, arguments.length ? arguments[0] : undefined); - }; - }; - // `WeakMap` constructor - // https://tc39.github.io/ecma262/#sec-weakmap-constructor - var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); - // IE11 WeakMap frozen keys fix - // We can't use feature detection because it crash some old IE builds - // https://github.com/zloirock/core-js/issues/485 - if (NATIVE_WEAK_MAP && IS_IE11) { - InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); - InternalMetadataModule.REQUIRED = true; - var WeakMapPrototype = $WeakMap.prototype; - var nativeDelete = WeakMapPrototype['delete']; - var nativeHas = WeakMapPrototype.has; - var nativeGet = WeakMapPrototype.get; - var nativeSet = WeakMapPrototype.set; - redefineAll(WeakMapPrototype, { - 'delete': function (key) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - return nativeDelete.call(this, key) || state.frozen['delete'](key); - } - return nativeDelete.call(this, key); - }, - has: function has(key) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - return nativeHas.call(this, key) || state.frozen.has(key); - } - return nativeHas.call(this, key); - }, - get: function get(key) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); - } - return nativeGet.call(this, key); - }, - set: function set(key, value) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); - } else nativeSet.call(this, key, value); - return this; - } - }); - } - }, - { - '../internals/collection': 50, - '../internals/collection-weak': 49, - '../internals/global': 77, - '../internals/internal-metadata': 87, - '../internals/internal-state': 88, - '../internals/is-object': 92, - '../internals/native-weak-map': 103, - '../internals/redefine-all': 125 - } - ], - 255: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var DOMIterables = _dereq_('../internals/dom-iterables'); - var forEach = _dereq_('../internals/array-for-each'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - for (var COLLECTION_NAME in DOMIterables) { - var Collection = global[COLLECTION_NAME]; - var CollectionPrototype = Collection && Collection.prototype; - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { - createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); - } catch (error) { - CollectionPrototype.forEach = forEach; - } - } - }, - { - '../internals/array-for-each': 34, - '../internals/create-non-enumerable-property': 56, - '../internals/dom-iterables': 63, - '../internals/global': 77 - } - ], - 256: [ - function (_dereq_, module, exports) { - var global = _dereq_('../internals/global'); - var DOMIterables = _dereq_('../internals/dom-iterables'); - var ArrayIteratorMethods = _dereq_('../modules/es.array.iterator'); - var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var ITERATOR = wellKnownSymbol('iterator'); - var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - var ArrayValues = ArrayIteratorMethods.values; - for (var COLLECTION_NAME in DOMIterables) { - var Collection = global[COLLECTION_NAME]; - var CollectionPrototype = Collection && Collection.prototype; - if (CollectionPrototype) { - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype[ITERATOR] !== ArrayValues) try { - createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); - } catch (error) { - CollectionPrototype[ITERATOR] = ArrayValues; - } - if (!CollectionPrototype[TO_STRING_TAG]) { - createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); - } - if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { - createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); - } catch (error) { - CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; - } - } - } - } - }, - { - '../internals/create-non-enumerable-property': 56, - '../internals/dom-iterables': 63, - '../internals/global': 77, - '../internals/well-known-symbol': 166, - '../modules/es.array.iterator': 179 - } - ], - 257: [ - function (_dereq_, module, exports) { - 'use strict'; - // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` - _dereq_('../modules/es.array.iterator'); - var $ = _dereq_('../internals/export'); - var getBuiltIn = _dereq_('../internals/get-built-in'); - var USE_NATIVE_URL = _dereq_('../internals/native-url'); - var redefine = _dereq_('../internals/redefine'); - var redefineAll = _dereq_('../internals/redefine-all'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var createIteratorConstructor = _dereq_('../internals/create-iterator-constructor'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var anInstance = _dereq_('../internals/an-instance'); - var hasOwn = _dereq_('../internals/has'); - var bind = _dereq_('../internals/function-bind-context'); - var classof = _dereq_('../internals/classof'); - var anObject = _dereq_('../internals/an-object'); - var isObject = _dereq_('../internals/is-object'); - var create = _dereq_('../internals/object-create'); - var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); - var getIterator = _dereq_('../internals/get-iterator'); - var getIteratorMethod = _dereq_('../internals/get-iterator-method'); - var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); - var $fetch = getBuiltIn('fetch'); - var Headers = getBuiltIn('Headers'); - var ITERATOR = wellKnownSymbol('iterator'); - var URL_SEARCH_PARAMS = 'URLSearchParams'; - var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; - var setInternalState = InternalStateModule.set; - var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); - var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); - var plus = /\+/g; - var sequences = Array(4); - var percentSequence = function (bytes) { - return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); - }; - var percentDecode = function (sequence) { - try { - return decodeURIComponent(sequence); - } catch (error) { - return sequence; - } - }; - var deserialize = function (it) { - var result = it.replace(plus, ' '); - var bytes = 4; - try { - return decodeURIComponent(result); - } catch (error) { - while (bytes) { - result = result.replace(percentSequence(bytes--), percentDecode); - } - return result; - } - }; - var find = /[!'()~]|%20/g; - var replace = { - '!': '%21', - '\'': '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+' - }; - var replacer = function (match) { - return replace[match]; - }; - var serialize = function (it) { - return encodeURIComponent(it).replace(find, replacer); - }; - var parseSearchParams = function (result, query) { - if (query) { - var attributes = query.split('&'); - var index = 0; - var attribute, - entry; - while (index < attributes.length) { - attribute = attributes[index++]; - if (attribute.length) { - entry = attribute.split('='); - result.push({ - key: deserialize(entry.shift()), - value: deserialize(entry.join('=')) - }); - } - } - } - }; - var updateSearchParams = function (query) { - this.entries.length = 0; - parseSearchParams(this.entries, query); - }; - var validateArgumentsLength = function (passed, required) { - if (passed < required) throw TypeError('Not enough arguments'); - }; - var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { - setInternalState(this, { - type: URL_SEARCH_PARAMS_ITERATOR, - iterator: getIterator(getInternalParamsState(params).entries), - kind: kind - }); - }, 'Iterator', function next() { - var state = getInternalIteratorState(this); - var kind = state.kind; - var step = state.iterator.next(); - var entry = step.value; - if (!step.done) { - step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [ - entry.key, - entry.value - ]; - } - return step; - }); - // `URLSearchParams` constructor - // https://url.spec.whatwg.org/#interface-urlsearchparams - var URLSearchParamsConstructor = function URLSearchParams( /* init */ - ) { - anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); - var init = arguments.length > 0 ? arguments[0] : undefined; - var that = this; - var entries = [ - ]; - var iteratorMethod, - iterator, - next, - step, - entryIterator, - entryNext, - first, - second, - key; - setInternalState(that, { - type: URL_SEARCH_PARAMS, - entries: entries, - updateURL: function () { /* empty */ - }, - updateSearchParams: updateSearchParams - }); - if (init !== undefined) { - if (isObject(init)) { - iteratorMethod = getIteratorMethod(init); - if (typeof iteratorMethod === 'function') { - iterator = iteratorMethod.call(init); - next = iterator.next; - while (!(step = next.call(iterator)).done) { - entryIterator = getIterator(anObject(step.value)); - entryNext = entryIterator.next; - if ((first = entryNext.call(entryIterator)).done || (second = entryNext.call(entryIterator)).done || !entryNext.call(entryIterator).done) throw TypeError('Expected sequence with length 2'); - entries.push({ - key: first.value + '', - value: second.value + '' - }); - } - } else for (key in init) if (hasOwn(init, key)) entries.push({ - key: key, - value: init[key] + '' - }); - } else { - parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + ''); - } - } - }; - var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; - redefineAll(URLSearchParamsPrototype, { - // `URLSearchParams.prototype.appent` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-append - append: function append(name, value) { - validateArgumentsLength(arguments.length, 2); - var state = getInternalParamsState(this); - state.entries.push({ - key: name + '', - value: value + '' - }); - state.updateURL(); - }, - // `URLSearchParams.prototype.delete` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-delete - 'delete': function (name) { - validateArgumentsLength(arguments.length, 1); - var state = getInternalParamsState(this); - var entries = state.entries; - var key = name + ''; - var index = 0; - while (index < entries.length) { - if (entries[index].key === key) entries.splice(index, 1); - else index++; - } - state.updateURL(); - }, - // `URLSearchParams.prototype.get` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-get - get: function get(name) { - validateArgumentsLength(arguments.length, 1); - var entries = getInternalParamsState(this).entries; - var key = name + ''; - var index = 0; - for (; index < entries.length; index++) { - if (entries[index].key === key) return entries[index].value; - } - return null; - }, - // `URLSearchParams.prototype.getAll` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-getall - getAll: function getAll(name) { - validateArgumentsLength(arguments.length, 1); - var entries = getInternalParamsState(this).entries; - var key = name + ''; - var result = [ - ]; - var index = 0; - for (; index < entries.length; index++) { - if (entries[index].key === key) result.push(entries[index].value); - } - return result; - }, - // `URLSearchParams.prototype.has` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-has - has: function has(name) { - validateArgumentsLength(arguments.length, 1); - var entries = getInternalParamsState(this).entries; - var key = name + ''; - var index = 0; - while (index < entries.length) { - if (entries[index++].key === key) return true; - } - return false; - }, - // `URLSearchParams.prototype.set` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-set - set: function set(name, value) { - validateArgumentsLength(arguments.length, 1); - var state = getInternalParamsState(this); - var entries = state.entries; - var found = false; - var key = name + ''; - var val = value + ''; - var index = 0; - var entry; - for (; index < entries.length; index++) { - entry = entries[index]; - if (entry.key === key) { - if (found) entries.splice(index--, 1); - else { - found = true; - entry.value = val; - } - } - } - if (!found) entries.push({ - key: key, - value: val - }); - state.updateURL(); - }, - // `URLSearchParams.prototype.sort` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-sort - sort: function sort() { - var state = getInternalParamsState(this); - var entries = state.entries; - // Array#sort is not stable in some engines - var slice = entries.slice(); - var entry, - entriesIndex, - sliceIndex; - entries.length = 0; - for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { - entry = slice[sliceIndex]; - for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { - if (entries[entriesIndex].key > entry.key) { - entries.splice(entriesIndex, 0, entry); - break; - } - } - if (entriesIndex === sliceIndex) entries.push(entry); - } - state.updateURL(); - }, - // `URLSearchParams.prototype.forEach` method - forEach: function forEach(callback /* , thisArg */ ) { - var entries = getInternalParamsState(this).entries; - var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); - var index = 0; - var entry; - while (index < entries.length) { - entry = entries[index++]; - boundFunction(entry.value, entry.key, this); - } - }, - // `URLSearchParams.prototype.keys` method - keys: function keys() { - return new URLSearchParamsIterator(this, 'keys'); - }, - // `URLSearchParams.prototype.values` method - values: function values() { - return new URLSearchParamsIterator(this, 'values'); - }, - // `URLSearchParams.prototype.entries` method - entries: function entries() { - return new URLSearchParamsIterator(this, 'entries'); - } - }, { - enumerable: true - }); - // `URLSearchParams.prototype[@@iterator]` method - redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); - // `URLSearchParams.prototype.toString` method - // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior - redefine(URLSearchParamsPrototype, 'toString', function toString() { - var entries = getInternalParamsState(this).entries; - var result = [ - ]; - var index = 0; - var entry; - while (index < entries.length) { - entry = entries[index++]; - result.push(serialize(entry.key) + '=' + serialize(entry.value)); - } - return result.join('&'); - }, { - enumerable: true - }); - setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); - $({ - global: true, - forced: !USE_NATIVE_URL - }, { - URLSearchParams: URLSearchParamsConstructor - }); - // Wrap `fetch` for correct work with polyfilled `URLSearchParams` - // https://github.com/zloirock/core-js/issues/674 - if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') { - $({ - global: true, - enumerable: true, - forced: true - }, { - fetch: function fetch(input /* , init */ ) { - var args = [ - input - ]; - var init, - body, - headers; - if (arguments.length > 1) { - init = arguments[1]; - if (isObject(init)) { - body = init.body; - if (classof(body) === URL_SEARCH_PARAMS) { - headers = init.headers ? new Headers(init.headers) : new Headers(); - if (!headers.has('content-type')) { - headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - init = create(init, { - body: createPropertyDescriptor(0, String(body)), - headers: createPropertyDescriptor(0, headers) - }); - } - } - args.push(init); - } - return $fetch.apply(this, args); - } - }); - } - module.exports = { - URLSearchParams: URLSearchParamsConstructor, - getState: getInternalParamsState - }; - }, - { - '../internals/an-instance': 27, - '../internals/an-object': 28, - '../internals/classof': 47, - '../internals/create-iterator-constructor': 55, - '../internals/create-property-descriptor': 57, - '../internals/export': 68, - '../internals/function-bind-context': 72, - '../internals/get-built-in': 74, - '../internals/get-iterator': 76, - '../internals/get-iterator-method': 75, - '../internals/has': 78, - '../internals/internal-state': 88, - '../internals/is-object': 92, - '../internals/native-url': 102, - '../internals/object-create': 108, - '../internals/redefine': 126, - '../internals/redefine-all': 125, - '../internals/set-to-string-tag': 135, - '../internals/well-known-symbol': 166, - '../modules/es.array.iterator': 179 - } - ], - 258: [ - function (_dereq_, module, exports) { - 'use strict'; - // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` - _dereq_('../modules/es.string.iterator'); - var $ = _dereq_('../internals/export'); - var DESCRIPTORS = _dereq_('../internals/descriptors'); - var USE_NATIVE_URL = _dereq_('../internals/native-url'); - var global = _dereq_('../internals/global'); - var defineProperties = _dereq_('../internals/object-define-properties'); - var redefine = _dereq_('../internals/redefine'); - var anInstance = _dereq_('../internals/an-instance'); - var has = _dereq_('../internals/has'); - var assign = _dereq_('../internals/object-assign'); - var arrayFrom = _dereq_('../internals/array-from'); - var codeAt = _dereq_('../internals/string-multibyte').codeAt; - var toASCII = _dereq_('../internals/string-punycode-to-ascii'); - var setToStringTag = _dereq_('../internals/set-to-string-tag'); - var URLSearchParamsModule = _dereq_('../modules/web.url-search-params'); - var InternalStateModule = _dereq_('../internals/internal-state'); - var NativeURL = global.URL; - var URLSearchParams = URLSearchParamsModule.URLSearchParams; - var getInternalSearchParamsState = URLSearchParamsModule.getState; - var setInternalState = InternalStateModule.set; - var getInternalURLState = InternalStateModule.getterFor('URL'); - var floor = Math.floor; - var pow = Math.pow; - var INVALID_AUTHORITY = 'Invalid authority'; - var INVALID_SCHEME = 'Invalid scheme'; - var INVALID_HOST = 'Invalid host'; - var INVALID_PORT = 'Invalid port'; - var ALPHA = /[A-Za-z]/; - var ALPHANUMERIC = /[\d+-.A-Za-z]/; - var DIGIT = /\d/; - var HEX_START = /^(0x|0X)/; - var OCT = /^[0-7]+$/; - var DEC = /^\d+$/; - var HEX = /^[\dA-Fa-f]+$/; - // eslint-disable-next-line no-control-regex - var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; - // eslint-disable-next-line no-control-regex - var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; - // eslint-disable-next-line no-control-regex - var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; - // eslint-disable-next-line no-control-regex - var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; - var EOF; - var parseHost = function (url, input) { - var result, - codePoints, - index; - if (input.charAt(0) == '[') { - if (input.charAt(input.length - 1) != ']') return INVALID_HOST; - result = parseIPv6(input.slice(1, - 1)); - if (!result) return INVALID_HOST; - url.host = result; - // opaque host - } else if (!isSpecial(url)) { - if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; - result = ''; - codePoints = arrayFrom(input); - for (index = 0; index < codePoints.length; index++) { - result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); - } - url.host = result; - } else { - input = toASCII(input); - if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; - result = parseIPv4(input); - if (result === null) return INVALID_HOST; - url.host = result; - } - }; - var parseIPv4 = function (input) { - var parts = input.split('.'); - var partsLength, - numbers, - index, - part, - radix, - number, - ipv4; - if (parts.length && parts[parts.length - 1] == '') { - parts.pop(); - } - partsLength = parts.length; - if (partsLength > 4) return input; - numbers = [ - ]; - for (index = 0; index < partsLength; index++) { - part = parts[index]; - if (part == '') return input; - radix = 10; - if (part.length > 1 && part.charAt(0) == '0') { - radix = HEX_START.test(part) ? 16 : 8; - part = part.slice(radix == 8 ? 1 : 2); - } - if (part === '') { - number = 0; - } else { - if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; - number = parseInt(part, radix); - } - numbers.push(number); - } - for (index = 0; index < partsLength; index++) { - number = numbers[index]; - if (index == partsLength - 1) { - if (number >= pow(256, 5 - partsLength)) return null; - } else if (number > 255) return null; - } - ipv4 = numbers.pop(); - for (index = 0; index < numbers.length; index++) { - ipv4 += numbers[index] * pow(256, 3 - index); - } - return ipv4; - }; - // eslint-disable-next-line max-statements - var parseIPv6 = function (input) { - var address = [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]; - var pieceIndex = 0; - var compress = null; - var pointer = 0; - var value, - length, - numbersSeen, - ipv4Piece, - number, - swaps, - swap; - var char = function () { - return input.charAt(pointer); - }; - if (char() == ':') { - if (input.charAt(1) != ':') return; - pointer += 2; - pieceIndex++; - compress = pieceIndex; - } - while (char()) { - if (pieceIndex == 8) return; - if (char() == ':') { - if (compress !== null) return; - pointer++; - pieceIndex++; - compress = pieceIndex; - continue; - } - value = length = 0; - while (length < 4 && HEX.test(char())) { - value = value * 16 + parseInt(char(), 16); - pointer++; - length++; - } - if (char() == '.') { - if (length == 0) return; - pointer -= length; - if (pieceIndex > 6) return; - numbersSeen = 0; - while (char()) { - ipv4Piece = null; - if (numbersSeen > 0) { - if (char() == '.' && numbersSeen < 4) pointer++; - else return; - } - if (!DIGIT.test(char())) return; - while (DIGIT.test(char())) { - number = parseInt(char(), 10); - if (ipv4Piece === null) ipv4Piece = number; - else if (ipv4Piece == 0) return; - else ipv4Piece = ipv4Piece * 10 + number; - if (ipv4Piece > 255) return; - pointer++; - } - address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; - numbersSeen++; - if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; - } - if (numbersSeen != 4) return; - break; - } else if (char() == ':') { - pointer++; - if (!char()) return; - } else if (char()) return; - address[pieceIndex++] = value; - } - if (compress !== null) { - swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex != 0 && swaps > 0) { - swap = address[pieceIndex]; - address[pieceIndex--] = address[compress + swaps - 1]; - address[compress + --swaps] = swap; - } - } else if (pieceIndex != 8) return; - return address; - }; - var findLongestZeroSequence = function (ipv6) { - var maxIndex = null; - var maxLength = 1; - var currStart = null; - var currLength = 0; - var index = 0; - for (; index < 8; index++) { - if (ipv6[index] !== 0) { - if (currLength > maxLength) { - maxIndex = currStart; - maxLength = currLength; - } - currStart = null; - currLength = 0; - } else { - if (currStart === null) currStart = index; - ++currLength; - } - } - if (currLength > maxLength) { - maxIndex = currStart; - maxLength = currLength; - } - return maxIndex; - }; - var serializeHost = function (host) { - var result, - index, - compress, - ignore0; - // ipv4 - if (typeof host == 'number') { - result = [ - ]; - for (index = 0; index < 4; index++) { - result.unshift(host % 256); - host = floor(host / 256); - } - return result.join('.'); - // ipv6 - } else if (typeof host == 'object') { - result = ''; - compress = findLongestZeroSequence(host); - for (index = 0; index < 8; index++) { - if (ignore0 && host[index] === 0) continue; - if (ignore0) ignore0 = false; - if (compress === index) { - result += index ? ':' : '::'; - ignore0 = true; - } else { - result += host[index].toString(16); - if (index < 7) result += ':'; - } - } - return '[' + result + ']'; - } - return host; - }; - var C0ControlPercentEncodeSet = { - }; - var fragmentPercentEncodeSet = assign({ - }, C0ControlPercentEncodeSet, { - ' ': 1, - '"': 1, - '<': 1, - '>': 1, - '`': 1 - }); - var pathPercentEncodeSet = assign({ - }, fragmentPercentEncodeSet, { - '#': 1, - '?': 1, - '{': 1, - '}': 1 - }); - var userinfoPercentEncodeSet = assign({ - }, pathPercentEncodeSet, { - '/': 1, - ':': 1, - ';': 1, - '=': 1, - '@': 1, - '[': 1, - '\\': 1, - ']': 1, - '^': 1, - '|': 1 - }); - var percentEncode = function (char, set) { - var code = codeAt(char, 0); - return code > 32 && code < 127 && !has(set, char) ? char : encodeURIComponent(char); - }; - var specialSchemes = { - ftp: 21, - file: null, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var isSpecial = function (url) { - return has(specialSchemes, url.scheme); - }; - var includesCredentials = function (url) { - return url.username != '' || url.password != ''; - }; - var cannotHaveUsernamePasswordPort = function (url) { - return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; - }; - var isWindowsDriveLetter = function (string, normalized) { - var second; - return string.length == 2 && ALPHA.test(string.charAt(0)) && ((second = string.charAt(1)) == ':' || !normalized && second == '|'); - }; - var startsWithWindowsDriveLetter = function (string) { - var third; - return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (string.length == 2 || (third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#'); - }; - var shortenURLsPath = function (url) { - var path = url.path; - var pathSize = path.length; - if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { - path.pop(); - } - }; - var isSingleDot = function (segment) { - return segment === '.' || segment.toLowerCase() === '%2e'; - }; - var isDoubleDot = function (segment) { - segment = segment.toLowerCase(); - return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; - }; - // States: - var SCHEME_START = { - }; - var SCHEME = { - }; - var NO_SCHEME = { - }; - var SPECIAL_RELATIVE_OR_AUTHORITY = { - }; - var PATH_OR_AUTHORITY = { - }; - var RELATIVE = { - }; - var RELATIVE_SLASH = { - }; - var SPECIAL_AUTHORITY_SLASHES = { - }; - var SPECIAL_AUTHORITY_IGNORE_SLASHES = { - }; - var AUTHORITY = { - }; - var HOST = { - }; - var HOSTNAME = { - }; - var PORT = { - }; - var FILE = { - }; - var FILE_SLASH = { - }; - var FILE_HOST = { - }; - var PATH_START = { - }; - var PATH = { - }; - var CANNOT_BE_A_BASE_URL_PATH = { - }; - var QUERY = { - }; - var FRAGMENT = { - }; - // eslint-disable-next-line max-statements - var parseURL = function (url, input, stateOverride, base) { - var state = stateOverride || SCHEME_START; - var pointer = 0; - var buffer = ''; - var seenAt = false; - var seenBracket = false; - var seenPasswordToken = false; - var codePoints, - char, - bufferCodePoints, - failure; - if (!stateOverride) { - url.scheme = ''; - url.username = ''; - url.password = ''; - url.host = null; - url.port = null; - url.path = [ - ]; - url.query = null; - url.fragment = null; - url.cannotBeABaseURL = false; - input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); - } - input = input.replace(TAB_AND_NEW_LINE, ''); - codePoints = arrayFrom(input); - while (pointer <= codePoints.length) { - char = codePoints[pointer]; - switch (state) { - case SCHEME_START: - if (char && ALPHA.test(char)) { - buffer += char.toLowerCase(); - state = SCHEME; - } else if (!stateOverride) { - state = NO_SCHEME; - continue; - } else return INVALID_SCHEME; - break; - case SCHEME: - if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { - buffer += char.toLowerCase(); - } else if (char == ':') { - if (stateOverride && (isSpecial(url) != has(specialSchemes, buffer) || buffer == 'file' && (includesCredentials(url) || url.port !== null) || url.scheme == 'file' && !url.host)) return; - url.scheme = buffer; - if (stateOverride) { - if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; - return; - } - buffer = ''; - if (url.scheme == 'file') { - state = FILE; - } else if (isSpecial(url) && base && base.scheme == url.scheme) { - state = SPECIAL_RELATIVE_OR_AUTHORITY; - } else if (isSpecial(url)) { - state = SPECIAL_AUTHORITY_SLASHES; - } else if (codePoints[pointer + 1] == '/') { - state = PATH_OR_AUTHORITY; - pointer++; - } else { - url.cannotBeABaseURL = true; - url.path.push(''); - state = CANNOT_BE_A_BASE_URL_PATH; - } - } else if (!stateOverride) { - buffer = ''; - state = NO_SCHEME; - pointer = 0; - continue; - } else return INVALID_SCHEME; - break; - case NO_SCHEME: - if (!base || base.cannotBeABaseURL && char != '#') return INVALID_SCHEME; - if (base.cannotBeABaseURL && char == '#') { - url.scheme = base.scheme; - url.path = base.path.slice(); - url.query = base.query; - url.fragment = ''; - url.cannotBeABaseURL = true; - state = FRAGMENT; - break; - } - state = base.scheme == 'file' ? FILE : RELATIVE; - continue; - case SPECIAL_RELATIVE_OR_AUTHORITY: - if (char == '/' && codePoints[pointer + 1] == '/') { - state = SPECIAL_AUTHORITY_IGNORE_SLASHES; - pointer++; - } else { - state = RELATIVE; - continue; - } - break; - case PATH_OR_AUTHORITY: - if (char == '/') { - state = AUTHORITY; - break; - } else { - state = PATH; - continue; - } - case RELATIVE: - url.scheme = base.scheme; - if (char == EOF) { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.query = base.query; - } else if (char == '/' || char == '\\' && isSpecial(url)) { - state = RELATIVE_SLASH; - } else if (char == '?') { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.query = ''; - state = QUERY; - } else if (char == '#') { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.query = base.query; - url.fragment = ''; - state = FRAGMENT; - } else { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.path.pop(); - state = PATH; - continue; - } - break; - case RELATIVE_SLASH: - if (isSpecial(url) && (char == '/' || char == '\\')) { - state = SPECIAL_AUTHORITY_IGNORE_SLASHES; - } else if (char == '/') { - state = AUTHORITY; - } else { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - state = PATH; - continue; - } - break; - case SPECIAL_AUTHORITY_SLASHES: - state = SPECIAL_AUTHORITY_IGNORE_SLASHES; - if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; - pointer++; - break; - case SPECIAL_AUTHORITY_IGNORE_SLASHES: - if (char != '/' && char != '\\') { - state = AUTHORITY; - continue; - } - break; - case AUTHORITY: - if (char == '@') { - if (seenAt) buffer = '%40' + buffer; - seenAt = true; - bufferCodePoints = arrayFrom(buffer); - for (var i = 0; i < bufferCodePoints.length; i++) { - var codePoint = bufferCodePoints[i]; - if (codePoint == ':' && !seenPasswordToken) { - seenPasswordToken = true; - continue; - } - var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); - if (seenPasswordToken) url.password += encodedCodePoints; - else url.username += encodedCodePoints; - } - buffer = ''; - } else if (char == EOF || char == '/' || char == '?' || char == '#' || char == '\\' && isSpecial(url)) { - if (seenAt && buffer == '') return INVALID_AUTHORITY; - pointer -= arrayFrom(buffer).length + 1; - buffer = ''; - state = HOST; - } else buffer += char; - break; - case HOST: - case HOSTNAME: - if (stateOverride && url.scheme == 'file') { - state = FILE_HOST; - continue; - } else if (char == ':' && !seenBracket) { - if (buffer == '') return INVALID_HOST; - failure = parseHost(url, buffer); - if (failure) return failure; - buffer = ''; - state = PORT; - if (stateOverride == HOSTNAME) return; - } else if (char == EOF || char == '/' || char == '?' || char == '#' || char == '\\' && isSpecial(url)) { - if (isSpecial(url) && buffer == '') return INVALID_HOST; - if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; - failure = parseHost(url, buffer); - if (failure) return failure; - buffer = ''; - state = PATH_START; - if (stateOverride) return; - continue; - } else { - if (char == '[') seenBracket = true; - else if (char == ']') seenBracket = false; - buffer += char; - } - break; - case PORT: - if (DIGIT.test(char)) { - buffer += char; - } else if (char == EOF || char == '/' || char == '?' || char == '#' || char == '\\' && isSpecial(url) || stateOverride) { - if (buffer != '') { - var port = parseInt(buffer, 10); - if (port > 65535) return INVALID_PORT; - url.port = isSpecial(url) && port === specialSchemes[url.scheme] ? null : port; - buffer = ''; - } - if (stateOverride) return; - state = PATH_START; - continue; - } else return INVALID_PORT; - break; - case FILE: - url.scheme = 'file'; - if (char == '/' || char == '\\') state = FILE_SLASH; - else if (base && base.scheme == 'file') { - if (char == EOF) { - url.host = base.host; - url.path = base.path.slice(); - url.query = base.query; - } else if (char == '?') { - url.host = base.host; - url.path = base.path.slice(); - url.query = ''; - state = QUERY; - } else if (char == '#') { - url.host = base.host; - url.path = base.path.slice(); - url.query = base.query; - url.fragment = ''; - state = FRAGMENT; - } else { - if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { - url.host = base.host; - url.path = base.path.slice(); - shortenURLsPath(url); - } - state = PATH; - continue; - } - } else { - state = PATH; - continue; - } - break; - case FILE_SLASH: - if (char == '/' || char == '\\') { - state = FILE_HOST; - break; - } - if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { - if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); - else url.host = base.host; - } - state = PATH; - continue; - case FILE_HOST: - if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { - if (!stateOverride && isWindowsDriveLetter(buffer)) { - state = PATH; - } else if (buffer == '') { - url.host = ''; - if (stateOverride) return; - state = PATH_START; - } else { - failure = parseHost(url, buffer); - if (failure) return failure; - if (url.host == 'localhost') url.host = ''; - if (stateOverride) return; - buffer = ''; - state = PATH_START; - } - continue; - } else buffer += char; - break; - case PATH_START: - if (isSpecial(url)) { - state = PATH; - if (char != '/' && char != '\\') continue; - } else if (!stateOverride && char == '?') { - url.query = ''; - state = QUERY; - } else if (!stateOverride && char == '#') { - url.fragment = ''; - state = FRAGMENT; - } else if (char != EOF) { - state = PATH; - if (char != '/') continue; - } - break; - case PATH: - if (char == EOF || char == '/' || char == '\\' && isSpecial(url) || !stateOverride && (char == '?' || char == '#')) { - if (isDoubleDot(buffer)) { - shortenURLsPath(url); - if (char != '/' && !(char == '\\' && isSpecial(url))) { - url.path.push(''); - } - } else if (isSingleDot(buffer)) { - if (char != '/' && !(char == '\\' && isSpecial(url))) { - url.path.push(''); - } - } else { - if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { - if (url.host) url.host = ''; - buffer = buffer.charAt(0) + ':'; // normalize windows drive letter - } - url.path.push(buffer); - } - buffer = ''; - if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { - while (url.path.length > 1 && url.path[0] === '') { - url.path.shift(); - } - } - if (char == '?') { - url.query = ''; - state = QUERY; - } else if (char == '#') { - url.fragment = ''; - state = FRAGMENT; - } - } else { - buffer += percentEncode(char, pathPercentEncodeSet); - } - break; - case CANNOT_BE_A_BASE_URL_PATH: - if (char == '?') { - url.query = ''; - state = QUERY; - } else if (char == '#') { - url.fragment = ''; - state = FRAGMENT; - } else if (char != EOF) { - url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); - } - break; - case QUERY: - if (!stateOverride && char == '#') { - url.fragment = ''; - state = FRAGMENT; - } else if (char != EOF) { - if (char == '\'' && isSpecial(url)) url.query += '%27'; - else if (char == '#') url.query += '%23'; - else url.query += percentEncode(char, C0ControlPercentEncodeSet); - } - break; - case FRAGMENT: - if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); - break; - } - pointer++; - } - }; - // `URL` constructor - // https://url.spec.whatwg.org/#url-class - var URLConstructor = function URL(url /* , base */ ) { - var that = anInstance(this, URLConstructor, 'URL'); - var base = arguments.length > 1 ? arguments[1] : undefined; - var urlString = String(url); - var state = setInternalState(that, { - type: 'URL' - }); - var baseState, - failure; - if (base !== undefined) { - if (base instanceof URLConstructor) baseState = getInternalURLState(base); - else { - failure = parseURL(baseState = { - }, String(base)); - if (failure) throw TypeError(failure); - } - } - failure = parseURL(state, urlString, null, baseState); - if (failure) throw TypeError(failure); - var searchParams = state.searchParams = new URLSearchParams(); - var searchParamsState = getInternalSearchParamsState(searchParams); - searchParamsState.updateSearchParams(state.query); - searchParamsState.updateURL = function () { - state.query = String(searchParams) || null; - }; - if (!DESCRIPTORS) { - that.href = serializeURL.call(that); - that.origin = getOrigin.call(that); - that.protocol = getProtocol.call(that); - that.username = getUsername.call(that); - that.password = getPassword.call(that); - that.host = getHost.call(that); - that.hostname = getHostname.call(that); - that.port = getPort.call(that); - that.pathname = getPathname.call(that); - that.search = getSearch.call(that); - that.searchParams = getSearchParams.call(that); - that.hash = getHash.call(that); - } - }; - var URLPrototype = URLConstructor.prototype; - var serializeURL = function () { - var url = getInternalURLState(this); - var scheme = url.scheme; - var username = url.username; - var password = url.password; - var host = url.host; - var port = url.port; - var path = url.path; - var query = url.query; - var fragment = url.fragment; - var output = scheme + ':'; - if (host !== null) { - output += '//'; - if (includesCredentials(url)) { - output += username + (password ? ':' + password : '') + '@'; - } - output += serializeHost(host); - if (port !== null) output += ':' + port; - } else if (scheme == 'file') output += '//'; - output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; - if (query !== null) output += '?' + query; - if (fragment !== null) output += '#' + fragment; - return output; - }; - var getOrigin = function () { - var url = getInternalURLState(this); - var scheme = url.scheme; - var port = url.port; - if (scheme == 'blob') try { - return new URL(scheme.path[0]).origin; - } catch (error) { - return 'null'; - } - if (scheme == 'file' || !isSpecial(url)) return 'null'; - return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); - }; - var getProtocol = function () { - return getInternalURLState(this).scheme + ':'; - }; - var getUsername = function () { - return getInternalURLState(this).username; - }; - var getPassword = function () { - return getInternalURLState(this).password; - }; - var getHost = function () { - var url = getInternalURLState(this); - var host = url.host; - var port = url.port; - return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; - }; - var getHostname = function () { - var host = getInternalURLState(this).host; - return host === null ? '' : serializeHost(host); - }; - var getPort = function () { - var port = getInternalURLState(this).port; - return port === null ? '' : String(port); - }; - var getPathname = function () { - var url = getInternalURLState(this); - var path = url.path; - return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; - }; - var getSearch = function () { - var query = getInternalURLState(this).query; - return query ? '?' + query : ''; - }; - var getSearchParams = function () { - return getInternalURLState(this).searchParams; - }; - var getHash = function () { - var fragment = getInternalURLState(this).fragment; - return fragment ? '#' + fragment : ''; - }; - var accessorDescriptor = function (getter, setter) { - return { - get: getter, - set: setter, - configurable: true, - enumerable: true - }; - }; - if (DESCRIPTORS) { - defineProperties(URLPrototype, { - // `URL.prototype.href` accessors pair - // https://url.spec.whatwg.org/#dom-url-href - href: accessorDescriptor(serializeURL, function (href) { - var url = getInternalURLState(this); - var urlString = String(href); - var failure = parseURL(url, urlString); - if (failure) throw TypeError(failure); - getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); - }), - // `URL.prototype.origin` getter - // https://url.spec.whatwg.org/#dom-url-origin - origin: accessorDescriptor(getOrigin), - // `URL.prototype.protocol` accessors pair - // https://url.spec.whatwg.org/#dom-url-protocol - protocol: accessorDescriptor(getProtocol, function (protocol) { - var url = getInternalURLState(this); - parseURL(url, String(protocol) + ':', SCHEME_START); - }), - // `URL.prototype.username` accessors pair - // https://url.spec.whatwg.org/#dom-url-username - username: accessorDescriptor(getUsername, function (username) { - var url = getInternalURLState(this); - var codePoints = arrayFrom(String(username)); - if (cannotHaveUsernamePasswordPort(url)) return; - url.username = ''; - for (var i = 0; i < codePoints.length; i++) { - url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); - } - }), - // `URL.prototype.password` accessors pair - // https://url.spec.whatwg.org/#dom-url-password - password: accessorDescriptor(getPassword, function (password) { - var url = getInternalURLState(this); - var codePoints = arrayFrom(String(password)); - if (cannotHaveUsernamePasswordPort(url)) return; - url.password = ''; - for (var i = 0; i < codePoints.length; i++) { - url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); - } - }), - // `URL.prototype.host` accessors pair - // https://url.spec.whatwg.org/#dom-url-host - host: accessorDescriptor(getHost, function (host) { - var url = getInternalURLState(this); - if (url.cannotBeABaseURL) return; - parseURL(url, String(host), HOST); - }), - // `URL.prototype.hostname` accessors pair - // https://url.spec.whatwg.org/#dom-url-hostname - hostname: accessorDescriptor(getHostname, function (hostname) { - var url = getInternalURLState(this); - if (url.cannotBeABaseURL) return; - parseURL(url, String(hostname), HOSTNAME); - }), - // `URL.prototype.port` accessors pair - // https://url.spec.whatwg.org/#dom-url-port - port: accessorDescriptor(getPort, function (port) { - var url = getInternalURLState(this); - if (cannotHaveUsernamePasswordPort(url)) return; - port = String(port); - if (port == '') url.port = null; - else parseURL(url, port, PORT); - }), - // `URL.prototype.pathname` accessors pair - // https://url.spec.whatwg.org/#dom-url-pathname - pathname: accessorDescriptor(getPathname, function (pathname) { - var url = getInternalURLState(this); - if (url.cannotBeABaseURL) return; - url.path = [ - ]; - parseURL(url, pathname + '', PATH_START); - }), - // `URL.prototype.search` accessors pair - // https://url.spec.whatwg.org/#dom-url-search - search: accessorDescriptor(getSearch, function (search) { - var url = getInternalURLState(this); - search = String(search); - if (search == '') { - url.query = null; - } else { - if ('?' == search.charAt(0)) search = search.slice(1); - url.query = ''; - parseURL(url, search, QUERY); - } - getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); - }), - // `URL.prototype.searchParams` getter - // https://url.spec.whatwg.org/#dom-url-searchparams - searchParams: accessorDescriptor(getSearchParams), - // `URL.prototype.hash` accessors pair - // https://url.spec.whatwg.org/#dom-url-hash - hash: accessorDescriptor(getHash, function (hash) { - var url = getInternalURLState(this); - hash = String(hash); - if (hash == '') { - url.fragment = null; - return; - } - if ('#' == hash.charAt(0)) hash = hash.slice(1); - url.fragment = ''; - parseURL(url, hash, FRAGMENT); - }) - }); - } // `URL.prototype.toJSON` method - // https://url.spec.whatwg.org/#dom-url-tojson - - redefine(URLPrototype, 'toJSON', function toJSON() { - return serializeURL.call(this); - }, { - enumerable: true - }); - // `URL.prototype.toString` method - // https://url.spec.whatwg.org/#URL-stringification-behavior - redefine(URLPrototype, 'toString', function toString() { - return serializeURL.call(this); - }, { - enumerable: true - }); - if (NativeURL) { - var nativeCreateObjectURL = NativeURL.createObjectURL; - var nativeRevokeObjectURL = NativeURL.revokeObjectURL; - // `URL.createObjectURL` method - // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL - // eslint-disable-next-line no-unused-vars - if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { - return nativeCreateObjectURL.apply(NativeURL, arguments); - }); - // `URL.revokeObjectURL` method - // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL - // eslint-disable-next-line no-unused-vars - if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { - return nativeRevokeObjectURL.apply(NativeURL, arguments); - }); - } - setToStringTag(URLConstructor, 'URL'); - $({ - global: true, - forced: !USE_NATIVE_URL, - sham: !DESCRIPTORS - }, { - URL: URLConstructor - }); - }, - { - '../internals/an-instance': 27, - '../internals/array-from': 35, - '../internals/descriptors': 61, - '../internals/export': 68, - '../internals/global': 77, - '../internals/has': 78, - '../internals/internal-state': 88, - '../internals/native-url': 102, - '../internals/object-assign': 107, - '../internals/object-define-properties': 109, - '../internals/redefine': 126, - '../internals/set-to-string-tag': 135, - '../internals/string-multibyte': 141, - '../internals/string-punycode-to-ascii': 144, - '../modules/es.string.iterator': 210, - '../modules/web.url-search-params': 257 - } - ], - 259: [ - function (_dereq_, module, exports) { - // This file can be required in Browserify and Node.js for automatic polyfill - // To use it: require('es6-promise/auto'); - 'use strict'; - module.exports = _dereq_('./').polyfill(); - }, - { - './': 260 - } - ], - 260: [ - function (_dereq_, module, exports) { - (function (process, global) { - /*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ - (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.ES6Promise = factory(); - }) (this, function () { - 'use strict'; - function objectOrFunction(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); - } - function isFunction(x) { - return typeof x === 'function'; - } - var _isArray = void 0; - if (Array.isArray) { - _isArray = Array.isArray; - } else { - _isArray = function (x) { - return Object.prototype.toString.call(x) === '[object Array]'; - }; - } - var isArray = _isArray; - var len = 0; - var vertxNext = void 0; - var customSchedulerFn = void 0; - var asap = function asap(callback, arg) { - queue[len] = callback; - queue[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 2, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - if (customSchedulerFn) { - customSchedulerFn(flush); - } else { - scheduleFlush(); - } - } - }; - function setScheduler(scheduleFn) { - customSchedulerFn = scheduleFn; - } - function setAsap(asapFn) { - asap = asapFn; - } - var browserWindow = typeof window !== 'undefined' ? window : undefined; - var browserGlobal = browserWindow || { - }; - var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; - var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && { - }.toString.call(process) === '[object process]'; - // test for web worker but not in IE10 - var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; - // node - function useNextTick() { - // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // see https://github.com/cujojs/when/issues/410 for details - return function () { - return process.nextTick(flush); - }; - } // vertx - - function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; - } - return useSetTimeout(); - } - function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { - characterData: true - }); - return function () { - node.data = iterations = ++iterations % 2; - }; - } // web worker - - function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; - } - function useSetTimeout() { - // Store setTimeout reference so es6-promise will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var globalSetTimeout = setTimeout; - return function () { - return globalSetTimeout(flush, 1); - }; - } - var queue = new Array(1000); - function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue[i]; - var arg = queue[i + 1]; - callback(arg); - queue[i] = undefined; - queue[i + 1] = undefined; - } - len = 0; - } - function attemptVertx() { - try { - var vertx = Function('return this') ().require('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } - } - var scheduleFlush = void 0; - // Decide what async method to use to triggering processing of queued callbacks: - if (isNode) { - scheduleFlush = useNextTick(); - } else if (BrowserMutationObserver) { - scheduleFlush = useMutationObserver(); - } else if (isWorker) { - scheduleFlush = useMessageChannel(); - } else if (browserWindow === undefined && typeof _dereq_ === 'function') { - scheduleFlush = attemptVertx(); - } else { - scheduleFlush = useSetTimeout(); - } - function then(onFulfillment, onRejection) { - var parent = this; - var child = new this.constructor(noop); - if (child[PROMISE_ID] === undefined) { - makePromise(child); - } - var _state = parent._state; - if (_state) { - var callback = arguments[_state - 1]; - asap(function () { - return invokeCallback(_state, child, callback, parent._result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } - return child; - } /** - `Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.resolve(1); - - promise.then(function(value){ - // value === 1 - }); - ``` - - @method resolve - @static - @param {Any} value value that the returned promise will be resolved with - Useful for tooling. - @return {Promise} a promise that will become fulfilled with the given - `value` - */ - - function resolve$1(object) { - /*jshint validthis:true */ - var Constructor = this; - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } - var promise = new Constructor(noop); - resolve(promise, object); - return promise; - } - var PROMISE_ID = Math.random().toString(36).substring(2); - function noop() { - } - var PENDING = void 0; - var FULFILLED = 1; - var REJECTED = 2; - function selfFulfillment() { - return new TypeError('You cannot resolve a promise with itself'); - } - function cannotReturnOwn() { - return new TypeError('A promises callback cannot return that same promise.'); - } - function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { - try { - then$$1.call(value, fulfillmentHandler, rejectionHandler); - } catch (e) { - return e; - } - } - function handleForeignThenable(promise, thenable, then$$1) { - asap(function (promise) { - var sealed = false; - var error = tryThen(then$$1, thenable, function (value) { - if (sealed) { - return; - } - sealed = true; - if (thenable !== value) { - resolve(promise, value); - } else { - fulfill(promise, value); - } - }, function (reason) { - if (sealed) { - return; - } - sealed = true; - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); - } - function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } - } - function handleMaybeThenable(promise, maybeThenable, then$$1) { - if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$1 === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$1)) { - handleForeignThenable(promise, maybeThenable, then$$1); - } else { - fulfill(promise, maybeThenable); - } - } - } - function resolve(promise, value) { - if (promise === value) { - reject(promise, selfFulfillment()); - } else if (objectOrFunction(value)) { - var then$$1 = void 0; - try { - then$$1 = value.then; - } catch (error) { - reject(promise, error); - return; - } - handleMaybeThenable(promise, value, then$$1); - } else { - fulfill(promise, value); - } - } - function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); - } - publish(promise); - } - function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } - promise._result = value; - promise._state = FULFILLED; - if (promise._subscribers.length !== 0) { - asap(publish, promise); - } - } - function reject(promise, reason) { - if (promise._state !== PENDING) { - return; - } - promise._state = REJECTED; - promise._result = reason; - asap(publishRejection, promise); - } - function subscribe(parent, child, onFulfillment, onRejection) { - var _subscribers = parent._subscribers; - var length = _subscribers.length; - parent._onerror = null; - _subscribers[length] = child; - _subscribers[length + FULFILLED] = onFulfillment; - _subscribers[length + REJECTED] = onRejection; - if (length === 0 && parent._state) { - asap(publish, parent); - } - } - function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - if (subscribers.length === 0) { - return; - } - var child = void 0, - callback = void 0, - detail = promise._result; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } - promise._subscribers.length = 0; - } - function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = void 0, - error = void 0, - succeeded = true; - if (hasCallback) { - try { - value = callback(detail); - } catch (e) { - succeeded = false; - error = e; - } - if (promise === value) { - reject(promise, cannotReturnOwn()); - return; - } - } else { - value = detail; - } - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (succeeded === false) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } - } - function initializePromise(promise, resolver) { - try { - resolver(function resolvePromise(value) { - resolve(promise, value); - }, function rejectPromise(reason) { - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); - } - } - var id = 0; - function nextId() { - return id++; - } - function makePromise(promise) { - promise[PROMISE_ID] = id++; - promise._state = undefined; - promise._result = undefined; - promise._subscribers = [ - ]; - } - function validationError() { - return new Error('Array Methods must be provided an Array'); - } - var Enumerator = function () { - function Enumerator(Constructor, input) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop); - if (!this.promise[PROMISE_ID]) { - makePromise(this.promise); - } - if (isArray(input)) { - this.length = input.length; - this._remaining = input.length; - this._result = new Array(this.length); - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(input); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, validationError()); - } - } - Enumerator.prototype._enumerate = function _enumerate(input) { - for (var i = 0; this._state === PENDING && i < input.length; i++) { - this._eachEntry(input[i], i); - } - }; - Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { - var c = this._instanceConstructor; - var resolve$$1 = c.resolve; - if (resolve$$1 === resolve$1) { - var _then = void 0; - var error = void 0; - var didError = false; - try { - _then = entry.then; - } catch (e) { - didError = true; - error = e; - } - if (_then === then && entry._state !== PENDING) { - this._settledAt(entry._state, i, entry._result); - } else if (typeof _then !== 'function') { - this._remaining--; - this._result[i] = entry; - } else if (c === Promise$1) { - var promise = new c(noop); - if (didError) { - reject(promise, error); - } else { - handleMaybeThenable(promise, entry, _then); - } - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve$$1) { - return resolve$$1(entry); - }), i); - } - } else { - this._willSettleAt(resolve$$1(entry), i); - } - }; - Enumerator.prototype._settledAt = function _settledAt(state, i, value) { - var promise = this.promise; - if (promise._state === PENDING) { - this._remaining--; - if (state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = value; - } - } - if (this._remaining === 0) { - fulfill(promise, this._result); - } - }; - Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { - var enumerator = this; - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; - return Enumerator; - }(); - /** - `Promise.all` accepts an array of promises, and returns a new promise which - is fulfilled with an array of fulfillment values for the passed promises, or - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = resolve(2); - let promise3 = resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = reject(new Error("2")); - let promise3 = reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static - */ - function all(entries) { - return new Enumerator(this, entries).promise; - } /** - `Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @param {Array} promises array of promises to observe - Useful for tooling. - @return {Promise} a promise which settles in the same way as the first passed - promise to settle. - */ - - function race(entries) { - /*jshint validthis:true */ - var Constructor = this; - if (!isArray(entries)) { - return new Constructor(function (_, reject) { - return reject(new TypeError('You must pass an array to race.')); - }); - } else { - return new Constructor(function (resolve, reject) { - var length = entries.length; - for (var i = 0; i < length; i++) { - Constructor.resolve(entries[i]).then(resolve, reject); - } - }); - } - } /** - `Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @param {Any} reason value that the returned promise will be rejected with. - Useful for tooling. - @return {Promise} a promise rejected with the given `reason`. - */ - - function reject$1(reason) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop); - reject(promise, reason); - return promise; - } - function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); - } - function needsNew() { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - } /** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class Promise - @param {Function} resolver - Useful for tooling. - @constructor - */ - - var Promise$1 = function () { - function Promise(resolver) { - this[PROMISE_ID] = nextId(); - this._result = this._state = undefined; - this._subscribers = [ - ]; - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); - } - } /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - Assimilation - ------------ - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - If the assimliated promise rejects, then the downstream promise will also reject. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - Simple Example - -------------- - Synchronous Example - ```javascript - let result; - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - Promise Example; - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - Advanced Example - -------------- - Synchronous Example - ```javascript - let author, books; - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - function foundBooks(books) { - } - function failure(reason) { - } - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); - } - // success - } - }); - ``` - Promise Example; - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - @method then - @param {Function} onFulfilled - @param {Function} onRejected - Useful for tooling. - @return {Promise} - */ - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - @method catch - @param {Function} onRejection - Useful for tooling. - @return {Promise} - */ - - Promise.prototype.catch = function _catch(onRejection) { - return this.then(null, onRejection); - }; - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @return {Promise} - */ - Promise.prototype.finally = function _finally(callback) { - var promise = this; - var constructor = promise.constructor; - if (isFunction(callback)) { - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }); - } - return promise.then(callback, callback); - }; - return Promise; - }(); - Promise$1.prototype.then = then; - Promise$1.all = all; - Promise$1.race = race; - Promise$1.resolve = resolve$1; - Promise$1.reject = reject$1; - Promise$1._setScheduler = setScheduler; - Promise$1._setAsap = setAsap; - Promise$1._asap = asap; - /*global self*/ - function polyfill() { - var local = void 0; - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this') (); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - var P = local.Promise; - if (P) { - var promiseToString = null; - try { - promiseToString = Object.prototype.toString.call(P.resolve()); - } catch (e) { - // silently ignored - } - if (promiseToString === '[object Promise]' && !P.cast) { - return; - } - } - local.Promise = Promise$1; - } // Strange compat.. - - Promise$1.polyfill = polyfill; - Promise$1.Promise = Promise$1; - return Promise$1; - }); - }).call(this, _dereq_('_process'), typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : { - }) - }, - { - '_process': 273 - } - ], - 261: [ - function (_dereq_, module, exports) { - (function (global, factory) { - if (typeof define === 'function' && define.amd) { - define(['exports', - 'module'], factory); - } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { - factory(exports, module); - } else { - var mod = { - exports: { - } - }; - factory(mod.exports, mod); - global.fetchJsonp = mod.exports; - } - }) (this, function (exports, module) { - 'use strict'; - var defaultOptions = { - timeout: 5000, - jsonpCallback: 'callback', - jsonpCallbackFunction: null - }; - function generateCallbackFunction() { - return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); - } - function clearFunction(functionName) { - // IE8 throws an exception when you try to delete a property on window - // http://stackoverflow.com/a/1824228/751089 - try { - delete window[functionName]; - } catch (e) { - window[functionName] = undefined; - } - } - function removeScript(scriptId) { - var script = document.getElementById(scriptId); - if (script) { - document.getElementsByTagName('head') [0].removeChild(script); - } - } - function fetchJsonp(_url) { - var options = arguments.length <= 1 || arguments[1] === undefined ? { - } - : arguments[1]; - // to avoid param reassign - var url = _url; - var timeout = options.timeout || defaultOptions.timeout; - var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback; - var timeoutId = undefined; - return new Promise(function (resolve, reject) { - var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction(); - var scriptId = jsonpCallback + '_' + callbackFunction; - window[callbackFunction] = function (response) { - resolve({ - ok: true, - // keep consistent with fetch API - json: function json() { - return Promise.resolve(response); - } - }); - if (timeoutId) clearTimeout(timeoutId); - removeScript(scriptId); - clearFunction(callbackFunction); - }; - // Check if the user set their own params, and if not add a ? to start a list of params - url += url.indexOf('?') === - 1 ? '?' : '&'; - var jsonpScript = document.createElement('script'); - jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction); - if (options.charset) { - jsonpScript.setAttribute('charset', options.charset); - } - jsonpScript.id = scriptId; - document.getElementsByTagName('head') [0].appendChild(jsonpScript); - timeoutId = setTimeout(function () { - reject(new Error('JSONP request to ' + _url + ' timed out')); - clearFunction(callbackFunction); - removeScript(scriptId); - window[callbackFunction] = function () { - clearFunction(callbackFunction); - }; - }, timeout); - // Caught if got 404/500 - jsonpScript.onerror = function () { - reject(new Error('JSONP request to ' + _url + ' failed')); - clearFunction(callbackFunction); - removeScript(scriptId); - if (timeoutId) clearTimeout(timeoutId); - }; - }); - } // export as global function - /* - let local; - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - local.fetchJsonp = fetchJsonp; - */ - - module.exports = fetchJsonp; - }); - }, - { - } - ], - 262: [ - function (_dereq_, module, exports) { - /* FileSaver.js - * A saveAs() FileSaver implementation. - * 1.3.2 - * 2016-06-16 18:25:19 - * - * By Eli Grey, http://eligrey.com - * License: MIT - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md - */ - /*global self */ - /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ - /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ - var saveAs = saveAs || function (view) { - 'use strict'; - // IE <10 is explicitly unsupported - if (typeof view === 'undefined' || typeof navigator !== 'undefined' && /MSIE [1-9]\./.test(navigator.userAgent)) { - return; - } - var doc = view.document // only get URL when necessary in case Blob.js hasn't overridden it yet - , - get_URL = function () { - return view.URL || view.webkitURL || view; - }, - save_link = doc.createElementNS('http://www.w3.org/1999/xhtml', 'a'), - can_use_save_link = ('download' in save_link), - click = function (node) { - var event = new MouseEvent('click'); - node.dispatchEvent(event); - }, - is_safari = /constructor/i.test(view.HTMLElement) || view.safari, - is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent), - throw_outside = function (ex) { - (view.setImmediate || view.setTimeout) (function () { - throw ex; - }, 0); - }, - force_saveable_type = 'application/octet-stream' // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to - , - arbitrary_revoke_timeout = 1000 * 40 // in ms - , - revoke = function (file) { - var revoker = function () { - if (typeof file === 'string') { - // file is an object URL - get_URL().revokeObjectURL(file); - } else { - // file is a File - file.remove(); - } - }; - setTimeout(revoker, arbitrary_revoke_timeout); - }, - dispatch = function (filesaver, event_types, event) { - event_types = [ - ].concat(event_types); - var i = event_types.length; - while (i--) { - var listener = filesaver['on' + event_types[i]]; - if (typeof listener === 'function') { - try { - listener.call(filesaver, event || filesaver); - } catch (ex) { - throw_outside(ex); - } - } - } - }, - auto_bom = function (blob) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(65279), - blob], { - type: blob.type - }); - } - return blob; - }, - FileSaver = function (blob, name, no_auto_bom) { - if (!no_auto_bom) { - blob = auto_bom(blob); - } // First try a.download, then web filesystem, then object URLs - - var filesaver = this, - type = blob.type, - force = type === force_saveable_type, - object_url, - dispatch_all = function () { - dispatch(filesaver, 'writestart progress write writeend'.split(' ')); - } // on any filesys errors revert to saving with object URLs - , - fs_error = function () { - if ((is_chrome_ios || force && is_safari) && view.FileReader) { - // Safari doesn't allow downloading of blob urls - var reader = new FileReader(); - reader.onloadend = function () { - var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;'); - var popup = view.open(url, '_blank'); - if (!popup) view.location.href = url; - url = undefined; // release reference before dispatching - filesaver.readyState = filesaver.DONE; - dispatch_all(); - }; - reader.readAsDataURL(blob); - filesaver.readyState = filesaver.INIT; - return; - } // don't create more object URLs than needed - - if (!object_url) { - object_url = get_URL().createObjectURL(blob); - } - if (force) { - view.location.href = object_url; - } else { - var opened = view.open(object_url, '_blank'); - if (!opened) { - // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html - view.location.href = object_url; - } - } - filesaver.readyState = filesaver.DONE; - dispatch_all(); - revoke(object_url); - }; - filesaver.readyState = filesaver.INIT; - if (can_use_save_link) { - object_url = get_URL().createObjectURL(blob); - setTimeout(function () { - save_link.href = object_url; - save_link.download = name; - click(save_link); - dispatch_all(); - revoke(object_url); - filesaver.readyState = filesaver.DONE; - }); - return; - } - fs_error(); - }, - FS_proto = FileSaver.prototype, - saveAs = function (blob, name, no_auto_bom) { - return new FileSaver(blob, name || blob.name || 'download', no_auto_bom); - }; - // IE 10+ (native saveAs) - if (typeof navigator !== 'undefined' && navigator.msSaveOrOpenBlob) { - return function (blob, name, no_auto_bom) { - name = name || blob.name || 'download'; - if (!no_auto_bom) { - blob = auto_bom(blob); - } - return navigator.msSaveOrOpenBlob(blob, name); - }; - } - FS_proto.abort = function () { - }; - FS_proto.readyState = FS_proto.INIT = 0; - FS_proto.WRITING = 1; - FS_proto.DONE = 2; - FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null; - return saveAs; - }(typeof self !== 'undefined' && self || typeof window !== 'undefined' && window || this.content); - // `self` is undefined in Firefox for Android content script context - // while `this` is nsIContentFrameMessageManager - // with an attribute `content` that corresponds to the window - if (typeof module !== 'undefined' && module.exports) { - module.exports.saveAs = saveAs; - } else if (typeof define !== 'undefined' && define !== null && define.amd !== null) { - define('FileSaver.js', function () { - return saveAs; - }); - } - }, - { - } - ], - 263: [ - function (_dereq_, module, exports) { - var __defProp = Object.defineProperty; - var __markAsModule = target=>__defProp(target, '__esModule', { - value: true - }); - var __export = (target, all) =>{ - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - // src/index.js - __markAsModule(exports); - __export(exports, { - GIFEncoder: () =>GIFEncoder, - applyPalette: () =>applyPalette, - default: - () =>src_default, - nearestColor: () =>nearestColor, - nearestColorIndex: () =>nearestColorIndex, - nearestColorIndexWithDistance: () =>nearestColorIndexWithDistance, - prequantize: () =>prequantize, - quantize: () =>quantize, - snapColorsToPalette: () =>snapColorsToPalette - }); - // src/constants.js - var constants_default = { - signature: 'GIF', - version: '89a', - trailer: 59, - extensionIntroducer: 33, - applicationExtensionLabel: 255, - graphicControlExtensionLabel: 249, - imageSeparator: 44, - signatureSize: 3, - versionSize: 3, - globalColorTableFlagMask: 128, - colorResolutionMask: 112, - sortFlagMask: 8, - globalColorTableSizeMask: 7, - applicationIdentifierSize: 8, - applicationAuthCodeSize: 3, - disposalMethodMask: 28, - userInputFlagMask: 2, - transparentColorFlagMask: 1, - localColorTableFlagMask: 128, - interlaceFlagMask: 64, - idSortFlagMask: 32, - localColorTableSizeMask: 7 - }; - // src/stream.js - function createStream(initialCapacity = 256) { - let cursor = 0; - let contents = new Uint8Array(initialCapacity); - return { - get buffer() { - return contents.buffer; - }, - reset() { - cursor = 0; - }, - bytesView() { - return contents.subarray(0, cursor); - }, - bytes() { - return contents.slice(0, cursor); - }, - writeByte(byte) { - expand(cursor + 1); - contents[cursor] = byte; - cursor++; - }, - writeBytes(data, offset = 0, byteLength = data.length) { - expand(cursor + byteLength); - for (let i = 0; i < byteLength; i++) { - contents[cursor++] = data[i + offset]; - } - }, - writeBytesView(data, offset = 0, byteLength = data.byteLength) { - expand(cursor + byteLength); - contents.set(data.subarray(offset, offset + byteLength), cursor); - cursor += byteLength; - } - }; - function expand(newCapacity) { - var prevCapacity = contents.length; - if (prevCapacity >= newCapacity) return; - var CAPACITY_DOUBLING_MAX = 1024 * 1024; - newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0); - if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); - const oldContents = contents; - contents = new Uint8Array(newCapacity); - if (cursor > 0) contents.set(oldContents.subarray(0, cursor), 0); - } - } // src/lzwEncode.js - - var BITS = 12; - var DEFAULT_HSIZE = 5003; - var MASKS = [ - 0, - 1, - 3, - 7, - 15, - 31, - 63, - 127, - 255, - 511, - 1023, - 2047, - 4095, - 8191, - 16383, - 32767, - 65535 - ]; - function lzwEncode(width, height, pixels, colorDepth, outStream = createStream(512), accum = new Uint8Array(256), htab = new Int32Array(DEFAULT_HSIZE), codetab = new Int32Array(DEFAULT_HSIZE)) { - const hsize = htab.length; - const initCodeSize = Math.max(2, colorDepth); - accum.fill(0); - codetab.fill(0); - htab.fill( - 1); - let cur_accum = 0; - let cur_bits = 0; - const init_bits = initCodeSize + 1; - const g_init_bits = init_bits; - let clear_flg = false; - let n_bits = g_init_bits; - let maxcode = (1 << n_bits) - 1; - const ClearCode = 1 << init_bits - 1; - const EOFCode = ClearCode + 1; - let free_ent = ClearCode + 2; - let a_count = 0; - let ent = pixels[0]; - let hshift = 0; - for (let fcode = hsize; fcode < 65536; fcode *= 2) { - ++hshift; - } - hshift = 8 - hshift; - outStream.writeByte(initCodeSize); - output(ClearCode); - const length = pixels.length; - for (let idx = 1; idx < length; idx++) { - next_block: { - const c = pixels[idx]; - const fcode = (c << BITS) + ent; - let i = c << hshift ^ ent; - if (htab[i] === fcode) { - ent = codetab[i]; - break next_block; - } - const disp = i === 0 ? 1 : hsize - i; - while (htab[i] >= 0) { - i -= disp; - if (i < 0) i += hsize; - if (htab[i] === fcode) { - ent = codetab[i]; - break next_block; - } - } - output(ent); - ent = c; - if (free_ent < 1 << BITS) { - codetab[i] = free_ent++; - htab[i] = fcode; - } else { - htab.fill( - 1); - free_ent = ClearCode + 2; - clear_flg = true; - output(ClearCode); - } - } - } - output(ent); - output(EOFCode); - outStream.writeByte(0); - return outStream.bytesView(); - function output(code) { - cur_accum &= MASKS[cur_bits]; - if (cur_bits > 0) cur_accum |= code << cur_bits; - else cur_accum = code; - cur_bits += n_bits; - while (cur_bits >= 8) { - accum[a_count++] = cur_accum & 255; - if (a_count >= 254) { - outStream.writeByte(a_count); - outStream.writeBytesView(accum, 0, a_count); - a_count = 0; - } - cur_accum >>= 8; - cur_bits -= 8; - } - if (free_ent > maxcode || clear_flg) { - if (clear_flg) { - n_bits = g_init_bits; - maxcode = (1 << n_bits) - 1; - clear_flg = false; - } else { - ++n_bits; - maxcode = n_bits === BITS ? 1 << n_bits : (1 << n_bits) - 1; - } - } - if (code == EOFCode) { - while (cur_bits > 0) { - accum[a_count++] = cur_accum & 255; - if (a_count >= 254) { - outStream.writeByte(a_count); - outStream.writeBytesView(accum, 0, a_count); - a_count = 0; - } - cur_accum >>= 8; - cur_bits -= 8; - } - if (a_count > 0) { - outStream.writeByte(a_count); - outStream.writeBytesView(accum, 0, a_count); - a_count = 0; - } - } - } - } - var lzwEncode_default = lzwEncode; - // src/rgb-packing.js - function rgb888_to_rgb565(r, g, b) { - return r << 8 & 63488 | g << 2 & 992 | b >> 3; - } - function rgba8888_to_rgba4444(r, g, b, a) { - return r >> 4 | g & 240 | (b & 240) << 4 | (a & 240) << 8; - } - function rgb888_to_rgb444(r, g, b) { - return r >> 4 << 8 | g & 240 | b >> 4; - } // src/pnnquant2.js - - function clamp(value, min, max) { - return value < min ? min : value > max ? max : value; - } - function sqr(value) { - return value * value; - } - function find_nn(bins, idx, hasAlpha) { - var nn = 0; - var err = 1e+100; - const bin1 = bins[idx]; - const n1 = bin1.cnt; - const wa = bin1.ac; - const wr = bin1.rc; - const wg = bin1.gc; - const wb = bin1.bc; - for (var i = bin1.fw; i != 0; i = bins[i].fw) { - const bin = bins[i]; - const n2 = bin.cnt; - const nerr2 = n1 * n2 / (n1 + n2); - if (nerr2 >= err) continue; - var nerr = 0; - if (hasAlpha) { - nerr += nerr2 * sqr(bin.ac - wa); - if (nerr >= err) continue; - } - nerr += nerr2 * sqr(bin.rc - wr); - if (nerr >= err) continue; - nerr += nerr2 * sqr(bin.gc - wg); - if (nerr >= err) continue; - nerr += nerr2 * sqr(bin.bc - wb); - if (nerr >= err) continue; - err = nerr; - nn = i; - } - bin1.err = err; - bin1.nn = nn; - } - function create_bin() { - return { - ac: 0, - rc: 0, - gc: 0, - bc: 0, - cnt: 0, - nn: 0, - fw: 0, - bk: 0, - tm: 0, - mtm: 0, - err: 0 - }; - } - function create_bin_list(data, format) { - const bincount = format === 'rgb444' ? 4096 : 65536; - const bins = new Array(bincount); - const size = data.length; - if (format === 'rgba4444') { - for (let i = 0; i < size; ++i) { - const color = data[i]; - const a = color >> 24 & 255; - const b = color >> 16 & 255; - const g = color >> 8 & 255; - const r = color & 255; - const index = rgba8888_to_rgba4444(r, g, b, a); - let bin = index in bins ? bins[index] : bins[index] = create_bin(); - bin.rc += r; - bin.gc += g; - bin.bc += b; - bin.ac += a; - bin.cnt++; - } - } else if (format === 'rgb444') { - for (let i = 0; i < size; ++i) { - const color = data[i]; - const b = color >> 16 & 255; - const g = color >> 8 & 255; - const r = color & 255; - const index = rgb888_to_rgb444(r, g, b); - let bin = index in bins ? bins[index] : bins[index] = create_bin(); - bin.rc += r; - bin.gc += g; - bin.bc += b; - bin.cnt++; - } - } else { - for (let i = 0; i < size; ++i) { - const color = data[i]; - const b = color >> 16 & 255; - const g = color >> 8 & 255; - const r = color & 255; - const index = rgb888_to_rgb565(r, g, b); - let bin = index in bins ? bins[index] : bins[index] = create_bin(); - bin.rc += r; - bin.gc += g; - bin.bc += b; - bin.cnt++; - } - } - return bins; - } - function quantize(rgba, maxColors, opts = { - }) { - const { - format = 'rgb565', - clearAlpha = true, - clearAlphaColor = 0, - clearAlphaThreshold = 0, - oneBitAlpha = false - } - = opts; - if (!rgba || !rgba.buffer) { - throw new Error('quantize() expected RGBA Uint8Array data'); - } - if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) { - throw new Error('quantize() expected RGBA Uint8Array data'); - } - const data = new Uint32Array(rgba.buffer); - let useSqrt = opts.useSqrt !== false; - const hasAlpha = format === 'rgba4444'; - const bins = create_bin_list(data, format); - const bincount = bins.length; - const bincountMinusOne = bincount - 1; - const heap = new Uint32Array(bincount + 1); - var maxbins = 0; - for (var i = 0; i < bincount; ++i) { - const bin = bins[i]; - if (bin != null) { - var d = 1 / bin.cnt; - if (hasAlpha) bin.ac *= d; - bin.rc *= d; - bin.gc *= d; - bin.bc *= d; - bins[maxbins++] = bin; - } - } - if (sqr(maxColors) / maxbins < 0.022) { - useSqrt = false; - } - var i = 0; - for (; i < maxbins - 1; ++i) { - bins[i].fw = i + 1; - bins[i + 1].bk = i; - if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); - } - if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); - var h, - l, - l2; - for (i = 0; i < maxbins; ++i) { - find_nn(bins, i, false); - var err = bins[i].err; - for (l = ++heap[0]; l > 1; l = l2) { - l2 = l >> 1; - if (bins[h = heap[l2]].err <= err) break; - heap[l] = h; - } - heap[l] = i; - } - var extbins = maxbins - maxColors; - for (i = 0; i < extbins; ) { - var tb; - for (; ; ) { - var b1 = heap[1]; - tb = bins[b1]; - if (tb.tm >= tb.mtm && bins[tb.nn].mtm <= tb.tm) break; - if (tb.mtm == bincountMinusOne) b1 = heap[1] = heap[heap[0]--]; - else { - find_nn(bins, b1, false); - tb.tm = i; - } - var err = bins[b1].err; - for (l = 1; (l2 = l + l) <= heap[0]; l = l2) { - if (l2 < heap[0] && bins[heap[l2]].err > bins[heap[l2 + 1]].err) l2++; - if (err <= bins[h = heap[l2]].err) break; - heap[l] = h; - } - heap[l] = b1; - } - var nb = bins[tb.nn]; - var n1 = tb.cnt; - var n2 = nb.cnt; - var d = 1 / (n1 + n2); - if (hasAlpha) tb.ac = d * (n1 * tb.ac + n2 * nb.ac); - tb.rc = d * (n1 * tb.rc + n2 * nb.rc); - tb.gc = d * (n1 * tb.gc + n2 * nb.gc); - tb.bc = d * (n1 * tb.bc + n2 * nb.bc); - tb.cnt += nb.cnt; - tb.mtm = ++i; - bins[nb.bk].fw = nb.fw; - bins[nb.fw].bk = nb.bk; - nb.mtm = bincountMinusOne; - } - let palette = [ - ]; - var k = 0; - for (i = 0; ; ++k) { - let r = clamp(Math.round(bins[i].rc), 0, 255); - let g = clamp(Math.round(bins[i].gc), 0, 255); - let b = clamp(Math.round(bins[i].bc), 0, 255); - let a = 255; - if (hasAlpha) { - a = clamp(Math.round(bins[i].ac), 0, 255); - if (oneBitAlpha) { - const threshold = typeof oneBitAlpha === 'number' ? oneBitAlpha : 127; - a = a <= threshold ? 0 : 255; - } - if (clearAlpha && a <= clearAlphaThreshold) { - r = g = b = clearAlphaColor; - a = 0; - } - } - const color = hasAlpha ? [ - r, - g, - b, - a - ] : [ - r, - g, - b - ]; - const exists = existsInPalette(palette, color); - if (!exists) palette.push(color); - if ((i = bins[i].fw) == 0) break; - } - return palette; - } - function existsInPalette(palette, color) { - for (let i = 0; i < palette.length; i++) { - const p = palette[i]; - let matchesRGB = p[0] === color[0] && p[1] === color[1] && p[2] === color[2]; - let matchesAlpha = p.length >= 4 && color.length >= 4 ? p[3] === color[3] : true; - if (matchesRGB && matchesAlpha) return true; - } - return false; - } // src/color.js - - function euclideanDistanceSquared(a, b) { - var sum = 0; - var n; - for (n = 0; n < a.length; n++) { - const dx = a[n] - b[n]; - sum += dx * dx; - } - return sum; - } // src/palettize.js - - function roundStep(byte, step) { - return step > 1 ? Math.round(byte / step) * step : byte; - } - function prequantize(rgba, { - roundRGB = 5, - roundAlpha = 10, - oneBitAlpha = null - } - = { - }) { - const data = new Uint32Array(rgba.buffer); - for (let i = 0; i < data.length; i++) { - const color = data[i]; - let a = color >> 24 & 255; - let b = color >> 16 & 255; - let g = color >> 8 & 255; - let r = color & 255; - a = roundStep(a, roundAlpha); - if (oneBitAlpha) { - const threshold = typeof oneBitAlpha === 'number' ? oneBitAlpha : 127; - a = a <= threshold ? 0 : 255; - } - r = roundStep(r, roundRGB); - g = roundStep(g, roundRGB); - b = roundStep(b, roundRGB); - data[i] = a << 24 | b << 16 | g << 8 | r << 0; - } - } - function applyPalette(rgba, palette, format = 'rgb565') { - if (!rgba || !rgba.buffer) { - throw new Error('quantize() expected RGBA Uint8Array data'); - } - if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) { - throw new Error('quantize() expected RGBA Uint8Array data'); - } - if (palette.length > 256) { - throw new Error('applyPalette() only works with 256 colors or less'); - } - const data = new Uint32Array(rgba.buffer); - const length = data.length; - const bincount = format === 'rgb444' ? 4096 : 65536; - const index = new Uint8Array(length); - const cache = new Array(bincount); - const hasAlpha = format === 'rgba4444'; - if (format === 'rgba4444') { - for (let i = 0; i < length; i++) { - const color = data[i]; - const a = color >> 24 & 255; - const b = color >> 16 & 255; - const g = color >> 8 & 255; - const r = color & 255; - const key = rgba8888_to_rgba4444(r, g, b, a); - const idx = key in cache ? cache[key] : cache[key] = nearestColorIndexRGBA(r, g, b, a, palette); - index[i] = idx; - } - } else { - const rgb888_to_key = format === 'rgb444' ? rgb888_to_rgb444 : rgb888_to_rgb565; - for (let i = 0; i < length; i++) { - const color = data[i]; - const b = color >> 16 & 255; - const g = color >> 8 & 255; - const r = color & 255; - const key = rgb888_to_key(r, g, b); - const idx = key in cache ? cache[key] : cache[key] = nearestColorIndexRGB(r, g, b, palette); - index[i] = idx; - } - } - return index; - } - function nearestColorIndexRGBA(r, g, b, a, palette) { - let k = 0; - let mindist = 1e+100; - for (let i = 0; i < palette.length; i++) { - const px2 = palette[i]; - const a2 = px2[3]; - let curdist = sqr2(a2 - a); - if (curdist > mindist) continue; - const r2 = px2[0]; - curdist += sqr2(r2 - r); - if (curdist > mindist) continue; - const g2 = px2[1]; - curdist += sqr2(g2 - g); - if (curdist > mindist) continue; - const b2 = px2[2]; - curdist += sqr2(b2 - b); - if (curdist > mindist) continue; - mindist = curdist; - k = i; - } - return k; - } - function nearestColorIndexRGB(r, g, b, palette) { - let k = 0; - let mindist = 1e+100; - for (let i = 0; i < palette.length; i++) { - const px2 = palette[i]; - const r2 = px2[0]; - let curdist = sqr2(r2 - r); - if (curdist > mindist) continue; - const g2 = px2[1]; - curdist += sqr2(g2 - g); - if (curdist > mindist) continue; - const b2 = px2[2]; - curdist += sqr2(b2 - b); - if (curdist > mindist) continue; - mindist = curdist; - k = i; - } - return k; - } - function snapColorsToPalette(palette, knownColors, threshold = 5) { - if (!palette.length || !knownColors.length) return; - const paletteRGB = palette.map(p=>p.slice(0, 3)); - const thresholdSq = threshold * threshold; - const dim = palette[0].length; - for (let i = 0; i < knownColors.length; i++) { - let color = knownColors[i]; - if (color.length < dim) { - color = [ - color[0], - color[1], - color[2], - 255 - ]; - } else if (color.length > dim) { - color = color.slice(0, 3); - } else { - color = color.slice(); - } - const r = nearestColorIndexWithDistance(paletteRGB, color.slice(0, 3), euclideanDistanceSquared); - const idx = r[0]; - const distanceSq = r[1]; - if (distanceSq > 0 && distanceSq <= thresholdSq) { - palette[idx] = color; - } - } - } - function sqr2(a) { - return a * a; - } - function nearestColorIndex(colors, pixel, distanceFn = euclideanDistanceSquared) { - let minDist = Infinity; - let minDistIndex = - 1; - for (let j = 0; j < colors.length; j++) { - const paletteColor = colors[j]; - const dist = distanceFn(pixel, paletteColor); - if (dist < minDist) { - minDist = dist; - minDistIndex = j; - } - } - return minDistIndex; - } - function nearestColorIndexWithDistance(colors, pixel, distanceFn = euclideanDistanceSquared) { - let minDist = Infinity; - let minDistIndex = - 1; - for (let j = 0; j < colors.length; j++) { - const paletteColor = colors[j]; - const dist = distanceFn(pixel, paletteColor); - if (dist < minDist) { - minDist = dist; - minDistIndex = j; - } - } - return [minDistIndex, - minDist]; - } - function nearestColor(colors, pixel, distanceFn = euclideanDistanceSquared) { - return colors[nearestColorIndex(colors, pixel, distanceFn)]; - } // src/index.js - - function GIFEncoder(opt = { - }) { - const { - initialCapacity = 4096, - auto = true - } - = opt; - const stream = createStream(initialCapacity); - const HSIZE = 5003; - const accum = new Uint8Array(256); - const htab = new Int32Array(HSIZE); - const codetab = new Int32Array(HSIZE); - let hasInit = false; - return { - reset() { - stream.reset(); - hasInit = false; - }, - finish() { - stream.writeByte(constants_default.trailer); - }, - bytes() { - return stream.bytes(); - }, - bytesView() { - return stream.bytesView(); - }, - get buffer() { - return stream.buffer; - }, - get stream() { - return stream; - }, - writeHeader, - writeFrame(index, width, height, opts = { - }) { - const { - transparent = false, - transparentIndex = 0, - delay = 0, - palette = null, - repeat = 0, - colorDepth = 8, - dispose = - 1 - } - = opts; - let first = false; - if (auto) { - if (!hasInit) { - first = true; - writeHeader(); - hasInit = true; - } - } else { - first = Boolean(opts.first); - } - width = Math.max(0, Math.floor(width)); - height = Math.max(0, Math.floor(height)); - if (first) { - if (!palette) { - throw new Error('First frame must include a { palette } option'); - } - encodeLogicalScreenDescriptor(stream, width, height, palette, colorDepth); - encodeColorTable(stream, palette); - if (repeat >= 0) { - encodeNetscapeExt(stream, repeat); - } - } - const delayTime = Math.round(delay / 10); - encodeGraphicControlExt(stream, dispose, delayTime, transparent, transparentIndex); - const useLocalColorTable = Boolean(palette) && !first; - encodeImageDescriptor(stream, width, height, useLocalColorTable ? palette : null); - if (useLocalColorTable) encodeColorTable(stream, palette); - encodePixels(stream, index, width, height, colorDepth, accum, htab, codetab); - } - }; - function writeHeader() { - writeUTFBytes(stream, 'GIF89a'); - } - } - function encodeGraphicControlExt(stream, dispose, delay, transparent, transparentIndex) { - stream.writeByte(33); - stream.writeByte(249); - stream.writeByte(4); - if (transparentIndex < 0) { - transparentIndex = 0; - transparent = false; - } - var transp, - disp; - if (!transparent) { - transp = 0; - disp = 0; - } else { - transp = 1; - disp = 2; - } - if (dispose >= 0) { - disp = dispose & 7; - } - disp <<= 2; - const userInput = 0; - stream.writeByte(0 | disp | userInput | transp); - writeUInt16(stream, delay); - stream.writeByte(transparentIndex || 0); - stream.writeByte(0); - } - function encodeLogicalScreenDescriptor(stream, width, height, palette, colorDepth = 8) { - const globalColorTableFlag = 1; - const sortFlag = 0; - const globalColorTableSize = colorTableSize(palette.length) - 1; - const fields = globalColorTableFlag << 7 | colorDepth - 1 << 4 | sortFlag << 3 | globalColorTableSize; - const backgroundColorIndex = 0; - const pixelAspectRatio = 0; - writeUInt16(stream, width); - writeUInt16(stream, height); - stream.writeBytes([fields, - backgroundColorIndex, - pixelAspectRatio]); - } - function encodeNetscapeExt(stream, repeat) { - stream.writeByte(33); - stream.writeByte(255); - stream.writeByte(11); - writeUTFBytes(stream, 'NETSCAPE2.0'); - stream.writeByte(3); - stream.writeByte(1); - writeUInt16(stream, repeat); - stream.writeByte(0); - } - function encodeColorTable(stream, palette) { - const colorTableLength = 1 << colorTableSize(palette.length); - for (let i = 0; i < colorTableLength; i++) { - let color = [ - 0, - 0, - 0 - ]; - if (i < palette.length) { - color = palette[i]; - } - stream.writeByte(color[0]); - stream.writeByte(color[1]); - stream.writeByte(color[2]); - } - } - function encodeImageDescriptor(stream, width, height, localPalette) { - stream.writeByte(44); - writeUInt16(stream, 0); - writeUInt16(stream, 0); - writeUInt16(stream, width); - writeUInt16(stream, height); - if (localPalette) { - const interlace = 0; - const sorted = 0; - const palSize = colorTableSize(localPalette.length) - 1; - stream.writeByte(128 | interlace | sorted | 0 | palSize); - } else { - stream.writeByte(0); - } - } - function encodePixels(stream, index, width, height, colorDepth = 8, accum, htab, codetab) { - lzwEncode_default(width, height, index, colorDepth, stream, accum, htab, codetab); - } - function writeUInt16(stream, short) { - stream.writeByte(short & 255); - stream.writeByte(short >> 8 & 255); - } - function writeUTFBytes(stream, text) { - for (var i = 0; i < text.length; i++) { - stream.writeByte(text.charCodeAt(i)); - } - } - function colorTableSize(length) { - return Math.max(Math.ceil(Math.log2(length)), 1); - } - var src_default = GIFEncoder; - }, - { - } - ], - 264: [ - function (_dereq_, module, exports) { - 'use strict'; - function _interopDefault(ex) { - return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; - } - var _classCallCheck = _interopDefault(_dereq_('@babel/runtime/helpers/classCallCheck')); - var _createClass = _interopDefault(_dereq_('@babel/runtime/helpers/createClass')); - var arr = [ - ]; - var each = arr.forEach; - var slice = arr.slice; - function defaults(obj) { - each.call(slice.call(arguments, 1), function (source) { - if (source) { - for (var prop in source) { - if (obj[prop] === undefined) obj[prop] = source[prop]; - } - } - }); - return obj; - } - var cookie = { - create: function create(name, value, minutes, domain) { - var expires; - if (minutes) { - var date = new Date(); - date.setTime(date.getTime() + minutes * 60 * 1000); - expires = '; expires=' + date.toGMTString(); - } else expires = ''; - domain = domain ? 'domain=' + domain + ';' : ''; - document.cookie = name + '=' + value + expires + ';' + domain + 'path=/'; - }, - read: function read(name) { - var nameEQ = name + '='; - var ca = document.cookie.split(';'); - for (var i = 0; i < ca.length; i++) { - var c = ca[i]; - while (c.charAt(0) === ' ') { - c = c.substring(1, c.length); - } - if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); - } - return null; - }, - remove: function remove(name) { - this.create(name, '', - 1); - } - }; - var cookie$1 = { - name: 'cookie', - lookup: function lookup(options) { - var found; - if (options.lookupCookie && typeof document !== 'undefined') { - var c = cookie.read(options.lookupCookie); - if (c) found = c; - } - return found; - }, - cacheUserLanguage: function cacheUserLanguage(lng, options) { - if (options.lookupCookie && typeof document !== 'undefined') { - cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain); - } - } - }; - var querystring = { - name: 'querystring', - lookup: function lookup(options) { - var found; - if (typeof window !== 'undefined') { - var query = window.location.search.substring(1); - var params = query.split('&'); - for (var i = 0; i < params.length; i++) { - var pos = params[i].indexOf('='); - if (pos > 0) { - var key = params[i].substring(0, pos); - if (key === options.lookupQuerystring) { - found = params[i].substring(pos + 1); - } - } - } - } - return found; - } - }; - var hasLocalStorageSupport; - try { - hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null; - var testKey = 'i18next.translate.boo'; - window.localStorage.setItem(testKey, 'foo'); - window.localStorage.removeItem(testKey); - } catch (e) { - hasLocalStorageSupport = false; - } - var localStorage = { - name: 'localStorage', - lookup: function lookup(options) { - var found; - if (options.lookupLocalStorage && hasLocalStorageSupport) { - var lng = window.localStorage.getItem(options.lookupLocalStorage); - if (lng) found = lng; - } - return found; - }, - cacheUserLanguage: function cacheUserLanguage(lng, options) { - if (options.lookupLocalStorage && hasLocalStorageSupport) { - window.localStorage.setItem(options.lookupLocalStorage, lng); - } - } - }; - var navigator$1 = { - name: 'navigator', - lookup: function lookup(options) { - var found = [ - ]; - if (typeof navigator !== 'undefined') { - if (navigator.languages) { - // chrome only; not an array, so can't use .push.apply instead of iterating - for (var i = 0; i < navigator.languages.length; i++) { - found.push(navigator.languages[i]); - } - } - if (navigator.userLanguage) { - found.push(navigator.userLanguage); - } - if (navigator.language) { - found.push(navigator.language); - } - } - return found.length > 0 ? found : undefined; - } - }; - var htmlTag = { - name: 'htmlTag', - lookup: function lookup(options) { - var found; - var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null); - if (htmlTag && typeof htmlTag.getAttribute === 'function') { - found = htmlTag.getAttribute('lang'); - } - return found; - } - }; - var path = { - name: 'path', - lookup: function lookup(options) { - var found; - if (typeof window !== 'undefined') { - var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g); - if (language instanceof Array) { - if (typeof options.lookupFromPathIndex === 'number') { - if (typeof language[options.lookupFromPathIndex] !== 'string') { - return undefined; - } - found = language[options.lookupFromPathIndex].replace('/', ''); - } else { - found = language[0].replace('/', ''); - } - } - } - return found; - } - }; - var subdomain = { - name: 'subdomain', - lookup: function lookup(options) { - var found; - if (typeof window !== 'undefined') { - var language = window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi); - if (language instanceof Array) { - if (typeof options.lookupFromSubdomainIndex === 'number') { - found = language[options.lookupFromSubdomainIndex].replace('http://', '').replace('https://', '').replace('.', ''); - } else { - found = language[0].replace('http://', '').replace('https://', '').replace('.', ''); - } - } - } - return found; - } - }; - function getDefaults() { - return { - order: [ - 'querystring', - 'cookie', - 'localStorage', - 'navigator', - 'htmlTag' - ], - lookupQuerystring: 'lng', - lookupCookie: 'i18next', - lookupLocalStorage: 'i18nextLng', - // cache user language - caches: [ - 'localStorage' - ], - excludeCacheFor: [ - 'cimode' - ], - //cookieMinutes: 10, - //cookieDomain: 'myDomain' - checkWhitelist: true - }; - } - var Browser = /*#__PURE__*/ - function () { - function Browser(services) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - _classCallCheck(this, Browser); - this.type = 'languageDetector'; - this.detectors = { - }; - this.init(services, options); - } - _createClass(Browser, [ - { - key: 'init', - value: function init(services) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - }; - this.services = services; - this.options = defaults(options, this.options || { - }, getDefaults()); // backwards compatibility - if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex; - this.i18nOptions = i18nOptions; - this.addDetector(cookie$1); - this.addDetector(querystring); - this.addDetector(localStorage); - this.addDetector(navigator$1); - this.addDetector(htmlTag); - this.addDetector(path); - this.addDetector(subdomain); - } - }, - { - key: 'addDetector', - value: function addDetector(detector) { - this.detectors[detector.name] = detector; - } - }, - { - key: 'detect', - value: function detect(detectionOrder) { - var _this = this; - if (!detectionOrder) detectionOrder = this.options.order; - var detected = [ - ]; - detectionOrder.forEach(function (detectorName) { - if (_this.detectors[detectorName]) { - var lookup = _this.detectors[detectorName].lookup(_this.options); - if (lookup && typeof lookup === 'string') lookup = [ - lookup - ]; - if (lookup) detected = detected.concat(lookup); - } - }); - var found; - detected.forEach(function (lng) { - if (found) return; - var cleanedLng = _this.services.languageUtils.formatLanguageCode(lng); - if (!_this.options.checkWhitelist || _this.services.languageUtils.isWhitelisted(cleanedLng)) found = cleanedLng; - }); - if (!found) { - var fallbacks = this.i18nOptions.fallbackLng; - if (typeof fallbacks === 'string') fallbacks = [ - fallbacks - ]; - if (!fallbacks) fallbacks = [ - ]; - if (Object.prototype.toString.apply(fallbacks) === '[object Array]') { - found = fallbacks[0]; - } else { - found = fallbacks[0] || fallbacks['default'] && fallbacks['default'][0]; - } - } - return found; - } - }, - { - key: 'cacheUserLanguage', - value: function cacheUserLanguage(lng, caches) { - var _this2 = this; - if (!caches) caches = this.options.caches; - if (!caches) return; - if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > - 1) return; - caches.forEach(function (cacheName) { - if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options); - }); - } - } - ]); - return Browser; - }(); - Browser.type = 'languageDetector'; - module.exports = Browser; - }, - { - '@babel/runtime/helpers/classCallCheck': 265, - '@babel/runtime/helpers/createClass': 266 - } - ], - 265: [ - function (_dereq_, module, exports) { - arguments[4][5][0].apply(exports, arguments) - }, - { - 'dup': 5 - } - ], - 266: [ - function (_dereq_, module, exports) { - arguments[4][6][0].apply(exports, arguments) - }, - { - 'dup': 6 - } - ], - 267: [ - function (_dereq_, module, exports) { - 'use strict'; - function _interopDefault(ex) { - return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; - } - var _typeof = _interopDefault(_dereq_('@babel/runtime/helpers/typeof')); - var _objectSpread = _interopDefault(_dereq_('@babel/runtime/helpers/objectSpread')); - var _classCallCheck = _interopDefault(_dereq_('@babel/runtime/helpers/classCallCheck')); - var _createClass = _interopDefault(_dereq_('@babel/runtime/helpers/createClass')); - var _possibleConstructorReturn = _interopDefault(_dereq_('@babel/runtime/helpers/possibleConstructorReturn')); - var _getPrototypeOf = _interopDefault(_dereq_('@babel/runtime/helpers/getPrototypeOf')); - var _assertThisInitialized = _interopDefault(_dereq_('@babel/runtime/helpers/assertThisInitialized')); - var _inherits = _interopDefault(_dereq_('@babel/runtime/helpers/inherits')); - var _toConsumableArray = _interopDefault(_dereq_('@babel/runtime/helpers/toConsumableArray')); - var _slicedToArray = _interopDefault(_dereq_('@babel/runtime/helpers/slicedToArray')); - var consoleLogger = { - type: 'logger', - log: function log(args) { - this.output('log', args); - }, - warn: function warn(args) { - this.output('warn', args); - }, - error: function error(args) { - this.output('error', args); - }, - output: function output(type, args) { - var _console; - /* eslint no-console: 0 */ - if (console && console[type]) (_console = console) [type].apply(_console, _toConsumableArray(args)); - } - }; - var Logger = /*#__PURE__*/ - function () { - function Logger(concreteLogger) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - _classCallCheck(this, Logger); - this.init(concreteLogger, options); - } - _createClass(Logger, [ - { - key: 'init', - value: function init(concreteLogger) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - this.prefix = options.prefix || 'i18next:'; - this.logger = concreteLogger || consoleLogger; - this.options = options; - this.debug = options.debug; - } - }, - { - key: 'setDebug', - value: function setDebug(bool) { - this.debug = bool; - } - }, - { - key: 'log', - value: function log() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return this.forward(args, 'log', '', true); - } - }, - { - key: 'warn', - value: function warn() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return this.forward(args, 'warn', '', true); - } - }, - { - key: 'error', - value: function error() { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - return this.forward(args, 'error', ''); - } - }, - { - key: 'deprecate', - value: function deprecate() { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true); - } - }, - { - key: 'forward', - value: function forward(args, lvl, prefix, debugOnly) { - if (debugOnly && !this.debug) return null; - if (typeof args[0] === 'string') args[0] = ''.concat(prefix).concat(this.prefix, ' ').concat(args[0]); - return this.logger[lvl](args); - } - }, - { - key: 'create', - value: function create(moduleName) { - return new Logger(this.logger, _objectSpread({ - }, { - prefix: ''.concat(this.prefix, ':').concat(moduleName, ':') - }, this.options)); - } - } - ]); - return Logger; - }(); - var baseLogger = new Logger(); - var EventEmitter = /*#__PURE__*/ - function () { - function EventEmitter() { - _classCallCheck(this, EventEmitter); - this.observers = { - }; - } - _createClass(EventEmitter, [ - { - key: 'on', - value: function on(events, listener) { - var _this = this; - events.split(' ').forEach(function (event) { - _this.observers[event] = _this.observers[event] || [ - ]; - _this.observers[event].push(listener); - }); - return this; - } - }, - { - key: 'off', - value: function off(event, listener) { - if (!this.observers[event]) return; - if (!listener) { - delete this.observers[event]; - return; - } - this.observers[event] = this.observers[event].filter(function (l) { - return l !== listener; - }); - } - }, - { - key: 'emit', - value: function emit(event) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - if (this.observers[event]) { - var cloned = [ - ].concat(this.observers[event]); - cloned.forEach(function (observer) { - observer.apply(void 0, args); - }); - } - if (this.observers['*']) { - var _cloned = [ - ].concat(this.observers['*']); - _cloned.forEach(function (observer) { - observer.apply(observer, [ - event - ].concat(args)); - }); - } - } - } - ]); - return EventEmitter; - }(); - // http://lea.verou.me/2016/12/resolve-promises-externally-with-this-one-weird-trick/ - function defer() { - var res; - var rej; - var promise = new Promise(function (resolve, reject) { - res = resolve; - rej = reject; - }); - promise.resolve = res; - promise.reject = rej; - return promise; - } - function makeString(object) { - if (object == null) return ''; - /* eslint prefer-template: 0 */ - return '' + object; - } - function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); - } - function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf('###') > - 1 ? key.replace(/###/g, '.') : key; - } - function canNotTraverseDeeper() { - return !object || typeof object === 'string'; - } - var stack = typeof path !== 'string' ? [ - ].concat(path) : path.split('.'); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return { - }; - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - if (canNotTraverseDeeper()) return { - }; - return { - obj: object, - k: cleanKey(stack.shift()) - }; - } - function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - obj[k] = newValue; - } - function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - obj[k] = obj[k] || [ - ]; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); - } - function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - if (!obj) return undefined; - return obj[k]; - } - function getPathWithDefaults(data, defaultData, key) { - var value = getPath(data, key); - if (value !== undefined) { - return value; - } // Fallback to default values - - return getPath(defaultData, key); - } - function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; - } - function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); - } /* eslint-disable */ - - var _entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '/': '/' - }; - /* eslint-enable */ - function escape(data) { - if (typeof data === 'string') { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - return data; - } - var ResourceStore = /*#__PURE__*/ - function (_EventEmitter) { - _inherits(ResourceStore, _EventEmitter); - function ResourceStore(data) { - var _this; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - ns: [ - 'translation' - ], - defaultNS: 'translation' - }; - _classCallCheck(this, ResourceStore); - _this = _possibleConstructorReturn(this, _getPrototypeOf(ResourceStore).call(this)); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - _this.data = data || { - }; - _this.options = options; - if (_this.options.keySeparator === undefined) { - _this.options.keySeparator = '.'; - } - return _this; - } - _createClass(ResourceStore, [ - { - key: 'addNamespaces', - value: function addNamespaces(ns) { - if (this.options.ns.indexOf(ns) < 0) { - this.options.ns.push(ns); - } - } - }, - { - key: 'removeNamespaces', - value: function removeNamespaces(ns) { - var index = this.options.ns.indexOf(ns); - if (index > - 1) { - this.options.ns.splice(index, 1); - } - } - }, - { - key: 'getResource', - value: function getResource(lng, ns, key) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { - }; - var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; - var path = [ - lng, - ns - ]; - if (key && typeof key !== 'string') path = path.concat(key); - if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key); - if (lng.indexOf('.') > - 1) { - path = lng.split('.'); - } - return getPath(this.data, path); - } - }, - { - key: 'addResource', - value: function addResource(lng, ns, key, value) { - var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { - silent: false - }; - var keySeparator = this.options.keySeparator; - if (keySeparator === undefined) keySeparator = '.'; - var path = [ - lng, - ns - ]; - if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); - if (lng.indexOf('.') > - 1) { - path = lng.split('.'); - value = ns; - ns = path[1]; - } - this.addNamespaces(ns); - setPath(this.data, path, value); - if (!options.silent) this.emit('added', lng, ns, key, value); - } - }, - { - key: 'addResources', - value: function addResources(lng, ns, resources) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { - silent: false - }; - /* eslint no-restricted-syntax: 0 */ - for (var m in resources) { - if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], { - silent: true - }); - } - if (!options.silent) this.emit('added', lng, ns, resources); - } - }, - { - key: 'addResourceBundle', - value: function addResourceBundle(lng, ns, resources, deep, overwrite) { - var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { - silent: false - }; - var path = [ - lng, - ns - ]; - if (lng.indexOf('.') > - 1) { - path = lng.split('.'); - deep = resources; - resources = ns; - ns = path[1]; - } - this.addNamespaces(ns); - var pack = getPath(this.data, path) || { - }; - if (deep) { - deepExtend(pack, resources, overwrite); - } else { - pack = _objectSpread({ - }, pack, resources); - } - setPath(this.data, path, pack); - if (!options.silent) this.emit('added', lng, ns, resources); - } - }, - { - key: 'removeResourceBundle', - value: function removeResourceBundle(lng, ns) { - if (this.hasResourceBundle(lng, ns)) { - delete this.data[lng][ns]; - } - this.removeNamespaces(ns); - this.emit('removed', lng, ns); - } - }, - { - key: 'hasResourceBundle', - value: function hasResourceBundle(lng, ns) { - return this.getResource(lng, ns) !== undefined; - } - }, - { - key: 'getResourceBundle', - value: function getResourceBundle(lng, ns) { - if (!ns) ns = this.options.defaultNS; // COMPATIBILITY: remove extend in v2.1.0 - if (this.options.compatibilityAPI === 'v1') return _objectSpread({ - }, { - }, this.getResource(lng, ns)); - return this.getResource(lng, ns); - } - }, - { - key: 'getDataByLanguage', - value: function getDataByLanguage(lng) { - return this.data[lng]; - } - }, - { - key: 'toJSON', - value: function toJSON() { - return this.data; - } - } - ]); - return ResourceStore; - }(EventEmitter); - var postProcessor = { - processors: { - }, - addPostProcessor: function addPostProcessor(module) { - this.processors[module.name] = module; - }, - handle: function handle(processors, value, key, options, translator) { - var _this = this; - processors.forEach(function (processor) { - if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator); - }); - return value; - } - }; - var checkedLoadedFor = { - }; - var Translator = /*#__PURE__*/ - function (_EventEmitter) { - _inherits(Translator, _EventEmitter); - function Translator(services) { - var _this; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - _classCallCheck(this, Translator); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Translator).call(this)); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - copy(['resourceStore', - 'languageUtils', - 'pluralResolver', - 'interpolator', - 'backendConnector', - 'i18nFormat', - 'utils'], services, _assertThisInitialized(_this)); - _this.options = options; - if (_this.options.keySeparator === undefined) { - _this.options.keySeparator = '.'; - } - _this.logger = baseLogger.create('translator'); - return _this; - } - _createClass(Translator, [ - { - key: 'changeLanguage', - value: function changeLanguage(lng) { - if (lng) this.language = lng; - } - }, - { - key: 'exists', - value: function exists(key) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - interpolation: { - } - }; - var resolved = this.resolve(key, options); - return resolved && resolved.res !== undefined; - } - }, - { - key: 'extractFromKey', - value: function extractFromKey(key, options) { - var nsSeparator = options.nsSeparator || this.options.nsSeparator; - if (nsSeparator === undefined) nsSeparator = ':'; - var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; - var namespaces = options.ns || this.options.defaultNS; - if (nsSeparator && key.indexOf(nsSeparator) > - 1) { - var parts = key.split(nsSeparator); - if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > - 1) namespaces = parts.shift(); - key = parts.join(keySeparator); - } - if (typeof namespaces === 'string') namespaces = [ - namespaces - ]; - return { - key: key, - namespaces: namespaces - }; - } - }, - { - key: 'translate', - value: function translate(keys, options) { - var _this2 = this; - if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) { - /* eslint prefer-rest-params: 0 */ - options = this.options.overloadTranslationOptionHandler(arguments); - } - if (!options) options = { - }; // non valid keys handling - if (keys === undefined || keys === null /* || keys === ''*/ - ) return ''; - if (!Array.isArray(keys)) keys = [ - String(keys) - ]; // separators - var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; // get namespace(s) - var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options), - key = _this$extractFromKey.key, - namespaces = _this$extractFromKey.namespaces; - var namespace = namespaces[namespaces.length - 1]; // return key on CIMode - var lng = options.lng || this.language; - var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; - if (lng && lng.toLowerCase() === 'cimode') { - if (appendNamespaceToCIMode) { - var nsSeparator = options.nsSeparator || this.options.nsSeparator; - return namespace + nsSeparator + key; - } - return key; - } // resolve from store - - var resolved = this.resolve(keys, options); - var res = resolved && resolved.res; - var resUsedKey = resolved && resolved.usedKey || key; - var resExactUsedKey = resolved && resolved.exactUsedKey || key; - var resType = Object.prototype.toString.apply(res); - var noObject = [ - '[object Number]', - '[object Function]', - '[object RegExp]' - ]; - var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; // object - var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject; - var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number'; - if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) { - if (!options.returnObjects && !this.options.returnObjects) { - this.logger.warn('accessing an object - but returnObjects options is not enabled!'); - return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, options) : 'key \''.concat(key, ' (').concat(this.language, ')\' returned an object instead of string.'); - } // if we got a separator we loop over children - else we just return object as is - // as having it set to false means no hierarchy so no lookup for nested values - - if (keySeparator) { - var resTypeIsArray = resType === '[object Array]'; - var copy$$1 = resTypeIsArray ? [ - ] : { - }; // apply child translation on a copy - /* eslint no-restricted-syntax: 0 */ - var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey; - for (var m in res) { - if (Object.prototype.hasOwnProperty.call(res, m)) { - var deepKey = ''.concat(newKeyToUse).concat(keySeparator).concat(m); - copy$$1[m] = this.translate(deepKey, _objectSpread({ - }, options, { - joinArrays: false, - ns: namespaces - })); - if (copy$$1[m] === deepKey) copy$$1[m] = res[m]; // if nothing found use orginal value as fallback - } - } - res = copy$$1; - } - } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') { - // array special treatment - res = res.join(joinArrays); - if (res) res = this.extendTranslation(res, keys, options); - } else { - // string, empty or null - var usedDefault = false; - var usedKey = false; // fallback value - if (!this.isValidLookup(res) && options.defaultValue !== undefined) { - usedDefault = true; - if (options.count !== undefined) { - var suffix = this.pluralResolver.getSuffix(lng, options.count); - res = options['defaultValue'.concat(suffix)]; - } - if (!res) res = options.defaultValue; - } - if (!this.isValidLookup(res)) { - usedKey = true; - res = key; - } // save missing - - var updateMissing = options.defaultValue && options.defaultValue !== res && this.options.updateMissing; - if (usedKey || usedDefault || updateMissing) { - this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? options.defaultValue : res); - var lngs = [ - ]; - var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); - if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { - for (var i = 0; i < fallbackLngs.length; i++) { - lngs.push(fallbackLngs[i]); - } - } else if (this.options.saveMissingTo === 'all') { - lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); - } else { - lngs.push(options.lng || this.language); - } - var send = function send(l, k) { - if (_this2.options.missingKeyHandler) { - _this2.options.missingKeyHandler(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options); - } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) { - _this2.backendConnector.saveMissing(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options); - } - _this2.emit('missingKey', l, namespace, k, res); - }; - if (this.options.saveMissing) { - var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; - if (this.options.saveMissingPlurals && needsPluralHandling) { - lngs.forEach(function (l) { - var plurals = _this2.pluralResolver.getPluralFormsOfKey(l, key); - plurals.forEach(function (p) { - return send([l], p); - }); - }); - } else { - send(lngs, key); - } - } - } // extend - - res = this.extendTranslation(res, keys, options, resolved); // append namespace if still key - if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = ''.concat(namespace, ':').concat(key); // parseMissingKeyHandler - if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res); - } // return - - return res; - } - }, - { - key: 'extendTranslation', - value: function extendTranslation(res, key, options, resolved) { - var _this3 = this; - if (this.i18nFormat && this.i18nFormat.parse) { - res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, { - resolved: resolved - }); - } else if (!options.skipInterpolation) { - // i18next.parsing - if (options.interpolation) this.interpolator.init(_objectSpread({ - }, options, { - interpolation: _objectSpread({ - }, this.options.interpolation, options.interpolation) - })); // interpolate - var data = options.replace && typeof options.replace !== 'string' ? options.replace : options; - if (this.options.interpolation.defaultVariables) data = _objectSpread({ - }, this.options.interpolation.defaultVariables, data); - res = this.interpolator.interpolate(res, data, options.lng || this.language, options); // nesting - if (options.nest !== false) res = this.interpolator.nest(res, function () { - return _this3.translate.apply(_this3, arguments); - }, options); - if (options.interpolation) this.interpolator.reset(); - } // post process - - var postProcess = options.postProcess || this.options.postProcess; - var postProcessorNames = typeof postProcess === 'string' ? [ - postProcess - ] : postProcess; - if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { - res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread({ - i18nResolved: resolved - }, options) : options, this); - } - return res; - } - }, - { - key: 'resolve', - value: function resolve(keys) { - var _this4 = this; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - var found; - var usedKey; // plain key - var exactUsedKey; // key with context / plural - var usedLng; - var usedNS; - if (typeof keys === 'string') keys = [ - keys - ]; // forEach possible key - keys.forEach(function (k) { - if (_this4.isValidLookup(found)) return; - var extracted = _this4.extractFromKey(k, options); - var key = extracted.key; - usedKey = key; - var namespaces = extracted.namespaces; - if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS); - var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; - var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== ''; - var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng); - namespaces.forEach(function (ns) { - if (_this4.isValidLookup(found)) return; - usedNS = ns; - if (!checkedLoadedFor[''.concat(codes[0], '-').concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) { - checkedLoadedFor[''.concat(codes[0], '-').concat(ns)] = true; - _this4.logger.warn('key "'.concat(usedKey, '" for namespace "').concat(usedNS, '" for languages "').concat(codes.join(', '), '" won\'t get resolved as namespace was not yet loaded'), 'This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!'); - } - codes.forEach(function (code) { - if (_this4.isValidLookup(found)) return; - usedLng = code; - var finalKey = key; - var finalKeys = [ - finalKey - ]; - if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) { - _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options); - } else { - var pluralSuffix; - if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count); // fallback for plural if context not found - if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); // get key for context if needed - if (needsContextHandling) finalKeys.push(finalKey += ''.concat(_this4.options.contextSeparator).concat(options.context)); // get key for plural if needed - if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix); - } // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only - - var possibleKey; - /* eslint no-cond-assign: 0 */ - while (possibleKey = finalKeys.pop()) { - if (!_this4.isValidLookup(found)) { - exactUsedKey = possibleKey; - found = _this4.getResource(code, ns, possibleKey, options); - } - } - }); - }); - }); - return { - res: found, - usedKey: usedKey, - exactUsedKey: exactUsedKey, - usedLng: usedLng, - usedNS: usedNS - }; - } - }, - { - key: 'isValidLookup', - value: function isValidLookup(res) { - return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); - } - }, - { - key: 'getResource', - value: function getResource(code, ns, key) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { - }; - if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options); - return this.resourceStore.getResource(code, ns, key, options); - } - } - ]); - return Translator; - }(EventEmitter); - function capitalize(string) { - return string.charAt(0).toUpperCase() + string.slice(1); - } - var LanguageUtil = /*#__PURE__*/ - function () { - function LanguageUtil(options) { - _classCallCheck(this, LanguageUtil); - this.options = options; - this.whitelist = this.options.whitelist || false; - this.logger = baseLogger.create('languageUtils'); - } - _createClass(LanguageUtil, [ - { - key: 'getScriptPartFromCode', - value: function getScriptPartFromCode(code) { - if (!code || code.indexOf('-') < 0) return null; - var p = code.split('-'); - if (p.length === 2) return null; - p.pop(); - return this.formatLanguageCode(p.join('-')); - } - }, - { - key: 'getLanguagePartFromCode', - value: function getLanguagePartFromCode(code) { - if (!code || code.indexOf('-') < 0) return code; - var p = code.split('-'); - return this.formatLanguageCode(p[0]); - } - }, - { - key: 'formatLanguageCode', - value: function formatLanguageCode(code) { - // http://www.iana.org/assignments/language-tags/language-tags.xhtml - if (typeof code === 'string' && code.indexOf('-') > - 1) { - var specialCases = [ - 'hans', - 'hant', - 'latn', - 'cyrl', - 'cans', - 'mong', - 'arab' - ]; - var p = code.split('-'); - if (this.options.lowerCaseLng) { - p = p.map(function (part) { - return part.toLowerCase(); - }); - } else if (p.length === 2) { - p[0] = p[0].toLowerCase(); - p[1] = p[1].toUpperCase(); - if (specialCases.indexOf(p[1].toLowerCase()) > - 1) p[1] = capitalize(p[1].toLowerCase()); - } else if (p.length === 3) { - p[0] = p[0].toLowerCase(); // if lenght 2 guess it's a country - if (p[1].length === 2) p[1] = p[1].toUpperCase(); - if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase(); - if (specialCases.indexOf(p[1].toLowerCase()) > - 1) p[1] = capitalize(p[1].toLowerCase()); - if (specialCases.indexOf(p[2].toLowerCase()) > - 1) p[2] = capitalize(p[2].toLowerCase()); - } - return p.join('-'); - } - return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; - } - }, - { - key: 'isWhitelisted', - value: function isWhitelisted(code) { - if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) { - code = this.getLanguagePartFromCode(code); - } - return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > - 1; - } - }, - { - key: 'getFallbackCodes', - value: function getFallbackCodes(fallbacks, code) { - if (!fallbacks) return []; - if (typeof fallbacks === 'string') fallbacks = [ - fallbacks - ]; - if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks; - if (!code) return fallbacks['default'] || [ - ]; // asume we have an object defining fallbacks - var found = fallbacks[code]; - if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; - if (!found) found = fallbacks[this.formatLanguageCode(code)]; - if (!found) found = fallbacks['default']; - return found || [ - ]; - } - }, - { - key: 'toResolveHierarchy', - value: function toResolveHierarchy(code, fallbackCode) { - var _this = this; - var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [ - ], code); - var codes = [ - ]; - var addCode = function addCode(c) { - if (!c) return; - if (_this.isWhitelisted(c)) { - codes.push(c); - } else { - _this.logger.warn('rejecting non-whitelisted language code: '.concat(c)); - } - }; - if (typeof code === 'string' && code.indexOf('-') > - 1) { - if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); - if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); - if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); - } else if (typeof code === 'string') { - addCode(this.formatLanguageCode(code)); - } - fallbackCodes.forEach(function (fc) { - if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc)); - }); - return codes; - } - } - ]); - return LanguageUtil; - }(); - /* eslint-disable */ - var sets = [ - { - lngs: [ - 'ach', - 'ak', - 'am', - 'arn', - 'br', - 'fil', - 'gun', - 'ln', - 'mfe', - 'mg', - 'mi', - 'oc', - 'pt', - 'pt-BR', - 'tg', - 'ti', - 'tr', - 'uz', - 'wa' - ], - nr: [ - 1, - 2 - ], - fc: 1 - }, - { - lngs: [ - 'af', - 'an', - 'ast', - 'az', - 'bg', - 'bn', - 'ca', - 'da', - 'de', - 'dev', - 'el', - 'en', - 'eo', - 'es', - 'et', - 'eu', - 'fi', - 'fo', - 'fur', - 'fy', - 'gl', - 'gu', - 'ha', - 'hi', - 'hu', - 'hy', - 'ia', - 'it', - 'kn', - 'ku', - 'lb', - 'mai', - 'ml', - 'mn', - 'mr', - 'nah', - 'nap', - 'nb', - 'ne', - 'nl', - 'nn', - 'no', - 'nso', - 'pa', - 'pap', - 'pms', - 'ps', - 'pt-PT', - 'rm', - 'sco', - 'se', - 'si', - 'so', - 'son', - 'sq', - 'sv', - 'sw', - 'ta', - 'te', - 'tk', - 'ur', - 'yo' - ], - nr: [ - 1, - 2 - ], - fc: 2 - }, - { - lngs: [ - 'ay', - 'bo', - 'cgg', - 'fa', - 'id', - 'ja', - 'jbo', - 'ka', - 'kk', - 'km', - 'ko', - 'ky', - 'lo', - 'ms', - 'sah', - 'su', - 'th', - 'tt', - 'ug', - 'vi', - 'wo', - 'zh' - ], - nr: [ - 1 - ], - fc: 3 - }, - { - lngs: [ - 'be', - 'bs', - 'cnr', - 'dz', - 'hr', - 'ru', - 'sr', - 'uk' - ], - nr: [ - 1, - 2, - 5 - ], - fc: 4 - }, - { - lngs: [ - 'ar' - ], - nr: [ - 0, - 1, - 2, - 3, - 11, - 100 - ], - fc: 5 - }, - { - lngs: [ - 'cs', - 'sk' - ], - nr: [ - 1, - 2, - 5 - ], - fc: 6 - }, - { - lngs: [ - 'csb', - 'pl' - ], - nr: [ - 1, - 2, - 5 - ], - fc: 7 - }, - { - lngs: [ - 'cy' - ], - nr: [ - 1, - 2, - 3, - 8 - ], - fc: 8 - }, - { - lngs: [ - 'fr' - ], - nr: [ - 1, - 2 - ], - fc: 9 - }, - { - lngs: [ - 'ga' - ], - nr: [ - 1, - 2, - 3, - 7, - 11 - ], - fc: 10 - }, - { - lngs: [ - 'gd' - ], - nr: [ - 1, - 2, - 3, - 20 - ], - fc: 11 - }, - { - lngs: [ - 'is' - ], - nr: [ - 1, - 2 - ], - fc: 12 - }, - { - lngs: [ - 'jv' - ], - nr: [ - 0, - 1 - ], - fc: 13 - }, - { - lngs: [ - 'kw' - ], - nr: [ - 1, - 2, - 3, - 4 - ], - fc: 14 - }, - { - lngs: [ - 'lt' - ], - nr: [ - 1, - 2, - 10 - ], - fc: 15 - }, - { - lngs: [ - 'lv' - ], - nr: [ - 1, - 2, - 0 - ], - fc: 16 - }, - { - lngs: [ - 'mk' - ], - nr: [ - 1, - 2 - ], - fc: 17 - }, - { - lngs: [ - 'mnk' - ], - nr: [ - 0, - 1, - 2 - ], - fc: 18 - }, - { - lngs: [ - 'mt' - ], - nr: [ - 1, - 2, - 11, - 20 - ], - fc: 19 - }, - { - lngs: [ - 'or' - ], - nr: [ - 2, - 1 - ], - fc: 2 - }, - { - lngs: [ - 'ro' - ], - nr: [ - 1, - 2, - 20 - ], - fc: 20 - }, - { - lngs: [ - 'sl' - ], - nr: [ - 5, - 1, - 2, - 3 - ], - fc: 21 - }, - { - lngs: [ - 'he' - ], - nr: [ - 1, - 2, - 20, - 21 - ], - fc: 22 - } - ]; - var _rulesPluralsTypes = { - 1: function _(n) { - return Number(n > 1); - }, - 2: function _(n) { - return Number(n != 1); - }, - 3: function _(n) { - return 0; - }, - 4: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 5: function _(n) { - return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); - }, - 6: function _(n) { - return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); - }, - 7: function _(n) { - return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 8: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); - }, - 9: function _(n) { - return Number(n >= 2); - }, - 10: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); - }, - 11: function _(n) { - return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); - }, - 12: function _(n) { - return Number(n % 10 != 1 || n % 100 == 11); - }, - 13: function _(n) { - return Number(n !== 0); - }, - 14: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); - }, - 15: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); - }, - 16: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); - }, - 17: function _(n) { - return Number(n == 1 || n % 10 == 1 ? 0 : 1); - }, - 18: function _(n) { - return Number(n == 0 ? 0 : n == 1 ? 1 : 2); - }, - 19: function _(n) { - return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); - }, - 20: function _(n) { - return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); - }, - 21: function _(n) { - return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); - }, - 22: function _(n) { - return Number(n === 1 ? 0 : n === 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3); - } - }; - /* eslint-enable */ - function createRules() { - var rules = { - }; - sets.forEach(function (set) { - set.lngs.forEach(function (l) { - rules[l] = { - numbers: set.nr, - plurals: _rulesPluralsTypes[set.fc] - }; - }); - }); - return rules; - } - var PluralResolver = /*#__PURE__*/ - function () { - function PluralResolver(languageUtils) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - _classCallCheck(this, PluralResolver); - this.languageUtils = languageUtils; - this.options = options; - this.logger = baseLogger.create('pluralResolver'); - this.rules = createRules(); - } - _createClass(PluralResolver, [ - { - key: 'addRule', - value: function addRule(lng, obj) { - this.rules[lng] = obj; - } - }, - { - key: 'getRule', - value: function getRule(code) { - return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)]; - } - }, - { - key: 'needsPlural', - value: function needsPlural(code) { - var rule = this.getRule(code); - return rule && rule.numbers.length > 1; - } - }, - { - key: 'getPluralFormsOfKey', - value: function getPluralFormsOfKey(code, key) { - var _this = this; - var ret = [ - ]; - var rule = this.getRule(code); - if (!rule) return ret; - rule.numbers.forEach(function (n) { - var suffix = _this.getSuffix(code, n); - ret.push(''.concat(key).concat(suffix)); - }); - return ret; - } - }, - { - key: 'getSuffix', - value: function getSuffix(code, count) { - var _this2 = this; - var rule = this.getRule(code); - if (rule) { - // if (rule.numbers.length === 1) return ''; // only singular - var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); - var suffix = rule.numbers[idx]; // special treatment for lngs only having singular and plural - if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { - if (suffix === 2) { - suffix = 'plural'; - } else if (suffix === 1) { - suffix = ''; - } - } - var returnSuffix = function returnSuffix() { - return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString(); - }; // COMPATIBILITY JSON - // v1 - if (this.options.compatibilityJSON === 'v1') { - if (suffix === 1) return ''; - if (typeof suffix === 'number') return '_plural_'.concat(suffix.toString()); - return returnSuffix(); - } else if ( /* v2 */ - this.options.compatibilityJSON === 'v2') { - return returnSuffix(); - } else if ( /* v3 - gettext index */ - this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { - return returnSuffix(); - } - return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); - } - this.logger.warn('no plural rule found for: '.concat(code)); - return ''; - } - } - ]); - return PluralResolver; - }(); - var Interpolator = /*#__PURE__*/ - function () { - function Interpolator() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - _classCallCheck(this, Interpolator); - this.logger = baseLogger.create('interpolator'); - this.options = options; - this.format = options.interpolation && options.interpolation.format || function (value) { - return value; - }; - this.init(options); - } /* eslint no-param-reassign: 0 */ - - _createClass(Interpolator, [ - { - key: 'init', - value: function init() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - if (!options.interpolation) options.interpolation = { - escapeValue: true - }; - var iOpts = options.interpolation; - this.escape = iOpts.escape !== undefined ? iOpts.escape : escape; - this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true; - this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false; - this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{'; - this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}'; - this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ','; - this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-'; - this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || ''; - this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t('); - this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')'); - this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000; // the regexp - this.resetRegExp(); - } - }, - { - key: 'reset', - value: function reset() { - if (this.options) this.init(this.options); - } - }, - { - key: 'resetRegExp', - value: function resetRegExp() { - // the regexp - var regexpStr = ''.concat(this.prefix, '(.+?)').concat(this.suffix); - this.regexp = new RegExp(regexpStr, 'g'); - var regexpUnescapeStr = ''.concat(this.prefix).concat(this.unescapePrefix, '(.+?)').concat(this.unescapeSuffix).concat(this.suffix); - this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g'); - var nestingRegexpStr = ''.concat(this.nestingPrefix, '(.+?)').concat(this.nestingSuffix); - this.nestingRegexp = new RegExp(nestingRegexpStr, 'g'); - } - }, - { - key: 'interpolate', - value: function interpolate(str, data, lng, options) { - var _this = this; - var match; - var value; - var replaces; - var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || { - }; - function regexSafe(val) { - return val.replace(/\$/g, '$$$$'); - } - var handleFormat = function handleFormat(key) { - if (key.indexOf(_this.formatSeparator) < 0) { - return getPathWithDefaults(data, defaultData, key); - } - var p = key.split(_this.formatSeparator); - var k = p.shift().trim(); - var f = p.join(_this.formatSeparator).trim(); - return _this.format(getPathWithDefaults(data, defaultData, k), f, lng); - }; - this.resetRegExp(); - var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler; - replaces = 0; // unescape if has unescapePrefix/Suffix - /* eslint no-cond-assign: 0 */ - while (match = this.regexpUnescape.exec(str)) { - value = handleFormat(match[1].trim()); - if (value === undefined) { - if (typeof missingInterpolationHandler === 'function') { - var temp = missingInterpolationHandler(str, match, options); - value = typeof temp === 'string' ? temp : ''; - } else { - this.logger.warn('missed to pass in variable '.concat(match[1], ' for interpolating ').concat(str)); - value = ''; - } - } else if (typeof value !== 'string' && !this.useRawValueToEscape) { - value = makeString(value); - } - str = str.replace(match[0], regexSafe(value)); - this.regexpUnescape.lastIndex = 0; - replaces++; - if (replaces >= this.maxReplaces) { - break; - } - } - replaces = 0; // regular escape on demand - while (match = this.regexp.exec(str)) { - value = handleFormat(match[1].trim()); - if (value === undefined) { - if (typeof missingInterpolationHandler === 'function') { - var _temp = missingInterpolationHandler(str, match, options); - value = typeof _temp === 'string' ? _temp : ''; - } else { - this.logger.warn('missed to pass in variable '.concat(match[1], ' for interpolating ').concat(str)); - value = ''; - } - } else if (typeof value !== 'string' && !this.useRawValueToEscape) { - value = makeString(value); - } - value = this.escapeValue ? regexSafe(this.escape(value)) : regexSafe(value); - str = str.replace(match[0], value); - this.regexp.lastIndex = 0; - replaces++; - if (replaces >= this.maxReplaces) { - break; - } - } - return str; - } - }, - { - key: 'nest', - value: function nest(str, fc) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - }; - var match; - var value; - var clonedOptions = _objectSpread({ - }, options); - clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup - delete clonedOptions.defaultValue; // assert we do not get a endless loop on interpolating defaultValue again and again - // if value is something like "myKey": "lorem $(anotherKey, { "count": {{aValueInOptions}} })" - function handleHasOptions(key, inheritedOptions) { - if (key.indexOf(',') < 0) return key; - var p = key.split(','); - key = p.shift(); - var optionsString = p.join(','); - optionsString = this.interpolate(optionsString, clonedOptions); - optionsString = optionsString.replace(/'/g, '"'); - try { - clonedOptions = JSON.parse(optionsString); - if (inheritedOptions) clonedOptions = _objectSpread({ - }, inheritedOptions, clonedOptions); - } catch (e) { - this.logger.error('failed parsing options string in nesting for key '.concat(key), e); - } // assert we do not get a endless loop on interpolating defaultValue again and again - - delete clonedOptions.defaultValue; - return key; - } // regular escape on demand - - while (match = this.nestingRegexp.exec(str)) { - value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions); // is only the nesting key (key1 = '$(key2)') return the value without stringify - if (value && match[0] === str && typeof value !== 'string') return value; // no string to include or empty - if (typeof value !== 'string') value = makeString(value); - if (!value) { - this.logger.warn('missed to resolve '.concat(match[1], ' for nesting ').concat(str)); - value = ''; - } // Nested keys should not be escaped by default #854 - // value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value); - - str = str.replace(match[0], value); - this.regexp.lastIndex = 0; - } - return str; - } - } - ]); - return Interpolator; - }(); - function remove(arr, what) { - var found = arr.indexOf(what); - while (found !== - 1) { - arr.splice(found, 1); - found = arr.indexOf(what); - } - } - var Connector = /*#__PURE__*/ - function (_EventEmitter) { - _inherits(Connector, _EventEmitter); - function Connector(backend, store, services) { - var _this; - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { - }; - _classCallCheck(this, Connector); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this)); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - _this.backend = backend; - _this.store = store; - _this.services = services; - _this.languageUtils = services.languageUtils; - _this.options = options; - _this.logger = baseLogger.create('backendConnector'); - _this.state = { - }; - _this.queue = [ - ]; - if (_this.backend && _this.backend.init) { - _this.backend.init(services, options.backend, options); - } - return _this; - } - _createClass(Connector, [ - { - key: 'queueLoad', - value: function queueLoad(languages, namespaces, options, callback) { - var _this2 = this; - // find what needs to be loaded - var toLoad = [ - ]; - var pending = [ - ]; - var toLoadLanguages = [ - ]; - var toLoadNamespaces = [ - ]; - languages.forEach(function (lng) { - var hasAllNamespaces = true; - namespaces.forEach(function (ns) { - var name = ''.concat(lng, '|').concat(ns); - if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) { - _this2.state[name] = 2; // loaded - } else if (_this2.state[name] < 0); - else if (_this2.state[name] === 1) { - if (pending.indexOf(name) < 0) pending.push(name); - } else { - _this2.state[name] = 1; // pending - hasAllNamespaces = false; - if (pending.indexOf(name) < 0) pending.push(name); - if (toLoad.indexOf(name) < 0) toLoad.push(name); - if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns); - } - }); - if (!hasAllNamespaces) toLoadLanguages.push(lng); - }); - if (toLoad.length || pending.length) { - this.queue.push({ - pending: pending, - loaded: { - }, - errors: [ - ], - callback: callback - }); - } - return { - toLoad: toLoad, - pending: pending, - toLoadLanguages: toLoadLanguages, - toLoadNamespaces: toLoadNamespaces - }; - } - }, - { - key: 'loaded', - value: function loaded(name, err, data) { - var _name$split = name.split('|'), - _name$split2 = _slicedToArray(_name$split, 2), - lng = _name$split2[0], - ns = _name$split2[1]; - if (err) this.emit('failedLoading', lng, ns, err); - if (data) { - this.store.addResourceBundle(lng, ns, data); - } // set loaded - - this.state[name] = err ? - 1 : 2; // consolidated loading done in this run - only emit once for a loaded namespace - var loaded = { - }; // callback if ready - this.queue.forEach(function (q) { - pushPath(q.loaded, [ - lng - ], ns); - remove(q.pending, name); - if (err) q.errors.push(err); - if (q.pending.length === 0 && !q.done) { - // only do once per loaded -> this.emit('loaded', q.loaded); - Object.keys(q.loaded).forEach(function (l) { - if (!loaded[l]) loaded[l] = [ - ]; - if (q.loaded[l].length) { - q.loaded[l].forEach(function (ns) { - if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns); - }); - } - }); - /* eslint no-param-reassign: 0 */ - q.done = true; - if (q.errors.length) { - q.callback(q.errors); - } else { - q.callback(); - } - } - }); // emit consolidated loaded event - this.emit('loaded', loaded); // remove done load requests - this.queue = this.queue.filter(function (q) { - return !q.done; - }); - } - }, - { - key: 'read', - value: function read(lng, ns, fcName) { - var _this3 = this; - var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 250; - var callback = arguments.length > 5 ? arguments[5] : undefined; - if (!lng.length) return callback(null, { - }); // noting to load - return this.backend[fcName](lng, ns, function (err, data) { - if (err && data /* = retryFlag */ && tried < 5) { - setTimeout(function () { - _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback); - }, wait); - return; - } - callback(err, data); - }); - } /* eslint consistent-return: 0 */ - - }, - { - key: 'prepareLoading', - value: function prepareLoading(languages, namespaces) { - var _this4 = this; - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - }; - var callback = arguments.length > 3 ? arguments[3] : undefined; - if (!this.backend) { - this.logger.warn('No backend was added via i18next.use. Will not load resources.'); - return callback && callback(); - } - if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages); - if (typeof namespaces === 'string') namespaces = [ - namespaces - ]; - var toLoad = this.queueLoad(languages, namespaces, options, callback); - if (!toLoad.toLoad.length) { - if (!toLoad.pending.length) callback(); // nothing to load and no pendings...callback now - return null; // pendings will trigger callback - } - toLoad.toLoad.forEach(function (name) { - _this4.loadOne(name); - }); - } - }, - { - key: 'load', - value: function load(languages, namespaces, callback) { - this.prepareLoading(languages, namespaces, { - }, callback); - } - }, - { - key: 'reload', - value: function reload(languages, namespaces, callback) { - this.prepareLoading(languages, namespaces, { - reload: true - }, callback); - } - }, - { - key: 'loadOne', - value: function loadOne(name) { - var _this5 = this; - var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var _name$split3 = name.split('|'), - _name$split4 = _slicedToArray(_name$split3, 2), - lng = _name$split4[0], - ns = _name$split4[1]; - this.read(lng, ns, 'read', null, null, function (err, data) { - if (err) _this5.logger.warn(''.concat(prefix, 'loading namespace ').concat(ns, ' for language ').concat(lng, ' failed'), err); - if (!err && data) _this5.logger.log(''.concat(prefix, 'loaded namespace ').concat(ns, ' for language ').concat(lng), data); - _this5.loaded(name, err, data); - }); - } - }, - { - key: 'saveMissing', - value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) { - var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { - }; - if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) { - this.logger.warn('did not save key "'.concat(key, '" for namespace "').concat(namespace, '" as the namespace was not yet loaded'), 'This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!'); - return; - } // ignore non valid keys - - if (key === undefined || key === null || key === '') return; - if (this.backend && this.backend.create) { - this.backend.create(languages, namespace, key, fallbackValue, null /* unused callback */ , _objectSpread({ - }, options, { - isUpdate: isUpdate - })); - } // write to store to avoid resending - - if (!languages || !languages[0]) return; - this.store.addResource(languages[0], namespace, key, fallbackValue); - } - } - ]); - return Connector; - }(EventEmitter); - function get() { - return { - debug: false, - initImmediate: true, - ns: [ - 'translation' - ], - defaultNS: [ - 'translation' - ], - fallbackLng: [ - 'dev' - ], - fallbackNS: false, - // string or array of namespaces - whitelist: false, - // array with whitelisted languages - nonExplicitWhitelist: false, - load: 'all', - // | currentOnly | languageOnly - preload: false, - // array with preload languages - simplifyPluralSuffix: true, - keySeparator: '.', - nsSeparator: ':', - pluralSeparator: '_', - contextSeparator: '_', - partialBundledLanguages: false, - // allow bundling certain languages that are not remotely fetched - saveMissing: false, - // enable to send missing values - updateMissing: false, - // enable to update default values if different from translated value (only useful on initial development, or when keeping code as source of truth) - saveMissingTo: 'fallback', - // 'current' || 'all' - saveMissingPlurals: true, - // will save all forms not only singular key - missingKeyHandler: false, - // function(lng, ns, key, fallbackValue) -> override if prefer on handling - missingInterpolationHandler: false, - // function(str, match) - postProcess: false, - // string or array of postProcessor names - postProcessPassResolved: false, - // pass resolved object into 'options.i18nResolved' for postprocessor - returnNull: true, - // allows null value as valid translation - returnEmptyString: true, - // allows empty string value as valid translation - returnObjects: false, - joinArrays: false, - // or string to join array - returnedObjectHandler: false, - // function(key, value, options) triggered if key returns object but returnObjects is set to false - parseMissingKeyHandler: false, - // function(key) parsed a key that was not found in t() before returning - appendNamespaceToMissingKey: false, - appendNamespaceToCIMode: false, - overloadTranslationOptionHandler: function handle(args) { - var ret = { - }; - if (_typeof(args[1]) === 'object') ret = args[1]; - if (typeof args[1] === 'string') ret.defaultValue = args[1]; - if (typeof args[2] === 'string') ret.tDescription = args[2]; - if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') { - var options = args[3] || args[2]; - Object.keys(options).forEach(function (key) { - ret[key] = options[key]; - }); - } - return ret; - }, - interpolation: { - escapeValue: true, - format: function format(value, _format, lng) { - return value; - }, - prefix: '{{', - suffix: '}}', - formatSeparator: ',', - // prefixEscaped: '{{', - // suffixEscaped: '}}', - // unescapeSuffix: '', - unescapePrefix: '-', - nestingPrefix: '$t(', - nestingSuffix: ')', - // nestingPrefixEscaped: '$t(', - // nestingSuffixEscaped: ')', - // defaultVariables: undefined // object that can have values to interpolate on - extends passed in interpolation data - maxReplaces: 1000 // max replaces to prevent endless loop - } - }; - } /* eslint no-param-reassign: 0 */ - - function transformOptions(options) { - // create namespace object if namespace is passed in as string - if (typeof options.ns === 'string') options.ns = [ - options.ns - ]; - if (typeof options.fallbackLng === 'string') options.fallbackLng = [ - options.fallbackLng - ]; - if (typeof options.fallbackNS === 'string') options.fallbackNS = [ - options.fallbackNS - ]; // extend whitelist with cimode - if (options.whitelist && options.whitelist.indexOf('cimode') < 0) { - options.whitelist = options.whitelist.concat(['cimode']); - } - return options; - } - function noop() { - } - var I18n = /*#__PURE__*/ - function (_EventEmitter) { - _inherits(I18n, _EventEmitter); - function I18n() { - var _this; - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - var callback = arguments.length > 1 ? arguments[1] : undefined; - _classCallCheck(this, I18n); - _this = _possibleConstructorReturn(this, _getPrototypeOf(I18n).call(this)); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - _this.options = transformOptions(options); - _this.services = { - }; - _this.logger = baseLogger; - _this.modules = { - external: [ - ] - }; - if (callback && !_this.isInitialized && !options.isClone) { - // https://github.com/i18next/i18next/issues/879 - if (!_this.options.initImmediate) { - _this.init(options, callback); - return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); - } - setTimeout(function () { - _this.init(options, callback); - }, 0); - } - return _this; - } - _createClass(I18n, [ - { - key: 'init', - value: function init() { - var _this2 = this; - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - var callback = arguments.length > 1 ? arguments[1] : undefined; - if (typeof options === 'function') { - callback = options; - options = { - }; - } - this.options = _objectSpread({ - }, get(), this.options, transformOptions(options)); - this.format = this.options.interpolation.format; - if (!callback) callback = noop; - function createClassOnDemand(ClassOrObject) { - if (!ClassOrObject) return null; - if (typeof ClassOrObject === 'function') return new ClassOrObject(); - return ClassOrObject; - } // init services - - if (!this.options.isClone) { - if (this.modules.logger) { - baseLogger.init(createClassOnDemand(this.modules.logger), this.options); - } else { - baseLogger.init(null, this.options); - } - var lu = new LanguageUtil(this.options); - this.store = new ResourceStore(this.options.resources, this.options); - var s = this.services; - s.logger = baseLogger; - s.resourceStore = this.store; - s.languageUtils = lu; - s.pluralResolver = new PluralResolver(lu, { - prepend: this.options.pluralSeparator, - compatibilityJSON: this.options.compatibilityJSON, - simplifyPluralSuffix: this.options.simplifyPluralSuffix - }); - s.interpolator = new Interpolator(this.options); - s.utils = { - hasLoadedNamespace: this.hasLoadedNamespace.bind(this) - }; - s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options); // pipe events from backendConnector - s.backendConnector.on('*', function (event) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - _this2.emit.apply(_this2, [ - event - ].concat(args)); - }); - if (this.modules.languageDetector) { - s.languageDetector = createClassOnDemand(this.modules.languageDetector); - s.languageDetector.init(s, this.options.detection, this.options); - } - if (this.modules.i18nFormat) { - s.i18nFormat = createClassOnDemand(this.modules.i18nFormat); - if (s.i18nFormat.init) s.i18nFormat.init(this); - } - this.translator = new Translator(this.services, this.options); // pipe events from translator - this.translator.on('*', function (event) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - _this2.emit.apply(_this2, [ - event - ].concat(args)); - }); - this.modules.external.forEach(function (m) { - if (m.init) m.init(_this2); - }); - } // append api - - var storeApi = [ - 'getResource', - 'addResource', - 'addResources', - 'addResourceBundle', - 'removeResourceBundle', - 'hasResourceBundle', - 'getResourceBundle', - 'getDataByLanguage' - ]; - storeApi.forEach(function (fcName) { - _this2[fcName] = function () { - var _this2$store; - return (_this2$store = _this2.store) [fcName].apply(_this2$store, arguments); - }; - }); - var deferred = defer(); - var load = function load() { - _this2.changeLanguage(_this2.options.lng, function (err, t) { - _this2.isInitialized = true; - _this2.logger.log('initialized', _this2.options); - _this2.emit('initialized', _this2.options); - deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning) - callback(err, t); - }); - }; - if (this.options.resources || !this.options.initImmediate) { - load(); - } else { - setTimeout(load, 0); - } - return deferred; - } /* eslint consistent-return: 0 */ - - }, - { - key: 'loadResources', - value: function loadResources(language) { - var _this3 = this; - var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop; - var usedCallback = callback; - var usedLng = typeof language === 'string' ? language : this.language; - if (typeof language === 'function') usedCallback = language; - if (!this.options.resources || this.options.partialBundledLanguages) { - if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback(); // avoid loading resources for cimode - var toLoad = [ - ]; - var append = function append(lng) { - if (!lng) return; - var lngs = _this3.services.languageUtils.toResolveHierarchy(lng); - lngs.forEach(function (l) { - if (toLoad.indexOf(l) < 0) toLoad.push(l); - }); - }; - if (!usedLng) { - // at least load fallbacks in this case - var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); - fallbacks.forEach(function (l) { - return append(l); - }); - } else { - append(usedLng); - } - if (this.options.preload) { - this.options.preload.forEach(function (l) { - return append(l); - }); - } - this.services.backendConnector.load(toLoad, this.options.ns, usedCallback); - } else { - usedCallback(null); - } - } - }, - { - key: 'reloadResources', - value: function reloadResources(lngs, ns, callback) { - var deferred = defer(); - if (!lngs) lngs = this.languages; - if (!ns) ns = this.options.ns; - if (!callback) callback = noop; - this.services.backendConnector.reload(lngs, ns, function (err) { - deferred.resolve(); // not rejecting on err (as err is only a loading translation failed warning) - callback(err); - }); - return deferred; - } - }, - { - key: 'use', - value: function use(module) { - if (module.type === 'backend') { - this.modules.backend = module; - } - if (module.type === 'logger' || module.log && module.warn && module.error) { - this.modules.logger = module; - } - if (module.type === 'languageDetector') { - this.modules.languageDetector = module; - } - if (module.type === 'i18nFormat') { - this.modules.i18nFormat = module; - } - if (module.type === 'postProcessor') { - postProcessor.addPostProcessor(module); - } - if (module.type === '3rdParty') { - this.modules.external.push(module); - } - return this; - } - }, - { - key: 'changeLanguage', - value: function changeLanguage(lng, callback) { - var _this4 = this; - this.isLanguageChangingTo = lng; - var deferred = defer(); - this.emit('languageChanging', lng); - var done = function done(err, l) { - if (l) { - _this4.language = l; - _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l); - _this4.translator.changeLanguage(l); - _this4.isLanguageChangingTo = undefined; - _this4.emit('languageChanged', l); - _this4.logger.log('languageChanged', l); - } else { - _this4.isLanguageChangingTo = undefined; - } - deferred.resolve(function () { - return _this4.t.apply(_this4, arguments); - }); - if (callback) callback(err, function () { - return _this4.t.apply(_this4, arguments); - }); - }; - var setLng = function setLng(l) { - if (l) { - if (!_this4.language) { - _this4.language = l; - _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l); - } - if (!_this4.translator.language) _this4.translator.changeLanguage(l); - if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l); - } - _this4.loadResources(l, function (err) { - done(err, l); - }); - }; - if (!lng && this.services.languageDetector && !this.services.languageDetector.async) { - setLng(this.services.languageDetector.detect()); - } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) { - this.services.languageDetector.detect(setLng); - } else { - setLng(lng); - } - return deferred; - } - }, - { - key: 'getFixedT', - value: function getFixedT(lng, ns) { - var _this5 = this; - var fixedT = function fixedT(key, opts) { - var options; - if (_typeof(opts) !== 'object') { - for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { - rest[_key3 - 2] = arguments[_key3]; - } - options = _this5.options.overloadTranslationOptionHandler([key, - opts].concat(rest)); - } else { - options = _objectSpread({ - }, opts); - } - options.lng = options.lng || fixedT.lng; - options.lngs = options.lngs || fixedT.lngs; - options.ns = options.ns || fixedT.ns; - return _this5.t(key, options); - }; - if (typeof lng === 'string') { - fixedT.lng = lng; - } else { - fixedT.lngs = lng; - } - fixedT.ns = ns; - return fixedT; - } - }, - { - key: 't', - value: function t() { - var _this$translator; - return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments); - } - }, - { - key: 'exists', - value: function exists() { - var _this$translator2; - return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments); - } - }, - { - key: 'setDefaultNamespace', - value: function setDefaultNamespace(ns) { - this.options.defaultNS = ns; - } - }, - { - key: 'hasLoadedNamespace', - value: function hasLoadedNamespace(ns) { - var _this6 = this; - if (!this.isInitialized) { - this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages); - return false; - } - if (!this.languages || !this.languages.length) { - this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages); - return false; - } - var lng = this.languages[0]; - var fallbackLng = this.options ? this.options.fallbackLng : false; - var lastLng = this.languages[this.languages.length - 1]; // we're in cimode so this shall pass - if (lng.toLowerCase() === 'cimode') return true; - var loadNotPending = function loadNotPending(l, n) { - var loadState = _this6.services.backendConnector.state[''.concat(l, '|').concat(n)]; - return loadState === - 1 || loadState === 2; - }; // loaded -> SUCCESS - if (this.hasResourceBundle(lng, ns)) return true; // were not loading at all -> SEMI SUCCESS - if (!this.services.backendConnector.backend) return true; // failed loading ns - but at least fallback is not pending -> SEMI SUCCESS - if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; - return false; - } - }, - { - key: 'loadNamespaces', - value: function loadNamespaces(ns, callback) { - var _this7 = this; - var deferred = defer(); - if (!this.options.ns) { - callback && callback(); - return Promise.resolve(); - } - if (typeof ns === 'string') ns = [ - ns - ]; - ns.forEach(function (n) { - if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n); - }); - this.loadResources(function (err) { - deferred.resolve(); - if (callback) callback(err); - }); - return deferred; - } - }, - { - key: 'loadLanguages', - value: function loadLanguages(lngs, callback) { - var deferred = defer(); - if (typeof lngs === 'string') lngs = [ - lngs - ]; - var preloaded = this.options.preload || [ - ]; - var newLngs = lngs.filter(function (lng) { - return preloaded.indexOf(lng) < 0; - }); // Exit early if all given languages are already preloaded - if (!newLngs.length) { - if (callback) callback(); - return Promise.resolve(); - } - this.options.preload = preloaded.concat(newLngs); - this.loadResources(function (err) { - deferred.resolve(); - if (callback) callback(err); - }); - return deferred; - } - }, - { - key: 'dir', - value: function dir(lng) { - if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language; - if (!lng) return 'rtl'; - var rtlLngs = [ - 'ar', - 'shu', - 'sqr', - 'ssh', - 'xaa', - 'yhd', - 'yud', - 'aao', - 'abh', - 'abv', - 'acm', - 'acq', - 'acw', - 'acx', - 'acy', - 'adf', - 'ads', - 'aeb', - 'aec', - 'afb', - 'ajp', - 'apc', - 'apd', - 'arb', - 'arq', - 'ars', - 'ary', - 'arz', - 'auz', - 'avl', - 'ayh', - 'ayl', - 'ayn', - 'ayp', - 'bbz', - 'pga', - 'he', - 'iw', - 'ps', - 'pbt', - 'pbu', - 'pst', - 'prp', - 'prd', - 'ur', - 'ydd', - 'yds', - 'yih', - 'ji', - 'yi', - 'hbo', - 'men', - 'xmn', - 'fa', - 'jpr', - 'peo', - 'pes', - 'prs', - 'dv', - 'sam' - ]; - return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) >= 0 ? 'rtl' : 'ltr'; - } /* eslint class-methods-use-this: 0 */ - - }, - { - key: 'createInstance', - value: function createInstance() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - var callback = arguments.length > 1 ? arguments[1] : undefined; - return new I18n(options, callback); - } - }, - { - key: 'cloneInstance', - value: function cloneInstance() { - var _this8 = this; - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop; - var mergedOptions = _objectSpread({ - }, this.options, options, { - isClone: true - }); - var clone = new I18n(mergedOptions); - var membersToCopy = [ - 'store', - 'services', - 'language' - ]; - membersToCopy.forEach(function (m) { - clone[m] = _this8[m]; - }); - clone.translator = new Translator(clone.services, clone.options); - clone.translator.on('*', function (event) { - for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { - args[_key4 - 1] = arguments[_key4]; - } - clone.emit.apply(clone, [ - event - ].concat(args)); - }); - clone.init(mergedOptions, callback); - clone.translator.options = clone.options; // sync options - return clone; - } - } - ]); - return I18n; - }(EventEmitter); - var i18next = new I18n(); - module.exports = i18next; - }, - { - '@babel/runtime/helpers/assertThisInitialized': 4, - '@babel/runtime/helpers/classCallCheck': 5, - '@babel/runtime/helpers/createClass': 6, - '@babel/runtime/helpers/getPrototypeOf': 8, - '@babel/runtime/helpers/inherits': 9, - '@babel/runtime/helpers/objectSpread': 14, - '@babel/runtime/helpers/possibleConstructorReturn': 15, - '@babel/runtime/helpers/slicedToArray': 17, - '@babel/runtime/helpers/toConsumableArray': 18, - '@babel/runtime/helpers/typeof': 19 - } - ], - 268: [ - function (_dereq_, module, exports) { - exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, - m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = - 7; - var i = isLE ? nBytes - 1 : 0; - var d = isLE ? - 1 : 1; - var s = buffer[offset + i]; - i += d; - e = s & (1 << - nBits) - 1; - s >>= - nBits; - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { - } - m = e & (1 << - nBits) - 1; - e >>= - nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { - } - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : (s ? - 1 : 1) * Infinity; - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? - 1 : 1) * m * Math.pow(2, e - mLen); - }; - exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, - m, - c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? Math.pow(2, - 24) - Math.pow(2, - 77) : 0; - var i = isLE ? 0 : nBytes - 1; - var d = isLE ? 1 : - 1; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - value = Math.abs(value); - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, - e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { - } - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { - } - buffer[offset + i - d] |= s * 128; - }; - }, - { - } - ], - 269: [ - function (_dereq_, module, exports) { - /* - - Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. - Copyright 2015, Google Inc. All Rights Reserved. - - 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 including the dates of first publication and - either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ - 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 - SILICON GRAPHICS, INC. 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. - - Original Code. The Original Code is: OpenGL Sample Implementation, - Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, - Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. - Copyright in any portions created by third parties is as indicated - elsewhere herein. All Rights Reserved. -*/ - 'use strict'; - var n; - function t(a, b) { - return a.b === b.b && a.a === b.a; - } - function u(a, b) { - return a.b < b.b || a.b === b.b && a.a <= b.a; - } - function v(a, b, c) { - var d = b.b - a.b, - e = c.b - b.b; - return 0 < d + e ? d < e ? b.a - a.a + d / (d + e) * (a.a - c.a) : b.a - c.a + e / (d + e) * (c.a - a.a) : 0; - } - function x(a, b, c) { - var d = b.b - a.b, - e = c.b - b.b; - return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0; - } - function z(a, b) { - return a.a < b.a || a.a === b.a && a.b <= b.b; - } - function aa(a, b, c) { - var d = b.a - a.a, - e = c.a - b.a; - return 0 < d + e ? d < e ? b.b - a.b + d / (d + e) * (a.b - c.b) : b.b - c.b + e / (d + e) * (c.b - a.b) : 0; - } - function ba(a, b, c) { - var d = b.a - a.a, - e = c.a - b.a; - return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0; - } - function ca(a) { - return u(a.b.a, a.a); - } - function da(a) { - return u(a.a, a.b.a); - } - function A(a, b, c, d) { - a = 0 > a ? 0 : a; - c = 0 > c ? 0 : c; - return a <= c ? 0 === c ? (b + d) / 2 : b + a / (a + c) * (d - b) : d + c / (a + c) * (b - d); - } - ; - function ea(a) { - var b = B(a.b); - C(b, a.c); - C(b.b, a.c); - D(b, a.a); - return b; - } - function E(a, b) { - var c = !1, - d = !1; - a !== b && (b.a !== a.a && (d = !0, F(b.a, a.a)), b.d !== a.d && (c = !0, G(b.d, a.d)), H(b, a), d || (C(b, a.a), a.a.c = a), c || (D(b, a.d), a.d.a = a)); - } - function I(a) { - var b = a.b, - c = !1; - a.d !== a.b.d && (c = !0, G(a.d, a.b.d)); - a.c === a ? F(a.a, null) : (a.b.d.a = J(a), a.a.c = a.c, H(a, J(a)), c || D(a, a.d)); - b.c === b ? (F(b.a, null), G(b.d, null)) : (a.d.a = J(b), b.a.c = b.c, H(b, J(b))); - fa(a); - } - function K(a) { - var b = B(a), - c = b.b; - H(b, a.e); - b.a = a.b.a; - C(c, b.a); - b.d = c.d = a.d; - b = b.b; - H(a.b, J(a.b)); - H(a.b, b); - a.b.a = b.a; - b.b.a.c = b.b; - b.b.d = a.b.d; - b.f = a.f; - b.b.f = a.b.f; - return b; - } - function L(a, b) { - var c = !1, - d = B(a), - e = d.b; - b.d !== a.d && (c = !0, G(b.d, a.d)); - H(d, a.e); - H(e, b); - d.a = a.b.a; - e.a = b.a; - d.d = e.d = a.d; - a.d.a = e; - c || D(d, a.d); - return d; - } - function B(a) { - var b = new M(), - c = new M(), - d = a.b.h; - c.h = d; - d.b.h = b; - b.h = a; - a.b.h = c; - b.b = c; - b.c = b; - b.e = c; - c.b = b; - c.c = c; - return c.e = b; - } - function H(a, b) { - var c = a.c, - d = b.c; - c.b.e = b; - d.b.e = a; - a.c = d; - b.c = c; - } - function C(a, b) { - var c = b.f, - d = new N(b, c); - c.e = d; - b.f = d; - c = d.c = a; - do c.a = d, - c = c.c; - while (c !== a); - } - function D(a, b) { - var c = b.d, - d = new ga(b, c); - c.b = d; - b.d = d; - d.a = a; - d.c = b.c; - c = a; - do c.d = d, - c = c.e; - while (c !== a); - } - function fa(a) { - var b = a.h; - a = a.b.h; - b.b.h = a; - a.b.h = b; - } - function F(a, b) { - var c = a.c, - d = c; - do d.a = b, - d = d.c; - while (d !== c); - c = a.f; - d = a.e; - d.f = c; - c.e = d; - } - function G(a, b) { - var c = a.a, - d = c; - do d.d = b, - d = d.e; - while (d !== c); - c = a.d; - d = a.b; - d.d = c; - c.b = d; - } - ; - function ha(a) { - var b = 0; - Math.abs(a[1]) > Math.abs(a[0]) && (b = 1); - Math.abs(a[2]) > Math.abs(a[b]) && (b = 2); - return b; - } - ; - var O = 4 * 1e+150; - function P(a, b) { - a.f += b.f; - a.b.f += b.b.f; - } - function ia(a, b, c) { - a = a.a; - b = b.a; - c = c.a; - if (b.b.a === a) return c.b.a === a ? u(b.a, c.a) ? 0 >= x(c.b.a, b.a, c.a) : 0 <= x(b.b.a, c.a, b.a) : 0 >= x(c.b.a, a, c.a); - if (c.b.a === a) return 0 <= x(b.b.a, a, b.a); - b = v(b.b.a, a, b.a); - a = v(c.b.a, a, c.a); - return b >= a; - } - function Q(a) { - a.a.i = null; - var b = a.e; - b.a.c = b.c; - b.c.a = b.a; - a.e = null; - } - function ja(a, b) { - I(a.a); - a.c = !1; - a.a = b; - b.i = a; - } - function ka(a) { - var b = a.a.a; - do a = R(a); - while (a.a.a === b); - a.c && (b = L(S(a).a.b, a.a.e), ja(a, b), a = R(a)); - return a; - } - function la(a, b, c) { - var d = new ma(); - d.a = c; - d.e = na(a.f, b.e, d); - return c.i = d; - } - function oa(a, b) { - switch (a.s) { - case 100130: - return 0 !== (b & 1); - case 100131: - return 0 !== b; - case 100132: - return 0 < b; - case 100133: - return 0 > b; - case 100134: - return 2 <= b || - 2 >= b; - } - return !1; - } - function pa(a) { - var b = a.a, - c = b.d; - c.c = a.d; - c.a = b; - Q(a); - } - function T(a, b, c) { - a = b; - for (b = b.a; a !== c; ) { - a.c = !1; - var d = S(a), - e = d.a; - if (e.a !== b.a) { - if (!d.c) { - pa(a); - break; - } - e = L(b.c.b, e.b); - ja(d, e); - } - b.c !== e && (E(J(e), e), E(b, e)); - pa(a); - b = d.a; - a = d; - } - return b; - } - function U(a, b, c, d, e, f) { - var g = !0; - do la(a, b, c.b), - c = c.c; - while (c !== d); - for (null === e && (e = S(b).a.b.c); ; ) { - d = S(b); - c = d.a.b; - if (c.a !== e.a) break; - c.c !== e && (E(J(c), c), E(J(e), c)); - d.f = b.f - c.f; - d.d = oa(a, d.f); - b.b = !0; - !g && qa(a, b) && (P(c, e), Q(b), I(e)); - g = !1; - b = d; - e = c; - } - b.b = !0; - f && ra(a, b); - } - function sa(a, b, c, d, e) { - var f = [ - b.g[0], - b.g[1], - b.g[2] - ]; - b.d = null; - b.d = a.o ? a.o(f, c, d, a.c) || null : null; - null === b.d && (e ? a.n || (V(a, 100156), a.n = !0) : b.d = c[0]); - } - function ta(a, b, c) { - var d = [ - null, - null, - null, - null - ]; - d[0] = b.a.d; - d[1] = c.a.d; - sa(a, b.a, d, [ - 0.5, - 0.5, - 0, - 0 - ], !1); - E(b, c); - } - function ua(a, b, c, d, e) { - var f = Math.abs(b.b - a.b) + Math.abs(b.a - a.a), - g = Math.abs(c.b - a.b) + Math.abs(c.a - a.a), - h = e + 1; - d[e] = 0.5 * g / (f + g); - d[h] = 0.5 * f / (f + g); - a.g[0] += d[e] * b.g[0] + d[h] * c.g[0]; - a.g[1] += d[e] * b.g[1] + d[h] * c.g[1]; - a.g[2] += d[e] * b.g[2] + d[h] * c.g[2]; - } - function qa(a, b) { - var c = S(b), - d = b.a, - e = c.a; - if (u(d.a, e.a)) { - if (0 < x(e.b.a, d.a, e.a)) return !1; - if (!t(d.a, e.a)) K(e.b), - E(d, J(e)), - b.b = c.b = !0; - else if (d.a !== e.a) { - var c = a.e, - f = d.a.h; - if (0 <= f) { - var c = c.b, - g = c.d, - h = c.e, - k = c.c, - l = k[f]; - g[l] = g[c.a]; - k[g[l]] = l; - l <= --c.a && (1 >= l ? W(c, l) : u(h[g[l >> 1]], h[g[l]]) ? W(c, l) : va(c, l)); - h[f] = null; - k[f] = c.b; - c.b = f; - } else for (c.c[ - (f + 1)] = null; 0 < c.a && null === c.c[c.d[c.a - 1]]; ) --c.a; - ta(a, J(e), d); - } - } else { - if (0 > x(d.b.a, e.a, d.a)) return !1; - R(b).b = b.b = !0; - K(d.b); - E(J(e), d); - } - return !0; - } - function wa(a, b) { - var c = S(b), - d = b.a, - e = c.a, - f = d.a, - g = e.a, - h = d.b.a, - k = e.b.a, - l = new N(); - x(h, a.a, f); - x(k, a.a, g); - if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1; - if (u(f, g)) { - if (0 < x(k, f, g)) return !1; - } else if (0 > x(h, g, f)) return !1; - var r = h, - p = f, - q = k, - y = g, - m, - w; - u(r, p) || (m = r, r = p, p = m); - u(q, y) || (m = q, q = y, y = m); - u(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m); - u(q, p) ? u(p, y) ? (m = v(r, q, p), w = v(q, p, y), 0 > m + w && (m = - m, w = - w), l.b = A(m, q.b, w, p.b)) : (m = x(r, q, p), w = - x(r, y, p), 0 > m + w && (m = - m, w = - w), l.b = A(m, q.b, w, y.b)) : l.b = (q.b + p.b) / 2; - z(r, p) || (m = r, r = p, p = m); - z(q, y) || (m = q, q = y, y = m); - z(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m); - z(q, p) ? z(p, y) ? (m = aa(r, q, p), w = aa(q, p, y), 0 > m + w && (m = - m, w = - w), l.a = A(m, q.a, w, p.a)) : (m = ba(r, q, p), w = - ba(r, y, p), 0 > m + w && (m = - m, w = - w), l.a = A(m, q.a, w, y.a)) : l.a = (q.a + p.a) / 2; - u(l, a.a) && (l.b = a.a.b, l.a = a.a.a); - r = u(f, g) ? f : g; - u(r, l) && (l.b = r.b, l.a = r.a); - if (t(l, f) || t(l, g)) return qa(a, b), - !1; - if (!t(h, a.a) && 0 <= x(h, a.a, l) || !t(k, a.a) && 0 >= x(k, a.a, l)) { - if (k === a.a) return K(d.b), - E(e.b, d), - b = ka(b), - d = S(b).a, - T(a, S(b), c), - U(a, b, J(d), d, d, !0), - !0; - if (h === a.a) { - K(e.b); - E(d.e, J(e)); - f = c = b; - g = f.a.b.a; - do f = R(f); - while (f.a.b.a === g); - b = f; - f = S(b).a.b.c; - c.a = J(e); - e = T(a, c, null); - U(a, b, e.c, d.b.c, f, !0); - return !0; - } - 0 <= x(h, a.a, l) && (R(b).b = b.b = !0, K(d.b), d.a.b = a.a.b, d.a.a = a.a.a); - 0 >= x(k, a.a, l) && (b.b = c.b = !0, K(e.b), e.a.b = a.a.b, e.a.a = a.a.a); - return !1; - } - K(d.b); - K(e.b); - E(J(e), d); - d.a.b = l.b; - d.a.a = l.a; - d.a.h = xa(a.e, d.a); - d = d.a; - e = [ - 0, - 0, - 0, - 0 - ]; - l = [ - f.d, - h.d, - g.d, - k.d - ]; - d.g[0] = d.g[1] = d.g[2] = 0; - ua(d, f, h, e, 0); - ua(d, g, k, e, 2); - sa(a, d, l, e, !0); - R(b).b = b.b = c.b = !0; - return !1; - } - function ra(a, b) { - for (var c = S(b); ; ) { - for (; c.b; ) b = c, - c = S(c); - if (!b.b && (c = b, b = R(b), null === b || !b.b)) break; - b.b = !1; - var d = b.a, - e = c.a, - f; - if (f = d.b.a !== e.b.a) a: { - f = b; - var g = S(f), - h = f.a, - k = g.a, - l = void 0; - if (u(h.b.a, k.b.a)) { - if (0 > x(h.b.a, k.b.a, h.a)) { - f = !1; - break a; - } - R(f).b = f.b = !0; - l = K(h); - E(k.b, l); - l.d.c = f.d; - } else { - if (0 < x(k.b.a, h.b.a, k.a)) { - f = !1; - break a; - } - f.b = g.b = !0; - l = K(k); - E(h.e, k.b); - l.b.d.c = f.d; - } - f = !0; - } - f && (c.c ? (Q(c), I(e), c = S(b), e = c.a) : b.c && (Q(b), I(d), b = R(c), d = b.a)); - if (d.a !== e.a) if (d.b.a === e.b.a || b.c || c.c || d.b.a !== a.a && e.b.a !== a.a) qa(a, b); - else if (wa(a, b)) break; - d.a === e.a && d.b.a === e.b.a && (P(e, d), Q(b), I(d), b = R(c)); - } - } - function ya(a, b) { - a.a = b; - for (var c = b.c; null === c.i; ) if (c = c.c, c === b.c) { - var c = a, - d = b, - e = new ma(); - e.a = d.c.b; - var f = c.f, - g = f.a; - do g = g.a; - while (null !== g.b && !f.c(f.b, e, g.b)); - var f = g.b, - h = S(f), - e = f.a, - g = h.a; - if (0 === x(e.b.a, d, e.a)) e = f.a, - t(e.a, d) || t(e.b.a, d) || (K(e.b), f.c && (I(e.c), f.c = !1), E(d.c, e), ya(c, d)); - else { - var k = u(g.b.a, e.b.a) ? f : h, - h = void 0; - f.d || k.c ? (k === f ? h = L(d.c.b, e.e) : h = L(g.b.c.b, d.c).b, k.c ? ja(k, h) : (e = c, f = la(c, f, h), f.f = R(f).f + f.a.f, f.d = oa(e, f.f)), ya(c, d)) : U(c, f, d.c, d.c, null, !0); - } - return; - } - c = ka(c.i); - e = S(c); - f = e.a; - e = T(a, e, null); - if (e.c === f) { - var f = e, - e = f.c, - g = S(c), - h = c.a, - k = g.a, - l = !1; - h.b.a !== k.b.a && wa(a, c); - t(h.a, a.a) && (E(J(e), h), c = ka(c), e = S(c).a, T(a, S(c), g), l = !0); - t(k.a, a.a) && (E(f, J(k)), f = T(a, g, null), l = !0); - l ? U(a, c, f.c, e, e, !0) : (u(k.a, h.a) ? d = J(k) : d = h, d = L(f.c.b, d), U(a, c, d, d.c, d.c, !1), d.b.i.c = !0, ra(a, c)); - } else U(a, c, e.c, f, f, !0); - } - function za(a, b) { - var c = new ma(), - d = ea(a.b); - d.a.b = O; - d.a.a = b; - d.b.a.b = - O; - d.b.a.a = b; - a.a = d.b.a; - c.a = d; - c.f = 0; - c.d = !1; - c.c = !1; - c.h = !0; - c.b = !1; - d = a.f; - d = na(d, d.a, c); - c.e = d; - } - ; - function Aa(a) { - this.a = new Ba(); - this.b = a; - this.c = ia; - } - function na(a, b, c) { - do b = b.c; - while (null !== b.b && !a.c(a.b, b.b, c)); - a = new Ba(c, b.a, b); - b.a.c = a; - return b.a = a; - } - ; - function Ba(a, b, c) { - this.b = a || null; - this.a = b || this; - this.c = c || this; - } - ; - function X() { - this.d = Y; - this.p = this.b = this.q = null; - this.j = [ - 0, - 0, - 0 - ]; - this.s = 100130; - this.n = !1; - this.o = this.a = this.e = this.f = null; - this.m = !1; - this.c = this.r = this.i = this.k = this.l = this.h = null; - } - var Y = 0; - n = X.prototype; - n.x = function () { - Z(this, Y); - }; - n.B = function (a, b) { - switch (a) { - case 100142: - return; - case 100140: - switch (b) { - case 100130: - case 100131: - case 100132: - case 100133: - case 100134: - this.s = b; - return; - } - break; - case 100141: - this.m = !!b; - return; - default: - V(this, 100900); - return; - } - V(this, 100901); - }; - n.y = function (a) { - switch (a) { - case 100142: - return 0; - case 100140: - return this.s; - case 100141: - return this.m; - default: - V(this, 100900); - } - return !1; - }; - n.A = function (a, b, c) { - this.j[0] = a; - this.j[1] = b; - this.j[2] = c; - }; - n.z = function (a, b) { - var c = b ? b : null; - switch (a) { - case 100100: - case 100106: - this.h = c; - break; - case 100104: - case 100110: - this.l = c; - break; - case 100101: - case 100107: - this.k = c; - break; - case 100102: - case 100108: - this.i = c; - break; - case 100103: - case 100109: - this.p = c; - break; - case 100105: - case 100111: - this.o = c; - break; - case 100112: - this.r = c; - break; - default: - V(this, 100900); - } - }; - n.C = function (a, b) { - var c = !1, - d = [ - 0, - 0, - 0 - ]; - Z(this, 2); - for (var e = 0; 3 > e; ++e) { - var f = a[e]; - - 1e+150 > f && (f = - 1e+150, c = !0); - 1e+150 < f && (f = 1e+150, c = !0); - d[e] = f; - } - c && V(this, 100155); - c = this.q; - null === c ? (c = ea(this.b), E(c, c.b)) : (K(c), c = c.e); - c.a.d = b; - c.a.g[0] = d[0]; - c.a.g[1] = d[1]; - c.a.g[2] = d[2]; - c.f = 1; - c.b.f = - 1; - this.q = c; - }; - n.u = function (a) { - Z(this, Y); - this.d = 1; - this.b = new Ca(); - this.c = a; - }; - n.t = function () { - Z(this, 1); - this.d = 2; - this.q = null; - }; - n.v = function () { - Z(this, 2); - this.d = 1; - }; - n.w = function () { - Z(this, 1); - this.d = Y; - var a = this.j[0], - b = this.j[1], - c = this.j[2], - d = !1, - e = [ - a, - b, - c - ]; - if (0 === a && 0 === b && 0 === c) { - for (var b = [ - - 2 * 1e+150, - - 2 * 1e+150, - - 2 * 1e+150 - ], f = [ - 2 * 1e+150, - 2 * 1e+150, - 2 * 1e+150 - ], c = [ - ], g = [ - ], d = this.b.c, a = d.e; a !== d; a = a.e) for (var h = 0; 3 > h; ++h) { - var k = a.g[h]; - k < f[h] && (f[h] = k, g[h] = a); - k > b[h] && (b[h] = k, c[h] = a); - } - a = 0; - b[1] - f[1] > b[0] - f[0] && (a = 1); - b[2] - f[2] > b[a] - f[a] && (a = 2); - if (f[a] >= b[a]) e[0] = 0, - e[1] = 0, - e[2] = 1; - else { - b = 0; - f = g[a]; - c = c[a]; - g = [ - 0, - 0, - 0 - ]; - f = [ - f.g[0] - c.g[0], - f.g[1] - c.g[1], - f.g[2] - c.g[2] - ]; - h = [ - 0, - 0, - 0 - ]; - for (a = d.e; a !== d; a = a.e) h[0] = a.g[0] - c.g[0], - h[1] = a.g[1] - c.g[1], - h[2] = a.g[2] - c.g[2], - g[0] = f[1] * h[2] - f[2] * h[1], - g[1] = f[2] * h[0] - f[0] * h[2], - g[2] = f[0] * h[1] - f[1] * h[0], - k = g[0] * g[0] + g[1] * g[1] + g[2] * g[2], - k > b && (b = k, e[0] = g[0], e[1] = g[1], e[2] = g[2]); - 0 >= b && (e[0] = e[1] = e[2] = 0, e[ha(f)] = 1); - } - d = !0; - } - g = ha(e); - a = this.b.c; - b = (g + 1) % 3; - c = (g + 2) % 3; - g = 0 < e[g] ? 1 : - 1; - for (e = a.e; e !== a; e = e.e) e.b = e.g[b], - e.a = g * e.g[c]; - if (d) { - e = 0; - d = this.b.a; - for (a = d.b; a !== d; a = a.b) if (b = a.a, !(0 >= b.f)) { - do e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a), - b = b.e; - while (b !== a.a); - } - if (0 > e) for (e = this.b.c, d = e.e; d !== e; d = d.e) d.a = - d.a; - } - this.n = !1; - e = this.b.b; - for (a = e.h; a !== e; a = d) if (d = a.h, b = a.e, t(a.a, a.b.a) && a.e.e !== a && (ta(this, b, a), I(a), a = b, b = a.e), b.e === a) { - if (b !== a) { - if (b === d || b === d.b) d = d.h; - I(b); - } - if (a === d || a === d.b) d = d.h; - I(a); - } - this.e = e = new Da(); - d = this.b.c; - for (a = d.e; a !== d; a = a.e) a.h = xa(e, a); - Ea(e); - this.f = new Aa(this); - za(this, - O); - for (za(this, O); null !== (e = Fa(this.e)); ) { - for (; ; ) { - a: if (a = this.e, 0 === a.a) d = Ga(a.b); - else if (d = a.c[a.d[a.a - 1]], 0 !== a.b.a && (a = Ga(a.b), u(a, d))) { - d = a; - break a; - } - if (null === d || !t(d, e)) break; - d = Fa(this.e); - ta(this, e.c, d.c); - } - ya(this, e); - } - this.a = this.f.a.a.b.a.a; - for (e = 0; null !== (d = this.f.a.a.b); ) d.h || ++e, - Q(d); - this.f = null; - e = this.e; - e.b = null; - e.d = null; - this.e = e.c = null; - e = this.b; - for (a = e.a.b; a !== e.a; a = d) d = a.b, - a = a.a, - a.e.e === a && (P(a.c, a), I(a)); - if (!this.n) { - e = this.b; - if (this.m) for (a = e.b.h; a !== e.b; a = d) d = a.h, - a.b.d.c !== a.d.c ? a.f = a.d.c ? 1 : - 1 : I(a); - else for (a = e.a.b; a !== e.a; a = d) if (d = a.b, a.c) { - for (a = a.a; u(a.b.a, a.a); a = a.c.b); - for (; u(a.a, a.b.a); a = a.e); - b = a.c.b; - for (c = void 0; a.e !== b; ) if (u(a.b.a, b.a)) { - for (; b.e !== a && (ca(b.e) || 0 >= x(b.a, b.b.a, b.e.b.a)); ) c = L(b.e, b), - b = c.b; - b = b.c.b; - } else { - for (; b.e !== a && (da(a.c.b) || 0 <= x(a.b.a, a.a, a.c.b.a)); ) c = L(a, a.c.b), - a = c.b; - a = a.e; - } - for (; b.e.e !== a; ) c = L(b.e, b), - b = c.b; - } - if (this.h || this.i || this.k || this.l) if (this.m) for (e = this.b, d = e.a.b; d !== e.a; d = d.b) { - if (d.c) { - this.h && this.h(2, this.c); - a = d.a; - do this.k && this.k(a.a.d, this.c), - a = a.e; - while (a !== d.a); - this.i && this.i(this.c); - } - } else { - e = this.b; - d = !!this.l; - a = !1; - b = - 1; - for (c = e.a.d; c !== e.a; c = c.d) if (c.c) { - a || (this.h && this.h(4, this.c), a = !0); - g = c.a; - do d && (f = g.b.d.c ? 0 : 1, b !== f && (b = f, this.l && this.l(!!b, this.c))), - this.k && this.k(g.a.d, this.c), - g = g.e; - while (g !== c.a); - } - a && this.i && this.i(this.c); - } - if (this.r) { - e = this.b; - for (a = e.a.b; a !== e.a; a = d) if (d = a.b, !a.c) { - b = a.a; - c = b.e; - g = void 0; - do g = c, - c = g.e, - g.d = null, - null === g.b.d && (g.c === g ? F(g.a, null) : (g.a.c = g.c, H(g, J(g))), f = g.b, f.c === f ? F(f.a, null) : (f.a.c = f.c, H(f, J(f))), fa(g)); - while (g !== b); - b = a.d; - a = a.b; - a.d = b; - b.b = a; - } - this.r(this.b); - this.c = this.b = null; - return; - } - } - this.b = this.c = null; - }; - function Z(a, b) { - if (a.d !== b) for (; a.d !== b; ) if (a.d < b) switch (a.d) { - case Y: - V(a, 100151); - a.u(null); - break; - case 1: - V(a, 100152), - a.t(); - } else switch (a.d) { - case 2: - V(a, 100154); - a.v(); - break; - case 1: - V(a, 100153), - a.w(); - } - } - function V(a, b) { - a.p && a.p(b, a.c); - } - ; - function ga(a, b) { - this.b = a || this; - this.d = b || this; - this.a = null; - this.c = !1; - } - ; - function M() { - this.h = this; - this.i = this.d = this.a = this.e = this.c = this.b = null; - this.f = 0; - } - function J(a) { - return a.b.e; - } - ; - function Ca() { - this.c = new N(); - this.a = new ga(); - this.b = new M(); - this.d = new M(); - this.b.b = this.d; - this.d.b = this.b; - } - ; - function N(a, b) { - this.e = a || this; - this.f = b || this; - this.d = this.c = null; - this.g = [ - 0, - 0, - 0 - ]; - this.h = this.a = this.b = 0; - } - ; - function Da() { - this.c = [ - ]; - this.d = null; - this.a = 0; - this.e = !1; - this.b = new Ha(); - } - function Ea(a) { - a.d = [ - ]; - for (var b = 0; b < a.a; b++) a.d[b] = b; - a.d.sort(function (a) { - return function (b, e) { - return u(a[b], a[e]) ? 1 : - 1; - }; - }(a.c)); - a.e = !0; - Ia(a.b); - } - function xa(a, b) { - if (a.e) { - var c = a.b, - d = ++c.a; - 2 * d > c.f && (c.f *= 2, c.c = Ja(c.c, c.f + 1)); - var e; - 0 === c.b ? e = d : (e = c.b, c.b = c.c[c.b]); - c.e[e] = b; - c.c[e] = d; - c.d[d] = e; - c.h && va(c, d); - return e; - } - c = a.a++; - a.c[c] = b; - return - (c + 1); - } - function Fa(a) { - if (0 === a.a) return Ka(a.b); - var b = a.c[a.d[a.a - 1]]; - if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b); - do --a.a; - while (0 < a.a && null === a.c[a.d[a.a - 1]]); - return b; - } - ; - function Ha() { - this.d = Ja([0], 33); - this.e = [ - null, - null - ]; - this.c = [ - 0, - 0 - ]; - this.a = 0; - this.f = 32; - this.b = 0; - this.h = !1; - this.d[1] = 1; - } - function Ja(a, b) { - for (var c = Array(b), d = 0; d < a.length; d++) c[d] = a[d]; - for (; d < b; d++) c[d] = 0; - return c; - } - function Ia(a) { - for (var b = a.a; 1 <= b; --b) W(a, b); - a.h = !0; - } - function Ga(a) { - return a.e[a.d[1]]; - } - function Ka(a) { - var b = a.d, - c = a.e, - d = a.c, - e = b[1], - f = c[e]; - 0 < a.a && (b[1] = b[a.a], d[b[1]] = 1, c[e] = null, d[e] = a.b, a.b = e, 0 < --a.a && W(a, 1)); - return f; - } - function W(a, b) { - for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { - var h = f << 1; - h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1); - var k = c[h]; - if (h > a.a || u(d[g], d[k])) { - c[f] = g; - e[g] = f; - break; - } - c[f] = k; - e[k] = f; - f = h; - } - } - function va(a, b) { - for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { - var h = f >> 1, - k = c[h]; - if (0 === h || u(d[k], d[g])) { - c[f] = g; - e[g] = f; - break; - } - c[f] = k; - e[k] = f; - f = h; - } - } - ; - function ma() { - this.e = this.a = null; - this.f = 0; - this.c = this.b = this.h = this.d = !1; - } - function S(a) { - return a.e.c.b; - } - function R(a) { - return a.e.a.b; - } - ; - this.libtess = { - GluTesselator: X, - windingRule: { - GLU_TESS_WINDING_ODD: 100130, - GLU_TESS_WINDING_NONZERO: 100131, - GLU_TESS_WINDING_POSITIVE: 100132, - GLU_TESS_WINDING_NEGATIVE: 100133, - GLU_TESS_WINDING_ABS_GEQ_TWO: 100134 - }, - primitiveType: { - GL_LINE_LOOP: 2, - GL_TRIANGLES: 4, - GL_TRIANGLE_STRIP: 5, - GL_TRIANGLE_FAN: 6 - }, - errorType: { - GLU_TESS_MISSING_BEGIN_POLYGON: 100151, - GLU_TESS_MISSING_END_POLYGON: 100153, - GLU_TESS_MISSING_BEGIN_CONTOUR: 100152, - GLU_TESS_MISSING_END_CONTOUR: 100154, - GLU_TESS_COORD_TOO_LARGE: 100155, - GLU_TESS_NEED_COMBINE_CALLBACK: 100156 - }, - gluEnum: { - GLU_TESS_MESH: 100112, - GLU_TESS_TOLERANCE: 100142, - GLU_TESS_WINDING_RULE: 100140, - GLU_TESS_BOUNDARY_ONLY: 100141, - GLU_INVALID_ENUM: 100900, - GLU_INVALID_VALUE: 100901, - GLU_TESS_BEGIN: 100100, - GLU_TESS_VERTEX: 100101, - GLU_TESS_END: 100102, - GLU_TESS_ERROR: 100103, - GLU_TESS_EDGE_FLAG: 100104, - GLU_TESS_COMBINE: 100105, - GLU_TESS_BEGIN_DATA: 100106, - GLU_TESS_VERTEX_DATA: 100107, - GLU_TESS_END_DATA: 100108, - GLU_TESS_ERROR_DATA: 100109, - GLU_TESS_EDGE_FLAG_DATA: 100110, - GLU_TESS_COMBINE_DATA: 100111 - } - }; - X.prototype.gluDeleteTess = X.prototype.x; - X.prototype.gluTessProperty = X.prototype.B; - X.prototype.gluGetTessProperty = X.prototype.y; - X.prototype.gluTessNormal = X.prototype.A; - X.prototype.gluTessCallback = X.prototype.z; - X.prototype.gluTessVertex = X.prototype.C; - X.prototype.gluTessBeginPolygon = X.prototype.u; - X.prototype.gluTessBeginContour = X.prototype.t; - X.prototype.gluTessEndContour = X.prototype.v; - X.prototype.gluTessEndPolygon = X.prototype.w; - if (typeof module !== 'undefined') { - module.exports = this.libtess; - } - }, - { - } - ], - 270: [ - function (_dereq_, module, exports) { - // (c) Dean McNamee , 2013. - // - // https://github.com/deanm/omggif - // - // 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. - // - // omggif is a JavaScript implementation of a GIF 89a encoder and decoder, - // including animation and compression. It does not rely on any specific - // underlying system, so should run in the browser, Node, or Plask. - 'use strict'; - function GifWriter(buf, width, height, gopts) { - var p = 0; - var gopts = gopts === undefined ? { - } - : gopts; - var loop_count = gopts.loop === undefined ? null : gopts.loop; - var global_palette = gopts.palette === undefined ? null : gopts.palette; - if (width <= 0 || height <= 0 || width > 65535 || height > 65535) throw new Error('Width/Height invalid.'); - function check_palette_and_num_colors(palette) { - var num_colors = palette.length; - if (num_colors < 2 || num_colors > 256 || num_colors & num_colors - 1) { - throw new Error('Invalid code/color length, must be power of 2 and 2 .. 256.'); - } - return num_colors; - } // - Header. - - buf[p++] = 71; - buf[p++] = 73; - buf[p++] = 70; // GIF - buf[p++] = 56; - buf[p++] = 57; - buf[p++] = 97; // 89a - // Handling of Global Color Table (palette) and background index. - var gp_num_colors_pow2 = 0; - var background = 0; - if (global_palette !== null) { - var gp_num_colors = check_palette_and_num_colors(global_palette); - while (gp_num_colors >>= 1) ++gp_num_colors_pow2; - gp_num_colors = 1 << gp_num_colors_pow2; - --gp_num_colors_pow2; - if (gopts.background !== undefined) { - background = gopts.background; - if (background >= gp_num_colors) throw new Error('Background index out of range.'); - // The GIF spec states that a background index of 0 should be ignored, so - // this is probably a mistake and you really want to set it to another - // slot in the palette. But actually in the end most browsers, etc end - // up ignoring this almost completely (including for dispose background). - if (background === 0) throw new Error('Background index explicitly passed as 0.'); - } - } // - Logical Screen Descriptor. - // NOTE(deanm): w/h apparently ignored by implementations, but set anyway. - - buf[p++] = width & 255; - buf[p++] = width >> 8 & 255; - buf[p++] = height & 255; - buf[p++] = height >> 8 & 255; - // NOTE: Indicates 0-bpp original color resolution (unused?). - buf[p++] = (global_palette !== null ? 128 : 0) | // Global Color Table Flag. - gp_num_colors_pow2; // NOTE: No sort flag (unused?). - buf[p++] = background; // Background Color Index. - buf[p++] = 0; // Pixel aspect ratio (unused?). - // - Global Color Table - if (global_palette !== null) { - for (var i = 0, il = global_palette.length; i < il; ++i) { - var rgb = global_palette[i]; - buf[p++] = rgb >> 16 & 255; - buf[p++] = rgb >> 8 & 255; - buf[p++] = rgb & 255; - } - } - if (loop_count !== null) { - // Netscape block for looping. - if (loop_count < 0 || loop_count > 65535) throw new Error('Loop count invalid.'); - // Extension code, label, and length. - buf[p++] = 33; - buf[p++] = 255; - buf[p++] = 11; - // NETSCAPE2.0 - buf[p++] = 78; - buf[p++] = 69; - buf[p++] = 84; - buf[p++] = 83; - buf[p++] = 67; - buf[p++] = 65; - buf[p++] = 80; - buf[p++] = 69; - buf[p++] = 50; - buf[p++] = 46; - buf[p++] = 48; - // Sub-block - buf[p++] = 3; - buf[p++] = 1; - buf[p++] = loop_count & 255; - buf[p++] = loop_count >> 8 & 255; - buf[p++] = 0; // Terminator. - } - var ended = false; - this.addFrame = function (x, y, w, h, indexed_pixels, opts) { - if (ended === true) { - --p; - ended = false; - } // Un-end. - - opts = opts === undefined ? { - } - : opts; - // TODO(deanm): Bounds check x, y. Do they need to be within the virtual - // canvas width/height, I imagine? - if (x < 0 || y < 0 || x > 65535 || y > 65535) throw new Error('x/y invalid.'); - if (w <= 0 || h <= 0 || w > 65535 || h > 65535) throw new Error('Width/Height invalid.'); - if (indexed_pixels.length < w * h) throw new Error('Not enough pixels for the frame size.'); - var using_local_palette = true; - var palette = opts.palette; - if (palette === undefined || palette === null) { - using_local_palette = false; - palette = global_palette; - } - if (palette === undefined || palette === null) throw new Error('Must supply either a local or global palette.'); - var num_colors = check_palette_and_num_colors(palette); - // Compute the min_code_size (power of 2), destroying num_colors. - var min_code_size = 0; - while (num_colors >>= 1) ++min_code_size; - num_colors = 1 << min_code_size; // Now we can easily get it back. - var delay = opts.delay === undefined ? 0 : opts.delay; - // From the spec: - // 0 - No disposal specified. The decoder is - // not required to take any action. - // 1 - Do not dispose. The graphic is to be left - // in place. - // 2 - Restore to background color. The area used by the - // graphic must be restored to the background color. - // 3 - Restore to previous. The decoder is required to - // restore the area overwritten by the graphic with - // what was there prior to rendering the graphic. - // 4-7 - To be defined. - // NOTE(deanm): Dispose background doesn't really work, apparently most - // browsers ignore the background palette index and clear to transparency. - var disposal = opts.disposal === undefined ? 0 : opts.disposal; - if (disposal < 0 || disposal > 3) // 4-7 is reserved. - throw new Error('Disposal out of range.'); - var use_transparency = false; - var transparent_index = 0; - if (opts.transparent !== undefined && opts.transparent !== null) { - use_transparency = true; - transparent_index = opts.transparent; - if (transparent_index < 0 || transparent_index >= num_colors) throw new Error('Transparent color index.'); - } - if (disposal !== 0 || use_transparency || delay !== 0) { - // - Graphics Control Extension - buf[p++] = 33; - buf[p++] = 249; // Extension / Label. - buf[p++] = 4; // Byte size. - buf[p++] = disposal << 2 | (use_transparency === true ? 1 : 0); - buf[p++] = delay & 255; - buf[p++] = delay >> 8 & 255; - buf[p++] = transparent_index; // Transparent color index. - buf[p++] = 0; // Block Terminator. - } // - Image Descriptor - - buf[p++] = 44; // Image Seperator. - buf[p++] = x & 255; - buf[p++] = x >> 8 & 255; // Left. - buf[p++] = y & 255; - buf[p++] = y >> 8 & 255; // Top. - buf[p++] = w & 255; - buf[p++] = w >> 8 & 255; - buf[p++] = h & 255; - buf[p++] = h >> 8 & 255; - // NOTE: No sort flag (unused?). - // TODO(deanm): Support interlace. - buf[p++] = using_local_palette === true ? 128 | min_code_size - 1 : 0; - // - Local Color Table - if (using_local_palette === true) { - for (var i = 0, il = palette.length; i < il; ++i) { - var rgb = palette[i]; - buf[p++] = rgb >> 16 & 255; - buf[p++] = rgb >> 8 & 255; - buf[p++] = rgb & 255; - } - } - p = GifWriterOutputLZWCodeStream(buf, p, min_code_size < 2 ? 2 : min_code_size, indexed_pixels); - return p; - }; - this.end = function () { - if (ended === false) { - buf[p++] = 59; // Trailer. - ended = true; - } - return p; - }; - this.getOutputBuffer = function () { - return buf; - }; - this.setOutputBuffer = function (v) { - buf = v; - }; - this.getOutputBufferPosition = function () { - return p; - }; - this.setOutputBufferPosition = function (v) { - p = v; - }; - } // Main compression routine, palette indexes -> LZW code stream. - // |index_stream| must have at least one entry. - - function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) { - buf[p++] = min_code_size; - var cur_subblock = p++; // Pointing at the length field. - var clear_code = 1 << min_code_size; - var code_mask = clear_code - 1; - var eoi_code = clear_code + 1; - var next_code = eoi_code + 1; - var cur_code_size = min_code_size + 1; // Number of bits per code. - var cur_shift = 0; - // We have at most 12-bit codes, so we should have to hold a max of 19 - // bits here (and then we would write out). - var cur = 0; - function emit_bytes_to_buffer(bit_block_size) { - while (cur_shift >= bit_block_size) { - buf[p++] = cur & 255; - cur >>= 8; - cur_shift -= 8; - if (p === cur_subblock + 256) { - // Finished a subblock. - buf[cur_subblock] = 255; - cur_subblock = p++; - } - } - } - function emit_code(c) { - cur |= c << cur_shift; - cur_shift += cur_code_size; - emit_bytes_to_buffer(8); - } // I am not an expert on the topic, and I don't want to write a thesis. - // However, it is good to outline here the basic algorithm and the few data - // structures and optimizations here that make this implementation fast. - // The basic idea behind LZW is to build a table of previously seen runs - // addressed by a short id (herein called output code). All data is - // referenced by a code, which represents one or more values from the - // original input stream. All input bytes can be referenced as the same - // value as an output code. So if you didn't want any compression, you - // could more or less just output the original bytes as codes (there are - // some details to this, but it is the idea). In order to achieve - // compression, values greater then the input range (codes can be up to - // 12-bit while input only 8-bit) represent a sequence of previously seen - // inputs. The decompressor is able to build the same mapping while - // decoding, so there is always a shared common knowledge between the - // encoding and decoder, which is also important for "timing" aspects like - // how to handle variable bit width code encoding. - // - // One obvious but very important consequence of the table system is there - // is always a unique id (at most 12-bits) to map the runs. 'A' might be - // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc. This relationship - // can be used for an effecient lookup strategy for the code mapping. We - // need to know if a run has been seen before, and be able to map that run - // to the output code. Since we start with known unique ids (input bytes), - // and then from those build more unique ids (table entries), we can - // continue this chain (almost like a linked list) to always have small - // integer values that represent the current byte chains in the encoder. - // This means instead of tracking the input bytes (AAAABCD) to know our - // current state, we can track the table entry for AAAABC (it is guaranteed - // to exist by the nature of the algorithm) and the next character D. - // Therefor the tuple of (table_entry, byte) is guaranteed to also be - // unique. This allows us to create a simple lookup key for mapping input - // sequences to codes (table indices) without having to store or search - // any of the code sequences. So if 'AAAA' has a table entry of 12, the - // tuple of ('AAAA', K) for any input byte K will be unique, and can be our - // key. This leads to a integer value at most 20-bits, which can always - // fit in an SMI value and be used as a fast sparse array / object key. - // Output code for the current contents of the index buffer. - - var ib_code = index_stream[0] & code_mask; // Load first input index. - var code_table = { - }; // Key'd on our 20-bit "tuple". - emit_code(clear_code); // Spec says first code should be a clear code. - // First index already loaded, process the rest of the stream. - for (var i = 1, il = index_stream.length; i < il; ++i) { - var k = index_stream[i] & code_mask; - var cur_key = ib_code << 8 | k; // (prev, k) unique tuple. - var cur_code = code_table[cur_key]; // buffer + k. - // Check if we have to create a new code table entry. - if (cur_code === undefined) { - // We don't have buffer + k. - // Emit index buffer (without k). - // This is an inline version of emit_code, because this is the core - // writing routine of the compressor (and V8 cannot inline emit_code - // because it is a closure here in a different context). Additionally - // we can call emit_byte_to_buffer less often, because we can have - // 30-bits (from our 31-bit signed SMI), and we know our codes will only - // be 12-bits, so can safely have 18-bits there without overflow. - // emit_code(ib_code); - cur |= ib_code << cur_shift; - cur_shift += cur_code_size; - while (cur_shift >= 8) { - buf[p++] = cur & 255; - cur >>= 8; - cur_shift -= 8; - if (p === cur_subblock + 256) { - // Finished a subblock. - buf[cur_subblock] = 255; - cur_subblock = p++; - } - } - if (next_code === 4096) { - // Table full, need a clear. - emit_code(clear_code); - next_code = eoi_code + 1; - cur_code_size = min_code_size + 1; - code_table = { - }; - } else { - // Table not full, insert a new entry. - // Increase our variable bit code sizes if necessary. This is a bit - // tricky as it is based on "timing" between the encoding and - // decoder. From the encoders perspective this should happen after - // we've already emitted the index buffer and are about to create the - // first table entry that would overflow our current code bit size. - if (next_code >= 1 << cur_code_size) ++cur_code_size; - code_table[cur_key] = next_code++; // Insert into code table. - } - ib_code = k; // Index buffer to single input k. - } else { - ib_code = cur_code; // Index buffer to sequence in code table. - } - } - emit_code(ib_code); // There will still be something in the index buffer. - emit_code(eoi_code); // End Of Information. - // Flush / finalize the sub-blocks stream to the buffer. - emit_bytes_to_buffer(1); - // Finish the sub-blocks, writing out any unfinished lengths and - // terminating with a sub-block of length 0. If we have already started - // but not yet used a sub-block it can just become the terminator. - if (cur_subblock + 1 === p) { - // Started but unused. - buf[cur_subblock] = 0; - } else { - // Started and used, write length and additional terminator block. - buf[cur_subblock] = p - cur_subblock - 1; - buf[p++] = 0; - } - return p; - } - function GifReader(buf) { - var p = 0; - // - Header (GIF87a or GIF89a). - if (buf[p++] !== 71 || buf[p++] !== 73 || buf[p++] !== 70 || buf[p++] !== 56 || (buf[p++] + 1 & 253) !== 56 || buf[p++] !== 97) { - throw new Error('Invalid GIF 87a/89a header.'); - } // - Logical Screen Descriptor. - - var width = buf[p++] | buf[p++] << 8; - var height = buf[p++] | buf[p++] << 8; - var pf0 = buf[p++]; // . - var global_palette_flag = pf0 >> 7; - var num_global_colors_pow2 = pf0 & 7; - var num_global_colors = 1 << num_global_colors_pow2 + 1; - var background = buf[p++]; - buf[p++]; // Pixel aspect ratio (unused?). - var global_palette_offset = null; - var global_palette_size = null; - if (global_palette_flag) { - global_palette_offset = p; - global_palette_size = num_global_colors; - p += num_global_colors * 3; // Seek past palette. - } - var no_eof = true; - var frames = [ - ]; - var delay = 0; - var transparent_index = null; - var disposal = 0; // 0 - No disposal specified. - var loop_count = null; - this.width = width; - this.height = height; - while (no_eof && p < buf.length) { - switch (buf[p++]) { - case 33: - // Graphics Control Extension Block - switch (buf[p++]) { - case 255: - // Application specific block - // Try if it's a Netscape block (with animation loop counter). - if (buf[p] !== 11 || // 21 FF already read, check block size. - // NETSCAPE2.0 - buf[p + 1] == 78 && buf[p + 2] == 69 && buf[p + 3] == 84 && buf[p + 4] == 83 && buf[p + 5] == 67 && buf[p + 6] == 65 && buf[p + 7] == 80 && buf[p + 8] == 69 && buf[p + 9] == 50 && buf[p + 10] == 46 && buf[p + 11] == 48 && // Sub-block - buf[p + 12] == 3 && buf[p + 13] == 1 && buf[p + 16] == 0) { - p += 14; - loop_count = buf[p++] | buf[p++] << 8; - p++; // Skip terminator. - } else { - // We don't know what it is, just try to get past it. - p += 12; - while (true) { - // Seek through subblocks. - var block_size = buf[p++]; - // Bad block size (ex: undefined from an out of bounds read). - if (!(block_size >= 0)) throw Error('Invalid block size'); - if (block_size === 0) break; // 0 size is terminator - p += block_size; - } - } - break; - case 249: - // Graphics Control Extension - if (buf[p++] !== 4 || buf[p + 4] !== 0) throw new Error('Invalid graphics extension block.'); - var pf1 = buf[p++]; - delay = buf[p++] | buf[p++] << 8; - transparent_index = buf[p++]; - if ((pf1 & 1) === 0) transparent_index = null; - disposal = pf1 >> 2 & 7; - p++; // Skip terminator. - break; - case 254: - // Comment Extension. - while (true) { - // Seek through subblocks. - var block_size = buf[p++]; - // Bad block size (ex: undefined from an out of bounds read). - if (!(block_size >= 0)) throw Error('Invalid block size'); - if (block_size === 0) break; // 0 size is terminator - // console.log(buf.slice(p, p+block_size).toString('ascii')); - p += block_size; - } - break; - default: - throw new Error('Unknown graphic control label: 0x' + buf[p - 1].toString(16)); - } - break; - case 44: - // Image Descriptor. - var x = buf[p++] | buf[p++] << 8; - var y = buf[p++] | buf[p++] << 8; - var w = buf[p++] | buf[p++] << 8; - var h = buf[p++] | buf[p++] << 8; - var pf2 = buf[p++]; - var local_palette_flag = pf2 >> 7; - var interlace_flag = pf2 >> 6 & 1; - var num_local_colors_pow2 = pf2 & 7; - var num_local_colors = 1 << num_local_colors_pow2 + 1; - var palette_offset = global_palette_offset; - var palette_size = global_palette_size; - var has_local_palette = false; - if (local_palette_flag) { - var has_local_palette = true; - palette_offset = p; // Override with local palette. - palette_size = num_local_colors; - p += num_local_colors * 3; // Seek past palette. - } - var data_offset = p; - p++; // codesize - while (true) { - var block_size = buf[p++]; - // Bad block size (ex: undefined from an out of bounds read). - if (!(block_size >= 0)) throw Error('Invalid block size'); - if (block_size === 0) break; // 0 size is terminator - p += block_size; - } - frames.push({ - x: x, - y: y, - width: w, - height: h, - has_local_palette: has_local_palette, - palette_offset: palette_offset, - palette_size: palette_size, - data_offset: data_offset, - data_length: p - data_offset, - transparent_index: transparent_index, - interlaced: !!interlace_flag, - delay: delay, - disposal: disposal - }); - break; - case 59: - // Trailer Marker (end of file). - no_eof = false; - break; - default: - throw new Error('Unknown gif block: 0x' + buf[p - 1].toString(16)); - break; - } - } - this.numFrames = function () { - return frames.length; - }; - this.loopCount = function () { - return loop_count; - }; - this.frameInfo = function (frame_num) { - if (frame_num < 0 || frame_num >= frames.length) throw new Error('Frame index out of range.'); - return frames[frame_num]; - }; - this.decodeAndBlitFrameBGRA = function (frame_num, pixels) { - var frame = this.frameInfo(frame_num); - var num_pixels = frame.width * frame.height; - var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. - GifReaderLZWOutputIndexStream(buf, frame.data_offset, index_stream, num_pixels); - var palette_offset = frame.palette_offset; - // NOTE(deanm): It seems to be much faster to compare index to 256 than - // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in - // the profile, not sure if it's related to using a Uint8Array. - var trans = frame.transparent_index; - if (trans === null) trans = 256; - // We are possibly just blitting to a portion of the entire frame. - // That is a subrect within the framerect, so the additional pixels - // must be skipped over after we finished a scanline. - var framewidth = frame.width; - var framestride = width - framewidth; - var xleft = framewidth; // Number of subrect pixels left in scanline. - // Output indicies of the top left and bottom right corners of the subrect. - var opbeg = (frame.y * width + frame.x) * 4; - var opend = ((frame.y + frame.height) * width + frame.x) * 4; - var op = opbeg; - var scanstride = framestride * 4; - // Use scanstride to skip past the rows when interlacing. This is skipping - // 7 rows for the first two passes, then 3 then 1. - if (frame.interlaced === true) { - scanstride += width * 4 * 7; // Pass 1. - } - var interlaceskip = 8; // Tracking the row interval in the current pass. - for (var i = 0, il = index_stream.length; i < il; ++i) { - var index = index_stream[i]; - if (xleft === 0) { - // Beginning of new scan line - op += scanstride; - xleft = framewidth; - if (op >= opend) { - // Catch the wrap to switch passes when interlacing. - scanstride = framestride * 4 + width * 4 * (interlaceskip - 1); - // interlaceskip / 2 * 4 is interlaceskip << 1. - op = opbeg + (framewidth + framestride) * (interlaceskip << 1); - interlaceskip >>= 1; - } - } - if (index === trans) { - op += 4; - } else { - var r = buf[palette_offset + index * 3]; - var g = buf[palette_offset + index * 3 + 1]; - var b = buf[palette_offset + index * 3 + 2]; - pixels[op++] = b; - pixels[op++] = g; - pixels[op++] = r; - pixels[op++] = 255; - } - --xleft; - } - }; - // I will go to copy and paste hell one day... - this.decodeAndBlitFrameRGBA = function (frame_num, pixels) { - var frame = this.frameInfo(frame_num); - var num_pixels = frame.width * frame.height; - var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. - GifReaderLZWOutputIndexStream(buf, frame.data_offset, index_stream, num_pixels); - var palette_offset = frame.palette_offset; - // NOTE(deanm): It seems to be much faster to compare index to 256 than - // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in - // the profile, not sure if it's related to using a Uint8Array. - var trans = frame.transparent_index; - if (trans === null) trans = 256; - // We are possibly just blitting to a portion of the entire frame. - // That is a subrect within the framerect, so the additional pixels - // must be skipped over after we finished a scanline. - var framewidth = frame.width; - var framestride = width - framewidth; - var xleft = framewidth; // Number of subrect pixels left in scanline. - // Output indicies of the top left and bottom right corners of the subrect. - var opbeg = (frame.y * width + frame.x) * 4; - var opend = ((frame.y + frame.height) * width + frame.x) * 4; - var op = opbeg; - var scanstride = framestride * 4; - // Use scanstride to skip past the rows when interlacing. This is skipping - // 7 rows for the first two passes, then 3 then 1. - if (frame.interlaced === true) { - scanstride += width * 4 * 7; // Pass 1. - } - var interlaceskip = 8; // Tracking the row interval in the current pass. - for (var i = 0, il = index_stream.length; i < il; ++i) { - var index = index_stream[i]; - if (xleft === 0) { - // Beginning of new scan line - op += scanstride; - xleft = framewidth; - if (op >= opend) { - // Catch the wrap to switch passes when interlacing. - scanstride = framestride * 4 + width * 4 * (interlaceskip - 1); - // interlaceskip / 2 * 4 is interlaceskip << 1. - op = opbeg + (framewidth + framestride) * (interlaceskip << 1); - interlaceskip >>= 1; - } - } - if (index === trans) { - op += 4; - } else { - var r = buf[palette_offset + index * 3]; - var g = buf[palette_offset + index * 3 + 1]; - var b = buf[palette_offset + index * 3 + 2]; - pixels[op++] = r; - pixels[op++] = g; - pixels[op++] = b; - pixels[op++] = 255; - } - --xleft; - } - }; - } - function GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) { - var min_code_size = code_stream[p++]; - var clear_code = 1 << min_code_size; - var eoi_code = clear_code + 1; - var next_code = eoi_code + 1; - var cur_code_size = min_code_size + 1; // Number of bits per code. - // NOTE: This shares the same name as the encoder, but has a different - // meaning here. Here this masks each code coming from the code stream. - var code_mask = (1 << cur_code_size) - 1; - var cur_shift = 0; - var cur = 0; - var op = 0; // Output pointer. - var subblock_size = code_stream[p++]; - // TODO(deanm): Would using a TypedArray be any faster? At least it would - // solve the fast mode / backing store uncertainty. - // var code_table = Array(4096); - var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits. - var prev_code = null; // Track code-1. - while (true) { - // Read up to two bytes, making sure we always 12-bits for max sized code. - while (cur_shift < 16) { - if (subblock_size === 0) break; // No more data to be read. - cur |= code_stream[p++] << cur_shift; - cur_shift += 8; - if (subblock_size === 1) { - // Never let it get to 0 to hold logic above. - subblock_size = code_stream[p++]; // Next subblock. - } else { - --subblock_size; - } - } // TODO(deanm): We should never really get here, we should have received - // and EOI. - - if (cur_shift < cur_code_size) break; - var code = cur & code_mask; - cur >>= cur_code_size; - cur_shift -= cur_code_size; - // TODO(deanm): Maybe should check that the first code was a clear code, - // at least this is what you're supposed to do. But actually our encoder - // now doesn't emit a clear code first anyway. - if (code === clear_code) { - // We don't actually have to clear the table. This could be a good idea - // for greater error checking, but we don't really do any anyway. We - // will just track it with next_code and overwrite old entries. - next_code = eoi_code + 1; - cur_code_size = min_code_size + 1; - code_mask = (1 << cur_code_size) - 1; - // Don't update prev_code ? - prev_code = null; - continue; - } else if (code === eoi_code) { - break; - } // We have a similar situation as the decoder, where we want to store - // variable length entries (code table entries), but we want to do in a - // faster manner than an array of arrays. The code below stores sort of a - // linked list within the code table, and then "chases" through it to - // construct the dictionary entries. When a new entry is created, just the - // last byte is stored, and the rest (prefix) of the entry is only - // referenced by its table entry. Then the code chases through the - // prefixes until it reaches a single byte code. We have to chase twice, - // first to compute the length, and then to actually copy the data to the - // output (backwards, since we know the length). The alternative would be - // storing something in an intermediate stack, but that doesn't make any - // more sense. I implemented an approach where it also stored the length - // in the code table, although it's a bit tricky because you run out of - // bits (12 + 12 + 8), but I didn't measure much improvements (the table - // entries are generally not the long). Even when I created benchmarks for - // very long table entries the complexity did not seem worth it. - // The code table stores the prefix entry in 12 bits and then the suffix - // byte in 8 bits, so each entry is 20 bits. - - var chase_code = code < next_code ? code : prev_code; - // Chase what we will output, either {CODE} or {CODE-1}. - var chase_length = 0; - var chase = chase_code; - while (chase > clear_code) { - chase = code_table[chase] >> 8; - ++chase_length; - } - var k = chase; - var op_end = op + chase_length + (chase_code !== code ? 1 : 0); - if (op_end > output_length) { - console.log('Warning, gif stream longer than expected.'); - return; - } // Already have the first byte from the chase, might as well write it fast. - - output[op++] = k; - op += chase_length; - var b = op; // Track pointer, writing backwards. - if (chase_code !== code) // The case of emitting {CODE-1} + k. - output[op++] = k; - chase = chase_code; - while (chase_length--) { - chase = code_table[chase]; - output[--b] = chase & 255; // Write backwards. - chase >>= 8; // Pull down to the prefix code. - } - if (prev_code !== null && next_code < 4096) { - code_table[next_code++] = prev_code << 8 | k; - // TODO(deanm): Figure out this clearing vs code growth logic better. I - // have an feeling that it should just happen somewhere else, for now it - // is awkward between when we grow past the max and then hit a clear code. - // For now just check if we hit the max 12-bits (then a clear code should - // follow, also of course encoded in 12-bits). - if (next_code >= code_mask + 1 && cur_code_size < 12) { - ++cur_code_size; - code_mask = code_mask << 1 | 1; - } - } - prev_code = code; - } - if (op !== output_length) { - console.log('Warning, gif stream shorter than expected.'); - } - return output; - } // CommonJS. - - try { - exports.GifWriter = GifWriter; - exports.GifReader = GifReader; - } catch (e) { - } - }, - { - } - ], - 271: [ - function (_dereq_, module, exports) { - (function (Buffer) { - /** - * https://opentype.js.org v0.9.0 | (c) Frederik De Bleser and other contributors | MIT License | Uses tiny-inflate by Devon Govett and string.prototype.codepointat polyfill by Mathias Bynens - */ - (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : factory(global.opentype = { - }); - }) (this, function (exports) { - 'use strict'; - /*! https://mths.be/codepointat v0.2.0 by @mathias */ - if (!String.prototype.codePointAt) { - (function () { - var defineProperty = function () { - // IE 8 only supports `Object.defineProperty` on DOM elements - try { - var object = { - }; - var $defineProperty = Object.defineProperty; - var result = $defineProperty(object, object, object) && $defineProperty; - } catch (error) { - } - return result; - }(); - var codePointAt = function (position) { - if (this == null) { - throw TypeError(); - } - var string = String(this); - var size = string.length; - // `ToInteger` - var index = position ? Number(position) : 0; - if (index != index) { - // better `isNaN` - index = 0; - } // Account for out-of-bounds indices: - - if (index < 0 || index >= size) { - return undefined; - } // Get the first code unit - - var first = string.charCodeAt(index); - var second; - if ( // check if it’s the start of a surrogate pair - first >= 55296 && first <= 56319 && // high surrogate - size > index + 1 // there is a next code unit - ) { - second = string.charCodeAt(index + 1); - if (second >= 56320 && second <= 57343) { - // low surrogate - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - return (first - 55296) * 1024 + second - 56320 + 65536; - } - } - return first; - }; - if (defineProperty) { - defineProperty(String.prototype, 'codePointAt', { - 'value': codePointAt, - 'configurable': true, - 'writable': true - }); - } else { - String.prototype.codePointAt = codePointAt; - } - }) (); - } - var TINF_OK = 0; - var TINF_DATA_ERROR = - 3; - function Tree() { - this.table = new Uint16Array(16); /* table of code length counts */ - this.trans = new Uint16Array(288); /* code -> symbol translation table */ - } - function Data(source, dest) { - this.source = source; - this.sourceIndex = 0; - this.tag = 0; - this.bitcount = 0; - this.dest = dest; - this.destLen = 0; - this.ltree = new Tree(); /* dynamic length/symbol tree */ - this.dtree = new Tree(); /* dynamic distance tree */ - } /* --------------------------------------------------- * - * -- uninitialized global data (static structures) -- * - * --------------------------------------------------- */ - - var sltree = new Tree(); - var sdtree = new Tree(); - /* extra bits and base tables for length codes */ - var length_bits = new Uint8Array(30); - var length_base = new Uint16Array(30); - /* extra bits and base tables for distance codes */ - var dist_bits = new Uint8Array(30); - var dist_base = new Uint16Array(30); - /* special ordering of code length codes */ - var clcidx = new Uint8Array([16, - 17, - 18, - 0, - 8, - 7, - 9, - 6, - 10, - 5, - 11, - 4, - 12, - 3, - 13, - 2, - 14, - 1, - 15]); - /* used by tinf_decode_trees, avoids allocations every call */ - var code_tree = new Tree(); - var lengths = new Uint8Array(288 + 32); - /* ----------------------- * - * -- utility functions -- * - * ----------------------- */ - /* build extra bits and base tables */ - function tinf_build_bits_base(bits, base, delta, first) { - var i, - sum; - /* build bits table */ - for (i = 0; i < delta; ++i) { - bits[i] = 0; - } - for (i = 0; i < 30 - delta; ++i) { - bits[i + delta] = i / delta | 0; - } /* build base table */ - - for (sum = first, i = 0; i < 30; ++i) { - base[i] = sum; - sum += 1 << bits[i]; - } - } /* build the fixed huffman trees */ - - function tinf_build_fixed_trees(lt, dt) { - var i; - /* build fixed length tree */ - for (i = 0; i < 7; ++i) { - lt.table[i] = 0; - } - lt.table[7] = 24; - lt.table[8] = 152; - lt.table[9] = 112; - for (i = 0; i < 24; ++i) { - lt.trans[i] = 256 + i; - } - for (i = 0; i < 144; ++i) { - lt.trans[24 + i] = i; - } - for (i = 0; i < 8; ++i) { - lt.trans[24 + 144 + i] = 280 + i; - } - for (i = 0; i < 112; ++i) { - lt.trans[24 + 144 + 8 + i] = 144 + i; - } /* build fixed distance tree */ - - for (i = 0; i < 5; ++i) { - dt.table[i] = 0; - } - dt.table[5] = 32; - for (i = 0; i < 32; ++i) { - dt.trans[i] = i; - } - } /* given an array of code lengths, build a tree */ - - var offs = new Uint16Array(16); - function tinf_build_tree(t, lengths, off, num) { - var i, - sum; - /* clear code length count table */ - for (i = 0; i < 16; ++i) { - t.table[i] = 0; - } /* scan symbol lengths, and sum code length counts */ - - for (i = 0; i < num; ++i) { - t.table[lengths[off + i]]++; - } - t.table[0] = 0; - /* compute offset table for distribution sort */ - for (sum = 0, i = 0; i < 16; ++i) { - offs[i] = sum; - sum += t.table[i]; - } /* create code->symbol translation table (symbols sorted by code) */ - - for (i = 0; i < num; ++i) { - if (lengths[off + i]) { - t.trans[offs[lengths[off + i]]++] = i; - } - } - } /* ---------------------- * - * -- decode functions -- * - * ---------------------- */ - /* get one bit from source stream */ - - function tinf_getbit(d) { - /* check if tag is empty */ - if (!d.bitcount--) { - /* load next tag */ - d.tag = d.source[d.sourceIndex++]; - d.bitcount = 7; - } /* shift bit out of tag */ - - var bit = d.tag & 1; - d.tag >>>= 1; - return bit; - } /* read a num bit value from a stream and add base */ - - function tinf_read_bits(d, num, base) { - if (!num) { - return base; - } - while (d.bitcount < 24) { - d.tag |= d.source[d.sourceIndex++] << d.bitcount; - d.bitcount += 8; - } - var val = d.tag & 65535 >>> 16 - num; - d.tag >>>= num; - d.bitcount -= num; - return val + base; - } /* given a data stream and a tree, decode a symbol */ - - function tinf_decode_symbol(d, t) { - while (d.bitcount < 24) { - d.tag |= d.source[d.sourceIndex++] << d.bitcount; - d.bitcount += 8; - } - var sum = 0, - cur = 0, - len = 0; - var tag = d.tag; - /* get more bits while code value is above sum */ - do { - cur = 2 * cur + (tag & 1); - tag >>>= 1; - ++len; - sum += t.table[len]; - cur -= t.table[len]; - } while (cur >= 0); - d.tag = tag; - d.bitcount -= len; - return t.trans[sum + cur]; - } /* given a data stream, decode dynamic trees from it */ - - function tinf_decode_trees(d, lt, dt) { - var hlit, - hdist, - hclen; - var i, - num, - length; - /* get 5 bits HLIT (257-286) */ - hlit = tinf_read_bits(d, 5, 257); - /* get 5 bits HDIST (1-32) */ - hdist = tinf_read_bits(d, 5, 1); - /* get 4 bits HCLEN (4-19) */ - hclen = tinf_read_bits(d, 4, 4); - for (i = 0; i < 19; ++i) { - lengths[i] = 0; - } /* read code lengths for code length alphabet */ - - for (i = 0; i < hclen; ++i) { - /* get 3 bits code length (0-7) */ - var clen = tinf_read_bits(d, 3, 0); - lengths[clcidx[i]] = clen; - } /* build code length tree */ - - tinf_build_tree(code_tree, lengths, 0, 19); - /* decode code lengths for the dynamic trees */ - for (num = 0; num < hlit + hdist; ) { - var sym = tinf_decode_symbol(d, code_tree); - switch (sym) { - case 16: - /* copy previous code length 3-6 times (read 2 bits) */ - var prev = lengths[num - 1]; - for (length = tinf_read_bits(d, 2, 3); length; --length) { - lengths[num++] = prev; - } - break; - case 17: - /* repeat code length 0 for 3-10 times (read 3 bits) */ - for (length = tinf_read_bits(d, 3, 3); length; --length) { - lengths[num++] = 0; - } - break; - case 18: - /* repeat code length 0 for 11-138 times (read 7 bits) */ - for (length = tinf_read_bits(d, 7, 11); length; --length) { - lengths[num++] = 0; - } - break; - default: - /* values 0-15 represent the actual code lengths */ - lengths[num++] = sym; - break; - } - } /* build dynamic trees */ - - tinf_build_tree(lt, lengths, 0, hlit); - tinf_build_tree(dt, lengths, hlit, hdist); - } /* ----------------------------- * - * -- block inflate functions -- * - * ----------------------------- */ - /* given a stream and two trees, inflate a block of data */ - - function tinf_inflate_block_data(d, lt, dt) { - while (1) { - var sym = tinf_decode_symbol(d, lt); - /* check for end of block */ - if (sym === 256) { - return TINF_OK; - } - if (sym < 256) { - d.dest[d.destLen++] = sym; - } else { - var length, - dist, - offs; - var i; - sym -= 257; - /* possibly get more bits from length code */ - length = tinf_read_bits(d, length_bits[sym], length_base[sym]); - dist = tinf_decode_symbol(d, dt); - /* possibly get more bits from distance code */ - offs = d.destLen - tinf_read_bits(d, dist_bits[dist], dist_base[dist]); - /* copy match */ - for (i = offs; i < offs + length; ++i) { - d.dest[d.destLen++] = d.dest[i]; - } - } - } - } /* inflate an uncompressed block of data */ - - function tinf_inflate_uncompressed_block(d) { - var length, - invlength; - var i; - /* unread from bitbuffer */ - while (d.bitcount > 8) { - d.sourceIndex--; - d.bitcount -= 8; - } /* get length */ - - length = d.source[d.sourceIndex + 1]; - length = 256 * length + d.source[d.sourceIndex]; - /* get one's complement of length */ - invlength = d.source[d.sourceIndex + 3]; - invlength = 256 * invlength + d.source[d.sourceIndex + 2]; - /* check length */ - if (length !== (~invlength & 65535)) { - return TINF_DATA_ERROR; - } - d.sourceIndex += 4; - /* copy block */ - for (i = length; i; --i) { - d.dest[d.destLen++] = d.source[d.sourceIndex++]; - } /* make sure we start next block on a byte boundary */ - - d.bitcount = 0; - return TINF_OK; - } /* inflate stream from source to dest */ - - function tinf_uncompress(source, dest) { - var d = new Data(source, dest); - var bfinal, - btype, - res; - do { - /* read final block flag */ - bfinal = tinf_getbit(d); - /* read block type (2 bits) */ - btype = tinf_read_bits(d, 2, 0); - /* decompress block */ - switch (btype) { - case 0: - /* decompress uncompressed block */ - res = tinf_inflate_uncompressed_block(d); - break; - case 1: - /* decompress block with fixed huffman trees */ - res = tinf_inflate_block_data(d, sltree, sdtree); - break; - case 2: - /* decompress block with dynamic huffman trees */ - tinf_decode_trees(d, d.ltree, d.dtree); - res = tinf_inflate_block_data(d, d.ltree, d.dtree); - break; - default: - res = TINF_DATA_ERROR; - } - if (res !== TINF_OK) { - throw new Error('Data error'); - } - } while (!bfinal); - if (d.destLen < d.dest.length) { - if (typeof d.dest.slice === 'function') { - return d.dest.slice(0, d.destLen); - } else { - return d.dest.subarray(0, d.destLen); - } - } - return d.dest; - } /* -------------------- * - * -- initialization -- * - * -------------------- */ - /* build fixed huffman trees */ - - tinf_build_fixed_trees(sltree, sdtree); - /* build extra bits and base tables */ - tinf_build_bits_base(length_bits, length_base, 4, 3); - tinf_build_bits_base(dist_bits, dist_base, 2, 1); - /* fix a special case */ - length_bits[28] = 0; - length_base[28] = 258; - var tinyInflate = tinf_uncompress; - // The Bounding Box object - function derive(v0, v1, v2, v3, t) { - return Math.pow(1 - t, 3) * v0 + 3 * Math.pow(1 - t, 2) * t * v1 + 3 * (1 - t) * Math.pow(t, 2) * v2 + Math.pow(t, 3) * v3; - } /** - * A bounding box is an enclosing box that describes the smallest measure within which all the points lie. - * It is used to calculate the bounding box of a glyph or text path. - * - * On initialization, x1/y1/x2/y2 will be NaN. Check if the bounding box is empty using `isEmpty()`. - * - * @exports opentype.BoundingBox - * @class - * @constructor - */ - - function BoundingBox() { - this.x1 = Number.NaN; - this.y1 = Number.NaN; - this.x2 = Number.NaN; - this.y2 = Number.NaN; - } /** - * Returns true if the bounding box is empty, that is, no points have been added to the box yet. - */ - - BoundingBox.prototype.isEmpty = function () { - return isNaN(this.x1) || isNaN(this.y1) || isNaN(this.x2) || isNaN(this.y2); - }; - /** - * Add the point to the bounding box. - * The x1/y1/x2/y2 coordinates of the bounding box will now encompass the given point. - * @param {number} x - The X coordinate of the point. - * @param {number} y - The Y coordinate of the point. - */ - BoundingBox.prototype.addPoint = function (x, y) { - if (typeof x === 'number') { - if (isNaN(this.x1) || isNaN(this.x2)) { - this.x1 = x; - this.x2 = x; - } - if (x < this.x1) { - this.x1 = x; - } - if (x > this.x2) { - this.x2 = x; - } - } - if (typeof y === 'number') { - if (isNaN(this.y1) || isNaN(this.y2)) { - this.y1 = y; - this.y2 = y; - } - if (y < this.y1) { - this.y1 = y; - } - if (y > this.y2) { - this.y2 = y; - } - } - }; - /** - * Add a X coordinate to the bounding box. - * This extends the bounding box to include the X coordinate. - * This function is used internally inside of addBezier. - * @param {number} x - The X coordinate of the point. - */ - BoundingBox.prototype.addX = function (x) { - this.addPoint(x, null); - }; - /** - * Add a Y coordinate to the bounding box. - * This extends the bounding box to include the Y coordinate. - * This function is used internally inside of addBezier. - * @param {number} y - The Y coordinate of the point. - */ - BoundingBox.prototype.addY = function (y) { - this.addPoint(null, y); - }; - /** - * Add a Bézier curve to the bounding box. - * This extends the bounding box to include the entire Bézier. - * @param {number} x0 - The starting X coordinate. - * @param {number} y0 - The starting Y coordinate. - * @param {number} x1 - The X coordinate of the first control point. - * @param {number} y1 - The Y coordinate of the first control point. - * @param {number} x2 - The X coordinate of the second control point. - * @param {number} y2 - The Y coordinate of the second control point. - * @param {number} x - The ending X coordinate. - * @param {number} y - The ending Y coordinate. - */ - BoundingBox.prototype.addBezier = function (x0, y0, x1, y1, x2, y2, x, y) { - var this$1 = this; - // This code is based on http://nishiohirokazu.blogspot.com/2009/06/how-to-calculate-bezier-curves-bounding.html - // and https://github.com/icons8/svg-path-bounding-box - var p0 = [ - x0, - y0 - ]; - var p1 = [ - x1, - y1 - ]; - var p2 = [ - x2, - y2 - ]; - var p3 = [ - x, - y - ]; - this.addPoint(x0, y0); - this.addPoint(x, y); - for (var i = 0; i <= 1; i++) { - var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; - var a = - 3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; - var c = 3 * p1[i] - 3 * p0[i]; - if (a === 0) { - if (b === 0) { - continue; - } - var t = - c / b; - if (0 < t && t < 1) { - if (i === 0) { - this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t)); - } - if (i === 1) { - this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t)); - } - } - continue; - } - var b2ac = Math.pow(b, 2) - 4 * c * a; - if (b2ac < 0) { - continue; - } - var t1 = ( - b + Math.sqrt(b2ac)) / (2 * a); - if (0 < t1 && t1 < 1) { - if (i === 0) { - this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t1)); - } - if (i === 1) { - this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t1)); - } - } - var t2 = ( - b - Math.sqrt(b2ac)) / (2 * a); - if (0 < t2 && t2 < 1) { - if (i === 0) { - this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t2)); - } - if (i === 1) { - this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t2)); - } - } - } - }; - /** - * Add a quadratic curve to the bounding box. - * This extends the bounding box to include the entire quadratic curve. - * @param {number} x0 - The starting X coordinate. - * @param {number} y0 - The starting Y coordinate. - * @param {number} x1 - The X coordinate of the control point. - * @param {number} y1 - The Y coordinate of the control point. - * @param {number} x - The ending X coordinate. - * @param {number} y - The ending Y coordinate. - */ - BoundingBox.prototype.addQuad = function (x0, y0, x1, y1, x, y) { - var cp1x = x0 + 2 / 3 * (x1 - x0); - var cp1y = y0 + 2 / 3 * (y1 - y0); - var cp2x = cp1x + 1 / 3 * (x - x0); - var cp2y = cp1y + 1 / 3 * (y - y0); - this.addBezier(x0, y0, cp1x, cp1y, cp2x, cp2y, x, y); - }; - // Geometric objects - /** - * A bézier path containing a set of path commands similar to a SVG path. - * Paths can be drawn on a context using `draw`. - * @exports opentype.Path - * @class - * @constructor - */ - function Path() { - this.commands = [ - ]; - this.fill = 'black'; - this.stroke = null; - this.strokeWidth = 1; - } /** - * @param {number} x - * @param {number} y - */ - - Path.prototype.moveTo = function (x, y) { - this.commands.push({ - type: 'M', - x: x, - y: y - }); - }; - /** - * @param {number} x - * @param {number} y - */ - Path.prototype.lineTo = function (x, y) { - this.commands.push({ - type: 'L', - x: x, - y: y - }); - }; - /** - * Draws cubic curve - * @function - * curveTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control 1 - * @param {number} y1 - y of control 1 - * @param {number} x2 - x of control 2 - * @param {number} y2 - y of control 2 - * @param {number} x - x of path point - * @param {number} y - y of path point - */ - /** - * Draws cubic curve - * @function - * bezierCurveTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control 1 - * @param {number} y1 - y of control 1 - * @param {number} x2 - x of control 2 - * @param {number} y2 - y of control 2 - * @param {number} x - x of path point - * @param {number} y - y of path point - * @see curveTo - */ - Path.prototype.curveTo = Path.prototype.bezierCurveTo = function (x1, y1, x2, y2, x, y) { - this.commands.push({ - type: 'C', - x1: x1, - y1: y1, - x2: x2, - y2: y2, - x: x, - y: y - }); - }; - /** - * Draws quadratic curve - * @function - * quadraticCurveTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control - * @param {number} y1 - y of control - * @param {number} x - x of path point - * @param {number} y - y of path point - */ - /** - * Draws quadratic curve - * @function - * quadTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control - * @param {number} y1 - y of control - * @param {number} x - x of path point - * @param {number} y - y of path point - */ - Path.prototype.quadTo = Path.prototype.quadraticCurveTo = function (x1, y1, x, y) { - this.commands.push({ - type: 'Q', - x1: x1, - y1: y1, - x: x, - y: y - }); - }; - /** - * Closes the path - * @function closePath - * @memberof opentype.Path.prototype - */ - /** - * Close the path - * @function close - * @memberof opentype.Path.prototype - */ - Path.prototype.close = Path.prototype.closePath = function () { - this.commands.push({ - type: 'Z' - }); - }; - /** - * Add the given path or list of commands to the commands of this path. - * @param {Array} pathOrCommands - another opentype.Path, an opentype.BoundingBox, or an array of commands. - */ - Path.prototype.extend = function (pathOrCommands) { - if (pathOrCommands.commands) { - pathOrCommands = pathOrCommands.commands; - } else if (pathOrCommands instanceof BoundingBox) { - var box = pathOrCommands; - this.moveTo(box.x1, box.y1); - this.lineTo(box.x2, box.y1); - this.lineTo(box.x2, box.y2); - this.lineTo(box.x1, box.y2); - this.close(); - return; - } - Array.prototype.push.apply(this.commands, pathOrCommands); - }; - /** - * Calculate the bounding box of the path. - * @returns {opentype.BoundingBox} - */ - Path.prototype.getBoundingBox = function () { - var this$1 = this; - var box = new BoundingBox(); - var startX = 0; - var startY = 0; - var prevX = 0; - var prevY = 0; - for (var i = 0; i < this.commands.length; i++) { - var cmd = this$1.commands[i]; - switch (cmd.type) { - case 'M': - box.addPoint(cmd.x, cmd.y); - startX = prevX = cmd.x; - startY = prevY = cmd.y; - break; - case 'L': - box.addPoint(cmd.x, cmd.y); - prevX = cmd.x; - prevY = cmd.y; - break; - case 'Q': - box.addQuad(prevX, prevY, cmd.x1, cmd.y1, cmd.x, cmd.y); - prevX = cmd.x; - prevY = cmd.y; - break; - case 'C': - box.addBezier(prevX, prevY, cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - prevX = cmd.x; - prevY = cmd.y; - break; - case 'Z': - prevX = startX; - prevY = startY; - break; - default: - throw new Error('Unexpected path command ' + cmd.type); - } - } - if (box.isEmpty()) { - box.addPoint(0, 0); - } - return box; - }; - /** - * Draw the path to a 2D context. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context. - */ - Path.prototype.draw = function (ctx) { - var this$1 = this; - ctx.beginPath(); - for (var i = 0; i < this.commands.length; i += 1) { - var cmd = this$1.commands[i]; - if (cmd.type === 'M') { - ctx.moveTo(cmd.x, cmd.y); - } else if (cmd.type === 'L') { - ctx.lineTo(cmd.x, cmd.y); - } else if (cmd.type === 'C') { - ctx.bezierCurveTo(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - } else if (cmd.type === 'Q') { - ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); - } else if (cmd.type === 'Z') { - ctx.closePath(); - } - } - if (this.fill) { - ctx.fillStyle = this.fill; - ctx.fill(); - } - if (this.stroke) { - ctx.strokeStyle = this.stroke; - ctx.lineWidth = this.strokeWidth; - ctx.stroke(); - } - }; - /** - * Convert the Path to a string of path data instructions - * See http://www.w3.org/TR/SVG/paths.html#PathData - * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values - * @return {string} - */ - Path.prototype.toPathData = function (decimalPlaces) { - var this$1 = this; - decimalPlaces = decimalPlaces !== undefined ? decimalPlaces : 2; - function floatToString(v) { - if (Math.round(v) === v) { - return '' + Math.round(v); - } else { - return v.toFixed(decimalPlaces); - } - } - function packValues() { - var arguments$1 = arguments; - var s = ''; - for (var i = 0; i < arguments.length; i += 1) { - var v = arguments$1[i]; - if (v >= 0 && i > 0) { - s += ' '; - } - s += floatToString(v); - } - return s; - } - var d = ''; - for (var i = 0; i < this.commands.length; i += 1) { - var cmd = this$1.commands[i]; - if (cmd.type === 'M') { - d += 'M' + packValues(cmd.x, cmd.y); - } else if (cmd.type === 'L') { - d += 'L' + packValues(cmd.x, cmd.y); - } else if (cmd.type === 'C') { - d += 'C' + packValues(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - } else if (cmd.type === 'Q') { - d += 'Q' + packValues(cmd.x1, cmd.y1, cmd.x, cmd.y); - } else if (cmd.type === 'Z') { - d += 'Z'; - } - } - return d; - }; - /** - * Convert the path to an SVG element, as a string. - * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values - * @return {string} - */ - Path.prototype.toSVG = function (decimalPlaces) { - var svg = '= 0 && v <= 255, 'Byte value should be between 0 and 255.'); - return [v]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.BYTE = constant(1); - /** - * Convert a 8-bit signed integer to a list of 1 byte. - * @param {string} - * @returns {Array} - */ - encode.CHAR = function (v) { - return [v.charCodeAt(0)]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.CHAR = constant(1); - /** - * Convert an ASCII string to a list of bytes. - * @param {string} - * @returns {Array} - */ - encode.CHARARRAY = function (v) { - var b = [ - ]; - for (var i = 0; i < v.length; i += 1) { - b[i] = v.charCodeAt(i); - } - return b; - }; - /** - * @param {Array} - * @returns {number} - */ - sizeOf.CHARARRAY = function (v) { - return v.length; - }; - /** - * Convert a 16-bit unsigned integer to a list of 2 bytes. - * @param {number} - * @returns {Array} - */ - encode.USHORT = function (v) { - return [v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.USHORT = constant(2); - /** - * Convert a 16-bit signed integer to a list of 2 bytes. - * @param {number} - * @returns {Array} - */ - encode.SHORT = function (v) { - // Two's complement - if (v >= LIMIT16) { - v = - (2 * LIMIT16 - v); - } - return [v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.SHORT = constant(2); - /** - * Convert a 24-bit unsigned integer to a list of 3 bytes. - * @param {number} - * @returns {Array} - */ - encode.UINT24 = function (v) { - return [v >> 16 & 255, - v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.UINT24 = constant(3); - /** - * Convert a 32-bit unsigned integer to a list of 4 bytes. - * @param {number} - * @returns {Array} - */ - encode.ULONG = function (v) { - return [v >> 24 & 255, - v >> 16 & 255, - v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.ULONG = constant(4); - /** - * Convert a 32-bit unsigned integer to a list of 4 bytes. - * @param {number} - * @returns {Array} - */ - encode.LONG = function (v) { - // Two's complement - if (v >= LIMIT32) { - v = - (2 * LIMIT32 - v); - } - return [v >> 24 & 255, - v >> 16 & 255, - v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.LONG = constant(4); - encode.FIXED = encode.ULONG; - sizeOf.FIXED = sizeOf.ULONG; - encode.FWORD = encode.SHORT; - sizeOf.FWORD = sizeOf.SHORT; - encode.UFWORD = encode.USHORT; - sizeOf.UFWORD = sizeOf.USHORT; - /** - * Convert a 32-bit Apple Mac timestamp integer to a list of 8 bytes, 64-bit timestamp. - * @param {number} - * @returns {Array} - */ - encode.LONGDATETIME = function (v) { - return [0, - 0, - 0, - 0, - v >> 24 & 255, - v >> 16 & 255, - v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.LONGDATETIME = constant(8); - /** - * Convert a 4-char tag to a list of 4 bytes. - * @param {string} - * @returns {Array} - */ - encode.TAG = function (v) { - check.argument(v.length === 4, 'Tag should be exactly 4 ASCII characters.'); - return [v.charCodeAt(0), - v.charCodeAt(1), - v.charCodeAt(2), - v.charCodeAt(3)]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.TAG = constant(4); - // CFF data types /////////////////////////////////////////////////////////// - encode.Card8 = encode.BYTE; - sizeOf.Card8 = sizeOf.BYTE; - encode.Card16 = encode.USHORT; - sizeOf.Card16 = sizeOf.USHORT; - encode.OffSize = encode.BYTE; - sizeOf.OffSize = sizeOf.BYTE; - encode.SID = encode.USHORT; - sizeOf.SID = sizeOf.USHORT; - // Convert a numeric operand or charstring number to a variable-size list of bytes. - /** - * Convert a numeric operand or charstring number to a variable-size list of bytes. - * @param {number} - * @returns {Array} - */ - encode.NUMBER = function (v) { - if (v >= - 107 && v <= 107) { - return [v + 139]; - } else if (v >= 108 && v <= 1131) { - v = v - 108; - return [(v >> 8) + 247, - v & 255]; - } else if (v >= - 1131 && v <= - 108) { - v = - v - 108; - return [(v >> 8) + 251, - v & 255]; - } else if (v >= - 32768 && v <= 32767) { - return encode.NUMBER16(v); - } else { - return encode.NUMBER32(v); - } - }; - /** - * @param {number} - * @returns {number} - */ - sizeOf.NUMBER = function (v) { - return encode.NUMBER(v).length; - }; - /** - * Convert a signed number between -32768 and +32767 to a three-byte value. - * This ensures we always use three bytes, but is not the most compact format. - * @param {number} - * @returns {Array} - */ - encode.NUMBER16 = function (v) { - return [28, - v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.NUMBER16 = constant(3); - /** - * Convert a signed number between -(2^31) and +(2^31-1) to a five-byte value. - * This is useful if you want to be sure you always use four bytes, - * at the expense of wasting a few bytes for smaller numbers. - * @param {number} - * @returns {Array} - */ - encode.NUMBER32 = function (v) { - return [29, - v >> 24 & 255, - v >> 16 & 255, - v >> 8 & 255, - v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.NUMBER32 = constant(5); - /** - * @param {number} - * @returns {Array} - */ - encode.REAL = function (v) { - var value = v.toString(); - // Some numbers use an epsilon to encode the value. (e.g. JavaScript will store 0.0000001 as 1e-7) - // This code converts it back to a number without the epsilon. - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); - if (m) { - var epsilon = parseFloat('1e' + ((m[2] ? + m[2] : 0) + m[1].length)); - value = (Math.round(v * epsilon) / epsilon).toString(); - } - var nibbles = ''; - for (var i = 0, ii = value.length; i < ii; i += 1) { - var c = value[i]; - if (c === 'e') { - nibbles += value[++i] === '-' ? 'c' : 'b'; - } else if (c === '.') { - nibbles += 'a'; - } else if (c === '-') { - nibbles += 'e'; - } else { - nibbles += c; - } - } - nibbles += nibbles.length & 1 ? 'f' : 'ff'; - var out = [ - 30 - ]; - for (var i$1 = 0, ii$1 = nibbles.length; i$1 < ii$1; i$1 += 2) { - out.push(parseInt(nibbles.substr(i$1, 2), 16)); - } - return out; - }; - /** - * @param {number} - * @returns {number} - */ - sizeOf.REAL = function (v) { - return encode.REAL(v).length; - }; - encode.NAME = encode.CHARARRAY; - sizeOf.NAME = sizeOf.CHARARRAY; - encode.STRING = encode.CHARARRAY; - sizeOf.STRING = sizeOf.CHARARRAY; - /** - * @param {DataView} data - * @param {number} offset - * @param {number} numBytes - * @returns {string} - */ - decode.UTF8 = function (data, offset, numBytes) { - var codePoints = [ - ]; - var numChars = numBytes; - for (var j = 0; j < numChars; j++, offset += 1) { - codePoints[j] = data.getUint8(offset); - } - return String.fromCharCode.apply(null, codePoints); - }; - /** - * @param {DataView} data - * @param {number} offset - * @param {number} numBytes - * @returns {string} - */ - decode.UTF16 = function (data, offset, numBytes) { - var codePoints = [ - ]; - var numChars = numBytes / 2; - for (var j = 0; j < numChars; j++, offset += 2) { - codePoints[j] = data.getUint16(offset); - } - return String.fromCharCode.apply(null, codePoints); - }; - /** - * Convert a JavaScript string to UTF16-BE. - * @param {string} - * @returns {Array} - */ - encode.UTF16 = function (v) { - var b = [ - ]; - for (var i = 0; i < v.length; i += 1) { - var codepoint = v.charCodeAt(i); - b[b.length] = codepoint >> 8 & 255; - b[b.length] = codepoint & 255; - } - return b; - }; - /** - * @param {string} - * @returns {number} - */ - sizeOf.UTF16 = function (v) { - return v.length * 2; - }; - // Data for converting old eight-bit Macintosh encodings to Unicode. - // This representation is optimized for decoding; encoding is slower - // and needs more memory. The assumption is that all opentype.js users - // want to open fonts, but saving a font will be comparatively rare - // so it can be more expensive. Keyed by IANA character set name. - // - // Python script for generating these strings: - // - // s = u''.join([chr(c).decode('mac_greek') for c in range(128, 256)]) - // print(s.encode('utf-8')) - /** - * @private - */ - var eightBitMacEncodings = { - 'x-mac-croatian': // Python: 'mac_croatian' - 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø' + '¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ', - 'x-mac-cyrillic': // Python: 'mac_cyrillic' - 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњ' + 'јЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю', - 'x-mac-gaelic': // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/GAELIC.TXT - 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæø' + 'ṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ', - 'x-mac-greek': // Python: 'mac_greek' - 'Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩ' + 'άΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­', - 'x-mac-icelandic': // Python: 'mac_iceland' - 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ', - 'x-mac-inuit': // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/INUIT.TXT - 'ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗ' + 'ᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł', - 'x-mac-ce': // Python: 'mac_latin2' - 'ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅ' + 'ņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ', - macintosh: // Python: 'mac_roman' - 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ', - 'x-mac-romanian': // Python: 'mac_romanian' - 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ', - 'x-mac-turkish': // Python: 'mac_turkish' - 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ' - }; - /** - * Decodes an old-style Macintosh string. Returns either a Unicode JavaScript - * string, or 'undefined' if the encoding is unsupported. For example, we do - * not support Chinese, Japanese or Korean because these would need large - * mapping tables. - * @param {DataView} dataView - * @param {number} offset - * @param {number} dataLength - * @param {string} encoding - * @returns {string} - */ - decode.MACSTRING = function (dataView, offset, dataLength, encoding) { - var table = eightBitMacEncodings[encoding]; - if (table === undefined) { - return undefined; - } - var result = ''; - for (var i = 0; i < dataLength; i++) { - var c = dataView.getUint8(offset + i); - // In all eight-bit Mac encodings, the characters 0x00..0x7F are - // mapped to U+0000..U+007F; we only need to look up the others. - if (c <= 127) { - result += String.fromCharCode(c); - } else { - result += table[c & 127]; - } - } - return result; - }; - // Helper function for encode.MACSTRING. Returns a dictionary for mapping - // Unicode character codes to their 8-bit MacOS equivalent. This table - // is not exactly a super cheap data structure, but we do not care because - // encoding Macintosh strings is only rarely needed in typical applications. - var macEncodingTableCache = typeof WeakMap === 'function' && new WeakMap(); - var macEncodingCacheKeys; - var getMacEncodingTable = function (encoding) { - // Since we use encoding as a cache key for WeakMap, it has to be - // a String object and not a literal. And at least on NodeJS 2.10.1, - // WeakMap requires that the same String instance is passed for cache hits. - if (!macEncodingCacheKeys) { - macEncodingCacheKeys = { - }; - for (var e in eightBitMacEncodings) { - /*jshint -W053 */ // Suppress "Do not use String as a constructor." - macEncodingCacheKeys[e] = new String(e); - } - } - var cacheKey = macEncodingCacheKeys[encoding]; - if (cacheKey === undefined) { - return undefined; - } // We can't do "if (cache.has(key)) {return cache.get(key)}" here: - // since garbage collection may run at any time, it could also kick in - // between the calls to cache.has() and cache.get(). In that case, - // we would return 'undefined' even though we do support the encoding. - - if (macEncodingTableCache) { - var cachedTable = macEncodingTableCache.get(cacheKey); - if (cachedTable !== undefined) { - return cachedTable; - } - } - var decodingTable = eightBitMacEncodings[encoding]; - if (decodingTable === undefined) { - return undefined; - } - var encodingTable = { - }; - for (var i = 0; i < decodingTable.length; i++) { - encodingTable[decodingTable.charCodeAt(i)] = i + 128; - } - if (macEncodingTableCache) { - macEncodingTableCache.set(cacheKey, encodingTable); - } - return encodingTable; - }; - /** - * Encodes an old-style Macintosh string. Returns a byte array upon success. - * If the requested encoding is unsupported, or if the input string contains - * a character that cannot be expressed in the encoding, the function returns - * 'undefined'. - * @param {string} str - * @param {string} encoding - * @returns {Array} - */ - encode.MACSTRING = function (str, encoding) { - var table = getMacEncodingTable(encoding); - if (table === undefined) { - return undefined; - } - var result = [ - ]; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - // In all eight-bit Mac encodings, the characters 0x00..0x7F are - // mapped to U+0000..U+007F; we only need to look up the others. - if (c >= 128) { - c = table[c]; - if (c === undefined) { - // str contains a Unicode character that cannot be encoded - // in the requested encoding. - return undefined; - } - } - result[i] = c; - // result.push(c); - } - return result; - }; - /** - * @param {string} str - * @param {string} encoding - * @returns {number} - */ - sizeOf.MACSTRING = function (str, encoding) { - var b = encode.MACSTRING(str, encoding); - if (b !== undefined) { - return b.length; - } else { - return 0; - } - }; - // Helper for encode.VARDELTAS - function isByteEncodable(value) { - return value >= - 128 && value <= 127; - } // Helper for encode.VARDELTAS - - function encodeVarDeltaRunAsZeroes(deltas, pos, result) { - var runLength = 0; - var numDeltas = deltas.length; - while (pos < numDeltas && runLength < 64 && deltas[pos] === 0) { - ++pos; - ++runLength; - } - result.push(128 | runLength - 1); - return pos; - } // Helper for encode.VARDELTAS - - function encodeVarDeltaRunAsBytes(deltas, offset, result) { - var runLength = 0; - var numDeltas = deltas.length; - var pos = offset; - while (pos < numDeltas && runLength < 64) { - var value = deltas[pos]; - if (!isByteEncodable(value)) { - break; - } // Within a byte-encoded run of deltas, a single zero is best - // stored literally as 0x00 value. However, if we have two or - // more zeroes in a sequence, it is better to start a new run. - // Fore example, the sequence of deltas [15, 15, 0, 15, 15] - // becomes 6 bytes (04 0F 0F 00 0F 0F) when storing the zero - // within the current run, but 7 bytes (01 0F 0F 80 01 0F 0F) - // when starting a new run. - - if (value === 0 && pos + 1 < numDeltas && deltas[pos + 1] === 0) { - break; - } - ++pos; - ++runLength; - } - result.push(runLength - 1); - for (var i = offset; i < pos; ++i) { - result.push(deltas[i] + 256 & 255); - } - return pos; - } // Helper for encode.VARDELTAS - - function encodeVarDeltaRunAsWords(deltas, offset, result) { - var runLength = 0; - var numDeltas = deltas.length; - var pos = offset; - while (pos < numDeltas && runLength < 64) { - var value = deltas[pos]; - // Within a word-encoded run of deltas, it is easiest to start - // a new run (with a different encoding) whenever we encounter - // a zero value. For example, the sequence [0x6666, 0, 0x7777] - // needs 7 bytes when storing the zero inside the current run - // (42 66 66 00 00 77 77), and equally 7 bytes when starting a - // new run (40 66 66 80 40 77 77). - if (value === 0) { - break; - } // Within a word-encoded run of deltas, a single value in the - // range (-128..127) should be encoded within the current run - // because it is more compact. For example, the sequence - // [0x6666, 2, 0x7777] becomes 7 bytes when storing the value - // literally (42 66 66 00 02 77 77), but 8 bytes when starting - // a new run (40 66 66 00 02 40 77 77). - - if (isByteEncodable(value) && pos + 1 < numDeltas && isByteEncodable(deltas[pos + 1])) { - break; - } - ++pos; - ++runLength; - } - result.push(64 | runLength - 1); - for (var i = offset; i < pos; ++i) { - var val = deltas[i]; - result.push(val + 65536 >> 8 & 255, val + 256 & 255); - } - return pos; - } /** - * Encode a list of variation adjustment deltas. - * - * Variation adjustment deltas are used in ‘gvar’ and ‘cvar’ tables. - * They indicate how points (in ‘gvar’) or values (in ‘cvar’) get adjusted - * when generating instances of variation fonts. - * - * @see https://www.microsoft.com/typography/otspec/gvar.htm - * @see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gvar.html - * @param {Array} - * @return {Array} - */ - - encode.VARDELTAS = function (deltas) { - var pos = 0; - var result = [ - ]; - while (pos < deltas.length) { - var value = deltas[pos]; - if (value === 0) { - pos = encodeVarDeltaRunAsZeroes(deltas, pos, result); - } else if (value >= - 128 && value <= 127) { - pos = encodeVarDeltaRunAsBytes(deltas, pos, result); - } else { - pos = encodeVarDeltaRunAsWords(deltas, pos, result); - } - } - return result; - }; - // Convert a list of values to a CFF INDEX structure. - // The values should be objects containing name / type / value. - /** - * @param {Array} l - * @returns {Array} - */ - encode.INDEX = function (l) { - //var offset, offsets, offsetEncoder, encodedOffsets, encodedOffset, data, - // i, v; - // Because we have to know which data type to use to encode the offsets, - // we have to go through the values twice: once to encode the data and - // calculate the offsets, then again to encode the offsets using the fitting data type. - var offset = 1; // First offset is always 1. - var offsets = [ - offset - ]; - var data = [ - ]; - for (var i = 0; i < l.length; i += 1) { - var v = encode.OBJECT(l[i]); - Array.prototype.push.apply(data, v); - offset += v.length; - offsets.push(offset); - } - if (data.length === 0) { - return [0, - 0]; - } - var encodedOffsets = [ - ]; - var offSize = 1 + Math.floor(Math.log(offset) / Math.log(2)) / 8 | 0; - var offsetEncoder = [ - undefined, - encode.BYTE, - encode.USHORT, - encode.UINT24, - encode.ULONG - ][offSize]; - for (var i$1 = 0; i$1 < offsets.length; i$1 += 1) { - var encodedOffset = offsetEncoder(offsets[i$1]); - Array.prototype.push.apply(encodedOffsets, encodedOffset); - } - return Array.prototype.concat(encode.Card16(l.length), encode.OffSize(offSize), encodedOffsets, data); - }; - /** - * @param {Array} - * @returns {number} - */ - sizeOf.INDEX = function (v) { - return encode.INDEX(v).length; - }; - /** - * Convert an object to a CFF DICT structure. - * The keys should be numeric. - * The values should be objects containing name / type / value. - * @param {Object} m - * @returns {Array} - */ - encode.DICT = function (m) { - var d = [ - ]; - var keys = Object.keys(m); - var length = keys.length; - for (var i = 0; i < length; i += 1) { - // Object.keys() return string keys, but our keys are always numeric. - var k = parseInt(keys[i], 0); - var v = m[k]; - // Value comes before the key. - d = d.concat(encode.OPERAND(v.value, v.type)); - d = d.concat(encode.OPERATOR(k)); - } - return d; - }; - /** - * @param {Object} - * @returns {number} - */ - sizeOf.DICT = function (m) { - return encode.DICT(m).length; - }; - /** - * @param {number} - * @returns {Array} - */ - encode.OPERATOR = function (v) { - if (v < 1200) { - return [v]; - } else { - return [12, - v - 1200]; - } - }; - /** - * @param {Array} v - * @param {string} - * @returns {Array} - */ - encode.OPERAND = function (v, type) { - var d = [ - ]; - if (Array.isArray(type)) { - for (var i = 0; i < type.length; i += 1) { - check.argument(v.length === type.length, 'Not enough arguments given for type' + type); - d = d.concat(encode.OPERAND(v[i], type[i])); - } - } else { - if (type === 'SID') { - d = d.concat(encode.NUMBER(v)); - } else if (type === 'offset') { - // We make it easy for ourselves and always encode offsets as - // 4 bytes. This makes offset calculation for the top dict easier. - d = d.concat(encode.NUMBER32(v)); - } else if (type === 'number') { - d = d.concat(encode.NUMBER(v)); - } else if (type === 'real') { - d = d.concat(encode.REAL(v)); - } else { - throw new Error('Unknown operand type ' + type); - // FIXME Add support for booleans - } - } - return d; - }; - encode.OP = encode.BYTE; - sizeOf.OP = sizeOf.BYTE; - // memoize charstring encoding using WeakMap if available - var wmm = typeof WeakMap === 'function' && new WeakMap(); - /** - * Convert a list of CharString operations to bytes. - * @param {Array} - * @returns {Array} - */ - encode.CHARSTRING = function (ops) { - // See encode.MACSTRING for why we don't do "if (wmm && wmm.has(ops))". - if (wmm) { - var cachedValue = wmm.get(ops); - if (cachedValue !== undefined) { - return cachedValue; - } - } - var d = [ - ]; - var length = ops.length; - for (var i = 0; i < length; i += 1) { - var op = ops[i]; - d = d.concat(encode[op.type](op.value)); - } - if (wmm) { - wmm.set(ops, d); - } - return d; - }; - /** - * @param {Array} - * @returns {number} - */ - sizeOf.CHARSTRING = function (ops) { - return encode.CHARSTRING(ops).length; - }; - // Utility functions //////////////////////////////////////////////////////// - /** - * Convert an object containing name / type / value to bytes. - * @param {Object} - * @returns {Array} - */ - encode.OBJECT = function (v) { - var encodingFunction = encode[v.type]; - check.argument(encodingFunction !== undefined, 'No encoding function for type ' + v.type); - return encodingFunction(v.value); - }; - /** - * @param {Object} - * @returns {number} - */ - sizeOf.OBJECT = function (v) { - var sizeOfFunction = sizeOf[v.type]; - check.argument(sizeOfFunction !== undefined, 'No sizeOf function for type ' + v.type); - return sizeOfFunction(v.value); - }; - /** - * Convert a table object to bytes. - * A table contains a list of fields containing the metadata (name, type and default value). - * The table itself has the field values set as attributes. - * @param {opentype.Table} - * @returns {Array} - */ - encode.TABLE = function (table) { - var d = [ - ]; - var length = table.fields.length; - var subtables = [ - ]; - var subtableOffsets = [ - ]; - for (var i = 0; i < length; i += 1) { - var field = table.fields[i]; - var encodingFunction = encode[field.type]; - check.argument(encodingFunction !== undefined, 'No encoding function for field type ' + field.type + ' (' + field.name + ')'); - var value = table[field.name]; - if (value === undefined) { - value = field.value; - } - var bytes = encodingFunction(value); - if (field.type === 'TABLE') { - subtableOffsets.push(d.length); - d = d.concat([0, - 0]); - subtables.push(bytes); - } else { - d = d.concat(bytes); - } - } - for (var i$1 = 0; i$1 < subtables.length; i$1 += 1) { - var o = subtableOffsets[i$1]; - var offset = d.length; - check.argument(offset < 65536, 'Table ' + table.tableName + ' too big.'); - d[o] = offset >> 8; - d[o + 1] = offset & 255; - d = d.concat(subtables[i$1]); - } - return d; - }; - /** - * @param {opentype.Table} - * @returns {number} - */ - sizeOf.TABLE = function (table) { - var numBytes = 0; - var length = table.fields.length; - for (var i = 0; i < length; i += 1) { - var field = table.fields[i]; - var sizeOfFunction = sizeOf[field.type]; - check.argument(sizeOfFunction !== undefined, 'No sizeOf function for field type ' + field.type + ' (' + field.name + ')'); - var value = table[field.name]; - if (value === undefined) { - value = field.value; - } - numBytes += sizeOfFunction(value); - // Subtables take 2 more bytes for offsets. - if (field.type === 'TABLE') { - numBytes += 2; - } - } - return numBytes; - }; - encode.RECORD = encode.TABLE; - sizeOf.RECORD = sizeOf.TABLE; - // Merge in a list of bytes. - encode.LITERAL = function (v) { - return v; - }; - sizeOf.LITERAL = function (v) { - return v.length; - }; - // Table metadata - /** - * @exports opentype.Table - * @class - * @param {string} tableName - * @param {Array} fields - * @param {Object} options - * @constructor - */ - function Table(tableName, fields, options) { - var this$1 = this; - for (var i = 0; i < fields.length; i += 1) { - var field = fields[i]; - this$1[field.name] = field.value; - } - this.tableName = tableName; - this.fields = fields; - if (options) { - var optionKeys = Object.keys(options); - for (var i$1 = 0; i$1 < optionKeys.length; i$1 += 1) { - var k = optionKeys[i$1]; - var v = options[k]; - if (this$1[k] !== undefined) { - this$1[k] = v; - } - } - } - } /** - * Encodes the table and returns an array of bytes - * @return {Array} - */ - - Table.prototype.encode = function () { - return encode.TABLE(this); - }; - /** - * Get the size of the table. - * @return {number} - */ - Table.prototype.sizeOf = function () { - return sizeOf.TABLE(this); - }; - /** - * @private - */ - function ushortList(itemName, list, count) { - if (count === undefined) { - count = list.length; - } - var fields = new Array(list.length + 1); - fields[0] = { - name: itemName + 'Count', - type: 'USHORT', - value: count - }; - for (var i = 0; i < list.length; i++) { - fields[i + 1] = { - name: itemName + i, - type: 'USHORT', - value: list[i] - }; - } - return fields; - } /** - * @private - */ - - function tableList(itemName, records, itemCallback) { - var count = records.length; - var fields = new Array(count + 1); - fields[0] = { - name: itemName + 'Count', - type: 'USHORT', - value: count - }; - for (var i = 0; i < count; i++) { - fields[i + 1] = { - name: itemName + i, - type: 'TABLE', - value: itemCallback(records[i], i) - }; - } - return fields; - } /** - * @private - */ - - function recordList(itemName, records, itemCallback) { - var count = records.length; - var fields = [ - ]; - fields[0] = { - name: itemName + 'Count', - type: 'USHORT', - value: count - }; - for (var i = 0; i < count; i++) { - fields = fields.concat(itemCallback(records[i], i)); - } - return fields; - } // Common Layout Tables - /** - * @exports opentype.Coverage - * @class - * @param {opentype.Table} - * @constructor - * @extends opentype.Table - */ - - function Coverage(coverageTable) { - if (coverageTable.format === 1) { - Table.call(this, 'coverageTable', [ - { - name: 'coverageFormat', - type: 'USHORT', - value: 1 - } - ].concat(ushortList('glyph', coverageTable.glyphs))); - } else { - check.assert(false, 'Can\'t create coverage table format 2 yet.'); - } - } - Coverage.prototype = Object.create(Table.prototype); - Coverage.prototype.constructor = Coverage; - function ScriptList(scriptListTable) { - Table.call(this, 'scriptListTable', recordList('scriptRecord', scriptListTable, function (scriptRecord, i) { - var script = scriptRecord.script; - var defaultLangSys = script.defaultLangSys; - check.assert(!!defaultLangSys, 'Unable to write GSUB: script ' + scriptRecord.tag + ' has no default language system.'); - return [{ - name: 'scriptTag' + i, - type: 'TAG', - value: scriptRecord.tag - }, - { - name: 'script' + i, - type: 'TABLE', - value: new Table('scriptTable', [ - { - name: 'defaultLangSys', - type: 'TABLE', - value: new Table('defaultLangSys', [ - { - name: 'lookupOrder', - type: 'USHORT', - value: 0 - }, - { - name: 'reqFeatureIndex', - type: 'USHORT', - value: defaultLangSys.reqFeatureIndex - } - ].concat(ushortList('featureIndex', defaultLangSys.featureIndexes))) - } - ].concat(recordList('langSys', script.langSysRecords, function (langSysRecord, i) { - var langSys = langSysRecord.langSys; - return [{ - name: 'langSysTag' + i, - type: 'TAG', - value: langSysRecord.tag - }, - { - name: 'langSys' + i, - type: 'TABLE', - value: new Table('langSys', [ - { - name: 'lookupOrder', - type: 'USHORT', - value: 0 - }, - { - name: 'reqFeatureIndex', - type: 'USHORT', - value: langSys.reqFeatureIndex - } - ].concat(ushortList('featureIndex', langSys.featureIndexes))) - } - ]; - }))) - } - ]; - })); - } - ScriptList.prototype = Object.create(Table.prototype); - ScriptList.prototype.constructor = ScriptList; - /** - * @exports opentype.FeatureList - * @class - * @param {opentype.Table} - * @constructor - * @extends opentype.Table - */ - function FeatureList(featureListTable) { - Table.call(this, 'featureListTable', recordList('featureRecord', featureListTable, function (featureRecord, i) { - var feature = featureRecord.feature; - return [{ - name: 'featureTag' + i, - type: 'TAG', - value: featureRecord.tag - }, - { - name: 'feature' + i, - type: 'TABLE', - value: new Table('featureTable', [ - { - name: 'featureParams', - type: 'USHORT', - value: feature.featureParams - } - ].concat(ushortList('lookupListIndex', feature.lookupListIndexes))) - } - ]; - })); - } - FeatureList.prototype = Object.create(Table.prototype); - FeatureList.prototype.constructor = FeatureList; - /** - * @exports opentype.LookupList - * @class - * @param {opentype.Table} - * @param {Object} - * @constructor - * @extends opentype.Table - */ - function LookupList(lookupListTable, subtableMakers) { - Table.call(this, 'lookupListTable', tableList('lookup', lookupListTable, function (lookupTable) { - var subtableCallback = subtableMakers[lookupTable.lookupType]; - check.assert(!!subtableCallback, 'Unable to write GSUB lookup type ' + lookupTable.lookupType + ' tables.'); - return new Table('lookupTable', [ - { - name: 'lookupType', - type: 'USHORT', - value: lookupTable.lookupType - }, - { - name: 'lookupFlag', - type: 'USHORT', - value: lookupTable.lookupFlag - } - ].concat(tableList('subtable', lookupTable.subtables, subtableCallback))); - })); - } - LookupList.prototype = Object.create(Table.prototype); - LookupList.prototype.constructor = LookupList; - // Record = same as Table, but inlined (a Table has an offset and its data is further in the stream) - // Don't use offsets inside Records (probable bug), only in Tables. - var table = { - Table: Table, - Record: Table, - Coverage: Coverage, - ScriptList: ScriptList, - FeatureList: FeatureList, - LookupList: LookupList, - ushortList: ushortList, - tableList: tableList, - recordList: recordList - }; - // Parsing utility functions - // Retrieve an unsigned byte from the DataView. - function getByte(dataView, offset) { - return dataView.getUint8(offset); - } // Retrieve an unsigned 16-bit short from the DataView. - // The value is stored in big endian. - - function getUShort(dataView, offset) { - return dataView.getUint16(offset, false); - } // Retrieve a signed 16-bit short from the DataView. - // The value is stored in big endian. - - function getShort(dataView, offset) { - return dataView.getInt16(offset, false); - } // Retrieve an unsigned 32-bit long from the DataView. - // The value is stored in big endian. - - function getULong(dataView, offset) { - return dataView.getUint32(offset, false); - } // Retrieve a 32-bit signed fixed-point number (16.16) from the DataView. - // The value is stored in big endian. - - function getFixed(dataView, offset) { - var decimal = dataView.getInt16(offset, false); - var fraction = dataView.getUint16(offset + 2, false); - return decimal + fraction / 65535; - } // Retrieve a 4-character tag from the DataView. - // Tags are used to identify tables. - - function getTag(dataView, offset) { - var tag = ''; - for (var i = offset; i < offset + 4; i += 1) { - tag += String.fromCharCode(dataView.getInt8(i)); - } - return tag; - } // Retrieve an offset from the DataView. - // Offsets are 1 to 4 bytes in length, depending on the offSize argument. - - function getOffset(dataView, offset, offSize) { - var v = 0; - for (var i = 0; i < offSize; i += 1) { - v <<= 8; - v += dataView.getUint8(offset + i); - } - return v; - } // Retrieve a number of bytes from start offset to the end offset from the DataView. - - function getBytes(dataView, startOffset, endOffset) { - var bytes = [ - ]; - for (var i = startOffset; i < endOffset; i += 1) { - bytes.push(dataView.getUint8(i)); - } - return bytes; - } // Convert the list of bytes to a string. - - function bytesToString(bytes) { - var s = ''; - for (var i = 0; i < bytes.length; i += 1) { - s += String.fromCharCode(bytes[i]); - } - return s; - } - var typeOffsets = { - byte: 1, - uShort: 2, - short: 2, - uLong: 4, - fixed: 4, - longDateTime: 8, - tag: 4 - }; - // A stateful parser that changes the offset whenever a value is retrieved. - // The data is a DataView. - function Parser(data, offset) { - this.data = data; - this.offset = offset; - this.relativeOffset = 0; - } - Parser.prototype.parseByte = function () { - var v = this.data.getUint8(this.offset + this.relativeOffset); - this.relativeOffset += 1; - return v; - }; - Parser.prototype.parseChar = function () { - var v = this.data.getInt8(this.offset + this.relativeOffset); - this.relativeOffset += 1; - return v; - }; - Parser.prototype.parseCard8 = Parser.prototype.parseByte; - Parser.prototype.parseUShort = function () { - var v = this.data.getUint16(this.offset + this.relativeOffset); - this.relativeOffset += 2; - return v; - }; - Parser.prototype.parseCard16 = Parser.prototype.parseUShort; - Parser.prototype.parseSID = Parser.prototype.parseUShort; - Parser.prototype.parseOffset16 = Parser.prototype.parseUShort; - Parser.prototype.parseShort = function () { - var v = this.data.getInt16(this.offset + this.relativeOffset); - this.relativeOffset += 2; - return v; - }; - Parser.prototype.parseF2Dot14 = function () { - var v = this.data.getInt16(this.offset + this.relativeOffset) / 16384; - this.relativeOffset += 2; - return v; - }; - Parser.prototype.parseULong = function () { - var v = getULong(this.data, this.offset + this.relativeOffset); - this.relativeOffset += 4; - return v; - }; - Parser.prototype.parseOffset32 = Parser.prototype.parseULong; - Parser.prototype.parseFixed = function () { - var v = getFixed(this.data, this.offset + this.relativeOffset); - this.relativeOffset += 4; - return v; - }; - Parser.prototype.parseString = function (length) { - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - var string = ''; - this.relativeOffset += length; - for (var i = 0; i < length; i++) { - string += String.fromCharCode(dataView.getUint8(offset + i)); - } - return string; - }; - Parser.prototype.parseTag = function () { - return this.parseString(4); - }; - // LONGDATETIME is a 64-bit integer. - // JavaScript and unix timestamps traditionally use 32 bits, so we - // only take the last 32 bits. - // + Since until 2038 those bits will be filled by zeros we can ignore them. - Parser.prototype.parseLongDateTime = function () { - var v = getULong(this.data, this.offset + this.relativeOffset + 4); - // Subtract seconds between 01/01/1904 and 01/01/1970 - // to convert Apple Mac timestamp to Standard Unix timestamp - v -= 2082844800; - this.relativeOffset += 8; - return v; - }; - Parser.prototype.parseVersion = function (minorBase) { - var major = getUShort(this.data, this.offset + this.relativeOffset); - // How to interpret the minor version is very vague in the spec. 0x5000 is 5, 0x1000 is 1 - // Default returns the correct number if minor = 0xN000 where N is 0-9 - // Set minorBase to 1 for tables that use minor = N where N is 0-9 - var minor = getUShort(this.data, this.offset + this.relativeOffset + 2); - this.relativeOffset += 4; - if (minorBase === undefined) { - minorBase = 4096; - } - return major + minor / minorBase / 10; - }; - Parser.prototype.skip = function (type, amount) { - if (amount === undefined) { - amount = 1; - } - this.relativeOffset += typeOffsets[type] * amount; - }; - ///// Parsing lists and records /////////////////////////////// - // Parse a list of 32 bit unsigned integers. - Parser.prototype.parseULongList = function (count) { - if (count === undefined) { - count = this.parseULong(); - } - var offsets = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - offsets[i] = dataView.getUint32(offset); - offset += 4; - } - this.relativeOffset += count * 4; - return offsets; - }; - // Parse a list of 16 bit unsigned integers. The length of the list can be read on the stream - // or provided as an argument. - Parser.prototype.parseOffset16List = Parser.prototype.parseUShortList = function (count) { - if (count === undefined) { - count = this.parseUShort(); - } - var offsets = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - offsets[i] = dataView.getUint16(offset); - offset += 2; - } - this.relativeOffset += count * 2; - return offsets; - }; - // Parses a list of 16 bit signed integers. - Parser.prototype.parseShortList = function (count) { - var list = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - list[i] = dataView.getInt16(offset); - offset += 2; - } - this.relativeOffset += count * 2; - return list; - }; - // Parses a list of bytes. - Parser.prototype.parseByteList = function (count) { - var list = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - list[i] = dataView.getUint8(offset++); - } - this.relativeOffset += count; - return list; - }; - /** - * Parse a list of items. - * Record count is optional, if omitted it is read from the stream. - * itemCallback is one of the Parser methods. - */ - Parser.prototype.parseList = function (count, itemCallback) { - var this$1 = this; - if (!itemCallback) { - itemCallback = count; - count = this.parseUShort(); - } - var list = new Array(count); - for (var i = 0; i < count; i++) { - list[i] = itemCallback.call(this$1); - } - return list; - }; - Parser.prototype.parseList32 = function (count, itemCallback) { - var this$1 = this; - if (!itemCallback) { - itemCallback = count; - count = this.parseULong(); - } - var list = new Array(count); - for (var i = 0; i < count; i++) { - list[i] = itemCallback.call(this$1); - } - return list; - }; - /** - * Parse a list of records. - * Record count is optional, if omitted it is read from the stream. - * Example of recordDescription: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } - */ - Parser.prototype.parseRecordList = function (count, recordDescription) { - var this$1 = this; - // If the count argument is absent, read it in the stream. - if (!recordDescription) { - recordDescription = count; - count = this.parseUShort(); - } - var records = new Array(count); - var fields = Object.keys(recordDescription); - for (var i = 0; i < count; i++) { - var rec = { - }; - for (var j = 0; j < fields.length; j++) { - var fieldName = fields[j]; - var fieldType = recordDescription[fieldName]; - rec[fieldName] = fieldType.call(this$1); - } - records[i] = rec; - } - return records; - }; - Parser.prototype.parseRecordList32 = function (count, recordDescription) { - var this$1 = this; - // If the count argument is absent, read it in the stream. - if (!recordDescription) { - recordDescription = count; - count = this.parseULong(); - } - var records = new Array(count); - var fields = Object.keys(recordDescription); - for (var i = 0; i < count; i++) { - var rec = { - }; - for (var j = 0; j < fields.length; j++) { - var fieldName = fields[j]; - var fieldType = recordDescription[fieldName]; - rec[fieldName] = fieldType.call(this$1); - } - records[i] = rec; - } - return records; - }; - // Parse a data structure into an object - // Example of description: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } - Parser.prototype.parseStruct = function (description) { - var this$1 = this; - if (typeof description === 'function') { - return description.call(this); - } else { - var fields = Object.keys(description); - var struct = { - }; - for (var j = 0; j < fields.length; j++) { - var fieldName = fields[j]; - var fieldType = description[fieldName]; - struct[fieldName] = fieldType.call(this$1); - } - return struct; - } - }; - /** - * Parse a GPOS valueRecord - * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record - * valueFormat is optional, if omitted it is read from the stream. - */ - Parser.prototype.parseValueRecord = function (valueFormat) { - if (valueFormat === undefined) { - valueFormat = this.parseUShort(); - } - if (valueFormat === 0) { - // valueFormat2 in kerning pairs is most often 0 - // in this case return undefined instead of an empty object, to save space - return; - } - var valueRecord = { - }; - if (valueFormat & 1) { - valueRecord.xPlacement = this.parseShort(); - } - if (valueFormat & 2) { - valueRecord.yPlacement = this.parseShort(); - } - if (valueFormat & 4) { - valueRecord.xAdvance = this.parseShort(); - } - if (valueFormat & 8) { - valueRecord.yAdvance = this.parseShort(); - } // Device table (non-variable font) / VariationIndex table (variable font) not supported - // https://docs.microsoft.com/fr-fr/typography/opentype/spec/chapter2#devVarIdxTbls - - if (valueFormat & 16) { - valueRecord.xPlaDevice = undefined; - this.parseShort(); - } - if (valueFormat & 32) { - valueRecord.yPlaDevice = undefined; - this.parseShort(); - } - if (valueFormat & 64) { - valueRecord.xAdvDevice = undefined; - this.parseShort(); - } - if (valueFormat & 128) { - valueRecord.yAdvDevice = undefined; - this.parseShort(); - } - return valueRecord; - }; - /** - * Parse a list of GPOS valueRecords - * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record - * valueFormat and valueCount are read from the stream. - */ - Parser.prototype.parseValueRecordList = function () { - var this$1 = this; - var valueFormat = this.parseUShort(); - var valueCount = this.parseUShort(); - var values = new Array(valueCount); - for (var i = 0; i < valueCount; i++) { - values[i] = this$1.parseValueRecord(valueFormat); - } - return values; - }; - Parser.prototype.parsePointer = function (description) { - var structOffset = this.parseOffset16(); - if (structOffset > 0) { - // NULL offset => return undefined - return new Parser(this.data, this.offset + structOffset).parseStruct(description); - } - return undefined; - }; - Parser.prototype.parsePointer32 = function (description) { - var structOffset = this.parseOffset32(); - if (structOffset > 0) { - // NULL offset => return undefined - return new Parser(this.data, this.offset + structOffset).parseStruct(description); - } - return undefined; - }; - /** - * Parse a list of offsets to lists of 16-bit integers, - * or a list of offsets to lists of offsets to any kind of items. - * If itemCallback is not provided, a list of list of UShort is assumed. - * If provided, itemCallback is called on each item and must parse the item. - * See examples in tables/gsub.js - */ - Parser.prototype.parseListOfLists = function (itemCallback) { - var this$1 = this; - var offsets = this.parseOffset16List(); - var count = offsets.length; - var relativeOffset = this.relativeOffset; - var list = new Array(count); - for (var i = 0; i < count; i++) { - var start = offsets[i]; - if (start === 0) { - // NULL offset - // Add i as owned property to list. Convenient with assert. - list[i] = undefined; - continue; - } - this$1.relativeOffset = start; - if (itemCallback) { - var subOffsets = this$1.parseOffset16List(); - var subList = new Array(subOffsets.length); - for (var j = 0; j < subOffsets.length; j++) { - this$1.relativeOffset = start + subOffsets[j]; - subList[j] = itemCallback.call(this$1); - } - list[i] = subList; - } else { - list[i] = this$1.parseUShortList(); - } - } - this.relativeOffset = relativeOffset; - return list; - }; - ///// Complex tables parsing ////////////////////////////////// - // Parse a coverage table in a GSUB, GPOS or GDEF table. - // https://www.microsoft.com/typography/OTSPEC/chapter2.htm - // parser.offset must point to the start of the table containing the coverage. - Parser.prototype.parseCoverage = function () { - var this$1 = this; - var startOffset = this.offset + this.relativeOffset; - var format = this.parseUShort(); - var count = this.parseUShort(); - if (format === 1) { - return { - format: 1, - glyphs: this.parseUShortList(count) - }; - } else if (format === 2) { - var ranges = new Array(count); - for (var i = 0; i < count; i++) { - ranges[i] = { - start: this$1.parseUShort(), - end: this$1.parseUShort(), - index: this$1.parseUShort() - }; - } - return { - format: 2, - ranges: ranges - }; - } - throw new Error('0x' + startOffset.toString(16) + ': Coverage format must be 1 or 2.'); - }; - // Parse a Class Definition Table in a GSUB, GPOS or GDEF table. - // https://www.microsoft.com/typography/OTSPEC/chapter2.htm - Parser.prototype.parseClassDef = function () { - var startOffset = this.offset + this.relativeOffset; - var format = this.parseUShort(); - if (format === 1) { - return { - format: 1, - startGlyph: this.parseUShort(), - classes: this.parseUShortList() - }; - } else if (format === 2) { - return { - format: 2, - ranges: this.parseRecordList({ - start: Parser.uShort, - end: Parser.uShort, - classId: Parser.uShort - }) - }; - } - throw new Error('0x' + startOffset.toString(16) + ': ClassDef format must be 1 or 2.'); - }; - ///// Static methods /////////////////////////////////// - // These convenience methods can be used as callbacks and should be called with "this" context set to a Parser instance. - Parser.list = function (count, itemCallback) { - return function () { - return this.parseList(count, itemCallback); - }; - }; - Parser.list32 = function (count, itemCallback) { - return function () { - return this.parseList32(count, itemCallback); - }; - }; - Parser.recordList = function (count, recordDescription) { - return function () { - return this.parseRecordList(count, recordDescription); - }; - }; - Parser.recordList32 = function (count, recordDescription) { - return function () { - return this.parseRecordList32(count, recordDescription); - }; - }; - Parser.pointer = function (description) { - return function () { - return this.parsePointer(description); - }; - }; - Parser.pointer32 = function (description) { - return function () { - return this.parsePointer32(description); - }; - }; - Parser.tag = Parser.prototype.parseTag; - Parser.byte = Parser.prototype.parseByte; - Parser.uShort = Parser.offset16 = Parser.prototype.parseUShort; - Parser.uShortList = Parser.prototype.parseUShortList; - Parser.uLong = Parser.offset32 = Parser.prototype.parseULong; - Parser.uLongList = Parser.prototype.parseULongList; - Parser.struct = Parser.prototype.parseStruct; - Parser.coverage = Parser.prototype.parseCoverage; - Parser.classDef = Parser.prototype.parseClassDef; - ///// Script, Feature, Lookup lists /////////////////////////////////////////////// - // https://www.microsoft.com/typography/OTSPEC/chapter2.htm - var langSysTable = { - reserved: Parser.uShort, - reqFeatureIndex: Parser.uShort, - featureIndexes: Parser.uShortList - }; - Parser.prototype.parseScriptList = function () { - return this.parsePointer(Parser.recordList({ - tag: Parser.tag, - script: Parser.pointer({ - defaultLangSys: Parser.pointer(langSysTable), - langSysRecords: Parser.recordList({ - tag: Parser.tag, - langSys: Parser.pointer(langSysTable) - }) - }) - })) || [ - ]; - }; - Parser.prototype.parseFeatureList = function () { - return this.parsePointer(Parser.recordList({ - tag: Parser.tag, - feature: Parser.pointer({ - featureParams: Parser.offset16, - lookupListIndexes: Parser.uShortList - }) - })) || [ - ]; - }; - Parser.prototype.parseLookupList = function (lookupTableParsers) { - return this.parsePointer(Parser.list(Parser.pointer(function () { - var lookupType = this.parseUShort(); - check.argument(1 <= lookupType && lookupType <= 9, 'GPOS/GSUB lookup type ' + lookupType + ' unknown.'); - var lookupFlag = this.parseUShort(); - var useMarkFilteringSet = lookupFlag & 16; - return { - lookupType: lookupType, - lookupFlag: lookupFlag, - subtables: this.parseList(Parser.pointer(lookupTableParsers[lookupType])), - markFilteringSet: useMarkFilteringSet ? this.parseUShort() : undefined - }; - }))) || [ - ]; - }; - Parser.prototype.parseFeatureVariationsList = function () { - return this.parsePointer32(function () { - var majorVersion = this.parseUShort(); - var minorVersion = this.parseUShort(); - check.argument(majorVersion === 1 && minorVersion < 1, 'GPOS/GSUB feature variations table unknown.'); - var featureVariations = this.parseRecordList32({ - conditionSetOffset: Parser.offset32, - featureTableSubstitutionOffset: Parser.offset32 - }); - return featureVariations; - }) || [ - ]; - }; - var parse = { - getByte: getByte, - getCard8: getByte, - getUShort: getUShort, - getCard16: getUShort, - getShort: getShort, - getULong: getULong, - getFixed: getFixed, - getTag: getTag, - getOffset: getOffset, - getBytes: getBytes, - bytesToString: bytesToString, - Parser: Parser - }; - // The `cmap` table stores the mappings from characters to glyphs. - function parseCmapTableFormat12(cmap, p) { - //Skip reserved. - p.parseUShort(); - // Length in bytes of the sub-tables. - cmap.length = p.parseULong(); - cmap.language = p.parseULong(); - var groupCount; - cmap.groupCount = groupCount = p.parseULong(); - cmap.glyphIndexMap = { - }; - for (var i = 0; i < groupCount; i += 1) { - var startCharCode = p.parseULong(); - var endCharCode = p.parseULong(); - var startGlyphId = p.parseULong(); - for (var c = startCharCode; c <= endCharCode; c += 1) { - cmap.glyphIndexMap[c] = startGlyphId; - startGlyphId++; - } - } - } - function parseCmapTableFormat4(cmap, p, data, start, offset) { - // Length in bytes of the sub-tables. - cmap.length = p.parseUShort(); - cmap.language = p.parseUShort(); - // segCount is stored x 2. - var segCount; - cmap.segCount = segCount = p.parseUShort() >> 1; - // Skip searchRange, entrySelector, rangeShift. - p.skip('uShort', 3); - // The "unrolled" mapping from character codes to glyph indices. - cmap.glyphIndexMap = { - }; - var endCountParser = new parse.Parser(data, start + offset + 14); - var startCountParser = new parse.Parser(data, start + offset + 16 + segCount * 2); - var idDeltaParser = new parse.Parser(data, start + offset + 16 + segCount * 4); - var idRangeOffsetParser = new parse.Parser(data, start + offset + 16 + segCount * 6); - var glyphIndexOffset = start + offset + 16 + segCount * 8; - for (var i = 0; i < segCount - 1; i += 1) { - var glyphIndex = void 0; - var endCount = endCountParser.parseUShort(); - var startCount = startCountParser.parseUShort(); - var idDelta = idDeltaParser.parseShort(); - var idRangeOffset = idRangeOffsetParser.parseUShort(); - for (var c = startCount; c <= endCount; c += 1) { - if (idRangeOffset !== 0) { - // The idRangeOffset is relative to the current position in the idRangeOffset array. - // Take the current offset in the idRangeOffset array. - glyphIndexOffset = idRangeOffsetParser.offset + idRangeOffsetParser.relativeOffset - 2; - // Add the value of the idRangeOffset, which will move us into the glyphIndex array. - glyphIndexOffset += idRangeOffset; - // Then add the character index of the current segment, multiplied by 2 for USHORTs. - glyphIndexOffset += (c - startCount) * 2; - glyphIndex = parse.getUShort(data, glyphIndexOffset); - if (glyphIndex !== 0) { - glyphIndex = glyphIndex + idDelta & 65535; - } - } else { - glyphIndex = c + idDelta & 65535; - } - cmap.glyphIndexMap[c] = glyphIndex; - } - } - } // Parse the `cmap` table. This table stores the mappings from characters to glyphs. - // There are many available formats, but we only support the Windows format 4 and 12. - // This function returns a `CmapEncoding` object or null if no supported format could be found. - - function parseCmapTable(data, start) { - var cmap = { - }; - cmap.version = parse.getUShort(data, start); - check.argument(cmap.version === 0, 'cmap table version should be 0.'); - // The cmap table can contain many sub-tables, each with their own format. - // We're only interested in a "platform 0" (Unicode format) and "platform 3" (Windows format) table. - cmap.numTables = parse.getUShort(data, start + 2); - var offset = - 1; - for (var i = cmap.numTables - 1; i >= 0; i -= 1) { - var platformId = parse.getUShort(data, start + 4 + i * 8); - var encodingId = parse.getUShort(data, start + 4 + i * 8 + 2); - if (platformId === 3 && (encodingId === 0 || encodingId === 1 || encodingId === 10) || platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 2 || encodingId === 3 || encodingId === 4)) { - offset = parse.getULong(data, start + 4 + i * 8 + 4); - break; - } - } - if (offset === - 1) { - // There is no cmap table in the font that we support. - throw new Error('No valid cmap sub-tables found.'); - } - var p = new parse.Parser(data, start + offset); - cmap.format = p.parseUShort(); - if (cmap.format === 12) { - parseCmapTableFormat12(cmap, p); - } else if (cmap.format === 4) { - parseCmapTableFormat4(cmap, p, data, start, offset); - } else { - throw new Error('Only format 4 and 12 cmap tables are supported (found format ' + cmap.format + ').'); - } - return cmap; - } - function addSegment(t, code, glyphIndex) { - t.segments.push({ - end: code, - start: code, - delta: - (code - glyphIndex), - offset: 0, - glyphIndex: glyphIndex - }); - } - function addTerminatorSegment(t) { - t.segments.push({ - end: 65535, - start: 65535, - delta: 1, - offset: 0 - }); - } // Make cmap table, format 4 by default, 12 if needed only - - function makeCmapTable(glyphs) { - // Plan 0 is the base Unicode Plan but emojis, for example are on another plan, and needs cmap 12 format (with 32bit) - var isPlan0Only = true; - var i; - // Check if we need to add cmap format 12 or if format 4 only is fine - for (i = glyphs.length - 1; i > 0; i -= 1) { - var g = glyphs.get(i); - if (g.unicode > 65535) { - console.log('Adding CMAP format 12 (needed!)'); - isPlan0Only = false; - break; - } - } - var cmapTable = [ - { - name: 'version', - type: 'USHORT', - value: 0 - }, - { - name: 'numTables', - type: 'USHORT', - value: isPlan0Only ? 1 : 2 - }, - // CMAP 4 header - { - name: 'platformID', - type: 'USHORT', - value: 3 - }, - { - name: 'encodingID', - type: 'USHORT', - value: 1 - }, - { - name: 'offset', - type: 'ULONG', - value: isPlan0Only ? 12 : 12 + 8 - } - ]; - if (!isPlan0Only) { - cmapTable = cmapTable.concat([ // CMAP 12 header - { - name: 'cmap12PlatformID', - type: 'USHORT', - value: 3 - }, - // We encode only for PlatformID = 3 (Windows) because it is supported everywhere - { - name: 'cmap12EncodingID', - type: 'USHORT', - value: 10 - }, - { - name: 'cmap12Offset', - type: 'ULONG', - value: 0 - } - ]); - } - cmapTable = cmapTable.concat([ // CMAP 4 Subtable - { - name: 'format', - type: 'USHORT', - value: 4 - }, - { - name: 'cmap4Length', - type: 'USHORT', - value: 0 - }, - { - name: 'language', - type: 'USHORT', - value: 0 - }, - { - name: 'segCountX2', - type: 'USHORT', - value: 0 - }, - { - name: 'searchRange', - type: 'USHORT', - value: 0 - }, - { - name: 'entrySelector', - type: 'USHORT', - value: 0 - }, - { - name: 'rangeShift', - type: 'USHORT', - value: 0 - } - ]); - var t = new table.Table('cmap', cmapTable); - t.segments = [ - ]; - for (i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - for (var j = 0; j < glyph.unicodes.length; j += 1) { - addSegment(t, glyph.unicodes[j], i); - } - t.segments = t.segments.sort(function (a, b) { - return a.start - b.start; - }); - } - addTerminatorSegment(t); - var segCount = t.segments.length; - var segCountToRemove = 0; - // CMAP 4 - // Set up parallel segment arrays. - var endCounts = [ - ]; - var startCounts = [ - ]; - var idDeltas = [ - ]; - var idRangeOffsets = [ - ]; - var glyphIds = [ - ]; - // CMAP 12 - var cmap12Groups = [ - ]; - // Reminder this loop is not following the specification at 100% - // The specification -> find suites of characters and make a group - // Here we're doing one group for each letter - // Doing as the spec can save 8 times (or more) space - for (i = 0; i < segCount; i += 1) { - var segment = t.segments[i]; - // CMAP 4 - if (segment.end <= 65535 && segment.start <= 65535) { - endCounts = endCounts.concat({ - name: 'end_' + i, - type: 'USHORT', - value: segment.end - }); - startCounts = startCounts.concat({ - name: 'start_' + i, - type: 'USHORT', - value: segment.start - }); - idDeltas = idDeltas.concat({ - name: 'idDelta_' + i, - type: 'SHORT', - value: segment.delta - }); - idRangeOffsets = idRangeOffsets.concat({ - name: 'idRangeOffset_' + i, - type: 'USHORT', - value: segment.offset - }); - if (segment.glyphId !== undefined) { - glyphIds = glyphIds.concat({ - name: 'glyph_' + i, - type: 'USHORT', - value: segment.glyphId - }); - } - } else { - // Skip Unicode > 65535 (16bit unsigned max) for CMAP 4, will be added in CMAP 12 - segCountToRemove += 1; - } // CMAP 12 - // Skip Terminator Segment - - if (!isPlan0Only && segment.glyphIndex !== undefined) { - cmap12Groups = cmap12Groups.concat({ - name: 'cmap12Start_' + i, - type: 'ULONG', - value: segment.start - }); - cmap12Groups = cmap12Groups.concat({ - name: 'cmap12End_' + i, - type: 'ULONG', - value: segment.end - }); - cmap12Groups = cmap12Groups.concat({ - name: 'cmap12Glyph_' + i, - type: 'ULONG', - value: segment.glyphIndex - }); - } - } // CMAP 4 Subtable - - t.segCountX2 = (segCount - segCountToRemove) * 2; - t.searchRange = Math.pow(2, Math.floor(Math.log(segCount - segCountToRemove) / Math.log(2))) * 2; - t.entrySelector = Math.log(t.searchRange / 2) / Math.log(2); - t.rangeShift = t.segCountX2 - t.searchRange; - t.fields = t.fields.concat(endCounts); - t.fields.push({ - name: 'reservedPad', - type: 'USHORT', - value: 0 - }); - t.fields = t.fields.concat(startCounts); - t.fields = t.fields.concat(idDeltas); - t.fields = t.fields.concat(idRangeOffsets); - t.fields = t.fields.concat(glyphIds); - t.cmap4Length = 14 + // Subtable header - endCounts.length * 2 + 2 + // reservedPad - startCounts.length * 2 + idDeltas.length * 2 + idRangeOffsets.length * 2 + glyphIds.length * 2; - if (!isPlan0Only) { - // CMAP 12 Subtable - var cmap12Length = 16 + // Subtable header - cmap12Groups.length * 4; - t.cmap12Offset = 12 + 2 * 2 + 4 + t.cmap4Length; - t.fields = t.fields.concat([{ - name: 'cmap12Format', - type: 'USHORT', - value: 12 - }, - { - name: 'cmap12Reserved', - type: 'USHORT', - value: 0 - }, - { - name: 'cmap12Length', - type: 'ULONG', - value: cmap12Length - }, - { - name: 'cmap12Language', - type: 'ULONG', - value: 0 - }, - { - name: 'cmap12nGroups', - type: 'ULONG', - value: cmap12Groups.length / 3 - } - ]); - t.fields = t.fields.concat(cmap12Groups); - } - return t; - } - var cmap = { - parse: parseCmapTable, - make: makeCmapTable - }; - // Glyph encoding - var cffStandardStrings = [ - '.notdef', - 'space', - 'exclam', - 'quotedbl', - 'numbersign', - 'dollar', - 'percent', - 'ampersand', - 'quoteright', - 'parenleft', - 'parenright', - 'asterisk', - 'plus', - 'comma', - 'hyphen', - 'period', - 'slash', - 'zero', - 'one', - 'two', - 'three', - 'four', - 'five', - 'six', - 'seven', - 'eight', - 'nine', - 'colon', - 'semicolon', - 'less', - 'equal', - 'greater', - 'question', - 'at', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - 'bracketleft', - 'backslash', - 'bracketright', - 'asciicircum', - 'underscore', - 'quoteleft', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - 'braceleft', - 'bar', - 'braceright', - 'asciitilde', - 'exclamdown', - 'cent', - 'sterling', - 'fraction', - 'yen', - 'florin', - 'section', - 'currency', - 'quotesingle', - 'quotedblleft', - 'guillemotleft', - 'guilsinglleft', - 'guilsinglright', - 'fi', - 'fl', - 'endash', - 'dagger', - 'daggerdbl', - 'periodcentered', - 'paragraph', - 'bullet', - 'quotesinglbase', - 'quotedblbase', - 'quotedblright', - 'guillemotright', - 'ellipsis', - 'perthousand', - 'questiondown', - 'grave', - 'acute', - 'circumflex', - 'tilde', - 'macron', - 'breve', - 'dotaccent', - 'dieresis', - 'ring', - 'cedilla', - 'hungarumlaut', - 'ogonek', - 'caron', - 'emdash', - 'AE', - 'ordfeminine', - 'Lslash', - 'Oslash', - 'OE', - 'ordmasculine', - 'ae', - 'dotlessi', - 'lslash', - 'oslash', - 'oe', - 'germandbls', - 'onesuperior', - 'logicalnot', - 'mu', - 'trademark', - 'Eth', - 'onehalf', - 'plusminus', - 'Thorn', - 'onequarter', - 'divide', - 'brokenbar', - 'degree', - 'thorn', - 'threequarters', - 'twosuperior', - 'registered', - 'minus', - 'eth', - 'multiply', - 'threesuperior', - 'copyright', - 'Aacute', - 'Acircumflex', - 'Adieresis', - 'Agrave', - 'Aring', - 'Atilde', - 'Ccedilla', - 'Eacute', - 'Ecircumflex', - 'Edieresis', - 'Egrave', - 'Iacute', - 'Icircumflex', - 'Idieresis', - 'Igrave', - 'Ntilde', - 'Oacute', - 'Ocircumflex', - 'Odieresis', - 'Ograve', - 'Otilde', - 'Scaron', - 'Uacute', - 'Ucircumflex', - 'Udieresis', - 'Ugrave', - 'Yacute', - 'Ydieresis', - 'Zcaron', - 'aacute', - 'acircumflex', - 'adieresis', - 'agrave', - 'aring', - 'atilde', - 'ccedilla', - 'eacute', - 'ecircumflex', - 'edieresis', - 'egrave', - 'iacute', - 'icircumflex', - 'idieresis', - 'igrave', - 'ntilde', - 'oacute', - 'ocircumflex', - 'odieresis', - 'ograve', - 'otilde', - 'scaron', - 'uacute', - 'ucircumflex', - 'udieresis', - 'ugrave', - 'yacute', - 'ydieresis', - 'zcaron', - 'exclamsmall', - 'Hungarumlautsmall', - 'dollaroldstyle', - 'dollarsuperior', - 'ampersandsmall', - 'Acutesmall', - 'parenleftsuperior', - 'parenrightsuperior', - '266 ff', - 'onedotenleader', - 'zerooldstyle', - 'oneoldstyle', - 'twooldstyle', - 'threeoldstyle', - 'fouroldstyle', - 'fiveoldstyle', - 'sixoldstyle', - 'sevenoldstyle', - 'eightoldstyle', - 'nineoldstyle', - 'commasuperior', - 'threequartersemdash', - 'periodsuperior', - 'questionsmall', - 'asuperior', - 'bsuperior', - 'centsuperior', - 'dsuperior', - 'esuperior', - 'isuperior', - 'lsuperior', - 'msuperior', - 'nsuperior', - 'osuperior', - 'rsuperior', - 'ssuperior', - 'tsuperior', - 'ff', - 'ffi', - 'ffl', - 'parenleftinferior', - 'parenrightinferior', - 'Circumflexsmall', - 'hyphensuperior', - 'Gravesmall', - 'Asmall', - 'Bsmall', - 'Csmall', - 'Dsmall', - 'Esmall', - 'Fsmall', - 'Gsmall', - 'Hsmall', - 'Ismall', - 'Jsmall', - 'Ksmall', - 'Lsmall', - 'Msmall', - 'Nsmall', - 'Osmall', - 'Psmall', - 'Qsmall', - 'Rsmall', - 'Ssmall', - 'Tsmall', - 'Usmall', - 'Vsmall', - 'Wsmall', - 'Xsmall', - 'Ysmall', - 'Zsmall', - 'colonmonetary', - 'onefitted', - 'rupiah', - 'Tildesmall', - 'exclamdownsmall', - 'centoldstyle', - 'Lslashsmall', - 'Scaronsmall', - 'Zcaronsmall', - 'Dieresissmall', - 'Brevesmall', - 'Caronsmall', - 'Dotaccentsmall', - 'Macronsmall', - 'figuredash', - 'hypheninferior', - 'Ogoneksmall', - 'Ringsmall', - 'Cedillasmall', - 'questiondownsmall', - 'oneeighth', - 'threeeighths', - 'fiveeighths', - 'seveneighths', - 'onethird', - 'twothirds', - 'zerosuperior', - 'foursuperior', - 'fivesuperior', - 'sixsuperior', - 'sevensuperior', - 'eightsuperior', - 'ninesuperior', - 'zeroinferior', - 'oneinferior', - 'twoinferior', - 'threeinferior', - 'fourinferior', - 'fiveinferior', - 'sixinferior', - 'seveninferior', - 'eightinferior', - 'nineinferior', - 'centinferior', - 'dollarinferior', - 'periodinferior', - 'commainferior', - 'Agravesmall', - 'Aacutesmall', - 'Acircumflexsmall', - 'Atildesmall', - 'Adieresissmall', - 'Aringsmall', - 'AEsmall', - 'Ccedillasmall', - 'Egravesmall', - 'Eacutesmall', - 'Ecircumflexsmall', - 'Edieresissmall', - 'Igravesmall', - 'Iacutesmall', - 'Icircumflexsmall', - 'Idieresissmall', - 'Ethsmall', - 'Ntildesmall', - 'Ogravesmall', - 'Oacutesmall', - 'Ocircumflexsmall', - 'Otildesmall', - 'Odieresissmall', - 'OEsmall', - 'Oslashsmall', - 'Ugravesmall', - 'Uacutesmall', - 'Ucircumflexsmall', - 'Udieresissmall', - 'Yacutesmall', - 'Thornsmall', - 'Ydieresissmall', - '001.000', - '001.001', - '001.002', - '001.003', - 'Black', - 'Bold', - 'Book', - 'Light', - 'Medium', - 'Regular', - 'Roman', - 'Semibold' - ]; - var cffStandardEncoding = [ - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - 'space', - 'exclam', - 'quotedbl', - 'numbersign', - 'dollar', - 'percent', - 'ampersand', - 'quoteright', - 'parenleft', - 'parenright', - 'asterisk', - 'plus', - 'comma', - 'hyphen', - 'period', - 'slash', - 'zero', - 'one', - 'two', - 'three', - 'four', - 'five', - 'six', - 'seven', - 'eight', - 'nine', - 'colon', - 'semicolon', - 'less', - 'equal', - 'greater', - 'question', - 'at', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - 'bracketleft', - 'backslash', - 'bracketright', - 'asciicircum', - 'underscore', - 'quoteleft', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - 'braceleft', - 'bar', - 'braceright', - 'asciitilde', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - 'exclamdown', - 'cent', - 'sterling', - 'fraction', - 'yen', - 'florin', - 'section', - 'currency', - 'quotesingle', - 'quotedblleft', - 'guillemotleft', - 'guilsinglleft', - 'guilsinglright', - 'fi', - 'fl', - '', - 'endash', - 'dagger', - 'daggerdbl', - 'periodcentered', - '', - 'paragraph', - 'bullet', - 'quotesinglbase', - 'quotedblbase', - 'quotedblright', - 'guillemotright', - 'ellipsis', - 'perthousand', - '', - 'questiondown', - '', - 'grave', - 'acute', - 'circumflex', - 'tilde', - 'macron', - 'breve', - 'dotaccent', - 'dieresis', - '', - 'ring', - 'cedilla', - '', - 'hungarumlaut', - 'ogonek', - 'caron', - 'emdash', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - 'AE', - '', - 'ordfeminine', - '', - '', - '', - '', - 'Lslash', - 'Oslash', - 'OE', - 'ordmasculine', - '', - '', - '', - '', - '', - 'ae', - '', - '', - '', - 'dotlessi', - '', - '', - 'lslash', - 'oslash', - 'oe', - 'germandbls' - ]; - var cffExpertEncoding = [ - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - 'space', - 'exclamsmall', - 'Hungarumlautsmall', - '', - 'dollaroldstyle', - 'dollarsuperior', - 'ampersandsmall', - 'Acutesmall', - 'parenleftsuperior', - 'parenrightsuperior', - 'twodotenleader', - 'onedotenleader', - 'comma', - 'hyphen', - 'period', - 'fraction', - 'zerooldstyle', - 'oneoldstyle', - 'twooldstyle', - 'threeoldstyle', - 'fouroldstyle', - 'fiveoldstyle', - 'sixoldstyle', - 'sevenoldstyle', - 'eightoldstyle', - 'nineoldstyle', - 'colon', - 'semicolon', - 'commasuperior', - 'threequartersemdash', - 'periodsuperior', - 'questionsmall', - '', - 'asuperior', - 'bsuperior', - 'centsuperior', - 'dsuperior', - 'esuperior', - '', - '', - 'isuperior', - '', - '', - 'lsuperior', - 'msuperior', - 'nsuperior', - 'osuperior', - '', - '', - 'rsuperior', - 'ssuperior', - 'tsuperior', - '', - 'ff', - 'fi', - 'fl', - 'ffi', - 'ffl', - 'parenleftinferior', - '', - 'parenrightinferior', - 'Circumflexsmall', - 'hyphensuperior', - 'Gravesmall', - 'Asmall', - 'Bsmall', - 'Csmall', - 'Dsmall', - 'Esmall', - 'Fsmall', - 'Gsmall', - 'Hsmall', - 'Ismall', - 'Jsmall', - 'Ksmall', - 'Lsmall', - 'Msmall', - 'Nsmall', - 'Osmall', - 'Psmall', - 'Qsmall', - 'Rsmall', - 'Ssmall', - 'Tsmall', - 'Usmall', - 'Vsmall', - 'Wsmall', - 'Xsmall', - 'Ysmall', - 'Zsmall', - 'colonmonetary', - 'onefitted', - 'rupiah', - 'Tildesmall', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - 'exclamdownsmall', - 'centoldstyle', - 'Lslashsmall', - '', - '', - 'Scaronsmall', - 'Zcaronsmall', - 'Dieresissmall', - 'Brevesmall', - 'Caronsmall', - '', - 'Dotaccentsmall', - '', - '', - 'Macronsmall', - '', - '', - 'figuredash', - 'hypheninferior', - '', - '', - 'Ogoneksmall', - 'Ringsmall', - 'Cedillasmall', - '', - '', - '', - 'onequarter', - 'onehalf', - 'threequarters', - 'questiondownsmall', - 'oneeighth', - 'threeeighths', - 'fiveeighths', - 'seveneighths', - 'onethird', - 'twothirds', - '', - '', - 'zerosuperior', - 'onesuperior', - 'twosuperior', - 'threesuperior', - 'foursuperior', - 'fivesuperior', - 'sixsuperior', - 'sevensuperior', - 'eightsuperior', - 'ninesuperior', - 'zeroinferior', - 'oneinferior', - 'twoinferior', - 'threeinferior', - 'fourinferior', - 'fiveinferior', - 'sixinferior', - 'seveninferior', - 'eightinferior', - 'nineinferior', - 'centinferior', - 'dollarinferior', - 'periodinferior', - 'commainferior', - 'Agravesmall', - 'Aacutesmall', - 'Acircumflexsmall', - 'Atildesmall', - 'Adieresissmall', - 'Aringsmall', - 'AEsmall', - 'Ccedillasmall', - 'Egravesmall', - 'Eacutesmall', - 'Ecircumflexsmall', - 'Edieresissmall', - 'Igravesmall', - 'Iacutesmall', - 'Icircumflexsmall', - 'Idieresissmall', - 'Ethsmall', - 'Ntildesmall', - 'Ogravesmall', - 'Oacutesmall', - 'Ocircumflexsmall', - 'Otildesmall', - 'Odieresissmall', - 'OEsmall', - 'Oslashsmall', - 'Ugravesmall', - 'Uacutesmall', - 'Ucircumflexsmall', - 'Udieresissmall', - 'Yacutesmall', - 'Thornsmall', - 'Ydieresissmall' - ]; - var standardNames = [ - '.notdef', - '.null', - 'nonmarkingreturn', - 'space', - 'exclam', - 'quotedbl', - 'numbersign', - 'dollar', - 'percent', - 'ampersand', - 'quotesingle', - 'parenleft', - 'parenright', - 'asterisk', - 'plus', - 'comma', - 'hyphen', - 'period', - 'slash', - 'zero', - 'one', - 'two', - 'three', - 'four', - 'five', - 'six', - 'seven', - 'eight', - 'nine', - 'colon', - 'semicolon', - 'less', - 'equal', - 'greater', - 'question', - 'at', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z', - 'bracketleft', - 'backslash', - 'bracketright', - 'asciicircum', - 'underscore', - 'grave', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - 'braceleft', - 'bar', - 'braceright', - 'asciitilde', - 'Adieresis', - 'Aring', - 'Ccedilla', - 'Eacute', - 'Ntilde', - 'Odieresis', - 'Udieresis', - 'aacute', - 'agrave', - 'acircumflex', - 'adieresis', - 'atilde', - 'aring', - 'ccedilla', - 'eacute', - 'egrave', - 'ecircumflex', - 'edieresis', - 'iacute', - 'igrave', - 'icircumflex', - 'idieresis', - 'ntilde', - 'oacute', - 'ograve', - 'ocircumflex', - 'odieresis', - 'otilde', - 'uacute', - 'ugrave', - 'ucircumflex', - 'udieresis', - 'dagger', - 'degree', - 'cent', - 'sterling', - 'section', - 'bullet', - 'paragraph', - 'germandbls', - 'registered', - 'copyright', - 'trademark', - 'acute', - 'dieresis', - 'notequal', - 'AE', - 'Oslash', - 'infinity', - 'plusminus', - 'lessequal', - 'greaterequal', - 'yen', - 'mu', - 'partialdiff', - 'summation', - 'product', - 'pi', - 'integral', - 'ordfeminine', - 'ordmasculine', - 'Omega', - 'ae', - 'oslash', - 'questiondown', - 'exclamdown', - 'logicalnot', - 'radical', - 'florin', - 'approxequal', - 'Delta', - 'guillemotleft', - 'guillemotright', - 'ellipsis', - 'nonbreakingspace', - 'Agrave', - 'Atilde', - 'Otilde', - 'OE', - 'oe', - 'endash', - 'emdash', - 'quotedblleft', - 'quotedblright', - 'quoteleft', - 'quoteright', - 'divide', - 'lozenge', - 'ydieresis', - 'Ydieresis', - 'fraction', - 'currency', - 'guilsinglleft', - 'guilsinglright', - 'fi', - 'fl', - 'daggerdbl', - 'periodcentered', - 'quotesinglbase', - 'quotedblbase', - 'perthousand', - 'Acircumflex', - 'Ecircumflex', - 'Aacute', - 'Edieresis', - 'Egrave', - 'Iacute', - 'Icircumflex', - 'Idieresis', - 'Igrave', - 'Oacute', - 'Ocircumflex', - 'apple', - 'Ograve', - 'Uacute', - 'Ucircumflex', - 'Ugrave', - 'dotlessi', - 'circumflex', - 'tilde', - 'macron', - 'breve', - 'dotaccent', - 'ring', - 'cedilla', - 'hungarumlaut', - 'ogonek', - 'caron', - 'Lslash', - 'lslash', - 'Scaron', - 'scaron', - 'Zcaron', - 'zcaron', - 'brokenbar', - 'Eth', - 'eth', - 'Yacute', - 'yacute', - 'Thorn', - 'thorn', - 'minus', - 'multiply', - 'onesuperior', - 'twosuperior', - 'threesuperior', - 'onehalf', - 'onequarter', - 'threequarters', - 'franc', - 'Gbreve', - 'gbreve', - 'Idotaccent', - 'Scedilla', - 'scedilla', - 'Cacute', - 'cacute', - 'Ccaron', - 'ccaron', - 'dcroat' - ]; - /** - * This is the encoding used for fonts created from scratch. - * It loops through all glyphs and finds the appropriate unicode value. - * Since it's linear time, other encodings will be faster. - * @exports opentype.DefaultEncoding - * @class - * @constructor - * @param {opentype.Font} - */ - function DefaultEncoding(font) { - this.font = font; - } - DefaultEncoding.prototype.charToGlyphIndex = function (c) { - var code = c.codePointAt(0); - var glyphs = this.font.glyphs; - if (glyphs) { - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - for (var j = 0; j < glyph.unicodes.length; j += 1) { - if (glyph.unicodes[j] === code) { - return i; - } - } - } - } - return null; - }; - /** - * @exports opentype.CmapEncoding - * @class - * @constructor - * @param {Object} cmap - a object with the cmap encoded data - */ - function CmapEncoding(cmap) { - this.cmap = cmap; - } /** - * @param {string} c - the character - * @return {number} The glyph index. - */ - - CmapEncoding.prototype.charToGlyphIndex = function (c) { - return this.cmap.glyphIndexMap[c.codePointAt(0)] || 0; - }; - /** - * @exports opentype.CffEncoding - * @class - * @constructor - * @param {string} encoding - The encoding - * @param {Array} charset - The character set. - */ - function CffEncoding(encoding, charset) { - this.encoding = encoding; - this.charset = charset; - } /** - * @param {string} s - The character - * @return {number} The index. - */ - - CffEncoding.prototype.charToGlyphIndex = function (s) { - var code = s.codePointAt(0); - var charName = this.encoding[code]; - return this.charset.indexOf(charName); - }; - /** - * @exports opentype.GlyphNames - * @class - * @constructor - * @param {Object} post - */ - function GlyphNames(post) { - var this$1 = this; - switch (post.version) { - case 1: - this.names = standardNames.slice(); - break; - case 2: - this.names = new Array(post.numberOfGlyphs); - for (var i = 0; i < post.numberOfGlyphs; i++) { - if (post.glyphNameIndex[i] < standardNames.length) { - this$1.names[i] = standardNames[post.glyphNameIndex[i]]; - } else { - this$1.names[i] = post.names[post.glyphNameIndex[i] - standardNames.length]; - } - } - break; - case 2.5: - this.names = new Array(post.numberOfGlyphs); - for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { - this$1.names[i$1] = standardNames[i$1 + post.glyphNameIndex[i$1]]; - } - break; - case 3: - this.names = [ - ]; - break; - default: - this.names = [ - ]; - break; - } - } /** - * Gets the index of a glyph by name. - * @param {string} name - The glyph name - * @return {number} The index - */ - - GlyphNames.prototype.nameToGlyphIndex = function (name) { - return this.names.indexOf(name); - }; - /** - * @param {number} gid - * @return {string} - */ - GlyphNames.prototype.glyphIndexToName = function (gid) { - return this.names[gid]; - }; - /** - * @alias opentype.addGlyphNames - * @param {opentype.Font} - */ - function addGlyphNames(font) { - var glyph; - var glyphIndexMap = font.tables.cmap.glyphIndexMap; - var charCodes = Object.keys(glyphIndexMap); - for (var i = 0; i < charCodes.length; i += 1) { - var c = charCodes[i]; - var glyphIndex = glyphIndexMap[c]; - glyph = font.glyphs.get(glyphIndex); - glyph.addUnicode(parseInt(c)); - } - for (var i$1 = 0; i$1 < font.glyphs.length; i$1 += 1) { - glyph = font.glyphs.get(i$1); - if (font.cffEncoding) { - if (font.isCIDFont) { - glyph.name = 'gid' + i$1; - } else { - glyph.name = font.cffEncoding.charset[i$1]; - } - } else if (font.glyphNames.names) { - glyph.name = font.glyphNames.glyphIndexToName(i$1); - } - } - } // Drawing utility functions. - // Draw a line on the given context from point `x1,y1` to point `x2,y2`. - - function line(ctx, x1, y1, x2, y2) { - ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.stroke(); - } - var draw = { - line: line - }; - // The Glyph object - // import glyf from './tables/glyf' Can't be imported here, because it's a circular dependency - function getPathDefinition(glyph, path) { - var _path = path || new Path(); - return { - configurable: true, - get: function () { - if (typeof _path === 'function') { - _path = _path(); - } - return _path; - }, - set: function (p) { - _path = p; - } - }; - } /** - * @typedef GlyphOptions - * @type Object - * @property {string} [name] - The glyph name - * @property {number} [unicode] - * @property {Array} [unicodes] - * @property {number} [xMin] - * @property {number} [yMin] - * @property {number} [xMax] - * @property {number} [yMax] - * @property {number} [advanceWidth] - */ - // A Glyph is an individual mark that often corresponds to a character. - // Some glyphs, such as ligatures, are a combination of many characters. - // Glyphs are the basic building blocks of a font. - // - // The `Glyph` class contains utility methods for drawing the path and its points. - /** - * @exports opentype.Glyph - * @class - * @param {GlyphOptions} - * @constructor - */ - - function Glyph(options) { - // By putting all the code on a prototype function (which is only declared once) - // we reduce the memory requirements for larger fonts by some 2% - this.bindConstructorValues(options); - } /** - * @param {GlyphOptions} - */ - - Glyph.prototype.bindConstructorValues = function (options) { - this.index = options.index || 0; - // These three values cannot be deferred for memory optimization: - this.name = options.name || null; - this.unicode = options.unicode || undefined; - this.unicodes = options.unicodes || options.unicode !== undefined ? [ - options.unicode - ] : [ - ]; - // But by binding these values only when necessary, we reduce can - // the memory requirements by almost 3% for larger fonts. - if (options.xMin) { - this.xMin = options.xMin; - } - if (options.yMin) { - this.yMin = options.yMin; - } - if (options.xMax) { - this.xMax = options.xMax; - } - if (options.yMax) { - this.yMax = options.yMax; - } - if (options.advanceWidth) { - this.advanceWidth = options.advanceWidth; - } // The path for a glyph is the most memory intensive, and is bound as a value - // with a getter/setter to ensure we actually do path parsing only once the - // path is actually needed by anything. - - Object.defineProperty(this, 'path', getPathDefinition(this, options.path)); - }; - /** - * @param {number} - */ - Glyph.prototype.addUnicode = function (unicode) { - if (this.unicodes.length === 0) { - this.unicode = unicode; - } - this.unicodes.push(unicode); - }; - /** - * Calculate the minimum bounding box for this glyph. - * @return {opentype.BoundingBox} - */ - Glyph.prototype.getBoundingBox = function () { - return this.path.getBoundingBox(); - }; - /** - * Convert the glyph to a Path we can draw on a drawing context. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {Object=} options - xScale, yScale to stretch the glyph. - * @param {opentype.Font} if hinting is to be used, the font - * @return {opentype.Path} - */ - Glyph.prototype.getPath = function (x, y, fontSize, options, font) { - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 72; - var commands; - var hPoints; - if (!options) { - options = { - }; - } - var xScale = options.xScale; - var yScale = options.yScale; - if (options.hinting && font && font.hinting) { - // in case of hinting, the hinting engine takes care - // of scaling the points (not the path) before hinting. - hPoints = this.path && font.hinting.exec(this, fontSize); - // in case the hinting engine failed hPoints is undefined - // and thus reverts to plain rending - } - if (hPoints) { - // Call font.hinting.getCommands instead of `glyf.getPath(hPoints).commands` to avoid a circular dependency - commands = font.hinting.getCommands(hPoints); - x = Math.round(x); - y = Math.round(y); - // TODO in case of hinting xyScaling is not yet supported - xScale = yScale = 1; - } else { - commands = this.path.commands; - var scale = 1 / this.path.unitsPerEm * fontSize; - if (xScale === undefined) { - xScale = scale; - } - if (yScale === undefined) { - yScale = scale; - } - } - var p = new Path(); - for (var i = 0; i < commands.length; i += 1) { - var cmd = commands[i]; - if (cmd.type === 'M') { - p.moveTo(x + cmd.x * xScale, y + - cmd.y * yScale); - } else if (cmd.type === 'L') { - p.lineTo(x + cmd.x * xScale, y + - cmd.y * yScale); - } else if (cmd.type === 'Q') { - p.quadraticCurveTo(x + cmd.x1 * xScale, y + - cmd.y1 * yScale, x + cmd.x * xScale, y + - cmd.y * yScale); - } else if (cmd.type === 'C') { - p.curveTo(x + cmd.x1 * xScale, y + - cmd.y1 * yScale, x + cmd.x2 * xScale, y + - cmd.y2 * yScale, x + cmd.x * xScale, y + - cmd.y * yScale); - } else if (cmd.type === 'Z') { - p.closePath(); - } - } - return p; - }; - /** - * Split the glyph into contours. - * This function is here for backwards compatibility, and to - * provide raw access to the TrueType glyph outlines. - * @return {Array} - */ - Glyph.prototype.getContours = function () { - var this$1 = this; - if (this.points === undefined) { - return []; - } - var contours = [ - ]; - var currentContour = [ - ]; - for (var i = 0; i < this.points.length; i += 1) { - var pt = this$1.points[i]; - currentContour.push(pt); - if (pt.lastPointOfContour) { - contours.push(currentContour); - currentContour = [ - ]; - } - } - check.argument(currentContour.length === 0, 'There are still points left in the current contour.'); - return contours; - }; - /** - * Calculate the xMin/yMin/xMax/yMax/lsb/rsb for a Glyph. - * @return {Object} - */ - Glyph.prototype.getMetrics = function () { - var commands = this.path.commands; - var xCoords = [ - ]; - var yCoords = [ - ]; - for (var i = 0; i < commands.length; i += 1) { - var cmd = commands[i]; - if (cmd.type !== 'Z') { - xCoords.push(cmd.x); - yCoords.push(cmd.y); - } - if (cmd.type === 'Q' || cmd.type === 'C') { - xCoords.push(cmd.x1); - yCoords.push(cmd.y1); - } - if (cmd.type === 'C') { - xCoords.push(cmd.x2); - yCoords.push(cmd.y2); - } - } - var metrics = { - xMin: Math.min.apply(null, xCoords), - yMin: Math.min.apply(null, yCoords), - xMax: Math.max.apply(null, xCoords), - yMax: Math.max.apply(null, yCoords), - leftSideBearing: this.leftSideBearing - }; - if (!isFinite(metrics.xMin)) { - metrics.xMin = 0; - } - if (!isFinite(metrics.xMax)) { - metrics.xMax = this.advanceWidth; - } - if (!isFinite(metrics.yMin)) { - metrics.yMin = 0; - } - if (!isFinite(metrics.yMax)) { - metrics.yMax = 0; - } - metrics.rightSideBearing = this.advanceWidth - metrics.leftSideBearing - (metrics.xMax - metrics.xMin); - return metrics; - }; - /** - * Draw the glyph on the given context. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {Object=} options - xScale, yScale to stretch the glyph. - */ - Glyph.prototype.draw = function (ctx, x, y, fontSize, options) { - this.getPath(x, y, fontSize, options).draw(ctx); - }; - /** - * Draw the points of the glyph. - * On-curve points will be drawn in blue, off-curve points will be drawn in red. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - */ - Glyph.prototype.drawPoints = function (ctx, x, y, fontSize) { - function drawCircles(l, x, y, scale) { - var PI_SQ = Math.PI * 2; - ctx.beginPath(); - for (var j = 0; j < l.length; j += 1) { - ctx.moveTo(x + l[j].x * scale, y + l[j].y * scale); - ctx.arc(x + l[j].x * scale, y + l[j].y * scale, 2, 0, PI_SQ, false); - } - ctx.closePath(); - ctx.fill(); - } - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 24; - var scale = 1 / this.path.unitsPerEm * fontSize; - var blueCircles = [ - ]; - var redCircles = [ - ]; - var path = this.path; - for (var i = 0; i < path.commands.length; i += 1) { - var cmd = path.commands[i]; - if (cmd.x !== undefined) { - blueCircles.push({ - x: cmd.x, - y: - cmd.y - }); - } - if (cmd.x1 !== undefined) { - redCircles.push({ - x: cmd.x1, - y: - cmd.y1 - }); - } - if (cmd.x2 !== undefined) { - redCircles.push({ - x: cmd.x2, - y: - cmd.y2 - }); - } - } - ctx.fillStyle = 'blue'; - drawCircles(blueCircles, x, y, scale); - ctx.fillStyle = 'red'; - drawCircles(redCircles, x, y, scale); - }; - /** - * Draw lines indicating important font measurements. - * Black lines indicate the origin of the coordinate system (point 0,0). - * Blue lines indicate the glyph bounding box. - * Green line indicates the advance width of the glyph. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - */ - Glyph.prototype.drawMetrics = function (ctx, x, y, fontSize) { - var scale; - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 24; - scale = 1 / this.path.unitsPerEm * fontSize; - ctx.lineWidth = 1; - // Draw the origin - ctx.strokeStyle = 'black'; - draw.line(ctx, x, - 10000, x, 10000); - draw.line(ctx, - 10000, y, 10000, y); - // This code is here due to memory optimization: by not using - // defaults in the constructor, we save a notable amount of memory. - var xMin = this.xMin || 0; - var yMin = this.yMin || 0; - var xMax = this.xMax || 0; - var yMax = this.yMax || 0; - var advanceWidth = this.advanceWidth || 0; - // Draw the glyph box - ctx.strokeStyle = 'blue'; - draw.line(ctx, x + xMin * scale, - 10000, x + xMin * scale, 10000); - draw.line(ctx, x + xMax * scale, - 10000, x + xMax * scale, 10000); - draw.line(ctx, - 10000, y + - yMin * scale, 10000, y + - yMin * scale); - draw.line(ctx, - 10000, y + - yMax * scale, 10000, y + - yMax * scale); - // Draw the advance width - ctx.strokeStyle = 'green'; - draw.line(ctx, x + advanceWidth * scale, - 10000, x + advanceWidth * scale, 10000); - }; - // The GlyphSet object - // Define a property on the glyph that depends on the path being loaded. - function defineDependentProperty(glyph, externalName, internalName) { - Object.defineProperty(glyph, externalName, { - get: function () { - // Request the path property to make sure the path is loaded. - glyph.path; // jshint ignore:line - return glyph[internalName]; - }, - set: function (newValue) { - glyph[internalName] = newValue; - }, - enumerable: true, - configurable: true - }); - } /** - * A GlyphSet represents all glyphs available in the font, but modelled using - * a deferred glyph loader, for retrieving glyphs only once they are absolutely - * necessary, to keep the memory footprint down. - * @exports opentype.GlyphSet - * @class - * @param {opentype.Font} - * @param {Array} - */ - - function GlyphSet(font, glyphs) { - var this$1 = this; - this.font = font; - this.glyphs = { - }; - if (Array.isArray(glyphs)) { - for (var i = 0; i < glyphs.length; i++) { - this$1.glyphs[i] = glyphs[i]; - } - } - this.length = glyphs && glyphs.length || 0; - } /** - * @param {number} index - * @return {opentype.Glyph} - */ - - GlyphSet.prototype.get = function (index) { - if (typeof this.glyphs[index] === 'function') { - this.glyphs[index] = this.glyphs[index](); - } - return this.glyphs[index]; - }; - /** - * @param {number} index - * @param {Object} - */ - GlyphSet.prototype.push = function (index, loader) { - this.glyphs[index] = loader; - this.length++; - }; - /** - * @alias opentype.glyphLoader - * @param {opentype.Font} font - * @param {number} index - * @return {opentype.Glyph} - */ - function glyphLoader(font, index) { - return new Glyph({ - index: index, - font: font - }); - } /** - * Generate a stub glyph that can be filled with all metadata *except* - * the "points" and "path" properties, which must be loaded only once - * the glyph's path is actually requested for text shaping. - * @alias opentype.ttfGlyphLoader - * @param {opentype.Font} font - * @param {number} index - * @param {Function} parseGlyph - * @param {Object} data - * @param {number} position - * @param {Function} buildPath - * @return {opentype.Glyph} - */ - - function ttfGlyphLoader(font, index, parseGlyph, data, position, buildPath) { - return function () { - var glyph = new Glyph({ - index: index, - font: font - }); - glyph.path = function () { - parseGlyph(glyph, data, position); - var path = buildPath(font.glyphs, glyph); - path.unitsPerEm = font.unitsPerEm; - return path; - }; - defineDependentProperty(glyph, 'xMin', '_xMin'); - defineDependentProperty(glyph, 'xMax', '_xMax'); - defineDependentProperty(glyph, 'yMin', '_yMin'); - defineDependentProperty(glyph, 'yMax', '_yMax'); - return glyph; - }; - } /** - * @alias opentype.cffGlyphLoader - * @param {opentype.Font} font - * @param {number} index - * @param {Function} parseCFFCharstring - * @param {string} charstring - * @return {opentype.Glyph} - */ - - function cffGlyphLoader(font, index, parseCFFCharstring, charstring) { - return function () { - var glyph = new Glyph({ - index: index, - font: font - }); - glyph.path = function () { - var path = parseCFFCharstring(font, glyph, charstring); - path.unitsPerEm = font.unitsPerEm; - return path; - }; - return glyph; - }; - } - var glyphset = { - GlyphSet: GlyphSet, - glyphLoader: glyphLoader, - ttfGlyphLoader: ttfGlyphLoader, - cffGlyphLoader: cffGlyphLoader - }; - // The `CFF` table contains the glyph outlines in PostScript format. - // Custom equals function that can also check lists. - function equals(a, b) { - if (a === b) { - return true; - } else if (Array.isArray(a) && Array.isArray(b)) { - if (a.length !== b.length) { - return false; - } - for (var i = 0; i < a.length; i += 1) { - if (!equals(a[i], b[i])) { - return false; - } - } - return true; - } else { - return false; - } - } // Subroutines are encoded using the negative half of the number space. - // See type 2 chapter 4.7 "Subroutine operators". - - function calcCFFSubroutineBias(subrs) { - var bias; - if (subrs.length < 1240) { - bias = 107; - } else if (subrs.length < 33900) { - bias = 1131; - } else { - bias = 32768; - } - return bias; - } // Parse a `CFF` INDEX array. - // An index array consists of a list of offsets, then a list of objects at those offsets. - - function parseCFFIndex(data, start, conversionFn) { - var offsets = [ - ]; - var objects = [ - ]; - var count = parse.getCard16(data, start); - var objectOffset; - var endOffset; - if (count !== 0) { - var offsetSize = parse.getByte(data, start + 2); - objectOffset = start + (count + 1) * offsetSize + 2; - var pos = start + 3; - for (var i = 0; i < count + 1; i += 1) { - offsets.push(parse.getOffset(data, pos, offsetSize)); - pos += offsetSize; - } // The total size of the index array is 4 header bytes + the value of the last offset. - - endOffset = objectOffset + offsets[count]; - } else { - endOffset = start + 2; - } - for (var i$1 = 0; i$1 < offsets.length - 1; i$1 += 1) { - var value = parse.getBytes(data, objectOffset + offsets[i$1], objectOffset + offsets[i$1 + 1]); - if (conversionFn) { - value = conversionFn(value); - } - objects.push(value); - } - return { - objects: objects, - startOffset: start, - endOffset: endOffset - }; - } // Parse a `CFF` DICT real value. - - function parseFloatOperand(parser) { - var s = ''; - var eof = 15; - var lookup = [ - '0', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9', - '.', - 'E', - 'E-', - null, - '-' - ]; - while (true) { - var b = parser.parseByte(); - var n1 = b >> 4; - var n2 = b & 15; - if (n1 === eof) { - break; - } - s += lookup[n1]; - if (n2 === eof) { - break; - } - s += lookup[n2]; - } - return parseFloat(s); - } // Parse a `CFF` DICT operand. - - function parseOperand(parser, b0) { - var b1; - var b2; - var b3; - var b4; - if (b0 === 28) { - b1 = parser.parseByte(); - b2 = parser.parseByte(); - return b1 << 8 | b2; - } - if (b0 === 29) { - b1 = parser.parseByte(); - b2 = parser.parseByte(); - b3 = parser.parseByte(); - b4 = parser.parseByte(); - return b1 << 24 | b2 << 16 | b3 << 8 | b4; - } - if (b0 === 30) { - return parseFloatOperand(parser); - } - if (b0 >= 32 && b0 <= 246) { - return b0 - 139; - } - if (b0 >= 247 && b0 <= 250) { - b1 = parser.parseByte(); - return (b0 - 247) * 256 + b1 + 108; - } - if (b0 >= 251 && b0 <= 254) { - b1 = parser.parseByte(); - return - (b0 - 251) * 256 - b1 - 108; - } - throw new Error('Invalid b0 ' + b0); - } // Convert the entries returned by `parseDict` to a proper dictionary. - // If a value is a list of one, it is unpacked. - - function entriesToObject(entries) { - var o = { - }; - for (var i = 0; i < entries.length; i += 1) { - var key = entries[i][0]; - var values = entries[i][1]; - var value = void 0; - if (values.length === 1) { - value = values[0]; - } else { - value = values; - } - if (o.hasOwnProperty(key) && !isNaN(o[key])) { - throw new Error('Object ' + o + ' already has key ' + key); - } - o[key] = value; - } - return o; - } // Parse a `CFF` DICT object. - // A dictionary contains key-value pairs in a compact tokenized format. - - function parseCFFDict(data, start, size) { - start = start !== undefined ? start : 0; - var parser = new parse.Parser(data, start); - var entries = [ - ]; - var operands = [ - ]; - size = size !== undefined ? size : data.length; - while (parser.relativeOffset < size) { - var op = parser.parseByte(); - // The first byte for each dict item distinguishes between operator (key) and operand (value). - // Values <= 21 are operators. - if (op <= 21) { - // Two-byte operators have an initial escape byte of 12. - if (op === 12) { - op = 1200 + parser.parseByte(); - } - entries.push([op, - operands]); - operands = [ - ]; - } else { - // Since the operands (values) come before the operators (keys), we store all operands in a list - // until we encounter an operator. - operands.push(parseOperand(parser, op)); - } - } - return entriesToObject(entries); - } // Given a String Index (SID), return the value of the string. - // Strings below index 392 are standard CFF strings and are not encoded in the font. - - function getCFFString(strings, index) { - if (index <= 390) { - index = cffStandardStrings[index]; - } else { - index = strings[index - 391]; - } - return index; - } // Interpret a dictionary and return a new dictionary with readable keys and values for missing entries. - // This function takes `meta` which is a list of objects containing `operand`, `name` and `default`. - - function interpretDict(dict, meta, strings) { - var newDict = { - }; - var value; - // Because we also want to include missing values, we start out from the meta list - // and lookup values in the dict. - for (var i = 0; i < meta.length; i += 1) { - var m = meta[i]; - if (Array.isArray(m.type)) { - var values = [ - ]; - values.length = m.type.length; - for (var j = 0; j < m.type.length; j++) { - value = dict[m.op] !== undefined ? dict[m.op][j] : undefined; - if (value === undefined) { - value = m.value !== undefined && m.value[j] !== undefined ? m.value[j] : null; - } - if (m.type[j] === 'SID') { - value = getCFFString(strings, value); - } - values[j] = value; - } - newDict[m.name] = values; - } else { - value = dict[m.op]; - if (value === undefined) { - value = m.value !== undefined ? m.value : null; - } - if (m.type === 'SID') { - value = getCFFString(strings, value); - } - newDict[m.name] = value; - } - } - return newDict; - } // Parse the CFF header. - - function parseCFFHeader(data, start) { - var header = { - }; - header.formatMajor = parse.getCard8(data, start); - header.formatMinor = parse.getCard8(data, start + 1); - header.size = parse.getCard8(data, start + 2); - header.offsetSize = parse.getCard8(data, start + 3); - header.startOffset = start; - header.endOffset = start + 4; - return header; - } - var TOP_DICT_META = [ - { - name: 'version', - op: 0, - type: 'SID' - }, - { - name: 'notice', - op: 1, - type: 'SID' - }, - { - name: 'copyright', - op: 1200, - type: 'SID' - }, - { - name: 'fullName', - op: 2, - type: 'SID' - }, - { - name: 'familyName', - op: 3, - type: 'SID' - }, - { - name: 'weight', - op: 4, - type: 'SID' - }, - { - name: 'isFixedPitch', - op: 1201, - type: 'number', - value: 0 - }, - { - name: 'italicAngle', - op: 1202, - type: 'number', - value: 0 - }, - { - name: 'underlinePosition', - op: 1203, - type: 'number', - value: - 100 - }, - { - name: 'underlineThickness', - op: 1204, - type: 'number', - value: 50 - }, - { - name: 'paintType', - op: 1205, - type: 'number', - value: 0 - }, - { - name: 'charstringType', - op: 1206, - type: 'number', - value: 2 - }, - { - name: 'fontMatrix', - op: 1207, - type: [ - 'real', - 'real', - 'real', - 'real', - 'real', - 'real' - ], - value: [ - 0.001, - 0, - 0, - 0.001, - 0, - 0 - ] - }, - { - name: 'uniqueId', - op: 13, - type: 'number' - }, - { - name: 'fontBBox', - op: 5, - type: [ - 'number', - 'number', - 'number', - 'number' - ], - value: [ - 0, - 0, - 0, - 0 - ] - }, - { - name: 'strokeWidth', - op: 1208, - type: 'number', - value: 0 - }, - { - name: 'xuid', - op: 14, - type: [ - ], - value: null - }, - { - name: 'charset', - op: 15, - type: 'offset', - value: 0 - }, - { - name: 'encoding', - op: 16, - type: 'offset', - value: 0 - }, - { - name: 'charStrings', - op: 17, - type: 'offset', - value: 0 - }, - { - name: 'private', - op: 18, - type: [ - 'number', - 'offset' - ], - value: [ - 0, - 0 - ] - }, - { - name: 'ros', - op: 1230, - type: [ - 'SID', - 'SID', - 'number' - ] - }, - { - name: 'cidFontVersion', - op: 1231, - type: 'number', - value: 0 - }, - { - name: 'cidFontRevision', - op: 1232, - type: 'number', - value: 0 - }, - { - name: 'cidFontType', - op: 1233, - type: 'number', - value: 0 - }, - { - name: 'cidCount', - op: 1234, - type: 'number', - value: 8720 - }, - { - name: 'uidBase', - op: 1235, - type: 'number' - }, - { - name: 'fdArray', - op: 1236, - type: 'offset' - }, - { - name: 'fdSelect', - op: 1237, - type: 'offset' - }, - { - name: 'fontName', - op: 1238, - type: 'SID' - } - ]; - var PRIVATE_DICT_META = [ - { - name: 'subrs', - op: 19, - type: 'offset', - value: 0 - }, - { - name: 'defaultWidthX', - op: 20, - type: 'number', - value: 0 - }, - { - name: 'nominalWidthX', - op: 21, - type: 'number', - value: 0 - } - ]; - // Parse the CFF top dictionary. A CFF table can contain multiple fonts, each with their own top dictionary. - // The top dictionary contains the essential metadata for the font, together with the private dictionary. - function parseCFFTopDict(data, strings) { - var dict = parseCFFDict(data, 0, data.byteLength); - return interpretDict(dict, TOP_DICT_META, strings); - } // Parse the CFF private dictionary. We don't fully parse out all the values, only the ones we need. - - function parseCFFPrivateDict(data, start, size, strings) { - var dict = parseCFFDict(data, start, size); - return interpretDict(dict, PRIVATE_DICT_META, strings); - } // Returns a list of "Top DICT"s found using an INDEX list. - // Used to read both the usual high-level Top DICTs and also the FDArray - // discovered inside CID-keyed fonts. When a Top DICT has a reference to - // a Private DICT that is read and saved into the Top DICT. - // - // In addition to the expected/optional values as outlined in TOP_DICT_META - // the following values might be saved into the Top DICT. - // - // _subrs [] array of local CFF subroutines from Private DICT - // _subrsBias bias value computed from number of subroutines - // (see calcCFFSubroutineBias() and parseCFFCharstring()) - // _defaultWidthX default widths for CFF characters - // _nominalWidthX bias added to width embedded within glyph description - // - // _privateDict saved copy of parsed Private DICT from Top DICT - - function gatherCFFTopDicts(data, start, cffIndex, strings) { - var topDictArray = [ - ]; - for (var iTopDict = 0; iTopDict < cffIndex.length; iTopDict += 1) { - var topDictData = new DataView(new Uint8Array(cffIndex[iTopDict]).buffer); - var topDict = parseCFFTopDict(topDictData, strings); - topDict._subrs = [ - ]; - topDict._subrsBias = 0; - var privateSize = topDict.private[0]; - var privateOffset = topDict.private[1]; - if (privateSize !== 0 && privateOffset !== 0) { - var privateDict = parseCFFPrivateDict(data, privateOffset + start, privateSize, strings); - topDict._defaultWidthX = privateDict.defaultWidthX; - topDict._nominalWidthX = privateDict.nominalWidthX; - if (privateDict.subrs !== 0) { - var subrOffset = privateOffset + privateDict.subrs; - var subrIndex = parseCFFIndex(data, subrOffset + start); - topDict._subrs = subrIndex.objects; - topDict._subrsBias = calcCFFSubroutineBias(topDict._subrs); - } - topDict._privateDict = privateDict; - } - topDictArray.push(topDict); - } - return topDictArray; - } // Parse the CFF charset table, which contains internal names for all the glyphs. - // This function will return a list of glyph names. - // See Adobe TN #5176 chapter 13, "Charsets". - - function parseCFFCharset(data, start, nGlyphs, strings) { - var sid; - var count; - var parser = new parse.Parser(data, start); - // The .notdef glyph is not included, so subtract 1. - nGlyphs -= 1; - var charset = [ - '.notdef' - ]; - var format = parser.parseCard8(); - if (format === 0) { - for (var i = 0; i < nGlyphs; i += 1) { - sid = parser.parseSID(); - charset.push(getCFFString(strings, sid)); - } - } else if (format === 1) { - while (charset.length <= nGlyphs) { - sid = parser.parseSID(); - count = parser.parseCard8(); - for (var i$1 = 0; i$1 <= count; i$1 += 1) { - charset.push(getCFFString(strings, sid)); - sid += 1; - } - } - } else if (format === 2) { - while (charset.length <= nGlyphs) { - sid = parser.parseSID(); - count = parser.parseCard16(); - for (var i$2 = 0; i$2 <= count; i$2 += 1) { - charset.push(getCFFString(strings, sid)); - sid += 1; - } - } - } else { - throw new Error('Unknown charset format ' + format); - } - return charset; - } // Parse the CFF encoding data. Only one encoding can be specified per font. - // See Adobe TN #5176 chapter 12, "Encodings". - - function parseCFFEncoding(data, start, charset) { - var code; - var enc = { - }; - var parser = new parse.Parser(data, start); - var format = parser.parseCard8(); - if (format === 0) { - var nCodes = parser.parseCard8(); - for (var i = 0; i < nCodes; i += 1) { - code = parser.parseCard8(); - enc[code] = i; - } - } else if (format === 1) { - var nRanges = parser.parseCard8(); - code = 1; - for (var i$1 = 0; i$1 < nRanges; i$1 += 1) { - var first = parser.parseCard8(); - var nLeft = parser.parseCard8(); - for (var j = first; j <= first + nLeft; j += 1) { - enc[j] = code; - code += 1; - } - } - } else { - throw new Error('Unknown encoding format ' + format); - } - return new CffEncoding(enc, charset); - } // Take in charstring code and return a Glyph object. - // The encoding is described in the Type 2 Charstring Format - // https://www.microsoft.com/typography/OTSPEC/charstr2.htm - - function parseCFFCharstring(font, glyph, code) { - var c1x; - var c1y; - var c2x; - var c2y; - var p = new Path(); - var stack = [ - ]; - var nStems = 0; - var haveWidth = false; - var open = false; - var x = 0; - var y = 0; - var subrs; - var subrsBias; - var defaultWidthX; - var nominalWidthX; - if (font.isCIDFont) { - var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index]; - var fdDict = font.tables.cff.topDict._fdArray[fdIndex]; - subrs = fdDict._subrs; - subrsBias = fdDict._subrsBias; - defaultWidthX = fdDict._defaultWidthX; - nominalWidthX = fdDict._nominalWidthX; - } else { - subrs = font.tables.cff.topDict._subrs; - subrsBias = font.tables.cff.topDict._subrsBias; - defaultWidthX = font.tables.cff.topDict._defaultWidthX; - nominalWidthX = font.tables.cff.topDict._nominalWidthX; - } - var width = defaultWidthX; - function newContour(x, y) { - if (open) { - p.closePath(); - } - p.moveTo(x, y); - open = true; - } - function parseStems() { - var hasWidthArg; - // The number of stem operators on the stack is always even. - // If the value is uneven, that means a width is specified. - hasWidthArg = stack.length % 2 !== 0; - if (hasWidthArg && !haveWidth) { - width = stack.shift() + nominalWidthX; - } - nStems += stack.length >> 1; - stack.length = 0; - haveWidth = true; - } - function parse$$1(code) { - var b1; - var b2; - var b3; - var b4; - var codeIndex; - var subrCode; - var jpx; - var jpy; - var c3x; - var c3y; - var c4x; - var c4y; - var i = 0; - while (i < code.length) { - var v = code[i]; - i += 1; - switch (v) { - case 1: - // hstem - parseStems(); - break; - case 3: - // vstem - parseStems(); - break; - case 4: - // vmoveto - if (stack.length > 1 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - y += stack.pop(); - newContour(x, y); - break; - case 5: - // rlineto - while (stack.length > 0) { - x += stack.shift(); - y += stack.shift(); - p.lineTo(x, y); - } - break; - case 6: - // hlineto - while (stack.length > 0) { - x += stack.shift(); - p.lineTo(x, y); - if (stack.length === 0) { - break; - } - y += stack.shift(); - p.lineTo(x, y); - } - break; - case 7: - // vlineto - while (stack.length > 0) { - y += stack.shift(); - p.lineTo(x, y); - if (stack.length === 0) { - break; - } - x += stack.shift(); - p.lineTo(x, y); - } - break; - case 8: - // rrcurveto - while (stack.length > 0) { - c1x = x + stack.shift(); - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 10: - // callsubr - codeIndex = stack.pop() + subrsBias; - subrCode = subrs[codeIndex]; - if (subrCode) { - parse$$1(subrCode); - } - break; - case 11: - // return - return; - case 12: - // flex operators - v = code[i]; - i += 1; - switch (v) { - case 35: - // flex - // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |- - c1x = x + stack.shift(); // dx1 - c1y = y + stack.shift(); // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y + stack.shift(); // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = jpy + stack.shift(); // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = c3y + stack.shift(); // dy5 - x = c4x + stack.shift(); // dx6 - y = c4y + stack.shift(); // dy6 - stack.shift(); // flex depth - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - case 34: - // hflex - // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |- - c1x = x + stack.shift(); // dx1 - c1y = y; // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y; // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = c2y; // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = y; // dy5 - x = c4x + stack.shift(); // dx6 - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - case 36: - // hflex1 - // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |- - c1x = x + stack.shift(); // dx1 - c1y = y + stack.shift(); // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y; // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = c2y; // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = c3y + stack.shift(); // dy5 - x = c4x + stack.shift(); // dx6 - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - case 37: - // flex1 - // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |- - c1x = x + stack.shift(); // dx1 - c1y = y + stack.shift(); // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y + stack.shift(); // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = jpy + stack.shift(); // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = c3y + stack.shift(); // dy5 - if (Math.abs(c4x - x) > Math.abs(c4y - y)) { - x = c4x + stack.shift(); - } else { - y = c4y + stack.shift(); - } - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - default: - console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v); - stack.length = 0; - } - break; - case 14: - // endchar - if (stack.length > 0 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - if (open) { - p.closePath(); - open = false; - } - break; - case 18: - // hstemhm - parseStems(); - break; - case 19: // hintmask - case 20: - // cntrmask - parseStems(); - i += nStems + 7 >> 3; - break; - case 21: - // rmoveto - if (stack.length > 2 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - y += stack.pop(); - x += stack.pop(); - newContour(x, y); - break; - case 22: - // hmoveto - if (stack.length > 1 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - x += stack.pop(); - newContour(x, y); - break; - case 23: - // vstemhm - parseStems(); - break; - case 24: - // rcurveline - while (stack.length > 2) { - c1x = x + stack.shift(); - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - x += stack.shift(); - y += stack.shift(); - p.lineTo(x, y); - break; - case 25: - // rlinecurve - while (stack.length > 6) { - x += stack.shift(); - y += stack.shift(); - p.lineTo(x, y); - } - c1x = x + stack.shift(); - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - break; - case 26: - // vvcurveto - if (stack.length % 2) { - x += stack.shift(); - } - while (stack.length > 0) { - c1x = x; - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x; - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 27: - // hhcurveto - if (stack.length % 2) { - y += stack.shift(); - } - while (stack.length > 0) { - c1x = x + stack.shift(); - c1y = y; - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y; - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 28: - // shortint - b1 = code[i]; - b2 = code[i + 1]; - stack.push((b1 << 24 | b2 << 16) >> 16); - i += 2; - break; - case 29: - // callgsubr - codeIndex = stack.pop() + font.gsubrsBias; - subrCode = font.gsubrs[codeIndex]; - if (subrCode) { - parse$$1(subrCode); - } - break; - case 30: - // vhcurveto - while (stack.length > 0) { - c1x = x; - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - if (stack.length === 0) { - break; - } - c1x = x + stack.shift(); - c1y = y; - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - y = c2y + stack.shift(); - x = c2x + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 31: - // hvcurveto - while (stack.length > 0) { - c1x = x + stack.shift(); - c1y = y; - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - y = c2y + stack.shift(); - x = c2x + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - if (stack.length === 0) { - break; - } - c1x = x; - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - default: - if (v < 32) { - console.log('Glyph ' + glyph.index + ': unknown operator ' + v); - } else if (v < 247) { - stack.push(v - 139); - } else if (v < 251) { - b1 = code[i]; - i += 1; - stack.push((v - 247) * 256 + b1 + 108); - } else if (v < 255) { - b1 = code[i]; - i += 1; - stack.push( - (v - 251) * 256 - b1 - 108); - } else { - b1 = code[i]; - b2 = code[i + 1]; - b3 = code[i + 2]; - b4 = code[i + 3]; - i += 4; - stack.push((b1 << 24 | b2 << 16 | b3 << 8 | b4) / 65536); - } - } - } - } - parse$$1(code); - glyph.advanceWidth = width; - return p; - } - function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) { - var fdSelect = [ - ]; - var fdIndex; - var parser = new parse.Parser(data, start); - var format = parser.parseCard8(); - if (format === 0) { - // Simple list of nGlyphs elements - for (var iGid = 0; iGid < nGlyphs; iGid++) { - fdIndex = parser.parseCard8(); - if (fdIndex >= fdArrayCount) { - throw new Error('CFF table CID Font FDSelect has bad FD index value ' + fdIndex + ' (FD count ' + fdArrayCount + ')'); - } - fdSelect.push(fdIndex); - } - } else if (format === 3) { - // Ranges - var nRanges = parser.parseCard16(); - var first = parser.parseCard16(); - if (first !== 0) { - throw new Error('CFF Table CID Font FDSelect format 3 range has bad initial GID ' + first); - } - var next; - for (var iRange = 0; iRange < nRanges; iRange++) { - fdIndex = parser.parseCard8(); - next = parser.parseCard16(); - if (fdIndex >= fdArrayCount) { - throw new Error('CFF table CID Font FDSelect has bad FD index value ' + fdIndex + ' (FD count ' + fdArrayCount + ')'); - } - if (next > nGlyphs) { - throw new Error('CFF Table CID Font FDSelect format 3 range has bad GID ' + next); - } - for (; first < next; first++) { - fdSelect.push(fdIndex); - } - first = next; - } - if (next !== nGlyphs) { - throw new Error('CFF Table CID Font FDSelect format 3 range has bad final GID ' + next); - } - } else { - throw new Error('CFF Table CID Font FDSelect table has unsupported format ' + format); - } - return fdSelect; - } // Parse the `CFF` table, which contains the glyph outlines in PostScript format. - - function parseCFFTable(data, start, font) { - font.tables.cff = { - }; - var header = parseCFFHeader(data, start); - var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString); - var topDictIndex = parseCFFIndex(data, nameIndex.endOffset); - var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString); - var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset); - font.gsubrs = globalSubrIndex.objects; - font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs); - var topDictArray = gatherCFFTopDicts(data, start, topDictIndex.objects, stringIndex.objects); - if (topDictArray.length !== 1) { - throw new Error('CFF table has too many fonts in \'FontSet\' - count of fonts NameIndex.length = ' + topDictArray.length); - } - var topDict = topDictArray[0]; - font.tables.cff.topDict = topDict; - if (topDict._privateDict) { - font.defaultWidthX = topDict._privateDict.defaultWidthX; - font.nominalWidthX = topDict._privateDict.nominalWidthX; - } - if (topDict.ros[0] !== undefined && topDict.ros[1] !== undefined) { - font.isCIDFont = true; - } - if (font.isCIDFont) { - var fdArrayOffset = topDict.fdArray; - var fdSelectOffset = topDict.fdSelect; - if (fdArrayOffset === 0 || fdSelectOffset === 0) { - throw new Error('Font is marked as a CID font, but FDArray and/or FDSelect information is missing'); - } - fdArrayOffset += start; - var fdArrayIndex = parseCFFIndex(data, fdArrayOffset); - var fdArray = gatherCFFTopDicts(data, start, fdArrayIndex.objects, stringIndex.objects); - topDict._fdArray = fdArray; - fdSelectOffset += start; - topDict._fdSelect = parseCFFFDSelect(data, fdSelectOffset, font.numGlyphs, fdArray.length); - } - var privateDictOffset = start + topDict.private[1]; - var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict.private[0], stringIndex.objects); - font.defaultWidthX = privateDict.defaultWidthX; - font.nominalWidthX = privateDict.nominalWidthX; - if (privateDict.subrs !== 0) { - var subrOffset = privateDictOffset + privateDict.subrs; - var subrIndex = parseCFFIndex(data, subrOffset); - font.subrs = subrIndex.objects; - font.subrsBias = calcCFFSubroutineBias(font.subrs); - } else { - font.subrs = [ - ]; - font.subrsBias = 0; - } // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset. - - var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings); - font.nGlyphs = charStringsIndex.objects.length; - var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects); - if (topDict.encoding === 0) { - // Standard encoding - font.cffEncoding = new CffEncoding(cffStandardEncoding, charset); - } else if (topDict.encoding === 1) { - // Expert encoding - font.cffEncoding = new CffEncoding(cffExpertEncoding, charset); - } else { - font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset); - } // Prefer the CMAP encoding to the CFF encoding. - - font.encoding = font.encoding || font.cffEncoding; - font.glyphs = new glyphset.GlyphSet(font); - for (var i = 0; i < font.nGlyphs; i += 1) { - var charString = charStringsIndex.objects[i]; - font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)); - } - } // Convert a string to a String ID (SID). - // The list of strings is modified in place. - - function encodeString(s, strings) { - var sid; - // Is the string in the CFF standard strings? - var i = cffStandardStrings.indexOf(s); - if (i >= 0) { - sid = i; - } // Is the string already in the string index? - - i = strings.indexOf(s); - if (i >= 0) { - sid = i + cffStandardStrings.length; - } else { - sid = cffStandardStrings.length + strings.length; - strings.push(s); - } - return sid; - } - function makeHeader() { - return new table.Record('Header', [ - { - name: 'major', - type: 'Card8', - value: 1 - }, - { - name: 'minor', - type: 'Card8', - value: 0 - }, - { - name: 'hdrSize', - type: 'Card8', - value: 4 - }, - { - name: 'major', - type: 'Card8', - value: 1 - } - ]); - } - function makeNameIndex(fontNames) { - var t = new table.Record('Name INDEX', [ - { - name: 'names', - type: 'INDEX', - value: [ - ] - } - ]); - t.names = [ - ]; - for (var i = 0; i < fontNames.length; i += 1) { - t.names.push({ - name: 'name_' + i, - type: 'NAME', - value: fontNames[i] - }); - } - return t; - } // Given a dictionary's metadata, create a DICT structure. - - function makeDict(meta, attrs, strings) { - var m = { - }; - for (var i = 0; i < meta.length; i += 1) { - var entry = meta[i]; - var value = attrs[entry.name]; - if (value !== undefined && !equals(value, entry.value)) { - if (entry.type === 'SID') { - value = encodeString(value, strings); - } - m[entry.op] = { - name: entry.name, - type: entry.type, - value: value - }; - } - } - return m; - } // The Top DICT houses the global font attributes. - - function makeTopDict(attrs, strings) { - var t = new table.Record('Top DICT', [ - { - name: 'dict', - type: 'DICT', - value: { - } - } - ]); - t.dict = makeDict(TOP_DICT_META, attrs, strings); - return t; - } - function makeTopDictIndex(topDict) { - var t = new table.Record('Top DICT INDEX', [ - { - name: 'topDicts', - type: 'INDEX', - value: [ - ] - } - ]); - t.topDicts = [ - { - name: 'topDict_0', - type: 'TABLE', - value: topDict - } - ]; - return t; - } - function makeStringIndex(strings) { - var t = new table.Record('String INDEX', [ - { - name: 'strings', - type: 'INDEX', - value: [ - ] - } - ]); - t.strings = [ - ]; - for (var i = 0; i < strings.length; i += 1) { - t.strings.push({ - name: 'string_' + i, - type: 'STRING', - value: strings[i] - }); - } - return t; - } - function makeGlobalSubrIndex() { - // Currently we don't use subroutines. - return new table.Record('Global Subr INDEX', [ - { - name: 'subrs', - type: 'INDEX', - value: [ - ] - } - ]); - } - function makeCharsets(glyphNames, strings) { - var t = new table.Record('Charsets', [ - { - name: 'format', - type: 'Card8', - value: 0 - } - ]); - for (var i = 0; i < glyphNames.length; i += 1) { - var glyphName = glyphNames[i]; - var glyphSID = encodeString(glyphName, strings); - t.fields.push({ - name: 'glyph_' + i, - type: 'SID', - value: glyphSID - }); - } - return t; - } - function glyphToOps(glyph) { - var ops = [ - ]; - var path = glyph.path; - ops.push({ - name: 'width', - type: 'NUMBER', - value: glyph.advanceWidth - }); - var x = 0; - var y = 0; - for (var i = 0; i < path.commands.length; i += 1) { - var dx = void 0; - var dy = void 0; - var cmd = path.commands[i]; - if (cmd.type === 'Q') { - // CFF only supports bézier curves, so convert the quad to a bézier. - var _13 = 1 / 3; - var _23 = 2 / 3; - // We're going to create a new command so we don't change the original path. - cmd = { - type: 'C', - x: cmd.x, - y: cmd.y, - x1: _13 * x + _23 * cmd.x1, - y1: _13 * y + _23 * cmd.y1, - x2: _13 * cmd.x + _23 * cmd.x1, - y2: _13 * cmd.y + _23 * cmd.y1 - }; - } - if (cmd.type === 'M') { - dx = Math.round(cmd.x - x); - dy = Math.round(cmd.y - y); - ops.push({ - name: 'dx', - type: 'NUMBER', - value: dx - }); - ops.push({ - name: 'dy', - type: 'NUMBER', - value: dy - }); - ops.push({ - name: 'rmoveto', - type: 'OP', - value: 21 - }); - x = Math.round(cmd.x); - y = Math.round(cmd.y); - } else if (cmd.type === 'L') { - dx = Math.round(cmd.x - x); - dy = Math.round(cmd.y - y); - ops.push({ - name: 'dx', - type: 'NUMBER', - value: dx - }); - ops.push({ - name: 'dy', - type: 'NUMBER', - value: dy - }); - ops.push({ - name: 'rlineto', - type: 'OP', - value: 5 - }); - x = Math.round(cmd.x); - y = Math.round(cmd.y); - } else if (cmd.type === 'C') { - var dx1 = Math.round(cmd.x1 - x); - var dy1 = Math.round(cmd.y1 - y); - var dx2 = Math.round(cmd.x2 - cmd.x1); - var dy2 = Math.round(cmd.y2 - cmd.y1); - dx = Math.round(cmd.x - cmd.x2); - dy = Math.round(cmd.y - cmd.y2); - ops.push({ - name: 'dx1', - type: 'NUMBER', - value: dx1 - }); - ops.push({ - name: 'dy1', - type: 'NUMBER', - value: dy1 - }); - ops.push({ - name: 'dx2', - type: 'NUMBER', - value: dx2 - }); - ops.push({ - name: 'dy2', - type: 'NUMBER', - value: dy2 - }); - ops.push({ - name: 'dx', - type: 'NUMBER', - value: dx - }); - ops.push({ - name: 'dy', - type: 'NUMBER', - value: dy - }); - ops.push({ - name: 'rrcurveto', - type: 'OP', - value: 8 - }); - x = Math.round(cmd.x); - y = Math.round(cmd.y); - } // Contours are closed automatically. - - } - ops.push({ - name: 'endchar', - type: 'OP', - value: 14 - }); - return ops; - } - function makeCharStringsIndex(glyphs) { - var t = new table.Record('CharStrings INDEX', [ - { - name: 'charStrings', - type: 'INDEX', - value: [ - ] - } - ]); - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - var ops = glyphToOps(glyph); - t.charStrings.push({ - name: glyph.name, - type: 'CHARSTRING', - value: ops - }); - } - return t; - } - function makePrivateDict(attrs, strings) { - var t = new table.Record('Private DICT', [ - { - name: 'dict', - type: 'DICT', - value: { - } - } - ]); - t.dict = makeDict(PRIVATE_DICT_META, attrs, strings); - return t; - } - function makeCFFTable(glyphs, options) { - var t = new table.Table('CFF ', [ - { - name: 'header', - type: 'RECORD' - }, - { - name: 'nameIndex', - type: 'RECORD' - }, - { - name: 'topDictIndex', - type: 'RECORD' - }, - { - name: 'stringIndex', - type: 'RECORD' - }, - { - name: 'globalSubrIndex', - type: 'RECORD' - }, - { - name: 'charsets', - type: 'RECORD' - }, - { - name: 'charStringsIndex', - type: 'RECORD' - }, - { - name: 'privateDict', - type: 'RECORD' - } - ]); - var fontScale = 1 / options.unitsPerEm; - // We use non-zero values for the offsets so that the DICT encodes them. - // This is important because the size of the Top DICT plays a role in offset calculation, - // and the size shouldn't change after we've written correct offsets. - var attrs = { - version: options.version, - fullName: options.fullName, - familyName: options.familyName, - weight: options.weightName, - fontBBox: options.fontBBox || [ - 0, - 0, - 0, - 0 - ], - fontMatrix: [ - fontScale, - 0, - 0, - fontScale, - 0, - 0 - ], - charset: 999, - encoding: 0, - charStrings: 999, - private: [ - 0, - 999 - ] - }; - var privateAttrs = { - }; - var glyphNames = [ - ]; - var glyph; - // Skip first glyph (.notdef) - for (var i = 1; i < glyphs.length; i += 1) { - glyph = glyphs.get(i); - glyphNames.push(glyph.name); - } - var strings = [ - ]; - t.header = makeHeader(); - t.nameIndex = makeNameIndex([options.postScriptName]); - var topDict = makeTopDict(attrs, strings); - t.topDictIndex = makeTopDictIndex(topDict); - t.globalSubrIndex = makeGlobalSubrIndex(); - t.charsets = makeCharsets(glyphNames, strings); - t.charStringsIndex = makeCharStringsIndex(glyphs); - t.privateDict = makePrivateDict(privateAttrs, strings); - // Needs to come at the end, to encode all custom strings used in the font. - t.stringIndex = makeStringIndex(strings); - var startOffset = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf(); - attrs.charset = startOffset; - // We use the CFF standard encoding; proper encoding will be handled in cmap. - attrs.encoding = 0; - attrs.charStrings = attrs.charset + t.charsets.sizeOf(); - attrs.private[1] = attrs.charStrings + t.charStringsIndex.sizeOf(); - // Recreate the Top DICT INDEX with the correct offsets. - topDict = makeTopDict(attrs, strings); - t.topDictIndex = makeTopDictIndex(topDict); - return t; - } - var cff = { - parse: parseCFFTable, - make: makeCFFTable - }; - // The `head` table contains global information about the font. - // Parse the header `head` table - function parseHeadTable(data, start) { - var head = { - }; - var p = new parse.Parser(data, start); - head.version = p.parseVersion(); - head.fontRevision = Math.round(p.parseFixed() * 1000) / 1000; - head.checkSumAdjustment = p.parseULong(); - head.magicNumber = p.parseULong(); - check.argument(head.magicNumber === 1594834165, 'Font header has wrong magic number.'); - head.flags = p.parseUShort(); - head.unitsPerEm = p.parseUShort(); - head.created = p.parseLongDateTime(); - head.modified = p.parseLongDateTime(); - head.xMin = p.parseShort(); - head.yMin = p.parseShort(); - head.xMax = p.parseShort(); - head.yMax = p.parseShort(); - head.macStyle = p.parseUShort(); - head.lowestRecPPEM = p.parseUShort(); - head.fontDirectionHint = p.parseShort(); - head.indexToLocFormat = p.parseShort(); - head.glyphDataFormat = p.parseShort(); - return head; - } - function makeHeadTable(options) { - // Apple Mac timestamp epoch is 01/01/1904 not 01/01/1970 - var timestamp = Math.round(new Date().getTime() / 1000) + 2082844800; - var createdTimestamp = timestamp; - if (options.createdTimestamp) { - createdTimestamp = options.createdTimestamp + 2082844800; - } - return new table.Table('head', [ - { - name: 'version', - type: 'FIXED', - value: 65536 - }, - { - name: 'fontRevision', - type: 'FIXED', - value: 65536 - }, - { - name: 'checkSumAdjustment', - type: 'ULONG', - value: 0 - }, - { - name: 'magicNumber', - type: 'ULONG', - value: 1594834165 - }, - { - name: 'flags', - type: 'USHORT', - value: 0 - }, - { - name: 'unitsPerEm', - type: 'USHORT', - value: 1000 - }, - { - name: 'created', - type: 'LONGDATETIME', - value: createdTimestamp - }, - { - name: 'modified', - type: 'LONGDATETIME', - value: timestamp - }, - { - name: 'xMin', - type: 'SHORT', - value: 0 - }, - { - name: 'yMin', - type: 'SHORT', - value: 0 - }, - { - name: 'xMax', - type: 'SHORT', - value: 0 - }, - { - name: 'yMax', - type: 'SHORT', - value: 0 - }, - { - name: 'macStyle', - type: 'USHORT', - value: 0 - }, - { - name: 'lowestRecPPEM', - type: 'USHORT', - value: 0 - }, - { - name: 'fontDirectionHint', - type: 'SHORT', - value: 2 - }, - { - name: 'indexToLocFormat', - type: 'SHORT', - value: 0 - }, - { - name: 'glyphDataFormat', - type: 'SHORT', - value: 0 - } - ], options); - } - var head = { - parse: parseHeadTable, - make: makeHeadTable - }; - // The `hhea` table contains information for horizontal layout. - // Parse the horizontal header `hhea` table - function parseHheaTable(data, start) { - var hhea = { - }; - var p = new parse.Parser(data, start); - hhea.version = p.parseVersion(); - hhea.ascender = p.parseShort(); - hhea.descender = p.parseShort(); - hhea.lineGap = p.parseShort(); - hhea.advanceWidthMax = p.parseUShort(); - hhea.minLeftSideBearing = p.parseShort(); - hhea.minRightSideBearing = p.parseShort(); - hhea.xMaxExtent = p.parseShort(); - hhea.caretSlopeRise = p.parseShort(); - hhea.caretSlopeRun = p.parseShort(); - hhea.caretOffset = p.parseShort(); - p.relativeOffset += 8; - hhea.metricDataFormat = p.parseShort(); - hhea.numberOfHMetrics = p.parseUShort(); - return hhea; - } - function makeHheaTable(options) { - return new table.Table('hhea', [ - { - name: 'version', - type: 'FIXED', - value: 65536 - }, - { - name: 'ascender', - type: 'FWORD', - value: 0 - }, - { - name: 'descender', - type: 'FWORD', - value: 0 - }, - { - name: 'lineGap', - type: 'FWORD', - value: 0 - }, - { - name: 'advanceWidthMax', - type: 'UFWORD', - value: 0 - }, - { - name: 'minLeftSideBearing', - type: 'FWORD', - value: 0 - }, - { - name: 'minRightSideBearing', - type: 'FWORD', - value: 0 - }, - { - name: 'xMaxExtent', - type: 'FWORD', - value: 0 - }, - { - name: 'caretSlopeRise', - type: 'SHORT', - value: 1 - }, - { - name: 'caretSlopeRun', - type: 'SHORT', - value: 0 - }, - { - name: 'caretOffset', - type: 'SHORT', - value: 0 - }, - { - name: 'reserved1', - type: 'SHORT', - value: 0 - }, - { - name: 'reserved2', - type: 'SHORT', - value: 0 - }, - { - name: 'reserved3', - type: 'SHORT', - value: 0 - }, - { - name: 'reserved4', - type: 'SHORT', - value: 0 - }, - { - name: 'metricDataFormat', - type: 'SHORT', - value: 0 - }, - { - name: 'numberOfHMetrics', - type: 'USHORT', - value: 0 - } - ], options); - } - var hhea = { - parse: parseHheaTable, - make: makeHheaTable - }; - // The `hmtx` table contains the horizontal metrics for all glyphs. - // Parse the `hmtx` table, which contains the horizontal metrics for all glyphs. - // This function augments the glyph array, adding the advanceWidth and leftSideBearing to each glyph. - function parseHmtxTable(data, start, numMetrics, numGlyphs, glyphs) { - var advanceWidth; - var leftSideBearing; - var p = new parse.Parser(data, start); - for (var i = 0; i < numGlyphs; i += 1) { - // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs. - if (i < numMetrics) { - advanceWidth = p.parseUShort(); - leftSideBearing = p.parseShort(); - } - var glyph = glyphs.get(i); - glyph.advanceWidth = advanceWidth; - glyph.leftSideBearing = leftSideBearing; - } - } - function makeHmtxTable(glyphs) { - var t = new table.Table('hmtx', [ - ]); - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - var advanceWidth = glyph.advanceWidth || 0; - var leftSideBearing = glyph.leftSideBearing || 0; - t.fields.push({ - name: 'advanceWidth_' + i, - type: 'USHORT', - value: advanceWidth - }); - t.fields.push({ - name: 'leftSideBearing_' + i, - type: 'SHORT', - value: leftSideBearing - }); - } - return t; - } - var hmtx = { - parse: parseHmtxTable, - make: makeHmtxTable - }; - // The `ltag` table stores IETF BCP-47 language tags. It allows supporting - function makeLtagTable(tags) { - var result = new table.Table('ltag', [ - { - name: 'version', - type: 'ULONG', - value: 1 - }, - { - name: 'flags', - type: 'ULONG', - value: 0 - }, - { - name: 'numTags', - type: 'ULONG', - value: tags.length - } - ]); - var stringPool = ''; - var stringPoolOffset = 12 + tags.length * 4; - for (var i = 0; i < tags.length; ++i) { - var pos = stringPool.indexOf(tags[i]); - if (pos < 0) { - pos = stringPool.length; - stringPool += tags[i]; - } - result.fields.push({ - name: 'offset ' + i, - type: 'USHORT', - value: stringPoolOffset + pos - }); - result.fields.push({ - name: 'length ' + i, - type: 'USHORT', - value: tags[i].length - }); - } - result.fields.push({ - name: 'stringPool', - type: 'CHARARRAY', - value: stringPool - }); - return result; - } - function parseLtagTable(data, start) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseULong(); - check.argument(tableVersion === 1, 'Unsupported ltag table version.'); - // The 'ltag' specification does not define any flags; skip the field. - p.skip('uLong', 1); - var numTags = p.parseULong(); - var tags = [ - ]; - for (var i = 0; i < numTags; i++) { - var tag = ''; - var offset = start + p.parseUShort(); - var length = p.parseUShort(); - for (var j = offset; j < offset + length; ++j) { - tag += String.fromCharCode(data.getInt8(j)); - } - tags.push(tag); - } - return tags; - } - var ltag = { - make: makeLtagTable, - parse: parseLtagTable - }; - // The `maxp` table establishes the memory requirements for the font. - // Parse the maximum profile `maxp` table. - function parseMaxpTable(data, start) { - var maxp = { - }; - var p = new parse.Parser(data, start); - maxp.version = p.parseVersion(); - maxp.numGlyphs = p.parseUShort(); - if (maxp.version === 1) { - maxp.maxPoints = p.parseUShort(); - maxp.maxContours = p.parseUShort(); - maxp.maxCompositePoints = p.parseUShort(); - maxp.maxCompositeContours = p.parseUShort(); - maxp.maxZones = p.parseUShort(); - maxp.maxTwilightPoints = p.parseUShort(); - maxp.maxStorage = p.parseUShort(); - maxp.maxFunctionDefs = p.parseUShort(); - maxp.maxInstructionDefs = p.parseUShort(); - maxp.maxStackElements = p.parseUShort(); - maxp.maxSizeOfInstructions = p.parseUShort(); - maxp.maxComponentElements = p.parseUShort(); - maxp.maxComponentDepth = p.parseUShort(); - } - return maxp; - } - function makeMaxpTable(numGlyphs) { - return new table.Table('maxp', [ - { - name: 'version', - type: 'FIXED', - value: 20480 - }, - { - name: 'numGlyphs', - type: 'USHORT', - value: numGlyphs - } - ]); - } - var maxp = { - parse: parseMaxpTable, - make: makeMaxpTable - }; - // The `name` naming table. - // NameIDs for the name table. - var nameTableNames = [ - 'copyright', - // 0 - 'fontFamily', - // 1 - 'fontSubfamily', - // 2 - 'uniqueID', - // 3 - 'fullName', - // 4 - 'version', - // 5 - 'postScriptName', - // 6 - 'trademark', - // 7 - 'manufacturer', - // 8 - 'designer', - // 9 - 'description', - // 10 - 'manufacturerURL', - // 11 - 'designerURL', - // 12 - 'license', - // 13 - 'licenseURL', - // 14 - 'reserved', - // 15 - 'preferredFamily', - // 16 - 'preferredSubfamily', - // 17 - 'compatibleFullName', - // 18 - 'sampleText', - // 19 - 'postScriptFindFontName', - // 20 - 'wwsFamily', - // 21 - 'wwsSubfamily' // 22 - ]; - var macLanguages = { - 0: 'en', - 1: 'fr', - 2: 'de', - 3: 'it', - 4: 'nl', - 5: 'sv', - 6: 'es', - 7: 'da', - 8: 'pt', - 9: 'no', - 10: 'he', - 11: 'ja', - 12: 'ar', - 13: 'fi', - 14: 'el', - 15: 'is', - 16: 'mt', - 17: 'tr', - 18: 'hr', - 19: 'zh-Hant', - 20: 'ur', - 21: 'hi', - 22: 'th', - 23: 'ko', - 24: 'lt', - 25: 'pl', - 26: 'hu', - 27: 'es', - 28: 'lv', - 29: 'se', - 30: 'fo', - 31: 'fa', - 32: 'ru', - 33: 'zh', - 34: 'nl-BE', - 35: 'ga', - 36: 'sq', - 37: 'ro', - 38: 'cz', - 39: 'sk', - 40: 'si', - 41: 'yi', - 42: 'sr', - 43: 'mk', - 44: 'bg', - 45: 'uk', - 46: 'be', - 47: 'uz', - 48: 'kk', - 49: 'az-Cyrl', - 50: 'az-Arab', - 51: 'hy', - 52: 'ka', - 53: 'mo', - 54: 'ky', - 55: 'tg', - 56: 'tk', - 57: 'mn-CN', - 58: 'mn', - 59: 'ps', - 60: 'ks', - 61: 'ku', - 62: 'sd', - 63: 'bo', - 64: 'ne', - 65: 'sa', - 66: 'mr', - 67: 'bn', - 68: 'as', - 69: 'gu', - 70: 'pa', - 71: 'or', - 72: 'ml', - 73: 'kn', - 74: 'ta', - 75: 'te', - 76: 'si', - 77: 'my', - 78: 'km', - 79: 'lo', - 80: 'vi', - 81: 'id', - 82: 'tl', - 83: 'ms', - 84: 'ms-Arab', - 85: 'am', - 86: 'ti', - 87: 'om', - 88: 'so', - 89: 'sw', - 90: 'rw', - 91: 'rn', - 92: 'ny', - 93: 'mg', - 94: 'eo', - 128: 'cy', - 129: 'eu', - 130: 'ca', - 131: 'la', - 132: 'qu', - 133: 'gn', - 134: 'ay', - 135: 'tt', - 136: 'ug', - 137: 'dz', - 138: 'jv', - 139: 'su', - 140: 'gl', - 141: 'af', - 142: 'br', - 143: 'iu', - 144: 'gd', - 145: 'gv', - 146: 'ga', - 147: 'to', - 148: 'el-polyton', - 149: 'kl', - 150: 'az', - 151: 'nn' - }; - // MacOS language ID → MacOS script ID - // - // Note that the script ID is not sufficient to determine what encoding - // to use in TrueType files. For some languages, MacOS used a modification - // of a mainstream script. For example, an Icelandic name would be stored - // with smRoman in the TrueType naming table, but the actual encoding - // is a special Icelandic version of the normal Macintosh Roman encoding. - // As another example, Inuktitut uses an 8-bit encoding for Canadian Aboriginal - // Syllables but MacOS had run out of available script codes, so this was - // done as a (pretty radical) "modification" of Ethiopic. - // - // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt - var macLanguageToScript = { - 0: 0, - // langEnglish → smRoman - 1: 0, - // langFrench → smRoman - 2: 0, - // langGerman → smRoman - 3: 0, - // langItalian → smRoman - 4: 0, - // langDutch → smRoman - 5: 0, - // langSwedish → smRoman - 6: 0, - // langSpanish → smRoman - 7: 0, - // langDanish → smRoman - 8: 0, - // langPortuguese → smRoman - 9: 0, - // langNorwegian → smRoman - 10: 5, - // langHebrew → smHebrew - 11: 1, - // langJapanese → smJapanese - 12: 4, - // langArabic → smArabic - 13: 0, - // langFinnish → smRoman - 14: 6, - // langGreek → smGreek - 15: 0, - // langIcelandic → smRoman (modified) - 16: 0, - // langMaltese → smRoman - 17: 0, - // langTurkish → smRoman (modified) - 18: 0, - // langCroatian → smRoman (modified) - 19: 2, - // langTradChinese → smTradChinese - 20: 4, - // langUrdu → smArabic - 21: 9, - // langHindi → smDevanagari - 22: 21, - // langThai → smThai - 23: 3, - // langKorean → smKorean - 24: 29, - // langLithuanian → smCentralEuroRoman - 25: 29, - // langPolish → smCentralEuroRoman - 26: 29, - // langHungarian → smCentralEuroRoman - 27: 29, - // langEstonian → smCentralEuroRoman - 28: 29, - // langLatvian → smCentralEuroRoman - 29: 0, - // langSami → smRoman - 30: 0, - // langFaroese → smRoman (modified) - 31: 4, - // langFarsi → smArabic (modified) - 32: 7, - // langRussian → smCyrillic - 33: 25, - // langSimpChinese → smSimpChinese - 34: 0, - // langFlemish → smRoman - 35: 0, - // langIrishGaelic → smRoman (modified) - 36: 0, - // langAlbanian → smRoman - 37: 0, - // langRomanian → smRoman (modified) - 38: 29, - // langCzech → smCentralEuroRoman - 39: 29, - // langSlovak → smCentralEuroRoman - 40: 0, - // langSlovenian → smRoman (modified) - 41: 5, - // langYiddish → smHebrew - 42: 7, - // langSerbian → smCyrillic - 43: 7, - // langMacedonian → smCyrillic - 44: 7, - // langBulgarian → smCyrillic - 45: 7, - // langUkrainian → smCyrillic (modified) - 46: 7, - // langByelorussian → smCyrillic - 47: 7, - // langUzbek → smCyrillic - 48: 7, - // langKazakh → smCyrillic - 49: 7, - // langAzerbaijani → smCyrillic - 50: 4, - // langAzerbaijanAr → smArabic - 51: 24, - // langArmenian → smArmenian - 52: 23, - // langGeorgian → smGeorgian - 53: 7, - // langMoldavian → smCyrillic - 54: 7, - // langKirghiz → smCyrillic - 55: 7, - // langTajiki → smCyrillic - 56: 7, - // langTurkmen → smCyrillic - 57: 27, - // langMongolian → smMongolian - 58: 7, - // langMongolianCyr → smCyrillic - 59: 4, - // langPashto → smArabic - 60: 4, - // langKurdish → smArabic - 61: 4, - // langKashmiri → smArabic - 62: 4, - // langSindhi → smArabic - 63: 26, - // langTibetan → smTibetan - 64: 9, - // langNepali → smDevanagari - 65: 9, - // langSanskrit → smDevanagari - 66: 9, - // langMarathi → smDevanagari - 67: 13, - // langBengali → smBengali - 68: 13, - // langAssamese → smBengali - 69: 11, - // langGujarati → smGujarati - 70: 10, - // langPunjabi → smGurmukhi - 71: 12, - // langOriya → smOriya - 72: 17, - // langMalayalam → smMalayalam - 73: 16, - // langKannada → smKannada - 74: 14, - // langTamil → smTamil - 75: 15, - // langTelugu → smTelugu - 76: 18, - // langSinhalese → smSinhalese - 77: 19, - // langBurmese → smBurmese - 78: 20, - // langKhmer → smKhmer - 79: 22, - // langLao → smLao - 80: 30, - // langVietnamese → smVietnamese - 81: 0, - // langIndonesian → smRoman - 82: 0, - // langTagalog → smRoman - 83: 0, - // langMalayRoman → smRoman - 84: 4, - // langMalayArabic → smArabic - 85: 28, - // langAmharic → smEthiopic - 86: 28, - // langTigrinya → smEthiopic - 87: 28, - // langOromo → smEthiopic - 88: 0, - // langSomali → smRoman - 89: 0, - // langSwahili → smRoman - 90: 0, - // langKinyarwanda → smRoman - 91: 0, - // langRundi → smRoman - 92: 0, - // langNyanja → smRoman - 93: 0, - // langMalagasy → smRoman - 94: 0, - // langEsperanto → smRoman - 128: 0, - // langWelsh → smRoman (modified) - 129: 0, - // langBasque → smRoman - 130: 0, - // langCatalan → smRoman - 131: 0, - // langLatin → smRoman - 132: 0, - // langQuechua → smRoman - 133: 0, - // langGuarani → smRoman - 134: 0, - // langAymara → smRoman - 135: 7, - // langTatar → smCyrillic - 136: 4, - // langUighur → smArabic - 137: 26, - // langDzongkha → smTibetan - 138: 0, - // langJavaneseRom → smRoman - 139: 0, - // langSundaneseRom → smRoman - 140: 0, - // langGalician → smRoman - 141: 0, - // langAfrikaans → smRoman - 142: 0, - // langBreton → smRoman (modified) - 143: 28, - // langInuktitut → smEthiopic (modified) - 144: 0, - // langScottishGaelic → smRoman (modified) - 145: 0, - // langManxGaelic → smRoman (modified) - 146: 0, - // langIrishGaelicScript → smRoman (modified) - 147: 0, - // langTongan → smRoman - 148: 6, - // langGreekAncient → smRoman - 149: 0, - // langGreenlandic → smRoman - 150: 0, - // langAzerbaijanRoman → smRoman - 151: 0 // langNynorsk → smRoman - }; - // While Microsoft indicates a region/country for all its language - // IDs, we omit the region code if it's equal to the "most likely - // region subtag" according to Unicode CLDR. For scripts, we omit - // the subtag if it is equal to the Suppress-Script entry in the - // IANA language subtag registry for IETF BCP 47. - // - // For example, Microsoft states that its language code 0x041A is - // Croatian in Croatia. We transform this to the BCP 47 language code 'hr' - // and not 'hr-HR' because Croatia is the default country for Croatian, - // according to Unicode CLDR. As another example, Microsoft states - // that 0x101A is Croatian (Latin) in Bosnia-Herzegovina. We transform - // this to 'hr-BA' and not 'hr-Latn-BA' because Latin is the default script - // for the Croatian language, according to IANA. - // - // http://www.unicode.org/cldr/charts/latest/supplemental/likely_subtags.html - // http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry - var windowsLanguages = { - 1078: 'af', - 1052: 'sq', - 1156: 'gsw', - 1118: 'am', - 5121: 'ar-DZ', - 15361: 'ar-BH', - 3073: 'ar', - 2049: 'ar-IQ', - 11265: 'ar-JO', - 13313: 'ar-KW', - 12289: 'ar-LB', - 4097: 'ar-LY', - 6145: 'ary', - 8193: 'ar-OM', - 16385: 'ar-QA', - 1025: 'ar-SA', - 10241: 'ar-SY', - 7169: 'aeb', - 14337: 'ar-AE', - 9217: 'ar-YE', - 1067: 'hy', - 1101: 'as', - 2092: 'az-Cyrl', - 1068: 'az', - 1133: 'ba', - 1069: 'eu', - 1059: 'be', - 2117: 'bn', - 1093: 'bn-IN', - 8218: 'bs-Cyrl', - 5146: 'bs', - 1150: 'br', - 1026: 'bg', - 1027: 'ca', - 3076: 'zh-HK', - 5124: 'zh-MO', - 2052: 'zh', - 4100: 'zh-SG', - 1028: 'zh-TW', - 1155: 'co', - 1050: 'hr', - 4122: 'hr-BA', - 1029: 'cs', - 1030: 'da', - 1164: 'prs', - 1125: 'dv', - 2067: 'nl-BE', - 1043: 'nl', - 3081: 'en-AU', - 10249: 'en-BZ', - 4105: 'en-CA', - 9225: 'en-029', - 16393: 'en-IN', - 6153: 'en-IE', - 8201: 'en-JM', - 17417: 'en-MY', - 5129: 'en-NZ', - 13321: 'en-PH', - 18441: 'en-SG', - 7177: 'en-ZA', - 11273: 'en-TT', - 2057: 'en-GB', - 1033: 'en', - 12297: 'en-ZW', - 1061: 'et', - 1080: 'fo', - 1124: 'fil', - 1035: 'fi', - 2060: 'fr-BE', - 3084: 'fr-CA', - 1036: 'fr', - 5132: 'fr-LU', - 6156: 'fr-MC', - 4108: 'fr-CH', - 1122: 'fy', - 1110: 'gl', - 1079: 'ka', - 3079: 'de-AT', - 1031: 'de', - 5127: 'de-LI', - 4103: 'de-LU', - 2055: 'de-CH', - 1032: 'el', - 1135: 'kl', - 1095: 'gu', - 1128: 'ha', - 1037: 'he', - 1081: 'hi', - 1038: 'hu', - 1039: 'is', - 1136: 'ig', - 1057: 'id', - 1117: 'iu', - 2141: 'iu-Latn', - 2108: 'ga', - 1076: 'xh', - 1077: 'zu', - 1040: 'it', - 2064: 'it-CH', - 1041: 'ja', - 1099: 'kn', - 1087: 'kk', - 1107: 'km', - 1158: 'quc', - 1159: 'rw', - 1089: 'sw', - 1111: 'kok', - 1042: 'ko', - 1088: 'ky', - 1108: 'lo', - 1062: 'lv', - 1063: 'lt', - 2094: 'dsb', - 1134: 'lb', - 1071: 'mk', - 2110: 'ms-BN', - 1086: 'ms', - 1100: 'ml', - 1082: 'mt', - 1153: 'mi', - 1146: 'arn', - 1102: 'mr', - 1148: 'moh', - 1104: 'mn', - 2128: 'mn-CN', - 1121: 'ne', - 1044: 'nb', - 2068: 'nn', - 1154: 'oc', - 1096: 'or', - 1123: 'ps', - 1045: 'pl', - 1046: 'pt', - 2070: 'pt-PT', - 1094: 'pa', - 1131: 'qu-BO', - 2155: 'qu-EC', - 3179: 'qu', - 1048: 'ro', - 1047: 'rm', - 1049: 'ru', - 9275: 'smn', - 4155: 'smj-NO', - 5179: 'smj', - 3131: 'se-FI', - 1083: 'se', - 2107: 'se-SE', - 8251: 'sms', - 6203: 'sma-NO', - 7227: 'sms', - 1103: 'sa', - 7194: 'sr-Cyrl-BA', - 3098: 'sr', - 6170: 'sr-Latn-BA', - 2074: 'sr-Latn', - 1132: 'nso', - 1074: 'tn', - 1115: 'si', - 1051: 'sk', - 1060: 'sl', - 11274: 'es-AR', - 16394: 'es-BO', - 13322: 'es-CL', - 9226: 'es-CO', - 5130: 'es-CR', - 7178: 'es-DO', - 12298: 'es-EC', - 17418: 'es-SV', - 4106: 'es-GT', - 18442: 'es-HN', - 2058: 'es-MX', - 19466: 'es-NI', - 6154: 'es-PA', - 15370: 'es-PY', - 10250: 'es-PE', - 20490: 'es-PR', - // Microsoft has defined two different language codes for - // “Spanish with modern sorting” and “Spanish with traditional - // sorting”. This makes sense for collation APIs, and it would be - // possible to express this in BCP 47 language tags via Unicode - // extensions (eg., es-u-co-trad is Spanish with traditional - // sorting). However, for storing names in fonts, the distinction - // does not make sense, so we give “es” in both cases. - 3082: 'es', - 1034: 'es', - 21514: 'es-US', - 14346: 'es-UY', - 8202: 'es-VE', - 2077: 'sv-FI', - 1053: 'sv', - 1114: 'syr', - 1064: 'tg', - 2143: 'tzm', - 1097: 'ta', - 1092: 'tt', - 1098: 'te', - 1054: 'th', - 1105: 'bo', - 1055: 'tr', - 1090: 'tk', - 1152: 'ug', - 1058: 'uk', - 1070: 'hsb', - 1056: 'ur', - 2115: 'uz-Cyrl', - 1091: 'uz', - 1066: 'vi', - 1106: 'cy', - 1160: 'wo', - 1157: 'sah', - 1144: 'ii', - 1130: 'yo' - }; - // Returns a IETF BCP 47 language code, for example 'zh-Hant' - // for 'Chinese in the traditional script'. - function getLanguageCode(platformID, languageID, ltag) { - switch (platformID) { - case 0: - // Unicode - if (languageID === 65535) { - return 'und'; - } else if (ltag) { - return ltag[languageID]; - } - break; - case 1: - // Macintosh - return macLanguages[languageID]; - case 3: - // Windows - return windowsLanguages[languageID]; - } - return undefined; - } - var utf16 = 'utf-16'; - // MacOS script ID → encoding. This table stores the default case, - // which can be overridden by macLanguageEncodings. - var macScriptEncodings = { - 0: 'macintosh', - // smRoman - 1: 'x-mac-japanese', - // smJapanese - 2: 'x-mac-chinesetrad', - // smTradChinese - 3: 'x-mac-korean', - // smKorean - 6: 'x-mac-greek', - // smGreek - 7: 'x-mac-cyrillic', - // smCyrillic - 9: 'x-mac-devanagai', - // smDevanagari - 10: 'x-mac-gurmukhi', - // smGurmukhi - 11: 'x-mac-gujarati', - // smGujarati - 12: 'x-mac-oriya', - // smOriya - 13: 'x-mac-bengali', - // smBengali - 14: 'x-mac-tamil', - // smTamil - 15: 'x-mac-telugu', - // smTelugu - 16: 'x-mac-kannada', - // smKannada - 17: 'x-mac-malayalam', - // smMalayalam - 18: 'x-mac-sinhalese', - // smSinhalese - 19: 'x-mac-burmese', - // smBurmese - 20: 'x-mac-khmer', - // smKhmer - 21: 'x-mac-thai', - // smThai - 22: 'x-mac-lao', - // smLao - 23: 'x-mac-georgian', - // smGeorgian - 24: 'x-mac-armenian', - // smArmenian - 25: 'x-mac-chinesesimp', - // smSimpChinese - 26: 'x-mac-tibetan', - // smTibetan - 27: 'x-mac-mongolian', - // smMongolian - 28: 'x-mac-ethiopic', - // smEthiopic - 29: 'x-mac-ce', - // smCentralEuroRoman - 30: 'x-mac-vietnamese', - // smVietnamese - 31: 'x-mac-extarabic' // smExtArabic - }; - // MacOS language ID → encoding. This table stores the exceptional - // cases, which override macScriptEncodings. For writing MacOS naming - // tables, we need to emit a MacOS script ID. Therefore, we cannot - // merge macScriptEncodings into macLanguageEncodings. - // - // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt - var macLanguageEncodings = { - 15: 'x-mac-icelandic', - // langIcelandic - 17: 'x-mac-turkish', - // langTurkish - 18: 'x-mac-croatian', - // langCroatian - 24: 'x-mac-ce', - // langLithuanian - 25: 'x-mac-ce', - // langPolish - 26: 'x-mac-ce', - // langHungarian - 27: 'x-mac-ce', - // langEstonian - 28: 'x-mac-ce', - // langLatvian - 30: 'x-mac-icelandic', - // langFaroese - 37: 'x-mac-romanian', - // langRomanian - 38: 'x-mac-ce', - // langCzech - 39: 'x-mac-ce', - // langSlovak - 40: 'x-mac-ce', - // langSlovenian - 143: 'x-mac-inuit', - // langInuktitut - 146: 'x-mac-gaelic' // langIrishGaelicScript - }; - function getEncoding(platformID, encodingID, languageID) { - switch (platformID) { - case 0: - // Unicode - return utf16; - case 1: - // Apple Macintosh - return macLanguageEncodings[languageID] || macScriptEncodings[encodingID]; - case 3: - // Microsoft Windows - if (encodingID === 1 || encodingID === 10) { - return utf16; - } - break; - } - return undefined; - } // Parse the naming `name` table. - // FIXME: Format 1 additional fields are not supported yet. - // ltag is the content of the `ltag' table, such as ['en', 'zh-Hans', 'de-CH-1904']. - - function parseNameTable(data, start, ltag) { - var name = { - }; - var p = new parse.Parser(data, start); - var format = p.parseUShort(); - var count = p.parseUShort(); - var stringOffset = p.offset + p.parseUShort(); - for (var i = 0; i < count; i++) { - var platformID = p.parseUShort(); - var encodingID = p.parseUShort(); - var languageID = p.parseUShort(); - var nameID = p.parseUShort(); - var property = nameTableNames[nameID] || nameID; - var byteLength = p.parseUShort(); - var offset = p.parseUShort(); - var language = getLanguageCode(platformID, languageID, ltag); - var encoding = getEncoding(platformID, encodingID, languageID); - if (encoding !== undefined && language !== undefined) { - var text = void 0; - if (encoding === utf16) { - text = decode.UTF16(data, stringOffset + offset, byteLength); - } else { - text = decode.MACSTRING(data, stringOffset + offset, byteLength, encoding); - } - if (text) { - var translations = name[property]; - if (translations === undefined) { - translations = name[property] = { - }; - } - translations[language] = text; - } - } - } - var langTagCount = 0; - if (format === 1) { - // FIXME: Also handle Microsoft's 'name' table 1. - langTagCount = p.parseUShort(); - } - return name; - } // {23: 'foo'} → {'foo': 23} - // ['bar', 'baz'] → {'bar': 0, 'baz': 1} - - function reverseDict(dict) { - var result = { - }; - for (var key in dict) { - result[dict[key]] = parseInt(key); - } - return result; - } - function makeNameRecord(platformID, encodingID, languageID, nameID, length, offset) { - return new table.Record('NameRecord', [ - { - name: 'platformID', - type: 'USHORT', - value: platformID - }, - { - name: 'encodingID', - type: 'USHORT', - value: encodingID - }, - { - name: 'languageID', - type: 'USHORT', - value: languageID - }, - { - name: 'nameID', - type: 'USHORT', - value: nameID - }, - { - name: 'length', - type: 'USHORT', - value: length - }, - { - name: 'offset', - type: 'USHORT', - value: offset - } - ]); - } // Finds the position of needle in haystack, or -1 if not there. - // Like String.indexOf(), but for arrays. - - function findSubArray(needle, haystack) { - var needleLength = needle.length; - var limit = haystack.length - needleLength + 1; - loop: for (var pos = 0; pos < limit; pos++) { - for (; pos < limit; pos++) { - for (var k = 0; k < needleLength; k++) { - if (haystack[pos + k] !== needle[k]) { - continue loop; - } - } - return pos; - } - } - return - 1; - } - function addStringToPool(s, pool) { - var offset = findSubArray(s, pool); - if (offset < 0) { - offset = pool.length; - var i = 0; - var len = s.length; - for (; i < len; ++i) { - pool.push(s[i]); - } - } - return offset; - } - function makeNameTable(names, ltag) { - var nameID; - var nameIDs = [ - ]; - var namesWithNumericKeys = { - }; - var nameTableIds = reverseDict(nameTableNames); - for (var key in names) { - var id = nameTableIds[key]; - if (id === undefined) { - id = key; - } - nameID = parseInt(id); - if (isNaN(nameID)) { - throw new Error('Name table entry "' + key + '" does not exist, see nameTableNames for complete list.'); - } - namesWithNumericKeys[nameID] = names[key]; - nameIDs.push(nameID); - } - var macLanguageIds = reverseDict(macLanguages); - var windowsLanguageIds = reverseDict(windowsLanguages); - var nameRecords = [ - ]; - var stringPool = [ - ]; - for (var i = 0; i < nameIDs.length; i++) { - nameID = nameIDs[i]; - var translations = namesWithNumericKeys[nameID]; - for (var lang in translations) { - var text = translations[lang]; - // For MacOS, we try to emit the name in the form that was introduced - // in the initial version of the TrueType spec (in the late 1980s). - // However, this can fail for various reasons: the requested BCP 47 - // language code might not have an old-style Mac equivalent; - // we might not have a codec for the needed character encoding; - // or the name might contain characters that cannot be expressed - // in the old-style Macintosh encoding. In case of failure, we emit - // the name in a more modern fashion (Unicode encoding with BCP 47 - // language tags) that is recognized by MacOS 10.5, released in 2009. - // If fonts were only read by operating systems, we could simply - // emit all names in the modern form; this would be much easier. - // However, there are many applications and libraries that read - // 'name' tables directly, and these will usually only recognize - // the ancient form (silently skipping the unrecognized names). - var macPlatform = 1; // Macintosh - var macLanguage = macLanguageIds[lang]; - var macScript = macLanguageToScript[macLanguage]; - var macEncoding = getEncoding(macPlatform, macScript, macLanguage); - var macName = encode.MACSTRING(text, macEncoding); - if (macName === undefined) { - macPlatform = 0; // Unicode - macLanguage = ltag.indexOf(lang); - if (macLanguage < 0) { - macLanguage = ltag.length; - ltag.push(lang); - } - macScript = 4; // Unicode 2.0 and later - macName = encode.UTF16(text); - } - var macNameOffset = addStringToPool(macName, stringPool); - nameRecords.push(makeNameRecord(macPlatform, macScript, macLanguage, nameID, macName.length, macNameOffset)); - var winLanguage = windowsLanguageIds[lang]; - if (winLanguage !== undefined) { - var winName = encode.UTF16(text); - var winNameOffset = addStringToPool(winName, stringPool); - nameRecords.push(makeNameRecord(3, 1, winLanguage, nameID, winName.length, winNameOffset)); - } - } - } - nameRecords.sort(function (a, b) { - return a.platformID - b.platformID || a.encodingID - b.encodingID || a.languageID - b.languageID || a.nameID - b.nameID; - }); - var t = new table.Table('name', [ - { - name: 'format', - type: 'USHORT', - value: 0 - }, - { - name: 'count', - type: 'USHORT', - value: nameRecords.length - }, - { - name: 'stringOffset', - type: 'USHORT', - value: 6 + nameRecords.length * 12 - } - ]); - for (var r = 0; r < nameRecords.length; r++) { - t.fields.push({ - name: 'record_' + r, - type: 'RECORD', - value: nameRecords[r] - }); - } - t.fields.push({ - name: 'strings', - type: 'LITERAL', - value: stringPool - }); - return t; - } - var _name = { - parse: parseNameTable, - make: makeNameTable - }; - // The `OS/2` table contains metrics required in OpenType fonts. - var unicodeRanges = [ - { - begin: 0, - end: 127 - }, - // Basic Latin - { - begin: 128, - end: 255 - }, - // Latin-1 Supplement - { - begin: 256, - end: 383 - }, - // Latin Extended-A - { - begin: 384, - end: 591 - }, - // Latin Extended-B - { - begin: 592, - end: 687 - }, - // IPA Extensions - { - begin: 688, - end: 767 - }, - // Spacing Modifier Letters - { - begin: 768, - end: 879 - }, - // Combining Diacritical Marks - { - begin: 880, - end: 1023 - }, - // Greek and Coptic - { - begin: 11392, - end: 11519 - }, - // Coptic - { - begin: 1024, - end: 1279 - }, - // Cyrillic - { - begin: 1328, - end: 1423 - }, - // Armenian - { - begin: 1424, - end: 1535 - }, - // Hebrew - { - begin: 42240, - end: 42559 - }, - // Vai - { - begin: 1536, - end: 1791 - }, - // Arabic - { - begin: 1984, - end: 2047 - }, - // NKo - { - begin: 2304, - end: 2431 - }, - // Devanagari - { - begin: 2432, - end: 2559 - }, - // Bengali - { - begin: 2560, - end: 2687 - }, - // Gurmukhi - { - begin: 2688, - end: 2815 - }, - // Gujarati - { - begin: 2816, - end: 2943 - }, - // Oriya - { - begin: 2944, - end: 3071 - }, - // Tamil - { - begin: 3072, - end: 3199 - }, - // Telugu - { - begin: 3200, - end: 3327 - }, - // Kannada - { - begin: 3328, - end: 3455 - }, - // Malayalam - { - begin: 3584, - end: 3711 - }, - // Thai - { - begin: 3712, - end: 3839 - }, - // Lao - { - begin: 4256, - end: 4351 - }, - // Georgian - { - begin: 6912, - end: 7039 - }, - // Balinese - { - begin: 4352, - end: 4607 - }, - // Hangul Jamo - { - begin: 7680, - end: 7935 - }, - // Latin Extended Additional - { - begin: 7936, - end: 8191 - }, - // Greek Extended - { - begin: 8192, - end: 8303 - }, - // General Punctuation - { - begin: 8304, - end: 8351 - }, - // Superscripts And Subscripts - { - begin: 8352, - end: 8399 - }, - // Currency Symbol - { - begin: 8400, - end: 8447 - }, - // Combining Diacritical Marks For Symbols - { - begin: 8448, - end: 8527 - }, - // Letterlike Symbols - { - begin: 8528, - end: 8591 - }, - // Number Forms - { - begin: 8592, - end: 8703 - }, - // Arrows - { - begin: 8704, - end: 8959 - }, - // Mathematical Operators - { - begin: 8960, - end: 9215 - }, - // Miscellaneous Technical - { - begin: 9216, - end: 9279 - }, - // Control Pictures - { - begin: 9280, - end: 9311 - }, - // Optical Character Recognition - { - begin: 9312, - end: 9471 - }, - // Enclosed Alphanumerics - { - begin: 9472, - end: 9599 - }, - // Box Drawing - { - begin: 9600, - end: 9631 - }, - // Block Elements - { - begin: 9632, - end: 9727 - }, - // Geometric Shapes - { - begin: 9728, - end: 9983 - }, - // Miscellaneous Symbols - { - begin: 9984, - end: 10175 - }, - // Dingbats - { - begin: 12288, - end: 12351 - }, - // CJK Symbols And Punctuation - { - begin: 12352, - end: 12447 - }, - // Hiragana - { - begin: 12448, - end: 12543 - }, - // Katakana - { - begin: 12544, - end: 12591 - }, - // Bopomofo - { - begin: 12592, - end: 12687 - }, - // Hangul Compatibility Jamo - { - begin: 43072, - end: 43135 - }, - // Phags-pa - { - begin: 12800, - end: 13055 - }, - // Enclosed CJK Letters And Months - { - begin: 13056, - end: 13311 - }, - // CJK Compatibility - { - begin: 44032, - end: 55215 - }, - // Hangul Syllables - { - begin: 55296, - end: 57343 - }, - // Non-Plane 0 * - { - begin: 67840, - end: 67871 - }, - // Phoenicia - { - begin: 19968, - end: 40959 - }, - // CJK Unified Ideographs - { - begin: 57344, - end: 63743 - }, - // Private Use Area (plane 0) - { - begin: 12736, - end: 12783 - }, - // CJK Strokes - { - begin: 64256, - end: 64335 - }, - // Alphabetic Presentation Forms - { - begin: 64336, - end: 65023 - }, - // Arabic Presentation Forms-A - { - begin: 65056, - end: 65071 - }, - // Combining Half Marks - { - begin: 65040, - end: 65055 - }, - // Vertical Forms - { - begin: 65104, - end: 65135 - }, - // Small Form Variants - { - begin: 65136, - end: 65279 - }, - // Arabic Presentation Forms-B - { - begin: 65280, - end: 65519 - }, - // Halfwidth And Fullwidth Forms - { - begin: 65520, - end: 65535 - }, - // Specials - { - begin: 3840, - end: 4095 - }, - // Tibetan - { - begin: 1792, - end: 1871 - }, - // Syriac - { - begin: 1920, - end: 1983 - }, - // Thaana - { - begin: 3456, - end: 3583 - }, - // Sinhala - { - begin: 4096, - end: 4255 - }, - // Myanmar - { - begin: 4608, - end: 4991 - }, - // Ethiopic - { - begin: 5024, - end: 5119 - }, - // Cherokee - { - begin: 5120, - end: 5759 - }, - // Unified Canadian Aboriginal Syllabics - { - begin: 5760, - end: 5791 - }, - // Ogham - { - begin: 5792, - end: 5887 - }, - // Runic - { - begin: 6016, - end: 6143 - }, - // Khmer - { - begin: 6144, - end: 6319 - }, - // Mongolian - { - begin: 10240, - end: 10495 - }, - // Braille Patterns - { - begin: 40960, - end: 42127 - }, - // Yi Syllables - { - begin: 5888, - end: 5919 - }, - // Tagalog - { - begin: 66304, - end: 66351 - }, - // Old Italic - { - begin: 66352, - end: 66383 - }, - // Gothic - { - begin: 66560, - end: 66639 - }, - // Deseret - { - begin: 118784, - end: 119039 - }, - // Byzantine Musical Symbols - { - begin: 119808, - end: 120831 - }, - // Mathematical Alphanumeric Symbols - { - begin: 1044480, - end: 1048573 - }, - // Private Use (plane 15) - { - begin: 65024, - end: 65039 - }, - // Variation Selectors - { - begin: 917504, - end: 917631 - }, - // Tags - { - begin: 6400, - end: 6479 - }, - // Limbu - { - begin: 6480, - end: 6527 - }, - // Tai Le - { - begin: 6528, - end: 6623 - }, - // New Tai Lue - { - begin: 6656, - end: 6687 - }, - // Buginese - { - begin: 11264, - end: 11359 - }, - // Glagolitic - { - begin: 11568, - end: 11647 - }, - // Tifinagh - { - begin: 19904, - end: 19967 - }, - // Yijing Hexagram Symbols - { - begin: 43008, - end: 43055 - }, - // Syloti Nagri - { - begin: 65536, - end: 65663 - }, - // Linear B Syllabary - { - begin: 65856, - end: 65935 - }, - // Ancient Greek Numbers - { - begin: 66432, - end: 66463 - }, - // Ugaritic - { - begin: 66464, - end: 66527 - }, - // Old Persian - { - begin: 66640, - end: 66687 - }, - // Shavian - { - begin: 66688, - end: 66735 - }, - // Osmanya - { - begin: 67584, - end: 67647 - }, - // Cypriot Syllabary - { - begin: 68096, - end: 68191 - }, - // Kharoshthi - { - begin: 119552, - end: 119647 - }, - // Tai Xuan Jing Symbols - { - begin: 73728, - end: 74751 - }, - // Cuneiform - { - begin: 119648, - end: 119679 - }, - // Counting Rod Numerals - { - begin: 7040, - end: 7103 - }, - // Sundanese - { - begin: 7168, - end: 7247 - }, - // Lepcha - { - begin: 7248, - end: 7295 - }, - // Ol Chiki - { - begin: 43136, - end: 43231 - }, - // Saurashtra - { - begin: 43264, - end: 43311 - }, - // Kayah Li - { - begin: 43312, - end: 43359 - }, - // Rejang - { - begin: 43520, - end: 43615 - }, - // Cham - { - begin: 65936, - end: 65999 - }, - // Ancient Symbols - { - begin: 66000, - end: 66047 - }, - // Phaistos Disc - { - begin: 66208, - end: 66271 - }, - // Carian - { - begin: 127024, - end: 127135 - } // Domino Tiles - - ]; - function getUnicodeRange(unicode) { - for (var i = 0; i < unicodeRanges.length; i += 1) { - var range = unicodeRanges[i]; - if (unicode >= range.begin && unicode < range.end) { - return i; - } - } - return - 1; - } // Parse the OS/2 and Windows metrics `OS/2` table - - function parseOS2Table(data, start) { - var os2 = { - }; - var p = new parse.Parser(data, start); - os2.version = p.parseUShort(); - os2.xAvgCharWidth = p.parseShort(); - os2.usWeightClass = p.parseUShort(); - os2.usWidthClass = p.parseUShort(); - os2.fsType = p.parseUShort(); - os2.ySubscriptXSize = p.parseShort(); - os2.ySubscriptYSize = p.parseShort(); - os2.ySubscriptXOffset = p.parseShort(); - os2.ySubscriptYOffset = p.parseShort(); - os2.ySuperscriptXSize = p.parseShort(); - os2.ySuperscriptYSize = p.parseShort(); - os2.ySuperscriptXOffset = p.parseShort(); - os2.ySuperscriptYOffset = p.parseShort(); - os2.yStrikeoutSize = p.parseShort(); - os2.yStrikeoutPosition = p.parseShort(); - os2.sFamilyClass = p.parseShort(); - os2.panose = [ - ]; - for (var i = 0; i < 10; i++) { - os2.panose[i] = p.parseByte(); - } - os2.ulUnicodeRange1 = p.parseULong(); - os2.ulUnicodeRange2 = p.parseULong(); - os2.ulUnicodeRange3 = p.parseULong(); - os2.ulUnicodeRange4 = p.parseULong(); - os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte()); - os2.fsSelection = p.parseUShort(); - os2.usFirstCharIndex = p.parseUShort(); - os2.usLastCharIndex = p.parseUShort(); - os2.sTypoAscender = p.parseShort(); - os2.sTypoDescender = p.parseShort(); - os2.sTypoLineGap = p.parseShort(); - os2.usWinAscent = p.parseUShort(); - os2.usWinDescent = p.parseUShort(); - if (os2.version >= 1) { - os2.ulCodePageRange1 = p.parseULong(); - os2.ulCodePageRange2 = p.parseULong(); - } - if (os2.version >= 2) { - os2.sxHeight = p.parseShort(); - os2.sCapHeight = p.parseShort(); - os2.usDefaultChar = p.parseUShort(); - os2.usBreakChar = p.parseUShort(); - os2.usMaxContent = p.parseUShort(); - } - return os2; - } - function makeOS2Table(options) { - return new table.Table('OS/2', [ - { - name: 'version', - type: 'USHORT', - value: 3 - }, - { - name: 'xAvgCharWidth', - type: 'SHORT', - value: 0 - }, - { - name: 'usWeightClass', - type: 'USHORT', - value: 0 - }, - { - name: 'usWidthClass', - type: 'USHORT', - value: 0 - }, - { - name: 'fsType', - type: 'USHORT', - value: 0 - }, - { - name: 'ySubscriptXSize', - type: 'SHORT', - value: 650 - }, - { - name: 'ySubscriptYSize', - type: 'SHORT', - value: 699 - }, - { - name: 'ySubscriptXOffset', - type: 'SHORT', - value: 0 - }, - { - name: 'ySubscriptYOffset', - type: 'SHORT', - value: 140 - }, - { - name: 'ySuperscriptXSize', - type: 'SHORT', - value: 650 - }, - { - name: 'ySuperscriptYSize', - type: 'SHORT', - value: 699 - }, - { - name: 'ySuperscriptXOffset', - type: 'SHORT', - value: 0 - }, - { - name: 'ySuperscriptYOffset', - type: 'SHORT', - value: 479 - }, - { - name: 'yStrikeoutSize', - type: 'SHORT', - value: 49 - }, - { - name: 'yStrikeoutPosition', - type: 'SHORT', - value: 258 - }, - { - name: 'sFamilyClass', - type: 'SHORT', - value: 0 - }, - { - name: 'bFamilyType', - type: 'BYTE', - value: 0 - }, - { - name: 'bSerifStyle', - type: 'BYTE', - value: 0 - }, - { - name: 'bWeight', - type: 'BYTE', - value: 0 - }, - { - name: 'bProportion', - type: 'BYTE', - value: 0 - }, - { - name: 'bContrast', - type: 'BYTE', - value: 0 - }, - { - name: 'bStrokeVariation', - type: 'BYTE', - value: 0 - }, - { - name: 'bArmStyle', - type: 'BYTE', - value: 0 - }, - { - name: 'bLetterform', - type: 'BYTE', - value: 0 - }, - { - name: 'bMidline', - type: 'BYTE', - value: 0 - }, - { - name: 'bXHeight', - type: 'BYTE', - value: 0 - }, - { - name: 'ulUnicodeRange1', - type: 'ULONG', - value: 0 - }, - { - name: 'ulUnicodeRange2', - type: 'ULONG', - value: 0 - }, - { - name: 'ulUnicodeRange3', - type: 'ULONG', - value: 0 - }, - { - name: 'ulUnicodeRange4', - type: 'ULONG', - value: 0 - }, - { - name: 'achVendID', - type: 'CHARARRAY', - value: 'XXXX' - }, - { - name: 'fsSelection', - type: 'USHORT', - value: 0 - }, - { - name: 'usFirstCharIndex', - type: 'USHORT', - value: 0 - }, - { - name: 'usLastCharIndex', - type: 'USHORT', - value: 0 - }, - { - name: 'sTypoAscender', - type: 'SHORT', - value: 0 - }, - { - name: 'sTypoDescender', - type: 'SHORT', - value: 0 - }, - { - name: 'sTypoLineGap', - type: 'SHORT', - value: 0 - }, - { - name: 'usWinAscent', - type: 'USHORT', - value: 0 - }, - { - name: 'usWinDescent', - type: 'USHORT', - value: 0 - }, - { - name: 'ulCodePageRange1', - type: 'ULONG', - value: 0 - }, - { - name: 'ulCodePageRange2', - type: 'ULONG', - value: 0 - }, - { - name: 'sxHeight', - type: 'SHORT', - value: 0 - }, - { - name: 'sCapHeight', - type: 'SHORT', - value: 0 - }, - { - name: 'usDefaultChar', - type: 'USHORT', - value: 0 - }, - { - name: 'usBreakChar', - type: 'USHORT', - value: 0 - }, - { - name: 'usMaxContext', - type: 'USHORT', - value: 0 - } - ], options); - } - var os2 = { - parse: parseOS2Table, - make: makeOS2Table, - unicodeRanges: unicodeRanges, - getUnicodeRange: getUnicodeRange - }; - // The `post` table stores additional PostScript information, such as glyph names. - // Parse the PostScript `post` table - function parsePostTable(data, start) { - var post = { - }; - var p = new parse.Parser(data, start); - post.version = p.parseVersion(); - post.italicAngle = p.parseFixed(); - post.underlinePosition = p.parseShort(); - post.underlineThickness = p.parseShort(); - post.isFixedPitch = p.parseULong(); - post.minMemType42 = p.parseULong(); - post.maxMemType42 = p.parseULong(); - post.minMemType1 = p.parseULong(); - post.maxMemType1 = p.parseULong(); - switch (post.version) { - case 1: - post.names = standardNames.slice(); - break; - case 2: - post.numberOfGlyphs = p.parseUShort(); - post.glyphNameIndex = new Array(post.numberOfGlyphs); - for (var i = 0; i < post.numberOfGlyphs; i++) { - post.glyphNameIndex[i] = p.parseUShort(); - } - post.names = [ - ]; - for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { - if (post.glyphNameIndex[i$1] >= standardNames.length) { - var nameLength = p.parseChar(); - post.names.push(p.parseString(nameLength)); - } - } - break; - case 2.5: - post.numberOfGlyphs = p.parseUShort(); - post.offset = new Array(post.numberOfGlyphs); - for (var i$2 = 0; i$2 < post.numberOfGlyphs; i$2++) { - post.offset[i$2] = p.parseChar(); - } - break; - } - return post; - } - function makePostTable() { - return new table.Table('post', [ - { - name: 'version', - type: 'FIXED', - value: 196608 - }, - { - name: 'italicAngle', - type: 'FIXED', - value: 0 - }, - { - name: 'underlinePosition', - type: 'FWORD', - value: 0 - }, - { - name: 'underlineThickness', - type: 'FWORD', - value: 0 - }, - { - name: 'isFixedPitch', - type: 'ULONG', - value: 0 - }, - { - name: 'minMemType42', - type: 'ULONG', - value: 0 - }, - { - name: 'maxMemType42', - type: 'ULONG', - value: 0 - }, - { - name: 'minMemType1', - type: 'ULONG', - value: 0 - }, - { - name: 'maxMemType1', - type: 'ULONG', - value: 0 - } - ]); - } - var post = { - parse: parsePostTable, - make: makePostTable - }; - // The `GSUB` table contains ligatures, among other things. - var subtableParsers = new Array(9); // subtableParsers[0] is unused - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#SS - subtableParsers[1] = function parseLookup1() { - var start = this.offset + this.relativeOffset; - var substFormat = this.parseUShort(); - if (substFormat === 1) { - return { - substFormat: 1, - coverage: this.parsePointer(Parser.coverage), - deltaGlyphId: this.parseUShort() - }; - } else if (substFormat === 2) { - return { - substFormat: 2, - coverage: this.parsePointer(Parser.coverage), - substitute: this.parseOffset16List() - }; - } - check.assert(false, '0x' + start.toString(16) + ': lookup type 1 format must be 1 or 2.'); - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#MS - subtableParsers[2] = function parseLookup2() { - var substFormat = this.parseUShort(); - check.argument(substFormat === 1, 'GSUB Multiple Substitution Subtable identifier-format must be 1'); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - sequences: this.parseListOfLists() - }; - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#AS - subtableParsers[3] = function parseLookup3() { - var substFormat = this.parseUShort(); - check.argument(substFormat === 1, 'GSUB Alternate Substitution Subtable identifier-format must be 1'); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - alternateSets: this.parseListOfLists() - }; - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#LS - subtableParsers[4] = function parseLookup4() { - var substFormat = this.parseUShort(); - check.argument(substFormat === 1, 'GSUB ligature table identifier-format must be 1'); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - ligatureSets: this.parseListOfLists(function () { - return { - ligGlyph: this.parseUShort(), - components: this.parseUShortList(this.parseUShort() - 1) - }; - }) - }; - }; - var lookupRecordDesc = { - sequenceIndex: Parser.uShort, - lookupListIndex: Parser.uShort - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CSF - subtableParsers[5] = function parseLookup5() { - var start = this.offset + this.relativeOffset; - var substFormat = this.parseUShort(); - if (substFormat === 1) { - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - ruleSets: this.parseListOfLists(function () { - var glyphCount = this.parseUShort(); - var substCount = this.parseUShort(); - return { - input: this.parseUShortList(glyphCount - 1), - lookupRecords: this.parseRecordList(substCount, lookupRecordDesc) - }; - }) - }; - } else if (substFormat === 2) { - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - classDef: this.parsePointer(Parser.classDef), - classSets: this.parseListOfLists(function () { - var glyphCount = this.parseUShort(); - var substCount = this.parseUShort(); - return { - classes: this.parseUShortList(glyphCount - 1), - lookupRecords: this.parseRecordList(substCount, lookupRecordDesc) - }; - }) - }; - } else if (substFormat === 3) { - var glyphCount = this.parseUShort(); - var substCount = this.parseUShort(); - return { - substFormat: substFormat, - coverages: this.parseList(glyphCount, Parser.pointer(Parser.coverage)), - lookupRecords: this.parseRecordList(substCount, lookupRecordDesc) - }; - } - check.assert(false, '0x' + start.toString(16) + ': lookup type 5 format must be 1, 2 or 3.'); - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CC - subtableParsers[6] = function parseLookup6() { - var start = this.offset + this.relativeOffset; - var substFormat = this.parseUShort(); - if (substFormat === 1) { - return { - substFormat: 1, - coverage: this.parsePointer(Parser.coverage), - chainRuleSets: this.parseListOfLists(function () { - return { - backtrack: this.parseUShortList(), - input: this.parseUShortList(this.parseShort() - 1), - lookahead: this.parseUShortList(), - lookupRecords: this.parseRecordList(lookupRecordDesc) - }; - }) - }; - } else if (substFormat === 2) { - return { - substFormat: 2, - coverage: this.parsePointer(Parser.coverage), - backtrackClassDef: this.parsePointer(Parser.classDef), - inputClassDef: this.parsePointer(Parser.classDef), - lookaheadClassDef: this.parsePointer(Parser.classDef), - chainClassSet: this.parseListOfLists(function () { - return { - backtrack: this.parseUShortList(), - input: this.parseUShortList(this.parseShort() - 1), - lookahead: this.parseUShortList(), - lookupRecords: this.parseRecordList(lookupRecordDesc) - }; - }) - }; - } else if (substFormat === 3) { - return { - substFormat: 3, - backtrackCoverage: this.parseList(Parser.pointer(Parser.coverage)), - inputCoverage: this.parseList(Parser.pointer(Parser.coverage)), - lookaheadCoverage: this.parseList(Parser.pointer(Parser.coverage)), - lookupRecords: this.parseRecordList(lookupRecordDesc) - }; - } - check.assert(false, '0x' + start.toString(16) + ': lookup type 6 format must be 1, 2 or 3.'); - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#ES - subtableParsers[7] = function parseLookup7() { - // Extension Substitution subtable - var substFormat = this.parseUShort(); - check.argument(substFormat === 1, 'GSUB Extension Substitution subtable identifier-format must be 1'); - var extensionLookupType = this.parseUShort(); - var extensionParser = new Parser(this.data, this.offset + this.parseULong()); - return { - substFormat: 1, - lookupType: extensionLookupType, - extension: subtableParsers[extensionLookupType].call(extensionParser) - }; - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#RCCS - subtableParsers[8] = function parseLookup8() { - var substFormat = this.parseUShort(); - check.argument(substFormat === 1, 'GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1'); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - backtrackCoverage: this.parseList(Parser.pointer(Parser.coverage)), - lookaheadCoverage: this.parseList(Parser.pointer(Parser.coverage)), - substitutes: this.parseUShortList() - }; - }; - // https://www.microsoft.com/typography/OTSPEC/gsub.htm - function parseGsubTable(data, start) { - start = start || 0; - var p = new Parser(data, start); - var tableVersion = p.parseVersion(1); - check.argument(tableVersion === 1 || tableVersion === 1.1, 'Unsupported GSUB table version.'); - if (tableVersion === 1) { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers) - }; - } else { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers), - variations: p.parseFeatureVariationsList() - }; - } - } // GSUB Writing ////////////////////////////////////////////// - - var subtableMakers = new Array(9); - subtableMakers[1] = function makeLookup1(subtable) { - if (subtable.substFormat === 1) { - return new table.Table('substitutionTable', [ - { - name: 'substFormat', - type: 'USHORT', - value: 1 - }, - { - name: 'coverage', - type: 'TABLE', - value: new table.Coverage(subtable.coverage) - }, - { - name: 'deltaGlyphID', - type: 'USHORT', - value: subtable.deltaGlyphId - } - ]); - } else { - return new table.Table('substitutionTable', [ - { - name: 'substFormat', - type: 'USHORT', - value: 2 - }, - { - name: 'coverage', - type: 'TABLE', - value: new table.Coverage(subtable.coverage) - } - ].concat(table.ushortList('substitute', subtable.substitute))); - } - check.fail('Lookup type 1 substFormat must be 1 or 2.'); - }; - subtableMakers[3] = function makeLookup3(subtable) { - check.assert(subtable.substFormat === 1, 'Lookup type 3 substFormat must be 1.'); - return new table.Table('substitutionTable', [ - { - name: 'substFormat', - type: 'USHORT', - value: 1 - }, - { - name: 'coverage', - type: 'TABLE', - value: new table.Coverage(subtable.coverage) - } - ].concat(table.tableList('altSet', subtable.alternateSets, function (alternateSet) { - return new table.Table('alternateSetTable', table.ushortList('alternate', alternateSet)); - }))); - }; - subtableMakers[4] = function makeLookup4(subtable) { - check.assert(subtable.substFormat === 1, 'Lookup type 4 substFormat must be 1.'); - return new table.Table('substitutionTable', [ - { - name: 'substFormat', - type: 'USHORT', - value: 1 - }, - { - name: 'coverage', - type: 'TABLE', - value: new table.Coverage(subtable.coverage) - } - ].concat(table.tableList('ligSet', subtable.ligatureSets, function (ligatureSet) { - return new table.Table('ligatureSetTable', table.tableList('ligature', ligatureSet, function (ligature) { - return new table.Table('ligatureTable', [ - { - name: 'ligGlyph', - type: 'USHORT', - value: ligature.ligGlyph - } - ].concat(table.ushortList('component', ligature.components, ligature.components.length + 1))); - })); - }))); - }; - function makeGsubTable(gsub) { - return new table.Table('GSUB', [ - { - name: 'version', - type: 'ULONG', - value: 65536 - }, - { - name: 'scripts', - type: 'TABLE', - value: new table.ScriptList(gsub.scripts) - }, - { - name: 'features', - type: 'TABLE', - value: new table.FeatureList(gsub.features) - }, - { - name: 'lookups', - type: 'TABLE', - value: new table.LookupList(gsub.lookups, subtableMakers) - } - ]); - } - var gsub = { - parse: parseGsubTable, - make: makeGsubTable - }; - // The `GPOS` table contains kerning pairs, among other things. - // Parse the metadata `meta` table. - // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html - function parseMetaTable(data, start) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseULong(); - check.argument(tableVersion === 1, 'Unsupported META table version.'); - p.parseULong(); // flags - currently unused and set to 0 - p.parseULong(); // tableOffset - var numDataMaps = p.parseULong(); - var tags = { - }; - for (var i = 0; i < numDataMaps; i++) { - var tag = p.parseTag(); - var dataOffset = p.parseULong(); - var dataLength = p.parseULong(); - var text = decode.UTF8(data, start + dataOffset, dataLength); - tags[tag] = text; - } - return tags; - } - function makeMetaTable(tags) { - var numTags = Object.keys(tags).length; - var stringPool = ''; - var stringPoolOffset = 16 + numTags * 12; - var result = new table.Table('meta', [ - { - name: 'version', - type: 'ULONG', - value: 1 - }, - { - name: 'flags', - type: 'ULONG', - value: 0 - }, - { - name: 'offset', - type: 'ULONG', - value: stringPoolOffset - }, - { - name: 'numTags', - type: 'ULONG', - value: numTags - } - ]); - for (var tag in tags) { - var pos = stringPool.length; - stringPool += tags[tag]; - result.fields.push({ - name: 'tag ' + tag, - type: 'TAG', - value: tag - }); - result.fields.push({ - name: 'offset ' + tag, - type: 'ULONG', - value: stringPoolOffset + pos - }); - result.fields.push({ - name: 'length ' + tag, - type: 'ULONG', - value: tags[tag].length - }); - } - result.fields.push({ - name: 'stringPool', - type: 'CHARARRAY', - value: stringPool - }); - return result; - } - var meta = { - parse: parseMetaTable, - make: makeMetaTable - }; - // The `sfnt` wrapper provides organization for the tables in the font. - function log2(v) { - return Math.log(v) / Math.log(2) | 0; - } - function computeCheckSum(bytes) { - while (bytes.length % 4 !== 0) { - bytes.push(0); - } - var sum = 0; - for (var i = 0; i < bytes.length; i += 4) { - sum += (bytes[i] << 24) + (bytes[i + 1] << 16) + (bytes[i + 2] << 8) + bytes[i + 3]; - } - sum %= Math.pow(2, 32); - return sum; - } - function makeTableRecord(tag, checkSum, offset, length) { - return new table.Record('Table Record', [ - { - name: 'tag', - type: 'TAG', - value: tag !== undefined ? tag : '' - }, - { - name: 'checkSum', - type: 'ULONG', - value: checkSum !== undefined ? checkSum : 0 - }, - { - name: 'offset', - type: 'ULONG', - value: offset !== undefined ? offset : 0 - }, - { - name: 'length', - type: 'ULONG', - value: length !== undefined ? length : 0 - } - ]); - } - function makeSfntTable(tables) { - var sfnt = new table.Table('sfnt', [ - { - name: 'version', - type: 'TAG', - value: 'OTTO' - }, - { - name: 'numTables', - type: 'USHORT', - value: 0 - }, - { - name: 'searchRange', - type: 'USHORT', - value: 0 - }, - { - name: 'entrySelector', - type: 'USHORT', - value: 0 - }, - { - name: 'rangeShift', - type: 'USHORT', - value: 0 - } - ]); - sfnt.tables = tables; - sfnt.numTables = tables.length; - var highestPowerOf2 = Math.pow(2, log2(sfnt.numTables)); - sfnt.searchRange = 16 * highestPowerOf2; - sfnt.entrySelector = log2(highestPowerOf2); - sfnt.rangeShift = sfnt.numTables * 16 - sfnt.searchRange; - var recordFields = [ - ]; - var tableFields = [ - ]; - var offset = sfnt.sizeOf() + makeTableRecord().sizeOf() * sfnt.numTables; - while (offset % 4 !== 0) { - offset += 1; - tableFields.push({ - name: 'padding', - type: 'BYTE', - value: 0 - }); - } - for (var i = 0; i < tables.length; i += 1) { - var t = tables[i]; - check.argument(t.tableName.length === 4, 'Table name' + t.tableName + ' is invalid.'); - var tableLength = t.sizeOf(); - var tableRecord = makeTableRecord(t.tableName, computeCheckSum(t.encode()), offset, tableLength); - recordFields.push({ - name: tableRecord.tag + ' Table Record', - type: 'RECORD', - value: tableRecord - }); - tableFields.push({ - name: t.tableName + ' table', - type: 'RECORD', - value: t - }); - offset += tableLength; - check.argument(!isNaN(offset), 'Something went wrong calculating the offset.'); - while (offset % 4 !== 0) { - offset += 1; - tableFields.push({ - name: 'padding', - type: 'BYTE', - value: 0 - }); - } - } // Table records need to be sorted alphabetically. - - recordFields.sort(function (r1, r2) { - if (r1.value.tag > r2.value.tag) { - return 1; - } else { - return - 1; - } - }); - sfnt.fields = sfnt.fields.concat(recordFields); - sfnt.fields = sfnt.fields.concat(tableFields); - return sfnt; - } // Get the metrics for a character. If the string has more than one character - // this function returns metrics for the first available character. - // You can provide optional fallback metrics if no characters are available. - - function metricsForChar(font, chars, notFoundMetrics) { - for (var i = 0; i < chars.length; i += 1) { - var glyphIndex = font.charToGlyphIndex(chars[i]); - if (glyphIndex > 0) { - var glyph = font.glyphs.get(glyphIndex); - return glyph.getMetrics(); - } - } - return notFoundMetrics; - } - function average(vs) { - var sum = 0; - for (var i = 0; i < vs.length; i += 1) { - sum += vs[i]; - } - return sum / vs.length; - } // Convert the font object to a SFNT data structure. - // This structure contains all the necessary tables and metadata to create a binary OTF file. - - function fontToSfntTable(font) { - var xMins = [ - ]; - var yMins = [ - ]; - var xMaxs = [ - ]; - var yMaxs = [ - ]; - var advanceWidths = [ - ]; - var leftSideBearings = [ - ]; - var rightSideBearings = [ - ]; - var firstCharIndex; - var lastCharIndex = 0; - var ulUnicodeRange1 = 0; - var ulUnicodeRange2 = 0; - var ulUnicodeRange3 = 0; - var ulUnicodeRange4 = 0; - for (var i = 0; i < font.glyphs.length; i += 1) { - var glyph = font.glyphs.get(i); - var unicode = glyph.unicode | 0; - if (isNaN(glyph.advanceWidth)) { - throw new Error('Glyph ' + glyph.name + ' (' + i + '): advanceWidth is not a number.'); - } - if (firstCharIndex > unicode || firstCharIndex === undefined) { - // ignore .notdef char - if (unicode > 0) { - firstCharIndex = unicode; - } - } - if (lastCharIndex < unicode) { - lastCharIndex = unicode; - } - var position = os2.getUnicodeRange(unicode); - if (position < 32) { - ulUnicodeRange1 |= 1 << position; - } else if (position < 64) { - ulUnicodeRange2 |= 1 << position - 32; - } else if (position < 96) { - ulUnicodeRange3 |= 1 << position - 64; - } else if (position < 123) { - ulUnicodeRange4 |= 1 << position - 96; - } else { - throw new Error('Unicode ranges bits > 123 are reserved for internal usage'); - } // Skip non-important characters. - - if (glyph.name === '.notdef') { - continue; - } - var metrics = glyph.getMetrics(); - xMins.push(metrics.xMin); - yMins.push(metrics.yMin); - xMaxs.push(metrics.xMax); - yMaxs.push(metrics.yMax); - leftSideBearings.push(metrics.leftSideBearing); - rightSideBearings.push(metrics.rightSideBearing); - advanceWidths.push(glyph.advanceWidth); - } - var globals = { - xMin: Math.min.apply(null, xMins), - yMin: Math.min.apply(null, yMins), - xMax: Math.max.apply(null, xMaxs), - yMax: Math.max.apply(null, yMaxs), - advanceWidthMax: Math.max.apply(null, advanceWidths), - advanceWidthAvg: average(advanceWidths), - minLeftSideBearing: Math.min.apply(null, leftSideBearings), - maxLeftSideBearing: Math.max.apply(null, leftSideBearings), - minRightSideBearing: Math.min.apply(null, rightSideBearings) - }; - globals.ascender = font.ascender; - globals.descender = font.descender; - var headTable = head.make({ - flags: 3, - // 00000011 (baseline for font at y=0; left sidebearing point at x=0) - unitsPerEm: font.unitsPerEm, - xMin: globals.xMin, - yMin: globals.yMin, - xMax: globals.xMax, - yMax: globals.yMax, - lowestRecPPEM: 3, - createdTimestamp: font.createdTimestamp - }); - var hheaTable = hhea.make({ - ascender: globals.ascender, - descender: globals.descender, - advanceWidthMax: globals.advanceWidthMax, - minLeftSideBearing: globals.minLeftSideBearing, - minRightSideBearing: globals.minRightSideBearing, - xMaxExtent: globals.maxLeftSideBearing + (globals.xMax - globals.xMin), - numberOfHMetrics: font.glyphs.length - }); - var maxpTable = maxp.make(font.glyphs.length); - var os2Table = os2.make({ - xAvgCharWidth: Math.round(globals.advanceWidthAvg), - usWeightClass: font.tables.os2.usWeightClass, - usWidthClass: font.tables.os2.usWidthClass, - usFirstCharIndex: firstCharIndex, - usLastCharIndex: lastCharIndex, - ulUnicodeRange1: ulUnicodeRange1, - ulUnicodeRange2: ulUnicodeRange2, - ulUnicodeRange3: ulUnicodeRange3, - ulUnicodeRange4: ulUnicodeRange4, - fsSelection: font.tables.os2.fsSelection, - // REGULAR - // See http://typophile.com/node/13081 for more info on vertical metrics. - // We get metrics for typical characters (such as "x" for xHeight). - // We provide some fallback characters if characters are unavailable: their - // ordering was chosen experimentally. - sTypoAscender: globals.ascender, - sTypoDescender: globals.descender, - sTypoLineGap: 0, - usWinAscent: globals.yMax, - usWinDescent: Math.abs(globals.yMin), - ulCodePageRange1: 1, - // FIXME: hard-code Latin 1 support for now - sxHeight: metricsForChar(font, 'xyvw', { - yMax: Math.round(globals.ascender / 2) - }).yMax, - sCapHeight: metricsForChar(font, 'HIKLEFJMNTZBDPRAGOQSUVWXY', globals).yMax, - usDefaultChar: font.hasChar(' ') ? 32 : 0, - // Use space as the default character, if available. - usBreakChar: font.hasChar(' ') ? 32 : 0 // Use space as the break character, if available. - }); - var hmtxTable = hmtx.make(font.glyphs); - var cmapTable = cmap.make(font.glyphs); - var englishFamilyName = font.getEnglishName('fontFamily'); - var englishStyleName = font.getEnglishName('fontSubfamily'); - var englishFullName = englishFamilyName + ' ' + englishStyleName; - var postScriptName = font.getEnglishName('postScriptName'); - if (!postScriptName) { - postScriptName = englishFamilyName.replace(/\s/g, '') + '-' + englishStyleName; - } - var names = { - }; - for (var n in font.names) { - names[n] = font.names[n]; - } - if (!names.uniqueID) { - names.uniqueID = { - en: font.getEnglishName('manufacturer') + ':' + englishFullName - }; - } - if (!names.postScriptName) { - names.postScriptName = { - en: postScriptName - }; - } - if (!names.preferredFamily) { - names.preferredFamily = font.names.fontFamily; - } - if (!names.preferredSubfamily) { - names.preferredSubfamily = font.names.fontSubfamily; - } - var languageTags = [ - ]; - var nameTable = _name.make(names, languageTags); - var ltagTable = languageTags.length > 0 ? ltag.make(languageTags) : undefined; - var postTable = post.make(); - var cffTable = cff.make(font.glyphs, { - version: font.getEnglishName('version'), - fullName: englishFullName, - familyName: englishFamilyName, - weightName: englishStyleName, - postScriptName: postScriptName, - unitsPerEm: font.unitsPerEm, - fontBBox: [ - 0, - globals.yMin, - globals.ascender, - globals.advanceWidthMax - ] - }); - var metaTable = font.metas && Object.keys(font.metas).length > 0 ? meta.make(font.metas) : undefined; - // The order does not matter because makeSfntTable() will sort them. - var tables = [ - headTable, - hheaTable, - maxpTable, - os2Table, - nameTable, - cmapTable, - postTable, - cffTable, - hmtxTable - ]; - if (ltagTable) { - tables.push(ltagTable); - } // Optional tables - - if (font.tables.gsub) { - tables.push(gsub.make(font.tables.gsub)); - } - if (metaTable) { - tables.push(metaTable); - } - var sfntTable = makeSfntTable(tables); - // Compute the font's checkSum and store it in head.checkSumAdjustment. - var bytes = sfntTable.encode(); - var checkSum = computeCheckSum(bytes); - var tableFields = sfntTable.fields; - var checkSumAdjusted = false; - for (var i$1 = 0; i$1 < tableFields.length; i$1 += 1) { - if (tableFields[i$1].name === 'head table') { - tableFields[i$1].value.checkSumAdjustment = 2981146554 - checkSum; - checkSumAdjusted = true; - break; - } - } - if (!checkSumAdjusted) { - throw new Error('Could not find head table with checkSum to adjust.'); - } - return sfntTable; - } - var sfnt = { - make: makeSfntTable, - fontToTable: fontToSfntTable, - computeCheckSum: computeCheckSum - }; - // The Layout object is the prototype of Substitution objects, and provides - function searchTag(arr, tag) { - /* jshint bitwise: false */ - var imin = 0; - var imax = arr.length - 1; - while (imin <= imax) { - var imid = imin + imax >>> 1; - var val = arr[imid].tag; - if (val === tag) { - return imid; - } else if (val < tag) { - imin = imid + 1; - } else { - imax = imid - 1; - } - } // Not found: return -1-insertion point - - return - imin - 1; - } - function binSearch(arr, value) { - /* jshint bitwise: false */ - var imin = 0; - var imax = arr.length - 1; - while (imin <= imax) { - var imid = imin + imax >>> 1; - var val = arr[imid]; - if (val === value) { - return imid; - } else if (val < value) { - imin = imid + 1; - } else { - imax = imid - 1; - } - } // Not found: return -1-insertion point - - return - imin - 1; - } // binary search in a list of ranges (coverage, class definition) - - function searchRange(ranges, value) { - // jshint bitwise: false - var range; - var imin = 0; - var imax = ranges.length - 1; - while (imin <= imax) { - var imid = imin + imax >>> 1; - range = ranges[imid]; - var start = range.start; - if (start === value) { - return range; - } else if (start < value) { - imin = imid + 1; - } else { - imax = imid - 1; - } - } - if (imin > 0) { - range = ranges[imin - 1]; - if (value > range.end) { - return 0; - } - return range; - } - } /** - * @exports opentype.Layout - * @class - */ - - function Layout(font, tableName) { - this.font = font; - this.tableName = tableName; - } - Layout.prototype = { - /** - * Binary search an object by "tag" property - * @instance - * @function searchTag - * @memberof opentype.Layout - * @param {Array} arr - * @param {string} tag - * @return {number} - */ - searchTag: searchTag, - /** - * Binary search in a list of numbers - * @instance - * @function binSearch - * @memberof opentype.Layout - * @param {Array} arr - * @param {number} value - * @return {number} - */ - binSearch: binSearch, - /** - * Get or create the Layout table (GSUB, GPOS etc). - * @param {boolean} create - Whether to create a new one. - * @return {Object} The GSUB or GPOS table. - */ - getTable: function (create) { - var layout = this.font.tables[this.tableName]; - if (!layout && create) { - layout = this.font.tables[this.tableName] = this.createDefaultTable(); - } - return layout; - }, - /** - * Returns all scripts in the substitution table. - * @instance - * @return {Array} - */ - getScriptNames: function () { - var layout = this.getTable(); - if (!layout) { - return []; - } - return layout.scripts.map(function (script) { - return script.tag; - }); - }, - /** - * Returns the best bet for a script name. - * Returns 'DFLT' if it exists. - * If not, returns 'latn' if it exists. - * If neither exist, returns undefined. - */ - getDefaultScriptName: function () { - var layout = this.getTable(); - if (!layout) { - return; - } - var hasLatn = false; - for (var i = 0; i < layout.scripts.length; i++) { - var name = layout.scripts[i].tag; - if (name === 'DFLT') { - return name; - } - if (name === 'latn') { - hasLatn = true; - } - } - if (hasLatn) { - return 'latn'; - } - }, - /** - * Returns all LangSysRecords in the given script. - * @instance - * @param {string} [script='DFLT'] - * @param {boolean} create - forces the creation of this script table if it doesn't exist. - * @return {Object} An object with tag and script properties. - */ - getScriptTable: function (script, create) { - var layout = this.getTable(create); - if (layout) { - script = script || 'DFLT'; - var scripts = layout.scripts; - var pos = searchTag(layout.scripts, script); - if (pos >= 0) { - return scripts[pos].script; - } else if (create) { - var scr = { - tag: script, - script: { - defaultLangSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [ - ] - }, - langSysRecords: [ - ] - } - }; - scripts.splice( - 1 - pos, 0, scr); - return scr.script; - } - } - }, - /** - * Returns a language system table - * @instance - * @param {string} [script='DFLT'] - * @param {string} [language='dlft'] - * @param {boolean} create - forces the creation of this langSysTable if it doesn't exist. - * @return {Object} - */ - getLangSysTable: function (script, language, create) { - var scriptTable = this.getScriptTable(script, create); - if (scriptTable) { - if (!language || language === 'dflt' || language === 'DFLT') { - return scriptTable.defaultLangSys; - } - var pos = searchTag(scriptTable.langSysRecords, language); - if (pos >= 0) { - return scriptTable.langSysRecords[pos].langSys; - } else if (create) { - var langSysRecord = { - tag: language, - langSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [ - ] - } - }; - scriptTable.langSysRecords.splice( - 1 - pos, 0, langSysRecord); - return langSysRecord.langSys; - } - } - }, - /** - * Get a specific feature table. - * @instance - * @param {string} [script='DFLT'] - * @param {string} [language='dlft'] - * @param {string} feature - One of the codes listed at https://www.microsoft.com/typography/OTSPEC/featurelist.htm - * @param {boolean} create - forces the creation of the feature table if it doesn't exist. - * @return {Object} - */ - getFeatureTable: function (script, language, feature, create) { - var langSysTable = this.getLangSysTable(script, language, create); - if (langSysTable) { - var featureRecord; - var featIndexes = langSysTable.featureIndexes; - var allFeatures = this.font.tables[this.tableName].features; - // The FeatureIndex array of indices is in arbitrary order, - // even if allFeatures is sorted alphabetically by feature tag. - for (var i = 0; i < featIndexes.length; i++) { - featureRecord = allFeatures[featIndexes[i]]; - if (featureRecord.tag === feature) { - return featureRecord.feature; - } - } - if (create) { - var index = allFeatures.length; - // Automatic ordering of features would require to shift feature indexes in the script list. - check.assert(index === 0 || feature >= allFeatures[index - 1].tag, 'Features must be added in alphabetical order.'); - featureRecord = { - tag: feature, - feature: { - params: 0, - lookupListIndexes: [ - ] - } - }; - allFeatures.push(featureRecord); - featIndexes.push(index); - return featureRecord.feature; - } - } - }, - /** - * Get the lookup tables of a given type for a script/language/feature. - * @instance - * @param {string} [script='DFLT'] - * @param {string} [language='dlft'] - * @param {string} feature - 4-letter feature code - * @param {number} lookupType - 1 to 9 - * @param {boolean} create - forces the creation of the lookup table if it doesn't exist, with no subtables. - * @return {Object[]} - */ - getLookupTables: function (script, language, feature, lookupType, create) { - var featureTable = this.getFeatureTable(script, language, feature, create); - var tables = [ - ]; - if (featureTable) { - var lookupTable; - var lookupListIndexes = featureTable.lookupListIndexes; - var allLookups = this.font.tables[this.tableName].lookups; - // lookupListIndexes are in no particular order, so use naive search. - for (var i = 0; i < lookupListIndexes.length; i++) { - lookupTable = allLookups[lookupListIndexes[i]]; - if (lookupTable.lookupType === lookupType) { - tables.push(lookupTable); - } - } - if (tables.length === 0 && create) { - lookupTable = { - lookupType: lookupType, - lookupFlag: 0, - subtables: [ - ], - markFilteringSet: undefined - }; - var index = allLookups.length; - allLookups.push(lookupTable); - lookupListIndexes.push(index); - return [lookupTable]; - } - } - return tables; - }, - /** - * Find a glyph in a class definition table - * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#class-definition-table - * @param {object} classDefTable - an OpenType Layout class definition table - * @param {number} glyphIndex - the index of the glyph to find - * @returns {number} -1 if not found - */ - getGlyphClass: function (classDefTable, glyphIndex) { - switch (classDefTable.format) { - case 1: - if (classDefTable.startGlyph <= glyphIndex && glyphIndex < classDefTable.startGlyph + classDefTable.classes.length) { - return classDefTable.classes[glyphIndex - classDefTable.startGlyph]; - } - return 0; - case 2: - var range = searchRange(classDefTable.ranges, glyphIndex); - return range ? range.classId : 0; - } - }, - /** - * Find a glyph in a coverage table - * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#coverage-table - * @param {object} coverageTable - an OpenType Layout coverage table - * @param {number} glyphIndex - the index of the glyph to find - * @returns {number} -1 if not found - */ - getCoverageIndex: function (coverageTable, glyphIndex) { - switch (coverageTable.format) { - case 1: - var index = binSearch(coverageTable.glyphs, glyphIndex); - return index >= 0 ? index : - 1; - case 2: - var range = searchRange(coverageTable.ranges, glyphIndex); - return range ? range.index + glyphIndex - range.start : - 1; - } - }, - /** - * Returns the list of glyph indexes of a coverage table. - * Format 1: the list is stored raw - * Format 2: compact list as range records. - * @instance - * @param {Object} coverageTable - * @return {Array} - */ - expandCoverage: function (coverageTable) { - if (coverageTable.format === 1) { - return coverageTable.glyphs; - } else { - var glyphs = [ - ]; - var ranges = coverageTable.ranges; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - var start = range.start; - var end = range.end; - for (var j = start; j <= end; j++) { - glyphs.push(j); - } - } - return glyphs; - } - } - }; - // The Position object provides utility methods to manipulate - /** - * @exports opentype.Position - * @class - * @extends opentype.Layout - * @param {opentype.Font} - * @constructor - */ - function Position(font) { - Layout.call(this, font, 'gpos'); - } - Position.prototype = Layout.prototype; - /** - * Init some data for faster and easier access later. - */ - Position.prototype.init = function () { - var script = this.getDefaultScriptName(); - this.defaultKerningTables = this.getKerningTables(script); - }; - /** - * Find a glyph pair in a list of lookup tables of type 2 and retrieve the xAdvance kerning value. - * - * @param {integer} leftIndex - left glyph index - * @param {integer} rightIndex - right glyph index - * @returns {integer} - */ - Position.prototype.getKerningValue = function (kerningLookups, leftIndex, rightIndex) { - var this$1 = this; - for (var i = 0; i < kerningLookups.length; i++) { - var subtables = kerningLookups[i].subtables; - for (var j = 0; j < subtables.length; j++) { - var subtable = subtables[j]; - var covIndex = this$1.getCoverageIndex(subtable.coverage, leftIndex); - if (covIndex < 0) { - continue; - } - switch (subtable.posFormat) { - case 1: - // Search Pair Adjustment Positioning Format 1 - var pairSet = subtable.pairSets[covIndex]; - for (var k = 0; k < pairSet.length; k++) { - var pair = pairSet[k]; - if (pair.secondGlyph === rightIndex) { - return pair.value1 && pair.value1.xAdvance || 0; - } - } - break; - // left glyph found, not right glyph - try next subtable - case 2: - // Search Pair Adjustment Positioning Format 2 - var class1 = this$1.getGlyphClass(subtable.classDef1, leftIndex); - var class2 = this$1.getGlyphClass(subtable.classDef2, rightIndex); - var pair$1 = subtable.classRecords[class1][class2]; - return pair$1.value1 && pair$1.value1.xAdvance || 0; - } - } - } - return 0; - }; - /** - * List all kerning lookup tables. - * - * @param {string} [script='DFLT'] - use font.position.getDefaultScriptName() for a better default value - * @param {string} [language='dflt'] - * @return {object[]} The list of kerning lookup tables (may be empty), or undefined if there is no GPOS table (and we should use the kern table) - */ - Position.prototype.getKerningTables = function (script, language) { - if (this.font.tables.gpos) { - return this.getLookupTables(script, language, 'kern', 2); - } - }; - // The Substitution object provides utility methods to manipulate - /** - * @exports opentype.Substitution - * @class - * @extends opentype.Layout - * @param {opentype.Font} - * @constructor - */ - function Substitution(font) { - Layout.call(this, font, 'gsub'); - } // Check if 2 arrays of primitives are equal. - - function arraysEqual(ar1, ar2) { - var n = ar1.length; - if (n !== ar2.length) { - return false; - } - for (var i = 0; i < n; i++) { - if (ar1[i] !== ar2[i]) { - return false; - } - } - return true; - } // Find the first subtable of a lookup table in a particular format. - - function getSubstFormat(lookupTable, format, defaultSubtable) { - var subtables = lookupTable.subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - if (subtable.substFormat === format) { - return subtable; - } - } - if (defaultSubtable) { - subtables.push(defaultSubtable); - return defaultSubtable; - } - return undefined; - } - Substitution.prototype = Layout.prototype; - /** - * Create a default GSUB table. - * @return {Object} gsub - The GSUB table. - */ - Substitution.prototype.createDefaultTable = function () { - // Generate a default empty GSUB table with just a DFLT script and dflt lang sys. - return { - version: 1, - scripts: [ - { - tag: 'DFLT', - script: { - defaultLangSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [ - ] - }, - langSysRecords: [ - ] - } - } - ], - features: [ - ], - lookups: [ - ] - }; - }; - /** - * List all single substitutions (lookup type 1) for a given script, language, and feature. - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @param {string} feature - 4-character feature name ('aalt', 'salt', 'ss01'...) - * @return {Array} substitutions - The list of substitutions. - */ - Substitution.prototype.getSingle = function (feature, script, language) { - var this$1 = this; - var substitutions = [ - ]; - var lookupTables = this.getLookupTables(script, language, feature, 1); - for (var idx = 0; idx < lookupTables.length; idx++) { - var subtables = lookupTables[idx].subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - var glyphs = this$1.expandCoverage(subtable.coverage); - var j = void 0; - if (subtable.substFormat === 1) { - var delta = subtable.deltaGlyphId; - for (j = 0; j < glyphs.length; j++) { - var glyph = glyphs[j]; - substitutions.push({ - sub: glyph, - by: glyph + delta - }); - } - } else { - var substitute = subtable.substitute; - for (j = 0; j < glyphs.length; j++) { - substitutions.push({ - sub: glyphs[j], - by: substitute[j] - }); - } - } - } - } - return substitutions; - }; - /** - * List all alternates (lookup type 3) for a given script, language, and feature. - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @param {string} feature - 4-character feature name ('aalt', 'salt'...) - * @return {Array} alternates - The list of alternates - */ - Substitution.prototype.getAlternates = function (feature, script, language) { - var this$1 = this; - var alternates = [ - ]; - var lookupTables = this.getLookupTables(script, language, feature, 3); - for (var idx = 0; idx < lookupTables.length; idx++) { - var subtables = lookupTables[idx].subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - var glyphs = this$1.expandCoverage(subtable.coverage); - var alternateSets = subtable.alternateSets; - for (var j = 0; j < glyphs.length; j++) { - alternates.push({ - sub: glyphs[j], - by: alternateSets[j] - }); - } - } - } - return alternates; - }; - /** - * List all ligatures (lookup type 4) for a given script, language, and feature. - * The result is an array of ligature objects like { sub: [ids], by: id } - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @return {Array} ligatures - The list of ligatures. - */ - Substitution.prototype.getLigatures = function (feature, script, language) { - var this$1 = this; - var ligatures = [ - ]; - var lookupTables = this.getLookupTables(script, language, feature, 4); - for (var idx = 0; idx < lookupTables.length; idx++) { - var subtables = lookupTables[idx].subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - var glyphs = this$1.expandCoverage(subtable.coverage); - var ligatureSets = subtable.ligatureSets; - for (var j = 0; j < glyphs.length; j++) { - var startGlyph = glyphs[j]; - var ligSet = ligatureSets[j]; - for (var k = 0; k < ligSet.length; k++) { - var lig = ligSet[k]; - ligatures.push({ - sub: [ - startGlyph - ].concat(lig.components), - by: lig.ligGlyph - }); - } - } - } - } - return ligatures; - }; - /** - * Add or modify a single substitution (lookup type 1) - * Format 2, more flexible, is always used. - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {Object} substitution - { sub: id, delta: number } for format 1 or { sub: id, by: id } for format 2. - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.addSingle = function (feature, substitution, script, language) { - var lookupTable = this.getLookupTables(script, language, feature, 1, true) [0]; - var subtable = getSubstFormat(lookupTable, 2, { - // lookup type 1 subtable, format 2, coverage format 1 - substFormat: 2, - coverage: { - format: 1, - glyphs: [ - ] - }, - substitute: [ - ] - }); - check.assert(subtable.coverage.format === 1, 'Ligature: unable to modify coverage table format ' + subtable.coverage.format); - var coverageGlyph = substitution.sub; - var pos = this.binSearch(subtable.coverage.glyphs, coverageGlyph); - if (pos < 0) { - pos = - 1 - pos; - subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); - subtable.substitute.splice(pos, 0, 0); - } - subtable.substitute[pos] = substitution.by; - }; - /** - * Add or modify an alternate substitution (lookup type 1) - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {Object} substitution - { sub: id, by: [ids] } - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.addAlternate = function (feature, substitution, script, language) { - var lookupTable = this.getLookupTables(script, language, feature, 3, true) [0]; - var subtable = getSubstFormat(lookupTable, 1, { - // lookup type 3 subtable, format 1, coverage format 1 - substFormat: 1, - coverage: { - format: 1, - glyphs: [ - ] - }, - alternateSets: [ - ] - }); - check.assert(subtable.coverage.format === 1, 'Ligature: unable to modify coverage table format ' + subtable.coverage.format); - var coverageGlyph = substitution.sub; - var pos = this.binSearch(subtable.coverage.glyphs, coverageGlyph); - if (pos < 0) { - pos = - 1 - pos; - subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); - subtable.alternateSets.splice(pos, 0, 0); - } - subtable.alternateSets[pos] = substitution.by; - }; - /** - * Add a ligature (lookup type 4) - * Ligatures with more components must be stored ahead of those with fewer components in order to be found - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {Object} ligature - { sub: [ids], by: id } - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.addLigature = function (feature, ligature, script, language) { - var lookupTable = this.getLookupTables(script, language, feature, 4, true) [0]; - var subtable = lookupTable.subtables[0]; - if (!subtable) { - subtable = { - // lookup type 4 subtable, format 1, coverage format 1 - substFormat: 1, - coverage: { - format: 1, - glyphs: [ - ] - }, - ligatureSets: [ - ] - }; - lookupTable.subtables[0] = subtable; - } - check.assert(subtable.coverage.format === 1, 'Ligature: unable to modify coverage table format ' + subtable.coverage.format); - var coverageGlyph = ligature.sub[0]; - var ligComponents = ligature.sub.slice(1); - var ligatureTable = { - ligGlyph: ligature.by, - components: ligComponents - }; - var pos = this.binSearch(subtable.coverage.glyphs, coverageGlyph); - if (pos >= 0) { - // ligatureSet already exists - var ligatureSet = subtable.ligatureSets[pos]; - for (var i = 0; i < ligatureSet.length; i++) { - // If ligature already exists, return. - if (arraysEqual(ligatureSet[i].components, ligComponents)) { - return; - } - } // ligature does not exist: add it. - - ligatureSet.push(ligatureTable); - } else { - // Create a new ligatureSet and add coverage for the first glyph. - pos = - 1 - pos; - subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); - subtable.ligatureSets.splice(pos, 0, [ - ligatureTable - ]); - } - }; - /** - * List all feature data for a given script and language. - * @param {string} feature - 4-letter feature name - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @return {Array} substitutions - The list of substitutions. - */ - Substitution.prototype.getFeature = function (feature, script, language) { - if (/ss\d\d/.test(feature)) { - // ss01 - ss20 - return this.getSingle(feature, script, language); - } - switch (feature) { - case 'aalt': - case 'salt': - return this.getSingle(feature, script, language).concat(this.getAlternates(feature, script, language)); - case 'dlig': - case 'liga': - case 'rlig': - return this.getLigatures(feature, script, language); - } - return undefined; - }; - /** - * Add a substitution to a feature for a given script and language. - * @param {string} feature - 4-letter feature name - * @param {Object} sub - the substitution to add (an object like { sub: id or [ids], by: id or [ids] }) - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.add = function (feature, sub, script, language) { - if (/ss\d\d/.test(feature)) { - // ss01 - ss20 - return this.addSingle(feature, sub, script, language); - } - switch (feature) { - case 'aalt': - case 'salt': - if (typeof sub.by === 'number') { - return this.addSingle(feature, sub, script, language); - } - return this.addAlternate(feature, sub, script, language); - case 'dlig': - case 'liga': - case 'rlig': - return this.addLigature(feature, sub, script, language); - } - return undefined; - }; - function isBrowser() { - return typeof window !== 'undefined'; - } - function nodeBufferToArrayBuffer(buffer) { - var ab = new ArrayBuffer(buffer.length); - var view = new Uint8Array(ab); - for (var i = 0; i < buffer.length; ++i) { - view[i] = buffer[i]; - } - return ab; - } - function arrayBufferToNodeBuffer(ab) { - var buffer = new Buffer(ab.byteLength); - var view = new Uint8Array(ab); - for (var i = 0; i < buffer.length; ++i) { - buffer[i] = view[i]; - } - return buffer; - } - function checkArgument(expression, message) { - if (!expression) { - throw message; - } - } // The `glyf` table describes the glyphs in TrueType outline format. - // Parse the coordinate data for a glyph. - - function parseGlyphCoordinate(p, flag, previousValue, shortVectorBitMask, sameBitMask) { - var v; - if ((flag & shortVectorBitMask) > 0) { - // The coordinate is 1 byte long. - v = p.parseByte(); - // The `same` bit is re-used for short values to signify the sign of the value. - if ((flag & sameBitMask) === 0) { - v = - v; - } - v = previousValue + v; - } else { - // The coordinate is 2 bytes long. - // If the `same` bit is set, the coordinate is the same as the previous coordinate. - if ((flag & sameBitMask) > 0) { - v = previousValue; - } else { - // Parse the coordinate as a signed 16-bit delta value. - v = previousValue + p.parseShort(); - } - } - return v; - } // Parse a TrueType glyph. - - function parseGlyph(glyph, data, start) { - var p = new parse.Parser(data, start); - glyph.numberOfContours = p.parseShort(); - glyph._xMin = p.parseShort(); - glyph._yMin = p.parseShort(); - glyph._xMax = p.parseShort(); - glyph._yMax = p.parseShort(); - var flags; - var flag; - if (glyph.numberOfContours > 0) { - // This glyph is not a composite. - var endPointIndices = glyph.endPointIndices = [ - ]; - for (var i = 0; i < glyph.numberOfContours; i += 1) { - endPointIndices.push(p.parseUShort()); - } - glyph.instructionLength = p.parseUShort(); - glyph.instructions = [ - ]; - for (var i$1 = 0; i$1 < glyph.instructionLength; i$1 += 1) { - glyph.instructions.push(p.parseByte()); - } - var numberOfCoordinates = endPointIndices[endPointIndices.length - 1] + 1; - flags = [ - ]; - for (var i$2 = 0; i$2 < numberOfCoordinates; i$2 += 1) { - flag = p.parseByte(); - flags.push(flag); - // If bit 3 is set, we repeat this flag n times, where n is the next byte. - if ((flag & 8) > 0) { - var repeatCount = p.parseByte(); - for (var j = 0; j < repeatCount; j += 1) { - flags.push(flag); - i$2 += 1; - } - } - } - check.argument(flags.length === numberOfCoordinates, 'Bad flags.'); - if (endPointIndices.length > 0) { - var points = [ - ]; - var point; - // X/Y coordinates are relative to the previous point, except for the first point which is relative to 0,0. - if (numberOfCoordinates > 0) { - for (var i$3 = 0; i$3 < numberOfCoordinates; i$3 += 1) { - flag = flags[i$3]; - point = { - }; - point.onCurve = !!(flag & 1); - point.lastPointOfContour = endPointIndices.indexOf(i$3) >= 0; - points.push(point); - } - var px = 0; - for (var i$4 = 0; i$4 < numberOfCoordinates; i$4 += 1) { - flag = flags[i$4]; - point = points[i$4]; - point.x = parseGlyphCoordinate(p, flag, px, 2, 16); - px = point.x; - } - var py = 0; - for (var i$5 = 0; i$5 < numberOfCoordinates; i$5 += 1) { - flag = flags[i$5]; - point = points[i$5]; - point.y = parseGlyphCoordinate(p, flag, py, 4, 32); - py = point.y; - } - } - glyph.points = points; - } else { - glyph.points = [ - ]; - } - } else if (glyph.numberOfContours === 0) { - glyph.points = [ - ]; - } else { - glyph.isComposite = true; - glyph.points = [ - ]; - glyph.components = [ - ]; - var moreComponents = true; - while (moreComponents) { - flags = p.parseUShort(); - var component = { - glyphIndex: p.parseUShort(), - xScale: 1, - scale01: 0, - scale10: 0, - yScale: 1, - dx: 0, - dy: 0 - }; - if ((flags & 1) > 0) { - // The arguments are words - if ((flags & 2) > 0) { - // values are offset - component.dx = p.parseShort(); - component.dy = p.parseShort(); - } else { - // values are matched points - component.matchedPoints = [ - p.parseUShort(), - p.parseUShort() - ]; - } - } else { - // The arguments are bytes - if ((flags & 2) > 0) { - // values are offset - component.dx = p.parseChar(); - component.dy = p.parseChar(); - } else { - // values are matched points - component.matchedPoints = [ - p.parseByte(), - p.parseByte() - ]; - } - } - if ((flags & 8) > 0) { - // We have a scale - component.xScale = component.yScale = p.parseF2Dot14(); - } else if ((flags & 64) > 0) { - // We have an X / Y scale - component.xScale = p.parseF2Dot14(); - component.yScale = p.parseF2Dot14(); - } else if ((flags & 128) > 0) { - // We have a 2x2 transformation - component.xScale = p.parseF2Dot14(); - component.scale01 = p.parseF2Dot14(); - component.scale10 = p.parseF2Dot14(); - component.yScale = p.parseF2Dot14(); - } - glyph.components.push(component); - moreComponents = !!(flags & 32); - } - if (flags & 256) { - // We have instructions - glyph.instructionLength = p.parseUShort(); - glyph.instructions = [ - ]; - for (var i$6 = 0; i$6 < glyph.instructionLength; i$6 += 1) { - glyph.instructions.push(p.parseByte()); - } - } - } - } // Transform an array of points and return a new array. - - function transformPoints(points, transform) { - var newPoints = [ - ]; - for (var i = 0; i < points.length; i += 1) { - var pt = points[i]; - var newPt = { - x: transform.xScale * pt.x + transform.scale01 * pt.y + transform.dx, - y: transform.scale10 * pt.x + transform.yScale * pt.y + transform.dy, - onCurve: pt.onCurve, - lastPointOfContour: pt.lastPointOfContour - }; - newPoints.push(newPt); - } - return newPoints; - } - function getContours(points) { - var contours = [ - ]; - var currentContour = [ - ]; - for (var i = 0; i < points.length; i += 1) { - var pt = points[i]; - currentContour.push(pt); - if (pt.lastPointOfContour) { - contours.push(currentContour); - currentContour = [ - ]; - } - } - check.argument(currentContour.length === 0, 'There are still points left in the current contour.'); - return contours; - } // Convert the TrueType glyph outline to a Path. - - function getPath(points) { - var p = new Path(); - if (!points) { - return p; - } - var contours = getContours(points); - for (var contourIndex = 0; contourIndex < contours.length; ++contourIndex) { - var contour = contours[contourIndex]; - var prev = null; - var curr = contour[contour.length - 1]; - var next = contour[0]; - if (curr.onCurve) { - p.moveTo(curr.x, curr.y); - } else { - if (next.onCurve) { - p.moveTo(next.x, next.y); - } else { - // If both first and last points are off-curve, start at their middle. - var start = { - x: (curr.x + next.x) * 0.5, - y: (curr.y + next.y) * 0.5 - }; - p.moveTo(start.x, start.y); - } - } - for (var i = 0; i < contour.length; ++i) { - prev = curr; - curr = next; - next = contour[(i + 1) % contour.length]; - if (curr.onCurve) { - // This is a straight line. - p.lineTo(curr.x, curr.y); - } else { - var prev2 = prev; - var next2 = next; - if (!prev.onCurve) { - prev2 = { - x: (curr.x + prev.x) * 0.5, - y: (curr.y + prev.y) * 0.5 - }; - } - if (!next.onCurve) { - next2 = { - x: (curr.x + next.x) * 0.5, - y: (curr.y + next.y) * 0.5 - }; - } - p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y); - } - } - p.closePath(); - } - return p; - } - function buildPath(glyphs, glyph) { - if (glyph.isComposite) { - for (var j = 0; j < glyph.components.length; j += 1) { - var component = glyph.components[j]; - var componentGlyph = glyphs.get(component.glyphIndex); - // Force the ttfGlyphLoader to parse the glyph. - componentGlyph.getPath(); - if (componentGlyph.points) { - var transformedPoints = void 0; - if (component.matchedPoints === undefined) { - // component positioned by offset - transformedPoints = transformPoints(componentGlyph.points, component); - } else { - // component positioned by matched points - if (component.matchedPoints[0] > glyph.points.length - 1 || component.matchedPoints[1] > componentGlyph.points.length - 1) { - throw Error('Matched points out of range in ' + glyph.name); - } - var firstPt = glyph.points[component.matchedPoints[0]]; - var secondPt = componentGlyph.points[component.matchedPoints[1]]; - var transform = { - xScale: component.xScale, - scale01: component.scale01, - scale10: component.scale10, - yScale: component.yScale, - dx: 0, - dy: 0 - }; - secondPt = transformPoints([secondPt], transform) [0]; - transform.dx = firstPt.x - secondPt.x; - transform.dy = firstPt.y - secondPt.y; - transformedPoints = transformPoints(componentGlyph.points, transform); - } - glyph.points = glyph.points.concat(transformedPoints); - } - } - } - return getPath(glyph.points); - } // Parse all the glyphs according to the offsets from the `loca` table. - - function parseGlyfTable(data, start, loca, font) { - var glyphs = new glyphset.GlyphSet(font); - // The last element of the loca table is invalid. - for (var i = 0; i < loca.length - 1; i += 1) { - var offset = loca[i]; - var nextOffset = loca[i + 1]; - if (offset !== nextOffset) { - glyphs.push(i, glyphset.ttfGlyphLoader(font, i, parseGlyph, data, start + offset, buildPath)); - } else { - glyphs.push(i, glyphset.glyphLoader(font, i)); - } - } - return glyphs; - } - var glyf = { - getPath: getPath, - parse: parseGlyfTable - }; - /* A TrueType font hinting interpreter. - * - * (c) 2017 Axel Kittenberger - * - * This interpreter has been implemented according to this documentation: - * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html - * - * According to the documentation F24DOT6 values are used for pixels. - * That means calculation is 1/64 pixel accurate and uses integer operations. - * However, Javascript has floating point operations by default and only - * those are available. One could make a case to simulate the 1/64 accuracy - * exactly by truncating after every division operation - * (for example with << 0) to get pixel exactly results as other TrueType - * implementations. It may make sense since some fonts are pixel optimized - * by hand using DELTAP instructions. The current implementation doesn't - * and rather uses full floating point precision. - * - * xScale, yScale and rotation is currently ignored. - * - * A few non-trivial instructions are missing as I didn't encounter yet - * a font that used them to test a possible implementation. - * - * Some fonts seem to use undocumented features regarding the twilight zone. - * Only some of them are implemented as they were encountered. - * - * The exports.DEBUG statements are removed on the minified distribution file. - */ - var instructionTable; - var exec; - var execGlyph; - var execComponent; - /* - * Creates a hinting object. - * - * There ought to be exactly one - * for each truetype font that is used for hinting. - */ - function Hinting(font) { - // the font this hinting object is for - this.font = font; - this.getCommands = function (hPoints) { - return glyf.getPath(hPoints).commands; - }; - // cached states - this._fpgmState = this._prepState = undefined; - // errorState - // 0 ... all okay - // 1 ... had an error in a glyf, - // continue working but stop spamming - // the console - // 2 ... error at prep, stop hinting at this ppem - // 3 ... error at fpeg, stop hinting for this font at all - this._errorState = 0; - } /* - * Not rounding. - */ - - function roundOff(v) { - return v; - } /* - * Rounding to grid. - */ - - function roundToGrid(v) { - //Rounding in TT is supposed to "symmetrical around zero" - return Math.sign(v) * Math.round(Math.abs(v)); - } /* - * Rounding to double grid. - */ - - function roundToDoubleGrid(v) { - return Math.sign(v) * Math.round(Math.abs(v * 2)) / 2; - } /* - * Rounding to half grid. - */ - - function roundToHalfGrid(v) { - return Math.sign(v) * (Math.round(Math.abs(v) + 0.5) - 0.5); - } /* - * Rounding to up to grid. - */ - - function roundUpToGrid(v) { - return Math.sign(v) * Math.ceil(Math.abs(v)); - } /* - * Rounding to down to grid. - */ - - function roundDownToGrid(v) { - return Math.sign(v) * Math.floor(Math.abs(v)); - } /* - * Super rounding. - */ - - var roundSuper = function (v) { - var period = this.srPeriod; - var phase = this.srPhase; - var threshold = this.srThreshold; - var sign = 1; - if (v < 0) { - v = - v; - sign = - 1; - } - v += threshold - phase; - v = Math.trunc(v / period) * period; - v += phase; - // according to http://xgridfit.sourceforge.net/round.html - if (v < 0) { - return phase * sign; - } - return v * sign; - }; - /* - * Unit vector of x-axis. - */ - var xUnitVector = { - x: 1, - y: 0, - axis: 'x', - // Gets the projected distance between two points. - // o1/o2 ... if true, respective original position is used. - distance: function (p1, p2, o1, o2) { - return (o1 ? p1.xo : p1.x) - (o2 ? p2.xo : p2.x); - }, - // Moves point p so the moved position has the same relative - // position to the moved positions of rp1 and rp2 than the - // original positions had. - // - // See APPENDIX on INTERPOLATE at the bottom of this file. - interpolate: function (p, rp1, rp2, pv) { - var do1; - var do2; - var doa1; - var doa2; - var dm1; - var dm2; - var dt; - if (!pv || pv === this) { - do1 = p.xo - rp1.xo; - do2 = p.xo - rp2.xo; - dm1 = rp1.x - rp1.xo; - dm2 = rp2.x - rp2.xo; - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - p.x = p.xo + (dm1 + dm2) / 2; - return; - } - p.x = p.xo + (dm1 * doa2 + dm2 * doa1) / dt; - return; - } - do1 = pv.distance(p, rp1, true, true); - do2 = pv.distance(p, rp2, true, true); - dm1 = pv.distance(rp1, rp1, false, true); - dm2 = pv.distance(rp2, rp2, false, true); - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - xUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); - return; - } - xUnitVector.setRelative(p, p, (dm1 * doa2 + dm2 * doa1) / dt, pv, true); - }, - // Slope of line normal to this - normalSlope: Number.NEGATIVE_INFINITY, - // Sets the point 'p' relative to point 'rp' - // by the distance 'd'. - // - // See APPENDIX on SETRELATIVE at the bottom of this file. - // - // p ... point to set - // rp ... reference point - // d ... distance on projection vector - // pv ... projection vector (undefined = this) - // org ... if true, uses the original position of rp as reference. - setRelative: function (p, rp, d, pv, org) { - if (!pv || pv === this) { - p.x = (org ? rp.xo : rp.x) + d; - return; - } - var rpx = org ? rp.xo : rp.x; - var rpy = org ? rp.yo : rp.y; - var rpdx = rpx + d * pv.x; - var rpdy = rpy + d * pv.y; - p.x = rpdx + (p.y - rpdy) / pv.normalSlope; - }, - // Slope of vector line. - slope: 0, - // Touches the point p. - touch: function (p) { - p.xTouched = true; - }, - // Tests if a point p is touched. - touched: function (p) { - return p.xTouched; - }, - // Untouches the point p. - untouch: function (p) { - p.xTouched = false; - } - }; - /* - * Unit vector of y-axis. - */ - var yUnitVector = { - x: 0, - y: 1, - axis: 'y', - // Gets the projected distance between two points. - // o1/o2 ... if true, respective original position is used. - distance: function (p1, p2, o1, o2) { - return (o1 ? p1.yo : p1.y) - (o2 ? p2.yo : p2.y); - }, - // Moves point p so the moved position has the same relative - // position to the moved positions of rp1 and rp2 than the - // original positions had. - // - // See APPENDIX on INTERPOLATE at the bottom of this file. - interpolate: function (p, rp1, rp2, pv) { - var do1; - var do2; - var doa1; - var doa2; - var dm1; - var dm2; - var dt; - if (!pv || pv === this) { - do1 = p.yo - rp1.yo; - do2 = p.yo - rp2.yo; - dm1 = rp1.y - rp1.yo; - dm2 = rp2.y - rp2.yo; - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - p.y = p.yo + (dm1 + dm2) / 2; - return; - } - p.y = p.yo + (dm1 * doa2 + dm2 * doa1) / dt; - return; - } - do1 = pv.distance(p, rp1, true, true); - do2 = pv.distance(p, rp2, true, true); - dm1 = pv.distance(rp1, rp1, false, true); - dm2 = pv.distance(rp2, rp2, false, true); - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - yUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); - return; - } - yUnitVector.setRelative(p, p, (dm1 * doa2 + dm2 * doa1) / dt, pv, true); - }, - // Slope of line normal to this. - normalSlope: 0, - // Sets the point 'p' relative to point 'rp' - // by the distance 'd' - // - // See APPENDIX on SETRELATIVE at the bottom of this file. - // - // p ... point to set - // rp ... reference point - // d ... distance on projection vector - // pv ... projection vector (undefined = this) - // org ... if true, uses the original position of rp as reference. - setRelative: function (p, rp, d, pv, org) { - if (!pv || pv === this) { - p.y = (org ? rp.yo : rp.y) + d; - return; - } - var rpx = org ? rp.xo : rp.x; - var rpy = org ? rp.yo : rp.y; - var rpdx = rpx + d * pv.x; - var rpdy = rpy + d * pv.y; - p.y = rpdy + pv.normalSlope * (p.x - rpdx); - }, - // Slope of vector line. - slope: Number.POSITIVE_INFINITY, - // Touches the point p. - touch: function (p) { - p.yTouched = true; - }, - // Tests if a point p is touched. - touched: function (p) { - return p.yTouched; - }, - // Untouches the point p. - untouch: function (p) { - p.yTouched = false; - } - }; - Object.freeze(xUnitVector); - Object.freeze(yUnitVector); - /* - * Creates a unit vector that is not x- or y-axis. - */ - function UnitVector(x, y) { - this.x = x; - this.y = y; - this.axis = undefined; - this.slope = y / x; - this.normalSlope = - x / y; - Object.freeze(this); - } /* - * Gets the projected distance between two points. - * o1/o2 ... if true, respective original position is used. - */ - - UnitVector.prototype.distance = function (p1, p2, o1, o2) { - return this.x * xUnitVector.distance(p1, p2, o1, o2) + this.y * yUnitVector.distance(p1, p2, o1, o2); - }; - /* - * Moves point p so the moved position has the same relative - * position to the moved positions of rp1 and rp2 than the - * original positions had. - * - * See APPENDIX on INTERPOLATE at the bottom of this file. - */ - UnitVector.prototype.interpolate = function (p, rp1, rp2, pv) { - var dm1; - var dm2; - var do1; - var do2; - var doa1; - var doa2; - var dt; - do1 = pv.distance(p, rp1, true, true); - do2 = pv.distance(p, rp2, true, true); - dm1 = pv.distance(rp1, rp1, false, true); - dm2 = pv.distance(rp2, rp2, false, true); - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - this.setRelative(p, p, (dm1 + dm2) / 2, pv, true); - return; - } - this.setRelative(p, p, (dm1 * doa2 + dm2 * doa1) / dt, pv, true); - }; - /* - * Sets the point 'p' relative to point 'rp' - * by the distance 'd' - * - * See APPENDIX on SETRELATIVE at the bottom of this file. - * - * p ... point to set - * rp ... reference point - * d ... distance on projection vector - * pv ... projection vector (undefined = this) - * org ... if true, uses the original position of rp as reference. - */ - UnitVector.prototype.setRelative = function (p, rp, d, pv, org) { - pv = pv || this; - var rpx = org ? rp.xo : rp.x; - var rpy = org ? rp.yo : rp.y; - var rpdx = rpx + d * pv.x; - var rpdy = rpy + d * pv.y; - var pvns = pv.normalSlope; - var fvs = this.slope; - var px = p.x; - var py = p.y; - p.x = (fvs * px - pvns * rpdx + rpdy - py) / (fvs - pvns); - p.y = fvs * (p.x - px) + py; - }; - /* - * Touches the point p. - */ - UnitVector.prototype.touch = function (p) { - p.xTouched = true; - p.yTouched = true; - }; - /* - * Returns a unit vector with x/y coordinates. - */ - function getUnitVector(x, y) { - var d = Math.sqrt(x * x + y * y); - x /= d; - y /= d; - if (x === 1 && y === 0) { - return xUnitVector; - } else if (x === 0 && y === 1) { - return yUnitVector; - } else { - return new UnitVector(x, y); - } - } /* - * Creates a point in the hinting engine. - */ - - function HPoint(x, y, lastPointOfContour, onCurve) { - this.x = this.xo = Math.round(x * 64) / 64; // hinted x value and original x-value - this.y = this.yo = Math.round(y * 64) / 64; // hinted y value and original y-value - this.lastPointOfContour = lastPointOfContour; - this.onCurve = onCurve; - this.prevPointOnContour = undefined; - this.nextPointOnContour = undefined; - this.xTouched = false; - this.yTouched = false; - Object.preventExtensions(this); - } /* - * Returns the next touched point on the contour. - * - * v ... unit vector to test touch axis. - */ - - HPoint.prototype.nextTouched = function (v) { - var p = this.nextPointOnContour; - while (!v.touched(p) && p !== this) { - p = p.nextPointOnContour; - } - return p; - }; - /* - * Returns the previous touched point on the contour - * - * v ... unit vector to test touch axis. - */ - HPoint.prototype.prevTouched = function (v) { - var p = this.prevPointOnContour; - while (!v.touched(p) && p !== this) { - p = p.prevPointOnContour; - } - return p; - }; - /* - * The zero point. - */ - var HPZero = Object.freeze(new HPoint(0, 0)); - /* - * The default state of the interpreter. - * - * Note: Freezing the defaultState and then deriving from it - * makes the V8 Javascript engine going awkward, - * so this is avoided, albeit the defaultState shouldn't - * ever change. - */ - var defaultState = { - cvCutIn: 17 / 16, - // control value cut in - deltaBase: 9, - deltaShift: 0.125, - loop: 1, - // loops some instructions - minDis: 1, - // minimum distance - autoFlip: true - }; - /* - * The current state of the interpreter. - * - * env ... 'fpgm' or 'prep' or 'glyf' - * prog ... the program - */ - function State(env, prog) { - this.env = env; - this.stack = [ - ]; - this.prog = prog; - switch (env) { - case 'glyf': - this.zp0 = this.zp1 = this.zp2 = 1; - this.rp0 = this.rp1 = this.rp2 = 0; - /* fall through */ - case 'prep': - this.fv = this.pv = this.dpv = xUnitVector; - this.round = roundToGrid; - } - } /* - * Executes a glyph program. - * - * This does the hinting for each glyph. - * - * Returns an array of moved points. - * - * glyph: the glyph to hint - * ppem: the size the glyph is rendered for - */ - - Hinting.prototype.exec = function (glyph, ppem) { - if (typeof ppem !== 'number') { - throw new Error('Point size is not a number!'); - } // Received a fatal error, don't do any hinting anymore. - - if (this._errorState > 2) { - return; - } - var font = this.font; - var prepState = this._prepState; - if (!prepState || prepState.ppem !== ppem) { - var fpgmState = this._fpgmState; - if (!fpgmState) { - // Executes the fpgm state. - // This is used by fonts to define functions. - State.prototype = defaultState; - fpgmState = this._fpgmState = new State('fpgm', font.tables.fpgm); - fpgmState.funcs = [ - ]; - fpgmState.font = font; - if (exports.DEBUG) { - console.log('---EXEC FPGM---'); - fpgmState.step = - 1; - } - try { - exec(fpgmState); - } catch (e) { - console.log('Hinting error in FPGM:' + e); - this._errorState = 3; - return; - } - } // Executes the prep program for this ppem setting. - // This is used by fonts to set cvt values - // depending on to be rendered font size. - - State.prototype = fpgmState; - prepState = this._prepState = new State('prep', font.tables.prep); - prepState.ppem = ppem; - // Creates a copy of the cvt table - // and scales it to the current ppem setting. - var oCvt = font.tables.cvt; - if (oCvt) { - var cvt = prepState.cvt = new Array(oCvt.length); - var scale = ppem / font.unitsPerEm; - for (var c = 0; c < oCvt.length; c++) { - cvt[c] = oCvt[c] * scale; - } - } else { - prepState.cvt = [ - ]; - } - if (exports.DEBUG) { - console.log('---EXEC PREP---'); - prepState.step = - 1; - } - try { - exec(prepState); - } catch (e) { - if (this._errorState < 2) { - console.log('Hinting error in PREP:' + e); - } - this._errorState = 2; - } - } - if (this._errorState > 1) { - return; - } - try { - return execGlyph(glyph, prepState); - } catch (e) { - if (this._errorState < 1) { - console.log('Hinting error:' + e); - console.log('Note: further hinting errors are silenced'); - } - this._errorState = 1; - return undefined; - } - }; - /* - * Executes the hinting program for a glyph. - */ - execGlyph = function (glyph, prepState) { - // original point positions - var xScale = prepState.ppem / prepState.font.unitsPerEm; - var yScale = xScale; - var components = glyph.components; - var contours; - var gZone; - var state; - State.prototype = prepState; - if (!components) { - state = new State('glyf', glyph.instructions); - if (exports.DEBUG) { - console.log('---EXEC GLYPH---'); - state.step = - 1; - } - execComponent(glyph, state, xScale, yScale); - gZone = state.gZone; - } else { - var font = prepState.font; - gZone = [ - ]; - contours = [ - ]; - for (var i = 0; i < components.length; i++) { - var c = components[i]; - var cg = font.glyphs.get(c.glyphIndex); - state = new State('glyf', cg.instructions); - if (exports.DEBUG) { - console.log('---EXEC COMP ' + i + '---'); - state.step = - 1; - } - execComponent(cg, state, xScale, yScale); - // appends the computed points to the result array - // post processes the component points - var dx = Math.round(c.dx * xScale); - var dy = Math.round(c.dy * yScale); - var gz = state.gZone; - var cc = state.contours; - for (var pi = 0; pi < gz.length; pi++) { - var p = gz[pi]; - p.xTouched = p.yTouched = false; - p.xo = p.x = p.x + dx; - p.yo = p.y = p.y + dy; - } - var gLen = gZone.length; - gZone.push.apply(gZone, gz); - for (var j = 0; j < cc.length; j++) { - contours.push(cc[j] + gLen); - } - } - if (glyph.instructions && !state.inhibitGridFit) { - // the composite has instructions on its own - state = new State('glyf', glyph.instructions); - state.gZone = state.z0 = state.z1 = state.z2 = gZone; - state.contours = contours; - // note: HPZero cannot be used here, since - // the point might be modified - gZone.push(new HPoint(0, 0), new HPoint(Math.round(glyph.advanceWidth * xScale), 0)); - if (exports.DEBUG) { - console.log('---EXEC COMPOSITE---'); - state.step = - 1; - } - exec(state); - gZone.length -= 2; - } - } - return gZone; - }; - /* - * Executes the hinting program for a component of a multi-component glyph - * or of the glyph itself for a non-component glyph. - */ - execComponent = function (glyph, state, xScale, yScale) { - var points = glyph.points || [ - ]; - var pLen = points.length; - var gZone = state.gZone = state.z0 = state.z1 = state.z2 = [ - ]; - var contours = state.contours = [ - ]; - // Scales the original points and - // makes copies for the hinted points. - var cp; // current point - for (var i = 0; i < pLen; i++) { - cp = points[i]; - gZone[i] = new HPoint(cp.x * xScale, cp.y * yScale, cp.lastPointOfContour, cp.onCurve); - } // Chain links the contours. - - var sp; // start point - var np; // next point - for (var i$1 = 0; i$1 < pLen; i$1++) { - cp = gZone[i$1]; - if (!sp) { - sp = cp; - contours.push(i$1); - } - if (cp.lastPointOfContour) { - cp.nextPointOnContour = sp; - sp.prevPointOnContour = cp; - sp = undefined; - } else { - np = gZone[i$1 + 1]; - cp.nextPointOnContour = np; - np.prevPointOnContour = cp; - } - } - if (state.inhibitGridFit) { - return; - } - if (exports.DEBUG) { - console.log('PROCESSING GLYPH', state.stack); - for (var i$2 = 0; i$2 < pLen; i$2++) { - console.log(i$2, gZone[i$2].x, gZone[i$2].y); - } - } - gZone.push(new HPoint(0, 0), new HPoint(Math.round(glyph.advanceWidth * xScale), 0)); - exec(state); - // Removes the extra points. - gZone.length -= 2; - if (exports.DEBUG) { - console.log('FINISHED GLYPH', state.stack); - for (var i$3 = 0; i$3 < pLen; i$3++) { - console.log(i$3, gZone[i$3].x, gZone[i$3].y); - } - } - }; - /* - * Executes the program loaded in state. - */ - exec = function (state) { - var prog = state.prog; - if (!prog) { - return; - } - var pLen = prog.length; - var ins; - for (state.ip = 0; state.ip < pLen; state.ip++) { - if (exports.DEBUG) { - state.step++; - } - ins = instructionTable[prog[state.ip]]; - if (!ins) { - throw new Error('unknown instruction: 0x' + Number(prog[state.ip]).toString(16)); - } - ins(state); - // very extensive debugging for each step - /* - if (exports.DEBUG) { - var da; - if (state.gZone) { - da = []; - for (let i = 0; i < state.gZone.length; i++) - { - da.push(i + ' ' + - state.gZone[i].x * 64 + ' ' + - state.gZone[i].y * 64 + ' ' + - (state.gZone[i].xTouched ? 'x' : '') + - (state.gZone[i].yTouched ? 'y' : '') - ); - } - console.log('GZ', da); - } - if (state.tZone) { - da = []; - for (let i = 0; i < state.tZone.length; i++) { - da.push(i + ' ' + - state.tZone[i].x * 64 + ' ' + - state.tZone[i].y * 64 + ' ' + - (state.tZone[i].xTouched ? 'x' : '') + - (state.tZone[i].yTouched ? 'y' : '') - ); - } - console.log('TZ', da); - } - if (state.stack.length > 10) { - console.log( - state.stack.length, - '...', state.stack.slice(state.stack.length - 10) - ); - } else { - console.log(state.stack.length, state.stack); - } - } - */ - } - }; - /* - * Initializes the twilight zone. - * - * This is only done if a SZPx instruction - * refers to the twilight zone. - */ - function initTZone(state) { - var tZone = state.tZone = new Array(state.gZone.length); - // no idea if this is actually correct... - for (var i = 0; i < tZone.length; i++) { - tZone[i] = new HPoint(0, 0); - } - } /* - * Skips the instruction pointer ahead over an IF/ELSE block. - * handleElse .. if true breaks on matching ELSE - */ - - function skip(state, handleElse) { - var prog = state.prog; - var ip = state.ip; - var nesting = 1; - var ins; - do { - ins = prog[++ip]; - if (ins === 88) // IF - { - nesting++; - } else if (ins === 89) // EIF - { - nesting--; - } else if (ins === 64) // NPUSHB - { - ip += prog[ip + 1] + 1; - } else if (ins === 65) // NPUSHW - { - ip += 2 * prog[ip + 1] + 1; - } else if (ins >= 176 && ins <= 183) // PUSHB - { - ip += ins - 176 + 1; - } else if (ins >= 184 && ins <= 191) // PUSHW - { - ip += (ins - 184 + 1) * 2; - } else if (handleElse && nesting === 1 && ins === 27) // ELSE - { - break; - } - } while (nesting > 0); - state.ip = ip; - } /*----------------------------------------------------------* - * And then a lot of instructions... * - *----------------------------------------------------------*/ - // SVTCA[a] Set freedom and projection Vectors To Coordinate Axis - // 0x00-0x01 - - function SVTCA(v, state) { - if (exports.DEBUG) { - console.log(state.step, 'SVTCA[' + v.axis + ']'); - } - state.fv = state.pv = state.dpv = v; - } // SPVTCA[a] Set Projection Vector to Coordinate Axis - // 0x02-0x03 - - function SPVTCA(v, state) { - if (exports.DEBUG) { - console.log(state.step, 'SPVTCA[' + v.axis + ']'); - } - state.pv = state.dpv = v; - } // SFVTCA[a] Set Freedom Vector to Coordinate Axis - // 0x04-0x05 - - function SFVTCA(v, state) { - if (exports.DEBUG) { - console.log(state.step, 'SFVTCA[' + v.axis + ']'); - } - state.fv = v; - } // SPVTL[a] Set Projection Vector To Line - // 0x06-0x07 - - function SPVTL(a, state) { - var stack = state.stack; - var p2i = stack.pop(); - var p1i = stack.pop(); - var p2 = state.z2[p2i]; - var p1 = state.z1[p1i]; - if (exports.DEBUG) { - console.log('SPVTL[' + a + ']', p2i, p1i); - } - var dx; - var dy; - if (!a) { - dx = p1.x - p2.x; - dy = p1.y - p2.y; - } else { - dx = p2.y - p1.y; - dy = p1.x - p2.x; - } - state.pv = state.dpv = getUnitVector(dx, dy); - } // SFVTL[a] Set Freedom Vector To Line - // 0x08-0x09 - - function SFVTL(a, state) { - var stack = state.stack; - var p2i = stack.pop(); - var p1i = stack.pop(); - var p2 = state.z2[p2i]; - var p1 = state.z1[p1i]; - if (exports.DEBUG) { - console.log('SFVTL[' + a + ']', p2i, p1i); - } - var dx; - var dy; - if (!a) { - dx = p1.x - p2.x; - dy = p1.y - p2.y; - } else { - dx = p2.y - p1.y; - dy = p1.x - p2.x; - } - state.fv = getUnitVector(dx, dy); - } // SPVFS[] Set Projection Vector From Stack - // 0x0A - - function SPVFS(state) { - var stack = state.stack; - var y = stack.pop(); - var x = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SPVFS[]', y, x); - } - state.pv = state.dpv = getUnitVector(x, y); - } // SFVFS[] Set Freedom Vector From Stack - // 0x0B - - function SFVFS(state) { - var stack = state.stack; - var y = stack.pop(); - var x = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SPVFS[]', y, x); - } - state.fv = getUnitVector(x, y); - } // GPV[] Get Projection Vector - // 0x0C - - function GPV(state) { - var stack = state.stack; - var pv = state.pv; - if (exports.DEBUG) { - console.log(state.step, 'GPV[]'); - } - stack.push(pv.x * 16384); - stack.push(pv.y * 16384); - } // GFV[] Get Freedom Vector - // 0x0C - - function GFV(state) { - var stack = state.stack; - var fv = state.fv; - if (exports.DEBUG) { - console.log(state.step, 'GFV[]'); - } - stack.push(fv.x * 16384); - stack.push(fv.y * 16384); - } // SFVTPV[] Set Freedom Vector To Projection Vector - // 0x0E - - function SFVTPV(state) { - state.fv = state.pv; - if (exports.DEBUG) { - console.log(state.step, 'SFVTPV[]'); - } - } // ISECT[] moves point p to the InterSECTion of two lines - // 0x0F - - function ISECT(state) { - var stack = state.stack; - var pa0i = stack.pop(); - var pa1i = stack.pop(); - var pb0i = stack.pop(); - var pb1i = stack.pop(); - var pi = stack.pop(); - var z0 = state.z0; - var z1 = state.z1; - var pa0 = z0[pa0i]; - var pa1 = z0[pa1i]; - var pb0 = z1[pb0i]; - var pb1 = z1[pb1i]; - var p = state.z2[pi]; - if (exports.DEBUG) { - console.log('ISECT[], ', pa0i, pa1i, pb0i, pb1i, pi); - } // math from - // en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line - - var x1 = pa0.x; - var y1 = pa0.y; - var x2 = pa1.x; - var y2 = pa1.y; - var x3 = pb0.x; - var y3 = pb0.y; - var x4 = pb1.x; - var y4 = pb1.y; - var div = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); - var f1 = x1 * y2 - y1 * x2; - var f2 = x3 * y4 - y3 * x4; - p.x = (f1 * (x3 - x4) - f2 * (x1 - x2)) / div; - p.y = (f1 * (y3 - y4) - f2 * (y1 - y2)) / div; - } // SRP0[] Set Reference Point 0 - // 0x10 - - function SRP0(state) { - state.rp0 = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SRP0[]', state.rp0); - } - } // SRP1[] Set Reference Point 1 - // 0x11 - - function SRP1(state) { - state.rp1 = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SRP1[]', state.rp1); - } - } // SRP1[] Set Reference Point 2 - // 0x12 - - function SRP2(state) { - state.rp2 = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SRP2[]', state.rp2); - } - } // SZP0[] Set Zone Pointer 0 - // 0x13 - - function SZP0(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SZP0[]', n); - } - state.zp0 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z0 = state.tZone; - break; - case 1: - state.z0 = state.gZone; - break; - default: - throw new Error('Invalid zone pointer'); - } - } // SZP1[] Set Zone Pointer 1 - // 0x14 - - function SZP1(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SZP1[]', n); - } - state.zp1 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z1 = state.tZone; - break; - case 1: - state.z1 = state.gZone; - break; - default: - throw new Error('Invalid zone pointer'); - } - } // SZP2[] Set Zone Pointer 2 - // 0x15 - - function SZP2(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SZP2[]', n); - } - state.zp2 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z2 = state.tZone; - break; - case 1: - state.z2 = state.gZone; - break; - default: - throw new Error('Invalid zone pointer'); - } - } // SZPS[] Set Zone PointerS - // 0x16 - - function SZPS(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SZPS[]', n); - } - state.zp0 = state.zp1 = state.zp2 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z0 = state.z1 = state.z2 = state.tZone; - break; - case 1: - state.z0 = state.z1 = state.z2 = state.gZone; - break; - default: - throw new Error('Invalid zone pointer'); - } - } // SLOOP[] Set LOOP variable - // 0x17 - - function SLOOP(state) { - state.loop = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SLOOP[]', state.loop); - } - } // RTG[] Round To Grid - // 0x18 - - function RTG(state) { - if (exports.DEBUG) { - console.log(state.step, 'RTG[]'); - } - state.round = roundToGrid; - } // RTHG[] Round To Half Grid - // 0x19 - - function RTHG(state) { - if (exports.DEBUG) { - console.log(state.step, 'RTHG[]'); - } - state.round = roundToHalfGrid; - } // SMD[] Set Minimum Distance - // 0x1A - - function SMD(state) { - var d = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SMD[]', d); - } - state.minDis = d / 64; - } // ELSE[] ELSE clause - // 0x1B - - function ELSE(state) { - // This instruction has been reached by executing a then branch - // so it just skips ahead until matching EIF. - // - // In case the IF was negative the IF[] instruction already - // skipped forward over the ELSE[] - if (exports.DEBUG) { - console.log(state.step, 'ELSE[]'); - } - skip(state, false); - } // JMPR[] JuMP Relative - // 0x1C - - function JMPR(state) { - var o = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'JMPR[]', o); - } // A jump by 1 would do nothing. - - state.ip += o - 1; - } // SCVTCI[] Set Control Value Table Cut-In - // 0x1D - - function SCVTCI(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SCVTCI[]', n); - } - state.cvCutIn = n / 64; - } // DUP[] DUPlicate top stack element - // 0x20 - - function DUP(state) { - var stack = state.stack; - if (exports.DEBUG) { - console.log(state.step, 'DUP[]'); - } - stack.push(stack[stack.length - 1]); - } // POP[] POP top stack element - // 0x21 - - function POP(state) { - if (exports.DEBUG) { - console.log(state.step, 'POP[]'); - } - state.stack.pop(); - } // CLEAR[] CLEAR the stack - // 0x22 - - function CLEAR(state) { - if (exports.DEBUG) { - console.log(state.step, 'CLEAR[]'); - } - state.stack.length = 0; - } // SWAP[] SWAP the top two elements on the stack - // 0x23 - - function SWAP(state) { - var stack = state.stack; - var a = stack.pop(); - var b = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SWAP[]'); - } - stack.push(a); - stack.push(b); - } // DEPTH[] DEPTH of the stack - // 0x24 - - function DEPTH(state) { - var stack = state.stack; - if (exports.DEBUG) { - console.log(state.step, 'DEPTH[]'); - } - stack.push(stack.length); - } // LOOPCALL[] LOOPCALL function - // 0x2A - - function LOOPCALL(state) { - var stack = state.stack; - var fn = stack.pop(); - var c = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'LOOPCALL[]', fn, c); - } // saves callers program - - var cip = state.ip; - var cprog = state.prog; - state.prog = state.funcs[fn]; - // executes the function - for (var i = 0; i < c; i++) { - exec(state); - if (exports.DEBUG) { - console.log(++state.step, i + 1 < c ? 'next loopcall' : 'done loopcall', i); - } - } // restores the callers program - - state.ip = cip; - state.prog = cprog; - } // CALL[] CALL function - // 0x2B - - function CALL(state) { - var fn = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'CALL[]', fn); - } // saves callers program - - var cip = state.ip; - var cprog = state.prog; - state.prog = state.funcs[fn]; - // executes the function - exec(state); - // restores the callers program - state.ip = cip; - state.prog = cprog; - if (exports.DEBUG) { - console.log(++state.step, 'returning from', fn); - } - } // CINDEX[] Copy the INDEXed element to the top of the stack - // 0x25 - - function CINDEX(state) { - var stack = state.stack; - var k = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'CINDEX[]', k); - } // In case of k == 1, it copies the last element after popping - // thus stack.length - k. - - stack.push(stack[stack.length - k]); - } // MINDEX[] Move the INDEXed element to the top of the stack - // 0x26 - - function MINDEX(state) { - var stack = state.stack; - var k = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'MINDEX[]', k); - } - stack.push(stack.splice(stack.length - k, 1) [0]); - } // FDEF[] Function DEFinition - // 0x2C - - function FDEF(state) { - if (state.env !== 'fpgm') { - throw new Error('FDEF not allowed here'); - } - var stack = state.stack; - var prog = state.prog; - var ip = state.ip; - var fn = stack.pop(); - var ipBegin = ip; - if (exports.DEBUG) { - console.log(state.step, 'FDEF[]', fn); - } - while (prog[++ip] !== 45) { - } - state.ip = ip; - state.funcs[fn] = prog.slice(ipBegin + 1, ip); - } // MDAP[a] Move Direct Absolute Point - // 0x2E-0x2F - - function MDAP(round, state) { - var pi = state.stack.pop(); - var p = state.z0[pi]; - var fv = state.fv; - var pv = state.pv; - if (exports.DEBUG) { - console.log(state.step, 'MDAP[' + round + ']', pi); - } - var d = pv.distance(p, HPZero); - if (round) { - d = state.round(d); - } - fv.setRelative(p, HPZero, d, pv); - fv.touch(p); - state.rp0 = state.rp1 = pi; - } // IUP[a] Interpolate Untouched Points through the outline - // 0x30 - - function IUP(v, state) { - var z2 = state.z2; - var pLen = z2.length - 2; - var cp; - var pp; - var np; - if (exports.DEBUG) { - console.log(state.step, 'IUP[' + v.axis + ']'); - } - for (var i = 0; i < pLen; i++) { - cp = z2[i]; // current point - // if this point has been touched go on - if (v.touched(cp)) { - continue; - } - pp = cp.prevTouched(v); - // no point on the contour has been touched? - if (pp === cp) { - continue; - } - np = cp.nextTouched(v); - if (pp === np) { - // only one point on the contour has been touched - // so simply moves the point like that - v.setRelative(cp, cp, v.distance(pp, pp, false, true), v, true); - } - v.interpolate(cp, pp, np, v); - } - } // SHP[] SHift Point using reference point - // 0x32-0x33 - - function SHP(a, state) { - var stack = state.stack; - var rpi = a ? state.rp1 : state.rp2; - var rp = (a ? state.z0 : state.z1) [rpi]; - var fv = state.fv; - var pv = state.pv; - var loop = state.loop; - var z2 = state.z2; - while (loop--) { - var pi = stack.pop(); - var p = z2[pi]; - var d = pv.distance(rp, rp, false, true); - fv.setRelative(p, p, d, pv); - fv.touch(p); - if (exports.DEBUG) { - console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'SHP[' + (a ? 'rp1' : 'rp2') + ']', pi); - } - } - state.loop = 1; - } // SHC[] SHift Contour using reference point - // 0x36-0x37 - - function SHC(a, state) { - var stack = state.stack; - var rpi = a ? state.rp1 : state.rp2; - var rp = (a ? state.z0 : state.z1) [rpi]; - var fv = state.fv; - var pv = state.pv; - var ci = stack.pop(); - var sp = state.z2[state.contours[ci]]; - var p = sp; - if (exports.DEBUG) { - console.log(state.step, 'SHC[' + a + ']', ci); - } - var d = pv.distance(rp, rp, false, true); - do { - if (p !== rp) { - fv.setRelative(p, p, d, pv); - } - p = p.nextPointOnContour; - } while (p !== sp); - } // SHZ[] SHift Zone using reference point - // 0x36-0x37 - - function SHZ(a, state) { - var stack = state.stack; - var rpi = a ? state.rp1 : state.rp2; - var rp = (a ? state.z0 : state.z1) [rpi]; - var fv = state.fv; - var pv = state.pv; - var e = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SHZ[' + a + ']', e); - } - var z; - switch (e) { - case 0: - z = state.tZone; - break; - case 1: - z = state.gZone; - break; - default: - throw new Error('Invalid zone'); - } - var p; - var d = pv.distance(rp, rp, false, true); - var pLen = z.length - 2; - for (var i = 0; i < pLen; i++) { - p = z[i]; - fv.setRelative(p, p, d, pv); - //if (p !== rp) fv.setRelative(p, p, d, pv); - } - } // SHPIX[] SHift point by a PIXel amount - // 0x38 - - function SHPIX(state) { - var stack = state.stack; - var loop = state.loop; - var fv = state.fv; - var d = stack.pop() / 64; - var z2 = state.z2; - while (loop--) { - var pi = stack.pop(); - var p = z2[pi]; - if (exports.DEBUG) { - console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'SHPIX[]', pi, d); - } - fv.setRelative(p, p, d); - fv.touch(p); - } - state.loop = 1; - } // IP[] Interpolate Point - // 0x39 - - function IP(state) { - var stack = state.stack; - var rp1i = state.rp1; - var rp2i = state.rp2; - var loop = state.loop; - var rp1 = state.z0[rp1i]; - var rp2 = state.z1[rp2i]; - var fv = state.fv; - var pv = state.dpv; - var z2 = state.z2; - while (loop--) { - var pi = stack.pop(); - var p = z2[pi]; - if (exports.DEBUG) { - console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'IP[]', pi, rp1i, '<->', rp2i); - } - fv.interpolate(p, rp1, rp2, pv); - fv.touch(p); - } - state.loop = 1; - } // MSIRP[a] Move Stack Indirect Relative Point - // 0x3A-0x3B - - function MSIRP(a, state) { - var stack = state.stack; - var d = stack.pop() / 64; - var pi = stack.pop(); - var p = state.z1[pi]; - var rp0 = state.z0[state.rp0]; - var fv = state.fv; - var pv = state.pv; - fv.setRelative(p, rp0, d, pv); - fv.touch(p); - if (exports.DEBUG) { - console.log(state.step, 'MSIRP[' + a + ']', d, pi); - } - state.rp1 = state.rp0; - state.rp2 = pi; - if (a) { - state.rp0 = pi; - } - } // ALIGNRP[] Align to reference point. - // 0x3C - - function ALIGNRP(state) { - var stack = state.stack; - var rp0i = state.rp0; - var rp0 = state.z0[rp0i]; - var loop = state.loop; - var fv = state.fv; - var pv = state.pv; - var z1 = state.z1; - while (loop--) { - var pi = stack.pop(); - var p = z1[pi]; - if (exports.DEBUG) { - console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'ALIGNRP[]', pi); - } - fv.setRelative(p, rp0, 0, pv); - fv.touch(p); - } - state.loop = 1; - } // RTG[] Round To Double Grid - // 0x3D - - function RTDG(state) { - if (exports.DEBUG) { - console.log(state.step, 'RTDG[]'); - } - state.round = roundToDoubleGrid; - } // MIAP[a] Move Indirect Absolute Point - // 0x3E-0x3F - - function MIAP(round, state) { - var stack = state.stack; - var n = stack.pop(); - var pi = stack.pop(); - var p = state.z0[pi]; - var fv = state.fv; - var pv = state.pv; - var cv = state.cvt[n]; - if (exports.DEBUG) { - console.log(state.step, 'MIAP[' + round + ']', n, '(', cv, ')', pi); - } - var d = pv.distance(p, HPZero); - if (round) { - if (Math.abs(d - cv) < state.cvCutIn) { - d = cv; - } - d = state.round(d); - } - fv.setRelative(p, HPZero, d, pv); - if (state.zp0 === 0) { - p.xo = p.x; - p.yo = p.y; - } - fv.touch(p); - state.rp0 = state.rp1 = pi; - } // NPUSB[] PUSH N Bytes - // 0x40 - - function NPUSHB(state) { - var prog = state.prog; - var ip = state.ip; - var stack = state.stack; - var n = prog[++ip]; - if (exports.DEBUG) { - console.log(state.step, 'NPUSHB[]', n); - } - for (var i = 0; i < n; i++) { - stack.push(prog[++ip]); - } - state.ip = ip; - } // NPUSHW[] PUSH N Words - // 0x41 - - function NPUSHW(state) { - var ip = state.ip; - var prog = state.prog; - var stack = state.stack; - var n = prog[++ip]; - if (exports.DEBUG) { - console.log(state.step, 'NPUSHW[]', n); - } - for (var i = 0; i < n; i++) { - var w = prog[++ip] << 8 | prog[++ip]; - if (w & 32768) { - w = - ((w ^ 65535) + 1); - } - stack.push(w); - } - state.ip = ip; - } // WS[] Write Store - // 0x42 - - function WS(state) { - var stack = state.stack; - var store = state.store; - if (!store) { - store = state.store = [ - ]; - } - var v = stack.pop(); - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'WS', v, l); - } - store[l] = v; - } // RS[] Read Store - // 0x43 - - function RS(state) { - var stack = state.stack; - var store = state.store; - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'RS', l); - } - var v = store && store[l] || 0; - stack.push(v); - } // WCVTP[] Write Control Value Table in Pixel units - // 0x44 - - function WCVTP(state) { - var stack = state.stack; - var v = stack.pop(); - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'WCVTP', v, l); - } - state.cvt[l] = v / 64; - } // RCVT[] Read Control Value Table entry - // 0x45 - - function RCVT(state) { - var stack = state.stack; - var cvte = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'RCVT', cvte); - } - stack.push(state.cvt[cvte] * 64); - } // GC[] Get Coordinate projected onto the projection vector - // 0x46-0x47 - - function GC(a, state) { - var stack = state.stack; - var pi = stack.pop(); - var p = state.z2[pi]; - if (exports.DEBUG) { - console.log(state.step, 'GC[' + a + ']', pi); - } - stack.push(state.dpv.distance(p, HPZero, a, false) * 64); - } // MD[a] Measure Distance - // 0x49-0x4A - - function MD(a, state) { - var stack = state.stack; - var pi2 = stack.pop(); - var pi1 = stack.pop(); - var p2 = state.z1[pi2]; - var p1 = state.z0[pi1]; - var d = state.dpv.distance(p1, p2, a, a); - if (exports.DEBUG) { - console.log(state.step, 'MD[' + a + ']', pi2, pi1, '->', d); - } - state.stack.push(Math.round(d * 64)); - } // MPPEM[] Measure Pixels Per EM - // 0x4B - - function MPPEM(state) { - if (exports.DEBUG) { - console.log(state.step, 'MPPEM[]'); - } - state.stack.push(state.ppem); - } // FLIPON[] set the auto FLIP Boolean to ON - // 0x4D - - function FLIPON(state) { - if (exports.DEBUG) { - console.log(state.step, 'FLIPON[]'); - } - state.autoFlip = true; - } // LT[] Less Than - // 0x50 - - function LT(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'LT[]', e2, e1); - } - stack.push(e1 < e2 ? 1 : 0); - } // LTEQ[] Less Than or EQual - // 0x53 - - function LTEQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'LTEQ[]', e2, e1); - } - stack.push(e1 <= e2 ? 1 : 0); - } // GTEQ[] Greater Than - // 0x52 - - function GT(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'GT[]', e2, e1); - } - stack.push(e1 > e2 ? 1 : 0); - } // GTEQ[] Greater Than or EQual - // 0x53 - - function GTEQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'GTEQ[]', e2, e1); - } - stack.push(e1 >= e2 ? 1 : 0); - } // EQ[] EQual - // 0x54 - - function EQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'EQ[]', e2, e1); - } - stack.push(e2 === e1 ? 1 : 0); - } // NEQ[] Not EQual - // 0x55 - - function NEQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'NEQ[]', e2, e1); - } - stack.push(e2 !== e1 ? 1 : 0); - } // ODD[] ODD - // 0x56 - - function ODD(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'ODD[]', n); - } - stack.push(Math.trunc(n) % 2 ? 1 : 0); - } // EVEN[] EVEN - // 0x57 - - function EVEN(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'EVEN[]', n); - } - stack.push(Math.trunc(n) % 2 ? 0 : 1); - } // IF[] IF test - // 0x58 - - function IF(state) { - var test = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'IF[]', test); - } // if test is true it just continues - // if not the ip is skipped until matching ELSE or EIF - - if (!test) { - skip(state, true); - if (exports.DEBUG) { - console.log(state.step, 'EIF[]'); - } - } - } // EIF[] End IF - // 0x59 - - function EIF(state) { - // this can be reached normally when - // executing an else branch. - // -> just ignore it - if (exports.DEBUG) { - console.log(state.step, 'EIF[]'); - } - } // AND[] logical AND - // 0x5A - - function AND(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'AND[]', e2, e1); - } - stack.push(e2 && e1 ? 1 : 0); - } // OR[] logical OR - // 0x5B - - function OR(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'OR[]', e2, e1); - } - stack.push(e2 || e1 ? 1 : 0); - } // NOT[] logical NOT - // 0x5C - - function NOT(state) { - var stack = state.stack; - var e = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'NOT[]', e); - } - stack.push(e ? 0 : 1); - } // DELTAP1[] DELTA exception P1 - // DELTAP2[] DELTA exception P2 - // DELTAP3[] DELTA exception P3 - // 0x5D, 0x71, 0x72 - - function DELTAP123(b, state) { - var stack = state.stack; - var n = stack.pop(); - var fv = state.fv; - var pv = state.pv; - var ppem = state.ppem; - var base = state.deltaBase + (b - 1) * 16; - var ds = state.deltaShift; - var z0 = state.z0; - if (exports.DEBUG) { - console.log(state.step, 'DELTAP[' + b + ']', n, stack); - } - for (var i = 0; i < n; i++) { - var pi = stack.pop(); - var arg = stack.pop(); - var appem = base + ((arg & 240) >> 4); - if (appem !== ppem) { - continue; - } - var mag = (arg & 15) - 8; - if (mag >= 0) { - mag++; - } - if (exports.DEBUG) { - console.log(state.step, 'DELTAPFIX', pi, 'by', mag * ds); - } - var p = z0[pi]; - fv.setRelative(p, p, mag * ds, pv); - } - } // SDB[] Set Delta Base in the graphics state - // 0x5E - - function SDB(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SDB[]', n); - } - state.deltaBase = n; - } // SDS[] Set Delta Shift in the graphics state - // 0x5F - - function SDS(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SDS[]', n); - } - state.deltaShift = Math.pow(0.5, n); - } // ADD[] ADD - // 0x60 - - function ADD(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'ADD[]', n2, n1); - } - stack.push(n1 + n2); - } // SUB[] SUB - // 0x61 - - function SUB(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SUB[]', n2, n1); - } - stack.push(n1 - n2); - } // DIV[] DIV - // 0x62 - - function DIV(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'DIV[]', n2, n1); - } - stack.push(n1 * 64 / n2); - } // MUL[] MUL - // 0x63 - - function MUL(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'MUL[]', n2, n1); - } - stack.push(n1 * n2 / 64); - } // ABS[] ABSolute value - // 0x64 - - function ABS(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'ABS[]', n); - } - stack.push(Math.abs(n)); - } // NEG[] NEGate - // 0x65 - - function NEG(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'NEG[]', n); - } - stack.push( - n); - } // FLOOR[] FLOOR - // 0x66 - - function FLOOR(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'FLOOR[]', n); - } - stack.push(Math.floor(n / 64) * 64); - } // CEILING[] CEILING - // 0x67 - - function CEILING(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'CEILING[]', n); - } - stack.push(Math.ceil(n / 64) * 64); - } // ROUND[ab] ROUND value - // 0x68-0x6B - - function ROUND(dt, state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'ROUND[]'); - } - stack.push(state.round(n / 64) * 64); - } // WCVTF[] Write Control Value Table in Funits - // 0x70 - - function WCVTF(state) { - var stack = state.stack; - var v = stack.pop(); - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'WCVTF[]', v, l); - } - state.cvt[l] = v * state.ppem / state.font.unitsPerEm; - } // DELTAC1[] DELTA exception C1 - // DELTAC2[] DELTA exception C2 - // DELTAC3[] DELTA exception C3 - // 0x73, 0x74, 0x75 - - function DELTAC123(b, state) { - var stack = state.stack; - var n = stack.pop(); - var ppem = state.ppem; - var base = state.deltaBase + (b - 1) * 16; - var ds = state.deltaShift; - if (exports.DEBUG) { - console.log(state.step, 'DELTAC[' + b + ']', n, stack); - } - for (var i = 0; i < n; i++) { - var c = stack.pop(); - var arg = stack.pop(); - var appem = base + ((arg & 240) >> 4); - if (appem !== ppem) { - continue; - } - var mag = (arg & 15) - 8; - if (mag >= 0) { - mag++; - } - var delta = mag * ds; - if (exports.DEBUG) { - console.log(state.step, 'DELTACFIX', c, 'by', delta); - } - state.cvt[c] += delta; - } - } // SROUND[] Super ROUND - // 0x76 - - function SROUND(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'SROUND[]', n); - } - state.round = roundSuper; - var period; - switch (n & 192) { - case 0: - period = 0.5; - break; - case 64: - period = 1; - break; - case 128: - period = 2; - break; - default: - throw new Error('invalid SROUND value'); - } - state.srPeriod = period; - switch (n & 48) { - case 0: - state.srPhase = 0; - break; - case 16: - state.srPhase = 0.25 * period; - break; - case 32: - state.srPhase = 0.5 * period; - break; - case 48: - state.srPhase = 0.75 * period; - break; - default: - throw new Error('invalid SROUND value'); - } - n &= 15; - if (n === 0) { - state.srThreshold = 0; - } else { - state.srThreshold = (n / 8 - 0.5) * period; - } - } // S45ROUND[] Super ROUND 45 degrees - // 0x77 - - function S45ROUND(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'S45ROUND[]', n); - } - state.round = roundSuper; - var period; - switch (n & 192) { - case 0: - period = Math.sqrt(2) / 2; - break; - case 64: - period = Math.sqrt(2); - break; - case 128: - period = 2 * Math.sqrt(2); - break; - default: - throw new Error('invalid S45ROUND value'); - } - state.srPeriod = period; - switch (n & 48) { - case 0: - state.srPhase = 0; - break; - case 16: - state.srPhase = 0.25 * period; - break; - case 32: - state.srPhase = 0.5 * period; - break; - case 48: - state.srPhase = 0.75 * period; - break; - default: - throw new Error('invalid S45ROUND value'); - } - n &= 15; - if (n === 0) { - state.srThreshold = 0; - } else { - state.srThreshold = (n / 8 - 0.5) * period; - } - } // ROFF[] Round Off - // 0x7A - - function ROFF(state) { - if (exports.DEBUG) { - console.log(state.step, 'ROFF[]'); - } - state.round = roundOff; - } // RUTG[] Round Up To Grid - // 0x7C - - function RUTG(state) { - if (exports.DEBUG) { - console.log(state.step, 'RUTG[]'); - } - state.round = roundUpToGrid; - } // RDTG[] Round Down To Grid - // 0x7D - - function RDTG(state) { - if (exports.DEBUG) { - console.log(state.step, 'RDTG[]'); - } - state.round = roundDownToGrid; - } // SCANCTRL[] SCAN conversion ConTRoL - // 0x85 - - function SCANCTRL(state) { - var n = state.stack.pop(); - // ignored by opentype.js - if (exports.DEBUG) { - console.log(state.step, 'SCANCTRL[]', n); - } - } // SDPVTL[a] Set Dual Projection Vector To Line - // 0x86-0x87 - - function SDPVTL(a, state) { - var stack = state.stack; - var p2i = stack.pop(); - var p1i = stack.pop(); - var p2 = state.z2[p2i]; - var p1 = state.z1[p1i]; - if (exports.DEBUG) { - console.log(state.step, 'SDPVTL[' + a + ']', p2i, p1i); - } - var dx; - var dy; - if (!a) { - dx = p1.x - p2.x; - dy = p1.y - p2.y; - } else { - dx = p2.y - p1.y; - dy = p1.x - p2.x; - } - state.dpv = getUnitVector(dx, dy); - } // GETINFO[] GET INFOrmation - // 0x88 - - function GETINFO(state) { - var stack = state.stack; - var sel = stack.pop(); - var r = 0; - if (exports.DEBUG) { - console.log(state.step, 'GETINFO[]', sel); - } // v35 as in no subpixel hinting - - if (sel & 1) { - r = 35; - } // TODO rotation and stretch currently not supported - // and thus those GETINFO are always 0. - // opentype.js is always gray scaling - - if (sel & 32) { - r |= 4096; - } - stack.push(r); - } // ROLL[] ROLL the top three stack elements - // 0x8A - - function ROLL(state) { - var stack = state.stack; - var a = stack.pop(); - var b = stack.pop(); - var c = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'ROLL[]'); - } - stack.push(b); - stack.push(a); - stack.push(c); - } // MAX[] MAXimum of top two stack elements - // 0x8B - - function MAX(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'MAX[]', e2, e1); - } - stack.push(Math.max(e1, e2)); - } // MIN[] MINimum of top two stack elements - // 0x8C - - function MIN(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'MIN[]', e2, e1); - } - stack.push(Math.min(e1, e2)); - } // SCANTYPE[] SCANTYPE - // 0x8D - - function SCANTYPE(state) { - var n = state.stack.pop(); - // ignored by opentype.js - if (exports.DEBUG) { - console.log(state.step, 'SCANTYPE[]', n); - } - } // INSTCTRL[] INSTCTRL - // 0x8D - - function INSTCTRL(state) { - var s = state.stack.pop(); - var v = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, 'INSTCTRL[]', s, v); - } - switch (s) { - case 1: - state.inhibitGridFit = !!v; - return; - case 2: - state.ignoreCvt = !!v; - return; - default: - throw new Error('invalid INSTCTRL[] selector'); - } - } // PUSHB[abc] PUSH Bytes - // 0xB0-0xB7 - - function PUSHB(n, state) { - var stack = state.stack; - var prog = state.prog; - var ip = state.ip; - if (exports.DEBUG) { - console.log(state.step, 'PUSHB[' + n + ']'); - } - for (var i = 0; i < n; i++) { - stack.push(prog[++ip]); - } - state.ip = ip; - } // PUSHW[abc] PUSH Words - // 0xB8-0xBF - - function PUSHW(n, state) { - var ip = state.ip; - var prog = state.prog; - var stack = state.stack; - if (exports.DEBUG) { - console.log(state.ip, 'PUSHW[' + n + ']'); - } - for (var i = 0; i < n; i++) { - var w = prog[++ip] << 8 | prog[++ip]; - if (w & 32768) { - w = - ((w ^ 65535) + 1); - } - stack.push(w); - } - state.ip = ip; - } // MDRP[abcde] Move Direct Relative Point - // 0xD0-0xEF - // (if indirect is 0) - // - // and - // - // MIRP[abcde] Move Indirect Relative Point - // 0xE0-0xFF - // (if indirect is 1) - - function MDRP_MIRP(indirect, setRp0, keepD, ro, dt, state) { - var stack = state.stack; - var cvte = indirect && stack.pop(); - var pi = stack.pop(); - var rp0i = state.rp0; - var rp = state.z0[rp0i]; - var p = state.z1[pi]; - var md = state.minDis; - var fv = state.fv; - var pv = state.dpv; - var od; // original distance - var d; // moving distance - var sign; // sign of distance - var cv; - d = od = pv.distance(p, rp, true, true); - sign = d >= 0 ? 1 : - 1; // Math.sign would be 0 in case of 0 - // TODO consider autoFlip - d = Math.abs(d); - if (indirect) { - cv = state.cvt[cvte]; - if (ro && Math.abs(d - cv) < state.cvCutIn) { - d = cv; - } - } - if (keepD && d < md) { - d = md; - } - if (ro) { - d = state.round(d); - } - fv.setRelative(p, rp, sign * d, pv); - fv.touch(p); - if (exports.DEBUG) { - console.log(state.step, (indirect ? 'MIRP[' : 'MDRP[') + (setRp0 ? 'M' : 'm') + (keepD ? '>' : '_') + (ro ? 'R' : '_') + (dt === 0 ? 'Gr' : dt === 1 ? 'Bl' : dt === 2 ? 'Wh' : '') + ']', indirect ? cvte + '(' + state.cvt[cvte] + ',' + cv + ')' : '', pi, '(d =', od, '->', sign * d, ')'); - } - state.rp1 = state.rp0; - state.rp2 = pi; - if (setRp0) { - state.rp0 = pi; - } - } /* - * The instruction table. - */ - - instructionTable = [ /* 0x00 */ SVTCA.bind(undefined, yUnitVector), /* 0x01 */ SVTCA.bind(undefined, xUnitVector), /* 0x02 */ SPVTCA.bind(undefined, yUnitVector), /* 0x03 */ SPVTCA.bind(undefined, xUnitVector), /* 0x04 */ SFVTCA.bind(undefined, yUnitVector), /* 0x05 */ SFVTCA.bind(undefined, xUnitVector), /* 0x06 */ SPVTL.bind(undefined, 0), /* 0x07 */ SPVTL.bind(undefined, 1), /* 0x08 */ SFVTL.bind(undefined, 0), /* 0x09 */ SFVTL.bind(undefined, 1), /* 0x0A */ SPVFS, /* 0x0B */ SFVFS, /* 0x0C */ GPV, /* 0x0D */ GFV, /* 0x0E */ SFVTPV, /* 0x0F */ ISECT, /* 0x10 */ SRP0, /* 0x11 */ SRP1, /* 0x12 */ SRP2, /* 0x13 */ SZP0, /* 0x14 */ SZP1, /* 0x15 */ SZP2, /* 0x16 */ SZPS, /* 0x17 */ SLOOP, /* 0x18 */ RTG, /* 0x19 */ RTHG, /* 0x1A */ SMD, /* 0x1B */ ELSE, /* 0x1C */ JMPR, /* 0x1D */ SCVTCI, /* 0x1E */ undefined, - // TODO SSWCI - /* 0x1F */ - undefined, - // TODO SSW - /* 0x20 */ - DUP, /* 0x21 */ POP, /* 0x22 */ CLEAR, /* 0x23 */ SWAP, /* 0x24 */ DEPTH, /* 0x25 */ CINDEX, /* 0x26 */ MINDEX, /* 0x27 */ undefined, - // TODO ALIGNPTS - /* 0x28 */ - undefined, /* 0x29 */ undefined, - // TODO UTP - /* 0x2A */ - LOOPCALL, /* 0x2B */ CALL, /* 0x2C */ FDEF, /* 0x2D */ undefined, - // ENDF (eaten by FDEF) - /* 0x2E */ - MDAP.bind(undefined, 0), /* 0x2F */ MDAP.bind(undefined, 1), /* 0x30 */ IUP.bind(undefined, yUnitVector), /* 0x31 */ IUP.bind(undefined, xUnitVector), /* 0x32 */ SHP.bind(undefined, 0), /* 0x33 */ SHP.bind(undefined, 1), /* 0x34 */ SHC.bind(undefined, 0), /* 0x35 */ SHC.bind(undefined, 1), /* 0x36 */ SHZ.bind(undefined, 0), /* 0x37 */ SHZ.bind(undefined, 1), /* 0x38 */ SHPIX, /* 0x39 */ IP, /* 0x3A */ MSIRP.bind(undefined, 0), /* 0x3B */ MSIRP.bind(undefined, 1), /* 0x3C */ ALIGNRP, /* 0x3D */ RTDG, /* 0x3E */ MIAP.bind(undefined, 0), /* 0x3F */ MIAP.bind(undefined, 1), /* 0x40 */ NPUSHB, /* 0x41 */ NPUSHW, /* 0x42 */ WS, /* 0x43 */ RS, /* 0x44 */ WCVTP, /* 0x45 */ RCVT, /* 0x46 */ GC.bind(undefined, 0), /* 0x47 */ GC.bind(undefined, 1), /* 0x48 */ undefined, - // TODO SCFS - /* 0x49 */ - MD.bind(undefined, 0), /* 0x4A */ MD.bind(undefined, 1), /* 0x4B */ MPPEM, /* 0x4C */ undefined, - // TODO MPS - /* 0x4D */ - FLIPON, /* 0x4E */ undefined, - // TODO FLIPOFF - /* 0x4F */ - undefined, - // TODO DEBUG - /* 0x50 */ - LT, /* 0x51 */ LTEQ, /* 0x52 */ GT, /* 0x53 */ GTEQ, /* 0x54 */ EQ, /* 0x55 */ NEQ, /* 0x56 */ ODD, /* 0x57 */ EVEN, /* 0x58 */ IF, /* 0x59 */ EIF, /* 0x5A */ AND, /* 0x5B */ OR, /* 0x5C */ NOT, /* 0x5D */ DELTAP123.bind(undefined, 1), /* 0x5E */ SDB, /* 0x5F */ SDS, /* 0x60 */ ADD, /* 0x61 */ SUB, /* 0x62 */ DIV, /* 0x63 */ MUL, /* 0x64 */ ABS, /* 0x65 */ NEG, /* 0x66 */ FLOOR, /* 0x67 */ CEILING, /* 0x68 */ ROUND.bind(undefined, 0), /* 0x69 */ ROUND.bind(undefined, 1), /* 0x6A */ ROUND.bind(undefined, 2), /* 0x6B */ ROUND.bind(undefined, 3), /* 0x6C */ undefined, - // TODO NROUND[ab] - /* 0x6D */ - undefined, - // TODO NROUND[ab] - /* 0x6E */ - undefined, - // TODO NROUND[ab] - /* 0x6F */ - undefined, - // TODO NROUND[ab] - /* 0x70 */ - WCVTF, /* 0x71 */ DELTAP123.bind(undefined, 2), /* 0x72 */ DELTAP123.bind(undefined, 3), /* 0x73 */ DELTAC123.bind(undefined, 1), /* 0x74 */ DELTAC123.bind(undefined, 2), /* 0x75 */ DELTAC123.bind(undefined, 3), /* 0x76 */ SROUND, /* 0x77 */ S45ROUND, /* 0x78 */ undefined, - // TODO JROT[] - /* 0x79 */ - undefined, - // TODO JROF[] - /* 0x7A */ - ROFF, /* 0x7B */ undefined, /* 0x7C */ RUTG, /* 0x7D */ RDTG, /* 0x7E */ POP, - // actually SANGW, supposed to do only a pop though - /* 0x7F */ - POP, - // actually AA, supposed to do only a pop though - /* 0x80 */ - undefined, - // TODO FLIPPT - /* 0x81 */ - undefined, - // TODO FLIPRGON - /* 0x82 */ - undefined, - // TODO FLIPRGOFF - /* 0x83 */ - undefined, /* 0x84 */ undefined, /* 0x85 */ SCANCTRL, /* 0x86 */ SDPVTL.bind(undefined, 0), /* 0x87 */ SDPVTL.bind(undefined, 1), /* 0x88 */ GETINFO, /* 0x89 */ undefined, - // TODO IDEF - /* 0x8A */ - ROLL, /* 0x8B */ MAX, /* 0x8C */ MIN, /* 0x8D */ SCANTYPE, /* 0x8E */ INSTCTRL, /* 0x8F */ undefined, /* 0x90 */ undefined, /* 0x91 */ undefined, /* 0x92 */ undefined, /* 0x93 */ undefined, /* 0x94 */ undefined, /* 0x95 */ undefined, /* 0x96 */ undefined, /* 0x97 */ undefined, /* 0x98 */ undefined, /* 0x99 */ undefined, /* 0x9A */ undefined, /* 0x9B */ undefined, /* 0x9C */ undefined, /* 0x9D */ undefined, /* 0x9E */ undefined, /* 0x9F */ undefined, /* 0xA0 */ undefined, /* 0xA1 */ undefined, /* 0xA2 */ undefined, /* 0xA3 */ undefined, /* 0xA4 */ undefined, /* 0xA5 */ undefined, /* 0xA6 */ undefined, /* 0xA7 */ undefined, /* 0xA8 */ undefined, /* 0xA9 */ undefined, /* 0xAA */ undefined, /* 0xAB */ undefined, /* 0xAC */ undefined, /* 0xAD */ undefined, /* 0xAE */ undefined, /* 0xAF */ undefined, /* 0xB0 */ PUSHB.bind(undefined, 1), /* 0xB1 */ PUSHB.bind(undefined, 2), /* 0xB2 */ PUSHB.bind(undefined, 3), /* 0xB3 */ PUSHB.bind(undefined, 4), /* 0xB4 */ PUSHB.bind(undefined, 5), /* 0xB5 */ PUSHB.bind(undefined, 6), /* 0xB6 */ PUSHB.bind(undefined, 7), /* 0xB7 */ PUSHB.bind(undefined, 8), /* 0xB8 */ PUSHW.bind(undefined, 1), /* 0xB9 */ PUSHW.bind(undefined, 2), /* 0xBA */ PUSHW.bind(undefined, 3), /* 0xBB */ PUSHW.bind(undefined, 4), /* 0xBC */ PUSHW.bind(undefined, 5), /* 0xBD */ PUSHW.bind(undefined, 6), /* 0xBE */ PUSHW.bind(undefined, 7), /* 0xBF */ PUSHW.bind(undefined, 8), /* 0xC0 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 0), /* 0xC1 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 1), /* 0xC2 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 2), /* 0xC3 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 3), /* 0xC4 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 0), /* 0xC5 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 1), /* 0xC6 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 2), /* 0xC7 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 3), /* 0xC8 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 0), /* 0xC9 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 1), /* 0xCA */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 2), /* 0xCB */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 3), /* 0xCC */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 0), /* 0xCD */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 1), /* 0xCE */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 2), /* 0xCF */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 3), /* 0xD0 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 0), /* 0xD1 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 1), /* 0xD2 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 2), /* 0xD3 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 3), /* 0xD4 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 0), /* 0xD5 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 1), /* 0xD6 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 2), /* 0xD7 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 3), /* 0xD8 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 0), /* 0xD9 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 1), /* 0xDA */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 2), /* 0xDB */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 3), /* 0xDC */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 0), /* 0xDD */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 1), /* 0xDE */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 2), /* 0xDF */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 3), /* 0xE0 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 0), /* 0xE1 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 1), /* 0xE2 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 2), /* 0xE3 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 3), /* 0xE4 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 0), /* 0xE5 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 1), /* 0xE6 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 2), /* 0xE7 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 3), /* 0xE8 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 0), /* 0xE9 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 1), /* 0xEA */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 2), /* 0xEB */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 3), /* 0xEC */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 0), /* 0xED */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 1), /* 0xEE */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 2), /* 0xEF */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 3), /* 0xF0 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 0), /* 0xF1 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 1), /* 0xF2 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 2), /* 0xF3 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 3), /* 0xF4 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 0), /* 0xF5 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 1), /* 0xF6 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 2), /* 0xF7 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 3), /* 0xF8 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 0), /* 0xF9 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 1), /* 0xFA */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 2), /* 0xFB */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 3), /* 0xFC */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 0), /* 0xFD */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 1), /* 0xFE */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 2), /* 0xFF */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 3) - ]; - /***************************** - Mathematical Considerations - ****************************** - fv ... refers to freedom vector - pv ... refers to projection vector - rp ... refers to reference point - p ... refers to to point being operated on - d ... refers to distance - SETRELATIVE: - ============ - case freedom vector == x-axis: - ------------------------------ - (pv) - .-' - rpd .-' - .-* - d .-'90°' - .-' ' - .-' ' - *-' ' b - rp ' - ' - ' - p *----------*-------------- (fv) - pm - rpdx = rpx + d * pv.x - rpdy = rpy + d * pv.y - equation of line b - y - rpdy = pvns * (x- rpdx) - y = p.y - x = rpdx + ( p.y - rpdy ) / pvns - - case freedom vector == y-axis: - ------------------------------ - * pm - |\ - | \ - | \ - | \ - | \ - | \ - | \ - | \ - | \ - | \ b - | \ - | \ - | \ .-' (pv) - | 90° \.-' - | .-'* rpd - | .-' - * *-' d - p rp - rpdx = rpx + d * pv.x - rpdy = rpy + d * pv.y - equation of line b: - pvns ... normal slope to pv - y - rpdy = pvns * (x - rpdx) - x = p.x - y = rpdy + pvns * (p.x - rpdx) - - generic case: - ------------- - - .'(fv) - .' - .* pm - .' ! - .' . - .' ! - .' . b - .' ! - * . - p ! - 90° . ... (pv) - ...-*-''' - ...---''' rpd - ...---''' d - *--''' - rp - rpdx = rpx + d * pv.x - rpdy = rpy + d * pv.y - equation of line b: - pvns... normal slope to pv - y - rpdy = pvns * (x - rpdx) - equation of freedom vector line: - fvs ... slope of freedom vector (=fy/fx) - y - py = fvs * (x - px) - - on pm both equations are true for same x/y - y - rpdy = pvns * (x - rpdx) - y - py = fvs * (x - px) - form to y and set equal: - pvns * (x - rpdx) + rpdy = fvs * (x - px) + py - expand: - pvns * x - pvns * rpdx + rpdy = fvs * x - fvs * px + py - switch: - fvs * x - fvs * px + py = pvns * x - pvns * rpdx + rpdy - solve for x: - fvs * x - pvns * x = fvs * px - pvns * rpdx - py + rpdy - - fvs * px - pvns * rpdx + rpdy - py - x = ----------------------------------- - fvs - pvns - and: - y = fvs * (x - px) + py - - INTERPOLATE: - ============ - Examples of point interpolation. - The weight of the movement of the reference point gets bigger - the further the other reference point is away, thus the safest - option (that is avoiding 0/0 divisions) is to weight the - original distance of the other point by the sum of both distances. - If the sum of both distances is 0, then move the point by the - arithmetic average of the movement of both reference points. - - - (+6) - rp1o *---->*rp1 - . . (+12) - . . rp2o *---------->* rp2 - . . . . - . . . . - . 10 20 . . - |.........|...................| . - . . . - . . (+8) . - po *------>*p . - . . . - . 12 . 24 . - |...........|.......................| - 36 - - ------- - - (+10) - rp1o *-------->*rp1 - . . (-10) - . . rp2 *<---------* rpo2 - . . . . - . . . . - . 10 . 30 . . - |.........|.............................| - . . - . (+5) . - po *--->* p . - . . . - . . 20 . - |....|..............| - 5 15 - - ------- - - (+10) - rp1o *-------->*rp1 - . . - . . - rp2o *-------->*rp2 - - (+10) - po *-------->* p - ------- - - (+10) - rp1o *-------->*rp1 - . . - . .(+30) - rp2o *---------------------------->*rp2 - - (+25) - po *----------------------->* p - - vim: set ts=4 sw=4 expandtab: - *****/ - // The Font object - // This code is based on Array.from implementation for strings in https://github.com/mathiasbynens/Array.from - var arrayFromString = Array.from || function (s) { - return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g) || [ - ]; - }; - /** - * @typedef FontOptions - * @type Object - * @property {Boolean} empty - whether to create a new empty font - * @property {string} familyName - * @property {string} styleName - * @property {string=} fullName - * @property {string=} postScriptName - * @property {string=} designer - * @property {string=} designerURL - * @property {string=} manufacturer - * @property {string=} manufacturerURL - * @property {string=} license - * @property {string=} licenseURL - * @property {string=} version - * @property {string=} description - * @property {string=} copyright - * @property {string=} trademark - * @property {Number} unitsPerEm - * @property {Number} ascender - * @property {Number} descender - * @property {Number} createdTimestamp - * @property {string=} weightClass - * @property {string=} widthClass - * @property {string=} fsSelection - */ - /** - * A Font represents a loaded OpenType font file. - * It contains a set of glyphs and methods to draw text on a drawing context, - * or to get a path representing the text. - * @exports opentype.Font - * @class - * @param {FontOptions} - * @constructor - */ - function Font(options) { - options = options || { - }; - if (!options.empty) { - // Check that we've provided the minimum set of names. - checkArgument(options.familyName, 'When creating a new Font object, familyName is required.'); - checkArgument(options.styleName, 'When creating a new Font object, styleName is required.'); - checkArgument(options.unitsPerEm, 'When creating a new Font object, unitsPerEm is required.'); - checkArgument(options.ascender, 'When creating a new Font object, ascender is required.'); - checkArgument(options.descender, 'When creating a new Font object, descender is required.'); - checkArgument(options.descender < 0, 'Descender should be negative (e.g. -512).'); - // OS X will complain if the names are empty, so we put a single space everywhere by default. - this.names = { - fontFamily: { - en: options.familyName || ' ' - }, - fontSubfamily: { - en: options.styleName || ' ' - }, - fullName: { - en: options.fullName || options.familyName + ' ' + options.styleName - }, - // postScriptName may not contain any whitespace - postScriptName: { - en: options.postScriptName || (options.familyName + options.styleName).replace(/\s/g, '') - }, - designer: { - en: options.designer || ' ' - }, - designerURL: { - en: options.designerURL || ' ' - }, - manufacturer: { - en: options.manufacturer || ' ' - }, - manufacturerURL: { - en: options.manufacturerURL || ' ' - }, - license: { - en: options.license || ' ' - }, - licenseURL: { - en: options.licenseURL || ' ' - }, - version: { - en: options.version || 'Version 0.1' - }, - description: { - en: options.description || ' ' - }, - copyright: { - en: options.copyright || ' ' - }, - trademark: { - en: options.trademark || ' ' - } - }; - this.unitsPerEm = options.unitsPerEm || 1000; - this.ascender = options.ascender; - this.descender = options.descender; - this.createdTimestamp = options.createdTimestamp; - this.tables = { - os2: { - usWeightClass: options.weightClass || this.usWeightClasses.MEDIUM, - usWidthClass: options.widthClass || this.usWidthClasses.MEDIUM, - fsSelection: options.fsSelection || this.fsSelectionValues.REGULAR - } - }; - } - this.supported = true; // Deprecated: parseBuffer will throw an error if font is not supported. - this.glyphs = new glyphset.GlyphSet(this, options.glyphs || [ - ]); - this.encoding = new DefaultEncoding(this); - this.position = new Position(this); - this.substitution = new Substitution(this); - this.tables = this.tables || { - }; - Object.defineProperty(this, 'hinting', { - get: function () { - if (this._hinting) { - return this._hinting; - } - if (this.outlinesFormat === 'truetype') { - return this._hinting = new Hinting(this); - } - } - }); - } /** - * Check if the font has a glyph for the given character. - * @param {string} - * @return {Boolean} - */ - - Font.prototype.hasChar = function (c) { - return this.encoding.charToGlyphIndex(c) !== null; - }; - /** - * Convert the given character to a single glyph index. - * Note that this function assumes that there is a one-to-one mapping between - * the given character and a glyph; for complex scripts this might not be the case. - * @param {string} - * @return {Number} - */ - Font.prototype.charToGlyphIndex = function (s) { - return this.encoding.charToGlyphIndex(s); - }; - /** - * Convert the given character to a single Glyph object. - * Note that this function assumes that there is a one-to-one mapping between - * the given character and a glyph; for complex scripts this might not be the case. - * @param {string} - * @return {opentype.Glyph} - */ - Font.prototype.charToGlyph = function (c) { - var glyphIndex = this.charToGlyphIndex(c); - var glyph = this.glyphs.get(glyphIndex); - if (!glyph) { - // .notdef - glyph = this.glyphs.get(0); - } - return glyph; - }; - /** - * Convert the given text to a list of Glyph objects. - * Note that there is no strict one-to-one mapping between characters and - * glyphs, so the list of returned glyphs can be larger or smaller than the - * length of the given string. - * @param {string} - * @param {GlyphRenderOptions} [options] - * @return {opentype.Glyph[]} - */ - Font.prototype.stringToGlyphs = function (s, options) { - var this$1 = this; - options = options || this.defaultRenderOptions; - // Get glyph indexes - var chars = arrayFromString(s); - var indexes = [ - ]; - for (var i = 0; i < chars.length; i += 1) { - var c = chars[i]; - indexes.push(this$1.charToGlyphIndex(c)); - } - var length = indexes.length; - // Apply substitutions on glyph indexes - if (options.features) { - var script = options.script || this.substitution.getDefaultScriptName(); - var manyToOne = [ - ]; - if (options.features.liga) { - manyToOne = manyToOne.concat(this.substitution.getFeature('liga', script, options.language)); - } - if (options.features.rlig) { - manyToOne = manyToOne.concat(this.substitution.getFeature('rlig', script, options.language)); - } - for (var i$1 = 0; i$1 < length; i$1 += 1) { - for (var j = 0; j < manyToOne.length; j++) { - var ligature = manyToOne[j]; - var components = ligature.sub; - var compCount = components.length; - var k = 0; - while (k < compCount && components[k] === indexes[i$1 + k]) { - k++; - } - if (k === compCount) { - indexes.splice(i$1, compCount, ligature.by); - length = length - compCount + 1; - } - } - } - } // convert glyph indexes to glyph objects - - var glyphs = new Array(length); - var notdef = this.glyphs.get(0); - for (var i$2 = 0; i$2 < length; i$2 += 1) { - glyphs[i$2] = this$1.glyphs.get(indexes[i$2]) || notdef; - } - return glyphs; - }; - /** - * @param {string} - * @return {Number} - */ - Font.prototype.nameToGlyphIndex = function (name) { - return this.glyphNames.nameToGlyphIndex(name); - }; - /** - * @param {string} - * @return {opentype.Glyph} - */ - Font.prototype.nameToGlyph = function (name) { - var glyphIndex = this.nameToGlyphIndex(name); - var glyph = this.glyphs.get(glyphIndex); - if (!glyph) { - // .notdef - glyph = this.glyphs.get(0); - } - return glyph; - }; - /** - * @param {Number} - * @return {String} - */ - Font.prototype.glyphIndexToName = function (gid) { - if (!this.glyphNames.glyphIndexToName) { - return ''; - } - return this.glyphNames.glyphIndexToName(gid); - }; - /** - * Retrieve the value of the kerning pair between the left glyph (or its index) - * and the right glyph (or its index). If no kerning pair is found, return 0. - * The kerning value gets added to the advance width when calculating the spacing - * between glyphs. - * For GPOS kerning, this method uses the default script and language, which covers - * most use cases. To have greater control, use font.position.getKerningValue . - * @param {opentype.Glyph} leftGlyph - * @param {opentype.Glyph} rightGlyph - * @return {Number} - */ - Font.prototype.getKerningValue = function (leftGlyph, rightGlyph) { - leftGlyph = leftGlyph.index || leftGlyph; - rightGlyph = rightGlyph.index || rightGlyph; - var gposKerning = this.position.defaultKerningTables; - if (gposKerning) { - return this.position.getKerningValue(gposKerning, leftGlyph, rightGlyph); - } // "kern" table - - return this.kerningPairs[leftGlyph + ',' + rightGlyph] || 0; - }; - /** - * @typedef GlyphRenderOptions - * @type Object - * @property {string} [script] - script used to determine which features to apply. By default, 'DFLT' or 'latn' is used. - * See https://www.microsoft.com/typography/otspec/scripttags.htm - * @property {string} [language='dflt'] - language system used to determine which features to apply. - * See https://www.microsoft.com/typography/developers/opentype/languagetags.aspx - * @property {boolean} [kerning=true] - whether to include kerning values - * @property {object} [features] - OpenType Layout feature tags. Used to enable or disable the features of the given script/language system. - * See https://www.microsoft.com/typography/otspec/featuretags.htm - */ - Font.prototype.defaultRenderOptions = { - kerning: true, - features: { - liga: true, - rlig: true - } - }; - /** - * Helper function that invokes the given callback for each glyph in the given text. - * The callback gets `(glyph, x, y, fontSize, options)`.* @param {string} text - * @param {string} text - The text to apply. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @param {Function} callback - */ - Font.prototype.forEachGlyph = function (text, x, y, fontSize, options, callback) { - var this$1 = this; - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 72; - options = options || this.defaultRenderOptions; - var fontScale = 1 / this.unitsPerEm * fontSize; - var glyphs = this.stringToGlyphs(text, options); - var kerningLookups; - if (options.kerning) { - var script = options.script || this.position.getDefaultScriptName(); - kerningLookups = this.position.getKerningTables(script, options.language); - } - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs[i]; - callback.call(this$1, glyph, x, y, fontSize, options); - if (glyph.advanceWidth) { - x += glyph.advanceWidth * fontScale; - } - if (options.kerning && i < glyphs.length - 1) { - // We should apply position adjustment lookups in a more generic way. - // Here we only use the xAdvance value. - var kerningValue = kerningLookups ? this$1.position.getKerningValue(kerningLookups, glyph.index, glyphs[i + 1].index) : this$1.getKerningValue(glyph, glyphs[i + 1]); - x += kerningValue * fontScale; - } - if (options.letterSpacing) { - x += options.letterSpacing * fontSize; - } else if (options.tracking) { - x += options.tracking / 1000 * fontSize; - } - } - return x; - }; - /** - * Create a Path object that represents the given text. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @return {opentype.Path} - */ - Font.prototype.getPath = function (text, x, y, fontSize, options) { - var fullPath = new Path(); - this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { - var glyphPath = glyph.getPath(gX, gY, gFontSize, options, this); - fullPath.extend(glyphPath); - }); - return fullPath; - }; - /** - * Create an array of Path objects that represent the glyphs of a given text. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @return {opentype.Path[]} - */ - Font.prototype.getPaths = function (text, x, y, fontSize, options) { - var glyphPaths = [ - ]; - this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { - var glyphPath = glyph.getPath(gX, gY, gFontSize, options, this); - glyphPaths.push(glyphPath); - }); - return glyphPaths; - }; - /** - * Returns the advance width of a text. - * - * This is something different than Path.getBoundingBox() as for example a - * suffixed whitespace increases the advanceWidth but not the bounding box - * or an overhanging letter like a calligraphic 'f' might have a quite larger - * bounding box than its advance width. - * - * This corresponds to canvas2dContext.measureText(text).width - * - * @param {string} text - The text to create. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @return advance width - */ - Font.prototype.getAdvanceWidth = function (text, fontSize, options) { - return this.forEachGlyph(text, 0, 0, fontSize, options, function () { - }); - }; - /** - * Draw the text on the given drawing context. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - */ - Font.prototype.draw = function (ctx, text, x, y, fontSize, options) { - this.getPath(text, x, y, fontSize, options).draw(ctx); - }; - /** - * Draw the points of all glyphs in the text. - * On-curve points will be drawn in blue, off-curve points will be drawn in red. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - */ - Font.prototype.drawPoints = function (ctx, text, x, y, fontSize, options) { - this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { - glyph.drawPoints(ctx, gX, gY, gFontSize); - }); - }; - /** - * Draw lines indicating important font measurements for all glyphs in the text. - * Black lines indicate the origin of the coordinate system (point 0,0). - * Blue lines indicate the glyph bounding box. - * Green line indicates the advance width of the glyph. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - */ - Font.prototype.drawMetrics = function (ctx, text, x, y, fontSize, options) { - this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { - glyph.drawMetrics(ctx, gX, gY, gFontSize); - }); - }; - /** - * @param {string} - * @return {string} - */ - Font.prototype.getEnglishName = function (name) { - var translations = this.names[name]; - if (translations) { - return translations.en; - } - }; - /** - * Validate - */ - Font.prototype.validate = function () { - var _this = this; - function assert(predicate, message) { - } - function assertNamePresent(name) { - var englishName = _this.getEnglishName(name); - assert(englishName && englishName.trim().length > 0, 'No English ' + name + ' specified.'); - } // Identification information - - assertNamePresent('fontFamily'); - assertNamePresent('weightName'); - assertNamePresent('manufacturer'); - assertNamePresent('copyright'); - assertNamePresent('version'); - // Dimension information - assert(this.unitsPerEm > 0, 'No unitsPerEm specified.'); - }; - /** - * Convert the font object to a SFNT data structure. - * This structure contains all the necessary tables and metadata to create a binary OTF file. - * @return {opentype.Table} - */ - Font.prototype.toTables = function () { - return sfnt.fontToTable(this); - }; - /** - * @deprecated Font.toBuffer is deprecated. Use Font.toArrayBuffer instead. - */ - Font.prototype.toBuffer = function () { - console.warn('Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.'); - return this.toArrayBuffer(); - }; - /** - * Converts a `opentype.Font` into an `ArrayBuffer` - * @return {ArrayBuffer} - */ - Font.prototype.toArrayBuffer = function () { - var sfntTable = this.toTables(); - var bytes = sfntTable.encode(); - var buffer = new ArrayBuffer(bytes.length); - var intArray = new Uint8Array(buffer); - for (var i = 0; i < bytes.length; i++) { - intArray[i] = bytes[i]; - } - return buffer; - }; - /** - * Initiate a download of the OpenType font. - */ - Font.prototype.download = function (fileName) { - var familyName = this.getEnglishName('fontFamily'); - var styleName = this.getEnglishName('fontSubfamily'); - fileName = fileName || familyName.replace(/\s/g, '') + '-' + styleName + '.otf'; - var arrayBuffer = this.toArrayBuffer(); - if (isBrowser()) { - window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; - window.requestFileSystem(window.TEMPORARY, arrayBuffer.byteLength, function (fs) { - fs.root.getFile(fileName, { - create: true - }, function (fileEntry) { - fileEntry.createWriter(function (writer) { - var dataView = new DataView(arrayBuffer); - var blob = new Blob([dataView], { - type: 'font/opentype' - }); - writer.write(blob); - writer.addEventListener('writeend', function () { - // Navigating to the file will download it. - location.href = fileEntry.toURL(); - }, false); - }); - }); - }, function (err) { - throw new Error(err.name + ': ' + err.message); - }); - } else { - var fs = _dereq_('fs'); - var buffer = arrayBufferToNodeBuffer(arrayBuffer); - fs.writeFileSync(fileName, buffer); - } - }; - /** - * @private - */ - Font.prototype.fsSelectionValues = { - ITALIC: 1, - //1 - UNDERSCORE: 2, - //2 - NEGATIVE: 4, - //4 - OUTLINED: 8, - //8 - STRIKEOUT: 16, - //16 - BOLD: 32, - //32 - REGULAR: 64, - //64 - USER_TYPO_METRICS: 128, - //128 - WWS: 256, - //256 - OBLIQUE: 512 //512 - }; - /** - * @private - */ - Font.prototype.usWidthClasses = { - ULTRA_CONDENSED: 1, - EXTRA_CONDENSED: 2, - CONDENSED: 3, - SEMI_CONDENSED: 4, - MEDIUM: 5, - SEMI_EXPANDED: 6, - EXPANDED: 7, - EXTRA_EXPANDED: 8, - ULTRA_EXPANDED: 9 - }; - /** - * @private - */ - Font.prototype.usWeightClasses = { - THIN: 100, - EXTRA_LIGHT: 200, - LIGHT: 300, - NORMAL: 400, - MEDIUM: 500, - SEMI_BOLD: 600, - BOLD: 700, - EXTRA_BOLD: 800, - BLACK: 900 - }; - // The `fvar` table stores font variation axes and instances. - function addName(name, names) { - var nameString = JSON.stringify(name); - var nameID = 256; - for (var nameKey in names) { - var n = parseInt(nameKey); - if (!n || n < 256) { - continue; - } - if (JSON.stringify(names[nameKey]) === nameString) { - return n; - } - if (nameID <= n) { - nameID = n + 1; - } - } - names[nameID] = name; - return nameID; - } - function makeFvarAxis(n, axis, names) { - var nameID = addName(axis.name, names); - return [{ - name: 'tag_' + n, - type: 'TAG', - value: axis.tag - }, - { - name: 'minValue_' + n, - type: 'FIXED', - value: axis.minValue << 16 - }, - { - name: 'defaultValue_' + n, - type: 'FIXED', - value: axis.defaultValue << 16 - }, - { - name: 'maxValue_' + n, - type: 'FIXED', - value: axis.maxValue << 16 - }, - { - name: 'flags_' + n, - type: 'USHORT', - value: 0 - }, - { - name: 'nameID_' + n, - type: 'USHORT', - value: nameID - } - ]; - } - function parseFvarAxis(data, start, names) { - var axis = { - }; - var p = new parse.Parser(data, start); - axis.tag = p.parseTag(); - axis.minValue = p.parseFixed(); - axis.defaultValue = p.parseFixed(); - axis.maxValue = p.parseFixed(); - p.skip('uShort', 1); // reserved for flags; no values defined - axis.name = names[p.parseUShort()] || { - }; - return axis; - } - function makeFvarInstance(n, inst, axes, names) { - var nameID = addName(inst.name, names); - var fields = [ - { - name: 'nameID_' + n, - type: 'USHORT', - value: nameID - }, - { - name: 'flags_' + n, - type: 'USHORT', - value: 0 - } - ]; - for (var i = 0; i < axes.length; ++i) { - var axisTag = axes[i].tag; - fields.push({ - name: 'axis_' + n + ' ' + axisTag, - type: 'FIXED', - value: inst.coordinates[axisTag] << 16 - }); - } - return fields; - } - function parseFvarInstance(data, start, axes, names) { - var inst = { - }; - var p = new parse.Parser(data, start); - inst.name = names[p.parseUShort()] || { - }; - p.skip('uShort', 1); // reserved for flags; no values defined - inst.coordinates = { - }; - for (var i = 0; i < axes.length; ++i) { - inst.coordinates[axes[i].tag] = p.parseFixed(); - } - return inst; - } - function makeFvarTable(fvar, names) { - var result = new table.Table('fvar', [ - { - name: 'version', - type: 'ULONG', - value: 65536 - }, - { - name: 'offsetToData', - type: 'USHORT', - value: 0 - }, - { - name: 'countSizePairs', - type: 'USHORT', - value: 2 - }, - { - name: 'axisCount', - type: 'USHORT', - value: fvar.axes.length - }, - { - name: 'axisSize', - type: 'USHORT', - value: 20 - }, - { - name: 'instanceCount', - type: 'USHORT', - value: fvar.instances.length - }, - { - name: 'instanceSize', - type: 'USHORT', - value: 4 + fvar.axes.length * 4 - } - ]); - result.offsetToData = result.sizeOf(); - for (var i = 0; i < fvar.axes.length; i++) { - result.fields = result.fields.concat(makeFvarAxis(i, fvar.axes[i], names)); - } - for (var j = 0; j < fvar.instances.length; j++) { - result.fields = result.fields.concat(makeFvarInstance(j, fvar.instances[j], fvar.axes, names)); - } - return result; - } - function parseFvarTable(data, start, names) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseULong(); - check.argument(tableVersion === 65536, 'Unsupported fvar table version.'); - var offsetToData = p.parseOffset16(); - // Skip countSizePairs. - p.skip('uShort', 1); - var axisCount = p.parseUShort(); - var axisSize = p.parseUShort(); - var instanceCount = p.parseUShort(); - var instanceSize = p.parseUShort(); - var axes = [ - ]; - for (var i = 0; i < axisCount; i++) { - axes.push(parseFvarAxis(data, start + offsetToData + i * axisSize, names)); - } - var instances = [ - ]; - var instanceStart = start + offsetToData + axisCount * axisSize; - for (var j = 0; j < instanceCount; j++) { - instances.push(parseFvarInstance(data, instanceStart + j * instanceSize, axes, names)); - } - return { - axes: axes, - instances: instances - }; - } - var fvar = { - make: makeFvarTable, - parse: parseFvarTable - }; - // The `GPOS` table contains kerning pairs, among other things. - var subtableParsers$1 = new Array(10); // subtableParsers[0] is unused - // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-1-single-adjustment-positioning-subtable - // this = Parser instance - subtableParsers$1[1] = function parseLookup1() { - var start = this.offset + this.relativeOffset; - var posformat = this.parseUShort(); - if (posformat === 1) { - return { - posFormat: 1, - coverage: this.parsePointer(Parser.coverage), - value: this.parseValueRecord() - }; - } else if (posformat === 2) { - return { - posFormat: 2, - coverage: this.parsePointer(Parser.coverage), - values: this.parseValueRecordList() - }; - } - check.assert(false, '0x' + start.toString(16) + ': GPOS lookup type 1 format must be 1 or 2.'); - }; - // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-2-pair-adjustment-positioning-subtable - subtableParsers$1[2] = function parseLookup2() { - var start = this.offset + this.relativeOffset; - var posFormat = this.parseUShort(); - check.assert(posFormat === 1 || posFormat === 2, '0x' + start.toString(16) + ': GPOS lookup type 2 format must be 1 or 2.'); - var coverage = this.parsePointer(Parser.coverage); - var valueFormat1 = this.parseUShort(); - var valueFormat2 = this.parseUShort(); - if (posFormat === 1) { - // Adjustments for Glyph Pairs - return { - posFormat: posFormat, - coverage: coverage, - valueFormat1: valueFormat1, - valueFormat2: valueFormat2, - pairSets: this.parseList(Parser.pointer(Parser.list(function () { - return { - // pairValueRecord - secondGlyph: this.parseUShort(), - value1: this.parseValueRecord(valueFormat1), - value2: this.parseValueRecord(valueFormat2) - }; - }))) - }; - } else if (posFormat === 2) { - var classDef1 = this.parsePointer(Parser.classDef); - var classDef2 = this.parsePointer(Parser.classDef); - var class1Count = this.parseUShort(); - var class2Count = this.parseUShort(); - return { - // Class Pair Adjustment - posFormat: posFormat, - coverage: coverage, - valueFormat1: valueFormat1, - valueFormat2: valueFormat2, - classDef1: classDef1, - classDef2: classDef2, - class1Count: class1Count, - class2Count: class2Count, - classRecords: this.parseList(class1Count, Parser.list(class2Count, function () { - return { - value1: this.parseValueRecord(valueFormat1), - value2: this.parseValueRecord(valueFormat2) - }; - })) - }; - } - }; - subtableParsers$1[3] = function parseLookup3() { - return { - error: 'GPOS Lookup 3 not supported' - }; - }; - subtableParsers$1[4] = function parseLookup4() { - return { - error: 'GPOS Lookup 4 not supported' - }; - }; - subtableParsers$1[5] = function parseLookup5() { - return { - error: 'GPOS Lookup 5 not supported' - }; - }; - subtableParsers$1[6] = function parseLookup6() { - return { - error: 'GPOS Lookup 6 not supported' - }; - }; - subtableParsers$1[7] = function parseLookup7() { - return { - error: 'GPOS Lookup 7 not supported' - }; - }; - subtableParsers$1[8] = function parseLookup8() { - return { - error: 'GPOS Lookup 8 not supported' - }; - }; - subtableParsers$1[9] = function parseLookup9() { - return { - error: 'GPOS Lookup 9 not supported' - }; - }; - // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos - function parseGposTable(data, start) { - start = start || 0; - var p = new Parser(data, start); - var tableVersion = p.parseVersion(1); - check.argument(tableVersion === 1 || tableVersion === 1.1, 'Unsupported GPOS table version ' + tableVersion); - if (tableVersion === 1) { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers$1) - }; - } else { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers$1), - variations: p.parseFeatureVariationsList() - }; - } - } // GPOS Writing ////////////////////////////////////////////// - // NOT SUPPORTED - - var subtableMakers$1 = new Array(10); - function makeGposTable(gpos) { - return new table.Table('GPOS', [ - { - name: 'version', - type: 'ULONG', - value: 65536 - }, - { - name: 'scripts', - type: 'TABLE', - value: new table.ScriptList(gpos.scripts) - }, - { - name: 'features', - type: 'TABLE', - value: new table.FeatureList(gpos.features) - }, - { - name: 'lookups', - type: 'TABLE', - value: new table.LookupList(gpos.lookups, subtableMakers$1) - } - ]); - } - var gpos = { - parse: parseGposTable, - make: makeGposTable - }; - // The `kern` table contains kerning pairs. - function parseWindowsKernTable(p) { - var pairs = { - }; - // Skip nTables. - p.skip('uShort'); - var subtableVersion = p.parseUShort(); - check.argument(subtableVersion === 0, 'Unsupported kern sub-table version.'); - // Skip subtableLength, subtableCoverage - p.skip('uShort', 2); - var nPairs = p.parseUShort(); - // Skip searchRange, entrySelector, rangeShift. - p.skip('uShort', 3); - for (var i = 0; i < nPairs; i += 1) { - var leftIndex = p.parseUShort(); - var rightIndex = p.parseUShort(); - var value = p.parseShort(); - pairs[leftIndex + ',' + rightIndex] = value; - } - return pairs; - } - function parseMacKernTable(p) { - var pairs = { - }; - // The Mac kern table stores the version as a fixed (32 bits) but we only loaded the first 16 bits. - // Skip the rest. - p.skip('uShort'); - var nTables = p.parseULong(); - //check.argument(nTables === 1, 'Only 1 subtable is supported (got ' + nTables + ').'); - if (nTables > 1) { - console.warn('Only the first kern subtable is supported.'); - } - p.skip('uLong'); - var coverage = p.parseUShort(); - var subtableVersion = coverage & 255; - p.skip('uShort'); - if (subtableVersion === 0) { - var nPairs = p.parseUShort(); - // Skip searchRange, entrySelector, rangeShift. - p.skip('uShort', 3); - for (var i = 0; i < nPairs; i += 1) { - var leftIndex = p.parseUShort(); - var rightIndex = p.parseUShort(); - var value = p.parseShort(); - pairs[leftIndex + ',' + rightIndex] = value; - } - } - return pairs; - } // Parse the `kern` table which contains kerning pairs. - - function parseKernTable(data, start) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseUShort(); - if (tableVersion === 0) { - return parseWindowsKernTable(p); - } else if (tableVersion === 1) { - return parseMacKernTable(p); - } else { - throw new Error('Unsupported kern table version (' + tableVersion + ').'); - } - } - var kern = { - parse: parseKernTable - }; - // The `loca` table stores the offsets to the locations of the glyphs in the font. - // Parse the `loca` table. This table stores the offsets to the locations of the glyphs in the font, - // relative to the beginning of the glyphData table. - // The number of glyphs stored in the `loca` table is specified in the `maxp` table (under numGlyphs) - // The loca table has two versions: a short version where offsets are stored as uShorts, and a long - // version where offsets are stored as uLongs. The `head` table specifies which version to use - // (under indexToLocFormat). - function parseLocaTable(data, start, numGlyphs, shortVersion) { - var p = new parse.Parser(data, start); - var parseFn = shortVersion ? p.parseUShort : p.parseULong; - // There is an extra entry after the last index element to compute the length of the last glyph. - // That's why we use numGlyphs + 1. - var glyphOffsets = [ - ]; - for (var i = 0; i < numGlyphs + 1; i += 1) { - var glyphOffset = parseFn.call(p); - if (shortVersion) { - // The short table version stores the actual offset divided by 2. - glyphOffset *= 2; - } - glyphOffsets.push(glyphOffset); - } - return glyphOffsets; - } - var loca = { - parse: parseLocaTable - }; - // opentype.js - /** - * The opentype library. - * @namespace opentype - */ - // File loaders ///////////////////////////////////////////////////////// - /** - * Loads a font from a file. The callback throws an error message as the first parameter if it fails - * and the font as an ArrayBuffer in the second parameter if it succeeds. - * @param {string} path - The path of the file - * @param {Function} callback - The function to call when the font load completes - */ - function loadFromFile(path, callback) { - var fs = _dereq_('fs'); - fs.readFile(path, function (err, buffer) { - if (err) { - return callback(err.message); - } - callback(null, nodeBufferToArrayBuffer(buffer)); - }); - } /** - * Loads a font from a URL. The callback throws an error message as the first parameter if it fails - * and the font as an ArrayBuffer in the second parameter if it succeeds. - * @param {string} url - The URL of the font file. - * @param {Function} callback - The function to call when the font load completes - */ - - function loadFromUrl(url, callback) { - var request = new XMLHttpRequest(); - request.open('get', url, true); - request.responseType = 'arraybuffer'; - request.onload = function () { - if (request.response) { - return callback(null, request.response); - } else { - return callback('Font could not be loaded: ' + request.statusText); - } - }; - request.onerror = function () { - callback('Font could not be loaded'); - }; - request.send(); - } // Table Directory Entries ////////////////////////////////////////////// - /** - * Parses OpenType table entries. - * @param {DataView} - * @param {Number} - * @return {Object[]} - */ - - function parseOpenTypeTableEntries(data, numTables) { - var tableEntries = [ - ]; - var p = 12; - for (var i = 0; i < numTables; i += 1) { - var tag = parse.getTag(data, p); - var checksum = parse.getULong(data, p + 4); - var offset = parse.getULong(data, p + 8); - var length = parse.getULong(data, p + 12); - tableEntries.push({ - tag: tag, - checksum: checksum, - offset: offset, - length: length, - compression: false - }); - p += 16; - } - return tableEntries; - } /** - * Parses WOFF table entries. - * @param {DataView} - * @param {Number} - * @return {Object[]} - */ - - function parseWOFFTableEntries(data, numTables) { - var tableEntries = [ - ]; - var p = 44; // offset to the first table directory entry. - for (var i = 0; i < numTables; i += 1) { - var tag = parse.getTag(data, p); - var offset = parse.getULong(data, p + 4); - var compLength = parse.getULong(data, p + 8); - var origLength = parse.getULong(data, p + 12); - var compression = void 0; - if (compLength < origLength) { - compression = 'WOFF'; - } else { - compression = false; - } - tableEntries.push({ - tag: tag, - offset: offset, - compression: compression, - compressedLength: compLength, - length: origLength - }); - p += 20; - } - return tableEntries; - } /** - * @typedef TableData - * @type Object - * @property {DataView} data - The DataView - * @property {number} offset - The data offset. - */ - /** - * @param {DataView} - * @param {Object} - * @return {TableData} - */ - - function uncompressTable(data, tableEntry) { - if (tableEntry.compression === 'WOFF') { - var inBuffer = new Uint8Array(data.buffer, tableEntry.offset + 2, tableEntry.compressedLength - 2); - var outBuffer = new Uint8Array(tableEntry.length); - tinyInflate(inBuffer, outBuffer); - if (outBuffer.byteLength !== tableEntry.length) { - throw new Error('Decompression error: ' + tableEntry.tag + ' decompressed length doesn\'t match recorded length'); - } - var view = new DataView(outBuffer.buffer, 0); - return { - data: view, - offset: 0 - }; - } else { - return { - data: data, - offset: tableEntry.offset - }; - } - } // Public API /////////////////////////////////////////////////////////// - /** - * Parse the OpenType file data (as an ArrayBuffer) and return a Font object. - * Throws an error if the font could not be parsed. - * @param {ArrayBuffer} - * @return {opentype.Font} - */ - - function parseBuffer(buffer) { - var indexToLocFormat; - var ltagTable; - // Since the constructor can also be called to create new fonts from scratch, we indicate this - // should be an empty font that we'll fill with our own data. - var font = new Font({ - empty: true - }); - // OpenType fonts use big endian byte ordering. - // We can't rely on typed array view types, because they operate with the endianness of the host computer. - // Instead we use DataViews where we can specify endianness. - var data = new DataView(buffer, 0); - var numTables; - var tableEntries = [ - ]; - var signature = parse.getTag(data, 0); - if (signature === String.fromCharCode(0, 1, 0, 0) || signature === 'true' || signature === 'typ1') { - font.outlinesFormat = 'truetype'; - numTables = parse.getUShort(data, 4); - tableEntries = parseOpenTypeTableEntries(data, numTables); - } else if (signature === 'OTTO') { - font.outlinesFormat = 'cff'; - numTables = parse.getUShort(data, 4); - tableEntries = parseOpenTypeTableEntries(data, numTables); - } else if (signature === 'wOFF') { - var flavor = parse.getTag(data, 4); - if (flavor === String.fromCharCode(0, 1, 0, 0)) { - font.outlinesFormat = 'truetype'; - } else if (flavor === 'OTTO') { - font.outlinesFormat = 'cff'; - } else { - throw new Error('Unsupported OpenType flavor ' + signature); - } - numTables = parse.getUShort(data, 12); - tableEntries = parseWOFFTableEntries(data, numTables); - } else { - throw new Error('Unsupported OpenType signature ' + signature); - } - var cffTableEntry; - var fvarTableEntry; - var glyfTableEntry; - var gposTableEntry; - var gsubTableEntry; - var hmtxTableEntry; - var kernTableEntry; - var locaTableEntry; - var nameTableEntry; - var metaTableEntry; - var p; - for (var i = 0; i < numTables; i += 1) { - var tableEntry = tableEntries[i]; - var table = void 0; - switch (tableEntry.tag) { - case 'cmap': - table = uncompressTable(data, tableEntry); - font.tables.cmap = cmap.parse(table.data, table.offset); - font.encoding = new CmapEncoding(font.tables.cmap); - break; - case 'cvt ': - table = uncompressTable(data, tableEntry); - p = new parse.Parser(table.data, table.offset); - font.tables.cvt = p.parseShortList(tableEntry.length / 2); - break; - case 'fvar': - fvarTableEntry = tableEntry; - break; - case 'fpgm': - table = uncompressTable(data, tableEntry); - p = new parse.Parser(table.data, table.offset); - font.tables.fpgm = p.parseByteList(tableEntry.length); - break; - case 'head': - table = uncompressTable(data, tableEntry); - font.tables.head = head.parse(table.data, table.offset); - font.unitsPerEm = font.tables.head.unitsPerEm; - indexToLocFormat = font.tables.head.indexToLocFormat; - break; - case 'hhea': - table = uncompressTable(data, tableEntry); - font.tables.hhea = hhea.parse(table.data, table.offset); - font.ascender = font.tables.hhea.ascender; - font.descender = font.tables.hhea.descender; - font.numberOfHMetrics = font.tables.hhea.numberOfHMetrics; - break; - case 'hmtx': - hmtxTableEntry = tableEntry; - break; - case 'ltag': - table = uncompressTable(data, tableEntry); - ltagTable = ltag.parse(table.data, table.offset); - break; - case 'maxp': - table = uncompressTable(data, tableEntry); - font.tables.maxp = maxp.parse(table.data, table.offset); - font.numGlyphs = font.tables.maxp.numGlyphs; - break; - case 'name': - nameTableEntry = tableEntry; - break; - case 'OS/2': - table = uncompressTable(data, tableEntry); - font.tables.os2 = os2.parse(table.data, table.offset); - break; - case 'post': - table = uncompressTable(data, tableEntry); - font.tables.post = post.parse(table.data, table.offset); - font.glyphNames = new GlyphNames(font.tables.post); - break; - case 'prep': - table = uncompressTable(data, tableEntry); - p = new parse.Parser(table.data, table.offset); - font.tables.prep = p.parseByteList(tableEntry.length); - break; - case 'glyf': - glyfTableEntry = tableEntry; - break; - case 'loca': - locaTableEntry = tableEntry; - break; - case 'CFF ': - cffTableEntry = tableEntry; - break; - case 'kern': - kernTableEntry = tableEntry; - break; - case 'GPOS': - gposTableEntry = tableEntry; - break; - case 'GSUB': - gsubTableEntry = tableEntry; - break; - case 'meta': - metaTableEntry = tableEntry; - break; - } - } - var nameTable = uncompressTable(data, nameTableEntry); - font.tables.name = _name.parse(nameTable.data, nameTable.offset, ltagTable); - font.names = font.tables.name; - if (glyfTableEntry && locaTableEntry) { - var shortVersion = indexToLocFormat === 0; - var locaTable = uncompressTable(data, locaTableEntry); - var locaOffsets = loca.parse(locaTable.data, locaTable.offset, font.numGlyphs, shortVersion); - var glyfTable = uncompressTable(data, glyfTableEntry); - font.glyphs = glyf.parse(glyfTable.data, glyfTable.offset, locaOffsets, font); - } else if (cffTableEntry) { - var cffTable = uncompressTable(data, cffTableEntry); - cff.parse(cffTable.data, cffTable.offset, font); - } else { - throw new Error('Font doesn\'t contain TrueType or CFF outlines.'); - } - var hmtxTable = uncompressTable(data, hmtxTableEntry); - hmtx.parse(hmtxTable.data, hmtxTable.offset, font.numberOfHMetrics, font.numGlyphs, font.glyphs); - addGlyphNames(font); - if (kernTableEntry) { - var kernTable = uncompressTable(data, kernTableEntry); - font.kerningPairs = kern.parse(kernTable.data, kernTable.offset); - } else { - font.kerningPairs = { - }; - } - if (gposTableEntry) { - var gposTable = uncompressTable(data, gposTableEntry); - font.tables.gpos = gpos.parse(gposTable.data, gposTable.offset); - font.position.init(); - } - if (gsubTableEntry) { - var gsubTable = uncompressTable(data, gsubTableEntry); - font.tables.gsub = gsub.parse(gsubTable.data, gsubTable.offset); - } - if (fvarTableEntry) { - var fvarTable = uncompressTable(data, fvarTableEntry); - font.tables.fvar = fvar.parse(fvarTable.data, fvarTable.offset, font.names); - } - if (metaTableEntry) { - var metaTable = uncompressTable(data, metaTableEntry); - font.tables.meta = meta.parse(metaTable.data, metaTable.offset); - font.metas = font.tables.meta; - } - return font; - } /** - * Asynchronously load the font from a URL or a filesystem. When done, call the callback - * with two arguments `(err, font)`. The `err` will be null on success, - * the `font` is a Font object. - * We use the node.js callback convention so that - * opentype.js can integrate with frameworks like async.js. - * @alias opentype.load - * @param {string} url - The URL of the font to load. - * @param {Function} callback - The callback. - */ - - function load(url, callback) { - var isNode$$1 = typeof window === 'undefined'; - var loadFn = isNode$$1 ? loadFromFile : loadFromUrl; - loadFn(url, function (err, arrayBuffer) { - if (err) { - return callback(err); - } - var font; - try { - font = parseBuffer(arrayBuffer); - } catch (e) { - return callback(e, null); - } - return callback(null, font); - }); - } /** - * Synchronously load the font from a URL or file. - * When done, returns the font object or throws an error. - * @alias opentype.loadSync - * @param {string} url - The URL of the font to load. - * @return {opentype.Font} - */ - - function loadSync(url) { - var fs = _dereq_('fs'); - var buffer = fs.readFileSync(url); - return parseBuffer(nodeBufferToArrayBuffer(buffer)); - } - exports.Font = Font; - exports.Glyph = Glyph; - exports.Path = Path; - exports.BoundingBox = BoundingBox; - exports._parse = parse; - exports.parse = parseBuffer; - exports.load = load; - exports.loadSync = loadSync; - Object.defineProperty(exports, '__esModule', { - value: true - }); - }); - }).call(this, _dereq_('buffer').Buffer) - }, - { - 'buffer': 22, - 'fs': 21 - } - ], - 272: [ - function (_dereq_, module, exports) { - (function (process) { - // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, - // backported and transplited with Babel, with backwards-compat fixes - // Copyright Joyent, Inc. and other Node contributors. - // - // 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. - // resolves . and .. elements in a path array with directory names there - // must be no slashes, empty elements, or device names (c:\) in the array - // (so also no leading and trailing slashes - it does not distinguish - // relative and absolute paths) - function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } // if the path is allowed to go above the root, restore leading ..s - - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - return parts; - } // path.resolve([from ...], to) - // posix version - - exports.resolve = function () { - var resolvedPath = '', - resolvedAbsolute = false; - for (var i = arguments.length - 1; i >= - 1 && !resolvedAbsolute; i--) { - var path = i >= 0 ? arguments[i] : process.cwd(); - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - // Normalize the path - - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) { - return !!p; - }), !resolvedAbsolute).join('/'); - return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; - }; - // path.normalize(path) - // posix version - exports.normalize = function (path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, - 1) === '/'; - // Normalize the path - path = normalizeArray(filter(path.split('/'), function (p) { - return !!p; - }), !isAbsolute).join('/'); - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - return (isAbsolute ? '/' : '') + path; - }; - // posix version - exports.isAbsolute = function (path) { - return path.charAt(0) === '/'; - }; - // posix version - exports.join = function () { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function (p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); - }; - // path.relative(from, to) - // posix version - exports.relative = function (from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - var outputParts = [ - ]; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - return outputParts.join('/'); - }; - exports.sep = '/'; - exports.delimiter = ':'; - exports.dirname = function (path) { - if (typeof path !== 'string') path = path + ''; - if (path.length === 0) return '.'; - var code = path.charCodeAt(0); - var hasRoot = code === 47 /*/*/ ; - var end = - 1; - var matchedSlash = true; - for (var i = path.length - 1; i >= 1; --i) { - code = path.charCodeAt(i); - if (code === 47 /*/*/ ) { - if (!matchedSlash) { - end = i; - break; - } - } else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === - 1) return hasRoot ? '/' : '.'; - if (hasRoot && end === 1) { - // return '//'; - // Backwards-compat fix: - return '/'; - } - return path.slice(0, end); - }; - function basename(path) { - if (typeof path !== 'string') path = path + ''; - var start = 0; - var end = - 1; - var matchedSlash = true; - var i; - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === 47 /*/*/ ) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } else if (end === - 1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === - 1) return ''; - return path.slice(start, end); - } // Uses a mixed approach for backwards-compatibility, as ext behavior changed - // in new Node.js versions, so only basename() above is backported here - - exports.basename = function (path, ext) { - var f = basename(path); - if (ext && f.substr( - 1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; - }; - exports.extname = function (path) { - if (typeof path !== 'string') path = path + ''; - var startDot = - 1; - var startPart = 0; - var end = - 1; - var matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - var preDotState = 0; - for (var i = path.length - 1; i >= 0; --i) { - var code = path.charCodeAt(i); - if (code === 47 /*/*/ ) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === - 1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === 46 /*.*/ ) { - // If this is our first dot, mark it as the start of our extension - if (startDot === - 1) startDot = i; - else if (preDotState !== 1) preDotState = 1; - } else if (startDot !== - 1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = - 1; - } - } - if (startDot === - 1 || end === - 1 || // We saw a non-dot character immediately before the dot - preDotState === 0 || // The (right-most) trimmed path component is exactly '..' - preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { - return ''; - } - return path.slice(startDot, end); - }; - function filter(xs, f) { - if (xs.filter) return xs.filter(f); - var res = [ - ]; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; - } // String.prototype.substr - negative index don't work in IE8 - - var substr = 'ab'.substr( - 1) === 'b' ? function (str, start, len) { - return str.substr(start, len); - } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - }; - }).call(this, _dereq_('_process')) - }, - { - '_process': 273 - } - ], - 273: [ - function (_dereq_, module, exports) { - // shim for using process in browser - var process = module.exports = { - }; - // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - var cachedSetTimeout; - var cachedClearTimeout; - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - }(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - }) (); - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - var queue = [ - ]; - var draining = false; - var currentQueue; - var queueIndex = - 1; - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = - 1; - } - if (queue.length) { - drainQueue(); - } - } - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - while (len) { - currentQueue = queue; - queue = [ - ]; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = - 1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = { - }; - process.argv = [ - ]; - process.version = ''; // empty string to avoid regexp issues - process.versions = { - }; - function noop() { - } - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - process.listeners = function (name) { - return []; - }; - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - process.cwd = function () { - return '/'; - }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function () { - return 0; - }; - }, - { - } - ], - 274: [ - function (_dereq_, module, exports) { - /** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - var runtime = function (exports) { - 'use strict'; - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === 'function' ? Symbol : { - }; - var iteratorSymbol = $Symbol.iterator || '@@iterator'; - var asyncIteratorSymbol = $Symbol.asyncIterator || '@@asyncIterator'; - var toStringTagSymbol = $Symbol.toStringTag || '@@toStringTag'; - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || [ - ]); - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - return generator; - } - exports.wrap = wrap; - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { - type: 'normal', - arg: fn.call(obj, arg) - }; - } catch (err) { - return { - type: 'throw', - arg: err - }; - } - } - var GenStateSuspendedStart = 'suspendedStart'; - var GenStateSuspendedYield = 'suspendedYield'; - var GenStateExecuting = 'executing'; - var GenStateCompleted = 'completed'; - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = { - }; - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() { - } - function GeneratorFunction() { - } - function GeneratorFunctionPrototype() { - } // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - - var IteratorPrototype = { - }; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = 'GeneratorFunction'; - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - [ - 'next', - 'throw', - 'return' - ].forEach(function (method) { - prototype[method] = function (arg) { - return this._invoke(method, arg); - }; - }); - } - exports.isGeneratorFunction = function (genFun) { - var ctor = typeof genFun === 'function' && genFun.constructor; - return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === 'GeneratorFunction' : false; - }; - exports.mark = function (genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = 'GeneratorFunction'; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function (arg) { - return { - __await: arg - }; - }; - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === 'throw') { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && typeof value === 'object' && hasOwn.call(value, '__await')) { - return Promise.resolve(value.__await).then(function (value) { - invoke('next', value, resolve, reject); - }, function (err) { - invoke('throw', err, resolve, reject); - }); - } - return Promise.resolve(value).then(function (unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function (error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke('throw', error, resolve, reject); - }); - } - } - var previousPromise; - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function (resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - return previousPromise = // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - - this._invoke = enqueue; - } - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - exports.AsyncIterator = AsyncIterator; - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function (innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList)); - return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function (result) { - return result.done ? result.value : iter.next(); - }); - }; - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error('Generator is already running'); - } - if (state === GenStateCompleted) { - if (method === 'throw') { - throw arg; - } // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - - return doneResult(); - } - context.method = method; - context.arg = arg; - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - if (context.method === 'next') { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - } else if (context.method === 'throw') { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - context.dispatchException(context.arg); - } else if (context.method === 'return') { - context.abrupt('return', context.arg); - } - state = GenStateExecuting; - var record = tryCatch(innerFn, self, context); - if (record.type === 'normal') { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done ? GenStateCompleted : GenStateSuspendedYield; - if (record.arg === ContinueSentinel) { - continue; - } - return { - value: record.arg, - done: context.done - }; - } else if (record.type === 'throw') { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = 'throw'; - context.arg = record.arg; - } - } - }; - } // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - if (context.method === 'throw') { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator['return']) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = 'return'; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - if (context.method === 'throw') { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - context.method = 'throw'; - context.arg = new TypeError('The iterator does not provide a \'throw\' method'); - } - return ContinueSentinel; - } - var record = tryCatch(method, delegate.iterator, context.arg); - if (record.type === 'throw') { - context.method = 'throw'; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - var info = record.arg; - if (!info) { - context.method = 'throw'; - context.arg = new TypeError('iterator result is not an object'); - context.delegate = null; - return ContinueSentinel; - } - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== 'return') { - context.method = 'next'; - context.arg = undefined; - } - } else { - // Re-yield the result returned by the delegate method. - return info; - } // The delegate iterator is finished, so forget it and continue with - // the outer generator. - - context.delegate = null; - return ContinueSentinel; - } // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - - defineIteratorMethods(Gp); - Gp[toStringTagSymbol] = 'Generator'; - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function () { - return this; - }; - Gp.toString = function () { - return '[object Generator]'; - }; - function pushTryEntry(locs) { - var entry = { - tryLoc: locs[0] - }; - if (1 in locs) { - entry.catchLoc = locs[1]; - } - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - this.tryEntries.push(entry); - } - function resetTryEntry(entry) { - var record = entry.completion || { - }; - record.type = 'normal'; - delete record.arg; - entry.completion = record; - } - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [ - { - tryLoc: 'root' - } - ]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - exports.keys = function (object) { - var keys = [ - ]; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - - next.done = true; - return next; - }; - }; - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - if (typeof iterable.next === 'function') { - return iterable; - } - if (!isNaN(iterable.length)) { - var i = - 1, - next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - next.value = undefined; - next.done = true; - return next; - }; - return next.next = next; - } - } // Return an iterator with no values. - - return { - next: doneResult - }; - } - exports.values = values; - function doneResult() { - return { - value: undefined, - done: true - }; - } - Context.prototype = { - constructor: Context, - reset: function (skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - this.method = 'next'; - this.arg = undefined; - this.tryEntries.forEach(resetTryEntry); - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === 't' && hasOwn.call(this, name) && !isNaN( + name.slice(1))) { - this[name] = undefined; - } - } - } - }, - stop: function () { - this.done = true; - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === 'throw') { - throw rootRecord.arg; - } - return this.rval; - }, - dispatchException: function (exception) { - if (this.done) { - throw exception; - } - var context = this; - function handle(loc, caught) { - record.type = 'throw'; - record.arg = exception; - context.next = loc; - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = 'next'; - context.arg = undefined; - } - return !!caught; - } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - if (entry.tryLoc === 'root') { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle('end'); - } - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, 'catchLoc'); - var hasFinally = hasOwn.call(entry, 'finallyLoc'); - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else { - throw new Error('try statement without catch or finally'); - } - } - } - }, - abrupt: function (type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && hasOwn.call(entry, 'finallyLoc') && this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - if (finallyEntry && (type === 'break' || type === 'continue') && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - var record = finallyEntry ? finallyEntry.completion : { - }; - record.type = type; - record.arg = arg; - if (finallyEntry) { - this.method = 'next'; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - return this.complete(record); - }, - complete: function (record, afterLoc) { - if (record.type === 'throw') { - throw record.arg; - } - if (record.type === 'break' || record.type === 'continue') { - this.next = record.arg; - } else if (record.type === 'return') { - this.rval = this.arg = record.arg; - this.method = 'return'; - this.next = 'end'; - } else if (record.type === 'normal' && afterLoc) { - this.next = afterLoc; - } - return ContinueSentinel; - }, - finish: function (finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - 'catch': function (tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === 'throw') { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - - throw new Error('illegal catch attempt'); - }, - delegateYield: function (iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - if (this.method === 'next') { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - return ContinueSentinel; - } - }; - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - }( // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - typeof module === 'object' ? module.exports : { - }); - try { - regeneratorRuntime = runtime; - } catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function('r', 'regeneratorRuntime = r') (runtime); - } - }, - { - } - ], - 275: [ - function (_dereq_, module, exports) { - (function (self) { - 'use strict'; - if (self.fetch) { - return; - } - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: 'FileReader' in self && 'Blob' in self && function () { - try { - new Blob(); - return true; - } catch (e) { - return false; - } - }(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - if (support.arrayBuffer) { - var viewClasses = [ - '[object Int8Array]', - '[object Uint8Array]', - '[object Uint8ClampedArray]', - '[object Int16Array]', - '[object Uint16Array]', - '[object Int32Array]', - '[object Uint32Array]', - '[object Float32Array]', - '[object Float64Array]' - ]; - var isDataView = function (obj) { - return obj && DataView.prototype.isPrototypeOf(obj); - }; - var isArrayBufferView = ArrayBuffer.isView || function (obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > - 1; - }; - } - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name'); - } - return name.toLowerCase(); - } - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value; - } // Build a destructive iterator for the value list - - function iteratorFor(items) { - var iterator = { - next: function () { - var value = items.shift(); - return { - done: value === undefined, - value: value - }; - } - }; - if (support.iterable) { - iterator[Symbol.iterator] = function () { - return iterator; - }; - } - return iterator; - } - function Headers(headers) { - this.map = { - }; - if (headers instanceof Headers) { - headers.forEach(function (value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function (header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function (name) { - this.append(name, headers[name]); - }, this); - } - } - Headers.prototype.append = function (name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + ',' + value : value; - }; - Headers.prototype['delete'] = function (name) { - delete this.map[normalizeName(name)]; - }; - Headers.prototype.get = function (name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null; - }; - Headers.prototype.has = function (name) { - return this.map.hasOwnProperty(normalizeName(name)); - }; - Headers.prototype.set = function (name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - Headers.prototype.forEach = function (callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - Headers.prototype.keys = function () { - var items = [ - ]; - this.forEach(function (value, name) { - items.push(name); - }); - return iteratorFor(items); - }; - Headers.prototype.values = function () { - var items = [ - ]; - this.forEach(function (value) { - items.push(value); - }); - return iteratorFor(items); - }; - Headers.prototype.entries = function () { - var items = [ - ]; - this.forEach(function (value, name) { - items.push([name, - value]); - }); - return iteratorFor(items); - }; - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')); - } - body.bodyUsed = true; - } - function fileReaderReady(reader) { - return new Promise(function (resolve, reject) { - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error); - }; - }); - } - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise; - } - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise; - } - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join(''); - } - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0); - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer; - } - } - function Body() { - this.bodyUsed = false; - this._initBody = function (body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ''; - } else if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body); - } else { - throw new Error('unsupported BodyInit type'); - } - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - if (support.blob) { - this.blob = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob); - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob'); - } else { - return Promise.resolve(new Blob([this._bodyText])); - } - }; - this.arrayBuffer = function () { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer); - } else { - return this.blob().then(readBlobAsArrayBuffer); - } - }; - } - this.text = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob); - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text'); - } else { - return Promise.resolve(this._bodyText); - } - }; - if (support.formData) { - this.formData = function () { - return this.text().then(decode); - }; - } - this.json = function () { - return this.text().then(JSON.parse); - }; - return this; - } // HTTP methods whose capitalization should be normalized - - var methods = [ - 'DELETE', - 'GET', - 'HEAD', - 'OPTIONS', - 'POST', - 'PUT' - ]; - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > - 1 ? upcased : method; - } - function Request(input, options) { - options = options || { - }; - var body = options.body; - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read'); - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - this.credentials = options.credentials || this.credentials || 'omit'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.referrer = null; - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests'); - } - this._initBody(body); - } - Request.prototype.clone = function () { - return new Request(this, { - body: this._bodyInit - }); - }; - function decode(body) { - var form = new FormData(); - body.trim().split('&').forEach(function (bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form; - } - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(function (line) { - var parts = line.split(':'); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(':').trim(); - headers.append(key, value); - } - }); - return headers; - } - Body.call(Request.prototype); - function Response(bodyInit, options) { - if (!options) { - options = { - }; - } - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - Body.call(Response.prototype); - Response.prototype.clone = function () { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }); - }; - Response.error = function () { - var response = new Response(null, { - status: 0, - statusText: '' - }); - response.type = 'error'; - return response; - }; - var redirectStatuses = [ - 301, - 302, - 303, - 307, - 308 - ]; - Response.redirect = function (url, status) { - if (redirectStatuses.indexOf(status) === - 1) { - throw new RangeError('Invalid status code'); - } - return new Response(null, { - status: status, - headers: { - location: url - } - }); - }; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - self.fetch = function (input, init) { - return new Promise(function (resolve, reject) { - var request = new Request(input, init); - var xhr = new XMLHttpRequest(); - xhr.onload = function () { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - xhr.onerror = function () { - reject(new TypeError('Network request failed')); - }; - xhr.ontimeout = function () { - reject(new TypeError('Network request failed')); - }; - xhr.open(request.method, request.url, true); - if (request.credentials === 'include') { - xhr.withCredentials = true; - } else if (request.credentials === 'omit') { - xhr.withCredentials = false; - } - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - request.headers.forEach(function (value, name) { - xhr.setRequestHeader(name, value); - }); - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }); - }; - self.fetch.polyfill = true; - }) (typeof self !== 'undefined' ? self : this); - }, - { - } - ], - 276: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.split'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var _color_conversion = _interopRequireDefault(_dereq_('../color/color_conversion')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - //stores the original hsb values - - var originalHSB; - //stores values for color name exceptions - var colorExceptions = [ - { - h: 0, - s: 0, - b: 0.8275, - name: 'gray' - }, - { - h: 0, - s: 0, - b: 0.8627, - name: 'gray' - }, - { - h: 0, - s: 0, - b: 0.7529, - name: 'gray' - }, - { - h: 0.0167, - s: 0.1176, - b: 1, - name: 'light pink' - } - ]; - //stores values for color names - var colorLookUp = [ - { - h: 0, - s: 0, - b: 0, - name: 'black' - }, - { - h: 0, - s: 0, - b: 0.5, - name: 'gray' - }, - { - h: 0, - s: 0, - b: 1, - name: 'white' - }, - { - h: 0, - s: 0.5, - b: 0.5, - name: 'dark maroon' - }, - { - h: 0, - s: 0.5, - b: 1, - name: 'salmon pink' - }, - { - h: 0, - s: 1, - b: 0, - name: 'black' - }, - { - h: 0, - s: 1, - b: 0.5, - name: 'dark red' - }, - { - h: 0, - s: 1, - b: 1, - name: 'red' - }, - { - h: 5, - s: 0, - b: 1, - name: 'very light peach' - }, - { - h: 5, - s: 0.5, - b: 0.5, - name: 'brown' - }, - { - h: 5, - s: 0.5, - b: 1, - name: 'peach' - }, - { - h: 5, - s: 1, - b: 0.5, - name: 'brick red' - }, - { - h: 5, - s: 1, - b: 1, - name: 'crimson' - }, - { - h: 10, - s: 0, - b: 1, - name: 'light peach' - }, - { - h: 10, - s: 0.5, - b: 0.5, - name: 'brown' - }, - { - h: 10, - s: 0.5, - b: 1, - name: 'light orange' - }, - { - h: 10, - s: 1, - b: 0.5, - name: 'brown' - }, - { - h: 10, - s: 1, - b: 1, - name: 'orange' - }, - { - h: 15, - s: 0, - b: 1, - name: 'very light yellow' - }, - { - h: 15, - s: 0.5, - b: 0.5, - name: 'olive green' - }, - { - h: 15, - s: 0.5, - b: 1, - name: 'light yellow' - }, - { - h: 15, - s: 1, - b: 0, - name: 'dark olive green' - }, - { - h: 15, - s: 1, - b: 0.5, - name: 'olive green' - }, - { - h: 15, - s: 1, - b: 1, - name: 'yellow' - }, - { - h: 20, - s: 0, - b: 1, - name: 'very light yellow' - }, - { - h: 20, - s: 0.5, - b: 0.5, - name: 'olive green' - }, - { - h: 20, - s: 0.5, - b: 1, - name: 'light yellow green' - }, - { - h: 20, - s: 1, - b: 0, - name: 'dark olive green' - }, - { - h: 20, - s: 1, - b: 0.5, - name: 'dark yellow green' - }, - { - h: 20, - s: 1, - b: 1, - name: 'yellow green' - }, - { - h: 25, - s: 0.5, - b: 0.5, - name: 'dark yellow green' - }, - { - h: 25, - s: 0.5, - b: 1, - name: 'light green' - }, - { - h: 25, - s: 1, - b: 0.5, - name: 'dark green' - }, - { - h: 25, - s: 1, - b: 1, - name: 'green' - }, - { - h: 30, - s: 0.5, - b: 1, - name: 'light green' - }, - { - h: 30, - s: 1, - b: 0.5, - name: 'dark green' - }, - { - h: 30, - s: 1, - b: 1, - name: 'green' - }, - { - h: 35, - s: 0, - b: 0.5, - name: 'light green' - }, - { - h: 35, - s: 0, - b: 1, - name: 'very light green' - }, - { - h: 35, - s: 0.5, - b: 0.5, - name: 'dark green' - }, - { - h: 35, - s: 0.5, - b: 1, - name: 'light green' - }, - { - h: 35, - s: 1, - b: 0, - name: 'very dark green' - }, - { - h: 35, - s: 1, - b: 0.5, - name: 'dark green' - }, - { - h: 35, - s: 1, - b: 1, - name: 'green' - }, - { - h: 40, - s: 0, - b: 1, - name: 'very light green' - }, - { - h: 40, - s: 0.5, - b: 0.5, - name: 'dark green' - }, - { - h: 40, - s: 0.5, - b: 1, - name: 'light green' - }, - { - h: 40, - s: 1, - b: 0.5, - name: 'dark green' - }, - { - h: 40, - s: 1, - b: 1, - name: 'green' - }, - { - h: 45, - s: 0.5, - b: 1, - name: 'light turquoise' - }, - { - h: 45, - s: 1, - b: 0.5, - name: 'dark turquoise' - }, - { - h: 45, - s: 1, - b: 1, - name: 'turquoise' - }, - { - h: 50, - s: 0, - b: 1, - name: 'light sky blue' - }, - { - h: 50, - s: 0.5, - b: 0.5, - name: 'dark cyan' - }, - { - h: 50, - s: 0.5, - b: 1, - name: 'light cyan' - }, - { - h: 50, - s: 1, - b: 0.5, - name: 'dark cyan' - }, - { - h: 50, - s: 1, - b: 1, - name: 'cyan' - }, - { - h: 55, - s: 0, - b: 1, - name: 'light sky blue' - }, - { - h: 55, - s: 0.5, - b: 1, - name: 'light sky blue' - }, - { - h: 55, - s: 1, - b: 0.5, - name: 'dark blue' - }, - { - h: 55, - s: 1, - b: 1, - name: 'sky blue' - }, - { - h: 60, - s: 0, - b: 0.5, - name: 'gray' - }, - { - h: 60, - s: 0, - b: 1, - name: 'very light blue' - }, - { - h: 60, - s: 0.5, - b: 0.5, - name: 'blue' - }, - { - h: 60, - s: 0.5, - b: 1, - name: 'light blue' - }, - { - h: 60, - s: 1, - b: 0.5, - name: 'navy blue' - }, - { - h: 60, - s: 1, - b: 1, - name: 'blue' - }, - { - h: 65, - s: 0, - b: 1, - name: 'lavender' - }, - { - h: 65, - s: 0.5, - b: 0.5, - name: 'navy blue' - }, - { - h: 65, - s: 0.5, - b: 1, - name: 'light purple' - }, - { - h: 65, - s: 1, - b: 0.5, - name: 'dark navy blue' - }, - { - h: 65, - s: 1, - b: 1, - name: 'blue' - }, - { - h: 70, - s: 0, - b: 1, - name: 'lavender' - }, - { - h: 70, - s: 0.5, - b: 0.5, - name: 'navy blue' - }, - { - h: 70, - s: 0.5, - b: 1, - name: 'lavender blue' - }, - { - h: 70, - s: 1, - b: 0.5, - name: 'dark navy blue' - }, - { - h: 70, - s: 1, - b: 1, - name: 'blue' - }, - { - h: 75, - s: 0.5, - b: 1, - name: 'lavender' - }, - { - h: 75, - s: 1, - b: 0.5, - name: 'dark purple' - }, - { - h: 75, - s: 1, - b: 1, - name: 'purple' - }, - { - h: 80, - s: 0.5, - b: 1, - name: 'pinkish purple' - }, - { - h: 80, - s: 1, - b: 0.5, - name: 'dark purple' - }, - { - h: 80, - s: 1, - b: 1, - name: 'purple' - }, - { - h: 85, - s: 0, - b: 1, - name: 'light pink' - }, - { - h: 85, - s: 0.5, - b: 0.5, - name: 'purple' - }, - { - h: 85, - s: 0.5, - b: 1, - name: 'light fuchsia' - }, - { - h: 85, - s: 1, - b: 0.5, - name: 'dark fuchsia' - }, - { - h: 85, - s: 1, - b: 1, - name: 'fuchsia' - }, - { - h: 90, - s: 0.5, - b: 0.5, - name: 'dark fuchsia' - }, - { - h: 90, - s: 0.5, - b: 1, - name: 'hot pink' - }, - { - h: 90, - s: 1, - b: 0.5, - name: 'dark fuchsia' - }, - { - h: 90, - s: 1, - b: 1, - name: 'fuchsia' - }, - { - h: 95, - s: 0, - b: 1, - name: 'pink' - }, - { - h: 95, - s: 0.5, - b: 1, - name: 'light pink' - }, - { - h: 95, - s: 1, - b: 0.5, - name: 'dark magenta' - }, - { - h: 95, - s: 1, - b: 1, - name: 'magenta' - } - ]; - //returns text with color name - function _calculateColor(hsb) { - var colortext; - //round hue - if (hsb[0] !== 0) { - hsb[0] = Math.round(hsb[0] * 100); - var hue = hsb[0].toString().split(''); - var last = hue.length - 1; - hue[last] = parseInt(hue[last]); - //if last digit of hue is < 2.5 make it 0 - if (hue[last] < 2.5) { - hue[last] = 0; - //if last digit of hue is >= 2.5 and less than 7.5 make it 5 - } else if (hue[last] >= 2.5 && hue[last] < 7.5) { - hue[last] = 5; - } //if hue only has two digits - - if (hue.length === 2) { - hue[0] = parseInt(hue[0]); - //if last is greater than 7.5 - if (hue[last] >= 7.5) { - //add one to the tens - hue[last] = 0; - hue[0] = hue[0] + 1; - } - hsb[0] = hue[0] * 10 + hue[1]; - } else { - if (hue[last] >= 7.5) { - hsb[0] = 10; - } else { - hsb[0] = hue[last]; - } - } - } //map brightness from 0 to 1 - - hsb[2] = hsb[2] / 255; - //round saturation and brightness - for (var i = hsb.length - 1; i >= 1; i--) { - if (hsb[i] <= 0.25) { - hsb[i] = 0; - } else if (hsb[i] > 0.25 && hsb[i] < 0.75) { - hsb[i] = 0.5; - } else { - hsb[i] = 1; - } - } //after rounding, if the values are hue 0, saturation 0 and brightness 1 - //look at color exceptions which includes several tones from white to gray - - if (hsb[0] === 0 && hsb[1] === 0 && hsb[2] === 1) { - //round original hsb values - for (var _i = 2; _i >= 0; _i--) { - originalHSB[_i] = Math.round(originalHSB[_i] * 10000) / 10000; - } //compare with the values in the colorExceptions array - - for (var e = 0; e < colorExceptions.length; e++) { - if (colorExceptions[e].h === originalHSB[0] && colorExceptions[e].s === originalHSB[1] && colorExceptions[e].b === originalHSB[2]) { - colortext = colorExceptions[e].name; - break; - } else { - //if there is no match return white - colortext = 'white'; - } - } - } else { - //otherwise, compare with values in colorLookUp - for (var _i2 = 0; _i2 < colorLookUp.length; _i2++) { - if (colorLookUp[_i2].h === hsb[0] && colorLookUp[_i2].s === hsb[1] && colorLookUp[_i2].b === hsb[2]) { - colortext = colorLookUp[_i2].name; - break; - } - } - } - return colortext; - } //gets rgba and returs a color name - - _main.default.prototype._rgbColorName = function (arg) { - //conversts rgba to hsb - var hsb = _color_conversion.default._rgbaToHSBA(arg); - //stores hsb in global variable - originalHSB = hsb; - //calculate color name - return _calculateColor([hsb[0], - hsb[1], - hsb[2]]); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../color/color_conversion': 282, - '../core/main': 298, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.split': 216 - } - ], - 277: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.ends-with'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.ends-with'); - _dereq_('core-js/modules/es.string.replace'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - - var descContainer = '_Description'; //Fallback container - var fallbackDescId = '_fallbackDesc'; //Fallback description - var fallbackTableId = '_fallbackTable'; //Fallback Table - var fallbackTableElId = '_fte_'; //Fallback Table Element - var labelContainer = '_Label'; //Label container - var labelDescId = '_labelDesc'; //Label description - var labelTableId = '_labelTable'; //Label Table - var labelTableElId = '_lte_'; //Label Table Element - /** - * Creates a screen reader-accessible description for the canvas. - * - * The first parameter, `text`, is the description of the canvas. - * - * The second parameter, `display`, is optional. It determines how the - * description is displayed. If `LABEL` is passed, as in - * `describe('A description.', LABEL)`, the description will be visible in - * a div element next to the canvas. If `FALLBACK` is passed, as in - * `describe('A description.', FALLBACK)`, the description will only be - * visible to screen readers. This is the default mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method describe - * @param {String} text description of the canvas. - * @param {Constant} [display] either LABEL or FALLBACK. - * - * @example - *
            - * - * function setup() { - * background('pink'); - * - * // Draw a heart. - * fill('red'); - * noStroke(); - * circle(67, 67, 20); - * circle(83, 67, 20); - * triangle(91, 73, 75, 95, 59, 73); - * - * // Add a general description of the canvas. - * describe('A pink square with a red heart in the bottom-right corner.'); - * } - * - *
            - * - *
            - * - * function setup() { - * background('pink'); - * - * // Draw a heart. - * fill('red'); - * noStroke(); - * circle(67, 67, 20); - * circle(83, 67, 20); - * triangle(91, 73, 75, 95, 59, 73); - * - * // Add a general description of the canvas - * // and display it for debugging. - * describe('A pink square with a red heart in the bottom-right corner.', LABEL); - * } - * - *
            - * - *
            - * - * function draw() { - * background(200); - * - * // The expression - * // frameCount % 100 - * // causes x to increase from 0 - * // to 99, then restart from 0. - * let x = frameCount % 100; - * - * // Draw the circle. - * fill(0, 255, 0); - * circle(x, 50, 40); - * - * // Add a general description of the canvas. - * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`); - * } - * - *
            - * - *
            - * - * function draw() { - * background(200); - * - * // The expression - * // frameCount % 100 - * // causes x to increase from 0 - * // to 99, then restart from 0. - * let x = frameCount % 100; - * - * // Draw the circle. - * fill(0, 255, 0); - * circle(x, 50, 40); - * - * // Add a general description of the canvas - * // and display it for debugging. - * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); - * } - * - *
            - */ - _main.default.prototype.describe = function (text, display) { - _main.default._validateParameters('describe', arguments); - if (typeof text !== 'string') { - return; - } - var cnvId = this.canvas.id; - //calls function that adds punctuation for better screen reading - text = _descriptionText(text); - //if there is no dummyDOM - if (!this.dummyDOM) { - this.dummyDOM = document.getElementById(cnvId).parentNode; - } - if (!this.descriptions) { - this.descriptions = { - }; - } //check if html structure for description is ready - - if (this.descriptions.fallback) { - //check if text is different from current description - if (this.descriptions.fallback.innerHTML !== text) { - //update description - this.descriptions.fallback.innerHTML = text; - } - } else { - //create fallback html structure - this._describeHTML('fallback', text); - } //if display is LABEL - - if (display === this.LABEL) { - //check if html structure for label is ready - if (this.descriptions.label) { - //check if text is different from current label - if (this.descriptions.label.innerHTML !== text) { - //update label description - this.descriptions.label.innerHTML = text; - } - } else { - //create label html structure - this._describeHTML('label', text); - } - } - }; - /** - * Creates a screen reader-accessible description for elements in the canvas. - * Elements are shapes or groups of shapes that create meaning together. - * - * The first parameter, `name`, is the name of the element. - * - * The second parameter, `text`, is the description of the element. - * - * The third parameter, `display`, is optional. It determines how the - * description is displayed. If `LABEL` is passed, as in - * `describe('A description.', LABEL)`, the description will be visible in - * a div element next to the canvas. Using `LABEL` creates unhelpful - * duplicates for screen readers. Only use `LABEL` during development. If - * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method describeElement - * @param {String} name name of the element. - * @param {String} text description of the element. - * @param {Constant} [display] either LABEL or FALLBACK. - * - * @example - *
            - * - * function setup() { - * background('pink'); - * - * // Describe the first element - * // and draw it. - * describeElement('Circle', 'A yellow circle in the top-left corner.'); - * noStroke(); - * fill('yellow'); - * circle(25, 25, 40); - * - * // Describe the second element - * // and draw it. - * describeElement('Heart', 'A red heart in the bottom-right corner.'); - * fill('red'); - * circle(66.6, 66.6, 20); - * circle(83.2, 66.6, 20); - * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); - * - * // Add a general description of the canvas. - * describe('A red heart and yellow circle over a pink background.'); - * } - * - *
            - * - *
            - * - * function setup() { - * background('pink'); - * - * // Describe the first element - * // and draw it. Display the - * // description for debugging. - * describeElement('Circle', 'A yellow circle in the top-left corner.', LABEL); - * noStroke(); - * fill('yellow'); - * circle(25, 25, 40); - * - * // Describe the second element - * // and draw it. Display the - * // description for debugging. - * describeElement('Heart', 'A red heart in the bottom-right corner.', LABEL); - * fill('red'); - * circle(66.6, 66.6, 20); - * circle(83.2, 66.6, 20); - * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); - * - * // Add a general description of the canvas. - * describe('A red heart and yellow circle over a pink background.'); - * } - * - *
            - */ - _main.default.prototype.describeElement = function (name, text, display) { - _main.default._validateParameters('describeElement', arguments); - if (typeof text !== 'string' || typeof name !== 'string') { - return; - } - var cnvId = this.canvas.id; - //calls function that adds punctuation for better screen reading - text = _descriptionText(text); - //calls function that adds punctuation for better screen reading - var elementName = _elementName(name); - //remove any special characters from name to use it as html id - name = name.replace(/[^a-zA-Z0-9]/g, ''); - //store element description - var inner = ''.concat(elementName, '').concat(text, ''); - //if there is no dummyDOM - if (!this.dummyDOM) { - this.dummyDOM = document.getElementById(cnvId).parentNode; - } - if (!this.descriptions) { - this.descriptions = { - fallbackElements: { - } - }; - } else if (!this.descriptions.fallbackElements) { - this.descriptions.fallbackElements = { - }; - } //check if html structure for element description is ready - - if (this.descriptions.fallbackElements[name]) { - //if current element description is not the same as inner - if (this.descriptions.fallbackElements[name].innerHTML !== inner) { - //update element description - this.descriptions.fallbackElements[name].innerHTML = inner; - } - } else { - //create fallback html structure - this._describeElementHTML('fallback', name, inner); - } //if display is LABEL - - if (display === this.LABEL) { - if (!this.descriptions.labelElements) { - this.descriptions.labelElements = { - }; - } //if html structure for label element description is ready - - if (this.descriptions.labelElements[name]) { - //if label element description is different - if (this.descriptions.labelElements[name].innerHTML !== inner) { - //update label element description - this.descriptions.labelElements[name].innerHTML = inner; - } - } else { - //create label element html structure - this._describeElementHTML('label', name, inner); - } - } - }; - /* - * - * Helper functions for describe() and describeElement(). - * - */ - // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark - function _descriptionText(text) { - if (text === 'label' || text === 'fallback') { - throw new Error('description should not be LABEL or FALLBACK'); - } //if string does not end with '.' - - if (!text.endsWith('.') && !text.endsWith(';') && !text.endsWith(',') && !text.endsWith('?') && !text.endsWith('!')) { - //add '.' to the end of string - text = text + '.'; - } - return text; - } /* - * Helper functions for describe() - */ - //creates HTML structure for canvas descriptions - - _main.default.prototype._describeHTML = function (type, text) { - var cnvId = this.canvas.id; - if (type === 'fallback') { - //if there is no description container - if (!this.dummyDOM.querySelector('#'.concat(cnvId + descContainer))) { - //if there are no accessible outputs (see textOutput() and gridOutput()) - var html = '

            '); - if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput'))) { - //create description container +

            for fallback description - this.dummyDOM.querySelector('#'.concat(cnvId)).innerHTML = html; - } else { - //create description container +

            for fallback description before outputs - this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput')).insertAdjacentHTML('beforebegin', html); - } - } else { - //if describeElement() has already created the container and added a table of elements - //create fallback description

            before the table - this.dummyDOM.querySelector('#' + cnvId + fallbackTableId).insertAdjacentHTML('beforebegin', '

            ')); - } //if the container for the description exists - - this.descriptions.fallback = this.dummyDOM.querySelector('#'.concat(cnvId).concat(fallbackDescId)); - this.descriptions.fallback.innerHTML = text; - return; - } else if (type === 'label') { - //if there is no label container - if (!this.dummyDOM.querySelector('#'.concat(cnvId + labelContainer))) { - var _html = '

            '); - //if there are no accessible outputs (see textOutput() and gridOutput()) - if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel'))) { - //create label container +

            for label description - this.dummyDOM.querySelector('#' + cnvId).insertAdjacentHTML('afterend', _html); - } else { - //create label container +

            for label description before outputs - this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel')).insertAdjacentHTML('beforebegin', _html); - } - } else if (this.dummyDOM.querySelector('#'.concat(cnvId + labelTableId))) { - //if describeElement() has already created the container and added a table of elements - //create label description

            before the table - this.dummyDOM.querySelector('#'.concat(cnvId + labelTableId)).insertAdjacentHTML('beforebegin', '

            ')); - } - this.descriptions.label = this.dummyDOM.querySelector('#' + cnvId + labelDescId); - this.descriptions.label.innerHTML = text; - return; - } - }; - /* - * Helper functions for describeElement(). - */ - //check that name is not LABEL or FALLBACK and ensure text ends with colon - function _elementName(name) { - if (name === 'label' || name === 'fallback') { - throw new Error('element name should not be LABEL or FALLBACK'); - } //check if last character of string n is '.', ';', or ',' - - if (name.endsWith('.') || name.endsWith(';') || name.endsWith(',')) { - //replace last character with ':' - name = name.replace(/.$/, ':'); - } else if (!name.endsWith(':')) { - //if string n does not end with ':' - //add ':'' at the end of string - name = name + ':'; - } - return name; - } //creates HTML structure for element descriptions - - _main.default.prototype._describeElementHTML = function (type, name, text) { - var cnvId = this.canvas.id; - if (type === 'fallback') { - //if there is no description container - if (!this.dummyDOM.querySelector('#'.concat(cnvId + descContainer))) { - //if there are no accessible outputs (see textOutput() and gridOutput()) - var html = '
            Canvas elements and their descriptions
            '); - if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput'))) { - //create container + table for element descriptions - this.dummyDOM.querySelector('#' + cnvId).innerHTML = html; - } else { - //create container + table for element descriptions before outputs - this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput')).insertAdjacentHTML('beforebegin', html); - } - } else if (!this.dummyDOM.querySelector('#' + cnvId + fallbackTableId)) { - //if describe() has already created the container and added a description - //and there is no table create fallback table for element description after - //fallback description - this.dummyDOM.querySelector('#' + cnvId + fallbackDescId).insertAdjacentHTML('afterend', '
            Canvas elements and their descriptions
            ')); - } //create a table row for the element - - var tableRow = document.createElement('tr'); - tableRow.id = cnvId + fallbackTableElId + name; - this.dummyDOM.querySelector('#' + cnvId + fallbackTableId).appendChild(tableRow); - //update element description - this.descriptions.fallbackElements[name] = this.dummyDOM.querySelector('#'.concat(cnvId).concat(fallbackTableElId).concat(name)); - this.descriptions.fallbackElements[name].innerHTML = text; - return; - } else if (type === 'label') { - //If display is LABEL creates a div adjacent to the canvas element with - //a table, a row header cell with the name of the elements, - //and adds the description of the element in adjecent cell. - //if there is no label description container - if (!this.dummyDOM.querySelector('#'.concat(cnvId + labelContainer))) { - //if there are no accessible outputs (see textOutput() and gridOutput()) - var _html2 = '
            '); - if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel'))) { - //create container + table for element descriptions - this.dummyDOM.querySelector('#' + cnvId).insertAdjacentHTML('afterend', _html2); - } else { - //create container + table for element descriptions before outputs - this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel')).insertAdjacentHTML('beforebegin', _html2); - } - } else if (!this.dummyDOM.querySelector('#'.concat(cnvId + labelTableId))) { - //if describe() has already created the label container and added a description - //and there is no table create label table for element description after - //label description - this.dummyDOM.querySelector('#' + cnvId + labelDescId).insertAdjacentHTML('afterend', '
            ')); - } //create a table row for the element label description - - var _tableRow = document.createElement('tr'); - _tableRow.id = cnvId + labelTableElId + name; - this.dummyDOM.querySelector('#' + cnvId + labelTableId).appendChild(_tableRow); - //update element label description - this.descriptions.labelElements[name] = this.dummyDOM.querySelector('#'.concat(cnvId).concat(labelTableElId).concat(name)); - this.descriptions.labelElements[name].innerHTML = text; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.ends-with': 208, - 'core-js/modules/es.string.replace': 214 - } - ], - 278: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.string.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - //the functions in this file support updating the grid output - //updates gridOutput - - _main.default.prototype._updateGridOutput = function (idT) { - //if html structure is not there yet - if (!this.dummyDOM.querySelector('#'.concat(idT, '_summary'))) { - return; - } - var current = this._accessibleOutputs[idT]; - //create shape details list - var innerShapeDetails = _gridShapeDetails(idT, this.ingredients.shapes); - //create summary - var innerSummary = _gridSummary(innerShapeDetails.numShapes, this.ingredients.colors.background, this.width, this.height); - //create grid map - var innerMap = _gridMap(idT, this.ingredients.shapes); - //if it is different from current summary - if (innerSummary !== current.summary.innerHTML) { - //update - current.summary.innerHTML = innerSummary; - } //if it is different from current map - - if (innerMap !== current.map.innerHTML) { - //update - current.map.innerHTML = innerMap; - } //if it is different from current shape details - - if (innerShapeDetails.details !== current.shapeDetails.innerHTML) { - //update - current.shapeDetails.innerHTML = innerShapeDetails.details; - } - this._accessibleOutputs[idT] = current; - }; - //creates spatial grid that maps the location of shapes - function _gridMap(idT, ingredients) { - var shapeNumber = 0; - var table = ''; - //create an array of arrays 10*10 of empty cells - var cells = Array.from(Array(10), function () { - return Array(10); - }); - for (var x in ingredients) { - for (var y in ingredients[x]) { - var fill = void 0; - if (x !== 'line') { - fill = '').concat(ingredients[x][y].color, ' ').concat(x, ''); - } else { - fill = '').concat(ingredients[x][y].color, ' ').concat(x, ' midpoint'); - } //if empty cell of location of shape is undefined - - if (!cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX]) { - //fill it with shape info - cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] = fill; - //if a shape is already in that location - } else { - //add it - cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] = cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] + ' ' + fill; - } - shapeNumber++; - } - } //make table based on array - - for (var _r in cells) { - var row = ''; - for (var c in cells[_r]) { - row = row + ''; - if (cells[_r][c] !== undefined) { - row = row + cells[_r][c]; - } - row = row + ''; - } - table = table + row + ''; - } - return table; - } //creates grid summary - - function _gridSummary(numShapes, background, width, height) { - var text = ''.concat(background, ' canvas, ').concat(width, ' by ').concat(height, ' pixels, contains ').concat(numShapes[0]); - if (numShapes[0] === 1) { - text = ''.concat(text, ' shape: ').concat(numShapes[1]); - } else { - text = ''.concat(text, ' shapes: ').concat(numShapes[1]); - } - return text; - } //creates list of shapes - - function _gridShapeDetails(idT, ingredients) { - var shapeDetails = ''; - var shapes = ''; - var totalShapes = 0; - //goes trhough every shape type in ingredients - for (var x in ingredients) { - var shapeNum = 0; - for (var y in ingredients[x]) { - //it creates a line in a list - var line = '
          • ').concat(ingredients[x][y].color, ' ').concat(x, ','); - if (x === 'line') { - line = line + ' location = '.concat(ingredients[x][y].pos, ', length = ').concat(ingredients[x][y].length, ' pixels'); - } else { - line = line + ' location = '.concat(ingredients[x][y].pos); - if (x !== 'point') { - line = line + ', area = '.concat(ingredients[x][y].area, ' %'); - } - line = line + '
          • '; - } - shapeDetails = shapeDetails + line; - shapeNum++; - totalShapes++; - } - if (shapeNum > 1) { - shapes = ''.concat(shapes, ' ').concat(shapeNum, ' ').concat(x, 's'); - } else { - shapes = ''.concat(shapes, ' ').concat(shapeNum, ' ').concat(x); - } - } - return { - numShapes: [ - totalShapes, - shapes - ], - details: shapeDetails - }; - } - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.string.iterator': 210 - } - ], - 279: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.number.to-fixed'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - /** - * Creates a screen reader-accessible description for shapes on the canvas. - * `textOutput()` adds a general description, list of shapes, and - * table of shapes to the web page. - * - * The general description includes the canvas size, canvas color, and number - * of shapes. For example, - * `Your output is a, 100 by 100 pixels, gray canvas containing the following 2 shapes:`. - * - * A list of shapes follows the general description. The list describes the - * color, location, and area of each shape. For example, - * `a red circle at middle covering 3% of the canvas`. Each shape can be - * selected to get more details. - * - * `textOutput()` uses its table of shapes as a list. The table describes the - * shape, color, location, coordinates and area. For example, - * `red circle location = middle area = 3%`. This is different from - * gridOutput(), which uses its table as a grid. - * - * The `display` parameter is optional. It determines how the description is - * displayed. If `LABEL` is passed, as in `textOutput(LABEL)`, the description - * will be visible in a div element next to the canvas. Using `LABEL` creates - * unhelpful duplicates for screen readers. Only use `LABEL` during - * development. If `FALLBACK` is passed, as in `textOutput(FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method textOutput - * @param {Constant} [display] either FALLBACK or LABEL. - * - * @example - *
            - * - * function setup() { - * // Add the text description. - * textOutput(); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
            - * - *
            - * - * function setup() { - * // Add the text description and - * // display it for debugging. - * textOutput(LABEL); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
            - * - *
            - * - * function draw() { - * // Add the text description. - * textOutput(); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
            - * - *
            - * - * function draw() { - * // Add the text description and - * // display it for debugging. - * textOutput(LABEL); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
            - */ - - _main.default.prototype.textOutput = function (display) { - _main.default._validateParameters('textOutput', arguments); - //if textOutput is already true - if (this._accessibleOutputs.text) { - return; - } else { - //make textOutput true - this._accessibleOutputs.text = true; - //create output for fallback - this._createOutput('textOutput', 'Fallback'); - if (display === this.LABEL) { - //make textOutput label true - this._accessibleOutputs.textLabel = true; - //create output for label - this._createOutput('textOutput', 'Label'); - } - } - }; - /** - * Creates a screen reader-accessible description for shapes on the canvas. - * `gridOutput()` adds a general description, table of shapes, and list of - * shapes to the web page. - * - * The general description includes the canvas size, canvas color, and number of - * shapes. For example, - * `gray canvas, 100 by 100 pixels, contains 2 shapes: 1 circle 1 square`. - * - * `gridOutput()` uses its table of shapes as a grid. Each shape in the grid - * is placed in a cell whose row and column correspond to the shape's location - * on the canvas. The grid cells describe the color and type of shape at that - * location. For example, `red circle`. These descriptions can be selected - * individually to get more details. This is different from - * textOutput(), which uses its table as a list. - * - * A list of shapes follows the table. The list describes the color, type, - * location, and area of each shape. For example, - * `red circle, location = middle, area = 3 %`. - * - * The `display` parameter is optional. It determines how the description is - * displayed. If `LABEL` is passed, as in `gridOutput(LABEL)`, the description - * will be visible in a div element next to the canvas. Using `LABEL` creates - * unhelpful duplicates for screen readers. Only use `LABEL` during - * development. If `FALLBACK` is passed, as in `gridOutput(FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method gridOutput - * @param {Constant} [display] either FALLBACK or LABEL. - * - * @example - *
            - * - * function setup() { - * // Add the grid description. - * gridOutput(); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
            - * - *
            - * - * function setup() { - * // Add the grid description and - * // display it for debugging. - * gridOutput(LABEL); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
            - * - *
            - * - * function draw() { - * // Add the grid description. - * gridOutput(); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
            - * - *
            - * - * function draw() { - * // Add the grid description and - * // display it for debugging. - * gridOutput(LABEL); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
            - */ - _main.default.prototype.gridOutput = function (display) { - _main.default._validateParameters('gridOutput', arguments); - //if gridOutput is already true - if (this._accessibleOutputs.grid) { - return; - } else { - //make gridOutput true - this._accessibleOutputs.grid = true; - //create output for fallback - this._createOutput('gridOutput', 'Fallback'); - if (display === this.LABEL) { - //make gridOutput label true - this._accessibleOutputs.gridLabel = true; - //create output for label - this._createOutput('gridOutput', 'Label'); - } - } - }; - //helper function returns true when accessible outputs are true - _main.default.prototype._addAccsOutput = function () { - //if there are no accessible outputs create object with all false - if (!this._accessibleOutputs) { - this._accessibleOutputs = { - text: false, - grid: false, - textLabel: false, - gridLabel: false - }; - } - return this._accessibleOutputs.grid || this._accessibleOutputs.text; - }; - //helper function that creates html structure for accessible outputs - _main.default.prototype._createOutput = function (type, display) { - var cnvId = this.canvas.id; - //if there are no ingredients create object. this object stores data for the outputs - if (!this.ingredients) { - this.ingredients = { - shapes: { - }, - colors: { - background: 'white', - fill: 'white', - stroke: 'black' - }, - pShapes: '' - }; - } //if there is no dummyDOM create it - - if (!this.dummyDOM) { - this.dummyDOM = document.getElementById(cnvId).parentNode; - } - var cIdT, - container, - inner; - var query = ''; - if (display === 'Fallback') { - cIdT = cnvId + type; - container = cnvId + 'accessibleOutput'; - if (!this.dummyDOM.querySelector('#'.concat(container))) { - //if there is no canvas description (see describe() and describeElement()) - if (!this.dummyDOM.querySelector('#'.concat(cnvId, '_Description'))) { - //create html structure inside of canvas - this.dummyDOM.querySelector('#'.concat(cnvId)).innerHTML = '
            '); - } else { - //create html structure after canvas description container - this.dummyDOM.querySelector('#'.concat(cnvId, '_Description')).insertAdjacentHTML('afterend', '
            ')); - } - } - } else if (display === 'Label') { - query = display; - cIdT = cnvId + type + display; - container = cnvId + 'accessibleOutput' + display; - if (!this.dummyDOM.querySelector('#'.concat(container))) { - //if there is no canvas description label (see describe() and describeElement()) - if (!this.dummyDOM.querySelector('#'.concat(cnvId, '_Label'))) { - //create html structure adjacent to canvas - this.dummyDOM.querySelector('#'.concat(cnvId)).insertAdjacentHTML('afterend', '
            ')); - } else { - //create html structure after canvas label - this.dummyDOM.querySelector('#'.concat(cnvId, '_Label')).insertAdjacentHTML('afterend', '
            ')); - } - } - } //create an object to store the latest output. this object is used in _updateTextOutput() and _updateGridOutput() - - this._accessibleOutputs[cIdT] = { - }; - if (type === 'textOutput') { - query = '#'.concat(cnvId, 'gridOutput').concat(query); //query is used to check if gridOutput already exists - inner = '
            Text Output

              '); - //if gridOutput already exists - if (this.dummyDOM.querySelector(query)) { - //create textOutput before gridOutput - this.dummyDOM.querySelector(query).insertAdjacentHTML('beforebegin', inner); - } else { - //create output inside of container - this.dummyDOM.querySelector('#'.concat(container)).innerHTML = inner; - } //store output html elements - - this._accessibleOutputs[cIdT].list = this.dummyDOM.querySelector('#'.concat(cIdT, '_list')); - } else if (type === 'gridOutput') { - query = '#'.concat(cnvId, 'textOutput').concat(query); //query is used to check if textOutput already exists - inner = '
              Grid Output

                '); - //if textOutput already exists - if (this.dummyDOM.querySelector(query)) { - //create gridOutput after textOutput - this.dummyDOM.querySelector(query).insertAdjacentHTML('afterend', inner); - } else { - //create output inside of container - this.dummyDOM.querySelector('#'.concat(container)).innerHTML = inner; - } //store output html elements - - this._accessibleOutputs[cIdT].map = this.dummyDOM.querySelector('#'.concat(cIdT, '_map')); - } - this._accessibleOutputs[cIdT].shapeDetails = this.dummyDOM.querySelector('#'.concat(cIdT, '_shapeDetails')); - this._accessibleOutputs[cIdT].summary = this.dummyDOM.querySelector('#'.concat(cIdT, '_summary')); - }; - //this function is called at the end of setup and draw if using - //accessibleOutputs and calls update functions of outputs - _main.default.prototype._updateAccsOutput = function () { - var cnvId = this.canvas.id; - //if the shapes are not the same as before - if (JSON.stringify(this.ingredients.shapes) !== this.ingredients.pShapes) { - //save current shapes as string in pShapes - this.ingredients.pShapes = JSON.stringify(this.ingredients.shapes); - if (this._accessibleOutputs.text) { - this._updateTextOutput(cnvId + 'textOutput'); - } - if (this._accessibleOutputs.grid) { - this._updateGridOutput(cnvId + 'gridOutput'); - } - if (this._accessibleOutputs.textLabel) { - this._updateTextOutput(cnvId + 'textOutputLabel'); - } - if (this._accessibleOutputs.gridLabel) { - this._updateGridOutput(cnvId + 'gridOutputLabel'); - } - } - }; - //helper function that resets all ingredients when background is called - //and saves background color name - _main.default.prototype._accsBackground = function (args) { - //save current shapes as string in pShapes - this.ingredients.pShapes = JSON.stringify(this.ingredients.shapes); - //empty shapes JSON - this.ingredients.shapes = { - }; - //update background different - if (this.ingredients.colors.backgroundRGBA !== args) { - this.ingredients.colors.backgroundRGBA = args; - this.ingredients.colors.background = this._rgbColorName(args); - } - }; - //helper function that gets fill and stroke of shapes - _main.default.prototype._accsCanvasColors = function (f, args) { - if (f === 'fill') { - //update fill different - if (this.ingredients.colors.fillRGBA !== args) { - this.ingredients.colors.fillRGBA = args; - this.ingredients.colors.fill = this._rgbColorName(args); - } - } else if (f === 'stroke') { - //update stroke if different - if (this.ingredients.colors.strokeRGBA !== args) { - this.ingredients.colors.strokeRGBA = args; - this.ingredients.colors.stroke = this._rgbColorName(args); - } - } - }; - //builds ingredients.shapes used for building outputs - _main.default.prototype._accsOutput = function (f, args) { - if (f === 'ellipse' && args[2] === args[3]) { - f = 'circle'; - } else if (f === 'rectangle' && args[2] === args[3]) { - f = 'square'; - } - var include = { - }; - var add = true; - var middle = _getMiddle(f, args); - if (f === 'line') { - //make color stroke - include.color = this.ingredients.colors.stroke; - //get lenght - include.length = Math.round(this.dist(args[0], args[1], args[2], args[3])); - //get position of end points - var p1 = this._getPos(args[0], [ - 1 - ]); - var p2 = this._getPos(args[2], [ - 3 - ]); - include.loc = _canvasLocator(middle, this.width, this.height); - if (p1 === p2) { - include.pos = 'at '.concat(p1); - } else { - include.pos = 'from '.concat(p1, ' to ').concat(p2); - } - } else { - if (f === 'point') { - //make color stroke - include.color = this.ingredients.colors.stroke; - } else { - //make color fill - include.color = this.ingredients.colors.fill; - //get area of shape - include.area = this._getArea(f, args); - } //get middle of shapes - //calculate position using middle of shape - - include.pos = this._getPos.apply(this, _toConsumableArray(middle)); - //calculate location using middle of shape - include.loc = _canvasLocator(middle, this.width, this.height); - } //if it is the first time this shape is created - - if (!this.ingredients.shapes[f]) { - this.ingredients.shapes[f] = [ - include - ]; - //if other shapes of this type have been created - } else if (this.ingredients.shapes[f] !== [include]) { - //for every shape of this type - for (var y in this.ingredients.shapes[f]) { - //compare it with current shape and if it already exists make add false - if (JSON.stringify(this.ingredients.shapes[f][y]) === JSON.stringify(include)) { - add = false; - } - } //add shape by pushing it to the end - - if (add === true) { - this.ingredients.shapes[f].push(include); - } - } - }; - //gets middle point / centroid of shape - function _getMiddle(f, args) { - var x, - y; - if (f === 'rectangle' || f === 'ellipse' || f === 'arc' || f === 'circle' || f === 'square') { - x = Math.round(args[0] + args[2] / 2); - y = Math.round(args[1] + args[3] / 2); - } else if (f === 'triangle') { - x = (args[0] + args[2] + args[4]) / 3; - y = (args[1] + args[3] + args[5]) / 3; - } else if (f === 'quadrilateral') { - x = (args[0] + args[2] + args[4] + args[6]) / 4; - y = (args[1] + args[3] + args[5] + args[7]) / 4; - } else if (f === 'line') { - x = (args[0] + args[2]) / 2; - y = (args[1] + args[3]) / 2; - } else { - x = args[0]; - y = args[1]; - } - return [x, - y]; - } //gets position of shape in the canvas - - _main.default.prototype._getPos = function (x, y) { - var untransformedPosition = new DOMPointReadOnly(x, y); - var currentTransform = this._renderer.isP3D ? new DOMMatrix(this._renderer.uMVMatrix.mat4) : this.drawingContext.getTransform(); - var _untransformedPositio = untransformedPosition.matrixTransform(currentTransform), - transformedX = _untransformedPositio.x, - transformedY = _untransformedPositio.y; - var canvasWidth = this.width, - canvasHeight = this.height; - if (transformedX < 0.4 * canvasWidth) { - if (transformedY < 0.4 * canvasHeight) { - return 'top left'; - } else if (transformedY > 0.6 * canvasHeight) { - return 'bottom left'; - } else { - return 'mid left'; - } - } else if (transformedX > 0.6 * canvasWidth) { - if (transformedY < 0.4 * canvasHeight) { - return 'top right'; - } else if (transformedY > 0.6 * canvasHeight) { - return 'bottom right'; - } else { - return 'mid right'; - } - } else { - if (transformedY < 0.4 * canvasHeight) { - return 'top middle'; - } else if (transformedY > 0.6 * canvasHeight) { - return 'bottom middle'; - } else { - return 'middle'; - } - } - }; - //locates shape in a 10*10 grid - function _canvasLocator(args, canvasWidth, canvasHeight) { - var noRows = 10; - var noCols = 10; - var locX = Math.floor(args[0] / canvasWidth * noRows); - var locY = Math.floor(args[1] / canvasHeight * noCols); - if (locX === noRows) { - locX = locX - 1; - } - if (locY === noCols) { - locY = locY - 1; - } - return { - locX: locX, - locY: locY - }; - } //calculates area of shape - - _main.default.prototype._getArea = function (objectType, shapeArgs) { - var objectArea = 0; - if (objectType === 'arc') { - // area of full ellipse = PI * horizontal radius * vertical radius. - // therefore, area of arc = difference bet. arc's start and end radians * horizontal radius * vertical radius. - // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 - var arcSizeInRadians = ((shapeArgs[5] - shapeArgs[4]) % (Math.PI * 2) + Math.PI * 2) % (Math.PI * 2); - objectArea = arcSizeInRadians * shapeArgs[2] * shapeArgs[3] / 8; - if (shapeArgs[6] === 'open' || shapeArgs[6] === 'chord') { - // when the arc's mode is OPEN or CHORD, we need to account for the area of the triangle that is formed to close the arc - // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ) )/2 - var Ax = shapeArgs[0]; - var Ay = shapeArgs[1]; - var Bx = shapeArgs[0] + shapeArgs[2] / 2 * Math.cos(shapeArgs[4]).toFixed(2); - var By = shapeArgs[1] + shapeArgs[3] / 2 * Math.sin(shapeArgs[4]).toFixed(2); - var Cx = shapeArgs[0] + shapeArgs[2] / 2 * Math.cos(shapeArgs[5]).toFixed(2); - var Cy = shapeArgs[1] + shapeArgs[3] / 2 * Math.sin(shapeArgs[5]).toFixed(2); - var areaOfExtraTriangle = Math.abs(Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) / 2; - if (arcSizeInRadians > Math.PI) { - objectArea = objectArea + areaOfExtraTriangle; - } else { - objectArea = objectArea - areaOfExtraTriangle; - } - } - } else if (objectType === 'ellipse' || objectType === 'circle') { - objectArea = 3.14 * shapeArgs[2] / 2 * shapeArgs[3] / 2; - } else if (objectType === 'line') { - objectArea = 0; - } else if (objectType === 'point') { - objectArea = 0; - } else if (objectType === 'quadrilateral') { - // ((x4+x1)*(y4-y1)+(x1+x2)*(y1-y2)+(x2+x3)*(y2-y3)+(x3+x4)*(y3-y4))/2 - objectArea = Math.abs((shapeArgs[6] + shapeArgs[0]) * (shapeArgs[7] - shapeArgs[1]) + (shapeArgs[0] + shapeArgs[2]) * (shapeArgs[1] - shapeArgs[3]) + (shapeArgs[2] + shapeArgs[4]) * (shapeArgs[3] - shapeArgs[5]) + (shapeArgs[4] + shapeArgs[6]) * (shapeArgs[5] - shapeArgs[7])) / 2; - } else if (objectType === 'rectangle' || objectType === 'square') { - objectArea = shapeArgs[2] * shapeArgs[3]; - } else if (objectType === 'triangle') { - objectArea = Math.abs(shapeArgs[0] * (shapeArgs[3] - shapeArgs[5]) + shapeArgs[2] * (shapeArgs[5] - shapeArgs[1]) + shapeArgs[4] * (shapeArgs[1] - shapeArgs[3])) / 2; - // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ))/2 - } // Store the positions of the canvas corners - - var canvasWidth = this.width * this._pixelDensity; - var canvasHeight = this.height * this._pixelDensity; - var canvasCorners = [ - new DOMPoint(0, 0), - new DOMPoint(canvasWidth, 0), - new DOMPoint(canvasWidth, canvasHeight), - new DOMPoint(0, canvasHeight) - ]; - // Apply the inverse of the current transformations to the canvas corners - var currentTransform = this._renderer.isP3D ? new DOMMatrix(this._renderer.uMVMatrix.mat4) : this.drawingContext.getTransform(); - var invertedTransform = currentTransform.inverse(); - var tc = canvasCorners.map(function (corner) { - return corner.matrixTransform(invertedTransform); - }); - /* Use same shoelace formula used for quad area (above) to calculate - the area of the canvas with inverted transformation applied */ - var transformedCanvasArea = Math.abs((tc[3].x + tc[0].x) * (tc[3].y - tc[0].y) + (tc[0].x + tc[1].x) * (tc[0].y - tc[1].y) + (tc[1].x + tc[2].x) * (tc[1].y - tc[2].y) + (tc[2].x + tc[3].x) * (tc[2].y - tc[3].y)) / 2; - /* Compare area of shape (minus transformations) to area of canvas - with inverted transformation applied. - Return percentage */ - var untransformedArea = Math.round(objectArea * 100 / transformedCanvasArea); - return untransformedArea; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.number.to-fixed': 193, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 280: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.concat'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - //the functions in this file support updating the text output - //updates textOutput - - _main.default.prototype._updateTextOutput = function (idT) { - //if html structure is not there yet - if (!this.dummyDOM.querySelector('#'.concat(idT, '_summary'))) { - return; - } - var current = this._accessibleOutputs[idT]; - //create shape list - var innerList = _shapeList(idT, this.ingredients.shapes); - //create output summary - var innerSummary = _textSummary(innerList.numShapes, this.ingredients.colors.background, this.width, this.height); - //create shape details - var innerShapeDetails = _shapeDetails(idT, this.ingredients.shapes); - //if it is different from current summary - if (innerSummary !== current.summary.innerHTML) { - //update - current.summary.innerHTML = innerSummary; - } //if it is different from current shape list - - if (innerList.listShapes !== current.list.innerHTML) { - //update - current.list.innerHTML = innerList.listShapes; - } //if it is different from current shape details - - if (innerShapeDetails !== current.shapeDetails.innerHTML) { - //update - current.shapeDetails.innerHTML = innerShapeDetails; - } - this._accessibleOutputs[idT] = current; - }; - //Builds textOutput summary - function _textSummary(numShapes, background, width, height) { - var text = 'Your output is a, '.concat(width, ' by ').concat(height, ' pixels, ').concat(background, ' canvas containing the following'); - if (numShapes === 1) { - text = ''.concat(text, ' shape:'); - } else { - text = ''.concat(text, ' ').concat(numShapes, ' shapes:'); - } - return text; - } //Builds textOutput table with shape details - - function _shapeDetails(idT, ingredients) { - var shapeDetails = ''; - var shapeNumber = 0; - //goes trhough every shape type in ingredients - for (var x in ingredients) { - //and for every shape - for (var y in ingredients[x]) { - //it creates a table row - var row = '').concat(ingredients[x][y].color, ' ').concat(x, ''); - if (x === 'line') { - row = row + 'location = '.concat(ingredients[x][y].pos, 'length = ').concat(ingredients[x][y].length, ' pixels'); - } else { - row = row + 'location = '.concat(ingredients[x][y].pos, ''); - if (x !== 'point') { - row = row + ' area = '.concat(ingredients[x][y].area, '%'); - } - row = row + ''; - } - shapeDetails = shapeDetails + row; - shapeNumber++; - } - } - return shapeDetails; - } //Builds textOutput shape list - - function _shapeList(idT, ingredients) { - var shapeList = ''; - var shapeNumber = 0; - //goes trhough every shape type in ingredients - for (var x in ingredients) { - for (var y in ingredients[x]) { - //it creates a line in a list - var _line = '
              • ').concat(ingredients[x][y].color, ' ').concat(x, ''); - if (x === 'line') { - _line = _line + ', '.concat(ingredients[x][y].pos, ', ').concat(ingredients[x][y].length, ' pixels long.
              • '); - } else { - _line = _line + ', at '.concat(ingredients[x][y].pos); - if (x !== 'point') { - _line = _line + ', covering '.concat(ingredients[x][y].area, '% of the canvas'); - } - _line = _line + '.'; - } - shapeList = shapeList + _line; - shapeNumber++; - } - } - return { - numShapes: shapeNumber, - listShapes: shapeList - }; - } - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169 - } - ], - 281: [ - function (_dereq_, module, exports) { - 'use strict'; - var _main = _interopRequireDefault(_dereq_('./core/main')); - _dereq_('./core/constants'); - _dereq_('./core/environment'); - _dereq_('./core/friendly_errors/stacktrace'); - _dereq_('./core/friendly_errors/validate_params'); - _dereq_('./core/friendly_errors/file_errors'); - _dereq_('./core/friendly_errors/fes_core'); - _dereq_('./core/friendly_errors/sketch_reader'); - _dereq_('./core/helpers'); - _dereq_('./core/legacy'); - _dereq_('./core/preload'); - _dereq_('./core/p5.Element'); - _dereq_('./core/p5.Graphics'); - _dereq_('./core/p5.Renderer'); - _dereq_('./core/p5.Renderer2D'); - _dereq_('./core/rendering'); - _dereq_('./core/shim'); - _dereq_('./core/structure'); - _dereq_('./core/transform'); - _dereq_('./core/shape/2d_primitives'); - _dereq_('./core/shape/attributes'); - _dereq_('./core/shape/curves'); - _dereq_('./core/shape/vertex'); - _dereq_('./accessibility/outputs'); - _dereq_('./accessibility/textOutput'); - _dereq_('./accessibility/gridOutput'); - _dereq_('./accessibility/color_namer'); - _dereq_('./color/color_conversion'); - _dereq_('./color/creating_reading'); - _dereq_('./color/p5.Color'); - _dereq_('./color/setting'); - _dereq_('./data/p5.TypedDict'); - _dereq_('./data/local_storage.js'); - _dereq_('./dom/dom'); - _dereq_('./accessibility/describe'); - _dereq_('./events/acceleration'); - _dereq_('./events/keyboard'); - _dereq_('./events/mouse'); - _dereq_('./events/touch'); - _dereq_('./image/filters'); - _dereq_('./image/image'); - _dereq_('./image/loading_displaying'); - _dereq_('./image/p5.Image'); - _dereq_('./image/pixels'); - _dereq_('./io/files'); - _dereq_('./io/p5.Table'); - _dereq_('./io/p5.TableRow'); - _dereq_('./io/p5.XML'); - _dereq_('./math/calculation'); - _dereq_('./math/math'); - _dereq_('./math/noise'); - _dereq_('./math/p5.Vector'); - _dereq_('./math/random'); - _dereq_('./math/trigonometry'); - _dereq_('./typography/attributes'); - _dereq_('./typography/loading_displaying'); - _dereq_('./typography/p5.Font'); - _dereq_('./utilities/array_functions'); - _dereq_('./utilities/conversion'); - _dereq_('./utilities/string_functions'); - _dereq_('./utilities/time_date'); - _dereq_('./webgl/3d_primitives'); - _dereq_('./webgl/interaction'); - _dereq_('./webgl/light'); - _dereq_('./webgl/loading'); - _dereq_('./webgl/material'); - _dereq_('./webgl/p5.Camera'); - _dereq_('./webgl/p5.DataArray'); - _dereq_('./webgl/p5.Geometry'); - _dereq_('./webgl/p5.Matrix'); - _dereq_('./webgl/p5.RendererGL.Immediate'); - _dereq_('./webgl/p5.RendererGL'); - _dereq_('./webgl/p5.RendererGL.Retained'); - _dereq_('./webgl/p5.Framebuffer'); - _dereq_('./webgl/p5.Shader'); - _dereq_('./webgl/p5.RenderBuffer'); - _dereq_('./webgl/p5.Texture'); - _dereq_('./webgl/text'); - _dereq_('./core/init'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } // core - //accessibility - // color - // data - // DOM - // accessibility - // events - // image - // io - // math - // typography - // utilities - // webgl - - module.exports = _main.default; - }, - { - './accessibility/color_namer': 276, - './accessibility/describe': 277, - './accessibility/gridOutput': 278, - './accessibility/outputs': 279, - './accessibility/textOutput': 280, - './color/color_conversion': 282, - './color/creating_reading': 283, - './color/p5.Color': 284, - './color/setting': 285, - './core/constants': 286, - './core/environment': 287, - './core/friendly_errors/fes_core': 289, - './core/friendly_errors/file_errors': 290, - './core/friendly_errors/sketch_reader': 291, - './core/friendly_errors/stacktrace': 292, - './core/friendly_errors/validate_params': 293, - './core/helpers': 294, - './core/init': 295, - './core/legacy': 297, - './core/main': 298, - './core/p5.Element': 299, - './core/p5.Graphics': 300, - './core/p5.Renderer': 301, - './core/p5.Renderer2D': 302, - './core/preload': 303, - './core/rendering': 304, - './core/shape/2d_primitives': 305, - './core/shape/attributes': 306, - './core/shape/curves': 307, - './core/shape/vertex': 308, - './core/shim': 309, - './core/structure': 310, - './core/transform': 311, - './data/local_storage.js': 312, - './data/p5.TypedDict': 313, - './dom/dom': 314, - './events/acceleration': 315, - './events/keyboard': 316, - './events/mouse': 317, - './events/touch': 318, - './image/filters': 319, - './image/image': 320, - './image/loading_displaying': 321, - './image/p5.Image': 322, - './image/pixels': 323, - './io/files': 324, - './io/p5.Table': 325, - './io/p5.TableRow': 326, - './io/p5.XML': 327, - './math/calculation': 328, - './math/math': 329, - './math/noise': 330, - './math/p5.Vector': 331, - './math/random': 332, - './math/trigonometry': 333, - './typography/attributes': 334, - './typography/loading_displaying': 335, - './typography/p5.Font': 336, - './utilities/array_functions': 337, - './utilities/conversion': 338, - './utilities/string_functions': 339, - './utilities/time_date': 340, - './webgl/3d_primitives': 341, - './webgl/interaction': 343, - './webgl/light': 344, - './webgl/loading': 345, - './webgl/material': 346, - './webgl/p5.Camera': 347, - './webgl/p5.DataArray': 348, - './webgl/p5.Framebuffer': 349, - './webgl/p5.Geometry': 350, - './webgl/p5.Matrix': 351, - './webgl/p5.RenderBuffer': 352, - './webgl/p5.RendererGL': 355, - './webgl/p5.RendererGL.Immediate': 353, - './webgl/p5.RendererGL.Retained': 354, - './webgl/p5.Shader': 356, - './webgl/p5.Texture': 357, - './webgl/text': 358 - } - ], - 282: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Color - * @submodule Color Conversion - * @for p5 - * @requires core - */ - /** - * Conversions adapted from . - * - * In these functions, hue is always in the range [0, 1], just like all other - * components are in the range [0, 1]. 'Brightness' and 'value' are used - * interchangeably. - */ - - _main.default.ColorConversion = { - /** - * Convert an HSBA array to HSLA. - */ - _hsbaToHSLA: function _hsbaToHSLA(hsba) { - var hue = hsba[0]; - var sat = hsba[1]; - var val = hsba[2]; - // Calculate lightness. - var li = (2 - sat) * val / 2; - // Convert saturation. - if (li !== 0) { - if (li === 1) { - sat = 0; - } else if (li < 0.5) { - sat = sat / (2 - sat); - } else { - sat = sat * val / (2 - li * 2); - } - } // Hue and alpha stay the same. - - return [hue, - sat, - li, - hsba[3]]; - }, - /** - * Convert an HSBA array to RGBA. - */ - _hsbaToRGBA: function _hsbaToRGBA(hsba) { - var hue = hsba[0] * 6; // We will split hue into 6 sectors. - var sat = hsba[1]; - var val = hsba[2]; - var RGBA = [ - ]; - if (sat === 0) { - RGBA = [ - val, - val, - val, - hsba[3] - ]; // Return early if grayscale. - } else { - var sector = Math.floor(hue); - var tint1 = val * (1 - sat); - var tint2 = val * (1 - sat * (hue - sector)); - var tint3 = val * (1 - sat * (1 + sector - hue)); - var red, - green, - blue; - if (sector === 1) { - // Yellow to green. - red = tint2; - green = val; - blue = tint1; - } else if (sector === 2) { - // Green to cyan. - red = tint1; - green = val; - blue = tint3; - } else if (sector === 3) { - // Cyan to blue. - red = tint1; - green = tint2; - blue = val; - } else if (sector === 4) { - // Blue to magenta. - red = tint3; - green = tint1; - blue = val; - } else if (sector === 5) { - // Magenta to red. - red = val; - green = tint1; - blue = tint2; - } else { - // Red to yellow (sector could be 0 or 6). - red = val; - green = tint3; - blue = tint1; - } - RGBA = [ - red, - green, - blue, - hsba[3] - ]; - } - return RGBA; - }, - /** - * Convert an HSLA array to HSBA. - */ - _hslaToHSBA: function _hslaToHSBA(hsla) { - var hue = hsla[0]; - var sat = hsla[1]; - var li = hsla[2]; - // Calculate brightness. - var val; - if (li < 0.5) { - val = (1 + sat) * li; - } else { - val = li + sat - li * sat; - } // Convert saturation. - - sat = 2 * (val - li) / val; - // Hue and alpha stay the same. - return [hue, - sat, - val, - hsla[3]]; - }, - /** - * Convert an HSLA array to RGBA. - * - * We need to change basis from HSLA to something that can be more easily be - * projected onto RGBA. We will choose hue and brightness as our first two - * components, and pick a convenient third one ('zest') so that we don't need - * to calculate formal HSBA saturation. - */ - _hslaToRGBA: function _hslaToRGBA(hsla) { - var hue = hsla[0] * 6; // We will split hue into 6 sectors. - var sat = hsla[1]; - var li = hsla[2]; - var RGBA = [ - ]; - if (sat === 0) { - RGBA = [ - li, - li, - li, - hsla[3] - ]; // Return early if grayscale. - } else { - // Calculate brightness. - var val; - if (li < 0.5) { - val = (1 + sat) * li; - } else { - val = li + sat - li * sat; - } // Define zest. - - var zest = 2 * li - val; - // Implement projection (project onto green by default). - var hzvToRGB = function hzvToRGB(hue, zest, val) { - if (hue < 0) { - // Hue must wrap to allow projection onto red and blue. - hue += 6; - } else if (hue >= 6) { - hue -= 6; - } - if (hue < 1) { - // Red to yellow (increasing green). - return zest + (val - zest) * hue; - } else if (hue < 3) { - // Yellow to cyan (greatest green). - return val; - } else if (hue < 4) { - // Cyan to blue (decreasing green). - return zest + (val - zest) * (4 - hue); - } else { - // Blue to red (least green). - return zest; - } - }; - // Perform projections, offsetting hue as necessary. - RGBA = [ - hzvToRGB(hue + 2, zest, val), - hzvToRGB(hue, zest, val), - hzvToRGB(hue - 2, zest, val), - hsla[3] - ]; - } - return RGBA; - }, - /** - * Convert an RGBA array to HSBA. - */ - _rgbaToHSBA: function _rgbaToHSBA(rgba) { - var red = rgba[0]; - var green = rgba[1]; - var blue = rgba[2]; - var val = Math.max(red, green, blue); - var chroma = val - Math.min(red, green, blue); - var hue, - sat; - if (chroma === 0) { - // Return early if grayscale. - hue = 0; - sat = 0; - } else { - sat = chroma / val; - if (red === val) { - // Magenta to yellow. - hue = (green - blue) / chroma; - } else if (green === val) { - // Yellow to cyan. - hue = 2 + (blue - red) / chroma; - } else if (blue === val) { - // Cyan to magenta. - hue = 4 + (red - green) / chroma; - } - if (hue < 0) { - // Confine hue to the interval [0, 1). - hue += 6; - } else if (hue >= 6) { - hue -= 6; - } - } - return [hue / 6, - sat, - val, - rgba[3]]; - }, - /** - * Convert an RGBA array to HSLA. - */ - _rgbaToHSLA: function _rgbaToHSLA(rgba) { - var red = rgba[0]; - var green = rgba[1]; - var blue = rgba[2]; - var val = Math.max(red, green, blue); - var min = Math.min(red, green, blue); - var li = val + min; // We will halve this later. - var chroma = val - min; - var hue, - sat; - if (chroma === 0) { - // Return early if grayscale. - hue = 0; - sat = 0; - } else { - if (li < 1) { - sat = chroma / li; - } else { - sat = chroma / (2 - li); - } - if (red === val) { - // Magenta to yellow. - hue = (green - blue) / chroma; - } else if (green === val) { - // Yellow to cyan. - hue = 2 + (blue - red) / chroma; - } else if (blue === val) { - // Cyan to magenta. - hue = 4 + (red - green) / chroma; - } - if (hue < 0) { - // Confine hue to the interval [0, 1). - hue += 6; - } else if (hue >= 6) { - hue -= 6; - } - } - return [hue / 6, - sat, - li / 2, - rgba[3]]; - } - }; - var _default = _main.default.ColorConversion; - exports.default = _default; - }, - { - '../core/main': 298 - } - ], - 283: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.map'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - _dereq_('./p5.Color'); - _dereq_('../core/friendly_errors/validate_params'); - _dereq_('../core/friendly_errors/file_errors'); - _dereq_('../core/friendly_errors/fes_core'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Color - * @submodule Creating & Reading - * @for p5 - * @requires core - * @requires constants - */ - /** - * Extracts the alpha (transparency) value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method alpha - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the alpha value. - * - * @example - *
                - * - * noStroke(); - * const c = color(0, 126, 255, 102); - * fill(c); - * rect(15, 15, 35, 70); - * // Sets 'alphaValue' to 102. - * const alphaValue = alpha(c); - * fill(alphaValue); - * rect(50, 15, 35, 70); - * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.'); - * - *
                - */ - - _main.default.prototype.alpha = function (c) { - _main.default._validateParameters('alpha', arguments); - return this.color(c)._getAlpha(); - }; - /** - * Extracts the blue value from a p5.Color object, - * array of color components, or CSS color string. - * - * @method blue - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the blue value. - * @example - *
                - * - * const c = color(175, 100, 220); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'blueValue' to 220. - * const blueValue = blue(c); - * fill(0, 0, blueValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The left one is light purple and the right one is royal blue.'); - * - *
                - * - */ - _main.default.prototype.blue = function (c) { - _main.default._validateParameters('blue', arguments); - return this.color(c)._getBlue(); - }; - /** - * Extracts the HSB brightness value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method brightness - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the brightness value. - * - * @example - *
                - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color(0, 126, 255); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'brightValue' to 255. - * const brightValue = brightness(c); - * fill(brightValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The left one is salmon pink and the right one is white.'); - * - *
                - * - *
                - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color('hsb(60, 100%, 50%)'); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'brightValue' to 127.5 (50% of 255) - * const brightValue = brightness(c); - * fill(brightValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The left one is olive and the right one is gray.'); - * - *
                - */ - _main.default.prototype.brightness = function (c) { - _main.default._validateParameters('brightness', arguments); - return this.color(c)._getBrightness(); - }; - /** - * Creates a p5.Color object. By default, the - * parameters are interpreted as RGB values. Calling `color(255, 204, 0)` will - * return a bright yellow color. The way these parameters are interpreted may - * be changed with the colorMode() function. - * - * The version of `color()` with one parameter interprets the value one of two - * ways. If the parameter is a number, it's interpreted as a grayscale value. - * If the parameter is a string, it's interpreted as a CSS color string. - * - * The version of `color()` with two parameters interprets the first one as a - * grayscale value. The second parameter sets the alpha (transparency) value. - * - * The version of `color()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current `colorMode()`. - * - * The version of `color()` with four parameters interprets them as RGBA, HSBA, - * or HSLA colors, depending on the current `colorMode()`. The last parameter - * sets the alpha (transparency) value. - * - * @method color - * @param {Number} gray number specifying value between white and black. - * @param {Number} [alpha] alpha value relative to current color range - * (default is 0-255). - * @return {p5.Color} resulting color. - * - * @example - *
                - * - * const c = color(255, 204, 0); - * fill(c); - * noStroke(); - * rect(30, 20, 55, 55); - * describe('A yellow rectangle on a gray canvas.'); - * - *
                - * - *
                - * - * // RGB values. - * let c = color(255, 204, 0); - * fill(c); - * noStroke(); - * circle(25, 25, 80); - * // A grayscale value. - * c = color(65); - * fill(c); - * circle(75, 75, 80); - * describe( - * 'Two ellipses. The circle in the top-left corner is yellow and the one at the bottom-right is gray.' - * ); - * - *
                - * - *
                - * - * // A CSS named color. - * const c = color('magenta'); - * fill(c); - * noStroke(); - * square(20, 20, 60); - * describe('A magenta square on a gray canvas.'); - * - *
                - * - *
                - * - * // CSS hex color codes. - * noStroke(); - * let c = color('#0f0'); - * fill(c); - * rect(0, 10, 45, 80); - * c = color('#00ff00'); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two bright green rectangles on a gray canvas.'); - * - *
                - * - *
                - * - * // RGB and RGBA color strings. - * noStroke(); - * let c = color('rgb(0,0,255)'); - * fill(c); - * square(10, 10, 35); - * c = color('rgb(0%, 0%, 100%)'); - * fill(c); - * square(55, 10, 35); - * c = color('rgba(0, 0, 255, 1)'); - * fill(c); - * square(10, 55, 35); - * c = color('rgba(0%, 0%, 100%, 1)'); - * fill(c); - * square(55, 55, 35); - * describe('Four blue squares in corners of a gray canvas.'); - * - *
                - * - *
                - * - * // HSL and HSLA color strings. - * let c = color('hsl(160, 100%, 50%)'); - * noStroke(); - * fill(c); - * rect(0, 10, 45, 80); - * c = color('hsla(160, 100%, 50%, 0.5)'); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two sea green rectangles. A darker rectangle on the left and a brighter one on the right.'); - * - *
                - * - *
                - * - * // HSB and HSBA color strings. - * let c = color('hsb(160, 100%, 50%)'); - * noStroke(); - * fill(c); - * rect(0, 10, 45, 80); - * c = color('hsba(160, 100%, 50%, 0.5)'); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two green rectangles. A darker rectangle on the left and a brighter one on the right.'); - * - *
                - * - *
                - * - * // Changing color modes. - * noStroke(); - * let c = color(50, 55, 100); - * fill(c); - * rect(0, 10, 45, 80); - * colorMode(HSB, 100); - * c = color(50, 55, 100); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two blue rectangles. A darker rectangle on the left and a brighter one on the right.'); - * - *
                - */ - /** - * @method color - * @param {Number} v1 red or hue value relative to - * the current color range. - * @param {Number} v2 green or saturation value - * relative to the current color range. - * @param {Number} v3 blue or brightness value - * relative to the current color range. - * @param {Number} [alpha] - * @return {p5.Color} - */ - /** - * @method color - * @param {String} value a color string. - * @return {p5.Color} - */ - /** - * @method color - * @param {Number[]} values an array containing the red, green, blue, - * and alpha components of the color. - * @return {p5.Color} - */ - /** - * @method color - * @param {p5.Color} color - * @return {p5.Color} - */ - _main.default.prototype.color = function () { - _main.default._validateParameters('color', arguments); - if (arguments[0] instanceof _main.default.Color) { - return arguments[0]; // Do nothing if argument is already a color object. - } - var args = arguments[0] instanceof Array ? arguments[0] : arguments; - return new _main.default.Color(this, args); - }; - /** - * Extracts the green value from a p5.Color object, - * array of color components, or CSS color string. - * - * @method green - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the green value. - * @example - *
                - * - * const c = color(20, 75, 200); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'greenValue' to 75. - * const greenValue = green(c); - * fill(0, greenValue, 0); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The rectangle on the left is blue and the one on the right is green.'); - * - *
                - */ - _main.default.prototype.green = function (c) { - _main.default._validateParameters('green', arguments); - return this.color(c)._getGreen(); - }; - /** - * Extracts the hue value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * Hue exists in both HSB and HSL. It describes a color's position on the - * color wheel. By default, this function returns the HSL-normalized hue. If - * the colorMode() is set to HSB, it returns the - * HSB-normalized hue. - * - * @method hue - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the hue - * @example - *
                - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color(0, 126, 255); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'hueValue' to 0. - * const hueValue = hue(c); - * fill(hueValue); - * rect(50, 20, 35, 60); - * describe( - * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.' - * ); - * - *
                - * - */ - _main.default.prototype.hue = function (c) { - _main.default._validateParameters('hue', arguments); - return this.color(c)._getHue(); - }; - /** - * Blends two colors to find a third color between them. The `amt` parameter - * specifies the amount to interpolate between the two values. 0 is equal to - * the first color, 0.1 is very near the first color, 0.5 is halfway between - * the two colors, and so on. Negative numbers are set to 0. Numbers greater - * than 1 are set to 1. This differs from the behavior of - * lerp. It's necessary because numbers outside of the - * interval [0, 1] will produce strange and unexpected colors. - * - * The way that colors are interpolated depends on the current - * colorMode(). - * - * @method lerpColor - * @param {p5.Color} c1 interpolate from this color. - * @param {p5.Color} c2 interpolate to this color. - * @param {Number} amt number between 0 and 1. - * @return {p5.Color} interpolated color. - * - * @example - *
                - * - * colorMode(RGB); - * stroke(255); - * background(51); - * const from = color(218, 165, 32); - * const to = color(72, 61, 139); - * colorMode(RGB); - * const interA = lerpColor(from, to, 0.33); - * const interB = lerpColor(from, to, 0.66); - * fill(from); - * rect(10, 20, 20, 60); - * fill(interA); - * rect(30, 20, 20, 60); - * fill(interB); - * rect(50, 20, 20, 60); - * fill(to); - * rect(70, 20, 20, 60); - * describe( - * 'Four rectangles with white edges. From left to right, the rectangles are tan, brown, brownish purple, and purple.' - * ); - * - *
                - */ - _main.default.prototype.lerpColor = function (c1, c2, amt) { - _main.default._validateParameters('lerpColor', arguments); - var mode = this._colorMode; - var maxes = this._colorMaxes; - var l0, - l1, - l2, - l3; - var fromArray, - toArray; - if (mode === constants.RGB) { - fromArray = c1.levels.map(function (level) { - return level / 255; - }); - toArray = c2.levels.map(function (level) { - return level / 255; - }); - } else if (mode === constants.HSB) { - c1._getBrightness(); // Cache hsba so it definitely exists. - c2._getBrightness(); - fromArray = c1.hsba; - toArray = c2.hsba; - } else if (mode === constants.HSL) { - c1._getLightness(); // Cache hsla so it definitely exists. - c2._getLightness(); - fromArray = c1.hsla; - toArray = c2.hsla; - } else { - throw new Error(''.concat(mode, 'cannot be used for interpolation.')); - } // Prevent extrapolation. - - amt = Math.max(Math.min(amt, 1), 0); - // Define lerp here itself if user isn't using math module. - // Maintains the definition as found in math/calculation.js - if (typeof this.lerp === 'undefined') { - this.lerp = function (start, stop, amt) { - return amt * (stop - start) + start; - }; - } // Perform interpolation. - - l0 = this.lerp(fromArray[0], toArray[0], amt); - l1 = this.lerp(fromArray[1], toArray[1], amt); - l2 = this.lerp(fromArray[2], toArray[2], amt); - l3 = this.lerp(fromArray[3], toArray[3], amt); - // Scale components. - l0 *= maxes[mode][0]; - l1 *= maxes[mode][1]; - l2 *= maxes[mode][2]; - l3 *= maxes[mode][3]; - return this.color(l0, l1, l2, l3); - }; - /** - * Extracts the HSL lightness value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method lightness - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the lightness - * - * @example - *
                - * - * noStroke(); - * colorMode(HSL); - * const c = color(156, 100, 50, 1); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'lightValue' to 50. - * const lightValue = lightness(c); - * fill(lightValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The rectangle on the left is light green and the one on the right is gray.'); - * - *
                - */ - _main.default.prototype.lightness = function (c) { - _main.default._validateParameters('lightness', arguments); - return this.color(c)._getLightness(); - }; - /** - * Extracts the red value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method red - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the red value. - * @example - *
                - * - * const c = color(255, 204, 0); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'redValue' to 255. - * const redValue = red(c); - * fill(redValue, 0, 0); - * rect(50, 20, 35, 60); - * describe( - * 'Two rectangles with black edges. The rectangle on the left is yellow and the one on the right is red.' - * ); - * - *
                - */ - _main.default.prototype.red = function (c) { - _main.default._validateParameters('red', arguments); - return this.color(c)._getRed(); - }; - /** - * Extracts the saturation value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * Saturation is scaled differently in HSB and HSL. By default, this function - * returns the HSL saturation. If the colorMode() - * is set to HSB, it returns the HSB saturation. - * - * @method saturation - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the saturation value - * @example - *
                - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color(0, 126, 255); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'satValue' to 126. - * const satValue = saturation(c); - * fill(satValue); - * rect(50, 20, 35, 60); - * describe( - * 'Two rectangles. The rectangle on the left is deep pink and the one on the right is gray.' - * ); - * - *
                - */ - _main.default.prototype.saturation = function (c) { - _main.default._validateParameters('saturation', arguments); - return this.color(c)._getSaturation(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/friendly_errors/fes_core': 289, - '../core/friendly_errors/file_errors': 290, - '../core/friendly_errors/validate_params': 293, - '../core/main': 298, - './p5.Color': 284, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 284: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.trim'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - var _color_conversion = _interopRequireDefault(_dereq_('./color_conversion')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Color - * @submodule Creating & Reading - * @for p5 - * @requires core - * @requires constants - * @requires color_conversion - */ - /** - * CSS named colors. - */ - - var namedColors = { - aliceblue: '#f0f8ff', - antiquewhite: '#faebd7', - aqua: '#00ffff', - aquamarine: '#7fffd4', - azure: '#f0ffff', - beige: '#f5f5dc', - bisque: '#ffe4c4', - black: '#000000', - blanchedalmond: '#ffebcd', - blue: '#0000ff', - blueviolet: '#8a2be2', - brown: '#a52a2a', - burlywood: '#deb887', - cadetblue: '#5f9ea0', - chartreuse: '#7fff00', - chocolate: '#d2691e', - coral: '#ff7f50', - cornflowerblue: '#6495ed', - cornsilk: '#fff8dc', - crimson: '#dc143c', - cyan: '#00ffff', - darkblue: '#00008b', - darkcyan: '#008b8b', - darkgoldenrod: '#b8860b', - darkgray: '#a9a9a9', - darkgreen: '#006400', - darkgrey: '#a9a9a9', - darkkhaki: '#bdb76b', - darkmagenta: '#8b008b', - darkolivegreen: '#556b2f', - darkorange: '#ff8c00', - darkorchid: '#9932cc', - darkred: '#8b0000', - darksalmon: '#e9967a', - darkseagreen: '#8fbc8f', - darkslateblue: '#483d8b', - darkslategray: '#2f4f4f', - darkslategrey: '#2f4f4f', - darkturquoise: '#00ced1', - darkviolet: '#9400d3', - deeppink: '#ff1493', - deepskyblue: '#00bfff', - dimgray: '#696969', - dimgrey: '#696969', - dodgerblue: '#1e90ff', - firebrick: '#b22222', - floralwhite: '#fffaf0', - forestgreen: '#228b22', - fuchsia: '#ff00ff', - gainsboro: '#dcdcdc', - ghostwhite: '#f8f8ff', - gold: '#ffd700', - goldenrod: '#daa520', - gray: '#808080', - green: '#008000', - greenyellow: '#adff2f', - grey: '#808080', - honeydew: '#f0fff0', - hotpink: '#ff69b4', - indianred: '#cd5c5c', - indigo: '#4b0082', - ivory: '#fffff0', - khaki: '#f0e68c', - lavender: '#e6e6fa', - lavenderblush: '#fff0f5', - lawngreen: '#7cfc00', - lemonchiffon: '#fffacd', - lightblue: '#add8e6', - lightcoral: '#f08080', - lightcyan: '#e0ffff', - lightgoldenrodyellow: '#fafad2', - lightgray: '#d3d3d3', - lightgreen: '#90ee90', - lightgrey: '#d3d3d3', - lightpink: '#ffb6c1', - lightsalmon: '#ffa07a', - lightseagreen: '#20b2aa', - lightskyblue: '#87cefa', - lightslategray: '#778899', - lightslategrey: '#778899', - lightsteelblue: '#b0c4de', - lightyellow: '#ffffe0', - lime: '#00ff00', - limegreen: '#32cd32', - linen: '#faf0e6', - magenta: '#ff00ff', - maroon: '#800000', - mediumaquamarine: '#66cdaa', - mediumblue: '#0000cd', - mediumorchid: '#ba55d3', - mediumpurple: '#9370db', - mediumseagreen: '#3cb371', - mediumslateblue: '#7b68ee', - mediumspringgreen: '#00fa9a', - mediumturquoise: '#48d1cc', - mediumvioletred: '#c71585', - midnightblue: '#191970', - mintcream: '#f5fffa', - mistyrose: '#ffe4e1', - moccasin: '#ffe4b5', - navajowhite: '#ffdead', - navy: '#000080', - oldlace: '#fdf5e6', - olive: '#808000', - olivedrab: '#6b8e23', - orange: '#ffa500', - orangered: '#ff4500', - orchid: '#da70d6', - palegoldenrod: '#eee8aa', - palegreen: '#98fb98', - paleturquoise: '#afeeee', - palevioletred: '#db7093', - papayawhip: '#ffefd5', - peachpuff: '#ffdab9', - peru: '#cd853f', - pink: '#ffc0cb', - plum: '#dda0dd', - powderblue: '#b0e0e6', - purple: '#800080', - rebeccapurple: '#663399', - red: '#ff0000', - rosybrown: '#bc8f8f', - royalblue: '#4169e1', - saddlebrown: '#8b4513', - salmon: '#fa8072', - sandybrown: '#f4a460', - seagreen: '#2e8b57', - seashell: '#fff5ee', - sienna: '#a0522d', - silver: '#c0c0c0', - skyblue: '#87ceeb', - slateblue: '#6a5acd', - slategray: '#708090', - slategrey: '#708090', - snow: '#fffafa', - springgreen: '#00ff7f', - steelblue: '#4682b4', - tan: '#d2b48c', - teal: '#008080', - thistle: '#d8bfd8', - tomato: '#ff6347', - turquoise: '#40e0d0', - violet: '#ee82ee', - wheat: '#f5deb3', - white: '#ffffff', - whitesmoke: '#f5f5f5', - yellow: '#ffff00', - yellowgreen: '#9acd32' - }; - /** - * These regular expressions are used to build up the patterns for matching - * viable CSS color strings: fragmenting the regexes in this way increases the - * legibility and comprehensibility of the code. - * - * Note that RGB values of .9 are not parsed by IE, but are supported here for - * color string consistency. - */ - var WHITESPACE = /\s*/; // Match zero or more whitespace characters. - var INTEGER = /(\d{1,3})/; // Match integers: 79, 255, etc. - var DECIMAL = /((?:\d+(?:\.\d+)?)|(?:\.\d+))/; // Match 129.6, 79, .9, etc. - var PERCENT = new RegExp(''.concat(DECIMAL.source, '%')); // Match 12.9%, 79%, .9%, etc. - /** - * Full color string patterns. The capture groups are necessary. - */ - var colorPatterns = { - // Match colors in format #XXX, e.g. #416. - HEX3: /^#([a-f0-9])([a-f0-9])([a-f0-9])$/i, - // Match colors in format #XXXX, e.g. #5123. - HEX4: /^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i, - // Match colors in format #XXXXXX, e.g. #b4d455. - HEX6: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, - // Match colors in format #XXXXXXXX, e.g. #b4d45535. - HEX8: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, - // Match colors in format rgb(R, G, B), e.g. rgb(255, 0, 128). - RGB: new RegExp(['^rgb\\(', - INTEGER.source, - ',', - INTEGER.source, - ',', - INTEGER.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format rgb(R%, G%, B%), e.g. rgb(100%, 0%, 28.9%). - RGB_PERCENT: new RegExp(['^rgb\\(', - PERCENT.source, - ',', - PERCENT.source, - ',', - PERCENT.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format rgb(R, G, B, A), e.g. rgb(255, 0, 128, 0.25). - RGBA: new RegExp(['^rgba\\(', - INTEGER.source, - ',', - INTEGER.source, - ',', - INTEGER.source, - ',', - DECIMAL.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format rgb(R%, G%, B%, A), e.g. rgb(100%, 0%, 28.9%, 0.5). - RGBA_PERCENT: new RegExp(['^rgba\\(', - PERCENT.source, - ',', - PERCENT.source, - ',', - PERCENT.source, - ',', - DECIMAL.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format hsla(H, S%, L%), e.g. hsl(100, 40%, 28.9%). - HSL: new RegExp(['^hsl\\(', - INTEGER.source, - ',', - PERCENT.source, - ',', - PERCENT.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format hsla(H, S%, L%, A), e.g. hsla(100, 40%, 28.9%, 0.5). - HSLA: new RegExp(['^hsla\\(', - INTEGER.source, - ',', - PERCENT.source, - ',', - PERCENT.source, - ',', - DECIMAL.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format hsb(H, S%, B%), e.g. hsb(100, 40%, 28.9%). - HSB: new RegExp(['^hsb\\(', - INTEGER.source, - ',', - PERCENT.source, - ',', - PERCENT.source, - '\\)$'].join(WHITESPACE.source), 'i'), - // Match colors in format hsba(H, S%, B%, A), e.g. hsba(100, 40%, 28.9%, 0.5). - HSBA: new RegExp(['^hsba\\(', - INTEGER.source, - ',', - PERCENT.source, - ',', - PERCENT.source, - ',', - DECIMAL.source, - '\\)$'].join(WHITESPACE.source), 'i') - }; - /** - * A class to describe a color. Each `p5.Color` object stores the color mode - * and level maxes that were active during its construction. These values are - * used to interpret the arguments passed to the object's constructor. They - * also determine output formatting such as when - * saturation() is called. - * - * Color is stored internally as an array of ideal RGBA values in floating - * point form, normalized from 0 to 1. These values are used to calculate the - * closest screen colors, which are RGBA levels from 0 to 255. Screen colors - * are sent to the renderer. - * - * When different color representations are calculated, the results are cached - * for performance. These values are normalized, floating-point numbers. - * - * color() is the recommended way to create an instance - * of this class. - * - * @class p5.Color - * @constructor - * @param {p5} [pInst] pointer to p5 instance. - * - * @param {Number[]|String} vals an array containing the color values - * for red, green, blue and alpha channel - * or CSS color. - */ - _main.default.Color = /*#__PURE__*/ function () { - function Color(pInst, vals) { - _classCallCheck(this, Color); - // Record color mode and maxes at time of construction. - this._storeModeAndMaxes(pInst._colorMode, pInst._colorMaxes); - // Calculate normalized RGBA values. - if (![constants.RGB, - constants.HSL, - constants.HSB].includes(this.mode)) { - throw new Error(''.concat(this.mode, ' is an invalid colorMode.')); - } else { - this._array = Color._parseInputs.apply(this, vals); - } // Expose closest screen color. - - this._calculateLevels(); - } /** - * Returns the color formatted as a string. Doing so can be useful for - * debugging, or for using p5.js with other libraries. - * - * @method toString - * @param {String} [format] how the color string will be formatted. - * Leaving this empty formats the string as rgba(r, g, b, a). - * '#rgb' '#rgba' '#rrggbb' and '#rrggbbaa' format as hexadecimal color codes. - * 'rgb' 'hsb' and 'hsl' return the color formatted in the specified color mode. - * 'rgba' 'hsba' and 'hsla' are the same as above but with alpha channels. - * 'rgb%' 'hsb%' 'hsl%' 'rgba%' 'hsba%' and 'hsla%' format as percentages. - * @return {String} the formatted string. - * - * @example - *
                - * - * createCanvas(200, 100); - * stroke(255); - * const myColor = color(100, 100, 250); - * fill(myColor); - * rotate(HALF_PI); - * text(myColor.toString(), 0, -5); - * text(myColor.toString('#rrggbb'), 0, -30); - * text(myColor.toString('rgba%'), 0, -55); - * describe('Three text representation of a color written sideways.'); - * - *
                - * - *
                - * - * const myColor = color(100, 130, 250); - * text(myColor.toString('#rrggbb'), 25, 25); - * describe('A hexadecimal representation of a color.'); - * - *
                - */ - - _createClass(Color, [ - { - key: 'toString', - value: function toString(format) { - var a = this.levels; - var f = this._array; - var alpha = f[3]; // String representation uses normalized alpha - switch (format) { - case '#rrggbb': - return '#'.concat(a[0] < 16 ? '0'.concat(a[0].toString(16)) : a[0].toString(16), a[1] < 16 ? '0'.concat(a[1].toString(16)) : a[1].toString(16), a[2] < 16 ? '0'.concat(a[2].toString(16)) : a[2].toString(16)); - case '#rrggbbaa': - return '#'.concat(a[0] < 16 ? '0'.concat(a[0].toString(16)) : a[0].toString(16), a[1] < 16 ? '0'.concat(a[1].toString(16)) : a[1].toString(16), a[2] < 16 ? '0'.concat(a[2].toString(16)) : a[2].toString(16), a[3] < 16 ? '0'.concat(a[3].toString(16)) : a[3].toString(16)); - case '#rgb': - return '#'.concat(Math.round(f[0] * 15).toString(16), Math.round(f[1] * 15).toString(16), Math.round(f[2] * 15).toString(16)); - case '#rgba': - return '#'.concat(Math.round(f[0] * 15).toString(16), Math.round(f[1] * 15).toString(16), Math.round(f[2] * 15).toString(16), Math.round(f[3] * 15).toString(16)); - case 'rgb': - return 'rgb('.concat(a[0], ', ', a[1], ', ', a[2], ')'); - case 'rgb%': - return 'rgb('.concat((100 * f[0]).toPrecision(3), '%, ', (100 * f[1]).toPrecision(3), '%, ', (100 * f[2]).toPrecision(3), '%)'); - case 'rgba%': - return 'rgba('.concat((100 * f[0]).toPrecision(3), '%, ', (100 * f[1]).toPrecision(3), '%, ', (100 * f[2]).toPrecision(3), '%, ', (100 * f[3]).toPrecision(3), '%)'); - case 'hsb': - case 'hsv': - if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - return 'hsb('.concat(this.hsba[0] * this.maxes[constants.HSB][0], ', ', this.hsba[1] * this.maxes[constants.HSB][1], ', ', this.hsba[2] * this.maxes[constants.HSB][2], ')'); - case 'hsb%': - case 'hsv%': - if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - return 'hsb('.concat((100 * this.hsba[0]).toPrecision(3), '%, ', (100 * this.hsba[1]).toPrecision(3), '%, ', (100 * this.hsba[2]).toPrecision(3), '%)'); - case 'hsba': - case 'hsva': - if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - return 'hsba('.concat(this.hsba[0] * this.maxes[constants.HSB][0], ', ', this.hsba[1] * this.maxes[constants.HSB][1], ', ', this.hsba[2] * this.maxes[constants.HSB][2], ', ', alpha, ')'); - case 'hsba%': - case 'hsva%': - if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - return 'hsba('.concat((100 * this.hsba[0]).toPrecision(3), '%, ', (100 * this.hsba[1]).toPrecision(3), '%, ', (100 * this.hsba[2]).toPrecision(3), '%, ', (100 * alpha).toPrecision(3), '%)'); - case 'hsl': - if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - return 'hsl('.concat(this.hsla[0] * this.maxes[constants.HSL][0], ', ', this.hsla[1] * this.maxes[constants.HSL][1], ', ', this.hsla[2] * this.maxes[constants.HSL][2], ')'); - case 'hsl%': - if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - return 'hsl('.concat((100 * this.hsla[0]).toPrecision(3), '%, ', (100 * this.hsla[1]).toPrecision(3), '%, ', (100 * this.hsla[2]).toPrecision(3), '%)'); - case 'hsla': - if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - return 'hsla('.concat(this.hsla[0] * this.maxes[constants.HSL][0], ', ', this.hsla[1] * this.maxes[constants.HSL][1], ', ', this.hsla[2] * this.maxes[constants.HSL][2], ', ', alpha, ')'); - case 'hsla%': - if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - return 'hsl('.concat((100 * this.hsla[0]).toPrecision(3), '%, ', (100 * this.hsla[1]).toPrecision(3), '%, ', (100 * this.hsla[2]).toPrecision(3), '%, ', (100 * alpha).toPrecision(3), '%)'); - case 'rgba': - default: - return 'rgba('.concat(a[0], ',', a[1], ',', a[2], ',', alpha, ')'); - } - } /** - * Sets the red component of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setRed - * @param {Number} red the new red value. - * - * @example - *
                - * - * let backgroundColor; - * - * function setup() { - * backgroundColor = color(100, 50, 150); - * } - * - * function draw() { - * backgroundColor.setRed(128 + 128 * sin(millis() / 1000)); - * background(backgroundColor); - * describe('A canvas with a gradually changing background color.'); - * } - * - *
                - */ - - }, - { - key: 'setRed', - value: function setRed(new_red) { - this._array[0] = new_red / this.maxes[constants.RGB][0]; - this._calculateLevels(); - } /** - * Sets the green component of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setGreen - * @param {Number} green the new green value. - * - * @example - *
                - * - * let backgroundColor; - * - * function setup() { - * backgroundColor = color(100, 50, 150); - * } - * - * function draw() { - * backgroundColor.setGreen(128 + 128 * sin(millis() / 1000)); - * background(backgroundColor); - * describe('A canvas with a gradually changing background color.'); - * } - * - *
                - **/ - - }, - { - key: 'setGreen', - value: function setGreen(new_green) { - this._array[1] = new_green / this.maxes[constants.RGB][1]; - this._calculateLevels(); - } /** - * Sets the blue component of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setBlue - * @param {Number} blue the new blue value. - * - * @example - *
                - * - * let backgroundColor; - * - * function setup() { - * backgroundColor = color(100, 50, 150); - * } - * - * function draw() { - * backgroundColor.setBlue(128 + 128 * sin(millis() / 1000)); - * background(backgroundColor); - * describe('A canvas with a gradually changing background color.'); - * } - * - *
                - **/ - - }, - { - key: 'setBlue', - value: function setBlue(new_blue) { - this._array[2] = new_blue / this.maxes[constants.RGB][2]; - this._calculateLevels(); - } /** - * Sets the alpha (transparency) value of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setAlpha - * @param {Number} alpha the new alpha value. - * - * @example - *
                - * - * function draw() { - * clear(); - * background(200); - * const squareColor = color(100, 50, 100); - * squareColor.setAlpha(128 + 128 * sin(millis() / 1000)); - * fill(squareColor); - * rect(13, 13, width - 26, height - 26); - * describe( - * 'A purple square with gradually changing opacity drawn on a gray background.' - * ); - * } - * - *
                - **/ - - }, - { - key: 'setAlpha', - value: function setAlpha(new_alpha) { - this._array[3] = new_alpha / this.maxes[this.mode][3]; - this._calculateLevels(); - } // calculates and stores the closest screen levels - - }, - { - key: '_calculateLevels', - value: function _calculateLevels() { - var array = this._array; - // (loop backwards for performance) - var levels = this.levels = new Array(array.length); - for (var i = array.length - 1; i >= 0; --i) { - levels[i] = Math.round(array[i] * 255); - } // Clear cached HSL/HSB values - - this.hsla = null; - this.hsba = null; - } - }, - { - key: '_getAlpha', - value: function _getAlpha() { - return this._array[3] * this.maxes[this.mode][3]; - } // stores the color mode and maxes in this instance of Color - // for later use (by _parseInputs()) - - }, - { - key: '_storeModeAndMaxes', - value: function _storeModeAndMaxes(new_mode, new_maxes) { - this.mode = new_mode; - this.maxes = new_maxes; - } - }, - { - key: '_getMode', - value: function _getMode() { - return this.mode; - } - }, - { - key: '_getMaxes', - value: function _getMaxes() { - return this.maxes; - } - }, - { - key: '_getBlue', - value: function _getBlue() { - return this._array[2] * this.maxes[constants.RGB][2]; - } - }, - { - key: '_getBrightness', - value: function _getBrightness() { - if (!this.hsba) { - this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - } - return this.hsba[2] * this.maxes[constants.HSB][2]; - } - }, - { - key: '_getGreen', - value: function _getGreen() { - return this._array[1] * this.maxes[constants.RGB][1]; - } /** - * Hue is the same in HSB and HSL, but the maximum value may be different. - * This function will return the HSB-normalized saturation when supplied with - * an HSB color object, but will default to the HSL-normalized saturation - * otherwise. - */ - - }, - { - key: '_getHue', - value: function _getHue() { - if (this.mode === constants.HSB) { - if (!this.hsba) { - this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - } - return this.hsba[0] * this.maxes[constants.HSB][0]; - } else { - if (!this.hsla) { - this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - } - return this.hsla[0] * this.maxes[constants.HSL][0]; - } - } - }, - { - key: '_getLightness', - value: function _getLightness() { - if (!this.hsla) { - this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - } - return this.hsla[2] * this.maxes[constants.HSL][2]; - } - }, - { - key: '_getRed', - value: function _getRed() { - return this._array[0] * this.maxes[constants.RGB][0]; - } /** - * Saturation is scaled differently in HSB and HSL. This function will return - * the HSB saturation when supplied with an HSB color object, but will default - * to the HSL saturation otherwise. - */ - - }, - { - key: '_getSaturation', - value: function _getSaturation() { - if (this.mode === constants.HSB) { - if (!this.hsba) { - this.hsba = _color_conversion.default._rgbaToHSBA(this._array); - } - return this.hsba[1] * this.maxes[constants.HSB][1]; - } else { - if (!this.hsla) { - this.hsla = _color_conversion.default._rgbaToHSLA(this._array); - } - return this.hsla[1] * this.maxes[constants.HSL][1]; - } - } /** - * For a number of different inputs, returns a color formatted as [r, g, b, a] - * arrays, with each component normalized between 0 and 1. - * - * @private - * @param {Array} [...args] An 'array-like' object that represents a list of - * arguments - * @return {Number[]} a color formatted as [r, g, b, a] - * Example: - * input ==> output - * g ==> [g, g, g, 255] - * g,a ==> [g, g, g, a] - * r, g, b ==> [r, g, b, 255] - * r, g, b, a ==> [r, g, b, a] - * [g] ==> [g, g, g, 255] - * [g, a] ==> [g, g, g, a] - * [r, g, b] ==> [r, g, b, 255] - * [r, g, b, a] ==> [r, g, b, a] - * @example - *
                - * - * // todo - * // - * // describe(''); - * - *
                - */ - - } - ], [ - { - key: '_parseInputs', - value: function _parseInputs(r, g, b, a) { - var numArgs = arguments.length; - var mode = this.mode; - var maxes = this.maxes[mode]; - var results = [ - ]; - var i; - if (numArgs >= 3) { - // Argument is a list of component values. - results[0] = r / maxes[0]; - results[1] = g / maxes[1]; - results[2] = b / maxes[2]; - // Alpha may be undefined, so default it to 100%. - if (typeof a === 'number') { - results[3] = a / maxes[3]; - } else { - results[3] = 1; - } // Constrain components to the range [0,1]. - // (loop backwards for performance) - - for (i = results.length - 1; i >= 0; --i) { - var result = results[i]; - if (result < 0) { - results[i] = 0; - } else if (result > 1) { - results[i] = 1; - } - } // Convert to RGBA and return. - - if (mode === constants.HSL) { - return _color_conversion.default._hslaToRGBA(results); - } else if (mode === constants.HSB) { - return _color_conversion.default._hsbaToRGBA(results); - } else { - return results; - } - } else if (numArgs === 1 && typeof r === 'string') { - var str = r.trim().toLowerCase(); - // Return if string is a named colour. - if (namedColors[str]) { - return Color._parseInputs.call(this, namedColors[str]); - } // Try RGBA pattern matching. - - if (colorPatterns.HEX3.test(str)) { - // #rgb - results = colorPatterns.HEX3.exec(str).slice(1).map(function (color) { - return parseInt(color + color, 16) / 255; - }); - results[3] = 1; - return results; - } else if (colorPatterns.HEX6.test(str)) { - // #rrggbb - results = colorPatterns.HEX6.exec(str).slice(1).map(function (color) { - return parseInt(color, 16) / 255; - }); - results[3] = 1; - return results; - } else if (colorPatterns.HEX4.test(str)) { - // #rgba - results = colorPatterns.HEX4.exec(str).slice(1).map(function (color) { - return parseInt(color + color, 16) / 255; - }); - return results; - } else if (colorPatterns.HEX8.test(str)) { - // #rrggbbaa - results = colorPatterns.HEX8.exec(str).slice(1).map(function (color) { - return parseInt(color, 16) / 255; - }); - return results; - } else if (colorPatterns.RGB.test(str)) { - // rgb(R,G,B) - results = colorPatterns.RGB.exec(str).slice(1).map(function (color) { - return color / 255; - }); - results[3] = 1; - return results; - } else if (colorPatterns.RGB_PERCENT.test(str)) { - // rgb(R%,G%,B%) - results = colorPatterns.RGB_PERCENT.exec(str).slice(1).map(function (color) { - return parseFloat(color) / 100; - }); - results[3] = 1; - return results; - } else if (colorPatterns.RGBA.test(str)) { - // rgba(R,G,B,A) - results = colorPatterns.RGBA.exec(str).slice(1).map(function (color, idx) { - if (idx === 3) { - return parseFloat(color); - } - return color / 255; - }); - return results; - } else if (colorPatterns.RGBA_PERCENT.test(str)) { - // rgba(R%,G%,B%,A%) - results = colorPatterns.RGBA_PERCENT.exec(str).slice(1).map(function (color, idx) { - if (idx === 3) { - return parseFloat(color); - } - return parseFloat(color) / 100; - }); - return results; - } // Try HSLA pattern matching. - - if (colorPatterns.HSL.test(str)) { - // hsl(H,S,L) - results = colorPatterns.HSL.exec(str).slice(1).map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } - return parseInt(color, 10) / 100; - }); - results[3] = 1; - } else if (colorPatterns.HSLA.test(str)) { - // hsla(H,S,L,A) - results = colorPatterns.HSLA.exec(str).slice(1).map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } else if (idx === 3) { - return parseFloat(color); - } - return parseInt(color, 10) / 100; - }); - } - results = results.map(function (value) { - return Math.max(Math.min(value, 1), 0); - }); - if (results.length) { - return _color_conversion.default._hslaToRGBA(results); - } // Try HSBA pattern matching. - - if (colorPatterns.HSB.test(str)) { - // hsb(H,S,B) - results = colorPatterns.HSB.exec(str).slice(1).map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } - return parseInt(color, 10) / 100; - }); - results[3] = 1; - } else if (colorPatterns.HSBA.test(str)) { - // hsba(H,S,B,A) - results = colorPatterns.HSBA.exec(str).slice(1).map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } else if (idx === 3) { - return parseFloat(color); - } - return parseInt(color, 10) / 100; - }); - } - if (results.length) { - // (loop backwards for performance) - for (i = results.length - 1; i >= 0; --i) { - results[i] = Math.max(Math.min(results[i], 1), 0); - } - return _color_conversion.default._hsbaToRGBA(results); - } // Input did not match any CSS color pattern: default to white. - - results = [ - 1, - 1, - 1, - 1 - ]; - } else if ((numArgs === 1 || numArgs === 2) && typeof r === 'number') { - // 'Grayscale' mode. - /** - * For HSB and HSL, interpret the gray level as a brightness/lightness - * value (they are equivalent when chroma is zero). For RGB, normalize the - * gray level according to the blue maximum. - */ - results[0] = r / maxes[2]; - results[1] = r / maxes[2]; - results[2] = r / maxes[2]; - // Alpha may be undefined, so default it to 100%. - if (typeof g === 'number') { - results[3] = g / maxes[3]; - } else { - results[3] = 1; - } // Constrain components to the range [0,1]. - - results = results.map(function (value) { - return Math.max(Math.min(value, 1), 0); - }); - } else { - throw new Error(''.concat(arguments, 'is not a valid color representation.')); - } - return results; - } - } - ]); - return Color; - }(); - var _default = _main.default.Color; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './color_conversion': 282, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.constructor': 204, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.trim': 219, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 285: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.fill'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - _dereq_('./p5.Color'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Color - * @submodule Setting - * @for p5 - * @requires core - * @requires constants - */ - /** - * Start defining a shape that will mask subsequent things drawn to the canvas. - * Only opaque regions of the mask shape will allow content to be drawn. - * Any shapes drawn between this and endClip() will - * contribute to the mask shape. - * - * The mask will apply to anything drawn after this call. To draw without a mask, contain - * the code to apply the mask and to draw the masked content between - * push() and pop(). - * - * Alternatively, rather than drawing the mask between this and - * endClip(), draw the mask in a callback function - * passed to clip(). - * - * Options can include: - * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. - * - * @method beginClip - * @param {Object} [options] An object containing clip settings. - * - * @example - *
                - * - * noStroke(); - * - * // Mask in some shapes - * push(); - * beginClip(); - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * endClip(); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - * translate(50, 50); - * - * // Mask out the same shapes - * push(); - * beginClip({ invert: true }); - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * endClip(); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - *
                - * - * @alt - * In the top left, a red triangle and circle. In the bottom right, a red - * square with a triangle and circle cut out of it. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(255); - * noStroke(); - * - * beginClip(); - * push(); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * scale(0.5); - * torus(30, 15); - * pop(); - * endClip(); - * - * beginShape(QUAD_STRIP); - * fill(0, 255, 255); - * vertex(-width/2, -height/2); - * vertex(width/2, -height/2); - * fill(100, 0, 100); - * vertex(-width/2, height/2); - * vertex(width/2, height/2); - * endShape(); - * } - * - *
                - * - * @alt - * A silhouette of a rotating torus colored with a gradient from - * cyan to purple - */ - - _main.default.prototype.beginClip = function () { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - this._renderer.beginClip(options); - }; - /** - * Finishes defining a shape that will mask subsequent things drawn to the canvas. - * Only opaque regions of the mask shape will allow content to be drawn. - * Any shapes drawn between beginClip() and this - * will contribute to the mask shape. - * - * @method endClip - */ - _main.default.prototype.endClip = function () { - this._renderer.endClip(); - }; - /** - * Use the shape drawn by a callback function to mask subsequent things drawn to the canvas. - * Only opaque regions of the mask shape will allow content to be drawn. - * - * The mask will apply to anything drawn after this call. To draw without a mask, contain - * the code to apply the mask and to draw the masked content between - * push() and pop(). - * - * Alternatively, rather than drawing the mask shape in a function, draw the - * shape between beginClip() and endClip(). - * - * Options can include: - * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. - * - * @method clip - * @param {Function} callback A function that draws the mask shape. - * @param {Object} [options] An object containing clip settings. - * - * @example - *
                - * - * noStroke(); - * - * // Mask in some shapes - * push(); - * clip(() => { - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * }); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - * translate(50, 50); - * - * // Mask out the same shapes - * push(); - * clip(() => { - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * }, { invert: true }); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - *
                - * - * @alt - * In the top left, a red triangle and circle. In the bottom right, a red - * square with a triangle and circle cut out of it. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(255); - * noStroke(); - * - * clip(() => { - * push(); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * scale(0.5); - * torus(30, 15); - * pop(); - * }); - * - * beginShape(QUAD_STRIP); - * fill(0, 255, 255); - * vertex(-width/2, -height/2); - * vertex(width/2, -height/2); - * fill(100, 0, 100); - * vertex(-width/2, height/2); - * vertex(width/2, height/2); - * endShape(); - * } - * - *
                - * - * @alt - * A silhouette of a rotating torus colored with a gradient from - * cyan to purple - */ - _main.default.prototype.clip = function (callback, options) { - this._renderer.beginClip(options); - callback(); - this._renderer.endClip(options); - }; - /** - * Sets the color used for the background of the canvas. By default, the - * background is transparent. This function is typically used within - * draw() to clear the display window at the beginning - * of each frame. It can also be used inside setup() to - * set the background on the first frame of animation. - * - * The version of `background()` with one parameter interprets the value one of four - * ways. If the parameter is a number, it's interpreted as a grayscale value. - * If the parameter is a string, it's interpreted as a CSS color string. RGB, RGBA, - * HSL, HSLA, hex, and named color strings are supported. If the parameter is a - * p5.Color object, it will be used as the background color. - * If the parameter is a p5.Image object, it will be used as - * the background image. - * - * The version of `background()` with two parameters interprets the first one as a - * grayscale value. The second parameter sets the alpha (transparency) value. - * - * The version of `background()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current colorMode(). - * By default, colors are specified in RGB values. Calling background(255, 204, 0) - * sets the background a bright yellow color. - * - * @method background - * @param {p5.Color} color any value created by the color() function - * @chainable - * - * @example - *
                - * - * // A grayscale integer value. - * background(51); - * describe('A canvas with a dark charcoal gray background.'); - * - *
                - * - *
                - * - * // A grayscale integer value and an alpha value. - * background(51, 0.4); - * describe('A canvas with a transparent gray background.'); - * - *
                - * - *
                - * - * // R, G & B integer values. - * background(255, 204, 0); - * describe('A canvas with a yellow background.'); - * - *
                - * - *
                - * - * // H, S & B integer values. - * colorMode(HSB); - * background(255, 204, 100); - * describe('A canvas with a royal blue background.'); - * - *
                - * - *
                - * - * // A CSS named color. - * background('red'); - * describe('A canvas with a red background.'); - * - *
                - * - *
                - * - * // Three-digit hex RGB notation. - * background('#fae'); - * describe('A canvas with a pink background.'); - * - *
                - * - *
                - * - * // Six-digit hex RGB notation. - * background('#222222'); - * describe('A canvas with a black background.'); - * - *
                - * - *
                - * - * // Integer RGB notation. - * background('rgb(0,255,0)'); - * describe('A canvas with a bright green background.'); - * - *
                - * - *
                - * - * // Integer RGBA notation. - * background('rgba(0,255,0, 0.25)'); - * describe('A canvas with a transparent green background.'); - * - *
                - * - *
                - * - * // Percentage RGB notation. - * background('rgb(100%,0%,10%)'); - * describe('A canvas with a red background.'); - * - *
                - * - *
                - * - * // Percentage RGBA notation. - * background('rgba(100%,0%,100%,0.5)'); - * describe('A canvas with a transparent purple background.'); - * - *
                - * - *
                - * - * // A p5.Color object. - * let c = color(0, 0, 255); - * background(c); - * describe('A canvas with a blue background.'); - * - *
                - * - */ - /** - * @method background - * @param {String} colorstring color string, possible formats include: integer - * rgb() or rgba(), percentage rgb() or rgba(), - * 3-digit hex, 6-digit hex. - * @param {Number} [a] opacity of the background relative to current - * color range (default is 0-255). - * @chainable - */ - /** - * @method background - * @param {Number} gray specifies a value between white and black. - * @param {Number} [a] - * @chainable - */ - /** - * @method background - * @param {Number} v1 red value if color mode is RGB, or hue value if color mode is HSB. - * @param {Number} v2 green value if color mode is RGB, or saturation value if color mode is HSB. - * @param {Number} v3 blue value if color mode is RGB, or brightness value if color mode is HSB. - * @param {Number} [a] - * @chainable - */ - /** - * @method background - * @param {Number[]} values an array containing the red, green, blue - * and alpha components of the color. - * @chainable - */ - /** - * @method background - * @param {p5.Image} image image created with loadImage() - * or createImage(), - * to set as background. - * (must be same size as the sketch window). - * @param {Number} [a] - * @chainable - */ - _main.default.prototype.background = function () { - var _this$_renderer; - (_this$_renderer = this._renderer).background.apply(_this$_renderer, arguments); - return this; - }; - /** - * Clears the pixels on the canvas. This function makes every pixel 100% - * transparent. Calling `clear()` doesn't clear objects created by `createX()` - * functions such as createGraphics(), - * createVideo(), and - * createImg(). These objects will remain - * unchanged after calling clear() and can be redrawn. - * - * In WebGL mode, this function can clear the screen to a specific color. It - * interprets four numeric parameters as normalized RGBA color values. It also - * clears the depth buffer. If you are not using the WebGL renderer, these - * parameters will have no effect. - * - * @method clear - * @chainable - * @example - *
                - * - * function draw() { - * circle(mouseX, mouseY, 20); - * describe('A white circle is drawn at the mouse x- and y-coordinates.'); - * } - * - * function mousePressed() { - * clear(); - * background(128); - * describe('The canvas is cleared when the mouse is clicked.'); - * } - * - *
                - * - *
                - * - * let pg; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * pg = createGraphics(60, 60); - * pg.background(200); - * pg.noStroke(); - * pg.circle(pg.width / 2, pg.height / 2, 15); - * image(pg, 20, 20); - * describe('A white circle drawn on a gray square. The square gets smaller when the mouse is pressed.'); - * } - * - * function mousePressed() { - * clear(); - * image(pg, 20, 20); - * } - * - *
                - * - * @param {Number} r normalized red value. - * @param {Number} g normalized green value. - * @param {Number} b normalized blue value. - * @param {Number} a normalized alpha value. - */ - _main.default.prototype.clear = function () { - var _r = (arguments.length <= 0 ? undefined : arguments[0]) || 0; - var _g = (arguments.length <= 1 ? undefined : arguments[1]) || 0; - var _b = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - var _a = (arguments.length <= 3 ? undefined : arguments[3]) || 0; - this._renderer.clear(_r, _g, _b, _a); - return this; - }; - /** - * Changes the way p5.js interprets color data. By default, the numeric - * parameters for fill(), - * stroke(), - * background(), and - * color() are defined by values between 0 and 255 - * using the RGB color model. This is equivalent to calling - * `colorMode(RGB, 255)`. Pure red is `color(255, 0, 0)` in this model. - * - * Calling `colorMode(RGB, 100)` sets colors to be interpreted as RGB color - * values between 0 and 100. Pure red is `color(100, 0, 0)` in this model. - * - * Calling `colorMode(HSB)` or `colorMode(HSL)` changes to HSB or HSL system - * instead of RGB. - * - * p5.Color objects remember the mode that they were - * created in. Changing modes doesn't affect their appearance. - * - * @method colorMode - * @param {Constant} mode either RGB, HSB or HSL, corresponding to - * Red/Green/Blue and Hue/Saturation/Brightness - * (or Lightness). - * @param {Number} [max] range for all values. - * @chainable - * - * @example - *
                - * - * noStroke(); - * colorMode(RGB, 100); - * for (let i = 0; i < 100; i += 1) { - * for (let j = 0; j < 100; j += 1) { - * stroke(i, j, 0); - * point(i, j); - * } - * } - * describe( - * 'A diagonal green to red gradient from bottom-left to top-right with shading transitioning to black at top-left corner.' - * ); - * - *
                - * - *
                - * - * noStroke(); - * colorMode(HSB, 100); - * for (let i = 0; i < 100; i++) { - * for (let j = 0; j < 100; j++) { - * stroke(i, j, 100); - * point(i, j); - * } - * } - * describe('A rainbow gradient from left-to-right. Brightness transitions to white at the top.'); - * - *
                - * - *
                - * - * colorMode(RGB, 255); - * let myColor = color(180, 175, 230); - * background(myColor); - * colorMode(RGB, 1); - * let redValue = red(myColor); - * let greenValue = green(myColor); - * let blueValue = blue(myColor); - * text(`Red: ${redValue}`, 10, 10, 80, 80); - * text(`Green: ${greenValue}`, 10, 40, 80, 80); - * text(`Blue: ${blueValue}`, 10, 70, 80, 80); - * describe('A purple canvas with the red, green, and blue decimal values of the color written on it.'); - * - *
                - * - *
                - * - * noFill(); - * colorMode(RGB, 255, 255, 255, 1); - * background(255); - * strokeWeight(4); - * stroke(255, 0, 10, 0.3); - * circle(40, 40, 50); - * circle(50, 60, 50); - * describe('Two overlapping translucent pink circle outlines.'); - * - *
                - * - */ - /** - * @method colorMode - * @param {Constant} mode - * @param {Number} max1 range for the red or hue depending on the - * current color mode. - * @param {Number} max2 range for the green or saturation depending - * on the current color mode. - * @param {Number} max3 range for the blue or brightness/lightness - * depending on the current color mode. - * @param {Number} [maxA] range for the alpha. - * @chainable - */ - _main.default.prototype.colorMode = function (mode, max1, max2, max3, maxA) { - _main.default._validateParameters('colorMode', arguments); - if (mode === constants.RGB || mode === constants.HSB || mode === constants.HSL) { - // Set color mode. - this._colorMode = mode; - // Set color maxes. - var maxes = this._colorMaxes[mode]; - if (arguments.length === 2) { - maxes[0] = max1; // Red - maxes[1] = max1; // Green - maxes[2] = max1; // Blue - maxes[3] = max1; // Alpha - } else if (arguments.length === 4) { - maxes[0] = max1; // Red - maxes[1] = max2; // Green - maxes[2] = max3; // Blue - } else if (arguments.length === 5) { - maxes[0] = max1; // Red - maxes[1] = max2; // Green - maxes[2] = max3; // Blue - maxes[3] = maxA; // Alpha - } - } - return this; - }; - /** - * Sets the color used to fill shapes. Calling `fill(255, 165, 0)` or - * `fill('orange')` means all shapes drawn after the fill command will be - * filled with the color orange. - * - * The version of `fill()` with one parameter interprets the value one of - * three ways. If the parameter is a number, it's interpreted as a grayscale - * value. If the parameter is a string, it's interpreted as a CSS color - * string. A p5.Color object can also be provided to - * set the fill color. - * - * The version of `fill()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current - * colorMode(). The default color space is RGB, - * with each value in the range from 0 to 255. - * - * @method fill - * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. - * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. - * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. - * @param {Number} [alpha] - * @chainable - * @example - *
                - * - * // Grayscale integer value. - * fill(51); - * square(20, 20, 60); - * describe('A dark charcoal gray square with a black outline.'); - * - *
                - * - *
                - * - * // R, G & B integer values. - * fill(255, 204, 0); - * square(20, 20, 60); - * describe('A yellow square with a black outline.'); - * - *
                - * - *
                - * - * // H, S & B integer values. - * colorMode(HSB); - * fill(255, 204, 100); - * square(20, 20, 60); - * describe('A royal blue square with a black outline.'); - * - *
                - * - *
                - * - * // A CSS named color. - * fill('red'); - * square(20, 20, 60); - * describe('A red square with a black outline.'); - * - *
                - * - *
                - * - * // Three-digit hex RGB notation. - * fill('#fae'); - * square(20, 20, 60); - * describe('A pink square with a black outline.'); - * - *
                - * - *
                - * - * // Six-digit hex RGB notation. - * fill('#A251FA'); - * square(20, 20, 60); - * describe('A purple square with a black outline.'); - * - *
                - * - *
                - * - * // Integer RGB notation. - * fill('rgb(0,255,0)'); - * square(20, 20, 60); - * describe('A bright green square with a black outline.'); - * - *
                - * - *
                - * - * // Integer RGBA notation. - * fill('rgba(0,255,0, 0.25)'); - * square(20, 20, 60); - * describe('A soft green rectange with a black outline.'); - * - *
                - * - *
                - * - * // Percentage RGB notation. - * fill('rgb(100%,0%,10%)'); - * square(20, 20, 60); - * describe('A red square with a black outline.'); - * - *
                - * - *
                - * - * // Percentage RGBA notation. - * fill('rgba(100%,0%,100%,0.5)'); - * square(20, 20, 60); - * describe('A dark fuchsia square with a black outline.'); - * - *
                - * - *
                - * - * // p5.Color object. - * let c = color(0, 0, 255); - * fill(c); - * square(20, 20, 60); - * describe('A blue square with a black outline.'); - * - *
                - */ - /** - * @method fill - * @param {String} value a color string. - * @chainable - */ - /** - * @method fill - * @param {Number} gray a grayscale value. - * @param {Number} [alpha] - * @chainable - */ - /** - * @method fill - * @param {Number[]} values an array containing the red, green, blue & - * and alpha components of the color. - * @chainable - */ - /** - * @method fill - * @param {p5.Color} color the fill color. - * @chainable - */ - _main.default.prototype.fill = function () { - var _this$_renderer2; - this._renderer._setProperty('_fillSet', true); - this._renderer._setProperty('_doFill', true); - (_this$_renderer2 = this._renderer).fill.apply(_this$_renderer2, arguments); - return this; - }; - /** - * Disables setting the interior color of shapes. This is the same as making - * the fill completely transparent. If both - * noStroke() and - * noFill() are called, nothing will be drawn to the - * screen. - * - * @method noFill - * @chainable - * @example - *
                - * - * square(32, 10, 35); - * noFill(); - * square(32, 55, 35); - * describe('A white square on top of an empty square. Both squares have black outlines.'); - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(0); - * noFill(); - * stroke(100, 100, 240); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(45, 45, 45); - * describe('A purple cube wireframe spinning on a black canvas.'); - * } - * - *
                - */ - _main.default.prototype.noFill = function () { - this._renderer._setProperty('_doFill', false); - return this; - }; - /** - * Disables drawing the stroke (outline). If both - * noStroke() and - * noFill() are called, nothing will be drawn to the - * screen. - * - * @method noStroke - * @chainable - * @example - *
                - * - * noStroke(); - * square(20, 20, 60); - * describe('A white square with no outline.'); - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(0); - * noStroke(); - * fill(240, 150, 150); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(45, 45, 45); - * describe('A pink cube with no edge outlines spinning on a black canvas.'); - * } - * - *
                - */ - _main.default.prototype.noStroke = function () { - this._renderer._setProperty('_doStroke', false); - return this; - }; - /** - * Sets the color used to draw lines and borders around shapes. Calling - * `stroke(255, 165, 0)` or `stroke('orange')` means all shapes drawn after - * the `stroke()` command will be filled with the color orange. The way these - * parameters are interpreted may be changed with the - * colorMode() function. - * - * The version of `stroke()` with one parameter interprets the value one of - * three ways. If the parameter is a number, it's interpreted as a grayscale - * value. If the parameter is a string, it's interpreted as a CSS color - * string. A p5.Color object can also be provided to - * set the stroke color. - * - * The version of `stroke()` with two parameters interprets the first one as a - * grayscale value. The second parameter sets the alpha (transparency) value. - * - * The version of `stroke()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current `colorMode()`. - * - * The version of `stroke()` with four parameters interprets them as RGBA, HSBA, - * or HSLA colors, depending on the current `colorMode()`. The last parameter - * sets the alpha (transparency) value. - * - * @method stroke - * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. - * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. - * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. - * @param {Number} [alpha] - * @chainable - * - * @example - *
                - * - * // Grayscale integer value. - * strokeWeight(4); - * stroke(51); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a dark charcoal gray outline.'); - * - *
                - * - *
                - * - * // R, G & B integer values. - * stroke(255, 204, 0); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a yellow outline.'); - * - *
                - * - *
                - * - * // H, S & B integer values. - * colorMode(HSB); - * strokeWeight(4); - * stroke(255, 204, 100); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a royal blue outline.'); - * - *
                - * - *
                - * - * // A CSS named color. - * stroke('red'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a red outline.'); - * - *
                - * - *
                - * - * // Three-digit hex RGB notation. - * stroke('#fae'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a pink outline.'); - * - *
                - * - *
                - * - * // Six-digit hex RGB notation. - * stroke('#222222'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a black outline.'); - * - *
                - * - *
                - * - * // Integer RGB notation. - * stroke('rgb(0,255,0)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A whiite rectangle with a bright green outline.'); - * - *
                - * - *
                - * - * // Integer RGBA notation. - * stroke('rgba(0,255,0,0.25)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a soft green outline.'); - * - *
                - * - *
                - * - * // Percentage RGB notation. - * stroke('rgb(100%,0%,10%)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a red outline.'); - * - *
                - * - *
                - * - * // Percentage RGBA notation. - * stroke('rgba(100%,0%,100%,0.5)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a dark fuchsia outline.'); - * - *
                - * - *
                - * - * // p5.Color object. - * stroke(color(0, 0, 255)); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a blue outline.'); - * - *
                - */ - /** - * @method stroke - * @param {String} value a color string. - * @chainable - */ - /** - * @method stroke - * @param {Number} gray a grayscale value. - * @param {Number} [alpha] - * @chainable - */ - /** - * @method stroke - * @param {Number[]} values an array containing the red, green, blue, - * and alpha components of the color. - * @chainable - */ - /** - * @method stroke - * @param {p5.Color} color the stroke color. - * @chainable - */ - _main.default.prototype.stroke = function () { - var _this$_renderer3; - this._renderer._setProperty('_strokeSet', true); - this._renderer._setProperty('_doStroke', true); - (_this$_renderer3 = this._renderer).stroke.apply(_this$_renderer3, arguments); - return this; - }; - /** - * All drawing that follows erase() will subtract - * from the canvas, revealing the web page underneath. The erased areas will - * become transparent, allowing the content behind the canvas to show through. - * The fill(), stroke(), and - * blendMode() have no effect once `erase()` is - * called. - * - * The `erase()` function has two optional parameters. The first parameter - * sets the strength of erasing by the shape's interior. A value of 0 means - * that no erasing will occur. A value of 255 means that the shape's interior - * will fully erase the content underneath. The default value is 255 - * (full strength). - * - * The second parameter sets the strength of erasing by the shape's edge. A - * value of 0 means that no erasing will occur. A value of 255 means that the - * shape's edge will fully erase the content underneath. The default value is - * 255 (full strength). - * - * To cancel the erasing effect, use the noErase() - * function. - * - * `erase()` has no effect on drawing done with the - * image() and - * background() functions. - * - * @method erase - * @param {Number} [strengthFill] a number (0-255) for the strength of erasing under a shape's interior. - * Defaults to 255, which is full strength. - * @param {Number} [strengthStroke] a number (0-255) for the strength of erasing under a shape's edge. - * Defaults to 255, which is full strength. - * - * @chainable - * @example - *
                - * - * background(100, 100, 250); - * fill(250, 100, 100); - * square(20, 20, 60); - * erase(); - * circle(25, 30, 30); - * noErase(); - * describe('A purple canvas with a pink square in the middle. A circle is erased from the top-left, leaving a white hole.'); - * - *
                - * - *
                - * - * let p = createP('I am a DOM element'); - * p.style('font-size', '12px'); - * p.style('width', '65px'); - * p.style('text-align', 'center'); - * p.position(18, 26); - * - * background(100, 170, 210); - * erase(200, 100); - * circle(50, 50, 77); - * noErase(); - * describe('A blue canvas with a circular hole in the center that reveals the message "I am a DOM element".'); - * - *
                - * - *
                - * - * background(150, 250, 150); - * fill(100, 100, 250); - * square(20, 20, 60); - * strokeWeight(5); - * erase(150, 255); - * triangle(50, 10, 70, 50, 90, 10); - * noErase(); - * describe('A mint green canvas with a purple square in the center. A triangle in the top-right corner partially erases its interior and a fully erases its outline.'); - * - *
                - */ - _main.default.prototype.erase = function () { - var opacityFill = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 255; - var opacityStroke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 255; - this._renderer.erase(opacityFill, opacityStroke); - return this; - }; - /** - * Ends erasing that was started with erase(). - * The fill(), stroke(), and - * blendMode() settings will return to what they - * were prior to calling erase(). - * - * @method noErase - * @chainable - * @example - *
                - * - * background(235, 145, 15); - * noStroke(); - * fill(30, 45, 220); - * rect(30, 10, 10, 80); - * erase(); - * circle(50, 50, 60); - * noErase(); - * rect(70, 10, 10, 80); - * describe('An orange canvas with two tall blue rectangles. A circular hole in the center erases the rectangle on the left but not the one on the right.'); - * - *
                - */ - _main.default.prototype.noErase = function () { - this._renderer.noErase(); - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.Color': 284, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 286: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.QUADRATIC = exports.LINEAR = exports._CTX_MIDDLE = exports._DEFAULT_LEADMULT = exports._DEFAULT_TEXT_FILL = exports.WORD = exports.CHAR = exports.BOLDITALIC = exports.BOLD = exports.ITALIC = exports.NORMAL = exports.BLUR = exports.ERODE = exports.DILATE = exports.POSTERIZE = exports.INVERT = exports.OPAQUE = exports.GRAY = exports.THRESHOLD = exports.BURN = exports.DODGE = exports.SOFT_LIGHT = exports.HARD_LIGHT = exports.OVERLAY = exports.REPLACE = exports.SCREEN = exports.MULTIPLY = exports.EXCLUSION = exports.SUBTRACT = exports.DIFFERENCE = exports.LIGHTEST = exports.DARKEST = exports.ADD = exports.REMOVE = exports.BLEND = exports.UP_ARROW = exports.TAB = exports.SHIFT = exports.RIGHT_ARROW = exports.RETURN = exports.OPTION = exports.LEFT_ARROW = exports.ESCAPE = exports.ENTER = exports.DOWN_ARROW = exports.DELETE = exports.CONTROL = exports.BACKSPACE = exports.ALT = exports.AUTO = exports.HSL = exports.HSB = exports.RGB = exports.MITER = exports.BEVEL = exports.ROUND = exports.SQUARE = exports.PROJECT = exports.PIE = exports.CHORD = exports.OPEN = exports.CLOSE = exports.TESS = exports.QUAD_STRIP = exports.QUADS = exports.TRIANGLE_STRIP = exports.TRIANGLE_FAN = exports.TRIANGLES = exports.LINE_LOOP = exports.LINE_STRIP = exports.LINES = exports.POINTS = exports.BASELINE = exports.BOTTOM = exports.TOP = exports.CENTER = exports.LEFT = exports.RIGHT = exports.RADIUS = exports.CORNERS = exports.CORNER = exports.RAD_TO_DEG = exports.DEG_TO_RAD = exports.RADIANS = exports.DEGREES = exports.TWO_PI = exports.TAU = exports.QUARTER_PI = exports.PI = exports.HALF_PI = exports.WAIT = exports.TEXT = exports.MOVE = exports.HAND = exports.CROSS = exports.ARROW = exports.WEBGL2 = exports.WEBGL = exports.P2D = exports.VERSION = void 0; - exports.RGBA = exports.HALF_FLOAT = exports.FLOAT = exports.UNSIGNED_INT = exports.UNSIGNED_BYTE = exports.COVER = exports.CONTAIN = exports.FALLBACK = exports.LABEL = exports.AXES = exports.GRID = exports._DEFAULT_FILL = exports._DEFAULT_STROKE = exports.PORTRAIT = exports.LANDSCAPE = exports.SMOOTH = exports.FLAT = exports.MIRROR = exports.CLAMP = exports.REPEAT = exports.NEAREST = exports.IMAGE = exports.IMMEDIATE = exports.TEXTURE = exports.FILL = exports.STROKE = exports.CURVE = exports.BEZIER = void 0; - /** - * @module Constants - * @submodule Constants - * @for p5 - */ - var _PI = Math.PI; - /** - * Version of this p5.js. - * @property {String} VERSION - * @final - */ - var VERSION = '1.9.0'; - // GRAPHICS RENDERER - /** - * The default, two-dimensional renderer. - * @property {String} P2D - * @final - */ - exports.VERSION = VERSION; - var P2D = 'p2d'; - /** - * One of the two render modes in p5.js, used for computationally intensive tasks like 3D rendering and shaders. - * - * `WEBGL` differs from the default `P2D` renderer in the following ways: - * - * - **Coordinate System** - When drawing in `WEBGL` mode, the origin point (0,0,0) is located at the center of the screen, not the top-left corner. See the learn page about coordinates and transformations. - * - **3D Shapes** - `WEBGL` mode can be used to draw 3-dimensional shapes like box(), sphere(), cone(), and more. See the learn page about custom geometry to make more complex objects. - * - **Shape Detail** - When drawing in `WEBGL` mode, you can specify how smooth curves should be drawn by using a `detail` parameter. See the wiki section about shapes for a more information and an example. - * - **Textures** - A texture is like a skin that wraps onto a shape. See the wiki section about textures for examples of mapping images onto surfaces with textures. - * - **Materials and Lighting** - `WEBGL` offers different types of lights like ambientLight() to place around a scene. Materials like specularMaterial() reflect the lighting to convey shape and depth. See the learn page for styling and appearance to experiment with different combinations. - * - **Camera** - The viewport of a `WEBGL` sketch can be adjusted by changing camera attributes. See the learn page section about cameras for an explanation of camera controls. - * - **Text** - `WEBGL` requires opentype/truetype font files to be preloaded using loadFont(). See the wiki section about text for details, along with a workaround. - * - **Shaders** - Shaders are hardware accelerated programs that can be used for a variety of effects and graphics. See the introduction to shaders to get started with shaders in p5.js. - * - **Graphics Acceleration** - `WEBGL` mode uses the graphics card instead of the CPU, so it may help boost the performance of your sketch (example: drawing more shapes on the screen at once). - * - * To learn more about WEBGL mode, check out all the interactive WEBGL tutorials in the "Learn" section of this website, or read the wiki article "Getting started with WebGL in p5". - * - * @property {String} WEBGL - * @final - */ - exports.P2D = P2D; - var WEBGL = 'webgl'; - /** - * One of the two possible values of a WebGL canvas (either WEBGL or WEBGL2), - * which can be used to determine what capabilities the rendering environment - * has. - * @property {String} WEBGL2 - * @final - */ - exports.WEBGL = WEBGL; - var WEBGL2 = 'webgl2'; - // ENVIRONMENT - /** - * @property {String} ARROW - * @final - */ - exports.WEBGL2 = WEBGL2; - var ARROW = 'default'; - /** - * @property {String} CROSS - * @final - */ - exports.ARROW = ARROW; - var CROSS = 'crosshair'; - /** - * @property {String} HAND - * @final - */ - exports.CROSS = CROSS; - var HAND = 'pointer'; - /** - * @property {String} MOVE - * @final - */ - exports.HAND = HAND; - var MOVE = 'move'; - /** - * @property {String} TEXT - * @final - */ - exports.MOVE = MOVE; - var TEXT = 'text'; - /** - * @property {String} WAIT - * @final - */ - exports.TEXT = TEXT; - var WAIT = 'wait'; - // TRIGONOMETRY - /** - * HALF_PI is a mathematical constant with the value - * 1.57079632679489661923. It is half the ratio of the - * circumference of a circle to its diameter. It is useful in - * combination with the trigonometric functions sin() and cos(). - * - * @property {Number} HALF_PI - * @final - * - * @example - *
                - * arc(50, 50, 80, 80, 0, HALF_PI); - *
                - * - * @alt - * 80×80 white quarter-circle with curve toward bottom right of canvas. - */ - exports.WAIT = WAIT; - var HALF_PI = _PI / 2; - /** - * PI is a mathematical constant with the value - * 3.14159265358979323846. It is the ratio of the circumference - * of a circle to its diameter. It is useful in combination with - * the trigonometric functions sin() and cos(). - * - * @property {Number} PI - * @final - * - * @example - *
                - * arc(50, 50, 80, 80, 0, PI); - *
                - * - * @alt - * white half-circle with curve toward bottom of canvas. - */ - exports.HALF_PI = HALF_PI; - var PI = _PI; - /** - * QUARTER_PI is a mathematical constant with the value 0.7853982. - * It is one quarter the ratio of the circumference of a circle to - * its diameter. It is useful in combination with the trigonometric - * functions sin() and cos(). - * - * @property {Number} QUARTER_PI - * @final - * - * @example - *
                - * arc(50, 50, 80, 80, 0, QUARTER_PI); - *
                - * - * @alt - * white eighth-circle rotated about 40 degrees with curve bottom right canvas. - */ - exports.PI = PI; - var QUARTER_PI = _PI / 4; - /** - * TAU is an alias for TWO_PI, a mathematical constant with the - * value 6.28318530717958647693. It is twice the ratio of the - * circumference of a circle to its diameter. It is useful in - * combination with the trigonometric functions sin() and cos(). - * - * @property {Number} TAU - * @final - * - * @example - *
                - * arc(50, 50, 80, 80, 0, TAU); - *
                - * - * @alt - * 80×80 white ellipse shape in center of canvas. - */ - exports.QUARTER_PI = QUARTER_PI; - var TAU = _PI * 2; - /** - * TWO_PI is a mathematical constant with the value - * 6.28318530717958647693. It is twice the ratio of the - * circumference of a circle to its diameter. It is useful in - * combination with the trigonometric functions sin() and cos(). - * - * @property {Number} TWO_PI - * @final - * - * @example - *
                - * arc(50, 50, 80, 80, 0, TWO_PI); - *
                - * - * @alt - * 80×80 white ellipse shape in center of canvas. - */ - exports.TAU = TAU; - var TWO_PI = _PI * 2; - /** - * Constant to be used with the angleMode() function, to set the mode in - * which p5.js interprets and calculates angles (either DEGREES or RADIANS). - * @property {String} DEGREES - * @final - * - * @example - *
                - * function setup() { - * angleMode(DEGREES); - * } - *
                - */ - exports.TWO_PI = TWO_PI; - var DEGREES = 'degrees'; - /** - * Constant to be used with the angleMode() function, to set the mode - * in which p5.js interprets and calculates angles (either RADIANS or DEGREES). - * @property {String} RADIANS - * @final - * - * @example - *
                - * function setup() { - * angleMode(RADIANS); - * } - *
                - */ - exports.DEGREES = DEGREES; - var RADIANS = 'radians'; - exports.RADIANS = RADIANS; - var DEG_TO_RAD = _PI / 180; - exports.DEG_TO_RAD = DEG_TO_RAD; - var RAD_TO_DEG = 180 / _PI; - // SHAPE - /** - * @property {String} CORNER - * @final - */ - exports.RAD_TO_DEG = RAD_TO_DEG; - var CORNER = 'corner'; - /** - * @property {String} CORNERS - * @final - */ - exports.CORNER = CORNER; - var CORNERS = 'corners'; - /** - * @property {String} RADIUS - * @final - */ - exports.CORNERS = CORNERS; - var RADIUS = 'radius'; - /** - * @property {String} RIGHT - * @final - */ - exports.RADIUS = RADIUS; - var RIGHT = 'right'; - /** - * @property {String} LEFT - * @final - */ - exports.RIGHT = RIGHT; - var LEFT = 'left'; - /** - * @property {String} CENTER - * @final - */ - exports.LEFT = LEFT; - var CENTER = 'center'; - /** - * @property {String} TOP - * @final - */ - exports.CENTER = CENTER; - var TOP = 'top'; - /** - * @property {String} BOTTOM - * @final - */ - exports.TOP = TOP; - var BOTTOM = 'bottom'; - /** - * @property {String} BASELINE - * @final - * @default alphabetic - */ - exports.BOTTOM = BOTTOM; - var BASELINE = 'alphabetic'; - /** - * @property {Number} POINTS - * @final - * @default 0x0000 - */ - exports.BASELINE = BASELINE; - var POINTS = 0; - /** - * @property {Number} LINES - * @final - * @default 0x0001 - */ - exports.POINTS = POINTS; - var LINES = 1; - /** - * @property {Number} LINE_STRIP - * @final - * @default 0x0003 - */ - exports.LINES = LINES; - var LINE_STRIP = 3; - /** - * @property {Number} LINE_LOOP - * @final - * @default 0x0002 - */ - exports.LINE_STRIP = LINE_STRIP; - var LINE_LOOP = 2; - /** - * @property {Number} TRIANGLES - * @final - * @default 0x0004 - */ - exports.LINE_LOOP = LINE_LOOP; - var TRIANGLES = 4; - /** - * @property {Number} TRIANGLE_FAN - * @final - * @default 0x0006 - */ - exports.TRIANGLES = TRIANGLES; - var TRIANGLE_FAN = 6; - /** - * @property {Number} TRIANGLE_STRIP - * @final - * @default 0x0005 - */ - exports.TRIANGLE_FAN = TRIANGLE_FAN; - var TRIANGLE_STRIP = 5; - /** - * @property {String} QUADS - * @final - */ - exports.TRIANGLE_STRIP = TRIANGLE_STRIP; - var QUADS = 'quads'; - /** - * @property {String} QUAD_STRIP - * @final - * @default quad_strip - */ - exports.QUADS = QUADS; - var QUAD_STRIP = 'quad_strip'; - /** - * @property {String} TESS - * @final - * @default tess - */ - exports.QUAD_STRIP = QUAD_STRIP; - var TESS = 'tess'; - /** - * @property {String} CLOSE - * @final - */ - exports.TESS = TESS; - var CLOSE = 'close'; - /** - * @property {String} OPEN - * @final - */ - exports.CLOSE = CLOSE; - var OPEN = 'open'; - /** - * @property {String} CHORD - * @final - */ - exports.OPEN = OPEN; - var CHORD = 'chord'; - /** - * @property {String} PIE - * @final - */ - exports.CHORD = CHORD; - var PIE = 'pie'; - /** - * @property {String} PROJECT - * @final - * @default square - */ - exports.PIE = PIE; - var PROJECT = 'square'; // PEND: careful this is counterintuitive - /** - * @property {String} SQUARE - * @final - * @default butt - */ - exports.PROJECT = PROJECT; - var SQUARE = 'butt'; - /** - * @property {String} ROUND - * @final - */ - exports.SQUARE = SQUARE; - var ROUND = 'round'; - /** - * @property {String} BEVEL - * @final - */ - exports.ROUND = ROUND; - var BEVEL = 'bevel'; - /** - * @property {String} MITER - * @final - */ - exports.BEVEL = BEVEL; - var MITER = 'miter'; - // COLOR - /** - * @property {String} RGB - * @final - */ - exports.MITER = MITER; - var RGB = 'rgb'; - /** - * HSB (hue, saturation, brightness) is a type of color model. - * You can learn more about it at - * HSB. - * - * @property {String} HSB - * @final - */ - exports.RGB = RGB; - var HSB = 'hsb'; - /** - * @property {String} HSL - * @final - */ - exports.HSB = HSB; - var HSL = 'hsl'; - // DOM EXTENSION - /** - * AUTO allows us to automatically set the width or height of an element (but not both), - * based on the current height and width of the element. Only one parameter can - * be passed to the size function as AUTO, at a time. - * - * @property {String} AUTO - * @final - */ - exports.HSL = HSL; - var AUTO = 'auto'; - /** - * @property {Number} ALT - * @final - */ - // INPUT - exports.AUTO = AUTO; - var ALT = 18; - /** - * @property {Number} BACKSPACE - * @final - */ - exports.ALT = ALT; - var BACKSPACE = 8; - /** - * @property {Number} CONTROL - * @final - */ - exports.BACKSPACE = BACKSPACE; - var CONTROL = 17; - /** - * @property {Number} DELETE - * @final - */ - exports.CONTROL = CONTROL; - var DELETE = 46; - /** - * @property {Number} DOWN_ARROW - * @final - */ - exports.DELETE = DELETE; - var DOWN_ARROW = 40; - /** - * @property {Number} ENTER - * @final - */ - exports.DOWN_ARROW = DOWN_ARROW; - var ENTER = 13; - /** - * @property {Number} ESCAPE - * @final - */ - exports.ENTER = ENTER; - var ESCAPE = 27; - /** - * @property {Number} LEFT_ARROW - * @final - */ - exports.ESCAPE = ESCAPE; - var LEFT_ARROW = 37; - /** - * @property {Number} OPTION - * @final - */ - exports.LEFT_ARROW = LEFT_ARROW; - var OPTION = 18; - /** - * @property {Number} RETURN - * @final - */ - exports.OPTION = OPTION; - var RETURN = 13; - /** - * @property {Number} RIGHT_ARROW - * @final - */ - exports.RETURN = RETURN; - var RIGHT_ARROW = 39; - /** - * @property {Number} SHIFT - * @final - */ - exports.RIGHT_ARROW = RIGHT_ARROW; - var SHIFT = 16; - /** - * @property {Number} TAB - * @final - */ - exports.SHIFT = SHIFT; - var TAB = 9; - /** - * @property {Number} UP_ARROW - * @final - */ - exports.TAB = TAB; - var UP_ARROW = 38; - // RENDERING - /** - * @property {String} BLEND - * @final - * @default source-over - */ - exports.UP_ARROW = UP_ARROW; - var BLEND = 'source-over'; - /** - * @property {String} REMOVE - * @final - * @default destination-out - */ - exports.BLEND = BLEND; - var REMOVE = 'destination-out'; - /** - * @property {String} ADD - * @final - * @default lighter - */ - exports.REMOVE = REMOVE; - var ADD = 'lighter'; - //ADD: 'add', // - //SUBTRACT: 'subtract', // - /** - * @property {String} DARKEST - * @final - */ - exports.ADD = ADD; - var DARKEST = 'darken'; - /** - * @property {String} LIGHTEST - * @final - * @default lighten - */ - exports.DARKEST = DARKEST; - var LIGHTEST = 'lighten'; - /** - * @property {String} DIFFERENCE - * @final - */ - exports.LIGHTEST = LIGHTEST; - var DIFFERENCE = 'difference'; - /** - * @property {String} SUBTRACT - * @final - */ - exports.DIFFERENCE = DIFFERENCE; - var SUBTRACT = 'subtract'; - /** - * @property {String} EXCLUSION - * @final - */ - exports.SUBTRACT = SUBTRACT; - var EXCLUSION = 'exclusion'; - /** - * @property {String} MULTIPLY - * @final - */ - exports.EXCLUSION = EXCLUSION; - var MULTIPLY = 'multiply'; - /** - * @property {String} SCREEN - * @final - */ - exports.MULTIPLY = MULTIPLY; - var SCREEN = 'screen'; - /** - * @property {String} REPLACE - * @final - * @default copy - */ - exports.SCREEN = SCREEN; - var REPLACE = 'copy'; - /** - * @property {String} OVERLAY - * @final - */ - exports.REPLACE = REPLACE; - var OVERLAY = 'overlay'; - /** - * @property {String} HARD_LIGHT - * @final - */ - exports.OVERLAY = OVERLAY; - var HARD_LIGHT = 'hard-light'; - /** - * @property {String} SOFT_LIGHT - * @final - */ - exports.HARD_LIGHT = HARD_LIGHT; - var SOFT_LIGHT = 'soft-light'; - /** - * @property {String} DODGE - * @final - * @default color-dodge - */ - exports.SOFT_LIGHT = SOFT_LIGHT; - var DODGE = 'color-dodge'; - /** - * @property {String} BURN - * @final - * @default color-burn - */ - exports.DODGE = DODGE; - var BURN = 'color-burn'; - // FILTERS - /** - * @property {String} THRESHOLD - * @final - */ - exports.BURN = BURN; - var THRESHOLD = 'threshold'; - /** - * @property {String} GRAY - * @final - */ - exports.THRESHOLD = THRESHOLD; - var GRAY = 'gray'; - /** - * @property {String} OPAQUE - * @final - */ - exports.GRAY = GRAY; - var OPAQUE = 'opaque'; - /** - * @property {String} INVERT - * @final - */ - exports.OPAQUE = OPAQUE; - var INVERT = 'invert'; - /** - * @property {String} POSTERIZE - * @final - */ - exports.INVERT = INVERT; - var POSTERIZE = 'posterize'; - /** - * @property {String} DILATE - * @final - */ - exports.POSTERIZE = POSTERIZE; - var DILATE = 'dilate'; - /** - * @property {String} ERODE - * @final - */ - exports.DILATE = DILATE; - var ERODE = 'erode'; - /** - * @property {String} BLUR - * @final - */ - exports.ERODE = ERODE; - var BLUR = 'blur'; - // TYPOGRAPHY - /** - * @property {String} NORMAL - * @final - */ - exports.BLUR = BLUR; - var NORMAL = 'normal'; - /** - * @property {String} ITALIC - * @final - */ - exports.NORMAL = NORMAL; - var ITALIC = 'italic'; - /** - * @property {String} BOLD - * @final - */ - exports.ITALIC = ITALIC; - var BOLD = 'bold'; - /** - * @property {String} BOLDITALIC - * @final - */ - exports.BOLD = BOLD; - var BOLDITALIC = 'bold italic'; - /** - * @property {String} CHAR - * @final - */ - exports.BOLDITALIC = BOLDITALIC; - var CHAR = 'CHAR'; - /** - * @property {String} WORD - * @final - */ - exports.CHAR = CHAR; - var WORD = 'WORD'; - // TYPOGRAPHY-INTERNAL - exports.WORD = WORD; - var _DEFAULT_TEXT_FILL = '#000000'; - exports._DEFAULT_TEXT_FILL = _DEFAULT_TEXT_FILL; - var _DEFAULT_LEADMULT = 1.25; - exports._DEFAULT_LEADMULT = _DEFAULT_LEADMULT; - var _CTX_MIDDLE = 'middle'; - // VERTICES - /** - * @property {String} LINEAR - * @final - */ - exports._CTX_MIDDLE = _CTX_MIDDLE; - var LINEAR = 'linear'; - /** - * @property {String} QUADRATIC - * @final - */ - exports.LINEAR = LINEAR; - var QUADRATIC = 'quadratic'; - /** - * @property {String} BEZIER - * @final - */ - exports.QUADRATIC = QUADRATIC; - var BEZIER = 'bezier'; - /** - * @property {String} CURVE - * @final - */ - exports.BEZIER = BEZIER; - var CURVE = 'curve'; - // WEBGL DRAWMODES - /** - * @property {String} STROKE - * @final - */ - exports.CURVE = CURVE; - var STROKE = 'stroke'; - /** - * @property {String} FILL - * @final - */ - exports.STROKE = STROKE; - var FILL = 'fill'; - /** - * @property {String} TEXTURE - * @final - */ - exports.FILL = FILL; - var TEXTURE = 'texture'; - /** - * @property {String} IMMEDIATE - * @final - */ - exports.TEXTURE = TEXTURE; - var IMMEDIATE = 'immediate'; - // WEBGL TEXTURE MODE - // NORMAL already exists for typography - /** - * @property {String} IMAGE - * @final - */ - exports.IMMEDIATE = IMMEDIATE; - var IMAGE = 'image'; - // WEBGL TEXTURE WRAP AND FILTERING - // LINEAR already exists above - /** - * @property {String} NEAREST - * @final - */ - exports.IMAGE = IMAGE; - var NEAREST = 'nearest'; - /** - * @property {String} REPEAT - * @final - */ - exports.NEAREST = NEAREST; - var REPEAT = 'repeat'; - /** - * @property {String} CLAMP - * @final - */ - exports.REPEAT = REPEAT; - var CLAMP = 'clamp'; - /** - * @property {String} MIRROR - * @final - */ - exports.CLAMP = CLAMP; - var MIRROR = 'mirror'; - // WEBGL GEOMETRY SHADING - /** - * @property {String} FLAT - * @final - */ - exports.MIRROR = MIRROR; - var FLAT = 'flat'; - /** - * @property {String} SMOOTH - * @final - */ - exports.FLAT = FLAT; - var SMOOTH = 'smooth'; - // DEVICE-ORIENTATION - /** - * @property {String} LANDSCAPE - * @final - */ - exports.SMOOTH = SMOOTH; - var LANDSCAPE = 'landscape'; - /** - * @property {String} PORTRAIT - * @final - */ - exports.LANDSCAPE = LANDSCAPE; - var PORTRAIT = 'portrait'; - // DEFAULTS - exports.PORTRAIT = PORTRAIT; - var _DEFAULT_STROKE = '#000000'; - exports._DEFAULT_STROKE = _DEFAULT_STROKE; - var _DEFAULT_FILL = '#FFFFFF'; - /** - * @property {String} GRID - * @final - */ - exports._DEFAULT_FILL = _DEFAULT_FILL; - var GRID = 'grid'; - /** - * @property {String} AXES - * @final - */ - exports.GRID = GRID; - var AXES = 'axes'; - /** - * @property {String} LABEL - * @final - */ - exports.AXES = AXES; - var LABEL = 'label'; - /** - * @property {String} FALLBACK - * @final - */ - exports.LABEL = LABEL; - var FALLBACK = 'fallback'; - /** - * @property {String} CONTAIN - * @final - */ - exports.FALLBACK = FALLBACK; - var CONTAIN = 'contain'; - /** - * @property {String} COVER - * @final - */ - exports.CONTAIN = CONTAIN; - var COVER = 'cover'; - /** - * @property {String} UNSIGNED_BYTE - * @final - */ - exports.COVER = COVER; - var UNSIGNED_BYTE = 'unsigned-byte'; - /** - * @property {String} UNSIGNED_INT - * @final - */ - exports.UNSIGNED_BYTE = UNSIGNED_BYTE; - var UNSIGNED_INT = 'unsigned-int'; - /** - * @property {String} FLOAT - * @final - */ - exports.UNSIGNED_INT = UNSIGNED_INT; - var FLOAT = 'float'; - /** - * @property {String} HALF_FLOAT - * @final - */ - exports.FLOAT = FLOAT; - var HALF_FLOAT = 'half-float'; - /** - * @property {String} RGBA - * @final - */ - exports.HALF_FLOAT = HALF_FLOAT; - var RGBA = 'rgba'; - exports.RGBA = RGBA; - }, - { - } - ], - 287: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.search'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.search'); - _dereq_('core-js/modules/es.string.split'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - var C = _interopRequireWildcard(_dereq_('./constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - * @requires constants - */ - - var standardCursors = [ - C.ARROW, - C.CROSS, - C.HAND, - C.MOVE, - C.TEXT, - C.WAIT - ]; - _main.default.prototype._frameRate = 0; - _main.default.prototype._lastFrameTime = window.performance.now(); - _main.default.prototype._targetFrameRate = 60; - var _windowPrint = window.print; - var windowPrintDisabled = false; - /** - * Displays text in the web browser's console. - * - * `print()` is helpful for printing values while debugging. Each call to - * `print()` creates a new line of text. - * - * Note: Call `print('\n')` to print a blank line. Calling `print()` without - * an argument opens the browser's dialog for printing documents. - * - * @method print - * @param {Any} contents content to print to the console. - * @example - *
                - * - * function setup() { - * // Prints "hello, world" to the console. - * print('hello, world'); - * } - * - *
                - * - *
                - * - * function setup() { - * let name = 'ada'; - * // Prints "hello, ada" to the console. - * print(`hello, ${name}`); - * } - * - *
                - */ - _main.default.prototype.print = function () { - if (!arguments.length) { - if (!windowPrintDisabled) { - _windowPrint(); - if (window.confirm('You just tried to print the webpage. Do you want to prevent this from running again?')) { - windowPrintDisabled = true; - } - } - } else { - var _console; - (_console = console).log.apply(_console, arguments); - } - }; - /** - * Tracks the number of frames drawn since the sketch started. - * - * `frameCount`'s value is 0 inside setup(). It - * increments by 1 each time the code in draw() - * finishes executing. - * - * @property {Integer} frameCount - * @readOnly - * @example - *
                - * - * function setup() { - * background(200); - * - * // Display the value of - * // frameCount. - * textSize(30); - * textAlign(CENTER, CENTER); - * text(frameCount, 50, 50); - * - * describe('The number 0 written in black in the middle of a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * // Set the frameRate to 30. - * frameRate(30); - * - * textSize(30); - * textAlign(CENTER, CENTER); - * } - * - * function draw() { - * background(200); - * - * // Display the value of - * // frameCount. - * text(frameCount, 50, 50); - * - * describe('A number written in black in the middle of a gray square. Its value increases rapidly.'); - * } - * - *
                - */ - _main.default.prototype.frameCount = 0; - /** - * Tracks the amount of time, in milliseconds, it took for - * draw to draw the previous frame. `deltaTime` is - * useful for simulating physics. - * - * @property {Integer} deltaTime - * @readOnly - * @example - *
                - * - * let x = 0; - * let speed = 0.05; - * - * function setup() { - * // Set the frameRate to 30. - * frameRate(30); - * } - * - * function draw() { - * background(200); - * - * // Use deltaTime to calculate - * // a change in position. - * let deltaX = speed * deltaTime; - * - * // Update the x variable. - * x += deltaX; - * - * // Reset x to 0 if it's - * // greater than 100. - * if (x > 100) { - * x = 0; - * } - * - * // Use x to set the circle's - * // position. - * circle(x, 50, 20); - * - * describe('A white circle moves from left to right on a gray background. It reappears on the left side when it reaches the right side.'); - * } - * - *
                - */ - _main.default.prototype.deltaTime = 0; - /** - * Tracks whether the browser window is focused and can receive user input. - * `focused` is `true` if the window if focused and `false` if not. - * - * @property {Boolean} focused - * @readOnly - * @example - *
                - * - * // Open this example in two separate browser - * // windows placed side-by-side to demonstrate. - * - * function draw() { - * // Change the background color - * // when the browser window - * // goes in/out of focus. - * if (focused === true) { - * background(0, 255, 0); - * } else { - * background(255, 0, 0); - * } - * - * describe('A square changes color from green to red when the browser window is out of focus.'); - * } - * - *
                - */ - _main.default.prototype.focused = document.hasFocus(); - /** - * Changes the cursor's appearance. - * - * The first parameter, `type`, sets the type of cursor to display. The - * built-in options are `ARROW`, `CROSS`, `HAND`, `MOVE`, `TEXT`, and `WAIT`. - * `cursor()` also recognizes standard CSS cursor properties passed as - * strings: `'help'`, `'wait'`, `'crosshair'`, `'not-allowed'`, `'zoom-in'`, - * and `'grab'`. If the path to an image is passed, as in - * `cursor('assets/target.png')`, then the image will be used as the cursor. - * Images must be in .cur, .gif, .jpg, .jpeg, or .png format. - * - * The parameters `x` and `y` are optional. If an image is used for the - * cursor, `x` and `y` set the location pointed to within the image. They are - * both 0 by default, so the cursor points to the image's top-left corner. `x` - * and `y` must be less than the image's width and height, respectively. - * - * @method cursor - * @param {String|Constant} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT. - * Native CSS properties: 'grab', 'progress', and so on. - * Path to cursor image. - * @param {Number} [x] horizontal active spot of the cursor. - * @param {Number} [y] vertical active spot of the cursor. - * @example - *
                - * - * function draw() { - * background(200); - * - * // Set the cursor to crosshairs: + - * cursor(CROSS); - * - * describe('A gray square. The cursor appears as crosshairs.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * // Divide the canvas into quadrants. - * line(50, 0, 50, 100); - * line(0, 50, 100, 50); - * - * // Change cursor based on mouse position. - * if (mouseX < 50 && mouseY < 50) { - * cursor(CROSS); - * } else if (mouseX > 50 && mouseY < 50) { - * cursor('progress'); - * } else if (mouseX > 50 && mouseY > 50) { - * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); - * } else { - * cursor('grab'); - * } - * - * describe('A gray square divided into quadrants. The cursor image changes when the mouse moves to each quadrant.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * // Change the cursor's active spot - * // when the mouse is pressed. - * if (mouseIsPressed === true) { - * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16', 8, 8); - * } else { - * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); - * } - * - * describe('An image of three purple curves follows the mouse. The image shifts when the mouse is pressed.'); - * } - * - *
                - */ - _main.default.prototype.cursor = function (type, x, y) { - var cursor = 'auto'; - var canvas = this._curElement.elt; - if (standardCursors.includes(type)) { - // Standard css cursor - cursor = type; - } else if (typeof type === 'string') { - var coords = ''; - if (x && y && typeof x === 'number' && typeof y === 'number') { - // Note that x and y values must be unit-less positive integers < 32 - // https://developer.mozilla.org/en-US/docs/Web/CSS/cursor - coords = ''.concat(x, ' ').concat(y); - } - if (type.substring(0, 7) === 'http://' || type.substring(0, 8) === 'https://') { - // Image (absolute url) - cursor = 'url('.concat(type, ') ').concat(coords, ', auto'); - } else if (/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(type)) { - // Image file (relative path) - Separated for performance reasons - cursor = 'url('.concat(type, ') ').concat(coords, ', auto'); - } else { - // Any valid string for the css cursor property - cursor = type; - } - } - canvas.style.cursor = cursor; - }; - /** - * Sets the number of frames to draw per second. - * - * Calling `frameRate()` with one numeric argument, as in `frameRate(30)`, - * attempts to draw 30 frames per second (FPS). The target frame rate may not - * be achieved depending on the sketch's processing needs. Most computers - * default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are - * fast enough for smooth animations. - * - * Calling `frameRate()` without an argument returns the current frame rate. - * The value returned is an approximation. - * - * @method frameRate - * @param {Number} fps number of frames to draw per second. - * @chainable - * - * @example - *
                - * - * function draw() { - * background(200); - * - * // Set the x variable based - * // on the current frameCount. - * let x = frameCount % 100; - * - * // If the mouse is pressed, - * // decrease the frame rate. - * if (mouseIsPressed === true) { - * frameRate(10); - * } else { - * frameRate(60); - * } - * - * // Use x to set the circle's - * // position. - * circle(x, 50, 20); - * - * describe('A white circle on a gray background. The circle moves from left to right in a loop. It slows down when the mouse is pressed.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * // If the mouse is pressed, do lots - * // of math to slow down drawing. - * if (mouseIsPressed === true) { - * for (let i = 0; i < 1000000; i += 1) { - * random(); - * } - * } - * - * // Get the current frame rate - * // and display it. - * let fps = frameRate(); - * text(fps, 50, 50); - * - * describe('A number written in black written on a gray background. The number decreases when the mouse is pressed.'); - * } - * - *
                - */ - /** - * @method frameRate - * @return {Number} current frame rate. - */ - _main.default.prototype.frameRate = function (fps) { - _main.default._validateParameters('frameRate', arguments); - if (typeof fps !== 'number' || fps < 0) { - return this._frameRate; - } else { - this._setProperty('_targetFrameRate', fps); - if (fps === 0) { - this._setProperty('_frameRate', fps); - } - return this; - } - }; - /** - * Returns the current framerate. - * - * @private - * @return {Number} current frameRate - */ - _main.default.prototype.getFrameRate = function () { - return this.frameRate(); - }; - /** - * Specifies the number of frames to be displayed every second. For example, - * the function call frameRate(30) will attempt to refresh 30 times a second. - * If the processor is not fast enough to maintain the specified rate, the - * frame rate will not be achieved. Setting the frame rate within setup() is - * recommended. The default rate is 60 frames per second. - * - * Calling `frameRate()` with no arguments returns the current frame rate. - * - * @private - * @param {Number} [fps] number of frames to be displayed every second - */ - _main.default.prototype.setFrameRate = function (fps) { - return this.frameRate(fps); - }; - /** - * Returns the target frame rate. The value is either the system frame rate or - * the last value passed to frameRate(). - * - * @method getTargetFrameRate - * @return {Number} _targetFrameRate - * @example - *
                - * - * function draw() { - * background(200); - * - * // Set the frame rate to 20. - * frameRate(20); - * - * // Get the target frame rate and - * // display it. - * let fps = getTargetFrameRate(); - * text(fps, 43, 54); - * - * describe('The number 20 written in black on a gray background.'); - * } - * - *
                - */ - _main.default.prototype.getTargetFrameRate = function () { - return this._targetFrameRate; - }; - /** - * Hides the cursor from view. - * - * @method noCursor - * @example - *
                - * - * function setup() { - * // Hide the cursor. - * noCursor(); - * } - * - * function draw() { - * background(200); - * - * circle(mouseX, mouseY, 10); - * - * describe('A white circle on a gray background. The circle follows the mouse as it moves. The cursor is hidden.'); - * } - * - *
                - */ - _main.default.prototype.noCursor = function () { - this._curElement.elt.style.cursor = 'none'; - }; - /** - * A string variable with the WebGL version in use. Its value equals one of - * the followin string constants: - * - * - `WEBGL2` whose value is `'webgl2'`, - * - `WEBGL` whose value is `'webgl'`, or - * - `P2D` whose value is `'p2d'`. This is the default for 2D sketches. - * - * See setAttributes() for ways to set the - * WebGL version. - * - * @property {String} webglVersion - * @readOnly - * @example - *
                - * - * function setup() { - * background(200); - * - * // Display the current WebGL version. - * text(webglVersion, 42, 54); - * - * describe('The text "p2d" written in black on a gray background.'); - * } - * - *
                - * - *
                - * - * let font; - * - * function preload() { - * // Load a font to use. - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * // Create a canvas using WEBGL mode. - * createCanvas(100, 50, WEBGL); - * background(200); - * - * // Display the current WebGL version. - * fill(0); - * textFont(font); - * text(webglVersion, -15, 5); - * - * describe('The text "webgl2" written in black on a gray background.'); - * } - * - *
                - * - *
                - * - * let font; - * - * function preload() { - * // Load a font to use. - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * // Create a canvas using WEBGL mode. - * createCanvas(100, 50, WEBGL); - * - * // Set WebGL to version 1. - * setAttributes({ version: 1 }); - * - * background(200); - * - * // Display the current WebGL version. - * fill(0); - * textFont(font); - * text(webglVersion, -14, 5); - * - * describe('The text "webgl" written in black on a gray background.'); - * } - * - *
                - */ - _main.default.prototype.webglVersion = C.P2D; - /** - * A numeric variable that stores the width of the screen display. Its value - * depends on the current pixelDensity(). - * `displayWidth` is useful for running full-screen programs. - * - * Note: The actual screen width can be computed as - * `displayWidth * pixelDensity()`. - * - * @property {Number} displayWidth - * @readOnly - * @example - *
                - * - * function setup() { - * // Set the canvas' width and height - * // using the display's dimensions. - * createCanvas(displayWidth, displayHeight); - * - * background(200); - * - * describe('A gray canvas that is the same size as the display.'); - * } - * - *
                - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.displayWidth = screen.width; - /** - * A numeric variable that stores the height of the screen display. Its value - * depends on the current pixelDensity(). - * `displayHeight` is useful for running full-screen programs. - * - * Note: The actual screen height can be computed as - * `displayHeight * pixelDensity()`. - * - * @property {Number} displayHeight - * @readOnly - * @example - *
                - * - * function setup() { - * // Set the canvas' width and height - * // using the display's dimensions. - * createCanvas(displayWidth, displayHeight); - * - * background(200); - * - * describe('A gray canvas that is the same size as the display.'); - * } - * - *
                - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.displayHeight = screen.height; - /** - * A numeric variable that stores the width of the browser's - * layout viewport. - * This viewport is the area within the browser that's available for drawing. - * - * @property {Number} windowWidth - * @readOnly - * @example - *
                - * - * function setup() { - * // Set the canvas' width and height - * // using the browser's dimensions. - * createCanvas(windowWidth, windowHeight); - * - * background(200); - * - * describe('A gray canvas that takes up the entire browser window.'); - * } - * - *
                - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.windowWidth = getWindowWidth(); - /** - * A numeric variable that stores the height of the browser's - * layout viewport. - * This viewport is the area within the browser that's available for drawing. - * - * @property {Number} windowHeight - * @readOnly - * @example - *
                - * - * function setup() { - * // Set the canvas' width and height - * // using the browser's dimensions. - * createCanvas(windowWidth, windowHeight); - * - * background(200); - * - * describe('A gray canvas that takes up the entire browser window.'); - * } - * - *
                - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.windowHeight = getWindowHeight(); - /** - * The code in `windowResized()` is called once each time the browser window - * is resized. It's a good place to resize the canvas or make other - * adjustments to accommodate the new window size. - * - * The `event` parameter is optional. If added to the function definition, it - * can be used for debugging or other purposes. - * - * @method windowResized - * @param {UIEvent} [event] optional resize Event. - * @example - *
                - * - * function setup() { - * createCanvas(windowWidth, windowHeight); - * } - * - * function draw() { - * background(200); - * - * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); - * } - * - * // Resize the canvas when the - * // browser's size changes. - * function windowResized() { - * resizeCanvas(windowWidth, windowHeight); - * } - * - *
                - * @alt - * This example does not render anything. - * - *
                - * - * function setup() { - * createCanvas(windowWidth, windowHeight); - * } - * - * function draw() { - * background(200); - * - * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); - * } - * - * function windowResized(event) { - * // Resize the canvas when the - * // browser's size changes. - * resizeCanvas(windowWidth, windowHeight); - * - * // Print the resize event to the console for debugging. - * print(event); - * } - * - *
                - * @alt - * This example does not render anything. - */ - _main.default.prototype._onresize = function (e) { - this._setProperty('windowWidth', getWindowWidth()); - this._setProperty('windowHeight', getWindowHeight()); - var context = this._isGlobal ? window : this; - var executeDefault; - if (typeof context.windowResized === 'function') { - executeDefault = context.windowResized(e); - if (executeDefault !== undefined && !executeDefault) { - e.preventDefault(); - } - } - }; - function getWindowWidth() { - return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth || 0; - } - function getWindowHeight() { - return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight || 0; - } /** - * A numeric variable that stores the width of the drawing canvas. Its - * default value is 100. - * - * Calling createCanvas() or - * resizeCanvas() changes the value of - * `width`. Calling noCanvas() sets its value to - * 0. - * - * @example - *
                - * - * function setup() { - * background(200); - * - * // Display the canvas' width. - * text(width, 42, 54); - * - * describe('The number 100 written in black on a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(50, 100); - * - * background(200); - * - * // Display the canvas' width. - * text(width, 21, 54); - * - * describe('The number 50 written in black on a gray rectangle.'); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100); - * - * background(200); - * - * // Display the canvas' width. - * text(width, 42, 54); - * - * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); - * } - * - * // If the mouse is pressed, reisze - * // the canvas and display its new - * // width. - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * resizeCanvas(50, 100); - * background(200); - * text(width, 42, 27); - * } - * } - * - *
                - * - * @property {Number} width - * @readOnly - */ - - _main.default.prototype.width = 0; - /** - * A numeric variable that stores the height of the drawing canvas. Its - * default value is 100. - * - * Calling createCanvas() or - * resizeCanvas() changes the value of - * `height`. Calling noCanvas() sets its value to - * 0. - * - * @example - *
                - * - * function setup() { - * background(200); - * - * // Display the canvas' height. - * text(height, 42, 54); - * - * describe('The number 100 written in black on a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 50); - * - * background(200); - * - * // Display the canvas' height. - * text(height, 21, 54); - * - * describe('The number 50 written in black on a gray rectangle.'); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100); - * - * background(200); - * - * // Display the canvas' height. - * text(height, 42, 54); - * - * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); - * } - * - * // If the mouse is pressed, reisze - * // the canvas and display its new - * // height. - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * resizeCanvas(100, 50); - * background(200); - * text(height, 42, 27); - * } - * } - * - *
                - * - * @property {Number} height - * @readOnly - */ - _main.default.prototype.height = 0; - /** - * Toggles full-screen mode or returns the current mode. - * - * Calling `fullscreen(true)` makes the sketch full-screen. Calling - * `fullscreen(false)` makes the sketch its original size. - * - * Calling `fullscreen()` without an argument returns `true` if the sketch - * is in full-screen mode and `false` if not. - * - * Note: Due to browser restrictions, `fullscreen()` can only be called with - * user input such as a mouse press. - * - * @method fullscreen - * @param {Boolean} [val] whether the sketch should be in fullscreen mode. - * @return {Boolean} current fullscreen state. - * @example - *
                - * - * function setup() { - * background(200); - * - * describe('A gray canvas that switches between default and full-screen display when clicked.'); - * } - * - * // If the mouse is pressed, - * // toggle full-screen mode. - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * let fs = fullscreen(); - * fullscreen(!fs); - * } - * } - * - *
                - */ - _main.default.prototype.fullscreen = function (val) { - _main.default._validateParameters('fullscreen', arguments); - // no arguments, return fullscreen or not - if (typeof val === 'undefined') { - return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement; - } else { - // otherwise set to fullscreen or not - if (val) { - launchFullscreen(document.documentElement); - } else { - exitFullscreen(); - } - } - }; - /** - * Sets the pixel scaling for high pixel density displays. - * - * By default, the pixel density is set to match display density. Calling - * `pixelDensity(1)` turn this off. - * - * Calling `pixelDensity()` without an argument returns the current pixel - * density. - * - * @method pixelDensity - * @param {Number} [val] desired pixel density. - * @chainable - * @example - *
                - * - * function setup() { - * // Set the pixel density to 1. - * pixelDensity(1); - * - * // Create a canvas and draw - * // a circle. - * createCanvas(100, 100); - * background(200); - * circle(50, 50, 70); - * - * describe('A fuzzy white circle on a gray canvas.'); - * } - * - *
                - * - *
                - * - * function setup() { - * // Set the pixel density to 3. - * pixelDensity(3); - * - * // Create a canvas, paint the - * // background, and draw a - * // circle. - * createCanvas(100, 100); - * background(200); - * circle(50, 50, 70); - * - * describe('A sharp white circle on a gray canvas.'); - * } - * - *
                - */ - /** - * @method pixelDensity - * @returns {Number} current pixel density of the sketch. - */ - _main.default.prototype.pixelDensity = function (val) { - _main.default._validateParameters('pixelDensity', arguments); - var returnValue; - if (typeof val === 'number') { - if (val !== this._pixelDensity) { - this._pixelDensity = val; - } - returnValue = this; - this.resizeCanvas(this.width, this.height, true); // as a side effect, it will clear the canvas - } else { - returnValue = this._pixelDensity; - } - return returnValue; - }; - /** - * Returns the display's current pixel density. - * - * @method displayDensity - * @returns {Number} current pixel density of the display. - * @example - *
                - * - * function setup() { - * // Set the pixel density to 1. - * pixelDensity(1); - * - * // Create a canvas and draw - * // a circle. - * createCanvas(100, 100); - * background(200); - * circle(50, 50, 70); - * - * describe('A fuzzy white circle drawn on a gray background. The circle becomes sharper when the mouse is pressed.'); - * } - * - * function mousePressed() { - * // Get the current display density. - * let d = displayDensity(); - * - * // Use the display density to set - * // the sketch's pixel density. - * pixelDensity(d); - * - * // Paint the background and - * // draw a circle. - * background(200); - * circle(50, 50, 70); - * } - * - *
                - */ - _main.default.prototype.displayDensity = function () { - return window.devicePixelRatio; - }; - function launchFullscreen(element) { - var enabled = document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled; - if (!enabled) { - throw new Error('Fullscreen not enabled in this browser.'); - } - if (element.requestFullscreen) { - element.requestFullscreen(); - } else if (element.mozRequestFullScreen) { - element.mozRequestFullScreen(); - } else if (element.webkitRequestFullscreen) { - element.webkitRequestFullscreen(); - } else if (element.msRequestFullscreen) { - element.msRequestFullscreen(); - } - } - function exitFullscreen() { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } - } /** - * Returns the sketch's current - * URL - * as a string. - * - * @method getURL - * @return {String} url - * @example - *
                - * - * function setup() { - * background(200); - * - * // Get the sketch's URL - * // and display it. - * let url = getURL(); - * textWrap(CHAR); - * text(url, 0, 40, 100); - * - * describe('The URL "https://p5js.org/reference/#/p5/getURL" written in black on a gray background.'); - * } - * - *
                - */ - - _main.default.prototype.getURL = function () { - return location.href; - }; - /** - * Returns the current - * URL - * path as an array of strings. - * - * For example, consider a sketch hosted at the URL - * `https://example.com/sketchbook`. Calling `getURLPath()` returns - * `['sketchbook']`. For a sketch hosted at the URL - * `https://example.com/sketchbook/monday`, `getURLPath()` returns - * `['sketchbook', 'monday']`. - * - * @method getURLPath - * @return {String[]} path components. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Get the sketch's URL path - * // and display the first - * // part. - * let path = getURLPath(); - * text(path[0], 25, 54); - * - * describe('The word "reference" written in black on a gray background.'); - * } - * - *
                - */ - _main.default.prototype.getURLPath = function () { - return location.pathname.split('/').filter(function (v) { - return v !== ''; - }); - }; - /** - * Returns the current - * URL parameters - * in an Object. - * - * For example, calling `getURLParams()` in a sketch hosted at the URL - * `http://p5js.org?year=2014&month=May&day=15` returns - * `{ year: 2014, month: 'May', day: 15 }`. - * - * @method getURLParams - * @return {Object} URL params - * @example - *
                - * - * // Imagine this sketch is hosted at the following URL: - * // https://p5js.org?year=2014&month=May&day=15 - * - * function setup() { - * background(200); - * - * // Get the sketch's URL - * // parameters and display - * // them. - * let params = getURLParams(); - * text(params.day, 10, 20); - * text(params.month, 10, 40); - * text(params.year, 10, 60); - * - * describe('The text "15", "May", and "2014" written in black on separate lines.'); - * } - * - *
                - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.getURLParams = function () { - var re = /[?&]([^&=]+)(?:[&=])([^&=]+)/gim; - var m; - var v = { - }; - while ((m = re.exec(location.search)) != null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - v[m[1]] = m[2]; - } - return v; - }; - var _default = _main.default; - exports.default = _default; - }, - { - './constants': 286, - './main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.search': 215, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 288: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - // This contains a data table used by ./fes_core.js/fesErrorMonitor(). - // - // Note: Different browsers use different error strings for the same error. - // Extracting info from the browser error messages is easier and cleaner - // if we have a predefined lookup. This file serves as that lookup. - // Using this lookup we match the errors obtained from the browser, classify - // them into types and extract the required information. - // The FES can use the extracted info to generate a friendly error message - // for the matching error. - var strings = { - ReferenceError: [ - { - msg: '{{}} is not defined', - type: 'NOTDEFINED', - browser: 'all' - }, - { - msg: 'Can\'t find variable: {{}}', - type: 'NOTDEFINED', - browser: 'Safari' - }, - { - msg: 'Cannot access \'{{.}}\' before initialization', - type: 'CANNOTACCESS', - browser: 'Chrome' - }, - { - msg: 'can\'t access lexical declaration \'{{.}}\' before initialization', - type: 'CANNOTACCESS', - browser: 'Firefox' - } - ], - SyntaxError: [ - { - msg: 'illegal character', - type: 'INVALIDTOKEN', - browser: 'Firefox' - }, - { - msg: 'Invalid character', - type: 'INVALIDTOKEN', - browser: 'Safari' - }, - { - msg: 'Invalid or unexpected token', - type: 'INVALIDTOKEN', - browser: 'Chrome' - }, - { - msg: 'Unexpected token \'{{.}}\'', - type: 'UNEXPECTEDTOKEN', - browser: 'Chrome' - }, - { - msg: 'expected {{.}}, got \'{{.}}\'', - type: 'UNEXPECTEDTOKEN', - browser: 'Chrome' - }, - { - msg: 'Identifier \'{{.}}\' has already been declared', - type: 'REDECLAREDVARIABLE', - browser: 'Chrome' - }, - { - msg: 'redeclaration of {} {{.}}', - type: 'REDECLAREDVARIABLE', - browser: 'Firefox' - }, - { - msg: 'Missing initializer in const declaration', - type: 'MISSINGINITIALIZER', - browser: 'Chrome' - }, - { - msg: 'missing = in const declaration', - type: 'MISSINGINITIALIZER', - browser: 'Firefox' - }, - { - msg: 'Illegal return statement', - type: 'BADRETURNORYIELD', - browser: 'Chrome' - }, - { - msg: 'return not in function', - type: 'BADRETURNORYIELD', - browser: 'Firefox' - } - ], - TypeError: [ - { - msg: '{{.}} is not a function', - type: 'NOTFUNC', - browser: 'all' - }, - { - msg: 'Cannot read {{.}} null', - type: 'READNULL', - browser: 'Chrome' - }, - { - msg: '{{.}} is null', - type: 'READNULL', - browser: 'Firefox' - }, - { - msg: 'Cannot read {{.}} undefined', - type: 'READUDEFINED', - browser: 'Chrome' - }, - { - msg: '{{.}} is undefined', - type: 'READUDEFINED', - browser: 'Firefox' - }, - { - msg: 'Assignment to constant variable', - type: 'CONSTASSIGN', - browser: 'Chrome' - }, - { - msg: 'invalid assignment to const \'{{.}}\'', - type: 'CONSTASSIGN', - browser: 'Firefox' - } - ] - }; - var _default = strings; - exports.default = _default; - }, - { - } - ], - 289: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.get-own-property-names'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.starts-with'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.get-own-property-names'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.starts-with'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var _internationalization = _dereq_('../internationalization'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError('Invalid attempt to destructure non-iterable instance'); - } - function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === '[object Arguments]')) { - return; - } - var _arr = [ - ]; - var _n = true; - var _d = false; - var _e = undefined; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i['return'] != null) _i['return'](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @for p5 - * @requires core - * - * This is the main file for the Friendly Error System (FES), containing - * the core as well as miscellaneous functionality of the FES. Here is a - * brief outline of the functions called in this system. - * - * The FES may be invoked by a call to either - * (1) _validateParameters, (2) _friendlyFileLoadError, (3) _friendlyError, - * (4) helpForMisusedAtTopLevelCode, or (5) _fesErrorMonitor. - * - * _validateParameters is located in validate_params.js along with other code - * used for parameter validation. - * _friendlyFileLoadError is located in file_errors.js along with other code - * used for dealing with file load errors. - * Apart from this, there's also a file stacktrace.js, which contains the code - * to parse the error stack, borrowed from: - * https://github.com/stacktracejs/stacktrace.js - * - * For more detailed information on the FES functions, including the call - * sequence of each function, please look at the FES Reference + Dev Notes: - * https://github.com/processing/p5.js/blob/main/contributor_docs/fes_reference_dev_notes.md - */ - // p5.js blue, p5.js orange, auto dark green; fallback p5.js darkened magenta - // See testColors below for all the color codes and names - - var typeColors = [ - '#2D7BB6', - '#EE9900', - '#4DB200', - '#C83C00' - ]; - var misusedAtTopLevelCode = null; - var defineMisusedAtTopLevelCode = null; - // the threshold for the maximum allowed levenshtein distance - // used in misspelling detection - var EDIT_DIST_THRESHOLD = 2; - // to enable or disable styling (color, font-size, etc. ) for fes messages - var ENABLE_FES_STYLING = false; - if (typeof IS_MINIFIED !== 'undefined') { - _main.default._friendlyError = _main.default._checkForUserDefinedFunctions = _main.default._fesErrorMonitor = function () { - }; - } else { - var doFriendlyWelcome = false; // TEMP until we get it all working LM - var errorTable = _dereq_('./browser_errors').default; - // -- Borrowed from jQuery 1.11.3 -- - var class2type = { - }; - var _toString = class2type.toString; - var names = [ - 'Boolean', - 'Number', - 'String', - 'Function', - 'Array', - 'Date', - 'RegExp', - 'Object', - 'Error' - ]; - for (var n = 0; n < names.length; n++) { - class2type['[object '.concat(names[n], ']')] = names[n].toLowerCase(); - } - var getType = function getType(obj) { - if (obj == null) { - return ''.concat(obj); - } - return _typeof(obj) === 'object' || typeof obj === 'function' ? class2type[_toString.call(obj)] || 'object' : _typeof(obj); - }; - // -- End borrow -- - // entry points into user-defined code - var entryPoints = [ - 'setup', - 'draw', - 'preload', - 'deviceMoved', - 'deviceTurned', - 'deviceShaken', - 'doubleClicked', - 'mousePressed', - 'mouseReleased', - 'mouseMoved', - 'mouseDragged', - 'mouseClicked', - 'mouseWheel', - 'touchStarted', - 'touchMoved', - 'touchEnded', - 'keyPressed', - 'keyReleased', - 'keyTyped', - 'windowResized' - ]; - var friendlyWelcome = function friendlyWelcome() { - // p5.js brand - magenta: #ED225D - //const astrixBgColor = 'transparent'; - //const astrixTxtColor = '#ED225D'; - //const welcomeBgColor = '#ED225D'; - //const welcomeTextColor = 'white'; - var welcomeMessage = (0, _internationalization.translator) ('fes.pre', { - message: (0, _internationalization.translator) ('fes.welcome') - }); - console.log(' _ \n' + ' /\\| |/\\ \n' + ' \\ ` \' / \n' + ' / , . \\ \n' + ' \\/|_|\\/ ' + '\n\n' + welcomeMessage); - }; - /** - * Takes a message and a p5 function func, and adds a link pointing to - * the reference documentation of func at the end of the message - * - * @method mapToReference - * @private - * @param {String} message the words to be said - * @param {String} [func] the name of function - * - * @returns {String} - */ - var mapToReference = function mapToReference(message, func) { - var msgWithReference = ''; - if (func == null || func.substring(0, 4) === 'load') { - msgWithReference = message; - } else { - var methodParts = func.split('.'); - var referenceSection = methodParts.length > 1 ? ''.concat(methodParts[0], '.').concat(methodParts[1]) : 'p5'; - var funcName = methodParts.length === 1 ? func : methodParts.slice(2).join('/'); - //Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link - funcName.startsWith('p5.') ? msgWithReference = ''.concat(message, ' (http://p5js.org/reference/#/').concat(referenceSection, '.').concat(funcName, ')') : msgWithReference = ''.concat(message, ' (http://p5js.org/reference/#/').concat(referenceSection, '/').concat(funcName, ')'); - } - return msgWithReference; - }; - /** - * Prints out a fancy, colorful message to the console log - * Attaches Friendly Errors prefix [fes.pre] to the message. - * - * @method _report - * @private - * @param {String} message Message to be printed - * @param {String} [func] Name of function - * @param {Number|String} [color] CSS color code - * - * @return console logs - */ - _main.default._report = function (message, func, color) { - // if p5._fesLogger is set ( i.e we are running tests ), use that - // instead of console.log - var log = _main.default._fesLogger == null ? console.log.bind(console) : _main.default._fesLogger; - if (doFriendlyWelcome) { - friendlyWelcome(); - doFriendlyWelcome = false; - } - if ('undefined' === getType(color)) { - color = '#B40033'; // dark magenta - } else if (getType(color) === 'number') { - // Type to color - color = typeColors[color]; - } // Add a link to the reference docs of func at the end of the message - - message = mapToReference(message, func); - var style = [ - 'color: '.concat(color), - 'font-family: Arial', - 'font-size: larger' - ]; - var prefixedMsg = (0, _internationalization.translator) ('fes.pre', { - message: message - }); - if (ENABLE_FES_STYLING) { - log('%c' + prefixedMsg, style.join(';')); - } else { - log(prefixedMsg); - } - }; - /** - * This is a generic method that can be called from anywhere in the p5 - * library to alert users to a common error. - * - * @method _friendlyError - * @private - * @param {String} message Message to be printed - * @param {String} [func] Name of the function linked to error - * @param {Number|String} [color] CSS color code - */ - _main.default._friendlyError = function (message, func, color) { - _main.default._report(message, func, color); - }; - /** - * This is called internally if there is an error with autoplay. Generates - * and prints a friendly error message [fes.autoplay]. - * - * @method _friendlyAutoplayError - * @private - */ - _main.default._friendlyAutoplayError = function (src) { - var message = (0, _internationalization.translator) ('fes.autoplay', { - src: src, - url: 'https://developer.mozilla.org/docs/Web/Media/Autoplay_guide' - }); - console.log((0, _internationalization.translator) ('fes.pre', { - message: message - })); - }; - /** - * Measures dissimilarity between two strings by calculating - * the Levenshtein distance. - * - * If the "distance" between them is small enough, it is - * reasonable to think that one is the misspelled version of the other. - * - * Specifically, this uses the Wagner–Fischer algorithm. - * @method computeEditDistance - * @private - * @param {String} w1 the first word - * @param {String} w2 the second word - * - * @returns {Number} the "distance" between the two words, a smaller value - * indicates that the words are similar - */ - var computeEditDistance = function computeEditDistance(w1, w2) { - var l1 = w1.length, - l2 = w2.length; - if (l1 === 0) return w2; - if (l2 === 0) return w1; - var prev = [ - ]; - var cur = [ - ]; - for (var j = 0; j < l2 + 1; j++) { - cur[j] = j; - } - prev = cur; - for (var i = 1; i < l1 + 1; i++) { - cur = [ - ]; - for (var _j = 0; _j < l2 + 1; _j++) { - if (_j === 0) { - cur[_j] = i; - } else { - var a1 = w1[i - 1], - a2 = w2[_j - 1]; - var temp = 999999; - var cost = a1.toLowerCase() === a2.toLowerCase() ? 0 : 1; - temp = temp > cost + prev[_j - 1] ? cost + prev[_j - 1] : temp; - temp = temp > 1 + cur[_j - 1] ? 1 + cur[_j - 1] : temp; - temp = temp > 1 + prev[_j] ? 1 + prev[_j] : temp; - cur[_j] = temp; - } - } - prev = cur; - } - return cur[l2]; - }; - /** - * Checks capitalization for user defined functions. - * - * Generates and prints a friendly error message using key: - * "fes.checkUserDefinedFns". - * - * @method checkForUserDefinedFunctions - * @private - * @param {*} context Current default context. Set to window in - * "global mode" and to a p5 instance in "instance mode" - */ - var checkForUserDefinedFunctions = function checkForUserDefinedFunctions(context) { - if (_main.default.disableFriendlyErrors) return; - // if using instance mode, this function would be called with the current - // instance as context - var instanceMode = context instanceof _main.default; - context = instanceMode ? context : window; - var fnNames = entryPoints; - var fxns = { - }; - // lowercasename -> actualName mapping - fnNames.forEach(function (symbol) { - fxns[symbol.toLowerCase()] = symbol; - }); - for (var _i = 0, _Object$keys = Object.keys(context); _i < _Object$keys.length; _i++) { - var prop = _Object$keys[_i]; - var lowercase = prop.toLowerCase(); - // check if the lowercase property name has an entry in fxns, if the - // actual name with correct capitalization doesnt exist in context, - // and if the user-defined symbol is of the type function - if (fxns[lowercase] && !context[fxns[lowercase]] && typeof context[prop] === 'function') { - var msg = (0, _internationalization.translator) ('fes.checkUserDefinedFns', { - name: prop, - actualName: fxns[lowercase] - }); - _main.default._friendlyError(msg, fxns[lowercase]); - } - } - }; - /** - * Compares the symbol caught in the ReferenceError to everything in - * misusedAtTopLevel ( all public p5 properties ). - * - * Generates and prints a friendly error message using key: "fes.misspelling". - * - * @method handleMisspelling - * @private - * @param {String} errSym Symbol to whose spelling to check - * @param {Error} error ReferenceError object - * - * @returns {Boolean} tell whether error was likely due to typo - */ - var handleMisspelling = function handleMisspelling(errSym, error) { - if (!misusedAtTopLevelCode) { - defineMisusedAtTopLevelCode(); - } - var distanceMap = { - }; - var min = 999999; - // compute the levenshtein distance for the symbol against all known - // public p5 properties. Find the property with the minimum distance - misusedAtTopLevelCode.forEach(function (symbol) { - var dist = computeEditDistance(errSym, symbol.name); - if (distanceMap[dist]) distanceMap[dist].push(symbol); - else distanceMap[dist] = [ - symbol - ]; - if (dist < min) min = dist; - }); - // if the closest match has more "distance" than the max allowed threshold - if (min > Math.min(EDIT_DIST_THRESHOLD, errSym.length)) return false; - // Show a message only if the caught symbol and the matched property name - // differ in their name ( either letter difference or difference of case ) - var matchedSymbols = distanceMap[min].filter(function (symbol) { - return symbol.name !== errSym; - }); - if (matchedSymbols.length !== 0) { - var parsed = _main.default._getErrorStackParser().parse(error); - var locationObj; - if (parsed && parsed[0] && parsed[0].fileName && parsed[0].lineNumber && parsed[0].columnNumber) { - locationObj = { - location: ''.concat(parsed[0].fileName, ':').concat(parsed[0].lineNumber, ':').concat(parsed[0].columnNumber), - file: parsed[0].fileName.split('/').slice( - 1), - line: parsed[0].lineNumber - }; - } - var msg; - if (matchedSymbols.length === 1) { - // To be used when there is only one closest match. The count parameter - // allows i18n to pick between the keys "fes.misspelling" and - // "fes.misspelling_plural" - msg = (0, _internationalization.translator) ('fes.misspelling', { - name: errSym, - actualName: matchedSymbols[0].name, - type: matchedSymbols[0].type, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', - count: matchedSymbols.length - }); - } else { - // To be used when there are multiple closest matches. Gives each - // suggestion on its own line, the function name followed by a link to - // reference documentation - var suggestions = matchedSymbols.map(function (symbol) { - var message = '▶️ ' + symbol.name + (symbol.type === 'function' ? '()' : ''); - return mapToReference(message, symbol.name); - }).join('\n'); - msg = (0, _internationalization.translator) ('fes.misspelling', { - name: errSym, - suggestions: suggestions, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', - count: matchedSymbols.length - }); - } // If there is only one closest match, tell _friendlyError to also add - // a link to the reference documentation. In case of multiple matches, - // this is already done in the suggestions variable, one link for each - // suggestion. - - _main.default._friendlyError(msg, matchedSymbols.length === 1 ? matchedSymbols[0].name : undefined); - return true; - } - return false; - }; - /** - * Prints a friendly stacktrace for user-written functions for "global" errors - * - * Generates and prints a friendly error message using key: - * "fes.globalErrors.stackTop", "fes.globalErrors.stackSubseq". - * - * @method printFriendlyStack - * @private - * @param {Array} friendlyStack - */ - var printFriendlyStack = function printFriendlyStack(friendlyStack) { - var log = _main.default._fesLogger && typeof _main.default._fesLogger === 'function' ? _main.default._fesLogger : console.log.bind(console); - if (friendlyStack.length > 1) { - var stacktraceMsg = ''; - friendlyStack.forEach(function (frame, idx) { - var location = ''.concat(frame.fileName, ':').concat(frame.lineNumber, ':').concat(frame.columnNumber); - var frameMsg, - translationObj = { - func: frame.functionName, - line: frame.lineNumber, - location: location, - file: frame.fileName.split('/').slice( - 1) - }; - if (idx === 0) { - frameMsg = (0, _internationalization.translator) ('fes.globalErrors.stackTop', translationObj); - } else { - frameMsg = (0, _internationalization.translator) ('fes.globalErrors.stackSubseq', translationObj); - } - stacktraceMsg += frameMsg; - }); - log(stacktraceMsg); - } - }; - /** - * Takes a stacktrace array and filters out all frames that show internal p5 - * details. - * - * Generates and prints a friendly error message using key: - * "fes.wrongPreload", "fes.libraryError". - * - * The processed stack is used to find whether the error happened internally - * within the library, and if the error was due to a non-loadX() method - * being used in preload. - * - * "Internally" here means that the exact location of the error (the top of - * the stack) is a piece of code written in the p5.js library (which may or - * may not have been called from the user's sketch). - * - * @method processStack - * @private - * @param {Error} error - * @param {Array} stacktrace - * - * @returns {Array} An array with two elements, [isInternal, friendlyStack] - * isInternal: a boolean value indicating whether the error - * happened internally - * friendlyStack: the filtered (simplified) stacktrace - */ - var processStack = function processStack(error, stacktrace) { - // cannot process a stacktrace that doesn't exist - if (!stacktrace) return [false, - null]; - stacktrace.forEach(function (frame) { - frame.functionName = frame.functionName || ''; - }); - // isInternal - Did this error happen inside the library - var isInternal = false; - var p5FileName, - friendlyStack, - currentEntryPoint; - // Intentionally throw an error that we catch so that we can check the name - // of the current file. Any errors we see from this file, we treat as - // internal errors. - try { - throw new Error(); - } catch (testError) { - var testStacktrace = _main.default._getErrorStackParser().parse(testError); - p5FileName = testStacktrace[0].fileName; - } - for (var i = stacktrace.length - 1; i >= 0; i--) { - var splitted = stacktrace[i].functionName.split('.'); - if (entryPoints.includes(splitted[splitted.length - 1])) { - // remove everything below an entry point function (setup, draw, etc). - // (it's usually the internal initialization calls) - friendlyStack = stacktrace.slice(0, i + 1); - currentEntryPoint = splitted[splitted.length - 1]; - // We call the error "internal" if the source of the error was a - // function from within the p5.js library file, but called from the - // user's code directly. We only need to check the topmost frame in - // the stack trace since any function internal to p5 should pass this - // check, not just public p5 functions. - if (stacktrace[0].fileName === p5FileName) { - isInternal = true; - break; - } - break; - } - } // in some cases ( errors in promises, callbacks, etc), no entry-point - // function may be found in the stacktrace. In that case just use the - // entire stacktrace for friendlyStack - - if (!friendlyStack) friendlyStack = stacktrace; - if (isInternal) { - // the frameIndex property is added before the filter, so frameIndex - // corresponds to the index of a frame in the original stacktrace. - // Then we filter out all frames which belong to the file that contains - // the p5 library - friendlyStack = friendlyStack.map(function (frame, index) { - frame.frameIndex = index; - return frame; - }).filter(function (frame) { - return frame.fileName !== p5FileName; - }); - // a weird case, if for some reason we can't identify the function called - // from user's code - if (friendlyStack.length === 0) return [true, - null]; - // get the function just above the topmost frame in the friendlyStack. - // i.e the name of the library function called from user's code - var func = stacktrace[friendlyStack[0].frameIndex - 1].functionName.split('.').slice( - 1) [0]; - // Try and get the location (line no.) from the top element of the stack - var locationObj; - if (friendlyStack[0].fileName && friendlyStack[0].lineNumber && friendlyStack[0].columnNumber) { - locationObj = { - location: ''.concat(friendlyStack[0].fileName, ':').concat(friendlyStack[0].lineNumber, ':').concat(friendlyStack[0].columnNumber), - file: friendlyStack[0].fileName.split('/').slice( - 1), - line: friendlyStack[0].lineNumber - }; - // if already handled by another part of the FES, don't handle again - if (_main.default._fesLogCache[locationObj.location]) return [true, - null]; - } // Check if the error is due to a non loadX method being used incorrectly - // in preload - - if (currentEntryPoint === 'preload' && _main.default.prototype._preloadMethods[func] == null) { - _main.default._friendlyError((0, _internationalization.translator) ('fes.wrongPreload', { - func: func, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', - error: error.message - }), 'preload'); - } else { - // Library error - _main.default._friendlyError((0, _internationalization.translator) ('fes.libraryError', { - func: func, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', - error: error.message - }), func); - } // Finally, if it's an internal error, print the friendlyStack - // ( fesErrorMonitor won't handle this error ) - - if (friendlyStack && friendlyStack.length) { - printFriendlyStack(friendlyStack); - } - } - return [isInternal, - friendlyStack]; - }; - /** - * Handles "global" errors that the browser catches. - * - * Called when an error event happens and detects the type of error. - * - * Generates and prints a friendly error message using key: - * "fes.globalErrors.syntax.[*]", "fes.globalErrors.reference.[*]", - * "fes.globalErrors.type.[*]". - * - * @method fesErrorMonitor - * @private - * @param {*} e Event object to extract error details from - */ - var fesErrorMonitor = function fesErrorMonitor(e) { - if (_main.default.disableFriendlyErrors) return; - // Try to get the error object from e - var error; - if (e instanceof Error) { - error = e; - } else if (e instanceof ErrorEvent) { - error = e.error; - } else if (e instanceof PromiseRejectionEvent) { - error = e.reason; - if (!(error instanceof Error)) return; - } - if (!error) return; - var stacktrace = _main.default._getErrorStackParser().parse(error); - // process the stacktrace from the browser and simplify it to give - // friendlyStack. - var _processStack = processStack(error, stacktrace), - _processStack2 = _slicedToArray(_processStack, 2), - isInternal = _processStack2[0], - friendlyStack = _processStack2[1]; // if this is an internal library error, the type of the error is not relevant, - // only the user code that lead to it is. - if (isInternal) { - return; - } - var errList = errorTable[error.name]; - if (!errList) return; // this type of error can't be handled yet - var matchedError; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = errList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var obj = _step.value; - var string = obj.msg; - // capture the primary symbol mentioned in the error - string = string.replace(new RegExp('{{}}', 'g'), '([a-zA-Z0-9_]+)'); - string = string.replace(new RegExp('{{.}}', 'g'), '(.+)'); - string = string.replace(new RegExp('{}', 'g'), '(?:[a-zA-Z0-9_]+)'); - var matched = error.message.match(string); - if (matched) { - matchedError = Object.assign({ - }, obj); - matchedError.match = matched; - break; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - if (!matchedError) return; - // Try and get the location from the top element of the stack - var locationObj; - if (stacktrace && stacktrace[0].fileName && stacktrace[0].lineNumber && stacktrace[0].columnNumber) { - locationObj = { - location: ''.concat(stacktrace[0].fileName, ':').concat(stacktrace[0].lineNumber, ':').concat(stacktrace[0].columnNumber), - file: stacktrace[0].fileName.split('/').slice( - 1), - line: friendlyStack[0].lineNumber - }; - } - switch (error.name) { - case 'SyntaxError': - { - // We can't really do much with syntax errors other than try to use - // a simpler framing of the error message. The stack isn't available - // for syntax errors - switch (matchedError.type) { - case 'INVALIDTOKEN': - { - //Error if there is an invalid or unexpected token that doesn't belong at this position in the code - //let x = “not a string”; -> string not in proper quotes - var url = 'https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character#What_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.invalidToken', { - url: url - })); - break; - } - case 'UNEXPECTEDTOKEN': - { - //Error if a specific language construct(, { ; etc) was expected, but something else was provided - //for (let i = 0; i < 5,; ++i) -> a comma after i<5 instead of a semicolon - var _url = 'https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Unexpected_token#What_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.unexpectedToken', { - url: _url - })); - break; - } - case 'REDECLAREDVARIABLE': - { - //Error if a variable is redeclared by the user. Example=> - //let a = 10; - //let a = 100; - var errSym = matchedError.match[1]; - var _url2 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter#what_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.redeclaredVariable', { - symbol: errSym, - url: _url2 - })); - break; - } - case 'MISSINGINITIALIZER': - { - //Error if a const variable is not initialized during declaration - //Example => const a; - var _url3 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const#what_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.missingInitializer', { - url: _url3 - })); - break; - } - case 'BADRETURNORYIELD': - { - //Error when a return statement is misplaced(usually outside of a function) - // const a = function(){ - // ..... - // } - // return; -> misplaced return statement - var _url4 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return_or_yield#what_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.badReturnOrYield', { - url: _url4 - })); - break; - } - } - break; - } - case 'ReferenceError': - { - switch (matchedError.type) { - case 'NOTDEFINED': - { - //Error if there is a non-existent variable referenced somewhere - //let a = 10; - //console.log(x); - var _errSym = matchedError.match[1]; - if (_errSym && handleMisspelling(_errSym, error)) { - break; - } // if the flow gets this far, this is likely not a misspelling - // of a p5 property/function - - var _url5 = 'https://p5js.org/examples/data-variable-scope.html'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.reference.notDefined', { - url: _url5, - symbol: _errSym, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' - })); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case 'CANNOTACCESS': - { - //Error if a lexical variable was accessed before it was initialized - //console.log(a); -> variable accessed before it was initialized - //let a=100; - var _errSym2 = matchedError.match[1]; - var _url6 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init#what_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.reference.cannotAccess', { - url: _url6, - symbol: _errSym2, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' - })); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - } - break; - } - case 'TypeError': - { - switch (matchedError.type) { - case 'NOTFUNC': - { - //Error when some code expects you to provide a function, but that didn't happen - //let a = document.getElementByID('foo'); -> getElementById instead of getElementByID - var _errSym3 = matchedError.match[1]; - var splitSym = _errSym3.split('.'); - var _url7 = 'https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_a_function#What_went_wrong'; - // if errSym is aa.bb.cc , symbol would be cc and obj would aa.bb - var translationObj = { - url: _url7, - symbol: splitSym[splitSym.length - 1], - obj: splitSym.slice(0, splitSym.length - 1).join('.'), - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' - }; - // There are two cases to handle here. When the function is called - // as a property of an object and when it's called independently. - // Both have different explanations. - if (splitSym.length > 1) { - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.notfuncObj', translationObj)); - } else { - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.notfunc', translationObj)); - } - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case 'READNULL': - { - //Error if a property of null is accessed - //let a = null; - //console.log(a.property); -> a is null - var _errSym4 = matchedError.match[1]; - var _url8 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong'; - /*let url2 = - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null';*/ - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.readFromNull', { - url: _url8, - symbol: _errSym4, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' - })); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case 'READUDEFINED': - { - //Error if a property of undefined is accessed - //let a; -> default value of a is undefined - //console.log(a.property); -> a is undefined - var _errSym5 = matchedError.match[1]; - var _url9 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong'; - /*let url2 = - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined#description';*/ - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.readFromUndefined', { - url: _url9, - symbol: _errSym5, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' - })); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case 'CONSTASSIGN': - { - //Error when a const variable is reassigned a value - //const a = 100; - //a=10; - var _url10 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment#what_went_wrong'; - _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.constAssign', { - url: _url10, - location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' - })); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - } - } - } - }; - _main.default._fesErrorMonitor = fesErrorMonitor; - _main.default._checkForUserDefinedFunctions = checkForUserDefinedFunctions; - // logger for testing purposes. - _main.default._fesLogger = null; - _main.default._fesLogCache = { - }; - window.addEventListener('load', checkForUserDefinedFunctions, false); - window.addEventListener('error', _main.default._fesErrorMonitor, false); - window.addEventListener('unhandledrejection', _main.default._fesErrorMonitor, false); - /** - * Prints out all the colors in the color pallete with white text. - * For color blindness testing. - */ - /* function testColors() { - const str = 'A box of biscuits, a box of mixed biscuits and a biscuit mixer'; - p5._friendlyError(str, 'print', '#ED225D'); // p5.js magenta - p5._friendlyError(str, 'print', '#2D7BB6'); // p5.js blue - p5._friendlyError(str, 'print', '#EE9900'); // p5.js orange - p5._friendlyError(str, 'print', '#A67F59'); // p5.js light brown - p5._friendlyError(str, 'print', '#704F21'); // p5.js gold - p5._friendlyError(str, 'print', '#1CC581'); // auto cyan - p5._friendlyError(str, 'print', '#FF6625'); // auto orange - p5._friendlyError(str, 'print', '#79EB22'); // auto green - p5._friendlyError(str, 'print', '#B40033'); // p5.js darkened magenta - p5._friendlyError(str, 'print', '#084B7F'); // p5.js darkened blue - p5._friendlyError(str, 'print', '#945F00'); // p5.js darkened orange - p5._friendlyError(str, 'print', '#6B441D'); // p5.js darkened brown - p5._friendlyError(str, 'print', '#2E1B00'); // p5.js darkened gold - p5._friendlyError(str, 'print', '#008851'); // auto dark cyan - p5._friendlyError(str, 'print', '#C83C00'); // auto dark orange - p5._friendlyError(str, 'print', '#4DB200'); // auto dark green - } */ - } // This is a lazily-defined list of p5 symbols that may be - // misused by beginners at top-level code, outside of setup/draw. We'd like - // to detect these errors and help the user by suggesting they move them - // into setup/draw. - // - // For more details, see https://github.com/processing/p5.js/issues/1121. - - misusedAtTopLevelCode = null; - var FAQ_URL = 'https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup'; - /** - * A helper function for populating misusedAtTopLevel list. - * - * @method defineMisusedAtTopLevelCode - * @private - */ - defineMisusedAtTopLevelCode = function defineMisusedAtTopLevelCode() { - var uniqueNamesFound = { - }; - var getSymbols = function getSymbols(obj) { - return Object.getOwnPropertyNames(obj).filter(function (name) { - if (name[0] === '_') { - return false; - } - if (name in uniqueNamesFound) { - return false; - } - uniqueNamesFound[name] = true; - return true; - }).map(function (name) { - var type; - if (typeof obj[name] === 'function') { - type = 'function'; - } else if (name === name.toUpperCase()) { - type = 'constant'; - } else { - type = 'variable'; - } - return { - name: name, - type: type - }; - }); - }; - misusedAtTopLevelCode = [ - ].concat(getSymbols(_main.default.prototype), // At present, p5 only adds its constants to p5.prototype during - // construction, which may not have happened at the time a - // ReferenceError is thrown, so we'll manually add them to our list. - getSymbols(_dereq_('../constants'))); - // This will ultimately ensure that we report the most specific error - // possible to the user, e.g. advising them about HALF_PI instead of PI - // when their code misuses the former. - misusedAtTopLevelCode.sort(function (a, b) { - return b.name.length - a.name.length; - }); - }; - /** - * Detects browser level error event for p5 constants/functions used outside - * of setup() and draw(). - * - * Generates and prints a friendly error message using key: - * "fes.misusedTopLevel". - * - * @method helpForMisusedAtTopLevelCode - * @private - * @param {Event} e Error event - * @param {Boolean} log false - * - * @returns {Boolean} true - */ - var helpForMisusedAtTopLevelCode = function helpForMisusedAtTopLevelCode(e, log) { - if (!log) { - log = console.log.bind(console); - } - if (!misusedAtTopLevelCode) { - defineMisusedAtTopLevelCode(); - } // If we find that we're logging lots of false positives, we can - // uncomment the following code to avoid displaying anything if the - // user's code isn't likely to be using p5's global mode. (Note that - // setup/draw are more likely to be defined due to JS function hoisting.) - // - //if (!('setup' in window || 'draw' in window)) { - // return; - //} - - misusedAtTopLevelCode.some(function (symbol) { - // Note that while just checking for the occurrence of the - // symbol name in the error message could result in false positives, - // a more rigorous test is difficult because different browsers - // log different messages, and the format of those messages may - // change over time. - // - // For example, if the user uses 'PI' in their code, it may result - // in any one of the following messages: - // - // * 'PI' is undefined (Microsoft Edge) - // * ReferenceError: PI is undefined (Firefox) - // * Uncaught ReferenceError: PI is not defined (Chrome) - if (e.message && e.message.match('\\W?'.concat(symbol.name, '\\W')) !== null) { - var symbolName = symbol.type === 'function' ? ''.concat(symbol.name, '()') : symbol.name; - if (typeof IS_MINIFIED !== 'undefined') { - log('Did you just try to use p5.js\'s '.concat(symbolName, ' ').concat(symbol.type, '? If so, you may want to move it into your sketch\'s setup() function.\n\nFor more details, see: ').concat(FAQ_URL)); - } else { - log((0, _internationalization.translator) ('fes.misusedTopLevel', { - symbolName: symbolName, - symbolType: symbol.type, - url: FAQ_URL - })); - } - return true; - } - }); - }; - // Exposing this primarily for unit testing. - _main.default.prototype._helpForMisusedAtTopLevelCode = helpForMisusedAtTopLevelCode; - if (document.readyState !== 'complete') { - window.addEventListener('error', helpForMisusedAtTopLevelCode, false); - // Our job is only to catch ReferenceErrors that are thrown when - // global (non-instance mode) p5 APIs are used at the top-level - // scope of a file, so we'll unbind our error listener now to make - // sure we don't log false positives later. - window.addEventListener('load', function () { - window.removeEventListener('error', helpForMisusedAtTopLevelCode, false); - }); - } - var _default = _main.default; - exports.default = _default; - }, - { - '../constants': 286, - '../internationalization': 296, - '../main': 298, - './browser_errors': 288, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.some': 184, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.object.assign': 194, - 'core-js/modules/es.object.get-own-property-names': 197, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.constructor': 204, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.match': 211, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.starts-with': 217, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 290: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var _internationalization = _dereq_('../internationalization'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @for p5 - * @requires core - */ - - if (typeof IS_MINIFIED !== 'undefined') { - _main.default._friendlyFileLoadError = function () { - }; - } else { - // mapping used by `_friendlyFileLoadError` - var fileLoadErrorCases = function fileLoadErrorCases(num, filePath) { - var suggestion = (0, _internationalization.translator) ('fes.fileLoadError.suggestion', { - filePath: filePath, - url: 'https://github.com/processing/p5.js/wiki/Local-server' - }); - switch (num) { - case 0: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.image', { - suggestion: suggestion - }), - method: 'loadImage' - }; - case 1: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.xml', { - suggestion: suggestion - }), - method: 'loadXML' - }; - case 2: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.table', { - suggestion: suggestion - }), - method: 'loadTable' - }; - case 3: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.strings', { - suggestion: suggestion - }), - method: 'loadStrings' - }; - case 4: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.font', { - suggestion: suggestion - }), - method: 'loadFont' - }; - case 5: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.json', { - suggestion: suggestion - }), - method: 'loadJSON' - }; - case 6: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.bytes', { - suggestion: suggestion - }), - method: 'loadBytes' - }; - case 7: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.large'), - method: 'loadX' - }; - case 8: - return { - message: (0, _internationalization.translator) ('fes.fileLoadError.gif'), - method: 'loadImage' - }; - } - }; - /** - * Called internally if there is an error during file loading. - * - * Generates and prints a friendly error message using key: - * "fes.fileLoadError.[*]". - * - * @method _friendlyFileLoadError - * @private - * @param {Number} errorType Number of file load error type - * @param {String} filePath Path to file caused the error - */ - _main.default._friendlyFileLoadError = function (errorType, filePath) { - var _fileLoadErrorCases = fileLoadErrorCases(errorType, filePath), - message = _fileLoadErrorCases.message, - method = _fileLoadErrorCases.method; - _main.default._friendlyError(message, method, 3); - }; - } - var _default = _main.default; - exports.default = _default; - }, - { - '../internationalization': 296, - '../main': 298 - } - ], - 291: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var _internationalization = _dereq_('../internationalization'); - var constants = _interopRequireWildcard(_dereq_('../constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @for p5 - * @requires core - */ - /** - * Checks if any p5.js constant/function is declared outside of setup() - * and draw() function. Also checks any reserved constant/function is - * redeclared. - * - * Generates and prints a friendly error message using key: - * "fes.sketchReaderErrors.reservedConst", - * "fes.sketchReaderErrors.reservedFunc". - * - * @method _fesCodeReader - * @private - */ - - if (typeof IS_MINIFIED !== 'undefined') { - _main.default._fesCodeReader = function () { - }; - } else { - //list of functions to ignore as they either - //are ment to be defined or generate false positive - //outputs - var ignoreFunction = [ - 'setup', - 'draw', - 'preload', - 'deviceMoved', - 'deviceTurned', - 'deviceShaken', - 'doubleClicked', - 'mousePressed', - 'mouseReleased', - 'mouseMoved', - 'mouseDragged', - 'mouseClicked', - 'mouseWheel', - 'touchStarted', - 'touchMoved', - 'touchEnded', - 'keyPressed', - 'keyReleased', - 'keyTyped', - 'windowResized', - 'name', - 'parent', - 'toString', - 'print', - 'stop', - 'onended' - ]; - /** - * Takes a list of variables defined by the user in the code - * as an array and checks if the list contains p5.js constants and functions. - * - * @method checkForConstsAndFuncs - * @private - * @param {Array} variableArray - */ - var checkForConstsAndFuncs = function checkForConstsAndFuncs(variableArray) { - for (var i = 0; i < variableArray.length; i++) { - //if the element in variableArray is a p5.js constant then the below condidion - //will be true, hence a match is found - if (constants[variableArray[i]] !== undefined) { - var url = 'https://p5js.org/reference/#/p5/'.concat(variableArray[i]); - //display the FES message if a match is found - _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedConst', { - url: url, - symbol: variableArray[i] - })); - return; - //if match found then end search - } - } - var p5Constructors = { - }; - for (var _i = 0, _Object$keys = Object.keys(_main.default); _i < _Object$keys.length; _i++) { - var key = _Object$keys[_i]; - // Get a list of all constructors in p5. They are functions whose names - // start with a capital letter - if (typeof _main.default[key] === 'function' && key[0] !== key[0].toLowerCase()) { - p5Constructors[key] = _main.default[key]; - } - } - for (var _i2 = 0; _i2 < variableArray.length; _i2++) { - //ignoreFunction contains the list of functions to be ignored - if (!ignoreFunction.includes(variableArray[_i2])) { - var keyArray = Object.keys(p5Constructors); - var j = 0; - //for every function name obtained check if it matches any p5.js function name - for (; j < keyArray.length; j++) { - if (p5Constructors[keyArray[j]].prototype[variableArray[_i2]] !== undefined) { - //if a p5.js function is used ie it is in the funcs array - var _url = 'https://p5js.org/reference/#/p5/'.concat(variableArray[_i2]); - _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedFunc', { - url: _url, - symbol: variableArray[_i2] - })); - return; - } - } - } - } - }; - //these regex are used to perform variable extraction - //visit https://regexr.com/ for the detailed view - var optionalVarKeyword = /(?:(?:let|const|var)\s+)?/; - // Bracketed expressions start with an opening bracket, some amount of non - // bracket characters, then a closing bracket. Note that this won't properly - // parse nested brackets: `constrain(millis(), 0, 1000)` will match - // `constrain(millis()` only, but will still fail gracefully and not try to - // mistakenly read any subsequent code as assignment expressions. - var roundBracketedExpr = /(?:\([^)]*\))/; - var squareBracketedExpr = /(?:\[[^\]]*\])/; - var curlyBracketedExpr = /(?:\{[^}]*\})/; - var bracketedExpr = new RegExp([roundBracketedExpr, - squareBracketedExpr, - curlyBracketedExpr].map(function (regex) { - return regex.source; - }).join('|')); - // In an a = b expression, `b` can be any character up to a newline or comma, - // unless the comma is inside of a bracketed expression of some kind (to make - // sure we parse function calls with multiple arguments properly.) - var rightHandSide = new RegExp('(?:' + bracketedExpr.source + '|[^\\n,])+'); - var leftHandSide = /([\w$]+)/; - var assignmentOperator = /\s*=\s*/; - var singleAssignment = new RegExp(leftHandSide.source + assignmentOperator.source + rightHandSide.source); - var listSeparator = /,\s*/; - var oneOrMoreAssignments = new RegExp('(?:' + singleAssignment.source + listSeparator.source + ')*' + singleAssignment.source); - var assignmentStatement = new RegExp('^' + optionalVarKeyword.source + oneOrMoreAssignments.source); - var letConstName = /(?:(?:let|const)\s+)([\w$]+)/; - /** - * Takes an array in which each element is a line of code - * containing a variable definition(Eg: arr=['let x = 100', 'const y = 200']) - * and extracts the variables defined. - * - * @method extractVariables - * @private - * @param {Array} linesArray array of lines of code - */ - var extractVariables = function extractVariables(linesArray) { - //extract variable names from the user's code - var matches = [ - ]; - linesArray.forEach(function (ele) { - // Match 0 is the part of the line of code that the regex looked at. - // Matches 1 and onward will be only the variable names on the left hand - // side of assignment expressions. - var match = ele.match(assignmentStatement); - if (!match) return; - matches.push.apply(matches, _toConsumableArray(match.slice(1).filter(function (group) { - return group !== undefined; - }))); - }); - //check if the obtained variables are a part of p5.js or not - checkForConstsAndFuncs(matches); - }; - /** - * Takes an array in which each element is a line of code - * containing a function definition(array=['let x = () => {...}']) - * and extracts the functions defined. - * - * @method extractFuncVariables - * @private - * @param {Array} linesArray array of lines of code - */ - var extractFuncVariables = function extractFuncVariables(linesArray) { - var matches = [ - ]; - //RegExp to extract function names from let/const x = function()... - //visit https://regexr.com/ for the detailed view. - linesArray.forEach(function (ele) { - var m = ele.match(letConstName); - if (m !== null) matches.push(ele.match(letConstName) [1]); - }); - //matches array contains the names of the functions - checkForConstsAndFuncs(matches); - }; - /** - * Converts code written by the user to an array - * every element of which is a seperate line of code. - * - * @method codeToLines - * @private - * @param {String} code code written by the user - */ - var codeToLines = function codeToLines(code) { - //convert code to array of code and filter out - //unnecessary lines - var arrayVariables = code.split('\n').map(function (line) { - return line.trim(); - }).filter(function (line) { - return line !== '' && !line.includes('//') && (line.includes('let') || line.includes('const')) && !line.includes('=>') && !line.includes('function'); - } //filter out lines containing variable names - ); - //filter out lines containing function names - var arrayFunctions = code.split('\n').map(function (line) { - return line.trim(); - }).filter(function (line) { - return line !== '' && !line.includes('//') && (line.includes('let') || line.includes('const')) && (line.includes('=>') || line.includes('function')); - }); - //pass the relevant array to a function which will extract all the variables/functions names - extractVariables(arrayVariables); - extractFuncVariables(arrayFunctions); - }; - /** - * Remove multiline comments and the content inside it. - * - * @method removeMultilineComments - * @private - * @param {String} code code written by the user - * @returns {String} - */ - var removeMultilineComments = function removeMultilineComments(code) { - var start = code.indexOf('/*'); - var end = code.indexOf('*/'); - //create a new string which don't have multiline comments - while (start !== - 1 && end !== - 1) { - if (start === 0) { - code = code.slice(end + 2); - } else code = code.slice(0, start) + code.slice(end + 2); - start = code.indexOf('/*'); - end = code.indexOf('*/'); - } - return code; - }; - /** - * Checks if any p5.js constant or function is declared outside a function - * and reports it if found. - * - * @method globalConstFuncCheck - * @private - * @returns {Boolean} - */ - var globalConstFuncCheck = function globalConstFuncCheck() { - // generate all the const key data as an array - var tempArray = Object.keys(constants); - var element; - for (var i = 0; i < tempArray.length; i++) { - try { - //if the user has not declared p5.js constant anywhere outside the - //setup or draw function then this will throw an - //error. - element = eval(tempArray[i]); - } catch (e) { - //We are catching the error due to the above mentioned - //reason. Since there is no declaration of constant everything - //is OK so we will skip the current iteration and check for the - //next element. - continue; - } //if we are not getting an error this means - //user have changed the value. We will check - //if the value is changed and if it is changed - //then report. - - if (constants[tempArray[i]] !== element) { - var url = 'https://p5js.org/reference/#/p5/'.concat(tempArray[i]); - _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedConst', { - url: url, - symbol: tempArray[i] - })); - //if a p5.js constant is already reported then no need to check - //for p5.js functions. - return true; - } - } //the below code gets a list of p5.js functions - - var p5Constructors = { - }; - for (var _i3 = 0, _Object$keys2 = Object.keys(_main.default); _i3 < _Object$keys2.length; _i3++) { - var key = _Object$keys2[_i3]; - // Get a list of all constructors in p5. They are functions whose names - // start with a capital letter - if (typeof _main.default[key] === 'function' && key[0] !== key[0].toLowerCase()) { - p5Constructors[key] = _main.default[key]; - } - } - var keyArray = Object.keys(p5Constructors); - var classesWithGlobalFns = [ - 'Renderer', - 'Renderer2D', - 'RendererGL' - ]; - var functionArray = [ - ]; - //get the names of all p5.js functions which are available globally - for (var _i4 = 0; _i4 < classesWithGlobalFns.length; _i4++) { - functionArray.push.apply(functionArray, _toConsumableArray(Object.keys(p5Constructors[classesWithGlobalFns[_i4]].prototype))); - } //we have p5.js function names with us so we will check - //if they have been declared or not. - - for (var _i5 = 0; _i5 < functionArray.length; _i5++) { - //ignoreFunction contains the list of functions to be ignored - if (!ignoreFunction.includes(functionArray[_i5])) { - try { - //if we get an error that means the function is not declared - element = eval(functionArray[_i5]); - } catch (e) { - //we will skip the iteration - continue; - } //if we are not getting an error this means - //user have used p5.js function. Check if it is - //changed and if so then report it. - - for (var k = 0; k < keyArray.length; k++) { - if (p5Constructors[keyArray[k]].prototype[functionArray[_i5]] === undefined); - else { - if (p5Constructors[keyArray[k]].prototype[functionArray[_i5]] !== element) { - var _url2 = 'https://p5js.org/reference/#/p5/'.concat(functionArray[_i5]); - _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedFunc', { - url: _url2, - symbol: functionArray[_i5] - })); - return true; - } - } - } - } - } - }; - /** - * Initiates the sketch_reader's processes. - * Obtains the code in setup and draw function - * and forwards it for further processing and evaluation. - * - * @method fesCodeReader - * @private - */ - var fesCodeReader = function fesCodeReader() { - //moveAhead will determine if a match is found outside - //the setup and draw function. If a match is found then - //to prevent further potential reporting we will exit immidiately - var moveAhead = globalConstFuncCheck(); - if (moveAhead) return; - var code = ''; - try { - //get code from setup - code += '' + setup; - } catch (e) { - code += ''; - } - try { - //get code from draw - code += '\n' + draw; - } catch (e) { - code += ''; - } - if (code === '') return; - code = removeMultilineComments(code); - codeToLines(code); - }; - _main.default._fesCodeReader = fesCodeReader; - window.addEventListener('load', _main.default._fesCodeReader); - } - var _default = _main.default; - exports.default = _default; - }, - { - '../constants': 286, - '../internationalization': 296, - '../main': 298, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.constructor': 204, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.match': 211, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.trim': 219, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 292: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @for p5 - * @requires core - */ - // Borrow from stacktracejs https://github.com/stacktracejs/stacktrace.js with - // minor modifications. The license for the same and the code is included below - // Copyright (c) 2017 Eric Wendelin and other contributors - // 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. - - function ErrorStackParser() { - var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; - var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; - var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; - return { - /** - * Given an Error object, extract the most information from it. - * @private - * @param {Error} error object - * @return {Array} of stack frames - */ - parse: function ErrorStackParser$$parse(error) { - if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { - return this.parseOpera(error); - } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { - return this.parseV8OrIE(error); - } else if (error.stack) { - return this.parseFFOrSafari(error); - } else { - // throw new Error('Cannot parse given Error object'); - } - }, - // Separate line and column numbers from a string of the form: (URI:Line:Column) - extractLocation: function ErrorStackParser$$extractLocation(urlLike) { - // Fail-fast but return locations like "(native)" - if (urlLike.indexOf(':') === - 1) { - return [urlLike]; - } - var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; - var parts = regExp.exec(urlLike.replace(/[()]/g, '')); - return [parts[1], - parts[2] || undefined, - parts[3] || undefined]; - }, - parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(CHROME_IE_STACK_REGEXP); - }, this); - return filtered.map(function (line) { - if (line.indexOf('(eval ') > - 1) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); - } - var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); - // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in - // case it has spaces in it, as the string is split on \s+ later on - var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); - // remove the parenthesized location from the line, if it was matched - sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); - // if a location was matched, pass it to extractLocation() otherwise pop the last token - var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); - var functionName = tokens.join(' ') || undefined; - var fileName = [ - 'eval', - '' - ].indexOf(locationParts[0]) > - 1 ? undefined : locationParts[0]; - return { - functionName: functionName, - fileName: fileName, - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }; - }, this); - }, - parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !line.match(SAFARI_NATIVE_CODE_REGEXP); - }, this); - return filtered.map(function (line) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - if (line.indexOf(' > eval') > - 1) { - line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); - } - if (line.indexOf('@') === - 1 && line.indexOf(':') === - 1) { - // Safari eval frames only have function names and nothing else - return { - functionName: line - }; - } else { - var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; - var matches = line.match(functionNameRegex); - var functionName = matches && matches[1] ? matches[1] : undefined; - var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); - return { - functionName: functionName, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }; - } - }, this); - }, - parseOpera: function ErrorStackParser$$parseOpera(e) { - if (!e.stacktrace || e.message.indexOf('\n') > - 1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { - return this.parseOpera9(e); - } else if (!e.stack) { - return this.parseOpera10(e); - } else { - return this.parseOpera11(e); - } - }, - parseOpera9: function ErrorStackParser$$parseOpera9(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; - var lines = e.message.split('\n'); - var result = [ - ]; - for (var i = 2, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - if (match) { - result.push({ - fileName: match[2], - lineNumber: match[1], - source: lines[i] - }); - } - } - return result; - }, - parseOpera10: function ErrorStackParser$$parseOpera10(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; - var lines = e.stacktrace.split('\n'); - var result = [ - ]; - for (var i = 0, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - if (match) { - result.push({ - functionName: match[3] || undefined, - fileName: match[2], - lineNumber: match[1], - source: lines[i] - }); - } - } - return result; - }, - // Opera 10.65+ Error.stack very similar to FF/Safari - parseOpera11: function ErrorStackParser$$parseOpera11(error) { - var filtered = error.stack.split('\n').filter(function (line) { - return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); - }, this); - return filtered.map(function (line) { - var tokens = line.split('@'); - var locationParts = this.extractLocation(tokens.pop()); - var functionCall = tokens.shift() || ''; - var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; - var argsRaw; - if (functionCall.match(/\(([^)]*)\)/)) { - argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); - } - var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); - return { - functionName: functionName, - args: args, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line - }; - }, this); - } - }; - } // End borrow - // wrapper exposing ErrorStackParser - - _main.default._getErrorStackParser = function getErrorStackParser() { - return new ErrorStackParser(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../main': 298, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.match': 211, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216 - } - ], - 293: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.last-index-of'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.last-index-of'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var constants = _interopRequireWildcard(_dereq_('../constants')); - var _internationalization = _dereq_('../internationalization'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _wrapNativeSuper(Class) { - var _cache = typeof Map === 'function' ? new Map() : undefined; - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - if (typeof Class !== 'function') { - throw new TypeError('Super expression must either be null or a function'); - } - if (typeof _cache !== 'undefined') { - if (_cache.has(Class)) return _cache.get(Class); - _cache.set(Class, Wrapper); - } - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - return _wrapNativeSuper(Class); - } - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [ - null - ]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - return _construct.apply(null, arguments); - } - function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf('[native code]') !== - 1; - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @for p5 - * @requires core - */ - - if (typeof IS_MINIFIED !== 'undefined') { - _main.default._validateParameters = _main.default._clearValidateParamsCache = function () { - }; - } else { - // for parameter validation - var dataDoc = _dereq_('../../../docs/parameterData.json'); - var arrDoc = JSON.parse(JSON.stringify(dataDoc)); - var docCache = { - }; - var builtinTypes = new Set(['null', - 'number', - 'string', - 'boolean', - 'constant', - 'function', - 'any', - 'integer']); - var basicTypes = { - number: true, - boolean: true, - string: true, - function : true, - undefined: true - }; - // reverse map of all constants - var constantsReverseMap = { - }; - for (var key in constants) { - constantsReverseMap[constants[key]] = key; - } // mapping names of p5 types to their constructor function - // p5Constructors: - // - Color: f() - // - Graphics: f() - // - Vector: f() - // and so on - - var p5Constructors = { - }; - // For speedup over many runs. funcSpecificConstructors[func] only has the - // constructors for types which were seen earlier as args of "func" - var funcSpecificConstructors = { - }; - window.addEventListener('load', function () { - // Make a list of all p5 classes to be used for argument validation - // This must be done only when everything has loaded otherwise we get - // an empty array - for (var _i = 0, _Object$keys = Object.keys(_main.default); _i < _Object$keys.length; _i++) { - var _key = _Object$keys[_i]; - // Get a list of all constructors in p5. They are functions whose names - // start with a capital letter - if (typeof _main.default[_key] === 'function' && _key[0] !== _key[0].toLowerCase()) { - p5Constructors[_key] = _main.default[_key]; - } - } - }); - var argumentTree = { - }; - // The following two functions are responsible for querying and inserting - // into the argument tree. It stores the types of arguments that each - // function has seen so far. It is used to query if a sequence of - // arguments seen in validate parameters was seen before. - // Lets consider that the following segment of code runs repeatedly, perhaps - // in a loop or in draw() - // color(10, 10, 10); - // color(10, 10); - // color('r', 'g', 'b'); - // After the first of run the code segment, the argument tree looks like - // - color - // - number - // - number - // - number - // - seen: true - // - seen: true - // - string - // - string - // - string - // - seen: true - // seen: true signifies that this argument was also seen as the last - // argument in a call. Now in the second run of the sketch, it would traverse - // the existing tree and see seen: true, i.e this sequence was seen - // before and so scoring can be skipped. This also prevents logging multiple - // validation messages for the same thing. - /** - * Query type and return the result as an object - * - * This would be called repeatedly over and over again, - * so it needs to be as optimized for performance as possible - * @method addType - * @private - */ - var addType = function addType(value, obj, func) { - var type = _typeof(value); - if (basicTypes[type]) { - if (constantsReverseMap[value]) { - // check if the value is a p5 constant and if it is, we would want the - // value itself to be stored in the tree instead of the type - obj = obj[value] || (obj[value] = { - }); - } else { - obj = obj[type] || (obj[type] = { - }); - } - } else if (value === null) { - // typeof null -> "object". don't want that - obj = obj['null'] || (obj['null'] = { - }); - } else { - // objects which are instances of p5 classes have nameless constructors. - // native objects have a constructor named "Object". This check - // differentiates between the two so that we dont waste time finding the - // p5 class if we just have a native object - if (value.constructor && value.constructor.name) { - obj = obj[value.constructor.name] || (obj[value.constructor.name] = { - }); - return obj; - } // constructors for types defined in p5 do not have a name property. - // e.constructor.name gives "". Code in this segment is a workaround for it - // p5C will only have the name: constructor mapping for types - // which were already seen as args of "func" - - var p5C = funcSpecificConstructors[func]; - // p5C would contain much fewer items than p5Constructors. if we find our - // answer in p5C, we don't have to scan through p5Constructors - if (p5C === undefined) { - // if there isn't an entry yet for func - // make an entry of empty object - p5C = funcSpecificConstructors[func] = { - }; - } - for (var _key2 in p5C) { - // search on the constructors we have already seen (smaller search space) - if (value instanceof p5C[_key2]) { - obj = obj[_key2] || (obj[_key2] = { - }); - return obj; - } - } - for (var _key3 in p5Constructors) { - // if the above search didn't work, search on all p5 constructors - if (value instanceof p5Constructors[_key3]) { - obj = obj[_key3] || (obj[_key3] = { - }); - // if found, add to known constructors for this function - p5C[_key3] = p5Constructors[_key3]; - return obj; - } - } // nothing worked, put the type as it is - - obj = obj[type] || (obj[type] = { - }); - } - return obj; - }; - /** - * Build the argument type tree, argumentTree - * - * This would be called repeatedly over and over again, - * so it needs to be as optimized for performance as possible - * @method buildArgTypeCache - * @private - */ - var buildArgTypeCache = function buildArgTypeCache(func, arr) { - // get the if an argument tree for current function already exists - var obj = argumentTree[func]; - if (obj === undefined) { - // if it doesn't, create an empty tree - obj = argumentTree[func] = { - }; - } - for (var i = 0, len = arr.length; i < len; ++i) { - var value = arr[i]; - if (value instanceof Array) { - // an array is passed as an argument, expand it and get the type of - // each of its element. We distinguish the start of an array with 'as' - // or arraystart. This would help distinguish between the arguments - // (number, number, number) and (number, [number, number]) - obj = obj['as'] || (obj['as'] = { - }); - for (var j = 0, lenA = value.length; j < lenA; ++j) { - obj = addType(value[j], obj, func); - } - } else { - obj = addType(value, obj, func); - } - } - return obj; - }; - /** - * Query data.json - * This is a helper function for validateParameters() - * @method lookupParamDoc - * @private - */ - var lookupParamDoc = function lookupParamDoc(func) { - // look for the docs in the `data.json` datastructure - var ichDot = func.lastIndexOf('.'); - var funcName = func.slice(ichDot + 1); - var funcClass = func.slice(0, ichDot !== - 1 ? ichDot : 0) || 'p5'; - var classitems = arrDoc; - var queryResult = classitems[funcClass][funcName]; - // different JSON structure for funct with multi-format - var overloads = [ - ]; - if (queryResult.hasOwnProperty('overloads')) { - // add all the overloads - for (var i = 0; i < queryResult.overloads.length; i++) { - overloads.push({ - formats: queryResult.overloads[i].params - }); - } - } else { - // no overloads, just add the main method definition - overloads.push({ - formats: queryResult.params || [ - ] - }); - } // parse the parameter types for each overload - - var mapConstants = { - }; - var maxParams = 0; - overloads.forEach(function (overload) { - var formats = overload.formats; - // keep a record of the maximum number of arguments - // this method requires. - if (maxParams < formats.length) { - maxParams = formats.length; - } // calculate the minimum number of arguments - // this overload requires. - - var minParams = formats.length; - while (minParams > 0 && formats[minParams - 1].optional) { - minParams--; - } - overload.minParams = minParams; - // loop through each parameter position, and parse its types - formats.forEach(function (format) { - // split this parameter's types - format.types = format.type.split('|').map(function ct(type) { - // array - if (type.slice( - 2) === '[]') { - return { - name: type, - array: ct(type.slice(0, - 2)) - }; - } - var lowerType = type.toLowerCase(); - // constant - if (lowerType === 'constant') { - var constant; - if (mapConstants.hasOwnProperty(format.name)) { - constant = mapConstants[format.name]; - } else { - // parse possible constant values from description - var myRe = /either\s+(?:[A-Z0-9_]+\s*,?\s*(?:or)?\s*)+/g; - var values = { - }; - var names = [ - ]; - constant = mapConstants[format.name] = { - values: values, - names: names - }; - var myArray = myRe.exec(format.description); - if (func === 'endShape' && format.name === 'mode') { - values[constants.CLOSE] = true; - names.push('CLOSE'); - } else { - var match = myArray[0]; - var reConst = /[A-Z0-9_]+/g; - var matchConst; - while ((matchConst = reConst.exec(match)) !== null) { - var name = matchConst[0]; - if (constants.hasOwnProperty(name)) { - values[constants[name]] = true; - names.push(name); - } - } - } - } - return { - name: type, - builtin: lowerType, - names: constant.names, - values: constant.values - }; - } // function - - if (lowerType.slice(0, 'function'.length) === 'function') { - lowerType = 'function'; - } // builtin - - if (builtinTypes.has(lowerType)) { - return { - name: type, - builtin: lowerType - }; - } // find type's prototype - - var t = window; - var typeParts = type.split('.'); - // special-case 'p5' since it may be non-global - if (typeParts[0] === 'p5') { - t = _main.default; - typeParts.shift(); - } - typeParts.forEach(function (p) { - t = t && t[p]; - }); - if (t) { - return { - name: type, - prototype: t - }; - } - return { - name: type, - type: lowerType - }; - }); - }); - }); - return { - overloads: overloads, - maxParams: maxParams - }; - }; - /** - * Checks whether input type is Number - * This is a helper function for validateParameters() - * @method isNumber - * @private - * - * @returns {Boolean} a boolean indicating whether input type is Number - */ - var isNumber = function isNumber(param) { - if (isNaN(parseFloat(param))) return false; - switch (_typeof(param)) { - case 'number': - return true; - case 'string': - return !isNaN(param); - default: - return false; - } - }; - /** - * Test type for non-object type parameter validation - * @method testParamType - * @private - */ - var testParamType = function testParamType(param, type) { - var isArray = param instanceof Array; - var matches = true; - if (type.array && isArray) { - for (var i = 0; i < param.length; i++) { - var error = testParamType(param[i], type.array); - if (error) return error / 2; // half error for elements - } - } else if (type.prototype) { - matches = param instanceof type.prototype; - } else if (type.builtin) { - switch (type.builtin) { - case 'number': - matches = isNumber(param); - break; - case 'integer': - matches = isNumber(param) && Number(param) === Math.floor(param); - break; - case 'boolean': - case 'any': - matches = true; - break; - case 'array': - matches = isArray; - break; - case 'string': - matches = /*typeof param === 'number' ||*/ typeof param === 'string'; - break; - case 'constant': - matches = type.values.hasOwnProperty(param); - break; - case 'function': - matches = param instanceof Function; - break; - case 'null': - matches = param === null; - break; - } - } else { - matches = _typeof(param) === type.t; - } - return matches ? 0 : 1; - }; - /** - * Test type for multiple parameters - * @method testParamTypes - * @private - */ - var testParamTypes = function testParamTypes(param, types) { - var minScore = 9999; - for (var i = 0; minScore > 0 && i < types.length; i++) { - var score = testParamType(param, types[i]); - if (minScore > score) minScore = score; - } - return minScore; - }; - /** - * generate a score (higher is worse) for applying these args to - * this overload. - * @method scoreOverload - * @private - */ - var scoreOverload = function scoreOverload(args, argCount, overload, minScore) { - var score = 0; - var formats = overload.formats; - var minParams = overload.minParams; - // check for too few/many args - // the score is double number of extra/missing args - if (argCount < minParams) { - score = (minParams - argCount) * 2; - } else if (argCount > formats.length) { - score = (argCount - formats.length) * 2; - } // loop through the formats, adding up the error score for each arg. - // quit early if the score gets higher than the previous best overload. - - for (var p = 0; score <= minScore && p < formats.length; p++) { - var arg = args[p]; - var format = formats[p]; - // '== null' checks for 'null' and typeof 'undefined' - if (arg == null) { - // handle undefined args - if (!format.optional || p < minParams || p < argCount) { - score += 1; - } - } else { - score += testParamTypes(arg, format.types); - } - } - return score; - }; - /** - * Gets a list of errors for this overload - * @method getOverloadErrors - * @private - */ - var getOverloadErrors = function getOverloadErrors(args, argCount, overload) { - var formats = overload.formats; - var minParams = overload.minParams; - // check for too few/many args - if (argCount < minParams) { - return [{ - type: 'TOO_FEW_ARGUMENTS', - argCount: argCount, - minParams: minParams - } - ]; - } else if (argCount > formats.length) { - return [{ - type: 'TOO_MANY_ARGUMENTS', - argCount: argCount, - maxParams: formats.length - } - ]; - } - var errorArray = [ - ]; - for (var p = 0; p < formats.length; p++) { - var arg = args[p]; - var format = formats[p]; - // '== null' checks for 'null' and typeof 'undefined' - if (arg == null) { - // handle undefined args - if (!format.optional || p < minParams || p < argCount) { - errorArray.push({ - type: 'EMPTY_VAR', - position: p, - format: format - }); - } - } else if (testParamTypes(arg, format.types) > 0) { - errorArray.push({ - type: 'WRONG_TYPE', - position: p, - format: format, - arg: arg - }); - } - } - return errorArray; - }; - /** - * a custom error type, used by the mocha - * tests when expecting validation errors - * @method ValidationError - * @private - */ - _main.default.ValidationError = function (name) { - var err = /*#__PURE__*/ function (_Error) { - _inherits(err, _Error); - var _super = _createSuper(err); - function err(message, func, type) { - var _this; - _classCallCheck(this, err); - _this = _super.call(this); - _this.message = message; - _this.func = func; - _this.type = type; - if ('captureStackTrace' in Error) Error.captureStackTrace(_assertThisInitialized(_this), err); - else _this.stack = new Error().stack; - return _this; - } - return err; - }( /*#__PURE__*/ _wrapNativeSuper(Error)); - err.prototype.name = name; - return err; - }('ValidationError'); - /** - * Prints a friendly msg after parameter validation - * @method _friendlyParamError - * @private - */ - _main.default._friendlyParamError = function (errorObj, func) { - var message; - var translationObj; - function formatType() { - var format = errorObj.format; - return format.types.map(function (type) { - return type.names ? type.names.join('|') : type.name; - }).join('|'); - } - switch (errorObj.type) { - case 'EMPTY_VAR': - { - translationObj = { - func: func, - formatType: formatType(), - // It needs to be this way for i18next-extract to work. The comment - // specifies the values that the context can take so that it can - // statically prepare the translation files with them. - /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ - position: (0, _internationalization.translator) ('fes.positions.p', { - context: (errorObj.position + 1).toString(), - defaultValue: (errorObj.position + 1).toString() - }), - url: 'https://p5js.org/examples/data-variable-scope.html' - }; - break; - } - case 'WRONG_TYPE': - { - var arg = errorObj.arg; - var argType = arg instanceof Array ? 'array' : arg === null ? 'null' : arg === undefined ? 'undefined' : typeof arg === 'number' && isNaN(arg) ? 'NaN' : arg.name || _typeof(arg); - translationObj = { - func: func, - formatType: formatType(), - argType: argType, - /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ - position: (0, _internationalization.translator) ('fes.positions.p', { - context: (errorObj.position + 1).toString(), - defaultValue: (errorObj.position + 1).toString() - }) - }; - break; - } - case 'TOO_FEW_ARGUMENTS': - { - translationObj = { - func: func, - minParams: errorObj.minParams, - argCount: errorObj.argCount - }; - break; - } - case 'TOO_MANY_ARGUMENTS': - { - translationObj = { - func: func, - maxParams: errorObj.maxParams, - argCount: errorObj.argCount - }; - break; - } - } - if (translationObj) { - try { - // const re = /Function\.validateParameters.*[\r\n].*[\r\n].*\(([^)]*)/; - var myError = new Error(); - var parsed = _main.default._getErrorStackParser().parse(myError); - if (parsed[3] && parsed[3].functionName && parsed[3].functionName.includes('.') && _main.default.prototype[parsed[3].functionName.split('.').slice( - 1) [0]]) { - return; - } - if (_main.default._throwValidationErrors) { - throw new _main.default.ValidationError(message, func, errorObj.type); - } // try to extract the location from where the function was called - - if (parsed[3] && parsed[3].fileName && parsed[3].lineNumber && parsed[3].columnNumber) { - var location = ''.concat(parsed[3].fileName, ':').concat(parsed[3].lineNumber, ':').concat(parsed[3].columnNumber); - translationObj.location = (0, _internationalization.translator) ('fes.location', { - location: location, - // for e.g. get "sketch.js" from "https://example.com/abc/sketch.js" - file: parsed[3].fileName.split('/').slice( - 1), - line: parsed[3].lineNumber - }); - // tell fesErrorMonitor that we have already given a friendly message - // for this line, so it need not to do the same in case of an error - _main.default._fesLogCache[location] = true; - } - } catch (err) { - if (err instanceof _main.default.ValidationError) { - throw err; - } - } - translationObj.context = errorObj.type; - // i18next-extract-mark-context-next-line ["EMPTY_VAR", "TOO_MANY_ARGUMENTS", "TOO_FEW_ARGUMENTS", "WRONG_TYPE"] - message = (0, _internationalization.translator) ('fes.friendlyParamError.type', translationObj); - _main.default._friendlyError(''.concat(message), func, 3); - } - }; - /** - * Clears cache to avoid having multiple FES messages for the same set of - * parameters. - * - * If a function is called with some set of wrong arguments, and then called - * again with the same set of arguments, the messages due to the second call - * will be supressed. If two tests test on the same wrong arguments, the - * second test won't see the validationError. clearing argumentTree solves it - * - * @method _clearValidateParamsCache - * @private - */ - _main.default._clearValidateParamsCache = function clearValidateParamsCache() { - for (var _i2 = 0, _Object$keys2 = Object.keys(argumentTree); _i2 < _Object$keys2.length; _i2++) { - var _key4 = _Object$keys2[_i2]; - delete argumentTree[_key4]; - } - }; - // allowing access to argumentTree for testing - _main.default._getValidateParamsArgTree = function getValidateParamsArgTree() { - return argumentTree; - }; - /** - * Runs parameter validation by matching the input parameters with information - * from `docs/reference/data.json`. - * Generates and prints a friendly error message using key: - * "fes.friendlyParamError.[*]". - * - * @method _validateParameters - * @private - * @param {String} func Name of the function - * @param {Array} args User input arguments - * - * @example: - * const a; - * ellipse(10,10,a,5); - * console output: - * "It looks like ellipse received an empty variable in spot #2." - * - * @example: - * ellipse(10,"foo",5,5); - * console output: - * "ellipse was expecting a number for parameter #1, - * received "foo" instead." - */ - _main.default._validateParameters = function validateParameters(func, args) { - if (_main.default.disableFriendlyErrors) { - return; // skip FES - } // query / build the argument type tree and check if this sequence - // has already been seen before. - - var obj = buildArgTypeCache(func, args); - if (obj.seen) { - return; - } // mark this sequence as seen - - obj.seen = true; - // lookup the docs in the 'data.json' file - var docs = docCache[func] || (docCache[func] = lookupParamDoc(func)); - var overloads = docs.overloads; - var argCount = args.length; - // the following line ignores trailing undefined arguments, commenting - // it to resolve https://github.com/processing/p5.js/issues/4571 - // '== null' checks for 'null' and typeof 'undefined' - // while (argCount > 0 && args[argCount - 1] == null) argCount--; - // find the overload with the best score - var minScore = 99999; - var minOverload; - for (var i = 0; i < overloads.length; i++) { - var score = scoreOverload(args, argCount, overloads[i], minScore); - if (score === 0) { - return; // done! - } else if (minScore > score) { - // this score is better that what we have so far... - minScore = score; - minOverload = i; - } - } // this should _always_ be true here... - - if (minScore > 0) { - // get the errors for the best overload - var errorArray = getOverloadErrors(args, argCount, overloads[minOverload]); - // generate err msg - for (var n = 0; n < errorArray.length; n++) { - _main.default._friendlyParamError(errorArray[n], func); - } - } - }; - _main.default.prototype._validateParameters = _main.default.validateParameters; - } - var _default = _main.default; - exports.default = _default; - }, - { - '../../../docs/parameterData.json': 1, - '../constants': 286, - '../internationalization': 296, - '../main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.last-index-of': 181, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.map': 187, - 'core-js/modules/es.number.constructor': 191, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.set': 207, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 294: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var constants = _interopRequireWildcard(_dereq_('./constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } /** - * @requires constants - */ - - function modeAdjust(a, b, c, d, mode) { - if (mode === constants.CORNER) { - return { - x: a, - y: b, - w: c, - h: d - }; - } else if (mode === constants.CORNERS) { - return { - x: a, - y: b, - w: c - a, - h: d - b - }; - } else if (mode === constants.RADIUS) { - return { - x: a - c, - y: b - d, - w: 2 * c, - h: 2 * d - }; - } else if (mode === constants.CENTER) { - return { - x: a - c * 0.5, - y: b - d * 0.5, - w: c, - h: d - }; - } - } - var _default = { - modeAdjust: modeAdjust - }; - exports.default = _default; - }, - { - './constants': 286, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 295: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - var _main = _interopRequireDefault(_dereq_('../core/main')); - var _internationalization = _dereq_('./internationalization'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * _globalInit - * - * TODO: ??? - * if sketch is on window - * assume "global" mode - * and instantiate p5 automatically - * otherwise do nothing - * - * @private - * @return {Undefined} - */ - - var _globalInit = function _globalInit() { - // Could have been any property defined within the p5 constructor. - // If that property is already a part of the global object, - // this code has already run before, likely due to a duplicate import - if (typeof window._setupDone !== 'undefined') { - console.warn('p5.js seems to have been imported multiple times. Please remove the duplicate import'); - return; - } - if (!window.mocha) { - // If there is a setup or draw function on the window - // then instantiate p5 in "global" mode - if ((window.setup && typeof window.setup === 'function' || window.draw && typeof window.draw === 'function') && !_main.default.instance) { - new _main.default(); - } - } - }; - // make a promise that resolves when the document is ready - var waitForDocumentReady = function waitForDocumentReady() { - return new Promise(function (resolve, reject) { - // if the page is ready, initialize p5 immediately - if (document.readyState === 'complete') { - resolve(); - // if the page is still loading, add an event listener - // and initialize p5 as soon as it finishes loading - } else { - window.addEventListener('load', resolve, false); - } - }); - }; - // only load translations if we're using the full, un-minified library - var waitingForTranslator = typeof IS_MINIFIED === 'undefined' ? (0, _internationalization.initialize) () : Promise.resolve(); - Promise.all([waitForDocumentReady(), - waitingForTranslator]).then(_globalInit); - }, - { - '../core/main': 298, - './internationalization': 296, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.promise': 201, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 296: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.setTranslatorLanguage = exports.currentTranslatorLanguage = exports.availableTranslatorLanguages = exports.initialize = exports.translator = void 0; - var _i18next = _interopRequireDefault(_dereq_('i18next')); - var _i18nextBrowserLanguagedetector = _interopRequireDefault(_dereq_('i18next-browser-languagedetector')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - var fallbackResources, - languages; - if (typeof IS_MINIFIED === 'undefined') { - // internationalization is only for the unminified build - var translationsModule = _dereq_('../../translations'); - fallbackResources = translationsModule.default; - languages = translationsModule.languages; - if (typeof P5_DEV_BUILD !== 'undefined') { - // When the library is built in development mode ( using npm run dev ) - // we want to use the current translation files on the disk, which may have - // been updated but not yet pushed to the CDN. - var completeResources = _dereq_('../../translations/dev'); - for (var _i = 0, _Object$keys = Object.keys(completeResources); _i < _Object$keys.length; _i++) { - var language = _Object$keys[_i]; - // In es_translation, language is es and namespace is translation - // In es_MX_translation, language is es-MX and namespace is translation - var parts = language.split('_'); - var lng = parts.slice(0, parts.length - 1).join('-'); - var ns = parts[parts.length - 1]; - fallbackResources[lng] = fallbackResources[lng] || { - }; - fallbackResources[lng][ns] = completeResources[language]; - } - } - } /** - * This is our i18next "backend" plugin. It tries to fetch languages - * from a CDN. - */ - - var FetchResources = /*#__PURE__*/ function () { - function FetchResources(services, options) { - _classCallCheck(this, FetchResources); - this.init(services, options); - } // run fetch with a timeout. Automatically rejects on timeout - // default timeout = 2000 ms - - _createClass(FetchResources, [ - { - key: 'fetchWithTimeout', - value: function fetchWithTimeout(url, options) { - var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2000; - return Promise.race([fetch(url, options), - new Promise(function (_, reject) { - return setTimeout(function () { - return reject(new Error('timeout')); - }, timeout); - })]); - } - }, - { - key: 'init', - value: function init(services) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - this.services = services; - this.options = options; - } - }, - { - key: 'read', - value: function read(language, namespace, callback) { - var loadPath = this.options.loadPath; - if (language === this.options.fallback) { - // if the default language of the user is the same as our inbuilt fallback, - // there's no need to fetch resources from the cdn. This won't actually - // need to run when we use "partialBundledLanguages" in the init - // function. - callback(null, fallbackResources[language][namespace]); - } else if (languages.includes(language)) { - // The user's language is included in the list of languages - // that we so far added translations for. - var url = this.services.interpolator.interpolate(loadPath, { - lng: language, - ns: namespace - }); - this.loadUrl(url, callback); - } else { - // We don't have translations for this language. i18next will use - // the default language instead. - callback('Not found', false); - } - } - }, - { - key: 'loadUrl', - value: function loadUrl(url, callback) { - this.fetchWithTimeout(url).then(function (response) { - var ok = response.ok; - if (!ok) { - // caught in the catch() below - throw new Error('failed loading '.concat(url)); - } - return response.json(); - }, function () { - // caught in the catch() below - throw new Error('failed loading '.concat(url)); - }).then(function (data) { - return callback(null, data); - }).catch(callback); - } - } - ]); - return FetchResources; - }(); - FetchResources.type = 'backend'; - /** - * This is our translation function. Give it a key and - * it will retrieve the appropriate string - * (within supported languages) according to the - * user's browser's language settings. - * @function translator - * @param {String} key a key that corresponds to a message in our translation files - * @param {Object} values values for use in the message under the given `key` - * @returns {String} message (with values inserted) in the user's browser language - * @private - */ - var translator = function translator(key, values) { - console.debug('p5.js translator called before translations were loaded'); - // Certain FES functionality may trigger before translations are downloaded. - // Using "partialBundledLanguages" option during initialization, we can - // still use our fallback language to display messages - _i18next.default.t(key, values); /* i18next-extract-disable-line */ - }; - // (We'll set this to a real value in the init function below!) - /** - * Set up our translation function, with loaded languages - */ - exports.translator = translator; - var initialize = function initialize() { - var i18init = _i18next.default.use(_i18nextBrowserLanguagedetector.default).use(FetchResources).init({ - fallbackLng: 'en', - nestingPrefix: '$tr(', - nestingSuffix: ')', - defaultNS: 'translation', - returnEmptyString: false, - interpolation: { - escapeValue: false - }, - detection: { - checkWhitelist: false, - // prevent storing or locating language from cookie or localStorage - // more info on https://github.com/processing/p5.js/issues/4862 - order: [ - 'querystring', - 'navigator', - 'htmlTag', - 'path', - 'subdomain' - ], - caches: [ - ] - }, - backend: { - fallback: 'en', - loadPath: 'https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json' - }, - partialBundledLanguages: true, - resources: fallbackResources - }).then(function (translateFn) { - exports.translator = translator = translateFn; - }, function (e) { - return console.debug('Translations failed to load ('.concat(e, ')')); - }); - // i18next.init() returns a promise that resolves when the translations - // are loaded. We use this in core/init.js to hold p5 initialization until - // we have the translation files. - return i18init; - }; - /** - * Returns a list of languages we have translations loaded for - */ - exports.initialize = initialize; - var availableTranslatorLanguages = function availableTranslatorLanguages() { - return _i18next.default.languages; - }; - /** - * Returns the current language selected for translation - */ - exports.availableTranslatorLanguages = availableTranslatorLanguages; - var currentTranslatorLanguage = function currentTranslatorLanguage(language) { - return _i18next.default.language; - }; - /** - * Sets the current language for translation - * Returns a promise that resolved when loading is finished, - * or rejects if it fails. - */ - exports.currentTranslatorLanguage = currentTranslatorLanguage; - var setTranslatorLanguage = function setTranslatorLanguage(language) { - return _i18next.default.changeLanguage(language || undefined, function (e) { - return console.debug('Translations failed to load ('.concat(e, ')')); - }); - }; - exports.setTranslatorLanguage = setTranslatorLanguage; - }, - { - '../../translations': 360, - '../../translations/dev': undefined, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.promise': 201, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/web.dom-collections.iterator': 256, - 'i18next': 267, - 'i18next-browser-languagedetector': 264 - } - ], - 297: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @for p5 - * @requires core - * These are functions that are part of the Processing API but are not part of - * the p5.js API. In some cases they have a new name, in others, they are - * removed completely. Not all unsupported Processing functions are listed here - * but we try to include ones that a user coming from Processing might likely - * call. - */ - - _main.default.prototype.pushStyle = function () { - throw new Error('pushStyle() not used, see push()'); - }; - _main.default.prototype.popStyle = function () { - throw new Error('popStyle() not used, see pop()'); - }; - _main.default.prototype.popMatrix = function () { - throw new Error('popMatrix() not used, see pop()'); - }; - _main.default.prototype.pushMatrix = function () { - throw new Error('pushMatrix() not used, see push()'); - }; - var _default = _main.default; - exports.default = _default; - }, - { - './main': 298 - } - ], - 298: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-own-property-names'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.object.get-own-property-names'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - _dereq_('./shim'); - var constants = _interopRequireWildcard(_dereq_('./constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Structure - * @submodule Structure - * @for p5 - * @requires constants - */ - // Core needs the PVariables object - /** - * This is the p5 instance constructor. - * - * A p5 instance holds all the properties and methods related to - * a p5 sketch. It expects an incoming sketch closure and it can also - * take an optional node parameter for attaching the generated p5 canvas - * to a node. The sketch closure takes the newly created p5 instance as - * its sole argument and may optionally set preload(), - * setup(), and/or - * draw() properties on it for running a sketch. - * - * A p5 sketch can run in "global" or "instance" mode: - * "global" - all properties and methods are attached to the window - * "instance" - all properties and methods are bound to this p5 object - * - * @class p5 - * @constructor - * @param {function(p5)} sketch a closure that can set optional preload(), - * setup(), and/or draw() properties on the - * given p5 instance - * @param {HTMLElement} [node] element to attach canvas to - * @return {p5} a p5 instance - */ - - var p5 = /*#__PURE__*/ function () { - function p5(sketch, node) { - var _this = this; - _classCallCheck(this, p5); - ////////////////////////////////////////////// - // PUBLIC p5 PROPERTIES AND METHODS - ////////////////////////////////////////////// - /** - * Called directly before setup(), the preload() function is used to handle - * asynchronous loading of external files in a blocking way. If a preload - * function is defined, setup() will wait until any load calls within have - * finished. Nothing besides load calls (loadImage, loadJSON, loadFont, - * loadStrings, etc.) should be inside the preload function. If asynchronous - * loading is preferred, the load methods can instead be called in setup() - * or anywhere else with the use of a callback parameter. - * - * By default the text "loading..." will be displayed. To make your own - * loading page, include an HTML element with id "p5_loading" in your - * page. More information here. - * - * @method preload - * @example - *
                - * let img; - * let c; - * function preload() { - * // preload() runs once - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * // setup() waits until preload() is done - * img.loadPixels(); - * // get color of middle pixel - * c = img.get(img.width / 2, img.height / 2); - * } - * - * function draw() { - * background(c); - * image(img, 25, 25, 50, 50); - * } - *
                - * - * @alt - * nothing displayed - * - */ - /** - * The setup() function is called once when the program starts. It's used to - * define initial environment properties such as screen size and background - * color and to load media such as images and fonts as the program starts. - * There can only be one setup() function for each program and it shouldn't - * be called again after its initial execution. - * - * Note: Variables declared within setup() are not accessible within other - * functions, including draw(). - * - * @method setup - * @example - *
                - * let a = 0; - * - * function setup() { - * background(0); - * noStroke(); - * fill(102); - * } - * - * function draw() { - * rect(a++ % width, 10, 2, 80); - * } - *
                - * - * @alt - * nothing displayed - * - */ - /** - * Called directly after setup(), the draw() function continuously executes - * the lines of code contained inside its block until the program is stopped - * or noLoop() is called. Note if noLoop() is called in setup(), draw() will - * still be executed once before stopping. draw() is called automatically and - * should never be called explicitly. - * - * It should always be controlled with noLoop(), redraw() and loop(). After - * noLoop() stops the code in draw() from executing, redraw() causes the - * code inside draw() to execute once, and loop() will cause the code - * inside draw() to resume executing continuously. - * - * The number of times draw() executes in each second may be controlled with - * the frameRate() function. - * - * There can only be one draw() function for each sketch, and draw() must - * exist if you want the code to run continuously, or to process events such - * as mousePressed(). Sometimes, you might have an empty call to draw() in - * your program, as shown in the above example. - * - * It is important to note that the drawing coordinate system will be reset - * at the beginning of each draw() call. If any transformations are performed - * within draw() (ex: scale, rotate, translate), their effects will be - * undone at the beginning of draw(), so transformations will not accumulate - * over time. On the other hand, styling applied (ex: fill, stroke, etc) will - * remain in effect. - * - * @method draw - * @example - *
                - * let yPos = 0; - * function setup() { - * // setup() runs once - * frameRate(30); - * } - * function draw() { - * // draw() loops forever, until stopped - * background(204); - * yPos = yPos - 1; - * if (yPos < 0) { - * yPos = height; - * } - * line(0, yPos, width, yPos); - * } - *
                - * - * @alt - * nothing displayed - * - */ - ////////////////////////////////////////////// - // PRIVATE p5 PROPERTIES AND METHODS - ////////////////////////////////////////////// - this._setupDone = false; - this._preloadDone = false; - // for handling hidpi - this._pixelDensity = Math.ceil(window.devicePixelRatio) || 1; - this._userNode = node; - this._curElement = null; - this._elements = [ - ]; - this._glAttributes = null; - this._requestAnimId = 0; - this._preloadCount = 0; - this._isGlobal = false; - this._loop = true; - this._startListener = null; - this._initializeInstanceVariables(); - this._defaultCanvasSize = { - width: 100, - height: 100 - }; - this._events = { - // keep track of user-events for unregistering later - mousemove: null, - mousedown: null, - mouseup: null, - dragend: null, - dragover: null, - click: null, - dblclick: null, - mouseover: null, - mouseout: null, - keydown: null, - keyup: null, - keypress: null, - touchstart: null, - touchmove: null, - touchend: null, - resize: null, - blur: null - }; - this._millisStart = - 1; - this._recording = false; - // States used in the custom random generators - this._lcg_random_state = null; - this._gaussian_previous = false; - this._events.wheel = null; - this._loadingScreenId = 'p5_loading'; - // Allows methods to be registered on an instance that - // are instance-specific. - this._registeredMethods = { - }; - var methods = Object.getOwnPropertyNames(p5.prototype._registeredMethods); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = methods[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var prop = _step.value; - this._registeredMethods[prop] = p5.prototype._registeredMethods[prop].slice(); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - if (window.DeviceOrientationEvent) { - this._events.deviceorientation = null; - } - if (window.DeviceMotionEvent && !window._isNodeWebkit) { - this._events.devicemotion = null; - } // Function to invoke registered hooks before or after events such as preload, setup, and pre/post draw. - - p5.prototype.callRegisteredHooksFor = function (hookName) { - var target = this || p5.prototype; - var context = this._isGlobal ? window : this; - if (target._registeredMethods.hasOwnProperty(hookName)) { - var _methods = target._registeredMethods[hookName]; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = _methods[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var method = _step2.value; - if (typeof method === 'function') { - method.call(context); - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - } - }; - this._start = function () { - // Find node if id given - if (_this._userNode) { - if (typeof _this._userNode === 'string') { - _this._userNode = document.getElementById(_this._userNode); - } - } - var context = _this._isGlobal ? window : _this; - if (context.preload) { - _this.callRegisteredHooksFor('beforePreload'); - // Setup loading screen - // Set loading screen into dom if not present - // Otherwise displays and removes user provided loading screen - var loadingScreen = document.getElementById(_this._loadingScreenId); - if (!loadingScreen) { - loadingScreen = document.createElement('div'); - loadingScreen.innerHTML = 'Loading...'; - loadingScreen.style.position = 'absolute'; - loadingScreen.id = _this._loadingScreenId; - var _node = _this._userNode || document.body; - _node.appendChild(loadingScreen); - } - var _methods2 = _this._preloadMethods; - for (var method in _methods2) { - // default to p5 if no object defined - _methods2[method] = _methods2[method] || p5; - var obj = _methods2[method]; - //it's p5, check if it's global or instance - if (obj === p5.prototype || obj === p5) { - if (_this._isGlobal) { - window[method] = _this._wrapPreload(_this, method); - } - obj = _this; - } - _this._registeredPreloadMethods[method] = obj[method]; - obj[method] = _this._wrapPreload(obj, method); - } - context.preload(); - _this._runIfPreloadsAreDone(); - } else { - _this._setup(); - if (!_this._recording) { - _this._draw(); - } - } - }; - this._runIfPreloadsAreDone = function () { - var context = this._isGlobal ? window : this; - if (context._preloadCount === 0) { - var loadingScreen = document.getElementById(context._loadingScreenId); - if (loadingScreen) { - loadingScreen.parentNode.removeChild(loadingScreen); - } - this.callRegisteredHooksFor('afterPreload'); - if (!this._setupDone) { - this._lastTargetFrameTime = window.performance.now(); - this._lastRealFrameTime = window.performance.now(); - context._setup(); - if (!this._recording) { - context._draw(); - } - } - } - }; - this._decrementPreload = function () { - var context = this._isGlobal ? window : this; - if (!context._preloadDone && typeof context.preload === 'function') { - context._setProperty('_preloadCount', context._preloadCount - 1); - context._runIfPreloadsAreDone(); - } - }; - this._wrapPreload = function (obj, fnName) { - var _this2 = this; - return function () { - //increment counter - _this2._incrementPreload(); - //call original function - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return _this2._registeredPreloadMethods[fnName].apply(obj, args); - }; - }; - this._incrementPreload = function () { - var context = this._isGlobal ? window : this; - // Do nothing if we tried to increment preloads outside of `preload` - if (context._preloadDone) return; - context._setProperty('_preloadCount', context._preloadCount + 1); - }; - this._setup = function () { - _this.callRegisteredHooksFor('beforeSetup'); - // Always create a default canvas. - // Later on if the user calls createCanvas, this default one - // will be replaced - _this.createCanvas(_this._defaultCanvasSize.width, _this._defaultCanvasSize.height, 'p2d'); - // return preload functions to their normal vals if switched by preload - var context = _this._isGlobal ? window : _this; - if (typeof context.preload === 'function') { - for (var f in _this._preloadMethods) { - context[f] = _this._preloadMethods[f][f]; - if (context[f] && _this) { - context[f] = context[f].bind(_this); - } - } - } // Record the time when sketch starts - - _this._millisStart = window.performance.now(); - context._preloadDone = true; - // Short-circuit on this, in case someone used the library in "global" - // mode earlier - if (typeof context.setup === 'function') { - context.setup(); - } // unhide any hidden canvases that were created - - var canvases = document.getElementsByTagName('canvas'); - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = canvases[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var k = _step3.value; - if (k.dataset.hidden === 'true') { - k.style.visibility = ''; - delete k.dataset.hidden; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - _this._lastTargetFrameTime = window.performance.now(); - _this._lastRealFrameTime = window.performance.now(); - _this._setupDone = true; - if (_this._accessibleOutputs.grid || _this._accessibleOutputs.text) { - _this._updateAccsOutput(); - } - _this.callRegisteredHooksFor('afterSetup'); - }; - this._draw = function () { - var now = window.performance.now(); - var time_since_last = now - _this._lastTargetFrameTime; - var target_time_between_frames = 1000 / _this._targetFrameRate; - // only draw if we really need to; don't overextend the browser. - // draw if we're within 5ms of when our next frame should paint - // (this will prevent us from giving up opportunities to draw - // again when it's really about time for us to do so). fixes an - // issue where the frameRate is too low if our refresh loop isn't - // in sync with the browser. note that we have to draw once even - // if looping is off, so we bypass the time delay if that - // is the case. - var epsilon = 5; - if (!_this._loop || time_since_last >= target_time_between_frames - epsilon) { - //mandatory update values(matrixes and stack) - _this.deltaTime = now - _this._lastRealFrameTime; - _this._setProperty('deltaTime', _this.deltaTime); - _this._frameRate = 1000 / _this.deltaTime; - _this.redraw(); - _this._lastTargetFrameTime = Math.max(_this._lastTargetFrameTime + target_time_between_frames, now); - _this._lastRealFrameTime = now; - // If the user is actually using mouse module, then update - // coordinates, otherwise skip. We can test this by simply - // checking if any of the mouse functions are available or not. - // NOTE : This reflects only in complete build or modular build. - if (typeof _this._updateMouseCoords !== 'undefined') { - _this._updateMouseCoords(); - //reset delta values so they reset even if there is no mouse event to set them - // for example if the mouse is outside the screen - _this._setProperty('movedX', 0); - _this._setProperty('movedY', 0); - } - } // get notified the next time the browser gives us - // an opportunity to draw. - - if (_this._loop) { - _this._requestAnimId = window.requestAnimationFrame(_this._draw); - } - }; - this._setProperty = function (prop, value) { - _this[prop] = value; - if (_this._isGlobal) { - window[prop] = value; - } - }; - /** - * Removes the entire p5 sketch. This will remove the canvas and any - * elements created by p5.js. It will also stop the draw loop and unbind - * any properties or methods from the window global scope. It will - * leave a variable p5 in case you wanted to create a new p5 sketch. - * If you like, you can set p5 = null to erase it. While all functions and - * variables and objects created by the p5 library will be removed, any - * other global variables created by your code will remain. - * - * @method remove - * @example - *
                - * function draw() { - * ellipse(50, 50, 10, 10); - * } - * - * function mousePressed() { - * remove(); // remove whole sketch on mouse press - * } - *
                - * - * @alt - * nothing displayed - * - */ - this.remove = function () { - // Remove start listener to prevent orphan canvas being created - if (_this._startListener) { - window.removeEventListener('load', _this._startListener, false); - } - var loadingScreen = document.getElementById(_this._loadingScreenId); - if (loadingScreen) { - loadingScreen.parentNode.removeChild(loadingScreen); - // Add 1 to preload counter to prevent the sketch ever executing setup() - _this._incrementPreload(); - } - if (_this._curElement) { - // stop draw - _this._loop = false; - if (_this._requestAnimId) { - window.cancelAnimationFrame(_this._requestAnimId); - } // unregister events sketch-wide - - for (var ev in _this._events) { - window.removeEventListener(ev, _this._events[ev]); - } // remove DOM elements created by p5, and listeners - - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for (var _iterator4 = _this._elements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var e = _step4.value; - if (e.elt && e.elt.parentNode) { - e.elt.parentNode.removeChild(e.elt); - } - for (var elt_ev in e._events) { - e.elt.removeEventListener(elt_ev, e._events[elt_ev]); - } - } // call any registered remove functions - - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - var self = _this; - _this._registeredMethods.remove.forEach(function (f) { - if (typeof f !== 'undefined') { - f.call(self); - } - }); - } // remove window bound properties and methods - - if (_this._isGlobal) { - for (var p in p5.prototype) { - try { - delete window[p]; - } catch (x) { - window[p] = undefined; - } - } - for (var p2 in _this) { - if (_this.hasOwnProperty(p2)) { - try { - delete window[p2]; - } catch (x) { - window[p2] = undefined; - } - } - } - p5.instance = null; - } - }; - // call any registered init functions - this._registeredMethods.init.forEach(function (f) { - if (typeof f !== 'undefined') { - f.call(this); - } - }, this); - // Set up promise preloads - this._setupPromisePreloads(); - var friendlyBindGlobal = this._createFriendlyGlobalFunctionBinder(); - // If the user has created a global setup or draw function, - // assume "global" mode and make everything global (i.e. on the window) - if (!sketch) { - this._isGlobal = true; - p5.instance = this; - // Loop through methods on the prototype and attach them to the window - for (var p in p5.prototype) { - if (typeof p5.prototype[p] === 'function') { - var ev = p.substring(2); - if (!this._events.hasOwnProperty(ev)) { - if (Math.hasOwnProperty(p) && Math[p] === p5.prototype[p]) { - // Multiple p5 methods are just native Math functions. These can be - // called without any binding. - friendlyBindGlobal(p, p5.prototype[p]); - } else { - friendlyBindGlobal(p, p5.prototype[p].bind(this)); - } - } - } else { - friendlyBindGlobal(p, p5.prototype[p]); - } - } // Attach its properties to the window - - for (var p2 in this) { - if (this.hasOwnProperty(p2)) { - friendlyBindGlobal(p2, this[p2]); - } - } - } else { - // Else, the user has passed in a sketch closure that may set - // user-provided 'setup', 'draw', etc. properties on this instance of p5 - sketch(this); - // Run a check to see if the user has misspelled 'setup', 'draw', etc - // detects capitalization mistakes only ( Setup, SETUP, MouseClicked, etc) - p5._checkForUserDefinedFunctions(this); - } // Bind events to window (not using container div bc key events don't work) - - for (var e in this._events) { - var f = this['_on'.concat(e)]; - if (f) { - var m = f.bind(this); - window.addEventListener(e, m, { - passive: false - }); - this._events[e] = m; - } - } - var focusHandler = function focusHandler() { - _this._setProperty('focused', true); - }; - var blurHandler = function blurHandler() { - _this._setProperty('focused', false); - }; - window.addEventListener('focus', focusHandler); - window.addEventListener('blur', blurHandler); - this.registerMethod('remove', function () { - window.removeEventListener('focus', focusHandler); - window.removeEventListener('blur', blurHandler); - }); - if (document.readyState === 'complete') { - this._start(); - } else { - this._startListener = this._start.bind(this); - window.addEventListener('load', this._startListener, false); - } - } - _createClass(p5, [ - { - key: '_initializeInstanceVariables', - value: function _initializeInstanceVariables() { - this._accessibleOutputs = { - text: false, - grid: false, - textLabel: false, - gridLabel: false - }; - this._styles = [ - ]; - this._bezierDetail = 20; - this._curveDetail = 20; - this._colorMode = constants.RGB; - this._colorMaxes = { - rgb: [ - 255, - 255, - 255, - 255 - ], - hsb: [ - 360, - 100, - 100, - 1 - ], - hsl: [ - 360, - 100, - 100, - 1 - ] - }; - this._downKeys = { - }; //Holds the key codes of currently pressed keys - } - }, - { - key: 'registerPreloadMethod', - value: function registerPreloadMethod(fnString, obj) { - // obj = obj || p5.prototype; - if (!p5.prototype._preloadMethods.hasOwnProperty(fnString)) { - p5.prototype._preloadMethods[fnString] = obj; - } - } - }, - { - key: 'registerMethod', - value: function registerMethod(name, m) { - var target = this || p5.prototype; - if (!target._registeredMethods.hasOwnProperty(name)) { - target._registeredMethods[name] = [ - ]; - } - target._registeredMethods[name].push(m); - } - }, - { - key: 'unregisterMethod', - value: function unregisterMethod(name, m) { - var target = this || p5.prototype; - if (target._registeredMethods.hasOwnProperty(name)) { - var methods = target._registeredMethods[name]; - var indexesToRemove = [ - ]; - // Find all indexes of the method `m` in the array of registered methods - for (var i = 0; i < methods.length; i++) { - if (methods[i] === m) { - indexesToRemove.push(i); - } - } // Remove all instances of the method `m` from the array - - for (var _i = indexesToRemove.length - 1; _i >= 0; _i--) { - methods.splice(indexesToRemove[_i], 1); - } - } - } // create a function which provides a standardized process for binding - // globals; this is implemented as a factory primarily so that there's a - // way to redefine what "global" means for the binding function so it - // can be used in scenarios like unit testing where the window object - // might not exist - - }, - { - key: '_createFriendlyGlobalFunctionBinder', - value: function _createFriendlyGlobalFunctionBinder() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - var globalObject = options.globalObject || window; - var log = options.log || console.log.bind(console); - var propsToForciblyOverwrite = { - // p5.print actually always overwrites an existing global function, - // albeit one that is very unlikely to be used: - // - // https://developer.mozilla.org/en-US/docs/Web/API/Window/print - print: true - }; - return function (prop, value) { - if (!p5.disableFriendlyErrors && typeof IS_MINIFIED === 'undefined' && typeof value === 'function' && !(prop in p5.prototype._preloadMethods)) { - try { - // Because p5 has so many common function names, it's likely - // that users may accidentally overwrite global p5 functions with - // their own variables. Let's allow this but log a warning to - // help users who may be doing this unintentionally. - // - // For more information, see: - // - // https://github.com/processing/p5.js/issues/1317 - if (prop in globalObject && !(prop in propsToForciblyOverwrite)) { - throw new Error('global "'.concat(prop, '" already exists')); - } // It's possible that this might throw an error because there - // are a lot of edge-cases in which `Object.defineProperty` might - // not succeed; since this functionality is only intended to - // help beginners anyways, we'll just catch such an exception - // if it occurs, and fall back to legacy behavior. - - Object.defineProperty(globalObject, prop, { - configurable: true, - enumerable: true, - get: function get() { - return value; - }, - set: function set(newValue) { - Object.defineProperty(globalObject, prop, { - configurable: true, - enumerable: true, - value: newValue, - writable: true - }); - log('You just changed the value of "'.concat(prop, '", which was a p5 function. This could cause problems later if you\'re not careful.')); - } - }); - } catch (e) { - var message = 'p5 had problems creating the global function "'.concat(prop, '", possibly because your code is already using that name as a variable. You may want to rename your variable to something else.'); - p5._friendlyError(message, prop); - globalObject[prop] = value; - } - } else { - globalObject[prop] = value; - } - }; - } - } - ]); - return p5; - }(); // This is a pointer to our global mode p5 instance, if we're in - // global mode. - p5.instance = null; - /** - * Turn off some features of the friendly error system (FES), which can give - * a significant boost to performance when needed. - * - * Note that this will disable the parts of the FES that cause performance - * slowdown (like argument checking). Friendly errors that have no performance - * cost (like giving a descriptive error if a file load fails, or warning you - * if you try to override p5.js functions in the global space), - * will remain in place. - * - * See - * disabling the friendly error system. - * - * @property {Boolean} disableFriendlyErrors - * @example - *
                - * p5.disableFriendlyErrors = true; - * - * function setup() { - * createCanvas(100, 50); - * } - *
                - */ - p5.disableFriendlyErrors = false; - // attach constants to p5 prototype - for (var k in constants) { - p5.prototype[k] = constants[k]; - } // makes the `VERSION` constant available on the p5 object - // in instance mode, even if it hasn't been instantiated yet - - p5.VERSION = constants.VERSION; - // functions that cause preload to wait - // more can be added by using registerPreloadMethod(func) - p5.prototype._preloadMethods = { - loadJSON: p5.prototype, - loadImage: p5.prototype, - loadStrings: p5.prototype, - loadXML: p5.prototype, - loadBytes: p5.prototype, - loadTable: p5.prototype, - loadFont: p5.prototype, - loadModel: p5.prototype, - loadShader: p5.prototype - }; - p5.prototype._registeredMethods = { - init: [ - ], - pre: [ - ], - post: [ - ], - remove: [ - ] - }; - p5.prototype._registeredPreloadMethods = { - }; - var _default = p5; - exports.default = _default; - }, - { - './constants': 286, - './shim': 309, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-own-property-names': 197, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 299: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module DOM - * @submodule DOM - * @for p5.Element - */ - /** - * A class to describe an - * HTML element. - * Sketches can use many elements. Common elements include the drawing canvas, - * buttons, sliders, webcam feeds, and so on. - * - * All elements share the methods of the `p5.Element` class. They're created - * with functions such as createCanvas() and - * createButton(). - * - * @class p5.Element - * @constructor - * @param {HTMLElement} elt wrapped DOM element. - * @param {p5} [pInst] pointer to p5 instance. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * - * background(200); - * - * // Create a button element and - * // place it beneath the canvas. - * let btn = createButton('change'); - * btn.position(0, 100); - * - * // Call randomColor() when - * // the button is pressed. - * btn.mousePressed(randomColor); - * - * describe('A gray square with a button that says "change" beneath it. The square changes color when the user presses the button.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - */ - - _main.default.Element = /*#__PURE__*/ function () { - function _class(elt, pInst) { - _classCallCheck(this, _class); - /** - * Underlying - * HTMLElement - * object. Its properties and methods can be used directly. - * - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Set the border style for the - * // canvas. - * cnv.elt.style.border = '5px dashed deeppink'; - * - * describe('A gray square with a pink border drawn with dashed lines.'); - * } - * - *
                - * - * @property elt - * @name elt - * @readOnly - */ - this.elt = elt; - /** - * @private - * @type {p5.Element} - * @name _pInst - */ - this._pInst = this._pixelsState = pInst; - this._events = { - }; - /** - * @type {Number} - * @property width - * @name width - */ - this.width = this.elt.offsetWidth; - /** - * @type {Number} - * @property height - * @name height - */ - this.height = this.elt.offsetHeight; - } /** - * Attaches this element to a parent element. - * - * For example, a `<div></div>` element may be used as a box to - * hold two pieces of text, a header and a paragraph. The - * `<div></div>` is the parent element of both the header and - * paragraph. - * - * The parameter `parent` can have one of three types. `parent` can be a - * string with the parent element's ID, as in - * `myElement.parent('container')`. It can also be another - * p5.Element object, as in - * `myElement.parent(myDiv)`. Finally, `parent` can be an `HTMLElement` - * object, as in `myElement.parent(anotherElement)`. - * - * Calling `myElement.parent()` without an argument returns this element's - * parent. - * - * @method parent - * @param {String|p5.Element|Object} parent ID, p5.Element, - * or HTMLElement of desired parent element. - * @chainable - * - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a div element. - * let div = createDiv(); - * // Place the div in the top-left corner. - * div.position(10, 20); - * // Set its width and height. - * div.size(80, 60); - * // Set its background color to white - * div.style('background-color', 'white'); - * // Align any text to the center. - * div.style('text-align', 'center'); - * // Set its ID to "container". - * div.id('container'); - * - * // Create a paragraph element. - * let p = createP('p5*js'); - * // Make the div its parent - * // using its ID "container". - * p.parent('container'); - * - * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create rectangular div element. - * let div = createDiv(); - * // Place the div in the top-left corner. - * div.position(10, 20); - * // Set its width and height. - * div.size(80, 60); - * // Set its background color and align - * // any text to the center. - * div.style('background-color', 'white'); - * div.style('text-align', 'center'); - * - * // Create a paragraph element. - * let p = createP('p5*js'); - * // Make the div its parent. - * p.parent(div); - * - * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create rectangular div element. - * let div = createDiv(); - * // Place the div in the top-left corner. - * div.position(10, 20); - * // Set its width and height. - * div.size(80, 60); - * // Set its background color and align - * // any text to the center. - * div.style('background-color', 'white'); - * div.style('text-align', 'center'); - * - * // Create a paragraph element. - * let p = createP('p5*js'); - * // Make the div its parent - * // using the underlying - * // HTMLElement. - * p.parent(div.elt); - * - * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); - * } - * - *
                - */ - /** - * @method parent - * @return {p5.Element} - */ - - _createClass(_class, [ - { - key: 'parent', - value: function parent(p) { - if (typeof p === 'undefined') { - return this.elt.parentNode; - } - if (typeof p === 'string') { - if (p[0] === '#') { - p = p.substring(1); - } - p = document.getElementById(p); - } else if (p instanceof _main.default.Element) { - p = p.elt; - } - p.appendChild(this.elt); - return this; - } /** - * Sets this element's ID using a given string. - * - * Calling `myElement.id()` without an argument returns its ID as a string. - * - * @method id - * @param {String} id ID of the element. - * @chainable - * - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Set the canvas' ID - * // to "mycanvas". - * cnv.id('mycanvas'); - * - * // Get the canvas' ID. - * let id = cnv.id(); - * text(id, 24, 54); - * - * describe('The text "mycanvas" written in black on a gray background.'); - * } - * - *
                - */ - /** - * @method id - * @return {String} ID of the element. - */ - - }, - { - key: 'id', - value: function id(_id) { - if (typeof _id === 'undefined') { - return this.elt.id; - } - this.elt.id = _id; - this.width = this.elt.offsetWidth; - this.height = this.elt.offsetHeight; - return this; - } /** - * Adds a - * class attribute - * to the element. - * - * Calling `myElement.class()` without an argument returns a string with its current classes. - * - * @method class - * @param {String} class class to add. - * @chainable - * - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Add the class "small" to the - * // canvas element. - * cnv.class('small'); - * - * // Get the canvas element's class - * // and display it. - * let c = cnv.class(); - * text(c, 35, 54); - * - * describe('The word "small" written in black on a gray canvas.'); - * - * } - * - *
                - */ - /** - * @method class - * @return {String} element's classes, if any. - */ - - }, - { - key: 'class', - value: function _class(c) { - if (typeof c === 'undefined') { - return this.elt.className; - } - this.elt.className = c; - return this; - } /** - * Calls a function when the mouse is pressed over the element. - * Calling `myElement.mousePressed(false)` disables the function. - * - * Note: Some mobile browsers may also trigger this event when the element - * receives a quick tap. - * - * @method mousePressed - * @param {Function|Boolean} fxn function to call when the mouse is - * pressed over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the canvas - * // is pressed. - * cnv.mousePressed(randomColor); - * - * describe('A gray square changes color when the mouse is pressed.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the canvas is pressed. - * cnv.mousePressed(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse is pressed.'); - * } - * - *
                - */ - - }, - { - key: 'mousePressed', - value: function mousePressed(fxn) { - // Prepend the mouse property setters to the event-listener. - // This is required so that mouseButton is set correctly prior to calling the callback (fxn). - // For details, see https://github.com/processing/p5.js/issues/3087. - var eventPrependedFxn = function eventPrependedFxn(event) { - this._pInst._setProperty('mouseIsPressed', true); - this._pInst._setMouseButton(event); - // Pass along the return-value of the callback: - return fxn.call(this, event); - }; - // Pass along the event-prepended form of the callback. - _main.default.Element._adjustListener('mousedown', eventPrependedFxn, this); - return this; - } /** - * Calls a function when the mouse is pressed twice over the element. - * Calling `myElement.doubleClicked(false)` disables the function. - * - * @method doubleClicked - * @param {Function|Boolean} fxn function to call when the mouse is - * double clicked over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // canvas is double-clicked. - * cnv.doubleClicked(randomColor); - * - * describe('A gray square changes color when the user double-clicks the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the canvas is double-clicked. - * cnv.doubleClicked(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user double-clicks the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'doubleClicked', - value: function doubleClicked(fxn) { - _main.default.Element._adjustListener('dblclick', fxn, this); - return this; - } /** - * Calls a function when the mouse wheel scrolls over th element. - * - * The callback function, `fxn`, is passed an `event` object. `event` has - * two numeric properties, `deltaY` and `deltaX`. `event.deltaY` is - * negative if the mouse wheel rotates away from the user. It's positive if - * the mouse wheel rotates toward the user. `event.deltaX` is positive if - * the mouse wheel moves to the right. It's negative if the mouse wheel moves - * to the left. - * - * Calling `myElement.mouseWheel(false)` disables the function. - * - * @method mouseWheel - * @param {Function|Boolean} fxn function to call when the mouse wheel is - * scrolled over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse wheel moves. - * cnv.mouseWheel(randomColor); - * - * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse wheel moves. - * cnv.mouseWheel(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call changeBackground() when the - * // mouse wheel moves. - * cnv.mouseWheel(changeBackground); - * - * describe('A gray square. When the mouse wheel scrolls over the square, it changes color and displays shapes.'); - * } - * - * function changeBackground(event) { - * // Change the background color - * // based on deltaY. - * if (event.deltaY > 0) { - * background('deeppink'); - * } else if (event.deltaY < 0) { - * background('cornflowerblue'); - * } else { - * background(200); - * } - * - * // Draw a shape based on deltaX. - * if (event.deltaX > 0) { - * circle(50, 50, 20); - * } else if (event.deltaX < 0) { - * square(40, 40, 20); - * } - * } - * - *
                - */ - - }, - { - key: 'mouseWheel', - value: function mouseWheel(fxn) { - _main.default.Element._adjustListener('wheel', fxn, this); - return this; - } /** - * Calls a function when the mouse is released over the element. Calling - * `myElement.mouseReleased(false)` disables the function. - * - * Note: Some mobile browsers may also trigger this event when the element - * receives a quick tap. - * - * @method mouseReleased - * @param {Function|Boolean} fxn function to call when the mouse is - * pressed over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when a - * // mouse press ends. - * cnv.mouseReleased(randomColor); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when a mouse press ends. - * cnv.mouseReleased(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - *
                - */ - - }, - { - key: 'mouseReleased', - value: function mouseReleased(fxn) { - _main.default.Element._adjustListener('mouseup', fxn, this); - return this; - } /** - * Calls a function when the mouse is pressed and released over the element. - * Calling `myElement.mouseReleased(false)` disables the function. - * - * Note: Some mobile browsers may also trigger this event when the element - * receives a quick tap. - * - * @method mouseClicked - * @param {Function|Boolean} fxn function to call when the mouse is - * pressed and released over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when a - * // mouse press ends. - * cnv.mouseClicked(randomColor); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when a mouse press ends. - * cnv.mouseClicked(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - *
                - */ - - }, - { - key: 'mouseClicked', - value: function mouseClicked(fxn) { - _main.default.Element._adjustListener('click', fxn, this); - return this; - } /** - * Calls a function when the mouse moves over the element. Calling - * `myElement.mouseMoved(false)` disables the function. - * - * @method mouseMoved - * @param {Function|Boolean} fxn function to call when the mouse - * moves over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse moves. - * cnv.mouseMoved(randomColor); - * - * describe('A gray square changes color when the mouse moves over the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse moves. - * cnv.mouseMoved(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse moves over the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'mouseMoved', - value: function mouseMoved(fxn) { - _main.default.Element._adjustListener('mousemove', fxn, this); - return this; - } /** - * Calls a function when the mouse moves onto the element. Calling - * `myElement.mouseOver(false)` disables the function. - * - * @method mouseOver - * @param {Function|Boolean} fxn function to call when the mouse - * moves onto the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse moves onto the canvas. - * cnv.mouseOver(randomColor); - * - * describe('A gray square changes color when the mouse moves onto the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse moves onto - * // the canvas. - * cnv.mouseOver(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse moves onto the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'mouseOver', - value: function mouseOver(fxn) { - _main.default.Element._adjustListener('mouseover', fxn, this); - return this; - } /** - * Calls a function when the mouse moves off the element. Calling - * `myElement.mouseOut(false)` disables the function. - * - * @method mouseOut - * @param {Function|Boolean} fxn function to call when the mouse - * moves off the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse moves off the canvas. - * cnv.mouseOut(randomColor); - * - * describe('A gray square changes color when the mouse moves off the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse moves off - * // the canvas. - * cnv.mouseOut(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse moves off the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'mouseOut', - value: function mouseOut(fxn) { - _main.default.Element._adjustListener('mouseout', fxn, this); - return this; - } /** - * Calls a function when the element is touched. Calling - * `myElement.touchStarted(false)` disables the function. - * - * Note: Touch functions only work on mobile devices. - * - * @method touchStarted - * @param {Function|Boolean} fxn function to call when the touch - * starts. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // user touches the canvas. - * cnv.touchStarted(randomColor); - * - * describe('A gray square changes color when the user touches the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the user touches the - * // canvas. - * cnv.touchStarted(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user touches the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'touchStarted', - value: function touchStarted(fxn) { - _main.default.Element._adjustListener('touchstart', fxn, this); - return this; - } /** - * Calls a function when the user touches the element and moves their - * finger. Calling `myElement.touchMoved(false)` disables the - * function. - * - * Note: Touch functions only work on mobile devices. - * - * @method touchMoved - * @param {Function|Boolean} fxn function to call when the touch - * moves over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // user touches the canvas - * // and moves. - * cnv.touchMoved(randomColor); - * - * describe('A gray square changes color when the user touches the canvas and moves.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the user touches the - * // canvas and moves. - * cnv.touchMoved(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user touches the canvas and moves.'); - * } - * - *
                - */ - - }, - { - key: 'touchMoved', - value: function touchMoved(fxn) { - _main.default.Element._adjustListener('touchmove', fxn, this); - return this; - } /** - * Calls a function when the user stops touching the element. Calling - * `myElement.touchMoved(false)` disables the function. - * - * Note: Touch functions only work on mobile devices. - * - * @method touchEnded - * @param {Function|Boolean} fxn function to call when the touch - * ends. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // user touches the canvas, - * // then lifts their finger. - * cnv.touchEnded(randomColor); - * - * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the user touches the - * // canvas, then lifts their - * // finger. - * cnv.touchEnded(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); - * } - * - *
                - */ - - }, - { - key: 'touchEnded', - value: function touchEnded(fxn) { - _main.default.Element._adjustListener('touchend', fxn, this); - return this; - } /** - * Calls a function when a file is dragged over the element. Calling - * `myElement.dragOver(false)` disables the function. - * - * @method dragOver - * @param {Function|Boolean} fxn function to call when the file is - * dragged over the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * // Drag a file over the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call helloFile() when a - * // file is dragged over - * // the canvas. - * cnv.dragOver(helloFile); - * - * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); - * } - * - * function helloFile() { - * text('hello, file', 50, 50); - * } - * - *
                - * - *
                - * - * // Drag a file over the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Say "hello, file" when a - * // file is dragged over - * // the canvas. - * cnv.dragOver(() => { - * text('hello, file', 50, 50); - * }); - * - * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); - * } - * - *
                - */ - - }, - { - key: 'dragOver', - value: function dragOver(fxn) { - _main.default.Element._adjustListener('dragover', fxn, this); - return this; - } /** - * Calls a function when a file is dragged off the element. Calling - * Calling `myElement.dragLeave(false)` disables the function. - * - * @method dragLeave - * @param {Function|Boolean} fxn function to call when the file is - * dragged off the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * // Drag a file over, then off - * // the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call byeFile() when a - * // file is dragged over, - * // then off the canvas. - * cnv.dragLeave(byeFile); - * - * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); - * } - * - * function byeFile() { - * text('bye, file', 50, 50); - * } - * - *
                - * - *
                - * - * // Drag a file over, then off - * // the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Say "bye, file" when a - * // file is dragged over, - * // then off the canvas. - * cnv.dragLeave(() => { - * text('bye, file', 50, 50); - * }); - * - * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); - * } - * - *
                - */ - - }, - { - key: 'dragLeave', - value: function dragLeave(fxn) { - _main.default.Element._adjustListener('dragleave', fxn, this); - return this; - } /** - * - * @private - * @static - * @param {String} ev - * @param {Boolean|Function} fxn - * @param {Element} ctx - * @chainable - * @alt - * General handler for event attaching and detaching - */ - - }, - { - key: '_setProperty', - /** - * Helper fxn for sharing pixel methods - */ - value: function _setProperty(prop, value) { - this[prop] = value; - } - } - ], [ - { - key: '_adjustListener', - value: function _adjustListener(ev, fxn, ctx) { - if (fxn === false) { - _main.default.Element._detachListener(ev, ctx); - } else { - _main.default.Element._attachListener(ev, fxn, ctx); - } - return this; - } /** - * - * @private - * @static - * @param {String} ev - * @param {Function} fxn - * @param {Element} ctx - */ - - }, - { - key: '_attachListener', - value: function _attachListener(ev, fxn, ctx) { - // detach the old listener if there was one - if (ctx._events[ev]) { - _main.default.Element._detachListener(ev, ctx); - } - var f = fxn.bind(ctx); - ctx.elt.addEventListener(ev, f, false); - ctx._events[ev] = f; - } /** - * - * @private - * @static - * @param {String} ev - * @param {Element} ctx - */ - - }, - { - key: '_detachListener', - value: function _detachListener(ev, ctx) { - var f = ctx._events[ev]; - ctx.elt.removeEventListener(ev, f, false); - ctx._events[ev] = null; - } - } - ]); - return _class; - }(); - var _default = _main.default.Element; - exports.default = _default; - }, - { - './main': 298 - } - ], - 300: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - var constants = _interopRequireWildcard(_dereq_('./constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - /** - * Thin wrapper around a renderer, to be used for creating a - * graphics buffer object. Use this class if you need - * to draw into an off-screen graphics buffer. The two parameters define the - * width and height in pixels. The fields and methods for this class are - * extensive, but mirror the normal drawing API for p5. - * - * @class p5.Graphics - * @constructor - * @extends p5.Element - * @param {Number} w width - * @param {Number} h height - * @param {Constant} renderer the renderer to use, either P2D or WEBGL - * @param {p5} [pInst] pointer to p5 instance - * @param {HTMLCanvasElement} [canvas] existing html canvas element - */ - - _main.default.Graphics = /*#__PURE__*/ function (_p5$Element) { - _inherits(_class, _p5$Element); - var _super = _createSuper(_class); - function _class(w, h, renderer, pInst, canvas) { - var _this; - _classCallCheck(this, _class); - var canvasTemp; - if (canvas) { - canvasTemp = canvas; - } else { - canvasTemp = document.createElement('canvas'); - } - _this = _super.call(this, canvasTemp, pInst); - _this.canvas = canvasTemp; - var r = renderer || constants.P2D; - var node = pInst._userNode || document.body; - if (!canvas) { - node.appendChild(_this.canvas); - } // bind methods and props of p5 to the new object - - for (var p in _main.default.prototype) { - if (!_this[p]) { - if (typeof _main.default.prototype[p] === 'function') { - _this[p] = _main.default.prototype[p].bind(_assertThisInitialized(_this)); - } else { - _this[p] = _main.default.prototype[p]; - } - } - } - _main.default.prototype._initializeInstanceVariables.apply(_assertThisInitialized(_this)); - _this.width = w; - _this.height = h; - _this._pixelDensity = pInst._pixelDensity; - if (r === constants.WEBGL) { - _this._renderer = new _main.default.RendererGL(_this.canvas, _assertThisInitialized(_this), false); - } else { - _this._renderer = new _main.default.Renderer2D(_this.canvas, _assertThisInitialized(_this), false); - } - pInst._elements.push(_assertThisInitialized(_this)); - Object.defineProperty(_assertThisInitialized(_this), 'deltaTime', { - get: function get() { - return this._pInst.deltaTime; - } - }); - _this._renderer.resize(w, h); - _this._renderer._applyDefaults(); - return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); - } /** - * Resets certain values such as those modified by functions in the Transform category - * and in the Lights category that are not automatically reset - * with graphics buffer objects. Calling this in draw() will copy the behavior - * of the standard canvas. - * - * @method reset - * @example - * - *
                - * let pg; - * function setup() { - * createCanvas(100, 100); - * background(0); - * pg = createGraphics(50, 100); - * pg.fill(0); - * frameRate(5); - * } - * - * function draw() { - * image(pg, width / 2, 0); - * pg.background(255); - * // p5.Graphics object behave a bit differently in some cases - * // The normal canvas on the left resets the translate - * // with every loop through draw() - * // the graphics object on the right doesn't automatically reset - * // so translate() is additive and it moves down the screen - * rect(0, 0, width / 2, 5); - * pg.rect(0, 0, width / 2, 5); - * translate(0, 5, 0); - * pg.translate(0, 5, 0); - * } - * function mouseClicked() { - * // if you click you will see that - * // reset() resets the translate back to the initial state - * // of the Graphics object - * pg.reset(); - * } - *
                - * - * @alt - * A white line on a black background stays still on the top-left half. - * A black line animates from top to bottom on a white background on the right half. - * When clicked, the black line starts back over at the top. - */ - - _createClass(_class, [ - { - key: 'reset', - value: function reset() { - this._renderer.resetMatrix(); - if (this._renderer.isP3D) { - this._renderer._update(); - } - } /** - * Removes a Graphics object from the page and frees any resources - * associated with it. - * - * @method remove - * - * @example - *
                - * let bg; - * function setup() { - * bg = createCanvas(100, 100); - * bg.background(0); - * image(bg, 0, 0); - * bg.remove(); - * } - *
                - * - *
                - * let bg; - * function setup() { - * pixelDensity(1); - * createCanvas(100, 100); - * stroke(255); - * fill(0); - * - * // create and draw the background image - * bg = createGraphics(100, 100); - * bg.background(200); - * bg.ellipse(50, 50, 80, 80); - * } - * function draw() { - * let t = millis() / 1000; - * // draw the background - * if (bg) { - * image(bg, frameCount % 100, 0); - * image(bg, frameCount % 100 - 100, 0); - * } - * // draw the foreground - * let p = p5.Vector.fromAngle(t, 35).add(50, 50); - * ellipse(p.x, p.y, 30); - * } - * function mouseClicked() { - * // remove the background - * if (bg) { - * bg.remove(); - * bg = null; - * } - * } - *
                - * - * @alt - * no image - * a multi-colored circle moving back and forth over a scrolling background. - */ - - }, - { - key: 'remove', - value: function remove() { - if (this.elt.parentNode) { - this.elt.parentNode.removeChild(this.elt); - } - var idx = this._pInst._elements.indexOf(this); - if (idx !== - 1) { - this._pInst._elements.splice(idx, 1); - } - for (var elt_ev in this._events) { - this.elt.removeEventListener(elt_ev, this._events[elt_ev]); - } - } /** - * Creates and returns a new p5.Framebuffer - * inside a p5.Graphics WebGL context. - * - * This takes the same parameters as the global - * createFramebuffer function. - * - * @method createFramebuffer - */ - - }, - { - key: 'createFramebuffer', - value: function createFramebuffer(options) { - return new _main.default.Framebuffer(this, options); - } - } - ]); - return _class; - }(_main.default.Element); - var _default = _main.default.Graphics; - exports.default = _default; - }, - { - './constants': 286, - './main': 298, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 301: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - /** - * Main graphics and rendering context, as well as the base API - * implementation for p5.js "core". To be used as the superclass for - * Renderer2D and Renderer3D classes, respectively. - * - * @class p5.Renderer - * @constructor - * @extends p5.Element - * @param {HTMLElement} elt DOM node that is wrapped - * @param {p5} [pInst] pointer to p5 instance - * @param {Boolean} [isMainCanvas] whether we're using it as main canvas - */ - - var Renderer = /*#__PURE__*/ function (_p5$Element) { - _inherits(Renderer, _p5$Element); - var _super = _createSuper(Renderer); - function Renderer(elt, pInst, isMainCanvas) { - var _this; - _classCallCheck(this, Renderer); - _this = _super.call(this, elt, pInst); - _this.canvas = elt; - _this._pixelsState = pInst; - if (isMainCanvas) { - _this._isMainCanvas = true; - // for pixel method sharing with pimage - _this._pInst._setProperty('_curElement', _assertThisInitialized(_this)); - _this._pInst._setProperty('canvas', _this.canvas); - _this._pInst._setProperty('width', _this.width); - _this._pInst._setProperty('height', _this.height); - } else { - // hide if offscreen buffer by default - _this.canvas.style.display = 'none'; - _this._styles = [ - ]; // non-main elt styles stored in p5.Renderer - } - _this._clipping = false; - _this._clipInvert = false; - _this._textSize = 12; - _this._textLeading = 15; - _this._textFont = 'sans-serif'; - _this._textStyle = constants.NORMAL; - _this._textAscent = null; - _this._textDescent = null; - _this._textAlign = constants.LEFT; - _this._textBaseline = constants.BASELINE; - _this._textWrap = constants.WORD; - _this._rectMode = constants.CORNER; - _this._ellipseMode = constants.CENTER; - _this._curveTightness = 0; - _this._imageMode = constants.CORNER; - _this._tint = null; - _this._doStroke = true; - _this._doFill = true; - _this._strokeSet = false; - _this._fillSet = false; - _this._leadingSet = false; - _this._pushPopDepth = 0; - return _this; - } // the renderer should return a 'style' object that it wishes to - // store on the push stack. - - _createClass(Renderer, [ - { - key: 'push', - value: function push() { - this._pushPopDepth++; - return { - properties: { - _doStroke: this._doStroke, - _strokeSet: this._strokeSet, - _doFill: this._doFill, - _fillSet: this._fillSet, - _tint: this._tint, - _imageMode: this._imageMode, - _rectMode: this._rectMode, - _ellipseMode: this._ellipseMode, - _textFont: this._textFont, - _textLeading: this._textLeading, - _leadingSet: this._leadingSet, - _textSize: this._textSize, - _textAlign: this._textAlign, - _textBaseline: this._textBaseline, - _textStyle: this._textStyle, - _textWrap: this._textWrap - } - }; - } // a pop() operation is in progress - // the renderer is passed the 'style' object that it returned - // from its push() method. - - }, - { - key: 'pop', - value: function pop(style) { - this._pushPopDepth--; - if (style.properties) { - // copy the style properties back into the renderer - Object.assign(this, style.properties); - } - } - }, - { - key: 'beginClip', - value: function beginClip() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - if (this._clipping) { - throw new Error('It looks like you\'re trying to clip while already in the middle of clipping. Did you forget to endClip()?'); - } - this._clipping = true; - this._clipInvert = options.invert; - } - }, - { - key: 'endClip', - value: function endClip() { - if (!this._clipping) { - throw new Error('It looks like you\'ve called endClip() without beginClip(). Did you forget to call beginClip() first?'); - } - this._clipping = false; - } /** - * Resize our canvas element. - */ - - }, - { - key: 'resize', - value: function resize(w, h) { - this.width = w; - this.height = h; - this.elt.width = w * this._pInst._pixelDensity; - this.elt.height = h * this._pInst._pixelDensity; - this.elt.style.width = ''.concat(w, 'px'); - this.elt.style.height = ''.concat(h, 'px'); - if (this._isMainCanvas) { - this._pInst._setProperty('width', this.width); - this._pInst._setProperty('height', this.height); - } - } - }, - { - key: 'get', - value: function get(x, y, w, h) { - var pixelsState = this._pixelsState; - var pd = pixelsState._pixelDensity; - var canvas = this.canvas; - if (typeof x === 'undefined' && typeof y === 'undefined') { - // get() - x = y = 0; - w = pixelsState.width; - h = pixelsState.height; - } else { - x *= pd; - y *= pd; - if (typeof w === 'undefined' && typeof h === 'undefined') { - // get(x,y) - if (x < 0 || y < 0 || x >= canvas.width || y >= canvas.height) { - return [0, - 0, - 0, - 0]; - } - return this._getPixel(x, y); - } // get(x,y,w,h) - - } - var region = new _main.default.Image(w * pd, h * pd); - region.pixelDensity(pd); - region.canvas.getContext('2d').drawImage(canvas, x, y, w * pd, h * pd, 0, 0, w * pd, h * pd); - return region; - } - }, - { - key: 'textLeading', - value: function textLeading(l) { - if (typeof l === 'number') { - this._setProperty('_leadingSet', true); - this._setProperty('_textLeading', l); - return this._pInst; - } - return this._textLeading; - } - }, - { - key: 'textStyle', - value: function textStyle(s) { - if (s) { - if (s === constants.NORMAL || s === constants.ITALIC || s === constants.BOLD || s === constants.BOLDITALIC) { - this._setProperty('_textStyle', s); - } - return this._applyTextProperties(); - } - return this._textStyle; - } - }, - { - key: 'textAscent', - value: function textAscent() { - if (this._textAscent === null) { - this._updateTextMetrics(); - } - return this._textAscent; - } - }, - { - key: 'textDescent', - value: function textDescent() { - if (this._textDescent === null) { - this._updateTextMetrics(); - } - return this._textDescent; - } - }, - { - key: 'textAlign', - value: function textAlign(h, v) { - if (typeof h !== 'undefined') { - this._setProperty('_textAlign', h); - if (typeof v !== 'undefined') { - this._setProperty('_textBaseline', v); - } - return this._applyTextProperties(); - } else { - return { - horizontal: this._textAlign, - vertical: this._textBaseline - }; - } - } - }, - { - key: 'textWrap', - value: function textWrap(wrapStyle) { - this._setProperty('_textWrap', wrapStyle); - return this._textWrap; - } - }, - { - key: 'text', - value: function text(str, x, y, maxWidth, maxHeight) { - var p = this._pInst; - var textWrapStyle = this._textWrap; - var lines; - var line; - var testLine; - var testWidth; - var words; - var chars; - var shiftedY; - var finalMaxHeight = Number.MAX_VALUE; - // fix for #5785 (top of bounding box) - var finalMinHeight = y; - if (!(this._doFill || this._doStroke)) { - return; - } - if (typeof str === 'undefined') { - return; - } else if (typeof str !== 'string') { - str = str.toString(); - } // Replaces tabs with double-spaces and splits string on any line - // breaks present in the original string - - str = str.replace(/(\t)/g, ' '); - lines = str.split('\n'); - if (typeof maxWidth !== 'undefined') { - if (this._rectMode === constants.CENTER) { - x -= maxWidth / 2; - } - switch (this._textAlign) { - case constants.CENTER: - x += maxWidth / 2; - break; - case constants.RIGHT: - x += maxWidth; - break; - } - if (typeof maxHeight !== 'undefined') { - if (this._rectMode === constants.CENTER) { - y -= maxHeight / 2; - finalMinHeight -= maxHeight / 2; - } - var originalY = y; - var ascent = p.textAscent(); - switch (this._textBaseline) { - case constants.BOTTOM: - shiftedY = y + maxHeight; - y = Math.max(shiftedY, y); - // fix for #5785 (top of bounding box) - finalMinHeight += ascent; - break; - case constants.CENTER: - shiftedY = y + maxHeight / 2; - y = Math.max(shiftedY, y); - // fix for #5785 (top of bounding box) - finalMinHeight += ascent / 2; - break; - } // remember the max-allowed y-position for any line (fix to #928) - - finalMaxHeight = y + maxHeight - ascent; - // fix for #5785 (bottom of bounding box) - if (this._textBaseline === constants.CENTER) { - finalMaxHeight = originalY + maxHeight - ascent / 2; - } - } else { - // no text-height specified, show warning for BOTTOM / CENTER - if (this._textBaseline === constants.BOTTOM || this._textBaseline === constants.CENTER) { - // use rectHeight as an approximation for text height - var rectHeight = p.textSize() * this._textLeading; - finalMinHeight = y - rectHeight / 2; - finalMaxHeight = y + rectHeight / 2; - } - } // Render lines of text according to settings of textWrap - // Splits lines at spaces, for loop adds one word + space - // at a time and tests length with next word added - - if (textWrapStyle === constants.WORD) { - var nlines = [ - ]; - for (var lineIndex = 0; lineIndex < lines.length; lineIndex++) { - line = ''; - words = lines[lineIndex].split(' '); - for (var wordIndex = 0; wordIndex < words.length; wordIndex++) { - testLine = ''.concat(line + words[wordIndex]) + ' '; - testWidth = this.textWidth(testLine); - if (testWidth > maxWidth && line.length > 0) { - nlines.push(line); - line = ''.concat(words[wordIndex]) + ' '; - } else { - line = testLine; - } - } - nlines.push(line); - } - var offset = 0; - if (this._textBaseline === constants.CENTER) { - offset = (nlines.length - 1) * p.textLeading() / 2; - } else if (this._textBaseline === constants.BOTTOM) { - offset = (nlines.length - 1) * p.textLeading(); - } - for (var _lineIndex = 0; _lineIndex < lines.length; _lineIndex++) { - line = ''; - words = lines[_lineIndex].split(' '); - for (var _wordIndex = 0; _wordIndex < words.length; _wordIndex++) { - testLine = ''.concat(line + words[_wordIndex]) + ' '; - testWidth = this.textWidth(testLine); - if (testWidth > maxWidth && line.length > 0) { - this._renderText(p, line.trim(), x, y - offset, finalMaxHeight, finalMinHeight); - line = ''.concat(words[_wordIndex]) + ' '; - y += p.textLeading(); - } else { - line = testLine; - } - } - this._renderText(p, line.trim(), x, y - offset, finalMaxHeight, finalMinHeight); - y += p.textLeading(); - } - } else { - var _nlines = [ - ]; - for (var _lineIndex2 = 0; _lineIndex2 < lines.length; _lineIndex2++) { - line = ''; - chars = lines[_lineIndex2].split(''); - for (var charIndex = 0; charIndex < chars.length; charIndex++) { - testLine = ''.concat(line + chars[charIndex]); - testWidth = this.textWidth(testLine); - if (testWidth <= maxWidth) { - line += chars[charIndex]; - } else if (testWidth > maxWidth && line.length > 0) { - _nlines.push(line); - line = ''.concat(chars[charIndex]); - } - } - } - _nlines.push(line); - var _offset = 0; - if (this._textBaseline === constants.CENTER) { - _offset = (_nlines.length - 1) * p.textLeading() / 2; - } else if (this._textBaseline === constants.BOTTOM) { - _offset = (_nlines.length - 1) * p.textLeading(); - } // Splits lines at characters, for loop adds one char at a time - // and tests length with next char added - - for (var _lineIndex3 = 0; _lineIndex3 < lines.length; _lineIndex3++) { - line = ''; - chars = lines[_lineIndex3].split(''); - for (var _charIndex = 0; _charIndex < chars.length; _charIndex++) { - testLine = ''.concat(line + chars[_charIndex]); - testWidth = this.textWidth(testLine); - if (testWidth <= maxWidth) { - line += chars[_charIndex]; - } else if (testWidth > maxWidth && line.length > 0) { - this._renderText(p, line.trim(), x, y - _offset, finalMaxHeight, finalMinHeight); - y += p.textLeading(); - line = ''.concat(chars[_charIndex]); - } - } - } - this._renderText(p, line.trim(), x, y - _offset, finalMaxHeight, finalMinHeight); - y += p.textLeading(); - } - } else { - // Offset to account for vertically centering multiple lines of text - no - // need to adjust anything for vertical align top or baseline - var _offset2 = 0; - if (this._textBaseline === constants.CENTER) { - _offset2 = (lines.length - 1) * p.textLeading() / 2; - } else if (this._textBaseline === constants.BOTTOM) { - _offset2 = (lines.length - 1) * p.textLeading(); - } // Renders lines of text at any line breaks present in the original string - - for (var i = 0; i < lines.length; i++) { - this._renderText(p, lines[i], x, y - _offset2, finalMaxHeight, finalMinHeight - _offset2); - y += p.textLeading(); - } - } - return p; - } - }, - { - key: '_applyDefaults', - value: function _applyDefaults() { - return this; - } /** - * Helper function to check font type (system or otf) - */ - - }, - { - key: '_isOpenType', - value: function _isOpenType() { - var f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._textFont; - return _typeof(f) === 'object' && f.font && f.font.supported; - } - }, - { - key: '_updateTextMetrics', - value: function _updateTextMetrics() { - if (this._isOpenType()) { - this._setProperty('_textAscent', this._textFont._textAscent()); - this._setProperty('_textDescent', this._textFont._textDescent()); - return this; - } // Adapted from http://stackoverflow.com/a/25355178 - - var text = document.createElement('span'); - text.style.fontFamily = this._textFont; - text.style.fontSize = ''.concat(this._textSize, 'px'); - text.innerHTML = 'ABCjgq|'; - var block = document.createElement('div'); - block.style.display = 'inline-block'; - block.style.width = '1px'; - block.style.height = '0px'; - var container = document.createElement('div'); - container.appendChild(text); - container.appendChild(block); - container.style.height = '0px'; - container.style.overflow = 'hidden'; - document.body.appendChild(container); - block.style.verticalAlign = 'baseline'; - var blockOffset = calculateOffset(block); - var textOffset = calculateOffset(text); - var ascent = blockOffset[1] - textOffset[1]; - block.style.verticalAlign = 'bottom'; - blockOffset = calculateOffset(block); - textOffset = calculateOffset(text); - var height = blockOffset[1] - textOffset[1]; - var descent = height - ascent; - document.body.removeChild(container); - this._setProperty('_textAscent', ascent); - this._setProperty('_textDescent', descent); - return this; - } - } - ]); - return Renderer; - }(_main.default.Element); - /** - * Helper fxn to measure ascent and descent. - * Adapted from http://stackoverflow.com/a/25355178 - */ - function calculateOffset(object) { - var currentLeft = 0, - currentTop = 0; - if (object.offsetParent) { - do { - currentLeft += object.offsetLeft; - currentTop += object.offsetTop; - } while (object = object.offsetParent); - } else { - currentLeft += object.offsetLeft; - currentTop += object.offsetTop; - } - return [currentLeft, - currentTop]; - } // This caused the test to failed. - - Renderer.prototype.textSize = function (s) { - if (typeof s === 'number') { - this._setProperty('_textSize', s); - if (!this._leadingSet) { - // only use a default value if not previously set (#5181) - this._setProperty('_textLeading', s * constants._DEFAULT_LEADMULT); - } - return this._applyTextProperties(); - } - return this._textSize; - }; - _main.default.Renderer = Renderer; - var _default = _main.default.Renderer; - exports.default = _default; - }, - { - '../core/constants': 286, - './main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.number.constructor': 191, - 'core-js/modules/es.object.assign': 194, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.trim': 219, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 302: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.reflect.get'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - var constants = _interopRequireWildcard(_dereq_('./constants')); - _dereq_('./p5.Renderer'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _get(target, property, receiver) { - if (typeof Reflect !== 'undefined' && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * p5.Renderer2D - * The 2D graphics canvas renderer class. - * extends p5.Renderer - */ - - var styleEmpty = 'rgba(0,0,0,0)'; - // const alphaThreshold = 0.00125; // minimum visible - var Renderer2D = /*#__PURE__*/ function (_p5$Renderer) { - _inherits(Renderer2D, _p5$Renderer); - var _super = _createSuper(Renderer2D); - function Renderer2D(elt, pInst, isMainCanvas) { - var _this; - _classCallCheck(this, Renderer2D); - _this = _super.call(this, elt, pInst, isMainCanvas); - _this.drawingContext = _this.canvas.getContext('2d'); - _this._pInst._setProperty('drawingContext', _this.drawingContext); - return _this; - } - _createClass(Renderer2D, [ - { - key: 'getFilterGraphicsLayer', - value: function getFilterGraphicsLayer() { - // create hidden webgl renderer if it doesn't exist - if (!this.filterGraphicsLayer) { - // the real _pInst is buried when this is a secondary p5.Graphics - var pInst = this._pInst instanceof _main.default.Graphics ? this._pInst._pInst : this._pInst; - // create secondary layer - this.filterGraphicsLayer = new _main.default.Graphics(this.width, this.height, constants.WEBGL, pInst); - } - if (this.filterGraphicsLayer.width !== this.width || this.filterGraphicsLayer.height !== this.height) { - // Resize the graphics layer - this.filterGraphicsLayer.resizeCanvas(this.width, this.height); - } - if (this.filterGraphicsLayer.pixelDensity() !== this._pInst.pixelDensity()) { - this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()); - } - return this.filterGraphicsLayer; - } - }, - { - key: '_applyDefaults', - value: function _applyDefaults() { - this._cachedFillStyle = this._cachedStrokeStyle = undefined; - this._cachedBlendMode = constants.BLEND; - this._setFill(constants._DEFAULT_FILL); - this._setStroke(constants._DEFAULT_STROKE); - this.drawingContext.lineCap = constants.ROUND; - this.drawingContext.font = 'normal 12px sans-serif'; - } - }, - { - key: 'resize', - value: function resize(w, h) { - _get(_getPrototypeOf(Renderer2D.prototype), 'resize', this).call(this, w, h); - this.drawingContext.scale(this._pInst._pixelDensity, this._pInst._pixelDensity); - } ////////////////////////////////////////////// - // COLOR | Setting - ////////////////////////////////////////////// - - }, - { - key: 'background', - value: function background() { - this.drawingContext.save(); - this.resetMatrix(); - if ((arguments.length <= 0 ? undefined : arguments[0]) instanceof _main.default.Image) { - if ((arguments.length <= 1 ? undefined : arguments[1]) >= 0) { - // set transparency of background - var img = arguments.length <= 0 ? undefined : arguments[0]; - this.drawingContext.globalAlpha = (arguments.length <= 1 ? undefined : arguments[1]) / 255; - this._pInst.image(img, 0, 0, this.width, this.height); - } else { - this._pInst.image(arguments.length <= 0 ? undefined : arguments[0], 0, 0, this.width, this.height); - } - } else { - var _this$_pInst; - var curFill = this._getFill(); - // create background rect - var color = (_this$_pInst = this._pInst).color.apply(_this$_pInst, arguments); - //accessible Outputs - if (this._pInst._addAccsOutput()) { - this._pInst._accsBackground(color.levels); - } - var newFill = color.toString(); - this._setFill(newFill); - if (this._isErasing) { - this.blendMode(this._cachedBlendMode); - } - this.drawingContext.fillRect(0, 0, this.width, this.height); - // reset fill - this._setFill(curFill); - if (this._isErasing) { - this._pInst.erase(); - } - } - this.drawingContext.restore(); - } - }, - { - key: 'clear', - value: function clear() { - this.drawingContext.save(); - this.resetMatrix(); - this.drawingContext.clearRect(0, 0, this.width, this.height); - this.drawingContext.restore(); - } - }, - { - key: 'fill', - value: function fill() { - var _this$_pInst2; - var color = (_this$_pInst2 = this._pInst).color.apply(_this$_pInst2, arguments); - this._setFill(color.toString()); - //accessible Outputs - if (this._pInst._addAccsOutput()) { - this._pInst._accsCanvasColors('fill', color.levels); - } - } - }, - { - key: 'stroke', - value: function stroke() { - var _this$_pInst3; - var color = (_this$_pInst3 = this._pInst).color.apply(_this$_pInst3, arguments); - this._setStroke(color.toString()); - //accessible Outputs - if (this._pInst._addAccsOutput()) { - this._pInst._accsCanvasColors('stroke', color.levels); - } - } - }, - { - key: 'erase', - value: function erase(opacityFill, opacityStroke) { - if (!this._isErasing) { - // cache the fill style - this._cachedFillStyle = this.drawingContext.fillStyle; - var newFill = this._pInst.color(255, opacityFill).toString(); - this.drawingContext.fillStyle = newFill; - // cache the stroke style - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - var newStroke = this._pInst.color(255, opacityStroke).toString(); - this.drawingContext.strokeStyle = newStroke; - // cache blendMode - var tempBlendMode = this._cachedBlendMode; - this.blendMode(constants.REMOVE); - this._cachedBlendMode = tempBlendMode; - this._isErasing = true; - } - } - }, - { - key: 'noErase', - value: function noErase() { - if (this._isErasing) { - this.drawingContext.fillStyle = this._cachedFillStyle; - this.drawingContext.strokeStyle = this._cachedStrokeStyle; - this.blendMode(this._cachedBlendMode); - this._isErasing = false; - } - } - }, - { - key: 'beginClip', - value: function beginClip() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - _get(_getPrototypeOf(Renderer2D.prototype), 'beginClip', this).call(this, options); - // cache the fill style - this._cachedFillStyle = this.drawingContext.fillStyle; - var newFill = this._pInst.color(255, 0).toString(); - this.drawingContext.fillStyle = newFill; - // cache the stroke style - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - var newStroke = this._pInst.color(255, 0).toString(); - this.drawingContext.strokeStyle = newStroke; - // cache blendMode - var tempBlendMode = this._cachedBlendMode; - this.blendMode(constants.BLEND); - this._cachedBlendMode = tempBlendMode; - // Start a new path. Everything from here on out should become part of this - // one path so that we can clip to the whole thing. - this.drawingContext.beginPath(); - if (this._clipInvert) { - // Slight hack: draw a big rectangle over everything with reverse winding - // order. This is hopefully large enough to cover most things. - this.drawingContext.moveTo( - 2 * this.width, - 2 * this.height); - this.drawingContext.lineTo( - 2 * this.width, 2 * this.height); - this.drawingContext.lineTo(2 * this.width, 2 * this.height); - this.drawingContext.lineTo(2 * this.width, - 2 * this.height); - this.drawingContext.closePath(); - } - } - }, - { - key: 'endClip', - value: function endClip() { - this._doFillStrokeClose(); - this.drawingContext.clip(); - _get(_getPrototypeOf(Renderer2D.prototype), 'endClip', this).call(this); - this.drawingContext.fillStyle = this._cachedFillStyle; - this.drawingContext.strokeStyle = this._cachedStrokeStyle; - this.blendMode(this._cachedBlendMode); - } ////////////////////////////////////////////// - // IMAGE | Loading & Displaying - ////////////////////////////////////////////// - - }, - { - key: 'image', - value: function image(img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) { - var cnv; - if (img.gifProperties) { - img._animateGif(this._pInst); - } - try { - if (_main.default.MediaElement && img instanceof _main.default.MediaElement) { - img._ensureCanvas(); - } - if (this._tint && img.canvas) { - cnv = this._getTintedImageCanvas(img); - } - if (!cnv) { - cnv = img.canvas || img.elt; - } - var s = 1; - if (img.width && img.width > 0) { - s = cnv.width / img.width; - } - if (this._isErasing) { - this.blendMode(this._cachedBlendMode); - } - this.drawingContext.drawImage(cnv, s * sx, s * sy, s * sWidth, s * sHeight, dx, dy, dWidth, dHeight); - if (this._isErasing) { - this._pInst.erase(); - } - } catch (e) { - if (e.name !== 'NS_ERROR_NOT_AVAILABLE') { - throw e; - } - } - } - }, - { - key: '_getTintedImageCanvas', - value: function _getTintedImageCanvas(img) { - if (!img.canvas) { - return img; - } - if (!img.tintCanvas) { - // Once an image has been tinted, keep its tint canvas - // around so we don't need to re-incur the cost of - // creating a new one for each tint - img.tintCanvas = document.createElement('canvas'); - } // Keep the size of the tint canvas up-to-date - - if (img.tintCanvas.width !== img.canvas.width) { - img.tintCanvas.width = img.canvas.width; - } - if (img.tintCanvas.height !== img.canvas.height) { - img.tintCanvas.height = img.canvas.height; - } // Goal: multiply the r,g,b,a values of the source by - // the r,g,b,a values of the tint color - - var ctx = img.tintCanvas.getContext('2d'); - ctx.save(); - ctx.clearRect(0, 0, img.canvas.width, img.canvas.height); - if (this._tint[0] < 255 || this._tint[1] < 255 || this._tint[2] < 255) { - // Color tint: we need to use the multiply blend mode to change the colors. - // However, the canvas implementation of this destroys the alpha channel of - // the image. To accommodate, we first get a version of the image with full - // opacity everywhere, tint using multiply, and then use the destination-in - // blend mode to restore the alpha channel again. - // Start with the original image - ctx.drawImage(img.canvas, 0, 0); - // This blend mode makes everything opaque but forces the luma to match - // the original image again - ctx.globalCompositeOperation = 'luminosity'; - ctx.drawImage(img.canvas, 0, 0); - // This blend mode forces the hue and chroma to match the original image. - // After this we should have the original again, but with full opacity. - ctx.globalCompositeOperation = 'color'; - ctx.drawImage(img.canvas, 0, 0); - // Apply color tint - ctx.globalCompositeOperation = 'multiply'; - ctx.fillStyle = 'rgb('.concat(this._tint.slice(0, 3).join(', '), ')'); - ctx.fillRect(0, 0, img.canvas.width, img.canvas.height); - // Replace the alpha channel with the original alpha * the alpha tint - ctx.globalCompositeOperation = 'destination-in'; - ctx.globalAlpha = this._tint[3] / 255; - ctx.drawImage(img.canvas, 0, 0); - } else { - // If we only need to change the alpha, we can skip all the extra work! - ctx.globalAlpha = this._tint[3] / 255; - ctx.drawImage(img.canvas, 0, 0); - } - ctx.restore(); - return img.tintCanvas; - } ////////////////////////////////////////////// - // IMAGE | Pixels - ////////////////////////////////////////////// - - }, - { - key: 'blendMode', - value: function blendMode(mode) { - if (mode === constants.SUBTRACT) { - console.warn('blendMode(SUBTRACT) only works in WEBGL mode.'); - } else if (mode === constants.BLEND || mode === constants.REMOVE || mode === constants.DARKEST || mode === constants.LIGHTEST || mode === constants.DIFFERENCE || mode === constants.MULTIPLY || mode === constants.EXCLUSION || mode === constants.SCREEN || mode === constants.REPLACE || mode === constants.OVERLAY || mode === constants.HARD_LIGHT || mode === constants.SOFT_LIGHT || mode === constants.DODGE || mode === constants.BURN || mode === constants.ADD) { - this._cachedBlendMode = mode; - this.drawingContext.globalCompositeOperation = mode; - } else { - throw new Error('Mode '.concat(mode, ' not recognized.')); - } - } - }, - { - key: 'blend', - value: function blend() { - var currBlend = this.drawingContext.globalCompositeOperation; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - var blendMode = args[args.length - 1]; - var copyArgs = Array.prototype.slice.call(args, 0, args.length - 1); - this.drawingContext.globalCompositeOperation = blendMode; - _main.default.prototype.copy.apply(this, copyArgs); - this.drawingContext.globalCompositeOperation = currBlend; - } // p5.Renderer2D.prototype.get = p5.Renderer.prototype.get; - // .get() is not overridden - // x,y are canvas-relative (pre-scaled by _pixelDensity) - - }, - { - key: '_getPixel', - value: function _getPixel(x, y) { - var imageData, - index; - imageData = this.drawingContext.getImageData(x, y, 1, 1).data; - index = 0; - return [imageData[index + 0], - imageData[index + 1], - imageData[index + 2], - imageData[index + 3]]; - } - }, - { - key: 'loadPixels', - value: function loadPixels() { - var pixelsState = this._pixelsState; // if called by p5.Image - var pd = pixelsState._pixelDensity; - var w = this.width * pd; - var h = this.height * pd; - var imageData = this.drawingContext.getImageData(0, 0, w, h); - // @todo this should actually set pixels per object, so diff buffers can - // have diff pixel arrays. - pixelsState._setProperty('imageData', imageData); - pixelsState._setProperty('pixels', imageData.data); - } - }, - { - key: 'set', - value: function set(x, y, imgOrCol) { - // round down to get integer numbers - x = Math.floor(x); - y = Math.floor(y); - var pixelsState = this._pixelsState; - if (imgOrCol instanceof _main.default.Image) { - this.drawingContext.save(); - this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); - this.drawingContext.scale(pixelsState._pixelDensity, pixelsState._pixelDensity); - this.drawingContext.clearRect(x, y, imgOrCol.width, imgOrCol.height); - this.drawingContext.drawImage(imgOrCol.canvas, x, y); - this.drawingContext.restore(); - } else { - var r = 0, - g = 0, - b = 0, - a = 0; - var idx = 4 * (y * pixelsState._pixelDensity * (this.width * pixelsState._pixelDensity) + x * pixelsState._pixelDensity); - if (!pixelsState.imageData) { - pixelsState.loadPixels.call(pixelsState); - } - if (typeof imgOrCol === 'number') { - if (idx < pixelsState.pixels.length) { - r = imgOrCol; - g = imgOrCol; - b = imgOrCol; - a = 255; - //this.updatePixels.call(this); - } - } else if (imgOrCol instanceof Array) { - if (imgOrCol.length < 4) { - throw new Error('pixel array must be of the form [R, G, B, A]'); - } - if (idx < pixelsState.pixels.length) { - r = imgOrCol[0]; - g = imgOrCol[1]; - b = imgOrCol[2]; - a = imgOrCol[3]; - //this.updatePixels.call(this); - } - } else if (imgOrCol instanceof _main.default.Color) { - if (idx < pixelsState.pixels.length) { - r = imgOrCol.levels[0]; - g = imgOrCol.levels[1]; - b = imgOrCol.levels[2]; - a = imgOrCol.levels[3]; - //this.updatePixels.call(this); - } - } // loop over pixelDensity * pixelDensity - - for (var i = 0; i < pixelsState._pixelDensity; i++) { - for (var j = 0; j < pixelsState._pixelDensity; j++) { - // loop over - idx = 4 * ((y * pixelsState._pixelDensity + j) * this.width * pixelsState._pixelDensity + (x * pixelsState._pixelDensity + i)); - pixelsState.pixels[idx] = r; - pixelsState.pixels[idx + 1] = g; - pixelsState.pixels[idx + 2] = b; - pixelsState.pixels[idx + 3] = a; - } - } - } - } - }, - { - key: 'updatePixels', - value: function updatePixels(x, y, w, h) { - var pixelsState = this._pixelsState; - var pd = pixelsState._pixelDensity; - if (x === undefined && y === undefined && w === undefined && h === undefined) { - x = 0; - y = 0; - w = this.width; - h = this.height; - } - x *= pd; - y *= pd; - w *= pd; - h *= pd; - if (this.gifProperties) { - this.gifProperties.frames[this.gifProperties.displayIndex].image = pixelsState.imageData; - } - this.drawingContext.putImageData(pixelsState.imageData, x, y, 0, 0, w, h); - } ////////////////////////////////////////////// - // SHAPE | 2D Primitives - ////////////////////////////////////////////// - /** - * Generate a cubic Bezier representing an arc on the unit circle of total - * angle `size` radians, beginning `start` radians above the x-axis. Up to - * four of these curves are combined to make a full arc. - * - * See ecridge.com/bezier.pdf for an explanation of the method. - */ - - }, - { - key: '_acuteArcToBezier', - value: function _acuteArcToBezier(start, size) { - // Evaluate constants. - var alpha = size / 2, - cos_alpha = Math.cos(alpha), - sin_alpha = Math.sin(alpha), - cot_alpha = 1 / Math.tan(alpha), - // This is how far the arc needs to be rotated. - phi = start + alpha, - cos_phi = Math.cos(phi), - sin_phi = Math.sin(phi), - lambda = (4 - cos_alpha) / 3, - mu = sin_alpha + (cos_alpha - lambda) * cot_alpha; - // Return rotated waypoints. - return { - ax: Math.cos(start).toFixed(7), - ay: Math.sin(start).toFixed(7), - bx: (lambda * cos_phi + mu * sin_phi).toFixed(7), - by: (lambda * sin_phi - mu * cos_phi).toFixed(7), - cx: (lambda * cos_phi - mu * sin_phi).toFixed(7), - cy: (lambda * sin_phi + mu * cos_phi).toFixed(7), - dx: Math.cos(start + size).toFixed(7), - dy: Math.sin(start + size).toFixed(7) - }; - } /* - * This function requires that: - * - * 0 <= start < TWO_PI - * - * start <= stop < start + TWO_PI - */ - - }, - { - key: 'arc', - value: function arc(x, y, w, h, start, stop, mode) { - var ctx = this.drawingContext; - var rx = w / 2; - var ry = h / 2; - var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. - var arcToDraw = 0; - var curves = [ - ]; - x += rx; - y += ry; - // Create curves - while (stop - start >= epsilon) { - arcToDraw = Math.min(stop - start, constants.HALF_PI); - curves.push(this._acuteArcToBezier(start, arcToDraw)); - start += arcToDraw; - } // Fill curves - - if (this._doFill) { - if (!this._clipping) ctx.beginPath(); - curves.forEach(function (curve, index) { - if (index === 0) { - ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); - } /* eslint-disable indent */ - - ctx.bezierCurveTo(x + curve.bx * rx, y + curve.by * ry, x + curve.cx * rx, y + curve.cy * ry, x + curve.dx * rx, y + curve.dy * ry); - /* eslint-enable indent */ - }); - if (mode === constants.PIE || mode == null) { - ctx.lineTo(x, y); - } - ctx.closePath(); - if (!this._clipping) ctx.fill(); - } // Stroke curves - - if (this._doStroke) { - if (!this._clipping) ctx.beginPath(); - curves.forEach(function (curve, index) { - if (index === 0) { - ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); - } /* eslint-disable indent */ - - ctx.bezierCurveTo(x + curve.bx * rx, y + curve.by * ry, x + curve.cx * rx, y + curve.cy * ry, x + curve.dx * rx, y + curve.dy * ry); - /* eslint-enable indent */ - }); - if (mode === constants.PIE) { - ctx.lineTo(x, y); - ctx.closePath(); - } else if (mode === constants.CHORD) { - ctx.closePath(); - } - if (!this._clipping) ctx.stroke(); - } - return this; - } - }, - { - key: 'ellipse', - value: function ellipse(args) { - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - var x = parseFloat(args[0]), - y = parseFloat(args[1]), - w = parseFloat(args[2]), - h = parseFloat(args[3]); - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - var kappa = 0.5522847498, - // control point offset horizontal - ox = w / 2 * kappa, - // control point offset vertical - oy = h / 2 * kappa, - // x-end - xe = x + w, - // y-end - ye = y + h, - // x-middle - xm = x + w / 2, - ym = y + h / 2; // y-middle - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x, ym); - ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - if (!this._clipping && doFill) { - ctx.fill(); - } - if (!this._clipping && doStroke) { - ctx.stroke(); - } - } - }, - { - key: 'line', - value: function line(x1, y1, x2, y2) { - var ctx = this.drawingContext; - if (!this._doStroke) { - return this; - } else if (this._getStroke() === styleEmpty) { - return this; - } - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.stroke(); - return this; - } - }, - { - key: 'point', - value: function point(x, y) { - var ctx = this.drawingContext; - if (!this._doStroke) { - return this; - } else if (this._getStroke() === styleEmpty) { - return this; - } - var s = this._getStroke(); - var f = this._getFill(); - if (!this._clipping) { - // swapping fill color to stroke and back after for correct point rendering - this._setFill(s); - } - if (!this._clipping) ctx.beginPath(); - ctx.arc(x, y, ctx.lineWidth / 2, 0, constants.TWO_PI, false); - if (!this._clipping) { - ctx.fill(); - this._setFill(f); - } - } - }, - { - key: 'quad', - value: function quad(x1, y1, x2, y2, x3, y3, x4, y4) { - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x3, y3); - ctx.lineTo(x4, y4); - ctx.closePath(); - if (!this._clipping && doFill) { - ctx.fill(); - } - if (!this._clipping && doStroke) { - ctx.stroke(); - } - return this; - } - }, - { - key: 'rect', - value: function rect(args) { - var x = args[0]; - var y = args[1]; - var w = args[2]; - var h = args[3]; - var tl = args[4]; - var tr = args[5]; - var br = args[6]; - var bl = args[7]; - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - if (!this._clipping) ctx.beginPath(); - if (typeof tl === 'undefined') { - // No rounded corners - ctx.rect(x, y, w, h); - } else { - // At least one rounded corner - // Set defaults when not specified - if (typeof tr === 'undefined') { - tr = tl; - } - if (typeof br === 'undefined') { - br = tr; - } - if (typeof bl === 'undefined') { - bl = br; - } // corner rounding must always be positive - - var absW = Math.abs(w); - var absH = Math.abs(h); - var hw = absW / 2; - var hh = absH / 2; - // Clip radii - if (absW < 2 * tl) { - tl = hw; - } - if (absH < 2 * tl) { - tl = hh; - } - if (absW < 2 * tr) { - tr = hw; - } - if (absH < 2 * tr) { - tr = hh; - } - if (absW < 2 * br) { - br = hw; - } - if (absH < 2 * br) { - br = hh; - } - if (absW < 2 * bl) { - bl = hw; - } - if (absH < 2 * bl) { - bl = hh; - } // Draw shape - - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x + tl, y); - ctx.arcTo(x + w, y, x + w, y + h, tr); - ctx.arcTo(x + w, y + h, x, y + h, br); - ctx.arcTo(x, y + h, x, y, bl); - ctx.arcTo(x, y, x + w, y, tl); - ctx.closePath(); - } - if (!this._clipping && this._doFill) { - ctx.fill(); - } - if (!this._clipping && this._doStroke) { - ctx.stroke(); - } - return this; - } - }, - { - key: 'triangle', - value: function triangle(args) { - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - var x1 = args[0], - y1 = args[1]; - var x2 = args[2], - y2 = args[3]; - var x3 = args[4], - y3 = args[5]; - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x3, y3); - ctx.closePath(); - if (!this._clipping && doFill) { - ctx.fill(); - } - if (!this._clipping && doStroke) { - ctx.stroke(); - } - } - }, - { - key: 'endShape', - value: function endShape(mode, vertices, isCurve, isBezier, isQuadratic, isContour, shapeKind) { - if (vertices.length === 0) { - return this; - } - if (!this._doStroke && !this._doFill) { - return this; - } - var closeShape = mode === constants.CLOSE; - var v; - if (closeShape && !isContour) { - vertices.push(vertices[0]); - } - var i, - j; - var numVerts = vertices.length; - if (isCurve && shapeKind === null) { - if (numVerts > 3) { - var b = [ - ], - s = 1 - this._curveTightness; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(vertices[1][0], vertices[1][1]); - for (i = 1; i + 2 < numVerts; i++) { - v = vertices[i]; - b[0] = [ - v[0], - v[1] - ]; - b[1] = [ - v[0] + (s * vertices[i + 1][0] - s * vertices[i - 1][0]) / 6, - v[1] + (s * vertices[i + 1][1] - s * vertices[i - 1][1]) / 6 - ]; - b[2] = [ - vertices[i + 1][0] + (s * vertices[i][0] - s * vertices[i + 2][0]) / 6, - vertices[i + 1][1] + (s * vertices[i][1] - s * vertices[i + 2][1]) / 6 - ]; - b[3] = [ - vertices[i + 1][0], - vertices[i + 1][1] - ]; - this.drawingContext.bezierCurveTo(b[1][0], b[1][1], b[2][0], b[2][1], b[3][0], b[3][1]); - } - if (closeShape) { - this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); - } - this._doFillStrokeClose(closeShape); - } - } else if (isBezier && shapeKind === null) { - if (!this._clipping) this.drawingContext.beginPath(); - for (i = 0; i < numVerts; i++) { - if (vertices[i].isVert) { - if (vertices[i].moveTo) { - this.drawingContext.moveTo(vertices[i][0], vertices[i][1]); - } else { - this.drawingContext.lineTo(vertices[i][0], vertices[i][1]); - } - } else { - this.drawingContext.bezierCurveTo(vertices[i][0], vertices[i][1], vertices[i][2], vertices[i][3], vertices[i][4], vertices[i][5]); - } - } - this._doFillStrokeClose(closeShape); - } else if (isQuadratic && shapeKind === null) { - if (!this._clipping) this.drawingContext.beginPath(); - for (i = 0; i < numVerts; i++) { - if (vertices[i].isVert) { - if (vertices[i].moveTo) { - this.drawingContext.moveTo(vertices[i][0], vertices[i][1]); - } else { - this.drawingContext.lineTo(vertices[i][0], vertices[i][1]); - } - } else { - this.drawingContext.quadraticCurveTo(vertices[i][0], vertices[i][1], vertices[i][2], vertices[i][3]); - } - } - this._doFillStrokeClose(closeShape); - } else { - if (shapeKind === constants.POINTS) { - for (i = 0; i < numVerts; i++) { - v = vertices[i]; - if (this._doStroke) { - this._pInst.stroke(v[6]); - } - this._pInst.point(v[0], v[1]); - } - } else if (shapeKind === constants.LINES) { - for (i = 0; i + 1 < numVerts; i += 2) { - v = vertices[i]; - if (this._doStroke) { - this._pInst.stroke(vertices[i + 1][6]); - } - this._pInst.line(v[0], v[1], vertices[i + 1][0], vertices[i + 1][1]); - } - } else if (shapeKind === constants.TRIANGLES) { - for (i = 0; i + 2 < numVerts; i += 3) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(v[0], v[1]); - this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); - this.drawingContext.lineTo(vertices[i + 2][0], vertices[i + 2][1]); - this.drawingContext.closePath(); - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 2][5]); - this.drawingContext.fill(); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 2][6]); - this.drawingContext.stroke(); - } - } - } else if (shapeKind === constants.TRIANGLE_STRIP) { - for (i = 0; i + 1 < numVerts; i++) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(vertices[i + 1][0], vertices[i + 1][1]); - this.drawingContext.lineTo(v[0], v[1]); - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 1][6]); - } - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 1][5]); - } - if (i + 2 < numVerts) { - this.drawingContext.lineTo(vertices[i + 2][0], vertices[i + 2][1]); - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 2][6]); - } - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 2][5]); - } - } - this._doFillStrokeClose(closeShape); - } - } else if (shapeKind === constants.TRIANGLE_FAN) { - if (numVerts > 2) { - // For performance reasons, try to batch as many of the - // fill and stroke calls as possible. - if (!this._clipping) this.drawingContext.beginPath(); - for (i = 2; i < numVerts; i++) { - v = vertices[i]; - this.drawingContext.moveTo(vertices[0][0], vertices[0][1]); - this.drawingContext.lineTo(vertices[i - 1][0], vertices[i - 1][1]); - this.drawingContext.lineTo(v[0], v[1]); - this.drawingContext.lineTo(vertices[0][0], vertices[0][1]); - // If the next colour is going to be different, stroke / fill now - if (i < numVerts - 1) { - if (this._doFill && v[5] !== vertices[i + 1][5] || this._doStroke && v[6] !== vertices[i + 1][6]) { - if (!this._clipping && this._doFill) { - this._pInst.fill(v[5]); - this.drawingContext.fill(); - this._pInst.fill(vertices[i + 1][5]); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(v[6]); - this.drawingContext.stroke(); - this._pInst.stroke(vertices[i + 1][6]); - } - this.drawingContext.closePath(); - if (!this._clipping) this.drawingContext.beginPath(); // Begin the next one - } - } - } - this._doFillStrokeClose(closeShape); - } - } else if (shapeKind === constants.QUADS) { - for (i = 0; i + 3 < numVerts; i += 4) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(v[0], v[1]); - for (j = 1; j < 4; j++) { - this.drawingContext.lineTo(vertices[i + j][0], vertices[i + j][1]); - } - this.drawingContext.lineTo(v[0], v[1]); - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 3][5]); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 3][6]); - } - this._doFillStrokeClose(closeShape); - } - } else if (shapeKind === constants.QUAD_STRIP) { - if (numVerts > 3) { - for (i = 0; i + 1 < numVerts; i += 2) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - if (i + 3 < numVerts) { - this.drawingContext.moveTo(vertices[i + 2][0], vertices[i + 2][1]); - this.drawingContext.lineTo(v[0], v[1]); - this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); - this.drawingContext.lineTo(vertices[i + 3][0], vertices[i + 3][1]); - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 3][5]); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 3][6]); - } - } else { - this.drawingContext.moveTo(v[0], v[1]); - this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); - } - this._doFillStrokeClose(closeShape); - } - } - } else { - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(vertices[0][0], vertices[0][1]); - for (i = 1; i < numVerts; i++) { - v = vertices[i]; - if (v.isVert) { - if (v.moveTo) { - if (closeShape) this.drawingContext.closePath(); - this.drawingContext.moveTo(v[0], v[1]); - } else { - this.drawingContext.lineTo(v[0], v[1]); - } - } - } - this._doFillStrokeClose(closeShape); - } - } - isCurve = false; - isBezier = false; - isQuadratic = false; - isContour = false; - if (closeShape) { - vertices.pop(); - } - return this; - } ////////////////////////////////////////////// - // SHAPE | Attributes - ////////////////////////////////////////////// - - }, - { - key: 'strokeCap', - value: function strokeCap(cap) { - if (cap === constants.ROUND || cap === constants.SQUARE || cap === constants.PROJECT) { - this.drawingContext.lineCap = cap; - } - return this; - } - }, - { - key: 'strokeJoin', - value: function strokeJoin(join) { - if (join === constants.ROUND || join === constants.BEVEL || join === constants.MITER) { - this.drawingContext.lineJoin = join; - } - return this; - } - }, - { - key: 'strokeWeight', - value: function strokeWeight(w) { - if (typeof w === 'undefined' || w === 0) { - // hack because lineWidth 0 doesn't work - this.drawingContext.lineWidth = 0.0001; - } else { - this.drawingContext.lineWidth = w; - } - return this; - } - }, - { - key: '_getFill', - value: function _getFill() { - if (!this._cachedFillStyle) { - this._cachedFillStyle = this.drawingContext.fillStyle; - } - return this._cachedFillStyle; - } - }, - { - key: '_setFill', - value: function _setFill(fillStyle) { - if (fillStyle !== this._cachedFillStyle) { - this.drawingContext.fillStyle = fillStyle; - this._cachedFillStyle = fillStyle; - } - } - }, - { - key: '_getStroke', - value: function _getStroke() { - if (!this._cachedStrokeStyle) { - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - } - return this._cachedStrokeStyle; - } - }, - { - key: '_setStroke', - value: function _setStroke(strokeStyle) { - if (strokeStyle !== this._cachedStrokeStyle) { - this.drawingContext.strokeStyle = strokeStyle; - this._cachedStrokeStyle = strokeStyle; - } - } ////////////////////////////////////////////// - // SHAPE | Curves - ////////////////////////////////////////////// - - }, - { - key: 'bezier', - value: function bezier(x1, y1, x2, y2, x3, y3, x4, y4) { - this._pInst.beginShape(); - this._pInst.vertex(x1, y1); - this._pInst.bezierVertex(x2, y2, x3, y3, x4, y4); - this._pInst.endShape(); - return this; - } - }, - { - key: 'curve', - value: function curve(x1, y1, x2, y2, x3, y3, x4, y4) { - this._pInst.beginShape(); - this._pInst.curveVertex(x1, y1); - this._pInst.curveVertex(x2, y2); - this._pInst.curveVertex(x3, y3); - this._pInst.curveVertex(x4, y4); - this._pInst.endShape(); - return this; - } ////////////////////////////////////////////// - // SHAPE | Vertex - ////////////////////////////////////////////// - - }, - { - key: '_doFillStrokeClose', - value: function _doFillStrokeClose(closeShape) { - if (closeShape) { - this.drawingContext.closePath(); - } - if (!this._clipping && this._doFill) { - this.drawingContext.fill(); - } - if (!this._clipping && this._doStroke) { - this.drawingContext.stroke(); - } - } ////////////////////////////////////////////// - // TRANSFORM - ////////////////////////////////////////////// - - }, - { - key: 'applyMatrix', - value: function applyMatrix(a, b, c, d, e, f) { - this.drawingContext.transform(a, b, c, d, e, f); - } - }, - { - key: 'resetMatrix', - value: function resetMatrix() { - this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); - this.drawingContext.scale(this._pInst._pixelDensity, this._pInst._pixelDensity); - return this; - } - }, - { - key: 'rotate', - value: function rotate(rad) { - this.drawingContext.rotate(rad); - } - }, - { - key: 'scale', - value: function scale(x, y) { - this.drawingContext.scale(x, y); - return this; - } - }, - { - key: 'translate', - value: function translate(x, y) { - // support passing a vector as the 1st parameter - if (x instanceof _main.default.Vector) { - y = x.y; - x = x.x; - } - this.drawingContext.translate(x, y); - return this; - } ////////////////////////////////////////////// - // TYPOGRAPHY - // - ////////////////////////////////////////////// - - }, - { - key: '_renderText', - value: function _renderText(p, line, x, y, maxY, minY) { - if (y < minY || y >= maxY) { - return; // don't render lines beyond our minY/maxY bounds (see #5785) - } - p.push(); // fix to #803 - if (!this._isOpenType()) { - // a system/browser font - // no stroke unless specified by user - if (this._doStroke && this._strokeSet) { - this.drawingContext.strokeText(line, x, y); - } - if (!this._clipping && this._doFill) { - // if fill hasn't been set by user, use default text fill - if (!this._fillSet) { - this._setFill(constants._DEFAULT_TEXT_FILL); - } - this.drawingContext.fillText(line, x, y); - } - } else { - // an opentype font, let it handle the rendering - this._textFont._renderPath(line, x, y, { - renderer: this - }); - } - p.pop(); - return p; - } - }, - { - key: 'textWidth', - value: function textWidth(s) { - if (this._isOpenType()) { - return this._textFont._textWidth(s, this._textSize); - } - return this.drawingContext.measureText(s).width; - } - }, - { - key: '_applyTextProperties', - value: function _applyTextProperties() { - var font; - var p = this._pInst; - this._setProperty('_textAscent', null); - this._setProperty('_textDescent', null); - font = this._textFont; - if (this._isOpenType()) { - font = this._textFont.font.familyName; - this._setProperty('_textStyle', this._textFont.font.styleName); - } - this.drawingContext.font = ''.concat(this._textStyle || 'normal', ' ').concat(this._textSize || 12, 'px ').concat(font || 'sans-serif'); - this.drawingContext.textAlign = this._textAlign; - if (this._textBaseline === constants.CENTER) { - this.drawingContext.textBaseline = constants._CTX_MIDDLE; - } else { - this.drawingContext.textBaseline = this._textBaseline; - } - return p; - } ////////////////////////////////////////////// - // STRUCTURE - ////////////////////////////////////////////// - // a push() operation is in progress. - // the renderer should return a 'style' object that it wishes to - // store on the push stack. - // derived renderers should call the base class' push() method - // to fetch the base style object. - - }, - { - key: 'push', - value: function push() { - this.drawingContext.save(); - // get the base renderer style - return _get(_getPrototypeOf(Renderer2D.prototype), 'push', this).call(this); - } // a pop() operation is in progress - // the renderer is passed the 'style' object that it returned - // from its push() method. - // derived renderers should pass this object to their base - // class' pop method - - }, - { - key: 'pop', - value: function pop(style) { - this.drawingContext.restore(); - // Re-cache the fill / stroke state - this._cachedFillStyle = this.drawingContext.fillStyle; - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - _get(_getPrototypeOf(Renderer2D.prototype), 'pop', this).call(this, style); - } - } - ]); - return Renderer2D; - }(_main.default.Renderer); // Fix test - Renderer2D.prototype.text = function (str, x, y, maxWidth, maxHeight) { - var baselineHacked; - // baselineHacked: (HACK) - // A temporary fix to conform to Processing's implementation - // of BASELINE vertical alignment in a bounding box - if (typeof maxWidth !== 'undefined') { - if (this.drawingContext.textBaseline === constants.BASELINE) { - baselineHacked = true; - this.drawingContext.textBaseline = constants.TOP; - } - } - var p = _main.default.Renderer.prototype.text.apply(this, arguments); - if (baselineHacked) { - this.drawingContext.textBaseline = constants.BASELINE; - } - return p; - }; - _main.default.Renderer2D = Renderer2D; - var _default = _main.default.Renderer2D; - exports.default = _default; - }, - { - './constants': 286, - './main': 298, - './p5.Renderer': 301, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.number.to-fixed': 193, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.reflect.get': 203, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 303: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - var _main = _interopRequireDefault(_dereq_('./main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - _main.default.prototype._promisePreloads = [ - /* Example object - { - target: p5.prototype, // The target object to have the method modified - method: 'loadXAsync', // The name of the preload function to wrap - addCallbacks: true, // Whether to automatically handle the p5 callbacks - legacyPreloadSetup: { // Optional object to generate a legacy-style preload - method: 'loadX', // The name of the legacy preload function to generate - createBaseObject: function() { - return {}; - } // An optional function to create the base object for the legacy preload. - } - } - */ - ]; - _main.default.prototype.registerPromisePreload = function (setup) { - _main.default.prototype._promisePreloads.push(setup); - }; - var initialSetupRan = false; - _main.default.prototype._setupPromisePreloads = function () { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this._promisePreloads[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var preloadSetup = _step.value; - var thisValue = this; - var method = preloadSetup.method, - addCallbacks = preloadSetup.addCallbacks, - legacyPreloadSetup = preloadSetup.legacyPreloadSetup; // Get the target object that the preload gets assigned to by default, - // that is the current object. - var target = preloadSetup.target || this; - var sourceFunction = target[method].bind(target); - // If the target is the p5 prototype, then only set it up on the first run per page - if (target === _main.default.prototype) { - if (initialSetupRan) { - continue; - } - thisValue = null; - sourceFunction = target[method]; - } // Replace the original method with a wrapped version - - target[method] = this._wrapPromisePreload(thisValue, sourceFunction, addCallbacks); - // If a legacy preload is required - if (legacyPreloadSetup) { - // What is the name for this legacy preload - var legacyMethod = legacyPreloadSetup.method; - // Wrap the already wrapped Promise-returning method with the legacy setup - target[legacyMethod] = this._legacyPreloadGenerator(thisValue, legacyPreloadSetup, target[method]); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - initialSetupRan = true; - }; - _main.default.prototype._wrapPromisePreload = function (thisValue, fn, addCallbacks) { - var replacementFunction = function replacementFunction() { - var _this = this; - // Uses the current preload counting mechanism for now. - this._incrementPreload(); - // A variable for the callback function if specified - var callback = null; - // A variable for the errorCallback function if specified - var errorCallback = null; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - if (addCallbacks) { - // Loop from the end of the args array, pulling up to two functions off of - // the end and putting them in fns - for (var i = args.length - 1; i >= 0 && !errorCallback; i--) { - if (typeof args[i] !== 'function') { - break; - } - errorCallback = callback; - callback = args.pop(); - } - } // Call the underlying function and pass it to Promise.resolve, - // so that even if it didn't return a promise we can still - // act on the result as if it did. - - var promise = Promise.resolve(fn.apply(this, args)); - // Add the optional callbacks - if (callback) { - promise.then(callback); - } - if (errorCallback) { - promise.catch(errorCallback); - } // Decrement the preload counter only if the promise resolved - - promise.then(function () { - return _this._decrementPreload(); - }); - // Return the original promise so that neither callback changes the result. - return promise; - }; - if (thisValue) { - replacementFunction = replacementFunction.bind(thisValue); - } - return replacementFunction; - }; - var objectCreator = function objectCreator() { - return { - }; - }; - _main.default.prototype._legacyPreloadGenerator = function (thisValue, legacyPreloadSetup, fn) { - // Create a function that will generate an object before the preload is - // launched. For example, if the object should be an array or be an instance - // of a specific class. - var baseValueGenerator = legacyPreloadSetup.createBaseObject || objectCreator; - var returnedFunction = function returnedFunction() { - var _this2 = this; - // Our then clause needs to run before setup, so we also increment the preload counter - this._incrementPreload(); - // Generate the return value based on the generator. - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - var returnValue = baseValueGenerator.apply(this, args); - // Run the original wrapper - fn.apply(this, args).then(function (data) { - // Copy each key from the resolved value into returnValue - Object.assign(returnValue, data); - // Decrement the preload counter, to allow setup to continue. - _this2._decrementPreload(); - }); - return returnValue; - }; - if (thisValue) { - returnedFunction = returnedFunction.bind(thisValue); - } - return returnedFunction; - }; - }, - { - './main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.assign': 194, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.promise': 201, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 304: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - var constants = _interopRequireWildcard(_dereq_('./constants')); - _dereq_('./p5.Graphics'); - _dereq_('./p5.Renderer2D'); - _dereq_('../webgl/p5.RendererGL'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - - var defaultId = 'defaultCanvas0'; // this gets set again in createCanvas - var defaultClass = 'p5Canvas'; - /** - * Creates a canvas element in the document and sets its dimensions - * in pixels. This method should be called only once at the start of setup(). - * Calling createCanvas more than once in a - * sketch will result in very unpredictable behavior. If you want more than - * one drawing canvas you could use createGraphics() - * (hidden by default but it can be shown). - * - * Important note: in 2D mode (i.e. when `p5.Renderer` is not set) the origin (0,0) - * is positioned at the top left of the screen. In 3D mode (i.e. when `p5.Renderer` - * is set to `WEBGL`), the origin is positioned at the center of the canvas. - * See [this issue](https://github.com/processing/p5.js/issues/1545) for more information. - * - * A WebGL canvas will use a WebGL2 context if it is supported by the browser. - * Check the webglVersion property to check what - * version is being used, or call setAttributes({ version: 1 }) - * to create a WebGL1 context. - * - * The system variables width and height are set by the parameters passed to this - * function. If createCanvas() is not used, the - * window will be given a default size of 100×100 pixels. - * - * Optionally, an existing canvas can be passed using a selector, ie. `document.getElementById('')`. - * If specified, avoid using `setAttributes()` afterwards, as this will remove and recreate the existing canvas. - * - * For more ways to position the canvas, see the - * - * positioning the canvas wiki page. - * - * @method createCanvas - * @param {Number} w width of the canvas - * @param {Number} h height of the canvas - * @param {Constant} [renderer] either P2D or WEBGL - * @param {HTMLCanvasElement} [canvas] existing html canvas element - * @return {p5.Renderer} pointer to p5.Renderer holding canvas - * @example - *
                - * - * function setup() { - * createCanvas(100, 50); - * background(153); - * line(0, 0, width, height); - * } - * - *
                - * - * @alt - * Black line extending from top-left of canvas to bottom right. - */ - /** - * @method createCanvas - * @param {Number} w - * @param {Number} h - * @param {HTMLCanvasElement} [canvas] - * @return {p5.Renderer} pointer to p5.Renderer holding canvas - */ - _main.default.prototype.createCanvas = function (w, h, renderer, canvas) { - _main.default._validateParameters('createCanvas', arguments); - //optional: renderer, otherwise defaults to p2d - var r; - if (arguments[2] instanceof HTMLCanvasElement) { - renderer = constants.P2D; - canvas = arguments[2]; - } else { - r = renderer || constants.P2D; - } - var c; - if (canvas) { - c = document.getElementById(defaultId); - if (c) { - c.parentNode.removeChild(c); //replace the existing defaultCanvas - } - c = canvas; - this._defaultGraphicsCreated = false; - } else { - if (r === constants.WEBGL) { - c = document.getElementById(defaultId); - if (c) { - //if defaultCanvas already exists - c.parentNode.removeChild(c); //replace the existing defaultCanvas - var thisRenderer = this._renderer; - this._elements = this._elements.filter(function (e) { - return e !== thisRenderer; - }); - } - c = document.createElement('canvas'); - c.id = defaultId; - c.classList.add(defaultClass); - } else { - if (!this._defaultGraphicsCreated) { - if (canvas) { - c = canvas; - } else { - c = document.createElement('canvas'); - } - var i = 0; - while (document.getElementById('defaultCanvas'.concat(i))) { - i++; - } - defaultId = 'defaultCanvas'.concat(i); - c.id = defaultId; - c.classList.add(defaultClass); - } else { - // resize the default canvas if new one is created - c = this.canvas; - } - } // set to invisible if still in setup (to prevent flashing with manipulate) - - if (!this._setupDone) { - c.dataset.hidden = true; // tag to show later - c.style.visibility = 'hidden'; - } - if (this._userNode) { - // user input node case - this._userNode.appendChild(c); - } else { - //create main element - if (document.getElementsByTagName('main').length === 0) { - var m = document.createElement('main'); - document.body.appendChild(m); - } //append canvas to main - - document.getElementsByTagName('main') [0].appendChild(c); - } - } // Init our graphics renderer - //webgl mode - - if (r === constants.WEBGL) { - this._setProperty('_renderer', new _main.default.RendererGL(c, this, true)); - this._elements.push(this._renderer); - } else { - //P2D mode - if (!this._defaultGraphicsCreated) { - this._setProperty('_renderer', new _main.default.Renderer2D(c, this, true)); - this._defaultGraphicsCreated = true; - this._elements.push(this._renderer); - } - } - this._renderer.resize(w, h); - this._renderer._applyDefaults(); - return this._renderer; - }; - /** - * Resizes the canvas to given width and height. The canvas will be cleared - * and draw will be called immediately, allowing the sketch to re-render itself - * in the resized canvas. - * @method resizeCanvas - * @param {Number} w width of the canvas - * @param {Number} h height of the canvas - * @param {Boolean} [noRedraw] don't redraw the canvas immediately - * @example - *
                - * function setup() { - * createCanvas(windowWidth, windowHeight); - * } - * - * function draw() { - * background(0, 100, 200); - * } - * - * function windowResized() { - * resizeCanvas(windowWidth, windowHeight); - * } - *
                - * - * @alt - * No image displayed. - */ - _main.default.prototype.resizeCanvas = function (w, h, noRedraw) { - _main.default._validateParameters('resizeCanvas', arguments); - if (this._renderer) { - // save canvas properties - var props = { - }; - for (var key in this.drawingContext) { - var val = this.drawingContext[key]; - if (_typeof(val) !== 'object' && typeof val !== 'function') { - props[key] = val; - } - } - this.width = w; - this.height = h; - // Make sure width and height are updated before the renderer resizes so - // that framebuffers updated from the resize read the correct size - this._renderer.resize(w, h); - // reset canvas properties - for (var savedKey in props) { - try { - this.drawingContext[savedKey] = props[savedKey]; - } catch (err) { - // ignore read-only property errors - } - } - if (!noRedraw) { - this.redraw(); - } - } //accessible Outputs - - if (this._addAccsOutput()) { - this._updateAccsOutput(); - } - }; - /** - * Removes the default canvas for a p5 sketch that doesn't require a canvas - * @method noCanvas - * @example - *
                - * - * function setup() { - * noCanvas(); - * } - * - *
                - * - * @alt - * no image displayed - */ - _main.default.prototype.noCanvas = function () { - if (this.canvas) { - this.canvas.parentNode.removeChild(this.canvas); - } - }; - /** - * Creates and returns a new p5.Graphics object. Use this class if you need - * to draw into an off-screen graphics buffer. The two parameters define the - * width and height in pixels. - * - * A WebGL p5.Graphics will use a WebGL2 context if it is supported by the browser. - * Check the pg.webglVersion property of the renderer - * to check what version is being used, or call pg.setAttributes({ version: 1 }) - * to create a WebGL1 context. - * - * Optionally, an existing canvas can be passed using a selector, ie. document.getElementById(''). - * By default this canvas will be hidden (offscreen buffer), to make visible, set element's style to display:block; - * - * @method createGraphics - * @param {Number} w width of the offscreen graphics buffer - * @param {Number} h height of the offscreen graphics buffer - * @param {Constant} [renderer] either P2D or WEBGL - * undefined defaults to p2d - * @param {HTMLCanvasElement} [canvas] existing html canvas element - * @return {p5.Graphics} offscreen graphics buffer - * @example - *
                - * - * let pg; - * function setup() { - * createCanvas(100, 100); - * pg = createGraphics(100, 100); - * } - * - * function draw() { - * background(200); - * pg.background(100); - * pg.noStroke(); - * pg.ellipse(pg.width / 2, pg.height / 2, 50, 50); - * image(pg, 50, 50); - * image(pg, 0, 0, 50, 50); - * } - * - *
                - * - * @alt - * 4 grey squares alternating light and dark grey. White quarter circle mid-left. - */ - /** - * @method createGraphics - * @param {Number} w - * @param {Number} h - * @param {HTMLCanvasElement} [canvas] - * @return {p5.Graphics} offscreen graphics buffer - */ - _main.default.prototype.createGraphics = function (w, h) { - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } /** - * args[0] is expected to be renderer - * args[1] is expected to be canvas - */ - - if (args[0] instanceof HTMLCanvasElement) { - args[1] = args[0]; - args[0] = constants.P2D; - } - _main.default._validateParameters('createGraphics', arguments); - return new _main.default.Graphics(w, h, args[0], this, args[1]); - }; - /** - * Creates and returns a new p5.Framebuffer, a - * high-performance WebGL object that you can draw to and then use as a texture. - * - * Options can include: - * - `format`: The data format of the texture, either `UNSIGNED_BYTE`, `FLOAT`, or `HALF_FLOAT`. The default is `UNSIGNED_BYTE`. - * - `channels`: What color channels to store, either `RGB` or `RGBA`. The default is to match the channels in the main canvas (with alpha unless disabled with `setAttributes`.) - * - `depth`: A boolean, whether or not to include a depth buffer. Defaults to true. - * - `depthFormat`: The data format for depth information, either `UNSIGNED_INT` or `FLOAT`. The default is `FLOAT` if available, or `UNSIGNED_INT` otherwise. - * - `stencil`: A boolean, whether or not to include a stencil buffer, which can be used for masking. This may only be used if also using a depth buffer. Defaults to the value of `depth`, which is true if not provided. - * - `antialias`: Boolean or Number, whether or not to render with antialiased edges, and if so, optionally the number of samples to use. Defaults to whether or not the main canvas is antialiased, using a default of 2 samples if so. Antialiasing is only supported when WebGL 2 is available. - * - `width`: The width of the texture. Defaults to matching the main canvas. - * - `height`: The height of the texture. Defaults to matching the main canvas. - * - `density`: The pixel density of the texture. Defaults to the pixel density of the main canvas. - * - `textureFiltering`: Either `LINEAR` (nearby pixels will be interpolated when reading values from the color texture) or `NEAREST` (no interpolation.) Generally, use `LINEAR` when using the texture as an image, and use `NEAREST` if reading the texture as data. Defaults to `LINEAR`. - * - * If `width`, `height`, or `density` are specified, then the framebuffer will - * keep that size until manually changed. Otherwise, it will be autosized, and - * it will update to match the main canvas's size and density when the main - * canvas changes. - * - * @method createFramebuffer - * @param {Object} [options] An optional object with configuration - * - * @example - *
                - * - * let prev, next, cam; - * function setup() { - * createCanvas(100, 100, WEBGL); - * prev = createFramebuffer({ format: FLOAT }); - * next = createFramebuffer({ format: FLOAT }); - * cam = createCamera(); - * noStroke(); - * } - * - * function draw() { - * // Swap prev and next so that we can use the previous - * // frame as a texture when drawing the current frame - * [prev, next] = [next, prev]; - * - * // Draw to the framebuffer - * next.begin(); - * background(255); - * - * push(); - * // Draw the previous texture farther away, but scaled - * // up to fill the screen, plus a bit extra scale so it grows - * translate(0, 0, -200); - * scale(1.001 * (200 + cam.eyeZ) / cam.eyeZ); - * tint(255, 253); - * image(prev, -width/2, -height/2); - * pop(); - * - * push(); - * normalMaterial(); - * translate(25*sin(frameCount * 0.014), 25*sin(frameCount * 0.02), 0); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(12); - * pop(); - * next.end(); - * - * image(next, -width/2, -height/2); - * } - * - *
                - * - * @alt - * A red, green, and blue box (using normalMaterial) moves and rotates around - * the canvas, leaving a trail behind it that slowly grows and fades away. - */ - _main.default.prototype.createFramebuffer = function (options) { - return new _main.default.Framebuffer(this, options); - }; - /** - * Blends the pixels in the display window according to the defined mode. - * There is a choice of the following modes to blend the source pixels (A) - * with the ones of pixels already in the display window (B): - *
                  - *
                • BLEND - linear interpolation of colours: C = - * A*factor + B. This is the default blending mode.
                • - *
                • ADD - sum of A and B
                • - *
                • DARKEST - only the darkest colour succeeds: C = - * min(A*factor, B).
                • - *
                • LIGHTEST - only the lightest colour succeeds: C = - * max(A*factor, B).
                • - *
                • DIFFERENCE - subtract colors from underlying image. - * (2D)
                • - *
                • EXCLUSION - similar to DIFFERENCE, but less - * extreme.
                • - *
                • MULTIPLY - multiply the colors, result will always be - * darker.
                • - *
                • SCREEN - opposite multiply, uses inverse values of the - * colors.
                • - *
                • REPLACE - the pixels entirely replace the others and - * don't utilize alpha (transparency) values.
                • - *
                • REMOVE - removes pixels from B with the alpha strength of A.
                • - *
                • OVERLAY - mix of MULTIPLY and SCREEN - * . Multiplies dark values, and screens light values. (2D)
                • - *
                • HARD_LIGHT - SCREEN when greater than 50% - * gray, MULTIPLY when lower. (2D)
                • - *
                • SOFT_LIGHT - mix of DARKEST and - * LIGHTEST. Works like OVERLAY, but not as harsh. (2D) - *
                • - *
                • DODGE - lightens light tones and increases contrast, - * ignores darks. (2D)
                • - *
                • BURN - darker areas are applied, increasing contrast, - * ignores lights. (2D)
                • - *
                • SUBTRACT - remainder of A and B (3D)
                • - *
                - * - * (2D) indicates that this blend mode only works in the 2D renderer.
                - * (3D) indicates that this blend mode only works in the WEBGL renderer. - * - * @method blendMode - * @param {Constant} mode blend mode to set for canvas. - * either BLEND, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY, - * EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, - * SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT - * @example - *
                - * - * blendMode(LIGHTEST); - * strokeWeight(30); - * stroke(80, 150, 255); - * line(25, 25, 75, 75); - * stroke(255, 50, 50); - * line(75, 25, 25, 75); - * - *
                - * - *
                - * - * blendMode(MULTIPLY); - * strokeWeight(30); - * stroke(80, 150, 255); - * line(25, 25, 75, 75); - * stroke(255, 50, 50); - * line(75, 25, 25, 75); - * - *
                - * - * @alt - * translucent image thick red & blue diagonal rounded lines intersecting center - * Thick red & blue diagonal rounded lines intersecting center. dark at overlap - */ - _main.default.prototype.blendMode = function (mode) { - _main.default._validateParameters('blendMode', arguments); - if (mode === constants.NORMAL) { - // Warning added 3/26/19, can be deleted in future (1.0 release?) - console.warn('NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead.'); - mode = constants.BLEND; - } - this._renderer.blendMode(mode); - }; - /** - * The p5.js API provides a lot of functionality for creating graphics, but there is - * some native HTML5 Canvas functionality that is not exposed by p5. You can still call - * it directly using the variable `drawingContext`, as in the example shown. This is - * the equivalent of calling `canvas.getContext('2d');` or `canvas.getContext('webgl');`. - * See this - * - * reference for the native canvas API for possible drawing functions you can call. - * - * @property drawingContext - * @example - *
                - * - * function setup() { - * drawingContext.shadowOffsetX = 5; - * drawingContext.shadowOffsetY = -5; - * drawingContext.shadowBlur = 10; - * drawingContext.shadowColor = 'black'; - * background(200); - * ellipse(width / 2, height / 2, 50, 50); - * } - * - *
                - * - * @alt - * white ellipse with shadow blur effect around edges - */ - var _default = _main.default; - exports.default = _default; - }, - { - '../webgl/p5.RendererGL': 355, - './constants': 286, - './main': 298, - './p5.Graphics': 300, - './p5.Renderer2D': 302, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 305: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.slice'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var constants = _interopRequireWildcard(_dereq_('../constants')); - var _helpers = _interopRequireDefault(_dereq_('../helpers')); - _dereq_('../friendly_errors/fes_core'); - _dereq_('../friendly_errors/file_errors'); - _dereq_('../friendly_errors/validate_params'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Shape - * @submodule 2D Primitives - * @for p5 - * @requires core - * @requires constants - */ - /** - * This function does 3 things: - * - * 1. Bounds the desired start/stop angles for an arc (in radians) so that: - * - * 0 <= start < TWO_PI ; start <= stop < start + TWO_PI - * - * This means that the arc rendering functions don't have to be concerned - * with what happens if stop is smaller than start, or if the arc 'goes - * round more than once', etc.: they can just start at start and increase - * until stop and the correct arc will be drawn. - * - * 2. Optionally adjusts the angles within each quadrant to counter the naive - * scaling of the underlying ellipse up from the unit circle. Without - * this, the angles become arbitrary when width != height: 45 degrees - * might be drawn at 5 degrees on a 'wide' ellipse, or at 85 degrees on - * a 'tall' ellipse. - * - * 3. Flags up when start and stop correspond to the same place on the - * underlying ellipse. This is useful if you want to do something special - * there (like rendering a whole ellipse instead). - */ - - _main.default.prototype._normalizeArcAngles = function (start, stop, width, height, correctForScaling) { - var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. - var separation; - // The order of the steps is important here: each one builds upon the - // adjustments made in the steps that precede it. - // Constrain both start and stop to [0,TWO_PI). - start = start - constants.TWO_PI * Math.floor(start / constants.TWO_PI); - stop = stop - constants.TWO_PI * Math.floor(stop / constants.TWO_PI); - // Get the angular separation between the requested start and stop points. - // - // Technically this separation only matches what gets drawn if - // correctForScaling is enabled. We could add a more complicated calculation - // for when the scaling is uncorrected (in which case the drawn points could - // end up pushed together or pulled apart quite dramatically relative to what - // was requested), but it would make things more opaque for little practical - // benefit. - // - // (If you do disable correctForScaling and find that correspondToSamePoint - // is set too aggressively, the easiest thing to do is probably to just make - // epsilon smaller...) - separation = Math.min(Math.abs(start - stop), constants.TWO_PI - Math.abs(start - stop)); - // Optionally adjust the angles to counter linear scaling. - if (correctForScaling) { - if (start <= constants.HALF_PI) { - start = Math.atan(width / height * Math.tan(start)); - } else if (start > constants.HALF_PI && start <= 3 * constants.HALF_PI) { - start = Math.atan(width / height * Math.tan(start)) + constants.PI; - } else { - start = Math.atan(width / height * Math.tan(start)) + constants.TWO_PI; - } - if (stop <= constants.HALF_PI) { - stop = Math.atan(width / height * Math.tan(stop)); - } else if (stop > constants.HALF_PI && stop <= 3 * constants.HALF_PI) { - stop = Math.atan(width / height * Math.tan(stop)) + constants.PI; - } else { - stop = Math.atan(width / height * Math.tan(stop)) + constants.TWO_PI; - } - } // Ensure that start <= stop < start + TWO_PI. - - if (start > stop) { - stop += constants.TWO_PI; - } - return { - start: start, - stop: stop, - correspondToSamePoint: separation < epsilon - }; - }; - /** - * Draws an arc to the canvas. Arcs are drawn along the outer edge of an ellipse - * (oval) defined by the `x`, `y`, `w`, and `h` parameters. Use the `start` and `stop` - * parameters to specify the angles (in radians) at which to draw the arc. Arcs are - * always drawn clockwise from `start` to `stop`. The origin of the arc's ellipse may - * be changed with the ellipseMode() function. - * - * The optional `mode` parameter determines the arc's fill style. The fill modes are - * a semi-circle (`OPEN`), a closed semi-circle (`CHORD`), or a closed pie segment (`PIE`). - * - * @method arc - * @param {Number} x x-coordinate of the arc's ellipse. - * @param {Number} y y-coordinate of the arc's ellipse. - * @param {Number} w width of the arc's ellipse by default. - * @param {Number} h height of the arc's ellipse by default. - * @param {Number} start angle to start the arc, specified in radians. - * @param {Number} stop angle to stop the arc, specified in radians. - * @param {Constant} [mode] optional parameter to determine the way of drawing - * the arc. either CHORD, PIE, or OPEN. - * @param {Integer} [detail] optional parameter for WebGL mode only. This is to - * specify the number of vertices that makes up the - * perimeter of the arc. Default value is 25. Won't - * draw a stroke for a detail of more than 50. - * @chainable - * - * @example - *
                - * - * arc(50, 55, 50, 50, 0, HALF_PI); - * noFill(); - * arc(50, 55, 60, 60, HALF_PI, PI); - * arc(50, 55, 70, 70, PI, PI + QUARTER_PI); - * arc(50, 55, 80, 80, PI + QUARTER_PI, TWO_PI); - * describe( - * 'A shattered outline of an ellipse with a quarter of a white circle at the bottom-right.' - * ); - * - *
                - * - *
                - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI); - * describe('A white ellipse with the top-right third missing. The bottom is outlined in black.'); - * - *
                - * - *
                - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN); - * describe( - * 'A white ellipse missing a section from the top-right. The bottom is outlined in black.' - * ); - * - *
                - * - *
                - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD); - * describe('A white ellipse with a black outline missing a section from the top-right.'); - * - *
                - * - *
                - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE); - * describe('A white ellipse with a black outline. The top-right third is missing.'); - * - *
                - * - */ - _main.default.prototype.arc = function (x, y, w, h, start, stop, mode, detail) { - _main.default._validateParameters('arc', arguments); - // if the current stroke and fill settings wouldn't result in something - // visible, exit immediately - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } - if (start === stop) { - return this; - } - start = this._toRadians(start); - stop = this._toRadians(stop); - // p5 supports negative width and heights for ellipses - w = Math.abs(w); - h = Math.abs(h); - var vals = _helpers.default.modeAdjust(x, y, w, h, this._renderer._ellipseMode); - var angles = this._normalizeArcAngles(start, stop, vals.w, vals.h, true); - if (angles.correspondToSamePoint) { - // If the arc starts and ends at (near enough) the same place, we choose to - // draw an ellipse instead. This is preferable to faking an ellipse (by - // making stop ever-so-slightly less than start + TWO_PI) because the ends - // join up to each other rather than at a vertex at the centre (leaving - // an unwanted spike in the stroke/fill). - this._renderer.ellipse([vals.x, - vals.y, - vals.w, - vals.h, - detail]); - } else { - this._renderer.arc(vals.x, vals.y, vals.w, vals.h, angles.start, // [0, TWO_PI) - angles.stop, // [start, start + TWO_PI) - mode, detail); - //accessible Outputs - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('arc', [ - vals.x, - vals.y, - vals.w, - vals.h, - angles.start, - angles.stop, - mode - ]); - } - } - return this; - }; - /** - * Draws an ellipse (oval) to the canvas. An ellipse with equal width and height - * is a circle. By default, the first two parameters set the location of the - * center of the ellipse. The third and fourth parameters set the shape's width - * and height, respectively. The origin may be changed with the - * ellipseMode() function. - * - * If no height is specified, the value of width is used for both the width and - * height. If a negative height or width is specified, the absolute value is - * taken. - * - * @method ellipse - * @param {Number} x x-coordinate of the center of the ellipse. - * @param {Number} y y-coordinate of the center of the ellipse. - * @param {Number} w width of the ellipse. - * @param {Number} [h] height of the ellipse. - * @chainable - * @example - *
                - * - * ellipse(56, 46, 55, 55); - * describe('A white ellipse with black outline in middle of a gray canvas.'); - * - *
                - * - */ - /** - * @method ellipse - * @param {Number} x - * @param {Number} y - * @param {Number} w - * @param {Number} h - * @param {Integer} [detail] optional parameter for WebGL mode only. This is to - * specify the number of vertices that makes up the - * perimeter of the ellipse. Default value is 25. Won't - * draw a stroke for a detail of more than 50. - */ - _main.default.prototype.ellipse = function (x, y, w, h, detailX) { - _main.default._validateParameters('ellipse', arguments); - return this._renderEllipse.apply(this, arguments); - }; - /** - * Draws a circle to the canvas. A circle is a round shape. Every point on the - * edge of a circle is the same distance from its center. By default, the first - * two parameters set the location of the center of the circle. The third - * parameter sets the shape's width and height (diameter). The origin may be - * changed with the ellipseMode() function. - * - * @method circle - * @param {Number} x x-coordinate of the center of the circle. - * @param {Number} y y-coordinate of the center of the circle. - * @param {Number} d diameter of the circle. - * @chainable - * @example - *
                - * - * circle(30, 30, 20); - * describe('A white circle with black outline in the middle of a gray canvas.'); - * - *
                - * - */ - _main.default.prototype.circle = function () { - _main.default._validateParameters('circle', arguments); - var args = Array.prototype.slice.call(arguments, 0, 2); - args.push(arguments[2]); - args.push(arguments[2]); - return this._renderEllipse.apply(this, _toConsumableArray(args)); - }; - // internal method for drawing ellipses (without parameter validation) - _main.default.prototype._renderEllipse = function (x, y, w, h, detailX) { - // if the current stroke and fill settings wouldn't result in something - // visible, exit immediately - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } // p5 supports negative width and heights for rects - - if (w < 0) { - w = Math.abs(w); - } - if (typeof h === 'undefined') { - // Duplicate 3rd argument if only 3 given. - h = w; - } else if (h < 0) { - h = Math.abs(h); - } - var vals = _helpers.default.modeAdjust(x, y, w, h, this._renderer._ellipseMode); - this._renderer.ellipse([vals.x, - vals.y, - vals.w, - vals.h, - detailX]); - //accessible Outputs - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('ellipse', [ - vals.x, - vals.y, - vals.w, - vals.h - ]); - } - return this; - }; - /** - * Draws a line, a straight path between two points. Its default width is one pixel. - * The version of `line()` with four parameters draws the line in 2D. To color a line, - * use the stroke() function. To change its width, use the - * strokeWeight() function. A line - * can't be filled, so the fill() function won't affect - * the color of a line. - * - * The version of `line()` with six parameters allows the line to be drawn in 3D - * space. Doing so requires adding the `WEBGL` argument to - * createCanvas(). - * - * @method line - * @param {Number} x1 the x-coordinate of the first point. - * @param {Number} y1 the y-coordinate of the first point. - * @param {Number} x2 the x-coordinate of the second point. - * @param {Number} y2 the y-coordinate of the second point. - * @chainable - * @example - *
                - * - * line(30, 20, 85, 75); - * describe( - * 'A black line on a gray canvas running from top-center to bottom-right.' - * ); - * - *
                - * - *
                - * - * line(30, 20, 85, 20); - * stroke(126); - * line(85, 20, 85, 75); - * stroke(255); - * line(85, 75, 30, 75); - * describe( - * 'Three lines drawn in grayscale on a gray canvas. They form the top, right, and bottom sides of a square.' - * ); - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('A black line drawn on a gray canvas.'); - * } - * - * function draw() { - * background(220); - * line(0, 0, 0, 10, 10, 0); - * } - * - *
                - * - */ - /** - * @method line - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 the z-coordinate of the first point. - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 the z-coordinate of the second point. - * @chainable - */ - _main.default.prototype.line = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('line', args); - if (this._renderer._doStroke) { - var _this$_renderer; - (_this$_renderer = this._renderer).line.apply(_this$_renderer, args); - } //accessible Outputs - - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('line', args); - } - return this; - }; - /** - * Draws a point, a single coordinate in space. Its default size is one pixel. The first two - * parameters are the point's x- and y-coordinates, respectively. To color a point, use - * the stroke() function. To change its size, use the - * strokeWeight() function. - * - * The version of `point()` with three parameters allows the point to be drawn in 3D - * space. Doing so requires adding the `WEBGL` argument to - * createCanvas(). - * - * The version of point() with one parameter allows the point's location to be set with - * a p5.Vector object. - * - * @method point - * @param {Number} x the x-coordinate. - * @param {Number} y the y-coordinate. - * @param {Number} [z] the z-coordinate (for WebGL mode). - * @chainable - * @example - *
                - * - * point(30, 20); - * point(85, 20); - * point(85, 75); - * point(30, 75); - * describe( - * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' - * ); - * - *
                - * - *
                - * - * point(30, 20); - * point(85, 20); - * stroke('purple'); - * strokeWeight(10); - * point(85, 75); - * point(30, 75); - * describe( - * 'Four points drawn on a gray canvas. Two are black and two are purple. The points form the corners of a square.' - * ); - * - *
                - * - *
                - * - * let a = createVector(10, 10); - * point(a); - * let b = createVector(10, 20); - * point(b); - * let c = createVector(20, 10); - * point(c); - * let d = createVector(20, 20); - * point(d); - * describe( - * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' - * ); - * - *
                - * - */ - /** - * @method point - * @param {p5.Vector} coordinateVector the coordinate vector. - * @chainable - */ - _main.default.prototype.point = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('point', args); - if (this._renderer._doStroke) { - if (args.length === 1 && args[0] instanceof _main.default.Vector) { - this._renderer.point.call(this._renderer, args[0].x, args[0].y, args[0].z); - } else { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).point.apply(_this$_renderer2, args); - //accessible Outputs - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('point', args); - } - } - } - return this; - }; - /** - * Draws a quad to the canvas. A quad is a quadrilateral, a four-sided - * polygon. Some examples of quads include rectangles, squares, rhombuses, - * and trapezoids. The first pair of parameters (`x1`,`y1`) sets the quad's - * first point. The following pairs of parameters set the coordinates for - * its next three points. Parameters should proceed clockwise or - * counter-clockwise around the shape. - * - * The version of `quad()` with twelve parameters allows the quad to be drawn - * in 3D space. Doing so requires adding the `WEBGL` argument to - * createCanvas(). - * - * @method quad - * @param {Number} x1 the x-coordinate of the first point. - * @param {Number} y1 the y-coordinate of the first point. - * @param {Number} x2 the x-coordinate of the second point. - * @param {Number} y2 the y-coordinate of the second point. - * @param {Number} x3 the x-coordinate of the third point. - * @param {Number} y3 the y-coordinate of the third point. - * @param {Number} x4 the x-coordinate of the fourth point. - * @param {Number} y4 the y-coordinate of the fourth point. - * @param {Integer} [detailX] number of segments in the x-direction. - * @param {Integer} [detailY] number of segments in the y-direction. - * @chainable - * @example - *
                - * - * quad(20, 20, 80, 20, 80, 80, 20, 80); - * describe('A white square with a black outline drawn on a gray canvas.'); - * - *
                - * - *
                - * - * quad(20, 30, 80, 30, 80, 70, 20, 70); - * describe('A white rectangle with a black outline drawn on a gray canvas.'); - * - *
                - * - *
                - * - * quad(50, 62, 86, 50, 50, 38, 14, 50); - * describe('A white rhombus with a black outline drawn on a gray canvas.'); - * - *
                - * - *
                - * - * quad(20, 50, 80, 30, 80, 70, 20, 70); - * describe('A white trapezoid with a black outline drawn on a gray canvas.'); - * - *
                - */ - /** - * @method quad - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 the z-coordinate of the first point. - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 the z-coordinate of the second point. - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 the z-coordinate of the third point. - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 the z-coordinate of the fourth point. - * @param {Integer} [detailX] - * @param {Integer} [detailY] - * @chainable - */ - _main.default.prototype.quad = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('quad', args); - if (this._renderer._doStroke || this._renderer._doFill) { - if (this._renderer.isP3D && args.length < 12) { - // if 3D and we weren't passed 12 args, assume Z is 0 - this._renderer.quad.call(this._renderer, args[0], args[1], 0, args[2], args[3], 0, args[4], args[5], 0, args[6], args[7], 0, args[8], args[9]); - } else { - var _this$_renderer3; - (_this$_renderer3 = this._renderer).quad.apply(_this$_renderer3, args); - //accessibile outputs - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('quadrilateral', args); - } - } - } - return this; - }; - /** - * Draws a rectangle to the canvas. A rectangle is a four-sided polygon with - * every angle at ninety degrees. By default, the first two parameters set the - * location of the rectangle's upper-left corner. The third and fourth set the - * shape's the width and height, respectively. The way these parameters are - * interpreted may be changed with the rectMode() - * function. - * - * The version of `rect()` with five parameters creates a rounded rectangle. The - * fifth parameter is used as the radius value for all four corners. - * - * The version of `rect()` with eight parameters also creates a rounded rectangle. - * When using eight parameters, the latter four set the radius of the arc at - * each corner separately. The radii start with the top-left corner and move - * clockwise around the rectangle. If any of these parameters are omitted, they - * are set to the value of the last specified corner radius. - * - * @method rect - * @param {Number} x x-coordinate of the rectangle. - * @param {Number} y y-coordinate of the rectangle. - * @param {Number} w width of the rectangle. - * @param {Number} [h] height of the rectangle. - * @param {Number} [tl] optional radius of top-left corner. - * @param {Number} [tr] optional radius of top-right corner. - * @param {Number} [br] optional radius of bottom-right corner. - * @param {Number} [bl] optional radius of bottom-left corner. - * @chainable - * @example - *
                - * - * rect(30, 20, 55, 55); - * describe('A white rectangle with a black outline on a gray canvas.'); - * - *
                - * - *
                - * - * rect(30, 20, 55, 55, 20); - * describe( - * 'A white rectangle with a black outline and round edges on a gray canvas.' - * ); - * - *
                - * - *
                - * - * rect(30, 20, 55, 55, 20, 15, 10, 5); - * describe('A white rectangle with a black outline and round edges of different radii.'); - * - *
                - * - */ - /** - * @method rect - * @param {Number} x - * @param {Number} y - * @param {Number} w - * @param {Number} h - * @param {Integer} [detailX] number of segments in the x-direction (for WebGL mode). - * @param {Integer} [detailY] number of segments in the y-direction (for WebGL mode). - * @chainable - */ - _main.default.prototype.rect = function () { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - _main.default._validateParameters('rect', args); - return this._renderRect.apply(this, args); - }; - /** - * Draws a square to the canvas. A square is a four-sided polygon with every - * angle at ninety degrees and equal side lengths. By default, the first two - * parameters set the location of the square's upper-left corner. The third - * parameter sets its side size. The way these parameters are interpreted may - * be changed with the rectMode() function. - * - * The version of `square()` with four parameters creates a rounded square. The - * fourth parameter is used as the radius value for all four corners. - * - * The version of `square()` with seven parameters also creates a rounded square. - * When using seven parameters, the latter four set the radius of the arc at - * each corner separately. The radii start with the top-left corner and move - * clockwise around the square. If any of these parameters are omitted, they - * are set to the value of the last specified corner radius. - * - * @method square - * @param {Number} x x-coordinate of the square. - * @param {Number} y y-coordinate of the square. - * @param {Number} s side size of the square. - * @param {Number} [tl] optional radius of top-left corner. - * @param {Number} [tr] optional radius of top-right corner. - * @param {Number} [br] optional radius of bottom-right corner. - * @param {Number} [bl] optional radius of bottom-left corner. - * @chainable - * @example - *
                - * - * square(30, 20, 55); - * describe('A white square with a black outline in on a gray canvas.'); - * - *
                - * - *
                - * - * square(30, 20, 55, 20); - * describe( - * 'A white square with a black outline and round edges on a gray canvas.' - * ); - * - *
                - * - *
                - * - * square(30, 20, 55, 20, 15, 10, 5); - * describe('A white square with a black outline and round edges of different radii.'); - * - *
                - * - */ - _main.default.prototype.square = function (x, y, s, tl, tr, br, bl) { - _main.default._validateParameters('square', arguments); - // duplicate width for height in case of square - return this._renderRect.call(this, x, y, s, s, tl, tr, br, bl); - }; - // internal method to have renderer draw a rectangle - _main.default.prototype._renderRect = function () { - if (this._renderer._doStroke || this._renderer._doFill) { - // duplicate width for height in case only 3 arguments is provided - if (arguments.length === 3) { - arguments[3] = arguments[2]; - } - var vals = _helpers.default.modeAdjust(arguments[0], arguments[1], arguments[2], arguments[3], this._renderer._rectMode); - var args = [ - vals.x, - vals.y, - vals.w, - vals.h - ]; - // append the additional arguments (either cornder radii, or - // segment details) to the argument list - for (var i = 4; i < arguments.length; i++) { - args[i] = arguments[i]; - } - this._renderer.rect(args); - //accessible outputs - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('rectangle', [ - vals.x, - vals.y, - vals.w, - vals.h - ]); - } - } - return this; - }; - /** - * Draws a triangle to the canvas. A triangle is a three-sided polygon. The - * first two parameters specify the triangle's first point `(x1,y1)`. The middle - * two parameters specify its second point `(x2,y2)`. And the last two parameters - * specify its third point `(x3, y3)`. - * - * @method triangle - * @param {Number} x1 x-coordinate of the first point. - * @param {Number} y1 y-coordinate of the first point. - * @param {Number} x2 x-coordinate of the second point. - * @param {Number} y2 y-coordinate of the second point. - * @param {Number} x3 x-coordinate of the third point. - * @param {Number} y3 y-coordinate of the third point. - * @chainable - * @example - *
                - * - * triangle(30, 75, 58, 20, 86, 75); - * describe('A white triangle with a black outline on a gray canvas.'); - * - *
                - * - */ - _main.default.prototype.triangle = function () { - for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - _main.default._validateParameters('triangle', args); - if (this._renderer._doStroke || this._renderer._doFill) { - this._renderer.triangle(args); - } //accessible outputs - - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput('triangle', args); - } - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../constants': 286, - '../friendly_errors/fes_core': 289, - '../friendly_errors/file_errors': 290, - '../friendly_errors/validate_params': 293, - '../helpers': 294, - '../main': 298, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 306: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var constants = _interopRequireWildcard(_dereq_('../constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Shape - * @submodule Attributes - * @for p5 - * @requires core - * @requires constants - */ - /** - * Modifies the location from which ellipses, circles, and arcs are drawn. By default, the - * first two parameters are the x- and y-coordinates of the shape's center. The next - * parameters are its width and height. This is equivalent to calling `ellipseMode(CENTER)`. - * - * `ellipseMode(RADIUS)` also uses the first two parameters to set the x- and y-coordinates - * of the shape's center. The next parameters are half of the shapes's width and height. - * Calling `ellipse(0, 0, 10, 15)` draws a shape with a width of 20 and height of 30. - * - * `ellipseMode(CORNER)` uses the first two parameters as the upper-left corner of the - * shape. The next parameters are its width and height. - * - * `ellipseMode(CORNERS)` uses the first two parameters as the location of one corner - * of the ellipse's bounding box. The third and fourth parameters are the location of the - * opposite corner. - * - * The argument passed to `ellipseMode()` must be written in ALL CAPS because the constants - * `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. JavaScript is a - * case-sensitive language. - * - * @method ellipseMode - * @param {Constant} mode either CENTER, RADIUS, CORNER, or CORNERS - * @chainable - * @example - *
                - * - * ellipseMode(RADIUS); - * fill(255); - * ellipse(50, 50, 30, 30); - * ellipseMode(CENTER); - * fill(100); - * ellipse(50, 50, 30, 30); - * describe('A white circle with a gray circle at its center. Both circles have black outlines.'); - * - *
                - * - *
                - * - * ellipseMode(CORNER); - * fill(255); - * ellipse(25, 25, 50, 50); - * ellipseMode(CORNERS); - * fill(100); - * ellipse(25, 25, 50, 50); - * describe('A white circle with a gray circle at its top-left corner. Both circles have black outlines.'); - * - *
                - */ - - _main.default.prototype.ellipseMode = function (m) { - _main.default._validateParameters('ellipseMode', arguments); - if (m === constants.CORNER || m === constants.CORNERS || m === constants.RADIUS || m === constants.CENTER) { - this._renderer._ellipseMode = m; - } - return this; - }; - /** - * Draws all geometry with jagged (aliased) edges. - * - * smooth() is active by default in 2D mode. It's necessary to call - * noSmooth() to disable smoothing of geometry, images, and fonts. - * - * In WebGL mode, noSmooth() is active by default. It's necessary - * to call smooth() to draw smooth (antialiased) edges. - * - * @method noSmooth - * @chainable - * @example - *
                - * - * background(0); - * noStroke(); - * smooth(); - * ellipse(30, 48, 36, 36); - * noSmooth(); - * ellipse(70, 48, 36, 36); - * describe('Two pixelated white circles on a black background.'); - * - *
                - */ - _main.default.prototype.noSmooth = function () { - if (!this._renderer.isP3D) { - if ('imageSmoothingEnabled' in this.drawingContext) { - this.drawingContext.imageSmoothingEnabled = false; - } - } else { - this.setAttributes('antialias', false); - } - return this; - }; - /** - * Modifies the location from which rectangles and squares are drawn. By default, - * the first two parameters are the x- and y-coordinates of the shape's upper-left - * corner. The next parameters are its width and height. This is equivalent to - * calling `rectMode(CORNER)`. - * - * `rectMode(CORNERS)` also uses the first two parameters as the location of one of - * the corners. The third and fourth parameters are the location of the opposite - * corner. - * - * `rectMode(CENTER)` uses the first two parameters as the x- and y-coordinates of - * the shape's center. The next parameters are its width and height. - * - * `rectMode(RADIUS)` also uses the first two parameters as the x- and y-coordinates - * of the shape's center. The next parameters are half of the shape's width and - * height. - * - * The argument passed to `rectMode()` must be written in ALL CAPS because the - * constants `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. - * JavaScript is a case-sensitive language. - * - * @method rectMode - * @param {Constant} mode either CORNER, CORNERS, CENTER, or RADIUS - * @chainable - * @example - *
                - * - * rectMode(CORNER); - * fill(255); - * rect(25, 25, 50, 50); - * - * rectMode(CORNERS); - * fill(100); - * rect(25, 25, 50, 50); - * - * describe('A small gray square drawn at the top-left corner of a white square.'); - * - *
                - * - *
                - * - * rectMode(RADIUS); - * fill(255); - * rect(50, 50, 30, 30); - * - * rectMode(CENTER); - * fill(100); - * rect(50, 50, 30, 30); - * - * describe('A small gray square drawn at the center of a white square.'); - * - *
                - */ - _main.default.prototype.rectMode = function (m) { - _main.default._validateParameters('rectMode', arguments); - if (m === constants.CORNER || m === constants.CORNERS || m === constants.RADIUS || m === constants.CENTER) { - this._renderer._rectMode = m; - } - return this; - }; - /** - * Draws all geometry with smooth (anti-aliased) edges. smooth() will also - * improve image quality of resized images. - * - * smooth() is active by default in 2D mode. It's necessary to call - * noSmooth() to disable smoothing of geometry, images, and fonts. - * - * In WebGL mode, noSmooth() is active by default. It's necessary - * to call smooth() to draw smooth (antialiased) edges. - * - * @method smooth - * @chainable - * @example - *
                - * - * background(0); - * noStroke(); - * smooth(); - * ellipse(30, 48, 36, 36); - * noSmooth(); - * ellipse(70, 48, 36, 36); - * describe('Two pixelated white circles on a black background.'); - * - *
                - */ - _main.default.prototype.smooth = function () { - this.setAttributes('antialias', true); - if (!this._renderer.isP3D) { - if ('imageSmoothingEnabled' in this.drawingContext) { - this.drawingContext.imageSmoothingEnabled = true; - } - } - return this; - }; - /** - * Sets the style for rendering line endings. These ends are either rounded - * (`ROUND`), squared (`SQUARE`), or extended (`PROJECT`). The default cap is - * `ROUND`. - * - * The argument passed to `strokeCap()` must be written in ALL CAPS because - * the constants `ROUND`, `SQUARE`, and `PROJECT` are defined this way. - * JavaScript is a case-sensitive language. - * - * @method strokeCap - * @param {Constant} cap either ROUND, SQUARE, or PROJECT - * @chainable - * @example - *
                - * - * strokeWeight(12.0); - * strokeCap(ROUND); - * line(20, 30, 80, 30); - * strokeCap(SQUARE); - * line(20, 50, 80, 50); - * strokeCap(PROJECT); - * line(20, 70, 80, 70); - * describe('Three horizontal lines. The top line has rounded ends, the middle line has squared ends, and the bottom line has longer, squared ends.'); - * - *
                - */ - _main.default.prototype.strokeCap = function (cap) { - _main.default._validateParameters('strokeCap', arguments); - if (cap === constants.ROUND || cap === constants.SQUARE || cap === constants.PROJECT) { - this._renderer.strokeCap(cap); - } - return this; - }; - /** - * Sets the style of the joints which connect line segments. These joints are - * either mitered (`MITER`), beveled (`BEVEL`), or rounded (`ROUND`). The default - * joint is `MITER` in 2D mode and `ROUND` in WebGL mode. - * - * The argument passed to `strokeJoin()` must be written in ALL CAPS because - * the constants `MITER`, `BEVEL`, and `ROUND` are defined this way. - * JavaScript is a case-sensitive language. - * - * @method strokeJoin - * @param {Constant} join either MITER, BEVEL, or ROUND - * @chainable - * @example - *
                - * - * noFill(); - * strokeWeight(10.0); - * strokeJoin(MITER); - * beginShape(); - * vertex(35, 20); - * vertex(65, 50); - * vertex(35, 80); - * endShape(); - * describe('A right-facing arrowhead shape with a pointed tip in center of canvas.'); - * - *
                - * - *
                - * - * noFill(); - * strokeWeight(10.0); - * strokeJoin(BEVEL); - * beginShape(); - * vertex(35, 20); - * vertex(65, 50); - * vertex(35, 80); - * endShape(); - * describe('A right-facing arrowhead shape with a flat tip in center of canvas.'); - * - *
                - * - *
                - * - * noFill(); - * strokeWeight(10.0); - * strokeJoin(ROUND); - * beginShape(); - * vertex(35, 20); - * vertex(65, 50); - * vertex(35, 80); - * endShape(); - * describe('A right-facing arrowhead shape with a rounded tip in center of canvas.'); - * - *
                - */ - _main.default.prototype.strokeJoin = function (join) { - _main.default._validateParameters('strokeJoin', arguments); - if (join === constants.ROUND || join === constants.BEVEL || join === constants.MITER) { - this._renderer.strokeJoin(join); - } - return this; - }; - /** - * Sets the width of the stroke used for lines, points, and the border around - * shapes. All widths are set in units of pixels. - * - * Note that `strokeWeight()` is affected by any transformation or scaling that - * has been applied previously. - * - * @method strokeWeight - * @param {Number} weight the weight of the stroke (in pixels). - * @chainable - * @example - *
                - * - * // Default. - * line(20, 20, 80, 20); - * // Thicker. - * strokeWeight(4); - * line(20, 40, 80, 40); - * // Beastly. - * strokeWeight(10); - * line(20, 70, 80, 70); - * describe('Three horizontal black lines. The top line is thin, the middle is medium, and the bottom is thick.'); - * - *
                - * - *
                - * - * // Default. - * line(20, 20, 80, 20); - * // Adding scale transformation. - * scale(5); - * // Coordinates adjusted for scaling. - * line(4, 8, 16, 8); - * describe('Two horizontal black lines. The top line is thin and the bottom is five times thicker than the top.'); - * - *
                - */ - _main.default.prototype.strokeWeight = function (w) { - _main.default._validateParameters('strokeWeight', arguments); - this._renderer.strokeWeight(w); - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../constants': 286, - '../main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 307: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - _dereq_('../friendly_errors/fes_core'); - _dereq_('../friendly_errors/file_errors'); - _dereq_('../friendly_errors/validate_params'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Shape - * @submodule Curves - * @for p5 - * @requires core - */ - /** - * Draws a cubic Bezier curve on the screen. These curves are defined by a - * series of anchor and control points. The first two parameters specify - * the first anchor point and the last two parameters specify the other - * anchor point, which become the first and last points on the curve. The - * middle parameters specify the two control points which define the shape - * of the curve. Approximately speaking, control points "pull" the curve - * towards them. - * - * Bezier curves were developed by French automotive engineer Pierre Bezier, - * and are commonly used in computer graphics to define gently sloping curves. - * See also curve(). - * - * @method bezier - * @param {Number} x1 x-coordinate for the first anchor point - * @param {Number} y1 y-coordinate for the first anchor point - * @param {Number} x2 x-coordinate for the first control point - * @param {Number} y2 y-coordinate for the first control point - * @param {Number} x3 x-coordinate for the second control point - * @param {Number} y3 y-coordinate for the second control point - * @param {Number} x4 x-coordinate for the second anchor point - * @param {Number} y4 y-coordinate for the second anchor point - * @chainable - * @example - *
                - * - * noFill(); - * stroke(255, 102, 0); - * line(85, 20, 10, 10); - * line(90, 90, 15, 80); - * stroke(0, 0, 0); - * bezier(85, 20, 10, 10, 90, 90, 15, 80); - * - *
                - * - *
                - * - * background(0, 0, 0); - * noFill(); - * stroke(255); - * bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0); - * - *
                - * - * @alt - * stretched black s-shape in center with orange lines extending from end points. - * a white colored curve on black background from the upper-right corner to the lower right corner. - */ - /** - * @method bezier - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 z-coordinate for the first anchor point - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate for the first control point - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the second control point - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 z-coordinate for the second anchor point - * @chainable - */ - - _main.default.prototype.bezier = function () { - var _this$_renderer; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('bezier', args); - // if the current stroke and fill settings wouldn't result in something - // visible, exit immediately - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - }(_this$_renderer = this._renderer).bezier.apply(_this$_renderer, args); - return this; - }; - /** - * Sets the resolution at which Bezier's curve is displayed. The default value is 20. - * - * Note, This function is only useful when using the WEBGL renderer - * as the default canvas renderer does not use this information. - * - * @method bezierDetail - * @param {Number} detail resolution of the curves - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noFill(); - * bezierDetail(5); - * } - * - * function draw() { - * background(200); - * bezier( - * -40, -40, 0, - * 90, -40, 0, - * -90, 40, 0, - * 40, 40, 0 - * ); - * } - * - *
                - * - * @alt - * stretched black s-shape with a low level of bezier detail - */ - _main.default.prototype.bezierDetail = function (d) { - _main.default._validateParameters('bezierDetail', arguments); - this._bezierDetail = d; - return this; - }; - /** - * Given the x or y co-ordinate values of control and anchor points of a bezier - * curve, it evaluates the x or y coordinate of the bezier at position t. The - * parameters a and d are the x or y coordinates of first and last points on the - * curve while b and c are of the control points.The final parameter t is the - * position of the resultant point which is given between 0 and 1. - * This can be done once with the x coordinates and a second time - * with the y coordinates to get the location of a bezier curve at t. - * - * @method bezierPoint - * @param {Number} a coordinate of first point on the curve - * @param {Number} b coordinate of first control point - * @param {Number} c coordinate of second control point - * @param {Number} d coordinate of second point on the curve - * @param {Number} t value between 0 and 1 - * @return {Number} the value of the Bezier at position t - * @example - *
                - * - * noFill(); - * let x1 = 85, - x2 = 10, - x3 = 90, - x4 = 15; - * let y1 = 20, - y2 = 10, - y3 = 90, - y4 = 80; - * bezier(x1, y1, x2, y2, x3, y3, x4, y4); - * fill(255); - * let steps = 10; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = bezierPoint(x1, x2, x3, x4, t); - * let y = bezierPoint(y1, y2, y3, y4, t); - * circle(x, y, 5); - * } - * - *
                - * - * @alt - * 10 points plotted on a given bezier at equal distances. - */ - _main.default.prototype.bezierPoint = function (a, b, c, d, t) { - _main.default._validateParameters('bezierPoint', arguments); - var adjustedT = 1 - t; - return Math.pow(adjustedT, 3) * a + 3 * Math.pow(adjustedT, 2) * t * b + 3 * adjustedT * Math.pow(t, 2) * c + Math.pow(t, 3) * d; - }; - /** - * Evaluates the tangent to the Bezier at position t for points a, b, c, d. - * The parameters a and d are the first and last points - * on the curve, and b and c are the control points. - * The final parameter t varies between 0 and 1. - * - * @method bezierTangent - * @param {Number} a coordinate of first point on the curve - * @param {Number} b coordinate of first control point - * @param {Number} c coordinate of second control point - * @param {Number} d coordinate of second point on the curve - * @param {Number} t value between 0 and 1 - * @return {Number} the tangent at position t - * @example - *
                - * - * noFill(); - * bezier(85, 20, 10, 10, 90, 90, 15, 80); - * let steps = 6; - * fill(255); - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * // Get the location of the point - * let x = bezierPoint(85, 10, 90, 15, t); - * let y = bezierPoint(20, 10, 90, 80, t); - * // Get the tangent points - * let tx = bezierTangent(85, 10, 90, 15, t); - * let ty = bezierTangent(20, 10, 90, 80, t); - * // Calculate an angle from the tangent points - * let a = atan2(ty, tx); - * a += PI; - * stroke(255, 102, 0); - * line(x, y, cos(a) * 30 + x, sin(a) * 30 + y); - * // The following line of code makes a line - * // inverse of the above line - * //line(x, y, cos(a)*-30 + x, sin(a)*-30 + y); - * stroke(0); - * ellipse(x, y, 5, 5); - * } - * - *
                - * - *
                - * - * noFill(); - * bezier(85, 20, 10, 10, 90, 90, 15, 80); - * stroke(255, 102, 0); - * let steps = 16; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = bezierPoint(85, 10, 90, 15, t); - * let y = bezierPoint(20, 10, 90, 80, t); - * let tx = bezierTangent(85, 10, 90, 15, t); - * let ty = bezierTangent(20, 10, 90, 80, t); - * let a = atan2(ty, tx); - * a -= HALF_PI; - * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); - * } - * - *
                - * - * @alt - * s-shaped line with 6 short orange lines showing the tangents at those points. - * s-shaped line with 6 short orange lines showing lines coming out the underside of the bezier. - */ - _main.default.prototype.bezierTangent = function (a, b, c, d, t) { - _main.default._validateParameters('bezierTangent', arguments); - var adjustedT = 1 - t; - return 3 * d * Math.pow(t, 2) - 3 * c * Math.pow(t, 2) + 6 * c * adjustedT * t - 6 * b * adjustedT * t + 3 * b * Math.pow(adjustedT, 2) - 3 * a * Math.pow(adjustedT, 2); - }; - /** - * Draws a curved line on the screen between two points, given as the - * middle four parameters. The first two parameters are a control point, as - * if the curve came from this point even though it's not drawn. The last - * two parameters similarly describe the other control point.

                - * Longer curves can be created by putting a series of curve() functions - * together or using curveVertex(). An additional function called - * curveTightness() provides control for the visual quality of the curve. - * The curve() function is an implementation of Catmull-Rom splines. - * - * @method curve - * @param {Number} x1 x-coordinate for the beginning control point - * @param {Number} y1 y-coordinate for the beginning control point - * @param {Number} x2 x-coordinate for the first point - * @param {Number} y2 y-coordinate for the first point - * @param {Number} x3 x-coordinate for the second point - * @param {Number} y3 y-coordinate for the second point - * @param {Number} x4 x-coordinate for the ending control point - * @param {Number} y4 y-coordinate for the ending control point - * @chainable - * @example - *
                - * - * noFill(); - * stroke(255, 102, 0); - * curve(5, 26, 5, 26, 73, 24, 73, 61); - * stroke(0); - * curve(5, 26, 73, 24, 73, 61, 15, 65); - * stroke(255, 102, 0); - * curve(73, 24, 73, 61, 15, 65, 15, 65); - * - *
                - * - *
                - * - * // Define the curve points as JavaScript objects - * let p1 = { x: 5, y: 26 }; - * let p2 = { x: 73, y: 24 }; - * let p3 = { x: 73, y: 61 }; - * let p4 = { x: 15, y: 65 }; - * noFill(); - * stroke(255, 102, 0); - * curve(p1.x, p1.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); - * stroke(0); - * curve(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y); - * stroke(255, 102, 0); - * curve(p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, p4.x, p4.y); - * - *
                - * - *
                - * - * noFill(); - * stroke(255, 102, 0); - * curve(5, 26, 0, 5, 26, 0, 73, 24, 0, 73, 61, 0); - * stroke(0); - * curve(5, 26, 0, 73, 24, 0, 73, 61, 0, 15, 65, 0); - * stroke(255, 102, 0); - * curve(73, 24, 0, 73, 61, 0, 15, 65, 0, 15, 65, 0); - * - *
                - * - * @alt - * horseshoe shape with orange ends facing left and black curved center. - * horseshoe shape with orange ends facing left and black curved center. - * curving black and orange lines. - */ - /** - * @method curve - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 z-coordinate for the beginning control point - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate for the first point - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the second point - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 z-coordinate for the ending control point - * @chainable - */ - _main.default.prototype.curve = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('curve', args); - if (this._renderer._doStroke) { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).curve.apply(_this$_renderer2, args); - } - return this; - }; - /** - * Sets the resolution at which curves display. The default value is 20 while - * the minimum value is 3. - * - * This function is only useful when using the WEBGL renderer - * as the default canvas renderer does not use this - * information. - * - * @method curveDetail - * @param {Number} resolution resolution of the curves - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * curveDetail(5); - * } - * function draw() { - * background(200); - * - * curve(250, 600, 0, -30, 40, 0, 30, 30, 0, -250, 600, 0); - * } - * - *
                - * - * @alt - * white arch shape with a low level of curve detail. - */ - _main.default.prototype.curveDetail = function (d) { - _main.default._validateParameters('curveDetail', arguments); - if (d < 3) { - this._curveDetail = 3; - } else { - this._curveDetail = d; - } - return this; - }; - /** - * Modifies the quality of forms created with curve() - * and curveVertex().The parameter tightness - * determines how the curve fits to the vertex points. The value 0.0 is the - * default value for tightness (this value defines the curves to be Catmull-Rom - * splines) and the value 1.0 connects all the points with straight lines. - * Values within the range -5.0 and 5.0 will deform the curves but will leave - * them recognizable and as values increase in magnitude, they will continue to deform. - * - * @method curveTightness - * @param {Number} amount amount of deformation from the original vertices - * @chainable - * @example - *
                - * - * // Move the mouse left and right to see the curve change - * function setup() { - * createCanvas(100, 100); - * noFill(); - * } - * - * function draw() { - * background(204); - * let t = map(mouseX, 0, width, -5, 5); - * curveTightness(t); - * beginShape(); - * curveVertex(10, 26); - * curveVertex(10, 26); - * curveVertex(83, 24); - * curveVertex(83, 61); - * curveVertex(25, 65); - * curveVertex(25, 65); - * endShape(); - * } - * - *
                - * - * @alt - * Line shaped like right-facing arrow,points move with mouse-x and warp shape. - */ - _main.default.prototype.curveTightness = function (t) { - _main.default._validateParameters('curveTightness', arguments); - this._renderer._curveTightness = t; - return this; - }; - /** - * Evaluates the curve at position t for points a, b, c, d. - * The parameter t varies between 0 and 1, a and d are control points - * of the curve, and b and c are the start and end points of the curve. - * This can be done once with the x coordinates and a second time - * with the y coordinates to get the location of a curve at t. - * - * @method curvePoint - * @param {Number} a coordinate of first control point of the curve - * @param {Number} b coordinate of first point - * @param {Number} c coordinate of second point - * @param {Number} d coordinate of second control point - * @param {Number} t value between 0 and 1 - * @return {Number} Curve value at position t - * @example - *
                - * - * noFill(); - * curve(5, 26, 5, 26, 73, 24, 73, 61); - * curve(5, 26, 73, 24, 73, 61, 15, 65); - * fill(255); - * ellipseMode(CENTER); - * let steps = 6; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = curvePoint(5, 5, 73, 73, t); - * let y = curvePoint(26, 26, 24, 61, t); - * ellipse(x, y, 5, 5); - * x = curvePoint(5, 73, 73, 15, t); - * y = curvePoint(26, 24, 61, 65, t); - * ellipse(x, y, 5, 5); - * } - * - *
                - * - *line hooking down to right-bottom with 13 5×5 white ellipse points - */ - _main.default.prototype.curvePoint = function (a, b, c, d, t) { - _main.default._validateParameters('curvePoint', arguments); - var s = this._renderer._curveTightness, - t3 = t * t * t, - t2 = t * t, - f1 = (s - 1) / 2 * t3 + (1 - s) * t2 + (s - 1) / 2 * t, - f2 = (s + 3) / 2 * t3 + ( - 5 - s) / 2 * t2 + 1, - f3 = ( - 3 - s) / 2 * t3 + (s + 2) * t2 + (1 - s) / 2 * t, - f4 = (1 - s) / 2 * t3 + (s - 1) / 2 * t2; - return a * f1 + b * f2 + c * f3 + d * f4; - }; - /** - * Evaluates the tangent to the curve at position t for points a, b, c, d. - * The parameter t varies between 0 and 1, a and d are points on the curve, - * and b and c are the control points. - * - * @method curveTangent - * @param {Number} a coordinate of first control point - * @param {Number} b coordinate of first point on the curve - * @param {Number} c coordinate of second point on the curve - * @param {Number} d coordinate of second conrol point - * @param {Number} t value between 0 and 1 - * @return {Number} the tangent at position t - * @example - *
                - * - * noFill(); - * curve(5, 26, 73, 24, 73, 61, 15, 65); - * let steps = 6; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = curvePoint(5, 73, 73, 15, t); - * let y = curvePoint(26, 24, 61, 65, t); - * //ellipse(x, y, 5, 5); - * let tx = curveTangent(5, 73, 73, 15, t); - * let ty = curveTangent(26, 24, 61, 65, t); - * let a = atan2(ty, tx); - * a -= PI / 2.0; - * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); - * } - * - *
                - * - * @alt - * right curving line mid-right of canvas with 7 short lines radiating from it. - */ - _main.default.prototype.curveTangent = function (a, b, c, d, t) { - _main.default._validateParameters('curveTangent', arguments); - var s = this._renderer._curveTightness, - tt3 = t * t * 3, - t2 = t * 2, - f1 = (s - 1) / 2 * tt3 + (1 - s) * t2 + (s - 1) / 2, - f2 = (s + 3) / 2 * tt3 + ( - 5 - s) / 2 * t2, - f3 = ( - 3 - s) / 2 * tt3 + (s + 2) * t2 + (1 - s) / 2, - f4 = (1 - s) / 2 * tt3 + (s - 1) / 2 * t2; - return a * f1 + b * f2 + c * f3 + d * f4; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../friendly_errors/fes_core': 289, - '../friendly_errors/file_errors': 290, - '../friendly_errors/validate_params': 293, - '../main': 298 - } - ], - 308: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.slice'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../main')); - var constants = _interopRequireWildcard(_dereq_('../constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Shape - * @submodule Vertex - * @for p5 - * @requires core - * @requires constants - */ - - var shapeKind = null; - var vertices = [ - ]; - var contourVertices = [ - ]; - var isBezier = false; - var isCurve = false; - var isQuadratic = false; - var isContour = false; - var isFirstContour = true; - /** - * Use the beginContour() and - * endContour() functions to create negative shapes - * within shapes such as the center of the letter 'O'. beginContour() - * begins recording vertices for the shape and endContour() stops recording. - * The vertices that define a negative shape must "wind" in the opposite direction - * from the exterior shape. First draw vertices for the exterior clockwise order, then for internal shapes, draw vertices - * shape in counter-clockwise. - * - * These functions can only be used within a beginShape()/endShape() pair and - * transformations such as translate(), rotate(), and scale() do not work - * within a beginContour()/endContour() pair. It is also not possible to use - * other shapes, such as ellipse() or rect() within. - * - * @method beginContour - * @chainable - * @example - *
                - * - * translate(50, 50); - * stroke(255, 0, 0); - * beginShape(); - * // Exterior part of shape, clockwise winding - * vertex(-40, -40); - * vertex(40, -40); - * vertex(40, 40); - * vertex(-40, 40); - * // Interior part of shape, counter-clockwise winding - * beginContour(); - * vertex(-20, -20); - * vertex(-20, 20); - * vertex(20, 20); - * vertex(20, -20); - * endContour(); - * endShape(CLOSE); - * - *
                - * - * @alt - * white rect and smaller grey rect with red outlines in center of canvas. - */ - _main.default.prototype.beginContour = function () { - if (this._renderer.isP3D) { - this._renderer.beginContour(); - } else { - contourVertices = [ - ]; - isContour = true; - } - return this; - }; - /** - * Using the beginShape() and endShape() functions allow creating more - * complex forms. beginShape() begins recording vertices for a shape and - * endShape() stops recording. The value of the kind parameter tells it which - * types of shapes to create from the provided vertices. With no mode - * specified, the shape can be any irregular polygon. - * - * The parameters available for beginShape() are: - * - * POINTS - * Draw a series of points - * - * LINES - * Draw a series of unconnected line segments (individual lines) - * - * TRIANGLES - * Draw a series of separate triangles - * - * TRIANGLE_FAN - * Draw a series of connected triangles sharing the first vertex in a fan-like fashion - * - * TRIANGLE_STRIP - * Draw a series of connected triangles in strip fashion - * - * QUADS - * Draw a series of separate quads - * - * QUAD_STRIP - * Draw quad strip using adjacent edges to form the next quad - * - * TESS (WEBGL only) - * Handle irregular polygon for filling curve by explicit tessellation - * - * After calling the beginShape() function, a series of vertex() commands must follow. To stop - * drawing the shape, call endShape(). Each shape will be outlined with the - * current stroke color and filled with the fill color. - * - * Transformations such as translate(), rotate(), and scale() do not work - * within beginShape(). It is also not possible to use other shapes, such as - * ellipse() or rect() within beginShape(). - * - * @method beginShape - * @param {Constant} [kind] either POINTS, LINES, TRIANGLES, TRIANGLE_FAN - * TRIANGLE_STRIP, QUADS, QUAD_STRIP or TESS - * @chainable - * @example - *
                - * - * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(CLOSE); - * - *
                - * - *
                - * - * beginShape(POINTS); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                - * - *
                - * - * beginShape(LINES); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                - * - *
                - * - * noFill(); - * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                - * - *
                - * - * noFill(); - * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(CLOSE); - * - *
                - * - *
                - * - * beginShape(TRIANGLES); - * vertex(30, 75); - * vertex(40, 20); - * vertex(50, 75); - * vertex(60, 20); - * vertex(70, 75); - * vertex(80, 20); - * endShape(); - * - *
                - * - *
                - * - * beginShape(TRIANGLE_STRIP); - * vertex(30, 75); - * vertex(40, 20); - * vertex(50, 75); - * vertex(60, 20); - * vertex(70, 75); - * vertex(80, 20); - * vertex(90, 75); - * endShape(); - * - *
                - * - *
                - * - * beginShape(TRIANGLE_FAN); - * vertex(57.5, 50); - * vertex(57.5, 15); - * vertex(92, 50); - * vertex(57.5, 85); - * vertex(22, 50); - * vertex(57.5, 15); - * endShape(); - * - *
                - * - *
                - * - * beginShape(QUADS); - * vertex(30, 20); - * vertex(30, 75); - * vertex(50, 75); - * vertex(50, 20); - * vertex(65, 20); - * vertex(65, 75); - * vertex(85, 75); - * vertex(85, 20); - * endShape(); - * - *
                - * - *
                - * - * beginShape(QUAD_STRIP); - * vertex(30, 20); - * vertex(30, 75); - * vertex(50, 20); - * vertex(50, 75); - * vertex(65, 20); - * vertex(65, 75); - * vertex(85, 20); - * vertex(85, 75); - * endShape(); - * - *
                - * - *
                - * - * beginShape(TESS); - * vertex(20, 20); - * vertex(80, 20); - * vertex(80, 40); - * vertex(40, 40); - * vertex(40, 60); - * vertex(80, 60); - * vertex(80, 80); - * vertex(20, 80); - * endShape(CLOSE); - * - *
                - * - * @alt - * white square-shape with black outline in middle-right of canvas. - * 4 black points in a square shape in middle-right of canvas. - * 2 horizontal black lines. In the top-right and bottom-right of canvas. - * 3 line shape with horizontal on top, vertical in middle and horizontal bottom. - * square line shape in middle-right of canvas. - * 2 white triangle shapes mid-right canvas. left one pointing up and right down. - * 5 horizontal interlocking and alternating white triangles in mid-right canvas. - * 4 interlocking white triangles in 45 degree rotated square-shape. - * 2 white rectangle shapes in mid-right canvas. Both 20×55. - * 3 side-by-side white rectangles center rect is smaller in mid-right canvas. - * Thick white l-shape with black outline mid-top-left of canvas. - */ - _main.default.prototype.beginShape = function (kind) { - _main.default._validateParameters('beginShape', arguments); - if (this._renderer.isP3D) { - var _this$_renderer; - (_this$_renderer = this._renderer).beginShape.apply(_this$_renderer, arguments); - } else { - if (kind === constants.POINTS || kind === constants.LINES || kind === constants.TRIANGLES || kind === constants.TRIANGLE_FAN || kind === constants.TRIANGLE_STRIP || kind === constants.QUADS || kind === constants.QUAD_STRIP) { - shapeKind = kind; - } else { - shapeKind = null; - } - vertices = [ - ]; - contourVertices = [ - ]; - } - return this; - }; - /** - * Specifies vertex coordinates for Bezier curves. Each call to - * bezierVertex() defines the position of two control points and - * one anchor point of a Bezier curve, adding a new segment to a - * line or shape. For WebGL mode bezierVertex() can be used in 2D - * as well as 3D mode. 2D mode expects 6 parameters, while 3D mode - * expects 9 parameters (including z coordinates). - * - * The first time bezierVertex() is used within a beginShape() - * call, it must be prefaced with a call to vertex() to set the first anchor - * point. This function must be used between beginShape() and endShape() - * and only when there is no MODE or POINTS parameter specified to - * beginShape(). - * - * @method bezierVertex - * @param {Number} x2 x-coordinate for the first control point - * @param {Number} y2 y-coordinate for the first control point - * @param {Number} x3 x-coordinate for the second control point - * @param {Number} y3 y-coordinate for the second control point - * @param {Number} x4 x-coordinate for the anchor point - * @param {Number} y4 y-coordinate for the anchor point - * @chainable - * - * @example - *
                - * - * noFill(); - * beginShape(); - * vertex(30, 20); - * bezierVertex(80, 0, 80, 75, 30, 75); - * endShape(); - * - *
                - * - *
                - * - * beginShape(); - * vertex(30, 20); - * bezierVertex(80, 0, 80, 75, 30, 75); - * bezierVertex(50, 80, 60, 25, 30, 20); - * endShape(); - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * } - * function draw() { - * orbitControl(); - * background(50); - * strokeWeight(4); - * stroke(255); - * point(-25, 30); - * point(25, 30); - * point(25, -30); - * point(-25, -30); - * - * strokeWeight(1); - * noFill(); - * - * beginShape(); - * vertex(-25, 30); - * bezierVertex(25, 30, 25, -30, -25, -30); - * endShape(); - * - * beginShape(); - * vertex(-25, 30, 20); - * bezierVertex(25, 30, 20, 25, -30, 20, -25, -30, 20); - * endShape(); - * } - * - *
                - * - * @alt - * crescent-shaped line in middle of canvas. Points facing left. - * white crescent shape in middle of canvas. Points facing left. - * crescent shape in middle of canvas with another crescent shape on positive z-axis. - */ - /** - * @method bezierVertex - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate for the first control point (for WebGL mode) - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the second control point (for WebGL mode) - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 z-coordinate for the anchor point (for WebGL mode) - * @chainable - */ - _main.default.prototype.bezierVertex = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('bezierVertex', args); - if (this._renderer.isP3D) { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).bezierVertex.apply(_this$_renderer2, args); - } else { - if (vertices.length === 0) { - _main.default._friendlyError('vertex() must be used once before calling bezierVertex()', 'bezierVertex'); - } else { - isBezier = true; - var vert = [ - ]; - for (var i = 0; i < args.length; i++) { - vert[i] = args[i]; - } - vert.isVert = false; - if (isContour) { - contourVertices.push(vert); - } else { - vertices.push(vert); - } - } - } - return this; - }; - /** - * Specifies vertex coordinates for curves. This function may only - * be used between beginShape() and endShape() and only when there - * is no MODE parameter specified to beginShape(). - * For WebGL mode curveVertex() can be used in 2D as well as 3D mode. - * 2D mode expects 2 parameters, while 3D mode expects 3 parameters. - * - * The first and last points in a series of curveVertex() lines will be used to - * guide the beginning and end of the curve. A minimum of four - * points is required to draw a tiny curve between the second and - * third points. Adding a fifth point with curveVertex() will draw - * the curve between the second, third, and fourth points. The - * curveVertex() function is an implementation of Catmull-Rom - * splines. - * - * @method curveVertex - * @param {Number} x x-coordinate of the vertex - * @param {Number} y y-coordinate of the vertex - * @chainable - * @example - *
                - * - * strokeWeight(5); - * point(84, 91); - * point(68, 19); - * point(21, 17); - * point(32, 91); - * strokeWeight(1); - * - * noFill(); - * beginShape(); - * curveVertex(84, 91); - * curveVertex(84, 91); - * curveVertex(68, 19); - * curveVertex(21, 17); - * curveVertex(32, 91); - * curveVertex(32, 91); - * endShape(); - * - *
                - * - * @alt - * Upside-down u-shape line, mid canvas. left point extends beyond canvas view. - */ - /** - * @method curveVertex - * @param {Number} x - * @param {Number} y - * @param {Number} [z] z-coordinate of the vertex (for WebGL mode) - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * } - * function draw() { - * orbitControl(); - * background(50); - * strokeWeight(4); - * stroke(255); - * - * point(-25, 25); - * point(-25, 25); - * point(-25, -25); - * point(25, -25); - * point(25, 25); - * point(25, 25); - * - * strokeWeight(1); - * noFill(); - * - * beginShape(); - * curveVertex(-25, 25); - * curveVertex(-25, 25); - * curveVertex(-25, -25); - * curveVertex(25, -25); - * curveVertex(25, 25); - * curveVertex(25, 25); - * endShape(); - * - * beginShape(); - * curveVertex(-25, 25, 20); - * curveVertex(-25, 25, 20); - * curveVertex(-25, -25, 20); - * curveVertex(25, -25, 20); - * curveVertex(25, 25, 20); - * curveVertex(25, 25, 20); - * endShape(); - * } - * - *
                - * - * @alt - * Upside-down u-shape line, mid canvas with the same shape in positive z-axis. - */ - _main.default.prototype.curveVertex = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('curveVertex', args); - if (this._renderer.isP3D) { - var _this$_renderer3; - (_this$_renderer3 = this._renderer).curveVertex.apply(_this$_renderer3, args); - } else { - isCurve = true; - this.vertex(args[0], args[1]); - } - return this; - }; - /** - * Use the beginContour() and endContour() functions to create negative - * shapes within shapes such as the center of the letter 'O'. beginContour() - * begins recording vertices for the shape and endContour() stops recording. - * The vertices that define a negative shape must "wind" in the opposite - * direction from the exterior shape. First draw vertices for the exterior - * clockwise order, then for internal shapes, draw vertices - * shape in counter-clockwise. - * - * These functions can only be used within a beginShape()/endShape() pair and - * transformations such as translate(), rotate(), and scale() do not work - * within a beginContour()/endContour() pair. It is also not possible to use - * other shapes, such as ellipse() or rect() within. - * - * @method endContour - * @chainable - * @example - *
                - * - * translate(50, 50); - * stroke(255, 0, 0); - * beginShape(); - * // Exterior part of shape, clockwise winding - * vertex(-40, -40); - * vertex(40, -40); - * vertex(40, 40); - * vertex(-40, 40); - * // Interior part of shape, counter-clockwise winding - * beginContour(); - * vertex(-20, -20); - * vertex(-20, 20); - * vertex(20, 20); - * vertex(20, -20); - * endContour(); - * endShape(CLOSE); - * - *
                - * - * @alt - * white rect and smaller grey rect with red outlines in center of canvas. - */ - _main.default.prototype.endContour = function () { - if (this._renderer.isP3D) { - return this; - } - var vert = contourVertices[0].slice(); // copy all data - vert.isVert = contourVertices[0].isVert; - vert.moveTo = false; - contourVertices.push(vert); - // prevent stray lines with multiple contours - if (isFirstContour) { - vertices.push(vertices[0]); - isFirstContour = false; - } - for (var i = 0; i < contourVertices.length; i++) { - vertices.push(contourVertices[i]); - } - return this; - }; - /** - * The endShape() function is the companion to beginShape() and may only be - * called after beginShape(). When endShape() is called, all of the image - * data defined since the previous call to beginShape() is written into the image - * buffer. The constant CLOSE is the value for the `mode` parameter to close - * the shape (to connect the beginning and the end). - * When using instancing with endShape() the instancing will not apply to the strokes. - * When the count parameter is used with a value greater than 1, it enables instancing for shapes built when in WEBGL mode. Instancing - * is a feature that allows the GPU to efficiently draw multiples of the same shape. It's often used for particle effects or other - * times when you need a lot of repetition. In order to take advantage of instancing, you will also need to write your own custom - * shader using the gl_InstanceID keyword. You can read more about instancing - * here or by working from the example on this - * page. - * - * @method endShape - * @param {Constant} [mode] use CLOSE to close the shape - * @param {Integer} [count] number of times you want to draw/instance the shape (for WebGL mode). - * @chainable - * @example - *
                - * - * noFill(); - * - * beginShape(); - * vertex(20, 20); - * vertex(45, 20); - * vertex(45, 80); - * endShape(CLOSE); - * - * beginShape(); - * vertex(50, 20); - * vertex(75, 20); - * vertex(75, 80); - * endShape(); - * - *
                - * - * @example - *
                - * - * let fx; - * let vs = `#version 300 es - * - * precision mediump float; - * - * in vec3 aPosition; - * flat out int instanceID; - * - * uniform mat4 uModelViewMatrix; - * uniform mat4 uProjectionMatrix; - * - * void main() { - * - * // copy the instance ID to the fragment shader - * instanceID = gl_InstanceID; - * vec4 positionVec4 = vec4(aPosition, 1.0); - * - * // gl_InstanceID represents a numeric value for each instance - * // using gl_InstanceID allows us to move each instance separately - * // here we move each instance horizontally by id * 40 - * float xOffset = float(gl_InstanceID) * 40.0; - * - * // apply the offset to the final position - * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4 - - * vec4(xOffset, 0.0, 0.0, 0.0); - * } - * `; - * let fs = `#version 300 es - * - * precision mediump float; - * - * out vec4 outColor; - * flat in int instanceID; - * uniform float numInstances; - * - * void main() { - * vec4 red = vec4(1.0, 0.0, 0.0, 1.0); - * vec4 blue = vec4(0.0, 0.0, 1.0, 1.0); - * - * // Normalize the instance id - * float normId = float(instanceID) / numInstances; - * - * // Mix between two colors using the normalized instance id - * outColor = mix(red, blue, normId); - * } - * `; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * fx = createShader(vs, fs); - * } - * - * function draw() { - * background(220); - * - * // strokes aren't instanced, and are rather used for debug purposes - * shader(fx); - * fx.setUniform('numInstances', 4); - * - * // this doesn't have to do with instancing, this is just for centering the squares - * translate(25, -10); - * - * // here we draw the squares we want to instance - * beginShape(); - * vertex(0, 0); - * vertex(0, 20); - * vertex(20, 20); - * vertex(20, 0); - * vertex(0, 0); - * endShape(CLOSE, 4); - * - * resetShader(); - * } - * - *
                - * - * @alt - * Triangle line shape with smallest interior angle on bottom and upside-down L. - */ - _main.default.prototype.endShape = function (mode) { - var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - _main.default._validateParameters('endShape', arguments); - if (count < 1) { - console.log('🌸 p5.js says: You can not have less than one instance'); - count = 1; - } - if (this._renderer.isP3D) { - this._renderer.endShape(mode, isCurve, isBezier, isQuadratic, isContour, shapeKind, count); - } else { - if (count !== 1) { - console.log('🌸 p5.js says: Instancing is only supported in WebGL2 mode'); - } - if (vertices.length === 0) { - return this; - } - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } - var closeShape = mode === constants.CLOSE; - // if the shape is closed, the first element is also the last element - if (closeShape && !isContour) { - vertices.push(vertices[0]); - } - this._renderer.endShape(mode, vertices, isCurve, isBezier, isQuadratic, isContour, shapeKind); - // Reset some settings - isCurve = false; - isBezier = false; - isQuadratic = false; - isContour = false; - isFirstContour = true; - // If the shape is closed, the first element was added as last element. - // We must remove it again to prevent the list of vertices from growing - // over successive calls to endShape(CLOSE) - if (closeShape) { - vertices.pop(); - } - } - return this; - }; - /** - * Specifies vertex coordinates for quadratic Bezier curves. Each call to - * quadraticVertex() defines the position of one control points and one - * anchor point of a Bezier curve, adding a new segment to a line or shape. - * The first time quadraticVertex() is used within a beginShape() call, it - * must be prefaced with a call to vertex() to set the first anchor point. - * For WebGL mode quadraticVertex() can be used in 2D as well as 3D mode. - * 2D mode expects 4 parameters, while 3D mode expects 6 parameters - * (including z coordinates). - * - * This function must be used between beginShape() and endShape() - * and only when there is no MODE or POINTS parameter specified to - * beginShape(). - * - * @method quadraticVertex - * @param {Number} cx x-coordinate for the control point - * @param {Number} cy y-coordinate for the control point - * @param {Number} x3 x-coordinate for the anchor point - * @param {Number} y3 y-coordinate for the anchor point - * @chainable - * - * @example - *
                - * - * strokeWeight(5); - * point(20, 20); - * point(80, 20); - * point(50, 50); - * - * noFill(); - * strokeWeight(1); - * beginShape(); - * vertex(20, 20); - * quadraticVertex(80, 20, 50, 50); - * endShape(); - * - *
                - * - *
                - * - * strokeWeight(5); - * point(20, 20); - * point(80, 20); - * point(50, 50); - * - * point(20, 80); - * point(80, 80); - * point(80, 60); - * - * noFill(); - * strokeWeight(1); - * beginShape(); - * vertex(20, 20); - * quadraticVertex(80, 20, 50, 50); - * quadraticVertex(20, 80, 80, 80); - * vertex(80, 60); - * endShape(); - * - *
                - * - * @alt - * arched-shaped black line with 4 pixel thick stroke weight. - * backwards s-shaped black line with 4 pixel thick stroke weight. - */ - /** - * @method quadraticVertex - * @param {Number} cx - * @param {Number} cy - * @param {Number} cz z-coordinate for the control point (for WebGL mode) - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the anchor point (for WebGL mode) - * @chainable - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * } - * function draw() { - * orbitControl(); - * background(50); - * strokeWeight(4); - * stroke(255); - * - * point(-35, -35); - * point(35, -35); - * point(0, 0); - * point(-35, 35); - * point(35, 35); - * point(35, 10); - * - * strokeWeight(1); - * noFill(); - * - * beginShape(); - * vertex(-35, -35); - * quadraticVertex(35, -35, 0, 0); - * quadraticVertex(-35, 35, 35, 35); - * vertex(35, 10); - * endShape(); - * - * beginShape(); - * vertex(-35, -35, 20); - * quadraticVertex(35, -35, 20, 0, 0, 20); - * quadraticVertex(-35, 35, 20, 35, 35, 20); - * vertex(35, 10, 20); - * endShape(); - * } - * - *
                - * - * @alt - * backwards s-shaped black line with the same s-shaped line in positive z-axis. - */ - _main.default.prototype.quadraticVertex = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('quadraticVertex', args); - if (this._renderer.isP3D) { - var _this$_renderer4; - (_this$_renderer4 = this._renderer).quadraticVertex.apply(_this$_renderer4, args); - } else { - //if we're drawing a contour, put the points into an - // array for inside drawing - if (this._contourInited) { - var pt = { - }; - pt.x = args[0]; - pt.y = args[1]; - pt.x3 = args[2]; - pt.y3 = args[3]; - pt.type = constants.QUADRATIC; - this._contourVertices.push(pt); - return this; - } - if (vertices.length > 0) { - isQuadratic = true; - var vert = [ - ]; - for (var i = 0; i < args.length; i++) { - vert[i] = args[i]; - } - vert.isVert = false; - if (isContour) { - contourVertices.push(vert); - } else { - vertices.push(vert); - } - } else { - _main.default._friendlyError('vertex() must be used once before calling quadraticVertex()', 'quadraticVertex'); - } - } - return this; - }; - /** - * All shapes are constructed by connecting a series of vertices. vertex() - * is used to specify the vertex coordinates for points, lines, triangles, - * quads, and polygons. It is used exclusively within the beginShape() and - * endShape() functions. - * - * @method vertex - * @param {Number} x x-coordinate of the vertex - * @param {Number} y y-coordinate of the vertex - * @chainable - * @example - *
                - * - * strokeWeight(3); - * beginShape(POINTS); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                - * - *
                - * - * createCanvas(100, 100, WEBGL); - * background(240, 240, 240); - * fill(237, 34, 93); - * noStroke(); - * beginShape(); - * vertex(0, 35); - * vertex(35, 0); - * vertex(0, -35); - * vertex(-35, 0); - * endShape(); - * - *
                - * - *
                - * - * createCanvas(100, 100, WEBGL); - * background(240, 240, 240); - * fill(237, 34, 93); - * noStroke(); - * beginShape(); - * vertex(-10, 10); - * vertex(0, 35); - * vertex(10, 10); - * vertex(35, 0); - * vertex(10, -8); - * vertex(0, -35); - * vertex(-10, -8); - * vertex(-35, 0); - * endShape(); - * - *
                - * - *
                - * - * strokeWeight(3); - * stroke(237, 34, 93); - * beginShape(LINES); - * vertex(10, 35); - * vertex(90, 35); - * vertex(10, 65); - * vertex(90, 65); - * vertex(35, 10); - * vertex(35, 90); - * vertex(65, 10); - * vertex(65, 90); - * endShape(); - * - *
                - * - *
                - * - * // Click to change the number of sides. - * // In WebGL mode, custom shapes will only - * // display hollow fill sections when - * // all calls to vertex() use the same z-value. - * - * let sides = 3; - * let angle, px, py; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * fill(237, 34, 93); - * strokeWeight(3); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateZ(frameCount * 0.01); - * ngon(sides, 0, 0, 80); - * } - * - * function mouseClicked() { - * if (sides > 6) { - * sides = 3; - * } else { - * sides++; - * } - * } - * - * function ngon(n, x, y, d) { - * beginShape(TESS); - * for (let i = 0; i < n + 1; i++) { - * angle = TWO_PI / n * i; - * px = x + sin(angle) * d / 2; - * py = y - cos(angle) * d / 2; - * vertex(px, py, 0); - * } - * for (let i = 0; i < n + 1; i++) { - * angle = TWO_PI / n * i; - * px = x + sin(angle) * d / 4; - * py = y - cos(angle) * d / 4; - * vertex(px, py, 0); - * } - * endShape(); - * } - * - *
                - * @alt - * 4 black points in a square shape in middle-right of canvas. - * 4 points making a diamond shape. - * 8 points making a star. - * 8 points making 4 lines. - * A rotating 3D shape with a hollow section in the middle. - */ - /** - * @method vertex - * @param {Number} x - * @param {Number} y - * @param {Number} [z] z-coordinate of the vertex. - * Defaults to 0 if not specified. - * @chainable - */ - /** - * @method vertex - * @param {Number} x - * @param {Number} y - * @param {Number} [z] - * @param {Number} [u] the vertex's texture u-coordinate - * @param {Number} [v] the vertex's texture v-coordinate - * @chainable - */ - _main.default.prototype.vertex = function (x, y, moveTo, u, v) { - if (this._renderer.isP3D) { - var _this$_renderer5; - (_this$_renderer5 = this._renderer).vertex.apply(_this$_renderer5, arguments); - } else { - var vert = [ - ]; - vert.isVert = true; - vert[0] = x; - vert[1] = y; - vert[2] = 0; - vert[3] = 0; - vert[4] = 0; - vert[5] = this._renderer._getFill(); - vert[6] = this._renderer._getStroke(); - if (moveTo) { - vert.moveTo = moveTo; - } - if (isContour) { - if (contourVertices.length === 0) { - vert.moveTo = true; - } - contourVertices.push(vert); - } else { - vertices.push(vert); - } - } - return this; - }; - /** - * Sets the 3d vertex normal to use for subsequent vertices drawn with - * vertex(). A normal is a vector that is generally - * nearly perpendicular to a shape's surface which controls how much light will - * be reflected from that part of the surface. - * - * @method normal - * @param {Vector} vector A p5.Vector representing the vertex normal. - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * } - * - * function draw() { - * background(255); - * rotateY(frameCount / 100); - * normalMaterial(); - * beginShape(TRIANGLE_STRIP); - * normal(-0.4, 0.4, 0.8); - * vertex(-30, 30, 0); - * - * normal(0, 0, 1); - * vertex(-30, -30, 30); - * vertex(30, 30, 30); - * - * normal(0.4, -0.4, 0.8); - * vertex(30, -30, 0); - * endShape(); - * } - * - *
                - */ - /** - * @method normal - * @param {Number} x The x component of the vertex normal. - * @param {Number} y The y component of the vertex normal. - * @param {Number} z The z component of the vertex normal. - * @chainable - */ - _main.default.prototype.normal = function (x, y, z) { - var _this$_renderer6; - this._assert3d('normal'); - _main.default._validateParameters('normal', arguments); - (_this$_renderer6 = this._renderer).normal.apply(_this$_renderer6, arguments); - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../constants': 286, - '../main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 309: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } // requestAnim shim layer by Paul Irish - // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - // http://my.opera.com/emoller/blog/2011/12/20/ - // requestanimationframe-for-smart-er-animating - // requestAnimationFrame polyfill by Erik Möller - // fixes from Paul Irish and Tino Zijdel - - window.requestAnimationFrame = function () { - return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) { - // should '60' here be framerate? - window.setTimeout(callback, 1000 / 60); - }; - }(); - /** - * shim for Uint8ClampedArray.slice - * (allows arrayCopy to work with pixels[]) - * with thanks to http://halfpapstudios.com/blog/tag/html5-canvas/ - * Enumerable set to false to protect for...in from - * Uint8ClampedArray.prototype pollution. - */ - (function () { - if (typeof Uint8ClampedArray !== 'undefined' && !Uint8ClampedArray.prototype.slice) { - Object.defineProperty(Uint8ClampedArray.prototype, 'slice', { - value: Array.prototype.slice, - writable: true, - configurable: true, - enumerable: false - }); - } - }) (); - /** - * this is implementation of Object.assign() which is unavailable in - * IE11 and (non-Chrome) Android browsers. - * The assign() method is used to copy the values of all enumerable - * own properties from one or more source objects to a target object. - * It will return the target object. - * Modified from https://github.com/ljharb/object.assign - */ - (function () { - if (!Object.assign) { - var keys = Object.keys; - var defineProperty = Object.defineProperty; - var canBeObject = function canBeObject(obj) { - return typeof obj !== 'undefined' && obj !== null; - }; - var hasSymbols = typeof Symbol === 'function' && _typeof(Symbol()) === 'symbol'; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - var isEnumerableOn = function isEnumerableOn(obj) { - return function isEnumerable(prop) { - return propIsEnumerable.call(obj, prop); - }; - }; - // per ES6 spec, this function has to have a length of 2 - var assignShim = function assign(target, source1) { - if (!canBeObject(target)) { - throw new TypeError('target must be an object'); - } - var objTarget = Object(target); - var s, - source, - i, - props; - for (s = 1; s < arguments.length; ++s) { - source = Object(arguments[s]); - props = keys(source); - if (hasSymbols && Object.getOwnPropertySymbols) { - var _props; - (_props = props).push.apply(_props, _toConsumableArray(Object.getOwnPropertySymbols(source).filter(isEnumerableOn(source)))); - } - for (i = 0; i < props.length; ++i) { - objTarget[props[i]] = source[props[i]]; - } - } - return objTarget; - }; - defineProperty(Object, 'assign', { - value: assignShim, - configurable: true, - enumerable: false, - writable: true - }); - } - }) (); - }, - { - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.assign': 194, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-clamped-array': 253, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 310: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.assign'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Structure - * @submodule Structure - * @for p5 - * @requires core - */ - /** - * Stops p5.js from continuously executing the code within draw(). - * If loop() is called, the code in draw() - * begins to run continuously again. If using noLoop() - * in setup(), it should be the last line inside the block. - * - * When noLoop() is used, it's not possible to manipulate - * or access the screen inside event handling functions such as - * mousePressed() or - * keyPressed(). Instead, use those functions to - * call redraw() or loop(), - * which will run draw(), which can update the screen - * properly. This means that when noLoop() has been - * called, no drawing can happen, and functions like saveFrames() - * or loadPixels() may not be used. - * - * Note that if the sketch is resized, redraw() will - * be called to update the sketch, even after noLoop() - * has been specified. Otherwise, the sketch would enter an odd state until - * loop() was called. - * - * Use isLooping() to check the current state of loop(). - * - * @method noLoop - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * noLoop(); - * } - - * function draw() { - * line(10, 10, 90, 90); - * } - * - *
                - * - *
                - * - * let x = 0; - * function setup() { - * createCanvas(100, 100); - * } - * - * function draw() { - * background(204); - * x = x + 0.1; - * if (x > width) { - * x = 0; - * } - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * noLoop(); - * } - * - * function mouseReleased() { - * loop(); - * } - * - *
                - * - * @alt - * 113 pixel long line extending from top-left to bottom right of canvas. - * horizontal line moves slowly from left. Loops but stops on mouse press. - */ - - _main.default.prototype.noLoop = function () { - this._loop = false; - }; - /** - * By default, p5.js loops through draw() continuously, executing the code within - * it. However, the draw() loop may be stopped by calling - * noLoop(). In that case, the draw() - * loop can be resumed with loop(). - * - * Avoid calling loop() from inside setup(). - * - * Use isLooping() to check the current state of loop(). - * - * @method loop - * @example - *
                - * - * let x = 0; - * function setup() { - * createCanvas(100, 100); - * noLoop(); - * } - * - * function draw() { - * background(204); - * x = x + 0.1; - * if (x > width) { - * x = 0; - * } - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * loop(); - * } - * - * function mouseReleased() { - * noLoop(); - * } - * - *
                - * - * @alt - * horizontal line moves slowly from left. Loops but stops on mouse press. - */ - _main.default.prototype.loop = function () { - if (!this._loop) { - this._loop = true; - if (this._setupDone) { - this._draw(); - } - } - }; - /** - * By default, p5.js loops through draw() continuously, - * executing the code within it. If the sketch is stopped with - * noLoop() or resumed with loop(), - * isLooping() returns the current state for use within custom event handlers. - * - * @method isLooping - * @returns {boolean} - * @example - *
                - * - * let checkbox, button, colBG, colFill; - * - * function setup() { - * createCanvas(100, 100); - * - * button = createButton('Colorize if loop()'); - * button.position(0, 120); - * button.mousePressed(changeBG); - * - * checkbox = createCheckbox('loop()', true); - * checkbox.changed(checkLoop); - * - * colBG = color(0); - * colFill = color(255); - * } - * - * function changeBG() { - * if (isLooping()) { - * colBG = color(random(255), random(255), random(255)); - * colFill = color(random(255), random(255), random(255)); - * } - * } - * - * function checkLoop() { - * if (this.checked()) { - * loop(); - * } else { - * noLoop(); - * } - * } - * - * function draw() { - * background(colBG); - * fill(colFill); - * ellipse(frameCount % width, height / 2, 50); - * } - * - *
                - * - * @alt - * Ellipse moves slowly from left. Checkbox toggles loop()/noLoop(). - * Button colorizes sketch if isLooping(). - * - */ - _main.default.prototype.isLooping = function () { - return this._loop; - }; - /** - * The push() function saves the current drawing style - * settings and transformations, while pop() restores these - * settings. Note that these functions are always used together. They allow you to - * change the style and transformation settings and later return to what you had. - * When a new state is started with push(), it builds on - * the current style and transform information. The push() - * and pop() functions can be embedded to provide more - * control. (See the second example for a demonstration.) - * - * push() stores information related to the current transformation state - * and style settings controlled by the following functions: - * fill(), - * noFill(), - * noStroke(), - * stroke(), - * tint(), - * noTint(), - * strokeWeight(), - * strokeCap(), - * strokeJoin(), - * imageMode(), - * rectMode(), - * ellipseMode(), - * colorMode(), - * textAlign(), - * textFont(), - * textSize(), - * textLeading(), - * applyMatrix(), - * resetMatrix(), - * rotate(), - * scale(), - * shearX(), - * shearY(), - * translate(), - * noiseSeed(). - * - * In WEBGL mode additional style settings are stored. These are controlled by the - * following functions: setCamera(), - * ambientLight(), - * directionalLight(), - * pointLight(), texture(), - * specularMaterial(), - * shininess(), - * normalMaterial() - * and shader(). - * - * @method push - * @example - *
                - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * strokeWeight(10); - * fill(204, 153, 0); - * translate(50, 0); - * ellipse(0, 50, 33, 33); // Middle circle - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                - * - *
                - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * strokeWeight(10); - * fill(204, 153, 0); - * ellipse(33, 50, 33, 33); // Left-middle circle - * - * push(); // Start another new drawing state - * stroke(0, 102, 153); - * ellipse(66, 50, 33, 33); // Right-middle circle - * pop(); // Restore previous state - * - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                - * - * @alt - * Gold ellipse + thick black outline @center 2 white ellipses on left and right. - * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. - */ - _main.default.prototype.push = function () { - this._styles.push({ - props: { - _colorMode: this._colorMode - }, - renderer: this._renderer.push() - }); - }; - /** - * The push() function saves the current drawing style - * settings and transformations, while pop() restores - * these settings. Note that these functions are always used together. They allow - * you to change the style and transformation settings and later return to what - * you had. When a new state is started with push(), it - * builds on the current style and transform information. The push() - * and pop() functions can be embedded to provide more - * control. (See the second example for a demonstration.) - * - * push() stores information related to the current transformation state - * and style settings controlled by the following functions: - * fill(), - * noFill(), - * noStroke(), - * stroke(), - * tint(), - * noTint(), - * strokeWeight(), - * strokeCap(), - * strokeJoin(), - * imageMode(), - * rectMode(), - * ellipseMode(), - * colorMode(), - * textAlign(), - * textFont(), - * textSize(), - * textLeading(), - * applyMatrix(), - * resetMatrix(), - * rotate(), - * scale(), - * shearX(), - * shearY(), - * translate(), - * noiseSeed(). - * - * In WEBGL mode additional style settings are stored. These are controlled by - * the following functions: - * setCamera(), - * ambientLight(), - * directionalLight(), - * pointLight(), - * texture(), - * specularMaterial(), - * shininess(), - * normalMaterial() and - * shader(). - * - * @method pop - * @example - *
                - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * translate(50, 0); - * strokeWeight(10); - * fill(204, 153, 0); - * ellipse(0, 50, 33, 33); // Middle circle - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                - * - *
                - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * strokeWeight(10); - * fill(204, 153, 0); - * ellipse(33, 50, 33, 33); // Left-middle circle - * - * push(); // Start another new drawing state - * stroke(0, 102, 153); - * ellipse(66, 50, 33, 33); // Right-middle circle - * pop(); // Restore previous state - * - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                - * - * @alt - * Gold ellipse + thick black outline @center 2 white ellipses on left and right. - * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. - */ - _main.default.prototype.pop = function () { - var style = this._styles.pop(); - if (style) { - this._renderer.pop(style.renderer); - Object.assign(this, style.props); - } else { - console.warn('pop() was called without matching push()'); - } - }; - /** - * Executes the code within draw() one time. This - * function allows the program to update the display window only when necessary, - * for example when an event registered by mousePressed() - * or keyPressed() occurs. - * - * In structuring a program, it only makes sense to call redraw() - * within events such as mousePressed(). This - * is because redraw() does not run - * draw() immediately (it only sets a flag that indicates - * an update is needed). - * - * The redraw() function does not work properly when - * called inside draw().To enable/disable animations, - * use loop() and noLoop(). - * - * In addition you can set the number of redraws per method call. Just - * add an integer as single parameter for the number of redraws. - * - * @method redraw - * @param {Integer} [n] Redraw for n-times. The default value is 1. - * @example - *
                - * let x = 0; - * - * function setup() { - * createCanvas(100, 100); - * noLoop(); - * } - * - * function draw() { - * background(204); - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * x += 1; - * redraw(); - * } - * - *
                - * - *
                - * - * let x = 0; - * - * function setup() { - * createCanvas(100, 100); - * noLoop(); - * } - * - * function draw() { - * background(204); - * x += 1; - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * redraw(5); - * } - * - *
                - * - * @alt - * black line on far left of canvas - * black line on far left of canvas - */ - _main.default.prototype.redraw = function (n) { - if (this._inUserDraw || !this._setupDone) { - return; - } - var numberOfRedraws = parseInt(n); - if (isNaN(numberOfRedraws) || numberOfRedraws < 1) { - numberOfRedraws = 1; - } - var context = this._isGlobal ? window : this; - if (typeof context.draw === 'function') { - if (typeof context.setup === 'undefined') { - context.scale(context._pixelDensity, context._pixelDensity); - } - for (var idxRedraw = 0; idxRedraw < numberOfRedraws; idxRedraw++) { - context.resetMatrix(); - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._updateAccsOutput(); - } - if (context._renderer.isP3D) { - context._renderer._update(); - } - context._setProperty('frameCount', context.frameCount + 1); - this.callRegisteredHooksFor('pre'); - this._inUserDraw = true; - try { - context.draw(); - } finally { - this._inUserDraw = false; - } - this.callRegisteredHooksFor('post'); - } - } - }; - /** - * The `p5()` constructor enables you to activate "instance mode" instead of normal - * "global mode". This is an advanced topic. A short description and example is - * included below. Please see - * - * Dan Shiffman's Coding Train video tutorial or this - * tutorial page - * for more info. - * - * By default, all p5.js functions are in the global namespace (i.e. bound to the window - * object), meaning you can call them simply `ellipse()`, `fill()`, etc. However, this - * might be inconvenient if you are mixing with other JS libraries (synchronously or - * asynchronously) or writing long programs of your own. p5.js currently supports a - * way around this problem called "instance mode". In instance mode, all p5 functions - * are bound up in a single variable instead of polluting your global namespace. - * - * Optionally, you can specify a default container for the canvas and any other elements - * to append to with a second argument. You can give the ID of an element in your html, - * or an html node itself. - * - * Note that creating instances like this also allows you to have more than one p5 sketch on - * a single web page, as they will each be wrapped up with their own set up variables. Of - * course, you could also use iframes to have multiple sketches in global mode. - * - * @method p5 - * @param {Object} sketch a function containing a p5.js sketch - * @param {String|Object} node ID or pointer to HTML DOM node to contain sketch in - * @example - *
                - * const s = p => { - * let x = 100; - * let y = 100; - * - * p.setup = function() { - * p.createCanvas(700, 410); - * }; - * - * p.draw = function() { - * p.background(0); - * p.fill(255); - * p.rect(x, y, 50, 50); - * }; - * }; - * - * new p5(s); // invoke p5 - *
                - * - * @alt - * white rectangle on black background - */ - var _default = _main.default; - exports.default = _default; - }, - { - './main': 298, - 'core-js/modules/es.object.assign': 194 - } - ], - 311: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('./main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Transform - * @submodule Transform - * @for p5 - * @requires core - * @requires constants - */ - /** - * Multiplies the current matrix by the one specified through the parameters. - * This is a powerful operation that can perform the equivalent of translate, - * scale, shear and rotate all at once. You can learn more about transformation - * matrices on - * Wikipedia. - * - * The naming of the arguments here follows the naming of the - * WHATWG specification and corresponds to a - * transformation matrix of the - * form: - * - * > The transformation matrix used when applyMatrix is called - * - * The transformation matrix used when applyMatrix is called with 4x4 matrix - * - * @method applyMatrix - * @param {Array} arr an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values) - * @chainable - * @example - *
                - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * background(200); - * // Equivalent to translate(x, y); - * applyMatrix(1, 0, 0, 1, 40 + step, 50); - * rect(0, 0, 50, 50); - * } - * - *
                - * - *
                - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * background(200); - * translate(50, 50); - * // Equivalent to scale(x, y); - * applyMatrix(1 / step, 0, 0, 1 / step, 0, 0); - * rect(0, 0, 50, 50); - * } - * - *
                - * - *
                - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * let angle = map(step, 0, 20, 0, TWO_PI); - * let cos_a = cos(angle); - * let sin_a = sin(angle); - * background(200); - * translate(50, 50); - * // Equivalent to rotate(angle); - * applyMatrix(cos_a, sin_a, -sin_a, cos_a, 0, 0); - * rect(0, 0, 50, 50); - * } - * - *
                - * - *
                - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * let angle = map(step, 0, 20, -PI / 4, PI / 4); - * background(200); - * translate(50, 50); - * // equivalent to shearX(angle); - * let shear_factor = 1 / tan(PI / 2 - angle); - * applyMatrix(1, 0, shear_factor, 1, 0, 0); - * rect(0, 0, 50, 50); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noFill(); - * } - * - * function draw() { - * background(200); - * rotateY(PI / 6); - * stroke(153); - * box(35); - * let rad = millis() / 1000; - * // Set rotation angles - * let ct = cos(rad); - * let st = sin(rad); - * // Matrix for rotation around the Y axis - * applyMatrix( - * ct, 0.0, st, 0.0, - * 0.0, 1.0, 0.0, 0.0, - * -st, 0.0, ct, 0.0, - * 0.0, 0.0, 0.0, 1.0 - * ); - * stroke(255); - * box(50); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * let testMatrix = [1, 0, 0, 1, 0, 0]; - * applyMatrix(testMatrix); - * rect(0, 0, 50, 50); - * } - * - *
                - * - * @alt - * A rectangle translating to the right - * A rectangle shrinking to the center - * A rectangle rotating clockwise about the center - * A rectangle shearing - * A rectangle in the upper left corner - */ - /** - * @method applyMatrix - * @param {Number} a numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} b numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} c numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} d numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} e numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} f numbers which define the 2×3 or 4×4 matrix to be multiplied - * @chainable - */ - /** - * @method applyMatrix - * @param {Number} a - * @param {Number} b - * @param {Number} c - * @param {Number} d - * @param {Number} e - * @param {Number} f - * @param {Number} g numbers which define the 4×4 matrix to be multiplied - * @param {Number} h numbers which define the 4×4 matrix to be multiplied - * @param {Number} i numbers which define the 4×4 matrix to be multiplied - * @param {Number} j numbers which define the 4×4 matrix to be multiplied - * @param {Number} k numbers which define the 4×4 matrix to be multiplied - * @param {Number} l numbers which define the 4×4 matrix to be multiplied - * @param {Number} m numbers which define the 4×4 matrix to be multiplied - * @param {Number} n numbers which define the 4×4 matrix to be multiplied - * @param {Number} o numbers which define the 4×4 matrix to be multiplied - * @param {Number} p numbers which define the 4×4 matrix to be multiplied - * @chainable - */ - - _main.default.prototype.applyMatrix = function () { - var isTypedArray = (arguments.length <= 0 ? undefined : arguments[0]) instanceof Object.getPrototypeOf(Uint8Array); - if (Array.isArray(arguments.length <= 0 ? undefined : arguments[0]) || isTypedArray) { - var _this$_renderer; - (_this$_renderer = this._renderer).applyMatrix.apply(_this$_renderer, _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0])); - } else { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).applyMatrix.apply(_this$_renderer2, arguments); - } - return this; - }; - /** - * Replaces the current matrix with the identity matrix. - * - * @method resetMatrix - * @chainable - * @example - *
                - * - * translate(50, 50); - * applyMatrix(0.5, 0.5, -0.5, 0.5, 0, 0); - * rect(0, 0, 20, 20); - * // Note that the translate is also reset. - * resetMatrix(); - * rect(0, 0, 20, 20); - * - *
                - * - * @alt - * A rotated rectangle in the center with another at the top left corner - */ - _main.default.prototype.resetMatrix = function () { - this._renderer.resetMatrix(); - return this; - }; - /** - * Rotates a shape by the amount specified by the angle parameter. This - * function accounts for angleMode, so angles - * can be entered in either RADIANS or DEGREES. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * Transformations apply to everything that happens after and subsequent - * calls to the function accumulate the effect. For example, calling - * rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). - * All transformations are reset when draw() begins again. - * - * Technically, rotate() multiplies the current transformation matrix - * by a rotation matrix. This function can be further controlled by - * push() and pop(). - * - * @method rotate - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @param {p5.Vector|Number[]} [axis] (in 3d) the axis to rotate around - * @chainable - * @example - *
                - * - * translate(width / 2, height / 2); - * rotate(PI / 3.0); - * rect(-26, -26, 52, 52); - * - *
                - * - * @alt - * white 52×52 rect with black outline at center rotated counter 45 degrees - */ - _main.default.prototype.rotate = function (angle, axis) { - _main.default._validateParameters('rotate', arguments); - this._renderer.rotate(this._toRadians(angle), axis); - return this; - }; - /** - * Rotates a shape around X axis by the amount specified in angle parameter. - * The angles can be entered in either RADIANS or DEGREES. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * All transformations are reset when draw() begins again. - * - * @method rotateX - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(255); - * rotateX(millis() / 1000); - * box(); - * } - * - *
                - * - * @alt - * 3d box rotating around the x axis. - */ - _main.default.prototype.rotateX = function (angle) { - this._assert3d('rotateX'); - _main.default._validateParameters('rotateX', arguments); - this._renderer.rotateX(this._toRadians(angle)); - return this; - }; - /** - * Rotates a shape around Y axis by the amount specified in angle parameter. - * The angles can be entered in either RADIANS or DEGREES. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * All transformations are reset when draw() begins again. - * - * @method rotateY - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(255); - * rotateY(millis() / 1000); - * box(); - * } - * - *
                - * - * @alt - * 3d box rotating around the y axis. - */ - _main.default.prototype.rotateY = function (angle) { - this._assert3d('rotateY'); - _main.default._validateParameters('rotateY', arguments); - this._renderer.rotateY(this._toRadians(angle)); - return this; - }; - /** - * Rotates a shape around Z axis by the amount specified in angle parameter. - * The angles can be entered in either RADIANS or DEGREES. - * - * This method works in WEBGL mode only. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * All transformations are reset when draw() begins again. - * - * @method rotateZ - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(255); - * rotateZ(millis() / 1000); - * box(); - * } - * - *
                - * - * @alt - * 3d box rotating around the z axis. - */ - _main.default.prototype.rotateZ = function (angle) { - this._assert3d('rotateZ'); - _main.default._validateParameters('rotateZ', arguments); - this._renderer.rotateZ(this._toRadians(angle)); - return this; - }; - /** - * Increases or decreases the size of a shape by expanding or contracting - * vertices. Objects always scale from their relative origin to the - * coordinate system. Scale values are specified as decimal percentages. - * For example, the function call scale(2.0) increases the dimension of a - * shape by 200%. - * - * Transformations apply to everything that happens after and subsequent - * calls to the function multiply the effect. For example, calling scale(2.0) - * and then scale(1.5) is the same as scale(3.0). If scale() is called - * within draw(), the transformation is reset when the loop begins again. - * - * Using this function with the z parameter is only available in WEBGL mode. - * This function can be further controlled with push() and pop(). - * - * @method scale - * @param {Number|p5.Vector|Number[]} s - * percent to scale the object, or percentage to - * scale the object in the x-axis if multiple arguments - * are given - * @param {Number} [y] percent to scale the object in the y-axis - * @param {Number} [z] percent to scale the object in the z-axis (webgl only) - * @chainable - * @example - *
                - * - * rect(30, 20, 50, 50); - * scale(0.5); - * rect(30, 20, 50, 50); - * - *
                - * - *
                - * - * rect(30, 20, 50, 50); - * scale(0.5, 1.3); - * rect(30, 20, 50, 50); - * - *
                - * - * @alt - * white 52×52 rect with black outline at center rotated counter 45 degrees - * 2 white rects with black outline- 1 50×50 at center. other 25×65 bottom left - */ - /** - * @method scale - * @param {p5.Vector|Number[]} scales per-axis percents to scale the object - * @chainable - */ - _main.default.prototype.scale = function (x, y, z) { - _main.default._validateParameters('scale', arguments); - // Only check for Vector argument type if Vector is available - if (x instanceof _main.default.Vector) { - var v = x; - x = v.x; - y = v.y; - z = v.z; - } else if (x instanceof Array) { - var rg = x; - x = rg[0]; - y = rg[1]; - z = rg[2] || 1; - } - if (isNaN(y)) { - y = z = x; - } else if (isNaN(z)) { - z = 1; - } - this._renderer.scale.call(this._renderer, x, y, z); - return this; - }; - /** - * Shears a shape around the x-axis by the amount specified by the angle - * parameter. Angles should be specified in the current angleMode. - * Objects are always sheared around their relative position to the origin - * and positive numbers shear objects in a clockwise direction. - * - * Transformations apply to everything that happens after and subsequent - * calls to the function accumulates the effect. For example, calling - * shearX(PI/2) and then shearX(PI/2) is the same as shearX(PI). - * If shearX() is called within the draw(), - * the transformation is reset when the loop begins again. - * - * Technically, shearX() multiplies the current - * transformation matrix by a rotation matrix. This function can be further - * controlled by the push() and pop() functions. - * - * @method shearX - * @param {Number} angle angle of shear specified in radians or degrees, - * depending on current angleMode - * @chainable - * @example - *
                - * - * translate(width / 4, height / 4); - * shearX(PI / 4.0); - * rect(0, 0, 30, 30); - * - *
                - * - * @alt - * white irregular quadrilateral with black outline at top middle. - */ - _main.default.prototype.shearX = function (angle) { - _main.default._validateParameters('shearX', arguments); - var rad = this._toRadians(angle); - this._renderer.applyMatrix(1, 0, Math.tan(rad), 1, 0, 0); - return this; - }; - /** - * Shears a shape around the y-axis the amount specified by the angle - * parameter. Angles should be specified in the current angleMode. Objects - * are always sheared around their relative position to the origin and - * positive numbers shear objects in a clockwise direction. - * - * Transformations apply to everything that happens after and subsequent - * calls to the function accumulates the effect. For example, calling - * shearY(PI/2) and then shearY(PI/2) is the same as shearY(PI). If - * shearY() is called within the draw(), the transformation is reset when - * the loop begins again. - * - * Technically, shearY() multiplies the current transformation matrix by a - * rotation matrix. This function can be further controlled by the - * push() and pop() functions. - * - * @method shearY - * @param {Number} angle angle of shear specified in radians or degrees, - * depending on current angleMode - * @chainable - * @example - *
                - * - * translate(width / 4, height / 4); - * shearY(PI / 4.0); - * rect(0, 0, 30, 30); - * - *
                - * - * @alt - * white irregular quadrilateral with black outline at middle bottom. - */ - _main.default.prototype.shearY = function (angle) { - _main.default._validateParameters('shearY', arguments); - var rad = this._toRadians(angle); - this._renderer.applyMatrix(1, Math.tan(rad), 0, 1, 0, 0); - return this; - }; - /** - * Specifies an amount to displace objects within the display window. - * The x parameter specifies left/right translation, the y parameter - * specifies up/down translation. - * - * Transformations are cumulative and apply to everything that happens after - * and subsequent calls to the function accumulates the effect. For example, - * calling translate(50, 0) and then translate(20, 0) is the same as - * translate(70, 0). If translate() is called within draw(), the - * transformation is reset when the loop begins again. This function can be - * further controlled by using push() and pop(). - * - * @method translate - * @param {Number} x left/right translation - * @param {Number} y up/down translation - * @param {Number} [z] forward/backward translation (WEBGL only) - * @chainable - * @example - *
                - * - * translate(30, 20); - * rect(0, 0, 55, 55); - * - *
                - * - *
                - * - * rect(0, 0, 55, 55); // Draw rect at original 0,0 - * translate(30, 20); - * rect(0, 0, 55, 55); // Draw rect at new 0,0 - * translate(14, 14); - * rect(0, 0, 55, 55); // Draw rect at new 0,0 - * - *
                - * - - *
                - * - * function draw() { - * background(200); - * rectMode(CENTER); - * translate(width / 2, height / 2); - * translate(p5.Vector.fromAngle(millis() / 1000, 40)); - * rect(0, 0, 20, 20); - * } - * - *
                - * - * @alt - * white 55×55 rect with black outline at center right. - * 3 white 55×55 rects with black outlines at top-l, center-r and bottom-r. - * a 20×20 white rect moving in a circle around the canvas - */ - /** - * @method translate - * @param {p5.Vector} vector the vector to translate by - * @chainable - */ - _main.default.prototype.translate = function (x, y, z) { - _main.default._validateParameters('translate', arguments); - if (this._renderer.isP3D) { - this._renderer.translate(x, y, z); - } else { - this._renderer.translate(x, y); - } - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - './main': 298, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 312: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.ends-with'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.ends-with'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module Data - * @submodule LocalStorage - * @requires core - * - * This module defines the p5 methods for working with local storage - */ - /** - * - * Stores a value in local storage under the key name. - * Local storage is saved in the browser and persists - * between browsing sessions and page reloads. - * The key can be the name of the variable but doesn't - * have to be. To retrieve stored items - * see getItem. - * - * Sensitive data such as passwords or personal information - * should not be stored in local storage. - * - * @method storeItem - * @for p5 - * @param {String} key - * @param {String|Number|Object|Boolean|p5.Color|p5.Vector} value - * - * @example - *
                - * // Type to change the letter in the - * // center of the canvas. - * // If you reload the page, it will - * // still display the last key you entered - * - * let myText; - * - * function setup() { - * createCanvas(100, 100); - * myText = getItem('myText'); - * if (myText === null) { - * myText = ''; - * } - * describe(`When you type the key name is displayed as black text on white background. - * If you reload the page, the last letter typed is still displaying.`); - * } - * - * function draw() { - * textSize(40); - * background(255); - * text(myText, width / 2, height / 2); - * } - * - * function keyPressed() { - * myText = key; - * storeItem('myText', myText); - * } - *
                - */ - - _main.default.prototype.storeItem = function (key, value) { - if (typeof key !== 'string') { - console.log('The argument that you passed to storeItem() - '.concat(key, ' is not a string.')); - } - if (key.endsWith('p5TypeID')) { - console.log('The argument that you passed to storeItem() - '.concat(key, ' must not end with \'p5TypeID\'.')); - } - if (typeof value === 'undefined') { - console.log('You cannot store undefined variables using storeItem().'); - } - var type = _typeof(value); - switch (type) { - case 'number': - case 'boolean': - value = value.toString(); - break; - case 'object': - if (value instanceof _main.default.Color) { - type = 'p5.Color'; - } else if (value instanceof _main.default.Vector) { - type = 'p5.Vector'; - var coord = [ - value.x, - value.y, - value.z - ]; - value = coord; - } - value = JSON.stringify(value); - break; - case 'string': - default: - break; - } - localStorage.setItem(key, value); - var typeKey = ''.concat(key, 'p5TypeID'); - localStorage.setItem(typeKey, type); - }; - /** - * - * Returns the value of an item that was stored in local storage - * using storeItem() - * - * @method getItem - * @for p5 - * @param {String} key name that you wish to use to store in local storage - * @return {Number|Object|String|Boolean|p5.Color|p5.Vector} Value of stored item - * - * @example - *
                - * // Click the mouse to change - * // the color of the background - * // Once you have changed the color - * // it will stay changed even when you - * // reload the page. - * - * let myColor; - * - * function setup() { - * createCanvas(100, 100); - * myColor = getItem('myColor'); - * } - * - * function draw() { - * if (myColor !== null) { - * background(myColor); - * } - * describe(`If you click, the canvas changes to a random color.· - * If you reload the page, the canvas is still the color it was when the - * page was previously loaded.`); - * } - * - * function mousePressed() { - * myColor = color(random(255), random(255), random(255)); - * storeItem('myColor', myColor); - * } - *
                - */ - _main.default.prototype.getItem = function (key) { - var value = localStorage.getItem(key); - var type = localStorage.getItem(''.concat(key, 'p5TypeID')); - if (typeof type === 'undefined') { - console.log('Unable to determine type of item stored under '.concat(key, 'in local storage. Did you save the item with something other than setItem()?')); - } else if (value !== null) { - switch (type) { - case 'number': - value = parseFloat(value); - break; - case 'boolean': - value = value === 'true'; - break; - case 'object': - value = JSON.parse(value); - break; - case 'p5.Color': - value = JSON.parse(value); - value = this.color.apply(this, _toConsumableArray(value.levels)); - break; - case 'p5.Vector': - value = JSON.parse(value); - value = this.createVector.apply(this, _toConsumableArray(value)); - break; - case 'string': - default: - break; - } - } - return value; - }; - /** - * - * Clears all local storage items set with storeItem() - * for the current domain. - * - * @method clearStorage - * @for p5 - * - * @example - *
                - * - * function setup() { - * let myNum = 10; - * let myBool = false; - * storeItem('myNum', myNum); - * storeItem('myBool', myBool); - * print(getItem('myNum')); // logs 10 to the console - * print(getItem('myBool')); // logs false to the console - * clearStorage(); - * print(getItem('myNum')); // logs null to the console - * print(getItem('myBool')); // logs null to the console - * } - *
                - */ - _main.default.prototype.clearStorage = function () { - localStorage.clear(); - }; - /** - * - * Removes an item that was stored with storeItem() - * - * @method removeItem - * @param {String} key - * @for p5 - * - * @example - *
                - * - * function setup() { - * let myVar = 10; - * storeItem('myVar', myVar); - * print(getItem('myVar')); // logs 10 to the console - * removeItem('myVar'); - * print(getItem('myVar')); // logs null to the console - * } - *
                - */ - _main.default.prototype.removeItem = function (key) { - if (typeof key !== 'string') { - console.log('The argument that you passed to removeItem() - '.concat(key, ' is not a string.')); - } - localStorage.removeItem(key); - localStorage.removeItem(''.concat(key, 'p5TypeID')); - }; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.ends-with': 208, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 313: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.object.keys'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Data - * @submodule Dictionary - * @for p5.TypedDict - * @requires core - * - * This module defines the p5 methods for the p5 Dictionary classes. - * The classes StringDict and NumberDict are for storing and working - * with key-value pairs. - */ - /** - * - * Creates a new instance of p5.StringDict using the key-value pair - * or the object you provide. - * - * @method createStringDict - * @for p5 - * @param {String} key - * @param {String} value - * @return {p5.StringDict} - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * print(myDictionary.hasKey('p5')); // logs true to console - * - * let anotherDictionary = createStringDict({ happy: 'coding' }); - * print(anotherDictionary.hasKey('happy')); // logs true to console - * } - *
                - */ - /** - * @method createStringDict - * @param {Object} object object - * @return {p5.StringDict} - */ - - _main.default.prototype.createStringDict = function (key, value) { - _main.default._validateParameters('createStringDict', arguments); - return new _main.default.StringDict(key, value); - }; - /** - * - * Creates a new instance of p5.NumberDict using the key-value pair - * or object you provide. - * - * @method createNumberDict - * @for p5 - * @param {Number} key - * @param {Number} value - * @return {p5.NumberDict} - * - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict(100, 42); - * print(myDictionary.hasKey(100)); // logs true to console - * - * let anotherDictionary = createNumberDict({ 200: 84 }); - * print(anotherDictionary.hasKey(200)); // logs true to console - * } - *
                - */ - /** - * @method createNumberDict - * @param {Object} object object - * @return {p5.NumberDict} - */ - _main.default.prototype.createNumberDict = function (key, value) { - _main.default._validateParameters('createNumberDict', arguments); - return new _main.default.NumberDict(key, value); - }; - /** - * - * Base class for all p5.Dictionary types. Specifically - * typed Dictionary classes inherit from this class. - * - * @class p5.TypedDict - * @constructor - */ - _main.default.TypedDict = /*#__PURE__*/ function () { - function TypedDict(key, value) { - _classCallCheck(this, TypedDict); - if (key instanceof Object) { - this.data = key; - } else { - this.data = { - }; - this.data[key] = value; - } - return this; - } /** - * Returns the number of key-value pairs currently stored in the Dictionary. - * - * @method size - * @return {Integer} the number of key-value pairs in the Dictionary - * - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict(1, 10); - * myDictionary.create(2, 20); - * myDictionary.create(3, 30); - * print(myDictionary.size()); // logs 3 to the console - * } - *
                - */ - - _createClass(TypedDict, [ - { - key: 'size', - value: function size() { - return Object.keys(this.data).length; - } /** - * Returns true if the given key exists in the Dictionary, - * otherwise returns false. - * - * @method hasKey - * @param {Number|String} key that you want to look up - * @return {Boolean} whether that key exists in Dictionary - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * print(myDictionary.hasKey('p5')); // logs true to console - * } - *
                - */ - - }, - { - key: 'hasKey', - value: function hasKey(key) { - return this.data.hasOwnProperty(key); - } /** - * Returns the value stored at the given key. - * - * @method get - * @param {Number|String} the key you want to access - * @return {Number|String} the value stored at that key - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * let myValue = myDictionary.get('p5'); - * print(myValue === 'js'); // logs true to console - * } - *
                - */ - - }, - { - key: 'get', - value: function get(key) { - if (this.data.hasOwnProperty(key)) { - return this.data[key]; - } else { - console.log(''.concat(key, ' does not exist in this Dictionary')); - } - } /** - * Updates the value associated with the given key in case it already exists - * in the Dictionary. Otherwise a new key-value pair is added. - * - * @method set - * @param {Number|String} key - * @param {Number|String} value - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.set('p5', 'JS'); - * myDictionary.print(); // logs "key: p5 - value: JS" to console - * } - *
                - */ - - }, - { - key: 'set', - value: function set(key, value) { - if (this._validate(value)) { - this.data[key] = value; - } else { - console.log('Those values dont work for this dictionary type.'); - } - } /** - * private helper function to handle the user passing in objects - * during construction or calls to create() - */ - - }, - { - key: '_addObj', - value: function _addObj(obj) { - for (var key in obj) { - this.set(key, obj[key]); - } - } /** - * Creates a new key-value pair in the Dictionary. - * - * @method create - * @param {Number|String} key - * @param {Number|String} value - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.create('happy', 'coding'); - * myDictionary.print(); - * // above logs "key: p5 - value: js, key: happy - value: coding" to console - * } - *
                - */ - /** - * @method create - * @param {Object} obj key/value pair - */ - - }, - { - key: 'create', - value: function create(key, value) { - if (key instanceof Object && typeof value === 'undefined') { - this._addObj(key); - } else if (typeof key !== 'undefined') { - this.set(key, value); - } else { - console.log('In order to create a new Dictionary entry you must pass ' + 'an object or a key, value pair'); - } - } /** - * Removes all previously stored key-value pairs from the Dictionary. - * - * @method clear - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * print(myDictionary.hasKey('p5')); // prints 'true' - * myDictionary.clear(); - * print(myDictionary.hasKey('p5')); // prints 'false' - * } - * - *
                - */ - - }, - { - key: 'clear', - value: function clear() { - this.data = { - }; - } /** - * Removes the key-value pair stored at the given key from the Dictionary. - * - * @method remove - * @param {Number|String} key for the pair to remove - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.create('happy', 'coding'); - * myDictionary.print(); - * // above logs "key: p5 - value: js, key: happy - value: coding" to console - * myDictionary.remove('p5'); - * myDictionary.print(); - * // above logs "key: happy value: coding" to console - * } - *
                - */ - - }, - { - key: 'remove', - value: function remove(key) { - if (this.data.hasOwnProperty(key)) { - delete this.data[key]; - } else { - throw new Error(''.concat(key, ' does not exist in this Dictionary')); - } - } /** - * Logs the set of items currently stored in the Dictionary to the console. - * - * @method print - * - * @example - *
                - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.create('happy', 'coding'); - * myDictionary.print(); - * // above logs "key: p5 - value: js, key: happy - value: coding" to console - * } - * - *
                - */ - - }, - { - key: 'print', - value: function print() { - for (var item in this.data) { - console.log('key:'.concat(item, ' value:').concat(this.data[item])); - } - } /** - * Converts the Dictionary into a CSV file for local download. - * - * @method saveTable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * createStringDict({ - * john: 1940, - * paul: 1942, - * george: 1943, - * ringo: 1940 - * }).saveTable('beatles'); - * } - * } - * - *
                - */ - - }, - { - key: 'saveTable', - value: function saveTable(filename) { - var output = ''; - for (var key in this.data) { - output += ''.concat(key, ',').concat(this.data[key], '\n'); - } - var blob = new Blob([output], { - type: 'text/csv' - }); - _main.default.prototype.downloadFile(blob, filename || 'mycsv', 'csv'); - } /** - * Converts the Dictionary into a JSON file for local download. - * - * @method saveJSON - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * createStringDict({ - * john: 1940, - * paul: 1942, - * george: 1943, - * ringo: 1940 - * }).saveJSON('beatles'); - * } - * } - * - *
                - */ - - }, - { - key: 'saveJSON', - value: function saveJSON(filename, opt) { - _main.default.prototype.saveJSON(this.data, filename, opt); - } /** - * private helper function to ensure that the user passed in valid - * values for the Dictionary type - */ - - }, - { - key: '_validate', - value: function _validate(value) { - return true; - } - } - ]); - return TypedDict; - }(); - /** - * - * A simple Dictionary class for Strings. - * - * @class p5.StringDict - * @extends p5.TypedDict - */ - _main.default.StringDict = /*#__PURE__*/ function (_p5$TypedDict) { - _inherits(StringDict, _p5$TypedDict); - var _super = _createSuper(StringDict); - function StringDict() { - _classCallCheck(this, StringDict); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return _super.call.apply(_super, [ - this - ].concat(args)); - } - _createClass(StringDict, [ - { - key: '_validate', - value: function _validate(value) { - return typeof value === 'string'; - } - } - ]); - return StringDict; - }(_main.default.TypedDict); - /** - * - * A simple Dictionary class for Numbers. - * - * @class p5.NumberDict - * @constructor - * @extends p5.TypedDict - */ - _main.default.NumberDict = /*#__PURE__*/ function (_p5$TypedDict2) { - _inherits(NumberDict, _p5$TypedDict2); - var _super2 = _createSuper(NumberDict); - function NumberDict() { - _classCallCheck(this, NumberDict); - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return _super2.call.apply(_super2, [ - this - ].concat(args)); - } /** - * private helper function to ensure that the user passed in valid - * values for the Dictionary type - */ - - _createClass(NumberDict, [ - { - key: '_validate', - value: function _validate(value) { - return typeof value === 'number'; - } /** - * Add the given number to the value currently stored at the given key. - * The sum then replaces the value previously stored in the Dictionary. - * - * @method add - * @param {Number} Key for the value you wish to add to - * @param {Number} Number to add to the value - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict(2, 5); - * myDictionary.add(2, 2); - * print(myDictionary.get(2)); // logs 7 to console. - * } - *
                - * - */ - - }, - { - key: 'add', - value: function add(key, amount) { - if (this.data.hasOwnProperty(key)) { - this.data[key] += amount; - } else { - console.log('The key - '.concat(key, ' does not exist in this dictionary.')); - } - } /** - * Subtract the given number from the value currently stored at the given key. - * The difference then replaces the value previously stored in the Dictionary. - * - * @method sub - * @param {Number} Key for the value you wish to subtract from - * @param {Number} Number to subtract from the value - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict(2, 5); - * myDictionary.sub(2, 2); - * print(myDictionary.get(2)); // logs 3 to console. - * } - *
                - * - */ - - }, - { - key: 'sub', - value: function sub(key, amount) { - this.add(key, - amount); - } /** - * Multiply the given number with the value currently stored at the given key. - * The product then replaces the value previously stored in the Dictionary. - * - * @method mult - * @param {Number} Key for value you wish to multiply - * @param {Number} Amount to multiply the value by - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict(2, 4); - * myDictionary.mult(2, 2); - * print(myDictionary.get(2)); // logs 8 to console. - * } - *
                - * - */ - - }, - { - key: 'mult', - value: function mult(key, amount) { - if (this.data.hasOwnProperty(key)) { - this.data[key] *= amount; - } else { - console.log('The key - '.concat(key, ' does not exist in this dictionary.')); - } - } /** - * Divide the given number with the value currently stored at the given key. - * The quotient then replaces the value previously stored in the Dictionary. - * - * @method div - * @param {Number} Key for value you wish to divide - * @param {Number} Amount to divide the value by - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict(2, 8); - * myDictionary.div(2, 2); - * print(myDictionary.get(2)); // logs 4 to console. - * } - *
                - * - */ - - }, - { - key: 'div', - value: function div(key, amount) { - if (this.data.hasOwnProperty(key)) { - this.data[key] /= amount; - } else { - console.log('The key - '.concat(key, ' does not exist in this dictionary.')); - } - } /** - * private helper function for finding lowest or highest value - * the argument 'flip' is used to flip the comparison arrow - * from 'less than' to 'greater than' - */ - - }, - { - key: '_valueTest', - value: function _valueTest(flip) { - if (Object.keys(this.data).length === 0) { - throw new Error('Unable to search for a minimum or maximum value on an empty NumberDict'); - } else if (Object.keys(this.data).length === 1) { - return this.data[Object.keys(this.data) [0]]; - } else { - var result = this.data[Object.keys(this.data) [0]]; - for (var key in this.data) { - if (this.data[key] * flip < result * flip) { - result = this.data[key]; - } - } - return result; - } - } /** - * Return the lowest number currently stored in the Dictionary. - * - * @method minValue - * @return {Number} - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); - * let lowestValue = myDictionary.minValue(); // value is -10 - * print(lowestValue); - * } - *
                - */ - - }, - { - key: 'minValue', - value: function minValue() { - return this._valueTest(1); - } /** - * Return the highest number currently stored in the Dictionary. - * - * @method maxValue - * @return {Number} - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); - * let highestValue = myDictionary.maxValue(); // value is 3 - * print(highestValue); - * } - *
                - */ - - }, - { - key: 'maxValue', - value: function maxValue() { - return this._valueTest( - 1); - } /** - * private helper function for finding lowest or highest key - * the argument 'flip' is used to flip the comparison arrow - * from 'less than' to 'greater than' - */ - - }, - { - key: '_keyTest', - value: function _keyTest(flip) { - if (Object.keys(this.data).length === 0) { - throw new Error('Unable to use minValue on an empty NumberDict'); - } else if (Object.keys(this.data).length === 1) { - return Object.keys(this.data) [0]; - } else { - var result = Object.keys(this.data) [0]; - for (var i = 1; i < Object.keys(this.data).length; i++) { - if (Object.keys(this.data) [i] * flip < result * flip) { - result = Object.keys(this.data) [i]; - } - } - return result; - } - } /** - * Return the lowest key currently used in the Dictionary. - * - * @method minKey - * @return {Number} - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); - * let lowestKey = myDictionary.minKey(); // value is 1.2 - * print(lowestKey); - * } - *
                - */ - - }, - { - key: 'minKey', - value: function minKey() { - return this._keyTest(1); - } /** - * Return the highest key currently used in the Dictionary. - * - * @method maxKey - * @return {Number} - * @example - *
                - * - * function setup() { - * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); - * let highestKey = myDictionary.maxKey(); // value is 4 - * print(highestKey); - * } - *
                - */ - - }, - { - key: 'maxKey', - value: function maxKey() { - return this._keyTest( - 1); - } - } - ]); - return NumberDict; - }(_main.default.TypedDict); - var _default = _main.default.TypedDict; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 314: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/web.url'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/web.url'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * The web is much more than just canvas and the DOM functionality makes it easy to interact - * with other HTML5 objects, including text, hyperlink, image, input, video, - * audio, and webcam. - * There is a set of creation methods, DOM manipulation methods, and - * an extended p5.Element that supports a range of HTML elements. See the - * - * beyond the canvas tutorial for a full overview of how this addon works. - * - * See tutorial: beyond the canvas - * for more info on how to use this library. - * - * @module DOM - * @submodule DOM - * @for p5 - * @requires p5 - */ - /** - * Searches the page for the first element that matches the given - * CSS selector string. - * The string can be an ID, class, tag name, or a combination. `select()` - * returns a p5.Element object if it finds a match - * and `null` otherwise. - * - * The second parameter, `container`, is optional. It specifies a container to - * search within. container can be CSS selector string, a - * p5.Element object, or an - * HTMLElement object. - * - * @method select - * @param {String} selectors CSS selector string of element to search for. - * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or - * HTMLElement to search within. - * @return {p5.Element|null} p5.Element containing the element. - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * // Select the canvas by its tag. - * let cnv = select('canvas'); - * cnv.style('border', '5px deeppink dashed'); - * - * describe('A gray square with a dashed pink border.'); - * } - * - *
                - * - *
                - * - * function setup() { - * let cnv = createCanvas(100, 100); - * // Add a class attribute to the canvas. - * cnv.class('pinkborder'); - * - * background(200); - * - * // Select the canvas by its class. - * cnv = select('.pinkborder'); - * // Style its border. - * cnv.style('border', '5px deeppink dashed'); - * - * describe('A gray square with a dashed pink border.'); - * } - * - *
                - * - *
                - * - * function setup() { - * let cnv = createCanvas(100, 100); - * // Set the canvas ID. - * cnv.id('mycanvas'); - * - * background(200); - * - * // Select the canvas by its ID. - * cnv = select('#mycanvas'); - * // Style its border. - * cnv.style('border', '5px deeppink dashed'); - * - * describe('A gray square with a dashed pink border.'); - * } - * - *
                - */ - - _main.default.prototype.select = function (e, p) { - _main.default._validateParameters('select', arguments); - var container = this._getContainer(p); - var res = container.querySelector(e); - if (res) { - return this._wrapElement(res); - } else { - return null; - } - }; - /** - * Searches the page for all elements that matches the given - * CSS selector string. - * The string can be an ID, class, tag name, or a combination. `selectAll()` - * returns an array of p5.Element objects if it - * finds any matches and an empty array otherwise. - * - * The second parameter, `container`, is optional. It specifies a container to - * search within. container can be CSS selector string, a - * p5.Element object, or an - * HTMLElement object. - * - * @method selectAll - * @param {String} selectors CSS selector string of element to search for. - * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or - * HTMLElement to search within. - * @return {p5.Element[]} array of p5.Elements containing any elements found. - * @example - *
                - * - * function setup() { - * // Create three buttons. - * createButton('1'); - * createButton('2'); - * createButton('3'); - * - * // Select the buttons by their tag. - * let buttons = selectAll('button'); - * - * // Position the buttons. - * for (let i = 0; i < 3; i += 1) { - * buttons[i].position(0, i * 30); - * } - * - * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3".'); - * } - * - *
                - * - *
                - * - * function setup() { - * // Create three buttons and position them. - * let b1 = createButton('1'); - * b1.position(0, 0); - * let b2 = createButton('2'); - * b2.position(0, 30); - * let b3 = createButton('3'); - * b3.position(0, 60); - * - * // Add a class attribute to each button. - * b1.class('btn'); - * b2.class('btn btn-pink'); - * b3.class('btn'); - * - * // Select the buttons by their class. - * let buttons = selectAll('.btn'); - * let pinkButtons = selectAll('.btn-pink'); - * - * // Style the selected buttons. - * buttons.forEach(btn => { - * btn.style('font-family', 'Comic Sans MS'); - * }); - * - * pinkButtons.forEach(btn => { - * btn.style('background', 'deeppink'); - * btn.style('color', 'white'); - * }); - * - * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3". Buttons "1" and "3" are gray. Button "2" is pink.'); - * } - * - *
                - */ - _main.default.prototype.selectAll = function (e, p) { - _main.default._validateParameters('selectAll', arguments); - var arr = [ - ]; - var container = this._getContainer(p); - var res = container.querySelectorAll(e); - if (res) { - for (var j = 0; j < res.length; j++) { - var obj = this._wrapElement(res[j]); - arr.push(obj); - } - } - return arr; - }; - /** - * Helper function for select and selectAll - */ - _main.default.prototype._getContainer = function (p) { - var container = document; - if (typeof p === 'string') { - container = document.querySelector(p) || document; - } else if (p instanceof _main.default.Element) { - container = p.elt; - } else if (p instanceof HTMLElement) { - container = p; - } - return container; - }; - /** - * Helper function for getElement and getElements. - */ - _main.default.prototype._wrapElement = function (elt) { - var children = Array.prototype.slice.call(elt.children); - if (elt.tagName === 'INPUT' && elt.type === 'checkbox') { - var converted = new _main.default.Element(elt, this); - converted.checked = function () { - if (arguments.length === 0) { - return this.elt.checked; - } else if (arguments.length <= 0 ? undefined : arguments[0]) { - this.elt.checked = true; - } else { - this.elt.checked = false; - } - return this; - }; - return converted; - } else if (elt.tagName === 'VIDEO' || elt.tagName === 'AUDIO') { - return new _main.default.MediaElement(elt, this); - } else if (elt.tagName === 'SELECT') { - return this.createSelect(new _main.default.Element(elt, this)); - } else if (children.length > 0 && children.every(function (c) { - return c.tagName === 'INPUT' || c.tagName === 'LABEL'; - })) { - return this.createRadio(new _main.default.Element(elt, this)); - } else { - return new _main.default.Element(elt, this); - } - }; - /** - * Removes all elements created by p5.js, including any event handlers. - * There are two exceptions: - * canvas elements created by createCanvas - * and p5.Render objects created by - * createGraphics. - * - * @method removeElements - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * // Create a paragraph element and place - * // it in the middle of the canvas. - * let p = createP('p5*js'); - * p.position(25, 25); - * - * describe('A gray square with the text "p5*js" written in its center. The text disappears when the mouse is pressed.'); - * } - * - * function mousePressed() { - * removeElements(); - * } - * - *
                - * - *
                - * - * let slider; - * - * function setup() { - * createCanvas(100, 100); - * - * // Create a paragraph element and place - * // it at the top of the canvas. - * let p = createP('p5*js'); - * p.position(25, 25); - * - * // Create a slider element and place it - * // beneath the canvas. - * slider = createSlider(0, 255, 200); - * slider.position(0, 100); - * - * describe('A gray square with the text "p5*js" written in its center and a range slider beneath it. The square changes color when the slider is moved. The text and slider disappear when the square is double-clicked.'); - * } - * - * function draw() { - * // Use the slider value to change the background color. - * let g = slider.value(); - * background(g); - * } - * - * function doubleClicked() { - * removeElements(); - * } - * - *
                - */ - _main.default.prototype.removeElements = function (e) { - _main.default._validateParameters('removeElements', arguments); - // el.remove splices from this._elements, so don't mix iteration with it - var isNotCanvasElement = function isNotCanvasElement(el) { - return !(el.elt instanceof HTMLCanvasElement); - }; - var removeableElements = this._elements.filter(isNotCanvasElement); - removeableElements.map(function (el) { - return el.remove(); - }); - }; - /** - * `myElement.changed()` sets a function to call when the value of the - * p5.Element object changes. Calling - * `myElement.changed(false)` disables the function. - * - * @method changed - * @param {Function|Boolean} fxn function to call when the element changes. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a dropdown menu and add a few color options. - * let drop = createSelect(); - * drop.position(0, 0); - * drop.option('red'); - * drop.option('green'); - * drop.option('blue'); - * - * // When the color option changes, paint the background with - * // that color. - * drop.changed(() => { - * let c = drop.value(); - * background(c); - * }); - * - * describe('A gray square with a dropdown menu at the top. The square changes color when an option is selected.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create a checkbox and place it beneath the canvas. - * let checkbox = createCheckbox(' circle'); - * checkbox.position(0, 100); - * - * // When the checkbox changes, paint the background gray - * // and determine whether to draw a circle. - * checkbox.changed(() => { - * background(200); - * if (checkbox.checked() === true) { - * circle(50, 50, 30); - * } - * }); - * - * describe('A gray square with a checkbox underneath it that says "circle". A white circle appears when the box is checked and disappears otherwise.'); - * } - * - *
                - */ - _main.default.Element.prototype.changed = function (fxn) { - _main.default.Element._adjustListener('change', fxn, this); - return this; - }; - /** - * `myElement.input()` sets a function to call when input is detected within - * the p5.Element object. It's often used to with - * text inputs and sliders. Calling `myElement.input(false)` disables the - * function. - * - * @method input - * @param {Function|Boolean} fxn function to call when input is detected within - * the element. - * `false` disables the function. - * @chainable - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a slider and place it beneath the canvas. - * let slider = createSlider(0, 255, 200); - * slider.position(0, 100); - * - * // When the slider changes, use its value to paint - * // the background. - * slider.input(() => { - * let g = slider.value(); - * background(g); - * }); - * - * describe('A gray square with a range slider underneath it. The background changes shades of gray when the slider is moved.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create an input and place it beneath the canvas. - * let inp = createInput(''); - * inp.position(0, 100); - * - * // When input is detected, paint the background gray - * // and display the text. - * inp.input(() => { - * background(200); - * let msg = inp.value(); - * text(msg, 5, 50); - * }); - * - * describe('A gray square with a text input bar beneath it. Any text written in the input appears in the middle of the square.'); - * } - * - *
                - */ - _main.default.Element.prototype.input = function (fxn) { - _main.default.Element._adjustListener('input', fxn, this); - return this; - }; - /** - * Helpers for create methods. - */ - function addElement(elt, pInst, media) { - var node = pInst._userNode ? pInst._userNode : document.body; - node.appendChild(elt); - var c = media ? new _main.default.MediaElement(elt, pInst) : new _main.default.Element(elt, pInst); - pInst._elements.push(c); - return c; - } /** - * Creates a `<div></div>` element. It's commonly used as a - * container for other elements. - * - * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<div></div>`. - * - * @method createDiv - * @param {String} [html] inner HTML for the new `<div></div>` element. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * let div = createDiv('p5*js'); - * div.position(25, 35); - * - * describe('A gray square with the text "p5*js" written in its center.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create an h3 element within the div. - * let div = createDiv('

                p5*js

                '); - * div.position(20, 5); - * - * describe('A gray square with the text "p5*js" written in its center.'); - * } - *
                - *
                - */ - - _main.default.prototype.createDiv = function () { - var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var elt = document.createElement('div'); - elt.innerHTML = html; - return addElement(elt, this); - }; - /** - * Creates a `<p></p>` element. It's commonly used for - * paragraph-length text. - * - * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<p></p>`. - * - * @method createP - * @param {String} [html] inner HTML for the new `<p></p>` element. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * let p = createP('Tell me a story.'); - * p.position(5, 0); - * - * describe('A gray square displaying the text "Tell me a story." written in black.'); - * } - * - *
                - */ - _main.default.prototype.createP = function () { - var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var elt = document.createElement('p'); - elt.innerHTML = html; - return addElement(elt, this); - }; - /** - * Creates a `<span></span>` element. It's commonly used as a - * container for inline elements. For example, a `<span></span>` - * can hold part of a sentence that's a - * different style. - * - * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<span></span>`. - * - * @method createSpan - * @param {String} [html] inner HTML for the new `<span></span>` element. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a span element. - * let span = createSpan('p5*js'); - * span.position(25, 35); - * - * describe('A gray square with the text "p5*js" written in its center.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create a div element as - * // a container. - * let div = createDiv(); - * // Place the div at the - * // center. - * div.position(25, 35); - * - * // Create a span element. - * let s1 = createSpan('p5'); - * // Create a second span element. - * let s2 = createSpan('*'); - * // Set the span's font color. - * s2.style('color', 'deeppink'); - * // Create a third span element. - * let s3 = createSpan('js'); - * - * // Add all the spans to the - * // container div. - * s1.parent(div); - * s2.parent(div); - * s3.parent(div); - * - * describe('A gray square with the text "p5*js" written in black at its center. The asterisk is pink.'); - * } - * - *
                - */ - _main.default.prototype.createSpan = function () { - var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var elt = document.createElement('span'); - elt.innerHTML = html; - return addElement(elt, this); - }; - /** - * Creates an `<img>` element that can appear outside of the canvas. - * - * The first parameter, `src`, is a string with the path to the image file. - * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as - * in `'https://example.com/image.png'`. - * - * The second parameter, `alt`, is a string with the - * alternate text - * for the image. An empty string `''` can be used for images that aren't displayed. - * - * The third parameter, `crossOrigin`, is optional. It's a string that sets the - * crossOrigin property - * of the image. Use `'anonymous'` or `'use-credentials'` to fetch the image - * with cross-origin access. - * - * The fourth parameter, `callback`, is also optional. It sets a function to - * call after the image loads. The new image is passed to the callback - * function as a p5.Element object. - * - * @method createImg - * @param {String} src relative path or URL for the image. - * @param {String} alt alternate text for the image. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * let img = createImg( - * 'https://p5js.org/assets/img/asterisk-01.png', - * 'The p5.js magenta asterisk.' - * ); - * img.position(0, -10); - * - * describe('A gray square with a magenta asterisk in its center.'); - * } - * - *
                - */ - /** - * @method createImg - * @param {String} src - * @param {String} alt - * @param {String} [crossOrigin] crossOrigin property to use when fetching the image. - * @param {Function} [successCallback] function to call once the image loads. The new image will be passed - * to the function as a p5.Element object. - * @return {p5.Element} new p5.Element object. - */ - _main.default.prototype.createImg = function () { - _main.default._validateParameters('createImg', arguments); - var elt = document.createElement('img'); - var args = arguments; - var self; - if (args.length > 1 && typeof args[1] === 'string') { - elt.alt = args[1]; - } - if (args.length > 2 && typeof args[2] === 'string') { - elt.crossOrigin = args[2]; - } - elt.src = args[0]; - self = addElement(elt, this); - elt.addEventListener('load', function () { - self.width = elt.offsetWidth || elt.width; - self.height = elt.offsetHeight || elt.height; - var last = args[args.length - 1]; - if (typeof last === 'function') last(self); - }); - return self; - }; - /** - * Creates an `<a></a>` element that links to another web page. - * - * The first parmeter, `href`, is a string that sets the URL of the linked - * page. - * - * The second parameter, `html`, is a string that sets the inner HTML of the - * link. It's common to use text, images, or buttons as links. - * - * The third parameter, `target`, is optional. It's a string that tells the - * web browser where to open the link. By default, links open in the current - * browser tab. Passing `'_blank'` will cause the link to open in a new - * browser tab. MDN describes a few - * other options. - * - * @method createA - * @param {String} href URL of linked page. - * @param {String} html inner HTML of link element to display. - * @param {String} [target] target where the new link should open, - * either `'_blank'`, `'_self'`, `'_parent'`, or `'_top'`. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create an anchor element that links to p5js.org. - * let a = createA('http://p5js.org/', 'p5*js'); - * a.position(25, 35); - * - * describe('The text "p5*js" written at the center of a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create an anchor element that links to p5js.org. - * // Open the link in a new tab. - * let a = createA('http://p5js.org/', 'p5*js', '_blank'); - * a.position(25, 35); - * - * describe('The text "p5*js" written at the center of a gray square.'); - * } - * - *
                - */ - _main.default.prototype.createA = function (href, html, target) { - _main.default._validateParameters('createA', arguments); - var elt = document.createElement('a'); - elt.href = href; - elt.innerHTML = html; - if (target) elt.target = target; - return addElement(elt, this); - }; - /** INPUT **/ - /** - * Creates a slider `<input></input>` element. Range sliders are - * useful for quickly selecting numbers from a given range. - * - * The first two parameters, `min` and `max`, are numbers that set the - * slider's minimum and maximum. - * - * The third parameter, `value`, is optional. It's a number that sets the - * slider's default value. - * - * The fourth parameter, `step`, is also optional. It's a number that sets the - * spacing between each value in the slider's range. Setting `step` to 0 - * allows the slider to move smoothly from `min` to `max`. - * - * @method createSlider - * @param {Number} min minimum value of the slider. - * @param {Number} max maximum value of the slider. - * @param {Number} [value] default value of the slider. - * @param {Number} [step] size for each step in the slider's range. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * slider = createSlider(0, 255); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A dark gray square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                - * - *
                - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * // Set its default value to 0. - * slider = createSlider(0, 255, 0); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                - * - *
                - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * // Set its default value to 0. - * // Set its step size to 50. - * slider = createSlider(0, 255, 0, 50); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                - * - *
                - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * // Set its default value to 0. - * // Set its step size to 0 so that it moves smoothly. - * slider = createSlider(0, 255, 0, 0); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                - */ - _main.default.prototype.createSlider = function (min, max, value, step) { - _main.default._validateParameters('createSlider', arguments); - var elt = document.createElement('input'); - elt.type = 'range'; - elt.min = min; - elt.max = max; - if (step === 0) { - elt.step = 1e-18; // smallest valid step - } else if (step) { - elt.step = step; - } - if (typeof value === 'number') elt.value = value; - return addElement(elt, this); - }; - /** - * Creates a `<button></button>` element. - * - * The first parameter, `label`, is a string that sets the label displayed on - * the button. - * - * The second parameter, `value`, is optional. It's a string that sets the - * button's value. See - * MDN - * for more details. - * - * @method createButton - * @param {String} label label displayed on the button. - * @param {String} [value] value of the button. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a button and place it beneath the canvas. - * let button = createButton('click me'); - * button.position(0, 100); - * - * // Use the button to change the background color. - * button.mousePressed(() => { - * let g = random(255); - * background(g); - * }); - * - * describe('A gray square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); - * } - * - *
                - * - *
                - * - * let button; - * - * function setup() { - * // Create a button and set its value to 0. - * // Place the button beneath the canvas. - * button = createButton('click me', 'red'); - * button.position(0, 100); - * - * // Change the button's value when the mouse - * // is pressed. - * button.mousePressed(() => { - * let c = random(['red', 'green', 'blue', 'yellow']); - * button.value(c); - * }); - * - * describe('A red square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); - * } - * - * function draw() { - * // Use the button's value to set the background color. - * let c = button.value(); - * background(c); - * } - * - *
                - */ - _main.default.prototype.createButton = function (label, value) { - _main.default._validateParameters('createButton', arguments); - var elt = document.createElement('button'); - elt.innerHTML = label; - if (value) elt.value = value; - return addElement(elt, this); - }; - /** - * Creates a checkbox `<input></input>` element. Checkboxes extend - * the p5.Element class with a `checked()` method. - * Calling `myBox.checked()` returns `true` if it the box is checked and - * `false` otherwise. - * - * The first parameter, `label`, is optional. It's a string that sets the label - * to display next to the checkbox. - * - * The second parameter, `value`, is also optional. It's a boolean that sets the - * checkbox's value. - * - * @method createCheckbox - * @param {String} [label] label displayed after the checkbox. - * @param {boolean} [value] value of the checkbox. Checked is `true` and unchecked is `false`. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * let checkbox; - * - * function setup() { - * // Create a checkbox and place it beneath the canvas. - * checkbox = createCheckbox(); - * checkbox.position(0, 100); - * - * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.'); - * } - * - * function draw() { - * // Use the checkbox to set the background color. - * if (checkbox.checked()) { - * background(255); - * } else { - * background(0); - * } - * } - * - *
                - * - *
                - * - * let checkbox; - * - * function setup() { - * // Create a checkbox and place it beneath the canvas. - * // Label the checkbox "white". - * checkbox = createCheckbox(' white'); - * checkbox.position(0, 100); - * - * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.'); - * } - * - * function draw() { - * // Use the checkbox to set the background color. - * if (checkbox.checked()) { - * background(255); - * } else { - * background(0); - * } - * } - * - *
                - * - *
                - * - * let checkbox; - * - * function setup() { - * // Create a checkbox and place it beneath the canvas. - * // Label the checkbox "white" and set its value to true. - * checkbox = createCheckbox(' white', true); - * checkbox.position(0, 100); - * - * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.'); - * } - * - * function draw() { - * // Use the checkbox to set the background color. - * if (checkbox.checked()) { - * background(255); - * } else { - * background(0); - * } - * } - * - *
                - */ - _main.default.prototype.createCheckbox = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('createCheckbox', args); - // Create a container element - var elt = document.createElement('div'); - // Create checkbox type input element - var checkbox = document.createElement('input'); - checkbox.type = 'checkbox'; - // Create label element and wrap it around checkbox - var label = document.createElement('label'); - label.appendChild(checkbox); - // Append label element inside the container - elt.appendChild(label); - //checkbox must be wrapped in p5.Element before label so that label appears after - var self = addElement(elt, this); - self.checked = function () { - var cb = self.elt.firstElementChild.getElementsByTagName('input') [0]; - if (cb) { - if (arguments.length === 0) { - return cb.checked; - } else if (arguments.length <= 0 ? undefined : arguments[0]) { - cb.checked = true; - } else { - cb.checked = false; - } - } - return self; - }; - this.value = function (val) { - self.value = val; - return this; - }; - // Set the span element innerHTML as the label value if passed - if (args[0]) { - self.value(args[0]); - var span = document.createElement('span'); - span.innerHTML = args[0]; - label.appendChild(span); - } // Set the checked value of checkbox if passed - - if (args[1]) { - checkbox.checked = true; - } - return self; - }; - /** - * Creates a dropdown menu `<select></select>` element. - * - * The parameter is optional. If `true` is passed, as in - * `let mySelect = createSelect(true)`, then the dropdown will support - * multiple selections. If an existing `<select></select>` element - * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing - * element will be wrapped in a new p5.Element - * object. - * - * Dropdowns extend the p5.Element class with a few - * helpful methods for managing options: - * - `mySelect.option(name, [value])` adds an option to the menu. The first paremeter, `name`, is a string that sets the option's name and value. The second parameter, `value`, is optional. If provided, it sets the value that corresponds to the key `name`. If an option with `name` already exists, its value is changed to `value`. - * - `mySelect.value()` returns the currently-selected option's value. - * - `mySelect.selected()` returns the currently-selected option. - * - `mySelect.selected(option)` selects the given option by default. - * - `mySelect.disable()` marks the whole dropdown element as disabled. - * - `mySelect.disable(option)` marks a given option as disabled. - * - `mySelect.enable()` marks the whole dropdown element as enabled. - * - `mySelect.enable(option)` marks a given option as enabled. - * - * @method createSelect - * @param {boolean} [multiple] support multiple selections. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * let mySelect; - * - * function setup() { - * // Create a dropdown and place it beneath the canvas. - * mySelect = createSelect(); - * mySelect.position(0, 100); - * - * // Add color options. - * mySelect.option('red'); - * mySelect.option('green'); - * mySelect.option('blue'); - * mySelect.option('yellow'); - * - * // Set the selected option to "red". - * mySelect.selected('red'); - * - * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); - * } - * - * function draw() { - * // Use the selected value to paint the background. - * let c = mySelect.selected(); - * background(c); - * } - * - *
                - * - *
                - * - * let mySelect; - * - * function setup() { - * // Create a dropdown and place it beneath the canvas. - * mySelect = createSelect(); - * mySelect.position(0, 100); - * - * // Add color options. - * mySelect.option('red'); - * mySelect.option('green'); - * mySelect.option('blue'); - * mySelect.option('yellow'); - * - * // Set the selected option to "red". - * mySelect.selected('red'); - * - * // Disable the "yellow" option. - * mySelect.disable('yellow'); - * - * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); - * } - * - * function draw() { - * // Use the selected value to paint the background. - * let c = mySelect.selected(); - * background(c); - * } - * - *
                - * - *
                - * - * let mySelect; - * - * function setup() { - * // Create a dropdown and place it beneath the canvas. - * mySelect = createSelect(); - * mySelect.position(0, 100); - * - * // Add color options with names and values. - * mySelect.option('one', 'red'); - * mySelect.option('two', 'green'); - * mySelect.option('three', 'blue'); - * mySelect.option('four', 'yellow'); - * - * // Set the selected option to "one". - * mySelect.selected('one'); - * - * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); - * } - * - * function draw() { - * // Use the selected value to paint the background. - * let c = mySelect.selected(); - * background(c); - * } - * - *
                - * - *
                - * - * // Hold CTRL to select multiple options on Windows and Linux. - * // Hold CMD to select multiple options on macOS. - * let mySelect; - * - * function setup() { - * // Create a dropdown and allow multiple selections. - * // Place it beneath the canvas. - * mySelect = createSelect(true); - * mySelect.position(0, 100); - * - * // Add color options. - * mySelect.option('red'); - * mySelect.option('green'); - * mySelect.option('blue'); - * mySelect.option('yellow'); - * - * describe('A gray square with a dropdown menu beneath it. Colorful circles appear when their color is selected.'); - * } - * - * function draw() { - * background(200); - * - * // Use the selected value(s) to draw circles. - * let colors = mySelect.selected(); - * colors.forEach((c, index) => { - * let x = 10 + index * 20; - * fill(c); - * circle(x, 50, 20); - * }); - * } - * - *
                - */ - /** - * @method createSelect - * @param {Object} existing select element to wrap, either as a p5.Element or - * a HTMLSelectElement. - * @return {p5.Element} - */ - _main.default.prototype.createSelect = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('createSelect', args); - var self; - var arg = args[0]; - if (arg instanceof _main.default.Element && arg.elt instanceof HTMLSelectElement) { - // If given argument is p5.Element of select type - self = arg; - this.elt = arg.elt; - } else if (arg instanceof HTMLSelectElement) { - self = addElement(arg, this); - this.elt = arg; - } else { - var elt = document.createElement('select'); - if (arg && typeof arg === 'boolean') { - elt.setAttribute('multiple', 'true'); - } - self = addElement(elt, this); - this.elt = elt; - } - self.option = function (name, value) { - var index; - // if no name is passed, return - if (name === undefined) { - return; - } //see if there is already an option with this name - - for (var i = 0; i < this.elt.length; i += 1) { - if (this.elt[i].textContent === name) { - index = i; - break; - } - } //if there is an option with this name we will modify it - - if (index !== undefined) { - //if the user passed in false then delete that option - if (value === false) { - this.elt.remove(index); - } else { - // Update the option at index with the value - this.elt[index].value = value; - } - } else { - //if it doesn't exist create it - var opt = document.createElement('option'); - opt.textContent = name; - opt.value = value === undefined ? name : value; - this.elt.appendChild(opt); - this._pInst._elements.push(opt); - } - }; - self.selected = function (value) { - // Update selected status of option - if (value !== undefined) { - for (var i = 0; i < this.elt.length; i += 1) { - if (this.elt[i].value.toString() === value.toString()) { - this.elt.selectedIndex = i; - } - } - return this; - } else { - if (this.elt.getAttribute('multiple')) { - var arr = [ - ]; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this.elt.selectedOptions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var selectedOption = _step.value; - arr.push(selectedOption.value); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return arr; - } else { - return this.elt.value; - } - } - }; - self.disable = function (value) { - if (typeof value === 'string') { - for (var i = 0; i < this.elt.length; i++) { - if (this.elt[i].value.toString() === value) { - this.elt[i].disabled = true; - this.elt[i].selected = false; - } - } - } else { - this.elt.disabled = true; - } - return this; - }; - self.enable = function (value) { - if (typeof value === 'string') { - for (var i = 0; i < this.elt.length; i++) { - if (this.elt[i].value.toString() === value) { - this.elt[i].disabled = false; - this.elt[i].selected = false; - } - } - } else { - this.elt.disabled = false; - for (var _i = 0; _i < this.elt.length; _i++) { - this.elt[_i].disabled = false; - this.elt[_i].selected = false; - } - } - return this; - }; - return self; - }; - /** - * Creates a radio button element. - * - * The parameter is optional. If a string is passed, as in - * `let myRadio = createSelect('food')`, then each radio option will - * have `"food"` as its `name` parameter: `<input name="food"></input>`. - * If an existing `<div></div>` or `<span></span>` - * element is passed, as in `let myRadio = createSelect(container)`, it will - * become the radio button's parent element. - * - * Radio buttons extend the p5.Element class with a few - * helpful methods for managing options: - * - `myRadio.option(value, [label])` adds an option to the menu. The first paremeter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned. - * - `myRadio.value()` returns the currently-selected option's value. - * - `myRadio.selected()` returns the currently-selected option. - * - `myRadio.selected(value)` selects the given option and returns it as an `HTMLInputElement`. - * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed. - * - * @method createRadio - * @param {Object} [containerElement] container HTML Element, either a `<div></div>` - * or `<span></span>`. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * let myRadio; - * - * function setup() { - * // Create a radio button element and place it - * // in the top-left corner. - * myRadio = createRadio(); - * myRadio.position(0, 0); - * myRadio.size(60); - * - * // Add a few color options. - * myRadio.option('red'); - * myRadio.option('yellow'); - * myRadio.option('blue'); - * - * // Choose a default option. - * myRadio.selected('yellow'); - * - * describe('A yellow square with three color options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option.'); - * } - * - * function draw() { - * // Set the background color using the radio button. - * let g = myRadio.value(); - * background(g); - * } - * - *
                - * - *
                - * - * let myRadio; - * - * function setup() { - * // Create a radio button element and place it - * // in the top-left corner. - * myRadio = createRadio(); - * myRadio.position(0, 0); - * myRadio.size(50); - * - * // Add a few color options. - * // Color values are labeled with - * // emotions they evoke. - * myRadio.option('red', 'love'); - * myRadio.option('yellow', 'joy'); - * myRadio.option('blue', 'trust'); - * - * // Choose a default option. - * myRadio.selected('yellow'); - * - * describe('A yellow square with three options listed, "love", "joy", and "trust". The square changes color when the user selects a new option.'); - * } - * - * function draw() { - * // Set the background color using the radio button. - * let c = myRadio.value(); - * background(c); - * } - * - *
                - * - *
                - * - * let myRadio; - * - * function setup() { - * // Create a radio button element and place it - * // in the top-left corner. - * myRadio = createRadio(); - * myRadio.position(0, 0); - * myRadio.size(50); - * - * // Add a few color options. - * myRadio.option('red'); - * myRadio.option('yellow'); - * myRadio.option('blue'); - * - * // Choose a default option. - * myRadio.selected('yellow'); - * - * // Create a button and place it beneath the canvas. - * let btn = createButton('disable'); - * btn.position(0, 100); - * - * // Use the button to disable the radio button. - * btn.mousePressed(() => { - * myRadio.disable(true); - * }); - * - * describe('A yellow square with three options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option. A "disable" button beneath the canvas disables the color options when pressed.'); - * } - * - * function draw() { - * // Set the background color using the radio button. - * let c = myRadio.value(); - * background(c); - * } - * - *
                - */ - /** - * @method createRadio - * @param {String} [name] name parameter assigned to each option's `<input></input>` element. - * @return {p5.Element} new p5.Element object. - */ - /** - * @method createRadio - * @return {p5.Element} new p5.Element object. - */ - _main.default.prototype.createRadio = function () { - // Creates a div, adds each option as an individual input inside it. - // If already given with a containerEl, will search for all input[radio] - // it, create a p5.Element out of it, add options to it and return the p5.Element. - var self; - var radioElement; - var name; - var arg0 = arguments.length <= 0 ? undefined : arguments[0]; - if (arg0 instanceof _main.default.Element && (arg0.elt instanceof HTMLDivElement || arg0.elt instanceof HTMLSpanElement)) { - // If given argument is p5.Element of div/span type - self = arg0; - this.elt = arg0.elt; - } else if ( // If existing radio Element is provided as argument 0 - arg0 instanceof HTMLDivElement || arg0 instanceof HTMLSpanElement) { - self = addElement(arg0, this); - this.elt = arg0; - radioElement = arg0; - if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'string') name = arguments.length <= 1 ? undefined : arguments[1]; - } else { - if (typeof arg0 === 'string') name = arg0; - radioElement = document.createElement('div'); - self = addElement(radioElement, this); - this.elt = radioElement; - } - self._name = name || 'radioOption'; - // setup member functions - var isRadioInput = function isRadioInput(el) { - return el instanceof HTMLInputElement && el.type === 'radio'; - }; - var isLabelElement = function isLabelElement(el) { - return el instanceof HTMLLabelElement; - }; - var isSpanElement = function isSpanElement(el) { - return el instanceof HTMLSpanElement; - }; - self._getOptionsArray = function () { - return Array.from(this.elt.children).filter(function (el) { - return isRadioInput(el) || isLabelElement(el) && isRadioInput(el.firstElementChild); - }).map(function (el) { - return isRadioInput(el) ? el : el.firstElementChild; - }); - }; - self.option = function (value, label) { - // return an option with this value, create if not exists. - var optionEl; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = self._getOptionsArray() [Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var option = _step2.value; - if (option.value === value) { - optionEl = option; - break; - } - } // Create a new option, add it to radioElement and return it. - - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - if (optionEl === undefined) { - optionEl = document.createElement('input'); - optionEl.setAttribute('type', 'radio'); - optionEl.setAttribute('value', value); - } - optionEl.setAttribute('name', self._name); - // Check if label element exists, else create it - var labelElement; - if (!isLabelElement(optionEl.parentElement)) { - labelElement = document.createElement('label'); - labelElement.insertAdjacentElement('afterbegin', optionEl); - } else { - labelElement = optionEl.parentElement; - } // Check if span element exists, else create it - - var spanElement; - if (!isSpanElement(labelElement.lastElementChild)) { - spanElement = document.createElement('span'); - optionEl.insertAdjacentElement('afterend', spanElement); - } else { - spanElement = labelElement.lastElementChild; - } // Set the innerHTML of span element as the label text - - spanElement.innerHTML = label === undefined ? value : label; - // Append the label element, which includes option element and - // span element to the radio container element - this.elt.appendChild(labelElement); - return optionEl; - }; - self.remove = function (value) { - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = self._getOptionsArray() [Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var optionEl = _step3.value; - if (optionEl.value === value) { - if (isLabelElement(optionEl.parentElement)) { - // Remove parent label which also removes children elements - optionEl.parentElement.remove(); - } else { - // Remove the option input if parent label does not exist - optionEl.remove(); - } - return; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - }; - self.value = function () { - var result = ''; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for (var _iterator4 = self._getOptionsArray() [Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var option = _step4.value; - if (option.checked) { - result = option.value; - break; - } - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - return result; - }; - self.selected = function (value) { - var result = null; - if (value === undefined) { - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - try { - for (var _iterator5 = self._getOptionsArray() [Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var option = _step5.value; - if (option.checked) { - result = option; - break; - } - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return != null) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - } else { - // forEach loop to uncheck all radio buttons before - // setting any one as checked. - self._getOptionsArray().forEach(function (option) { - option.checked = false; - option.removeAttribute('checked'); - }); - var _iteratorNormalCompletion6 = true; - var _didIteratorError6 = false; - var _iteratorError6 = undefined; - try { - for (var _iterator6 = self._getOptionsArray() [Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { - var _option = _step6.value; - if (_option.value === value) { - _option.setAttribute('checked', true); - _option.checked = true; - result = _option; - } - } - } catch (err) { - _didIteratorError6 = true; - _iteratorError6 = err; - } finally { - try { - if (!_iteratorNormalCompletion6 && _iterator6.return != null) { - _iterator6.return(); - } - } finally { - if (_didIteratorError6) { - throw _iteratorError6; - } - } - } - } - return result; - }; - self.disable = function () { - var shouldDisable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - var _iteratorNormalCompletion7 = true; - var _didIteratorError7 = false; - var _iteratorError7 = undefined; - try { - for (var _iterator7 = self._getOptionsArray() [Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { - var radioInput = _step7.value; - radioInput.setAttribute('disabled', shouldDisable); - } - } catch (err) { - _didIteratorError7 = true; - _iteratorError7 = err; - } finally { - try { - if (!_iteratorNormalCompletion7 && _iterator7.return != null) { - _iterator7.return(); - } - } finally { - if (_didIteratorError7) { - throw _iteratorError7; - } - } - } - }; - return self; - }; - /** - * Creates a color picker element. - * - * The parameter, `value`, is optional. If a color string or - * p5.Color object is passed, it will set the default - * color. - * - * Color pickers extend the p5.Element class with a - * couple of helpful methods for managing colors: - * - `myPicker.value()` returns the current color as a hex string in the format `'#rrggbb'`. - * - `myPicker.color()` returns the current color as a p5.Color object. - * - * - * @method createColorPicker - * @param {String|p5.Color} [value] default color as a CSS color string. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * let myPicker; - * - * function setup() { - * myPicker = createColorPicker('deeppink'); - * myPicker.position(0, 100); - * - * describe('A pink square with a color picker beneath it. The square changes color when the user picks a new color.'); - * } - * - * function draw() { - * // Use the color picker to paint the background. - * let c = myPicker.color(); - * background(c); - * } - * - *
                - * - *
                - * - * let myPicker; - * - * function setup() { - * myPicker = createColorPicker('deeppink'); - * myPicker.position(0, 100); - * - * describe('A number with the format "#rrggbb" is displayed on a pink canvas. The background color and number change when the user picks a new color.'); - * } - * - * function draw() { - * // Use the color picker to paint the background. - * let c = myPicker.value(); - * background(c); - * - * // Display the current color as a hex string. - * text(c, 25, 55); - * } - * - *
                - */ - _main.default.prototype.createColorPicker = function (value) { - _main.default._validateParameters('createColorPicker', arguments); - var elt = document.createElement('input'); - var self; - elt.type = 'color'; - if (value) { - if (value instanceof _main.default.Color) { - elt.value = value.toString('#rrggbb'); - } else { - _main.default.prototype._colorMode = 'rgb'; - _main.default.prototype._colorMaxes = { - rgb: [ - 255, - 255, - 255, - 255 - ], - hsb: [ - 360, - 100, - 100, - 1 - ], - hsl: [ - 360, - 100, - 100, - 1 - ] - }; - elt.value = _main.default.prototype.color(value).toString('#rrggbb'); - } - } else { - elt.value = '#000000'; - } - self = addElement(elt, this); - // Method to return a p5.Color object for the given color. - self.color = function () { - if (value) { - if (value.mode) { - _main.default.prototype._colorMode = value.mode; - } - if (value.maxes) { - _main.default.prototype._colorMaxes = value.maxes; - } - } - return _main.default.prototype.color(this.elt.value); - }; - return self; - }; - /** - * Creates a text `<input></input>` element. Call `myInput.size()` - * to set the length of the text box. - * - * The first parameter, `value`, is optional. It's a string that sets the - * input's default value. The input is blank by default. - * - * The second parameter, `type`, is also optional. It's a string that - * specifies the type of text being input. See MDN for a full - * list of options. - * The default is `'text'`. - * - * @method createInput - * @param {String} [value] default value of the input box. Defaults to an empty string `''`. - * @param {String} [type] type of input. Defaults to `'text'`. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * let myInput; - * - * function setup() { - * // Create an input element and place it - * // beneath the canvas. - * myInput = createInput(); - * myInput.position(0, 100); - * - * describe('A gray square with a text box beneath it. The text in the square changes when the user types something new in the input bar.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input to display a message. - * let msg = myInput.value(); - * text(msg, 25, 55); - * } - * - *
                - * - *
                - * - * let myInput; - * - * function setup() { - * // Create an input element and place it - * // beneath the canvas. Set its default - * // text to "hello!". - * myInput = createInput('hello!'); - * myInput.position(0, 100); - * - * describe('The text "hello!" written at the center of a gray square. A text box beneath the square also says "hello!". The text in the square changes when the user types something new in the input bar.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input to display a message. - * let msg = myInput.value(); - * text(msg, 25, 55); - * } - * - *
                - */ - /** - * @method createInput - * @param {String} [value] - * @return {p5.Element} - */ - _main.default.prototype.createInput = function () { - var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text'; - _main.default._validateParameters('createInput', arguments); - var elt = document.createElement('input'); - elt.setAttribute('value', value); - elt.setAttribute('type', type); - return addElement(elt, this); - }; - /** - * Creates an `<input></input>` element of type `'file'`. - * This allows users to select local files for use in a sketch. - * - * The first parameter, `callback`, is a function that's called when the file - * loads. The callback function should have one parameter, `file`, that's a - * p5.File object. - * - * The second parameter, `multiple`, is optional. It's a boolean value that - * allows loading multiple files if set to `true`. If `true`, `callback` - * will be called once per file. - * - * @method createFileInput - * @param {Function} callback function to call once the file loads. - * @param {Boolean} [multiple] allow multiple files to be selected. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * // Use the file input to select an image to - * // load and display. - * let input; - * let img; - * - * function setup() { - * // Create a file input and place it beneath - * // the canvas. - * input = createFileInput(handleImage); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); - * } - * - * function draw() { - * background(200); - * - * // Draw the image if loaded. - * if (img) { - * image(img, 0, 0, width, height); - * } - * } - * - * // Create an image if the file is an image. - * function handleImage(file) { - * if (file.type === 'image') { - * img = createImg(file.data, ''); - * img.hide(); - * } else { - * img = null; - * } - * } - * - *
                - * - *
                - * - * // Use the file input to select multiple images - * // to load and display. - * let input; - * let images = []; - * - * function setup() { - * // Create a file input and place it beneath - * // the canvas. Allow it to load multiple files. - * input = createFileInput(handleImage, true); - * input.position(0, 100); - * } - * - * function draw() { - * background(200); - * - * // Draw the images if loaded. Each image - * // is drawn 20 pixels lower than the - * // previous image. - * images.forEach((img, index) => { - * let y = index * 20; - * image(img, 0, y, width, height); - * }); - * - * describe('A gray square with a file input beneath it. If the user selects multiple image files to load, they are displayed on the square.'); - * } - * - * // Create an image if the file is an image, - * // then add it to the images array. - * function handleImage(file) { - * if (file.type === 'image') { - * let img = createImg(file.data, ''); - * img.hide(); - * images.push(img); - * } - * } - * - *
                - */ - _main.default.prototype.createFileInput = function (callback) { - var multiple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - _main.default._validateParameters('createFileInput', arguments); - var handleFileSelect = function handleFileSelect(event) { - var _iteratorNormalCompletion8 = true; - var _didIteratorError8 = false; - var _iteratorError8 = undefined; - try { - for (var _iterator8 = event.target.files[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { - var file = _step8.value; - _main.default.File._load(file, callback); - } - } catch (err) { - _didIteratorError8 = true; - _iteratorError8 = err; - } finally { - try { - if (!_iteratorNormalCompletion8 && _iterator8.return != null) { - _iterator8.return(); - } - } finally { - if (_didIteratorError8) { - throw _iteratorError8; - } - } - } - }; - // If File API's are not supported, throw Error - if (!(window.File && window.FileReader && window.FileList && window.Blob)) { - console.log('The File APIs are not fully supported in this browser. Cannot create element.'); - return; - } - var fileInput = document.createElement('input'); - fileInput.setAttribute('type', 'file'); - if (multiple) fileInput.setAttribute('multiple', true); - fileInput.addEventListener('change', handleFileSelect, false); - return addElement(fileInput, this); - }; - /** VIDEO STUFF **/ - // Helps perform similar tasks for media element methods. - function createMedia(pInst, type, src, callback) { - var elt = document.createElement(type); - // Create source elements from given sources - src = src || ''; - if (typeof src === 'string') { - src = [ - src - ]; - } - var _iteratorNormalCompletion9 = true; - var _didIteratorError9 = false; - var _iteratorError9 = undefined; - try { - for (var _iterator9 = src[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { - var mediaSource = _step9.value; - var sourceEl = document.createElement('source'); - sourceEl.setAttribute('src', mediaSource); - elt.appendChild(sourceEl); - } // If callback is provided, attach to element - - } catch (err) { - _didIteratorError9 = true; - _iteratorError9 = err; - } finally { - try { - if (!_iteratorNormalCompletion9 && _iterator9.return != null) { - _iterator9.return(); - } - } finally { - if (_didIteratorError9) { - throw _iteratorError9; - } - } - } - if (typeof callback === 'function') { - var callbackHandler = function callbackHandler() { - callback(); - elt.removeEventListener('canplaythrough', callbackHandler); - }; - elt.addEventListener('canplaythrough', callbackHandler); - } - var mediaEl = addElement(elt, pInst, true); - mediaEl.loadedmetadata = false; - // set width and height onload metadata - elt.addEventListener('loadedmetadata', function () { - mediaEl.width = elt.videoWidth; - mediaEl.height = elt.videoHeight; - // set elt width and height if not set - if (mediaEl.elt.width === 0) mediaEl.elt.width = elt.videoWidth; - if (mediaEl.elt.height === 0) mediaEl.elt.height = elt.videoHeight; - if (mediaEl.presetPlaybackRate) { - mediaEl.elt.playbackRate = mediaEl.presetPlaybackRate; - delete mediaEl.presetPlaybackRate; - } - mediaEl.loadedmetadata = true; - }); - return mediaEl; - } /** - * Creates a `<video>` element for simple audio/video playback. - * Returns a new p5.MediaElement object. - * - * Videos are shown by default. They can be hidden by calling `video.hide()` - * and drawn to the canvas using image(). - * - * The first parameter, `src`, is the path the video. If a single string is - * passed, as in `'assets/topsecret.mp4'`, a single video is loaded. An array - * of strings can be used to load the same video in different formats. For - * example, `['assets/topsecret.mp4', 'assets/topsecret.ogv', 'assets/topsecret.webm']`. - * This is useful for ensuring that the video can play across different browsers with - * different capabilities. See - * MDN - * for more information about supported formats. - * - * The second parameter, `callback`, is optional. It's a function to call once - * the video is ready to play. - * - * @method createVideo - * @param {String|String[]} src path to a video file, or an array of paths for - * supporting different browsers. - * @param {Function} [callback] function to call once the video is ready to play. - * @return {p5.MediaElement} new p5.MediaElement object. - * @example - *
                - * - * function setup() { - * noCanvas(); - * - * // Load a video and add it to the page. - * // Note: this may not work in some browsers. - * let video = createVideo('assets/small.mp4'); - * // Show the default video controls. - * video.showControls(); - * - * describe('A video of a toy robot with playback controls beneath it.'); - * } - * - *
                - * - *
                - * - * function setup() { - * noCanvas(); - * - * // Load a video and add it to the page. - * // Provide an array options for different file formats. - * let video = createVideo( - * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'] - * ); - * // Show the default video controls. - * video.showControls(); - * - * describe('A video of a toy robot with playback controls beneath it.'); - * } - * - *
                - * - *
                - * - * let video; - * - * function setup() { - * noCanvas(); - * - * // Load a video and add it to the page. - * // Provide an array options for different file formats. - * // Call mute() once the video loads. - * video = createVideo( - * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'], - * muteVideo - * ); - * // Show the default video controls. - * video.showControls(); - * - * describe('A video of a toy robot with playback controls beneath it.'); - * } - * - * // Mute the video once it loads. - * function muteVideo() { - * video.volume(0); - * } - * - *
                - */ - - _main.default.prototype.createVideo = function (src, callback) { - _main.default._validateParameters('createVideo', arguments); - return createMedia(this, 'video', src, callback); - }; - /** AUDIO STUFF **/ - /** - * Creates a hidden `<audio>` element for simple audio playback. - * Returns a new p5.MediaElement object. - * - * The first parameter, `src`, is the path the video. If a single string is - * passed, as in `'assets/video.mp4'`, a single video is loaded. An array - * of strings can be used to load the same video in different formats. For - * example, `['assets/video.mp4', 'assets/video.ogv', 'assets/video.webm']`. - * This is useful for ensuring that the video can play across different - * browsers with different capabilities. See - * MDN - * for more information about supported formats. - * - * The second parameter, `callback`, is optional. It's a function to call once - * the audio is ready to play. - * - * @method createAudio - * @param {String|String[]} [src] path to an audio file, or an array of paths - * for supporting different browsers. - * @param {Function} [callback] function to call once the audio is ready to play. - * @return {p5.MediaElement} new p5.MediaElement object. - * @example - *
                - * - * function setup() { - * noCanvas(); - * - * // Load the audio. - * let beat = createAudio('assets/beat.mp3'); - * // Show the default audio controls. - * beat.showControls(); - * - * describe('An audio beat plays when the user double-clicks the square.'); - * } - * - *
                - */ - _main.default.prototype.createAudio = function (src, callback) { - _main.default._validateParameters('createAudio', arguments); - return createMedia(this, 'audio', src, callback); - }; - /** CAMERA STUFF **/ - _main.default.prototype.VIDEO = 'video'; - _main.default.prototype.AUDIO = 'audio'; - // from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia - // Older browsers might not implement mediaDevices at all, so we set an empty object first - if (navigator.mediaDevices === undefined) { - navigator.mediaDevices = { - }; - } // Some browsers partially implement mediaDevices. We can't just assign an object - // with getUserMedia as it would overwrite existing properties. - // Here, we will just add the getUserMedia property if it's missing. - - if (navigator.mediaDevices.getUserMedia === undefined) { - navigator.mediaDevices.getUserMedia = function (constraints) { - // First get ahold of the legacy getUserMedia, if present - var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia; - // Some browsers just don't implement it - return a rejected promise with an error - // to keep a consistent interface - if (!getUserMedia) { - return Promise.reject(new Error('getUserMedia is not implemented in this browser')); - } // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise - - return new Promise(function (resolve, reject) { - getUserMedia.call(navigator, constraints, resolve, reject); - }); - }; - } /** - * Creates a `<video>` element that "captures" the audio/video stream from - * the webcam and microphone. Returns a new - * p5.Element object. - * - * Videos are shown by default. They can be hidden by calling `capture.hide()` - * and drawn to the canvas using image(). - * - * The first parameter, `type`, is optional. It sets the type of capture to - * use. By default, `createCapture()` captures both audio and video. If `VIDEO` - * is passed, as in `createCapture(VIDEO)`, only video will be captured. - * If `AUDIO` is passed, as in `createCapture(AUDIO)`, only audio will be - * captured. A constraints object can also be passed to customize the stream. - * See the - * W3C documentation for possible properties. Different browsers support different - * properties. - * - * The second parameter, `callback`, is optional. It's a function to call once - * the capture is ready for use. The callback function should have one - * parameter, `stream`, that's a - * MediaStream object. - * - * Note: `createCapture()` only works when running a sketch locally or using HTTPS. Learn more - * here - * and here. - * - * @method createCapture - * @param {String|Constant|Object} [type] type of capture, either AUDIO or VIDEO, - * or a constraints object. Both video and audio - * audio streams are captured by default. - * @param {Function} [callback] function to call once the stream - * has loaded. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * noCanvas(); - * createCapture(VIDEO); - * - * describe('A video stream from the webcam.'); - * } - * - *
                - * - *
                - * - * let capture; - * - * function setup() { - * // Create the video capture and hide the element. - * capture = createCapture(VIDEO); - * capture.hide(); - * - * describe('A video stream from the webcam with inverted colors.'); - * } - * - * function draw() { - * // Draw the video capture within the canvas. - * image(capture, 0, 0, width, width * capture.height / capture.width); - * // Invert the colors in the stream. - * filter(INVERT); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(480, 120); - * - * // Create a constraints object. - * let constraints = { - * video: { - * mandatory: { - * minWidth: 1280, - * minHeight: 720 - * }, - * optional: [{ maxFrameRate: 10 }] - * }, - * audio: false - * }; - * - * // Create the video capture. - * createCapture(constraints); - * - * describe('A video stream from the webcam.'); - * } - * - *
                - */ - - _main.default.prototype.createCapture = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('createCapture', args); - // return if getUserMedia is not supported by browser - if (!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia)) { - throw new DOMException('getUserMedia not supported in this browser'); - } - var useVideo = true; - var useAudio = true; - var constraints; - var callback; - for (var _i2 = 0, _args = args; _i2 < _args.length; _i2++) { - var arg = _args[_i2]; - if (arg === _main.default.prototype.VIDEO) useAudio = false; - else if (arg === _main.default.prototype.AUDIO) useVideo = false; - else if (_typeof(arg) === 'object') constraints = arg; - else if (typeof arg === 'function') callback = arg; - } - if (!constraints) constraints = { - video: useVideo, - audio: useAudio - }; - var domElement = document.createElement('video'); - // required to work in iOS 11 & up: - domElement.setAttribute('playsinline', ''); - navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { - try { - if ('srcObject' in domElement) { - domElement.srcObject = stream; - } else { - domElement.src = window.URL.createObjectURL(stream); - } - } catch (err) { - domElement.src = stream; - } - }, console.log); - var videoEl = addElement(domElement, this, true); - videoEl.loadedmetadata = false; - // set width and height onload metadata - domElement.addEventListener('loadedmetadata', function () { - domElement.play(); - if (domElement.width) { - videoEl.width = domElement.width; - videoEl.height = domElement.height; - } else { - videoEl.width = videoEl.elt.width = domElement.videoWidth; - videoEl.height = videoEl.elt.height = domElement.videoHeight; - } - videoEl.loadedmetadata = true; - if (callback) callback(domElement.srcObject); - }); - return videoEl; - }; - /** - * Creates a new p5.Element object. - * - * The first parameter, `tag`, is a string an HTML tag such as `'h5'`. - * - * The second parameter, `content`, is optional. It's a string that sets the - * HTML content to insert into the new element. New elements have no content - * by default. - * - * @method createElement - * @param {String} tag tag for the new element. - * @param {String} [content] HTML content to insert into the element. - * @return {p5.Element} new p5.Element object. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create an h5 element with nothing in it. - * createElement('h5'); - * - * describe('A gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create an h5 element with the content - * // "p5*js". - * let h5 = createElement('h5', 'p5*js'); - * // Set the element's style and position. - * h5.style('color', 'deeppink'); - * h5.position(30, 15); - * - * describe('The text "p5*js" written in pink in the middle of a gray square.'); - * } - * - *
                - */ - _main.default.prototype.createElement = function (tag, content) { - _main.default._validateParameters('createElement', arguments); - var elt = document.createElement(tag); - if (typeof content !== 'undefined') { - elt.innerHTML = content; - } - return addElement(elt, this); - }; - // ============================================================================= - // p5.Element additions - // ============================================================================= - /** - * - * Adds specified class to the element. - * - * @for p5.Element - * @method addClass - * @param {String} class name of class to add - * @chainable - * @example - *
                - * let div = createDiv('div'); - * div.addClass('myClass'); - *
                - */ - _main.default.Element.prototype.addClass = function (c) { - if (this.elt.className) { - if (!this.hasClass(c)) { - this.elt.className = this.elt.className + ' ' + c; - } - } else { - this.elt.className = c; - } - return this; - }; - /** - * - * Removes specified class from the element. - * - * @method removeClass - * @param {String} class name of class to remove - * @chainable - * @example - *
                - * // In this example, a class is set when the div is created - * // and removed when mouse is pressed. This could link up - * // with a CSS style rule to toggle style properties. - * - * let div; - * - * function setup() { - * div = createDiv('div'); - * div.addClass('myClass'); - * } - * - * function mousePressed() { - * div.removeClass('myClass'); - * } - *
                - */ - _main.default.Element.prototype.removeClass = function (c) { - // Note: Removing a class that does not exist does NOT throw an error in classList.remove method - this.elt.classList.remove(c); - return this; - }; - /** - * - * Checks if specified class is already applied to element. - * - * @method hasClass - * @returns {boolean} a boolean value if element has specified class - * @param c {String} class name of class to check - * @example - *
                - * let div; - * - * function setup() { - * div = createDiv('div'); - * div.addClass('show'); - * } - * - * function mousePressed() { - * if (div.hasClass('show')) { - * div.addClass('show'); - * } else { - * div.removeClass('show'); - * } - * } - *
                - */ - _main.default.Element.prototype.hasClass = function (c) { - return this.elt.classList.contains(c); - }; - /** - * - * Toggles element class. - * - * @method toggleClass - * @param c {String} class name to toggle - * @chainable - * @example - *
                - * let div; - * - * function setup() { - * div = createDiv('div'); - * div.addClass('show'); - * } - * - * function mousePressed() { - * div.toggleClass('show'); - * } - *
                - */ - _main.default.Element.prototype.toggleClass = function (c) { - // classList also has a toggle() method, but we cannot use that yet as support is unclear. - // See https://github.com/processing/p5.js/issues/3631 - // this.elt.classList.toggle(c); - if (this.elt.classList.contains(c)) { - this.elt.classList.remove(c); - } else { - this.elt.classList.add(c); - } - return this; - }; - /** - * - * Attaches the element as a child to the parent specified. - * Accepts either a string ID, DOM node, or p5.Element. - * If no argument is specified, an array of children DOM nodes is returned. - * - * @method child - * @returns {Node[]} an array of child nodes - * @example - *
                - * let div0 = createDiv('this is the parent'); - * let div1 = createDiv('this is the child'); - * div0.child(div1); // use p5.Element - *
                - *
                - * let div0 = createDiv('this is the parent'); - * let div1 = createDiv('this is the child'); - * div1.id('apples'); - * div0.child('apples'); // use id - *
                - *
                - * // this example assumes there is a div already on the page - * // with id "myChildDiv" - * let div0 = createDiv('this is the parent'); - * let elt = document.getElementById('myChildDiv'); - * div0.child(elt); // use element from page - *
                - */ - /** - * @method child - * @param {String|p5.Element} [child] the ID, DOM node, or p5.Element - * to add to the current element - * @chainable - */ - _main.default.Element.prototype.child = function (childNode) { - if (typeof childNode === 'undefined') { - return this.elt.childNodes; - } - if (typeof childNode === 'string') { - if (childNode[0] === '#') { - childNode = childNode.substring(1); - } - childNode = document.getElementById(childNode); - } else if (childNode instanceof _main.default.Element) { - childNode = childNode.elt; - } - if (childNode instanceof HTMLElement) { - this.elt.appendChild(childNode); - } - return this; - }; - /** - * Centers a p5.Element either vertically, horizontally, - * or both, relative to its parent or according to - * the body if the p5.Element has no parent. If no argument is passed - * the p5.Element is aligned both vertically and horizontally. - * - * @method center - * @param {String} [align] passing 'vertical', 'horizontal' aligns element accordingly - * @chainable - * - * @example - *
                - * function setup() { - * let div = createDiv('').size(10, 10); - * div.style('background-color', 'orange'); - * div.center(); - * } - *
                - */ - _main.default.Element.prototype.center = function (align) { - var style = this.elt.style.display; - var hidden = this.elt.style.display === 'none'; - var parentHidden = this.parent().style.display === 'none'; - var pos = { - x: this.elt.offsetLeft, - y: this.elt.offsetTop - }; - if (hidden) this.show(); - if (parentHidden) this.parent().show(); - this.elt.style.display = 'block'; - this.position(0, 0); - var wOffset = Math.abs(this.parent().offsetWidth - this.elt.offsetWidth); - var hOffset = Math.abs(this.parent().offsetHeight - this.elt.offsetHeight); - if (align === 'both' || align === undefined) { - this.position(wOffset / 2 + this.parent().offsetLeft, hOffset / 2 + this.parent().offsetTop); - } else if (align === 'horizontal') { - this.position(wOffset / 2 + this.parent().offsetLeft, pos.y); - } else if (align === 'vertical') { - this.position(pos.x, hOffset / 2 + this.parent().offsetTop); - } - this.style('display', style); - if (hidden) this.hide(); - if (parentHidden) this.parent().hide(); - return this; - }; - /** - * - * If an argument is given, sets the inner HTML of the element, - * replacing any existing HTML. If true is included as a second - * argument, HTML is appended instead of replacing existing HTML. - * If no arguments are given, returns - * the inner HTML of the element. - * - * @for p5.Element - * @method html - * @returns {String} the inner HTML of the element - * @example - *
                - * let div = createDiv('').size(100, 100); - * div.html('hi'); - *
                - *
                - * let div = createDiv('Hello ').size(100, 100); - * div.html('World', true); - *
                - */ - /** - * @method html - * @param {String} [html] the HTML to be placed inside the element - * @param {boolean} [append] whether to append HTML to existing - * @chainable - */ - _main.default.Element.prototype.html = function () { - if (arguments.length === 0) { - return this.elt.innerHTML; - } else if (arguments.length <= 1 ? undefined : arguments[1]) { - this.elt.insertAdjacentHTML('beforeend', arguments.length <= 0 ? undefined : arguments[0]); - return this; - } else { - this.elt.innerHTML = arguments.length <= 0 ? undefined : arguments[0]; - return this; - } - }; - /** - * - * Sets the position of the element. If no position type argument is given, the - * position will be relative to (0, 0) of the window. - * Essentially, this sets position:absolute and left and top - * properties of style. If an optional third argument specifying position type is given, - * the x and y-coordinates will be interpreted based on the positioning scheme. - * If no arguments given, the function returns the x and y position of the element. - * - * found documentation on how to be more specific with object type - * https://stackoverflow.com/questions/14714314/how-do-i-comment-object-literals-in-yuidoc - * - * @method position - * @returns {Object} object of form { x: 0, y: 0 } containing the position of the element in an object - * @example - *
                - * function setup() { - * let cnv = createCanvas(100, 100); - * // positions canvas 50px to the right and 100px - * // below upper left corner of the window - * cnv.position(50, 100); - * } - *
                - *
                - * function setup() { - * let cnv = createCanvas(100, 100); - * // positions canvas at upper left corner of the window - * // with a 'fixed' position type - * cnv.position(0, 0, 'fixed'); - * } - *
                - */ - /** - * @method position - * @param {Number} [x] x-position relative to upper left of window (optional) - * @param {Number} [y] y-position relative to upper left of window (optional) - * @param {String} [positionType] it can be static, fixed, relative, sticky, initial or inherit (optional) - * @chainable - */ - _main.default.Element.prototype.position = function () { - if (arguments.length === 0) { - return { - x: this.elt.offsetLeft, - y: this.elt.offsetTop - }; - } else { - var positionType = 'absolute'; - if ((arguments.length <= 2 ? undefined : arguments[2]) === 'static' || (arguments.length <= 2 ? undefined : arguments[2]) === 'fixed' || (arguments.length <= 2 ? undefined : arguments[2]) === 'relative' || (arguments.length <= 2 ? undefined : arguments[2]) === 'sticky' || (arguments.length <= 2 ? undefined : arguments[2]) === 'initial' || (arguments.length <= 2 ? undefined : arguments[2]) === 'inherit') { - positionType = arguments.length <= 2 ? undefined : arguments[2]; - } - this.elt.style.position = positionType; - this.elt.style.left = (arguments.length <= 0 ? undefined : arguments[0]) + 'px'; - this.elt.style.top = (arguments.length <= 1 ? undefined : arguments[1]) + 'px'; - this.x = arguments.length <= 0 ? undefined : arguments[0]; - this.y = arguments.length <= 1 ? undefined : arguments[1]; - return this; - } - }; - /* Helper method called by p5.Element.style() */ - _main.default.Element.prototype._translate = function () { - this.elt.style.position = 'absolute'; - // save out initial non-translate transform styling - var transform = ''; - if (this.elt.style.transform) { - transform = this.elt.style.transform.replace(/translate3d\(.*\)/g, ''); - transform = transform.replace(/translate[X-Z]?\(.*\)/g, ''); - } - if (arguments.length === 2) { - this.elt.style.transform = 'translate(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'px, ' + (arguments.length <= 1 ? undefined : arguments[1]) + 'px)'; - } else if (arguments.length > 2) { - this.elt.style.transform = 'translate3d(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'px,' + (arguments.length <= 1 ? undefined : arguments[1]) + 'px,' + (arguments.length <= 2 ? undefined : arguments[2]) + 'px)'; - if (arguments.length === 3) { - this.elt.parentElement.style.perspective = '1000px'; - } else { - this.elt.parentElement.style.perspective = (arguments.length <= 3 ? undefined : arguments[3]) + 'px'; - } - } // add any extra transform styling back on end - - this.elt.style.transform += transform; - return this; - }; - /* Helper method called by p5.Element.style() */ - _main.default.Element.prototype._rotate = function () { - // save out initial non-rotate transform styling - var transform = ''; - if (this.elt.style.transform) { - transform = this.elt.style.transform.replace(/rotate3d\(.*\)/g, ''); - transform = transform.replace(/rotate[X-Z]?\(.*\)/g, ''); - } - if (arguments.length === 1) { - this.elt.style.transform = 'rotate(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'deg)'; - } else if (arguments.length === 2) { - this.elt.style.transform = 'rotate(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'deg, ' + (arguments.length <= 1 ? undefined : arguments[1]) + 'deg)'; - } else if (arguments.length === 3) { - this.elt.style.transform = 'rotateX(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'deg)'; - this.elt.style.transform += 'rotateY(' + (arguments.length <= 1 ? undefined : arguments[1]) + 'deg)'; - this.elt.style.transform += 'rotateZ(' + (arguments.length <= 2 ? undefined : arguments[2]) + 'deg)'; - } // add remaining transform back on - - this.elt.style.transform += transform; - return this; - }; - /** - * Applies a style to an element by adding a - * CSS declaration. - * - * The first parameter, `property`, is a string. If the name of a style - * property is passed, as in `myElement.style('color')`, the method returns - * the current value as a string or `null` if it hasn't been set. If a - * `property:style` string is passed, as in - * `myElement.style('color:deeppink')`, the method sets `property` to - * `value`. - * - * The second parameter, `value`, is optional. It sets the property's value. - * `value` can be a string, as in - * `myElement.style('color', 'deeppink')`, or a - * p5.Color object, as in - * `myElement.style('color', myColor)`. - * - * @method style - * @param {String} property style property to set. - * @returns {String} value of the property. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a paragraph element and - * // set its font color to "deeppink". - * let p = createP('p5*js'); - * p.position(25, 20); - * p.style('color', 'deeppink'); - * - * describe('The text p5*js written in pink on a gray background.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create a p5.Color object. - * let c = color('deeppink'); - * - * // Create a paragraph element and - * // set its font color using a - * // p5.Color object. - * let p = createP('p5*js'); - * p.position(25, 20); - * p.style('color', c); - * - * describe('The text p5*js written in pink on a gray background.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create a paragraph element and - * // set its font color to "deeppink" - * // using property:value syntax. - * let p = createP('p5*js'); - * p.position(25, 20); - * p.style('color:deeppink'); - * - * describe('The text p5*js written in pink on a gray background.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create an empty paragraph element - * // and set its font color to "deeppink". - * let p = createP(); - * p.position(5, 5); - * p.style('color', 'deeppink'); - * - * // Get the element's color as an - * // RGB color string. - * let c = p.style('color'); - * - * // Set the element's inner HTML - * // using the RGB color string. - * p.html(c); - * - * describe('The text "rgb(255, 20, 147)" written in pink on a gray background.'); - * } - * - *
                - */ - /** - * @method style - * @param {String} property - * @param {String|p5.Color} value value to assign to the property. - * @return {String} value of the property. - * @chainable - */ - _main.default.Element.prototype.style = function (prop, val) { - var self = this; - if (val instanceof _main.default.Color) { - val = 'rgba(' + val.levels[0] + ',' + val.levels[1] + ',' + val.levels[2] + ',' + val.levels[3] / 255 + ')'; - } - if (typeof val === 'undefined') { - if (prop.indexOf(':') === - 1) { - // no value set, so assume requesting a value - var styles = window.getComputedStyle(self.elt); - var style = styles.getPropertyValue(prop); - return style; - } else { - // value set using `:` in a single line string - var attrs = prop.split(';'); - for (var i = 0; i < attrs.length; i++) { - var parts = attrs[i].split(':'); - if (parts[0] && parts[1]) { - this.elt.style[parts[0].trim()] = parts[1].trim(); - } - } - } - } else { - // input provided as key,val pair - this.elt.style[prop] = val; - if (prop === 'width' || prop === 'height' || prop === 'left' || prop === 'top') { - var _styles = window.getComputedStyle(self.elt); - var styleVal = _styles.getPropertyValue(prop); - var numVal = styleVal.replace(/[^\d.]/g, ''); - this[prop] = Math.round(parseFloat(numVal, 10)); - } - } - return this; - }; - /** - * Adds an - * attribute - * to the element. This method is useful for advanced tasks. - * - * Most commonly-used attributes, such as `id`, can be set with their - * dedicated methods. For example, `nextButton.id('next')` sets an element's - * `id` attribute. - * - * The first parameter, `attr`, is the attribute's name as a string. Calling - * `myElement.attribute('align')` returns the attribute's current value as a - * string or `null` if it hasn't been set. - * - * The second parameter, `value`, is optional. It's a string used to set the - * attribute's value. For example, calling - * `myElement.attribute('align', 'center')` sets the element's horizontal - * alignment to `center`. - * - * @method attribute - * @return {String} value of the attribute. - * - * @example - *
                - * - * function setup() { - * // Create a container div and - * // place it at the top-left - * // corner. - * let container = createDiv(); - * container.position(0, 0); - * - * // Create a paragraph element - * // and place it within the container. - * // Set its horizontal alignment to - * // "left". - * let p1 = createP('hi'); - * p1.parent(container); - * p1.attribute('align', 'left'); - * - * // Create a paragraph element - * // and place it within the container. - * // Set its horizontal alignment to - * // "center". - * let p2 = createP('hi'); - * p2.parent(container); - * p2.attribute('align', 'center'); - * - * // Create a paragraph element - * // and place it within the container. - * // Set its horizontal alignment to - * // "right". - * let p3 = createP('hi'); - * p3.parent(container); - * p3.attribute('align', 'right'); - * - * describe('A gray square with the text "hi" written on three separate lines, each placed further to the right.'); - * } - * - *
                - */ - /** - * @method attribute - * @param {String} attr attribute to set. - * @param {String} value value to assign to the attribute. - * @chainable - */ - _main.default.Element.prototype.attribute = function (attr, value) { - //handling for checkboxes and radios to ensure options get - //attributes not divs - if (this.elt.firstChild != null && (this.elt.firstChild.type === 'checkbox' || this.elt.firstChild.type === 'radio')) { - if (typeof value === 'undefined') { - return this.elt.firstChild.getAttribute(attr); - } else { - for (var i = 0; i < this.elt.childNodes.length; i++) { - this.elt.childNodes[i].setAttribute(attr, value); - } - } - } else if (typeof value === 'undefined') { - return this.elt.getAttribute(attr); - } else { - this.elt.setAttribute(attr, value); - return this; - } - }; - /** - * Removes an attribute from the element. - * - * The parameter `attr` is the attribute's name as a string. For example, - * calling `myElement.removeAttribute('align')` removes its `align` - * attribute if it's been set. - * - * @method removeAttribute - * @param {String} attr attribute to remove. - * @chainable - * - * @example - *
                - * - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element and place it - * // in the center of the canvas. - * // Set its "align" attribute to "center". - * p = createP('hi'); - * p.position(0, 20); - * p.attribute('align', 'center'); - * - * describe('The text "hi" written in black at the center of a gray square. The text moves to the left edge when double-clicked.'); - * } - * - * function doubleClicked() { - * p.removeAttribute('align'); - * } - * - *
                - */ - _main.default.Element.prototype.removeAttribute = function (attr) { - if (this.elt.firstChild != null && (this.elt.firstChild.type === 'checkbox' || this.elt.firstChild.type === 'radio')) { - for (var i = 0; i < this.elt.childNodes.length; i++) { - this.elt.childNodes[i].removeAttribute(attr); - } - } - this.elt.removeAttribute(attr); - return this; - }; - /** - * Returns or sets the element's value. - * - * Calling `myElement.value()` returns the element's current value. - * - * The parameter, `value`, is an optional number or string. If provided, - * as in `myElement.value(123)`, it's used to set the element's value. - * - * @method value - * @return {String|Number} value of the element. - * @example - *
                - * - * let inp; - * - * function setup() { - * // Create a text input and place it - * // beneath the canvas. Set its default - * // value to "hello". - * inp = createInput('hello'); - * inp.position(0, 100); - * - * describe('The text from an input box is displayed on a gray square.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input's value to display a message. - * let msg = inp.value(); - * text(msg, 0, 55); - * } - * - *
                - * - *
                - * - * let inp; - * - * function setup() { - * // Create a text input and place it - * // beneath the canvas. Set its default - * // value to "hello". - * inp = createInput('hello'); - * inp.position(0, 100); - * - * describe('The text from an input box is displayed on a gray square. The text resets to "hello" when the user double-clicks the square.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input's value to display a message. - * let msg = inp.value(); - * text(msg, 0, 55); - * } - * - * // Reset the input's value. - * function doubleClicked() { - * inp.value('hello'); - * } - * - *
                - */ - /** - * @method value - * @param {String|Number} value - * @chainable - */ - _main.default.Element.prototype.value = function () { - if (arguments.length > 0) { - this.elt.value = arguments.length <= 0 ? undefined : arguments[0]; - return this; - } else { - if (this.elt.type === 'range') { - return parseFloat(this.elt.value); - } else return this.elt.value; - } - }; - /** - * Shows the current element. - * - * @method show - * @chainable - * @example - *
                - * - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element and hide it. - * p = createP('p5*js'); - * p.position(10, 10); - * p.hide(); - * - * describe('A gray square. The text "p5*js" appears when the user double-clicks the square.'); - * } - * - * // Show the paragraph when double-clicked. - * function doubleClicked() { - * p.show(); - * } - * - *
                - */ - _main.default.Element.prototype.show = function () { - this.elt.style.display = 'block'; - return this; - }; - /** - * Hides the current element. - * - * @method hide - * @chainable - * @example - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element. - * p = createP('p5*js'); - * p.position(10, 10); - * - * describe('The text "p5*js" at the center of a gray square. The text disappears when the user double-clicks the square.'); - * } - * - * // Hide the paragraph when double-clicked. - * function doubleClicked() { - * p.hide(); - * } - *
                - * - */ - _main.default.Element.prototype.hide = function () { - this.elt.style.display = 'none'; - return this; - }; - /** - * Sets the element's width and height. - * - * Calling `myElement.size()` without an argument returns the element's size - * as an object with the properties `width` and `height`. For example, - * `{ width: 20, height: 10 }`. - * - * The first parameter, `width`, is optional. It's a number used to set the - * element's width. Calling `myElement.size(10)` - * - * The second parameter, 'height`, is also optional. It's a - * number used to set the element's height. For example, calling - * `myElement.size(20, 10)` sets the element's width to 20 pixels and height - * to 10 pixels. - * - * The constant `AUTO` can be used to adjust one dimension at a time while - * maintaining the aspect ratio, which is `width / height`. For example, - * consider an element that's 200 pixels wide and 100 pixels tall. Calling - * `myElement.size(20, AUTO)` sets the width to 20 pixels and height to 10 - * pixels. - * - * Note: In the case of elements that need to load data, such as images, wait - * to call `myElement.size()` until after the data loads. - * - * @method size - * @return {Object} width and height of the element in an object. - * @example - *
                - * - * function setup() { - * background(200); - * - * // Create a pink div element and place it at - * // the top-left corner. - * let div = createDiv(); - * div.position(10, 10); - * div.style('background-color', 'deeppink'); - * - * // Set the div's width to 80 pixels and - * // height to 20 pixels. - * div.size(80, 20); - * - * describe('A gray square with a pink rectangle near its top.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Create a pink div element and place it at - * // the top-left corner. - * let div = createDiv(); - * div.position(10, 10); - * div.style('background-color', 'deeppink'); - * - * // Set the div's width to 80 pixels and - * // height to 40 pixels. - * div.size(80, 40); - * - * // Get the div's size as an object. - * let s = div.size(); - * // Write the div's dimensions. - * div.html(`${s.width} x ${s.height}`); - * - * describe('A gray square with a pink rectangle near its top. The text "80 x 40" is written within the rectangle.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * // Load an image of an astronaut on the moon - * // and place it at the top-left of the canvas. - * let img1 = createImg( - * 'assets/moonwalk.jpg', - * 'An astronaut walking on the moon', - * '' - * ); - * img1.position(0, 0); - * - * // Load an image of an astronaut on the moon - * // and place it at the top-left of the canvas. - * // Resize the image once it's loaded. - * let img2 = createImg( - * 'assets/moonwalk.jpg', - * 'An astronaut walking on the moon', - * '', - * () => { - * img2.size(50, AUTO); - * } - * ); - * img2.position(0, 0); - * - * describe('A gray square two copies of a space image at the top-left. The copy in front is smaller.'); - * } - * - *
                - */ - /** - * @method size - * @param {Number|Constant} w width of the element, either AUTO, or a number. - * @param {Number|Constant} [h] height of the element, either AUTO, or a number. - * @chainable - */ - _main.default.Element.prototype.size = function (w, h) { - if (arguments.length === 0) { - return { - width: this.elt.offsetWidth, - height: this.elt.offsetHeight - }; - } else { - var aW = w; - var aH = h; - var AUTO = _main.default.prototype.AUTO; - if (aW !== AUTO || aH !== AUTO) { - if (aW === AUTO) { - aW = h * this.width / this.height; - } else if (aH === AUTO) { - aH = w * this.height / this.width; - } // set diff for cnv vs normal div - - if (this.elt instanceof HTMLCanvasElement) { - var j = { - }; - var k = this.elt.getContext('2d'); - var prop; - for (prop in k) { - j[prop] = k[prop]; - } - this.elt.setAttribute('width', aW * this._pInst._pixelDensity); - this.elt.setAttribute('height', aH * this._pInst._pixelDensity); - this.elt.style.width = aW + 'px'; - this.elt.style.height = aH + 'px'; - this._pInst.scale(this._pInst._pixelDensity, this._pInst._pixelDensity); - for (prop in j) { - this.elt.getContext('2d') [prop] = j[prop]; - } - } else { - this.elt.style.width = aW + 'px'; - this.elt.style.height = aH + 'px'; - this.elt.width = aW; - this.elt.height = aH; - } - this.width = this.elt.offsetWidth; - this.height = this.elt.offsetHeight; - if (this._pInst && this._pInst._curElement) { - // main canvas associated with p5 instance - if (this._pInst._curElement.elt === this.elt) { - this._pInst._setProperty('width', this.elt.offsetWidth); - this._pInst._setProperty('height', this.elt.offsetHeight); - } - } - } - return this; - } - }; - /** - * Removes the element, stops all audio/video streams, and removes all - * callback functions. - * - * @method remove - * @example - *
                - * - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element. - * p = createP('p5*js'); - * p.position(10, 10); - * - * describe('The text "p5*js" written at the center of a gray square. '); - * } - * - * // Remove the paragraph when double-clicked. - * function doubleClicked() { - * p.remove(); - * } - * - *
                - */ - _main.default.Element.prototype.remove = function () { - // stop all audios/videos and detach all devices like microphone/camera etc - // used as input/output for audios/videos. - if (this instanceof _main.default.MediaElement) { - this.stop(); - var sources = this.elt.srcObject; - if (sources !== null) { - var tracks = sources.getTracks(); - tracks.forEach(function (track) { - track.stop(); - }); - } - } // delete the reference in this._pInst._elements - - var index = this._pInst._elements.indexOf(this); - if (index !== - 1) { - this._pInst._elements.splice(index, 1); - } // deregister events - - for (var ev in this._events) { - this.elt.removeEventListener(ev, this._events[ev]); - } - if (this.elt && this.elt.parentNode) { - this.elt.parentNode.removeChild(this.elt); - } - }; - /** - * Sets a function to call when the user drops a file on the element. - * - * The first parameter, `callback`, is a function to call once the file loads. - * The callback function should have one parameter, `file`, that's a - * p5.File object. If the user drops multiple files on - * the element, `callback`, is called once for each file. - * - * The second parameter, `fxn`, is a function to call when the browser detects - * one or more dropped files. The callback function should have one - * parameter, `event`, that's a - * DragEvent. - * - * @method drop - * @param {Function} callback called when a file loads. Called once for each file dropped. - * @param {Function} [fxn] called once when any files are dropped. - * @chainable - * @example - *
                - * - * // Drop an image on the canvas to view - * // this example. - * let img; - * - * function setup() { - * let c = createCanvas(100, 100); - * - * background(200); - * - * // Call a function when a file - * // dropped on the canvas has - * // loaded. - * c.drop(file => { - * // Remove the current image, if any. - * if (img) { - * img.remove(); - * } - * - * // Create an element with the - * // dropped file. - * img = createImg(file.data, ''); - * img.hide(); - * - * // Draw the image. - * image(img, 0, 0, width, height); - * }); - * - * describe('A gray square. When the user drops an image on the square, it is displayed.'); - * } - * - *
                - * - *
                - * - * // Drop an image on the canvas to view - * // this example. - * let img; - * let msg; - * - * function setup() { - * let c = createCanvas(100, 100); - * - * background(200); - * - * // Call functions when the user - * // drops a file on the canvas - * // and when the file loads. - * c.drop(handleFile, handleDrop); - * - * describe('A gray square. When the user drops an image on the square, it is displayed. The id attribute of canvas element is also displayed.'); - * } - * - * function handleFile(file) { - * // Remove the current image, if any. - * if (img) { - * img.remove(); - * } - * - * // Create an element with the - * // dropped file. - * img = createImg(file.data, ''); - * img.hide(); - * - * // Draw the image. - * image(img, 0, 0, width, height); - * } - * - * function handleDrop(event) { - * // Remove current paragraph, if any. - * if (msg) { - * msg.remove(); - * } - * - * // Use event to get the drop - * // target's id. - * let id = event.target.id; - * - * // Write the canvas' id - * // beneath it. - * msg = createP(id); - * msg.position(0, 100); - * - * // Set the font color - * // randomly for each drop. - * let c = random(['red', 'green', 'blue']); - * msg.style('color', c); - * msg.style('font-size', '12px'); - * } - * - *
                - */ - _main.default.Element.prototype.drop = function (callback, fxn) { - // Is the file stuff supported? - if (window.File && window.FileReader && window.FileList && window.Blob) { - if (!this._dragDisabled) { - this._dragDisabled = true; - var preventDefault = function preventDefault(evt) { - evt.preventDefault(); - }; - // If you want to be able to drop you've got to turn off - // a lot of default behavior. - // avoid `attachListener` here, since it overrides other handlers. - this.elt.addEventListener('dragover', preventDefault); - // If this is a drag area we need to turn off the default behavior - this.elt.addEventListener('dragleave', preventDefault); - } // Deal with the files - - _main.default.Element._attachListener('drop', function (evt) { - evt.preventDefault(); - // Call the second argument as a callback that receives the raw drop event - if (typeof fxn === 'function') { - fxn.call(this, evt); - } // A FileList - - var files = evt.dataTransfer.files; - // Load each one and trigger the callback - var _iteratorNormalCompletion10 = true; - var _didIteratorError10 = false; - var _iteratorError10 = undefined; - try { - for (var _iterator10 = files[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { - var f = _step10.value; - _main.default.File._load(f, callback); - } - } catch (err) { - _didIteratorError10 = true; - _iteratorError10 = err; - } finally { - try { - if (!_iteratorNormalCompletion10 && _iterator10.return != null) { - _iterator10.return(); - } - } finally { - if (_didIteratorError10) { - throw _iteratorError10; - } - } - } - }, this); - } else { - console.log('The File APIs are not fully supported in this browser.'); - } - return this; - }; - /** - * Turns p5.Element into a draggable item. If an argument is given, it will drag that p5.Element instead, ie. drag a entire GUI panel (parent container) with the panel's title bar. - * - * @method draggable - * @param {p5.Element} [elmnt] pass another p5.Element - * @chainable - * - * @example - *
                - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * createDiv('Post-It') - * .position(5, 5) - * .size(75, 20) - * .style('font-size', '16px') - * .style('background', 'yellow') - * .style('color', '#000') - * .style('border', '1px solid #aaaa00') - * .style('padding', '5px') - * .draggable(); - * // .style('cursor', 'help') // override cursor - * - * let gui = createDiv('') - * .position(5, 40) - * .size(85, 50) - * .style('font-size', '16px') - * .style('background', 'yellow') - * .style('z-index', '100') - * .style('border', '1px solid #00aaaa'); - * - * createDiv('= PANEL =') - * .parent(gui) - * .style('background', 'cyan') - * .style('padding', '2px') - * .style('text-align', 'center') - * .draggable(gui); - * - * createSlider(0, 100, random(100)) - * .style('cursor', 'pointer') - * .size(80, 5) - * .parent(gui); - * } - *
                - */ - _main.default.Element.prototype.draggable = function (elmMove) { - var isTouch = ('ontouchstart' in window); - var x = 0, - y = 0, - px = 0, - py = 0, - elmDrag, - dragMouseDownEvt = isTouch ? 'touchstart' : 'mousedown', - closeDragElementEvt = isTouch ? 'touchend' : 'mouseup', - elementDragEvt = isTouch ? 'touchmove' : 'mousemove'; - if (elmMove === undefined) { - elmMove = this.elt; - elmDrag = elmMove; - } else if (elmMove !== this.elt && elmMove.elt !== this.elt) { - elmMove = elmMove.elt; - elmDrag = this.elt; - } - elmDrag.addEventListener(dragMouseDownEvt, dragMouseDown, false); - elmDrag.style.cursor = 'move'; - function dragMouseDown(e) { - e = e || window.event; - if (isTouch) { - var touches = e.changedTouches; - px = parseInt(touches[0].clientX); - py = parseInt(touches[0].clientY); - } else { - px = parseInt(e.clientX); - py = parseInt(e.clientY); - } - document.addEventListener(closeDragElementEvt, closeDragElement, false); - document.addEventListener(elementDragEvt, elementDrag, false); - return false; - } - function elementDrag(e) { - e = e || window.event; - if (isTouch) { - var touches = e.changedTouches; - x = px - parseInt(touches[0].clientX); - y = py - parseInt(touches[0].clientY); - px = parseInt(touches[0].clientX); - py = parseInt(touches[0].clientY); - } else { - x = px - parseInt(e.clientX); - y = py - parseInt(e.clientY); - px = parseInt(e.clientX); - py = parseInt(e.clientY); - } - elmMove.style.left = elmMove.offsetLeft - x + 'px'; - elmMove.style.top = elmMove.offsetTop - y + 'px'; - } - function closeDragElement() { - document.removeEventListener(closeDragElementEvt, closeDragElement, false); - document.removeEventListener(elementDragEvt, elementDrag, false); - } - return this; - }; - /*** SCHEDULE EVENTS ***/ - // Cue inspired by JavaScript setTimeout, and the - // Tone.js Transport Timeline Event, MIT License Yotam Mann 2015 tonejs.org - // eslint-disable-next-line no-unused-vars - var Cue = function Cue(callback, time, id, val) { - _classCallCheck(this, Cue); - this.callback = callback; - this.time = time; - this.id = id; - this.val = val; - }; // ============================================================================= - // p5.MediaElement additions - // ============================================================================= - /** - * A class to handle audio and video. - * - * `p5.MediaElement` extends p5.Element with - * methods to handle audio and video. `p5.MediaElement` objects are created by - * calling createVideo, - * createAudio, and - * createCapture. - * - * @class p5.MediaElement - * @constructor - * @param {String} elt DOM node that is wrapped - * @extends p5.Element - * @example - *
                - * - * let capture; - * - * function setup() { - * createCanvas(100, 100); - * - * // Create a p5.MediaElement using createCapture(). - * capture = createCapture(VIDEO); - * capture.hide(); - * } - * - * function draw() { - * // Display the video stream and invert the colors. - * image(capture, 0, 0, width, width * capture.height / capture.width); - * filter(INVERT); - * } - * - *
                - */ - var MediaElement = /*#__PURE__*/ function (_p5$Element) { - _inherits(MediaElement, _p5$Element); - var _super = _createSuper(MediaElement); - function MediaElement(elt, pInst) { - var _this; - _classCallCheck(this, MediaElement); - _this = _super.call(this, elt, pInst); - var self = _assertThisInitialized(_this); - _this.elt.crossOrigin = 'anonymous'; - _this._prevTime = 0; - _this._cueIDCounter = 0; - _this._cues = [ - ]; - _this.pixels = [ - ]; - _this._pixelsState = _assertThisInitialized(_this); - _this._pixelDensity = 1; - _this._modified = false; - // Media has an internal canvas that is used when drawing it to the main - // canvas. It will need to be updated each frame as the video itself plays. - // We don't want to update it every time we draw, however, in case the user - // has used load/updatePixels. To handle this, we record the frame drawn to - // the internal canvas so we only update it if the frame has changed. - _this._frameOnCanvas = - 1; - /** - * Path to the media element's source as a string. - * - * @property src - * @return {String} src - * @example - *
                - * - * let beat; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "https://p5js.org/reference/assets/beat.mp3" written in black on a gray background.'); - * } - * - * function draw() { - * background(200); - * - * textWrap(CHAR); - * text(beat.src, 10, 10, 80, 80); - * } - * - *
                - */ - Object.defineProperty(self, 'src', { - get: function get() { - var firstChildSrc = self.elt.children[0].src; - var srcVal = self.elt.src === window.location.href ? '' : self.elt.src; - var ret = firstChildSrc === window.location.href ? srcVal : firstChildSrc; - return ret; - }, - set: function set(newValue) { - for (var i = 0; i < self.elt.children.length; i++) { - self.elt.removeChild(self.elt.children[i]); - } - var source = document.createElement('source'); - source.src = newValue; - elt.appendChild(source); - self.elt.src = newValue; - self.modified = true; - } - }); - // private _onended callback, set by the method: onended(callback) - self._onended = function () { - }; - self.elt.onended = function () { - self._onended(self); - }; - return _this; - } /** - * Play audio or video from a media element. - * - * @method play - * @chainable - * @example - *
                - * - * let beat; - * - * function setup() { - * background(200); - * - * textAlign(CENTER); - * text('Click to play', 50, 50); - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks the square.'); - * } - * - * // Play the beat when the user - * // presses the mouse. - * function mousePressed() { - * beat.play(); - * } - * - *
                - */ - - _createClass(MediaElement, [ - { - key: 'play', - value: function play() { - var _this2 = this; - if (this.elt.currentTime === this.elt.duration) { - this.elt.currentTime = 0; - } - var promise; - if (this.elt.readyState > 1) { - promise = this.elt.play(); - } else { - // in Chrome, playback cannot resume after being stopped and must reload - this.elt.load(); - promise = this.elt.play(); - } - if (promise && promise.catch) { - promise.catch(function (e) { - // if it's an autoplay failure error - if (e.name === 'NotAllowedError') { - if (typeof IS_MINIFIED === 'undefined') { - _main.default._friendlyAutoplayError(_this2.src); - } else { - console.error(e); - } - } else { - // any other kind of error - console.error('Media play method encountered an unexpected error', e); - } - }); - } - return this; - } /** - * Stops a media element and sets its current time to zero. Calling - * `media.play()` will restart playing audio/video from the beginning. - * - * @method stop - * @chainable - * @example - *
                - * - * let beat; - * let isStopped = true; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to start" written in black on a gray background. The beat starts or stops when the user presses the mouse.'); - * } - * - * function draw() { - * background(200); - * - * textAlign(CENTER); - * if (isStopped === true) { - * text('Click to start', 50, 50); - * } else { - * text('Click to stop', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isStopped === true) { - * // If the beat is stopped, - * // play it. - * beat.play(); - * isStopped = false; - * } else { - * // If the beat is playing, - * // stop it. - * beat.stop(); - * isStopped = true; - * } - * } - * - *
                - */ - - }, - { - key: 'stop', - value: function stop() { - this.elt.pause(); - this.elt.currentTime = 0; - return this; - } /** - * Pauses a media element. Calling `media.play()` will resume playing - * audio/video from the moment it paused. - * - * @method pause - * @chainable - * @example - *
                - * - * let beat; - * let isPaused = true; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to play" written in black on a gray background. The beat plays or pauses when the user clicks the square.'); - * } - * - * function draw() { - * background(200); - * - * // Display different instructions - * // based on playback. - * textAlign(CENTER); - * if (isPaused === true) { - * text('Click to play', 50, 50); - * } else { - * text('Click to pause', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isPaused === true) { - * // If the beat is paused, - * // play it. - * beat.play(); - * isPaused = false; - * } else { - * // If the beat is playing, - * // pause it. - * beat.pause(); - * isPaused = true; - * } - * } - * - *
                - */ - - }, - { - key: 'pause', - value: function pause() { - this.elt.pause(); - return this; - } /** - * Play the audio/video repeatedly in a loop. - * - * @method loop - * @chainable - * @example - *
                - * - * let beat; - * let isLooping = false; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to loop" written in black on a gray background. A beat plays repeatedly in a loop when the user clicks. The beat stops when the user clicks again.'); - * } - * - * function draw() { - * background(200); - * - * // Display different instructions - * // based on playback. - * textAlign(CENTER); - * if (isLooping === true) { - * text('Click to stop', 50, 50); - * } else { - * text('Click to loop', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isLooping === true) { - * // If the beat is looping, - * // stop it. - * beat.stop(); - * isLooping = false; - * } else { - * // If the beat is stopped, - * // loop it. - * beat.loop(); - * isLooping = true; - * } - * } - * - *
                - */ - - }, - { - key: 'loop', - value: function loop() { - this.elt.setAttribute('loop', true); - this.play(); - return this; - } /** - * Stops the audio/video from playing in a loop. It will stop when it - * reaches the end. - * - * @method noLoop - * @chainable - * @example - *
                - * - * let beat; - * let isPlaying = false; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks. The beat stops when the user clicks again.'); - * } - * - * function draw() { - * background(200); - * - * // Display different instructions - * // based on playback. - * textAlign(CENTER); - * if (isPlaying === true) { - * text('Click to stop', 50, 50); - * } else { - * text('Click to play', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isPlaying === true) { - * // If the beat is playing, - * // stop it. - * beat.stop(); - * isPlaying = false; - * } else { - * // If the beat is stopped, - * // play it. - * beat.play(); - * isPlaying = true; - * } - * } - * - *
                - */ - - }, - { - key: 'noLoop', - value: function noLoop() { - this.elt.removeAttribute('loop'); - return this; - } /** - * Sets up logic to check that autoplay succeeded. - * - * @method setupAutoplayFailDetection - * @private - */ - - }, - { - key: '_setupAutoplayFailDetection', - value: function _setupAutoplayFailDetection() { - var _this3 = this; - var timeout = setTimeout(function () { - if (typeof IS_MINIFIED === 'undefined') { - _main.default._friendlyAutoplayError(_this3.src); - } else { - console.error(e); - } - }, 500); - this.elt.addEventListener('play', function () { - return clearTimeout(timeout); - }, { - passive: true, - once: true - }); - } /** - * Sets the audio/video to play once it's loaded. - * - * The parameter, `shouldAutoplay`, is optional. Calling - * `media.autoplay()` without an argument causes the media to play - * automatically. If `true` is passed, as in `media.autoplay(true)`, the - * media will automatically play. If `false` is passed, as in - * `media.autoPlay(false)`, it won't play automatically. - * - * @method autoplay - * @param {Boolean} [shouldAutoplay] whether the element should autoplay. - * @chainable - * @example - *
                - * - * function setup() { - * noCanvas(); - * - * // Load a video and play it automatically. - * let video = createVideo('assets/fingers.mov', () => { - * video.autoplay(); - * video.size(100, 100); - * }); - * - * describe('A video of fingers walking on a treadmill.'); - * } - * - *
                - * - *
                - * - * function setup() { - * noCanvas(); - * - * // Load a video, but don't play it automatically. - * let video = createVideo('assets/fingers.mov', () => { - * video.autoplay(false); - * video.size(100, 100); - * }); - * - * // Play the video when the user clicks on it. - * video.mousePressed(() => { - * video.play(); - * }); - * - * describe('An image of fingers on a treadmill. They start walking when the user double-clicks on them.'); - * } - * - *
                - */ - - }, - { - key: 'autoplay', - value: function autoplay(val) { - var _this4 = this; - var oldVal = this.elt.getAttribute('autoplay'); - this.elt.setAttribute('autoplay', val); - // if we turned on autoplay - if (val && !oldVal) { - // bind method to this scope - var setupAutoplayFailDetection = function setupAutoplayFailDetection() { - return _this4._setupAutoplayFailDetection(); - }; - // if media is ready to play, schedule check now - if (this.elt.readyState === 4) { - setupAutoplayFailDetection(); - } else { - // otherwise, schedule check whenever it is ready - this.elt.addEventListener('canplay', setupAutoplayFailDetection, { - passive: true, - once: true - }); - } - } - return this; - } /** - * Manages the audio/video volume. - * - * Calling `media.volume()` without an argument returns the current volume - * as a number in the range 0 (off) to 1 (maximum). - * - * The parameter, `val`, is optional. It's a number that sets the volume - * from 0 (off) to 1 (maximum). For example, calling `media.volume(0.5)` - * sets the volume to half of its maximum. - * - * @method volume - * @return {Number} current volume. - * - * @example - *
                - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "Volume: V" on a gray square with media controls beneath it. The number "V" oscillates between 0 and 1 as the music plays.'); - * } - * - * function draw() { - * background(200); - * - * // Produce a number between 0 and 1. - * let n = 0.5 * sin(frameCount * 0.01) + 0.5; - * // Use n to set the volume. - * dragon.volume(n); - * - * // Get the current volume - * // and display it. - * let v = dragon.volume(); - * // Round v to 1 decimal place - * // for display. - * v = round(v, 1); - * textAlign(CENTER); - * text(`Volume: ${v}`, 50, 50); - * } - * - *
                - */ - /** - * @method volume - * @param {Number} val volume between 0.0 and 1.0. - * @chainable - */ - - }, - { - key: 'volume', - value: function volume(val) { - if (typeof val === 'undefined') { - return this.elt.volume; - } else { - this.elt.volume = val; - } - } /** - * Manages the audio/video playback speed. Calling `media.speed()` returns - * the current speed as a number. - * - * The parameter, `val`, is optional. It's a number that sets the playback - * speed. 1 plays the media at normal speed, 0.5 plays it at half speed, 2 - * plays it at double speed, and so on. -1 plays the media at normal speed - * in reverse. - * - * Note: Not all browsers support backward playback. Even if they do, - * playback might not be smooth. - * - * @method speed - * @return {Number} current playback speed. - * - * @example - *
                - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "Speed: S" on a gray square with media controls beneath it. The number "S" oscillates between 0 and 1 as the music plays.'); - * } - * - * function draw() { - * background(200); - * - * // Produce a number between 0 and 2. - * let n = sin(frameCount * 0.01) + 1; - * // Use n to set the playback speed. - * dragon.speed(n); - * - * // Get the current speed - * // and display it. - * let s = dragon.speed(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * textAlign(CENTER); - * text(`Speed: ${s}`, 50, 50); - * } - * - */ - /** - * @method speed - * @param {Number} speed speed multiplier for playback. - * @chainable - */ - - }, - { - key: 'speed', - value: function speed(val) { - if (typeof val === 'undefined') { - return this.presetPlaybackRate || this.elt.playbackRate; - } else { - if (this.loadedmetadata) { - this.elt.playbackRate = val; - } else { - this.presetPlaybackRate = val; - } - } - } /** - * Manages the media element's playback time. Calling `media.time()` - * returns the number of seconds the audio/video has played. Time resets to - * 0 when the looping media restarts. - * - * The parameter, `time`, is optional. It's a number that specifies the - * time, in seconds, to jump to when playback begins. - * - * @method time - * @return {Number} current time (in seconds). - * - * @example - *
                - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); - * } - * - * function draw() { - * background(200); - * - * // Display the current time. - * let s = dragon.time(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * textAlign(CENTER); - * text(`${s} seconds`, 50, 50); - * } - * - *
                - * - *
                - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * // Jump to 2 seconds - * // to start. - * dragon.time(2); - * - * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); - * } - * - * function draw() { - * background(200); - * - * // Display the current time. - * let s = dragon.time(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * textAlign(CENTER); - * text(`${s} seconds`, 50, 50); - * } - * - *
                - */ - /** - * @method time - * @param {Number} time time to jump to (in seconds). - * @chainable - */ - - }, - { - key: 'time', - value: function time(val) { - if (typeof val === 'undefined') { - return this.elt.currentTime; - } else { - this.elt.currentTime = val; - return this; - } - } /** - * Returns the audio/video's duration in seconds. - * - * @method duration - * @return {Number} duration (in seconds). - * - * @example - *
                - * - * let dragon; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "S seconds left" on a gray square with media controls beneath it. The number "S" decreases as the song plays.'); - * } - * - * function draw() { - * background(200); - * - * // Calculate the time remaining. - * let s = dragon.duration() - dragon.time(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * - * // Display the time remaining. - * textAlign(CENTER); - * text(`${s} seconds left`, 50, 50); - * } - * - *
                - */ - - }, - { - key: 'duration', - value: function duration() { - return this.elt.duration; - } - }, - { - key: '_ensureCanvas', - value: function _ensureCanvas() { - if (!this.canvas) { - this.canvas = document.createElement('canvas'); - this.drawingContext = this.canvas.getContext('2d'); - this.setModified(true); - } // Don't update the canvas again if we have already updated the canvas with - // the current frame - - var needsRedraw = this._frameOnCanvas !== this._pInst.frameCount; - if (this.loadedmetadata && needsRedraw) { - // wait for metadata for w/h - if (this.canvas.width !== this.elt.width) { - this.canvas.width = this.elt.width; - this.canvas.height = this.elt.height; - this.width = this.canvas.width; - this.height = this.canvas.height; - } - this.drawingContext.clearRect(0, 0, this.canvas.width, this.canvas.height); - this.drawingContext.drawImage(this.elt, 0, 0, this.canvas.width, this.canvas.height); - this.setModified(true); - this._frameOnCanvas = this._pInst.frameCount; - } - } - }, - { - key: 'loadPixels', - value: function loadPixels() { - this._ensureCanvas(); - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - return _main.default.Renderer2D.prototype.loadPixels.apply(this, args); - } - }, - { - key: 'updatePixels', - value: function updatePixels(x, y, w, h) { - if (this.loadedmetadata) { - // wait for metadata - this._ensureCanvas(); - _main.default.Renderer2D.prototype.updatePixels.call(this, x, y, w, h); - } - this.setModified(true); - return this; - } - }, - { - key: 'get', - value: function get() { - this._ensureCanvas(); - for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } - return _main.default.Renderer2D.prototype.get.apply(this, args); - } - }, - { - key: '_getPixel', - value: function _getPixel() { - this.loadPixels(); - for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - args[_key6] = arguments[_key6]; - } - return _main.default.Renderer2D.prototype._getPixel.apply(this, args); - } - }, - { - key: 'set', - value: function set(x, y, imgOrCol) { - if (this.loadedmetadata) { - // wait for metadata - this._ensureCanvas(); - _main.default.Renderer2D.prototype.set.call(this, x, y, imgOrCol); - this.setModified(true); - } - } - }, - { - key: 'copy', - value: function copy() { - this._ensureCanvas(); - for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { - args[_key7] = arguments[_key7]; - } - _main.default.prototype.copy.apply(this, args); - } - }, - { - key: 'mask', - value: function mask() { - this.loadPixels(); - this.setModified(true); - for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { - args[_key8] = arguments[_key8]; - } - _main.default.Image.prototype.mask.apply(this, args); - } /** - * helper method for web GL mode to figure out if the element - * has been modified and might need to be re-uploaded to texture - * memory between frames. - * @method isModified - * @private - * @return {boolean} a boolean indicating whether or not the - * image has been updated or modified since last texture upload. - */ - - }, - { - key: 'isModified', - value: function isModified() { - return this._modified; - } /** - * helper method for web GL mode to indicate that an element has been - * changed or unchanged since last upload. gl texture upload will - * set this value to false after uploading the texture; or might set - * it to true if metadata has become available but there is no actual - * texture data available yet.. - * @method setModified - * @param {boolean} val sets whether or not the element has been - * modified. - * @private - */ - - }, - { - key: 'setModified', - value: function setModified(value) { - this._modified = value; - } /** - * Calls a function when the audio/video reaches the end of its playback - * The function won't be called if the media is looping. - * - * The `p5.MediaElement` is passed as an argument to the callback function. - * - * @method onended - * @param {Function} callback function to call when playback ends. - * The `p5.MediaElement` is passed as - * the argument. - * @chainable - * @example - *
                - * - * let beat; - * let isPlaying = false; - * let isDone = false; - * - * function setup() { - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * // Set isDone to false when - * // the beat finishes. - * beat.onended(() => { - * isDone = true; - * }); - * - * describe('The text "Click to play" written in black on a gray square. A beat plays when the user clicks. The text "Done!" appears when the beat finishes playing.'); - * } - * - * function draw() { - * background(200); - * - * // Display different messages - * // based on playback. - * textAlign(CENTER); - * if (isDone === true) { - * text('Done!', 50, 50); - * } else if (isPlaying === false) { - * text('Click to play', 50, 50); - * } else { - * text('Playing...', 50, 50); - * } - * } - * - * // Play the beat when the - * // user presses the mouse. - * function mousePressed() { - * if (isPlaying === false) { - * isPlaying = true; - * beat.play(); - * } - * } - * - *
                - */ - - }, - { - key: 'onended', - value: function onended(callback) { - this._onended = callback; - return this; - } /*** CONNECT TO WEB AUDIO API / p5.sound.js ***/ - /** - * Send the audio output of this element to a specified audioNode or - * p5.sound object. If no element is provided, connects to p5's main - * output. That connection is established when this method is first called. - * All connections are removed by the .disconnect() method. - * - * This method is meant to be used with the p5.sound.js addon library. - * - * @method connect - * @param {AudioNode|Object} audioNode AudioNode from the Web Audio API, - * or an object from the p5.sound library - */ - - }, - { - key: 'connect', - value: function connect(obj) { - var audioContext, - mainOutput; - // if p5.sound exists, same audio context - if (typeof _main.default.prototype.getAudioContext === 'function') { - audioContext = _main.default.prototype.getAudioContext(); - mainOutput = _main.default.soundOut.input; - } else { - try { - audioContext = obj.context; - mainOutput = audioContext.destination; - } catch (e) { - throw 'connect() is meant to be used with Web Audio API or p5.sound.js'; - } - } // create a Web Audio MediaElementAudioSourceNode if none already exists - - if (!this.audioSourceNode) { - this.audioSourceNode = audioContext.createMediaElementSource(this.elt); - // connect to main output when this method is first called - this.audioSourceNode.connect(mainOutput); - } // connect to object if provided - - if (obj) { - if (obj.input) { - this.audioSourceNode.connect(obj.input); - } else { - this.audioSourceNode.connect(obj); - } - } else { - // otherwise connect to main output of p5.sound / AudioContext - this.audioSourceNode.connect(mainOutput); - } - } /** - * Disconnect all Web Audio routing, including to main output. - * This is useful if you want to re-route the output through - * audio effects, for example. - * - * @method disconnect - */ - - }, - { - key: 'disconnect', - value: function disconnect() { - if (this.audioSourceNode) { - this.audioSourceNode.disconnect(); - } else { - throw 'nothing to disconnect'; - } - } /*** SHOW / HIDE CONTROLS ***/ - /** - * Show the default - * HTMLMediaElement - * controls. These vary between web browser. - * - * @method showControls - * @example - *
                - * - * function setup() { - * background('cornflowerblue'); - * - * textAlign(CENTER); - * textSize(50); - * text('🐉', 50, 50); - * - * // Create a p5.MediaElement using createAudio(). - * let dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('A dragon emoji, 🐉, drawn in the center of a blue square. A song plays in the background. Audio controls are displayed beneath the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'showControls', - value: function showControls() { - // must set style for the element to show on the page - this.elt.style['text-align'] = 'inherit'; - this.elt.controls = true; - } /** - * Hide the default - * HTMLMediaElement - * controls. - * - * @method hideControls - * @example - *
                - * - * let dragon; - * let isHidden = false; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "Double-click to hide controls" written in the middle of a gray square. A song plays in the background. Audio controls are displayed beneath the canvas. The controls appear/disappear when the user double-clicks the square.'); - * } - * - * function draw() { - * background(200); - * - * // Display a different message when - * // controls are hidden or shown. - * textAlign(CENTER); - * if (isHidden === true) { - * text('Double-click to show controls', 10, 20, 80, 80); - * } else { - * text('Double-click to hide controls', 10, 20, 80, 80); - * } - * } - * - * // Show/hide controls based on a double-click. - * function doubleClicked() { - * if (isHidden === true) { - * dragon.showControls(); - * isHidden = false; - * } else { - * dragon.hideControls(); - * isHidden = true; - * } - * } - * - *
                - */ - - }, - { - key: 'hideControls', - value: function hideControls() { - this.elt.controls = false; - } /** - * Schedules a function to call when the audio/video reaches a specific time - * during its playback. - * - * The first parameter, `time`, is the time, in seconds, when the function - * should run. This value is passed to `callback` as its first argument. - * - * The second parameter, `callback`, is the function to call at the specified - * cue time. - * - * The third parameter, `value`, is optional and can be any type of value. - * `value` is passed to `callback`. - * - * Calling `media.addCue()` returns an ID as a string. This is useful for - * removing the cue later. - * - * @method addCue - * @param {Number} time cue time to run the callback function. - * @param {Function} callback function to call at the cue time. - * @param {Object} [value] object to pass as the argument to - * `callback`. - * @return {Number} id ID of this cue, - * useful for `media.removeCue(id)`. - * @example - *
                - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * let beat = createAudio('assets/beat.mp3'); - * // Play the beat in a loop. - * beat.loop(); - * - * // Schedule a few events. - * beat.addCue(0, changeBackground, 'red'); - * beat.addCue(2, changeBackground, 'deeppink'); - * beat.addCue(4, changeBackground, 'orchid'); - * beat.addCue(6, changeBackground, 'lavender'); - * - * describe('A red square with a beat playing in the background. Its color changes every 2 seconds while the audio plays.'); - * } - * - * function changeBackground(c) { - * background(c); - * } - * - *
                - */ - - }, - { - key: 'addCue', - value: function addCue(time, callback, val) { - var id = this._cueIDCounter++; - var cue = new Cue(callback, time, id, val); - this._cues.push(cue); - if (!this.elt.ontimeupdate) { - this.elt.ontimeupdate = this._onTimeUpdate.bind(this); - } - return id; - } /** - * Remove a callback based on its ID. - * - * @method removeCue - * @param {Number} id ID of the cue, created by `media.addCue()`. - * @example - *
                - * - * let lavenderID; - * let isRemoved = false; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * let beat = createAudio('assets/beat.mp3'); - * // Play the beat in a loop. - * beat.loop(); - * - * // Schedule a few events. - * beat.addCue(0, changeBackground, 'red'); - * beat.addCue(2, changeBackground, 'deeppink'); - * beat.addCue(4, changeBackground, 'orchid'); - * - * // Record the ID of the "lavender" callback. - * lavenderID = beat.addCue(6, changeBackground, 'lavender'); - * - * describe('The text "Double-click to remove lavender." written on a red square. The color changes every 2 seconds while the audio plays. The lavender option is removed when the user double-clicks the square.'); - * } - * - * function draw() { - * if (isRemoved === false) { - * text('Double-click to remove lavender.', 10, 10, 80, 80); - * } else { - * text('No more lavender.', 10, 10, 80, 80); - * } - * } - * - * function changeBackground(c) { - * background(c); - * } - * - * // Remove the lavender color-change cue - * // when the user double-clicks. - * function doubleClicked() { - * if (isRemoved === false) { - * beat.removeCue(lavenderID); - * isRemoved = true; - * } - * } - * - *
                - */ - - }, - { - key: 'removeCue', - value: function removeCue(id) { - for (var i = 0; i < this._cues.length; i++) { - if (this._cues[i].id === id) { - console.log(id); - this._cues.splice(i, 1); - } - } - if (this._cues.length === 0) { - this.elt.ontimeupdate = null; - } - } /** - * Removes all functions scheduled with `media.addCue()`. - * - * @method clearCues - * @example - *
                - * - * let isChanging = true; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * let beat = createAudio('assets/beat.mp3'); - * // Play the beat in a loop. - * beat.loop(); - * - * // Schedule a few events. - * beat.addCue(0, changeBackground, 'red'); - * beat.addCue(2, changeBackground, 'deeppink'); - * beat.addCue(4, changeBackground, 'orchid'); - * beat.addCue(6, changeBackground, 'lavender'); - * - * describe('The text "Double-click to stop changing." written on a square. The color changes every 2 seconds while the audio plays. The color stops changing when the user double-clicks the square.'); - * } - * - * function draw() { - * if (isChanging === true) { - * text('Double-click to stop changing.', 10, 10, 80, 80); - * } else { - * text('No more changes.', 10, 10, 80, 80); - * } - * } - * - * function changeBackground(c) { - * background(c); - * } - * - * // Remove cued functions and stop - * // changing colors when the user - * // double-clicks. - * function doubleClicked() { - * if (isChanging === true) { - * beat.clearCues(); - * isChanging = false; - * } - * } - * - *
                - */ - - }, - { - key: 'clearCues', - value: function clearCues() { - this._cues = [ - ]; - this.elt.ontimeupdate = null; - } // private method that checks for cues to be fired if events - // have been scheduled using addCue(callback, time). - - }, - { - key: '_onTimeUpdate', - value: function _onTimeUpdate() { - var playbackTime = this.time(); - for (var i = 0; i < this._cues.length; i++) { - var callbackTime = this._cues[i].time; - var val = this._cues[i].val; - if (this._prevTime < callbackTime && callbackTime <= playbackTime) { - // pass the scheduled callbackTime as parameter to the callback - this._cues[i].callback(val); - } - } - this._prevTime = playbackTime; - } - } - ]); - return MediaElement; - }(_main.default.Element); - _main.default.MediaElement = MediaElement; - /** - * A class to describe a file. - * - * `p5.File` objects are used by - * myElement.drop() and - * created by - * createFileInput. - * - * @class p5.File - * @constructor - * @param {File} file wrapped file. - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayInfo() when - * // the file loads. - * let input = createFileInput(displayInfo); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); - * } - * - * // Display the p5.File's info - * // once it loads. - * function displayInfo(file) { - * background(200); - * - * // Display the p5.File's name. - * text(file.name, 10, 10, 80, 40); - * // Display the p5.File's type and subtype. - * text(`${file.type}/${file.subtype}`, 10, 70); - * // Display the p5.File's size in bytes. - * text(file.size, 10, 90); - * } - * - *
                - * - *
                - * - * // Use the file input to select an image to - * // load and display. - * let img; - * - * function setup() { - * // Create a file input and place it beneath - * // the canvas. Call handleImage() when - * // the file image loads. - * let input = createFileInput(handleImage); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); - * } - * - * function draw() { - * background(200); - * - * // Draw the image if it's ready. - * if (img) { - * image(img, 0, 0, width, height); - * } - * } - * - * // Use the p5.File's data once - * // it loads. - * function handleImage(file) { - * // Check the p5.File's type. - * if (file.type === 'image') { - * // Create an image using using - * // the p5.File's data. - * img = createImg(file.data, ''); - * - * // Hide the image element so it - * // doesn't appear twice. - * img.hide(); - * } else { - * img = null; - * } - * } - * - *
                - */ - var File = /*#__PURE__*/ function () { - function File(file, pInst) { - _classCallCheck(this, File); - /** - * Underlying - * File - * object. All `File` properties and methods are accessible. - * - * @property file - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayInfo() when - * // the file loads. - * let input = createFileInput(displayInfo); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); - * } - * - * // Use the p5.File once - * // it loads. - * function displayInfo(file) { - * background(200); - * - * // Display the p5.File's name. - * text(file.name, 10, 10, 80, 40); - * // Display the p5.File's type and subtype. - * text(`${file.type}/${file.subtype}`, 10, 70); - * // Display the p5.File's size in bytes. - * text(file.size, 10, 90); - * } - * - *
                - */ - this.file = file; - this._pInst = pInst; - // Splitting out the file type into two components - // This makes determining if image or text etc simpler - var typeList = file.type.split('/'); - /** - * The file - * MIME type - * as a string. For example, `'image'`, `'text'`, and so on. - * - * @property type - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayType() when - * // the file loads. - * let input = createFileInput(displayType); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its type is written in black.'); - * } - * - * // Display the p5.File's type - * // once it loads. - * function displayType(file) { - * background(200); - * - * // Display the p5.File's type. - * text(`This is file's type is: ${file.type}`, 10, 10, 80, 80); - * } - * - *
                - */ - this.type = typeList[0]; - /** - * The file subtype as a string. For example, a file with an `'image'` - * MIME type - * may have a subtype such as ``png`` or ``jpeg``. - * - * @property subtype - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displaySubtype() when - * // the file loads. - * let input = createFileInput(displaySubtype); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its subtype is written in black.'); - * } - * - * // Display the p5.File's type - * // once it loads. - * function displaySubtype(file) { - * background(200); - * - * // Display the p5.File's subtype. - * text(`This is file's subtype is: ${file.subtype}`, 10, 10, 80, 80); - * } - * - *
                - */ - this.subtype = typeList[1]; - /** - * The file name as a string. - * - * @property name - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayName() when - * // the file loads. - * let input = createFileInput(displayName); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its name is written in black.'); - * } - * - * // Display the p5.File's name - * // once it loads. - * function displayName(file) { - * background(200); - * - * // Display the p5.File's name. - * text(`This is file's name is: ${file.name}`, 10, 10, 80, 80); - * } - * - *
                - */ - this.name = file.name; - /** - * The number of bytes in the file. - * - * @property size - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displaySize() when - * // the file loads. - * let input = createFileInput(displaySize); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its size in bytes is written in black.'); - * } - * - * // Display the p5.File's size - * // in bytes once it loads. - * function displaySize(file) { - * background(200); - * - * // Display the p5.File's size. - * text(`This is file has ${file.size} bytes.`, 10, 10, 80, 80); - * } - * - *
                - */ - this.size = file.size; - /** - * A string containing either the file's image data, text contents, or - * a parsed object in the case of JSON and - * p5.XML objects. - * - * @property data - * @example - *
                - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayData() when - * // the file loads. - * let input = createFileInput(displayData); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its data is written in black.'); - * } - * - * // Display the p5.File's data - * // once it loads. - * function displayData(file) { - * background(200); - * - * // Display the p5.File's data, - * // which looks like a random - * // string of characters. - * text(file.data, 10, 10, 80, 80); - * } - * - *
                - */ - this.data = undefined; - } - _createClass(File, null, [ - { - key: '_createLoader', - value: function _createLoader(theFile, callback) { - var reader = new FileReader(); - reader.onload = function (e) { - var p5file = new _main.default.File(theFile); - if (p5file.file.type === 'application/json') { - // Parse JSON and store the result in data - p5file.data = JSON.parse(e.target.result); - } else if (p5file.file.type === 'text/xml') { - // Parse XML, wrap it in p5.XML and store the result in data - var parser = new DOMParser(); - var xml = parser.parseFromString(e.target.result, 'text/xml'); - p5file.data = new _main.default.XML(xml.documentElement); - } else { - p5file.data = e.target.result; - } - callback(p5file); - }; - return reader; - } - }, - { - key: '_load', - value: function _load(f, callback) { - // Text or data? - // This should likely be improved - if (/^text\//.test(f.type) || f.type === 'application/json') { - _main.default.File._createLoader(f, callback).readAsText(f); - } else if (!/^(video|audio)\//.test(f.type)) { - _main.default.File._createLoader(f, callback).readAsDataURL(f); - } else { - var file = new _main.default.File(f); - file.data = URL.createObjectURL(f); - callback(file); - } - } - } - ]); - return File; - }(); - _main.default.File = File; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.every': 171, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.promise': 201, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.trim': 219, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256, - 'core-js/modules/web.url': 258 - } - ], - 315: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Events - * @submodule Acceleration - * @for p5 - * @requires core - * @main Events - */ - /** - * The system variable deviceOrientation always contains the orientation of - * the device. The value of this variable will either be set 'landscape' - * or 'portrait'. If no data is available it will be set to 'undefined'. - * either LANDSCAPE or PORTRAIT. - * - * @property {Constant} deviceOrientation - * @readOnly - */ - - _main.default.prototype.deviceOrientation = window.innerWidth / window.innerHeight > 1 ? 'landscape' : 'portrait'; - /** - * The system variable accelerationX always contains the acceleration of the - * device along the x axis. Value is represented as meters per second squared. - * - * @property {Number} accelerationX - * @readOnly - * @example - *
                - * - * // Move a touchscreen device to register - * // acceleration changes. - * function draw() { - * background(220, 50); - * fill('magenta'); - * ellipse(width / 2, height / 2, accelerationX); - * describe('Magnitude of device acceleration is displayed as ellipse size.'); - * } - * - *
                - */ - _main.default.prototype.accelerationX = 0; - /** - * The system variable accelerationY always contains the acceleration of the - * device along the y axis. Value is represented as meters per second squared. - * - * @property {Number} accelerationY - * @readOnly - * @example - *
                - * - * // Move a touchscreen device to register - * // acceleration changes. - * function draw() { - * background(220, 50); - * fill('magenta'); - * ellipse(width / 2, height / 2, accelerationY); - * describe('Magnitude of device acceleration is displayed as ellipse size'); - * } - * - *
                - */ - _main.default.prototype.accelerationY = 0; - /** - * The system variable accelerationZ always contains the acceleration of the - * device along the z axis. Value is represented as meters per second squared. - * - * @property {Number} accelerationZ - * @readOnly - * - * @example - *
                - * - * // Move a touchscreen device to register - * // acceleration changes. - * function draw() { - * background(220, 50); - * fill('magenta'); - * ellipse(width / 2, height / 2, accelerationZ); - * describe('Magnitude of device acceleration is displayed as ellipse size'); - * } - * - *
                - */ - _main.default.prototype.accelerationZ = 0; - /** - * The system variable pAccelerationX always contains the acceleration of the - * device along the x axis in the frame previous to the current frame. Value - * is represented as meters per second squared. - * - * @property {Number} pAccelerationX - * @readOnly - */ - _main.default.prototype.pAccelerationX = 0; - /** - * The system variable pAccelerationY always contains the acceleration of the - * device along the y axis in the frame previous to the current frame. Value - * is represented as meters per second squared. - * - * @property {Number} pAccelerationY - * @readOnly - */ - _main.default.prototype.pAccelerationY = 0; - /** - * The system variable pAccelerationZ always contains the acceleration of the - * device along the z axis in the frame previous to the current frame. Value - * is represented as meters per second squared. - * - * @property {Number} pAccelerationZ - * @readOnly - */ - _main.default.prototype.pAccelerationZ = 0; - /** - * _updatePAccelerations updates the pAcceleration values - * - * @private - */ - _main.default.prototype._updatePAccelerations = function () { - this._setProperty('pAccelerationX', this.accelerationX); - this._setProperty('pAccelerationY', this.accelerationY); - this._setProperty('pAccelerationZ', this.accelerationZ); - }; - /** - * The system variable rotationX always contains the rotation of the - * device along the x axis. If the sketch - * angleMode() is set to DEGREES, the value will be -180 to 180. If - * it is set to RADIANS, the value will be -PI to PI. - * - * Note: The order the rotations are called is important, ie. if used - * together, it must be called in the order Z-X-Y or there might be - * unexpected behaviour. - * - * @property {Number} rotationX - * @readOnly - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * //rotateZ(radians(rotationZ)); - * rotateX(radians(rotationX)); - * //rotateY(radians(rotationY)); - * box(200, 200, 200); - * describe(`red horizontal line right, green vertical line bottom. - * black background.`); - * } - * - *
                - */ - _main.default.prototype.rotationX = 0; - /** - * The system variable rotationY always contains the rotation of the - * device along the y axis. If the sketch - * angleMode() is set to DEGREES, the value will be -90 to 90. If - * it is set to RADIANS, the value will be -PI/2 to PI/2. - * - * Note: The order the rotations are called is important, ie. if used - * together, it must be called in the order Z-X-Y or there might be - * unexpected behaviour. - * - * @property {Number} rotationY - * @readOnly - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * //rotateZ(radians(rotationZ)); - * //rotateX(radians(rotationX)); - * rotateY(radians(rotationY)); - * box(200, 200, 200); - * describe(`red horizontal line right, green vertical line bottom. - * black background.`); - * } - * - *
                - */ - _main.default.prototype.rotationY = 0; - /** - * The system variable rotationZ always contains the rotation of the - * device along the z axis. If the sketch - * angleMode() is set to DEGREES, the value will be 0 to 360. If - * it is set to RADIANS, the value will be 0 to 2*PI. - * - * Unlike rotationX and rotationY, this variable is available for devices - * with a built-in compass only. - * - * Note: The order the rotations are called is important, ie. if used - * together, it must be called in the order Z-X-Y or there might be - * unexpected behaviour. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * rotateZ(radians(rotationZ)); - * //rotateX(radians(rotationX)); - * //rotateY(radians(rotationY)); - * box(200, 200, 200); - * describe(`red horizontal line right, green vertical line bottom. - * black background.`); - * } - * - *
                - * - * @property {Number} rotationZ - * @readOnly - */ - _main.default.prototype.rotationZ = 0; - /** - * The system variable pRotationX always contains the rotation of the - * device along the x axis in the frame previous to the current frame. - * If the sketch angleMode() is set to DEGREES, - * the value will be -180 to 180. If it is set to RADIANS, the value will - * be -PI to PI. - * - * pRotationX can also be used with rotationX to determine the rotate - * direction of the device along the X-axis. - * @example - *
                - * - * // A simple if statement looking at whether - * // rotationX - pRotationX < 0 is true or not will be - * // sufficient for determining the rotate direction - * // in most cases. - * - * // Some extra logic is needed to account for cases where - * // the angles wrap around. - * let rotateDirection = 'clockwise'; - * - * // Simple range conversion to make things simpler. - * // This is not absolutely necessary but the logic - * // will be different in that case. - * - * let rX = rotationX + 180; - * let pRX = pRotationX + 180; - * - * if ((rX - pRX > 0 && rX - pRX < 270) || rX - pRX < -270) { - * rotateDirection = 'clockwise'; - * } else if (rX - pRX < 0 || rX - pRX > 270) { - * rotateDirection = 'counter-clockwise'; - * } - * - * print(rotateDirection); - * describe('no image to display.'); - * - *
                - * - * @property {Number} pRotationX - * @readOnly - */ - _main.default.prototype.pRotationX = 0; - /** - * The system variable pRotationY always contains the rotation of the - * device along the y axis in the frame previous to the current frame. - * If the sketch angleMode() is set to DEGREES, - * the value will be -90 to 90. If it is set to RADIANS, the value will - * be -PI/2 to PI/2. - * - * pRotationY can also be used with rotationY to determine the rotate - * direction of the device along the Y-axis. - * @example - *
                - * - * // A simple if statement looking at whether - * // rotationY - pRotationY < 0 is true or not will be - * // sufficient for determining the rotate direction - * // in most cases. - * - * // Some extra logic is needed to account for cases where - * // the angles wrap around. - * let rotateDirection = 'clockwise'; - * - * // Simple range conversion to make things simpler. - * // This is not absolutely necessary but the logic - * // will be different in that case. - * - * let rY = rotationY + 180; - * let pRY = pRotationY + 180; - * - * if ((rY - pRY > 0 && rY - pRY < 270) || rY - pRY < -270) { - * rotateDirection = 'clockwise'; - * } else if (rY - pRY < 0 || rY - pRY > 270) { - * rotateDirection = 'counter-clockwise'; - * } - * print(rotateDirection); - * describe('no image to display.'); - * - *
                - * - * @property {Number} pRotationY - * @readOnly - */ - _main.default.prototype.pRotationY = 0; - /** - * The system variable pRotationZ always contains the rotation of the - * device along the z axis in the frame previous to the current frame. - * If the sketch angleMode() is set to DEGREES, - * the value will be 0 to 360. If it is set to RADIANS, the value will - * be 0 to 2*PI. - * - * pRotationZ can also be used with rotationZ to determine the rotate - * direction of the device along the Z-axis. - * @example - *
                - * - * // A simple if statement looking at whether - * // rotationZ - pRotationZ < 0 is true or not will be - * // sufficient for determining the rotate direction - * // in most cases. - * - * // Some extra logic is needed to account for cases where - * // the angles wrap around. - * let rotateDirection = 'clockwise'; - * - * if ( - * (rotationZ - pRotationZ > 0 && rotationZ - pRotationZ < 270) || - * rotationZ - pRotationZ < -270 - * ) { - * rotateDirection = 'clockwise'; - * } else if (rotationZ - pRotationZ < 0 || rotationZ - pRotationZ > 270) { - * rotateDirection = 'counter-clockwise'; - * } - * print(rotateDirection); - * describe('no image to display.'); - * - *
                - * - * @property {Number} pRotationZ - * @readOnly - */ - _main.default.prototype.pRotationZ = 0; - var startAngleX = 0; - var startAngleY = 0; - var startAngleZ = 0; - var rotateDirectionX = 'clockwise'; - var rotateDirectionY = 'clockwise'; - var rotateDirectionZ = 'clockwise'; - _main.default.prototype.pRotateDirectionX = undefined; - _main.default.prototype.pRotateDirectionY = undefined; - _main.default.prototype.pRotateDirectionZ = undefined; - _main.default.prototype._updatePRotations = function () { - this._setProperty('pRotationX', this.rotationX); - this._setProperty('pRotationY', this.rotationY); - this._setProperty('pRotationZ', this.rotationZ); - }; - /** - * When a device is rotated, the axis that triggers the deviceTurned() - * method is stored in the turnAxis variable. The turnAxis variable is only defined within - * the scope of deviceTurned(). - * @property {String} turnAxis - * @readOnly - * @example - *
                - * - * // Run this example on a mobile device - * // Rotate the device by 90 degrees in the - * // X-axis to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device turns`); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when x-axis turns`); - * } - * function deviceTurned() { - * if (turnAxis === 'X') { - * if (value === 0) { - * value = 255; - * } else if (value === 255) { - * value = 0; - * } - * } - * } - * - *
                - */ - _main.default.prototype.turnAxis = undefined; - var move_threshold = 0.5; - var shake_threshold = 30; - /** - * The setMoveThreshold() function is used to set the movement threshold for - * the deviceMoved() function. The default threshold is set to 0.5. - * - * @method setMoveThreshold - * @param {number} value The threshold value - * @example - *
                - * - * // Run this example on a mobile device - * // You will need to move the device incrementally further - * // the closer the square's color gets to white in order to change the value. - * - * let value = 0; - * let threshold = 0.5; - * function setup() { - * setMoveThreshold(threshold); - * } - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device moves`); - * } - * function deviceMoved() { - * value = value + 5; - * threshold = threshold + 0.1; - * if (value > 255) { - * value = 0; - * threshold = 30; - * } - * setMoveThreshold(threshold); - * } - * - *
                - */ - _main.default.prototype.setMoveThreshold = function (val) { - _main.default._validateParameters('setMoveThreshold', arguments); - move_threshold = val; - }; - /** - * The setShakeThreshold() function is used to set the movement threshold for - * the deviceShaken() function. The default threshold is set to 30. - * - * @method setShakeThreshold - * @param {number} value The threshold value - * @example - *
                - * - * // Run this example on a mobile device - * // You will need to shake the device more firmly - * // the closer the box's fill gets to white in order to change the value. - * - * let value = 0; - * let threshold = 30; - * function setup() { - * setShakeThreshold(threshold); - * } - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device is being shaked`); - * } - * function deviceMoved() { - * value = value + 5; - * threshold = threshold + 5; - * if (value > 255) { - * value = 0; - * threshold = 30; - * } - * setShakeThreshold(threshold); - * } - * - *
                - */ - _main.default.prototype.setShakeThreshold = function (val) { - _main.default._validateParameters('setShakeThreshold', arguments); - shake_threshold = val; - }; - /** - * The deviceMoved() function is called when the device is moved by more than - * the threshold value along X, Y or Z axis. The default threshold is set to 0.5. - * The threshold value can be changed using setMoveThreshold(). - * - * @method deviceMoved - * @example - *
                - * - * // Run this example on a mobile device - * // Move the device around - * // to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device moves`); - * } - * function deviceMoved() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                - */ - /** - * The deviceTurned() function is called when the device rotates by - * more than 90 degrees continuously. - * - * The axis that triggers the deviceTurned() method is stored in the turnAxis - * variable. The deviceTurned() method can be locked to trigger on any axis: - * X, Y or Z by comparing the turnAxis variable to 'X', 'Y' or 'Z'. - * - * @method deviceTurned - * @example - *
                - * - * // Run this example on a mobile device - * // Rotate the device by 90 degrees - * // to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device turns`); - * } - * function deviceTurned() { - * if (value === 0) { - * value = 255; - * } else if (value === 255) { - * value = 0; - * } - * } - * - *
                - *
                - * - * // Run this example on a mobile device - * // Rotate the device by 90 degrees in the - * // X-axis to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when x-axis turns`); - * } - * function deviceTurned() { - * if (turnAxis === 'X') { - * if (value === 0) { - * value = 255; - * } else if (value === 255) { - * value = 0; - * } - * } - * } - * - *
                - */ - /** - * The deviceShaken() function is called when the device total acceleration - * changes of accelerationX and accelerationY values is more than - * the threshold value. The default threshold is set to 30. - * The threshold value can be changed using setShakeThreshold(). - * - * @method deviceShaken - * @example - *
                - * - * // Run this example on a mobile device - * // Shake the device to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device shakes`); - * } - * function deviceShaken() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                - */ - _main.default.prototype._ondeviceorientation = function (e) { - this._updatePRotations(); - if (this._angleMode === constants.radians) { - e.beta = e.beta * (_PI / 180); - e.gamma = e.gamma * (_PI / 180); - e.alpha = e.alpha * (_PI / 180); - } - this._setProperty('rotationX', e.beta); - this._setProperty('rotationY', e.gamma); - this._setProperty('rotationZ', e.alpha); - this._handleMotion(); - }; - _main.default.prototype._ondevicemotion = function (e) { - this._updatePAccelerations(); - this._setProperty('accelerationX', e.acceleration.x * 2); - this._setProperty('accelerationY', e.acceleration.y * 2); - this._setProperty('accelerationZ', e.acceleration.z * 2); - this._handleMotion(); - }; - _main.default.prototype._handleMotion = function () { - if (window.orientation === 90 || window.orientation === - 90) { - this._setProperty('deviceOrientation', 'landscape'); - } else if (window.orientation === 0) { - this._setProperty('deviceOrientation', 'portrait'); - } else if (window.orientation === undefined) { - this._setProperty('deviceOrientation', 'undefined'); - } - var context = this._isGlobal ? window : this; - if (typeof context.deviceMoved === 'function') { - if (Math.abs(this.accelerationX - this.pAccelerationX) > move_threshold || Math.abs(this.accelerationY - this.pAccelerationY) > move_threshold || Math.abs(this.accelerationZ - this.pAccelerationZ) > move_threshold) { - context.deviceMoved(); - } - } - if (typeof context.deviceTurned === 'function') { - // The angles given by rotationX etc is from range -180 to 180. - // The following will convert them to 0 to 360 for ease of calculation - // of cases when the angles wrapped around. - // _startAngleX will be converted back at the end and updated. - var wRX = this.rotationX + 180; - var wPRX = this.pRotationX + 180; - var wSAX = startAngleX + 180; - if (wRX - wPRX > 0 && wRX - wPRX < 270 || wRX - wPRX < - 270) { - rotateDirectionX = 'clockwise'; - } else if (wRX - wPRX < 0 || wRX - wPRX > 270) { - rotateDirectionX = 'counter-clockwise'; - } - if (rotateDirectionX !== this.pRotateDirectionX) { - wSAX = wRX; - } - if (Math.abs(wRX - wSAX) > 90 && Math.abs(wRX - wSAX) < 270) { - wSAX = wRX; - this._setProperty('turnAxis', 'X'); - context.deviceTurned(); - } - this.pRotateDirectionX = rotateDirectionX; - startAngleX = wSAX - 180; - // Y-axis is identical to X-axis except for changing some names. - var wRY = this.rotationY + 180; - var wPRY = this.pRotationY + 180; - var wSAY = startAngleY + 180; - if (wRY - wPRY > 0 && wRY - wPRY < 270 || wRY - wPRY < - 270) { - rotateDirectionY = 'clockwise'; - } else if (wRY - wPRY < 0 || wRY - this.pRotationY > 270) { - rotateDirectionY = 'counter-clockwise'; - } - if (rotateDirectionY !== this.pRotateDirectionY) { - wSAY = wRY; - } - if (Math.abs(wRY - wSAY) > 90 && Math.abs(wRY - wSAY) < 270) { - wSAY = wRY; - this._setProperty('turnAxis', 'Y'); - context.deviceTurned(); - } - this.pRotateDirectionY = rotateDirectionY; - startAngleY = wSAY - 180; - // Z-axis is already in the range 0 to 360 - // so no conversion is needed. - if (this.rotationZ - this.pRotationZ > 0 && this.rotationZ - this.pRotationZ < 270 || this.rotationZ - this.pRotationZ < - 270) { - rotateDirectionZ = 'clockwise'; - } else if (this.rotationZ - this.pRotationZ < 0 || this.rotationZ - this.pRotationZ > 270) { - rotateDirectionZ = 'counter-clockwise'; - } - if (rotateDirectionZ !== this.pRotateDirectionZ) { - startAngleZ = this.rotationZ; - } - if (Math.abs(this.rotationZ - startAngleZ) > 90 && Math.abs(this.rotationZ - startAngleZ) < 270) { - startAngleZ = this.rotationZ; - this._setProperty('turnAxis', 'Z'); - context.deviceTurned(); - } - this.pRotateDirectionZ = rotateDirectionZ; - this._setProperty('turnAxis', undefined); - } - if (typeof context.deviceShaken === 'function') { - var accelerationChangeX; - var accelerationChangeY; - // Add accelerationChangeZ if acceleration change on Z is needed - if (this.pAccelerationX !== null) { - accelerationChangeX = Math.abs(this.accelerationX - this.pAccelerationX); - accelerationChangeY = Math.abs(this.accelerationY - this.pAccelerationY); - } - if (accelerationChangeX + accelerationChangeY > shake_threshold) { - context.deviceShaken(); - } - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 316: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Events - * @submodule Keyboard - * @for p5 - * @requires core - */ - /** - * The boolean system variable keyIsPressed is true if any key is pressed - * and false if no keys are pressed. - * - * @property {Boolean} keyIsPressed - * @readOnly - * @example - *
                - * - * function draw() { - * if (keyIsPressed === true) { - * fill(0); - * } else { - * fill(255); - * } - * rect(25, 25, 50, 50); - * describe('50-by-50 white rect that turns black on keypress.'); - * } - * - *
                - */ - - _main.default.prototype.isKeyPressed = false; - _main.default.prototype.keyIsPressed = false; // khan - /** - * The system variable key always contains the value of the most recent - * key on the keyboard that was typed. To get the proper capitalization, it - * is best to use it within keyTyped(). For non-ASCII keys, use the keyCode - * variable. - * - * @property {String} key - * @readOnly - * @example - *
                - * // Click any key to display it! - * // (Not Guaranteed to be Case Sensitive) - * function setup() { - * fill(245, 123, 158); - * textSize(50); - * } - * - * function draw() { - * background(200); - * text(key, 33, 65); // Display last key pressed. - * describe('canvas displays any key value that is pressed in pink font.'); - * } - *
                - */ - _main.default.prototype.key = ''; - /** - * The variable keyCode is used to detect special keys such as BACKSPACE, - * DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, OPTION, ALT, UP_ARROW, - * DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. - * You can also check for custom keys by looking up the keyCode of any key - * on a site like this: keycode.info. - * - * @property {Integer} keyCode - * @readOnly - * @example - *
                - * let fillVal = 126; - * function draw() { - * fill(fillVal); - * rect(25, 25, 50, 50); - * describe(`Grey rect center. turns white when up arrow pressed and black when down. - * Display key pressed and its keyCode in a yellow box.`); - * } - * - * function keyPressed() { - * if (keyCode === UP_ARROW) { - * fillVal = 255; - * } else if (keyCode === DOWN_ARROW) { - * fillVal = 0; - * } - * } - *
                - *
                - * function draw() {} - * function keyPressed() { - * background('yellow'); - * text(`${key} ${keyCode}`, 10, 40); - * print(key, ' ', keyCode); - * } - *
                - */ - _main.default.prototype.keyCode = 0; - /** - * The keyPressed() function is called once every time a key is pressed. The - * keyCode for the key that was pressed is stored in the keyCode variable. - * - * For non-ASCII keys, use the keyCode variable. You can check if the keyCode - * equals BACKSPACE, DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, - * OPTION, ALT, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. - * - * For ASCII keys, the key that was pressed is stored in the key variable. However, it - * does not distinguish between uppercase and lowercase. For this reason, it - * is recommended to use keyTyped() to read the key variable, in which the - * case of the variable will be distinguished. - * - * Because of how operating systems handle key repeats, holding down a key - * may cause multiple calls to keyTyped() (and keyReleased() as well). The - * rate of repeat is set by the operating system and how each computer is - * configured.

                - * Browsers may have different default - * behaviors attached to various key events. To prevent any default - * behavior for this event, add "return false" to the end of the method. - * - * @method keyPressed - * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. - * @example - *
                - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when key pressed and black - * when released.`); - * } - * function keyPressed() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                - *
                - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when left arrow pressed and - * black when right.`); - * } - * function keyPressed() { - * if (keyCode === LEFT_ARROW) { - * value = 255; - * } else if (keyCode === RIGHT_ARROW) { - * value = 0; - * } - * } - * - *
                - *
                - * - * function keyPressed() { - * // Do something - * return false; // prevent any default behaviour - * } - * - *
                - */ - _main.default.prototype._onkeydown = function (e) { - if (this._downKeys[e.which]) { - // prevent multiple firings - return; - } - this._setProperty('isKeyPressed', true); - this._setProperty('keyIsPressed', true); - this._setProperty('keyCode', e.which); - this._downKeys[e.which] = true; - this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); - var context = this._isGlobal ? window : this; - if (typeof context.keyPressed === 'function' && !e.charCode) { - var executeDefault = context.keyPressed(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The keyReleased() function is called once every time a key is released. - * See key and keyCode for more information.

                - * Browsers may have different default - * behaviors attached to various key events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method keyReleased - * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. - * @example - *
                - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when key pressed and black - * when pressed again`); - * } - * function keyReleased() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * return false; // prevent any default behavior - * } - * - *
                - */ - _main.default.prototype._onkeyup = function (e) { - this._downKeys[e.which] = false; - if (!this._areDownKeys()) { - this._setProperty('isKeyPressed', false); - this._setProperty('keyIsPressed', false); - } - this._setProperty('_lastKeyCodeTyped', null); - this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); - this._setProperty('keyCode', e.which); - var context = this._isGlobal ? window : this; - if (typeof context.keyReleased === 'function') { - var executeDefault = context.keyReleased(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The keyTyped() function is called once every time a key is pressed, but - * action keys such as Backspace, Delete, Ctrl, Shift, and Alt are ignored. If you are trying to detect - * a keyCode for one of these keys, use the keyPressed() function instead. - * The most recent key typed will be stored in the key variable. - * - * Because of how operating systems handle key repeats, holding down a key - * will cause multiple calls to keyTyped() (and keyReleased() as well). The - * rate of repeat is set by the operating system and how each computer is - * configured.

                - * Browsers may have different default behaviors attached to various key - * events. To prevent any default behavior for this event, add "return false" - * to the end of the function. - * - * @method keyTyped - * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. - * @example - *
                - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when 'a' key typed and - * black when 'b' pressed`); - * } - * function keyTyped() { - * if (key === 'a') { - * value = 255; - * } else if (key === 'b') { - * value = 0; - * } - * // uncomment to prevent any default behavior - * // return false; - * } - * - *
                - */ - _main.default.prototype._onkeypress = function (e) { - if (e.which === this._lastKeyCodeTyped) { - // prevent multiple firings - return; - } - this._setProperty('_lastKeyCodeTyped', e.which); // track last keyCode - this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); - var context = this._isGlobal ? window : this; - if (typeof context.keyTyped === 'function') { - var executeDefault = context.keyTyped(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The onblur function is called when the user is no longer focused - * on the p5 element. Because the keyup events will not fire if the user is - * not focused on the element we must assume all keys currently down have - * been released. - */ - _main.default.prototype._onblur = function (e) { - this._downKeys = { - }; - }; - /** - * The keyIsDown() function checks if the key is currently down, i.e. pressed. - * It can be used if you have an object that moves, and you want several keys - * to be able to affect its behaviour simultaneously, such as moving a - * sprite diagonally. You can put in any number representing the keyCode of - * the key, or use any of the variable keyCode names listed - * here. - * - * @method keyIsDown - * @param {Number} code The key to check for. - * @return {Boolean} whether key is down or not - * @example - *
                - * let x = 100; - * let y = 100; - * - * function setup() { - * createCanvas(512, 512); - * fill(255, 0, 0); - * } - * - * function draw() { - * if (keyIsDown(LEFT_ARROW)) { - * x -= 5; - * } - * - * if (keyIsDown(RIGHT_ARROW)) { - * x += 5; - * } - * - * if (keyIsDown(UP_ARROW)) { - * y -= 5; - * } - * - * if (keyIsDown(DOWN_ARROW)) { - * y += 5; - * } - * - * clear(); - * ellipse(x, y, 50, 50); - * describe(`50-by-50 red ellipse moves left, right, up, and - * down with arrow presses.`); - * } - *
                - * - *
                - * let diameter = 50; - * - * function setup() { - * createCanvas(512, 512); - * } - * - * function draw() { - * // 107 and 187 are keyCodes for "+" - * if (keyIsDown(107) || keyIsDown(187)) { - * diameter += 1; - * } - * - * // 109 and 189 are keyCodes for "-" - * if (keyIsDown(109) || keyIsDown(189)) { - * diameter -= 1; - * } - * - * clear(); - * fill(255, 0, 0); - * ellipse(50, 50, diameter, diameter); - * describe(`50-by-50 red ellipse gets bigger or smaller when - * + or - are pressed.`); - * } - *
                - */ - _main.default.prototype.keyIsDown = function (code) { - _main.default._validateParameters('keyIsDown', arguments); - return this._downKeys[code] || false; - }; - /** - * The _areDownKeys function returns a boolean true if any keys pressed - * and a false if no keys are currently pressed. - - * Helps avoid instances where multiple keys are pressed simultaneously and - * releasing a single key will then switch the - * keyIsPressed property to true. - * @private -**/ - _main.default.prototype._areDownKeys = function () { - for (var key in this._downKeys) { - if (this._downKeys.hasOwnProperty(key) && this._downKeys[key] === true) { - return true; - } - } - return false; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298 - } - ], - 317: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.string.includes'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Events - * @submodule Mouse - * @for p5 - * @requires core - * @requires constants - */ - /** - * - * The variable movedX contains the horizontal movement of the mouse since the last frame - * @property {Number} movedX - * @readOnly - * @example - *
                - * - * let x = 50; - * function setup() { - * rectMode(CENTER); - * } - * - * function draw() { - * if (x > 48) { - * x -= 2; - * } else if (x < 48) { - * x += 2; - * } - * x += floor(movedX / 5); - * background(237, 34, 93); - * fill(0); - * rect(x, 50, 50, 50); - * describe(`box moves left and right according to mouse movement - * then slowly back towards the center`); - * } - * - *
                - */ - - _main.default.prototype.movedX = 0; - /** - * The variable movedY contains the vertical movement of the mouse since the last frame - * @property {Number} movedY - * @readOnly - * @example - *
                - * - * let y = 50; - * function setup() { - * rectMode(CENTER); - * } - * - * function draw() { - * if (y > 48) { - * y -= 2; - * } else if (y < 48) { - * y += 2; - * } - * y += floor(movedY / 5); - * background(237, 34, 93); - * fill(0); - * rect(50, y, 50, 50); - * describe(`box moves up and down according to mouse movement then - * slowly back towards the center`); - * } - * - *
                - */ - _main.default.prototype.movedY = 0; - /* - * This is a flag which is false until the first time - * we receive a mouse event. The pmouseX and pmouseY - * values will match the mouseX and mouseY values until - * this interaction takes place. - */ - _main.default.prototype._hasMouseInteracted = false; - /** - * The system variable mouseX always contains the current horizontal - * position of the mouse, relative to (0, 0) of the canvas. The value at - * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. - * If touch is used instead of mouse input, mouseX will hold the x value - * of the most recent touch point. - * - * @property {Number} mouseX - * @readOnly - * - * @example - *
                - * - * // Move the mouse across the canvas - * function draw() { - * background(244, 248, 252); - * line(mouseX, 0, mouseX, 100); - * describe('horizontal black line moves left and right with mouse x-position'); - * } - * - *
                - */ - _main.default.prototype.mouseX = 0; - /** - * The system variable mouseY always contains the current vertical - * position of the mouse, relative to (0, 0) of the canvas. The value at - * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. - * If touch is used instead of mouse input, mouseY will hold the y value - * of the most recent touch point. - * - * @property {Number} mouseY - * @readOnly - * - * @example - *
                - * - * // Move the mouse across the canvas - * function draw() { - * background(244, 248, 252); - * line(0, mouseY, 100, mouseY); - * describe('vertical black line moves up and down with mouse y-position'); - * } - * - *
                - */ - _main.default.prototype.mouseY = 0; - /** - * The system variable pmouseX always contains the horizontal position of - * the mouse or finger in the frame previous to the current frame, relative to - * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and - * (-width/2, -height/2) for WebGL. Note: pmouseX will be reset to the current mouseX - * value at the start of each touch event. - * - * @property {Number} pmouseX - * @readOnly - * - * @example - *
                - * - * // Move the mouse across the canvas to leave a trail - * function setup() { - * //slow down the frameRate to make it more visible - * frameRate(10); - * } - * - * function draw() { - * background(244, 248, 252); - * line(mouseX, mouseY, pmouseX, pmouseY); - * print(pmouseX + ' -> ' + mouseX); - * describe(`line trail is created from cursor movements. - * faster movement make longer line.`); - * } - * - *
                - */ - _main.default.prototype.pmouseX = 0; - /** - * The system variable pmouseY always contains the vertical position of - * the mouse or finger in the frame previous to the current frame, relative to - * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and - * (-width/2, -height/2) for WebGL. Note: pmouseY will be reset to the current mouseY - * value at the start of each touch event. - * - * @property {Number} pmouseY - * @readOnly - * - * @example - *
                - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * //draw a square only if the mouse is not moving - * if (mouseY === pmouseY && mouseX === pmouseX) { - * rect(20, 20, 60, 60); - * } - * - * print(pmouseY + ' -> ' + mouseY); - * describe(`60-by-60 black rect center, fuchsia background. - * rect flickers on mouse movement`); - * } - * - *
                - */ - _main.default.prototype.pmouseY = 0; - /** - * The system variable winMouseX always contains the current horizontal - * position of the mouse, relative to (0, 0) of the window. - * - * @property {Number} winMouseX - * @readOnly - * - * @example - *
                - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * let body = document.getElementsByTagName('body')[0]; - * myCanvas.parent(body); - * } - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * //move the canvas to the horizontal mouse position - * //relative to the window - * myCanvas.position(winMouseX + 1, windowHeight / 2); - * - * //the y of the square is relative to the canvas - * rect(20, mouseY, 60, 60); - * describe(`60-by-60 black rect y moves with mouse y and fuchsia - * canvas moves with mouse x`); - * } - * - *
                - */ - _main.default.prototype.winMouseX = 0; - /** - * The system variable winMouseY always contains the current vertical - * position of the mouse, relative to (0, 0) of the window. - * - * @property {Number} winMouseY - * @readOnly - * - * @example - *
                - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * let body = document.getElementsByTagName('body')[0]; - * myCanvas.parent(body); - * } - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * //move the canvas to the vertical mouse position - * //relative to the window - * myCanvas.position(windowWidth / 2, winMouseY + 1); - * - * //the x of the square is relative to the canvas - * rect(mouseX, 20, 60, 60); - * describe(`60-by-60 black rect x moves with mouse x and - * fuchsia canvas y moves with mouse y`); - * } - * - *
                - */ - _main.default.prototype.winMouseY = 0; - /** - * The system variable pwinMouseX always contains the horizontal position - * of the mouse in the frame previous to the current frame, relative to - * (0, 0) of the window. Note: pwinMouseX will be reset to the current winMouseX - * value at the start of each touch event. - * - * @property {Number} pwinMouseX - * @readOnly - * - * @example - *
                - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * noStroke(); - * fill(237, 34, 93); - * } - * - * function draw() { - * clear(); - * //the difference between previous and - * //current x position is the horizontal mouse speed - * let speed = abs(winMouseX - pwinMouseX); - * //change the size of the circle - * //according to the horizontal speed - * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); - * //move the canvas to the mouse position - * myCanvas.position(winMouseX + 1, winMouseY + 1); - * describe(`fuchsia ellipse moves with mouse x and y. - * Grows and shrinks with mouse speed`); - * } - * - *
                - */ - _main.default.prototype.pwinMouseX = 0; - /** - * The system variable pwinMouseY always contains the vertical position of - * the mouse in the frame previous to the current frame, relative to (0, 0) - * of the window. Note: pwinMouseY will be reset to the current winMouseY - * value at the start of each touch event. - * - * @property {Number} pwinMouseY - * @readOnly - * - * @example - *
                - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * noStroke(); - * fill(237, 34, 93); - * } - * - * function draw() { - * clear(); - * //the difference between previous and - * //current y position is the vertical mouse speed - * let speed = abs(winMouseY - pwinMouseY); - * //change the size of the circle - * //according to the vertical speed - * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); - * //move the canvas to the mouse position - * myCanvas.position(winMouseX + 1, winMouseY + 1); - * describe(`fuchsia ellipse moves with mouse x and y. - * Grows and shrinks with mouse speed`); - * } - * - *
                - */ - _main.default.prototype.pwinMouseY = 0; - /** - * p5 automatically tracks if the mouse button is pressed and which - * button is pressed. The value of the system variable mouseButton is either - * LEFT, RIGHT, or CENTER depending on which button was pressed last. - * Warning: different browsers may track mouseButton differently. - * - * @property {Constant} mouseButton - * @readOnly - * - * @example - *
                - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * if (mouseIsPressed === true) { - * if (mouseButton === LEFT) { - * ellipse(50, 50, 50, 50); - * } - * if (mouseButton === RIGHT) { - * rect(25, 25, 50, 50); - * } - * if (mouseButton === CENTER) { - * triangle(23, 75, 50, 20, 78, 75); - * } - * } - * - * print(mouseButton); - * describe(`50-by-50 black ellipse appears on center of fuchsia - * canvas on mouse click/press.`); - * } - * - *
                - */ - _main.default.prototype.mouseButton = 0; - /** - * The boolean system variable mouseIsPressed is true if the mouse is pressed - * and false if not. - * - * @property {Boolean} mouseIsPressed - * @readOnly - * - * @example - *
                - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * if (mouseIsPressed === true) { - * ellipse(50, 50, 50, 50); - * } else { - * rect(25, 25, 50, 50); - * } - * - * print(mouseIsPressed); - * describe(`black 50-by-50 rect becomes ellipse with mouse click/press. - * fuchsia background.`); - * } - * - *
                - */ - _main.default.prototype.mouseIsPressed = false; - _main.default.prototype._updateNextMouseCoords = function (e) { - if (this._curElement !== null && (!e.touches || e.touches.length > 0)) { - var mousePos = getMousePos(this._curElement.elt, this.width, this.height, e); - this._setProperty('movedX', e.movementX); - this._setProperty('movedY', e.movementY); - this._setProperty('mouseX', mousePos.x); - this._setProperty('mouseY', mousePos.y); - this._setProperty('winMouseX', mousePos.winX); - this._setProperty('winMouseY', mousePos.winY); - } - if (!this._hasMouseInteracted) { - // For first draw, make previous and next equal - this._updateMouseCoords(); - this._setProperty('_hasMouseInteracted', true); - } - }; - _main.default.prototype._updateMouseCoords = function () { - this._setProperty('pmouseX', this.mouseX); - this._setProperty('pmouseY', this.mouseY); - this._setProperty('pwinMouseX', this.winMouseX); - this._setProperty('pwinMouseY', this.winMouseY); - this._setProperty('_pmouseWheelDeltaY', this._mouseWheelDeltaY); - }; - function getMousePos(canvas, w, h, evt) { - if (evt && !evt.clientX) { - // use touches if touch and not mouse - if (evt.touches) { - evt = evt.touches[0]; - } else if (evt.changedTouches) { - evt = evt.changedTouches[0]; - } - } - var rect = canvas.getBoundingClientRect(); - var sx = canvas.scrollWidth / w || 1; - var sy = canvas.scrollHeight / h || 1; - return { - x: (evt.clientX - rect.left) / sx, - y: (evt.clientY - rect.top) / sy, - winX: evt.clientX, - winY: evt.clientY, - id: evt.identifier - }; - } - _main.default.prototype._setMouseButton = function (e) { - if (e.button === 1) { - this._setProperty('mouseButton', constants.CENTER); - } else if (e.button === 2) { - this._setProperty('mouseButton', constants.RIGHT); - } else { - this._setProperty('mouseButton', constants.LEFT); - } - }; - /** - * The mouseMoved() function is called every time the mouse moves and a mouse - * button is not pressed.

                - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the method. - * - * @method mouseMoved - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                - * - * // Move the mouse across the page - * // to change its value - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black 50-by-50 rect becomes lighter with mouse movements until - * white then resets no image displayed`); - * } - * function mouseMoved() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function mouseMoved() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                - * - *
                - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseMoved(event) { - * console.log(event); - * } - * - *
                - */ - /** - * The mouseDragged() function is called once every time the mouse moves and - * a mouse button is pressed. If no mouseDragged() function is defined, the - * touchMoved() function will be called instead if it is defined.

                - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mouseDragged - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                - * - * // Drag the mouse across the page - * // to change its value - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black 50-by-50 rect turns lighter with mouse click and - * drag until white, resets`); - * } - * function mouseDragged() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function mouseDragged() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                - * - *
                - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseDragged(event) { - * console.log(event); - * } - * - *
                - */ - _main.default.prototype._onmousemove = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._updateNextMouseCoords(e); - if (!this.mouseIsPressed) { - if (typeof context.mouseMoved === 'function') { - executeDefault = context.mouseMoved(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - } else { - if (typeof context.mouseDragged === 'function') { - executeDefault = context.mouseDragged(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.touchMoved === 'function') { - executeDefault = context.touchMoved(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - } - }; - /** - * The mousePressed() function is called once after every time a mouse button - * is pressed. The mouseButton variable (see the related reference entry) - * can be used to determine which button has been pressed. If no - * mousePressed() function is defined, the touchStarted() function will be - * called instead if it is defined.

                - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mousePressed - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                - * - * // Click anywhere in the webpage to change - * // the color value of the rectangle - * - * let colorValue = 0; - * function draw() { - * fill(colorValue); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse click/press.'); - * } - * function mousePressed() { - * if (colorValue === 0) { - * colorValue = 255; - * } else { - * colorValue = 0; - * } - * } - * - *
                - * - *
                - * - * function mousePressed() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                - * - *
                - * - * // returns a MouseEvent object - * // as a callback argument - * function mousePressed(event) { - * console.log(event); - * } - * - *
                - */ - _main.default.prototype._onmousedown = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._setProperty('mouseIsPressed', true); - this._setMouseButton(e); - this._updateNextMouseCoords(e); - if (typeof context.mousePressed === 'function') { - executeDefault = context.mousePressed(e); - if (executeDefault === false) { - e.preventDefault(); - } // only safari needs this manual fallback for consistency - - } else if (navigator.userAgent.toLowerCase().includes('safari') && typeof context.touchStarted === 'function') { - executeDefault = context.touchStarted(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The mouseReleased() function is called every time a mouse button is - * released. If no mouseReleased() function is defined, the touchEnded() - * function will be called instead if it is defined.

                - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mouseReleased - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                - * - * // Click within the image to change - * // the value of the rectangle - * // after the mouse has been clicked - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse click/press.'); - * } - * function mouseReleased() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function mouseReleased() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                - * - *
                - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseReleased(event) { - * console.log(event); - * } - * - *
                - */ - _main.default.prototype._onmouseup = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._setProperty('mouseIsPressed', false); - if (typeof context.mouseReleased === 'function') { - executeDefault = context.mouseReleased(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.touchEnded === 'function') { - executeDefault = context.touchEnded(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - _main.default.prototype._ondragend = _main.default.prototype._onmouseup; - _main.default.prototype._ondragover = _main.default.prototype._onmousemove; - /** - * The mouseClicked() function is called once after a mouse button has been - * pressed and then released.

                - * Browsers handle clicks differently, so this function is only guaranteed to be - * run when the left mouse button is clicked. To handle other mouse buttons - * being pressed or released, see mousePressed() or mouseReleased().

                - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mouseClicked - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                - * - * // Click within the image to change - * // the value of the rectangle - * // after the mouse has been clicked - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse click/press.'); - * } - * - * function mouseClicked() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function mouseClicked() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                - * - *
                - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseClicked(event) { - * console.log(event); - * } - * - *
                - */ - _main.default.prototype._onclick = function (e) { - var context = this._isGlobal ? window : this; - if (typeof context.mouseClicked === 'function') { - var executeDefault = context.mouseClicked(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The doubleClicked() function is executed every time a event - * listener has detected a dblclick event which is a part of the - * DOM L3 specification. The doubleClicked event is fired when a - * pointing device button (usually a mouse's primary button) - * is clicked twice on a single element. For more info on the - * dblclick event refer to mozilla's documentation here: - * https://developer.mozilla.org/en-US/docs/Web/Events/dblclick - * - * @method doubleClicked - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                - * - * // Click within the image to change - * // the value of the rectangle - * // after the mouse has been double clicked - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse doubleClick/press.'); - * } - * - * function doubleClicked() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function doubleClicked() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                - * - *
                - * - * // returns a MouseEvent object - * // as a callback argument - * function doubleClicked(event) { - * console.log(event); - * } - * - *
                - */ - _main.default.prototype._ondblclick = function (e) { - var context = this._isGlobal ? window : this; - if (typeof context.doubleClicked === 'function') { - var executeDefault = context.doubleClicked(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * For use with WebGL orbitControl. - * @property {Number} _mouseWheelDeltaY - * @readOnly - * @private - */ - _main.default.prototype._mouseWheelDeltaY = 0; - /** - * For use with WebGL orbitControl. - * @property {Number} _pmouseWheelDeltaY - * @readOnly - * @private - */ - _main.default.prototype._pmouseWheelDeltaY = 0; - /** - * The function mouseWheel() is executed every time a vertical mouse wheel - * event is detected either triggered by an actual mouse wheel or by a - * touchpad.

                - * The event.delta property returns the amount the mouse wheel - * have scrolled. The values can be positive or negative depending on the - * scroll direction (on macOS with "natural" scrolling enabled, the signs - * are inverted).

                - * Browsers may have different default behaviors attached to various - * mouse events. To prevent any default behavior for this event, add - * "return false" to the end of the method.

                - * Due to the current support of the "wheel" event on Safari, the function - * may only work as expected if "return false" is included while using Safari. - * - * @method mouseWheel - * @param {WheelEvent} [event] optional WheelEvent callback argument. - * - * @example - *
                - * - * let pos = 25; - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * rect(25, pos, 50, 50); - * describe(`black 50-by-50 rect moves up and down with vertical scroll. - * fuchsia background`); - * } - * - * function mouseWheel(event) { - * print(event.delta); - * //move the square according to the vertical scroll amount - * pos += event.delta; - * //uncomment to block page scrolling - * //return false; - * } - * - *
                - */ - _main.default.prototype._onwheel = function (e) { - var context = this._isGlobal ? window : this; - this._setProperty('_mouseWheelDeltaY', e.deltaY); - if (typeof context.mouseWheel === 'function') { - e.delta = e.deltaY; - var executeDefault = context.mouseWheel(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The function requestPointerLock() - * locks the pointer to its current position and makes it invisible. - * Use movedX and movedY to get the difference the mouse was moved since - * the last call of draw. - * Note that not all browsers support this feature. - * This enables you to create experiences that aren't limited by the mouse moving out of the screen - * even if it is repeatedly moved into one direction. - * For example, a first person perspective experience. - * - * @method requestPointerLock - * @example - *
                - * - * let cam; - * function setup() { - * createCanvas(100, 100, WEBGL); - * requestPointerLock(); - * cam = createCamera(); - * } - * - * function draw() { - * background(255); - * cam.pan(-movedX * 0.001); - * cam.tilt(movedY * 0.001); - * sphere(25); - * describe(`3D scene moves according to mouse mouse movement in a - * first person perspective`); - * } - * - *
                - */ - _main.default.prototype.requestPointerLock = function () { - // pointer lock object forking for cross browser - var canvas = this._curElement.elt; - canvas.requestPointerLock = canvas.requestPointerLock || canvas.mozRequestPointerLock; - if (!canvas.requestPointerLock) { - console.log('requestPointerLock is not implemented in this browser'); - return false; - } - canvas.requestPointerLock(); - return true; - }; - /** - * The function exitPointerLock() - * exits a previously triggered pointer Lock - * for example to make ui elements usable etc - * - * @method exitPointerLock - * @example - *
                - * - * //click the canvas to lock the pointer - * //click again to exit (otherwise escape) - * let locked = false; - * function draw() { - * background(237, 34, 93); - * describe('cursor gets locked / unlocked on mouse-click'); - * } - * function mouseClicked() { - * if (!locked) { - * locked = true; - * requestPointerLock(); - * } else { - * exitPointerLock(); - * locked = false; - * } - * } - * - *
                - */ - _main.default.prototype.exitPointerLock = function () { - document.exitPointerLock(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 318: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.string.includes'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Events - * @submodule Touch - * @for p5 - * @requires core - */ - /** - * The system variable touches[] contains an array of the positions of all - * current touch points, relative to (0, 0) of the canvas, and IDs identifying a - * unique touch as it moves. Each element in the array is an object with x, y, - * and id properties. - * - * The touches[] array is not supported on Safari and IE on touch-based - * desktops (laptops). - * - * @property {Object[]} touches - * @readOnly - * - * @example - *
                - * - * // On a touchscreen device, touch - * // the canvas using one or more fingers - * // at the same time - * function draw() { - * clear(); - * let display = touches.length + ' touches'; - * text(display, 5, 10); - * describe(`Number of touches currently registered are displayed - * on the canvas`); - * } - * - *
                - */ - - _main.default.prototype.touches = [ - ]; - _main.default.prototype._updateTouchCoords = function (e) { - if (this._curElement !== null) { - var touches = [ - ]; - for (var i = 0; i < e.touches.length; i++) { - touches[i] = getTouchInfo(this._curElement.elt, this.width, this.height, e, i); - } - this._setProperty('touches', touches); - } - }; - function getTouchInfo(canvas, w, h, e) { - var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; - var rect = canvas.getBoundingClientRect(); - var sx = canvas.scrollWidth / w || 1; - var sy = canvas.scrollHeight / h || 1; - var touch = e.touches[i] || e.changedTouches[i]; - return { - x: (touch.clientX - rect.left) / sx, - y: (touch.clientY - rect.top) / sy, - winX: touch.clientX, - winY: touch.clientY, - id: touch.identifier - }; - } /** - * The touchStarted() function is called once after every time a touch is - * registered. If no touchStarted() function is defined, the mousePressed() - * function will be called instead if it is defined.

                - * Browsers may have different default behaviors attached to various touch - * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. - * - * @method touchStarted - * @param {TouchEvent} [event] optional TouchEvent callback argument. - * @example - *
                - * - * // Touch within the image to change - * // the value of the rectangle - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('50-by-50 black rect turns white with touch event.'); - * } - * function touchStarted() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function touchStarted() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * describe('no image displayed'); - * - *
                - * - *
                - * - * // returns a TouchEvent object - * // as a callback argument - * function touchStarted(event) { - * console.log(event); - * } - * describe('no image displayed'); - * - *
                - */ - - _main.default.prototype._ontouchstart = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._setProperty('mouseIsPressed', true); - this._updateTouchCoords(e); - this._updateNextMouseCoords(e); - this._updateMouseCoords(); // reset pmouseXY at the start of each touch event - if (typeof context.touchStarted === 'function') { - executeDefault = context.touchStarted(e); - if (executeDefault === false) { - e.preventDefault(); - } // only safari needs this manual fallback for consistency - - } else if (navigator.userAgent.toLowerCase().includes('safari') && typeof context.mousePressed === 'function') { - executeDefault = context.mousePressed(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The touchMoved() function is called every time a touch move is registered. - * If no touchMoved() function is defined, the mouseDragged() function will - * be called instead if it is defined.

                - * Browsers may have different default behaviors attached to various touch - * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. - * - * @method touchMoved - * @param {TouchEvent} [event] optional TouchEvent callback argument. - * @example - *
                - * - * // Move your finger across the page - * // to change its value - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('50-by-50 black rect turns lighter with touch until white. resets'); - * } - * function touchMoved() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function touchMoved() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * describe('no image displayed'); - * - *
                - * - *
                - * - * // returns a TouchEvent object - * // as a callback argument - * function touchMoved(event) { - * console.log(event); - * } - * describe('no image displayed'); - * - *
                - */ - _main.default.prototype._ontouchmove = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._updateTouchCoords(e); - this._updateNextMouseCoords(e); - if (typeof context.touchMoved === 'function') { - executeDefault = context.touchMoved(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.mouseDragged === 'function') { - executeDefault = context.mouseDragged(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The touchEnded() function is called every time a touch ends. If no - * touchEnded() function is defined, the mouseReleased() function will be - * called instead if it is defined.

                - * Browsers may have different default behaviors attached to various touch - * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. - * - * @method touchEnded - * @param {TouchEvent} [event] optional TouchEvent callback argument. - * @example - *
                - * - * // Release touch within the image to - * // change the value of the rectangle - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('50-by-50 black rect turns white with touch.'); - * } - * function touchEnded() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                - * - *
                - * - * function touchEnded() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * describe('no image displayed'); - * - *
                - * - *
                - * - * // returns a TouchEvent object - * // as a callback argument - * function touchEnded(event) { - * console.log(event); - * } - * describe('no image displayed'); - * - *
                - */ - _main.default.prototype._ontouchend = function (e) { - this._setProperty('mouseIsPressed', false); - this._updateTouchCoords(e); - this._updateNextMouseCoords(e); - var context = this._isGlobal ? window : this; - var executeDefault; - if (typeof context.touchEnded === 'function') { - executeDefault = context.touchEnded(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.mouseReleased === 'function') { - executeDefault = context.mouseReleased(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.string.includes': 209 - } - ], - 319: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.int32-array'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.int32-array'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - /** - * This module defines the filters for use with image buffers. - * - * This module is basically a collection of functions stored in an object - * as opposed to modules. The functions are destructive, modifying - * the passed in canvas rather than creating a copy. - * - * Generally speaking users of this module will use the Filters.apply method - * on a canvas to create an effect. - * - * A number of functions are borrowed/adapted from - * http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ - * or the java processing implementation. - */ - var Filters = { - /* - * Helper functions - */ - /** - * Returns the pixel buffer for a canvas. - * - * @private - * - * @param {Canvas|ImageData} canvas the canvas to get pixels from - * @return {Uint8ClampedArray} a one-dimensional array containing - * the data in the RGBA order, with integer - * values between 0 and 255. - */ - _toPixels: function _toPixels(canvas) { - // Return pixel data if 'canvas' is an ImageData object. - if (canvas instanceof ImageData) { - return canvas.data; - } else { - // Check 2D context support. - if (canvas.getContext('2d')) { - // Retrieve pixel data. - return canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height).data; - } else if (canvas.getContext('webgl')) { - //Check WebGL context support - var gl = canvas.getContext('webgl'); - // Calculate the size of pixel data - // (4 bytes per pixel - one byte for each RGBA channel). - var len = gl.drawingBufferWidth * gl.drawingBufferHeight * 4; - var data = new Uint8Array(len); - // Use gl.readPixels to fetch pixel data from the WebGL - // canvas, storing it in the data array as UNSIGNED_BYTE integers. - gl.readPixels(0, 0, canvas.width, canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, data); - return data; - } - } - }, - /** - * Returns a 32-bit number containing ARGB data at the ith pixel in the - * 1D array containing pixels data. - * - * @private - * - * @param {Uint8ClampedArray} data array returned by _toPixels() - * @param {Integer} i index of a 1D Image Array - * @return {Integer} 32-bit integer value representing - * ARGB value. - */ - _getARGB: function _getARGB(data, i) { - // Determine the starting position in the 'data' array for the 'i'-th pixel. - var offset = i * 4; - return ( // Combining the extracted components using bitwise OR operations to form the final ARGB value. - data[offset + 3] << 24 & 4278190080 | //Extract alpha component - data[offset] << 16 & 16711680 | //Extract Red component - data[offset + 1] << 8 & 65280 | //Extract green component - data[offset + 2] & 255 //Extract blue component - ); - }, - /** - * Modifies pixels RGBA values to values contained in the data object. - * - * @private - * - * @param {Uint8ClampedArray} pixels array returned by _toPixels() - * @param {Int32Array} data source 1D array where each value - * represents ARGB values - */ - _setPixels: function _setPixels(pixels, data) { - var offset = 0; - for (var i = 0, al = pixels.length; i < al; i++) { - offset = i * 4; - pixels[offset + 0] = (data[i] & 16711680) >>> 16; - pixels[offset + 1] = (data[i] & 65280) >>> 8; - pixels[offset + 2] = data[i] & 255; - pixels[offset + 3] = (data[i] & 4278190080) >>> 24; - } - }, - /** - * Returns the ImageData object for a canvas. - * https://developer.mozilla.org/en-US/docs/Web/API/ImageData - * - * @private - * - * @param {Canvas|ImageData} canvas canvas to get image data from - * @return {ImageData} Holder of pixel data (and width and - * height) for a canvas - */ - _toImageData: function _toImageData(canvas) { - if (canvas instanceof ImageData) { - return canvas; - } else { - return canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height); - } - }, - /** - * Returns a blank ImageData object. - * - * @private - * - * @param {Integer} width - * @param {Integer} height - * @return {ImageData} - */ - _createImageData: function _createImageData(width, height) { - Filters._tmpCanvas = document.createElement('canvas'); - Filters._tmpCtx = Filters._tmpCanvas.getContext('2d'); - return this._tmpCtx.createImageData(width, height); - }, - /** - * Applys a filter function to a canvas. - * - * The difference between this and the actual filter functions defined below - * is that the filter functions generally modify the pixel buffer but do - * not actually put that data back to the canvas (where it would actually - * update what is visible). By contrast this method does make the changes - * actually visible in the canvas. - * - * The apply method is the method that callers of this module would generally - * use. It has been separated from the actual filters to support an advanced - * use case of creating a filter chain that executes without actually updating - * the canvas in between everystep. - * - * @private - * @param {HTMLCanvasElement} canvas The input canvas to apply the filter on. - * @param {function(ImageData,Object)} func The filter function to apply to the canvas's pixel data. - * @param {Object} filterParam An optional parameter to pass to the filter function. - */ - apply: function apply(canvas, func, filterParam) { - var pixelsState = canvas.getContext('2d'); - var imageData = pixelsState.getImageData(0, 0, canvas.width, canvas.height); - //Filters can either return a new ImageData object, or just modify - //the one they received. - var newImageData = func(imageData, filterParam); - //If new ImageData is returned, replace the canvas's pixel data with it. - if (newImageData instanceof ImageData) { - pixelsState.putImageData(newImageData, 0, 0, 0, 0, canvas.width, canvas.height); - } else { - //Restore the original pixel. - pixelsState.putImageData(imageData, 0, 0, 0, 0, canvas.width, canvas.height); - } - }, - /* - * Filters - */ - /** - * Converts the image to black and white pixels depending if they are above or - * below the threshold defined by the level parameter. The parameter must be - * between 0.0 (black) and 1.0 (white). If no level is specified, 0.5 is used. - * - * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ - * - * @private - * @param {Canvas} canvas Canvas to apply thershold filter on. - * @param {Float} level Threshold level (0-1). - */ - threshold: function threshold(canvas, level) { - var pixels = Filters._toPixels(canvas); - if (level === undefined) { - level = 0.5; - } // Calculate threshold value on a (0-255) scale. - - var thresh = Math.floor(level * 255); - for (var i = 0; i < pixels.length; i += 4) { - var r = pixels[i]; - var g = pixels[i + 1]; - var b = pixels[i + 2]; - // CIE luminance for RGB - var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; - var val = void 0; - if (gray >= thresh) { - val = 255; - } else { - val = 0; - } - pixels[i] = pixels[i + 1] = pixels[i + 2] = val; //set pixel to val. - } - }, - /** - * Converts any colors in the image to grayscale equivalents. - * No parameter is used. - * - * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ - * - * @private - * @param {Canvas} canvas Canvas to apply gray filter on. - */ - gray: function gray(canvas) { - var pixels = Filters._toPixels(canvas); - for (var i = 0; i < pixels.length; i += 4) { - var r = pixels[i]; - var g = pixels[i + 1]; - var b = pixels[i + 2]; - // CIE luminance for RGB - var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; - pixels[i] = pixels[i + 1] = pixels[i + 2] = gray; // set pixel to gray. - } - }, - /** - * Sets the alpha channel to entirely opaque. No parameter is used. - * - * @private - * @param {Canvas} canvas - */ - opaque: function opaque(canvas) { - var pixels = Filters._toPixels(canvas); - for (var i = 0; i < pixels.length; i += 4) { - pixels[i + 3] = 255; - } - return pixels; - }, - /** - * Sets each pixel to its inverse value. No parameter is used. - * @private - * @param {Canvas} canvas - */ - invert: function invert(canvas) { - var pixels = Filters._toPixels(canvas); - for (var i = 0; i < pixels.length; i += 4) { - pixels[i] = 255 - pixels[i]; - pixels[i + 1] = 255 - pixels[i + 1]; - pixels[i + 2] = 255 - pixels[i + 2]; - } - }, - /** - * Limits each channel of the image to the number of colors specified as - * the parameter. The parameter can be set to values between 2 and 255, but - * results are most noticeable in the lower ranges. - * - * Adapted from java based processing implementation - * - * @private - * @param {Canvas} canvas - * @param {Integer} level - */ - posterize: function posterize(canvas, level) { - var pixels = Filters._toPixels(canvas); - if (level === undefined) { - level = 4; - } - if (level < 2 || level > 255) { - throw new Error('Level must be greater than 2 and less than 255 for posterize'); - } - var levels1 = level - 1; - for (var i = 0; i < pixels.length; i += 4) { - var rlevel = pixels[i]; - var glevel = pixels[i + 1]; - var blevel = pixels[i + 2]; - // New pixel value by posterizing each color. - pixels[i] = (rlevel * level >> 8) * 255 / levels1; - pixels[i + 1] = (glevel * level >> 8) * 255 / levels1; - pixels[i + 2] = (blevel * level >> 8) * 255 / levels1; - } - }, - /** - * Increases the bright areas in an image. - * @private - * @param {Canvas} canvas - */ - dilate: function dilate(canvas) { - var pixels = Filters._toPixels(canvas); - var currIdx = 0; - var maxIdx = pixels.length ? pixels.length / 4 : 0; - var out = new Int32Array(maxIdx); - var currRowIdx, - maxRowIdx, - colOrig, - colOut, - currLum; - var idxRight, - idxLeft, - idxUp, - idxDown; - var colRight, - colLeft, - colUp, - colDown; - var lumRight, - lumLeft, - lumUp, - lumDown; - // Iterates through rows of pixels. - while (currIdx < maxIdx) { - currRowIdx = currIdx; - maxRowIdx = currIdx + canvas.width; - // Iterates through pixels within the current row. - while (currIdx < maxRowIdx) { - // Get original color of current pixel. - colOrig = colOut = Filters._getARGB(pixels, currIdx); - idxLeft = currIdx - 1; - idxRight = currIdx + 1; - idxUp = currIdx - canvas.width; - idxDown = currIdx + canvas.width; - // Adjust the indices to avoid going out of bounds. - if (idxLeft < currRowIdx) { - idxLeft = currIdx; - } - if (idxRight >= maxRowIdx) { - idxRight = currIdx; - } - if (idxUp < 0) { - idxUp = 0; - } - if (idxDown >= maxIdx) { - idxDown = currIdx; - } - colUp = Filters._getARGB(pixels, idxUp); - colLeft = Filters._getARGB(pixels, idxLeft); - colDown = Filters._getARGB(pixels, idxDown); - colRight = Filters._getARGB(pixels, idxRight); - // Compute luminance - currLum = 77 * (colOrig >> 16 & 255) + 151 * (colOrig >> 8 & 255) + 28 * (colOrig & 255); - lumLeft = 77 * (colLeft >> 16 & 255) + 151 * (colLeft >> 8 & 255) + 28 * (colLeft & 255); - lumRight = 77 * (colRight >> 16 & 255) + 151 * (colRight >> 8 & 255) + 28 * (colRight & 255); - lumUp = 77 * (colUp >> 16 & 255) + 151 * (colUp >> 8 & 255) + 28 * (colUp & 255); - lumDown = 77 * (colDown >> 16 & 255) + 151 * (colDown >> 8 & 255) + 28 * (colDown & 255); - // Update the output color based on the highest luminance value - if (lumLeft > currLum) { - colOut = colLeft; - currLum = lumLeft; - } - if (lumRight > currLum) { - colOut = colRight; - currLum = lumRight; - } - if (lumUp > currLum) { - colOut = colUp; - currLum = lumUp; - } - if (lumDown > currLum) { - colOut = colDown; - currLum = lumDown; - } // Store the updated color. - - out[currIdx++] = colOut; - } - } - Filters._setPixels(pixels, out); - }, - /** - * Reduces the bright areas in an image. - * Similar to `dilate()`, but updates the output color based on the lowest luminance value. - * @private - * @param {Canvas} canvas - */ - erode: function erode(canvas) { - var pixels = Filters._toPixels(canvas); - var currIdx = 0; - var maxIdx = pixels.length ? pixels.length / 4 : 0; - var out = new Int32Array(maxIdx); - var currRowIdx, - maxRowIdx, - colOrig, - colOut, - currLum; - var idxRight, - idxLeft, - idxUp, - idxDown; - var colRight, - colLeft, - colUp, - colDown; - var lumRight, - lumLeft, - lumUp, - lumDown; - while (currIdx < maxIdx) { - currRowIdx = currIdx; - maxRowIdx = currIdx + canvas.width; - while (currIdx < maxRowIdx) { - colOrig = colOut = Filters._getARGB(pixels, currIdx); - idxLeft = currIdx - 1; - idxRight = currIdx + 1; - idxUp = currIdx - canvas.width; - idxDown = currIdx + canvas.width; - if (idxLeft < currRowIdx) { - idxLeft = currIdx; - } - if (idxRight >= maxRowIdx) { - idxRight = currIdx; - } - if (idxUp < 0) { - idxUp = 0; - } - if (idxDown >= maxIdx) { - idxDown = currIdx; - } - colUp = Filters._getARGB(pixels, idxUp); - colLeft = Filters._getARGB(pixels, idxLeft); - colDown = Filters._getARGB(pixels, idxDown); - colRight = Filters._getARGB(pixels, idxRight); - //compute luminance - currLum = 77 * (colOrig >> 16 & 255) + 151 * (colOrig >> 8 & 255) + 28 * (colOrig & 255); - lumLeft = 77 * (colLeft >> 16 & 255) + 151 * (colLeft >> 8 & 255) + 28 * (colLeft & 255); - lumRight = 77 * (colRight >> 16 & 255) + 151 * (colRight >> 8 & 255) + 28 * (colRight & 255); - lumUp = 77 * (colUp >> 16 & 255) + 151 * (colUp >> 8 & 255) + 28 * (colUp & 255); - lumDown = 77 * (colDown >> 16 & 255) + 151 * (colDown >> 8 & 255) + 28 * (colDown & 255); - if (lumLeft < currLum) { - colOut = colLeft; - currLum = lumLeft; - } - if (lumRight < currLum) { - colOut = colRight; - currLum = lumRight; - } - if (lumUp < currLum) { - colOut = colUp; - currLum = lumUp; - } - if (lumDown < currLum) { - colOut = colDown; - currLum = lumDown; - } // Store the updated color. - - out[currIdx++] = colOut; - } - } - Filters._setPixels(pixels, out); - }, - blur: function blur(canvas, radius) { - blurARGB(canvas, radius); - } - }; - // BLUR - // Internal kernel stuff for the gaussian blur filter. - var blurRadius; - var blurKernelSize; - var blurKernel; - var blurMult; - /* - * Port of https://github.com/processing/processing/blob/ - * main/core/src/processing/core/PImage.java#L1250 - * - * Optimized code for building the blur kernel. - * further optimized blur code (approx. 15% for radius=20) - * bigger speed gains for larger radii (~30%) - * added support for various image types (ALPHA, RGB, ARGB) - * [toxi 050728] - */ - function buildBlurKernel(r) { - var radius = r * 3.5 | 0; - radius = radius < 1 ? 1 : radius < 248 ? radius : 248; - if (blurRadius !== radius) { - blurRadius = radius; - // Calculating the size of the blur kernel - blurKernelSize = 1 + blurRadius << 1; - blurKernel = new Int32Array(blurKernelSize); - blurMult = new Array(blurKernelSize); - for (var l = 0; l < blurKernelSize; l++) { - blurMult[l] = new Int32Array(256); - } - var bk, - bki; - var bm, - bmi; - // Generating blur kernel values. - for (var i = 1, radiusi = radius - 1; i < radius; i++) { - blurKernel[radius + i] = blurKernel[radiusi] = bki = radiusi * radiusi; - bm = blurMult[radius + i]; - bmi = blurMult[radiusi--]; - for (var j = 0; j < 256; j++) { - bm[j] = bmi[j] = bki * j; - } - } - bk = blurKernel[radius] = radius * radius; - bm = blurMult[radius]; - for (var k = 0; k < 256; k++) { - bm[k] = bk * k; - } - } - } // Port of https://github.com/processing/processing/blob/ - // main/core/src/processing/core/PImage.java#L1433 - - function blurARGB(canvas, radius) { - // Get pixel data. - var pixels = Filters._toPixels(canvas); - var width = canvas.width; - var height = canvas.height; - var numPackedPixels = width * height; - var argb = new Int32Array(numPackedPixels); - for (var j = 0; j < numPackedPixels; j++) { - argb[j] = Filters._getARGB(pixels, j); - } - var sum, - cr, - cg, - cb, - ca; - var read, - ri, - ym, - ymi, - bk0; - var a2 = new Int32Array(numPackedPixels); - var r2 = new Int32Array(numPackedPixels); - var g2 = new Int32Array(numPackedPixels); - var b2 = new Int32Array(numPackedPixels); - var yi = 0; - buildBlurKernel(radius); - var x, - y, - i; - var bm; - // Horizontal pass. - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - cb = cg = cr = ca = sum = 0; - read = x - blurRadius; - // Handle edge cases. - if (read < 0) { - bk0 = - read; - read = 0; - } else { - if (read >= width) { - break; - } - bk0 = 0; - } - for (i = bk0; i < blurKernelSize; i++) { - if (read >= width) { - break; - } - var c = argb[read + yi]; - bm = blurMult[i]; - ca += bm[(c & - 16777216) >>> 24]; - cr += bm[(c & 16711680) >> 16]; - cg += bm[(c & 65280) >> 8]; - cb += bm[c & 255]; - sum += blurKernel[i]; - read++; - } - ri = yi + x; - a2[ri] = ca / sum; - r2[ri] = cr / sum; - g2[ri] = cg / sum; - b2[ri] = cb / sum; - } - yi += width; - } - yi = 0; - ym = - blurRadius; - ymi = ym * width; - // Vertical pass. - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - cb = cg = cr = ca = sum = 0; - // Handle edge cases. - if (ym < 0) { - bk0 = ri = - ym; - read = x; - } else { - if (ym >= height) { - break; - } - bk0 = 0; - ri = ym; - read = x + ymi; - } - for (i = bk0; i < blurKernelSize; i++) { - if (ri >= height) { - break; - } - bm = blurMult[i]; - ca += bm[a2[read]]; - cr += bm[r2[read]]; - cg += bm[g2[read]]; - cb += bm[b2[read]]; - sum += blurKernel[i]; - ri++; - read += width; - } // Set final ARGB value - - argb[x + yi] = ca / sum << 24 | cr / sum << 16 | cg / sum << 8 | cb / sum; - } - yi += width; - ymi += width; - ym++; - } - Filters._setPixels(pixels, argb); - } - var _default = Filters; - exports.default = _default; - }, - { - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.int32-array': 235, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-array': 252 - } - ], - 320: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var _omggif = _interopRequireDefault(_dereq_('omggif')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Image - * @submodule Image - * @for p5 - * @requires core - */ - /** - * This module defines the p5 methods for the p5.Image class - * for drawing images to the main display canvas. - */ - /** - * Creates a new p5.Image object. The new image is - * transparent by default. - * - * `createImage()` uses the `width` and `height` paremeters to set the new - * p5.Image object's dimensions in pixels. The new - * p5.Image can be modified by updating its - * pixels array or by calling its - * get() and - * set() methods. The - * loadPixels() method must be called - * before reading or modifying pixel values. The - * updatePixels() method must be called - * for updates to take effect. - * - * @method createImage - * @param {Integer} width width in pixels. - * @param {Integer} height height in pixels. - * @return {p5.Image} new p5.Image object. - * @example - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - * - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * let a = map(x, 0, img.width, 0, 255); - * let c = color(0, a); - * img.set(x, y, c); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A square with a horizontal color gradient that transitions from gray to black.'); - * - *
                - * - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let d = pixelDensity(); - * let halfImage = 4 * (d * img.width) * (d * img.height / 2); - * for (let i = 0; i < halfImage; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - */ - - _main.default.prototype.createImage = function (width, height) { - _main.default._validateParameters('createImage', arguments); - return new _main.default.Image(width, height); - }; - /** - * Saves the current canvas as an image. The browser will either save the - * file immediately or prompt the user with a dialogue window. - * - * @method saveCanvas - * @param {p5.Framebuffer|p5.Element|HTMLCanvasElement} selectedCanvas reference to a - * specific HTML5 canvas element. - * @param {String} [filename] file name. Defaults to 'untitled'. - * @param {String} [extension] file extension, either 'jpg' or 'png'. Defaults to 'png'. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(255); - * saveCanvas(); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(255); - * saveCanvas('myCanvas.jpg'); - * } - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(255); - * saveCanvas('myCanvas', 'jpg'); - * } - * - *
                - * - *
                - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(255); - * saveCanvas(cnv); - * } - * - *
                - * - *
                - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(255); - * saveCanvas(cnv, 'myCanvas.jpg'); - * } - * - *
                - * - *
                - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(255); - * saveCanvas(cnv, 'myCanvas', 'jpg'); - * } - * - *
                - */ - /** - * @method saveCanvas - * @param {String} [filename] - * @param {String} [extension] - */ - _main.default.prototype.saveCanvas = function () { - _main.default._validateParameters('saveCanvas', arguments); - // copy arguments to array - var args = [ - ].slice.call(arguments); - var htmlCanvas, - filename, - extension, - temporaryGraphics; - if (arguments[0] instanceof HTMLCanvasElement) { - htmlCanvas = arguments[0]; - args.shift(); - } else if (arguments[0] instanceof _main.default.Element) { - htmlCanvas = arguments[0].elt; - args.shift(); - } else if (arguments[0] instanceof _main.default.Framebuffer) { - var framebuffer = arguments[0]; - temporaryGraphics = this.createGraphics(framebuffer.width, framebuffer.height); - temporaryGraphics.pixelDensity(pixelDensity()); - framebuffer.loadPixels(); - temporaryGraphics.loadPixels(); - temporaryGraphics.pixels.set(framebuffer.pixels); - temporaryGraphics.updatePixels(); - htmlCanvas = temporaryGraphics.elt; - args.shift(); - } else { - htmlCanvas = this._curElement && this._curElement.elt; - } - if (args.length >= 1) { - filename = args[0]; - } - if (args.length >= 2) { - extension = args[1]; - } - extension = extension || _main.default.prototype._checkFileExtension(filename, extension) [1] || 'png'; - var mimeType; - switch (extension) { - default: - //case 'png': - mimeType = 'image/png'; - break; - case 'jpeg': - case 'jpg': - mimeType = 'image/jpeg'; - break; - } - htmlCanvas.toBlob(function (blob) { - _main.default.prototype.downloadFile(blob, filename, extension); - if (temporaryGraphics) temporaryGraphics.remove(); - }, mimeType); - }; - // this is the old saveGif, left here for compatibility purposes - // the only place I found it being used was on image/p5.Image.js, on the - // save function. that has been changed to use this function. - _main.default.prototype.encodeAndDownloadGif = function (pImg, filename) { - var props = pImg.gifProperties; - //convert loopLimit back into Netscape Block formatting - var loopLimit = props.loopLimit; - if (loopLimit === 1) { - loopLimit = null; - } else if (loopLimit === null) { - loopLimit = 0; - } - var buffer = new Uint8Array(pImg.width * pImg.height * props.numFrames); - var allFramesPixelColors = [ - ]; - // Used to determine the occurrence of unique palettes and the frames - // which use them - var paletteFreqsAndFrames = { - }; - // Pass 1: - //loop over frames and get the frequency of each palette - for (var i = 0; i < props.numFrames; i++) { - var paletteSet = new Set(); - var data = props.frames[i].image.data; - var dataLength = data.length; - // The color for each pixel in this frame ( for easier lookup later ) - var pixelColors = new Uint32Array(pImg.width * pImg.height); - for (var j = 0, k = 0; j < dataLength; j += 4, k++) { - var r = data[j + 0]; - var g = data[j + 1]; - var b = data[j + 2]; - var color = r << 16 | g << 8 | b << 0; - paletteSet.add(color); - // What color does this pixel have in this frame ? - pixelColors[k] = color; - } // A way to put use the entire palette as an object key - - var paletteStr = _toConsumableArray(paletteSet).sort().toString(); - if (paletteFreqsAndFrames[paletteStr] === undefined) { - paletteFreqsAndFrames[paletteStr] = { - freq: 1, - frames: [ - i - ] - }; - } else { - paletteFreqsAndFrames[paletteStr].freq += 1; - paletteFreqsAndFrames[paletteStr].frames.push(i); - } - allFramesPixelColors.push(pixelColors); - } - var framesUsingGlobalPalette = [ - ]; - // Now to build the global palette - // Sort all the unique palettes in descending order of their occurrence - var palettesSortedByFreq = Object.keys(paletteFreqsAndFrames).sort(function (a, b) { - return paletteFreqsAndFrames[b].freq - paletteFreqsAndFrames[a].freq; - }); - // The initial global palette is the one with the most occurrence - var globalPalette = palettesSortedByFreq[0].split(',').map(function (a) { - return parseInt(a); - }); - framesUsingGlobalPalette = framesUsingGlobalPalette.concat(paletteFreqsAndFrames[globalPalette].frames); - var globalPaletteSet = new Set(globalPalette); - // Build a more complete global palette - // Iterate over the remaining palettes in the order of - // their occurrence and see if the colors in this palette which are - // not in the global palette can be added there, while keeping the length - // of the global palette <= 256 - for (var _i = 1; _i < palettesSortedByFreq.length; _i++) { - var palette = palettesSortedByFreq[_i].split(',').map(function (a) { - return parseInt(a); - }); - var difference = palette.filter(function (x) { - return !globalPaletteSet.has(x); - }); - if (globalPalette.length + difference.length <= 256) { - for (var _j = 0; _j < difference.length; _j++) { - globalPalette.push(difference[_j]); - globalPaletteSet.add(difference[_j]); - } // All frames using this palette now use the global palette - - framesUsingGlobalPalette = framesUsingGlobalPalette.concat(paletteFreqsAndFrames[palettesSortedByFreq[_i]].frames); - } - } - framesUsingGlobalPalette = new Set(framesUsingGlobalPalette); - // Build a lookup table of the index of each color in the global palette - // Maps a color to its index - var globalIndicesLookup = { - }; - for (var _i2 = 0; _i2 < globalPalette.length; _i2++) { - if (!globalIndicesLookup[globalPalette[_i2]]) { - globalIndicesLookup[globalPalette[_i2]] = _i2; - } - } // force palette to be power of 2 - - var powof2 = 1; - while (powof2 < globalPalette.length) { - powof2 <<= 1; - } - globalPalette.length = powof2; - // global opts - var opts = { - loop: loopLimit, - palette: new Uint32Array(globalPalette) - }; - var gifWriter = new _omggif.default.GifWriter(buffer, pImg.width, pImg.height, opts); - var previousFrame = { - }; - // Pass 2 - // Determine if the frame needs a local palette - // Also apply transparency optimization. This function will often blow up - // the size of a GIF if not for transparency. If a pixel in one frame has - // the same color in the previous frame, that pixel can be marked as - // transparent. We decide one particular color as transparent and make all - // transparent pixels take this color. This helps in later in compression. - var _loop = function _loop(_i3) { - var localPaletteRequired = !framesUsingGlobalPalette.has(_i3); - var palette = localPaletteRequired ? [ - ] : globalPalette; - var pixelPaletteIndex = new Uint8Array(pImg.width * pImg.height); - // Lookup table mapping color to its indices - var colorIndicesLookup = { - }; - // All the colors that cannot be marked transparent in this frame - var cannotBeTransparent = new Set(); - allFramesPixelColors[_i3].forEach(function (color, k) { - if (localPaletteRequired) { - if (colorIndicesLookup[color] === undefined) { - colorIndicesLookup[color] = palette.length; - palette.push(color); - } - pixelPaletteIndex[k] = colorIndicesLookup[color]; - } else { - pixelPaletteIndex[k] = globalIndicesLookup[color]; - } - if (_i3 > 0) { - // If even one pixel of this color has changed in this frame - // from the previous frame, we cannot mark it as transparent - if (allFramesPixelColors[_i3 - 1][k] !== color) { - cannotBeTransparent.add(color); - } - } - }); - var frameOpts = { - }; - // Transparency optimization - var canBeTransparent = palette.filter(function (a) { - return !cannotBeTransparent.has(a); - }); - if (canBeTransparent.length > 0) { - // Select a color to mark as transparent - var transparent = canBeTransparent[0]; - var transparentIndex = localPaletteRequired ? colorIndicesLookup[transparent] : globalIndicesLookup[transparent]; - if (_i3 > 0) { - for (var _k = 0; _k < allFramesPixelColors[_i3].length; _k++) { - // If this pixel in this frame has the same color in previous frame - if (allFramesPixelColors[_i3 - 1][_k] === allFramesPixelColors[_i3][_k]) { - pixelPaletteIndex[_k] = transparentIndex; - } - } - frameOpts.transparent = transparentIndex; - // If this frame has any transparency, do not dispose the previous frame - previousFrame.frameOpts.disposal = 1; - } - } - frameOpts.delay = props.frames[_i3].delay / 10; // Move timing back into GIF formatting - if (localPaletteRequired) { - // force palette to be power of 2 - var _powof = 1; - while (_powof < palette.length) { - _powof <<= 1; - } - palette.length = _powof; - frameOpts.palette = new Uint32Array(palette); - } - if (_i3 > 0) { - // add the frame that came before the current one - gifWriter.addFrame(0, 0, pImg.width, pImg.height, previousFrame.pixelPaletteIndex, previousFrame.frameOpts); - } // previous frame object should now have details of this frame - - previousFrame = { - pixelPaletteIndex: pixelPaletteIndex, - frameOpts: frameOpts - }; - }; - for (var _i3 = 0; _i3 < props.numFrames; _i3++) { - _loop(_i3); - } - previousFrame.frameOpts.disposal = 1; - // add the last frame - gifWriter.addFrame(0, 0, pImg.width, pImg.height, previousFrame.pixelPaletteIndex, previousFrame.frameOpts); - var extension = 'gif'; - var blob = new Blob([buffer.slice(0, gifWriter.end())], { - type: 'image/gif' - }); - _main.default.prototype.downloadFile(blob, filename, extension); - }; - /** - * Captures a sequence of frames from the canvas that can be used to create a - * movie. Frames are downloaded as individual image files by default. - * - * The first parameter, `filename`, sets the prefix for the file names. For - * example, setting the prefix to `'frame'` would generate the image files - * `frame0.png`, `frame1.png`, and so on. The second parameter, `extension`, - * sets the file type to either `'png'` or `'jpg'`. - * - * The third parameter, `duration`, sets the duration to record in seconds. - * The maximum duration is 15 seconds. The fourth parameter, `framerate`, sets - * the number of frames to record per second. The maximum frame rate value is - * 22. Limits are placed on `duration` and `framerate` to avoid using too much - * memory. Recording large canvases can easily crash sketches or even web - * browsers. - * - * The fifth parameter, `callback`, is optional. If a function is passed, - * image files won't be saved by default. The callback function can be used - * to process an array containing the data for each captured frame. The array - * of image data contains a sequence of objects with three properties for each - * frame: `imageData`, `filename`, and `extension`. - * - * @method saveFrames - * @param {String} filename prefix of file name. - * @param {String} extension file extension, either 'jpg' or 'png'. - * @param {Number} duration duration in seconds to record. This parameter will be constrained to be less or equal to 15. - * @param {Number} framerate number of frames to save per second. This parameter will be constrained to be less or equal to 22. - * @param {function(Array)} [callback] callback function that will be executed - to handle the image data. This function - should accept an array as argument. The - array will contain the specified number of - frames of objects. Each object has three - properties: `imageData`, `filename`, and `extension`. - * @example - *
                - * - * function draw() { - * let r = frameCount % 255; - * let g = 50; - * let b = 100; - * background(r, g, b); - * - * describe('A square repeatedly changes color from blue to pink.'); - * } - * - * function keyPressed() { - * if (key === 's') { - * saveFrames('frame', 'png', 1, 5); - * } - * } - * - *
                - * - *
                - * - * function draw() { - * let r = frameCount % 255; - * let g = 50; - * let b = 100; - * background(r, g, b); - * - * describe('A square repeatedly changes color from blue to pink.'); - * } - * - * function mousePressed() { - * saveFrames('frame', 'png', 1, 5, data => { - * // Prints an array of objects containing raw image data, - * // filenames, and extensions. - * print(data); - * }); - * } - * - *
                - */ - _main.default.prototype.saveFrames = function (fName, ext, _duration, _fps, callback) { - _main.default._validateParameters('saveFrames', arguments); - var duration = _duration || 3; - duration = _main.default.prototype.constrain(duration, 0, 15); - duration = duration * 1000; - var fps = _fps || 15; - fps = _main.default.prototype.constrain(fps, 0, 22); - var count = 0; - var makeFrame = _main.default.prototype._makeFrame; - var cnv = this._curElement.elt; - var frames = [ - ]; - var frameFactory = setInterval(function () { - frames.push(makeFrame(fName + count, ext, cnv)); - count++; - }, 1000 / fps); - setTimeout(function () { - clearInterval(frameFactory); - if (callback) { - callback(frames); - } else { - for (var _i4 = 0, _frames = frames; _i4 < _frames.length; _i4++) { - var f = _frames[_i4]; - _main.default.prototype.downloadFile(f.imageData, f.filename, f.ext); - } - } - frames = [ - ]; // clear frames - }, duration + 0.01); - }; - _main.default.prototype._makeFrame = function (filename, extension, _cnv) { - var cnv; - if (this) { - cnv = this._curElement.elt; - } else { - cnv = _cnv; - } - var mimeType; - if (!extension) { - extension = 'png'; - mimeType = 'image/png'; - } else { - switch (extension.toLowerCase()) { - case 'png': - mimeType = 'image/png'; - break; - case 'jpeg': - mimeType = 'image/jpeg'; - break; - case 'jpg': - mimeType = 'image/jpeg'; - break; - default: - mimeType = 'image/png'; - break; - } - } - var downloadMime = 'image/octet-stream'; - var imageData = cnv.toDataURL(mimeType); - imageData = imageData.replace(mimeType, downloadMime); - var thisFrame = { - }; - thisFrame.imageData = imageData; - thisFrame.filename = filename; - thisFrame.ext = extension; - return thisFrame; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.set': 207, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint32-array': 251, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256, - 'omggif': 270 - } - ], - 321: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.copy-within'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.copy-within'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - _dereq_('regenerator-runtime/runtime'); - var _main = _interopRequireDefault(_dereq_('../core/main')); - var _helpers = _interopRequireDefault(_dereq_('../core/helpers')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - var _omggif = _interopRequireDefault(_dereq_('omggif')); - var _gifenc = _dereq_('gifenc'); - _dereq_('../core/friendly_errors/validate_params'); - _dereq_('../core/friendly_errors/file_errors'); - _dereq_('../core/friendly_errors/fes_core'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value); - } - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err); - } - _next(undefined); - }); - }; - } /** - * @module Image - * @submodule Loading & Displaying - * @for p5 - * @requires core - */ - /** - * Loads an image to create a p5.Image object. - * - * `loadImage()` interprets the first parameter one of three ways. If the path - * to an image file is provided, `loadImage()` will load it. Paths to local - * files should be relative, such as `'assets/thundercat.jpg'`. URLs such as - * `'https://example.com/thundercat.jpg'` may be blocked due to browser - * security. Raw image data can also be passed as a base64 encoded image in - * the form `'data:image/png;base64,arandomsequenceofcharacters'`. - * - * The second parameter is optional. If a function is passed, it will be - * called once the image has loaded. The callback function can optionally use - * the new p5.Image object. - * - * The third parameter is also optional. If a function is passed, it will be - * called if the image fails to load. The callback function can optionally use - * the event error. - * - * Images can take time to load. Calling `loadImage()` in - * preload() ensures images load before they're - * used in setup() or draw(). - * - * @method loadImage - * @param {String} path path of the image to be loaded or base64 encoded image. - * @param {function(p5.Image)} [successCallback] function called with - * p5.Image once it - * loads. - * @param {function(Event)} [failureCallback] function called with event - * error if the image fails to load. - * @return {p5.Image} the p5.Image object. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * describe('Image of the underside of a white umbrella and a gridded ceiling.'); - * } - * - *
                - * - *
                - * - * function setup() { - * loadImage('assets/laDefense.jpg', img => { - * image(img, 0, 0); - * }); - * describe('Image of the underside of a white umbrella and a gridded ceiling.'); - * } - * - *
                - * - *
                - * - * function setup() { - * loadImage('assets/laDefense.jpg', success, failure); - * } - * - * function success(img) { - * image(img, 0, 0); - * describe('Image of the underside of a white umbrella and a gridded ceiling.'); - * } - * - * function failure(event) { - * console.error('Oops!', event); - * } - * - *
                - */ - - _main.default.prototype.loadImage = function (path, successCallback, failureCallback) { - _main.default._validateParameters('loadImage', arguments); - var pImg = new _main.default.Image(1, 1, this); - var self = this; - var req = new Request(path, { - method: 'GET', - mode: 'cors' - }); - fetch(path, req).then(function (response) { - // GIF section - var contentType = response.headers.get('content-type'); - if (contentType === null) { - console.warn('The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset.'); - } - if (contentType && contentType.includes('image/gif')) { - response.arrayBuffer().then(function (arrayBuffer) { - if (arrayBuffer) { - var byteArray = new Uint8Array(arrayBuffer); - _createGif(byteArray, pImg, successCallback, failureCallback, function (pImg) { - self._decrementPreload(); - }.bind(self)); - } - }, function (e) { - if (typeof failureCallback === 'function') { - failureCallback(e); - self._decrementPreload(); - } else { - console.error(e); - } - }); - } else { - // Non-GIF Section - var img = new Image(); - img.onload = function () { - pImg.width = pImg.canvas.width = img.width; - pImg.height = pImg.canvas.height = img.height; - // Draw the image into the backing canvas of the p5.Image - pImg.drawingContext.drawImage(img, 0, 0); - pImg.modified = true; - if (typeof successCallback === 'function') { - successCallback(pImg); - } - self._decrementPreload(); - }; - img.onerror = function (e) { - _main.default._friendlyFileLoadError(0, img.src); - if (typeof failureCallback === 'function') { - failureCallback(e); - self._decrementPreload(); - } else { - console.error(e); - } - }; - // Set crossOrigin in case image is served with CORS headers. - // This will let us draw to the canvas without tainting it. - // See https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image - // When using data-uris the file will be loaded locally - // so we don't need to worry about crossOrigin with base64 file types. - if (path.indexOf('data:image/') !== 0) { - img.crossOrigin = 'Anonymous'; - } // start loading the image - - img.src = path; - } - pImg.modified = true; - }).catch(function (e) { - _main.default._friendlyFileLoadError(0, path); - if (typeof failureCallback === 'function') { - failureCallback(e); - self._decrementPreload(); - } else { - console.error(e); - } - }); - return pImg; - }; - /** - * Generates a gif from a sketch and saves it to a file. `saveGif()` may be - * called in setup() or at any point while a sketch - * is running. - * - * The first parameter, `fileName`, sets the gif's file name. The second - * parameter, `duration`, sets the gif's duration in seconds. - * - * The third parameter, `options`, is optional. If an object is passed, - * `saveGif()` will use its properties to customize the gif. `saveGif()` - * recognizes the properties `delay`, `units`, `silent`, - * `notificationDuration`, and `notificationID`. - * - * @method saveGif - * @param {String} filename file name of gif. - * @param {Number} duration duration in seconds to capture from the sketch. - * @param {Object} [options] an object that can contain five more properties: - * `delay`, a Number specifying how much time to wait before recording; - * `units`, a String that can be either 'seconds' or 'frames'. By default it's 'seconds’; - * `silent`, a Boolean that defines presence of progress notifications. By default it’s `false`; - * `notificationDuration`, a Number that defines how long in seconds the final notification - * will live. By default it's `0`, meaning the notification will never be removed; - * `notificationID`, a String that specifies the id of the notification's DOM element. By default it’s `'progressBar’`. - * - * @example - *
                - * - * function draw() { - * background(200); - * let c = frameCount % 255; - * fill(c); - * circle(50, 50, 25); - * - * describe('A circle drawn in the middle of a gray square. The circle changes color from black to white, then repeats.'); - * } - * - * function keyPressed() { - * if (key === 's') { - * saveGif('mySketch', 5); - * } - * } - * - *
                - */ - _main.default.prototype.saveGif = /*#__PURE__*/ function () { - var _ref = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee(fileName, duration) { - var options, - delay, - units, - silent, - notificationDuration, - notificationID, - _frameRate, - gifFrameDelay, - nFrames, - nFramesDelay, - totalNumberOfFrames, - frameIterator, - lastPixelDensity, - frames, - p, - pixels, - gl, - data, - gif, - globalPalette, - paletteCache, - getIndexedFrame, - transparentIndex, - prevIndexedFrame, - i, - indexedFrame, - originalIndexedFrame, - _i, - buffer, - extension, - blob, - _args = arguments; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - options = _args.length > 2 && _args[2] !== undefined ? _args[2] : { - delay: 0, - units: 'seconds', - silent: false, - notificationDuration: 0, - notificationID: 'progressBar' - }; - if (!(typeof fileName !== 'string')) { - _context.next = 3; - break; - } - throw TypeError('fileName parameter must be a string'); - case 3: - if (!(typeof duration !== 'number')) { - _context.next = 5; - break; - } - throw TypeError('Duration parameter must be a number'); - case 5: - // extract variables for more comfortable use - delay = options && options.delay || 0; // in seconds - units = options && options.units || 'seconds'; // either 'seconds' or 'frames' - silent = options && options.silent || false; - notificationDuration = options && options.notificationDuration || 0; - notificationID = options && options.notificationID || 'progressBar'; // if arguments in the options object are not correct, cancel operation - if (!(typeof delay !== 'number')) { - _context.next = 12; - break; - } - throw TypeError('Delay parameter must be a number'); - case 12: - if (!(units !== 'seconds' && units !== 'frames')) { - _context.next = 14; - break; - } - throw TypeError('Units parameter must be either "frames" or "seconds"'); - case 14: - if (!(typeof silent !== 'boolean')) { - _context.next = 16; - break; - } - throw TypeError('Silent parameter must be a boolean'); - case 16: - if (!(typeof notificationDuration !== 'number')) { - _context.next = 18; - break; - } - throw TypeError('Notification duration parameter must be a number'); - case 18: - if (!(typeof notificationID !== 'string')) { - _context.next = 20; - break; - } - throw TypeError('Notification ID parameter must be a string'); - case 20: - this._recording = true; - // get the project's framerate - _frameRate = this._targetFrameRate; // if it is undefined or some non useful value, assume it's 60 - if (_frameRate === Infinity || _frameRate === undefined || _frameRate === 0) { - _frameRate = 60; - } // calculate frame delay based on frameRate - // this delay has nothing to do with the - // delay in options, but rather is the delay - // we have to specify to the gif encoder between frames. - - gifFrameDelay = 1 / _frameRate * 1000; // constrain it to be always greater than 20, - // otherwise it won't work in some browsers and systems - // reference: https://stackoverflow.com/questions/64473278/gif-frame-duration-seems-slower-than-expected - gifFrameDelay = gifFrameDelay < 20 ? 20 : gifFrameDelay; - // check the mode we are in and how many frames - // that duration translates to - nFrames = units === 'seconds' ? duration * _frameRate : duration; - nFramesDelay = units === 'seconds' ? delay * _frameRate : delay; - totalNumberOfFrames = nFrames + nFramesDelay; // initialize variables for the frames processing - frameIterator = nFramesDelay; - this.frameCount = frameIterator; - lastPixelDensity = this._pixelDensity; - this.pixelDensity(1); - // We first take every frame that we are going to use for the animation - frames = [ - ]; - if (document.getElementById(notificationID) !== null) document.getElementById(notificationID).remove(); - if (!silent) { - p = this.createP(''); - p.id(notificationID); - p.style('font-size', '16px'); - p.style('font-family', 'Montserrat'); - p.style('background-color', '#ffffffa0'); - p.style('padding', '8px'); - p.style('border-radius', '10px'); - p.position(0, 0); - } - if (this._renderer instanceof _main.default.RendererGL) { - // if we have a WEBGL context, initialize the pixels array - // and the gl context to use them inside the loop - gl = this.drawingContext; - pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4); - } // stop the loop since we are going to manually redraw - - this.noLoop(); - // Defer execution until the rest of the call stack finishes, allowing the - // rest of `setup` to be called (and, importantly, canvases hidden in setup - // to be unhidden.) - // - // Waiting on this empty promise means we'll continue as soon as setup - // finishes without waiting for another frame. - _context.next = 39; - return Promise.resolve(); - case 39: - if (!(frameIterator < totalNumberOfFrames)) { - _context.next = 50; - break; - } /* - we draw the next frame. this is important, since - busy sketches or low end devices might take longer - to render some frames. So we just wait for the frame - to be drawn and immediately save it to a buffer and continue - */ - - this.redraw(); - // depending on the context we'll extract the pixels one way - // or another - data = undefined; - if (this._renderer instanceof _main.default.RendererGL) { - pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4); - gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels); - data = _flipPixels(pixels); - } else { - data = this.drawingContext.getImageData(0, 0, this.width, this.height).data; - } - frames.push(data); - frameIterator++; - if (!silent) { - p.html('Saved frame ' + frames.length.toString() + ' out of ' + nFrames.toString()); - } - _context.next = 48; - return new Promise(function (resolve) { - return setTimeout(resolve, 0); - }); - case 48: - _context.next = 39; - break; - case 50: - if (!silent) p.html('Frames processed, generating color palette...'); - this.loop(); - this.pixelDensity(lastPixelDensity); - // create the gif encoder and the colorspace format - gif = (0, _gifenc.GIFEncoder) (); // calculate the global palette for this set of frames - globalPalette = _generateGlobalPalette(frames); // Rather than using applyPalette() from the gifenc library, we use our - // own function to map frame pixels to a palette color. This way, we can - // cache palette color mappings between frames for extra performance, and - // use our own caching mechanism to avoid flickering colors from cache - // key collisions. - paletteCache = { - }; - getIndexedFrame = function getIndexedFrame(frame) { - var length = frame.length / 4; - var index = new Uint8Array(length); - for (var i = 0; i < length; i++) { - var key = frame[i * 4] << 24 | frame[i * 4 + 1] << 16 | frame[i * 4 + 2] << 8 | frame[i * 4 + 3]; - if (paletteCache[key] === undefined) { - paletteCache[key] = (0, _gifenc.nearestColorIndex) (globalPalette, frame.slice(i * 4, (i + 1) * 4)); - } - index[i] = paletteCache[key]; - } - return index; - }; // the way we designed the palette means we always take the last index for transparency - transparentIndex = globalPalette.length - 1; // we are going to iterate the frames in pairs, n-1 and n - prevIndexedFrame = [ - ]; - i = 0; - case 60: - if (!(i < frames.length)) { - _context.next = 71; - break; - } //const indexedFrame = applyPalette(frames[i], globalPaletteWithoutAlpha, 'rgba565'); - - indexedFrame = getIndexedFrame(frames[i]); // Make a copy of the palette-applied frame before editing the original - // to use transparent pixels - originalIndexedFrame = indexedFrame.slice(); - if (i === 0) { - gif.writeFrame(indexedFrame, this.width, this.height, { - palette: globalPalette, - delay: gifFrameDelay, - dispose: 1 - }); - } else { - // Matching pixels between frames can be set to full transparency, - // allowing the previous frame's pixels to show through. We only do - // this for pixels that get mapped to the same quantized color so that - // the resulting image would be the same. - for (_i = 0; _i < indexedFrame.length; _i++) { - if (indexedFrame[_i] === prevIndexedFrame[_i]) { - indexedFrame[_i] = transparentIndex; - } - } // Write frame into the encoder - - gif.writeFrame(indexedFrame, this.width, this.height, { - delay: gifFrameDelay, - transparent: true, - transparentIndex: transparentIndex, - dispose: 1 - }); - } - prevIndexedFrame = originalIndexedFrame; - if (!silent) { - p.html('Rendered frame ' + i.toString() + ' out of ' + nFrames.toString()); - } // this just makes the process asynchronous, preventing - // that the encoding locks up the browser - - _context.next = 68; - return new Promise(function (resolve) { - return setTimeout(resolve, 0); - }); - case 68: - i++; - _context.next = 60; - break; - case 71: - gif.finish(); - // Get a direct typed array view into the buffer to avoid copying it - buffer = gif.bytesView(); - extension = 'gif'; - blob = new Blob([buffer], { - type: 'image/gif' - }); - frames = [ - ]; - this._recording = false; - this.loop(); - if (!silent) { - p.html('Done. Downloading your gif!🌸'); - if (notificationDuration > 0) setTimeout(function () { - return p.remove(); - }, notificationDuration * 1000); - } - _main.default.prototype.downloadFile(blob, fileName, extension); - case 80: - case 'end': - return _context.stop(); - } - } - }, _callee, this); - })); - return function (_x, _x2) { - return _ref.apply(this, arguments); - }; - }(); - function _flipPixels(pixels) { - // extracting the pixels using readPixels returns - // an upside down image. we have to flip it back - // first. this solution is proposed by gman on - // this stack overflow answer: - // https://stackoverflow.com/questions/41969562/how-can-i-flip-the-result-of-webglrenderingcontext-readpixels - var halfHeight = parseInt(height / 2); - var bytesPerRow = width * 4; - // make a temp buffer to hold one row - var temp = new Uint8Array(width * 4); - for (var y = 0; y < halfHeight; ++y) { - var topOffset = y * bytesPerRow; - var bottomOffset = (height - y - 1) * bytesPerRow; - // make copy of a row on the top half - temp.set(pixels.subarray(topOffset, topOffset + bytesPerRow)); - // copy a row from the bottom half to the top - pixels.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow); - // copy the copy of the top half row to the bottom half - pixels.set(temp, bottomOffset); - } - return pixels; - } - function _generateGlobalPalette(frames) { - // make an array the size of every possible color in every possible frame - // that is: width * height * frames. - var allColors = new Uint8Array(frames.length * frames[0].length); - // put every frame one after the other in sequence. - // this array will hold absolutely every pixel from the animation. - // the set function on the Uint8Array works super fast tho! - for (var f = 0; f < frames.length; f++) { - allColors.set(frames[f], f * frames[0].length); - } // quantize this massive array into 256 colors and return it! - - var colorPalette = (0, _gifenc.quantize) (allColors, 256, { - format: 'rgba4444', - oneBitAlpha: true - }); - // when generating the palette, we have to leave space for 1 of the - // indices to be a random color that does not appear anywhere in our - // animation to use for transparency purposes. So, if the palette is full - // (has 256 colors), we overwrite the last one with a random, fully transparent - // color. Otherwise, we just push a new color into the palette the same way. - // this guarantees that when using the transparency index, there are no matches - // between some colors of the animation and the "holes" we want to dig on them, - // which would cause pieces of some frames to be transparent and thus look glitchy. - if (colorPalette.length === 256) { - colorPalette[colorPalette.length - 1] = [ - Math.random() * 255, - Math.random() * 255, - Math.random() * 255, - 0 - ]; - } else { - colorPalette.push([Math.random() * 255, - Math.random() * 255, - Math.random() * 255, - 0]); - } - return colorPalette; - } /** - * Helper function for loading GIF-based images - */ - - function _createGif(arrayBuffer, pImg, successCallback, failureCallback, finishCallback) { - var gifReader = new _omggif.default.GifReader(arrayBuffer); - pImg.width = pImg.canvas.width = gifReader.width; - pImg.height = pImg.canvas.height = gifReader.height; - var frames = [ - ]; - var numFrames = gifReader.numFrames(); - var framePixels = new Uint8ClampedArray(pImg.width * pImg.height * 4); - var loadGIFFrameIntoImage = function loadGIFFrameIntoImage(frameNum, gifReader) { - try { - gifReader.decodeAndBlitFrameRGBA(frameNum, framePixels); - } catch (e) { - _main.default._friendlyFileLoadError(8, pImg.src); - if (typeof failureCallback === 'function') { - failureCallback(e); - } else { - console.error(e); - } - } - }; - for (var j = 0; j < numFrames; j++) { - var frameInfo = gifReader.frameInfo(j); - var prevFrameData = pImg.drawingContext.getImageData(0, 0, pImg.width, pImg.height); - framePixels = prevFrameData.data.slice(); - loadGIFFrameIntoImage(j, gifReader); - var imageData = new ImageData(framePixels, pImg.width, pImg.height); - pImg.drawingContext.putImageData(imageData, 0, 0); - var frameDelay = frameInfo.delay; - // To maintain the default of 10FPS when frameInfo.delay equals to 0 - if (frameDelay === 0) { - frameDelay = 10; - } - frames.push({ - image: pImg.drawingContext.getImageData(0, 0, pImg.width, pImg.height), - delay: frameDelay * 10 //GIF stores delay in one-hundredth of a second, shift to ms - }); - // Some GIFs are encoded so that they expect the previous frame - // to be under the current frame. This can occur at a sub-frame level - // - // Values : 0 - No disposal specified. The decoder is - // not required to take any action. - // 1 - Do not dispose. The graphic is to be left - // in place. - // 2 - Restore to background color. The area used by the - // graphic must be restored to the background color. - // 3 - Restore to previous. The decoder is required to - // restore the area overwritten by the graphic with - // what was there prior to rendering the graphic. - // 4-7 - To be defined. - if (frameInfo.disposal === 2) { - // Restore background color - pImg.drawingContext.clearRect(frameInfo.x, frameInfo.y, frameInfo.width, frameInfo.height); - } else if (frameInfo.disposal === 3) { - // Restore previous - pImg.drawingContext.putImageData(prevFrameData, 0, 0, frameInfo.x, frameInfo.y, frameInfo.width, frameInfo.height); - } - } //Uses Netscape block encoding - //to repeat forever, this will be 0 - //to repeat just once, this will be null - //to repeat N times (1 1) { - pImg.gifProperties = { - displayIndex: 0, - loopLimit: loopLimit, - loopCount: 0, - frames: frames, - numFrames: numFrames, - playing: true, - timeDisplayed: 0, - lastChangeTime: 0 - }; - } - if (typeof successCallback === 'function') { - successCallback(pImg); - } - finishCallback(); - } /** - * @private - * @param {Constant} xAlign either LEFT, RIGHT or CENTER - * @param {Constant} yAlign either TOP, BOTTOM or CENTER - * @param {Number} dx - * @param {Number} dy - * @param {Number} dw - * @param {Number} dh - * @param {Number} sw - * @param {Number} sh - * @returns {Object} - */ - - function _imageContain(xAlign, yAlign, dx, dy, dw, dh, sw, sh) { - var r = Math.max(sw / dw, sh / dh); - var adjusted_dw = sw / r, - adjusted_dh = sh / r; - var x = dx; - var y = dy; - if (xAlign === constants.CENTER) { - x += (dw - adjusted_dw) / 2; - } else if (xAlign === constants.RIGHT) { - x += dw - adjusted_dw; - } - if (yAlign === constants.CENTER) { - y += (dh - adjusted_dh) / 2; - } else if (yAlign === constants.BOTTOM) { - y += dh - adjusted_dh; - } - return { - x: x, - y: y, - w: adjusted_dw, - h: adjusted_dh - }; - } /** - * @private - * @param {Constant} xAlign either LEFT, RIGHT or CENTER - * @param {Constant} yAlign either TOP, BOTTOM or CENTER - * @param {Number} dw - * @param {Number} dh - * @param {Number} sx - * @param {Number} sy - * @param {Number} sw - * @param {Number} sh - * @returns {Object} - */ - - function _imageCover(xAlign, yAlign, dw, dh, sx, sy, sw, sh) { - var r = Math.max(dw / sw, dh / sh); - var adjusted_sw = dw / r, - adjusted_sh = dh / r; - var x = sx; - var y = sy; - if (xAlign === constants.CENTER) { - x += (sw - adjusted_sw) / 2; - } else if (xAlign === constants.RIGHT) { - x += sw - adjusted_sw; - } - if (yAlign === constants.CENTER) { - y += (sh - adjusted_sh) / 2; - } else if (yAlign === constants.BOTTOM) { - y += sh - adjusted_sh; - } - return { - x: x, - y: y, - w: adjusted_sw, - h: adjusted_sh - }; - } /** - * @private - * @param {Constant} [fit] either CONTAIN or COVER - * @param {Constant} xAlign either LEFT, RIGHT or CENTER - * @param {Constant} yAlign either TOP, BOTTOM or CENTER - * @param {Number} dx - * @param {Number} dy - * @param {Number} dw - * @param {Number} dh - * @param {Number} sx - * @param {Number} sy - * @param {Number} sw - * @param {Number} sh - * @returns {Object} - */ - - function _imageFit(fit, xAlign, yAlign, dx, dy, dw, dh, sx, sy, sw, sh) { - if (fit === constants.COVER) { - var _imageCover2 = _imageCover(xAlign, yAlign, dw, dh, sx, sy, sw, sh), - x = _imageCover2.x, - y = _imageCover2.y, - w = _imageCover2.w, - h = _imageCover2.h; - sx = x; - sy = y; - sw = w; - sh = h; - } - if (fit === constants.CONTAIN) { - var _imageContain2 = _imageContain(xAlign, yAlign, dx, dy, dw, dh, sw, sh), - _x3 = _imageContain2.x, - _y = _imageContain2.y, - _w = _imageContain2.w, - _h = _imageContain2.h; - dx = _x3; - dy = _y; - dw = _w; - dh = _h; - } - return { - sx: sx, - sy: sy, - sw: sw, - sh: sh, - dx: dx, - dy: dy, - dw: dw, - dh: dh - }; - } /** - * Validates clipping params. Per drawImage spec sWidth and sHight cannot be - * negative or greater than image intrinsic width and height - * @private - * @param {Number} sVal - * @param {Number} iVal - * @returns {Number} - * @private - */ - - function _sAssign(sVal, iVal) { - if (sVal > 0 && sVal < iVal) { - return sVal; - } else { - return iVal; - } - } /** - * Draws a source image to the canvas. - * - * The first parameter, `img`, is the source image to be drawn. The second and - * third parameters, `dx` and `dy`, set the coordinates of the destination - * image's top left corner. See imageMode() for - * other ways to position images. - * - * Here's a diagram that explains how optional parameters work in `image()`: - * - * - * - * The fourth and fifth parameters, `dw` and `dh`, are optional. They set the - * the width and height to draw the destination image. By default, `image()` - * draws the full source image at its original size. - * - * The sixth and seventh parameters, `sx` and `sy`, are also optional. - * These coordinates define the top left corner of a subsection to draw from - * the source image. - * - * The eighth and ninth parameters, `sw` and `sh`, are also optional. - * They define the width and height of a subsection to draw from the source - * image. By default, `image()` draws the full subsection that begins at - * (`sx`, `sy`) and extends to the edges of the source image. - * - * The ninth parameter, `fit`, is also optional. It enables a subsection of - * the source image to be drawn without affecting its aspect ratio. If - * `CONTAIN` is passed, the full subsection will appear within the destination - * rectangle. If `COVER` is passed, the subsection will completely cover the - * destination rectangle. This may have the effect of zooming into the - * subsection. - * - * The tenth and eleventh paremeters, `xAlign` and `yAlign`, are also - * optional. They determine how to align the fitted subsection. `xAlign` can - * be set to either `LEFT`, `RIGHT`, or `CENTER`. `yAlign` can be set to - * either `TOP`, `BOTTOM`, or `CENTER`. By default, both `xAlign` and `yAlign` - * are set to `CENTER`. - * - * @method image - * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img image to display. - * @param {Number} x x-coordinate of the top-left corner of the image. - * @param {Number} y y-coordinate of the top-left corner of the image. - * @param {Number} [width] width to draw the image. - * @param {Number} [height] height to draw the image. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0); - * - * describe('An image of the underside of a white umbrella with a gridded ceiling above.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 10, 10); - * - * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image has dark gray borders on its left and top.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0, 50, 50); - * - * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image is drawn in the top left corner of a dark gray square.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 25, 25, 50, 50, 25, 25, 50, 50); - * - * describe('An image of a gridded ceiling drawn in the center of a dark gray square.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/moonwalk.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0, width, height, 0, 0, img.width, img.height, CONTAIN); - * - * describe('An image of an astronaut on the moon. The top and bottom borders of the image are dark gray.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * // Image is 50 x 50 pixels. - * img = loadImage('assets/laDefense50.png'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0, width, height, 0, 0, img.width, img.height, COVER); - * - * describe('A pixelated image of the underside of a white umbrella with a gridded ceiling above.'); - * } - * - *
                - */ - /** - * @method image - * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img - * @param {Number} dx the x-coordinate of the destination - * rectangle in which to draw the source image - * @param {Number} dy the y-coordinate of the destination - * rectangle in which to draw the source image - * @param {Number} dWidth the width of the destination rectangle - * @param {Number} dHeight the height of the destination rectangle - * @param {Number} sx the x-coordinate of the subsection of the source - * image to draw into the destination rectangle - * @param {Number} sy the y-coordinate of the subsection of the source - * image to draw into the destination rectangle - * @param {Number} [sWidth] the width of the subsection of the - * source image to draw into the destination - * rectangle - * @param {Number} [sHeight] the height of the subsection of the - * source image to draw into the destination rectangle - * @param {Constant} [fit] either CONTAIN or COVER - * @param {Constant} [xAlign] either LEFT, RIGHT or CENTER default is CENTER - * @param {Constant} [yAlign] either TOP, BOTTOM or CENTER default is CENTER - */ - - _main.default.prototype.image = function (img, dx, dy, dWidth, dHeight, sx, sy, sWidth, sHeight, fit, xAlign, yAlign) { - // set defaults per spec: https://goo.gl/3ykfOq - _main.default._validateParameters('image', arguments); - var defW = img.width; - var defH = img.height; - yAlign = yAlign || constants.CENTER; - xAlign = xAlign || constants.CENTER; - if (img.elt) { - defW = defW !== undefined ? defW : img.elt.width; - defH = defH !== undefined ? defH : img.elt.height; - } - if (img.elt && img.elt.videoWidth && !img.canvas) { - // video no canvas - defW = defW !== undefined ? defW : img.elt.videoWidth; - defH = defH !== undefined ? defH : img.elt.videoHeight; - } - var _dx = dx; - var _dy = dy; - var _dw = dWidth || defW; - var _dh = dHeight || defH; - var _sx = sx || 0; - var _sy = sy || 0; - var _sw = sWidth !== undefined ? sWidth : defW; - var _sh = sHeight !== undefined ? sHeight : defH; - _sw = _sAssign(_sw, defW); - _sh = _sAssign(_sh, defH); - // This part needs cleanup and unit tests - // see issues https://github.com/processing/p5.js/issues/1741 - // and https://github.com/processing/p5.js/issues/1673 - var pd = 1; - if (img.elt && !img.canvas && img.elt.style.width) { - //if img is video and img.elt.size() has been used and - //no width passed to image() - if (img.elt.videoWidth && !dWidth) { - pd = img.elt.videoWidth; - } else { - //all other cases - pd = img.elt.width; - } - pd /= parseInt(img.elt.style.width, 10); - } - _sx *= pd; - _sy *= pd; - _sh *= pd; - _sw *= pd; - var vals = _helpers.default.modeAdjust(_dx, _dy, _dw, _dh, this._renderer._imageMode); - vals = _imageFit(fit, xAlign, yAlign, vals.x, vals.y, vals.w, vals.h, _sx, _sy, _sw, _sh); - // tint the image if there is a tint - this._renderer.image(img, vals.sx, vals.sy, vals.sw, vals.sh, vals.dx, vals.dy, vals.dw, vals.dh); - }; - /** - * Tints images using a specified color. - * - * The version of `tint()` with one parameter interprets it one of four ways. - * If the parameter is a number, it's interpreted as a grayscale value. If the - * parameter is a string, it's interpreted as a CSS color string. An array of - * `[R, G, B, A]` values or a p5.Color object can - * also be used to set the tint color. - * - * The version of `tint()` with two parameters uses the first one as a - * grayscale value and the second as an alpha value. For example, calling - * `tint(255, 128)` will make an image 50% transparent. - * - * The version of `tint()` with three parameters interprets them as RGB or - * HSB values, depending on the current - * colorMode(). The optional fourth parameter - * sets the alpha value. For example, `tint(255, 0, 0, 100)` will give images - * a red tint and make them transparent. - * - * @method tint - * @param {Number} v1 red or hue value. - * @param {Number} v2 green or saturation value. - * @param {Number} v3 blue or brightness. - * @param {Number} [alpha] - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint('red'); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint(255, 0, 0); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint(255, 0, 0, 100); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a transparent red tint.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint(255, 180); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right is transparent.'); - * } - * - *
                - */ - /** - * @method tint - * @param {String} value CSS color string. - */ - /** - * @method tint - * @param {Number} gray grayscale value. - * @param {Number} [alpha] - */ - /** - * @method tint - * @param {Number[]} values array containing the red, green, blue & - * alpha components of the color. - */ - /** - * @method tint - * @param {p5.Color} color the tint color - */ - _main.default.prototype.tint = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('tint', args); - var c = this.color.apply(this, args); - this._renderer._tint = c.levels; - }; - /** - * Removes the current tint set by tint() and restores - * images to their original colors. - * - * @method noTint - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * function setup() { - * tint('red'); - * image(img, 0, 0); - * noTint(); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the left has a red tint.'); - * } - * - *
                - */ - _main.default.prototype.noTint = function () { - this._renderer._tint = null; - }; - /** - * Apply the current tint color to the input image, return the resulting - * canvas. - * - * @private - * @param {p5.Image} The image to be tinted - * @return {canvas} The resulting tinted canvas - */ - _main.default.prototype._getTintedImageCanvas = _main.default.Renderer2D.prototype._getTintedImageCanvas; - /** - * Changes the location from which images are drawn when - * image() is called. - * - * By default, the first - * two parameters of image() are the x- and - * y-coordinates of the image's upper-left corner. The next parameters are - * its width and height. This is the same as calling `imageMode(CORNER)`. - * - * `imageMode(CORNERS)` also uses the first two parameters of - * image() as the x- and y-coordinates of the image's - * top-left corner. The third and fourth parameters are the coordinates of its - * bottom-right corner. - * - * `imageMode(CENTER)` uses the first two parameters of - * image() as the x- and y-coordinates of the image's - * center. The next parameters are its width and height. - * - * @method imageMode - * @param {Constant} mode either CORNER, CORNERS, or CENTER. - * @example - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * background(200); - * imageMode(CORNER); - * image(img, 10, 10, 50, 50); - * - * describe('A square image of a brick wall is drawn at the top left of a gray square.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * background(200); - * imageMode(CORNERS); - * image(img, 10, 10, 90, 40); - * - * describe('An image of a brick wall is drawn on a gray square. The image is squeezed into a small rectangular area.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * background(200); - * imageMode(CENTER); - * image(img, 50, 50, 80, 80); - * - * describe('A square image of a brick wall is drawn on a gray square.'); - * } - * - *
                - */ - _main.default.prototype.imageMode = function (m) { - _main.default._validateParameters('imageMode', arguments); - if (m === constants.CORNER || m === constants.CORNERS || m === constants.CENTER) { - this._renderer._imageMode = m; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/friendly_errors/fes_core': 289, - '../core/friendly_errors/file_errors': 290, - '../core/friendly_errors/validate_params': 293, - '../core/helpers': 294, - '../core/main': 298, - 'core-js/modules/es.array.copy-within': 170, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.promise': 201, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/es.typed-array.uint8-clamped-array': 253, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256, - 'gifenc': 263, - 'omggif': 270, - 'regenerator-runtime/runtime': 274 - } - ], - 322: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var _filters = _interopRequireDefault(_dereq_('./filters')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Image - * @submodule Image - * @requires core - * @requires constants - * @requires filters - */ - /** - * This module defines the p5.Image class and P5 methods for - * drawing images to the main display canvas. - */ - /* - * Class methods - */ - /** - * A class to describe an image. Images are rectangular grids of pixels that - * can be displayed and modified. - * - * Existing images can be loaded by calling - * loadImage(). Blank images can be created by - * calling createImage(). `p5.Image` objects - * have methods for common tasks such as applying filters and modifying - * pixel values. - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * - * describe('An image of a brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(GRAY); - * image(img, 0, 0); - * - * describe('A grayscale image of a brick wall.'); - * } - * - *
                - * - *
                - * - * background(200); - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - * - * @class p5.Image - * @constructor - * @param {Number} width - * @param {Number} height - */ - - _main.default.Image = /*#__PURE__*/ function () { - function _class(width, height) { - _classCallCheck(this, _class); - /** - * Image width. - * @type {Number} - * @property {Number} width - * @name width - * @readOnly - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let x = img.width / 2; - * let y = img.height / 2; - * let d = 20; - * circle(x, y, d); - * - * describe('An image of a mountain landscape with a white circle drawn in the middle.'); - * } - * - *
                - */ - this.width = width; - /** - * Image height. - * @type {Number} - * @property height - * @name height - * @readOnly - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let x = img.width / 2; - * let y = img.height / 2; - * let d = 20; - * circle(x, y, d); - * - * describe('An image of a mountain landscape with a white circle drawn in the middle.'); - * } - * - *
                - */ - this.height = height; - this.canvas = document.createElement('canvas'); - this.canvas.width = this.width; - this.canvas.height = this.height; - this.drawingContext = this.canvas.getContext('2d'); - this._pixelsState = this; - this._pixelDensity = 1; - //Object for working with GIFs, defaults to null - this.gifProperties = null; - //For WebGL Texturing only: used to determine whether to reupload texture to GPU - this._modified = false; - /** - * An array containing the color of each pixel in the - * p5.Image object. Colors are stored as numbers - * representing red, green, blue, and alpha (RGBA) values. `img.pixels` is a - * one-dimensional array for performance reasons. - * - * Each pixel occupies four elements in the pixels array, one for each - * RGBA value. For example, the pixel at coordinates (0, 0) stores its - * RGBA values at `img.pixels[0]`, `img.pixels[1]`, `img.pixels[2]`, - * and `img.pixels[3]`, respectively. The next pixel at coordinates (1, 0) - * stores its RGBA values at `img.pixels[4]`, `img.pixels[5]`, - * `img.pixels[6]`, and `img.pixels[7]`. And so on. The `img.pixels` array - * for a 100×100 p5.Image object has - * 100 × 100 × 4 = 40,000 elements. - * - * Accessing the RGBA values for a pixel in the - * p5.Image object requires a little math as - * shown below. The img.loadPixels() - * method must be called before accessing the `img.pixels` array. The - * img.updatePixels() method must be - * called after any changes are made. - * - * @property {Number[]} pixels - * @name pixels - * @example - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - * - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 255; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A red square drawn in the middle of a gray square.'); - * - *
                - */ - this.pixels = [ - ]; - } /** - * Gets or sets the pixel density for high pixel density displays. By default, - * the density will be set to 1. - * - * Call this method with no arguments to get the default density, or pass - * in a number to set the density. If a non-positive number is provided, - * it defaults to 1. - * - * @method pixelDensity - * @param {Number} [density] A scaling factor for the number of pixels per - * side - * @returns {Number} The current density if called without arguments, or the instance for chaining if setting density. - */ - - _createClass(_class, [ - { - key: 'pixelDensity', - value: function pixelDensity(density) { - if (typeof density !== 'undefined') { - // Setter: set the density and handle resize - if (density <= 0) { - var errorObj = { - type: 'INVALID_VALUE', - format: { - types: [ - 'Number' - ] - }, - position: 1 - }; - _main.default._friendlyParamError(errorObj, 'pixelDensity'); - // Default to 1 in case of an invalid value - density = 1; - } - this._pixelDensity = density; - // Adjust canvas dimensions based on pixel density - this.width /= density; - this.height /= density; - return this; // Return the image instance for chaining if needed - } else { - // Getter: return the default density - return this._pixelDensity; - } - } /** - * Helper function for animating GIF-based images with time - */ - - }, - { - key: '_animateGif', - value: function _animateGif(pInst) { - var props = this.gifProperties; - var curTime = pInst._lastRealFrameTime; - if (props.lastChangeTime === 0) { - props.lastChangeTime = curTime; - } - if (props.playing) { - props.timeDisplayed = curTime - props.lastChangeTime; - var curDelay = props.frames[props.displayIndex].delay; - if (props.timeDisplayed >= curDelay) { - //GIF is bound to 'realtime' so can skip frames - var skips = Math.floor(props.timeDisplayed / curDelay); - props.timeDisplayed = 0; - props.lastChangeTime = curTime; - props.displayIndex += skips; - props.loopCount = Math.floor(props.displayIndex / props.numFrames); - if (props.loopLimit !== null && props.loopCount >= props.loopLimit) { - props.playing = false; - } else { - var ind = props.displayIndex % props.numFrames; - this.drawingContext.putImageData(props.frames[ind].image, 0, 0); - props.displayIndex = ind; - this.setModified(true); - } - } - } - } /** - * Helper fxn for sharing pixel methods - */ - - }, - { - key: '_setProperty', - value: function _setProperty(prop, value) { - this[prop] = value; - this.setModified(true); - } /** - * Loads the current value of each pixel in the - * p5.Image object into the `img.pixels` array. - * This method must be called before reading or modifying pixel values. - * - * @method loadPixels - * @example - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - * - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - */ - - }, - { - key: 'loadPixels', - value: function loadPixels() { - _main.default.Renderer2D.prototype.loadPixels.call(this); - this.setModified(true); - } /** - * Updates the canvas with the RGBA values in the - * img.pixels array. - * - * `img.updatePixels()` only needs to be called after changing values in - * the img.pixels array. Such changes can be - * made directly after calling - * img.loadPixels() or by calling - * img.set(). - * - * The optional parameters `x`, `y`, `width`, and `height` define a - * subsection of the p5.Image object to update. - * Doing so can improve performance in some cases. - * - * If the p5.Image object was loaded from a GIF, - * then calling `img.updatePixels()` will update the pixels in current - * frame. - * - * @method updatePixels - * @param {Integer} x x-coordinate of the upper-left corner - * of the subsection to update. - * @param {Integer} y y-coordinate of the upper-left corner - * of the subsection to update. - * @param {Integer} w width of the subsection to update. - * @param {Integer} h height of the subsection to update. - * @example - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - * - *
                - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                - */ - /** - * @method updatePixels - */ - - }, - { - key: 'updatePixels', - value: function updatePixels(x, y, w, h) { - _main.default.Renderer2D.prototype.updatePixels.call(this, x, y, w, h); - this.setModified(true); - } /** - * Gets a pixel or a region of pixels from a - * p5.Image object. - * - * `img.get()` is easy to use but it's not as fast as - * img.pixels. Use - * img.pixels to read many pixel values. - * - * The version of `img.get()` with no parameters returns the entire image. - * - * The version of `img.get()` with two parameters interprets them as - * coordinates. It returns an array with the `[R, G, B, A]` values of the - * pixel at the given point. - * - * The version of `img.get()` with four parameters interprets them as - * coordinates and dimensions. It returns a subsection of the canvas as a - * p5.Image object. The first two parameters are - * the coordinates for the upper-left corner of the subsection. The last two - * parameters are the width and height of the subsection. - * - * Use img.get() to work directly with - * p5.Image objects. - * - * @method get - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number} w width of the subsection to be returned. - * @param {Number} h height of the subsection to be returned. - * @return {p5.Image} subsection as a p5.Image object. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let img2 = get(); - * image(img2, width / 2, 0); - * - * describe('Two identical mountain landscapes shown side-by-side.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = img.get(50, 90); - * fill(c); - * noStroke(); - * square(25, 25, 50); - * - * describe('A mountain landscape with an olive green square in its center.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let img2 = img.get(0, 0, img.width / 2, img.height / 2); - * image(img2, width / 2, height / 2); - * - * describe('A mountain landscape drawn on top of another mountain landscape.'); - * } - * - *
                - */ - /** - * @method get - * @return {p5.Image} whole p5.Image - */ - /** - * @method get - * @param {Number} x - * @param {Number} y - * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. - */ - - }, - { - key: 'get', - value: function get(x, y, w, h) { - _main.default._validateParameters('p5.Image.get', arguments); - return _main.default.Renderer2D.prototype.get.apply(this, arguments); - } - }, - { - key: '_getPixel', - value: function _getPixel() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return _main.default.Renderer2D.prototype._getPixel.apply(this, args); - } /** - * Sets the color of one or more pixels within a - * p5.Image object. - * - * `img.set()` is easy to use but it's not as fast as - * img.pixels. Use - * img.pixels to set many pixel values. - * - * `img.set()` interprets the first two parameters as x- and y-coordinates. It - * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel - * array, a p5.Color object, or another - * p5.Image object. - * - * img.updatePixels() must be called - * after using `img.set()` for changes to appear. - * - * @method set - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number|Number[]|Object} a grayscale value | pixel array | - * p5.Color object | - * p5.Image to copy. - * @example - *
                - * - * let img = createImage(100, 100); - * img.set(30, 20, 0); - * img.set(85, 20, 0); - * img.set(85, 75, 0); - * img.set(30, 75, 0); - * img.updatePixels(); - * image(img, 0, 0); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                - * - *
                - * - * let img = createImage(100, 100); - * let black = color(0); - * img.set(30, 20, black); - * img.set(85, 20, black); - * img.set(85, 75, black); - * img.set(30, 75, black); - * img.updatePixels(); - * image(img, 0, 0); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                - * - *
                - * - * let img = createImage(66, 66); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * let c = map(x, 0, img.width, 0, 255); - * img.set(x, y, c); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A square with a horiztonal color gradient from black to white drawn on a gray background.'); - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * let img2 = createImage(100, 100); - * img2.set(0, 0, img); - * image(img2, 0, 0); - * - * describe('An image of a mountain landscape.'); - * } - * - *
                - */ - - }, - { - key: 'set', - value: function set(x, y, imgOrCol) { - _main.default.Renderer2D.prototype.set.call(this, x, y, imgOrCol); - this.setModified(true); - } /** - * Resizes the p5.Image object to a given `width` - * and `height`. The image's original aspect ratio can be kept by passing 0 - * for either `width` or `height`. For example, calling `img.resize(50, 0)` - * on an image that was 500 × 300 pixels will resize it to - * 50 × 30 pixels. - * - * @method resize - * @param {Number} width resized image width. - * @param {Number} height resized image height. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * function setup() { - * image(img, 0, 0); - * img.resize(50, 100); - * image(img, 0, 0); - * - * describe('Two images of a mountain landscape. One copy of the image is squeezed horizontally.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * function setup() { - * image(img, 0, 0); - * img.resize(0, 30); - * image(img, 0, 0); - * - * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * function setup() { - * image(img, 0, 0); - * img.resize(60, 0); - * image(img, 0, 0); - * - * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); - * } - * - *
                - */ - - }, - { - key: 'resize', - value: function resize(width, height) { - // Copy contents to a temporary canvas, resize the original - // and then copy back. - // - // There is a faster approach that involves just one copy and swapping the - // this.canvas reference. We could switch to that approach if (as i think - // is the case) there an expectation that the user would not hold a - // reference to the backing canvas of a p5.Image. But since we do not - // enforce that at the moment, I am leaving in the slower, but safer - // implementation. - // auto-resize - if (width === 0 && height === 0) { - width = this.canvas.width; - height = this.canvas.height; - } else if (width === 0) { - width = this.canvas.width * height / this.canvas.height; - } else if (height === 0) { - height = this.canvas.height * width / this.canvas.width; - } - width = Math.floor(width); - height = Math.floor(height); - var tempCanvas = document.createElement('canvas'); - tempCanvas.width = width; - tempCanvas.height = height; - if (this.gifProperties) { - var props = this.gifProperties; - //adapted from github.com/LinusU/resize-image-data - var nearestNeighbor = function nearestNeighbor(src, dst) { - var pos = 0; - for (var y = 0; y < dst.height; y++) { - for (var x = 0; x < dst.width; x++) { - var srcX = Math.floor(x * src.width / dst.width); - var srcY = Math.floor(y * src.height / dst.height); - var srcPos = (srcY * src.width + srcX) * 4; - dst.data[pos++] = src.data[srcPos++]; // R - dst.data[pos++] = src.data[srcPos++]; // G - dst.data[pos++] = src.data[srcPos++]; // B - dst.data[pos++] = src.data[srcPos++]; // A - } - } - }; - for (var i = 0; i < props.numFrames; i++) { - var resizedImageData = this.drawingContext.createImageData(width, height); - nearestNeighbor(props.frames[i].image, resizedImageData); - props.frames[i].image = resizedImageData; - } - } - tempCanvas.getContext('2d').drawImage(this.canvas, 0, 0, this.canvas.width, this.canvas.height, 0, 0, tempCanvas.width, tempCanvas.height); - // Resize the original canvas, which will clear its contents - this.canvas.width = this.width = width; - this.canvas.height = this.height = height; - //Copy the image back - this.drawingContext.drawImage(tempCanvas, 0, 0, width, height, 0, 0, width, height); - if (this.pixels.length > 0) { - this.loadPixels(); - } - this.setModified(true); - } /** - * - * Copies pixels from a source p5.Image - * to this one. Calling `img.copy()` will scale pixels from the source - * region if it isn't the same size as the destination region. - * - * @method copy - * @param {p5.Image|p5.Element} srcImage source image. - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * img.copy(7, 22, 10, 10, 35, 25, 50, 50); - * image(img, 0, 0); - * // Outline copied region. - * stroke(255); - * noFill(); - * square(7, 22, 10); - * - * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); - * } - * - *
                - * - *
                - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * let x = bricks.width / 2; - * let y = bricks.height / 2; - * mountains.copy(bricks, 0, 0, x, y, 0, 0, x, y); - * image(mountains, 0, 0); - * - * describe('An image of a brick wall drawn at the top-left of an image of a mountain landscape.'); - * } - * - *
                - */ - /** - * @method copy - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - */ - - }, - { - key: 'copy', - value: function copy() { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default.prototype.copy.apply(this, args); - } /** - * Masks part of an image from displaying by loading another - * image and using its alpha channel as an alpha channel for - * this image. Masks are cumulative, once applied to an image - * object, they cannot be removed. - * - * @method mask - * @param {p5.Image} srcImage source image. - * - * @example - *
                - * - * let photo; - * let maskImage; - * - * function preload() { - * photo = loadImage('assets/rockies.jpg'); - * maskImage = loadImage('assets/mask2.png'); - * } - * - * function setup() { - * photo.mask(maskImage); - * image(photo, 0, 0); - * - * describe('An image of a mountain landscape. The right side of the image has a faded patch of white.'); - * } - * - *
                - */ - // TODO: - Accept an array of alpha values. - - }, - { - key: 'mask', - value: function mask(p5Image) { - if (p5Image === undefined) { - p5Image = this; - } - var currBlend = this.drawingContext.globalCompositeOperation; - var scaleFactor = 1; - if (p5Image instanceof _main.default.Renderer) { - scaleFactor = p5Image._pInst._pixelDensity; - } - var copyArgs = [ - p5Image, - 0, - 0, - scaleFactor * p5Image.width, - scaleFactor * p5Image.height, - 0, - 0, - this.width, - this.height - ]; - this.drawingContext.globalCompositeOperation = 'destination-in'; - if (this.gifProperties) { - for (var i = 0; i < this.gifProperties.frames.length; i++) { - this.drawingContext.putImageData(this.gifProperties.frames[i].image, 0, 0); - this.copy.apply(this, copyArgs); - this.gifProperties.frames[i].image = this.drawingContext.getImageData(0, 0, this.width, this.height); - } - this.drawingContext.putImageData(this.gifProperties.frames[this.gifProperties.displayIndex].image, 0, 0); - } else { - this.copy.apply(this, copyArgs); - } - this.drawingContext.globalCompositeOperation = currBlend; - this.setModified(true); - } /** - * Applies an image filter to the p5.Image object. - * The preset options are: - * - * `INVERT` - * Inverts the colors in the image. No parameter is used. - * - * `GRAY` - * Converts the image to grayscale. No parameter is used. - * - * `THRESHOLD` - * Converts the image to black and white. Pixels with a grayscale value - * above a given threshold are converted to white. The rest are converted to - * black. The threshold must be between 0.0 (black) and 1.0 (white). If no - * value is specified, 0.5 is used. - * - * `OPAQUE` - * Sets the alpha channel to be entirely opaque. No parameter is used. - * - * `POSTERIZE` - * Limits the number of colors in the image. Each color channel is limited to - * the number of colors specified. Values between 2 and 255 are valid, but - * results are most noticeable with lower values. The default value is 4. - * - * `BLUR` - * Blurs the image. The level of blurring is specified by a blur radius. Larger - * values increase the blur. The default value is 4. A gaussian blur is used - * in `P2D` mode. A box blur is used in `WEBGL` mode. - * - * `ERODE` - * Reduces the light areas. No parameter is used. - * - * `DILATE` - * Increases the light areas. No parameter is used. - * - * @method filter - * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, - * POSTERIZE, ERODE, DILATE or BLUR. - * @param {Number} [filterParam] parameter unique to each filter. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(INVERT); - * image(img, 0, 0); - * - * describe('A blue brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(GRAY); - * image(img, 0, 0); - * - * describe('A brick wall drawn in grayscale.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(THRESHOLD); - * image(img, 0, 0); - * - * describe('A brick wall drawn in black and white.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(OPAQUE); - * image(img, 0, 0); - * - * describe('A red brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(POSTERIZE, 3); - * image(img, 0, 0); - * - * describe('An image of a red brick wall drawn with a limited color palette.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(BLUR, 3); - * image(img, 0, 0); - * - * describe('A blurry image of a red brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(DILATE); - * image(img, 0, 0); - * - * describe('A red brick wall with bright lines between each brick.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(ERODE); - * image(img, 0, 0); - * - * describe('A red brick wall with faint lines between each brick.'); - * } - * - *
                - */ - - }, - { - key: 'filter', - value: function filter(operation, value) { - _filters.default.apply(this.canvas, _filters.default[operation], value); - this.setModified(true); - } /** - * Copies a region of pixels from another - * p5.Image object into this one. The `blendMode` - * parameter blends the images' colors to create different effects. - * - * @method blend - * @param {p5.Image} srcImage source image - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * @param {Constant} blendMode the blend mode. either - * BLEND, DARKEST, LIGHTEST, DIFFERENCE, - * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, - * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. - * - * Available blend modes are: normal | multiply | screen | overlay | - * darken | lighten | color-dodge | color-burn | hard-light | - * soft-light | difference | exclusion | hue | saturation | - * color | luminosity - * - * http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ - * @example - *
                - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, ADD); - * image(mountains, 0, 0); - * image(bricks, 0, 0); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); - * } - * - *
                - * - *
                - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); - * image(mountains, 0, 0); - * image(bricks, 0, 0); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); - * } - * - *
                - * - *
                - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); - * image(mountains, 0, 0); - * image(bricks, 0, 0); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); - * } - * - *
                - */ - /** - * @method blend - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - * @param {Constant} blendMode - */ - - }, - { - key: 'blend', - value: function blend() { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('p5.Image.blend', arguments); - _main.default.prototype.blend.apply(this, args); - this.setModified(true); - } /** - * helper method for web GL mode to indicate that an image has been - * changed or unchanged since last upload. gl texture upload will - * set this value to false after uploading the texture. - * @method setModified - * @param {boolean} val sets whether or not the image has been - * modified. - * @private - */ - - }, - { - key: 'setModified', - value: function setModified(val) { - this._modified = val; //enforce boolean? - } /** - * helper method for web GL mode to figure out if the image - * has been modified and might need to be re-uploaded to texture - * memory between frames. - * @method isModified - * @private - * @return {boolean} a boolean indicating whether or not the - * image has been updated or modified since last texture upload. - */ - - }, - { - key: 'isModified', - value: function isModified() { - return this._modified; - } /** - * Saves the p5.Image object to a file. - * The browser will either save the file immediately or prompt the user - * with a dialogue window. - * - * By default, calling `img.save()` will save the image as `untitled.png`. - * - * Calling `img.save()` with one argument, as in `img.save('photo.png')`, - * will set the image's filename and type together. - * - * Calling `img.save()` with two arguments, as in - * `image.save('photo', 'png')`, will set the image's filename and type - * separately. - * - * The image will only be downloaded as an animated GIF if the - * p5.Image object was loaded from a GIF file. - * See saveGif() to create new GIFs. - * @method save - * @param {String} filename filename. Defaults to 'untitled'. - * @param {String} [extension] file extension, either 'png' or 'jpg'. - * Defaults to 'png'. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function draw() { - * image(img, 0, 0); - * - * describe('An image of a mountain landscape.'); - * } - * - * function keyPressed() { - * if (key === 's') { - * img.save(); - * } else if (key === 'j') { - * img.save('rockies.jpg'); - * } else if (key === 'p') { - * img.save('rockies', 'png'); - * } - * } - * - *
                - */ - - }, - { - key: 'save', - value: function save(filename, extension) { - if (this.gifProperties) { - _main.default.prototype.encodeAndDownloadGif(this, filename); - } else { - _main.default.prototype.saveCanvas(this.canvas, filename, extension); - } - } // GIF Section - /** - * Restarts an animated GIF at its first frame. - * - * @method reset - * @example - *
                - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-wink-loop-once.gif'); - * } - * - * function draw() { - * background(255); - * image(gif, 0, 0); - * - * describe('A cartoon face winks once and then freezes. Clicking resets the face and makes it wink again.'); - * } - * - * function mousePressed() { - * gif.reset(); - * } - * - *
                - */ - - }, - { - key: 'reset', - value: function reset() { - if (this.gifProperties) { - var props = this.gifProperties; - props.playing = true; - props.timeSinceStart = 0; - props.timeDisplayed = 0; - props.lastChangeTime = 0; - props.loopCount = 0; - props.displayIndex = 0; - this.drawingContext.putImageData(props.frames[0].image, 0, 0); - } - } /** - * Gets the index of the current frame in an animated GIF. - * - * @method getCurrentFrame - * @return {Number} index of the GIF's current frame. - * @example - *
                - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function draw() { - * let index = gif.getCurrentFrame(); - * image(gif, 0, 0); - * text(index, 10, 90); - * - * describe('A cartoon eye repeatedly looks around, then outwards. A number displayed in the bottom-left corner increases from 0 to 124, then repeats.'); - * } - * - *
                - */ - - }, - { - key: 'getCurrentFrame', - value: function getCurrentFrame() { - if (this.gifProperties) { - var props = this.gifProperties; - return props.displayIndex % props.numFrames; - } - } /** - * Sets the current frame in an animated GIF. - * - * @method setFrame - * @param {Number} index index of the frame to display. - * @example - *
                - * - * let gif; - * let frameSlider; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function setup() { - * let maxFrame = gif.numFrames() - 1; - * frameSlider = createSlider(0, maxFrame); - * frameSlider.position(10, 80); - * frameSlider.size(80); - * } - * - * function draw() { - * let index = frameSlider.value(); - * gif.setFrame(index); - * image(gif, 0, 0); - * - * describe('A cartoon eye looks around when a slider is moved.'); - * } - * - *
                - */ - - }, - { - key: 'setFrame', - value: function setFrame(index) { - if (this.gifProperties) { - var props = this.gifProperties; - if (index < props.numFrames && index >= 0) { - props.timeDisplayed = 0; - props.lastChangeTime = 0; - props.displayIndex = index; - this.drawingContext.putImageData(props.frames[index].image, 0, 0); - } else { - console.log('Cannot set GIF to a frame number that is higher than total number of frames or below zero.'); - } - } - } /** - * Returns the number of frames in an animated GIF. - * - * @method numFrames - * @return {Number} number of frames in the GIF. - * - * @example - *
                - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function draw() { - * image(gif, 0, 0); - * let total = gif.numFrames(); - * let index = gif.getCurrentFrame(); - * text(`${index} / ${total}`, 30, 90); - * - * describe('A cartoon eye looks around. The text "n / 125" is shown at the bottom of the canvas.'); - * } - * - *
                - */ - - }, - { - key: 'numFrames', - value: function numFrames() { - if (this.gifProperties) { - return this.gifProperties.numFrames; - } - } /** - * Plays an animated GIF that was paused with - * img.pause(). - * - * @method play - * - * @example - *
                - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); - * } - * - * function draw() { - * background(255); - * image(gif, 0, 0); - * - * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); - * } - * - * function mousePressed() { - * gif.pause(); - * } - * - * function mouseReleased() { - * gif.play(); - * } - * - *
                - */ - - }, - { - key: 'play', - value: function play() { - if (this.gifProperties) { - this.gifProperties.playing = true; - } - } /** - * Pauses an animated GIF. The GIF can be resumed by calling - * img.play(). - * - * @method pause - * - * @example - *
                - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); - * } - * - * function draw() { - * background(255); - * image(gif, 0, 0); - * - * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); - * } - * - * function mousePressed() { - * gif.pause(); - * } - * - * function mouseReleased() { - * gif.play(); - * } - * - *
                - */ - - }, - { - key: 'pause', - value: function pause() { - if (this.gifProperties) { - this.gifProperties.playing = false; - } - } /** - * Changes the delay between frames in an animated GIF. - * - * The second parameter, `index`, is optional. If provided, only the frame - * at `index` will have its delay modified. All other frames will keep - * their default delay. - * - * @method delay - * @param {Number} d delay in milliseconds between switching frames. - * @param {Number} [index] index of the frame that will have its delay modified. - * - * @example - *
                - * - * let gifFast; - * let gifSlow; - * - * function preload() { - * gifFast = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * gifSlow = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function setup() { - * gifFast.resize(50, 50); - * gifSlow.resize(50, 50); - * gifFast.delay(10); - * gifSlow.delay(100); - * } - * - * function draw() { - * image(gifFast, 0, 0); - * image(gifSlow, 50, 0); - * - * describe('Two animated eyes looking around. The eye on the left moves faster than the eye on the right.'); - * } - * - *
                - * - *
                - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function setup() { - * gif.delay(3000, 67); - * } - * - * function draw() { - * image(gif, 0, 0); - * - * describe('An animated eye looking around. It pauses for three seconds while it looks down.'); - * } - * - *
                - */ - - }, - { - key: 'delay', - value: function delay(d, index) { - if (this.gifProperties) { - var props = this.gifProperties; - if (index < props.numFrames && index >= 0) { - props.frames[index].delay = d; - } else { - // change all frames - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = props.frames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var frame = _step.value; - frame.delay = d; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - } - } - } - ]); - return _class; - }(); - var _default = _main.default.Image; - exports.default = _default; - }, - { - '../core/main': 298, - './filters': 319, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 323: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.filter'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var _filters = _interopRequireDefault(_dereq_('./filters')); - _dereq_('../color/p5.Color'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Image - * @submodule Pixels - * @for p5 - * @requires core - */ - /** - * An array containing the color of each pixel on the canvas. Colors are - * stored as numbers representing red, green, blue, and alpha (RGBA) values. - * `pixels` is a one-dimensional array for performance reasons. - * - * Each pixel occupies four elements in the `pixels` array, one for each RGBA - * value. For example, the pixel at coordinates (0, 0) stores its RGBA values - * at `pixels[0]`, `pixels[1]`, `pixels[2]`, and `pixels[3]`, respectively. - * The next pixel at coordinates (1, 0) stores its RGBA values at `pixels[4]`, - * `pixels[5]`, `pixels[6]`, and `pixels[7]`. And so on. The `pixels` array - * for a 100×100 canvas has 100 × 100 × 4 = 40,000 elements. - * - * Some displays use several smaller pixels to set the color at a single - * point. The pixelDensity() function returns - * the pixel density of the canvas. High density displays often have a - * pixelDensity() of 2. On such a display, the - * `pixels` array for a 100×100 canvas has 200 × 200 × 4 = - * 160,000 elements. - * - * Accessing the RGBA values for a point on the canvas requires a little math - * as shown below. The loadPixels() function - * must be called before accessing the `pixels` array. The - * updatePixels() function must be called - * after any changes are made. - * - * @property {Number[]} pixels - * - * @example - *
                - * - * loadPixels(); - * let x = 50; - * let y = 50; - * let d = pixelDensity(); - * for (let i = 0; i < d; i += 1) { - * for (let j = 0; j < d; j += 1) { - * let index = 4 * ((y * d + j) * width * d + (x * d + i)); - * // Red. - * pixels[index] = 0; - * // Green. - * pixels[index + 1] = 0; - * // Blue. - * pixels[index + 2] = 0; - * // Alpha. - * pixels[index + 3] = 255; - * } - * } - * updatePixels(); - * - * describe('A black dot in the middle of a gray rectangle.'); - * - *
                - * - *
                - * - * loadPixels(); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * for (let i = 0; i < halfImage; i += 4) { - * // Red. - * pixels[i] = 255; - * // Green. - * pixels[i + 1] = 0; - * // Blue. - * pixels[i + 2] = 0; - * // Alpha. - * pixels[i + 3] = 255; - * } - * updatePixels(); - * - * describe('A red rectangle drawn above a gray rectangle.'); - * - *
                - * - *
                - * - * let pink = color(255, 102, 204); - * loadPixels(); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * for (let i = 0; i < halfImage; i += 4) { - * pixels[i] = red(pink); - * pixels[i + 1] = green(pink); - * pixels[i + 2] = blue(pink); - * pixels[i + 3] = alpha(pink); - * } - * updatePixels(); - * - * describe('A pink rectangle drawn above a gray rectangle.'); - * - *
                - */ - - _main.default.prototype.pixels = [ - ]; - /** - * Copies a region of pixels from one image to another. The `blendMode` - * parameter blends the images' colors to create different effects. - * - * @method blend - * @param {p5.Image} srcImage source image. - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * @param {Constant} blendMode the blend mode. either - * BLEND, DARKEST, LIGHTEST, DIFFERENCE, - * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, - * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. - * - * @example - *
                - * - * let img0; - * let img1; - * - * function preload() { - * img0 = loadImage('assets/rockies.jpg'); - * img1 = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * background(img0); - * image(img1, 0, 0); - * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); - * } - * - *
                - * - *
                - * - * let img0; - * let img1; - * - * function preload() { - * img0 = loadImage('assets/rockies.jpg'); - * img1 = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * background(img0); - * image(img1, 0, 0); - * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); - * } - * - *
                - * - *
                - * - * let img0; - * let img1; - * - * function preload() { - * img0 = loadImage('assets/rockies.jpg'); - * img1 = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * background(img0); - * image(img1, 0, 0); - * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, ADD); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); - * } - * - *
                - */ - /** - * @method blend - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - * @param {Constant} blendMode - */ - _main.default.prototype.blend = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('blend', args); - if (this._renderer) { - var _this$_renderer; - (_this$_renderer = this._renderer).blend.apply(_this$_renderer, args); - } else { - _main.default.Renderer2D.prototype.blend.apply(this, args); - } - }; - /** - * Copies pixels from a source image to a region of the canvas. The source - * image can be the canvas itself or a p5.Image - * object. `copy()` will scale pixels from the source region if it isn't the - * same size as the destination region. - * - * @method copy - * @param {p5.Image|p5.Element} srcImage source image. - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * background(img); - * copy(img, 7, 22, 10, 10, 35, 25, 50, 50); - * // Show copied region. - * stroke(255); - * noFill(); - * square(7, 22, 10); - * - * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); - * } - * - *
                - */ - /** - * @method copy - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - */ - _main.default.prototype.copy = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('copy', args); - var srcImage, - sx, - sy, - sw, - sh, - dx, - dy, - dw, - dh; - if (args.length === 9) { - srcImage = args[0]; - sx = args[1]; - sy = args[2]; - sw = args[3]; - sh = args[4]; - dx = args[5]; - dy = args[6]; - dw = args[7]; - dh = args[8]; - } else if (args.length === 8) { - srcImage = this; - sx = args[0]; - sy = args[1]; - sw = args[2]; - sh = args[3]; - dx = args[4]; - dy = args[5]; - dw = args[6]; - dh = args[7]; - } else { - throw new Error('Signature not supported'); - } - _main.default.prototype._copyHelper(this, srcImage, sx, sy, sw, sh, dx, dy, dw, dh); - }; - _main.default.prototype._copyHelper = function (dstImage, srcImage, sx, sy, sw, sh, dx, dy, dw, dh) { - var s = srcImage.canvas.width / srcImage.width; - // adjust coord system for 3D when renderer - // ie top-left = -width/2, -height/2 - var sxMod = 0; - var syMod = 0; - if (srcImage._renderer && srcImage._renderer.isP3D) { - sxMod = srcImage.width / 2; - syMod = srcImage.height / 2; - } - if (dstImage._renderer && dstImage._renderer.isP3D) { - _main.default.RendererGL.prototype.image.call(dstImage._renderer, srcImage, sx + sxMod, sy + syMod, sw, sh, dx, dy, dw, dh); - } else { - dstImage.drawingContext.drawImage(srcImage.canvas, s * (sx + sxMod), s * (sy + syMod), s * sw, s * sh, dx, dy, dw, dh); - } - }; - /** - * Applies an image filter to the canvas. The preset options are: - * - * `INVERT` - * Inverts the colors in the image. No parameter is used. - * - * `GRAY` - * Converts the image to grayscale. No parameter is used. - * - * `THRESHOLD` - * Converts the image to black and white. Pixels with a grayscale value - * above a given threshold are converted to white. The rest are converted to - * black. The threshold must be between 0.0 (black) and 1.0 (white). If no - * value is specified, 0.5 is used. - * - * `OPAQUE` - * Sets the alpha channel to entirely opaque. No parameter is used. - * - * `POSTERIZE` - * Limits the number of colors in the image. Each color channel is limited to - * the number of colors specified. Values between 2 and 255 are valid, but - * results are most noticeable with lower values. The default value is 4. - * - * `BLUR` - * Blurs the image. The level of blurring is specified by a blur radius. Larger - * values increase the blur. The default value is 4. A gaussian blur is used - * in `P2D` mode. A box blur is used in `WEBGL` mode. - * - * `ERODE` - * Reduces the light areas. No parameter is used. - * - * `DILATE` - * Increases the light areas. No parameter is used. - * - * `filter()` uses WebGL in the background by default because it's faster. - * This can be disabled in `P2D` mode by adding a `false` argument, as in - * `filter(BLUR, false)`. This may be useful to keep computation off the GPU - * or to work around a lack of WebGL support. - * - * In `WEBGL` mode, `filter()` can also use custom shaders. See - * createFilterShader() for more - * information. - * - * - * @method filter - * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, - * POSTERIZE, BLUR, ERODE, DILATE or BLUR. - * @param {Number} [filterParam] parameter unique to each filter. - * @param {Boolean} [useWebGL] flag to control whether to use fast - * WebGL filters (GPU) or original image - * filters (CPU); defaults to `true`. - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(INVERT); - * - * describe('A blue brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(GRAY); - * - * describe('A brick wall drawn in grayscale.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(THRESHOLD); - * - * describe('A brick wall drawn in black and white.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(OPAQUE); - * - * describe('A red brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(POSTERIZE, 3); - * - * describe('An image of a red brick wall drawn with limited color palette.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(BLUR, 3); - * - * describe('A blurry image of a red brick wall.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(DILATE); - * - * describe('A red brick wall with bright lines between each brick.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(ERODE); - * - * describe('A red brick wall with faint lines between each brick.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * // Don't use WebGL. - * filter(BLUR, 3, false); - * - * describe('A blurry image of a red brick wall.'); - * } - * - *
                - */ - /** - * @method getFilterGraphicsLayer - * @private - * @returns {p5.Graphics} - */ - _main.default.prototype.getFilterGraphicsLayer = function () { - return this._renderer.getFilterGraphicsLayer(); - }; - /** - * @method filter - * @param {Constant} filterType - * @param {Boolean} [useWebGL] - */ - /** - * @method filter - * @param {p5.Shader} shaderFilter shader that's been loaded, with the - * frag shader using a `tex0` uniform. - */ - _main.default.prototype.filter = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('filter', arguments); - var _parseFilterArgs = parseFilterArgs.apply(void 0, args), - shader = _parseFilterArgs.shader, - operation = _parseFilterArgs.operation, - value = _parseFilterArgs.value, - useWebGL = _parseFilterArgs.useWebGL; // when passed a shader, use it directly - if (this._renderer.isP3D && shader) { - _main.default.RendererGL.prototype.filter.call(this._renderer, shader); - return; - } // when opting out of webgl, use old pixels method - - if (!useWebGL && !this._renderer.isP3D) { - if (this.canvas !== undefined) { - _filters.default.apply(this.canvas, _filters.default[operation], value); - } else { - _filters.default.apply(this.elt, _filters.default[operation], value); - } - return; - } - if (!useWebGL && this._renderer.isP3D) { - console.warn('filter() with useWebGL=false is not supported in WEBGL'); - } // when this is a webgl renderer, apply constant shader filter - - if (this._renderer.isP3D) { - _main.default.RendererGL.prototype.filter.call(this._renderer, operation, value); - } // when this is P2D renderer, create/use hidden webgl renderer - else { - var filterGraphicsLayer = this.getFilterGraphicsLayer(); - // copy p2d canvas contents to secondary webgl renderer - // dest - filterGraphicsLayer.copy( // src - this._renderer, // src coods - 0, 0, this.width, this.height, // dest coords - - this.width / 2, - this.height / 2, this.width, this.height); - //clearing the main canvas - this._renderer.clear(); - this._renderer.resetMatrix(); - // filter it with shaders - filterGraphicsLayer.filter.apply(filterGraphicsLayer, args); - // copy secondary webgl renderer back to original p2d canvas - this._renderer._pInst.image(filterGraphicsLayer, 0, 0); - filterGraphicsLayer.clear(); // prevent feedback effects on p2d canvas - } - }; - function parseFilterArgs() { - var _ref; - // args could be: - // - operation, value, [useWebGL] - // - operation, [useWebGL] - // - shader - var result = { - shader: undefined, - operation: undefined, - value: undefined, - useWebGL: true - }; - if ((arguments.length <= 0 ? undefined : arguments[0]) instanceof _main.default.Shader) { - result.shader = arguments.length <= 0 ? undefined : arguments[0]; - return result; - } else { - result.operation = arguments.length <= 0 ? undefined : arguments[0]; - } - if (arguments.length > 1 && typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'number') { - result.value = arguments.length <= 1 ? undefined : arguments[1]; - } - if ((_ref = arguments.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]) === false) { - result.useWebGL = false; - } - return result; - } /** - * Gets a pixel or a region of pixels from the canvas. - * - * `get()` is easy to use but it's not as fast as - * pixels. Use pixels - * to read many pixel values. - * - * The version of `get()` with no parameters returns the entire canvas. - * - * The version of `get()` with two parameters interprets them as - * coordinates. It returns an array with the `[R, G, B, A]` values of the - * pixel at the given point. - * - * The version of `get()` with four parameters interprets them as coordinates - * and dimensions. It returns a subsection of the canvas as a - * p5.Image object. The first two parameters are the - * coordinates for the upper-left corner of the subsection. The last two - * parameters are the width and height of the subsection. - * - * Use p5.Image.get() to work directly with - * p5.Image objects. - * - * @method get - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number} w width of the subsection to be returned. - * @param {Number} h height of the subsection to be returned. - * @return {p5.Image} subsection as a p5.Image object. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = get(); - * image(c, width / 2, 0); - * - * describe('Two identical mountain landscapes shown side-by-side.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = get(50, 90); - * fill(c); - * noStroke(); - * square(25, 25, 50); - * - * describe('A mountain landscape with an olive green square in its center.'); - * } - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = get(0, 0, width / 2, height / 2); - * image(c, width / 2, height / 2); - * - * describe('A mountain landscape drawn on top of another mountain landscape.'); - * } - * - *
                - */ - /** - * @method get - * @return {p5.Image} whole canvas as a p5.Image. - */ - /** - * @method get - * @param {Number} x - * @param {Number} y - * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. - */ - - _main.default.prototype.get = function (x, y, w, h) { - var _this$_renderer2; - _main.default._validateParameters('get', arguments); - return (_this$_renderer2 = this._renderer).get.apply(_this$_renderer2, arguments); - }; - /** - * Loads the current value of each pixel on the canvas into the - * pixels array. This - * function must be called before reading from or writing to - * pixels. - * - * @method loadPixels - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0, width, height); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * loadPixels(); - * for (let i = 0; i < halfImage; i += 1) { - * pixels[i + halfImage] = pixels[i]; - * } - * updatePixels(); - * - * describe('Two identical images of mountain landscapes, one on top of the other.'); - * } - * - *
                - */ - _main.default.prototype.loadPixels = function () { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - _main.default._validateParameters('loadPixels', args); - this._renderer.loadPixels(); - }; - /** - * Sets the color of a pixel or draws an image to the canvas. - * - * `set()` is easy to use but it's not as fast as - * pixels. Use pixels - * to set many pixel values. - * - * `set()` interprets the first two parameters as x- and y-coordinates. It - * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel - * array, a p5.Color object, or a - * p5.Image object. If an image is passed, the first - * two parameters set the coordinates for the image's upper-left corner, - * regardless of the current imageMode(). - * - * updatePixels() must be called after using - * `set()` for changes to appear. - * - * @method set - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number|Number[]|Object} c grayscale value | pixel array | - * p5.Color object | p5.Image to copy. - * @example - *
                - * - * set(30, 20, 0); - * set(85, 20, 0); - * set(85, 75, 0); - * set(30, 75, 0); - * updatePixels(); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                - * - *
                - * - * let black = color(0); - * set(30, 20, black); - * set(85, 20, black); - * set(85, 75, black); - * set(30, 75, black); - * updatePixels(); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                - * - *
                - * - * for (let x = 0; x < width; x += 1) { - * for (let y = 0; y < height; y += 1) { - * let c = map(x, 0, width, 0, 255); - * set(x, y, c); - * } - * } - * updatePixels(); - * - * describe('A horiztonal color gradient from black to white.'); - * - *
                - * - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * set(0, 0, img); - * updatePixels(); - * - * describe('An image of a mountain landscape.'); - * } - * - *
                - */ - _main.default.prototype.set = function (x, y, imgOrCol) { - this._renderer.set(x, y, imgOrCol); - }; - /** - * Updates the canvas with the RGBA values in the - * pixels array. - * - * `updatePixels()` only needs to be called after changing values in the - * pixels array. Such changes can be made directly - * after calling loadPixels() or by calling - * set(). - * - * @method updatePixels - * @param {Number} [x] x-coordinate of the upper-left corner of region - * to update. - * @param {Number} [y] y-coordinate of the upper-left corner of region - * to update. - * @param {Number} [w] width of region to update. - * @param {Number} [h] height of region to update. - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0, width, height); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * loadPixels(); - * for (let i = 0; i < halfImage; i += 1) { - * pixels[i + halfImage] = pixels[i]; - * } - * updatePixels(); - * - * describe('Two identical images of mountain landscapes, one on top of the other.'); - * } - * - *
                - */ - _main.default.prototype.updatePixels = function (x, y, w, h) { - _main.default._validateParameters('updatePixels', arguments); - // graceful fail - if loadPixels() or set() has not been called, pixel - // array will be empty, ignore call to updatePixels() - if (this.pixels.length === 0) { - return; - } - this._renderer.updatePixels(x, y, w, h); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../color/p5.Color': 284, - '../core/main': 298, - './filters': 319, - 'core-js/modules/es.array.filter': 173 - } - ], - 324: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.last-index-of'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.from-entries'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/web.url'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.last-index-of'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.from-entries'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.promise'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/web.url'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - _dereq_('whatwg-fetch'); - _dereq_('es6-promise/auto'); - var _fetchJsonp = _interopRequireDefault(_dereq_('fetch-jsonp')); - var _fileSaver = _interopRequireDefault(_dereq_('file-saver')); - _dereq_('../core/friendly_errors/validate_params'); - _dereq_('../core/friendly_errors/file_errors'); - _dereq_('../core/friendly_errors/fes_core'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module IO - * @submodule Input - * @for p5 - * @requires core - */ - /** - * Loads a JSON file from a file or a URL, and returns an Object. - * Note that even if the JSON file contains an Array, an Object will be - * returned with index numbers as keys. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. JSONP is supported via a polyfill and you - * can pass in as the second argument an object with definitions of the json - * callback following the syntax specified here. - * - * This method is suitable for fetching files up to size of 64MB. - * @method loadJSON - * @param {String} path name of the file or url to load - * @param {Object} [jsonpOptions] options object for jsonp related settings - * @param {String} [datatype] "json" or "jsonp" - * @param {function} [callback] function to be executed after - * loadJSON() completes, data is passed - * in as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Object|Array} JSON data - * @example - * - * Calling loadJSON() inside preload() guarantees to complete the - * operation before setup() and draw() are called. - * - *
                - * // Examples use USGS Earthquake API: - * // https://earthquake.usgs.gov/fdsnws/event/1/#methods - * let earthquakes; - * function preload() { - * // Get the most recent earthquake in the database - * let url = - 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + - * 'summary/all_day.geojson'; - * earthquakes = loadJSON(url); - * } - * - * function setup() { - * noLoop(); - * } - * - * function draw() { - * background(200); - * // Get the magnitude and name of the earthquake out of the loaded JSON - * let earthquakeMag = earthquakes.features[0].properties.mag; - * let earthquakeName = earthquakes.features[0].properties.place; - * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); - * textAlign(CENTER); - * text(earthquakeName, 0, height - 30, width, 30); - * describe(`50×50 ellipse that changes from black to white - * depending on the current humidity`); - * } - *
                - * - * Outside of preload(), you may supply a callback function to handle the - * object: - *
                - * function setup() { - * noLoop(); - * let url = - 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + - * 'summary/all_day.geojson'; - * loadJSON(url, drawEarthquake); - * } - * - * function draw() { - * background(200); - * describe(`50×50 ellipse that changes from black to white - * depending on the current humidity`); - * } - * - * function drawEarthquake(earthquakes) { - * // Get the magnitude and name of the earthquake out of the loaded JSON - * let earthquakeMag = earthquakes.features[0].properties.mag; - * let earthquakeName = earthquakes.features[0].properties.place; - * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); - * textAlign(CENTER); - * text(earthquakeName, 0, height - 30, width, 30); - * } - *
                - */ - /** - * @method loadJSON - * @param {String} path - * @param {String} datatype - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Object|Array} - */ - /** - * @method loadJSON - * @param {String} path - * @param {function} callback - * @param {function} [errorCallback] - * @return {Object|Array} - */ - - _main.default.prototype.loadJSON = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('loadJSON', args); - var path = args[0]; - var callback; - var errorCallback; - var options; - var ret = { - }; // object needed for preload - var t = 'json'; - // check for explicit data type argument - for (var i = 1; i < args.length; i++) { - var arg = args[i]; - if (typeof arg === 'string') { - if (arg === 'jsonp' || arg === 'json') { - t = arg; - } - } else if (typeof arg === 'function') { - if (!callback) { - callback = arg; - } else { - errorCallback = arg; - } - } else if (_typeof(arg) === 'object' && (arg.hasOwnProperty('jsonpCallback') || arg.hasOwnProperty('jsonpCallbackFunction'))) { - t = 'jsonp'; - options = arg; - } - } - var self = this; - this.httpDo(path, 'GET', options, t, function (resp) { - for (var k in resp) { - ret[k] = resp[k]; - } - if (typeof callback !== 'undefined') { - callback(resp); - } - self._decrementPreload(); - }, function (err) { - // Error handling - _main.default._friendlyFileLoadError(5, path); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }); - return ret; - }; - /** - * Reads the contents of a file and creates a String array of its individual - * lines. If the name of the file is used as the parameter, as in the above - * example, the file must be located in the sketch directory/folder. - * - * Alternatively, the file may be loaded from anywhere on the local - * computer using an absolute path (something that starts with / on Unix and - * Linux, or a drive letter on Windows), or the filename parameter can be a - * URL for a file found on a network. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. - * - * This method is suitable for fetching files up to size of 64MB. - * @method loadStrings - * @param {String} filename name of the file or url to load - * @param {function} [callback] function to be executed after loadStrings() - * completes, Array is passed in as first - * argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {String[]} Array of Strings - * @example - * - * Calling loadStrings() inside preload() guarantees to complete the - * operation before setup() and draw() are called. - * - *
                - * let result; - * function preload() { - * result = loadStrings('assets/test.txt'); - * } - - * function setup() { - * background(200); - * text(random(result), 10, 10, 80, 80); - * describe(`randomly generated text from a file, - * for example "i smell like butter"`); - * } - *
                - * - * Outside of preload(), you may supply a callback function to handle the - * object: - * - *
                - * function setup() { - * loadStrings('assets/test.txt', pickString); - * describe(`randomly generated text from a file, - * for example "i have three feet"`); - * } - * - * function pickString(result) { - * background(200); - * text(random(result), 10, 10, 80, 80); - * } - *
                - */ - _main.default.prototype.loadStrings = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('loadStrings', args); - var ret = [ - ]; - var callback, - errorCallback; - for (var i = 1; i < args.length; i++) { - var arg = args[i]; - if (typeof arg === 'function') { - if (typeof callback === 'undefined') { - callback = arg; - } else if (typeof errorCallback === 'undefined') { - errorCallback = arg; - } - } - } - var self = this; - _main.default.prototype.httpDo.call(this, args[0], 'GET', 'text', function (data) { - // split lines handling mac/windows/linux endings - var lines = data.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/); - // safe insert approach which will not blow up stack when inserting - // >100k lines, but still be faster than iterating line-by-line. based on - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#Examples - var QUANTUM = 32768; - for (var _i = 0, len = lines.length; _i < len; _i += QUANTUM) { - Array.prototype.push.apply(ret, lines.slice(_i, Math.min(_i + QUANTUM, len))); - } - if (typeof callback !== 'undefined') { - callback(ret); - } - self._decrementPreload(); - }, function (err) { - // Error handling - _main.default._friendlyFileLoadError(3, arguments[0]); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }); - return ret; - }; - /** - * Reads the contents of a file or URL and creates a p5.Table object with - * its values. If a file is specified, it must be located in the sketch's - * "data" folder. The filename parameter can also be a URL to a file found - * online. By default, the file is assumed to be comma-separated (in CSV - * format). Table only looks for a header row if the 'header' option is - * included. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. Calling loadTable() inside preload() - * guarantees to complete the operation before setup() and draw() are called. - * Outside of preload(), you may supply a callback function to handle the - * object: - * - * All files loaded and saved use UTF-8 encoding. This method is suitable for fetching files up to size of 64MB. - * @method loadTable - * @param {String} filename name of the file or URL to load - * @param {String} [extension] parse the table by comma-separated values "csv", semicolon-separated - * values "ssv", or tab-separated values "tsv" - * @param {String} [header] "header" to indicate table has header row - * @param {function} [callback] function to be executed after - * loadTable() completes. On success, the - * Table object is passed in as the - * first argument. - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Object} Table object containing data - * - * @example - *
                - * - * // Given the following CSV file called "mammals.csv" - * // located in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * //the file can be remote - * //table = loadTable("http://p5js.org/reference/assets/mammals.csv", - * // "csv", "header"); - * } - * - * function setup() { - * //count the columns - * print(table.getRowCount() + ' total rows in table'); - * print(table.getColumnCount() + ' total columns in table'); - * - * print(table.getColumn('name')); - * //["Goat", "Leopard", "Zebra"] - * - * //cycle through the table - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) { - * print(table.getString(r, c)); - * } - * describe(`randomly generated text from a file, - * for example "i smell like butter"`); - * } - * - *
                - */ - _main.default.prototype.loadTable = function (path) { - // p5._validateParameters('loadTable', arguments); - var callback; - var errorCallback; - var options = [ - ]; - var header = false; - var ext = path.substring(path.lastIndexOf('.') + 1, path.length); - var sep; - if (ext === 'csv') { - sep = ','; - } else if (ext === 'ssv') { - sep = ';'; - } else if (ext === 'tsv') { - sep = '\t'; - } - for (var i = 1; i < arguments.length; i++) { - if (typeof arguments[i] === 'function') { - if (typeof callback === 'undefined') { - callback = arguments[i]; - } else if (typeof errorCallback === 'undefined') { - errorCallback = arguments[i]; - } - } else if (typeof arguments[i] === 'string') { - options.push(arguments[i]); - if (arguments[i] === 'header') { - header = true; - } - if (arguments[i] === 'csv') { - sep = ','; - } else if (arguments[i] === 'ssv') { - sep = ';'; - } else if (arguments[i] === 'tsv') { - sep = '\t'; - } - } - } - var t = new _main.default.Table(); - var self = this; - this.httpDo(path, 'GET', 'table', function (resp) { - var state = { - }; - // define constants - var PRE_TOKEN = 0, - MID_TOKEN = 1, - POST_TOKEN = 2, - POST_RECORD = 4; - var QUOTE = '"', - CR = '\r', - LF = '\n'; - var records = [ - ]; - var offset = 0; - var currentRecord = null; - var currentChar; - var tokenBegin = function tokenBegin() { - state.currentState = PRE_TOKEN; - state.token = ''; - }; - var tokenEnd = function tokenEnd() { - currentRecord.push(state.token); - tokenBegin(); - }; - var recordBegin = function recordBegin() { - state.escaped = false; - currentRecord = [ - ]; - tokenBegin(); - }; - var recordEnd = function recordEnd() { - state.currentState = POST_RECORD; - records.push(currentRecord); - currentRecord = null; - }; - for (; ; ) { - currentChar = resp[offset++]; - // EOF - if (currentChar == null) { - if (state.escaped) { - throw new Error('Unclosed quote in file.'); - } - if (currentRecord) { - tokenEnd(); - recordEnd(); - break; - } - } - if (currentRecord === null) { - recordBegin(); - } // Handle opening quote - - if (state.currentState === PRE_TOKEN) { - if (currentChar === QUOTE) { - state.escaped = true; - state.currentState = MID_TOKEN; - continue; - } - state.currentState = MID_TOKEN; - } // mid-token and escaped, look for sequences and end quote - - if (state.currentState === MID_TOKEN && state.escaped) { - if (currentChar === QUOTE) { - if (resp[offset] === QUOTE) { - state.token += QUOTE; - offset++; - } else { - state.escaped = false; - state.currentState = POST_TOKEN; - } - } else if (currentChar === CR) { - continue; - } else { - state.token += currentChar; - } - continue; - } // fall-through: mid-token or post-token, not escaped - - if (currentChar === CR) { - if (resp[offset] === LF) { - offset++; - } - tokenEnd(); - recordEnd(); - } else if (currentChar === LF) { - tokenEnd(); - recordEnd(); - } else if (currentChar === sep) { - tokenEnd(); - } else if (state.currentState === MID_TOKEN) { - state.token += currentChar; - } - } // set up column names - - if (header) { - t.columns = records.shift(); - } else { - for (var _i2 = 0; _i2 < records[0].length; _i2++) { - t.columns[_i2] = 'null'; - } - } - var row; - for (var _i3 = 0; _i3 < records.length; _i3++) { - //Handles row of 'undefined' at end of some CSVs - if (records[_i3].length === 1) { - if (records[_i3][0] === 'undefined' || records[_i3][0] === '') { - continue; - } - } - row = new _main.default.TableRow(); - row.arr = records[_i3]; - row.obj = makeObject(records[_i3], t.columns); - t.addRow(row); - } - if (typeof callback === 'function') { - callback(t); - } - self._decrementPreload(); - }, function (err) { - // Error handling - _main.default._friendlyFileLoadError(2, path); - if (errorCallback) { - errorCallback(err); - } else { - console.error(err); - } - }); - return t; - }; - // helper function to turn a row into a JSON object - function makeObject(row, headers) { - headers = headers || [ - ]; - if (typeof headers === 'undefined') { - for (var j = 0; j < row.length; j++) { - headers[j.toString()] = j; - } - } - return Object.fromEntries(headers.map(function (key, i) { - return [key, - row[i]]; - })); - } /** - * Reads the contents of a file and creates an XML object with its values. - * If the name of the file is used as the parameter, as in the above example, - * the file must be located in the sketch directory/folder. - * - * Alternatively, the file maybe be loaded from anywhere on the local - * computer using an absolute path (something that starts with / on Unix and - * Linux, or a drive letter on Windows), or the filename parameter can be a - * URL for a file found on a network. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. Calling loadXML() inside preload() - * guarantees to complete the operation before setup() and draw() are called. - * - * Outside of preload(), you may supply a callback function to handle the - * object. - * - * This method is suitable for fetching files up to size of 64MB. - * @method loadXML - * @param {String} filename name of the file or URL to load - * @param {function} [callback] function to be executed after loadXML() - * completes, XML object is passed in as - * first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Object} XML object containing data - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let children = xml.getChildren('animal'); - * - * for (let i = 0; i < children.length; i++) { - * let id = children[i].getNum('id'); - * let coloring = children[i].getString('species'); - * let name = children[i].getContent(); - * print(id + ', ' + coloring + ', ' + name); - * } - * describe('no image displayed'); - * } - * - * // Sketch prints: - * // 0, Capra hircus, Goat - * // 1, Panthera pardus, Leopard - * // 2, Equus zebra, Zebra - *
                - */ - - _main.default.prototype.loadXML = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - var ret = new _main.default.XML(); - var callback, - errorCallback; - for (var i = 1; i < args.length; i++) { - var arg = args[i]; - if (typeof arg === 'function') { - if (typeof callback === 'undefined') { - callback = arg; - } else if (typeof errorCallback === 'undefined') { - errorCallback = arg; - } - } - } - var self = this; - this.httpDo(args[0], 'GET', 'xml', function (xml) { - for (var key in xml) { - ret[key] = xml[key]; - } - if (typeof callback !== 'undefined') { - callback(ret); - } - self._decrementPreload(); - }, function (err) { - // Error handling - _main.default._friendlyFileLoadError(1, arguments[0]); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }); - return ret; - }; - /** - * This method is suitable for fetching files up to size of 64MB. - * @method loadBytes - * @param {string} file name of the file or URL to load - * @param {function} [callback] function to be executed after loadBytes() - * completes - * @param {function} [errorCallback] function to be executed if there - * is an error - * @returns {Object} an object whose 'bytes' property will be the loaded buffer - * - * @example - *
                - * let data; - * - * function preload() { - * data = loadBytes('assets/mammals.xml'); - * } - * - * function setup() { - * for (let i = 0; i < 5; i++) { - * console.log(data.bytes[i].toString(16)); - * } - * describe('no image displayed'); - * } - *
                - */ - _main.default.prototype.loadBytes = function (file, callback, errorCallback) { - var ret = { - }; - var self = this; - this.httpDo(file, 'GET', 'arrayBuffer', function (arrayBuffer) { - ret.bytes = new Uint8Array(arrayBuffer); - if (typeof callback === 'function') { - callback(ret); - } - self._decrementPreload(); - }, function (err) { - // Error handling - _main.default._friendlyFileLoadError(6, file); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }); - return ret; - }; - /** - * Method for executing an HTTP GET request. If data type is not specified, - * p5 will try to guess based on the URL, defaulting to text. This is equivalent to - * calling httpDo(path, 'GET'). The 'binary' datatype will return - * a Blob object, and the 'arrayBuffer' datatype will return an ArrayBuffer - * which can be used to initialize typed arrays (such as Uint8Array). - * - * @method httpGet - * @param {String} path name of the file or url to load - * @param {String} [datatype] "json", "jsonp", "binary", "arrayBuffer", - * "xml", or "text" - * @param {Object|Boolean} [data] param data passed sent with request - * @param {function} [callback] function to be executed after - * httpGet() completes, data is passed in - * as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Promise} A promise that resolves with the data when the operation - * completes successfully or rejects with the error after - * one occurs. - * @example - *
                - * // Examples use USGS Earthquake API: - * // https://earthquake.usgs.gov/fdsnws/event/1/#methods - * let earthquakes; - * function preload() { - * // Get the most recent earthquake in the database - * let url = - 'https://earthquake.usgs.gov/fdsnws/event/1/query?' + - * 'format=geojson&limit=1&orderby=time'; - * httpGet(url, 'jsonp', false, function(response) { - * // when the HTTP request completes, populate the variable that holds the - * // earthquake data used in the visualization. - * earthquakes = response; - * }); - * } - * - * function draw() { - * if (!earthquakes) { - * // Wait until the earthquake data has loaded before drawing. - * return; - * } - * background(200); - * // Get the magnitude and name of the earthquake out of the loaded JSON - * let earthquakeMag = earthquakes.features[0].properties.mag; - * let earthquakeName = earthquakes.features[0].properties.place; - * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); - * textAlign(CENTER); - * text(earthquakeName, 0, height - 30, width, 30); - * noLoop(); - * } - *
                - */ - /** - * @method httpGet - * @param {String} path - * @param {Object|Boolean} data - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Promise} - */ - /** - * @method httpGet - * @param {String} path - * @param {function} callback - * @param {function} [errorCallback] - * @return {Promise} - */ - _main.default.prototype.httpGet = function () { - _main.default._validateParameters('httpGet', arguments); - var args = Array.prototype.slice.call(arguments); - args.splice(1, 0, 'GET'); - return _main.default.prototype.httpDo.apply(this, args); - }; - /** - * Method for executing an HTTP POST request. If data type is not specified, - * p5 will try to guess based on the URL, defaulting to text. This is equivalent to - * calling httpDo(path, 'POST'). - * - * @method httpPost - * @param {String} path name of the file or url to load - * @param {String} [datatype] "json", "jsonp", "xml", or "text". - * If omitted, httpPost() will guess. - * @param {Object|Boolean} [data] param data passed sent with request - * @param {function} [callback] function to be executed after - * httpPost() completes, data is passed in - * as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Promise} A promise that resolves with the data when the operation - * completes successfully or rejects with the error after - * one occurs. - * - * @example - *
                - * - * // Examples use jsonplaceholder.typicode.com for a Mock Data API - * - * let url = 'https://jsonplaceholder.typicode.com/posts'; - * let postData = { userId: 1, title: 'p5 Clicked!', body: 'p5.js is very cool.' }; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * } - * - * function mousePressed() { - * httpPost(url, 'json', postData, function(result) { - * strokeWeight(2); - * text(result.body, mouseX, mouseY); - * }); - * } - * - *
                - * - *
                - * let url = 'ttps://invalidURL'; // A bad URL that will cause errors - * let postData = { title: 'p5 Clicked!', body: 'p5.js is very cool.' }; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * } - * - * function mousePressed() { - * httpPost( - * url, - * 'json', - * postData, - * function(result) { - * // ... won't be called - * }, - * function(error) { - * strokeWeight(2); - * text(error.toString(), mouseX, mouseY); - * } - * ); - * } - *
                - */ - /** - * @method httpPost - * @param {String} path - * @param {Object|Boolean} data - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Promise} - */ - /** - * @method httpPost - * @param {String} path - * @param {function} callback - * @param {function} [errorCallback] - * @return {Promise} - */ - _main.default.prototype.httpPost = function () { - _main.default._validateParameters('httpPost', arguments); - var args = Array.prototype.slice.call(arguments); - args.splice(1, 0, 'POST'); - return _main.default.prototype.httpDo.apply(this, args); - }; - /** - * Method for executing an HTTP request. If data type is not specified, - * p5 will try to guess based on the URL, defaulting to text.

                - * For more advanced use, you may also pass in the path as the first argument - * and a object as the second argument, the signature follows the one specified - * in the Fetch API specification. - * This method is suitable for fetching files up to size of 64MB when "GET" is used. - * - * @method httpDo - * @param {String} path name of the file or url to load - * @param {String} [method] either "GET", "POST", or "PUT", - * defaults to "GET" - * @param {String} [datatype] "json", "jsonp", "xml", or "text" - * @param {Object} [data] param data passed sent with request - * @param {function} [callback] function to be executed after - * httpGet() completes, data is passed in - * as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Promise} A promise that resolves with the data when the operation - * completes successfully or rejects with the error after - * one occurs. - * - * @example - *
                - * - * // Examples use USGS Earthquake API: - * // https://earthquake.usgs.gov/fdsnws/event/1/#methods - * - * // displays an animation of all USGS earthquakes - * let earthquakes; - * let eqFeatureIndex = 0; - * - * function preload() { - * let url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson'; - * httpDo( - * url, - * { - * method: 'GET', - * // Other Request options, like special headers for apis - * headers: { authorization: 'Bearer secretKey' } - * }, - * function(res) { - * earthquakes = res; - * } - * ); - * } - * - * function draw() { - * // wait until the data is loaded - * if (!earthquakes || !earthquakes.features[eqFeatureIndex]) { - * return; - * } - * clear(); - * - * let feature = earthquakes.features[eqFeatureIndex]; - * let mag = feature.properties.mag; - * let rad = mag / 11 * ((width + height) / 2); - * fill(255, 0, 0, 100); - * ellipse(width / 2 + random(-2, 2), height / 2 + random(-2, 2), rad, rad); - * - * if (eqFeatureIndex >= earthquakes.features.length) { - * eqFeatureIndex = 0; - * } else { - * eqFeatureIndex += 1; - * } - * } - * - *
                - */ - /** - * @method httpDo - * @param {String} path - * @param {Object} options Request object options as documented in the - * "fetch" API - * reference - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Promise} - */ - _main.default.prototype.httpDo = function () { - var type; - var callback; - var errorCallback; - var request; - var promise; - var jsonpOptions = { - }; - var cbCount = 0; - var contentType = 'text/plain'; - // Trim the callbacks off the end to get an idea of how many arguments are passed - for (var i = arguments.length - 1; i > 0; i--) { - if (typeof (i < 0 || arguments.length <= i ? undefined : arguments[i]) === 'function') { - cbCount++; - } else { - break; - } - } // The number of arguments minus callbacks - - var argsCount = arguments.length - cbCount; - var path = arguments.length <= 0 ? undefined : arguments[0]; - if (argsCount === 2 && typeof path === 'string' && _typeof(arguments.length <= 1 ? undefined : arguments[1]) === 'object') { - // Intended for more advanced use, pass in Request parameters directly - request = new Request(path, arguments.length <= 1 ? undefined : arguments[1]); - callback = arguments.length <= 2 ? undefined : arguments[2]; - errorCallback = arguments.length <= 3 ? undefined : arguments[3]; - } else { - // Provided with arguments - var method = 'GET'; - var data; - for (var j = 1; j < arguments.length; j++) { - var a = j < 0 || arguments.length <= j ? undefined : arguments[j]; - if (typeof a === 'string') { - if (a === 'GET' || a === 'POST' || a === 'PUT' || a === 'DELETE') { - method = a; - } else if (a === 'json' || a === 'jsonp' || a === 'binary' || a === 'arrayBuffer' || a === 'xml' || a === 'text' || a === 'table') { - type = a; - } else { - data = a; - } - } else if (typeof a === 'number') { - data = a.toString(); - } else if (_typeof(a) === 'object') { - if (a.hasOwnProperty('jsonpCallback') || a.hasOwnProperty('jsonpCallbackFunction')) { - for (var attr in a) { - jsonpOptions[attr] = a[attr]; - } - } else if (a instanceof _main.default.XML) { - data = a.serialize(); - contentType = 'application/xml'; - } else { - data = JSON.stringify(a); - contentType = 'application/json'; - } - } else if (typeof a === 'function') { - if (!callback) { - callback = a; - } else { - errorCallback = a; - } - } - } - var headers = method === 'GET' ? new Headers() : new Headers({ - 'Content-Type': contentType - }); - request = new Request(path, { - method: method, - mode: 'cors', - body: data, - headers: headers - }); - } // do some sort of smart type checking - - if (!type) { - if (path.includes('json')) { - type = 'json'; - } else if (path.includes('xml')) { - type = 'xml'; - } else { - type = 'text'; - } - } - if (type === 'jsonp') { - promise = (0, _fetchJsonp.default) (path, jsonpOptions); - } else { - promise = fetch(request); - } - promise = promise.then(function (res) { - if (!res.ok) { - var err = new Error(res.body); - err.status = res.status; - err.ok = false; - throw err; - } else { - var fileSize = 0; - if (type !== 'jsonp') { - fileSize = res.headers.get('content-length'); - } - if (fileSize && fileSize > 64000000) { - _main.default._friendlyFileLoadError(7, path); - } - switch (type) { - case 'json': - case 'jsonp': - return res.json(); - case 'binary': - return res.blob(); - case 'arrayBuffer': - return res.arrayBuffer(); - case 'xml': - return res.text().then(function (text) { - var parser = new DOMParser(); - var xml = parser.parseFromString(text, 'text/xml'); - return new _main.default.XML(xml.documentElement); - }); - default: - return res.text(); - } - } - }); - promise.then(callback || function () { - }); - promise.catch(errorCallback || console.error); - return promise; - }; - /** - * @module IO - * @submodule Output - * @for p5 - */ - window.URL = window.URL || window.webkitURL; - // private array of p5.PrintWriter objects - _main.default.prototype._pWriters = [ - ]; - /** - * @method createWriter - * @param {String} name name of the file to be created - * @param {String} [extension] - * @return {p5.PrintWriter} - * @example - *
                - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * const writer = createWriter('squares.txt'); - * for (let i = 0; i < 10; i++) { - * writer.print(i * i); - * } - * writer.close(); - * writer.clear(); - * } - * } - * - *
                - */ - _main.default.prototype.createWriter = function (name, extension) { - var newPW; - // check that it doesn't already exist - for (var i in _main.default.prototype._pWriters) { - if (_main.default.prototype._pWriters[i].name === name) { - // if a p5.PrintWriter w/ this name already exists... - // return p5.prototype._pWriters[i]; // return it w/ contents intact. - // or, could return a new, empty one with a unique name: - newPW = new _main.default.PrintWriter(name + this.millis(), extension); - _main.default.prototype._pWriters.push(newPW); - return newPW; - } - } - newPW = new _main.default.PrintWriter(name, extension); - _main.default.prototype._pWriters.push(newPW); - return newPW; - }; - /** - * @class p5.PrintWriter - * @param {String} filename - * @param {String} [extension] - */ - _main.default.PrintWriter = function (filename, extension) { - var self = this; - this.name = filename; - this.content = ''; - //Changed to write because it was being overloaded by function below. - /** - * Writes data to the PrintWriter stream - * @method write - * @param {Array} data all data to be written by the PrintWriter - * @example - *
                - * - * // creates a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // write 'Hello world!'' to the file - * writer.write(['Hello world!']); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                - *
                - * - * // creates a file called 'newFile2.txt' - * let writer = createWriter('newFile2.txt'); - * // write 'apples,bananas,123' to the file - * writer.write(['apples', 'bananas', 123]); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                - *
                - * - * // creates a file called 'newFile3.txt' - * let writer = createWriter('newFile3.txt'); - * // write 'My name is: Teddy' to the file - * writer.write('My name is:'); - * writer.write(' Teddy'); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                - *
                - * - * function setup() { - * createCanvas(100, 100); - * button = createButton('SAVE FILE'); - * button.position(21, 40); - * button.mousePressed(createFile); - * } - * - * function createFile() { - * // creates a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // write 'Hello world!'' to the file - * writer.write(['Hello world!']); - * // close the PrintWriter and save the file - * writer.close(); - * } - * - *
                - */ - this.write = function (data) { - this.content += data; - }; - /** - * Writes data to the PrintWriter stream, and adds a new line at the end - * @method print - * @param {Array} data all data to be printed by the PrintWriter - * @example - *
                - * - * // creates a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // creates a file containing - * // My name is: - * // Teddy - * writer.print('My name is:'); - * writer.print('Teddy'); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                - *
                - * - * let writer; - * - * function setup() { - * createCanvas(400, 400); - * // create a PrintWriter - * writer = createWriter('newFile.txt'); - * } - * - * function draw() { - * writer.print([mouseX, mouseY]); - * } - * - * function mouseClicked() { - * writer.close(); - * } - * - *
                - */ - this.print = function (data) { - this.content += ''.concat(data, '\n'); - }; - /** - * Clears the data already written to the PrintWriter object - * @method clear - * @example - *
                - * // create writer object - * let writer = createWriter('newFile.txt'); - * writer.write(['clear me']); - * // clear writer object here - * writer.clear(); - * // close writer - * writer.close(); - *
                - *
                - * - * function setup() { - * button = createButton('CLEAR ME'); - * button.position(21, 40); - * button.mousePressed(createFile); - * } - * - * function createFile() { - * let writer = createWriter('newFile.txt'); - * writer.write(['clear me']); - * writer.clear(); - * writer.close(); - * } - * - *
                - * - */ - this.clear = function () { - this.content = ''; - }; - /** - * Closes the PrintWriter - * @method close - * @example - *
                - * - * // create a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                - *
                - * - * // create a file called 'newFile2.txt' - * let writer = createWriter('newFile2.txt'); - * // write some data to the file - * writer.write([100, 101, 102]); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                - */ - this.close = function () { - // convert String to Array for the writeFile Blob - var arr = [ - ]; - arr.push(this.content); - _main.default.prototype.writeFile(arr, filename, extension); - // remove from _pWriters array and delete self - for (var i in _main.default.prototype._pWriters) { - if (_main.default.prototype._pWriters[i].name === this.name) { - // remove from _pWriters array - _main.default.prototype._pWriters.splice(i, 1); - } - } - self.clear(); - self = { - }; - }; - }; - /** - * @module IO - * @submodule Output - * @for p5 - */ - // object, filename, options --> saveJSON, saveStrings, - // filename, [extension] [canvas] --> saveImage - /** - * Saves a given element(image, text, json, csv, wav, or html) to the client's - * computer. The first parameter can be a pointer to element we want to save. - * The element can be one of p5.Element,an Array of - * Strings, an Array of JSON, a JSON object, a p5.Table - * , a p5.Image, or a p5.SoundFile (requires - * p5.sound). The second parameter is a filename (including extension).The - * third parameter is for options specific to this type of object. This method - * will save a file that fits the given parameters. - * If it is called without specifying an element, by default it will save the - * whole canvas as an image file. You can optionally specify a filename as - * the first parameter in such a case. - * **Note that it is not recommended to - * call this method within draw, as it will open a new save dialog on every - * render.** - * - * @method save - * @param {Object|String} [objectOrFilename] If filename is provided, will - * save canvas as an image with - * either png or jpg extension - * depending on the filename. - * If object is provided, will - * save depending on the object - * and filename (see examples - * above). - * @param {String} [filename] If an object is provided as the first - * parameter, then the second parameter - * indicates the filename, - * and should include an appropriate - * file extension (see examples above). - * @param {Boolean|String} [options] Additional options depend on - * filetype. For example, when saving JSON, - * true indicates that the - * output will be optimized for filesize, - * rather than readability. - * - * @example - *
                - * // Saves the canvas as an image - * cnv = createCanvas(300, 300); - * save(cnv, 'myCanvas.jpg'); - * - * // Saves the canvas as an image by default - * save('myCanvas.jpg'); - * describe('An example for saving a canvas as an image.'); - *
                - * - *
                - * // Saves p5.Image as an image - * img = createImage(10, 10); - * save(img, 'myImage.png'); - * describe('An example for saving a p5.Image element as an image.'); - *
                - * - *
                - * // Saves p5.Renderer object as an image - * obj = createGraphics(100, 100); - * save(obj, 'myObject.png'); - * describe('An example for saving a p5.Renderer element.'); - *
                - * - *
                - * let myTable = new p5.Table(); - * // Saves table as html file - * save(myTable, 'myTable.html'); - * - * // Comma Separated Values - * save(myTable, 'myTable.csv'); - * - * // Tab Separated Values - * save(myTable, 'myTable.tsv'); - * - * describe(`An example showing how to save a table in formats of - * HTML, CSV and TSV.`); - *
                - * - *
                - * let myJSON = { a: 1, b: true }; - * - * // Saves pretty JSON - * save(myJSON, 'my.json'); - * - * // Optimizes JSON filesize - * save(myJSON, 'my.json', true); - * - * describe('An example for saving JSON to a txt file with some extra arguments.'); - *
                - * - *
                - * // Saves array of strings to text file with line breaks after each item - * let arrayOfStrings = ['a', 'b']; - * save(arrayOfStrings, 'my.txt'); - * describe(`An example for saving an array of strings to text file - * with line breaks.`); - *
                - */ - _main.default.prototype.save = function (object, _filename, _options) { - // parse the arguments and figure out which things we are saving - var args = arguments; - // ================================================= - // OPTION 1: saveCanvas... - // if no arguments are provided, save canvas - var cnv = this._curElement ? this._curElement.elt : this.elt; - if (args.length === 0) { - _main.default.prototype.saveCanvas(cnv); - return; - } else if (args[0] instanceof _main.default.Renderer || args[0] instanceof _main.default.Graphics) { - // otherwise, parse the arguments - // if first param is a p5Graphics, then saveCanvas - _main.default.prototype.saveCanvas(args[0].elt, args[1], args[2]); - return; - } else if (args.length === 1 && typeof args[0] === 'string') { - // if 1st param is String and only one arg, assume it is canvas filename - _main.default.prototype.saveCanvas(cnv, args[0]); - } else { - // ================================================= - // OPTION 2: extension clarifies saveStrings vs. saveJSON - var extension = _checkFileExtension(args[1], args[2]) [1]; - switch (extension) { - case 'json': - _main.default.prototype.saveJSON(args[0], args[1], args[2]); - return; - case 'txt': - _main.default.prototype.saveStrings(args[0], args[1], args[2]); - return; - // ================================================= - // OPTION 3: decide based on object... - default: - if (args[0] instanceof Array) { - _main.default.prototype.saveStrings(args[0], args[1], args[2]); - } else if (args[0] instanceof _main.default.Table) { - _main.default.prototype.saveTable(args[0], args[1], args[2]); - } else if (args[0] instanceof _main.default.Image) { - _main.default.prototype.saveCanvas(args[0].canvas, args[1]); - } else if (args[0] instanceof _main.default.SoundFile) { - _main.default.prototype.saveSound(args[0], args[1], args[2], args[3]); - } - } - } - }; - /** - * Writes the contents of an Array or a JSON object to a .json file. - * The file saving process and location of the saved file will - * vary between web browsers. - * - * @method saveJSON - * @param {Array|Object} json - * @param {String} filename - * @param {Boolean} [optimize] If true, removes line breaks - * and spaces from the output - * file to optimize filesize - * (but not readability). - * @example - *
                - * let json = {}; // new JSON Object - * - * json.id = 0; - * json.species = 'Panthera leo'; - * json.name = 'Lion'; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * describe('no image displayed'); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * saveJSON(json, 'lion.json'); - * } - * } - * - * // saves the following to a file called "lion.json": - * // { - * // "id": 0, - * // "species": "Panthera leo", - * // "name": "Lion" - * // } - *
                - */ - _main.default.prototype.saveJSON = function (json, filename, opt) { - _main.default._validateParameters('saveJSON', arguments); - var stringify; - if (opt) { - stringify = JSON.stringify(json); - } else { - stringify = JSON.stringify(json, undefined, 2); - } - this.saveStrings(stringify.split('\n'), filename, 'json'); - }; - _main.default.prototype.saveJSONObject = _main.default.prototype.saveJSON; - _main.default.prototype.saveJSONArray = _main.default.prototype.saveJSON; - /** - * Writes an array of Strings to a text file, one line per String. - * The file saving process and location of the saved file will - * vary between web browsers. - * - * @method saveStrings - * @param {String[]} list string array to be written - * @param {String} filename filename for output - * @param {String} [extension] the filename's extension - * @param {Boolean} [isCRLF] if true, change line-break to CRLF - * @example - *
                - * let words = 'apple bear cat dog'; - * - * // .split() outputs an Array - * let list = split(words, ' '); - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * describe('no image displayed'); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * saveStrings(list, 'nouns.txt'); - * } - * } - * - * // Saves the following to a file called 'nouns.txt': - * // - * // apple - * // bear - * // cat - * // dog - *
                - */ - _main.default.prototype.saveStrings = function (list, filename, extension, isCRLF) { - _main.default._validateParameters('saveStrings', arguments); - var ext = extension || 'txt'; - var pWriter = this.createWriter(filename, ext); - for (var i = 0; i < list.length; i++) { - isCRLF ? pWriter.write(list[i] + '\r\n') : pWriter.write(list[i] + '\n'); - } - pWriter.close(); - pWriter.clear(); - }; - // ======= - // HELPERS - // ======= - function escapeHelper(content) { - return content.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); - } /** - * Writes the contents of a Table object to a file. Defaults to a - * text file with comma-separated-values ('csv') but can also - * use tab separation ('tsv'), or generate an HTML table ('html'). - * The file saving process and location of the saved file will - * vary between web browsers. - * - * @method saveTable - * @param {p5.Table} Table the Table object to save to a file - * @param {String} filename the filename to which the Table should be saved - * @param {String} [options] can be one of "tsv", "csv", or "html" - * @example - *
                - * let table; - * - * function setup() { - * table = new p5.Table(); - * - * table.addColumn('id'); - * table.addColumn('species'); - * table.addColumn('name'); - * - * let newRow = table.addRow(); - * newRow.setNum('id', table.getRowCount() - 1); - * newRow.setString('species', 'Panthera leo'); - * newRow.setString('name', 'Lion'); - * - * // To save, un-comment next line then click 'run' - * // saveTable(table, 'new.csv'); - * - * describe('no image displayed'); - * } - * - * // Saves the following to a file called 'new.csv': - * // id,species,name - * // 0,Panthera leo,Lion - *
                - */ - - _main.default.prototype.saveTable = function (table, filename, options) { - _main.default._validateParameters('saveTable', arguments); - var ext; - if (options === undefined) { - ext = filename.substring(filename.lastIndexOf('.') + 1, filename.length); - } else { - ext = options; - } - var pWriter = this.createWriter(filename, ext); - var header = table.columns; - var sep = ','; // default to CSV - if (ext === 'tsv') { - sep = '\t'; - } - if (ext !== 'html') { - // make header if it has values - if (header[0] !== '0') { - for (var h = 0; h < header.length; h++) { - if (h < header.length - 1) { - pWriter.write(header[h] + sep); - } else { - pWriter.write(header[h]); - } - } - pWriter.write('\n'); - } // make rows - - for (var i = 0; i < table.rows.length; i++) { - var j = void 0; - for (j = 0; j < table.rows[i].arr.length; j++) { - if (j < table.rows[i].arr.length - 1) { - //double quotes should be inserted in csv only if contains comma separated single value - if (ext === 'csv' && String(table.rows[i].arr[j]).includes(',')) { - pWriter.write('"' + table.rows[i].arr[j] + '"' + sep); - } else { - pWriter.write(table.rows[i].arr[j] + sep); - } - } else { - //double quotes should be inserted in csv only if contains comma separated single value - if (ext === 'csv' && String(table.rows[i].arr[j]).includes(',')) { - pWriter.write('"' + table.rows[i].arr[j] + '"'); - } else { - pWriter.write(table.rows[i].arr[j]); - } - } - } - pWriter.write('\n'); - } - } else { - // otherwise, make HTML - pWriter.print(''); - pWriter.print(''); - var str = ' '); - pWriter.print(''); - pWriter.print(' '); - // make header if it has values - if (header[0] !== '0') { - pWriter.print(' '); - for (var k = 0; k < header.length; k++) { - var e = escapeHelper(header[k]); - pWriter.print(' '); - } - pWriter.print(' '); - } // make rows - - for (var row = 0; row < table.rows.length; row++) { - pWriter.print(' '); - for (var col = 0; col < table.columns.length; col++) { - var entry = table.rows[row].getString(col); - var htmlEntry = escapeHelper(entry); - pWriter.print(' '); - } - pWriter.print(' '); - } - pWriter.print('
                '.concat(e)); - pWriter.print('
                '.concat(htmlEntry)); - pWriter.print('
                '); - pWriter.print(''); - pWriter.print(''); - } // close and clear the pWriter - - pWriter.close(); - pWriter.clear(); - }; // end saveTable() - /** - * Generate a blob of file data as a url to prepare for download. - * Accepts an array of data, a filename, and an extension (optional). - * This is a private function because it does not do any formatting, - * but it is used by saveStrings, saveJSON, saveTable etc. - * - * @param {Array} dataToDownload - * @param {String} filename - * @param {String} [extension] - * @private - */ - _main.default.prototype.writeFile = function (dataToDownload, filename, extension) { - var type = 'application/octet-stream'; - if (_main.default.prototype._isSafari()) { - type = 'text/plain'; - } - var blob = new Blob(dataToDownload, { - type: type - }); - _main.default.prototype.downloadFile(blob, filename, extension); - }; - /** - * Forces download. Accepts a url to filedata/blob, a filename, - * and an extension (optional). - * This is a private function because it does not do any formatting, - * but it is used by saveStrings, saveJSON, saveTable etc. - * - * @method downloadFile - * @private - * @param {String|Blob} data either an href generated by createObjectURL, - * or a Blob object containing the data - * @param {String} [filename] - * @param {String} [extension] - */ - _main.default.prototype.downloadFile = function (data, fName, extension) { - var fx = _checkFileExtension(fName, extension); - var filename = fx[0]; - if (data instanceof Blob) { - _fileSaver.default.saveAs(data, filename); - return; - } - var a = document.createElement('a'); - a.href = data; - a.download = filename; - // Firefox requires the link to be added to the DOM before click() - a.onclick = function (e) { - destroyClickedElement(e); - e.stopPropagation(); - }; - a.style.display = 'none'; - document.body.appendChild(a); - // Safari will open this file in the same page as a confusing Blob. - if (_main.default.prototype._isSafari()) { - var aText = 'Hello, Safari user! To download this file...\n'; - aText += '1. Go to File --> Save As.\n'; - aText += '2. Choose "Page Source" as the Format.\n'; - aText += '3. Name it with this extension: ."'.concat(fx[1], '"'); - alert(aText); - } - a.click(); - }; - /** - * Returns a file extension, or another string - * if the provided parameter has no extension. - * - * @param {String} filename - * @param {String} [extension] - * @return {String[]} [fileName, fileExtension] - * - * @private - */ - function _checkFileExtension(filename, extension) { - if (!extension || extension === true || extension === 'true') { - extension = ''; - } - if (!filename) { - filename = 'untitled'; - } - var ext = ''; - // make sure the file will have a name, see if filename needs extension - if (filename && filename.includes('.')) { - ext = filename.split('.').pop(); - } // append extension if it doesn't exist - - if (extension) { - if (ext !== extension) { - ext = extension; - filename = ''.concat(filename, '.').concat(ext); - } - } - return [filename, - ext]; - } - _main.default.prototype._checkFileExtension = _checkFileExtension; - /** - * Returns true if the browser is Safari, false if not. - * Safari makes trouble for downloading files. - * - * @return {Boolean} [description] - * @private - */ - _main.default.prototype._isSafari = function () { - var x = Object.prototype.toString.call(window.HTMLElement); - return x.indexOf('Constructor') > 0; - }; - /** - * Helper function, a callback for download that deletes - * an invisible anchor element from the DOM once the file - * has been automatically downloaded. - * - * @private - */ - function destroyClickedElement(event) { - document.body.removeChild(event.target); - } - var _default = _main.default; - exports.default = _default; - }, - { - '../core/friendly_errors/fes_core': 289, - '../core/friendly_errors/file_errors': 290, - '../core/friendly_errors/validate_params': 293, - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.last-index-of': 181, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.object.from-entries': 195, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.promise': 201, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/web.dom-collections.iterator': 256, - 'core-js/modules/web.url': 258, - 'es6-promise/auto': 259, - 'fetch-jsonp': 261, - 'file-saver': 262, - 'whatwg-fetch': 275 - } - ], - 325: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.replace'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module IO - * @submodule Table - * @requires core - */ - /** - * Table Options - * Generic class for handling tabular data, typically from a - * CSV, TSV, or other sort of spreadsheet file. - * CSV files are - * - * comma separated values, often with the data in quotes. TSV - * files use tabs as separators, and usually don't bother with the - * quotes. - * File names should end with .csv if they're comma separated. - * A rough "spec" for CSV can be found - * here. - * To load files, use the loadTable method. - * To save tables to your computer, use the save method - * or the saveTable method. - * - * Possible options include: - *
                  - *
                • csv - parse the table as comma-separated values - *
                • tsv - parse the table as tab-separated values - *
                • header - this table has a header (title) row - *
                - */ - /** - * Table objects store data with multiple rows and columns, much - * like in a traditional spreadsheet. Tables can be generated from - * scratch, dynamically, or using data from an existing file. - * - * @class p5.Table - * @constructor - * @param {p5.TableRow[]} [rows] An array of p5.TableRow objects - */ - - _main.default.Table = /*#__PURE__*/ function () { - /** - * An array containing the names of the columns in the table, if the "header" the table is - * loaded with the "header" parameter. - * @type {String[]} - * @property columns - * @name columns - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //print the column names - * for (let c = 0; c < table.getColumnCount(); c++) { - * print('column ' + c + ' is named ' + table.columns[c]); - * } - * } - * - *
                - */ - function _class(rows) { - _classCallCheck(this, _class); - this.columns = [ - ]; - /** - * An array containing the p5.TableRow objects that make up the - * rows of the table. The same result as calling getRows() - * @type {p5.TableRow[]} - * @property rows - * @name rows - */ - this.rows = [ - ]; - } /** - * Use addRow() to add a new row of data to a p5.Table object. By default, - * an empty row is created. Typically, you would store a reference to - * the new row in a TableRow object (see newRow in the example above), - * and then set individual values using set(). - * - * If a p5.TableRow object is included as a parameter, then that row is - * duplicated and added to the table. - * - * @method addRow - * @param {p5.TableRow} [row] row to be added to the table - * @return {p5.TableRow} the row that was added - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //add a row - * let newRow = table.addRow(); - * newRow.setString('id', table.getRowCount() - 1); - * newRow.setString('species', 'Canis Lupus'); - * newRow.setString('name', 'Wolf'); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                - */ - - _createClass(_class, [ - { - key: 'addRow', - value: function addRow(row) { - // make sure it is a valid TableRow - var r = row || new _main.default.TableRow(); - if (typeof r.arr === 'undefined' || typeof r.obj === 'undefined') { - //r = new p5.prototype.TableRow(r); - throw new Error('invalid TableRow: '.concat(r)); - } - r.table = this; - this.rows.push(r); - return r; - } /** - * Removes a row from the table object. - * - * @method removeRow - * @param {Integer} id ID number of the row to remove - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //remove the first row - * table.removeRow(0); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'removeRow', - value: function removeRow(id) { - this.rows[id].table = null; // remove reference to table - var chunk = this.rows.splice(id + 1, this.rows.length); - this.rows.pop(); - this.rows = this.rows.concat(chunk); - } /** - * Returns a reference to the specified p5.TableRow. The reference - * can then be used to get and set values of the selected row. - * - * @method getRow - * @param {Integer} rowID ID number of the row to get - * @return {p5.TableRow} p5.TableRow object - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let row = table.getRow(1); - * //print it column by column - * //note: a row is an object, not an array - * for (let c = 0; c < table.getColumnCount(); c++) { - * print(row.getString(c)); - * } - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getRow', - value: function getRow(r) { - return this.rows[r]; - } /** - * Gets all rows from the table. Returns an array of p5.TableRows. - * - * @method getRows - * @return {p5.TableRow[]} Array of p5.TableRows - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * - * //warning: rows is an array of objects - * for (let r = 0; r < rows.length; r++) { - * rows[r].set('name', 'Unicorn'); - * } - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getRows', - value: function getRows() { - return this.rows; - } /** - * Finds the first row in the Table that contains the value - * provided, and returns a reference to that row. Even if - * multiple rows are possible matches, only the first matching - * row is returned. The column to search may be specified by - * either its ID or title. - * - * @method findRow - * @param {String} value The value to match - * @param {Integer|String} column ID number or title of the - * column to search - * @return {p5.TableRow} - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //find the animal named zebra - * let row = table.findRow('Zebra', 'name'); - * //find the corresponding species - * print(row.getString('species')); - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'findRow', - value: function findRow(value, column) { - // try the Object - if (typeof column === 'string') { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column] === value) { - return this.rows[i]; - } - } - } else { - // try the Array - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column] === value) { - return this.rows[j]; - } - } - } // otherwise... - - return null; - } /** - * Finds the rows in the Table that contain the value - * provided, and returns references to those rows. Returns an - * Array, so for must be used to iterate through all the rows, - * as shown in the example above. The column to search may be - * specified by either its ID or title. - * - * @method findRows - * @param {String} value The value to match - * @param {Integer|String} column ID number or title of the - * column to search - * @return {p5.TableRow[]} An Array of TableRow objects - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //add another goat - * let newRow = table.addRow(); - * newRow.setString('id', table.getRowCount() - 1); - * newRow.setString('species', 'Scape Goat'); - * newRow.setString('name', 'Goat'); - * - * //find the rows containing animals named Goat - * let rows = table.findRows('Goat', 'name'); - * print(rows.length + ' Goats found'); - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'findRows', - value: function findRows(value, column) { - var ret = [ - ]; - if (typeof column === 'string') { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column] === value) { - ret.push(this.rows[i]); - } - } - } else { - // try the Array - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column] === value) { - ret.push(this.rows[j]); - } - } - } - return ret; - } /** - * Finds the first row in the Table that matches the regular - * expression provided, and returns a reference to that row. - * Even if multiple rows are possible matches, only the first - * matching row is returned. The column to search may be - * specified by either its ID or title. - * - * @method matchRow - * @param {String|RegExp} regexp The regular expression to match - * @param {String|Integer} column The column ID (number) or - * title (string) - * @return {p5.TableRow} TableRow object - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //Search using specified regex on a given column, return TableRow object - * let mammal = table.matchRow(new RegExp('ant'), 1); - * print(mammal.getString(1)); - * //Output "Panthera pardus" - * } - * - *
                - */ - - }, - { - key: 'matchRow', - value: function matchRow(regexp, column) { - if (typeof column === 'number') { - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column].match(regexp)) { - return this.rows[j]; - } - } - } else { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column].match(regexp)) { - return this.rows[i]; - } - } - } - return null; - } /** - * Finds the rows in the Table that match the regular expression provided, - * and returns references to those rows. Returns an array, so for must be - * used to iterate through all the rows, as shown in the example. The - * column to search may be specified by either its ID or title. - * - * @method matchRows - * @param {String} regexp The regular expression to match - * @param {String|Integer} [column] The column ID (number) or - * title (string) - * @return {p5.TableRow[]} An Array of TableRow objects - * @example - *
                - * - * let table; - * - * function setup() { - * table = new p5.Table(); - * - * table.addColumn('name'); - * table.addColumn('type'); - * - * let newRow = table.addRow(); - * newRow.setString('name', 'Lion'); - * newRow.setString('type', 'Mammal'); - * - * newRow = table.addRow(); - * newRow.setString('name', 'Snake'); - * newRow.setString('type', 'Reptile'); - * - * newRow = table.addRow(); - * newRow.setString('name', 'Mosquito'); - * newRow.setString('type', 'Insect'); - * - * newRow = table.addRow(); - * newRow.setString('name', 'Lizard'); - * newRow.setString('type', 'Reptile'); - * - * let rows = table.matchRows('R.*', 'type'); - * for (let i = 0; i < rows.length; i++) { - * print(rows[i].getString('name') + ': ' + rows[i].getString('type')); - * } - * } - * // Sketch prints: - * // Snake: Reptile - * // Lizard: Reptile - * - *
                - */ - - }, - { - key: 'matchRows', - value: function matchRows(regexp, column) { - var ret = [ - ]; - if (typeof column === 'number') { - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column].match(regexp)) { - ret.push(this.rows[j]); - } - } - } else { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column].match(regexp)) { - ret.push(this.rows[i]); - } - } - } - return ret; - } /** - * Retrieves all values in the specified column, and returns them - * as an array. The column may be specified by either its ID or title. - * - * @method getColumn - * @param {String|Number} column String or Number of the column to return - * @return {Array} Array of column values - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //getColumn returns an array that can be printed directly - * print(table.getColumn('species')); - * //outputs ["Capra hircus", "Panthera pardus", "Equus zebra"] - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getColumn', - value: function getColumn(value) { - var ret = [ - ]; - if (typeof value === 'string') { - for (var i = 0; i < this.rows.length; i++) { - ret.push(this.rows[i].obj[value]); - } - } else { - for (var j = 0; j < this.rows.length; j++) { - ret.push(this.rows[j].arr[value]); - } - } - return ret; - } /** - * Removes all rows from a Table. While all rows are removed, - * columns and column titles are maintained. - * - * @method clearRows - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.clearRows(); - * print(table.getRowCount() + ' total rows in table'); - * print(table.getColumnCount() + ' total columns in table'); - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'clearRows', - value: function clearRows() { - delete this.rows; - this.rows = [ - ]; - } /** - * Use addColumn() to add a new column to a Table object. - * Typically, you will want to specify a title, so the column - * may be easily referenced later by name. (If no title is - * specified, the new column's title will be null.) - * - * @method addColumn - * @param {String} [title] title of the given column - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.addColumn('carnivore'); - * table.set(0, 'carnivore', 'no'); - * table.set(1, 'carnivore', 'yes'); - * table.set(2, 'carnivore', 'no'); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'addColumn', - value: function addColumn(title) { - var t = title || null; - this.columns.push(t); - } /** - * Returns the total number of columns in a Table. - * - * @method getColumnCount - * @return {Integer} Number of columns in this table - * @example - *
                - * - * // given the cvs file "blobs.csv" in /assets directory - * // ID, Name, Flavor, Shape, Color - * // Blob1, Blobby, Sweet, Blob, Pink - * // Blob2, Saddy, Savory, Blob, Blue - * - * let table; - * - * function preload() { - * table = loadTable('assets/blobs.csv'); - * } - * - * function setup() { - * createCanvas(200, 100); - * textAlign(CENTER); - * background(255); - * } - * - * function draw() { - * let numOfColumn = table.getColumnCount(); - * text('There are ' + numOfColumn + ' columns in the table.', 100, 50); - * } - * - *
                - */ - - }, - { - key: 'getColumnCount', - value: function getColumnCount() { - return this.columns.length; - } /** - * Returns the total number of rows in a Table. - * - * @method getRowCount - * @return {Integer} Number of rows in this table - * @example - *
                - * - * // given the cvs file "blobs.csv" in /assets directory - * // - * // ID, Name, Flavor, Shape, Color - * // Blob1, Blobby, Sweet, Blob, Pink - * // Blob2, Saddy, Savory, Blob, Blue - * - * let table; - * - * function preload() { - * table = loadTable('assets/blobs.csv'); - * } - * - * function setup() { - * createCanvas(200, 100); - * textAlign(CENTER); - * background(255); - * } - * - * function draw() { - * text('There are ' + table.getRowCount() + ' rows in the table.', 100, 50); - * } - * - *
                - */ - - }, - { - key: 'getRowCount', - value: function getRowCount() { - return this.rows.length; - } /** - * Removes any of the specified characters (or "tokens"). - * - * If no column is specified, then the values in all columns and - * rows are processed. A specific column may be referenced by - * either its ID or title. - * - * @method removeTokens - * @param {String} chars String listing characters to be removed - * @param {String|Integer} [column] Column ID (number) - * or name (string) - * - * @example - *
                - * function setup() { - * let table = new p5.Table(); - * - * table.addColumn('name'); - * table.addColumn('type'); - * - * let newRow = table.addRow(); - * newRow.setString('name', ' $Lion ,'); - * newRow.setString('type', ',,,Mammal'); - * - * newRow = table.addRow(); - * newRow.setString('name', '$Snake '); - * newRow.setString('type', ',,,Reptile'); - * - * table.removeTokens(',$ '); - * print(table.getArray()); - * } - * - * // prints: - * // 0 "Lion" "Mamal" - * // 1 "Snake" "Reptile" - *
                - */ - - }, - { - key: 'removeTokens', - value: function removeTokens(chars, column) { - var escape = function escape(s) { - return s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); - }; - var charArray = [ - ]; - for (var i = 0; i < chars.length; i++) { - charArray.push(escape(chars.charAt(i))); - } - var regex = new RegExp(charArray.join('|'), 'g'); - if (typeof column === 'undefined') { - for (var c = 0; c < this.columns.length; c++) { - for (var d = 0; d < this.rows.length; d++) { - var s = this.rows[d].arr[c]; - s = s.replace(regex, ''); - this.rows[d].arr[c] = s; - this.rows[d].obj[this.columns[c]] = s; - } - } - } else if (typeof column === 'string') { - for (var j = 0; j < this.rows.length; j++) { - var val = this.rows[j].obj[column]; - val = val.replace(regex, ''); - this.rows[j].obj[column] = val; - var pos = this.columns.indexOf(column); - this.rows[j].arr[pos] = val; - } - } else { - for (var k = 0; k < this.rows.length; k++) { - var str = this.rows[k].arr[column]; - str = str.replace(regex, ''); - this.rows[k].arr[column] = str; - this.rows[k].obj[this.columns[column]] = str; - } - } - } /** - * Trims leading and trailing whitespace, such as spaces and tabs, - * from String table values. If no column is specified, then the - * values in all columns and rows are trimmed. A specific column - * may be referenced by either its ID or title. - * - * @method trim - * @param {String|Integer} [column] Column ID (number) - * or name (string) - * @example - *
                - * function setup() { - * let table = new p5.Table(); - * - * table.addColumn('name'); - * table.addColumn('type'); - * - * let newRow = table.addRow(); - * newRow.setString('name', ' Lion ,'); - * newRow.setString('type', ' Mammal '); - * - * newRow = table.addRow(); - * newRow.setString('name', ' Snake '); - * newRow.setString('type', ' Reptile '); - * - * table.trim(); - * print(table.getArray()); - * } - * - * // prints: - * // 0 "Lion" "Mamal" - * // 1 "Snake" "Reptile" - *
                - */ - - }, - { - key: 'trim', - value: function trim(column) { - var regex = new RegExp(' ', 'g'); - if (typeof column === 'undefined') { - for (var c = 0; c < this.columns.length; c++) { - for (var d = 0; d < this.rows.length; d++) { - var s = this.rows[d].arr[c]; - s = s.replace(regex, ''); - this.rows[d].arr[c] = s; - this.rows[d].obj[this.columns[c]] = s; - } - } - } else if (typeof column === 'string') { - for (var j = 0; j < this.rows.length; j++) { - var val = this.rows[j].obj[column]; - val = val.replace(regex, ''); - this.rows[j].obj[column] = val; - var pos = this.columns.indexOf(column); - this.rows[j].arr[pos] = val; - } - } else { - for (var k = 0; k < this.rows.length; k++) { - var str = this.rows[k].arr[column]; - str = str.replace(regex, ''); - this.rows[k].arr[column] = str; - this.rows[k].obj[this.columns[column]] = str; - } - } - } /** - * Use removeColumn() to remove an existing column from a Table - * object. The column to be removed may be identified by either - * its title (a String) or its index value (an int). - * removeColumn(0) would remove the first column, removeColumn(1) - * would remove the second column, and so on. - * - * @method removeColumn - * @param {String|Integer} column columnName (string) or ID (number) - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.removeColumn('id'); - * print(table.getColumnCount()); - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'removeColumn', - value: function removeColumn(c) { - var cString; - var cNumber; - if (typeof c === 'string') { - // find the position of c in the columns - cString = c; - cNumber = this.columns.indexOf(c); - } else { - cNumber = c; - cString = this.columns[c]; - } - var chunk = this.columns.splice(cNumber + 1, this.columns.length); - this.columns.pop(); - this.columns = this.columns.concat(chunk); - for (var i = 0; i < this.rows.length; i++) { - var tempR = this.rows[i].arr; - var chip = tempR.splice(cNumber + 1, tempR.length); - tempR.pop(); - this.rows[i].arr = tempR.concat(chip); - delete this.rows[i].obj[cString]; - } - } /** - * Stores a value in the Table's specified row and column. - * The row is specified by its ID, while the column may be specified - * by either its ID or title. - * - * @method set - * @param {Integer} row row ID - * @param {String|Integer} column column ID (Number) - * or title (String) - * @param {String|Number} value value to assign - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.set(0, 'species', 'Canis Lupus'); - * table.set(0, 'name', 'Wolf'); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'set', - value: function set(row, column, value) { - this.rows[row].set(column, value); - } /** - * Stores a Float value in the Table's specified row and column. - * The row is specified by its ID, while the column may be specified - * by either its ID or title. - * - * @method setNum - * @param {Integer} row row ID - * @param {String|Integer} column column ID (Number) - * or title (String) - * @param {Number} value value to assign - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.setNum(1, 'id', 1); - * - * print(table.getColumn(0)); - * //["0", 1, "2"] - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'setNum', - value: function setNum(row, column, value) { - this.rows[row].setNum(column, value); - } /** - * Stores a String value in the Table's specified row and column. - * The row is specified by its ID, while the column may be specified - * by either its ID or title. - * - * @method setString - * @param {Integer} row row ID - * @param {String|Integer} column column ID (Number) - * or title (String) - * @param {String} value value to assign - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //add a row - * let newRow = table.addRow(); - * newRow.setString('id', table.getRowCount() - 1); - * newRow.setString('species', 'Canis Lupus'); - * newRow.setString('name', 'Wolf'); - * - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                - */ - - }, - { - key: 'setString', - value: function setString(row, column, value) { - this.rows[row].setString(column, value); - } /** - * Retrieves a value from the Table's specified row and column. - * The row is specified by its ID, while the column may be specified by - * either its ID or title. - * - * @method get - * @param {Integer} row row ID - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String|Number} - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * print(table.get(0, 1)); - * //Capra hircus - * print(table.get(0, 'species')); - * //Capra hircus - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'get', - value: function get(row, column) { - return this.rows[row].get(column); - } /** - * Retrieves a Float value from the Table's specified row and column. - * The row is specified by its ID, while the column may be specified by - * either its ID or title. - * - * @method getNum - * @param {Integer} row row ID - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {Number} - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * print(table.getNum(1, 0) + 100); - * //id 1 + 100 = 101 - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getNum', - value: function getNum(row, column) { - return this.rows[row].getNum(column); - } /** - * Retrieves a String value from the Table's specified row and column. - * The row is specified by its ID, while the column may be specified by - * either its ID or title. - * - * @method getString - * @param {Integer} row row ID - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String} - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * // table is comma separated value "CSV" - * // and has specifiying header for column labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * print(table.getString(0, 0)); // 0 - * print(table.getString(0, 1)); // Capra hircus - * print(table.getString(0, 2)); // Goat - * print(table.getString(1, 0)); // 1 - * print(table.getString(1, 1)); // Panthera pardus - * print(table.getString(1, 2)); // Leopard - * print(table.getString(2, 0)); // 2 - * print(table.getString(2, 1)); // Equus zebra - * print(table.getString(2, 2)); // Zebra - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getString', - value: function getString(row, column) { - return this.rows[row].getString(column); - } /** - * Retrieves all table data and returns as an object. If a column name is - * passed in, each row object will be stored with that attribute as its - * title. - * - * @method getObject - * @param {String} [headerColumn] Name of the column which should be used to - * title each row object (optional) - * @return {Object} - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let tableObject = table.getObject(); - * - * print(tableObject); - * //outputs an object - * - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getObject', - value: function getObject(headerColumn) { - var tableObject = { - }; - var obj, - cPos, - index; - for (var i = 0; i < this.rows.length; i++) { - obj = this.rows[i].obj; - if (typeof headerColumn === 'string') { - cPos = this.columns.indexOf(headerColumn); // index of columnID - if (cPos >= 0) { - index = obj[headerColumn]; - tableObject[index] = obj; - } else { - throw new Error('This table has no column named "'.concat(headerColumn, '"')); - } - } else { - tableObject[i] = this.rows[i].obj; - } - } - return tableObject; - } /** - * Retrieves all table data and returns it as a multidimensional array. - * - * @method getArray - * @return {Array} - * - * @example - *
                - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leoperd - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * // table is comma separated value "CSV" - * // and has specifiying header for column labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let tableArray = table.getArray(); - * for (let i = 0; i < tableArray.length; i++) { - * print(tableArray[i]); - * } - * describe('no image displayed'); - * } - * - *
                - */ - - }, - { - key: 'getArray', - value: function getArray() { - var tableArray = [ - ]; - for (var i = 0; i < this.rows.length; i++) { - tableArray.push(this.rows[i].arr); - } - return tableArray; - } - } - ]); - return _class; - }(); - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.regexp.constructor': 204, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.match': 211, - 'core-js/modules/es.string.replace': 214 - } - ], - 326: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.from-entries'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.from-entries'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module IO - * @submodule Table - * @requires core - */ - /** - * A TableRow object represents a single row of data values, - * stored in columns, from a table. - * - * A Table Row contains both an ordered array, and an unordered - * JSON object. - * - * @class p5.TableRow - * @constructor - * @param {String} [str] optional: populate the row with a - * string of values, separated by the - * separator - * @param {String} [separator] comma separated values (csv) by default - */ - - _main.default.TableRow = /*#__PURE__*/ function () { - function _class(str, separator) { - _classCallCheck(this, _class); - var arr = [ - ]; - if (str) { - separator = separator || ','; - arr = str.split(separator); - } - this.arr = arr; - this.obj = Object.fromEntries(arr.entries()); - this.table = null; - } /** - * Stores a value in the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method set - * @param {String|Integer} column Column ID (Number) - * or Title (String) - * @param {String|Number} value The value to be stored - * - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * rows[r].set('name', 'Unicorn'); - * } - * - * //print the results - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                - */ - - _createClass(_class, [ - { - key: 'set', - value: function set(column, value) { - // if typeof column is string, use .obj - if (typeof column === 'string') { - var cPos = this.table.columns.indexOf(column); // index of columnID - if (cPos >= 0) { - this.obj[column] = value; - this.arr[cPos] = value; - } else { - throw new Error('This table has no column named "'.concat(column, '"')); - } - } else { - // if typeof column is number, use .arr - if (column < this.table.columns.length) { - this.arr[column] = value; - var cTitle = this.table.columns[column]; - this.obj[cTitle] = value; - } else { - throw new Error('Column #'.concat(column, ' is out of the range of this table')); - } - } - } /** - * Stores a Float value in the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method setNum - * @param {String|Integer} column Column ID (Number) - * or Title (String) - * @param {Number|String} value The value to be stored - * as a Float - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * rows[r].setNum('id', r + 10); - * } - * - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                - */ - - }, - { - key: 'setNum', - value: function setNum(column, value) { - var floatVal = parseFloat(value); - this.set(column, floatVal); - } /** - * Stores a String value in the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method setString - * @param {String|Integer} column Column ID (Number) - * or Title (String) - * @param {String|Number|Boolean|Object} value The value to be stored - * as a String - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * let name = rows[r].getString('name'); - * rows[r].setString('name', 'A ' + name + ' named George'); - * } - * - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                - */ - - }, - { - key: 'setString', - value: function setString(column, value) { - var stringVal = value.toString(); - this.set(column, stringVal); - } /** - * Retrieves a value from the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method get - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String|Number} - * - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let names = []; - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * names.push(rows[r].get('name')); - * } - * - * print(names); - * - * describe('no image displayed'); - * } - *
                - */ - - }, - { - key: 'get', - value: function get(column) { - if (typeof column === 'string') { - return this.obj[column]; - } else { - return this.arr[column]; - } - } /** - * Retrieves a Float value from the TableRow's specified - * column. The column may be specified by either its ID or - * title. - * - * @method getNum - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {Number} Float Floating point number - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * let minId = Infinity; - * let maxId = -Infinity; - * for (let r = 0; r < rows.length; r++) { - * let id = rows[r].getNum('id'); - * minId = min(minId, id); - * maxId = min(maxId, id); - * } - * print('minimum id = ' + minId + ', maximum id = ' + maxId); - * describe('no image displayed'); - * } - *
                - */ - - }, - { - key: 'getNum', - value: function getNum(column) { - var ret; - if (typeof column === 'string') { - ret = parseFloat(this.obj[column]); - } else { - ret = parseFloat(this.arr[column]); - } - if (ret.toString() === 'NaN') { - throw 'Error: '.concat(this.obj[column], ' is NaN (Not a Number)'); - } - return ret; - } /** - * Retrieves an String value from the TableRow's specified - * column. The column may be specified by either its ID or - * title. - * - * @method getString - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String} String - * @example - *
                - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * let longest = ''; - * for (let r = 0; r < rows.length; r++) { - * let species = rows[r].getString('species'); - * if (longest.length < species.length) { - * longest = species; - * } - * } - * - * print('longest: ' + longest); - * - * describe('no image displayed'); - * } - *
                - */ - - }, - { - key: 'getString', - value: function getString(column) { - if (typeof column === 'string') { - return this.obj[column].toString(); - } else { - return this.arr[column].toString(); - } - } - } - ]); - return _class; - }(); - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.from-entries': 195, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 327: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module IO - * @submodule Input - * @requires core - */ - /** - * XML is a representation of an XML object, able to parse XML code. Use - * loadXML() to load external XML files and create XML objects. - * - * @class p5.XML - * @constructor - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let children = xml.getChildren('animal'); - * - * for (let i = 0; i < children.length; i++) { - * let id = children[i].getNum('id'); - * let coloring = children[i].getString('species'); - * let name = children[i].getContent(); - * print(id + ', ' + coloring + ', ' + name); - * } - * - * describe('no image displayed'); - * } - * - * // Sketch prints: - * // 0, Capra hircus, Goat - * // 1, Panthera pardus, Leopard - * // 2, Equus zebra, Zebra - *
                - */ - - _main.default.XML = /*#__PURE__*/ function () { - function _class(DOM) { - _classCallCheck(this, _class); - if (!DOM) { - var xmlDoc = document.implementation.createDocument(null, 'doc'); - this.DOM = xmlDoc.createElement('root'); - } else { - this.DOM = DOM; - } - } /** - * Gets a copy of the element's parent. Returns the parent as another - * p5.XML object. - * - * @method getParent - * @return {p5.XML} element parent - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let children = xml.getChildren('animal'); - * let parent = children[1].getParent(); - * print(parent.getName()); - * } - * - * // Sketch prints: - * // mammals - *
                - */ - - _createClass(_class, [ - { - key: 'getParent', - value: function getParent() { - return new _main.default.XML(this.DOM.parentElement); - } /** - * Gets the element's full name, which is returned as a String. - * - * @method getName - * @return {String} the name of the node - * @example<animal - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.getName()); - * } - * - * // Sketch prints: - * // mammals - *
                - */ - - }, - { - key: 'getName', - value: function getName() { - return this.DOM.tagName; - } /** - * Sets the element's name, which is specified as a String. - * - * @method setName - * @param {String} the new name of the node - * @example<animal - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.getName()); - * xml.setName('fish'); - * print(xml.getName()); - * } - * - * // Sketch prints: - * // mammals - * // fish - *
                - */ - - }, - { - key: 'setName', - value: function setName(name) { - var content = this.DOM.innerHTML; - var attributes = this.DOM.attributes; - var xmlDoc = document.implementation.createDocument(null, 'default'); - var newDOM = xmlDoc.createElement(name); - newDOM.innerHTML = content; - for (var i = 0; i < attributes.length; i++) { - newDOM.setAttribute(attributes[i].nodeName, attributes.nodeValue); - } - this.DOM = newDOM; - } /** - * Checks whether or not the element has any children, and returns the result - * as a boolean. - * - * @method hasChildren - * @return {boolean} - * @example<animal - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.hasChildren()); - * } - * - * // Sketch prints: - * // true - *
                - */ - - }, - { - key: 'hasChildren', - value: function hasChildren() { - return this.DOM.children.length > 0; - } /** - * Get the names of all of the element's children, and returns the names as an - * array of Strings. This is the same as looping through and calling getName() - * on each child element individually. - * - * @method listChildren - * @return {String[]} names of the children of the element - * @example<animal - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.listChildren()); - * } - * - * // Sketch prints: - * // ["animal", "animal", "animal"] - *
                - */ - - }, - { - key: 'listChildren', - value: function listChildren() { - var arr = [ - ]; - for (var i = 0; i < this.DOM.childNodes.length; i++) { - arr.push(this.DOM.childNodes[i].nodeName); - } - return arr; - } /** - * Returns all of the element's children as an array of p5.XML objects. When - * the name parameter is specified, then it will return all children that match - * that name. - * - * @method getChildren - * @param {String} [name] element name - * @return {p5.XML[]} children of the element - * @example<animal - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let animals = xml.getChildren('animal'); - * - * for (let i = 0; i < animals.length; i++) { - * print(animals[i].getContent()); - * } - * } - * - * // Sketch prints: - * // "Goat" - * // "Leopard" - * // "Zebra" - *
                - */ - - }, - { - key: 'getChildren', - value: function getChildren(param) { - if (param) { - return elementsToP5XML(this.DOM.getElementsByTagName(param)); - } else { - return elementsToP5XML(this.DOM.children); - } - } /** - * Returns the first of the element's children that matches the name parameter - * or the child of the given index.It returns undefined if no matching - * child is found. - * - * @method getChild - * @param {String|Integer} name element name or index - * @return {p5.XML} - * @example<animal - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getContent()); - * } - * - * // Sketch prints: - * // "Goat" - *
                - *
                - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let secondChild = xml.getChild(1); - * print(secondChild.getContent()); - * } - * - * // Sketch prints: - * // "Leopard" - *
                - */ - - }, - { - key: 'getChild', - value: function getChild(param) { - if (typeof param === 'string') { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this.DOM.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var child = _step.value; - if (child.tagName === param) return new _main.default.XML(child); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } else { - return new _main.default.XML(this.DOM.children[param]); - } - } /** - * Appends a new child to the element. The child can be specified with - * either a String, which will be used as the new tag's name, or as a - * reference to an existing p5.XML object. - * A reference to the newly created child is returned as an p5.XML object. - * - * @method addChild - * @param {p5.XML} node a p5.XML Object which will be the child to be added - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let child = new p5.XML(); - * child.setName('animal'); - * child.setAttribute('id', '3'); - * child.setAttribute('species', 'Ornithorhynchus anatinus'); - * child.setContent('Platypus'); - * xml.addChild(child); - * - * let animals = xml.getChildren('animal'); - * print(animals[animals.length - 1].getContent()); - * } - * - * // Sketch prints: - * // "Goat" - * // "Leopard" - * // "Zebra" - *
                - */ - - }, - { - key: 'addChild', - value: function addChild(node) { - if (node instanceof _main.default.XML) { - this.DOM.appendChild(node.DOM); - } else { - // PEND - } - } /** - * Removes the element specified by name or index. - * - * @method removeChild - * @param {String|Integer} name element name or index - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * xml.removeChild('animal'); - * let children = xml.getChildren(); - * for (let i = 0; i < children.length; i++) { - * print(children[i].getContent()); - * } - * } - * - * // Sketch prints: - * // "Leopard" - * // "Zebra" - *
                - *
                - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * xml.removeChild(1); - * let children = xml.getChildren(); - * for (let i = 0; i < children.length; i++) { - * print(children[i].getContent()); - * } - * } - * - * // Sketch prints: - * // "Goat" - * // "Zebra" - *
                - */ - - }, - { - key: 'removeChild', - value: function removeChild(param) { - var ind = - 1; - if (typeof param === 'string') { - for (var i = 0; i < this.DOM.children.length; i++) { - if (this.DOM.children[i].tagName === param) { - ind = i; - break; - } - } - } else { - ind = param; - } - if (ind !== - 1) { - this.DOM.removeChild(this.DOM.children[ind]); - } - } /** - * Counts the specified element's number of attributes, returned as an Number. - * - * @method getAttributeCount - * @return {Integer} - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getAttributeCount()); - * } - * - * // Sketch prints: - * // 2 - *
                - */ - - }, - { - key: 'getAttributeCount', - value: function getAttributeCount() { - return this.DOM.attributes.length; - } /** - * Gets all of the specified element's attributes, and returns them as an - * array of Strings. - * - * @method listAttributes - * @return {String[]} an array of strings containing the names of attributes - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.listAttributes()); - * } - * - * // Sketch prints: - * // ["id", "species"] - *
                - */ - - }, - { - key: 'listAttributes', - value: function listAttributes() { - var arr = [ - ]; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = this.DOM.attributes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var attribute = _step2.value; - arr.push(attribute.nodeName); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return arr; - } /** - * Checks whether or not an element has the specified attribute. - * - * @method hasAttribute - * @param {String} the attribute to be checked - * @return {boolean} true if attribute found else false - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.hasAttribute('species')); - * print(firstChild.hasAttribute('color')); - * } - * - * // Sketch prints: - * // true - * // false - *
                - */ - - }, - { - key: 'hasAttribute', - value: function hasAttribute(name) { - var obj = { - }; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = this.DOM.attributes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var attribute = _step3.value; - obj[attribute.nodeName] = attribute.nodeValue; - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - return obj[name] ? true : false; - } /** - * Returns an attribute value of the element as an Number. If the defaultValue - * parameter is specified and the attribute doesn't exist, then defaultValue - * is returned. If no defaultValue is specified and the attribute doesn't - * exist, the value 0 is returned. - * - * @method getNum - * @param {String} name the non-null full name of the attribute - * @param {Number} [defaultValue] the default value of the attribute - * @return {Number} - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getNum('id')); - * } - * - * // Sketch prints: - * // 0 - *
                - */ - - }, - { - key: 'getNum', - value: function getNum(name, defaultValue) { - var obj = { - }; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for (var _iterator4 = this.DOM.attributes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var attribute = _step4.value; - obj[attribute.nodeName] = attribute.nodeValue; - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - return Number(obj[name]) || defaultValue || 0; - } /** - * Returns an attribute value of the element as an String. If the defaultValue - * parameter is specified and the attribute doesn't exist, then defaultValue - * is returned. If no defaultValue is specified and the attribute doesn't - * exist, null is returned. - * - * @method getString - * @param {String} name the non-null full name of the attribute - * @param {Number} [defaultValue] the default value of the attribute - * @return {String} - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getString('species')); - * } - * - * // Sketch prints: - * // "Capra hircus" - *
                - */ - - }, - { - key: 'getString', - value: function getString(name, defaultValue) { - var obj = { - }; - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - try { - for (var _iterator5 = this.DOM.attributes[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var attribute = _step5.value; - obj[attribute.nodeName] = attribute.nodeValue; - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return != null) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - return obj[name] ? String(obj[name]) : defaultValue || null; - } /** - * Sets the content of an element's attribute. The first parameter specifies - * the attribute name, while the second specifies the new content. - * - * @method setAttribute - * @param {String} name the full name of the attribute - * @param {Number|String|Boolean} value the value of the attribute - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getString('species')); - * firstChild.setAttribute('species', 'Jamides zebra'); - * print(firstChild.getString('species')); - * } - * - * // Sketch prints: - * // "Capra hircus" - * // "Jamides zebra" - *
                - */ - - }, - { - key: 'setAttribute', - value: function setAttribute(name, value) { - this.DOM.setAttribute(name, value); - } /** - * Returns the content of an element. If there is no such content, - * defaultValue is returned if specified, otherwise null is returned. - * - * @method getContent - * @param {String} [defaultValue] value returned if no content is found - * @return {String} - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getContent()); - * } - * - * // Sketch prints: - * // "Goat" - *
                - */ - - }, - { - key: 'getContent', - value: function getContent(defaultValue) { - var str; - str = this.DOM.textContent; - str = str.replace(/\s\s+/g, ','); - return str || defaultValue || null; - } /** - * Sets the element's content. - * - * @method setContent - * @param {String} text the new content - * @example - *
                - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getContent()); - * firstChild.setContent('Mountain Goat'); - * print(firstChild.getContent()); - * } - * - * // Sketch prints: - * // "Goat" - * // "Mountain Goat" - *
                - */ - - }, - { - key: 'setContent', - value: function setContent(content) { - if (!this.DOM.children.length) { - this.DOM.textContent = content; - } - } /** - * Serializes the element into a string. This function is useful for preparing - * the content to be sent over a http request or saved to file. - * - * @method serialize - * @return {String} Serialized string of the element - * @example - *
                - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.serialize()); - * } - * - * // Sketch prints: - * // - * // Goat - * // Leopard - * // Zebra - * // - *
                - */ - - }, - { - key: 'serialize', - value: function serialize() { - var xmlSerializer = new XMLSerializer(); - return xmlSerializer.serializeToString(this.DOM); - } - } - ]); - return _class; - }(); - function elementsToP5XML(elements) { - var arr = [ - ]; - for (var i = 0; i < elements.length; i++) { - arr.push(new _main.default.XML(elements[i])); - } - return arr; - } - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.number.constructor': 191, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 328: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Math - * @submodule Calculation - * @for p5 - * @requires core - */ - /** - * Calculates the absolute value of a number. A number's absolute value is its - * distance from zero on the number line. -5 and 5 are both five units away - * from zero, so calling `abs(-5)` and `abs(5)` both return 5. The absolute - * value of a number is always positive. - * - * @method abs - * @param {Number} n number to compute. - * @return {Number} absolute value of given number. - * @example - *
                - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let centerX = width / 2; - * let x = frameCount; - * let y = abs(x - centerX); - * point(x, y); - * - * describe('A series of black dots that form a "V" shape.'); - * } - * - *
                - */ - - _main.default.prototype.abs = Math.abs; - /** - * Calculates the closest integer value that is greater than or equal to the - * parameter's value. For example, calling `ceil(9.03)` returns the value - * 10. - * - * @method ceil - * @param {Number} n number to round up. - * @return {Integer} rounded up number. - * @example - *
                - * - * // Set the range for RGB values from 0 to 1. - * colorMode(RGB, 1); - * noStroke(); - * - * let r = 0.3; - * fill(r, 0, 0); - * rect(0, 0, width / 2, height); - * - * // Round r up to 1. - * r = ceil(r); - * fill(r, 0, 0); - * rect(width / 2, 0, width / 2, height); - * - * describe('Two rectangles. The one on the left is dark red and the one on the right is bright red.'); - * - *
                - */ - _main.default.prototype.ceil = Math.ceil; - /** - * Constrains a number between a minimum and maximum value. - * - * @method constrain - * @param {Number} n number to constrain. - * @param {Number} low minimum limit. - * @param {Number} high maximum limit. - * @return {Number} constrained number. - * @example - *
                - * - * function draw() { - * background(200); - * - * let x = constrain(mouseX, 33, 67); - * let y = 50; - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot drawn on a gray square follows the mouse from left to right. Its movement is constrained to the middle third of the square.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * // Set boundaries and draw them. - * let leftWall = width * 0.25; - * let rightWall = width * 0.75; - * line(leftWall, 0, leftWall, height); - * line(rightWall, 0, rightWall, height); - * - * // Draw a circle that follows the mouse freely. - * fill(255); - * circle(mouseX, height / 3, 9); - * - * // Draw a circle that's constrained. - * let xc = constrain(mouseX, leftWall, rightWall); - * fill(0); - * circle(xc, 2 * height / 3, 9); - * - * describe('Two vertical lines. Two circles move horizontally with the mouse. One circle stops at the vertical lines.'); - * } - * - *
                - */ - _main.default.prototype.constrain = function (n, low, high) { - _main.default._validateParameters('constrain', arguments); - return Math.max(Math.min(n, high), low); - }; - /** - * Calculates the distance between two points. - * - * The version of `dist()` with four parameters calculates distance in two - * dimensions. - * - * The version of `dist()` with six parameters calculates distance in three - * dimensions. - * - * Use p5.Vector.dist() to calculate the - * distance between two p5.Vector objects. - * - * @method dist - * @param {Number} x1 x-coordinate of the first point. - * @param {Number} y1 y-coordinate of the first point. - * @param {Number} x2 x-coordinate of the second point. - * @param {Number} y2 y-coordinate of the second point. - * @return {Number} distance between the two points. - * - * @example - *
                - * - * let x1 = 10; - * let y1 = 50; - * let x2 = 90; - * let y2 = 50; - * - * line(x1, y1, x2, y2); - * strokeWeight(5); - * point(x1, y1); - * point(x2, y2); - * - * let d = dist(x1, y1, x2, y2); - * text(d, 43, 40); - * - * describe('Two dots connected by a horizontal line. The number 80 is written above the center of the line.'); - * - *
                - */ - /** - * @method dist - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 z-coordinate of the first point. - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate of the second point. - * @return {Number} distance between the two points. - */ - _main.default.prototype.dist = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('dist', args); - if (args.length === 4) { - //2D - return Math.hypot(args[2] - args[0], args[3] - args[1]); - } else if (args.length === 6) { - //3D - return Math.hypot(args[3] - args[0], args[4] - args[1], args[5] - args[2]); - } - }; - /** - * Returns Euler's number e (2.71828...) raised to the power of the `n` - * parameter. - * - * @method exp - * @param {Number} n exponent to raise. - * @return {Number} e^n - * @example - *
                - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 0.005 * exp(x * 0.1); - * point(x, y); - * - * describe('A series of black dots that grow exponentially from left to right.'); - * } - * - *
                - */ - _main.default.prototype.exp = Math.exp; - /** - * Calculates the closest integer value that is less than or equal to the - * value of the `n` parameter. - * - * @method floor - * @param {Number} n number to round down. - * @return {Integer} rounded down number. - * @example - *
                - * - * // Set the range for RGB values from 0 to 1. - * colorMode(RGB, 1); - * noStroke(); - * - * let r = 0.8; - * fill(r, 0, 0); - * rect(0, 0, width / 2, height); - * - * // Round r down to 0. - * r = floor(r); - * fill(r, 0, 0); - * rect(width / 2, 0, width / 2, height); - * - * describe('Two rectangles. The one on the left is bright red and the one on the right is black.'); - * - *
                - */ - _main.default.prototype.floor = Math.floor; - /** - * Calculates a number between two numbers at a specific increment. The `amt` - * parameter is the amount to interpolate between the two numbers. 0.0 is - * equal to the first number, 0.1 is very near the first number, 0.5 is - * half-way in between, and 1.0 is equal to the second number. The `lerp()` - * function is convenient for creating motion along a straight path and for - * drawing dotted lines. - * - * If the value of `amt` is less than 0 or more than 1, `lerp()` will return a - * number outside of the original interval. For example, calling - * `lerp(0, 10, 1.5)` will return 15. - * - * @method lerp - * @param {Number} start first value. - * @param {Number} stop second value. - * @param {Number} amt number. - * @return {Number} lerped value. - * @example - *
                - * - * let a = 20; - * let b = 80; - * let c = lerp(a, b, 0.2); - * let d = lerp(a, b, 0.5); - * let e = lerp(a, b, 0.8); - * - * let y = 50; - * - * strokeWeight(5); - * - * // Draw the original points in black. - * stroke(0); - * point(a, y); - * point(b, y); - * - * // Draw the lerped points in gray. - * stroke(100); - * point(c, y); - * point(d, y); - * point(e, y); - * - * describe('Five points in a horizontal line. The outer points are black and the inner points are gray.'); - * - *
                - */ - _main.default.prototype.lerp = function (start, stop, amt) { - _main.default._validateParameters('lerp', arguments); - return amt * (stop - start) + start; - }; - /** - * Calculates the natural logarithm (the base-e logarithm) of a number. This - * function expects the `n` parameter to be a value greater than 0.0. - * - * @method log - * @param {Number} n number greater than 0. - * @return {Number} natural logarithm of n. - * @example - *
                - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 15 * log(x); - * point(x, y); - * - * describe('A series of black dots that get higher slowly from left to right.'); - * } - * - *
                - */ - _main.default.prototype.log = Math.log; - /** - * Calculates the magnitude, or length, of a vector. A vector is like an arrow - * pointing in space. Vectors are commonly used for programming motion. - * - * Vectors don't have a "start" position because the same arrow can be drawn - * anywhere. A vector's magnitude can be thought of as the distance from the - * origin (0, 0) to its tip at (x, y). `mag(x, y)` is a shortcut for calling - * `dist(0, 0, x, y)`. - * - * @method mag - * @param {Number} x first component. - * @param {Number} y second component. - * @return {Number} magnitude of vector from (0,0) to (x,y). - * @example - *
                - * - * let x = 30; - * let y = 40; - * let m = mag(x, y); - * - * line(0, 0, x, y); - * text(m, x, y); - * - * describe('A diagonal line is drawn from the top left of the canvas. The number 50 is written at the end of the line.'); - * - *
                - */ - _main.default.prototype.mag = function (x, y) { - _main.default._validateParameters('mag', arguments); - return Math.hypot(x, y); - }; - /** - * Re-maps a number from one range to another. - * - * For example, calling `map(2, 0, 10, 0, 100)` returns 20. The first three - * arguments set the original value to 2 and the original range from 0 to 10. - * The last two arguments set the target range from 0 to 100. 20's position - * in the target range [0, 100] is proportional to 2's position in the - * original range [0, 10]. - * - * @method map - * @param {Number} value the incoming value to be converted. - * @param {Number} start1 lower bound of the value's current range. - * @param {Number} stop1 upper bound of the value's current range. - * @param {Number} start2 lower bound of the value's target range. - * @param {Number} stop2 upper bound of the value's target range. - * @param {Boolean} [withinBounds] constrain the value to the newly mapped range. - * @return {Number} remapped number. - * @example - *
                - * - * let n = map(7, 0, 10, 0, 100); - * text(n, 50, 50); - * - * describe('The number 70 written in the middle of a gray square.'); - * - *
                - * - *
                - * - * let x = map(2, 0, 10, 0, width); - * circle(x, 50, 10); - * - * describe('A white circle drawn on the left side of a gray square.'); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let c = map(mouseX, 0, width, 0, 255); - * fill(c); - * circle(50, 50, 20); - * - * describe('A circle changes color from black to white as the mouse moves from left to right.'); - * } - * - *
                - */ - _main.default.prototype.map = function (n, start1, stop1, start2, stop2, withinBounds) { - _main.default._validateParameters('map', arguments); - var newval = (n - start1) / (stop1 - start1) * (stop2 - start2) + start2; - if (!withinBounds) { - return newval; - } - if (start2 < stop2) { - return this.constrain(newval, start2, stop2); - } else { - return this.constrain(newval, stop2, start2); - } - }; - /** - * Returns the largest value in a sequence of numbers. - * - * The version of `max()` with one parameter interprets it as an array of - * numbers and returns the largest number. - * - * The version of `max()` with two or more parameters interprets them as - * individual numbers and returns the largest number. - * - * @method max - * @param {Number} n0 first number to compare. - * @param {Number} n1 second number to compare. - * @return {Number} maximum number. - * @example - *
                - * - * let m = max(10, 20); - * text(m, 50, 50); - * - * describe('The number 20 written in the middle of a gray square.'); - * - *
                - * - *
                - * - * let m = max([10, 20]); - * text(m, 50, 50); - * - * describe('The number 20 written in the middle of a gray square.'); - * - *
                - * - *
                - * - * let numbers = [2, 1, 5, 4, 8, 9]; - * - * // Draw all of the numbers in the array. - * noStroke(); - * let spacing = 15; - * numbers.forEach((n, index) => { - * let x = index * spacing; - * let y = 25; - * text(n, x, y); - * }); - * - * // Draw the maximum value in the array. - * let m = max(numbers); - * let maxX = 33; - * let maxY = 80; - * - * textSize(32); - * text(m, maxX, maxY); - * - * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 9 is written in large text at the center of the square.'); - * - *
                - */ - /** - * @method max - * @param {Number[]} nums numbers to compare. - * @return {Number} - */ - _main.default.prototype.max = function () { - var findMax = function findMax(arr) { - var max = - Infinity; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var x = _step.value; - max = x > max ? x : max; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return max; - }; - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - if (args[0] instanceof Array) { - return findMax(args[0]); - } else { - return findMax(args); - } - }; - /** - * Returns the smallest value in a sequence of numbers. - * - * The version of `min()` with one parameter interprets it as an array of - * numbers and returns the smallest number. - * - * The version of `min()` with two or more parameters interprets them as - * individual numbers and returns the smallest number. - * - * @method min - * @param {Number} n0 first number to compare. - * @param {Number} n1 second number to compare. - * @return {Number} minimum number. - * @example - *
                - * - * let m = min(10, 20); - * text(m, 50, 50); - * - * describe('The number 10 written in the middle of a gray square.'); - * - *
                - * - *
                - * - * let m = min([10, 20]); - * text(m, 50, 50); - * - * describe('The number 10 written in the middle of a gray square.'); - * - *
                - * - *
                - * - * let numbers = [2, 1, 5, 4, 8, 9]; - * - * // Draw all of the numbers in the array. - * noStroke(); - * let spacing = 15; - * numbers.forEach((n, index) => { - * let x = index * spacing; - * let y = 25; - * text(n, x, y); - * }); - * - * // Draw the minimum value in the array. - * let m = min(numbers); - * let minX = 33; - * let minY = 80; - * - * textSize(32); - * text(m, minX, minY); - * - * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 1 is written in large text at the center of the square.'); - * - *
                - */ - /** - * @method min - * @param {Number[]} nums numbers to compare. - * @return {Number} - */ - _main.default.prototype.min = function () { - var findMin = function findMin(arr) { - var min = Infinity; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = arr[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var x = _step2.value; - min = x < min ? x : min; - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return min; - }; - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - if (args[0] instanceof Array) { - return findMin(args[0]); - } else { - return findMin(args); - } - }; - /** - * Maps a number from one range to a value between 0 and 1. - * - * For example, `norm(2, 0, 10)` returns 0.2. 2's position in the original - * range [0, 10] is proportional to 0.2's position in the range [0, 1]. This - * is equivalent to calling `map(2, 0, 10, 0, 1)`. - * - * Numbers outside of the original range are not constrained between 0 and 1. - * Out-of-range values are often intentional and useful. - * - * @method norm - * @param {Number} value incoming value to be normalized. - * @param {Number} start lower bound of the value's current range. - * @param {Number} stop upper bound of the value's current range. - * @return {Number} normalized number. - * @example - *
                - * - * function draw() { - * // Set the range for RGB values from 0 to 1. - * colorMode(RGB, 1); - * - * let r = norm(mouseX, 0, width); - * background(r, 0, 0); - * - * describe('A square changes color from black to red as the mouse moves from left to right.'); - * } - * - *
                - */ - _main.default.prototype.norm = function (n, start, stop) { - _main.default._validateParameters('norm', arguments); - return this.map(n, start, stop, 0, 1); - }; - /** - * Calculates exponential expressions such as 2^3. - * - * For example, `pow(2, 3)` is equivalent to the expression - * 2 × 2 × 2. `pow(2, -3)` is equivalent to 1 ÷ - * (2 × 2 × 2). - * - * @method pow - * @param {Number} n base of the exponential expression. - * @param {Number} e power by which to raise the base. - * @return {Number} n^e. - * @example - *
                - * - * let base = 3; - * - * let d = pow(base, 1); - * circle(10, 10, d); - * - * d = pow(base, 2); - * circle(20, 20, d); - * - * d = pow(base, 3); - * circle(40, 40, d); - * - * d = pow(base, 4); - * circle(80, 80, d); - * - * describe('A series of circles that grow exponentially from top left to bottom right.'); - * - *
                - */ - _main.default.prototype.pow = Math.pow; - /** - * Calculates the integer closest to the `n` parameter. For example, - * `round(133.8)` returns the value 134. - * - * @method round - * @param {Number} n number to round. - * @param {Number} [decimals] number of decimal places to round to, default is 0. - * @return {Integer} rounded number. - * @example - *
                - * - * let x = round(3.7); - * text(x, width / 2, height / 2); - * - * describe('The number 4 written in middle of canvas.'); - * - *
                - * - *
                - * - * let x = round(12.782383, 2); - * text(x, width / 2, height / 2); - * - * describe('The number 12.78 written in middle of canvas.'); - * - *
                - */ - _main.default.prototype.round = function (n, decimals) { - if (!decimals) { - return Math.round(n); - } - var multiplier = Math.pow(10, decimals); - return Math.round(n * multiplier) / multiplier; - }; - /** - * Squares a number, which means multiplying the number by itself. The value - * returned is always a positive number. - * - * For example, `sq(3)` evaluates 3 × 3 which is 9. `sq(-3)` evaluates - * -3 × -3 which is also 9. Multiplying two negative numbers produces - * a positive number. - * - * @method sq - * @param {Number} n number to square. - * @return {Number} squared number. - * @example - *
                - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 0.01 * sq(x); - * point(x, y); - * - * describe('A series of black dots that get higher quickly from left to right.'); - * } - * - *
                - */ - _main.default.prototype.sq = function (n) { - return n * n; - }; - /** - * Calculates the square root of a number. A number's square root can be - * multiplied by itself to produce the original number. - * - * For example, `sqrt(9)` returns 3 because 3 × 3 = 9. `sqrt()` always - * returns a positive value. `sqrt()` doesn't work with negative arguments - * such as `sqrt(-9)`. - * - * @method sqrt - * @param {Number} n non-negative number to square root. - * @return {Number} square root of number. - * @example - *
                - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 5 * sqrt(x); - * point(x, y); - * - * describe('A series of black dots that get higher slowly from left to right.'); - * } - * - *
                - */ - _main.default.prototype.sqrt = Math.sqrt; - /** - * Calculates the fractional part of a number. For example, - * `fract(12.34)` returns 0.34. - * - * @method fract - * @param {Number} n number whose fractional part will be found. - * @returns {Number} fractional part of n. - * @example - *
                - * - * let n = 56.78; - * text(n, 20, 33); - * let f = fract(n); - * text(f, 20, 66); - * - * describe('The number 56.78 written above the number 0.78.'); - * - *
                - */ - _main.default.prototype.fract = function (toConvert) { - _main.default._validateParameters('fract', arguments); - var sign = 0; - var num = Number(toConvert); - if (isNaN(num) || Math.abs(num) === Infinity) { - return num; - } else if (num < 0) { - num = - num; - sign = 1; - } - if (String(num).includes('.') && !String(num).includes('e')) { - var toFract = String(num); - toFract = Number('0' + toFract.slice(toFract.indexOf('.'))); - return Math.abs(sign - toFract); - } else if (num < 1) { - return Math.abs(sign - num); - } else { - return 0; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.math.hypot': 188, - 'core-js/modules/es.number.constructor': 191, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 329: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.slice'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [ - null - ]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - return _construct.apply(null, arguments); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } /** - * @module Math - * @submodule Vector - * @for p5 - * @requires core - */ - /** - * Creates a new p5.Vector object. A vector is like - * an arrow pointing in space. Vectors have both magnitude (length) - * and direction. Calling `createVector()` without arguments sets the new - * vector's components to 0. - * - * p5.Vector objects are often used to program - * motion because they simplify the math. For example, a moving ball has a - * position and a velocity. Position describes where the ball is in space. The - * ball's position vector extends from the origin to the ball's center. - * Velocity describes the ball's speed and the direction it's moving. If the - * ball is moving straight up, its velocity vector points straight up. Adding - * the ball's velocity vector to its position vector moves it, as in - * `pos.add(vel)`. Vector math relies on methods inside the - * p5.Vector class. - * - * @method createVector - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @return {p5.Vector} new p5.Vector object. - * @example - *
                - * - * let p1 = createVector(25, 25); - * let p2 = createVector(50, 50); - * let p3 = createVector(75, 75); - * - * strokeWeight(5); - * point(p1); - * point(p2); - * point(p3); - * - * describe('Three black dots form a diagonal line from top left to bottom right.'); - * - *
                - * - *
                - * - * let pos; - * let vel; - * - * function setup() { - * createCanvas(100, 100); - * pos = createVector(width / 2, height); - * vel = createVector(0, -1); - * } - * - * function draw() { - * background(200); - * - * pos.add(vel); - * - * if (pos.y < 0) { - * pos.y = height; - * } - * - * strokeWeight(5); - * point(pos); - * - * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); - * } - * - *
                - */ - - _main.default.prototype.createVector = function (x, y, z) { - if (this instanceof _main.default) { - return _construct(_main.default.Vector, [ - this._fromRadians.bind(this), - this._toRadians.bind(this) - ].concat(Array.prototype.slice.call(arguments))); - } else { - return new _main.default.Vector(x, y, z); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.to-string': 206 - } - ], - 330: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } ////////////////////////////////////////////////////////////// - // http://mrl.nyu.edu/~perlin/noise/ - // Adapting from PApplet.java - // which was adapted from toxi - // which was adapted from the german demo group farbrausch - // as used in their demo "art": http://www.farb-rausch.de/fr010src.zip - // someday we might consider using "improved noise" - // http://mrl.nyu.edu/~perlin/paper445.pdf - // See: https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/ - // blob/main/introduction/Noise1D/noise.js - /** - * @module Math - * @submodule Noise - * @for p5 - * @requires core - */ - - var PERLIN_YWRAPB = 4; - var PERLIN_YWRAP = 1 << PERLIN_YWRAPB; - var PERLIN_ZWRAPB = 8; - var PERLIN_ZWRAP = 1 << PERLIN_ZWRAPB; - var PERLIN_SIZE = 4095; - var perlin_octaves = 4; // default to medium smooth - var perlin_amp_falloff = 0.5; // 50% reduction/octave - var scaled_cosine = function scaled_cosine(i) { - return 0.5 * (1 - Math.cos(i * Math.PI)); - }; - var perlin; // will be initialized lazily by noise() or noiseSeed() - /** - * Returns random numbers that can be tuned to feel more organic. The values - * returned will always be between 0 and 1. - * - * Values returned by random() and - * randomGaussian() can change by large - * amounts between function calls. By contrast, values returned by `noise()` - * can be made "smooth". Calls to `noise()` with similar inputs will produce - * similar outputs. `noise()` is used to create textures, motion, shapes, - * terrains, and so on. Ken Perlin invented `noise()` while animating the - * original Tron film in the 1980s. - * - * `noise()` returns the same value for a given input while a sketch is - * running. It produces different results each time a sketch runs. The - * noiseSeed() function can be used to generate - * the same sequence of Perlin noise values each time a sketch runs. - * - * The character of the noise can be adjusted in two ways. The first way is to - * scale the inputs. `noise()` interprets inputs as coordinates. The sequence - * of noise values will be smoother when the input coordinates are closer. The - * second way is to use the noiseDetail() - * function. - * - * The version of `noise()` with one parameter computes noise values in one - * dimension. This dimension can be thought of as space, as in `noise(x)`, or - * time, as in `noise(t)`. - * - * The version of `noise()` with two parameters computes noise values in two - * dimensions. These dimensions can be thought of as space, as in - * `noise(x, y)`, or space and time, as in `noise(x, t)`. - * - * The version of `noise()` with three parameters computes noise values in - * three dimensions. These dimensions can be thought of as space, as in - * `noise(x, y, z)`, or space and time, as in `noise(x, y, t)`. - * - * @method noise - * @param {Number} x x-coordinate in noise space. - * @param {Number} [y] y-coordinate in noise space. - * @param {Number} [z] z-coordinate in noise space. - * @return {Number} Perlin noise value at specified coordinates. - * @example - *
                - * - * function draw() { - * background(200); - * - * let x = 100 * noise(0.005 * frameCount); - * let y = 100 * noise(0.005 * frameCount + 10000); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves randomly on a gray square.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let noiseLevel = 100; - * let noiseScale = 0.005; - * // Scale input coordinate. - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let x = noiseLevel * noise(nt); - * let y = noiseLevel * noise(nt + 10000); - * // Render. - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves randomly on a gray square.'); - * } - * - *
                - * - *
                - * - * function draw() { - * let noiseLevel = 100; - * let noiseScale = 0.02; - * // Scale input coordinate. - * let x = frameCount; - * let nx = noiseScale * x; - * // Compute noise value. - * let y = noiseLevel * noise(nx); - * // Render. - * line(x, 0, x, y); - * - * describe('A hilly terrain drawn in gray against a black sky.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let noiseLevel = 100; - * let noiseScale = 0.002; - * for (let x = 0; x < width; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let y = noiseLevel * noise(nx, nt); - * // Render. - * line(x, 0, x, y); - * } - * - * describe('A calm sea drawn in gray against a black sky.'); - * } - * - *
                - * - *
                - * - * let noiseLevel = 255; - * let noiseScale = 0.01; - * for (let y = 0; y < height; y += 1) { - * for (let x = 0; x < width; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let ny = noiseScale * y; - * // Compute noise value. - * let c = noiseLevel * noise(nx, ny); - * // Render. - * stroke(c); - * point(x, y); - * } - * } - * - * describe('A gray cloudy pattern.'); - * - *
                - * - *
                - * - * function draw() { - * let noiseLevel = 255; - * let noiseScale = 0.009; - * for (let y = 0; y < height; y += 1) { - * for (let x = 0; x < width; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let ny = noiseScale * y; - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let c = noiseLevel * noise(nx, ny, nt); - * // Render. - * stroke(c); - * point(x, y); - * } - * } - * - * describe('A gray cloudy pattern that changes.'); - * } - * - *
                - */ - _main.default.prototype.noise = function (x) { - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - if (perlin == null) { - perlin = new Array(PERLIN_SIZE + 1); - for (var i = 0; i < PERLIN_SIZE + 1; i++) { - perlin[i] = Math.random(); - } - } - if (x < 0) { - x = - x; - } - if (y < 0) { - y = - y; - } - if (z < 0) { - z = - z; - } - var xi = Math.floor(x), - yi = Math.floor(y), - zi = Math.floor(z); - var xf = x - xi; - var yf = y - yi; - var zf = z - zi; - var rxf, - ryf; - var r = 0; - var ampl = 0.5; - var n1, - n2, - n3; - for (var o = 0; o < perlin_octaves; o++) { - var of = xi + (yi << PERLIN_YWRAPB) + (zi << PERLIN_ZWRAPB); - rxf = scaled_cosine(xf); - ryf = scaled_cosine(yf); - n1 = perlin[of & PERLIN_SIZE]; - n1 += rxf * (perlin[of + 1 & PERLIN_SIZE] - n1); - n2 = perlin[of + PERLIN_YWRAP & PERLIN_SIZE]; - n2 += rxf * (perlin[of + PERLIN_YWRAP + 1 & PERLIN_SIZE] - n2); - n1 += ryf * (n2 - n1); - of += PERLIN_ZWRAP; - n2 = perlin[of & PERLIN_SIZE]; - n2 += rxf * (perlin[of + 1 & PERLIN_SIZE] - n2); - n3 = perlin[of + PERLIN_YWRAP & PERLIN_SIZE]; - n3 += rxf * (perlin[of + PERLIN_YWRAP + 1 & PERLIN_SIZE] - n3); - n2 += ryf * (n3 - n2); - n1 += scaled_cosine(zf) * (n2 - n1); - r += n1 * ampl; - ampl *= perlin_amp_falloff; - xi <<= 1; - xf *= 2; - yi <<= 1; - yf *= 2; - zi <<= 1; - zf *= 2; - if (xf >= 1) { - xi++; - xf--; - } - if (yf >= 1) { - yi++; - yf--; - } - if (zf >= 1) { - zi++; - zf--; - } - } - return r; - }; - /** - * Adjusts the character of the noise produced by the - * noise() function. - * - * Perlin noise values are created by adding layers of noise together. The - * noise layers, called octaves, are similar to harmonics in music. Lower - * octaves contribute more to the output signal. They define the overall - * intensity of the noise. Higher octaves create finer-grained details. - * - * By default, noise values are created by combining four octaves. Each higher - * octave contributes half as much (50% less) compared to its predecessor. - * `noiseDetail()` changes the number of octaves and the falloff amount. For - * example, calling `noiseDetail(6, 0.25)` ensures that - * noise() will use six octaves. Each higher octave - * will contribute 25% as much (75% less) compared to its predecessor. Falloff - * values between 0 and 1 are valid. However, falloff values greater than 0.5 - * might result in noise values greater than 1. - * - * @method noiseDetail - * @param {Number} lod number of octaves to be used by the noise. - * @param {Number} falloff falloff factor for each octave. - * @example - *
                - * - * let noiseLevel = 255; - * let noiseScale = 0.02; - * for (let y = 0; y < height; y += 1) { - * for (let x = 0; x < width / 2; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let ny = noiseScale * y; - * - * // Compute noise value. - * noiseDetail(6, 0.25); - * let c = noiseLevel * noise(nx, ny); - * // Render left side. - * stroke(c); - * point(x, y); - * - * // Compute noise value. - * noiseDetail(4, 0.5); - * c = noiseLevel * noise(nx, ny); - * // Render right side. - * stroke(c); - * point(x + width / 2, y); - * } - * } - * - * describe('Two gray cloudy patterns. The pattern on the right is cloudier than the pattern on the left.'); - * - *
                - */ - _main.default.prototype.noiseDetail = function (lod, falloff) { - if (lod > 0) { - perlin_octaves = lod; - } - if (falloff > 0) { - perlin_amp_falloff = falloff; - } - }; - /** - * Sets the seed value for noise(). By default, - * noise() produces different results each time - * a sketch is run. Calling `noiseSeed()` with a constant - * argument, such as `noiseSeed(99)`, makes noise() - * produce the same results each time a sketch is run. - * - * @method noiseSeed - * @param {Number} seed seed value. - * @example - *
                - * - * function setup() { - * noiseSeed(99); - * background(255); - * } - * - * function draw() { - * let noiseLevel = 100; - * let noiseScale = 0.005; - * // Scale input coordinate. - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let x = noiseLevel * noise(nt); - * // Render. - * line(x, 0, x, height); - * - * describe('A black rectangle that grows randomly, first to the right and then to the left.'); - * } - * - *
                - */ - _main.default.prototype.noiseSeed = function (seed) { - // Linear Congruential Generator - // Variant of a Lehman Generator - var lcg = function () { - // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes - // m is basically chosen to be large (as it is the max period) - // and for its relationships to a and c - var m = 4294967296; - // a - 1 should be divisible by m's prime factors - var a = 1664525; - // c and m should be co-prime - var c = 1013904223; - var seed, - z; - return { - setSeed: function setSeed(val) { - // pick a random seed if val is undefined or null - // the >>> 0 casts the seed to an unsigned 32-bit integer - z = seed = (val == null ? Math.random() * m : val) >>> 0; - }, - getSeed: function getSeed() { - return seed; - }, - rand: function rand() { - // define the recurrence relationship - z = (a * z + c) % m; - // return a float in [0, 1) - // if z = m then z / m = 0 therefore (z % m) / m < 1 always - return z / m; - } - }; - }(); - lcg.setSeed(seed); - perlin = new Array(PERLIN_SIZE + 1); - for (var i = 0; i < PERLIN_SIZE + 1; i++) { - perlin[i] = lcg.rand(); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298 - } - ], - 331: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.math.sign'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.number.is-finite'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.sub'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.math.sign'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.number.is-finite'); - _dereq_('core-js/modules/es.string.sub'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Math - * @submodule Vector - * @requires constants - */ - /// HELPERS FOR REMAINDER METHOD - - var calculateRemainder2D = function calculateRemainder2D(xComponent, yComponent) { - if (xComponent !== 0) { - this.x = this.x % xComponent; - } - if (yComponent !== 0) { - this.y = this.y % yComponent; - } - return this; - }; - var calculateRemainder3D = function calculateRemainder3D(xComponent, yComponent, zComponent) { - if (xComponent !== 0) { - this.x = this.x % xComponent; - } - if (yComponent !== 0) { - this.y = this.y % yComponent; - } - if (zComponent !== 0) { - this.z = this.z % zComponent; - } - return this; - }; - /** - * A class to describe a two or three-dimensional vector. A vector is like an - * arrow pointing in space. Vectors have both magnitude (length) and - * direction. - * - * `p5.Vector` objects are often used to program motion because they simplify - * the math. For example, a moving ball has a position and a velocity. - * Position describes where the ball is in space. The ball's position vector - * extends from the origin to the ball's center. Velocity describes the ball's - * speed and the direction it's moving. If the ball is moving straight up, its - * velocity vector points straight up. Adding the ball's velocity vector to - * its position vector moves it, as in `pos.add(vel)`. Vector math relies on - * methods inside the `p5.Vector` class. - * - * @class p5.Vector - * @constructor - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @example - *
                - * - * let p1 = createVector(25, 25); - * let p2 = createVector(75, 75); - * - * strokeWeight(5); - * point(p1); - * point(p2.x, p2.y); - * - * describe('Two black dots on a gray square, one at the top left and the other at the bottom right.'); - * - *
                - * - *
                - * - * let pos; - * let vel; - * - * function setup() { - * createCanvas(100, 100); - * pos = createVector(width / 2, height); - * vel = createVector(0, -1); - * } - * - * function draw() { - * background(200); - * - * pos.add(vel); - * - * if (pos.y < 0) { - * pos.y = height; - * } - * - * strokeWeight(5); - * point(pos); - * - * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); - * } - * - *
                - */ - _main.default.Vector = /*#__PURE__*/ function () { - // This is how it comes in with createVector() - // This check if the first argument is a function - function _class() { - _classCallCheck(this, _class); - var x, - y, - z; - if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'function') { - this.isPInst = true; - this._fromRadians = arguments.length <= 0 ? undefined : arguments[0]; - this._toRadians = arguments.length <= 1 ? undefined : arguments[1]; - x = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - y = (arguments.length <= 3 ? undefined : arguments[3]) || 0; - z = (arguments.length <= 4 ? undefined : arguments[4]) || 0; - // This is what we'll get with new p5.Vector() - } else { - x = (arguments.length <= 0 ? undefined : arguments[0]) || 0; - y = (arguments.length <= 1 ? undefined : arguments[1]) || 0; - z = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - } /** - * The x component of the vector - * @type {Number} - * @property x - * @name x - */ - - this.x = x; - /** - * The y component of the vector - * @type {Number} - * @property y - * @name y - */ - this.y = y; - /** - * The z component of the vector - * @type {Number} - * @property z - * @name z - */ - this.z = z; - } /** - * Returns a string representation of a vector. This method is useful for - * printing vectors to the console while debugging. - * @method toString - * @return {String} string representation of the vector. - * @example - *
                - * - * function setup() { - * let v = createVector(20, 30); - * // Prints 'p5.Vector Object : [20, 30, 0]'. - * print(v.toString()); - * } - * - *
                - */ - - _createClass(_class, [ - { - key: 'toString', - value: function toString() { - return 'p5.Vector Object : ['.concat(this.x, ', ').concat(this.y, ', ').concat(this.z, ']'); - } /** - * Sets the `x`, `y`, and `z` components of the vector using separate numbers, - * a p5.Vector object, or an array of numbers. - * Calling `set()` with no arguments sets the vector's components to 0. - * - * @method set - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @chainable - * @example - *
                - * - * strokeWeight(5); - * - * // Top left. - * let pos = createVector(25, 25); - * point(pos); - * - * // Top right. - * pos.set(75, 25); - * point(pos); - * - * // Bottom right. - * let p2 = createVector(75, 75); - * pos.set(p2); - * point(pos); - * - * // Bottom left. - * let arr = [25, 75]; - * pos.set(arr); - * point(pos); - * - * describe('Four black dots arranged in a square on a gray background.'); - * - *
                - */ - /** - * @method set - * @param {p5.Vector|Number[]} value vector to set. - * @chainable - */ - - }, - { - key: 'set', - value: function set(x, y, z) { - if (x instanceof _main.default.Vector) { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - return this; - } - if (Array.isArray(x)) { - this.x = x[0] || 0; - this.y = x[1] || 0; - this.z = x[2] || 0; - return this; - } - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - return this; - } /** - * Returns a copy of the p5.Vector object. - * - * @method copy - * @return {p5.Vector} copy of the p5.Vector object. - * @example - *
                - * - * let pos = createVector(50, 50); - * let pc = pos.copy(); - * - * strokeWeight(5); - * point(pc); - * - * describe('A black point drawn in the middle of a gray square.'); - * - *
                - */ - - }, - { - key: 'copy', - value: function copy() { - if (this.isPInst) { - return new _main.default.Vector(this._fromRadians, this._toRadians, this.x, this.y, this.z); - } else { - return new _main.default.Vector(this.x, this.y, this.z); - } - } /** - * Adds to a vector's `x`, `y`, and `z` components using separate numbers, - * another p5.Vector object, or an array of numbers. - * Calling `add()` with no arguments has no effect. - * - * The static version of `add()`, as in `p5.Vector.add(v2, v1)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method add - * @param {Number} x x component of the vector to be added. - * @param {Number} [y] y component of the vector to be added. - * @param {Number} [z] z component of the vector to be added. - * @chainable - * @example - *
                - * - * strokeWeight(5); - * - * // Top left. - * let pos = createVector(25, 25); - * point(pos); - * - * // Top right. - * pos.add(50, 0); - * point(pos); - * - * // Bottom right. - * let p2 = createVector(0, 50); - * pos.add(p2); - * point(pos); - * - * // Bottom left. - * let arr = [-50, 0]; - * pos.add(arr); - * point(pos); - * - * describe('Four black dots arranged in a square on a gray background.'); - * - *
                - * - *
                - * - * // Top left. - * let p1 = createVector(25, 25); - * - * // Center. - * let p2 = createVector(50, 50); - * - * // Bottom right. - * let p3 = p5.Vector.add(p1, p2); - * - * strokeWeight(5); - * point(p1); - * point(p2); - * point(p3); - * - * describe('Three black dots in a diagonal line from top left to bottom right.'); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = createVector(-30, 20); - * drawArrow(v1, v2, 'blue'); - * - * let v3 = p5.Vector.add(v1, v2); - * drawArrow(origin, v3, 'purple'); - * - * describe('Three arrows drawn on a gray square. A red arrow extends from the top left corner to the center. A blue arrow extends from the tip of the red arrow. A purple arrow extends from the origin to the tip of the blue arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - /** - * @method add - * @param {p5.Vector|Number[]} value The vector to add - * @chainable - */ - - }, - { - key: 'add', - value: function add(x, y, z) { - if (x instanceof _main.default.Vector) { - this.x += x.x || 0; - this.y += x.y || 0; - this.z += x.z || 0; - return this; - } - if (Array.isArray(x)) { - this.x += x[0] || 0; - this.y += x[1] || 0; - this.z += x[2] || 0; - return this; - } - this.x += x || 0; - this.y += y || 0; - this.z += z || 0; - return this; - } /** - * Performs modulo (remainder) division with a vector's `x`, `y`, and `z` - * components using separate numbers, another - * p5.Vector object, or an array of numbers. - * - * The static version of `rem()` as in `p5.Vector.rem(v2, v1)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method rem - * @param {Number} x x component of divisor vector. - * @param {Number} y y component of divisor vector. - * @param {Number} z z component of divisor vector. - * @chainable - * @example - *
                - * - * let v = createVector(3, 4, 5); - * v.rem(2, 3, 4); - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v.toString()); - * - *
                - * - *
                - * - * let v1 = createVector(3, 4, 5); - * let v2 = createVector(2, 3, 4); - * v1.rem(v2); - * - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v1.toString()); - * - *
                - * - *
                - * - * let v = createVector(3, 4, 5); - * let arr = [2, 3, 4]; - * v.rem(arr); - * - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v.toString()); - * - *
                - * - *
                - * - * let v1 = createVector(3, 4, 5); - * let v2 = createVector(2, 3, 4); - * let v3 = p5.Vector.rem(v1, v2); - * - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v3.toString()); - * - *
                - */ - /** - * @method rem - * @param {p5.Vector | Number[]} value divisor vector. - * @chainable - */ - - }, - { - key: 'rem', - value: function rem(x, y, z) { - if (x instanceof _main.default.Vector) { - if ([x.x, - x.y, - x.z].every(Number.isFinite)) { - var xComponent = parseFloat(x.x); - var yComponent = parseFloat(x.y); - var zComponent = parseFloat(x.z); - return calculateRemainder3D.call(this, xComponent, yComponent, zComponent); - } - } else if (Array.isArray(x)) { - if (x.every(function (element) { - return Number.isFinite(element); - })) { - if (x.length === 2) { - return calculateRemainder2D.call(this, x[0], x[1]); - } - if (x.length === 3) { - return calculateRemainder3D.call(this, x[0], x[1], x[2]); - } - } - } else if (arguments.length === 1) { - if (Number.isFinite(arguments[0]) && arguments[0] !== 0) { - this.x = this.x % arguments[0]; - this.y = this.y % arguments[0]; - this.z = this.z % arguments[0]; - return this; - } - } else if (arguments.length === 2) { - var vectorComponents = Array.prototype.slice.call(arguments); - if (vectorComponents.every(function (element) { - return Number.isFinite(element); - })) { - if (vectorComponents.length === 2) { - return calculateRemainder2D.call(this, vectorComponents[0], vectorComponents[1]); - } - } - } else if (arguments.length === 3) { - var _vectorComponents = Array.prototype.slice.call(arguments); - if (_vectorComponents.every(function (element) { - return Number.isFinite(element); - })) { - if (_vectorComponents.length === 3) { - return calculateRemainder3D.call(this, _vectorComponents[0], _vectorComponents[1], _vectorComponents[2]); - } - } - } - } /** - * Subtracts from a vector's `x`, `y`, and `z` components using separate - * numbers, another p5.Vector object, or an array of - * numbers. Calling `sub()` with no arguments has no effect. - * - * The static version of `sub()`, as in `p5.Vector.sub(v2, v1)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method sub - * @param {Number} x x component of the vector to subtract. - * @param {Number} [y] y component of the vector to subtract. - * @param {Number} [z] z component of the vector to subtract. - * @chainable - * @example - *
                - * - * strokeWeight(5); - * - * // Bottom right. - * let pos = createVector(75, 75); - * point(pos); - * - * // Top right. - * pos.sub(0, 50); - * point(pos); - * - * // Top left. - * let p2 = createVector(50, 0); - * pos.sub(p2); - * point(pos); - * - * // Bottom left. - * let arr = [0, -50]; - * pos.sub(arr); - * point(pos); - * - * describe('Four black dots arranged in a square on a gray background.'); - * - *
                - * - *
                - * - * // Bottom right. - * let p1 = createVector(75, 75); - * - * // Center. - * let p2 = createVector(50, 50); - * - * // Top left. - * let p3 = p5.Vector.sub(p1, p2); - * - * strokeWeight(5); - * point(p1); - * point(p2); - * point(p3); - * - * describe('Three black dots in a diagonal line from top left to bottom right.'); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = createVector(20, 70); - * drawArrow(origin, v2, 'blue'); - * - * let v3 = p5.Vector.sub(v2, v1); - * drawArrow(v1, v3, 'purple'); - * - * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - /** - * @method sub - * @param {p5.Vector|Number[]} value the vector to subtract - * @chainable - */ - - }, - { - key: 'sub', - value: function sub(x, y, z) { - if (x instanceof _main.default.Vector) { - this.x -= x.x || 0; - this.y -= x.y || 0; - this.z -= x.z || 0; - return this; - } - if (Array.isArray(x)) { - this.x -= x[0] || 0; - this.y -= x[1] || 0; - this.z -= x[2] || 0; - return this; - } - this.x -= x || 0; - this.y -= y || 0; - this.z -= z || 0; - return this; - } /** - * Multiplies a vector's `x`, `y`, and `z` components by the same number, - * separate numbers, the components of another - * p5.Vector object, or an array of numbers. Calling - * `mult()` with no arguments has no effect. - * - * The static version of `mult()`, as in `p5.Vector.mult(v, 2)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method mult - * @param {Number} n The number to multiply with the vector - * @chainable - * @example - *
                - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * p.mult(2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * p.mult(2, 3); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * let arr = [2, 3]; - * p.mult(arr); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * let p2 = createVector(2, 3); - * p.mult(p2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * let p2 = createVector(2, 3); - * let p3 = p5.Vector.mult(p, p2); - * point(p3); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(25, 25); - * drawArrow(origin, v1, 'red'); - * - * let v2 = p5.Vector.mult(v1, 2); - * drawArrow(origin, v2, 'blue'); - * - * describe('Two arrows extending from the top left corner. The blue arrow is twice the length of the red arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - /** - * @method mult - * @param {Number} x number to multiply with the x component of the vector. - * @param {Number} y number to multiply with the y component of the vector. - * @param {Number} [z] number to multiply with the z component of the vector. - * @chainable - */ - /** - * @method mult - * @param {Number[]} arr array to multiply with the components of the vector. - * @chainable - */ - /** - * @method mult - * @param {p5.Vector} v vector to multiply with the components of the original vector. - * @chainable - */ - - }, - { - key: 'mult', - value: function mult(x, y, z) { - if (x instanceof _main.default.Vector) { - // new p5.Vector will check that values are valid upon construction but it's possible - // that someone could change the value of a component after creation, which is why we still - // perform this check - if (Number.isFinite(x.x) && Number.isFinite(x.y) && Number.isFinite(x.z) && typeof x.x === 'number' && typeof x.y === 'number' && typeof x.z === 'number') { - this.x *= x.x; - this.y *= x.y; - this.z *= x.z; - } else { - console.warn('p5.Vector.prototype.mult:', 'x contains components that are either undefined or not finite numbers'); - } - return this; - } - if (Array.isArray(x)) { - if (x.every(function (element) { - return Number.isFinite(element); - }) && x.every(function (element) { - return typeof element === 'number'; - })) { - if (x.length === 1) { - this.x *= x[0]; - this.y *= x[0]; - this.z *= x[0]; - } else if (x.length === 2) { - this.x *= x[0]; - this.y *= x[1]; - } else if (x.length === 3) { - this.x *= x[0]; - this.y *= x[1]; - this.z *= x[2]; - } - } else { - console.warn('p5.Vector.prototype.mult:', 'x contains elements that are either undefined or not finite numbers'); - } - return this; - } - var vectorComponents = Array.prototype.slice.call(arguments); - if (vectorComponents.every(function (element) { - return Number.isFinite(element); - }) && vectorComponents.every(function (element) { - return typeof element === 'number'; - })) { - if (arguments.length === 1) { - this.x *= x; - this.y *= x; - this.z *= x; - } - if (arguments.length === 2) { - this.x *= x; - this.y *= y; - } - if (arguments.length === 3) { - this.x *= x; - this.y *= y; - this.z *= z; - } - } else { - console.warn('p5.Vector.prototype.mult:', 'x, y, or z arguments are either undefined or not a finite number'); - } - return this; - } /** - * Divides a vector's `x`, `y`, and `z` components by the same number, - * separate numbers, the components of another - * p5.Vector object, or an array of numbers. Calling - * `div()` with no arguments has no effect. - * - * The static version of `div()`, as in `p5.Vector.div(v, 2)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method div - * @param {number} n The number to divide the vector by - * @chainable - * @example - *
                - * - * strokeWeight(5); - * - * let p = createVector(50, 50); - * point(p); - * - * p.div(2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * p.div(2, 3); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * let arr = [2, 3]; - * p.div(arr); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * let p2 = createVector(2, 3); - * p.div(p2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * let p2 = createVector(2, 3); - * let p3 = p5.Vector.div(p, p2); - * point(p3); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = p5.Vector.div(v1, 2); - * drawArrow(origin, v2, 'blue'); - * - * describe('Two arrows extending from the top left corner. The blue arrow is half the length of the red arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - /** - * @method div - * @param {Number} x number to divide with the x component of the vector. - * @param {Number} y number to divide with the y component of the vector. - * @param {Number} [z] number to divide with the z component of the vector. - * @chainable - */ - /** - * @method div - * @param {Number[]} arr array to divide the components of the vector by. - * @chainable - */ - /** - * @method div - * @param {p5.Vector} v vector to divide the components of the original vector by. - * @chainable - */ - - }, - { - key: 'div', - value: function div(x, y, z) { - if (x instanceof _main.default.Vector) { - // new p5.Vector will check that values are valid upon construction but it's possible - // that someone could change the value of a component after creation, which is why we still - // perform this check - if (Number.isFinite(x.x) && Number.isFinite(x.y) && Number.isFinite(x.z) && typeof x.x === 'number' && typeof x.y === 'number' && typeof x.z === 'number') { - var isLikely2D = x.z === 0 && this.z === 0; - if (x.x === 0 || x.y === 0 || !isLikely2D && x.z === 0) { - console.warn('p5.Vector.prototype.div:', 'divide by 0'); - return this; - } - this.x /= x.x; - this.y /= x.y; - if (!isLikely2D) { - this.z /= x.z; - } - } else { - console.warn('p5.Vector.prototype.div:', 'x contains components that are either undefined or not finite numbers'); - } - return this; - } - if (Array.isArray(x)) { - if (x.every(function (element) { - return Number.isFinite(element); - }) && x.every(function (element) { - return typeof element === 'number'; - })) { - if (x.some(function (element) { - return element === 0; - })) { - console.warn('p5.Vector.prototype.div:', 'divide by 0'); - return this; - } - if (x.length === 1) { - this.x /= x[0]; - this.y /= x[0]; - this.z /= x[0]; - } else if (x.length === 2) { - this.x /= x[0]; - this.y /= x[1]; - } else if (x.length === 3) { - this.x /= x[0]; - this.y /= x[1]; - this.z /= x[2]; - } - } else { - console.warn('p5.Vector.prototype.div:', 'x contains components that are either undefined or not finite numbers'); - } - return this; - } - var vectorComponents = Array.prototype.slice.call(arguments); - if (vectorComponents.every(function (element) { - return Number.isFinite(element); - }) && vectorComponents.every(function (element) { - return typeof element === 'number'; - })) { - if (vectorComponents.some(function (element) { - return element === 0; - })) { - console.warn('p5.Vector.prototype.div:', 'divide by 0'); - return this; - } - if (arguments.length === 1) { - this.x /= x; - this.y /= x; - this.z /= x; - } - if (arguments.length === 2) { - this.x /= x; - this.y /= y; - } - if (arguments.length === 3) { - this.x /= x; - this.y /= y; - this.z /= z; - } - } else { - console.warn('p5.Vector.prototype.div:', 'x, y, or z arguments are either undefined or not a finite number'); - } - return this; - } /** - * Returns the magnitude (length) of the vector. - * - * @method mag - * @return {Number} magnitude of the vector. - * @example - *
                - * - * let p = createVector(30, 40); - * line(0, 0, p.x, p.y); - * - * let m = p.mag(); - * text(m, p.x, p.y); - * - * describe('A diagonal black line extends from the top left corner of a gray square. The number 50 is written at the end of the line.'); - * - *
                - */ - - }, - { - key: 'mag', - value: function mag() { - return Math.sqrt(this.magSq()); - } /** - * Returns the magnitude (length) of the vector squared. - * - * @method magSq - * @return {number} squared magnitude of the vector. - * @example - *
                - * - * let p = createVector(30, 40); - * line(0, 0, p.x, p.y); - * - * let m = p.magSq(); - * text(m, p.x, p.y); - * - * describe('A diagonal black line extends from the top left corner of a gray square. The number 2500 is written at the end of the line.'); - * - *
                - */ - - }, - { - key: 'magSq', - value: function magSq() { - var x = this.x; - var y = this.y; - var z = this.z; - return x * x + y * y + z * z; - } /** - * Returns the dot product of two vectors. The dot product is a number that - * describes the overlap between two vectors. Visually, the dot product can be - * thought of as the "shadow" one vector casts on another. The dot product's - * magnitude is largest when two vectors point in the same or opposite - * directions. Its magnitude is 0 when two vectors form a right angle. - * - * The version of `dot()` with one parameter interprets it as another - * p5.Vector object. - * - * The version of `dot()` with multiple parameters interprets them as the - * `x`, `y`, and `z` components of another vector. - * - * The static version of `dot()`, as in `p5.Vector.dot(v1, v2)`, is the same - * as calling `v1.dot(v2)`. - * - * @method dot - * @param {Number} x x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @return {Number} dot product. - * - * @example - *
                - * - * let v1 = createVector(3, 4); - * let v2 = createVector(3, 0); - * let dp = v1.dot(v2); - * // Prints "9" to the console. - * print(dp); - * - *
                - * - *
                - * - * let v1 = createVector(1, 0); - * let v2 = createVector(0, 1); - * let dp = p5.Vector.dot(v1, v2); - * // Prints "0" to the console. - * print(dp); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let v0 = createVector(width / 2, height / 2); - * let v1 = createVector(30, 0); - * drawArrow(v0, v1, 'black'); - * - * let v2 = createVector(mouseX - width / 2, mouseY - height / 2); - * drawArrow(v0, v2, 'red'); - * - * let dp = v2.dot(v1); - * text(`v2 • v1 = ${dp}`, 15, 20); - * - * describe('Two arrows drawn on a gray square. A black arrow points to the right and a red arrow follows the mouse. The text "v1 • v2 = something" changes as the mouse moves.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - /** - * @method dot - * @param {p5.Vector} v p5.Vector to be dotted. - * @return {Number} - */ - - }, - { - key: 'dot', - value: function dot(x, y, z) { - if (x instanceof _main.default.Vector) { - return this.dot(x.x, x.y, x.z); - } - return this.x * (x || 0) + this.y * (y || 0) + this.z * (z || 0); - } /** - * Returns the cross product of two vectors. The cross product is a vector - * that points straight out of the plane created by two vectors. The cross - * product's magnitude is the area of the parallelogram formed by the original - * two vectors. - * - * The static version of `cross()`, as in `p5.Vector.cross(v1, v2)`, is the same - * as calling `v1.cross(v2)`. - * - * @method cross - * @param {p5.Vector} v p5.Vector to be crossed. - * @return {p5.Vector} cross product as a p5.Vector. - * @example - *
                - * - * let v1 = createVector(1, 0); - * let v2 = createVector(3, 4); - * let cp = v1.cross(v2); - * // Prints "p5.Vector Object : [0, 0, 4]" to the console. - * print(cp.toString()); - * - *
                - * - *
                - * - * let v1 = createVector(1, 0); - * let v2 = createVector(3, 4); - * let cp = p5.Vector.cross(v1, v2); - * // Prints "p5.Vector Object : [0, 0, 4]" to the console. - * print(cp.toString()); - * - *
                - */ - - }, - { - key: 'cross', - value: function cross(v) { - var x = this.y * v.z - this.z * v.y; - var y = this.z * v.x - this.x * v.z; - var z = this.x * v.y - this.y * v.x; - if (this.isPInst) { - return new _main.default.Vector(this._fromRadians, this._toRadians, x, y, z); - } else { - return new _main.default.Vector(x, y, z); - } - } /** - * Returns the distance between two points represented by vectors. A point's - * coordinates can be thought of as a vector's components. - * - * The static version of `dist()`, as in `p5.Vector.dist(v1, v2)`, is the same - * as calling `v1.dist(v2)`. - * - * Use dist() to calculate the distance between points - * using coordinates as in `dist(x1, y1, x2, y2)`. - * - * @method dist - * @param {p5.Vector} v x, y, and z coordinates of a p5.Vector. - * @return {Number} distance. - * @example - *
                - * - * let v1 = createVector(1, 0); - * let v2 = createVector(0, 1); - * let d = v1.dist(v2); - * // Prints "1.414..." to the console. - * print(d); - * - *
                - * - *
                - * - * let v1 = createVector(1, 0); - * let v2 = createVector(0, 1); - * let d = p5.Vector.dist(v1, v2); - * // Prints "1.414..." to the console. - * print(d); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = createVector(20, 70); - * drawArrow(origin, v2, 'blue'); - * - * let v3 = p5.Vector.sub(v2, v1); - * drawArrow(v1, v3, 'purple'); - * - * let m = floor(v3.mag()); - * text(m, 50, 75); - * - * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow. The number 36 is written in black near the purple arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'dist', - value: function dist(v) { - return v.copy().sub(this).mag(); - } /** - * Scales the components of a p5.Vector object so - * that its magnitude is 1. - * - * The static version of `normalize()`, as in `p5.Vector.normalize(v)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method normalize - * @return {p5.Vector} normalized p5.Vector. - * @example - *
                - * - * let v = createVector(10, 20, 2); - * v.normalize(); - * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * let v0 = createVector(10, 20, 2); - * let v1 = p5.Vector.normalize(v0); - * // Prints "p5.Vector Object : [10, 20, 2]" to the console. - * print(v0.toString()); - * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. - * print(v1.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(240); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(mouseX - 50, mouseY - 50); - * - * let r = 25; - * drawArrow(v0, v1, 'red'); - * v1.normalize(); - * drawArrow(v0, v1.mult(r), 'blue'); - * - * noFill(); - * circle(50, 50, r * 2); - * - * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow's length is fixed to the circle's radius."); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'normalize', - value: function normalize() { - var len = this.mag(); - // here we multiply by the reciprocal instead of calling 'div()' - // since div duplicates this zero check. - if (len !== 0) this.mult(1 / len); - return this; - } /** - * Limits a vector's magnitude to a maximum value. - * - * The static version of `limit()`, as in `p5.Vector.limit(v, 5)`, returns a - * new p5.Vector object and doesn't change the - * original. - * - * @method limit - * @param {Number} max maximum magnitude for the vector. - * @chainable - * @example - *
                - * - * let v = createVector(10, 20, 2); - * v.limit(5); - * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * let v0 = createVector(10, 20, 2); - * let v1 = p5.Vector.limit(v0, 5); - * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. - * print(v1.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(240); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(mouseX - 50, mouseY - 50); - * - * let r = 25; - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v1.limit(r), 'blue'); - * - * noFill(); - * circle(50, 50, r * 2); - * - * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow never crosses the circle's edge."); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'limit', - value: function limit(max) { - var mSq = this.magSq(); - if (mSq > max * max) { - this.div(Math.sqrt(mSq)) //normalize it - .mult(max); - } - return this; - } /** - * Sets a vector's magnitude to a given value. - * - * The static version of `setMag()`, as in `p5.Vector.setMag(v, 10)`, returns - * a new p5.Vector object and doesn't change the - * original. - * - * @method setMag - * @param {number} len new length for this vector. - * @chainable - * @example - *
                - * - * let v = createVector(3, 4, 0); - * // Prints "5" to the console. - * print(v.mag()); - * - * v.setMag(10); - * // Prints "p5.Vector Object : [6, 8, 0]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * let v0 = createVector(3, 4, 0); - * let v1 = p5.Vector.setMag(v0, 10); - * // Prints "5" to the console. - * print(v0.mag()); - * // Prints "p5.Vector Object : [6, 8, 0]" to the console. - * print(v1.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(240); - * - * let origin = createVector(0, 0); - * let v = createVector(50, 50); - * - * drawArrow(origin, v, 'red'); - * - * v.setMag(30); - * drawArrow(origin, v, 'blue'); - * - * describe('Two arrows extend from the top left corner of a square toward its center. The red arrow reaches the center and the blue arrow only extends part of the way.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'setMag', - value: function setMag(n) { - return this.normalize().mult(n); - } /** - * Calculates the angle a 2D vector makes with the positive x-axis. Angles - * increase in the clockwise direction. - * - * If the vector was created with - * createVector(), `heading()` returns angles - * in the units of the current angleMode(). - * - * The static version of `heading()`, as in `p5.Vector.heading(v)`, works the - * same way. - * - * @method heading - * @return {Number} angle of rotation. - * @example - *
                - * - * let v = createVector(1, 1); - * // Prints "0.785..." to the console. - * print(v.heading()); - * - * angleMode(DEGREES); - * // Prints "45" to the console. - * print(v.heading()); - * - *
                - * - *
                - * - * let v = createVector(1, 1); - * // Prints "0.785..." to the console. - * print(p5.Vector.heading(v)); - * - * angleMode(DEGREES); - * // Prints "45" to the console. - * print(p5.Vector.heading(v)); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v = createVector(50, 50); - * - * drawArrow(origin, v, 'black'); - * - * angleMode(RADIANS); - * let h = round(v.heading(), 2); - * text(`Radians: ${h}`, 20, 70); - * angleMode(DEGREES); - * h = v.heading(); - * text(`Degrees: ${h}`, 20, 85); - * - * describe('A black arrow extends from the top left of a square to its center. The text "Radians: 0.79" and "Degrees: 45" is written near the tip of the arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'heading', - value: function heading() { - var h = Math.atan2(this.y, this.x); - if (this.isPInst) return this._fromRadians(h); - return h; - } /** - * Rotates a 2D vector to a specific angle without changing its magnitude. - * By convention, the positive x-axis has an angle of 0. Angles increase in - * the clockwise direction. - * - * If the vector was created with - * createVector(), `setHeading()` uses - * the units of the current angleMode(). - * - * @method setHeading - * @param {number} angle angle of rotation. - * @chainable - * @example - *
                - * - * let v = createVector(0, 1); - * // Prints "1.570..." to the console. - * print(v.heading()); - * - * v.setHeading(PI); - * // Prints "3.141..." to the console. - * print(v.heading()); - * - *
                - * - *
                - * - * angleMode(DEGREES); - * let v = createVector(0, 1); - * // Prints "90" to the console. - * print(v.heading()); - * - * v.setHeading(180); - * // Prints "180" to the console. - * print(v.heading()); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 0); - * - * drawArrow(v0, v1, 'red'); - * - * v1.setHeading(HALF_PI); - * drawArrow(v0, v1, 'blue'); - * - * describe('Two arrows extend from the center of a gray square. The red arrow points to the right and the blue arrow points down.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'setHeading', - value: function setHeading(a) { - if (this.isPInst) a = this._toRadians(a); - var m = this.mag(); - this.x = m * Math.cos(a); - this.y = m * Math.sin(a); - return this; - } /** - * Rotates a 2D vector by an angle without changing its magnitude. - * By convention, the positive x-axis has an angle of 0. Angles increase in - * the clockwise direction. - * - * If the vector was created with - * createVector(), `rotate()` uses - * the units of the current angleMode(). - * - * The static version of `rotate()`, as in `p5.Vector.rotate(v, PI)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method rotate - * @param {number} angle angle of rotation. - * @chainable - * @example - *
                - * - * let v = createVector(1, 0); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v.toString()); - * v.rotate(HALF_PI); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * angleMode(DEGREES); - * let v = createVector(1, 0); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v.toString()); - * v.rotate(90); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * let v0 = createVector(1, 0); - * let v1 = p5.Vector.rotate(v0, HALF_PI); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v0.toString()); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v1.toString()); - * - *
                - * - *
                - * - * angleMode(DEGREES); - * let v0 = createVector(1, 0); - * let v1 = p5.Vector.rotate(v0, 90); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v0.toString()); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v1.toString()); - * - *
                - * - *
                - * - * let v0; - * let v1; - * - * function setup() { - * v0 = createVector(50, 50); - * v1 = createVector(30, 0); - * } - * - * function draw() { - * background(240); - * - * v1.rotate(0.01); - * - * drawArrow(v0, v1, 'black'); - * - * describe('A black arrow extends from the center of a gray square. The arrow rotates counterclockwise.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'rotate', - value: function rotate(a) { - var newHeading = this.heading() + a; - if (this.isPInst) newHeading = this._toRadians(newHeading); - var mag = this.mag(); - this.x = Math.cos(newHeading) * mag; - this.y = Math.sin(newHeading) * mag; - return this; - } /** - * Returns the angle between two vectors. The angles returned are signed, - * which means that `v1.angleBetween(v2) === -v2.angleBetween(v1)`. - * - * If the vector was created with - * createVector(), `angleBetween()` returns - * angles in the units of the current - * angleMode(). - * - * @method angleBetween - * @param {p5.Vector} value x, y, and z components of a p5.Vector. - * @return {Number} angle between the vectors. - * @example - *
                - * - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "1.570..." to the console. - * print(v0.angleBetween(v1)); - * // Prints "-1.570..." to the console. - * print(v1.angleBetween(v0)); - * - *
                - * - *
                - * - * angleMode(DEGREES); - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "90" to the console. - * print(v0.angleBetween(v1)); - * // Prints "-90" to the console. - * print(v1.angleBetween(v0)); - * - *
                - * - *
                - * - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "1.570..." to the console. - * print(p5.Vector.angleBetween(v0, v1)); - * // Prints "-1.570..." to the console. - * print(p5.Vector.angleBetween(v1, v0)); - * - *
                - * - *
                - * - * angleMode(DEGREES); - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "90" to the console. - * print(p5.Vector.angleBetween(v0, v1)); - * // Prints "-90" to the console. - * print(p5.Vector.angleBetween(v1, v0)); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 0); - * let v2 = createVector(0, 30); - * - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * - * angleMode(RADIANS); - * let angle = round(v1.angleBetween(v2), 2); - * text(`Radians: ${angle}`, 20, 20); - * angleMode(DEGREES); - * angle = round(v1.angleBetween(v2), 2); - * text(`Degrees: ${angle}`, 20, 35); - * - * describe('Two arrows extend from the center of a gray square. A red arrow points to the right and a blue arrow points down. The text "Radians: 1.57" and "Degrees: 90" is written above the arrows.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'angleBetween', - value: function angleBetween(v) { - var magSqMult = this.magSq() * v.magSq(); - // Returns NaN if either vector is the zero vector. - if (magSqMult === 0) { - return NaN; - } - var u = this.cross(v); - // The dot product computes the cos value, and the cross product computes - // the sin value. Find the angle based on them. In addition, in the case of - // 2D vectors, a sign is added according to the direction of the vector. - var angle = Math.atan2(u.mag(), this.dot(v)) * Math.sign(u.z || 1); - if (this.isPInst) { - angle = this._fromRadians(angle); - } - return angle; - } /** - * Calculates new `x`, `y`, and `z` components that are proportionally the - * same distance between two vectors. The `amt` parameter is the amount to - * interpolate between the old vector and the new vector. 0.0 keeps all - * components equal to the old vector's, 0.5 is halfway between, and 1.0 sets - * all components equal to the new vector's. - * - * The static version of `lerp()`, as in `p5.Vector.lerp(v0, v1, 0.5)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method lerp - * @param {Number} x x component. - * @param {Number} y y component. - * @param {Number} z z component. - * @param {Number} amt amount of interpolation between 0.0 (old vector) - * and 1.0 (new vector). 0.5 is halfway between. - * @chainable - * - * @example - *
                - * - * let v0 = createVector(1, 1, 1); - * let v1 = createVector(3, 3, 3); - * v0.lerp(v1, 0.5); - * // Prints "p5.Vector Object : [2, 2, 2]" to the console. - * print(v0.toString()); - * - *
                - * - *
                - * - * let v = createVector(1, 1, 1); - * v.lerp(3, 3, 3, 0.5); - * // Prints "p5.Vector Object : [2, 2, 2]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * let v0 = createVector(1, 1, 1); - * let v1 = createVector(3, 3, 3); - * let v2 = p5.Vector.lerp(v0, v1, 0.5); - * // Prints "p5.Vector Object : [2, 2, 2]" to the console. - * print(v2.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 0); - * let v2 = createVector(0, 30); - * let v3 = p5.Vector.lerp(v1, v2, 0.5); - * - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * drawArrow(v0, v3, 'purple'); - * - * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points down, and a purple arrow points to the bottom right.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - /** - * @method lerp - * @param {p5.Vector} v p5.Vector to lerp toward. - * @param {Number} amt - * @chainable - */ - - }, - { - key: 'lerp', - value: function lerp(x, y, z, amt) { - if (x instanceof _main.default.Vector) { - return this.lerp(x.x, x.y, x.z, y); - } - this.x += (x - this.x) * amt || 0; - this.y += (y - this.y) * amt || 0; - this.z += (z - this.z) * amt || 0; - return this; - } /** - * Calculates a new heading and magnitude that are between two vectors. The - * `amt` parameter is the amount to interpolate between the old vector and - * the new vector. 0.0 keeps the heading and magnitude equal to the old - * vector's, 0.5 sets them halfway between, and 1.0 sets the heading and - * magnitude equal to the new vector's. - * - * `slerp()` differs from lerp() because - * it interpolates magnitude. Calling `v0.slerp(v1, 0.5)` sets `v0`'s - * magnitude to a value halfway between its original magnitude and `v1`'s. - * Calling `v0.lerp(v1, 0.5)` makes no such guarantee. - * - * The static version of `slerp()`, as in `p5.Vector.slerp(v0, v1, 0.5)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method slerp - * @param {p5.Vector} v p5.Vector to slerp toward. - * @param {Number} amt amount of interpolation between 0.0 (old vector) - * and 1.0 (new vector). 0.5 is halfway between. - * @return {p5.Vector} - * - * @example - *
                - * - * let v0 = createVector(3, 0); - * // Prints "3" to the console. - * print(v0.mag()); - * // Prints "0" to the console. - * print(v0.heading()); - * - * let v1 = createVector(0, 1); - * // Prints "1" to the console. - * print(v1.mag()); - * // Prints "1.570..." to the console. - * print(v1.heading()); - * - * v0.slerp(v1, 0.5); - * // Prints "2" to the console. - * print(v0.mag()); - * // Prints "0.785..." to the console. - * print(v0.heading()); - * - *
                - * - *
                - * - * let v0 = createVector(3, 0); - * // Prints "3" to the console. - * print(v0.mag()); - * // Prints "0" to the console. - * print(v0.heading()); - * - * let v1 = createVector(0, 1); - * // Prints "1" to the console. - * print(v1.mag()); - * // Prints "1.570..." to the console. - * print(v1.heading()); - * - * let v3 = p5.Vector.slerp(v0, v1, 0.5); - * // Prints "2" to the console. - * print(v3.mag()); - * // Prints "0.785..." to the console. - * print(v3.heading()); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(20, 0); - * let v2 = createVector(-40, 0); - * let v3 = p5.Vector.slerp(v1, v2, 0.5); - * - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * drawArrow(v0, v3, 'purple'); - * - * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points to the left, and a purple arrow points down.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'slerp', - value: function slerp(v, amt) { - // edge cases. - if (amt === 0) { - return this; - } - if (amt === 1) { - return this.set(v); - } // calculate magnitudes - - var selfMag = this.mag(); - var vMag = v.mag(); - var magmag = selfMag * vMag; - // if either is a zero vector, linearly interpolate by these vectors - if (magmag === 0) { - this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); - return this; - } // the cross product of 'this' and 'v' is the axis of rotation - - var axis = this.cross(v); - var axisMag = axis.mag(); - // Calculates the angle between 'this' and 'v' - var theta = Math.atan2(axisMag, this.dot(v)); - // However, if the norm of axis is 0, normalization cannot be performed, - // so we will divide the cases - if (axisMag > 0) { - axis.x /= axisMag; - axis.y /= axisMag; - axis.z /= axisMag; - } else if (theta < Math.PI * 0.5) { - // if the norm is 0 and the angle is less than PI/2, - // the angle is very close to 0, so do linear interpolation. - this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); - return this; - } else { - // If the norm is 0 and the angle is more than PI/2, the angle is - // very close to PI. - // In this case v can be regarded as '-this', so take any vector - // that is orthogonal to 'this' and use that as the axis. - if (this.z === 0 && v.z === 0) { - // if both this and v are 2D vectors, use (0,0,1) - // this makes the result also a 2D vector. - axis.set(0, 0, 1); - } else if (this.x !== 0) { - // if the x components is not 0, use (y, -x, 0) - axis.set(this.y, - this.x, 0).normalize(); - } else { - // if the x components is 0, use (1,0,0) - axis.set(1, 0, 0); - } - } // Since 'axis' is a unit vector, ey is a vector of the same length as 'this'. - - var ey = axis.cross(this); - // interpolate the length with 'this' and 'v'. - var lerpedMagFactor = 1 - amt + amt * vMag / selfMag; - // imagine a situation where 'axis', 'this', and 'ey' are pointing - // along the z, x, and y axes, respectively. - // rotates 'this' around 'axis' by amt * theta towards 'ey'. - var cosMultiplier = lerpedMagFactor * Math.cos(amt * theta); - var sinMultiplier = lerpedMagFactor * Math.sin(amt * theta); - // then, calculate 'result'. - this.x = this.x * cosMultiplier + ey.x * sinMultiplier; - this.y = this.y * cosMultiplier + ey.y * sinMultiplier; - this.z = this.z * cosMultiplier + ey.z * sinMultiplier; - return this; - } /** - * Reflects a vector about a line in 2D or a plane in 3D. The orientation of - * the line or plane is described by a normal vector that points away from the - * shape. - * - * The static version of `reflect()`, as in `p5.Vector.reflect(v, n)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method reflect - * @param {p5.Vector} surfaceNormal p5.Vector - * to reflect about. - * @chainable - * @example - *
                - * - * let n = createVector(0, 1); - * let v = createVector(4, 6); - * v.reflect(n); - * // Prints "p5.Vector Object : [4, -6, 0]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * let n = createVector(0, 1); - * let v0 = createVector(4, 6); - * let v1 = p5.Vector.reflect(v0, n); - * // Prints "p5.Vector Object : [4, -6, 0]" to the console. - * print(v1.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * line(50, 0, 50, 100); - * let n = createVector(1, 0); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 40); - * let v2 = p5.Vector.reflect(v1, n); - * - * n.setMag(30); - * drawArrow(v0, n, 'black'); - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * - * describe('Three arrows extend from the center of a gray square with a vertical line down its middle. A black arrow points to the right, a blue arrow points to the bottom left, and a red arrow points to the bottom right.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'reflect', - value: function reflect(surfaceNormal) { - surfaceNormal.normalize(); - return this.sub(surfaceNormal.mult(2 * this.dot(surfaceNormal))); - } /** - * Returns the vector's components as an array of numbers. - * - * @method array - * @return {Number[]} array with the vector's components. - * @example - *
                - * - * let v = createVector(20, 30); - * // Prints "[20, 30, 0]" to the console. - * print(v.array()); - * - *
                - */ - - }, - { - key: 'array', - value: function array() { - return [this.x || 0, - this.y || 0, - this.z || 0]; - } /** - * Returns `true` if the vector's components are all the same as another - * vector's and `false` if not. - * - * The version of `equals()` with one parameter interprets it as another - * p5.Vector object. - * - * The version of `equals()` with multiple parameters interprets them as the - * components of another vector. Any missing parameters are assigned the value - * 0. - * - * The static version of `equals()`, as in `p5.Vector.equals(v0, v1)`, - * interprets both parameters as p5.Vector objects. - * - * @method equals - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @return {Boolean} whether the vectors are equal. - * @example - *
                - * - * let v0 = createVector(10, 20, 30); - * let v1 = createVector(10, 20, 30); - * let v2 = createVector(0, 0, 0); - * - * // Prints "true" to the console. - * print(v0.equals(v1)); - * // Prints "false" to the console. - * print(v0.equals(v2)); - * - *
                - * - *
                - * - * let v0 = createVector(5, 10, 20); - * let v1 = createVector(5, 10, 20); - * let v2 = createVector(13, 10, 19); - * - * // Prints "true" to the console. - * print(v0.equals(v1.x, v1.y, v1.z)); - * // Prints "false" to the console. - * print(v0.equals(v2.x, v2.y, v2.z)); - * - *
                - * - *
                - * - * let v0 = createVector(10, 20, 30); - * let v1 = createVector(10, 20, 30); - * let v2 = createVector(0, 0, 0); - * - * // Prints "true" to the console. - * print(p5.Vector.equals(v0, v1)); - * // Prints "false" to the console. - * print(p5.Vector.equals(v0, v2)); - * - *
                - */ - /** - * @method equals - * @param {p5.Vector|Array} value vector to compare. - * @return {Boolean} - */ - - }, - { - key: 'equals', - value: function equals(x, y, z) { - var a, - b, - c; - if (x instanceof _main.default.Vector) { - a = x.x || 0; - b = x.y || 0; - c = x.z || 0; - } else if (Array.isArray(x)) { - a = x[0] || 0; - b = x[1] || 0; - c = x[2] || 0; - } else { - a = x || 0; - b = y || 0; - c = z || 0; - } - return this.x === a && this.y === b && this.z === c; - } // Static Methods - /** - * Make a new 2D vector from an angle. - * - * @method fromAngle - * @static - * @param {Number} angle desired angle, in radians. Unaffected by angleMode(). - * @param {Number} [length] length of the new vector (defaults to 1). - * @return {p5.Vector} new p5.Vector object. - * @example - *
                - * - * let v = p5.Vector.fromAngle(0); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = p5.Vector.fromAngle(0, 30); - * - * drawArrow(v0, v1, 'black'); - * - * describe('A black arrow extends from the center of a gray square. It points to the right.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - } - ], [ - { - key: 'fromAngle', - value: function fromAngle(angle, length) { - if (typeof length === 'undefined') { - length = 1; - } - return new _main.default.Vector(length * Math.cos(angle), length * Math.sin(angle), 0); - } /** - * Make a new 3D vector from a pair of ISO spherical angles. - * - * @method fromAngles - * @static - * @param {Number} theta polar angle in radians (zero is up). - * @param {Number} phi azimuthal angle in radians - * (zero is out of the screen). - * @param {Number} [length] length of the new vector (defaults to 1). - * @return {p5.Vector} new p5.Vector object. - * @example - *
                - * - * let v = p5.Vector.fromAngles(0, 0); - * // Prints "p5.Vector Object : [0, -1, 0]" to the console. - * print(v.toString()); - * - *
                - * - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(0); - * - * fill(255); - * noStroke(); - * - * let theta = frameCount * 0.05; - * let phi = 0; - * let v = p5.Vector.fromAngles(theta, phi, 100); - * let c = color('deeppink'); - * pointLight(c, v); - * - * sphere(35); - * - * describe('A light shines on a pink sphere as it orbits.'); - * } - * - *
                - */ - - }, - { - key: 'fromAngles', - value: function fromAngles(theta, phi, length) { - if (typeof length === 'undefined') { - length = 1; - } - var cosPhi = Math.cos(phi); - var sinPhi = Math.sin(phi); - var cosTheta = Math.cos(theta); - var sinTheta = Math.sin(theta); - return new _main.default.Vector(length * sinTheta * sinPhi, - length * cosTheta, length * sinTheta * cosPhi); - } /** - * Make a new 2D unit vector with a random heading. - * - * @method random2D - * @static - * @return {p5.Vector} new p5.Vector object. - * @example - *
                - * - * let v = p5.Vector.random2D(); - * // Prints "p5.Vector Object : [x, y, 0]" to the console - * // where x and y are small random numbers. - * print(v.toString()); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * frameRate(1); - * - * let v0 = createVector(50, 50); - * let v1 = p5.Vector.random2D(); - * v1.mult(30); - * drawArrow(v0, v1, 'black'); - * - * describe('A black arrow in extends from the center of a gray square. It changes direction once per second.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                - */ - - }, - { - key: 'random2D', - value: function random2D() { - return this.fromAngle(Math.random() * constants.TWO_PI); - } /** - * Make a new 3D unit vector with a random heading. - * - * @method random3D - * @static - * @return {p5.Vector} new p5.Vector object. - * @example - *
                - * - * let v = p5.Vector.random3D(); - * // Prints "p5.Vector Object : [x, y, z]" to the console - * // where x, y, and z are small random numbers. - * print(v.toString()); - * - *
                - */ - - }, - { - key: 'random3D', - value: function random3D() { - var angle = Math.random() * constants.TWO_PI; - var vz = Math.random() * 2 - 1; - var vzBase = Math.sqrt(1 - vz * vz); - var vx = vzBase * Math.cos(angle); - var vy = vzBase * Math.sin(angle); - return new _main.default.Vector(vx, vy, vz); - } // Returns a copy of a vector. - /** - * @method copy - * @static - * @param {p5.Vector} v the p5.Vector to create a copy of - * @return {p5.Vector} the copy of the p5.Vector object - */ - - }, - { - key: 'copy', - value: function copy(v) { - return v.copy(v); - } // Adds two vectors together and returns a new one. - /** - * @method add - * @static - * @param {p5.Vector} v1 A p5.Vector to add - * @param {p5.Vector} v2 A p5.Vector to add - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} resulting p5.Vector. - */ - - }, - { - key: 'add', - value: function add(v1, v2, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 3) { - _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.add'); - } - } else { - target.set(v1); - } - target.add(v2); - return target; - } // Returns a vector remainder when it is divided by another vector - /** - * @method rem - * @static - * @param {p5.Vector} v1 The dividend p5.Vector - * @param {p5.Vector} v2 The divisor p5.Vector - */ - /** - * @method rem - * @static - * @param {p5.Vector} v1 - * @param {p5.Vector} v2 - * @return {p5.Vector} The resulting p5.Vector - */ - - }, - { - key: 'rem', - value: function rem(v1, v2) { - if (v1 instanceof _main.default.Vector && v2 instanceof _main.default.Vector) { - var target = v1.copy(); - target.rem(v2); - return target; - } - } /* - * Subtracts one p5.Vector from another and returns a new one. The second - * vector (`v2`) is subtracted from the first (`v1`), resulting in `v1-v2`. - */ - /** - * @method sub - * @static - * @param {p5.Vector} v1 A p5.Vector to subtract from - * @param {p5.Vector} v2 A p5.Vector to subtract - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} The resulting p5.Vector - */ - - }, - { - key: 'sub', - value: function sub(v1, v2, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 3) { - _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.sub'); - } - } else { - target.set(v1); - } - target.sub(v2); - return target; - } /** - * Multiplies a vector by a scalar and returns a new vector. - */ - /** - * @method mult - * @static - * @param {Number} x - * @param {Number} y - * @param {Number} [z] - * @return {p5.Vector} resulting new p5.Vector. - */ - /** - * @method mult - * @static - * @param {p5.Vector} v - * @param {Number} n - * @param {p5.Vector} [target] vector to receive the result. - */ - /** - * @method mult - * @static - * @param {p5.Vector} v0 - * @param {p5.Vector} v1 - * @param {p5.Vector} [target] - */ - /** - * @method mult - * @static - * @param {p5.Vector} v0 - * @param {Number[]} arr - * @param {p5.Vector} [target] - */ - - }, - { - key: 'mult', - value: function mult(v, n, target) { - if (!target) { - target = v.copy(); - if (arguments.length === 3) { - _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.mult'); - } - } else { - target.set(v); - } - target.mult(n); - return target; - } /** - * Rotates the vector (only 2D vectors) by the given angle; magnitude remains the same. Returns a new vector. - */ - /** - * @method rotate - * @static - * @param {p5.Vector} v - * @param {Number} angle - * @param {p5.Vector} [target] The vector to receive the result - */ - - }, - { - key: 'rotate', - value: function rotate(v, a, target) { - if (arguments.length === 2) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.rotate'); - } - target.set(v); - } - target.rotate(a); - return target; - } /** - * Divides a vector by a scalar and returns a new vector. - */ - /** - * @method div - * @static - * @param {Number} x - * @param {Number} y - * @param {Number} [z] - * @return {p5.Vector} The resulting new p5.Vector - */ - /** - * @method div - * @static - * @param {p5.Vector} v - * @param {Number} n - * @param {p5.Vector} [target] The vector to receive the result - */ - /** - * @method div - * @static - * @param {p5.Vector} v0 - * @param {p5.Vector} v1 - * @param {p5.Vector} [target] - */ - /** - * @method div - * @static - * @param {p5.Vector} v0 - * @param {Number[]} arr - * @param {p5.Vector} [target] - */ - - }, - { - key: 'div', - value: function div(v, n, target) { - if (!target) { - target = v.copy(); - if (arguments.length === 3) { - _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.div'); - } - } else { - target.set(v); - } - target.div(n); - return target; - } /** - * Calculates the dot product of two vectors. - */ - /** - * @method dot - * @static - * @param {p5.Vector} v1 first p5.Vector. - * @param {p5.Vector} v2 second p5.Vector. - * @return {Number} dot product. - */ - - }, - { - key: 'dot', - value: function dot(v1, v2) { - return v1.dot(v2); - } /** - * Calculates the cross product of two vectors. - */ - /** - * @method cross - * @static - * @param {p5.Vector} v1 first p5.Vector. - * @param {p5.Vector} v2 second p5.Vector. - * @return {Number} cross product. - */ - - }, - { - key: 'cross', - value: function cross(v1, v2) { - return v1.cross(v2); - } /** - * Calculates the Euclidean distance between two points (considering a - * point as a vector object). - */ - /** - * @method dist - * @static - * @param {p5.Vector} v1 The first p5.Vector - * @param {p5.Vector} v2 The second p5.Vector - * @return {Number} The distance - */ - - }, - { - key: 'dist', - value: function dist(v1, v2) { - return v1.dist(v2); - } /** - * Linear interpolate a vector to another vector and return the result as a - * new vector. - */ - /** - * @method lerp - * @static - * @param {p5.Vector} v1 - * @param {p5.Vector} v2 - * @param {Number} amt - * @param {p5.Vector} [target] The vector to receive the result - * @return {p5.Vector} The lerped value - */ - - }, - { - key: 'lerp', - value: function lerp(v1, v2, amt, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 4) { - _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.lerp'); - } - } else { - target.set(v1); - } - target.lerp(v2, amt); - return target; - } /** - * Performs spherical linear interpolation with the other vector - * and returns the resulting vector. - * This works in both 3D and 2D. As for 2D, the result of slerping - * between 2D vectors is always a 2D vector. - */ - /** - * @method slerp - * @static - * @param {p5.Vector} v1 old vector. - * @param {p5.Vector} v2 new vector. - * @param {Number} amt - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} slerped vector between v1 and v2 - */ - - }, - { - key: 'slerp', - value: function slerp(v1, v2, amt, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 4) { - _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.slerp'); - } - } else { - target.set(v1); - } - target.slerp(v2, amt); - return target; - } /** - * Calculates the magnitude (length) of the vector and returns the result as - * a float (this is simply the equation `sqrt(x*x + y*y + z*z)`.) - */ - /** - * @method mag - * @static - * @param {p5.Vector} vecT The vector to return the magnitude of - * @return {Number} The magnitude of vecT - */ - - }, - { - key: 'mag', - value: function mag(vecT) { - return vecT.mag(); - } /** - * Calculates the squared magnitude of the vector and returns the result - * as a float (this is simply the equation (x\*x + y\*y + z\*z).) - * Faster if the real length is not required in the - * case of comparing vectors, etc. - */ - /** - * @method magSq - * @static - * @param {p5.Vector} vecT the vector to return the squared magnitude of - * @return {Number} the squared magnitude of vecT - */ - - }, - { - key: 'magSq', - value: function magSq(vecT) { - return vecT.magSq(); - } /** - * Normalize the vector to length 1 (make it a unit vector). - */ - /** - * @method normalize - * @static - * @param {p5.Vector} v The vector to normalize - * @param {p5.Vector} [target] The vector to receive the result - * @return {p5.Vector} The vector v, normalized to a length of 1 - */ - - }, - { - key: 'normalize', - value: function normalize(v, target) { - if (arguments.length < 2) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.normalize'); - } - target.set(v); - } - return target.normalize(); - } /** - * Limit the magnitude of the vector to the value used for the max - * parameter. - */ - /** - * @method limit - * @static - * @param {p5.Vector} v the vector to limit - * @param {Number} max - * @param {p5.Vector} [target] the vector to receive the result (Optional) - * @return {p5.Vector} v with a magnitude limited to max - */ - - }, - { - key: 'limit', - value: function limit(v, max, target) { - if (arguments.length < 3) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.limit'); - } - target.set(v); - } - return target.limit(max); - } /** - * Set the magnitude of the vector to the value used for the len - * parameter. - */ - /** - * @method setMag - * @static - * @param {p5.Vector} v the vector to set the magnitude of - * @param {number} len - * @param {p5.Vector} [target] the vector to receive the result (Optional) - * @return {p5.Vector} v with a magnitude set to len - */ - - }, - { - key: 'setMag', - value: function setMag(v, len, target) { - if (arguments.length < 3) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.setMag'); - } - target.set(v); - } - return target.setMag(len); - } /** - * Calculate the angle of rotation for this vector (only 2D vectors). - * p5.Vectors created using createVector() - * will take the current angleMode into - * consideration, and give the angle in radians or degrees accordingly. - */ - /** - * @method heading - * @static - * @param {p5.Vector} v the vector to find the angle of - * @return {Number} the angle of rotation - */ - - }, - { - key: 'heading', - value: function heading(v) { - return v.heading(); - } /** - * Calculates and returns the angle between two vectors. This function will take - * the angleMode on v1 into consideration, and - * give the angle in radians or degrees accordingly. - */ - /** - * @method angleBetween - * @static - * @param {p5.Vector} v1 the first vector. - * @param {p5.Vector} v2 the second vector. - * @return {Number} angle between the two vectors. - */ - - }, - { - key: 'angleBetween', - value: function angleBetween(v1, v2) { - return v1.angleBetween(v2); - } /** - * Reflect a vector about a normal to a line in 2D, or about a normal to a - * plane in 3D. - */ - /** - * @method reflect - * @static - * @param {p5.Vector} incidentVector vector to be reflected. - * @param {p5.Vector} surfaceNormal - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} the reflected vector - */ - - }, - { - key: 'reflect', - value: function reflect(incidentVector, surfaceNormal, target) { - if (arguments.length < 3) { - target = incidentVector.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.reflect'); - } - target.set(incidentVector); - } - return target.reflect(surfaceNormal); - } /** - * Return a representation of this vector as a float array. This is only - * for temporary use. If used in any other fashion, the contents should be - * copied by using the p5.Vector.copy() - * method to copy into your own vector. - */ - /** - * @method array - * @static - * @param {p5.Vector} v the vector to convert to an array - * @return {Number[]} an Array with the 3 values - */ - - }, - { - key: 'array', - value: function array(v) { - return v.array(); - } /** - * Equality check against a p5.Vector - */ - /** - * @method equals - * @static - * @param {p5.Vector|Array} v1 the first vector to compare - * @param {p5.Vector|Array} v2 the second vector to compare - * @return {Boolean} - */ - - }, - { - key: 'equals', - value: function equals(v1, v2) { - var v; - if (v1 instanceof _main.default.Vector) { - v = v1; - } else if (v1 instanceof Array) { - v = new _main.default.Vector().set(v1); - } else { - _main.default._friendlyError('The v1 parameter should be of type Array or p5.Vector', 'p5.Vector.equals'); - } - return v.equals(v2); - } - } - ]); - return _class; - }(); - var _default = _main.default.Vector; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.every': 171, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.some': 184, - 'core-js/modules/es.math.sign': 190, - 'core-js/modules/es.number.constructor': 191, - 'core-js/modules/es.number.is-finite': 192, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.sub': 218, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 332: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Math - * @submodule Random - * @for p5 - * @requires core - */ - // variables used for random number generators - - var randomStateProp = '_lcg_random_state'; - // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes - // m is basically chosen to be large (as it is the max period) - // and for its relationships to a and c - var m = 4294967296; - // a - 1 should be divisible by m's prime factors - var a = 1664525; - // c and m should be co-prime - var c = 1013904223; - var y2 = 0; - // Linear Congruential Generator that stores its state at instance[stateProperty] - _main.default.prototype._lcg = function (stateProperty) { - // define the recurrence relationship - this[stateProperty] = (a * this[stateProperty] + c) % m; - // return a float in [0, 1) - // we've just used % m, so / m is always < 1 - return this[stateProperty] / m; - }; - _main.default.prototype._lcgSetSeed = function (stateProperty, val) { - // pick a random seed if val is undefined or null - // the >>> 0 casts the seed to an unsigned 32-bit integer - this[stateProperty] = (val == null ? Math.random() * m : val) >>> 0; - }; - /** - * Sets the seed value for random() and - * randomGaussian(). By default, - * random() and - * randomGaussian() produce different - * results each time a sketch is run. Calling `randomSeed()` with a constant - * argument, such as `randomSeed(99)`, makes these functions produce the same - * results each time a sketch is run. - * - * @method randomSeed - * @param {Number} seed seed value. - * @example - *
                - * - * let x = random(width); - * let y = random(height); - * circle(x, y, 10); - * - * randomSeed(99); - * x = random(width); - * y = random(height); - * fill(0); - * circle(x, y, 10); - * - * describe('A white circle appears at a random position. A black circle appears at (27.4, 25.8).'); - * - *
                - */ - _main.default.prototype.randomSeed = function (seed) { - this._lcgSetSeed(randomStateProp, seed); - this._gaussian_previous = false; - }; - /** - * Returns a random number or a random element from an array. - * - * `random()` follows uniform distribution, which means that all outcomes are - * equally likely. When `random()` is used to generate numbers, all - * numbers in the output range are equally likely to be returned. When - * `random()` is used to select elements from an array, all elements are - * equally likely to be chosen. - * - * By default, `random()` produces different results each time a sketch runs. - * The randomSeed() function can be used to - * generate the same sequence of numbers or choices each time a sketch runs. - * - * The version of `random()` with no parameters returns a random number from 0 - * up to but not including 1. - * - * The version of `random()` with one parameter works one of two ways. If the - * argument passed is a number, `random()` returns a random number from 0 up - * to but not including the number. For example, calling `random(5)` returns - * values between 0 and 5. If the argument passed is an array, `random()` - * returns a random element from that array. For example, calling - * `random(['🦁', '🐯', '🐻'])` returns either a lion, tiger, or bear emoji. - * - * The version of `random()` with two parameters returns a random number from - * a given range. The arguments passed set the range's lower and upper bounds. - * For example, calling `random(-5, 10.2)` returns values from -5 up to but - * not including 10.2. - * - * @method random - * @param {Number} [min] lower bound (inclusive). - * @param {Number} [max] upper bound (exclusive). - * @return {Number} random number. - * @example - *
                - * - * let x = random(width); - * let y = random(height); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot appears in a random posiiton on a gray square.'); - * - *
                - * - *
                - * - * let animals = ['🦁', '🐯', '🐻']; - * let animal = random(animals); - * text(animal, 50, 50); - * - * describe('An animal face is displayed at random. Either a lion, tiger, or bear.'); - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * frameRate(5); - * let x = random(width); - * let y = random(height); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves around randomly on a gray square.'); - * } - * - *
                - * - *
                - * - * function draw() { - * background(200); - * - * frameRate(5); - * let x = random(45, 55); - * let y = random(45, 55); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves around randomly in the middle of a gray square.'); - * } - * - *
                - */ - /** - * @method random - * @param {Array} choices array to choose from. - * @return {*} random element from the array. - * @example - */ - _main.default.prototype.random = function (min, max) { - _main.default._validateParameters('random', arguments); - var rand; - if (this[randomStateProp] != null) { - rand = this._lcg(randomStateProp); - } else { - rand = Math.random(); - } - if (typeof min === 'undefined') { - return rand; - } else if (typeof max === 'undefined') { - if (min instanceof Array) { - return min[Math.floor(rand * min.length)]; - } else { - return rand * min; - } - } else { - if (min > max) { - var tmp = min; - min = max; - max = tmp; - } - return rand * (max - min) + min; - } - }; - /** - * Returns a random number fitting a Gaussian, or normal, distribution. Normal - * distributions look like bell curves when plotted. Values from a normal - * distribution cluster around a central value called the mean. The cluster's - * standard deviation describes its spread. - * - * By default, `randomGaussian()` produces different results each time a - * sketch runs. The randomSeed() function can be - * used to generate the same sequence of numbers each time a sketch runs. - * - * There's no minimum or maximum value that `randomGaussian()` might return. - * Values far from the mean are very unlikely and values near the mean are - * very likely. - * - * The version of `randomGaussian()` with no parameters returns values with a - * mean of 0 and standard deviation of 1. - * - * The version of `randomGaussian()` with one parameter interprets the - * argument passed as the mean. The standard deviation is 1. - * - * The version of `randomGaussian()` with two parameters interprets the first - * argument passed as the mean and the second as the standard deviation. - * - * @method randomGaussian - * @param {Number} [mean] mean. - * @param {Number} [sd] standard deviation. - * @return {Number} random number. - * @example - *
                - * - * function draw() { - * noStroke(); - * fill(0, 10); - * - * // Uniform distribution. - * let x = random(width); - * let y = 25; - * circle(x, y, 5); - * - * // Gaussian distribution with sd = 1. - * x = randomGaussian(50); - * y = 50; - * circle(x, y, 5); - * - * // Gaussian distribution with sd = 10. - * x = randomGaussian(50, 10); - * y = 75; - * circle(x, y, 5); - * - * describe('Three horizontal black lines are filled in randomly. The top line spans entire canvas. The middle line is very short. The bottom line spans two-thirds of the canvas.'); - * } - * - *
                - */ - _main.default.prototype.randomGaussian = function (mean) { - var sd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - var y1, - x1, - x2, - w; - if (this._gaussian_previous) { - y1 = y2; - this._gaussian_previous = false; - } else { - do { - x1 = this.random(2) - 1; - x2 = this.random(2) - 1; - w = x1 * x1 + x2 * x2; - } while (w >= 1); - w = Math.sqrt( - 2 * Math.log(w) / w); - y1 = x1 * w; - y2 = x2 * w; - this._gaussian_previous = true; - } - var m = mean || 0; - return y1 * sd + m; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298 - } - ], - 333: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Math - * @submodule Trigonometry - * @for p5 - * @requires core - * @requires constants - */ - /* - * all DEGREES/RADIANS conversion should be done in the p5 instance - * if possible, using the p5._toRadians(), p5._fromRadians() methods. - */ - - _main.default.prototype._angleMode = constants.RADIANS; - /** - * The inverse of cos(), returns the arc cosine of a - * value. This function expects arguments in the range -1 to 1. By default, - * `acos()` returns values in the range 0 to π (about 3.14). If the - * angleMode() is `DEGREES`, then values are - * returned in the range 0 to 180. - * - * @method acos - * @param {Number} value value whose arc cosine is to be returned. - * @return {Number} arc cosine of the given value. - * - * @example - *
                - * - * let a = PI; - * let c = cos(a); - * let ac = acos(c); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(c, 3)}`, 35, 50); - * text(`${round(ac, 3)}`, 35, 75); - * - * describe('The numbers 3.142, -1, and 3.142 written on separate rows.'); - * - *
                - * - *
                - * - * let a = PI; - * let c = cos(a); - * let ac = acos(c); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(c, 3)}`, 35, 50); - * text(`${round(ac, 3)}`, 35, 75); - * - * describe('The numbers 3.927, -0.707, and 2.356 written on separate rows.'); - * - *
                - */ - _main.default.prototype.acos = function (ratio) { - return this._fromRadians(Math.acos(ratio)); - }; - /** - * The inverse of sin(), returns the arc sine of a - * value. This function expects input values in the range of -1 to 1. By - * default, `asin()` returns values in the range -π ÷ 2 - * (about -1.57) to π ÷ 2 (about 1.57). If the - * angleMode() is `DEGREES` then values are - * returned in the range -90 to 90. - * - * @method asin - * @param {Number} value value whose arc sine is to be returned. - * @return {Number} arc sine of the given value. - * - * @example - *
                - * - * let a = PI / 3; - * let s = sin(a); - * let as = asin(s); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(s, 3)}`, 35, 50); - * text(`${round(as, 3)}`, 35, 75); - * - * describe('The numbers 1.047, 0.866, and 1.047 written on separate rows.'); - * - *
                - * - *
                - * - * let a = PI + PI / 3; - * let s = sin(a); - * let as = asin(s); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(s, 3)}`, 35, 50); - * text(`${round(as, 3)}`, 35, 75); - * - * describe('The numbers 4.189, -0.866, and -1.047 written on separate rows.'); - * - *
                - */ - _main.default.prototype.asin = function (ratio) { - return this._fromRadians(Math.asin(ratio)); - }; - /** - * The inverse of tan(), returns the arc tangent of a - * value. This function expects input values in the range of -Infinity to - * Infinity. By default, `atan()` returns values in the range -π ÷ 2 - * (about -1.57) to π ÷ 2 (about 1.57). If the - * angleMode() is `DEGREES` then values are - * returned in the range -90 to 90. - * - * @method atan - * @param {Number} value value whose arc tangent is to be returned. - * @return {Number} arc tangent of the given value. - * - * @example - *
                - * - * let a = PI / 3; - * let t = tan(a); - * let at = atan(t); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(t, 3)}`, 35, 50); - * text(`${round(at, 3)}`, 35, 75); - * - * describe('The numbers 1.047, 1.732, and 1.047 written on separate rows.'); - * - *
                - * - *
                - * - * let a = PI + PI / 3; - * let t = tan(a); - * let at = atan(t); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(t, 3)}`, 35, 50); - * text(`${round(at, 3)}`, 35, 75); - * - * describe('The numbers 4.189, 1.732, and 1.047 written on separate rows.'); - * - *
                - */ - _main.default.prototype.atan = function (ratio) { - return this._fromRadians(Math.atan(ratio)); - }; - /** - * Calculates the angle formed by a specified point, the origin, and the - * positive x-axis. By default, `atan2()` returns values in the range - * -π (about -3.14) to π (3.14). If the - * angleMode() is `DEGREES`, then values are - * returned in the range -180 to 180. The `atan2()` function is most often - * used for orienting geometry to the mouse's position. - * - * Note: The y-coordinate of the point is the first parameter and the - * x-coordinate is the second parameter. - * - * @method atan2 - * @param {Number} y y-coordinate of the point. - * @param {Number} x x-coordinate of the point. - * @return {Number} arc tangent of the given point. - * - * @example - *
                - * - * function draw() { - * background(200); - * translate(width / 2, height / 2); - * let x = mouseX - width / 2; - * let y = mouseY - height / 2; - * let a = atan2(y, x); - * rotate(a); - * rect(-30, -5, 60, 10); - * - * describe('A rectangle at the center of the canvas rotates with mouse movements.'); - * } - * - *
                - */ - _main.default.prototype.atan2 = function (y, x) { - return this._fromRadians(Math.atan2(y, x)); - }; - /** - * Calculates the cosine of an angle. `cos()` is useful for many geometric - * tasks in creative coding. The values returned oscillate between -1 and 1 - * as the input angle increases. `cos()` takes into account the current - * angleMode. - * - * @method cos - * @param {Number} angle the angle. - * @return {Number} cosine of the angle. - * - * @example - *
                - * - * function draw() { - * background(200); - * - * let t = frameCount; - * let x = 30 * cos(t * 0.05) + 50; - * let y = 50; - * line(50, y, x, y); - * circle(x, y, 20); - * - * describe('A white ball on a string oscillates left and right.'); - * } - * - *
                - * - *
                - * - * function draw() { - * let x = frameCount; - * let y = 30 * cos(x * 0.1) + 50; - * point(x, y); - * - * describe('A series of black dots form a wave pattern.'); - * } - * - *
                - * - *
                - * - * function draw() { - * let t = frameCount; - * let x = 30 * cos(t * 0.1) + 50; - * let y = 10 * sin(t * 0.2) + 50; - * point(x, y); - * - * describe('A series of black dots form an infinity symbol.'); - * } - * - *
                - */ - _main.default.prototype.cos = function (angle) { - return Math.cos(this._toRadians(angle)); - }; - /** - * Calculates the sine of an angle. `sin()` is useful for many geometric tasks - * in creative coding. The values returned oscillate between -1 and 1 as the - * input angle increases. `sin()` takes into account the current - * angleMode. - * - * @method sin - * @param {Number} angle the angle. - * @return {Number} sine of the angle. - * - * @example - *
                - * - * function draw() { - * background(200); - * - * let t = frameCount; - * let x = 50; - * let y = 30 * sin(t * 0.05) + 50; - * line(x, 50, x, y); - * circle(x, y, 20); - * - * describe('A white ball on a string oscillates up and down.'); - * } - * - *
                - * - *
                - * - * function draw() { - * let x = frameCount; - * let y = 30 * sin(x * 0.1) + 50; - * point(x, y); - * - * describe('A series of black dots form a wave pattern.'); - * } - * - *
                - * - *
                - * - * function draw() { - * let t = frameCount; - * let x = 30 * cos(t * 0.1) + 50; - * let y = 10 * sin(t * 0.2) + 50; - * point(x, y); - * - * describe('A series of black dots form an infinity symbol.'); - * } - * - *
                - */ - _main.default.prototype.sin = function (angle) { - return Math.sin(this._toRadians(angle)); - }; - /** - * Calculates the tangent of an angle. `tan()` is useful for many geometric - * tasks in creative coding. The values returned range from -Infinity - * to Infinity and repeat periodically as the input angle increases. `tan()` - * takes into account the current angleMode. - * - * @method tan - * @param {Number} angle the angle. - * @return {Number} tangent of the angle. - * - * @example - *
                - * - * function draw() { - * let x = frameCount; - * let y = 5 * tan(x * 0.1) + 50; - * point(x, y); - * - * describe('A series of identical curves drawn with black dots. Each curve starts from the top of the canvas, continues down at a slight angle, flattens out at the middle of the canvas, then continues to the bottom.'); - * } - * - *
                - */ - _main.default.prototype.tan = function (angle) { - return Math.tan(this._toRadians(angle)); - }; - /** - * Converts an angle measurement in radians to its corresponding value in - * degrees. Degrees and radians are two ways of measuring the same thing. - * There are 360 degrees in a circle and 2 × π (about 6.28) - * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) - * radians. This function doesn't take into account the current - * angleMode(). - * - * @method degrees - * @param {Number} radians radians value to convert to degrees. - * @return {Number} converted angle. - * - * @example - *
                - * - * let rad = QUARTER_PI; - * let deg = degrees(rad); - * text(`${round(rad, 2)} rad = ${deg}˚`, 10, 50); - * - * describe('The text "0.79 rad = 45˚".'); - * - *
                - */ - _main.default.prototype.degrees = function (angle) { - return angle * constants.RAD_TO_DEG; - }; - /** - * Converts an angle measurement in degrees to its corresponding value in - * radians. Degrees and radians are two ways of measuring the same thing. - * There are 360 degrees in a circle and 2 × π (about 6.28) - * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) - * radians. This function doesn't take into account the current - * angleMode(). - * - * @method radians - * @param {Number} degrees degree value to convert to radians. - * @return {Number} converted angle. - * - * @example - *
                - * - * let deg = 45; - * let rad = radians(deg); - * text(`${deg}˚ = ${round(rad, 3)} rad`, 10, 50); - * - * describe('The text "45˚ = 0.785 rad".'); - * - *
                - */ - _main.default.prototype.radians = function (angle) { - return angle * constants.DEG_TO_RAD; - }; - /** - * Changes the way trigonometric functions interpret angle values. By default, - * the mode is `RADIANS`. - * - * Calling `angleMode()` with no arguments returns current angle mode. - * @method angleMode - * @param {Constant} mode either RADIANS or DEGREES. - * @example - *
                - * - * let r = 40; - * push(); - * rotate(PI / 6); - * line(0, 0, r, 0); - * text('0.524 rad', r, 0); - * pop(); - * - * angleMode(DEGREES); - * push(); - * rotate(60); - * line(0, 0, r, 0); - * text('60˚', r, 0); - * pop(); - * - * describe('Two diagonal lines radiating from the top left corner of a square. The lines are oriented 30 degrees from the edges of the square and 30 degrees apart from each other.'); - * - *
                - * - */ - /** - * @method angleMode - * @return {Constant} mode either RADIANS or DEGREES - */ - _main.default.prototype.angleMode = function (mode) { - _main.default._validateParameters('angleMode', arguments); - if (typeof mode === 'undefined') { - return this._angleMode; - } else if (mode === constants.DEGREES || mode === constants.RADIANS) { - this._angleMode = mode; - } - }; - /** - * converts angles from the current angleMode to RADIANS - * - * @method _toRadians - * @private - * @param {Number} angle - * @returns {Number} - */ - _main.default.prototype._toRadians = function (angle) { - if (this._angleMode === constants.DEGREES) { - return angle * constants.DEG_TO_RAD; - } - return angle; - }; - /** - * converts angles from the current angleMode to DEGREES - * - * @method _toDegrees - * @private - * @param {Number} angle - * @returns {Number} - */ - _main.default.prototype._toDegrees = function (angle) { - if (this._angleMode === constants.RADIANS) { - return angle * constants.RAD_TO_DEG; - } - return angle; - }; - /** - * converts angles from RADIANS into the current angleMode - * - * @method _fromRadians - * @private - * @param {Number} angle - * @returns {Number} - */ - _main.default.prototype._fromRadians = function (angle) { - if (this._angleMode === constants.DEGREES) { - return angle * constants.RAD_TO_DEG; - } - return angle; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 334: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Typography - * @submodule Attributes - * @for p5 - * @requires core - * @requires constants - */ - /** - * Sets the way text is aligned when text() is called. - * - * By default, calling `text('hi', 10, 20)` places the bottom-left corner of - * the text's bounding box at (10, 20). - * - * The first parameter, `horizAlign`, changes the way - * text() interprets x-coordinates. By default, the - * x-coordinate sets the left edge of the bounding box. `textAlign()` accepts - * the following values for `horizAlign`: `LEFT`, `CENTER`, or `RIGHT`. - * - * The second parameter, `vertAlign`, is optional. It changes the way - * text() interprets y-coordinates. By default, the - * y-coordinate sets the bottom edge of the bounding box. `textAlign()` - * accepts the following values for `vertAlign`: `TOP`, `BOTTOM`, `CENTER`, - * or `BASELINE`. - * - * @method textAlign - * @param {Constant} horizAlign horizontal alignment, either LEFT, - * CENTER, or RIGHT. - * @param {Constant} [vertAlign] vertical alignment, either TOP, - * BOTTOM, CENTER, or BASELINE. - * @chainable - * @example - *
                - * - * strokeWeight(0.5); - * line(50, 0, 50, 100); - * - * textSize(16); - * textAlign(RIGHT); - * text('ABCD', 50, 30); - * textAlign(CENTER); - * text('EFGH', 50, 50); - * textAlign(LEFT); - * text('IJKL', 50, 70); - * - * describe('The letters ABCD displayed at top-left, EFGH at center, and IJKL at bottom-right. A vertical line divides the canvas in half.'); - * - *
                - * - *
                - * - * strokeWeight(0.5); - * - * line(0, 12, width, 12); - * textAlign(CENTER, TOP); - * text('TOP', 50, 12); - * - * line(0, 37, width, 37); - * textAlign(CENTER, CENTER); - * text('CENTER', 50, 37); - * - * line(0, 62, width, 62); - * textAlign(CENTER, BASELINE); - * text('BASELINE', 50, 62); - * - * line(0, 97, width, 97); - * textAlign(CENTER, BOTTOM); - * text('BOTTOM', 50, 97); - * - * describe('The words "TOP", "CENTER", "BASELINE", and "BOTTOM" each drawn relative to a horizontal line. Their positions demonstrate different vertical alignments.'); - * - *
                - */ - /** - * @method textAlign - * @return {Object} - */ - - _main.default.prototype.textAlign = function (horizAlign, vertAlign) { - var _this$_renderer; - _main.default._validateParameters('textAlign', arguments); - return (_this$_renderer = this._renderer).textAlign.apply(_this$_renderer, arguments); - }; - /** - * Sets the spacing between lines of text when - * text() is called. Spacing is measured in pixels. - * - * Calling `textLeading()` without an argument returns the current spacing. - * - * @method textLeading - * @param {Number} leading spacing between lines of text in units of pixels. - * @chainable - * - * @example - *
                - * - * // "\n" starts a new line of text. - * let lines = 'one\ntwo'; - * - * text(lines, 10, 25); - * - * textLeading(30); - * text(lines, 70, 25); - * - * describe('The words "one" and "two" written on separate lines twice. The words on the left have less vertical spacing than the words on the right.'); - * - *
                - */ - /** - * @method textLeading - * @return {Number} - */ - _main.default.prototype.textLeading = function (theLeading) { - var _this$_renderer2; - _main.default._validateParameters('textLeading', arguments); - return (_this$_renderer2 = this._renderer).textLeading.apply(_this$_renderer2, arguments); - }; - /** - * Sets the font size when - * text() is called. Font size is measured in pixels. - * - * Calling `textSize()` without an arugment returns the current size. - * - * @method textSize - * @param {Number} size size of the letters in units of pixels - * @chainable - * - * @example - *
                - * - * textSize(12); - * text('Font Size 12', 10, 30); - * textSize(14); - * text('Font Size 14', 10, 60); - * textSize(16); - * text('Font Size 16', 10, 90); - * - * describe('The text "Font Size 12" drawn small, "Font Size 14" drawn medium, and "Font Size 16" drawn large.'); - * - *
                - */ - /** - * @method textSize - * @return {Number} - */ - _main.default.prototype.textSize = function (theSize) { - var _this$_renderer3; - _main.default._validateParameters('textSize', arguments); - return (_this$_renderer3 = this._renderer).textSize.apply(_this$_renderer3, arguments); - }; - /** - * Sets the style for system fonts when - * text() is called. `textStyle()` accepts the - * following values: `NORMAL`, `ITALIC`, `BOLD` or `BOLDITALIC`. - * - * `textStyle()` may be overridden by CSS styling. This function doesn't - * affect fonts loaded with loadFont(). - * - * @method textStyle - * @param {Constant} style styling for text, either NORMAL, - * ITALIC, BOLD or BOLDITALIC - * @chainable - * @example - *
                - * - * textSize(12); - * textAlign(CENTER); - * - * textStyle(NORMAL); - * text('Normal', 50, 15); - * textStyle(ITALIC); - * text('Italic', 50, 40); - * textStyle(BOLD); - * text('Bold', 50, 65); - * textStyle(BOLDITALIC); - * text('Bold Italic', 50, 90); - * - * describe('The words "Normal" displayed normally, "Italic" in italic, "Bold" in bold, and "Bold Italic" in bold italics.'); - * - *
                - */ - /** - * @method textStyle - * @return {String} - */ - _main.default.prototype.textStyle = function (theStyle) { - var _this$_renderer4; - _main.default._validateParameters('textStyle', arguments); - return (_this$_renderer4 = this._renderer).textStyle.apply(_this$_renderer4, arguments); - }; - /** - * Returns the maximum width of a string of text drawn when - * text() is called. - * - * @method textWidth - * @param {String} str string of text to measure. - * @return {Number} width measured in units of pixels. - * @example - *
                - * - * function setup() { - * background(200); - * - * textSize(28); - * strokeWeight(0.5); - * let s = 'yoyo'; - * let w = textWidth(s); - * text(s, 22, 55); - * line(22, 55, 22 + w, 55); - * - * describe('The word "yoyo" underlined.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * - * textSize(28); - * strokeWeight(0.5); - * // "\n" starts a new line. - * let s = 'yo\nyo'; - * let w = textWidth(s); - * text(s, 22, 55); - * line(22, 55, 22 + w, 55); - * - * describe('The word "yo" written twice, one copy beneath the other. The words are divided by a horizontal line.'); - * } - * - *
                - */ - _main.default.prototype.textWidth = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - args[0] += ''; - _main.default._validateParameters('textWidth', args); - if (args[0].length === 0) { - return 0; - } // Only use the line with the longest width, and replace tabs with double-space - - var textLines = args[0].replace(/\t/g, ' ').split(/\r?\n|\r|\n/g); - var newArr = [ - ]; - // Return the textWidth for every line - for (var i = 0; i < textLines.length; i++) { - newArr.push(this._renderer.textWidth(textLines[i])); - } // Return the largest textWidth - - var largestWidth = Math.max.apply(Math, newArr); - return largestWidth; - }; - /** - * Returns the ascent of the current font at its current size. The ascent - * represents the distance, in pixels, of the tallest character above - * the baseline. - * - * @method textAscent - * @return {Number} ascent measured in units of pixels. - * @example - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * textFont(font); - * - * // Different for each font. - * let fontScale = 0.8; - * - * let baseY = 75; - * strokeWeight(0.5); - * - * // Draw small text. - * textSize(24); - * text('dp', 0, baseY); - * // Draw baseline and ascent. - * let a = textAscent() * fontScale; - * line(0, baseY, 23, baseY); - * line(23, baseY - a, 23, baseY); - * - * // Draw large text. - * textSize(48); - * text('dp', 45, baseY); - * // Draw baseline and ascent. - * a = textAscent() * fontScale; - * line(45, baseY, 91, baseY); - * line(91, baseY - a, 91, baseY); - * - * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends upward from each baseline to the top of the "d".'); - * } - * - *
                - */ - _main.default.prototype.textAscent = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('textAscent', args); - return this._renderer.textAscent(); - }; - /** - * Returns the descent of the current font at its current size. The descent - * represents the distance, in pixels, of the character with the longest - * descender below the baseline. - * - * @method textDescent - * @return {Number} descent measured in units of pixels. - * @example - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * textFont(font); - * - * // Different for each font. - * let fontScale = 0.9; - * - * let baseY = 75; - * strokeWeight(0.5); - * - * // Draw small text. - * textSize(24); - * text('dp', 0, baseY); - * // Draw baseline and descent. - * let d = textDescent() * fontScale; - * line(0, baseY, 23, baseY); - * line(23, baseY, 23, baseY + d); - * - * // Draw large text. - * textSize(48); - * text('dp', 45, baseY); - * // Draw baseline and descent. - * d = textDescent() * fontScale; - * line(45, baseY, 91, baseY); - * line(91, baseY, 91, baseY + d); - * - * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends downward from each baseline to the bottom of the "p".'); - * } - * - *
                - */ - _main.default.prototype.textDescent = function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('textDescent', args); - return this._renderer.textDescent(); - }; - /** - * Helper function to measure ascent and descent. - */ - _main.default.prototype._updateTextMetrics = function () { - return this._renderer._updateTextMetrics(); - }; - /** - * Sets the style for wrapping text when - * text() is called. `textWrap()` accepts the - * following values: - * - * `WORD` starts new lines of text at spaces. If a string of text doesn't - * have spaces, it may overflow the text box and the canvas. This is the - * default style. - * - * `CHAR` starts new lines as needed to stay within the text box. - * - * `textWrap()` only works when the maximum width is set for a text box. For - * example, calling `text('Have a wonderful day', 0, 10, 100)` sets the - * maximum width to 100 pixels. - * - * Calling `textWrap()` without an argument returns the current style. - * - * @method textWrap - * @param {Constant} style text wrapping style, either WORD or CHAR. - * @return {String} style - * @example - *
                - * - * textSize(20); - * textWrap(WORD); - * text('Have a wonderful day', 0, 10, 100); - * - *
                - * - *
                - * - * textSize(20); - * textWrap(CHAR); - * text('Have a wonderful day', 0, 10, 100); - * - *
                - * - *
                - * - * textSize(20); - * textWrap(CHAR); - * text('祝你有美好的一天', 0, 10, 100); - * - *
                - */ - _main.default.prototype.textWrap = function (wrapStyle) { - if (wrapStyle !== 'WORD' && wrapStyle !== 'CHAR') { - throw 'Error: textWrap accepts only WORD or CHAR'; - } - return this._renderer.textWrap(wrapStyle); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216 - } - ], - 335: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.last-index-of'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.last-index-of'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.split'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - var opentype = _interopRequireWildcard(_dereq_('opentype.js')); - _dereq_('../core/friendly_errors/validate_params'); - _dereq_('../core/friendly_errors/file_errors'); - _dereq_('../core/friendly_errors/fes_core'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Typography - * @submodule Loading & Displaying - * @for p5 - * @requires core - */ - /** - * Loads a font and creates a p5.Font object. - * `loadFont()` can load fonts in either .otf or .ttf format. Loaded fonts can - * be used to style text on the canvas and in HTML elements. - * - * The first parameter, `path`, is the path to a font file. - * Paths to local files should be relative. For example, - * `'assets/inconsolata.otf'`. The Inconsolata font used in the following - * examples can be downloaded for free - * here. - * Paths to remote files should be URLs. For example, - * `'https://example.com/inconsolata.otf'`. URLs may be blocked due to browser - * security. - * - * The second parameter, `successCallback`, is optional. If a function is - * passed, it will be called once the font has loaded. The callback function - * may use the new p5.Font object if needed. - * - * The third parameter, `failureCallback`, is also optional. If a function is - * passed, it will be called if the font fails to load. The callback function - * may use the error - * Event - * object if needed. - * - * Fonts can take time to load. Calling `loadFont()` in - * preload() ensures fonts load before they're - * used in setup() or - * draw(). - * - * @method loadFont - * @param {String} path path of the font to be loaded. - * @param {Function} [successCallback] function called with the - * p5.Font object after it - * loads. - * @param {Function} [failureCallback] function called with the error - * Event - * object if the font fails to load. - * @return {p5.Font} p5.Font object. - * @example - * - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - *
                - * - *
                - * - * function setup() { - * loadFont('assets/inconsolata.otf', font => { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * }); - * } - * - *
                - * - *
                - * - * function setup() { - * loadFont('assets/inconsolata.otf', success, failure); - * } - * - * function success(font) { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - * function failure(event) { - * console.error('Oops!', event); - * } - * - *
                - * - *
                - * - * function preload() { - * loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * let p = createP('p5*js'); - * p.style('color', 'deeppink'); - * p.style('font-family', 'Inconsolata'); - * p.style('font-size', '36px'); - * p.position(10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - *
                - */ - - _main.default.prototype.loadFont = function (path, onSuccess, onError) { - _main.default._validateParameters('loadFont', arguments); - var p5Font = new _main.default.Font(this); - var self = this; - opentype.load(path, function (err, font) { - if (err) { - _main.default._friendlyFileLoadError(4, path); - if (typeof onError !== 'undefined') { - return onError(err); - } - console.error(err, path); - return; - } - p5Font.font = font; - if (typeof onSuccess !== 'undefined') { - onSuccess(p5Font); - } - self._decrementPreload(); - // check that we have an acceptable font type - var validFontTypes = [ - 'ttf', - 'otf', - 'woff', - 'woff2' - ]; - var fileNoPath = path.split('\\').pop().split('/').pop(); - var lastDotIdx = fileNoPath.lastIndexOf('.'); - var fontFamily; - var newStyle; - var fileExt = lastDotIdx < 1 ? null : fileNoPath.slice(lastDotIdx + 1); - // if so, add it to the DOM (name-only) for use with DOM module - if (validFontTypes.includes(fileExt)) { - fontFamily = fileNoPath.slice(0, lastDotIdx !== - 1 ? lastDotIdx : 0); - newStyle = document.createElement('style'); - newStyle.appendChild(document.createTextNode('\n@font-face {\nfont-family: '.concat(fontFamily, ';\nsrc: url(').concat(path, ');\n}\n'))); - document.head.appendChild(newStyle); - } - }); - return p5Font; - }; - /** - * Draws text to the canvas. - * - * The first parameter, `str`, is the text to be drawn. The second and third - * parameters, `x` and `y`, set the coordinates of the text's bottom-left - * corner. See textAlign() for other ways to - * align text. - * - * The fourth and fifth parameters, `maxWidth` and `maxHeight`, are optional. - * They set the dimensions of the invisible rectangle containing the text. By - * default, they set its maximum width and height. See - * rectMode() for other ways to define the - * rectangular text box. Text will wrap to fit within the text box. Text - * outside of the box won't be drawn. - * - * Text can be styled a few ways. Call the fill() - * function to set the text's fill color. Call - * stroke() and - * strokeWeight() to set the text's outline. - * Call textSize() and - * textFont() to set the text's size and font, - * respectively. - * - * Note: `WEBGL` mode only supports fonts loaded with - * loadFont(). Calling - * stroke() has no effect in `WEBGL` mode. - * - * @method text - * @param {String|Object|Array|Number|Boolean} str text to be displayed. - * @param {Number} x x-coordinate of the text box. - * @param {Number} y y-coordinate of the text box. - * @param {Number} [maxWidth] maximum width of the text box. See - * rectMode() for - * other options. - * @param {Number} [maxHeight] maximum height of the text box. See - * rectMode() for - * other options. - * - * @chainable - * @example - *
                - * - * function setup() { - * background(200); - * text('hi', 50, 50); - * - * describe('The text "hi" written in black in the middle of a gray square.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background('skyblue'); - * textSize(100); - * text('🌈', 0, 100); - * - * describe('A rainbow in a blue sky.'); - * } - * - *
                - * - *
                - * - * function setup() { - * textSize(32); - * fill(255); - * stroke(0); - * strokeWeight(4); - * text('hi', 50, 50); - * - * describe('The text "hi" written in white with a black outline.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background('black'); - * textSize(22); - * fill('yellow'); - * text('rainbows', 6, 20); - * fill('cornflowerblue'); - * text('rainbows', 6, 45); - * fill('tomato'); - * text('rainbows', 6, 70); - * fill('limegreen'); - * text('rainbows', 6, 95); - * - * describe('The text "rainbows" written on several lines, each in a different color.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * let s = 'The quick brown fox jumps over the lazy dog.'; - * text(s, 10, 10, 70, 80); - * - * describe('The sample text "The quick brown fox..." written in black across several lines.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * rectMode(CENTER); - * let s = 'The quick brown fox jumps over the lazy dog.'; - * text(s, 50, 50, 70, 80); - * - * describe('The sample text "The quick brown fox..." written in black across several lines.'); - * } - * - *
                - * - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * textFont(font); - * textSize(32); - * textAlign(CENTER, CENTER); - * } - * - * function draw() { - * background(0); - * rotateY(frameCount / 30); - * text('p5*js', 0, 0); - * - * describe('The text "p5*js" written in white and spinning in 3D.'); - * } - * - *
                - */ - _main.default.prototype.text = function (str, x, y, maxWidth, maxHeight) { - var _this$_renderer; - _main.default._validateParameters('text', arguments); - return !(this._renderer._doFill || this._renderer._doStroke) ? this : (_this$_renderer = this._renderer).text.apply(_this$_renderer, arguments); - }; - /** - * Sets the font used by the text() function. - * - * The first parameter, `font`, sets the font. `textFont()` recognizes either - * a p5.Font object or a string with the name of a - * system font. For example, `'Courier New'`. - * - * The second parameter, `size`, is optional. It sets the font size in pixels. - * This has the same effect as calling textSize(). - * - * Note: `WEBGL` mode only supports fonts loaded with - * loadFont(). - * - * @method textFont - * @return {Object} current font or p5 Object. - * - * @example - *
                - * - * function setup() { - * background(200); - * textFont('Courier New'); - * textSize(24); - * text('hi', 35, 55); - * - * describe('The text "hi" written in a black, monospace font on a gray background.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background('black'); - * fill('palegreen'); - * textFont('Courier New', 10); - * text('You turn to the left and see a door. Do you enter?', 5, 5, 90, 90); - * text('>', 5, 70); - * - * describe('A text prompt from a game is written in a green, monospace font on a black background.'); - * } - * - *
                - * - *
                - * - * function setup() { - * background(200); - * textFont('Verdana'); - * let currentFont = textFont(); - * text(currentFont, 25, 50); - * - * describe('The text "Verdana" written in a black, sans-serif font on a gray background.'); - * } - * - *
                - * - *
                - * - * let fontRegular; - * let fontItalic; - * let fontBold; - * - * function preload() { - * fontRegular = loadFont('assets/Regular.otf'); - * fontItalic = loadFont('assets/Italic.ttf'); - * fontBold = loadFont('assets/Bold.ttf'); - * } - * - * function setup() { - * background(200); - * textFont(fontRegular); - * text('I am Normal', 10, 30); - * textFont(fontItalic); - * text('I am Italic', 10, 50); - * textFont(fontBold); - * text('I am Bold', 10, 70); - * - * describe('The statements "I am Normal", "I am Italic", and "I am Bold" written in black on separate lines. The statements have normal, italic, and bold fonts, respectively.'); - * } - * - *
                - */ - /** - * @method textFont - * @param {Object|String} font font as a p5.Font object or a string. - * @param {Number} [size] font size in pixels. - * @chainable - */ - _main.default.prototype.textFont = function (theFont, theSize) { - _main.default._validateParameters('textFont', arguments); - if (arguments.length) { - if (!theFont) { - throw new Error('null font passed to textFont'); - } - this._renderer._setProperty('_textFont', theFont); - if (theSize) { - this._renderer._setProperty('_textSize', theSize); - if (!this._renderer._leadingSet) { - // only use a default value if not previously set (#5181) - this._renderer._setProperty('_textLeading', theSize * constants._DEFAULT_LEADMULT); - } - } - return this._renderer._applyTextProperties(); - } - return this._renderer._textFont; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/friendly_errors/fes_core': 289, - '../core/friendly_errors/file_errors': 290, - '../core/friendly_errors/validate_params': 293, - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.last-index-of': 181, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256, - 'opentype.js': 271 - } - ], - 336: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * This module defines the p5.Font class and functions for - * drawing text to the display canvas. - * @module Typography - * @submodule Loading & Displaying - * @requires core - * @requires constants - */ - /** - * A class to describe fonts. - * @class p5.Font - * @constructor - * @param {p5} [pInst] pointer to p5 instance. - * @example - *
                - * - * let font; - * - * function preload() { - * // Creates a p5.Font object. - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - *
                - */ - - _main.default.Font = /*#__PURE__*/ function () { - function _class(p) { - _classCallCheck(this, _class); - this.parent = p; - this.cache = { - }; - /** - * Underlying - * opentype.js - * font object. - * @property font - * @name font - */ - this.font = undefined; - } /** - * Returns the bounding box for a string of text written using this - * p5.Font. - * - * The first parameter, `str`, is a string of text. The second and third - * parameters, `x` and `y`, are the text's position. By default, they set the - * coordinates of the bounding box's bottom-left corner. See - * textAlign() for more ways to align text. - * - * The fourth parameter, `fontSize`, is optional. It sets the font size used to - * determine the bounding box. By default, `font.textBounds()` will use the - * current textSize(). - * - * @method textBounds - * @param {String} str string of text. - * @param {Number} x x-coordinate of the text. - * @param {Number} y y-coordinate of the text. - * @param {Number} [fontSize] font size. Defaults to the current - * textSize(). - * @return {Object} object describing the bounding box with - * properties x, y, w, and h. - * - * @example - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * - * let bbox = font.textBounds('p5*js', 35, 53); - * rect(bbox.x, bbox.y, bbox.w, bbox.h); - * - * textFont(font); - * text('p5*js', 35, 53); - * - * describe('The text "p5*js" written in black inside a white rectangle.'); - * } - * - *
                - * - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * - * textFont(font); - * textSize(15); - * textAlign(CENTER, CENTER); - * - * let bbox = font.textBounds('p5*js', 50, 50); - * rect(bbox.x, bbox.y, bbox.w, bbox.h); - * - * text('p5*js', 50, 50); - * - * describe('The text "p5*js" written in black inside a white rectangle.'); - * } - * - *
                - * - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * - * let bbox = font.textBounds('p5*js', 31, 53, 15); - * rect(bbox.x, bbox.y, bbox.w, bbox.h); - * - * textFont(font); - * textSize(15); - * text('p5*js', 31, 53); - * - * describe('The text "p5*js" written in black inside a white rectangle.'); - * } - * - *
                - */ - - _createClass(_class, [ - { - key: 'textBounds', - value: function textBounds(str) { - var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var fontSize = arguments.length > 3 ? arguments[3] : undefined; - var opts = arguments.length > 4 ? arguments[4] : undefined; - // Check cache for existing bounds. Take into consideration the text alignment - // settings. Default alignment should match opentype's origin: left-aligned & - // alphabetic baseline. - var p = opts && opts.renderer && opts.renderer._pInst || this.parent; - var ctx = p._renderer.drawingContext; - var alignment = ctx.textAlign || constants.LEFT; - var baseline = ctx.textBaseline || constants.BASELINE; - var cacheResults = false; - var result; - var key; - fontSize = fontSize || p._renderer._textSize; - // NOTE: cache disabled for now pending further discussion of #3436 - if (cacheResults) { - key = cacheKey('textBounds', str, x, y, fontSize, alignment, baseline); - result = this.cache[key]; - } - if (!result) { - var minX = [ - ]; - var minY; - var maxX = [ - ]; - var maxY; - var pos; - var xCoords = [ - ]; - xCoords[0] = [ - ]; - var yCoords = [ - ]; - var scale = this._scale(fontSize); - var lineHeight = p._renderer.textLeading(); - var lineCount = 0; - this.font.forEachGlyph(str, x, y, fontSize, opts, function (glyph, gX, gY, gFontSize) { - var gm = glyph.getMetrics(); - if (glyph.index === 0 || glyph.index === 10) { - lineCount += 1; - xCoords[lineCount] = [ - ]; - } else { - xCoords[lineCount].push(gX + gm.xMin * scale); - xCoords[lineCount].push(gX + gm.xMax * scale); - yCoords.push(gY + lineCount * lineHeight + - gm.yMin * scale); - yCoords.push(gY + lineCount * lineHeight + - gm.yMax * scale); - } - }); - if (xCoords[lineCount].length > 0) { - minX[lineCount] = Math.min.apply(null, xCoords[lineCount]); - maxX[lineCount] = Math.max.apply(null, xCoords[lineCount]); - } - var finalMaxX = 0; - for (var i = 0; i <= lineCount; i++) { - minX[i] = Math.min.apply(null, xCoords[i]); - maxX[i] = Math.max.apply(null, xCoords[i]); - var lineLength = maxX[i] - minX[i]; - if (lineLength > finalMaxX) { - finalMaxX = lineLength; - } - } - var finalMinX = Math.min.apply(null, minX); - minY = Math.min.apply(null, yCoords); - maxY = Math.max.apply(null, yCoords); - result = { - x: finalMinX, - y: minY, - h: maxY - minY, - w: finalMaxX, - advance: finalMinX - x - }; - // Bounds are now calculated, so shift the x & y to match alignment settings - pos = this._handleAlignment(p._renderer, str, result.x, result.y, result.w + result.advance); - result.x = pos.x; - result.y = pos.y; - if (cacheResults) { - this.cache[key] = result; - } - } - return result; - } /** - * Returns an array of points outlining a string of text written using this - * p5.Font. - * - * The first parameter, `str`, is a string of text. The second and third - * parameters, `x` and `y`, are the text's position. By default, they set the - * coordinates of the bounding box's bottom-left corner. See - * textAlign() for more ways to align text. - * - * The fourth parameter, `fontSize`, is optional. It sets the text's font - * size. By default, `font.textToPoints()` will use the current - * textSize(). - * - * The fifth parameter, `options`, is also optional. `font.textToPoints()` - * expects an object with the following properties: - * - * `sampleFactor` is the ratio of the text's path length to the number of - * samples. It defaults to 0.1. Higher values produce more points along the - * path and are more precise. - * - * `simplifyThreshold` removes collinear points if it's set to a number other - * than 0. The value represents the threshold angle to use when determining - * whether two edges are collinear. - * - * @method textToPoints - * @param {String} str string of text. - * @param {Number} x x-coordinate of the text. - * @param {Number} y y-coordinate of the text. - * @param {Number} [fontSize] font size. Defaults to the current - * textSize(). - * @param {Object} [options] object with sampleFactor and simplifyThreshold - * properties. - * @return {Array} array of point objects, each with x, y, and alpha (path angle) properties. - * @example - *
                - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * let points = font.textToPoints('p5*js', 6, 60, 35, { sampleFactor: 0.5 }); - * points.forEach(p => { - * point(p.x, p.y); - * }); - * - * describe('A set of black dots outlining the text "p5*js" on a gray background.'); - * } - * - *
                - */ - - }, - { - key: 'textToPoints', - value: function textToPoints(txt, x, y, fontSize, options) { - var xOriginal = x; - var result = [ - ]; - var lines = txt.split(/\r?\n|\r|\n/g); - fontSize = fontSize || this.parent._renderer._textSize; - function isSpace(i, text, glyphsLine) { - return glyphsLine[i].name && glyphsLine[i].name === 'space' || text.length === glyphsLine.length && text[i] === ' ' //|| - //(glyphs[i].index && glyphs[i].index === 3) - ; - } - for (var i = 0; i < lines.length; i++) { - var xoff = 0; - x = xOriginal; - var line = lines[i]; - line = line.replace('\t', ' '); - var glyphs = this._getGlyphs(line); - for (var j = 0; j < glyphs.length; j++) { - if (!isSpace(j, line, glyphs)) { - // fix to #1817, #2069 - var gpath = glyphs[j].getPath(x, y, fontSize), - paths = splitPaths(gpath.commands); - for (var k = 0; k < paths.length; k++) { - var pts = pathToPoints(paths[k], options); - for (var l = 0; l < pts.length; l++) { - pts[l].x += xoff; - result.push(pts[l]); - } - } - } - xoff += glyphs[j].advanceWidth * this._scale(fontSize); - } - y = y + this.parent._renderer._textLeading; - } - return result; - } // ----------------------------- End API ------------------------------ - /** - * Returns the set of opentype glyphs for the supplied string. - * - * Note that there is not a strict one-to-one mapping between characters - * and glyphs, so the list of returned glyphs can be larger or smaller - * than the length of the given string. - * - * @private - * @param {String} str the string to be converted - * @return {Array} the opentype glyphs - */ - - }, - { - key: '_getGlyphs', - value: function _getGlyphs(str) { - return this.font.stringToGlyphs(str); - } /** - * Returns an opentype path for the supplied string and position. - * - * @private - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional) - * @return {Object} the opentype path - */ - - }, - { - key: '_getPath', - value: function _getPath(line, x, y, options) { - var p = options && options.renderer && options.renderer._pInst || this.parent, - renderer = p._renderer, - pos = this._handleAlignment(renderer, line, x, y); - return this.font.getPath(line, pos.x, pos.y, renderer._textSize, options); - } /* - * Creates an SVG-formatted path-data string - * (See http://www.w3.org/TR/SVG/paths.html#PathData) - * from the given opentype path or string/position - * - * @param {Object} path an opentype path, OR the following: - * - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional), set options.decimals - * to set the decimal precision of the path-data - * - * @return {Object} this p5.Font object - */ - - }, - { - key: '_getPathData', - value: function _getPathData(line, x, y, options) { - var decimals = 3; - // create path from string/position - if (typeof line === 'string' && arguments.length > 2) { - line = this._getPath(line, x, y, options); - } else if (_typeof(x) === 'object') { - // handle options specified in 2nd arg - options = x; - } // handle svg arguments - - if (options && typeof options.decimals === 'number') { - decimals = options.decimals; - } - return line.toPathData(decimals); - } /* - * Creates an SVG element, as a string, - * from the given opentype path or string/position - * - * @param {Object} path an opentype path, OR the following: - * - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional), set options.decimals - * to set the decimal precision of the path-data in the element, - * options.fill to set the fill color for the element, - * options.stroke to set the stroke color for the element, - * options.strokeWidth to set the strokeWidth for the element. - * - * @return {Object} this p5.Font object - */ - - }, - { - key: '_getSVG', - value: function _getSVG(line, x, y, options) { - var decimals = 3; - // create path from string/position - if (typeof line === 'string' && arguments.length > 2) { - line = this._getPath(line, x, y, options); - } else if (_typeof(x) === 'object') { - // handle options specified in 2nd arg - options = x; - } // handle svg arguments - - if (options) { - if (typeof options.decimals === 'number') { - decimals = options.decimals; - } - if (typeof options.strokeWidth === 'number') { - line.strokeWidth = options.strokeWidth; - } - if (typeof options.fill !== 'undefined') { - line.fill = options.fill; - } - if (typeof options.stroke !== 'undefined') { - line.stroke = options.stroke; - } - } - return line.toSVG(decimals); - } /* - * Renders an opentype path or string/position - * to the current graphics context - * - * @param {Object} path an opentype path, OR the following: - * - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional) - * - * @return {p5.Font} this p5.Font object - */ - - }, - { - key: '_renderPath', - value: function _renderPath(line, x, y, options) { - var pdata; - var pg = options && options.renderer || this.parent._renderer; - var ctx = pg.drawingContext; - if (_typeof(line) === 'object' && line.commands) { - pdata = line.commands; - } else { - //pos = handleAlignment(p, ctx, line, x, y); - pdata = this._getPath(line, x, y, options).commands; - } - ctx.beginPath(); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = pdata[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var cmd = _step.value; - if (cmd.type === 'M') { - ctx.moveTo(cmd.x, cmd.y); - } else if (cmd.type === 'L') { - ctx.lineTo(cmd.x, cmd.y); - } else if (cmd.type === 'C') { - ctx.bezierCurveTo(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - } else if (cmd.type === 'Q') { - ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); - } else if (cmd.type === 'Z') { - ctx.closePath(); - } - } // only draw stroke if manually set by user - - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - if (pg._doStroke && pg._strokeSet && !pg._clipping) { - ctx.stroke(); - } - if (pg._doFill && !pg._clipping) { - // if fill hasn't been set by user, use default-text-fill - if (!pg._fillSet) { - pg._setFill(constants._DEFAULT_TEXT_FILL); - } - ctx.fill(); - } - return this; - } - }, - { - key: '_textWidth', - value: function _textWidth(str, fontSize) { - return this.font.getAdvanceWidth(str, fontSize); - } - }, - { - key: '_textAscent', - value: function _textAscent(fontSize) { - return this.font.ascender * this._scale(fontSize); - } - }, - { - key: '_textDescent', - value: function _textDescent(fontSize) { - return - this.font.descender * this._scale(fontSize); - } - }, - { - key: '_scale', - value: function _scale(fontSize) { - return 1 / this.font.unitsPerEm * (fontSize || this.parent._renderer._textSize); - } - }, - { - key: '_handleAlignment', - value: function _handleAlignment(renderer, line, x, y, textWidth) { - var fontSize = renderer._textSize; - if (typeof textWidth === 'undefined') { - textWidth = this._textWidth(line, fontSize); - } - switch (renderer._textAlign) { - case constants.CENTER: - x -= textWidth / 2; - break; - case constants.RIGHT: - x -= textWidth; - break; - } - switch (renderer._textBaseline) { - case constants.TOP: - y += this._textAscent(fontSize); - break; - case constants.CENTER: - y += this._textAscent(fontSize) / 2; - break; - case constants.BOTTOM: - y -= this._textDescent(fontSize); - break; - } - return { - x: x, - y: y - }; - } - } - ]); - return _class; - }(); - // path-utils - function pathToPoints(cmds, options) { - var opts = parseOpts(options, { - sampleFactor: 0.1, - simplifyThreshold: 0 - }); - var // total-length - len = pointAtLength(cmds, 0, 1), - t = len / (len * opts.sampleFactor), - pts = [ - ]; - for (var i = 0; i < len; i += t) { - pts.push(pointAtLength(cmds, i)); - } - if (opts.simplifyThreshold) { - simplify(pts, opts.simplifyThreshold); - } - return pts; - } - function simplify(pts) { - var angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var num = 0; - for (var i = pts.length - 1; pts.length > 3 && i >= 0; --i) { - if (collinear(at(pts, i - 1), at(pts, i), at(pts, i + 1), angle)) { - // Remove the middle point - pts.splice(i % pts.length, 1); - num++; - } - } - return num; - } - function splitPaths(cmds) { - var paths = [ - ]; - var current; - for (var i = 0; i < cmds.length; i++) { - if (cmds[i].type === 'M') { - if (current) { - paths.push(current); - } - current = [ - ]; - } - current.push(cmdToArr(cmds[i])); - } - paths.push(current); - return paths; - } - function cmdToArr(cmd) { - var arr = [ - cmd.type - ]; - if (cmd.type === 'M' || cmd.type === 'L') { - // moveto or lineto - arr.push(cmd.x, cmd.y); - } else if (cmd.type === 'C') { - arr.push(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - } else if (cmd.type === 'Q') { - arr.push(cmd.x1, cmd.y1, cmd.x, cmd.y); - } // else if (cmd.type === 'Z') { /* no-op */ } - - return arr; - } - function parseOpts(options, defaults) { - if (_typeof(options) !== 'object') { - options = defaults; - } else { - for (var key in defaults) { - if (typeof options[key] === 'undefined') { - options[key] = defaults[key]; - } - } - } - return options; - } //////////////////////// Helpers //////////////////////////// - - function at(v, i) { - var s = v.length; - return v[i < 0 ? i % s + s : i % s]; - } - function collinear(a, b, c, thresholdAngle) { - if (!thresholdAngle) { - return areaTriangle(a, b, c) === 0; - } - if (typeof collinear.tmpPoint1 === 'undefined') { - collinear.tmpPoint1 = [ - ]; - collinear.tmpPoint2 = [ - ]; - } - var ab = collinear.tmpPoint1, - bc = collinear.tmpPoint2; - ab.x = b.x - a.x; - ab.y = b.y - a.y; - bc.x = c.x - b.x; - bc.y = c.y - b.y; - var dot = ab.x * bc.x + ab.y * bc.y, - magA = Math.sqrt(ab.x * ab.x + ab.y * ab.y), - magB = Math.sqrt(bc.x * bc.x + bc.y * bc.y), - angle = Math.acos(dot / (magA * magB)); - return angle < thresholdAngle; - } - function areaTriangle(a, b, c) { - return (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]); - } // Portions of below code copyright 2008 Dmitry Baranovskiy (via MIT license) - - function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { - var t1 = 1 - t; - var t13 = Math.pow(t1, 3); - var t12 = Math.pow(t1, 2); - var t2 = t * t; - var t3 = t2 * t; - var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x; - var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y; - var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x); - var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y); - var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x); - var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y); - var ax = t1 * p1x + t * c1x; - var ay = t1 * p1y + t * c1y; - var cx = t1 * c2x + t * p2x; - var cy = t1 * c2y + t * p2y; - var alpha = 90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI; - if (mx > nx || my < ny) { - alpha += 180; - } - return { - x: x, - y: y, - m: { - x: mx, - y: my - }, - n: { - x: nx, - y: ny - }, - start: { - x: ax, - y: ay - }, - end: { - x: cx, - y: cy - }, - alpha: alpha - }; - } - function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) { - return length == null ? bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) : findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length)); - } - function pointAtLength(path, length, istotal) { - path = path2curve(path); - var x; - var y; - var p; - var l; - var sp = ''; - var subpaths = { - }; - var point; - var len = 0; - for (var i = 0, ii = path.length; i < ii; i++) { - p = path[i]; - if (p[0] === 'M') { - x = + p[1]; - y = + p[2]; - } else { - l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); - if (len + l > length) { - if (!istotal) { - point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len); - return { - x: point.x, - y: point.y, - alpha: point.alpha - }; - } - } - len += l; - x = + p[5]; - y = + p[6]; - } - sp += p.shift() + p; - } - subpaths.end = sp; - point = istotal ? len : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); - if (point.alpha) { - point = { - x: point.x, - y: point.y, - alpha: point.alpha - }; - } - return point; - } - function pathToAbsolute(pathArray) { - var res = [ - ], - x = 0, - y = 0, - mx = 0, - my = 0, - start = 0; - if (!pathArray) { - // console.warn("Unexpected state: undefined pathArray"); // shouldn't happen - return res; - } - if (pathArray[0][0] === 'M') { - x = + pathArray[0][1]; - y = + pathArray[0][2]; - mx = x; - my = y; - start++; - res[0] = [ - 'M', - x, - y - ]; - } - var dots; - var crz = pathArray.length === 3 && pathArray[0][0] === 'M' && pathArray[1][0].toUpperCase() === 'R' && pathArray[2][0].toUpperCase() === 'Z'; - for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) { - res.push(r = [ - ]); - pa = pathArray[i]; - if (pa[0] !== String.prototype.toUpperCase.call(pa[0])) { - r[0] = String.prototype.toUpperCase.call(pa[0]); - switch (r[0]) { - case 'A': - r[1] = pa[1]; - r[2] = pa[2]; - r[3] = pa[3]; - r[4] = pa[4]; - r[5] = pa[5]; - r[6] = + (pa[6] + x); - r[7] = + (pa[7] + y); - break; - case 'V': - r[1] = + pa[1] + y; - break; - case 'H': - r[1] = + pa[1] + x; - break; - case 'R': - dots = [ - x, - y - ].concat(pa.slice(1)); - for (var j = 2, jj = dots.length; j < jj; j++) { - dots[j] = + dots[j] + x; - dots[++j] = + dots[j] + y; - } - res.pop(); - res = res.concat(catmullRom2bezier(dots, crz)); - break; - case 'M': - mx = + pa[1] + x; - my = + pa[2] + y; - break; - default: - for (var _j = 1, _jj = pa.length; _j < _jj; _j++) { - r[_j] = + pa[_j] + (_j % 2 ? x : y); - } - } - } else if (pa[0] === 'R') { - dots = [ - x, - y - ].concat(pa.slice(1)); - res.pop(); - res = res.concat(catmullRom2bezier(dots, crz)); - r = [ - 'R' - ].concat(pa.slice( - 2)); - } else { - for (var k = 0, kk = pa.length; k < kk; k++) { - r[k] = pa[k]; - } - } - switch (r[0]) { - case 'Z': - x = mx; - y = my; - break; - case 'H': - x = r[1]; - break; - case 'V': - y = r[1]; - break; - case 'M': - mx = r[r.length - 2]; - my = r[r.length - 1]; - break; - default: - x = r[r.length - 2]; - y = r[r.length - 1]; - } - } - return res; - } - function path2curve(path, path2) { - var p = pathToAbsolute(path), - p2 = path2 && pathToAbsolute(path2); - var attrs = { - x: 0, - y: 0, - bx: 0, - by: 0, - X: 0, - Y: 0, - qx: null, - qy: null - }; - var attrs2 = { - x: 0, - y: 0, - bx: 0, - by: 0, - X: 0, - Y: 0, - qx: null, - qy: null - }; - var pcoms1 = [ - ]; // path commands of original path p - var pcoms2 = [ - ]; // path commands of original path p2 - var ii; - var processPath = function processPath(path, d, pcom) { - var nx; - var ny; - var tq = { - T: 1, - Q: 1 - }; - if (!path) { - return ['C', - d.x, - d.y, - d.x, - d.y, - d.x, - d.y]; - } - if (!(path[0] in tq)) { - d.qx = d.qy = null; - } - switch (path[0]) { - case 'M': - d.X = path[1]; - d.Y = path[2]; - break; - case 'A': - path = [ - 'C' - ].concat(a2c.apply(0, [ - d.x, - d.y - ].concat(path.slice(1)))); - break; - case 'S': - if (pcom === 'C' || pcom === 'S') { - nx = d.x * 2 - d.bx; - ny = d.y * 2 - d.by; - } else { - nx = d.x; - ny = d.y; - } - path = [ - 'C', - nx, - ny - ].concat(path.slice(1)); - break; - case 'T': - if (pcom === 'Q' || pcom === 'T') { - d.qx = d.x * 2 - d.qx; - d.qy = d.y * 2 - d.qy; - } else { - d.qx = d.x; - d.qy = d.y; - } - path = [ - 'C' - ].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2])); - break; - case 'Q': - d.qx = path[1]; - d.qy = path[2]; - path = [ - 'C' - ].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4])); - break; - case 'L': - path = [ - 'C' - ].concat(l2c(d.x, d.y, path[1], path[2])); - break; - case 'H': - path = [ - 'C' - ].concat(l2c(d.x, d.y, path[1], d.y)); - break; - case 'V': - path = [ - 'C' - ].concat(l2c(d.x, d.y, d.x, path[1])); - break; - case 'Z': - path = [ - 'C' - ].concat(l2c(d.x, d.y, d.X, d.Y)); - break; - } - return path; - }, - fixArc = function fixArc(pp, i) { - if (pp[i].length > 7) { - pp[i].shift(); - var pi = pp[i]; - while (pi.length) { - pcoms1[i] = 'A'; - if (p2) { - pcoms2[i] = 'A'; - } - pp.splice(i++, 0, [ - 'C' - ].concat(pi.splice(0, 6))); - } - pp.splice(i, 1); - ii = Math.max(p.length, p2 && p2.length || 0); - } - }, - fixM = function fixM(path1, path2, a1, a2, i) { - if (path1 && path2 && path1[i][0] === 'M' && path2[i][0] !== 'M') { - path2.splice(i, 0, [ - 'M', - a2.x, - a2.y - ]); - a1.bx = 0; - a1.by = 0; - a1.x = path1[i][1]; - a1.y = path1[i][2]; - ii = Math.max(p.length, p2 && p2.length || 0); - } - }; - var pfirst = ''; // temporary holder for original path command - var pcom = ''; // holder for previous path command of original path - ii = Math.max(p.length, p2 && p2.length || 0); - for (var i = 0; i < ii; i++) { - if (p[i]) { - pfirst = p[i][0]; - } // save current path command - - if (pfirst !== 'C') { - pcoms1[i] = pfirst; // Save current path command - if (i) { - pcom = pcoms1[i - 1]; - } // Get previous path command pcom - - } - p[i] = processPath(p[i], attrs, pcom); - if (pcoms1[i] !== 'A' && pfirst === 'C') { - pcoms1[i] = 'C'; - } - fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1 - if (p2) { - // the same procedures is done to p2 - if (p2[i]) { - pfirst = p2[i][0]; - } - if (pfirst !== 'C') { - pcoms2[i] = pfirst; - if (i) { - pcom = pcoms2[i - 1]; - } - } - p2[i] = processPath(p2[i], attrs2, pcom); - if (pcoms2[i] !== 'A' && pfirst === 'C') { - pcoms2[i] = 'C'; - } - fixArc(p2, i); - } - fixM(p, p2, attrs, attrs2, i); - fixM(p2, p, attrs2, attrs, i); - var seg = p[i], - seg2 = p2 && p2[i], - seglen = seg.length, - seg2len = p2 && seg2.length; - attrs.x = seg[seglen - 2]; - attrs.y = seg[seglen - 1]; - attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x; - attrs.by = parseFloat(seg[seglen - 3]) || attrs.y; - attrs2.bx = p2 && (parseFloat(seg2[seg2len - 4]) || attrs2.x); - attrs2.by = p2 && (parseFloat(seg2[seg2len - 3]) || attrs2.y); - attrs2.x = p2 && seg2[seg2len - 2]; - attrs2.y = p2 && seg2[seg2len - 1]; - } - return p2 ? [ - p, - p2 - ] : p; - } - function a2c(x1, y1, rx, ry, angle, lac, sweep_flag, x2, y2, recursive) { - // for more information of where this Math came from visit: - // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes - var PI = Math.PI; - var _120 = PI * 120 / 180; - var f1; - var f2; - var cx; - var cy; - var rad = PI / 180 * ( + angle || 0); - var res = [ - ]; - var xy; - var rotate = function rotate(x, y, rad) { - var X = x * Math.cos(rad) - y * Math.sin(rad), - Y = x * Math.sin(rad) + y * Math.cos(rad); - return { - x: X, - y: Y - }; - }; - if (!recursive) { - xy = rotate(x1, y1, - rad); - x1 = xy.x; - y1 = xy.y; - xy = rotate(x2, y2, - rad); - x2 = xy.x; - y2 = xy.y; - var x = (x1 - x2) / 2; - var y = (y1 - y2) / 2; - var h = x * x / (rx * rx) + y * y / (ry * ry); - if (h > 1) { - h = Math.sqrt(h); - rx = h * rx; - ry = h * ry; - } - var rx2 = rx * rx, - ry2 = ry * ry; - var k = (lac === sweep_flag ? - 1 : 1) * Math.sqrt(Math.abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))); - cx = k * rx * y / ry + (x1 + x2) / 2; - cy = k * - ry * x / rx + (y1 + y2) / 2; - f1 = Math.asin(((y1 - cy) / ry).toFixed(9)); - f2 = Math.asin(((y2 - cy) / ry).toFixed(9)); - f1 = x1 < cx ? PI - f1 : f1; - f2 = x2 < cx ? PI - f2 : f2; - if (f1 < 0) { - f1 = PI * 2 + f1; - } - if (f2 < 0) { - f2 = PI * 2 + f2; - } - if (sweep_flag && f1 > f2) { - f1 = f1 - PI * 2; - } - if (!sweep_flag && f2 > f1) { - f2 = f2 - PI * 2; - } - } else { - f1 = recursive[0]; - f2 = recursive[1]; - cx = recursive[2]; - cy = recursive[3]; - } - var df = f2 - f1; - if (Math.abs(df) > _120) { - var f2old = f2, - x2old = x2, - y2old = y2; - f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : - 1); - x2 = cx + rx * Math.cos(f2); - y2 = cy + ry * Math.sin(f2); - res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [ - f2, - f2old, - cx, - cy - ]); - } - df = f2 - f1; - var c1 = Math.cos(f1), - s1 = Math.sin(f1), - c2 = Math.cos(f2), - s2 = Math.sin(f2), - t = Math.tan(df / 4), - hx = 4 / 3 * rx * t, - hy = 4 / 3 * ry * t, - m1 = [ - x1, - y1 - ], - m2 = [ - x1 + hx * s1, - y1 - hy * c1 - ], - m3 = [ - x2 + hx * s2, - y2 - hy * c2 - ], - m4 = [ - x2, - y2 - ]; - m2[0] = 2 * m1[0] - m2[0]; - m2[1] = 2 * m1[1] - m2[1]; - if (recursive) { - return [m2, - m3, - m4].concat(res); - } else { - res = [ - m2, - m3, - m4 - ].concat(res).join().split(','); - var newres = [ - ]; - for (var i = 0, ii = res.length; i < ii; i++) { - newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x; - } - return newres; - } - } // http://schepers.cc/getting-to-the-point - - function catmullRom2bezier(crp, z) { - var d = [ - ]; - for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) { - var p = [ - { - x: + crp[i - 2], - y: + crp[i - 1] - }, - { - x: + crp[i], - y: + crp[i + 1] - }, - { - x: + crp[i + 2], - y: + crp[i + 3] - }, - { - x: + crp[i + 4], - y: + crp[i + 5] - } - ]; - if (z) { - if (!i) { - p[0] = { - x: + crp[iLen - 2], - y: + crp[iLen - 1] - }; - } else if (iLen - 4 === i) { - p[3] = { - x: + crp[0], - y: + crp[1] - }; - } else if (iLen - 2 === i) { - p[2] = { - x: + crp[0], - y: + crp[1] - }; - p[3] = { - x: + crp[2], - y: + crp[3] - }; - } - } else { - if (iLen - 4 === i) { - p[3] = p[2]; - } else if (!i) { - p[0] = { - x: + crp[i], - y: + crp[i + 1] - }; - } - } - d.push(['C', - ( - p[0].x + 6 * p[1].x + p[2].x) / 6, - ( - p[0].y + 6 * p[1].y + p[2].y) / 6, - (p[1].x + 6 * p[2].x - p[3].x) / 6, - (p[1].y + 6 * p[2].y - p[3].y) / 6, - p[2].x, - p[2].y]); - } - return d; - } - function l2c(x1, y1, x2, y2) { - return [x1, - y1, - x2, - y2, - x2, - y2]; - } - function q2c(x1, y1, ax, ay, x2, y2) { - var _13 = 1 / 3, - _23 = 2 / 3; - return [_13 * x1 + _23 * ax, - _13 * y1 + _23 * ay, - _13 * x2 + _23 * ax, - _13 * y2 + _23 * ay, - x2, - y2]; - } - function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) { - if (z == null) { - z = 1; - } - z = z > 1 ? 1 : z < 0 ? 0 : z; - var z2 = z / 2; - var n = 12; - var Tvalues = [ - - 0.1252, - 0.1252, - - 0.3678, - 0.3678, - - 0.5873, - 0.5873, - - 0.7699, - 0.7699, - - 0.9041, - 0.9041, - - 0.9816, - 0.9816 - ]; - var sum = 0; - var Cvalues = [ - 0.2491, - 0.2491, - 0.2335, - 0.2335, - 0.2032, - 0.2032, - 0.1601, - 0.1601, - 0.1069, - 0.1069, - 0.0472, - 0.0472 - ]; - for (var i = 0; i < n; i++) { - var ct = z2 * Tvalues[i] + z2, - xbase = base3(ct, x1, x2, x3, x4), - ybase = base3(ct, y1, y2, y3, y4), - comb = xbase * xbase + ybase * ybase; - sum += Cvalues[i] * Math.sqrt(comb); - } - return z2 * sum; - } - function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) { - if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) { - return; - } - var t = 1; - var step = t / 2; - var t2 = t - step; - var l; - var e = 0.01; - l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); - while (Math.abs(l - ll) > e) { - step /= 2; - t2 += (l < ll ? 1 : - 1) * step; - l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); - } - return t2; - } - function base3(t, p1, p2, p3, p4) { - var t1 = - 3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, - t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3; - return t * t2 - 3 * p1 + 3 * p2; - } - function cacheKey() { - var hash = ''; - for (var i = arguments.length - 1; i >= 0; --i) { - hash += '?'.concat(i < 0 || arguments.length <= i ? undefined : arguments[i]); - } - return hash; - } - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.number.to-fixed': 193, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 337: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.array-buffer.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.array-buffer.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Data - * @submodule Array Functions - * @for p5 - * @requires core - */ - /** - * Adds a value to the end of an array. Extends the length of - * the array by one. Maps to Array.push(). - * - * @method append - * @deprecated Use array.push(value) instead. - * @param {Array} array Array to append - * @param {any} value to be added to the Array - * @return {Array} the array that was appended to - * @example - *
                - * function setup() { - * let myArray = ['Mango', 'Apple', 'Papaya']; - * print(myArray); // ['Mango', 'Apple', 'Papaya'] - * - * append(myArray, 'Peach'); - * print(myArray); // ['Mango', 'Apple', 'Papaya', 'Peach'] - * } - *
                - */ - - _main.default.prototype.append = function (array, value) { - array.push(value); - return array; - }; - /** - * Copies an array (or part of an array) to another array. The src array is - * copied to the dst array, beginning at the position specified by - * srcPosition and into the position specified by dstPosition. The number of - * elements to copy is determined by length. Note that copying values - * overwrites existing values in the destination array. To append values - * instead of overwriting them, use concat(). - * - * The simplified version with only two arguments, arrayCopy(src, dst), - * copies an entire array to another of the same size. It is equivalent to - * arrayCopy(src, 0, dst, 0, src.length). - * - * Using this function is far more efficient for copying array data than - * iterating through a for() loop and copying each element individually. - * - * @method arrayCopy - * @deprecated Use arr1.copyWithin(arr2) instead. - * @param {Array} src the source Array - * @param {Integer} srcPosition starting position in the source Array - * @param {Array} dst the destination Array - * @param {Integer} dstPosition starting position in the destination Array - * @param {Integer} length number of Array elements to be copied - * - * @example - *
                - * let src = ['A', 'B', 'C']; - * let dst = [1, 2, 3]; - * let srcPosition = 1; - * let dstPosition = 0; - * let length = 2; - * - * print(src); // ['A', 'B', 'C'] - * print(dst); // [ 1 , 2 , 3 ] - * - * arrayCopy(src, srcPosition, dst, dstPosition, length); - * print(dst); // ['B', 'C', 3] - *
                - */ - /** - * @method arrayCopy - * @deprecated Use arr1.copyWithin(arr2) instead. - * @param {Array} src - * @param {Array} dst - * @param {Integer} [length] - */ - _main.default.prototype.arrayCopy = function (src, srcPosition, dst, dstPosition, length) { - // the index to begin splicing from dst array - var start; - var end; - if (typeof length !== 'undefined') { - end = Math.min(length, src.length); - start = dstPosition; - src = src.slice(srcPosition, end + srcPosition); - } else { - if (typeof dst !== 'undefined') { - // src, dst, length - // rename so we don't get confused - end = dst; - end = Math.min(end, src.length); - } else { - // src, dst - end = src.length; - } - start = 0; - // rename so we don't get confused - dst = srcPosition; - src = src.slice(0, end); - } // Since we are not returning the array and JavaScript is pass by reference - // we must modify the actual values of the array - // instead of reassigning arrays - - Array.prototype.splice.apply(dst, [ - start, - end - ].concat(src)); - }; - /** - * Concatenates two arrays, maps to Array.concat(). Does not modify the - * input arrays. - * - * @method concat - * @deprecated Use arr1.concat(arr2) instead. - * @param {Array} a first Array to concatenate - * @param {Array} b second Array to concatenate - * @return {Array} concatenated array - * - * @example - *
                - * function setup() { - * let arr1 = ['A', 'B', 'C']; - * let arr2 = [1, 2, 3]; - * - * print(arr1); // ['A','B','C'] - * print(arr2); // [1,2,3] - * - * let arr3 = concat(arr1, arr2); - * - * print(arr1); // ['A','B','C'] - * print(arr2); // [1, 2, 3] - * print(arr3); // ['A','B','C', 1, 2, 3] - * } - *
                - */ - _main.default.prototype.concat = function (list0, list1) { - return list0.concat(list1); - }; - /** - * Reverses the order of an array, maps to Array.reverse() - * - * @method reverse - * @deprecated Use array.reverse() instead. - * @param {Array} list Array to reverse - * @return {Array} the reversed list - * @example - *
                - * function setup() { - * let myArray = ['A', 'B', 'C']; - * print(myArray); // ['A','B','C'] - * - * reverse(myArray); - * print(myArray); // ['C','B','A'] - * } - *
                - */ - _main.default.prototype.reverse = function (list) { - return list.reverse(); - }; - /** - * Decreases an array by one element and returns the shortened array, - * maps to Array.pop(). - * - * @method shorten - * @deprecated Use array.pop() instead. - * @param {Array} list Array to shorten - * @return {Array} shortened Array - * @example - *
                - * function setup() { - * let myArray = ['A', 'B', 'C']; - * print(myArray); // ['A', 'B', 'C'] - * let newArray = shorten(myArray); - * print(myArray); // ['A','B','C'] - * print(newArray); // ['A','B'] - * } - *
                - */ - _main.default.prototype.shorten = function (list) { - list.pop(); - return list; - }; - /** - * Randomizes the order of the elements of an array. Implements - * - * Fisher-Yates Shuffle Algorithm. - * - * @method shuffle - * @param {Array} array Array to shuffle - * @param {Boolean} [bool] modify passed array - * @return {Array} shuffled Array - * @example - *
                - * function setup() { - * let regularArr = ['ABC', 'def', createVector(), TAU, Math.E]; - * print(regularArr); - * shuffle(regularArr, true); // force modifications to passed array - * print(regularArr); - * - * // By default shuffle() returns a shuffled cloned array: - * let newArr = shuffle(regularArr); - * print(regularArr); - * print(newArr); - * } - *
                - */ - _main.default.prototype.shuffle = function (arr, bool) { - var isView = ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(arr); - arr = bool || isView ? arr : arr.slice(); - var rnd, - tmp, - idx = arr.length; - while (idx > 1) { - rnd = this.random(0, 1) * idx | 0; - tmp = arr[--idx]; - arr[idx] = arr[rnd]; - arr[rnd] = tmp; - } - return arr; - }; - /** - * Sorts an array of numbers from smallest to largest, or puts an array of - * words in alphabetical order. The original array is not modified; a - * re-ordered array is returned. The count parameter states the number of - * elements to sort. For example, if there are 12 elements in an array and - * count is set to 5, only the first 5 elements in the array will be sorted. - * - * @method sort - * @deprecated Use array.sort() instead. - * @param {Array} list Array to sort - * @param {Integer} [count] number of elements to sort, starting from 0 - * @return {Array} the sorted list - * - * @example - *
                - * function setup() { - * let words = ['banana', 'apple', 'pear', 'lime']; - * print(words); // ['banana', 'apple', 'pear', 'lime'] - * let count = 4; // length of array - * - * words = sort(words, count); - * print(words); // ['apple', 'banana', 'lime', 'pear'] - * } - *
                - *
                - * function setup() { - * let numbers = [2, 6, 1, 5, 14, 9, 8, 12]; - * print(numbers); // [2, 6, 1, 5, 14, 9, 8, 12] - * let count = 5; // Less than the length of the array - * - * numbers = sort(numbers, count); - * print(numbers); // [1,2,5,6,14,9,8,12] - * } - *
                - */ - _main.default.prototype.sort = function (list, count) { - var arr = count ? list.slice(0, Math.min(count, list.length)) : list; - var rest = count ? list.slice(Math.min(count, list.length)) : [ - ]; - if (typeof arr[0] === 'string') { - arr = arr.sort(); - } else { - arr = arr.sort(function (a, b) { - return a - b; - }); - } - return arr.concat(rest); - }; - /** - * Inserts a value or an array of values into an existing array. The first - * parameter specifies the initial array to be modified, and the second - * parameter defines the data to be inserted. The third parameter is an index - * value which specifies the array position from which to insert data. - * (Remember that array index numbering starts at zero, so the first position - * is 0, the second position is 1, and so on.) - * - * @method splice - * @deprecated Use array.splice() instead. - * @param {Array} list Array to splice into - * @param {any} value value to be spliced in - * @param {Integer} position in the array from which to insert data - * @return {Array} the list - * - * @example - *
                - * function setup() { - * let myArray = [0, 1, 2, 3, 4]; - * let insArray = ['A', 'B', 'C']; - * print(myArray); // [0, 1, 2, 3, 4] - * print(insArray); // ['A','B','C'] - * - * splice(myArray, insArray, 3); - * print(myArray); // [0,1,2,'A','B','C',3,4] - * } - *
                - */ - _main.default.prototype.splice = function (list, value, index) { - // note that splice returns spliced elements and not an array - Array.prototype.splice.apply(list, [ - index, - 0 - ].concat(value)); - return list; - }; - /** - * Extracts an array of elements from an existing array. The list parameter - * defines the array from which the elements will be copied, and the start - * and count parameters specify which elements to extract. If no count is - * given, elements will be extracted from the start to the end of the array. - * When specifying the start, remember that the first array element is 0. - * This function does not change the source array. - * - * @method subset - * @deprecated Use array.slice() instead. - * @param {Array} list Array to extract from - * @param {Integer} start position to begin - * @param {Integer} [count] number of values to extract - * @return {Array} Array of extracted elements - * - * @example - *
                - * function setup() { - * let myArray = [1, 2, 3, 4, 5]; - * print(myArray); // [1, 2, 3, 4, 5] - * - * let sub1 = subset(myArray, 0, 3); - * let sub2 = subset(myArray, 2, 2); - * print(sub1); // [1,2,3] - * print(sub2); // [3,4] - * } - *
                - */ - _main.default.prototype.subset = function (list, start, count) { - if (typeof count !== 'undefined') { - return list.slice(start, start + count); - } else { - return list.slice(start, list.length); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array-buffer.constructor': 168, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.object.to-string': 200 - } - ], - 338: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.repeat'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.number.constructor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.repeat'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Data - * @submodule Conversion - * @for p5 - * @requires core - */ - /** - * Converts a string to its floating point representation. The contents of a - * string must resemble a number, or NaN (not a number) will be returned. - * For example, float("1234.56") evaluates to 1234.56, but float("giraffe") - * will return NaN. - * - * When an array of values is passed in, then an array of floats of the same - * length is returned. - * - * @method float - * @param {String} str float string to parse - * @return {Number} floating point representation of string - * @example - *
                - * let str = '20'; - * let diameter = float(str); - * ellipse(width / 2, height / 2, diameter, diameter); - * describe('20-by-20 white ellipse in the center of the canvas'); - *
                - *
                - * print(float('10.31')); // 10.31 - * print(float('Infinity')); // Infinity - * print(float('-Infinity')); // -Infinity - *
                - */ - - _main.default.prototype.float = function (str) { - if (str instanceof Array) { - return str.map(parseFloat); - } - return parseFloat(str); - }; - /** - * Converts a boolean, string, or float to its integer representation. - * When an array of values is passed in, then an int array of the same length - * is returned. - * - * @method int - * @param {String|Boolean|Number} n value to parse - * @param {Integer} [radix] the radix to convert to (default: 10) - * @return {Number} integer representation of value - * - * @example - *
                - * print(int('10')); // 10 - * print(int(10.31)); // 10 - * print(int(-10)); // -10 - * print(int(true)); // 1 - * print(int(false)); // 0 - * print(int([false, true, '10.3', 9.8])); // [0, 1, 10, 9] - * print(int(Infinity)); // Infinity - * print(int('-Infinity')); // -Infinity - *
                - */ - /** - * @method int - * @param {Array} ns values to parse - * @param {Integer} [radix] - * @return {Number[]} integer representation of values - */ - _main.default.prototype.int = function (n) { - var radix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; - if (n === Infinity || n === 'Infinity') { - return Infinity; - } else if (n === - Infinity || n === '-Infinity') { - return - Infinity; - } else if (typeof n === 'string') { - return parseInt(n, radix); - } else if (typeof n === 'number') { - return n | 0; - } else if (typeof n === 'boolean') { - return n ? 1 : 0; - } else if (n instanceof Array) { - return n.map(function (n) { - return _main.default.prototype.int(n, radix); - }); - } - }; - /** - * Converts a boolean, string or number to its string representation. - * When an array of values is passed in, then an array of strings of the same - * length is returned. - * - * @method str - * @param {String|Boolean|Number|Array} n value to parse - * @return {String} string representation of value - * @example - *
                - * print(str('10')); // "10" - * print(str(10.31)); // "10.31" - * print(str(-10)); // "-10" - * print(str(true)); // "true" - * print(str(false)); // "false" - * print(str([true, '10.3', 9.8])); // [ "true", "10.3", "9.8" ] - *
                - */ - _main.default.prototype.str = function (n) { - if (n instanceof Array) { - return n.map(_main.default.prototype.str); - } else { - return String(n); - } - }; - /** - * Converts a number or string to its boolean representation. - * For a number, any non-zero value (positive or negative) evaluates to true, - * while zero evaluates to false. For a string, the value "true" evaluates to - * true, while any other value evaluates to false. When an array of number or - * string values is passed in, then a array of booleans of the same length is - * returned. - * - * @method boolean - * @param {String|Boolean|Number|Array} n value to parse - * @return {Boolean} boolean representation of value - * @example - *
                - * print(boolean(0)); // false - * print(boolean(1)); // true - * print(boolean('true')); // true - * print(boolean('abcd')); // false - * print(boolean([0, 12, 'true'])); // [false, true, true] - *
                - */ - _main.default.prototype.boolean = function (n) { - if (typeof n === 'number') { - return n !== 0; - } else if (typeof n === 'string') { - return n.toLowerCase() === 'true'; - } else if (typeof n === 'boolean') { - return n; - } else if (n instanceof Array) { - return n.map(_main.default.prototype.boolean); - } - }; - /** - * Converts a number, string representation of a number, or boolean to its byte - * representation. A byte can be only a whole number between -128 and 127, so - * when a value outside of this range is converted, it wraps around to the - * corresponding byte representation. When an array of number, string or boolean - * values is passed in, then an array of bytes the same length is returned. - * - * @method byte - * @param {String|Boolean|Number} n value to parse - * @return {Number} byte representation of value - * - * @example - *
                - * print(byte(127)); // 127 - * print(byte(128)); // -128 - * print(byte(23.4)); // 23 - * print(byte('23.4')); // 23 - * print(byte('hello')); // NaN - * print(byte(true)); // 1 - * print(byte([0, 255, '100'])); // [0, -1, 100] - *
                - */ - /** - * @method byte - * @param {Array} ns values to parse - * @return {Number[]} array of byte representation of values - */ - _main.default.prototype.byte = function (n) { - var nn = _main.default.prototype.int(n, 10); - if (typeof nn === 'number') { - return (nn + 128) % 256 - 128; - } else if (nn instanceof Array) { - return nn.map(_main.default.prototype.byte); - } - }; - /** - * Converts a number or string to its corresponding single-character - * string representation. If a string parameter is provided, it is first - * parsed as an integer and then translated into a single-character string. - * When an array of number or string values is passed in, then an array of - * single-character strings of the same length is returned. - * - * @method char - * @param {String|Number} n value to parse - * @return {String} string representation of value - * - * @example - *
                - * print(char(65)); // "A" - * print(char('65')); // "A" - * print(char([65, 66, 67])); // [ "A", "B", "C" ] - * print(join(char([65, 66, 67]), '')); // "ABC" - *
                - */ - /** - * @method char - * @param {Array} ns values to parse - * @return {String[]} array of string representation of values - */ - _main.default.prototype.char = function (n) { - if (typeof n === 'number' && !isNaN(n)) { - return String.fromCharCode(n); - } else if (n instanceof Array) { - return n.map(_main.default.prototype.char); - } else if (typeof n === 'string') { - return _main.default.prototype.char(parseInt(n, 10)); - } - }; - /** - * Converts a single-character string to its corresponding integer - * representation. When an array of single-character string values is passed - * in, then an array of integers of the same length is returned. - * - * @method unchar - * @param {String} n value to parse - * @return {Number} integer representation of value - * - * @example - *
                - * print(unchar('A')); // 65 - * print(unchar(['A', 'B', 'C'])); // [ 65, 66, 67 ] - * print(unchar(split('ABC', ''))); // [ 65, 66, 67 ] - *
                - */ - /** - * @method unchar - * @param {Array} ns values to parse - * @return {Number[]} integer representation of values - */ - _main.default.prototype.unchar = function (n) { - if (typeof n === 'string' && n.length === 1) { - return n.charCodeAt(0); - } else if (n instanceof Array) { - return n.map(_main.default.prototype.unchar); - } - }; - /** - * Converts a number to a string in its equivalent hexadecimal notation. If a - * second parameter is passed, it is used to set the number of characters to - * generate in the hexadecimal notation. When an array is passed in, an - * array of strings in hexadecimal notation of the same length is returned. - * - * @method hex - * @param {Number} n value to parse - * @param {Number} [digits] - * @return {String} hexadecimal string representation of value - * - * @example - *
                - * print(hex(255)); // "000000FF" - * print(hex(255, 6)); // "0000FF" - * print(hex([0, 127, 255], 6)); // [ "000000", "00007F", "0000FF" ] - * print(Infinity); // "FFFFFFFF" - * print(-Infinity); // "00000000" - *
                - */ - /** - * @method hex - * @param {Number[]} ns array of values to parse - * @param {Number} [digits] - * @return {String[]} hexadecimal string representation of values - */ - _main.default.prototype.hex = function (n, digits) { - digits = digits === undefined || digits === null ? digits = 8 : digits; - if (n instanceof Array) { - return n.map(function (n) { - return _main.default.prototype.hex(n, digits); - }); - } else if (n === Infinity || n === - Infinity) { - var c = n === Infinity ? 'F' : '0'; - return c.repeat(digits); - } else if (typeof n === 'number') { - if (n < 0) { - n = 4294967295 + n + 1; - } - var hex = Number(n).toString(16).toUpperCase(); - while (hex.length < digits) { - hex = '0'.concat(hex); - } - if (hex.length >= digits) { - hex = hex.substring(hex.length - digits, hex.length); - } - return hex; - } - }; - /** - * Converts a string representation of a hexadecimal number to its equivalent - * integer value. When an array of strings in hexadecimal notation is passed - * in, an array of integers of the same length is returned. - * - * @method unhex - * @param {String} n value to parse - * @return {Number} integer representation of hexadecimal value - * - * @example - *
                - * print(unhex('A')); // 10 - * print(unhex('FF')); // 255 - * print(unhex(['FF', 'AA', '00'])); // [ 255, 170, 0 ] - *
                - */ - /** - * @method unhex - * @param {Array} ns values to parse - * @return {Number[]} integer representations of hexadecimal value - */ - _main.default.prototype.unhex = function (n) { - if (n instanceof Array) { - return n.map(_main.default.prototype.unhex); - } else { - return parseInt('0x'.concat(n), 16); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.number.constructor': 191, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.repeat': 213 - } - ], - 339: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.pad-start'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.array.filter'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.constructor'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.pad-start'); - _dereq_('core-js/modules/es.string.replace'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - _dereq_('../core/friendly_errors/validate_params'); - _dereq_('../core/friendly_errors/file_errors'); - _dereq_('../core/friendly_errors/fes_core'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError('Invalid attempt to destructure non-iterable instance'); - } - function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === '[object Arguments]')) { - return; - } - var _arr = [ - ]; - var _n = true; - var _d = false; - var _e = undefined; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i['return'] != null) _i['return'](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } /** - * @module Data - * @submodule String Functions - * @for p5 - * @requires core - */ - //return p5; //LM is this a mistake? - /** - * Combines an array of Strings into one String, each separated by the - * character(s) used for the separator parameter. To join arrays of ints or - * floats, it's necessary to first convert them to Strings using nf() or - * nfs(). - * - * @method join - * @param {Array} list array of Strings to be joined - * @param {String} separator String to be placed between each item - * @return {String} joined String - * @example - *
                - * - * let array = ['Hello', 'world!']; - * let separator = ' '; - * let message = join(array, separator); - * text(message, 5, 50); - * describe('“Hello world!” displayed middle left of canvas.'); - * - *
                - */ - - _main.default.prototype.join = function (list, separator) { - _main.default._validateParameters('join', arguments); - return list.join(separator); - }; - /** - * This function is used to apply a regular expression to a piece of text, - * and return matching groups (elements found inside parentheses) as a - * String array. If there are no matches, a null value will be returned. - * If no groups are specified in the regular expression, but the sequence - * matches, an array of length 1 (with the matched text as the first element - * of the array) will be returned. - * - * To use the function, first check to see if the result is null. If the - * result is null, then the sequence did not match at all. If the sequence - * did match, an array is returned. - * - * If there are groups (specified by sets of parentheses) in the regular - * expression, then the contents of each will be returned in the array. - * Element [0] of a regular expression match returns the entire matching - * string, and the match groups start at element [1] (the first group is [1], - * the second [2], and so on). - * - * @method match - * @param {String} str the String to be searched - * @param {String} regexp the regexp to be used for matching - * @return {String[]} Array of Strings found - * @example - *
                - * - * let string = 'Hello p5js*!'; - * let regexp = 'p5js\\*'; - * let m = match(string, regexp); - * text(m, 5, 50); - * describe('“p5js*” displayed middle left of canvas.'); - * - *
                - */ - _main.default.prototype.match = function (str, reg) { - _main.default._validateParameters('match', arguments); - return str.match(reg); - }; - /** - * This function is used to apply a regular expression to a piece of text, - * and return a list of matching groups (elements found inside parentheses) - * as a two-dimensional String array. If there are no matches, a null value - * will be returned. If no groups are specified in the regular expression, - * but the sequence matches, a two dimensional array is still returned, but - * the second dimension is only of length one. - * - * To use the function, first check to see if the result is null. If the - * result is null, then the sequence did not match at all. If the sequence - * did match, a 2D array is returned. - * - * If there are groups (specified by sets of parentheses) in the regular - * expression, then the contents of each will be returned in the array. - * Assuming a loop with counter variable i, element [i][0] of a regular - * expression match returns the entire matching string, and the match groups - * start at element [i][1] (the first group is [i][1], the second [i][2], - * and so on). - * - * @method matchAll - * @param {String} str the String to be searched - * @param {String} regexp the regexp to be used for matching - * @return {String[]} 2d Array of Strings found - * @example - *
                - * - * let string = 'Hello p5js*! Hello world!'; - * let regexp = 'Hello'; - * matchAll(string, regexp); - * - *
                - */ - _main.default.prototype.matchAll = function (str, reg) { - _main.default._validateParameters('matchAll', arguments); - var re = new RegExp(reg, 'g'); - var match = re.exec(str); - var matches = [ - ]; - while (match !== null) { - matches.push(match); - // matched text: match[0] - // match start: match.index - // capturing group n: match[n] - match = re.exec(str); - } - return matches; - }; - /** - * Utility function for formatting numbers into strings. There are two - * versions: one for formatting floats, and one for formatting ints. - * - * The values for the digits, left, and right parameters should always - * be positive integers. - * - * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter - * if greater than the current length of the number. - * - * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 - * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than - * the result will be 123.200. - * - * @method nf - * @param {Number|String} num the Number to format - * @param {Integer|String} [left] number of digits to the left of the - * decimal point - * @param {Integer|String} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                - * - * function setup() { - * background(200); - * let num1 = 321; - * let num2 = -1321; - * - * noStroke(); - * fill(0); - * textSize(16); - * - * text(nf(num1, 4, 2), 10, 30); - * text(nf(num2, 4, 2), 10, 80); - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“0321.00” middle top, “-1321.00” middle bottom canvas'); - * } - * - *
                - */ - /** - * @method nf - * @param {Array} nums the Numbers to format - * @param {Integer|String} [left] - * @param {Integer|String} [right] - * @return {String[]} formatted Strings - */ - _main.default.prototype.nf = function (nums, left, right) { - _main.default._validateParameters('nf', arguments); - if (nums instanceof Array) { - return nums.map(function (x) { - return doNf(x, left, right); - }); - } else { - var typeOfFirst = Object.prototype.toString.call(nums); - if (typeOfFirst === '[object Arguments]') { - if (nums.length === 3) { - return this.nf(nums[0], nums[1], nums[2]); - } else if (nums.length === 2) { - return this.nf(nums[0], nums[1]); - } else { - return this.nf(nums[0]); - } - } else { - return doNf(nums, left, right); - } - } - }; - function doNf(num, left, right) { - var _num$toString$split = num.toString().split('.'), - _num$toString$split2 = _slicedToArray(_num$toString$split, 2), - leftPart = _num$toString$split2[0], - rightPart = _num$toString$split2[1]; - if (typeof right === 'undefined') { - leftPart = leftPart.padStart(left, '0'); - return rightPart ? leftPart + '.' + rightPart : leftPart; - } else { - var roundedOff = num.toFixed(right); - var _roundedOff$toString$ = roundedOff.toString().split('.'); - var _roundedOff$toString$2 = _slicedToArray(_roundedOff$toString$, 2); - leftPart = _roundedOff$toString$2[0]; - rightPart = _roundedOff$toString$2[1]; - leftPart = leftPart.padStart(left, '0'); - if (typeof rightPart === 'undefined') { - return leftPart; - } else { - return leftPart + '.' + rightPart; - } - } - } /** - * Utility function for formatting numbers into strings and placing - * appropriate commas to mark units of 1000. There are two versions: one - * for formatting ints, and one for formatting an array of ints. The value - * for the right parameter should always be a positive integer. - * - * @method nfc - * @param {Number|String} num the Number to format - * @param {Integer|String} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                - * - * function setup() { - * background(200); - * let num = 11253106.115; - * let numArr = [1, 1, 2]; - * - * noStroke(); - * fill(0); - * textSize(12); - * - * // Draw formatted numbers - * text(nfc(num, 4), 10, 30); - * text(nfc(numArr, 2), 10, 80); - * - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“11,253,106.115” top middle and “1.00,1.00,2.00” displayed bottom mid'); - * } - * - *
                - */ - /** - * @method nfc - * @param {Array} nums the Numbers to format - * @param {Integer|String} [right] - * @return {String[]} formatted Strings - */ - - _main.default.prototype.nfc = function (num, right) { - _main.default._validateParameters('nfc', arguments); - if (num instanceof Array) { - return num.map(function (x) { - return doNfc(x, right); - }); - } else { - return doNfc(num, right); - } - }; - function doNfc(num, right) { - num = num.toString(); - var dec = num.indexOf('.'); - var rem = dec !== - 1 ? num.substring(dec) : ''; - var n = dec !== - 1 ? num.substring(0, dec) : num; - n = n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); - if (right === 0) { - rem = ''; - } else if (typeof right !== 'undefined') { - if (right > rem.length) { - rem += dec === - 1 ? '.' : ''; - var len = right - rem.length + 1; - for (var i = 0; i < len; i++) { - rem += '0'; - } - } else { - rem = rem.substring(0, right + 1); - } - } - return n + rem; - } /** - * Utility function for formatting numbers into strings. Similar to nf() but - * puts a "+" in front of positive numbers and a "-" in front of negative - * numbers. There are two versions: one for formatting floats, and one for - * formatting ints. The values for left, and right parameters - * should always be positive integers. - * - * @method nfp - * @param {Number} num the Number to format - * @param {Integer} [left] number of digits to the left of the decimal - * point - * @param {Integer} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                - * - * function setup() { - * background(200); - * let num1 = 11253106.115; - * let num2 = -11253106.115; - * - * noStroke(); - * fill(0); - * textSize(12); - * - * // Draw formatted numbers - * text(nfp(num1, 4, 2), 10, 30); - * text(nfp(num2, 4, 2), 10, 80); - * - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“+11253106.11” top middle and “-11253106.11” displayed bottom middle'); - * } - * - *
                - */ - /** - * @method nfp - * @param {Number[]} nums the Numbers to format - * @param {Integer} [left] - * @param {Integer} [right] - * @return {String[]} formatted Strings - */ - - _main.default.prototype.nfp = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('nfp', args); - var nfRes = _main.default.prototype.nf.apply(this, args); - if (nfRes instanceof Array) { - return nfRes.map(addNfp); - } else { - return addNfp(nfRes); - } - }; - function addNfp(num) { - return parseFloat(num) > 0 ? '+'.concat(num.toString()) : num.toString(); - } /** - * Utility function for formatting numbers into strings. Similar to nf() but - * puts an additional "_" (space) in front of positive numbers just in case to align it with negative - * numbers which includes "-" (minus) sign. - * - * The main usecase of nfs() can be seen when one wants to align the digits (place values) of a non-negative - * number with some negative number (See the example to get a clear picture). - * There are two versions: one for formatting float, and one for formatting int. - * - * The values for the digits, left, and right parameters should always be positive integers. - * - * (IMP): The result on the canvas basically the expected alignment can vary based on the typeface you are using. - * - * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter - * if greater than the current length of the number. - * - * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 - * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than - * the result will be 123.200. - * - * @method nfs - * @param {Number} num the Number to format - * @param {Integer} [left] number of digits to the left of the decimal - * point - * @param {Integer} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                - * - * function setup() { - * background(200); - * let num1 = 321; - * let num2 = -1321; - * - * noStroke(); - * fill(0); - * textSize(16); - * - * // nfs() aligns num1 (positive number) with num2 (negative number) by - * // adding a blank space in front of the num1 (positive number) - * // [left = 4] in num1 add one 0 in front, to align the digits with num2 - * // [right = 2] in num1 and num2 adds two 0's after both numbers - * // To see the differences check the example of nf() too. - * text(nfs(num1, 4, 2), 10, 30); - * text(nfs(num2, 4, 2), 10, 80); - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“0321.00” top middle and “-1321.00” displayed bottom middle'); - * } - * - *
                - */ - /** - * @method nfs - * @param {Array} nums the Numbers to format - * @param {Integer} [left] - * @param {Integer} [right] - * @return {String[]} formatted Strings - */ - - _main.default.prototype.nfs = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('nfs', args); - var nfRes = _main.default.prototype.nf.apply(this, args); - if (nfRes instanceof Array) { - return nfRes.map(addNfs); - } else { - return addNfs(nfRes); - } - }; - function addNfs(num) { - return parseFloat(num) >= 0 ? ' '.concat(num.toString()) : num.toString(); - } /** - * The split() function maps to String.split(), it breaks a String into - * pieces using a character or string as the delimiter. The delim parameter - * specifies the character or characters that mark the boundaries between - * each piece. A String[] array is returned that contains each of the pieces. - * - * The splitTokens() function works in a similar fashion, except that it - * splits using a range of characters instead of a specific character or - * sequence. - * - * @method split - * @param {String} value the String to be split - * @param {String} delim the String used to separate the data - * @return {String[]} Array of Strings - * @example - *
                - * - * let names = 'Pat,Xio,Alex'; - * let splitString = split(names, ','); - * text(splitString[0], 5, 30); - * text(splitString[1], 5, 50); - * text(splitString[2], 5, 70); - * describe('“Pat” top left, “Xio” mid left, and “Alex” displayed bottom left'); - * - *
                - */ - - _main.default.prototype.split = function (str, delim) { - _main.default._validateParameters('split', arguments); - return str.split(delim); - }; - /** - * The splitTokens() function splits a String at one or many character - * delimiters or "tokens." The delim parameter specifies the character or - * characters to be used as a boundary. - * - * If no delim characters are specified, any whitespace character is used to - * split. Whitespace characters include tab (\t), line feed (\n), carriage - * return (\r), form feed (\f), and space. - * - * @method splitTokens - * @param {String} value the String to be split - * @param {String} [delim] list of individual Strings that will be used as - * separators - * @return {String[]} Array of Strings - * @example - *
                - * - * function setup() { - * let myStr = 'Mango, Banana, Lime'; - * let myStrArr = splitTokens(myStr, ','); - * - * print(myStrArr); // prints : ["Mango"," Banana"," Lime"] - * } - * - *
                - */ - _main.default.prototype.splitTokens = function (value, delims) { - _main.default._validateParameters('splitTokens', arguments); - var d; - if (typeof delims !== 'undefined') { - var str = delims; - var sqc = /\]/g.exec(str); - var sqo = /\[/g.exec(str); - if (sqo && sqc) { - str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); - sqo = /\[/g.exec(str); - str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); - d = new RegExp('[\\['.concat(str, '\\]]'), 'g'); - } else if (sqc) { - str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); - d = new RegExp('['.concat(str, '\\]]'), 'g'); - } else if (sqo) { - str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); - d = new RegExp('['.concat(str, '\\[]'), 'g'); - } else { - d = new RegExp('['.concat(str, ']'), 'g'); - } - } else { - d = /\s/g; - } - return value.split(d).filter(function (n) { - return n; - }); - }; - /** - * Removes whitespace characters from the beginning and end of a String. In - * addition to standard whitespace characters such as space, carriage return, - * and tab, this function also removes the Unicode "nbsp" character. - * - * @method trim - * @param {String} str a String to be trimmed - * @return {String} a trimmed String - * - * @example - *
                - * - * let string = trim(' No new lines\n '); - * text(string + ' here', 2, 50); - * describe('“No new lines here” displayed center canvas'); - * - *
                - */ - /** - * @method trim - * @param {Array} strs an Array of Strings to be trimmed - * @return {String[]} an Array of trimmed Strings - */ - _main.default.prototype.trim = function (str) { - _main.default._validateParameters('trim', arguments); - if (str instanceof Array) { - return str.map(this.trim); - } else { - return str.trim(); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/friendly_errors/fes_core': 289, - '../core/friendly_errors/file_errors': 290, - '../core/friendly_errors/validate_params': 293, - '../core/main': 298, - 'core-js/modules/es.array.filter': 173, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.number.to-fixed': 193, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.constructor': 204, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.match': 211, - 'core-js/modules/es.string.pad-start': 212, - 'core-js/modules/es.string.replace': 214, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.trim': 219, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 340: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module IO - * @submodule Time & Date - * @for p5 - * @requires core - */ - /** - * p5.js communicates with the clock on your computer. The day() function - * returns the current day as a value from 1 - 31. - * - * @method day - * @return {Integer} the current day - * @example - *
                - * - * let d = day(); - * text('Current day: \n' + d, 5, 50); - * describe('Current day is displayed'); - * - *
                - */ - - _main.default.prototype.day = function () { - return new Date().getDate(); - }; - /** - * p5.js communicates with the clock on your computer. The hour() function - * returns the current hour as a value from 0 - 23. - * - * @method hour - * @return {Integer} the current hour - * @example - *
                - * - * let h = hour(); - * text('Current hour:\n' + h, 5, 50); - * describe('Current hour is displayed'); - * - *
                - */ - _main.default.prototype.hour = function () { - return new Date().getHours(); - }; - /** - * p5.js communicates with the clock on your computer. The minute() function - * returns the current minute as a value from 0 - 59. - * - * @method minute - * @return {Integer} the current minute - * @example - *
                - * - * let m = minute(); - * text('Current minute: \n' + m, 5, 50); - * describe('Current minute is displayed'); - * - *
                - */ - _main.default.prototype.minute = function () { - return new Date().getMinutes(); - }; - /** - * Returns the number of milliseconds (thousandths of a second) since - * starting the sketch (when `setup()` is called). This information is often - * used for timing events and animation sequences. - * - * @method millis - * @return {Number} the number of milliseconds since starting the sketch - * @example - *
                - * - * let millisecond = millis(); - * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); - * describe('number of milliseconds since sketch has started displayed'); - * - *
                - */ - _main.default.prototype.millis = function () { - if (this._millisStart === - 1) { - // Sketch has not started - return 0; - } else { - return window.performance.now() - this._millisStart; - } - }; - /** - * p5.js communicates with the clock on your computer. The month() function - * returns the current month as a value from 1 - 12. - * - * @method month - * @return {Integer} the current month - * @example - *
                - * - * let m = month(); - * text('Current month: \n' + m, 5, 50); - * describe('Current month is displayed'); - * - *
                - */ - _main.default.prototype.month = function () { - //January is 0! - return new Date().getMonth() + 1; - }; - /** - * p5.js communicates with the clock on your computer. The second() function - * returns the current second as a value from 0 - 59. - * - * @method second - * @return {Integer} the current second - * @example - *
                - * - * let s = second(); - * text('Current second: \n' + s, 5, 50); - * describe('Current second is displayed'); - * - *
                - */ - _main.default.prototype.second = function () { - return new Date().getSeconds(); - }; - /** - * p5.js communicates with the clock on your computer. The year() function - * returns the current year as an integer (2014, 2015, 2016, etc). - * - * @method year - * @return {Integer} the current year - * @example - *
                - * - * let y = year(); - * text('Current year: \n' + y, 5, 50); - * describe('Current year is displayed'); - * - *
                - */ - _main.default.prototype.year = function () { - return new Date().getFullYear(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298 - } - ], - 341: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.math.sign'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.math.sign'); - _dereq_('core-js/modules/es.number.to-fixed'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - _dereq_('./p5.Geometry'); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Shape - * @submodule 3D Primitives - * @for p5 - * @requires core - * @requires p5.Geometry - */ - /** - * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added - * to the geometry and then returned when - * endGeometry() is called. One can also use - * buildGeometry() to pass a function that - * draws shapes. - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them upfront with `beginGeometry()` and `endGeometry()` and then - * drawing that will run faster than repeatedly drawing the individual pieces. - * - * @method beginGeometry - * - * @example - *
                - * - * let shapes; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * makeShapes(); - * } - * - * function makeShapes() { - * beginGeometry(); - * scale(0.18); - * - * push(); - * translate(100, -50); - * scale(0.5); - * rotateX(PI/4); - * cone(); - * pop(); - * cone(); - * - * beginShape(); - * vertex(-20, -50); - * quadraticVertex( - * -40, -70, - * 0, -60 - * ); - * endShape(); - * - * beginShape(TRIANGLE_STRIP); - * for (let y = 20; y <= 60; y += 10) { - * for (let x of [20, 60]) { - * vertex(x, y); - * } - * } - * endShape(); - * - * beginShape(); - * vertex(-100, -120); - * vertex(-120, -110); - * vertex(-105, -100); - * endShape(); - * - * shapes = endGeometry(); - * } - * - * function draw() { - * background(255); - * lights(); - * orbitControl(); - * model(shapes); - * } - * - *
                - * - * @alt - * A series of different flat, curved, and 3D shapes floating in space. - */ - - _main.default.prototype.beginGeometry = function () { - return this._renderer.beginGeometry(); - }; - /** - * Finishes creating a new p5.Geometry that was - * started using beginGeometry(). One can also - * use buildGeometry() to pass a function that - * draws shapes. - * - * @method endGeometry - * @returns {p5.Geometry} The model that was built. - */ - _main.default.prototype.endGeometry = function () { - return this._renderer.endGeometry(); - }; - /** - * Creates a new p5.Geometry that contains all - * the shapes drawn in a provided callback function. The returned combined shape - * can then be drawn all at once using model(). - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them with `buildGeometry()` once and then drawing that will run - * faster than repeatedly drawing the individual pieces. - * - * One can also draw shapes directly between - * beginGeometry() and - * endGeometry() instead of using a callback - * function. - * - * @method buildGeometry - * @param {Function} callback A function that draws shapes. - * @returns {p5.Geometry} The model that was built from the callback function. - * - * @example - *
                - * - * let particles; - * let button; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * button = createButton('New'); - * button.mousePressed(makeParticles); - * makeParticles(); - * } - * - * function makeParticles() { - * if (particles) freeGeometry(particles); - * - * particles = buildGeometry(() => { - * for (let i = 0; i < 60; i++) { - * push(); - * translate( - * randomGaussian(0, 20), - * randomGaussian(0, 20), - * randomGaussian(0, 20) - * ); - * sphere(5); - * pop(); - * } - * }); - * } - * - * function draw() { - * background(255); - * noStroke(); - * lights(); - * orbitControl(); - * model(particles); - * } - * - *
                - * - * @alt - * A cluster of spheres. - */ - _main.default.prototype.buildGeometry = function (callback) { - return this._renderer.buildGeometry(callback); - }; - /** - * Clears the resources of a model to free up browser memory. A model whose - * resources have been cleared can still be drawn, but the first time it is - * drawn again, it might take longer. - * - * This method works on models generated with - * buildGeometry() as well as those loaded - * from loadModel(). - * - * @method freeGeometry - * @param {p5.Geometry} geometry The geometry whose resources should be freed - */ - _main.default.prototype.freeGeometry = function (geometry) { - this._renderer._freeBuffers(geometry.gid); - }; - /** - * Draw a plane with given a width and height - * @method plane - * @param {Number} [width] width of the plane - * @param {Number} [height] height of the plane - * @param {Integer} [detailX] Optional number of triangle - * subdivisions in x-dimension - * @param {Integer} [detailY] Optional number of triangle - * subdivisions in y-dimension - * @chainable - * @example - *
                - * - * // draw a plane - * // with width 50 and height 50 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white plane with black wireframe lines'); - * } - * - * function draw() { - * background(200); - * plane(50, 50); - * } - * - *
                - * - * @alt - * Nothing displayed on canvas - * Rotating interior view of a box with sides that change color. - * 3d red and green gradient. - * Rotating interior view of a cylinder with sides that change color. - * Rotating view of a cylinder with sides that change color. - * 3d red and green gradient. - * rotating view of a multi-colored cylinder with concave sides. - */ - _main.default.prototype.plane = function (width, height, detailX, detailY) { - this._assert3d('plane'); - _main.default._validateParameters('plane', arguments); - if (typeof width === 'undefined') { - width = 50; - } - if (typeof height === 'undefined') { - height = width; - } - if (typeof detailX === 'undefined') { - detailX = 1; - } - if (typeof detailY === 'undefined') { - detailY = 1; - } - var gId = 'plane|'.concat(detailX, '|').concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _plane = function _plane() { - var u, - v, - p; - for (var i = 0; i <= this.detailY; i++) { - v = i / this.detailY; - for (var j = 0; j <= this.detailX; j++) { - u = j / this.detailX; - p = new _main.default.Vector(u - 0.5, v - 0.5, 0); - this.vertices.push(p); - this.uvs.push(u, v); - } - } - }; - var planeGeom = new _main.default.Geometry(detailX, detailY, _plane); - planeGeom.computeFaces().computeNormals(); - if (detailX <= 1 && detailY <= 1) { - planeGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log('Cannot draw stroke on plane objects with more' + ' than 1 detailX or 1 detailY'); - } - this._renderer.createBuffers(gId, planeGeom); - } - this._renderer.drawBuffersScaled(gId, width, height, 1); - return this; - }; - /** - * Draw a box with given width, height and depth - * @method box - * @param {Number} [width] width of the box - * @param {Number} [height] height of the box - * @param {Number} [depth] depth of the box - * @param {Integer} [detailX] Optional number of triangle - * subdivisions in x-dimension - * @param {Integer} [detailY] Optional number of triangle - * subdivisions in y-dimension - * @chainable - * @example - *
                - * - * // draw a spinning box - * // with width, height and depth of 50 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white box rotating in 3D space'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(50); - * } - * - *
                - */ - _main.default.prototype.box = function (width, height, depth, detailX, detailY) { - this._assert3d('box'); - _main.default._validateParameters('box', arguments); - if (typeof width === 'undefined') { - width = 50; - } - if (typeof height === 'undefined') { - height = width; - } - if (typeof depth === 'undefined') { - depth = height; - } - var perPixelLighting = this._renderer.attributes && this._renderer.attributes.perPixelLighting; - if (typeof detailX === 'undefined') { - detailX = perPixelLighting ? 1 : 4; - } - if (typeof detailY === 'undefined') { - detailY = perPixelLighting ? 1 : 4; - } - var gId = 'box|'.concat(detailX, '|').concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _box = function _box() { - var _this = this; - var cubeIndices = [ - [0, - 4, - 2, - 6], - // -1, 0, 0],// -x - [ - 1, - 3, - 5, - 7 - ], - // +1, 0, 0],// +x - [ - 0, - 1, - 4, - 5 - ], - // 0, -1, 0],// -y - [ - 2, - 6, - 3, - 7 - ], - // 0, +1, 0],// +y - [ - 0, - 2, - 1, - 3 - ], - // 0, 0, -1],// -z - [ - 4, - 5, - 6, - 7 - ] // 0, 0, +1] // +z - ]; - //using custom edges - //to avoid diagonal stroke lines across face of box - this.edges = [ - [0, - 1], - [ - 1, - 3 - ], - [ - 3, - 2 - ], - [ - 6, - 7 - ], - [ - 8, - 9 - ], - [ - 9, - 11 - ], - [ - 14, - 15 - ], - [ - 16, - 17 - ], - [ - 17, - 19 - ], - [ - 18, - 19 - ], - [ - 20, - 21 - ], - [ - 22, - 23 - ] - ]; - cubeIndices.forEach(function (cubeIndex, i) { - var v = i * 4; - for (var j = 0; j < 4; j++) { - var d = cubeIndex[j]; - //inspired by lightgl: - //https://github.com/evanw/lightgl.js - //octants:https://en.wikipedia.org/wiki/Octant_(solid_geometry) - var octant = new _main.default.Vector(((d & 1) * 2 - 1) / 2, ((d & 2) - 1) / 2, ((d & 4) / 2 - 1) / 2); - _this.vertices.push(octant); - _this.uvs.push(j & 1, (j & 2) / 2); - } - _this.faces.push([v, - v + 1, - v + 2]); - _this.faces.push([v + 2, - v + 1, - v + 3]); - }); - }; - var boxGeom = new _main.default.Geometry(detailX, detailY, _box); - boxGeom.computeNormals(); - if (detailX <= 4 && detailY <= 4) { - boxGeom._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log('Cannot draw stroke on box objects with more' + ' than 4 detailX or 4 detailY'); - } //initialize our geometry buffer with - //the key val pair: - //geometry Id, Geom object - - this._renderer.createBuffers(gId, boxGeom); - } - this._renderer.drawBuffersScaled(gId, width, height, depth); - return this; - }; - /** - * Draw a sphere with given radius. - * - * DetailX and detailY determines the number of subdivisions in the x-dimension - * and the y-dimension of a sphere. More subdivisions make the sphere seem - * smoother. The recommended maximum values are both 24. Using a value greater - * than 24 may cause a warning or slow down the browser. - * @method sphere - * @param {Number} [radius] radius of circle - * @param {Integer} [detailX] optional number of subdivisions in x-dimension - * @param {Integer} [detailY] optional number of subdivisions in y-dimension - * - * @chainable - * @example - *
                - * - * // draw a sphere with radius 40 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white sphere with black wireframe lines'); - * } - * - * function draw() { - * background(205, 102, 94); - * sphere(40); - * } - * - *
                - * - * @example - *
                - * - * let detailX; - * // slide to see how detailX works - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 24, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * sphere(40, detailX.value(), 16); - * } - * - *
                - * - * @example - *
                - * - * let detailY; - * // slide to see how detailY works - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(3, 16, 3); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * sphere(40, 16, detailY.value()); - * } - * - *
                - */ - _main.default.prototype.sphere = function (radius, detailX, detailY) { - this._assert3d('sphere'); - _main.default._validateParameters('sphere', arguments); - if (typeof radius === 'undefined') { - radius = 50; - } - if (typeof detailX === 'undefined') { - detailX = 24; - } - if (typeof detailY === 'undefined') { - detailY = 16; - } - this.ellipsoid(radius, radius, radius, detailX, detailY); - return this; - }; - /** - * @private - * Helper function for creating both cones and cylinders - * Will only generate well-defined geometry when bottomRadius, height > 0 - * and topRadius >= 0 - * If topRadius == 0, topCap should be false - */ - var _truncatedCone = function _truncatedCone(bottomRadius, topRadius, height, detailX, detailY, bottomCap, topCap) { - bottomRadius = bottomRadius <= 0 ? 1 : bottomRadius; - topRadius = topRadius < 0 ? 0 : topRadius; - height = height <= 0 ? bottomRadius : height; - detailX = detailX < 3 ? 3 : detailX; - detailY = detailY < 1 ? 1 : detailY; - bottomCap = bottomCap === undefined ? true : bottomCap; - topCap = topCap === undefined ? topRadius !== 0 : topCap; - var start = bottomCap ? - 2 : 0; - var end = detailY + (topCap ? 2 : 0); - //ensure constant slant for interior vertex normals - var slant = Math.atan2(bottomRadius - topRadius, height); - var sinSlant = Math.sin(slant); - var cosSlant = Math.cos(slant); - var yy, - ii, - jj; - for (yy = start; yy <= end; ++yy) { - var v = yy / detailY; - var y = height * v; - var ringRadius = void 0; - if (yy < 0) { - //for the bottomCap edge - y = 0; - v = 0; - ringRadius = bottomRadius; - } else if (yy > detailY) { - //for the topCap edge - y = height; - v = 1; - ringRadius = topRadius; - } else { - //for the middle - ringRadius = bottomRadius + (topRadius - bottomRadius) * v; - } - if (yy === - 2 || yy === detailY + 2) { - //center of bottom or top caps - ringRadius = 0; - } - y -= height / 2; //shift coordiate origin to the center of object - for (ii = 0; ii < detailX; ++ii) { - var u = ii / (detailX - 1); - var ur = 2 * Math.PI * u; - var sur = Math.sin(ur); - var cur = Math.cos(ur); - //VERTICES - this.vertices.push(new _main.default.Vector(sur * ringRadius, y, cur * ringRadius)); - //VERTEX NORMALS - var vertexNormal = void 0; - if (yy < 0) { - vertexNormal = new _main.default.Vector(0, - 1, 0); - } else if (yy > detailY && topRadius) { - vertexNormal = new _main.default.Vector(0, 1, 0); - } else { - vertexNormal = new _main.default.Vector(sur * cosSlant, sinSlant, cur * cosSlant); - } - this.vertexNormals.push(vertexNormal); - //UVs - this.uvs.push(u, v); - } - } - var startIndex = 0; - if (bottomCap) { - for (jj = 0; jj < detailX; ++jj) { - var nextjj = (jj + 1) % detailX; - this.faces.push([startIndex + jj, - startIndex + detailX + nextjj, - startIndex + detailX + jj]); - } - startIndex += detailX * 2; - } - for (yy = 0; yy < detailY; ++yy) { - for (ii = 0; ii < detailX; ++ii) { - var nextii = (ii + 1) % detailX; - this.faces.push([startIndex + ii, - startIndex + nextii, - startIndex + detailX + nextii]); - this.faces.push([startIndex + ii, - startIndex + detailX + nextii, - startIndex + detailX + ii]); - } - startIndex += detailX; - } - if (topCap) { - startIndex += detailX; - for (ii = 0; ii < detailX; ++ii) { - this.faces.push([startIndex + ii, - startIndex + (ii + 1) % detailX, - startIndex + detailX]); - } - } - }; - /** - * Draw a cylinder with given radius and height - * - * DetailX and detailY determines the number of subdivisions in the x-dimension - * and the y-dimension of a cylinder. More subdivisions make the cylinder seem smoother. - * The recommended maximum value for detailX is 24. Using a value greater than 24 - * may cause a warning or slow down the browser. - * - * @method cylinder - * @param {Number} [radius] radius of the surface - * @param {Number} [height] height of the cylinder - * @param {Integer} [detailX] number of subdivisions in x-dimension; - * default is 24 - * @param {Integer} [detailY] number of subdivisions in y-dimension; - * default is 1 - * @param {Boolean} [bottomCap] whether to draw the bottom of the cylinder - * @param {Boolean} [topCap] whether to draw the top of the cylinder - * @chainable - * @example - *
                - * - * // draw a spinning cylinder - * // with radius 20 and height 50 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a rotating white cylinder'); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateX(frameCount * 0.01); - * rotateZ(frameCount * 0.01); - * cylinder(20, 50); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailX works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 24, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * cylinder(20, 75, detailX.value(), 1); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(1, 16, 1); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * cylinder(20, 75, 16, detailY.value()); - * } - * - *
                - */ - _main.default.prototype.cylinder = function (radius, height, detailX, detailY, bottomCap, topCap) { - this._assert3d('cylinder'); - _main.default._validateParameters('cylinder', arguments); - if (typeof radius === 'undefined') { - radius = 50; - } - if (typeof height === 'undefined') { - height = radius; - } - if (typeof detailX === 'undefined') { - detailX = 24; - } - if (typeof detailY === 'undefined') { - detailY = 1; - } - if (typeof topCap === 'undefined') { - topCap = true; - } - if (typeof bottomCap === 'undefined') { - bottomCap = true; - } - var gId = 'cylinder|'.concat(detailX, '|').concat(detailY, '|').concat(bottomCap, '|').concat(topCap); - if (!this._renderer.geometryInHash(gId)) { - var cylinderGeom = new _main.default.Geometry(detailX, detailY); - _truncatedCone.call(cylinderGeom, 1, 1, 1, detailX, detailY, bottomCap, topCap); - // normals are computed in call to _truncatedCone - if (detailX <= 24 && detailY <= 16) { - cylinderGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log('Cannot draw stroke on cylinder objects with more' + ' than 24 detailX or 16 detailY'); - } - this._renderer.createBuffers(gId, cylinderGeom); - } - this._renderer.drawBuffersScaled(gId, radius, height, radius); - return this; - }; - /** - * Draw a cone with given radius and height - * - * DetailX and detailY determine the number of subdivisions in the x-dimension and - * the y-dimension of a cone. More subdivisions make the cone seem smoother. The - * recommended maximum value for detailX is 24. Using a value greater than 24 - * may cause a warning or slow down the browser. - * @method cone - * @param {Number} [radius] radius of the bottom surface - * @param {Number} [height] height of the cone - * @param {Integer} [detailX] number of segments, - * the more segments the smoother geometry - * default is 24 - * @param {Integer} [detailY] number of segments, - * the more segments the smoother geometry - * default is 1 - * @param {Boolean} [cap] whether to draw the base of the cone - * @chainable - * @example - *
                - * - * // draw a spinning cone - * // with radius 40 and height 70 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a rotating white cone'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateZ(frameCount * 0.01); - * cone(40, 70); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailx works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 16, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * cone(30, 65, detailX.value(), 16); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(3, 16, 3); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * cone(30, 65, 16, detailY.value()); - * } - * - *
                - */ - _main.default.prototype.cone = function (radius, height, detailX, detailY, cap) { - this._assert3d('cone'); - _main.default._validateParameters('cone', arguments); - if (typeof radius === 'undefined') { - radius = 50; - } - if (typeof height === 'undefined') { - height = radius; - } - if (typeof detailX === 'undefined') { - detailX = 24; - } - if (typeof detailY === 'undefined') { - detailY = 1; - } - if (typeof cap === 'undefined') { - cap = true; - } - var gId = 'cone|'.concat(detailX, '|').concat(detailY, '|').concat(cap); - if (!this._renderer.geometryInHash(gId)) { - var coneGeom = new _main.default.Geometry(detailX, detailY); - _truncatedCone.call(coneGeom, 1, 0, 1, detailX, detailY, cap, false); - if (detailX <= 24 && detailY <= 16) { - coneGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log('Cannot draw stroke on cone objects with more' + ' than 24 detailX or 16 detailY'); - } - this._renderer.createBuffers(gId, coneGeom); - } - this._renderer.drawBuffersScaled(gId, radius, height, radius); - return this; - }; - /** - * Draw an ellipsoid with given radius - * - * DetailX and detailY determine the number of subdivisions in the x-dimension and - * the y-dimension of a cone. More subdivisions make the ellipsoid appear to be smoother. - * Avoid detail number above 150, it may crash the browser. - * @method ellipsoid - * @param {Number} [radiusx] x-radius of ellipsoid - * @param {Number} [radiusy] y-radius of ellipsoid - * @param {Number} [radiusz] z-radius of ellipsoid - * @param {Integer} [detailX] number of segments, - * the more segments the smoother geometry - * default is 24. Avoid detail number above - * 150, it may crash the browser. - * @param {Integer} [detailY] number of segments, - * the more segments the smoother geometry - * default is 16. Avoid detail number above - * 150, it may crash the browser. - * @chainable - * @example - *
                - * - * // draw an ellipsoid - * // with radius 30, 40 and 40. - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white 3d ellipsoid'); - * } - * - * function draw() { - * background(205, 105, 94); - * ellipsoid(30, 40, 40); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailX works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(2, 24, 12); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * ellipsoid(30, 40, 40, detailX.value(), 8); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(2, 24, 6); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 105, 9); - * rotateY(millis() / 1000); - * ellipsoid(30, 40, 40, 12, detailY.value()); - * } - * - *
                - */ - _main.default.prototype.ellipsoid = function (radiusX, radiusY, radiusZ, detailX, detailY) { - this._assert3d('ellipsoid'); - _main.default._validateParameters('ellipsoid', arguments); - if (typeof radiusX === 'undefined') { - radiusX = 50; - } - if (typeof radiusY === 'undefined') { - radiusY = radiusX; - } - if (typeof radiusZ === 'undefined') { - radiusZ = radiusX; - } - if (typeof detailX === 'undefined') { - detailX = 24; - } - if (typeof detailY === 'undefined') { - detailY = 16; - } - var gId = 'ellipsoid|'.concat(detailX, '|').concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _ellipsoid = function _ellipsoid() { - for (var i = 0; i <= this.detailY; i++) { - var v = i / this.detailY; - var phi = Math.PI * v - Math.PI / 2; - var cosPhi = Math.cos(phi); - var sinPhi = Math.sin(phi); - for (var j = 0; j <= this.detailX; j++) { - var u = j / this.detailX; - var theta = 2 * Math.PI * u; - var cosTheta = Math.cos(theta); - var sinTheta = Math.sin(theta); - var p = new _main.default.Vector(cosPhi * sinTheta, sinPhi, cosPhi * cosTheta); - this.vertices.push(p); - this.vertexNormals.push(p); - this.uvs.push(u, v); - } - } - }; - var ellipsoidGeom = new _main.default.Geometry(detailX, detailY, _ellipsoid); - ellipsoidGeom.computeFaces(); - if (detailX <= 24 && detailY <= 24) { - ellipsoidGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log('Cannot draw stroke on ellipsoids with more' + ' than 24 detailX or 24 detailY'); - } - this._renderer.createBuffers(gId, ellipsoidGeom); - } - this._renderer.drawBuffersScaled(gId, radiusX, radiusY, radiusZ); - return this; - }; - /** - * Draw a torus with given radius and tube radius - * - * DetailX and detailY determine the number of subdivisions in the x-dimension and - * the y-dimension of a torus. More subdivisions make the torus appear to be smoother. - * The default and maximum values for detailX and detailY are 24 and 16, respectively. - * Setting them to relatively small values like 4 and 6 allows you to create new - * shapes other than a torus. - * @method torus - * @param {Number} [radius] radius of the whole ring - * @param {Number} [tubeRadius] radius of the tube - * @param {Integer} [detailX] number of segments in x-dimension, - * the more segments the smoother geometry - * default is 24 - * @param {Integer} [detailY] number of segments in y-dimension, - * the more segments the smoother geometry - * default is 16 - * @chainable - * @example - *
                - * - * // draw a spinning torus - * // with ring radius 30 and tube radius 15 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a rotating white torus'); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * torus(30, 15); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailX works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 24, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * torus(30, 15, detailX.value(), 12); - * } - * - *
                - * - * @example - *
                - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(3, 16, 3); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * torus(30, 15, 16, detailY.value()); - * } - * - *
                - */ - _main.default.prototype.torus = function (radius, tubeRadius, detailX, detailY) { - this._assert3d('torus'); - _main.default._validateParameters('torus', arguments); - if (typeof radius === 'undefined') { - radius = 50; - } else if (!radius) { - return; // nothing to draw - } - if (typeof tubeRadius === 'undefined') { - tubeRadius = 10; - } else if (!tubeRadius) { - return; // nothing to draw - } - if (typeof detailX === 'undefined') { - detailX = 24; - } - if (typeof detailY === 'undefined') { - detailY = 16; - } - var tubeRatio = (tubeRadius / radius).toPrecision(4); - var gId = 'torus|'.concat(tubeRatio, '|').concat(detailX, '|').concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _torus = function _torus() { - for (var i = 0; i <= this.detailY; i++) { - var v = i / this.detailY; - var phi = 2 * Math.PI * v; - var cosPhi = Math.cos(phi); - var sinPhi = Math.sin(phi); - var r = 1 + tubeRatio * cosPhi; - for (var j = 0; j <= this.detailX; j++) { - var u = j / this.detailX; - var theta = 2 * Math.PI * u; - var cosTheta = Math.cos(theta); - var sinTheta = Math.sin(theta); - var p = new _main.default.Vector(r * cosTheta, r * sinTheta, tubeRatio * sinPhi); - var n = new _main.default.Vector(cosPhi * cosTheta, cosPhi * sinTheta, sinPhi); - this.vertices.push(p); - this.vertexNormals.push(n); - this.uvs.push(u, v); - } - } - }; - var torusGeom = new _main.default.Geometry(detailX, detailY, _torus); - torusGeom.computeFaces(); - if (detailX <= 24 && detailY <= 16) { - torusGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log('Cannot draw strokes on torus object with more' + ' than 24 detailX or 16 detailY'); - } - this._renderer.createBuffers(gId, torusGeom); - } - this._renderer.drawBuffersScaled(gId, radius, radius, radius); - return this; - }; - /////////////////////// - /// 2D primitives - ///////////////////////// - // - // Note: Documentation is not generated on the p5.js website for functions on - // the p5.RendererGL prototype. - /** - * Draws a point, a coordinate in space at the dimension of one pixel, - * given x, y and z coordinates. The color of the point is determined - * by the current stroke, while the point size is determined by current - * stroke weight. - * @private - * @param {Number} x x-coordinate of point - * @param {Number} y y-coordinate of point - * @param {Number} z z-coordinate of point - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(50); - * stroke(255); - * strokeWeight(4); - * point(25, 0); - * strokeWeight(3); - * point(-25, 0); - * strokeWeight(2); - * point(0, 25); - * strokeWeight(1); - * point(0, -25); - * } - * - *
                - */ - _main.default.RendererGL.prototype.point = function (x, y, z) { - if (typeof z === 'undefined') { - z = 0; - } - var _vertex = [ - ]; - _vertex.push(new _main.default.Vector(x, y, z)); - this._drawPoints(_vertex, this.immediateMode.buffers.point); - return this; - }; - _main.default.RendererGL.prototype.triangle = function (args) { - var x1 = args[0], - y1 = args[1]; - var x2 = args[2], - y2 = args[3]; - var x3 = args[4], - y3 = args[5]; - var gId = 'tri'; - if (!this.geometryInHash(gId)) { - var _triangle = function _triangle() { - var vertices = [ - ]; - vertices.push(new _main.default.Vector(0, 0, 0)); - vertices.push(new _main.default.Vector(1, 0, 0)); - vertices.push(new _main.default.Vector(0, 1, 0)); - this.edges = [ - [0, - 1], - [ - 1, - 2 - ], - [ - 2, - 0 - ] - ]; - this.vertices = vertices; - this.faces = [ - [0, - 1, - 2] - ]; - this.uvs = [ - 0, - 0, - 1, - 0, - 1, - 1 - ]; - }; - var triGeom = new _main.default.Geometry(1, 1, _triangle); - triGeom._edgesToVertices(); - triGeom.computeNormals(); - this.createBuffers(gId, triGeom); - } // only one triangle is cached, one point is at the origin, and the - // two adjacent sides are tne unit vectors along the X & Y axes. - // - // this matrix multiplication transforms those two unit vectors - // onto the required vector prior to rendering, and moves the - // origin appropriately. - - var uMVMatrix = this.uMVMatrix.copy(); - try { - // triangle orientation. - var orientation = Math.sign(x1 * y2 - x2 * y1 + x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3); - var mult = new _main.default.Matrix([x2 - x1, - y2 - y1, - 0, - 0, - // the resulting unit X-axis - x3 - x1, - y3 - y1, - 0, - 0, - // the resulting unit Y-axis - 0, - 0, - orientation, - 0, - // the resulting unit Z-axis (Reflect the specified order of vertices) - x1, - y1, - 0, - 1 // the resulting origin - ]).mult(this.uMVMatrix); - this.uMVMatrix = mult; - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - return this; - }; - _main.default.RendererGL.prototype.ellipse = function (args) { - this.arc(args[0], args[1], args[2], args[3], 0, constants.TWO_PI, constants.OPEN, args[4]); - }; - _main.default.RendererGL.prototype.arc = function (args) { - var x = arguments[0]; - var y = arguments[1]; - var width = arguments[2]; - var height = arguments[3]; - var start = arguments[4]; - var stop = arguments[5]; - var mode = arguments[6]; - var detail = arguments[7] || 25; - var shape; - var gId; - // check if it is an ellipse or an arc - if (Math.abs(stop - start) >= constants.TWO_PI) { - shape = 'ellipse'; - gId = ''.concat(shape, '|').concat(detail, '|'); - } else { - shape = 'arc'; - gId = ''.concat(shape, '|').concat(start, '|').concat(stop, '|').concat(mode, '|').concat(detail, '|'); - } - if (!this.geometryInHash(gId)) { - var _arc = function _arc() { - // if the start and stop angles are not the same, push vertices to the array - if (start.toFixed(10) !== stop.toFixed(10)) { - // if the mode specified is PIE or null, push the mid point of the arc in vertices - if (mode === constants.PIE || typeof mode === 'undefined') { - this.vertices.push(new _main.default.Vector(0.5, 0.5, 0)); - this.uvs.push([0.5, - 0.5]); - } // vertices for the perimeter of the circle - - for (var i = 0; i <= detail; i++) { - var u = i / detail; - var theta = (stop - start) * u + start; - var _x = 0.5 + Math.cos(theta) / 2; - var _y = 0.5 + Math.sin(theta) / 2; - this.vertices.push(new _main.default.Vector(_x, _y, 0)); - this.uvs.push([_x, - _y]); - if (i < detail - 1) { - this.faces.push([0, - i + 1, - i + 2]); - this.edges.push([i + 1, - i + 2]); - } - } // check the mode specified in order to push vertices and faces, different for each mode - - switch (mode) { - case constants.PIE: - this.faces.push([0, - this.vertices.length - 2, - this.vertices.length - 1]); - this.edges.push([0, - 1]); - this.edges.push([this.vertices.length - 2, - this.vertices.length - 1]); - this.edges.push([0, - this.vertices.length - 1]); - break; - case constants.CHORD: - this.edges.push([0, - 1]); - this.edges.push([0, - this.vertices.length - 1]); - break; - case constants.OPEN: - this.edges.push([0, - 1]); - break; - default: - this.faces.push([0, - this.vertices.length - 2, - this.vertices.length - 1]); - this.edges.push([this.vertices.length - 2, - this.vertices.length - 1]); - } - } - }; - var arcGeom = new _main.default.Geometry(detail, 1, _arc); - arcGeom.computeNormals(); - if (detail <= 50) { - arcGeom._edgesToVertices(arcGeom); - } else if (this._doStroke) { - console.log('Cannot apply a stroke to an '.concat(shape, ' with more than 50 detail')); - } - this.createBuffers(gId, arcGeom); - } - var uMVMatrix = this.uMVMatrix.copy(); - try { - this.uMVMatrix.translate([x, - y, - 0]); - this.uMVMatrix.scale(width, height, 1); - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - return this; - }; - _main.default.RendererGL.prototype.rect = function (args) { - var x = args[0]; - var y = args[1]; - var width = args[2]; - var height = args[3]; - if (typeof args[4] === 'undefined') { - // Use the retained mode for drawing rectangle, - // if args for rounding rectangle is not provided by user. - var perPixelLighting = this._pInst._glAttributes.perPixelLighting; - var detailX = args[4] || (perPixelLighting ? 1 : 24); - var detailY = args[5] || (perPixelLighting ? 1 : 16); - var gId = 'rect|'.concat(detailX, '|').concat(detailY); - if (!this.geometryInHash(gId)) { - var _rect = function _rect() { - for (var i = 0; i <= this.detailY; i++) { - var v = i / this.detailY; - for (var j = 0; j <= this.detailX; j++) { - var u = j / this.detailX; - var p = new _main.default.Vector(u, v, 0); - this.vertices.push(p); - this.uvs.push(u, v); - } - } // using stroke indices to avoid stroke over face(s) of rectangle - - if (detailX > 0 && detailY > 0) { - this.edges = [ - [0, - detailX], - [ - detailX, - (detailX + 1) * (detailY + 1) - 1 - ], - [ - (detailX + 1) * (detailY + 1) - 1, - (detailX + 1) * detailY - ], - [ - (detailX + 1) * detailY, - 0 - ] - ]; - } - }; - var rectGeom = new _main.default.Geometry(detailX, detailY, _rect); - rectGeom.computeFaces().computeNormals()._edgesToVertices(); - this.createBuffers(gId, rectGeom); - } // only a single rectangle (of a given detail) is cached: a square with - // opposite corners at (0,0) & (1,1). - // - // before rendering, this square is scaled & moved to the required location. - - var uMVMatrix = this.uMVMatrix.copy(); - try { - this.uMVMatrix.translate([x, - y, - 0]); - this.uMVMatrix.scale(width, height, 1); - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - } else { - // Use Immediate mode to round the rectangle corner, - // if args for rounding corners is provided by user - var tl = args[4]; - var tr = typeof args[5] === 'undefined' ? tl : args[5]; - var br = typeof args[6] === 'undefined' ? tr : args[6]; - var bl = typeof args[7] === 'undefined' ? br : args[7]; - var a = x; - var b = y; - var c = width; - var d = height; - c += a; - d += b; - if (a > c) { - var temp = a; - a = c; - c = temp; - } - if (b > d) { - var _temp = b; - b = d; - d = _temp; - } - var maxRounding = Math.min((c - a) / 2, (d - b) / 2); - if (tl > maxRounding) tl = maxRounding; - if (tr > maxRounding) tr = maxRounding; - if (br > maxRounding) br = maxRounding; - if (bl > maxRounding) bl = maxRounding; - var x1 = a; - var y1 = b; - var x2 = c; - var y2 = d; - this.beginShape(); - if (tr !== 0) { - this.vertex(x2 - tr, y1); - this.quadraticVertex(x2, y1, x2, y1 + tr); - } else { - this.vertex(x2, y1); - } - if (br !== 0) { - this.vertex(x2, y2 - br); - this.quadraticVertex(x2, y2, x2 - br, y2); - } else { - this.vertex(x2, y2); - } - if (bl !== 0) { - this.vertex(x1 + bl, y2); - this.quadraticVertex(x1, y2, x1, y2 - bl); - } else { - this.vertex(x1, y2); - } - if (tl !== 0) { - this.vertex(x1, y1 + tl); - this.quadraticVertex(x1, y1, x1 + tl, y1); - } else { - this.vertex(x1, y1); - } - this.immediateMode.geometry.uvs.length = 0; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this.immediateMode.geometry.vertices[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var vert = _step.value; - var u = (vert.x - x1) / width; - var v = (vert.y - y1) / height; - this.immediateMode.geometry.uvs.push(u, v); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - this.endShape(constants.CLOSE); - } - return this; - }; - /* eslint-disable max-len */ - _main.default.RendererGL.prototype.quad = function (x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, detailX, detailY) { - /* eslint-enable max-len */ - if (typeof detailX === 'undefined') { - detailX = 2; - } - if (typeof detailY === 'undefined') { - detailY = 2; - } - var gId = 'quad|'.concat(x1, '|').concat(y1, '|').concat(z1, '|').concat(x2, '|').concat(y2, '|').concat(z2, '|').concat(x3, '|').concat(y3, '|').concat(z3, '|').concat(x4, '|').concat(y4, '|').concat(z4, '|').concat(detailX, '|').concat(detailY); - if (!this.geometryInHash(gId)) { - var quadGeom = new _main.default.Geometry(detailX, detailY, function () { - //algorithm adapted from c++ to js - //https://stackoverflow.com/questions/16989181/whats-the-correct-way-to-draw-a-distorted-plane-in-opengl/16993202#16993202 - var xRes = 1 / (this.detailX - 1); - var yRes = 1 / (this.detailY - 1); - for (var y = 0; y < this.detailY; y++) { - for (var x = 0; x < this.detailX; x++) { - var pctx = x * xRes; - var pcty = y * yRes; - var linePt0x = (1 - pcty) * x1 + pcty * x4; - var linePt0y = (1 - pcty) * y1 + pcty * y4; - var linePt0z = (1 - pcty) * z1 + pcty * z4; - var linePt1x = (1 - pcty) * x2 + pcty * x3; - var linePt1y = (1 - pcty) * y2 + pcty * y3; - var linePt1z = (1 - pcty) * z2 + pcty * z3; - var ptx = (1 - pctx) * linePt0x + pctx * linePt1x; - var pty = (1 - pctx) * linePt0y + pctx * linePt1y; - var ptz = (1 - pctx) * linePt0z + pctx * linePt1z; - this.vertices.push(new _main.default.Vector(ptx, pty, ptz)); - this.uvs.push([pctx, - pcty]); - } - } - }); - quadGeom.faces = [ - ]; - for (var y = 0; y < detailY - 1; y++) { - for (var x = 0; x < detailX - 1; x++) { - var pt0 = x + y * detailX; - var pt1 = x + 1 + y * detailX; - var pt2 = x + 1 + (y + 1) * detailX; - var pt3 = x + (y + 1) * detailX; - quadGeom.faces.push([pt0, - pt1, - pt2]); - quadGeom.faces.push([pt0, - pt2, - pt3]); - } - } - quadGeom.computeNormals(); - quadGeom.edges.length = 0; - var vertexOrder = [ - 0, - 2, - 3, - 1 - ]; - for (var i = 0; i < vertexOrder.length; i++) { - var startVertex = vertexOrder[i]; - var endVertex = vertexOrder[(i + 1) % vertexOrder.length]; - quadGeom.edges.push([startVertex, - endVertex]); - } - quadGeom._edgesToVertices(); - this.createBuffers(gId, quadGeom); - } - this.drawBuffers(gId); - return this; - }; - //this implementation of bezier curve - //is based on Bernstein polynomial - // pretier-ignore - _main.default.RendererGL.prototype.bezier = function (x1, y1, z1, // x2 - x2, // y2 - y2, // x3 - z2, // y3 - x3, // x4 - y3, // y4 - z3, x4, y4, z4) { - if (arguments.length === 8) { - y4 = y3; - x4 = x3; - y3 = z2; - x3 = y2; - y2 = x2; - x2 = z1; - z1 = z2 = z3 = z4 = 0; - } - var bezierDetail = this._pInst._bezierDetail || 20; //value of Bezier detail - this.beginShape(); - for (var i = 0; i <= bezierDetail; i++) { - var c1 = Math.pow(1 - i / bezierDetail, 3); - var c2 = 3 * (i / bezierDetail) * Math.pow(1 - i / bezierDetail, 2); - var c3 = 3 * Math.pow(i / bezierDetail, 2) * (1 - i / bezierDetail); - var c4 = Math.pow(i / bezierDetail, 3); - this.vertex(x1 * c1 + x2 * c2 + x3 * c3 + x4 * c4, y1 * c1 + y2 * c2 + y3 * c3 + y4 * c4, z1 * c1 + z2 * c2 + z3 * c3 + z4 * c4); - } - this.endShape(); - return this; - }; - // pretier-ignore - _main.default.RendererGL.prototype.curve = function (x1, y1, z1, // x2 - x2, // y2 - y2, // x3 - z2, // y3 - x3, // x4 - y3, // y4 - z3, x4, y4, z4) { - if (arguments.length === 8) { - x4 = x3; - y4 = y3; - x3 = y2; - y3 = x2; - x2 = z1; - y2 = x2; - z1 = z2 = z3 = z4 = 0; - } - var curveDetail = this._pInst._curveDetail; - this.beginShape(); - for (var i = 0; i <= curveDetail; i++) { - var c1 = Math.pow(i / curveDetail, 3) * 0.5; - var c2 = Math.pow(i / curveDetail, 2) * 0.5; - var c3 = i / curveDetail * 0.5; - var c4 = 0.5; - var vx = c1 * ( - x1 + 3 * x2 - 3 * x3 + x4) + c2 * (2 * x1 - 5 * x2 + 4 * x3 - x4) + c3 * ( - x1 + x3) + c4 * (2 * x2); - var vy = c1 * ( - y1 + 3 * y2 - 3 * y3 + y4) + c2 * (2 * y1 - 5 * y2 + 4 * y3 - y4) + c3 * ( - y1 + y3) + c4 * (2 * y2); - var vz = c1 * ( - z1 + 3 * z2 - 3 * z3 + z4) + c2 * (2 * z1 - 5 * z2 + 4 * z3 - z4) + c3 * ( - z1 + z3) + c4 * (2 * z2); - this.vertex(vx, vy, vz); - } - this.endShape(); - return this; - }; - /** - * Draw a line given two points - * @private - * @param {Number} x0 x-coordinate of first vertex - * @param {Number} y0 y-coordinate of first vertex - * @param {Number} z0 z-coordinate of first vertex - * @param {Number} x1 x-coordinate of second vertex - * @param {Number} y1 y-coordinate of second vertex - * @param {Number} z1 z-coordinate of second vertex - * @chainable - * @example - *
                - * - * //draw a line - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * // Use fill instead of stroke to change the color of shape. - * fill(255, 0, 0); - * line(10, 10, 0, 60, 60, 20); - * } - * - *
                - */ - _main.default.RendererGL.prototype.line = function () { - if (arguments.length === 6) { - this.beginShape(constants.LINES); - this.vertex(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]); - this.vertex(arguments.length <= 3 ? undefined : arguments[3], arguments.length <= 4 ? undefined : arguments[4], arguments.length <= 5 ? undefined : arguments[5]); - this.endShape(); - } else if (arguments.length === 4) { - this.beginShape(constants.LINES); - this.vertex(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], 0); - this.vertex(arguments.length <= 2 ? undefined : arguments[2], arguments.length <= 3 ? undefined : arguments[3], 0); - this.endShape(); - } - return this; - }; - _main.default.RendererGL.prototype.bezierVertex = function () { - if (this.immediateMode._bezierVertex.length === 0) { - throw Error('vertex() must be used once before calling bezierVertex()'); - } else { - var w_x = [ - ]; - var w_y = [ - ]; - var w_z = [ - ]; - var t, - _x, - _y, - _z, - i, - k, - m; - // variable i for bezierPoints, k for components, and m for anchor points. - var argLength = arguments.length; - t = 0; - if (this._lookUpTableBezier.length === 0 || this._lutBezierDetail !== this._pInst._curveDetail) { - this._lookUpTableBezier = [ - ]; - this._lutBezierDetail = this._pInst._curveDetail; - var step = 1 / this._lutBezierDetail; - var start = 0; - var end = 1; - var j = 0; - while (start < 1) { - t = parseFloat(start.toFixed(6)); - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - if (end.toFixed(6) === step.toFixed(6)) { - t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); - ++j; - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - break; - } - start += step; - end -= step; - ++j; - } - } - var LUTLength = this._lookUpTableBezier.length; - // fillColors[0]: start point color - // fillColors[1],[2]: control point color - // fillColors[3]: end point color - var fillColors = [ - ]; - for (m = 0; m < 4; m++) { - fillColors.push([]); - } - fillColors[0] = this.immediateMode.geometry.vertexColors.slice( - 4); - fillColors[3] = this.curFillColor.slice(); - // Do the same for strokeColor. - var strokeColors = [ - ]; - for (m = 0; m < 4; m++) { - strokeColors.push([]); - } - strokeColors[0] = this.immediateMode.geometry.vertexStrokeColors.slice( - 4); - strokeColors[3] = this.curStrokeColor.slice(); - if (argLength === 6) { - this.isBezier = true; - w_x = [ - this.immediateMode._bezierVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 4 ? undefined : arguments[4] - ]; - w_y = [ - this.immediateMode._bezierVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 3 ? undefined : arguments[3], - arguments.length <= 5 ? undefined : arguments[5] - ]; - // The ratio of the distance between the start point, the two control- - // points, and the end point determines the intermediate color. - var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); - var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); - var d2 = Math.hypot(w_x[2] - w_x[3], w_y[2] - w_y[3]); - var totalLength = d0 + d1 + d2; - d0 /= totalLength; - d2 /= totalLength; - for (k = 0; k < 4; k++) { - fillColors[1].push(fillColors[0][k] * (1 - d0) + fillColors[3][k] * d0); - fillColors[2].push(fillColors[0][k] * d2 + fillColors[3][k] * (1 - d2)); - strokeColors[1].push(strokeColors[0][k] * (1 - d0) + strokeColors[3][k] * d0); - strokeColors[2].push(strokeColors[0][k] * d2 + strokeColors[3][k] * (1 - d2)); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [ - 0, - 0, - 0, - 0 - ]; - this.curStrokeColor = [ - 0, - 0, - 0, - 0 - ]; - _x = _y = 0; - for (m = 0; m < 4; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += this._lookUpTableBezier[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += this._lookUpTableBezier[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableBezier[i][m]; - _y += w_y[m] * this._lookUpTableBezier[i][m]; - } - this.vertex(_x, _y); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[3]; - this.curStrokeColor = strokeColors[3]; - this.immediateMode._bezierVertex[0] = arguments.length <= 4 ? undefined : arguments[4]; - this.immediateMode._bezierVertex[1] = arguments.length <= 5 ? undefined : arguments[5]; - } else if (argLength === 9) { - this.isBezier = true; - w_x = [ - this.immediateMode._bezierVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 3 ? undefined : arguments[3], - arguments.length <= 6 ? undefined : arguments[6] - ]; - w_y = [ - this.immediateMode._bezierVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 4 ? undefined : arguments[4], - arguments.length <= 7 ? undefined : arguments[7] - ]; - w_z = [ - this.immediateMode._bezierVertex[2], - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 5 ? undefined : arguments[5], - arguments.length <= 8 ? undefined : arguments[8] - ]; - // The ratio of the distance between the start point, the two control- - // points, and the end point determines the intermediate color. - var _d = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1], w_z[0] - w_z[1]); - var _d2 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2], w_z[1] - w_z[2]); - var _d3 = Math.hypot(w_x[2] - w_x[3], w_y[2] - w_y[3], w_z[2] - w_z[3]); - var _totalLength = _d + _d2 + _d3; - _d /= _totalLength; - _d3 /= _totalLength; - for (k = 0; k < 4; k++) { - fillColors[1].push(fillColors[0][k] * (1 - _d) + fillColors[3][k] * _d); - fillColors[2].push(fillColors[0][k] * _d3 + fillColors[3][k] * (1 - _d3)); - strokeColors[1].push(strokeColors[0][k] * (1 - _d) + strokeColors[3][k] * _d); - strokeColors[2].push(strokeColors[0][k] * _d3 + strokeColors[3][k] * (1 - _d3)); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [ - 0, - 0, - 0, - 0 - ]; - this.curStrokeColor = [ - 0, - 0, - 0, - 0 - ]; - _x = _y = _z = 0; - for (m = 0; m < 4; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += this._lookUpTableBezier[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += this._lookUpTableBezier[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableBezier[i][m]; - _y += w_y[m] * this._lookUpTableBezier[i][m]; - _z += w_z[m] * this._lookUpTableBezier[i][m]; - } - this.vertex(_x, _y, _z); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[3]; - this.curStrokeColor = strokeColors[3]; - this.immediateMode._bezierVertex[0] = arguments.length <= 6 ? undefined : arguments[6]; - this.immediateMode._bezierVertex[1] = arguments.length <= 7 ? undefined : arguments[7]; - this.immediateMode._bezierVertex[2] = arguments.length <= 8 ? undefined : arguments[8]; - } - } - }; - _main.default.RendererGL.prototype.quadraticVertex = function () { - if (this.immediateMode._quadraticVertex.length === 0) { - throw Error('vertex() must be used once before calling quadraticVertex()'); - } else { - var w_x = [ - ]; - var w_y = [ - ]; - var w_z = [ - ]; - var t, - _x, - _y, - _z, - i, - k, - m; - // variable i for bezierPoints, k for components, and m for anchor points. - var argLength = arguments.length; - t = 0; - if (this._lookUpTableQuadratic.length === 0 || this._lutQuadraticDetail !== this._pInst._curveDetail) { - this._lookUpTableQuadratic = [ - ]; - this._lutQuadraticDetail = this._pInst._curveDetail; - var step = 1 / this._lutQuadraticDetail; - var start = 0; - var end = 1; - var j = 0; - while (start < 1) { - t = parseFloat(start.toFixed(6)); - this._lookUpTableQuadratic[j] = this._quadraticCoefficients(t); - if (end.toFixed(6) === step.toFixed(6)) { - t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); - ++j; - this._lookUpTableQuadratic[j] = this._quadraticCoefficients(t); - break; - } - start += step; - end -= step; - ++j; - } - } - var LUTLength = this._lookUpTableQuadratic.length; - // fillColors[0]: start point color - // fillColors[1]: control point color - // fillColors[2]: end point color - var fillColors = [ - ]; - for (m = 0; m < 3; m++) { - fillColors.push([]); - } - fillColors[0] = this.immediateMode.geometry.vertexColors.slice( - 4); - fillColors[2] = this.curFillColor.slice(); - // Do the same for strokeColor. - var strokeColors = [ - ]; - for (m = 0; m < 3; m++) { - strokeColors.push([]); - } - strokeColors[0] = this.immediateMode.geometry.vertexStrokeColors.slice( - 4); - strokeColors[2] = this.curStrokeColor.slice(); - if (argLength === 4) { - this.isQuadratic = true; - w_x = [ - this.immediateMode._quadraticVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 2 ? undefined : arguments[2] - ]; - w_y = [ - this.immediateMode._quadraticVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 3 ? undefined : arguments[3] - ]; - // The ratio of the distance between the start point, the control- - // point, and the end point determines the intermediate color. - var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); - var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); - var totalLength = d0 + d1; - d0 /= totalLength; - for (k = 0; k < 4; k++) { - fillColors[1].push(fillColors[0][k] * (1 - d0) + fillColors[2][k] * d0); - strokeColors[1].push(strokeColors[0][k] * (1 - d0) + strokeColors[2][k] * d0); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [ - 0, - 0, - 0, - 0 - ]; - this.curStrokeColor = [ - 0, - 0, - 0, - 0 - ]; - _x = _y = 0; - for (m = 0; m < 3; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += this._lookUpTableQuadratic[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableQuadratic[i][m]; - _y += w_y[m] * this._lookUpTableQuadratic[i][m]; - } - this.vertex(_x, _y); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[2]; - this.curStrokeColor = strokeColors[2]; - this.immediateMode._quadraticVertex[0] = arguments.length <= 2 ? undefined : arguments[2]; - this.immediateMode._quadraticVertex[1] = arguments.length <= 3 ? undefined : arguments[3]; - } else if (argLength === 6) { - this.isQuadratic = true; - w_x = [ - this.immediateMode._quadraticVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 3 ? undefined : arguments[3] - ]; - w_y = [ - this.immediateMode._quadraticVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 4 ? undefined : arguments[4] - ]; - w_z = [ - this.immediateMode._quadraticVertex[2], - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 5 ? undefined : arguments[5] - ]; - // The ratio of the distance between the start point, the control- - // point, and the end point determines the intermediate color. - var _d4 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1], w_z[0] - w_z[1]); - var _d5 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2], w_z[1] - w_z[2]); - var _totalLength2 = _d4 + _d5; - _d4 /= _totalLength2; - for (k = 0; k < 4; k++) { - fillColors[1].push(fillColors[0][k] * (1 - _d4) + fillColors[2][k] * _d4); - strokeColors[1].push(strokeColors[0][k] * (1 - _d4) + strokeColors[2][k] * _d4); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [ - 0, - 0, - 0, - 0 - ]; - this.curStrokeColor = [ - 0, - 0, - 0, - 0 - ]; - _x = _y = _z = 0; - for (m = 0; m < 3; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += this._lookUpTableQuadratic[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableQuadratic[i][m]; - _y += w_y[m] * this._lookUpTableQuadratic[i][m]; - _z += w_z[m] * this._lookUpTableQuadratic[i][m]; - } - this.vertex(_x, _y, _z); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[2]; - this.curStrokeColor = strokeColors[2]; - this.immediateMode._quadraticVertex[0] = arguments.length <= 3 ? undefined : arguments[3]; - this.immediateMode._quadraticVertex[1] = arguments.length <= 4 ? undefined : arguments[4]; - this.immediateMode._quadraticVertex[2] = arguments.length <= 5 ? undefined : arguments[5]; - } - } - }; - _main.default.RendererGL.prototype.curveVertex = function () { - var w_x = [ - ]; - var w_y = [ - ]; - var w_z = [ - ]; - var t, - _x, - _y, - _z, - i; - t = 0; - var argLength = arguments.length; - if (this._lookUpTableBezier.length === 0 || this._lutBezierDetail !== this._pInst._curveDetail) { - this._lookUpTableBezier = [ - ]; - this._lutBezierDetail = this._pInst._curveDetail; - var step = 1 / this._lutBezierDetail; - var start = 0; - var end = 1; - var j = 0; - while (start < 1) { - t = parseFloat(start.toFixed(6)); - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - if (end.toFixed(6) === step.toFixed(6)) { - t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); - ++j; - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - break; - } - start += step; - end -= step; - ++j; - } - } - var LUTLength = this._lookUpTableBezier.length; - if (argLength === 2) { - this.immediateMode._curveVertex.push(arguments.length <= 0 ? undefined : arguments[0]); - this.immediateMode._curveVertex.push(arguments.length <= 1 ? undefined : arguments[1]); - if (this.immediateMode._curveVertex.length === 8) { - this.isCurve = true; - w_x = this._bezierToCatmull([this.immediateMode._curveVertex[0], - this.immediateMode._curveVertex[2], - this.immediateMode._curveVertex[4], - this.immediateMode._curveVertex[6]]); - w_y = this._bezierToCatmull([this.immediateMode._curveVertex[1], - this.immediateMode._curveVertex[3], - this.immediateMode._curveVertex[5], - this.immediateMode._curveVertex[7]]); - for (i = 0; i < LUTLength; i++) { - _x = w_x[0] * this._lookUpTableBezier[i][0] + w_x[1] * this._lookUpTableBezier[i][1] + w_x[2] * this._lookUpTableBezier[i][2] + w_x[3] * this._lookUpTableBezier[i][3]; - _y = w_y[0] * this._lookUpTableBezier[i][0] + w_y[1] * this._lookUpTableBezier[i][1] + w_y[2] * this._lookUpTableBezier[i][2] + w_y[3] * this._lookUpTableBezier[i][3]; - this.vertex(_x, _y); - } - for (i = 0; i < argLength; i++) { - this.immediateMode._curveVertex.shift(); - } - } - } else if (argLength === 3) { - this.immediateMode._curveVertex.push(arguments.length <= 0 ? undefined : arguments[0]); - this.immediateMode._curveVertex.push(arguments.length <= 1 ? undefined : arguments[1]); - this.immediateMode._curveVertex.push(arguments.length <= 2 ? undefined : arguments[2]); - if (this.immediateMode._curveVertex.length === 12) { - this.isCurve = true; - w_x = this._bezierToCatmull([this.immediateMode._curveVertex[0], - this.immediateMode._curveVertex[3], - this.immediateMode._curveVertex[6], - this.immediateMode._curveVertex[9]]); - w_y = this._bezierToCatmull([this.immediateMode._curveVertex[1], - this.immediateMode._curveVertex[4], - this.immediateMode._curveVertex[7], - this.immediateMode._curveVertex[10]]); - w_z = this._bezierToCatmull([this.immediateMode._curveVertex[2], - this.immediateMode._curveVertex[5], - this.immediateMode._curveVertex[8], - this.immediateMode._curveVertex[11]]); - for (i = 0; i < LUTLength; i++) { - _x = w_x[0] * this._lookUpTableBezier[i][0] + w_x[1] * this._lookUpTableBezier[i][1] + w_x[2] * this._lookUpTableBezier[i][2] + w_x[3] * this._lookUpTableBezier[i][3]; - _y = w_y[0] * this._lookUpTableBezier[i][0] + w_y[1] * this._lookUpTableBezier[i][1] + w_y[2] * this._lookUpTableBezier[i][2] + w_y[3] * this._lookUpTableBezier[i][3]; - _z = w_z[0] * this._lookUpTableBezier[i][0] + w_z[1] * this._lookUpTableBezier[i][1] + w_z[2] * this._lookUpTableBezier[i][2] + w_z[3] * this._lookUpTableBezier[i][3]; - this.vertex(_x, _y, _z); - } - for (i = 0; i < argLength; i++) { - this.immediateMode._curveVertex.shift(); - } - } - } - }; - _main.default.RendererGL.prototype.image = function (img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) { - if (this._isErasing) { - this.blendMode(this._cachedBlendMode); - } - this._pInst.push(); - this._pInst.noLights(); - this._pInst.noStroke(); - this._pInst.texture(img); - this._pInst.textureMode(constants.NORMAL); - var u0 = 0; - if (sx <= img.width) { - u0 = sx / img.width; - } - var u1 = 1; - if (sx + sWidth <= img.width) { - u1 = (sx + sWidth) / img.width; - } - var v0 = 0; - if (sy <= img.height) { - v0 = sy / img.height; - } - var v1 = 1; - if (sy + sHeight <= img.height) { - v1 = (sy + sHeight) / img.height; - } - this.beginShape(); - this.vertex(dx, dy, 0, u0, v0); - this.vertex(dx + dWidth, dy, 0, u1, v0); - this.vertex(dx + dWidth, dy + dHeight, 0, u1, v1); - this.vertex(dx, dy + dHeight, 0, u0, v1); - this.endShape(constants.CLOSE); - this._pInst.pop(); - if (this._isErasing) { - this.blendMode(constants.REMOVE); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.Geometry': 350, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.math.hypot': 188, - 'core-js/modules/es.math.sign': 190, - 'core-js/modules/es.number.to-fixed': 193, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 342: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.object.assign'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @private - * A class responsible for converting successive WebGL draw calls into a single - * `p5.Geometry` that can be reused and drawn with `model()`. - */ - - var GeometryBuilder = /*#__PURE__*/ function () { - function GeometryBuilder(renderer) { - _classCallCheck(this, GeometryBuilder); - this.renderer = renderer; - renderer._pInst.push(); - this.identityMatrix = new _main.default.Matrix(); - renderer.uMVMatrix = new _main.default.Matrix(); - this.geometry = new _main.default.Geometry(); - this.geometry.gid = '_p5_GeometryBuilder_'.concat(GeometryBuilder.nextGeometryId); - GeometryBuilder.nextGeometryId++; - this.hasTransform = false; - } /** - * @private - * Applies the current transformation matrix to each vertex. - */ - - _createClass(GeometryBuilder, [ - { - key: 'transformVertices', - value: function transformVertices(vertices) { - var _this = this; - if (!this.hasTransform) return vertices; - return vertices.map(function (v) { - return _this.renderer.uMVMatrix.multiplyPoint(v); - }); - } /** - * @private - * Applies the current normal matrix to each normal. - */ - - }, - { - key: 'transformNormals', - value: function transformNormals(normals) { - var _this2 = this; - if (!this.hasTransform) return normals; - return normals.map(function (v) { - return _this2.renderer.uNMatrix.multiplyVec3(v); - }); - } /** - * @private - * Adds a p5.Geometry to the builder's combined geometry, flattening - * transformations. - */ - - }, - { - key: 'addGeometry', - value: function addGeometry(input) { - var _this3 = this, - _this$geometry$vertic, - _this$geometry$vertex, - _this$geometry$uvs, - _this$geometry$vertex2; - this.hasTransform = !this.renderer.uMVMatrix.mat4.every(function (v, i) { - return v === _this3.identityMatrix.mat4[i]; - }); - if (this.hasTransform) { - this.renderer.uNMatrix.inverseTranspose(this.renderer.uMVMatrix); - } - var startIdx = this.geometry.vertices.length; - (_this$geometry$vertic = this.geometry.vertices).push.apply(_this$geometry$vertic, _toConsumableArray(this.transformVertices(input.vertices))); - (_this$geometry$vertex = this.geometry.vertexNormals).push.apply(_this$geometry$vertex, _toConsumableArray(this.transformNormals(input.vertexNormals))); - (_this$geometry$uvs = this.geometry.uvs).push.apply(_this$geometry$uvs, _toConsumableArray(input.uvs)); - if (this.renderer._doFill) { - var _this$geometry$faces; - (_this$geometry$faces = this.geometry.faces).push.apply(_this$geometry$faces, _toConsumableArray(input.faces.map(function (f) { - return f.map(function (idx) { - return idx + startIdx; - }); - }))); - } - if (this.renderer._doStroke) { - var _this$geometry$edges; - (_this$geometry$edges = this.geometry.edges).push.apply(_this$geometry$edges, _toConsumableArray(input.edges.map(function (edge) { - return edge.map(function (idx) { - return idx + startIdx; - }); - }))); - } - var vertexColors = _toConsumableArray(input.vertexColors); - while (vertexColors.length < input.vertices.length * 4) { - vertexColors.push.apply(vertexColors, _toConsumableArray(this.renderer.curFillColor)); - }(_this$geometry$vertex2 = this.geometry.vertexColors).push.apply(_this$geometry$vertex2, _toConsumableArray(vertexColors)); - } /** - * Adds geometry from the renderer's immediate mode into the builder's - * combined geometry. - */ - - }, - { - key: 'addImmediate', - value: function addImmediate() { - var geometry = this.renderer.immediateMode.geometry; - var shapeMode = this.renderer.immediateMode.shapeMode; - var faces = [ - ]; - if (this.renderer._doFill) { - if (shapeMode === constants.TRIANGLE_STRIP || shapeMode === constants.QUAD_STRIP) { - for (var i = 2; i < geometry.vertices.length; i++) { - if (i % 2 === 0) { - faces.push([i, - i - 1, - i - 2]); - } else { - faces.push([i, - i - 2, - i - 1]); - } - } - } else if (shapeMode === constants.TRIANGLE_FAN) { - for (var _i = 2; _i < geometry.vertices.length; _i++) { - faces.push([0, - _i - 1, - _i]); - } - } else { - for (var _i2 = 0; _i2 < geometry.vertices.length; _i2 += 3) { - faces.push([_i2, - _i2 + 1, - _i2 + 2]); - } - } - } - this.addGeometry(Object.assign({ - }, geometry, { - faces: faces - })); - } /** - * Adds geometry from the renderer's retained mode into the builder's - * combined geometry. - */ - - }, - { - key: 'addRetained', - value: function addRetained(geometry) { - this.addGeometry(geometry.model); - } /** - * Cleans up the state of the renderer and returns the combined geometry that - * was built. - * @returns p5.Geometry The flattened, combined geometry - */ - - }, - { - key: 'finish', - value: function finish() { - this.renderer._pInst.pop(); - return this.geometry; - } - } - ]); - return GeometryBuilder; - }(); - /** - * Keeps track of how many custom geometry objects have been made so that each - * can be assigned a unique ID. - */ - GeometryBuilder.nextGeometryId = 0; - var _default = GeometryBuilder; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.every': 171, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.object.assign': 194, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 343: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.math.sign'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.math.sign'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module 3D - * @submodule Interaction - * @for p5 - * @requires core - */ - /** - * Allows movement around a 3D sketch using a mouse or trackpad or touch. - * Left-clicking and dragging or swipe motion will rotate the camera position - * about the center of the sketch, right-clicking and dragging or multi-swipe - * will pan the camera position without rotation, and using the mouse wheel - * (scrolling) or pinch in/out will move the camera further or closer - * from the center of the sketch. This function can be called with parameters - * dictating sensitivity to mouse/touch movement along the X and Y axes. - * Calling this function without parameters is equivalent to calling - * orbitControl(1,1). To reverse direction of movement in either axis, - * enter a negative number for sensitivity. - * @method orbitControl - * @for p5 - * @param {Number} [sensitivityX] sensitivity to mouse movement along X axis - * @param {Number} [sensitivityY] sensitivity to mouse movement along Y axis - * @param {Number} [sensitivityZ] sensitivity to scroll movement along Z axis - * @param {Object} [options] An optional object that can contain additional settings, - * disableTouchActions - Boolean, default value is true. - * Setting this to true makes mobile interactions smoother by preventing - * accidental interactions with the page while orbiting. But if you're already - * doing it via css or want the default touch actions, consider setting it to false. - * freeRotation - Boolean, default value is false. - * By default, horizontal movement of the mouse or touch pointer rotates the camera - * around the y-axis, and vertical movement rotates the camera around the x-axis. - * But if setting this option to true, the camera always rotates in the direction - * the pointer is moving. For zoom and move, the behavior is the same regardless of - * true/false. - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * describe( - * 'Camera orbits around a box when mouse is hold-clicked & then moved.' - * ); - * } - * function draw() { - * background(200); - * - * // If you execute the line commented out instead of next line, the direction of rotation - * // will be the direction the mouse or touch pointer moves, not around the X or Y axis. - * orbitControl(); - * // orbitControl(1, 1, 1, {freeRotation: true}); - * - * rotateY(0.5); - * box(30, 50); - * } - * - *
                - * - * @alt - * Camera orbits around a box when mouse is hold-clicked & then moved. - */ - // implementation based on three.js 'orbitControls': - // https://github.com/mrdoob/three.js/blob/6afb8595c0bf8b2e72818e42b64e6fe22707d896/examples/jsm/controls/OrbitControls.js#L22 - - _main.default.prototype.orbitControl = function (sensitivityX, sensitivityY, sensitivityZ, options) { - var _this = this; - this._assert3d('orbitControl'); - _main.default._validateParameters('orbitControl', arguments); - var cam = this._renderer._curCamera; - if (typeof sensitivityX === 'undefined') { - sensitivityX = 1; - } - if (typeof sensitivityY === 'undefined') { - sensitivityY = sensitivityX; - } - if (typeof sensitivityZ === 'undefined') { - sensitivityZ = 1; - } - if (_typeof(options) !== 'object') { - options = { - }; - } // default right-mouse and mouse-wheel behaviors (context menu and scrolling, - // respectively) are disabled here to allow use of those events for panning and - // zooming. However, whether or not to disable touch actions is an option. - // disable context menu for canvas element and add 'contextMenuDisabled' - // flag to p5 instance - - if (this.contextMenuDisabled !== true) { - this.canvas.oncontextmenu = function () { - return false; - }; - this._setProperty('contextMenuDisabled', true); - } // disable default scrolling behavior on the canvas element and add - // 'wheelDefaultDisabled' flag to p5 instance - - if (this.wheelDefaultDisabled !== true) { - this.canvas.onwheel = function () { - return false; - }; - this._setProperty('wheelDefaultDisabled', true); - } // disable default touch behavior on the canvas element and add - // 'touchActionsDisabled' flag to p5 instance - - var _options = options, - _options$disableTouch = _options.disableTouchActions, - disableTouchActions = _options$disableTouch === void 0 ? true : _options$disableTouch; - if (this.touchActionsDisabled !== true && disableTouchActions) { - this.canvas.style['touch-action'] = 'none'; - this._setProperty('touchActionsDisabled', true); - } // If option.freeRotation is true, the camera always rotates freely in the direction - // the pointer moves. default value is false (normal behavior) - - var _options2 = options, - _options2$freeRotatio = _options2.freeRotation, - freeRotation = _options2$freeRotatio === void 0 ? false : _options2$freeRotatio; // get moved touches. - var movedTouches = [ - ]; - this.touches.forEach(function (curTouch) { - _this._renderer.prevTouches.forEach(function (prevTouch) { - if (curTouch.id === prevTouch.id) { - var movedTouch = { - x: curTouch.x, - y: curTouch.y, - px: prevTouch.x, - py: prevTouch.y - }; - movedTouches.push(movedTouch); - } - }); - }); - this._renderer.prevTouches = this.touches; - // The idea of using damping is based on the following website. thank you. - // https://github.com/freshfork/p5.EasyCam/blob/9782964680f6a5c4c9bee825c475d9f2021d5134/p5.easycam.js#L1124 - // variables for interaction - var deltaRadius = 0; - var deltaTheta = 0; - var deltaPhi = 0; - var moveDeltaX = 0; - var moveDeltaY = 0; - // constants for dampingProcess - var damping = 0.85; - var rotateAccelerationFactor = 0.6; - var moveAccelerationFactor = 0.15; - // For touches, the appropriate scale is different - // because the distance difference is multiplied. - var mouseZoomScaleFactor = 0.01; - var touchZoomScaleFactor = 0.0004; - var scaleFactor = this.height < this.width ? this.height : this.width; - // Flag whether the mouse or touch pointer is inside the canvas - var pointersInCanvas = false; - // calculate and determine flags and variables. - if (movedTouches.length > 0) { - /* for touch */ - // if length === 1, rotate - // if length > 1, zoom and move - // for touch, it is calculated based on one moved touch pointer position. - pointersInCanvas = movedTouches[0].x > 0 && movedTouches[0].x < this.width && movedTouches[0].y > 0 && movedTouches[0].y < this.height; - if (movedTouches.length === 1) { - var t = movedTouches[0]; - deltaTheta = - sensitivityX * (t.x - t.px) / scaleFactor; - deltaPhi = sensitivityY * (t.y - t.py) / scaleFactor; - } else { - var t0 = movedTouches[0]; - var t1 = movedTouches[1]; - var distWithTouches = Math.hypot(t0.x - t1.x, t0.y - t1.y); - var prevDistWithTouches = Math.hypot(t0.px - t1.px, t0.py - t1.py); - var changeDist = distWithTouches - prevDistWithTouches; - // move the camera farther when the distance between the two touch points - // decreases, move the camera closer when it increases. - deltaRadius = - changeDist * sensitivityZ * touchZoomScaleFactor; - // Move the center of the camera along with the movement of - // the center of gravity of the two touch points. - moveDeltaX = 0.5 * (t0.x + t1.x) - 0.5 * (t0.px + t1.px); - moveDeltaY = 0.5 * (t0.y + t1.y) - 0.5 * (t0.py + t1.py); - } - if (this.touches.length > 0) { - if (pointersInCanvas) { - // Initiate an interaction if touched in the canvas - this._renderer.executeRotateAndMove = true; - this._renderer.executeZoom = true; - } - } else { - // End an interaction when the touch is released - this._renderer.executeRotateAndMove = false; - this._renderer.executeZoom = false; - } - } else { - /* for mouse */ - // if wheelDeltaY !== 0, zoom - // if mouseLeftButton is down, rotate - // if mouseRightButton is down, move - // For mouse, it is calculated based on the mouse position. - pointersInCanvas = this.mouseX > 0 && this.mouseX < this.width && this.mouseY > 0 && this.mouseY < this.height; - if (this._mouseWheelDeltaY !== 0) { - // zoom the camera depending on the value of _mouseWheelDeltaY. - // move away if positive, move closer if negative - deltaRadius = Math.sign(this._mouseWheelDeltaY) * sensitivityZ; - deltaRadius *= mouseZoomScaleFactor; - this._mouseWheelDeltaY = 0; - // start zoom when the mouse is wheeled within the canvas. - if (pointersInCanvas) this._renderer.executeZoom = true; - } else { - // quit zoom when you stop wheeling. - this._renderer.zoomFlag = false; - } - if (this.mouseIsPressed) { - if (this.mouseButton === this.LEFT) { - deltaTheta = - sensitivityX * this.movedX / scaleFactor; - deltaPhi = sensitivityY * this.movedY / scaleFactor; - } else if (this.mouseButton === this.RIGHT) { - moveDeltaX = this.movedX; - moveDeltaY = this.movedY * cam.yScale; - } // start rotate and move when mouse is pressed within the canvas. - - if (pointersInCanvas) this._renderer.executeRotateAndMove = true; - } else { - // quit rotate and move if mouse is released. - this._renderer.executeRotateAndMove = false; - } - } // interactions - // zoom process - - if (deltaRadius !== 0 && this._renderer.executeZoom) { - // accelerate zoom velocity - this._renderer.zoomVelocity += deltaRadius; - } - if (Math.abs(this._renderer.zoomVelocity) > 0.001) { - // if freeRotation is true, we use _orbitFree() instead of _orbit() - if (freeRotation) { - cam._orbitFree(0, 0, this._renderer.zoomVelocity); - } else { - cam._orbit(0, 0, this._renderer.zoomVelocity); - } // In orthogonal projection, the scale does not change even if - // the distance to the gaze point is changed, so the projection matrix - // needs to be modified. - - if (cam.projMatrix.mat4[15] !== 0) { - cam.projMatrix.mat4[0] *= Math.pow(10, - this._renderer.zoomVelocity); - cam.projMatrix.mat4[5] *= Math.pow(10, - this._renderer.zoomVelocity); - // modify uPMatrix - this._renderer.uPMatrix.mat4[0] = cam.projMatrix.mat4[0]; - this._renderer.uPMatrix.mat4[5] = cam.projMatrix.mat4[5]; - } // damping - - this._renderer.zoomVelocity *= damping; - } else { - this._renderer.zoomVelocity = 0; - } // rotate process - - if ((deltaTheta !== 0 || deltaPhi !== 0) && this._renderer.executeRotateAndMove) { - // accelerate rotate velocity - this._renderer.rotateVelocity.add(deltaTheta * rotateAccelerationFactor, deltaPhi * rotateAccelerationFactor); - } - if (this._renderer.rotateVelocity.magSq() > 0.000001) { - // if freeRotation is true, the camera always rotates freely in the direction the pointer moves - if (freeRotation) { - cam._orbitFree( - this._renderer.rotateVelocity.x, this._renderer.rotateVelocity.y, 0); - } else { - cam._orbit(this._renderer.rotateVelocity.x, this._renderer.rotateVelocity.y, 0); - } // damping - - this._renderer.rotateVelocity.mult(damping); - } else { - this._renderer.rotateVelocity.set(0, 0); - } // move process - - if ((moveDeltaX !== 0 || moveDeltaY !== 0) && this._renderer.executeRotateAndMove) { - // Normalize movement distance - var ndcX = moveDeltaX * 2 / this.width; - var ndcY = - moveDeltaY * 2 / this.height; - // accelerate move velocity - this._renderer.moveVelocity.add(ndcX * moveAccelerationFactor, ndcY * moveAccelerationFactor); - } - if (this._renderer.moveVelocity.magSq() > 0.000001) { - // Translate the camera so that the entire object moves - // perpendicular to the line of sight when the mouse is moved - // or when the centers of gravity of the two touch pointers move. - var local = cam._getLocalAxes(); - // Calculate the z coordinate in the view coordinates of - // the center, that is, the distance to the view point - var diffX = cam.eyeX - cam.centerX; - var diffY = cam.eyeY - cam.centerY; - var diffZ = cam.eyeZ - cam.centerZ; - var viewZ = Math.sqrt(diffX * diffX + diffY * diffY + diffZ * diffZ); - // position vector of the center. - var cv = new _main.default.Vector(cam.centerX, cam.centerY, cam.centerZ); - // Calculate the normalized device coordinates of the center. - cv = cam.cameraMatrix.multiplyPoint(cv); - cv = this._renderer.uPMatrix.multiplyAndNormalizePoint(cv); - // Move the center by this distance - // in the normalized device coordinate system. - cv.x -= this._renderer.moveVelocity.x; - cv.y -= this._renderer.moveVelocity.y; - // Calculate the translation vector - // in the direction perpendicular to the line of sight of center. - var dx, - dy; - var uP = this._renderer.uPMatrix.mat4; - if (uP[15] === 0) { - dx = (uP[8] + cv.x) / uP[0] * viewZ; - dy = (uP[9] + cv.y) / uP[5] * viewZ; - } else { - dx = (cv.x - uP[12]) / uP[0]; - dy = (cv.y - uP[13]) / uP[5]; - } // translate the camera. - - cam.setPosition(cam.eyeX + dx * local.x[0] + dy * local.y[0], cam.eyeY + dx * local.x[1] + dy * local.y[1], cam.eyeZ + dx * local.x[2] + dy * local.y[2]); - // damping - this._renderer.moveVelocity.mult(damping); - } else { - this._renderer.moveVelocity.set(0, 0); - } - return this; - }; - /** - * debugMode() helps visualize 3D space by adding a grid to indicate where the - * ‘ground’ is in a sketch and an axes icon which indicates the +X, +Y, and +Z - * directions. This function can be called without parameters to create a - * default grid and axes icon, or it can be called according to the examples - * above to customize the size and position of the grid and/or axes icon. The - * grid is drawn using the most recently set stroke color and weight. To - * specify these parameters, add a call to stroke() and strokeWeight() - * just before the end of the draw() loop. - * - * By default, the grid will run through the origin (0,0,0) of the sketch - * along the XZ plane - * and the axes icon will be offset from the origin. Both the grid and axes - * icon will be sized according to the current canvas size. Note that because the - * grid runs parallel to the default camera view, it is often helpful to use - * debugMode along with orbitControl to allow full view of the grid. - * @method debugMode - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(); - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' - * ); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * // Press the spacebar to turn debugMode off! - * if (keyIsDown(32)) { - * noDebugMode(); - * } - * } - * - *
                - * @alt - * a 3D box is centered on a grid in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. the grid and icon disappear when the - * spacebar is pressed. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(GRID); - * describe('a 3D box is centered on a grid in a 3D sketch.'); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * } - * - *
                - * @alt - * a 3D box is centered on a grid in a 3D sketch. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(AXES); - * describe( - * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' - * ); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * } - * - *
                - * @alt - * a 3D box is centered in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(GRID, 100, 10, 0, 0, 0); - * describe('a 3D box is centered on a grid in a 3D sketch'); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * } - * - *
                - * @alt - * a 3D box is centered on a grid in a 3D sketch - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(100, 10, 0, 0, 0, 20, 0, -40, 0); - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' - * ); - * } - * - * function draw() { - * noStroke(); - * background(200); - * orbitControl(); - * box(15, 30); - * // set the stroke color and weight for the grid! - * stroke(255, 0, 150); - * strokeWeight(0.8); - * } - * - *
                - * @alt - * a 3D box is centered on a grid in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. - */ - /** - * @method debugMode - * @param {Constant} mode either GRID or AXES - */ - /** - * @method debugMode - * @param {Constant} mode - * @param {Number} [gridSize] size of one side of the grid - * @param {Number} [gridDivisions] number of divisions in the grid - * @param {Number} [xOff] X axis offset from origin (0,0,0) - * @param {Number} [yOff] Y axis offset from origin (0,0,0) - * @param {Number} [zOff] Z axis offset from origin (0,0,0) - */ - /** - * @method debugMode - * @param {Constant} mode - * @param {Number} [axesSize] size of axes icon - * @param {Number} [xOff] - * @param {Number} [yOff] - * @param {Number} [zOff] - */ - /** - * @method debugMode - * @param {Number} [gridSize] - * @param {Number} [gridDivisions] - * @param {Number} [gridXOff] - * @param {Number} [gridYOff] - * @param {Number} [gridZOff] - * @param {Number} [axesSize] - * @param {Number} [axesXOff] - * @param {Number} [axesYOff] - * @param {Number} [axesZOff] - */ - _main.default.prototype.debugMode = function () { - this._assert3d('debugMode'); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('debugMode', args); - // start by removing existing 'post' registered debug methods - for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { - // test for equality... - if (this._registeredMethods.post[i].toString() === this._grid().toString() || this._registeredMethods.post[i].toString() === this._axesIcon().toString()) { - this._registeredMethods.post.splice(i, 1); - } - } // then add new debugMode functions according to the argument list - - if (args[0] === constants.GRID) { - this.registerMethod('post', this._grid.call(this, args[1], args[2], args[3], args[4], args[5])); - } else if (args[0] === constants.AXES) { - this.registerMethod('post', this._axesIcon.call(this, args[1], args[2], args[3], args[4])); - } else { - this.registerMethod('post', this._grid.call(this, args[0], args[1], args[2], args[3], args[4])); - this.registerMethod('post', this._axesIcon.call(this, args[5], args[6], args[7], args[8])); - } - }; - /** - * Turns off debugMode() in a 3D sketch. - * @method noDebugMode - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(); - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' - * ); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * // Press the spacebar to turn debugMode off! - * if (keyIsDown(32)) { - * noDebugMode(); - * } - * } - * - *
                - * @alt - * a 3D box is centered on a grid in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. the grid and icon disappear when the - * spacebar is pressed. - */ - _main.default.prototype.noDebugMode = function () { - this._assert3d('noDebugMode'); - // start by removing existing 'post' registered debug methods - for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { - // test for equality... - if (this._registeredMethods.post[i].toString() === this._grid().toString() || this._registeredMethods.post[i].toString() === this._axesIcon().toString()) { - this._registeredMethods.post.splice(i, 1); - } - } - }; - /** - * For use with debugMode - * @private - * @method _grid - * @param {Number} [size] size of grid sides - * @param {Number} [div] number of grid divisions - * @param {Number} [xOff] offset of grid center from origin in X axis - * @param {Number} [yOff] offset of grid center from origin in Y axis - * @param {Number} [zOff] offset of grid center from origin in Z axis - */ - _main.default.prototype._grid = function (size, numDivs, xOff, yOff, zOff) { - if (typeof size === 'undefined') { - size = this.width / 2; - } - if (typeof numDivs === 'undefined') { - // ensure at least 2 divisions - numDivs = Math.round(size / 30) < 4 ? 4 : Math.round(size / 30); - } - if (typeof xOff === 'undefined') { - xOff = 0; - } - if (typeof yOff === 'undefined') { - yOff = 0; - } - if (typeof zOff === 'undefined') { - zOff = 0; - } - var spacing = size / numDivs; - var halfSize = size / 2; - return function () { - this.push(); - this.stroke(this._renderer.curStrokeColor[0] * 255, this._renderer.curStrokeColor[1] * 255, this._renderer.curStrokeColor[2] * 255); - this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0], this._renderer._curCamera.cameraMatrix.mat4[1], this._renderer._curCamera.cameraMatrix.mat4[2], this._renderer._curCamera.cameraMatrix.mat4[3], this._renderer._curCamera.cameraMatrix.mat4[4], this._renderer._curCamera.cameraMatrix.mat4[5], this._renderer._curCamera.cameraMatrix.mat4[6], this._renderer._curCamera.cameraMatrix.mat4[7], this._renderer._curCamera.cameraMatrix.mat4[8], this._renderer._curCamera.cameraMatrix.mat4[9], this._renderer._curCamera.cameraMatrix.mat4[10], this._renderer._curCamera.cameraMatrix.mat4[11], this._renderer._curCamera.cameraMatrix.mat4[12], this._renderer._curCamera.cameraMatrix.mat4[13], this._renderer._curCamera.cameraMatrix.mat4[14], this._renderer._curCamera.cameraMatrix.mat4[15]); - // Lines along X axis - for (var q = 0; q <= numDivs; q++) { - this.beginShape(this.LINES); - this.vertex( - halfSize + xOff, yOff, q * spacing - halfSize + zOff); - this.vertex( + halfSize + xOff, yOff, q * spacing - halfSize + zOff); - this.endShape(); - } // Lines along Z axis - - for (var i = 0; i <= numDivs; i++) { - this.beginShape(this.LINES); - this.vertex(i * spacing - halfSize + xOff, yOff, - halfSize + zOff); - this.vertex(i * spacing - halfSize + xOff, yOff, + halfSize + zOff); - this.endShape(); - } - this.pop(); - }; - }; - /** - * For use with debugMode - * @private - * @method _axesIcon - * @param {Number} [size] size of axes icon lines - * @param {Number} [xOff] offset of icon from origin in X axis - * @param {Number} [yOff] offset of icon from origin in Y axis - * @param {Number} [zOff] offset of icon from origin in Z axis - */ - _main.default.prototype._axesIcon = function (size, xOff, yOff, zOff) { - if (typeof size === 'undefined') { - size = this.width / 20 > 40 ? this.width / 20 : 40; - } - if (typeof xOff === 'undefined') { - xOff = - this.width / 4; - } - if (typeof yOff === 'undefined') { - yOff = xOff; - } - if (typeof zOff === 'undefined') { - zOff = xOff; - } - return function () { - this.push(); - this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0], this._renderer._curCamera.cameraMatrix.mat4[1], this._renderer._curCamera.cameraMatrix.mat4[2], this._renderer._curCamera.cameraMatrix.mat4[3], this._renderer._curCamera.cameraMatrix.mat4[4], this._renderer._curCamera.cameraMatrix.mat4[5], this._renderer._curCamera.cameraMatrix.mat4[6], this._renderer._curCamera.cameraMatrix.mat4[7], this._renderer._curCamera.cameraMatrix.mat4[8], this._renderer._curCamera.cameraMatrix.mat4[9], this._renderer._curCamera.cameraMatrix.mat4[10], this._renderer._curCamera.cameraMatrix.mat4[11], this._renderer._curCamera.cameraMatrix.mat4[12], this._renderer._curCamera.cameraMatrix.mat4[13], this._renderer._curCamera.cameraMatrix.mat4[14], this._renderer._curCamera.cameraMatrix.mat4[15]); - // X axis - this.strokeWeight(2); - this.stroke(255, 0, 0); - this.beginShape(this.LINES); - this.vertex(xOff, yOff, zOff); - this.vertex(xOff + size, yOff, zOff); - this.endShape(); - // Y axis - this.stroke(0, 255, 0); - this.beginShape(this.LINES); - this.vertex(xOff, yOff, zOff); - this.vertex(xOff, yOff + size, zOff); - this.endShape(); - // Z axis - this.stroke(0, 0, 255); - this.beginShape(this.LINES); - this.vertex(xOff, yOff, zOff); - this.vertex(xOff, yOff, zOff + size); - this.endShape(); - this.pop(); - }; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.math.hypot': 188, - 'core-js/modules/es.math.sign': 190, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 344: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module 3D - * @submodule Lights - * @for p5 - * @requires core - */ - /** - * Creates an ambient light with the given color. - * - * Ambient light does not come from a specific direction. - * Objects are evenly lit from all sides. Ambient lights are - * almost always used in combination with other types of lights. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method ambientLight - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @param {Number} [alpha] alpha value relative to current - * color range (default is 0-255) - * @chainable - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe('sphere with coral color under black light'); - * } - * function draw() { - * background(100); - * ambientLight(0); // black light (no light) - * ambientMaterial(255, 127, 80); // coral material - * sphere(40); - * } - * - *
                - * @alt - * sphere with coral color under black light - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe('sphere with coral color under white light'); - * } - * function draw() { - * background(100); - * ambientLight(255); // white light - * ambientMaterial(255, 127, 80); // coral material - * sphere(40); - * } - * - *
                - * @alt - * sphere with coral color under white light - * - * @example - *
                - * - * function setup() { - * createCanvas(100,100,WEBGL); - * camera(0,-100,300); - * } - * function draw() { - * background(230); - * ambientMaterial(237,34,93); //Pink Material - * ambientLight(mouseY); - * //As you move the mouse up to down it changes from no ambient light to full ambient light. - * rotateY(millis()/2000); - * box(100); - * } - * - *
                - * @alt - * pink ambient material cube under the ambient light - */ - /** - * @method ambientLight - * @param {Number} gray number specifying value between - * white and black - * @param {Number} [alpha] - * @chainable - */ - /** - * @method ambientLight - * @param {String} value a color string - * @chainable - */ - /** - * @method ambientLight - * @param {Number[]} values an array containing the red,green,blue & - * and alpha components of the color - * @chainable - */ - /** - * @method ambientLight - * @param {p5.Color} color color as a p5.Color - * @chainable - */ - - _main.default.prototype.ambientLight = function (v1, v2, v3, a) { - this._assert3d('ambientLight'); - _main.default._validateParameters('ambientLight', arguments); - var color = this.color.apply(this, arguments); - this._renderer.ambientLightColors.push(color._array[0], color._array[1], color._array[2]); - this._renderer._enableLighting = true; - return this; - }; - /** - * Sets the color of the specular highlight of a non-ambient light - * (i.e. all lights except ambientLight()). - * - * specularColor() affects only the lights which are created after - * it in the code. - * - * This function is used in combination with - * specularMaterial(). - * If a geometry does not use specularMaterial(), this function - * will have no effect. - * - * The default color is white (255, 255, 255), which is used if - * specularColor() is not explicitly called. - * - * Note: specularColor is equivalent to the Processing function - * lightSpecular. - * - * @method specularColor - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @chainable - * @example - *
                - * - * let setRedSpecularColor = true; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe( - * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' - * ); - * } - * - * function draw() { - * background(0); - * - * ambientLight(60); - * - * // add a point light to showcase specular color - * // -- use mouse location to position the light - * let lightPosX = mouseX - width / 2; - * let lightPosY = mouseY - height / 2; - * // -- set the light's specular color - * if (setRedSpecularColor) { - * specularColor(255, 0, 0); // red specular highlight - * } - * // -- create the light - * pointLight(200, 200, 200, lightPosX, lightPosY, 50); // white light - * - * // use specular material with high shininess - * specularMaterial(150); - * shininess(50); - * - * sphere(30, 64, 64); - * } - * - * function mouseClicked() { - * setRedSpecularColor = !setRedSpecularColor; - * } - * - *
                - * - * @alt - * Sphere with specular highlight. Clicking the mouse toggles the - * specular highlight color between red and the default white. - */ - /** - * @method specularColor - * @param {Number} gray number specifying value between - * white and black - * @chainable - */ - /** - * @method specularColor - * @param {String} value color as a CSS string - * @chainable - */ - /** - * @method specularColor - * @param {Number[]} values color as an array containing the - * red, green, and blue components - * @chainable - */ - /** - * @method specularColor - * @param {p5.Color} color color as a p5.Color - * @chainable - */ - _main.default.prototype.specularColor = function (v1, v2, v3) { - this._assert3d('specularColor'); - _main.default._validateParameters('specularColor', arguments); - var color = this.color.apply(this, arguments); - this._renderer.specularColors = [ - color._array[0], - color._array[1], - color._array[2] - ]; - return this; - }; - /** - * Creates a directional light with the given color and direction. - * - * Directional light comes from one direction. - * The direction is specified as numbers inclusively between -1 and 1. - * For example, setting the direction as (0, -1, 0) will cause the - * geometry to be lit from below (since the light will be facing - * directly upwards). Similarly, setting the direction as (1, 0, 0) - * will cause the geometry to be lit from the left (since the light - * will be facing directly rightwards). - * - * Directional lights do not have a specific point of origin, and - * therefore cannot be positioned closer or farther away from a geometry. - * - * A maximum of **5** directional lights can be active at once. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method directionalLight - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @param {Number} x x component of direction (inclusive range of -1 to 1) - * @param {Number} y y component of direction (inclusive range of -1 to 1) - * @param {Number} z z component of direction (inclusive range of -1 to 1) - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' - * ); - * } - * function draw() { - * background(0); - * //move your mouse to change light direction - * let dirX = (mouseX / width - 0.5) * 2; - * let dirY = (mouseY / height - 0.5) * 2; - * directionalLight(250, 250, 250, -dirX, -dirY, -1); - * noStroke(); - * sphere(40); - * } - * - *
                - * - * @alt - * scene with sphere and directional light. The direction of - * the light is controlled with the mouse position. - */ - /** - * @method directionalLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} direction direction of light as a - * p5.Vector - * @chainable - */ - /** - * @method directionalLight - * @param {p5.Color|Number[]|String} color color as a p5.Color, - * as an array, or as a CSS string - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @chainable - */ - /** - * @method directionalLight - * @param {p5.Color|Number[]|String} color - * @param {p5.Vector} direction - * @chainable - */ - _main.default.prototype.directionalLight = function (v1, v2, v3, x, y, z) { - this._assert3d('directionalLight'); - _main.default._validateParameters('directionalLight', arguments); - //@TODO: check parameters number - var color; - if (v1 instanceof _main.default.Color) { - color = v1; - } else { - color = this.color(v1, v2, v3); - } - var _x, - _y, - _z; - var v = arguments[arguments.length - 1]; - if (typeof v === 'number') { - _x = arguments[arguments.length - 3]; - _y = arguments[arguments.length - 2]; - _z = arguments[arguments.length - 1]; - } else { - _x = v.x; - _y = v.y; - _z = v.z; - } // normalize direction - - var l = Math.sqrt(_x * _x + _y * _y + _z * _z); - this._renderer.directionalLightDirections.push(_x / l, _y / l, _z / l); - this._renderer.directionalLightDiffuseColors.push(color._array[0], color._array[1], color._array[2]); - Array.prototype.push.apply(this._renderer.directionalLightSpecularColors, this._renderer.specularColors); - this._renderer._enableLighting = true; - return this; - }; - /** - * Creates a point light with the given color and position. - * - * A point light emits light from a single point in all directions. - * Because the light is emitted from a specific point (position), - * it has a different effect when it is positioned farther vs. nearer - * an object. - * - * A maximum of **5** point lights can be active at once. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method pointLight - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @param {Number} x x component of position - * @param {Number} y y component of position - * @param {Number} z z component of position - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' - * ); - * } - * function draw() { - * background(0); - * // move your mouse to change light position - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * // to set the light position, - * // think of the world's coordinate as: - * // -width/2,-height/2 ----------- width/2,-height/2 - * // | | - * // | 0,0 | - * // | | - * // -width/2,height/2 ----------- width/2,height/2 - * pointLight(250, 250, 250, locX, locY, 50); - * noStroke(); - * sphere(40); - * } - * - *
                - * - * @alt - * scene with sphere and point light. The position of - * the light is controlled with the mouse position. - */ - /** - * @method pointLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position of light as a p5.Vector - * @chainable - */ - /** - * @method pointLight - * @param {p5.Color|Number[]|String} color color as a p5.Color, - * as an array, or as a CSS string - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @chainable - */ - /** - * @method pointLight - * @param {p5.Color|Number[]|String} color - * @param {p5.Vector} position - * @chainable - */ - _main.default.prototype.pointLight = function (v1, v2, v3, x, y, z) { - this._assert3d('pointLight'); - _main.default._validateParameters('pointLight', arguments); - //@TODO: check parameters number - var color; - if (v1 instanceof _main.default.Color) { - color = v1; - } else { - color = this.color(v1, v2, v3); - } - var _x, - _y, - _z; - var v = arguments[arguments.length - 1]; - if (typeof v === 'number') { - _x = arguments[arguments.length - 3]; - _y = arguments[arguments.length - 2]; - _z = arguments[arguments.length - 1]; - } else { - _x = v.x; - _y = v.y; - _z = v.z; - } - this._renderer.pointLightPositions.push(_x, _y, _z); - this._renderer.pointLightDiffuseColors.push(color._array[0], color._array[1], color._array[2]); - Array.prototype.push.apply(this._renderer.pointLightSpecularColors, this._renderer.specularColors); - this._renderer._enableLighting = true; - return this; - }; - /** - * Creates an image light with the given image. - * - * The image light simulates light from all the directions. - * This is done by using the image as a texture for an infinitely - * large sphere light. This sphere contains - * or encapsulates the whole scene/drawing. - * It will have different effect for varying shininess of the - * object in the drawing. - * Under the hood it is mainly doing 2 types of calculations, - * the first one is creating an irradiance map the - * environment map of the input image. - * The second one is managing reflections based on the shininess - * or roughness of the material used in the scene. - * - * Note: The image's diffuse light will be affected by fill() - * and the specular reflections will be affected by specularMaterial() - * and shininess(). - * - * @method imageLight - * @param {p5.image} img image for the background - * @example - *
                - * - * let img; - * function preload() { - * img = loadImage('assets/outdoor_image.jpg'); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(220); - * imageMode(CENTER); - * push(); - * translate(0, 0, -200); - * scale(2); - * image(img, 0, 0, width, height); - * pop(); - * ambientLight(50); - * imageLight(img); - * specularMaterial(20); - * noStroke(); - * scale(2); - * rotateX(frameCount * 0.005); - * rotateY(frameCount * 0.005); - * box(25); - * } - * - *
                - * @alt - * image light example - * @example - *
                - * - * let img; - * let slider; - * function preload() { - * img = loadImage('assets/outdoor_spheremap.jpg'); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * slider = createSlider(0, 400, 100, 1); - * slider.position(0, height); - * } - * function draw() { - * background(220); - * imageMode(CENTER); - * push(); - * translate(0, 0, -200); - * scale(2); - * image(img, 0, 0, width, height); - * pop(); - * ambientLight(50); - * imageLight(img); - * specularMaterial(20); - * shininess(slider.value()); - * noStroke(); - * scale(2); - * sphere(15); - * } - * - *
                - * @alt - * light with slider having a slider for varying roughness - */ - _main.default.prototype.imageLight = function (img) { - // activeImageLight property is checked by _setFillUniforms - // for sending uniforms to the fillshader - this._renderer.activeImageLight = img; - this._renderer._enableLighting = true; - }; - /** - * Places an ambient and directional light in the scene. - * The lights are set to ambientLight(128, 128, 128) and - * directionalLight(128, 128, 128, 0, 0, -1). - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method lights - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('the light is partially ambient and partially directional'); - * } - * function draw() { - * background(0); - * lights(); - * rotateX(millis() / 1000); - * rotateY(millis() / 1000); - * rotateZ(millis() / 1000); - * box(); - * } - * - *
                - * - * @alt - * the light is partially ambient and partially directional - */ - _main.default.prototype.lights = function () { - this._assert3d('lights'); - // Both specify gray by default. - var grayColor = this.color('rgb(128,128,128)'); - this.ambientLight(grayColor); - this.directionalLight(grayColor, 0, 0, - 1); - return this; - }; - /** - * Sets the falloff rate for pointLight() - * and spotLight(). - * - * lightFalloff() affects only the lights which are created after it - * in the code. - * - * The `constant`, `linear`, an `quadratic` parameters are used to calculate falloff as follows: - * - * d = distance from light position to vertex position - * - * falloff = 1 / (CONSTANT + d \* LINEAR + (d \* d) \* QUADRATIC) - * - * @method lightFalloff - * @param {Number} constant CONSTANT value for determining falloff - * @param {Number} linear LINEAR value for determining falloff - * @param {Number} quadratic QUADRATIC value for determining falloff - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe( - * 'Two spheres with different falloff values show different intensity of light' - * ); - * } - * function draw() { - * ortho(); - * background(0); - * - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * locX /= 2; // half scale - * - * lightFalloff(1, 0, 0); - * push(); - * translate(-25, 0, 0); - * pointLight(250, 250, 250, locX - 25, locY, 50); - * sphere(20); - * pop(); - * - * lightFalloff(0.97, 0.03, 0); - * push(); - * translate(25, 0, 0); - * pointLight(250, 250, 250, locX + 25, locY, 50); - * sphere(20); - * pop(); - * } - * - *
                - * - * @alt - * Two spheres with different falloff values show different intensity of light - */ - _main.default.prototype.lightFalloff = function (constantAttenuation, linearAttenuation, quadraticAttenuation) { - this._assert3d('lightFalloff'); - _main.default._validateParameters('lightFalloff', arguments); - if (constantAttenuation < 0) { - constantAttenuation = 0; - console.warn('Value of constant argument in lightFalloff() should be never be negative. Set to 0.'); - } - if (linearAttenuation < 0) { - linearAttenuation = 0; - console.warn('Value of linear argument in lightFalloff() should be never be negative. Set to 0.'); - } - if (quadraticAttenuation < 0) { - quadraticAttenuation = 0; - console.warn('Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.'); - } - if (constantAttenuation === 0 && linearAttenuation === 0 && quadraticAttenuation === 0) { - constantAttenuation = 1; - console.warn('Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.'); - } - this._renderer.constantAttenuation = constantAttenuation; - this._renderer.linearAttenuation = linearAttenuation; - this._renderer.quadraticAttenuation = quadraticAttenuation; - return this; - }; - /** - * Creates a spot light with the given color, position, - * light direction, angle, and concentration. - * - * Like a pointLight(), a spotLight() - * emits light from a specific point (position). It has a different effect - * when it is positioned farther vs. nearer an object. - * - * However, unlike a pointLight(), the light is emitted in **one direction** - * along a conical shape. The shape of the cone can be controlled using - * the `angle` and `concentration` parameters. - * - * The `angle` parameter is used to - * determine the radius of the cone. And the `concentration` - * parameter is used to focus the light towards the center of - * the cone. Both parameters are optional, however if you want - * to specify `concentration`, you must also specify `angle`. - * The minimum concentration value is 1. - * - * A maximum of **5** spot lights can be active at once. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method spotLight - * @param {Number} v1 red or hue value relative to the current color range - * @param {Number} v2 green or saturation value relative to the current color range - * @param {Number} v3 blue or brightness value relative to the current color range - * @param {Number} x x component of position - * @param {Number} y y component of position - * @param {Number} z z component of position - * @param {Number} rx x component of light direction (inclusive range of -1 to 1) - * @param {Number} ry y component of light direction (inclusive range of -1 to 1) - * @param {Number} rz z component of light direction (inclusive range of -1 to 1) - * @param {Number} [angle] angle of cone. Defaults to PI/3 - * @param {Number} [concentration] concentration of cone. Defaults to 100 - * @chainable - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' - * ); - * } - * function draw() { - * background(0); - * // move your mouse to change light position - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * // to set the light position, - * // think of the world's coordinate as: - * // -width/2,-height/2 ----------- width/2,-height/2 - * // | | - * // | 0,0 | - * // | | - * // -width/2,height/2 ----------- width/2,height/2 - * ambientLight(50); - * spotLight(0, 250, 0, locX, locY, 100, 0, 0, -1, Math.PI / 16); - * noStroke(); - * sphere(40); - * } - * - *
                - * - * @alt - * scene with sphere and spot light. The position of - * the light is controlled with the mouse position. - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color color as a p5.Color, - * as an array, or as a CSS string - * @param {p5.Vector} position position of light as a p5.Vector - * @param {p5.Vector} direction direction of light as a p5.Vector - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position - * @param {p5.Vector} direction - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {p5.Vector} direction - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color - * @param {p5.Vector} position - * @param {Number} rx - * @param {Number} ry - * @param {Number} rz - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {p5.Vector} direction - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position - * @param {Number} rx - * @param {Number} ry - * @param {Number} rz - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {Number} rx - * @param {Number} ry - * @param {Number} rz - * @param {Number} [angle] - * @param {Number} [concentration] - */ - _main.default.prototype.spotLight = function (v1, v2, v3, x, y, z, nx, ny, nz, angle, concentration) { - this._assert3d('spotLight'); - _main.default._validateParameters('spotLight', arguments); - var color, - position, - direction; - var length = arguments.length; - switch (length) { - case 11: - case 10: - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = new _main.default.Vector(nx, ny, nz); - break; - case 9: - if (v1 instanceof _main.default.Color) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = new _main.default.Vector(y, z, nx); - angle = ny; - concentration = nz; - } else if (x instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = new _main.default.Vector(y, z, nx); - angle = ny; - concentration = nz; - } else if (nx instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = nx; - angle = ny; - concentration = nz; - } else { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = new _main.default.Vector(nx, ny, nz); - } - break; - case 8: - if (v1 instanceof _main.default.Color) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = new _main.default.Vector(y, z, nx); - angle = ny; - } else if (x instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = new _main.default.Vector(y, z, nx); - angle = ny; - } else { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = nx; - angle = ny; - } - break; - case 7: - if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector) { - color = v1; - position = v2; - direction = new _main.default.Vector(v3, x, y); - angle = z; - concentration = nx; - } else if (v1 instanceof _main.default.Color && y instanceof _main.default.Vector) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = y; - angle = z; - concentration = nx; - } else if (x instanceof _main.default.Vector && y instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = y; - angle = z; - concentration = nx; - } else if (v1 instanceof _main.default.Color) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = new _main.default.Vector(y, z, nx); - } else if (x instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = new _main.default.Vector(y, z, nx); - } else { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = nx; - } - break; - case 6: - if (x instanceof _main.default.Vector && y instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = y; - angle = z; - } else if (v1 instanceof _main.default.Color && y instanceof _main.default.Vector) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = y; - angle = z; - } else if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector) { - color = v1; - position = v2; - direction = new _main.default.Vector(v3, x, y); - angle = z; - } - break; - case 5: - if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector && v3 instanceof _main.default.Vector) { - color = v1; - position = v2; - direction = v3; - angle = x; - concentration = y; - } else if (x instanceof _main.default.Vector && y instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = y; - } else if (v1 instanceof _main.default.Color && y instanceof _main.default.Vector) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = y; - } else if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector) { - color = v1; - position = v2; - direction = new _main.default.Vector(v3, x, y); - } - break; - case 4: - color = v1; - position = v2; - direction = v3; - angle = x; - break; - case 3: - color = v1; - position = v2; - direction = v3; - break; - default: - console.warn('Sorry, input for spotlight() is not in prescribed format. Too '.concat(length < 3 ? 'few' : 'many', ' arguments were provided')); - return this; - } - this._renderer.spotLightDiffuseColors.push(color._array[0], color._array[1], color._array[2]); - Array.prototype.push.apply(this._renderer.spotLightSpecularColors, this._renderer.specularColors); - this._renderer.spotLightPositions.push(position.x, position.y, position.z); - direction.normalize(); - this._renderer.spotLightDirections.push(direction.x, direction.y, direction.z); - if (angle === undefined) { - angle = Math.PI / 3; - } - if (concentration !== undefined && concentration < 1) { - concentration = 1; - console.warn('Value of concentration needs to be greater than 1. Setting it to 1'); - } else if (concentration === undefined) { - concentration = 100; - } - angle = this._renderer._pInst._toRadians(angle); - this._renderer.spotLightAngle.push(Math.cos(angle)); - this._renderer.spotLightConc.push(concentration); - this._renderer._enableLighting = true; - return this; - }; - /** - * Removes all lights present in a sketch. - * - * All subsequent geometry is rendered without lighting (until a new - * light is created with a call to one of the lighting functions - * (lights(), - * ambientLight(), - * directionalLight(), - * pointLight(), - * spotLight()). - * - * @method noLights - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'Three white spheres. Each appears as a different color due to lighting.' - * ); - * } - * function draw() { - * background(200); - * noStroke(); - * - * ambientLight(255, 0, 0); - * translate(-30, 0, 0); - * ambientMaterial(255); - * sphere(13); - * - * noLights(); - * translate(30, 0, 0); - * ambientMaterial(255); - * sphere(13); - * - * ambientLight(0, 255, 0); - * translate(30, 0, 0); - * ambientMaterial(255); - * sphere(13); - * } - * - *
                - * - * @alt - * Three white spheres. Each appears as a different - * color due to lighting. - */ - _main.default.prototype.noLights = function () { - this._assert3d('noLights'); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('noLights', args); - this._renderer._enableLighting = false; - this._renderer.ambientLightColors.length = 0; - this._renderer.specularColors = [ - 1, - 1, - 1 - ]; - this._renderer.directionalLightDirections.length = 0; - this._renderer.directionalLightDiffuseColors.length = 0; - this._renderer.directionalLightSpecularColors.length = 0; - this._renderer.pointLightPositions.length = 0; - this._renderer.pointLightDiffuseColors.length = 0; - this._renderer.pointLightSpecularColors.length = 0; - this._renderer.spotLightPositions.length = 0; - this._renderer.spotLightDirections.length = 0; - this._renderer.spotLightDiffuseColors.length = 0; - this._renderer.spotLightSpecularColors.length = 0; - this._renderer.spotLightAngle.length = 0; - this._renderer.spotLightConc.length = 0; - this._renderer.constantAttenuation = 1; - this._renderer.linearAttenuation = 0; - this._renderer.quadraticAttenuation = 0; - this._renderer._useShininess = 1; - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298 - } - ], - 345: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.splice'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.match'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.trim'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - _dereq_('./p5.Geometry'); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module Shape - * @submodule 3D Models - * @for p5 - * @requires core - * @requires p5.Geometry - */ - /** - * Load a 3d model from an OBJ or STL file. - * - * loadModel() should be placed inside of preload(). - * This allows the model to load fully before the rest of your code is run. - * - * One of the limitations of the OBJ and STL format is that it doesn't have a built-in - * sense of scale. This means that models exported from different programs might - * be very different sizes. If your model isn't displaying, try calling - * loadModel() with the normalized parameter set to true. This will resize the - * model to a scale appropriate for p5. You can also make additional changes to - * the final size of your model with the scale() function. - * - * Also, the support for colored STL files is not present. STL files with color will be - * rendered without color properties. - * - * @method loadModel - * @param {String} path Path of the model to be loaded - * @param {Boolean} normalize If true, scale the model to a - * standardized size when loading - * @param {function(p5.Geometry)} [successCallback] Function to be called - * once the model is loaded. Will be passed - * the 3D model object. - * @param {function(Event)} [failureCallback] called with event error if - * the model fails to load. - * @param {String} [fileType] The file extension of the model - * (.stl, .obj). - * @return {p5.Geometry} the p5.Geometry object - * - * @example - *
                - * - * //draw a spinning octahedron - * let octahedron; - * - * function preload() { - * octahedron = loadModel('assets/octahedron.obj'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Vertically rotating 3-d octahedron.'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * model(octahedron); - * } - * - *
                - * - * @alt - * Vertically rotating 3-d octahedron. - * - * @example - *
                - * - * //draw a spinning teapot - * let teapot; - * - * function preload() { - * // Load model with normalise parameter set to true - * teapot = loadModel('assets/teapot.obj', true); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); - * } - * - * function draw() { - * background(200); - * scale(0.4); // Scaled to make model fit into canvas - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * normalMaterial(); // For effect - * model(teapot); - * } - * - *
                - * - * @alt - * Vertically rotating 3-d teapot with red, green and blue gradient. - */ - /** - * @method loadModel - * @param {String} path - * @param {function(p5.Geometry)} [successCallback] - * @param {function(Event)} [failureCallback] - * @param {String} [fileType] - * @return {p5.Geometry} the p5.Geometry object - */ - - _main.default.prototype.loadModel = function (path) { - _main.default._validateParameters('loadModel', arguments); - var normalize; - var successCallback; - var failureCallback; - var fileType = path.slice( - 4); - if (typeof arguments[1] === 'boolean') { - normalize = arguments[1]; - successCallback = arguments[2]; - failureCallback = arguments[3]; - if (typeof arguments[4] !== 'undefined') { - fileType = arguments[4]; - } - } else { - normalize = false; - successCallback = arguments[1]; - failureCallback = arguments[2]; - if (typeof arguments[3] !== 'undefined') { - fileType = arguments[3]; - } - } - var model = new _main.default.Geometry(); - model.gid = ''.concat(path, '|').concat(normalize); - var self = this; - if (fileType.match(/\.stl$/i)) { - this.httpDo(path, 'GET', 'arrayBuffer', function (arrayBuffer) { - parseSTL(model, arrayBuffer); - if (normalize) { - model.normalize(); - } - self._decrementPreload(); - if (typeof successCallback === 'function') { - successCallback(model); - } - }, failureCallback); - } else if (fileType.match(/\.obj$/i)) { - this.loadStrings(path, function (strings) { - parseObj(model, strings); - if (normalize) { - model.normalize(); - } - self._decrementPreload(); - if (typeof successCallback === 'function') { - successCallback(model); - } - }, failureCallback); - } else { - _main.default._friendlyFileLoadError(3, path); - if (failureCallback) { - failureCallback(); - } else { - _main.default._friendlyError('Sorry, the file type is invalid. Only OBJ and STL files are supported.'); - } - } - return model; - }; - /** - * Parse OBJ lines into model. For reference, this is what a simple model of a - * square might look like: - * - * v -0.5 -0.5 0.5 - * v -0.5 -0.5 -0.5 - * v -0.5 0.5 -0.5 - * v -0.5 0.5 0.5 - * - * f 4 3 2 1 - */ - function parseObj(model, lines) { - // OBJ allows a face to specify an index for a vertex (in the above example), - // but it also allows you to specify a custom combination of vertex, UV - // coordinate, and vertex normal. So, "3/4/3" would mean, "use vertex 3 with - // UV coordinate 4 and vertex normal 3". In WebGL, every vertex with different - // parameters must be a different vertex, so loadedVerts is used to - // temporarily store the parsed vertices, normals, etc., and indexedVerts is - // used to map a specific combination (keyed on, for example, the string - // "3/4/3"), to the actual index of the newly created vertex in the final - // object. - var loadedVerts = { - v: [ - ], - vt: [ - ], - vn: [ - ] - }; - var indexedVerts = { - }; - for (var line = 0; line < lines.length; ++line) { - // Each line is a separate object (vertex, face, vertex normal, etc) - // For each line, split it into tokens on whitespace. The first token - // describes the type. - var tokens = lines[line].trim().split(/\b\s+/); - if (tokens.length > 0) { - if (tokens[0] === 'v' || tokens[0] === 'vn') { - // Check if this line describes a vertex or vertex normal. - // It will have three numeric parameters. - var vertex = new _main.default.Vector(parseFloat(tokens[1]), parseFloat(tokens[2]), parseFloat(tokens[3])); - loadedVerts[tokens[0]].push(vertex); - } else if (tokens[0] === 'vt') { - // Check if this line describes a texture coordinate. - // It will have two numeric parameters U and V (W is omitted). - // Because of WebGL texture coordinates rendering behaviour, the V - // coordinate is inversed. - var texVertex = [ - parseFloat(tokens[1]), - 1 - parseFloat(tokens[2]) - ]; - loadedVerts[tokens[0]].push(texVertex); - } else if (tokens[0] === 'f') { - // Check if this line describes a face. - // OBJ faces can have more than three points. Triangulate points. - for (var tri = 3; tri < tokens.length; ++tri) { - var face = [ - ]; - var vertexTokens = [ - 1, - tri - 1, - tri - ]; - for (var tokenInd = 0; tokenInd < vertexTokens.length; ++tokenInd) { - // Now, convert the given token into an index - var vertString = tokens[vertexTokens[tokenInd]]; - var vertIndex = 0; - // TODO: Faces can technically use negative numbers to refer to the - // previous nth vertex. I haven't seen this used in practice, but - // it might be good to implement this in the future. - if (indexedVerts[vertString] !== undefined) { - vertIndex = indexedVerts[vertString]; - } else { - var vertParts = vertString.split('/'); - for (var i = 0; i < vertParts.length; i++) { - vertParts[i] = parseInt(vertParts[i]) - 1; - } - vertIndex = indexedVerts[vertString] = model.vertices.length; - model.vertices.push(loadedVerts.v[vertParts[0]].copy()); - if (loadedVerts.vt[vertParts[1]]) { - model.uvs.push(loadedVerts.vt[vertParts[1]].slice()); - } else { - model.uvs.push([0, - 0]); - } - if (loadedVerts.vn[vertParts[2]]) { - model.vertexNormals.push(loadedVerts.vn[vertParts[2]].copy()); - } - } - face.push(vertIndex); - } - if (face[0] !== face[1] && face[0] !== face[2] && face[1] !== face[2]) { - model.faces.push(face); - } - } - } - } - } // If the model doesn't have normals, compute the normals - - if (model.vertexNormals.length === 0) { - model.computeNormals(); - } - return model; - } /** - * STL files can be of two types, ASCII and Binary, - * - * We need to convert the arrayBuffer to an array of strings, - * to parse it as an ASCII file. - */ - - function parseSTL(model, buffer) { - if (isBinary(buffer)) { - parseBinarySTL(model, buffer); - } else { - var reader = new DataView(buffer); - if (!('TextDecoder' in window)) { - console.warn('Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)'); - return model; - } - var decoder = new TextDecoder('utf-8'); - var lines = decoder.decode(reader); - var lineArray = lines.split('\n'); - parseASCIISTL(model, lineArray); - } - return model; - } /** - * This function checks if the file is in ASCII format or in Binary format - * - * It is done by searching keyword `solid` at the start of the file. - * - * An ASCII STL data must begin with `solid` as the first six bytes. - * However, ASCII STLs lacking the SPACE after the `d` are known to be - * plentiful. So, check the first 5 bytes for `solid`. - * - * Several encodings, such as UTF-8, precede the text with up to 5 bytes: - * https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding - * Search for `solid` to start anywhere after those prefixes. - */ - - function isBinary(data) { - var reader = new DataView(data); - // US-ASCII ordinal values for `s`, `o`, `l`, `i`, `d` - var solid = [ - 115, - 111, - 108, - 105, - 100 - ]; - for (var off = 0; off < 5; off++) { - // If "solid" text is matched to the current offset, declare it to be an ASCII STL. - if (matchDataViewAt(solid, reader, off)) return false; - } // Couldn't find "solid" text at the beginning; it is binary STL. - - return true; - } /** - * This function matches the `query` at the provided `offset` - */ - - function matchDataViewAt(query, reader, offset) { - // Check if each byte in query matches the corresponding byte from the current offset - for (var i = 0, il = query.length; i < il; i++) { - if (query[i] !== reader.getUint8(offset + i, false)) return false; - } - return true; - } /** - * This function parses the Binary STL files. - * https://en.wikipedia.org/wiki/STL_%28file_format%29#Binary_STL - * - * Currently there is no support for the colors provided in STL files. - */ - - function parseBinarySTL(model, buffer) { - var reader = new DataView(buffer); - // Number of faces is present following the header - var faces = reader.getUint32(80, true); - var r, - g, - b, - hasColors = false, - colors; - var defaultR, - defaultG, - defaultB; - // Binary files contain 80-byte header, which is generally ignored. - for (var index = 0; index < 80 - 10; index++) { - // Check for `COLOR=` - if (reader.getUint32(index, false) === 1129270351 /*COLO*/ && reader.getUint8(index + 4) === 82 /*'R'*/ && reader.getUint8(index + 5) === 61 /*'='*/ ) { - hasColors = true; - colors = [ - ]; - defaultR = reader.getUint8(index + 6) / 255; - defaultG = reader.getUint8(index + 7) / 255; - defaultB = reader.getUint8(index + 8) / 255; - // To be used when color support is added - // alpha = reader.getUint8(index + 9) / 255; - } - } - var dataOffset = 84; - var faceLength = 12 * 4 + 2; - // Iterate the faces - for (var face = 0; face < faces; face++) { - var start = dataOffset + face * faceLength; - var normalX = reader.getFloat32(start, true); - var normalY = reader.getFloat32(start + 4, true); - var normalZ = reader.getFloat32(start + 8, true); - if (hasColors) { - var packedColor = reader.getUint16(start + 48, true); - if ((packedColor & 32768) === 0) { - // facet has its own unique color - r = (packedColor & 31) / 31; - g = (packedColor >> 5 & 31) / 31; - b = (packedColor >> 10 & 31) / 31; - } else { - r = defaultR; - g = defaultG; - b = defaultB; - } - } - var newNormal = new _main.default.Vector(normalX, normalY, normalZ); - for (var i = 1; i <= 3; i++) { - var vertexstart = start + i * 12; - var newVertex = new _main.default.Vector(reader.getFloat32(vertexstart, true), reader.getFloat32(vertexstart + 4, true), reader.getFloat32(vertexstart + 8, true)); - model.vertices.push(newVertex); - model.vertexNormals.push(newNormal); - if (hasColors) { - colors.push(r, g, b); - } - } - model.faces.push([3 * face, - 3 * face + 1, - 3 * face + 2]); - model.uvs.push([0, - 0], [ - 0, - 0 - ], [ - 0, - 0 - ]); - } - if (hasColors) { - // add support for colors here. - } - return model; - } /** - * ASCII STL file starts with `solid 'nameOfFile'` - * Then contain the normal of the face, starting with `facet normal` - * Next contain a keyword indicating the start of face vertex, `outer loop` - * Next comes the three vertex, starting with `vertex x y z` - * Vertices ends with `endloop` - * Face ends with `endfacet` - * Next face starts with `facet normal` - * The end of the file is indicated by `endsolid` - */ - - function parseASCIISTL(model, lines) { - var state = ''; - var curVertexIndex = [ - ]; - var newNormal, - newVertex; - for (var iterator = 0; iterator < lines.length; ++iterator) { - var line = lines[iterator].trim(); - var parts = line.split(' '); - for (var partsiterator = 0; partsiterator < parts.length; ++partsiterator) { - if (parts[partsiterator] === '') { - // Ignoring multiple whitespaces - parts.splice(partsiterator, 1); - } - } - if (parts.length === 0) { - // Remove newline - continue; - } - switch (state) { - case '': - // First run - if (parts[0] !== 'solid') { - // Invalid state - console.error(line); - console.error('Invalid state "'.concat(parts[0], '", should be "solid"')); - return; - } else { - state = 'solid'; - } - break; - case 'solid': - // First face - if (parts[0] !== 'facet' || parts[1] !== 'normal') { - // Invalid state - console.error(line); - console.error('Invalid state "'.concat(parts[0], '", should be "facet normal"')); - return; - } else { - // Push normal for first face - newNormal = new _main.default.Vector(parseFloat(parts[2]), parseFloat(parts[3]), parseFloat(parts[4])); - model.vertexNormals.push(newNormal, newNormal, newNormal); - state = 'facet normal'; - } - break; - case 'facet normal': - // After normal is defined - if (parts[0] !== 'outer' || parts[1] !== 'loop') { - // Invalid State - console.error(line); - console.error('Invalid state "'.concat(parts[0], '", should be "outer loop"')); - return; - } else { - // Next should be vertices - state = 'vertex'; - } - break; - case 'vertex': - if (parts[0] === 'vertex') { - //Vertex of triangle - newVertex = new _main.default.Vector(parseFloat(parts[1]), parseFloat(parts[2]), parseFloat(parts[3])); - model.vertices.push(newVertex); - model.uvs.push([0, - 0]); - curVertexIndex.push(model.vertices.indexOf(newVertex)); - } else if (parts[0] === 'endloop') { - // End of vertices - model.faces.push(curVertexIndex); - curVertexIndex = [ - ]; - state = 'endloop'; - } else { - // Invalid State - console.error(line); - console.error('Invalid state "'.concat(parts[0], '", should be "vertex" or "endloop"')); - return; - } - break; - case 'endloop': - if (parts[0] !== 'endfacet') { - // End of face - console.error(line); - console.error('Invalid state "'.concat(parts[0], '", should be "endfacet"')); - return; - } else { - state = 'endfacet'; - } - break; - case 'endfacet': - if (parts[0] === 'endsolid') { - // End of solid - } else if (parts[0] === 'facet' && parts[1] === 'normal') { - // Next face - newNormal = new _main.default.Vector(parseFloat(parts[2]), parseFloat(parts[3]), parseFloat(parts[4])); - model.vertexNormals.push(newNormal, newNormal, newNormal); - state = 'facet normal'; - } else { - // Invalid State - console.error(line); - console.error('Invalid state "'.concat(parts[0], '", should be "endsolid" or "facet normal"')); - return; - } - break; - default: - console.error('Invalid state "'.concat(state, '"')); - break; - } - } - return model; - } /** - * Render a 3d model to the screen. - * - * @method model - * @param {p5.Geometry} model Loaded 3d model to be rendered - * @example - *
                - * - * //draw a spinning octahedron - * let octahedron; - * - * function preload() { - * octahedron = loadModel('assets/octahedron.obj'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Vertically rotating 3-d octahedron.'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * model(octahedron); - * } - * - *
                - * - * @alt - * Vertically rotating 3-d octahedron. - */ - - _main.default.prototype.model = function (model) { - this._assert3d('model'); - _main.default._validateParameters('model', arguments); - if (model.vertices.length > 0) { - if (!this._renderer.geometryInHash(model.gid)) { - if (model.edges.length === 0) { - model._makeTriangleEdges(); - } - model._edgesToVertices(); - this._renderer.createBuffers(model.gid, model); - } - this._renderer.drawBuffers(model.gid); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/main': 298, - './p5.Geometry': 350, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.splice': 185, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.match': 211, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.trim': 219 - } - ], - 346: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.join'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - _dereq_('./p5.Texture'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } /** - * @module 3D - * @submodule Material - * @for p5 - * @requires core - */ - /** - * Creates a new p5.Shader object - * from the provided vertex and fragment shader files. - * - * The shader files are loaded asynchronously in the - * background, so this method should be used in preload(). - * - * Shaders can alter the positioning of shapes drawn with them. - * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. - * - * Note, shaders can only be used in WEBGL mode. - * - * @method loadShader - * @param {String} vertFilename path to file containing vertex shader - * source code - * @param {String} fragFilename path to file containing fragment shader - * source code - * @param {function} [callback] callback to be executed after loadShader - * completes. On success, the p5.Shader object is passed as the first argument. - * @param {function} [errorCallback] callback to be executed when an error - * occurs inside loadShader. On error, the error is passed as the first - * argument. - * @return {p5.Shader} a shader object created from the provided - * vertex and fragment shader files. - * - * @example - *
                - * - * let mandel; - * function preload() { - * // load the shader definitions from files - * mandel = loadShader('assets/shader.vert', 'assets/shader.frag'); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * // use the shader - * shader(mandel); - * noStroke(); - * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); - * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); - * } - * - * function draw() { - * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); - * quad(-1, -1, 1, -1, 1, 1, -1, 1); - * } - * - *
                - * - * @alt - * zooming Mandelbrot set. a colorful, infinitely detailed fractal. - */ - - _main.default.prototype.loadShader = function (vertFilename, fragFilename, callback, errorCallback) { - _main.default._validateParameters('loadShader', arguments); - if (!errorCallback) { - errorCallback = console.error; - } - var loadedShader = new _main.default.Shader(); - var self = this; - var loadedFrag = false; - var loadedVert = false; - var onLoad = function onLoad() { - self._decrementPreload(); - if (callback) { - callback(loadedShader); - } - }; - this.loadStrings(vertFilename, function (result) { - loadedShader._vertSrc = result.join('\n'); - loadedVert = true; - if (loadedFrag) { - onLoad(); - } - }, errorCallback); - this.loadStrings(fragFilename, function (result) { - loadedShader._fragSrc = result.join('\n'); - loadedFrag = true; - if (loadedVert) { - onLoad(); - } - }, errorCallback); - return loadedShader; - }; - /** - * Creates a new p5.Shader object - * from the provided vertex and fragment shader code. - * - * Note, shaders can only be used in WEBGL mode. - * - * Shaders can alter the positioning of shapes drawn with them. - * To ensure consistency in rendering, it's recommended to use the vertex shader shown in the example below. - * - * @method createShader - * @param {String} vertSrc source code for the vertex shader - * @param {String} fragSrc source code for the fragment shader - * @returns {p5.Shader} a shader object created from the provided - * vertex and fragment shaders. - * - * @example - *
                - * - * - * // the vertex shader is called for each vertex - * let vs = ` - * precision highp float; - * uniform mat4 uModelViewMatrix; - * uniform mat4 uProjectionMatrix; - * - * attribute vec3 aPosition; - * attribute vec2 aTexCoord; - * varying vec2 vTexCoord; - * - * void main() { - * vTexCoord = aTexCoord; - * vec4 positionVec4 = vec4(aPosition, 1.0); - * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; - * } - * `; - * - * - * // the fragment shader is called for each pixel - * let fs = ` - * precision highp float; - * uniform vec2 p; - * uniform float r; - * const int I = 500; - * varying vec2 vTexCoord; - * void main() { - * vec2 c = p + gl_FragCoord.xy * r, z = c; - * float n = 0.0; - * for (int i = I; i > 0; i --) { - * if(z.x*z.x+z.y*z.y > 4.0) { - * n = float(i)/float(I); - * break; - * } - * z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c; - * } - * gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0); - * }`; - * - * let mandel; - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * // create and initialize the shader - * mandel = createShader(vs, fs); - * shader(mandel); - * noStroke(); - * - * // 'p' is the center point of the Mandelbrot image - * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); - * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); - * } - * - * function draw() { - * // 'r' is the size of the image in Mandelbrot-space - * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); - * plane(width, height); - * } - * - *
                - * - * @alt - * zooming Mandelbrot set. a colorful, infinitely detailed fractal. - */ - _main.default.prototype.createShader = function (vertSrc, fragSrc) { - _main.default._validateParameters('createShader', arguments); - return new _main.default.Shader(this._renderer, vertSrc, fragSrc); - }; - /** - * Creates a new p5.Shader using only a fragment shader, as a convenience method for creating image effects. - * It's like createShader() but with a default vertex shader included. - * - * createFilterShader() is intended to be used along with filter() for filtering the contents of a canvas. - * A filter shader will not be applied to any geometries. - * - * The fragment shader receives some uniforms: - * - `sampler2D tex0`, which contains the canvas contents as a texture -* - `vec2 canvasSize`, which is the p5 width and height of the canvas (not including pixel density) - * - `vec2 texelSize`, which is the size of a physical pixel including pixel density (`1.0/(width*density)`, `1.0/(height*density)`) - * - * For more info about filters and shaders, see Adam Ferriss' repo of shader examples - * or the introduction to shaders page. - * - * @method createFilterShader - * @param {String} fragSrc source code for the fragment shader - * @returns {p5.Shader} a shader object created from the provided - * fragment shader. - * @example - *
                - * - * function setup() { - * let fragSrc = `precision highp float; - * void main() { - * gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); - * }`; - * - * createCanvas(100, 100, WEBGL); - * let s = createFilterShader(fragSrc); - * filter(s); - * describe('a yellow canvas'); - * } - * - *
                - * - *
                - * - * let img, s; - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * function setup() { - * let fragSrc = `precision highp float; - * - * // x,y coordinates, given from the vertex shader - * varying vec2 vTexCoord; - * - * // the canvas contents, given from filter() - * uniform sampler2D tex0; - * // other useful information from the canvas - * uniform vec2 texelSize; - * uniform vec2 canvasSize; - * // a custom variable from this sketch - * uniform float darkness; - * - * void main() { - * // get the color at current pixel - * vec4 color = texture2D(tex0, vTexCoord); - * // set the output color - * color.b = 1.0; - * color *= darkness; - * gl_FragColor = vec4(color.rgb, 1.0); - * }`; - * - * createCanvas(100, 100, WEBGL); - * s = createFilterShader(fragSrc); - * } - * function draw() { - * image(img, -50, -50); - * s.setUniform('darkness', 0.5); - * filter(s); - * describe('a image of bricks tinted dark blue'); - * } - * - *
                - */ - _main.default.prototype.createFilterShader = function (fragSrc) { - _main.default._validateParameters('createFilterShader', arguments); - var defaultVertV1 = '\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n '; - var defaultVertV2 = '#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n '; - var vertSrc = fragSrc.includes('#version 300 es') ? defaultVertV2 : defaultVertV1; - var shader = new _main.default.Shader(this._renderer, vertSrc, fragSrc); - if (this._renderer.GL) { - shader.ensureCompiledOnContext(this); - } else { - shader.ensureCompiledOnContext(this._renderer.getFilterGraphicsLayer()); - } - return shader; - }; - /** - * Sets the p5.Shader object to - * be used to render subsequent shapes. - * - * Shaders can alter the positioning of shapes drawn with them. - * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. - * - * Custom shaders can be created using the - * createShader() and - * loadShader() functions. - * - * Use resetShader() to - * restore the default shaders. - * - * Note, shaders can only be used in WEBGL mode. - * - * @method shader - * @chainable - * @param {p5.Shader} s the p5.Shader object - * to use for rendering shapes. - * - * @example - *
                - * - * // Click within the image to toggle - * // the shader used by the quad shape - * // Note: for an alternative approach to the same example, - * // involving changing uniforms please refer to: - * // https://p5js.org/reference/#/p5.Shader/setUniform - * - * let redGreen; - * let orangeBlue; - * let showRedGreen = false; - * - * function preload() { - * // note that we are using two instances - * // of the same vertex and fragment shaders - * redGreen = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); - * orangeBlue = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * // initialize the colors for redGreen shader - * shader(redGreen); - * redGreen.setUniform('colorCenter', [1.0, 0.0, 0.0]); - * redGreen.setUniform('colorBackground', [0.0, 1.0, 0.0]); - * - * // initialize the colors for orangeBlue shader - * shader(orangeBlue); - * orangeBlue.setUniform('colorCenter', [1.0, 0.5, 0.0]); - * orangeBlue.setUniform('colorBackground', [0.226, 0.0, 0.615]); - * - * noStroke(); - * - * describe( - * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' - * ); - * } - * - * function draw() { - * // update the offset values for each shader, - * // moving orangeBlue in vertical and redGreen - * // in horizontal direction - * orangeBlue.setUniform('offset', [0, sin(millis() / 2000) + 1]); - * redGreen.setUniform('offset', [sin(millis() / 2000), 1]); - * - * if (showRedGreen === true) { - * shader(redGreen); - * } else { - * shader(orangeBlue); - * } - * quad(-1, -1, 1, -1, 1, 1, -1, 1); - * } - * - * function mouseClicked() { - * showRedGreen = !showRedGreen; - * } - * - *
                - * - * @alt - * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. - */ - _main.default.prototype.shader = function (s) { - this._assert3d('shader'); - _main.default._validateParameters('shader', arguments); - s.ensureCompiledOnContext(this); - if (s.isStrokeShader()) { - this._renderer.userStrokeShader = s; - } else { - this._renderer.userFillShader = s; - this._renderer._useNormalMaterial = false; - } - return this; - }; - /** - * Restores the default shaders. Code that runs after resetShader() - * will not be affected by the shader previously set by - * shader() - * - * @method resetShader - * @chainable - * @example - *
                - * - * // This variable will hold our shader object - * let shaderProgram; - * - * // This variable will hold our vertex shader source code - * let vertSrc = ` - * attribute vec3 aPosition; - * attribute vec2 aTexCoord; - * uniform mat4 uProjectionMatrix; - * uniform mat4 uModelViewMatrix; - * varying vec2 vTexCoord; - * - * void main() { - * vTexCoord = aTexCoord; - * vec4 position = vec4(aPosition, 1.0); - * gl_Position = uProjectionMatrix * uModelViewMatrix * position; - * } - * `; - * - * // This variable will hold our fragment shader source code - * let fragSrc = ` - * precision mediump float; - * - * varying vec2 vTexCoord; - * - * void main() { - * vec2 uv = vTexCoord; - * vec3 color = vec3(uv.x, uv.y, min(uv.x + uv.y, 1.0)); - * gl_FragColor = vec4(color, 1.0); - * } - * `; - * - * function setup() { - * // Shaders require WEBGL mode to work - * createCanvas(100, 100, WEBGL); - * - * // Create our shader - * shaderProgram = createShader(vertSrc, fragSrc); - * - * describe( - * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' - * ); - * } - * - * function draw() { - * // Clear the scene - * background(200); - * - * // Draw a box using our shader - * // shader() sets the active shader with our shader - * shader(shaderProgram); - * push(); - * translate(-width / 4, 0, 0); - * rotateX(millis() * 0.00025); - * rotateY(millis() * 0.0005); - * box(width / 4); - * pop(); - * - * // Draw a box using the default fill shader - * // resetShader() restores the default fill shader - * resetShader(); - * fill(255, 0, 0); - * push(); - * translate(width / 4, 0, 0); - * rotateX(millis() * 0.00025); - * rotateY(millis() * 0.0005); - * box(width / 4); - * pop(); - * } - * - *
                - * @alt - * Two rotating cubes. The left one is painted using a custom (user-defined) shader, - * while the right one is painted using the default fill shader. - */ - _main.default.prototype.resetShader = function () { - this._renderer.userFillShader = this._renderer.userStrokeShader = null; - return this; - }; - /** - * Sets the texture that will be used to render subsequent shapes. - * - * A texture is like a "skin" that wraps around a 3D geometry. Currently - * supported textures are images, video, and offscreen renders. - * - * To texture a geometry created with beginShape(), - * you will need to specify uv coordinates in vertex(). - * - * Note, texture() can only be used in WEBGL mode. - * - * You can view more materials in this - * example. - * - * @method texture - * @param {p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} tex image to use as texture - * @chainable - * @example - *
                - * - * let img; - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('spinning cube with a texture from an image'); - * } - * - * function draw() { - * background(0); - * rotateZ(frameCount * 0.01); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * //pass image as texture - * texture(img); - * box(width / 2); - * } - * - *
                - * @alt - * spinning cube with a texture from an image - * - * @example - *
                - * - * let pg; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * pg = createGraphics(200, 200); - * pg.textSize(75); - * describe('plane with a texture from an image created by createGraphics()'); - * } - * - * function draw() { - * background(0); - * pg.background(255); - * pg.text('hello!', 0, 100); - * //pass image as texture - * texture(pg); - * rotateX(0.5); - * noStroke(); - * plane(50); - * } - * - *
                - * @alt - * plane with a texture from an image created by createGraphics() - * - * @example - *
                - * - * let vid; - * function preload() { - * vid = createVideo('assets/fingers.mov'); - * vid.hide(); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('rectangle with video as texture'); - * } - * - * function draw() { - * background(0); - * //pass video frame as texture - * texture(vid); - * rect(-40, -40, 80, 80); - * } - * - * function mousePressed() { - * vid.loop(); - * } - * - *
                - * - * @alt - * rectangle with video as texture - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('quad with a texture, mapped using normalized coordinates'); - * } - * - * function draw() { - * background(0); - * texture(img); - * textureMode(NORMAL); - * beginShape(); - * vertex(-40, -40, 0, 0); - * vertex(40, -40, 1, 0); - * vertex(40, 40, 1, 1); - * vertex(-40, 40, 0, 1); - * endShape(); - * } - * - *
                - * @alt - * quad with a texture, mapped using normalized coordinates - */ - _main.default.prototype.texture = function (tex) { - this._assert3d('texture'); - _main.default._validateParameters('texture', arguments); - if (tex.gifProperties) { - tex._animateGif(this); - } - this._renderer.drawMode = constants.TEXTURE; - this._renderer._useNormalMaterial = false; - this._renderer._tex = tex; - this._renderer._setProperty('_doFill', true); - return this; - }; - /** - * Sets the coordinate space for texture mapping. The default mode is IMAGE - * which refers to the actual coordinates of the image. - * NORMAL refers to a normalized space of values ranging from 0 to 1. - * - * With IMAGE, if an image is 100×200 pixels, mapping the image onto the entire - * size of a quad would require the points (0,0) (100, 0) (100,200) (0,200). - * The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1). - * @method textureMode - * @param {Constant} mode either IMAGE or NORMAL - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('quad with a texture, mapped using normalized coordinates'); - * } - * - * function draw() { - * texture(img); - * textureMode(NORMAL); - * beginShape(); - * vertex(-50, -50, 0, 0); - * vertex(50, -50, 1, 0); - * vertex(50, 50, 1, 1); - * vertex(-50, 50, 0, 1); - * endShape(); - * } - * - *
                - * @alt - * quad with a texture, mapped using normalized coordinates - * - * @example - *
                - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('quad with a texture, mapped using image coordinates'); - * } - * - * function draw() { - * texture(img); - * textureMode(IMAGE); - * beginShape(); - * vertex(-50, -50, 0, 0); - * vertex(50, -50, img.width, 0); - * vertex(50, 50, img.width, img.height); - * vertex(-50, 50, 0, img.height); - * endShape(); - * } - * - *
                - * @alt - * quad with a texture, mapped using image coordinates - */ - _main.default.prototype.textureMode = function (mode) { - if (mode !== constants.IMAGE && mode !== constants.NORMAL) { - console.warn('You tried to set '.concat(mode, ' textureMode only supports IMAGE & NORMAL ')); - } else { - this._renderer.textureMode = mode; - } - }; - /** - * Sets the global texture wrapping mode. This controls how textures behave - * when their uv's go outside of the 0 to 1 range. There are three options: - * CLAMP, REPEAT, and MIRROR. - * - * CLAMP causes the pixels at the edge of the texture to extend to the bounds. - * REPEAT causes the texture to tile repeatedly until reaching the bounds. - * MIRROR works similarly to REPEAT but it flips the texture with every new tile. - * - * REPEAT & MIRROR are only available if the texture - * is a power of two size (128, 256, 512, 1024, etc.). - * - * This method will affect all textures in your sketch until a subsequent - * textureWrap() call is made. - * - * If only one argument is provided, it will be applied to both the - * horizontal and vertical axes. - * @method textureWrap - * @param {Constant} wrapX either CLAMP, REPEAT, or MIRROR - * @param {Constant} [wrapY] either CLAMP, REPEAT, or MIRROR - * @example - *
                - * - * let img; - * function preload() { - * img = loadImage('assets/rockies128.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * textureWrap(MIRROR); - * describe('an image of the rocky mountains repeated in mirrored tiles'); - * } - * - * function draw() { - * background(0); - * - * let dX = mouseX; - * let dY = mouseY; - * - * let u = lerp(1.0, 2.0, dX); - * let v = lerp(1.0, 2.0, dY); - * - * scale(width / 2); - * - * texture(img); - * - * beginShape(TRIANGLES); - * vertex(-1, -1, 0, 0, 0); - * vertex(1, -1, 0, u, 0); - * vertex(1, 1, 0, u, v); - * - * vertex(1, 1, 0, u, v); - * vertex(-1, 1, 0, 0, v); - * vertex(-1, -1, 0, 0, 0); - * endShape(); - * } - * - *
                - * - * @alt - * an image of the rocky mountains repeated in mirrored tiles - */ - _main.default.prototype.textureWrap = function (wrapX) { - var wrapY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : wrapX; - this._renderer.textureWrapX = wrapX; - this._renderer.textureWrapY = wrapY; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this._renderer.textures.values() [Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var texture = _step.value; - texture.setWrapMode(wrapX, wrapY); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }; - /** - * Sets the current material as a normal material. - * - * A normal material is not affected by light. It is often used as - * a placeholder material when debugging. - * - * Surfaces facing the X-axis become red, those facing the Y-axis - * become green, and those facing the Z-axis become blue. - * - * You can view more materials in this - * example. - * - * @method normalMaterial - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Sphere with normal material'); - * } - * - * function draw() { - * background(200); - * normalMaterial(); - * sphere(40); - * } - * - *
                - * @alt - * Sphere with normal material - */ - _main.default.prototype.normalMaterial = function () { - this._assert3d('normalMaterial'); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('normalMaterial', args); - this._renderer.drawMode = constants.FILL; - this._renderer._useSpecularMaterial = false; - this._renderer._useEmissiveMaterial = false; - this._renderer._useNormalMaterial = true; - this._renderer.curFillColor = [ - 1, - 1, - 1, - 1 - ]; - this._renderer._setProperty('_doFill', true); - this.noStroke(); - return this; - }; - /** - * Sets the ambient color of the material. - * - * The ambientMaterial() color represents the components - * of the **ambientLight()** color that the object reflects. - * - * Consider an ambientMaterial() with the color yellow (255, 255, 0). - * If the ambientLight() emits the color white (255, 255, 255), then the object - * will appear yellow as it will reflect the red and green components - * of the light. If the ambientLight() emits the color red (255, 0, 0), then - * the object will appear red as it will reflect the red component - * of the light. If the ambientLight() emits the color blue (0, 0, 255), - * then the object will appear black, as there is no component of - * the light that it can reflect. - * - * You can view more materials in this - * example. - * - * @method ambientMaterial - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('sphere reflecting red, blue, and green light'); - * } - * function draw() { - * background(0); - * noStroke(); - * ambientLight(255); - * ambientMaterial(70, 130, 230); - * sphere(40); - * } - * - *
                - * @alt - * sphere reflecting red, blue, and green light - * - * @example - *
                - * - * // ambientLight is both red and blue (magenta), - * // so object only reflects it's red and blue components - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('box reflecting only red and blue light'); - * } - * function draw() { - * background(70); - * ambientLight(255, 0, 255); // magenta light - * ambientMaterial(255); // white material - * box(30); - * } - * - *
                - * @alt - * box reflecting only red and blue light - * - * @example - *
                - * - * // ambientLight is green. Since object does not contain - * // green, it does not reflect any light - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('box reflecting no light'); - * } - * function draw() { - * background(70); - * ambientLight(0, 255, 0); // green light - * ambientMaterial(255, 0, 255); // magenta material - * box(30); - * } - * - *
                - * @alt - * box reflecting no light - */ - /** - * @method ambientMaterial - * @param {Number} gray number specifying value between - * white and black - * @chainable - */ - /** - * @method ambientMaterial - * @param {p5.Color|Number[]|String} color - * color as a p5.Color, - * as an array, or as a CSS string - * @chainable - */ - _main.default.prototype.ambientMaterial = function (v1, v2, v3) { - this._assert3d('ambientMaterial'); - _main.default._validateParameters('ambientMaterial', arguments); - var color = _main.default.prototype.color.apply(this, arguments); - this._renderer._hasSetAmbient = true; - this._renderer.curAmbientColor = color._array; - this._renderer._useNormalMaterial = false; - this._renderer._enableLighting = true; - this._renderer._setProperty('_doFill', true); - return this; - }; - /** - * Sets the emissive color of the material. - * - * An emissive material will display the emissive color at - * full strength regardless of lighting. This can give the - * appearance that the object is glowing. - * - * Note, "emissive" is a misnomer in the sense that the material - * does not actually emit light that will affect surrounding objects. - * - * You can view more materials in this - * example. - * - * @method emissiveMaterial - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @param {Number} [alpha] alpha value relative to current color - * range (default is 0-255) - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('sphere with green emissive material'); - * } - * function draw() { - * background(0); - * noStroke(); - * ambientLight(0); - * emissiveMaterial(130, 230, 0); - * sphere(40); - * } - * - *
                - * - * @alt - * sphere with green emissive material - */ - /** - * @method emissiveMaterial - * @param {Number} gray number specifying value between - * white and black - * @chainable - */ - /** - * @method emissiveMaterial - * @param {p5.Color|Number[]|String} color - * color as a p5.Color, - * as an array, or as a CSS string - * @chainable - */ - _main.default.prototype.emissiveMaterial = function (v1, v2, v3, a) { - this._assert3d('emissiveMaterial'); - _main.default._validateParameters('emissiveMaterial', arguments); - var color = _main.default.prototype.color.apply(this, arguments); - this._renderer.curEmissiveColor = color._array; - this._renderer._useEmissiveMaterial = true; - this._renderer._useNormalMaterial = false; - this._renderer._enableLighting = true; - return this; - }; - /** - * Sets the specular color of the material. - * - * A specular material is reflective (shiny). The shininess can be - * controlled by the shininess() function. - * - * Like ambientMaterial(), - * the specularMaterial() color is the color the object will reflect - * under ambientLight(). - * However unlike ambientMaterial(), for all other types of lights - * (directionalLight(), - * pointLight(), - * spotLight()), - * a specular material will reflect the **color of the light source**. - * This is what gives it its "shiny" appearance. - * - * You can view more materials in this - * example. - * - * @method specularMaterial - * @param {Number} gray number specifying value between white and black. - * @param {Number} [alpha] alpha value relative to current color range - * (default is 0-255) - * @chainable - * - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe('torus with specular material'); - * } - * - * function draw() { - * background(0); - * - * ambientLight(60); - * - * // add point light to showcase specular material - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * pointLight(255, 255, 255, locX, locY, 50); - * - * specularMaterial(250); - * shininess(50); - * torus(30, 10, 64, 64); - * } - * - *
                - * @alt - * torus with specular material - */ - /** - * @method specularMaterial - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @param {Number} [alpha] - * @chainable - */ - /** - * @method specularMaterial - * @param {p5.Color|Number[]|String} color - * color as a p5.Color, - * as an array, or as a CSS string - * @chainable - */ - _main.default.prototype.specularMaterial = function (v1, v2, v3, alpha) { - this._assert3d('specularMaterial'); - _main.default._validateParameters('specularMaterial', arguments); - var color = _main.default.prototype.color.apply(this, arguments); - this._renderer.curSpecularColor = color._array; - this._renderer._useSpecularMaterial = true; - this._renderer._useNormalMaterial = false; - this._renderer._enableLighting = true; - return this; - }; - /** - * Sets the amount of gloss ("shininess") of a - * specularMaterial(). - * - * The default and minimum value is 1. - * - * @method shininess - * @param {Number} shine degree of shininess - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('two spheres, one more shiny than the other'); - * } - * function draw() { - * background(0); - * noStroke(); - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * ambientLight(60, 60, 60); - * pointLight(255, 255, 255, locX, locY, 50); - * specularMaterial(250); - * translate(-25, 0, 0); - * shininess(1); - * sphere(20); - * translate(50, 0, 0); - * shininess(20); - * sphere(20); - * } - * - *
                - * @alt - * two spheres, one more shiny than the other - */ - _main.default.prototype.shininess = function (shine) { - this._assert3d('shininess'); - _main.default._validateParameters('shininess', arguments); - if (shine < 1) { - shine = 1; - } - this._renderer._useShininess = shine; - return this; - }; - /** - * @private blends colors according to color components. - * If alpha value is less than 1, or non-standard blendMode - * we need to enable blending on our gl context. - * @param {Number[]} color [description] - * @return {Number[]]} Normalized numbers array - */ - _main.default.RendererGL.prototype._applyColorBlend = function (colors) { - var gl = this.GL; - var isTexture = this.drawMode === constants.TEXTURE; - var doBlend = this.userFillShader || this.userStrokeShader || this.userPointShader || isTexture || this.curBlendMode !== constants.BLEND || colors[colors.length - 1] < 1 || this._isErasing; - if (doBlend !== this._isBlending) { - if (doBlend || this.curBlendMode !== constants.BLEND && this.curBlendMode !== constants.ADD) { - gl.enable(gl.BLEND); - } else { - gl.disable(gl.BLEND); - } - gl.depthMask(true); - this._isBlending = doBlend; - } - this._applyBlendMode(); - return colors; - }; - /** - * @private sets blending in gl context to curBlendMode - * @param {Number[]} color [description] - * @return {Number[]]} Normalized numbers array - */ - _main.default.RendererGL.prototype._applyBlendMode = function () { - if (this._cachedBlendMode === this.curBlendMode) { - return; - } - var gl = this.GL; - switch (this.curBlendMode) { - case constants.BLEND: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.ADD: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ONE); - break; - case constants.REMOVE: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ZERO, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.MULTIPLY: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.SCREEN: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR); - break; - case constants.EXCLUSION: - gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); - gl.blendFuncSeparate(gl.ONE_MINUS_DST_COLOR, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE); - break; - case constants.REPLACE: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ZERO); - break; - case constants.SUBTRACT: - gl.blendEquationSeparate(gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD); - gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.DARKEST: - if (this.blendExt) { - gl.blendEquationSeparate(this.blendExt.MIN || this.blendExt.MIN_EXT, gl.FUNC_ADD); - gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); - } else { - console.warn('blendMode(DARKEST) does not work in your browser in WEBGL mode.'); - } - break; - case constants.LIGHTEST: - if (this.blendExt) { - gl.blendEquationSeparate(this.blendExt.MAX || this.blendExt.MAX_EXT, gl.FUNC_ADD); - gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); - } else { - console.warn('blendMode(LIGHTEST) does not work in your browser in WEBGL mode.'); - } - break; - default: - console.error('Oops! Somehow RendererGL set curBlendMode to an unsupported mode.'); - break; - } - if (!this._isErasing) { - this._cachedBlendMode = this.curBlendMode; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.Texture': 357, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.join': 180, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 347: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.string.sub'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.hypot'); - _dereq_('core-js/modules/es.string.sub'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module 3D - * @submodule Camera - * @requires core - */ - //////////////////////////////////////////////////////////////////////////////// - // p5.Prototype Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Sets the position of the current camera in a 3D sketch. - * Parameters for this function define the camera's position, - * the center of the sketch (where the camera is pointing), - * and an up direction (the orientation of the camera). - * - * This function simulates the movements of the camera, allowing objects to be - * viewed from various angles. Remember, it does not move the objects themselves - * but the camera instead. For example when the centerX value is positive, - * and the camera is rotating to the right side of the sketch, - * the object will seem like it's moving to the left. - * - * See this example - * to view the position of your camera. - * - * If no parameters are given, the following default is used: - * camera(0, 0, (height/2) / tan(PI/6), 0, 0, 0, 0, 1, 0) - * @method camera - * @constructor - * @for p5 - * @param {Number} [x] camera position value on x axis - * @param {Number} [y] camera position value on y axis - * @param {Number} [z] camera position value on z axis - * @param {Number} [centerX] x coordinate representing center of the sketch - * @param {Number} [centerY] y coordinate representing center of the sketch - * @param {Number} [centerZ] z coordinate representing center of the sketch - * @param {Number} [upX] x component of direction 'up' from camera - * @param {Number} [upY] y component of direction 'up' from camera - * @param {Number} [upZ] z component of direction 'up' from camera - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a square moving closer and then away from the camera.'); - * } - * function draw() { - * background(204); - * //move the camera away from the plane by a sin wave - * camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); - * plane(10, 10); - * } - * - *
                - * - * @example - *
                - * - * //move slider to see changes! - * //sliders control the first 6 parameters of camera() - * let sliderGroup = []; - * let X; - * let Y; - * let Z; - * let centerX; - * let centerY; - * let centerZ; - * let h = 20; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * //create sliders - * for (var i = 0; i < 6; i++) { - * if (i === 2) { - * sliderGroup[i] = createSlider(10, 400, 200); - * } else { - * sliderGroup[i] = createSlider(-400, 400, 0); - * } - * h = map(i, 0, 6, 5, 85); - * sliderGroup[i].position(10, height + h); - * sliderGroup[i].style('width', '80px'); - * } - * describe( - * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' - * ); - * } - * - * function draw() { - * background(60); - * // assigning sliders' value to each parameters - * X = sliderGroup[0].value(); - * Y = sliderGroup[1].value(); - * Z = sliderGroup[2].value(); - * centerX = sliderGroup[3].value(); - * centerY = sliderGroup[4].value(); - * centerZ = sliderGroup[5].value(); - * camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); - * stroke(255); - * fill(255, 102, 94); - * box(85); - * } - * - *
                - * @alt - * White square repeatedly grows to fill canvas and then shrinks. - * An interactive example of a red cube with 3 sliders for moving it across x, y, - * z axis and 3 sliders for shifting its center. - */ - - _main.default.prototype.camera = function () { - var _this$_renderer$_curC; - this._assert3d('camera'); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters('camera', args); - (_this$_renderer$_curC = this._renderer._curCamera).camera.apply(_this$_renderer$_curC, args); - return this; - }; - /** - * Sets a perspective projection for the current camera in a 3D sketch. - * This projection represents depth through foreshortening: objects - * that are close to the camera appear their actual size while those - * that are further away from the camera appear smaller. - * - * The parameters to this function define the viewing frustum - * (the truncated pyramid within which objects are seen by the camera) through - * vertical field of view, aspect ratio (usually width/height), and near and far - * clipping planes. - * - * If no parameters are given, the default values are used as: - * - * - `fov` : The default field of view for the camera is such that the full height of renderer is visible when it is positioned at a default distance of 800 units from the camera. - * - `aspect` : The default aspect ratio is the ratio of renderer's width to renderer's height. - * - `near` : The default value for the near clipping plane is 80, which is 0.1 times the default distance from the camera to its subject. - * - `far` : The default value for the far clipping plane is 8000, which is 10 times the default distance from the camera to its subject. - * - * If you prefer a fixed field of view, follow these steps: - * 1. Choose your desired field of view angle (`fovy`). This is how wide the camera can see. - * 2. To ensure that you can see the entire width across horizontally and height across vertically, place the camera a distance of `(height / 2) / tan(fovy / 2)` back from its subject. - * 3. Call perspective with the chosen field of view, canvas aspect ratio, and near/far values: - * `perspective(fovy, width / height, cameraDistance / 10, cameraDistance * 10);` - * - * @method perspective - * @for p5 - * @param {Number} [fovy] camera frustum vertical field of view, - * from bottom to top of view, in angleMode units - * @param {Number} [aspect] camera frustum aspect ratio - * @param {Number} [near] frustum near plane length - * @param {Number} [far] frustum far plane length - * @chainable - * @example - *
                - * - * //drag the mouse to look around! - * function setup() { - * createCanvas(100, 100, WEBGL); - * perspective(PI / 3.0, width / height, 0.1, 500); - * describe( - * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' - * ); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * - * translate(0, 0, 550); - * rotateX(-0.3); - * rotateY(-0.2); - * - * push(); - * translate(-15, 0, sin(frameCount / 30) * 95); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 95); - * box(30); - * pop(); - * } - * - *
                - * - * @alt - * two colored 3D boxes move back and forth, rotating as mouse is dragged. - */ - _main.default.prototype.perspective = function () { - var _this$_renderer$_curC2; - this._assert3d('perspective'); - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters('perspective', args); - (_this$_renderer$_curC2 = this._renderer._curCamera).perspective.apply(_this$_renderer$_curC2, args); - return this; - }; - /** - * Sets an orthographic projection for the current camera in a 3D sketch - * and defines a box-shaped viewing frustum within which objects are seen. - * In this projection, all objects with the same dimension appear the same - * size, regardless of whether they are near or far from the camera. - * - * The parameters to this function specify the viewing frustum where - * left and right are the minimum and maximum x values, top and bottom are - * the minimum and maximum y values, and near and far are the minimum and - * maximum z values. - * - * If no parameters are given, the following default is used: - * ortho(-width/2, width/2, -height/2, height/2). - * @method ortho - * @for p5 - * @param {Number} [left] camera frustum left plane - * @param {Number} [right] camera frustum right plane - * @param {Number} [bottom] camera frustum bottom plane - * @param {Number} [top] camera frustum top plane - * @param {Number} [near] camera frustum near plane - * @param {Number} [far] camera frustum far plane - * @chainable - * @example - *
                - * - * //drag the mouse to look around! - * //there's no vanishing point - * function setup() { - * createCanvas(100, 100, WEBGL); - * ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); - * describe( - * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' - * ); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * - * translate(0,0,500); - * rotateX(0.2); - * rotateY(-0.2); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 65); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 65); - * box(30); - * pop(); - * } - * - *
                - * - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */ - _main.default.prototype.ortho = function () { - var _this$_renderer$_curC3; - this._assert3d('ortho'); - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters('ortho', args); - (_this$_renderer$_curC3 = this._renderer._curCamera).ortho.apply(_this$_renderer$_curC3, args); - return this; - }; - /** - * Sets the frustum of the current camera as defined by - * the parameters. - * - * A frustum is a geometric form: a pyramid with its top - * cut off. With the viewer's eye at the imaginary top of - * the pyramid, the six planes of the frustum act as clipping - * planes when rendering a 3D view. Thus, any form inside the - * clipping planes is visible; anything outside - * those planes is not visible. - * - * Setting the frustum changes the perspective of the scene being rendered. - * This can be achieved more simply in many cases by using - * perspective(). - * - * If no parameters are given, the following default is used: - * frustum(-width/20, width/20, height/20, -height/20, eyeZ/10, eyeZ*10), - * where eyeZ is equal to ((height/2) / tan(PI/6)). - * @method frustum - * @for p5 - * @param {Number} [left] camera frustum left plane - * @param {Number} [right] camera frustum right plane - * @param {Number} [bottom] camera frustum bottom plane - * @param {Number} [top] camera frustum top plane - * @param {Number} [near] camera frustum near plane - * @param {Number} [far] camera frustum far plane - * @chainable - * @example - *
                - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); - * describe( - * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' - * ); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * translate(0,0,700); - * rotateY(-0.2); - * rotateX(-0.3); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 25); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 25); - * box(30); - * pop(); - * } - * - *
                - * - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */ - _main.default.prototype.frustum = function () { - var _this$_renderer$_curC4; - this._assert3d('frustum'); - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - _main.default._validateParameters('frustum', args); - (_this$_renderer$_curC4 = this._renderer._curCamera).frustum.apply(_this$_renderer$_curC4, args); - return this; - }; - //////////////////////////////////////////////////////////////////////////////// - // p5.Camera - //////////////////////////////////////////////////////////////////////////////// - /** - * Creates a new p5.Camera object and sets it - * as the current (active) camera. - * - * The new camera is initialized with a default position - * (see camera()) - * and a default perspective projection - * (see perspective()). - * Its properties can be controlled with the p5.Camera - * methods. - * - * Note: Every 3D sketch starts with a default camera initialized. - * This camera can be controlled with the global methods - * camera(), - * perspective(), ortho(), - * and frustum() if it is the only camera - * in the scene. - * @method createCamera - * @return {p5.Camera} The newly created camera object. - * @for p5 - * @example - *
                - * // Creates a camera object and animates it around a box. - * let camera; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * camera = createCamera(); - * describe('An example that creates a camera and moves it around the box.'); - * } - * - * function draw() { - * background(0); - * // The camera will automatically - * // rotate to look at [0, 0, 0]. - * camera.lookAt(0, 0, 0); - * - * // The camera will move on the - * // x axis. - * camera.setPosition(sin(frameCount / 60) * 200, 0, 100); - * box(20); - * - * // A 'ground' box to give the viewer - * // a better idea of where the camera - * // is looking. - * translate(0, 50, 0); - * rotateX(HALF_PI); - * box(150, 150, 20); - * } - *
                - * - * @alt - * An example that creates a camera and moves it around the box. - */ - _main.default.prototype.createCamera = function () { - this._assert3d('createCamera'); - var _cam = new _main.default.Camera(this._renderer); - // compute default camera settings, then set a default camera - _cam._computeCameraDefaultSettings(); - _cam._setDefaultCamera(); - // set renderer current camera to the new camera - this._renderer._curCamera = _cam; - return _cam; - }; - /** - * This class describes a camera for use in p5's - * - * WebGL mode. It contains camera position, orientation, and projection - * information necessary for rendering a 3D scene. - * - * New p5.Camera objects can be made through the - * createCamera() function and controlled through - * the methods described below. A camera created in this way will use a default - * position in the scene and a default perspective projection until these - * properties are changed through the various methods available. It is possible - * to create multiple cameras, in which case the current camera - * can be set through the setCamera() method. - * - * Note: - * The methods below operate in two coordinate systems: the 'world' coordinate - * system describe positions in terms of their relationship to the origin along - * the X, Y and Z axes whereas the camera's 'local' coordinate system - * describes positions from the camera's point of view: left-right, up-down, - * and forward-backward. The move() method, - * for instance, moves the camera along its own axes, whereas the - * setPosition() - * method sets the camera's position in world-space. - * - * The camera object propreties - * eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ - * which describes camera position, orientation, and projection - * are also accessible via the camera object generated using - * createCamera() - * - * @class p5.Camera - * @param {rendererGL} rendererGL instance of WebGL renderer - * @example - *
                - * - * let cam; - * let delta = 0.01; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * // set initial pan angle - * cam.pan(-0.8); - * describe( - * 'camera view pans left and right across a series of rotating 3D boxes.' - * ); - * } - * - * function draw() { - * background(200); - * - * // pan camera according to angle 'delta' - * cam.pan(delta); - * - * // every 160 frames, switch direction - * if (frameCount % 160 === 0) { - * delta *= -1; - * } - * - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                - * - * @alt - * camera view pans left and right across a series of rotating 3D boxes. - */ - _main.default.Camera = /*#__PURE__*/ function () { - function Camera(renderer) { - _classCallCheck(this, Camera); - this._renderer = renderer; - this.cameraType = 'default'; - this.cameraMatrix = new _main.default.Matrix(); - this.projMatrix = new _main.default.Matrix(); - this.yScale = 1; - } /** - * camera position value on x axis - * @property {Number} eyeX - * @readonly - * @example - * - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * cam = createCamera(); - * div = createDiv(); - * div.position(0, 0); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * div.html('eyeX = ' + cam.eyeX); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * camera position value on y axis - * @property {Number} eyeY - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * cam = createCamera(); - * div = createDiv(); - * div.position(0, 0); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * div.html('eyeY = ' + cam.eyeY); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * camera position value on z axis - * @property {Number} eyeZ - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * cam = createCamera(); - * div = createDiv(); - * div.position(0, 0); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * div.html('eyeZ = ' + cam.eyeZ); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * x coordinate representing center of the sketch - * @property {Number} centerX - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * cam.lookAt(1, 0, 0); - * div = createDiv('centerX = ' + cam.centerX); - * div.position(0, 0); - * div.style('color', 'white'); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * y coordinate representing center of the sketch - * @property {Number} centerY - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * cam.lookAt(0, 1, 0); - * div = createDiv('centerY = ' + cam.centerY); - * div.position(0, 0); - * div.style('color', 'white'); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * z coordinate representing center of the sketch - * @property {Number} centerZ - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * cam.lookAt(0, 0, 1); - * div = createDiv('centerZ = ' + cam.centerZ); - * div.position(0, 0); - * div.style('color', 'white'); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * x component of direction 'up' from camera - * @property {Number} upX - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * div = createDiv('upX = ' + cam.upX); - * div.position(0, 0); - * div.style('color', 'blue'); - * div.style('font-size', '18px'); - * describe('An example showing the use of camera object properties'); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * y component of direction 'up' from camera - * @property {Number} upY - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * div = createDiv('upY = ' + cam.upY); - * div.position(0, 0); - * div.style('color', 'blue'); - * div.style('font-size', '18px'); - * describe('An example showing the use of camera object properties'); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * z component of direction 'up' from camera - * @property {Number} upZ - * @readonly - * @example - *
                - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * div = createDiv('upZ = ' + cam.upZ); - * div.position(0, 0); - * div.style('color', 'blue'); - * div.style('font-size', '18px'); - * describe('An example showing the use of camera object properties'); - * } - *
                - * - * @alt - * An example showing the use of camera object properties - * - */ - //////////////////////////////////////////////////////////////////////////////// - // Camera Projection Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Sets a perspective projection. - * Accepts the same parameters as the global - * perspective(). - * More information on this function can be found there. - * @method perspective - * @for p5.Camera - * @example - *
                - * - * // drag the mouse to look around! - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // create a camera - * cam = createCamera(); - * // give it a perspective projection - * cam.perspective(PI / 3.0, width / height, 0.1, 500); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * - * translate(0, 0, 550); - * rotateX(-0.3); - * rotateY(-0.2); - * - * push(); - * translate(-15, 0, sin(frameCount / 30) * 95); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 95); - * box(30); - * pop(); - * } - * - *
                - * @alt - * two colored 3D boxes move back and forth, rotating as mouse is dragged. - */ - - _createClass(Camera, [ - { - key: 'perspective', - value: function perspective(fovy, aspect, near, far) { - this.cameraType = arguments.length > 0 ? 'custom' : 'default'; - if (typeof fovy === 'undefined') { - fovy = this.defaultCameraFOV; - // this avoids issue where setting angleMode(DEGREES) before calling - // perspective leads to a smaller than expected FOV (because - // _computeCameraDefaultSettings computes in radians) - this.cameraFOV = fovy; - } else { - this.cameraFOV = this._renderer._pInst._toRadians(fovy); - } - if (typeof aspect === 'undefined') { - aspect = this.defaultAspectRatio; - } - if (typeof near === 'undefined') { - near = this.defaultCameraNear; - } - if (typeof far === 'undefined') { - far = this.defaultCameraFar; - } - if (near <= 0.0001) { - near = 0.01; - console.log('Avoid perspective near plane values close to or below 0. ' + 'Setting value to 0.01.'); - } - if (far < near) { - console.log('Perspective far plane value is less than near plane value. ' + 'Nothing will be shown.'); - } - this.aspectRatio = aspect; - this.cameraNear = near; - this.cameraFar = far; - this.projMatrix = _main.default.Matrix.identity(); - var f = 1 / Math.tan(this.cameraFOV / 2); - var nf = 1 / (this.cameraNear - this.cameraFar); - /* eslint-disable indent */ - this.projMatrix.set(f / aspect, 0, 0, 0, 0, - f * this.yScale, 0, 0, 0, 0, (far + near) * nf, - 1, 0, 0, 2 * far * near * nf, 0); - /* eslint-enable indent */ - if (this._isActive()) { - this._renderer.uPMatrix.set(this.projMatrix.mat4[0], this.projMatrix.mat4[1], this.projMatrix.mat4[2], this.projMatrix.mat4[3], this.projMatrix.mat4[4], this.projMatrix.mat4[5], this.projMatrix.mat4[6], this.projMatrix.mat4[7], this.projMatrix.mat4[8], this.projMatrix.mat4[9], this.projMatrix.mat4[10], this.projMatrix.mat4[11], this.projMatrix.mat4[12], this.projMatrix.mat4[13], this.projMatrix.mat4[14], this.projMatrix.mat4[15]); - } - } /** - * Sets an orthographic projection. - * Accepts the same parameters as the global - * ortho(). - * More information on this function can be found there. - * @method ortho - * @for p5.Camera - * @example - *
                - * - * // drag the mouse to look around! - * // there's no vanishing point - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // create a camera - * cam = createCamera(); - * // give it an orthographic projection - * cam.ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * translate(0,0,500); - * rotateX(0.2); - * rotateY(-0.2); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 65); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 65); - * box(30); - * pop(); - * } - * - *
                - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */ - - }, - { - key: 'ortho', - value: function ortho(left, right, bottom, top, near, far) { - if (left === undefined) left = - this._renderer.width / 2; - if (right === undefined) right = + this._renderer.width / 2; - if (bottom === undefined) bottom = - this._renderer.height / 2; - if (top === undefined) top = + this._renderer.height / 2; - if (near === undefined) near = 0; - if (far === undefined) far = Math.max(this._renderer.width, this._renderer.height); - this.cameraNear = near; - this.cameraFar = far; - var w = right - left; - var h = top - bottom; - var d = far - near; - var x = + 2 / w; - var y = + 2 / h * this.yScale; - var z = - 2 / d; - var tx = - (right + left) / w; - var ty = - (top + bottom) / h; - var tz = - (far + near) / d; - this.projMatrix = _main.default.Matrix.identity(); - /* eslint-disable indent */ - this.projMatrix.set(x, 0, 0, 0, 0, - y, 0, 0, 0, 0, z, 0, tx, ty, tz, 1); - /* eslint-enable indent */ - if (this._isActive()) { - this._renderer.uPMatrix.set(this.projMatrix.mat4[0], this.projMatrix.mat4[1], this.projMatrix.mat4[2], this.projMatrix.mat4[3], this.projMatrix.mat4[4], this.projMatrix.mat4[5], this.projMatrix.mat4[6], this.projMatrix.mat4[7], this.projMatrix.mat4[8], this.projMatrix.mat4[9], this.projMatrix.mat4[10], this.projMatrix.mat4[11], this.projMatrix.mat4[12], this.projMatrix.mat4[13], this.projMatrix.mat4[14], this.projMatrix.mat4[15]); - } - this.cameraType = 'custom'; - } /** - * Sets the camera's frustum. - * Accepts the same parameters as the global - * frustum(). - * More information on this function can be found there. - * @method frustum - * @for p5.Camera - * @example - *
                - * - * let cam; - * - * function setup() { - * x = createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * // create a camera - * cam = createCamera(); - * // set its frustum - * cam.frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * translate(0,0,700); - * rotateY(-0.2); - * rotateX(-0.3); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 25); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 25); - * box(30); - * pop(); - * } - * - *
                - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */ - - }, - { - key: 'frustum', - value: function frustum(left, right, bottom, top, near, far) { - if (left === undefined) left = - this._renderer.width * 0.05; - if (right === undefined) right = + this._renderer.width * 0.05; - if (bottom === undefined) bottom = + this._renderer.height * 0.05; - if (top === undefined) top = - this._renderer.height * 0.05; - if (near === undefined) near = this.defaultCameraNear; - if (far === undefined) far = this.defaultCameraFar; - this.cameraNear = near; - this.cameraFar = far; - var w = right - left; - var h = top - bottom; - var d = far - near; - var x = + (2 * near) / w; - var y = + (2 * near) / h * this.yScale; - var z = - (2 * far * near) / d; - var tx = (right + left) / w; - var ty = (top + bottom) / h; - var tz = - (far + near) / d; - this.projMatrix = _main.default.Matrix.identity(); - /* eslint-disable indent */ - this.projMatrix.set(x, 0, 0, 0, 0, - y, 0, 0, tx, ty, tz, - 1, 0, 0, z, 0); - /* eslint-enable indent */ - if (this._isActive()) { - this._renderer.uPMatrix.set(this.projMatrix.mat4[0], this.projMatrix.mat4[1], this.projMatrix.mat4[2], this.projMatrix.mat4[3], this.projMatrix.mat4[4], this.projMatrix.mat4[5], this.projMatrix.mat4[6], this.projMatrix.mat4[7], this.projMatrix.mat4[8], this.projMatrix.mat4[9], this.projMatrix.mat4[10], this.projMatrix.mat4[11], this.projMatrix.mat4[12], this.projMatrix.mat4[13], this.projMatrix.mat4[14], this.projMatrix.mat4[15]); - } - this.cameraType = 'custom'; - } //////////////////////////////////////////////////////////////////////////////// - // Camera Orientation Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Rotate camera view about arbitrary axis defined by x,y,z - * based on http://learnwebgl.brown37.net/07_cameras/camera_rotating_motion.html - * @method _rotateView - * @private - */ - - }, - { - key: '_rotateView', - value: function _rotateView(a, x, y, z) { - var centerX = this.centerX; - var centerY = this.centerY; - var centerZ = this.centerZ; - // move center by eye position such that rotation happens around eye position - centerX -= this.eyeX; - centerY -= this.eyeY; - centerZ -= this.eyeZ; - var rotation = _main.default.Matrix.identity(this._renderer._pInst); - rotation.rotate(this._renderer._pInst._toRadians(a), x, y, z); - /* eslint-disable max-len */ - var rotatedCenter = [ - centerX * rotation.mat4[0] + centerY * rotation.mat4[4] + centerZ * rotation.mat4[8], - centerX * rotation.mat4[1] + centerY * rotation.mat4[5] + centerZ * rotation.mat4[9], - centerX * rotation.mat4[2] + centerY * rotation.mat4[6] + centerZ * rotation.mat4[10] - ]; - /* eslint-enable max-len */ - // add eye position back into center - rotatedCenter[0] += this.eyeX; - rotatedCenter[1] += this.eyeY; - rotatedCenter[2] += this.eyeZ; - this.camera(this.eyeX, this.eyeY, this.eyeZ, rotatedCenter[0], rotatedCenter[1], rotatedCenter[2], this.upX, this.upY, this.upZ); - } /** - * Panning rotates the camera view to the left and right. - * @method pan - * @param {Number} angle amount to rotate camera in current - * angleMode units. - * Greater than 0 values rotate counterclockwise (to the left). - * @example - *
                - * - * let cam; - * let delta = 0.01; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * // set initial pan angle - * cam.pan(-0.8); - * } - * - * function draw() { - * background(200); - * - * // pan camera according to angle 'delta' - * cam.pan(delta); - * - * // every 160 frames, switch direction - * if (frameCount % 160 === 0) { - * delta *= -1; - * } - * - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                - * - * @alt - * camera view pans left and right across a series of rotating 3D boxes. - */ - - }, - { - key: 'pan', - value: function pan(amount) { - var local = this._getLocalAxes(); - this._rotateView(amount, local.y[0], local.y[1], local.y[2]); - } /** - * Tilting rotates the camera view up and down. - * @method tilt - * @param {Number} angle amount to rotate camera in current - * angleMode units. - * Greater than 0 values rotate counterclockwise (to the left). - * @example - *
                - * - * let cam; - * let delta = 0.01; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * // set initial tilt - * cam.tilt(-0.8); - * } - * - * function draw() { - * background(200); - * - * // pan camera according to angle 'delta' - * cam.tilt(delta); - * - * // every 160 frames, switch direction - * if (frameCount % 160 === 0) { - * delta *= -1; - * } - * - * rotateY(frameCount * 0.01); - * translate(0, -100, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * } - * - *
                - * - * @alt - * camera view tilts up and down across a series of rotating 3D boxes. - */ - - }, - { - key: 'tilt', - value: function tilt(amount) { - var local = this._getLocalAxes(); - this._rotateView(amount, local.x[0], local.x[1], local.x[2]); - } /** - * Reorients the camera to look at a position in world space. - * @method lookAt - * @for p5.Camera - * @param {Number} x x position of a point in world space - * @param {Number} y y position of a point in world space - * @param {Number} z z position of a point in world space - * @example - *
                - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * } - * - * function draw() { - * background(200); - * - * // look at a new random point every 60 frames - * if (frameCount % 60 === 0) { - * cam.lookAt(random(-100, 100), random(-50, 50), 0); - * } - * - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                - * - * @alt - * camera view of rotating 3D cubes changes to look at a new random - * point every second . - */ - - }, - { - key: 'lookAt', - value: function lookAt(x, y, z) { - this.camera(this.eyeX, this.eyeY, this.eyeZ, x, y, z, this.upX, this.upY, this.upZ); - } //////////////////////////////////////////////////////////////////////////////// - // Camera Position Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Sets the camera's position and orientation. - * Accepts the same parameters as the global - * camera(). - * More information on this function can be found there. - * @method camera - * @for p5.Camera - * @example - *
                - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // Create a camera. - * // createCamera() sets the newly created camera as - * // the current (active) camera. - * cam = createCamera(); - * } - * - * function draw() { - * background(204); - * // Move the camera away from the plane by a sin wave - * cam.camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); - * plane(10, 10); - * } - * - *
                - * @alt - * White square repeatedly grows to fill canvas and then shrinks. - * - * @example - *
                - * - * // move slider to see changes! - * // sliders control the first 6 parameters of camera() - * - * let sliderGroup = []; - * let X; - * let Y; - * let Z; - * let centerX; - * let centerY; - * let centerZ; - * let h = 20; - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // create a camera - * cam = createCamera(); - * // create sliders - * for (var i = 0; i < 6; i++) { - * if (i === 2) { - * sliderGroup[i] = createSlider(10, 400, 200); - * } else { - * sliderGroup[i] = createSlider(-400, 400, 0); - * } - * h = map(i, 0, 6, 5, 85); - * sliderGroup[i].position(10, height + h); - * sliderGroup[i].style('width', '80px'); - * } - * } - * - * function draw() { - * background(60); - * // assigning sliders' value to each parameters - * X = sliderGroup[0].value(); - * Y = sliderGroup[1].value(); - * Z = sliderGroup[2].value(); - * centerX = sliderGroup[3].value(); - * centerY = sliderGroup[4].value(); - * centerZ = sliderGroup[5].value(); - * cam.camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); - * stroke(255); - * fill(255, 102, 94); - * box(85); - * } - * - *
                - * @alt - * An interactive example of a red cube with 3 sliders for moving it across x, y, - * z axis and 3 sliders for shifting its center. - */ - - }, - { - key: 'camera', - value: function camera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ) { - if (typeof eyeX === 'undefined') { - eyeX = this.defaultEyeX; - eyeY = this.defaultEyeY; - eyeZ = this.defaultEyeZ; - centerX = eyeX; - centerY = eyeY; - centerZ = 0; - upX = 0; - upY = 1; - upZ = 0; - } - this.eyeX = eyeX; - this.eyeY = eyeY; - this.eyeZ = eyeZ; - if (typeof centerX !== 'undefined') { - this.centerX = centerX; - this.centerY = centerY; - this.centerZ = centerZ; - } - if (typeof upX !== 'undefined') { - this.upX = upX; - this.upY = upY; - this.upZ = upZ; - } - var local = this._getLocalAxes(); - // the camera affects the model view matrix, insofar as it - // inverse translates the world to the eye position of the camera - // and rotates it. - /* eslint-disable indent */ - this.cameraMatrix.set(local.x[0], local.y[0], local.z[0], 0, local.x[1], local.y[1], local.z[1], 0, local.x[2], local.y[2], local.z[2], 0, 0, 0, 0, 1); - /* eslint-enable indent */ - var tx = - eyeX; - var ty = - eyeY; - var tz = - eyeZ; - this.cameraMatrix.translate([tx, - ty, - tz]); - if (this._isActive()) { - this._renderer.uMVMatrix.set(this.cameraMatrix.mat4[0], this.cameraMatrix.mat4[1], this.cameraMatrix.mat4[2], this.cameraMatrix.mat4[3], this.cameraMatrix.mat4[4], this.cameraMatrix.mat4[5], this.cameraMatrix.mat4[6], this.cameraMatrix.mat4[7], this.cameraMatrix.mat4[8], this.cameraMatrix.mat4[9], this.cameraMatrix.mat4[10], this.cameraMatrix.mat4[11], this.cameraMatrix.mat4[12], this.cameraMatrix.mat4[13], this.cameraMatrix.mat4[14], this.cameraMatrix.mat4[15]); - } - return this; - } /** - * Move camera along its local axes while maintaining current camera orientation. - * @method move - * @param {Number} x amount to move along camera's left-right axis - * @param {Number} y amount to move along camera's up-down axis - * @param {Number} z amount to move along camera's forward-backward axis - * @example - *
                - * - * // see the camera move along its own axes while maintaining its orientation - * let cam; - * let delta = 0.5; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * } - * - * function draw() { - * background(200); - * - * // move the camera along its local axes - * cam.move(delta, delta, 0); - * - * // every 100 frames, switch direction - * if (frameCount % 150 === 0) { - * delta *= -1; - * } - * - * translate(-10, -10, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * } - * - *
                - * - * @alt - * camera view moves along a series of 3D boxes, maintaining the same - * orientation throughout the move - */ - - }, - { - key: 'move', - value: function move(x, y, z) { - var local = this._getLocalAxes(); - // scale local axes by movement amounts - // based on http://learnwebgl.brown37.net/07_cameras/camera_linear_motion.html - var dx = [ - local.x[0] * x, - local.x[1] * x, - local.x[2] * x - ]; - var dy = [ - local.y[0] * y, - local.y[1] * y, - local.y[2] * y - ]; - var dz = [ - local.z[0] * z, - local.z[1] * z, - local.z[2] * z - ]; - this.camera(this.eyeX + dx[0] + dy[0] + dz[0], this.eyeY + dx[1] + dy[1] + dz[1], this.eyeZ + dx[2] + dy[2] + dz[2], this.centerX + dx[0] + dy[0] + dz[0], this.centerY + dx[1] + dy[1] + dz[1], this.centerZ + dx[2] + dy[2] + dz[2], this.upX, this.upY, this.upZ); - } /** - * Set camera position in world-space while maintaining current camera - * orientation. - * @method setPosition - * @param {Number} x x position of a point in world space - * @param {Number} y y position of a point in world space - * @param {Number} z z position of a point in world space - * @example - *
                - * - * // press '1' '2' or '3' keys to set camera position - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * } - * - * function draw() { - * background(200); - * - * // '1' key - * if (keyIsDown(49)) { - * cam.setPosition(30, 0, 80); - * } - * // '2' key - * if (keyIsDown(50)) { - * cam.setPosition(0, 0, 80); - * } - * // '3' key - * if (keyIsDown(51)) { - * cam.setPosition(-30, 0, 80); - * } - * - * box(20); - * } - * - *
                - * - * @alt - * camera position changes as the user presses keys, altering view of a 3D box - */ - - }, - { - key: 'setPosition', - value: function setPosition(x, y, z) { - var diffX = x - this.eyeX; - var diffY = y - this.eyeY; - var diffZ = z - this.eyeZ; - this.camera(x, y, z, this.centerX + diffX, this.centerY + diffY, this.centerZ + diffZ, this.upX, this.upY, this.upZ); - } /** - * Copies information about the argument camera's view and projection to - * the target camera. If the target camera is active, it will be reflected - * on the screen. - * - * @method set - * @param {p5.Camera} cam source camera - * - * @example - *
                - * - * let cam, initialCam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * strokeWeight(3); - * - * // Set the initial state to initialCamera and set it to the camera - * // used for drawing. Then set cam to be the active camera. - * cam = createCamera(); - * initialCam = createCamera(); - * initialCam.camera(100, 100, 100, 0, 0, 0, 0, 0, -1); - * cam.set(initialCam); - * - * setCamera(cam); - * } - * - * function draw() { - * orbitControl(); - * background(255); - * box(50); - * translate(0, 0, -25); - * plane(100); - * } - * - * function doubleClicked(){ - * // Double-click to return the camera to its initial position. - * cam.set(initialCam); - * } - * - *
                - * @alt - * Prepare two cameras. One is the camera that sets the initial state, - * and the other is the camera that moves with interaction. - * Draw a plane and a box on top of it, operate the camera using orbitControl(). - * Double-click to set the camera in the initial state and return to - * the initial state. - */ - - }, - { - key: 'set', - value: function set(cam) { - var keyNamesOfThePropToCopy = [ - 'eyeX', - 'eyeY', - 'eyeZ', - 'centerX', - 'centerY', - 'centerZ', - 'upX', - 'upY', - 'upZ', - 'cameraFOV', - 'aspectRatio', - 'cameraNear', - 'cameraFar', - 'cameraType', - 'yScale' - ]; - for (var _i = 0, _keyNamesOfThePropToC = keyNamesOfThePropToCopy; _i < _keyNamesOfThePropToC.length; _i++) { - var keyName = _keyNamesOfThePropToC[_i]; - this[keyName] = cam[keyName]; - } - this.cameraMatrix = cam.cameraMatrix.copy(); - this.projMatrix = cam.projMatrix.copy(); - // If the target camera is active, update uMVMatrix and uPMatrix. - if (this._isActive()) { - this._renderer.uMVMatrix.mat4 = this.cameraMatrix.mat4.slice(); - this._renderer.uPMatrix.mat4 = this.projMatrix.mat4.slice(); - } - } /** - * For the cameras cam0 and cam1 with the given arguments, their view are combined - * with the parameter amt that represents the quantity, and the obtained view is applied. - * For example, if cam0 is looking straight ahead and cam1 is looking straight - * to the right and amt is 0.5, the applied camera will look to the halfway - * between front and right. - * If the applied camera is active, the applied result will be reflected on the screen. - * When applying this function, all cameras involved must have exactly the same projection - * settings. For example, if one is perspective, ortho, frustum, the other two must also be - * perspective, ortho, frustum respectively. However, if all cameras have ortho settings, - * interpolation is possible if the ratios of left, right, top and bottom are equal to each other. - * For example, when it is changed by orbitControl(). - * - * @method slerp - * @param {p5.Camera} cam0 first p5.Camera - * @param {p5.Camera} cam1 second p5.Camera - * @param {Number} amt amount to use for interpolation during slerp - * - * @example - *
                - * - * let cam0, cam1, cam; - * function setup() { - * createCanvas(100, 100, WEBGL); - * strokeWeight(3); - * - * // camera for slerp. - * cam = createCamera(); - * // cam0 is looking at the cube from the front. - * // cam1 is pointing straight to the right in the cube - * // at the same position as cam0 by doing a pan(-PI/2). - * cam0 = createCamera(); - * cam1 = createCamera(); - * cam1.pan(-PI/2); - * - * // we only use cam. - * setCamera(cam); - * } - * - * function draw() { - * // calculate amount. - * const amt = 0.5 - 0.5 * cos(frameCount * TAU / 120); - * // slerp cam0 and cam1 with amt, set to cam. - * // When amt moves from 0 to 1, cam moves from cam0 to cam1, - * // shaking the camera to the right. - * cam.slerp(cam0, cam1, amt); - * - * background(255); - * // Every time the camera turns right, the cube drifts left. - * box(40); - * } - * - *
                - * @alt - * Prepare two cameras. One camera is facing straight ahead to the cube and the other - * camera is in the same position and looking straight to the right. - * If you use a camera which interpolates these with slerp(), the facing direction - * of the camera will change smoothly between the front and the right. - * - * @example - *
                - * - * let cam, lastCam, initialCam; - * let countForReset = 30; - * // This sample uses orbitControl() to move the camera. - * // Double-clicking the canvas restores the camera to its initial state. - * function setup() { - * createCanvas(100, 100, WEBGL); - * strokeWeight(3); - * - * cam = createCamera(); // main camera - * lastCam = createCamera(); // Camera for recording loc info before reset - * initialCam = createCamera(); // Camera for recording the initial state - * - * setCamera(cam); // set main camera - * } - * - * function draw() { - * if (countForReset < 30) { - * // if the reset count is less than 30, - * // it will move closer to the original camera as it increases. - * countForReset++; - * cam.slerp(lastCam, initialCam, countForReset / 30); - * } else { - * // if the count is 30, - * // you can freely move the main camera with orbitControl(). - * orbitControl(); - * } - * - * background(255); - * box(40); - * } - * // A double-click sets countForReset to 0 and initiates a reset. - * function doubleClicked() { - * if (countForReset === 30) { - * countForReset = 0; - * lastCam.set(cam); - * } - * } - * - *
                - * @alt - * There is a camera, drawing a cube. The camera can be moved freely with - * orbitControl(). Double-click to smoothly return the camera to its initial state. - * The camera cannot be moved during that time. - */ - - }, - { - key: 'slerp', - value: function slerp(cam0, cam1, amt) { - // If t is 0 or 1, do not interpolate and set the argument camera. - if (amt === 0) { - this.set(cam0); - return; - } else if (amt === 1) { - this.set(cam1); - return; - } // For this cameras is ortho, assume that cam0 and cam1 are also ortho - // and interpolate the elements of the projection matrix. - // Use logarithmic interpolation for interpolation. - - if (this.projMatrix.mat4[15] !== 0) { - this.projMatrix.mat4[0] = cam0.projMatrix.mat4[0] * Math.pow(cam1.projMatrix.mat4[0] / cam0.projMatrix.mat4[0], amt); - this.projMatrix.mat4[5] = cam0.projMatrix.mat4[5] * Math.pow(cam1.projMatrix.mat4[5] / cam0.projMatrix.mat4[5], amt); - // If the camera is active, make uPMatrix reflect changes in projMatrix. - if (this._isActive()) { - this._renderer.uPMatrix.mat4 = this.projMatrix.mat4.slice(); - } - } // prepare eye vector and center vector of argument cameras. - - var eye0 = new _main.default.Vector(cam0.eyeX, cam0.eyeY, cam0.eyeZ); - var eye1 = new _main.default.Vector(cam1.eyeX, cam1.eyeY, cam1.eyeZ); - var center0 = new _main.default.Vector(cam0.centerX, cam0.centerY, cam0.centerZ); - var center1 = new _main.default.Vector(cam1.centerX, cam1.centerY, cam1.centerZ); - // Calculate the distance between eye and center for each camera. - // Logarithmically interpolate these with amt. - var dist0 = _main.default.Vector.dist(eye0, center0); - var dist1 = _main.default.Vector.dist(eye1, center1); - var lerpedDist = dist0 * Math.pow(dist1 / dist0, amt); - // Next, calculate the ratio to interpolate the eye and center by a constant - // ratio for each camera. This ratio is the same for both. Also, with this ratio - // of points, the distance is the minimum distance of the two points of - // the same ratio. - // With this method, if the viewpoint is fixed, linear interpolation is performed - // at the viewpoint, and if the center is fixed, linear interpolation is performed - // at the center, resulting in reasonable interpolation. If both move, the point - // halfway between them is taken. - var eyeDiff = _main.default.Vector.sub(eye0, eye1); - var diffDiff = eye0.copy().sub(eye1).sub(center0).add(center1); - // Suppose there are two line segments. Consider the distance between the points - // above them as if they were taken in the same ratio. This calculation figures out - // a ratio that minimizes this. - // Each line segment is, a line segment connecting the viewpoint and the center - // for each camera. - var divider = diffDiff.magSq(); - var ratio = 1; // default. - if (divider > 0.000001) { - ratio = _main.default.Vector.dot(eyeDiff, diffDiff) / divider; - ratio = Math.max(0, Math.min(ratio, 1)); - } // Take the appropriate proportions and work out the points - // that are between the new viewpoint and the new center position. - - var lerpedMedium = _main.default.Vector.lerp(_main.default.Vector.lerp(eye0, center0, ratio), _main.default.Vector.lerp(eye1, center1, ratio), amt); - // Prepare each of rotation matrix from their camera matrix - var rotMat0 = cam0.cameraMatrix.createSubMatrix3x3(); - var rotMat1 = cam1.cameraMatrix.createSubMatrix3x3(); - // get front and up vector from local-coordinate-system. - var front0 = rotMat0.row(2); - var front1 = rotMat1.row(2); - var up0 = rotMat0.row(1); - var up1 = rotMat1.row(1); - // prepare new vectors. - var newFront = new _main.default.Vector(); - var newUp = new _main.default.Vector(); - var newEye = new _main.default.Vector(); - var newCenter = new _main.default.Vector(); - // Create the inverse matrix of mat0 by transposing mat0, - // and multiply it to mat1 from the right. - // This matrix represents the difference between the two. - // 'deltaRot' means 'difference of rotation matrices'. - var deltaRot = rotMat1.mult3x3(rotMat0.copy().transpose3x3()); - // Calculate the trace and from it the cos value of the angle. - // An orthogonal matrix is just an orthonormal basis. If this is not the identity - // matrix, it is a centered orthonormal basis plus some angle of rotation about - // some axis. That's the angle. Letting this be theta, trace becomes 1+2cos(theta). - // reference: https://en.wikipedia.org/wiki/Rotation_matrix#Determining_the_angle - var diag = deltaRot.diagonal(); - var cosTheta = 0.5 * (diag[0] + diag[1] + diag[2] - 1); - // If the angle is close to 0, the two matrices are very close, - // so in that case we execute linearly interpolate. - if (1 - cosTheta < 1e-7) { - // Obtain the front vector and up vector by linear interpolation - // and normalize them. - // calculate newEye, newCenter with newFront vector. - newFront.set(_main.default.Vector.lerp(front0, front1, amt)).normalize(); - newEye.set(newFront).mult(ratio * lerpedDist).add(lerpedMedium); - newCenter.set(newFront).mult((ratio - 1) * lerpedDist).add(lerpedMedium); - newUp.set(_main.default.Vector.lerp(up0, up1, amt)).normalize(); - // set the camera - this.camera(newEye.x, newEye.y, newEye.z, newCenter.x, newCenter.y, newCenter.z, newUp.x, newUp.y, newUp.z); - return; - } // Calculates the axis vector and the angle of the difference orthogonal matrix. - // The axis vector is what I explained earlier in the comments. - // similar calculation is here: - // https://github.com/mrdoob/three.js/blob/883249620049d1632e8791732808fefd1a98c871/src/math/Quaternion.js#L294 - - var a, - b, - c, - sinTheta; - var invOneMinusCosTheta = 1 / (1 - cosTheta); - var maxDiag = Math.max(diag[0], diag[1], diag[2]); - var offDiagSum13 = deltaRot.mat3[1] + deltaRot.mat3[3]; - var offDiagSum26 = deltaRot.mat3[2] + deltaRot.mat3[6]; - var offDiagSum57 = deltaRot.mat3[5] + deltaRot.mat3[7]; - if (maxDiag === diag[0]) { - a = Math.sqrt((diag[0] - cosTheta) * invOneMinusCosTheta); // not zero. - invOneMinusCosTheta /= a; - b = 0.5 * offDiagSum13 * invOneMinusCosTheta; - c = 0.5 * offDiagSum26 * invOneMinusCosTheta; - sinTheta = 0.5 * (deltaRot.mat3[7] - deltaRot.mat3[5]) / a; - } else if (maxDiag === diag[1]) { - b = Math.sqrt((diag[1] - cosTheta) * invOneMinusCosTheta); // not zero. - invOneMinusCosTheta /= b; - c = 0.5 * offDiagSum57 * invOneMinusCosTheta; - a = 0.5 * offDiagSum13 * invOneMinusCosTheta; - sinTheta = 0.5 * (deltaRot.mat3[2] - deltaRot.mat3[6]) / b; - } else { - c = Math.sqrt((diag[2] - cosTheta) * invOneMinusCosTheta); // not zero. - invOneMinusCosTheta /= c; - a = 0.5 * offDiagSum26 * invOneMinusCosTheta; - b = 0.5 * offDiagSum57 * invOneMinusCosTheta; - sinTheta = 0.5 * (deltaRot.mat3[3] - deltaRot.mat3[1]) / c; - } // Constructs a new matrix after interpolating the angles. - // Multiplying mat0 by the first matrix yields mat1, but by creating a state - // in the middle of that matrix, you can obtain a matrix that is - // an intermediate state between mat0 and mat1. - - var angle = amt * Math.atan2(sinTheta, cosTheta); - var cosAngle = Math.cos(angle); - var sinAngle = Math.sin(angle); - var oneMinusCosAngle = 1 - cosAngle; - var ab = a * b; - var bc = b * c; - var ca = c * a; - var lerpedRotMat = new _main.default.Matrix('mat3', [ - cosAngle + oneMinusCosAngle * a * a, - oneMinusCosAngle * ab + sinAngle * c, - oneMinusCosAngle * ca - sinAngle * b, - oneMinusCosAngle * ab - sinAngle * c, - cosAngle + oneMinusCosAngle * b * b, - oneMinusCosAngle * bc + sinAngle * a, - oneMinusCosAngle * ca + sinAngle * b, - oneMinusCosAngle * bc - sinAngle * a, - cosAngle + oneMinusCosAngle * c * c - ]); - // Multiply this to mat0 from left to get the interpolated front vector. - // calculate newEye, newCenter with newFront vector. - lerpedRotMat.multiplyVec3(front0, newFront); - newEye.set(newFront).mult(ratio * lerpedDist).add(lerpedMedium); - newCenter.set(newFront).mult((ratio - 1) * lerpedDist).add(lerpedMedium); - lerpedRotMat.multiplyVec3(up0, newUp); - // We also get the up vector in the same way and set the camera. - // The eye position and center position are calculated based on the front vector. - this.camera(newEye.x, newEye.y, newEye.z, newCenter.x, newCenter.y, newCenter.z, newUp.x, newUp.y, newUp.z); - } //////////////////////////////////////////////////////////////////////////////// - // Camera Helper Methods - //////////////////////////////////////////////////////////////////////////////// - // @TODO: combine this function with _setDefaultCamera to compute these values - // as-needed - - }, - { - key: '_computeCameraDefaultSettings', - value: function _computeCameraDefaultSettings() { - this.defaultAspectRatio = this._renderer.width / this._renderer.height; - this.defaultEyeX = 0; - this.defaultEyeY = 0; - this.defaultEyeZ = 800; - this.defaultCameraFOV = 2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ); - this.defaultCenterX = 0; - this.defaultCenterY = 0; - this.defaultCenterZ = 0; - this.defaultCameraNear = this.defaultEyeZ * 0.1; - this.defaultCameraFar = this.defaultEyeZ * 10; - } //detect if user didn't set the camera - //then call this function below - - }, - { - key: '_setDefaultCamera', - value: function _setDefaultCamera() { - this.cameraFOV = this.defaultCameraFOV; - this.aspectRatio = this.defaultAspectRatio; - this.eyeX = this.defaultEyeX; - this.eyeY = this.defaultEyeY; - this.eyeZ = this.defaultEyeZ; - this.centerX = this.defaultCenterX; - this.centerY = this.defaultCenterY; - this.centerZ = this.defaultCenterZ; - this.upX = 0; - this.upY = 1; - this.upZ = 0; - this.cameraNear = this.defaultCameraNear; - this.cameraFar = this.defaultCameraFar; - this.perspective(); - this.camera(); - this.cameraType = 'default'; - } - }, - { - key: '_resize', - value: function _resize() { - // If we're using the default camera, update the aspect ratio - if (this.cameraType === 'default') { - this._computeCameraDefaultSettings(); - this.cameraFOV = this.defaultCameraFOV; - this.aspectRatio = this.defaultAspectRatio; - this.perspective(); - } - } /** - * Returns a copy of a camera. - * @method copy - * @private - */ - - }, - { - key: 'copy', - value: function copy() { - var _cam = new _main.default.Camera(this._renderer); - _cam.cameraFOV = this.cameraFOV; - _cam.aspectRatio = this.aspectRatio; - _cam.eyeX = this.eyeX; - _cam.eyeY = this.eyeY; - _cam.eyeZ = this.eyeZ; - _cam.centerX = this.centerX; - _cam.centerY = this.centerY; - _cam.centerZ = this.centerZ; - _cam.upX = this.upX; - _cam.upY = this.upY; - _cam.upZ = this.upZ; - _cam.cameraNear = this.cameraNear; - _cam.cameraFar = this.cameraFar; - _cam.cameraType = this.cameraType; - _cam.cameraMatrix = this.cameraMatrix.copy(); - _cam.projMatrix = this.projMatrix.copy(); - _cam.yScale = this.yScale; - return _cam; - } /** - * Returns a camera's local axes: left-right, up-down, and forward-backward, - * as defined by vectors in world-space. - * @method _getLocalAxes - * @private - */ - - }, - { - key: '_getLocalAxes', - value: function _getLocalAxes() { - // calculate camera local Z vector - var z0 = this.eyeX - this.centerX; - var z1 = this.eyeY - this.centerY; - var z2 = this.eyeZ - this.centerZ; - // normalize camera local Z vector - var eyeDist = Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - if (eyeDist !== 0) { - z0 /= eyeDist; - z1 /= eyeDist; - z2 /= eyeDist; - } // calculate camera Y vector - - var y0 = this.upX; - var y1 = this.upY; - var y2 = this.upZ; - // compute camera local X vector as up vector (local Y) cross local Z - var x0 = y1 * z2 - y2 * z1; - var x1 = - y0 * z2 + y2 * z0; - var x2 = y0 * z1 - y1 * z0; - // recompute y = z cross x - y0 = z1 * x2 - z2 * x1; - y1 = - z0 * x2 + z2 * x0; - y2 = z0 * x1 - z1 * x0; - // cross product gives area of parallelogram, which is < 1.0 for - // non-perpendicular unit-length vectors; so normalize x, y here: - var xmag = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - if (xmag !== 0) { - x0 /= xmag; - x1 /= xmag; - x2 /= xmag; - } - var ymag = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - if (ymag !== 0) { - y0 /= ymag; - y1 /= ymag; - y2 /= ymag; - } - return { - x: [ - x0, - x1, - x2 - ], - y: [ - y0, - y1, - y2 - ], - z: [ - z0, - z1, - z2 - ] - }; - } /** - * Orbits the camera about center point. For use with orbitControl(). - * @method _orbit - * @private - * @param {Number} dTheta change in spherical coordinate theta - * @param {Number} dPhi change in spherical coordinate phi - * @param {Number} dRadius change in radius - */ - - }, - { - key: '_orbit', - value: function _orbit(dTheta, dPhi, dRadius) { - // Calculate the vector and its magnitude from the center to the viewpoint - var diffX = this.eyeX - this.centerX; - var diffY = this.eyeY - this.centerY; - var diffZ = this.eyeZ - this.centerZ; - var camRadius = Math.hypot(diffX, diffY, diffZ); - // front vector. unit vector from center to eye. - var front = new _main.default.Vector(diffX, diffY, diffZ).normalize(); - // up vector. normalized camera's up vector. - var up = new _main.default.Vector(this.upX, this.upY, this.upZ).normalize(); // y-axis - // side vector. Right when viewed from the front - var side = new _main.default.Vector.cross(up, front).normalize(); // x-axis - // vertical vector. normalized vector of projection of front vector. - var vertical = new _main.default.Vector.cross(side, up); // z-axis - // update camRadius - camRadius *= Math.pow(10, dRadius); - // prevent zooming through the center: - if (camRadius < this.cameraNear) { - camRadius = this.cameraNear; - } - if (camRadius > this.cameraFar) { - camRadius = this.cameraFar; - } // calculate updated camera angle - // Find the angle between the "up" and the "front", add dPhi to that. - // angleBetween() may return negative value. Since this specification is subject to change - // due to version updates, it cannot be adopted, so here we calculate using a method - // that directly obtains the absolute value. - - var camPhi = Math.acos(Math.max( - 1, Math.min(1, _main.default.Vector.dot(front, up)))) + dPhi; - // Rotate by dTheta in the shortest direction from "vertical" to "side" - var camTheta = dTheta; - // Invert camera's upX, upY, upZ if dPhi is below 0 or above PI - if (camPhi <= 0 || camPhi >= Math.PI) { - this.upX *= - 1; - this.upY *= - 1; - this.upZ *= - 1; - } // update eye vector by calculate new front vector - - up.mult(Math.cos(camPhi)); - vertical.mult(Math.cos(camTheta) * Math.sin(camPhi)); - side.mult(Math.sin(camTheta) * Math.sin(camPhi)); - front.set(up).add(vertical).add(side); - this.eyeX = camRadius * front.x + this.centerX; - this.eyeY = camRadius * front.y + this.centerY; - this.eyeZ = camRadius * front.z + this.centerZ; - // update camera - this.camera(this.eyeX, this.eyeY, this.eyeZ, this.centerX, this.centerY, this.centerZ, this.upX, this.upY, this.upZ); - } /** - * Orbits the camera about center point. For use with orbitControl(). - * Unlike _orbit(), the direction of rotation always matches the direction of pointer movement. - * @method _orbitFree - * @private - * @param {Number} dx the x component of the rotation vector. - * @param {Number} dy the y component of the rotation vector. - * @param {Number} dRadius change in radius - */ - - }, - { - key: '_orbitFree', - value: function _orbitFree(dx, dy, dRadius) { - // Calculate the vector and its magnitude from the center to the viewpoint - var diffX = this.eyeX - this.centerX; - var diffY = this.eyeY - this.centerY; - var diffZ = this.eyeZ - this.centerZ; - var camRadius = Math.hypot(diffX, diffY, diffZ); - // front vector. unit vector from center to eye. - var front = new _main.default.Vector(diffX, diffY, diffZ).normalize(); - // up vector. camera's up vector. - var up = new _main.default.Vector(this.upX, this.upY, this.upZ); - // side vector. Right when viewed from the front. (like x-axis) - var side = new _main.default.Vector.cross(up, front).normalize(); - // down vector. Bottom when viewed from the front. (like y-axis) - var down = new _main.default.Vector.cross(front, side); - // side vector and down vector are no longer used as-is. - // Create a vector representing the direction of rotation - // in the form cos(direction)*side + sin(direction)*down. - // Make the current side vector into this. - var directionAngle = Math.atan2(dy, dx); - down.mult(Math.sin(directionAngle)); - side.mult(Math.cos(directionAngle)).add(down); - // The amount of rotation is the size of the vector (dx, dy). - var rotAngle = Math.sqrt(dx * dx + dy * dy); - // The vector that is orthogonal to both the front vector and - // the rotation direction vector is the rotation axis vector. - var axis = new _main.default.Vector.cross(front, side); - // update camRadius - camRadius *= Math.pow(10, dRadius); - // prevent zooming through the center: - if (camRadius < this.cameraNear) { - camRadius = this.cameraNear; - } - if (camRadius > this.cameraFar) { - camRadius = this.cameraFar; - } // If the axis vector is likened to the z-axis, the front vector is - // the x-axis and the side vector is the y-axis. Rotate the up and front - // vectors respectively by thinking of them as rotations around the z-axis. - // Calculate the components by taking the dot product and - // calculate a rotation based on that. - - var c = Math.cos(rotAngle); - var s = Math.sin(rotAngle); - var dotFront = up.dot(front); - var dotSide = up.dot(side); - var ux = dotFront * c + dotSide * s; - var uy = - dotFront * s + dotSide * c; - var uz = up.dot(axis); - up.x = ux * front.x + uy * side.x + uz * axis.x; - up.y = ux * front.y + uy * side.y + uz * axis.y; - up.z = ux * front.z + uy * side.z + uz * axis.z; - // We won't be using the side vector and the front vector anymore, - // so let's make the front vector into the vector from the center to the new eye. - side.mult( - s); - front.mult(c).add(side).mult(camRadius); - // it's complete. let's update camera. - this.camera(front.x + this.centerX, front.y + this.centerY, front.z + this.centerZ, this.centerX, this.centerY, this.centerZ, up.x, up.y, up.z); - } /** - * Returns true if camera is currently attached to renderer. - * @method _isActive - * @private - */ - - }, - { - key: '_isActive', - value: function _isActive() { - return this === this._renderer._curCamera; - } - } - ]); - return Camera; - }(); - /** - * Sets the current (active) camera of a 3D sketch. - * Allows for switching between multiple cameras. - * @method setCamera - * @param {p5.Camera} cam p5.Camera object - * @for p5 - * @example - *
                - * - * let cam1, cam2; - * let currentCamera; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * - * cam1 = createCamera(); - * cam2 = createCamera(); - * cam2.setPosition(30, 0, 50); - * cam2.lookAt(0, 0, 0); - * cam2.ortho(); - * - * // set variable for previously active camera: - * currentCamera = 1; - * - * describe( - * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' - * ); - * } - * - * function draw() { - * background(200); - * - * // camera 1: - * cam1.lookAt(0, 0, 0); - * cam1.setPosition(sin(frameCount / 60) * 200, 0, 100); - * - * // every 100 frames, switch between the two cameras - * if (frameCount % 100 === 0) { - * if (currentCamera === 1) { - * setCamera(cam1); - * currentCamera = 0; - * } else { - * setCamera(cam2); - * currentCamera = 1; - * } - * } - * - * drawBoxes(); - * } - * - * function drawBoxes() { - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                - * - * @alt - * Canvas switches between two camera views, each showing a series of spinning - * 3D boxes. - */ - _main.default.prototype.setCamera = function (cam) { - this._renderer._curCamera = cam; - // set the projection matrix (which is not normally updated each frame) - this._renderer.uPMatrix.set(cam.projMatrix.mat4[0], cam.projMatrix.mat4[1], cam.projMatrix.mat4[2], cam.projMatrix.mat4[3], cam.projMatrix.mat4[4], cam.projMatrix.mat4[5], cam.projMatrix.mat4[6], cam.projMatrix.mat4[7], cam.projMatrix.mat4[8], cam.projMatrix.mat4[9], cam.projMatrix.mat4[10], cam.projMatrix.mat4[11], cam.projMatrix.mat4[12], cam.projMatrix.mat4[13], cam.projMatrix.mat4[14], cam.projMatrix.mat4[15]); - }; - var _default = _main.default.Camera; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.math.hypot': 188, - 'core-js/modules/es.string.sub': 218 - } - ], - 348: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.log2'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.math.log2'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * An internal class to store data that will be sent to a p5.RenderBuffer. - * Those need to eventually go into a Float32Array, so this class provides a - * variable-length array container backed by a Float32Array so that it can be - * sent to the GPU without allocating a new array each frame. - * - * Like a C++ vector, its fixed-length Float32Array backing its contents will - * double in size when it goes over its capacity. - * - * @example - *
                - * - * // Initialize storage with a capacity of 4 - * const storage = new DataArray(4); - * console.log(storage.data.length); // 4 - * console.log(storage.length); // 0 - * console.log(storage.dataArray()); // Empty Float32Array - * - * storage.push(1, 2, 3, 4, 5, 6); - * console.log(storage.data.length); // 8 - * console.log(storage.length); // 6 - * console.log(storage.dataArray()); // Float32Array{1, 2, 3, 4, 5, 6} - * - *
                - */ - - _main.default.DataArray = /*#__PURE__*/ function () { - function DataArray() { - var initialLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 128; - _classCallCheck(this, DataArray); - this.length = 0; - this.data = new Float32Array(initialLength); - this.initialLength = initialLength; - } /** - * Returns a Float32Array window sized to the exact length of the data - */ - - _createClass(DataArray, [ - { - key: 'dataArray', - value: function dataArray() { - return this.subArray(0, this.length); - } /** - * A "soft" clear, which keeps the underlying storage size the same, but - * empties the contents of its dataArray() - */ - - }, - { - key: 'clear', - value: function clear() { - this.length = 0; - } /** - * Can be used to scale a DataArray back down to fit its contents. - */ - - }, - { - key: 'rescale', - value: function rescale() { - if (this.length < this.data.length / 2) { - // Find the power of 2 size that fits the data - var targetLength = 1 << Math.ceil(Math.log2(this.length)); - var newData = new Float32Array(targetLength); - newData.set(this.data.subarray(0, this.length), 0); - this.data = newData; - } - } /** - * A full reset, which allocates a new underlying Float32Array at its initial - * length - */ - - }, - { - key: 'reset', - value: function reset() { - this.clear(); - this.data = new Float32Array(this.initialLength); - } /** - * Adds values to the DataArray, expanding its internal storage to - * accommodate the new items. - */ - - }, - { - key: 'push', - value: function push() { - for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { - values[_key] = arguments[_key]; - } - this.ensureLength(this.length + values.length); - this.data.set(values, this.length); - this.length += values.length; - } /** - * Returns a copy of the data from the index `from`, inclusive, to the index - * `to`, exclusive - */ - - }, - { - key: 'slice', - value: function slice(from, to) { - return this.data.slice(from, Math.min(to, this.length)); - } /** - * Returns a mutable Float32Array window from the index `from`, inclusive, to - * the index `to`, exclusive - */ - - }, - { - key: 'subArray', - value: function subArray(from, to) { - return this.data.subarray(from, Math.min(to, this.length)); - } /** - * Expand capacity of the internal storage until it can fit a target size - */ - - }, - { - key: 'ensureLength', - value: function ensureLength(target) { - while (this.data.length < target) { - var newData = new Float32Array(this.data.length * 2); - newData.set(this.data, 0); - this.data = newData; - } - } - } - ]); - return DataArray; - }(); - var _default = _main.default.DataArray; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.math.log2': 189, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.float32-array': 229, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249 - } - ], - 349: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.reflect.get'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - var _p = _dereq_('./p5.Texture'); - var _p2 = _dereq_('./p5.RendererGL'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError('Invalid attempt to destructure non-iterable instance'); - } - function _iterableToArrayLimit(arr, i) { - if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === '[object Arguments]')) { - return; - } - var _arr = [ - ]; - var _n = true; - var _d = false; - var _e = undefined; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i['return'] != null) _i['return'](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _get(target, property, receiver) { - if (typeof Reflect !== 'undefined' && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * @module Rendering - * @requires constants - */ - - var FramebufferCamera = /*#__PURE__*/ function (_p5$Camera) { - _inherits(FramebufferCamera, _p5$Camera); - var _super = _createSuper(FramebufferCamera); - /** - * A p5.Camera attached to a - * p5.Framebuffer. - * - * @class p5.FramebufferCamera - * @constructor - * @param {p5.Framebuffer} framebuffer The framebuffer this camera is - * attached to - * @private - */ - function FramebufferCamera(framebuffer) { - var _this; - _classCallCheck(this, FramebufferCamera); - _this = _super.call(this, framebuffer.target._renderer); - _this.fbo = framebuffer; - // WebGL textures are upside-down compared to textures that come from - // images and graphics. Framebuffer cameras need to invert their y - // axes when being rendered to so that the texture comes out rightway up - // when read in shaders or image(). - _this.yScale = - 1; - return _this; - } - _createClass(FramebufferCamera, [ - { - key: '_computeCameraDefaultSettings', - value: function _computeCameraDefaultSettings() { - _get(_getPrototypeOf(FramebufferCamera.prototype), '_computeCameraDefaultSettings', this).call(this); - this.defaultAspectRatio = this.fbo.width / this.fbo.height; - this.defaultCameraFOV = 2 * Math.atan(this.fbo.height / 2 / this.defaultEyeZ); - } - } - ]); - return FramebufferCamera; - }(_main.default.Camera); - _main.default.FramebufferCamera = FramebufferCamera; - var FramebufferTexture = /*#__PURE__*/ function () { - /** - * A p5.Texture corresponding to a property of a - * p5.Framebuffer. - * - * @class p5.FramebufferTexture - * @param {p5.Framebuffer} framebuffer The framebuffer represented by this - * texture - * @param {String} property The property of the framebuffer represented by - * this texture, either `color` or `depth` - * @private - */ - function FramebufferTexture(framebuffer, property) { - _classCallCheck(this, FramebufferTexture); - this.framebuffer = framebuffer; - this.property = property; - } - _createClass(FramebufferTexture, [ - { - key: 'rawTexture', - value: function rawTexture() { - return this.framebuffer[this.property]; - } - }, - { - key: 'width', - get: function get() { - return this.framebuffer.width * this.framebuffer.density; - } - }, - { - key: 'height', - get: function get() { - return this.framebuffer.height * this.framebuffer.density; - } - } - ]); - return FramebufferTexture; - }(); - _main.default.FramebufferTexture = FramebufferTexture; - var Framebuffer = /*#__PURE__*/ function () { - /** - * An object that one can draw to and then read as a texture. While similar - * to a p5.Graphics, using a p5.Framebuffer as a texture will generally run - * much faster, as it lives within the same WebGL context as the canvas it - * is created on. It only works in WebGL mode. - * - * @class p5.Framebuffer - * @constructor - * @param {p5.Graphics|p5} target A p5 global instance or p5.Graphics - * @param {Object} [settings] A settings object - */ - function Framebuffer(target) { - var _this2 = this; - var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }; - _classCallCheck(this, Framebuffer); - this.target = target; - this.target._renderer.framebuffers.add(this); - this._isClipApplied = false; - /** - * A Uint8ClampedArray - * containing the values for all the pixels in the Framebuffer. - * - * Like the main canvas pixels property, call - * loadPixels() before reading - * it, and call updatePixels() - * afterwards to update its data. - * - * Note that updating pixels via this property will be slower than - * drawing to the framebuffer directly. - * Consider using a shader instead of looping over pixels. - * - * @property {Number[]} pixels - */ - this.pixels = [ - ]; - this.format = settings.format || constants.UNSIGNED_BYTE; - this.channels = settings.channels || (target._renderer._pInst._glAttributes.alpha ? constants.RGBA : constants.RGB); - this.useDepth = settings.depth === undefined ? true : settings.depth; - this.depthFormat = settings.depthFormat || constants.FLOAT; - this.textureFiltering = settings.textureFiltering || constants.LINEAR; - if (settings.antialias === undefined) { - this.antialiasSamples = target._renderer._pInst._glAttributes.antialias ? 2 : 0; - } else if (typeof settings.antialias === 'number') { - this.antialiasSamples = settings.antialias; - } else { - this.antialiasSamples = settings.antialias ? 2 : 0; - } - this.antialias = this.antialiasSamples > 0; - if (this.antialias && target.webglVersion !== constants.WEBGL2) { - console.warn('Antialiasing is unsupported in a WebGL 1 context'); - this.antialias = false; - } - if (settings.width && settings.height) { - this.width = settings.width; - this.height = settings.height; - this.autoSized = false; - } else { - if (settings.width === undefined !== (settings.height === undefined)) { - console.warn('Please supply both width and height for a framebuffer to give it a ' + 'size. Only one was given, so the framebuffer will match the size ' + 'of its canvas.'); - } - this.width = target.width; - this.height = target.height; - this.autoSized = true; - } - this.density = settings.density || target.pixelDensity(); - var gl = target._renderer.GL; - this.gl = gl; - this._checkIfFormatsAvailable(); - if (settings.stencil && !this.useDepth) { - console.warn('A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored.'); - } - this.useStencil = this.useDepth && (settings.stencil === undefined ? true : settings.stencil); - this.framebuffer = gl.createFramebuffer(); - if (!this.framebuffer) { - throw new Error('Unable to create a framebuffer'); - } - if (this.antialias) { - this.aaFramebuffer = gl.createFramebuffer(); - if (!this.aaFramebuffer) { - throw new Error('Unable to create a framebuffer for antialiasing'); - } - } - this._recreateTextures(); - var prevCam = this.target._renderer._curCamera; - this.defaultCamera = this.createCamera(); - this.target._renderer._curCamera = prevCam; - this.draw(function () { - return _this2.target.clear(); - }); - } /** - * Resizes the framebuffer to the given width and height. - * - * @method resize - * @param {Number} width - * @param {Number} height - * - * @example - *
                - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function mouseMoved() { - * framebuffer.resize( - * max(20, mouseX), - * max(20, mouseY) - * ); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * normalMaterial(); - * sphere(20); - * framebuffer.end(); - * - * background(100); - * // Draw the framebuffer to the main canvas - * image(framebuffer, -width/2, -height/2); - * } - * - *
                - * - * @alt - * A red, green, and blue sphere is drawn in the middle of a white rectangle - * which starts in the top left of the canvas and whose bottom right is at - * the user's mouse - */ - - _createClass(Framebuffer, [ - { - key: 'resize', - value: function resize(width, height) { - this.autoSized = false; - this.width = width; - this.height = height; - this._handleResize(); - } /** - * Gets or sets the pixel scaling for high pixel density displays. By - * default, the density will match that of the canvas the framebuffer was - * created on, which will match the display density. - * - * Call this method with no arguments to get the current density, or pass - * in a number to set the density. - * - * @method pixelDensity - * @param {Number} [density] A scaling factor for the number of pixels per - * side of the framebuffer - */ - - }, - { - key: 'pixelDensity', - value: function pixelDensity(density) { - if (density) { - this.autoSized = false; - this.density = density; - this._handleResize(); - } else { - return this.density; - } - } /** - * Gets or sets whether or not this framebuffer will automatically resize - * along with the canvas it's attached to in order to match its size. - * - * Call this method with no arguments to see if it is currently auto-sized, - * or pass in a boolean to set this property. - * - * @method autoSized - * @param {Boolean} [autoSized] Whether or not the framebuffer should resize - * along with the canvas it's attached to - */ - - }, - { - key: 'autoSized', - value: function autoSized(_autoSized) { - if (_autoSized === undefined) { - return this.autoSized; - } else { - this.autoSized = _autoSized; - this._handleResize(); - } - } /** - * Checks the capabilities of the current WebGL environment to see if the - * settings supplied by the user are capable of being fulfilled. If they - * are not, warnings will be logged and the settings will be changed to - * something close that can be fulfilled. - * - * @private - */ - - }, - { - key: '_checkIfFormatsAvailable', - value: function _checkIfFormatsAvailable() { - var gl = this.gl; - if (this.useDepth && this.target.webglVersion === constants.WEBGL && !gl.getExtension('WEBGL_depth_texture')) { - console.warn('Unable to create depth textures in this environment. Falling back ' + 'to a framebuffer without depth.'); - this.useDepth = false; - } - if (this.useDepth && this.target.webglVersion === constants.WEBGL && this.depthFormat === constants.FLOAT) { - console.warn('FLOAT depth format is unavailable in WebGL 1. ' + 'Defaulting to UNSIGNED_INT.'); - this.depthFormat = constants.UNSIGNED_INT; - } - if (![constants.UNSIGNED_BYTE, - constants.FLOAT, - constants.HALF_FLOAT].includes(this.format)) { - console.warn('Unknown Framebuffer format. ' + 'Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. ' + 'Defaulting to UNSIGNED_BYTE.'); - this.format = constants.UNSIGNED_BYTE; - } - if (this.useDepth && ![constants.UNSIGNED_INT, - constants.FLOAT].includes(this.depthFormat)) { - console.warn('Unknown Framebuffer depth format. ' + 'Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT.'); - this.depthFormat = constants.FLOAT; - } - var support = (0, _p.checkWebGLCapabilities) (this.target._renderer); - if (!support.float && this.format === constants.FLOAT) { - console.warn('This environment does not support FLOAT textures. ' + 'Falling back to UNSIGNED_BYTE.'); - this.format = constants.UNSIGNED_BYTE; - } - if (this.useDepth && !support.float && this.depthFormat === constants.FLOAT) { - console.warn('This environment does not support FLOAT depth textures. ' + 'Falling back to UNSIGNED_INT.'); - this.depthFormat = constants.UNSIGNED_INT; - } - if (!support.halfFloat && this.format === constants.HALF_FLOAT) { - console.warn('This environment does not support HALF_FLOAT textures. ' + 'Falling back to UNSIGNED_BYTE.'); - this.format = constants.UNSIGNED_BYTE; - } - if (this.channels === constants.RGB && [ - constants.FLOAT, - constants.HALF_FLOAT - ].includes(this.format)) { - console.warn('FLOAT and HALF_FLOAT formats do not work cross-platform with only ' + 'RGB channels. Falling back to RGBA.'); - this.channels = constants.RGBA; - } - } /** - * Creates new textures and renderbuffers given the current size of the - * framebuffer. - * - * @private - */ - - }, - { - key: '_recreateTextures', - value: function _recreateTextures() { - var gl = this.gl; - this._updateSize(); - var prevBoundTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); - var prevBoundFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); - var colorTexture = gl.createTexture(); - if (!colorTexture) { - throw new Error('Unable to create color texture'); - } - gl.bindTexture(gl.TEXTURE_2D, colorTexture); - var colorFormat = this._glColorFormat(); - gl.texImage2D(gl.TEXTURE_2D, 0, colorFormat.internalFormat, this.width * this.density, this.height * this.density, 0, colorFormat.format, colorFormat.type, null); - this.colorTexture = colorTexture; - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTexture, 0); - if (this.useDepth) { - // Create the depth texture - var depthTexture = gl.createTexture(); - if (!depthTexture) { - throw new Error('Unable to create depth texture'); - } - var depthFormat = this._glDepthFormat(); - gl.bindTexture(gl.TEXTURE_2D, depthTexture); - gl.texImage2D(gl.TEXTURE_2D, 0, depthFormat.internalFormat, this.width * this.density, this.height * this.density, 0, depthFormat.format, depthFormat.type, null); - gl.framebufferTexture2D(gl.FRAMEBUFFER, this.useStencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture, 0); - this.depthTexture = depthTexture; - } // Create separate framebuffer for antialiasing - - if (this.antialias) { - this.colorRenderbuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.colorRenderbuffer); - gl.renderbufferStorageMultisample(gl.RENDERBUFFER, Math.max(0, Math.min(this.antialiasSamples, gl.getParameter(gl.MAX_SAMPLES))), colorFormat.internalFormat, this.width * this.density, this.height * this.density); - if (this.useDepth) { - var _depthFormat = this._glDepthFormat(); - this.depthRenderbuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.depthRenderbuffer); - gl.renderbufferStorageMultisample(gl.RENDERBUFFER, Math.max(0, Math.min(this.antialiasSamples, gl.getParameter(gl.MAX_SAMPLES))), _depthFormat.internalFormat, this.width * this.density, this.height * this.density); - } - gl.bindFramebuffer(gl.FRAMEBUFFER, this.aaFramebuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.colorRenderbuffer); - if (this.useDepth) { - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, this.useStencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, this.depthRenderbuffer); - } - } - if (this.useDepth) { - this.depth = new FramebufferTexture(this, 'depthTexture'); - var depthFilter = gl.NEAREST; - this.depthP5Texture = new _main.default.Texture(this.target._renderer, this.depth, { - minFilter: depthFilter, - magFilter: depthFilter - }); - this.target._renderer.textures.set(this.depth, this.depthP5Texture); - } - this.color = new FramebufferTexture(this, 'colorTexture'); - var filter = this.textureFiltering === constants.LINEAR ? gl.LINEAR : gl.NEAREST; - this.colorP5Texture = new _main.default.Texture(this.target._renderer, this.color, { - minFilter: filter, - magFilter: filter - }); - this.target._renderer.textures.set(this.color, this.colorP5Texture); - gl.bindTexture(gl.TEXTURE_2D, prevBoundTexture); - gl.bindFramebuffer(gl.FRAMEBUFFER, prevBoundFramebuffer); - } /** - * To create a WebGL texture, one needs to supply three pieces of information: - * the type (the data type each channel will be stored as, e.g. int or float), - * the format (the color channels that will each be stored in the previously - * specified type, e.g. rgb or rgba), and the internal format (the specifics - * of how data for each channel, in the aforementioned type, will be packed - * together, such as how many bits to use, e.g. RGBA32F or RGB565.) - * - * The format and channels asked for by the user hint at what these values - * need to be, and the WebGL version affects what options are avaiable. - * This method returns the values for these three properties, given the - * framebuffer's settings. - * - * @private - */ - - }, - { - key: '_glColorFormat', - value: function _glColorFormat() { - var type, - format, - internalFormat; - var gl = this.gl; - if (this.format === constants.FLOAT) { - type = gl.FLOAT; - } else if (this.format === constants.HALF_FLOAT) { - type = this.target.webglVersion === constants.WEBGL2 ? gl.HALF_FLOAT : gl.getExtension('OES_texture_half_float').HALF_FLOAT_OES; - } else { - type = gl.UNSIGNED_BYTE; - } - if (this.channels === constants.RGBA) { - format = gl.RGBA; - } else { - format = gl.RGB; - } - if (this.target.webglVersion === constants.WEBGL2) { - var _gl$UNSIGNED_BYTE, - _table; - // https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html - var table = (_table = { - }, _defineProperty(_table, gl.FLOAT, _defineProperty({ - }, gl.RGBA, gl.RGBA32F)), _defineProperty(_table, gl.HALF_FLOAT, _defineProperty({ - }, gl.RGBA, gl.RGBA16F)), _defineProperty(_table, gl.UNSIGNED_BYTE, (_gl$UNSIGNED_BYTE = { - }, _defineProperty(_gl$UNSIGNED_BYTE, gl.RGBA, gl.RGBA8), _defineProperty(_gl$UNSIGNED_BYTE, gl.RGB, gl.RGB8), _gl$UNSIGNED_BYTE)), _table); - internalFormat = table[type][format]; - } else if (this.format === constants.HALF_FLOAT) { - internalFormat = gl.RGBA; - } else { - internalFormat = format; - } - return { - internalFormat: internalFormat, - format: format, - type: type - }; - } /** - * To create a WebGL texture, one needs to supply three pieces of information: - * the type (the data type each channel will be stored as, e.g. int or float), - * the format (the color channels that will each be stored in the previously - * specified type, e.g. rgb or rgba), and the internal format (the specifics - * of how data for each channel, in the aforementioned type, will be packed - * together, such as how many bits to use, e.g. RGBA32F or RGB565.) - * - * This method takes into account the settings asked for by the user and - * returns values for these three properties that can be used for the - * texture storing depth information. - * - * @private - */ - - }, - { - key: '_glDepthFormat', - value: function _glDepthFormat() { - var type, - format, - internalFormat; - var gl = this.gl; - if (this.useStencil) { - if (this.depthFormat === constants.FLOAT) { - type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; - } else if (this.target.webglVersion === constants.WEBGL2) { - type = gl.UNSIGNED_INT_24_8; - } else { - type = gl.getExtension('WEBGL_depth_texture').UNSIGNED_INT_24_8_WEBGL; - } - } else { - if (this.depthFormat === constants.FLOAT) { - type = gl.FLOAT; - } else { - type = gl.UNSIGNED_INT; - } - } - if (this.useStencil) { - format = gl.DEPTH_STENCIL; - } else { - format = gl.DEPTH_COMPONENT; - } - if (this.useStencil) { - if (this.depthFormat === constants.FLOAT) { - internalFormat = gl.DEPTH32F_STENCIL8; - } else if (this.target.webglVersion === constants.WEBGL2) { - internalFormat = gl.DEPTH24_STENCIL8; - } else { - internalFormat = gl.DEPTH_STENCIL; - } - } else if (this.target.webglVersion === constants.WEBGL2) { - if (this.depthFormat === constants.FLOAT) { - internalFormat = gl.DEPTH_COMPONENT32F; - } else { - internalFormat = gl.DEPTH_COMPONENT24; - } - } else { - internalFormat = gl.DEPTH_COMPONENT; - } - return { - internalFormat: internalFormat, - format: format, - type: type - }; - } /** - * A method that will be called when recreating textures. If the framebuffer - * is auto-sized, it will update its width, height, and density properties. - * - * @private - */ - - }, - { - key: '_updateSize', - value: function _updateSize() { - if (this.autoSized) { - this.width = this.target.width; - this.height = this.target.height; - this.density = this.target.pixelDensity(); - } - } /** - * Called when the canvas that the framebuffer is attached to resizes. If the - * framebuffer is auto-sized, it will update its textures to match the new - * size. - * - * @private - */ - - }, - { - key: '_canvasSizeChanged', - value: function _canvasSizeChanged() { - if (this.autoSized) { - this._handleResize(); - } - } /** - * Called when the size of the framebuffer has changed (either by being - * manually updated or from auto-size updates when its canvas changes size.) - * Old textures and renderbuffers will be deleted, and then recreated with the - * new size. - * - * @private - */ - - }, - { - key: '_handleResize', - value: function _handleResize() { - var oldColor = this.color; - var oldDepth = this.depth; - var oldColorRenderbuffer = this.colorRenderbuffer; - var oldDepthRenderbuffer = this.depthRenderbuffer; - this._deleteTexture(oldColor); - if (oldDepth) this._deleteTexture(oldDepth); - var gl = this.gl; - if (oldColorRenderbuffer) gl.deleteRenderbuffer(oldColorRenderbuffer); - if (oldDepthRenderbuffer) gl.deleteRenderbuffer(oldDepthRenderbuffer); - this._recreateTextures(); - this.defaultCamera._resize(); - } /** - * Creates and returns a new - * p5.FramebufferCamera to be used - * while drawing to this framebuffer. The camera will be set as the - * currently active camera. - * - * @method createCamera - * @returns {p5.Camera} A new camera - */ - - }, - { - key: 'createCamera', - value: function createCamera() { - var cam = new FramebufferCamera(this); - cam._computeCameraDefaultSettings(); - cam._setDefaultCamera(); - this.target._renderer._curCamera = cam; - return cam; - } /** - * Given a raw texture wrapper, delete its stored texture from WebGL memory, - * and remove it from p5's list of active textures. - * - * @param {p5.FramebufferTexture} texture - * @private - */ - - }, - { - key: '_deleteTexture', - value: function _deleteTexture(texture) { - var gl = this.gl; - gl.deleteTexture(texture.rawTexture()); - this.target._renderer.textures.delete(texture); - } /** - * Removes the framebuffer and frees its resources. - * - * @method remove - * - * @example - *
                - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * const useFramebuffer = (frameCount % 120) > 60; - * if (useFramebuffer && !framebuffer) { - * // Create a new framebuffer for us to use - * framebuffer = createFramebuffer(); - * } else if (!useFramebuffer && framebuffer) { - * // Free the old framebuffer's resources - * framebuffer.remove(); - * framebuffer = undefined; - * } - * - * background(255); - * if (useFramebuffer) { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * fill(255, 0, 0); - * box(30); - * framebuffer.end(); - * - * image(framebuffer, -width/2, -height/2); - * } - * } - * - *
                - * - * @alt - * A rotating red cube blinks on and off every second. - */ - - }, - { - key: 'remove', - value: function remove() { - var gl = this.gl; - this._deleteTexture(this.color); - if (this.depth) this._deleteTexture(this.depth); - gl.deleteFramebuffer(this.framebuffer); - if (this.aaFramebuffer) { - gl.deleteFramebuffer(this.aaFramebuffer); - } - if (this.depthRenderbuffer) { - gl.deleteRenderbuffer(this.depthRenderbuffer); - } - if (this.colorRenderbuffer) { - gl.deleteRenderbuffer(this.colorRenderbuffer); - } - this.target._renderer.framebuffers.delete(this); - } /** - * Begin drawing to this framebuffer. Subsequent drawing functions to the - * canvas the framebuffer is attached to will not be immediately visible, and - * will instead be drawn to the framebuffer's texture. Call - * end() when finished to make draw - * functions go right to the canvas again and to be able to read the - * contents of the framebuffer's texture. - * - * @method begin - * - * @example - *
                - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * translate(0, 10*sin(frameCount * 0.01), 0); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * fill(255, 0, 0); - * box(50); - * framebuffer.end(); - * - * background(100); - * // Draw the framebuffer to the main canvas - * image(framebuffer, -50, -50, 25, 25); - * image(framebuffer, 0, 0, 35, 35); - * } - * - *
                - * - * @alt - * A video of a floating and rotating red cube is pasted twice on the - * canvas: once in the top left, and again, larger, in the bottom right. - */ - - }, - { - key: 'begin', - value: function begin() { - this.prevFramebuffer = this.target._renderer.activeFramebuffer(); - if (this.prevFramebuffer) { - this.prevFramebuffer._beforeEnd(); - } - this.target._renderer.activeFramebuffers.push(this); - this._beforeBegin(); - this.target.push(); - // Apply the framebuffer's camera. This does almost what - // RendererGL.reset() does, but this does not try to clear any buffers; - // it only sets the camera. - this.target.setCamera(this.defaultCamera); - this.target._renderer.uMVMatrix.set(this.target._renderer._curCamera.cameraMatrix.mat4[0], this.target._renderer._curCamera.cameraMatrix.mat4[1], this.target._renderer._curCamera.cameraMatrix.mat4[2], this.target._renderer._curCamera.cameraMatrix.mat4[3], this.target._renderer._curCamera.cameraMatrix.mat4[4], this.target._renderer._curCamera.cameraMatrix.mat4[5], this.target._renderer._curCamera.cameraMatrix.mat4[6], this.target._renderer._curCamera.cameraMatrix.mat4[7], this.target._renderer._curCamera.cameraMatrix.mat4[8], this.target._renderer._curCamera.cameraMatrix.mat4[9], this.target._renderer._curCamera.cameraMatrix.mat4[10], this.target._renderer._curCamera.cameraMatrix.mat4[11], this.target._renderer._curCamera.cameraMatrix.mat4[12], this.target._renderer._curCamera.cameraMatrix.mat4[13], this.target._renderer._curCamera.cameraMatrix.mat4[14], this.target._renderer._curCamera.cameraMatrix.mat4[15]); - } /** - * When making a p5.Framebuffer active so that it may be drawn to, this method - * returns the underlying WebGL framebuffer that needs to be active to - * support this. Antialiased framebuffers first write to a multisampled - * renderbuffer, while other framebuffers can write directly to their main - * framebuffers. - * - * @method _framebufferToBind - * @private - */ - - }, - { - key: '_framebufferToBind', - value: function _framebufferToBind() { - if (this.antialias) { - // If antialiasing, draw to an antialiased renderbuffer rather - // than directly to the texture. In end() we will copy from the - // renderbuffer to the texture. - return this.aaFramebuffer; - } else { - return this.framebuffer; - } - } /** - * Ensures that the framebuffer is ready to be drawn to - * - * @method _beforeBegin - * @private - */ - - }, - { - key: '_beforeBegin', - value: function _beforeBegin() { - var gl = this.gl; - gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebufferToBind()); - this.target._renderer.viewport(this.width * this.density, this.height * this.density); - } /** - * Ensures that the framebuffer is ready to be read by other framebuffers. - * - * @method _beforeEnd - * @private - */ - - }, - { - key: '_beforeEnd', - value: function _beforeEnd() { - if (this.antialias) { - var gl = this.gl; - gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.aaFramebuffer); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.framebuffer); - var partsToCopy = [ - [gl.COLOR_BUFFER_BIT, - this.colorP5Texture.glMagFilter] - ]; - if (this.useDepth) { - partsToCopy.push([gl.DEPTH_BUFFER_BIT, - this.depthP5Texture.glMagFilter]); - } - for (var _i = 0, _partsToCopy = partsToCopy; _i < _partsToCopy.length; _i++) { - var _partsToCopy$_i = _slicedToArray(_partsToCopy[_i], 2), - flag = _partsToCopy$_i[0], - filter = _partsToCopy$_i[1]; - gl.blitFramebuffer(0, 0, this.width * this.density, this.height * this.density, 0, 0, this.width * this.density, this.height * this.density, flag, filter); - } - } - } /** - * After having previously called - * begin(), this method stops drawing - * functions from going to the framebuffer's texture, allowing them to go - * right to the canvas again. After this, one can read from the framebuffer's - * texture. - * - * @method end - */ - - }, - { - key: 'end', - value: function end() { - var gl = this.gl; - this.target.pop(); - var fbo = this.target._renderer.activeFramebuffers.pop(); - if (fbo !== this) { - throw new Error('It looks like you\'ve called end() while another Framebuffer is active.'); - } - this._beforeEnd(); - if (this.prevFramebuffer) { - this.prevFramebuffer._beforeBegin(); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - this.target._renderer.viewport(this.target._renderer._origViewport.width, this.target._renderer._origViewport.height); - } - this.target._renderer._applyStencilTestIfClipping(); - } /** - * Run a function while drawing to the framebuffer rather than to its canvas. - * This is equivalent to calling `framebuffer.begin()`, running the function, - * and then calling `framebuffer.end()`, but ensures that one never - * accidentally forgets `begin` or `end`. - * - * @method draw - * @param {Function} callback A function to run that draws to the canvas. The - * function will immediately be run, but it will draw to the framebuffer - * instead of the canvas. - * - * @example - *
                - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.draw(function() { - * background(255); - * translate(0, 10*sin(frameCount * 0.01), 0); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * fill(255, 0, 0); - * box(50); - * }); - * - * background(100); - * // Draw the framebuffer to the main canvas - * image(framebuffer, -50, -50, 25, 25); - * image(framebuffer, 0, 0, 35, 35); - * } - * - *
                - * - * @alt - * A video of a floating and rotating red cube is pasted twice on the - * canvas: once in the top left, and again, larger, in the bottom right. - */ - - }, - { - key: 'draw', - value: function draw(callback) { - this.begin(); - callback(); - this.end(); - } /** - * Call this befpre updating pixels - * and calling updatePixels - * to replace the content of the framebuffer with the data in the pixels - * array. - */ - - }, - { - key: 'loadPixels', - value: function loadPixels() { - var gl = this.gl; - var prevFramebuffer = this.target._renderer.activeFramebuffer(); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); - var colorFormat = this._glColorFormat(); - this.pixels = (0, _p2.readPixelsWebGL) (this.pixels, gl, this.framebuffer, 0, 0, this.width * this.density, this.height * this.density, colorFormat.format, colorFormat.type); - if (prevFramebuffer) { - gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer._framebufferToBind()); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - } - } /** - * Get a region of pixels from the canvas in the form of a - * p5.Image, or a single pixel as an array of - * numbers. - * - * Returns an array of [R,G,B,A] values for any pixel or grabs a section of - * an image. If the Framebuffer has been set up to not store alpha values, then - * only [R,G,B] will be returned. If no parameters are specified, the entire - * image is returned. - * Use the x and y parameters to get the value of one pixel. Get a section of - * the display window by specifying additional w and h parameters. When - * getting an image, the x and y parameters define the coordinates for the - * upper-left corner of the image, regardless of the current imageMode(). - * - * @method get - * @param {Number} x x-coordinate of the pixel - * @param {Number} y y-coordinate of the pixel - * @param {Number} w width of the section to be returned - * @param {Number} h height of the section to be returned - * @return {p5.Image} the rectangle p5.Image - */ - /** - * @method get - * @return {p5.Image} the whole p5.Image - */ - /** - * @method get - * @param {Number} x - * @param {Number} y - * @return {Number[]} color of pixel at x,y in array format [R, G, B, A] - */ - - }, - { - key: 'get', - value: function get(x, y, w, h) { - _main.default._validateParameters('p5.Framebuffer.get', arguments); - var colorFormat = this._glColorFormat(); - if (x === undefined && y === undefined) { - x = 0; - y = 0; - w = this.width; - h = this.height; - } else if (w === undefined && h === undefined) { - if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - console.warn('The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped.'); - x = this.target.constrain(x, 0, this.width - 1); - y = this.target.constrain(y, 0, this.height - 1); - } - return (0, _p2.readPixelWebGL) (this.gl, this.framebuffer, x * this.density, y * this.density, colorFormat.format, colorFormat.type); - } - x = this.target.constrain(x, 0, this.width - 1); - y = this.target.constrain(y, 0, this.height - 1); - w = this.target.constrain(w, 1, this.width - x); - h = this.target.constrain(h, 1, this.height - y); - var rawData = (0, _p2.readPixelsWebGL) (undefined, this.gl, this.framebuffer, x * this.density, y * this.density, w * this.density, h * this.density, colorFormat.format, colorFormat.type); - // Framebuffer data might be either a Uint8Array or Float32Array - // depending on its format, and it may or may not have an alpha channel. - // To turn it into an image, we have to normalize the data into a - // Uint8ClampedArray with alpha. - var fullData = new Uint8ClampedArray(w * h * this.density * this.density * 4); - // Default channels that aren't in the framebuffer (e.g. alpha, if the - // framebuffer is in RGB mode instead of RGBA) to 255 - fullData.fill(255); - var channels = colorFormat.type === this.gl.RGB ? 3 : 4; - for (var _y = 0; _y < h * this.density; _y++) { - for (var _x = 0; _x < w * this.density; _x++) { - for (var channel = 0; channel < 4; channel++) { - var idx = (_y * w * this.density + _x) * 4 + channel; - if (channel < channels) { - // Find the index of this pixel in `rawData`, which might have a - // different number of channels - var rawDataIdx = channels === 4 ? idx : (_y * w * this.density + _x) * channels + channel; - fullData[idx] = rawData[rawDataIdx]; - } - } - } - } // Create an image from the data - - var region = new _main.default.Image(w * this.density, h * this.density); - region.imageData = region.canvas.getContext('2d').createImageData(region.width, region.height); - region.imageData.data.set(fullData); - region.pixels = region.imageData.data; - region.updatePixels(); - if (this.density !== 1) { - // TODO: support get() at a pixel density > 1 - region.resize(w, h); - } - return region; - } /** - * Call this after initially calling - * loadPixels() and updating pixels - * to replace the content of the framebuffer with the data in the pixels - * array. - * - * This will also clear the depth buffer so that any future drawing done - * afterwards will go on top. - * - * @example - *
                - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * } - * function draw() { - * noStroke(); - * lights(); - * - * // Draw a sphere to the framebuffer - * framebuffer.begin(); - * background(0); - * sphere(25); - * framebuffer.end(); - * - * // Load its pixels and draw a gradient over the lower half of the canvas - * framebuffer.loadPixels(); - * for (let y = height/2; y < height; y++) { - * for (let x = 0; x < width; x++) { - * const idx = (y * width + x) * 4; - * framebuffer.pixels[idx] = (x / width) * 255; - * framebuffer.pixels[idx + 1] = (y / height) * 255; - * framebuffer.pixels[idx + 2] = 255; - * framebuffer.pixels[idx + 3] = 255; - * } - * } - * framebuffer.updatePixels(); - * - * // Draw a cube on top of the pixels we just wrote - * framebuffer.begin(); - * push(); - * translate(20, 20); - * rotateX(0.5); - * rotateY(0.5); - * box(20); - * pop(); - * framebuffer.end(); - * - * image(framebuffer, -width/2, -height/2); - * noLoop(); - * } - * - *
                - * - * @alt - * A sphere partly occluded by a gradient from cyan to white to magenta on - * the lower half of the canvas, with a 3D cube drawn on top of that in the - * lower right corner. - */ - - }, - { - key: 'updatePixels', - value: function updatePixels() { - var gl = this.gl; - this.colorP5Texture.bindTexture(); - var colorFormat = this._glColorFormat(); - var channels = colorFormat.format === gl.RGBA ? 4 : 3; - var len = this.width * this.height * this.density * this.density * channels; - var TypedArrayClass = colorFormat.type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; - if (!(this.pixels instanceof TypedArrayClass) || this.pixels.length !== len) { - throw new Error('The pixels array has not been set correctly. Please call loadPixels() before updatePixels().'); - } - gl.texImage2D(gl.TEXTURE_2D, 0, colorFormat.internalFormat, this.width * this.density, this.height * this.density, 0, colorFormat.format, colorFormat.type, this.pixels); - this.colorP5Texture.unbindTexture(); - var prevFramebuffer = this.target._renderer.activeFramebuffer(); - if (this.antialias) { - // We need to make sure the antialiased framebuffer also has the updated - // pixels so that if more is drawn to it, it goes on top of the updated - // pixels instead of replacing them. - // We can't blit the framebuffer to the multisampled antialias - // framebuffer to leave both in the same state, so instead we have - // to use image() to put the framebuffer texture onto the antialiased - // framebuffer. - this.begin(); - this.target.push(); - this.target.imageMode(this.target.CENTER); - this.target.resetMatrix(); - this.target.noStroke(); - this.target.clear(); - this.target.image(this, 0, 0); - this.target.pop(); - if (this.useDepth) { - gl.clearDepth(1); - gl.clear(gl.DEPTH_BUFFER_BIT); - } - this.end(); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); - if (this.useDepth) { - gl.clearDepth(1); - gl.clear(gl.DEPTH_BUFFER_BIT); - } - if (prevFramebuffer) { - gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer._framebufferToBind()); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - } - } - } - } - ]); - return Framebuffer; - }(); - /** - * A texture with the color information of the framebuffer. Pass this (or the - * framebuffer itself) to texture() to draw it to - * the canvas, or pass it to a shader with - * setUniform() to read its data. - * - * Since Framebuffers are controlled by WebGL, their y coordinates are stored - * flipped compared to images and videos. When texturing with a framebuffer - * texture, you may want to flip vertically, e.g. with - * `plane(framebuffer.width, -framebuffer.height)`. - * - * @property {p5.FramebufferTexture} color - * @for p5.Framebuffer - * - * @example - *
                - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * normalMaterial(); - * sphere(20); - * framebuffer.end(); - * - * // Draw the framebuffer to the main canvas - * image(framebuffer.color, -width/2, -height/2); - * } - * - *
                - * - * @alt - * A red, green, and blue sphere in the middle of the canvas - */ - /** - * A texture with the depth information of the framebuffer. If the framebuffer - * was created with `{ depth: false }` in its settings, then this property will - * be undefined. Pass this to texture() to draw it to - * the canvas, or pass it to a shader with - * setUniform() to read its data. - * - * Since Framebuffers are controlled by WebGL, their y coordinates are stored - * flipped compared to images and videos. When texturing with a framebuffer - * texture, you may want to flip vertically, e.g. with - * `plane(framebuffer.width, -framebuffer.height)`. - * - * @property {p5.FramebufferTexture|undefined} depth - * @for p5.Framebuffer - * - * @example - *
                - * - * let framebuffer; - * let depthShader; - * - * const vert = ` - * precision highp float; - * attribute vec3 aPosition; - * attribute vec2 aTexCoord; - * uniform mat4 uModelViewMatrix; - * uniform mat4 uProjectionMatrix; - * varying vec2 vTexCoord; - * void main() { - * vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0); - * gl_Position = uProjectionMatrix * viewModelPosition; - * vTexCoord = aTexCoord; - * } - * `; - * - * const frag = ` - * precision highp float; - * varying vec2 vTexCoord; - * uniform sampler2D depth; - * void main() { - * float depthVal = texture2D(depth, vTexCoord).r; - * gl_FragColor = mix( - * vec4(1., 1., 0., 1.), // yellow - * vec4(0., 0., 1., 1.), // blue - * pow(depthVal, 6.) - * ); - * } - * `; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * depthShader = createShader(vert, frag); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * rotateX(frameCount * 0.01); - * box(20, 20, 100); - * framebuffer.end(); - * - * push(); - * shader(depthShader); - * depthShader.setUniform('depth', framebuffer.depth); - * plane(framebuffer.width, framebuffer.height); - * pop(); - * } - * - *
                - * - * @alt - * A video of a rectangular prism rotating, with parts closest to the camera - * appearing yellow and colors getting progressively more blue the farther - * from the camera they go - */ - _main.default.Framebuffer = Framebuffer; - var _default = Framebuffer; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.RendererGL': 355, - './p5.Texture': 357, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.reflect.get': 203, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.float32-array': 229, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/es.typed-array.uint8-clamped-array': 253, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 350: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.sub'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.for-each'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.sub'); - _dereq_('core-js/modules/web.dom-collections.for-each'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Shape - * @submodule 3D Primitives - * @for p5 - * @requires core - * @requires p5.Geometry - */ - //some of the functions are adjusted from Three.js(http://threejs.org) - /** - * p5 Geometry class - * @class p5.Geometry - * @constructor - * @param {Integer} [detailX] number of vertices along the x-axis. - * @param {Integer} [detailY] number of vertices along the y-axis. - * @param {function} [callback] function to call upon object instantiation. - */ - - _main.default.Geometry = /*#__PURE__*/ function () { - function Geometry(detailX, detailY, callback) { - _classCallCheck(this, Geometry); - //an array containing every vertex - //@type [p5.Vector] - this.vertices = [ - ]; - //an array containing every vertex for stroke drawing - this.lineVertices = new _main.default.DataArray(); - // The tangents going into or out of a vertex on a line. Along a straight - // line segment, both should be equal. At an endpoint, one or the other - // will not exist and will be all 0. In joins between line segments, they - // may be different, as they will be the tangents on either side of the join. - this.lineTangentsIn = new _main.default.DataArray(); - this.lineTangentsOut = new _main.default.DataArray(); - // When drawing lines with thickness, entries in this buffer represent which - // side of the centerline the vertex will be placed. The sign of the number - // will represent the side of the centerline, and the absolute value will be - // used as an enum to determine which part of the cap or join each vertex - // represents. See the doc comments for _addCap and _addJoin for diagrams. - this.lineSides = new _main.default.DataArray(); - //an array containing 1 normal per vertex - //@type [p5.Vector] - //[p5.Vector, p5.Vector, p5.Vector,p5.Vector, p5.Vector, p5.Vector,...] - this.vertexNormals = [ - ]; - //an array containing each three vertex indices that form a face - //[[0, 1, 2], [2, 1, 3], ...] - this.faces = [ - ]; - //a 2D array containing uvs for every vertex - //[[0.0,0.0],[1.0,0.0], ...] - this.uvs = [ - ]; - // a 2D array containing edge connectivity pattern for create line vertices - //based on faces for most objects; - this.edges = [ - ]; - this.vertexColors = [ - ]; - // One color per vertex representing the stroke color at that vertex - this.vertexStrokeColors = [ - ]; - // One color per line vertex, generated automatically based on - // vertexStrokeColors in _edgesToVertices() - this.lineVertexColors = new _main.default.DataArray(); - this.detailX = detailX !== undefined ? detailX : 1; - this.detailY = detailY !== undefined ? detailY : 1; - this.dirtyFlags = { - }; - if (callback instanceof Function) { - callback.call(this); - } - return this; // TODO: is this a constructor? - } - _createClass(Geometry, [ - { - key: 'reset', - value: function reset() { - this.lineVertices.clear(); - this.lineTangentsIn.clear(); - this.lineTangentsOut.clear(); - this.lineSides.clear(); - this.vertices.length = 0; - this.edges.length = 0; - this.vertexColors.length = 0; - this.vertexStrokeColors.length = 0; - this.lineVertexColors.clear(); - this.vertexNormals.length = 0; - this.uvs.length = 0; - this.dirtyFlags = { - }; - } /** - * Removes the internal colors of p5.Geometry. - * Using `clearColors()`, you can use `fill()` to supply new colors before drawing each shape. - * If `clearColors()` is not used, the shapes will use their internal colors by ignoring `fill()`. - * - * @method clearColors - * - * @example - *
                - * - * let shape01; - * let shape02; - * let points = []; - * - * function setup() { - * createCanvas(600, 600, WEBGL); - * points.push(new p5.Vector(-1, -1, 0), new p5.Vector(-1, 1, 0), - * new p5.Vector(1, -1, 0), new p5.Vector(-1, -1, 0)); - * buildShape01(); - * buildShape02(); - * } - * function draw() { - * background(0); - * fill('pink'); // shape01 retains its internal blue color, so it won't turn pink. - * model(shape01); - * fill('yellow'); // Now, shape02 is yellow. - * model(shape02); - * } - * - * function buildShape01() { - * beginGeometry(); - * fill('blue'); // shape01's color is blue because its internal colors remain. - * beginShape(); - * for (let vec of points) vertex(vec.x * 100, vec.y * 100, vec.z * 100); - * endShape(CLOSE); - * shape01 = endGeometry(); - * } - * - * function buildShape02() { - * beginGeometry(); - * fill('red'); // shape02.clearColors() removes its internal colors. Now, shape02 is red. - * beginShape(); - * for (let vec of points) vertex(vec.x * 200, vec.y * 200, vec.z * 200); - * endShape(CLOSE); - * shape02 = endGeometry(); - * shape02.clearColors(); // Resets shape02's colors. - * } - * - *
                - */ - - }, - { - key: 'clearColors', - value: function clearColors() { - this.vertexColors = [ - ]; - return this; - } /** - * computes faces for geometry objects based on the vertices. - * @method computeFaces - * @chainable - */ - - }, - { - key: 'computeFaces', - value: function computeFaces() { - this.faces.length = 0; - var sliceCount = this.detailX + 1; - var a, - b, - c, - d; - for (var i = 0; i < this.detailY; i++) { - for (var j = 0; j < this.detailX; j++) { - a = i * sliceCount + j; // + offset; - b = i * sliceCount + j + 1; // + offset; - c = (i + 1) * sliceCount + j + 1; // + offset; - d = (i + 1) * sliceCount + j; // + offset; - this.faces.push([a, - b, - d]); - this.faces.push([d, - b, - c]); - } - } - return this; - } - }, - { - key: '_getFaceNormal', - value: function _getFaceNormal(faceId) { - //This assumes that vA->vB->vC is a counter-clockwise ordering - var face = this.faces[faceId]; - var vA = this.vertices[face[0]]; - var vB = this.vertices[face[1]]; - var vC = this.vertices[face[2]]; - var ab = _main.default.Vector.sub(vB, vA); - var ac = _main.default.Vector.sub(vC, vA); - var n = _main.default.Vector.cross(ab, ac); - var ln = _main.default.Vector.mag(n); - var sinAlpha = ln / (_main.default.Vector.mag(ab) * _main.default.Vector.mag(ac)); - if (sinAlpha === 0 || isNaN(sinAlpha)) { - console.warn('p5.Geometry.prototype._getFaceNormal:', 'face has colinear sides or a repeated vertex'); - return n; - } - if (sinAlpha > 1) sinAlpha = 1; // handle float rounding error - return n.mult(Math.asin(sinAlpha) / ln); - } /** - * This function calculates normals for each face, where each vertex's normal is the average of the normals of all faces it's connected to. - * i.e computes smooth normals per vertex as an average of each face. - * - * When using `FLAT` shading, vertices are disconnected/duplicated i.e each face has its own copy of vertices. - * When using `SMOOTH` shading, vertices are connected/deduplicated i.e each face has its vertices shared with other faces. - * - * Options can include: - * - `roundToPrecision`: Precision value for rounding computations. Defaults to 3. - * - * @method computeNormals - * @param {String} [shadingType] shading type (`FLAT` for flat shading or `SMOOTH` for smooth shading) for buildGeometry() outputs. Defaults to `FLAT`. - * @param {Object} [options] An optional object with configuration. - * @chainable - * - * @example - *
                - * - * let helix; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * helix = buildGeometry(() => { - * beginShape(); - * - * for (let i = 0; i < TWO_PI * 3; i += 0.6) { - * let radius = 20; - * let x = cos(i) * radius; - * let y = sin(i) * radius; - * let z = map(i, 0, TWO_PI * 3, -30, 30); - * vertex(x, y, z); - * } - * endShape(); - * }); - * helix.computeNormals(); - * } - * function draw() { - * background(255); - * stroke(0); - * fill(150, 200, 250); - * lights(); - * rotateX(PI*0.2); - * orbitControl(); - * model(helix); - * } - * - *
                - * - * @alt - * A 3D helix using the computeNormals() function by default uses `FLAT` to create a flat shading effect on the helix. - * - * @example - *
                - * - * let star; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * star = buildGeometry(() => { - * beginShape(); - * for (let i = 0; i < TWO_PI; i += PI / 5) { - * let outerRadius = 60; - * let innerRadius = 30; - * let xOuter = cos(i) * outerRadius; - * let yOuter = sin(i) * outerRadius; - * let zOuter = random(-20, 20); - * vertex(xOuter, yOuter, zOuter); - * - * let nextI = i + PI / 5 / 2; - * let xInner = cos(nextI) * innerRadius; - * let yInner = sin(nextI) * innerRadius; - * let zInner = random(-20, 20); - * vertex(xInner, yInner, zInner); - * } - * endShape(CLOSE); - * }); - * star.computeNormals(SMOOTH); - * } - * function draw() { - * background(255); - * stroke(0); - * fill(150, 200, 250); - * lights(); - * rotateX(PI*0.2); - * orbitControl(); - * model(star); - * } - * - *
                - * - * @alt - * A star-like geometry, here the computeNormals(SMOOTH) is applied for a smooth shading effect. - * This helps to avoid the faceted appearance that can occur with flat shading. - */ - - }, - { - key: 'computeNormals', - value: function computeNormals() { - var _this = this; - var shadingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : constants.FLAT; - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - }, - _ref$roundToPrecision = _ref.roundToPrecision, - roundToPrecision = _ref$roundToPrecision === void 0 ? 3 : _ref$roundToPrecision; - var vertexNormals = this.vertexNormals; - var vertices = this.vertices; - var faces = this.faces; - var iv; - if (shadingType === constants.SMOOTH) { - var vertexIndices = { - }; - var uniqueVertices = [ - ]; - var power = Math.pow(10, roundToPrecision); - var rounded = function rounded(val) { - return Math.round(val * power) / power; - }; - var getKey = function getKey(vert) { - return ''.concat(rounded(vert.x), ',').concat(rounded(vert.y), ',').concat(rounded(vert.z)); - }; - // loop through each vertex and add uniqueVertices - for (var i = 0; i < vertices.length; i++) { - var vertex = vertices[i]; - var key = getKey(vertex); - if (vertexIndices[key] === undefined) { - vertexIndices[key] = uniqueVertices.length; - uniqueVertices.push(vertex); - } - } // update face indices to use the deduplicated vertex indices - - faces.forEach(function (face) { - for (var fv = 0; fv < 3; ++fv) { - var originalVertexIndex = face[fv]; - var originalVertex = vertices[originalVertexIndex]; - var _key = getKey(originalVertex); - face[fv] = vertexIndices[_key]; - } - }); - // update edge indices to use the deduplicated vertex indices - this.edges.forEach(function (edge) { - for (var ev = 0; ev < 2; ++ev) { - var originalVertexIndex = edge[ev]; - var originalVertex = vertices[originalVertexIndex]; - var _key2 = getKey(originalVertex); - edge[ev] = vertexIndices[_key2]; - } - }); - // update the deduplicated vertices - this.vertices = vertices = uniqueVertices; - } // initialize the vertexNormals array with empty vectors - - vertexNormals.length = 0; - for (iv = 0; iv < vertices.length; ++iv) { - vertexNormals.push(new _main.default.Vector()); - } // loop through all the faces adding its normal to the normal - // of each of its vertices - - faces.forEach(function (face, f) { - var faceNormal = _this._getFaceNormal(f); - // all three vertices get the normal added - for (var fv = 0; fv < 3; ++fv) { - var vertexIndex = face[fv]; - vertexNormals[vertexIndex].add(faceNormal); - } - }); - // normalize the normals - for (iv = 0; iv < vertices.length; ++iv) { - vertexNormals[iv].normalize(); - } - return this; - } /** - * Averages the vertex normals. Used in curved - * surfaces - * @method averageNormals - * @chainable - */ - - }, - { - key: 'averageNormals', - value: function averageNormals() { - for (var i = 0; i <= this.detailY; i++) { - var offset = this.detailX + 1; - var temp = _main.default.Vector.add(this.vertexNormals[i * offset], this.vertexNormals[i * offset + this.detailX]); - temp = _main.default.Vector.div(temp, 2); - this.vertexNormals[i * offset] = temp; - this.vertexNormals[i * offset + this.detailX] = temp; - } - return this; - } /** - * Averages pole normals. Used in spherical primitives - * @method averagePoleNormals - * @chainable - */ - - }, - { - key: 'averagePoleNormals', - value: function averagePoleNormals() { - //average the north pole - var sum = new _main.default.Vector(0, 0, 0); - for (var i = 0; i < this.detailX; i++) { - sum.add(this.vertexNormals[i]); - } - sum = _main.default.Vector.div(sum, this.detailX); - for (var _i = 0; _i < this.detailX; _i++) { - this.vertexNormals[_i] = sum; - } //average the south pole - - sum = new _main.default.Vector(0, 0, 0); - for (var _i2 = this.vertices.length - 1; _i2 > this.vertices.length - 1 - this.detailX; _i2--) { - sum.add(this.vertexNormals[_i2]); - } - sum = _main.default.Vector.div(sum, this.detailX); - for (var _i3 = this.vertices.length - 1; _i3 > this.vertices.length - 1 - this.detailX; _i3--) { - this.vertexNormals[_i3] = sum; - } - return this; - } /** - * Create a 2D array for establishing stroke connections - * @private - * @chainable - */ - - }, - { - key: '_makeTriangleEdges', - value: function _makeTriangleEdges() { - this.edges.length = 0; - for (var j = 0; j < this.faces.length; j++) { - this.edges.push([this.faces[j][0], - this.faces[j][1]]); - this.edges.push([this.faces[j][1], - this.faces[j][2]]); - this.edges.push([this.faces[j][2], - this.faces[j][0]]); - } - return this; - } /** - * Converts each line segment into the vertices and vertex attributes needed - * to turn the line into a polygon on screen. This will include: - * - Two triangles line segment to create a rectangle - * - Two triangles per endpoint to create a stroke cap rectangle. A fragment - * shader is responsible for displaying the appropriate cap style within - * that rectangle. - * - Four triangles per join between adjacent line segments, creating a quad on - * either side of the join, perpendicular to the lines. A vertex shader will - * discard the quad in the "elbow" of the join, and a fragment shader will - * display the appropriate join style within the remaining quad. - * - * @private - * @chainable - */ - - }, - { - key: '_edgesToVertices', - value: function _edgesToVertices() { - this.lineVertices.clear(); - this.lineTangentsIn.clear(); - this.lineTangentsOut.clear(); - this.lineSides.clear(); - var potentialCaps = new Map(); - var connected = new Set(); - var lastValidDir; - for (var i = 0; i < this.edges.length; i++) { - var prevEdge = this.edges[i - 1]; - var currEdge = this.edges[i]; - var begin = this.vertices[currEdge[0]]; - var end = this.vertices[currEdge[1]]; - var fromColor = this.vertexStrokeColors.length > 0 ? this.vertexStrokeColors.slice(currEdge[0] * 4, (currEdge[0] + 1) * 4) : [ - 0, - 0, - 0, - 0 - ]; - var toColor = this.vertexStrokeColors.length > 0 ? this.vertexStrokeColors.slice(currEdge[1] * 4, (currEdge[1] + 1) * 4) : [ - 0, - 0, - 0, - 0 - ]; - var dir = end.copy().sub(begin).normalize(); - var dirOK = dir.magSq() > 0; - if (dirOK) { - this._addSegment(begin, end, fromColor, toColor, dir); - } - if (i > 0 && prevEdge[1] === currEdge[0]) { - if (!connected.has(currEdge[0])) { - connected.add(currEdge[0]); - potentialCaps.delete(currEdge[0]); - // Add a join if this segment shares a vertex with the previous. Skip - // actually adding join vertices if either the previous segment or this - // one has a length of 0. - // - // Don't add a join if the tangents point in the same direction, which - // would mean the edges line up exactly, and there is no need for a join. - if (lastValidDir && dirOK && dir.dot(lastValidDir) < 1 - 1e-8) { - this._addJoin(begin, lastValidDir, dir, fromColor); - } - } - } else { - // Start a new line - if (dirOK && !connected.has(currEdge[0])) { - var existingCap = potentialCaps.get(currEdge[0]); - if (existingCap) { - this._addJoin(begin, existingCap.dir, dir, fromColor); - potentialCaps.delete(currEdge[0]); - connected.add(currEdge[0]); - } else { - potentialCaps.set(currEdge[0], { - point: begin, - dir: dir.copy().mult( - 1), - color: fromColor - }); - } - } - if (lastValidDir && !connected.has(prevEdge[1])) { - var _existingCap = potentialCaps.get(prevEdge[1]); - if (_existingCap) { - this._addJoin(this.vertices[prevEdge[1]], lastValidDir, _existingCap.dir.copy().mult( - 1), fromColor); - potentialCaps.delete(prevEdge[1]); - connected.add(prevEdge[1]); - } else { - // Close off the last segment with a cap - potentialCaps.set(prevEdge[1], { - point: this.vertices[prevEdge[1]], - dir: lastValidDir, - color: fromColor - }); - } - lastValidDir = undefined; - } - } - if (i === this.edges.length - 1 && !connected.has(currEdge[1])) { - var _existingCap2 = potentialCaps.get(currEdge[1]); - if (_existingCap2) { - this._addJoin(end, dir, _existingCap2.dir.copy().mult( - 1), toColor); - potentialCaps.delete(currEdge[1]); - connected.add(currEdge[1]); - } else { - potentialCaps.set(currEdge[1], { - point: end, - dir: dir, - color: toColor - }); - } - } - if (dirOK) { - lastValidDir = dir; - } - } - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = potentialCaps.values() [Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _step$value = _step.value, - point = _step$value.point, - _dir = _step$value.dir, - color = _step$value.color; - this._addCap(point, _dir, color); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return this; - } /** - * Adds the vertices and vertex attributes for two triangles making a rectangle - * for a straight line segment. A vertex shader is responsible for picking - * proper coordinates on the screen given the centerline positions, the tangent, - * and the side of the centerline each vertex belongs to. Sides follow the - * following scheme: - * - * -1 -1 - * o-------------o - * | | - * o-------------o - * 1 1 - * - * @private - * @chainable - */ - - }, - { - key: '_addSegment', - value: function _addSegment(begin, end, fromColor, toColor, dir) { - var _this$lineVertices, - _this$lineVertexColor; - var a = begin.array(); - var b = end.array(); - var dirArr = dir.array(); - this.lineSides.push(1, 1, - 1, 1, - 1, - 1); - for (var _i4 = 0, _arr = [ - this.lineTangentsIn, - this.lineTangentsOut - ]; _i4 < _arr.length; _i4++) { - var tangents = _arr[_i4]; - for (var i = 0; i < 6; i++) { - tangents.push.apply(tangents, _toConsumableArray(dirArr)); - } - }(_this$lineVertices = this.lineVertices).push.apply(_this$lineVertices, _toConsumableArray(a).concat(_toConsumableArray(b), _toConsumableArray(a), _toConsumableArray(b), _toConsumableArray(b), _toConsumableArray(a))); - (_this$lineVertexColor = this.lineVertexColors).push.apply(_this$lineVertexColor, _toConsumableArray(fromColor).concat(_toConsumableArray(toColor), _toConsumableArray(fromColor), _toConsumableArray(toColor), _toConsumableArray(toColor), _toConsumableArray(fromColor))); - return this; - } /** - * Adds the vertices and vertex attributes for two triangles representing the - * stroke cap of a line. A fragment shader is responsible for displaying the - * appropriate cap style within the rectangle they make. - * - * The lineSides buffer will include the following values for the points on - * the cap rectangle: - * - * -1 -2 - * -----------o---o - * | | - * -----------o---o - * 1 2 - * @private - * @chainable - */ + if (typeof exports === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + } + g.p5 = f(); + } +})(function () { + var define, module, exports; + return (function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = "function" == typeof require && require; + if (!f && c) return c(i, !0); + if (u) return u(i, !0); + var a = new Error("Cannot find module '" + i + "'"); + throw ((a.code = "MODULE_NOT_FOUND"), a); + } + var p = (n[i] = { + exports: {}, + }); + e[i][0].call( + p.exports, + function (r) { + var n = e[i][1][r]; + return o(n || r); + }, + p, + p.exports, + r, + e, + n, + t, + ); + } + return n[i].exports; + } + for ( + var u = "function" == typeof require && require, i = 0; + i < t.length; + i++ + ) + o(t[i]); + return o; + } + return r; + })()( + { + 1: [ + function (_dereq_, module, exports) { + module.exports = { + p5: { + describe: { + name: "describe", + params: [ + { + name: "text", + description: "

                description of the canvas.

                \n", + type: "String", + }, + { + name: "display", + description: "

                either LABEL or FALLBACK.

                \n", + type: "Constant", + optional: true, + }, + ], + class: "p5", + module: "Environment", + }, + describeElement: { + name: "describeElement", + params: [ + { + name: "name", + description: "

                name of the element.

                \n", + type: "String", + }, + { + name: "text", + description: "

                description of the element.

                \n", + type: "String", + }, + { + name: "display", + description: "

                either LABEL or FALLBACK.

                \n", + type: "Constant", + optional: true, + }, + ], + class: "p5", + module: "Environment", + }, + textOutput: { + name: "textOutput", + params: [ + { + name: "display", + description: "

                either FALLBACK or LABEL.

                \n", + type: "Constant", + optional: true, + }, + ], + class: "p5", + module: "Environment", + }, + gridOutput: { + name: "gridOutput", + params: [ + { + name: "display", + description: "

                either FALLBACK or LABEL.

                \n", + type: "Constant", + optional: true, + }, + ], + class: "p5", + module: "Environment", + }, + alpha: { + name: "alpha", + params: [ + { + name: "color", + description: + '

                p5.Color object, array of\n color components, or CSS color string.

                \n', + type: "p5.Color|Number[]|String", + }, + ], + class: "p5", + module: "Color", + }, + blue: { + name: "blue", + params: [ + { + name: "color", + description: + '

                p5.Color object, array of\n color components, or CSS color string.

                \n', + type: "p5.Color|Number[]|String", + }, + ], + class: "p5", + module: "Color", + }, + brightness: { + name: "brightness", + params: [ + { + name: "color", + description: + '

                p5.Color object, array of\n color components, or CSS color string.

                \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: true, + }, + ], + }, + { + 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: true, + }, + ], + }, + { + 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, array of\n color components, or CSS color string.

                \n', + type: "p5.Color|Number[]|String", + }, + ], + class: "p5", + module: "Color", + }, + hue: { + name: "hue", + params: [ + { + name: "color", + description: + '

                p5.Color object, array of\n color components, or CSS color string.

                \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, array of\n color components, or CSS color string.

                \n', + type: "p5.Color|Number[]|String", + }, + ], + class: "p5", + module: "Color", + }, + red: { + name: "red", + params: [ + { + name: "color", + description: + '

                p5.Color object, array of\n color components, or CSS color string.

                \n', + type: "p5.Color|Number[]|String", + }, + ], + class: "p5", + module: "Color", + }, + saturation: { + name: "saturation", + params: [ + { + name: "color", + description: + '

                p5.Color object, array of\n color components, or CSS color string.

                \n', + type: "p5.Color|Number[]|String", + }, + ], + class: "p5", + module: "Color", + }, + beginClip: { + name: "beginClip", + params: [ + { + name: "options", + description: "

                An object containing clip settings.

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5", + module: "Color", + }, + endClip: { + name: "endClip", + class: "p5", + module: "Color", + }, + clip: { + name: "clip", + params: [ + { + name: "callback", + description: + "

                A function that draws the mask shape.

                \n", + type: "Function", + }, + { + name: "options", + description: "

                An object containing clip settings.

                \n", + type: "Object", + optional: true, + }, + ], + 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: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "gray", + description: + "

                specifies a value between white and black.

                \n", + type: "Number", + }, + { + name: "a", + description: "", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v1", + description: + "

                red value if color mode is RGB, or hue value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green value if color mode is RGB, or saturation value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue value if color mode is RGB, or brightness value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "a", + description: "", + type: "Number", + optional: true, + }, + ], + 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()\n 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: true, + }, + ], + chainable: 1, + }, + ], + }, + clear: { + name: "clear", + params: [ + { + name: "r", + description: "

                normalized red value.

                \n", + type: "Number", + }, + { + name: "g", + description: "

                normalized green value.

                \n", + type: "Number", + }, + { + name: "b", + description: "

                normalized blue value.

                \n", + type: "Number", + }, + { + name: "a", + description: "

                normalized alpha value.

                \n", + type: "Number", + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + chainable: 1, + }, + ], + }, + fill: { + name: "fill", + class: "p5", + module: "Color", + overloads: [ + { + params: [ + { + name: "v1", + description: + "

                red value if color mode is RGB or hue value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green value if color mode is RGB or saturation value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue value if color mode is RGB or brightness value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "value", + description: "

                a color string.

                \n", + type: "String", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "gray", + description: "

                a grayscale value.

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + 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 value if color mode is RGB or hue value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green value if color mode is RGB or saturation value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue value if color mode is RGB or brightness value if color mode is HSB.

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "value", + description: "

                a color string.

                \n", + type: "String", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "gray", + description: "

                a grayscale value.

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + 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 under a shape's interior.\n Defaults to 255, which is full strength.

                \n", + type: "Number", + optional: true, + }, + { + name: "strengthStroke", + description: + "

                a number (0-255) for the strength of erasing under a shape's edge.\n Defaults to 255, which is full strength.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + 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. Won't\n draw a stroke for a detail of more than 50.

                \n", + type: "Integer", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + ellipse: { + name: "ellipse", + class: "p5", + module: "Shape", + overloads: [ + { + params: [ + { + name: "x", + description: + "

                x-coordinate of the center of the ellipse.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                y-coordinate of the center of the 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: true, + }, + ], + 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: + "

                optional parameter for WebGL mode only. This is to\n specify the number of vertices that makes up the\n perimeter of the ellipse. Default value is 25. Won't\n draw a stroke for a detail of more than 50.

                \n", + type: "Integer", + optional: true, + }, + ], + }, + ], + }, + circle: { + name: "circle", + params: [ + { + name: "x", + description: + "

                x-coordinate of the center of the circle.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                y-coordinate of the center 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: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "coordinateVector", + 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", + }, + { + name: "detailX", + description: + "

                number of segments in the x-direction.

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                number of segments in the y-direction.

                \n", + type: "Integer", + optional: true, + }, + ], + 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", + }, + { + name: "detailX", + description: "", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: "", + type: "Integer", + optional: true, + }, + ], + 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: true, + }, + { + name: "tl", + description: + "

                optional radius of top-left corner.

                \n", + type: "Number", + optional: true, + }, + { + name: "tr", + description: + "

                optional radius of top-right corner.

                \n", + type: "Number", + optional: true, + }, + { + name: "br", + description: + "

                optional radius of bottom-right corner.

                \n", + type: "Number", + optional: true, + }, + { + name: "bl", + description: + "

                optional radius of bottom-left corner.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "detailY", + description: + "

                number of segments in the y-direction (for WebGL mode).

                \n", + type: "Integer", + optional: true, + }, + ], + 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: true, + }, + { + name: "tr", + description: + "

                optional radius of top-right corner.

                \n", + type: "Number", + optional: true, + }, + { + name: "br", + description: + "

                optional radius of bottom-right corner.

                \n", + type: "Number", + optional: true, + }, + { + name: "bl", + description: + "

                optional radius of bottom-left corner.

                \n", + type: "Number", + optional: true, + }, + ], + 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, or 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + name: "count", + description: + "

                number of times you want to draw/instance the shape (for WebGL mode).

                \n", + type: "Integer", + optional: true, + }, + ], + 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 Defaults to 0 if not specified.

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "x", + description: "", + type: "Number", + }, + { + name: "y", + description: "", + type: "Number", + }, + { + name: "z", + description: "", + type: "Number", + optional: true, + }, + { + name: "u", + description: + "

                the vertex's texture u-coordinate

                \n", + type: "Number", + optional: true, + }, + { + name: "v", + description: + "

                the vertex's texture v-coordinate

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + ], + }, + normal: { + name: "normal", + class: "p5", + module: "Shape", + overloads: [ + { + params: [ + { + name: "vector", + description: + "

                A p5.Vector representing the vertex normal.

                \n", + type: "Vector", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "x", + description: + "

                The x component of the vertex normal.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                The y component of the vertex normal.

                \n", + type: "Number", + }, + { + name: "z", + description: + "

                The z component of the vertex normal.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + ], + }, + VERSION: { + name: "VERSION", + class: "p5", + module: "Constants", + }, + P2D: { + name: "P2D", + class: "p5", + module: "Constants", + }, + WEBGL: { + name: "WEBGL", + class: "p5", + module: "Constants", + }, + WEBGL2: { + name: "WEBGL2", + 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", + }, + CHAR: { + name: "CHAR", + class: "p5", + module: "Constants", + }, + WORD: { + name: "WORD", + 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", + }, + FLAT: { + name: "FLAT", + class: "p5", + module: "Constants", + }, + SMOOTH: { + name: "SMOOTH", + 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", + }, + LABEL: { + name: "LABEL", + class: "p5", + module: "Constants", + }, + FALLBACK: { + name: "FALLBACK", + class: "p5", + module: "Constants", + }, + CONTAIN: { + name: "CONTAIN", + class: "p5", + module: "Constants", + }, + COVER: { + name: "COVER", + class: "p5", + module: "Constants", + }, + UNSIGNED_BYTE: { + name: "UNSIGNED_BYTE", + class: "p5", + module: "Constants", + }, + UNSIGNED_INT: { + name: "UNSIGNED_INT", + class: "p5", + module: "Constants", + }, + FLOAT: { + name: "FLOAT", + class: "p5", + module: "Constants", + }, + HALF_FLOAT: { + name: "HALF_FLOAT", + class: "p5", + module: "Constants", + }, + RGBA: { + name: "RGBA", + class: "p5", + module: "Constants", + }, + print: { + name: "print", + params: [ + { + name: "contents", + description: "

                content to print to the console.

                \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, or WAIT.\n Native CSS properties: 'grab', 'progress', and so on.\n Path to cursor image.

                \n", + type: "String|Constant", + }, + { + name: "x", + description: + "

                horizontal active spot of the cursor.

                \n", + type: "Number", + optional: true, + }, + { + name: "y", + description: "

                vertical active spot of the cursor.

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "Environment", + }, + frameRate: { + name: "frameRate", + class: "p5", + module: "Environment", + overloads: [ + { + params: [ + { + name: "fps", + description: + "

                number of frames to draw per second.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [], + }, + ], + }, + getTargetFrameRate: { + name: "getTargetFrameRate", + class: "p5", + module: "Environment", + }, + noCursor: { + name: "noCursor", + class: "p5", + module: "Environment", + }, + webglVersion: { + name: "webglVersion", + 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", + params: [ + { + name: "event", + description: "

                optional resize Event.

                \n", + type: "UIEvent", + optional: true, + }, + ], + 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.

                \n", + type: "Boolean", + optional: true, + }, + ], + class: "p5", + module: "Environment", + }, + pixelDensity: { + name: "pixelDensity", + class: "p5", + module: "Environment", + overloads: [ + { + params: [ + { + name: "val", + description: "

                desired pixel density.

                \n", + type: "Number", + optional: true, + }, + ], + 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", + class: "p5", + module: "Rendering", + overloads: [ + { + 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: true, + }, + { + name: "canvas", + description: "

                existing html canvas element

                \n", + type: "HTMLCanvasElement", + optional: true, + }, + ], + }, + { + params: [ + { + name: "w", + description: "", + type: "Number", + }, + { + name: "h", + description: "", + type: "Number", + }, + { + name: "canvas", + description: "", + type: "HTMLCanvasElement", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + ], + class: "p5", + module: "Rendering", + }, + noCanvas: { + name: "noCanvas", + class: "p5", + module: "Rendering", + }, + createGraphics: { + name: "createGraphics", + class: "p5", + module: "Rendering", + overloads: [ + { + 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: true, + }, + { + name: "canvas", + description: "

                existing html canvas element

                \n", + type: "HTMLCanvasElement", + optional: true, + }, + ], + }, + { + params: [ + { + name: "w", + description: "", + type: "Number", + }, + { + name: "h", + description: "", + type: "Number", + }, + { + name: "canvas", + description: "", + type: "HTMLCanvasElement", + optional: true, + }, + ], + }, + ], + }, + createFramebuffer: { + name: "createFramebuffer", + params: [ + { + name: "options", + description: + "

                An optional object with configuration

                \n", + type: "Object", + optional: true, + }, + ], + 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: true, + }, + ], + 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", + class: "p5", + module: "Transform", + overloads: [ + { + params: [ + { + name: "arr", + description: + "

                an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values)

                \n", + type: "Array", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "a", + description: + "

                numbers which define the 2×3 or 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "b", + description: + "

                numbers which define the 2×3 or 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "c", + description: + "

                numbers which define the 2×3 or 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "d", + description: + "

                numbers which define the 2×3 or 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "e", + description: + "

                numbers which define the 2×3 or 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "f", + description: + "

                numbers which define the 2×3 or 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "a", + description: "", + type: "Number", + }, + { + name: "b", + description: "", + type: "Number", + }, + { + name: "c", + description: "", + type: "Number", + }, + { + name: "d", + description: "", + type: "Number", + }, + { + name: "e", + description: "", + type: "Number", + }, + { + name: "f", + description: "", + type: "Number", + }, + { + name: "g", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "h", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "i", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "j", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "k", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "l", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "m", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "n", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "o", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + { + name: "p", + description: + "

                numbers which define the 4×4 matrix to be multiplied

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + ], + }, + 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: true, + }, + ], + 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: true, + }, + { + name: "z", + description: + "

                percent to scale the object in the z-axis (webgl only)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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 HTMLElement to search within.

                \n', + type: "String|p5.Element|HTMLElement", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + selectAll: { + name: "selectAll", + 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 HTMLElement to search within.

                \n', + type: "String|p5.Element|HTMLElement", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + removeElements: { + name: "removeElements", + class: "p5", + module: "DOM", + }, + changed: { + name: "changed", + params: [ + { + name: "fxn", + description: + "

                function to call when the element changes.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5", + module: "DOM", + }, + input: { + name: "input", + params: [ + { + name: "fxn", + description: + "

                function to call when input is detected within\n the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5", + module: "DOM", + }, + createDiv: { + name: "createDiv", + params: [ + { + name: "html", + description: + "

                inner HTML for the new <div></div> element.

                \n", + type: "String", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createP: { + name: "createP", + params: [ + { + name: "html", + description: + "

                inner HTML for the new <p></p> element.

                \n", + type: "String", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createSpan: { + name: "createSpan", + params: [ + { + name: "html", + description: + "

                inner HTML for the new <span></span> element.

                \n", + type: "String", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createImg: { + name: "createImg", + class: "p5", + module: "DOM", + overloads: [ + { + params: [ + { + name: "src", + description: + "

                relative path or URL for the image.

                \n", + type: "String", + }, + { + name: "alt", + description: "

                alternate text for the image.

                \n", + type: "String", + }, + ], + }, + { + params: [ + { + name: "src", + description: "", + type: "String", + }, + { + name: "alt", + description: "", + type: "String", + }, + { + name: "crossOrigin", + description: + "

                crossOrigin property to use when fetching the image.

                \n", + type: "String", + optional: true, + }, + { + name: "successCallback", + description: + '

                function to call once the image loads. The new image will be passed\n to the function as a p5.Element object.

                \n', + type: "Function", + optional: true, + }, + ], + }, + ], + }, + createA: { + name: "createA", + params: [ + { + name: "href", + description: "

                URL of linked page.

                \n", + type: "String", + }, + { + name: "html", + description: + "

                inner HTML of link element to display.

                \n", + type: "String", + }, + { + name: "target", + description: + "

                target where the new link should open,\n either '_blank', '_self', '_parent', or '_top'.

                \n", + type: "String", + optional: true, + }, + ], + 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: true, + }, + { + name: "step", + description: + "

                size for each step in the slider's range.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + class: "p5", + module: "DOM", + }, + createCheckbox: { + name: "createCheckbox", + params: [ + { + name: "label", + description: "

                label displayed after the checkbox.

                \n", + type: "String", + optional: true, + }, + { + name: "value", + description: + "

                value of the checkbox. Checked is true and unchecked is false.

                \n", + type: "Boolean", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createSelect: { + name: "createSelect", + class: "p5", + module: "DOM", + overloads: [ + { + params: [ + { + name: "multiple", + description: "

                support multiple selections.

                \n", + type: "Boolean", + optional: true, + }, + ], + }, + { + params: [ + { + name: "existing", + description: + '

                select element to wrap, either as a p5.Element or\n a HTMLSelectElement.

                \n', + type: "Object", + }, + ], + }, + ], + }, + createRadio: { + name: "createRadio", + class: "p5", + module: "DOM", + overloads: [ + { + params: [ + { + name: "containerElement", + description: + "

                container HTML Element, either a <div></div>\nor <span></span>.

                \n", + type: "Object", + optional: true, + }, + ], + }, + { + params: [ + { + name: "name", + description: + "

                name parameter assigned to each option's <input></input> element.

                \n", + type: "String", + optional: true, + }, + ], + }, + { + params: [], + }, + ], + }, + createColorPicker: { + name: "createColorPicker", + params: [ + { + name: "value", + description: + '

                default color as a CSS color string.

                \n', + type: "String|p5.Color", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createInput: { + name: "createInput", + class: "p5", + module: "DOM", + overloads: [ + { + params: [ + { + name: "value", + description: + "

                default value of the input box. Defaults to an empty string ''.

                \n", + type: "String", + optional: true, + }, + { + name: "type", + description: + "

                type of input. Defaults to 'text'.

                \n", + type: "String", + optional: true, + }, + ], + }, + { + params: [ + { + name: "value", + description: "", + type: "String", + optional: true, + }, + ], + }, + ], + }, + createFileInput: { + name: "createFileInput", + params: [ + { + name: "callback", + description: + "

                function to call once the file loads.

                \n", + type: "Function", + }, + { + name: "multiple", + description: + "

                allow multiple files to be selected.

                \n", + type: "Boolean", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createVideo: { + name: "createVideo", + params: [ + { + name: "src", + description: + "

                path to a video file, or an array of paths for\n supporting different browsers.

                \n", + type: "String|String[]", + }, + { + name: "callback", + description: + "

                function to call once the video is ready to play.

                \n", + type: "Function", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createAudio: { + name: "createAudio", + params: [ + { + name: "src", + description: + "

                path to an audio file, or an array of paths\n for supporting different browsers.

                \n", + type: "String|String[]", + optional: true, + }, + { + name: "callback", + description: + "

                function to call once the audio is ready to play.

                \n", + type: "Function", + optional: true, + }, + ], + class: "p5", + module: "DOM", + }, + createCapture: { + name: "createCapture", + params: [ + { + name: "type", + description: + "

                type of capture, either AUDIO or VIDEO,\n or a constraints object. Both video and audio\n audio streams are captured by default.

                \n", + type: "String|Constant|Object", + optional: true, + }, + { + name: "callback", + description: + "

                function to call once the stream\n has loaded.

                \n", + type: "Function", + optional: true, + }, + ], + 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 insert into the element.

                \n", + type: "String", + optional: true, + }, + ], + 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", + params: [ + { + name: "event", + description: + "

                optional KeyboardEvent callback argument.

                \n", + type: "KeyboardEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + keyReleased: { + name: "keyReleased", + params: [ + { + name: "event", + description: + "

                optional KeyboardEvent callback argument.

                \n", + type: "KeyboardEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + keyTyped: { + name: "keyTyped", + params: [ + { + name: "event", + description: + "

                optional KeyboardEvent callback argument.

                \n", + type: "KeyboardEvent", + optional: true, + }, + ], + 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: "MouseEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + mouseDragged: { + name: "mouseDragged", + params: [ + { + name: "event", + description: + "

                optional MouseEvent callback argument.

                \n", + type: "MouseEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + mousePressed: { + name: "mousePressed", + params: [ + { + name: "event", + description: + "

                optional MouseEvent callback argument.

                \n", + type: "MouseEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + mouseReleased: { + name: "mouseReleased", + params: [ + { + name: "event", + description: + "

                optional MouseEvent callback argument.

                \n", + type: "MouseEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + mouseClicked: { + name: "mouseClicked", + params: [ + { + name: "event", + description: + "

                optional MouseEvent callback argument.

                \n", + type: "MouseEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + doubleClicked: { + name: "doubleClicked", + params: [ + { + name: "event", + description: + "

                optional MouseEvent callback argument.

                \n", + type: "MouseEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + mouseWheel: { + name: "mouseWheel", + params: [ + { + name: "event", + description: + "

                optional WheelEvent callback argument.

                \n", + type: "WheelEvent", + optional: true, + }, + ], + 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: "TouchEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + touchMoved: { + name: "touchMoved", + params: [ + { + name: "event", + description: + "

                optional TouchEvent callback argument.

                \n", + type: "TouchEvent", + optional: true, + }, + ], + class: "p5", + module: "Events", + }, + touchEnded: { + name: "touchEnded", + params: [ + { + name: "event", + description: + "

                optional TouchEvent callback argument.

                \n", + type: "TouchEvent", + optional: true, + }, + ], + 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: + "

                reference to a\n specific HTML5 canvas element.

                \n", + type: "p5.Framebuffer|p5.Element|HTMLCanvasElement", + }, + { + name: "filename", + description: + "

                file name. Defaults to 'untitled'.

                \n", + type: "String", + optional: true, + }, + { + name: "extension", + description: + "

                file extension, either 'jpg' or 'png'. Defaults to 'png'.

                \n", + type: "String", + optional: true, + }, + ], + }, + { + params: [ + { + name: "filename", + description: "", + type: "String", + optional: true, + }, + { + name: "extension", + description: "", + type: "String", + optional: true, + }, + ], + }, + ], + }, + saveFrames: { + name: "saveFrames", + params: [ + { + name: "filename", + description: "

                prefix of file name.

                \n", + type: "String", + }, + { + name: "extension", + description: + "

                file extension, either 'jpg' or 'png'.

                \n", + type: "String", + }, + { + name: "duration", + description: + "

                duration in seconds to record. This parameter will be constrained to be less or equal to 15.

                \n", + type: "Number", + }, + { + name: "framerate", + description: + "

                number of frames to save per second. This parameter will be constrained to be less or equal to 22.

                \n", + type: "Number", + }, + { + name: "callback", + description: + "

                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, filename, and extension.

                \n", + type: "Function(Array)", + optional: true, + }, + ], + class: "p5", + module: "Image", + }, + loadImage: { + name: "loadImage", + params: [ + { + name: "path", + description: + "

                path of the image to be loaded or base64 encoded image.

                \n", + type: "String", + }, + { + name: "successCallback", + description: + '

                function called with\n p5.Image once it\n loads.

                \n', + type: "function(p5.Image)", + optional: true, + }, + { + name: "failureCallback", + description: + "

                function called with event\n error if the image fails to load.

                \n", + type: "Function(Event)", + optional: true, + }, + ], + class: "p5", + module: "Image", + }, + saveGif: { + name: "saveGif", + params: [ + { + name: "filename", + description: "

                file name of gif.

                \n", + type: "String", + }, + { + name: "duration", + description: + "

                duration in seconds to capture from the sketch.

                \n", + type: "Number", + }, + { + name: "options", + description: + "

                an object that can contain five more properties:\n delay, a Number specifying how much time to wait before recording;\n units, a String that can be either 'seconds' or 'frames'. By default it's 'seconds’;\n silent, a Boolean that defines presence of progress notifications. By default it’s false;\n notificationDuration, a Number that defines how long in seconds the final notification\n will live. By default it's 0, meaning the notification will never be removed;\n notificationID, a String that specifies the id of the notification's DOM element. By default it’s 'progressBar’.

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5", + module: "Image", + }, + image: { + name: "image", + class: "p5", + module: "Image", + overloads: [ + { + params: [ + { + name: "img", + description: "

                image to display.

                \n", + type: "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", + }, + { + name: "x", + description: + "

                x-coordinate of the top-left corner of the image.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                y-coordinate of the top-left corner of the image.

                \n", + type: "Number", + }, + { + name: "width", + description: "

                width to draw the image.

                \n", + type: "Number", + optional: true, + }, + { + name: "height", + description: "

                height to draw the image.

                \n", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "img", + description: "", + type: "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", + }, + { + 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: true, + }, + { + name: "sHeight", + description: + "

                the height of the subsection of the\n source image to draw into the destination rectangle

                \n", + type: "Number", + optional: true, + }, + { + name: "fit", + description: "

                either CONTAIN or COVER

                \n", + type: "Constant", + optional: true, + }, + { + name: "xAlign", + description: + "

                either LEFT, RIGHT or CENTER default is CENTER

                \n", + type: "Constant", + optional: true, + }, + { + name: "yAlign", + description: + "

                either TOP, BOTTOM or CENTER default is CENTER

                \n", + type: "Constant", + optional: true, + }, + ], + }, + ], + }, + tint: { + name: "tint", + class: "p5", + module: "Image", + overloads: [ + { + params: [ + { + name: "v1", + description: "

                red or hue value.

                \n", + type: "Number", + }, + { + name: "v2", + description: "

                green or saturation value.

                \n", + type: "Number", + }, + { + name: "v3", + description: "

                blue or brightness.

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "value", + description: "

                CSS color string.

                \n", + type: "String", + }, + ], + }, + { + params: [ + { + name: "gray", + description: "

                grayscale value.

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "values", + description: + "

                array containing the red, green, blue &\n 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", + class: "p5", + module: "Image", + overloads: [ + { + params: [ + { + name: "filterType", + description: + "

                either THRESHOLD, GRAY, OPAQUE, INVERT,\n POSTERIZE, BLUR, ERODE, DILATE or BLUR.

                \n", + type: "Constant", + }, + { + name: "filterParam", + description: + "

                parameter unique to each filter.

                \n", + type: "Number", + optional: true, + }, + { + name: "useWebGL", + description: + "

                flag to control whether to use fast\n WebGL filters (GPU) or original image\n filters (CPU); defaults to true.

                \n", + type: "Boolean", + optional: true, + }, + ], + }, + { + params: [ + { + name: "filterType", + description: "", + type: "Constant", + }, + { + name: "useWebGL", + description: "", + type: "Boolean", + optional: true, + }, + ], + }, + { + params: [ + { + name: "shaderFilter", + description: + "

                shader that's been loaded, with the\n frag shader using a tex0 uniform.

                \n", + type: "p5.Shader", + }, + ], + }, + ], + }, + 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 of the subsection to be returned.

                \n", + type: "Number", + }, + { + name: "h", + description: + "

                height of the subsection to be returned.

                \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: + '

                grayscale value | pixel array |\n p5.Color object | 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: true, + }, + { + name: "y", + description: + "

                y-coordinate of the upper-left corner of region\n to update.

                \n", + type: "Number", + optional: true, + }, + { + name: "w", + description: "

                width of region to update.

                \n", + type: "Number", + optional: true, + }, + { + name: "h", + description: "

                height of region to update.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "datatype", + description: '

                "json" or "jsonp"

                \n', + type: "String", + optional: true, + }, + { + name: "callback", + description: + '

                function to be executed after\n loadJSON() completes, data is passed\n in as first argument

                \n', + type: "Function", + optional: true, + }, + { + 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: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "datatype", + description: "", + type: "String", + }, + { + name: "callback", + description: "", + type: "Function", + optional: true, + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "callback", + description: "", + type: "Function", + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + { + name: "header", + description: + '

                "header" to indicate table has header row

                \n', + type: "String", + optional: true, + }, + { + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + { + name: "errorCallback", + description: + "

                function to be executed if there\n is an error

                \n", + type: "Function", + optional: true, + }, + ], + 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: true, + }, + { + name: "data", + description: + "

                param data passed sent with request

                \n", + type: "Object|Boolean", + optional: true, + }, + { + name: "callback", + description: + '

                function to be executed after\n httpGet() completes, data is passed in\n as first argument

                \n', + type: "Function", + optional: true, + }, + { + 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: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "data", + description: "", + type: "Object|Boolean", + }, + { + name: "callback", + description: "", + type: "Function", + optional: true, + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "callback", + description: "", + type: "Function", + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + { + name: "data", + description: + "

                param data passed sent with request

                \n", + type: "Object|Boolean", + optional: true, + }, + { + name: "callback", + description: + '

                function to be executed after\n httpPost() completes, data is passed in\n as first argument

                \n', + type: "Function", + optional: true, + }, + { + 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: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "data", + description: "", + type: "Object|Boolean", + }, + { + name: "callback", + description: "", + type: "Function", + optional: true, + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "callback", + description: "", + type: "Function", + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + { + name: "datatype", + description: + '

                "json", "jsonp", "xml", or "text"

                \n', + type: "String", + optional: true, + }, + { + name: "data", + description: + "

                param data passed sent with request

                \n", + type: "Object", + optional: true, + }, + { + name: "callback", + description: + '

                function to be executed after\n httpGet() completes, data is passed in\n as first argument

                \n', + type: "Function", + optional: true, + }, + { + 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: true, + }, + ], + }, + { + 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: true, + }, + { + name: "errorCallback", + description: "", + type: "Function", + optional: true, + }, + ], + }, + ], + }, + createWriter: { + name: "createWriter", + params: [ + { + name: "name", + description: "

                name of the file to be created

                \n", + type: "String", + }, + { + name: "extension", + description: "", + type: "String", + optional: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + name: "isCRLF", + description: "

                if true, change line-break to CRLF

                \n", + type: "Boolean", + optional: true, + }, + ], + 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: true, + }, + ], + 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: "x", + description: "

                first component.

                \n", + type: "Number", + }, + { + name: "y", + description: "

                second component.

                \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: true, + }, + ], + class: "p5", + module: "Math", + }, + max: { + name: "max", + class: "p5", + module: "Math", + overloads: [ + { + params: [ + { + name: "n0", + description: "

                first number to compare.

                \n", + type: "Number", + }, + { + name: "n1", + description: "

                second 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: "

                first number to compare.

                \n", + type: "Number", + }, + { + name: "n1", + description: "

                second 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: true, + }, + ], + 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: "n", + description: + "

                number whose fractional part will be found.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + createVector: { + name: "createVector", + params: [ + { + name: "x", + description: "

                x component of the vector.

                \n", + type: "Number", + optional: true, + }, + { + name: "y", + description: "

                y component of the vector.

                \n", + type: "Number", + optional: true, + }, + { + name: "z", + description: "

                z component of the vector.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "z", + description: "

                z-coordinate in noise space.

                \n", + type: "Number", + optional: true, + }, + ], + 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: "

                seed value.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + randomSeed: { + name: "randomSeed", + params: [ + { + name: "seed", + description: "

                seed value.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + random: { + name: "random", + class: "p5", + module: "Math", + overloads: [ + { + params: [ + { + name: "min", + description: "

                lower bound (inclusive).

                \n", + type: "Number", + optional: true, + }, + { + name: "max", + description: "

                upper bound (exclusive).

                \n", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "choices", + description: "

                array to choose from.

                \n", + type: "Array", + }, + ], + }, + ], + }, + randomGaussian: { + name: "randomGaussian", + params: [ + { + name: "mean", + description: "

                mean.

                \n", + type: "Number", + optional: true, + }, + { + name: "sd", + description: "

                standard deviation.

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "Math", + }, + acos: { + name: "acos", + params: [ + { + name: "value", + description: + "

                value whose arc cosine is to be returned.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + asin: { + name: "asin", + params: [ + { + name: "value", + description: + "

                value whose arc sine is to be returned.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + atan: { + name: "atan", + params: [ + { + name: "value", + description: + "

                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: + "

                radians value to convert to degrees.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + radians: { + name: "radians", + params: [ + { + name: "degrees", + description: "

                degree value to convert to radians.

                \n", + type: "Number", + }, + ], + class: "p5", + module: "Math", + }, + angleMode: { + name: "angleMode", + class: "p5", + module: "Math", + overloads: [ + { + params: [ + { + name: "mode", + description: "

                either RADIANS or DEGREES.

                \n", + type: "Constant", + }, + ], + }, + { + params: [], + }, + ], + }, + 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: true, + }, + ], + chainable: 1, + }, + { + params: [], + }, + ], + }, + textLeading: { + name: "textLeading", + class: "p5", + module: "Typography", + overloads: [ + { + params: [ + { + name: "leading", + description: + "

                spacing between lines of text in units of pixels.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [], + }, + ], + }, + textSize: { + name: "textSize", + class: "p5", + module: "Typography", + overloads: [ + { + params: [ + { + name: "size", + description: + "

                size of the letters in units of pixels

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [], + }, + ], + }, + textStyle: { + name: "textStyle", + class: "p5", + module: "Typography", + overloads: [ + { + params: [ + { + name: "style", + description: + "

                styling for text, either NORMAL,\n ITALIC, BOLD or BOLDITALIC

                \n", + type: "Constant", + }, + ], + chainable: 1, + }, + { + params: [], + }, + ], + }, + textWidth: { + name: "textWidth", + params: [ + { + name: "str", + description: "

                string of text to measure.

                \n", + type: "String", + }, + ], + class: "p5", + module: "Typography", + }, + textAscent: { + name: "textAscent", + class: "p5", + module: "Typography", + }, + textDescent: { + name: "textDescent", + class: "p5", + module: "Typography", + }, + textWrap: { + name: "textWrap", + params: [ + { + name: "style", + description: + "

                text wrapping style, either WORD or CHAR.

                \n", + type: "Constant", + }, + ], + class: "p5", + module: "Typography", + }, + loadFont: { + name: "loadFont", + params: [ + { + name: "path", + description: "

                path of the font to be loaded.

                \n", + type: "String", + }, + { + name: "successCallback", + description: + '

                function called with the\n p5.Font object after it\n loads.

                \n', + type: "Function", + optional: true, + }, + { + name: "failureCallback", + description: + '

                function called with the error\n Event\n object if the font fails to load.

                \n', + type: "Function", + optional: true, + }, + ], + class: "p5", + module: "Typography", + }, + text: { + name: "text", + params: [ + { + name: "str", + description: "

                text to be displayed.

                \n", + type: "String|Object|Array|Number|Boolean", + }, + { + name: "x", + description: "

                x-coordinate of the text box.

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y-coordinate of the text box.

                \n", + type: "Number", + }, + { + name: "maxWidth", + description: + '

                maximum width of the text box. See\n rectMode() for\n other options.

                \n', + type: "Number", + optional: true, + }, + { + name: "maxHeight", + description: + '

                maximum height of the text box. See\n rectMode() for\n other options.

                \n', + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "Typography", + }, + textFont: { + name: "textFont", + class: "p5", + module: "Typography", + overloads: [ + { + params: [], + }, + { + params: [ + { + name: "font", + description: + '

                font as a p5.Font object or a string.

                \n', + type: "Object|String", + }, + { + name: "size", + description: "

                font size in pixels.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + }, + ], + }, + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + }, + { + params: [ + { + name: "ns", + description: "

                values to parse

                \n", + type: "Array", + }, + { + name: "radix", + description: "", + type: "Integer", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + ], + }, + { + params: [ + { + name: "ns", + description: "

                array of values to parse

                \n", + type: "Number[]", + }, + { + name: "digits", + description: "", + type: "Number", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + { + name: "right", + description: + "

                number of digits to the right of the\n decimal point

                \n", + type: "Integer|String", + optional: true, + }, + ], + }, + { + params: [ + { + name: "nums", + description: "

                the Numbers to format

                \n", + type: "Array", + }, + { + name: "left", + description: "", + type: "Integer|String", + optional: true, + }, + { + name: "right", + description: "", + type: "Integer|String", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + ], + }, + { + params: [ + { + name: "nums", + description: "

                the Numbers to format

                \n", + type: "Array", + }, + { + name: "right", + description: "", + type: "Integer|String", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + { + name: "right", + description: + "

                number of digits to the right of the\n decimal point

                \n", + type: "Integer", + optional: true, + }, + ], + }, + { + params: [ + { + name: "nums", + description: "

                the Numbers to format

                \n", + type: "Number[]", + }, + { + name: "left", + description: "", + type: "Integer", + optional: true, + }, + { + name: "right", + description: "", + type: "Integer", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + { + name: "right", + description: + "

                number of digits to the right of the\n decimal point

                \n", + type: "Integer", + optional: true, + }, + ], + }, + { + params: [ + { + name: "nums", + description: "

                the Numbers to format

                \n", + type: "Array", + }, + { + name: "left", + description: "", + type: "Integer", + optional: true, + }, + { + name: "right", + description: "", + type: "Integer", + optional: true, + }, + ], + }, + ], + }, + 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: true, + }, + ], + 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", + }, + beginGeometry: { + name: "beginGeometry", + class: "p5", + module: "Shape", + }, + endGeometry: { + name: "endGeometry", + class: "p5", + module: "Shape", + }, + buildGeometry: { + name: "buildGeometry", + params: [ + { + name: "callback", + description: "

                A function that draws shapes.

                \n", + type: "Function", + }, + ], + class: "p5", + module: "Shape", + }, + freeGeometry: { + name: "freeGeometry", + params: [ + { + name: "geometry", + description: + "

                The geometry whose resources should be freed

                \n", + type: "p5.Geometry", + }, + ], + class: "p5", + module: "Shape", + }, + plane: { + name: "plane", + params: [ + { + name: "width", + description: "

                width of the plane

                \n", + type: "Number", + optional: true, + }, + { + name: "height", + description: "

                height of the plane

                \n", + type: "Number", + optional: true, + }, + { + name: "detailX", + description: + "

                Optional number of triangle\n subdivisions in x-dimension

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                Optional number of triangle\n subdivisions in y-dimension

                \n", + type: "Integer", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + box: { + name: "box", + params: [ + { + name: "width", + description: "

                width of the box

                \n", + type: "Number", + optional: true, + }, + { + name: "height", + description: "

                height of the box

                \n", + type: "Number", + optional: true, + }, + { + name: "depth", + description: "

                depth of the box

                \n", + type: "Number", + optional: true, + }, + { + name: "detailX", + description: + "

                Optional number of triangle\n subdivisions in x-dimension

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                Optional number of triangle\n subdivisions in y-dimension

                \n", + type: "Integer", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + sphere: { + name: "sphere", + params: [ + { + name: "radius", + description: "

                radius of circle

                \n", + type: "Number", + optional: true, + }, + { + name: "detailX", + description: + "

                optional number of subdivisions in x-dimension

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                optional number of subdivisions in y-dimension

                \n", + type: "Integer", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + cylinder: { + name: "cylinder", + params: [ + { + name: "radius", + description: "

                radius of the surface

                \n", + type: "Number", + optional: true, + }, + { + name: "height", + description: "

                height of the cylinder

                \n", + type: "Number", + optional: true, + }, + { + name: "detailX", + description: + "

                number of subdivisions in x-dimension;\n default is 24

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                number of subdivisions in y-dimension;\n default is 1

                \n", + type: "Integer", + optional: true, + }, + { + name: "bottomCap", + description: + "

                whether to draw the bottom of the cylinder

                \n", + type: "Boolean", + optional: true, + }, + { + name: "topCap", + description: + "

                whether to draw the top of the cylinder

                \n", + type: "Boolean", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + cone: { + name: "cone", + params: [ + { + name: "radius", + description: "

                radius of the bottom surface

                \n", + type: "Number", + optional: true, + }, + { + name: "height", + description: "

                height of the cone

                \n", + type: "Number", + optional: true, + }, + { + name: "detailX", + description: + "

                number of segments,\n the more segments the smoother geometry\n default is 24

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                number of segments,\n the more segments the smoother geometry\n default is 1

                \n", + type: "Integer", + optional: true, + }, + { + name: "cap", + description: + "

                whether to draw the base of the cone

                \n", + type: "Boolean", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + ellipsoid: { + name: "ellipsoid", + params: [ + { + name: "radiusx", + description: "

                x-radius of ellipsoid

                \n", + type: "Number", + optional: true, + }, + { + name: "radiusy", + description: "

                y-radius of ellipsoid

                \n", + type: "Number", + optional: true, + }, + { + name: "radiusz", + description: "

                z-radius of ellipsoid

                \n", + type: "Number", + optional: true, + }, + { + 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: true, + }, + { + 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: true, + }, + ], + class: "p5", + module: "Shape", + }, + torus: { + name: "torus", + params: [ + { + name: "radius", + description: "

                radius of the whole ring

                \n", + type: "Number", + optional: true, + }, + { + name: "tubeRadius", + description: "

                radius of the tube

                \n", + type: "Number", + optional: true, + }, + { + name: "detailX", + description: + "

                number of segments in x-dimension,\n the more segments the smoother geometry\n default is 24

                \n", + type: "Integer", + optional: true, + }, + { + name: "detailY", + description: + "

                number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16

                \n", + type: "Integer", + optional: true, + }, + ], + class: "p5", + module: "Shape", + }, + orbitControl: { + name: "orbitControl", + params: [ + { + name: "sensitivityX", + description: + "

                sensitivity to mouse movement along X axis

                \n", + type: "Number", + optional: true, + }, + { + name: "sensitivityY", + description: + "

                sensitivity to mouse movement along Y axis

                \n", + type: "Number", + optional: true, + }, + { + name: "sensitivityZ", + description: + "

                sensitivity to scroll movement along Z axis

                \n", + type: "Number", + optional: true, + }, + { + name: "options", + description: + "

                An optional object that can contain additional settings,\ndisableTouchActions - Boolean, default value is true.\nSetting this to true makes mobile interactions smoother by preventing\naccidental interactions with the page while orbiting. But if you're already\ndoing it via css or want the default touch actions, consider setting it to false.\nfreeRotation - Boolean, default value is false.\nBy default, horizontal movement of the mouse or touch pointer rotates the camera\naround the y-axis, and vertical movement rotates the camera around the x-axis.\nBut if setting this option to true, the camera always rotates in the direction\nthe pointer is moving. For zoom and move, the behavior is the same regardless of\ntrue/false.

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5", + module: "3D", + }, + debugMode: { + name: "debugMode", + class: "p5", + module: "3D", + 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: true, + }, + { + name: "gridDivisions", + description: "

                number of divisions in the grid

                \n", + type: "Number", + optional: true, + }, + { + name: "xOff", + description: + "

                X axis offset from origin (0,0,0)

                \n", + type: "Number", + optional: true, + }, + { + name: "yOff", + description: + "

                Y axis offset from origin (0,0,0)

                \n", + type: "Number", + optional: true, + }, + { + name: "zOff", + description: + "

                Z axis offset from origin (0,0,0)

                \n", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "mode", + description: "", + type: "Constant", + }, + { + name: "axesSize", + description: "

                size of axes icon

                \n", + type: "Number", + optional: true, + }, + { + name: "xOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "yOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "zOff", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "gridSize", + description: "", + type: "Number", + optional: true, + }, + { + name: "gridDivisions", + description: "", + type: "Number", + optional: true, + }, + { + name: "gridXOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "gridYOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "gridZOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "axesSize", + description: "", + type: "Number", + optional: true, + }, + { + name: "axesXOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "axesYOff", + description: "", + type: "Number", + optional: true, + }, + { + name: "axesZOff", + description: "", + type: "Number", + optional: true, + }, + ], + }, + ], + }, + noDebugMode: { + name: "noDebugMode", + class: "p5", + module: "3D", + }, + ambientLight: { + name: "ambientLight", + class: "p5", + module: "3D", + 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: + "

                alpha value relative to current\n color range (default is 0-255)

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "gray", + description: + "

                number specifying value between\n white and black

                \n", + type: "Number", + }, + { + name: "alpha", + description: "", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "value", + description: "

                a color string

                \n", + type: "String", + }, + ], + 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: + '

                color as a p5.Color

                \n', + type: "p5.Color", + }, + ], + chainable: 1, + }, + ], + }, + specularColor: { + name: "specularColor", + class: "p5", + module: "3D", + 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: "gray", + description: + "

                number specifying value between\n white and black

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "value", + description: "

                color as a CSS string

                \n", + type: "String", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "values", + description: + "

                color as an array containing the\n red, green, and blue components

                \n", + type: "Number[]", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color

                \n', + type: "p5.Color", + }, + ], + chainable: 1, + }, + ], + }, + directionalLight: { + name: "directionalLight", + class: "p5", + module: "3D", + overloads: [ + { + params: [ + { + name: "v1", + description: + "

                red or hue value relative to the current\n color range

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green or saturation value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue or brightness value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "x", + description: + "

                x component of direction (inclusive range of -1 to 1)

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                y component of direction (inclusive range of -1 to 1)

                \n", + type: "Number", + }, + { + name: "z", + description: + "

                z component of direction (inclusive range of -1 to 1)

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v1", + description: "", + type: "Number", + }, + { + name: "v2", + description: "", + type: "Number", + }, + { + name: "v3", + description: "", + type: "Number", + }, + { + name: "direction", + description: + '

                direction of light as a\n p5.Vector

                \n', + type: "p5.Vector", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color,\n as an array, or as a CSS string

                \n', + type: "p5.Color|Number[]|String", + }, + { + name: "x", + description: "", + type: "Number", + }, + { + name: "y", + description: "", + type: "Number", + }, + { + name: "z", + description: "", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: "", + type: "p5.Color|Number[]|String", + }, + { + name: "direction", + description: "", + type: "p5.Vector", + }, + ], + chainable: 1, + }, + ], + }, + pointLight: { + name: "pointLight", + class: "p5", + module: "3D", + overloads: [ + { + params: [ + { + name: "v1", + description: + "

                red or hue value relative to the current\n color range

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green or saturation value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue or brightness value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "x", + description: "

                x component of position

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y component of position

                \n", + type: "Number", + }, + { + name: "z", + description: "

                z component of 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: + '

                of light as a p5.Vector

                \n', + type: "p5.Vector", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color,\n as an array, or as a CSS string

                \n', + type: "p5.Color|Number[]|String", + }, + { + name: "x", + description: "", + type: "Number", + }, + { + name: "y", + description: "", + type: "Number", + }, + { + name: "z", + description: "", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: "", + type: "p5.Color|Number[]|String", + }, + { + name: "position", + description: "", + type: "p5.Vector", + }, + ], + chainable: 1, + }, + ], + }, + imageLight: { + name: "imageLight", + params: [ + { + name: "img", + description: "

                image for the background

                \n", + type: "p5.image", + }, + ], + class: "p5", + module: "3D", + }, + lights: { + name: "lights", + class: "p5", + module: "3D", + }, + 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: "3D", + }, + spotLight: { + name: "spotLight", + class: "p5", + module: "3D", + overloads: [ + { + params: [ + { + name: "v1", + description: + "

                red or hue value relative to the current color range

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green or saturation value relative to the current color range

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue or brightness value relative to the current color range

                \n", + type: "Number", + }, + { + name: "x", + description: "

                x component of position

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y component of position

                \n", + type: "Number", + }, + { + name: "z", + description: "

                z component of position

                \n", + type: "Number", + }, + { + name: "rx", + description: + "

                x component of light direction (inclusive range of -1 to 1)

                \n", + type: "Number", + }, + { + name: "ry", + description: + "

                y component of light direction (inclusive range of -1 to 1)

                \n", + type: "Number", + }, + { + name: "rz", + description: + "

                z component of light direction (inclusive range of -1 to 1)

                \n", + type: "Number", + }, + { + name: "angle", + description: "

                angle of cone. Defaults to PI/3

                \n", + type: "Number", + optional: true, + }, + { + name: "concentration", + description: + "

                concentration of cone. Defaults to 100

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color,\n as an array, or as a CSS string

                \n', + type: "p5.Color|Number[]|String", + }, + { + name: "position", + description: + '

                position of light as a p5.Vector

                \n', + type: "p5.Vector", + }, + { + name: "direction", + description: + '

                direction of light as a p5.Vector

                \n', + type: "p5.Vector", + }, + { + name: "angle", + description: "", + type: "Number", + optional: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + 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: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "color", + description: "", + type: "p5.Color|Number[]|String", + }, + { + 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: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "color", + description: "", + type: "p5.Color|Number[]|String", + }, + { + 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: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + 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: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + 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: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "color", + description: "", + type: "p5.Color|Number[]|String", + }, + { + 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: true, + }, + { + name: "concentration", + description: "", + type: "Number", + optional: true, + }, + ], + }, + ], + }, + noLights: { + name: "noLights", + class: "p5", + module: "3D", + }, + 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: true, + }, + { + name: "failureCallback", + description: + "

                called with event error if\n the model fails to load.

                \n", + type: "Function(Event)", + optional: true, + }, + { + name: "fileType", + description: + "

                The file extension of the model\n (.stl, .obj).

                \n", + type: "String", + optional: true, + }, + ], + }, + { + params: [ + { + name: "path", + description: "", + type: "String", + }, + { + name: "successCallback", + description: "", + type: "function(p5.Geometry)", + optional: true, + }, + { + name: "failureCallback", + description: "", + type: "Function(Event)", + optional: true, + }, + { + name: "fileType", + description: "", + type: "String", + optional: true, + }, + ], + }, + ], + }, + 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 p5.Shader object is passed as the first argument.

                \n", + type: "Function", + optional: true, + }, + { + 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: true, + }, + ], + class: "p5", + module: "3D", + }, + 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: "3D", + }, + createFilterShader: { + name: "createFilterShader", + params: [ + { + name: "fragSrc", + description: "

                source code for the fragment shader

                \n", + type: "String", + }, + ], + class: "p5", + module: "3D", + }, + shader: { + name: "shader", + params: [ + { + name: "s", + description: + '

                the p5.Shader object\nto use for rendering shapes.

                \n', + type: "p5.Shader", + }, + ], + class: "p5", + module: "3D", + }, + resetShader: { + name: "resetShader", + class: "p5", + module: "3D", + }, + texture: { + name: "texture", + params: [ + { + name: "tex", + description: "

                image to use as texture

                \n", + type: "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", + }, + ], + class: "p5", + module: "3D", + }, + textureMode: { + name: "textureMode", + params: [ + { + name: "mode", + description: "

                either IMAGE or NORMAL

                \n", + type: "Constant", + }, + ], + class: "p5", + module: "3D", + }, + 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: true, + }, + ], + class: "p5", + module: "3D", + }, + normalMaterial: { + name: "normalMaterial", + class: "p5", + module: "3D", + }, + ambientMaterial: { + name: "ambientMaterial", + class: "p5", + module: "3D", + overloads: [ + { + params: [ + { + name: "v1", + description: + "

                red or hue value relative to the current\n color range

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green or saturation value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue or brightness value relative to the\n current color range

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "gray", + description: + "

                number specifying value between\n white and black

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color,\n as an array, or as a CSS string

                \n', + type: "p5.Color|Number[]|String", + }, + ], + chainable: 1, + }, + ], + }, + emissiveMaterial: { + name: "emissiveMaterial", + class: "p5", + module: "3D", + overloads: [ + { + params: [ + { + name: "v1", + description: + "

                red or hue value relative to the current\n color range

                \n", + type: "Number", + }, + { + name: "v2", + description: + "

                green or saturation value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "v3", + description: + "

                blue or brightness value relative to the\n current color range

                \n", + type: "Number", + }, + { + name: "alpha", + description: + "

                alpha value relative to current color\n range (default is 0-255)

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "gray", + description: + "

                number specifying value between\n white and black

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color,\n as an array, or as a CSS string

                \n', + type: "p5.Color|Number[]|String", + }, + ], + chainable: 1, + }, + ], + }, + specularMaterial: { + name: "specularMaterial", + class: "p5", + module: "3D", + 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: true, + }, + ], + 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: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "color", + description: + '

                color as a p5.Color,\n as an array, or as a CSS string

                \n', + type: "p5.Color|Number[]|String", + }, + ], + chainable: 1, + }, + ], + }, + shininess: { + name: "shininess", + params: [ + { + name: "shine", + description: "

                degree of shininess

                \n", + type: "Number", + }, + ], + class: "p5", + module: "3D", + }, + camera: { + name: "camera", + params: [ + { + name: "x", + description: "

                camera position value on x axis

                \n", + type: "Number", + optional: true, + }, + { + name: "y", + description: "

                camera position value on y axis

                \n", + type: "Number", + optional: true, + }, + { + name: "z", + description: "

                camera position value on z axis

                \n", + type: "Number", + optional: true, + }, + { + name: "centerX", + description: + "

                x coordinate representing center of the sketch

                \n", + type: "Number", + optional: true, + }, + { + name: "centerY", + description: + "

                y coordinate representing center of the sketch

                \n", + type: "Number", + optional: true, + }, + { + name: "centerZ", + description: + "

                z coordinate representing center of the sketch

                \n", + type: "Number", + optional: true, + }, + { + name: "upX", + description: + "

                x component of direction 'up' from camera

                \n", + type: "Number", + optional: true, + }, + { + name: "upY", + description: + "

                y component of direction 'up' from camera

                \n", + type: "Number", + optional: true, + }, + { + name: "upZ", + description: + "

                z component of direction 'up' from camera

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "3D", + }, + 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: true, + }, + { + name: "aspect", + description: "

                camera frustum aspect ratio

                \n", + type: "Number", + optional: true, + }, + { + name: "near", + description: "

                frustum near plane length

                \n", + type: "Number", + optional: true, + }, + { + name: "far", + description: "

                frustum far plane length

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "3D", + }, + ortho: { + name: "ortho", + params: [ + { + name: "left", + description: "

                camera frustum left plane

                \n", + type: "Number", + optional: true, + }, + { + name: "right", + description: "

                camera frustum right plane

                \n", + type: "Number", + optional: true, + }, + { + name: "bottom", + description: "

                camera frustum bottom plane

                \n", + type: "Number", + optional: true, + }, + { + name: "top", + description: "

                camera frustum top plane

                \n", + type: "Number", + optional: true, + }, + { + name: "near", + description: "

                camera frustum near plane

                \n", + type: "Number", + optional: true, + }, + { + name: "far", + description: "

                camera frustum far plane

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "3D", + }, + frustum: { + name: "frustum", + params: [ + { + name: "left", + description: "

                camera frustum left plane

                \n", + type: "Number", + optional: true, + }, + { + name: "right", + description: "

                camera frustum right plane

                \n", + type: "Number", + optional: true, + }, + { + name: "bottom", + description: "

                camera frustum bottom plane

                \n", + type: "Number", + optional: true, + }, + { + name: "top", + description: "

                camera frustum top plane

                \n", + type: "Number", + optional: true, + }, + { + name: "near", + description: "

                camera frustum near plane

                \n", + type: "Number", + optional: true, + }, + { + name: "far", + description: "

                camera frustum far plane

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "3D", + }, + createCamera: { + name: "createCamera", + class: "p5", + module: "3D", + }, + setCamera: { + name: "setCamera", + params: [ + { + name: "cam", + description: "

                p5.Camera object

                \n", + type: "p5.Camera", + }, + ], + class: "p5", + module: "3D", + }, + vertexNormal: { + name: "vertexNormal", + params: [ + { + name: "x", + description: "", + type: "Number", + }, + { + name: "y", + description: "", + type: "Number", + }, + { + name: "z", + description: "", + type: "Number", + }, + { + name: "v", + description: "", + type: "Vector", + }, + ], + class: "p5", + module: "Shape", + }, + 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", + }, + ], + }, + ], + }, + getAudioContext: { + name: "getAudioContext", + class: "p5", + module: "p5.sound", + }, + userStartAudio: { + params: [ + { + name: "elements", + 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: true, + }, + { + name: "callback", + description: + "

                Callback to invoke when the AudioContext\n has started

                \n", + type: "Function", + optional: true, + }, + ], + name: "userStartAudio", + class: "p5", + module: "p5.sound", + }, + getOutputVolume: { + name: "getOutputVolume", + class: "p5", + module: "p5.sound", + }, + outputVolume: { + name: "outputVolume", + 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: true, + }, + { + name: "timeFromNow", + description: + "

                Schedule this event to happen at\n t seconds in the future

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5", + module: "p5.sound", + }, + soundOut: { + name: "soundOut", + class: "p5", + module: "p5.sound", + }, + 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: true, + multiple: true, + }, + ], + 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", + }, + 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: true, + }, + { + name: "errorCallback", + description: + "

                Name of a function to call if there is\n an error loading the file.

                \n", + type: "Function", + optional: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + ], + 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", + }, + }, + "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: true, + }, + ], + 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", + }, + width: { + name: "width", + class: "p5.Element", + module: "DOM", + }, + height: { + name: "height", + class: "p5.Element", + module: "DOM", + }, + parent: { + name: "parent", + class: "p5.Element", + module: "DOM", + overloads: [ + { + params: [ + { + name: "parent", + description: + '

                ID, p5.Element,\n or HTMLElement 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 call when the mouse is\n pressed over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + doubleClicked: { + name: "doubleClicked", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse is\n double clicked over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + mouseWheel: { + name: "mouseWheel", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse wheel is\n scrolled over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + mouseReleased: { + name: "mouseReleased", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse is\n pressed over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + mouseClicked: { + name: "mouseClicked", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse is\n pressed and released over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + mouseMoved: { + name: "mouseMoved", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse\n moves over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + mouseOver: { + name: "mouseOver", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse\n moves onto the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + mouseOut: { + name: "mouseOut", + params: [ + { + name: "fxn", + description: + "

                function to call when the mouse\n moves off the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + touchStarted: { + name: "touchStarted", + params: [ + { + name: "fxn", + description: + "

                function to call when the touch\n starts.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + touchMoved: { + name: "touchMoved", + params: [ + { + name: "fxn", + description: + "

                function to call when the touch\n moves over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + touchEnded: { + name: "touchEnded", + params: [ + { + name: "fxn", + description: + "

                function to call when the touch\n ends.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + dragOver: { + name: "dragOver", + params: [ + { + name: "fxn", + description: + "

                function to call when the file is\n dragged over the element.\n false disables the function.

                \n", + type: "Function|Boolean", + }, + ], + class: "p5.Element", + module: "DOM", + }, + dragLeave: { + name: "dragLeave", + params: [ + { + name: "fxn", + description: + "

                function to call when the file is\n dragged off the element.\n false disables the function.

                \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: true, + }, + ], + chainable: 1, + }, + ], + }, + center: { + name: "center", + params: [ + { + name: "align", + description: + "

                passing 'vertical', 'horizontal' aligns element accordingly

                \n", + type: "String", + optional: true, + }, + ], + 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: true, + }, + { + name: "append", + description: + "

                whether to append HTML to existing

                \n", + type: "Boolean", + optional: true, + }, + ], + 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: true, + }, + { + name: "y", + description: + "

                y-position relative to upper left of window (optional)

                \n", + type: "Number", + optional: true, + }, + { + name: "positionType", + description: + "

                it can be static, fixed, relative, sticky, initial or inherit (optional)

                \n", + type: "String", + optional: true, + }, + ], + chainable: 1, + }, + ], + }, + style: { + name: "style", + class: "p5.Element", + module: "DOM", + overloads: [ + { + params: [ + { + name: "property", + description: "

                style property to set.

                \n", + type: "String", + }, + ], + }, + { + params: [ + { + name: "property", + description: "", + type: "String", + }, + { + name: "value", + description: + "

                value to assign to the 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 the 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: true, + }, + ], + chainable: 1, + }, + ], + }, + remove: { + name: "remove", + class: "p5.Element", + module: "DOM", + }, + drop: { + name: "drop", + params: [ + { + name: "callback", + description: + "

                called when a file loads. Called once for each file dropped.

                \n", + type: "Function", + }, + { + name: "fxn", + description: + "

                called once when any files are dropped.

                \n", + type: "Function", + optional: true, + }, + ], + class: "p5.Element", + module: "DOM", + }, + draggable: { + name: "draggable", + params: [ + { + name: "elmnt", + description: "

                pass another p5.Element

                \n", + type: "p5.Element", + optional: true, + }, + ], + class: "p5.Element", + module: "DOM", + }, + }, + "p5.Graphics": { + reset: { + name: "reset", + class: "p5.Graphics", + module: "Rendering", + }, + remove: { + name: "remove", + class: "p5.Graphics", + module: "Rendering", + }, + createFramebuffer: { + name: "createFramebuffer", + 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", + optional: true, + }, + ], + 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 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 playback ends.\n The p5.MediaElement is passed as\n the argument.

                \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: + "

                cue time to run the callback function.

                \n", + type: "Number", + }, + { + name: "callback", + description: "

                function to call at the cue time.

                \n", + type: "Function", + }, + { + name: "value", + description: + "

                object to pass as the argument to\n callback.

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5.MediaElement", + module: "DOM", + }, + removeCue: { + name: "removeCue", + params: [ + { + name: "id", + description: + "

                ID of the cue, created by media.addCue().

                \n", + type: "Number", + }, + ], + class: "p5.MediaElement", + module: "DOM", + }, + clearCues: { + name: "clearCues", + 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", + }, + pixelDensity: { + name: "pixelDensity", + params: [ + { + name: "density", + description: + "

                A scaling factor for the number of pixels per\nside

                \n", + type: "Number", + optional: true, + }, + ], + 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-coordinate of the upper-left corner\n of the subsection to update.

                \n", + type: "Integer", + }, + { + name: "y", + description: + "

                y-coordinate of the upper-left corner\n of the subsection to update.

                \n", + type: "Integer", + }, + { + name: "w", + description: + "

                width of the subsection to update.

                \n", + type: "Integer", + }, + { + name: "h", + description: + "

                height of the subsection to update.

                \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 of the subsection to be returned.

                \n", + type: "Number", + }, + { + name: "h", + description: + "

                height of the subsection to be returned.

                \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 p5.Color object |\n p5.Image to copy.

                \n', + type: "Number|Number[]|Object", + }, + ], + class: "p5.Image", + module: "Image", + }, + resize: { + name: "resize", + params: [ + { + name: "width", + description: "

                resized image width.

                \n", + type: "Number", + }, + { + name: "height", + description: "

                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, ERODE, DILATE or BLUR.

                \n", + type: "Constant", + }, + { + name: "filterParam", + description: "

                parameter unique to each filter.

                \n", + type: "Number", + optional: true, + }, + ], + 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.

                \n

                Available 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

                \n

                http://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: "

                filename. Defaults to 'untitled'.

                \n", + type: "String", + }, + { + name: "extension", + description: + "

                file extension, either 'png' or 'jpg'.\n Defaults to 'png'.

                \n", + type: "String", + optional: true, + }, + ], + 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: "

                index of the frame to display.

                \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: + "

                delay in milliseconds between switching frames.

                \n", + type: "Number", + }, + { + name: "index", + description: + "

                index of the frame that will have its delay modified.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + class: "p5.Table", + module: "IO", + }, + trim: { + name: "trim", + params: [ + { + name: "column", + description: + "

                Column ID (number)\n or name (string)

                \n", + type: "String|Integer", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: "

                x component of the vector.

                \n", + type: "Number", + optional: true, + }, + { + name: "y", + description: "

                y component of the vector.

                \n", + type: "Number", + optional: true, + }, + { + name: "z", + description: "

                z component of the vector.

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "value", + description: "

                vector to set.

                \n", + type: "p5.Vector|Number[]", + }, + ], + chainable: 1, + }, + ], + }, + copy: { + name: "copy", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [], + }, + { + params: [ + { + name: "v", + description: + '

                the p5.Vector to create a copy of

                \n', + type: "p5.Vector", + }, + ], + static: 1, + }, + ], + }, + add: { + name: "add", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "x", + description: + "

                x component of the vector to be added.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                y component of the vector to be added.

                \n", + type: "Number", + optional: true, + }, + { + name: "z", + description: + "

                z component of the vector to be added.

                \n", + type: "Number", + optional: true, + }, + ], + 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: "

                vector to receive the result.

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + rem: { + name: "rem", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "x", + description: "

                x component of divisor vector.

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y component of divisor vector.

                \n", + type: "Number", + }, + { + name: "z", + description: "

                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: + '

                The dividend p5.Vector

                \n', + type: "p5.Vector", + }, + { + name: "v2", + description: + '

                The 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: + "

                x component of the vector to subtract.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                y component of the vector to subtract.

                \n", + type: "Number", + optional: true, + }, + { + name: "z", + description: + "

                z component of the vector to subtract.

                \n", + type: "Number", + optional: true, + }, + ], + 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: "

                vector to receive the result.

                \n", + type: "p5.Vector", + optional: true, + }, + ], + 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: + "

                number to multiply with the x component of the vector.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                number to multiply with the y component of the vector.

                \n", + type: "Number", + }, + { + name: "z", + description: + "

                number to multiply with the z component of the vector.

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "arr", + description: + "

                array to multiply with the components of the vector.

                \n", + type: "Number[]", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v", + description: + "

                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: true, + }, + ], + static: 1, + }, + { + params: [ + { + name: "v", + description: "", + type: "p5.Vector", + }, + { + name: "n", + description: "", + type: "Number", + }, + { + name: "target", + description: "

                vector to receive the result.

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + { + params: [ + { + name: "v0", + description: "", + type: "p5.Vector", + }, + { + name: "v1", + description: "", + type: "p5.Vector", + }, + { + name: "target", + description: "", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + { + params: [ + { + name: "v0", + description: "", + type: "p5.Vector", + }, + { + name: "arr", + description: "", + type: "Number[]", + }, + { + name: "target", + description: "", + type: "p5.Vector", + optional: true, + }, + ], + 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: + "

                number to divide with the x component of the vector.

                \n", + type: "Number", + }, + { + name: "y", + description: + "

                number to divide with the y component of the vector.

                \n", + type: "Number", + }, + { + name: "z", + description: + "

                number to divide with the z component of the vector.

                \n", + type: "Number", + optional: true, + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "arr", + description: + "

                array to divide the components of the vector by.

                \n", + type: "Number[]", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v", + description: + "

                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: true, + }, + ], + static: 1, + }, + { + params: [ + { + name: "v", + description: "", + type: "p5.Vector", + }, + { + name: "n", + description: "", + type: "Number", + }, + { + name: "target", + description: + "

                The vector to receive the result

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + { + params: [ + { + name: "v0", + description: "", + type: "p5.Vector", + }, + { + name: "v1", + description: "", + type: "p5.Vector", + }, + { + name: "target", + description: "", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + { + params: [ + { + name: "v0", + description: "", + type: "p5.Vector", + }, + { + name: "arr", + description: "", + type: "Number[]", + }, + { + name: "target", + description: "", + type: "p5.Vector", + optional: true, + }, + ], + 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", + overloads: [ + { + params: [], + }, + { + params: [ + { + name: "vecT", + description: + "

                the vector to return the squared magnitude of

                \n", + type: "p5.Vector", + }, + ], + static: 1, + }, + ], + }, + 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: true, + }, + { + name: "z", + description: "

                z component of the vector.

                \n", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "v", + description: + '

                p5.Vector to be dotted.

                \n', + type: "p5.Vector", + }, + ], + }, + { + params: [ + { + name: "v1", + description: + '

                first p5.Vector.

                \n', + type: "p5.Vector", + }, + { + name: "v2", + description: + '

                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: + '

                first p5.Vector.

                \n', + type: "p5.Vector", + }, + { + name: "v2", + description: + '

                second p5.Vector.

                \n', + type: "p5.Vector", + }, + ], + static: 1, + }, + ], + }, + dist: { + name: "dist", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "v", + description: + '

                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", + overloads: [ + { + params: [], + }, + { + params: [ + { + name: "v", + description: "

                The vector to normalize

                \n", + type: "p5.Vector", + }, + { + name: "target", + description: + "

                The vector to receive the result

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + limit: { + name: "limit", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "max", + description: + "

                maximum magnitude for the vector.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v", + description: "

                the vector to limit

                \n", + type: "p5.Vector", + }, + { + name: "max", + description: "", + type: "Number", + }, + { + name: "target", + description: + "

                the vector to receive the result (Optional)

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + setMag: { + name: "setMag", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "len", + description: "

                new length for this vector.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v", + description: + "

                the vector to set the magnitude of

                \n", + type: "p5.Vector", + }, + { + name: "len", + description: "", + type: "Number", + }, + { + name: "target", + description: + "

                the vector to receive the result (Optional)

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + heading: { + name: "heading", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [], + }, + { + params: [ + { + name: "v", + description: "

                the vector to find the angle of

                \n", + type: "p5.Vector", + }, + ], + static: 1, + }, + ], + }, + setHeading: { + name: "setHeading", + params: [ + { + name: "angle", + description: "

                angle of rotation.

                \n", + type: "Number", + }, + ], + class: "p5.Vector", + module: "Math", + }, + rotate: { + name: "rotate", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "angle", + description: "

                angle of rotation.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v", + description: "", + type: "p5.Vector", + }, + { + name: "angle", + description: "", + type: "Number", + }, + { + name: "target", + description: + "

                The vector to receive the result

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + angleBetween: { + name: "angleBetween", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "value", + description: + '

                x, y, and z components of a p5.Vector.

                \n', + type: "p5.Vector", + }, + ], + }, + { + params: [ + { + name: "v1", + description: "

                the first vector.

                \n", + type: "p5.Vector", + }, + { + name: "v2", + description: "

                the second vector.

                \n", + type: "p5.Vector", + }, + ], + static: 1, + }, + ], + }, + lerp: { + name: "lerp", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "x", + description: "

                x component.

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y component.

                \n", + type: "Number", + }, + { + name: "z", + description: "

                z component.

                \n", + type: "Number", + }, + { + name: "amt", + description: + "

                amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

                \n", + type: "Number", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "v", + description: + '

                p5.Vector to lerp toward.

                \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

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + slerp: { + name: "slerp", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "v", + description: + '

                p5.Vector to slerp toward.

                \n', + type: "p5.Vector", + }, + { + name: "amt", + description: + "

                amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

                \n", + type: "Number", + }, + ], + }, + { + params: [ + { + name: "v1", + description: "

                old vector.

                \n", + type: "p5.Vector", + }, + { + name: "v2", + description: "

                new vector.

                \n", + type: "p5.Vector", + }, + { + name: "amt", + description: "", + type: "Number", + }, + { + name: "target", + description: "

                vector to receive the result.

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + reflect: { + name: "reflect", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "surfaceNormal", + description: + '

                p5.Vector\n to reflect about.

                \n', + type: "p5.Vector", + }, + ], + chainable: 1, + }, + { + params: [ + { + name: "incidentVector", + description: "

                vector to be reflected.

                \n", + type: "p5.Vector", + }, + { + name: "surfaceNormal", + description: "", + type: "p5.Vector", + }, + { + name: "target", + description: "

                vector to receive the result.

                \n", + type: "p5.Vector", + optional: true, + }, + ], + static: 1, + }, + ], + }, + array: { + name: "array", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [], + }, + { + params: [ + { + name: "v", + description: + "

                the vector to convert to an array

                \n", + type: "p5.Vector", + }, + ], + static: 1, + }, + ], + }, + equals: { + name: "equals", + class: "p5.Vector", + module: "Math", + overloads: [ + { + params: [ + { + name: "x", + description: "

                x component of the vector.

                \n", + type: "Number", + optional: true, + }, + { + name: "y", + description: "

                y component of the vector.

                \n", + type: "Number", + optional: true, + }, + { + name: "z", + description: "

                z component of the vector.

                \n", + type: "Number", + optional: true, + }, + ], + }, + { + params: [ + { + name: "value", + description: "

                vector to compare.

                \n", + type: "p5.Vector|Array", + }, + ], + }, + { + params: [ + { + name: "v1", + description: "

                the first vector to compare

                \n", + type: "p5.Vector|Array", + }, + { + name: "v2", + description: "

                the second vector to compare

                \n", + type: "p5.Vector|Array", + }, + ], + static: 1, + }, + ], + }, + fromAngle: { + name: "fromAngle", + params: [ + { + name: "angle", + description: + '

                desired angle, in radians. Unaffected by angleMode().

                \n', + type: "Number", + }, + { + name: "length", + description: + "

                length of the new vector (defaults to 1).

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Vector", + module: "Math", + }, + fromAngles: { + name: "fromAngles", + params: [ + { + name: "theta", + description: + "

                polar angle in radians (zero is up).

                \n", + type: "Number", + }, + { + name: "phi", + description: + "

                azimuthal angle in radians\n (zero is out of the screen).

                \n", + type: "Number", + }, + { + name: "length", + description: + "

                length of the new vector (defaults to 1).

                \n", + type: "Number", + optional: true, + }, + ], + 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: "str", + description: "

                string of text.

                \n", + type: "String", + }, + { + name: "x", + description: "

                x-coordinate of the text.

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y-coordinate of the text.

                \n", + type: "Number", + }, + { + name: "fontSize", + description: + '

                font size. Defaults to the current\n textSize().

                \n', + type: "Number", + optional: true, + }, + ], + class: "p5.Font", + module: "Typography", + }, + textToPoints: { + name: "textToPoints", + params: [ + { + name: "str", + description: "

                string of text.

                \n", + type: "String", + }, + { + name: "x", + description: "

                x-coordinate of the text.

                \n", + type: "Number", + }, + { + name: "y", + description: "

                y-coordinate of the text.

                \n", + type: "Number", + }, + { + name: "fontSize", + description: + '

                font size. Defaults to the current\n textSize().

                \n', + type: "Number", + optional: true, + }, + { + name: "options", + description: + "

                object with sampleFactor and simplifyThreshold\n properties.

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5.Font", + module: "Typography", + }, + }, + "p5.Camera": { + eyeX: { + name: "eyeX", + class: "p5.Camera", + module: "3D", + }, + eyeY: { + name: "eyeY", + class: "p5.Camera", + module: "3D", + }, + eyeZ: { + name: "eyeZ", + class: "p5.Camera", + module: "3D", + }, + centerX: { + name: "centerX", + class: "p5.Camera", + module: "3D", + }, + centerY: { + name: "centerY", + class: "p5.Camera", + module: "3D", + }, + centerZ: { + name: "centerZ", + class: "p5.Camera", + module: "3D", + }, + upX: { + name: "upX", + class: "p5.Camera", + module: "3D", + }, + upY: { + name: "upY", + class: "p5.Camera", + module: "3D", + }, + upZ: { + name: "upZ", + class: "p5.Camera", + module: "3D", + }, + perspective: { + name: "perspective", + class: "p5.Camera", + module: "3D", + }, + ortho: { + name: "ortho", + class: "p5.Camera", + module: "3D", + }, + frustum: { + name: "frustum", + class: "p5.Camera", + module: "3D", + }, + 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: "3D", + }, + 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: "3D", + }, + 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: "3D", + }, + camera: { + name: "camera", + class: "p5.Camera", + module: "3D", + }, + 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: "3D", + }, + 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: "3D", + }, + set: { + name: "set", + params: [ + { + name: "cam", + description: "

                source camera

                \n", + type: "p5.Camera", + }, + ], + class: "p5.Camera", + module: "3D", + }, + slerp: { + name: "slerp", + params: [ + { + name: "cam0", + description: "

                first p5.Camera

                \n", + type: "p5.Camera", + }, + { + name: "cam1", + description: "

                second p5.Camera

                \n", + type: "p5.Camera", + }, + { + name: "amt", + description: + "

                amount to use for interpolation during slerp

                \n", + type: "Number", + }, + ], + class: "p5.Camera", + module: "3D", + }, + }, + "p5.Framebuffer": { + pixels: { + name: "pixels", + class: "p5.Framebuffer", + module: "Rendering", + }, + resize: { + name: "resize", + params: [ + { + name: "width", + description: "", + type: "Number", + }, + { + name: "height", + description: "", + type: "Number", + }, + ], + class: "p5.Framebuffer", + module: "Rendering", + }, + pixelDensity: { + name: "pixelDensity", + params: [ + { + name: "density", + description: + "

                A scaling factor for the number of pixels per\nside of the framebuffer

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Framebuffer", + module: "Rendering", + }, + autoSized: { + name: "autoSized", + params: [ + { + name: "autoSized", + description: + "

                Whether or not the framebuffer should resize\nalong with the canvas it's attached to

                \n", + type: "Boolean", + optional: true, + }, + ], + class: "p5.Framebuffer", + module: "Rendering", + }, + createCamera: { + name: "createCamera", + class: "p5.Framebuffer", + module: "Rendering", + }, + remove: { + name: "remove", + class: "p5.Framebuffer", + module: "Rendering", + }, + begin: { + name: "begin", + class: "p5.Framebuffer", + module: "Rendering", + }, + end: { + name: "end", + class: "p5.Framebuffer", + module: "Rendering", + }, + draw: { + name: "draw", + params: [ + { + name: "callback", + description: + "

                A function to run that draws to the canvas. The\nfunction will immediately be run, but it will draw to the framebuffer\ninstead of the canvas.

                \n", + type: "Function", + }, + ], + class: "p5.Framebuffer", + module: "Rendering", + }, + get: { + name: "get", + class: "p5.Framebuffer", + module: "Rendering", + 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 of the section to be returned

                \n", + type: "Number", + }, + { + name: "h", + description: + "

                height of the section to be returned

                \n", + type: "Number", + }, + ], + }, + { + params: [], + }, + { + params: [ + { + name: "x", + description: "", + type: "Number", + }, + { + name: "y", + description: "", + type: "Number", + }, + ], + }, + ], + }, + color: { + name: "color", + class: "p5.Framebuffer", + module: "Rendering", + }, + depth: { + name: "depth", + class: "p5.Framebuffer", + module: "Rendering", + }, + }, + "p5.Geometry": { + clearColors: { + name: "clearColors", + class: "p5.Geometry", + module: "Shape", + }, + computeFaces: { + name: "computeFaces", + class: "p5.Geometry", + module: "Shape", + }, + computeNormals: { + name: "computeNormals", + params: [ + { + name: "shadingType", + description: + "

                shading type (FLAT for flat shading or SMOOTH for smooth shading) for buildGeometry() outputs. Defaults to FLAT.

                \n", + type: "String", + optional: true, + }, + { + name: "options", + description: + "

                An optional object with configuration.

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5.Geometry", + module: "Shape", + }, + averageNormals: { + name: "averageNormals", + class: "p5.Geometry", + module: "Shape", + }, + averagePoleNormals: { + name: "averagePoleNormals", + class: "p5.Geometry", + module: "Shape", + }, + normalize: { + name: "normalize", + class: "p5.Geometry", + module: "Shape", + }, + }, + "p5.Shader": { + copyToContext: { + name: "copyToContext", + params: [ + { + name: "context", + description: + "

                The graphic or instance to copy this shader to.\nPass window if you need to copy to the main canvas.

                \n", + type: "p5|p5.Graphics", + }, + ], + class: "p5.Shader", + module: "3D", + }, + setUniform: { + name: "setUniform", + params: [ + { + name: "uniformName", + description: + "

                the name of the uniform.\nMust correspond to the name used in the vertex and fragment shaders

                \n", + type: "String", + }, + { + name: "data", + description: + "

                the data to associate with the uniform. The type can be\na boolean (true/false), a number, an array of numbers, or\nan image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture)

                \n", + type: "Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture", + }, + ], + class: "p5.Shader", + module: "3D", + }, + }, + "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: true, + }, + { + name: "rate", + description: "

                (optional) playback rate

                \n", + type: "Number", + optional: true, + }, + { + name: "amp", + description: + "

                (optional) amplitude (volume)\n of playback

                \n", + type: "Number", + optional: true, + }, + { + name: "cueStart", + description: + "

                (optional) cue start time in seconds

                \n", + type: "Number", + optional: true, + }, + { + name: "duration", + description: + "

                (optional) duration of playback in seconds

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + name: "rate", + description: "

                (optional) playback rate

                \n", + type: "Number", + optional: true, + }, + { + name: "amp", + description: "

                (optional) playback volume

                \n", + type: "Number", + optional: true, + }, + { + name: "cueLoopStart", + description: "

                (optional) startTime in seconds

                \n", + type: "Number", + optional: true, + }, + { + name: "duration", + description: "

                (optional) loop duration in seconds

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + class: "p5.SoundFile", + module: "p5.sound", + }, + pan: { + name: "pan", + params: [ + { + name: "panValue", + description: "

                Set the stereo panner

                \n", + type: "Number", + optional: true, + }, + { + name: "timeFromNow", + description: + "

                schedule this event to happen\n seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + name: "timeFromNow", + description: + "

                Schedule this event to happen at\n t seconds in the future

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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", + }, + 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: true, + }, + ], + 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: true, + }, + ], + 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 main output)

                \n", + type: "SoundObject|undefined", + optional: true, + }, + { + name: "smoothing", + description: + "

                a range between 0.0 and 1.0\n to smooth amplitude readings

                \n", + type: "Number|undefined", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + ], + 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.Oscillator": { + start: { + name: "start", + params: [ + { + name: "time", + description: "

                startTime in seconds from now.

                \n", + type: "Number", + optional: true, + }, + { + name: "frequency", + description: "

                frequency in Hz.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "timeFromNow", + description: + "

                schedule this event to happen\n seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Oscillator", + module: "p5.sound", + }, + getAmp: { + name: "getAmp", + 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: true, + }, + { + name: "timeFromNow", + description: + "

                Schedule this event to happen\n at x seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Oscillator", + module: "p5.sound", + }, + getFreq: { + name: "getFreq", + 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", + }, + getType: { + name: "getType", + 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", + }, + getPan: { + name: "getPan", + 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.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: true, + }, + { + 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: true, + }, + { + name: "releaseTime", + description: + "

                Time in seconds from now (defaults to 0)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + multiple: true, + }, + ], + 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: true, + }, + { + name: "sustainTime", + description: + "

                time to sustain before releasing the envelope

                \n", + type: "Number", + optional: true, + }, + ], + 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

                \n", + type: "Number", + optional: true, + }, + ], + 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.Noise": { + setType: { + name: "setType", + params: [ + { + name: "type", + description: "

                'white', 'pink' or 'brown'

                \n", + type: "String", + optional: true, + }, + ], + class: "p5.Noise", + 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: true, + }, + ], + class: "p5.Pulse", + 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: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + name: "errorCallback", + description: + "

                This optional callback receives the error\n message as its argument.

                \n", + type: "Function", + optional: true, + }, + ], + 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.Effect": { + amp: { + name: "amp", + params: [ + { + name: "vol", + description: "

                amplitude between 0 and 1.0

                \n", + type: "Number", + optional: true, + }, + { + name: "rampTime", + description: + "

                create a fade that lasts until rampTime

                \n", + type: "Number", + optional: true, + }, + { + name: "tFromNow", + description: + "

                schedule this event to happen in tFromNow seconds

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Effect", + module: "p5.sound", + }, + chain: { + name: "chain", + params: [ + { + name: "arguments", + description: + "

                Chain together multiple sound objects

                \n", + type: "Object", + optional: true, + }, + ], + class: "p5.Effect", + module: "p5.sound", + }, + drywet: { + name: "drywet", + params: [ + { + name: "fade", + description: "

                The desired drywet value (0 - 1.0)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "res", + description: + "

                Resonance/Width of the filter frequency\n from 0.001 to 1000

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Filter", + module: "p5.sound", + }, + set: { + name: "set", + params: [ + { + name: "freq", + description: "

                Frequency in Hz, from 10 to 22050

                \n", + type: "Number", + optional: true, + }, + { + name: "res", + description: "

                Resonance (Q) from 0.001 to 1000

                \n", + type: "Number", + optional: true, + }, + { + name: "timeFromNow", + description: + "

                schedule this event to happen\n seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + 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.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: true, + }, + { + name: "rolloffFactor", + description: "", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "feedback", + description: + "

                sends the delay back through itself\n in a loop that decreases in volume\n each time.

                \n", + type: "Number", + optional: true, + }, + { + name: "lowPass", + description: + "

                Cutoff frequency. Only frequencies\n below the lowPass will be part of the\n delay.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "timeFromNow", + description: + "

                schedule this event to happen\n seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "decayRate", + description: + "

                Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

                \n", + type: "Number", + optional: true, + }, + { + name: "reverse", + description: + "

                Play the reverb backwards or forwards.

                \n", + type: "Boolean", + optional: true, + }, + ], + 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: true, + }, + { + name: "decayRate", + description: + "

                Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

                \n", + type: "Number", + optional: true, + }, + { + name: "reverse", + description: + "

                Play the reverb backwards or forwards.

                \n", + type: "Boolean", + optional: true, + }, + ], + 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: true, + }, + { + name: "timeFromNow", + description: + "

                schedule this event to happen\n seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + 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", + }, + impulses: { + name: "impulses", + 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", + }, + 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: true, + }, + ], + 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: true, + }, + ], + class: "p5.Part", + module: "p5.sound", + }, + loop: { + name: "loop", + params: [ + { + name: "time", + description: "

                seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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": { + 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", + }, + 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: true, + }, + ], + class: "p5.SoundLoop", + module: "p5.sound", + }, + stop: { + name: "stop", + params: [ + { + name: "timeFromNow", + description: "

                schedule a stopping time

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.SoundLoop", + module: "p5.sound", + }, + pause: { + name: "pause", + params: [ + { + name: "timeFromNow", + description: "

                schedule a pausing time

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + { + 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: true, + }, + { + name: "threshold", + description: + "

                The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0

                \n", + type: "Number", + optional: true, + }, + { + 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: true, + }, + ], + 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: true, + }, + { + name: "time", + description: + "

                Assign time value to schedule the change in value

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "time", + description: + "

                Assign time value to schedule the change in value

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "time", + description: + "

                Assign time value to schedule the change in value

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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: true, + }, + ], + class: "p5.Compressor", + module: "p5.sound", + }, + reduction: { + name: "reduction", + class: "p5.Compressor", + 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: true, + }, + ], + class: "p5.PeakDetect", + 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: true, + }, + ], + 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: true, + }, + { + name: "callback", + description: + "

                The name of a function that will be\n called once the recording completes

                \n", + type: "Function", + optional: true, + }, + ], + class: "p5.SoundRecorder", + module: "p5.sound", + }, + stop: { + name: "stop", + class: "p5.SoundRecorder", + 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: true, + optdefault: "0.25", + }, + { + name: "oversample", + description: "

                'none', '2x', or '4x'.

                \n", + type: "String", + optional: true, + 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: true, + optdefault: "0.25", + }, + { + name: "oversample", + description: "

                'none', '2x', or '4x'.

                \n", + type: "String", + optional: true, + 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", + }, + }, + "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: true, + }, + { + name: "timeFromNow", + description: + "

                schedule this event to happen\n seconds from now

                \n", + type: "Number", + optional: true, + }, + ], + class: "p5.Gain", + 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.MonoSynth": { + 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", + }, + 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: true, + }, + { + name: "secondsFromNow", + description: + "

                time from now (in seconds) at which to play

                \n", + type: "Number", + optional: true, + }, + { + name: "sustainTime", + description: + "

                time to sustain before releasing the envelope. Defaults to 0.15 seconds.

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "secondsFromNow", + description: + "

                time from now (in seconds) at which to play

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + 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: true, + }, + { + name: "releaseTime", + description: + "

                Time in seconds from now (defaults to 0)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + ], + 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.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: true, + }, + { + name: "velocity", + description: + "

                velocity of the note to play (ranging from 0 to 1)

                \n", + type: "Number", + optional: true, + }, + { + name: "secondsFromNow", + description: + "

                time from now (in seconds) at which to play

                \n", + type: "Number", + optional: true, + }, + { + name: "sustainTime", + description: + "

                time to sustain before releasing the envelope

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "attackTime", + description: + "

                Time (in seconds before envelope\n reaches Attack Level

                \n", + type: "Number", + optional: true, + }, + { + name: "decayTime", + description: + "

                Time (in seconds) before envelope\n reaches Decay/Sustain Level

                \n", + type: "Number", + optional: true, + }, + { + 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: true, + }, + { + name: "releaseTime", + description: + "

                Time in seconds from now (defaults to 0)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "decayTime", + description: + "

                Time (in seconds) before envelope\n reaches Decay/Sustain Level

                \n", + type: "Number", + optional: true, + }, + { + 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: true, + }, + { + name: "releaseTime", + description: + "

                Time in seconds from now (defaults to 0)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "velocity", + description: + "

                velocity of the note to play (ranging from 0 to 1)/

                \n", + type: "Number", + optional: true, + }, + { + name: "secondsFromNow", + description: "

                time from now (in seconds)

                \n", + type: "Number", + optional: true, + }, + ], + 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: true, + }, + { + name: "secondsFromNow", + description: "

                time to trigger the release

                \n", + type: "Number", + optional: true, + }, + ], + 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", + }, + }, + }; + }, + {}, + ], + 2: [ + function (_dereq_, module, exports) { + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + module.exports = _arrayWithHoles; + }, + {}, + ], + 3: [ + function (_dereq_, module, exports) { + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } + module.exports = _arrayWithoutHoles; + }, + {}, + ], + 4: [ + function (_dereq_, module, exports) { + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + module.exports = _assertThisInitialized; + }, + {}, + ], + 5: [ + function (_dereq_, module, exports) { + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + module.exports = _classCallCheck; + }, + {}, + ], + 6: [ + function (_dereq_, module, exports) { + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + module.exports = _createClass; + }, + {}, + ], + 7: [ + function (_dereq_, module, exports) { + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true, + }); + } else { + obj[key] = value; + } + return obj; + } + module.exports = _defineProperty; + }, + {}, + ], + 8: [ + function (_dereq_, module, exports) { + function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + module.exports = _getPrototypeOf; + }, + {}, + ], + 9: [ + function (_dereq_, module, exports) { + var setPrototypeOf = _dereq_("./setPrototypeOf"); + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) setPrototypeOf(subClass, superClass); + } + module.exports = _inherits; + }, + { + "./setPrototypeOf": 16, + }, + ], + 10: [ + function (_dereq_, module, exports) { + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + module.exports = _iterableToArray; + }, + {}, + ], + 11: [ + function (_dereq_, module, exports) { + function _iterableToArrayLimit(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for ( + var _i = arr[Symbol.iterator](), _s; + !(_n = (_s = _i.next()).done); + _n = true + ) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + module.exports = _iterableToArrayLimit; + }, + {}, + ], + 12: [ + function (_dereq_, module, exports) { + function _nonIterableRest() { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance", + ); + } + module.exports = _nonIterableRest; + }, + {}, + ], + 13: [ + function (_dereq_, module, exports) { + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + module.exports = _nonIterableSpread; + }, + {}, + ], + 14: [ + function (_dereq_, module, exports) { + var defineProperty = _dereq_("./defineProperty"); + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + if (typeof Object.getOwnPropertySymbols === "function") { + ownKeys = ownKeys.concat( + Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym) + .enumerable; + }), + ); + } + ownKeys.forEach(function (key) { + defineProperty(target, key, source[key]); + }); + } + return target; + } + module.exports = _objectSpread; + }, + { + "./defineProperty": 7, + }, + ], + 15: [ + function (_dereq_, module, exports) { + var _typeof = _dereq_("../helpers/typeof"); + var assertThisInitialized = _dereq_("./assertThisInitialized"); + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return assertThisInitialized(self); + } + module.exports = _possibleConstructorReturn; + }, + { + "../helpers/typeof": 19, + "./assertThisInitialized": 4, + }, + ], + 16: [ + function (_dereq_, module, exports) { + function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + module.exports = _setPrototypeOf; + }, + {}, + ], + 17: [ + function (_dereq_, module, exports) { + var arrayWithHoles = _dereq_("./arrayWithHoles"); + var iterableToArrayLimit = _dereq_("./iterableToArrayLimit"); + var nonIterableRest = _dereq_("./nonIterableRest"); + function _slicedToArray(arr, i) { + return ( + arrayWithHoles(arr) || + iterableToArrayLimit(arr, i) || + nonIterableRest() + ); + } + module.exports = _slicedToArray; + }, + { + "./arrayWithHoles": 2, + "./iterableToArrayLimit": 11, + "./nonIterableRest": 12, + }, + ], + 18: [ + function (_dereq_, module, exports) { + var arrayWithoutHoles = _dereq_("./arrayWithoutHoles"); + var iterableToArray = _dereq_("./iterableToArray"); + var nonIterableSpread = _dereq_("./nonIterableSpread"); + function _toConsumableArray(arr) { + return ( + arrayWithoutHoles(arr) || + iterableToArray(arr) || + nonIterableSpread() + ); + } + module.exports = _toConsumableArray; + }, + { + "./arrayWithoutHoles": 3, + "./iterableToArray": 10, + "./nonIterableSpread": 13, + }, + ], + 19: [ + function (_dereq_, module, exports) { + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + module.exports = _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + module.exports = _typeof; + }, + {}, + ], + 20: [ + function (_dereq_, module, exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len = b64.length; + if (len % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + var validLen = b64.indexOf("="); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4); + return [validLen, placeHoldersLen]; + } // base64 is 4/3 + up to two characters of the original data + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = (tmp >> 16) & 255; + arr[curByte++] = (tmp >> 8) & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4); + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2); + arr[curByte++] = (tmp >> 8) & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return ( + lookup[(num >> 18) & 63] + + lookup[(num >> 12) & 63] + + lookup[(num >> 6) & 63] + + lookup[num & 63] + ); + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 16711680) + + ((uint8[i + 1] << 8) & 65280) + + (uint8[i + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + for ( + var i = 0, len2 = len - extraBytes; + i < len2; + i += maxChunkLength + ) { + parts.push( + encodeChunk( + uint8, + i, + i + maxChunkLength > len2 ? len2 : i + maxChunkLength, + ), + ); + } // pad the end with zeros, but make sure to not forget the extra bytes + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[(tmp << 4) & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 63] + + lookup[(tmp << 2) & 63] + + "=", + ); + } + return parts.join(""); + } + }, + {}, + ], + 21: [function (_dereq_, module, exports) {}, {}], + 22: [ + function (_dereq_, module, exports) { + (function (Buffer) { + /*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + /* eslint-disable no-proto */ + "use strict"; + var base64 = _dereq_("base64-js"); + var ieee754 = _dereq_("ieee754"); + var customInspectSymbol = + typeof Symbol === "function" && typeof Symbol.for === "function" + ? Symbol.for("nodejs.util.inspect.custom") + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if ( + !Buffer.TYPED_ARRAY_SUPPORT && + typeof console !== "undefined" && + typeof console.error === "function" + ) { + console.error( + "This browser lacks typed array (Uint8Array) support which is required by " + + "`buffer` v5.x. Use `buffer` v4.x if you require old browser support.", + ); + } + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function () { + return 42; + }, + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer.prototype, "parent", { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + }, + }); + Object.defineProperty(Buffer.prototype, "offset", { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + }, + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError( + 'The value "' + length + '" is invalid for option "size"', + ); + } // Return an augmented `Uint8Array` instance + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError( + 'The "string" argument must be of type string. Received type number', + ); + } + return allocUnsafe(arg); + } + return from(arg, encodingOrOffset, length); + } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + + if ( + typeof Symbol !== "undefined" && + Symbol.species != null && + Buffer[Symbol.species] === Buffer + ) { + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true, + enumerable: false, + writable: false, + }); + } + Buffer.poolSize = 8192; // not used by this implementation + function from(value, encodingOrOffset, length) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value); + } + if (value == null) { + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, " + + "or Array-like Object. Received type " + + typeof value, + ); + } + if ( + isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer)) + ) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === "number") { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number', + ); + } + var valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + var b = fromObject(value); + if (b) return b; + if ( + typeof Symbol !== "undefined" && + Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === "function" + ) { + return Buffer.from( + value[Symbol.toPrimitive]("string"), + encodingOrOffset, + length, + ); + } + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, " + + "or Array-like Object. Received type " + + typeof value, + ); + } /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError( + 'The value "' + size + '" is invalid for option "size"', + ); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === "string" + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill); + } + return createBuffer(size); + } /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + function fromString(string, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + var buf; + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== undefined) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError( + "Attempt to allocate Buffer larger than maximum " + + "size: 0x" + + K_MAX_LENGTH.toString(16) + + " bytes", + ); + } + return length | 0; + } + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + return Buffer.alloc(+length); + } + Buffer.isBuffer = function isBuffer(b) { + return ( + b != null && b._isBuffer === true && b !== Buffer.prototype + ); // so Buffer.isBuffer(Buffer.prototype) will be false + }; + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer.from(b, b.offset, b.byteLength); + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array', + ); + } + if (a === b) return 0; + var x = a.length; + var y = b.length; + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }; + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError( + '"list" argument must be an Array of Buffers', + ); + } + if (list.length === 0) { + return Buffer.alloc(0); + } + var i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + if (isInstance(buf, Uint8Array)) { + buf = Buffer.from(buf); + } + if (!Buffer.isBuffer(buf)) { + throw new TypeError( + '"list" argument must be an Array of Buffers', + ); + } + buf.copy(buffer, pos); + pos += buf.length; + } + return buffer; + }; + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + if ( + ArrayBuffer.isView(string) || + isInstance(string, ArrayBuffer) + ) { + return string.byteLength; + } + if (typeof string !== "string") { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + "Received type " + + typeof string, + ); + } + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; + // Use a for loop to avoid recursion + var loweredCase = false; + for (;;) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer.byteLength = byteLength; + function slowToString(encoding, start, end) { + var loweredCase = false; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + if (start > this.length) { + return ""; + } + if (end === undefined || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + Buffer.prototype._isBuffer = true; + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + if (len % 2 !== 0) { + throw new RangeError( + "Buffer size must be a multiple of 16-bits", + ); + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + if (len % 4 !== 0) { + throw new RangeError( + "Buffer size must be a multiple of 32-bits", + ); + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + if (len % 8 !== 0) { + throw new RangeError( + "Buffer size must be a multiple of 64-bits", + ); + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ""; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + Buffer.prototype.inspect = function inspect() { + var str = ""; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max) + .replace(/(.{2})/g, "$1 ") + .trim(); + if (this.length > max) str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + Buffer.prototype.compare = function compare( + target, + start, + end, + thisStart, + thisEnd, + ) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + "Received type " + + typeof target, + ); + } + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + if ( + start < 0 || + end > target.length || + thisStart < 0 || + thisEnd > this.length + ) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf( + buffer, + val, + byteOffset, + encoding, + dir, + ) { + // Empty buffer means no match + if (buffer.length === 0) return -1; + // Normalize byteOffset + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1; + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1; + } // Normalize val + + if (typeof val === "string") { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call( + buffer, + val, + byteOffset, + ); + } else { + return Uint8Array.prototype.lastIndexOf.call( + buffer, + val, + byteOffset, + ); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if ( + encoding === "ucs2" || + encoding === "ucs-2" || + encoding === "utf16le" || + encoding === "utf-16le" + ) { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + var i; + if (dir) { + var foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if ( + read(arr, i) === + read(val, foundIndex === -1 ? 0 : i - foundIndex) + ) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + var found = true; + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + if (found) return i; + } + } + return -1; + } + Buffer.prototype.includes = function includes( + val, + byteOffset, + encoding, + ) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer.prototype.indexOf = function indexOf( + val, + byteOffset, + encoding, + ) { + return bidirectionalIndexOf( + this, + val, + byteOffset, + encoding, + true, + ); + }; + Buffer.prototype.lastIndexOf = function lastIndexOf( + val, + byteOffset, + encoding, + ) { + return bidirectionalIndexOf( + this, + val, + byteOffset, + encoding, + false, + ); + }; + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + var strLen = string.length; + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string, offset, length) { + return blitBuffer( + utf8ToBytes(string, buf.length - offset), + buf, + offset, + length, + ); + } + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + function latin1Write(buf, string, offset, length) { + return asciiWrite(buf, string, offset, length); + } + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + function ucs2Write(buf, string, offset, length) { + return blitBuffer( + utf16leToBytes(string, buf.length - offset), + buf, + offset, + length, + ); + } + Buffer.prototype.write = function write( + string, + offset, + length, + encoding, + ) { + // Buffer#write(string) + if (offset === undefined) { + encoding = "utf8"; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === "string") { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = "utf8"; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error( + "Buffer.write(string, encoding, offset[, length]) is no longer supported", + ); + } + var remaining = this.length - offset; + if (length === undefined || length > remaining) + length = remaining; + if ( + (string.length > 0 && (length < 0 || offset < 0)) || + offset > this.length + ) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) encoding = "utf8"; + var loweredCase = false; + for (;;) { + switch (encoding) { + case "hex": + return hexWrite(this, string, offset, length); + case "utf8": + case "utf-8": + return utf8Write(this, string, offset, length); + case "ascii": + return asciiWrite(this, string, offset, length); + case "latin1": + case "binary": + return latin1Write(this, string, offset, length); + case "base64": + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string, offset, length); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0), + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = + firstByte > 239 + ? 4 + : firstByte > 223 + ? 3 + : firstByte > 191 + ? 2 + : 1; + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = + ((firstByte & 31) << 6) | (secondByte & 63); + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ( + (secondByte & 192) === 128 && + (thirdByte & 192) === 128 + ) { + tempCodePoint = + ((firstByte & 15) << 12) | + ((secondByte & 63) << 6) | + (thirdByte & 63); + if ( + tempCodePoint > 2047 && + (tempCodePoint < 55296 || tempCodePoint > 57343) + ) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ( + (secondByte & 192) === 128 && + (thirdByte & 192) === 128 && + (fourthByte & 192) === 128 + ) { + tempCodePoint = + ((firstByte & 15) << 18) | + ((secondByte & 63) << 12) | + ((thirdByte & 63) << 6) | + (fourthByte & 63); + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + // encode to utf16 (surrogate pair dance) + codePoint -= 65536; + res.push(((codePoint >>> 10) & 1023) | 55296); + codePoint = 56320 | (codePoint & 1023); + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + var res = ""; + var i = 0; + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, (i += MAX_ARGUMENTS_LENGTH)), + ); + } + return res; + } + function asciiSlice(buf, start, end) { + var ret = ""; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + var ret = ""; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ""; + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ""; + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + if (end < start) end = start; + var newBuf = this.subarray(start, end); + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer.prototype.readUIntLE = function readUIntLE( + offset, + byteLength, + noAssert, + ) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer.prototype.readUIntBE = function readUIntBE( + offset, + byteLength, + noAssert, + ) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + var val = this[offset + --byteLength]; + var mul = 1; + while (byteLength > 0 && (mul *= 256)) { + val += this[offset + --byteLength] * mul; + } + return val; + }; + Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer.prototype.readUInt16LE = function readUInt16LE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | (this[offset + 1] << 8); + }; + Buffer.prototype.readUInt16BE = function readUInt16BE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return (this[offset] << 8) | this[offset + 1]; + }; + Buffer.prototype.readUInt32LE = function readUInt32LE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ( + (this[offset] | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + this[offset + 3] * 16777216 + ); + }; + Buffer.prototype.readUInt32BE = function readUInt32BE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ( + this[offset] * 16777216 + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) + ); + }; + Buffer.prototype.readIntLE = function readIntLE( + offset, + byteLength, + noAssert, + ) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + Buffer.prototype.readIntBE = function readIntBE( + offset, + byteLength, + noAssert, + ) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer.prototype.readInt16LE = function readInt16LE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | (this[offset + 1] << 8); + return val & 32768 ? val | 4294901760 : val; + }; + Buffer.prototype.readInt16BE = function readInt16BE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | (this[offset] << 8); + return val & 32768 ? val | 4294901760 : val; + }; + Buffer.prototype.readInt32LE = function readInt32LE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ( + this[offset] | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) + ); + }; + Buffer.prototype.readInt32BE = function readInt32BE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ( + (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3] + ); + }; + Buffer.prototype.readFloatLE = function readFloatLE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer.prototype.readFloatBE = function readFloatBE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer.prototype.readDoubleLE = function readDoubleLE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer.prototype.readDoubleBE = function readDoubleBE( + offset, + noAssert, + ) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) + throw new TypeError( + '"buffer" argument must be a Buffer instance', + ); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer.prototype.writeUIntLE = function writeUIntLE( + value, + offset, + byteLength, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + var mul = 1; + var i = 0; + this[offset] = value & 255; + while (++i < byteLength && (mul *= 256)) { + this[offset + i] = (value / mul) & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeUIntBE = function writeUIntBE( + value, + offset, + byteLength, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = (value / mul) & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeUInt8 = function writeUInt8( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer.prototype.writeUInt16LE = function writeUInt16LE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer.prototype.writeUInt16BE = function writeUInt16BE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer.prototype.writeUInt32LE = function writeUInt32LE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer.prototype.writeUInt32BE = function writeUInt32BE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer.prototype.writeIntLE = function writeIntLE( + value, + offset, + byteLength, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 255; + while (++i < byteLength && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (((value / mul) >> 0) - sub) & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeIntBE = function writeIntBE( + value, + offset, + byteLength, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (((value / mul) >> 0) - sub) & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeInt8 = function writeInt8( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 127, -128); + if (value < 0) value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer.prototype.writeInt16LE = function writeInt16LE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer.prototype.writeInt16BE = function writeInt16BE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer.prototype.writeInt32LE = function writeInt32LE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer.prototype.writeInt32BE = function writeInt32BE( + value, + offset, + noAssert, + ) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754( + buf, + value, + offset, + 4, + 3.4028234663852886e38, + -3.4028234663852886e38, + ); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer.prototype.writeFloatLE = function writeFloatLE( + value, + offset, + noAssert, + ) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer.prototype.writeFloatBE = function writeFloatBE( + value, + offset, + noAssert, + ) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754( + buf, + value, + offset, + 8, + 1.7976931348623157e308, + -1.7976931348623157e308, + ); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer.prototype.writeDoubleLE = function writeDoubleLE( + value, + offset, + noAssert, + ) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer.prototype.writeDoubleBE = function writeDoubleBE( + value, + offset, + noAssert, + ) { + return writeDouble(this, value, offset, false, noAssert); + }; + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy( + target, + targetStart, + start, + end, + ) { + if (!Buffer.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + // Copy 0 bytes; we're done + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) throw new RangeError("sourceEnd out of bounds"); + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + var len = end - start; + if ( + this === target && + typeof Uint8Array.prototype.copyWithin === "function" + ) { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else if ( + this === target && + start < targetStart && + targetStart < end + ) { + // descending copy from end + for (var i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start]; + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart, + ); + } + return len; + }; + // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== undefined && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if ( + typeof encoding === "string" && + !Buffer.isEncoding(encoding) + ) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + var code = val.charCodeAt(0); + if ( + (encoding === "utf8" && code < 128) || + encoding === "latin1" + ) { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding); + var len = bytes.length; + if (len === 0) { + throw new TypeError( + 'The value "' + val + '" is invalid for argument "value"', + ); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + // HELPER FUNCTIONS + // ================ + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split("=")[0]; + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, ""); + // Node converts strings with length < 2 to '' + if (str.length < 2) return ""; + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + // is surrogate component + if (codePoint > 55295 && codePoint < 57344) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 56319) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(239, 191, 189); + continue; + } // valid lead + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + if (codePoint < 56320) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + codePoint = + (((leadSurrogate - 55296) << 10) | (codePoint - 56320)) + + 65536; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(239, 191, 189); + } + leadSurrogate = null; + // encode utf8 + if (codePoint < 128) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) break; + bytes.push((codePoint >> 6) | 192, (codePoint & 63) | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) break; + bytes.push( + (codePoint >> 12) | 224, + ((codePoint >> 6) & 63) | 128, + (codePoint & 63) | 128, + ); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) break; + bytes.push( + (codePoint >> 18) | 240, + ((codePoint >> 12) & 63) | 128, + ((codePoint >> 6) & 63) | 128, + (codePoint & 63) | 128, + ); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + function isInstance(obj, type) { + return ( + obj instanceof type || + (obj != null && + obj.constructor != null && + obj.constructor.name != null && + obj.constructor.name === type.name) + ); + } + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + var hexSliceLookupTable = (function () { + var alphabet = "0123456789abcdef"; + var table = new Array(256); + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + })(); + }).call(this, _dereq_("buffer").Buffer); + }, + { + "base64-js": 20, + buffer: 22, + ieee754: 268, + }, + ], + 23: [ + function (_dereq_, module, exports) { + module.exports = function (it) { + if (typeof it != "function") { + throw TypeError(String(it) + " is not a function"); + } + return it; + }; + }, + {}, + ], + 24: [ + function (_dereq_, module, exports) { + var isObject = _dereq_("../internals/is-object"); + module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + " as a prototype"); + } + return it; + }; + }, + { + "../internals/is-object": 92, + }, + ], + 25: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var create = _dereq_("../internals/object-create"); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var UNSCOPABLES = wellKnownSymbol("unscopables"); + var ArrayPrototype = Array.prototype; + // Array.prototype[@@unscopables] + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + if (ArrayPrototype[UNSCOPABLES] == undefined) { + definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null), + }); + } // add a key to Array.prototype[@@unscopables] + + module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; + }; + }, + { + "../internals/object-create": 108, + "../internals/object-define-property": 110, + "../internals/well-known-symbol": 166, + }, + ], + 26: [ + function (_dereq_, module, exports) { + "use strict"; + var charAt = _dereq_("../internals/string-multibyte").charAt; + // `AdvanceStringIndex` abstract operation + // https://tc39.github.io/ecma262/#sec-advancestringindex + module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); + }; + }, + { + "../internals/string-multibyte": 141, + }, + ], + 27: [ + function (_dereq_, module, exports) { + module.exports = function (it, Constructor, name) { + if (!(it instanceof Constructor)) { + throw TypeError( + "Incorrect " + (name ? name + " " : "") + "invocation", + ); + } + return it; + }; + }, + {}, + ], + 28: [ + function (_dereq_, module, exports) { + var isObject = _dereq_("../internals/is-object"); + module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + " is not an object"); + } + return it; + }; + }, + { + "../internals/is-object": 92, + }, + ], + 29: [ + function (_dereq_, module, exports) { + module.exports = + typeof ArrayBuffer !== "undefined" && + typeof DataView !== "undefined"; + }, + {}, + ], + 30: [ + function (_dereq_, module, exports) { + "use strict"; + var NATIVE_ARRAY_BUFFER = _dereq_("../internals/array-buffer-native"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var global = _dereq_("../internals/global"); + var isObject = _dereq_("../internals/is-object"); + var has = _dereq_("../internals/has"); + var classof = _dereq_("../internals/classof"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var redefine = _dereq_("../internals/redefine"); + var defineProperty = _dereq_("../internals/object-define-property").f; + var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); + var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var uid = _dereq_("../internals/uid"); + var Int8Array = global.Int8Array; + var Int8ArrayPrototype = Int8Array && Int8Array.prototype; + var Uint8ClampedArray = global.Uint8ClampedArray; + var Uint8ClampedArrayPrototype = + Uint8ClampedArray && Uint8ClampedArray.prototype; + var TypedArray = Int8Array && getPrototypeOf(Int8Array); + var TypedArrayPrototype = + Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); + var ObjectPrototype = Object.prototype; + var isPrototypeOf = ObjectPrototype.isPrototypeOf; + var TO_STRING_TAG = wellKnownSymbol("toStringTag"); + var TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG"); + // Fixing native typed arrays in Opera Presto crashes the browser, see #595 + var NATIVE_ARRAY_BUFFER_VIEWS = + NATIVE_ARRAY_BUFFER && + !!setPrototypeOf && + classof(global.opera) !== "Opera"; + var TYPED_ARRAY_TAG_REQIRED = false; + var NAME; + var TypedArrayConstructorsList = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8, + }; + var isView = function isView(it) { + var klass = classof(it); + return ( + klass === "DataView" || has(TypedArrayConstructorsList, klass) + ); + }; + var isTypedArray = function (it) { + return isObject(it) && has(TypedArrayConstructorsList, classof(it)); + }; + var aTypedArray = function (it) { + if (isTypedArray(it)) return it; + throw TypeError("Target is not a typed array"); + }; + var aTypedArrayConstructor = function (C) { + if (setPrototypeOf) { + if (isPrototypeOf.call(TypedArray, C)) return C; + } else + for (var ARRAY in TypedArrayConstructorsList) + if (has(TypedArrayConstructorsList, NAME)) { + var TypedArrayConstructor = global[ARRAY]; + if ( + TypedArrayConstructor && + (C === TypedArrayConstructor || + isPrototypeOf.call(TypedArrayConstructor, C)) + ) { + return C; + } + } + throw TypeError("Target is not a typed array constructor"); + }; + var exportTypedArrayMethod = function (KEY, property, forced) { + if (!DESCRIPTORS) return; + if (forced) + for (var ARRAY in TypedArrayConstructorsList) { + var TypedArrayConstructor = global[ARRAY]; + if ( + TypedArrayConstructor && + has(TypedArrayConstructor.prototype, KEY) + ) { + delete TypedArrayConstructor.prototype[KEY]; + } + } + if (!TypedArrayPrototype[KEY] || forced) { + redefine( + TypedArrayPrototype, + KEY, + forced + ? property + : (NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY]) || + property, + ); + } + }; + var exportTypedArrayStaticMethod = function (KEY, property, forced) { + var ARRAY, TypedArrayConstructor; + if (!DESCRIPTORS) return; + if (setPrototypeOf) { + if (forced) + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if ( + TypedArrayConstructor && + has(TypedArrayConstructor, KEY) + ) { + delete TypedArrayConstructor[KEY]; + } + } + if (!TypedArray[KEY] || forced) { + // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable + try { + return redefine( + TypedArray, + KEY, + forced + ? property + : (NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY]) || + property, + ); + } catch (error) { + /* empty */ + } + } else return; + } + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if ( + TypedArrayConstructor && + (!TypedArrayConstructor[KEY] || forced) + ) { + redefine(TypedArrayConstructor, KEY, property); + } + } + }; + for (NAME in TypedArrayConstructorsList) { + if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; + } // WebKit bug - typed arrays constructors prototype is Object.prototype + + if ( + !NATIVE_ARRAY_BUFFER_VIEWS || + typeof TypedArray != "function" || + TypedArray === Function.prototype + ) { + // eslint-disable-next-line no-shadow + TypedArray = function TypedArray() { + throw TypeError("Incorrect invocation"); + }; + if (NATIVE_ARRAY_BUFFER_VIEWS) + for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); + } + } + if ( + !NATIVE_ARRAY_BUFFER_VIEWS || + !TypedArrayPrototype || + TypedArrayPrototype === ObjectPrototype + ) { + TypedArrayPrototype = TypedArray.prototype; + if (NATIVE_ARRAY_BUFFER_VIEWS) + for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) + setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); + } + } // WebKit bug - one more object in Uint8ClampedArray prototype chain + + if ( + NATIVE_ARRAY_BUFFER_VIEWS && + getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype + ) { + setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); + } + if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { + TYPED_ARRAY_TAG_REQIRED = true; + defineProperty(TypedArrayPrototype, TO_STRING_TAG, { + get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + }, + }); + for (NAME in TypedArrayConstructorsList) + if (global[NAME]) { + createNonEnumerableProperty( + global[NAME], + TYPED_ARRAY_TAG, + NAME, + ); + } + } + module.exports = { + NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, + aTypedArray: aTypedArray, + aTypedArrayConstructor: aTypedArrayConstructor, + exportTypedArrayMethod: exportTypedArrayMethod, + exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, + isView: isView, + isTypedArray: isTypedArray, + TypedArray: TypedArray, + TypedArrayPrototype: TypedArrayPrototype, + }; + }, + { + "../internals/array-buffer-native": 29, + "../internals/classof": 47, + "../internals/create-non-enumerable-property": 56, + "../internals/descriptors": 61, + "../internals/global": 77, + "../internals/has": 78, + "../internals/is-object": 92, + "../internals/object-define-property": 110, + "../internals/object-get-prototype-of": 115, + "../internals/object-set-prototype-of": 119, + "../internals/redefine": 126, + "../internals/uid": 163, + "../internals/well-known-symbol": 166, + }, + ], + 31: [ + function (_dereq_, module, exports) { + "use strict"; + var global = _dereq_("../internals/global"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var NATIVE_ARRAY_BUFFER = _dereq_("../internals/array-buffer-native"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var redefineAll = _dereq_("../internals/redefine-all"); + var fails = _dereq_("../internals/fails"); + var anInstance = _dereq_("../internals/an-instance"); + var toInteger = _dereq_("../internals/to-integer"); + var toLength = _dereq_("../internals/to-length"); + var toIndex = _dereq_("../internals/to-index"); + var IEEE754 = _dereq_("../internals/ieee754"); + var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); + var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); + var getOwnPropertyNames = _dereq_( + "../internals/object-get-own-property-names", + ).f; + var defineProperty = _dereq_("../internals/object-define-property").f; + var arrayFill = _dereq_("../internals/array-fill"); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var InternalStateModule = _dereq_("../internals/internal-state"); + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var ARRAY_BUFFER = "ArrayBuffer"; + var DATA_VIEW = "DataView"; + var PROTOTYPE = "prototype"; + var WRONG_LENGTH = "Wrong length"; + var WRONG_INDEX = "Wrong index"; + var NativeArrayBuffer = global[ARRAY_BUFFER]; + var $ArrayBuffer = NativeArrayBuffer; + var $DataView = global[DATA_VIEW]; + var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; + var ObjectPrototype = Object.prototype; + var RangeError = global.RangeError; + var packIEEE754 = IEEE754.pack; + var unpackIEEE754 = IEEE754.unpack; + var packInt8 = function (number) { + return [number & 255]; + }; + var packInt16 = function (number) { + return [number & 255, (number >> 8) & 255]; + }; + var packInt32 = function (number) { + return [ + number & 255, + (number >> 8) & 255, + (number >> 16) & 255, + (number >> 24) & 255, + ]; + }; + var unpackInt32 = function (buffer) { + return ( + (buffer[3] << 24) | + (buffer[2] << 16) | + (buffer[1] << 8) | + buffer[0] + ); + }; + var packFloat32 = function (number) { + return packIEEE754(number, 23, 4); + }; + var packFloat64 = function (number) { + return packIEEE754(number, 52, 8); + }; + var addGetter = function (Constructor, key) { + defineProperty(Constructor[PROTOTYPE], key, { + get: function () { + return getInternalState(this)[key]; + }, + }); + }; + var get = function (view, count, index, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) + throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = bytes.slice(start, start + count); + return isLittleEndian ? pack : pack.reverse(); + }; + var set = function ( + view, + count, + index, + conversion, + value, + isLittleEndian, + ) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) + throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = conversion(+value); + for (var i = 0; i < count; i++) + bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; + }; + if (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + setInternalState(this, { + bytes: arrayFill.call(new Array(byteLength), 0), + byteLength: byteLength, + }); + if (!DESCRIPTORS) this.byteLength = byteLength; + }; + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = getInternalState(buffer).byteLength; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) + throw RangeError("Wrong offset"); + byteLength = + byteLength === undefined + ? bufferLength - offset + : toLength(byteLength); + if (offset + byteLength > bufferLength) + throw RangeError(WRONG_LENGTH); + setInternalState(this, { + buffer: buffer, + byteLength: byteLength, + byteOffset: offset, + }); + if (!DESCRIPTORS) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; + if (DESCRIPTORS) { + addGetter($ArrayBuffer, "byteLength"); + addGetter($DataView, "buffer"); + addGetter($DataView, "byteLength"); + addGetter($DataView, "byteOffset"); + } + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return (get(this, 1, byteOffset)[0] << 24) >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get( + this, + 2, + byteOffset, + arguments.length > 1 ? arguments[1] : undefined, + ); + return (((bytes[1] << 8) | bytes[0]) << 16) >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get( + this, + 2, + byteOffset, + arguments.length > 1 ? arguments[1] : undefined, + ); + return (bytes[1] << 8) | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackInt32( + get( + this, + 4, + byteOffset, + arguments.length > 1 ? arguments[1] : undefined, + ), + ); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return ( + unpackInt32( + get( + this, + 4, + byteOffset, + arguments.length > 1 ? arguments[1] : undefined, + ), + ) >>> 0 + ); + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754( + get( + this, + 4, + byteOffset, + arguments.length > 1 ? arguments[1] : undefined, + ), + 23, + ); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754( + get( + this, + 8, + byteOffset, + arguments.length > 1 ? arguments[1] : undefined, + ), + 52, + ); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16( + byteOffset, + value /* , littleEndian */, + ) { + set( + this, + 2, + byteOffset, + packInt16, + value, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + setUint16: function setUint16( + byteOffset, + value /* , littleEndian */, + ) { + set( + this, + 2, + byteOffset, + packInt16, + value, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + setInt32: function setInt32( + byteOffset, + value /* , littleEndian */, + ) { + set( + this, + 4, + byteOffset, + packInt32, + value, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + setUint32: function setUint32( + byteOffset, + value /* , littleEndian */, + ) { + set( + this, + 4, + byteOffset, + packInt32, + value, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + setFloat32: function setFloat32( + byteOffset, + value /* , littleEndian */, + ) { + set( + this, + 4, + byteOffset, + packFloat32, + value, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + setFloat64: function setFloat64( + byteOffset, + value /* , littleEndian */, + ) { + set( + this, + 8, + byteOffset, + packFloat64, + value, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + }); + } else { + if ( + !fails(function () { + NativeArrayBuffer(1); + }) || + !fails(function () { + new NativeArrayBuffer(-1); // eslint-disable-line no-new + }) || + fails(function () { + new NativeArrayBuffer(); // eslint-disable-line no-new + new NativeArrayBuffer(1.5); // eslint-disable-line no-new + new NativeArrayBuffer(NaN); // eslint-disable-line no-new + return NativeArrayBuffer.name != ARRAY_BUFFER; + }) + ) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new NativeArrayBuffer(toIndex(length)); + }; + var ArrayBufferPrototype = ($ArrayBuffer[PROTOTYPE] = + NativeArrayBuffer[PROTOTYPE]); + for ( + var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; + keys.length > j; + + ) { + if (!((key = keys[j++]) in $ArrayBuffer)) { + createNonEnumerableProperty( + $ArrayBuffer, + key, + NativeArrayBuffer[key], + ); + } + } + ArrayBufferPrototype.constructor = $ArrayBuffer; + } // WebKit bug - the same parent prototype for typed arrays and data view + + if ( + setPrototypeOf && + getPrototypeOf($DataViewPrototype) !== ObjectPrototype + ) { + setPrototypeOf($DataViewPrototype, ObjectPrototype); + } // iOS Safari 7.x bug + + var testView = new $DataView(new $ArrayBuffer(2)); + var nativeSetInt8 = $DataViewPrototype.setInt8; + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) + redefineAll( + $DataViewPrototype, + { + setInt8: function setInt8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, (value << 24) >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, (value << 24) >> 24); + }, + }, + { + unsafe: true, + }, + ); + } + setToStringTag($ArrayBuffer, ARRAY_BUFFER); + setToStringTag($DataView, DATA_VIEW); + module.exports = { + ArrayBuffer: $ArrayBuffer, + DataView: $DataView, + }; + }, + { + "../internals/an-instance": 27, + "../internals/array-buffer-native": 29, + "../internals/array-fill": 33, + "../internals/create-non-enumerable-property": 56, + "../internals/descriptors": 61, + "../internals/fails": 69, + "../internals/global": 77, + "../internals/ieee754": 83, + "../internals/internal-state": 88, + "../internals/object-define-property": 110, + "../internals/object-get-own-property-names": 113, + "../internals/object-get-prototype-of": 115, + "../internals/object-set-prototype-of": 119, + "../internals/redefine-all": 125, + "../internals/set-to-string-tag": 135, + "../internals/to-index": 151, + "../internals/to-integer": 153, + "../internals/to-length": 154, + }, + ], + 32: [ + function (_dereq_, module, exports) { + "use strict"; + var toObject = _dereq_("../internals/to-object"); + var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); + var toLength = _dereq_("../internals/to-length"); + var min = Math.min; + // `Array.prototype.copyWithin` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin + module.exports = + [].copyWithin || + function copyWithin( + target /* = 0 */, + start /* = 0, end = @length */, + ) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min( + (end === undefined ? len : toAbsoluteIndex(end, len)) - from, + len - to, + ); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } + return O; + }; + }, + { + "../internals/to-absolute-index": 150, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 33: [ + function (_dereq_, module, exports) { + "use strict"; + var toObject = _dereq_("../internals/to-object"); + var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); + var toLength = _dereq_("../internals/to-length"); + // `Array.prototype.fill` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.fill + module.exports = function fill( + value /* , start = 0, end = @length */, + ) { + var O = toObject(this); + var length = toLength(O.length); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex( + argumentsLength > 1 ? arguments[1] : undefined, + length, + ); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = + end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; + }; + }, + { + "../internals/to-absolute-index": 150, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 34: [ + function (_dereq_, module, exports) { + "use strict"; + var $forEach = _dereq_("../internals/array-iteration").forEach; + var arrayMethodIsStrict = _dereq_( + "../internals/array-method-is-strict", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var STRICT_METHOD = arrayMethodIsStrict("forEach"); + var USES_TO_LENGTH = arrayMethodUsesToLength("forEach"); + // `Array.prototype.forEach` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + module.exports = + !STRICT_METHOD || !USES_TO_LENGTH + ? function forEach(callbackfn /* , thisArg */) { + return $forEach( + this, + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + } + : [].forEach; + }, + { + "../internals/array-iteration": 37, + "../internals/array-method-is-strict": 40, + "../internals/array-method-uses-to-length": 41, + }, + ], + 35: [ + function (_dereq_, module, exports) { + "use strict"; + var bind = _dereq_("../internals/function-bind-context"); + var toObject = _dereq_("../internals/to-object"); + var callWithSafeIterationClosing = _dereq_( + "../internals/call-with-safe-iteration-closing", + ); + var isArrayIteratorMethod = _dereq_( + "../internals/is-array-iterator-method", + ); + var toLength = _dereq_("../internals/to-length"); + var createProperty = _dereq_("../internals/create-property"); + var getIteratorMethod = _dereq_("../internals/get-iterator-method"); + // `Array.from` method implementation + // https://tc39.github.io/ecma262/#sec-array.from + module.exports = function from( + arrayLike /* , mapfn = undefined, thisArg = undefined */, + ) { + var O = toObject(arrayLike); + var C = typeof this == "function" ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var index = 0; + var length, result, step, iterator, next, value; + if (mapping) + mapfn = bind( + mapfn, + argumentsLength > 2 ? arguments[2] : undefined, + 2, + ); + // if the target is not iterable or it's an array with the default iterator - use a simple case + if ( + iteratorMethod != undefined && + !(C == Array && isArrayIteratorMethod(iteratorMethod)) + ) { + iterator = iteratorMethod.call(O); + next = iterator.next; + result = new C(); + for (; !(step = next.call(iterator)).done; index++) { + value = mapping + ? callWithSafeIterationClosing( + iterator, + mapfn, + [step.value, index], + true, + ) + : step.value; + createProperty(result, index, value); + } + } else { + length = toLength(O.length); + result = new C(length); + for (; length > index; index++) { + value = mapping ? mapfn(O[index], index) : O[index]; + createProperty(result, index, value); + } + } + result.length = index; + return result; + }; + }, + { + "../internals/call-with-safe-iteration-closing": 44, + "../internals/create-property": 58, + "../internals/function-bind-context": 72, + "../internals/get-iterator-method": 75, + "../internals/is-array-iterator-method": 89, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 36: [ + function (_dereq_, module, exports) { + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var toLength = _dereq_("../internals/to-length"); + var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); + // `Array.prototype.{ indexOf, includes }` methods implementation + var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) + while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } + else + for (; length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) + return IS_INCLUDES || index || 0; + } + return !IS_INCLUDES && -1; + }; + }; + module.exports = { + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false), + }; + }, + { + "../internals/to-absolute-index": 150, + "../internals/to-indexed-object": 152, + "../internals/to-length": 154, + }, + ], + 37: [ + function (_dereq_, module, exports) { + var bind = _dereq_("../internals/function-bind-context"); + var IndexedObject = _dereq_("../internals/indexed-object"); + var toObject = _dereq_("../internals/to-object"); + var toLength = _dereq_("../internals/to-length"); + var arraySpeciesCreate = _dereq_("../internals/array-species-create"); + var push = [].push; + // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation + var createMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var boundFunction = bind(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP + ? create($this, length) + : IS_FILTER + ? create($this, 0) + : undefined; + var value, result; + for (; length > index; index++) + if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) + switch (TYPE) { + case 3: + return true; + // some + case 5: + return value; + // find + case 6: + return index; + // findIndex + case 2: + push.call(target, value); + // filter + } + else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX + ? -1 + : IS_SOME || IS_EVERY + ? IS_EVERY + : target; + }; + }; + module.exports = { + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.github.io/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6), + }; + }, + { + "../internals/array-species-create": 43, + "../internals/function-bind-context": 72, + "../internals/indexed-object": 84, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 38: [ + function (_dereq_, module, exports) { + "use strict"; + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var toInteger = _dereq_("../internals/to-integer"); + var toLength = _dereq_("../internals/to-length"); + var arrayMethodIsStrict = _dereq_( + "../internals/array-method-is-strict", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var min = Math.min; + var nativeLastIndexOf = [].lastIndexOf; + var NEGATIVE_ZERO = + !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; + var STRICT_METHOD = arrayMethodIsStrict("lastIndexOf"); + // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method + var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { + ACCESSORS: true, + 1: 0, + }); + var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH; + // `Array.prototype.lastIndexOf` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof + module.exports = FORCED + ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) + return nativeLastIndexOf.apply(this, arguments) || 0; + var O = toIndexedObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) + index = min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (; index >= 0; index--) + if (index in O && O[index] === searchElement) + return index || 0; + return -1; + } + : nativeLastIndexOf; + }, + { + "../internals/array-method-is-strict": 40, + "../internals/array-method-uses-to-length": 41, + "../internals/to-indexed-object": 152, + "../internals/to-integer": 153, + "../internals/to-length": 154, + }, + ], + 39: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var V8_VERSION = _dereq_("../internals/engine-v8-version"); + var SPECIES = wellKnownSymbol("species"); + module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return ( + V8_VERSION >= 51 || + !fails(function () { + var array = []; + var constructor = (array.constructor = {}); + constructor[SPECIES] = function () { + return { + foo: 1, + }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }) + ); + }; + }, + { + "../internals/engine-v8-version": 66, + "../internals/fails": 69, + "../internals/well-known-symbol": 166, + }, + ], + 40: [ + function (_dereq_, module, exports) { + "use strict"; + var fails = _dereq_("../internals/fails"); + module.exports = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return ( + !!method && + fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal + method.call( + null, + argument || + function () { + throw 1; + }, + 1, + ); + }) + ); + }; + }, + { + "../internals/fails": 69, + }, + ], + 41: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var fails = _dereq_("../internals/fails"); + var has = _dereq_("../internals/has"); + var defineProperty = Object.defineProperty; + var cache = {}; + var thrower = function (it) { + throw it; + }; + module.exports = function (METHOD_NAME, options) { + if (has(cache, METHOD_NAME)) return cache[METHOD_NAME]; + if (!options) options = {}; + var method = [][METHOD_NAME]; + var ACCESSORS = has(options, "ACCESSORS") + ? options.ACCESSORS + : false; + var argument0 = has(options, 0) ? options[0] : thrower; + var argument1 = has(options, 1) ? options[1] : undefined; + return (cache[METHOD_NAME] = + !!method && + !fails(function () { + if (ACCESSORS && !DESCRIPTORS) return true; + var O = { + length: -1, + }; + if (ACCESSORS) + defineProperty(O, 1, { + enumerable: true, + get: thrower, + }); + else O[1] = 1; + method.call(O, argument0, argument1); + })); + }; + }, + { + "../internals/descriptors": 61, + "../internals/fails": 69, + "../internals/has": 78, + }, + ], + 42: [ + function (_dereq_, module, exports) { + var aFunction = _dereq_("../internals/a-function"); + var toObject = _dereq_("../internals/to-object"); + var IndexedObject = _dereq_("../internals/indexed-object"); + var toLength = _dereq_("../internals/to-length"); + // `Array.prototype.{ reduce, reduceRight }` methods implementation + var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction(callbackfn); + var O = toObject(that); + var self = IndexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) + while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError( + "Reduce of empty array with no initial value", + ); + } + } + for (; IS_RIGHT ? index >= 0 : length > index; index += i) + if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; + }; + module.exports = { + // `Array.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright + right: createMethod(true), + }; + }, + { + "../internals/a-function": 23, + "../internals/indexed-object": 84, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 43: [ + function (_dereq_, module, exports) { + var isObject = _dereq_("../internals/is-object"); + var isArray = _dereq_("../internals/is-array"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var SPECIES = wellKnownSymbol("species"); + // `ArraySpeciesCreate` abstract operation + // https://tc39.github.io/ecma262/#sec-arrayspeciescreate + module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if ( + typeof C == "function" && + (C === Array || isArray(C.prototype)) + ) + C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } + return new (C === undefined ? Array : C)(length === 0 ? 0 : length); + }; + }, + { + "../internals/is-array": 90, + "../internals/is-object": 92, + "../internals/well-known-symbol": 166, + }, + ], + 44: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + // call something on iterator step with safe closing on error + module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + var returnMethod = iterator["return"]; + if (returnMethod !== undefined) + anObject(returnMethod.call(iterator)); + throw error; + } + }; + }, + { + "../internals/an-object": 28, + }, + ], + 45: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var ITERATOR = wellKnownSymbol("iterator"); + var SAFE_CLOSING = false; + try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { + done: !!called++, + }; + }, + return: function () { + SAFE_CLOSING = true; + }, + }; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line no-throw-literal + Array.from(iteratorWithReturn, function () { + throw 2; + }); + } catch (error) { + /* empty */ + } + module.exports = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR] = function () { + return { + next: function () { + return { + done: (ITERATION_SUPPORT = true), + }; + }, + }; + }; + exec(object); + } catch (error) { + /* empty */ + } + return ITERATION_SUPPORT; + }; + }, + { + "../internals/well-known-symbol": 166, + }, + ], + 46: [ + function (_dereq_, module, exports) { + var toString = {}.toString; + module.exports = function (it) { + return toString.call(it).slice(8, -1); + }; + }, + {}, + ], + 47: [ + function (_dereq_, module, exports) { + var TO_STRING_TAG_SUPPORT = _dereq_( + "../internals/to-string-tag-support", + ); + var classofRaw = _dereq_("../internals/classof-raw"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var TO_STRING_TAG = wellKnownSymbol("toStringTag"); + // ES3 wrong here + var CORRECT_ARGUMENTS = + classofRaw( + (function () { + return arguments; + })(), + ) == "Arguments"; + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { + /* empty */ + } + }; + // getting tag from ES6+ `Object.prototype.toString` + module.exports = TO_STRING_TAG_SUPPORT + ? classofRaw + : function (it) { + var O, tag, result; + return it === undefined + ? "Undefined" + : it === null + ? "Null" // @@toStringTag case + : typeof (tag = tryGet((O = Object(it)), TO_STRING_TAG)) == + "string" + ? tag // builtinTag case + : CORRECT_ARGUMENTS + ? classofRaw(O) // ES3 arguments fallback + : (result = classofRaw(O)) == "Object" && + typeof O.callee == "function" + ? "Arguments" + : result; + }; + }, + { + "../internals/classof-raw": 46, + "../internals/to-string-tag-support": 159, + "../internals/well-known-symbol": 166, + }, + ], + 48: [ + function (_dereq_, module, exports) { + "use strict"; + var defineProperty = _dereq_("../internals/object-define-property").f; + var create = _dereq_("../internals/object-create"); + var redefineAll = _dereq_("../internals/redefine-all"); + var bind = _dereq_("../internals/function-bind-context"); + var anInstance = _dereq_("../internals/an-instance"); + var iterate = _dereq_("../internals/iterate"); + var defineIterator = _dereq_("../internals/define-iterator"); + var setSpecies = _dereq_("../internals/set-species"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var fastKey = _dereq_("../internals/internal-metadata").fastKey; + var InternalStateModule = _dereq_("../internals/internal-state"); + var setInternalState = InternalStateModule.set; + var internalStateGetterFor = InternalStateModule.getterFor; + module.exports = { + getConstructor: function ( + wrapper, + CONSTRUCTOR_NAME, + IS_MAP, + ADDER, + ) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + index: create(null), + first: undefined, + last: undefined, + size: 0, + }); + if (!DESCRIPTORS) that.size = 0; + if (iterable != undefined) + iterate(iterable, that[ADDER], that, IS_MAP); + }); + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, index; + // change existing entry + if (entry) { + entry.value = value; + // create new entry + } else { + state.last = entry = { + index: (index = fastKey(key, true)), + key: key, + value: value, + previous: (previous = state.last), + next: undefined, + removed: false, + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (DESCRIPTORS) state.size++; + else that.size++; + // add to index + if (index !== "F") state.index[index] = entry; + } + return that; + }; + var getEntry = function (that, key) { + var state = getInternalState(that); + // fast case + var index = fastKey(key); + var entry; + if (index !== "F") return state.index[index]; + // frozen object case + for (entry = state.first; entry; entry = entry.next) { + if (entry.key == key) return entry; + } + }; + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + var that = this; + var state = getInternalState(that); + var data = state.index; + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) + entry.previous = entry.previous.next = undefined; + delete data[entry.index]; + entry = entry.next; + } + state.first = state.last = undefined; + if (DESCRIPTORS) state.size = 0; + else that.size = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + delete: function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first == entry) state.first = next; + if (state.last == entry) state.last = prev; + if (DESCRIPTORS) state.size--; + else that.size--; + } + return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + var state = getInternalState(this); + var boundFunction = bind( + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + 3, + ); + var entry; + while ((entry = entry ? entry.next : state.first)) { + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(this, key); + }, + }); + redefineAll( + C.prototype, + IS_MAP + ? { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + }, + } + : { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return define( + this, + (value = value === 0 ? 0 : value), + value, + ); + }, + }, + ); + if (DESCRIPTORS) + defineProperty(C.prototype, "size", { + get: function () { + return getInternalState(this).size; + }, + }); + return C; + }, + setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator"; + var getInternalCollectionState = + internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = + internalStateGetterFor(ITERATOR_NAME); + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + defineIterator( + C, + CONSTRUCTOR_NAME, + function (iterated, kind) { + setInternalState(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined, + }); + }, + function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry + if ( + !state.target || + !(state.last = entry = + entry ? entry.next : state.state.first) + ) { + // or finish the iteration + state.target = undefined; + return { + value: undefined, + done: true, + }; + } // return step by kind + + if (kind == "keys") + return { + value: entry.key, + done: false, + }; + if (kind == "values") + return { + value: entry.value, + done: false, + }; + return { + value: [entry.key, entry.value], + done: false, + }; + }, + IS_MAP ? "entries" : "values", + !IS_MAP, + true, + ); + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(CONSTRUCTOR_NAME); + }, + }; + }, + { + "../internals/an-instance": 27, + "../internals/define-iterator": 59, + "../internals/descriptors": 61, + "../internals/function-bind-context": 72, + "../internals/internal-metadata": 87, + "../internals/internal-state": 88, + "../internals/iterate": 95, + "../internals/object-create": 108, + "../internals/object-define-property": 110, + "../internals/redefine-all": 125, + "../internals/set-species": 134, + }, + ], + 49: [ + function (_dereq_, module, exports) { + "use strict"; + var redefineAll = _dereq_("../internals/redefine-all"); + var getWeakData = _dereq_( + "../internals/internal-metadata", + ).getWeakData; + var anObject = _dereq_("../internals/an-object"); + var isObject = _dereq_("../internals/is-object"); + var anInstance = _dereq_("../internals/an-instance"); + var iterate = _dereq_("../internals/iterate"); + var ArrayIterationModule = _dereq_("../internals/array-iteration"); + var $has = _dereq_("../internals/has"); + var InternalStateModule = _dereq_("../internals/internal-state"); + var setInternalState = InternalStateModule.set; + var internalStateGetterFor = InternalStateModule.getterFor; + var find = ArrayIterationModule.find; + var findIndex = ArrayIterationModule.findIndex; + var id = 0; + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function (store) { + return store.frozen || (store.frozen = new UncaughtFrozenStore()); + }; + var UncaughtFrozenStore = function () { + this.entries = []; + }; + var findUncaughtFrozen = function (store, key) { + return find(store.entries, function (it) { + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.entries.push([key, value]); + }, + delete: function (key) { + var index = findIndex(this.entries, function (it) { + return it[0] === key; + }); + if (~index) this.entries.splice(index, 1); + return !!~index; + }, + }; + module.exports = { + getConstructor: function ( + wrapper, + CONSTRUCTOR_NAME, + IS_MAP, + ADDER, + ) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + id: id++, + frozen: undefined, + }); + if (iterable != undefined) + iterate(iterable, that[ADDER], that, IS_MAP); + }); + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + var define = function (that, key, value) { + var state = getInternalState(that); + var data = getWeakData(anObject(key), true); + if (data === true) uncaughtFrozenStore(state).set(key, value); + else data[state.id] = value; + return that; + }; + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + delete: function (key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) + return uncaughtFrozenStore(state)["delete"](key); + return data && $has(data, state.id) && delete data[state.id]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).has(key); + return data && $has(data, state.id); + }, + }); + redefineAll( + C.prototype, + IS_MAP + ? { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + var state = getInternalState(this); + if (isObject(key)) { + var data = getWeakData(key); + if (data === true) + return uncaughtFrozenStore(state).get(key); + return data ? data[state.id] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return define(this, key, value); + }, + } + : { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return define(this, value, true); + }, + }, + ); + return C; + }, + }; + }, + { + "../internals/an-instance": 27, + "../internals/an-object": 28, + "../internals/array-iteration": 37, + "../internals/has": 78, + "../internals/internal-metadata": 87, + "../internals/internal-state": 88, + "../internals/is-object": 92, + "../internals/iterate": 95, + "../internals/redefine-all": 125, + }, + ], + 50: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var global = _dereq_("../internals/global"); + var isForced = _dereq_("../internals/is-forced"); + var redefine = _dereq_("../internals/redefine"); + var InternalMetadataModule = _dereq_( + "../internals/internal-metadata", + ); + var iterate = _dereq_("../internals/iterate"); + var anInstance = _dereq_("../internals/an-instance"); + var isObject = _dereq_("../internals/is-object"); + var fails = _dereq_("../internals/fails"); + var checkCorrectnessOfIteration = _dereq_( + "../internals/check-correctness-of-iteration", + ); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var inheritIfRequired = _dereq_("../internals/inherit-if-required"); + module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf("Map") !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf("Weak") !== -1; + var ADDER = IS_MAP ? "set" : "add"; + var NativeConstructor = global[CONSTRUCTOR_NAME]; + var NativePrototype = + NativeConstructor && NativeConstructor.prototype; + var Constructor = NativeConstructor; + var exported = {}; + var fixMethod = function (KEY) { + var nativeMethod = NativePrototype[KEY]; + redefine( + NativePrototype, + KEY, + KEY == "add" + ? function add(value) { + nativeMethod.call(this, value === 0 ? 0 : value); + return this; + } + : KEY == "delete" + ? function (key) { + return IS_WEAK && !isObject(key) + ? false + : nativeMethod.call(this, key === 0 ? 0 : key); + } + : KEY == "get" + ? function get(key) { + return IS_WEAK && !isObject(key) + ? undefined + : nativeMethod.call(this, key === 0 ? 0 : key); + } + : KEY == "has" + ? function has(key) { + return IS_WEAK && !isObject(key) + ? false + : nativeMethod.call(this, key === 0 ? 0 : key); + } + : function set(key, value) { + nativeMethod.call(this, key === 0 ? 0 : key, value); + return this; + }, + ); + }; + // eslint-disable-next-line max-len + if ( + isForced( + CONSTRUCTOR_NAME, + typeof NativeConstructor != "function" || + !( + IS_WEAK || + (NativePrototype.forEach && + !fails(function () { + new NativeConstructor().entries().next(); + })) + ), + ) + ) { + // create collection constructor + Constructor = common.getConstructor( + wrapper, + CONSTRUCTOR_NAME, + IS_MAP, + ADDER, + ); + InternalMetadataModule.REQUIRED = true; + } else if (isForced(CONSTRUCTOR_NAME, true)) { + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = + instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { + instance.has(1); + }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + // eslint-disable-next-line no-new + var ACCEPT_ITERABLES = checkCorrectnessOfIteration( + function (iterable) { + new NativeConstructor(iterable); + }, + ); + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = + !IS_WEAK && + fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new NativeConstructor(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + Constructor = wrapper(function (dummy, iterable) { + anInstance(dummy, Constructor, CONSTRUCTOR_NAME); + var that = inheritIfRequired( + new NativeConstructor(), + dummy, + Constructor, + ); + if (iterable != undefined) + iterate(iterable, that[ADDER], that, IS_MAP); + return that; + }); + Constructor.prototype = NativePrototype; + NativePrototype.constructor = Constructor; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod("delete"); + fixMethod("has"); + IS_MAP && fixMethod("get"); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && NativePrototype.clear) + delete NativePrototype.clear; + } + exported[CONSTRUCTOR_NAME] = Constructor; + $( + { + global: true, + forced: Constructor != NativeConstructor, + }, + exported, + ); + setToStringTag(Constructor, CONSTRUCTOR_NAME); + if (!IS_WEAK) + common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + return Constructor; + }; + }, + { + "../internals/an-instance": 27, + "../internals/check-correctness-of-iteration": 45, + "../internals/export": 68, + "../internals/fails": 69, + "../internals/global": 77, + "../internals/inherit-if-required": 85, + "../internals/internal-metadata": 87, + "../internals/is-forced": 91, + "../internals/is-object": 92, + "../internals/iterate": 95, + "../internals/redefine": 126, + "../internals/set-to-string-tag": 135, + }, + ], + 51: [ + function (_dereq_, module, exports) { + var has = _dereq_("../internals/has"); + var ownKeys = _dereq_("../internals/own-keys"); + var getOwnPropertyDescriptorModule = _dereq_( + "../internals/object-get-own-property-descriptor", + ); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + module.exports = function (target, source) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!has(target, key)) + defineProperty( + target, + key, + getOwnPropertyDescriptor(source, key), + ); + } + }; + }, + { + "../internals/has": 78, + "../internals/object-define-property": 110, + "../internals/object-get-own-property-descriptor": 111, + "../internals/own-keys": 121, + }, + ], + 52: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var MATCH = wellKnownSymbol("match"); + module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + "/./"[METHOD_NAME](regexp); + } catch (e) { + try { + regexp[MATCH] = false; + return "/./"[METHOD_NAME](regexp); + } catch (f) { + /* empty */ + } + } + return false; + }; + }, + { + "../internals/well-known-symbol": 166, + }, + ], + 53: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + module.exports = !fails(function () { + function F() { + /* empty */ + } + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; + }); + }, + { + "../internals/fails": 69, + }, + ], + 54: [ + function (_dereq_, module, exports) { + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var quot = /"/g; + // B.2.3.2.1 CreateHTML(string, tag, attribute, value) + // https://tc39.github.io/ecma262/#sec-createhtml + module.exports = function (string, tag, attribute, value) { + var S = String(requireObjectCoercible(string)); + var p1 = "<" + tag; + if (attribute !== "") + p1 += + " " + + attribute + + '="' + + String(value).replace(quot, """) + + '"'; + return p1 + ">" + S + ""; + }; + }, + { + "../internals/require-object-coercible": 131, + }, + ], + 55: [ + function (_dereq_, module, exports) { + "use strict"; + var IteratorPrototype = _dereq_( + "../internals/iterators-core", + ).IteratorPrototype; + var create = _dereq_("../internals/object-create"); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var Iterators = _dereq_("../internals/iterators"); + var returnThis = function () { + return this; + }; + module.exports = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + " Iterator"; + IteratorConstructor.prototype = create(IteratorPrototype, { + next: createPropertyDescriptor(1, next), + }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; + }; + }, + { + "../internals/create-property-descriptor": 57, + "../internals/iterators": 97, + "../internals/iterators-core": 96, + "../internals/object-create": 108, + "../internals/set-to-string-tag": 135, + }, + ], + 56: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + module.exports = DESCRIPTORS + ? function (object, key, value) { + return definePropertyModule.f( + object, + key, + createPropertyDescriptor(1, value), + ); + } + : function (object, key, value) { + object[key] = value; + return object; + }; + }, + { + "../internals/create-property-descriptor": 57, + "../internals/descriptors": 61, + "../internals/object-define-property": 110, + }, + ], + 57: [ + function (_dereq_, module, exports) { + module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value, + }; + }; + }, + {}, + ], + 58: [ + function (_dereq_, module, exports) { + "use strict"; + var toPrimitive = _dereq_("../internals/to-primitive"); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) + definePropertyModule.f( + object, + propertyKey, + createPropertyDescriptor(0, value), + ); + else object[propertyKey] = value; + }; + }, + { + "../internals/create-property-descriptor": 57, + "../internals/object-define-property": 110, + "../internals/to-primitive": 158, + }, + ], + 59: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var createIteratorConstructor = _dereq_( + "../internals/create-iterator-constructor", + ); + var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); + var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var redefine = _dereq_("../internals/redefine"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var IS_PURE = _dereq_("../internals/is-pure"); + var Iterators = _dereq_("../internals/iterators"); + var IteratorsCore = _dereq_("../internals/iterators-core"); + var IteratorPrototype = IteratorsCore.IteratorPrototype; + var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; + var ITERATOR = wellKnownSymbol("iterator"); + var KEYS = "keys"; + var VALUES = "values"; + var ENTRIES = "entries"; + var returnThis = function () { + return this; + }; + module.exports = function ( + Iterable, + NAME, + IteratorConstructor, + next, + DEFAULT, + IS_SET, + FORCED, + ) { + createIteratorConstructor(IteratorConstructor, NAME, next); + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) + return IterablePrototype[KIND]; + switch (KIND) { + case KEYS: + return function keys() { + return new IteratorConstructor(this, KIND); + }; + case VALUES: + return function values() { + return new IteratorConstructor(this, KIND); + }; + case ENTRIES: + return function entries() { + return new IteratorConstructor(this, KIND); + }; + } + return function () { + return new IteratorConstructor(this); + }; + }; + var TO_STRING_TAG = NAME + " Iterator"; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = + IterablePrototype[ITERATOR] || + IterablePrototype["@@iterator"] || + (DEFAULT && IterablePrototype[DEFAULT]); + var defaultIterator = + (!BUGGY_SAFARI_ITERATORS && nativeIterator) || + getIterationMethod(DEFAULT); + var anyNativeIterator = + NAME == "Array" + ? IterablePrototype.entries || nativeIterator + : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf( + anyNativeIterator.call(new Iterable()), + ); + if ( + IteratorPrototype !== Object.prototype && + CurrentIteratorPrototype.next + ) { + if ( + !IS_PURE && + getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype + ) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if ( + typeof CurrentIteratorPrototype[ITERATOR] != "function" + ) { + createNonEnumerableProperty( + CurrentIteratorPrototype, + ITERATOR, + returnThis, + ); + } + } // Set @@toStringTag to native iterators + + setToStringTag( + CurrentIteratorPrototype, + TO_STRING_TAG, + true, + true, + ); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } // fix Array#{values, @@iterator}.name in V8 / FF + + if ( + DEFAULT == VALUES && + nativeIterator && + nativeIterator.name !== VALUES + ) { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { + return nativeIterator.call(this); + }; + } // define iterator + + if ( + (!IS_PURE || FORCED) && + IterablePrototype[ITERATOR] !== defaultIterator + ) { + createNonEnumerableProperty( + IterablePrototype, + ITERATOR, + defaultIterator, + ); + } + Iterators[NAME] = defaultIterator; + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES), + }; + if (FORCED) + for (KEY in methods) { + if ( + BUGGY_SAFARI_ITERATORS || + INCORRECT_VALUES_NAME || + !(KEY in IterablePrototype) + ) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } + else + $( + { + target: NAME, + proto: true, + forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME, + }, + methods, + ); + } + return methods; + }; + }, + { + "../internals/create-iterator-constructor": 55, + "../internals/create-non-enumerable-property": 56, + "../internals/export": 68, + "../internals/is-pure": 93, + "../internals/iterators": 97, + "../internals/iterators-core": 96, + "../internals/object-get-prototype-of": 115, + "../internals/object-set-prototype-of": 119, + "../internals/redefine": 126, + "../internals/set-to-string-tag": 135, + "../internals/well-known-symbol": 166, + }, + ], + 60: [ + function (_dereq_, module, exports) { + var path = _dereq_("../internals/path"); + var has = _dereq_("../internals/has"); + var wrappedWellKnownSymbolModule = _dereq_( + "../internals/well-known-symbol-wrapped", + ); + var defineProperty = _dereq_("../internals/object-define-property").f; + module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!has(Symbol, NAME)) + defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME), + }); + }; + }, + { + "../internals/has": 78, + "../internals/object-define-property": 110, + "../internals/path": 122, + "../internals/well-known-symbol-wrapped": 165, + }, + ], + 61: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + // Thank's IE8 for his funny defineProperty + module.exports = !fails(function () { + return ( + Object.defineProperty({}, 1, { + get: function () { + return 7; + }, + })[1] != 7 + ); + }); + }, + { + "../internals/fails": 69, + }, + ], + 62: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var isObject = _dereq_("../internals/is-object"); + var document = global.document; + // typeof document.createElement is 'object' in old IE + var EXISTS = isObject(document) && isObject(document.createElement); + module.exports = function (it) { + return EXISTS ? document.createElement(it) : {}; + }; + }, + { + "../internals/global": 77, + "../internals/is-object": 92, + }, + ], + 63: [ + function (_dereq_, module, exports) { + // iterable DOM collections + // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods + module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0, + }; + }, + {}, + ], + 64: [ + function (_dereq_, module, exports) { + var userAgent = _dereq_("../internals/engine-user-agent"); + module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent); + }, + { + "../internals/engine-user-agent": 65, + }, + ], + 65: [ + function (_dereq_, module, exports) { + var getBuiltIn = _dereq_("../internals/get-built-in"); + module.exports = getBuiltIn("navigator", "userAgent") || ""; + }, + { + "../internals/get-built-in": 74, + }, + ], + 66: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var userAgent = _dereq_("../internals/engine-user-agent"); + var process = global.process; + var versions = process && process.versions; + var v8 = versions && versions.v8; + var match, version; + if (v8) { + match = v8.split("."); + version = match[0] + match[1]; + } else if (userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = match[1]; + } + } + module.exports = version && +version; + }, + { + "../internals/engine-user-agent": 65, + "../internals/global": 77, + }, + ], + 67: [ + function (_dereq_, module, exports) { + // IE8- don't enum bug keys + module.exports = [ + "constructor", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "toLocaleString", + "toString", + "valueOf", + ]; + }, + {}, + ], + 68: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var getOwnPropertyDescriptor = _dereq_( + "../internals/object-get-own-property-descriptor", + ).f; + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var redefine = _dereq_("../internals/redefine"); + var setGlobal = _dereq_("../internals/set-global"); + var copyConstructorProperties = _dereq_( + "../internals/copy-constructor-properties", + ); + var isForced = _dereq_("../internals/is-forced"); + /* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ + module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) + for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced( + GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, + options.forced, + ); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } // add a flag to not completely full polyfills + + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, "sham", true); + } // extend global + + redefine(target, key, sourceProperty, options); + } + }; + }, + { + "../internals/copy-constructor-properties": 51, + "../internals/create-non-enumerable-property": 56, + "../internals/global": 77, + "../internals/is-forced": 91, + "../internals/object-get-own-property-descriptor": 111, + "../internals/redefine": 126, + "../internals/set-global": 133, + }, + ], + 69: [ + function (_dereq_, module, exports) { + module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } + }; + }, + {}, + ], + 70: [ + function (_dereq_, module, exports) { + "use strict"; + // TODO: Remove from `core-js@4` since it's moved to entry points + _dereq_("../modules/es.regexp.exec"); + var redefine = _dereq_("../internals/redefine"); + var fails = _dereq_("../internals/fails"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var regexpExec = _dereq_("../internals/regexp-exec"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var SPECIES = wellKnownSymbol("species"); + var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { + a: "7", + }; + return result; + }; + return "".replace(re, "$") !== "7"; + }); + // IE <= 11 replaces $0 with the whole match, as if it was $& + // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 + var REPLACE_KEEPS_$0 = (function () { + return "a".replace(/./, "$0") === "$0"; + })(); + var REPLACE = wellKnownSymbol("replace"); + // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string + var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { + if (/./[REPLACE]) { + return /./[REPLACE]("a", "$0") === ""; + } + return false; + })(); + // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec + // Weex JS has frozen built-in prototypes, so use try / catch wrapper + var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { + return originalExec.apply(this, arguments); + }; + var result = "ab".split(re); + return ( + result.length !== 2 || result[0] !== "a" || result[1] !== "b" + ); + }); + module.exports = function (KEY, length, exec, sham) { + var SYMBOL = wellKnownSymbol(KEY); + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { + return 7; + }; + return ""[KEY](O) != 7; + }); + var DELEGATES_TO_EXEC = + DELEGATES_TO_SYMBOL && + !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + if (KEY === "split") { + // We can't use real regex here since it causes deoptimization + // and serious performance degradation in V8 + // https://github.com/zloirock/core-js/issues/306 + re = {}; + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { + return re; + }; + re.flags = ""; + re[SYMBOL] = /./[SYMBOL]; + } + re.exec = function () { + execCalled = true; + return null; + }; + re[SYMBOL](""); + return !execCalled; + }); + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === "replace" && + !( + REPLACE_SUPPORTS_NAMED_GROUPS && + REPLACE_KEEPS_$0 && + !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE + )) || + (KEY === "split" && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var methods = exec( + SYMBOL, + ""[KEY], + function (nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { + done: true, + value: nativeRegExpMethod.call(regexp, str, arg2), + }; + } + return { + done: true, + value: nativeMethod.call(str, regexp, arg2), + }; + } + return { + done: false, + }; + }, + { + REPLACE_KEEPS_$0: REPLACE_KEEPS_$0, + REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: + REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE, + }, + ); + var stringMethod = methods[0]; + var regexMethod = methods[1]; + redefine(String.prototype, KEY, stringMethod); + redefine( + RegExp.prototype, + SYMBOL, + length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + ? // 21.2.5.11 RegExp.prototype[@@split](string, limit) + function (string, arg) { + return regexMethod.call(string, this, arg); + } // 21.2.5.6 RegExp.prototype[@@match](string) + : // 21.2.5.9 RegExp.prototype[@@search](string) + + function (string) { + return regexMethod.call(string, this); + }, + ); + } + if (sham) + createNonEnumerableProperty( + RegExp.prototype[SYMBOL], + "sham", + true, + ); + }; + }, + { + "../internals/create-non-enumerable-property": 56, + "../internals/fails": 69, + "../internals/redefine": 126, + "../internals/regexp-exec": 128, + "../internals/well-known-symbol": 166, + "../modules/es.regexp.exec": 205, + }, + ], + 71: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + module.exports = !fails(function () { + return Object.isExtensible(Object.preventExtensions({})); + }); + }, + { + "../internals/fails": 69, + }, + ], + 72: [ + function (_dereq_, module, exports) { + var aFunction = _dereq_("../internals/a-function"); + // optional / simple context binding + module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: + return function () { + return fn.call(that); + }; + case 1: + return function (a) { + return fn.call(that, a); + }; + case 2: + return function (a, b) { + return fn.call(that, a, b); + }; + case 3: + return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function () /* ...args */ + { + return fn.apply(that, arguments); + }; + }; + }, + { + "../internals/a-function": 23, + }, + ], + 73: [ + function (_dereq_, module, exports) { + "use strict"; + var aFunction = _dereq_("../internals/a-function"); + var isObject = _dereq_("../internals/is-object"); + var slice = [].slice; + var factories = {}; + var construct = function (C, argsLength, args) { + if (!(argsLength in factories)) { + for (var list = [], i = 0; i < argsLength; i++) + list[i] = "a[" + i + "]"; + // eslint-disable-next-line no-new-func + factories[argsLength] = Function( + "C,a", + "return new C(" + list.join(",") + ")", + ); + } + return factories[argsLength](C, args); + }; + // `Function.prototype.bind` method implementation + // https://tc39.github.io/ecma262/#sec-function.prototype.bind + module.exports = + Function.bind || + function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = slice.call(arguments, 1); + var boundFunction = function bound /* args... */() { + var args = partArgs.concat(slice.call(arguments)); + return this instanceof boundFunction + ? construct(fn, args.length, args) + : fn.apply(that, args); + }; + if (isObject(fn.prototype)) + boundFunction.prototype = fn.prototype; + return boundFunction; + }; + }, + { + "../internals/a-function": 23, + "../internals/is-object": 92, + }, + ], + 74: [ + function (_dereq_, module, exports) { + var path = _dereq_("../internals/path"); + var global = _dereq_("../internals/global"); + var aFunction = function (variable) { + return typeof variable == "function" ? variable : undefined; + }; + module.exports = function (namespace, method) { + return arguments.length < 2 + ? aFunction(path[namespace]) || aFunction(global[namespace]) + : (path[namespace] && path[namespace][method]) || + (global[namespace] && global[namespace][method]); + }; + }, + { + "../internals/global": 77, + "../internals/path": 122, + }, + ], + 75: [ + function (_dereq_, module, exports) { + var classof = _dereq_("../internals/classof"); + var Iterators = _dereq_("../internals/iterators"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var ITERATOR = wellKnownSymbol("iterator"); + module.exports = function (it) { + if (it != undefined) + return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; + }; + }, + { + "../internals/classof": 47, + "../internals/iterators": 97, + "../internals/well-known-symbol": 166, + }, + ], + 76: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + var getIteratorMethod = _dereq_("../internals/get-iterator-method"); + module.exports = function (it) { + var iteratorMethod = getIteratorMethod(it); + if (typeof iteratorMethod != "function") { + throw TypeError(String(it) + " is not iterable"); + } + return anObject(iteratorMethod.call(it)); + }; + }, + { + "../internals/an-object": 28, + "../internals/get-iterator-method": 75, + }, + ], + 77: [ + function (_dereq_, module, exports) { + (function (global) { + var check = function (it) { + return it && it.Math == Math && it; + }; + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + module.exports = // eslint-disable-next-line no-undef + check(typeof globalThis == "object" && globalThis) || + check(typeof window == "object" && window) || + check(typeof self == "object" && self) || + check(typeof global == "object" && global) || // eslint-disable-next-line no-new-func + Function("return this")(); + }).call( + this, + typeof global !== "undefined" + ? global + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : {}, + ); + }, + {}, + ], + 78: [ + function (_dereq_, module, exports) { + var hasOwnProperty = {}.hasOwnProperty; + module.exports = function (it, key) { + return hasOwnProperty.call(it, key); + }; + }, + {}, + ], + 79: [ + function (_dereq_, module, exports) { + module.exports = {}; + }, + {}, + ], + 80: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + module.exports = function (a, b) { + var console = global.console; + if (console && console.error) { + arguments.length === 1 ? console.error(a) : console.error(a, b); + } + }; + }, + { + "../internals/global": 77, + }, + ], + 81: [ + function (_dereq_, module, exports) { + var getBuiltIn = _dereq_("../internals/get-built-in"); + module.exports = getBuiltIn("document", "documentElement"); + }, + { + "../internals/get-built-in": 74, + }, + ], + 82: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var fails = _dereq_("../internals/fails"); + var createElement = _dereq_("../internals/document-create-element"); + // Thank's IE8 for his funny defineProperty + module.exports = + !DESCRIPTORS && + !fails(function () { + return ( + Object.defineProperty(createElement("div"), "a", { + get: function () { + return 7; + }, + }).a != 7 + ); + }); + }, + { + "../internals/descriptors": 61, + "../internals/document-create-element": 62, + "../internals/fails": 69, + }, + ], + 83: [ + function (_dereq_, module, exports) { + // IEEE754 conversions based on https://github.com/feross/ieee754 + // eslint-disable-next-line no-shadow-restricted-names + var Infinity = 1 / 0; + var abs = Math.abs; + var pow = Math.pow; + var floor = Math.floor; + var log = Math.log; + var LN2 = Math.LN2; + var pack = function (number, mantissaLength, bytes) { + var buffer = new Array(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; + var sign = number < 0 || (number === 0 && 1 / number < 0) ? 1 : 0; + var index = 0; + var exponent, mantissa, c; + number = abs(number); + // eslint-disable-next-line no-self-compare + if (number != number || number === Infinity) { + // eslint-disable-next-line no-self-compare + mantissa = number != number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + if (number * (c = pow(2, -exponent)) < 1) { + exponent--; + c *= 2; + } + if (exponent + eBias >= 1) { + number += rt / c; + } else { + number += rt * pow(2, 1 - eBias); + } + if (number * c >= 2) { + exponent++; + c /= 2; + } + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c - 1) * pow(2, mantissaLength); + exponent = exponent + eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; + } + } + for ( + ; + mantissaLength >= 8; + buffer[index++] = mantissa & 255, + mantissa /= 256, + mantissaLength -= 8 + ); + exponent = (exponent << mantissaLength) | mantissa; + exponentLength += mantissaLength; + for ( + ; + exponentLength > 0; + buffer[index++] = exponent & 255, + exponent /= 256, + exponentLength -= 8 + ); + buffer[--index] |= sign * 128; + return buffer; + }; + var unpack = function (buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + for ( + ; + nBits > 0; + exponent = exponent * 256 + buffer[index], index--, nBits -= 8 + ); + mantissa = exponent & ((1 << -nBits) - 1); + exponent >>= -nBits; + nBits += mantissaLength; + for ( + ; + nBits > 0; + mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8 + ); + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? -Infinity : Infinity; + } else { + mantissa = mantissa + pow(2, mantissaLength); + exponent = exponent - eBias; + } + return ( + (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength) + ); + }; + module.exports = { + pack: pack, + unpack: unpack, + }; + }, + {}, + ], + 84: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + var classof = _dereq_("../internals/classof-raw"); + var split = "".split; + // fallback for non-array-like ES3 and non-enumerable old V8 strings + module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins + return !Object("z").propertyIsEnumerable(0); + }) + ? function (it) { + return classof(it) == "String" + ? split.call(it, "") + : Object(it); + } + : Object; + }, + { + "../internals/classof-raw": 46, + "../internals/fails": 69, + }, + ], + 85: [ + function (_dereq_, module, exports) { + var isObject = _dereq_("../internals/is-object"); + var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); + // makes subclassing work correct for wrapped built-ins + module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == "function" && + NewTarget !== Wrapper && + isObject((NewTargetPrototype = NewTarget.prototype)) && + NewTargetPrototype !== Wrapper.prototype + ) + setPrototypeOf($this, NewTargetPrototype); + return $this; + }; + }, + { + "../internals/is-object": 92, + "../internals/object-set-prototype-of": 119, + }, + ], + 86: [ + function (_dereq_, module, exports) { + var store = _dereq_("../internals/shared-store"); + var functionToString = Function.toString; + // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper + if (typeof store.inspectSource != "function") { + store.inspectSource = function (it) { + return functionToString.call(it); + }; + } + module.exports = store.inspectSource; + }, + { + "../internals/shared-store": 137, + }, + ], + 87: [ + function (_dereq_, module, exports) { + var hiddenKeys = _dereq_("../internals/hidden-keys"); + var isObject = _dereq_("../internals/is-object"); + var has = _dereq_("../internals/has"); + var defineProperty = _dereq_("../internals/object-define-property").f; + var uid = _dereq_("../internals/uid"); + var FREEZING = _dereq_("../internals/freezing"); + var METADATA = uid("meta"); + var id = 0; + var isExtensible = + Object.isExtensible || + function () { + return true; + }; + var setMetadata = function (it) { + defineProperty(it, METADATA, { + value: { + objectID: "O" + ++id, + // object ID + weakData: {}, // weak collections IDs + }, + }); + }; + var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject(it)) + return typeof it == "symbol" + ? it + : (typeof it == "string" ? "S" : "P") + it; + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return "F"; + // not necessary to add metadata + if (!create) return "E"; + // add missing metadata + setMetadata(it); + // return object ID + } + return it[METADATA].objectID; + }; + var getWeakData = function (it, create) { + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs + } + return it[METADATA].weakData; + }; + // add metadata on freeze-family methods calling + var onFreeze = function (it) { + if ( + FREEZING && + meta.REQUIRED && + isExtensible(it) && + !has(it, METADATA) + ) + setMetadata(it); + return it; + }; + var meta = (module.exports = { + REQUIRED: false, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze, + }); + hiddenKeys[METADATA] = true; + }, + { + "../internals/freezing": 71, + "../internals/has": 78, + "../internals/hidden-keys": 79, + "../internals/is-object": 92, + "../internals/object-define-property": 110, + "../internals/uid": 163, + }, + ], + 88: [ + function (_dereq_, module, exports) { + var NATIVE_WEAK_MAP = _dereq_("../internals/native-weak-map"); + var global = _dereq_("../internals/global"); + var isObject = _dereq_("../internals/is-object"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var objectHas = _dereq_("../internals/has"); + var sharedKey = _dereq_("../internals/shared-key"); + var hiddenKeys = _dereq_("../internals/hidden-keys"); + var WeakMap = global.WeakMap; + var set, get, has; + var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); + }; + var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError("Incompatible receiver, " + TYPE + " required"); + } + return state; + }; + }; + if (NATIVE_WEAK_MAP) { + var store = new WeakMap(); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || {}; + }; + has = function (it) { + return wmhas.call(store, it); + }; + } else { + var STATE = sharedKey("state"); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return objectHas(it, STATE); + }; + } + module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor, + }; + }, + { + "../internals/create-non-enumerable-property": 56, + "../internals/global": 77, + "../internals/has": 78, + "../internals/hidden-keys": 79, + "../internals/is-object": 92, + "../internals/native-weak-map": 103, + "../internals/shared-key": 136, + }, + ], + 89: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var Iterators = _dereq_("../internals/iterators"); + var ITERATOR = wellKnownSymbol("iterator"); + var ArrayPrototype = Array.prototype; + // check on default Array iterator + module.exports = function (it) { + return ( + it !== undefined && + (Iterators.Array === it || ArrayPrototype[ITERATOR] === it) + ); + }; + }, + { + "../internals/iterators": 97, + "../internals/well-known-symbol": 166, + }, + ], + 90: [ + function (_dereq_, module, exports) { + var classof = _dereq_("../internals/classof-raw"); + // `IsArray` abstract operation + // https://tc39.github.io/ecma262/#sec-isarray + module.exports = + Array.isArray || + function isArray(arg) { + return classof(arg) == "Array"; + }; + }, + { + "../internals/classof-raw": 46, + }, + ], + 91: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + var replacement = /#|\.prototype\./; + var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL + ? true + : value == NATIVE + ? false + : typeof detection == "function" + ? fails(detection) + : !!detection; + }; + var normalize = (isForced.normalize = function (string) { + return String(string).replace(replacement, ".").toLowerCase(); + }); + var data = (isForced.data = {}); + var NATIVE = (isForced.NATIVE = "N"); + var POLYFILL = (isForced.POLYFILL = "P"); + module.exports = isForced; + }, + { + "../internals/fails": 69, + }, + ], + 92: [ + function (_dereq_, module, exports) { + module.exports = function (it) { + return typeof it === "object" + ? it !== null + : typeof it === "function"; + }; + }, + {}, + ], + 93: [ + function (_dereq_, module, exports) { + module.exports = false; + }, + {}, + ], + 94: [ + function (_dereq_, module, exports) { + var isObject = _dereq_("../internals/is-object"); + var classof = _dereq_("../internals/classof-raw"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var MATCH = wellKnownSymbol("match"); + // `IsRegExp` abstract operation + // https://tc39.github.io/ecma262/#sec-isregexp + module.exports = function (it) { + var isRegExp; + return ( + isObject(it) && + ((isRegExp = it[MATCH]) !== undefined + ? !!isRegExp + : classof(it) == "RegExp") + ); + }; + }, + { + "../internals/classof-raw": 46, + "../internals/is-object": 92, + "../internals/well-known-symbol": 166, + }, + ], + 95: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + var isArrayIteratorMethod = _dereq_( + "../internals/is-array-iterator-method", + ); + var toLength = _dereq_("../internals/to-length"); + var bind = _dereq_("../internals/function-bind-context"); + var getIteratorMethod = _dereq_("../internals/get-iterator-method"); + var callWithSafeIterationClosing = _dereq_( + "../internals/call-with-safe-iteration-closing", + ); + var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; + }; + var iterate = (module.exports = function ( + iterable, + fn, + that, + AS_ENTRIES, + IS_ITERATOR, + ) { + var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1); + var iterator, iterFn, index, length, result, next, step; + if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (typeof iterFn != "function") + throw TypeError("Target is not iterable"); + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for ( + index = 0, length = toLength(iterable.length); + length > index; + index++ + ) { + result = AS_ENTRIES + ? boundFunction( + anObject((step = iterable[index]))[0], + step[1], + ) + : boundFunction(iterable[index]); + if (result && result instanceof Result) return result; + } + return new Result(false); + } + iterator = iterFn.call(iterable); + } + next = iterator.next; + while (!(step = next.call(iterator)).done) { + result = callWithSafeIterationClosing( + iterator, + boundFunction, + step.value, + AS_ENTRIES, + ); + if ( + typeof result == "object" && + result && + result instanceof Result + ) + return result; + } + return new Result(false); + }); + iterate.stop = function (result) { + return new Result(true, result); + }; + }, + { + "../internals/an-object": 28, + "../internals/call-with-safe-iteration-closing": 44, + "../internals/function-bind-context": 72, + "../internals/get-iterator-method": 75, + "../internals/is-array-iterator-method": 89, + "../internals/to-length": 154, + }, + ], + 96: [ + function (_dereq_, module, exports) { + "use strict"; + var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var has = _dereq_("../internals/has"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var IS_PURE = _dereq_("../internals/is-pure"); + var ITERATOR = wellKnownSymbol("iterator"); + var BUGGY_SAFARI_ITERATORS = false; + var returnThis = function () { + return this; + }; + // `%IteratorPrototype%` object + // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object + var IteratorPrototype, + PrototypeOfArrayIteratorPrototype, + arrayIterator; + if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!("next" in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf( + getPrototypeOf(arrayIterator), + ); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) + IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } + } + if (IteratorPrototype == undefined) IteratorPrototype = {}; + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { + createNonEnumerableProperty( + IteratorPrototype, + ITERATOR, + returnThis, + ); + } + module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS, + }; + }, + { + "../internals/create-non-enumerable-property": 56, + "../internals/has": 78, + "../internals/is-pure": 93, + "../internals/object-get-prototype-of": 115, + "../internals/well-known-symbol": 166, + }, + ], + 97: [ + function (_dereq_, module, exports) { + module.exports = {}; + }, + {}, + ], + 98: [ + function (_dereq_, module, exports) { + // `Math.sign` method implementation + // https://tc39.github.io/ecma262/#sec-math.sign + module.exports = + Math.sign || + function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; + }; + }, + {}, + ], + 99: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var getOwnPropertyDescriptor = _dereq_( + "../internals/object-get-own-property-descriptor", + ).f; + var classof = _dereq_("../internals/classof-raw"); + var macrotask = _dereq_("../internals/task").set; + var IS_IOS = _dereq_("../internals/engine-is-ios"); + var MutationObserver = + global.MutationObserver || global.WebKitMutationObserver; + var process = global.process; + var Promise = global.Promise; + var IS_NODE = classof(process) == "process"; + // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` + var queueMicrotaskDescriptor = getOwnPropertyDescriptor( + global, + "queueMicrotask", + ); + var queueMicrotask = + queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; + var flush, head, last, notify, toggle, node, promise, then; + // modern engines have queueMicrotask method + if (!queueMicrotask) { + flush = function () { + var parent, fn; + if (IS_NODE && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (error) { + if (head) notify(); + else last = undefined; + throw error; + } + } + last = undefined; + if (parent) parent.enter(); + }; + // Node.js + if (IS_NODE) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + } else if (MutationObserver && !IS_IOS) { + toggle = true; + node = document.createTextNode(""); + new MutationObserver(flush).observe(node, { + characterData: true, + }); + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + promise = Promise.resolve(undefined); + then = promise.then; + notify = function () { + then.call(promise, flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + } + module.exports = + queueMicrotask || + function (fn) { + var task = { + fn: fn, + next: undefined, + }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } + last = task; + }; + }, + { + "../internals/classof-raw": 46, + "../internals/engine-is-ios": 64, + "../internals/global": 77, + "../internals/object-get-own-property-descriptor": 111, + "../internals/task": 148, + }, + ], + 100: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + module.exports = global.Promise; + }, + { + "../internals/global": 77, + }, + ], + 101: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + module.exports = + !!Object.getOwnPropertySymbols && + !fails(function () { + // Chrome 38 Symbol has incorrect toString conversion + // eslint-disable-next-line no-undef + return !String(Symbol()); + }); + }, + { + "../internals/fails": 69, + }, + ], + 102: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var IS_PURE = _dereq_("../internals/is-pure"); + var ITERATOR = wellKnownSymbol("iterator"); + module.exports = !fails(function () { + var url = new URL("b?a=1&b=2&c=3", "http://a"); + var searchParams = url.searchParams; + var result = ""; + url.pathname = "c%20d"; + searchParams.forEach(function (value, key) { + searchParams["delete"]("b"); + result += key + value; + }); + return ( + (IS_PURE && !url.toJSON) || + !searchParams.sort || + url.href !== "http://a/c%20d?a=1&c=3" || + searchParams.get("c") !== "3" || + String(new URLSearchParams("?a=1")) !== "a=1" || + !searchParams[ITERATOR] || // throws in Edge + new URL("https://a@b").username !== "a" || + new URLSearchParams(new URLSearchParams("a=b")).get("a") !== + "b" || // not punycoded in Edge + new URL("http://тест").host !== "xn--e1aybc" || // not escaped in Chrome 62- + new URL("http://a#б").hash !== "#%D0%B1" || // fails in Chrome 66- + result !== "a1c3" || // throws in Safari + new URL("http://x", undefined).host !== "x" + ); + }); + }, + { + "../internals/fails": 69, + "../internals/is-pure": 93, + "../internals/well-known-symbol": 166, + }, + ], + 103: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var inspectSource = _dereq_("../internals/inspect-source"); + var WeakMap = global.WeakMap; + module.exports = + typeof WeakMap === "function" && + /native code/.test(inspectSource(WeakMap)); + }, + { + "../internals/global": 77, + "../internals/inspect-source": 86, + }, + ], + 104: [ + function (_dereq_, module, exports) { + "use strict"; + var aFunction = _dereq_("../internals/a-function"); + var PromiseCapability = function (C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) + throw TypeError("Bad Promise constructor"); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); + }; + // 25.4.1.5 NewPromiseCapability(C) + module.exports.f = function (C) { + return new PromiseCapability(C); + }; + }, + { + "../internals/a-function": 23, + }, + ], + 105: [ + function (_dereq_, module, exports) { + var isRegExp = _dereq_("../internals/is-regexp"); + module.exports = function (it) { + if (isRegExp(it)) { + throw TypeError("The method doesn't accept regular expressions"); + } + return it; + }; + }, + { + "../internals/is-regexp": 94, + }, + ], + 106: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var globalIsFinite = global.isFinite; + // `Number.isFinite` method + // https://tc39.github.io/ecma262/#sec-number.isfinite + module.exports = + Number.isFinite || + function isFinite(it) { + return typeof it == "number" && globalIsFinite(it); + }; + }, + { + "../internals/global": 77, + }, + ], + 107: [ + function (_dereq_, module, exports) { + "use strict"; + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var fails = _dereq_("../internals/fails"); + var objectKeys = _dereq_("../internals/object-keys"); + var getOwnPropertySymbolsModule = _dereq_( + "../internals/object-get-own-property-symbols", + ); + var propertyIsEnumerableModule = _dereq_( + "../internals/object-property-is-enumerable", + ); + var toObject = _dereq_("../internals/to-object"); + var IndexedObject = _dereq_("../internals/indexed-object"); + var nativeAssign = Object.assign; + var defineProperty = Object.defineProperty; + // `Object.assign` method + // https://tc39.github.io/ecma262/#sec-object.assign + module.exports = + !nativeAssign || + fails(function () { + // should have correct order of operations (Edge bug) + if ( + DESCRIPTORS && + nativeAssign( + { + b: 1, + }, + nativeAssign( + defineProperty({}, "a", { + enumerable: true, + get: function () { + defineProperty(this, "b", { + value: 3, + enumerable: false, + }); + }, + }), + { + b: 2, + }, + ), + ).b !== 1 + ) + return true; + // should work with symbols and should have deterministic property order (V8 bug) + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var symbol = Symbol(); + var alphabet = "abcdefghijklmnopqrst"; + A[symbol] = 7; + alphabet.split("").forEach(function (chr) { + B[chr] = chr; + }); + return ( + nativeAssign({}, A)[symbol] != 7 || + objectKeys(nativeAssign({}, B)).join("") != alphabet + ); + }) + ? function assign(target, source) { + // eslint-disable-line no-unused-vars + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols + ? objectKeys(S).concat(getOwnPropertySymbols(S)) + : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) + T[key] = S[key]; + } + } + return T; + } + : nativeAssign; + }, + { + "../internals/descriptors": 61, + "../internals/fails": 69, + "../internals/indexed-object": 84, + "../internals/object-get-own-property-symbols": 114, + "../internals/object-keys": 117, + "../internals/object-property-is-enumerable": 118, + "../internals/to-object": 155, + }, + ], + 108: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + var defineProperties = _dereq_( + "../internals/object-define-properties", + ); + var enumBugKeys = _dereq_("../internals/enum-bug-keys"); + var hiddenKeys = _dereq_("../internals/hidden-keys"); + var html = _dereq_("../internals/html"); + var documentCreateElement = _dereq_( + "../internals/document-create-element", + ); + var sharedKey = _dereq_("../internals/shared-key"); + var GT = ">"; + var LT = "<"; + var PROTOTYPE = "prototype"; + var SCRIPT = "script"; + var IE_PROTO = sharedKey("IE_PROTO"); + var EmptyConstructor = function () { + /* empty */ + }; + var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT; + }; + // Create object with fake `null` prototype: use ActiveX Object with cleared prototype + var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag("")); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; + }; + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement("iframe"); + var JS = "java" + SCRIPT + ":"; + var iframeDocument; + iframe.style.display = "none"; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag("document.F=Object")); + iframeDocument.close(); + return iframeDocument.F; + }; + // Check for document.domain and active x support + // No need to use active x approach when document.domain is not set + // see https://github.com/es-shims/es5-shim/issues/150 + // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 + // avoid IE GC bug + var activeXDocument; + var NullProtoObject = function () { + try { + /* global ActiveXObject */ + activeXDocument = + document.domain && new ActiveXObject("htmlfile"); + } catch (error) { + /* ignore */ + } + NullProtoObject = activeXDocument + ? NullProtoObjectViaActiveX(activeXDocument) + : NullProtoObjectViaIFrame(); + var length = enumBugKeys.length; + while (length--) + delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); + }; + hiddenKeys[IE_PROTO] = true; + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + module.exports = + Object.create || + function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined + ? result + : defineProperties(result, Properties); + }; + }, + { + "../internals/an-object": 28, + "../internals/document-create-element": 62, + "../internals/enum-bug-keys": 67, + "../internals/hidden-keys": 79, + "../internals/html": 81, + "../internals/object-define-properties": 109, + "../internals/shared-key": 136, + }, + ], + 109: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var anObject = _dereq_("../internals/an-object"); + var objectKeys = _dereq_("../internals/object-keys"); + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + module.exports = DESCRIPTORS + ? Object.defineProperties + : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) + definePropertyModule.f( + O, + (key = keys[index++]), + Properties[key], + ); + return O; + }; + }, + { + "../internals/an-object": 28, + "../internals/descriptors": 61, + "../internals/object-define-property": 110, + "../internals/object-keys": 117, + }, + ], + 110: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var IE8_DOM_DEFINE = _dereq_("../internals/ie8-dom-define"); + var anObject = _dereq_("../internals/an-object"); + var toPrimitive = _dereq_("../internals/to-primitive"); + var nativeDefineProperty = Object.defineProperty; + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + exports.f = DESCRIPTORS + ? nativeDefineProperty + : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) + try { + return nativeDefineProperty(O, P, Attributes); + } catch (error) { + /* empty */ + } + if ("get" in Attributes || "set" in Attributes) + throw TypeError("Accessors not supported"); + if ("value" in Attributes) O[P] = Attributes.value; + return O; + }; + }, + { + "../internals/an-object": 28, + "../internals/descriptors": 61, + "../internals/ie8-dom-define": 82, + "../internals/to-primitive": 158, + }, + ], + 111: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var propertyIsEnumerableModule = _dereq_( + "../internals/object-property-is-enumerable", + ); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var toPrimitive = _dereq_("../internals/to-primitive"); + var has = _dereq_("../internals/has"); + var IE8_DOM_DEFINE = _dereq_("../internals/ie8-dom-define"); + var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + exports.f = DESCRIPTORS + ? nativeGetOwnPropertyDescriptor + : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) + try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { + /* empty */ + } + if (has(O, P)) + return createPropertyDescriptor( + !propertyIsEnumerableModule.f.call(O, P), + O[P], + ); + }; + }, + { + "../internals/create-property-descriptor": 57, + "../internals/descriptors": 61, + "../internals/has": 78, + "../internals/ie8-dom-define": 82, + "../internals/object-property-is-enumerable": 118, + "../internals/to-indexed-object": 152, + "../internals/to-primitive": 158, + }, + ], + 112: [ + function (_dereq_, module, exports) { + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var nativeGetOwnPropertyNames = _dereq_( + "../internals/object-get-own-property-names", + ).f; + var toString = {}.toString; + var windowNames = + typeof window == "object" && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) + : []; + var getWindowNames = function (it) { + try { + return nativeGetOwnPropertyNames(it); + } catch (error) { + return windowNames.slice(); + } + }; + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == "[object Window]" + ? getWindowNames(it) + : nativeGetOwnPropertyNames(toIndexedObject(it)); + }; + }, + { + "../internals/object-get-own-property-names": 113, + "../internals/to-indexed-object": 152, + }, + ], + 113: [ + function (_dereq_, module, exports) { + var internalObjectKeys = _dereq_("../internals/object-keys-internal"); + var enumBugKeys = _dereq_("../internals/enum-bug-keys"); + var hiddenKeys = enumBugKeys.concat("length", "prototype"); + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + exports.f = + Object.getOwnPropertyNames || + function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); + }; + }, + { + "../internals/enum-bug-keys": 67, + "../internals/object-keys-internal": 116, + }, + ], + 114: [ + function (_dereq_, module, exports) { + exports.f = Object.getOwnPropertySymbols; + }, + {}, + ], + 115: [ + function (_dereq_, module, exports) { + var has = _dereq_("../internals/has"); + var toObject = _dereq_("../internals/to-object"); + var sharedKey = _dereq_("../internals/shared-key"); + var CORRECT_PROTOTYPE_GETTER = _dereq_( + "../internals/correct-prototype-getter", + ); + var IE_PROTO = sharedKey("IE_PROTO"); + var ObjectPrototype = Object.prototype; + // `Object.getPrototypeOf` method + // https://tc39.github.io/ecma262/#sec-object.getprototypeof + module.exports = CORRECT_PROTOTYPE_GETTER + ? Object.getPrototypeOf + : function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if ( + typeof O.constructor == "function" && + O instanceof O.constructor + ) { + return O.constructor.prototype; + } + return O instanceof Object ? ObjectPrototype : null; + }; + }, + { + "../internals/correct-prototype-getter": 53, + "../internals/has": 78, + "../internals/shared-key": 136, + "../internals/to-object": 155, + }, + ], + 116: [ + function (_dereq_, module, exports) { + var has = _dereq_("../internals/has"); + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var indexOf = _dereq_("../internals/array-includes").indexOf; + var hiddenKeys = _dereq_("../internals/hidden-keys"); + module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) + !has(hiddenKeys, key) && has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) + if (has(O, (key = names[i++]))) { + ~indexOf(result, key) || result.push(key); + } + return result; + }; + }, + { + "../internals/array-includes": 36, + "../internals/has": 78, + "../internals/hidden-keys": 79, + "../internals/to-indexed-object": 152, + }, + ], + 117: [ + function (_dereq_, module, exports) { + var internalObjectKeys = _dereq_("../internals/object-keys-internal"); + var enumBugKeys = _dereq_("../internals/enum-bug-keys"); + // `Object.keys` method + // https://tc39.github.io/ecma262/#sec-object.keys + module.exports = + Object.keys || + function keys(O) { + return internalObjectKeys(O, enumBugKeys); + }; + }, + { + "../internals/enum-bug-keys": 67, + "../internals/object-keys-internal": 116, + }, + ], + 118: [ + function (_dereq_, module, exports) { + "use strict"; + var nativePropertyIsEnumerable = {}.propertyIsEnumerable; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + // Nashorn ~ JDK8 bug + var NASHORN_BUG = + getOwnPropertyDescriptor && + !nativePropertyIsEnumerable.call( + { + 1: 2, + }, + 1, + ); + // `Object.prototype.propertyIsEnumerable` method implementation + // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable + exports.f = NASHORN_BUG + ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; + } + : nativePropertyIsEnumerable; + }, + {}, + ], + 119: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + var aPossiblePrototype = _dereq_("../internals/a-possible-prototype"); + // `Object.setPrototypeOf` method + // https://tc39.github.io/ecma262/#sec-object.setprototypeof + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + module.exports = + Object.setPrototypeOf || + ("__proto__" in {} + ? (function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + setter = Object.getOwnPropertyDescriptor( + Object.prototype, + "__proto__", + ).set; + setter.call(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { + /* empty */ + } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter.call(O, proto); + else O.__proto__ = proto; + return O; + }; + })() + : undefined); + }, + { + "../internals/a-possible-prototype": 24, + "../internals/an-object": 28, + }, + ], + 120: [ + function (_dereq_, module, exports) { + "use strict"; + var TO_STRING_TAG_SUPPORT = _dereq_( + "../internals/to-string-tag-support", + ); + var classof = _dereq_("../internals/classof"); + // `Object.prototype.toString` method implementation + // https://tc39.github.io/ecma262/#sec-object.prototype.tostring + module.exports = TO_STRING_TAG_SUPPORT + ? {}.toString + : function toString() { + return "[object " + classof(this) + "]"; + }; + }, + { + "../internals/classof": 47, + "../internals/to-string-tag-support": 159, + }, + ], + 121: [ + function (_dereq_, module, exports) { + var getBuiltIn = _dereq_("../internals/get-built-in"); + var getOwnPropertyNamesModule = _dereq_( + "../internals/object-get-own-property-names", + ); + var getOwnPropertySymbolsModule = _dereq_( + "../internals/object-get-own-property-symbols", + ); + var anObject = _dereq_("../internals/an-object"); + // all object keys, includes non-enumerable and symbols + module.exports = + getBuiltIn("Reflect", "ownKeys") || + function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols + ? keys.concat(getOwnPropertySymbols(it)) + : keys; + }; + }, + { + "../internals/an-object": 28, + "../internals/get-built-in": 74, + "../internals/object-get-own-property-names": 113, + "../internals/object-get-own-property-symbols": 114, + }, + ], + 122: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + module.exports = global; + }, + { + "../internals/global": 77, + }, + ], + 123: [ + function (_dereq_, module, exports) { + module.exports = function (exec) { + try { + return { + error: false, + value: exec(), + }; + } catch (error) { + return { + error: true, + value: error, + }; + } + }; + }, + {}, + ], + 124: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + var isObject = _dereq_("../internals/is-object"); + var newPromiseCapability = _dereq_( + "../internals/new-promise-capability", + ); + module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; + }; + }, + { + "../internals/an-object": 28, + "../internals/is-object": 92, + "../internals/new-promise-capability": 104, + }, + ], + 125: [ + function (_dereq_, module, exports) { + var redefine = _dereq_("../internals/redefine"); + module.exports = function (target, src, options) { + for (var key in src) redefine(target, key, src[key], options); + return target; + }; + }, + { + "../internals/redefine": 126, + }, + ], + 126: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var has = _dereq_("../internals/has"); + var setGlobal = _dereq_("../internals/set-global"); + var inspectSource = _dereq_("../internals/inspect-source"); + var InternalStateModule = _dereq_("../internals/internal-state"); + var getInternalState = InternalStateModule.get; + var enforceInternalState = InternalStateModule.enforce; + var TEMPLATE = String(String).split("String"); + (module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + if (typeof value == "function") { + if (typeof key == "string" && !has(value, "name")) + createNonEnumerableProperty(value, "name", key); + enforceInternalState(value).source = TEMPLATE.join( + typeof key == "string" ? key : "", + ); + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else createNonEnumerableProperty(O, key, value); + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, "toString", function toString() { + return ( + (typeof this == "function" && getInternalState(this).source) || + inspectSource(this) + ); + }); + }, + { + "../internals/create-non-enumerable-property": 56, + "../internals/global": 77, + "../internals/has": 78, + "../internals/inspect-source": 86, + "../internals/internal-state": 88, + "../internals/set-global": 133, + }, + ], + 127: [ + function (_dereq_, module, exports) { + var classof = _dereq_("./classof-raw"); + var regexpExec = _dereq_("./regexp-exec"); + // `RegExpExec` abstract operation + // https://tc39.github.io/ecma262/#sec-regexpexec + module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === "function") { + var result = exec.call(R, S); + if (typeof result !== "object") { + throw TypeError( + "RegExp exec method returned something other than an Object or null", + ); + } + return result; + } + if (classof(R) !== "RegExp") { + throw TypeError("RegExp#exec called on incompatible receiver"); + } + return regexpExec.call(R, S); + }; + }, + { + "./classof-raw": 46, + "./regexp-exec": 128, + }, + ], + 128: [ + function (_dereq_, module, exports) { + "use strict"; + var regexpFlags = _dereq_("./regexp-flags"); + var stickyHelpers = _dereq_("./regexp-sticky-helpers"); + var nativeExec = RegExp.prototype.exec; + // This always refers to the native implementation, because the + // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, + // which loads this file before patching the method. + var nativeReplace = String.prototype.replace; + var patchedExec = nativeExec; + var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/; + var re2 = /b*/g; + nativeExec.call(re1, "a"); + nativeExec.call(re2, "a"); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; + })(); + var UNSUPPORTED_Y = + stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET; + // nonparticipating capturing group, copied from es5-shim's String#split patch. + var NPCG_INCLUDED = /()??/.exec("")[1] !== undefined; + var PATCH = + UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y; + if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; + var sticky = UNSUPPORTED_Y && re.sticky; + var flags = regexpFlags.call(re); + var source = re.source; + var charsAdded = 0; + var strCopy = str; + if (sticky) { + flags = flags.replace("y", ""); + if (flags.indexOf("g") === -1) { + flags += "g"; + } + strCopy = String(str).slice(re.lastIndex); + // Support anchored sticky behavior. + if ( + re.lastIndex > 0 && + (!re.multiline || + (re.multiline && str[re.lastIndex - 1] !== "\n")) + ) { + source = "(?: " + source + ")"; + strCopy = " " + strCopy; + charsAdded++; + } // ^(? + rx + ) is needed, in combination with some str slicing, to + // simulate the 'y' flag. + + reCopy = new RegExp("^(?:" + source + ")", flags); + } + if (NPCG_INCLUDED) { + reCopy = new RegExp("^" + source + "$(?!\\s)", flags); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; + match = nativeExec.call(sticky ? reCopy : re, strCopy); + if (sticky) { + if (match) { + match.input = match.input.slice(charsAdded); + match[0] = match[0].slice(charsAdded); + match.index = re.lastIndex; + re.lastIndex += match[0].length; + } else re.lastIndex = 0; + } else if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global + ? match.index + match[0].length + : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + return match; + }; + } + module.exports = patchedExec; + }, + { + "./regexp-flags": 129, + "./regexp-sticky-helpers": 130, + }, + ], + 129: [ + function (_dereq_, module, exports) { + "use strict"; + var anObject = _dereq_("../internals/an-object"); + // `RegExp.prototype.flags` getter implementation + // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags + module.exports = function () { + var that = anObject(this); + var result = ""; + if (that.global) result += "g"; + if (that.ignoreCase) result += "i"; + if (that.multiline) result += "m"; + if (that.dotAll) result += "s"; + if (that.unicode) result += "u"; + if (that.sticky) result += "y"; + return result; + }; + }, + { + "../internals/an-object": 28, + }, + ], + 130: [ + function (_dereq_, module, exports) { + "use strict"; + var fails = _dereq_("./fails"); + // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, + // so we use an intermediate function. + function RE(s, f) { + return RegExp(s, f); + } + exports.UNSUPPORTED_Y = fails(function () { + // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError + var re = RE("a", "y"); + re.lastIndex = 2; + return re.exec("abcd") != null; + }); + exports.BROKEN_CARET = fails(function () { + // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 + var re = RE("^r", "gy"); + re.lastIndex = 2; + return re.exec("str") != null; + }); + }, + { + "./fails": 69, + }, + ], + 131: [ + function (_dereq_, module, exports) { + // `RequireObjectCoercible` abstract operation + // https://tc39.github.io/ecma262/#sec-requireobjectcoercible + module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; + }; + }, + {}, + ], + 132: [ + function (_dereq_, module, exports) { + // `SameValue` abstract operation + // https://tc39.github.io/ecma262/#sec-samevalue + module.exports = + Object.is || + function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + }, + {}, + ], + 133: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + module.exports = function (key, value) { + try { + createNonEnumerableProperty(global, key, value); + } catch (error) { + global[key] = value; + } + return value; + }; + }, + { + "../internals/create-non-enumerable-property": 56, + "../internals/global": 77, + }, + ], + 134: [ + function (_dereq_, module, exports) { + "use strict"; + var getBuiltIn = _dereq_("../internals/get-built-in"); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var SPECIES = wellKnownSymbol("species"); + module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = definePropertyModule.f; + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineProperty(Constructor, SPECIES, { + configurable: true, + get: function () { + return this; + }, + }); + } + }; + }, + { + "../internals/descriptors": 61, + "../internals/get-built-in": 74, + "../internals/object-define-property": 110, + "../internals/well-known-symbol": 166, + }, + ], + 135: [ + function (_dereq_, module, exports) { + var defineProperty = _dereq_("../internals/object-define-property").f; + var has = _dereq_("../internals/has"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var TO_STRING_TAG = wellKnownSymbol("toStringTag"); + module.exports = function (it, TAG, STATIC) { + if (it && !has((it = STATIC ? it : it.prototype), TO_STRING_TAG)) { + defineProperty(it, TO_STRING_TAG, { + configurable: true, + value: TAG, + }); + } + }; + }, + { + "../internals/has": 78, + "../internals/object-define-property": 110, + "../internals/well-known-symbol": 166, + }, + ], + 136: [ + function (_dereq_, module, exports) { + var shared = _dereq_("../internals/shared"); + var uid = _dereq_("../internals/uid"); + var keys = shared("keys"); + module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); + }; + }, + { + "../internals/shared": 138, + "../internals/uid": 163, + }, + ], + 137: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var setGlobal = _dereq_("../internals/set-global"); + var SHARED = "__core-js_shared__"; + var store = global[SHARED] || setGlobal(SHARED, {}); + module.exports = store; + }, + { + "../internals/global": 77, + "../internals/set-global": 133, + }, + ], + 138: [ + function (_dereq_, module, exports) { + var IS_PURE = _dereq_("../internals/is-pure"); + var store = _dereq_("../internals/shared-store"); + (module.exports = function (key, value) { + return ( + store[key] || (store[key] = value !== undefined ? value : {}) + ); + })("versions", []).push({ + version: "3.6.5", + mode: IS_PURE ? "pure" : "global", + copyright: "© 2020 Denis Pushkarev (zloirock.ru)", + }); + }, + { + "../internals/is-pure": 93, + "../internals/shared-store": 137, + }, + ], + 139: [ + function (_dereq_, module, exports) { + var anObject = _dereq_("../internals/an-object"); + var aFunction = _dereq_("../internals/a-function"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var SPECIES = wellKnownSymbol("species"); + // `SpeciesConstructor` abstract operation + // https://tc39.github.io/ecma262/#sec-speciesconstructor + module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined + ? defaultConstructor + : aFunction(S); + }; + }, + { + "../internals/a-function": 23, + "../internals/an-object": 28, + "../internals/well-known-symbol": 166, + }, + ], + 140: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + // check the existence of a method, lowercase + // of a tag and escaping quotes in arguments + module.exports = function (METHOD_NAME) { + return fails(function () { + var test = ""[METHOD_NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }); + }; + }, + { + "../internals/fails": 69, + }, + ], + 141: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_("../internals/to-integer"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + // `String.prototype.{ codePointAt, at }` methods implementation + var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = String(requireObjectCoercible($this)); + var position = toInteger(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) + return CONVERT_TO_STRING ? "" : undefined; + first = S.charCodeAt(position); + return first < 55296 || + first > 56319 || + position + 1 === size || + (second = S.charCodeAt(position + 1)) < 56320 || + second > 57343 + ? CONVERT_TO_STRING + ? S.charAt(position) + : first + : CONVERT_TO_STRING + ? S.slice(position, position + 2) + : ((first - 55296) << 10) + (second - 56320) + 65536; + }; + }; + module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true), + }; + }, + { + "../internals/require-object-coercible": 131, + "../internals/to-integer": 153, + }, + ], + 142: [ + function (_dereq_, module, exports) { + // https://github.com/zloirock/core-js/issues/280 + var userAgent = _dereq_("../internals/engine-user-agent"); + // eslint-disable-next-line unicorn/no-unsafe-regex + module.exports = + /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); + }, + { + "../internals/engine-user-agent": 65, + }, + ], + 143: [ + function (_dereq_, module, exports) { + // https://github.com/tc39/proposal-string-pad-start-end + var toLength = _dereq_("../internals/to-length"); + var repeat = _dereq_("../internals/string-repeat"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var ceil = Math.ceil; + // `String.prototype.{ padStart, padEnd }` methods implementation + var createMethod = function (IS_END) { + return function ($this, maxLength, fillString) { + var S = String(requireObjectCoercible($this)); + var stringLength = S.length; + var fillStr = fillString === undefined ? " " : String(fillString); + var intMaxLength = toLength(maxLength); + var fillLen, stringFiller; + if (intMaxLength <= stringLength || fillStr == "") return S; + fillLen = intMaxLength - stringLength; + stringFiller = repeat.call( + fillStr, + ceil(fillLen / fillStr.length), + ); + if (stringFiller.length > fillLen) + stringFiller = stringFiller.slice(0, fillLen); + return IS_END ? S + stringFiller : stringFiller + S; + }; + }; + module.exports = { + // `String.prototype.padStart` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + start: createMethod(false), + // `String.prototype.padEnd` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padend + end: createMethod(true), + }; + }, + { + "../internals/require-object-coercible": 131, + "../internals/string-repeat": 145, + "../internals/to-length": 154, + }, + ], + 144: [ + function (_dereq_, module, exports) { + "use strict"; + // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js + var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; // 0x80 + var delimiter = "-"; // '\x2D' + var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars + var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + var OVERFLOW_ERROR = + "Overflow: input needs wider integers to process"; + var baseMinusTMin = base - tMin; + var floor = Math.floor; + var stringFromCharCode = String.fromCharCode; + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + */ + var ucs2decode = function (string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 55296 && value <= 56319 && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + // Low surrogate. + output.push(((value & 1023) << 10) + (extra & 1023) + 65536); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + }; + /** + * Converts a digit/integer into a basic code point. + */ + var digitToBasic = function (digit) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26); + }; + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + */ + var adapt = function (delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; delta > (baseMinusTMin * tMax) >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew)); + }; + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + */ + // eslint-disable-next-line max-statements + var encode = function (input) { + var output = []; + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + // Cache the length. + var inputLength = input.length; + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + var i, currentValue; + // Handle the basic code points. + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < 128) { + output.push(stringFromCharCode(currentValue)); + } + } + var basicLength = output.length; // number of basic code points. + var handledCPCount = basicLength; // number of code points that have been handled; + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } // Main encoding loop: + + while (handledCPCount < inputLength) { + // All non-basic code points < n have been handled already. Find the next larger one: + var m = maxInt; + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } // Increase `delta` enough to advance the decoder's state to , but guard against overflow. + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + throw RangeError(OVERFLOW_ERROR); + } + delta += (m - n) * handledCPCountPlusOne; + n = m; + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < n && ++delta > maxInt) { + throw RangeError(OVERFLOW_ERROR); + } + if (currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (/* no condition */ var k = base; ; k += base) { + var t = + k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) break; + var qMinusT = q - t; + var baseMinusT = base - t; + output.push( + stringFromCharCode( + digitToBasic(t + (qMinusT % baseMinusT)), + ), + ); + q = floor(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q))); + bias = adapt( + delta, + handledCPCountPlusOne, + handledCPCount == basicLength, + ); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n; + } + return output.join(""); + }; + module.exports = function (input) { + var encoded = []; + var labels = input + .toLowerCase() + .replace(regexSeparators, ".") + .split("."); + var i, label; + for (i = 0; i < labels.length; i++) { + label = labels[i]; + encoded.push( + regexNonASCII.test(label) ? "xn--" + encode(label) : label, + ); + } + return encoded.join("."); + }; + }, + {}, + ], + 145: [ + function (_dereq_, module, exports) { + "use strict"; + var toInteger = _dereq_("../internals/to-integer"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + // `String.prototype.repeat` method implementation + // https://tc39.github.io/ecma262/#sec-string.prototype.repeat + module.exports = + "".repeat || + function repeat(count) { + var str = String(requireObjectCoercible(this)); + var result = ""; + var n = toInteger(count); + if (n < 0 || n == Infinity) + throw RangeError("Wrong number of repetitions"); + for (; n > 0; (n >>>= 1) && (str += str)) + if (n & 1) result += str; + return result; + }; + }, + { + "../internals/require-object-coercible": 131, + "../internals/to-integer": 153, + }, + ], + 146: [ + function (_dereq_, module, exports) { + var fails = _dereq_("../internals/fails"); + var whitespaces = _dereq_("../internals/whitespaces"); + var non = "​…᠎"; + // check that a method works with the correct list + // of whitespaces and has a correct name + module.exports = function (METHOD_NAME) { + return fails(function () { + return ( + !!whitespaces[METHOD_NAME]() || + non[METHOD_NAME]() != non || + whitespaces[METHOD_NAME].name !== METHOD_NAME + ); + }); + }; + }, + { + "../internals/fails": 69, + "../internals/whitespaces": 167, + }, + ], + 147: [ + function (_dereq_, module, exports) { + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var whitespaces = _dereq_("../internals/whitespaces"); + var whitespace = "[" + whitespaces + "]"; + var ltrim = RegExp("^" + whitespace + whitespace + "*"); + var rtrim = RegExp(whitespace + whitespace + "*$"); + // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation + var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ""); + if (TYPE & 2) string = string.replace(rtrim, ""); + return string; + }; + }; + module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + trim: createMethod(3), + }; + }, + { + "../internals/require-object-coercible": 131, + "../internals/whitespaces": 167, + }, + ], + 148: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var fails = _dereq_("../internals/fails"); + var classof = _dereq_("../internals/classof-raw"); + var bind = _dereq_("../internals/function-bind-context"); + var html = _dereq_("../internals/html"); + var createElement = _dereq_("../internals/document-create-element"); + var IS_IOS = _dereq_("../internals/engine-is-ios"); + var location = global.location; + var set = global.setImmediate; + var clear = global.clearImmediate; + var process = global.process; + var MessageChannel = global.MessageChannel; + var Dispatch = global.Dispatch; + var counter = 0; + var queue = {}; + var ONREADYSTATECHANGE = "onreadystatechange"; + var defer, channel, port; + var run = function (id) { + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var runner = function (id) { + return function () { + run(id); + }; + }; + var listener = function (event) { + run(event.data); + }; + var post = function (id) { + // old engines have not location.origin + global.postMessage( + id + "", + location.protocol + "//" + location.host, + ); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if (!set || !clear) { + set = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + (typeof fn == "function" ? fn : Function(fn)).apply( + undefined, + args, + ); + }; + defer(counter); + return counter; + }; + clear = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (classof(process) == "process") { + defer = function (id) { + process.nextTick(runner(id)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(runner(id)); + }; + // Browsers with MessageChannel, includes WebWorkers + // except iOS - https://github.com/zloirock/core-js/issues/624 + } else if (MessageChannel && !IS_IOS) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = bind(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if ( + global.addEventListener && + typeof postMessage == "function" && + !global.importScripts && + !fails(post) && + location.protocol !== "file:" + ) { + defer = post; + global.addEventListener("message", listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in createElement("script")) { + defer = function (id) { + html.appendChild(createElement("script"))[ONREADYSTATECHANGE] = + function () { + html.removeChild(this); + run(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(runner(id), 0); + }; + } + } + module.exports = { + set: set, + clear: clear, + }; + }, + { + "../internals/classof-raw": 46, + "../internals/document-create-element": 62, + "../internals/engine-is-ios": 64, + "../internals/fails": 69, + "../internals/function-bind-context": 72, + "../internals/global": 77, + "../internals/html": 81, + }, + ], + 149: [ + function (_dereq_, module, exports) { + var classof = _dereq_("../internals/classof-raw"); + // `thisNumberValue` abstract operation + // https://tc39.github.io/ecma262/#sec-thisnumbervalue + module.exports = function (value) { + if (typeof value != "number" && classof(value) != "Number") { + throw TypeError("Incorrect invocation"); + } + return +value; + }; + }, + { + "../internals/classof-raw": 46, + }, + ], + 150: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_("../internals/to-integer"); + var max = Math.max; + var min = Math.min; + // Helper for a popular repeating case of the spec: + // Let integer be ? ToInteger(index). + // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). + module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 + ? max(integer + length, 0) + : min(integer, length); + }; + }, + { + "../internals/to-integer": 153, + }, + ], + 151: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_("../internals/to-integer"); + var toLength = _dereq_("../internals/to-length"); + // `ToIndex` abstract operation + // https://tc39.github.io/ecma262/#sec-toindex + module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError("Wrong length or index"); + return length; + }; + }, + { + "../internals/to-integer": 153, + "../internals/to-length": 154, + }, + ], + 152: [ + function (_dereq_, module, exports) { + // toObject with fallback for non-array-like ES3 strings + var IndexedObject = _dereq_("../internals/indexed-object"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); + }; + }, + { + "../internals/indexed-object": 84, + "../internals/require-object-coercible": 131, + }, + ], + 153: [ + function (_dereq_, module, exports) { + var ceil = Math.ceil; + var floor = Math.floor; + // `ToInteger` abstract operation + // https://tc39.github.io/ecma262/#sec-tointeger + module.exports = function (argument) { + return isNaN((argument = +argument)) + ? 0 + : (argument > 0 ? floor : ceil)(argument); + }; + }, + {}, + ], + 154: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_("../internals/to-integer"); + var min = Math.min; + // `ToLength` abstract operation + // https://tc39.github.io/ecma262/#sec-tolength + module.exports = function (argument) { + return argument > 0 + ? min(toInteger(argument), 9007199254740991) + : 0; // 2 ** 53 - 1 == 9007199254740991 + }; + }, + { + "../internals/to-integer": 153, + }, + ], + 155: [ + function (_dereq_, module, exports) { + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + // `ToObject` abstract operation + // https://tc39.github.io/ecma262/#sec-toobject + module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); + }; + }, + { + "../internals/require-object-coercible": 131, + }, + ], + 156: [ + function (_dereq_, module, exports) { + var toPositiveInteger = _dereq_("../internals/to-positive-integer"); + module.exports = function (it, BYTES) { + var offset = toPositiveInteger(it); + if (offset % BYTES) throw RangeError("Wrong offset"); + return offset; + }; + }, + { + "../internals/to-positive-integer": 157, + }, + ], + 157: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_("../internals/to-integer"); + module.exports = function (it) { + var result = toInteger(it); + if (result < 0) + throw RangeError("The argument can't be less than 0"); + return result; + }; + }, + { + "../internals/to-integer": 153, + }, + ], + 158: [ + function (_dereq_, module, exports) { + var isObject = _dereq_("../internals/is-object"); + // `ToPrimitive` abstract operation + // https://tc39.github.io/ecma262/#sec-toprimitive + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + module.exports = function (input, PREFERRED_STRING) { + if (!isObject(input)) return input; + var fn, val; + if ( + PREFERRED_STRING && + typeof (fn = input.toString) == "function" && + !isObject((val = fn.call(input))) + ) + return val; + if ( + typeof (fn = input.valueOf) == "function" && + !isObject((val = fn.call(input))) + ) + return val; + if ( + !PREFERRED_STRING && + typeof (fn = input.toString) == "function" && + !isObject((val = fn.call(input))) + ) + return val; + throw TypeError("Can't convert object to primitive value"); + }; + }, + { + "../internals/is-object": 92, + }, + ], + 159: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var TO_STRING_TAG = wellKnownSymbol("toStringTag"); + var test = {}; + test[TO_STRING_TAG] = "z"; + module.exports = String(test) === "[object z]"; + }, + { + "../internals/well-known-symbol": 166, + }, + ], + 160: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var global = _dereq_("../internals/global"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = _dereq_( + "../internals/typed-array-constructors-require-wrappers", + ); + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var ArrayBufferModule = _dereq_("../internals/array-buffer"); + var anInstance = _dereq_("../internals/an-instance"); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var toLength = _dereq_("../internals/to-length"); + var toIndex = _dereq_("../internals/to-index"); + var toOffset = _dereq_("../internals/to-offset"); + var toPrimitive = _dereq_("../internals/to-primitive"); + var has = _dereq_("../internals/has"); + var classof = _dereq_("../internals/classof"); + var isObject = _dereq_("../internals/is-object"); + var create = _dereq_("../internals/object-create"); + var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); + var getOwnPropertyNames = _dereq_( + "../internals/object-get-own-property-names", + ).f; + var typedArrayFrom = _dereq_("../internals/typed-array-from"); + var forEach = _dereq_("../internals/array-iteration").forEach; + var setSpecies = _dereq_("../internals/set-species"); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var getOwnPropertyDescriptorModule = _dereq_( + "../internals/object-get-own-property-descriptor", + ); + var InternalStateModule = _dereq_("../internals/internal-state"); + var inheritIfRequired = _dereq_("../internals/inherit-if-required"); + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var nativeDefineProperty = definePropertyModule.f; + var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var round = Math.round; + var RangeError = global.RangeError; + var ArrayBuffer = ArrayBufferModule.ArrayBuffer; + var DataView = ArrayBufferModule.DataView; + var NATIVE_ARRAY_BUFFER_VIEWS = + ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; + var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; + var TypedArray = ArrayBufferViewCore.TypedArray; + var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; + var aTypedArrayConstructor = + ArrayBufferViewCore.aTypedArrayConstructor; + var isTypedArray = ArrayBufferViewCore.isTypedArray; + var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT"; + var WRONG_LENGTH = "Wrong length"; + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; + }; + var addGetter = function (it, key) { + nativeDefineProperty(it, key, { + get: function () { + return getInternalState(this)[key]; + }, + }); + }; + var isArrayBuffer = function (it) { + var klass; + return ( + it instanceof ArrayBuffer || + (klass = classof(it)) == "ArrayBuffer" || + klass == "SharedArrayBuffer" + ); + }; + var isTypedArrayIndex = function (target, key) { + return ( + isTypedArray(target) && + typeof key != "symbol" && + key in target && + String(+key) == String(key) + ); + }; + var wrappedGetOwnPropertyDescriptor = + function getOwnPropertyDescriptor(target, key) { + return isTypedArrayIndex(target, (key = toPrimitive(key, true))) + ? createPropertyDescriptor(2, target[key]) + : nativeGetOwnPropertyDescriptor(target, key); + }; + var wrappedDefineProperty = function defineProperty( + target, + key, + descriptor, + ) { + if ( + isTypedArrayIndex(target, (key = toPrimitive(key, true))) && + isObject(descriptor) && + has(descriptor, "value") && + !has(descriptor, "get") && + !has(descriptor, "set") && // TODO: add validation descriptor w/o calling accessors + !descriptor.configurable && + (!has(descriptor, "writable") || descriptor.writable) && + (!has(descriptor, "enumerable") || descriptor.enumerable) + ) { + target[key] = descriptor.value; + return target; + } + return nativeDefineProperty(target, key, descriptor); + }; + if (DESCRIPTORS) { + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + getOwnPropertyDescriptorModule.f = + wrappedGetOwnPropertyDescriptor; + definePropertyModule.f = wrappedDefineProperty; + addGetter(TypedArrayPrototype, "buffer"); + addGetter(TypedArrayPrototype, "byteOffset"); + addGetter(TypedArrayPrototype, "byteLength"); + addGetter(TypedArrayPrototype, "length"); + } + $( + { + target: "Object", + stat: true, + forced: !NATIVE_ARRAY_BUFFER_VIEWS, + }, + { + getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, + defineProperty: wrappedDefineProperty, + }, + ); + module.exports = function (TYPE, wrapper, CLAMPED) { + var BYTES = TYPE.match(/\d+$/)[0] / 8; + var CONSTRUCTOR_NAME = + TYPE + (CLAMPED ? "Clamped" : "") + "Array"; + var GETTER = "get" + TYPE; + var SETTER = "set" + TYPE; + var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; + var TypedArrayConstructor = NativeTypedArrayConstructor; + var TypedArrayConstructorPrototype = + TypedArrayConstructor && TypedArrayConstructor.prototype; + var exported = {}; + var getter = function (that, index) { + var data = getInternalState(that); + return data.view[GETTER](index * BYTES + data.byteOffset, true); + }; + var setter = function (that, index, value) { + var data = getInternalState(that); + if (CLAMPED) + value = + (value = round(value)) < 0 + ? 0 + : value > 255 + ? 255 + : value & 255; + data.view[SETTER](index * BYTES + data.byteOffset, value, true); + }; + var addElement = function (that, index) { + nativeDefineProperty(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true, + }); + }; + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + TypedArrayConstructor = wrapper( + function (that, data, offset, $length) { + anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); + var index = 0; + var byteOffset = 0; + var buffer, byteLength, length; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new ArrayBuffer(byteLength); + } else if (isArrayBuffer(data)) { + buffer = data; + byteOffset = toOffset(offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - byteOffset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + byteOffset > $len) + throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (isTypedArray(data)) { + return fromList(TypedArrayConstructor, data); + } else { + return typedArrayFrom.call(TypedArrayConstructor, data); + } + setInternalState(that, { + buffer: buffer, + byteOffset: byteOffset, + byteLength: byteLength, + length: length, + view: new DataView(buffer), + }); + while (index < length) addElement(that, index++); + }, + ); + if (setPrototypeOf) + setPrototypeOf(TypedArrayConstructor, TypedArray); + TypedArrayConstructorPrototype = + TypedArrayConstructor.prototype = create(TypedArrayPrototype); + } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { + TypedArrayConstructor = wrapper( + function (dummy, data, typedArrayOffset, $length) { + anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); + return inheritIfRequired( + (function () { + if (!isObject(data)) + return new NativeTypedArrayConstructor(toIndex(data)); + if (isArrayBuffer(data)) + return $length !== undefined + ? new NativeTypedArrayConstructor( + data, + toOffset(typedArrayOffset, BYTES), + $length, + ) + : typedArrayOffset !== undefined + ? new NativeTypedArrayConstructor( + data, + toOffset(typedArrayOffset, BYTES), + ) + : new NativeTypedArrayConstructor(data); + if (isTypedArray(data)) + return fromList(TypedArrayConstructor, data); + return typedArrayFrom.call(TypedArrayConstructor, data); + })(), + dummy, + TypedArrayConstructor, + ); + }, + ); + if (setPrototypeOf) + setPrototypeOf(TypedArrayConstructor, TypedArray); + forEach( + getOwnPropertyNames(NativeTypedArrayConstructor), + function (key) { + if (!(key in TypedArrayConstructor)) { + createNonEnumerableProperty( + TypedArrayConstructor, + key, + NativeTypedArrayConstructor[key], + ); + } + }, + ); + TypedArrayConstructor.prototype = + TypedArrayConstructorPrototype; + } + if ( + TypedArrayConstructorPrototype.constructor !== + TypedArrayConstructor + ) { + createNonEnumerableProperty( + TypedArrayConstructorPrototype, + "constructor", + TypedArrayConstructor, + ); + } + if (TYPED_ARRAY_TAG) { + createNonEnumerableProperty( + TypedArrayConstructorPrototype, + TYPED_ARRAY_TAG, + CONSTRUCTOR_NAME, + ); + } + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; + $( + { + global: true, + forced: TypedArrayConstructor != NativeTypedArrayConstructor, + sham: !NATIVE_ARRAY_BUFFER_VIEWS, + }, + exported, + ); + if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { + createNonEnumerableProperty( + TypedArrayConstructor, + BYTES_PER_ELEMENT, + BYTES, + ); + } + if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { + createNonEnumerableProperty( + TypedArrayConstructorPrototype, + BYTES_PER_ELEMENT, + BYTES, + ); + } + setSpecies(CONSTRUCTOR_NAME); + }; + } else + module.exports = function () { + /* empty */ + }; + }, + { + "../internals/an-instance": 27, + "../internals/array-buffer": 31, + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + "../internals/classof": 47, + "../internals/create-non-enumerable-property": 56, + "../internals/create-property-descriptor": 57, + "../internals/descriptors": 61, + "../internals/export": 68, + "../internals/global": 77, + "../internals/has": 78, + "../internals/inherit-if-required": 85, + "../internals/internal-state": 88, + "../internals/is-object": 92, + "../internals/object-create": 108, + "../internals/object-define-property": 110, + "../internals/object-get-own-property-descriptor": 111, + "../internals/object-get-own-property-names": 113, + "../internals/object-set-prototype-of": 119, + "../internals/set-species": 134, + "../internals/to-index": 151, + "../internals/to-length": 154, + "../internals/to-offset": 156, + "../internals/to-primitive": 158, + "../internals/typed-array-constructors-require-wrappers": 161, + "../internals/typed-array-from": 162, + }, + ], + 161: [ + function (_dereq_, module, exports) { + /* eslint-disable no-new */ + var global = _dereq_("../internals/global"); + var fails = _dereq_("../internals/fails"); + var checkCorrectnessOfIteration = _dereq_( + "../internals/check-correctness-of-iteration", + ); + var NATIVE_ARRAY_BUFFER_VIEWS = _dereq_( + "../internals/array-buffer-view-core", + ).NATIVE_ARRAY_BUFFER_VIEWS; + var ArrayBuffer = global.ArrayBuffer; + var Int8Array = global.Int8Array; + module.exports = + !NATIVE_ARRAY_BUFFER_VIEWS || + !fails(function () { + Int8Array(1); + }) || + !fails(function () { + new Int8Array(-1); + }) || + !checkCorrectnessOfIteration(function (iterable) { + new Int8Array(); + new Int8Array(null); + new Int8Array(1.5); + new Int8Array(iterable); + }, true) || + fails(function () { + // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill + return ( + new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1 + ); + }); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/check-correctness-of-iteration": 45, + "../internals/fails": 69, + "../internals/global": 77, + }, + ], + 162: [ + function (_dereq_, module, exports) { + var toObject = _dereq_("../internals/to-object"); + var toLength = _dereq_("../internals/to-length"); + var getIteratorMethod = _dereq_("../internals/get-iterator-method"); + var isArrayIteratorMethod = _dereq_( + "../internals/is-array-iterator-method", + ); + var bind = _dereq_("../internals/function-bind-context"); + var aTypedArrayConstructor = _dereq_( + "../internals/array-buffer-view-core", + ).aTypedArrayConstructor; + module.exports = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var i, length, result, step, iterator, next; + if ( + iteratorMethod != undefined && + !isArrayIteratorMethod(iteratorMethod) + ) { + iterator = iteratorMethod.call(O); + next = iterator.next; + O = []; + while (!(step = next.call(iterator)).done) { + O.push(step.value); + } + } + if (mapping && argumentsLength > 2) { + mapfn = bind(mapfn, arguments[2], 2); + } + length = toLength(O.length); + result = new (aTypedArrayConstructor(this))(length); + for (i = 0; length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/function-bind-context": 72, + "../internals/get-iterator-method": 75, + "../internals/is-array-iterator-method": 89, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 163: [ + function (_dereq_, module, exports) { + var id = 0; + var postfix = Math.random(); + module.exports = function (key) { + return ( + "Symbol(" + + String(key === undefined ? "" : key) + + ")_" + + (++id + postfix).toString(36) + ); + }; + }, + {}, + ], + 164: [ + function (_dereq_, module, exports) { + var NATIVE_SYMBOL = _dereq_("../internals/native-symbol"); + module.exports = + NATIVE_SYMBOL && // eslint-disable-next-line no-undef + !Symbol.sham && // eslint-disable-next-line no-undef + typeof Symbol.iterator == "symbol"; + }, + { + "../internals/native-symbol": 101, + }, + ], + 165: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + exports.f = wellKnownSymbol; + }, + { + "../internals/well-known-symbol": 166, + }, + ], + 166: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var shared = _dereq_("../internals/shared"); + var has = _dereq_("../internals/has"); + var uid = _dereq_("../internals/uid"); + var NATIVE_SYMBOL = _dereq_("../internals/native-symbol"); + var USE_SYMBOL_AS_UID = _dereq_("../internals/use-symbol-as-uid"); + var WellKnownSymbolsStore = shared("wks"); + var Symbol = global.Symbol; + var createWellKnownSymbol = USE_SYMBOL_AS_UID + ? Symbol + : (Symbol && Symbol.withoutSetter) || uid; + module.exports = function (name) { + if (!has(WellKnownSymbolsStore, name)) { + if (NATIVE_SYMBOL && has(Symbol, name)) + WellKnownSymbolsStore[name] = Symbol[name]; + else + WellKnownSymbolsStore[name] = createWellKnownSymbol( + "Symbol." + name, + ); + } + return WellKnownSymbolsStore[name]; + }; + }, + { + "../internals/global": 77, + "../internals/has": 78, + "../internals/native-symbol": 101, + "../internals/shared": 138, + "../internals/uid": 163, + "../internals/use-symbol-as-uid": 164, + }, + ], + 167: [ + function (_dereq_, module, exports) { + // a string of all valid unicode whitespaces + // eslint-disable-next-line max-len + module.exports = "\t\n\v\f\r                 \u2028\u2029"; + }, + {}, + ], + 168: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var global = _dereq_("../internals/global"); + var arrayBufferModule = _dereq_("../internals/array-buffer"); + var setSpecies = _dereq_("../internals/set-species"); + var ARRAY_BUFFER = "ArrayBuffer"; + var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; + var NativeArrayBuffer = global[ARRAY_BUFFER]; + // `ArrayBuffer` constructor + // https://tc39.github.io/ecma262/#sec-arraybuffer-constructor + $( + { + global: true, + forced: NativeArrayBuffer !== ArrayBuffer, + }, + { + ArrayBuffer: ArrayBuffer, + }, + ); + setSpecies(ARRAY_BUFFER); + }, + { + "../internals/array-buffer": 31, + "../internals/export": 68, + "../internals/global": 77, + "../internals/set-species": 134, + }, + ], + 169: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var fails = _dereq_("../internals/fails"); + var isArray = _dereq_("../internals/is-array"); + var isObject = _dereq_("../internals/is-object"); + var toObject = _dereq_("../internals/to-object"); + var toLength = _dereq_("../internals/to-length"); + var createProperty = _dereq_("../internals/create-property"); + var arraySpeciesCreate = _dereq_("../internals/array-species-create"); + var arrayMethodHasSpeciesSupport = _dereq_( + "../internals/array-method-has-species-support", + ); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var V8_VERSION = _dereq_("../internals/engine-v8-version"); + var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable"); + var MAX_SAFE_INTEGER = 9007199254740991; + var MAXIMUM_ALLOWED_INDEX_EXCEEDED = "Maximum allowed index exceeded"; + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/679 + var IS_CONCAT_SPREADABLE_SUPPORT = + V8_VERSION >= 51 || + !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; + }); + var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat"); + var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); + }; + var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; + // `Array.prototype.concat` method + // https://tc39.github.io/ecma262/#sec-array.prototype.concat + // with adding support of @@isConcatSpreadable and @@species + $( + { + target: "Array", + proto: true, + forced: FORCED, + }, + { + concat: function concat(arg) { + // eslint-disable-line no-unused-vars + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) + throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + for (k = 0; k < len; k++, n++) + if (k in E) createProperty(A, n, E[k]); + } else { + if (n >= MAX_SAFE_INTEGER) + throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + createProperty(A, n++, E); + } + } + A.length = n; + return A; + }, + }, + ); + }, + { + "../internals/array-method-has-species-support": 39, + "../internals/array-species-create": 43, + "../internals/create-property": 58, + "../internals/engine-v8-version": 66, + "../internals/export": 68, + "../internals/fails": 69, + "../internals/is-array": 90, + "../internals/is-object": 92, + "../internals/to-length": 154, + "../internals/to-object": 155, + "../internals/well-known-symbol": 166, + }, + ], + 170: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var copyWithin = _dereq_("../internals/array-copy-within"); + var addToUnscopables = _dereq_("../internals/add-to-unscopables"); + // `Array.prototype.copyWithin` method + // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin + $( + { + target: "Array", + proto: true, + }, + { + copyWithin: copyWithin, + }, + ); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables("copyWithin"); + }, + { + "../internals/add-to-unscopables": 25, + "../internals/array-copy-within": 32, + "../internals/export": 68, + }, + ], + 171: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $every = _dereq_("../internals/array-iteration").every; + var arrayMethodIsStrict = _dereq_( + "../internals/array-method-is-strict", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var STRICT_METHOD = arrayMethodIsStrict("every"); + var USES_TO_LENGTH = arrayMethodUsesToLength("every"); + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + $( + { + target: "Array", + proto: true, + forced: !STRICT_METHOD || !USES_TO_LENGTH, + }, + { + every: function every(callbackfn /* , thisArg */) { + return $every( + this, + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/array-iteration": 37, + "../internals/array-method-is-strict": 40, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 172: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var fill = _dereq_("../internals/array-fill"); + var addToUnscopables = _dereq_("../internals/add-to-unscopables"); + // `Array.prototype.fill` method + // https://tc39.github.io/ecma262/#sec-array.prototype.fill + $( + { + target: "Array", + proto: true, + }, + { + fill: fill, + }, + ); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables("fill"); + }, + { + "../internals/add-to-unscopables": 25, + "../internals/array-fill": 33, + "../internals/export": 68, + }, + ], + 173: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $filter = _dereq_("../internals/array-iteration").filter; + var arrayMethodHasSpeciesSupport = _dereq_( + "../internals/array-method-has-species-support", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter"); + // Edge 14- issue + var USES_TO_LENGTH = arrayMethodUsesToLength("filter"); + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + // with adding support of @@species + $( + { + target: "Array", + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, + }, + { + filter: function filter(callbackfn /* , thisArg */) { + return $filter( + this, + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/array-iteration": 37, + "../internals/array-method-has-species-support": 39, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 174: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $findIndex = _dereq_("../internals/array-iteration").findIndex; + var addToUnscopables = _dereq_("../internals/add-to-unscopables"); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var FIND_INDEX = "findIndex"; + var SKIPS_HOLES = true; + var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX); + // Shouldn't skip holes + if (FIND_INDEX in []) + Array(1)[FIND_INDEX](function () { + SKIPS_HOLES = false; + }); + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findindex + $( + { + target: "Array", + proto: true, + forced: SKIPS_HOLES || !USES_TO_LENGTH, + }, + { + findIndex: function findIndex( + callbackfn /* , that = undefined */, + ) { + return $findIndex( + this, + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables(FIND_INDEX); + }, + { + "../internals/add-to-unscopables": 25, + "../internals/array-iteration": 37, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 175: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var forEach = _dereq_("../internals/array-for-each"); + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + $( + { + target: "Array", + proto: true, + forced: [].forEach != forEach, + }, + { + forEach: forEach, + }, + ); + }, + { + "../internals/array-for-each": 34, + "../internals/export": 68, + }, + ], + 176: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var from = _dereq_("../internals/array-from"); + var checkCorrectnessOfIteration = _dereq_( + "../internals/check-correctness-of-iteration", + ); + var INCORRECT_ITERATION = !checkCorrectnessOfIteration( + function (iterable) { + Array.from(iterable); + }, + ); + // `Array.from` method + // https://tc39.github.io/ecma262/#sec-array.from + $( + { + target: "Array", + stat: true, + forced: INCORRECT_ITERATION, + }, + { + from: from, + }, + ); + }, + { + "../internals/array-from": 35, + "../internals/check-correctness-of-iteration": 45, + "../internals/export": 68, + }, + ], + 177: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $includes = _dereq_("../internals/array-includes").includes; + var addToUnscopables = _dereq_("../internals/add-to-unscopables"); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { + ACCESSORS: true, + 1: 0, + }); + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + $( + { + target: "Array", + proto: true, + forced: !USES_TO_LENGTH, + }, + { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes( + this, + el, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables("includes"); + }, + { + "../internals/add-to-unscopables": 25, + "../internals/array-includes": 36, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 178: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $indexOf = _dereq_("../internals/array-includes").indexOf; + var arrayMethodIsStrict = _dereq_( + "../internals/array-method-is-strict", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var nativeIndexOf = [].indexOf; + var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; + var STRICT_METHOD = arrayMethodIsStrict("indexOf"); + var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { + ACCESSORS: true, + 1: 0, + }); + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + $( + { + target: "Array", + proto: true, + forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH, + }, + { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 + : $indexOf( + this, + searchElement, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/array-includes": 36, + "../internals/array-method-is-strict": 40, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 179: [ + function (_dereq_, module, exports) { + "use strict"; + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var addToUnscopables = _dereq_("../internals/add-to-unscopables"); + var Iterators = _dereq_("../internals/iterators"); + var InternalStateModule = _dereq_("../internals/internal-state"); + var defineIterator = _dereq_("../internals/define-iterator"); + var ARRAY_ITERATOR = "Array Iterator"; + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + // `Array.prototype.entries` method + // https://tc39.github.io/ecma262/#sec-array.prototype.entries + // `Array.prototype.keys` method + // https://tc39.github.io/ecma262/#sec-array.prototype.keys + // `Array.prototype.values` method + // https://tc39.github.io/ecma262/#sec-array.prototype.values + // `Array.prototype[@@iterator]` method + // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator + // `CreateArrayIterator` internal method + // https://tc39.github.io/ecma262/#sec-createarrayiterator + module.exports = defineIterator( + Array, + "Array", + function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), + // target + index: 0, + // next index + kind: kind, // kind + }); + // `%ArrayIteratorPrototype%.next` method + // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next + }, + function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return { + value: undefined, + done: true, + }; + } + if (kind == "keys") + return { + value: index, + done: false, + }; + if (kind == "values") + return { + value: target[index], + done: false, + }; + return { + value: [index, target[index]], + done: false, + }; + }, + "values", + ); + // argumentsList[@@iterator] is %ArrayProto_values% + // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject + // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject + Iterators.Arguments = Iterators.Array; + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables("keys"); + addToUnscopables("values"); + addToUnscopables("entries"); + }, + { + "../internals/add-to-unscopables": 25, + "../internals/define-iterator": 59, + "../internals/internal-state": 88, + "../internals/iterators": 97, + "../internals/to-indexed-object": 152, + }, + ], + 180: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var IndexedObject = _dereq_("../internals/indexed-object"); + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var arrayMethodIsStrict = _dereq_( + "../internals/array-method-is-strict", + ); + var nativeJoin = [].join; + var ES3_STRINGS = IndexedObject != Object; + var STRICT_METHOD = arrayMethodIsStrict("join", ","); + // `Array.prototype.join` method + // https://tc39.github.io/ecma262/#sec-array.prototype.join + $( + { + target: "Array", + proto: true, + forced: ES3_STRINGS || !STRICT_METHOD, + }, + { + join: function join(separator) { + return nativeJoin.call( + toIndexedObject(this), + separator === undefined ? "," : separator, + ); + }, + }, + ); + }, + { + "../internals/array-method-is-strict": 40, + "../internals/export": 68, + "../internals/indexed-object": 84, + "../internals/to-indexed-object": 152, + }, + ], + 181: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var lastIndexOf = _dereq_("../internals/array-last-index-of"); + // `Array.prototype.lastIndexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof + $( + { + target: "Array", + proto: true, + forced: lastIndexOf !== [].lastIndexOf, + }, + { + lastIndexOf: lastIndexOf, + }, + ); + }, + { + "../internals/array-last-index-of": 38, + "../internals/export": 68, + }, + ], + 182: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $map = _dereq_("../internals/array-iteration").map; + var arrayMethodHasSpeciesSupport = _dereq_( + "../internals/array-method-has-species-support", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map"); + // FF49- issue + var USES_TO_LENGTH = arrayMethodUsesToLength("map"); + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + // with adding support of @@species + $( + { + target: "Array", + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, + }, + { + map: function map(callbackfn /* , thisArg */) { + return $map( + this, + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/array-iteration": 37, + "../internals/array-method-has-species-support": 39, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 183: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var isObject = _dereq_("../internals/is-object"); + var isArray = _dereq_("../internals/is-array"); + var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); + var toLength = _dereq_("../internals/to-length"); + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var createProperty = _dereq_("../internals/create-property"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var arrayMethodHasSpeciesSupport = _dereq_( + "../internals/array-method-has-species-support", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice"); + var USES_TO_LENGTH = arrayMethodUsesToLength("slice", { + ACCESSORS: true, + 0: 0, + 1: 2, + }); + var SPECIES = wellKnownSymbol("species"); + var nativeSlice = [].slice; + var max = Math.max; + // `Array.prototype.slice` method + // https://tc39.github.io/ecma262/#sec-array.prototype.slice + // fallback for not array-like ES3 strings and DOM objects + $( + { + target: "Array", + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, + }, + { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex( + end === undefined ? length : end, + length, + ); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if ( + typeof Constructor == "function" && + (Constructor === Array || isArray(Constructor.prototype)) + ) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + result = new (Constructor === undefined ? Array : Constructor)( + max(fin - k, 0), + ); + for (n = 0; k < fin; k++, n++) + if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; + }, + }, + ); + }, + { + "../internals/array-method-has-species-support": 39, + "../internals/array-method-uses-to-length": 41, + "../internals/create-property": 58, + "../internals/export": 68, + "../internals/is-array": 90, + "../internals/is-object": 92, + "../internals/to-absolute-index": 150, + "../internals/to-indexed-object": 152, + "../internals/to-length": 154, + "../internals/well-known-symbol": 166, + }, + ], + 184: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $some = _dereq_("../internals/array-iteration").some; + var arrayMethodIsStrict = _dereq_( + "../internals/array-method-is-strict", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var STRICT_METHOD = arrayMethodIsStrict("some"); + var USES_TO_LENGTH = arrayMethodUsesToLength("some"); + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + $( + { + target: "Array", + proto: true, + forced: !STRICT_METHOD || !USES_TO_LENGTH, + }, + { + some: function some(callbackfn /* , thisArg */) { + return $some( + this, + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/array-iteration": 37, + "../internals/array-method-is-strict": 40, + "../internals/array-method-uses-to-length": 41, + "../internals/export": 68, + }, + ], + 185: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); + var toInteger = _dereq_("../internals/to-integer"); + var toLength = _dereq_("../internals/to-length"); + var toObject = _dereq_("../internals/to-object"); + var arraySpeciesCreate = _dereq_("../internals/array-species-create"); + var createProperty = _dereq_("../internals/create-property"); + var arrayMethodHasSpeciesSupport = _dereq_( + "../internals/array-method-has-species-support", + ); + var arrayMethodUsesToLength = _dereq_( + "../internals/array-method-uses-to-length", + ); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice"); + var USES_TO_LENGTH = arrayMethodUsesToLength("splice", { + ACCESSORS: true, + 0: 0, + 1: 2, + }); + var max = Math.max; + var min = Math.min; + var MAX_SAFE_INTEGER = 9007199254740991; + var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = + "Maximum allowed length exceeded"; + // `Array.prototype.splice` method + // https://tc39.github.io/ecma262/#sec-array.prototype.splice + // with adding support of @@species + $( + { + target: "Array", + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, + }, + { + splice: function splice(start, deleteCount /* , ...items */) { + var O = toObject(this); + var len = toLength(O.length); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min( + max(toInteger(deleteCount), 0), + len - actualStart, + ); + } + if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { + throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); + } + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) + delete O[k - 1]; + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; + } + O.length = len - actualDeleteCount + insertCount; + return A; + }, + }, + ); + }, + { + "../internals/array-method-has-species-support": 39, + "../internals/array-method-uses-to-length": 41, + "../internals/array-species-create": 43, + "../internals/create-property": 58, + "../internals/export": 68, + "../internals/to-absolute-index": 150, + "../internals/to-integer": 153, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 186: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var defineProperty = _dereq_("../internals/object-define-property").f; + var FunctionPrototype = Function.prototype; + var FunctionPrototypeToString = FunctionPrototype.toString; + var nameRE = /^\s*function ([^ (]*)/; + var NAME = "name"; + // Function instances `.name` property + // https://tc39.github.io/ecma262/#sec-function-instances-name + if (DESCRIPTORS && !(NAME in FunctionPrototype)) { + defineProperty(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return FunctionPrototypeToString.call(this).match(nameRE)[1]; + } catch (error) { + return ""; + } + }, + }); + } + }, + { + "../internals/descriptors": 61, + "../internals/object-define-property": 110, + }, + ], + 187: [ + function (_dereq_, module, exports) { + "use strict"; + var collection = _dereq_("../internals/collection"); + var collectionStrong = _dereq_("../internals/collection-strong"); + // `Map` constructor + // https://tc39.github.io/ecma262/#sec-map-objects + module.exports = collection( + "Map", + function (init) { + return function Map() { + return init(this, arguments.length ? arguments[0] : undefined); + }; + }, + collectionStrong, + ); + }, + { + "../internals/collection": 50, + "../internals/collection-strong": 48, + }, + ], + 188: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var $hypot = Math.hypot; + var abs = Math.abs; + var sqrt = Math.sqrt; + // Chrome 77 bug + // https://bugs.chromium.org/p/v8/issues/detail?id=9546 + var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; + // `Math.hypot` method + // https://tc39.github.io/ecma262/#sec-math.hypot + $( + { + target: "Math", + stat: true, + forced: BUGGY, + }, + { + hypot: function hypot(value1, value2) { + // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * sqrt(sum); + }, + }, + ); + }, + { + "../internals/export": 68, + }, + ], + 189: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var log = Math.log; + var LN2 = Math.LN2; + // `Math.log2` method + // https://tc39.github.io/ecma262/#sec-math.log2 + $( + { + target: "Math", + stat: true, + }, + { + log2: function log2(x) { + return log(x) / LN2; + }, + }, + ); + }, + { + "../internals/export": 68, + }, + ], + 190: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var sign = _dereq_("../internals/math-sign"); + // `Math.sign` method + // https://tc39.github.io/ecma262/#sec-math.sign + $( + { + target: "Math", + stat: true, + }, + { + sign: sign, + }, + ); + }, + { + "../internals/export": 68, + "../internals/math-sign": 98, + }, + ], + 191: [ + function (_dereq_, module, exports) { + "use strict"; + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var global = _dereq_("../internals/global"); + var isForced = _dereq_("../internals/is-forced"); + var redefine = _dereq_("../internals/redefine"); + var has = _dereq_("../internals/has"); + var classof = _dereq_("../internals/classof-raw"); + var inheritIfRequired = _dereq_("../internals/inherit-if-required"); + var toPrimitive = _dereq_("../internals/to-primitive"); + var fails = _dereq_("../internals/fails"); + var create = _dereq_("../internals/object-create"); + var getOwnPropertyNames = _dereq_( + "../internals/object-get-own-property-names", + ).f; + var getOwnPropertyDescriptor = _dereq_( + "../internals/object-get-own-property-descriptor", + ).f; + var defineProperty = _dereq_("../internals/object-define-property").f; + var trim = _dereq_("../internals/string-trim").trim; + var NUMBER = "Number"; + var NativeNumber = global[NUMBER]; + var NumberPrototype = NativeNumber.prototype; + // Opera ~12 has broken Object#toString + var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; + // `ToNumber` abstract operation + // https://tc39.github.io/ecma262/#sec-tonumber + var toNumber = function (argument) { + var it = toPrimitive(argument, false); + var first, third, radix, maxCode, digits, length, index, code; + if (typeof it == "string" && it.length > 2) { + it = trim(it); + first = it.charCodeAt(0); + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: + case 98: + radix = 2; + maxCode = 49; + break; + // fast equal of /^0b[01]+$/i + case 79: + case 111: + radix = 8; + maxCode = 55; + break; + // fast equal of /^0o[0-7]+$/i + default: + return +it; + } + digits = it.slice(2); + length = digits.length; + for (index = 0; index < length; index++) { + code = digits.charCodeAt(index); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } + return parseInt(digits, radix); + } + } + return +it; + }; + // `Number` constructor + // https://tc39.github.io/ecma262/#sec-number-constructor + if ( + isForced( + NUMBER, + !NativeNumber(" 0o1") || + !NativeNumber("0b1") || + NativeNumber("+0x1"), + ) + ) { + var NumberWrapper = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var dummy = this; + return dummy instanceof NumberWrapper && // check on 1..constructor(foo) case + (BROKEN_CLASSOF + ? fails(function () { + NumberPrototype.valueOf.call(dummy); + }) + : classof(dummy) != NUMBER) + ? inheritIfRequired( + new NativeNumber(toNumber(it)), + dummy, + NumberWrapper, + ) + : toNumber(it); + }; + for ( + var keys = DESCRIPTORS + ? getOwnPropertyNames(NativeNumber) + : // ES3: + ( + "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY," + // ES2015 (in case, if modules with ES2015 Number statics required before): + "EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER," + + "MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger" + ).split(","), + j = 0, + key; + keys.length > j; + j++ + ) { + if ( + has(NativeNumber, (key = keys[j])) && + !has(NumberWrapper, key) + ) { + defineProperty( + NumberWrapper, + key, + getOwnPropertyDescriptor(NativeNumber, key), + ); + } + } + NumberWrapper.prototype = NumberPrototype; + NumberPrototype.constructor = NumberWrapper; + redefine(global, NUMBER, NumberWrapper); + } + }, + { + "../internals/classof-raw": 46, + "../internals/descriptors": 61, + "../internals/fails": 69, + "../internals/global": 77, + "../internals/has": 78, + "../internals/inherit-if-required": 85, + "../internals/is-forced": 91, + "../internals/object-create": 108, + "../internals/object-define-property": 110, + "../internals/object-get-own-property-descriptor": 111, + "../internals/object-get-own-property-names": 113, + "../internals/redefine": 126, + "../internals/string-trim": 147, + "../internals/to-primitive": 158, + }, + ], + 192: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var numberIsFinite = _dereq_("../internals/number-is-finite"); + // `Number.isFinite` method + // https://tc39.github.io/ecma262/#sec-number.isfinite + $( + { + target: "Number", + stat: true, + }, + { + isFinite: numberIsFinite, + }, + ); + }, + { + "../internals/export": 68, + "../internals/number-is-finite": 106, + }, + ], + 193: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var toInteger = _dereq_("../internals/to-integer"); + var thisNumberValue = _dereq_("../internals/this-number-value"); + var repeat = _dereq_("../internals/string-repeat"); + var fails = _dereq_("../internals/fails"); + var nativeToFixed = (1).toFixed; + var floor = Math.floor; + var pow = function (x, n, acc) { + return n === 0 + ? acc + : n % 2 === 1 + ? pow(x, n - 1, acc * x) + : pow(x * x, n / 2, acc); + }; + var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } + return n; + }; + var FORCED = + (nativeToFixed && + ((0.00008).toFixed(3) !== "0.000" || + (0.9).toFixed(0) !== "1" || + (1.255).toFixed(2) !== "1.25" || + (1000000000000000100).toFixed(0) !== "1000000000000000128")) || + !fails(function () { + // V8 ~ Android 4.3- + nativeToFixed.call({}); + }); + // `Number.prototype.toFixed` method + // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed + $( + { + target: "Number", + proto: true, + forced: FORCED, + }, + { + // eslint-disable-next-line max-statements + toFixed: function toFixed(fractionDigits) { + var number = thisNumberValue(this); + var fractDigits = toInteger(fractionDigits); + var data = [0, 0, 0, 0, 0, 0]; + var sign = ""; + var result = "0"; + var e, z, j, k; + var multiply = function (n, c) { + var index = -1; + var c2 = c; + while (++index < 6) { + c2 += n * data[index]; + data[index] = c2 % 10000000; + c2 = floor(c2 / 10000000); + } + }; + var divide = function (n) { + var index = 6; + var c = 0; + while (--index >= 0) { + c += data[index]; + data[index] = floor(c / n); + c = (c % n) * 10000000; + } + }; + var dataToString = function () { + var index = 6; + var s = ""; + while (--index >= 0) { + if (s !== "" || index === 0 || data[index] !== 0) { + var t = String(data[index]); + s = s === "" ? t : s + repeat.call("0", 7 - t.length) + t; + } + } + return s; + }; + if (fractDigits < 0 || fractDigits > 20) + throw RangeError("Incorrect fraction digits"); + // eslint-disable-next-line no-self-compare + if (number != number) return "NaN"; + if (number <= -1e21 || number >= 1e21) return String(number); + if (number < 0) { + sign = "-"; + number = -number; + } + if (number > 1e-21) { + e = log(number * pow(2, 69, 1)) - 69; + z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1); + z *= 4503599627370496; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = fractDigits; + while (j >= 7) { + multiply(10000000, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + result = dataToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + result = dataToString() + repeat.call("0", fractDigits); + } + } + if (fractDigits > 0) { + k = result.length; + result = + sign + + (k <= fractDigits + ? "0." + repeat.call("0", fractDigits - k) + result + : result.slice(0, k - fractDigits) + + "." + + result.slice(k - fractDigits)); + } else { + result = sign + result; + } + return result; + }, + }, + ); + }, + { + "../internals/export": 68, + "../internals/fails": 69, + "../internals/string-repeat": 145, + "../internals/this-number-value": 149, + "../internals/to-integer": 153, + }, + ], + 194: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var assign = _dereq_("../internals/object-assign"); + // `Object.assign` method + // https://tc39.github.io/ecma262/#sec-object.assign + $( + { + target: "Object", + stat: true, + forced: Object.assign !== assign, + }, + { + assign: assign, + }, + ); + }, + { + "../internals/export": 68, + "../internals/object-assign": 107, + }, + ], + 195: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var iterate = _dereq_("../internals/iterate"); + var createProperty = _dereq_("../internals/create-property"); + // `Object.fromEntries` method + // https://github.com/tc39/proposal-object-from-entries + $( + { + target: "Object", + stat: true, + }, + { + fromEntries: function fromEntries(iterable) { + var obj = {}; + iterate( + iterable, + function (k, v) { + createProperty(obj, k, v); + }, + undefined, + true, + ); + return obj; + }, + }, + ); + }, + { + "../internals/create-property": 58, + "../internals/export": 68, + "../internals/iterate": 95, + }, + ], + 196: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var fails = _dereq_("../internals/fails"); + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var nativeGetOwnPropertyDescriptor = _dereq_( + "../internals/object-get-own-property-descriptor", + ).f; + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var FAILS_ON_PRIMITIVES = fails(function () { + nativeGetOwnPropertyDescriptor(1); + }); + var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + $( + { + target: "Object", + stat: true, + forced: FORCED, + sham: !DESCRIPTORS, + }, + { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor( + it, + key, + ) { + return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); + }, + }, + ); + }, + { + "../internals/descriptors": 61, + "../internals/export": 68, + "../internals/fails": 69, + "../internals/object-get-own-property-descriptor": 111, + "../internals/to-indexed-object": 152, + }, + ], + 197: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var fails = _dereq_("../internals/fails"); + var nativeGetOwnPropertyNames = _dereq_( + "../internals/object-get-own-property-names-external", + ).f; + var FAILS_ON_PRIMITIVES = fails(function () { + return !Object.getOwnPropertyNames(1); + }); + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + $( + { + target: "Object", + stat: true, + forced: FAILS_ON_PRIMITIVES, + }, + { + getOwnPropertyNames: nativeGetOwnPropertyNames, + }, + ); + }, + { + "../internals/export": 68, + "../internals/fails": 69, + "../internals/object-get-own-property-names-external": 112, + }, + ], + 198: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var fails = _dereq_("../internals/fails"); + var toObject = _dereq_("../internals/to-object"); + var nativeGetPrototypeOf = _dereq_( + "../internals/object-get-prototype-of", + ); + var CORRECT_PROTOTYPE_GETTER = _dereq_( + "../internals/correct-prototype-getter", + ); + var FAILS_ON_PRIMITIVES = fails(function () { + nativeGetPrototypeOf(1); + }); + // `Object.getPrototypeOf` method + // https://tc39.github.io/ecma262/#sec-object.getprototypeof + $( + { + target: "Object", + stat: true, + forced: FAILS_ON_PRIMITIVES, + sham: !CORRECT_PROTOTYPE_GETTER, + }, + { + getPrototypeOf: function getPrototypeOf(it) { + return nativeGetPrototypeOf(toObject(it)); + }, + }, + ); + }, + { + "../internals/correct-prototype-getter": 53, + "../internals/export": 68, + "../internals/fails": 69, + "../internals/object-get-prototype-of": 115, + "../internals/to-object": 155, + }, + ], + 199: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var toObject = _dereq_("../internals/to-object"); + var nativeKeys = _dereq_("../internals/object-keys"); + var fails = _dereq_("../internals/fails"); + var FAILS_ON_PRIMITIVES = fails(function () { + nativeKeys(1); + }); + // `Object.keys` method + // https://tc39.github.io/ecma262/#sec-object.keys + $( + { + target: "Object", + stat: true, + forced: FAILS_ON_PRIMITIVES, + }, + { + keys: function keys(it) { + return nativeKeys(toObject(it)); + }, + }, + ); + }, + { + "../internals/export": 68, + "../internals/fails": 69, + "../internals/object-keys": 117, + "../internals/to-object": 155, + }, + ], + 200: [ + function (_dereq_, module, exports) { + var TO_STRING_TAG_SUPPORT = _dereq_( + "../internals/to-string-tag-support", + ); + var redefine = _dereq_("../internals/redefine"); + var toString = _dereq_("../internals/object-to-string"); + // `Object.prototype.toString` method + // https://tc39.github.io/ecma262/#sec-object.prototype.tostring + if (!TO_STRING_TAG_SUPPORT) { + redefine(Object.prototype, "toString", toString, { + unsafe: true, + }); + } + }, + { + "../internals/object-to-string": 120, + "../internals/redefine": 126, + "../internals/to-string-tag-support": 159, + }, + ], + 201: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var IS_PURE = _dereq_("../internals/is-pure"); + var global = _dereq_("../internals/global"); + var getBuiltIn = _dereq_("../internals/get-built-in"); + var NativePromise = _dereq_( + "../internals/native-promise-constructor", + ); + var redefine = _dereq_("../internals/redefine"); + var redefineAll = _dereq_("../internals/redefine-all"); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var setSpecies = _dereq_("../internals/set-species"); + var isObject = _dereq_("../internals/is-object"); + var aFunction = _dereq_("../internals/a-function"); + var anInstance = _dereq_("../internals/an-instance"); + var classof = _dereq_("../internals/classof-raw"); + var inspectSource = _dereq_("../internals/inspect-source"); + var iterate = _dereq_("../internals/iterate"); + var checkCorrectnessOfIteration = _dereq_( + "../internals/check-correctness-of-iteration", + ); + var speciesConstructor = _dereq_("../internals/species-constructor"); + var task = _dereq_("../internals/task").set; + var microtask = _dereq_("../internals/microtask"); + var promiseResolve = _dereq_("../internals/promise-resolve"); + var hostReportErrors = _dereq_("../internals/host-report-errors"); + var newPromiseCapabilityModule = _dereq_( + "../internals/new-promise-capability", + ); + var perform = _dereq_("../internals/perform"); + var InternalStateModule = _dereq_("../internals/internal-state"); + var isForced = _dereq_("../internals/is-forced"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var V8_VERSION = _dereq_("../internals/engine-v8-version"); + var SPECIES = wellKnownSymbol("species"); + var PROMISE = "Promise"; + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); + var PromiseConstructor = NativePromise; + var TypeError = global.TypeError; + var document = global.document; + var process = global.process; + var $fetch = getBuiltIn("fetch"); + var newPromiseCapability = newPromiseCapabilityModule.f; + var newGenericPromiseCapability = newPromiseCapability; + var IS_NODE = classof(process) == "process"; + var DISPATCH_EVENT = !!( + document && + document.createEvent && + global.dispatchEvent + ); + var UNHANDLED_REJECTION = "unhandledrejection"; + var REJECTION_HANDLED = "rejectionhandled"; + var PENDING = 0; + var FULFILLED = 1; + var REJECTED = 2; + var HANDLED = 1; + var UNHANDLED = 2; + var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; + var FORCED = isForced(PROMISE, function () { + var GLOBAL_CORE_JS_PROMISE = + inspectSource(PromiseConstructor) !== String(PromiseConstructor); + if (!GLOBAL_CORE_JS_PROMISE) { + // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // We can't detect it synchronously, so just check versions + if (V8_VERSION === 66) return true; + // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test + if (!IS_NODE && typeof PromiseRejectionEvent != "function") + return true; + } // We need Promise#finally in the pure version for preventing prototype pollution + + if (IS_PURE && !PromiseConstructor.prototype["finally"]) + return true; + // We can't use @@species feature detection in V8 since it causes + // deoptimization and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) + return false; + // Detect correctness of subclassing with @@species support + var promise = PromiseConstructor.resolve(1); + var FakePromise = function (exec) { + exec( + function () { + /* empty */ + }, + function () { + /* empty */ + }, + ); + }; + var constructor = (promise.constructor = {}); + constructor[SPECIES] = FakePromise; + return !( + promise.then(function () { + /* empty */ + }) instanceof FakePromise + ); + }); + var INCORRECT_ITERATION = + FORCED || + !checkCorrectnessOfIteration(function (iterable) { + PromiseConstructor.all(iterable)["catch"](function () { + /* empty */ + }); + }); + // helpers + var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == "function" + ? then + : false; + }; + var notify = function (promise, state, isReject) { + if (state.notified) return; + state.notified = true; + var chain = state.reactions; + microtask(function () { + var value = state.value; + var ok = state.state == FULFILLED; + var index = 0; + // variable length - can't use forEach + while (chain.length > index) { + var reaction = chain[index++]; + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (state.rejection === UNHANDLED) + onHandleUnhandled(promise, state); + state.rejection = HANDLED; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // can throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError("Promise-chain cycle")); + } else if ((then = isThenable(result))) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (error) { + if (domain && !exited) domain.exit(); + reject(error); + } + } + state.reactions = []; + state.notified = false; + if (isReject && !state.rejection) onUnhandled(promise, state); + }); + }; + var dispatchEvent = function (name, promise, reason) { + var event, handler; + if (DISPATCH_EVENT) { + event = document.createEvent("Event"); + event.promise = promise; + event.reason = reason; + event.initEvent(name, false, true); + global.dispatchEvent(event); + } else + event = { + promise: promise, + reason: reason, + }; + if ((handler = global["on" + name])) handler(event); + else if (name === UNHANDLED_REJECTION) + hostReportErrors("Unhandled promise rejection", reason); + }; + var onUnhandled = function (promise, state) { + task.call(global, function () { + var value = state.value; + var IS_UNHANDLED = isUnhandled(state); + var result; + if (IS_UNHANDLED) { + result = perform(function () { + if (IS_NODE) { + process.emit("unhandledRejection", value, promise); + } else dispatchEvent(UNHANDLED_REJECTION, promise, value); + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + state.rejection = + IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; + if (result.error) throw result.value; + } + }); + }; + var isUnhandled = function (state) { + return state.rejection !== HANDLED && !state.parent; + }; + var onHandleUnhandled = function (promise, state) { + task.call(global, function () { + if (IS_NODE) { + process.emit("rejectionHandled", promise); + } else dispatchEvent(REJECTION_HANDLED, promise, state.value); + }); + }; + var bind = function (fn, promise, state, unwrap) { + return function (value) { + fn(promise, state, value, unwrap); + }; + }; + var internalReject = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + state.value = value; + state.state = REJECTED; + notify(promise, state, true); + }; + var internalResolve = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + try { + if (promise === value) + throw TypeError("Promise can't be resolved itself"); + var then = isThenable(value); + if (then) { + microtask(function () { + var wrapper = { + done: false, + }; + try { + then.call( + value, + bind(internalResolve, promise, wrapper, state), + bind(internalReject, promise, wrapper, state), + ); + } catch (error) { + internalReject(promise, wrapper, error, state); + } + }); + } else { + state.value = value; + state.state = FULFILLED; + notify(promise, state, false); + } + } catch (error) { + internalReject( + promise, + { + done: false, + }, + error, + state, + ); + } + }; + // constructor polyfill + if (FORCED) { + // 25.4.3.1 Promise(executor) + PromiseConstructor = function Promise(executor) { + anInstance(this, PromiseConstructor, PROMISE); + aFunction(executor); + Internal.call(this); + var state = getInternalState(this); + try { + executor( + bind(internalResolve, this, state), + bind(internalReject, this, state), + ); + } catch (error) { + internalReject(this, state, error); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + setInternalState(this, { + type: PROMISE, + done: false, + notified: false, + parent: false, + reactions: [], + rejection: false, + state: PENDING, + value: undefined, + }); + }; + Internal.prototype = redefineAll(PromiseConstructor.prototype, { + // `Promise.prototype.then` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.then + then: function then(onFulfilled, onRejected) { + var state = getInternalPromiseState(this); + var reaction = newPromiseCapability( + speciesConstructor(this, PromiseConstructor), + ); + reaction.ok = + typeof onFulfilled == "function" ? onFulfilled : true; + reaction.fail = typeof onRejected == "function" && onRejected; + reaction.domain = IS_NODE ? process.domain : undefined; + state.parent = true; + state.reactions.push(reaction); + if (state.state != PENDING) notify(this, state, false); + return reaction.promise; + }, + // `Promise.prototype.catch` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.catch + catch: function (onRejected) { + return this.then(undefined, onRejected); + }, + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + var state = getInternalState(promise); + this.promise = promise; + this.resolve = bind(internalResolve, promise, state); + this.reject = bind(internalReject, promise, state); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === PromiseConstructor || C === PromiseWrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + if (!IS_PURE && typeof NativePromise == "function") { + nativeThen = NativePromise.prototype.then; + // wrap native Promise#then for native async functions + redefine( + NativePromise.prototype, + "then", + function then(onFulfilled, onRejected) { + var that = this; + return new PromiseConstructor(function (resolve, reject) { + nativeThen.call(that, resolve, reject); + }).then(onFulfilled, onRejected); + // https://github.com/zloirock/core-js/issues/640 + }, + { + unsafe: true, + }, + ); + // wrap fetch result + if (typeof $fetch == "function") + $( + { + global: true, + enumerable: true, + forced: true, + }, + { + // eslint-disable-next-line no-unused-vars + fetch: function fetch(input /* , init */) { + return promiseResolve( + PromiseConstructor, + $fetch.apply(global, arguments), + ); + }, + }, + ); + } + } + $( + { + global: true, + wrap: true, + forced: FORCED, + }, + { + Promise: PromiseConstructor, + }, + ); + setToStringTag(PromiseConstructor, PROMISE, false, true); + setSpecies(PROMISE); + PromiseWrapper = getBuiltIn(PROMISE); + // statics + $( + { + target: PROMISE, + stat: true, + forced: FORCED, + }, + { + // `Promise.reject` method + // https://tc39.github.io/ecma262/#sec-promise.reject + reject: function reject(r) { + var capability = newPromiseCapability(this); + capability.reject.call(undefined, r); + return capability.promise; + }, + }, + ); + $( + { + target: PROMISE, + stat: true, + forced: IS_PURE || FORCED, + }, + { + // `Promise.resolve` method + // https://tc39.github.io/ecma262/#sec-promise.resolve + resolve: function resolve(x) { + return promiseResolve( + IS_PURE && this === PromiseWrapper + ? PromiseConstructor + : this, + x, + ); + }, + }, + ); + $( + { + target: PROMISE, + stat: true, + forced: INCORRECT_ITERATION, + }, + { + // `Promise.all` method + // https://tc39.github.io/ecma262/#sec-promise.all + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + var values = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + $promiseResolve.call(C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; + }, + // `Promise.race` method + // https://tc39.github.io/ecma262/#sec-promise.race + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + iterate(iterable, function (promise) { + $promiseResolve + .call(C, promise) + .then(capability.resolve, reject); + }); + }); + if (result.error) reject(result.value); + return capability.promise; + }, + }, + ); + }, + { + "../internals/a-function": 23, + "../internals/an-instance": 27, + "../internals/check-correctness-of-iteration": 45, + "../internals/classof-raw": 46, + "../internals/engine-v8-version": 66, + "../internals/export": 68, + "../internals/get-built-in": 74, + "../internals/global": 77, + "../internals/host-report-errors": 80, + "../internals/inspect-source": 86, + "../internals/internal-state": 88, + "../internals/is-forced": 91, + "../internals/is-object": 92, + "../internals/is-pure": 93, + "../internals/iterate": 95, + "../internals/microtask": 99, + "../internals/native-promise-constructor": 100, + "../internals/new-promise-capability": 104, + "../internals/perform": 123, + "../internals/promise-resolve": 124, + "../internals/redefine": 126, + "../internals/redefine-all": 125, + "../internals/set-species": 134, + "../internals/set-to-string-tag": 135, + "../internals/species-constructor": 139, + "../internals/task": 148, + "../internals/well-known-symbol": 166, + }, + ], + 202: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var getBuiltIn = _dereq_("../internals/get-built-in"); + var aFunction = _dereq_("../internals/a-function"); + var anObject = _dereq_("../internals/an-object"); + var isObject = _dereq_("../internals/is-object"); + var create = _dereq_("../internals/object-create"); + var bind = _dereq_("../internals/function-bind"); + var fails = _dereq_("../internals/fails"); + var nativeConstruct = getBuiltIn("Reflect", "construct"); + // `Reflect.construct` method + // https://tc39.github.io/ecma262/#sec-reflect.construct + // MS Edge supports only 2 arguments and argumentsList argument is optional + // FF Nightly sets third argument as `new.target`, but does not create `this` from it + var NEW_TARGET_BUG = fails(function () { + function F() { + /* empty */ + } + return !( + nativeConstruct( + function () { + /* empty */ + }, + [], + F, + ) instanceof F + ); + }); + var ARGS_BUG = !fails(function () { + nativeConstruct(function () { + /* empty */ + }); + }); + var FORCED = NEW_TARGET_BUG || ARGS_BUG; + $( + { + target: "Reflect", + stat: true, + forced: FORCED, + sham: FORCED, + }, + { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = + arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) + return nativeConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } // w/o altered newTarget, lot of arguments case + + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } // with altered newTarget, not support built-in constructors + + var proto = newTarget.prototype; + var instance = create( + isObject(proto) ? proto : Object.prototype, + ); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + }, + }, + ); + }, + { + "../internals/a-function": 23, + "../internals/an-object": 28, + "../internals/export": 68, + "../internals/fails": 69, + "../internals/function-bind": 73, + "../internals/get-built-in": 74, + "../internals/is-object": 92, + "../internals/object-create": 108, + }, + ], + 203: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var isObject = _dereq_("../internals/is-object"); + var anObject = _dereq_("../internals/an-object"); + var has = _dereq_("../internals/has"); + var getOwnPropertyDescriptorModule = _dereq_( + "../internals/object-get-own-property-descriptor", + ); + var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); + // `Reflect.get` method + // https://tc39.github.io/ecma262/#sec-reflect.get + function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var descriptor, prototype; + if (anObject(target) === receiver) return target[propertyKey]; + if ( + (descriptor = getOwnPropertyDescriptorModule.f( + target, + propertyKey, + )) + ) + return has(descriptor, "value") + ? descriptor.value + : descriptor.get === undefined + ? undefined + : descriptor.get.call(receiver); + if (isObject((prototype = getPrototypeOf(target)))) + return get(prototype, propertyKey, receiver); + } + $( + { + target: "Reflect", + stat: true, + }, + { + get: get, + }, + ); + }, + { + "../internals/an-object": 28, + "../internals/export": 68, + "../internals/has": 78, + "../internals/is-object": 92, + "../internals/object-get-own-property-descriptor": 111, + "../internals/object-get-prototype-of": 115, + }, + ], + 204: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var global = _dereq_("../internals/global"); + var isForced = _dereq_("../internals/is-forced"); + var inheritIfRequired = _dereq_("../internals/inherit-if-required"); + var defineProperty = _dereq_("../internals/object-define-property").f; + var getOwnPropertyNames = _dereq_( + "../internals/object-get-own-property-names", + ).f; + var isRegExp = _dereq_("../internals/is-regexp"); + var getFlags = _dereq_("../internals/regexp-flags"); + var stickyHelpers = _dereq_("../internals/regexp-sticky-helpers"); + var redefine = _dereq_("../internals/redefine"); + var fails = _dereq_("../internals/fails"); + var setInternalState = _dereq_("../internals/internal-state").set; + var setSpecies = _dereq_("../internals/set-species"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var MATCH = wellKnownSymbol("match"); + var NativeRegExp = global.RegExp; + var RegExpPrototype = NativeRegExp.prototype; + var re1 = /a/g; + var re2 = /a/g; + // "new" should create a new object, old webkit bug + var CORRECT_NEW = new NativeRegExp(re1) !== re1; + var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; + var FORCED = + DESCRIPTORS && + isForced( + "RegExp", + !CORRECT_NEW || + UNSUPPORTED_Y || + fails(function () { + re2[MATCH] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return ( + NativeRegExp(re1) != re1 || + NativeRegExp(re2) == re2 || + NativeRegExp(re1, "i") != "/a/i" + ); + }), + ); + // `RegExp` constructor + // https://tc39.github.io/ecma262/#sec-regexp-constructor + if (FORCED) { + var RegExpWrapper = function RegExp(pattern, flags) { + var thisIsRegExp = this instanceof RegExpWrapper; + var patternIsRegExp = isRegExp(pattern); + var flagsAreUndefined = flags === undefined; + var sticky; + if ( + !thisIsRegExp && + patternIsRegExp && + pattern.constructor === RegExpWrapper && + flagsAreUndefined + ) { + return pattern; + } + if (CORRECT_NEW) { + if (patternIsRegExp && !flagsAreUndefined) + pattern = pattern.source; + } else if (pattern instanceof RegExpWrapper) { + if (flagsAreUndefined) flags = getFlags.call(pattern); + pattern = pattern.source; + } + if (UNSUPPORTED_Y) { + sticky = !!flags && flags.indexOf("y") > -1; + if (sticky) flags = flags.replace(/y/g, ""); + } + var result = inheritIfRequired( + CORRECT_NEW + ? new NativeRegExp(pattern, flags) + : NativeRegExp(pattern, flags), + thisIsRegExp ? this : RegExpPrototype, + RegExpWrapper, + ); + if (UNSUPPORTED_Y && sticky) + setInternalState(result, { + sticky: sticky, + }); + return result; + }; + var proxy = function (key) { + key in RegExpWrapper || + defineProperty(RegExpWrapper, key, { + configurable: true, + get: function () { + return NativeRegExp[key]; + }, + set: function (it) { + NativeRegExp[key] = it; + }, + }); + }; + var keys = getOwnPropertyNames(NativeRegExp); + var index = 0; + while (keys.length > index) proxy(keys[index++]); + RegExpPrototype.constructor = RegExpWrapper; + RegExpWrapper.prototype = RegExpPrototype; + redefine(global, "RegExp", RegExpWrapper); + } // https://tc39.github.io/ecma262/#sec-get-regexp-@@species + + setSpecies("RegExp"); + }, + { + "../internals/descriptors": 61, + "../internals/fails": 69, + "../internals/global": 77, + "../internals/inherit-if-required": 85, + "../internals/internal-state": 88, + "../internals/is-forced": 91, + "../internals/is-regexp": 94, + "../internals/object-define-property": 110, + "../internals/object-get-own-property-names": 113, + "../internals/redefine": 126, + "../internals/regexp-flags": 129, + "../internals/regexp-sticky-helpers": 130, + "../internals/set-species": 134, + "../internals/well-known-symbol": 166, + }, + ], + 205: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var exec = _dereq_("../internals/regexp-exec"); + $( + { + target: "RegExp", + proto: true, + forced: /./.exec !== exec, + }, + { + exec: exec, + }, + ); + }, + { + "../internals/export": 68, + "../internals/regexp-exec": 128, + }, + ], + 206: [ + function (_dereq_, module, exports) { + "use strict"; + var redefine = _dereq_("../internals/redefine"); + var anObject = _dereq_("../internals/an-object"); + var fails = _dereq_("../internals/fails"); + var flags = _dereq_("../internals/regexp-flags"); + var TO_STRING = "toString"; + var RegExpPrototype = RegExp.prototype; + var nativeToString = RegExpPrototype[TO_STRING]; + var NOT_GENERIC = fails(function () { + return ( + nativeToString.call({ + source: "a", + flags: "b", + }) != "/a/b" + ); + }); + // FF44- RegExp#toString has a wrong name + var INCORRECT_NAME = nativeToString.name != TO_STRING; + // `RegExp.prototype.toString` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring + if (NOT_GENERIC || INCORRECT_NAME) { + redefine( + RegExp.prototype, + TO_STRING, + function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String( + rf === undefined && + R instanceof RegExp && + !("flags" in RegExpPrototype) + ? flags.call(R) + : rf, + ); + return "/" + p + "/" + f; + }, + { + unsafe: true, + }, + ); + } + }, + { + "../internals/an-object": 28, + "../internals/fails": 69, + "../internals/redefine": 126, + "../internals/regexp-flags": 129, + }, + ], + 207: [ + function (_dereq_, module, exports) { + "use strict"; + var collection = _dereq_("../internals/collection"); + var collectionStrong = _dereq_("../internals/collection-strong"); + // `Set` constructor + // https://tc39.github.io/ecma262/#sec-set-objects + module.exports = collection( + "Set", + function (init) { + return function Set() { + return init(this, arguments.length ? arguments[0] : undefined); + }; + }, + collectionStrong, + ); + }, + { + "../internals/collection": 50, + "../internals/collection-strong": 48, + }, + ], + 208: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var getOwnPropertyDescriptor = _dereq_( + "../internals/object-get-own-property-descriptor", + ).f; + var toLength = _dereq_("../internals/to-length"); + var notARegExp = _dereq_("../internals/not-a-regexp"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var correctIsRegExpLogic = _dereq_( + "../internals/correct-is-regexp-logic", + ); + var IS_PURE = _dereq_("../internals/is-pure"); + var nativeEndsWith = "".endsWith; + var min = Math.min; + var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("endsWith"); + // https://github.com/zloirock/core-js/pull/702 + var MDN_POLYFILL_BUG = + !IS_PURE && + !CORRECT_IS_REGEXP_LOGIC && + !!(function () { + var descriptor = getOwnPropertyDescriptor( + String.prototype, + "endsWith", + ); + return descriptor && !descriptor.writable; + })(); + // `String.prototype.endsWith` method + // https://tc39.github.io/ecma262/#sec-string.prototype.endswith + $( + { + target: "String", + proto: true, + forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC, + }, + { + endsWith: function endsWith( + searchString /* , endPosition = @length */, + ) { + var that = String(requireObjectCoercible(this)); + notARegExp(searchString); + var endPosition = + arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = + endPosition === undefined + ? len + : min(toLength(endPosition), len); + var search = String(searchString); + return nativeEndsWith + ? nativeEndsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + }, + }, + ); + }, + { + "../internals/correct-is-regexp-logic": 52, + "../internals/export": 68, + "../internals/is-pure": 93, + "../internals/not-a-regexp": 105, + "../internals/object-get-own-property-descriptor": 111, + "../internals/require-object-coercible": 131, + "../internals/to-length": 154, + }, + ], + 209: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var notARegExp = _dereq_("../internals/not-a-regexp"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var correctIsRegExpLogic = _dereq_( + "../internals/correct-is-regexp-logic", + ); + // `String.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-string.prototype.includes + $( + { + target: "String", + proto: true, + forced: !correctIsRegExpLogic("includes"), + }, + { + includes: function includes(searchString /* , position = 0 */) { + return !!~String(requireObjectCoercible(this)).indexOf( + notARegExp(searchString), + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/correct-is-regexp-logic": 52, + "../internals/export": 68, + "../internals/not-a-regexp": 105, + "../internals/require-object-coercible": 131, + }, + ], + 210: [ + function (_dereq_, module, exports) { + "use strict"; + var charAt = _dereq_("../internals/string-multibyte").charAt; + var InternalStateModule = _dereq_("../internals/internal-state"); + var defineIterator = _dereq_("../internals/define-iterator"); + var STRING_ITERATOR = "String Iterator"; + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + // `String.prototype[@@iterator]` method + // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator + defineIterator( + String, + "String", + function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: String(iterated), + index: 0, + }); + // `%StringIteratorPrototype%.next` method + // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next + }, + function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) + return { + value: undefined, + done: true, + }; + point = charAt(string, index); + state.index += point.length; + return { + value: point, + done: false, + }; + }, + ); + }, + { + "../internals/define-iterator": 59, + "../internals/internal-state": 88, + "../internals/string-multibyte": 141, + }, + ], + 211: [ + function (_dereq_, module, exports) { + "use strict"; + var fixRegExpWellKnownSymbolLogic = _dereq_( + "../internals/fix-regexp-well-known-symbol-logic", + ); + var anObject = _dereq_("../internals/an-object"); + var toLength = _dereq_("../internals/to-length"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var advanceStringIndex = _dereq_("../internals/advance-string-index"); + var regExpExec = _dereq_("../internals/regexp-exec-abstract"); + // @@match logic + fixRegExpWellKnownSymbolLogic( + "match", + 1, + function (MATCH, nativeMatch, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.github.io/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = regexp == undefined ? undefined : regexp[MATCH]; + return matcher !== undefined + ? matcher.call(regexp, O) + : new RegExp(regexp)[MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative(nativeMatch, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + if (!rx.global) return regExpExec(rx, S); + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === "") + rx.lastIndex = advanceStringIndex( + S, + toLength(rx.lastIndex), + fullUnicode, + ); + n++; + } + return n === 0 ? null : A; + }, + ]; + }, + ); + }, + { + "../internals/advance-string-index": 26, + "../internals/an-object": 28, + "../internals/fix-regexp-well-known-symbol-logic": 70, + "../internals/regexp-exec-abstract": 127, + "../internals/require-object-coercible": 131, + "../internals/to-length": 154, + }, + ], + 212: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $padStart = _dereq_("../internals/string-pad").start; + var WEBKIT_BUG = _dereq_("../internals/string-pad-webkit-bug"); + // `String.prototype.padStart` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + $( + { + target: "String", + proto: true, + forced: WEBKIT_BUG, + }, + { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $padStart( + this, + maxLength, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + }, + ); + }, + { + "../internals/export": 68, + "../internals/string-pad": 143, + "../internals/string-pad-webkit-bug": 142, + }, + ], + 213: [ + function (_dereq_, module, exports) { + var $ = _dereq_("../internals/export"); + var repeat = _dereq_("../internals/string-repeat"); + // `String.prototype.repeat` method + // https://tc39.github.io/ecma262/#sec-string.prototype.repeat + $( + { + target: "String", + proto: true, + }, + { + repeat: repeat, + }, + ); + }, + { + "../internals/export": 68, + "../internals/string-repeat": 145, + }, + ], + 214: [ + function (_dereq_, module, exports) { + "use strict"; + var fixRegExpWellKnownSymbolLogic = _dereq_( + "../internals/fix-regexp-well-known-symbol-logic", + ); + var anObject = _dereq_("../internals/an-object"); + var toObject = _dereq_("../internals/to-object"); + var toLength = _dereq_("../internals/to-length"); + var toInteger = _dereq_("../internals/to-integer"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var advanceStringIndex = _dereq_("../internals/advance-string-index"); + var regExpExec = _dereq_("../internals/regexp-exec-abstract"); + var max = Math.max; + var min = Math.min; + var floor = Math.floor; + var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; + var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; + var maybeToString = function (it) { + return it === undefined ? it : String(it); + }; + // @@replace logic + fixRegExpWellKnownSymbolLogic( + "replace", + 2, + function (REPLACE, nativeReplace, maybeCallNative, reason) { + var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = + reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE; + var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0; + var UNSAFE_SUBSTITUTE = + REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0"; + return [ + // `String.prototype.replace` method + // https://tc39.github.io/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = + searchValue == undefined ? undefined : searchValue[REPLACE]; + return replacer !== undefined + ? replacer.call(searchValue, O, replaceValue) + : nativeReplace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + if ( + (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && + REPLACE_KEEPS_$0) || + (typeof replaceValue === "string" && + replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1) + ) { + var res = maybeCallNative( + nativeReplace, + regexp, + this, + replaceValue, + ); + if (res.done) return res.value; + } + var rx = anObject(regexp); + var S = String(this); + var functionalReplace = typeof replaceValue === "function"; + if (!functionalReplace) replaceValue = String(replaceValue); + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + results.push(result); + if (!global) break; + var matchStr = String(result[0]); + if (matchStr === "") + rx.lastIndex = advanceStringIndex( + S, + toLength(rx.lastIndex), + fullUnicode, + ); + } + var accumulatedResult = ""; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + var matched = String(result[0]); + var position = max( + min(toInteger(result.index), S.length), + 0, + ); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) + captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [matched].concat( + captures, + position, + S, + ); + if (namedCaptures !== undefined) + replacerArgs.push(namedCaptures); + var replacement = String( + replaceValue.apply(undefined, replacerArgs), + ); + } else { + replacement = getSubstitution( + matched, + S, + position, + captures, + namedCaptures, + replaceValue, + ); + } + if (position >= nextSourcePosition) { + accumulatedResult += + S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + S.slice(nextSourcePosition); + }, + ]; + // https://tc39.github.io/ecma262/#sec-getsubstitution + function getSubstitution( + matched, + str, + position, + captures, + namedCaptures, + replacement, + ) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return nativeReplace.call( + replacement, + symbols, + function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case "$": + return "$"; + case "&": + return matched; + case "`": + return str.slice(0, position); + case "'": + return str.slice(tailPos); + case "<": + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: + // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) + return captures[f - 1] === undefined + ? ch.charAt(1) + : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? "" : capture; + }, + ); + } + }, + ); + }, + { + "../internals/advance-string-index": 26, + "../internals/an-object": 28, + "../internals/fix-regexp-well-known-symbol-logic": 70, + "../internals/regexp-exec-abstract": 127, + "../internals/require-object-coercible": 131, + "../internals/to-integer": 153, + "../internals/to-length": 154, + "../internals/to-object": 155, + }, + ], + 215: [ + function (_dereq_, module, exports) { + "use strict"; + var fixRegExpWellKnownSymbolLogic = _dereq_( + "../internals/fix-regexp-well-known-symbol-logic", + ); + var anObject = _dereq_("../internals/an-object"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var sameValue = _dereq_("../internals/same-value"); + var regExpExec = _dereq_("../internals/regexp-exec-abstract"); + // @@search logic + fixRegExpWellKnownSymbolLogic( + "search", + 1, + function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.github.io/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = + regexp == undefined ? undefined : regexp[SEARCH]; + return searcher !== undefined + ? searcher.call(regexp, O) + : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative(nativeSearch, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) + rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + }, + ]; + }, + ); + }, + { + "../internals/an-object": 28, + "../internals/fix-regexp-well-known-symbol-logic": 70, + "../internals/regexp-exec-abstract": 127, + "../internals/require-object-coercible": 131, + "../internals/same-value": 132, + }, + ], + 216: [ + function (_dereq_, module, exports) { + "use strict"; + var fixRegExpWellKnownSymbolLogic = _dereq_( + "../internals/fix-regexp-well-known-symbol-logic", + ); + var isRegExp = _dereq_("../internals/is-regexp"); + var anObject = _dereq_("../internals/an-object"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var speciesConstructor = _dereq_("../internals/species-constructor"); + var advanceStringIndex = _dereq_("../internals/advance-string-index"); + var toLength = _dereq_("../internals/to-length"); + var callRegExpExec = _dereq_("../internals/regexp-exec-abstract"); + var regexpExec = _dereq_("../internals/regexp-exec"); + var fails = _dereq_("../internals/fails"); + var arrayPush = [].push; + var min = Math.min; + var MAX_UINT32 = 4294967295; + // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError + var SUPPORTS_Y = !fails(function () { + return !RegExp(MAX_UINT32, "y"); + }); + // @@split logic + fixRegExpWellKnownSymbolLogic( + "split", + 2, + function (SPLIT, nativeSplit, maybeCallNative) { + var internalSplit; + if ( + "abbc".split(/(b)*/)[1] == "c" || + "test".split(/(?:)/, -1).length != 4 || + "ab".split(/(?:ab)*/).length != 2 || + ".".split(/(.?)(.?)/).length != 4 || + ".".split(/()()/).length > 1 || + "".split(/.?/).length + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(requireObjectCoercible(this)); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) { + return nativeSplit.call(string, separator, lim); + } + var output = []; + var flags = + (separator.ignoreCase ? "i" : "") + + (separator.multiline ? "m" : "") + + (separator.unicode ? "u" : "") + + (separator.sticky ? "y" : ""); + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + "g"); + var match, lastIndex, lastLength; + while ((match = regexpExec.call(separatorCopy, string))) { + lastIndex = separatorCopy.lastIndex; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) + arrayPush.apply(output, match.slice(1)); + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= lim) break; + } + if (separatorCopy.lastIndex === match.index) + separatorCopy.lastIndex++; // Avoid an infinite loop + } + if (lastLastIndex === string.length) { + if (lastLength || !separatorCopy.test("")) output.push(""); + } else output.push(string.slice(lastLastIndex)); + return output.length > lim ? output.slice(0, lim) : output; + }; + // Chakra, V8 + } else if ("0".split(undefined, 0).length) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 + ? [] + : nativeSplit.call(this, separator, limit); + }; + } else internalSplit = nativeSplit; + return [ + // `String.prototype.split` method + // https://tc39.github.io/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = requireObjectCoercible(this); + var splitter = + separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined + ? splitter.call(separator, O, limit) + : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative( + internalSplit, + regexp, + this, + limit, + internalSplit !== nativeSplit, + ); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var C = speciesConstructor(rx, RegExp); + var unicodeMatching = rx.unicode; + var flags = + (rx.ignoreCase ? "i" : "") + + (rx.multiline ? "m" : "") + + (rx.unicode ? "u" : "") + + (SUPPORTS_Y ? "y" : "g"); + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C( + SUPPORTS_Y ? rx : "^(?:" + rx.source + ")", + flags, + ); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) + return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = callRegExpExec( + splitter, + SUPPORTS_Y ? S : S.slice(q), + ); + var e; + if ( + z === null || + (e = min( + toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), + S.length, + )) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + }, + ]; + }, + !SUPPORTS_Y, + ); + }, + { + "../internals/advance-string-index": 26, + "../internals/an-object": 28, + "../internals/fails": 69, + "../internals/fix-regexp-well-known-symbol-logic": 70, + "../internals/is-regexp": 94, + "../internals/regexp-exec": 128, + "../internals/regexp-exec-abstract": 127, + "../internals/require-object-coercible": 131, + "../internals/species-constructor": 139, + "../internals/to-length": 154, + }, + ], + 217: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var getOwnPropertyDescriptor = _dereq_( + "../internals/object-get-own-property-descriptor", + ).f; + var toLength = _dereq_("../internals/to-length"); + var notARegExp = _dereq_("../internals/not-a-regexp"); + var requireObjectCoercible = _dereq_( + "../internals/require-object-coercible", + ); + var correctIsRegExpLogic = _dereq_( + "../internals/correct-is-regexp-logic", + ); + var IS_PURE = _dereq_("../internals/is-pure"); + var nativeStartsWith = "".startsWith; + var min = Math.min; + var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith"); + // https://github.com/zloirock/core-js/pull/702 + var MDN_POLYFILL_BUG = + !IS_PURE && + !CORRECT_IS_REGEXP_LOGIC && + !!(function () { + var descriptor = getOwnPropertyDescriptor( + String.prototype, + "startsWith", + ); + return descriptor && !descriptor.writable; + })(); + // `String.prototype.startsWith` method + // https://tc39.github.io/ecma262/#sec-string.prototype.startswith + $( + { + target: "String", + proto: true, + forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC, + }, + { + startsWith: function startsWith( + searchString /* , position = 0 */, + ) { + var that = String(requireObjectCoercible(this)); + notARegExp(searchString); + var index = toLength( + min( + arguments.length > 1 ? arguments[1] : undefined, + that.length, + ), + ); + var search = String(searchString); + return nativeStartsWith + ? nativeStartsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + }, + }, + ); + }, + { + "../internals/correct-is-regexp-logic": 52, + "../internals/export": 68, + "../internals/is-pure": 93, + "../internals/not-a-regexp": 105, + "../internals/object-get-own-property-descriptor": 111, + "../internals/require-object-coercible": 131, + "../internals/to-length": 154, + }, + ], + 218: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var createHTML = _dereq_("../internals/create-html"); + var forcedStringHTMLMethod = _dereq_( + "../internals/string-html-forced", + ); + // `String.prototype.sub` method + // https://tc39.github.io/ecma262/#sec-string.prototype.sub + $( + { + target: "String", + proto: true, + forced: forcedStringHTMLMethod("sub"), + }, + { + sub: function sub() { + return createHTML(this, "sub", "", ""); + }, + }, + ); + }, + { + "../internals/create-html": 54, + "../internals/export": 68, + "../internals/string-html-forced": 140, + }, + ], + 219: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var $trim = _dereq_("../internals/string-trim").trim; + var forcedStringTrimMethod = _dereq_( + "../internals/string-trim-forced", + ); + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + $( + { + target: "String", + proto: true, + forced: forcedStringTrimMethod("trim"), + }, + { + trim: function trim() { + return $trim(this); + }, + }, + ); + }, + { + "../internals/export": 68, + "../internals/string-trim": 147, + "../internals/string-trim-forced": 146, + }, + ], + 220: [ + function (_dereq_, module, exports) { + // `Symbol.prototype.description` getter + // https://tc39.github.io/ecma262/#sec-symbol.prototype.description + "use strict"; + var $ = _dereq_("../internals/export"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var global = _dereq_("../internals/global"); + var has = _dereq_("../internals/has"); + var isObject = _dereq_("../internals/is-object"); + var defineProperty = _dereq_("../internals/object-define-property").f; + var copyConstructorProperties = _dereq_( + "../internals/copy-constructor-properties", + ); + var NativeSymbol = global.Symbol; + if ( + DESCRIPTORS && + typeof NativeSymbol == "function" && + (!("description" in NativeSymbol.prototype) || // Safari 12 bug + NativeSymbol().description !== undefined) + ) { + var EmptyStringDescriptionStore = {}; + // wrap Symbol constructor for correct work with undefined description + var SymbolWrapper = function Symbol() { + var description = + arguments.length < 1 || arguments[0] === undefined + ? undefined + : String(arguments[0]); + var result = + this instanceof SymbolWrapper + ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + : description === undefined + ? NativeSymbol() + : NativeSymbol(description); + if (description === "") + EmptyStringDescriptionStore[result] = true; + return result; + }; + copyConstructorProperties(SymbolWrapper, NativeSymbol); + var symbolPrototype = (SymbolWrapper.prototype = + NativeSymbol.prototype); + symbolPrototype.constructor = SymbolWrapper; + var symbolToString = symbolPrototype.toString; + var native = String(NativeSymbol("test")) == "Symbol(test)"; + var regexp = /^Symbol\((.*)\)[^)]+$/; + defineProperty(symbolPrototype, "description", { + configurable: true, + get: function description() { + var symbol = isObject(this) ? this.valueOf() : this; + var string = symbolToString.call(symbol); + if (has(EmptyStringDescriptionStore, symbol)) return ""; + var desc = native + ? string.slice(7, -1) + : string.replace(regexp, "$1"); + return desc === "" ? undefined : desc; + }, + }); + $( + { + global: true, + forced: true, + }, + { + Symbol: SymbolWrapper, + }, + ); + } + }, + { + "../internals/copy-constructor-properties": 51, + "../internals/descriptors": 61, + "../internals/export": 68, + "../internals/global": 77, + "../internals/has": 78, + "../internals/is-object": 92, + "../internals/object-define-property": 110, + }, + ], + 221: [ + function (_dereq_, module, exports) { + var defineWellKnownSymbol = _dereq_( + "../internals/define-well-known-symbol", + ); + // `Symbol.iterator` well-known symbol + // https://tc39.github.io/ecma262/#sec-symbol.iterator + defineWellKnownSymbol("iterator"); + }, + { + "../internals/define-well-known-symbol": 60, + }, + ], + 222: [ + function (_dereq_, module, exports) { + "use strict"; + var $ = _dereq_("../internals/export"); + var global = _dereq_("../internals/global"); + var getBuiltIn = _dereq_("../internals/get-built-in"); + var IS_PURE = _dereq_("../internals/is-pure"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var NATIVE_SYMBOL = _dereq_("../internals/native-symbol"); + var USE_SYMBOL_AS_UID = _dereq_("../internals/use-symbol-as-uid"); + var fails = _dereq_("../internals/fails"); + var has = _dereq_("../internals/has"); + var isArray = _dereq_("../internals/is-array"); + var isObject = _dereq_("../internals/is-object"); + var anObject = _dereq_("../internals/an-object"); + var toObject = _dereq_("../internals/to-object"); + var toIndexedObject = _dereq_("../internals/to-indexed-object"); + var toPrimitive = _dereq_("../internals/to-primitive"); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + var nativeObjectCreate = _dereq_("../internals/object-create"); + var objectKeys = _dereq_("../internals/object-keys"); + var getOwnPropertyNamesModule = _dereq_( + "../internals/object-get-own-property-names", + ); + var getOwnPropertyNamesExternal = _dereq_( + "../internals/object-get-own-property-names-external", + ); + var getOwnPropertySymbolsModule = _dereq_( + "../internals/object-get-own-property-symbols", + ); + var getOwnPropertyDescriptorModule = _dereq_( + "../internals/object-get-own-property-descriptor", + ); + var definePropertyModule = _dereq_( + "../internals/object-define-property", + ); + var propertyIsEnumerableModule = _dereq_( + "../internals/object-property-is-enumerable", + ); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var redefine = _dereq_("../internals/redefine"); + var shared = _dereq_("../internals/shared"); + var sharedKey = _dereq_("../internals/shared-key"); + var hiddenKeys = _dereq_("../internals/hidden-keys"); + var uid = _dereq_("../internals/uid"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var wrappedWellKnownSymbolModule = _dereq_( + "../internals/well-known-symbol-wrapped", + ); + var defineWellKnownSymbol = _dereq_( + "../internals/define-well-known-symbol", + ); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var InternalStateModule = _dereq_("../internals/internal-state"); + var $forEach = _dereq_("../internals/array-iteration").forEach; + var HIDDEN = sharedKey("hidden"); + var SYMBOL = "Symbol"; + var PROTOTYPE = "prototype"; + var TO_PRIMITIVE = wellKnownSymbol("toPrimitive"); + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(SYMBOL); + var ObjectPrototype = Object[PROTOTYPE]; + var $Symbol = global.Symbol; + var $stringify = getBuiltIn("JSON", "stringify"); + var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var nativeDefineProperty = definePropertyModule.f; + var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; + var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; + var AllSymbols = shared("symbols"); + var ObjectPrototypeSymbols = shared("op-symbols"); + var StringToSymbolRegistry = shared("string-to-symbol-registry"); + var SymbolToStringRegistry = shared("symbol-to-string-registry"); + var WellKnownSymbolsStore = shared("wks"); + var QObject = global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var USE_SETTER = + !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDescriptor = + DESCRIPTORS && + fails(function () { + return ( + nativeObjectCreate( + nativeDefineProperty({}, "a", { + get: function () { + return nativeDefineProperty(this, "a", { + value: 7, + }).a; + }, + }), + ).a != 7 + ); + }) + ? function (O, P, Attributes) { + var ObjectPrototypeDescriptor = + nativeGetOwnPropertyDescriptor(ObjectPrototype, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; + nativeDefineProperty(O, P, Attributes); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { + nativeDefineProperty( + ObjectPrototype, + P, + ObjectPrototypeDescriptor, + ); + } + } + : nativeDefineProperty; + var wrap = function (tag, description) { + var symbol = (AllSymbols[tag] = nativeObjectCreate( + $Symbol[PROTOTYPE], + )); + setInternalState(symbol, { + type: SYMBOL, + tag: tag, + description: description, + }); + if (!DESCRIPTORS) symbol.description = description; + return symbol; + }; + var isSymbol = USE_SYMBOL_AS_UID + ? function (it) { + return typeof it == "symbol"; + } + : function (it) { + return Object(it) instanceof $Symbol; + }; + var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype) + $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPrimitive(P, true); + anObject(Attributes); + if (has(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!has(O, HIDDEN)) + nativeDefineProperty( + O, + HIDDEN, + createPropertyDescriptor(1, {}), + ); + O[HIDDEN][key] = true; + } else { + if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = nativeObjectCreate(Attributes, { + enumerable: createPropertyDescriptor(0, false), + }); + } + return setSymbolDescriptor(O, key, Attributes); + } + return nativeDefineProperty(O, key, Attributes); + }; + var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat( + $getOwnPropertySymbols(properties), + ); + $forEach(keys, function (key) { + if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) + $defineProperty(O, key, properties[key]); + }); + return O; + }; + var $create = function create(O, Properties) { + return Properties === undefined + ? nativeObjectCreate(O) + : $defineProperties(nativeObjectCreate(O), Properties); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPrimitive(V, true); + var enumerable = nativePropertyIsEnumerable.call(this, P); + if ( + this === ObjectPrototype && + has(AllSymbols, P) && + !has(ObjectPrototypeSymbols, P) + ) + return false; + return enumerable || + !has(this, P) || + !has(AllSymbols, P) || + (has(this, HIDDEN) && this[HIDDEN][P]) + ? enumerable + : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor( + O, + P, + ) { + var it = toIndexedObject(O); + var key = toPrimitive(P, true); + if ( + it === ObjectPrototype && + has(AllSymbols, key) && + !has(ObjectPrototypeSymbols, key) + ) + return; + var descriptor = nativeGetOwnPropertyDescriptor(it, key); + if ( + descriptor && + has(AllSymbols, key) && + !(has(it, HIDDEN) && it[HIDDEN][key]) + ) { + descriptor.enumerable = true; + } + return descriptor; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames(toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (!has(AllSymbols, key) && !has(hiddenKeys, key)) + result.push(key); + }); + return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; + var names = nativeGetOwnPropertyNames( + IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O), + ); + var result = []; + $forEach(names, function (key) { + if ( + has(AllSymbols, key) && + (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key)) + ) { + result.push(AllSymbols[key]); + } + }); + return result; + }; + // `Symbol` constructor + // https://tc39.github.io/ecma262/#sec-symbol-constructor + if (!NATIVE_SYMBOL) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) + throw TypeError("Symbol is not a constructor"); + var description = + !arguments.length || arguments[0] === undefined + ? undefined + : String(arguments[0]); + var tag = uid(description); + var setter = function (value) { + if (this === ObjectPrototype) + setter.call(ObjectPrototypeSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) + this[HIDDEN][tag] = false; + setSymbolDescriptor( + this, + tag, + createPropertyDescriptor(1, value), + ); + }; + if (DESCRIPTORS && USE_SETTER) + setSymbolDescriptor(ObjectPrototype, tag, { + configurable: true, + set: setter, + }); + return wrap(tag, description); + }; + redefine($Symbol[PROTOTYPE], "toString", function toString() { + return getInternalState(this).tag; + }); + redefine($Symbol, "withoutSetter", function (description) { + return wrap(uid(description), description); + }); + propertyIsEnumerableModule.f = $propertyIsEnumerable; + definePropertyModule.f = $defineProperty; + getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; + getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = + $getOwnPropertyNames; + getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; + wrappedWellKnownSymbolModule.f = function (name) { + return wrap(wellKnownSymbol(name), name); + }; + if (DESCRIPTORS) { + // https://github.com/tc39/proposal-Symbol-description + nativeDefineProperty($Symbol[PROTOTYPE], "description", { + configurable: true, + get: function description() { + return getInternalState(this).description; + }, + }); + if (!IS_PURE) { + redefine( + ObjectPrototype, + "propertyIsEnumerable", + $propertyIsEnumerable, + { + unsafe: true, + }, + ); + } + } + } + $( + { + global: true, + wrap: true, + forced: !NATIVE_SYMBOL, + sham: !NATIVE_SYMBOL, + }, + { + Symbol: $Symbol, + }, + ); + $forEach(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); + }); + $( + { + target: SYMBOL, + stat: true, + forced: !NATIVE_SYMBOL, + }, + { + // `Symbol.for` method + // https://tc39.github.io/ecma262/#sec-symbol.for + for: function (key) { + var string = String(key); + if (has(StringToSymbolRegistry, string)) + return StringToSymbolRegistry[string]; + var symbol = $Symbol(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; + }, + // `Symbol.keyFor` method + // https://tc39.github.io/ecma262/#sec-symbol.keyfor + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + " is not a symbol"); + if (has(SymbolToStringRegistry, sym)) + return SymbolToStringRegistry[sym]; + }, + useSetter: function () { + USE_SETTER = true; + }, + useSimple: function () { + USE_SETTER = false; + }, + }, + ); + $( + { + target: "Object", + stat: true, + forced: !NATIVE_SYMBOL, + sham: !DESCRIPTORS, + }, + { + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + }, + ); + $( + { + target: "Object", + stat: true, + forced: !NATIVE_SYMBOL, + }, + { + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames, + // `Object.getOwnPropertySymbols` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols + getOwnPropertySymbols: $getOwnPropertySymbols, + }, + ); + // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives + // https://bugs.chromium.org/p/v8/issues/detail?id=3443 + $( + { + target: "Object", + stat: true, + forced: fails(function () { + getOwnPropertySymbolsModule.f(1); + }), + }, + { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return getOwnPropertySymbolsModule.f(toObject(it)); + }, + }, + ); + // `JSON.stringify` method behavior with symbols + // https://tc39.github.io/ecma262/#sec-json.stringify + if ($stringify) { + var FORCED_JSON_STRINGIFY = + !NATIVE_SYMBOL || + fails(function () { + var symbol = $Symbol(); + // MS Edge converts symbol values to JSON as {} + return ( + $stringify([symbol]) != "[null]" || // WebKit converts symbol values to JSON as null + $stringify({ + a: symbol, + }) != "{}" || // V8 throws on boxed symbols + $stringify(Object(symbol)) != "{}" + ); + }); + $( + { + target: "JSON", + stat: true, + forced: FORCED_JSON_STRINGIFY, + }, + { + // eslint-disable-next-line no-unused-vars + stringify: function stringify(it, replacer, space) { + var args = [it]; + var index = 1; + var $replacer; + while (arguments.length > index) + args.push(arguments[index++]); + $replacer = replacer; + if ((!isObject(replacer) && it === undefined) || isSymbol(it)) + return; // IE8 returns string on undefined + if (!isArray(replacer)) + replacer = function (key, value) { + if (typeof $replacer == "function") + value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return $stringify.apply(null, args); + }, + }, + ); + } // `Symbol.prototype[@@toPrimitive]` method + // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive + + if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { + createNonEnumerableProperty( + $Symbol[PROTOTYPE], + TO_PRIMITIVE, + $Symbol[PROTOTYPE].valueOf, + ); + } // `Symbol.prototype[@@toStringTag]` property + // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag + + setToStringTag($Symbol, SYMBOL); + hiddenKeys[HIDDEN] = true; + }, + { + "../internals/an-object": 28, + "../internals/array-iteration": 37, + "../internals/create-non-enumerable-property": 56, + "../internals/create-property-descriptor": 57, + "../internals/define-well-known-symbol": 60, + "../internals/descriptors": 61, + "../internals/export": 68, + "../internals/fails": 69, + "../internals/get-built-in": 74, + "../internals/global": 77, + "../internals/has": 78, + "../internals/hidden-keys": 79, + "../internals/internal-state": 88, + "../internals/is-array": 90, + "../internals/is-object": 92, + "../internals/is-pure": 93, + "../internals/native-symbol": 101, + "../internals/object-create": 108, + "../internals/object-define-property": 110, + "../internals/object-get-own-property-descriptor": 111, + "../internals/object-get-own-property-names": 113, + "../internals/object-get-own-property-names-external": 112, + "../internals/object-get-own-property-symbols": 114, + "../internals/object-keys": 117, + "../internals/object-property-is-enumerable": 118, + "../internals/redefine": 126, + "../internals/set-to-string-tag": 135, + "../internals/shared": 138, + "../internals/shared-key": 136, + "../internals/to-indexed-object": 152, + "../internals/to-object": 155, + "../internals/to-primitive": 158, + "../internals/uid": 163, + "../internals/use-symbol-as-uid": 164, + "../internals/well-known-symbol": 166, + "../internals/well-known-symbol-wrapped": 165, + }, + ], + 223: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $copyWithin = _dereq_("../internals/array-copy-within"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.copyWithin` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin + exportTypedArrayMethod( + "copyWithin", + function copyWithin(target, start /* , end */) { + return $copyWithin.call( + aTypedArray(this), + target, + start, + arguments.length > 2 ? arguments[2] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-copy-within": 32, + }, + ], + 224: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $every = _dereq_("../internals/array-iteration").every; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.every` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every + exportTypedArrayMethod( + "every", + function every(callbackfn /* , thisArg */) { + return $every( + aTypedArray(this), + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + }, + ], + 225: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $fill = _dereq_("../internals/array-fill"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.fill` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill + // eslint-disable-next-line no-unused-vars + exportTypedArrayMethod( + "fill", + function fill(value /* , start, end */) { + return $fill.apply(aTypedArray(this), arguments); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-fill": 33, + }, + ], + 226: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $filter = _dereq_("../internals/array-iteration").filter; + var speciesConstructor = _dereq_("../internals/species-constructor"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = + ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter + exportTypedArrayMethod( + "filter", + function filter(callbackfn /* , thisArg */) { + var list = $filter( + aTypedArray(this), + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + "../internals/species-constructor": 139, + }, + ], + 227: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $findIndex = _dereq_("../internals/array-iteration").findIndex; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex + exportTypedArrayMethod( + "findIndex", + function findIndex(predicate /* , thisArg */) { + return $findIndex( + aTypedArray(this), + predicate, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + }, + ], + 228: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $find = _dereq_("../internals/array-iteration").find; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.find` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find + exportTypedArrayMethod( + "find", + function find(predicate /* , thisArg */) { + return $find( + aTypedArray(this), + predicate, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + }, + ], + 229: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Float32Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Float32", function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 230: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Float64Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Float64", function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 231: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $forEach = _dereq_("../internals/array-iteration").forEach; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach + exportTypedArrayMethod( + "forEach", + function forEach(callbackfn /* , thisArg */) { + $forEach( + aTypedArray(this), + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + }, + ], + 232: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $includes = _dereq_("../internals/array-includes").includes; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes + exportTypedArrayMethod( + "includes", + function includes(searchElement /* , fromIndex */) { + return $includes( + aTypedArray(this), + searchElement, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-includes": 36, + }, + ], + 233: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $indexOf = _dereq_("../internals/array-includes").indexOf; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof + exportTypedArrayMethod( + "indexOf", + function indexOf(searchElement /* , fromIndex */) { + return $indexOf( + aTypedArray(this), + searchElement, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-includes": 36, + }, + ], + 234: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Int16Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Int16", function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 235: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Int32Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Int32", function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 236: [ + function (_dereq_, module, exports) { + "use strict"; + var global = _dereq_("../internals/global"); + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var ArrayIterators = _dereq_("../modules/es.array.iterator"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var ITERATOR = wellKnownSymbol("iterator"); + var Uint8Array = global.Uint8Array; + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var nativeTypedArrayIterator = + Uint8Array && Uint8Array.prototype[ITERATOR]; + var CORRECT_ITER_NAME = + !!nativeTypedArrayIterator && + (nativeTypedArrayIterator.name == "values" || + nativeTypedArrayIterator.name == undefined); + var typedArrayValues = function values() { + return arrayValues.call(aTypedArray(this)); + }; + // `%TypedArray%.prototype.entries` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries + exportTypedArrayMethod("entries", function entries() { + return arrayEntries.call(aTypedArray(this)); + }); + // `%TypedArray%.prototype.keys` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys + exportTypedArrayMethod("keys", function keys() { + return arrayKeys.call(aTypedArray(this)); + }); + // `%TypedArray%.prototype.values` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values + exportTypedArrayMethod( + "values", + typedArrayValues, + !CORRECT_ITER_NAME, + ); + // `%TypedArray%.prototype[@@iterator]` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator + exportTypedArrayMethod( + ITERATOR, + typedArrayValues, + !CORRECT_ITER_NAME, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/global": 77, + "../internals/well-known-symbol": 166, + "../modules/es.array.iterator": 179, + }, + ], + 237: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var $join = [].join; + // `%TypedArray%.prototype.join` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join + // eslint-disable-next-line no-unused-vars + exportTypedArrayMethod("join", function join(separator) { + return $join.apply(aTypedArray(this), arguments); + }); + }, + { + "../internals/array-buffer-view-core": 30, + }, + ], + 238: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $lastIndexOf = _dereq_("../internals/array-last-index-of"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.lastIndexOf` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof + // eslint-disable-next-line no-unused-vars + exportTypedArrayMethod( + "lastIndexOf", + function lastIndexOf(searchElement /* , fromIndex */) { + return $lastIndexOf.apply(aTypedArray(this), arguments); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-last-index-of": 38, + }, + ], + 239: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $map = _dereq_("../internals/array-iteration").map; + var speciesConstructor = _dereq_("../internals/species-constructor"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = + ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.map` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map + exportTypedArrayMethod("map", function map(mapfn /* , thisArg */) { + return $map( + aTypedArray(this), + mapfn, + arguments.length > 1 ? arguments[1] : undefined, + function (O, length) { + return new (aTypedArrayConstructor( + speciesConstructor(O, O.constructor), + ))(length); + }, + ); + }); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + "../internals/species-constructor": 139, + }, + ], + 240: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $reduceRight = _dereq_("../internals/array-reduce").right; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.reduceRicht` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright + exportTypedArrayMethod( + "reduceRight", + function reduceRight(callbackfn /* , initialValue */) { + return $reduceRight( + aTypedArray(this), + callbackfn, + arguments.length, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-reduce": 42, + }, + ], + 241: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $reduce = _dereq_("../internals/array-reduce").left; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce + exportTypedArrayMethod( + "reduce", + function reduce(callbackfn /* , initialValue */) { + return $reduce( + aTypedArray(this), + callbackfn, + arguments.length, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-reduce": 42, + }, + ], + 242: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var floor = Math.floor; + // `%TypedArray%.prototype.reverse` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse + exportTypedArrayMethod("reverse", function reverse() { + var that = this; + var length = aTypedArray(that).length; + var middle = floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } + return that; + }); + }, + { + "../internals/array-buffer-view-core": 30, + }, + ], + 243: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var toLength = _dereq_("../internals/to-length"); + var toOffset = _dereq_("../internals/to-offset"); + var toObject = _dereq_("../internals/to-object"); + var fails = _dereq_("../internals/fails"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var FORCED = fails(function () { + // eslint-disable-next-line no-undef + new Int8Array(1).set({}); + }); + // `%TypedArray%.prototype.set` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set + exportTypedArrayMethod( + "set", + function set(arrayLike /* , offset */) { + aTypedArray(this); + var offset = toOffset( + arguments.length > 1 ? arguments[1] : undefined, + 1, + ); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError("Wrong length"); + while (index < len) this[offset + index] = src[index++]; + }, + FORCED, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/fails": 69, + "../internals/to-length": 154, + "../internals/to-object": 155, + "../internals/to-offset": 156, + }, + ], + 244: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var speciesConstructor = _dereq_("../internals/species-constructor"); + var fails = _dereq_("../internals/fails"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = + ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var $slice = [].slice; + var FORCED = fails(function () { + // eslint-disable-next-line no-undef + new Int8Array(1).slice(); + }); + // `%TypedArray%.prototype.slice` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice + exportTypedArrayMethod( + "slice", + function slice(start, end) { + var list = $slice.call(aTypedArray(this), start, end); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C))(length); + while (length > index) result[index] = list[index++]; + return result; + }, + FORCED, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/fails": 69, + "../internals/species-constructor": 139, + }, + ], + 245: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var $some = _dereq_("../internals/array-iteration").some; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.some` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some + exportTypedArrayMethod( + "some", + function some(callbackfn /* , thisArg */) { + return $some( + aTypedArray(this), + callbackfn, + arguments.length > 1 ? arguments[1] : undefined, + ); + }, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/array-iteration": 37, + }, + ], + 246: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var $sort = [].sort; + // `%TypedArray%.prototype.sort` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort + exportTypedArrayMethod("sort", function sort(comparefn) { + return $sort.call(aTypedArray(this), comparefn); + }); + }, + { + "../internals/array-buffer-view-core": 30, + }, + ], + 247: [ + function (_dereq_, module, exports) { + "use strict"; + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var toLength = _dereq_("../internals/to-length"); + var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); + var speciesConstructor = _dereq_("../internals/species-constructor"); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.subarray` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray + exportTypedArrayMethod("subarray", function subarray(begin, end) { + var O = aTypedArray(this); + var length = O.length; + var beginIndex = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O.constructor))( + O.buffer, + O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, + toLength( + (end === undefined ? length : toAbsoluteIndex(end, length)) - + beginIndex, + ), + ); + }); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/species-constructor": 139, + "../internals/to-absolute-index": 150, + "../internals/to-length": 154, + }, + ], + 248: [ + function (_dereq_, module, exports) { + "use strict"; + var global = _dereq_("../internals/global"); + var ArrayBufferViewCore = _dereq_( + "../internals/array-buffer-view-core", + ); + var fails = _dereq_("../internals/fails"); + var Int8Array = global.Int8Array; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = + ArrayBufferViewCore.exportTypedArrayMethod; + var $toLocaleString = [].toLocaleString; + var $slice = [].slice; + // iOS Safari 6.x fails here + var TO_LOCALE_STRING_BUG = + !!Int8Array && + fails(function () { + $toLocaleString.call(new Int8Array(1)); + }); + var FORCED = + fails(function () { + return ( + [1, 2].toLocaleString() != + new Int8Array([1, 2]).toLocaleString() + ); + }) || + !fails(function () { + Int8Array.prototype.toLocaleString.call([1, 2]); + }); + // `%TypedArray%.prototype.toLocaleString` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring + exportTypedArrayMethod( + "toLocaleString", + function toLocaleString() { + return $toLocaleString.apply( + TO_LOCALE_STRING_BUG + ? $slice.call(aTypedArray(this)) + : aTypedArray(this), + arguments, + ); + }, + FORCED, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/fails": 69, + "../internals/global": 77, + }, + ], + 249: [ + function (_dereq_, module, exports) { + "use strict"; + var exportTypedArrayMethod = _dereq_( + "../internals/array-buffer-view-core", + ).exportTypedArrayMethod; + var fails = _dereq_("../internals/fails"); + var global = _dereq_("../internals/global"); + var Uint8Array = global.Uint8Array; + var Uint8ArrayPrototype = (Uint8Array && Uint8Array.prototype) || {}; + var arrayToString = [].toString; + var arrayJoin = [].join; + if ( + fails(function () { + arrayToString.call({}); + }) + ) { + arrayToString = function toString() { + return arrayJoin.call(this); + }; + } + var IS_NOT_ARRAY_METHOD = + Uint8ArrayPrototype.toString != arrayToString; + // `%TypedArray%.prototype.toString` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring + exportTypedArrayMethod( + "toString", + arrayToString, + IS_NOT_ARRAY_METHOD, + ); + }, + { + "../internals/array-buffer-view-core": 30, + "../internals/fails": 69, + "../internals/global": 77, + }, + ], + 250: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Uint16Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Uint16", function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 251: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Uint32Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Uint32", function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 252: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Uint8Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor("Uint8", function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 253: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_( + "../internals/typed-array-constructor", + ); + // `Uint8ClampedArray` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor( + "Uint8", + function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }, + true, + ); + }, + { + "../internals/typed-array-constructor": 160, + }, + ], + 254: [ + function (_dereq_, module, exports) { + "use strict"; + var global = _dereq_("../internals/global"); + var redefineAll = _dereq_("../internals/redefine-all"); + var InternalMetadataModule = _dereq_( + "../internals/internal-metadata", + ); + var collection = _dereq_("../internals/collection"); + var collectionWeak = _dereq_("../internals/collection-weak"); + var isObject = _dereq_("../internals/is-object"); + var enforceIternalState = _dereq_( + "../internals/internal-state", + ).enforce; + var NATIVE_WEAK_MAP = _dereq_("../internals/native-weak-map"); + var IS_IE11 = !global.ActiveXObject && "ActiveXObject" in global; + var isExtensible = Object.isExtensible; + var InternalWeakMap; + var wrapper = function (init) { + return function WeakMap() { + return init(this, arguments.length ? arguments[0] : undefined); + }; + }; + // `WeakMap` constructor + // https://tc39.github.io/ecma262/#sec-weakmap-constructor + var $WeakMap = (module.exports = collection( + "WeakMap", + wrapper, + collectionWeak, + )); + // IE11 WeakMap frozen keys fix + // We can't use feature detection because it crash some old IE builds + // https://github.com/zloirock/core-js/issues/485 + if (NATIVE_WEAK_MAP && IS_IE11) { + InternalWeakMap = collectionWeak.getConstructor( + wrapper, + "WeakMap", + true, + ); + InternalMetadataModule.REQUIRED = true; + var WeakMapPrototype = $WeakMap.prototype; + var nativeDelete = WeakMapPrototype["delete"]; + var nativeHas = WeakMapPrototype.has; + var nativeGet = WeakMapPrototype.get; + var nativeSet = WeakMapPrototype.set; + redefineAll(WeakMapPrototype, { + delete: function (key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return ( + nativeDelete.call(this, key) || state.frozen["delete"](key) + ); + } + return nativeDelete.call(this, key); + }, + has: function has(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) || state.frozen.has(key); + } + return nativeHas.call(this, key); + }, + get: function get(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) + ? nativeGet.call(this, key) + : state.frozen.get(key); + } + return nativeGet.call(this, key); + }, + set: function set(key, value) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + nativeHas.call(this, key) + ? nativeSet.call(this, key, value) + : state.frozen.set(key, value); + } else nativeSet.call(this, key, value); + return this; + }, + }); + } + }, + { + "../internals/collection": 50, + "../internals/collection-weak": 49, + "../internals/global": 77, + "../internals/internal-metadata": 87, + "../internals/internal-state": 88, + "../internals/is-object": 92, + "../internals/native-weak-map": 103, + "../internals/redefine-all": 125, + }, + ], + 255: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var DOMIterables = _dereq_("../internals/dom-iterables"); + var forEach = _dereq_("../internals/array-for-each"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) + try { + createNonEnumerableProperty( + CollectionPrototype, + "forEach", + forEach, + ); + } catch (error) { + CollectionPrototype.forEach = forEach; + } + } + }, + { + "../internals/array-for-each": 34, + "../internals/create-non-enumerable-property": 56, + "../internals/dom-iterables": 63, + "../internals/global": 77, + }, + ], + 256: [ + function (_dereq_, module, exports) { + var global = _dereq_("../internals/global"); + var DOMIterables = _dereq_("../internals/dom-iterables"); + var ArrayIteratorMethods = _dereq_("../modules/es.array.iterator"); + var createNonEnumerableProperty = _dereq_( + "../internals/create-non-enumerable-property", + ); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var ITERATOR = wellKnownSymbol("iterator"); + var TO_STRING_TAG = wellKnownSymbol("toStringTag"); + var ArrayValues = ArrayIteratorMethods.values; + for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) + try { + createNonEnumerableProperty( + CollectionPrototype, + ITERATOR, + ArrayValues, + ); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + if (!CollectionPrototype[TO_STRING_TAG]) { + createNonEnumerableProperty( + CollectionPrototype, + TO_STRING_TAG, + COLLECTION_NAME, + ); + } + if (DOMIterables[COLLECTION_NAME]) + for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if ( + CollectionPrototype[METHOD_NAME] !== + ArrayIteratorMethods[METHOD_NAME] + ) + try { + createNonEnumerableProperty( + CollectionPrototype, + METHOD_NAME, + ArrayIteratorMethods[METHOD_NAME], + ); + } catch (error) { + CollectionPrototype[METHOD_NAME] = + ArrayIteratorMethods[METHOD_NAME]; + } + } + } + } + }, + { + "../internals/create-non-enumerable-property": 56, + "../internals/dom-iterables": 63, + "../internals/global": 77, + "../internals/well-known-symbol": 166, + "../modules/es.array.iterator": 179, + }, + ], + 257: [ + function (_dereq_, module, exports) { + "use strict"; + // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` + _dereq_("../modules/es.array.iterator"); + var $ = _dereq_("../internals/export"); + var getBuiltIn = _dereq_("../internals/get-built-in"); + var USE_NATIVE_URL = _dereq_("../internals/native-url"); + var redefine = _dereq_("../internals/redefine"); + var redefineAll = _dereq_("../internals/redefine-all"); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var createIteratorConstructor = _dereq_( + "../internals/create-iterator-constructor", + ); + var InternalStateModule = _dereq_("../internals/internal-state"); + var anInstance = _dereq_("../internals/an-instance"); + var hasOwn = _dereq_("../internals/has"); + var bind = _dereq_("../internals/function-bind-context"); + var classof = _dereq_("../internals/classof"); + var anObject = _dereq_("../internals/an-object"); + var isObject = _dereq_("../internals/is-object"); + var create = _dereq_("../internals/object-create"); + var createPropertyDescriptor = _dereq_( + "../internals/create-property-descriptor", + ); + var getIterator = _dereq_("../internals/get-iterator"); + var getIteratorMethod = _dereq_("../internals/get-iterator-method"); + var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); + var $fetch = getBuiltIn("fetch"); + var Headers = getBuiltIn("Headers"); + var ITERATOR = wellKnownSymbol("iterator"); + var URL_SEARCH_PARAMS = "URLSearchParams"; + var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + "Iterator"; + var setInternalState = InternalStateModule.set; + var getInternalParamsState = + InternalStateModule.getterFor(URL_SEARCH_PARAMS); + var getInternalIteratorState = InternalStateModule.getterFor( + URL_SEARCH_PARAMS_ITERATOR, + ); + var plus = /\+/g; + var sequences = Array(4); + var percentSequence = function (bytes) { + return ( + sequences[bytes - 1] || + (sequences[bytes - 1] = RegExp( + "((?:%[\\da-f]{2}){" + bytes + "})", + "gi", + )) + ); + }; + var percentDecode = function (sequence) { + try { + return decodeURIComponent(sequence); + } catch (error) { + return sequence; + } + }; + var deserialize = function (it) { + var result = it.replace(plus, " "); + var bytes = 4; + try { + return decodeURIComponent(result); + } catch (error) { + while (bytes) { + result = result.replace( + percentSequence(bytes--), + percentDecode, + ); + } + return result; + } + }; + var find = /[!'()~]|%20/g; + var replace = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+", + }; + var replacer = function (match) { + return replace[match]; + }; + var serialize = function (it) { + return encodeURIComponent(it).replace(find, replacer); + }; + var parseSearchParams = function (result, query) { + if (query) { + var attributes = query.split("&"); + var index = 0; + var attribute, entry; + while (index < attributes.length) { + attribute = attributes[index++]; + if (attribute.length) { + entry = attribute.split("="); + result.push({ + key: deserialize(entry.shift()), + value: deserialize(entry.join("=")), + }); + } + } + } + }; + var updateSearchParams = function (query) { + this.entries.length = 0; + parseSearchParams(this.entries, query); + }; + var validateArgumentsLength = function (passed, required) { + if (passed < required) throw TypeError("Not enough arguments"); + }; + var URLSearchParamsIterator = createIteratorConstructor( + function Iterator(params, kind) { + setInternalState(this, { + type: URL_SEARCH_PARAMS_ITERATOR, + iterator: getIterator(getInternalParamsState(params).entries), + kind: kind, + }); + }, + "Iterator", + function next() { + var state = getInternalIteratorState(this); + var kind = state.kind; + var step = state.iterator.next(); + var entry = step.value; + if (!step.done) { + step.value = + kind === "keys" + ? entry.key + : kind === "values" + ? entry.value + : [entry.key, entry.value]; + } + return step; + }, + ); + // `URLSearchParams` constructor + // https://url.spec.whatwg.org/#interface-urlsearchparams + var URLSearchParamsConstructor = + function URLSearchParams /* init */() { + anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); + var init = arguments.length > 0 ? arguments[0] : undefined; + var that = this; + var entries = []; + var iteratorMethod, + iterator, + next, + step, + entryIterator, + entryNext, + first, + second, + key; + setInternalState(that, { + type: URL_SEARCH_PARAMS, + entries: entries, + updateURL: function () { + /* empty */ + }, + updateSearchParams: updateSearchParams, + }); + if (init !== undefined) { + if (isObject(init)) { + iteratorMethod = getIteratorMethod(init); + if (typeof iteratorMethod === "function") { + iterator = iteratorMethod.call(init); + next = iterator.next; + while (!(step = next.call(iterator)).done) { + entryIterator = getIterator(anObject(step.value)); + entryNext = entryIterator.next; + if ( + (first = entryNext.call(entryIterator)).done || + (second = entryNext.call(entryIterator)).done || + !entryNext.call(entryIterator).done + ) + throw TypeError("Expected sequence with length 2"); + entries.push({ + key: first.value + "", + value: second.value + "", + }); + } + } else + for (key in init) + if (hasOwn(init, key)) + entries.push({ + key: key, + value: init[key] + "", + }); + } else { + parseSearchParams( + entries, + typeof init === "string" + ? init.charAt(0) === "?" + ? init.slice(1) + : init + : init + "", + ); + } + } + }; + var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; + redefineAll( + URLSearchParamsPrototype, + { + // `URLSearchParams.prototype.appent` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-append + append: function append(name, value) { + validateArgumentsLength(arguments.length, 2); + var state = getInternalParamsState(this); + state.entries.push({ + key: name + "", + value: value + "", + }); + state.updateURL(); + }, + // `URLSearchParams.prototype.delete` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-delete + delete: function (name) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var key = name + ""; + var index = 0; + while (index < entries.length) { + if (entries[index].key === key) entries.splice(index, 1); + else index++; + } + state.updateURL(); + }, + // `URLSearchParams.prototype.get` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-get + get: function get(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ""; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) return entries[index].value; + } + return null; + }, + // `URLSearchParams.prototype.getAll` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-getall + getAll: function getAll(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ""; + var result = []; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) + result.push(entries[index].value); + } + return result; + }, + // `URLSearchParams.prototype.has` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-has + has: function has(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ""; + var index = 0; + while (index < entries.length) { + if (entries[index++].key === key) return true; + } + return false; + }, + // `URLSearchParams.prototype.set` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-set + set: function set(name, value) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var found = false; + var key = name + ""; + var val = value + ""; + var index = 0; + var entry; + for (; index < entries.length; index++) { + entry = entries[index]; + if (entry.key === key) { + if (found) entries.splice(index--, 1); + else { + found = true; + entry.value = val; + } + } + } + if (!found) + entries.push({ + key: key, + value: val, + }); + state.updateURL(); + }, + // `URLSearchParams.prototype.sort` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-sort + sort: function sort() { + var state = getInternalParamsState(this); + var entries = state.entries; + // Array#sort is not stable in some engines + var slice = entries.slice(); + var entry, entriesIndex, sliceIndex; + entries.length = 0; + for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { + entry = slice[sliceIndex]; + for ( + entriesIndex = 0; + entriesIndex < sliceIndex; + entriesIndex++ + ) { + if (entries[entriesIndex].key > entry.key) { + entries.splice(entriesIndex, 0, entry); + break; + } + } + if (entriesIndex === sliceIndex) entries.push(entry); + } + state.updateURL(); + }, + // `URLSearchParams.prototype.forEach` method + forEach: function forEach(callback /* , thisArg */) { + var entries = getInternalParamsState(this).entries; + var boundFunction = bind( + callback, + arguments.length > 1 ? arguments[1] : undefined, + 3, + ); + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + boundFunction(entry.value, entry.key, this); + } + }, + // `URLSearchParams.prototype.keys` method + keys: function keys() { + return new URLSearchParamsIterator(this, "keys"); + }, + // `URLSearchParams.prototype.values` method + values: function values() { + return new URLSearchParamsIterator(this, "values"); + }, + // `URLSearchParams.prototype.entries` method + entries: function entries() { + return new URLSearchParamsIterator(this, "entries"); + }, + }, + { + enumerable: true, + }, + ); + // `URLSearchParams.prototype[@@iterator]` method + redefine( + URLSearchParamsPrototype, + ITERATOR, + URLSearchParamsPrototype.entries, + ); + // `URLSearchParams.prototype.toString` method + // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior + redefine( + URLSearchParamsPrototype, + "toString", + function toString() { + var entries = getInternalParamsState(this).entries; + var result = []; + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + result.push( + serialize(entry.key) + "=" + serialize(entry.value), + ); + } + return result.join("&"); + }, + { + enumerable: true, + }, + ); + setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); + $( + { + global: true, + forced: !USE_NATIVE_URL, + }, + { + URLSearchParams: URLSearchParamsConstructor, + }, + ); + // Wrap `fetch` for correct work with polyfilled `URLSearchParams` + // https://github.com/zloirock/core-js/issues/674 + if ( + !USE_NATIVE_URL && + typeof $fetch == "function" && + typeof Headers == "function" + ) { + $( + { + global: true, + enumerable: true, + forced: true, + }, + { + fetch: function fetch(input /* , init */) { + var args = [input]; + var init, body, headers; + if (arguments.length > 1) { + init = arguments[1]; + if (isObject(init)) { + body = init.body; + if (classof(body) === URL_SEARCH_PARAMS) { + headers = init.headers + ? new Headers(init.headers) + : new Headers(); + if (!headers.has("content-type")) { + headers.set( + "content-type", + "application/x-www-form-urlencoded;charset=UTF-8", + ); + } + init = create(init, { + body: createPropertyDescriptor(0, String(body)), + headers: createPropertyDescriptor(0, headers), + }); + } + } + args.push(init); + } + return $fetch.apply(this, args); + }, + }, + ); + } + module.exports = { + URLSearchParams: URLSearchParamsConstructor, + getState: getInternalParamsState, + }; + }, + { + "../internals/an-instance": 27, + "../internals/an-object": 28, + "../internals/classof": 47, + "../internals/create-iterator-constructor": 55, + "../internals/create-property-descriptor": 57, + "../internals/export": 68, + "../internals/function-bind-context": 72, + "../internals/get-built-in": 74, + "../internals/get-iterator": 76, + "../internals/get-iterator-method": 75, + "../internals/has": 78, + "../internals/internal-state": 88, + "../internals/is-object": 92, + "../internals/native-url": 102, + "../internals/object-create": 108, + "../internals/redefine": 126, + "../internals/redefine-all": 125, + "../internals/set-to-string-tag": 135, + "../internals/well-known-symbol": 166, + "../modules/es.array.iterator": 179, + }, + ], + 258: [ + function (_dereq_, module, exports) { + "use strict"; + // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` + _dereq_("../modules/es.string.iterator"); + var $ = _dereq_("../internals/export"); + var DESCRIPTORS = _dereq_("../internals/descriptors"); + var USE_NATIVE_URL = _dereq_("../internals/native-url"); + var global = _dereq_("../internals/global"); + var defineProperties = _dereq_( + "../internals/object-define-properties", + ); + var redefine = _dereq_("../internals/redefine"); + var anInstance = _dereq_("../internals/an-instance"); + var has = _dereq_("../internals/has"); + var assign = _dereq_("../internals/object-assign"); + var arrayFrom = _dereq_("../internals/array-from"); + var codeAt = _dereq_("../internals/string-multibyte").codeAt; + var toASCII = _dereq_("../internals/string-punycode-to-ascii"); + var setToStringTag = _dereq_("../internals/set-to-string-tag"); + var URLSearchParamsModule = _dereq_( + "../modules/web.url-search-params", + ); + var InternalStateModule = _dereq_("../internals/internal-state"); + var NativeURL = global.URL; + var URLSearchParams = URLSearchParamsModule.URLSearchParams; + var getInternalSearchParamsState = URLSearchParamsModule.getState; + var setInternalState = InternalStateModule.set; + var getInternalURLState = InternalStateModule.getterFor("URL"); + var floor = Math.floor; + var pow = Math.pow; + var INVALID_AUTHORITY = "Invalid authority"; + var INVALID_SCHEME = "Invalid scheme"; + var INVALID_HOST = "Invalid host"; + var INVALID_PORT = "Invalid port"; + var ALPHA = /[A-Za-z]/; + var ALPHANUMERIC = /[\d+-.A-Za-z]/; + var DIGIT = /\d/; + var HEX_START = /^(0x|0X)/; + var OCT = /^[0-7]+$/; + var DEC = /^\d+$/; + var HEX = /^[\dA-Fa-f]+$/; + // eslint-disable-next-line no-control-regex + var FORBIDDEN_HOST_CODE_POINT = + /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; + // eslint-disable-next-line no-control-regex + var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = + /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; + // eslint-disable-next-line no-control-regex + var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = + /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; + // eslint-disable-next-line no-control-regex + var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; + var EOF; + var parseHost = function (url, input) { + var result, codePoints, index; + if (input.charAt(0) == "[") { + if (input.charAt(input.length - 1) != "]") return INVALID_HOST; + result = parseIPv6(input.slice(1, -1)); + if (!result) return INVALID_HOST; + url.host = result; + // opaque host + } else if (!isSpecial(url)) { + if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) + return INVALID_HOST; + result = ""; + codePoints = arrayFrom(input); + for (index = 0; index < codePoints.length; index++) { + result += percentEncode( + codePoints[index], + C0ControlPercentEncodeSet, + ); + } + url.host = result; + } else { + input = toASCII(input); + if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; + result = parseIPv4(input); + if (result === null) return INVALID_HOST; + url.host = result; + } + }; + var parseIPv4 = function (input) { + var parts = input.split("."); + var partsLength, numbers, index, part, radix, number, ipv4; + if (parts.length && parts[parts.length - 1] == "") { + parts.pop(); + } + partsLength = parts.length; + if (partsLength > 4) return input; + numbers = []; + for (index = 0; index < partsLength; index++) { + part = parts[index]; + if (part == "") return input; + radix = 10; + if (part.length > 1 && part.charAt(0) == "0") { + radix = HEX_START.test(part) ? 16 : 8; + part = part.slice(radix == 8 ? 1 : 2); + } + if (part === "") { + number = 0; + } else { + if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) + return input; + number = parseInt(part, radix); + } + numbers.push(number); + } + for (index = 0; index < partsLength; index++) { + number = numbers[index]; + if (index == partsLength - 1) { + if (number >= pow(256, 5 - partsLength)) return null; + } else if (number > 255) return null; + } + ipv4 = numbers.pop(); + for (index = 0; index < numbers.length; index++) { + ipv4 += numbers[index] * pow(256, 3 - index); + } + return ipv4; + }; + // eslint-disable-next-line max-statements + var parseIPv6 = function (input) { + var address = [0, 0, 0, 0, 0, 0, 0, 0]; + var pieceIndex = 0; + var compress = null; + var pointer = 0; + var value, length, numbersSeen, ipv4Piece, number, swaps, swap; + var char = function () { + return input.charAt(pointer); + }; + if (char() == ":") { + if (input.charAt(1) != ":") return; + pointer += 2; + pieceIndex++; + compress = pieceIndex; + } + while (char()) { + if (pieceIndex == 8) return; + if (char() == ":") { + if (compress !== null) return; + pointer++; + pieceIndex++; + compress = pieceIndex; + continue; + } + value = length = 0; + while (length < 4 && HEX.test(char())) { + value = value * 16 + parseInt(char(), 16); + pointer++; + length++; + } + if (char() == ".") { + if (length == 0) return; + pointer -= length; + if (pieceIndex > 6) return; + numbersSeen = 0; + while (char()) { + ipv4Piece = null; + if (numbersSeen > 0) { + if (char() == "." && numbersSeen < 4) pointer++; + else return; + } + if (!DIGIT.test(char())) return; + while (DIGIT.test(char())) { + number = parseInt(char(), 10); + if (ipv4Piece === null) ipv4Piece = number; + else if (ipv4Piece == 0) return; + else ipv4Piece = ipv4Piece * 10 + number; + if (ipv4Piece > 255) return; + pointer++; + } + address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; + numbersSeen++; + if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; + } + if (numbersSeen != 4) return; + break; + } else if (char() == ":") { + pointer++; + if (!char()) return; + } else if (char()) return; + address[pieceIndex++] = value; + } + if (compress !== null) { + swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex != 0 && swaps > 0) { + swap = address[pieceIndex]; + address[pieceIndex--] = address[compress + swaps - 1]; + address[compress + --swaps] = swap; + } + } else if (pieceIndex != 8) return; + return address; + }; + var findLongestZeroSequence = function (ipv6) { + var maxIndex = null; + var maxLength = 1; + var currStart = null; + var currLength = 0; + var index = 0; + for (; index < 8; index++) { + if (ipv6[index] !== 0) { + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + currStart = null; + currLength = 0; + } else { + if (currStart === null) currStart = index; + ++currLength; + } + } + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + return maxIndex; + }; + var serializeHost = function (host) { + var result, index, compress, ignore0; + // ipv4 + if (typeof host == "number") { + result = []; + for (index = 0; index < 4; index++) { + result.unshift(host % 256); + host = floor(host / 256); + } + return result.join("."); + // ipv6 + } else if (typeof host == "object") { + result = ""; + compress = findLongestZeroSequence(host); + for (index = 0; index < 8; index++) { + if (ignore0 && host[index] === 0) continue; + if (ignore0) ignore0 = false; + if (compress === index) { + result += index ? ":" : "::"; + ignore0 = true; + } else { + result += host[index].toString(16); + if (index < 7) result += ":"; + } + } + return "[" + result + "]"; + } + return host; + }; + var C0ControlPercentEncodeSet = {}; + var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { + " ": 1, + '"': 1, + "<": 1, + ">": 1, + "`": 1, + }); + var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { + "#": 1, + "?": 1, + "{": 1, + "}": 1, + }); + var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { + "/": 1, + ":": 1, + ";": 1, + "=": 1, + "@": 1, + "[": 1, + "\\": 1, + "]": 1, + "^": 1, + "|": 1, + }); + var percentEncode = function (char, set) { + var code = codeAt(char, 0); + return code > 32 && code < 127 && !has(set, char) + ? char + : encodeURIComponent(char); + }; + var specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443, + }; + var isSpecial = function (url) { + return has(specialSchemes, url.scheme); + }; + var includesCredentials = function (url) { + return url.username != "" || url.password != ""; + }; + var cannotHaveUsernamePasswordPort = function (url) { + return !url.host || url.cannotBeABaseURL || url.scheme == "file"; + }; + var isWindowsDriveLetter = function (string, normalized) { + var second; + return ( + string.length == 2 && + ALPHA.test(string.charAt(0)) && + ((second = string.charAt(1)) == ":" || + (!normalized && second == "|")) + ); + }; + var startsWithWindowsDriveLetter = function (string) { + var third; + return ( + string.length > 1 && + isWindowsDriveLetter(string.slice(0, 2)) && + (string.length == 2 || + (third = string.charAt(2)) === "/" || + third === "\\" || + third === "?" || + third === "#") + ); + }; + var shortenURLsPath = function (url) { + var path = url.path; + var pathSize = path.length; + if ( + pathSize && + (url.scheme != "file" || + pathSize != 1 || + !isWindowsDriveLetter(path[0], true)) + ) { + path.pop(); + } + }; + var isSingleDot = function (segment) { + return segment === "." || segment.toLowerCase() === "%2e"; + }; + var isDoubleDot = function (segment) { + segment = segment.toLowerCase(); + return ( + segment === ".." || + segment === "%2e." || + segment === ".%2e" || + segment === "%2e%2e" + ); + }; + // States: + var SCHEME_START = {}; + var SCHEME = {}; + var NO_SCHEME = {}; + var SPECIAL_RELATIVE_OR_AUTHORITY = {}; + var PATH_OR_AUTHORITY = {}; + var RELATIVE = {}; + var RELATIVE_SLASH = {}; + var SPECIAL_AUTHORITY_SLASHES = {}; + var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; + var AUTHORITY = {}; + var HOST = {}; + var HOSTNAME = {}; + var PORT = {}; + var FILE = {}; + var FILE_SLASH = {}; + var FILE_HOST = {}; + var PATH_START = {}; + var PATH = {}; + var CANNOT_BE_A_BASE_URL_PATH = {}; + var QUERY = {}; + var FRAGMENT = {}; + // eslint-disable-next-line max-statements + var parseURL = function (url, input, stateOverride, base) { + var state = stateOverride || SCHEME_START; + var pointer = 0; + var buffer = ""; + var seenAt = false; + var seenBracket = false; + var seenPasswordToken = false; + var codePoints, char, bufferCodePoints, failure; + if (!stateOverride) { + url.scheme = ""; + url.username = ""; + url.password = ""; + url.host = null; + url.port = null; + url.path = []; + url.query = null; + url.fragment = null; + url.cannotBeABaseURL = false; + input = input.replace( + LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, + "", + ); + } + input = input.replace(TAB_AND_NEW_LINE, ""); + codePoints = arrayFrom(input); + while (pointer <= codePoints.length) { + char = codePoints[pointer]; + switch (state) { + case SCHEME_START: + if (char && ALPHA.test(char)) { + buffer += char.toLowerCase(); + state = SCHEME; + } else if (!stateOverride) { + state = NO_SCHEME; + continue; + } else return INVALID_SCHEME; + break; + case SCHEME: + if ( + char && + (ALPHANUMERIC.test(char) || + char == "+" || + char == "-" || + char == ".") + ) { + buffer += char.toLowerCase(); + } else if (char == ":") { + if ( + stateOverride && + (isSpecial(url) != has(specialSchemes, buffer) || + (buffer == "file" && + (includesCredentials(url) || url.port !== null)) || + (url.scheme == "file" && !url.host)) + ) + return; + url.scheme = buffer; + if (stateOverride) { + if ( + isSpecial(url) && + specialSchemes[url.scheme] == url.port + ) + url.port = null; + return; + } + buffer = ""; + if (url.scheme == "file") { + state = FILE; + } else if ( + isSpecial(url) && + base && + base.scheme == url.scheme + ) { + state = SPECIAL_RELATIVE_OR_AUTHORITY; + } else if (isSpecial(url)) { + state = SPECIAL_AUTHORITY_SLASHES; + } else if (codePoints[pointer + 1] == "/") { + state = PATH_OR_AUTHORITY; + pointer++; + } else { + url.cannotBeABaseURL = true; + url.path.push(""); + state = CANNOT_BE_A_BASE_URL_PATH; + } + } else if (!stateOverride) { + buffer = ""; + state = NO_SCHEME; + pointer = 0; + continue; + } else return INVALID_SCHEME; + break; + case NO_SCHEME: + if (!base || (base.cannotBeABaseURL && char != "#")) + return INVALID_SCHEME; + if (base.cannotBeABaseURL && char == "#") { + url.scheme = base.scheme; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ""; + url.cannotBeABaseURL = true; + state = FRAGMENT; + break; + } + state = base.scheme == "file" ? FILE : RELATIVE; + continue; + case SPECIAL_RELATIVE_OR_AUTHORITY: + if (char == "/" && codePoints[pointer + 1] == "/") { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + pointer++; + } else { + state = RELATIVE; + continue; + } + break; + case PATH_OR_AUTHORITY: + if (char == "/") { + state = AUTHORITY; + break; + } else { + state = PATH; + continue; + } + case RELATIVE: + url.scheme = base.scheme; + if (char == EOF) { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == "/" || (char == "\\" && isSpecial(url))) { + state = RELATIVE_SLASH; + } else if (char == "?") { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = ""; + state = QUERY; + } else if (char == "#") { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ""; + state = FRAGMENT; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.path.pop(); + state = PATH; + continue; + } + break; + case RELATIVE_SLASH: + if (isSpecial(url) && (char == "/" || char == "\\")) { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + } else if (char == "/") { + state = AUTHORITY; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + state = PATH; + continue; + } + break; + case SPECIAL_AUTHORITY_SLASHES: + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + if (char != "/" || buffer.charAt(pointer + 1) != "/") + continue; + pointer++; + break; + case SPECIAL_AUTHORITY_IGNORE_SLASHES: + if (char != "/" && char != "\\") { + state = AUTHORITY; + continue; + } + break; + case AUTHORITY: + if (char == "@") { + if (seenAt) buffer = "%40" + buffer; + seenAt = true; + bufferCodePoints = arrayFrom(buffer); + for (var i = 0; i < bufferCodePoints.length; i++) { + var codePoint = bufferCodePoints[i]; + if (codePoint == ":" && !seenPasswordToken) { + seenPasswordToken = true; + continue; + } + var encodedCodePoints = percentEncode( + codePoint, + userinfoPercentEncodeSet, + ); + if (seenPasswordToken) url.password += encodedCodePoints; + else url.username += encodedCodePoints; + } + buffer = ""; + } else if ( + char == EOF || + char == "/" || + char == "?" || + char == "#" || + (char == "\\" && isSpecial(url)) + ) { + if (seenAt && buffer == "") return INVALID_AUTHORITY; + pointer -= arrayFrom(buffer).length + 1; + buffer = ""; + state = HOST; + } else buffer += char; + break; + case HOST: + case HOSTNAME: + if (stateOverride && url.scheme == "file") { + state = FILE_HOST; + continue; + } else if (char == ":" && !seenBracket) { + if (buffer == "") return INVALID_HOST; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ""; + state = PORT; + if (stateOverride == HOSTNAME) return; + } else if ( + char == EOF || + char == "/" || + char == "?" || + char == "#" || + (char == "\\" && isSpecial(url)) + ) { + if (isSpecial(url) && buffer == "") return INVALID_HOST; + if ( + stateOverride && + buffer == "" && + (includesCredentials(url) || url.port !== null) + ) + return; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ""; + state = PATH_START; + if (stateOverride) return; + continue; + } else { + if (char == "[") seenBracket = true; + else if (char == "]") seenBracket = false; + buffer += char; + } + break; + case PORT: + if (DIGIT.test(char)) { + buffer += char; + } else if ( + char == EOF || + char == "/" || + char == "?" || + char == "#" || + (char == "\\" && isSpecial(url)) || + stateOverride + ) { + if (buffer != "") { + var port = parseInt(buffer, 10); + if (port > 65535) return INVALID_PORT; + url.port = + isSpecial(url) && port === specialSchemes[url.scheme] + ? null + : port; + buffer = ""; + } + if (stateOverride) return; + state = PATH_START; + continue; + } else return INVALID_PORT; + break; + case FILE: + url.scheme = "file"; + if (char == "/" || char == "\\") state = FILE_SLASH; + else if (base && base.scheme == "file") { + if (char == EOF) { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == "?") { + url.host = base.host; + url.path = base.path.slice(); + url.query = ""; + state = QUERY; + } else if (char == "#") { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ""; + state = FRAGMENT; + } else { + if ( + !startsWithWindowsDriveLetter( + codePoints.slice(pointer).join(""), + ) + ) { + url.host = base.host; + url.path = base.path.slice(); + shortenURLsPath(url); + } + state = PATH; + continue; + } + } else { + state = PATH; + continue; + } + break; + case FILE_SLASH: + if (char == "/" || char == "\\") { + state = FILE_HOST; + break; + } + if ( + base && + base.scheme == "file" && + !startsWithWindowsDriveLetter( + codePoints.slice(pointer).join(""), + ) + ) { + if (isWindowsDriveLetter(base.path[0], true)) + url.path.push(base.path[0]); + else url.host = base.host; + } + state = PATH; + continue; + case FILE_HOST: + if ( + char == EOF || + char == "/" || + char == "\\" || + char == "?" || + char == "#" + ) { + if (!stateOverride && isWindowsDriveLetter(buffer)) { + state = PATH; + } else if (buffer == "") { + url.host = ""; + if (stateOverride) return; + state = PATH_START; + } else { + failure = parseHost(url, buffer); + if (failure) return failure; + if (url.host == "localhost") url.host = ""; + if (stateOverride) return; + buffer = ""; + state = PATH_START; + } + continue; + } else buffer += char; + break; + case PATH_START: + if (isSpecial(url)) { + state = PATH; + if (char != "/" && char != "\\") continue; + } else if (!stateOverride && char == "?") { + url.query = ""; + state = QUERY; + } else if (!stateOverride && char == "#") { + url.fragment = ""; + state = FRAGMENT; + } else if (char != EOF) { + state = PATH; + if (char != "/") continue; + } + break; + case PATH: + if ( + char == EOF || + char == "/" || + (char == "\\" && isSpecial(url)) || + (!stateOverride && (char == "?" || char == "#")) + ) { + if (isDoubleDot(buffer)) { + shortenURLsPath(url); + if (char != "/" && !(char == "\\" && isSpecial(url))) { + url.path.push(""); + } + } else if (isSingleDot(buffer)) { + if (char != "/" && !(char == "\\" && isSpecial(url))) { + url.path.push(""); + } + } else { + if ( + url.scheme == "file" && + !url.path.length && + isWindowsDriveLetter(buffer) + ) { + if (url.host) url.host = ""; + buffer = buffer.charAt(0) + ":"; // normalize windows drive letter + } + url.path.push(buffer); + } + buffer = ""; + if ( + url.scheme == "file" && + (char == EOF || char == "?" || char == "#") + ) { + while (url.path.length > 1 && url.path[0] === "") { + url.path.shift(); + } + } + if (char == "?") { + url.query = ""; + state = QUERY; + } else if (char == "#") { + url.fragment = ""; + state = FRAGMENT; + } + } else { + buffer += percentEncode(char, pathPercentEncodeSet); + } + break; + case CANNOT_BE_A_BASE_URL_PATH: + if (char == "?") { + url.query = ""; + state = QUERY; + } else if (char == "#") { + url.fragment = ""; + state = FRAGMENT; + } else if (char != EOF) { + url.path[0] += percentEncode( + char, + C0ControlPercentEncodeSet, + ); + } + break; + case QUERY: + if (!stateOverride && char == "#") { + url.fragment = ""; + state = FRAGMENT; + } else if (char != EOF) { + if (char == "'" && isSpecial(url)) url.query += "%27"; + else if (char == "#") url.query += "%23"; + else + url.query += percentEncode( + char, + C0ControlPercentEncodeSet, + ); + } + break; + case FRAGMENT: + if (char != EOF) + url.fragment += percentEncode( + char, + fragmentPercentEncodeSet, + ); + break; + } + pointer++; + } + }; + // `URL` constructor + // https://url.spec.whatwg.org/#url-class + var URLConstructor = function URL(url /* , base */) { + var that = anInstance(this, URLConstructor, "URL"); + var base = arguments.length > 1 ? arguments[1] : undefined; + var urlString = String(url); + var state = setInternalState(that, { + type: "URL", + }); + var baseState, failure; + if (base !== undefined) { + if (base instanceof URLConstructor) + baseState = getInternalURLState(base); + else { + failure = parseURL((baseState = {}), String(base)); + if (failure) throw TypeError(failure); + } + } + failure = parseURL(state, urlString, null, baseState); + if (failure) throw TypeError(failure); + var searchParams = (state.searchParams = new URLSearchParams()); + var searchParamsState = getInternalSearchParamsState(searchParams); + searchParamsState.updateSearchParams(state.query); + searchParamsState.updateURL = function () { + state.query = String(searchParams) || null; + }; + if (!DESCRIPTORS) { + that.href = serializeURL.call(that); + that.origin = getOrigin.call(that); + that.protocol = getProtocol.call(that); + that.username = getUsername.call(that); + that.password = getPassword.call(that); + that.host = getHost.call(that); + that.hostname = getHostname.call(that); + that.port = getPort.call(that); + that.pathname = getPathname.call(that); + that.search = getSearch.call(that); + that.searchParams = getSearchParams.call(that); + that.hash = getHash.call(that); + } + }; + var URLPrototype = URLConstructor.prototype; + var serializeURL = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var username = url.username; + var password = url.password; + var host = url.host; + var port = url.port; + var path = url.path; + var query = url.query; + var fragment = url.fragment; + var output = scheme + ":"; + if (host !== null) { + output += "//"; + if (includesCredentials(url)) { + output += username + (password ? ":" + password : "") + "@"; + } + output += serializeHost(host); + if (port !== null) output += ":" + port; + } else if (scheme == "file") output += "//"; + output += url.cannotBeABaseURL + ? path[0] + : path.length + ? "/" + path.join("/") + : ""; + if (query !== null) output += "?" + query; + if (fragment !== null) output += "#" + fragment; + return output; + }; + var getOrigin = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var port = url.port; + if (scheme == "blob") + try { + return new URL(scheme.path[0]).origin; + } catch (error) { + return "null"; + } + if (scheme == "file" || !isSpecial(url)) return "null"; + return ( + scheme + + "://" + + serializeHost(url.host) + + (port !== null ? ":" + port : "") + ); + }; + var getProtocol = function () { + return getInternalURLState(this).scheme + ":"; + }; + var getUsername = function () { + return getInternalURLState(this).username; + }; + var getPassword = function () { + return getInternalURLState(this).password; + }; + var getHost = function () { + var url = getInternalURLState(this); + var host = url.host; + var port = url.port; + return host === null + ? "" + : port === null + ? serializeHost(host) + : serializeHost(host) + ":" + port; + }; + var getHostname = function () { + var host = getInternalURLState(this).host; + return host === null ? "" : serializeHost(host); + }; + var getPort = function () { + var port = getInternalURLState(this).port; + return port === null ? "" : String(port); + }; + var getPathname = function () { + var url = getInternalURLState(this); + var path = url.path; + return url.cannotBeABaseURL + ? path[0] + : path.length + ? "/" + path.join("/") + : ""; + }; + var getSearch = function () { + var query = getInternalURLState(this).query; + return query ? "?" + query : ""; + }; + var getSearchParams = function () { + return getInternalURLState(this).searchParams; + }; + var getHash = function () { + var fragment = getInternalURLState(this).fragment; + return fragment ? "#" + fragment : ""; + }; + var accessorDescriptor = function (getter, setter) { + return { + get: getter, + set: setter, + configurable: true, + enumerable: true, + }; + }; + if (DESCRIPTORS) { + defineProperties(URLPrototype, { + // `URL.prototype.href` accessors pair + // https://url.spec.whatwg.org/#dom-url-href + href: accessorDescriptor(serializeURL, function (href) { + var url = getInternalURLState(this); + var urlString = String(href); + var failure = parseURL(url, urlString); + if (failure) throw TypeError(failure); + getInternalSearchParamsState( + url.searchParams, + ).updateSearchParams(url.query); + }), + // `URL.prototype.origin` getter + // https://url.spec.whatwg.org/#dom-url-origin + origin: accessorDescriptor(getOrigin), + // `URL.prototype.protocol` accessors pair + // https://url.spec.whatwg.org/#dom-url-protocol + protocol: accessorDescriptor(getProtocol, function (protocol) { + var url = getInternalURLState(this); + parseURL(url, String(protocol) + ":", SCHEME_START); + }), + // `URL.prototype.username` accessors pair + // https://url.spec.whatwg.org/#dom-url-username + username: accessorDescriptor(getUsername, function (username) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(username)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.username = ""; + for (var i = 0; i < codePoints.length; i++) { + url.username += percentEncode( + codePoints[i], + userinfoPercentEncodeSet, + ); + } + }), + // `URL.prototype.password` accessors pair + // https://url.spec.whatwg.org/#dom-url-password + password: accessorDescriptor(getPassword, function (password) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(password)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.password = ""; + for (var i = 0; i < codePoints.length; i++) { + url.password += percentEncode( + codePoints[i], + userinfoPercentEncodeSet, + ); + } + }), + // `URL.prototype.host` accessors pair + // https://url.spec.whatwg.org/#dom-url-host + host: accessorDescriptor(getHost, function (host) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(host), HOST); + }), + // `URL.prototype.hostname` accessors pair + // https://url.spec.whatwg.org/#dom-url-hostname + hostname: accessorDescriptor(getHostname, function (hostname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(hostname), HOSTNAME); + }), + // `URL.prototype.port` accessors pair + // https://url.spec.whatwg.org/#dom-url-port + port: accessorDescriptor(getPort, function (port) { + var url = getInternalURLState(this); + if (cannotHaveUsernamePasswordPort(url)) return; + port = String(port); + if (port == "") url.port = null; + else parseURL(url, port, PORT); + }), + // `URL.prototype.pathname` accessors pair + // https://url.spec.whatwg.org/#dom-url-pathname + pathname: accessorDescriptor(getPathname, function (pathname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + url.path = []; + parseURL(url, pathname + "", PATH_START); + }), + // `URL.prototype.search` accessors pair + // https://url.spec.whatwg.org/#dom-url-search + search: accessorDescriptor(getSearch, function (search) { + var url = getInternalURLState(this); + search = String(search); + if (search == "") { + url.query = null; + } else { + if ("?" == search.charAt(0)) search = search.slice(1); + url.query = ""; + parseURL(url, search, QUERY); + } + getInternalSearchParamsState( + url.searchParams, + ).updateSearchParams(url.query); + }), + // `URL.prototype.searchParams` getter + // https://url.spec.whatwg.org/#dom-url-searchparams + searchParams: accessorDescriptor(getSearchParams), + // `URL.prototype.hash` accessors pair + // https://url.spec.whatwg.org/#dom-url-hash + hash: accessorDescriptor(getHash, function (hash) { + var url = getInternalURLState(this); + hash = String(hash); + if (hash == "") { + url.fragment = null; + return; + } + if ("#" == hash.charAt(0)) hash = hash.slice(1); + url.fragment = ""; + parseURL(url, hash, FRAGMENT); + }), + }); + } // `URL.prototype.toJSON` method + // https://url.spec.whatwg.org/#dom-url-tojson + + redefine( + URLPrototype, + "toJSON", + function toJSON() { + return serializeURL.call(this); + }, + { + enumerable: true, + }, + ); + // `URL.prototype.toString` method + // https://url.spec.whatwg.org/#URL-stringification-behavior + redefine( + URLPrototype, + "toString", + function toString() { + return serializeURL.call(this); + }, + { + enumerable: true, + }, + ); + if (NativeURL) { + var nativeCreateObjectURL = NativeURL.createObjectURL; + var nativeRevokeObjectURL = NativeURL.revokeObjectURL; + // `URL.createObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL + // eslint-disable-next-line no-unused-vars + if (nativeCreateObjectURL) + redefine( + URLConstructor, + "createObjectURL", + function createObjectURL(blob) { + return nativeCreateObjectURL.apply(NativeURL, arguments); + }, + ); + // `URL.revokeObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL + // eslint-disable-next-line no-unused-vars + if (nativeRevokeObjectURL) + redefine( + URLConstructor, + "revokeObjectURL", + function revokeObjectURL(url) { + return nativeRevokeObjectURL.apply(NativeURL, arguments); + }, + ); + } + setToStringTag(URLConstructor, "URL"); + $( + { + global: true, + forced: !USE_NATIVE_URL, + sham: !DESCRIPTORS, + }, + { + URL: URLConstructor, + }, + ); + }, + { + "../internals/an-instance": 27, + "../internals/array-from": 35, + "../internals/descriptors": 61, + "../internals/export": 68, + "../internals/global": 77, + "../internals/has": 78, + "../internals/internal-state": 88, + "../internals/native-url": 102, + "../internals/object-assign": 107, + "../internals/object-define-properties": 109, + "../internals/redefine": 126, + "../internals/set-to-string-tag": 135, + "../internals/string-multibyte": 141, + "../internals/string-punycode-to-ascii": 144, + "../modules/es.string.iterator": 210, + "../modules/web.url-search-params": 257, + }, + ], + 259: [ + function (_dereq_, module, exports) { + // This file can be required in Browserify and Node.js for automatic polyfill + // To use it: require('es6-promise/auto'); + "use strict"; + module.exports = _dereq_("./").polyfill(); + }, + { + "./": 260, + }, + ], + 260: [ + function (_dereq_, module, exports) { + (function (process, global) { + /*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */ + (function (global, factory) { + typeof exports === "object" && typeof module !== "undefined" + ? (module.exports = factory()) + : typeof define === "function" && define.amd + ? define(factory) + : (global.ES6Promise = factory()); + })(this, function () { + "use strict"; + function objectOrFunction(x) { + var type = typeof x; + return x !== null && (type === "object" || type === "function"); + } + function isFunction(x) { + return typeof x === "function"; + } + var _isArray = void 0; + if (Array.isArray) { + _isArray = Array.isArray; + } else { + _isArray = function (x) { + return Object.prototype.toString.call(x) === "[object Array]"; + }; + } + var isArray = _isArray; + var len = 0; + var vertxNext = void 0; + var customSchedulerFn = void 0; + var asap = function asap(callback, arg) { + queue[len] = callback; + queue[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (customSchedulerFn) { + customSchedulerFn(flush); + } else { + scheduleFlush(); + } + } + }; + function setScheduler(scheduleFn) { + customSchedulerFn = scheduleFn; + } + function setAsap(asapFn) { + asap = asapFn; + } + var browserWindow = + typeof window !== "undefined" ? window : undefined; + var browserGlobal = browserWindow || {}; + var BrowserMutationObserver = + browserGlobal.MutationObserver || + browserGlobal.WebKitMutationObserver; + var isNode = + typeof self === "undefined" && + typeof process !== "undefined" && + {}.toString.call(process) === "[object process]"; + // test for web worker but not in IE10 + var isWorker = + typeof Uint8ClampedArray !== "undefined" && + typeof importScripts !== "undefined" && + typeof MessageChannel !== "undefined"; + // node + function useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function () { + return process.nextTick(flush); + }; + } // vertx + + function useVertxTimer() { + if (typeof vertxNext !== "undefined") { + return function () { + vertxNext(flush); + }; + } + return useSetTimeout(); + } + function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(""); + observer.observe(node, { + characterData: true, + }); + return function () { + node.data = iterations = ++iterations % 2; + }; + } // web worker + + function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; + } + function useSetTimeout() { + // Store setTimeout reference so es6-promise will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var globalSetTimeout = setTimeout; + return function () { + return globalSetTimeout(flush, 1); + }; + } + var queue = new Array(1000); + function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue[i]; + var arg = queue[i + 1]; + callback(arg); + queue[i] = undefined; + queue[i + 1] = undefined; + } + len = 0; + } + function attemptVertx() { + try { + var vertx = Function("return this")().require("vertx"); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } + } + var scheduleFlush = void 0; + // Decide what async method to use to triggering processing of queued callbacks: + if (isNode) { + scheduleFlush = useNextTick(); + } else if (BrowserMutationObserver) { + scheduleFlush = useMutationObserver(); + } else if (isWorker) { + scheduleFlush = useMessageChannel(); + } else if ( + browserWindow === undefined && + typeof _dereq_ === "function" + ) { + scheduleFlush = attemptVertx(); + } else { + scheduleFlush = useSetTimeout(); + } + function then(onFulfillment, onRejection) { + var parent = this; + var child = new this.constructor(noop); + if (child[PROMISE_ID] === undefined) { + makePromise(child); + } + var _state = parent._state; + if (_state) { + var callback = arguments[_state - 1]; + asap(function () { + return invokeCallback( + _state, + child, + callback, + parent._result, + ); + }); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } + return child; + } /** + `Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + let promise = new Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @param {Any} value value that the returned promise will be resolved with + Useful for tooling. + @return {Promise} a promise that will become fulfilled with the given + `value` + */ - }, - { - key: '_addCap', - value: function _addCap(point, tangent, color) { - var ptArray = point.array(); - var tanInArray = tangent.array(); - var tanOutArray = [ - 0, - 0, - 0 - ]; - for (var i = 0; i < 6; i++) { - var _this$lineVertices2, - _this$lineTangentsIn, - _this$lineTangentsOut, - _this$lineVertexColor2; - (_this$lineVertices2 = this.lineVertices).push.apply(_this$lineVertices2, _toConsumableArray(ptArray)); - (_this$lineTangentsIn = this.lineTangentsIn).push.apply(_this$lineTangentsIn, _toConsumableArray(tanInArray)); - (_this$lineTangentsOut = this.lineTangentsOut).push.apply(_this$lineTangentsOut, tanOutArray); - (_this$lineVertexColor2 = this.lineVertexColors).push.apply(_this$lineVertexColor2, _toConsumableArray(color)); - } - this.lineSides.push( - 1, 2, - 2, 1, 2, - 1); - return this; - } /** - * Adds the vertices and vertex attributes for four triangles representing a - * join between two adjacent line segments. This creates a quad on either side - * of the shared vertex of the two line segments, with each quad perpendicular - * to the lines. A vertex shader will discard all but the quad in the "elbow" of - * the join, and a fragment shader will display the appropriate join style - * within the remaining quad. - * - * The lineSides buffer will include the following values for the points on - * the join rectangles: - * - * -1 -2 - * -------------o----o - * | | - * 1 o----o----o -3 - * | | 0 | - * --------o----o | - * 2| 3 | - * | | - * | | - * @private - * @chainable - */ + function resolve$1(object) { + /*jshint validthis:true */ + var Constructor = this; + if ( + object && + typeof object === "object" && + object.constructor === Constructor + ) { + return object; + } + var promise = new Constructor(noop); + resolve(promise, object); + return promise; + } + var PROMISE_ID = Math.random().toString(36).substring(2); + function noop() {} + var PENDING = void 0; + var FULFILLED = 1; + var REJECTED = 2; + function selfFulfillment() { + return new TypeError( + "You cannot resolve a promise with itself", + ); + } + function cannotReturnOwn() { + return new TypeError( + "A promises callback cannot return that same promise.", + ); + } + function tryThen( + then$$1, + value, + fulfillmentHandler, + rejectionHandler, + ) { + try { + then$$1.call(value, fulfillmentHandler, rejectionHandler); + } catch (e) { + return e; + } + } + function handleForeignThenable(promise, thenable, then$$1) { + asap(function (promise) { + var sealed = false; + var error = tryThen( + then$$1, + thenable, + function (value) { + if (sealed) { + return; + } + sealed = true; + if (thenable !== value) { + resolve(promise, value); + } else { + fulfill(promise, value); + } + }, + function (reason) { + if (sealed) { + return; + } + sealed = true; + reject(promise, reason); + }, + "Settle: " + (promise._label || " unknown promise"), + ); + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); + } + function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + reject(promise, thenable._result); + } else { + subscribe( + thenable, + undefined, + function (value) { + return resolve(promise, value); + }, + function (reason) { + return reject(promise, reason); + }, + ); + } + } + function handleMaybeThenable(promise, maybeThenable, then$$1) { + if ( + maybeThenable.constructor === promise.constructor && + then$$1 === then && + maybeThenable.constructor.resolve === resolve$1 + ) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$1 === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$1)) { + handleForeignThenable(promise, maybeThenable, then$$1); + } else { + fulfill(promise, maybeThenable); + } + } + } + function resolve(promise, value) { + if (promise === value) { + reject(promise, selfFulfillment()); + } else if (objectOrFunction(value)) { + var then$$1 = void 0; + try { + then$$1 = value.then; + } catch (error) { + reject(promise, error); + return; + } + handleMaybeThenable(promise, value, then$$1); + } else { + fulfill(promise, value); + } + } + function publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + publish(promise); + } + function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } + promise._result = value; + promise._state = FULFILLED; + if (promise._subscribers.length !== 0) { + asap(publish, promise); + } + } + function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + asap(publishRejection, promise); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var _subscribers = parent._subscribers; + var length = _subscribers.length; + parent._onerror = null; + _subscribers[length] = child; + _subscribers[length + FULFILLED] = onFulfillment; + _subscribers[length + REJECTED] = onRejection; + if (length === 0 && parent._state) { + asap(publish, parent); + } + } + function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + if (subscribers.length === 0) { + return; + } + var child = void 0, + callback = void 0, + detail = promise._result; + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + promise._subscribers.length = 0; + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = void 0, + error = void 0, + succeeded = true; + if (hasCallback) { + try { + value = callback(detail); + } catch (e) { + succeeded = false; + error = e; + } + if (promise === value) { + reject(promise, cannotReturnOwn()); + return; + } + } else { + value = detail; + } + if (promise._state !== PENDING) { + // noop + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (succeeded === false) { + reject(promise, error); + } else if (settled === FULFILLED) { + fulfill(promise, value); + } else if (settled === REJECTED) { + reject(promise, value); + } + } + function initializePromise(promise, resolver) { + try { + resolver( + function resolvePromise(value) { + resolve(promise, value); + }, + function rejectPromise(reason) { + reject(promise, reason); + }, + ); + } catch (e) { + reject(promise, e); + } + } + var id = 0; + function nextId() { + return id++; + } + function makePromise(promise) { + promise[PROMISE_ID] = id++; + promise._state = undefined; + promise._result = undefined; + promise._subscribers = []; + } + function validationError() { + return new Error("Array Methods must be provided an Array"); + } + var Enumerator = (function () { + function Enumerator(Constructor, input) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop); + if (!this.promise[PROMISE_ID]) { + makePromise(this.promise); + } + if (isArray(input)) { + this.length = input.length; + this._remaining = input.length; + this._result = new Array(this.length); + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(input); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, validationError()); + } + } + Enumerator.prototype._enumerate = function _enumerate(input) { + for ( + var i = 0; + this._state === PENDING && i < input.length; + i++ + ) { + this._eachEntry(input[i], i); + } + }; + Enumerator.prototype._eachEntry = function _eachEntry( + entry, + i, + ) { + var c = this._instanceConstructor; + var resolve$$1 = c.resolve; + if (resolve$$1 === resolve$1) { + var _then = void 0; + var error = void 0; + var didError = false; + try { + _then = entry.then; + } catch (e) { + didError = true; + error = e; + } + if (_then === then && entry._state !== PENDING) { + this._settledAt(entry._state, i, entry._result); + } else if (typeof _then !== "function") { + this._remaining--; + this._result[i] = entry; + } else if (c === Promise$1) { + var promise = new c(noop); + if (didError) { + reject(promise, error); + } else { + handleMaybeThenable(promise, entry, _then); + } + this._willSettleAt(promise, i); + } else { + this._willSettleAt( + new c(function (resolve$$1) { + return resolve$$1(entry); + }), + i, + ); + } + } else { + this._willSettleAt(resolve$$1(entry), i); + } + }; + Enumerator.prototype._settledAt = function _settledAt( + state, + i, + value, + ) { + var promise = this.promise; + if (promise._state === PENDING) { + this._remaining--; + if (state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = value; + } + } + if (this._remaining === 0) { + fulfill(promise, this._result); + } + }; + Enumerator.prototype._willSettleAt = function _willSettleAt( + promise, + i, + ) { + var enumerator = this; + subscribe( + promise, + undefined, + function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, + function (reason) { + return enumerator._settledAt(REJECTED, i, reason); + }, + ); + }; + return Enumerator; + })(); + /** + `Promise.all` accepts an array of promises, and returns a new promise which + is fulfilled with an array of fulfillment values for the passed promises, or + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = resolve(1); + let promise2 = resolve(2); + let promise3 = resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = resolve(1); + let promise2 = reject(new Error("2")); + let promise3 = reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static + */ + function all(entries) { + return new Enumerator(this, entries).promise; + } /** + `Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @param {Array} promises array of promises to observe + Useful for tooling. + @return {Promise} a promise which settles in the same way as the first passed + promise to settle. + */ - }, - { - key: '_addJoin', - value: function _addJoin(point, fromTangent, toTangent, color) { - var ptArray = point.array(); - var tanInArray = fromTangent.array(); - var tanOutArray = toTangent.array(); - for (var i = 0; i < 12; i++) { - var _this$lineVertices3, - _this$lineTangentsIn2, - _this$lineTangentsOut2, - _this$lineVertexColor3; - (_this$lineVertices3 = this.lineVertices).push.apply(_this$lineVertices3, _toConsumableArray(ptArray)); - (_this$lineTangentsIn2 = this.lineTangentsIn).push.apply(_this$lineTangentsIn2, _toConsumableArray(tanInArray)); - (_this$lineTangentsOut2 = this.lineTangentsOut).push.apply(_this$lineTangentsOut2, _toConsumableArray(tanOutArray)); - (_this$lineVertexColor3 = this.lineVertexColors).push.apply(_this$lineVertexColor3, _toConsumableArray(color)); - } - this.lineSides.push( - 1, - 3, - 2, - 1, 0, - 3); - this.lineSides.push(3, 1, 2, 3, 0, 1); - return this; - } /** - * Modifies all vertices to be centered within the range -100 to 100. - * @method normalize - * @chainable - */ + function race(entries) { + /*jshint validthis:true */ + var Constructor = this; + if (!isArray(entries)) { + return new Constructor(function (_, reject) { + return reject( + new TypeError("You must pass an array to race."), + ); + }); + } else { + return new Constructor(function (resolve, reject) { + var length = entries.length; + for (var i = 0; i < length; i++) { + Constructor.resolve(entries[i]).then(resolve, reject); + } + }); + } + } /** + `Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @param {Any} reason value that the returned promise will be rejected with. + Useful for tooling. + @return {Promise} a promise rejected with the given `reason`. + */ - }, - { - key: 'normalize', - value: function normalize() { - if (this.vertices.length > 0) { - // Find the corners of our bounding box - var maxPosition = this.vertices[0].copy(); - var minPosition = this.vertices[0].copy(); - for (var i = 0; i < this.vertices.length; i++) { - maxPosition.x = Math.max(maxPosition.x, this.vertices[i].x); - minPosition.x = Math.min(minPosition.x, this.vertices[i].x); - maxPosition.y = Math.max(maxPosition.y, this.vertices[i].y); - minPosition.y = Math.min(minPosition.y, this.vertices[i].y); - maxPosition.z = Math.max(maxPosition.z, this.vertices[i].z); - minPosition.z = Math.min(minPosition.z, this.vertices[i].z); - } - var center = _main.default.Vector.lerp(maxPosition, minPosition, 0.5); - var dist = _main.default.Vector.sub(maxPosition, minPosition); - var longestDist = Math.max(Math.max(dist.x, dist.y), dist.z); - var scale = 200 / longestDist; - for (var _i5 = 0; _i5 < this.vertices.length; _i5++) { - this.vertices[_i5].sub(center); - this.vertices[_i5].mult(scale); - } - } - return this; - } + function reject$1(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop); + reject(promise, reason); + return promise; + } + function needsResolver() { + throw new TypeError( + "You must pass a resolver function as the first argument to the promise constructor", + ); + } + function needsNew() { + throw new TypeError( + "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.", + ); + } /** + Promise objects represent the eventual result of an asynchronous operation. The + primary way of interacting with a promise is through its `then` method, which + registers callbacks to receive either a promise's eventual value or the reason + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } - ]); - return Geometry; - }(); - var _default = _main.default.Geometry; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.for-each': 175, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.map': 187, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.set': 207, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.sub': 218, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.for-each': 255, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 351: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @requires constants - * @todo see methods below needing further implementation. - * future consideration: implement SIMD optimizations - * when browser compatibility becomes available - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/ - * Reference/Global_Objects/SIMD - */ - - var GLMAT_ARRAY_TYPE = Array; - var isMatrixArray = function isMatrixArray(x) { - return Array.isArray(x); }; - if (typeof Float32Array !== 'undefined') { - GLMAT_ARRAY_TYPE = Float32Array; - isMatrixArray = function isMatrixArray(x) { - return Array.isArray(x) || x instanceof Float32Array; - }; - } /** - * A class to describe a 4×4 matrix - * for model and view matrix manipulation in the p5js webgl renderer. - * @class p5.Matrix - * @private - * @constructor - * @param {Array} [mat4] column-major array literal of our 4×4 matrix - */ - - _main.default.Matrix = /*#__PURE__*/ function () { - function _class() { - var _ref; - _classCallCheck(this, _class); - // This is default behavior when object - // instantiated using createMatrix() - // @todo implement createMatrix() in core/math.js - if (arguments.length && (_ref = arguments.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]) instanceof _main.default) { - var _ref2; - this.p5 = (_ref2 = arguments.length - 1, _ref2 < 0 || arguments.length <= _ref2 ? undefined : arguments[_ref2]); - } - if ((arguments.length <= 0 ? undefined : arguments[0]) === 'mat3') { - this.mat3 = Array.isArray(arguments.length <= 1 ? undefined : arguments[1]) ? arguments.length <= 1 ? undefined : arguments[1] : new GLMAT_ARRAY_TYPE([1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1]); - } else { - this.mat4 = Array.isArray(arguments.length <= 0 ? undefined : arguments[0]) ? arguments.length <= 0 ? undefined : arguments[0] : new GLMAT_ARRAY_TYPE([1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1]); - } - return this; - } /** - * Sets the x, y, and z component of the vector using two or three separate - * variables, the data from a p5.Matrix, or the values from a float array. - * - * @method set - * @param {p5.Matrix|Float32Array|Number[]} [inMatrix] the input p5.Matrix or - * an Array of length 16 - * @chainable - */ - /** - * @method set - * @param {Number[]} elements 16 numbers passed by value to avoid - * array copying. - * @chainable + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {Function} resolver + Useful for tooling. + @constructor */ - _createClass(_class, [ - { - key: 'set', - value: function set(inMatrix) { - if (inMatrix instanceof _main.default.Matrix) { - this.mat4 = inMatrix.mat4; - return this; - } else if (isMatrixArray(inMatrix)) { - this.mat4 = inMatrix; - return this; - } else if (arguments.length === 16) { - this.mat4[0] = arguments[0]; - this.mat4[1] = arguments[1]; - this.mat4[2] = arguments[2]; - this.mat4[3] = arguments[3]; - this.mat4[4] = arguments[4]; - this.mat4[5] = arguments[5]; - this.mat4[6] = arguments[6]; - this.mat4[7] = arguments[7]; - this.mat4[8] = arguments[8]; - this.mat4[9] = arguments[9]; - this.mat4[10] = arguments[10]; - this.mat4[11] = arguments[11]; - this.mat4[12] = arguments[12]; - this.mat4[13] = arguments[13]; - this.mat4[14] = arguments[14]; - this.mat4[15] = arguments[15]; - } - return this; - } /** - * Gets a copy of the vector, returns a p5.Matrix object. - * - * @method get - * @return {p5.Matrix} the copy of the p5.Matrix object - */ - - }, - { - key: 'get', - value: function get() { - return new _main.default.Matrix(this.mat4, this.p5); - } /** - * return a copy of this matrix. - * If this matrix is 4x4, a 4x4 matrix with exactly the same entries will be - * generated. The same is true if this matrix is 3x3. - * - * @method copy - * @return {p5.Matrix} the result matrix - */ - - }, - { - key: 'copy', - value: function copy() { - if (this.mat3 !== undefined) { - var copied3x3 = new _main.default.Matrix('mat3', this.p5); - copied3x3.mat3[0] = this.mat3[0]; - copied3x3.mat3[1] = this.mat3[1]; - copied3x3.mat3[2] = this.mat3[2]; - copied3x3.mat3[3] = this.mat3[3]; - copied3x3.mat3[4] = this.mat3[4]; - copied3x3.mat3[5] = this.mat3[5]; - copied3x3.mat3[6] = this.mat3[6]; - copied3x3.mat3[7] = this.mat3[7]; - copied3x3.mat3[8] = this.mat3[8]; - return copied3x3; - } - var copied = new _main.default.Matrix(this.p5); - copied.mat4[0] = this.mat4[0]; - copied.mat4[1] = this.mat4[1]; - copied.mat4[2] = this.mat4[2]; - copied.mat4[3] = this.mat4[3]; - copied.mat4[4] = this.mat4[4]; - copied.mat4[5] = this.mat4[5]; - copied.mat4[6] = this.mat4[6]; - copied.mat4[7] = this.mat4[7]; - copied.mat4[8] = this.mat4[8]; - copied.mat4[9] = this.mat4[9]; - copied.mat4[10] = this.mat4[10]; - copied.mat4[11] = this.mat4[11]; - copied.mat4[12] = this.mat4[12]; - copied.mat4[13] = this.mat4[13]; - copied.mat4[14] = this.mat4[14]; - copied.mat4[15] = this.mat4[15]; - return copied; - } /** - * return an identity matrix - * @method identity - * @return {p5.Matrix} the result matrix - */ - - }, - { - key: 'transpose', - /** - * transpose according to a given matrix - * @method transpose - * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be - * based on to transpose - * @chainable - */ - value: function transpose(a) { - var a01, - a02, - a03, - a12, - a13, - a23; - if (a instanceof _main.default.Matrix) { - a01 = a.mat4[1]; - a02 = a.mat4[2]; - a03 = a.mat4[3]; - a12 = a.mat4[6]; - a13 = a.mat4[7]; - a23 = a.mat4[11]; - this.mat4[0] = a.mat4[0]; - this.mat4[1] = a.mat4[4]; - this.mat4[2] = a.mat4[8]; - this.mat4[3] = a.mat4[12]; - this.mat4[4] = a01; - this.mat4[5] = a.mat4[5]; - this.mat4[6] = a.mat4[9]; - this.mat4[7] = a.mat4[13]; - this.mat4[8] = a02; - this.mat4[9] = a12; - this.mat4[10] = a.mat4[10]; - this.mat4[11] = a.mat4[14]; - this.mat4[12] = a03; - this.mat4[13] = a13; - this.mat4[14] = a23; - this.mat4[15] = a.mat4[15]; - } else if (isMatrixArray(a)) { - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a12 = a[6]; - a13 = a[7]; - a23 = a[11]; - this.mat4[0] = a[0]; - this.mat4[1] = a[4]; - this.mat4[2] = a[8]; - this.mat4[3] = a[12]; - this.mat4[4] = a01; - this.mat4[5] = a[5]; - this.mat4[6] = a[9]; - this.mat4[7] = a[13]; - this.mat4[8] = a02; - this.mat4[9] = a12; - this.mat4[10] = a[10]; - this.mat4[11] = a[14]; - this.mat4[12] = a03; - this.mat4[13] = a13; - this.mat4[14] = a23; - this.mat4[15] = a[15]; - } - return this; - } /** - * invert matrix according to a give matrix - * @method invert - * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be - * based on to invert - * @chainable - */ - - }, - { - key: 'invert', - value: function invert(a) { - var a00, - a01, - a02, - a03, - a10, - a11, - a12, - a13; - var a20, - a21, - a22, - a23, - a30, - a31, - a32, - a33; - if (a instanceof _main.default.Matrix) { - a00 = a.mat4[0]; - a01 = a.mat4[1]; - a02 = a.mat4[2]; - a03 = a.mat4[3]; - a10 = a.mat4[4]; - a11 = a.mat4[5]; - a12 = a.mat4[6]; - a13 = a.mat4[7]; - a20 = a.mat4[8]; - a21 = a.mat4[9]; - a22 = a.mat4[10]; - a23 = a.mat4[11]; - a30 = a.mat4[12]; - a31 = a.mat4[13]; - a32 = a.mat4[14]; - a33 = a.mat4[15]; - } else if (isMatrixArray(a)) { - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; - a30 = a[12]; - a31 = a[13]; - a32 = a[14]; - a33 = a[15]; - } - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - if (!det) { - return null; - } - det = 1 / det; - this.mat4[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - this.mat4[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - this.mat4[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - this.mat4[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - this.mat4[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - this.mat4[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - this.mat4[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - this.mat4[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - this.mat4[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - this.mat4[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - this.mat4[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - this.mat4[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - this.mat4[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - this.mat4[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - this.mat4[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - this.mat4[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - return this; - } /** - * Inverts a 3×3 matrix - * @method invert3x3 - * @chainable - */ - - }, - { - key: 'invert3x3', - value: function invert3x3() { - var a00 = this.mat3[0]; - var a01 = this.mat3[1]; - var a02 = this.mat3[2]; - var a10 = this.mat3[3]; - var a11 = this.mat3[4]; - var a12 = this.mat3[5]; - var a20 = this.mat3[6]; - var a21 = this.mat3[7]; - var a22 = this.mat3[8]; - var b01 = a22 * a11 - a12 * a21; - var b11 = - a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - if (!det) { - return null; - } - det = 1 / det; - this.mat3[0] = b01 * det; - this.mat3[1] = ( - a22 * a01 + a02 * a21) * det; - this.mat3[2] = (a12 * a01 - a02 * a11) * det; - this.mat3[3] = b11 * det; - this.mat3[4] = (a22 * a00 - a02 * a20) * det; - this.mat3[5] = ( - a12 * a00 + a02 * a10) * det; - this.mat3[6] = b21 * det; - this.mat3[7] = ( - a21 * a00 + a01 * a20) * det; - this.mat3[8] = (a11 * a00 - a01 * a10) * det; - return this; - } /** - * This function is only for 3x3 matrices. - * transposes a 3×3 p5.Matrix by a mat3 - * If there is an array of arguments, the matrix obtained by transposing - * the 3x3 matrix generated based on that array is set. - * If no arguments, it transposes itself and returns it. - * - * @method transpose3x3 - * @param {Number[]} mat3 1-dimensional array - * @chainable - */ - - }, - { - key: 'transpose3x3', - value: function transpose3x3(mat3) { - if (mat3 === undefined) { - mat3 = this.mat3; - } - var a01 = mat3[1]; - var a02 = mat3[2]; - var a12 = mat3[5]; - this.mat3[0] = mat3[0]; - this.mat3[1] = mat3[3]; - this.mat3[2] = mat3[6]; - this.mat3[3] = a01; - this.mat3[4] = mat3[4]; - this.mat3[5] = mat3[7]; - this.mat3[6] = a02; - this.mat3[7] = a12; - this.mat3[8] = mat3[8]; - return this; - } /** - * converts a 4×4 matrix to its 3×3 inverse transform - * commonly used in MVMatrix to NMatrix conversions. - * @method invertTranspose - * @param {p5.Matrix} mat4 the matrix to be based on to invert - * @chainable - * @todo finish implementation - */ - - }, - { - key: 'inverseTranspose', - value: function inverseTranspose(_ref3) { - var mat4 = _ref3.mat4; - if (this.mat3 === undefined) { - _main.default._friendlyError('sorry, this function only works with mat3'); - } else { - //convert mat4 -> mat3 - this.mat3[0] = mat4[0]; - this.mat3[1] = mat4[1]; - this.mat3[2] = mat4[2]; - this.mat3[3] = mat4[4]; - this.mat3[4] = mat4[5]; - this.mat3[5] = mat4[6]; - this.mat3[6] = mat4[8]; - this.mat3[7] = mat4[9]; - this.mat3[8] = mat4[10]; - } - var inverse = this.invert3x3(); - // check inverse succeeded - if (inverse) { - inverse.transpose3x3(this.mat3); - } else { - // in case of singularity, just zero the matrix - for (var i = 0; i < 9; i++) { - this.mat3[i] = 0; - } - } - return this; - } /** - * inspired by Toji's mat4 determinant - * @method determinant - * @return {Number} Determinant of our 4×4 matrix - */ - - }, - { - key: 'determinant', - value: function determinant() { - var d00 = this.mat4[0] * this.mat4[5] - this.mat4[1] * this.mat4[4], - d01 = this.mat4[0] * this.mat4[6] - this.mat4[2] * this.mat4[4], - d02 = this.mat4[0] * this.mat4[7] - this.mat4[3] * this.mat4[4], - d03 = this.mat4[1] * this.mat4[6] - this.mat4[2] * this.mat4[5], - d04 = this.mat4[1] * this.mat4[7] - this.mat4[3] * this.mat4[5], - d05 = this.mat4[2] * this.mat4[7] - this.mat4[3] * this.mat4[6], - d06 = this.mat4[8] * this.mat4[13] - this.mat4[9] * this.mat4[12], - d07 = this.mat4[8] * this.mat4[14] - this.mat4[10] * this.mat4[12], - d08 = this.mat4[8] * this.mat4[15] - this.mat4[11] * this.mat4[12], - d09 = this.mat4[9] * this.mat4[14] - this.mat4[10] * this.mat4[13], - d10 = this.mat4[9] * this.mat4[15] - this.mat4[11] * this.mat4[13], - d11 = this.mat4[10] * this.mat4[15] - this.mat4[11] * this.mat4[14]; - // Calculate the determinant - return d00 * d11 - d01 * d10 + d02 * d09 + d03 * d08 - d04 * d07 + d05 * d06; - } /** - * multiply two mat4s - * @method mult - * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix - * we want to multiply by - * @chainable - */ - - }, - { - key: 'mult', - value: function mult(multMatrix) { - var _src; - if (multMatrix === this || multMatrix === this.mat4) { - _src = this.copy().mat4; // only need to allocate in this rare case - } else if (multMatrix instanceof _main.default.Matrix) { - _src = multMatrix.mat4; - } else if (isMatrixArray(multMatrix)) { - _src = multMatrix; - } else if (arguments.length === 16) { - _src = arguments; - } else { - return; // nothing to do. - } // each row is used for the multiplier - - var b0 = this.mat4[0], - b1 = this.mat4[1], - b2 = this.mat4[2], - b3 = this.mat4[3]; - this.mat4[0] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; - this.mat4[1] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; - this.mat4[2] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; - this.mat4[3] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; - b0 = this.mat4[4]; - b1 = this.mat4[5]; - b2 = this.mat4[6]; - b3 = this.mat4[7]; - this.mat4[4] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; - this.mat4[5] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; - this.mat4[6] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; - this.mat4[7] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; - b0 = this.mat4[8]; - b1 = this.mat4[9]; - b2 = this.mat4[10]; - b3 = this.mat4[11]; - this.mat4[8] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; - this.mat4[9] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; - this.mat4[10] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; - this.mat4[11] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; - b0 = this.mat4[12]; - b1 = this.mat4[13]; - b2 = this.mat4[14]; - b3 = this.mat4[15]; - this.mat4[12] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; - this.mat4[13] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; - this.mat4[14] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; - this.mat4[15] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; - return this; - } - }, - { - key: 'apply', - value: function apply(multMatrix) { - var _src; - if (multMatrix === this || multMatrix === this.mat4) { - _src = this.copy().mat4; // only need to allocate in this rare case - } else if (multMatrix instanceof _main.default.Matrix) { - _src = multMatrix.mat4; - } else if (isMatrixArray(multMatrix)) { - _src = multMatrix; - } else if (arguments.length === 16) { - _src = arguments; - } else { - return; // nothing to do. - } - var mat4 = this.mat4; - // each row is used for the multiplier - var m0 = mat4[0]; - var m4 = mat4[4]; - var m8 = mat4[8]; - var m12 = mat4[12]; - mat4[0] = _src[0] * m0 + _src[1] * m4 + _src[2] * m8 + _src[3] * m12; - mat4[4] = _src[4] * m0 + _src[5] * m4 + _src[6] * m8 + _src[7] * m12; - mat4[8] = _src[8] * m0 + _src[9] * m4 + _src[10] * m8 + _src[11] * m12; - mat4[12] = _src[12] * m0 + _src[13] * m4 + _src[14] * m8 + _src[15] * m12; - var m1 = mat4[1]; - var m5 = mat4[5]; - var m9 = mat4[9]; - var m13 = mat4[13]; - mat4[1] = _src[0] * m1 + _src[1] * m5 + _src[2] * m9 + _src[3] * m13; - mat4[5] = _src[4] * m1 + _src[5] * m5 + _src[6] * m9 + _src[7] * m13; - mat4[9] = _src[8] * m1 + _src[9] * m5 + _src[10] * m9 + _src[11] * m13; - mat4[13] = _src[12] * m1 + _src[13] * m5 + _src[14] * m9 + _src[15] * m13; - var m2 = mat4[2]; - var m6 = mat4[6]; - var m10 = mat4[10]; - var m14 = mat4[14]; - mat4[2] = _src[0] * m2 + _src[1] * m6 + _src[2] * m10 + _src[3] * m14; - mat4[6] = _src[4] * m2 + _src[5] * m6 + _src[6] * m10 + _src[7] * m14; - mat4[10] = _src[8] * m2 + _src[9] * m6 + _src[10] * m10 + _src[11] * m14; - mat4[14] = _src[12] * m2 + _src[13] * m6 + _src[14] * m10 + _src[15] * m14; - var m3 = mat4[3]; - var m7 = mat4[7]; - var m11 = mat4[11]; - var m15 = mat4[15]; - mat4[3] = _src[0] * m3 + _src[1] * m7 + _src[2] * m11 + _src[3] * m15; - mat4[7] = _src[4] * m3 + _src[5] * m7 + _src[6] * m11 + _src[7] * m15; - mat4[11] = _src[8] * m3 + _src[9] * m7 + _src[10] * m11 + _src[11] * m15; - mat4[15] = _src[12] * m3 + _src[13] * m7 + _src[14] * m11 + _src[15] * m15; - return this; - } /** - * scales a p5.Matrix by scalars or a vector - * @method scale - * @param {p5.Vector|Float32Array|Number[]} s vector to scale by - * @chainable - */ - - }, - { - key: 'scale', - value: function scale(x, y, z) { - if (x instanceof _main.default.Vector) { - // x is a vector, extract the components from it. - y = x.y; - z = x.z; - x = x.x; // must be last - } else if (x instanceof Array) { - // x is an array, extract the components from it. - y = x[1]; - z = x[2]; - x = x[0]; // must be last - } - this.mat4[0] *= x; - this.mat4[1] *= x; - this.mat4[2] *= x; - this.mat4[3] *= x; - this.mat4[4] *= y; - this.mat4[5] *= y; - this.mat4[6] *= y; - this.mat4[7] *= y; - this.mat4[8] *= z; - this.mat4[9] *= z; - this.mat4[10] *= z; - this.mat4[11] *= z; - return this; - } /** - * rotate our Matrix around an axis by the given angle. - * @method rotate - * @param {Number} a The angle of rotation in radians - * @param {p5.Vector|Number[]} axis the axis(es) to rotate around - * @chainable - * inspired by Toji's gl-matrix lib, mat4 rotation - */ - - }, - { - key: 'rotate', - value: function rotate(a, x, y, z) { - if (x instanceof _main.default.Vector) { - // x is a vector, extract the components from it. - y = x.y; - z = x.z; - x = x.x; //must be last - } else if (x instanceof Array) { - // x is an array, extract the components from it. - y = x[1]; - z = x[2]; - x = x[0]; //must be last - } - var len = Math.sqrt(x * x + y * y + z * z); - x *= 1 / len; - y *= 1 / len; - z *= 1 / len; - var a00 = this.mat4[0]; - var a01 = this.mat4[1]; - var a02 = this.mat4[2]; - var a03 = this.mat4[3]; - var a10 = this.mat4[4]; - var a11 = this.mat4[5]; - var a12 = this.mat4[6]; - var a13 = this.mat4[7]; - var a20 = this.mat4[8]; - var a21 = this.mat4[9]; - var a22 = this.mat4[10]; - var a23 = this.mat4[11]; - //sin,cos, and tan of respective angle - var sA = Math.sin(a); - var cA = Math.cos(a); - var tA = 1 - cA; - // Construct the elements of the rotation matrix - var b00 = x * x * tA + cA; - var b01 = y * x * tA + z * sA; - var b02 = z * x * tA - y * sA; - var b10 = x * y * tA - z * sA; - var b11 = y * y * tA + cA; - var b12 = z * y * tA + x * sA; - var b20 = x * z * tA + y * sA; - var b21 = y * z * tA - x * sA; - var b22 = z * z * tA + cA; - // rotation-specific matrix multiplication - this.mat4[0] = a00 * b00 + a10 * b01 + a20 * b02; - this.mat4[1] = a01 * b00 + a11 * b01 + a21 * b02; - this.mat4[2] = a02 * b00 + a12 * b01 + a22 * b02; - this.mat4[3] = a03 * b00 + a13 * b01 + a23 * b02; - this.mat4[4] = a00 * b10 + a10 * b11 + a20 * b12; - this.mat4[5] = a01 * b10 + a11 * b11 + a21 * b12; - this.mat4[6] = a02 * b10 + a12 * b11 + a22 * b12; - this.mat4[7] = a03 * b10 + a13 * b11 + a23 * b12; - this.mat4[8] = a00 * b20 + a10 * b21 + a20 * b22; - this.mat4[9] = a01 * b20 + a11 * b21 + a21 * b22; - this.mat4[10] = a02 * b20 + a12 * b21 + a22 * b22; - this.mat4[11] = a03 * b20 + a13 * b21 + a23 * b22; - return this; - } /** - * @todo finish implementing this method! - * translates - * @method translate - * @param {Number[]} v vector to translate by - * @chainable - */ - - }, - { - key: 'translate', - value: function translate(v) { - var x = v[0], - y = v[1], - z = v[2] || 0; - this.mat4[12] += this.mat4[0] * x + this.mat4[4] * y + this.mat4[8] * z; - this.mat4[13] += this.mat4[1] * x + this.mat4[5] * y + this.mat4[9] * z; - this.mat4[14] += this.mat4[2] * x + this.mat4[6] * y + this.mat4[10] * z; - this.mat4[15] += this.mat4[3] * x + this.mat4[7] * y + this.mat4[11] * z; - } - }, - { - key: 'rotateX', - value: function rotateX(a) { - this.rotate(a, 1, 0, 0); - } - }, - { - key: 'rotateY', - value: function rotateY(a) { - this.rotate(a, 0, 1, 0); + var Promise$1 = (function () { + function Promise(resolver) { + this[PROMISE_ID] = nextId(); + this._result = this._state = undefined; + this._subscribers = []; + if (noop !== resolver) { + typeof resolver !== "function" && needsResolver(); + this instanceof Promise + ? initializePromise(this, resolver) + : needsNew(); + } + } /** + The primary way of interacting with a promise is through its `then` method, + which registers callbacks to receive either a promise's eventual value or the + reason why the promise cannot be fulfilled. + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + Chaining + -------- + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + Assimilation + ------------ + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + If the assimliated promise rejects, then the downstream promise will also reject. + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + Simple Example + -------------- + Synchronous Example + ```javascript + let result; + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + Errback Example + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + Promise Example; + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + Advanced Example + -------------- + Synchronous Example + ```javascript + let author, books; + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + Errback Example + ```js + function foundBooks(books) { + } + function failure(reason) { + } + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); } - }, - { - key: 'rotateZ', - value: function rotateZ(a) { - this.rotate(a, 0, 0, 1); - } /** - * sets the perspective matrix - * @method perspective - * @param {Number} fovy [description] - * @param {Number} aspect [description] - * @param {Number} near near clipping plane - * @param {Number} far far clipping plane - * @chainable - */ - - }, - { - key: 'perspective', - value: function perspective(fovy, aspect, near, far) { - var f = 1 / Math.tan(fovy / 2), - nf = 1 / (near - far); - this.mat4[0] = f / aspect; - this.mat4[1] = 0; - this.mat4[2] = 0; - this.mat4[3] = 0; - this.mat4[4] = 0; - this.mat4[5] = f; - this.mat4[6] = 0; - this.mat4[7] = 0; - this.mat4[8] = 0; - this.mat4[9] = 0; - this.mat4[10] = (far + near) * nf; - this.mat4[11] = - 1; - this.mat4[12] = 0; - this.mat4[13] = 0; - this.mat4[14] = 2 * far * near * nf; - this.mat4[15] = 0; - return this; - } /** - * sets the ortho matrix - * @method ortho - * @param {Number} left [description] - * @param {Number} right [description] - * @param {Number} bottom [description] - * @param {Number} top [description] - * @param {Number} near near clipping plane - * @param {Number} far far clipping plane - * @chainable - */ - - }, - { - key: 'ortho', - value: function ortho(left, right, bottom, top, near, far) { - var lr = 1 / (left - right), - bt = 1 / (bottom - top), - nf = 1 / (near - far); - this.mat4[0] = - 2 * lr; - this.mat4[1] = 0; - this.mat4[2] = 0; - this.mat4[3] = 0; - this.mat4[4] = 0; - this.mat4[5] = - 2 * bt; - this.mat4[6] = 0; - this.mat4[7] = 0; - this.mat4[8] = 0; - this.mat4[9] = 0; - this.mat4[10] = 2 * nf; - this.mat4[11] = 0; - this.mat4[12] = (left + right) * lr; - this.mat4[13] = (top + bottom) * bt; - this.mat4[14] = (far + near) * nf; - this.mat4[15] = 1; - return this; - } /** - * apply a matrix to a vector with x,y,z,w components - * get the results in the form of an array - * @method multiplyVec4 - * @param {Number} - * @return {Number[]} - */ - - }, - { - key: 'multiplyVec4', - value: function multiplyVec4(x, y, z, w) { - var result = new Array(4); - var m = this.mat4; - result[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - result[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - result[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - result[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - return result; - } /** - * Applies a matrix to a vector. - * The fourth component is set to 1. - * Returns a vector consisting of the first - * through third components of the result. - * - * @method multiplyPoint - * @param {p5.Vector} - * @return {p5.Vector} - */ - - }, - { - key: 'multiplyPoint', - value: function multiplyPoint(_ref4) { - var x = _ref4.x, - y = _ref4.y, - z = _ref4.z; - var array = this.multiplyVec4(x, y, z, 1); - return new _main.default.Vector(array[0], array[1], array[2]); - } /** - * Applies a matrix to a vector. - * The fourth component is set to 1. - * Returns the result of dividing the 1st to 3rd components - * of the result by the 4th component as a vector. - * - * @method multiplyAndNormalizePoint - * @param {p5.Vector} - * @return {p5.Vector} - */ - - }, - { - key: 'multiplyAndNormalizePoint', - value: function multiplyAndNormalizePoint(_ref5) { - var x = _ref5.x, - y = _ref5.y, - z = _ref5.z; - var array = this.multiplyVec4(x, y, z, 1); - array[0] /= array[3]; - array[1] /= array[3]; - array[2] /= array[3]; - return new _main.default.Vector(array[0], array[1], array[2]); - } /** - * Applies a matrix to a vector. - * The fourth component is set to 0. - * Returns a vector consisting of the first - * through third components of the result. - * - * @method multiplyDirection - * @param {p5.Vector} - * @return {p5.Vector} - */ - - }, - { - key: 'multiplyDirection', - value: function multiplyDirection(_ref6) { - var x = _ref6.x, - y = _ref6.y, - z = _ref6.z; - var array = this.multiplyVec4(x, y, z, 0); - return new _main.default.Vector(array[0], array[1], array[2]); - } /** - * This function is only for 3x3 matrices. - * multiply two mat3s. It is an operation to multiply the 3x3 matrix of - * the argument from the right. Arguments can be a 3x3 p5.Matrix, - * a Float32Array of length 9, or a javascript array of length 9. - * In addition, it can also be done by enumerating 9 numbers. - * - * @method mult3x3 - * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix - * we want to multiply by - * @chainable - */ - - }, - { - key: 'mult3x3', - value: function mult3x3(multMatrix) { - var _src; - if (multMatrix === this || multMatrix === this.mat3) { - _src = this.copy().mat3; // only need to allocate in this rare case - } else if (multMatrix instanceof _main.default.Matrix) { - _src = multMatrix.mat3; - } else if (isMatrixArray(multMatrix)) { - _src = multMatrix; - } else if (arguments.length === 9) { - _src = arguments; - } else { - return; // nothing to do. - } // each row is used for the multiplier - - var b0 = this.mat3[0]; - var b1 = this.mat3[1]; - var b2 = this.mat3[2]; - this.mat3[0] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; - this.mat3[1] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; - this.mat3[2] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; - b0 = this.mat3[3]; - b1 = this.mat3[4]; - b2 = this.mat3[5]; - this.mat3[3] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; - this.mat3[4] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; - this.mat3[5] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; - b0 = this.mat3[6]; - b1 = this.mat3[7]; - b2 = this.mat3[8]; - this.mat3[6] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; - this.mat3[7] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; - this.mat3[8] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; - return this; - } /** - * This function is only for 3x3 matrices. - * A function that returns a column vector of a 3x3 matrix. - * - * @method column - * @param {Number} columnIndex matrix column number - * @return {p5.Vector} - */ - - }, - { - key: 'column', - value: function column(columnIndex) { - return new _main.default.Vector(this.mat3[3 * columnIndex], this.mat3[3 * columnIndex + 1], this.mat3[3 * columnIndex + 2]); - } /** - * This function is only for 3x3 matrices. - * A function that returns a row vector of a 3x3 matrix. - * - * @method row - * @param {Number} rowIndex matrix row number - * @return {p5.Vector} - */ - - }, - { - key: 'row', - value: function row(rowIndex) { - return new _main.default.Vector(this.mat3[rowIndex], this.mat3[rowIndex + 3], this.mat3[rowIndex + 6]); - } /** - * Returns the diagonal elements of the matrix in the form of an array. - * A 3x3 matrix will return an array of length 3. - * A 4x4 matrix will return an array of length 4. - * - * @method diagonal - * @return {Number[]} An array obtained by arranging the diagonal elements - * of the matrix in ascending order of index - */ - - }, - { - key: 'diagonal', - value: function diagonal() { - if (this.mat3 !== undefined) { - return [this.mat3[0], - this.mat3[4], - this.mat3[8]]; - } - return [this.mat4[0], - this.mat4[5], - this.mat4[10], - this.mat4[15]]; - } /** - * This function is only for 3x3 matrices. - * Takes a vector and returns the vector resulting from multiplying to - * that vector by this matrix from left. - * - * @method multiplyVec3 - * @param {p5.Vector} multVector the vector to which this matrix applies - * @param {p5.Vector} [target] The vector to receive the result - * @return {p5.Vector} - */ - - }, - { - key: 'multiplyVec3', - value: function multiplyVec3(multVector, target) { - if (target === undefined) { - target = multVector.copy(); - } - target.x = this.row(0).dot(multVector); - target.y = this.row(1).dot(multVector); - target.z = this.row(2).dot(multVector); - return target; - } /** - * This function is only for 4x4 matrices. - * Creates a 3x3 matrix whose entries are the top left 3x3 part and returns it. - * - * @method createSubMatrix3x3 - * @return {p5.Matrix} + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + Promise Example; + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} */ - - }, - { - key: 'createSubMatrix3x3', - value: function createSubMatrix3x3() { - var result = new _main.default.Matrix('mat3'); - result.mat3[0] = this.mat4[0]; - result.mat3[1] = this.mat4[1]; - result.mat3[2] = this.mat4[2]; - result.mat3[3] = this.mat4[4]; - result.mat3[4] = this.mat4[5]; - result.mat3[5] = this.mat4[6]; - result.mat3[6] = this.mat4[8]; - result.mat3[7] = this.mat4[9]; - result.mat3[8] = this.mat4[10]; - return result; - } /** - * PRIVATE + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} */ - // matrix methods adapted from: - // https://developer.mozilla.org/en-US/docs/Web/WebGL/ - // gluPerspective - // - // function _makePerspective(fovy, aspect, znear, zfar){ - // const ymax = znear * Math.tan(fovy * Math.PI / 360.0); - // const ymin = -ymax; - // const xmin = ymin * aspect; - // const xmax = ymax * aspect; - // return _makeFrustum(xmin, xmax, ymin, ymax, znear, zfar); - // } - //// - //// glFrustum - //// - //function _makeFrustum(left, right, bottom, top, znear, zfar){ - // const X = 2*znear/(right-left); - // const Y = 2*znear/(top-bottom); - // const A = (right+left)/(right-left); - // const B = (top+bottom)/(top-bottom); - // const C = -(zfar+znear)/(zfar-znear); - // const D = -2*zfar*znear/(zfar-znear); - // const frustrumMatrix =[ - // X, 0, A, 0, - // 0, Y, B, 0, - // 0, 0, C, D, - // 0, 0, -1, 0 - //]; - //return frustrumMatrix; - // } - // function _setMVPMatrices(){ - ////an identity matrix - ////@TODO use the p5.Matrix class to abstract away our MV matrices and - ///other math - //const _mvMatrix = - //[ - // 1.0,0.0,0.0,0.0, - // 0.0,1.0,0.0,0.0, - // 0.0,0.0,1.0,0.0, - // 0.0,0.0,0.0,1.0 - //]; - } - ], [ - { - key: 'identity', - value: function identity(pInst) { - return new _main.default.Matrix(pInst); - } - } - ]); - return _class; - }(); - var _default = _main.default.Matrix; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.float32-array': 229, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249 - } - ], - 352: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.map'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; + Promise.prototype.catch = function _catch(onRejection) { + return this.then(null, onRejection); + }; + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); } - _main.default.RenderBuffer = /*#__PURE__*/ function () { - function _class(size, src, dst, attr, renderer, map) { - _classCallCheck(this, _class); - this.size = size; // the number of FLOATs in each vertex - this.src = src; // the name of the model's source array - this.dst = dst; // the name of the geometry's buffer - this.attr = attr; // the name of the vertex attribute - this._renderer = renderer; - this.map = map; // optional, a transformation function to apply to src - } /** - * Enables and binds the buffers used by shader when the appropriate data exists in geometry. - * Must always be done prior to drawing geometry in WebGL. - * @param {p5.Geometry} geometry Geometry that is going to be drawn - * @param {p5.Shader} shader Active shader - * @private - */ - - _createClass(_class, [ - { - key: '_prepareBuffer', - value: function _prepareBuffer(geometry, shader) { - var attributes = shader.attributes; - var gl = this._renderer.GL; - var model; - if (geometry.model) { - model = geometry.model; - } else { - model = geometry; - } // loop through each of the buffer definitions - - var attr = attributes[this.attr]; - if (!attr) { - return; - } // check if the model has the appropriate source array - - var buffer = geometry[this.dst]; - var src = model[this.src]; - if (src.length > 0) { - // check if we need to create the GL buffer - var createBuffer = !buffer; - if (createBuffer) { - // create and remember the buffer - geometry[this.dst] = buffer = gl.createBuffer(); - } // bind the buffer - - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - // check if we need to fill the buffer with data - if (createBuffer || model.dirtyFlags[this.src] !== false) { - var map = this.map; - // get the values from the model, possibly transformed - var values = map ? map(src) : src; - // fill the buffer with the values - this._renderer._bindBuffer(buffer, gl.ARRAY_BUFFER, values); - // mark the model's source array as clean - model.dirtyFlags[this.src] = false; - } // enable the attribute - - shader.enableAttrib(attr, this.size); - } else { - var loc = attr.location; - if (loc === - 1 || !this._renderer.registerEnabled.has(loc)) { - return; - } // Disable register corresponding to unused attribute - - gl.disableVertexAttribArray(loc); - // Record register availability - this._renderer.registerEnabled.delete(loc); - } - } - } - ]); - return _class; - }(); - var _default = _main.default.RenderBuffer; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.map': 182 + return new Author(); } - ], - 353: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.find-index'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.find-index'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.map'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - _dereq_('./p5.RenderBuffer'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * Welcome to RendererGL Immediate Mode. - * Immediate mode is used for drawing custom shapes - * from a set of vertices. Immediate Mode is activated - * when you call beginShape() & de-activated when you call endShape(). - * Immediate mode is a style of programming borrowed - * from OpenGL's (now-deprecated) immediate mode. - * It differs from p5.js' default, Retained Mode, which caches - * geometries and buffers on the CPU to reduce the number of webgl - * draw calls. Retained mode is more efficient & performative, - * however, Immediate Mode is useful for sketching quick - * geometric ideas. - */ - /** - * Begin shape drawing. This is a helpful way of generating - * custom shapes quickly. However in WEBGL mode, application - * performance will likely drop as a result of too many calls to - * beginShape() / endShape(). As a high performance alternative, - * please use p5.js geometry primitives. - * @private - * @method beginShape - * @param {Number} mode webgl primitives mode. beginShape supports the - * following modes: - * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, - * TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP, - * and TESS(WEBGL only) - * @chainable - */ - - _main.default.RendererGL.prototype.beginShape = function (mode) { - this.immediateMode.shapeMode = mode !== undefined ? mode : constants.TESS; - this.immediateMode.geometry.reset(); - this.immediateMode.contourIndices = [ - ]; - return this; - }; - var immediateBufferStrides = { - vertices: 1, - vertexNormals: 1, - vertexColors: 4, - vertexStrokeColors: 4, - uvs: 2 - }; - _main.default.RendererGL.prototype.beginContour = function () { - if (this.immediateMode.shapeMode !== constants.TESS) { - throw new Error('WebGL mode can only use contours with beginShape(TESS).'); - } - this.immediateMode.contourIndices.push(this.immediateMode.geometry.vertices.length); - }; - /** - * adds a vertex to be drawn in a custom Shape. - * @private - * @method vertex - * @param {Number} x x-coordinate of vertex - * @param {Number} y y-coordinate of vertex - * @param {Number} z z-coordinate of vertex - * @chainable - * @TODO implement handling of p5.Vector args - */ - _main.default.RendererGL.prototype.vertex = function (x, y) { - // WebGL 1 doesn't support QUADS or QUAD_STRIP, so we duplicate data to turn - // QUADS into TRIANGLES and QUAD_STRIP into TRIANGLE_STRIP. (There is no extra - // work to convert QUAD_STRIP here, since the only difference is in how edges - // are rendered.) - if (this.immediateMode.shapeMode === constants.QUADS) { - // A finished quad turned into triangles should leave 6 vertices in the - // buffer: - // 0--3 0 3--5 - // | | --> | \ \ | - // 1--2 1--2 4 - // When vertex index 3 is being added, add the necessary duplicates. - if (this.immediateMode.geometry.vertices.length % 6 === 3) { - for (var key in immediateBufferStrides) { - var stride = immediateBufferStrides[key]; - var buffer = this.immediateMode.geometry[key]; - buffer.push.apply(buffer, _toConsumableArray(buffer.slice(buffer.length - 3 * stride, buffer.length - 2 * stride)).concat(_toConsumableArray(buffer.slice(buffer.length - stride, buffer.length)))); - } - } - } - var z, - u, - v; - // default to (x, y) mode: all other arguments assumed to be 0. - z = u = v = 0; - if (arguments.length === 3) { - // (x, y, z) mode: (u, v) assumed to be 0. - z = arguments[2]; - } else if (arguments.length === 4) { - // (x, y, u, v) mode: z assumed to be 0. - u = arguments[2]; - v = arguments[3]; - } else if (arguments.length === 5) { - // (x, y, z, u, v) mode - z = arguments[2]; - u = arguments[3]; - v = arguments[4]; - } - var vert = new _main.default.Vector(x, y, z); - this.immediateMode.geometry.vertices.push(vert); - this.immediateMode.geometry.vertexNormals.push(this._currentNormal); - var vertexColor = this.curFillColor || [ - 0.5, - 0.5, - 0.5, - 1 - ]; - this.immediateMode.geometry.vertexColors.push(vertexColor[0], vertexColor[1], vertexColor[2], vertexColor[3]); - var lineVertexColor = this.curStrokeColor || [ - 0.5, - 0.5, - 0.5, - 1 - ]; - this.immediateMode.geometry.vertexStrokeColors.push(lineVertexColor[0], lineVertexColor[1], lineVertexColor[2], lineVertexColor[3]); - if (this.textureMode === constants.IMAGE && !this.isProcessingVertices) { - if (this._tex !== null) { - if (this._tex.width > 0 && this._tex.height > 0) { - u /= this._tex.width; - v /= this._tex.height; - } - } else if (this.userFillShader !== undefined || this.userStrokeShader !== undefined || this.userPointShader !== undefined) { - // Do nothing if user-defined shaders are present - } else if (this._tex === null && arguments.length >= 4) { - // Only throw this warning if custom uv's have been provided - console.warn('You must first call texture() before using' + ' vertex() with image based u and v coordinates'); - } - } - this.immediateMode.geometry.uvs.push(u, v); - this.immediateMode._bezierVertex[0] = x; - this.immediateMode._bezierVertex[1] = y; - this.immediateMode._bezierVertex[2] = z; - this.immediateMode._quadraticVertex[0] = x; - this.immediateMode._quadraticVertex[1] = y; - this.immediateMode._quadraticVertex[2] = z; - return this; - }; - /** - * Sets the normal to use for subsequent vertices. - * @method vertexNormal - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @chainable - * - * @method vertexNormal - * @param {Vector} v - * @chainable - */ - _main.default.RendererGL.prototype.normal = function (xorv, y, z) { - if (xorv instanceof _main.default.Vector) { - this._currentNormal = xorv; - } else { - this._currentNormal = new _main.default.Vector(xorv, y, z); - } - return this; - }; - /** - * End shape drawing and render vertices to screen. - * @chainable - */ - _main.default.RendererGL.prototype.endShape = function (mode, isCurve, isBezier, isQuadratic, isContour, shapeKind) { - var count = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1; - if (this.immediateMode.shapeMode === constants.POINTS) { - this._drawPoints(this.immediateMode.geometry.vertices, this.immediateMode.buffers.point); - return this; - } // When we are drawing a shape then the shape mode is TESS, - // but in case of triangle we can skip the breaking into small triangle - // this can optimize performance by skipping the step of breaking it into triangles - - if (this.immediateMode.geometry.vertices.length === 3 && this.immediateMode.shapeMode === constants.TESS) { - this.immediateMode.shapeMode === constants.TRIANGLES; - } - this.isProcessingVertices = true; - this._processVertices.apply(this, arguments); - this.isProcessingVertices = false; - // LINE_STRIP and LINES are not used for rendering, instead - // they only indicate a way to modify vertices during the _processVertices() step - if (this.immediateMode.shapeMode === constants.LINE_STRIP || this.immediateMode.shapeMode === constants.LINES) { - this.immediateMode.shapeMode = constants.TRIANGLE_FAN; - } // WebGL doesn't support the QUADS and QUAD_STRIP modes, so we - // need to convert them to a supported format. In `vertex()`, we reformat - // the input data into the formats specified below. - - if (this.immediateMode.shapeMode === constants.QUADS) { - this.immediateMode.shapeMode = constants.TRIANGLES; - } else if (this.immediateMode.shapeMode === constants.QUAD_STRIP) { - this.immediateMode.shapeMode = constants.TRIANGLE_STRIP; - } - if (this._doFill) { - if (!this.geometryBuilder && this.immediateMode.geometry.vertices.length >= 3) { - this._drawImmediateFill(count); - } - } - if (this._doStroke) { - if (!this.geometryBuilder && this.immediateMode.geometry.lineVertices.length >= 1) { - this._drawImmediateStroke(); - } - } - if (this.geometryBuilder) { - this.geometryBuilder.addImmediate(); - } - this.isBezier = false; - this.isQuadratic = false; - this.isCurve = false; - this.immediateMode._bezierVertex.length = 0; - this.immediateMode._quadraticVertex.length = 0; - this.immediateMode._curveVertex.length = 0; - return this; - }; - /** - * Called from endShape(). This function calculates the stroke vertices for custom shapes and - * tesselates shapes when applicable. - * @private - * @param {Number} mode webgl primitives mode. beginShape supports the - * following modes: - * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, - * TRIANGLE_STRIP, TRIANGLE_FAN and TESS(WEBGL only) - */ - _main.default.RendererGL.prototype._processVertices = function (mode) { - if (this.immediateMode.geometry.vertices.length === 0) return; - var calculateStroke = this._doStroke; - var shouldClose = mode === constants.CLOSE; - if (calculateStroke) { - this.immediateMode.geometry.edges = this._calculateEdges(this.immediateMode.shapeMode, this.immediateMode.geometry.vertices, shouldClose); - if (!this.geometryBuilder) { - this.immediateMode.geometry._edgesToVertices(); - } - } // For hollow shapes, user must set mode to TESS - - var convexShape = this.immediateMode.shapeMode === constants.TESS; - // If the shape has a contour, we have to re-triangulate to cut out the - // contour region - var hasContour = this.immediateMode.contourIndices.length > 0; - // We tesselate when drawing curves or convex shapes - var shouldTess = this._doFill && (this.isBezier || this.isQuadratic || this.isCurve || convexShape || hasContour) && this.immediateMode.shapeMode !== constants.LINES; - if (shouldTess) { - this._tesselateShape(); - } - }; - /** - * Called from _processVertices(). This function calculates the stroke vertices for custom shapes and - * tesselates shapes when applicable. - * @private - * @returns {Array[Number]} indices for custom shape vertices indicating edges. - */ - _main.default.RendererGL.prototype._calculateEdges = function (shapeMode, verts, shouldClose) { - var res = [ - ]; - var i = 0; - var contourIndices = this.immediateMode.contourIndices.slice(); - var contourStart = 0; - switch (shapeMode) { - case constants.TRIANGLE_STRIP: - for (i = 0; i < verts.length - 2; i++) { - res.push([i, - i + 1]); - res.push([i, - i + 2]); - } - res.push([i, - i + 1]); - break; - case constants.TRIANGLE_FAN: - for (i = 1; i < verts.length - 1; i++) { - res.push([0, - i]); - res.push([i, - i + 1]); - } - res.push([0, - verts.length - 1]); - break; - case constants.TRIANGLES: - for (i = 0; i < verts.length - 2; i = i + 3) { - res.push([i, - i + 1]); - res.push([i + 1, - i + 2]); - res.push([i + 2, - i]); - } - break; - case constants.LINES: - for (i = 0; i < verts.length - 1; i = i + 2) { - res.push([i, - i + 1]); - } - break; - case constants.QUADS: - // Quads have been broken up into two triangles by `vertex()`: - // 0 3--5 - // | \ \ | - // 1--2 4 - for (i = 0; i < verts.length - 5; i += 6) { - res.push([i, - i + 1]); - res.push([i + 1, - i + 2]); - res.push([i + 3, - i + 5]); - res.push([i + 4, - i + 5]); - } - break; - case constants.QUAD_STRIP: - // 0---2---4 - // | | | - // 1---3---5 - for (i = 0; i < verts.length - 2; i += 2) { - res.push([i, - i + 1]); - res.push([i, - i + 2]); - res.push([i + 1, - i + 3]); - } - res.push([i, - i + 1]); - break; - default: - // TODO: handle contours in other modes too - for (i = 0; i < verts.length; i++) { - // Handle breaks between contours - if (i + 1 < verts.length && i + 1 !== contourIndices[0]) { - res.push([i, - i + 1]); - } else { - if (shouldClose || contourStart) { - res.push([i, - contourStart]); - } - if (contourIndices.length > 0) { - contourStart = contourIndices.shift(); - } - } - } - break; - } - if (shapeMode !== constants.TESS && shouldClose) { - res.push([verts.length - 1, - 0]); - } - return res; - }; - /** - * Called from _processVertices() when applicable. This function tesselates immediateMode.geometry. - * @private - */ - _main.default.RendererGL.prototype._tesselateShape = function () { - var _this = this; - // TODO: handle non-TESS shape modes that have contours - this.immediateMode.shapeMode = constants.TRIANGLES; - var contours = [ - [] - ]; - for (var i = 0; i < this.immediateMode.geometry.vertices.length; i++) { - if (this.immediateMode.contourIndices.length > 0 && this.immediateMode.contourIndices[0] === i) { - this.immediateMode.contourIndices.shift(); - contours.push([]); - } - contours[contours.length - 1].push(this.immediateMode.geometry.vertices[i].x, this.immediateMode.geometry.vertices[i].y, this.immediateMode.geometry.vertices[i].z, this.immediateMode.geometry.uvs[i * 2], this.immediateMode.geometry.uvs[i * 2 + 1], this.immediateMode.geometry.vertexColors[i * 4], this.immediateMode.geometry.vertexColors[i * 4 + 1], this.immediateMode.geometry.vertexColors[i * 4 + 2], this.immediateMode.geometry.vertexColors[i * 4 + 3], this.immediateMode.geometry.vertexNormals[i].x, this.immediateMode.geometry.vertexNormals[i].y, this.immediateMode.geometry.vertexNormals[i].z); - } - var polyTriangles = this._triangulate(contours); - var originalVertices = this.immediateMode.geometry.vertices; - this.immediateMode.geometry.vertices = [ - ]; - this.immediateMode.geometry.vertexNormals = [ - ]; - this.immediateMode.geometry.uvs = [ - ]; - var colors = [ - ]; - for (var j = 0, polyTriLength = polyTriangles.length; j < polyTriLength; j = j + _main.default.RendererGL.prototype.tessyVertexSize) { - colors.push.apply(colors, _toConsumableArray(polyTriangles.slice(j + 5, j + 9))); - this.normal.apply(this, _toConsumableArray(polyTriangles.slice(j + 9, j + 12))); - this.vertex.apply(this, _toConsumableArray(polyTriangles.slice(j, j + 5))); - } - if (this.geometryBuilder) { - // Tesselating the face causes the indices of edge vertices to stop being - // correct. When rendering, this is not a problem, since _edgesToVertices - // will have been called before this, and edge vertex indices are no longer - // needed. However, the geometry builder still needs this information, so - // when one is active, we need to update the indices. - // - // We record index mappings in a Map so that once we have found a - // corresponding vertex, we don't need to loop to find it again. - var newIndex = new Map(); - this.immediateMode.geometry.edges = this.immediateMode.geometry.edges.map(function (edge) { - return edge.map(function (origIdx) { - if (!newIndex.has(origIdx)) { - var orig = originalVertices[origIdx]; - var newVertIndex = _this.immediateMode.geometry.vertices.findIndex(function (v) { - return orig.x === v.x && orig.y === v.y && orig.z === v.z; - }); - if (newVertIndex === - 1) { - // The tesselation process didn't output a vertex with the exact - // coordinate as before, potentially due to numerical issues. This - // doesn't happen often, but in this case, pick the closest point - var closestDist = Infinity; - var closestIndex = 0; - for (var _i = 0; _i < _this.immediateMode.geometry.vertices.length; _i++) { - var vert = _this.immediateMode.geometry.vertices[_i]; - var dX = orig.x - vert.x; - var dY = orig.y - vert.y; - var dZ = orig.z - vert.z; - var dist = dX * dX + dY * dY + dZ * dZ; - if (dist < closestDist) { - closestDist = dist; - closestIndex = _i; - } - } - newVertIndex = closestIndex; - } - newIndex.set(origIdx, newVertIndex); - } - return newIndex.get(origIdx); - }); - }); - } - this.immediateMode.geometry.vertexColors = colors; - }; - /** - * Called from endShape(). Responsible for calculating normals, setting shader uniforms, - * enabling all appropriate buffers, applying color blend, and drawing the fill geometry. - * @private - */ - _main.default.RendererGL.prototype._drawImmediateFill = function () { - var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; - var gl = this.GL; - this._useVertexColor = this.immediateMode.geometry.vertexColors.length > 0; - var shader; - shader = this._getImmediateFillShader(); - this._setFillUniforms(shader); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this.immediateMode.buffers.fill[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var buff = _step.value; - buff._prepareBuffer(this.immediateMode.geometry, shader); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - shader.disableRemainingAttributes(); - this._applyColorBlend(this.curFillColor); - if (count === 1) { - gl.drawArrays(this.immediateMode.shapeMode, 0, this.immediateMode.geometry.vertices.length); - } else { - try { - gl.drawArraysInstanced(this.immediateMode.shapeMode, 0, this.immediateMode.geometry.vertices.length, count); - } catch (e) { - console.log('🌸 p5.js says: Instancing is only supported in WebGL2 mode'); - } - } - shader.unbindShader(); - }; - /** - * Called from endShape(). Responsible for calculating normals, setting shader uniforms, - * enabling all appropriate buffers, applying color blend, and drawing the stroke geometry. - * @private - */ - _main.default.RendererGL.prototype._drawImmediateStroke = function () { - var gl = this.GL; - this._useLineColor = this.immediateMode.geometry.vertexStrokeColors.length > 0; - var shader = this._getImmediateStrokeShader(); - this._setStrokeUniforms(shader); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = this.immediateMode.buffers.stroke[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var buff = _step2.value; - buff._prepareBuffer(this.immediateMode.geometry, shader); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - shader.disableRemainingAttributes(); - this._applyColorBlend(this.curStrokeColor); - gl.drawArrays(gl.TRIANGLES, 0, this.immediateMode.geometry.lineVertices.length / 3); - shader.unbindShader(); - }; - var _default = _main.default.RendererGL; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.RenderBuffer': 352, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.find-index': 174, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.map': 182, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.map': 187, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value } - ], - 354: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.uint16-array'); - _dereq_('core-js/modules/es.typed-array.uint32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.uint16-array'); - _dereq_('core-js/modules/es.typed-array.uint32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - _dereq_('./p5.RendererGL'); - _dereq_('./p5.RenderBuffer'); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } //Retained Mode. The default mode for rendering 3D primitives - //in WEBGL. - /** - * @param {p5.Geometry} geometry The model whose resources will be freed - */ + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @return {Promise} + */ + Promise.prototype.finally = function _finally(callback) { + var promise = this; + var constructor = promise.constructor; + if (isFunction(callback)) { + return promise.then( + function (value) { + return constructor + .resolve(callback()) + .then(function () { + return value; + }); + }, + function (reason) { + return constructor + .resolve(callback()) + .then(function () { + throw reason; + }); + }, + ); + } + return promise.then(callback, callback); + }; + return Promise; + })(); + Promise$1.prototype.then = then; + Promise$1.all = all; + Promise$1.race = race; + Promise$1.resolve = resolve$1; + Promise$1.reject = reject$1; + Promise$1._setScheduler = setScheduler; + Promise$1._setAsap = setAsap; + Promise$1._asap = asap; + /*global self*/ + function polyfill() { + var local = void 0; + if (typeof global !== "undefined") { + local = global; + } else if (typeof self !== "undefined") { + local = self; + } else { + try { + local = Function("return this")(); + } catch (e) { + throw new Error( + "polyfill failed because global object is unavailable in this environment", + ); + } + } + var P = local.Promise; + if (P) { + var promiseToString = null; + try { + promiseToString = Object.prototype.toString.call( + P.resolve(), + ); + } catch (e) { + // silently ignored + } + if (promiseToString === "[object Promise]" && !P.cast) { + return; + } + } + local.Promise = Promise$1; + } // Strange compat.. + + Promise$1.polyfill = polyfill; + Promise$1.Promise = Promise$1; + return Promise$1; + }); + }).call( + this, + _dereq_("_process"), + typeof global !== "undefined" + ? global + : typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : {}, + ); + }, + { + _process: 273, + }, + ], + 261: [ + function (_dereq_, module, exports) { + (function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "module"], factory); + } else if ( + typeof exports !== "undefined" && + typeof module !== "undefined" + ) { + factory(exports, module); + } else { + var mod = { + exports: {}, + }; + factory(mod.exports, mod); + global.fetchJsonp = mod.exports; + } + })(this, function (exports, module) { + "use strict"; + var defaultOptions = { + timeout: 5000, + jsonpCallback: "callback", + jsonpCallbackFunction: null, + }; + function generateCallbackFunction() { + return ( + "jsonp_" + Date.now() + "_" + Math.ceil(Math.random() * 100000) + ); + } + function clearFunction(functionName) { + // IE8 throws an exception when you try to delete a property on window + // http://stackoverflow.com/a/1824228/751089 + try { + delete window[functionName]; + } catch (e) { + window[functionName] = undefined; + } + } + function removeScript(scriptId) { + var script = document.getElementById(scriptId); + if (script) { + document.getElementsByTagName("head")[0].removeChild(script); + } + } + function fetchJsonp(_url) { + var options = + arguments.length <= 1 || arguments[1] === undefined + ? {} + : arguments[1]; + // to avoid param reassign + var url = _url; + var timeout = options.timeout || defaultOptions.timeout; + var jsonpCallback = + options.jsonpCallback || defaultOptions.jsonpCallback; + var timeoutId = undefined; + return new Promise(function (resolve, reject) { + var callbackFunction = + options.jsonpCallbackFunction || generateCallbackFunction(); + var scriptId = jsonpCallback + "_" + callbackFunction; + window[callbackFunction] = function (response) { + resolve({ + ok: true, + // keep consistent with fetch API + json: function json() { + return Promise.resolve(response); + }, + }); + if (timeoutId) clearTimeout(timeoutId); + removeScript(scriptId); + clearFunction(callbackFunction); + }; + // Check if the user set their own params, and if not add a ? to start a list of params + url += url.indexOf("?") === -1 ? "?" : "&"; + var jsonpScript = document.createElement("script"); + jsonpScript.setAttribute( + "src", + "" + url + jsonpCallback + "=" + callbackFunction, + ); + if (options.charset) { + jsonpScript.setAttribute("charset", options.charset); + } + jsonpScript.id = scriptId; + document + .getElementsByTagName("head")[0] + .appendChild(jsonpScript); + timeoutId = setTimeout(function () { + reject(new Error("JSONP request to " + _url + " timed out")); + clearFunction(callbackFunction); + removeScript(scriptId); + window[callbackFunction] = function () { + clearFunction(callbackFunction); + }; + }, timeout); + // Caught if got 404/500 + jsonpScript.onerror = function () { + reject(new Error("JSONP request to " + _url + " failed")); + clearFunction(callbackFunction); + removeScript(scriptId); + if (timeoutId) clearTimeout(timeoutId); + }; + }); + } // export as global function + /* + let local; + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + local.fetchJsonp = fetchJsonp; + */ - _main.default.RendererGL.prototype.freeGeometry = function (geometry) { - if (!geometry.gid) { - console.warn('The model you passed to freeGeometry does not have an id!'); - return; - } - this._freeBuffers(geometry.gid); - }; - /** - * _initBufferDefaults - * @private - * @description initializes buffer defaults. runs each time a new geometry is - * registered - * @param {String} gId key of the geometry object - * @returns {Object} a new buffer object - */ - _main.default.RendererGL.prototype._initBufferDefaults = function (gId) { - this._freeBuffers(gId); - //@TODO remove this limit on hashes in retainedMode.geometry - if (Object.keys(this.retainedMode.geometry).length > 1000) { - var key = Object.keys(this.retainedMode.geometry) [0]; - this._freeBuffers(key); - } //create a new entry in our retainedMode.geometry - - return this.retainedMode.geometry[gId] = { - }; - }; - _main.default.RendererGL.prototype._freeBuffers = function (gId) { - var buffers = this.retainedMode.geometry[gId]; - if (!buffers) { - return; - } - delete this.retainedMode.geometry[gId]; - var gl = this.GL; - if (buffers.indexBuffer) { - gl.deleteBuffer(buffers.indexBuffer); - } - function freeBuffers(defs) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = defs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var def = _step.value; - if (buffers[def.dst]) { - gl.deleteBuffer(buffers[def.dst]); - buffers[def.dst] = null; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } // free all the buffers + module.exports = fetchJsonp; + }); + }, + {}, + ], + 262: [ + function (_dereq_, module, exports) { + /* FileSaver.js + * A saveAs() FileSaver implementation. + * 1.3.2 + * 2016-06-16 18:25:19 + * + * By Eli Grey, http://eligrey.com + * License: MIT + * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md + */ + /*global self */ + /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ + /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ + var saveAs = + saveAs || + (function (view) { + "use strict"; + // IE <10 is explicitly unsupported + if ( + typeof view === "undefined" || + (typeof navigator !== "undefined" && + /MSIE [1-9]\./.test(navigator.userAgent)) + ) { + return; + } + var doc = view.document, // only get URL when necessary in case Blob.js hasn't overridden it yet + get_URL = function () { + return view.URL || view.webkitURL || view; + }, + save_link = doc.createElementNS( + "http://www.w3.org/1999/xhtml", + "a", + ), + can_use_save_link = "download" in save_link, + click = function (node) { + var event = new MouseEvent("click"); + node.dispatchEvent(event); + }, + is_safari = + /constructor/i.test(view.HTMLElement) || view.safari, + is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent), + throw_outside = function (ex) { + (view.setImmediate || view.setTimeout)(function () { + throw ex; + }, 0); + }, + force_saveable_type = "application/octet-stream", // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to + arbitrary_revoke_timeout = 1000 * 40, // in ms + revoke = function (file) { + var revoker = function () { + if (typeof file === "string") { + // file is an object URL + get_URL().revokeObjectURL(file); + } else { + // file is a File + file.remove(); + } + }; + setTimeout(revoker, arbitrary_revoke_timeout); + }, + dispatch = function (filesaver, event_types, event) { + event_types = [].concat(event_types); + var i = event_types.length; + while (i--) { + var listener = filesaver["on" + event_types[i]]; + if (typeof listener === "function") { + try { + listener.call(filesaver, event || filesaver); + } catch (ex) { + throw_outside(ex); + } + } + } + }, + auto_bom = function (blob) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if ( + /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test( + blob.type, + ) + ) { + return new Blob([String.fromCharCode(65279), blob], { + type: blob.type, + }); + } + return blob; + }, + FileSaver = function (blob, name, no_auto_bom) { + if (!no_auto_bom) { + blob = auto_bom(blob); + } // First try a.download, then web filesystem, then object URLs + + var filesaver = this, + type = blob.type, + force = type === force_saveable_type, + object_url, + dispatch_all = function () { + dispatch( + filesaver, + "writestart progress write writeend".split(" "), + ); + }, // on any filesys errors revert to saving with object URLs + fs_error = function () { + if ( + (is_chrome_ios || (force && is_safari)) && + view.FileReader + ) { + // Safari doesn't allow downloading of blob urls + var reader = new FileReader(); + reader.onloadend = function () { + var url = is_chrome_ios + ? reader.result + : reader.result.replace( + /^data:[^;]*;/, + "data:attachment/file;", + ); + var popup = view.open(url, "_blank"); + if (!popup) view.location.href = url; + url = undefined; // release reference before dispatching + filesaver.readyState = filesaver.DONE; + dispatch_all(); + }; + reader.readAsDataURL(blob); + filesaver.readyState = filesaver.INIT; + return; + } // don't create more object URLs than needed + + if (!object_url) { + object_url = get_URL().createObjectURL(blob); + } + if (force) { + view.location.href = object_url; + } else { + var opened = view.open(object_url, "_blank"); + if (!opened) { + // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html + view.location.href = object_url; + } + } + filesaver.readyState = filesaver.DONE; + dispatch_all(); + revoke(object_url); + }; + filesaver.readyState = filesaver.INIT; + if (can_use_save_link) { + object_url = get_URL().createObjectURL(blob); + setTimeout(function () { + save_link.href = object_url; + save_link.download = name; + click(save_link); + dispatch_all(); + revoke(object_url); + filesaver.readyState = filesaver.DONE; + }); + return; + } + fs_error(); + }, + FS_proto = FileSaver.prototype, + saveAs = function (blob, name, no_auto_bom) { + return new FileSaver( + blob, + name || blob.name || "download", + no_auto_bom, + ); + }; + // IE 10+ (native saveAs) + if ( + typeof navigator !== "undefined" && + navigator.msSaveOrOpenBlob + ) { + return function (blob, name, no_auto_bom) { + name = name || blob.name || "download"; + if (!no_auto_bom) { + blob = auto_bom(blob); + } + return navigator.msSaveOrOpenBlob(blob, name); + }; + } + FS_proto.abort = function () {}; + FS_proto.readyState = FS_proto.INIT = 0; + FS_proto.WRITING = 1; + FS_proto.DONE = 2; + FS_proto.error = + FS_proto.onwritestart = + FS_proto.onprogress = + FS_proto.onwrite = + FS_proto.onabort = + FS_proto.onerror = + FS_proto.onwriteend = + null; + return saveAs; + })( + (typeof self !== "undefined" && self) || + (typeof window !== "undefined" && window) || + this.content, + ); + // `self` is undefined in Firefox for Android content script context + // while `this` is nsIContentFrameMessageManager + // with an attribute `content` that corresponds to the window + if (typeof module !== "undefined" && module.exports) { + module.exports.saveAs = saveAs; + } else if ( + typeof define !== "undefined" && + define !== null && + define.amd !== null + ) { + define("FileSaver.js", function () { + return saveAs; + }); + } + }, + {}, + ], + 263: [ + function (_dereq_, module, exports) { + var __defProp = Object.defineProperty; + var __markAsModule = (target) => + __defProp(target, "__esModule", { + value: true, + }); + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { + get: all[name], + enumerable: true, + }); + }; + // src/index.js + __markAsModule(exports); + __export(exports, { + GIFEncoder: () => GIFEncoder, + applyPalette: () => applyPalette, + default: () => src_default, + nearestColor: () => nearestColor, + nearestColorIndex: () => nearestColorIndex, + nearestColorIndexWithDistance: () => nearestColorIndexWithDistance, + prequantize: () => prequantize, + quantize: () => quantize, + snapColorsToPalette: () => snapColorsToPalette, + }); + // src/constants.js + var constants_default = { + signature: "GIF", + version: "89a", + trailer: 59, + extensionIntroducer: 33, + applicationExtensionLabel: 255, + graphicControlExtensionLabel: 249, + imageSeparator: 44, + signatureSize: 3, + versionSize: 3, + globalColorTableFlagMask: 128, + colorResolutionMask: 112, + sortFlagMask: 8, + globalColorTableSizeMask: 7, + applicationIdentifierSize: 8, + applicationAuthCodeSize: 3, + disposalMethodMask: 28, + userInputFlagMask: 2, + transparentColorFlagMask: 1, + localColorTableFlagMask: 128, + interlaceFlagMask: 64, + idSortFlagMask: 32, + localColorTableSizeMask: 7, + }; + // src/stream.js + function createStream(initialCapacity = 256) { + let cursor = 0; + let contents = new Uint8Array(initialCapacity); + return { + get buffer() { + return contents.buffer; + }, + reset() { + cursor = 0; + }, + bytesView() { + return contents.subarray(0, cursor); + }, + bytes() { + return contents.slice(0, cursor); + }, + writeByte(byte) { + expand(cursor + 1); + contents[cursor] = byte; + cursor++; + }, + writeBytes(data, offset = 0, byteLength = data.length) { + expand(cursor + byteLength); + for (let i = 0; i < byteLength; i++) { + contents[cursor++] = data[i + offset]; + } + }, + writeBytesView(data, offset = 0, byteLength = data.byteLength) { + expand(cursor + byteLength); + contents.set( + data.subarray(offset, offset + byteLength), + cursor, + ); + cursor += byteLength; + }, + }; + function expand(newCapacity) { + var prevCapacity = contents.length; + if (prevCapacity >= newCapacity) return; + var CAPACITY_DOUBLING_MAX = 1024 * 1024; + newCapacity = Math.max( + newCapacity, + (prevCapacity * + (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125)) >>> + 0, + ); + if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); + const oldContents = contents; + contents = new Uint8Array(newCapacity); + if (cursor > 0) contents.set(oldContents.subarray(0, cursor), 0); + } + } // src/lzwEncode.js + + var BITS = 12; + var DEFAULT_HSIZE = 5003; + var MASKS = [ + 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, + 16383, 32767, 65535, + ]; + function lzwEncode( + width, + height, + pixels, + colorDepth, + outStream = createStream(512), + accum = new Uint8Array(256), + htab = new Int32Array(DEFAULT_HSIZE), + codetab = new Int32Array(DEFAULT_HSIZE), + ) { + const hsize = htab.length; + const initCodeSize = Math.max(2, colorDepth); + accum.fill(0); + codetab.fill(0); + htab.fill(-1); + let cur_accum = 0; + let cur_bits = 0; + const init_bits = initCodeSize + 1; + const g_init_bits = init_bits; + let clear_flg = false; + let n_bits = g_init_bits; + let maxcode = (1 << n_bits) - 1; + const ClearCode = 1 << (init_bits - 1); + const EOFCode = ClearCode + 1; + let free_ent = ClearCode + 2; + let a_count = 0; + let ent = pixels[0]; + let hshift = 0; + for (let fcode = hsize; fcode < 65536; fcode *= 2) { + ++hshift; + } + hshift = 8 - hshift; + outStream.writeByte(initCodeSize); + output(ClearCode); + const length = pixels.length; + for (let idx = 1; idx < length; idx++) { + next_block: { + const c = pixels[idx]; + const fcode = (c << BITS) + ent; + let i = (c << hshift) ^ ent; + if (htab[i] === fcode) { + ent = codetab[i]; + break next_block; + } + const disp = i === 0 ? 1 : hsize - i; + while (htab[i] >= 0) { + i -= disp; + if (i < 0) i += hsize; + if (htab[i] === fcode) { + ent = codetab[i]; + break next_block; + } + } + output(ent); + ent = c; + if (free_ent < 1 << BITS) { + codetab[i] = free_ent++; + htab[i] = fcode; + } else { + htab.fill(-1); + free_ent = ClearCode + 2; + clear_flg = true; + output(ClearCode); + } + } + } + output(ent); + output(EOFCode); + outStream.writeByte(0); + return outStream.bytesView(); + function output(code) { + cur_accum &= MASKS[cur_bits]; + if (cur_bits > 0) cur_accum |= code << cur_bits; + else cur_accum = code; + cur_bits += n_bits; + while (cur_bits >= 8) { + accum[a_count++] = cur_accum & 255; + if (a_count >= 254) { + outStream.writeByte(a_count); + outStream.writeBytesView(accum, 0, a_count); + a_count = 0; + } + cur_accum >>= 8; + cur_bits -= 8; + } + if (free_ent > maxcode || clear_flg) { + if (clear_flg) { + n_bits = g_init_bits; + maxcode = (1 << n_bits) - 1; + clear_flg = false; + } else { + ++n_bits; + maxcode = n_bits === BITS ? 1 << n_bits : (1 << n_bits) - 1; + } + } + if (code == EOFCode) { + while (cur_bits > 0) { + accum[a_count++] = cur_accum & 255; + if (a_count >= 254) { + outStream.writeByte(a_count); + outStream.writeBytesView(accum, 0, a_count); + a_count = 0; + } + cur_accum >>= 8; + cur_bits -= 8; + } + if (a_count > 0) { + outStream.writeByte(a_count); + outStream.writeBytesView(accum, 0, a_count); + a_count = 0; + } + } + } + } + var lzwEncode_default = lzwEncode; + // src/rgb-packing.js + function rgb888_to_rgb565(r, g, b) { + return ((r << 8) & 63488) | ((g << 2) & 992) | (b >> 3); + } + function rgba8888_to_rgba4444(r, g, b, a) { + return (r >> 4) | (g & 240) | ((b & 240) << 4) | ((a & 240) << 8); + } + function rgb888_to_rgb444(r, g, b) { + return ((r >> 4) << 8) | (g & 240) | (b >> 4); + } // src/pnnquant2.js + + function clamp(value, min, max) { + return value < min ? min : value > max ? max : value; + } + function sqr(value) { + return value * value; + } + function find_nn(bins, idx, hasAlpha) { + var nn = 0; + var err = 1e100; + const bin1 = bins[idx]; + const n1 = bin1.cnt; + const wa = bin1.ac; + const wr = bin1.rc; + const wg = bin1.gc; + const wb = bin1.bc; + for (var i = bin1.fw; i != 0; i = bins[i].fw) { + const bin = bins[i]; + const n2 = bin.cnt; + const nerr2 = (n1 * n2) / (n1 + n2); + if (nerr2 >= err) continue; + var nerr = 0; + if (hasAlpha) { + nerr += nerr2 * sqr(bin.ac - wa); + if (nerr >= err) continue; + } + nerr += nerr2 * sqr(bin.rc - wr); + if (nerr >= err) continue; + nerr += nerr2 * sqr(bin.gc - wg); + if (nerr >= err) continue; + nerr += nerr2 * sqr(bin.bc - wb); + if (nerr >= err) continue; + err = nerr; + nn = i; + } + bin1.err = err; + bin1.nn = nn; + } + function create_bin() { + return { + ac: 0, + rc: 0, + gc: 0, + bc: 0, + cnt: 0, + nn: 0, + fw: 0, + bk: 0, + tm: 0, + mtm: 0, + err: 0, + }; + } + function create_bin_list(data, format) { + const bincount = format === "rgb444" ? 4096 : 65536; + const bins = new Array(bincount); + const size = data.length; + if (format === "rgba4444") { + for (let i = 0; i < size; ++i) { + const color = data[i]; + const a = (color >> 24) & 255; + const b = (color >> 16) & 255; + const g = (color >> 8) & 255; + const r = color & 255; + const index = rgba8888_to_rgba4444(r, g, b, a); + let bin = + index in bins ? bins[index] : (bins[index] = create_bin()); + bin.rc += r; + bin.gc += g; + bin.bc += b; + bin.ac += a; + bin.cnt++; + } + } else if (format === "rgb444") { + for (let i = 0; i < size; ++i) { + const color = data[i]; + const b = (color >> 16) & 255; + const g = (color >> 8) & 255; + const r = color & 255; + const index = rgb888_to_rgb444(r, g, b); + let bin = + index in bins ? bins[index] : (bins[index] = create_bin()); + bin.rc += r; + bin.gc += g; + bin.bc += b; + bin.cnt++; + } + } else { + for (let i = 0; i < size; ++i) { + const color = data[i]; + const b = (color >> 16) & 255; + const g = (color >> 8) & 255; + const r = color & 255; + const index = rgb888_to_rgb565(r, g, b); + let bin = + index in bins ? bins[index] : (bins[index] = create_bin()); + bin.rc += r; + bin.gc += g; + bin.bc += b; + bin.cnt++; + } + } + return bins; + } + function quantize(rgba, maxColors, opts = {}) { + const { + format = "rgb565", + clearAlpha = true, + clearAlphaColor = 0, + clearAlphaThreshold = 0, + oneBitAlpha = false, + } = opts; + if (!rgba || !rgba.buffer) { + throw new Error("quantize() expected RGBA Uint8Array data"); + } + if ( + !(rgba instanceof Uint8Array) && + !(rgba instanceof Uint8ClampedArray) + ) { + throw new Error("quantize() expected RGBA Uint8Array data"); + } + const data = new Uint32Array(rgba.buffer); + let useSqrt = opts.useSqrt !== false; + const hasAlpha = format === "rgba4444"; + const bins = create_bin_list(data, format); + const bincount = bins.length; + const bincountMinusOne = bincount - 1; + const heap = new Uint32Array(bincount + 1); + var maxbins = 0; + for (var i = 0; i < bincount; ++i) { + const bin = bins[i]; + if (bin != null) { + var d = 1 / bin.cnt; + if (hasAlpha) bin.ac *= d; + bin.rc *= d; + bin.gc *= d; + bin.bc *= d; + bins[maxbins++] = bin; + } + } + if (sqr(maxColors) / maxbins < 0.022) { + useSqrt = false; + } + var i = 0; + for (; i < maxbins - 1; ++i) { + bins[i].fw = i + 1; + bins[i + 1].bk = i; + if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); + } + if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); + var h, l, l2; + for (i = 0; i < maxbins; ++i) { + find_nn(bins, i, false); + var err = bins[i].err; + for (l = ++heap[0]; l > 1; l = l2) { + l2 = l >> 1; + if (bins[(h = heap[l2])].err <= err) break; + heap[l] = h; + } + heap[l] = i; + } + var extbins = maxbins - maxColors; + for (i = 0; i < extbins; ) { + var tb; + for (;;) { + var b1 = heap[1]; + tb = bins[b1]; + if (tb.tm >= tb.mtm && bins[tb.nn].mtm <= tb.tm) break; + if (tb.mtm == bincountMinusOne) b1 = heap[1] = heap[heap[0]--]; + else { + find_nn(bins, b1, false); + tb.tm = i; + } + var err = bins[b1].err; + for (l = 1; (l2 = l + l) <= heap[0]; l = l2) { + if ( + l2 < heap[0] && + bins[heap[l2]].err > bins[heap[l2 + 1]].err + ) + l2++; + if (err <= bins[(h = heap[l2])].err) break; + heap[l] = h; + } + heap[l] = b1; + } + var nb = bins[tb.nn]; + var n1 = tb.cnt; + var n2 = nb.cnt; + var d = 1 / (n1 + n2); + if (hasAlpha) tb.ac = d * (n1 * tb.ac + n2 * nb.ac); + tb.rc = d * (n1 * tb.rc + n2 * nb.rc); + tb.gc = d * (n1 * tb.gc + n2 * nb.gc); + tb.bc = d * (n1 * tb.bc + n2 * nb.bc); + tb.cnt += nb.cnt; + tb.mtm = ++i; + bins[nb.bk].fw = nb.fw; + bins[nb.fw].bk = nb.bk; + nb.mtm = bincountMinusOne; + } + let palette = []; + var k = 0; + for (i = 0; ; ++k) { + let r = clamp(Math.round(bins[i].rc), 0, 255); + let g = clamp(Math.round(bins[i].gc), 0, 255); + let b = clamp(Math.round(bins[i].bc), 0, 255); + let a = 255; + if (hasAlpha) { + a = clamp(Math.round(bins[i].ac), 0, 255); + if (oneBitAlpha) { + const threshold = + typeof oneBitAlpha === "number" ? oneBitAlpha : 127; + a = a <= threshold ? 0 : 255; + } + if (clearAlpha && a <= clearAlphaThreshold) { + r = g = b = clearAlphaColor; + a = 0; + } + } + const color = hasAlpha ? [r, g, b, a] : [r, g, b]; + const exists = existsInPalette(palette, color); + if (!exists) palette.push(color); + if ((i = bins[i].fw) == 0) break; + } + return palette; + } + function existsInPalette(palette, color) { + for (let i = 0; i < palette.length; i++) { + const p = palette[i]; + let matchesRGB = + p[0] === color[0] && p[1] === color[1] && p[2] === color[2]; + let matchesAlpha = + p.length >= 4 && color.length >= 4 ? p[3] === color[3] : true; + if (matchesRGB && matchesAlpha) return true; + } + return false; + } // src/color.js + + function euclideanDistanceSquared(a, b) { + var sum = 0; + var n; + for (n = 0; n < a.length; n++) { + const dx = a[n] - b[n]; + sum += dx * dx; + } + return sum; + } // src/palettize.js + + function roundStep(byte, step) { + return step > 1 ? Math.round(byte / step) * step : byte; + } + function prequantize( + rgba, + { roundRGB = 5, roundAlpha = 10, oneBitAlpha = null } = {}, + ) { + const data = new Uint32Array(rgba.buffer); + for (let i = 0; i < data.length; i++) { + const color = data[i]; + let a = (color >> 24) & 255; + let b = (color >> 16) & 255; + let g = (color >> 8) & 255; + let r = color & 255; + a = roundStep(a, roundAlpha); + if (oneBitAlpha) { + const threshold = + typeof oneBitAlpha === "number" ? oneBitAlpha : 127; + a = a <= threshold ? 0 : 255; + } + r = roundStep(r, roundRGB); + g = roundStep(g, roundRGB); + b = roundStep(b, roundRGB); + data[i] = (a << 24) | (b << 16) | (g << 8) | (r << 0); + } + } + function applyPalette(rgba, palette, format = "rgb565") { + if (!rgba || !rgba.buffer) { + throw new Error("quantize() expected RGBA Uint8Array data"); + } + if ( + !(rgba instanceof Uint8Array) && + !(rgba instanceof Uint8ClampedArray) + ) { + throw new Error("quantize() expected RGBA Uint8Array data"); + } + if (palette.length > 256) { + throw new Error( + "applyPalette() only works with 256 colors or less", + ); + } + const data = new Uint32Array(rgba.buffer); + const length = data.length; + const bincount = format === "rgb444" ? 4096 : 65536; + const index = new Uint8Array(length); + const cache = new Array(bincount); + const hasAlpha = format === "rgba4444"; + if (format === "rgba4444") { + for (let i = 0; i < length; i++) { + const color = data[i]; + const a = (color >> 24) & 255; + const b = (color >> 16) & 255; + const g = (color >> 8) & 255; + const r = color & 255; + const key = rgba8888_to_rgba4444(r, g, b, a); + const idx = + key in cache + ? cache[key] + : (cache[key] = nearestColorIndexRGBA(r, g, b, a, palette)); + index[i] = idx; + } + } else { + const rgb888_to_key = + format === "rgb444" ? rgb888_to_rgb444 : rgb888_to_rgb565; + for (let i = 0; i < length; i++) { + const color = data[i]; + const b = (color >> 16) & 255; + const g = (color >> 8) & 255; + const r = color & 255; + const key = rgb888_to_key(r, g, b); + const idx = + key in cache + ? cache[key] + : (cache[key] = nearestColorIndexRGB(r, g, b, palette)); + index[i] = idx; + } + } + return index; + } + function nearestColorIndexRGBA(r, g, b, a, palette) { + let k = 0; + let mindist = 1e100; + for (let i = 0; i < palette.length; i++) { + const px2 = palette[i]; + const a2 = px2[3]; + let curdist = sqr2(a2 - a); + if (curdist > mindist) continue; + const r2 = px2[0]; + curdist += sqr2(r2 - r); + if (curdist > mindist) continue; + const g2 = px2[1]; + curdist += sqr2(g2 - g); + if (curdist > mindist) continue; + const b2 = px2[2]; + curdist += sqr2(b2 - b); + if (curdist > mindist) continue; + mindist = curdist; + k = i; + } + return k; + } + function nearestColorIndexRGB(r, g, b, palette) { + let k = 0; + let mindist = 1e100; + for (let i = 0; i < palette.length; i++) { + const px2 = palette[i]; + const r2 = px2[0]; + let curdist = sqr2(r2 - r); + if (curdist > mindist) continue; + const g2 = px2[1]; + curdist += sqr2(g2 - g); + if (curdist > mindist) continue; + const b2 = px2[2]; + curdist += sqr2(b2 - b); + if (curdist > mindist) continue; + mindist = curdist; + k = i; + } + return k; + } + function snapColorsToPalette(palette, knownColors, threshold = 5) { + if (!palette.length || !knownColors.length) return; + const paletteRGB = palette.map((p) => p.slice(0, 3)); + const thresholdSq = threshold * threshold; + const dim = palette[0].length; + for (let i = 0; i < knownColors.length; i++) { + let color = knownColors[i]; + if (color.length < dim) { + color = [color[0], color[1], color[2], 255]; + } else if (color.length > dim) { + color = color.slice(0, 3); + } else { + color = color.slice(); + } + const r = nearestColorIndexWithDistance( + paletteRGB, + color.slice(0, 3), + euclideanDistanceSquared, + ); + const idx = r[0]; + const distanceSq = r[1]; + if (distanceSq > 0 && distanceSq <= thresholdSq) { + palette[idx] = color; + } + } + } + function sqr2(a) { + return a * a; + } + function nearestColorIndex( + colors, + pixel, + distanceFn = euclideanDistanceSquared, + ) { + let minDist = Infinity; + let minDistIndex = -1; + for (let j = 0; j < colors.length; j++) { + const paletteColor = colors[j]; + const dist = distanceFn(pixel, paletteColor); + if (dist < minDist) { + minDist = dist; + minDistIndex = j; + } + } + return minDistIndex; + } + function nearestColorIndexWithDistance( + colors, + pixel, + distanceFn = euclideanDistanceSquared, + ) { + let minDist = Infinity; + let minDistIndex = -1; + for (let j = 0; j < colors.length; j++) { + const paletteColor = colors[j]; + const dist = distanceFn(pixel, paletteColor); + if (dist < minDist) { + minDist = dist; + minDistIndex = j; + } + } + return [minDistIndex, minDist]; + } + function nearestColor( + colors, + pixel, + distanceFn = euclideanDistanceSquared, + ) { + return colors[nearestColorIndex(colors, pixel, distanceFn)]; + } // src/index.js + + function GIFEncoder(opt = {}) { + const { initialCapacity = 4096, auto = true } = opt; + const stream = createStream(initialCapacity); + const HSIZE = 5003; + const accum = new Uint8Array(256); + const htab = new Int32Array(HSIZE); + const codetab = new Int32Array(HSIZE); + let hasInit = false; + return { + reset() { + stream.reset(); + hasInit = false; + }, + finish() { + stream.writeByte(constants_default.trailer); + }, + bytes() { + return stream.bytes(); + }, + bytesView() { + return stream.bytesView(); + }, + get buffer() { + return stream.buffer; + }, + get stream() { + return stream; + }, + writeHeader, + writeFrame(index, width, height, opts = {}) { + const { + transparent = false, + transparentIndex = 0, + delay = 0, + palette = null, + repeat = 0, + colorDepth = 8, + dispose = -1, + } = opts; + let first = false; + if (auto) { + if (!hasInit) { + first = true; + writeHeader(); + hasInit = true; + } + } else { + first = Boolean(opts.first); + } + width = Math.max(0, Math.floor(width)); + height = Math.max(0, Math.floor(height)); + if (first) { + if (!palette) { + throw new Error( + "First frame must include a { palette } option", + ); + } + encodeLogicalScreenDescriptor( + stream, + width, + height, + palette, + colorDepth, + ); + encodeColorTable(stream, palette); + if (repeat >= 0) { + encodeNetscapeExt(stream, repeat); + } + } + const delayTime = Math.round(delay / 10); + encodeGraphicControlExt( + stream, + dispose, + delayTime, + transparent, + transparentIndex, + ); + const useLocalColorTable = Boolean(palette) && !first; + encodeImageDescriptor( + stream, + width, + height, + useLocalColorTable ? palette : null, + ); + if (useLocalColorTable) encodeColorTable(stream, palette); + encodePixels( + stream, + index, + width, + height, + colorDepth, + accum, + htab, + codetab, + ); + }, + }; + function writeHeader() { + writeUTFBytes(stream, "GIF89a"); + } + } + function encodeGraphicControlExt( + stream, + dispose, + delay, + transparent, + transparentIndex, + ) { + stream.writeByte(33); + stream.writeByte(249); + stream.writeByte(4); + if (transparentIndex < 0) { + transparentIndex = 0; + transparent = false; + } + var transp, disp; + if (!transparent) { + transp = 0; + disp = 0; + } else { + transp = 1; + disp = 2; + } + if (dispose >= 0) { + disp = dispose & 7; + } + disp <<= 2; + const userInput = 0; + stream.writeByte(0 | disp | userInput | transp); + writeUInt16(stream, delay); + stream.writeByte(transparentIndex || 0); + stream.writeByte(0); + } + function encodeLogicalScreenDescriptor( + stream, + width, + height, + palette, + colorDepth = 8, + ) { + const globalColorTableFlag = 1; + const sortFlag = 0; + const globalColorTableSize = colorTableSize(palette.length) - 1; + const fields = + (globalColorTableFlag << 7) | + ((colorDepth - 1) << 4) | + (sortFlag << 3) | + globalColorTableSize; + const backgroundColorIndex = 0; + const pixelAspectRatio = 0; + writeUInt16(stream, width); + writeUInt16(stream, height); + stream.writeBytes([fields, backgroundColorIndex, pixelAspectRatio]); + } + function encodeNetscapeExt(stream, repeat) { + stream.writeByte(33); + stream.writeByte(255); + stream.writeByte(11); + writeUTFBytes(stream, "NETSCAPE2.0"); + stream.writeByte(3); + stream.writeByte(1); + writeUInt16(stream, repeat); + stream.writeByte(0); + } + function encodeColorTable(stream, palette) { + const colorTableLength = 1 << colorTableSize(palette.length); + for (let i = 0; i < colorTableLength; i++) { + let color = [0, 0, 0]; + if (i < palette.length) { + color = palette[i]; + } + stream.writeByte(color[0]); + stream.writeByte(color[1]); + stream.writeByte(color[2]); + } + } + function encodeImageDescriptor(stream, width, height, localPalette) { + stream.writeByte(44); + writeUInt16(stream, 0); + writeUInt16(stream, 0); + writeUInt16(stream, width); + writeUInt16(stream, height); + if (localPalette) { + const interlace = 0; + const sorted = 0; + const palSize = colorTableSize(localPalette.length) - 1; + stream.writeByte(128 | interlace | sorted | 0 | palSize); + } else { + stream.writeByte(0); + } + } + function encodePixels( + stream, + index, + width, + height, + colorDepth = 8, + accum, + htab, + codetab, + ) { + lzwEncode_default( + width, + height, + index, + colorDepth, + stream, + accum, + htab, + codetab, + ); + } + function writeUInt16(stream, short) { + stream.writeByte(short & 255); + stream.writeByte((short >> 8) & 255); + } + function writeUTFBytes(stream, text) { + for (var i = 0; i < text.length; i++) { + stream.writeByte(text.charCodeAt(i)); + } + } + function colorTableSize(length) { + return Math.max(Math.ceil(Math.log2(length)), 1); + } + var src_default = GIFEncoder; + }, + {}, + ], + 264: [ + function (_dereq_, module, exports) { + "use strict"; + function _interopDefault(ex) { + return ex && typeof ex === "object" && "default" in ex + ? ex["default"] + : ex; + } + var _classCallCheck = _interopDefault( + _dereq_("@babel/runtime/helpers/classCallCheck"), + ); + var _createClass = _interopDefault( + _dereq_("@babel/runtime/helpers/createClass"), + ); + var arr = []; + var each = arr.forEach; + var slice = arr.slice; + function defaults(obj) { + each.call(slice.call(arguments, 1), function (source) { + if (source) { + for (var prop in source) { + if (obj[prop] === undefined) obj[prop] = source[prop]; + } + } + }); + return obj; + } + var cookie = { + create: function create(name, value, minutes, domain) { + var expires; + if (minutes) { + var date = new Date(); + date.setTime(date.getTime() + minutes * 60 * 1000); + expires = "; expires=" + date.toGMTString(); + } else expires = ""; + domain = domain ? "domain=" + domain + ";" : ""; + document.cookie = + name + "=" + value + expires + ";" + domain + "path=/"; + }, + read: function read(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(";"); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) === " ") { + c = c.substring(1, c.length); + } + if (c.indexOf(nameEQ) === 0) + return c.substring(nameEQ.length, c.length); + } + return null; + }, + remove: function remove(name) { + this.create(name, "", -1); + }, + }; + var cookie$1 = { + name: "cookie", + lookup: function lookup(options) { + var found; + if (options.lookupCookie && typeof document !== "undefined") { + var c = cookie.read(options.lookupCookie); + if (c) found = c; + } + return found; + }, + cacheUserLanguage: function cacheUserLanguage(lng, options) { + if (options.lookupCookie && typeof document !== "undefined") { + cookie.create( + options.lookupCookie, + lng, + options.cookieMinutes, + options.cookieDomain, + ); + } + }, + }; + var querystring = { + name: "querystring", + lookup: function lookup(options) { + var found; + if (typeof window !== "undefined") { + var query = window.location.search.substring(1); + var params = query.split("&"); + for (var i = 0; i < params.length; i++) { + var pos = params[i].indexOf("="); + if (pos > 0) { + var key = params[i].substring(0, pos); + if (key === options.lookupQuerystring) { + found = params[i].substring(pos + 1); + } + } + } + } + return found; + }, + }; + var hasLocalStorageSupport; + try { + hasLocalStorageSupport = + window !== "undefined" && window.localStorage !== null; + var testKey = "i18next.translate.boo"; + window.localStorage.setItem(testKey, "foo"); + window.localStorage.removeItem(testKey); + } catch (e) { + hasLocalStorageSupport = false; + } + var localStorage = { + name: "localStorage", + lookup: function lookup(options) { + var found; + if (options.lookupLocalStorage && hasLocalStorageSupport) { + var lng = window.localStorage.getItem( + options.lookupLocalStorage, + ); + if (lng) found = lng; + } + return found; + }, + cacheUserLanguage: function cacheUserLanguage(lng, options) { + if (options.lookupLocalStorage && hasLocalStorageSupport) { + window.localStorage.setItem(options.lookupLocalStorage, lng); + } + }, + }; + var navigator$1 = { + name: "navigator", + lookup: function lookup(options) { + var found = []; + if (typeof navigator !== "undefined") { + if (navigator.languages) { + // chrome only; not an array, so can't use .push.apply instead of iterating + for (var i = 0; i < navigator.languages.length; i++) { + found.push(navigator.languages[i]); + } + } + if (navigator.userLanguage) { + found.push(navigator.userLanguage); + } + if (navigator.language) { + found.push(navigator.language); + } + } + return found.length > 0 ? found : undefined; + }, + }; + var htmlTag = { + name: "htmlTag", + lookup: function lookup(options) { + var found; + var htmlTag = + options.htmlTag || + (typeof document !== "undefined" + ? document.documentElement + : null); + if (htmlTag && typeof htmlTag.getAttribute === "function") { + found = htmlTag.getAttribute("lang"); + } + return found; + }, + }; + var path = { + name: "path", + lookup: function lookup(options) { + var found; + if (typeof window !== "undefined") { + var language = + window.location.pathname.match(/\/([a-zA-Z-]*)/g); + if (language instanceof Array) { + if (typeof options.lookupFromPathIndex === "number") { + if ( + typeof language[options.lookupFromPathIndex] !== "string" + ) { + return undefined; + } + found = language[options.lookupFromPathIndex].replace( + "/", + "", + ); + } else { + found = language[0].replace("/", ""); + } + } + } + return found; + }, + }; + var subdomain = { + name: "subdomain", + lookup: function lookup(options) { + var found; + if (typeof window !== "undefined") { + var language = window.location.href.match( + /(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi, + ); + if (language instanceof Array) { + if (typeof options.lookupFromSubdomainIndex === "number") { + found = language[options.lookupFromSubdomainIndex] + .replace("http://", "") + .replace("https://", "") + .replace(".", ""); + } else { + found = language[0] + .replace("http://", "") + .replace("https://", "") + .replace(".", ""); + } + } + } + return found; + }, + }; + function getDefaults() { + return { + order: [ + "querystring", + "cookie", + "localStorage", + "navigator", + "htmlTag", + ], + lookupQuerystring: "lng", + lookupCookie: "i18next", + lookupLocalStorage: "i18nextLng", + // cache user language + caches: ["localStorage"], + excludeCacheFor: ["cimode"], + //cookieMinutes: 10, + //cookieDomain: 'myDomain' + checkWhitelist: true, + }; + } + var Browser = + /*#__PURE__*/ + (function () { + function Browser(services) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + _classCallCheck(this, Browser); + this.type = "languageDetector"; + this.detectors = {}; + this.init(services, options); + } + _createClass(Browser, [ + { + key: "init", + value: function init(services) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + var i18nOptions = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : {}; + this.services = services; + this.options = defaults( + options, + this.options || {}, + getDefaults(), + ); // backwards compatibility + if (this.options.lookupFromUrlIndex) + this.options.lookupFromPathIndex = + this.options.lookupFromUrlIndex; + this.i18nOptions = i18nOptions; + this.addDetector(cookie$1); + this.addDetector(querystring); + this.addDetector(localStorage); + this.addDetector(navigator$1); + this.addDetector(htmlTag); + this.addDetector(path); + this.addDetector(subdomain); + }, + }, + { + key: "addDetector", + value: function addDetector(detector) { + this.detectors[detector.name] = detector; + }, + }, + { + key: "detect", + value: function detect(detectionOrder) { + var _this = this; + if (!detectionOrder) detectionOrder = this.options.order; + var detected = []; + detectionOrder.forEach(function (detectorName) { + if (_this.detectors[detectorName]) { + var lookup = _this.detectors[detectorName].lookup( + _this.options, + ); + if (lookup && typeof lookup === "string") + lookup = [lookup]; + if (lookup) detected = detected.concat(lookup); + } + }); + var found; + detected.forEach(function (lng) { + if (found) return; + var cleanedLng = + _this.services.languageUtils.formatLanguageCode(lng); + if ( + !_this.options.checkWhitelist || + _this.services.languageUtils.isWhitelisted(cleanedLng) + ) + found = cleanedLng; + }); + if (!found) { + var fallbacks = this.i18nOptions.fallbackLng; + if (typeof fallbacks === "string") + fallbacks = [fallbacks]; + if (!fallbacks) fallbacks = []; + if ( + Object.prototype.toString.apply(fallbacks) === + "[object Array]" + ) { + found = fallbacks[0]; + } else { + found = + fallbacks[0] || + (fallbacks["default"] && fallbacks["default"][0]); + } + } + return found; + }, + }, + { + key: "cacheUserLanguage", + value: function cacheUserLanguage(lng, caches) { + var _this2 = this; + if (!caches) caches = this.options.caches; + if (!caches) return; + if ( + this.options.excludeCacheFor && + this.options.excludeCacheFor.indexOf(lng) > -1 + ) + return; + caches.forEach(function (cacheName) { + if (_this2.detectors[cacheName]) + _this2.detectors[cacheName].cacheUserLanguage( + lng, + _this2.options, + ); + }); + }, + }, + ]); + return Browser; + })(); + Browser.type = "languageDetector"; + module.exports = Browser; + }, + { + "@babel/runtime/helpers/classCallCheck": 265, + "@babel/runtime/helpers/createClass": 266, + }, + ], + 265: [ + function (_dereq_, module, exports) { + arguments[4][5][0].apply(exports, arguments); + }, + { + dup: 5, + }, + ], + 266: [ + function (_dereq_, module, exports) { + arguments[4][6][0].apply(exports, arguments); + }, + { + dup: 6, + }, + ], + 267: [ + function (_dereq_, module, exports) { + "use strict"; + function _interopDefault(ex) { + return ex && typeof ex === "object" && "default" in ex + ? ex["default"] + : ex; + } + var _typeof = _interopDefault( + _dereq_("@babel/runtime/helpers/typeof"), + ); + var _objectSpread = _interopDefault( + _dereq_("@babel/runtime/helpers/objectSpread"), + ); + var _classCallCheck = _interopDefault( + _dereq_("@babel/runtime/helpers/classCallCheck"), + ); + var _createClass = _interopDefault( + _dereq_("@babel/runtime/helpers/createClass"), + ); + var _possibleConstructorReturn = _interopDefault( + _dereq_("@babel/runtime/helpers/possibleConstructorReturn"), + ); + var _getPrototypeOf = _interopDefault( + _dereq_("@babel/runtime/helpers/getPrototypeOf"), + ); + var _assertThisInitialized = _interopDefault( + _dereq_("@babel/runtime/helpers/assertThisInitialized"), + ); + var _inherits = _interopDefault( + _dereq_("@babel/runtime/helpers/inherits"), + ); + var _toConsumableArray = _interopDefault( + _dereq_("@babel/runtime/helpers/toConsumableArray"), + ); + var _slicedToArray = _interopDefault( + _dereq_("@babel/runtime/helpers/slicedToArray"), + ); + var consoleLogger = { + type: "logger", + log: function log(args) { + this.output("log", args); + }, + warn: function warn(args) { + this.output("warn", args); + }, + error: function error(args) { + this.output("error", args); + }, + output: function output(type, args) { + var _console; + /* eslint no-console: 0 */ + if (console && console[type]) + (_console = console)[type].apply( + _console, + _toConsumableArray(args), + ); + }, + }; + var Logger = + /*#__PURE__*/ + (function () { + function Logger(concreteLogger) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + _classCallCheck(this, Logger); + this.init(concreteLogger, options); + } + _createClass(Logger, [ + { + key: "init", + value: function init(concreteLogger) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + this.prefix = options.prefix || "i18next:"; + this.logger = concreteLogger || consoleLogger; + this.options = options; + this.debug = options.debug; + }, + }, + { + key: "setDebug", + value: function setDebug(bool) { + this.debug = bool; + }, + }, + { + key: "log", + value: function log() { + for ( + var _len = arguments.length, + args = new Array(_len), + _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + return this.forward(args, "log", "", true); + }, + }, + { + key: "warn", + value: function warn() { + for ( + var _len2 = arguments.length, + args = new Array(_len2), + _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + return this.forward(args, "warn", "", true); + }, + }, + { + key: "error", + value: function error() { + for ( + var _len3 = arguments.length, + args = new Array(_len3), + _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + return this.forward(args, "error", ""); + }, + }, + { + key: "deprecate", + value: function deprecate() { + for ( + var _len4 = arguments.length, + args = new Array(_len4), + _key4 = 0; + _key4 < _len4; + _key4++ + ) { + args[_key4] = arguments[_key4]; + } + return this.forward( + args, + "warn", + "WARNING DEPRECATED: ", + true, + ); + }, + }, + { + key: "forward", + value: function forward(args, lvl, prefix, debugOnly) { + if (debugOnly && !this.debug) return null; + if (typeof args[0] === "string") + args[0] = "" + .concat(prefix) + .concat(this.prefix, " ") + .concat(args[0]); + return this.logger[lvl](args); + }, + }, + { + key: "create", + value: function create(moduleName) { + return new Logger( + this.logger, + _objectSpread( + {}, + { + prefix: "" + .concat(this.prefix, ":") + .concat(moduleName, ":"), + }, + this.options, + ), + ); + }, + }, + ]); + return Logger; + })(); + var baseLogger = new Logger(); + var EventEmitter = + /*#__PURE__*/ + (function () { + function EventEmitter() { + _classCallCheck(this, EventEmitter); + this.observers = {}; + } + _createClass(EventEmitter, [ + { + key: "on", + value: function on(events, listener) { + var _this = this; + events.split(" ").forEach(function (event) { + _this.observers[event] = _this.observers[event] || []; + _this.observers[event].push(listener); + }); + return this; + }, + }, + { + key: "off", + value: function off(event, listener) { + if (!this.observers[event]) return; + if (!listener) { + delete this.observers[event]; + return; + } + this.observers[event] = this.observers[event].filter( + function (l) { + return l !== listener; + }, + ); + }, + }, + { + key: "emit", + value: function emit(event) { + for ( + var _len = arguments.length, + args = new Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + if (this.observers[event]) { + var cloned = [].concat(this.observers[event]); + cloned.forEach(function (observer) { + observer.apply(void 0, args); + }); + } + if (this.observers["*"]) { + var _cloned = [].concat(this.observers["*"]); + _cloned.forEach(function (observer) { + observer.apply(observer, [event].concat(args)); + }); + } + }, + }, + ]); + return EventEmitter; + })(); + // http://lea.verou.me/2016/12/resolve-promises-externally-with-this-one-weird-trick/ + function defer() { + var res; + var rej; + var promise = new Promise(function (resolve, reject) { + res = resolve; + rej = reject; + }); + promise.resolve = res; + promise.reject = rej; + return promise; + } + function makeString(object) { + if (object == null) return ""; + /* eslint prefer-template: 0 */ + return "" + object; + } + function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); + } + function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf("###") > -1 + ? key.replace(/###/g, ".") + : key; + } + function canNotTraverseDeeper() { + return !object || typeof object === "string"; + } + var stack = + typeof path !== "string" ? [].concat(path) : path.split("."); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return {}; + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + if (canNotTraverseDeeper()) return {}; + return { + obj: object, + k: cleanKey(stack.shift()), + }; + } + function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + obj[k] = newValue; + } + function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + obj[k] = obj[k] || []; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); + } + function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + if (!obj) return undefined; + return obj[k]; + } + function getPathWithDefaults(data, defaultData, key) { + var value = getPath(data, key); + if (value !== undefined) { + return value; + } // Fallback to default values + + return getPath(defaultData, key); + } + function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if ( + typeof target[prop] === "string" || + target[prop] instanceof String || + typeof source[prop] === "string" || + source[prop] instanceof String + ) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; + } + function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } /* eslint-disable */ + + var _entityMap = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "/": "/", + }; + /* eslint-enable */ + function escape(data) { + if (typeof data === "string") { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + return data; + } + var ResourceStore = + /*#__PURE__*/ + (function (_EventEmitter) { + _inherits(ResourceStore, _EventEmitter); + function ResourceStore(data) { + var _this; + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : { + ns: ["translation"], + defaultNS: "translation", + }; + _classCallCheck(this, ResourceStore); + _this = _possibleConstructorReturn( + this, + _getPrototypeOf(ResourceStore).call(this), + ); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + _this.data = data || {}; + _this.options = options; + if (_this.options.keySeparator === undefined) { + _this.options.keySeparator = "."; + } + return _this; + } + _createClass(ResourceStore, [ + { + key: "addNamespaces", + value: function addNamespaces(ns) { + if (this.options.ns.indexOf(ns) < 0) { + this.options.ns.push(ns); + } + }, + }, + { + key: "removeNamespaces", + value: function removeNamespaces(ns) { + var index = this.options.ns.indexOf(ns); + if (index > -1) { + this.options.ns.splice(index, 1); + } + }, + }, + { + key: "getResource", + value: function getResource(lng, ns, key) { + var options = + arguments.length > 3 && arguments[3] !== undefined + ? arguments[3] + : {}; + var keySeparator = + options.keySeparator !== undefined + ? options.keySeparator + : this.options.keySeparator; + var path = [lng, ns]; + if (key && typeof key !== "string") path = path.concat(key); + if (key && typeof key === "string") + path = path.concat( + keySeparator ? key.split(keySeparator) : key, + ); + if (lng.indexOf(".") > -1) { + path = lng.split("."); + } + return getPath(this.data, path); + }, + }, + { + key: "addResource", + value: function addResource(lng, ns, key, value) { + var options = + arguments.length > 4 && arguments[4] !== undefined + ? arguments[4] + : { + silent: false, + }; + var keySeparator = this.options.keySeparator; + if (keySeparator === undefined) keySeparator = "."; + var path = [lng, ns]; + if (key) + path = path.concat( + keySeparator ? key.split(keySeparator) : key, + ); + if (lng.indexOf(".") > -1) { + path = lng.split("."); + value = ns; + ns = path[1]; + } + this.addNamespaces(ns); + setPath(this.data, path, value); + if (!options.silent) + this.emit("added", lng, ns, key, value); + }, + }, + { + key: "addResources", + value: function addResources(lng, ns, resources) { + var options = + arguments.length > 3 && arguments[3] !== undefined + ? arguments[3] + : { + silent: false, + }; + /* eslint no-restricted-syntax: 0 */ + for (var m in resources) { + if ( + typeof resources[m] === "string" || + Object.prototype.toString.apply(resources[m]) === + "[object Array]" + ) + this.addResource(lng, ns, m, resources[m], { + silent: true, + }); + } + if (!options.silent) this.emit("added", lng, ns, resources); + }, + }, + { + key: "addResourceBundle", + value: function addResourceBundle( + lng, + ns, + resources, + deep, + overwrite, + ) { + var options = + arguments.length > 5 && arguments[5] !== undefined + ? arguments[5] + : { + silent: false, + }; + var path = [lng, ns]; + if (lng.indexOf(".") > -1) { + path = lng.split("."); + deep = resources; + resources = ns; + ns = path[1]; + } + this.addNamespaces(ns); + var pack = getPath(this.data, path) || {}; + if (deep) { + deepExtend(pack, resources, overwrite); + } else { + pack = _objectSpread({}, pack, resources); + } + setPath(this.data, path, pack); + if (!options.silent) this.emit("added", lng, ns, resources); + }, + }, + { + key: "removeResourceBundle", + value: function removeResourceBundle(lng, ns) { + if (this.hasResourceBundle(lng, ns)) { + delete this.data[lng][ns]; + } + this.removeNamespaces(ns); + this.emit("removed", lng, ns); + }, + }, + { + key: "hasResourceBundle", + value: function hasResourceBundle(lng, ns) { + return this.getResource(lng, ns) !== undefined; + }, + }, + { + key: "getResourceBundle", + value: function getResourceBundle(lng, ns) { + if (!ns) ns = this.options.defaultNS; // COMPATIBILITY: remove extend in v2.1.0 + if (this.options.compatibilityAPI === "v1") + return _objectSpread({}, {}, this.getResource(lng, ns)); + return this.getResource(lng, ns); + }, + }, + { + key: "getDataByLanguage", + value: function getDataByLanguage(lng) { + return this.data[lng]; + }, + }, + { + key: "toJSON", + value: function toJSON() { + return this.data; + }, + }, + ]); + return ResourceStore; + })(EventEmitter); + var postProcessor = { + processors: {}, + addPostProcessor: function addPostProcessor(module) { + this.processors[module.name] = module; + }, + handle: function handle( + processors, + value, + key, + options, + translator, + ) { + var _this = this; + processors.forEach(function (processor) { + if (_this.processors[processor]) + value = _this.processors[processor].process( + value, + key, + options, + translator, + ); + }); + return value; + }, + }; + var checkedLoadedFor = {}; + var Translator = + /*#__PURE__*/ + (function (_EventEmitter) { + _inherits(Translator, _EventEmitter); + function Translator(services) { + var _this; + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + _classCallCheck(this, Translator); + _this = _possibleConstructorReturn( + this, + _getPrototypeOf(Translator).call(this), + ); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + copy( + [ + "resourceStore", + "languageUtils", + "pluralResolver", + "interpolator", + "backendConnector", + "i18nFormat", + "utils", + ], + services, + _assertThisInitialized(_this), + ); + _this.options = options; + if (_this.options.keySeparator === undefined) { + _this.options.keySeparator = "."; + } + _this.logger = baseLogger.create("translator"); + return _this; + } + _createClass(Translator, [ + { + key: "changeLanguage", + value: function changeLanguage(lng) { + if (lng) this.language = lng; + }, + }, + { + key: "exists", + value: function exists(key) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : { + interpolation: {}, + }; + var resolved = this.resolve(key, options); + return resolved && resolved.res !== undefined; + }, + }, + { + key: "extractFromKey", + value: function extractFromKey(key, options) { + var nsSeparator = + options.nsSeparator || this.options.nsSeparator; + if (nsSeparator === undefined) nsSeparator = ":"; + var keySeparator = + options.keySeparator !== undefined + ? options.keySeparator + : this.options.keySeparator; + var namespaces = options.ns || this.options.defaultNS; + if (nsSeparator && key.indexOf(nsSeparator) > -1) { + var parts = key.split(nsSeparator); + if ( + nsSeparator !== keySeparator || + (nsSeparator === keySeparator && + this.options.ns.indexOf(parts[0]) > -1) + ) + namespaces = parts.shift(); + key = parts.join(keySeparator); + } + if (typeof namespaces === "string") + namespaces = [namespaces]; + return { + key: key, + namespaces: namespaces, + }; + }, + }, + { + key: "translate", + value: function translate(keys, options) { + var _this2 = this; + if ( + _typeof(options) !== "object" && + this.options.overloadTranslationOptionHandler + ) { + /* eslint prefer-rest-params: 0 */ + options = + this.options.overloadTranslationOptionHandler( + arguments, + ); + } + if (!options) options = {}; // non valid keys handling + if (keys === undefined || keys === null /* || keys === ''*/) + return ""; + if (!Array.isArray(keys)) keys = [String(keys)]; // separators + var keySeparator = + options.keySeparator !== undefined + ? options.keySeparator + : this.options.keySeparator; // get namespace(s) + var _this$extractFromKey = this.extractFromKey( + keys[keys.length - 1], + options, + ), + key = _this$extractFromKey.key, + namespaces = _this$extractFromKey.namespaces; + var namespace = namespaces[namespaces.length - 1]; // return key on CIMode + var lng = options.lng || this.language; + var appendNamespaceToCIMode = + options.appendNamespaceToCIMode || + this.options.appendNamespaceToCIMode; + if (lng && lng.toLowerCase() === "cimode") { + if (appendNamespaceToCIMode) { + var nsSeparator = + options.nsSeparator || this.options.nsSeparator; + return namespace + nsSeparator + key; + } + return key; + } // resolve from store + + var resolved = this.resolve(keys, options); + var res = resolved && resolved.res; + var resUsedKey = (resolved && resolved.usedKey) || key; + var resExactUsedKey = + (resolved && resolved.exactUsedKey) || key; + var resType = Object.prototype.toString.apply(res); + var noObject = [ + "[object Number]", + "[object Function]", + "[object RegExp]", + ]; + var joinArrays = + options.joinArrays !== undefined + ? options.joinArrays + : this.options.joinArrays; // object + var handleAsObjectInI18nFormat = + !this.i18nFormat || this.i18nFormat.handleAsObject; + var handleAsObject = + typeof res !== "string" && + typeof res !== "boolean" && + typeof res !== "number"; + if ( + handleAsObjectInI18nFormat && + res && + handleAsObject && + noObject.indexOf(resType) < 0 && + !( + typeof joinArrays === "string" && + resType === "[object Array]" + ) + ) { + if ( + !options.returnObjects && + !this.options.returnObjects + ) { + this.logger.warn( + "accessing an object - but returnObjects options is not enabled!", + ); + return this.options.returnedObjectHandler + ? this.options.returnedObjectHandler( + resUsedKey, + res, + options, + ) + : "key '" + .concat(key, " (") + .concat( + this.language, + ")' returned an object instead of string.", + ); + } // if we got a separator we loop over children - else we just return object as is + // as having it set to false means no hierarchy so no lookup for nested values + + if (keySeparator) { + var resTypeIsArray = resType === "[object Array]"; + var copy$$1 = resTypeIsArray ? [] : {}; // apply child translation on a copy + /* eslint no-restricted-syntax: 0 */ + var newKeyToUse = resTypeIsArray + ? resExactUsedKey + : resUsedKey; + for (var m in res) { + if (Object.prototype.hasOwnProperty.call(res, m)) { + var deepKey = "" + .concat(newKeyToUse) + .concat(keySeparator) + .concat(m); + copy$$1[m] = this.translate( + deepKey, + _objectSpread({}, options, { + joinArrays: false, + ns: namespaces, + }), + ); + if (copy$$1[m] === deepKey) copy$$1[m] = res[m]; // if nothing found use orginal value as fallback + } + } + res = copy$$1; + } + } else if ( + handleAsObjectInI18nFormat && + typeof joinArrays === "string" && + resType === "[object Array]" + ) { + // array special treatment + res = res.join(joinArrays); + if (res) res = this.extendTranslation(res, keys, options); + } else { + // string, empty or null + var usedDefault = false; + var usedKey = false; // fallback value + if ( + !this.isValidLookup(res) && + options.defaultValue !== undefined + ) { + usedDefault = true; + if (options.count !== undefined) { + var suffix = this.pluralResolver.getSuffix( + lng, + options.count, + ); + res = options["defaultValue".concat(suffix)]; + } + if (!res) res = options.defaultValue; + } + if (!this.isValidLookup(res)) { + usedKey = true; + res = key; + } // save missing + + var updateMissing = + options.defaultValue && + options.defaultValue !== res && + this.options.updateMissing; + if (usedKey || usedDefault || updateMissing) { + this.logger.log( + updateMissing ? "updateKey" : "missingKey", + lng, + namespace, + key, + updateMissing ? options.defaultValue : res, + ); + var lngs = []; + var fallbackLngs = this.languageUtils.getFallbackCodes( + this.options.fallbackLng, + options.lng || this.language, + ); + if ( + this.options.saveMissingTo === "fallback" && + fallbackLngs && + fallbackLngs[0] + ) { + for (var i = 0; i < fallbackLngs.length; i++) { + lngs.push(fallbackLngs[i]); + } + } else if (this.options.saveMissingTo === "all") { + lngs = this.languageUtils.toResolveHierarchy( + options.lng || this.language, + ); + } else { + lngs.push(options.lng || this.language); + } + var send = function send(l, k) { + if (_this2.options.missingKeyHandler) { + _this2.options.missingKeyHandler( + l, + namespace, + k, + updateMissing ? options.defaultValue : res, + updateMissing, + options, + ); + } else if ( + _this2.backendConnector && + _this2.backendConnector.saveMissing + ) { + _this2.backendConnector.saveMissing( + l, + namespace, + k, + updateMissing ? options.defaultValue : res, + updateMissing, + options, + ); + } + _this2.emit("missingKey", l, namespace, k, res); + }; + if (this.options.saveMissing) { + var needsPluralHandling = + options.count !== undefined && + typeof options.count !== "string"; + if ( + this.options.saveMissingPlurals && + needsPluralHandling + ) { + lngs.forEach(function (l) { + var plurals = + _this2.pluralResolver.getPluralFormsOfKey( + l, + key, + ); + plurals.forEach(function (p) { + return send([l], p); + }); + }); + } else { + send(lngs, key); + } + } + } // extend + + res = this.extendTranslation( + res, + keys, + options, + resolved, + ); // append namespace if still key + if ( + usedKey && + res === key && + this.options.appendNamespaceToMissingKey + ) + res = "".concat(namespace, ":").concat(key); // parseMissingKeyHandler + if (usedKey && this.options.parseMissingKeyHandler) + res = this.options.parseMissingKeyHandler(res); + } // return + + return res; + }, + }, + { + key: "extendTranslation", + value: function extendTranslation( + res, + key, + options, + resolved, + ) { + var _this3 = this; + if (this.i18nFormat && this.i18nFormat.parse) { + res = this.i18nFormat.parse( + res, + options, + resolved.usedLng, + resolved.usedNS, + resolved.usedKey, + { + resolved: resolved, + }, + ); + } else if (!options.skipInterpolation) { + // i18next.parsing + if (options.interpolation) + this.interpolator.init( + _objectSpread({}, options, { + interpolation: _objectSpread( + {}, + this.options.interpolation, + options.interpolation, + ), + }), + ); // interpolate + var data = + options.replace && typeof options.replace !== "string" + ? options.replace + : options; + if (this.options.interpolation.defaultVariables) + data = _objectSpread( + {}, + this.options.interpolation.defaultVariables, + data, + ); + res = this.interpolator.interpolate( + res, + data, + options.lng || this.language, + options, + ); // nesting + if (options.nest !== false) + res = this.interpolator.nest( + res, + function () { + return _this3.translate.apply(_this3, arguments); + }, + options, + ); + if (options.interpolation) this.interpolator.reset(); + } // post process + + var postProcess = + options.postProcess || this.options.postProcess; + var postProcessorNames = + typeof postProcess === "string" + ? [postProcess] + : postProcess; + if ( + res !== undefined && + res !== null && + postProcessorNames && + postProcessorNames.length && + options.applyPostProcessor !== false + ) { + res = postProcessor.handle( + postProcessorNames, + res, + key, + this.options && this.options.postProcessPassResolved + ? _objectSpread( + { + i18nResolved: resolved, + }, + options, + ) + : options, + this, + ); + } + return res; + }, + }, + { + key: "resolve", + value: function resolve(keys) { + var _this4 = this; + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + var found; + var usedKey; // plain key + var exactUsedKey; // key with context / plural + var usedLng; + var usedNS; + if (typeof keys === "string") keys = [keys]; // forEach possible key + keys.forEach(function (k) { + if (_this4.isValidLookup(found)) return; + var extracted = _this4.extractFromKey(k, options); + var key = extracted.key; + usedKey = key; + var namespaces = extracted.namespaces; + if (_this4.options.fallbackNS) + namespaces = namespaces.concat( + _this4.options.fallbackNS, + ); + var needsPluralHandling = + options.count !== undefined && + typeof options.count !== "string"; + var needsContextHandling = + options.context !== undefined && + typeof options.context === "string" && + options.context !== ""; + var codes = options.lngs + ? options.lngs + : _this4.languageUtils.toResolveHierarchy( + options.lng || _this4.language, + options.fallbackLng, + ); + namespaces.forEach(function (ns) { + if (_this4.isValidLookup(found)) return; + usedNS = ns; + if ( + !checkedLoadedFor[ + "".concat(codes[0], "-").concat(ns) + ] && + _this4.utils && + _this4.utils.hasLoadedNamespace && + !_this4.utils.hasLoadedNamespace(usedNS) + ) { + checkedLoadedFor[ + "".concat(codes[0], "-").concat(ns) + ] = true; + _this4.logger.warn( + 'key "' + .concat(usedKey, '" for namespace "') + .concat(usedNS, '" for languages "') + .concat( + codes.join(", "), + "\" won't get resolved as namespace was not yet loaded", + ), + "This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!", + ); + } + codes.forEach(function (code) { + if (_this4.isValidLookup(found)) return; + usedLng = code; + var finalKey = key; + var finalKeys = [finalKey]; + if ( + _this4.i18nFormat && + _this4.i18nFormat.addLookupKeys + ) { + _this4.i18nFormat.addLookupKeys( + finalKeys, + key, + code, + ns, + options, + ); + } else { + var pluralSuffix; + if (needsPluralHandling) + pluralSuffix = _this4.pluralResolver.getSuffix( + code, + options.count, + ); // fallback for plural if context not found + if (needsPluralHandling && needsContextHandling) + finalKeys.push(finalKey + pluralSuffix); // get key for context if needed + if (needsContextHandling) + finalKeys.push( + (finalKey += "" + .concat(_this4.options.contextSeparator) + .concat(options.context)), + ); // get key for plural if needed + if (needsPluralHandling) + finalKeys.push((finalKey += pluralSuffix)); + } // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only + + var possibleKey; + /* eslint no-cond-assign: 0 */ + while ((possibleKey = finalKeys.pop())) { + if (!_this4.isValidLookup(found)) { + exactUsedKey = possibleKey; + found = _this4.getResource( + code, + ns, + possibleKey, + options, + ); + } + } + }); + }); + }); + return { + res: found, + usedKey: usedKey, + exactUsedKey: exactUsedKey, + usedLng: usedLng, + usedNS: usedNS, + }; + }, + }, + { + key: "isValidLookup", + value: function isValidLookup(res) { + return ( + res !== undefined && + !(!this.options.returnNull && res === null) && + !(!this.options.returnEmptyString && res === "") + ); + }, + }, + { + key: "getResource", + value: function getResource(code, ns, key) { + var options = + arguments.length > 3 && arguments[3] !== undefined + ? arguments[3] + : {}; + if (this.i18nFormat && this.i18nFormat.getResource) + return this.i18nFormat.getResource( + code, + ns, + key, + options, + ); + return this.resourceStore.getResource( + code, + ns, + key, + options, + ); + }, + }, + ]); + return Translator; + })(EventEmitter); + function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + } + var LanguageUtil = + /*#__PURE__*/ + (function () { + function LanguageUtil(options) { + _classCallCheck(this, LanguageUtil); + this.options = options; + this.whitelist = this.options.whitelist || false; + this.logger = baseLogger.create("languageUtils"); + } + _createClass(LanguageUtil, [ + { + key: "getScriptPartFromCode", + value: function getScriptPartFromCode(code) { + if (!code || code.indexOf("-") < 0) return null; + var p = code.split("-"); + if (p.length === 2) return null; + p.pop(); + return this.formatLanguageCode(p.join("-")); + }, + }, + { + key: "getLanguagePartFromCode", + value: function getLanguagePartFromCode(code) { + if (!code || code.indexOf("-") < 0) return code; + var p = code.split("-"); + return this.formatLanguageCode(p[0]); + }, + }, + { + key: "formatLanguageCode", + value: function formatLanguageCode(code) { + // http://www.iana.org/assignments/language-tags/language-tags.xhtml + if (typeof code === "string" && code.indexOf("-") > -1) { + var specialCases = [ + "hans", + "hant", + "latn", + "cyrl", + "cans", + "mong", + "arab", + ]; + var p = code.split("-"); + if (this.options.lowerCaseLng) { + p = p.map(function (part) { + return part.toLowerCase(); + }); + } else if (p.length === 2) { + p[0] = p[0].toLowerCase(); + p[1] = p[1].toUpperCase(); + if (specialCases.indexOf(p[1].toLowerCase()) > -1) + p[1] = capitalize(p[1].toLowerCase()); + } else if (p.length === 3) { + p[0] = p[0].toLowerCase(); // if lenght 2 guess it's a country + if (p[1].length === 2) p[1] = p[1].toUpperCase(); + if (p[0] !== "sgn" && p[2].length === 2) + p[2] = p[2].toUpperCase(); + if (specialCases.indexOf(p[1].toLowerCase()) > -1) + p[1] = capitalize(p[1].toLowerCase()); + if (specialCases.indexOf(p[2].toLowerCase()) > -1) + p[2] = capitalize(p[2].toLowerCase()); + } + return p.join("-"); + } + return this.options.cleanCode || this.options.lowerCaseLng + ? code.toLowerCase() + : code; + }, + }, + { + key: "isWhitelisted", + value: function isWhitelisted(code) { + if ( + this.options.load === "languageOnly" || + this.options.nonExplicitWhitelist + ) { + code = this.getLanguagePartFromCode(code); + } + return ( + !this.whitelist || + !this.whitelist.length || + this.whitelist.indexOf(code) > -1 + ); + }, + }, + { + key: "getFallbackCodes", + value: function getFallbackCodes(fallbacks, code) { + if (!fallbacks) return []; + if (typeof fallbacks === "string") fallbacks = [fallbacks]; + if ( + Object.prototype.toString.apply(fallbacks) === + "[object Array]" + ) + return fallbacks; + if (!code) return fallbacks["default"] || []; // asume we have an object defining fallbacks + var found = fallbacks[code]; + if (!found) + found = fallbacks[this.getScriptPartFromCode(code)]; + if (!found) + found = fallbacks[this.formatLanguageCode(code)]; + if (!found) found = fallbacks["default"]; + return found || []; + }, + }, + { + key: "toResolveHierarchy", + value: function toResolveHierarchy(code, fallbackCode) { + var _this = this; + var fallbackCodes = this.getFallbackCodes( + fallbackCode || this.options.fallbackLng || [], + code, + ); + var codes = []; + var addCode = function addCode(c) { + if (!c) return; + if (_this.isWhitelisted(c)) { + codes.push(c); + } else { + _this.logger.warn( + "rejecting non-whitelisted language code: ".concat(c), + ); + } + }; + if (typeof code === "string" && code.indexOf("-") > -1) { + if (this.options.load !== "languageOnly") + addCode(this.formatLanguageCode(code)); + if ( + this.options.load !== "languageOnly" && + this.options.load !== "currentOnly" + ) + addCode(this.getScriptPartFromCode(code)); + if (this.options.load !== "currentOnly") + addCode(this.getLanguagePartFromCode(code)); + } else if (typeof code === "string") { + addCode(this.formatLanguageCode(code)); + } + fallbackCodes.forEach(function (fc) { + if (codes.indexOf(fc) < 0) + addCode(_this.formatLanguageCode(fc)); + }); + return codes; + }, + }, + ]); + return LanguageUtil; + })(); + /* eslint-disable */ + var sets = [ + { + lngs: [ + "ach", + "ak", + "am", + "arn", + "br", + "fil", + "gun", + "ln", + "mfe", + "mg", + "mi", + "oc", + "pt", + "pt-BR", + "tg", + "ti", + "tr", + "uz", + "wa", + ], + nr: [1, 2], + fc: 1, + }, + { + lngs: [ + "af", + "an", + "ast", + "az", + "bg", + "bn", + "ca", + "da", + "de", + "dev", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fi", + "fo", + "fur", + "fy", + "gl", + "gu", + "ha", + "hi", + "hu", + "hy", + "ia", + "it", + "kn", + "ku", + "lb", + "mai", + "ml", + "mn", + "mr", + "nah", + "nap", + "nb", + "ne", + "nl", + "nn", + "no", + "nso", + "pa", + "pap", + "pms", + "ps", + "pt-PT", + "rm", + "sco", + "se", + "si", + "so", + "son", + "sq", + "sv", + "sw", + "ta", + "te", + "tk", + "ur", + "yo", + ], + nr: [1, 2], + fc: 2, + }, + { + lngs: [ + "ay", + "bo", + "cgg", + "fa", + "id", + "ja", + "jbo", + "ka", + "kk", + "km", + "ko", + "ky", + "lo", + "ms", + "sah", + "su", + "th", + "tt", + "ug", + "vi", + "wo", + "zh", + ], + nr: [1], + fc: 3, + }, + { + lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], + nr: [1, 2, 5], + fc: 4, + }, + { + lngs: ["ar"], + nr: [0, 1, 2, 3, 11, 100], + fc: 5, + }, + { + lngs: ["cs", "sk"], + nr: [1, 2, 5], + fc: 6, + }, + { + lngs: ["csb", "pl"], + nr: [1, 2, 5], + fc: 7, + }, + { + lngs: ["cy"], + nr: [1, 2, 3, 8], + fc: 8, + }, + { + lngs: ["fr"], + nr: [1, 2], + fc: 9, + }, + { + lngs: ["ga"], + nr: [1, 2, 3, 7, 11], + fc: 10, + }, + { + lngs: ["gd"], + nr: [1, 2, 3, 20], + fc: 11, + }, + { + lngs: ["is"], + nr: [1, 2], + fc: 12, + }, + { + lngs: ["jv"], + nr: [0, 1], + fc: 13, + }, + { + lngs: ["kw"], + nr: [1, 2, 3, 4], + fc: 14, + }, + { + lngs: ["lt"], + nr: [1, 2, 10], + fc: 15, + }, + { + lngs: ["lv"], + nr: [1, 2, 0], + fc: 16, + }, + { + lngs: ["mk"], + nr: [1, 2], + fc: 17, + }, + { + lngs: ["mnk"], + nr: [0, 1, 2], + fc: 18, + }, + { + lngs: ["mt"], + nr: [1, 2, 11, 20], + fc: 19, + }, + { + lngs: ["or"], + nr: [2, 1], + fc: 2, + }, + { + lngs: ["ro"], + nr: [1, 2, 20], + fc: 20, + }, + { + lngs: ["sl"], + nr: [5, 1, 2, 3], + fc: 21, + }, + { + lngs: ["he"], + nr: [1, 2, 20, 21], + fc: 22, + }, + ]; + var _rulesPluralsTypes = { + 1: function _(n) { + return Number(n > 1); + }, + 2: function _(n) { + return Number(n != 1); + }, + 3: function _(n) { + return 0; + }, + 4: function _(n) { + return Number( + n % 10 == 1 && n % 100 != 11 + ? 0 + : n % 10 >= 2 && + n % 10 <= 4 && + (n % 100 < 10 || n % 100 >= 20) + ? 1 + : 2, + ); + }, + 5: function _(n) { + return Number( + n === 0 + ? 0 + : n == 1 + ? 1 + : n == 2 + ? 2 + : n % 100 >= 3 && n % 100 <= 10 + ? 3 + : n % 100 >= 11 + ? 4 + : 5, + ); + }, + 6: function _(n) { + return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); + }, + 7: function _(n) { + return Number( + n == 1 + ? 0 + : n % 10 >= 2 && + n % 10 <= 4 && + (n % 100 < 10 || n % 100 >= 20) + ? 1 + : 2, + ); + }, + 8: function _(n) { + return Number( + n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3, + ); + }, + 9: function _(n) { + return Number(n >= 2); + }, + 10: function _(n) { + return Number( + n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4, + ); + }, + 11: function _(n) { + return Number( + n == 1 || n == 11 + ? 0 + : n == 2 || n == 12 + ? 1 + : n > 2 && n < 20 + ? 2 + : 3, + ); + }, + 12: function _(n) { + return Number(n % 10 != 1 || n % 100 == 11); + }, + 13: function _(n) { + return Number(n !== 0); + }, + 14: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); + }, + 15: function _(n) { + return Number( + n % 10 == 1 && n % 100 != 11 + ? 0 + : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) + ? 1 + : 2, + ); + }, + 16: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); + }, + 17: function _(n) { + return Number(n == 1 || n % 10 == 1 ? 0 : 1); + }, + 18: function _(n) { + return Number(n == 0 ? 0 : n == 1 ? 1 : 2); + }, + 19: function _(n) { + return Number( + n == 1 + ? 0 + : n === 0 || (n % 100 > 1 && n % 100 < 11) + ? 1 + : n % 100 > 10 && n % 100 < 20 + ? 2 + : 3, + ); + }, + 20: function _(n) { + return Number( + n == 1 ? 0 : n === 0 || (n % 100 > 0 && n % 100 < 20) ? 1 : 2, + ); + }, + 21: function _(n) { + return Number( + n % 100 == 1 + ? 1 + : n % 100 == 2 + ? 2 + : n % 100 == 3 || n % 100 == 4 + ? 3 + : 0, + ); + }, + 22: function _(n) { + return Number( + n === 1 + ? 0 + : n === 2 + ? 1 + : (n < 0 || n > 10) && n % 10 == 0 + ? 2 + : 3, + ); + }, + }; + /* eslint-enable */ + function createRules() { + var rules = {}; + sets.forEach(function (set) { + set.lngs.forEach(function (l) { + rules[l] = { + numbers: set.nr, + plurals: _rulesPluralsTypes[set.fc], + }; + }); + }); + return rules; + } + var PluralResolver = + /*#__PURE__*/ + (function () { + function PluralResolver(languageUtils) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + _classCallCheck(this, PluralResolver); + this.languageUtils = languageUtils; + this.options = options; + this.logger = baseLogger.create("pluralResolver"); + this.rules = createRules(); + } + _createClass(PluralResolver, [ + { + key: "addRule", + value: function addRule(lng, obj) { + this.rules[lng] = obj; + }, + }, + { + key: "getRule", + value: function getRule(code) { + return ( + this.rules[code] || + this.rules[ + this.languageUtils.getLanguagePartFromCode(code) + ] + ); + }, + }, + { + key: "needsPlural", + value: function needsPlural(code) { + var rule = this.getRule(code); + return rule && rule.numbers.length > 1; + }, + }, + { + key: "getPluralFormsOfKey", + value: function getPluralFormsOfKey(code, key) { + var _this = this; + var ret = []; + var rule = this.getRule(code); + if (!rule) return ret; + rule.numbers.forEach(function (n) { + var suffix = _this.getSuffix(code, n); + ret.push("".concat(key).concat(suffix)); + }); + return ret; + }, + }, + { + key: "getSuffix", + value: function getSuffix(code, count) { + var _this2 = this; + var rule = this.getRule(code); + if (rule) { + // if (rule.numbers.length === 1) return ''; // only singular + var idx = rule.noAbs + ? rule.plurals(count) + : rule.plurals(Math.abs(count)); + var suffix = rule.numbers[idx]; // special treatment for lngs only having singular and plural + if ( + this.options.simplifyPluralSuffix && + rule.numbers.length === 2 && + rule.numbers[0] === 1 + ) { + if (suffix === 2) { + suffix = "plural"; + } else if (suffix === 1) { + suffix = ""; + } + } + var returnSuffix = function returnSuffix() { + return _this2.options.prepend && suffix.toString() + ? _this2.options.prepend + suffix.toString() + : suffix.toString(); + }; // COMPATIBILITY JSON + // v1 + if (this.options.compatibilityJSON === "v1") { + if (suffix === 1) return ""; + if (typeof suffix === "number") + return "_plural_".concat(suffix.toString()); + return returnSuffix(); + } else if ( + /* v2 */ + this.options.compatibilityJSON === "v2" + ) { + return returnSuffix(); + } else if ( + /* v3 - gettext index */ + this.options.simplifyPluralSuffix && + rule.numbers.length === 2 && + rule.numbers[0] === 1 + ) { + return returnSuffix(); + } + return this.options.prepend && idx.toString() + ? this.options.prepend + idx.toString() + : idx.toString(); + } + this.logger.warn("no plural rule found for: ".concat(code)); + return ""; + }, + }, + ]); + return PluralResolver; + })(); + var Interpolator = + /*#__PURE__*/ + (function () { + function Interpolator() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + _classCallCheck(this, Interpolator); + this.logger = baseLogger.create("interpolator"); + this.options = options; + this.format = + (options.interpolation && options.interpolation.format) || + function (value) { + return value; + }; + this.init(options); + } /* eslint no-param-reassign: 0 */ + + _createClass(Interpolator, [ + { + key: "init", + value: function init() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + if (!options.interpolation) + options.interpolation = { + escapeValue: true, + }; + var iOpts = options.interpolation; + this.escape = + iOpts.escape !== undefined ? iOpts.escape : escape; + this.escapeValue = + iOpts.escapeValue !== undefined + ? iOpts.escapeValue + : true; + this.useRawValueToEscape = + iOpts.useRawValueToEscape !== undefined + ? iOpts.useRawValueToEscape + : false; + this.prefix = iOpts.prefix + ? regexEscape(iOpts.prefix) + : iOpts.prefixEscaped || "{{"; + this.suffix = iOpts.suffix + ? regexEscape(iOpts.suffix) + : iOpts.suffixEscaped || "}}"; + this.formatSeparator = iOpts.formatSeparator + ? iOpts.formatSeparator + : iOpts.formatSeparator || ","; + this.unescapePrefix = iOpts.unescapeSuffix + ? "" + : iOpts.unescapePrefix || "-"; + this.unescapeSuffix = this.unescapePrefix + ? "" + : iOpts.unescapeSuffix || ""; + this.nestingPrefix = iOpts.nestingPrefix + ? regexEscape(iOpts.nestingPrefix) + : iOpts.nestingPrefixEscaped || regexEscape("$t("); + this.nestingSuffix = iOpts.nestingSuffix + ? regexEscape(iOpts.nestingSuffix) + : iOpts.nestingSuffixEscaped || regexEscape(")"); + this.maxReplaces = iOpts.maxReplaces + ? iOpts.maxReplaces + : 1000; // the regexp + this.resetRegExp(); + }, + }, + { + key: "reset", + value: function reset() { + if (this.options) this.init(this.options); + }, + }, + { + key: "resetRegExp", + value: function resetRegExp() { + // the regexp + var regexpStr = "" + .concat(this.prefix, "(.+?)") + .concat(this.suffix); + this.regexp = new RegExp(regexpStr, "g"); + var regexpUnescapeStr = "" + .concat(this.prefix) + .concat(this.unescapePrefix, "(.+?)") + .concat(this.unescapeSuffix) + .concat(this.suffix); + this.regexpUnescape = new RegExp(regexpUnescapeStr, "g"); + var nestingRegexpStr = "" + .concat(this.nestingPrefix, "(.+?)") + .concat(this.nestingSuffix); + this.nestingRegexp = new RegExp(nestingRegexpStr, "g"); + }, + }, + { + key: "interpolate", + value: function interpolate(str, data, lng, options) { + var _this = this; + var match; + var value; + var replaces; + var defaultData = + (this.options && + this.options.interpolation && + this.options.interpolation.defaultVariables) || + {}; + function regexSafe(val) { + return val.replace(/\$/g, "$$$$"); + } + var handleFormat = function handleFormat(key) { + if (key.indexOf(_this.formatSeparator) < 0) { + return getPathWithDefaults(data, defaultData, key); + } + var p = key.split(_this.formatSeparator); + var k = p.shift().trim(); + var f = p.join(_this.formatSeparator).trim(); + return _this.format( + getPathWithDefaults(data, defaultData, k), + f, + lng, + ); + }; + this.resetRegExp(); + var missingInterpolationHandler = + (options && options.missingInterpolationHandler) || + this.options.missingInterpolationHandler; + replaces = 0; // unescape if has unescapePrefix/Suffix + /* eslint no-cond-assign: 0 */ + while ((match = this.regexpUnescape.exec(str))) { + value = handleFormat(match[1].trim()); + if (value === undefined) { + if (typeof missingInterpolationHandler === "function") { + var temp = missingInterpolationHandler( + str, + match, + options, + ); + value = typeof temp === "string" ? temp : ""; + } else { + this.logger.warn( + "missed to pass in variable " + .concat(match[1], " for interpolating ") + .concat(str), + ); + value = ""; + } + } else if ( + typeof value !== "string" && + !this.useRawValueToEscape + ) { + value = makeString(value); + } + str = str.replace(match[0], regexSafe(value)); + this.regexpUnescape.lastIndex = 0; + replaces++; + if (replaces >= this.maxReplaces) { + break; + } + } + replaces = 0; // regular escape on demand + while ((match = this.regexp.exec(str))) { + value = handleFormat(match[1].trim()); + if (value === undefined) { + if (typeof missingInterpolationHandler === "function") { + var _temp = missingInterpolationHandler( + str, + match, + options, + ); + value = typeof _temp === "string" ? _temp : ""; + } else { + this.logger.warn( + "missed to pass in variable " + .concat(match[1], " for interpolating ") + .concat(str), + ); + value = ""; + } + } else if ( + typeof value !== "string" && + !this.useRawValueToEscape + ) { + value = makeString(value); + } + value = this.escapeValue + ? regexSafe(this.escape(value)) + : regexSafe(value); + str = str.replace(match[0], value); + this.regexp.lastIndex = 0; + replaces++; + if (replaces >= this.maxReplaces) { + break; + } + } + return str; + }, + }, + { + key: "nest", + value: function nest(str, fc) { + var options = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : {}; + var match; + var value; + var clonedOptions = _objectSpread({}, options); + clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup + delete clonedOptions.defaultValue; // assert we do not get a endless loop on interpolating defaultValue again and again + // if value is something like "myKey": "lorem $(anotherKey, { "count": {{aValueInOptions}} })" + function handleHasOptions(key, inheritedOptions) { + if (key.indexOf(",") < 0) return key; + var p = key.split(","); + key = p.shift(); + var optionsString = p.join(","); + optionsString = this.interpolate( + optionsString, + clonedOptions, + ); + optionsString = optionsString.replace(/'/g, '"'); + try { + clonedOptions = JSON.parse(optionsString); + if (inheritedOptions) + clonedOptions = _objectSpread( + {}, + inheritedOptions, + clonedOptions, + ); + } catch (e) { + this.logger.error( + "failed parsing options string in nesting for key ".concat( + key, + ), + e, + ); + } // assert we do not get a endless loop on interpolating defaultValue again and again + + delete clonedOptions.defaultValue; + return key; + } // regular escape on demand + + while ((match = this.nestingRegexp.exec(str))) { + value = fc( + handleHasOptions.call( + this, + match[1].trim(), + clonedOptions, + ), + clonedOptions, + ); // is only the nesting key (key1 = '$(key2)') return the value without stringify + if ( + value && + match[0] === str && + typeof value !== "string" + ) + return value; // no string to include or empty + if (typeof value !== "string") value = makeString(value); + if (!value) { + this.logger.warn( + "missed to resolve " + .concat(match[1], " for nesting ") + .concat(str), + ); + value = ""; + } // Nested keys should not be escaped by default #854 + // value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value); + + str = str.replace(match[0], value); + this.regexp.lastIndex = 0; + } + return str; + }, + }, + ]); + return Interpolator; + })(); + function remove(arr, what) { + var found = arr.indexOf(what); + while (found !== -1) { + arr.splice(found, 1); + found = arr.indexOf(what); + } + } + var Connector = + /*#__PURE__*/ + (function (_EventEmitter) { + _inherits(Connector, _EventEmitter); + function Connector(backend, store, services) { + var _this; + var options = + arguments.length > 3 && arguments[3] !== undefined + ? arguments[3] + : {}; + _classCallCheck(this, Connector); + _this = _possibleConstructorReturn( + this, + _getPrototypeOf(Connector).call(this), + ); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + _this.backend = backend; + _this.store = store; + _this.services = services; + _this.languageUtils = services.languageUtils; + _this.options = options; + _this.logger = baseLogger.create("backendConnector"); + _this.state = {}; + _this.queue = []; + if (_this.backend && _this.backend.init) { + _this.backend.init(services, options.backend, options); + } + return _this; + } + _createClass(Connector, [ + { + key: "queueLoad", + value: function queueLoad( + languages, + namespaces, + options, + callback, + ) { + var _this2 = this; + // find what needs to be loaded + var toLoad = []; + var pending = []; + var toLoadLanguages = []; + var toLoadNamespaces = []; + languages.forEach(function (lng) { + var hasAllNamespaces = true; + namespaces.forEach(function (ns) { + var name = "".concat(lng, "|").concat(ns); + if ( + !options.reload && + _this2.store.hasResourceBundle(lng, ns) + ) { + _this2.state[name] = 2; // loaded + } else if (_this2.state[name] < 0); + else if (_this2.state[name] === 1) { + if (pending.indexOf(name) < 0) pending.push(name); + } else { + _this2.state[name] = 1; // pending + hasAllNamespaces = false; + if (pending.indexOf(name) < 0) pending.push(name); + if (toLoad.indexOf(name) < 0) toLoad.push(name); + if (toLoadNamespaces.indexOf(ns) < 0) + toLoadNamespaces.push(ns); + } + }); + if (!hasAllNamespaces) toLoadLanguages.push(lng); + }); + if (toLoad.length || pending.length) { + this.queue.push({ + pending: pending, + loaded: {}, + errors: [], + callback: callback, + }); + } + return { + toLoad: toLoad, + pending: pending, + toLoadLanguages: toLoadLanguages, + toLoadNamespaces: toLoadNamespaces, + }; + }, + }, + { + key: "loaded", + value: function loaded(name, err, data) { + var _name$split = name.split("|"), + _name$split2 = _slicedToArray(_name$split, 2), + lng = _name$split2[0], + ns = _name$split2[1]; + if (err) this.emit("failedLoading", lng, ns, err); + if (data) { + this.store.addResourceBundle(lng, ns, data); + } // set loaded + + this.state[name] = err ? -1 : 2; // consolidated loading done in this run - only emit once for a loaded namespace + var loaded = {}; // callback if ready + this.queue.forEach(function (q) { + pushPath(q.loaded, [lng], ns); + remove(q.pending, name); + if (err) q.errors.push(err); + if (q.pending.length === 0 && !q.done) { + // only do once per loaded -> this.emit('loaded', q.loaded); + Object.keys(q.loaded).forEach(function (l) { + if (!loaded[l]) loaded[l] = []; + if (q.loaded[l].length) { + q.loaded[l].forEach(function (ns) { + if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns); + }); + } + }); + /* eslint no-param-reassign: 0 */ + q.done = true; + if (q.errors.length) { + q.callback(q.errors); + } else { + q.callback(); + } + } + }); // emit consolidated loaded event + this.emit("loaded", loaded); // remove done load requests + this.queue = this.queue.filter(function (q) { + return !q.done; + }); + }, + }, + { + key: "read", + value: function read(lng, ns, fcName) { + var _this3 = this; + var tried = + arguments.length > 3 && arguments[3] !== undefined + ? arguments[3] + : 0; + var wait = + arguments.length > 4 && arguments[4] !== undefined + ? arguments[4] + : 250; + var callback = + arguments.length > 5 ? arguments[5] : undefined; + if (!lng.length) return callback(null, {}); // noting to load + return this.backend[fcName](lng, ns, function (err, data) { + if (err && data /* = retryFlag */ && tried < 5) { + setTimeout(function () { + _this3.read.call( + _this3, + lng, + ns, + fcName, + tried + 1, + wait * 2, + callback, + ); + }, wait); + return; + } + callback(err, data); + }); + } /* eslint consistent-return: 0 */, + }, + { + key: "prepareLoading", + value: function prepareLoading(languages, namespaces) { + var _this4 = this; + var options = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : {}; + var callback = + arguments.length > 3 ? arguments[3] : undefined; + if (!this.backend) { + this.logger.warn( + "No backend was added via i18next.use. Will not load resources.", + ); + return callback && callback(); + } + if (typeof languages === "string") + languages = + this.languageUtils.toResolveHierarchy(languages); + if (typeof namespaces === "string") + namespaces = [namespaces]; + var toLoad = this.queueLoad( + languages, + namespaces, + options, + callback, + ); + if (!toLoad.toLoad.length) { + if (!toLoad.pending.length) callback(); // nothing to load and no pendings...callback now + return null; // pendings will trigger callback + } + toLoad.toLoad.forEach(function (name) { + _this4.loadOne(name); + }); + }, + }, + { + key: "load", + value: function load(languages, namespaces, callback) { + this.prepareLoading(languages, namespaces, {}, callback); + }, + }, + { + key: "reload", + value: function reload(languages, namespaces, callback) { + this.prepareLoading( + languages, + namespaces, + { + reload: true, + }, + callback, + ); + }, + }, + { + key: "loadOne", + value: function loadOne(name) { + var _this5 = this; + var prefix = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : ""; + var _name$split3 = name.split("|"), + _name$split4 = _slicedToArray(_name$split3, 2), + lng = _name$split4[0], + ns = _name$split4[1]; + this.read( + lng, + ns, + "read", + null, + null, + function (err, data) { + if (err) + _this5.logger.warn( + "" + .concat(prefix, "loading namespace ") + .concat(ns, " for language ") + .concat(lng, " failed"), + err, + ); + if (!err && data) + _this5.logger.log( + "" + .concat(prefix, "loaded namespace ") + .concat(ns, " for language ") + .concat(lng), + data, + ); + _this5.loaded(name, err, data); + }, + ); + }, + }, + { + key: "saveMissing", + value: function saveMissing( + languages, + namespace, + key, + fallbackValue, + isUpdate, + ) { + var options = + arguments.length > 5 && arguments[5] !== undefined + ? arguments[5] + : {}; + if ( + this.services.utils && + this.services.utils.hasLoadedNamespace && + !this.services.utils.hasLoadedNamespace(namespace) + ) { + this.logger.warn( + 'did not save key "' + .concat(key, '" for namespace "') + .concat( + namespace, + '" as the namespace was not yet loaded', + ), + "This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!", + ); + return; + } // ignore non valid keys + + if (key === undefined || key === null || key === "") return; + if (this.backend && this.backend.create) { + this.backend.create( + languages, + namespace, + key, + fallbackValue, + null /* unused callback */, + _objectSpread({}, options, { + isUpdate: isUpdate, + }), + ); + } // write to store to avoid resending + + if (!languages || !languages[0]) return; + this.store.addResource( + languages[0], + namespace, + key, + fallbackValue, + ); + }, + }, + ]); + return Connector; + })(EventEmitter); + function get() { + return { + debug: false, + initImmediate: true, + ns: ["translation"], + defaultNS: ["translation"], + fallbackLng: ["dev"], + fallbackNS: false, + // string or array of namespaces + whitelist: false, + // array with whitelisted languages + nonExplicitWhitelist: false, + load: "all", + // | currentOnly | languageOnly + preload: false, + // array with preload languages + simplifyPluralSuffix: true, + keySeparator: ".", + nsSeparator: ":", + pluralSeparator: "_", + contextSeparator: "_", + partialBundledLanguages: false, + // allow bundling certain languages that are not remotely fetched + saveMissing: false, + // enable to send missing values + updateMissing: false, + // enable to update default values if different from translated value (only useful on initial development, or when keeping code as source of truth) + saveMissingTo: "fallback", + // 'current' || 'all' + saveMissingPlurals: true, + // will save all forms not only singular key + missingKeyHandler: false, + // function(lng, ns, key, fallbackValue) -> override if prefer on handling + missingInterpolationHandler: false, + // function(str, match) + postProcess: false, + // string or array of postProcessor names + postProcessPassResolved: false, + // pass resolved object into 'options.i18nResolved' for postprocessor + returnNull: true, + // allows null value as valid translation + returnEmptyString: true, + // allows empty string value as valid translation + returnObjects: false, + joinArrays: false, + // or string to join array + returnedObjectHandler: false, + // function(key, value, options) triggered if key returns object but returnObjects is set to false + parseMissingKeyHandler: false, + // function(key) parsed a key that was not found in t() before returning + appendNamespaceToMissingKey: false, + appendNamespaceToCIMode: false, + overloadTranslationOptionHandler: function handle(args) { + var ret = {}; + if (_typeof(args[1]) === "object") ret = args[1]; + if (typeof args[1] === "string") ret.defaultValue = args[1]; + if (typeof args[2] === "string") ret.tDescription = args[2]; + if ( + _typeof(args[2]) === "object" || + _typeof(args[3]) === "object" + ) { + var options = args[3] || args[2]; + Object.keys(options).forEach(function (key) { + ret[key] = options[key]; + }); + } + return ret; + }, + interpolation: { + escapeValue: true, + format: function format(value, _format, lng) { + return value; + }, + prefix: "{{", + suffix: "}}", + formatSeparator: ",", + // prefixEscaped: '{{', + // suffixEscaped: '}}', + // unescapeSuffix: '', + unescapePrefix: "-", + nestingPrefix: "$t(", + nestingSuffix: ")", + // nestingPrefixEscaped: '$t(', + // nestingSuffixEscaped: ')', + // defaultVariables: undefined // object that can have values to interpolate on - extends passed in interpolation data + maxReplaces: 1000, // max replaces to prevent endless loop + }, + }; + } /* eslint no-param-reassign: 0 */ + + function transformOptions(options) { + // create namespace object if namespace is passed in as string + if (typeof options.ns === "string") options.ns = [options.ns]; + if (typeof options.fallbackLng === "string") + options.fallbackLng = [options.fallbackLng]; + if (typeof options.fallbackNS === "string") + options.fallbackNS = [options.fallbackNS]; // extend whitelist with cimode + if (options.whitelist && options.whitelist.indexOf("cimode") < 0) { + options.whitelist = options.whitelist.concat(["cimode"]); + } + return options; + } + function noop() {} + var I18n = + /*#__PURE__*/ + (function (_EventEmitter) { + _inherits(I18n, _EventEmitter); + function I18n() { + var _this; + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + var callback = arguments.length > 1 ? arguments[1] : undefined; + _classCallCheck(this, I18n); + _this = _possibleConstructorReturn( + this, + _getPrototypeOf(I18n).call(this), + ); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + _this.options = transformOptions(options); + _this.services = {}; + _this.logger = baseLogger; + _this.modules = { + external: [], + }; + if (callback && !_this.isInitialized && !options.isClone) { + // https://github.com/i18next/i18next/issues/879 + if (!_this.options.initImmediate) { + _this.init(options, callback); + return _possibleConstructorReturn( + _this, + _assertThisInitialized(_this), + ); + } + setTimeout(function () { + _this.init(options, callback); + }, 0); + } + return _this; + } + _createClass(I18n, [ + { + key: "init", + value: function init() { + var _this2 = this; + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + var callback = + arguments.length > 1 ? arguments[1] : undefined; + if (typeof options === "function") { + callback = options; + options = {}; + } + this.options = _objectSpread( + {}, + get(), + this.options, + transformOptions(options), + ); + this.format = this.options.interpolation.format; + if (!callback) callback = noop; + function createClassOnDemand(ClassOrObject) { + if (!ClassOrObject) return null; + if (typeof ClassOrObject === "function") + return new ClassOrObject(); + return ClassOrObject; + } // init services + + if (!this.options.isClone) { + if (this.modules.logger) { + baseLogger.init( + createClassOnDemand(this.modules.logger), + this.options, + ); + } else { + baseLogger.init(null, this.options); + } + var lu = new LanguageUtil(this.options); + this.store = new ResourceStore( + this.options.resources, + this.options, + ); + var s = this.services; + s.logger = baseLogger; + s.resourceStore = this.store; + s.languageUtils = lu; + s.pluralResolver = new PluralResolver(lu, { + prepend: this.options.pluralSeparator, + compatibilityJSON: this.options.compatibilityJSON, + simplifyPluralSuffix: this.options.simplifyPluralSuffix, + }); + s.interpolator = new Interpolator(this.options); + s.utils = { + hasLoadedNamespace: this.hasLoadedNamespace.bind(this), + }; + s.backendConnector = new Connector( + createClassOnDemand(this.modules.backend), + s.resourceStore, + s, + this.options, + ); // pipe events from backendConnector + s.backendConnector.on("*", function (event) { + for ( + var _len = arguments.length, + args = new Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + _this2.emit.apply(_this2, [event].concat(args)); + }); + if (this.modules.languageDetector) { + s.languageDetector = createClassOnDemand( + this.modules.languageDetector, + ); + s.languageDetector.init( + s, + this.options.detection, + this.options, + ); + } + if (this.modules.i18nFormat) { + s.i18nFormat = createClassOnDemand( + this.modules.i18nFormat, + ); + if (s.i18nFormat.init) s.i18nFormat.init(this); + } + this.translator = new Translator( + this.services, + this.options, + ); // pipe events from translator + this.translator.on("*", function (event) { + for ( + var _len2 = arguments.length, + args = new Array(_len2 > 1 ? _len2 - 1 : 0), + _key2 = 1; + _key2 < _len2; + _key2++ + ) { + args[_key2 - 1] = arguments[_key2]; + } + _this2.emit.apply(_this2, [event].concat(args)); + }); + this.modules.external.forEach(function (m) { + if (m.init) m.init(_this2); + }); + } // append api + + var storeApi = [ + "getResource", + "addResource", + "addResources", + "addResourceBundle", + "removeResourceBundle", + "hasResourceBundle", + "getResourceBundle", + "getDataByLanguage", + ]; + storeApi.forEach(function (fcName) { + _this2[fcName] = function () { + var _this2$store; + return (_this2$store = _this2.store)[fcName].apply( + _this2$store, + arguments, + ); + }; + }); + var deferred = defer(); + var load = function load() { + _this2.changeLanguage( + _this2.options.lng, + function (err, t) { + _this2.isInitialized = true; + _this2.logger.log("initialized", _this2.options); + _this2.emit("initialized", _this2.options); + deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning) + callback(err, t); + }, + ); + }; + if (this.options.resources || !this.options.initImmediate) { + load(); + } else { + setTimeout(load, 0); + } + return deferred; + } /* eslint consistent-return: 0 */, + }, + { + key: "loadResources", + value: function loadResources(language) { + var _this3 = this; + var callback = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : noop; + var usedCallback = callback; + var usedLng = + typeof language === "string" ? language : this.language; + if (typeof language === "function") usedCallback = language; + if ( + !this.options.resources || + this.options.partialBundledLanguages + ) { + if (usedLng && usedLng.toLowerCase() === "cimode") + return usedCallback(); // avoid loading resources for cimode + var toLoad = []; + var append = function append(lng) { + if (!lng) return; + var lngs = + _this3.services.languageUtils.toResolveHierarchy(lng); + lngs.forEach(function (l) { + if (toLoad.indexOf(l) < 0) toLoad.push(l); + }); + }; + if (!usedLng) { + // at least load fallbacks in this case + var fallbacks = + this.services.languageUtils.getFallbackCodes( + this.options.fallbackLng, + ); + fallbacks.forEach(function (l) { + return append(l); + }); + } else { + append(usedLng); + } + if (this.options.preload) { + this.options.preload.forEach(function (l) { + return append(l); + }); + } + this.services.backendConnector.load( + toLoad, + this.options.ns, + usedCallback, + ); + } else { + usedCallback(null); + } + }, + }, + { + key: "reloadResources", + value: function reloadResources(lngs, ns, callback) { + var deferred = defer(); + if (!lngs) lngs = this.languages; + if (!ns) ns = this.options.ns; + if (!callback) callback = noop; + this.services.backendConnector.reload( + lngs, + ns, + function (err) { + deferred.resolve(); // not rejecting on err (as err is only a loading translation failed warning) + callback(err); + }, + ); + return deferred; + }, + }, + { + key: "use", + value: function use(module) { + if (module.type === "backend") { + this.modules.backend = module; + } + if ( + module.type === "logger" || + (module.log && module.warn && module.error) + ) { + this.modules.logger = module; + } + if (module.type === "languageDetector") { + this.modules.languageDetector = module; + } + if (module.type === "i18nFormat") { + this.modules.i18nFormat = module; + } + if (module.type === "postProcessor") { + postProcessor.addPostProcessor(module); + } + if (module.type === "3rdParty") { + this.modules.external.push(module); + } + return this; + }, + }, + { + key: "changeLanguage", + value: function changeLanguage(lng, callback) { + var _this4 = this; + this.isLanguageChangingTo = lng; + var deferred = defer(); + this.emit("languageChanging", lng); + var done = function done(err, l) { + if (l) { + _this4.language = l; + _this4.languages = + _this4.services.languageUtils.toResolveHierarchy(l); + _this4.translator.changeLanguage(l); + _this4.isLanguageChangingTo = undefined; + _this4.emit("languageChanged", l); + _this4.logger.log("languageChanged", l); + } else { + _this4.isLanguageChangingTo = undefined; + } + deferred.resolve(function () { + return _this4.t.apply(_this4, arguments); + }); + if (callback) + callback(err, function () { + return _this4.t.apply(_this4, arguments); + }); + }; + var setLng = function setLng(l) { + if (l) { + if (!_this4.language) { + _this4.language = l; + _this4.languages = + _this4.services.languageUtils.toResolveHierarchy(l); + } + if (!_this4.translator.language) + _this4.translator.changeLanguage(l); + if (_this4.services.languageDetector) + _this4.services.languageDetector.cacheUserLanguage(l); + } + _this4.loadResources(l, function (err) { + done(err, l); + }); + }; + if ( + !lng && + this.services.languageDetector && + !this.services.languageDetector.async + ) { + setLng(this.services.languageDetector.detect()); + } else if ( + !lng && + this.services.languageDetector && + this.services.languageDetector.async + ) { + this.services.languageDetector.detect(setLng); + } else { + setLng(lng); + } + return deferred; + }, + }, + { + key: "getFixedT", + value: function getFixedT(lng, ns) { + var _this5 = this; + var fixedT = function fixedT(key, opts) { + var options; + if (_typeof(opts) !== "object") { + for ( + var _len3 = arguments.length, + rest = new Array(_len3 > 2 ? _len3 - 2 : 0), + _key3 = 2; + _key3 < _len3; + _key3++ + ) { + rest[_key3 - 2] = arguments[_key3]; + } + options = + _this5.options.overloadTranslationOptionHandler( + [key, opts].concat(rest), + ); + } else { + options = _objectSpread({}, opts); + } + options.lng = options.lng || fixedT.lng; + options.lngs = options.lngs || fixedT.lngs; + options.ns = options.ns || fixedT.ns; + return _this5.t(key, options); + }; + if (typeof lng === "string") { + fixedT.lng = lng; + } else { + fixedT.lngs = lng; + } + fixedT.ns = ns; + return fixedT; + }, + }, + { + key: "t", + value: function t() { + var _this$translator; + return ( + this.translator && + (_this$translator = this.translator).translate.apply( + _this$translator, + arguments, + ) + ); + }, + }, + { + key: "exists", + value: function exists() { + var _this$translator2; + return ( + this.translator && + (_this$translator2 = this.translator).exists.apply( + _this$translator2, + arguments, + ) + ); + }, + }, + { + key: "setDefaultNamespace", + value: function setDefaultNamespace(ns) { + this.options.defaultNS = ns; + }, + }, + { + key: "hasLoadedNamespace", + value: function hasLoadedNamespace(ns) { + var _this6 = this; + if (!this.isInitialized) { + this.logger.warn( + "hasLoadedNamespace: i18next was not initialized", + this.languages, + ); + return false; + } + if (!this.languages || !this.languages.length) { + this.logger.warn( + "hasLoadedNamespace: i18n.languages were undefined or empty", + this.languages, + ); + return false; + } + var lng = this.languages[0]; + var fallbackLng = this.options + ? this.options.fallbackLng + : false; + var lastLng = this.languages[this.languages.length - 1]; // we're in cimode so this shall pass + if (lng.toLowerCase() === "cimode") return true; + var loadNotPending = function loadNotPending(l, n) { + var loadState = + _this6.services.backendConnector.state[ + "".concat(l, "|").concat(n) + ]; + return loadState === -1 || loadState === 2; + }; // loaded -> SUCCESS + if (this.hasResourceBundle(lng, ns)) return true; // were not loading at all -> SEMI SUCCESS + if (!this.services.backendConnector.backend) return true; // failed loading ns - but at least fallback is not pending -> SEMI SUCCESS + if ( + loadNotPending(lng, ns) && + (!fallbackLng || loadNotPending(lastLng, ns)) + ) + return true; + return false; + }, + }, + { + key: "loadNamespaces", + value: function loadNamespaces(ns, callback) { + var _this7 = this; + var deferred = defer(); + if (!this.options.ns) { + callback && callback(); + return Promise.resolve(); + } + if (typeof ns === "string") ns = [ns]; + ns.forEach(function (n) { + if (_this7.options.ns.indexOf(n) < 0) + _this7.options.ns.push(n); + }); + this.loadResources(function (err) { + deferred.resolve(); + if (callback) callback(err); + }); + return deferred; + }, + }, + { + key: "loadLanguages", + value: function loadLanguages(lngs, callback) { + var deferred = defer(); + if (typeof lngs === "string") lngs = [lngs]; + var preloaded = this.options.preload || []; + var newLngs = lngs.filter(function (lng) { + return preloaded.indexOf(lng) < 0; + }); // Exit early if all given languages are already preloaded + if (!newLngs.length) { + if (callback) callback(); + return Promise.resolve(); + } + this.options.preload = preloaded.concat(newLngs); + this.loadResources(function (err) { + deferred.resolve(); + if (callback) callback(err); + }); + return deferred; + }, + }, + { + key: "dir", + value: function dir(lng) { + if (!lng) + lng = + this.languages && this.languages.length > 0 + ? this.languages[0] + : this.language; + if (!lng) return "rtl"; + var rtlLngs = [ + "ar", + "shu", + "sqr", + "ssh", + "xaa", + "yhd", + "yud", + "aao", + "abh", + "abv", + "acm", + "acq", + "acw", + "acx", + "acy", + "adf", + "ads", + "aeb", + "aec", + "afb", + "ajp", + "apc", + "apd", + "arb", + "arq", + "ars", + "ary", + "arz", + "auz", + "avl", + "ayh", + "ayl", + "ayn", + "ayp", + "bbz", + "pga", + "he", + "iw", + "ps", + "pbt", + "pbu", + "pst", + "prp", + "prd", + "ur", + "ydd", + "yds", + "yih", + "ji", + "yi", + "hbo", + "men", + "xmn", + "fa", + "jpr", + "peo", + "pes", + "prs", + "dv", + "sam", + ]; + return rtlLngs.indexOf( + this.services.languageUtils.getLanguagePartFromCode(lng), + ) >= 0 + ? "rtl" + : "ltr"; + } /* eslint class-methods-use-this: 0 */, + }, + { + key: "createInstance", + value: function createInstance() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + var callback = + arguments.length > 1 ? arguments[1] : undefined; + return new I18n(options, callback); + }, + }, + { + key: "cloneInstance", + value: function cloneInstance() { + var _this8 = this; + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + var callback = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : noop; + var mergedOptions = _objectSpread( + {}, + this.options, + options, + { + isClone: true, + }, + ); + var clone = new I18n(mergedOptions); + var membersToCopy = ["store", "services", "language"]; + membersToCopy.forEach(function (m) { + clone[m] = _this8[m]; + }); + clone.translator = new Translator( + clone.services, + clone.options, + ); + clone.translator.on("*", function (event) { + for ( + var _len4 = arguments.length, + args = new Array(_len4 > 1 ? _len4 - 1 : 0), + _key4 = 1; + _key4 < _len4; + _key4++ + ) { + args[_key4 - 1] = arguments[_key4]; + } + clone.emit.apply(clone, [event].concat(args)); + }); + clone.init(mergedOptions, callback); + clone.translator.options = clone.options; // sync options + return clone; + }, + }, + ]); + return I18n; + })(EventEmitter); + var i18next = new I18n(); + module.exports = i18next; + }, + { + "@babel/runtime/helpers/assertThisInitialized": 4, + "@babel/runtime/helpers/classCallCheck": 5, + "@babel/runtime/helpers/createClass": 6, + "@babel/runtime/helpers/getPrototypeOf": 8, + "@babel/runtime/helpers/inherits": 9, + "@babel/runtime/helpers/objectSpread": 14, + "@babel/runtime/helpers/possibleConstructorReturn": 15, + "@babel/runtime/helpers/slicedToArray": 17, + "@babel/runtime/helpers/toConsumableArray": 18, + "@babel/runtime/helpers/typeof": 19, + }, + ], + 268: [ + function (_dereq_, module, exports) { + exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & ((1 << -nBits) - 1); + s >>= -nBits; + nBits += eLen; + for ( + ; + nBits > 0; + e = e * 256 + buffer[offset + i], i += d, nBits -= 8 + ) {} + m = e & ((1 << -nBits) - 1); + e >>= -nBits; + nBits += mLen; + for ( + ; + nBits > 0; + m = m * 256 + buffer[offset + i], i += d, nBits -= 8 + ) {} + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for ( + ; + mLen >= 8; + buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8 + ) {} + e = (e << mLen) | m; + eLen += mLen; + for ( + ; + eLen > 0; + buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8 + ) {} + buffer[offset + i - d] |= s * 128; + }; + }, + {}, + ], + 269: [ + function (_dereq_, module, exports) { + /* - freeBuffers(this.retainedMode.buffers.stroke); - freeBuffers(this.retainedMode.buffers.fill); - }; - /** - * creates a buffers object that holds the WebGL render buffers - * for a geometry. - * @private - * @param {String} gId key of the geometry object - * @param {p5.Geometry} model contains geometry data - */ - _main.default.RendererGL.prototype.createBuffers = function (gId, model) { - var gl = this.GL; - //initialize the gl buffers for our geom groups - var buffers = this._initBufferDefaults(gId); - buffers.model = model; - var indexBuffer = buffers.indexBuffer; - if (model.faces.length) { - // allocate space for faces - if (!indexBuffer) indexBuffer = buffers.indexBuffer = gl.createBuffer(); - var vals = _main.default.RendererGL.prototype._flatten(model.faces); - // If any face references a vertex with an index greater than the maximum - // un-singed 16 bit integer, then we need to use a Uint32Array instead of a - // Uint16Array - var hasVertexIndicesOverMaxUInt16 = vals.some(function (v) { - return v > 65535; - }); - var type = hasVertexIndicesOverMaxUInt16 ? Uint32Array : Uint16Array; - this._bindBuffer(indexBuffer, gl.ELEMENT_ARRAY_BUFFER, vals, type); - // If we're using a Uint32Array for our indexBuffer we will need to pass a - // different enum value to WebGL draw triangles. This happens in - // the _drawElements function. - buffers.indexBufferType = hasVertexIndicesOverMaxUInt16 ? gl.UNSIGNED_INT : gl.UNSIGNED_SHORT; - // the vertex count is based on the number of faces - buffers.vertexCount = model.faces.length * 3; - } else { - // the index buffer is unused, remove it - if (indexBuffer) { - gl.deleteBuffer(indexBuffer); - buffers.indexBuffer = null; - } // the vertex count comes directly from the model + Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. + Copyright 2015, Google Inc. All Rights Reserved. - buffers.vertexCount = model.vertices ? model.vertices.length : 0; - } - buffers.lineVertexCount = model.lineVertices ? model.lineVertices.length / 3 : 0; - return buffers; - }; - /** - * Draws buffers given a geometry key ID - * @private - * @param {String} gId ID in our geom hash - * @chainable - */ - _main.default.RendererGL.prototype.drawBuffers = function (gId) { - var gl = this.GL; - var geometry = this.retainedMode.geometry[gId]; - if (!this.geometryBuilder && this._doFill && this.retainedMode.geometry[gId].vertexCount > 0) { - this._useVertexColor = geometry.model.vertexColors.length > 0; - var fillShader = this._getRetainedFillShader(); - this._setFillUniforms(fillShader); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = this.retainedMode.buffers.fill[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var buff = _step2.value; - buff._prepareBuffer(geometry, fillShader); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } + 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 including the dates of first publication and + either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ + 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 + SILICON GRAPHICS, INC. 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. + + Original Code. The Original Code is: OpenGL Sample Implementation, + Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, + Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. + Copyright in any portions created by third parties is as indicated + elsewhere herein. All Rights Reserved. +*/ + "use strict"; + var n; + function t(a, b) { + return a.b === b.b && a.a === b.a; + } + function u(a, b) { + return a.b < b.b || (a.b === b.b && a.a <= b.a); + } + function v(a, b, c) { + var d = b.b - a.b, + e = c.b - b.b; + return 0 < d + e + ? d < e + ? b.a - a.a + (d / (d + e)) * (a.a - c.a) + : b.a - c.a + (e / (d + e)) * (c.a - a.a) + : 0; + } + function x(a, b, c) { + var d = b.b - a.b, + e = c.b - b.b; + return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0; + } + function z(a, b) { + return a.a < b.a || (a.a === b.a && a.b <= b.b); + } + function aa(a, b, c) { + var d = b.a - a.a, + e = c.a - b.a; + return 0 < d + e + ? d < e + ? b.b - a.b + (d / (d + e)) * (a.b - c.b) + : b.b - c.b + (e / (d + e)) * (c.b - a.b) + : 0; + } + function ba(a, b, c) { + var d = b.a - a.a, + e = c.a - b.a; + return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0; + } + function ca(a) { + return u(a.b.a, a.a); + } + function da(a) { + return u(a.a, a.b.a); + } + function A(a, b, c, d) { + a = 0 > a ? 0 : a; + c = 0 > c ? 0 : c; + return a <= c + ? 0 === c + ? (b + d) / 2 + : b + (a / (a + c)) * (d - b) + : d + (c / (a + c)) * (b - d); + } + function ea(a) { + var b = B(a.b); + C(b, a.c); + C(b.b, a.c); + D(b, a.a); + return b; + } + function E(a, b) { + var c = !1, + d = !1; + a !== b && + (b.a !== a.a && ((d = !0), F(b.a, a.a)), + b.d !== a.d && ((c = !0), G(b.d, a.d)), + H(b, a), + d || (C(b, a.a), (a.a.c = a)), + c || (D(b, a.d), (a.d.a = a))); + } + function I(a) { + var b = a.b, + c = !1; + a.d !== a.b.d && ((c = !0), G(a.d, a.b.d)); + a.c === a + ? F(a.a, null) + : ((a.b.d.a = J(a)), (a.a.c = a.c), H(a, J(a)), c || D(a, a.d)); + b.c === b + ? (F(b.a, null), G(b.d, null)) + : ((a.d.a = J(b)), (b.a.c = b.c), H(b, J(b))); + fa(a); + } + function K(a) { + var b = B(a), + c = b.b; + H(b, a.e); + b.a = a.b.a; + C(c, b.a); + b.d = c.d = a.d; + b = b.b; + H(a.b, J(a.b)); + H(a.b, b); + a.b.a = b.a; + b.b.a.c = b.b; + b.b.d = a.b.d; + b.f = a.f; + b.b.f = a.b.f; + return b; + } + function L(a, b) { + var c = !1, + d = B(a), + e = d.b; + b.d !== a.d && ((c = !0), G(b.d, a.d)); + H(d, a.e); + H(e, b); + d.a = a.b.a; + e.a = b.a; + d.d = e.d = a.d; + a.d.a = e; + c || D(d, a.d); + return d; + } + function B(a) { + var b = new M(), + c = new M(), + d = a.b.h; + c.h = d; + d.b.h = b; + b.h = a; + a.b.h = c; + b.b = c; + b.c = b; + b.e = c; + c.b = b; + c.c = c; + return (c.e = b); + } + function H(a, b) { + var c = a.c, + d = b.c; + c.b.e = b; + d.b.e = a; + a.c = d; + b.c = c; + } + function C(a, b) { + var c = b.f, + d = new N(b, c); + c.e = d; + b.f = d; + c = d.c = a; + do (c.a = d), (c = c.c); + while (c !== a); + } + function D(a, b) { + var c = b.d, + d = new ga(b, c); + c.b = d; + b.d = d; + d.a = a; + d.c = b.c; + c = a; + do (c.d = d), (c = c.e); + while (c !== a); + } + function fa(a) { + var b = a.h; + a = a.b.h; + b.b.h = a; + a.b.h = b; + } + function F(a, b) { + var c = a.c, + d = c; + do (d.a = b), (d = d.c); + while (d !== c); + c = a.f; + d = a.e; + d.f = c; + c.e = d; + } + function G(a, b) { + var c = a.a, + d = c; + do (d.d = b), (d = d.e); + while (d !== c); + c = a.d; + d = a.b; + d.d = c; + c.b = d; + } + function ha(a) { + var b = 0; + Math.abs(a[1]) > Math.abs(a[0]) && (b = 1); + Math.abs(a[2]) > Math.abs(a[b]) && (b = 2); + return b; + } + var O = 4 * 1e150; + function P(a, b) { + a.f += b.f; + a.b.f += b.b.f; + } + function ia(a, b, c) { + a = a.a; + b = b.a; + c = c.a; + if (b.b.a === a) + return c.b.a === a + ? u(b.a, c.a) + ? 0 >= x(c.b.a, b.a, c.a) + : 0 <= x(b.b.a, c.a, b.a) + : 0 >= x(c.b.a, a, c.a); + if (c.b.a === a) return 0 <= x(b.b.a, a, b.a); + b = v(b.b.a, a, b.a); + a = v(c.b.a, a, c.a); + return b >= a; + } + function Q(a) { + a.a.i = null; + var b = a.e; + b.a.c = b.c; + b.c.a = b.a; + a.e = null; + } + function ja(a, b) { + I(a.a); + a.c = !1; + a.a = b; + b.i = a; + } + function ka(a) { + var b = a.a.a; + do a = R(a); + while (a.a.a === b); + a.c && ((b = L(S(a).a.b, a.a.e)), ja(a, b), (a = R(a))); + return a; + } + function la(a, b, c) { + var d = new ma(); + d.a = c; + d.e = na(a.f, b.e, d); + return (c.i = d); + } + function oa(a, b) { + switch (a.s) { + case 100130: + return 0 !== (b & 1); + case 100131: + return 0 !== b; + case 100132: + return 0 < b; + case 100133: + return 0 > b; + case 100134: + return 2 <= b || -2 >= b; + } + return !1; + } + function pa(a) { + var b = a.a, + c = b.d; + c.c = a.d; + c.a = b; + Q(a); + } + function T(a, b, c) { + a = b; + for (b = b.a; a !== c; ) { + a.c = !1; + var d = S(a), + e = d.a; + if (e.a !== b.a) { + if (!d.c) { + pa(a); + break; + } + e = L(b.c.b, e.b); + ja(d, e); + } + b.c !== e && (E(J(e), e), E(b, e)); + pa(a); + b = d.a; + a = d; + } + return b; + } + function U(a, b, c, d, e, f) { + var g = !0; + do la(a, b, c.b), (c = c.c); + while (c !== d); + for (null === e && (e = S(b).a.b.c); ; ) { + d = S(b); + c = d.a.b; + if (c.a !== e.a) break; + c.c !== e && (E(J(c), c), E(J(e), c)); + d.f = b.f - c.f; + d.d = oa(a, d.f); + b.b = !0; + !g && qa(a, b) && (P(c, e), Q(b), I(e)); + g = !1; + b = d; + e = c; + } + b.b = !0; + f && ra(a, b); + } + function sa(a, b, c, d, e) { + var f = [b.g[0], b.g[1], b.g[2]]; + b.d = null; + b.d = a.o ? a.o(f, c, d, a.c) || null : null; + null === b.d && + (e ? a.n || (V(a, 100156), (a.n = !0)) : (b.d = c[0])); + } + function ta(a, b, c) { + var d = [null, null, null, null]; + d[0] = b.a.d; + d[1] = c.a.d; + sa(a, b.a, d, [0.5, 0.5, 0, 0], !1); + E(b, c); + } + function ua(a, b, c, d, e) { + var f = Math.abs(b.b - a.b) + Math.abs(b.a - a.a), + g = Math.abs(c.b - a.b) + Math.abs(c.a - a.a), + h = e + 1; + d[e] = (0.5 * g) / (f + g); + d[h] = (0.5 * f) / (f + g); + a.g[0] += d[e] * b.g[0] + d[h] * c.g[0]; + a.g[1] += d[e] * b.g[1] + d[h] * c.g[1]; + a.g[2] += d[e] * b.g[2] + d[h] * c.g[2]; + } + function qa(a, b) { + var c = S(b), + d = b.a, + e = c.a; + if (u(d.a, e.a)) { + if (0 < x(e.b.a, d.a, e.a)) return !1; + if (!t(d.a, e.a)) K(e.b), E(d, J(e)), (b.b = c.b = !0); + else if (d.a !== e.a) { + var c = a.e, + f = d.a.h; + if (0 <= f) { + var c = c.b, + g = c.d, + h = c.e, + k = c.c, + l = k[f]; + g[l] = g[c.a]; + k[g[l]] = l; + l <= --c.a && + (1 >= l + ? W(c, l) + : u(h[g[l >> 1]], h[g[l]]) + ? W(c, l) + : va(c, l)); + h[f] = null; + k[f] = c.b; + c.b = f; + } else + for ( + c.c[-(f + 1)] = null; + 0 < c.a && null === c.c[c.d[c.a - 1]]; + + ) + --c.a; + ta(a, J(e), d); + } + } else { + if (0 > x(d.b.a, e.a, d.a)) return !1; + R(b).b = b.b = !0; + K(d.b); + E(J(e), d); + } + return !0; + } + function wa(a, b) { + var c = S(b), + d = b.a, + e = c.a, + f = d.a, + g = e.a, + h = d.b.a, + k = e.b.a, + l = new N(); + x(h, a.a, f); + x(k, a.a, g); + if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1; + if (u(f, g)) { + if (0 < x(k, f, g)) return !1; + } else if (0 > x(h, g, f)) return !1; + var r = h, + p = f, + q = k, + y = g, + m, + w; + u(r, p) || ((m = r), (r = p), (p = m)); + u(q, y) || ((m = q), (q = y), (y = m)); + u(r, q) || ((m = r), (r = q), (q = m), (m = p), (p = y), (y = m)); + u(q, p) + ? u(p, y) + ? ((m = v(r, q, p)), + (w = v(q, p, y)), + 0 > m + w && ((m = -m), (w = -w)), + (l.b = A(m, q.b, w, p.b))) + : ((m = x(r, q, p)), + (w = -x(r, y, p)), + 0 > m + w && ((m = -m), (w = -w)), + (l.b = A(m, q.b, w, y.b))) + : (l.b = (q.b + p.b) / 2); + z(r, p) || ((m = r), (r = p), (p = m)); + z(q, y) || ((m = q), (q = y), (y = m)); + z(r, q) || ((m = r), (r = q), (q = m), (m = p), (p = y), (y = m)); + z(q, p) + ? z(p, y) + ? ((m = aa(r, q, p)), + (w = aa(q, p, y)), + 0 > m + w && ((m = -m), (w = -w)), + (l.a = A(m, q.a, w, p.a))) + : ((m = ba(r, q, p)), + (w = -ba(r, y, p)), + 0 > m + w && ((m = -m), (w = -w)), + (l.a = A(m, q.a, w, y.a))) + : (l.a = (q.a + p.a) / 2); + u(l, a.a) && ((l.b = a.a.b), (l.a = a.a.a)); + r = u(f, g) ? f : g; + u(r, l) && ((l.b = r.b), (l.a = r.a)); + if (t(l, f) || t(l, g)) return qa(a, b), !1; + if ( + (!t(h, a.a) && 0 <= x(h, a.a, l)) || + (!t(k, a.a) && 0 >= x(k, a.a, l)) + ) { + if (k === a.a) + return ( + K(d.b), + E(e.b, d), + (b = ka(b)), + (d = S(b).a), + T(a, S(b), c), + U(a, b, J(d), d, d, !0), + !0 + ); + if (h === a.a) { + K(e.b); + E(d.e, J(e)); + f = c = b; + g = f.a.b.a; + do f = R(f); + while (f.a.b.a === g); + b = f; + f = S(b).a.b.c; + c.a = J(e); + e = T(a, c, null); + U(a, b, e.c, d.b.c, f, !0); + return !0; + } + 0 <= x(h, a.a, l) && + ((R(b).b = b.b = !0), K(d.b), (d.a.b = a.a.b), (d.a.a = a.a.a)); + 0 >= x(k, a.a, l) && + ((b.b = c.b = !0), K(e.b), (e.a.b = a.a.b), (e.a.a = a.a.a)); + return !1; + } + K(d.b); + K(e.b); + E(J(e), d); + d.a.b = l.b; + d.a.a = l.a; + d.a.h = xa(a.e, d.a); + d = d.a; + e = [0, 0, 0, 0]; + l = [f.d, h.d, g.d, k.d]; + d.g[0] = d.g[1] = d.g[2] = 0; + ua(d, f, h, e, 0); + ua(d, g, k, e, 2); + sa(a, d, l, e, !0); + R(b).b = b.b = c.b = !0; + return !1; + } + function ra(a, b) { + for (var c = S(b); ; ) { + for (; c.b; ) (b = c), (c = S(c)); + if (!b.b && ((c = b), (b = R(b)), null === b || !b.b)) break; + b.b = !1; + var d = b.a, + e = c.a, + f; + if ((f = d.b.a !== e.b.a)) + a: { + f = b; + var g = S(f), + h = f.a, + k = g.a, + l = void 0; + if (u(h.b.a, k.b.a)) { + if (0 > x(h.b.a, k.b.a, h.a)) { + f = !1; + break a; + } + R(f).b = f.b = !0; + l = K(h); + E(k.b, l); + l.d.c = f.d; + } else { + if (0 < x(k.b.a, h.b.a, k.a)) { + f = !1; + break a; + } + f.b = g.b = !0; + l = K(k); + E(h.e, k.b); + l.b.d.c = f.d; + } + f = !0; + } + f && + (c.c + ? (Q(c), I(e), (c = S(b)), (e = c.a)) + : b.c && (Q(b), I(d), (b = R(c)), (d = b.a))); + if (d.a !== e.a) + if ( + d.b.a === e.b.a || + b.c || + c.c || + (d.b.a !== a.a && e.b.a !== a.a) + ) + qa(a, b); + else if (wa(a, b)) break; + d.a === e.a && + d.b.a === e.b.a && + (P(e, d), Q(b), I(d), (b = R(c))); + } + } + function ya(a, b) { + a.a = b; + for (var c = b.c; null === c.i; ) + if (((c = c.c), c === b.c)) { + var c = a, + d = b, + e = new ma(); + e.a = d.c.b; + var f = c.f, + g = f.a; + do g = g.a; + while (null !== g.b && !f.c(f.b, e, g.b)); + var f = g.b, + h = S(f), + e = f.a, + g = h.a; + if (0 === x(e.b.a, d, e.a)) + (e = f.a), + t(e.a, d) || + t(e.b.a, d) || + (K(e.b), + f.c && (I(e.c), (f.c = !1)), + E(d.c, e), + ya(c, d)); + else { + var k = u(g.b.a, e.b.a) ? f : h, + h = void 0; + f.d || k.c + ? (k === f ? (h = L(d.c.b, e.e)) : (h = L(g.b.c.b, d.c).b), + k.c + ? ja(k, h) + : ((e = c), + (f = la(c, f, h)), + (f.f = R(f).f + f.a.f), + (f.d = oa(e, f.f))), + ya(c, d)) + : U(c, f, d.c, d.c, null, !0); + } + return; + } + c = ka(c.i); + e = S(c); + f = e.a; + e = T(a, e, null); + if (e.c === f) { + var f = e, + e = f.c, + g = S(c), + h = c.a, + k = g.a, + l = !1; + h.b.a !== k.b.a && wa(a, c); + t(h.a, a.a) && + (E(J(e), h), + (c = ka(c)), + (e = S(c).a), + T(a, S(c), g), + (l = !0)); + t(k.a, a.a) && (E(f, J(k)), (f = T(a, g, null)), (l = !0)); + l + ? U(a, c, f.c, e, e, !0) + : (u(k.a, h.a) ? (d = J(k)) : (d = h), + (d = L(f.c.b, d)), + U(a, c, d, d.c, d.c, !1), + (d.b.i.c = !0), + ra(a, c)); + } else U(a, c, e.c, f, f, !0); + } + function za(a, b) { + var c = new ma(), + d = ea(a.b); + d.a.b = O; + d.a.a = b; + d.b.a.b = -O; + d.b.a.a = b; + a.a = d.b.a; + c.a = d; + c.f = 0; + c.d = !1; + c.c = !1; + c.h = !0; + c.b = !1; + d = a.f; + d = na(d, d.a, c); + c.e = d; + } + function Aa(a) { + this.a = new Ba(); + this.b = a; + this.c = ia; + } + function na(a, b, c) { + do b = b.c; + while (null !== b.b && !a.c(a.b, b.b, c)); + a = new Ba(c, b.a, b); + b.a.c = a; + return (b.a = a); + } + function Ba(a, b, c) { + this.b = a || null; + this.a = b || this; + this.c = c || this; + } + function X() { + this.d = Y; + this.p = this.b = this.q = null; + this.j = [0, 0, 0]; + this.s = 100130; + this.n = !1; + this.o = this.a = this.e = this.f = null; + this.m = !1; + this.c = this.r = this.i = this.k = this.l = this.h = null; + } + var Y = 0; + n = X.prototype; + n.x = function () { + Z(this, Y); + }; + n.B = function (a, b) { + switch (a) { + case 100142: + return; + case 100140: + switch (b) { + case 100130: + case 100131: + case 100132: + case 100133: + case 100134: + this.s = b; + return; + } + break; + case 100141: + this.m = !!b; + return; + default: + V(this, 100900); + return; + } + V(this, 100901); + }; + n.y = function (a) { + switch (a) { + case 100142: + return 0; + case 100140: + return this.s; + case 100141: + return this.m; + default: + V(this, 100900); + } + return !1; + }; + n.A = function (a, b, c) { + this.j[0] = a; + this.j[1] = b; + this.j[2] = c; + }; + n.z = function (a, b) { + var c = b ? b : null; + switch (a) { + case 100100: + case 100106: + this.h = c; + break; + case 100104: + case 100110: + this.l = c; + break; + case 100101: + case 100107: + this.k = c; + break; + case 100102: + case 100108: + this.i = c; + break; + case 100103: + case 100109: + this.p = c; + break; + case 100105: + case 100111: + this.o = c; + break; + case 100112: + this.r = c; + break; + default: + V(this, 100900); + } + }; + n.C = function (a, b) { + var c = !1, + d = [0, 0, 0]; + Z(this, 2); + for (var e = 0; 3 > e; ++e) { + var f = a[e]; + -1e150 > f && ((f = -1e150), (c = !0)); + 1e150 < f && ((f = 1e150), (c = !0)); + d[e] = f; + } + c && V(this, 100155); + c = this.q; + null === c ? ((c = ea(this.b)), E(c, c.b)) : (K(c), (c = c.e)); + c.a.d = b; + c.a.g[0] = d[0]; + c.a.g[1] = d[1]; + c.a.g[2] = d[2]; + c.f = 1; + c.b.f = -1; + this.q = c; + }; + n.u = function (a) { + Z(this, Y); + this.d = 1; + this.b = new Ca(); + this.c = a; + }; + n.t = function () { + Z(this, 1); + this.d = 2; + this.q = null; + }; + n.v = function () { + Z(this, 2); + this.d = 1; + }; + n.w = function () { + Z(this, 1); + this.d = Y; + var a = this.j[0], + b = this.j[1], + c = this.j[2], + d = !1, + e = [a, b, c]; + if (0 === a && 0 === b && 0 === c) { + for ( + var b = [-2 * 1e150, -2 * 1e150, -2 * 1e150], + f = [2 * 1e150, 2 * 1e150, 2 * 1e150], + c = [], + g = [], + d = this.b.c, + a = d.e; + a !== d; + a = a.e + ) + for (var h = 0; 3 > h; ++h) { + var k = a.g[h]; + k < f[h] && ((f[h] = k), (g[h] = a)); + k > b[h] && ((b[h] = k), (c[h] = a)); + } + a = 0; + b[1] - f[1] > b[0] - f[0] && (a = 1); + b[2] - f[2] > b[a] - f[a] && (a = 2); + if (f[a] >= b[a]) (e[0] = 0), (e[1] = 0), (e[2] = 1); + else { + b = 0; + f = g[a]; + c = c[a]; + g = [0, 0, 0]; + f = [f.g[0] - c.g[0], f.g[1] - c.g[1], f.g[2] - c.g[2]]; + h = [0, 0, 0]; + for (a = d.e; a !== d; a = a.e) + (h[0] = a.g[0] - c.g[0]), + (h[1] = a.g[1] - c.g[1]), + (h[2] = a.g[2] - c.g[2]), + (g[0] = f[1] * h[2] - f[2] * h[1]), + (g[1] = f[2] * h[0] - f[0] * h[2]), + (g[2] = f[0] * h[1] - f[1] * h[0]), + (k = g[0] * g[0] + g[1] * g[1] + g[2] * g[2]), + k > b && + ((b = k), (e[0] = g[0]), (e[1] = g[1]), (e[2] = g[2])); + 0 >= b && ((e[0] = e[1] = e[2] = 0), (e[ha(f)] = 1)); + } + d = !0; + } + g = ha(e); + a = this.b.c; + b = (g + 1) % 3; + c = (g + 2) % 3; + g = 0 < e[g] ? 1 : -1; + for (e = a.e; e !== a; e = e.e) (e.b = e.g[b]), (e.a = g * e.g[c]); + if (d) { + e = 0; + d = this.b.a; + for (a = d.b; a !== d; a = a.b) + if (((b = a.a), !(0 >= b.f))) { + do (e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a)), (b = b.e); + while (b !== a.a); + } + if (0 > e) + for (e = this.b.c, d = e.e; d !== e; d = d.e) d.a = -d.a; + } + this.n = !1; + e = this.b.b; + for (a = e.h; a !== e; a = d) + if ( + ((d = a.h), + (b = a.e), + t(a.a, a.b.a) && + a.e.e !== a && + (ta(this, b, a), I(a), (a = b), (b = a.e)), + b.e === a) + ) { + if (b !== a) { + if (b === d || b === d.b) d = d.h; + I(b); + } + if (a === d || a === d.b) d = d.h; + I(a); + } + this.e = e = new Da(); + d = this.b.c; + for (a = d.e; a !== d; a = a.e) a.h = xa(e, a); + Ea(e); + this.f = new Aa(this); + za(this, -O); + for (za(this, O); null !== (e = Fa(this.e)); ) { + for (;;) { + a: if (((a = this.e), 0 === a.a)) d = Ga(a.b); + else if ( + ((d = a.c[a.d[a.a - 1]]), + 0 !== a.b.a && ((a = Ga(a.b)), u(a, d))) + ) { + d = a; + break a; + } + if (null === d || !t(d, e)) break; + d = Fa(this.e); + ta(this, e.c, d.c); + } + ya(this, e); + } + this.a = this.f.a.a.b.a.a; + for (e = 0; null !== (d = this.f.a.a.b); ) d.h || ++e, Q(d); + this.f = null; + e = this.e; + e.b = null; + e.d = null; + this.e = e.c = null; + e = this.b; + for (a = e.a.b; a !== e.a; a = d) + (d = a.b), (a = a.a), a.e.e === a && (P(a.c, a), I(a)); + if (!this.n) { + e = this.b; + if (this.m) + for (a = e.b.h; a !== e.b; a = d) + (d = a.h), a.b.d.c !== a.d.c ? (a.f = a.d.c ? 1 : -1) : I(a); + else + for (a = e.a.b; a !== e.a; a = d) + if (((d = a.b), a.c)) { + for (a = a.a; u(a.b.a, a.a); a = a.c.b); + for (; u(a.a, a.b.a); a = a.e); + b = a.c.b; + for (c = void 0; a.e !== b; ) + if (u(a.b.a, b.a)) { + for ( + ; + b.e !== a && (ca(b.e) || 0 >= x(b.a, b.b.a, b.e.b.a)); + + ) + (c = L(b.e, b)), (b = c.b); + b = b.c.b; + } else { + for ( + ; + b.e !== a && + (da(a.c.b) || 0 <= x(a.b.a, a.a, a.c.b.a)); + + ) + (c = L(a, a.c.b)), (a = c.b); + a = a.e; + } + for (; b.e.e !== a; ) (c = L(b.e, b)), (b = c.b); + } + if (this.h || this.i || this.k || this.l) + if (this.m) + for (e = this.b, d = e.a.b; d !== e.a; d = d.b) { + if (d.c) { + this.h && this.h(2, this.c); + a = d.a; + do this.k && this.k(a.a.d, this.c), (a = a.e); + while (a !== d.a); + this.i && this.i(this.c); + } + } + else { + e = this.b; + d = !!this.l; + a = !1; + b = -1; + for (c = e.a.d; c !== e.a; c = c.d) + if (c.c) { + a || (this.h && this.h(4, this.c), (a = !0)); + g = c.a; + do + d && + ((f = g.b.d.c ? 0 : 1), + b !== f && ((b = f), this.l && this.l(!!b, this.c))), + this.k && this.k(g.a.d, this.c), + (g = g.e); + while (g !== c.a); + } + a && this.i && this.i(this.c); + } + if (this.r) { + e = this.b; + for (a = e.a.b; a !== e.a; a = d) + if (((d = a.b), !a.c)) { + b = a.a; + c = b.e; + g = void 0; + do + (g = c), + (c = g.e), + (g.d = null), + null === g.b.d && + (g.c === g + ? F(g.a, null) + : ((g.a.c = g.c), H(g, J(g))), + (f = g.b), + f.c === f + ? F(f.a, null) + : ((f.a.c = f.c), H(f, J(f))), + fa(g)); + while (g !== b); + b = a.d; + a = a.b; + a.d = b; + b.b = a; + } + this.r(this.b); + this.c = this.b = null; + return; + } + } + this.b = this.c = null; + }; + function Z(a, b) { + if (a.d !== b) + for (; a.d !== b; ) + if (a.d < b) + switch (a.d) { + case Y: + V(a, 100151); + a.u(null); + break; + case 1: + V(a, 100152), a.t(); + } + else + switch (a.d) { + case 2: + V(a, 100154); + a.v(); + break; + case 1: + V(a, 100153), a.w(); + } + } + function V(a, b) { + a.p && a.p(b, a.c); + } + function ga(a, b) { + this.b = a || this; + this.d = b || this; + this.a = null; + this.c = !1; + } + function M() { + this.h = this; + this.i = this.d = this.a = this.e = this.c = this.b = null; + this.f = 0; + } + function J(a) { + return a.b.e; + } + function Ca() { + this.c = new N(); + this.a = new ga(); + this.b = new M(); + this.d = new M(); + this.b.b = this.d; + this.d.b = this.b; + } + function N(a, b) { + this.e = a || this; + this.f = b || this; + this.d = this.c = null; + this.g = [0, 0, 0]; + this.h = this.a = this.b = 0; + } + function Da() { + this.c = []; + this.d = null; + this.a = 0; + this.e = !1; + this.b = new Ha(); + } + function Ea(a) { + a.d = []; + for (var b = 0; b < a.a; b++) a.d[b] = b; + a.d.sort( + (function (a) { + return function (b, e) { + return u(a[b], a[e]) ? 1 : -1; + }; + })(a.c), + ); + a.e = !0; + Ia(a.b); + } + function xa(a, b) { + if (a.e) { + var c = a.b, + d = ++c.a; + 2 * d > c.f && ((c.f *= 2), (c.c = Ja(c.c, c.f + 1))); + var e; + 0 === c.b ? (e = d) : ((e = c.b), (c.b = c.c[c.b])); + c.e[e] = b; + c.c[e] = d; + c.d[d] = e; + c.h && va(c, d); + return e; + } + c = a.a++; + a.c[c] = b; + return -(c + 1); + } + function Fa(a) { + if (0 === a.a) return Ka(a.b); + var b = a.c[a.d[a.a - 1]]; + if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b); + do --a.a; + while (0 < a.a && null === a.c[a.d[a.a - 1]]); + return b; + } + function Ha() { + this.d = Ja([0], 33); + this.e = [null, null]; + this.c = [0, 0]; + this.a = 0; + this.f = 32; + this.b = 0; + this.h = !1; + this.d[1] = 1; + } + function Ja(a, b) { + for (var c = Array(b), d = 0; d < a.length; d++) c[d] = a[d]; + for (; d < b; d++) c[d] = 0; + return c; + } + function Ia(a) { + for (var b = a.a; 1 <= b; --b) W(a, b); + a.h = !0; + } + function Ga(a) { + return a.e[a.d[1]]; + } + function Ka(a) { + var b = a.d, + c = a.e, + d = a.c, + e = b[1], + f = c[e]; + 0 < a.a && + ((b[1] = b[a.a]), + (d[b[1]] = 1), + (c[e] = null), + (d[e] = a.b), + (a.b = e), + 0 < --a.a && W(a, 1)); + return f; + } + function W(a, b) { + for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { + var h = f << 1; + h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1); + var k = c[h]; + if (h > a.a || u(d[g], d[k])) { + c[f] = g; + e[g] = f; + break; + } + c[f] = k; + e[k] = f; + f = h; + } + } + function va(a, b) { + for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { + var h = f >> 1, + k = c[h]; + if (0 === h || u(d[k], d[g])) { + c[f] = g; + e[g] = f; + break; + } + c[f] = k; + e[k] = f; + f = h; + } + } + function ma() { + this.e = this.a = null; + this.f = 0; + this.c = this.b = this.h = this.d = !1; + } + function S(a) { + return a.e.c.b; + } + function R(a) { + return a.e.a.b; + } + this.libtess = { + GluTesselator: X, + windingRule: { + GLU_TESS_WINDING_ODD: 100130, + GLU_TESS_WINDING_NONZERO: 100131, + GLU_TESS_WINDING_POSITIVE: 100132, + GLU_TESS_WINDING_NEGATIVE: 100133, + GLU_TESS_WINDING_ABS_GEQ_TWO: 100134, + }, + primitiveType: { + GL_LINE_LOOP: 2, + GL_TRIANGLES: 4, + GL_TRIANGLE_STRIP: 5, + GL_TRIANGLE_FAN: 6, + }, + errorType: { + GLU_TESS_MISSING_BEGIN_POLYGON: 100151, + GLU_TESS_MISSING_END_POLYGON: 100153, + GLU_TESS_MISSING_BEGIN_CONTOUR: 100152, + GLU_TESS_MISSING_END_CONTOUR: 100154, + GLU_TESS_COORD_TOO_LARGE: 100155, + GLU_TESS_NEED_COMBINE_CALLBACK: 100156, + }, + gluEnum: { + GLU_TESS_MESH: 100112, + GLU_TESS_TOLERANCE: 100142, + GLU_TESS_WINDING_RULE: 100140, + GLU_TESS_BOUNDARY_ONLY: 100141, + GLU_INVALID_ENUM: 100900, + GLU_INVALID_VALUE: 100901, + GLU_TESS_BEGIN: 100100, + GLU_TESS_VERTEX: 100101, + GLU_TESS_END: 100102, + GLU_TESS_ERROR: 100103, + GLU_TESS_EDGE_FLAG: 100104, + GLU_TESS_COMBINE: 100105, + GLU_TESS_BEGIN_DATA: 100106, + GLU_TESS_VERTEX_DATA: 100107, + GLU_TESS_END_DATA: 100108, + GLU_TESS_ERROR_DATA: 100109, + GLU_TESS_EDGE_FLAG_DATA: 100110, + GLU_TESS_COMBINE_DATA: 100111, + }, + }; + X.prototype.gluDeleteTess = X.prototype.x; + X.prototype.gluTessProperty = X.prototype.B; + X.prototype.gluGetTessProperty = X.prototype.y; + X.prototype.gluTessNormal = X.prototype.A; + X.prototype.gluTessCallback = X.prototype.z; + X.prototype.gluTessVertex = X.prototype.C; + X.prototype.gluTessBeginPolygon = X.prototype.u; + X.prototype.gluTessBeginContour = X.prototype.t; + X.prototype.gluTessEndContour = X.prototype.v; + X.prototype.gluTessEndPolygon = X.prototype.w; + if (typeof module !== "undefined") { + module.exports = this.libtess; + } + }, + {}, + ], + 270: [ + function (_dereq_, module, exports) { + // (c) Dean McNamee , 2013. + // + // https://github.com/deanm/omggif + // + // 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. + // + // omggif is a JavaScript implementation of a GIF 89a encoder and decoder, + // including animation and compression. It does not rely on any specific + // underlying system, so should run in the browser, Node, or Plask. + "use strict"; + function GifWriter(buf, width, height, gopts) { + var p = 0; + var gopts = gopts === undefined ? {} : gopts; + var loop_count = gopts.loop === undefined ? null : gopts.loop; + var global_palette = + gopts.palette === undefined ? null : gopts.palette; + if (width <= 0 || height <= 0 || width > 65535 || height > 65535) + throw new Error("Width/Height invalid."); + function check_palette_and_num_colors(palette) { + var num_colors = palette.length; + if ( + num_colors < 2 || + num_colors > 256 || + num_colors & (num_colors - 1) + ) { + throw new Error( + "Invalid code/color length, must be power of 2 and 2 .. 256.", + ); + } + return num_colors; + } // - Header. + + buf[p++] = 71; + buf[p++] = 73; + buf[p++] = 70; // GIF + buf[p++] = 56; + buf[p++] = 57; + buf[p++] = 97; // 89a + // Handling of Global Color Table (palette) and background index. + var gp_num_colors_pow2 = 0; + var background = 0; + if (global_palette !== null) { + var gp_num_colors = check_palette_and_num_colors(global_palette); + while ((gp_num_colors >>= 1)) ++gp_num_colors_pow2; + gp_num_colors = 1 << gp_num_colors_pow2; + --gp_num_colors_pow2; + if (gopts.background !== undefined) { + background = gopts.background; + if (background >= gp_num_colors) + throw new Error("Background index out of range."); + // The GIF spec states that a background index of 0 should be ignored, so + // this is probably a mistake and you really want to set it to another + // slot in the palette. But actually in the end most browsers, etc end + // up ignoring this almost completely (including for dispose background). + if (background === 0) + throw new Error("Background index explicitly passed as 0."); + } + } // - Logical Screen Descriptor. + // NOTE(deanm): w/h apparently ignored by implementations, but set anyway. + + buf[p++] = width & 255; + buf[p++] = (width >> 8) & 255; + buf[p++] = height & 255; + buf[p++] = (height >> 8) & 255; + // NOTE: Indicates 0-bpp original color resolution (unused?). + buf[p++] = + (global_palette !== null ? 128 : 0) | // Global Color Table Flag. + gp_num_colors_pow2; // NOTE: No sort flag (unused?). + buf[p++] = background; // Background Color Index. + buf[p++] = 0; // Pixel aspect ratio (unused?). + // - Global Color Table + if (global_palette !== null) { + for (var i = 0, il = global_palette.length; i < il; ++i) { + var rgb = global_palette[i]; + buf[p++] = (rgb >> 16) & 255; + buf[p++] = (rgb >> 8) & 255; + buf[p++] = rgb & 255; + } + } + if (loop_count !== null) { + // Netscape block for looping. + if (loop_count < 0 || loop_count > 65535) + throw new Error("Loop count invalid."); + // Extension code, label, and length. + buf[p++] = 33; + buf[p++] = 255; + buf[p++] = 11; + // NETSCAPE2.0 + buf[p++] = 78; + buf[p++] = 69; + buf[p++] = 84; + buf[p++] = 83; + buf[p++] = 67; + buf[p++] = 65; + buf[p++] = 80; + buf[p++] = 69; + buf[p++] = 50; + buf[p++] = 46; + buf[p++] = 48; + // Sub-block + buf[p++] = 3; + buf[p++] = 1; + buf[p++] = loop_count & 255; + buf[p++] = (loop_count >> 8) & 255; + buf[p++] = 0; // Terminator. + } + var ended = false; + this.addFrame = function (x, y, w, h, indexed_pixels, opts) { + if (ended === true) { + --p; + ended = false; + } // Un-end. + + opts = opts === undefined ? {} : opts; + // TODO(deanm): Bounds check x, y. Do they need to be within the virtual + // canvas width/height, I imagine? + if (x < 0 || y < 0 || x > 65535 || y > 65535) + throw new Error("x/y invalid."); + if (w <= 0 || h <= 0 || w > 65535 || h > 65535) + throw new Error("Width/Height invalid."); + if (indexed_pixels.length < w * h) + throw new Error("Not enough pixels for the frame size."); + var using_local_palette = true; + var palette = opts.palette; + if (palette === undefined || palette === null) { + using_local_palette = false; + palette = global_palette; + } + if (palette === undefined || palette === null) + throw new Error( + "Must supply either a local or global palette.", + ); + var num_colors = check_palette_and_num_colors(palette); + // Compute the min_code_size (power of 2), destroying num_colors. + var min_code_size = 0; + while ((num_colors >>= 1)) ++min_code_size; + num_colors = 1 << min_code_size; // Now we can easily get it back. + var delay = opts.delay === undefined ? 0 : opts.delay; + // From the spec: + // 0 - No disposal specified. The decoder is + // not required to take any action. + // 1 - Do not dispose. The graphic is to be left + // in place. + // 2 - Restore to background color. The area used by the + // graphic must be restored to the background color. + // 3 - Restore to previous. The decoder is required to + // restore the area overwritten by the graphic with + // what was there prior to rendering the graphic. + // 4-7 - To be defined. + // NOTE(deanm): Dispose background doesn't really work, apparently most + // browsers ignore the background palette index and clear to transparency. + var disposal = opts.disposal === undefined ? 0 : opts.disposal; + if (disposal < 0 || disposal > 3) + // 4-7 is reserved. + throw new Error("Disposal out of range."); + var use_transparency = false; + var transparent_index = 0; + if (opts.transparent !== undefined && opts.transparent !== null) { + use_transparency = true; + transparent_index = opts.transparent; + if (transparent_index < 0 || transparent_index >= num_colors) + throw new Error("Transparent color index."); + } + if (disposal !== 0 || use_transparency || delay !== 0) { + // - Graphics Control Extension + buf[p++] = 33; + buf[p++] = 249; // Extension / Label. + buf[p++] = 4; // Byte size. + buf[p++] = + (disposal << 2) | (use_transparency === true ? 1 : 0); + buf[p++] = delay & 255; + buf[p++] = (delay >> 8) & 255; + buf[p++] = transparent_index; // Transparent color index. + buf[p++] = 0; // Block Terminator. + } // - Image Descriptor + + buf[p++] = 44; // Image Seperator. + buf[p++] = x & 255; + buf[p++] = (x >> 8) & 255; // Left. + buf[p++] = y & 255; + buf[p++] = (y >> 8) & 255; // Top. + buf[p++] = w & 255; + buf[p++] = (w >> 8) & 255; + buf[p++] = h & 255; + buf[p++] = (h >> 8) & 255; + // NOTE: No sort flag (unused?). + // TODO(deanm): Support interlace. + buf[p++] = + using_local_palette === true ? 128 | (min_code_size - 1) : 0; + // - Local Color Table + if (using_local_palette === true) { + for (var i = 0, il = palette.length; i < il; ++i) { + var rgb = palette[i]; + buf[p++] = (rgb >> 16) & 255; + buf[p++] = (rgb >> 8) & 255; + buf[p++] = rgb & 255; + } + } + p = GifWriterOutputLZWCodeStream( + buf, + p, + min_code_size < 2 ? 2 : min_code_size, + indexed_pixels, + ); + return p; + }; + this.end = function () { + if (ended === false) { + buf[p++] = 59; // Trailer. + ended = true; + } + return p; + }; + this.getOutputBuffer = function () { + return buf; + }; + this.setOutputBuffer = function (v) { + buf = v; + }; + this.getOutputBufferPosition = function () { + return p; + }; + this.setOutputBufferPosition = function (v) { + p = v; + }; + } // Main compression routine, palette indexes -> LZW code stream. + // |index_stream| must have at least one entry. + + function GifWriterOutputLZWCodeStream( + buf, + p, + min_code_size, + index_stream, + ) { + buf[p++] = min_code_size; + var cur_subblock = p++; // Pointing at the length field. + var clear_code = 1 << min_code_size; + var code_mask = clear_code - 1; + var eoi_code = clear_code + 1; + var next_code = eoi_code + 1; + var cur_code_size = min_code_size + 1; // Number of bits per code. + var cur_shift = 0; + // We have at most 12-bit codes, so we should have to hold a max of 19 + // bits here (and then we would write out). + var cur = 0; + function emit_bytes_to_buffer(bit_block_size) { + while (cur_shift >= bit_block_size) { + buf[p++] = cur & 255; + cur >>= 8; + cur_shift -= 8; + if (p === cur_subblock + 256) { + // Finished a subblock. + buf[cur_subblock] = 255; + cur_subblock = p++; + } + } + } + function emit_code(c) { + cur |= c << cur_shift; + cur_shift += cur_code_size; + emit_bytes_to_buffer(8); + } // I am not an expert on the topic, and I don't want to write a thesis. + // However, it is good to outline here the basic algorithm and the few data + // structures and optimizations here that make this implementation fast. + // The basic idea behind LZW is to build a table of previously seen runs + // addressed by a short id (herein called output code). All data is + // referenced by a code, which represents one or more values from the + // original input stream. All input bytes can be referenced as the same + // value as an output code. So if you didn't want any compression, you + // could more or less just output the original bytes as codes (there are + // some details to this, but it is the idea). In order to achieve + // compression, values greater then the input range (codes can be up to + // 12-bit while input only 8-bit) represent a sequence of previously seen + // inputs. The decompressor is able to build the same mapping while + // decoding, so there is always a shared common knowledge between the + // encoding and decoder, which is also important for "timing" aspects like + // how to handle variable bit width code encoding. + // + // One obvious but very important consequence of the table system is there + // is always a unique id (at most 12-bits) to map the runs. 'A' might be + // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc. This relationship + // can be used for an effecient lookup strategy for the code mapping. We + // need to know if a run has been seen before, and be able to map that run + // to the output code. Since we start with known unique ids (input bytes), + // and then from those build more unique ids (table entries), we can + // continue this chain (almost like a linked list) to always have small + // integer values that represent the current byte chains in the encoder. + // This means instead of tracking the input bytes (AAAABCD) to know our + // current state, we can track the table entry for AAAABC (it is guaranteed + // to exist by the nature of the algorithm) and the next character D. + // Therefor the tuple of (table_entry, byte) is guaranteed to also be + // unique. This allows us to create a simple lookup key for mapping input + // sequences to codes (table indices) without having to store or search + // any of the code sequences. So if 'AAAA' has a table entry of 12, the + // tuple of ('AAAA', K) for any input byte K will be unique, and can be our + // key. This leads to a integer value at most 20-bits, which can always + // fit in an SMI value and be used as a fast sparse array / object key. + // Output code for the current contents of the index buffer. + + var ib_code = index_stream[0] & code_mask; // Load first input index. + var code_table = {}; // Key'd on our 20-bit "tuple". + emit_code(clear_code); // Spec says first code should be a clear code. + // First index already loaded, process the rest of the stream. + for (var i = 1, il = index_stream.length; i < il; ++i) { + var k = index_stream[i] & code_mask; + var cur_key = (ib_code << 8) | k; // (prev, k) unique tuple. + var cur_code = code_table[cur_key]; // buffer + k. + // Check if we have to create a new code table entry. + if (cur_code === undefined) { + // We don't have buffer + k. + // Emit index buffer (without k). + // This is an inline version of emit_code, because this is the core + // writing routine of the compressor (and V8 cannot inline emit_code + // because it is a closure here in a different context). Additionally + // we can call emit_byte_to_buffer less often, because we can have + // 30-bits (from our 31-bit signed SMI), and we know our codes will only + // be 12-bits, so can safely have 18-bits there without overflow. + // emit_code(ib_code); + cur |= ib_code << cur_shift; + cur_shift += cur_code_size; + while (cur_shift >= 8) { + buf[p++] = cur & 255; + cur >>= 8; + cur_shift -= 8; + if (p === cur_subblock + 256) { + // Finished a subblock. + buf[cur_subblock] = 255; + cur_subblock = p++; + } + } + if (next_code === 4096) { + // Table full, need a clear. + emit_code(clear_code); + next_code = eoi_code + 1; + cur_code_size = min_code_size + 1; + code_table = {}; + } else { + // Table not full, insert a new entry. + // Increase our variable bit code sizes if necessary. This is a bit + // tricky as it is based on "timing" between the encoding and + // decoder. From the encoders perspective this should happen after + // we've already emitted the index buffer and are about to create the + // first table entry that would overflow our current code bit size. + if (next_code >= 1 << cur_code_size) ++cur_code_size; + code_table[cur_key] = next_code++; // Insert into code table. + } + ib_code = k; // Index buffer to single input k. + } else { + ib_code = cur_code; // Index buffer to sequence in code table. + } + } + emit_code(ib_code); // There will still be something in the index buffer. + emit_code(eoi_code); // End Of Information. + // Flush / finalize the sub-blocks stream to the buffer. + emit_bytes_to_buffer(1); + // Finish the sub-blocks, writing out any unfinished lengths and + // terminating with a sub-block of length 0. If we have already started + // but not yet used a sub-block it can just become the terminator. + if (cur_subblock + 1 === p) { + // Started but unused. + buf[cur_subblock] = 0; + } else { + // Started and used, write length and additional terminator block. + buf[cur_subblock] = p - cur_subblock - 1; + buf[p++] = 0; + } + return p; + } + function GifReader(buf) { + var p = 0; + // - Header (GIF87a or GIF89a). + if ( + buf[p++] !== 71 || + buf[p++] !== 73 || + buf[p++] !== 70 || + buf[p++] !== 56 || + ((buf[p++] + 1) & 253) !== 56 || + buf[p++] !== 97 + ) { + throw new Error("Invalid GIF 87a/89a header."); + } // - Logical Screen Descriptor. + + var width = buf[p++] | (buf[p++] << 8); + var height = buf[p++] | (buf[p++] << 8); + var pf0 = buf[p++]; // . + var global_palette_flag = pf0 >> 7; + var num_global_colors_pow2 = pf0 & 7; + var num_global_colors = 1 << (num_global_colors_pow2 + 1); + var background = buf[p++]; + buf[p++]; // Pixel aspect ratio (unused?). + var global_palette_offset = null; + var global_palette_size = null; + if (global_palette_flag) { + global_palette_offset = p; + global_palette_size = num_global_colors; + p += num_global_colors * 3; // Seek past palette. + } + var no_eof = true; + var frames = []; + var delay = 0; + var transparent_index = null; + var disposal = 0; // 0 - No disposal specified. + var loop_count = null; + this.width = width; + this.height = height; + while (no_eof && p < buf.length) { + switch (buf[p++]) { + case 33: + // Graphics Control Extension Block + switch (buf[p++]) { + case 255: + // Application specific block + // Try if it's a Netscape block (with animation loop counter). + if ( + buf[p] !== 11 || // 21 FF already read, check block size. + // NETSCAPE2.0 + (buf[p + 1] == 78 && + buf[p + 2] == 69 && + buf[p + 3] == 84 && + buf[p + 4] == 83 && + buf[p + 5] == 67 && + buf[p + 6] == 65 && + buf[p + 7] == 80 && + buf[p + 8] == 69 && + buf[p + 9] == 50 && + buf[p + 10] == 46 && + buf[p + 11] == 48 && // Sub-block + buf[p + 12] == 3 && + buf[p + 13] == 1 && + buf[p + 16] == 0) + ) { + p += 14; + loop_count = buf[p++] | (buf[p++] << 8); + p++; // Skip terminator. + } else { + // We don't know what it is, just try to get past it. + p += 12; + while (true) { + // Seek through subblocks. + var block_size = buf[p++]; + // Bad block size (ex: undefined from an out of bounds read). + if (!(block_size >= 0)) + throw Error("Invalid block size"); + if (block_size === 0) break; // 0 size is terminator + p += block_size; + } + } + break; + case 249: + // Graphics Control Extension + if (buf[p++] !== 4 || buf[p + 4] !== 0) + throw new Error("Invalid graphics extension block."); + var pf1 = buf[p++]; + delay = buf[p++] | (buf[p++] << 8); + transparent_index = buf[p++]; + if ((pf1 & 1) === 0) transparent_index = null; + disposal = (pf1 >> 2) & 7; + p++; // Skip terminator. + break; + case 254: + // Comment Extension. + while (true) { + // Seek through subblocks. + var block_size = buf[p++]; + // Bad block size (ex: undefined from an out of bounds read). + if (!(block_size >= 0)) + throw Error("Invalid block size"); + if (block_size === 0) break; // 0 size is terminator + // console.log(buf.slice(p, p+block_size).toString('ascii')); + p += block_size; + } + break; + default: + throw new Error( + "Unknown graphic control label: 0x" + + buf[p - 1].toString(16), + ); + } + break; + case 44: + // Image Descriptor. + var x = buf[p++] | (buf[p++] << 8); + var y = buf[p++] | (buf[p++] << 8); + var w = buf[p++] | (buf[p++] << 8); + var h = buf[p++] | (buf[p++] << 8); + var pf2 = buf[p++]; + var local_palette_flag = pf2 >> 7; + var interlace_flag = (pf2 >> 6) & 1; + var num_local_colors_pow2 = pf2 & 7; + var num_local_colors = 1 << (num_local_colors_pow2 + 1); + var palette_offset = global_palette_offset; + var palette_size = global_palette_size; + var has_local_palette = false; + if (local_palette_flag) { + var has_local_palette = true; + palette_offset = p; // Override with local palette. + palette_size = num_local_colors; + p += num_local_colors * 3; // Seek past palette. + } + var data_offset = p; + p++; // codesize + while (true) { + var block_size = buf[p++]; + // Bad block size (ex: undefined from an out of bounds read). + if (!(block_size >= 0)) throw Error("Invalid block size"); + if (block_size === 0) break; // 0 size is terminator + p += block_size; + } + frames.push({ + x: x, + y: y, + width: w, + height: h, + has_local_palette: has_local_palette, + palette_offset: palette_offset, + palette_size: palette_size, + data_offset: data_offset, + data_length: p - data_offset, + transparent_index: transparent_index, + interlaced: !!interlace_flag, + delay: delay, + disposal: disposal, + }); + break; + case 59: + // Trailer Marker (end of file). + no_eof = false; + break; + default: + throw new Error( + "Unknown gif block: 0x" + buf[p - 1].toString(16), + ); + break; + } + } + this.numFrames = function () { + return frames.length; + }; + this.loopCount = function () { + return loop_count; + }; + this.frameInfo = function (frame_num) { + if (frame_num < 0 || frame_num >= frames.length) + throw new Error("Frame index out of range."); + return frames[frame_num]; + }; + this.decodeAndBlitFrameBGRA = function (frame_num, pixels) { + var frame = this.frameInfo(frame_num); + var num_pixels = frame.width * frame.height; + var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. + GifReaderLZWOutputIndexStream( + buf, + frame.data_offset, + index_stream, + num_pixels, + ); + var palette_offset = frame.palette_offset; + // NOTE(deanm): It seems to be much faster to compare index to 256 than + // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in + // the profile, not sure if it's related to using a Uint8Array. + var trans = frame.transparent_index; + if (trans === null) trans = 256; + // We are possibly just blitting to a portion of the entire frame. + // That is a subrect within the framerect, so the additional pixels + // must be skipped over after we finished a scanline. + var framewidth = frame.width; + var framestride = width - framewidth; + var xleft = framewidth; // Number of subrect pixels left in scanline. + // Output indicies of the top left and bottom right corners of the subrect. + var opbeg = (frame.y * width + frame.x) * 4; + var opend = ((frame.y + frame.height) * width + frame.x) * 4; + var op = opbeg; + var scanstride = framestride * 4; + // Use scanstride to skip past the rows when interlacing. This is skipping + // 7 rows for the first two passes, then 3 then 1. + if (frame.interlaced === true) { + scanstride += width * 4 * 7; // Pass 1. + } + var interlaceskip = 8; // Tracking the row interval in the current pass. + for (var i = 0, il = index_stream.length; i < il; ++i) { + var index = index_stream[i]; + if (xleft === 0) { + // Beginning of new scan line + op += scanstride; + xleft = framewidth; + if (op >= opend) { + // Catch the wrap to switch passes when interlacing. + scanstride = + framestride * 4 + width * 4 * (interlaceskip - 1); + // interlaceskip / 2 * 4 is interlaceskip << 1. + op = + opbeg + (framewidth + framestride) * (interlaceskip << 1); + interlaceskip >>= 1; + } + } + if (index === trans) { + op += 4; + } else { + var r = buf[palette_offset + index * 3]; + var g = buf[palette_offset + index * 3 + 1]; + var b = buf[palette_offset + index * 3 + 2]; + pixels[op++] = b; + pixels[op++] = g; + pixels[op++] = r; + pixels[op++] = 255; + } + --xleft; + } + }; + // I will go to copy and paste hell one day... + this.decodeAndBlitFrameRGBA = function (frame_num, pixels) { + var frame = this.frameInfo(frame_num); + var num_pixels = frame.width * frame.height; + var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. + GifReaderLZWOutputIndexStream( + buf, + frame.data_offset, + index_stream, + num_pixels, + ); + var palette_offset = frame.palette_offset; + // NOTE(deanm): It seems to be much faster to compare index to 256 than + // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in + // the profile, not sure if it's related to using a Uint8Array. + var trans = frame.transparent_index; + if (trans === null) trans = 256; + // We are possibly just blitting to a portion of the entire frame. + // That is a subrect within the framerect, so the additional pixels + // must be skipped over after we finished a scanline. + var framewidth = frame.width; + var framestride = width - framewidth; + var xleft = framewidth; // Number of subrect pixels left in scanline. + // Output indicies of the top left and bottom right corners of the subrect. + var opbeg = (frame.y * width + frame.x) * 4; + var opend = ((frame.y + frame.height) * width + frame.x) * 4; + var op = opbeg; + var scanstride = framestride * 4; + // Use scanstride to skip past the rows when interlacing. This is skipping + // 7 rows for the first two passes, then 3 then 1. + if (frame.interlaced === true) { + scanstride += width * 4 * 7; // Pass 1. + } + var interlaceskip = 8; // Tracking the row interval in the current pass. + for (var i = 0, il = index_stream.length; i < il; ++i) { + var index = index_stream[i]; + if (xleft === 0) { + // Beginning of new scan line + op += scanstride; + xleft = framewidth; + if (op >= opend) { + // Catch the wrap to switch passes when interlacing. + scanstride = + framestride * 4 + width * 4 * (interlaceskip - 1); + // interlaceskip / 2 * 4 is interlaceskip << 1. + op = + opbeg + (framewidth + framestride) * (interlaceskip << 1); + interlaceskip >>= 1; + } + } + if (index === trans) { + op += 4; + } else { + var r = buf[palette_offset + index * 3]; + var g = buf[palette_offset + index * 3 + 1]; + var b = buf[palette_offset + index * 3 + 2]; + pixels[op++] = r; + pixels[op++] = g; + pixels[op++] = b; + pixels[op++] = 255; + } + --xleft; + } + }; + } + function GifReaderLZWOutputIndexStream( + code_stream, + p, + output, + output_length, + ) { + var min_code_size = code_stream[p++]; + var clear_code = 1 << min_code_size; + var eoi_code = clear_code + 1; + var next_code = eoi_code + 1; + var cur_code_size = min_code_size + 1; // Number of bits per code. + // NOTE: This shares the same name as the encoder, but has a different + // meaning here. Here this masks each code coming from the code stream. + var code_mask = (1 << cur_code_size) - 1; + var cur_shift = 0; + var cur = 0; + var op = 0; // Output pointer. + var subblock_size = code_stream[p++]; + // TODO(deanm): Would using a TypedArray be any faster? At least it would + // solve the fast mode / backing store uncertainty. + // var code_table = Array(4096); + var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits. + var prev_code = null; // Track code-1. + while (true) { + // Read up to two bytes, making sure we always 12-bits for max sized code. + while (cur_shift < 16) { + if (subblock_size === 0) break; // No more data to be read. + cur |= code_stream[p++] << cur_shift; + cur_shift += 8; + if (subblock_size === 1) { + // Never let it get to 0 to hold logic above. + subblock_size = code_stream[p++]; // Next subblock. + } else { + --subblock_size; + } + } // TODO(deanm): We should never really get here, we should have received + // and EOI. + + if (cur_shift < cur_code_size) break; + var code = cur & code_mask; + cur >>= cur_code_size; + cur_shift -= cur_code_size; + // TODO(deanm): Maybe should check that the first code was a clear code, + // at least this is what you're supposed to do. But actually our encoder + // now doesn't emit a clear code first anyway. + if (code === clear_code) { + // We don't actually have to clear the table. This could be a good idea + // for greater error checking, but we don't really do any anyway. We + // will just track it with next_code and overwrite old entries. + next_code = eoi_code + 1; + cur_code_size = min_code_size + 1; + code_mask = (1 << cur_code_size) - 1; + // Don't update prev_code ? + prev_code = null; + continue; + } else if (code === eoi_code) { + break; + } // We have a similar situation as the decoder, where we want to store + // variable length entries (code table entries), but we want to do in a + // faster manner than an array of arrays. The code below stores sort of a + // linked list within the code table, and then "chases" through it to + // construct the dictionary entries. When a new entry is created, just the + // last byte is stored, and the rest (prefix) of the entry is only + // referenced by its table entry. Then the code chases through the + // prefixes until it reaches a single byte code. We have to chase twice, + // first to compute the length, and then to actually copy the data to the + // output (backwards, since we know the length). The alternative would be + // storing something in an intermediate stack, but that doesn't make any + // more sense. I implemented an approach where it also stored the length + // in the code table, although it's a bit tricky because you run out of + // bits (12 + 12 + 8), but I didn't measure much improvements (the table + // entries are generally not the long). Even when I created benchmarks for + // very long table entries the complexity did not seem worth it. + // The code table stores the prefix entry in 12 bits and then the suffix + // byte in 8 bits, so each entry is 20 bits. + + var chase_code = code < next_code ? code : prev_code; + // Chase what we will output, either {CODE} or {CODE-1}. + var chase_length = 0; + var chase = chase_code; + while (chase > clear_code) { + chase = code_table[chase] >> 8; + ++chase_length; + } + var k = chase; + var op_end = op + chase_length + (chase_code !== code ? 1 : 0); + if (op_end > output_length) { + console.log("Warning, gif stream longer than expected."); + return; + } // Already have the first byte from the chase, might as well write it fast. + + output[op++] = k; + op += chase_length; + var b = op; // Track pointer, writing backwards. + if (chase_code !== code) + // The case of emitting {CODE-1} + k. + output[op++] = k; + chase = chase_code; + while (chase_length--) { + chase = code_table[chase]; + output[--b] = chase & 255; // Write backwards. + chase >>= 8; // Pull down to the prefix code. + } + if (prev_code !== null && next_code < 4096) { + code_table[next_code++] = (prev_code << 8) | k; + // TODO(deanm): Figure out this clearing vs code growth logic better. I + // have an feeling that it should just happen somewhere else, for now it + // is awkward between when we grow past the max and then hit a clear code. + // For now just check if we hit the max 12-bits (then a clear code should + // follow, also of course encoded in 12-bits). + if (next_code >= code_mask + 1 && cur_code_size < 12) { + ++cur_code_size; + code_mask = (code_mask << 1) | 1; + } + } + prev_code = code; + } + if (op !== output_length) { + console.log("Warning, gif stream shorter than expected."); + } + return output; + } // CommonJS. + + try { + exports.GifWriter = GifWriter; + exports.GifReader = GifReader; + } catch (e) {} + }, + {}, + ], + 271: [ + function (_dereq_, module, exports) { + (function (Buffer) { + /** + * https://opentype.js.org v0.9.0 | (c) Frederik De Bleser and other contributors | MIT License | Uses tiny-inflate by Devon Govett and string.prototype.codepointat polyfill by Mathias Bynens + */ + (function (global, factory) { + typeof exports === "object" && typeof module !== "undefined" + ? factory(exports) + : typeof define === "function" && define.amd + ? define(["exports"], factory) + : factory((global.opentype = {})); + })(this, function (exports) { + "use strict"; + /*! https://mths.be/codepointat v0.2.0 by @mathias */ + if (!String.prototype.codePointAt) { + (function () { + var defineProperty = (function () { + // IE 8 only supports `Object.defineProperty` on DOM elements + try { + var object = {}; + var $defineProperty = Object.defineProperty; + var result = + $defineProperty(object, object, object) && + $defineProperty; + } catch (error) {} + return result; + })(); + var codePointAt = function (position) { + if (this == null) { + throw TypeError(); + } + var string = String(this); + var size = string.length; + // `ToInteger` + var index = position ? Number(position) : 0; + if (index != index) { + // better `isNaN` + index = 0; + } // Account for out-of-bounds indices: + + if (index < 0 || index >= size) { + return undefined; + } // Get the first code unit + + var first = string.charCodeAt(index); + var second; + if ( + // check if it’s the start of a surrogate pair + first >= 55296 && + first <= 56319 && // high surrogate + size > index + 1 // there is a next code unit + ) { + second = string.charCodeAt(index + 1); + if (second >= 56320 && second <= 57343) { + // low surrogate + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 55296) * 1024 + second - 56320 + 65536; + } + } + return first; + }; + if (defineProperty) { + defineProperty(String.prototype, "codePointAt", { + value: codePointAt, + configurable: true, + writable: true, + }); + } else { + String.prototype.codePointAt = codePointAt; + } + })(); + } + var TINF_OK = 0; + var TINF_DATA_ERROR = -3; + function Tree() { + this.table = new Uint16Array( + 16, + ); /* table of code length counts */ + this.trans = new Uint16Array( + 288, + ); /* code -> symbol translation table */ + } + function Data(source, dest) { + this.source = source; + this.sourceIndex = 0; + this.tag = 0; + this.bitcount = 0; + this.dest = dest; + this.destLen = 0; + this.ltree = new Tree(); /* dynamic length/symbol tree */ + this.dtree = new Tree(); /* dynamic distance tree */ + } /* --------------------------------------------------- * + * -- uninitialized global data (static structures) -- * + * --------------------------------------------------- */ + + var sltree = new Tree(); + var sdtree = new Tree(); + /* extra bits and base tables for length codes */ + var length_bits = new Uint8Array(30); + var length_base = new Uint16Array(30); + /* extra bits and base tables for distance codes */ + var dist_bits = new Uint8Array(30); + var dist_base = new Uint16Array(30); + /* special ordering of code length codes */ + var clcidx = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, + 15, + ]); + /* used by tinf_decode_trees, avoids allocations every call */ + var code_tree = new Tree(); + var lengths = new Uint8Array(288 + 32); + /* ----------------------- * + * -- utility functions -- * + * ----------------------- */ + /* build extra bits and base tables */ + function tinf_build_bits_base(bits, base, delta, first) { + var i, sum; + /* build bits table */ + for (i = 0; i < delta; ++i) { + bits[i] = 0; + } + for (i = 0; i < 30 - delta; ++i) { + bits[i + delta] = (i / delta) | 0; + } /* build base table */ + + for (sum = first, i = 0; i < 30; ++i) { + base[i] = sum; + sum += 1 << bits[i]; + } + } /* build the fixed huffman trees */ + + function tinf_build_fixed_trees(lt, dt) { + var i; + /* build fixed length tree */ + for (i = 0; i < 7; ++i) { + lt.table[i] = 0; + } + lt.table[7] = 24; + lt.table[8] = 152; + lt.table[9] = 112; + for (i = 0; i < 24; ++i) { + lt.trans[i] = 256 + i; + } + for (i = 0; i < 144; ++i) { + lt.trans[24 + i] = i; + } + for (i = 0; i < 8; ++i) { + lt.trans[24 + 144 + i] = 280 + i; + } + for (i = 0; i < 112; ++i) { + lt.trans[24 + 144 + 8 + i] = 144 + i; + } /* build fixed distance tree */ + + for (i = 0; i < 5; ++i) { + dt.table[i] = 0; + } + dt.table[5] = 32; + for (i = 0; i < 32; ++i) { + dt.trans[i] = i; + } + } /* given an array of code lengths, build a tree */ + + var offs = new Uint16Array(16); + function tinf_build_tree(t, lengths, off, num) { + var i, sum; + /* clear code length count table */ + for (i = 0; i < 16; ++i) { + t.table[i] = 0; + } /* scan symbol lengths, and sum code length counts */ + + for (i = 0; i < num; ++i) { + t.table[lengths[off + i]]++; + } + t.table[0] = 0; + /* compute offset table for distribution sort */ + for (sum = 0, i = 0; i < 16; ++i) { + offs[i] = sum; + sum += t.table[i]; + } /* create code->symbol translation table (symbols sorted by code) */ + + for (i = 0; i < num; ++i) { + if (lengths[off + i]) { + t.trans[offs[lengths[off + i]]++] = i; + } + } + } /* ---------------------- * + * -- decode functions -- * + * ---------------------- */ + /* get one bit from source stream */ + + function tinf_getbit(d) { + /* check if tag is empty */ + if (!d.bitcount--) { + /* load next tag */ + d.tag = d.source[d.sourceIndex++]; + d.bitcount = 7; + } /* shift bit out of tag */ + + var bit = d.tag & 1; + d.tag >>>= 1; + return bit; + } /* read a num bit value from a stream and add base */ + + function tinf_read_bits(d, num, base) { + if (!num) { + return base; + } + while (d.bitcount < 24) { + d.tag |= d.source[d.sourceIndex++] << d.bitcount; + d.bitcount += 8; + } + var val = d.tag & (65535 >>> (16 - num)); + d.tag >>>= num; + d.bitcount -= num; + return val + base; + } /* given a data stream and a tree, decode a symbol */ + + function tinf_decode_symbol(d, t) { + while (d.bitcount < 24) { + d.tag |= d.source[d.sourceIndex++] << d.bitcount; + d.bitcount += 8; + } + var sum = 0, + cur = 0, + len = 0; + var tag = d.tag; + /* get more bits while code value is above sum */ + do { + cur = 2 * cur + (tag & 1); + tag >>>= 1; + ++len; + sum += t.table[len]; + cur -= t.table[len]; + } while (cur >= 0); + d.tag = tag; + d.bitcount -= len; + return t.trans[sum + cur]; + } /* given a data stream, decode dynamic trees from it */ + + function tinf_decode_trees(d, lt, dt) { + var hlit, hdist, hclen; + var i, num, length; + /* get 5 bits HLIT (257-286) */ + hlit = tinf_read_bits(d, 5, 257); + /* get 5 bits HDIST (1-32) */ + hdist = tinf_read_bits(d, 5, 1); + /* get 4 bits HCLEN (4-19) */ + hclen = tinf_read_bits(d, 4, 4); + for (i = 0; i < 19; ++i) { + lengths[i] = 0; + } /* read code lengths for code length alphabet */ + + for (i = 0; i < hclen; ++i) { + /* get 3 bits code length (0-7) */ + var clen = tinf_read_bits(d, 3, 0); + lengths[clcidx[i]] = clen; + } /* build code length tree */ + + tinf_build_tree(code_tree, lengths, 0, 19); + /* decode code lengths for the dynamic trees */ + for (num = 0; num < hlit + hdist; ) { + var sym = tinf_decode_symbol(d, code_tree); + switch (sym) { + case 16: + /* copy previous code length 3-6 times (read 2 bits) */ + var prev = lengths[num - 1]; + for (length = tinf_read_bits(d, 2, 3); length; --length) { + lengths[num++] = prev; + } + break; + case 17: + /* repeat code length 0 for 3-10 times (read 3 bits) */ + for (length = tinf_read_bits(d, 3, 3); length; --length) { + lengths[num++] = 0; + } + break; + case 18: + /* repeat code length 0 for 11-138 times (read 7 bits) */ + for ( + length = tinf_read_bits(d, 7, 11); + length; + --length + ) { + lengths[num++] = 0; + } + break; + default: + /* values 0-15 represent the actual code lengths */ + lengths[num++] = sym; + break; + } + } /* build dynamic trees */ + + tinf_build_tree(lt, lengths, 0, hlit); + tinf_build_tree(dt, lengths, hlit, hdist); + } /* ----------------------------- * + * -- block inflate functions -- * + * ----------------------------- */ + /* given a stream and two trees, inflate a block of data */ + + function tinf_inflate_block_data(d, lt, dt) { + while (1) { + var sym = tinf_decode_symbol(d, lt); + /* check for end of block */ + if (sym === 256) { + return TINF_OK; + } + if (sym < 256) { + d.dest[d.destLen++] = sym; + } else { + var length, dist, offs; + var i; + sym -= 257; + /* possibly get more bits from length code */ + length = tinf_read_bits( + d, + length_bits[sym], + length_base[sym], + ); + dist = tinf_decode_symbol(d, dt); + /* possibly get more bits from distance code */ + offs = + d.destLen - + tinf_read_bits(d, dist_bits[dist], dist_base[dist]); + /* copy match */ + for (i = offs; i < offs + length; ++i) { + d.dest[d.destLen++] = d.dest[i]; + } + } + } + } /* inflate an uncompressed block of data */ + + function tinf_inflate_uncompressed_block(d) { + var length, invlength; + var i; + /* unread from bitbuffer */ + while (d.bitcount > 8) { + d.sourceIndex--; + d.bitcount -= 8; + } /* get length */ + + length = d.source[d.sourceIndex + 1]; + length = 256 * length + d.source[d.sourceIndex]; + /* get one's complement of length */ + invlength = d.source[d.sourceIndex + 3]; + invlength = 256 * invlength + d.source[d.sourceIndex + 2]; + /* check length */ + if (length !== (~invlength & 65535)) { + return TINF_DATA_ERROR; + } + d.sourceIndex += 4; + /* copy block */ + for (i = length; i; --i) { + d.dest[d.destLen++] = d.source[d.sourceIndex++]; + } /* make sure we start next block on a byte boundary */ + + d.bitcount = 0; + return TINF_OK; + } /* inflate stream from source to dest */ + + function tinf_uncompress(source, dest) { + var d = new Data(source, dest); + var bfinal, btype, res; + do { + /* read final block flag */ + bfinal = tinf_getbit(d); + /* read block type (2 bits) */ + btype = tinf_read_bits(d, 2, 0); + /* decompress block */ + switch (btype) { + case 0: + /* decompress uncompressed block */ + res = tinf_inflate_uncompressed_block(d); + break; + case 1: + /* decompress block with fixed huffman trees */ + res = tinf_inflate_block_data(d, sltree, sdtree); + break; + case 2: + /* decompress block with dynamic huffman trees */ + tinf_decode_trees(d, d.ltree, d.dtree); + res = tinf_inflate_block_data(d, d.ltree, d.dtree); + break; + default: + res = TINF_DATA_ERROR; + } + if (res !== TINF_OK) { + throw new Error("Data error"); + } + } while (!bfinal); + if (d.destLen < d.dest.length) { + if (typeof d.dest.slice === "function") { + return d.dest.slice(0, d.destLen); + } else { + return d.dest.subarray(0, d.destLen); + } + } + return d.dest; + } /* -------------------- * + * -- initialization -- * + * -------------------- */ + /* build fixed huffman trees */ + + tinf_build_fixed_trees(sltree, sdtree); + /* build extra bits and base tables */ + tinf_build_bits_base(length_bits, length_base, 4, 3); + tinf_build_bits_base(dist_bits, dist_base, 2, 1); + /* fix a special case */ + length_bits[28] = 0; + length_base[28] = 258; + var tinyInflate = tinf_uncompress; + // The Bounding Box object + function derive(v0, v1, v2, v3, t) { + return ( + Math.pow(1 - t, 3) * v0 + + 3 * Math.pow(1 - t, 2) * t * v1 + + 3 * (1 - t) * Math.pow(t, 2) * v2 + + Math.pow(t, 3) * v3 + ); + } /** + * A bounding box is an enclosing box that describes the smallest measure within which all the points lie. + * It is used to calculate the bounding box of a glyph or text path. + * + * On initialization, x1/y1/x2/y2 will be NaN. Check if the bounding box is empty using `isEmpty()`. + * + * @exports opentype.BoundingBox + * @class + * @constructor + */ + + function BoundingBox() { + this.x1 = Number.NaN; + this.y1 = Number.NaN; + this.x2 = Number.NaN; + this.y2 = Number.NaN; + } /** + * Returns true if the bounding box is empty, that is, no points have been added to the box yet. + */ + + BoundingBox.prototype.isEmpty = function () { + return ( + isNaN(this.x1) || + isNaN(this.y1) || + isNaN(this.x2) || + isNaN(this.y2) + ); + }; + /** + * Add the point to the bounding box. + * The x1/y1/x2/y2 coordinates of the bounding box will now encompass the given point. + * @param {number} x - The X coordinate of the point. + * @param {number} y - The Y coordinate of the point. + */ + BoundingBox.prototype.addPoint = function (x, y) { + if (typeof x === "number") { + if (isNaN(this.x1) || isNaN(this.x2)) { + this.x1 = x; + this.x2 = x; + } + if (x < this.x1) { + this.x1 = x; + } + if (x > this.x2) { + this.x2 = x; + } + } + if (typeof y === "number") { + if (isNaN(this.y1) || isNaN(this.y2)) { + this.y1 = y; + this.y2 = y; + } + if (y < this.y1) { + this.y1 = y; + } + if (y > this.y2) { + this.y2 = y; + } + } + }; + /** + * Add a X coordinate to the bounding box. + * This extends the bounding box to include the X coordinate. + * This function is used internally inside of addBezier. + * @param {number} x - The X coordinate of the point. + */ + BoundingBox.prototype.addX = function (x) { + this.addPoint(x, null); + }; + /** + * Add a Y coordinate to the bounding box. + * This extends the bounding box to include the Y coordinate. + * This function is used internally inside of addBezier. + * @param {number} y - The Y coordinate of the point. + */ + BoundingBox.prototype.addY = function (y) { + this.addPoint(null, y); + }; + /** + * Add a Bézier curve to the bounding box. + * This extends the bounding box to include the entire Bézier. + * @param {number} x0 - The starting X coordinate. + * @param {number} y0 - The starting Y coordinate. + * @param {number} x1 - The X coordinate of the first control point. + * @param {number} y1 - The Y coordinate of the first control point. + * @param {number} x2 - The X coordinate of the second control point. + * @param {number} y2 - The Y coordinate of the second control point. + * @param {number} x - The ending X coordinate. + * @param {number} y - The ending Y coordinate. + */ + BoundingBox.prototype.addBezier = function ( + x0, + y0, + x1, + y1, + x2, + y2, + x, + y, + ) { + var this$1 = this; + // This code is based on http://nishiohirokazu.blogspot.com/2009/06/how-to-calculate-bezier-curves-bounding.html + // and https://github.com/icons8/svg-path-bounding-box + var p0 = [x0, y0]; + var p1 = [x1, y1]; + var p2 = [x2, y2]; + var p3 = [x, y]; + this.addPoint(x0, y0); + this.addPoint(x, y); + for (var i = 0; i <= 1; i++) { + var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; + var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; + var c = 3 * p1[i] - 3 * p0[i]; + if (a === 0) { + if (b === 0) { + continue; + } + var t = -c / b; + if (0 < t && t < 1) { + if (i === 0) { + this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t)); + } + if (i === 1) { + this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t)); + } + } + continue; + } + var b2ac = Math.pow(b, 2) - 4 * c * a; + if (b2ac < 0) { + continue; + } + var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); + if (0 < t1 && t1 < 1) { + if (i === 0) { + this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t1)); + } + if (i === 1) { + this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t1)); + } + } + var t2 = (-b - Math.sqrt(b2ac)) / (2 * a); + if (0 < t2 && t2 < 1) { + if (i === 0) { + this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t2)); + } + if (i === 1) { + this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t2)); + } + } + } + }; + /** + * Add a quadratic curve to the bounding box. + * This extends the bounding box to include the entire quadratic curve. + * @param {number} x0 - The starting X coordinate. + * @param {number} y0 - The starting Y coordinate. + * @param {number} x1 - The X coordinate of the control point. + * @param {number} y1 - The Y coordinate of the control point. + * @param {number} x - The ending X coordinate. + * @param {number} y - The ending Y coordinate. + */ + BoundingBox.prototype.addQuad = function (x0, y0, x1, y1, x, y) { + var cp1x = x0 + (2 / 3) * (x1 - x0); + var cp1y = y0 + (2 / 3) * (y1 - y0); + var cp2x = cp1x + (1 / 3) * (x - x0); + var cp2y = cp1y + (1 / 3) * (y - y0); + this.addBezier(x0, y0, cp1x, cp1y, cp2x, cp2y, x, y); + }; + // Geometric objects + /** + * A bézier path containing a set of path commands similar to a SVG path. + * Paths can be drawn on a context using `draw`. + * @exports opentype.Path + * @class + * @constructor + */ + function Path() { + this.commands = []; + this.fill = "black"; + this.stroke = null; + this.strokeWidth = 1; + } /** + * @param {number} x + * @param {number} y + */ + + Path.prototype.moveTo = function (x, y) { + this.commands.push({ + type: "M", + x: x, + y: y, + }); + }; + /** + * @param {number} x + * @param {number} y + */ + Path.prototype.lineTo = function (x, y) { + this.commands.push({ + type: "L", + x: x, + y: y, + }); + }; + /** + * Draws cubic curve + * @function + * curveTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control 1 + * @param {number} y1 - y of control 1 + * @param {number} x2 - x of control 2 + * @param {number} y2 - y of control 2 + * @param {number} x - x of path point + * @param {number} y - y of path point + */ + /** + * Draws cubic curve + * @function + * bezierCurveTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control 1 + * @param {number} y1 - y of control 1 + * @param {number} x2 - x of control 2 + * @param {number} y2 - y of control 2 + * @param {number} x - x of path point + * @param {number} y - y of path point + * @see curveTo + */ + Path.prototype.curveTo = Path.prototype.bezierCurveTo = function ( + x1, + y1, + x2, + y2, + x, + y, + ) { + this.commands.push({ + type: "C", + x1: x1, + y1: y1, + x2: x2, + y2: y2, + x: x, + y: y, + }); + }; + /** + * Draws quadratic curve + * @function + * quadraticCurveTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control + * @param {number} y1 - y of control + * @param {number} x - x of path point + * @param {number} y - y of path point + */ + /** + * Draws quadratic curve + * @function + * quadTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control + * @param {number} y1 - y of control + * @param {number} x - x of path point + * @param {number} y - y of path point + */ + Path.prototype.quadTo = Path.prototype.quadraticCurveTo = + function (x1, y1, x, y) { + this.commands.push({ + type: "Q", + x1: x1, + y1: y1, + x: x, + y: y, + }); + }; + /** + * Closes the path + * @function closePath + * @memberof opentype.Path.prototype + */ + /** + * Close the path + * @function close + * @memberof opentype.Path.prototype + */ + Path.prototype.close = Path.prototype.closePath = function () { + this.commands.push({ + type: "Z", + }); + }; + /** + * Add the given path or list of commands to the commands of this path. + * @param {Array} pathOrCommands - another opentype.Path, an opentype.BoundingBox, or an array of commands. + */ + Path.prototype.extend = function (pathOrCommands) { + if (pathOrCommands.commands) { + pathOrCommands = pathOrCommands.commands; + } else if (pathOrCommands instanceof BoundingBox) { + var box = pathOrCommands; + this.moveTo(box.x1, box.y1); + this.lineTo(box.x2, box.y1); + this.lineTo(box.x2, box.y2); + this.lineTo(box.x1, box.y2); + this.close(); + return; + } + Array.prototype.push.apply(this.commands, pathOrCommands); + }; + /** + * Calculate the bounding box of the path. + * @returns {opentype.BoundingBox} + */ + Path.prototype.getBoundingBox = function () { + var this$1 = this; + var box = new BoundingBox(); + var startX = 0; + var startY = 0; + var prevX = 0; + var prevY = 0; + for (var i = 0; i < this.commands.length; i++) { + var cmd = this$1.commands[i]; + switch (cmd.type) { + case "M": + box.addPoint(cmd.x, cmd.y); + startX = prevX = cmd.x; + startY = prevY = cmd.y; + break; + case "L": + box.addPoint(cmd.x, cmd.y); + prevX = cmd.x; + prevY = cmd.y; + break; + case "Q": + box.addQuad(prevX, prevY, cmd.x1, cmd.y1, cmd.x, cmd.y); + prevX = cmd.x; + prevY = cmd.y; + break; + case "C": + box.addBezier( + prevX, + prevY, + cmd.x1, + cmd.y1, + cmd.x2, + cmd.y2, + cmd.x, + cmd.y, + ); + prevX = cmd.x; + prevY = cmd.y; + break; + case "Z": + prevX = startX; + prevY = startY; + break; + default: + throw new Error("Unexpected path command " + cmd.type); + } + } + if (box.isEmpty()) { + box.addPoint(0, 0); + } + return box; + }; + /** + * Draw the path to a 2D context. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context. + */ + Path.prototype.draw = function (ctx) { + var this$1 = this; + ctx.beginPath(); + for (var i = 0; i < this.commands.length; i += 1) { + var cmd = this$1.commands[i]; + if (cmd.type === "M") { + ctx.moveTo(cmd.x, cmd.y); + } else if (cmd.type === "L") { + ctx.lineTo(cmd.x, cmd.y); + } else if (cmd.type === "C") { + ctx.bezierCurveTo( + cmd.x1, + cmd.y1, + cmd.x2, + cmd.y2, + cmd.x, + cmd.y, + ); + } else if (cmd.type === "Q") { + ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); + } else if (cmd.type === "Z") { + ctx.closePath(); + } + } + if (this.fill) { + ctx.fillStyle = this.fill; + ctx.fill(); + } + if (this.stroke) { + ctx.strokeStyle = this.stroke; + ctx.lineWidth = this.strokeWidth; + ctx.stroke(); + } + }; + /** + * Convert the Path to a string of path data instructions + * See http://www.w3.org/TR/SVG/paths.html#PathData + * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values + * @return {string} + */ + Path.prototype.toPathData = function (decimalPlaces) { + var this$1 = this; + decimalPlaces = decimalPlaces !== undefined ? decimalPlaces : 2; + function floatToString(v) { + if (Math.round(v) === v) { + return "" + Math.round(v); + } else { + return v.toFixed(decimalPlaces); + } + } + function packValues() { + var arguments$1 = arguments; + var s = ""; + for (var i = 0; i < arguments.length; i += 1) { + var v = arguments$1[i]; + if (v >= 0 && i > 0) { + s += " "; + } + s += floatToString(v); + } + return s; + } + var d = ""; + for (var i = 0; i < this.commands.length; i += 1) { + var cmd = this$1.commands[i]; + if (cmd.type === "M") { + d += "M" + packValues(cmd.x, cmd.y); + } else if (cmd.type === "L") { + d += "L" + packValues(cmd.x, cmd.y); + } else if (cmd.type === "C") { + d += + "C" + + packValues(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + } else if (cmd.type === "Q") { + d += "Q" + packValues(cmd.x1, cmd.y1, cmd.x, cmd.y); + } else if (cmd.type === "Z") { + d += "Z"; + } + } + return d; + }; + /** + * Convert the path to an SVG element, as a string. + * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values + * @return {string} + */ + Path.prototype.toSVG = function (decimalPlaces) { + var svg = '= 0 && v <= 255, + "Byte value should be between 0 and 255.", + ); + return [v]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.BYTE = constant(1); + /** + * Convert a 8-bit signed integer to a list of 1 byte. + * @param {string} + * @returns {Array} + */ + encode.CHAR = function (v) { + return [v.charCodeAt(0)]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.CHAR = constant(1); + /** + * Convert an ASCII string to a list of bytes. + * @param {string} + * @returns {Array} + */ + encode.CHARARRAY = function (v) { + var b = []; + for (var i = 0; i < v.length; i += 1) { + b[i] = v.charCodeAt(i); + } + return b; + }; + /** + * @param {Array} + * @returns {number} + */ + sizeOf.CHARARRAY = function (v) { + return v.length; + }; + /** + * Convert a 16-bit unsigned integer to a list of 2 bytes. + * @param {number} + * @returns {Array} + */ + encode.USHORT = function (v) { + return [(v >> 8) & 255, v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.USHORT = constant(2); + /** + * Convert a 16-bit signed integer to a list of 2 bytes. + * @param {number} + * @returns {Array} + */ + encode.SHORT = function (v) { + // Two's complement + if (v >= LIMIT16) { + v = -(2 * LIMIT16 - v); + } + return [(v >> 8) & 255, v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.SHORT = constant(2); + /** + * Convert a 24-bit unsigned integer to a list of 3 bytes. + * @param {number} + * @returns {Array} + */ + encode.UINT24 = function (v) { + return [(v >> 16) & 255, (v >> 8) & 255, v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.UINT24 = constant(3); + /** + * Convert a 32-bit unsigned integer to a list of 4 bytes. + * @param {number} + * @returns {Array} + */ + encode.ULONG = function (v) { + return [ + (v >> 24) & 255, + (v >> 16) & 255, + (v >> 8) & 255, + v & 255, + ]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.ULONG = constant(4); + /** + * Convert a 32-bit unsigned integer to a list of 4 bytes. + * @param {number} + * @returns {Array} + */ + encode.LONG = function (v) { + // Two's complement + if (v >= LIMIT32) { + v = -(2 * LIMIT32 - v); + } + return [ + (v >> 24) & 255, + (v >> 16) & 255, + (v >> 8) & 255, + v & 255, + ]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.LONG = constant(4); + encode.FIXED = encode.ULONG; + sizeOf.FIXED = sizeOf.ULONG; + encode.FWORD = encode.SHORT; + sizeOf.FWORD = sizeOf.SHORT; + encode.UFWORD = encode.USHORT; + sizeOf.UFWORD = sizeOf.USHORT; + /** + * Convert a 32-bit Apple Mac timestamp integer to a list of 8 bytes, 64-bit timestamp. + * @param {number} + * @returns {Array} + */ + encode.LONGDATETIME = function (v) { + return [ + 0, + 0, + 0, + 0, + (v >> 24) & 255, + (v >> 16) & 255, + (v >> 8) & 255, + v & 255, + ]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.LONGDATETIME = constant(8); + /** + * Convert a 4-char tag to a list of 4 bytes. + * @param {string} + * @returns {Array} + */ + encode.TAG = function (v) { + check.argument( + v.length === 4, + "Tag should be exactly 4 ASCII characters.", + ); + return [ + v.charCodeAt(0), + v.charCodeAt(1), + v.charCodeAt(2), + v.charCodeAt(3), + ]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.TAG = constant(4); + // CFF data types /////////////////////////////////////////////////////////// + encode.Card8 = encode.BYTE; + sizeOf.Card8 = sizeOf.BYTE; + encode.Card16 = encode.USHORT; + sizeOf.Card16 = sizeOf.USHORT; + encode.OffSize = encode.BYTE; + sizeOf.OffSize = sizeOf.BYTE; + encode.SID = encode.USHORT; + sizeOf.SID = sizeOf.USHORT; + // Convert a numeric operand or charstring number to a variable-size list of bytes. + /** + * Convert a numeric operand or charstring number to a variable-size list of bytes. + * @param {number} + * @returns {Array} + */ + encode.NUMBER = function (v) { + if (v >= -107 && v <= 107) { + return [v + 139]; + } else if (v >= 108 && v <= 1131) { + v = v - 108; + return [(v >> 8) + 247, v & 255]; + } else if (v >= -1131 && v <= -108) { + v = -v - 108; + return [(v >> 8) + 251, v & 255]; + } else if (v >= -32768 && v <= 32767) { + return encode.NUMBER16(v); + } else { + return encode.NUMBER32(v); + } + }; + /** + * @param {number} + * @returns {number} + */ + sizeOf.NUMBER = function (v) { + return encode.NUMBER(v).length; + }; + /** + * Convert a signed number between -32768 and +32767 to a three-byte value. + * This ensures we always use three bytes, but is not the most compact format. + * @param {number} + * @returns {Array} + */ + encode.NUMBER16 = function (v) { + return [28, (v >> 8) & 255, v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.NUMBER16 = constant(3); + /** + * Convert a signed number between -(2^31) and +(2^31-1) to a five-byte value. + * This is useful if you want to be sure you always use four bytes, + * at the expense of wasting a few bytes for smaller numbers. + * @param {number} + * @returns {Array} + */ + encode.NUMBER32 = function (v) { + return [ + 29, + (v >> 24) & 255, + (v >> 16) & 255, + (v >> 8) & 255, + v & 255, + ]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.NUMBER32 = constant(5); + /** + * @param {number} + * @returns {Array} + */ + encode.REAL = function (v) { + var value = v.toString(); + // Some numbers use an epsilon to encode the value. (e.g. JavaScript will store 0.0000001 as 1e-7) + // This code converts it back to a number without the epsilon. + var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec( + value, + ); + if (m) { + var epsilon = parseFloat( + "1e" + ((m[2] ? +m[2] : 0) + m[1].length), + ); + value = (Math.round(v * epsilon) / epsilon).toString(); + } + var nibbles = ""; + for (var i = 0, ii = value.length; i < ii; i += 1) { + var c = value[i]; + if (c === "e") { + nibbles += value[++i] === "-" ? "c" : "b"; + } else if (c === ".") { + nibbles += "a"; + } else if (c === "-") { + nibbles += "e"; + } else { + nibbles += c; + } + } + nibbles += nibbles.length & 1 ? "f" : "ff"; + var out = [30]; + for (var i$1 = 0, ii$1 = nibbles.length; i$1 < ii$1; i$1 += 2) { + out.push(parseInt(nibbles.substr(i$1, 2), 16)); + } + return out; + }; + /** + * @param {number} + * @returns {number} + */ + sizeOf.REAL = function (v) { + return encode.REAL(v).length; + }; + encode.NAME = encode.CHARARRAY; + sizeOf.NAME = sizeOf.CHARARRAY; + encode.STRING = encode.CHARARRAY; + sizeOf.STRING = sizeOf.CHARARRAY; + /** + * @param {DataView} data + * @param {number} offset + * @param {number} numBytes + * @returns {string} + */ + decode.UTF8 = function (data, offset, numBytes) { + var codePoints = []; + var numChars = numBytes; + for (var j = 0; j < numChars; j++, offset += 1) { + codePoints[j] = data.getUint8(offset); + } + return String.fromCharCode.apply(null, codePoints); + }; + /** + * @param {DataView} data + * @param {number} offset + * @param {number} numBytes + * @returns {string} + */ + decode.UTF16 = function (data, offset, numBytes) { + var codePoints = []; + var numChars = numBytes / 2; + for (var j = 0; j < numChars; j++, offset += 2) { + codePoints[j] = data.getUint16(offset); + } + return String.fromCharCode.apply(null, codePoints); + }; + /** + * Convert a JavaScript string to UTF16-BE. + * @param {string} + * @returns {Array} + */ + encode.UTF16 = function (v) { + var b = []; + for (var i = 0; i < v.length; i += 1) { + var codepoint = v.charCodeAt(i); + b[b.length] = (codepoint >> 8) & 255; + b[b.length] = codepoint & 255; + } + return b; + }; + /** + * @param {string} + * @returns {number} + */ + sizeOf.UTF16 = function (v) { + return v.length * 2; + }; + // Data for converting old eight-bit Macintosh encodings to Unicode. + // This representation is optimized for decoding; encoding is slower + // and needs more memory. The assumption is that all opentype.js users + // want to open fonts, but saving a font will be comparatively rare + // so it can be more expensive. Keyed by IANA character set name. + // + // Python script for generating these strings: + // + // s = u''.join([chr(c).decode('mac_greek') for c in range(128, 256)]) + // print(s.encode('utf-8')) + /** + * @private + */ + var eightBitMacEncodings = { + // Python: 'mac_croatian' + "x-mac-croatian": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø" + + "¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ", + // Python: 'mac_cyrillic' + "x-mac-cyrillic": + "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњ" + + "јЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю", + // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/GAELIC.TXT + "x-mac-gaelic": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæø" + + "ṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ", + // Python: 'mac_greek' + "x-mac-greek": + "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩ" + + "άΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­", + // Python: 'mac_iceland' + "x-mac-icelandic": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø" + + "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", + // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/INUIT.TXT + "x-mac-inuit": + "ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗ" + + "ᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł", + // Python: 'mac_latin2' + "x-mac-ce": + "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅ" + + "ņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", + // Python: 'mac_roman' + macintosh: + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø" + + "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", + // Python: 'mac_romanian' + "x-mac-romanian": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș" + + "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", + // Python: 'mac_turkish' + "x-mac-turkish": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø" + + "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ", + }; + /** + * Decodes an old-style Macintosh string. Returns either a Unicode JavaScript + * string, or 'undefined' if the encoding is unsupported. For example, we do + * not support Chinese, Japanese or Korean because these would need large + * mapping tables. + * @param {DataView} dataView + * @param {number} offset + * @param {number} dataLength + * @param {string} encoding + * @returns {string} + */ + decode.MACSTRING = function ( + dataView, + offset, + dataLength, + encoding, + ) { + var table = eightBitMacEncodings[encoding]; + if (table === undefined) { + return undefined; + } + var result = ""; + for (var i = 0; i < dataLength; i++) { + var c = dataView.getUint8(offset + i); + // In all eight-bit Mac encodings, the characters 0x00..0x7F are + // mapped to U+0000..U+007F; we only need to look up the others. + if (c <= 127) { + result += String.fromCharCode(c); + } else { + result += table[c & 127]; + } + } + return result; + }; + // Helper function for encode.MACSTRING. Returns a dictionary for mapping + // Unicode character codes to their 8-bit MacOS equivalent. This table + // is not exactly a super cheap data structure, but we do not care because + // encoding Macintosh strings is only rarely needed in typical applications. + var macEncodingTableCache = + typeof WeakMap === "function" && new WeakMap(); + var macEncodingCacheKeys; + var getMacEncodingTable = function (encoding) { + // Since we use encoding as a cache key for WeakMap, it has to be + // a String object and not a literal. And at least on NodeJS 2.10.1, + // WeakMap requires that the same String instance is passed for cache hits. + if (!macEncodingCacheKeys) { + macEncodingCacheKeys = {}; + for (var e in eightBitMacEncodings) { + /*jshint -W053 */ // Suppress "Do not use String as a constructor." + macEncodingCacheKeys[e] = new String(e); + } + } + var cacheKey = macEncodingCacheKeys[encoding]; + if (cacheKey === undefined) { + return undefined; + } // We can't do "if (cache.has(key)) {return cache.get(key)}" here: + // since garbage collection may run at any time, it could also kick in + // between the calls to cache.has() and cache.get(). In that case, + // we would return 'undefined' even though we do support the encoding. + + if (macEncodingTableCache) { + var cachedTable = macEncodingTableCache.get(cacheKey); + if (cachedTable !== undefined) { + return cachedTable; + } + } + var decodingTable = eightBitMacEncodings[encoding]; + if (decodingTable === undefined) { + return undefined; + } + var encodingTable = {}; + for (var i = 0; i < decodingTable.length; i++) { + encodingTable[decodingTable.charCodeAt(i)] = i + 128; + } + if (macEncodingTableCache) { + macEncodingTableCache.set(cacheKey, encodingTable); + } + return encodingTable; + }; + /** + * Encodes an old-style Macintosh string. Returns a byte array upon success. + * If the requested encoding is unsupported, or if the input string contains + * a character that cannot be expressed in the encoding, the function returns + * 'undefined'. + * @param {string} str + * @param {string} encoding + * @returns {Array} + */ + encode.MACSTRING = function (str, encoding) { + var table = getMacEncodingTable(encoding); + if (table === undefined) { + return undefined; + } + var result = []; + for (var i = 0; i < str.length; i++) { + var c = str.charCodeAt(i); + // In all eight-bit Mac encodings, the characters 0x00..0x7F are + // mapped to U+0000..U+007F; we only need to look up the others. + if (c >= 128) { + c = table[c]; + if (c === undefined) { + // str contains a Unicode character that cannot be encoded + // in the requested encoding. + return undefined; + } + } + result[i] = c; + // result.push(c); + } + return result; + }; + /** + * @param {string} str + * @param {string} encoding + * @returns {number} + */ + sizeOf.MACSTRING = function (str, encoding) { + var b = encode.MACSTRING(str, encoding); + if (b !== undefined) { + return b.length; + } else { + return 0; + } + }; + // Helper for encode.VARDELTAS + function isByteEncodable(value) { + return value >= -128 && value <= 127; + } // Helper for encode.VARDELTAS + + function encodeVarDeltaRunAsZeroes(deltas, pos, result) { + var runLength = 0; + var numDeltas = deltas.length; + while (pos < numDeltas && runLength < 64 && deltas[pos] === 0) { + ++pos; + ++runLength; + } + result.push(128 | (runLength - 1)); + return pos; + } // Helper for encode.VARDELTAS + + function encodeVarDeltaRunAsBytes(deltas, offset, result) { + var runLength = 0; + var numDeltas = deltas.length; + var pos = offset; + while (pos < numDeltas && runLength < 64) { + var value = deltas[pos]; + if (!isByteEncodable(value)) { + break; + } // Within a byte-encoded run of deltas, a single zero is best + // stored literally as 0x00 value. However, if we have two or + // more zeroes in a sequence, it is better to start a new run. + // Fore example, the sequence of deltas [15, 15, 0, 15, 15] + // becomes 6 bytes (04 0F 0F 00 0F 0F) when storing the zero + // within the current run, but 7 bytes (01 0F 0F 80 01 0F 0F) + // when starting a new run. + + if ( + value === 0 && + pos + 1 < numDeltas && + deltas[pos + 1] === 0 + ) { + break; + } + ++pos; + ++runLength; + } + result.push(runLength - 1); + for (var i = offset; i < pos; ++i) { + result.push((deltas[i] + 256) & 255); + } + return pos; + } // Helper for encode.VARDELTAS + + function encodeVarDeltaRunAsWords(deltas, offset, result) { + var runLength = 0; + var numDeltas = deltas.length; + var pos = offset; + while (pos < numDeltas && runLength < 64) { + var value = deltas[pos]; + // Within a word-encoded run of deltas, it is easiest to start + // a new run (with a different encoding) whenever we encounter + // a zero value. For example, the sequence [0x6666, 0, 0x7777] + // needs 7 bytes when storing the zero inside the current run + // (42 66 66 00 00 77 77), and equally 7 bytes when starting a + // new run (40 66 66 80 40 77 77). + if (value === 0) { + break; + } // Within a word-encoded run of deltas, a single value in the + // range (-128..127) should be encoded within the current run + // because it is more compact. For example, the sequence + // [0x6666, 2, 0x7777] becomes 7 bytes when storing the value + // literally (42 66 66 00 02 77 77), but 8 bytes when starting + // a new run (40 66 66 00 02 40 77 77). + + if ( + isByteEncodable(value) && + pos + 1 < numDeltas && + isByteEncodable(deltas[pos + 1]) + ) { + break; + } + ++pos; + ++runLength; + } + result.push(64 | (runLength - 1)); + for (var i = offset; i < pos; ++i) { + var val = deltas[i]; + result.push(((val + 65536) >> 8) & 255, (val + 256) & 255); + } + return pos; + } /** + * Encode a list of variation adjustment deltas. + * + * Variation adjustment deltas are used in ‘gvar’ and ‘cvar’ tables. + * They indicate how points (in ‘gvar’) or values (in ‘cvar’) get adjusted + * when generating instances of variation fonts. + * + * @see https://www.microsoft.com/typography/otspec/gvar.htm + * @see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gvar.html + * @param {Array} + * @return {Array} + */ + + encode.VARDELTAS = function (deltas) { + var pos = 0; + var result = []; + while (pos < deltas.length) { + var value = deltas[pos]; + if (value === 0) { + pos = encodeVarDeltaRunAsZeroes(deltas, pos, result); + } else if (value >= -128 && value <= 127) { + pos = encodeVarDeltaRunAsBytes(deltas, pos, result); + } else { + pos = encodeVarDeltaRunAsWords(deltas, pos, result); + } + } + return result; + }; + // Convert a list of values to a CFF INDEX structure. + // The values should be objects containing name / type / value. + /** + * @param {Array} l + * @returns {Array} + */ + encode.INDEX = function (l) { + //var offset, offsets, offsetEncoder, encodedOffsets, encodedOffset, data, + // i, v; + // Because we have to know which data type to use to encode the offsets, + // we have to go through the values twice: once to encode the data and + // calculate the offsets, then again to encode the offsets using the fitting data type. + var offset = 1; // First offset is always 1. + var offsets = [offset]; + var data = []; + for (var i = 0; i < l.length; i += 1) { + var v = encode.OBJECT(l[i]); + Array.prototype.push.apply(data, v); + offset += v.length; + offsets.push(offset); + } + if (data.length === 0) { + return [0, 0]; + } + var encodedOffsets = []; + var offSize = + (1 + Math.floor(Math.log(offset) / Math.log(2)) / 8) | 0; + var offsetEncoder = [ + undefined, + encode.BYTE, + encode.USHORT, + encode.UINT24, + encode.ULONG, + ][offSize]; + for (var i$1 = 0; i$1 < offsets.length; i$1 += 1) { + var encodedOffset = offsetEncoder(offsets[i$1]); + Array.prototype.push.apply(encodedOffsets, encodedOffset); + } + return Array.prototype.concat( + encode.Card16(l.length), + encode.OffSize(offSize), + encodedOffsets, + data, + ); + }; + /** + * @param {Array} + * @returns {number} + */ + sizeOf.INDEX = function (v) { + return encode.INDEX(v).length; + }; + /** + * Convert an object to a CFF DICT structure. + * The keys should be numeric. + * The values should be objects containing name / type / value. + * @param {Object} m + * @returns {Array} + */ + encode.DICT = function (m) { + var d = []; + var keys = Object.keys(m); + var length = keys.length; + for (var i = 0; i < length; i += 1) { + // Object.keys() return string keys, but our keys are always numeric. + var k = parseInt(keys[i], 0); + var v = m[k]; + // Value comes before the key. + d = d.concat(encode.OPERAND(v.value, v.type)); + d = d.concat(encode.OPERATOR(k)); + } + return d; + }; + /** + * @param {Object} + * @returns {number} + */ + sizeOf.DICT = function (m) { + return encode.DICT(m).length; + }; + /** + * @param {number} + * @returns {Array} + */ + encode.OPERATOR = function (v) { + if (v < 1200) { + return [v]; + } else { + return [12, v - 1200]; + } + }; + /** + * @param {Array} v + * @param {string} + * @returns {Array} + */ + encode.OPERAND = function (v, type) { + var d = []; + if (Array.isArray(type)) { + for (var i = 0; i < type.length; i += 1) { + check.argument( + v.length === type.length, + "Not enough arguments given for type" + type, + ); + d = d.concat(encode.OPERAND(v[i], type[i])); + } + } else { + if (type === "SID") { + d = d.concat(encode.NUMBER(v)); + } else if (type === "offset") { + // We make it easy for ourselves and always encode offsets as + // 4 bytes. This makes offset calculation for the top dict easier. + d = d.concat(encode.NUMBER32(v)); + } else if (type === "number") { + d = d.concat(encode.NUMBER(v)); + } else if (type === "real") { + d = d.concat(encode.REAL(v)); + } else { + throw new Error("Unknown operand type " + type); + // FIXME Add support for booleans + } + } + return d; + }; + encode.OP = encode.BYTE; + sizeOf.OP = sizeOf.BYTE; + // memoize charstring encoding using WeakMap if available + var wmm = typeof WeakMap === "function" && new WeakMap(); + /** + * Convert a list of CharString operations to bytes. + * @param {Array} + * @returns {Array} + */ + encode.CHARSTRING = function (ops) { + // See encode.MACSTRING for why we don't do "if (wmm && wmm.has(ops))". + if (wmm) { + var cachedValue = wmm.get(ops); + if (cachedValue !== undefined) { + return cachedValue; + } + } + var d = []; + var length = ops.length; + for (var i = 0; i < length; i += 1) { + var op = ops[i]; + d = d.concat(encode[op.type](op.value)); + } + if (wmm) { + wmm.set(ops, d); + } + return d; + }; + /** + * @param {Array} + * @returns {number} + */ + sizeOf.CHARSTRING = function (ops) { + return encode.CHARSTRING(ops).length; + }; + // Utility functions //////////////////////////////////////////////////////// + /** + * Convert an object containing name / type / value to bytes. + * @param {Object} + * @returns {Array} + */ + encode.OBJECT = function (v) { + var encodingFunction = encode[v.type]; + check.argument( + encodingFunction !== undefined, + "No encoding function for type " + v.type, + ); + return encodingFunction(v.value); + }; + /** + * @param {Object} + * @returns {number} + */ + sizeOf.OBJECT = function (v) { + var sizeOfFunction = sizeOf[v.type]; + check.argument( + sizeOfFunction !== undefined, + "No sizeOf function for type " + v.type, + ); + return sizeOfFunction(v.value); + }; + /** + * Convert a table object to bytes. + * A table contains a list of fields containing the metadata (name, type and default value). + * The table itself has the field values set as attributes. + * @param {opentype.Table} + * @returns {Array} + */ + encode.TABLE = function (table) { + var d = []; + var length = table.fields.length; + var subtables = []; + var subtableOffsets = []; + for (var i = 0; i < length; i += 1) { + var field = table.fields[i]; + var encodingFunction = encode[field.type]; + check.argument( + encodingFunction !== undefined, + "No encoding function for field type " + + field.type + + " (" + + field.name + + ")", + ); + var value = table[field.name]; + if (value === undefined) { + value = field.value; + } + var bytes = encodingFunction(value); + if (field.type === "TABLE") { + subtableOffsets.push(d.length); + d = d.concat([0, 0]); + subtables.push(bytes); + } else { + d = d.concat(bytes); + } + } + for (var i$1 = 0; i$1 < subtables.length; i$1 += 1) { + var o = subtableOffsets[i$1]; + var offset = d.length; + check.argument( + offset < 65536, + "Table " + table.tableName + " too big.", + ); + d[o] = offset >> 8; + d[o + 1] = offset & 255; + d = d.concat(subtables[i$1]); + } + return d; + }; + /** + * @param {opentype.Table} + * @returns {number} + */ + sizeOf.TABLE = function (table) { + var numBytes = 0; + var length = table.fields.length; + for (var i = 0; i < length; i += 1) { + var field = table.fields[i]; + var sizeOfFunction = sizeOf[field.type]; + check.argument( + sizeOfFunction !== undefined, + "No sizeOf function for field type " + + field.type + + " (" + + field.name + + ")", + ); + var value = table[field.name]; + if (value === undefined) { + value = field.value; + } + numBytes += sizeOfFunction(value); + // Subtables take 2 more bytes for offsets. + if (field.type === "TABLE") { + numBytes += 2; + } + } + return numBytes; + }; + encode.RECORD = encode.TABLE; + sizeOf.RECORD = sizeOf.TABLE; + // Merge in a list of bytes. + encode.LITERAL = function (v) { + return v; + }; + sizeOf.LITERAL = function (v) { + return v.length; + }; + // Table metadata + /** + * @exports opentype.Table + * @class + * @param {string} tableName + * @param {Array} fields + * @param {Object} options + * @constructor + */ + function Table(tableName, fields, options) { + var this$1 = this; + for (var i = 0; i < fields.length; i += 1) { + var field = fields[i]; + this$1[field.name] = field.value; + } + this.tableName = tableName; + this.fields = fields; + if (options) { + var optionKeys = Object.keys(options); + for (var i$1 = 0; i$1 < optionKeys.length; i$1 += 1) { + var k = optionKeys[i$1]; + var v = options[k]; + if (this$1[k] !== undefined) { + this$1[k] = v; + } + } + } + } /** + * Encodes the table and returns an array of bytes + * @return {Array} + */ + + Table.prototype.encode = function () { + return encode.TABLE(this); + }; + /** + * Get the size of the table. + * @return {number} + */ + Table.prototype.sizeOf = function () { + return sizeOf.TABLE(this); + }; + /** + * @private + */ + function ushortList(itemName, list, count) { + if (count === undefined) { + count = list.length; + } + var fields = new Array(list.length + 1); + fields[0] = { + name: itemName + "Count", + type: "USHORT", + value: count, + }; + for (var i = 0; i < list.length; i++) { + fields[i + 1] = { + name: itemName + i, + type: "USHORT", + value: list[i], + }; + } + return fields; + } /** + * @private + */ + + function tableList(itemName, records, itemCallback) { + var count = records.length; + var fields = new Array(count + 1); + fields[0] = { + name: itemName + "Count", + type: "USHORT", + value: count, + }; + for (var i = 0; i < count; i++) { + fields[i + 1] = { + name: itemName + i, + type: "TABLE", + value: itemCallback(records[i], i), + }; + } + return fields; + } /** + * @private + */ + + function recordList(itemName, records, itemCallback) { + var count = records.length; + var fields = []; + fields[0] = { + name: itemName + "Count", + type: "USHORT", + value: count, + }; + for (var i = 0; i < count; i++) { + fields = fields.concat(itemCallback(records[i], i)); + } + return fields; + } // Common Layout Tables + /** + * @exports opentype.Coverage + * @class + * @param {opentype.Table} + * @constructor + * @extends opentype.Table + */ + + function Coverage(coverageTable) { + if (coverageTable.format === 1) { + Table.call( + this, + "coverageTable", + [ + { + name: "coverageFormat", + type: "USHORT", + value: 1, + }, + ].concat(ushortList("glyph", coverageTable.glyphs)), + ); + } else { + check.assert( + false, + "Can't create coverage table format 2 yet.", + ); + } + } + Coverage.prototype = Object.create(Table.prototype); + Coverage.prototype.constructor = Coverage; + function ScriptList(scriptListTable) { + Table.call( + this, + "scriptListTable", + recordList( + "scriptRecord", + scriptListTable, + function (scriptRecord, i) { + var script = scriptRecord.script; + var defaultLangSys = script.defaultLangSys; + check.assert( + !!defaultLangSys, + "Unable to write GSUB: script " + + scriptRecord.tag + + " has no default language system.", + ); + return [ + { + name: "scriptTag" + i, + type: "TAG", + value: scriptRecord.tag, + }, + { + name: "script" + i, + type: "TABLE", + value: new Table( + "scriptTable", + [ + { + name: "defaultLangSys", + type: "TABLE", + value: new Table( + "defaultLangSys", + [ + { + name: "lookupOrder", + type: "USHORT", + value: 0, + }, + { + name: "reqFeatureIndex", + type: "USHORT", + value: defaultLangSys.reqFeatureIndex, + }, + ].concat( + ushortList( + "featureIndex", + defaultLangSys.featureIndexes, + ), + ), + ), + }, + ].concat( + recordList( + "langSys", + script.langSysRecords, + function (langSysRecord, i) { + var langSys = langSysRecord.langSys; + return [ + { + name: "langSysTag" + i, + type: "TAG", + value: langSysRecord.tag, + }, + { + name: "langSys" + i, + type: "TABLE", + value: new Table( + "langSys", + [ + { + name: "lookupOrder", + type: "USHORT", + value: 0, + }, + { + name: "reqFeatureIndex", + type: "USHORT", + value: langSys.reqFeatureIndex, + }, + ].concat( + ushortList( + "featureIndex", + langSys.featureIndexes, + ), + ), + ), + }, + ]; + }, + ), + ), + ), + }, + ]; + }, + ), + ); + } + ScriptList.prototype = Object.create(Table.prototype); + ScriptList.prototype.constructor = ScriptList; + /** + * @exports opentype.FeatureList + * @class + * @param {opentype.Table} + * @constructor + * @extends opentype.Table + */ + function FeatureList(featureListTable) { + Table.call( + this, + "featureListTable", + recordList( + "featureRecord", + featureListTable, + function (featureRecord, i) { + var feature = featureRecord.feature; + return [ + { + name: "featureTag" + i, + type: "TAG", + value: featureRecord.tag, + }, + { + name: "feature" + i, + type: "TABLE", + value: new Table( + "featureTable", + [ + { + name: "featureParams", + type: "USHORT", + value: feature.featureParams, + }, + ].concat( + ushortList( + "lookupListIndex", + feature.lookupListIndexes, + ), + ), + ), + }, + ]; + }, + ), + ); + } + FeatureList.prototype = Object.create(Table.prototype); + FeatureList.prototype.constructor = FeatureList; + /** + * @exports opentype.LookupList + * @class + * @param {opentype.Table} + * @param {Object} + * @constructor + * @extends opentype.Table + */ + function LookupList(lookupListTable, subtableMakers) { + Table.call( + this, + "lookupListTable", + tableList("lookup", lookupListTable, function (lookupTable) { + var subtableCallback = + subtableMakers[lookupTable.lookupType]; + check.assert( + !!subtableCallback, + "Unable to write GSUB lookup type " + + lookupTable.lookupType + + " tables.", + ); + return new Table( + "lookupTable", + [ + { + name: "lookupType", + type: "USHORT", + value: lookupTable.lookupType, + }, + { + name: "lookupFlag", + type: "USHORT", + value: lookupTable.lookupFlag, + }, + ].concat( + tableList( + "subtable", + lookupTable.subtables, + subtableCallback, + ), + ), + ); + }), + ); + } + LookupList.prototype = Object.create(Table.prototype); + LookupList.prototype.constructor = LookupList; + // Record = same as Table, but inlined (a Table has an offset and its data is further in the stream) + // Don't use offsets inside Records (probable bug), only in Tables. + var table = { + Table: Table, + Record: Table, + Coverage: Coverage, + ScriptList: ScriptList, + FeatureList: FeatureList, + LookupList: LookupList, + ushortList: ushortList, + tableList: tableList, + recordList: recordList, + }; + // Parsing utility functions + // Retrieve an unsigned byte from the DataView. + function getByte(dataView, offset) { + return dataView.getUint8(offset); + } // Retrieve an unsigned 16-bit short from the DataView. + // The value is stored in big endian. + + function getUShort(dataView, offset) { + return dataView.getUint16(offset, false); + } // Retrieve a signed 16-bit short from the DataView. + // The value is stored in big endian. + + function getShort(dataView, offset) { + return dataView.getInt16(offset, false); + } // Retrieve an unsigned 32-bit long from the DataView. + // The value is stored in big endian. + + function getULong(dataView, offset) { + return dataView.getUint32(offset, false); + } // Retrieve a 32-bit signed fixed-point number (16.16) from the DataView. + // The value is stored in big endian. + + function getFixed(dataView, offset) { + var decimal = dataView.getInt16(offset, false); + var fraction = dataView.getUint16(offset + 2, false); + return decimal + fraction / 65535; + } // Retrieve a 4-character tag from the DataView. + // Tags are used to identify tables. + + function getTag(dataView, offset) { + var tag = ""; + for (var i = offset; i < offset + 4; i += 1) { + tag += String.fromCharCode(dataView.getInt8(i)); + } + return tag; + } // Retrieve an offset from the DataView. + // Offsets are 1 to 4 bytes in length, depending on the offSize argument. + + function getOffset(dataView, offset, offSize) { + var v = 0; + for (var i = 0; i < offSize; i += 1) { + v <<= 8; + v += dataView.getUint8(offset + i); + } + return v; + } // Retrieve a number of bytes from start offset to the end offset from the DataView. + + function getBytes(dataView, startOffset, endOffset) { + var bytes = []; + for (var i = startOffset; i < endOffset; i += 1) { + bytes.push(dataView.getUint8(i)); + } + return bytes; + } // Convert the list of bytes to a string. + + function bytesToString(bytes) { + var s = ""; + for (var i = 0; i < bytes.length; i += 1) { + s += String.fromCharCode(bytes[i]); + } + return s; + } + var typeOffsets = { + byte: 1, + uShort: 2, + short: 2, + uLong: 4, + fixed: 4, + longDateTime: 8, + tag: 4, + }; + // A stateful parser that changes the offset whenever a value is retrieved. + // The data is a DataView. + function Parser(data, offset) { + this.data = data; + this.offset = offset; + this.relativeOffset = 0; + } + Parser.prototype.parseByte = function () { + var v = this.data.getUint8(this.offset + this.relativeOffset); + this.relativeOffset += 1; + return v; + }; + Parser.prototype.parseChar = function () { + var v = this.data.getInt8(this.offset + this.relativeOffset); + this.relativeOffset += 1; + return v; + }; + Parser.prototype.parseCard8 = Parser.prototype.parseByte; + Parser.prototype.parseUShort = function () { + var v = this.data.getUint16(this.offset + this.relativeOffset); + this.relativeOffset += 2; + return v; + }; + Parser.prototype.parseCard16 = Parser.prototype.parseUShort; + Parser.prototype.parseSID = Parser.prototype.parseUShort; + Parser.prototype.parseOffset16 = Parser.prototype.parseUShort; + Parser.prototype.parseShort = function () { + var v = this.data.getInt16(this.offset + this.relativeOffset); + this.relativeOffset += 2; + return v; + }; + Parser.prototype.parseF2Dot14 = function () { + var v = + this.data.getInt16(this.offset + this.relativeOffset) / 16384; + this.relativeOffset += 2; + return v; + }; + Parser.prototype.parseULong = function () { + var v = getULong(this.data, this.offset + this.relativeOffset); + this.relativeOffset += 4; + return v; + }; + Parser.prototype.parseOffset32 = Parser.prototype.parseULong; + Parser.prototype.parseFixed = function () { + var v = getFixed(this.data, this.offset + this.relativeOffset); + this.relativeOffset += 4; + return v; + }; + Parser.prototype.parseString = function (length) { + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + var string = ""; + this.relativeOffset += length; + for (var i = 0; i < length; i++) { + string += String.fromCharCode(dataView.getUint8(offset + i)); + } + return string; + }; + Parser.prototype.parseTag = function () { + return this.parseString(4); + }; + // LONGDATETIME is a 64-bit integer. + // JavaScript and unix timestamps traditionally use 32 bits, so we + // only take the last 32 bits. + // + Since until 2038 those bits will be filled by zeros we can ignore them. + Parser.prototype.parseLongDateTime = function () { + var v = getULong( + this.data, + this.offset + this.relativeOffset + 4, + ); + // Subtract seconds between 01/01/1904 and 01/01/1970 + // to convert Apple Mac timestamp to Standard Unix timestamp + v -= 2082844800; + this.relativeOffset += 8; + return v; + }; + Parser.prototype.parseVersion = function (minorBase) { + var major = getUShort( + this.data, + this.offset + this.relativeOffset, + ); + // How to interpret the minor version is very vague in the spec. 0x5000 is 5, 0x1000 is 1 + // Default returns the correct number if minor = 0xN000 where N is 0-9 + // Set minorBase to 1 for tables that use minor = N where N is 0-9 + var minor = getUShort( + this.data, + this.offset + this.relativeOffset + 2, + ); + this.relativeOffset += 4; + if (minorBase === undefined) { + minorBase = 4096; + } + return major + minor / minorBase / 10; + }; + Parser.prototype.skip = function (type, amount) { + if (amount === undefined) { + amount = 1; + } + this.relativeOffset += typeOffsets[type] * amount; + }; + ///// Parsing lists and records /////////////////////////////// + // Parse a list of 32 bit unsigned integers. + Parser.prototype.parseULongList = function (count) { + if (count === undefined) { + count = this.parseULong(); + } + var offsets = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + offsets[i] = dataView.getUint32(offset); + offset += 4; + } + this.relativeOffset += count * 4; + return offsets; + }; + // Parse a list of 16 bit unsigned integers. The length of the list can be read on the stream + // or provided as an argument. + Parser.prototype.parseOffset16List = + Parser.prototype.parseUShortList = function (count) { + if (count === undefined) { + count = this.parseUShort(); + } + var offsets = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + offsets[i] = dataView.getUint16(offset); + offset += 2; + } + this.relativeOffset += count * 2; + return offsets; + }; + // Parses a list of 16 bit signed integers. + Parser.prototype.parseShortList = function (count) { + var list = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + list[i] = dataView.getInt16(offset); + offset += 2; + } + this.relativeOffset += count * 2; + return list; + }; + // Parses a list of bytes. + Parser.prototype.parseByteList = function (count) { + var list = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + list[i] = dataView.getUint8(offset++); + } + this.relativeOffset += count; + return list; + }; + /** + * Parse a list of items. + * Record count is optional, if omitted it is read from the stream. + * itemCallback is one of the Parser methods. + */ + Parser.prototype.parseList = function (count, itemCallback) { + var this$1 = this; + if (!itemCallback) { + itemCallback = count; + count = this.parseUShort(); + } + var list = new Array(count); + for (var i = 0; i < count; i++) { + list[i] = itemCallback.call(this$1); + } + return list; + }; + Parser.prototype.parseList32 = function (count, itemCallback) { + var this$1 = this; + if (!itemCallback) { + itemCallback = count; + count = this.parseULong(); + } + var list = new Array(count); + for (var i = 0; i < count; i++) { + list[i] = itemCallback.call(this$1); + } + return list; + }; + /** + * Parse a list of records. + * Record count is optional, if omitted it is read from the stream. + * Example of recordDescription: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } + */ + Parser.prototype.parseRecordList = function ( + count, + recordDescription, + ) { + var this$1 = this; + // If the count argument is absent, read it in the stream. + if (!recordDescription) { + recordDescription = count; + count = this.parseUShort(); + } + var records = new Array(count); + var fields = Object.keys(recordDescription); + for (var i = 0; i < count; i++) { + var rec = {}; + for (var j = 0; j < fields.length; j++) { + var fieldName = fields[j]; + var fieldType = recordDescription[fieldName]; + rec[fieldName] = fieldType.call(this$1); + } + records[i] = rec; + } + return records; + }; + Parser.prototype.parseRecordList32 = function ( + count, + recordDescription, + ) { + var this$1 = this; + // If the count argument is absent, read it in the stream. + if (!recordDescription) { + recordDescription = count; + count = this.parseULong(); + } + var records = new Array(count); + var fields = Object.keys(recordDescription); + for (var i = 0; i < count; i++) { + var rec = {}; + for (var j = 0; j < fields.length; j++) { + var fieldName = fields[j]; + var fieldType = recordDescription[fieldName]; + rec[fieldName] = fieldType.call(this$1); + } + records[i] = rec; + } + return records; + }; + // Parse a data structure into an object + // Example of description: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } + Parser.prototype.parseStruct = function (description) { + var this$1 = this; + if (typeof description === "function") { + return description.call(this); + } else { + var fields = Object.keys(description); + var struct = {}; + for (var j = 0; j < fields.length; j++) { + var fieldName = fields[j]; + var fieldType = description[fieldName]; + struct[fieldName] = fieldType.call(this$1); + } + return struct; + } + }; + /** + * Parse a GPOS valueRecord + * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record + * valueFormat is optional, if omitted it is read from the stream. + */ + Parser.prototype.parseValueRecord = function (valueFormat) { + if (valueFormat === undefined) { + valueFormat = this.parseUShort(); + } + if (valueFormat === 0) { + // valueFormat2 in kerning pairs is most often 0 + // in this case return undefined instead of an empty object, to save space + return; + } + var valueRecord = {}; + if (valueFormat & 1) { + valueRecord.xPlacement = this.parseShort(); + } + if (valueFormat & 2) { + valueRecord.yPlacement = this.parseShort(); + } + if (valueFormat & 4) { + valueRecord.xAdvance = this.parseShort(); + } + if (valueFormat & 8) { + valueRecord.yAdvance = this.parseShort(); + } // Device table (non-variable font) / VariationIndex table (variable font) not supported + // https://docs.microsoft.com/fr-fr/typography/opentype/spec/chapter2#devVarIdxTbls + + if (valueFormat & 16) { + valueRecord.xPlaDevice = undefined; + this.parseShort(); + } + if (valueFormat & 32) { + valueRecord.yPlaDevice = undefined; + this.parseShort(); + } + if (valueFormat & 64) { + valueRecord.xAdvDevice = undefined; + this.parseShort(); + } + if (valueFormat & 128) { + valueRecord.yAdvDevice = undefined; + this.parseShort(); + } + return valueRecord; + }; + /** + * Parse a list of GPOS valueRecords + * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record + * valueFormat and valueCount are read from the stream. + */ + Parser.prototype.parseValueRecordList = function () { + var this$1 = this; + var valueFormat = this.parseUShort(); + var valueCount = this.parseUShort(); + var values = new Array(valueCount); + for (var i = 0; i < valueCount; i++) { + values[i] = this$1.parseValueRecord(valueFormat); + } + return values; + }; + Parser.prototype.parsePointer = function (description) { + var structOffset = this.parseOffset16(); + if (structOffset > 0) { + // NULL offset => return undefined + return new Parser( + this.data, + this.offset + structOffset, + ).parseStruct(description); + } + return undefined; + }; + Parser.prototype.parsePointer32 = function (description) { + var structOffset = this.parseOffset32(); + if (structOffset > 0) { + // NULL offset => return undefined + return new Parser( + this.data, + this.offset + structOffset, + ).parseStruct(description); + } + return undefined; + }; + /** + * Parse a list of offsets to lists of 16-bit integers, + * or a list of offsets to lists of offsets to any kind of items. + * If itemCallback is not provided, a list of list of UShort is assumed. + * If provided, itemCallback is called on each item and must parse the item. + * See examples in tables/gsub.js + */ + Parser.prototype.parseListOfLists = function (itemCallback) { + var this$1 = this; + var offsets = this.parseOffset16List(); + var count = offsets.length; + var relativeOffset = this.relativeOffset; + var list = new Array(count); + for (var i = 0; i < count; i++) { + var start = offsets[i]; + if (start === 0) { + // NULL offset + // Add i as owned property to list. Convenient with assert. + list[i] = undefined; + continue; + } + this$1.relativeOffset = start; + if (itemCallback) { + var subOffsets = this$1.parseOffset16List(); + var subList = new Array(subOffsets.length); + for (var j = 0; j < subOffsets.length; j++) { + this$1.relativeOffset = start + subOffsets[j]; + subList[j] = itemCallback.call(this$1); + } + list[i] = subList; + } else { + list[i] = this$1.parseUShortList(); + } + } + this.relativeOffset = relativeOffset; + return list; + }; + ///// Complex tables parsing ////////////////////////////////// + // Parse a coverage table in a GSUB, GPOS or GDEF table. + // https://www.microsoft.com/typography/OTSPEC/chapter2.htm + // parser.offset must point to the start of the table containing the coverage. + Parser.prototype.parseCoverage = function () { + var this$1 = this; + var startOffset = this.offset + this.relativeOffset; + var format = this.parseUShort(); + var count = this.parseUShort(); + if (format === 1) { + return { + format: 1, + glyphs: this.parseUShortList(count), + }; + } else if (format === 2) { + var ranges = new Array(count); + for (var i = 0; i < count; i++) { + ranges[i] = { + start: this$1.parseUShort(), + end: this$1.parseUShort(), + index: this$1.parseUShort(), + }; + } + return { + format: 2, + ranges: ranges, + }; + } + throw new Error( + "0x" + + startOffset.toString(16) + + ": Coverage format must be 1 or 2.", + ); + }; + // Parse a Class Definition Table in a GSUB, GPOS or GDEF table. + // https://www.microsoft.com/typography/OTSPEC/chapter2.htm + Parser.prototype.parseClassDef = function () { + var startOffset = this.offset + this.relativeOffset; + var format = this.parseUShort(); + if (format === 1) { + return { + format: 1, + startGlyph: this.parseUShort(), + classes: this.parseUShortList(), + }; + } else if (format === 2) { + return { + format: 2, + ranges: this.parseRecordList({ + start: Parser.uShort, + end: Parser.uShort, + classId: Parser.uShort, + }), + }; + } + throw new Error( + "0x" + + startOffset.toString(16) + + ": ClassDef format must be 1 or 2.", + ); + }; + ///// Static methods /////////////////////////////////// + // These convenience methods can be used as callbacks and should be called with "this" context set to a Parser instance. + Parser.list = function (count, itemCallback) { + return function () { + return this.parseList(count, itemCallback); + }; + }; + Parser.list32 = function (count, itemCallback) { + return function () { + return this.parseList32(count, itemCallback); + }; + }; + Parser.recordList = function (count, recordDescription) { + return function () { + return this.parseRecordList(count, recordDescription); + }; + }; + Parser.recordList32 = function (count, recordDescription) { + return function () { + return this.parseRecordList32(count, recordDescription); + }; + }; + Parser.pointer = function (description) { + return function () { + return this.parsePointer(description); + }; + }; + Parser.pointer32 = function (description) { + return function () { + return this.parsePointer32(description); + }; + }; + Parser.tag = Parser.prototype.parseTag; + Parser.byte = Parser.prototype.parseByte; + Parser.uShort = Parser.offset16 = Parser.prototype.parseUShort; + Parser.uShortList = Parser.prototype.parseUShortList; + Parser.uLong = Parser.offset32 = Parser.prototype.parseULong; + Parser.uLongList = Parser.prototype.parseULongList; + Parser.struct = Parser.prototype.parseStruct; + Parser.coverage = Parser.prototype.parseCoverage; + Parser.classDef = Parser.prototype.parseClassDef; + ///// Script, Feature, Lookup lists /////////////////////////////////////////////// + // https://www.microsoft.com/typography/OTSPEC/chapter2.htm + var langSysTable = { + reserved: Parser.uShort, + reqFeatureIndex: Parser.uShort, + featureIndexes: Parser.uShortList, + }; + Parser.prototype.parseScriptList = function () { + return ( + this.parsePointer( + Parser.recordList({ + tag: Parser.tag, + script: Parser.pointer({ + defaultLangSys: Parser.pointer(langSysTable), + langSysRecords: Parser.recordList({ + tag: Parser.tag, + langSys: Parser.pointer(langSysTable), + }), + }), + }), + ) || [] + ); + }; + Parser.prototype.parseFeatureList = function () { + return ( + this.parsePointer( + Parser.recordList({ + tag: Parser.tag, + feature: Parser.pointer({ + featureParams: Parser.offset16, + lookupListIndexes: Parser.uShortList, + }), + }), + ) || [] + ); + }; + Parser.prototype.parseLookupList = function (lookupTableParsers) { + return ( + this.parsePointer( + Parser.list( + Parser.pointer(function () { + var lookupType = this.parseUShort(); + check.argument( + 1 <= lookupType && lookupType <= 9, + "GPOS/GSUB lookup type " + lookupType + " unknown.", + ); + var lookupFlag = this.parseUShort(); + var useMarkFilteringSet = lookupFlag & 16; + return { + lookupType: lookupType, + lookupFlag: lookupFlag, + subtables: this.parseList( + Parser.pointer(lookupTableParsers[lookupType]), + ), + markFilteringSet: useMarkFilteringSet + ? this.parseUShort() + : undefined, + }; + }), + ), + ) || [] + ); + }; + Parser.prototype.parseFeatureVariationsList = function () { + return ( + this.parsePointer32(function () { + var majorVersion = this.parseUShort(); + var minorVersion = this.parseUShort(); + check.argument( + majorVersion === 1 && minorVersion < 1, + "GPOS/GSUB feature variations table unknown.", + ); + var featureVariations = this.parseRecordList32({ + conditionSetOffset: Parser.offset32, + featureTableSubstitutionOffset: Parser.offset32, + }); + return featureVariations; + }) || [] + ); + }; + var parse = { + getByte: getByte, + getCard8: getByte, + getUShort: getUShort, + getCard16: getUShort, + getShort: getShort, + getULong: getULong, + getFixed: getFixed, + getTag: getTag, + getOffset: getOffset, + getBytes: getBytes, + bytesToString: bytesToString, + Parser: Parser, + }; + // The `cmap` table stores the mappings from characters to glyphs. + function parseCmapTableFormat12(cmap, p) { + //Skip reserved. + p.parseUShort(); + // Length in bytes of the sub-tables. + cmap.length = p.parseULong(); + cmap.language = p.parseULong(); + var groupCount; + cmap.groupCount = groupCount = p.parseULong(); + cmap.glyphIndexMap = {}; + for (var i = 0; i < groupCount; i += 1) { + var startCharCode = p.parseULong(); + var endCharCode = p.parseULong(); + var startGlyphId = p.parseULong(); + for (var c = startCharCode; c <= endCharCode; c += 1) { + cmap.glyphIndexMap[c] = startGlyphId; + startGlyphId++; + } + } + } + function parseCmapTableFormat4(cmap, p, data, start, offset) { + // Length in bytes of the sub-tables. + cmap.length = p.parseUShort(); + cmap.language = p.parseUShort(); + // segCount is stored x 2. + var segCount; + cmap.segCount = segCount = p.parseUShort() >> 1; + // Skip searchRange, entrySelector, rangeShift. + p.skip("uShort", 3); + // The "unrolled" mapping from character codes to glyph indices. + cmap.glyphIndexMap = {}; + var endCountParser = new parse.Parser( + data, + start + offset + 14, + ); + var startCountParser = new parse.Parser( + data, + start + offset + 16 + segCount * 2, + ); + var idDeltaParser = new parse.Parser( + data, + start + offset + 16 + segCount * 4, + ); + var idRangeOffsetParser = new parse.Parser( + data, + start + offset + 16 + segCount * 6, + ); + var glyphIndexOffset = start + offset + 16 + segCount * 8; + for (var i = 0; i < segCount - 1; i += 1) { + var glyphIndex = void 0; + var endCount = endCountParser.parseUShort(); + var startCount = startCountParser.parseUShort(); + var idDelta = idDeltaParser.parseShort(); + var idRangeOffset = idRangeOffsetParser.parseUShort(); + for (var c = startCount; c <= endCount; c += 1) { + if (idRangeOffset !== 0) { + // The idRangeOffset is relative to the current position in the idRangeOffset array. + // Take the current offset in the idRangeOffset array. + glyphIndexOffset = + idRangeOffsetParser.offset + + idRangeOffsetParser.relativeOffset - + 2; + // Add the value of the idRangeOffset, which will move us into the glyphIndex array. + glyphIndexOffset += idRangeOffset; + // Then add the character index of the current segment, multiplied by 2 for USHORTs. + glyphIndexOffset += (c - startCount) * 2; + glyphIndex = parse.getUShort(data, glyphIndexOffset); + if (glyphIndex !== 0) { + glyphIndex = (glyphIndex + idDelta) & 65535; + } + } else { + glyphIndex = (c + idDelta) & 65535; + } + cmap.glyphIndexMap[c] = glyphIndex; + } + } + } // Parse the `cmap` table. This table stores the mappings from characters to glyphs. + // There are many available formats, but we only support the Windows format 4 and 12. + // This function returns a `CmapEncoding` object or null if no supported format could be found. + + function parseCmapTable(data, start) { + var cmap = {}; + cmap.version = parse.getUShort(data, start); + check.argument( + cmap.version === 0, + "cmap table version should be 0.", + ); + // The cmap table can contain many sub-tables, each with their own format. + // We're only interested in a "platform 0" (Unicode format) and "platform 3" (Windows format) table. + cmap.numTables = parse.getUShort(data, start + 2); + var offset = -1; + for (var i = cmap.numTables - 1; i >= 0; i -= 1) { + var platformId = parse.getUShort(data, start + 4 + i * 8); + var encodingId = parse.getUShort(data, start + 4 + i * 8 + 2); + if ( + (platformId === 3 && + (encodingId === 0 || + encodingId === 1 || + encodingId === 10)) || + (platformId === 0 && + (encodingId === 0 || + encodingId === 1 || + encodingId === 2 || + encodingId === 3 || + encodingId === 4)) + ) { + offset = parse.getULong(data, start + 4 + i * 8 + 4); + break; + } + } + if (offset === -1) { + // There is no cmap table in the font that we support. + throw new Error("No valid cmap sub-tables found."); + } + var p = new parse.Parser(data, start + offset); + cmap.format = p.parseUShort(); + if (cmap.format === 12) { + parseCmapTableFormat12(cmap, p); + } else if (cmap.format === 4) { + parseCmapTableFormat4(cmap, p, data, start, offset); + } else { + throw new Error( + "Only format 4 and 12 cmap tables are supported (found format " + + cmap.format + + ").", + ); + } + return cmap; + } + function addSegment(t, code, glyphIndex) { + t.segments.push({ + end: code, + start: code, + delta: -(code - glyphIndex), + offset: 0, + glyphIndex: glyphIndex, + }); + } + function addTerminatorSegment(t) { + t.segments.push({ + end: 65535, + start: 65535, + delta: 1, + offset: 0, + }); + } // Make cmap table, format 4 by default, 12 if needed only + + function makeCmapTable(glyphs) { + // Plan 0 is the base Unicode Plan but emojis, for example are on another plan, and needs cmap 12 format (with 32bit) + var isPlan0Only = true; + var i; + // Check if we need to add cmap format 12 or if format 4 only is fine + for (i = glyphs.length - 1; i > 0; i -= 1) { + var g = glyphs.get(i); + if (g.unicode > 65535) { + console.log("Adding CMAP format 12 (needed!)"); + isPlan0Only = false; + break; + } + } + var cmapTable = [ + { + name: "version", + type: "USHORT", + value: 0, + }, + { + name: "numTables", + type: "USHORT", + value: isPlan0Only ? 1 : 2, + }, + // CMAP 4 header + { + name: "platformID", + type: "USHORT", + value: 3, + }, + { + name: "encodingID", + type: "USHORT", + value: 1, + }, + { + name: "offset", + type: "ULONG", + value: isPlan0Only ? 12 : 12 + 8, + }, + ]; + if (!isPlan0Only) { + cmapTable = cmapTable.concat([ + // CMAP 12 header + { + name: "cmap12PlatformID", + type: "USHORT", + value: 3, + }, + // We encode only for PlatformID = 3 (Windows) because it is supported everywhere + { + name: "cmap12EncodingID", + type: "USHORT", + value: 10, + }, + { + name: "cmap12Offset", + type: "ULONG", + value: 0, + }, + ]); + } + cmapTable = cmapTable.concat([ + // CMAP 4 Subtable + { + name: "format", + type: "USHORT", + value: 4, + }, + { + name: "cmap4Length", + type: "USHORT", + value: 0, + }, + { + name: "language", + type: "USHORT", + value: 0, + }, + { + name: "segCountX2", + type: "USHORT", + value: 0, + }, + { + name: "searchRange", + type: "USHORT", + value: 0, + }, + { + name: "entrySelector", + type: "USHORT", + value: 0, + }, + { + name: "rangeShift", + type: "USHORT", + value: 0, + }, + ]); + var t = new table.Table("cmap", cmapTable); + t.segments = []; + for (i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + for (var j = 0; j < glyph.unicodes.length; j += 1) { + addSegment(t, glyph.unicodes[j], i); + } + t.segments = t.segments.sort(function (a, b) { + return a.start - b.start; + }); + } + addTerminatorSegment(t); + var segCount = t.segments.length; + var segCountToRemove = 0; + // CMAP 4 + // Set up parallel segment arrays. + var endCounts = []; + var startCounts = []; + var idDeltas = []; + var idRangeOffsets = []; + var glyphIds = []; + // CMAP 12 + var cmap12Groups = []; + // Reminder this loop is not following the specification at 100% + // The specification -> find suites of characters and make a group + // Here we're doing one group for each letter + // Doing as the spec can save 8 times (or more) space + for (i = 0; i < segCount; i += 1) { + var segment = t.segments[i]; + // CMAP 4 + if (segment.end <= 65535 && segment.start <= 65535) { + endCounts = endCounts.concat({ + name: "end_" + i, + type: "USHORT", + value: segment.end, + }); + startCounts = startCounts.concat({ + name: "start_" + i, + type: "USHORT", + value: segment.start, + }); + idDeltas = idDeltas.concat({ + name: "idDelta_" + i, + type: "SHORT", + value: segment.delta, + }); + idRangeOffsets = idRangeOffsets.concat({ + name: "idRangeOffset_" + i, + type: "USHORT", + value: segment.offset, + }); + if (segment.glyphId !== undefined) { + glyphIds = glyphIds.concat({ + name: "glyph_" + i, + type: "USHORT", + value: segment.glyphId, + }); + } + } else { + // Skip Unicode > 65535 (16bit unsigned max) for CMAP 4, will be added in CMAP 12 + segCountToRemove += 1; + } // CMAP 12 + // Skip Terminator Segment + + if (!isPlan0Only && segment.glyphIndex !== undefined) { + cmap12Groups = cmap12Groups.concat({ + name: "cmap12Start_" + i, + type: "ULONG", + value: segment.start, + }); + cmap12Groups = cmap12Groups.concat({ + name: "cmap12End_" + i, + type: "ULONG", + value: segment.end, + }); + cmap12Groups = cmap12Groups.concat({ + name: "cmap12Glyph_" + i, + type: "ULONG", + value: segment.glyphIndex, + }); + } + } // CMAP 4 Subtable + + t.segCountX2 = (segCount - segCountToRemove) * 2; + t.searchRange = + Math.pow( + 2, + Math.floor( + Math.log(segCount - segCountToRemove) / Math.log(2), + ), + ) * 2; + t.entrySelector = Math.log(t.searchRange / 2) / Math.log(2); + t.rangeShift = t.segCountX2 - t.searchRange; + t.fields = t.fields.concat(endCounts); + t.fields.push({ + name: "reservedPad", + type: "USHORT", + value: 0, + }); + t.fields = t.fields.concat(startCounts); + t.fields = t.fields.concat(idDeltas); + t.fields = t.fields.concat(idRangeOffsets); + t.fields = t.fields.concat(glyphIds); + t.cmap4Length = + 14 + // Subtable header + endCounts.length * 2 + + 2 + // reservedPad + startCounts.length * 2 + + idDeltas.length * 2 + + idRangeOffsets.length * 2 + + glyphIds.length * 2; + if (!isPlan0Only) { + // CMAP 12 Subtable + var cmap12Length = + 16 + // Subtable header + cmap12Groups.length * 4; + t.cmap12Offset = 12 + 2 * 2 + 4 + t.cmap4Length; + t.fields = t.fields.concat([ + { + name: "cmap12Format", + type: "USHORT", + value: 12, + }, + { + name: "cmap12Reserved", + type: "USHORT", + value: 0, + }, + { + name: "cmap12Length", + type: "ULONG", + value: cmap12Length, + }, + { + name: "cmap12Language", + type: "ULONG", + value: 0, + }, + { + name: "cmap12nGroups", + type: "ULONG", + value: cmap12Groups.length / 3, + }, + ]); + t.fields = t.fields.concat(cmap12Groups); + } + return t; + } + var cmap = { + parse: parseCmapTable, + make: makeCmapTable, + }; + // Glyph encoding + var cffStandardStrings = [ + ".notdef", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "questiondown", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "AE", + "ordfeminine", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "ae", + "dotlessi", + "lslash", + "oslash", + "oe", + "germandbls", + "onesuperior", + "logicalnot", + "mu", + "trademark", + "Eth", + "onehalf", + "plusminus", + "Thorn", + "onequarter", + "divide", + "brokenbar", + "degree", + "thorn", + "threequarters", + "twosuperior", + "registered", + "minus", + "eth", + "multiply", + "threesuperior", + "copyright", + "Aacute", + "Acircumflex", + "Adieresis", + "Agrave", + "Aring", + "Atilde", + "Ccedilla", + "Eacute", + "Ecircumflex", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Ntilde", + "Oacute", + "Ocircumflex", + "Odieresis", + "Ograve", + "Otilde", + "Scaron", + "Uacute", + "Ucircumflex", + "Udieresis", + "Ugrave", + "Yacute", + "Ydieresis", + "Zcaron", + "aacute", + "acircumflex", + "adieresis", + "agrave", + "aring", + "atilde", + "ccedilla", + "eacute", + "ecircumflex", + "edieresis", + "egrave", + "iacute", + "icircumflex", + "idieresis", + "igrave", + "ntilde", + "oacute", + "ocircumflex", + "odieresis", + "ograve", + "otilde", + "scaron", + "uacute", + "ucircumflex", + "udieresis", + "ugrave", + "yacute", + "ydieresis", + "zcaron", + "exclamsmall", + "Hungarumlautsmall", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "266 ff", + "onedotenleader", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "isuperior", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "rsuperior", + "ssuperior", + "tsuperior", + "ff", + "ffi", + "ffl", + "parenleftinferior", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "Dotaccentsmall", + "Macronsmall", + "figuredash", + "hypheninferior", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "zerosuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", + "001.000", + "001.001", + "001.002", + "001.003", + "Black", + "Bold", + "Book", + "Light", + "Medium", + "Regular", + "Roman", + "Semibold", + ]; + var cffStandardEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "", + "questiondown", + "", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "", + "ring", + "cedilla", + "", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "AE", + "", + "ordfeminine", + "", + "", + "", + "", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "", + "", + "", + "", + "", + "ae", + "", + "", + "", + "dotlessi", + "", + "", + "lslash", + "oslash", + "oe", + "germandbls", + ]; + var cffExpertEncoding = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclamsmall", + "Hungarumlautsmall", + "", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "comma", + "hyphen", + "period", + "fraction", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "colon", + "semicolon", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "", + "", + "isuperior", + "", + "", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "", + "", + "rsuperior", + "ssuperior", + "tsuperior", + "", + "ff", + "fi", + "fl", + "ffi", + "ffl", + "parenleftinferior", + "", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "", + "", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "", + "Dotaccentsmall", + "", + "", + "Macronsmall", + "", + "", + "figuredash", + "hypheninferior", + "", + "", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "", + "", + "", + "onequarter", + "onehalf", + "threequarters", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "", + "", + "zerosuperior", + "onesuperior", + "twosuperior", + "threesuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", + ]; + var standardNames = [ + ".notdef", + ".null", + "nonmarkingreturn", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quotesingle", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "grave", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "Adieresis", + "Aring", + "Ccedilla", + "Eacute", + "Ntilde", + "Odieresis", + "Udieresis", + "aacute", + "agrave", + "acircumflex", + "adieresis", + "atilde", + "aring", + "ccedilla", + "eacute", + "egrave", + "ecircumflex", + "edieresis", + "iacute", + "igrave", + "icircumflex", + "idieresis", + "ntilde", + "oacute", + "ograve", + "ocircumflex", + "odieresis", + "otilde", + "uacute", + "ugrave", + "ucircumflex", + "udieresis", + "dagger", + "degree", + "cent", + "sterling", + "section", + "bullet", + "paragraph", + "germandbls", + "registered", + "copyright", + "trademark", + "acute", + "dieresis", + "notequal", + "AE", + "Oslash", + "infinity", + "plusminus", + "lessequal", + "greaterequal", + "yen", + "mu", + "partialdiff", + "summation", + "product", + "pi", + "integral", + "ordfeminine", + "ordmasculine", + "Omega", + "ae", + "oslash", + "questiondown", + "exclamdown", + "logicalnot", + "radical", + "florin", + "approxequal", + "Delta", + "guillemotleft", + "guillemotright", + "ellipsis", + "nonbreakingspace", + "Agrave", + "Atilde", + "Otilde", + "OE", + "oe", + "endash", + "emdash", + "quotedblleft", + "quotedblright", + "quoteleft", + "quoteright", + "divide", + "lozenge", + "ydieresis", + "Ydieresis", + "fraction", + "currency", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "daggerdbl", + "periodcentered", + "quotesinglbase", + "quotedblbase", + "perthousand", + "Acircumflex", + "Ecircumflex", + "Aacute", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Oacute", + "Ocircumflex", + "apple", + "Ograve", + "Uacute", + "Ucircumflex", + "Ugrave", + "dotlessi", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "Lslash", + "lslash", + "Scaron", + "scaron", + "Zcaron", + "zcaron", + "brokenbar", + "Eth", + "eth", + "Yacute", + "yacute", + "Thorn", + "thorn", + "minus", + "multiply", + "onesuperior", + "twosuperior", + "threesuperior", + "onehalf", + "onequarter", + "threequarters", + "franc", + "Gbreve", + "gbreve", + "Idotaccent", + "Scedilla", + "scedilla", + "Cacute", + "cacute", + "Ccaron", + "ccaron", + "dcroat", + ]; + /** + * This is the encoding used for fonts created from scratch. + * It loops through all glyphs and finds the appropriate unicode value. + * Since it's linear time, other encodings will be faster. + * @exports opentype.DefaultEncoding + * @class + * @constructor + * @param {opentype.Font} + */ + function DefaultEncoding(font) { + this.font = font; + } + DefaultEncoding.prototype.charToGlyphIndex = function (c) { + var code = c.codePointAt(0); + var glyphs = this.font.glyphs; + if (glyphs) { + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + for (var j = 0; j < glyph.unicodes.length; j += 1) { + if (glyph.unicodes[j] === code) { + return i; + } + } + } + } + return null; + }; + /** + * @exports opentype.CmapEncoding + * @class + * @constructor + * @param {Object} cmap - a object with the cmap encoded data + */ + function CmapEncoding(cmap) { + this.cmap = cmap; + } /** + * @param {string} c - the character + * @return {number} The glyph index. + */ + + CmapEncoding.prototype.charToGlyphIndex = function (c) { + return this.cmap.glyphIndexMap[c.codePointAt(0)] || 0; + }; + /** + * @exports opentype.CffEncoding + * @class + * @constructor + * @param {string} encoding - The encoding + * @param {Array} charset - The character set. + */ + function CffEncoding(encoding, charset) { + this.encoding = encoding; + this.charset = charset; + } /** + * @param {string} s - The character + * @return {number} The index. + */ + + CffEncoding.prototype.charToGlyphIndex = function (s) { + var code = s.codePointAt(0); + var charName = this.encoding[code]; + return this.charset.indexOf(charName); + }; + /** + * @exports opentype.GlyphNames + * @class + * @constructor + * @param {Object} post + */ + function GlyphNames(post) { + var this$1 = this; + switch (post.version) { + case 1: + this.names = standardNames.slice(); + break; + case 2: + this.names = new Array(post.numberOfGlyphs); + for (var i = 0; i < post.numberOfGlyphs; i++) { + if (post.glyphNameIndex[i] < standardNames.length) { + this$1.names[i] = standardNames[post.glyphNameIndex[i]]; + } else { + this$1.names[i] = + post.names[ + post.glyphNameIndex[i] - standardNames.length + ]; + } + } + break; + case 2.5: + this.names = new Array(post.numberOfGlyphs); + for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { + this$1.names[i$1] = + standardNames[i$1 + post.glyphNameIndex[i$1]]; + } + break; + case 3: + this.names = []; + break; + default: + this.names = []; + break; + } + } /** + * Gets the index of a glyph by name. + * @param {string} name - The glyph name + * @return {number} The index + */ + + GlyphNames.prototype.nameToGlyphIndex = function (name) { + return this.names.indexOf(name); + }; + /** + * @param {number} gid + * @return {string} + */ + GlyphNames.prototype.glyphIndexToName = function (gid) { + return this.names[gid]; + }; + /** + * @alias opentype.addGlyphNames + * @param {opentype.Font} + */ + function addGlyphNames(font) { + var glyph; + var glyphIndexMap = font.tables.cmap.glyphIndexMap; + var charCodes = Object.keys(glyphIndexMap); + for (var i = 0; i < charCodes.length; i += 1) { + var c = charCodes[i]; + var glyphIndex = glyphIndexMap[c]; + glyph = font.glyphs.get(glyphIndex); + glyph.addUnicode(parseInt(c)); + } + for (var i$1 = 0; i$1 < font.glyphs.length; i$1 += 1) { + glyph = font.glyphs.get(i$1); + if (font.cffEncoding) { + if (font.isCIDFont) { + glyph.name = "gid" + i$1; + } else { + glyph.name = font.cffEncoding.charset[i$1]; + } + } else if (font.glyphNames.names) { + glyph.name = font.glyphNames.glyphIndexToName(i$1); + } + } + } // Drawing utility functions. + // Draw a line on the given context from point `x1,y1` to point `x2,y2`. + + function line(ctx, x1, y1, x2, y2) { + ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + } + var draw = { + line: line, + }; + // The Glyph object + // import glyf from './tables/glyf' Can't be imported here, because it's a circular dependency + function getPathDefinition(glyph, path) { + var _path = path || new Path(); + return { + configurable: true, + get: function () { + if (typeof _path === "function") { + _path = _path(); + } + return _path; + }, + set: function (p) { + _path = p; + }, + }; + } + /** + * @typedef GlyphOptions + * @type Object + * @property {string} [name] - The glyph name + * @property {number} [unicode] + * @property {Array} [unicodes] + * @property {number} [xMin] + * @property {number} [yMin] + * @property {number} [xMax] + * @property {number} [yMax] + * @property {number} [advanceWidth] + */ + // A Glyph is an individual mark that often corresponds to a character. + // Some glyphs, such as ligatures, are a combination of many characters. + // Glyphs are the basic building blocks of a font. + // + // The `Glyph` class contains utility methods for drawing the path and its points. + /** + * @exports opentype.Glyph + * @class + * @param {GlyphOptions} + * @constructor + */ + + function Glyph(options) { + // By putting all the code on a prototype function (which is only declared once) + // we reduce the memory requirements for larger fonts by some 2% + this.bindConstructorValues(options); + } /** + * @param {GlyphOptions} + */ + + Glyph.prototype.bindConstructorValues = function (options) { + this.index = options.index || 0; + // These three values cannot be deferred for memory optimization: + this.name = options.name || null; + this.unicode = options.unicode || undefined; + this.unicodes = + options.unicodes || options.unicode !== undefined + ? [options.unicode] + : []; + // But by binding these values only when necessary, we reduce can + // the memory requirements by almost 3% for larger fonts. + if (options.xMin) { + this.xMin = options.xMin; + } + if (options.yMin) { + this.yMin = options.yMin; + } + if (options.xMax) { + this.xMax = options.xMax; + } + if (options.yMax) { + this.yMax = options.yMax; + } + if (options.advanceWidth) { + this.advanceWidth = options.advanceWidth; + } // The path for a glyph is the most memory intensive, and is bound as a value + // with a getter/setter to ensure we actually do path parsing only once the + // path is actually needed by anything. + + Object.defineProperty( + this, + "path", + getPathDefinition(this, options.path), + ); + }; + /** + * @param {number} + */ + Glyph.prototype.addUnicode = function (unicode) { + if (this.unicodes.length === 0) { + this.unicode = unicode; + } + this.unicodes.push(unicode); + }; + /** + * Calculate the minimum bounding box for this glyph. + * @return {opentype.BoundingBox} + */ + Glyph.prototype.getBoundingBox = function () { + return this.path.getBoundingBox(); + }; + /** + * Convert the glyph to a Path we can draw on a drawing context. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {Object=} options - xScale, yScale to stretch the glyph. + * @param {opentype.Font} if hinting is to be used, the font + * @return {opentype.Path} + */ + Glyph.prototype.getPath = function ( + x, + y, + fontSize, + options, + font, + ) { + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 72; + var commands; + var hPoints; + if (!options) { + options = {}; + } + var xScale = options.xScale; + var yScale = options.yScale; + if (options.hinting && font && font.hinting) { + // in case of hinting, the hinting engine takes care + // of scaling the points (not the path) before hinting. + hPoints = this.path && font.hinting.exec(this, fontSize); + // in case the hinting engine failed hPoints is undefined + // and thus reverts to plain rending + } + if (hPoints) { + // Call font.hinting.getCommands instead of `glyf.getPath(hPoints).commands` to avoid a circular dependency + commands = font.hinting.getCommands(hPoints); + x = Math.round(x); + y = Math.round(y); + // TODO in case of hinting xyScaling is not yet supported + xScale = yScale = 1; + } else { + commands = this.path.commands; + var scale = (1 / this.path.unitsPerEm) * fontSize; + if (xScale === undefined) { + xScale = scale; + } + if (yScale === undefined) { + yScale = scale; + } + } + var p = new Path(); + for (var i = 0; i < commands.length; i += 1) { + var cmd = commands[i]; + if (cmd.type === "M") { + p.moveTo(x + cmd.x * xScale, y + -cmd.y * yScale); + } else if (cmd.type === "L") { + p.lineTo(x + cmd.x * xScale, y + -cmd.y * yScale); + } else if (cmd.type === "Q") { + p.quadraticCurveTo( + x + cmd.x1 * xScale, + y + -cmd.y1 * yScale, + x + cmd.x * xScale, + y + -cmd.y * yScale, + ); + } else if (cmd.type === "C") { + p.curveTo( + x + cmd.x1 * xScale, + y + -cmd.y1 * yScale, + x + cmd.x2 * xScale, + y + -cmd.y2 * yScale, + x + cmd.x * xScale, + y + -cmd.y * yScale, + ); + } else if (cmd.type === "Z") { + p.closePath(); + } + } + return p; + }; + /** + * Split the glyph into contours. + * This function is here for backwards compatibility, and to + * provide raw access to the TrueType glyph outlines. + * @return {Array} + */ + Glyph.prototype.getContours = function () { + var this$1 = this; + if (this.points === undefined) { + return []; + } + var contours = []; + var currentContour = []; + for (var i = 0; i < this.points.length; i += 1) { + var pt = this$1.points[i]; + currentContour.push(pt); + if (pt.lastPointOfContour) { + contours.push(currentContour); + currentContour = []; + } + } + check.argument( + currentContour.length === 0, + "There are still points left in the current contour.", + ); + return contours; + }; + /** + * Calculate the xMin/yMin/xMax/yMax/lsb/rsb for a Glyph. + * @return {Object} + */ + Glyph.prototype.getMetrics = function () { + var commands = this.path.commands; + var xCoords = []; + var yCoords = []; + for (var i = 0; i < commands.length; i += 1) { + var cmd = commands[i]; + if (cmd.type !== "Z") { + xCoords.push(cmd.x); + yCoords.push(cmd.y); + } + if (cmd.type === "Q" || cmd.type === "C") { + xCoords.push(cmd.x1); + yCoords.push(cmd.y1); + } + if (cmd.type === "C") { + xCoords.push(cmd.x2); + yCoords.push(cmd.y2); + } + } + var metrics = { + xMin: Math.min.apply(null, xCoords), + yMin: Math.min.apply(null, yCoords), + xMax: Math.max.apply(null, xCoords), + yMax: Math.max.apply(null, yCoords), + leftSideBearing: this.leftSideBearing, + }; + if (!isFinite(metrics.xMin)) { + metrics.xMin = 0; + } + if (!isFinite(metrics.xMax)) { + metrics.xMax = this.advanceWidth; + } + if (!isFinite(metrics.yMin)) { + metrics.yMin = 0; + } + if (!isFinite(metrics.yMax)) { + metrics.yMax = 0; + } + metrics.rightSideBearing = + this.advanceWidth - + metrics.leftSideBearing - + (metrics.xMax - metrics.xMin); + return metrics; + }; + /** + * Draw the glyph on the given context. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {Object=} options - xScale, yScale to stretch the glyph. + */ + Glyph.prototype.draw = function (ctx, x, y, fontSize, options) { + this.getPath(x, y, fontSize, options).draw(ctx); + }; + /** + * Draw the points of the glyph. + * On-curve points will be drawn in blue, off-curve points will be drawn in red. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + */ + Glyph.prototype.drawPoints = function (ctx, x, y, fontSize) { + function drawCircles(l, x, y, scale) { + var PI_SQ = Math.PI * 2; + ctx.beginPath(); + for (var j = 0; j < l.length; j += 1) { + ctx.moveTo(x + l[j].x * scale, y + l[j].y * scale); + ctx.arc( + x + l[j].x * scale, + y + l[j].y * scale, + 2, + 0, + PI_SQ, + false, + ); + } + ctx.closePath(); + ctx.fill(); + } + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 24; + var scale = (1 / this.path.unitsPerEm) * fontSize; + var blueCircles = []; + var redCircles = []; + var path = this.path; + for (var i = 0; i < path.commands.length; i += 1) { + var cmd = path.commands[i]; + if (cmd.x !== undefined) { + blueCircles.push({ + x: cmd.x, + y: -cmd.y, + }); + } + if (cmd.x1 !== undefined) { + redCircles.push({ + x: cmd.x1, + y: -cmd.y1, + }); + } + if (cmd.x2 !== undefined) { + redCircles.push({ + x: cmd.x2, + y: -cmd.y2, + }); + } + } + ctx.fillStyle = "blue"; + drawCircles(blueCircles, x, y, scale); + ctx.fillStyle = "red"; + drawCircles(redCircles, x, y, scale); + }; + /** + * Draw lines indicating important font measurements. + * Black lines indicate the origin of the coordinate system (point 0,0). + * Blue lines indicate the glyph bounding box. + * Green line indicates the advance width of the glyph. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + */ + Glyph.prototype.drawMetrics = function (ctx, x, y, fontSize) { + var scale; + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 24; + scale = (1 / this.path.unitsPerEm) * fontSize; + ctx.lineWidth = 1; + // Draw the origin + ctx.strokeStyle = "black"; + draw.line(ctx, x, -10000, x, 10000); + draw.line(ctx, -10000, y, 10000, y); + // This code is here due to memory optimization: by not using + // defaults in the constructor, we save a notable amount of memory. + var xMin = this.xMin || 0; + var yMin = this.yMin || 0; + var xMax = this.xMax || 0; + var yMax = this.yMax || 0; + var advanceWidth = this.advanceWidth || 0; + // Draw the glyph box + ctx.strokeStyle = "blue"; + draw.line( + ctx, + x + xMin * scale, + -10000, + x + xMin * scale, + 10000, + ); + draw.line( + ctx, + x + xMax * scale, + -10000, + x + xMax * scale, + 10000, + ); + draw.line( + ctx, + -10000, + y + -yMin * scale, + 10000, + y + -yMin * scale, + ); + draw.line( + ctx, + -10000, + y + -yMax * scale, + 10000, + y + -yMax * scale, + ); + // Draw the advance width + ctx.strokeStyle = "green"; + draw.line( + ctx, + x + advanceWidth * scale, + -10000, + x + advanceWidth * scale, + 10000, + ); + }; + // The GlyphSet object + // Define a property on the glyph that depends on the path being loaded. + function defineDependentProperty( + glyph, + externalName, + internalName, + ) { + Object.defineProperty(glyph, externalName, { + get: function () { + // Request the path property to make sure the path is loaded. + glyph.path; // jshint ignore:line + return glyph[internalName]; + }, + set: function (newValue) { + glyph[internalName] = newValue; + }, + enumerable: true, + configurable: true, + }); + } /** + * A GlyphSet represents all glyphs available in the font, but modelled using + * a deferred glyph loader, for retrieving glyphs only once they are absolutely + * necessary, to keep the memory footprint down. + * @exports opentype.GlyphSet + * @class + * @param {opentype.Font} + * @param {Array} + */ + + function GlyphSet(font, glyphs) { + var this$1 = this; + this.font = font; + this.glyphs = {}; + if (Array.isArray(glyphs)) { + for (var i = 0; i < glyphs.length; i++) { + this$1.glyphs[i] = glyphs[i]; + } + } + this.length = (glyphs && glyphs.length) || 0; + } /** + * @param {number} index + * @return {opentype.Glyph} + */ + + GlyphSet.prototype.get = function (index) { + if (typeof this.glyphs[index] === "function") { + this.glyphs[index] = this.glyphs[index](); + } + return this.glyphs[index]; + }; + /** + * @param {number} index + * @param {Object} + */ + GlyphSet.prototype.push = function (index, loader) { + this.glyphs[index] = loader; + this.length++; + }; + /** + * @alias opentype.glyphLoader + * @param {opentype.Font} font + * @param {number} index + * @return {opentype.Glyph} + */ + function glyphLoader(font, index) { + return new Glyph({ + index: index, + font: font, + }); + } /** + * Generate a stub glyph that can be filled with all metadata *except* + * the "points" and "path" properties, which must be loaded only once + * the glyph's path is actually requested for text shaping. + * @alias opentype.ttfGlyphLoader + * @param {opentype.Font} font + * @param {number} index + * @param {Function} parseGlyph + * @param {Object} data + * @param {number} position + * @param {Function} buildPath + * @return {opentype.Glyph} + */ + + function ttfGlyphLoader( + font, + index, + parseGlyph, + data, + position, + buildPath, + ) { + return function () { + var glyph = new Glyph({ + index: index, + font: font, + }); + glyph.path = function () { + parseGlyph(glyph, data, position); + var path = buildPath(font.glyphs, glyph); + path.unitsPerEm = font.unitsPerEm; + return path; + }; + defineDependentProperty(glyph, "xMin", "_xMin"); + defineDependentProperty(glyph, "xMax", "_xMax"); + defineDependentProperty(glyph, "yMin", "_yMin"); + defineDependentProperty(glyph, "yMax", "_yMax"); + return glyph; + }; + } /** + * @alias opentype.cffGlyphLoader + * @param {opentype.Font} font + * @param {number} index + * @param {Function} parseCFFCharstring + * @param {string} charstring + * @return {opentype.Glyph} + */ + + function cffGlyphLoader( + font, + index, + parseCFFCharstring, + charstring, + ) { + return function () { + var glyph = new Glyph({ + index: index, + font: font, + }); + glyph.path = function () { + var path = parseCFFCharstring(font, glyph, charstring); + path.unitsPerEm = font.unitsPerEm; + return path; + }; + return glyph; + }; + } + var glyphset = { + GlyphSet: GlyphSet, + glyphLoader: glyphLoader, + ttfGlyphLoader: ttfGlyphLoader, + cffGlyphLoader: cffGlyphLoader, + }; + // The `CFF` table contains the glyph outlines in PostScript format. + // Custom equals function that can also check lists. + function equals(a, b) { + if (a === b) { + return true; + } else if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0; i < a.length; i += 1) { + if (!equals(a[i], b[i])) { + return false; + } + } + return true; + } else { + return false; + } + } // Subroutines are encoded using the negative half of the number space. + // See type 2 chapter 4.7 "Subroutine operators". + + function calcCFFSubroutineBias(subrs) { + var bias; + if (subrs.length < 1240) { + bias = 107; + } else if (subrs.length < 33900) { + bias = 1131; + } else { + bias = 32768; + } + return bias; + } // Parse a `CFF` INDEX array. + // An index array consists of a list of offsets, then a list of objects at those offsets. + + function parseCFFIndex(data, start, conversionFn) { + var offsets = []; + var objects = []; + var count = parse.getCard16(data, start); + var objectOffset; + var endOffset; + if (count !== 0) { + var offsetSize = parse.getByte(data, start + 2); + objectOffset = start + (count + 1) * offsetSize + 2; + var pos = start + 3; + for (var i = 0; i < count + 1; i += 1) { + offsets.push(parse.getOffset(data, pos, offsetSize)); + pos += offsetSize; + } // The total size of the index array is 4 header bytes + the value of the last offset. + + endOffset = objectOffset + offsets[count]; + } else { + endOffset = start + 2; + } + for (var i$1 = 0; i$1 < offsets.length - 1; i$1 += 1) { + var value = parse.getBytes( + data, + objectOffset + offsets[i$1], + objectOffset + offsets[i$1 + 1], + ); + if (conversionFn) { + value = conversionFn(value); + } + objects.push(value); + } + return { + objects: objects, + startOffset: start, + endOffset: endOffset, + }; + } // Parse a `CFF` DICT real value. + + function parseFloatOperand(parser) { + var s = ""; + var eof = 15; + var lookup = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ".", + "E", + "E-", + null, + "-", + ]; + while (true) { + var b = parser.parseByte(); + var n1 = b >> 4; + var n2 = b & 15; + if (n1 === eof) { + break; + } + s += lookup[n1]; + if (n2 === eof) { + break; + } + s += lookup[n2]; + } + return parseFloat(s); + } // Parse a `CFF` DICT operand. + + function parseOperand(parser, b0) { + var b1; + var b2; + var b3; + var b4; + if (b0 === 28) { + b1 = parser.parseByte(); + b2 = parser.parseByte(); + return (b1 << 8) | b2; + } + if (b0 === 29) { + b1 = parser.parseByte(); + b2 = parser.parseByte(); + b3 = parser.parseByte(); + b4 = parser.parseByte(); + return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4; + } + if (b0 === 30) { + return parseFloatOperand(parser); + } + if (b0 >= 32 && b0 <= 246) { + return b0 - 139; + } + if (b0 >= 247 && b0 <= 250) { + b1 = parser.parseByte(); + return (b0 - 247) * 256 + b1 + 108; + } + if (b0 >= 251 && b0 <= 254) { + b1 = parser.parseByte(); + return -(b0 - 251) * 256 - b1 - 108; + } + throw new Error("Invalid b0 " + b0); + } // Convert the entries returned by `parseDict` to a proper dictionary. + // If a value is a list of one, it is unpacked. + + function entriesToObject(entries) { + var o = {}; + for (var i = 0; i < entries.length; i += 1) { + var key = entries[i][0]; + var values = entries[i][1]; + var value = void 0; + if (values.length === 1) { + value = values[0]; + } else { + value = values; + } + if (o.hasOwnProperty(key) && !isNaN(o[key])) { + throw new Error("Object " + o + " already has key " + key); + } + o[key] = value; + } + return o; + } // Parse a `CFF` DICT object. + // A dictionary contains key-value pairs in a compact tokenized format. + + function parseCFFDict(data, start, size) { + start = start !== undefined ? start : 0; + var parser = new parse.Parser(data, start); + var entries = []; + var operands = []; + size = size !== undefined ? size : data.length; + while (parser.relativeOffset < size) { + var op = parser.parseByte(); + // The first byte for each dict item distinguishes between operator (key) and operand (value). + // Values <= 21 are operators. + if (op <= 21) { + // Two-byte operators have an initial escape byte of 12. + if (op === 12) { + op = 1200 + parser.parseByte(); + } + entries.push([op, operands]); + operands = []; + } else { + // Since the operands (values) come before the operators (keys), we store all operands in a list + // until we encounter an operator. + operands.push(parseOperand(parser, op)); + } + } + return entriesToObject(entries); + } // Given a String Index (SID), return the value of the string. + // Strings below index 392 are standard CFF strings and are not encoded in the font. + + function getCFFString(strings, index) { + if (index <= 390) { + index = cffStandardStrings[index]; + } else { + index = strings[index - 391]; + } + return index; + } // Interpret a dictionary and return a new dictionary with readable keys and values for missing entries. + // This function takes `meta` which is a list of objects containing `operand`, `name` and `default`. + + function interpretDict(dict, meta, strings) { + var newDict = {}; + var value; + // Because we also want to include missing values, we start out from the meta list + // and lookup values in the dict. + for (var i = 0; i < meta.length; i += 1) { + var m = meta[i]; + if (Array.isArray(m.type)) { + var values = []; + values.length = m.type.length; + for (var j = 0; j < m.type.length; j++) { + value = + dict[m.op] !== undefined ? dict[m.op][j] : undefined; + if (value === undefined) { + value = + m.value !== undefined && m.value[j] !== undefined + ? m.value[j] + : null; + } + if (m.type[j] === "SID") { + value = getCFFString(strings, value); + } + values[j] = value; + } + newDict[m.name] = values; + } else { + value = dict[m.op]; + if (value === undefined) { + value = m.value !== undefined ? m.value : null; + } + if (m.type === "SID") { + value = getCFFString(strings, value); + } + newDict[m.name] = value; + } + } + return newDict; + } // Parse the CFF header. + + function parseCFFHeader(data, start) { + var header = {}; + header.formatMajor = parse.getCard8(data, start); + header.formatMinor = parse.getCard8(data, start + 1); + header.size = parse.getCard8(data, start + 2); + header.offsetSize = parse.getCard8(data, start + 3); + header.startOffset = start; + header.endOffset = start + 4; + return header; + } + var TOP_DICT_META = [ + { + name: "version", + op: 0, + type: "SID", + }, + { + name: "notice", + op: 1, + type: "SID", + }, + { + name: "copyright", + op: 1200, + type: "SID", + }, + { + name: "fullName", + op: 2, + type: "SID", + }, + { + name: "familyName", + op: 3, + type: "SID", + }, + { + name: "weight", + op: 4, + type: "SID", + }, + { + name: "isFixedPitch", + op: 1201, + type: "number", + value: 0, + }, + { + name: "italicAngle", + op: 1202, + type: "number", + value: 0, + }, + { + name: "underlinePosition", + op: 1203, + type: "number", + value: -100, + }, + { + name: "underlineThickness", + op: 1204, + type: "number", + value: 50, + }, + { + name: "paintType", + op: 1205, + type: "number", + value: 0, + }, + { + name: "charstringType", + op: 1206, + type: "number", + value: 2, + }, + { + name: "fontMatrix", + op: 1207, + type: ["real", "real", "real", "real", "real", "real"], + value: [0.001, 0, 0, 0.001, 0, 0], + }, + { + name: "uniqueId", + op: 13, + type: "number", + }, + { + name: "fontBBox", + op: 5, + type: ["number", "number", "number", "number"], + value: [0, 0, 0, 0], + }, + { + name: "strokeWidth", + op: 1208, + type: "number", + value: 0, + }, + { + name: "xuid", + op: 14, + type: [], + value: null, + }, + { + name: "charset", + op: 15, + type: "offset", + value: 0, + }, + { + name: "encoding", + op: 16, + type: "offset", + value: 0, + }, + { + name: "charStrings", + op: 17, + type: "offset", + value: 0, + }, + { + name: "private", + op: 18, + type: ["number", "offset"], + value: [0, 0], + }, + { + name: "ros", + op: 1230, + type: ["SID", "SID", "number"], + }, + { + name: "cidFontVersion", + op: 1231, + type: "number", + value: 0, + }, + { + name: "cidFontRevision", + op: 1232, + type: "number", + value: 0, + }, + { + name: "cidFontType", + op: 1233, + type: "number", + value: 0, + }, + { + name: "cidCount", + op: 1234, + type: "number", + value: 8720, + }, + { + name: "uidBase", + op: 1235, + type: "number", + }, + { + name: "fdArray", + op: 1236, + type: "offset", + }, + { + name: "fdSelect", + op: 1237, + type: "offset", + }, + { + name: "fontName", + op: 1238, + type: "SID", + }, + ]; + var PRIVATE_DICT_META = [ + { + name: "subrs", + op: 19, + type: "offset", + value: 0, + }, + { + name: "defaultWidthX", + op: 20, + type: "number", + value: 0, + }, + { + name: "nominalWidthX", + op: 21, + type: "number", + value: 0, + }, + ]; + // Parse the CFF top dictionary. A CFF table can contain multiple fonts, each with their own top dictionary. + // The top dictionary contains the essential metadata for the font, together with the private dictionary. + function parseCFFTopDict(data, strings) { + var dict = parseCFFDict(data, 0, data.byteLength); + return interpretDict(dict, TOP_DICT_META, strings); + } // Parse the CFF private dictionary. We don't fully parse out all the values, only the ones we need. + + function parseCFFPrivateDict(data, start, size, strings) { + var dict = parseCFFDict(data, start, size); + return interpretDict(dict, PRIVATE_DICT_META, strings); + } // Returns a list of "Top DICT"s found using an INDEX list. + // Used to read both the usual high-level Top DICTs and also the FDArray + // discovered inside CID-keyed fonts. When a Top DICT has a reference to + // a Private DICT that is read and saved into the Top DICT. + // + // In addition to the expected/optional values as outlined in TOP_DICT_META + // the following values might be saved into the Top DICT. + // + // _subrs [] array of local CFF subroutines from Private DICT + // _subrsBias bias value computed from number of subroutines + // (see calcCFFSubroutineBias() and parseCFFCharstring()) + // _defaultWidthX default widths for CFF characters + // _nominalWidthX bias added to width embedded within glyph description + // + // _privateDict saved copy of parsed Private DICT from Top DICT + + function gatherCFFTopDicts(data, start, cffIndex, strings) { + var topDictArray = []; + for ( + var iTopDict = 0; + iTopDict < cffIndex.length; + iTopDict += 1 + ) { + var topDictData = new DataView( + new Uint8Array(cffIndex[iTopDict]).buffer, + ); + var topDict = parseCFFTopDict(topDictData, strings); + topDict._subrs = []; + topDict._subrsBias = 0; + var privateSize = topDict.private[0]; + var privateOffset = topDict.private[1]; + if (privateSize !== 0 && privateOffset !== 0) { + var privateDict = parseCFFPrivateDict( + data, + privateOffset + start, + privateSize, + strings, + ); + topDict._defaultWidthX = privateDict.defaultWidthX; + topDict._nominalWidthX = privateDict.nominalWidthX; + if (privateDict.subrs !== 0) { + var subrOffset = privateOffset + privateDict.subrs; + var subrIndex = parseCFFIndex(data, subrOffset + start); + topDict._subrs = subrIndex.objects; + topDict._subrsBias = calcCFFSubroutineBias( + topDict._subrs, + ); + } + topDict._privateDict = privateDict; + } + topDictArray.push(topDict); + } + return topDictArray; + } // Parse the CFF charset table, which contains internal names for all the glyphs. + // This function will return a list of glyph names. + // See Adobe TN #5176 chapter 13, "Charsets". + + function parseCFFCharset(data, start, nGlyphs, strings) { + var sid; + var count; + var parser = new parse.Parser(data, start); + // The .notdef glyph is not included, so subtract 1. + nGlyphs -= 1; + var charset = [".notdef"]; + var format = parser.parseCard8(); + if (format === 0) { + for (var i = 0; i < nGlyphs; i += 1) { + sid = parser.parseSID(); + charset.push(getCFFString(strings, sid)); + } + } else if (format === 1) { + while (charset.length <= nGlyphs) { + sid = parser.parseSID(); + count = parser.parseCard8(); + for (var i$1 = 0; i$1 <= count; i$1 += 1) { + charset.push(getCFFString(strings, sid)); + sid += 1; + } + } + } else if (format === 2) { + while (charset.length <= nGlyphs) { + sid = parser.parseSID(); + count = parser.parseCard16(); + for (var i$2 = 0; i$2 <= count; i$2 += 1) { + charset.push(getCFFString(strings, sid)); + sid += 1; + } + } + } else { + throw new Error("Unknown charset format " + format); + } + return charset; + } // Parse the CFF encoding data. Only one encoding can be specified per font. + // See Adobe TN #5176 chapter 12, "Encodings". + + function parseCFFEncoding(data, start, charset) { + var code; + var enc = {}; + var parser = new parse.Parser(data, start); + var format = parser.parseCard8(); + if (format === 0) { + var nCodes = parser.parseCard8(); + for (var i = 0; i < nCodes; i += 1) { + code = parser.parseCard8(); + enc[code] = i; + } + } else if (format === 1) { + var nRanges = parser.parseCard8(); + code = 1; + for (var i$1 = 0; i$1 < nRanges; i$1 += 1) { + var first = parser.parseCard8(); + var nLeft = parser.parseCard8(); + for (var j = first; j <= first + nLeft; j += 1) { + enc[j] = code; + code += 1; + } + } + } else { + throw new Error("Unknown encoding format " + format); + } + return new CffEncoding(enc, charset); + } // Take in charstring code and return a Glyph object. + // The encoding is described in the Type 2 Charstring Format + // https://www.microsoft.com/typography/OTSPEC/charstr2.htm + + function parseCFFCharstring(font, glyph, code) { + var c1x; + var c1y; + var c2x; + var c2y; + var p = new Path(); + var stack = []; + var nStems = 0; + var haveWidth = false; + var open = false; + var x = 0; + var y = 0; + var subrs; + var subrsBias; + var defaultWidthX; + var nominalWidthX; + if (font.isCIDFont) { + var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index]; + var fdDict = font.tables.cff.topDict._fdArray[fdIndex]; + subrs = fdDict._subrs; + subrsBias = fdDict._subrsBias; + defaultWidthX = fdDict._defaultWidthX; + nominalWidthX = fdDict._nominalWidthX; + } else { + subrs = font.tables.cff.topDict._subrs; + subrsBias = font.tables.cff.topDict._subrsBias; + defaultWidthX = font.tables.cff.topDict._defaultWidthX; + nominalWidthX = font.tables.cff.topDict._nominalWidthX; + } + var width = defaultWidthX; + function newContour(x, y) { + if (open) { + p.closePath(); + } + p.moveTo(x, y); + open = true; + } + function parseStems() { + var hasWidthArg; + // The number of stem operators on the stack is always even. + // If the value is uneven, that means a width is specified. + hasWidthArg = stack.length % 2 !== 0; + if (hasWidthArg && !haveWidth) { + width = stack.shift() + nominalWidthX; + } + nStems += stack.length >> 1; + stack.length = 0; + haveWidth = true; + } + function parse$$1(code) { + var b1; + var b2; + var b3; + var b4; + var codeIndex; + var subrCode; + var jpx; + var jpy; + var c3x; + var c3y; + var c4x; + var c4y; + var i = 0; + while (i < code.length) { + var v = code[i]; + i += 1; + switch (v) { + case 1: + // hstem + parseStems(); + break; + case 3: + // vstem + parseStems(); + break; + case 4: + // vmoveto + if (stack.length > 1 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + y += stack.pop(); + newContour(x, y); + break; + case 5: + // rlineto + while (stack.length > 0) { + x += stack.shift(); + y += stack.shift(); + p.lineTo(x, y); + } + break; + case 6: + // hlineto + while (stack.length > 0) { + x += stack.shift(); + p.lineTo(x, y); + if (stack.length === 0) { + break; + } + y += stack.shift(); + p.lineTo(x, y); + } + break; + case 7: + // vlineto + while (stack.length > 0) { + y += stack.shift(); + p.lineTo(x, y); + if (stack.length === 0) { + break; + } + x += stack.shift(); + p.lineTo(x, y); + } + break; + case 8: + // rrcurveto + while (stack.length > 0) { + c1x = x + stack.shift(); + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 10: + // callsubr + codeIndex = stack.pop() + subrsBias; + subrCode = subrs[codeIndex]; + if (subrCode) { + parse$$1(subrCode); + } + break; + case 11: + // return + return; + case 12: + // flex operators + v = code[i]; + i += 1; + switch (v) { + case 35: + // flex + // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |- + c1x = x + stack.shift(); // dx1 + c1y = y + stack.shift(); // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y + stack.shift(); // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = jpy + stack.shift(); // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = c3y + stack.shift(); // dy5 + x = c4x + stack.shift(); // dx6 + y = c4y + stack.shift(); // dy6 + stack.shift(); // flex depth + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + case 34: + // hflex + // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |- + c1x = x + stack.shift(); // dx1 + c1y = y; // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y; // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = c2y; // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = y; // dy5 + x = c4x + stack.shift(); // dx6 + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + case 36: + // hflex1 + // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |- + c1x = x + stack.shift(); // dx1 + c1y = y + stack.shift(); // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y; // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = c2y; // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = c3y + stack.shift(); // dy5 + x = c4x + stack.shift(); // dx6 + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + case 37: + // flex1 + // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |- + c1x = x + stack.shift(); // dx1 + c1y = y + stack.shift(); // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y + stack.shift(); // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = jpy + stack.shift(); // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = c3y + stack.shift(); // dy5 + if (Math.abs(c4x - x) > Math.abs(c4y - y)) { + x = c4x + stack.shift(); + } else { + y = c4y + stack.shift(); + } + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + default: + console.log( + "Glyph " + + glyph.index + + ": unknown operator " + + 1200 + + v, + ); + stack.length = 0; + } + break; + case 14: + // endchar + if (stack.length > 0 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + if (open) { + p.closePath(); + open = false; + } + break; + case 18: + // hstemhm + parseStems(); + break; + case 19: // hintmask + case 20: + // cntrmask + parseStems(); + i += (nStems + 7) >> 3; + break; + case 21: + // rmoveto + if (stack.length > 2 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + y += stack.pop(); + x += stack.pop(); + newContour(x, y); + break; + case 22: + // hmoveto + if (stack.length > 1 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + x += stack.pop(); + newContour(x, y); + break; + case 23: + // vstemhm + parseStems(); + break; + case 24: + // rcurveline + while (stack.length > 2) { + c1x = x + stack.shift(); + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + x += stack.shift(); + y += stack.shift(); + p.lineTo(x, y); + break; + case 25: + // rlinecurve + while (stack.length > 6) { + x += stack.shift(); + y += stack.shift(); + p.lineTo(x, y); + } + c1x = x + stack.shift(); + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + break; + case 26: + // vvcurveto + if (stack.length % 2) { + x += stack.shift(); + } + while (stack.length > 0) { + c1x = x; + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x; + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 27: + // hhcurveto + if (stack.length % 2) { + y += stack.shift(); + } + while (stack.length > 0) { + c1x = x + stack.shift(); + c1y = y; + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y; + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 28: + // shortint + b1 = code[i]; + b2 = code[i + 1]; + stack.push(((b1 << 24) | (b2 << 16)) >> 16); + i += 2; + break; + case 29: + // callgsubr + codeIndex = stack.pop() + font.gsubrsBias; + subrCode = font.gsubrs[codeIndex]; + if (subrCode) { + parse$$1(subrCode); + } + break; + case 30: + // vhcurveto + while (stack.length > 0) { + c1x = x; + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + if (stack.length === 0) { + break; + } + c1x = x + stack.shift(); + c1y = y; + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + y = c2y + stack.shift(); + x = c2x + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 31: + // hvcurveto + while (stack.length > 0) { + c1x = x + stack.shift(); + c1y = y; + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + y = c2y + stack.shift(); + x = c2x + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + if (stack.length === 0) { + break; + } + c1x = x; + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + default: + if (v < 32) { + console.log( + "Glyph " + glyph.index + ": unknown operator " + v, + ); + } else if (v < 247) { + stack.push(v - 139); + } else if (v < 251) { + b1 = code[i]; + i += 1; + stack.push((v - 247) * 256 + b1 + 108); + } else if (v < 255) { + b1 = code[i]; + i += 1; + stack.push(-(v - 251) * 256 - b1 - 108); + } else { + b1 = code[i]; + b2 = code[i + 1]; + b3 = code[i + 2]; + b4 = code[i + 3]; + i += 4; + stack.push( + ((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536, + ); + } + } + } + } + parse$$1(code); + glyph.advanceWidth = width; + return p; + } + function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) { + var fdSelect = []; + var fdIndex; + var parser = new parse.Parser(data, start); + var format = parser.parseCard8(); + if (format === 0) { + // Simple list of nGlyphs elements + for (var iGid = 0; iGid < nGlyphs; iGid++) { + fdIndex = parser.parseCard8(); + if (fdIndex >= fdArrayCount) { + throw new Error( + "CFF table CID Font FDSelect has bad FD index value " + + fdIndex + + " (FD count " + + fdArrayCount + + ")", + ); + } + fdSelect.push(fdIndex); + } + } else if (format === 3) { + // Ranges + var nRanges = parser.parseCard16(); + var first = parser.parseCard16(); + if (first !== 0) { + throw new Error( + "CFF Table CID Font FDSelect format 3 range has bad initial GID " + + first, + ); + } + var next; + for (var iRange = 0; iRange < nRanges; iRange++) { + fdIndex = parser.parseCard8(); + next = parser.parseCard16(); + if (fdIndex >= fdArrayCount) { + throw new Error( + "CFF table CID Font FDSelect has bad FD index value " + + fdIndex + + " (FD count " + + fdArrayCount + + ")", + ); + } + if (next > nGlyphs) { + throw new Error( + "CFF Table CID Font FDSelect format 3 range has bad GID " + + next, + ); + } + for (; first < next; first++) { + fdSelect.push(fdIndex); + } + first = next; + } + if (next !== nGlyphs) { + throw new Error( + "CFF Table CID Font FDSelect format 3 range has bad final GID " + + next, + ); + } + } else { + throw new Error( + "CFF Table CID Font FDSelect table has unsupported format " + + format, + ); + } + return fdSelect; + } // Parse the `CFF` table, which contains the glyph outlines in PostScript format. + + function parseCFFTable(data, start, font) { + font.tables.cff = {}; + var header = parseCFFHeader(data, start); + var nameIndex = parseCFFIndex( + data, + header.endOffset, + parse.bytesToString, + ); + var topDictIndex = parseCFFIndex(data, nameIndex.endOffset); + var stringIndex = parseCFFIndex( + data, + topDictIndex.endOffset, + parse.bytesToString, + ); + var globalSubrIndex = parseCFFIndex( + data, + stringIndex.endOffset, + ); + font.gsubrs = globalSubrIndex.objects; + font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs); + var topDictArray = gatherCFFTopDicts( + data, + start, + topDictIndex.objects, + stringIndex.objects, + ); + if (topDictArray.length !== 1) { + throw new Error( + "CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + + topDictArray.length, + ); + } + var topDict = topDictArray[0]; + font.tables.cff.topDict = topDict; + if (topDict._privateDict) { + font.defaultWidthX = topDict._privateDict.defaultWidthX; + font.nominalWidthX = topDict._privateDict.nominalWidthX; + } + if ( + topDict.ros[0] !== undefined && + topDict.ros[1] !== undefined + ) { + font.isCIDFont = true; + } + if (font.isCIDFont) { + var fdArrayOffset = topDict.fdArray; + var fdSelectOffset = topDict.fdSelect; + if (fdArrayOffset === 0 || fdSelectOffset === 0) { + throw new Error( + "Font is marked as a CID font, but FDArray and/or FDSelect information is missing", + ); + } + fdArrayOffset += start; + var fdArrayIndex = parseCFFIndex(data, fdArrayOffset); + var fdArray = gatherCFFTopDicts( + data, + start, + fdArrayIndex.objects, + stringIndex.objects, + ); + topDict._fdArray = fdArray; + fdSelectOffset += start; + topDict._fdSelect = parseCFFFDSelect( + data, + fdSelectOffset, + font.numGlyphs, + fdArray.length, + ); + } + var privateDictOffset = start + topDict.private[1]; + var privateDict = parseCFFPrivateDict( + data, + privateDictOffset, + topDict.private[0], + stringIndex.objects, + ); + font.defaultWidthX = privateDict.defaultWidthX; + font.nominalWidthX = privateDict.nominalWidthX; + if (privateDict.subrs !== 0) { + var subrOffset = privateDictOffset + privateDict.subrs; + var subrIndex = parseCFFIndex(data, subrOffset); + font.subrs = subrIndex.objects; + font.subrsBias = calcCFFSubroutineBias(font.subrs); + } else { + font.subrs = []; + font.subrsBias = 0; + } // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset. + + var charStringsIndex = parseCFFIndex( + data, + start + topDict.charStrings, + ); + font.nGlyphs = charStringsIndex.objects.length; + var charset = parseCFFCharset( + data, + start + topDict.charset, + font.nGlyphs, + stringIndex.objects, + ); + if (topDict.encoding === 0) { + // Standard encoding + font.cffEncoding = new CffEncoding( + cffStandardEncoding, + charset, + ); + } else if (topDict.encoding === 1) { + // Expert encoding + font.cffEncoding = new CffEncoding( + cffExpertEncoding, + charset, + ); + } else { + font.cffEncoding = parseCFFEncoding( + data, + start + topDict.encoding, + charset, + ); + } // Prefer the CMAP encoding to the CFF encoding. + + font.encoding = font.encoding || font.cffEncoding; + font.glyphs = new glyphset.GlyphSet(font); + for (var i = 0; i < font.nGlyphs; i += 1) { + var charString = charStringsIndex.objects[i]; + font.glyphs.push( + i, + glyphset.cffGlyphLoader( + font, + i, + parseCFFCharstring, + charString, + ), + ); + } + } // Convert a string to a String ID (SID). + // The list of strings is modified in place. + + function encodeString(s, strings) { + var sid; + // Is the string in the CFF standard strings? + var i = cffStandardStrings.indexOf(s); + if (i >= 0) { + sid = i; + } // Is the string already in the string index? + + i = strings.indexOf(s); + if (i >= 0) { + sid = i + cffStandardStrings.length; + } else { + sid = cffStandardStrings.length + strings.length; + strings.push(s); + } + return sid; + } + function makeHeader() { + return new table.Record("Header", [ + { + name: "major", + type: "Card8", + value: 1, + }, + { + name: "minor", + type: "Card8", + value: 0, + }, + { + name: "hdrSize", + type: "Card8", + value: 4, + }, + { + name: "major", + type: "Card8", + value: 1, + }, + ]); + } + function makeNameIndex(fontNames) { + var t = new table.Record("Name INDEX", [ + { + name: "names", + type: "INDEX", + value: [], + }, + ]); + t.names = []; + for (var i = 0; i < fontNames.length; i += 1) { + t.names.push({ + name: "name_" + i, + type: "NAME", + value: fontNames[i], + }); + } + return t; + } // Given a dictionary's metadata, create a DICT structure. + + function makeDict(meta, attrs, strings) { + var m = {}; + for (var i = 0; i < meta.length; i += 1) { + var entry = meta[i]; + var value = attrs[entry.name]; + if (value !== undefined && !equals(value, entry.value)) { + if (entry.type === "SID") { + value = encodeString(value, strings); + } + m[entry.op] = { + name: entry.name, + type: entry.type, + value: value, + }; + } + } + return m; + } // The Top DICT houses the global font attributes. + + function makeTopDict(attrs, strings) { + var t = new table.Record("Top DICT", [ + { + name: "dict", + type: "DICT", + value: {}, + }, + ]); + t.dict = makeDict(TOP_DICT_META, attrs, strings); + return t; + } + function makeTopDictIndex(topDict) { + var t = new table.Record("Top DICT INDEX", [ + { + name: "topDicts", + type: "INDEX", + value: [], + }, + ]); + t.topDicts = [ + { + name: "topDict_0", + type: "TABLE", + value: topDict, + }, + ]; + return t; + } + function makeStringIndex(strings) { + var t = new table.Record("String INDEX", [ + { + name: "strings", + type: "INDEX", + value: [], + }, + ]); + t.strings = []; + for (var i = 0; i < strings.length; i += 1) { + t.strings.push({ + name: "string_" + i, + type: "STRING", + value: strings[i], + }); + } + return t; + } + function makeGlobalSubrIndex() { + // Currently we don't use subroutines. + return new table.Record("Global Subr INDEX", [ + { + name: "subrs", + type: "INDEX", + value: [], + }, + ]); + } + function makeCharsets(glyphNames, strings) { + var t = new table.Record("Charsets", [ + { + name: "format", + type: "Card8", + value: 0, + }, + ]); + for (var i = 0; i < glyphNames.length; i += 1) { + var glyphName = glyphNames[i]; + var glyphSID = encodeString(glyphName, strings); + t.fields.push({ + name: "glyph_" + i, + type: "SID", + value: glyphSID, + }); + } + return t; + } + function glyphToOps(glyph) { + var ops = []; + var path = glyph.path; + ops.push({ + name: "width", + type: "NUMBER", + value: glyph.advanceWidth, + }); + var x = 0; + var y = 0; + for (var i = 0; i < path.commands.length; i += 1) { + var dx = void 0; + var dy = void 0; + var cmd = path.commands[i]; + if (cmd.type === "Q") { + // CFF only supports bézier curves, so convert the quad to a bézier. + var _13 = 1 / 3; + var _23 = 2 / 3; + // We're going to create a new command so we don't change the original path. + cmd = { + type: "C", + x: cmd.x, + y: cmd.y, + x1: _13 * x + _23 * cmd.x1, + y1: _13 * y + _23 * cmd.y1, + x2: _13 * cmd.x + _23 * cmd.x1, + y2: _13 * cmd.y + _23 * cmd.y1, + }; + } + if (cmd.type === "M") { + dx = Math.round(cmd.x - x); + dy = Math.round(cmd.y - y); + ops.push({ + name: "dx", + type: "NUMBER", + value: dx, + }); + ops.push({ + name: "dy", + type: "NUMBER", + value: dy, + }); + ops.push({ + name: "rmoveto", + type: "OP", + value: 21, + }); + x = Math.round(cmd.x); + y = Math.round(cmd.y); + } else if (cmd.type === "L") { + dx = Math.round(cmd.x - x); + dy = Math.round(cmd.y - y); + ops.push({ + name: "dx", + type: "NUMBER", + value: dx, + }); + ops.push({ + name: "dy", + type: "NUMBER", + value: dy, + }); + ops.push({ + name: "rlineto", + type: "OP", + value: 5, + }); + x = Math.round(cmd.x); + y = Math.round(cmd.y); + } else if (cmd.type === "C") { + var dx1 = Math.round(cmd.x1 - x); + var dy1 = Math.round(cmd.y1 - y); + var dx2 = Math.round(cmd.x2 - cmd.x1); + var dy2 = Math.round(cmd.y2 - cmd.y1); + dx = Math.round(cmd.x - cmd.x2); + dy = Math.round(cmd.y - cmd.y2); + ops.push({ + name: "dx1", + type: "NUMBER", + value: dx1, + }); + ops.push({ + name: "dy1", + type: "NUMBER", + value: dy1, + }); + ops.push({ + name: "dx2", + type: "NUMBER", + value: dx2, + }); + ops.push({ + name: "dy2", + type: "NUMBER", + value: dy2, + }); + ops.push({ + name: "dx", + type: "NUMBER", + value: dx, + }); + ops.push({ + name: "dy", + type: "NUMBER", + value: dy, + }); + ops.push({ + name: "rrcurveto", + type: "OP", + value: 8, + }); + x = Math.round(cmd.x); + y = Math.round(cmd.y); + } // Contours are closed automatically. + } + ops.push({ + name: "endchar", + type: "OP", + value: 14, + }); + return ops; + } + function makeCharStringsIndex(glyphs) { + var t = new table.Record("CharStrings INDEX", [ + { + name: "charStrings", + type: "INDEX", + value: [], + }, + ]); + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + var ops = glyphToOps(glyph); + t.charStrings.push({ + name: glyph.name, + type: "CHARSTRING", + value: ops, + }); + } + return t; + } + function makePrivateDict(attrs, strings) { + var t = new table.Record("Private DICT", [ + { + name: "dict", + type: "DICT", + value: {}, + }, + ]); + t.dict = makeDict(PRIVATE_DICT_META, attrs, strings); + return t; + } + function makeCFFTable(glyphs, options) { + var t = new table.Table("CFF ", [ + { + name: "header", + type: "RECORD", + }, + { + name: "nameIndex", + type: "RECORD", + }, + { + name: "topDictIndex", + type: "RECORD", + }, + { + name: "stringIndex", + type: "RECORD", + }, + { + name: "globalSubrIndex", + type: "RECORD", + }, + { + name: "charsets", + type: "RECORD", + }, + { + name: "charStringsIndex", + type: "RECORD", + }, + { + name: "privateDict", + type: "RECORD", + }, + ]); + var fontScale = 1 / options.unitsPerEm; + // We use non-zero values for the offsets so that the DICT encodes them. + // This is important because the size of the Top DICT plays a role in offset calculation, + // and the size shouldn't change after we've written correct offsets. + var attrs = { + version: options.version, + fullName: options.fullName, + familyName: options.familyName, + weight: options.weightName, + fontBBox: options.fontBBox || [0, 0, 0, 0], + fontMatrix: [fontScale, 0, 0, fontScale, 0, 0], + charset: 999, + encoding: 0, + charStrings: 999, + private: [0, 999], + }; + var privateAttrs = {}; + var glyphNames = []; + var glyph; + // Skip first glyph (.notdef) + for (var i = 1; i < glyphs.length; i += 1) { + glyph = glyphs.get(i); + glyphNames.push(glyph.name); + } + var strings = []; + t.header = makeHeader(); + t.nameIndex = makeNameIndex([options.postScriptName]); + var topDict = makeTopDict(attrs, strings); + t.topDictIndex = makeTopDictIndex(topDict); + t.globalSubrIndex = makeGlobalSubrIndex(); + t.charsets = makeCharsets(glyphNames, strings); + t.charStringsIndex = makeCharStringsIndex(glyphs); + t.privateDict = makePrivateDict(privateAttrs, strings); + // Needs to come at the end, to encode all custom strings used in the font. + t.stringIndex = makeStringIndex(strings); + var startOffset = + t.header.sizeOf() + + t.nameIndex.sizeOf() + + t.topDictIndex.sizeOf() + + t.stringIndex.sizeOf() + + t.globalSubrIndex.sizeOf(); + attrs.charset = startOffset; + // We use the CFF standard encoding; proper encoding will be handled in cmap. + attrs.encoding = 0; + attrs.charStrings = attrs.charset + t.charsets.sizeOf(); + attrs.private[1] = + attrs.charStrings + t.charStringsIndex.sizeOf(); + // Recreate the Top DICT INDEX with the correct offsets. + topDict = makeTopDict(attrs, strings); + t.topDictIndex = makeTopDictIndex(topDict); + return t; + } + var cff = { + parse: parseCFFTable, + make: makeCFFTable, + }; + // The `head` table contains global information about the font. + // Parse the header `head` table + function parseHeadTable(data, start) { + var head = {}; + var p = new parse.Parser(data, start); + head.version = p.parseVersion(); + head.fontRevision = Math.round(p.parseFixed() * 1000) / 1000; + head.checkSumAdjustment = p.parseULong(); + head.magicNumber = p.parseULong(); + check.argument( + head.magicNumber === 1594834165, + "Font header has wrong magic number.", + ); + head.flags = p.parseUShort(); + head.unitsPerEm = p.parseUShort(); + head.created = p.parseLongDateTime(); + head.modified = p.parseLongDateTime(); + head.xMin = p.parseShort(); + head.yMin = p.parseShort(); + head.xMax = p.parseShort(); + head.yMax = p.parseShort(); + head.macStyle = p.parseUShort(); + head.lowestRecPPEM = p.parseUShort(); + head.fontDirectionHint = p.parseShort(); + head.indexToLocFormat = p.parseShort(); + head.glyphDataFormat = p.parseShort(); + return head; + } + function makeHeadTable(options) { + // Apple Mac timestamp epoch is 01/01/1904 not 01/01/1970 + var timestamp = + Math.round(new Date().getTime() / 1000) + 2082844800; + var createdTimestamp = timestamp; + if (options.createdTimestamp) { + createdTimestamp = options.createdTimestamp + 2082844800; + } + return new table.Table( + "head", + [ + { + name: "version", + type: "FIXED", + value: 65536, + }, + { + name: "fontRevision", + type: "FIXED", + value: 65536, + }, + { + name: "checkSumAdjustment", + type: "ULONG", + value: 0, + }, + { + name: "magicNumber", + type: "ULONG", + value: 1594834165, + }, + { + name: "flags", + type: "USHORT", + value: 0, + }, + { + name: "unitsPerEm", + type: "USHORT", + value: 1000, + }, + { + name: "created", + type: "LONGDATETIME", + value: createdTimestamp, + }, + { + name: "modified", + type: "LONGDATETIME", + value: timestamp, + }, + { + name: "xMin", + type: "SHORT", + value: 0, + }, + { + name: "yMin", + type: "SHORT", + value: 0, + }, + { + name: "xMax", + type: "SHORT", + value: 0, + }, + { + name: "yMax", + type: "SHORT", + value: 0, + }, + { + name: "macStyle", + type: "USHORT", + value: 0, + }, + { + name: "lowestRecPPEM", + type: "USHORT", + value: 0, + }, + { + name: "fontDirectionHint", + type: "SHORT", + value: 2, + }, + { + name: "indexToLocFormat", + type: "SHORT", + value: 0, + }, + { + name: "glyphDataFormat", + type: "SHORT", + value: 0, + }, + ], + options, + ); + } + var head = { + parse: parseHeadTable, + make: makeHeadTable, + }; + // The `hhea` table contains information for horizontal layout. + // Parse the horizontal header `hhea` table + function parseHheaTable(data, start) { + var hhea = {}; + var p = new parse.Parser(data, start); + hhea.version = p.parseVersion(); + hhea.ascender = p.parseShort(); + hhea.descender = p.parseShort(); + hhea.lineGap = p.parseShort(); + hhea.advanceWidthMax = p.parseUShort(); + hhea.minLeftSideBearing = p.parseShort(); + hhea.minRightSideBearing = p.parseShort(); + hhea.xMaxExtent = p.parseShort(); + hhea.caretSlopeRise = p.parseShort(); + hhea.caretSlopeRun = p.parseShort(); + hhea.caretOffset = p.parseShort(); + p.relativeOffset += 8; + hhea.metricDataFormat = p.parseShort(); + hhea.numberOfHMetrics = p.parseUShort(); + return hhea; + } + function makeHheaTable(options) { + return new table.Table( + "hhea", + [ + { + name: "version", + type: "FIXED", + value: 65536, + }, + { + name: "ascender", + type: "FWORD", + value: 0, + }, + { + name: "descender", + type: "FWORD", + value: 0, + }, + { + name: "lineGap", + type: "FWORD", + value: 0, + }, + { + name: "advanceWidthMax", + type: "UFWORD", + value: 0, + }, + { + name: "minLeftSideBearing", + type: "FWORD", + value: 0, + }, + { + name: "minRightSideBearing", + type: "FWORD", + value: 0, + }, + { + name: "xMaxExtent", + type: "FWORD", + value: 0, + }, + { + name: "caretSlopeRise", + type: "SHORT", + value: 1, + }, + { + name: "caretSlopeRun", + type: "SHORT", + value: 0, + }, + { + name: "caretOffset", + type: "SHORT", + value: 0, + }, + { + name: "reserved1", + type: "SHORT", + value: 0, + }, + { + name: "reserved2", + type: "SHORT", + value: 0, + }, + { + name: "reserved3", + type: "SHORT", + value: 0, + }, + { + name: "reserved4", + type: "SHORT", + value: 0, + }, + { + name: "metricDataFormat", + type: "SHORT", + value: 0, + }, + { + name: "numberOfHMetrics", + type: "USHORT", + value: 0, + }, + ], + options, + ); + } + var hhea = { + parse: parseHheaTable, + make: makeHheaTable, + }; + // The `hmtx` table contains the horizontal metrics for all glyphs. + // Parse the `hmtx` table, which contains the horizontal metrics for all glyphs. + // This function augments the glyph array, adding the advanceWidth and leftSideBearing to each glyph. + function parseHmtxTable( + data, + start, + numMetrics, + numGlyphs, + glyphs, + ) { + var advanceWidth; + var leftSideBearing; + var p = new parse.Parser(data, start); + for (var i = 0; i < numGlyphs; i += 1) { + // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs. + if (i < numMetrics) { + advanceWidth = p.parseUShort(); + leftSideBearing = p.parseShort(); + } + var glyph = glyphs.get(i); + glyph.advanceWidth = advanceWidth; + glyph.leftSideBearing = leftSideBearing; + } + } + function makeHmtxTable(glyphs) { + var t = new table.Table("hmtx", []); + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + var advanceWidth = glyph.advanceWidth || 0; + var leftSideBearing = glyph.leftSideBearing || 0; + t.fields.push({ + name: "advanceWidth_" + i, + type: "USHORT", + value: advanceWidth, + }); + t.fields.push({ + name: "leftSideBearing_" + i, + type: "SHORT", + value: leftSideBearing, + }); + } + return t; + } + var hmtx = { + parse: parseHmtxTable, + make: makeHmtxTable, + }; + // The `ltag` table stores IETF BCP-47 language tags. It allows supporting + function makeLtagTable(tags) { + var result = new table.Table("ltag", [ + { + name: "version", + type: "ULONG", + value: 1, + }, + { + name: "flags", + type: "ULONG", + value: 0, + }, + { + name: "numTags", + type: "ULONG", + value: tags.length, + }, + ]); + var stringPool = ""; + var stringPoolOffset = 12 + tags.length * 4; + for (var i = 0; i < tags.length; ++i) { + var pos = stringPool.indexOf(tags[i]); + if (pos < 0) { + pos = stringPool.length; + stringPool += tags[i]; + } + result.fields.push({ + name: "offset " + i, + type: "USHORT", + value: stringPoolOffset + pos, + }); + result.fields.push({ + name: "length " + i, + type: "USHORT", + value: tags[i].length, + }); + } + result.fields.push({ + name: "stringPool", + type: "CHARARRAY", + value: stringPool, + }); + return result; + } + function parseLtagTable(data, start) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseULong(); + check.argument( + tableVersion === 1, + "Unsupported ltag table version.", + ); + // The 'ltag' specification does not define any flags; skip the field. + p.skip("uLong", 1); + var numTags = p.parseULong(); + var tags = []; + for (var i = 0; i < numTags; i++) { + var tag = ""; + var offset = start + p.parseUShort(); + var length = p.parseUShort(); + for (var j = offset; j < offset + length; ++j) { + tag += String.fromCharCode(data.getInt8(j)); + } + tags.push(tag); + } + return tags; + } + var ltag = { + make: makeLtagTable, + parse: parseLtagTable, + }; + // The `maxp` table establishes the memory requirements for the font. + // Parse the maximum profile `maxp` table. + function parseMaxpTable(data, start) { + var maxp = {}; + var p = new parse.Parser(data, start); + maxp.version = p.parseVersion(); + maxp.numGlyphs = p.parseUShort(); + if (maxp.version === 1) { + maxp.maxPoints = p.parseUShort(); + maxp.maxContours = p.parseUShort(); + maxp.maxCompositePoints = p.parseUShort(); + maxp.maxCompositeContours = p.parseUShort(); + maxp.maxZones = p.parseUShort(); + maxp.maxTwilightPoints = p.parseUShort(); + maxp.maxStorage = p.parseUShort(); + maxp.maxFunctionDefs = p.parseUShort(); + maxp.maxInstructionDefs = p.parseUShort(); + maxp.maxStackElements = p.parseUShort(); + maxp.maxSizeOfInstructions = p.parseUShort(); + maxp.maxComponentElements = p.parseUShort(); + maxp.maxComponentDepth = p.parseUShort(); + } + return maxp; + } + function makeMaxpTable(numGlyphs) { + return new table.Table("maxp", [ + { + name: "version", + type: "FIXED", + value: 20480, + }, + { + name: "numGlyphs", + type: "USHORT", + value: numGlyphs, + }, + ]); + } + var maxp = { + parse: parseMaxpTable, + make: makeMaxpTable, + }; + // The `name` naming table. + // NameIDs for the name table. + var nameTableNames = [ + "copyright", + // 0 + "fontFamily", + // 1 + "fontSubfamily", + // 2 + "uniqueID", + // 3 + "fullName", + // 4 + "version", + // 5 + "postScriptName", + // 6 + "trademark", + // 7 + "manufacturer", + // 8 + "designer", + // 9 + "description", + // 10 + "manufacturerURL", + // 11 + "designerURL", + // 12 + "license", + // 13 + "licenseURL", + // 14 + "reserved", + // 15 + "preferredFamily", + // 16 + "preferredSubfamily", + // 17 + "compatibleFullName", + // 18 + "sampleText", + // 19 + "postScriptFindFontName", + // 20 + "wwsFamily", + // 21 + "wwsSubfamily", // 22 + ]; + var macLanguages = { + 0: "en", + 1: "fr", + 2: "de", + 3: "it", + 4: "nl", + 5: "sv", + 6: "es", + 7: "da", + 8: "pt", + 9: "no", + 10: "he", + 11: "ja", + 12: "ar", + 13: "fi", + 14: "el", + 15: "is", + 16: "mt", + 17: "tr", + 18: "hr", + 19: "zh-Hant", + 20: "ur", + 21: "hi", + 22: "th", + 23: "ko", + 24: "lt", + 25: "pl", + 26: "hu", + 27: "es", + 28: "lv", + 29: "se", + 30: "fo", + 31: "fa", + 32: "ru", + 33: "zh", + 34: "nl-BE", + 35: "ga", + 36: "sq", + 37: "ro", + 38: "cz", + 39: "sk", + 40: "si", + 41: "yi", + 42: "sr", + 43: "mk", + 44: "bg", + 45: "uk", + 46: "be", + 47: "uz", + 48: "kk", + 49: "az-Cyrl", + 50: "az-Arab", + 51: "hy", + 52: "ka", + 53: "mo", + 54: "ky", + 55: "tg", + 56: "tk", + 57: "mn-CN", + 58: "mn", + 59: "ps", + 60: "ks", + 61: "ku", + 62: "sd", + 63: "bo", + 64: "ne", + 65: "sa", + 66: "mr", + 67: "bn", + 68: "as", + 69: "gu", + 70: "pa", + 71: "or", + 72: "ml", + 73: "kn", + 74: "ta", + 75: "te", + 76: "si", + 77: "my", + 78: "km", + 79: "lo", + 80: "vi", + 81: "id", + 82: "tl", + 83: "ms", + 84: "ms-Arab", + 85: "am", + 86: "ti", + 87: "om", + 88: "so", + 89: "sw", + 90: "rw", + 91: "rn", + 92: "ny", + 93: "mg", + 94: "eo", + 128: "cy", + 129: "eu", + 130: "ca", + 131: "la", + 132: "qu", + 133: "gn", + 134: "ay", + 135: "tt", + 136: "ug", + 137: "dz", + 138: "jv", + 139: "su", + 140: "gl", + 141: "af", + 142: "br", + 143: "iu", + 144: "gd", + 145: "gv", + 146: "ga", + 147: "to", + 148: "el-polyton", + 149: "kl", + 150: "az", + 151: "nn", + }; + // MacOS language ID → MacOS script ID + // + // Note that the script ID is not sufficient to determine what encoding + // to use in TrueType files. For some languages, MacOS used a modification + // of a mainstream script. For example, an Icelandic name would be stored + // with smRoman in the TrueType naming table, but the actual encoding + // is a special Icelandic version of the normal Macintosh Roman encoding. + // As another example, Inuktitut uses an 8-bit encoding for Canadian Aboriginal + // Syllables but MacOS had run out of available script codes, so this was + // done as a (pretty radical) "modification" of Ethiopic. + // + // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt + var macLanguageToScript = { + 0: 0, + // langEnglish → smRoman + 1: 0, + // langFrench → smRoman + 2: 0, + // langGerman → smRoman + 3: 0, + // langItalian → smRoman + 4: 0, + // langDutch → smRoman + 5: 0, + // langSwedish → smRoman + 6: 0, + // langSpanish → smRoman + 7: 0, + // langDanish → smRoman + 8: 0, + // langPortuguese → smRoman + 9: 0, + // langNorwegian → smRoman + 10: 5, + // langHebrew → smHebrew + 11: 1, + // langJapanese → smJapanese + 12: 4, + // langArabic → smArabic + 13: 0, + // langFinnish → smRoman + 14: 6, + // langGreek → smGreek + 15: 0, + // langIcelandic → smRoman (modified) + 16: 0, + // langMaltese → smRoman + 17: 0, + // langTurkish → smRoman (modified) + 18: 0, + // langCroatian → smRoman (modified) + 19: 2, + // langTradChinese → smTradChinese + 20: 4, + // langUrdu → smArabic + 21: 9, + // langHindi → smDevanagari + 22: 21, + // langThai → smThai + 23: 3, + // langKorean → smKorean + 24: 29, + // langLithuanian → smCentralEuroRoman + 25: 29, + // langPolish → smCentralEuroRoman + 26: 29, + // langHungarian → smCentralEuroRoman + 27: 29, + // langEstonian → smCentralEuroRoman + 28: 29, + // langLatvian → smCentralEuroRoman + 29: 0, + // langSami → smRoman + 30: 0, + // langFaroese → smRoman (modified) + 31: 4, + // langFarsi → smArabic (modified) + 32: 7, + // langRussian → smCyrillic + 33: 25, + // langSimpChinese → smSimpChinese + 34: 0, + // langFlemish → smRoman + 35: 0, + // langIrishGaelic → smRoman (modified) + 36: 0, + // langAlbanian → smRoman + 37: 0, + // langRomanian → smRoman (modified) + 38: 29, + // langCzech → smCentralEuroRoman + 39: 29, + // langSlovak → smCentralEuroRoman + 40: 0, + // langSlovenian → smRoman (modified) + 41: 5, + // langYiddish → smHebrew + 42: 7, + // langSerbian → smCyrillic + 43: 7, + // langMacedonian → smCyrillic + 44: 7, + // langBulgarian → smCyrillic + 45: 7, + // langUkrainian → smCyrillic (modified) + 46: 7, + // langByelorussian → smCyrillic + 47: 7, + // langUzbek → smCyrillic + 48: 7, + // langKazakh → smCyrillic + 49: 7, + // langAzerbaijani → smCyrillic + 50: 4, + // langAzerbaijanAr → smArabic + 51: 24, + // langArmenian → smArmenian + 52: 23, + // langGeorgian → smGeorgian + 53: 7, + // langMoldavian → smCyrillic + 54: 7, + // langKirghiz → smCyrillic + 55: 7, + // langTajiki → smCyrillic + 56: 7, + // langTurkmen → smCyrillic + 57: 27, + // langMongolian → smMongolian + 58: 7, + // langMongolianCyr → smCyrillic + 59: 4, + // langPashto → smArabic + 60: 4, + // langKurdish → smArabic + 61: 4, + // langKashmiri → smArabic + 62: 4, + // langSindhi → smArabic + 63: 26, + // langTibetan → smTibetan + 64: 9, + // langNepali → smDevanagari + 65: 9, + // langSanskrit → smDevanagari + 66: 9, + // langMarathi → smDevanagari + 67: 13, + // langBengali → smBengali + 68: 13, + // langAssamese → smBengali + 69: 11, + // langGujarati → smGujarati + 70: 10, + // langPunjabi → smGurmukhi + 71: 12, + // langOriya → smOriya + 72: 17, + // langMalayalam → smMalayalam + 73: 16, + // langKannada → smKannada + 74: 14, + // langTamil → smTamil + 75: 15, + // langTelugu → smTelugu + 76: 18, + // langSinhalese → smSinhalese + 77: 19, + // langBurmese → smBurmese + 78: 20, + // langKhmer → smKhmer + 79: 22, + // langLao → smLao + 80: 30, + // langVietnamese → smVietnamese + 81: 0, + // langIndonesian → smRoman + 82: 0, + // langTagalog → smRoman + 83: 0, + // langMalayRoman → smRoman + 84: 4, + // langMalayArabic → smArabic + 85: 28, + // langAmharic → smEthiopic + 86: 28, + // langTigrinya → smEthiopic + 87: 28, + // langOromo → smEthiopic + 88: 0, + // langSomali → smRoman + 89: 0, + // langSwahili → smRoman + 90: 0, + // langKinyarwanda → smRoman + 91: 0, + // langRundi → smRoman + 92: 0, + // langNyanja → smRoman + 93: 0, + // langMalagasy → smRoman + 94: 0, + // langEsperanto → smRoman + 128: 0, + // langWelsh → smRoman (modified) + 129: 0, + // langBasque → smRoman + 130: 0, + // langCatalan → smRoman + 131: 0, + // langLatin → smRoman + 132: 0, + // langQuechua → smRoman + 133: 0, + // langGuarani → smRoman + 134: 0, + // langAymara → smRoman + 135: 7, + // langTatar → smCyrillic + 136: 4, + // langUighur → smArabic + 137: 26, + // langDzongkha → smTibetan + 138: 0, + // langJavaneseRom → smRoman + 139: 0, + // langSundaneseRom → smRoman + 140: 0, + // langGalician → smRoman + 141: 0, + // langAfrikaans → smRoman + 142: 0, + // langBreton → smRoman (modified) + 143: 28, + // langInuktitut → smEthiopic (modified) + 144: 0, + // langScottishGaelic → smRoman (modified) + 145: 0, + // langManxGaelic → smRoman (modified) + 146: 0, + // langIrishGaelicScript → smRoman (modified) + 147: 0, + // langTongan → smRoman + 148: 6, + // langGreekAncient → smRoman + 149: 0, + // langGreenlandic → smRoman + 150: 0, + // langAzerbaijanRoman → smRoman + 151: 0, // langNynorsk → smRoman + }; + // While Microsoft indicates a region/country for all its language + // IDs, we omit the region code if it's equal to the "most likely + // region subtag" according to Unicode CLDR. For scripts, we omit + // the subtag if it is equal to the Suppress-Script entry in the + // IANA language subtag registry for IETF BCP 47. + // + // For example, Microsoft states that its language code 0x041A is + // Croatian in Croatia. We transform this to the BCP 47 language code 'hr' + // and not 'hr-HR' because Croatia is the default country for Croatian, + // according to Unicode CLDR. As another example, Microsoft states + // that 0x101A is Croatian (Latin) in Bosnia-Herzegovina. We transform + // this to 'hr-BA' and not 'hr-Latn-BA' because Latin is the default script + // for the Croatian language, according to IANA. + // + // http://www.unicode.org/cldr/charts/latest/supplemental/likely_subtags.html + // http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry + var windowsLanguages = { + 1078: "af", + 1052: "sq", + 1156: "gsw", + 1118: "am", + 5121: "ar-DZ", + 15361: "ar-BH", + 3073: "ar", + 2049: "ar-IQ", + 11265: "ar-JO", + 13313: "ar-KW", + 12289: "ar-LB", + 4097: "ar-LY", + 6145: "ary", + 8193: "ar-OM", + 16385: "ar-QA", + 1025: "ar-SA", + 10241: "ar-SY", + 7169: "aeb", + 14337: "ar-AE", + 9217: "ar-YE", + 1067: "hy", + 1101: "as", + 2092: "az-Cyrl", + 1068: "az", + 1133: "ba", + 1069: "eu", + 1059: "be", + 2117: "bn", + 1093: "bn-IN", + 8218: "bs-Cyrl", + 5146: "bs", + 1150: "br", + 1026: "bg", + 1027: "ca", + 3076: "zh-HK", + 5124: "zh-MO", + 2052: "zh", + 4100: "zh-SG", + 1028: "zh-TW", + 1155: "co", + 1050: "hr", + 4122: "hr-BA", + 1029: "cs", + 1030: "da", + 1164: "prs", + 1125: "dv", + 2067: "nl-BE", + 1043: "nl", + 3081: "en-AU", + 10249: "en-BZ", + 4105: "en-CA", + 9225: "en-029", + 16393: "en-IN", + 6153: "en-IE", + 8201: "en-JM", + 17417: "en-MY", + 5129: "en-NZ", + 13321: "en-PH", + 18441: "en-SG", + 7177: "en-ZA", + 11273: "en-TT", + 2057: "en-GB", + 1033: "en", + 12297: "en-ZW", + 1061: "et", + 1080: "fo", + 1124: "fil", + 1035: "fi", + 2060: "fr-BE", + 3084: "fr-CA", + 1036: "fr", + 5132: "fr-LU", + 6156: "fr-MC", + 4108: "fr-CH", + 1122: "fy", + 1110: "gl", + 1079: "ka", + 3079: "de-AT", + 1031: "de", + 5127: "de-LI", + 4103: "de-LU", + 2055: "de-CH", + 1032: "el", + 1135: "kl", + 1095: "gu", + 1128: "ha", + 1037: "he", + 1081: "hi", + 1038: "hu", + 1039: "is", + 1136: "ig", + 1057: "id", + 1117: "iu", + 2141: "iu-Latn", + 2108: "ga", + 1076: "xh", + 1077: "zu", + 1040: "it", + 2064: "it-CH", + 1041: "ja", + 1099: "kn", + 1087: "kk", + 1107: "km", + 1158: "quc", + 1159: "rw", + 1089: "sw", + 1111: "kok", + 1042: "ko", + 1088: "ky", + 1108: "lo", + 1062: "lv", + 1063: "lt", + 2094: "dsb", + 1134: "lb", + 1071: "mk", + 2110: "ms-BN", + 1086: "ms", + 1100: "ml", + 1082: "mt", + 1153: "mi", + 1146: "arn", + 1102: "mr", + 1148: "moh", + 1104: "mn", + 2128: "mn-CN", + 1121: "ne", + 1044: "nb", + 2068: "nn", + 1154: "oc", + 1096: "or", + 1123: "ps", + 1045: "pl", + 1046: "pt", + 2070: "pt-PT", + 1094: "pa", + 1131: "qu-BO", + 2155: "qu-EC", + 3179: "qu", + 1048: "ro", + 1047: "rm", + 1049: "ru", + 9275: "smn", + 4155: "smj-NO", + 5179: "smj", + 3131: "se-FI", + 1083: "se", + 2107: "se-SE", + 8251: "sms", + 6203: "sma-NO", + 7227: "sms", + 1103: "sa", + 7194: "sr-Cyrl-BA", + 3098: "sr", + 6170: "sr-Latn-BA", + 2074: "sr-Latn", + 1132: "nso", + 1074: "tn", + 1115: "si", + 1051: "sk", + 1060: "sl", + 11274: "es-AR", + 16394: "es-BO", + 13322: "es-CL", + 9226: "es-CO", + 5130: "es-CR", + 7178: "es-DO", + 12298: "es-EC", + 17418: "es-SV", + 4106: "es-GT", + 18442: "es-HN", + 2058: "es-MX", + 19466: "es-NI", + 6154: "es-PA", + 15370: "es-PY", + 10250: "es-PE", + 20490: "es-PR", + // Microsoft has defined two different language codes for + // “Spanish with modern sorting” and “Spanish with traditional + // sorting”. This makes sense for collation APIs, and it would be + // possible to express this in BCP 47 language tags via Unicode + // extensions (eg., es-u-co-trad is Spanish with traditional + // sorting). However, for storing names in fonts, the distinction + // does not make sense, so we give “es” in both cases. + 3082: "es", + 1034: "es", + 21514: "es-US", + 14346: "es-UY", + 8202: "es-VE", + 2077: "sv-FI", + 1053: "sv", + 1114: "syr", + 1064: "tg", + 2143: "tzm", + 1097: "ta", + 1092: "tt", + 1098: "te", + 1054: "th", + 1105: "bo", + 1055: "tr", + 1090: "tk", + 1152: "ug", + 1058: "uk", + 1070: "hsb", + 1056: "ur", + 2115: "uz-Cyrl", + 1091: "uz", + 1066: "vi", + 1106: "cy", + 1160: "wo", + 1157: "sah", + 1144: "ii", + 1130: "yo", + }; + // Returns a IETF BCP 47 language code, for example 'zh-Hant' + // for 'Chinese in the traditional script'. + function getLanguageCode(platformID, languageID, ltag) { + switch (platformID) { + case 0: + // Unicode + if (languageID === 65535) { + return "und"; + } else if (ltag) { + return ltag[languageID]; + } + break; + case 1: + // Macintosh + return macLanguages[languageID]; + case 3: + // Windows + return windowsLanguages[languageID]; + } + return undefined; + } + var utf16 = "utf-16"; + // MacOS script ID → encoding. This table stores the default case, + // which can be overridden by macLanguageEncodings. + var macScriptEncodings = { + 0: "macintosh", + // smRoman + 1: "x-mac-japanese", + // smJapanese + 2: "x-mac-chinesetrad", + // smTradChinese + 3: "x-mac-korean", + // smKorean + 6: "x-mac-greek", + // smGreek + 7: "x-mac-cyrillic", + // smCyrillic + 9: "x-mac-devanagai", + // smDevanagari + 10: "x-mac-gurmukhi", + // smGurmukhi + 11: "x-mac-gujarati", + // smGujarati + 12: "x-mac-oriya", + // smOriya + 13: "x-mac-bengali", + // smBengali + 14: "x-mac-tamil", + // smTamil + 15: "x-mac-telugu", + // smTelugu + 16: "x-mac-kannada", + // smKannada + 17: "x-mac-malayalam", + // smMalayalam + 18: "x-mac-sinhalese", + // smSinhalese + 19: "x-mac-burmese", + // smBurmese + 20: "x-mac-khmer", + // smKhmer + 21: "x-mac-thai", + // smThai + 22: "x-mac-lao", + // smLao + 23: "x-mac-georgian", + // smGeorgian + 24: "x-mac-armenian", + // smArmenian + 25: "x-mac-chinesesimp", + // smSimpChinese + 26: "x-mac-tibetan", + // smTibetan + 27: "x-mac-mongolian", + // smMongolian + 28: "x-mac-ethiopic", + // smEthiopic + 29: "x-mac-ce", + // smCentralEuroRoman + 30: "x-mac-vietnamese", + // smVietnamese + 31: "x-mac-extarabic", // smExtArabic + }; + // MacOS language ID → encoding. This table stores the exceptional + // cases, which override macScriptEncodings. For writing MacOS naming + // tables, we need to emit a MacOS script ID. Therefore, we cannot + // merge macScriptEncodings into macLanguageEncodings. + // + // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt + var macLanguageEncodings = { + 15: "x-mac-icelandic", + // langIcelandic + 17: "x-mac-turkish", + // langTurkish + 18: "x-mac-croatian", + // langCroatian + 24: "x-mac-ce", + // langLithuanian + 25: "x-mac-ce", + // langPolish + 26: "x-mac-ce", + // langHungarian + 27: "x-mac-ce", + // langEstonian + 28: "x-mac-ce", + // langLatvian + 30: "x-mac-icelandic", + // langFaroese + 37: "x-mac-romanian", + // langRomanian + 38: "x-mac-ce", + // langCzech + 39: "x-mac-ce", + // langSlovak + 40: "x-mac-ce", + // langSlovenian + 143: "x-mac-inuit", + // langInuktitut + 146: "x-mac-gaelic", // langIrishGaelicScript + }; + function getEncoding(platformID, encodingID, languageID) { + switch (platformID) { + case 0: + // Unicode + return utf16; + case 1: + // Apple Macintosh + return ( + macLanguageEncodings[languageID] || + macScriptEncodings[encodingID] + ); + case 3: + // Microsoft Windows + if (encodingID === 1 || encodingID === 10) { + return utf16; + } + break; + } + return undefined; + } // Parse the naming `name` table. + // FIXME: Format 1 additional fields are not supported yet. + // ltag is the content of the `ltag' table, such as ['en', 'zh-Hans', 'de-CH-1904']. + + function parseNameTable(data, start, ltag) { + var name = {}; + var p = new parse.Parser(data, start); + var format = p.parseUShort(); + var count = p.parseUShort(); + var stringOffset = p.offset + p.parseUShort(); + for (var i = 0; i < count; i++) { + var platformID = p.parseUShort(); + var encodingID = p.parseUShort(); + var languageID = p.parseUShort(); + var nameID = p.parseUShort(); + var property = nameTableNames[nameID] || nameID; + var byteLength = p.parseUShort(); + var offset = p.parseUShort(); + var language = getLanguageCode(platformID, languageID, ltag); + var encoding = getEncoding( + platformID, + encodingID, + languageID, + ); + if (encoding !== undefined && language !== undefined) { + var text = void 0; + if (encoding === utf16) { + text = decode.UTF16( + data, + stringOffset + offset, + byteLength, + ); + } else { + text = decode.MACSTRING( + data, + stringOffset + offset, + byteLength, + encoding, + ); + } + if (text) { + var translations = name[property]; + if (translations === undefined) { + translations = name[property] = {}; + } + translations[language] = text; + } + } + } + var langTagCount = 0; + if (format === 1) { + // FIXME: Also handle Microsoft's 'name' table 1. + langTagCount = p.parseUShort(); + } + return name; + } // {23: 'foo'} → {'foo': 23} + // ['bar', 'baz'] → {'bar': 0, 'baz': 1} + + function reverseDict(dict) { + var result = {}; + for (var key in dict) { + result[dict[key]] = parseInt(key); + } + return result; + } + function makeNameRecord( + platformID, + encodingID, + languageID, + nameID, + length, + offset, + ) { + return new table.Record("NameRecord", [ + { + name: "platformID", + type: "USHORT", + value: platformID, + }, + { + name: "encodingID", + type: "USHORT", + value: encodingID, + }, + { + name: "languageID", + type: "USHORT", + value: languageID, + }, + { + name: "nameID", + type: "USHORT", + value: nameID, + }, + { + name: "length", + type: "USHORT", + value: length, + }, + { + name: "offset", + type: "USHORT", + value: offset, + }, + ]); + } // Finds the position of needle in haystack, or -1 if not there. + // Like String.indexOf(), but for arrays. + + function findSubArray(needle, haystack) { + var needleLength = needle.length; + var limit = haystack.length - needleLength + 1; + loop: for (var pos = 0; pos < limit; pos++) { + for (; pos < limit; pos++) { + for (var k = 0; k < needleLength; k++) { + if (haystack[pos + k] !== needle[k]) { + continue loop; + } + } + return pos; + } + } + return -1; + } + function addStringToPool(s, pool) { + var offset = findSubArray(s, pool); + if (offset < 0) { + offset = pool.length; + var i = 0; + var len = s.length; + for (; i < len; ++i) { + pool.push(s[i]); + } + } + return offset; + } + function makeNameTable(names, ltag) { + var nameID; + var nameIDs = []; + var namesWithNumericKeys = {}; + var nameTableIds = reverseDict(nameTableNames); + for (var key in names) { + var id = nameTableIds[key]; + if (id === undefined) { + id = key; + } + nameID = parseInt(id); + if (isNaN(nameID)) { + throw new Error( + 'Name table entry "' + + key + + '" does not exist, see nameTableNames for complete list.', + ); + } + namesWithNumericKeys[nameID] = names[key]; + nameIDs.push(nameID); + } + var macLanguageIds = reverseDict(macLanguages); + var windowsLanguageIds = reverseDict(windowsLanguages); + var nameRecords = []; + var stringPool = []; + for (var i = 0; i < nameIDs.length; i++) { + nameID = nameIDs[i]; + var translations = namesWithNumericKeys[nameID]; + for (var lang in translations) { + var text = translations[lang]; + // For MacOS, we try to emit the name in the form that was introduced + // in the initial version of the TrueType spec (in the late 1980s). + // However, this can fail for various reasons: the requested BCP 47 + // language code might not have an old-style Mac equivalent; + // we might not have a codec for the needed character encoding; + // or the name might contain characters that cannot be expressed + // in the old-style Macintosh encoding. In case of failure, we emit + // the name in a more modern fashion (Unicode encoding with BCP 47 + // language tags) that is recognized by MacOS 10.5, released in 2009. + // If fonts were only read by operating systems, we could simply + // emit all names in the modern form; this would be much easier. + // However, there are many applications and libraries that read + // 'name' tables directly, and these will usually only recognize + // the ancient form (silently skipping the unrecognized names). + var macPlatform = 1; // Macintosh + var macLanguage = macLanguageIds[lang]; + var macScript = macLanguageToScript[macLanguage]; + var macEncoding = getEncoding( + macPlatform, + macScript, + macLanguage, + ); + var macName = encode.MACSTRING(text, macEncoding); + if (macName === undefined) { + macPlatform = 0; // Unicode + macLanguage = ltag.indexOf(lang); + if (macLanguage < 0) { + macLanguage = ltag.length; + ltag.push(lang); + } + macScript = 4; // Unicode 2.0 and later + macName = encode.UTF16(text); + } + var macNameOffset = addStringToPool(macName, stringPool); + nameRecords.push( + makeNameRecord( + macPlatform, + macScript, + macLanguage, + nameID, + macName.length, + macNameOffset, + ), + ); + var winLanguage = windowsLanguageIds[lang]; + if (winLanguage !== undefined) { + var winName = encode.UTF16(text); + var winNameOffset = addStringToPool(winName, stringPool); + nameRecords.push( + makeNameRecord( + 3, + 1, + winLanguage, + nameID, + winName.length, + winNameOffset, + ), + ); + } + } + } + nameRecords.sort(function (a, b) { + return ( + a.platformID - b.platformID || + a.encodingID - b.encodingID || + a.languageID - b.languageID || + a.nameID - b.nameID + ); + }); + var t = new table.Table("name", [ + { + name: "format", + type: "USHORT", + value: 0, + }, + { + name: "count", + type: "USHORT", + value: nameRecords.length, + }, + { + name: "stringOffset", + type: "USHORT", + value: 6 + nameRecords.length * 12, + }, + ]); + for (var r = 0; r < nameRecords.length; r++) { + t.fields.push({ + name: "record_" + r, + type: "RECORD", + value: nameRecords[r], + }); + } + t.fields.push({ + name: "strings", + type: "LITERAL", + value: stringPool, + }); + return t; + } + var _name = { + parse: parseNameTable, + make: makeNameTable, + }; + // The `OS/2` table contains metrics required in OpenType fonts. + var unicodeRanges = [ + { + begin: 0, + end: 127, + }, + // Basic Latin + { + begin: 128, + end: 255, + }, + // Latin-1 Supplement + { + begin: 256, + end: 383, + }, + // Latin Extended-A + { + begin: 384, + end: 591, + }, + // Latin Extended-B + { + begin: 592, + end: 687, + }, + // IPA Extensions + { + begin: 688, + end: 767, + }, + // Spacing Modifier Letters + { + begin: 768, + end: 879, + }, + // Combining Diacritical Marks + { + begin: 880, + end: 1023, + }, + // Greek and Coptic + { + begin: 11392, + end: 11519, + }, + // Coptic + { + begin: 1024, + end: 1279, + }, + // Cyrillic + { + begin: 1328, + end: 1423, + }, + // Armenian + { + begin: 1424, + end: 1535, + }, + // Hebrew + { + begin: 42240, + end: 42559, + }, + // Vai + { + begin: 1536, + end: 1791, + }, + // Arabic + { + begin: 1984, + end: 2047, + }, + // NKo + { + begin: 2304, + end: 2431, + }, + // Devanagari + { + begin: 2432, + end: 2559, + }, + // Bengali + { + begin: 2560, + end: 2687, + }, + // Gurmukhi + { + begin: 2688, + end: 2815, + }, + // Gujarati + { + begin: 2816, + end: 2943, + }, + // Oriya + { + begin: 2944, + end: 3071, + }, + // Tamil + { + begin: 3072, + end: 3199, + }, + // Telugu + { + begin: 3200, + end: 3327, + }, + // Kannada + { + begin: 3328, + end: 3455, + }, + // Malayalam + { + begin: 3584, + end: 3711, + }, + // Thai + { + begin: 3712, + end: 3839, + }, + // Lao + { + begin: 4256, + end: 4351, + }, + // Georgian + { + begin: 6912, + end: 7039, + }, + // Balinese + { + begin: 4352, + end: 4607, + }, + // Hangul Jamo + { + begin: 7680, + end: 7935, + }, + // Latin Extended Additional + { + begin: 7936, + end: 8191, + }, + // Greek Extended + { + begin: 8192, + end: 8303, + }, + // General Punctuation + { + begin: 8304, + end: 8351, + }, + // Superscripts And Subscripts + { + begin: 8352, + end: 8399, + }, + // Currency Symbol + { + begin: 8400, + end: 8447, + }, + // Combining Diacritical Marks For Symbols + { + begin: 8448, + end: 8527, + }, + // Letterlike Symbols + { + begin: 8528, + end: 8591, + }, + // Number Forms + { + begin: 8592, + end: 8703, + }, + // Arrows + { + begin: 8704, + end: 8959, + }, + // Mathematical Operators + { + begin: 8960, + end: 9215, + }, + // Miscellaneous Technical + { + begin: 9216, + end: 9279, + }, + // Control Pictures + { + begin: 9280, + end: 9311, + }, + // Optical Character Recognition + { + begin: 9312, + end: 9471, + }, + // Enclosed Alphanumerics + { + begin: 9472, + end: 9599, + }, + // Box Drawing + { + begin: 9600, + end: 9631, + }, + // Block Elements + { + begin: 9632, + end: 9727, + }, + // Geometric Shapes + { + begin: 9728, + end: 9983, + }, + // Miscellaneous Symbols + { + begin: 9984, + end: 10175, + }, + // Dingbats + { + begin: 12288, + end: 12351, + }, + // CJK Symbols And Punctuation + { + begin: 12352, + end: 12447, + }, + // Hiragana + { + begin: 12448, + end: 12543, + }, + // Katakana + { + begin: 12544, + end: 12591, + }, + // Bopomofo + { + begin: 12592, + end: 12687, + }, + // Hangul Compatibility Jamo + { + begin: 43072, + end: 43135, + }, + // Phags-pa + { + begin: 12800, + end: 13055, + }, + // Enclosed CJK Letters And Months + { + begin: 13056, + end: 13311, + }, + // CJK Compatibility + { + begin: 44032, + end: 55215, + }, + // Hangul Syllables + { + begin: 55296, + end: 57343, + }, + // Non-Plane 0 * + { + begin: 67840, + end: 67871, + }, + // Phoenicia + { + begin: 19968, + end: 40959, + }, + // CJK Unified Ideographs + { + begin: 57344, + end: 63743, + }, + // Private Use Area (plane 0) + { + begin: 12736, + end: 12783, + }, + // CJK Strokes + { + begin: 64256, + end: 64335, + }, + // Alphabetic Presentation Forms + { + begin: 64336, + end: 65023, + }, + // Arabic Presentation Forms-A + { + begin: 65056, + end: 65071, + }, + // Combining Half Marks + { + begin: 65040, + end: 65055, + }, + // Vertical Forms + { + begin: 65104, + end: 65135, + }, + // Small Form Variants + { + begin: 65136, + end: 65279, + }, + // Arabic Presentation Forms-B + { + begin: 65280, + end: 65519, + }, + // Halfwidth And Fullwidth Forms + { + begin: 65520, + end: 65535, + }, + // Specials + { + begin: 3840, + end: 4095, + }, + // Tibetan + { + begin: 1792, + end: 1871, + }, + // Syriac + { + begin: 1920, + end: 1983, + }, + // Thaana + { + begin: 3456, + end: 3583, + }, + // Sinhala + { + begin: 4096, + end: 4255, + }, + // Myanmar + { + begin: 4608, + end: 4991, + }, + // Ethiopic + { + begin: 5024, + end: 5119, + }, + // Cherokee + { + begin: 5120, + end: 5759, + }, + // Unified Canadian Aboriginal Syllabics + { + begin: 5760, + end: 5791, + }, + // Ogham + { + begin: 5792, + end: 5887, + }, + // Runic + { + begin: 6016, + end: 6143, + }, + // Khmer + { + begin: 6144, + end: 6319, + }, + // Mongolian + { + begin: 10240, + end: 10495, + }, + // Braille Patterns + { + begin: 40960, + end: 42127, + }, + // Yi Syllables + { + begin: 5888, + end: 5919, + }, + // Tagalog + { + begin: 66304, + end: 66351, + }, + // Old Italic + { + begin: 66352, + end: 66383, + }, + // Gothic + { + begin: 66560, + end: 66639, + }, + // Deseret + { + begin: 118784, + end: 119039, + }, + // Byzantine Musical Symbols + { + begin: 119808, + end: 120831, + }, + // Mathematical Alphanumeric Symbols + { + begin: 1044480, + end: 1048573, + }, + // Private Use (plane 15) + { + begin: 65024, + end: 65039, + }, + // Variation Selectors + { + begin: 917504, + end: 917631, + }, + // Tags + { + begin: 6400, + end: 6479, + }, + // Limbu + { + begin: 6480, + end: 6527, + }, + // Tai Le + { + begin: 6528, + end: 6623, + }, + // New Tai Lue + { + begin: 6656, + end: 6687, + }, + // Buginese + { + begin: 11264, + end: 11359, + }, + // Glagolitic + { + begin: 11568, + end: 11647, + }, + // Tifinagh + { + begin: 19904, + end: 19967, + }, + // Yijing Hexagram Symbols + { + begin: 43008, + end: 43055, + }, + // Syloti Nagri + { + begin: 65536, + end: 65663, + }, + // Linear B Syllabary + { + begin: 65856, + end: 65935, + }, + // Ancient Greek Numbers + { + begin: 66432, + end: 66463, + }, + // Ugaritic + { + begin: 66464, + end: 66527, + }, + // Old Persian + { + begin: 66640, + end: 66687, + }, + // Shavian + { + begin: 66688, + end: 66735, + }, + // Osmanya + { + begin: 67584, + end: 67647, + }, + // Cypriot Syllabary + { + begin: 68096, + end: 68191, + }, + // Kharoshthi + { + begin: 119552, + end: 119647, + }, + // Tai Xuan Jing Symbols + { + begin: 73728, + end: 74751, + }, + // Cuneiform + { + begin: 119648, + end: 119679, + }, + // Counting Rod Numerals + { + begin: 7040, + end: 7103, + }, + // Sundanese + { + begin: 7168, + end: 7247, + }, + // Lepcha + { + begin: 7248, + end: 7295, + }, + // Ol Chiki + { + begin: 43136, + end: 43231, + }, + // Saurashtra + { + begin: 43264, + end: 43311, + }, + // Kayah Li + { + begin: 43312, + end: 43359, + }, + // Rejang + { + begin: 43520, + end: 43615, + }, + // Cham + { + begin: 65936, + end: 65999, + }, + // Ancient Symbols + { + begin: 66000, + end: 66047, + }, + // Phaistos Disc + { + begin: 66208, + end: 66271, + }, + // Carian + { + begin: 127024, + end: 127135, + }, // Domino Tiles + ]; + function getUnicodeRange(unicode) { + for (var i = 0; i < unicodeRanges.length; i += 1) { + var range = unicodeRanges[i]; + if (unicode >= range.begin && unicode < range.end) { + return i; + } + } + return -1; + } // Parse the OS/2 and Windows metrics `OS/2` table + + function parseOS2Table(data, start) { + var os2 = {}; + var p = new parse.Parser(data, start); + os2.version = p.parseUShort(); + os2.xAvgCharWidth = p.parseShort(); + os2.usWeightClass = p.parseUShort(); + os2.usWidthClass = p.parseUShort(); + os2.fsType = p.parseUShort(); + os2.ySubscriptXSize = p.parseShort(); + os2.ySubscriptYSize = p.parseShort(); + os2.ySubscriptXOffset = p.parseShort(); + os2.ySubscriptYOffset = p.parseShort(); + os2.ySuperscriptXSize = p.parseShort(); + os2.ySuperscriptYSize = p.parseShort(); + os2.ySuperscriptXOffset = p.parseShort(); + os2.ySuperscriptYOffset = p.parseShort(); + os2.yStrikeoutSize = p.parseShort(); + os2.yStrikeoutPosition = p.parseShort(); + os2.sFamilyClass = p.parseShort(); + os2.panose = []; + for (var i = 0; i < 10; i++) { + os2.panose[i] = p.parseByte(); + } + os2.ulUnicodeRange1 = p.parseULong(); + os2.ulUnicodeRange2 = p.parseULong(); + os2.ulUnicodeRange3 = p.parseULong(); + os2.ulUnicodeRange4 = p.parseULong(); + os2.achVendID = String.fromCharCode( + p.parseByte(), + p.parseByte(), + p.parseByte(), + p.parseByte(), + ); + os2.fsSelection = p.parseUShort(); + os2.usFirstCharIndex = p.parseUShort(); + os2.usLastCharIndex = p.parseUShort(); + os2.sTypoAscender = p.parseShort(); + os2.sTypoDescender = p.parseShort(); + os2.sTypoLineGap = p.parseShort(); + os2.usWinAscent = p.parseUShort(); + os2.usWinDescent = p.parseUShort(); + if (os2.version >= 1) { + os2.ulCodePageRange1 = p.parseULong(); + os2.ulCodePageRange2 = p.parseULong(); + } + if (os2.version >= 2) { + os2.sxHeight = p.parseShort(); + os2.sCapHeight = p.parseShort(); + os2.usDefaultChar = p.parseUShort(); + os2.usBreakChar = p.parseUShort(); + os2.usMaxContent = p.parseUShort(); + } + return os2; + } + function makeOS2Table(options) { + return new table.Table( + "OS/2", + [ + { + name: "version", + type: "USHORT", + value: 3, + }, + { + name: "xAvgCharWidth", + type: "SHORT", + value: 0, + }, + { + name: "usWeightClass", + type: "USHORT", + value: 0, + }, + { + name: "usWidthClass", + type: "USHORT", + value: 0, + }, + { + name: "fsType", + type: "USHORT", + value: 0, + }, + { + name: "ySubscriptXSize", + type: "SHORT", + value: 650, + }, + { + name: "ySubscriptYSize", + type: "SHORT", + value: 699, + }, + { + name: "ySubscriptXOffset", + type: "SHORT", + value: 0, + }, + { + name: "ySubscriptYOffset", + type: "SHORT", + value: 140, + }, + { + name: "ySuperscriptXSize", + type: "SHORT", + value: 650, + }, + { + name: "ySuperscriptYSize", + type: "SHORT", + value: 699, + }, + { + name: "ySuperscriptXOffset", + type: "SHORT", + value: 0, + }, + { + name: "ySuperscriptYOffset", + type: "SHORT", + value: 479, + }, + { + name: "yStrikeoutSize", + type: "SHORT", + value: 49, + }, + { + name: "yStrikeoutPosition", + type: "SHORT", + value: 258, + }, + { + name: "sFamilyClass", + type: "SHORT", + value: 0, + }, + { + name: "bFamilyType", + type: "BYTE", + value: 0, + }, + { + name: "bSerifStyle", + type: "BYTE", + value: 0, + }, + { + name: "bWeight", + type: "BYTE", + value: 0, + }, + { + name: "bProportion", + type: "BYTE", + value: 0, + }, + { + name: "bContrast", + type: "BYTE", + value: 0, + }, + { + name: "bStrokeVariation", + type: "BYTE", + value: 0, + }, + { + name: "bArmStyle", + type: "BYTE", + value: 0, + }, + { + name: "bLetterform", + type: "BYTE", + value: 0, + }, + { + name: "bMidline", + type: "BYTE", + value: 0, + }, + { + name: "bXHeight", + type: "BYTE", + value: 0, + }, + { + name: "ulUnicodeRange1", + type: "ULONG", + value: 0, + }, + { + name: "ulUnicodeRange2", + type: "ULONG", + value: 0, + }, + { + name: "ulUnicodeRange3", + type: "ULONG", + value: 0, + }, + { + name: "ulUnicodeRange4", + type: "ULONG", + value: 0, + }, + { + name: "achVendID", + type: "CHARARRAY", + value: "XXXX", + }, + { + name: "fsSelection", + type: "USHORT", + value: 0, + }, + { + name: "usFirstCharIndex", + type: "USHORT", + value: 0, + }, + { + name: "usLastCharIndex", + type: "USHORT", + value: 0, + }, + { + name: "sTypoAscender", + type: "SHORT", + value: 0, + }, + { + name: "sTypoDescender", + type: "SHORT", + value: 0, + }, + { + name: "sTypoLineGap", + type: "SHORT", + value: 0, + }, + { + name: "usWinAscent", + type: "USHORT", + value: 0, + }, + { + name: "usWinDescent", + type: "USHORT", + value: 0, + }, + { + name: "ulCodePageRange1", + type: "ULONG", + value: 0, + }, + { + name: "ulCodePageRange2", + type: "ULONG", + value: 0, + }, + { + name: "sxHeight", + type: "SHORT", + value: 0, + }, + { + name: "sCapHeight", + type: "SHORT", + value: 0, + }, + { + name: "usDefaultChar", + type: "USHORT", + value: 0, + }, + { + name: "usBreakChar", + type: "USHORT", + value: 0, + }, + { + name: "usMaxContext", + type: "USHORT", + value: 0, + }, + ], + options, + ); + } + var os2 = { + parse: parseOS2Table, + make: makeOS2Table, + unicodeRanges: unicodeRanges, + getUnicodeRange: getUnicodeRange, + }; + // The `post` table stores additional PostScript information, such as glyph names. + // Parse the PostScript `post` table + function parsePostTable(data, start) { + var post = {}; + var p = new parse.Parser(data, start); + post.version = p.parseVersion(); + post.italicAngle = p.parseFixed(); + post.underlinePosition = p.parseShort(); + post.underlineThickness = p.parseShort(); + post.isFixedPitch = p.parseULong(); + post.minMemType42 = p.parseULong(); + post.maxMemType42 = p.parseULong(); + post.minMemType1 = p.parseULong(); + post.maxMemType1 = p.parseULong(); + switch (post.version) { + case 1: + post.names = standardNames.slice(); + break; + case 2: + post.numberOfGlyphs = p.parseUShort(); + post.glyphNameIndex = new Array(post.numberOfGlyphs); + for (var i = 0; i < post.numberOfGlyphs; i++) { + post.glyphNameIndex[i] = p.parseUShort(); + } + post.names = []; + for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { + if (post.glyphNameIndex[i$1] >= standardNames.length) { + var nameLength = p.parseChar(); + post.names.push(p.parseString(nameLength)); + } + } + break; + case 2.5: + post.numberOfGlyphs = p.parseUShort(); + post.offset = new Array(post.numberOfGlyphs); + for (var i$2 = 0; i$2 < post.numberOfGlyphs; i$2++) { + post.offset[i$2] = p.parseChar(); + } + break; + } + return post; + } + function makePostTable() { + return new table.Table("post", [ + { + name: "version", + type: "FIXED", + value: 196608, + }, + { + name: "italicAngle", + type: "FIXED", + value: 0, + }, + { + name: "underlinePosition", + type: "FWORD", + value: 0, + }, + { + name: "underlineThickness", + type: "FWORD", + value: 0, + }, + { + name: "isFixedPitch", + type: "ULONG", + value: 0, + }, + { + name: "minMemType42", + type: "ULONG", + value: 0, + }, + { + name: "maxMemType42", + type: "ULONG", + value: 0, + }, + { + name: "minMemType1", + type: "ULONG", + value: 0, + }, + { + name: "maxMemType1", + type: "ULONG", + value: 0, + }, + ]); + } + var post = { + parse: parsePostTable, + make: makePostTable, + }; + // The `GSUB` table contains ligatures, among other things. + var subtableParsers = new Array(9); // subtableParsers[0] is unused + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#SS + subtableParsers[1] = function parseLookup1() { + var start = this.offset + this.relativeOffset; + var substFormat = this.parseUShort(); + if (substFormat === 1) { + return { + substFormat: 1, + coverage: this.parsePointer(Parser.coverage), + deltaGlyphId: this.parseUShort(), + }; + } else if (substFormat === 2) { + return { + substFormat: 2, + coverage: this.parsePointer(Parser.coverage), + substitute: this.parseOffset16List(), + }; + } + check.assert( + false, + "0x" + + start.toString(16) + + ": lookup type 1 format must be 1 or 2.", + ); + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#MS + subtableParsers[2] = function parseLookup2() { + var substFormat = this.parseUShort(); + check.argument( + substFormat === 1, + "GSUB Multiple Substitution Subtable identifier-format must be 1", + ); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + sequences: this.parseListOfLists(), + }; + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#AS + subtableParsers[3] = function parseLookup3() { + var substFormat = this.parseUShort(); + check.argument( + substFormat === 1, + "GSUB Alternate Substitution Subtable identifier-format must be 1", + ); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + alternateSets: this.parseListOfLists(), + }; + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#LS + subtableParsers[4] = function parseLookup4() { + var substFormat = this.parseUShort(); + check.argument( + substFormat === 1, + "GSUB ligature table identifier-format must be 1", + ); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + ligatureSets: this.parseListOfLists(function () { + return { + ligGlyph: this.parseUShort(), + components: this.parseUShortList(this.parseUShort() - 1), + }; + }), + }; + }; + var lookupRecordDesc = { + sequenceIndex: Parser.uShort, + lookupListIndex: Parser.uShort, + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CSF + subtableParsers[5] = function parseLookup5() { + var start = this.offset + this.relativeOffset; + var substFormat = this.parseUShort(); + if (substFormat === 1) { + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + ruleSets: this.parseListOfLists(function () { + var glyphCount = this.parseUShort(); + var substCount = this.parseUShort(); + return { + input: this.parseUShortList(glyphCount - 1), + lookupRecords: this.parseRecordList( + substCount, + lookupRecordDesc, + ), + }; + }), + }; + } else if (substFormat === 2) { + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + classDef: this.parsePointer(Parser.classDef), + classSets: this.parseListOfLists(function () { + var glyphCount = this.parseUShort(); + var substCount = this.parseUShort(); + return { + classes: this.parseUShortList(glyphCount - 1), + lookupRecords: this.parseRecordList( + substCount, + lookupRecordDesc, + ), + }; + }), + }; + } else if (substFormat === 3) { + var glyphCount = this.parseUShort(); + var substCount = this.parseUShort(); + return { + substFormat: substFormat, + coverages: this.parseList( + glyphCount, + Parser.pointer(Parser.coverage), + ), + lookupRecords: this.parseRecordList( + substCount, + lookupRecordDesc, + ), + }; + } + check.assert( + false, + "0x" + + start.toString(16) + + ": lookup type 5 format must be 1, 2 or 3.", + ); + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CC + subtableParsers[6] = function parseLookup6() { + var start = this.offset + this.relativeOffset; + var substFormat = this.parseUShort(); + if (substFormat === 1) { + return { + substFormat: 1, + coverage: this.parsePointer(Parser.coverage), + chainRuleSets: this.parseListOfLists(function () { + return { + backtrack: this.parseUShortList(), + input: this.parseUShortList(this.parseShort() - 1), + lookahead: this.parseUShortList(), + lookupRecords: this.parseRecordList(lookupRecordDesc), + }; + }), + }; + } else if (substFormat === 2) { + return { + substFormat: 2, + coverage: this.parsePointer(Parser.coverage), + backtrackClassDef: this.parsePointer(Parser.classDef), + inputClassDef: this.parsePointer(Parser.classDef), + lookaheadClassDef: this.parsePointer(Parser.classDef), + chainClassSet: this.parseListOfLists(function () { + return { + backtrack: this.parseUShortList(), + input: this.parseUShortList(this.parseShort() - 1), + lookahead: this.parseUShortList(), + lookupRecords: this.parseRecordList(lookupRecordDesc), + }; + }), + }; + } else if (substFormat === 3) { + return { + substFormat: 3, + backtrackCoverage: this.parseList( + Parser.pointer(Parser.coverage), + ), + inputCoverage: this.parseList( + Parser.pointer(Parser.coverage), + ), + lookaheadCoverage: this.parseList( + Parser.pointer(Parser.coverage), + ), + lookupRecords: this.parseRecordList(lookupRecordDesc), + }; + } + check.assert( + false, + "0x" + + start.toString(16) + + ": lookup type 6 format must be 1, 2 or 3.", + ); + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#ES + subtableParsers[7] = function parseLookup7() { + // Extension Substitution subtable + var substFormat = this.parseUShort(); + check.argument( + substFormat === 1, + "GSUB Extension Substitution subtable identifier-format must be 1", + ); + var extensionLookupType = this.parseUShort(); + var extensionParser = new Parser( + this.data, + this.offset + this.parseULong(), + ); + return { + substFormat: 1, + lookupType: extensionLookupType, + extension: + subtableParsers[extensionLookupType].call(extensionParser), + }; + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#RCCS + subtableParsers[8] = function parseLookup8() { + var substFormat = this.parseUShort(); + check.argument( + substFormat === 1, + "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1", + ); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + backtrackCoverage: this.parseList( + Parser.pointer(Parser.coverage), + ), + lookaheadCoverage: this.parseList( + Parser.pointer(Parser.coverage), + ), + substitutes: this.parseUShortList(), + }; + }; + // https://www.microsoft.com/typography/OTSPEC/gsub.htm + function parseGsubTable(data, start) { + start = start || 0; + var p = new Parser(data, start); + var tableVersion = p.parseVersion(1); + check.argument( + tableVersion === 1 || tableVersion === 1.1, + "Unsupported GSUB table version.", + ); + if (tableVersion === 1) { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers), + }; + } else { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers), + variations: p.parseFeatureVariationsList(), + }; + } + } // GSUB Writing ////////////////////////////////////////////// + + var subtableMakers = new Array(9); + subtableMakers[1] = function makeLookup1(subtable) { + if (subtable.substFormat === 1) { + return new table.Table("substitutionTable", [ + { + name: "substFormat", + type: "USHORT", + value: 1, + }, + { + name: "coverage", + type: "TABLE", + value: new table.Coverage(subtable.coverage), + }, + { + name: "deltaGlyphID", + type: "USHORT", + value: subtable.deltaGlyphId, + }, + ]); + } else { + return new table.Table( + "substitutionTable", + [ + { + name: "substFormat", + type: "USHORT", + value: 2, + }, + { + name: "coverage", + type: "TABLE", + value: new table.Coverage(subtable.coverage), + }, + ].concat( + table.ushortList("substitute", subtable.substitute), + ), + ); + } + check.fail("Lookup type 1 substFormat must be 1 or 2."); + }; + subtableMakers[3] = function makeLookup3(subtable) { + check.assert( + subtable.substFormat === 1, + "Lookup type 3 substFormat must be 1.", + ); + return new table.Table( + "substitutionTable", + [ + { + name: "substFormat", + type: "USHORT", + value: 1, + }, + { + name: "coverage", + type: "TABLE", + value: new table.Coverage(subtable.coverage), + }, + ].concat( + table.tableList( + "altSet", + subtable.alternateSets, + function (alternateSet) { + return new table.Table( + "alternateSetTable", + table.ushortList("alternate", alternateSet), + ); + }, + ), + ), + ); + }; + subtableMakers[4] = function makeLookup4(subtable) { + check.assert( + subtable.substFormat === 1, + "Lookup type 4 substFormat must be 1.", + ); + return new table.Table( + "substitutionTable", + [ + { + name: "substFormat", + type: "USHORT", + value: 1, + }, + { + name: "coverage", + type: "TABLE", + value: new table.Coverage(subtable.coverage), + }, + ].concat( + table.tableList( + "ligSet", + subtable.ligatureSets, + function (ligatureSet) { + return new table.Table( + "ligatureSetTable", + table.tableList( + "ligature", + ligatureSet, + function (ligature) { + return new table.Table( + "ligatureTable", + [ + { + name: "ligGlyph", + type: "USHORT", + value: ligature.ligGlyph, + }, + ].concat( + table.ushortList( + "component", + ligature.components, + ligature.components.length + 1, + ), + ), + ); + }, + ), + ); + }, + ), + ), + ); + }; + function makeGsubTable(gsub) { + return new table.Table("GSUB", [ + { + name: "version", + type: "ULONG", + value: 65536, + }, + { + name: "scripts", + type: "TABLE", + value: new table.ScriptList(gsub.scripts), + }, + { + name: "features", + type: "TABLE", + value: new table.FeatureList(gsub.features), + }, + { + name: "lookups", + type: "TABLE", + value: new table.LookupList(gsub.lookups, subtableMakers), + }, + ]); + } + var gsub = { + parse: parseGsubTable, + make: makeGsubTable, + }; + // The `GPOS` table contains kerning pairs, among other things. + // Parse the metadata `meta` table. + // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html + function parseMetaTable(data, start) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseULong(); + check.argument( + tableVersion === 1, + "Unsupported META table version.", + ); + p.parseULong(); // flags - currently unused and set to 0 + p.parseULong(); // tableOffset + var numDataMaps = p.parseULong(); + var tags = {}; + for (var i = 0; i < numDataMaps; i++) { + var tag = p.parseTag(); + var dataOffset = p.parseULong(); + var dataLength = p.parseULong(); + var text = decode.UTF8(data, start + dataOffset, dataLength); + tags[tag] = text; + } + return tags; + } + function makeMetaTable(tags) { + var numTags = Object.keys(tags).length; + var stringPool = ""; + var stringPoolOffset = 16 + numTags * 12; + var result = new table.Table("meta", [ + { + name: "version", + type: "ULONG", + value: 1, + }, + { + name: "flags", + type: "ULONG", + value: 0, + }, + { + name: "offset", + type: "ULONG", + value: stringPoolOffset, + }, + { + name: "numTags", + type: "ULONG", + value: numTags, + }, + ]); + for (var tag in tags) { + var pos = stringPool.length; + stringPool += tags[tag]; + result.fields.push({ + name: "tag " + tag, + type: "TAG", + value: tag, + }); + result.fields.push({ + name: "offset " + tag, + type: "ULONG", + value: stringPoolOffset + pos, + }); + result.fields.push({ + name: "length " + tag, + type: "ULONG", + value: tags[tag].length, + }); + } + result.fields.push({ + name: "stringPool", + type: "CHARARRAY", + value: stringPool, + }); + return result; + } + var meta = { + parse: parseMetaTable, + make: makeMetaTable, + }; + // The `sfnt` wrapper provides organization for the tables in the font. + function log2(v) { + return (Math.log(v) / Math.log(2)) | 0; + } + function computeCheckSum(bytes) { + while (bytes.length % 4 !== 0) { + bytes.push(0); + } + var sum = 0; + for (var i = 0; i < bytes.length; i += 4) { + sum += + (bytes[i] << 24) + + (bytes[i + 1] << 16) + + (bytes[i + 2] << 8) + + bytes[i + 3]; + } + sum %= Math.pow(2, 32); + return sum; + } + function makeTableRecord(tag, checkSum, offset, length) { + return new table.Record("Table Record", [ + { + name: "tag", + type: "TAG", + value: tag !== undefined ? tag : "", + }, + { + name: "checkSum", + type: "ULONG", + value: checkSum !== undefined ? checkSum : 0, + }, + { + name: "offset", + type: "ULONG", + value: offset !== undefined ? offset : 0, + }, + { + name: "length", + type: "ULONG", + value: length !== undefined ? length : 0, + }, + ]); + } + function makeSfntTable(tables) { + var sfnt = new table.Table("sfnt", [ + { + name: "version", + type: "TAG", + value: "OTTO", + }, + { + name: "numTables", + type: "USHORT", + value: 0, + }, + { + name: "searchRange", + type: "USHORT", + value: 0, + }, + { + name: "entrySelector", + type: "USHORT", + value: 0, + }, + { + name: "rangeShift", + type: "USHORT", + value: 0, + }, + ]); + sfnt.tables = tables; + sfnt.numTables = tables.length; + var highestPowerOf2 = Math.pow(2, log2(sfnt.numTables)); + sfnt.searchRange = 16 * highestPowerOf2; + sfnt.entrySelector = log2(highestPowerOf2); + sfnt.rangeShift = sfnt.numTables * 16 - sfnt.searchRange; + var recordFields = []; + var tableFields = []; + var offset = + sfnt.sizeOf() + makeTableRecord().sizeOf() * sfnt.numTables; + while (offset % 4 !== 0) { + offset += 1; + tableFields.push({ + name: "padding", + type: "BYTE", + value: 0, + }); + } + for (var i = 0; i < tables.length; i += 1) { + var t = tables[i]; + check.argument( + t.tableName.length === 4, + "Table name" + t.tableName + " is invalid.", + ); + var tableLength = t.sizeOf(); + var tableRecord = makeTableRecord( + t.tableName, + computeCheckSum(t.encode()), + offset, + tableLength, + ); + recordFields.push({ + name: tableRecord.tag + " Table Record", + type: "RECORD", + value: tableRecord, + }); + tableFields.push({ + name: t.tableName + " table", + type: "RECORD", + value: t, + }); + offset += tableLength; + check.argument( + !isNaN(offset), + "Something went wrong calculating the offset.", + ); + while (offset % 4 !== 0) { + offset += 1; + tableFields.push({ + name: "padding", + type: "BYTE", + value: 0, + }); + } + } // Table records need to be sorted alphabetically. + + recordFields.sort(function (r1, r2) { + if (r1.value.tag > r2.value.tag) { + return 1; + } else { + return -1; + } + }); + sfnt.fields = sfnt.fields.concat(recordFields); + sfnt.fields = sfnt.fields.concat(tableFields); + return sfnt; + } // Get the metrics for a character. If the string has more than one character + // this function returns metrics for the first available character. + // You can provide optional fallback metrics if no characters are available. + + function metricsForChar(font, chars, notFoundMetrics) { + for (var i = 0; i < chars.length; i += 1) { + var glyphIndex = font.charToGlyphIndex(chars[i]); + if (glyphIndex > 0) { + var glyph = font.glyphs.get(glyphIndex); + return glyph.getMetrics(); + } + } + return notFoundMetrics; + } + function average(vs) { + var sum = 0; + for (var i = 0; i < vs.length; i += 1) { + sum += vs[i]; + } + return sum / vs.length; + } // Convert the font object to a SFNT data structure. + // This structure contains all the necessary tables and metadata to create a binary OTF file. + + function fontToSfntTable(font) { + var xMins = []; + var yMins = []; + var xMaxs = []; + var yMaxs = []; + var advanceWidths = []; + var leftSideBearings = []; + var rightSideBearings = []; + var firstCharIndex; + var lastCharIndex = 0; + var ulUnicodeRange1 = 0; + var ulUnicodeRange2 = 0; + var ulUnicodeRange3 = 0; + var ulUnicodeRange4 = 0; + for (var i = 0; i < font.glyphs.length; i += 1) { + var glyph = font.glyphs.get(i); + var unicode = glyph.unicode | 0; + if (isNaN(glyph.advanceWidth)) { + throw new Error( + "Glyph " + + glyph.name + + " (" + + i + + "): advanceWidth is not a number.", + ); + } + if ( + firstCharIndex > unicode || + firstCharIndex === undefined + ) { + // ignore .notdef char + if (unicode > 0) { + firstCharIndex = unicode; + } + } + if (lastCharIndex < unicode) { + lastCharIndex = unicode; + } + var position = os2.getUnicodeRange(unicode); + if (position < 32) { + ulUnicodeRange1 |= 1 << position; + } else if (position < 64) { + ulUnicodeRange2 |= 1 << (position - 32); + } else if (position < 96) { + ulUnicodeRange3 |= 1 << (position - 64); + } else if (position < 123) { + ulUnicodeRange4 |= 1 << (position - 96); + } else { + throw new Error( + "Unicode ranges bits > 123 are reserved for internal usage", + ); + } // Skip non-important characters. + + if (glyph.name === ".notdef") { + continue; + } + var metrics = glyph.getMetrics(); + xMins.push(metrics.xMin); + yMins.push(metrics.yMin); + xMaxs.push(metrics.xMax); + yMaxs.push(metrics.yMax); + leftSideBearings.push(metrics.leftSideBearing); + rightSideBearings.push(metrics.rightSideBearing); + advanceWidths.push(glyph.advanceWidth); + } + var globals = { + xMin: Math.min.apply(null, xMins), + yMin: Math.min.apply(null, yMins), + xMax: Math.max.apply(null, xMaxs), + yMax: Math.max.apply(null, yMaxs), + advanceWidthMax: Math.max.apply(null, advanceWidths), + advanceWidthAvg: average(advanceWidths), + minLeftSideBearing: Math.min.apply(null, leftSideBearings), + maxLeftSideBearing: Math.max.apply(null, leftSideBearings), + minRightSideBearing: Math.min.apply(null, rightSideBearings), + }; + globals.ascender = font.ascender; + globals.descender = font.descender; + var headTable = head.make({ + flags: 3, + // 00000011 (baseline for font at y=0; left sidebearing point at x=0) + unitsPerEm: font.unitsPerEm, + xMin: globals.xMin, + yMin: globals.yMin, + xMax: globals.xMax, + yMax: globals.yMax, + lowestRecPPEM: 3, + createdTimestamp: font.createdTimestamp, + }); + var hheaTable = hhea.make({ + ascender: globals.ascender, + descender: globals.descender, + advanceWidthMax: globals.advanceWidthMax, + minLeftSideBearing: globals.minLeftSideBearing, + minRightSideBearing: globals.minRightSideBearing, + xMaxExtent: + globals.maxLeftSideBearing + (globals.xMax - globals.xMin), + numberOfHMetrics: font.glyphs.length, + }); + var maxpTable = maxp.make(font.glyphs.length); + var os2Table = os2.make({ + xAvgCharWidth: Math.round(globals.advanceWidthAvg), + usWeightClass: font.tables.os2.usWeightClass, + usWidthClass: font.tables.os2.usWidthClass, + usFirstCharIndex: firstCharIndex, + usLastCharIndex: lastCharIndex, + ulUnicodeRange1: ulUnicodeRange1, + ulUnicodeRange2: ulUnicodeRange2, + ulUnicodeRange3: ulUnicodeRange3, + ulUnicodeRange4: ulUnicodeRange4, + fsSelection: font.tables.os2.fsSelection, + // REGULAR + // See http://typophile.com/node/13081 for more info on vertical metrics. + // We get metrics for typical characters (such as "x" for xHeight). + // We provide some fallback characters if characters are unavailable: their + // ordering was chosen experimentally. + sTypoAscender: globals.ascender, + sTypoDescender: globals.descender, + sTypoLineGap: 0, + usWinAscent: globals.yMax, + usWinDescent: Math.abs(globals.yMin), + ulCodePageRange1: 1, + // FIXME: hard-code Latin 1 support for now + sxHeight: metricsForChar(font, "xyvw", { + yMax: Math.round(globals.ascender / 2), + }).yMax, + sCapHeight: metricsForChar( + font, + "HIKLEFJMNTZBDPRAGOQSUVWXY", + globals, + ).yMax, + usDefaultChar: font.hasChar(" ") ? 32 : 0, + // Use space as the default character, if available. + usBreakChar: font.hasChar(" ") ? 32 : 0, // Use space as the break character, if available. + }); + var hmtxTable = hmtx.make(font.glyphs); + var cmapTable = cmap.make(font.glyphs); + var englishFamilyName = font.getEnglishName("fontFamily"); + var englishStyleName = font.getEnglishName("fontSubfamily"); + var englishFullName = + englishFamilyName + " " + englishStyleName; + var postScriptName = font.getEnglishName("postScriptName"); + if (!postScriptName) { + postScriptName = + englishFamilyName.replace(/\s/g, "") + + "-" + + englishStyleName; + } + var names = {}; + for (var n in font.names) { + names[n] = font.names[n]; + } + if (!names.uniqueID) { + names.uniqueID = { + en: + font.getEnglishName("manufacturer") + + ":" + + englishFullName, + }; + } + if (!names.postScriptName) { + names.postScriptName = { + en: postScriptName, + }; + } + if (!names.preferredFamily) { + names.preferredFamily = font.names.fontFamily; + } + if (!names.preferredSubfamily) { + names.preferredSubfamily = font.names.fontSubfamily; + } + var languageTags = []; + var nameTable = _name.make(names, languageTags); + var ltagTable = + languageTags.length > 0 ? ltag.make(languageTags) : undefined; + var postTable = post.make(); + var cffTable = cff.make(font.glyphs, { + version: font.getEnglishName("version"), + fullName: englishFullName, + familyName: englishFamilyName, + weightName: englishStyleName, + postScriptName: postScriptName, + unitsPerEm: font.unitsPerEm, + fontBBox: [ + 0, + globals.yMin, + globals.ascender, + globals.advanceWidthMax, + ], + }); + var metaTable = + font.metas && Object.keys(font.metas).length > 0 + ? meta.make(font.metas) + : undefined; + // The order does not matter because makeSfntTable() will sort them. + var tables = [ + headTable, + hheaTable, + maxpTable, + os2Table, + nameTable, + cmapTable, + postTable, + cffTable, + hmtxTable, + ]; + if (ltagTable) { + tables.push(ltagTable); + } // Optional tables + + if (font.tables.gsub) { + tables.push(gsub.make(font.tables.gsub)); + } + if (metaTable) { + tables.push(metaTable); + } + var sfntTable = makeSfntTable(tables); + // Compute the font's checkSum and store it in head.checkSumAdjustment. + var bytes = sfntTable.encode(); + var checkSum = computeCheckSum(bytes); + var tableFields = sfntTable.fields; + var checkSumAdjusted = false; + for (var i$1 = 0; i$1 < tableFields.length; i$1 += 1) { + if (tableFields[i$1].name === "head table") { + tableFields[i$1].value.checkSumAdjustment = + 2981146554 - checkSum; + checkSumAdjusted = true; + break; + } + } + if (!checkSumAdjusted) { + throw new Error( + "Could not find head table with checkSum to adjust.", + ); + } + return sfntTable; + } + var sfnt = { + make: makeSfntTable, + fontToTable: fontToSfntTable, + computeCheckSum: computeCheckSum, + }; + // The Layout object is the prototype of Substitution objects, and provides + function searchTag(arr, tag) { + /* jshint bitwise: false */ + var imin = 0; + var imax = arr.length - 1; + while (imin <= imax) { + var imid = (imin + imax) >>> 1; + var val = arr[imid].tag; + if (val === tag) { + return imid; + } else if (val < tag) { + imin = imid + 1; + } else { + imax = imid - 1; + } + } // Not found: return -1-insertion point + + return -imin - 1; + } + function binSearch(arr, value) { + /* jshint bitwise: false */ + var imin = 0; + var imax = arr.length - 1; + while (imin <= imax) { + var imid = (imin + imax) >>> 1; + var val = arr[imid]; + if (val === value) { + return imid; + } else if (val < value) { + imin = imid + 1; + } else { + imax = imid - 1; + } + } // Not found: return -1-insertion point + + return -imin - 1; + } // binary search in a list of ranges (coverage, class definition) + + function searchRange(ranges, value) { + // jshint bitwise: false + var range; + var imin = 0; + var imax = ranges.length - 1; + while (imin <= imax) { + var imid = (imin + imax) >>> 1; + range = ranges[imid]; + var start = range.start; + if (start === value) { + return range; + } else if (start < value) { + imin = imid + 1; + } else { + imax = imid - 1; + } + } + if (imin > 0) { + range = ranges[imin - 1]; + if (value > range.end) { + return 0; + } + return range; + } + } /** + * @exports opentype.Layout + * @class + */ + + function Layout(font, tableName) { + this.font = font; + this.tableName = tableName; + } + Layout.prototype = { + /** + * Binary search an object by "tag" property + * @instance + * @function searchTag + * @memberof opentype.Layout + * @param {Array} arr + * @param {string} tag + * @return {number} + */ + searchTag: searchTag, + /** + * Binary search in a list of numbers + * @instance + * @function binSearch + * @memberof opentype.Layout + * @param {Array} arr + * @param {number} value + * @return {number} + */ + binSearch: binSearch, + /** + * Get or create the Layout table (GSUB, GPOS etc). + * @param {boolean} create - Whether to create a new one. + * @return {Object} The GSUB or GPOS table. + */ + getTable: function (create) { + var layout = this.font.tables[this.tableName]; + if (!layout && create) { + layout = this.font.tables[this.tableName] = + this.createDefaultTable(); + } + return layout; + }, + /** + * Returns all scripts in the substitution table. + * @instance + * @return {Array} + */ + getScriptNames: function () { + var layout = this.getTable(); + if (!layout) { + return []; + } + return layout.scripts.map(function (script) { + return script.tag; + }); + }, + /** + * Returns the best bet for a script name. + * Returns 'DFLT' if it exists. + * If not, returns 'latn' if it exists. + * If neither exist, returns undefined. + */ + getDefaultScriptName: function () { + var layout = this.getTable(); + if (!layout) { + return; + } + var hasLatn = false; + for (var i = 0; i < layout.scripts.length; i++) { + var name = layout.scripts[i].tag; + if (name === "DFLT") { + return name; + } + if (name === "latn") { + hasLatn = true; + } + } + if (hasLatn) { + return "latn"; + } + }, + /** + * Returns all LangSysRecords in the given script. + * @instance + * @param {string} [script='DFLT'] + * @param {boolean} create - forces the creation of this script table if it doesn't exist. + * @return {Object} An object with tag and script properties. + */ + getScriptTable: function (script, create) { + var layout = this.getTable(create); + if (layout) { + script = script || "DFLT"; + var scripts = layout.scripts; + var pos = searchTag(layout.scripts, script); + if (pos >= 0) { + return scripts[pos].script; + } else if (create) { + var scr = { + tag: script, + script: { + defaultLangSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [], + }, + langSysRecords: [], + }, + }; + scripts.splice(-1 - pos, 0, scr); + return scr.script; + } + } + }, + /** + * Returns a language system table + * @instance + * @param {string} [script='DFLT'] + * @param {string} [language='dlft'] + * @param {boolean} create - forces the creation of this langSysTable if it doesn't exist. + * @return {Object} + */ + getLangSysTable: function (script, language, create) { + var scriptTable = this.getScriptTable(script, create); + if (scriptTable) { + if ( + !language || + language === "dflt" || + language === "DFLT" + ) { + return scriptTable.defaultLangSys; + } + var pos = searchTag(scriptTable.langSysRecords, language); + if (pos >= 0) { + return scriptTable.langSysRecords[pos].langSys; + } else if (create) { + var langSysRecord = { + tag: language, + langSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [], + }, + }; + scriptTable.langSysRecords.splice( + -1 - pos, + 0, + langSysRecord, + ); + return langSysRecord.langSys; + } + } + }, + /** + * Get a specific feature table. + * @instance + * @param {string} [script='DFLT'] + * @param {string} [language='dlft'] + * @param {string} feature - One of the codes listed at https://www.microsoft.com/typography/OTSPEC/featurelist.htm + * @param {boolean} create - forces the creation of the feature table if it doesn't exist. + * @return {Object} + */ + getFeatureTable: function (script, language, feature, create) { + var langSysTable = this.getLangSysTable( + script, + language, + create, + ); + if (langSysTable) { + var featureRecord; + var featIndexes = langSysTable.featureIndexes; + var allFeatures = this.font.tables[this.tableName].features; + // The FeatureIndex array of indices is in arbitrary order, + // even if allFeatures is sorted alphabetically by feature tag. + for (var i = 0; i < featIndexes.length; i++) { + featureRecord = allFeatures[featIndexes[i]]; + if (featureRecord.tag === feature) { + return featureRecord.feature; + } + } + if (create) { + var index = allFeatures.length; + // Automatic ordering of features would require to shift feature indexes in the script list. + check.assert( + index === 0 || feature >= allFeatures[index - 1].tag, + "Features must be added in alphabetical order.", + ); + featureRecord = { + tag: feature, + feature: { + params: 0, + lookupListIndexes: [], + }, + }; + allFeatures.push(featureRecord); + featIndexes.push(index); + return featureRecord.feature; + } + } + }, + /** + * Get the lookup tables of a given type for a script/language/feature. + * @instance + * @param {string} [script='DFLT'] + * @param {string} [language='dlft'] + * @param {string} feature - 4-letter feature code + * @param {number} lookupType - 1 to 9 + * @param {boolean} create - forces the creation of the lookup table if it doesn't exist, with no subtables. + * @return {Object[]} + */ + getLookupTables: function ( + script, + language, + feature, + lookupType, + create, + ) { + var featureTable = this.getFeatureTable( + script, + language, + feature, + create, + ); + var tables = []; + if (featureTable) { + var lookupTable; + var lookupListIndexes = featureTable.lookupListIndexes; + var allLookups = this.font.tables[this.tableName].lookups; + // lookupListIndexes are in no particular order, so use naive search. + for (var i = 0; i < lookupListIndexes.length; i++) { + lookupTable = allLookups[lookupListIndexes[i]]; + if (lookupTable.lookupType === lookupType) { + tables.push(lookupTable); + } + } + if (tables.length === 0 && create) { + lookupTable = { + lookupType: lookupType, + lookupFlag: 0, + subtables: [], + markFilteringSet: undefined, + }; + var index = allLookups.length; + allLookups.push(lookupTable); + lookupListIndexes.push(index); + return [lookupTable]; + } + } + return tables; + }, + /** + * Find a glyph in a class definition table + * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#class-definition-table + * @param {object} classDefTable - an OpenType Layout class definition table + * @param {number} glyphIndex - the index of the glyph to find + * @returns {number} -1 if not found + */ + getGlyphClass: function (classDefTable, glyphIndex) { + switch (classDefTable.format) { + case 1: + if ( + classDefTable.startGlyph <= glyphIndex && + glyphIndex < + classDefTable.startGlyph + + classDefTable.classes.length + ) { + return classDefTable.classes[ + glyphIndex - classDefTable.startGlyph + ]; + } + return 0; + case 2: + var range = searchRange(classDefTable.ranges, glyphIndex); + return range ? range.classId : 0; + } + }, + /** + * Find a glyph in a coverage table + * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#coverage-table + * @param {object} coverageTable - an OpenType Layout coverage table + * @param {number} glyphIndex - the index of the glyph to find + * @returns {number} -1 if not found + */ + getCoverageIndex: function (coverageTable, glyphIndex) { + switch (coverageTable.format) { + case 1: + var index = binSearch(coverageTable.glyphs, glyphIndex); + return index >= 0 ? index : -1; + case 2: + var range = searchRange(coverageTable.ranges, glyphIndex); + return range + ? range.index + glyphIndex - range.start + : -1; + } + }, + /** + * Returns the list of glyph indexes of a coverage table. + * Format 1: the list is stored raw + * Format 2: compact list as range records. + * @instance + * @param {Object} coverageTable + * @return {Array} + */ + expandCoverage: function (coverageTable) { + if (coverageTable.format === 1) { + return coverageTable.glyphs; + } else { + var glyphs = []; + var ranges = coverageTable.ranges; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var start = range.start; + var end = range.end; + for (var j = start; j <= end; j++) { + glyphs.push(j); + } + } + return glyphs; + } + }, + }; + // The Position object provides utility methods to manipulate + /** + * @exports opentype.Position + * @class + * @extends opentype.Layout + * @param {opentype.Font} + * @constructor + */ + function Position(font) { + Layout.call(this, font, "gpos"); + } + Position.prototype = Layout.prototype; + /** + * Init some data for faster and easier access later. + */ + Position.prototype.init = function () { + var script = this.getDefaultScriptName(); + this.defaultKerningTables = this.getKerningTables(script); + }; + /** + * Find a glyph pair in a list of lookup tables of type 2 and retrieve the xAdvance kerning value. + * + * @param {integer} leftIndex - left glyph index + * @param {integer} rightIndex - right glyph index + * @returns {integer} + */ + Position.prototype.getKerningValue = function ( + kerningLookups, + leftIndex, + rightIndex, + ) { + var this$1 = this; + for (var i = 0; i < kerningLookups.length; i++) { + var subtables = kerningLookups[i].subtables; + for (var j = 0; j < subtables.length; j++) { + var subtable = subtables[j]; + var covIndex = this$1.getCoverageIndex( + subtable.coverage, + leftIndex, + ); + if (covIndex < 0) { + continue; + } + switch (subtable.posFormat) { + case 1: + // Search Pair Adjustment Positioning Format 1 + var pairSet = subtable.pairSets[covIndex]; + for (var k = 0; k < pairSet.length; k++) { + var pair = pairSet[k]; + if (pair.secondGlyph === rightIndex) { + return (pair.value1 && pair.value1.xAdvance) || 0; + } + } + break; + // left glyph found, not right glyph - try next subtable + case 2: + // Search Pair Adjustment Positioning Format 2 + var class1 = this$1.getGlyphClass( + subtable.classDef1, + leftIndex, + ); + var class2 = this$1.getGlyphClass( + subtable.classDef2, + rightIndex, + ); + var pair$1 = subtable.classRecords[class1][class2]; + return (pair$1.value1 && pair$1.value1.xAdvance) || 0; + } + } + } + return 0; + }; + /** + * List all kerning lookup tables. + * + * @param {string} [script='DFLT'] - use font.position.getDefaultScriptName() for a better default value + * @param {string} [language='dflt'] + * @return {object[]} The list of kerning lookup tables (may be empty), or undefined if there is no GPOS table (and we should use the kern table) + */ + Position.prototype.getKerningTables = function ( + script, + language, + ) { + if (this.font.tables.gpos) { + return this.getLookupTables(script, language, "kern", 2); + } + }; + // The Substitution object provides utility methods to manipulate + /** + * @exports opentype.Substitution + * @class + * @extends opentype.Layout + * @param {opentype.Font} + * @constructor + */ + function Substitution(font) { + Layout.call(this, font, "gsub"); + } // Check if 2 arrays of primitives are equal. + + function arraysEqual(ar1, ar2) { + var n = ar1.length; + if (n !== ar2.length) { + return false; + } + for (var i = 0; i < n; i++) { + if (ar1[i] !== ar2[i]) { + return false; + } + } + return true; + } // Find the first subtable of a lookup table in a particular format. + + function getSubstFormat(lookupTable, format, defaultSubtable) { + var subtables = lookupTable.subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + if (subtable.substFormat === format) { + return subtable; + } + } + if (defaultSubtable) { + subtables.push(defaultSubtable); + return defaultSubtable; + } + return undefined; + } + Substitution.prototype = Layout.prototype; + /** + * Create a default GSUB table. + * @return {Object} gsub - The GSUB table. + */ + Substitution.prototype.createDefaultTable = function () { + // Generate a default empty GSUB table with just a DFLT script and dflt lang sys. + return { + version: 1, + scripts: [ + { + tag: "DFLT", + script: { + defaultLangSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [], + }, + langSysRecords: [], + }, + }, + ], + features: [], + lookups: [], + }; + }; + /** + * List all single substitutions (lookup type 1) for a given script, language, and feature. + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @param {string} feature - 4-character feature name ('aalt', 'salt', 'ss01'...) + * @return {Array} substitutions - The list of substitutions. + */ + Substitution.prototype.getSingle = function ( + feature, + script, + language, + ) { + var this$1 = this; + var substitutions = []; + var lookupTables = this.getLookupTables( + script, + language, + feature, + 1, + ); + for (var idx = 0; idx < lookupTables.length; idx++) { + var subtables = lookupTables[idx].subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + var glyphs = this$1.expandCoverage(subtable.coverage); + var j = void 0; + if (subtable.substFormat === 1) { + var delta = subtable.deltaGlyphId; + for (j = 0; j < glyphs.length; j++) { + var glyph = glyphs[j]; + substitutions.push({ + sub: glyph, + by: glyph + delta, + }); + } + } else { + var substitute = subtable.substitute; + for (j = 0; j < glyphs.length; j++) { + substitutions.push({ + sub: glyphs[j], + by: substitute[j], + }); + } + } + } + } + return substitutions; + }; + /** + * List all alternates (lookup type 3) for a given script, language, and feature. + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @param {string} feature - 4-character feature name ('aalt', 'salt'...) + * @return {Array} alternates - The list of alternates + */ + Substitution.prototype.getAlternates = function ( + feature, + script, + language, + ) { + var this$1 = this; + var alternates = []; + var lookupTables = this.getLookupTables( + script, + language, + feature, + 3, + ); + for (var idx = 0; idx < lookupTables.length; idx++) { + var subtables = lookupTables[idx].subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + var glyphs = this$1.expandCoverage(subtable.coverage); + var alternateSets = subtable.alternateSets; + for (var j = 0; j < glyphs.length; j++) { + alternates.push({ + sub: glyphs[j], + by: alternateSets[j], + }); + } + } + } + return alternates; + }; + /** + * List all ligatures (lookup type 4) for a given script, language, and feature. + * The result is an array of ligature objects like { sub: [ids], by: id } + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @return {Array} ligatures - The list of ligatures. + */ + Substitution.prototype.getLigatures = function ( + feature, + script, + language, + ) { + var this$1 = this; + var ligatures = []; + var lookupTables = this.getLookupTables( + script, + language, + feature, + 4, + ); + for (var idx = 0; idx < lookupTables.length; idx++) { + var subtables = lookupTables[idx].subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + var glyphs = this$1.expandCoverage(subtable.coverage); + var ligatureSets = subtable.ligatureSets; + for (var j = 0; j < glyphs.length; j++) { + var startGlyph = glyphs[j]; + var ligSet = ligatureSets[j]; + for (var k = 0; k < ligSet.length; k++) { + var lig = ligSet[k]; + ligatures.push({ + sub: [startGlyph].concat(lig.components), + by: lig.ligGlyph, + }); + } + } + } + } + return ligatures; + }; + /** + * Add or modify a single substitution (lookup type 1) + * Format 2, more flexible, is always used. + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {Object} substitution - { sub: id, delta: number } for format 1 or { sub: id, by: id } for format 2. + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.addSingle = function ( + feature, + substitution, + script, + language, + ) { + var lookupTable = this.getLookupTables( + script, + language, + feature, + 1, + true, + )[0]; + var subtable = getSubstFormat(lookupTable, 2, { + // lookup type 1 subtable, format 2, coverage format 1 + substFormat: 2, + coverage: { + format: 1, + glyphs: [], + }, + substitute: [], + }); + check.assert( + subtable.coverage.format === 1, + "Ligature: unable to modify coverage table format " + + subtable.coverage.format, + ); + var coverageGlyph = substitution.sub; + var pos = this.binSearch( + subtable.coverage.glyphs, + coverageGlyph, + ); + if (pos < 0) { + pos = -1 - pos; + subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); + subtable.substitute.splice(pos, 0, 0); + } + subtable.substitute[pos] = substitution.by; + }; + /** + * Add or modify an alternate substitution (lookup type 1) + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {Object} substitution - { sub: id, by: [ids] } + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.addAlternate = function ( + feature, + substitution, + script, + language, + ) { + var lookupTable = this.getLookupTables( + script, + language, + feature, + 3, + true, + )[0]; + var subtable = getSubstFormat(lookupTable, 1, { + // lookup type 3 subtable, format 1, coverage format 1 + substFormat: 1, + coverage: { + format: 1, + glyphs: [], + }, + alternateSets: [], + }); + check.assert( + subtable.coverage.format === 1, + "Ligature: unable to modify coverage table format " + + subtable.coverage.format, + ); + var coverageGlyph = substitution.sub; + var pos = this.binSearch( + subtable.coverage.glyphs, + coverageGlyph, + ); + if (pos < 0) { + pos = -1 - pos; + subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); + subtable.alternateSets.splice(pos, 0, 0); + } + subtable.alternateSets[pos] = substitution.by; + }; + /** + * Add a ligature (lookup type 4) + * Ligatures with more components must be stored ahead of those with fewer components in order to be found + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {Object} ligature - { sub: [ids], by: id } + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.addLigature = function ( + feature, + ligature, + script, + language, + ) { + var lookupTable = this.getLookupTables( + script, + language, + feature, + 4, + true, + )[0]; + var subtable = lookupTable.subtables[0]; + if (!subtable) { + subtable = { + // lookup type 4 subtable, format 1, coverage format 1 + substFormat: 1, + coverage: { + format: 1, + glyphs: [], + }, + ligatureSets: [], + }; + lookupTable.subtables[0] = subtable; + } + check.assert( + subtable.coverage.format === 1, + "Ligature: unable to modify coverage table format " + + subtable.coverage.format, + ); + var coverageGlyph = ligature.sub[0]; + var ligComponents = ligature.sub.slice(1); + var ligatureTable = { + ligGlyph: ligature.by, + components: ligComponents, + }; + var pos = this.binSearch( + subtable.coverage.glyphs, + coverageGlyph, + ); + if (pos >= 0) { + // ligatureSet already exists + var ligatureSet = subtable.ligatureSets[pos]; + for (var i = 0; i < ligatureSet.length; i++) { + // If ligature already exists, return. + if (arraysEqual(ligatureSet[i].components, ligComponents)) { + return; + } + } // ligature does not exist: add it. + + ligatureSet.push(ligatureTable); + } else { + // Create a new ligatureSet and add coverage for the first glyph. + pos = -1 - pos; + subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); + subtable.ligatureSets.splice(pos, 0, [ligatureTable]); + } + }; + /** + * List all feature data for a given script and language. + * @param {string} feature - 4-letter feature name + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @return {Array} substitutions - The list of substitutions. + */ + Substitution.prototype.getFeature = function ( + feature, + script, + language, + ) { + if (/ss\d\d/.test(feature)) { + // ss01 - ss20 + return this.getSingle(feature, script, language); + } + switch (feature) { + case "aalt": + case "salt": + return this.getSingle(feature, script, language).concat( + this.getAlternates(feature, script, language), + ); + case "dlig": + case "liga": + case "rlig": + return this.getLigatures(feature, script, language); + } + return undefined; + }; + /** + * Add a substitution to a feature for a given script and language. + * @param {string} feature - 4-letter feature name + * @param {Object} sub - the substitution to add (an object like { sub: id or [ids], by: id or [ids] }) + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.add = function ( + feature, + sub, + script, + language, + ) { + if (/ss\d\d/.test(feature)) { + // ss01 - ss20 + return this.addSingle(feature, sub, script, language); + } + switch (feature) { + case "aalt": + case "salt": + if (typeof sub.by === "number") { + return this.addSingle(feature, sub, script, language); + } + return this.addAlternate(feature, sub, script, language); + case "dlig": + case "liga": + case "rlig": + return this.addLigature(feature, sub, script, language); + } + return undefined; + }; + function isBrowser() { + return typeof window !== "undefined"; + } + function nodeBufferToArrayBuffer(buffer) { + var ab = new ArrayBuffer(buffer.length); + var view = new Uint8Array(ab); + for (var i = 0; i < buffer.length; ++i) { + view[i] = buffer[i]; + } + return ab; + } + function arrayBufferToNodeBuffer(ab) { + var buffer = new Buffer(ab.byteLength); + var view = new Uint8Array(ab); + for (var i = 0; i < buffer.length; ++i) { + buffer[i] = view[i]; + } + return buffer; + } + function checkArgument(expression, message) { + if (!expression) { + throw message; + } + } // The `glyf` table describes the glyphs in TrueType outline format. + // Parse the coordinate data for a glyph. + + function parseGlyphCoordinate( + p, + flag, + previousValue, + shortVectorBitMask, + sameBitMask, + ) { + var v; + if ((flag & shortVectorBitMask) > 0) { + // The coordinate is 1 byte long. + v = p.parseByte(); + // The `same` bit is re-used for short values to signify the sign of the value. + if ((flag & sameBitMask) === 0) { + v = -v; + } + v = previousValue + v; + } else { + // The coordinate is 2 bytes long. + // If the `same` bit is set, the coordinate is the same as the previous coordinate. + if ((flag & sameBitMask) > 0) { + v = previousValue; + } else { + // Parse the coordinate as a signed 16-bit delta value. + v = previousValue + p.parseShort(); + } + } + return v; + } // Parse a TrueType glyph. + + function parseGlyph(glyph, data, start) { + var p = new parse.Parser(data, start); + glyph.numberOfContours = p.parseShort(); + glyph._xMin = p.parseShort(); + glyph._yMin = p.parseShort(); + glyph._xMax = p.parseShort(); + glyph._yMax = p.parseShort(); + var flags; + var flag; + if (glyph.numberOfContours > 0) { + // This glyph is not a composite. + var endPointIndices = (glyph.endPointIndices = []); + for (var i = 0; i < glyph.numberOfContours; i += 1) { + endPointIndices.push(p.parseUShort()); + } + glyph.instructionLength = p.parseUShort(); + glyph.instructions = []; + for (var i$1 = 0; i$1 < glyph.instructionLength; i$1 += 1) { + glyph.instructions.push(p.parseByte()); + } + var numberOfCoordinates = + endPointIndices[endPointIndices.length - 1] + 1; + flags = []; + for (var i$2 = 0; i$2 < numberOfCoordinates; i$2 += 1) { + flag = p.parseByte(); + flags.push(flag); + // If bit 3 is set, we repeat this flag n times, where n is the next byte. + if ((flag & 8) > 0) { + var repeatCount = p.parseByte(); + for (var j = 0; j < repeatCount; j += 1) { + flags.push(flag); + i$2 += 1; + } + } + } + check.argument( + flags.length === numberOfCoordinates, + "Bad flags.", + ); + if (endPointIndices.length > 0) { + var points = []; + var point; + // X/Y coordinates are relative to the previous point, except for the first point which is relative to 0,0. + if (numberOfCoordinates > 0) { + for (var i$3 = 0; i$3 < numberOfCoordinates; i$3 += 1) { + flag = flags[i$3]; + point = {}; + point.onCurve = !!(flag & 1); + point.lastPointOfContour = + endPointIndices.indexOf(i$3) >= 0; + points.push(point); + } + var px = 0; + for (var i$4 = 0; i$4 < numberOfCoordinates; i$4 += 1) { + flag = flags[i$4]; + point = points[i$4]; + point.x = parseGlyphCoordinate(p, flag, px, 2, 16); + px = point.x; + } + var py = 0; + for (var i$5 = 0; i$5 < numberOfCoordinates; i$5 += 1) { + flag = flags[i$5]; + point = points[i$5]; + point.y = parseGlyphCoordinate(p, flag, py, 4, 32); + py = point.y; + } + } + glyph.points = points; + } else { + glyph.points = []; + } + } else if (glyph.numberOfContours === 0) { + glyph.points = []; + } else { + glyph.isComposite = true; + glyph.points = []; + glyph.components = []; + var moreComponents = true; + while (moreComponents) { + flags = p.parseUShort(); + var component = { + glyphIndex: p.parseUShort(), + xScale: 1, + scale01: 0, + scale10: 0, + yScale: 1, + dx: 0, + dy: 0, + }; + if ((flags & 1) > 0) { + // The arguments are words + if ((flags & 2) > 0) { + // values are offset + component.dx = p.parseShort(); + component.dy = p.parseShort(); + } else { + // values are matched points + component.matchedPoints = [ + p.parseUShort(), + p.parseUShort(), + ]; + } + } else { + // The arguments are bytes + if ((flags & 2) > 0) { + // values are offset + component.dx = p.parseChar(); + component.dy = p.parseChar(); + } else { + // values are matched points + component.matchedPoints = [ + p.parseByte(), + p.parseByte(), + ]; + } + } + if ((flags & 8) > 0) { + // We have a scale + component.xScale = component.yScale = p.parseF2Dot14(); + } else if ((flags & 64) > 0) { + // We have an X / Y scale + component.xScale = p.parseF2Dot14(); + component.yScale = p.parseF2Dot14(); + } else if ((flags & 128) > 0) { + // We have a 2x2 transformation + component.xScale = p.parseF2Dot14(); + component.scale01 = p.parseF2Dot14(); + component.scale10 = p.parseF2Dot14(); + component.yScale = p.parseF2Dot14(); + } + glyph.components.push(component); + moreComponents = !!(flags & 32); + } + if (flags & 256) { + // We have instructions + glyph.instructionLength = p.parseUShort(); + glyph.instructions = []; + for (var i$6 = 0; i$6 < glyph.instructionLength; i$6 += 1) { + glyph.instructions.push(p.parseByte()); + } + } + } + } // Transform an array of points and return a new array. + + function transformPoints(points, transform) { + var newPoints = []; + for (var i = 0; i < points.length; i += 1) { + var pt = points[i]; + var newPt = { + x: + transform.xScale * pt.x + + transform.scale01 * pt.y + + transform.dx, + y: + transform.scale10 * pt.x + + transform.yScale * pt.y + + transform.dy, + onCurve: pt.onCurve, + lastPointOfContour: pt.lastPointOfContour, + }; + newPoints.push(newPt); + } + return newPoints; + } + function getContours(points) { + var contours = []; + var currentContour = []; + for (var i = 0; i < points.length; i += 1) { + var pt = points[i]; + currentContour.push(pt); + if (pt.lastPointOfContour) { + contours.push(currentContour); + currentContour = []; + } + } + check.argument( + currentContour.length === 0, + "There are still points left in the current contour.", + ); + return contours; + } // Convert the TrueType glyph outline to a Path. + + function getPath(points) { + var p = new Path(); + if (!points) { + return p; + } + var contours = getContours(points); + for ( + var contourIndex = 0; + contourIndex < contours.length; + ++contourIndex + ) { + var contour = contours[contourIndex]; + var prev = null; + var curr = contour[contour.length - 1]; + var next = contour[0]; + if (curr.onCurve) { + p.moveTo(curr.x, curr.y); + } else { + if (next.onCurve) { + p.moveTo(next.x, next.y); + } else { + // If both first and last points are off-curve, start at their middle. + var start = { + x: (curr.x + next.x) * 0.5, + y: (curr.y + next.y) * 0.5, + }; + p.moveTo(start.x, start.y); + } + } + for (var i = 0; i < contour.length; ++i) { + prev = curr; + curr = next; + next = contour[(i + 1) % contour.length]; + if (curr.onCurve) { + // This is a straight line. + p.lineTo(curr.x, curr.y); + } else { + var prev2 = prev; + var next2 = next; + if (!prev.onCurve) { + prev2 = { + x: (curr.x + prev.x) * 0.5, + y: (curr.y + prev.y) * 0.5, + }; + } + if (!next.onCurve) { + next2 = { + x: (curr.x + next.x) * 0.5, + y: (curr.y + next.y) * 0.5, + }; + } + p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y); + } + } + p.closePath(); + } + return p; + } + function buildPath(glyphs, glyph) { + if (glyph.isComposite) { + for (var j = 0; j < glyph.components.length; j += 1) { + var component = glyph.components[j]; + var componentGlyph = glyphs.get(component.glyphIndex); + // Force the ttfGlyphLoader to parse the glyph. + componentGlyph.getPath(); + if (componentGlyph.points) { + var transformedPoints = void 0; + if (component.matchedPoints === undefined) { + // component positioned by offset + transformedPoints = transformPoints( + componentGlyph.points, + component, + ); + } else { + // component positioned by matched points + if ( + component.matchedPoints[0] > + glyph.points.length - 1 || + component.matchedPoints[1] > + componentGlyph.points.length - 1 + ) { + throw Error( + "Matched points out of range in " + glyph.name, + ); + } + var firstPt = glyph.points[component.matchedPoints[0]]; + var secondPt = + componentGlyph.points[component.matchedPoints[1]]; + var transform = { + xScale: component.xScale, + scale01: component.scale01, + scale10: component.scale10, + yScale: component.yScale, + dx: 0, + dy: 0, + }; + secondPt = transformPoints([secondPt], transform)[0]; + transform.dx = firstPt.x - secondPt.x; + transform.dy = firstPt.y - secondPt.y; + transformedPoints = transformPoints( + componentGlyph.points, + transform, + ); + } + glyph.points = glyph.points.concat(transformedPoints); + } + } + } + return getPath(glyph.points); + } // Parse all the glyphs according to the offsets from the `loca` table. + + function parseGlyfTable(data, start, loca, font) { + var glyphs = new glyphset.GlyphSet(font); + // The last element of the loca table is invalid. + for (var i = 0; i < loca.length - 1; i += 1) { + var offset = loca[i]; + var nextOffset = loca[i + 1]; + if (offset !== nextOffset) { + glyphs.push( + i, + glyphset.ttfGlyphLoader( + font, + i, + parseGlyph, + data, + start + offset, + buildPath, + ), + ); + } else { + glyphs.push(i, glyphset.glyphLoader(font, i)); + } + } + return glyphs; + } + var glyf = { + getPath: getPath, + parse: parseGlyfTable, + }; + /* A TrueType font hinting interpreter. + * + * (c) 2017 Axel Kittenberger + * + * This interpreter has been implemented according to this documentation: + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html + * + * According to the documentation F24DOT6 values are used for pixels. + * That means calculation is 1/64 pixel accurate and uses integer operations. + * However, Javascript has floating point operations by default and only + * those are available. One could make a case to simulate the 1/64 accuracy + * exactly by truncating after every division operation + * (for example with << 0) to get pixel exactly results as other TrueType + * implementations. It may make sense since some fonts are pixel optimized + * by hand using DELTAP instructions. The current implementation doesn't + * and rather uses full floating point precision. + * + * xScale, yScale and rotation is currently ignored. + * + * A few non-trivial instructions are missing as I didn't encounter yet + * a font that used them to test a possible implementation. + * + * Some fonts seem to use undocumented features regarding the twilight zone. + * Only some of them are implemented as they were encountered. + * + * The exports.DEBUG statements are removed on the minified distribution file. + */ + var instructionTable; + var exec; + var execGlyph; + var execComponent; + /* + * Creates a hinting object. + * + * There ought to be exactly one + * for each truetype font that is used for hinting. + */ + function Hinting(font) { + // the font this hinting object is for + this.font = font; + this.getCommands = function (hPoints) { + return glyf.getPath(hPoints).commands; + }; + // cached states + this._fpgmState = this._prepState = undefined; + // errorState + // 0 ... all okay + // 1 ... had an error in a glyf, + // continue working but stop spamming + // the console + // 2 ... error at prep, stop hinting at this ppem + // 3 ... error at fpeg, stop hinting for this font at all + this._errorState = 0; + } /* + * Not rounding. + */ + + function roundOff(v) { + return v; + } /* + * Rounding to grid. + */ + + function roundToGrid(v) { + //Rounding in TT is supposed to "symmetrical around zero" + return Math.sign(v) * Math.round(Math.abs(v)); + } /* + * Rounding to double grid. + */ + + function roundToDoubleGrid(v) { + return (Math.sign(v) * Math.round(Math.abs(v * 2))) / 2; + } /* + * Rounding to half grid. + */ + + function roundToHalfGrid(v) { + return Math.sign(v) * (Math.round(Math.abs(v) + 0.5) - 0.5); + } /* + * Rounding to up to grid. + */ + + function roundUpToGrid(v) { + return Math.sign(v) * Math.ceil(Math.abs(v)); + } /* + * Rounding to down to grid. + */ + + function roundDownToGrid(v) { + return Math.sign(v) * Math.floor(Math.abs(v)); + } /* + * Super rounding. + */ + + var roundSuper = function (v) { + var period = this.srPeriod; + var phase = this.srPhase; + var threshold = this.srThreshold; + var sign = 1; + if (v < 0) { + v = -v; + sign = -1; + } + v += threshold - phase; + v = Math.trunc(v / period) * period; + v += phase; + // according to http://xgridfit.sourceforge.net/round.html + if (v < 0) { + return phase * sign; + } + return v * sign; + }; + /* + * Unit vector of x-axis. + */ + var xUnitVector = { + x: 1, + y: 0, + axis: "x", + // Gets the projected distance between two points. + // o1/o2 ... if true, respective original position is used. + distance: function (p1, p2, o1, o2) { + return (o1 ? p1.xo : p1.x) - (o2 ? p2.xo : p2.x); + }, + // Moves point p so the moved position has the same relative + // position to the moved positions of rp1 and rp2 than the + // original positions had. + // + // See APPENDIX on INTERPOLATE at the bottom of this file. + interpolate: function (p, rp1, rp2, pv) { + var do1; + var do2; + var doa1; + var doa2; + var dm1; + var dm2; + var dt; + if (!pv || pv === this) { + do1 = p.xo - rp1.xo; + do2 = p.xo - rp2.xo; + dm1 = rp1.x - rp1.xo; + dm2 = rp2.x - rp2.xo; + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + p.x = p.xo + (dm1 + dm2) / 2; + return; + } + p.x = p.xo + (dm1 * doa2 + dm2 * doa1) / dt; + return; + } + do1 = pv.distance(p, rp1, true, true); + do2 = pv.distance(p, rp2, true, true); + dm1 = pv.distance(rp1, rp1, false, true); + dm2 = pv.distance(rp2, rp2, false, true); + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + xUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); + return; + } + xUnitVector.setRelative( + p, + p, + (dm1 * doa2 + dm2 * doa1) / dt, + pv, + true, + ); + }, + // Slope of line normal to this + normalSlope: Number.NEGATIVE_INFINITY, + // Sets the point 'p' relative to point 'rp' + // by the distance 'd'. + // + // See APPENDIX on SETRELATIVE at the bottom of this file. + // + // p ... point to set + // rp ... reference point + // d ... distance on projection vector + // pv ... projection vector (undefined = this) + // org ... if true, uses the original position of rp as reference. + setRelative: function (p, rp, d, pv, org) { + if (!pv || pv === this) { + p.x = (org ? rp.xo : rp.x) + d; + return; + } + var rpx = org ? rp.xo : rp.x; + var rpy = org ? rp.yo : rp.y; + var rpdx = rpx + d * pv.x; + var rpdy = rpy + d * pv.y; + p.x = rpdx + (p.y - rpdy) / pv.normalSlope; + }, + // Slope of vector line. + slope: 0, + // Touches the point p. + touch: function (p) { + p.xTouched = true; + }, + // Tests if a point p is touched. + touched: function (p) { + return p.xTouched; + }, + // Untouches the point p. + untouch: function (p) { + p.xTouched = false; + }, + }; + /* + * Unit vector of y-axis. + */ + var yUnitVector = { + x: 0, + y: 1, + axis: "y", + // Gets the projected distance between two points. + // o1/o2 ... if true, respective original position is used. + distance: function (p1, p2, o1, o2) { + return (o1 ? p1.yo : p1.y) - (o2 ? p2.yo : p2.y); + }, + // Moves point p so the moved position has the same relative + // position to the moved positions of rp1 and rp2 than the + // original positions had. + // + // See APPENDIX on INTERPOLATE at the bottom of this file. + interpolate: function (p, rp1, rp2, pv) { + var do1; + var do2; + var doa1; + var doa2; + var dm1; + var dm2; + var dt; + if (!pv || pv === this) { + do1 = p.yo - rp1.yo; + do2 = p.yo - rp2.yo; + dm1 = rp1.y - rp1.yo; + dm2 = rp2.y - rp2.yo; + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + p.y = p.yo + (dm1 + dm2) / 2; + return; + } + p.y = p.yo + (dm1 * doa2 + dm2 * doa1) / dt; + return; + } + do1 = pv.distance(p, rp1, true, true); + do2 = pv.distance(p, rp2, true, true); + dm1 = pv.distance(rp1, rp1, false, true); + dm2 = pv.distance(rp2, rp2, false, true); + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + yUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); + return; + } + yUnitVector.setRelative( + p, + p, + (dm1 * doa2 + dm2 * doa1) / dt, + pv, + true, + ); + }, + // Slope of line normal to this. + normalSlope: 0, + // Sets the point 'p' relative to point 'rp' + // by the distance 'd' + // + // See APPENDIX on SETRELATIVE at the bottom of this file. + // + // p ... point to set + // rp ... reference point + // d ... distance on projection vector + // pv ... projection vector (undefined = this) + // org ... if true, uses the original position of rp as reference. + setRelative: function (p, rp, d, pv, org) { + if (!pv || pv === this) { + p.y = (org ? rp.yo : rp.y) + d; + return; + } + var rpx = org ? rp.xo : rp.x; + var rpy = org ? rp.yo : rp.y; + var rpdx = rpx + d * pv.x; + var rpdy = rpy + d * pv.y; + p.y = rpdy + pv.normalSlope * (p.x - rpdx); + }, + // Slope of vector line. + slope: Number.POSITIVE_INFINITY, + // Touches the point p. + touch: function (p) { + p.yTouched = true; + }, + // Tests if a point p is touched. + touched: function (p) { + return p.yTouched; + }, + // Untouches the point p. + untouch: function (p) { + p.yTouched = false; + }, + }; + Object.freeze(xUnitVector); + Object.freeze(yUnitVector); + /* + * Creates a unit vector that is not x- or y-axis. + */ + function UnitVector(x, y) { + this.x = x; + this.y = y; + this.axis = undefined; + this.slope = y / x; + this.normalSlope = -x / y; + Object.freeze(this); + } /* + * Gets the projected distance between two points. + * o1/o2 ... if true, respective original position is used. + */ + + UnitVector.prototype.distance = function (p1, p2, o1, o2) { + return ( + this.x * xUnitVector.distance(p1, p2, o1, o2) + + this.y * yUnitVector.distance(p1, p2, o1, o2) + ); + }; + /* + * Moves point p so the moved position has the same relative + * position to the moved positions of rp1 and rp2 than the + * original positions had. + * + * See APPENDIX on INTERPOLATE at the bottom of this file. + */ + UnitVector.prototype.interpolate = function (p, rp1, rp2, pv) { + var dm1; + var dm2; + var do1; + var do2; + var doa1; + var doa2; + var dt; + do1 = pv.distance(p, rp1, true, true); + do2 = pv.distance(p, rp2, true, true); + dm1 = pv.distance(rp1, rp1, false, true); + dm2 = pv.distance(rp2, rp2, false, true); + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + this.setRelative(p, p, (dm1 + dm2) / 2, pv, true); + return; + } + this.setRelative( + p, + p, + (dm1 * doa2 + dm2 * doa1) / dt, + pv, + true, + ); + }; + /* + * Sets the point 'p' relative to point 'rp' + * by the distance 'd' + * + * See APPENDIX on SETRELATIVE at the bottom of this file. + * + * p ... point to set + * rp ... reference point + * d ... distance on projection vector + * pv ... projection vector (undefined = this) + * org ... if true, uses the original position of rp as reference. + */ + UnitVector.prototype.setRelative = function (p, rp, d, pv, org) { + pv = pv || this; + var rpx = org ? rp.xo : rp.x; + var rpy = org ? rp.yo : rp.y; + var rpdx = rpx + d * pv.x; + var rpdy = rpy + d * pv.y; + var pvns = pv.normalSlope; + var fvs = this.slope; + var px = p.x; + var py = p.y; + p.x = (fvs * px - pvns * rpdx + rpdy - py) / (fvs - pvns); + p.y = fvs * (p.x - px) + py; + }; + /* + * Touches the point p. + */ + UnitVector.prototype.touch = function (p) { + p.xTouched = true; + p.yTouched = true; + }; + /* + * Returns a unit vector with x/y coordinates. + */ + function getUnitVector(x, y) { + var d = Math.sqrt(x * x + y * y); + x /= d; + y /= d; + if (x === 1 && y === 0) { + return xUnitVector; + } else if (x === 0 && y === 1) { + return yUnitVector; + } else { + return new UnitVector(x, y); + } + } /* + * Creates a point in the hinting engine. + */ + + function HPoint(x, y, lastPointOfContour, onCurve) { + this.x = this.xo = Math.round(x * 64) / 64; // hinted x value and original x-value + this.y = this.yo = Math.round(y * 64) / 64; // hinted y value and original y-value + this.lastPointOfContour = lastPointOfContour; + this.onCurve = onCurve; + this.prevPointOnContour = undefined; + this.nextPointOnContour = undefined; + this.xTouched = false; + this.yTouched = false; + Object.preventExtensions(this); + } /* + * Returns the next touched point on the contour. + * + * v ... unit vector to test touch axis. + */ + + HPoint.prototype.nextTouched = function (v) { + var p = this.nextPointOnContour; + while (!v.touched(p) && p !== this) { + p = p.nextPointOnContour; + } + return p; + }; + /* + * Returns the previous touched point on the contour + * + * v ... unit vector to test touch axis. + */ + HPoint.prototype.prevTouched = function (v) { + var p = this.prevPointOnContour; + while (!v.touched(p) && p !== this) { + p = p.prevPointOnContour; + } + return p; + }; + /* + * The zero point. + */ + var HPZero = Object.freeze(new HPoint(0, 0)); + /* + * The default state of the interpreter. + * + * Note: Freezing the defaultState and then deriving from it + * makes the V8 Javascript engine going awkward, + * so this is avoided, albeit the defaultState shouldn't + * ever change. + */ + var defaultState = { + cvCutIn: 17 / 16, + // control value cut in + deltaBase: 9, + deltaShift: 0.125, + loop: 1, + // loops some instructions + minDis: 1, + // minimum distance + autoFlip: true, + }; + /* + * The current state of the interpreter. + * + * env ... 'fpgm' or 'prep' or 'glyf' + * prog ... the program + */ + function State(env, prog) { + this.env = env; + this.stack = []; + this.prog = prog; + switch (env) { + case "glyf": + this.zp0 = this.zp1 = this.zp2 = 1; + this.rp0 = this.rp1 = this.rp2 = 0; + /* fall through */ + case "prep": + this.fv = this.pv = this.dpv = xUnitVector; + this.round = roundToGrid; + } + } /* + * Executes a glyph program. + * + * This does the hinting for each glyph. + * + * Returns an array of moved points. + * + * glyph: the glyph to hint + * ppem: the size the glyph is rendered for + */ + + Hinting.prototype.exec = function (glyph, ppem) { + if (typeof ppem !== "number") { + throw new Error("Point size is not a number!"); + } // Received a fatal error, don't do any hinting anymore. + + if (this._errorState > 2) { + return; + } + var font = this.font; + var prepState = this._prepState; + if (!prepState || prepState.ppem !== ppem) { + var fpgmState = this._fpgmState; + if (!fpgmState) { + // Executes the fpgm state. + // This is used by fonts to define functions. + State.prototype = defaultState; + fpgmState = this._fpgmState = new State( + "fpgm", + font.tables.fpgm, + ); + fpgmState.funcs = []; + fpgmState.font = font; + if (exports.DEBUG) { + console.log("---EXEC FPGM---"); + fpgmState.step = -1; + } + try { + exec(fpgmState); + } catch (e) { + console.log("Hinting error in FPGM:" + e); + this._errorState = 3; + return; + } + } // Executes the prep program for this ppem setting. + // This is used by fonts to set cvt values + // depending on to be rendered font size. + + State.prototype = fpgmState; + prepState = this._prepState = new State( + "prep", + font.tables.prep, + ); + prepState.ppem = ppem; + // Creates a copy of the cvt table + // and scales it to the current ppem setting. + var oCvt = font.tables.cvt; + if (oCvt) { + var cvt = (prepState.cvt = new Array(oCvt.length)); + var scale = ppem / font.unitsPerEm; + for (var c = 0; c < oCvt.length; c++) { + cvt[c] = oCvt[c] * scale; + } + } else { + prepState.cvt = []; + } + if (exports.DEBUG) { + console.log("---EXEC PREP---"); + prepState.step = -1; + } + try { + exec(prepState); + } catch (e) { + if (this._errorState < 2) { + console.log("Hinting error in PREP:" + e); + } + this._errorState = 2; + } + } + if (this._errorState > 1) { + return; + } + try { + return execGlyph(glyph, prepState); + } catch (e) { + if (this._errorState < 1) { + console.log("Hinting error:" + e); + console.log("Note: further hinting errors are silenced"); + } + this._errorState = 1; + return undefined; + } + }; + /* + * Executes the hinting program for a glyph. + */ + execGlyph = function (glyph, prepState) { + // original point positions + var xScale = prepState.ppem / prepState.font.unitsPerEm; + var yScale = xScale; + var components = glyph.components; + var contours; + var gZone; + var state; + State.prototype = prepState; + if (!components) { + state = new State("glyf", glyph.instructions); + if (exports.DEBUG) { + console.log("---EXEC GLYPH---"); + state.step = -1; + } + execComponent(glyph, state, xScale, yScale); + gZone = state.gZone; + } else { + var font = prepState.font; + gZone = []; + contours = []; + for (var i = 0; i < components.length; i++) { + var c = components[i]; + var cg = font.glyphs.get(c.glyphIndex); + state = new State("glyf", cg.instructions); + if (exports.DEBUG) { + console.log("---EXEC COMP " + i + "---"); + state.step = -1; + } + execComponent(cg, state, xScale, yScale); + // appends the computed points to the result array + // post processes the component points + var dx = Math.round(c.dx * xScale); + var dy = Math.round(c.dy * yScale); + var gz = state.gZone; + var cc = state.contours; + for (var pi = 0; pi < gz.length; pi++) { + var p = gz[pi]; + p.xTouched = p.yTouched = false; + p.xo = p.x = p.x + dx; + p.yo = p.y = p.y + dy; + } + var gLen = gZone.length; + gZone.push.apply(gZone, gz); + for (var j = 0; j < cc.length; j++) { + contours.push(cc[j] + gLen); + } + } + if (glyph.instructions && !state.inhibitGridFit) { + // the composite has instructions on its own + state = new State("glyf", glyph.instructions); + state.gZone = state.z0 = state.z1 = state.z2 = gZone; + state.contours = contours; + // note: HPZero cannot be used here, since + // the point might be modified + gZone.push( + new HPoint(0, 0), + new HPoint(Math.round(glyph.advanceWidth * xScale), 0), + ); + if (exports.DEBUG) { + console.log("---EXEC COMPOSITE---"); + state.step = -1; + } + exec(state); + gZone.length -= 2; + } + } + return gZone; + }; + /* + * Executes the hinting program for a component of a multi-component glyph + * or of the glyph itself for a non-component glyph. + */ + execComponent = function (glyph, state, xScale, yScale) { + var points = glyph.points || []; + var pLen = points.length; + var gZone = (state.gZone = state.z0 = state.z1 = state.z2 = []); + var contours = (state.contours = []); + // Scales the original points and + // makes copies for the hinted points. + var cp; // current point + for (var i = 0; i < pLen; i++) { + cp = points[i]; + gZone[i] = new HPoint( + cp.x * xScale, + cp.y * yScale, + cp.lastPointOfContour, + cp.onCurve, + ); + } // Chain links the contours. + + var sp; // start point + var np; // next point + for (var i$1 = 0; i$1 < pLen; i$1++) { + cp = gZone[i$1]; + if (!sp) { + sp = cp; + contours.push(i$1); + } + if (cp.lastPointOfContour) { + cp.nextPointOnContour = sp; + sp.prevPointOnContour = cp; + sp = undefined; + } else { + np = gZone[i$1 + 1]; + cp.nextPointOnContour = np; + np.prevPointOnContour = cp; + } + } + if (state.inhibitGridFit) { + return; + } + if (exports.DEBUG) { + console.log("PROCESSING GLYPH", state.stack); + for (var i$2 = 0; i$2 < pLen; i$2++) { + console.log(i$2, gZone[i$2].x, gZone[i$2].y); + } + } + gZone.push( + new HPoint(0, 0), + new HPoint(Math.round(glyph.advanceWidth * xScale), 0), + ); + exec(state); + // Removes the extra points. + gZone.length -= 2; + if (exports.DEBUG) { + console.log("FINISHED GLYPH", state.stack); + for (var i$3 = 0; i$3 < pLen; i$3++) { + console.log(i$3, gZone[i$3].x, gZone[i$3].y); + } + } + }; + /* + * Executes the program loaded in state. + */ + exec = function (state) { + var prog = state.prog; + if (!prog) { + return; + } + var pLen = prog.length; + var ins; + for (state.ip = 0; state.ip < pLen; state.ip++) { + if (exports.DEBUG) { + state.step++; + } + ins = instructionTable[prog[state.ip]]; + if (!ins) { + throw new Error( + "unknown instruction: 0x" + + Number(prog[state.ip]).toString(16), + ); + } + ins(state); + // very extensive debugging for each step + /* + if (exports.DEBUG) { + var da; + if (state.gZone) { + da = []; + for (let i = 0; i < state.gZone.length; i++) + { + da.push(i + ' ' + + state.gZone[i].x * 64 + ' ' + + state.gZone[i].y * 64 + ' ' + + (state.gZone[i].xTouched ? 'x' : '') + + (state.gZone[i].yTouched ? 'y' : '') + ); } - } - fillShader.disableRemainingAttributes(); - if (geometry.indexBuffer) { - //vertex index buffer - this._bindBuffer(geometry.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); - } - this._applyColorBlend(this.curFillColor); - this._drawElements(gl.TRIANGLES, gId); - fillShader.unbindShader(); + console.log('GZ', da); } - if (!this.geometryBuilder && this._doStroke && geometry.lineVertexCount > 0) { - this._useLineColor = geometry.model.vertexStrokeColors.length > 0; - var strokeShader = this._getRetainedStrokeShader(); - this._setStrokeUniforms(strokeShader); - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = this.retainedMode.buffers.stroke[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var _buff = _step3.value; - _buff._prepareBuffer(geometry, strokeShader); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } + if (state.tZone) { + da = []; + for (let i = 0; i < state.tZone.length; i++) { + da.push(i + ' ' + + state.tZone[i].x * 64 + ' ' + + state.tZone[i].y * 64 + ' ' + + (state.tZone[i].xTouched ? 'x' : '') + + (state.tZone[i].yTouched ? 'y' : '') + ); } - } - strokeShader.disableRemainingAttributes(); - this._applyColorBlend(this.curStrokeColor); - this._drawArrays(gl.TRIANGLES, gId); - strokeShader.unbindShader(); + console.log('TZ', da); } - if (this.geometryBuilder) { - this.geometryBuilder.addRetained(geometry); + if (state.stack.length > 10) { + console.log( + state.stack.length, + '...', state.stack.slice(state.stack.length - 10) + ); + } else { + console.log(state.stack.length, state.stack); } - return this; - }; - /** - * Calls drawBuffers() with a scaled model/view matrix. + } + */ + } + }; + /* + * Initializes the twilight zone. + * + * This is only done if a SZPx instruction + * refers to the twilight zone. + */ + function initTZone(state) { + var tZone = (state.tZone = new Array(state.gZone.length)); + // no idea if this is actually correct... + for (var i = 0; i < tZone.length; i++) { + tZone[i] = new HPoint(0, 0); + } + } /* + * Skips the instruction pointer ahead over an IF/ELSE block. + * handleElse .. if true breaks on matching ELSE + */ + + function skip(state, handleElse) { + var prog = state.prog; + var ip = state.ip; + var nesting = 1; + var ins; + do { + ins = prog[++ip]; + if (ins === 88) { + // IF + nesting++; + } else if (ins === 89) { + // EIF + nesting--; + } else if (ins === 64) { + // NPUSHB + ip += prog[ip + 1] + 1; + } else if (ins === 65) { + // NPUSHW + ip += 2 * prog[ip + 1] + 1; + } else if (ins >= 176 && ins <= 183) { + // PUSHB + ip += ins - 176 + 1; + } else if (ins >= 184 && ins <= 191) { + // PUSHW + ip += (ins - 184 + 1) * 2; + } else if (handleElse && nesting === 1 && ins === 27) { + // ELSE + break; + } + } while (nesting > 0); + state.ip = ip; + } /*----------------------------------------------------------* + * And then a lot of instructions... * + *----------------------------------------------------------*/ + // SVTCA[a] Set freedom and projection Vectors To Coordinate Axis + // 0x00-0x01 + + function SVTCA(v, state) { + if (exports.DEBUG) { + console.log(state.step, "SVTCA[" + v.axis + "]"); + } + state.fv = state.pv = state.dpv = v; + } // SPVTCA[a] Set Projection Vector to Coordinate Axis + // 0x02-0x03 + + function SPVTCA(v, state) { + if (exports.DEBUG) { + console.log(state.step, "SPVTCA[" + v.axis + "]"); + } + state.pv = state.dpv = v; + } // SFVTCA[a] Set Freedom Vector to Coordinate Axis + // 0x04-0x05 + + function SFVTCA(v, state) { + if (exports.DEBUG) { + console.log(state.step, "SFVTCA[" + v.axis + "]"); + } + state.fv = v; + } // SPVTL[a] Set Projection Vector To Line + // 0x06-0x07 + + function SPVTL(a, state) { + var stack = state.stack; + var p2i = stack.pop(); + var p1i = stack.pop(); + var p2 = state.z2[p2i]; + var p1 = state.z1[p1i]; + if (exports.DEBUG) { + console.log("SPVTL[" + a + "]", p2i, p1i); + } + var dx; + var dy; + if (!a) { + dx = p1.x - p2.x; + dy = p1.y - p2.y; + } else { + dx = p2.y - p1.y; + dy = p1.x - p2.x; + } + state.pv = state.dpv = getUnitVector(dx, dy); + } // SFVTL[a] Set Freedom Vector To Line + // 0x08-0x09 + + function SFVTL(a, state) { + var stack = state.stack; + var p2i = stack.pop(); + var p1i = stack.pop(); + var p2 = state.z2[p2i]; + var p1 = state.z1[p1i]; + if (exports.DEBUG) { + console.log("SFVTL[" + a + "]", p2i, p1i); + } + var dx; + var dy; + if (!a) { + dx = p1.x - p2.x; + dy = p1.y - p2.y; + } else { + dx = p2.y - p1.y; + dy = p1.x - p2.x; + } + state.fv = getUnitVector(dx, dy); + } // SPVFS[] Set Projection Vector From Stack + // 0x0A + + function SPVFS(state) { + var stack = state.stack; + var y = stack.pop(); + var x = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SPVFS[]", y, x); + } + state.pv = state.dpv = getUnitVector(x, y); + } // SFVFS[] Set Freedom Vector From Stack + // 0x0B + + function SFVFS(state) { + var stack = state.stack; + var y = stack.pop(); + var x = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SPVFS[]", y, x); + } + state.fv = getUnitVector(x, y); + } // GPV[] Get Projection Vector + // 0x0C + + function GPV(state) { + var stack = state.stack; + var pv = state.pv; + if (exports.DEBUG) { + console.log(state.step, "GPV[]"); + } + stack.push(pv.x * 16384); + stack.push(pv.y * 16384); + } // GFV[] Get Freedom Vector + // 0x0C + + function GFV(state) { + var stack = state.stack; + var fv = state.fv; + if (exports.DEBUG) { + console.log(state.step, "GFV[]"); + } + stack.push(fv.x * 16384); + stack.push(fv.y * 16384); + } // SFVTPV[] Set Freedom Vector To Projection Vector + // 0x0E + + function SFVTPV(state) { + state.fv = state.pv; + if (exports.DEBUG) { + console.log(state.step, "SFVTPV[]"); + } + } // ISECT[] moves point p to the InterSECTion of two lines + // 0x0F + + function ISECT(state) { + var stack = state.stack; + var pa0i = stack.pop(); + var pa1i = stack.pop(); + var pb0i = stack.pop(); + var pb1i = stack.pop(); + var pi = stack.pop(); + var z0 = state.z0; + var z1 = state.z1; + var pa0 = z0[pa0i]; + var pa1 = z0[pa1i]; + var pb0 = z1[pb0i]; + var pb1 = z1[pb1i]; + var p = state.z2[pi]; + if (exports.DEBUG) { + console.log("ISECT[], ", pa0i, pa1i, pb0i, pb1i, pi); + } // math from + // en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line + + var x1 = pa0.x; + var y1 = pa0.y; + var x2 = pa1.x; + var y2 = pa1.y; + var x3 = pb0.x; + var y3 = pb0.y; + var x4 = pb1.x; + var y4 = pb1.y; + var div = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); + var f1 = x1 * y2 - y1 * x2; + var f2 = x3 * y4 - y3 * x4; + p.x = (f1 * (x3 - x4) - f2 * (x1 - x2)) / div; + p.y = (f1 * (y3 - y4) - f2 * (y1 - y2)) / div; + } // SRP0[] Set Reference Point 0 + // 0x10 + + function SRP0(state) { + state.rp0 = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SRP0[]", state.rp0); + } + } // SRP1[] Set Reference Point 1 + // 0x11 + + function SRP1(state) { + state.rp1 = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SRP1[]", state.rp1); + } + } // SRP1[] Set Reference Point 2 + // 0x12 + + function SRP2(state) { + state.rp2 = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SRP2[]", state.rp2); + } + } // SZP0[] Set Zone Pointer 0 + // 0x13 + + function SZP0(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SZP0[]", n); + } + state.zp0 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z0 = state.tZone; + break; + case 1: + state.z0 = state.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + } // SZP1[] Set Zone Pointer 1 + // 0x14 + + function SZP1(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SZP1[]", n); + } + state.zp1 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z1 = state.tZone; + break; + case 1: + state.z1 = state.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + } // SZP2[] Set Zone Pointer 2 + // 0x15 + + function SZP2(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SZP2[]", n); + } + state.zp2 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z2 = state.tZone; + break; + case 1: + state.z2 = state.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + } // SZPS[] Set Zone PointerS + // 0x16 + + function SZPS(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SZPS[]", n); + } + state.zp0 = state.zp1 = state.zp2 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z0 = state.z1 = state.z2 = state.tZone; + break; + case 1: + state.z0 = state.z1 = state.z2 = state.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + } // SLOOP[] Set LOOP variable + // 0x17 + + function SLOOP(state) { + state.loop = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SLOOP[]", state.loop); + } + } // RTG[] Round To Grid + // 0x18 + + function RTG(state) { + if (exports.DEBUG) { + console.log(state.step, "RTG[]"); + } + state.round = roundToGrid; + } // RTHG[] Round To Half Grid + // 0x19 + + function RTHG(state) { + if (exports.DEBUG) { + console.log(state.step, "RTHG[]"); + } + state.round = roundToHalfGrid; + } // SMD[] Set Minimum Distance + // 0x1A + + function SMD(state) { + var d = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SMD[]", d); + } + state.minDis = d / 64; + } // ELSE[] ELSE clause + // 0x1B + + function ELSE(state) { + // This instruction has been reached by executing a then branch + // so it just skips ahead until matching EIF. + // + // In case the IF was negative the IF[] instruction already + // skipped forward over the ELSE[] + if (exports.DEBUG) { + console.log(state.step, "ELSE[]"); + } + skip(state, false); + } // JMPR[] JuMP Relative + // 0x1C + + function JMPR(state) { + var o = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "JMPR[]", o); + } // A jump by 1 would do nothing. + + state.ip += o - 1; + } // SCVTCI[] Set Control Value Table Cut-In + // 0x1D + + function SCVTCI(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SCVTCI[]", n); + } + state.cvCutIn = n / 64; + } // DUP[] DUPlicate top stack element + // 0x20 + + function DUP(state) { + var stack = state.stack; + if (exports.DEBUG) { + console.log(state.step, "DUP[]"); + } + stack.push(stack[stack.length - 1]); + } // POP[] POP top stack element + // 0x21 + + function POP(state) { + if (exports.DEBUG) { + console.log(state.step, "POP[]"); + } + state.stack.pop(); + } // CLEAR[] CLEAR the stack + // 0x22 + + function CLEAR(state) { + if (exports.DEBUG) { + console.log(state.step, "CLEAR[]"); + } + state.stack.length = 0; + } // SWAP[] SWAP the top two elements on the stack + // 0x23 + + function SWAP(state) { + var stack = state.stack; + var a = stack.pop(); + var b = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SWAP[]"); + } + stack.push(a); + stack.push(b); + } // DEPTH[] DEPTH of the stack + // 0x24 + + function DEPTH(state) { + var stack = state.stack; + if (exports.DEBUG) { + console.log(state.step, "DEPTH[]"); + } + stack.push(stack.length); + } // LOOPCALL[] LOOPCALL function + // 0x2A + + function LOOPCALL(state) { + var stack = state.stack; + var fn = stack.pop(); + var c = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "LOOPCALL[]", fn, c); + } // saves callers program + + var cip = state.ip; + var cprog = state.prog; + state.prog = state.funcs[fn]; + // executes the function + for (var i = 0; i < c; i++) { + exec(state); + if (exports.DEBUG) { + console.log( + ++state.step, + i + 1 < c ? "next loopcall" : "done loopcall", + i, + ); + } + } // restores the callers program + + state.ip = cip; + state.prog = cprog; + } // CALL[] CALL function + // 0x2B + + function CALL(state) { + var fn = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "CALL[]", fn); + } // saves callers program + + var cip = state.ip; + var cprog = state.prog; + state.prog = state.funcs[fn]; + // executes the function + exec(state); + // restores the callers program + state.ip = cip; + state.prog = cprog; + if (exports.DEBUG) { + console.log(++state.step, "returning from", fn); + } + } // CINDEX[] Copy the INDEXed element to the top of the stack + // 0x25 + + function CINDEX(state) { + var stack = state.stack; + var k = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "CINDEX[]", k); + } // In case of k == 1, it copies the last element after popping + // thus stack.length - k. + + stack.push(stack[stack.length - k]); + } // MINDEX[] Move the INDEXed element to the top of the stack + // 0x26 + + function MINDEX(state) { + var stack = state.stack; + var k = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "MINDEX[]", k); + } + stack.push(stack.splice(stack.length - k, 1)[0]); + } // FDEF[] Function DEFinition + // 0x2C + + function FDEF(state) { + if (state.env !== "fpgm") { + throw new Error("FDEF not allowed here"); + } + var stack = state.stack; + var prog = state.prog; + var ip = state.ip; + var fn = stack.pop(); + var ipBegin = ip; + if (exports.DEBUG) { + console.log(state.step, "FDEF[]", fn); + } + while (prog[++ip] !== 45) {} + state.ip = ip; + state.funcs[fn] = prog.slice(ipBegin + 1, ip); + } // MDAP[a] Move Direct Absolute Point + // 0x2E-0x2F + + function MDAP(round, state) { + var pi = state.stack.pop(); + var p = state.z0[pi]; + var fv = state.fv; + var pv = state.pv; + if (exports.DEBUG) { + console.log(state.step, "MDAP[" + round + "]", pi); + } + var d = pv.distance(p, HPZero); + if (round) { + d = state.round(d); + } + fv.setRelative(p, HPZero, d, pv); + fv.touch(p); + state.rp0 = state.rp1 = pi; + } // IUP[a] Interpolate Untouched Points through the outline + // 0x30 + + function IUP(v, state) { + var z2 = state.z2; + var pLen = z2.length - 2; + var cp; + var pp; + var np; + if (exports.DEBUG) { + console.log(state.step, "IUP[" + v.axis + "]"); + } + for (var i = 0; i < pLen; i++) { + cp = z2[i]; // current point + // if this point has been touched go on + if (v.touched(cp)) { + continue; + } + pp = cp.prevTouched(v); + // no point on the contour has been touched? + if (pp === cp) { + continue; + } + np = cp.nextTouched(v); + if (pp === np) { + // only one point on the contour has been touched + // so simply moves the point like that + v.setRelative( + cp, + cp, + v.distance(pp, pp, false, true), + v, + true, + ); + } + v.interpolate(cp, pp, np, v); + } + } // SHP[] SHift Point using reference point + // 0x32-0x33 + + function SHP(a, state) { + var stack = state.stack; + var rpi = a ? state.rp1 : state.rp2; + var rp = (a ? state.z0 : state.z1)[rpi]; + var fv = state.fv; + var pv = state.pv; + var loop = state.loop; + var z2 = state.z2; + while (loop--) { + var pi = stack.pop(); + var p = z2[pi]; + var d = pv.distance(rp, rp, false, true); + fv.setRelative(p, p, d, pv); + fv.touch(p); + if (exports.DEBUG) { + console.log( + state.step, + (state.loop > 1 + ? "loop " + (state.loop - loop) + ": " + : "") + + "SHP[" + + (a ? "rp1" : "rp2") + + "]", + pi, + ); + } + } + state.loop = 1; + } // SHC[] SHift Contour using reference point + // 0x36-0x37 + + function SHC(a, state) { + var stack = state.stack; + var rpi = a ? state.rp1 : state.rp2; + var rp = (a ? state.z0 : state.z1)[rpi]; + var fv = state.fv; + var pv = state.pv; + var ci = stack.pop(); + var sp = state.z2[state.contours[ci]]; + var p = sp; + if (exports.DEBUG) { + console.log(state.step, "SHC[" + a + "]", ci); + } + var d = pv.distance(rp, rp, false, true); + do { + if (p !== rp) { + fv.setRelative(p, p, d, pv); + } + p = p.nextPointOnContour; + } while (p !== sp); + } // SHZ[] SHift Zone using reference point + // 0x36-0x37 + + function SHZ(a, state) { + var stack = state.stack; + var rpi = a ? state.rp1 : state.rp2; + var rp = (a ? state.z0 : state.z1)[rpi]; + var fv = state.fv; + var pv = state.pv; + var e = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SHZ[" + a + "]", e); + } + var z; + switch (e) { + case 0: + z = state.tZone; + break; + case 1: + z = state.gZone; + break; + default: + throw new Error("Invalid zone"); + } + var p; + var d = pv.distance(rp, rp, false, true); + var pLen = z.length - 2; + for (var i = 0; i < pLen; i++) { + p = z[i]; + fv.setRelative(p, p, d, pv); + //if (p !== rp) fv.setRelative(p, p, d, pv); + } + } // SHPIX[] SHift point by a PIXel amount + // 0x38 + + function SHPIX(state) { + var stack = state.stack; + var loop = state.loop; + var fv = state.fv; + var d = stack.pop() / 64; + var z2 = state.z2; + while (loop--) { + var pi = stack.pop(); + var p = z2[pi]; + if (exports.DEBUG) { + console.log( + state.step, + (state.loop > 1 + ? "loop " + (state.loop - loop) + ": " + : "") + "SHPIX[]", + pi, + d, + ); + } + fv.setRelative(p, p, d); + fv.touch(p); + } + state.loop = 1; + } // IP[] Interpolate Point + // 0x39 + + function IP(state) { + var stack = state.stack; + var rp1i = state.rp1; + var rp2i = state.rp2; + var loop = state.loop; + var rp1 = state.z0[rp1i]; + var rp2 = state.z1[rp2i]; + var fv = state.fv; + var pv = state.dpv; + var z2 = state.z2; + while (loop--) { + var pi = stack.pop(); + var p = z2[pi]; + if (exports.DEBUG) { + console.log( + state.step, + (state.loop > 1 + ? "loop " + (state.loop - loop) + ": " + : "") + "IP[]", + pi, + rp1i, + "<->", + rp2i, + ); + } + fv.interpolate(p, rp1, rp2, pv); + fv.touch(p); + } + state.loop = 1; + } // MSIRP[a] Move Stack Indirect Relative Point + // 0x3A-0x3B + + function MSIRP(a, state) { + var stack = state.stack; + var d = stack.pop() / 64; + var pi = stack.pop(); + var p = state.z1[pi]; + var rp0 = state.z0[state.rp0]; + var fv = state.fv; + var pv = state.pv; + fv.setRelative(p, rp0, d, pv); + fv.touch(p); + if (exports.DEBUG) { + console.log(state.step, "MSIRP[" + a + "]", d, pi); + } + state.rp1 = state.rp0; + state.rp2 = pi; + if (a) { + state.rp0 = pi; + } + } // ALIGNRP[] Align to reference point. + // 0x3C + + function ALIGNRP(state) { + var stack = state.stack; + var rp0i = state.rp0; + var rp0 = state.z0[rp0i]; + var loop = state.loop; + var fv = state.fv; + var pv = state.pv; + var z1 = state.z1; + while (loop--) { + var pi = stack.pop(); + var p = z1[pi]; + if (exports.DEBUG) { + console.log( + state.step, + (state.loop > 1 + ? "loop " + (state.loop - loop) + ": " + : "") + "ALIGNRP[]", + pi, + ); + } + fv.setRelative(p, rp0, 0, pv); + fv.touch(p); + } + state.loop = 1; + } // RTG[] Round To Double Grid + // 0x3D + + function RTDG(state) { + if (exports.DEBUG) { + console.log(state.step, "RTDG[]"); + } + state.round = roundToDoubleGrid; + } // MIAP[a] Move Indirect Absolute Point + // 0x3E-0x3F + + function MIAP(round, state) { + var stack = state.stack; + var n = stack.pop(); + var pi = stack.pop(); + var p = state.z0[pi]; + var fv = state.fv; + var pv = state.pv; + var cv = state.cvt[n]; + if (exports.DEBUG) { + console.log( + state.step, + "MIAP[" + round + "]", + n, + "(", + cv, + ")", + pi, + ); + } + var d = pv.distance(p, HPZero); + if (round) { + if (Math.abs(d - cv) < state.cvCutIn) { + d = cv; + } + d = state.round(d); + } + fv.setRelative(p, HPZero, d, pv); + if (state.zp0 === 0) { + p.xo = p.x; + p.yo = p.y; + } + fv.touch(p); + state.rp0 = state.rp1 = pi; + } // NPUSB[] PUSH N Bytes + // 0x40 + + function NPUSHB(state) { + var prog = state.prog; + var ip = state.ip; + var stack = state.stack; + var n = prog[++ip]; + if (exports.DEBUG) { + console.log(state.step, "NPUSHB[]", n); + } + for (var i = 0; i < n; i++) { + stack.push(prog[++ip]); + } + state.ip = ip; + } // NPUSHW[] PUSH N Words + // 0x41 + + function NPUSHW(state) { + var ip = state.ip; + var prog = state.prog; + var stack = state.stack; + var n = prog[++ip]; + if (exports.DEBUG) { + console.log(state.step, "NPUSHW[]", n); + } + for (var i = 0; i < n; i++) { + var w = (prog[++ip] << 8) | prog[++ip]; + if (w & 32768) { + w = -((w ^ 65535) + 1); + } + stack.push(w); + } + state.ip = ip; + } // WS[] Write Store + // 0x42 + + function WS(state) { + var stack = state.stack; + var store = state.store; + if (!store) { + store = state.store = []; + } + var v = stack.pop(); + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "WS", v, l); + } + store[l] = v; + } // RS[] Read Store + // 0x43 + + function RS(state) { + var stack = state.stack; + var store = state.store; + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "RS", l); + } + var v = (store && store[l]) || 0; + stack.push(v); + } // WCVTP[] Write Control Value Table in Pixel units + // 0x44 + + function WCVTP(state) { + var stack = state.stack; + var v = stack.pop(); + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "WCVTP", v, l); + } + state.cvt[l] = v / 64; + } // RCVT[] Read Control Value Table entry + // 0x45 + + function RCVT(state) { + var stack = state.stack; + var cvte = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "RCVT", cvte); + } + stack.push(state.cvt[cvte] * 64); + } // GC[] Get Coordinate projected onto the projection vector + // 0x46-0x47 + + function GC(a, state) { + var stack = state.stack; + var pi = stack.pop(); + var p = state.z2[pi]; + if (exports.DEBUG) { + console.log(state.step, "GC[" + a + "]", pi); + } + stack.push(state.dpv.distance(p, HPZero, a, false) * 64); + } // MD[a] Measure Distance + // 0x49-0x4A + + function MD(a, state) { + var stack = state.stack; + var pi2 = stack.pop(); + var pi1 = stack.pop(); + var p2 = state.z1[pi2]; + var p1 = state.z0[pi1]; + var d = state.dpv.distance(p1, p2, a, a); + if (exports.DEBUG) { + console.log(state.step, "MD[" + a + "]", pi2, pi1, "->", d); + } + state.stack.push(Math.round(d * 64)); + } // MPPEM[] Measure Pixels Per EM + // 0x4B + + function MPPEM(state) { + if (exports.DEBUG) { + console.log(state.step, "MPPEM[]"); + } + state.stack.push(state.ppem); + } // FLIPON[] set the auto FLIP Boolean to ON + // 0x4D + + function FLIPON(state) { + if (exports.DEBUG) { + console.log(state.step, "FLIPON[]"); + } + state.autoFlip = true; + } // LT[] Less Than + // 0x50 + + function LT(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "LT[]", e2, e1); + } + stack.push(e1 < e2 ? 1 : 0); + } // LTEQ[] Less Than or EQual + // 0x53 + + function LTEQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "LTEQ[]", e2, e1); + } + stack.push(e1 <= e2 ? 1 : 0); + } // GTEQ[] Greater Than + // 0x52 + + function GT(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "GT[]", e2, e1); + } + stack.push(e1 > e2 ? 1 : 0); + } // GTEQ[] Greater Than or EQual + // 0x53 + + function GTEQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "GTEQ[]", e2, e1); + } + stack.push(e1 >= e2 ? 1 : 0); + } // EQ[] EQual + // 0x54 + + function EQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "EQ[]", e2, e1); + } + stack.push(e2 === e1 ? 1 : 0); + } // NEQ[] Not EQual + // 0x55 + + function NEQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "NEQ[]", e2, e1); + } + stack.push(e2 !== e1 ? 1 : 0); + } // ODD[] ODD + // 0x56 + + function ODD(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "ODD[]", n); + } + stack.push(Math.trunc(n) % 2 ? 1 : 0); + } // EVEN[] EVEN + // 0x57 + + function EVEN(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "EVEN[]", n); + } + stack.push(Math.trunc(n) % 2 ? 0 : 1); + } // IF[] IF test + // 0x58 + + function IF(state) { + var test = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "IF[]", test); + } // if test is true it just continues + // if not the ip is skipped until matching ELSE or EIF + + if (!test) { + skip(state, true); + if (exports.DEBUG) { + console.log(state.step, "EIF[]"); + } + } + } // EIF[] End IF + // 0x59 + + function EIF(state) { + // this can be reached normally when + // executing an else branch. + // -> just ignore it + if (exports.DEBUG) { + console.log(state.step, "EIF[]"); + } + } // AND[] logical AND + // 0x5A + + function AND(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "AND[]", e2, e1); + } + stack.push(e2 && e1 ? 1 : 0); + } // OR[] logical OR + // 0x5B + + function OR(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "OR[]", e2, e1); + } + stack.push(e2 || e1 ? 1 : 0); + } // NOT[] logical NOT + // 0x5C + + function NOT(state) { + var stack = state.stack; + var e = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "NOT[]", e); + } + stack.push(e ? 0 : 1); + } // DELTAP1[] DELTA exception P1 + // DELTAP2[] DELTA exception P2 + // DELTAP3[] DELTA exception P3 + // 0x5D, 0x71, 0x72 + + function DELTAP123(b, state) { + var stack = state.stack; + var n = stack.pop(); + var fv = state.fv; + var pv = state.pv; + var ppem = state.ppem; + var base = state.deltaBase + (b - 1) * 16; + var ds = state.deltaShift; + var z0 = state.z0; + if (exports.DEBUG) { + console.log(state.step, "DELTAP[" + b + "]", n, stack); + } + for (var i = 0; i < n; i++) { + var pi = stack.pop(); + var arg = stack.pop(); + var appem = base + ((arg & 240) >> 4); + if (appem !== ppem) { + continue; + } + var mag = (arg & 15) - 8; + if (mag >= 0) { + mag++; + } + if (exports.DEBUG) { + console.log(state.step, "DELTAPFIX", pi, "by", mag * ds); + } + var p = z0[pi]; + fv.setRelative(p, p, mag * ds, pv); + } + } // SDB[] Set Delta Base in the graphics state + // 0x5E + + function SDB(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SDB[]", n); + } + state.deltaBase = n; + } // SDS[] Set Delta Shift in the graphics state + // 0x5F + + function SDS(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SDS[]", n); + } + state.deltaShift = Math.pow(0.5, n); + } // ADD[] ADD + // 0x60 + + function ADD(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "ADD[]", n2, n1); + } + stack.push(n1 + n2); + } // SUB[] SUB + // 0x61 + + function SUB(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SUB[]", n2, n1); + } + stack.push(n1 - n2); + } // DIV[] DIV + // 0x62 + + function DIV(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "DIV[]", n2, n1); + } + stack.push((n1 * 64) / n2); + } // MUL[] MUL + // 0x63 + + function MUL(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "MUL[]", n2, n1); + } + stack.push((n1 * n2) / 64); + } // ABS[] ABSolute value + // 0x64 + + function ABS(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "ABS[]", n); + } + stack.push(Math.abs(n)); + } // NEG[] NEGate + // 0x65 + + function NEG(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "NEG[]", n); + } + stack.push(-n); + } // FLOOR[] FLOOR + // 0x66 + + function FLOOR(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "FLOOR[]", n); + } + stack.push(Math.floor(n / 64) * 64); + } // CEILING[] CEILING + // 0x67 + + function CEILING(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "CEILING[]", n); + } + stack.push(Math.ceil(n / 64) * 64); + } // ROUND[ab] ROUND value + // 0x68-0x6B + + function ROUND(dt, state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "ROUND[]"); + } + stack.push(state.round(n / 64) * 64); + } // WCVTF[] Write Control Value Table in Funits + // 0x70 + + function WCVTF(state) { + var stack = state.stack; + var v = stack.pop(); + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "WCVTF[]", v, l); + } + state.cvt[l] = (v * state.ppem) / state.font.unitsPerEm; + } // DELTAC1[] DELTA exception C1 + // DELTAC2[] DELTA exception C2 + // DELTAC3[] DELTA exception C3 + // 0x73, 0x74, 0x75 + + function DELTAC123(b, state) { + var stack = state.stack; + var n = stack.pop(); + var ppem = state.ppem; + var base = state.deltaBase + (b - 1) * 16; + var ds = state.deltaShift; + if (exports.DEBUG) { + console.log(state.step, "DELTAC[" + b + "]", n, stack); + } + for (var i = 0; i < n; i++) { + var c = stack.pop(); + var arg = stack.pop(); + var appem = base + ((arg & 240) >> 4); + if (appem !== ppem) { + continue; + } + var mag = (arg & 15) - 8; + if (mag >= 0) { + mag++; + } + var delta = mag * ds; + if (exports.DEBUG) { + console.log(state.step, "DELTACFIX", c, "by", delta); + } + state.cvt[c] += delta; + } + } // SROUND[] Super ROUND + // 0x76 + + function SROUND(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "SROUND[]", n); + } + state.round = roundSuper; + var period; + switch (n & 192) { + case 0: + period = 0.5; + break; + case 64: + period = 1; + break; + case 128: + period = 2; + break; + default: + throw new Error("invalid SROUND value"); + } + state.srPeriod = period; + switch (n & 48) { + case 0: + state.srPhase = 0; + break; + case 16: + state.srPhase = 0.25 * period; + break; + case 32: + state.srPhase = 0.5 * period; + break; + case 48: + state.srPhase = 0.75 * period; + break; + default: + throw new Error("invalid SROUND value"); + } + n &= 15; + if (n === 0) { + state.srThreshold = 0; + } else { + state.srThreshold = (n / 8 - 0.5) * period; + } + } // S45ROUND[] Super ROUND 45 degrees + // 0x77 + + function S45ROUND(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "S45ROUND[]", n); + } + state.round = roundSuper; + var period; + switch (n & 192) { + case 0: + period = Math.sqrt(2) / 2; + break; + case 64: + period = Math.sqrt(2); + break; + case 128: + period = 2 * Math.sqrt(2); + break; + default: + throw new Error("invalid S45ROUND value"); + } + state.srPeriod = period; + switch (n & 48) { + case 0: + state.srPhase = 0; + break; + case 16: + state.srPhase = 0.25 * period; + break; + case 32: + state.srPhase = 0.5 * period; + break; + case 48: + state.srPhase = 0.75 * period; + break; + default: + throw new Error("invalid S45ROUND value"); + } + n &= 15; + if (n === 0) { + state.srThreshold = 0; + } else { + state.srThreshold = (n / 8 - 0.5) * period; + } + } // ROFF[] Round Off + // 0x7A + + function ROFF(state) { + if (exports.DEBUG) { + console.log(state.step, "ROFF[]"); + } + state.round = roundOff; + } // RUTG[] Round Up To Grid + // 0x7C + + function RUTG(state) { + if (exports.DEBUG) { + console.log(state.step, "RUTG[]"); + } + state.round = roundUpToGrid; + } // RDTG[] Round Down To Grid + // 0x7D + + function RDTG(state) { + if (exports.DEBUG) { + console.log(state.step, "RDTG[]"); + } + state.round = roundDownToGrid; + } // SCANCTRL[] SCAN conversion ConTRoL + // 0x85 + + function SCANCTRL(state) { + var n = state.stack.pop(); + // ignored by opentype.js + if (exports.DEBUG) { + console.log(state.step, "SCANCTRL[]", n); + } + } // SDPVTL[a] Set Dual Projection Vector To Line + // 0x86-0x87 + + function SDPVTL(a, state) { + var stack = state.stack; + var p2i = stack.pop(); + var p1i = stack.pop(); + var p2 = state.z2[p2i]; + var p1 = state.z1[p1i]; + if (exports.DEBUG) { + console.log(state.step, "SDPVTL[" + a + "]", p2i, p1i); + } + var dx; + var dy; + if (!a) { + dx = p1.x - p2.x; + dy = p1.y - p2.y; + } else { + dx = p2.y - p1.y; + dy = p1.x - p2.x; + } + state.dpv = getUnitVector(dx, dy); + } // GETINFO[] GET INFOrmation + // 0x88 + + function GETINFO(state) { + var stack = state.stack; + var sel = stack.pop(); + var r = 0; + if (exports.DEBUG) { + console.log(state.step, "GETINFO[]", sel); + } // v35 as in no subpixel hinting + + if (sel & 1) { + r = 35; + } // TODO rotation and stretch currently not supported + // and thus those GETINFO are always 0. + // opentype.js is always gray scaling + + if (sel & 32) { + r |= 4096; + } + stack.push(r); + } // ROLL[] ROLL the top three stack elements + // 0x8A + + function ROLL(state) { + var stack = state.stack; + var a = stack.pop(); + var b = stack.pop(); + var c = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "ROLL[]"); + } + stack.push(b); + stack.push(a); + stack.push(c); + } // MAX[] MAXimum of top two stack elements + // 0x8B + + function MAX(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "MAX[]", e2, e1); + } + stack.push(Math.max(e1, e2)); + } // MIN[] MINimum of top two stack elements + // 0x8C + + function MIN(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "MIN[]", e2, e1); + } + stack.push(Math.min(e1, e2)); + } // SCANTYPE[] SCANTYPE + // 0x8D + + function SCANTYPE(state) { + var n = state.stack.pop(); + // ignored by opentype.js + if (exports.DEBUG) { + console.log(state.step, "SCANTYPE[]", n); + } + } // INSTCTRL[] INSTCTRL + // 0x8D + + function INSTCTRL(state) { + var s = state.stack.pop(); + var v = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, "INSTCTRL[]", s, v); + } + switch (s) { + case 1: + state.inhibitGridFit = !!v; + return; + case 2: + state.ignoreCvt = !!v; + return; + default: + throw new Error("invalid INSTCTRL[] selector"); + } + } // PUSHB[abc] PUSH Bytes + // 0xB0-0xB7 + + function PUSHB(n, state) { + var stack = state.stack; + var prog = state.prog; + var ip = state.ip; + if (exports.DEBUG) { + console.log(state.step, "PUSHB[" + n + "]"); + } + for (var i = 0; i < n; i++) { + stack.push(prog[++ip]); + } + state.ip = ip; + } // PUSHW[abc] PUSH Words + // 0xB8-0xBF + + function PUSHW(n, state) { + var ip = state.ip; + var prog = state.prog; + var stack = state.stack; + if (exports.DEBUG) { + console.log(state.ip, "PUSHW[" + n + "]"); + } + for (var i = 0; i < n; i++) { + var w = (prog[++ip] << 8) | prog[++ip]; + if (w & 32768) { + w = -((w ^ 65535) + 1); + } + stack.push(w); + } + state.ip = ip; + } // MDRP[abcde] Move Direct Relative Point + // 0xD0-0xEF + // (if indirect is 0) + // + // and + // + // MIRP[abcde] Move Indirect Relative Point + // 0xE0-0xFF + // (if indirect is 1) + + function MDRP_MIRP(indirect, setRp0, keepD, ro, dt, state) { + var stack = state.stack; + var cvte = indirect && stack.pop(); + var pi = stack.pop(); + var rp0i = state.rp0; + var rp = state.z0[rp0i]; + var p = state.z1[pi]; + var md = state.minDis; + var fv = state.fv; + var pv = state.dpv; + var od; // original distance + var d; // moving distance + var sign; // sign of distance + var cv; + d = od = pv.distance(p, rp, true, true); + sign = d >= 0 ? 1 : -1; // Math.sign would be 0 in case of 0 + // TODO consider autoFlip + d = Math.abs(d); + if (indirect) { + cv = state.cvt[cvte]; + if (ro && Math.abs(d - cv) < state.cvCutIn) { + d = cv; + } + } + if (keepD && d < md) { + d = md; + } + if (ro) { + d = state.round(d); + } + fv.setRelative(p, rp, sign * d, pv); + fv.touch(p); + if (exports.DEBUG) { + console.log( + state.step, + (indirect ? "MIRP[" : "MDRP[") + + (setRp0 ? "M" : "m") + + (keepD ? ">" : "_") + + (ro ? "R" : "_") + + (dt === 0 + ? "Gr" + : dt === 1 + ? "Bl" + : dt === 2 + ? "Wh" + : "") + + "]", + indirect + ? cvte + "(" + state.cvt[cvte] + "," + cv + ")" + : "", + pi, + "(d =", + od, + "->", + sign * d, + ")", + ); + } + state.rp1 = state.rp0; + state.rp2 = pi; + if (setRp0) { + state.rp0 = pi; + } + } /* + * The instruction table. + */ + + instructionTable = [ + /* 0x00 */ SVTCA.bind(undefined, yUnitVector), + /* 0x01 */ SVTCA.bind(undefined, xUnitVector), + /* 0x02 */ SPVTCA.bind(undefined, yUnitVector), + /* 0x03 */ SPVTCA.bind(undefined, xUnitVector), + /* 0x04 */ SFVTCA.bind(undefined, yUnitVector), + /* 0x05 */ SFVTCA.bind(undefined, xUnitVector), + /* 0x06 */ SPVTL.bind(undefined, 0), + /* 0x07 */ SPVTL.bind(undefined, 1), + /* 0x08 */ SFVTL.bind(undefined, 0), + /* 0x09 */ SFVTL.bind(undefined, 1), + /* 0x0A */ SPVFS, + /* 0x0B */ SFVFS, + /* 0x0C */ GPV, + /* 0x0D */ GFV, + /* 0x0E */ SFVTPV, + /* 0x0F */ ISECT, + /* 0x10 */ SRP0, + /* 0x11 */ SRP1, + /* 0x12 */ SRP2, + /* 0x13 */ SZP0, + /* 0x14 */ SZP1, + /* 0x15 */ SZP2, + /* 0x16 */ SZPS, + /* 0x17 */ SLOOP, + /* 0x18 */ RTG, + /* 0x19 */ RTHG, + /* 0x1A */ SMD, + /* 0x1B */ ELSE, + /* 0x1C */ JMPR, + /* 0x1D */ SCVTCI, + /* 0x1E */ undefined, + // TODO SSWCI + /* 0x1F */ + undefined, + // TODO SSW + /* 0x20 */ + DUP, + /* 0x21 */ POP, + /* 0x22 */ CLEAR, + /* 0x23 */ SWAP, + /* 0x24 */ DEPTH, + /* 0x25 */ CINDEX, + /* 0x26 */ MINDEX, + /* 0x27 */ undefined, + // TODO ALIGNPTS + /* 0x28 */ + undefined, + /* 0x29 */ undefined, + // TODO UTP + /* 0x2A */ + LOOPCALL, + /* 0x2B */ CALL, + /* 0x2C */ FDEF, + /* 0x2D */ undefined, + // ENDF (eaten by FDEF) + /* 0x2E */ + MDAP.bind(undefined, 0), + /* 0x2F */ MDAP.bind(undefined, 1), + /* 0x30 */ IUP.bind(undefined, yUnitVector), + /* 0x31 */ IUP.bind(undefined, xUnitVector), + /* 0x32 */ SHP.bind(undefined, 0), + /* 0x33 */ SHP.bind(undefined, 1), + /* 0x34 */ SHC.bind(undefined, 0), + /* 0x35 */ SHC.bind(undefined, 1), + /* 0x36 */ SHZ.bind(undefined, 0), + /* 0x37 */ SHZ.bind(undefined, 1), + /* 0x38 */ SHPIX, + /* 0x39 */ IP, + /* 0x3A */ MSIRP.bind(undefined, 0), + /* 0x3B */ MSIRP.bind(undefined, 1), + /* 0x3C */ ALIGNRP, + /* 0x3D */ RTDG, + /* 0x3E */ MIAP.bind(undefined, 0), + /* 0x3F */ MIAP.bind(undefined, 1), + /* 0x40 */ NPUSHB, + /* 0x41 */ NPUSHW, + /* 0x42 */ WS, + /* 0x43 */ RS, + /* 0x44 */ WCVTP, + /* 0x45 */ RCVT, + /* 0x46 */ GC.bind(undefined, 0), + /* 0x47 */ GC.bind(undefined, 1), + /* 0x48 */ undefined, + // TODO SCFS + /* 0x49 */ + MD.bind(undefined, 0), + /* 0x4A */ MD.bind(undefined, 1), + /* 0x4B */ MPPEM, + /* 0x4C */ undefined, + // TODO MPS + /* 0x4D */ + FLIPON, + /* 0x4E */ undefined, + // TODO FLIPOFF + /* 0x4F */ + undefined, + // TODO DEBUG + /* 0x50 */ + LT, + /* 0x51 */ LTEQ, + /* 0x52 */ GT, + /* 0x53 */ GTEQ, + /* 0x54 */ EQ, + /* 0x55 */ NEQ, + /* 0x56 */ ODD, + /* 0x57 */ EVEN, + /* 0x58 */ IF, + /* 0x59 */ EIF, + /* 0x5A */ AND, + /* 0x5B */ OR, + /* 0x5C */ NOT, + /* 0x5D */ DELTAP123.bind(undefined, 1), + /* 0x5E */ SDB, + /* 0x5F */ SDS, + /* 0x60 */ ADD, + /* 0x61 */ SUB, + /* 0x62 */ DIV, + /* 0x63 */ MUL, + /* 0x64 */ ABS, + /* 0x65 */ NEG, + /* 0x66 */ FLOOR, + /* 0x67 */ CEILING, + /* 0x68 */ ROUND.bind(undefined, 0), + /* 0x69 */ ROUND.bind(undefined, 1), + /* 0x6A */ ROUND.bind(undefined, 2), + /* 0x6B */ ROUND.bind(undefined, 3), + /* 0x6C */ undefined, + // TODO NROUND[ab] + /* 0x6D */ + undefined, + // TODO NROUND[ab] + /* 0x6E */ + undefined, + // TODO NROUND[ab] + /* 0x6F */ + undefined, + // TODO NROUND[ab] + /* 0x70 */ + WCVTF, + /* 0x71 */ DELTAP123.bind(undefined, 2), + /* 0x72 */ DELTAP123.bind(undefined, 3), + /* 0x73 */ DELTAC123.bind(undefined, 1), + /* 0x74 */ DELTAC123.bind(undefined, 2), + /* 0x75 */ DELTAC123.bind(undefined, 3), + /* 0x76 */ SROUND, + /* 0x77 */ S45ROUND, + /* 0x78 */ undefined, + // TODO JROT[] + /* 0x79 */ + undefined, + // TODO JROF[] + /* 0x7A */ + ROFF, + /* 0x7B */ undefined, + /* 0x7C */ RUTG, + /* 0x7D */ RDTG, + /* 0x7E */ POP, + // actually SANGW, supposed to do only a pop though + /* 0x7F */ + POP, + // actually AA, supposed to do only a pop though + /* 0x80 */ + undefined, + // TODO FLIPPT + /* 0x81 */ + undefined, + // TODO FLIPRGON + /* 0x82 */ + undefined, + // TODO FLIPRGOFF + /* 0x83 */ + undefined, + /* 0x84 */ undefined, + /* 0x85 */ SCANCTRL, + /* 0x86 */ SDPVTL.bind(undefined, 0), + /* 0x87 */ SDPVTL.bind(undefined, 1), + /* 0x88 */ GETINFO, + /* 0x89 */ undefined, + // TODO IDEF + /* 0x8A */ + ROLL, + /* 0x8B */ MAX, + /* 0x8C */ MIN, + /* 0x8D */ SCANTYPE, + /* 0x8E */ INSTCTRL, + /* 0x8F */ undefined, + /* 0x90 */ undefined, + /* 0x91 */ undefined, + /* 0x92 */ undefined, + /* 0x93 */ undefined, + /* 0x94 */ undefined, + /* 0x95 */ undefined, + /* 0x96 */ undefined, + /* 0x97 */ undefined, + /* 0x98 */ undefined, + /* 0x99 */ undefined, + /* 0x9A */ undefined, + /* 0x9B */ undefined, + /* 0x9C */ undefined, + /* 0x9D */ undefined, + /* 0x9E */ undefined, + /* 0x9F */ undefined, + /* 0xA0 */ undefined, + /* 0xA1 */ undefined, + /* 0xA2 */ undefined, + /* 0xA3 */ undefined, + /* 0xA4 */ undefined, + /* 0xA5 */ undefined, + /* 0xA6 */ undefined, + /* 0xA7 */ undefined, + /* 0xA8 */ undefined, + /* 0xA9 */ undefined, + /* 0xAA */ undefined, + /* 0xAB */ undefined, + /* 0xAC */ undefined, + /* 0xAD */ undefined, + /* 0xAE */ undefined, + /* 0xAF */ undefined, + /* 0xB0 */ PUSHB.bind(undefined, 1), + /* 0xB1 */ PUSHB.bind(undefined, 2), + /* 0xB2 */ PUSHB.bind(undefined, 3), + /* 0xB3 */ PUSHB.bind(undefined, 4), + /* 0xB4 */ PUSHB.bind(undefined, 5), + /* 0xB5 */ PUSHB.bind(undefined, 6), + /* 0xB6 */ PUSHB.bind(undefined, 7), + /* 0xB7 */ PUSHB.bind(undefined, 8), + /* 0xB8 */ PUSHW.bind(undefined, 1), + /* 0xB9 */ PUSHW.bind(undefined, 2), + /* 0xBA */ PUSHW.bind(undefined, 3), + /* 0xBB */ PUSHW.bind(undefined, 4), + /* 0xBC */ PUSHW.bind(undefined, 5), + /* 0xBD */ PUSHW.bind(undefined, 6), + /* 0xBE */ PUSHW.bind(undefined, 7), + /* 0xBF */ PUSHW.bind(undefined, 8), + /* 0xC0 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 0), + /* 0xC1 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 1), + /* 0xC2 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 2), + /* 0xC3 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 3), + /* 0xC4 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 0), + /* 0xC5 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 1), + /* 0xC6 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 2), + /* 0xC7 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 3), + /* 0xC8 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 0), + /* 0xC9 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 1), + /* 0xCA */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 2), + /* 0xCB */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 3), + /* 0xCC */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 0), + /* 0xCD */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 1), + /* 0xCE */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 2), + /* 0xCF */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 3), + /* 0xD0 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 0), + /* 0xD1 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 1), + /* 0xD2 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 2), + /* 0xD3 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 3), + /* 0xD4 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 0), + /* 0xD5 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 1), + /* 0xD6 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 2), + /* 0xD7 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 3), + /* 0xD8 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 0), + /* 0xD9 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 1), + /* 0xDA */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 2), + /* 0xDB */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 3), + /* 0xDC */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 0), + /* 0xDD */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 1), + /* 0xDE */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 2), + /* 0xDF */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 3), + /* 0xE0 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 0), + /* 0xE1 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 1), + /* 0xE2 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 2), + /* 0xE3 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 3), + /* 0xE4 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 0), + /* 0xE5 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 1), + /* 0xE6 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 2), + /* 0xE7 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 3), + /* 0xE8 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 0), + /* 0xE9 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 1), + /* 0xEA */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 2), + /* 0xEB */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 3), + /* 0xEC */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 0), + /* 0xED */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 1), + /* 0xEE */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 2), + /* 0xEF */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 3), + /* 0xF0 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 0), + /* 0xF1 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 1), + /* 0xF2 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 2), + /* 0xF3 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 3), + /* 0xF4 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 0), + /* 0xF5 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 1), + /* 0xF6 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 2), + /* 0xF7 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 3), + /* 0xF8 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 0), + /* 0xF9 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 1), + /* 0xFA */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 2), + /* 0xFB */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 3), + /* 0xFC */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 0), + /* 0xFD */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 1), + /* 0xFE */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 2), + /* 0xFF */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 3), + ]; + /***************************** + Mathematical Considerations + ****************************** + fv ... refers to freedom vector + pv ... refers to projection vector + rp ... refers to reference point + p ... refers to to point being operated on + d ... refers to distance + SETRELATIVE: + ============ + case freedom vector == x-axis: + ------------------------------ + (pv) + .-' + rpd .-' + .-* + d .-'90°' + .-' ' + .-' ' + *-' ' b + rp ' + ' + ' + p *----------*-------------- (fv) + pm + rpdx = rpx + d * pv.x + rpdy = rpy + d * pv.y + equation of line b + y - rpdy = pvns * (x- rpdx) + y = p.y + x = rpdx + ( p.y - rpdy ) / pvns + + case freedom vector == y-axis: + ------------------------------ + * pm + |\ + | \ + | \ + | \ + | \ + | \ + | \ + | \ + | \ + | \ b + | \ + | \ + | \ .-' (pv) + | 90° \.-' + | .-'* rpd + | .-' + * *-' d + p rp + rpdx = rpx + d * pv.x + rpdy = rpy + d * pv.y + equation of line b: + pvns ... normal slope to pv + y - rpdy = pvns * (x - rpdx) + x = p.x + y = rpdy + pvns * (p.x - rpdx) + + generic case: + ------------- + + .'(fv) + .' + .* pm + .' ! + .' . + .' ! + .' . b + .' ! + * . + p ! + 90° . ... (pv) + ...-*-''' + ...---''' rpd + ...---''' d + *--''' + rp + rpdx = rpx + d * pv.x + rpdy = rpy + d * pv.y + equation of line b: + pvns... normal slope to pv + y - rpdy = pvns * (x - rpdx) + equation of freedom vector line: + fvs ... slope of freedom vector (=fy/fx) + y - py = fvs * (x - px) + + on pm both equations are true for same x/y + y - rpdy = pvns * (x - rpdx) + y - py = fvs * (x - px) + form to y and set equal: + pvns * (x - rpdx) + rpdy = fvs * (x - px) + py + expand: + pvns * x - pvns * rpdx + rpdy = fvs * x - fvs * px + py + switch: + fvs * x - fvs * px + py = pvns * x - pvns * rpdx + rpdy + solve for x: + fvs * x - pvns * x = fvs * px - pvns * rpdx - py + rpdy + + fvs * px - pvns * rpdx + rpdy - py + x = ----------------------------------- + fvs - pvns + and: + y = fvs * (x - px) + py + + INTERPOLATE: + ============ + Examples of point interpolation. + The weight of the movement of the reference point gets bigger + the further the other reference point is away, thus the safest + option (that is avoiding 0/0 divisions) is to weight the + original distance of the other point by the sum of both distances. + If the sum of both distances is 0, then move the point by the + arithmetic average of the movement of both reference points. + + + (+6) + rp1o *---->*rp1 + . . (+12) + . . rp2o *---------->* rp2 + . . . . + . . . . + . 10 20 . . + |.........|...................| . + . . . + . . (+8) . + po *------>*p . + . . . + . 12 . 24 . + |...........|.......................| + 36 + + ------- + + (+10) + rp1o *-------->*rp1 + . . (-10) + . . rp2 *<---------* rpo2 + . . . . + . . . . + . 10 . 30 . . + |.........|.............................| + . . + . (+5) . + po *--->* p . + . . . + . . 20 . + |....|..............| + 5 15 + + ------- + + (+10) + rp1o *-------->*rp1 + . . + . . + rp2o *-------->*rp2 + + (+10) + po *-------->* p + ------- + + (+10) + rp1o *-------->*rp1 + . . + . .(+30) + rp2o *---------------------------->*rp2 + + (+25) + po *----------------------->* p + + vim: set ts=4 sw=4 expandtab: + *****/ + // The Font object + // This code is based on Array.from implementation for strings in https://github.com/mathiasbynens/Array.from + var arrayFromString = + Array.from || + function (s) { + return ( + s.match( + /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g, + ) || [] + ); + }; + /** + * @typedef FontOptions + * @type Object + * @property {Boolean} empty - whether to create a new empty font + * @property {string} familyName + * @property {string} styleName + * @property {string=} fullName + * @property {string=} postScriptName + * @property {string=} designer + * @property {string=} designerURL + * @property {string=} manufacturer + * @property {string=} manufacturerURL + * @property {string=} license + * @property {string=} licenseURL + * @property {string=} version + * @property {string=} description + * @property {string=} copyright + * @property {string=} trademark + * @property {Number} unitsPerEm + * @property {Number} ascender + * @property {Number} descender + * @property {Number} createdTimestamp + * @property {string=} weightClass + * @property {string=} widthClass + * @property {string=} fsSelection + */ + /** + * A Font represents a loaded OpenType font file. + * It contains a set of glyphs and methods to draw text on a drawing context, + * or to get a path representing the text. + * @exports opentype.Font + * @class + * @param {FontOptions} + * @constructor + */ + function Font(options) { + options = options || {}; + if (!options.empty) { + // Check that we've provided the minimum set of names. + checkArgument( + options.familyName, + "When creating a new Font object, familyName is required.", + ); + checkArgument( + options.styleName, + "When creating a new Font object, styleName is required.", + ); + checkArgument( + options.unitsPerEm, + "When creating a new Font object, unitsPerEm is required.", + ); + checkArgument( + options.ascender, + "When creating a new Font object, ascender is required.", + ); + checkArgument( + options.descender, + "When creating a new Font object, descender is required.", + ); + checkArgument( + options.descender < 0, + "Descender should be negative (e.g. -512).", + ); + // OS X will complain if the names are empty, so we put a single space everywhere by default. + this.names = { + fontFamily: { + en: options.familyName || " ", + }, + fontSubfamily: { + en: options.styleName || " ", + }, + fullName: { + en: + options.fullName || + options.familyName + " " + options.styleName, + }, + // postScriptName may not contain any whitespace + postScriptName: { + en: + options.postScriptName || + (options.familyName + options.styleName).replace( + /\s/g, + "", + ), + }, + designer: { + en: options.designer || " ", + }, + designerURL: { + en: options.designerURL || " ", + }, + manufacturer: { + en: options.manufacturer || " ", + }, + manufacturerURL: { + en: options.manufacturerURL || " ", + }, + license: { + en: options.license || " ", + }, + licenseURL: { + en: options.licenseURL || " ", + }, + version: { + en: options.version || "Version 0.1", + }, + description: { + en: options.description || " ", + }, + copyright: { + en: options.copyright || " ", + }, + trademark: { + en: options.trademark || " ", + }, + }; + this.unitsPerEm = options.unitsPerEm || 1000; + this.ascender = options.ascender; + this.descender = options.descender; + this.createdTimestamp = options.createdTimestamp; + this.tables = { + os2: { + usWeightClass: + options.weightClass || this.usWeightClasses.MEDIUM, + usWidthClass: + options.widthClass || this.usWidthClasses.MEDIUM, + fsSelection: + options.fsSelection || this.fsSelectionValues.REGULAR, + }, + }; + } + this.supported = true; // Deprecated: parseBuffer will throw an error if font is not supported. + this.glyphs = new glyphset.GlyphSet(this, options.glyphs || []); + this.encoding = new DefaultEncoding(this); + this.position = new Position(this); + this.substitution = new Substitution(this); + this.tables = this.tables || {}; + Object.defineProperty(this, "hinting", { + get: function () { + if (this._hinting) { + return this._hinting; + } + if (this.outlinesFormat === "truetype") { + return (this._hinting = new Hinting(this)); + } + }, + }); + } /** + * Check if the font has a glyph for the given character. + * @param {string} + * @return {Boolean} + */ + + Font.prototype.hasChar = function (c) { + return this.encoding.charToGlyphIndex(c) !== null; + }; + /** + * Convert the given character to a single glyph index. + * Note that this function assumes that there is a one-to-one mapping between + * the given character and a glyph; for complex scripts this might not be the case. + * @param {string} + * @return {Number} + */ + Font.prototype.charToGlyphIndex = function (s) { + return this.encoding.charToGlyphIndex(s); + }; + /** + * Convert the given character to a single Glyph object. + * Note that this function assumes that there is a one-to-one mapping between + * the given character and a glyph; for complex scripts this might not be the case. + * @param {string} + * @return {opentype.Glyph} + */ + Font.prototype.charToGlyph = function (c) { + var glyphIndex = this.charToGlyphIndex(c); + var glyph = this.glyphs.get(glyphIndex); + if (!glyph) { + // .notdef + glyph = this.glyphs.get(0); + } + return glyph; + }; + /** + * Convert the given text to a list of Glyph objects. + * Note that there is no strict one-to-one mapping between characters and + * glyphs, so the list of returned glyphs can be larger or smaller than the + * length of the given string. + * @param {string} + * @param {GlyphRenderOptions} [options] + * @return {opentype.Glyph[]} + */ + Font.prototype.stringToGlyphs = function (s, options) { + var this$1 = this; + options = options || this.defaultRenderOptions; + // Get glyph indexes + var chars = arrayFromString(s); + var indexes = []; + for (var i = 0; i < chars.length; i += 1) { + var c = chars[i]; + indexes.push(this$1.charToGlyphIndex(c)); + } + var length = indexes.length; + // Apply substitutions on glyph indexes + if (options.features) { + var script = + options.script || this.substitution.getDefaultScriptName(); + var manyToOne = []; + if (options.features.liga) { + manyToOne = manyToOne.concat( + this.substitution.getFeature( + "liga", + script, + options.language, + ), + ); + } + if (options.features.rlig) { + manyToOne = manyToOne.concat( + this.substitution.getFeature( + "rlig", + script, + options.language, + ), + ); + } + for (var i$1 = 0; i$1 < length; i$1 += 1) { + for (var j = 0; j < manyToOne.length; j++) { + var ligature = manyToOne[j]; + var components = ligature.sub; + var compCount = components.length; + var k = 0; + while ( + k < compCount && + components[k] === indexes[i$1 + k] + ) { + k++; + } + if (k === compCount) { + indexes.splice(i$1, compCount, ligature.by); + length = length - compCount + 1; + } + } + } + } // convert glyph indexes to glyph objects + + var glyphs = new Array(length); + var notdef = this.glyphs.get(0); + for (var i$2 = 0; i$2 < length; i$2 += 1) { + glyphs[i$2] = this$1.glyphs.get(indexes[i$2]) || notdef; + } + return glyphs; + }; + /** + * @param {string} + * @return {Number} + */ + Font.prototype.nameToGlyphIndex = function (name) { + return this.glyphNames.nameToGlyphIndex(name); + }; + /** + * @param {string} + * @return {opentype.Glyph} + */ + Font.prototype.nameToGlyph = function (name) { + var glyphIndex = this.nameToGlyphIndex(name); + var glyph = this.glyphs.get(glyphIndex); + if (!glyph) { + // .notdef + glyph = this.glyphs.get(0); + } + return glyph; + }; + /** + * @param {Number} + * @return {String} + */ + Font.prototype.glyphIndexToName = function (gid) { + if (!this.glyphNames.glyphIndexToName) { + return ""; + } + return this.glyphNames.glyphIndexToName(gid); + }; + /** + * Retrieve the value of the kerning pair between the left glyph (or its index) + * and the right glyph (or its index). If no kerning pair is found, return 0. + * The kerning value gets added to the advance width when calculating the spacing + * between glyphs. + * For GPOS kerning, this method uses the default script and language, which covers + * most use cases. To have greater control, use font.position.getKerningValue . + * @param {opentype.Glyph} leftGlyph + * @param {opentype.Glyph} rightGlyph + * @return {Number} + */ + Font.prototype.getKerningValue = function ( + leftGlyph, + rightGlyph, + ) { + leftGlyph = leftGlyph.index || leftGlyph; + rightGlyph = rightGlyph.index || rightGlyph; + var gposKerning = this.position.defaultKerningTables; + if (gposKerning) { + return this.position.getKerningValue( + gposKerning, + leftGlyph, + rightGlyph, + ); + } // "kern" table + + return this.kerningPairs[leftGlyph + "," + rightGlyph] || 0; + }; + /** + * @typedef GlyphRenderOptions + * @type Object + * @property {string} [script] - script used to determine which features to apply. By default, 'DFLT' or 'latn' is used. + * See https://www.microsoft.com/typography/otspec/scripttags.htm + * @property {string} [language='dflt'] - language system used to determine which features to apply. + * See https://www.microsoft.com/typography/developers/opentype/languagetags.aspx + * @property {boolean} [kerning=true] - whether to include kerning values + * @property {object} [features] - OpenType Layout feature tags. Used to enable or disable the features of the given script/language system. + * See https://www.microsoft.com/typography/otspec/featuretags.htm + */ + Font.prototype.defaultRenderOptions = { + kerning: true, + features: { + liga: true, + rlig: true, + }, + }; + /** + * Helper function that invokes the given callback for each glyph in the given text. + * The callback gets `(glyph, x, y, fontSize, options)`.* @param {string} text + * @param {string} text - The text to apply. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @param {Function} callback + */ + Font.prototype.forEachGlyph = function ( + text, + x, + y, + fontSize, + options, + callback, + ) { + var this$1 = this; + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 72; + options = options || this.defaultRenderOptions; + var fontScale = (1 / this.unitsPerEm) * fontSize; + var glyphs = this.stringToGlyphs(text, options); + var kerningLookups; + if (options.kerning) { + var script = + options.script || this.position.getDefaultScriptName(); + kerningLookups = this.position.getKerningTables( + script, + options.language, + ); + } + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs[i]; + callback.call(this$1, glyph, x, y, fontSize, options); + if (glyph.advanceWidth) { + x += glyph.advanceWidth * fontScale; + } + if (options.kerning && i < glyphs.length - 1) { + // We should apply position adjustment lookups in a more generic way. + // Here we only use the xAdvance value. + var kerningValue = kerningLookups + ? this$1.position.getKerningValue( + kerningLookups, + glyph.index, + glyphs[i + 1].index, + ) + : this$1.getKerningValue(glyph, glyphs[i + 1]); + x += kerningValue * fontScale; + } + if (options.letterSpacing) { + x += options.letterSpacing * fontSize; + } else if (options.tracking) { + x += (options.tracking / 1000) * fontSize; + } + } + return x; + }; + /** + * Create a Path object that represents the given text. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @return {opentype.Path} + */ + Font.prototype.getPath = function ( + text, + x, + y, + fontSize, + options, + ) { + var fullPath = new Path(); + this.forEachGlyph( + text, + x, + y, + fontSize, + options, + function (glyph, gX, gY, gFontSize) { + var glyphPath = glyph.getPath( + gX, + gY, + gFontSize, + options, + this, + ); + fullPath.extend(glyphPath); + }, + ); + return fullPath; + }; + /** + * Create an array of Path objects that represent the glyphs of a given text. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @return {opentype.Path[]} + */ + Font.prototype.getPaths = function ( + text, + x, + y, + fontSize, + options, + ) { + var glyphPaths = []; + this.forEachGlyph( + text, + x, + y, + fontSize, + options, + function (glyph, gX, gY, gFontSize) { + var glyphPath = glyph.getPath( + gX, + gY, + gFontSize, + options, + this, + ); + glyphPaths.push(glyphPath); + }, + ); + return glyphPaths; + }; + /** + * Returns the advance width of a text. + * + * This is something different than Path.getBoundingBox() as for example a + * suffixed whitespace increases the advanceWidth but not the bounding box + * or an overhanging letter like a calligraphic 'f' might have a quite larger + * bounding box than its advance width. + * + * This corresponds to canvas2dContext.measureText(text).width + * + * @param {string} text - The text to create. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @return advance width + */ + Font.prototype.getAdvanceWidth = function ( + text, + fontSize, + options, + ) { + return this.forEachGlyph( + text, + 0, + 0, + fontSize, + options, + function () {}, + ); + }; + /** + * Draw the text on the given drawing context. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + */ + Font.prototype.draw = function ( + ctx, + text, + x, + y, + fontSize, + options, + ) { + this.getPath(text, x, y, fontSize, options).draw(ctx); + }; + /** + * Draw the points of all glyphs in the text. + * On-curve points will be drawn in blue, off-curve points will be drawn in red. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + */ + Font.prototype.drawPoints = function ( + ctx, + text, + x, + y, + fontSize, + options, + ) { + this.forEachGlyph( + text, + x, + y, + fontSize, + options, + function (glyph, gX, gY, gFontSize) { + glyph.drawPoints(ctx, gX, gY, gFontSize); + }, + ); + }; + /** + * Draw lines indicating important font measurements for all glyphs in the text. + * Black lines indicate the origin of the coordinate system (point 0,0). + * Blue lines indicate the glyph bounding box. + * Green line indicates the advance width of the glyph. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + */ + Font.prototype.drawMetrics = function ( + ctx, + text, + x, + y, + fontSize, + options, + ) { + this.forEachGlyph( + text, + x, + y, + fontSize, + options, + function (glyph, gX, gY, gFontSize) { + glyph.drawMetrics(ctx, gX, gY, gFontSize); + }, + ); + }; + /** + * @param {string} + * @return {string} + */ + Font.prototype.getEnglishName = function (name) { + var translations = this.names[name]; + if (translations) { + return translations.en; + } + }; + /** + * Validate + */ + Font.prototype.validate = function () { + var _this = this; + function assert(predicate, message) {} + function assertNamePresent(name) { + var englishName = _this.getEnglishName(name); + assert( + englishName && englishName.trim().length > 0, + "No English " + name + " specified.", + ); + } // Identification information + + assertNamePresent("fontFamily"); + assertNamePresent("weightName"); + assertNamePresent("manufacturer"); + assertNamePresent("copyright"); + assertNamePresent("version"); + // Dimension information + assert(this.unitsPerEm > 0, "No unitsPerEm specified."); + }; + /** + * Convert the font object to a SFNT data structure. + * This structure contains all the necessary tables and metadata to create a binary OTF file. + * @return {opentype.Table} + */ + Font.prototype.toTables = function () { + return sfnt.fontToTable(this); + }; + /** + * @deprecated Font.toBuffer is deprecated. Use Font.toArrayBuffer instead. + */ + Font.prototype.toBuffer = function () { + console.warn( + "Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.", + ); + return this.toArrayBuffer(); + }; + /** + * Converts a `opentype.Font` into an `ArrayBuffer` + * @return {ArrayBuffer} + */ + Font.prototype.toArrayBuffer = function () { + var sfntTable = this.toTables(); + var bytes = sfntTable.encode(); + var buffer = new ArrayBuffer(bytes.length); + var intArray = new Uint8Array(buffer); + for (var i = 0; i < bytes.length; i++) { + intArray[i] = bytes[i]; + } + return buffer; + }; + /** + * Initiate a download of the OpenType font. + */ + Font.prototype.download = function (fileName) { + var familyName = this.getEnglishName("fontFamily"); + var styleName = this.getEnglishName("fontSubfamily"); + fileName = + fileName || + familyName.replace(/\s/g, "") + "-" + styleName + ".otf"; + var arrayBuffer = this.toArrayBuffer(); + if (isBrowser()) { + window.requestFileSystem = + window.requestFileSystem || window.webkitRequestFileSystem; + window.requestFileSystem( + window.TEMPORARY, + arrayBuffer.byteLength, + function (fs) { + fs.root.getFile( + fileName, + { + create: true, + }, + function (fileEntry) { + fileEntry.createWriter(function (writer) { + var dataView = new DataView(arrayBuffer); + var blob = new Blob([dataView], { + type: "font/opentype", + }); + writer.write(blob); + writer.addEventListener( + "writeend", + function () { + // Navigating to the file will download it. + location.href = fileEntry.toURL(); + }, + false, + ); + }); + }, + ); + }, + function (err) { + throw new Error(err.name + ": " + err.message); + }, + ); + } else { + var fs = _dereq_("fs"); + var buffer = arrayBufferToNodeBuffer(arrayBuffer); + fs.writeFileSync(fileName, buffer); + } + }; + /** + * @private + */ + Font.prototype.fsSelectionValues = { + ITALIC: 1, + //1 + UNDERSCORE: 2, + //2 + NEGATIVE: 4, + //4 + OUTLINED: 8, + //8 + STRIKEOUT: 16, + //16 + BOLD: 32, + //32 + REGULAR: 64, + //64 + USER_TYPO_METRICS: 128, + //128 + WWS: 256, + //256 + OBLIQUE: 512, //512 + }; + /** + * @private + */ + Font.prototype.usWidthClasses = { + ULTRA_CONDENSED: 1, + EXTRA_CONDENSED: 2, + CONDENSED: 3, + SEMI_CONDENSED: 4, + MEDIUM: 5, + SEMI_EXPANDED: 6, + EXPANDED: 7, + EXTRA_EXPANDED: 8, + ULTRA_EXPANDED: 9, + }; + /** + * @private + */ + Font.prototype.usWeightClasses = { + THIN: 100, + EXTRA_LIGHT: 200, + LIGHT: 300, + NORMAL: 400, + MEDIUM: 500, + SEMI_BOLD: 600, + BOLD: 700, + EXTRA_BOLD: 800, + BLACK: 900, + }; + // The `fvar` table stores font variation axes and instances. + function addName(name, names) { + var nameString = JSON.stringify(name); + var nameID = 256; + for (var nameKey in names) { + var n = parseInt(nameKey); + if (!n || n < 256) { + continue; + } + if (JSON.stringify(names[nameKey]) === nameString) { + return n; + } + if (nameID <= n) { + nameID = n + 1; + } + } + names[nameID] = name; + return nameID; + } + function makeFvarAxis(n, axis, names) { + var nameID = addName(axis.name, names); + return [ + { + name: "tag_" + n, + type: "TAG", + value: axis.tag, + }, + { + name: "minValue_" + n, + type: "FIXED", + value: axis.minValue << 16, + }, + { + name: "defaultValue_" + n, + type: "FIXED", + value: axis.defaultValue << 16, + }, + { + name: "maxValue_" + n, + type: "FIXED", + value: axis.maxValue << 16, + }, + { + name: "flags_" + n, + type: "USHORT", + value: 0, + }, + { + name: "nameID_" + n, + type: "USHORT", + value: nameID, + }, + ]; + } + function parseFvarAxis(data, start, names) { + var axis = {}; + var p = new parse.Parser(data, start); + axis.tag = p.parseTag(); + axis.minValue = p.parseFixed(); + axis.defaultValue = p.parseFixed(); + axis.maxValue = p.parseFixed(); + p.skip("uShort", 1); // reserved for flags; no values defined + axis.name = names[p.parseUShort()] || {}; + return axis; + } + function makeFvarInstance(n, inst, axes, names) { + var nameID = addName(inst.name, names); + var fields = [ + { + name: "nameID_" + n, + type: "USHORT", + value: nameID, + }, + { + name: "flags_" + n, + type: "USHORT", + value: 0, + }, + ]; + for (var i = 0; i < axes.length; ++i) { + var axisTag = axes[i].tag; + fields.push({ + name: "axis_" + n + " " + axisTag, + type: "FIXED", + value: inst.coordinates[axisTag] << 16, + }); + } + return fields; + } + function parseFvarInstance(data, start, axes, names) { + var inst = {}; + var p = new parse.Parser(data, start); + inst.name = names[p.parseUShort()] || {}; + p.skip("uShort", 1); // reserved for flags; no values defined + inst.coordinates = {}; + for (var i = 0; i < axes.length; ++i) { + inst.coordinates[axes[i].tag] = p.parseFixed(); + } + return inst; + } + function makeFvarTable(fvar, names) { + var result = new table.Table("fvar", [ + { + name: "version", + type: "ULONG", + value: 65536, + }, + { + name: "offsetToData", + type: "USHORT", + value: 0, + }, + { + name: "countSizePairs", + type: "USHORT", + value: 2, + }, + { + name: "axisCount", + type: "USHORT", + value: fvar.axes.length, + }, + { + name: "axisSize", + type: "USHORT", + value: 20, + }, + { + name: "instanceCount", + type: "USHORT", + value: fvar.instances.length, + }, + { + name: "instanceSize", + type: "USHORT", + value: 4 + fvar.axes.length * 4, + }, + ]); + result.offsetToData = result.sizeOf(); + for (var i = 0; i < fvar.axes.length; i++) { + result.fields = result.fields.concat( + makeFvarAxis(i, fvar.axes[i], names), + ); + } + for (var j = 0; j < fvar.instances.length; j++) { + result.fields = result.fields.concat( + makeFvarInstance(j, fvar.instances[j], fvar.axes, names), + ); + } + return result; + } + function parseFvarTable(data, start, names) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseULong(); + check.argument( + tableVersion === 65536, + "Unsupported fvar table version.", + ); + var offsetToData = p.parseOffset16(); + // Skip countSizePairs. + p.skip("uShort", 1); + var axisCount = p.parseUShort(); + var axisSize = p.parseUShort(); + var instanceCount = p.parseUShort(); + var instanceSize = p.parseUShort(); + var axes = []; + for (var i = 0; i < axisCount; i++) { + axes.push( + parseFvarAxis( + data, + start + offsetToData + i * axisSize, + names, + ), + ); + } + var instances = []; + var instanceStart = start + offsetToData + axisCount * axisSize; + for (var j = 0; j < instanceCount; j++) { + instances.push( + parseFvarInstance( + data, + instanceStart + j * instanceSize, + axes, + names, + ), + ); + } + return { + axes: axes, + instances: instances, + }; + } + var fvar = { + make: makeFvarTable, + parse: parseFvarTable, + }; + // The `GPOS` table contains kerning pairs, among other things. + var subtableParsers$1 = new Array(10); // subtableParsers[0] is unused + // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-1-single-adjustment-positioning-subtable + // this = Parser instance + subtableParsers$1[1] = function parseLookup1() { + var start = this.offset + this.relativeOffset; + var posformat = this.parseUShort(); + if (posformat === 1) { + return { + posFormat: 1, + coverage: this.parsePointer(Parser.coverage), + value: this.parseValueRecord(), + }; + } else if (posformat === 2) { + return { + posFormat: 2, + coverage: this.parsePointer(Parser.coverage), + values: this.parseValueRecordList(), + }; + } + check.assert( + false, + "0x" + + start.toString(16) + + ": GPOS lookup type 1 format must be 1 or 2.", + ); + }; + // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-2-pair-adjustment-positioning-subtable + subtableParsers$1[2] = function parseLookup2() { + var start = this.offset + this.relativeOffset; + var posFormat = this.parseUShort(); + check.assert( + posFormat === 1 || posFormat === 2, + "0x" + + start.toString(16) + + ": GPOS lookup type 2 format must be 1 or 2.", + ); + var coverage = this.parsePointer(Parser.coverage); + var valueFormat1 = this.parseUShort(); + var valueFormat2 = this.parseUShort(); + if (posFormat === 1) { + // Adjustments for Glyph Pairs + return { + posFormat: posFormat, + coverage: coverage, + valueFormat1: valueFormat1, + valueFormat2: valueFormat2, + pairSets: this.parseList( + Parser.pointer( + Parser.list(function () { + return { + // pairValueRecord + secondGlyph: this.parseUShort(), + value1: this.parseValueRecord(valueFormat1), + value2: this.parseValueRecord(valueFormat2), + }; + }), + ), + ), + }; + } else if (posFormat === 2) { + var classDef1 = this.parsePointer(Parser.classDef); + var classDef2 = this.parsePointer(Parser.classDef); + var class1Count = this.parseUShort(); + var class2Count = this.parseUShort(); + return { + // Class Pair Adjustment + posFormat: posFormat, + coverage: coverage, + valueFormat1: valueFormat1, + valueFormat2: valueFormat2, + classDef1: classDef1, + classDef2: classDef2, + class1Count: class1Count, + class2Count: class2Count, + classRecords: this.parseList( + class1Count, + Parser.list(class2Count, function () { + return { + value1: this.parseValueRecord(valueFormat1), + value2: this.parseValueRecord(valueFormat2), + }; + }), + ), + }; + } + }; + subtableParsers$1[3] = function parseLookup3() { + return { + error: "GPOS Lookup 3 not supported", + }; + }; + subtableParsers$1[4] = function parseLookup4() { + return { + error: "GPOS Lookup 4 not supported", + }; + }; + subtableParsers$1[5] = function parseLookup5() { + return { + error: "GPOS Lookup 5 not supported", + }; + }; + subtableParsers$1[6] = function parseLookup6() { + return { + error: "GPOS Lookup 6 not supported", + }; + }; + subtableParsers$1[7] = function parseLookup7() { + return { + error: "GPOS Lookup 7 not supported", + }; + }; + subtableParsers$1[8] = function parseLookup8() { + return { + error: "GPOS Lookup 8 not supported", + }; + }; + subtableParsers$1[9] = function parseLookup9() { + return { + error: "GPOS Lookup 9 not supported", + }; + }; + // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos + function parseGposTable(data, start) { + start = start || 0; + var p = new Parser(data, start); + var tableVersion = p.parseVersion(1); + check.argument( + tableVersion === 1 || tableVersion === 1.1, + "Unsupported GPOS table version " + tableVersion, + ); + if (tableVersion === 1) { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers$1), + }; + } else { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers$1), + variations: p.parseFeatureVariationsList(), + }; + } + } // GPOS Writing ////////////////////////////////////////////// + // NOT SUPPORTED + + var subtableMakers$1 = new Array(10); + function makeGposTable(gpos) { + return new table.Table("GPOS", [ + { + name: "version", + type: "ULONG", + value: 65536, + }, + { + name: "scripts", + type: "TABLE", + value: new table.ScriptList(gpos.scripts), + }, + { + name: "features", + type: "TABLE", + value: new table.FeatureList(gpos.features), + }, + { + name: "lookups", + type: "TABLE", + value: new table.LookupList(gpos.lookups, subtableMakers$1), + }, + ]); + } + var gpos = { + parse: parseGposTable, + make: makeGposTable, + }; + // The `kern` table contains kerning pairs. + function parseWindowsKernTable(p) { + var pairs = {}; + // Skip nTables. + p.skip("uShort"); + var subtableVersion = p.parseUShort(); + check.argument( + subtableVersion === 0, + "Unsupported kern sub-table version.", + ); + // Skip subtableLength, subtableCoverage + p.skip("uShort", 2); + var nPairs = p.parseUShort(); + // Skip searchRange, entrySelector, rangeShift. + p.skip("uShort", 3); + for (var i = 0; i < nPairs; i += 1) { + var leftIndex = p.parseUShort(); + var rightIndex = p.parseUShort(); + var value = p.parseShort(); + pairs[leftIndex + "," + rightIndex] = value; + } + return pairs; + } + function parseMacKernTable(p) { + var pairs = {}; + // The Mac kern table stores the version as a fixed (32 bits) but we only loaded the first 16 bits. + // Skip the rest. + p.skip("uShort"); + var nTables = p.parseULong(); + //check.argument(nTables === 1, 'Only 1 subtable is supported (got ' + nTables + ').'); + if (nTables > 1) { + console.warn("Only the first kern subtable is supported."); + } + p.skip("uLong"); + var coverage = p.parseUShort(); + var subtableVersion = coverage & 255; + p.skip("uShort"); + if (subtableVersion === 0) { + var nPairs = p.parseUShort(); + // Skip searchRange, entrySelector, rangeShift. + p.skip("uShort", 3); + for (var i = 0; i < nPairs; i += 1) { + var leftIndex = p.parseUShort(); + var rightIndex = p.parseUShort(); + var value = p.parseShort(); + pairs[leftIndex + "," + rightIndex] = value; + } + } + return pairs; + } // Parse the `kern` table which contains kerning pairs. + + function parseKernTable(data, start) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseUShort(); + if (tableVersion === 0) { + return parseWindowsKernTable(p); + } else if (tableVersion === 1) { + return parseMacKernTable(p); + } else { + throw new Error( + "Unsupported kern table version (" + tableVersion + ").", + ); + } + } + var kern = { + parse: parseKernTable, + }; + // The `loca` table stores the offsets to the locations of the glyphs in the font. + // Parse the `loca` table. This table stores the offsets to the locations of the glyphs in the font, + // relative to the beginning of the glyphData table. + // The number of glyphs stored in the `loca` table is specified in the `maxp` table (under numGlyphs) + // The loca table has two versions: a short version where offsets are stored as uShorts, and a long + // version where offsets are stored as uLongs. The `head` table specifies which version to use + // (under indexToLocFormat). + function parseLocaTable(data, start, numGlyphs, shortVersion) { + var p = new parse.Parser(data, start); + var parseFn = shortVersion ? p.parseUShort : p.parseULong; + // There is an extra entry after the last index element to compute the length of the last glyph. + // That's why we use numGlyphs + 1. + var glyphOffsets = []; + for (var i = 0; i < numGlyphs + 1; i += 1) { + var glyphOffset = parseFn.call(p); + if (shortVersion) { + // The short table version stores the actual offset divided by 2. + glyphOffset *= 2; + } + glyphOffsets.push(glyphOffset); + } + return glyphOffsets; + } + var loca = { + parse: parseLocaTable, + }; + // opentype.js + /** + * The opentype library. + * @namespace opentype + */ + // File loaders ///////////////////////////////////////////////////////// + /** + * Loads a font from a file. The callback throws an error message as the first parameter if it fails + * and the font as an ArrayBuffer in the second parameter if it succeeds. + * @param {string} path - The path of the file + * @param {Function} callback - The function to call when the font load completes + */ + function loadFromFile(path, callback) { + var fs = _dereq_("fs"); + fs.readFile(path, function (err, buffer) { + if (err) { + return callback(err.message); + } + callback(null, nodeBufferToArrayBuffer(buffer)); + }); + } /** + * Loads a font from a URL. The callback throws an error message as the first parameter if it fails + * and the font as an ArrayBuffer in the second parameter if it succeeds. + * @param {string} url - The URL of the font file. + * @param {Function} callback - The function to call when the font load completes + */ + + function loadFromUrl(url, callback) { + var request = new XMLHttpRequest(); + request.open("get", url, true); + request.responseType = "arraybuffer"; + request.onload = function () { + if (request.response) { + return callback(null, request.response); + } else { + return callback( + "Font could not be loaded: " + request.statusText, + ); + } + }; + request.onerror = function () { + callback("Font could not be loaded"); + }; + request.send(); + } // Table Directory Entries ////////////////////////////////////////////// + /** + * Parses OpenType table entries. + * @param {DataView} + * @param {Number} + * @return {Object[]} + */ + + function parseOpenTypeTableEntries(data, numTables) { + var tableEntries = []; + var p = 12; + for (var i = 0; i < numTables; i += 1) { + var tag = parse.getTag(data, p); + var checksum = parse.getULong(data, p + 4); + var offset = parse.getULong(data, p + 8); + var length = parse.getULong(data, p + 12); + tableEntries.push({ + tag: tag, + checksum: checksum, + offset: offset, + length: length, + compression: false, + }); + p += 16; + } + return tableEntries; + } /** + * Parses WOFF table entries. + * @param {DataView} + * @param {Number} + * @return {Object[]} + */ + + function parseWOFFTableEntries(data, numTables) { + var tableEntries = []; + var p = 44; // offset to the first table directory entry. + for (var i = 0; i < numTables; i += 1) { + var tag = parse.getTag(data, p); + var offset = parse.getULong(data, p + 4); + var compLength = parse.getULong(data, p + 8); + var origLength = parse.getULong(data, p + 12); + var compression = void 0; + if (compLength < origLength) { + compression = "WOFF"; + } else { + compression = false; + } + tableEntries.push({ + tag: tag, + offset: offset, + compression: compression, + compressedLength: compLength, + length: origLength, + }); + p += 20; + } + return tableEntries; + } + /** + * @typedef TableData + * @type Object + * @property {DataView} data - The DataView + * @property {number} offset - The data offset. + */ + /** + * @param {DataView} + * @param {Object} + * @return {TableData} + */ + + function uncompressTable(data, tableEntry) { + if (tableEntry.compression === "WOFF") { + var inBuffer = new Uint8Array( + data.buffer, + tableEntry.offset + 2, + tableEntry.compressedLength - 2, + ); + var outBuffer = new Uint8Array(tableEntry.length); + tinyInflate(inBuffer, outBuffer); + if (outBuffer.byteLength !== tableEntry.length) { + throw new Error( + "Decompression error: " + + tableEntry.tag + + " decompressed length doesn't match recorded length", + ); + } + var view = new DataView(outBuffer.buffer, 0); + return { + data: view, + offset: 0, + }; + } else { + return { + data: data, + offset: tableEntry.offset, + }; + } + } // Public API /////////////////////////////////////////////////////////// + /** + * Parse the OpenType file data (as an ArrayBuffer) and return a Font object. + * Throws an error if the font could not be parsed. + * @param {ArrayBuffer} + * @return {opentype.Font} + */ + + function parseBuffer(buffer) { + var indexToLocFormat; + var ltagTable; + // Since the constructor can also be called to create new fonts from scratch, we indicate this + // should be an empty font that we'll fill with our own data. + var font = new Font({ + empty: true, + }); + // OpenType fonts use big endian byte ordering. + // We can't rely on typed array view types, because they operate with the endianness of the host computer. + // Instead we use DataViews where we can specify endianness. + var data = new DataView(buffer, 0); + var numTables; + var tableEntries = []; + var signature = parse.getTag(data, 0); + if ( + signature === String.fromCharCode(0, 1, 0, 0) || + signature === "true" || + signature === "typ1" + ) { + font.outlinesFormat = "truetype"; + numTables = parse.getUShort(data, 4); + tableEntries = parseOpenTypeTableEntries(data, numTables); + } else if (signature === "OTTO") { + font.outlinesFormat = "cff"; + numTables = parse.getUShort(data, 4); + tableEntries = parseOpenTypeTableEntries(data, numTables); + } else if (signature === "wOFF") { + var flavor = parse.getTag(data, 4); + if (flavor === String.fromCharCode(0, 1, 0, 0)) { + font.outlinesFormat = "truetype"; + } else if (flavor === "OTTO") { + font.outlinesFormat = "cff"; + } else { + throw new Error("Unsupported OpenType flavor " + signature); + } + numTables = parse.getUShort(data, 12); + tableEntries = parseWOFFTableEntries(data, numTables); + } else { + throw new Error( + "Unsupported OpenType signature " + signature, + ); + } + var cffTableEntry; + var fvarTableEntry; + var glyfTableEntry; + var gposTableEntry; + var gsubTableEntry; + var hmtxTableEntry; + var kernTableEntry; + var locaTableEntry; + var nameTableEntry; + var metaTableEntry; + var p; + for (var i = 0; i < numTables; i += 1) { + var tableEntry = tableEntries[i]; + var table = void 0; + switch (tableEntry.tag) { + case "cmap": + table = uncompressTable(data, tableEntry); + font.tables.cmap = cmap.parse(table.data, table.offset); + font.encoding = new CmapEncoding(font.tables.cmap); + break; + case "cvt ": + table = uncompressTable(data, tableEntry); + p = new parse.Parser(table.data, table.offset); + font.tables.cvt = p.parseShortList(tableEntry.length / 2); + break; + case "fvar": + fvarTableEntry = tableEntry; + break; + case "fpgm": + table = uncompressTable(data, tableEntry); + p = new parse.Parser(table.data, table.offset); + font.tables.fpgm = p.parseByteList(tableEntry.length); + break; + case "head": + table = uncompressTable(data, tableEntry); + font.tables.head = head.parse(table.data, table.offset); + font.unitsPerEm = font.tables.head.unitsPerEm; + indexToLocFormat = font.tables.head.indexToLocFormat; + break; + case "hhea": + table = uncompressTable(data, tableEntry); + font.tables.hhea = hhea.parse(table.data, table.offset); + font.ascender = font.tables.hhea.ascender; + font.descender = font.tables.hhea.descender; + font.numberOfHMetrics = font.tables.hhea.numberOfHMetrics; + break; + case "hmtx": + hmtxTableEntry = tableEntry; + break; + case "ltag": + table = uncompressTable(data, tableEntry); + ltagTable = ltag.parse(table.data, table.offset); + break; + case "maxp": + table = uncompressTable(data, tableEntry); + font.tables.maxp = maxp.parse(table.data, table.offset); + font.numGlyphs = font.tables.maxp.numGlyphs; + break; + case "name": + nameTableEntry = tableEntry; + break; + case "OS/2": + table = uncompressTable(data, tableEntry); + font.tables.os2 = os2.parse(table.data, table.offset); + break; + case "post": + table = uncompressTable(data, tableEntry); + font.tables.post = post.parse(table.data, table.offset); + font.glyphNames = new GlyphNames(font.tables.post); + break; + case "prep": + table = uncompressTable(data, tableEntry); + p = new parse.Parser(table.data, table.offset); + font.tables.prep = p.parseByteList(tableEntry.length); + break; + case "glyf": + glyfTableEntry = tableEntry; + break; + case "loca": + locaTableEntry = tableEntry; + break; + case "CFF ": + cffTableEntry = tableEntry; + break; + case "kern": + kernTableEntry = tableEntry; + break; + case "GPOS": + gposTableEntry = tableEntry; + break; + case "GSUB": + gsubTableEntry = tableEntry; + break; + case "meta": + metaTableEntry = tableEntry; + break; + } + } + var nameTable = uncompressTable(data, nameTableEntry); + font.tables.name = _name.parse( + nameTable.data, + nameTable.offset, + ltagTable, + ); + font.names = font.tables.name; + if (glyfTableEntry && locaTableEntry) { + var shortVersion = indexToLocFormat === 0; + var locaTable = uncompressTable(data, locaTableEntry); + var locaOffsets = loca.parse( + locaTable.data, + locaTable.offset, + font.numGlyphs, + shortVersion, + ); + var glyfTable = uncompressTable(data, glyfTableEntry); + font.glyphs = glyf.parse( + glyfTable.data, + glyfTable.offset, + locaOffsets, + font, + ); + } else if (cffTableEntry) { + var cffTable = uncompressTable(data, cffTableEntry); + cff.parse(cffTable.data, cffTable.offset, font); + } else { + throw new Error( + "Font doesn't contain TrueType or CFF outlines.", + ); + } + var hmtxTable = uncompressTable(data, hmtxTableEntry); + hmtx.parse( + hmtxTable.data, + hmtxTable.offset, + font.numberOfHMetrics, + font.numGlyphs, + font.glyphs, + ); + addGlyphNames(font); + if (kernTableEntry) { + var kernTable = uncompressTable(data, kernTableEntry); + font.kerningPairs = kern.parse( + kernTable.data, + kernTable.offset, + ); + } else { + font.kerningPairs = {}; + } + if (gposTableEntry) { + var gposTable = uncompressTable(data, gposTableEntry); + font.tables.gpos = gpos.parse( + gposTable.data, + gposTable.offset, + ); + font.position.init(); + } + if (gsubTableEntry) { + var gsubTable = uncompressTable(data, gsubTableEntry); + font.tables.gsub = gsub.parse( + gsubTable.data, + gsubTable.offset, + ); + } + if (fvarTableEntry) { + var fvarTable = uncompressTable(data, fvarTableEntry); + font.tables.fvar = fvar.parse( + fvarTable.data, + fvarTable.offset, + font.names, + ); + } + if (metaTableEntry) { + var metaTable = uncompressTable(data, metaTableEntry); + font.tables.meta = meta.parse( + metaTable.data, + metaTable.offset, + ); + font.metas = font.tables.meta; + } + return font; + } /** + * Asynchronously load the font from a URL or a filesystem. When done, call the callback + * with two arguments `(err, font)`. The `err` will be null on success, + * the `font` is a Font object. + * We use the node.js callback convention so that + * opentype.js can integrate with frameworks like async.js. + * @alias opentype.load + * @param {string} url - The URL of the font to load. + * @param {Function} callback - The callback. + */ + + function load(url, callback) { + var isNode$$1 = typeof window === "undefined"; + var loadFn = isNode$$1 ? loadFromFile : loadFromUrl; + loadFn(url, function (err, arrayBuffer) { + if (err) { + return callback(err); + } + var font; + try { + font = parseBuffer(arrayBuffer); + } catch (e) { + return callback(e, null); + } + return callback(null, font); + }); + } /** + * Synchronously load the font from a URL or file. + * When done, returns the font object or throws an error. + * @alias opentype.loadSync + * @param {string} url - The URL of the font to load. + * @return {opentype.Font} + */ + + function loadSync(url) { + var fs = _dereq_("fs"); + var buffer = fs.readFileSync(url); + return parseBuffer(nodeBufferToArrayBuffer(buffer)); + } + exports.Font = Font; + exports.Glyph = Glyph; + exports.Path = Path; + exports.BoundingBox = BoundingBox; + exports._parse = parse; + exports.parse = parseBuffer; + exports.load = load; + exports.loadSync = loadSync; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + }); + }).call(this, _dereq_("buffer").Buffer); + }, + { + buffer: 22, + fs: 21, + }, + ], + 272: [ + function (_dereq_, module, exports) { + (function (process) { + // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, + // backported and transplited with Babel, with backwards-compat fixes + // Copyright Joyent, Inc. and other Node contributors. + // + // 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. + // resolves . and .. elements in a path array with directory names there + // must be no slashes, empty elements, or device names (c:\) in the array + // (so also no leading and trailing slashes - it does not distinguish + // relative and absolute paths) + function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1); + } else if (last === "..") { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } // if the path is allowed to go above the root, restore leading ..s + + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift(".."); + } + } + return parts; + } // path.resolve([from ...], to) + // posix version + + exports.resolve = function () { + var resolvedPath = "", + resolvedAbsolute = false; + for ( + var i = arguments.length - 1; + i >= -1 && !resolvedAbsolute; + i-- + ) { + var path = i >= 0 ? arguments[i] : process.cwd(); + // Skip empty and invalid entries + if (typeof path !== "string") { + throw new TypeError( + "Arguments to path.resolve must be strings", + ); + } else if (!path) { + continue; + } + resolvedPath = path + "/" + resolvedPath; + resolvedAbsolute = path.charAt(0) === "/"; + } // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + // Normalize the path + + resolvedPath = normalizeArray( + filter(resolvedPath.split("/"), function (p) { + return !!p; + }), + !resolvedAbsolute, + ).join("/"); + return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; + }; + // path.normalize(path) + // posix version + exports.normalize = function (path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === "/"; + // Normalize the path + path = normalizeArray( + filter(path.split("/"), function (p) { + return !!p; + }), + !isAbsolute, + ).join("/"); + if (!path && !isAbsolute) { + path = "."; + } + if (path && trailingSlash) { + path += "/"; + } + return (isAbsolute ? "/" : "") + path; + }; + // posix version + exports.isAbsolute = function (path) { + return path.charAt(0) === "/"; + }; + // posix version + exports.join = function () { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize( + filter(paths, function (p, index) { + if (typeof p !== "string") { + throw new TypeError( + "Arguments to path.join must be strings", + ); + } + return p; + }).join("/"), + ); + }; + // path.relative(from, to) + // posix version + exports.relative = function (from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== "") break; + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== "") break; + } + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + var fromParts = trim(from.split("/")); + var toParts = trim(to.split("/")); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push(".."); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join("/"); + }; + exports.sep = "/"; + exports.delimiter = ":"; + exports.dirname = function (path) { + if (typeof path !== "string") path = path + ""; + if (path.length === 0) return "."; + var code = path.charCodeAt(0); + var hasRoot = code === 47; /*/*/ + var end = -1; + var matchedSlash = true; + for (var i = path.length - 1; i >= 1; --i) { + code = path.charCodeAt(i); + if (code === 47 /*/*/) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } + if (end === -1) return hasRoot ? "/" : "."; + if (hasRoot && end === 1) { + // return '//'; + // Backwards-compat fix: + return "/"; + } + return path.slice(0, end); + }; + function basename(path) { + if (typeof path !== "string") path = path + ""; + var start = 0; + var end = -1; + var matchedSlash = true; + var i; + for (i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === 47 /*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // path component + matchedSlash = false; + end = i + 1; + } + } + if (end === -1) return ""; + return path.slice(start, end); + } // Uses a mixed approach for backwards-compatibility, as ext behavior changed + // in new Node.js versions, so only basename() above is backported here + + exports.basename = function (path, ext) { + var f = basename(path); + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; + }; + exports.extname = function (path) { + if (typeof path !== "string") path = path + ""; + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + for (var i = path.length - 1; i >= 0; --i) { + var code = path.charCodeAt(i); + if (code === 47 /*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46 /*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + if ( + startDot === -1 || + end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + (preDotState === 1 && + startDot === end - 1 && + startDot === startPart + 1) + ) { + return ""; + } + return path.slice(startDot, end); + }; + function filter(xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; + } // String.prototype.substr - negative index don't work in IE8 + + var substr = + "ab".substr(-1) === "b" + ? function (str, start, len) { + return str.substr(start, len); + } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + }; + }).call(this, _dereq_("_process")); + }, + { + _process: 273, + }, + ], + 273: [ + function (_dereq_, module, exports) { + // shim for using process in browser + var process = (module.exports = {}); + // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error("setTimeout has not been defined"); + } + function defaultClearTimeout() { + throw new Error("clearTimeout has not been defined"); + } + (function () { + try { + if (typeof setTimeout === "function") { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === "function") { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + })(); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } // if setTimeout wasn't available but was latter defined + + if ( + (cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && + setTimeout + ) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } // if clearTimeout wasn't available but was latter defined + + if ( + (cachedClearTimeout === defaultClearTimeout || + !cachedClearTimeout) && + clearTimeout + ) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = "browser"; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ""; // empty string to avoid regexp issues + process.versions = {}; + function noop() {} + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error("process.binding is not supported"); + }; + process.cwd = function () { + return "/"; + }; + process.chdir = function (dir) { + throw new Error("process.chdir is not supported"); + }; + process.umask = function () { + return 0; + }; + }, + {}, + ], + 274: [ + function (_dereq_, module, exports) { + /** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + var runtime = (function (exports) { + "use strict"; + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = + $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = + outerFn && outerFn.prototype instanceof Generator + ? outerFn + : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + return generator; + } + exports.wrap = wrap; + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { + type: "normal", + arg: fn.call(obj, arg), + }; + } catch (err) { + return { + type: "throw", + arg: err, + }; + } + } + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = + getProto && getProto(getProto(values([]))); + if ( + NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol) + ) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + var Gp = + (GeneratorFunctionPrototype.prototype = + Generator.prototype = + Object.create(IteratorPrototype)); + GeneratorFunction.prototype = Gp.constructor = + GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function (method) { + prototype[method] = function (arg) { + return this._invoke(method, arg); + }; + }); + } + exports.isGeneratorFunction = function (genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + exports.mark = function (genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function (arg) { + return { + __await: arg, + }; + }; + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if ( + value && + typeof value === "object" && + hasOwn.call(value, "__await") + ) { + return Promise.resolve(value.__await).then( + function (value) { + invoke("next", value, resolve, reject); + }, + function (err) { + invoke("throw", err, resolve, reject); + }, + ); + } + return Promise.resolve(value).then( + function (unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, + function (error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }, + ); + } + } + var previousPromise; + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + return (previousPromise = // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise + ? previousPromise.then( + callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg, + ) + : callInvokeWithMethodAndArg()); + } // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + + this._invoke = enqueue; + } + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function (innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList), + ); + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }; + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + + return doneResult(); + } + context.method = method; + context.arg = arg; + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + context.dispatchException(context.arg); + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + state = GenStateExecuting; + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + if (record.arg === ContinueSentinel) { + continue; + } + return { + value: record.arg, + done: context.done, + }; + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + if (context.method === "throw") { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method", + ); + } + return ContinueSentinel; + } + var record = tryCatch(method, delegate.iterator, context.arg); + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + var info = record.arg; + if (!info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + } else { + // Re-yield the result returned by the delegate method. + return info; + } // The delegate iterator is finished, so forget it and continue with + // the outer generator. + + context.delegate = null; + return ContinueSentinel; + } // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + + defineIteratorMethods(Gp); + Gp[toStringTagSymbol] = "Generator"; + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function () { + return this; + }; + Gp.toString = function () { + return "[object Generator]"; + }; + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0], + }; + if (1 in locs) { + entry.catchLoc = locs[1]; + } + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + this.tryEntries.push(entry); + } + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [ + { + tryLoc: "root", + }, + ]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + exports.keys = function (object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + + next.done = true; + return next; + }; + }; + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + if (typeof iterable.next === "function") { + return iterable; + } + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + next.value = undefined; + next.done = true; + return next; + }; + return (next.next = next); + } + } // Return an iterator with no values. + + return { + next: doneResult, + }; + } + exports.values = values; + function doneResult() { + return { + value: undefined, + done: true, + }; + } + Context.prototype = { + constructor: Context, + reset: function (skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + this.method = "next"; + this.arg = undefined; + this.tryEntries.forEach(resetTryEntry); + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if ( + name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1)) + ) { + this[name] = undefined; + } + } + } + }, + stop: function () { + this.done = true; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + return this.rval; + }, + dispatchException: function (exception) { + if (this.done) { + throw exception; + } + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + return !!caught; + } + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + abrupt: function (type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if ( + entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc + ) { + var finallyEntry = entry; + break; + } + } + if ( + finallyEntry && + (type === "break" || type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc + ) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + return this.complete(record); + }, + complete: function (record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + if (record.type === "break" || record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + return ContinueSentinel; + }, + finish: function (finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + catch: function (tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + + throw new Error("illegal catch attempt"); + }, + delegateYield: function (iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc, + }; + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + return ContinueSentinel; + }, + }; + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + })( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === "object" ? module.exports : {}, + ); + try { + regeneratorRuntime = runtime; + } catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function("r", "regeneratorRuntime = r")(runtime); + } + }, + {}, + ], + 275: [ + function (_dereq_, module, exports) { + (function (self) { + "use strict"; + if (self.fetch) { + return; + } + var support = { + searchParams: "URLSearchParams" in self, + iterable: "Symbol" in self && "iterator" in Symbol, + blob: + "FileReader" in self && + "Blob" in self && + (function () { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + })(), + formData: "FormData" in self, + arrayBuffer: "ArrayBuffer" in self, + }; + if (support.arrayBuffer) { + var viewClasses = [ + "[object Int8Array]", + "[object Uint8Array]", + "[object Uint8ClampedArray]", + "[object Int16Array]", + "[object Uint16Array]", + "[object Int32Array]", + "[object Uint32Array]", + "[object Float32Array]", + "[object Float64Array]", + ]; + var isDataView = function (obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + }; + var isArrayBufferView = + ArrayBuffer.isView || + function (obj) { + return ( + obj && + viewClasses.indexOf(Object.prototype.toString.call(obj)) > + -1 + ); + }; + } + function normalizeName(name) { + if (typeof name !== "string") { + name = String(name); + } + if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { + throw new TypeError("Invalid character in header field name"); + } + return name.toLowerCase(); + } + function normalizeValue(value) { + if (typeof value !== "string") { + value = String(value); + } + return value; + } // Build a destructive iterator for the value list + + function iteratorFor(items) { + var iterator = { + next: function () { + var value = items.shift(); + return { + done: value === undefined, + value: value, + }; + }, + }; + if (support.iterable) { + iterator[Symbol.iterator] = function () { + return iterator; + }; + } + return iterator; + } + function Headers(headers) { + this.map = {}; + if (headers instanceof Headers) { + headers.forEach(function (value, name) { + this.append(name, value); + }, this); + } else if (Array.isArray(headers)) { + headers.forEach(function (header) { + this.append(header[0], header[1]); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function (name) { + this.append(name, headers[name]); + }, this); + } + } + Headers.prototype.append = function (name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var oldValue = this.map[name]; + this.map[name] = oldValue ? oldValue + "," + value : value; + }; + Headers.prototype["delete"] = function (name) { + delete this.map[normalizeName(name)]; + }; + Headers.prototype.get = function (name) { + name = normalizeName(name); + return this.has(name) ? this.map[name] : null; + }; + Headers.prototype.has = function (name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + Headers.prototype.set = function (name, value) { + this.map[normalizeName(name)] = normalizeValue(value); + }; + Headers.prototype.forEach = function (callback, thisArg) { + for (var name in this.map) { + if (this.map.hasOwnProperty(name)) { + callback.call(thisArg, this.map[name], name, this); + } + } + }; + Headers.prototype.keys = function () { + var items = []; + this.forEach(function (value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + Headers.prototype.values = function () { + var items = []; + this.forEach(function (value) { + items.push(value); + }); + return iteratorFor(items); + }; + Headers.prototype.entries = function () { + var items = []; + this.forEach(function (value, name) { + items.push([name, value]); + }); + return iteratorFor(items); + }; + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + } + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError("Already read")); + } + body.bodyUsed = true; + } + function fileReaderReady(reader) { + return new Promise(function (resolve, reject) { + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error); + }; + }); + } + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsArrayBuffer(blob); + return promise; + } + function readBlobAsText(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsText(blob); + return promise; + } + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf); + var chars = new Array(view.length); + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]); + } + return chars.join(""); + } + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0); + } else { + var view = new Uint8Array(buf.byteLength); + view.set(new Uint8Array(buf)); + return view.buffer; + } + } + function Body() { + this.bodyUsed = false; + this._initBody = function (body) { + this._bodyInit = body; + if (!body) { + this._bodyText = ""; + } else if (typeof body === "string") { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if ( + support.formData && + FormData.prototype.isPrototypeOf(body) + ) { + this._bodyFormData = body; + } else if ( + support.searchParams && + URLSearchParams.prototype.isPrototypeOf(body) + ) { + this._bodyText = body.toString(); + } else if ( + support.arrayBuffer && + support.blob && + isDataView(body) + ) { + this._bodyArrayBuffer = bufferClone(body.buffer); + // IE 10-11 can't handle a DataView body. + this._bodyInit = new Blob([this._bodyArrayBuffer]); + } else if ( + support.arrayBuffer && + (ArrayBuffer.prototype.isPrototypeOf(body) || + isArrayBufferView(body)) + ) { + this._bodyArrayBuffer = bufferClone(body); + } else { + throw new Error("unsupported BodyInit type"); + } + if (!this.headers.get("content-type")) { + if (typeof body === "string") { + this.headers.set( + "content-type", + "text/plain;charset=UTF-8", + ); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set("content-type", this._bodyBlob.type); + } else if ( + support.searchParams && + URLSearchParams.prototype.isPrototypeOf(body) + ) { + this.headers.set( + "content-type", + "application/x-www-form-urlencoded;charset=UTF-8", + ); + } + } + }; + if (support.blob) { + this.blob = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + } else if (this._bodyFormData) { + throw new Error("could not read FormData body as blob"); + } else { + return Promise.resolve(new Blob([this._bodyText])); + } + }; + this.arrayBuffer = function () { + if (this._bodyArrayBuffer) { + return ( + consumed(this) || Promise.resolve(this._bodyArrayBuffer) + ); + } else { + return this.blob().then(readBlobAsArrayBuffer); + } + }; + } + this.text = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve( + readArrayBufferAsText(this._bodyArrayBuffer), + ); + } else if (this._bodyFormData) { + throw new Error("could not read FormData body as text"); + } else { + return Promise.resolve(this._bodyText); + } + }; + if (support.formData) { + this.formData = function () { + return this.text().then(decode); + }; + } + this.json = function () { + return this.text().then(JSON.parse); + }; + return this; + } // HTTP methods whose capitalization should be normalized + + var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > -1 ? upcased : method; + } + function Request(input, options) { + options = options || {}; + var body = options.body; + if (input instanceof Request) { + if (input.bodyUsed) { + throw new TypeError("Already read"); + } + this.url = input.url; + this.credentials = input.credentials; + if (!options.headers) { + this.headers = new Headers(input.headers); + } + this.method = input.method; + this.mode = input.mode; + if (!body && input._bodyInit != null) { + body = input._bodyInit; + input.bodyUsed = true; + } + } else { + this.url = String(input); + } + this.credentials = + options.credentials || this.credentials || "omit"; + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); + } + this.method = normalizeMethod( + options.method || this.method || "GET", + ); + this.mode = options.mode || this.mode || null; + this.referrer = null; + if ((this.method === "GET" || this.method === "HEAD") && body) { + throw new TypeError( + "Body not allowed for GET or HEAD requests", + ); + } + this._initBody(body); + } + Request.prototype.clone = function () { + return new Request(this, { + body: this._bodyInit, + }); + }; + function decode(body) { + var form = new FormData(); + body + .trim() + .split("&") + .forEach(function (bytes) { + if (bytes) { + var split = bytes.split("="); + var name = split.shift().replace(/\+/g, " "); + var value = split.join("=").replace(/\+/g, " "); + form.append( + decodeURIComponent(name), + decodeURIComponent(value), + ); + } + }); + return form; + } + function parseHeaders(rawHeaders) { + var headers = new Headers(); + // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space + // https://tools.ietf.org/html/rfc7230#section-3.2 + var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " "); + preProcessedHeaders.split(/\r?\n/).forEach(function (line) { + var parts = line.split(":"); + var key = parts.shift().trim(); + if (key) { + var value = parts.join(":").trim(); + headers.append(key, value); + } + }); + return headers; + } + Body.call(Request.prototype); + function Response(bodyInit, options) { + if (!options) { + options = {}; + } + this.type = "default"; + this.status = options.status === undefined ? 200 : options.status; + this.ok = this.status >= 200 && this.status < 300; + this.statusText = + "statusText" in options ? options.statusText : "OK"; + this.headers = new Headers(options.headers); + this.url = options.url || ""; + this._initBody(bodyInit); + } + Body.call(Response.prototype); + Response.prototype.clone = function () { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url, + }); + }; + Response.error = function () { + var response = new Response(null, { + status: 0, + statusText: "", + }); + response.type = "error"; + return response; + }; + var redirectStatuses = [301, 302, 303, 307, 308]; + Response.redirect = function (url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError("Invalid status code"); + } + return new Response(null, { + status: status, + headers: { + location: url, + }, + }); + }; + self.Headers = Headers; + self.Request = Request; + self.Response = Response; + self.fetch = function (input, init) { + return new Promise(function (resolve, reject) { + var request = new Request(input, init); + var xhr = new XMLHttpRequest(); + xhr.onload = function () { + var options = { + status: xhr.status, + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || ""), + }; + options.url = + "responseURL" in xhr + ? xhr.responseURL + : options.headers.get("X-Request-URL"); + var body = + "response" in xhr ? xhr.response : xhr.responseText; + resolve(new Response(body, options)); + }; + xhr.onerror = function () { + reject(new TypeError("Network request failed")); + }; + xhr.ontimeout = function () { + reject(new TypeError("Network request failed")); + }; + xhr.open(request.method, request.url, true); + if (request.credentials === "include") { + xhr.withCredentials = true; + } else if (request.credentials === "omit") { + xhr.withCredentials = false; + } + if ("responseType" in xhr && support.blob) { + xhr.responseType = "blob"; + } + request.headers.forEach(function (value, name) { + xhr.setRequestHeader(name, value); + }); + xhr.send( + typeof request._bodyInit === "undefined" + ? null + : request._bodyInit, + ); + }); + }; + self.fetch.polyfill = true; + })(typeof self !== "undefined" ? self : this); + }, + {}, + ], + 276: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.split"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var _color_conversion = _interopRequireDefault( + _dereq_("../color/color_conversion"), + ); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + //stores the original hsb values + + var originalHSB; + //stores values for color name exceptions + var colorExceptions = [ + { + h: 0, + s: 0, + b: 0.8275, + name: "gray", + }, + { + h: 0, + s: 0, + b: 0.8627, + name: "gray", + }, + { + h: 0, + s: 0, + b: 0.7529, + name: "gray", + }, + { + h: 0.0167, + s: 0.1176, + b: 1, + name: "light pink", + }, + ]; + //stores values for color names + var colorLookUp = [ + { + h: 0, + s: 0, + b: 0, + name: "black", + }, + { + h: 0, + s: 0, + b: 0.5, + name: "gray", + }, + { + h: 0, + s: 0, + b: 1, + name: "white", + }, + { + h: 0, + s: 0.5, + b: 0.5, + name: "dark maroon", + }, + { + h: 0, + s: 0.5, + b: 1, + name: "salmon pink", + }, + { + h: 0, + s: 1, + b: 0, + name: "black", + }, + { + h: 0, + s: 1, + b: 0.5, + name: "dark red", + }, + { + h: 0, + s: 1, + b: 1, + name: "red", + }, + { + h: 5, + s: 0, + b: 1, + name: "very light peach", + }, + { + h: 5, + s: 0.5, + b: 0.5, + name: "brown", + }, + { + h: 5, + s: 0.5, + b: 1, + name: "peach", + }, + { + h: 5, + s: 1, + b: 0.5, + name: "brick red", + }, + { + h: 5, + s: 1, + b: 1, + name: "crimson", + }, + { + h: 10, + s: 0, + b: 1, + name: "light peach", + }, + { + h: 10, + s: 0.5, + b: 0.5, + name: "brown", + }, + { + h: 10, + s: 0.5, + b: 1, + name: "light orange", + }, + { + h: 10, + s: 1, + b: 0.5, + name: "brown", + }, + { + h: 10, + s: 1, + b: 1, + name: "orange", + }, + { + h: 15, + s: 0, + b: 1, + name: "very light yellow", + }, + { + h: 15, + s: 0.5, + b: 0.5, + name: "olive green", + }, + { + h: 15, + s: 0.5, + b: 1, + name: "light yellow", + }, + { + h: 15, + s: 1, + b: 0, + name: "dark olive green", + }, + { + h: 15, + s: 1, + b: 0.5, + name: "olive green", + }, + { + h: 15, + s: 1, + b: 1, + name: "yellow", + }, + { + h: 20, + s: 0, + b: 1, + name: "very light yellow", + }, + { + h: 20, + s: 0.5, + b: 0.5, + name: "olive green", + }, + { + h: 20, + s: 0.5, + b: 1, + name: "light yellow green", + }, + { + h: 20, + s: 1, + b: 0, + name: "dark olive green", + }, + { + h: 20, + s: 1, + b: 0.5, + name: "dark yellow green", + }, + { + h: 20, + s: 1, + b: 1, + name: "yellow green", + }, + { + h: 25, + s: 0.5, + b: 0.5, + name: "dark yellow green", + }, + { + h: 25, + s: 0.5, + b: 1, + name: "light green", + }, + { + h: 25, + s: 1, + b: 0.5, + name: "dark green", + }, + { + h: 25, + s: 1, + b: 1, + name: "green", + }, + { + h: 30, + s: 0.5, + b: 1, + name: "light green", + }, + { + h: 30, + s: 1, + b: 0.5, + name: "dark green", + }, + { + h: 30, + s: 1, + b: 1, + name: "green", + }, + { + h: 35, + s: 0, + b: 0.5, + name: "light green", + }, + { + h: 35, + s: 0, + b: 1, + name: "very light green", + }, + { + h: 35, + s: 0.5, + b: 0.5, + name: "dark green", + }, + { + h: 35, + s: 0.5, + b: 1, + name: "light green", + }, + { + h: 35, + s: 1, + b: 0, + name: "very dark green", + }, + { + h: 35, + s: 1, + b: 0.5, + name: "dark green", + }, + { + h: 35, + s: 1, + b: 1, + name: "green", + }, + { + h: 40, + s: 0, + b: 1, + name: "very light green", + }, + { + h: 40, + s: 0.5, + b: 0.5, + name: "dark green", + }, + { + h: 40, + s: 0.5, + b: 1, + name: "light green", + }, + { + h: 40, + s: 1, + b: 0.5, + name: "dark green", + }, + { + h: 40, + s: 1, + b: 1, + name: "green", + }, + { + h: 45, + s: 0.5, + b: 1, + name: "light turquoise", + }, + { + h: 45, + s: 1, + b: 0.5, + name: "dark turquoise", + }, + { + h: 45, + s: 1, + b: 1, + name: "turquoise", + }, + { + h: 50, + s: 0, + b: 1, + name: "light sky blue", + }, + { + h: 50, + s: 0.5, + b: 0.5, + name: "dark cyan", + }, + { + h: 50, + s: 0.5, + b: 1, + name: "light cyan", + }, + { + h: 50, + s: 1, + b: 0.5, + name: "dark cyan", + }, + { + h: 50, + s: 1, + b: 1, + name: "cyan", + }, + { + h: 55, + s: 0, + b: 1, + name: "light sky blue", + }, + { + h: 55, + s: 0.5, + b: 1, + name: "light sky blue", + }, + { + h: 55, + s: 1, + b: 0.5, + name: "dark blue", + }, + { + h: 55, + s: 1, + b: 1, + name: "sky blue", + }, + { + h: 60, + s: 0, + b: 0.5, + name: "gray", + }, + { + h: 60, + s: 0, + b: 1, + name: "very light blue", + }, + { + h: 60, + s: 0.5, + b: 0.5, + name: "blue", + }, + { + h: 60, + s: 0.5, + b: 1, + name: "light blue", + }, + { + h: 60, + s: 1, + b: 0.5, + name: "navy blue", + }, + { + h: 60, + s: 1, + b: 1, + name: "blue", + }, + { + h: 65, + s: 0, + b: 1, + name: "lavender", + }, + { + h: 65, + s: 0.5, + b: 0.5, + name: "navy blue", + }, + { + h: 65, + s: 0.5, + b: 1, + name: "light purple", + }, + { + h: 65, + s: 1, + b: 0.5, + name: "dark navy blue", + }, + { + h: 65, + s: 1, + b: 1, + name: "blue", + }, + { + h: 70, + s: 0, + b: 1, + name: "lavender", + }, + { + h: 70, + s: 0.5, + b: 0.5, + name: "navy blue", + }, + { + h: 70, + s: 0.5, + b: 1, + name: "lavender blue", + }, + { + h: 70, + s: 1, + b: 0.5, + name: "dark navy blue", + }, + { + h: 70, + s: 1, + b: 1, + name: "blue", + }, + { + h: 75, + s: 0.5, + b: 1, + name: "lavender", + }, + { + h: 75, + s: 1, + b: 0.5, + name: "dark purple", + }, + { + h: 75, + s: 1, + b: 1, + name: "purple", + }, + { + h: 80, + s: 0.5, + b: 1, + name: "pinkish purple", + }, + { + h: 80, + s: 1, + b: 0.5, + name: "dark purple", + }, + { + h: 80, + s: 1, + b: 1, + name: "purple", + }, + { + h: 85, + s: 0, + b: 1, + name: "light pink", + }, + { + h: 85, + s: 0.5, + b: 0.5, + name: "purple", + }, + { + h: 85, + s: 0.5, + b: 1, + name: "light fuchsia", + }, + { + h: 85, + s: 1, + b: 0.5, + name: "dark fuchsia", + }, + { + h: 85, + s: 1, + b: 1, + name: "fuchsia", + }, + { + h: 90, + s: 0.5, + b: 0.5, + name: "dark fuchsia", + }, + { + h: 90, + s: 0.5, + b: 1, + name: "hot pink", + }, + { + h: 90, + s: 1, + b: 0.5, + name: "dark fuchsia", + }, + { + h: 90, + s: 1, + b: 1, + name: "fuchsia", + }, + { + h: 95, + s: 0, + b: 1, + name: "pink", + }, + { + h: 95, + s: 0.5, + b: 1, + name: "light pink", + }, + { + h: 95, + s: 1, + b: 0.5, + name: "dark magenta", + }, + { + h: 95, + s: 1, + b: 1, + name: "magenta", + }, + ]; + //returns text with color name + function _calculateColor(hsb) { + var colortext; + //round hue + if (hsb[0] !== 0) { + hsb[0] = Math.round(hsb[0] * 100); + var hue = hsb[0].toString().split(""); + var last = hue.length - 1; + hue[last] = parseInt(hue[last]); + //if last digit of hue is < 2.5 make it 0 + if (hue[last] < 2.5) { + hue[last] = 0; + //if last digit of hue is >= 2.5 and less than 7.5 make it 5 + } else if (hue[last] >= 2.5 && hue[last] < 7.5) { + hue[last] = 5; + } //if hue only has two digits + + if (hue.length === 2) { + hue[0] = parseInt(hue[0]); + //if last is greater than 7.5 + if (hue[last] >= 7.5) { + //add one to the tens + hue[last] = 0; + hue[0] = hue[0] + 1; + } + hsb[0] = hue[0] * 10 + hue[1]; + } else { + if (hue[last] >= 7.5) { + hsb[0] = 10; + } else { + hsb[0] = hue[last]; + } + } + } //map brightness from 0 to 1 + + hsb[2] = hsb[2] / 255; + //round saturation and brightness + for (var i = hsb.length - 1; i >= 1; i--) { + if (hsb[i] <= 0.25) { + hsb[i] = 0; + } else if (hsb[i] > 0.25 && hsb[i] < 0.75) { + hsb[i] = 0.5; + } else { + hsb[i] = 1; + } + } //after rounding, if the values are hue 0, saturation 0 and brightness 1 + //look at color exceptions which includes several tones from white to gray + + if (hsb[0] === 0 && hsb[1] === 0 && hsb[2] === 1) { + //round original hsb values + for (var _i = 2; _i >= 0; _i--) { + originalHSB[_i] = Math.round(originalHSB[_i] * 10000) / 10000; + } //compare with the values in the colorExceptions array + + for (var e = 0; e < colorExceptions.length; e++) { + if ( + colorExceptions[e].h === originalHSB[0] && + colorExceptions[e].s === originalHSB[1] && + colorExceptions[e].b === originalHSB[2] + ) { + colortext = colorExceptions[e].name; + break; + } else { + //if there is no match return white + colortext = "white"; + } + } + } else { + //otherwise, compare with values in colorLookUp + for (var _i2 = 0; _i2 < colorLookUp.length; _i2++) { + if ( + colorLookUp[_i2].h === hsb[0] && + colorLookUp[_i2].s === hsb[1] && + colorLookUp[_i2].b === hsb[2] + ) { + colortext = colorLookUp[_i2].name; + break; + } + } + } + return colortext; + } //gets rgba and returs a color name + + _main.default.prototype._rgbColorName = function (arg) { + //conversts rgba to hsb + var hsb = _color_conversion.default._rgbaToHSBA(arg); + //stores hsb in global variable + originalHSB = hsb; + //calculate color name + return _calculateColor([hsb[0], hsb[1], hsb[2]]); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../color/color_conversion": 282, + "../core/main": 298, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.split": 216, + }, + ], + 277: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.ends-with"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.ends-with"); + _dereq_("core-js/modules/es.string.replace"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + + var descContainer = "_Description"; //Fallback container + var fallbackDescId = "_fallbackDesc"; //Fallback description + var fallbackTableId = "_fallbackTable"; //Fallback Table + var fallbackTableElId = "_fte_"; //Fallback Table Element + var labelContainer = "_Label"; //Label container + var labelDescId = "_labelDesc"; //Label description + var labelTableId = "_labelTable"; //Label Table + var labelTableElId = "_lte_"; //Label Table Element + /** + * Creates a screen reader-accessible description for the canvas. + * + * The first parameter, `text`, is the description of the canvas. + * + * The second parameter, `display`, is optional. It determines how the + * description is displayed. If `LABEL` is passed, as in + * `describe('A description.', LABEL)`, the description will be visible in + * a div element next to the canvas. If `FALLBACK` is passed, as in + * `describe('A description.', FALLBACK)`, the description will only be + * visible to screen readers. This is the default mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method describe + * @param {String} text description of the canvas. + * @param {Constant} [display] either LABEL or FALLBACK. + * + * @example + *
                + * + * function setup() { + * background('pink'); + * + * // Draw a heart. + * fill('red'); + * noStroke(); + * circle(67, 67, 20); + * circle(83, 67, 20); + * triangle(91, 73, 75, 95, 59, 73); + * + * // Add a general description of the canvas. + * describe('A pink square with a red heart in the bottom-right corner.'); + * } + * + *
                + * + *
                + * + * function setup() { + * background('pink'); + * + * // Draw a heart. + * fill('red'); + * noStroke(); + * circle(67, 67, 20); + * circle(83, 67, 20); + * triangle(91, 73, 75, 95, 59, 73); + * + * // Add a general description of the canvas + * // and display it for debugging. + * describe('A pink square with a red heart in the bottom-right corner.', LABEL); + * } + * + *
                + * + *
                + * + * function draw() { + * background(200); + * + * // The expression + * // frameCount % 100 + * // causes x to increase from 0 + * // to 99, then restart from 0. + * let x = frameCount % 100; + * + * // Draw the circle. + * fill(0, 255, 0); + * circle(x, 50, 40); + * + * // Add a general description of the canvas. + * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`); + * } + * + *
                + * + *
                + * + * function draw() { + * background(200); + * + * // The expression + * // frameCount % 100 + * // causes x to increase from 0 + * // to 99, then restart from 0. + * let x = frameCount % 100; + * + * // Draw the circle. + * fill(0, 255, 0); + * circle(x, 50, 40); + * + * // Add a general description of the canvas + * // and display it for debugging. + * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); + * } + * + *
                + */ + _main.default.prototype.describe = function (text, display) { + _main.default._validateParameters("describe", arguments); + if (typeof text !== "string") { + return; + } + var cnvId = this.canvas.id; + //calls function that adds punctuation for better screen reading + text = _descriptionText(text); + //if there is no dummyDOM + if (!this.dummyDOM) { + this.dummyDOM = document.getElementById(cnvId).parentNode; + } + if (!this.descriptions) { + this.descriptions = {}; + } //check if html structure for description is ready + + if (this.descriptions.fallback) { + //check if text is different from current description + if (this.descriptions.fallback.innerHTML !== text) { + //update description + this.descriptions.fallback.innerHTML = text; + } + } else { + //create fallback html structure + this._describeHTML("fallback", text); + } //if display is LABEL + + if (display === this.LABEL) { + //check if html structure for label is ready + if (this.descriptions.label) { + //check if text is different from current label + if (this.descriptions.label.innerHTML !== text) { + //update label description + this.descriptions.label.innerHTML = text; + } + } else { + //create label html structure + this._describeHTML("label", text); + } + } + }; + /** + * Creates a screen reader-accessible description for elements in the canvas. + * Elements are shapes or groups of shapes that create meaning together. + * + * The first parameter, `name`, is the name of the element. + * + * The second parameter, `text`, is the description of the element. + * + * The third parameter, `display`, is optional. It determines how the + * description is displayed. If `LABEL` is passed, as in + * `describe('A description.', LABEL)`, the description will be visible in + * a div element next to the canvas. Using `LABEL` creates unhelpful + * duplicates for screen readers. Only use `LABEL` during development. If + * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method describeElement + * @param {String} name name of the element. + * @param {String} text description of the element. + * @param {Constant} [display] either LABEL or FALLBACK. + * + * @example + *
                + * + * function setup() { + * background('pink'); + * + * // Describe the first element + * // and draw it. + * describeElement('Circle', 'A yellow circle in the top-left corner.'); + * noStroke(); + * fill('yellow'); + * circle(25, 25, 40); + * + * // Describe the second element + * // and draw it. + * describeElement('Heart', 'A red heart in the bottom-right corner.'); + * fill('red'); + * circle(66.6, 66.6, 20); + * circle(83.2, 66.6, 20); + * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * + * // Add a general description of the canvas. + * describe('A red heart and yellow circle over a pink background.'); + * } + * + *
                + * + *
                + * + * function setup() { + * background('pink'); + * + * // Describe the first element + * // and draw it. Display the + * // description for debugging. + * describeElement('Circle', 'A yellow circle in the top-left corner.', LABEL); + * noStroke(); + * fill('yellow'); + * circle(25, 25, 40); + * + * // Describe the second element + * // and draw it. Display the + * // description for debugging. + * describeElement('Heart', 'A red heart in the bottom-right corner.', LABEL); + * fill('red'); + * circle(66.6, 66.6, 20); + * circle(83.2, 66.6, 20); + * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * + * // Add a general description of the canvas. + * describe('A red heart and yellow circle over a pink background.'); + * } + * + *
                + */ + _main.default.prototype.describeElement = function ( + name, + text, + display, + ) { + _main.default._validateParameters("describeElement", arguments); + if (typeof text !== "string" || typeof name !== "string") { + return; + } + var cnvId = this.canvas.id; + //calls function that adds punctuation for better screen reading + text = _descriptionText(text); + //calls function that adds punctuation for better screen reading + var elementName = _elementName(name); + //remove any special characters from name to use it as html id + name = name.replace(/[^a-zA-Z0-9]/g, ""); + //store element description + var inner = '' + .concat(elementName, "") + .concat(text, ""); + //if there is no dummyDOM + if (!this.dummyDOM) { + this.dummyDOM = document.getElementById(cnvId).parentNode; + } + if (!this.descriptions) { + this.descriptions = { + fallbackElements: {}, + }; + } else if (!this.descriptions.fallbackElements) { + this.descriptions.fallbackElements = {}; + } //check if html structure for element description is ready + + if (this.descriptions.fallbackElements[name]) { + //if current element description is not the same as inner + if ( + this.descriptions.fallbackElements[name].innerHTML !== inner + ) { + //update element description + this.descriptions.fallbackElements[name].innerHTML = inner; + } + } else { + //create fallback html structure + this._describeElementHTML("fallback", name, inner); + } //if display is LABEL + + if (display === this.LABEL) { + if (!this.descriptions.labelElements) { + this.descriptions.labelElements = {}; + } //if html structure for label element description is ready + + if (this.descriptions.labelElements[name]) { + //if label element description is different + if (this.descriptions.labelElements[name].innerHTML !== inner) { + //update label element description + this.descriptions.labelElements[name].innerHTML = inner; + } + } else { + //create label element html structure + this._describeElementHTML("label", name, inner); + } + } + }; + /* + * + * Helper functions for describe() and describeElement(). + * + */ + // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark + function _descriptionText(text) { + if (text === "label" || text === "fallback") { + throw new Error("description should not be LABEL or FALLBACK"); + } //if string does not end with '.' + + if ( + !text.endsWith(".") && + !text.endsWith(";") && + !text.endsWith(",") && + !text.endsWith("?") && + !text.endsWith("!") + ) { + //add '.' to the end of string + text = text + "."; + } + return text; + } /* + * Helper functions for describe() + */ + //creates HTML structure for canvas descriptions + + _main.default.prototype._describeHTML = function (type, text) { + var cnvId = this.canvas.id; + if (type === "fallback") { + //if there is no description container + if ( + !this.dummyDOM.querySelector("#".concat(cnvId + descContainer)) + ) { + //if there are no accessible outputs (see textOutput() and gridOutput()) + var html = '

                '); + if ( + !this.dummyDOM.querySelector( + "#".concat(cnvId, "accessibleOutput"), + ) + ) { + //create description container +

                for fallback description + this.dummyDOM.querySelector("#".concat(cnvId)).innerHTML = + html; + } else { + //create description container +

                for fallback description before outputs + this.dummyDOM + .querySelector("#".concat(cnvId, "accessibleOutput")) + .insertAdjacentHTML("beforebegin", html); + } + } else { + //if describeElement() has already created the container and added a table of elements + //create fallback description

                before the table + this.dummyDOM + .querySelector("#" + cnvId + fallbackTableId) + .insertAdjacentHTML( + "beforebegin", + '

                '), + ); + } //if the container for the description exists + + this.descriptions.fallback = this.dummyDOM.querySelector( + "#".concat(cnvId).concat(fallbackDescId), + ); + this.descriptions.fallback.innerHTML = text; + return; + } else if (type === "label") { + //if there is no label container + if ( + !this.dummyDOM.querySelector("#".concat(cnvId + labelContainer)) + ) { + var _html = '

                '); + //if there are no accessible outputs (see textOutput() and gridOutput()) + if ( + !this.dummyDOM.querySelector( + "#".concat(cnvId, "accessibleOutputLabel"), + ) + ) { + //create label container +

                for label description + this.dummyDOM + .querySelector("#" + cnvId) + .insertAdjacentHTML("afterend", _html); + } else { + //create label container +

                for label description before outputs + this.dummyDOM + .querySelector("#".concat(cnvId, "accessibleOutputLabel")) + .insertAdjacentHTML("beforebegin", _html); + } + } else if ( + this.dummyDOM.querySelector("#".concat(cnvId + labelTableId)) + ) { + //if describeElement() has already created the container and added a table of elements + //create label description

                before the table + this.dummyDOM + .querySelector("#".concat(cnvId + labelTableId)) + .insertAdjacentHTML( + "beforebegin", + '

                '), + ); + } + this.descriptions.label = this.dummyDOM.querySelector( + "#" + cnvId + labelDescId, + ); + this.descriptions.label.innerHTML = text; + return; + } + }; + /* + * Helper functions for describeElement(). + */ + //check that name is not LABEL or FALLBACK and ensure text ends with colon + function _elementName(name) { + if (name === "label" || name === "fallback") { + throw new Error("element name should not be LABEL or FALLBACK"); + } //check if last character of string n is '.', ';', or ',' + + if ( + name.endsWith(".") || + name.endsWith(";") || + name.endsWith(",") + ) { + //replace last character with ':' + name = name.replace(/.$/, ":"); + } else if (!name.endsWith(":")) { + //if string n does not end with ':' + //add ':'' at the end of string + name = name + ":"; + } + return name; + } //creates HTML structure for element descriptions + + _main.default.prototype._describeElementHTML = function ( + type, + name, + text, + ) { + var cnvId = this.canvas.id; + if (type === "fallback") { + //if there is no description container + if ( + !this.dummyDOM.querySelector("#".concat(cnvId + descContainer)) + ) { + //if there are no accessible outputs (see textOutput() and gridOutput()) + var html = '
                Canvas elements and their descriptions
                ', + ); + if ( + !this.dummyDOM.querySelector( + "#".concat(cnvId, "accessibleOutput"), + ) + ) { + //create container + table for element descriptions + this.dummyDOM.querySelector("#" + cnvId).innerHTML = html; + } else { + //create container + table for element descriptions before outputs + this.dummyDOM + .querySelector("#".concat(cnvId, "accessibleOutput")) + .insertAdjacentHTML("beforebegin", html); + } + } else if ( + !this.dummyDOM.querySelector("#" + cnvId + fallbackTableId) + ) { + //if describe() has already created the container and added a description + //and there is no table create fallback table for element description after + //fallback description + this.dummyDOM + .querySelector("#" + cnvId + fallbackDescId) + .insertAdjacentHTML( + "afterend", + '
                Canvas elements and their descriptions
                ', + ), + ); + } //create a table row for the element + + var tableRow = document.createElement("tr"); + tableRow.id = cnvId + fallbackTableElId + name; + this.dummyDOM + .querySelector("#" + cnvId + fallbackTableId) + .appendChild(tableRow); + //update element description + this.descriptions.fallbackElements[name] = + this.dummyDOM.querySelector( + "#".concat(cnvId).concat(fallbackTableElId).concat(name), + ); + this.descriptions.fallbackElements[name].innerHTML = text; + return; + } else if (type === "label") { + //If display is LABEL creates a div adjacent to the canvas element with + //a table, a row header cell with the name of the elements, + //and adds the description of the element in adjecent cell. + //if there is no label description container + if ( + !this.dummyDOM.querySelector("#".concat(cnvId + labelContainer)) + ) { + //if there are no accessible outputs (see textOutput() and gridOutput()) + var _html2 = '
                '); + if ( + !this.dummyDOM.querySelector( + "#".concat(cnvId, "accessibleOutputLabel"), + ) + ) { + //create container + table for element descriptions + this.dummyDOM + .querySelector("#" + cnvId) + .insertAdjacentHTML("afterend", _html2); + } else { + //create container + table for element descriptions before outputs + this.dummyDOM + .querySelector("#".concat(cnvId, "accessibleOutputLabel")) + .insertAdjacentHTML("beforebegin", _html2); + } + } else if ( + !this.dummyDOM.querySelector("#".concat(cnvId + labelTableId)) + ) { + //if describe() has already created the label container and added a description + //and there is no table create label table for element description after + //label description + this.dummyDOM + .querySelector("#" + cnvId + labelDescId) + .insertAdjacentHTML( + "afterend", + '
                '), + ); + } //create a table row for the element label description + + var _tableRow = document.createElement("tr"); + _tableRow.id = cnvId + labelTableElId + name; + this.dummyDOM + .querySelector("#" + cnvId + labelTableId) + .appendChild(_tableRow); + //update element label description + this.descriptions.labelElements[name] = + this.dummyDOM.querySelector( + "#".concat(cnvId).concat(labelTableElId).concat(name), + ); + this.descriptions.labelElements[name].innerHTML = text; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.ends-with": 208, + "core-js/modules/es.string.replace": 214, + }, + ], + 278: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.string.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + //the functions in this file support updating the grid output + //updates gridOutput + + _main.default.prototype._updateGridOutput = function (idT) { + //if html structure is not there yet + if (!this.dummyDOM.querySelector("#".concat(idT, "_summary"))) { + return; + } + var current = this._accessibleOutputs[idT]; + //create shape details list + var innerShapeDetails = _gridShapeDetails( + idT, + this.ingredients.shapes, + ); + //create summary + var innerSummary = _gridSummary( + innerShapeDetails.numShapes, + this.ingredients.colors.background, + this.width, + this.height, + ); + //create grid map + var innerMap = _gridMap(idT, this.ingredients.shapes); + //if it is different from current summary + if (innerSummary !== current.summary.innerHTML) { + //update + current.summary.innerHTML = innerSummary; + } //if it is different from current map + + if (innerMap !== current.map.innerHTML) { + //update + current.map.innerHTML = innerMap; + } //if it is different from current shape details + + if (innerShapeDetails.details !== current.shapeDetails.innerHTML) { + //update + current.shapeDetails.innerHTML = innerShapeDetails.details; + } + this._accessibleOutputs[idT] = current; + }; + //creates spatial grid that maps the location of shapes + function _gridMap(idT, ingredients) { + var shapeNumber = 0; + var table = ""; + //create an array of arrays 10*10 of empty cells + var cells = Array.from(Array(10), function () { + return Array(10); + }); + for (var x in ingredients) { + for (var y in ingredients[x]) { + var fill = void 0; + if (x !== "line") { + fill = '') + .concat(ingredients[x][y].color, " ") + .concat(x, ""); + } else { + fill = '') + .concat(ingredients[x][y].color, " ") + .concat(x, " midpoint"); + } //if empty cell of location of shape is undefined + + if ( + !cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] + ) { + //fill it with shape info + cells[ingredients[x][y].loc.locY][ + ingredients[x][y].loc.locX + ] = fill; + //if a shape is already in that location + } else { + //add it + cells[ingredients[x][y].loc.locY][ + ingredients[x][y].loc.locX + ] = + cells[ingredients[x][y].loc.locY][ + ingredients[x][y].loc.locX + ] + + " " + + fill; + } + shapeNumber++; + } + } //make table based on array + + for (var _r in cells) { + var row = ""; + for (var c in cells[_r]) { + row = row + ""; + if (cells[_r][c] !== undefined) { + row = row + cells[_r][c]; + } + row = row + ""; + } + table = table + row + ""; + } + return table; + } //creates grid summary + + function _gridSummary(numShapes, background, width, height) { + var text = "" + .concat(background, " canvas, ") + .concat(width, " by ") + .concat(height, " pixels, contains ") + .concat(numShapes[0]); + if (numShapes[0] === 1) { + text = "".concat(text, " shape: ").concat(numShapes[1]); + } else { + text = "".concat(text, " shapes: ").concat(numShapes[1]); + } + return text; + } //creates list of shapes + + function _gridShapeDetails(idT, ingredients) { + var shapeDetails = ""; + var shapes = ""; + var totalShapes = 0; + //goes trhough every shape type in ingredients + for (var x in ingredients) { + var shapeNum = 0; + for (var y in ingredients[x]) { + //it creates a line in a list + var line = '
              • ') + .concat(ingredients[x][y].color, " ") + .concat(x, ","); + if (x === "line") { + line = + line + + " location = " + .concat(ingredients[x][y].pos, ", length = ") + .concat(ingredients[x][y].length, " pixels"); + } else { + line = line + " location = ".concat(ingredients[x][y].pos); + if (x !== "point") { + line = + line + ", area = ".concat(ingredients[x][y].area, " %"); + } + line = line + "
              • "; + } + shapeDetails = shapeDetails + line; + shapeNum++; + totalShapes++; + } + if (shapeNum > 1) { + shapes = "" + .concat(shapes, " ") + .concat(shapeNum, " ") + .concat(x, "s"); + } else { + shapes = "".concat(shapes, " ").concat(shapeNum, " ").concat(x); + } + } + return { + numShapes: [totalShapes, shapes], + details: shapeDetails, + }; + } + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.string.iterator": 210, + }, + ], + 279: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.number.to-fixed"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + /** + * Creates a screen reader-accessible description for shapes on the canvas. + * `textOutput()` adds a general description, list of shapes, and + * table of shapes to the web page. + * + * The general description includes the canvas size, canvas color, and number + * of shapes. For example, + * `Your output is a, 100 by 100 pixels, gray canvas containing the following 2 shapes:`. + * + * A list of shapes follows the general description. The list describes the + * color, location, and area of each shape. For example, + * `a red circle at middle covering 3% of the canvas`. Each shape can be + * selected to get more details. + * + * `textOutput()` uses its table of shapes as a list. The table describes the + * shape, color, location, coordinates and area. For example, + * `red circle location = middle area = 3%`. This is different from + * gridOutput(), which uses its table as a grid. + * + * The `display` parameter is optional. It determines how the description is + * displayed. If `LABEL` is passed, as in `textOutput(LABEL)`, the description + * will be visible in a div element next to the canvas. Using `LABEL` creates + * unhelpful duplicates for screen readers. Only use `LABEL` during + * development. If `FALLBACK` is passed, as in `textOutput(FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method textOutput + * @param {Constant} [display] either FALLBACK or LABEL. + * + * @example + *
                + * + * function setup() { + * // Add the text description. + * textOutput(); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                + * + *
                + * + * function setup() { + * // Add the text description and + * // display it for debugging. + * textOutput(LABEL); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                + * + *
                + * + * function draw() { + * // Add the text description. + * textOutput(); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                + * + *
                + * + * function draw() { + * // Add the text description and + * // display it for debugging. + * textOutput(LABEL); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                + */ + + _main.default.prototype.textOutput = function (display) { + _main.default._validateParameters("textOutput", arguments); + //if textOutput is already true + if (this._accessibleOutputs.text) { + return; + } else { + //make textOutput true + this._accessibleOutputs.text = true; + //create output for fallback + this._createOutput("textOutput", "Fallback"); + if (display === this.LABEL) { + //make textOutput label true + this._accessibleOutputs.textLabel = true; + //create output for label + this._createOutput("textOutput", "Label"); + } + } + }; + /** + * Creates a screen reader-accessible description for shapes on the canvas. + * `gridOutput()` adds a general description, table of shapes, and list of + * shapes to the web page. + * + * The general description includes the canvas size, canvas color, and number of + * shapes. For example, + * `gray canvas, 100 by 100 pixels, contains 2 shapes: 1 circle 1 square`. + * + * `gridOutput()` uses its table of shapes as a grid. Each shape in the grid + * is placed in a cell whose row and column correspond to the shape's location + * on the canvas. The grid cells describe the color and type of shape at that + * location. For example, `red circle`. These descriptions can be selected + * individually to get more details. This is different from + * textOutput(), which uses its table as a list. + * + * A list of shapes follows the table. The list describes the color, type, + * location, and area of each shape. For example, + * `red circle, location = middle, area = 3 %`. + * + * The `display` parameter is optional. It determines how the description is + * displayed. If `LABEL` is passed, as in `gridOutput(LABEL)`, the description + * will be visible in a div element next to the canvas. Using `LABEL` creates + * unhelpful duplicates for screen readers. Only use `LABEL` during + * development. If `FALLBACK` is passed, as in `gridOutput(FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method gridOutput + * @param {Constant} [display] either FALLBACK or LABEL. + * + * @example + *
                + * + * function setup() { + * // Add the grid description. + * gridOutput(); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                + * + *
                + * + * function setup() { + * // Add the grid description and + * // display it for debugging. + * gridOutput(LABEL); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                + * + *
                + * + * function draw() { + * // Add the grid description. + * gridOutput(); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                + * + *
                + * + * function draw() { + * // Add the grid description and + * // display it for debugging. + * gridOutput(LABEL); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                + */ + _main.default.prototype.gridOutput = function (display) { + _main.default._validateParameters("gridOutput", arguments); + //if gridOutput is already true + if (this._accessibleOutputs.grid) { + return; + } else { + //make gridOutput true + this._accessibleOutputs.grid = true; + //create output for fallback + this._createOutput("gridOutput", "Fallback"); + if (display === this.LABEL) { + //make gridOutput label true + this._accessibleOutputs.gridLabel = true; + //create output for label + this._createOutput("gridOutput", "Label"); + } + } + }; + //helper function returns true when accessible outputs are true + _main.default.prototype._addAccsOutput = function () { + //if there are no accessible outputs create object with all false + if (!this._accessibleOutputs) { + this._accessibleOutputs = { + text: false, + grid: false, + textLabel: false, + gridLabel: false, + }; + } + return this._accessibleOutputs.grid || this._accessibleOutputs.text; + }; + //helper function that creates html structure for accessible outputs + _main.default.prototype._createOutput = function (type, display) { + var cnvId = this.canvas.id; + //if there are no ingredients create object. this object stores data for the outputs + if (!this.ingredients) { + this.ingredients = { + shapes: {}, + colors: { + background: "white", + fill: "white", + stroke: "black", + }, + pShapes: "", + }; + } //if there is no dummyDOM create it + + if (!this.dummyDOM) { + this.dummyDOM = document.getElementById(cnvId).parentNode; + } + var cIdT, container, inner; + var query = ""; + if (display === "Fallback") { + cIdT = cnvId + type; + container = cnvId + "accessibleOutput"; + if (!this.dummyDOM.querySelector("#".concat(container))) { + //if there is no canvas description (see describe() and describeElement()) + if ( + !this.dummyDOM.querySelector( + "#".concat(cnvId, "_Description"), + ) + ) { + //create html structure inside of canvas + this.dummyDOM.querySelector("#".concat(cnvId)).innerHTML = + '
                ', + ); + } else { + //create html structure after canvas description container + this.dummyDOM + .querySelector("#".concat(cnvId, "_Description")) + .insertAdjacentHTML( + "afterend", + '
                ', + ), + ); + } + } + } else if (display === "Label") { + query = display; + cIdT = cnvId + type + display; + container = cnvId + "accessibleOutput" + display; + if (!this.dummyDOM.querySelector("#".concat(container))) { + //if there is no canvas description label (see describe() and describeElement()) + if (!this.dummyDOM.querySelector("#".concat(cnvId, "_Label"))) { + //create html structure adjacent to canvas + this.dummyDOM + .querySelector("#".concat(cnvId)) + .insertAdjacentHTML( + "afterend", + '
                '), + ); + } else { + //create html structure after canvas label + this.dummyDOM + .querySelector("#".concat(cnvId, "_Label")) + .insertAdjacentHTML( + "afterend", + '
                '), + ); + } + } + } //create an object to store the latest output. this object is used in _updateTextOutput() and _updateGridOutput() + + this._accessibleOutputs[cIdT] = {}; + if (type === "textOutput") { + query = "#".concat(cnvId, "gridOutput").concat(query); //query is used to check if gridOutput already exists + inner = '
                Text Output

                  ', + ); + //if gridOutput already exists + if (this.dummyDOM.querySelector(query)) { + //create textOutput before gridOutput + this.dummyDOM + .querySelector(query) + .insertAdjacentHTML("beforebegin", inner); + } else { + //create output inside of container + this.dummyDOM.querySelector("#".concat(container)).innerHTML = + inner; + } //store output html elements + + this._accessibleOutputs[cIdT].list = this.dummyDOM.querySelector( + "#".concat(cIdT, "_list"), + ); + } else if (type === "gridOutput") { + query = "#".concat(cnvId, "textOutput").concat(query); //query is used to check if textOutput already exists + inner = '
                  Grid Output

                    ', + ); + //if textOutput already exists + if (this.dummyDOM.querySelector(query)) { + //create gridOutput after textOutput + this.dummyDOM + .querySelector(query) + .insertAdjacentHTML("afterend", inner); + } else { + //create output inside of container + this.dummyDOM.querySelector("#".concat(container)).innerHTML = + inner; + } //store output html elements + + this._accessibleOutputs[cIdT].map = this.dummyDOM.querySelector( + "#".concat(cIdT, "_map"), + ); + } + this._accessibleOutputs[cIdT].shapeDetails = + this.dummyDOM.querySelector("#".concat(cIdT, "_shapeDetails")); + this._accessibleOutputs[cIdT].summary = this.dummyDOM.querySelector( + "#".concat(cIdT, "_summary"), + ); + }; + //this function is called at the end of setup and draw if using + //accessibleOutputs and calls update functions of outputs + _main.default.prototype._updateAccsOutput = function () { + var cnvId = this.canvas.id; + //if the shapes are not the same as before + if ( + JSON.stringify(this.ingredients.shapes) !== + this.ingredients.pShapes + ) { + //save current shapes as string in pShapes + this.ingredients.pShapes = JSON.stringify( + this.ingredients.shapes, + ); + if (this._accessibleOutputs.text) { + this._updateTextOutput(cnvId + "textOutput"); + } + if (this._accessibleOutputs.grid) { + this._updateGridOutput(cnvId + "gridOutput"); + } + if (this._accessibleOutputs.textLabel) { + this._updateTextOutput(cnvId + "textOutputLabel"); + } + if (this._accessibleOutputs.gridLabel) { + this._updateGridOutput(cnvId + "gridOutputLabel"); + } + } + }; + //helper function that resets all ingredients when background is called + //and saves background color name + _main.default.prototype._accsBackground = function (args) { + //save current shapes as string in pShapes + this.ingredients.pShapes = JSON.stringify(this.ingredients.shapes); + //empty shapes JSON + this.ingredients.shapes = {}; + //update background different + if (this.ingredients.colors.backgroundRGBA !== args) { + this.ingredients.colors.backgroundRGBA = args; + this.ingredients.colors.background = this._rgbColorName(args); + } + }; + //helper function that gets fill and stroke of shapes + _main.default.prototype._accsCanvasColors = function (f, args) { + if (f === "fill") { + //update fill different + if (this.ingredients.colors.fillRGBA !== args) { + this.ingredients.colors.fillRGBA = args; + this.ingredients.colors.fill = this._rgbColorName(args); + } + } else if (f === "stroke") { + //update stroke if different + if (this.ingredients.colors.strokeRGBA !== args) { + this.ingredients.colors.strokeRGBA = args; + this.ingredients.colors.stroke = this._rgbColorName(args); + } + } + }; + //builds ingredients.shapes used for building outputs + _main.default.prototype._accsOutput = function (f, args) { + if (f === "ellipse" && args[2] === args[3]) { + f = "circle"; + } else if (f === "rectangle" && args[2] === args[3]) { + f = "square"; + } + var include = {}; + var add = true; + var middle = _getMiddle(f, args); + if (f === "line") { + //make color stroke + include.color = this.ingredients.colors.stroke; + //get lenght + include.length = Math.round( + this.dist(args[0], args[1], args[2], args[3]), + ); + //get position of end points + var p1 = this._getPos(args[0], [1]); + var p2 = this._getPos(args[2], [3]); + include.loc = _canvasLocator(middle, this.width, this.height); + if (p1 === p2) { + include.pos = "at ".concat(p1); + } else { + include.pos = "from ".concat(p1, " to ").concat(p2); + } + } else { + if (f === "point") { + //make color stroke + include.color = this.ingredients.colors.stroke; + } else { + //make color fill + include.color = this.ingredients.colors.fill; + //get area of shape + include.area = this._getArea(f, args); + } //get middle of shapes + //calculate position using middle of shape + + include.pos = this._getPos.apply( + this, + _toConsumableArray(middle), + ); + //calculate location using middle of shape + include.loc = _canvasLocator(middle, this.width, this.height); + } //if it is the first time this shape is created + + if (!this.ingredients.shapes[f]) { + this.ingredients.shapes[f] = [include]; + //if other shapes of this type have been created + } else if (this.ingredients.shapes[f] !== [include]) { + //for every shape of this type + for (var y in this.ingredients.shapes[f]) { + //compare it with current shape and if it already exists make add false + if ( + JSON.stringify(this.ingredients.shapes[f][y]) === + JSON.stringify(include) + ) { + add = false; + } + } //add shape by pushing it to the end + + if (add === true) { + this.ingredients.shapes[f].push(include); + } + } + }; + //gets middle point / centroid of shape + function _getMiddle(f, args) { + var x, y; + if ( + f === "rectangle" || + f === "ellipse" || + f === "arc" || + f === "circle" || + f === "square" + ) { + x = Math.round(args[0] + args[2] / 2); + y = Math.round(args[1] + args[3] / 2); + } else if (f === "triangle") { + x = (args[0] + args[2] + args[4]) / 3; + y = (args[1] + args[3] + args[5]) / 3; + } else if (f === "quadrilateral") { + x = (args[0] + args[2] + args[4] + args[6]) / 4; + y = (args[1] + args[3] + args[5] + args[7]) / 4; + } else if (f === "line") { + x = (args[0] + args[2]) / 2; + y = (args[1] + args[3]) / 2; + } else { + x = args[0]; + y = args[1]; + } + return [x, y]; + } //gets position of shape in the canvas + + _main.default.prototype._getPos = function (x, y) { + var untransformedPosition = new DOMPointReadOnly(x, y); + var currentTransform = this._renderer.isP3D + ? new DOMMatrix(this._renderer.uMVMatrix.mat4) + : this.drawingContext.getTransform(); + var _untransformedPositio = + untransformedPosition.matrixTransform(currentTransform), + transformedX = _untransformedPositio.x, + transformedY = _untransformedPositio.y; + var canvasWidth = this.width, + canvasHeight = this.height; + if (transformedX < 0.4 * canvasWidth) { + if (transformedY < 0.4 * canvasHeight) { + return "top left"; + } else if (transformedY > 0.6 * canvasHeight) { + return "bottom left"; + } else { + return "mid left"; + } + } else if (transformedX > 0.6 * canvasWidth) { + if (transformedY < 0.4 * canvasHeight) { + return "top right"; + } else if (transformedY > 0.6 * canvasHeight) { + return "bottom right"; + } else { + return "mid right"; + } + } else { + if (transformedY < 0.4 * canvasHeight) { + return "top middle"; + } else if (transformedY > 0.6 * canvasHeight) { + return "bottom middle"; + } else { + return "middle"; + } + } + }; + //locates shape in a 10*10 grid + function _canvasLocator(args, canvasWidth, canvasHeight) { + var noRows = 10; + var noCols = 10; + var locX = Math.floor((args[0] / canvasWidth) * noRows); + var locY = Math.floor((args[1] / canvasHeight) * noCols); + if (locX === noRows) { + locX = locX - 1; + } + if (locY === noCols) { + locY = locY - 1; + } + return { + locX: locX, + locY: locY, + }; + } //calculates area of shape + + _main.default.prototype._getArea = function (objectType, shapeArgs) { + var objectArea = 0; + if (objectType === "arc") { + // area of full ellipse = PI * horizontal radius * vertical radius. + // therefore, area of arc = difference bet. arc's start and end radians * horizontal radius * vertical radius. + // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 + var arcSizeInRadians = + (((shapeArgs[5] - shapeArgs[4]) % (Math.PI * 2)) + + Math.PI * 2) % + (Math.PI * 2); + objectArea = (arcSizeInRadians * shapeArgs[2] * shapeArgs[3]) / 8; + if (shapeArgs[6] === "open" || shapeArgs[6] === "chord") { + // when the arc's mode is OPEN or CHORD, we need to account for the area of the triangle that is formed to close the arc + // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ) )/2 + var Ax = shapeArgs[0]; + var Ay = shapeArgs[1]; + var Bx = + shapeArgs[0] + + (shapeArgs[2] / 2) * Math.cos(shapeArgs[4]).toFixed(2); + var By = + shapeArgs[1] + + (shapeArgs[3] / 2) * Math.sin(shapeArgs[4]).toFixed(2); + var Cx = + shapeArgs[0] + + (shapeArgs[2] / 2) * Math.cos(shapeArgs[5]).toFixed(2); + var Cy = + shapeArgs[1] + + (shapeArgs[3] / 2) * Math.sin(shapeArgs[5]).toFixed(2); + var areaOfExtraTriangle = + Math.abs(Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) / + 2; + if (arcSizeInRadians > Math.PI) { + objectArea = objectArea + areaOfExtraTriangle; + } else { + objectArea = objectArea - areaOfExtraTriangle; + } + } + } else if (objectType === "ellipse" || objectType === "circle") { + objectArea = (((3.14 * shapeArgs[2]) / 2) * shapeArgs[3]) / 2; + } else if (objectType === "line") { + objectArea = 0; + } else if (objectType === "point") { + objectArea = 0; + } else if (objectType === "quadrilateral") { + // ((x4+x1)*(y4-y1)+(x1+x2)*(y1-y2)+(x2+x3)*(y2-y3)+(x3+x4)*(y3-y4))/2 + objectArea = + Math.abs( + (shapeArgs[6] + shapeArgs[0]) * + (shapeArgs[7] - shapeArgs[1]) + + (shapeArgs[0] + shapeArgs[2]) * + (shapeArgs[1] - shapeArgs[3]) + + (shapeArgs[2] + shapeArgs[4]) * + (shapeArgs[3] - shapeArgs[5]) + + (shapeArgs[4] + shapeArgs[6]) * + (shapeArgs[5] - shapeArgs[7]), + ) / 2; + } else if (objectType === "rectangle" || objectType === "square") { + objectArea = shapeArgs[2] * shapeArgs[3]; + } else if (objectType === "triangle") { + objectArea = + Math.abs( + shapeArgs[0] * (shapeArgs[3] - shapeArgs[5]) + + shapeArgs[2] * (shapeArgs[5] - shapeArgs[1]) + + shapeArgs[4] * (shapeArgs[1] - shapeArgs[3]), + ) / 2; + // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ))/2 + } // Store the positions of the canvas corners + + var canvasWidth = this.width * this._pixelDensity; + var canvasHeight = this.height * this._pixelDensity; + var canvasCorners = [ + new DOMPoint(0, 0), + new DOMPoint(canvasWidth, 0), + new DOMPoint(canvasWidth, canvasHeight), + new DOMPoint(0, canvasHeight), + ]; + // Apply the inverse of the current transformations to the canvas corners + var currentTransform = this._renderer.isP3D + ? new DOMMatrix(this._renderer.uMVMatrix.mat4) + : this.drawingContext.getTransform(); + var invertedTransform = currentTransform.inverse(); + var tc = canvasCorners.map(function (corner) { + return corner.matrixTransform(invertedTransform); + }); + /* Use same shoelace formula used for quad area (above) to calculate + the area of the canvas with inverted transformation applied */ + var transformedCanvasArea = + Math.abs( + (tc[3].x + tc[0].x) * (tc[3].y - tc[0].y) + + (tc[0].x + tc[1].x) * (tc[0].y - tc[1].y) + + (tc[1].x + tc[2].x) * (tc[1].y - tc[2].y) + + (tc[2].x + tc[3].x) * (tc[2].y - tc[3].y), + ) / 2; + /* Compare area of shape (minus transformations) to area of canvas + with inverted transformation applied. + Return percentage */ + var untransformedArea = Math.round( + (objectArea * 100) / transformedCanvasArea, + ); + return untransformedArea; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.number.to-fixed": 193, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 280: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.concat"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + //the functions in this file support updating the text output + //updates textOutput + + _main.default.prototype._updateTextOutput = function (idT) { + //if html structure is not there yet + if (!this.dummyDOM.querySelector("#".concat(idT, "_summary"))) { + return; + } + var current = this._accessibleOutputs[idT]; + //create shape list + var innerList = _shapeList(idT, this.ingredients.shapes); + //create output summary + var innerSummary = _textSummary( + innerList.numShapes, + this.ingredients.colors.background, + this.width, + this.height, + ); + //create shape details + var innerShapeDetails = _shapeDetails(idT, this.ingredients.shapes); + //if it is different from current summary + if (innerSummary !== current.summary.innerHTML) { + //update + current.summary.innerHTML = innerSummary; + } //if it is different from current shape list + + if (innerList.listShapes !== current.list.innerHTML) { + //update + current.list.innerHTML = innerList.listShapes; + } //if it is different from current shape details + + if (innerShapeDetails !== current.shapeDetails.innerHTML) { + //update + current.shapeDetails.innerHTML = innerShapeDetails; + } + this._accessibleOutputs[idT] = current; + }; + //Builds textOutput summary + function _textSummary(numShapes, background, width, height) { + var text = "Your output is a, " + .concat(width, " by ") + .concat(height, " pixels, ") + .concat(background, " canvas containing the following"); + if (numShapes === 1) { + text = "".concat(text, " shape:"); + } else { + text = "".concat(text, " ").concat(numShapes, " shapes:"); + } + return text; + } //Builds textOutput table with shape details + + function _shapeDetails(idT, ingredients) { + var shapeDetails = ""; + var shapeNumber = 0; + //goes trhough every shape type in ingredients + for (var x in ingredients) { + //and for every shape + for (var y in ingredients[x]) { + //it creates a table row + var row = '') + .concat(ingredients[x][y].color, " ") + .concat(x, ""); + if (x === "line") { + row = + row + + "location = " + .concat(ingredients[x][y].pos, "length = ") + .concat(ingredients[x][y].length, " pixels"); + } else { + row = + row + + "location = ".concat(ingredients[x][y].pos, ""); + if (x !== "point") { + row = + row + + " area = ".concat(ingredients[x][y].area, "%"); + } + row = row + ""; + } + shapeDetails = shapeDetails + row; + shapeNumber++; + } + } + return shapeDetails; + } //Builds textOutput shape list + + function _shapeList(idT, ingredients) { + var shapeList = ""; + var shapeNumber = 0; + //goes trhough every shape type in ingredients + for (var x in ingredients) { + for (var y in ingredients[x]) { + //it creates a line in a list + var _line = '
                  • ') + .concat(ingredients[x][y].color, " ") + .concat(x, ""); + if (x === "line") { + _line = + _line + + ", " + .concat(ingredients[x][y].pos, ", ") + .concat(ingredients[x][y].length, " pixels long.
                  • "); + } else { + _line = _line + ", at ".concat(ingredients[x][y].pos); + if (x !== "point") { + _line = + _line + + ", covering ".concat( + ingredients[x][y].area, + "% of the canvas", + ); + } + _line = _line + "."; + } + shapeList = shapeList + _line; + shapeNumber++; + } + } + return { + numShapes: shapeNumber, + listShapes: shapeList, + }; + } + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + }, + ], + 281: [ + function (_dereq_, module, exports) { + "use strict"; + var _main = _interopRequireDefault(_dereq_("./core/main")); + _dereq_("./core/constants"); + _dereq_("./core/environment"); + _dereq_("./core/friendly_errors/stacktrace"); + _dereq_("./core/friendly_errors/validate_params"); + _dereq_("./core/friendly_errors/file_errors"); + _dereq_("./core/friendly_errors/fes_core"); + _dereq_("./core/friendly_errors/sketch_reader"); + _dereq_("./core/helpers"); + _dereq_("./core/legacy"); + _dereq_("./core/preload"); + _dereq_("./core/p5.Element"); + _dereq_("./core/p5.Graphics"); + _dereq_("./core/p5.Renderer"); + _dereq_("./core/p5.Renderer2D"); + _dereq_("./core/rendering"); + _dereq_("./core/shim"); + _dereq_("./core/structure"); + _dereq_("./core/transform"); + _dereq_("./core/shape/2d_primitives"); + _dereq_("./core/shape/attributes"); + _dereq_("./core/shape/curves"); + _dereq_("./core/shape/vertex"); + _dereq_("./accessibility/outputs"); + _dereq_("./accessibility/textOutput"); + _dereq_("./accessibility/gridOutput"); + _dereq_("./accessibility/color_namer"); + _dereq_("./color/color_conversion"); + _dereq_("./color/creating_reading"); + _dereq_("./color/p5.Color"); + _dereq_("./color/setting"); + _dereq_("./data/p5.TypedDict"); + _dereq_("./data/local_storage.js"); + _dereq_("./dom/dom"); + _dereq_("./accessibility/describe"); + _dereq_("./events/acceleration"); + _dereq_("./events/keyboard"); + _dereq_("./events/mouse"); + _dereq_("./events/touch"); + _dereq_("./image/filters"); + _dereq_("./image/image"); + _dereq_("./image/loading_displaying"); + _dereq_("./image/p5.Image"); + _dereq_("./image/pixels"); + _dereq_("./io/files"); + _dereq_("./io/p5.Table"); + _dereq_("./io/p5.TableRow"); + _dereq_("./io/p5.XML"); + _dereq_("./math/calculation"); + _dereq_("./math/math"); + _dereq_("./math/noise"); + _dereq_("./math/p5.Vector"); + _dereq_("./math/random"); + _dereq_("./math/trigonometry"); + _dereq_("./typography/attributes"); + _dereq_("./typography/loading_displaying"); + _dereq_("./typography/p5.Font"); + _dereq_("./utilities/array_functions"); + _dereq_("./utilities/conversion"); + _dereq_("./utilities/string_functions"); + _dereq_("./utilities/time_date"); + _dereq_("./webgl/3d_primitives"); + _dereq_("./webgl/interaction"); + _dereq_("./webgl/light"); + _dereq_("./webgl/loading"); + _dereq_("./webgl/material"); + _dereq_("./webgl/p5.Camera"); + _dereq_("./webgl/p5.DataArray"); + _dereq_("./webgl/p5.Geometry"); + _dereq_("./webgl/p5.Matrix"); + _dereq_("./webgl/p5.RendererGL.Immediate"); + _dereq_("./webgl/p5.RendererGL"); + _dereq_("./webgl/p5.RendererGL.Retained"); + _dereq_("./webgl/p5.Framebuffer"); + _dereq_("./webgl/p5.Shader"); + _dereq_("./webgl/p5.RenderBuffer"); + _dereq_("./webgl/p5.Texture"); + _dereq_("./webgl/text"); + _dereq_("./core/init"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } // core + //accessibility + // color + // data + // DOM + // accessibility + // events + // image + // io + // math + // typography + // utilities + // webgl + + module.exports = _main.default; + }, + { + "./accessibility/color_namer": 276, + "./accessibility/describe": 277, + "./accessibility/gridOutput": 278, + "./accessibility/outputs": 279, + "./accessibility/textOutput": 280, + "./color/color_conversion": 282, + "./color/creating_reading": 283, + "./color/p5.Color": 284, + "./color/setting": 285, + "./core/constants": 286, + "./core/environment": 287, + "./core/friendly_errors/fes_core": 289, + "./core/friendly_errors/file_errors": 290, + "./core/friendly_errors/sketch_reader": 291, + "./core/friendly_errors/stacktrace": 292, + "./core/friendly_errors/validate_params": 293, + "./core/helpers": 294, + "./core/init": 295, + "./core/legacy": 297, + "./core/main": 298, + "./core/p5.Element": 299, + "./core/p5.Graphics": 300, + "./core/p5.Renderer": 301, + "./core/p5.Renderer2D": 302, + "./core/preload": 303, + "./core/rendering": 304, + "./core/shape/2d_primitives": 305, + "./core/shape/attributes": 306, + "./core/shape/curves": 307, + "./core/shape/vertex": 308, + "./core/shim": 309, + "./core/structure": 310, + "./core/transform": 311, + "./data/local_storage.js": 312, + "./data/p5.TypedDict": 313, + "./dom/dom": 314, + "./events/acceleration": 315, + "./events/keyboard": 316, + "./events/mouse": 317, + "./events/touch": 318, + "./image/filters": 319, + "./image/image": 320, + "./image/loading_displaying": 321, + "./image/p5.Image": 322, + "./image/pixels": 323, + "./io/files": 324, + "./io/p5.Table": 325, + "./io/p5.TableRow": 326, + "./io/p5.XML": 327, + "./math/calculation": 328, + "./math/math": 329, + "./math/noise": 330, + "./math/p5.Vector": 331, + "./math/random": 332, + "./math/trigonometry": 333, + "./typography/attributes": 334, + "./typography/loading_displaying": 335, + "./typography/p5.Font": 336, + "./utilities/array_functions": 337, + "./utilities/conversion": 338, + "./utilities/string_functions": 339, + "./utilities/time_date": 340, + "./webgl/3d_primitives": 341, + "./webgl/interaction": 343, + "./webgl/light": 344, + "./webgl/loading": 345, + "./webgl/material": 346, + "./webgl/p5.Camera": 347, + "./webgl/p5.DataArray": 348, + "./webgl/p5.Framebuffer": 349, + "./webgl/p5.Geometry": 350, + "./webgl/p5.Matrix": 351, + "./webgl/p5.RenderBuffer": 352, + "./webgl/p5.RendererGL": 355, + "./webgl/p5.RendererGL.Immediate": 353, + "./webgl/p5.RendererGL.Retained": 354, + "./webgl/p5.Shader": 356, + "./webgl/p5.Texture": 357, + "./webgl/text": 358, + }, + ], + 282: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Color + * @submodule Color Conversion + * @for p5 + * @requires core + */ + /** + * Conversions adapted from . + * + * In these functions, hue is always in the range [0, 1], just like all other + * components are in the range [0, 1]. 'Brightness' and 'value' are used + * interchangeably. + */ + + _main.default.ColorConversion = { + /** + * Convert an HSBA array to HSLA. + */ + _hsbaToHSLA: function _hsbaToHSLA(hsba) { + var hue = hsba[0]; + var sat = hsba[1]; + var val = hsba[2]; + // Calculate lightness. + var li = ((2 - sat) * val) / 2; + // Convert saturation. + if (li !== 0) { + if (li === 1) { + sat = 0; + } else if (li < 0.5) { + sat = sat / (2 - sat); + } else { + sat = (sat * val) / (2 - li * 2); + } + } // Hue and alpha stay the same. + + return [hue, sat, li, hsba[3]]; + }, + /** + * Convert an HSBA array to RGBA. + */ + _hsbaToRGBA: function _hsbaToRGBA(hsba) { + var hue = hsba[0] * 6; // We will split hue into 6 sectors. + var sat = hsba[1]; + var val = hsba[2]; + var RGBA = []; + if (sat === 0) { + RGBA = [val, val, val, hsba[3]]; // Return early if grayscale. + } else { + var sector = Math.floor(hue); + var tint1 = val * (1 - sat); + var tint2 = val * (1 - sat * (hue - sector)); + var tint3 = val * (1 - sat * (1 + sector - hue)); + var red, green, blue; + if (sector === 1) { + // Yellow to green. + red = tint2; + green = val; + blue = tint1; + } else if (sector === 2) { + // Green to cyan. + red = tint1; + green = val; + blue = tint3; + } else if (sector === 3) { + // Cyan to blue. + red = tint1; + green = tint2; + blue = val; + } else if (sector === 4) { + // Blue to magenta. + red = tint3; + green = tint1; + blue = val; + } else if (sector === 5) { + // Magenta to red. + red = val; + green = tint1; + blue = tint2; + } else { + // Red to yellow (sector could be 0 or 6). + red = val; + green = tint3; + blue = tint1; + } + RGBA = [red, green, blue, hsba[3]]; + } + return RGBA; + }, + /** + * Convert an HSLA array to HSBA. + */ + _hslaToHSBA: function _hslaToHSBA(hsla) { + var hue = hsla[0]; + var sat = hsla[1]; + var li = hsla[2]; + // Calculate brightness. + var val; + if (li < 0.5) { + val = (1 + sat) * li; + } else { + val = li + sat - li * sat; + } // Convert saturation. + + sat = (2 * (val - li)) / val; + // Hue and alpha stay the same. + return [hue, sat, val, hsla[3]]; + }, + /** + * Convert an HSLA array to RGBA. + * + * We need to change basis from HSLA to something that can be more easily be + * projected onto RGBA. We will choose hue and brightness as our first two + * components, and pick a convenient third one ('zest') so that we don't need + * to calculate formal HSBA saturation. + */ + _hslaToRGBA: function _hslaToRGBA(hsla) { + var hue = hsla[0] * 6; // We will split hue into 6 sectors. + var sat = hsla[1]; + var li = hsla[2]; + var RGBA = []; + if (sat === 0) { + RGBA = [li, li, li, hsla[3]]; // Return early if grayscale. + } else { + // Calculate brightness. + var val; + if (li < 0.5) { + val = (1 + sat) * li; + } else { + val = li + sat - li * sat; + } // Define zest. + + var zest = 2 * li - val; + // Implement projection (project onto green by default). + var hzvToRGB = function hzvToRGB(hue, zest, val) { + if (hue < 0) { + // Hue must wrap to allow projection onto red and blue. + hue += 6; + } else if (hue >= 6) { + hue -= 6; + } + if (hue < 1) { + // Red to yellow (increasing green). + return zest + (val - zest) * hue; + } else if (hue < 3) { + // Yellow to cyan (greatest green). + return val; + } else if (hue < 4) { + // Cyan to blue (decreasing green). + return zest + (val - zest) * (4 - hue); + } else { + // Blue to red (least green). + return zest; + } + }; + // Perform projections, offsetting hue as necessary. + RGBA = [ + hzvToRGB(hue + 2, zest, val), + hzvToRGB(hue, zest, val), + hzvToRGB(hue - 2, zest, val), + hsla[3], + ]; + } + return RGBA; + }, + /** + * Convert an RGBA array to HSBA. + */ + _rgbaToHSBA: function _rgbaToHSBA(rgba) { + var red = rgba[0]; + var green = rgba[1]; + var blue = rgba[2]; + var val = Math.max(red, green, blue); + var chroma = val - Math.min(red, green, blue); + var hue, sat; + if (chroma === 0) { + // Return early if grayscale. + hue = 0; + sat = 0; + } else { + sat = chroma / val; + if (red === val) { + // Magenta to yellow. + hue = (green - blue) / chroma; + } else if (green === val) { + // Yellow to cyan. + hue = 2 + (blue - red) / chroma; + } else if (blue === val) { + // Cyan to magenta. + hue = 4 + (red - green) / chroma; + } + if (hue < 0) { + // Confine hue to the interval [0, 1). + hue += 6; + } else if (hue >= 6) { + hue -= 6; + } + } + return [hue / 6, sat, val, rgba[3]]; + }, + /** + * Convert an RGBA array to HSLA. + */ + _rgbaToHSLA: function _rgbaToHSLA(rgba) { + var red = rgba[0]; + var green = rgba[1]; + var blue = rgba[2]; + var val = Math.max(red, green, blue); + var min = Math.min(red, green, blue); + var li = val + min; // We will halve this later. + var chroma = val - min; + var hue, sat; + if (chroma === 0) { + // Return early if grayscale. + hue = 0; + sat = 0; + } else { + if (li < 1) { + sat = chroma / li; + } else { + sat = chroma / (2 - li); + } + if (red === val) { + // Magenta to yellow. + hue = (green - blue) / chroma; + } else if (green === val) { + // Yellow to cyan. + hue = 2 + (blue - red) / chroma; + } else if (blue === val) { + // Cyan to magenta. + hue = 4 + (red - green) / chroma; + } + if (hue < 0) { + // Confine hue to the interval [0, 1). + hue += 6; + } else if (hue >= 6) { + hue -= 6; + } + } + return [hue / 6, sat, li / 2, rgba[3]]; + }, + }; + var _default = _main.default.ColorConversion; + exports.default = _default; + }, + { + "../core/main": 298, + }, + ], + 283: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.map"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + _dereq_("./p5.Color"); + _dereq_("../core/friendly_errors/validate_params"); + _dereq_("../core/friendly_errors/file_errors"); + _dereq_("../core/friendly_errors/fes_core"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Color + * @submodule Creating & Reading + * @for p5 + * @requires core + * @requires constants + */ + /** + * Extracts the alpha (transparency) value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method alpha + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the alpha value. + * + * @example + *
                    + * + * noStroke(); + * const c = color(0, 126, 255, 102); + * fill(c); + * rect(15, 15, 35, 70); + * // Sets 'alphaValue' to 102. + * const alphaValue = alpha(c); + * fill(alphaValue); + * rect(50, 15, 35, 70); + * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.'); + * + *
                    + */ + + _main.default.prototype.alpha = function (c) { + _main.default._validateParameters("alpha", arguments); + return this.color(c)._getAlpha(); + }; + /** + * Extracts the blue value from a p5.Color object, + * array of color components, or CSS color string. + * + * @method blue + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the blue value. + * @example + *
                    + * + * const c = color(175, 100, 220); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'blueValue' to 220. + * const blueValue = blue(c); + * fill(0, 0, blueValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The left one is light purple and the right one is royal blue.'); + * + *
                    + * + */ + _main.default.prototype.blue = function (c) { + _main.default._validateParameters("blue", arguments); + return this.color(c)._getBlue(); + }; + /** + * Extracts the HSB brightness value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method brightness + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the brightness value. + * + * @example + *
                    + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color(0, 126, 255); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'brightValue' to 255. + * const brightValue = brightness(c); + * fill(brightValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The left one is salmon pink and the right one is white.'); + * + *
                    + * + *
                    + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color('hsb(60, 100%, 50%)'); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'brightValue' to 127.5 (50% of 255) + * const brightValue = brightness(c); + * fill(brightValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The left one is olive and the right one is gray.'); + * + *
                    + */ + _main.default.prototype.brightness = function (c) { + _main.default._validateParameters("brightness", arguments); + return this.color(c)._getBrightness(); + }; + /** + * Creates a p5.Color object. By default, the + * parameters are interpreted as RGB values. Calling `color(255, 204, 0)` will + * return a bright yellow color. The way these parameters are interpreted may + * be changed with the colorMode() function. + * + * The version of `color()` with one parameter interprets the value one of two + * ways. If the parameter is a number, it's interpreted as a grayscale value. + * If the parameter is a string, it's interpreted as a CSS color string. + * + * The version of `color()` with two parameters interprets the first one as a + * grayscale value. The second parameter sets the alpha (transparency) value. + * + * The version of `color()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current `colorMode()`. + * + * The version of `color()` with four parameters interprets them as RGBA, HSBA, + * or HSLA colors, depending on the current `colorMode()`. The last parameter + * sets the alpha (transparency) value. + * + * @method color + * @param {Number} gray number specifying value between white and black. + * @param {Number} [alpha] alpha value relative to current color range + * (default is 0-255). + * @return {p5.Color} resulting color. + * + * @example + *
                    + * + * const c = color(255, 204, 0); + * fill(c); + * noStroke(); + * rect(30, 20, 55, 55); + * describe('A yellow rectangle on a gray canvas.'); + * + *
                    + * + *
                    + * + * // RGB values. + * let c = color(255, 204, 0); + * fill(c); + * noStroke(); + * circle(25, 25, 80); + * // A grayscale value. + * c = color(65); + * fill(c); + * circle(75, 75, 80); + * describe( + * 'Two ellipses. The circle in the top-left corner is yellow and the one at the bottom-right is gray.' + * ); + * + *
                    + * + *
                    + * + * // A CSS named color. + * const c = color('magenta'); + * fill(c); + * noStroke(); + * square(20, 20, 60); + * describe('A magenta square on a gray canvas.'); + * + *
                    + * + *
                    + * + * // CSS hex color codes. + * noStroke(); + * let c = color('#0f0'); + * fill(c); + * rect(0, 10, 45, 80); + * c = color('#00ff00'); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two bright green rectangles on a gray canvas.'); + * + *
                    + * + *
                    + * + * // RGB and RGBA color strings. + * noStroke(); + * let c = color('rgb(0,0,255)'); + * fill(c); + * square(10, 10, 35); + * c = color('rgb(0%, 0%, 100%)'); + * fill(c); + * square(55, 10, 35); + * c = color('rgba(0, 0, 255, 1)'); + * fill(c); + * square(10, 55, 35); + * c = color('rgba(0%, 0%, 100%, 1)'); + * fill(c); + * square(55, 55, 35); + * describe('Four blue squares in corners of a gray canvas.'); + * + *
                    + * + *
                    + * + * // HSL and HSLA color strings. + * let c = color('hsl(160, 100%, 50%)'); + * noStroke(); + * fill(c); + * rect(0, 10, 45, 80); + * c = color('hsla(160, 100%, 50%, 0.5)'); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two sea green rectangles. A darker rectangle on the left and a brighter one on the right.'); + * + *
                    + * + *
                    + * + * // HSB and HSBA color strings. + * let c = color('hsb(160, 100%, 50%)'); + * noStroke(); + * fill(c); + * rect(0, 10, 45, 80); + * c = color('hsba(160, 100%, 50%, 0.5)'); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two green rectangles. A darker rectangle on the left and a brighter one on the right.'); + * + *
                    + * + *
                    + * + * // Changing color modes. + * noStroke(); + * let c = color(50, 55, 100); + * fill(c); + * rect(0, 10, 45, 80); + * colorMode(HSB, 100); + * c = color(50, 55, 100); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two blue rectangles. A darker rectangle on the left and a brighter one on the right.'); + * + *
                    + */ + /** + * @method color + * @param {Number} v1 red or hue value relative to + * the current color range. + * @param {Number} v2 green or saturation value + * relative to the current color range. + * @param {Number} v3 blue or brightness value + * relative to the current color range. + * @param {Number} [alpha] + * @return {p5.Color} + */ + /** + * @method color + * @param {String} value a color string. + * @return {p5.Color} + */ + /** + * @method color + * @param {Number[]} values an array containing the red, green, blue, + * and alpha components of the color. + * @return {p5.Color} + */ + /** + * @method color + * @param {p5.Color} color + * @return {p5.Color} + */ + _main.default.prototype.color = function () { + _main.default._validateParameters("color", arguments); + if (arguments[0] instanceof _main.default.Color) { + return arguments[0]; // Do nothing if argument is already a color object. + } + var args = arguments[0] instanceof Array ? arguments[0] : arguments; + return new _main.default.Color(this, args); + }; + /** + * Extracts the green value from a p5.Color object, + * array of color components, or CSS color string. + * + * @method green + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the green value. + * @example + *
                    + * + * const c = color(20, 75, 200); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'greenValue' to 75. + * const greenValue = green(c); + * fill(0, greenValue, 0); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The rectangle on the left is blue and the one on the right is green.'); + * + *
                    + */ + _main.default.prototype.green = function (c) { + _main.default._validateParameters("green", arguments); + return this.color(c)._getGreen(); + }; + /** + * Extracts the hue value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * Hue exists in both HSB and HSL. It describes a color's position on the + * color wheel. By default, this function returns the HSL-normalized hue. If + * the colorMode() is set to HSB, it returns the + * HSB-normalized hue. + * + * @method hue + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the hue + * @example + *
                    + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color(0, 126, 255); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'hueValue' to 0. + * const hueValue = hue(c); + * fill(hueValue); + * rect(50, 20, 35, 60); + * describe( + * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.' + * ); + * + *
                    + * + */ + _main.default.prototype.hue = function (c) { + _main.default._validateParameters("hue", arguments); + return this.color(c)._getHue(); + }; + /** + * Blends two colors to find a third color between them. The `amt` parameter + * specifies the amount to interpolate between the two values. 0 is equal to + * the first color, 0.1 is very near the first color, 0.5 is halfway between + * the two colors, and so on. Negative numbers are set to 0. Numbers greater + * than 1 are set to 1. This differs from the behavior of + * lerp. It's necessary because numbers outside of the + * interval [0, 1] will produce strange and unexpected colors. + * + * The way that colors are interpolated depends on the current + * colorMode(). + * + * @method lerpColor + * @param {p5.Color} c1 interpolate from this color. + * @param {p5.Color} c2 interpolate to this color. + * @param {Number} amt number between 0 and 1. + * @return {p5.Color} interpolated color. + * + * @example + *
                    + * + * colorMode(RGB); + * stroke(255); + * background(51); + * const from = color(218, 165, 32); + * const to = color(72, 61, 139); + * colorMode(RGB); + * const interA = lerpColor(from, to, 0.33); + * const interB = lerpColor(from, to, 0.66); + * fill(from); + * rect(10, 20, 20, 60); + * fill(interA); + * rect(30, 20, 20, 60); + * fill(interB); + * rect(50, 20, 20, 60); + * fill(to); + * rect(70, 20, 20, 60); + * describe( + * 'Four rectangles with white edges. From left to right, the rectangles are tan, brown, brownish purple, and purple.' + * ); + * + *
                    + */ + _main.default.prototype.lerpColor = function (c1, c2, amt) { + _main.default._validateParameters("lerpColor", arguments); + var mode = this._colorMode; + var maxes = this._colorMaxes; + var l0, l1, l2, l3; + var fromArray, toArray; + if (mode === constants.RGB) { + fromArray = c1.levels.map(function (level) { + return level / 255; + }); + toArray = c2.levels.map(function (level) { + return level / 255; + }); + } else if (mode === constants.HSB) { + c1._getBrightness(); // Cache hsba so it definitely exists. + c2._getBrightness(); + fromArray = c1.hsba; + toArray = c2.hsba; + } else if (mode === constants.HSL) { + c1._getLightness(); // Cache hsla so it definitely exists. + c2._getLightness(); + fromArray = c1.hsla; + toArray = c2.hsla; + } else { + throw new Error( + "".concat(mode, "cannot be used for interpolation."), + ); + } // Prevent extrapolation. + + amt = Math.max(Math.min(amt, 1), 0); + // Define lerp here itself if user isn't using math module. + // Maintains the definition as found in math/calculation.js + if (typeof this.lerp === "undefined") { + this.lerp = function (start, stop, amt) { + return amt * (stop - start) + start; + }; + } // Perform interpolation. + + l0 = this.lerp(fromArray[0], toArray[0], amt); + l1 = this.lerp(fromArray[1], toArray[1], amt); + l2 = this.lerp(fromArray[2], toArray[2], amt); + l3 = this.lerp(fromArray[3], toArray[3], amt); + // Scale components. + l0 *= maxes[mode][0]; + l1 *= maxes[mode][1]; + l2 *= maxes[mode][2]; + l3 *= maxes[mode][3]; + return this.color(l0, l1, l2, l3); + }; + /** + * Extracts the HSL lightness value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method lightness + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the lightness + * + * @example + *
                    + * + * noStroke(); + * colorMode(HSL); + * const c = color(156, 100, 50, 1); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'lightValue' to 50. + * const lightValue = lightness(c); + * fill(lightValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The rectangle on the left is light green and the one on the right is gray.'); + * + *
                    + */ + _main.default.prototype.lightness = function (c) { + _main.default._validateParameters("lightness", arguments); + return this.color(c)._getLightness(); + }; + /** + * Extracts the red value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method red + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the red value. + * @example + *
                    + * + * const c = color(255, 204, 0); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'redValue' to 255. + * const redValue = red(c); + * fill(redValue, 0, 0); + * rect(50, 20, 35, 60); + * describe( + * 'Two rectangles with black edges. The rectangle on the left is yellow and the one on the right is red.' + * ); + * + *
                    + */ + _main.default.prototype.red = function (c) { + _main.default._validateParameters("red", arguments); + return this.color(c)._getRed(); + }; + /** + * Extracts the saturation value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * Saturation is scaled differently in HSB and HSL. By default, this function + * returns the HSL saturation. If the colorMode() + * is set to HSB, it returns the HSB saturation. + * + * @method saturation + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the saturation value + * @example + *
                    + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color(0, 126, 255); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'satValue' to 126. + * const satValue = saturation(c); + * fill(satValue); + * rect(50, 20, 35, 60); + * describe( + * 'Two rectangles. The rectangle on the left is deep pink and the one on the right is gray.' + * ); + * + *
                    + */ + _main.default.prototype.saturation = function (c) { + _main.default._validateParameters("saturation", arguments); + return this.color(c)._getSaturation(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/friendly_errors/fes_core": 289, + "../core/friendly_errors/file_errors": 290, + "../core/friendly_errors/validate_params": 293, + "../core/main": 298, + "./p5.Color": 284, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 284: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.trim"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + var _color_conversion = _interopRequireDefault( + _dereq_("./color_conversion"), + ); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Color + * @submodule Creating & Reading + * @for p5 + * @requires core + * @requires constants + * @requires color_conversion + */ + /** + * CSS named colors. + */ + + var namedColors = { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyan: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + rebeccapurple: "#663399", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + steelblue: "#4682b4", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + tomato: "#ff6347", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32", + }; + /** + * These regular expressions are used to build up the patterns for matching + * viable CSS color strings: fragmenting the regexes in this way increases the + * legibility and comprehensibility of the code. + * + * Note that RGB values of .9 are not parsed by IE, but are supported here for + * color string consistency. + */ + var WHITESPACE = /\s*/; // Match zero or more whitespace characters. + var INTEGER = /(\d{1,3})/; // Match integers: 79, 255, etc. + var DECIMAL = /((?:\d+(?:\.\d+)?)|(?:\.\d+))/; // Match 129.6, 79, .9, etc. + var PERCENT = new RegExp("".concat(DECIMAL.source, "%")); // Match 12.9%, 79%, .9%, etc. + /** + * Full color string patterns. The capture groups are necessary. + */ + var colorPatterns = { + // Match colors in format #XXX, e.g. #416. + HEX3: /^#([a-f0-9])([a-f0-9])([a-f0-9])$/i, + // Match colors in format #XXXX, e.g. #5123. + HEX4: /^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i, + // Match colors in format #XXXXXX, e.g. #b4d455. + HEX6: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, + // Match colors in format #XXXXXXXX, e.g. #b4d45535. + HEX8: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, + // Match colors in format rgb(R, G, B), e.g. rgb(255, 0, 128). + RGB: new RegExp( + [ + "^rgb\\(", + INTEGER.source, + ",", + INTEGER.source, + ",", + INTEGER.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format rgb(R%, G%, B%), e.g. rgb(100%, 0%, 28.9%). + RGB_PERCENT: new RegExp( + [ + "^rgb\\(", + PERCENT.source, + ",", + PERCENT.source, + ",", + PERCENT.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format rgb(R, G, B, A), e.g. rgb(255, 0, 128, 0.25). + RGBA: new RegExp( + [ + "^rgba\\(", + INTEGER.source, + ",", + INTEGER.source, + ",", + INTEGER.source, + ",", + DECIMAL.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format rgb(R%, G%, B%, A), e.g. rgb(100%, 0%, 28.9%, 0.5). + RGBA_PERCENT: new RegExp( + [ + "^rgba\\(", + PERCENT.source, + ",", + PERCENT.source, + ",", + PERCENT.source, + ",", + DECIMAL.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format hsla(H, S%, L%), e.g. hsl(100, 40%, 28.9%). + HSL: new RegExp( + [ + "^hsl\\(", + INTEGER.source, + ",", + PERCENT.source, + ",", + PERCENT.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format hsla(H, S%, L%, A), e.g. hsla(100, 40%, 28.9%, 0.5). + HSLA: new RegExp( + [ + "^hsla\\(", + INTEGER.source, + ",", + PERCENT.source, + ",", + PERCENT.source, + ",", + DECIMAL.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format hsb(H, S%, B%), e.g. hsb(100, 40%, 28.9%). + HSB: new RegExp( + [ + "^hsb\\(", + INTEGER.source, + ",", + PERCENT.source, + ",", + PERCENT.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + // Match colors in format hsba(H, S%, B%, A), e.g. hsba(100, 40%, 28.9%, 0.5). + HSBA: new RegExp( + [ + "^hsba\\(", + INTEGER.source, + ",", + PERCENT.source, + ",", + PERCENT.source, + ",", + DECIMAL.source, + "\\)$", + ].join(WHITESPACE.source), + "i", + ), + }; + /** + * A class to describe a color. Each `p5.Color` object stores the color mode + * and level maxes that were active during its construction. These values are + * used to interpret the arguments passed to the object's constructor. They + * also determine output formatting such as when + * saturation() is called. + * + * Color is stored internally as an array of ideal RGBA values in floating + * point form, normalized from 0 to 1. These values are used to calculate the + * closest screen colors, which are RGBA levels from 0 to 255. Screen colors + * are sent to the renderer. + * + * When different color representations are calculated, the results are cached + * for performance. These values are normalized, floating-point numbers. + * + * color() is the recommended way to create an instance + * of this class. + * + * @class p5.Color + * @constructor + * @param {p5} [pInst] pointer to p5 instance. + * + * @param {Number[]|String} vals an array containing the color values + * for red, green, blue and alpha channel + * or CSS color. + */ + _main.default.Color = /*#__PURE__*/ (function () { + function Color(pInst, vals) { + _classCallCheck(this, Color); + // Record color mode and maxes at time of construction. + this._storeModeAndMaxes(pInst._colorMode, pInst._colorMaxes); + // Calculate normalized RGBA values. + if ( + ![constants.RGB, constants.HSL, constants.HSB].includes( + this.mode, + ) + ) { + throw new Error( + "".concat(this.mode, " is an invalid colorMode."), + ); + } else { + this._array = Color._parseInputs.apply(this, vals); + } // Expose closest screen color. + + this._calculateLevels(); + } /** + * Returns the color formatted as a string. Doing so can be useful for + * debugging, or for using p5.js with other libraries. + * + * @method toString + * @param {String} [format] how the color string will be formatted. + * Leaving this empty formats the string as rgba(r, g, b, a). + * '#rgb' '#rgba' '#rrggbb' and '#rrggbbaa' format as hexadecimal color codes. + * 'rgb' 'hsb' and 'hsl' return the color formatted in the specified color mode. + * 'rgba' 'hsba' and 'hsla' are the same as above but with alpha channels. + * 'rgb%' 'hsb%' 'hsl%' 'rgba%' 'hsba%' and 'hsla%' format as percentages. + * @return {String} the formatted string. + * + * @example + *
                    + * + * createCanvas(200, 100); + * stroke(255); + * const myColor = color(100, 100, 250); + * fill(myColor); + * rotate(HALF_PI); + * text(myColor.toString(), 0, -5); + * text(myColor.toString('#rrggbb'), 0, -30); + * text(myColor.toString('rgba%'), 0, -55); + * describe('Three text representation of a color written sideways.'); + * + *
                    + * + *
                    + * + * const myColor = color(100, 130, 250); + * text(myColor.toString('#rrggbb'), 25, 25); + * describe('A hexadecimal representation of a color.'); + * + *
                    + */ + + _createClass( + Color, + [ + { + key: "toString", + value: function toString(format) { + var a = this.levels; + var f = this._array; + var alpha = f[3]; // String representation uses normalized alpha + switch (format) { + case "#rrggbb": + return "#".concat( + a[0] < 16 + ? "0".concat(a[0].toString(16)) + : a[0].toString(16), + a[1] < 16 + ? "0".concat(a[1].toString(16)) + : a[1].toString(16), + a[2] < 16 + ? "0".concat(a[2].toString(16)) + : a[2].toString(16), + ); + case "#rrggbbaa": + return "#".concat( + a[0] < 16 + ? "0".concat(a[0].toString(16)) + : a[0].toString(16), + a[1] < 16 + ? "0".concat(a[1].toString(16)) + : a[1].toString(16), + a[2] < 16 + ? "0".concat(a[2].toString(16)) + : a[2].toString(16), + a[3] < 16 + ? "0".concat(a[3].toString(16)) + : a[3].toString(16), + ); + case "#rgb": + return "#".concat( + Math.round(f[0] * 15).toString(16), + Math.round(f[1] * 15).toString(16), + Math.round(f[2] * 15).toString(16), + ); + case "#rgba": + return "#".concat( + Math.round(f[0] * 15).toString(16), + Math.round(f[1] * 15).toString(16), + Math.round(f[2] * 15).toString(16), + Math.round(f[3] * 15).toString(16), + ); + case "rgb": + return "rgb(".concat(a[0], ", ", a[1], ", ", a[2], ")"); + case "rgb%": + return "rgb(".concat( + (100 * f[0]).toPrecision(3), + "%, ", + (100 * f[1]).toPrecision(3), + "%, ", + (100 * f[2]).toPrecision(3), + "%)", + ); + case "rgba%": + return "rgba(".concat( + (100 * f[0]).toPrecision(3), + "%, ", + (100 * f[1]).toPrecision(3), + "%, ", + (100 * f[2]).toPrecision(3), + "%, ", + (100 * f[3]).toPrecision(3), + "%)", + ); + case "hsb": + case "hsv": + if (!this.hsba) + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + return "hsb(".concat( + this.hsba[0] * this.maxes[constants.HSB][0], + ", ", + this.hsba[1] * this.maxes[constants.HSB][1], + ", ", + this.hsba[2] * this.maxes[constants.HSB][2], + ")", + ); + case "hsb%": + case "hsv%": + if (!this.hsba) + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + return "hsb(".concat( + (100 * this.hsba[0]).toPrecision(3), + "%, ", + (100 * this.hsba[1]).toPrecision(3), + "%, ", + (100 * this.hsba[2]).toPrecision(3), + "%)", + ); + case "hsba": + case "hsva": + if (!this.hsba) + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + return "hsba(".concat( + this.hsba[0] * this.maxes[constants.HSB][0], + ", ", + this.hsba[1] * this.maxes[constants.HSB][1], + ", ", + this.hsba[2] * this.maxes[constants.HSB][2], + ", ", + alpha, + ")", + ); + case "hsba%": + case "hsva%": + if (!this.hsba) + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + return "hsba(".concat( + (100 * this.hsba[0]).toPrecision(3), + "%, ", + (100 * this.hsba[1]).toPrecision(3), + "%, ", + (100 * this.hsba[2]).toPrecision(3), + "%, ", + (100 * alpha).toPrecision(3), + "%)", + ); + case "hsl": + if (!this.hsla) + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + return "hsl(".concat( + this.hsla[0] * this.maxes[constants.HSL][0], + ", ", + this.hsla[1] * this.maxes[constants.HSL][1], + ", ", + this.hsla[2] * this.maxes[constants.HSL][2], + ")", + ); + case "hsl%": + if (!this.hsla) + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + return "hsl(".concat( + (100 * this.hsla[0]).toPrecision(3), + "%, ", + (100 * this.hsla[1]).toPrecision(3), + "%, ", + (100 * this.hsla[2]).toPrecision(3), + "%)", + ); + case "hsla": + if (!this.hsla) + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + return "hsla(".concat( + this.hsla[0] * this.maxes[constants.HSL][0], + ", ", + this.hsla[1] * this.maxes[constants.HSL][1], + ", ", + this.hsla[2] * this.maxes[constants.HSL][2], + ", ", + alpha, + ")", + ); + case "hsla%": + if (!this.hsla) + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + return "hsl(".concat( + (100 * this.hsla[0]).toPrecision(3), + "%, ", + (100 * this.hsla[1]).toPrecision(3), + "%, ", + (100 * this.hsla[2]).toPrecision(3), + "%, ", + (100 * alpha).toPrecision(3), + "%)", + ); + case "rgba": + default: + return "rgba(".concat( + a[0], + ",", + a[1], + ",", + a[2], + ",", + alpha, + ")", + ); + } + } /** + * Sets the red component of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setRed + * @param {Number} red the new red value. + * + * @example + *
                    + * + * let backgroundColor; + * + * function setup() { + * backgroundColor = color(100, 50, 150); + * } + * + * function draw() { + * backgroundColor.setRed(128 + 128 * sin(millis() / 1000)); + * background(backgroundColor); + * describe('A canvas with a gradually changing background color.'); + * } + * + *
                    + */, + }, + { + key: "setRed", + value: function setRed(new_red) { + this._array[0] = new_red / this.maxes[constants.RGB][0]; + this._calculateLevels(); + } /** + * Sets the green component of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setGreen + * @param {Number} green the new green value. + * + * @example + *
                    + * + * let backgroundColor; + * + * function setup() { + * backgroundColor = color(100, 50, 150); + * } + * + * function draw() { + * backgroundColor.setGreen(128 + 128 * sin(millis() / 1000)); + * background(backgroundColor); + * describe('A canvas with a gradually changing background color.'); + * } + * + *
                    + **/, + }, + { + key: "setGreen", + value: function setGreen(new_green) { + this._array[1] = new_green / this.maxes[constants.RGB][1]; + this._calculateLevels(); + } /** + * Sets the blue component of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setBlue + * @param {Number} blue the new blue value. + * + * @example + *
                    + * + * let backgroundColor; + * + * function setup() { + * backgroundColor = color(100, 50, 150); + * } + * + * function draw() { + * backgroundColor.setBlue(128 + 128 * sin(millis() / 1000)); + * background(backgroundColor); + * describe('A canvas with a gradually changing background color.'); + * } + * + *
                    + **/, + }, + { + key: "setBlue", + value: function setBlue(new_blue) { + this._array[2] = new_blue / this.maxes[constants.RGB][2]; + this._calculateLevels(); + } /** + * Sets the alpha (transparency) value of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setAlpha + * @param {Number} alpha the new alpha value. + * + * @example + *
                    + * + * function draw() { + * clear(); + * background(200); + * const squareColor = color(100, 50, 100); + * squareColor.setAlpha(128 + 128 * sin(millis() / 1000)); + * fill(squareColor); + * rect(13, 13, width - 26, height - 26); + * describe( + * 'A purple square with gradually changing opacity drawn on a gray background.' + * ); + * } + * + *
                    + **/, + }, + { + key: "setAlpha", + value: function setAlpha(new_alpha) { + this._array[3] = new_alpha / this.maxes[this.mode][3]; + this._calculateLevels(); + }, // calculates and stores the closest screen levels + }, + { + key: "_calculateLevels", + value: function _calculateLevels() { + var array = this._array; + // (loop backwards for performance) + var levels = (this.levels = new Array(array.length)); + for (var i = array.length - 1; i >= 0; --i) { + levels[i] = Math.round(array[i] * 255); + } // Clear cached HSL/HSB values + + this.hsla = null; + this.hsba = null; + }, + }, + { + key: "_getAlpha", + value: function _getAlpha() { + return this._array[3] * this.maxes[this.mode][3]; + }, // stores the color mode and maxes in this instance of Color + // for later use (by _parseInputs()) + }, + { + key: "_storeModeAndMaxes", + value: function _storeModeAndMaxes(new_mode, new_maxes) { + this.mode = new_mode; + this.maxes = new_maxes; + }, + }, + { + key: "_getMode", + value: function _getMode() { + return this.mode; + }, + }, + { + key: "_getMaxes", + value: function _getMaxes() { + return this.maxes; + }, + }, + { + key: "_getBlue", + value: function _getBlue() { + return this._array[2] * this.maxes[constants.RGB][2]; + }, + }, + { + key: "_getBrightness", + value: function _getBrightness() { + if (!this.hsba) { + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + } + return this.hsba[2] * this.maxes[constants.HSB][2]; + }, + }, + { + key: "_getGreen", + value: function _getGreen() { + return this._array[1] * this.maxes[constants.RGB][1]; + } /** + * Hue is the same in HSB and HSL, but the maximum value may be different. + * This function will return the HSB-normalized saturation when supplied with + * an HSB color object, but will default to the HSL-normalized saturation + * otherwise. + */, + }, + { + key: "_getHue", + value: function _getHue() { + if (this.mode === constants.HSB) { + if (!this.hsba) { + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + } + return this.hsba[0] * this.maxes[constants.HSB][0]; + } else { + if (!this.hsla) { + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + } + return this.hsla[0] * this.maxes[constants.HSL][0]; + } + }, + }, + { + key: "_getLightness", + value: function _getLightness() { + if (!this.hsla) { + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + } + return this.hsla[2] * this.maxes[constants.HSL][2]; + }, + }, + { + key: "_getRed", + value: function _getRed() { + return this._array[0] * this.maxes[constants.RGB][0]; + } /** + * Saturation is scaled differently in HSB and HSL. This function will return + * the HSB saturation when supplied with an HSB color object, but will default + * to the HSL saturation otherwise. + */, + }, + { + key: "_getSaturation", + value: function _getSaturation() { + if (this.mode === constants.HSB) { + if (!this.hsba) { + this.hsba = _color_conversion.default._rgbaToHSBA( + this._array, + ); + } + return this.hsba[1] * this.maxes[constants.HSB][1]; + } else { + if (!this.hsla) { + this.hsla = _color_conversion.default._rgbaToHSLA( + this._array, + ); + } + return this.hsla[1] * this.maxes[constants.HSL][1]; + } + } /** + * For a number of different inputs, returns a color formatted as [r, g, b, a] + * arrays, with each component normalized between 0 and 1. + * + * @private + * @param {Array} [...args] An 'array-like' object that represents a list of + * arguments + * @return {Number[]} a color formatted as [r, g, b, a] + * Example: + * input ==> output + * g ==> [g, g, g, 255] + * g,a ==> [g, g, g, a] + * r, g, b ==> [r, g, b, 255] + * r, g, b, a ==> [r, g, b, a] + * [g] ==> [g, g, g, 255] + * [g, a] ==> [g, g, g, a] + * [r, g, b] ==> [r, g, b, 255] + * [r, g, b, a] ==> [r, g, b, a] + * @example + *
                    + * + * // todo + * // + * // describe(''); + * + *
                    + */, + }, + ], + [ + { + key: "_parseInputs", + value: function _parseInputs(r, g, b, a) { + var numArgs = arguments.length; + var mode = this.mode; + var maxes = this.maxes[mode]; + var results = []; + var i; + if (numArgs >= 3) { + // Argument is a list of component values. + results[0] = r / maxes[0]; + results[1] = g / maxes[1]; + results[2] = b / maxes[2]; + // Alpha may be undefined, so default it to 100%. + if (typeof a === "number") { + results[3] = a / maxes[3]; + } else { + results[3] = 1; + } // Constrain components to the range [0,1]. + // (loop backwards for performance) + + for (i = results.length - 1; i >= 0; --i) { + var result = results[i]; + if (result < 0) { + results[i] = 0; + } else if (result > 1) { + results[i] = 1; + } + } // Convert to RGBA and return. + + if (mode === constants.HSL) { + return _color_conversion.default._hslaToRGBA(results); + } else if (mode === constants.HSB) { + return _color_conversion.default._hsbaToRGBA(results); + } else { + return results; + } + } else if (numArgs === 1 && typeof r === "string") { + var str = r.trim().toLowerCase(); + // Return if string is a named colour. + if (namedColors[str]) { + return Color._parseInputs.call(this, namedColors[str]); + } // Try RGBA pattern matching. + + if (colorPatterns.HEX3.test(str)) { + // #rgb + results = colorPatterns.HEX3.exec(str) + .slice(1) + .map(function (color) { + return parseInt(color + color, 16) / 255; + }); + results[3] = 1; + return results; + } else if (colorPatterns.HEX6.test(str)) { + // #rrggbb + results = colorPatterns.HEX6.exec(str) + .slice(1) + .map(function (color) { + return parseInt(color, 16) / 255; + }); + results[3] = 1; + return results; + } else if (colorPatterns.HEX4.test(str)) { + // #rgba + results = colorPatterns.HEX4.exec(str) + .slice(1) + .map(function (color) { + return parseInt(color + color, 16) / 255; + }); + return results; + } else if (colorPatterns.HEX8.test(str)) { + // #rrggbbaa + results = colorPatterns.HEX8.exec(str) + .slice(1) + .map(function (color) { + return parseInt(color, 16) / 255; + }); + return results; + } else if (colorPatterns.RGB.test(str)) { + // rgb(R,G,B) + results = colorPatterns.RGB.exec(str) + .slice(1) + .map(function (color) { + return color / 255; + }); + results[3] = 1; + return results; + } else if (colorPatterns.RGB_PERCENT.test(str)) { + // rgb(R%,G%,B%) + results = colorPatterns.RGB_PERCENT.exec(str) + .slice(1) + .map(function (color) { + return parseFloat(color) / 100; + }); + results[3] = 1; + return results; + } else if (colorPatterns.RGBA.test(str)) { + // rgba(R,G,B,A) + results = colorPatterns.RGBA.exec(str) + .slice(1) + .map(function (color, idx) { + if (idx === 3) { + return parseFloat(color); + } + return color / 255; + }); + return results; + } else if (colorPatterns.RGBA_PERCENT.test(str)) { + // rgba(R%,G%,B%,A%) + results = colorPatterns.RGBA_PERCENT.exec(str) + .slice(1) + .map(function (color, idx) { + if (idx === 3) { + return parseFloat(color); + } + return parseFloat(color) / 100; + }); + return results; + } // Try HSLA pattern matching. + + if (colorPatterns.HSL.test(str)) { + // hsl(H,S,L) + results = colorPatterns.HSL.exec(str) + .slice(1) + .map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } + return parseInt(color, 10) / 100; + }); + results[3] = 1; + } else if (colorPatterns.HSLA.test(str)) { + // hsla(H,S,L,A) + results = colorPatterns.HSLA.exec(str) + .slice(1) + .map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } else if (idx === 3) { + return parseFloat(color); + } + return parseInt(color, 10) / 100; + }); + } + results = results.map(function (value) { + return Math.max(Math.min(value, 1), 0); + }); + if (results.length) { + return _color_conversion.default._hslaToRGBA(results); + } // Try HSBA pattern matching. + + if (colorPatterns.HSB.test(str)) { + // hsb(H,S,B) + results = colorPatterns.HSB.exec(str) + .slice(1) + .map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } + return parseInt(color, 10) / 100; + }); + results[3] = 1; + } else if (colorPatterns.HSBA.test(str)) { + // hsba(H,S,B,A) + results = colorPatterns.HSBA.exec(str) + .slice(1) + .map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } else if (idx === 3) { + return parseFloat(color); + } + return parseInt(color, 10) / 100; + }); + } + if (results.length) { + // (loop backwards for performance) + for (i = results.length - 1; i >= 0; --i) { + results[i] = Math.max(Math.min(results[i], 1), 0); + } + return _color_conversion.default._hsbaToRGBA(results); + } // Input did not match any CSS color pattern: default to white. + + results = [1, 1, 1, 1]; + } else if ( + (numArgs === 1 || numArgs === 2) && + typeof r === "number" + ) { + // 'Grayscale' mode. + /** + * For HSB and HSL, interpret the gray level as a brightness/lightness + * value (they are equivalent when chroma is zero). For RGB, normalize the + * gray level according to the blue maximum. + */ + results[0] = r / maxes[2]; + results[1] = r / maxes[2]; + results[2] = r / maxes[2]; + // Alpha may be undefined, so default it to 100%. + if (typeof g === "number") { + results[3] = g / maxes[3]; + } else { + results[3] = 1; + } // Constrain components to the range [0,1]. + + results = results.map(function (value) { + return Math.max(Math.min(value, 1), 0); + }); + } else { + throw new Error( + "".concat( + arguments, + "is not a valid color representation.", + ), + ); + } + return results; + }, + }, + ], + ); + return Color; + })(); + var _default = _main.default.Color; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./color_conversion": 282, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.constructor": 204, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.trim": 219, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 285: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.fill"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + _dereq_("./p5.Color"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Color + * @submodule Setting + * @for p5 + * @requires core + * @requires constants + */ + /** + * Start defining a shape that will mask subsequent things drawn to the canvas. + * Only opaque regions of the mask shape will allow content to be drawn. + * Any shapes drawn between this and endClip() will + * contribute to the mask shape. + * + * The mask will apply to anything drawn after this call. To draw without a mask, contain + * the code to apply the mask and to draw the masked content between + * push() and pop(). + * + * Alternatively, rather than drawing the mask between this and + * endClip(), draw the mask in a callback function + * passed to clip(). + * + * Options can include: + * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. + * + * @method beginClip + * @param {Object} [options] An object containing clip settings. + * + * @example + *
                    + * + * noStroke(); + * + * // Mask in some shapes + * push(); + * beginClip(); + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * endClip(); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + * translate(50, 50); + * + * // Mask out the same shapes + * push(); + * beginClip({ invert: true }); + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * endClip(); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + *
                    + * + * @alt + * In the top left, a red triangle and circle. In the bottom right, a red + * square with a triangle and circle cut out of it. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(255); + * noStroke(); + * + * beginClip(); + * push(); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * scale(0.5); + * torus(30, 15); + * pop(); + * endClip(); + * + * beginShape(QUAD_STRIP); + * fill(0, 255, 255); + * vertex(-width/2, -height/2); + * vertex(width/2, -height/2); + * fill(100, 0, 100); + * vertex(-width/2, height/2); + * vertex(width/2, height/2); + * endShape(); + * } + * + *
                    + * + * @alt + * A silhouette of a rotating torus colored with a gradient from + * cyan to purple + */ + + _main.default.prototype.beginClip = function () { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + this._renderer.beginClip(options); + }; + /** + * Finishes defining a shape that will mask subsequent things drawn to the canvas. + * Only opaque regions of the mask shape will allow content to be drawn. + * Any shapes drawn between beginClip() and this + * will contribute to the mask shape. + * + * @method endClip + */ + _main.default.prototype.endClip = function () { + this._renderer.endClip(); + }; + /** + * Use the shape drawn by a callback function to mask subsequent things drawn to the canvas. + * Only opaque regions of the mask shape will allow content to be drawn. + * + * The mask will apply to anything drawn after this call. To draw without a mask, contain + * the code to apply the mask and to draw the masked content between + * push() and pop(). + * + * Alternatively, rather than drawing the mask shape in a function, draw the + * shape between beginClip() and endClip(). + * + * Options can include: + * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. + * + * @method clip + * @param {Function} callback A function that draws the mask shape. + * @param {Object} [options] An object containing clip settings. + * + * @example + *
                    + * + * noStroke(); + * + * // Mask in some shapes + * push(); + * clip(() => { + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * }); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + * translate(50, 50); + * + * // Mask out the same shapes + * push(); + * clip(() => { + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * }, { invert: true }); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + *
                    + * + * @alt + * In the top left, a red triangle and circle. In the bottom right, a red + * square with a triangle and circle cut out of it. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(255); + * noStroke(); + * + * clip(() => { + * push(); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * scale(0.5); + * torus(30, 15); + * pop(); + * }); + * + * beginShape(QUAD_STRIP); + * fill(0, 255, 255); + * vertex(-width/2, -height/2); + * vertex(width/2, -height/2); + * fill(100, 0, 100); + * vertex(-width/2, height/2); + * vertex(width/2, height/2); + * endShape(); + * } + * + *
                    + * + * @alt + * A silhouette of a rotating torus colored with a gradient from + * cyan to purple + */ + _main.default.prototype.clip = function (callback, options) { + this._renderer.beginClip(options); + callback(); + this._renderer.endClip(options); + }; + /** + * Sets the color used for the background of the canvas. By default, the + * background is transparent. This function is typically used within + * draw() to clear the display window at the beginning + * of each frame. It can also be used inside setup() to + * set the background on the first frame of animation. + * + * The version of `background()` with one parameter interprets the value one of four + * ways. If the parameter is a number, it's interpreted as a grayscale value. + * If the parameter is a string, it's interpreted as a CSS color string. RGB, RGBA, + * HSL, HSLA, hex, and named color strings are supported. If the parameter is a + * p5.Color object, it will be used as the background color. + * If the parameter is a p5.Image object, it will be used as + * the background image. + * + * The version of `background()` with two parameters interprets the first one as a + * grayscale value. The second parameter sets the alpha (transparency) value. + * + * The version of `background()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current colorMode(). + * By default, colors are specified in RGB values. Calling background(255, 204, 0) + * sets the background a bright yellow color. + * + * @method background + * @param {p5.Color} color any value created by the color() function + * @chainable + * + * @example + *
                    + * + * // A grayscale integer value. + * background(51); + * describe('A canvas with a dark charcoal gray background.'); + * + *
                    + * + *
                    + * + * // A grayscale integer value and an alpha value. + * background(51, 0.4); + * describe('A canvas with a transparent gray background.'); + * + *
                    + * + *
                    + * + * // R, G & B integer values. + * background(255, 204, 0); + * describe('A canvas with a yellow background.'); + * + *
                    + * + *
                    + * + * // H, S & B integer values. + * colorMode(HSB); + * background(255, 204, 100); + * describe('A canvas with a royal blue background.'); + * + *
                    + * + *
                    + * + * // A CSS named color. + * background('red'); + * describe('A canvas with a red background.'); + * + *
                    + * + *
                    + * + * // Three-digit hex RGB notation. + * background('#fae'); + * describe('A canvas with a pink background.'); + * + *
                    + * + *
                    + * + * // Six-digit hex RGB notation. + * background('#222222'); + * describe('A canvas with a black background.'); + * + *
                    + * + *
                    + * + * // Integer RGB notation. + * background('rgb(0,255,0)'); + * describe('A canvas with a bright green background.'); + * + *
                    + * + *
                    + * + * // Integer RGBA notation. + * background('rgba(0,255,0, 0.25)'); + * describe('A canvas with a transparent green background.'); + * + *
                    + * + *
                    + * + * // Percentage RGB notation. + * background('rgb(100%,0%,10%)'); + * describe('A canvas with a red background.'); + * + *
                    + * + *
                    + * + * // Percentage RGBA notation. + * background('rgba(100%,0%,100%,0.5)'); + * describe('A canvas with a transparent purple background.'); + * + *
                    + * + *
                    + * + * // A p5.Color object. + * let c = color(0, 0, 255); + * background(c); + * describe('A canvas with a blue background.'); + * + *
                    + * + */ + /** + * @method background + * @param {String} colorstring color string, possible formats include: integer + * rgb() or rgba(), percentage rgb() or rgba(), + * 3-digit hex, 6-digit hex. + * @param {Number} [a] opacity of the background relative to current + * color range (default is 0-255). + * @chainable + */ + /** + * @method background + * @param {Number} gray specifies a value between white and black. + * @param {Number} [a] + * @chainable + */ + /** + * @method background + * @param {Number} v1 red value if color mode is RGB, or hue value if color mode is HSB. + * @param {Number} v2 green value if color mode is RGB, or saturation value if color mode is HSB. + * @param {Number} v3 blue value if color mode is RGB, or brightness value if color mode is HSB. + * @param {Number} [a] + * @chainable + */ + /** + * @method background + * @param {Number[]} values an array containing the red, green, blue + * and alpha components of the color. + * @chainable + */ + /** + * @method background + * @param {p5.Image} image image created with loadImage() + * or createImage(), + * to set as background. + * (must be same size as the sketch window). + * @param {Number} [a] + * @chainable + */ + _main.default.prototype.background = function () { + var _this$_renderer; + (_this$_renderer = this._renderer).background.apply( + _this$_renderer, + arguments, + ); + return this; + }; + /** + * Clears the pixels on the canvas. This function makes every pixel 100% + * transparent. Calling `clear()` doesn't clear objects created by `createX()` + * functions such as createGraphics(), + * createVideo(), and + * createImg(). These objects will remain + * unchanged after calling clear() and can be redrawn. + * + * In WebGL mode, this function can clear the screen to a specific color. It + * interprets four numeric parameters as normalized RGBA color values. It also + * clears the depth buffer. If you are not using the WebGL renderer, these + * parameters will have no effect. + * + * @method clear + * @chainable + * @example + *
                    + * + * function draw() { + * circle(mouseX, mouseY, 20); + * describe('A white circle is drawn at the mouse x- and y-coordinates.'); + * } + * + * function mousePressed() { + * clear(); + * background(128); + * describe('The canvas is cleared when the mouse is clicked.'); + * } + * + *
                    + * + *
                    + * + * let pg; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * pg = createGraphics(60, 60); + * pg.background(200); + * pg.noStroke(); + * pg.circle(pg.width / 2, pg.height / 2, 15); + * image(pg, 20, 20); + * describe('A white circle drawn on a gray square. The square gets smaller when the mouse is pressed.'); + * } + * + * function mousePressed() { + * clear(); + * image(pg, 20, 20); + * } + * + *
                    + * + * @param {Number} r normalized red value. + * @param {Number} g normalized green value. + * @param {Number} b normalized blue value. + * @param {Number} a normalized alpha value. + */ + _main.default.prototype.clear = function () { + var _r = (arguments.length <= 0 ? undefined : arguments[0]) || 0; + var _g = (arguments.length <= 1 ? undefined : arguments[1]) || 0; + var _b = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + var _a = (arguments.length <= 3 ? undefined : arguments[3]) || 0; + this._renderer.clear(_r, _g, _b, _a); + return this; + }; + /** + * Changes the way p5.js interprets color data. By default, the numeric + * parameters for fill(), + * stroke(), + * background(), and + * color() are defined by values between 0 and 255 + * using the RGB color model. This is equivalent to calling + * `colorMode(RGB, 255)`. Pure red is `color(255, 0, 0)` in this model. + * + * Calling `colorMode(RGB, 100)` sets colors to be interpreted as RGB color + * values between 0 and 100. Pure red is `color(100, 0, 0)` in this model. + * + * Calling `colorMode(HSB)` or `colorMode(HSL)` changes to HSB or HSL system + * instead of RGB. + * + * p5.Color objects remember the mode that they were + * created in. Changing modes doesn't affect their appearance. + * + * @method colorMode + * @param {Constant} mode either RGB, HSB or HSL, corresponding to + * Red/Green/Blue and Hue/Saturation/Brightness + * (or Lightness). + * @param {Number} [max] range for all values. + * @chainable + * + * @example + *
                    + * + * noStroke(); + * colorMode(RGB, 100); + * for (let i = 0; i < 100; i += 1) { + * for (let j = 0; j < 100; j += 1) { + * stroke(i, j, 0); + * point(i, j); + * } + * } + * describe( + * 'A diagonal green to red gradient from bottom-left to top-right with shading transitioning to black at top-left corner.' + * ); + * + *
                    + * + *
                    + * + * noStroke(); + * colorMode(HSB, 100); + * for (let i = 0; i < 100; i++) { + * for (let j = 0; j < 100; j++) { + * stroke(i, j, 100); + * point(i, j); + * } + * } + * describe('A rainbow gradient from left-to-right. Brightness transitions to white at the top.'); + * + *
                    + * + *
                    + * + * colorMode(RGB, 255); + * let myColor = color(180, 175, 230); + * background(myColor); + * colorMode(RGB, 1); + * let redValue = red(myColor); + * let greenValue = green(myColor); + * let blueValue = blue(myColor); + * text(`Red: ${redValue}`, 10, 10, 80, 80); + * text(`Green: ${greenValue}`, 10, 40, 80, 80); + * text(`Blue: ${blueValue}`, 10, 70, 80, 80); + * describe('A purple canvas with the red, green, and blue decimal values of the color written on it.'); + * + *
                    + * + *
                    + * + * noFill(); + * colorMode(RGB, 255, 255, 255, 1); + * background(255); + * strokeWeight(4); + * stroke(255, 0, 10, 0.3); + * circle(40, 40, 50); + * circle(50, 60, 50); + * describe('Two overlapping translucent pink circle outlines.'); + * + *
                    + * + */ + /** + * @method colorMode + * @param {Constant} mode + * @param {Number} max1 range for the red or hue depending on the + * current color mode. + * @param {Number} max2 range for the green or saturation depending + * on the current color mode. + * @param {Number} max3 range for the blue or brightness/lightness + * depending on the current color mode. + * @param {Number} [maxA] range for the alpha. + * @chainable + */ + _main.default.prototype.colorMode = function ( + mode, + max1, + max2, + max3, + maxA, + ) { + _main.default._validateParameters("colorMode", arguments); + if ( + mode === constants.RGB || + mode === constants.HSB || + mode === constants.HSL + ) { + // Set color mode. + this._colorMode = mode; + // Set color maxes. + var maxes = this._colorMaxes[mode]; + if (arguments.length === 2) { + maxes[0] = max1; // Red + maxes[1] = max1; // Green + maxes[2] = max1; // Blue + maxes[3] = max1; // Alpha + } else if (arguments.length === 4) { + maxes[0] = max1; // Red + maxes[1] = max2; // Green + maxes[2] = max3; // Blue + } else if (arguments.length === 5) { + maxes[0] = max1; // Red + maxes[1] = max2; // Green + maxes[2] = max3; // Blue + maxes[3] = maxA; // Alpha + } + } + return this; + }; + /** + * Sets the color used to fill shapes. Calling `fill(255, 165, 0)` or + * `fill('orange')` means all shapes drawn after the fill command will be + * filled with the color orange. + * + * The version of `fill()` with one parameter interprets the value one of + * three ways. If the parameter is a number, it's interpreted as a grayscale + * value. If the parameter is a string, it's interpreted as a CSS color + * string. A p5.Color object can also be provided to + * set the fill color. + * + * The version of `fill()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current + * colorMode(). The default color space is RGB, + * with each value in the range from 0 to 255. + * + * @method fill + * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. + * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. + * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. + * @param {Number} [alpha] + * @chainable + * @example + *
                    + * + * // Grayscale integer value. + * fill(51); + * square(20, 20, 60); + * describe('A dark charcoal gray square with a black outline.'); + * + *
                    + * + *
                    + * + * // R, G & B integer values. + * fill(255, 204, 0); + * square(20, 20, 60); + * describe('A yellow square with a black outline.'); + * + *
                    + * + *
                    + * + * // H, S & B integer values. + * colorMode(HSB); + * fill(255, 204, 100); + * square(20, 20, 60); + * describe('A royal blue square with a black outline.'); + * + *
                    + * + *
                    + * + * // A CSS named color. + * fill('red'); + * square(20, 20, 60); + * describe('A red square with a black outline.'); + * + *
                    + * + *
                    + * + * // Three-digit hex RGB notation. + * fill('#fae'); + * square(20, 20, 60); + * describe('A pink square with a black outline.'); + * + *
                    + * + *
                    + * + * // Six-digit hex RGB notation. + * fill('#A251FA'); + * square(20, 20, 60); + * describe('A purple square with a black outline.'); + * + *
                    + * + *
                    + * + * // Integer RGB notation. + * fill('rgb(0,255,0)'); + * square(20, 20, 60); + * describe('A bright green square with a black outline.'); + * + *
                    + * + *
                    + * + * // Integer RGBA notation. + * fill('rgba(0,255,0, 0.25)'); + * square(20, 20, 60); + * describe('A soft green rectange with a black outline.'); + * + *
                    + * + *
                    + * + * // Percentage RGB notation. + * fill('rgb(100%,0%,10%)'); + * square(20, 20, 60); + * describe('A red square with a black outline.'); + * + *
                    + * + *
                    + * + * // Percentage RGBA notation. + * fill('rgba(100%,0%,100%,0.5)'); + * square(20, 20, 60); + * describe('A dark fuchsia square with a black outline.'); + * + *
                    + * + *
                    + * + * // p5.Color object. + * let c = color(0, 0, 255); + * fill(c); + * square(20, 20, 60); + * describe('A blue square with a black outline.'); + * + *
                    + */ + /** + * @method fill + * @param {String} value a color string. + * @chainable + */ + /** + * @method fill + * @param {Number} gray a grayscale value. + * @param {Number} [alpha] + * @chainable + */ + /** + * @method fill + * @param {Number[]} values an array containing the red, green, blue & + * and alpha components of the color. + * @chainable + */ + /** + * @method fill + * @param {p5.Color} color the fill color. + * @chainable + */ + _main.default.prototype.fill = function () { + var _this$_renderer2; + this._renderer._setProperty("_fillSet", true); + this._renderer._setProperty("_doFill", true); + (_this$_renderer2 = this._renderer).fill.apply( + _this$_renderer2, + arguments, + ); + return this; + }; + /** + * Disables setting the interior color of shapes. This is the same as making + * the fill completely transparent. If both + * noStroke() and + * noFill() are called, nothing will be drawn to the + * screen. + * + * @method noFill + * @chainable + * @example + *
                    + * + * square(32, 10, 35); + * noFill(); + * square(32, 55, 35); + * describe('A white square on top of an empty square. Both squares have black outlines.'); + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(0); + * noFill(); + * stroke(100, 100, 240); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(45, 45, 45); + * describe('A purple cube wireframe spinning on a black canvas.'); + * } + * + *
                    + */ + _main.default.prototype.noFill = function () { + this._renderer._setProperty("_doFill", false); + return this; + }; + /** + * Disables drawing the stroke (outline). If both + * noStroke() and + * noFill() are called, nothing will be drawn to the + * screen. + * + * @method noStroke + * @chainable + * @example + *
                    + * + * noStroke(); + * square(20, 20, 60); + * describe('A white square with no outline.'); + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(0); + * noStroke(); + * fill(240, 150, 150); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(45, 45, 45); + * describe('A pink cube with no edge outlines spinning on a black canvas.'); + * } + * + *
                    + */ + _main.default.prototype.noStroke = function () { + this._renderer._setProperty("_doStroke", false); + return this; + }; + /** + * Sets the color used to draw lines and borders around shapes. Calling + * `stroke(255, 165, 0)` or `stroke('orange')` means all shapes drawn after + * the `stroke()` command will be filled with the color orange. The way these + * parameters are interpreted may be changed with the + * colorMode() function. + * + * The version of `stroke()` with one parameter interprets the value one of + * three ways. If the parameter is a number, it's interpreted as a grayscale + * value. If the parameter is a string, it's interpreted as a CSS color + * string. A p5.Color object can also be provided to + * set the stroke color. + * + * The version of `stroke()` with two parameters interprets the first one as a + * grayscale value. The second parameter sets the alpha (transparency) value. + * + * The version of `stroke()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current `colorMode()`. + * + * The version of `stroke()` with four parameters interprets them as RGBA, HSBA, + * or HSLA colors, depending on the current `colorMode()`. The last parameter + * sets the alpha (transparency) value. + * + * @method stroke + * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. + * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. + * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. + * @param {Number} [alpha] + * @chainable + * + * @example + *
                    + * + * // Grayscale integer value. + * strokeWeight(4); + * stroke(51); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a dark charcoal gray outline.'); + * + *
                    + * + *
                    + * + * // R, G & B integer values. + * stroke(255, 204, 0); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a yellow outline.'); + * + *
                    + * + *
                    + * + * // H, S & B integer values. + * colorMode(HSB); + * strokeWeight(4); + * stroke(255, 204, 100); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a royal blue outline.'); + * + *
                    + * + *
                    + * + * // A CSS named color. + * stroke('red'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a red outline.'); + * + *
                    + * + *
                    + * + * // Three-digit hex RGB notation. + * stroke('#fae'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a pink outline.'); + * + *
                    + * + *
                    + * + * // Six-digit hex RGB notation. + * stroke('#222222'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a black outline.'); + * + *
                    + * + *
                    + * + * // Integer RGB notation. + * stroke('rgb(0,255,0)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A whiite rectangle with a bright green outline.'); + * + *
                    + * + *
                    + * + * // Integer RGBA notation. + * stroke('rgba(0,255,0,0.25)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a soft green outline.'); + * + *
                    + * + *
                    + * + * // Percentage RGB notation. + * stroke('rgb(100%,0%,10%)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a red outline.'); + * + *
                    + * + *
                    + * + * // Percentage RGBA notation. + * stroke('rgba(100%,0%,100%,0.5)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a dark fuchsia outline.'); + * + *
                    + * + *
                    + * + * // p5.Color object. + * stroke(color(0, 0, 255)); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a blue outline.'); + * + *
                    + */ + /** + * @method stroke + * @param {String} value a color string. + * @chainable + */ + /** + * @method stroke + * @param {Number} gray a grayscale value. + * @param {Number} [alpha] + * @chainable + */ + /** + * @method stroke + * @param {Number[]} values an array containing the red, green, blue, + * and alpha components of the color. + * @chainable + */ + /** + * @method stroke + * @param {p5.Color} color the stroke color. + * @chainable + */ + _main.default.prototype.stroke = function () { + var _this$_renderer3; + this._renderer._setProperty("_strokeSet", true); + this._renderer._setProperty("_doStroke", true); + (_this$_renderer3 = this._renderer).stroke.apply( + _this$_renderer3, + arguments, + ); + return this; + }; + /** + * All drawing that follows erase() will subtract + * from the canvas, revealing the web page underneath. The erased areas will + * become transparent, allowing the content behind the canvas to show through. + * The fill(), stroke(), and + * blendMode() have no effect once `erase()` is + * called. + * + * The `erase()` function has two optional parameters. The first parameter + * sets the strength of erasing by the shape's interior. A value of 0 means + * that no erasing will occur. A value of 255 means that the shape's interior + * will fully erase the content underneath. The default value is 255 + * (full strength). + * + * The second parameter sets the strength of erasing by the shape's edge. A + * value of 0 means that no erasing will occur. A value of 255 means that the + * shape's edge will fully erase the content underneath. The default value is + * 255 (full strength). + * + * To cancel the erasing effect, use the noErase() + * function. + * + * `erase()` has no effect on drawing done with the + * image() and + * background() functions. + * + * @method erase + * @param {Number} [strengthFill] a number (0-255) for the strength of erasing under a shape's interior. + * Defaults to 255, which is full strength. + * @param {Number} [strengthStroke] a number (0-255) for the strength of erasing under a shape's edge. + * Defaults to 255, which is full strength. + * + * @chainable + * @example + *
                    + * + * background(100, 100, 250); + * fill(250, 100, 100); + * square(20, 20, 60); + * erase(); + * circle(25, 30, 30); + * noErase(); + * describe('A purple canvas with a pink square in the middle. A circle is erased from the top-left, leaving a white hole.'); + * + *
                    + * + *
                    + * + * let p = createP('I am a DOM element'); + * p.style('font-size', '12px'); + * p.style('width', '65px'); + * p.style('text-align', 'center'); + * p.position(18, 26); + * + * background(100, 170, 210); + * erase(200, 100); + * circle(50, 50, 77); + * noErase(); + * describe('A blue canvas with a circular hole in the center that reveals the message "I am a DOM element".'); + * + *
                    + * + *
                    + * + * background(150, 250, 150); + * fill(100, 100, 250); + * square(20, 20, 60); + * strokeWeight(5); + * erase(150, 255); + * triangle(50, 10, 70, 50, 90, 10); + * noErase(); + * describe('A mint green canvas with a purple square in the center. A triangle in the top-right corner partially erases its interior and a fully erases its outline.'); + * + *
                    + */ + _main.default.prototype.erase = function () { + var opacityFill = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : 255; + var opacityStroke = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 255; + this._renderer.erase(opacityFill, opacityStroke); + return this; + }; + /** + * Ends erasing that was started with erase(). + * The fill(), stroke(), and + * blendMode() settings will return to what they + * were prior to calling erase(). + * + * @method noErase + * @chainable + * @example + *
                    + * + * background(235, 145, 15); + * noStroke(); + * fill(30, 45, 220); + * rect(30, 10, 10, 80); + * erase(); + * circle(50, 50, 60); + * noErase(); + * rect(70, 10, 10, 80); + * describe('An orange canvas with two tall blue rectangles. A circular hole in the center erases the rectangle on the left but not the one on the right.'); + * + *
                    + */ + _main.default.prototype.noErase = function () { + this._renderer.noErase(); + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.Color": 284, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 286: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.QUADRATIC = + exports.LINEAR = + exports._CTX_MIDDLE = + exports._DEFAULT_LEADMULT = + exports._DEFAULT_TEXT_FILL = + exports.WORD = + exports.CHAR = + exports.BOLDITALIC = + exports.BOLD = + exports.ITALIC = + exports.NORMAL = + exports.BLUR = + exports.ERODE = + exports.DILATE = + exports.POSTERIZE = + exports.INVERT = + exports.OPAQUE = + exports.GRAY = + exports.THRESHOLD = + exports.BURN = + exports.DODGE = + exports.SOFT_LIGHT = + exports.HARD_LIGHT = + exports.OVERLAY = + exports.REPLACE = + exports.SCREEN = + exports.MULTIPLY = + exports.EXCLUSION = + exports.SUBTRACT = + exports.DIFFERENCE = + exports.LIGHTEST = + exports.DARKEST = + exports.ADD = + exports.REMOVE = + exports.BLEND = + exports.UP_ARROW = + exports.TAB = + exports.SHIFT = + exports.RIGHT_ARROW = + exports.RETURN = + exports.OPTION = + exports.LEFT_ARROW = + exports.ESCAPE = + exports.ENTER = + exports.DOWN_ARROW = + exports.DELETE = + exports.CONTROL = + exports.BACKSPACE = + exports.ALT = + exports.AUTO = + exports.HSL = + exports.HSB = + exports.RGB = + exports.MITER = + exports.BEVEL = + exports.ROUND = + exports.SQUARE = + exports.PROJECT = + exports.PIE = + exports.CHORD = + exports.OPEN = + exports.CLOSE = + exports.TESS = + exports.QUAD_STRIP = + exports.QUADS = + exports.TRIANGLE_STRIP = + exports.TRIANGLE_FAN = + exports.TRIANGLES = + exports.LINE_LOOP = + exports.LINE_STRIP = + exports.LINES = + exports.POINTS = + exports.BASELINE = + exports.BOTTOM = + exports.TOP = + exports.CENTER = + exports.LEFT = + exports.RIGHT = + exports.RADIUS = + exports.CORNERS = + exports.CORNER = + exports.RAD_TO_DEG = + exports.DEG_TO_RAD = + exports.RADIANS = + exports.DEGREES = + exports.TWO_PI = + exports.TAU = + exports.QUARTER_PI = + exports.PI = + exports.HALF_PI = + exports.WAIT = + exports.TEXT = + exports.MOVE = + exports.HAND = + exports.CROSS = + exports.ARROW = + exports.WEBGL2 = + exports.WEBGL = + exports.P2D = + exports.VERSION = + void 0; + exports.RGBA = + exports.HALF_FLOAT = + exports.FLOAT = + exports.UNSIGNED_INT = + exports.UNSIGNED_BYTE = + exports.COVER = + exports.CONTAIN = + exports.FALLBACK = + exports.LABEL = + exports.AXES = + exports.GRID = + exports._DEFAULT_FILL = + exports._DEFAULT_STROKE = + exports.PORTRAIT = + exports.LANDSCAPE = + exports.SMOOTH = + exports.FLAT = + exports.MIRROR = + exports.CLAMP = + exports.REPEAT = + exports.NEAREST = + exports.IMAGE = + exports.IMMEDIATE = + exports.TEXTURE = + exports.FILL = + exports.STROKE = + exports.CURVE = + exports.BEZIER = + void 0; + /** + * @module Constants + * @submodule Constants + * @for p5 + */ + var _PI = Math.PI; + /** + * Version of this p5.js. + * @property {String} VERSION + * @final + */ + var VERSION = "1.9.0"; + // GRAPHICS RENDERER + /** + * The default, two-dimensional renderer. + * @property {String} P2D + * @final + */ + exports.VERSION = VERSION; + var P2D = "p2d"; + /** + * One of the two render modes in p5.js, used for computationally intensive tasks like 3D rendering and shaders. + * + * `WEBGL` differs from the default `P2D` renderer in the following ways: + * + * - **Coordinate System** - When drawing in `WEBGL` mode, the origin point (0,0,0) is located at the center of the screen, not the top-left corner. See the learn page about coordinates and transformations. + * - **3D Shapes** - `WEBGL` mode can be used to draw 3-dimensional shapes like box(), sphere(), cone(), and more. See the learn page about custom geometry to make more complex objects. + * - **Shape Detail** - When drawing in `WEBGL` mode, you can specify how smooth curves should be drawn by using a `detail` parameter. See the wiki section about shapes for a more information and an example. + * - **Textures** - A texture is like a skin that wraps onto a shape. See the wiki section about textures for examples of mapping images onto surfaces with textures. + * - **Materials and Lighting** - `WEBGL` offers different types of lights like ambientLight() to place around a scene. Materials like specularMaterial() reflect the lighting to convey shape and depth. See the learn page for styling and appearance to experiment with different combinations. + * - **Camera** - The viewport of a `WEBGL` sketch can be adjusted by changing camera attributes. See the learn page section about cameras for an explanation of camera controls. + * - **Text** - `WEBGL` requires opentype/truetype font files to be preloaded using loadFont(). See the wiki section about text for details, along with a workaround. + * - **Shaders** - Shaders are hardware accelerated programs that can be used for a variety of effects and graphics. See the introduction to shaders to get started with shaders in p5.js. + * - **Graphics Acceleration** - `WEBGL` mode uses the graphics card instead of the CPU, so it may help boost the performance of your sketch (example: drawing more shapes on the screen at once). + * + * To learn more about WEBGL mode, check out all the interactive WEBGL tutorials in the "Learn" section of this website, or read the wiki article "Getting started with WebGL in p5". + * + * @property {String} WEBGL + * @final + */ + exports.P2D = P2D; + var WEBGL = "webgl"; + /** + * One of the two possible values of a WebGL canvas (either WEBGL or WEBGL2), + * which can be used to determine what capabilities the rendering environment + * has. + * @property {String} WEBGL2 + * @final + */ + exports.WEBGL = WEBGL; + var WEBGL2 = "webgl2"; + // ENVIRONMENT + /** + * @property {String} ARROW + * @final + */ + exports.WEBGL2 = WEBGL2; + var ARROW = "default"; + /** + * @property {String} CROSS + * @final + */ + exports.ARROW = ARROW; + var CROSS = "crosshair"; + /** + * @property {String} HAND + * @final + */ + exports.CROSS = CROSS; + var HAND = "pointer"; + /** + * @property {String} MOVE + * @final + */ + exports.HAND = HAND; + var MOVE = "move"; + /** + * @property {String} TEXT + * @final + */ + exports.MOVE = MOVE; + var TEXT = "text"; + /** + * @property {String} WAIT + * @final + */ + exports.TEXT = TEXT; + var WAIT = "wait"; + // TRIGONOMETRY + /** + * HALF_PI is a mathematical constant with the value + * 1.57079632679489661923. It is half the ratio of the + * circumference of a circle to its diameter. It is useful in + * combination with the trigonometric functions sin() and cos(). + * + * @property {Number} HALF_PI + * @final + * + * @example + *
                    + * arc(50, 50, 80, 80, 0, HALF_PI); + *
                    + * + * @alt + * 80×80 white quarter-circle with curve toward bottom right of canvas. + */ + exports.WAIT = WAIT; + var HALF_PI = _PI / 2; + /** + * PI is a mathematical constant with the value + * 3.14159265358979323846. It is the ratio of the circumference + * of a circle to its diameter. It is useful in combination with + * the trigonometric functions sin() and cos(). + * + * @property {Number} PI + * @final + * + * @example + *
                    + * arc(50, 50, 80, 80, 0, PI); + *
                    + * + * @alt + * white half-circle with curve toward bottom of canvas. + */ + exports.HALF_PI = HALF_PI; + var PI = _PI; + /** + * QUARTER_PI is a mathematical constant with the value 0.7853982. + * It is one quarter the ratio of the circumference of a circle to + * its diameter. It is useful in combination with the trigonometric + * functions sin() and cos(). + * + * @property {Number} QUARTER_PI + * @final + * + * @example + *
                    + * arc(50, 50, 80, 80, 0, QUARTER_PI); + *
                    + * + * @alt + * white eighth-circle rotated about 40 degrees with curve bottom right canvas. + */ + exports.PI = PI; + var QUARTER_PI = _PI / 4; + /** + * TAU is an alias for TWO_PI, a mathematical constant with the + * value 6.28318530717958647693. It is twice the ratio of the + * circumference of a circle to its diameter. It is useful in + * combination with the trigonometric functions sin() and cos(). + * + * @property {Number} TAU + * @final + * + * @example + *
                    + * arc(50, 50, 80, 80, 0, TAU); + *
                    + * + * @alt + * 80×80 white ellipse shape in center of canvas. + */ + exports.QUARTER_PI = QUARTER_PI; + var TAU = _PI * 2; + /** + * TWO_PI is a mathematical constant with the value + * 6.28318530717958647693. It is twice the ratio of the + * circumference of a circle to its diameter. It is useful in + * combination with the trigonometric functions sin() and cos(). + * + * @property {Number} TWO_PI + * @final + * + * @example + *
                    + * arc(50, 50, 80, 80, 0, TWO_PI); + *
                    + * + * @alt + * 80×80 white ellipse shape in center of canvas. + */ + exports.TAU = TAU; + var TWO_PI = _PI * 2; + /** + * Constant to be used with the angleMode() function, to set the mode in + * which p5.js interprets and calculates angles (either DEGREES or RADIANS). + * @property {String} DEGREES + * @final + * + * @example + *
                    + * function setup() { + * angleMode(DEGREES); + * } + *
                    + */ + exports.TWO_PI = TWO_PI; + var DEGREES = "degrees"; + /** + * Constant to be used with the angleMode() function, to set the mode + * in which p5.js interprets and calculates angles (either RADIANS or DEGREES). + * @property {String} RADIANS + * @final + * + * @example + *
                    + * function setup() { + * angleMode(RADIANS); + * } + *
                    + */ + exports.DEGREES = DEGREES; + var RADIANS = "radians"; + exports.RADIANS = RADIANS; + var DEG_TO_RAD = _PI / 180; + exports.DEG_TO_RAD = DEG_TO_RAD; + var RAD_TO_DEG = 180 / _PI; + // SHAPE + /** + * @property {String} CORNER + * @final + */ + exports.RAD_TO_DEG = RAD_TO_DEG; + var CORNER = "corner"; + /** + * @property {String} CORNERS + * @final + */ + exports.CORNER = CORNER; + var CORNERS = "corners"; + /** + * @property {String} RADIUS + * @final + */ + exports.CORNERS = CORNERS; + var RADIUS = "radius"; + /** + * @property {String} RIGHT + * @final + */ + exports.RADIUS = RADIUS; + var RIGHT = "right"; + /** + * @property {String} LEFT + * @final + */ + exports.RIGHT = RIGHT; + var LEFT = "left"; + /** + * @property {String} CENTER + * @final + */ + exports.LEFT = LEFT; + var CENTER = "center"; + /** + * @property {String} TOP + * @final + */ + exports.CENTER = CENTER; + var TOP = "top"; + /** + * @property {String} BOTTOM + * @final + */ + exports.TOP = TOP; + var BOTTOM = "bottom"; + /** + * @property {String} BASELINE + * @final + * @default alphabetic + */ + exports.BOTTOM = BOTTOM; + var BASELINE = "alphabetic"; + /** + * @property {Number} POINTS + * @final + * @default 0x0000 + */ + exports.BASELINE = BASELINE; + var POINTS = 0; + /** + * @property {Number} LINES + * @final + * @default 0x0001 + */ + exports.POINTS = POINTS; + var LINES = 1; + /** + * @property {Number} LINE_STRIP + * @final + * @default 0x0003 + */ + exports.LINES = LINES; + var LINE_STRIP = 3; + /** + * @property {Number} LINE_LOOP + * @final + * @default 0x0002 + */ + exports.LINE_STRIP = LINE_STRIP; + var LINE_LOOP = 2; + /** + * @property {Number} TRIANGLES + * @final + * @default 0x0004 + */ + exports.LINE_LOOP = LINE_LOOP; + var TRIANGLES = 4; + /** + * @property {Number} TRIANGLE_FAN + * @final + * @default 0x0006 + */ + exports.TRIANGLES = TRIANGLES; + var TRIANGLE_FAN = 6; + /** + * @property {Number} TRIANGLE_STRIP + * @final + * @default 0x0005 + */ + exports.TRIANGLE_FAN = TRIANGLE_FAN; + var TRIANGLE_STRIP = 5; + /** + * @property {String} QUADS + * @final + */ + exports.TRIANGLE_STRIP = TRIANGLE_STRIP; + var QUADS = "quads"; + /** + * @property {String} QUAD_STRIP + * @final + * @default quad_strip + */ + exports.QUADS = QUADS; + var QUAD_STRIP = "quad_strip"; + /** + * @property {String} TESS + * @final + * @default tess + */ + exports.QUAD_STRIP = QUAD_STRIP; + var TESS = "tess"; + /** + * @property {String} CLOSE + * @final + */ + exports.TESS = TESS; + var CLOSE = "close"; + /** + * @property {String} OPEN + * @final + */ + exports.CLOSE = CLOSE; + var OPEN = "open"; + /** + * @property {String} CHORD + * @final + */ + exports.OPEN = OPEN; + var CHORD = "chord"; + /** + * @property {String} PIE + * @final + */ + exports.CHORD = CHORD; + var PIE = "pie"; + /** + * @property {String} PROJECT + * @final + * @default square + */ + exports.PIE = PIE; + var PROJECT = "square"; // PEND: careful this is counterintuitive + /** + * @property {String} SQUARE + * @final + * @default butt + */ + exports.PROJECT = PROJECT; + var SQUARE = "butt"; + /** + * @property {String} ROUND + * @final + */ + exports.SQUARE = SQUARE; + var ROUND = "round"; + /** + * @property {String} BEVEL + * @final + */ + exports.ROUND = ROUND; + var BEVEL = "bevel"; + /** + * @property {String} MITER + * @final + */ + exports.BEVEL = BEVEL; + var MITER = "miter"; + // COLOR + /** + * @property {String} RGB + * @final + */ + exports.MITER = MITER; + var RGB = "rgb"; + /** + * HSB (hue, saturation, brightness) is a type of color model. + * You can learn more about it at + * HSB. + * + * @property {String} HSB + * @final + */ + exports.RGB = RGB; + var HSB = "hsb"; + /** + * @property {String} HSL + * @final + */ + exports.HSB = HSB; + var HSL = "hsl"; + // DOM EXTENSION + /** + * AUTO allows us to automatically set the width or height of an element (but not both), + * based on the current height and width of the element. Only one parameter can + * be passed to the size function as AUTO, at a time. + * + * @property {String} AUTO + * @final + */ + exports.HSL = HSL; + var AUTO = "auto"; + /** + * @property {Number} ALT + * @final + */ + // INPUT + exports.AUTO = AUTO; + var ALT = 18; + /** + * @property {Number} BACKSPACE + * @final + */ + exports.ALT = ALT; + var BACKSPACE = 8; + /** + * @property {Number} CONTROL + * @final + */ + exports.BACKSPACE = BACKSPACE; + var CONTROL = 17; + /** + * @property {Number} DELETE + * @final + */ + exports.CONTROL = CONTROL; + var DELETE = 46; + /** + * @property {Number} DOWN_ARROW + * @final + */ + exports.DELETE = DELETE; + var DOWN_ARROW = 40; + /** + * @property {Number} ENTER + * @final + */ + exports.DOWN_ARROW = DOWN_ARROW; + var ENTER = 13; + /** + * @property {Number} ESCAPE + * @final + */ + exports.ENTER = ENTER; + var ESCAPE = 27; + /** + * @property {Number} LEFT_ARROW + * @final + */ + exports.ESCAPE = ESCAPE; + var LEFT_ARROW = 37; + /** + * @property {Number} OPTION + * @final + */ + exports.LEFT_ARROW = LEFT_ARROW; + var OPTION = 18; + /** + * @property {Number} RETURN + * @final + */ + exports.OPTION = OPTION; + var RETURN = 13; + /** + * @property {Number} RIGHT_ARROW + * @final + */ + exports.RETURN = RETURN; + var RIGHT_ARROW = 39; + /** + * @property {Number} SHIFT + * @final + */ + exports.RIGHT_ARROW = RIGHT_ARROW; + var SHIFT = 16; + /** + * @property {Number} TAB + * @final + */ + exports.SHIFT = SHIFT; + var TAB = 9; + /** + * @property {Number} UP_ARROW + * @final + */ + exports.TAB = TAB; + var UP_ARROW = 38; + // RENDERING + /** + * @property {String} BLEND + * @final + * @default source-over + */ + exports.UP_ARROW = UP_ARROW; + var BLEND = "source-over"; + /** + * @property {String} REMOVE + * @final + * @default destination-out + */ + exports.BLEND = BLEND; + var REMOVE = "destination-out"; + /** + * @property {String} ADD + * @final + * @default lighter + */ + exports.REMOVE = REMOVE; + var ADD = "lighter"; + //ADD: 'add', // + //SUBTRACT: 'subtract', // + /** + * @property {String} DARKEST + * @final + */ + exports.ADD = ADD; + var DARKEST = "darken"; + /** + * @property {String} LIGHTEST + * @final + * @default lighten + */ + exports.DARKEST = DARKEST; + var LIGHTEST = "lighten"; + /** + * @property {String} DIFFERENCE + * @final + */ + exports.LIGHTEST = LIGHTEST; + var DIFFERENCE = "difference"; + /** + * @property {String} SUBTRACT + * @final + */ + exports.DIFFERENCE = DIFFERENCE; + var SUBTRACT = "subtract"; + /** + * @property {String} EXCLUSION + * @final + */ + exports.SUBTRACT = SUBTRACT; + var EXCLUSION = "exclusion"; + /** + * @property {String} MULTIPLY + * @final + */ + exports.EXCLUSION = EXCLUSION; + var MULTIPLY = "multiply"; + /** + * @property {String} SCREEN + * @final + */ + exports.MULTIPLY = MULTIPLY; + var SCREEN = "screen"; + /** + * @property {String} REPLACE + * @final + * @default copy + */ + exports.SCREEN = SCREEN; + var REPLACE = "copy"; + /** + * @property {String} OVERLAY + * @final + */ + exports.REPLACE = REPLACE; + var OVERLAY = "overlay"; + /** + * @property {String} HARD_LIGHT + * @final + */ + exports.OVERLAY = OVERLAY; + var HARD_LIGHT = "hard-light"; + /** + * @property {String} SOFT_LIGHT + * @final + */ + exports.HARD_LIGHT = HARD_LIGHT; + var SOFT_LIGHT = "soft-light"; + /** + * @property {String} DODGE + * @final + * @default color-dodge + */ + exports.SOFT_LIGHT = SOFT_LIGHT; + var DODGE = "color-dodge"; + /** + * @property {String} BURN + * @final + * @default color-burn + */ + exports.DODGE = DODGE; + var BURN = "color-burn"; + // FILTERS + /** + * @property {String} THRESHOLD + * @final + */ + exports.BURN = BURN; + var THRESHOLD = "threshold"; + /** + * @property {String} GRAY + * @final + */ + exports.THRESHOLD = THRESHOLD; + var GRAY = "gray"; + /** + * @property {String} OPAQUE + * @final + */ + exports.GRAY = GRAY; + var OPAQUE = "opaque"; + /** + * @property {String} INVERT + * @final + */ + exports.OPAQUE = OPAQUE; + var INVERT = "invert"; + /** + * @property {String} POSTERIZE + * @final + */ + exports.INVERT = INVERT; + var POSTERIZE = "posterize"; + /** + * @property {String} DILATE + * @final + */ + exports.POSTERIZE = POSTERIZE; + var DILATE = "dilate"; + /** + * @property {String} ERODE + * @final + */ + exports.DILATE = DILATE; + var ERODE = "erode"; + /** + * @property {String} BLUR + * @final + */ + exports.ERODE = ERODE; + var BLUR = "blur"; + // TYPOGRAPHY + /** + * @property {String} NORMAL + * @final + */ + exports.BLUR = BLUR; + var NORMAL = "normal"; + /** + * @property {String} ITALIC + * @final + */ + exports.NORMAL = NORMAL; + var ITALIC = "italic"; + /** + * @property {String} BOLD + * @final + */ + exports.ITALIC = ITALIC; + var BOLD = "bold"; + /** + * @property {String} BOLDITALIC + * @final + */ + exports.BOLD = BOLD; + var BOLDITALIC = "bold italic"; + /** + * @property {String} CHAR + * @final + */ + exports.BOLDITALIC = BOLDITALIC; + var CHAR = "CHAR"; + /** + * @property {String} WORD + * @final + */ + exports.CHAR = CHAR; + var WORD = "WORD"; + // TYPOGRAPHY-INTERNAL + exports.WORD = WORD; + var _DEFAULT_TEXT_FILL = "#000000"; + exports._DEFAULT_TEXT_FILL = _DEFAULT_TEXT_FILL; + var _DEFAULT_LEADMULT = 1.25; + exports._DEFAULT_LEADMULT = _DEFAULT_LEADMULT; + var _CTX_MIDDLE = "middle"; + // VERTICES + /** + * @property {String} LINEAR + * @final + */ + exports._CTX_MIDDLE = _CTX_MIDDLE; + var LINEAR = "linear"; + /** + * @property {String} QUADRATIC + * @final + */ + exports.LINEAR = LINEAR; + var QUADRATIC = "quadratic"; + /** + * @property {String} BEZIER + * @final + */ + exports.QUADRATIC = QUADRATIC; + var BEZIER = "bezier"; + /** + * @property {String} CURVE + * @final + */ + exports.BEZIER = BEZIER; + var CURVE = "curve"; + // WEBGL DRAWMODES + /** + * @property {String} STROKE + * @final + */ + exports.CURVE = CURVE; + var STROKE = "stroke"; + /** + * @property {String} FILL + * @final + */ + exports.STROKE = STROKE; + var FILL = "fill"; + /** + * @property {String} TEXTURE + * @final + */ + exports.FILL = FILL; + var TEXTURE = "texture"; + /** + * @property {String} IMMEDIATE + * @final + */ + exports.TEXTURE = TEXTURE; + var IMMEDIATE = "immediate"; + // WEBGL TEXTURE MODE + // NORMAL already exists for typography + /** + * @property {String} IMAGE + * @final + */ + exports.IMMEDIATE = IMMEDIATE; + var IMAGE = "image"; + // WEBGL TEXTURE WRAP AND FILTERING + // LINEAR already exists above + /** + * @property {String} NEAREST + * @final + */ + exports.IMAGE = IMAGE; + var NEAREST = "nearest"; + /** + * @property {String} REPEAT + * @final + */ + exports.NEAREST = NEAREST; + var REPEAT = "repeat"; + /** + * @property {String} CLAMP + * @final + */ + exports.REPEAT = REPEAT; + var CLAMP = "clamp"; + /** + * @property {String} MIRROR + * @final + */ + exports.CLAMP = CLAMP; + var MIRROR = "mirror"; + // WEBGL GEOMETRY SHADING + /** + * @property {String} FLAT + * @final + */ + exports.MIRROR = MIRROR; + var FLAT = "flat"; + /** + * @property {String} SMOOTH + * @final + */ + exports.FLAT = FLAT; + var SMOOTH = "smooth"; + // DEVICE-ORIENTATION + /** + * @property {String} LANDSCAPE + * @final + */ + exports.SMOOTH = SMOOTH; + var LANDSCAPE = "landscape"; + /** + * @property {String} PORTRAIT + * @final + */ + exports.LANDSCAPE = LANDSCAPE; + var PORTRAIT = "portrait"; + // DEFAULTS + exports.PORTRAIT = PORTRAIT; + var _DEFAULT_STROKE = "#000000"; + exports._DEFAULT_STROKE = _DEFAULT_STROKE; + var _DEFAULT_FILL = "#FFFFFF"; + /** + * @property {String} GRID + * @final + */ + exports._DEFAULT_FILL = _DEFAULT_FILL; + var GRID = "grid"; + /** + * @property {String} AXES + * @final + */ + exports.GRID = GRID; + var AXES = "axes"; + /** + * @property {String} LABEL + * @final + */ + exports.AXES = AXES; + var LABEL = "label"; + /** + * @property {String} FALLBACK + * @final + */ + exports.LABEL = LABEL; + var FALLBACK = "fallback"; + /** + * @property {String} CONTAIN + * @final + */ + exports.FALLBACK = FALLBACK; + var CONTAIN = "contain"; + /** + * @property {String} COVER + * @final + */ + exports.CONTAIN = CONTAIN; + var COVER = "cover"; + /** + * @property {String} UNSIGNED_BYTE + * @final + */ + exports.COVER = COVER; + var UNSIGNED_BYTE = "unsigned-byte"; + /** + * @property {String} UNSIGNED_INT + * @final + */ + exports.UNSIGNED_BYTE = UNSIGNED_BYTE; + var UNSIGNED_INT = "unsigned-int"; + /** + * @property {String} FLOAT + * @final + */ + exports.UNSIGNED_INT = UNSIGNED_INT; + var FLOAT = "float"; + /** + * @property {String} HALF_FLOAT + * @final + */ + exports.FLOAT = FLOAT; + var HALF_FLOAT = "half-float"; + /** + * @property {String} RGBA + * @final + */ + exports.HALF_FLOAT = HALF_FLOAT; + var RGBA = "rgba"; + exports.RGBA = RGBA; + }, + {}, + ], + 287: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.search"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.search"); + _dereq_("core-js/modules/es.string.split"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + var C = _interopRequireWildcard(_dereq_("./constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + * @requires constants + */ + + var standardCursors = [ + C.ARROW, + C.CROSS, + C.HAND, + C.MOVE, + C.TEXT, + C.WAIT, + ]; + _main.default.prototype._frameRate = 0; + _main.default.prototype._lastFrameTime = window.performance.now(); + _main.default.prototype._targetFrameRate = 60; + var _windowPrint = window.print; + var windowPrintDisabled = false; + /** + * Displays text in the web browser's console. + * + * `print()` is helpful for printing values while debugging. Each call to + * `print()` creates a new line of text. + * + * Note: Call `print('\n')` to print a blank line. Calling `print()` without + * an argument opens the browser's dialog for printing documents. + * + * @method print + * @param {Any} contents content to print to the console. + * @example + *
                    + * + * function setup() { + * // Prints "hello, world" to the console. + * print('hello, world'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * let name = 'ada'; + * // Prints "hello, ada" to the console. + * print(`hello, ${name}`); + * } + * + *
                    + */ + _main.default.prototype.print = function () { + if (!arguments.length) { + if (!windowPrintDisabled) { + _windowPrint(); + if ( + window.confirm( + "You just tried to print the webpage. Do you want to prevent this from running again?", + ) + ) { + windowPrintDisabled = true; + } + } + } else { + var _console; + (_console = console).log.apply(_console, arguments); + } + }; + /** + * Tracks the number of frames drawn since the sketch started. + * + * `frameCount`'s value is 0 inside setup(). It + * increments by 1 each time the code in draw() + * finishes executing. + * + * @property {Integer} frameCount + * @readOnly + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Display the value of + * // frameCount. + * textSize(30); + * textAlign(CENTER, CENTER); + * text(frameCount, 50, 50); + * + * describe('The number 0 written in black in the middle of a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Set the frameRate to 30. + * frameRate(30); + * + * textSize(30); + * textAlign(CENTER, CENTER); + * } + * + * function draw() { + * background(200); + * + * // Display the value of + * // frameCount. + * text(frameCount, 50, 50); + * + * describe('A number written in black in the middle of a gray square. Its value increases rapidly.'); + * } + * + *
                    + */ + _main.default.prototype.frameCount = 0; + /** + * Tracks the amount of time, in milliseconds, it took for + * draw to draw the previous frame. `deltaTime` is + * useful for simulating physics. + * + * @property {Integer} deltaTime + * @readOnly + * @example + *
                    + * + * let x = 0; + * let speed = 0.05; + * + * function setup() { + * // Set the frameRate to 30. + * frameRate(30); + * } + * + * function draw() { + * background(200); + * + * // Use deltaTime to calculate + * // a change in position. + * let deltaX = speed * deltaTime; + * + * // Update the x variable. + * x += deltaX; + * + * // Reset x to 0 if it's + * // greater than 100. + * if (x > 100) { + * x = 0; + * } + * + * // Use x to set the circle's + * // position. + * circle(x, 50, 20); + * + * describe('A white circle moves from left to right on a gray background. It reappears on the left side when it reaches the right side.'); + * } + * + *
                    + */ + _main.default.prototype.deltaTime = 0; + /** + * Tracks whether the browser window is focused and can receive user input. + * `focused` is `true` if the window if focused and `false` if not. + * + * @property {Boolean} focused + * @readOnly + * @example + *
                    + * + * // Open this example in two separate browser + * // windows placed side-by-side to demonstrate. + * + * function draw() { + * // Change the background color + * // when the browser window + * // goes in/out of focus. + * if (focused === true) { + * background(0, 255, 0); + * } else { + * background(255, 0, 0); + * } + * + * describe('A square changes color from green to red when the browser window is out of focus.'); + * } + * + *
                    + */ + _main.default.prototype.focused = document.hasFocus(); + /** + * Changes the cursor's appearance. + * + * The first parameter, `type`, sets the type of cursor to display. The + * built-in options are `ARROW`, `CROSS`, `HAND`, `MOVE`, `TEXT`, and `WAIT`. + * `cursor()` also recognizes standard CSS cursor properties passed as + * strings: `'help'`, `'wait'`, `'crosshair'`, `'not-allowed'`, `'zoom-in'`, + * and `'grab'`. If the path to an image is passed, as in + * `cursor('assets/target.png')`, then the image will be used as the cursor. + * Images must be in .cur, .gif, .jpg, .jpeg, or .png format. + * + * The parameters `x` and `y` are optional. If an image is used for the + * cursor, `x` and `y` set the location pointed to within the image. They are + * both 0 by default, so the cursor points to the image's top-left corner. `x` + * and `y` must be less than the image's width and height, respectively. + * + * @method cursor + * @param {String|Constant} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT. + * Native CSS properties: 'grab', 'progress', and so on. + * Path to cursor image. + * @param {Number} [x] horizontal active spot of the cursor. + * @param {Number} [y] vertical active spot of the cursor. + * @example + *
                    + * + * function draw() { + * background(200); + * + * // Set the cursor to crosshairs: + + * cursor(CROSS); + * + * describe('A gray square. The cursor appears as crosshairs.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * // Divide the canvas into quadrants. + * line(50, 0, 50, 100); + * line(0, 50, 100, 50); + * + * // Change cursor based on mouse position. + * if (mouseX < 50 && mouseY < 50) { + * cursor(CROSS); + * } else if (mouseX > 50 && mouseY < 50) { + * cursor('progress'); + * } else if (mouseX > 50 && mouseY > 50) { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); + * } else { + * cursor('grab'); + * } + * + * describe('A gray square divided into quadrants. The cursor image changes when the mouse moves to each quadrant.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * // Change the cursor's active spot + * // when the mouse is pressed. + * if (mouseIsPressed === true) { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16', 8, 8); + * } else { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); + * } + * + * describe('An image of three purple curves follows the mouse. The image shifts when the mouse is pressed.'); + * } + * + *
                    + */ + _main.default.prototype.cursor = function (type, x, y) { + var cursor = "auto"; + var canvas = this._curElement.elt; + if (standardCursors.includes(type)) { + // Standard css cursor + cursor = type; + } else if (typeof type === "string") { + var coords = ""; + if (x && y && typeof x === "number" && typeof y === "number") { + // Note that x and y values must be unit-less positive integers < 32 + // https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + coords = "".concat(x, " ").concat(y); + } + if ( + type.substring(0, 7) === "http://" || + type.substring(0, 8) === "https://" + ) { + // Image (absolute url) + cursor = "url(".concat(type, ") ").concat(coords, ", auto"); + } else if ( + /\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(type) + ) { + // Image file (relative path) - Separated for performance reasons + cursor = "url(".concat(type, ") ").concat(coords, ", auto"); + } else { + // Any valid string for the css cursor property + cursor = type; + } + } + canvas.style.cursor = cursor; + }; + /** + * Sets the number of frames to draw per second. + * + * Calling `frameRate()` with one numeric argument, as in `frameRate(30)`, + * attempts to draw 30 frames per second (FPS). The target frame rate may not + * be achieved depending on the sketch's processing needs. Most computers + * default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are + * fast enough for smooth animations. + * + * Calling `frameRate()` without an argument returns the current frame rate. + * The value returned is an approximation. + * + * @method frameRate + * @param {Number} fps number of frames to draw per second. + * @chainable + * + * @example + *
                    + * + * function draw() { + * background(200); + * + * // Set the x variable based + * // on the current frameCount. + * let x = frameCount % 100; + * + * // If the mouse is pressed, + * // decrease the frame rate. + * if (mouseIsPressed === true) { + * frameRate(10); + * } else { + * frameRate(60); + * } + * + * // Use x to set the circle's + * // position. + * circle(x, 50, 20); + * + * describe('A white circle on a gray background. The circle moves from left to right in a loop. It slows down when the mouse is pressed.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * // If the mouse is pressed, do lots + * // of math to slow down drawing. + * if (mouseIsPressed === true) { + * for (let i = 0; i < 1000000; i += 1) { + * random(); + * } + * } + * + * // Get the current frame rate + * // and display it. + * let fps = frameRate(); + * text(fps, 50, 50); + * + * describe('A number written in black written on a gray background. The number decreases when the mouse is pressed.'); + * } + * + *
                    + */ + /** + * @method frameRate + * @return {Number} current frame rate. + */ + _main.default.prototype.frameRate = function (fps) { + _main.default._validateParameters("frameRate", arguments); + if (typeof fps !== "number" || fps < 0) { + return this._frameRate; + } else { + this._setProperty("_targetFrameRate", fps); + if (fps === 0) { + this._setProperty("_frameRate", fps); + } + return this; + } + }; + /** + * Returns the current framerate. + * + * @private + * @return {Number} current frameRate + */ + _main.default.prototype.getFrameRate = function () { + return this.frameRate(); + }; + /** + * Specifies the number of frames to be displayed every second. For example, + * the function call frameRate(30) will attempt to refresh 30 times a second. + * If the processor is not fast enough to maintain the specified rate, the + * frame rate will not be achieved. Setting the frame rate within setup() is + * recommended. The default rate is 60 frames per second. + * + * Calling `frameRate()` with no arguments returns the current frame rate. + * + * @private + * @param {Number} [fps] number of frames to be displayed every second + */ + _main.default.prototype.setFrameRate = function (fps) { + return this.frameRate(fps); + }; + /** + * Returns the target frame rate. The value is either the system frame rate or + * the last value passed to frameRate(). + * + * @method getTargetFrameRate + * @return {Number} _targetFrameRate + * @example + *
                    + * + * function draw() { + * background(200); + * + * // Set the frame rate to 20. + * frameRate(20); + * + * // Get the target frame rate and + * // display it. + * let fps = getTargetFrameRate(); + * text(fps, 43, 54); + * + * describe('The number 20 written in black on a gray background.'); + * } + * + *
                    + */ + _main.default.prototype.getTargetFrameRate = function () { + return this._targetFrameRate; + }; + /** + * Hides the cursor from view. + * + * @method noCursor + * @example + *
                    + * + * function setup() { + * // Hide the cursor. + * noCursor(); + * } + * + * function draw() { + * background(200); + * + * circle(mouseX, mouseY, 10); + * + * describe('A white circle on a gray background. The circle follows the mouse as it moves. The cursor is hidden.'); + * } + * + *
                    + */ + _main.default.prototype.noCursor = function () { + this._curElement.elt.style.cursor = "none"; + }; + /** + * A string variable with the WebGL version in use. Its value equals one of + * the followin string constants: + * + * - `WEBGL2` whose value is `'webgl2'`, + * - `WEBGL` whose value is `'webgl'`, or + * - `P2D` whose value is `'p2d'`. This is the default for 2D sketches. + * + * See setAttributes() for ways to set the + * WebGL version. + * + * @property {String} webglVersion + * @readOnly + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Display the current WebGL version. + * text(webglVersion, 42, 54); + * + * describe('The text "p2d" written in black on a gray background.'); + * } + * + *
                    + * + *
                    + * + * let font; + * + * function preload() { + * // Load a font to use. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * // Create a canvas using WEBGL mode. + * createCanvas(100, 50, WEBGL); + * background(200); + * + * // Display the current WebGL version. + * fill(0); + * textFont(font); + * text(webglVersion, -15, 5); + * + * describe('The text "webgl2" written in black on a gray background.'); + * } + * + *
                    + * + *
                    + * + * let font; + * + * function preload() { + * // Load a font to use. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * // Create a canvas using WEBGL mode. + * createCanvas(100, 50, WEBGL); + * + * // Set WebGL to version 1. + * setAttributes({ version: 1 }); + * + * background(200); + * + * // Display the current WebGL version. + * fill(0); + * textFont(font); + * text(webglVersion, -14, 5); + * + * describe('The text "webgl" written in black on a gray background.'); + * } + * + *
                    + */ + _main.default.prototype.webglVersion = C.P2D; + /** + * A numeric variable that stores the width of the screen display. Its value + * depends on the current pixelDensity(). + * `displayWidth` is useful for running full-screen programs. + * + * Note: The actual screen width can be computed as + * `displayWidth * pixelDensity()`. + * + * @property {Number} displayWidth + * @readOnly + * @example + *
                    + * + * function setup() { + * // Set the canvas' width and height + * // using the display's dimensions. + * createCanvas(displayWidth, displayHeight); + * + * background(200); + * + * describe('A gray canvas that is the same size as the display.'); + * } + * + *
                    + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.displayWidth = screen.width; + /** + * A numeric variable that stores the height of the screen display. Its value + * depends on the current pixelDensity(). + * `displayHeight` is useful for running full-screen programs. + * + * Note: The actual screen height can be computed as + * `displayHeight * pixelDensity()`. + * + * @property {Number} displayHeight + * @readOnly + * @example + *
                    + * + * function setup() { + * // Set the canvas' width and height + * // using the display's dimensions. + * createCanvas(displayWidth, displayHeight); + * + * background(200); + * + * describe('A gray canvas that is the same size as the display.'); + * } + * + *
                    + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.displayHeight = screen.height; + /** + * A numeric variable that stores the width of the browser's + * layout viewport. + * This viewport is the area within the browser that's available for drawing. + * + * @property {Number} windowWidth + * @readOnly + * @example + *
                    + * + * function setup() { + * // Set the canvas' width and height + * // using the browser's dimensions. + * createCanvas(windowWidth, windowHeight); + * + * background(200); + * + * describe('A gray canvas that takes up the entire browser window.'); + * } + * + *
                    + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.windowWidth = getWindowWidth(); + /** + * A numeric variable that stores the height of the browser's + * layout viewport. + * This viewport is the area within the browser that's available for drawing. + * + * @property {Number} windowHeight + * @readOnly + * @example + *
                    + * + * function setup() { + * // Set the canvas' width and height + * // using the browser's dimensions. + * createCanvas(windowWidth, windowHeight); + * + * background(200); + * + * describe('A gray canvas that takes up the entire browser window.'); + * } + * + *
                    + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.windowHeight = getWindowHeight(); + /** + * The code in `windowResized()` is called once each time the browser window + * is resized. It's a good place to resize the canvas or make other + * adjustments to accommodate the new window size. + * + * The `event` parameter is optional. If added to the function definition, it + * can be used for debugging or other purposes. + * + * @method windowResized + * @param {UIEvent} [event] optional resize Event. + * @example + *
                    + * + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(200); + * + * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); + * } + * + * // Resize the canvas when the + * // browser's size changes. + * function windowResized() { + * resizeCanvas(windowWidth, windowHeight); + * } + * + *
                    + * @alt + * This example does not render anything. + * + *
                    + * + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(200); + * + * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); + * } + * + * function windowResized(event) { + * // Resize the canvas when the + * // browser's size changes. + * resizeCanvas(windowWidth, windowHeight); + * + * // Print the resize event to the console for debugging. + * print(event); + * } + * + *
                    + * @alt + * This example does not render anything. + */ + _main.default.prototype._onresize = function (e) { + this._setProperty("windowWidth", getWindowWidth()); + this._setProperty("windowHeight", getWindowHeight()); + var context = this._isGlobal ? window : this; + var executeDefault; + if (typeof context.windowResized === "function") { + executeDefault = context.windowResized(e); + if (executeDefault !== undefined && !executeDefault) { + e.preventDefault(); + } + } + }; + function getWindowWidth() { + return ( + window.innerWidth || + (document.documentElement && + document.documentElement.clientWidth) || + (document.body && document.body.clientWidth) || + 0 + ); + } + function getWindowHeight() { + return ( + window.innerHeight || + (document.documentElement && + document.documentElement.clientHeight) || + (document.body && document.body.clientHeight) || + 0 + ); + } /** + * A numeric variable that stores the width of the drawing canvas. Its + * default value is 100. + * + * Calling createCanvas() or + * resizeCanvas() changes the value of + * `width`. Calling noCanvas() sets its value to + * 0. + * + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Display the canvas' width. + * text(width, 42, 54); + * + * describe('The number 100 written in black on a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(50, 100); + * + * background(200); + * + * // Display the canvas' width. + * text(width, 21, 54); + * + * describe('The number 50 written in black on a gray rectangle.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Display the canvas' width. + * text(width, 42, 54); + * + * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); + * } + * + * // If the mouse is pressed, reisze + * // the canvas and display its new + * // width. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * resizeCanvas(50, 100); + * background(200); + * text(width, 42, 27); + * } + * } + * + *
                    + * + * @property {Number} width + * @readOnly + */ + + _main.default.prototype.width = 0; + /** + * A numeric variable that stores the height of the drawing canvas. Its + * default value is 100. + * + * Calling createCanvas() or + * resizeCanvas() changes the value of + * `height`. Calling noCanvas() sets its value to + * 0. + * + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Display the canvas' height. + * text(height, 42, 54); + * + * describe('The number 100 written in black on a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 50); + * + * background(200); + * + * // Display the canvas' height. + * text(height, 21, 54); + * + * describe('The number 50 written in black on a gray rectangle.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Display the canvas' height. + * text(height, 42, 54); + * + * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); + * } + * + * // If the mouse is pressed, reisze + * // the canvas and display its new + * // height. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * resizeCanvas(100, 50); + * background(200); + * text(height, 42, 27); + * } + * } + * + *
                    + * + * @property {Number} height + * @readOnly + */ + _main.default.prototype.height = 0; + /** + * Toggles full-screen mode or returns the current mode. + * + * Calling `fullscreen(true)` makes the sketch full-screen. Calling + * `fullscreen(false)` makes the sketch its original size. + * + * Calling `fullscreen()` without an argument returns `true` if the sketch + * is in full-screen mode and `false` if not. + * + * Note: Due to browser restrictions, `fullscreen()` can only be called with + * user input such as a mouse press. + * + * @method fullscreen + * @param {Boolean} [val] whether the sketch should be in fullscreen mode. + * @return {Boolean} current fullscreen state. + * @example + *
                    + * + * function setup() { + * background(200); + * + * describe('A gray canvas that switches between default and full-screen display when clicked.'); + * } + * + * // If the mouse is pressed, + * // toggle full-screen mode. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * let fs = fullscreen(); + * fullscreen(!fs); + * } + * } + * + *
                    + */ + _main.default.prototype.fullscreen = function (val) { + _main.default._validateParameters("fullscreen", arguments); + // no arguments, return fullscreen or not + if (typeof val === "undefined") { + return ( + document.fullscreenElement || + document.webkitFullscreenElement || + document.mozFullScreenElement || + document.msFullscreenElement + ); + } else { + // otherwise set to fullscreen or not + if (val) { + launchFullscreen(document.documentElement); + } else { + exitFullscreen(); + } + } + }; + /** + * Sets the pixel scaling for high pixel density displays. + * + * By default, the pixel density is set to match display density. Calling + * `pixelDensity(1)` turn this off. + * + * Calling `pixelDensity()` without an argument returns the current pixel + * density. + * + * @method pixelDensity + * @param {Number} [val] desired pixel density. + * @chainable + * @example + *
                    + * + * function setup() { + * // Set the pixel density to 1. + * pixelDensity(1); + * + * // Create a canvas and draw + * // a circle. + * createCanvas(100, 100); + * background(200); + * circle(50, 50, 70); + * + * describe('A fuzzy white circle on a gray canvas.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Set the pixel density to 3. + * pixelDensity(3); + * + * // Create a canvas, paint the + * // background, and draw a + * // circle. + * createCanvas(100, 100); + * background(200); + * circle(50, 50, 70); + * + * describe('A sharp white circle on a gray canvas.'); + * } + * + *
                    + */ + /** + * @method pixelDensity + * @returns {Number} current pixel density of the sketch. + */ + _main.default.prototype.pixelDensity = function (val) { + _main.default._validateParameters("pixelDensity", arguments); + var returnValue; + if (typeof val === "number") { + if (val !== this._pixelDensity) { + this._pixelDensity = val; + } + returnValue = this; + this.resizeCanvas(this.width, this.height, true); // as a side effect, it will clear the canvas + } else { + returnValue = this._pixelDensity; + } + return returnValue; + }; + /** + * Returns the display's current pixel density. + * + * @method displayDensity + * @returns {Number} current pixel density of the display. + * @example + *
                    + * + * function setup() { + * // Set the pixel density to 1. + * pixelDensity(1); + * + * // Create a canvas and draw + * // a circle. + * createCanvas(100, 100); + * background(200); + * circle(50, 50, 70); + * + * describe('A fuzzy white circle drawn on a gray background. The circle becomes sharper when the mouse is pressed.'); + * } + * + * function mousePressed() { + * // Get the current display density. + * let d = displayDensity(); + * + * // Use the display density to set + * // the sketch's pixel density. + * pixelDensity(d); + * + * // Paint the background and + * // draw a circle. + * background(200); + * circle(50, 50, 70); + * } + * + *
                    + */ + _main.default.prototype.displayDensity = function () { + return window.devicePixelRatio; + }; + function launchFullscreen(element) { + var enabled = + document.fullscreenEnabled || + document.webkitFullscreenEnabled || + document.mozFullScreenEnabled || + document.msFullscreenEnabled; + if (!enabled) { + throw new Error("Fullscreen not enabled in this browser."); + } + if (element.requestFullscreen) { + element.requestFullscreen(); + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen(); + } else if (element.webkitRequestFullscreen) { + element.webkitRequestFullscreen(); + } else if (element.msRequestFullscreen) { + element.msRequestFullscreen(); + } + } + function exitFullscreen() { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + } /** + * Returns the sketch's current + * URL + * as a string. + * + * @method getURL + * @return {String} url + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Get the sketch's URL + * // and display it. + * let url = getURL(); + * textWrap(CHAR); + * text(url, 0, 40, 100); + * + * describe('The URL "https://p5js.org/reference/#/p5/getURL" written in black on a gray background.'); + * } + * + *
                    + */ + + _main.default.prototype.getURL = function () { + return location.href; + }; + /** + * Returns the current + * URL + * path as an array of strings. + * + * For example, consider a sketch hosted at the URL + * `https://example.com/sketchbook`. Calling `getURLPath()` returns + * `['sketchbook']`. For a sketch hosted at the URL + * `https://example.com/sketchbook/monday`, `getURLPath()` returns + * `['sketchbook', 'monday']`. + * + * @method getURLPath + * @return {String[]} path components. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Get the sketch's URL path + * // and display the first + * // part. + * let path = getURLPath(); + * text(path[0], 25, 54); + * + * describe('The word "reference" written in black on a gray background.'); + * } + * + *
                    + */ + _main.default.prototype.getURLPath = function () { + return location.pathname.split("/").filter(function (v) { + return v !== ""; + }); + }; + /** + * Returns the current + * URL parameters + * in an Object. + * + * For example, calling `getURLParams()` in a sketch hosted at the URL + * `http://p5js.org?year=2014&month=May&day=15` returns + * `{ year: 2014, month: 'May', day: 15 }`. + * + * @method getURLParams + * @return {Object} URL params + * @example + *
                    + * + * // Imagine this sketch is hosted at the following URL: + * // https://p5js.org?year=2014&month=May&day=15 + * + * function setup() { + * background(200); + * + * // Get the sketch's URL + * // parameters and display + * // them. + * let params = getURLParams(); + * text(params.day, 10, 20); + * text(params.month, 10, 40); + * text(params.year, 10, 60); + * + * describe('The text "15", "May", and "2014" written in black on separate lines.'); + * } + * + *
                    + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.getURLParams = function () { + var re = /[?&]([^&=]+)(?:[&=])([^&=]+)/gim; + var m; + var v = {}; + while ((m = re.exec(location.search)) != null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + v[m[1]] = m[2]; + } + return v; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "./constants": 286, + "./main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.search": 215, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 288: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + // This contains a data table used by ./fes_core.js/fesErrorMonitor(). + // + // Note: Different browsers use different error strings for the same error. + // Extracting info from the browser error messages is easier and cleaner + // if we have a predefined lookup. This file serves as that lookup. + // Using this lookup we match the errors obtained from the browser, classify + // them into types and extract the required information. + // The FES can use the extracted info to generate a friendly error message + // for the matching error. + var strings = { + ReferenceError: [ + { + msg: "{{}} is not defined", + type: "NOTDEFINED", + browser: "all", + }, + { + msg: "Can't find variable: {{}}", + type: "NOTDEFINED", + browser: "Safari", + }, + { + msg: "Cannot access '{{.}}' before initialization", + type: "CANNOTACCESS", + browser: "Chrome", + }, + { + msg: "can't access lexical declaration '{{.}}' before initialization", + type: "CANNOTACCESS", + browser: "Firefox", + }, + ], + SyntaxError: [ + { + msg: "illegal character", + type: "INVALIDTOKEN", + browser: "Firefox", + }, + { + msg: "Invalid character", + type: "INVALIDTOKEN", + browser: "Safari", + }, + { + msg: "Invalid or unexpected token", + type: "INVALIDTOKEN", + browser: "Chrome", + }, + { + msg: "Unexpected token '{{.}}'", + type: "UNEXPECTEDTOKEN", + browser: "Chrome", + }, + { + msg: "expected {{.}}, got '{{.}}'", + type: "UNEXPECTEDTOKEN", + browser: "Chrome", + }, + { + msg: "Identifier '{{.}}' has already been declared", + type: "REDECLAREDVARIABLE", + browser: "Chrome", + }, + { + msg: "redeclaration of {} {{.}}", + type: "REDECLAREDVARIABLE", + browser: "Firefox", + }, + { + msg: "Missing initializer in const declaration", + type: "MISSINGINITIALIZER", + browser: "Chrome", + }, + { + msg: "missing = in const declaration", + type: "MISSINGINITIALIZER", + browser: "Firefox", + }, + { + msg: "Illegal return statement", + type: "BADRETURNORYIELD", + browser: "Chrome", + }, + { + msg: "return not in function", + type: "BADRETURNORYIELD", + browser: "Firefox", + }, + ], + TypeError: [ + { + msg: "{{.}} is not a function", + type: "NOTFUNC", + browser: "all", + }, + { + msg: "Cannot read {{.}} null", + type: "READNULL", + browser: "Chrome", + }, + { + msg: "{{.}} is null", + type: "READNULL", + browser: "Firefox", + }, + { + msg: "Cannot read {{.}} undefined", + type: "READUDEFINED", + browser: "Chrome", + }, + { + msg: "{{.}} is undefined", + type: "READUDEFINED", + browser: "Firefox", + }, + { + msg: "Assignment to constant variable", + type: "CONSTASSIGN", + browser: "Chrome", + }, + { + msg: "invalid assignment to const '{{.}}'", + type: "CONSTASSIGN", + browser: "Firefox", + }, + ], + }; + var _default = strings; + exports.default = _default; + }, + {}, + ], + 289: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.get-own-property-names"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.starts-with"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.get-own-property-names"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.starts-with"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var _internationalization = _dereq_("../internationalization"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _slicedToArray(arr, i) { + return ( + _arrayWithHoles(arr) || + _iterableToArrayLimit(arr, i) || + _nonIterableRest() + ); + } + function _nonIterableRest() { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance", + ); + } + function _iterableToArrayLimit(arr, i) { + if ( + !( + Symbol.iterator in Object(arr) || + Object.prototype.toString.call(arr) === "[object Arguments]" + ) + ) { + return; + } + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for ( + var _i = arr[Symbol.iterator](), _s; + !(_n = (_s = _i.next()).done); + _n = true + ) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @for p5 + * @requires core + * + * This is the main file for the Friendly Error System (FES), containing + * the core as well as miscellaneous functionality of the FES. Here is a + * brief outline of the functions called in this system. + * + * The FES may be invoked by a call to either + * (1) _validateParameters, (2) _friendlyFileLoadError, (3) _friendlyError, + * (4) helpForMisusedAtTopLevelCode, or (5) _fesErrorMonitor. + * + * _validateParameters is located in validate_params.js along with other code + * used for parameter validation. + * _friendlyFileLoadError is located in file_errors.js along with other code + * used for dealing with file load errors. + * Apart from this, there's also a file stacktrace.js, which contains the code + * to parse the error stack, borrowed from: + * https://github.com/stacktracejs/stacktrace.js + * + * For more detailed information on the FES functions, including the call + * sequence of each function, please look at the FES Reference + Dev Notes: + * https://github.com/processing/p5.js/blob/main/contributor_docs/fes_reference_dev_notes.md + */ + // p5.js blue, p5.js orange, auto dark green; fallback p5.js darkened magenta + // See testColors below for all the color codes and names + + var typeColors = ["#2D7BB6", "#EE9900", "#4DB200", "#C83C00"]; + var misusedAtTopLevelCode = null; + var defineMisusedAtTopLevelCode = null; + // the threshold for the maximum allowed levenshtein distance + // used in misspelling detection + var EDIT_DIST_THRESHOLD = 2; + // to enable or disable styling (color, font-size, etc. ) for fes messages + var ENABLE_FES_STYLING = false; + if (typeof IS_MINIFIED !== "undefined") { + _main.default._friendlyError = + _main.default._checkForUserDefinedFunctions = + _main.default._fesErrorMonitor = + function () {}; + } else { + var doFriendlyWelcome = false; // TEMP until we get it all working LM + var errorTable = _dereq_("./browser_errors").default; + // -- Borrowed from jQuery 1.11.3 -- + var class2type = {}; + var _toString = class2type.toString; + var names = [ + "Boolean", + "Number", + "String", + "Function", + "Array", + "Date", + "RegExp", + "Object", + "Error", + ]; + for (var n = 0; n < names.length; n++) { + class2type["[object ".concat(names[n], "]")] = + names[n].toLowerCase(); + } + var getType = function getType(obj) { + if (obj == null) { + return "".concat(obj); + } + return _typeof(obj) === "object" || typeof obj === "function" + ? class2type[_toString.call(obj)] || "object" + : _typeof(obj); + }; + // -- End borrow -- + // entry points into user-defined code + var entryPoints = [ + "setup", + "draw", + "preload", + "deviceMoved", + "deviceTurned", + "deviceShaken", + "doubleClicked", + "mousePressed", + "mouseReleased", + "mouseMoved", + "mouseDragged", + "mouseClicked", + "mouseWheel", + "touchStarted", + "touchMoved", + "touchEnded", + "keyPressed", + "keyReleased", + "keyTyped", + "windowResized", + ]; + var friendlyWelcome = function friendlyWelcome() { + // p5.js brand - magenta: #ED225D + //const astrixBgColor = 'transparent'; + //const astrixTxtColor = '#ED225D'; + //const welcomeBgColor = '#ED225D'; + //const welcomeTextColor = 'white'; + var welcomeMessage = (0, _internationalization.translator)( + "fes.pre", + { + message: (0, _internationalization.translator)("fes.welcome"), + }, + ); + console.log( + " _ \n" + + " /\\| |/\\ \n" + + " \\ ` ' / \n" + + " / , . \\ \n" + + " \\/|_|\\/ " + + "\n\n" + + welcomeMessage, + ); + }; + /** + * Takes a message and a p5 function func, and adds a link pointing to + * the reference documentation of func at the end of the message + * + * @method mapToReference + * @private + * @param {String} message the words to be said + * @param {String} [func] the name of function + * + * @returns {String} + */ + var mapToReference = function mapToReference(message, func) { + var msgWithReference = ""; + if (func == null || func.substring(0, 4) === "load") { + msgWithReference = message; + } else { + var methodParts = func.split("."); + var referenceSection = + methodParts.length > 1 + ? "".concat(methodParts[0], ".").concat(methodParts[1]) + : "p5"; + var funcName = + methodParts.length === 1 + ? func + : methodParts.slice(2).join("/"); + //Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link + funcName.startsWith("p5.") + ? (msgWithReference = "" + .concat(message, " (http://p5js.org/reference/#/") + .concat(referenceSection, ".") + .concat(funcName, ")")) + : (msgWithReference = "" + .concat(message, " (http://p5js.org/reference/#/") + .concat(referenceSection, "/") + .concat(funcName, ")")); + } + return msgWithReference; + }; + /** + * Prints out a fancy, colorful message to the console log + * Attaches Friendly Errors prefix [fes.pre] to the message. + * + * @method _report + * @private + * @param {String} message Message to be printed + * @param {String} [func] Name of function + * @param {Number|String} [color] CSS color code + * + * @return console logs + */ + _main.default._report = function (message, func, color) { + // if p5._fesLogger is set ( i.e we are running tests ), use that + // instead of console.log + var log = + _main.default._fesLogger == null + ? console.log.bind(console) + : _main.default._fesLogger; + if (doFriendlyWelcome) { + friendlyWelcome(); + doFriendlyWelcome = false; + } + if ("undefined" === getType(color)) { + color = "#B40033"; // dark magenta + } else if (getType(color) === "number") { + // Type to color + color = typeColors[color]; + } // Add a link to the reference docs of func at the end of the message + + message = mapToReference(message, func); + var style = [ + "color: ".concat(color), + "font-family: Arial", + "font-size: larger", + ]; + var prefixedMsg = (0, _internationalization.translator)( + "fes.pre", + { + message: message, + }, + ); + if (ENABLE_FES_STYLING) { + log("%c" + prefixedMsg, style.join(";")); + } else { + log(prefixedMsg); + } + }; + /** + * This is a generic method that can be called from anywhere in the p5 + * library to alert users to a common error. + * + * @method _friendlyError + * @private + * @param {String} message Message to be printed + * @param {String} [func] Name of the function linked to error + * @param {Number|String} [color] CSS color code + */ + _main.default._friendlyError = function (message, func, color) { + _main.default._report(message, func, color); + }; + /** + * This is called internally if there is an error with autoplay. Generates + * and prints a friendly error message [fes.autoplay]. + * + * @method _friendlyAutoplayError + * @private + */ + _main.default._friendlyAutoplayError = function (src) { + var message = (0, _internationalization.translator)( + "fes.autoplay", + { + src: src, + url: "https://developer.mozilla.org/docs/Web/Media/Autoplay_guide", + }, + ); + console.log( + (0, _internationalization.translator)("fes.pre", { + message: message, + }), + ); + }; + /** + * Measures dissimilarity between two strings by calculating + * the Levenshtein distance. + * + * If the "distance" between them is small enough, it is + * reasonable to think that one is the misspelled version of the other. + * + * Specifically, this uses the Wagner–Fischer algorithm. + * @method computeEditDistance + * @private + * @param {String} w1 the first word + * @param {String} w2 the second word + * + * @returns {Number} the "distance" between the two words, a smaller value + * indicates that the words are similar + */ + var computeEditDistance = function computeEditDistance(w1, w2) { + var l1 = w1.length, + l2 = w2.length; + if (l1 === 0) return w2; + if (l2 === 0) return w1; + var prev = []; + var cur = []; + for (var j = 0; j < l2 + 1; j++) { + cur[j] = j; + } + prev = cur; + for (var i = 1; i < l1 + 1; i++) { + cur = []; + for (var _j = 0; _j < l2 + 1; _j++) { + if (_j === 0) { + cur[_j] = i; + } else { + var a1 = w1[i - 1], + a2 = w2[_j - 1]; + var temp = 999999; + var cost = a1.toLowerCase() === a2.toLowerCase() ? 0 : 1; + temp = + temp > cost + prev[_j - 1] ? cost + prev[_j - 1] : temp; + temp = temp > 1 + cur[_j - 1] ? 1 + cur[_j - 1] : temp; + temp = temp > 1 + prev[_j] ? 1 + prev[_j] : temp; + cur[_j] = temp; + } + } + prev = cur; + } + return cur[l2]; + }; + /** + * Checks capitalization for user defined functions. + * + * Generates and prints a friendly error message using key: + * "fes.checkUserDefinedFns". + * + * @method checkForUserDefinedFunctions + * @private + * @param {*} context Current default context. Set to window in + * "global mode" and to a p5 instance in "instance mode" + */ + var checkForUserDefinedFunctions = + function checkForUserDefinedFunctions(context) { + if (_main.default.disableFriendlyErrors) return; + // if using instance mode, this function would be called with the current + // instance as context + var instanceMode = context instanceof _main.default; + context = instanceMode ? context : window; + var fnNames = entryPoints; + var fxns = {}; + // lowercasename -> actualName mapping + fnNames.forEach(function (symbol) { + fxns[symbol.toLowerCase()] = symbol; + }); + for ( + var _i = 0, _Object$keys = Object.keys(context); + _i < _Object$keys.length; + _i++ + ) { + var prop = _Object$keys[_i]; + var lowercase = prop.toLowerCase(); + // check if the lowercase property name has an entry in fxns, if the + // actual name with correct capitalization doesnt exist in context, + // and if the user-defined symbol is of the type function + if ( + fxns[lowercase] && + !context[fxns[lowercase]] && + typeof context[prop] === "function" + ) { + var msg = (0, _internationalization.translator)( + "fes.checkUserDefinedFns", + { + name: prop, + actualName: fxns[lowercase], + }, + ); + _main.default._friendlyError(msg, fxns[lowercase]); + } + } + }; + /** + * Compares the symbol caught in the ReferenceError to everything in + * misusedAtTopLevel ( all public p5 properties ). + * + * Generates and prints a friendly error message using key: "fes.misspelling". + * + * @method handleMisspelling + * @private + * @param {String} errSym Symbol to whose spelling to check + * @param {Error} error ReferenceError object + * + * @returns {Boolean} tell whether error was likely due to typo + */ + var handleMisspelling = function handleMisspelling(errSym, error) { + if (!misusedAtTopLevelCode) { + defineMisusedAtTopLevelCode(); + } + var distanceMap = {}; + var min = 999999; + // compute the levenshtein distance for the symbol against all known + // public p5 properties. Find the property with the minimum distance + misusedAtTopLevelCode.forEach(function (symbol) { + var dist = computeEditDistance(errSym, symbol.name); + if (distanceMap[dist]) distanceMap[dist].push(symbol); + else distanceMap[dist] = [symbol]; + if (dist < min) min = dist; + }); + // if the closest match has more "distance" than the max allowed threshold + if (min > Math.min(EDIT_DIST_THRESHOLD, errSym.length)) + return false; + // Show a message only if the caught symbol and the matched property name + // differ in their name ( either letter difference or difference of case ) + var matchedSymbols = distanceMap[min].filter(function (symbol) { + return symbol.name !== errSym; + }); + if (matchedSymbols.length !== 0) { + var parsed = _main.default._getErrorStackParser().parse(error); + var locationObj; + if ( + parsed && + parsed[0] && + parsed[0].fileName && + parsed[0].lineNumber && + parsed[0].columnNumber + ) { + locationObj = { + location: "" + .concat(parsed[0].fileName, ":") + .concat(parsed[0].lineNumber, ":") + .concat(parsed[0].columnNumber), + file: parsed[0].fileName.split("/").slice(-1), + line: parsed[0].lineNumber, + }; + } + var msg; + if (matchedSymbols.length === 1) { + // To be used when there is only one closest match. The count parameter + // allows i18n to pick between the keys "fes.misspelling" and + // "fes.misspelling_plural" + msg = (0, _internationalization.translator)( + "fes.misspelling", + { + name: errSym, + actualName: matchedSymbols[0].name, + type: matchedSymbols[0].type, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + count: matchedSymbols.length, + }, + ); + } else { + // To be used when there are multiple closest matches. Gives each + // suggestion on its own line, the function name followed by a link to + // reference documentation + var suggestions = matchedSymbols + .map(function (symbol) { + var message = + "▶️ " + + symbol.name + + (symbol.type === "function" ? "()" : ""); + return mapToReference(message, symbol.name); + }) + .join("\n"); + msg = (0, _internationalization.translator)( + "fes.misspelling", + { + name: errSym, + suggestions: suggestions, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + count: matchedSymbols.length, + }, + ); + } // If there is only one closest match, tell _friendlyError to also add + // a link to the reference documentation. In case of multiple matches, + // this is already done in the suggestions variable, one link for each + // suggestion. + + _main.default._friendlyError( + msg, + matchedSymbols.length === 1 + ? matchedSymbols[0].name + : undefined, + ); + return true; + } + return false; + }; + /** + * Prints a friendly stacktrace for user-written functions for "global" errors + * + * Generates and prints a friendly error message using key: + * "fes.globalErrors.stackTop", "fes.globalErrors.stackSubseq". + * + * @method printFriendlyStack + * @private + * @param {Array} friendlyStack + */ + var printFriendlyStack = function printFriendlyStack( + friendlyStack, + ) { + var log = + _main.default._fesLogger && + typeof _main.default._fesLogger === "function" + ? _main.default._fesLogger + : console.log.bind(console); + if (friendlyStack.length > 1) { + var stacktraceMsg = ""; + friendlyStack.forEach(function (frame, idx) { + var location = "" + .concat(frame.fileName, ":") + .concat(frame.lineNumber, ":") + .concat(frame.columnNumber); + var frameMsg, + translationObj = { + func: frame.functionName, + line: frame.lineNumber, + location: location, + file: frame.fileName.split("/").slice(-1), + }; + if (idx === 0) { + frameMsg = (0, _internationalization.translator)( + "fes.globalErrors.stackTop", + translationObj, + ); + } else { + frameMsg = (0, _internationalization.translator)( + "fes.globalErrors.stackSubseq", + translationObj, + ); + } + stacktraceMsg += frameMsg; + }); + log(stacktraceMsg); + } + }; + /** + * Takes a stacktrace array and filters out all frames that show internal p5 + * details. + * + * Generates and prints a friendly error message using key: + * "fes.wrongPreload", "fes.libraryError". + * + * The processed stack is used to find whether the error happened internally + * within the library, and if the error was due to a non-loadX() method + * being used in preload. + * + * "Internally" here means that the exact location of the error (the top of + * the stack) is a piece of code written in the p5.js library (which may or + * may not have been called from the user's sketch). + * + * @method processStack + * @private + * @param {Error} error + * @param {Array} stacktrace + * + * @returns {Array} An array with two elements, [isInternal, friendlyStack] + * isInternal: a boolean value indicating whether the error + * happened internally + * friendlyStack: the filtered (simplified) stacktrace + */ + var processStack = function processStack(error, stacktrace) { + // cannot process a stacktrace that doesn't exist + if (!stacktrace) return [false, null]; + stacktrace.forEach(function (frame) { + frame.functionName = frame.functionName || ""; + }); + // isInternal - Did this error happen inside the library + var isInternal = false; + var p5FileName, friendlyStack, currentEntryPoint; + // Intentionally throw an error that we catch so that we can check the name + // of the current file. Any errors we see from this file, we treat as + // internal errors. + try { + throw new Error(); + } catch (testError) { + var testStacktrace = _main.default + ._getErrorStackParser() + .parse(testError); + p5FileName = testStacktrace[0].fileName; + } + for (var i = stacktrace.length - 1; i >= 0; i--) { + var splitted = stacktrace[i].functionName.split("."); + if (entryPoints.includes(splitted[splitted.length - 1])) { + // remove everything below an entry point function (setup, draw, etc). + // (it's usually the internal initialization calls) + friendlyStack = stacktrace.slice(0, i + 1); + currentEntryPoint = splitted[splitted.length - 1]; + // We call the error "internal" if the source of the error was a + // function from within the p5.js library file, but called from the + // user's code directly. We only need to check the topmost frame in + // the stack trace since any function internal to p5 should pass this + // check, not just public p5 functions. + if (stacktrace[0].fileName === p5FileName) { + isInternal = true; + break; + } + break; + } + } // in some cases ( errors in promises, callbacks, etc), no entry-point + // function may be found in the stacktrace. In that case just use the + // entire stacktrace for friendlyStack + + if (!friendlyStack) friendlyStack = stacktrace; + if (isInternal) { + // the frameIndex property is added before the filter, so frameIndex + // corresponds to the index of a frame in the original stacktrace. + // Then we filter out all frames which belong to the file that contains + // the p5 library + friendlyStack = friendlyStack + .map(function (frame, index) { + frame.frameIndex = index; + return frame; + }) + .filter(function (frame) { + return frame.fileName !== p5FileName; + }); + // a weird case, if for some reason we can't identify the function called + // from user's code + if (friendlyStack.length === 0) return [true, null]; + // get the function just above the topmost frame in the friendlyStack. + // i.e the name of the library function called from user's code + var func = stacktrace[ + friendlyStack[0].frameIndex - 1 + ].functionName + .split(".") + .slice(-1)[0]; + // Try and get the location (line no.) from the top element of the stack + var locationObj; + if ( + friendlyStack[0].fileName && + friendlyStack[0].lineNumber && + friendlyStack[0].columnNumber + ) { + locationObj = { + location: "" + .concat(friendlyStack[0].fileName, ":") + .concat(friendlyStack[0].lineNumber, ":") + .concat(friendlyStack[0].columnNumber), + file: friendlyStack[0].fileName.split("/").slice(-1), + line: friendlyStack[0].lineNumber, + }; + // if already handled by another part of the FES, don't handle again + if (_main.default._fesLogCache[locationObj.location]) + return [true, null]; + } // Check if the error is due to a non loadX method being used incorrectly + // in preload + + if ( + currentEntryPoint === "preload" && + _main.default.prototype._preloadMethods[func] == null + ) { + _main.default._friendlyError( + (0, _internationalization.translator)("fes.wrongPreload", { + func: func, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + error: error.message, + }), + "preload", + ); + } else { + // Library error + _main.default._friendlyError( + (0, _internationalization.translator)("fes.libraryError", { + func: func, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + error: error.message, + }), + func, + ); + } // Finally, if it's an internal error, print the friendlyStack + // ( fesErrorMonitor won't handle this error ) + + if (friendlyStack && friendlyStack.length) { + printFriendlyStack(friendlyStack); + } + } + return [isInternal, friendlyStack]; + }; + /** + * Handles "global" errors that the browser catches. + * + * Called when an error event happens and detects the type of error. + * + * Generates and prints a friendly error message using key: + * "fes.globalErrors.syntax.[*]", "fes.globalErrors.reference.[*]", + * "fes.globalErrors.type.[*]". + * + * @method fesErrorMonitor + * @private + * @param {*} e Event object to extract error details from + */ + var fesErrorMonitor = function fesErrorMonitor(e) { + if (_main.default.disableFriendlyErrors) return; + // Try to get the error object from e + var error; + if (e instanceof Error) { + error = e; + } else if (e instanceof ErrorEvent) { + error = e.error; + } else if (e instanceof PromiseRejectionEvent) { + error = e.reason; + if (!(error instanceof Error)) return; + } + if (!error) return; + var stacktrace = _main.default + ._getErrorStackParser() + .parse(error); + // process the stacktrace from the browser and simplify it to give + // friendlyStack. + var _processStack = processStack(error, stacktrace), + _processStack2 = _slicedToArray(_processStack, 2), + isInternal = _processStack2[0], + friendlyStack = _processStack2[1]; // if this is an internal library error, the type of the error is not relevant, + // only the user code that lead to it is. + if (isInternal) { + return; + } + var errList = errorTable[error.name]; + if (!errList) return; // this type of error can't be handled yet + var matchedError; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = errList[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var obj = _step.value; + var string = obj.msg; + // capture the primary symbol mentioned in the error + string = string.replace( + new RegExp("{{}}", "g"), + "([a-zA-Z0-9_]+)", + ); + string = string.replace(new RegExp("{{.}}", "g"), "(.+)"); + string = string.replace( + new RegExp("{}", "g"), + "(?:[a-zA-Z0-9_]+)", + ); + var matched = error.message.match(string); + if (matched) { + matchedError = Object.assign({}, obj); + matchedError.match = matched; + break; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (!matchedError) return; + // Try and get the location from the top element of the stack + var locationObj; + if ( + stacktrace && + stacktrace[0].fileName && + stacktrace[0].lineNumber && + stacktrace[0].columnNumber + ) { + locationObj = { + location: "" + .concat(stacktrace[0].fileName, ":") + .concat(stacktrace[0].lineNumber, ":") + .concat(stacktrace[0].columnNumber), + file: stacktrace[0].fileName.split("/").slice(-1), + line: friendlyStack[0].lineNumber, + }; + } + switch (error.name) { + case "SyntaxError": { + // We can't really do much with syntax errors other than try to use + // a simpler framing of the error message. The stack isn't available + // for syntax errors + switch (matchedError.type) { + case "INVALIDTOKEN": { + //Error if there is an invalid or unexpected token that doesn't belong at this position in the code + //let x = “not a string”; -> string not in proper quotes + var url = + "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character#What_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.syntax.invalidToken", + { + url: url, + }, + ), + ); + break; + } + case "UNEXPECTEDTOKEN": { + //Error if a specific language construct(, { ; etc) was expected, but something else was provided + //for (let i = 0; i < 5,; ++i) -> a comma after i<5 instead of a semicolon + var _url = + "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Unexpected_token#What_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.syntax.unexpectedToken", + { + url: _url, + }, + ), + ); + break; + } + case "REDECLAREDVARIABLE": { + //Error if a variable is redeclared by the user. Example=> + //let a = 10; + //let a = 100; + var errSym = matchedError.match[1]; + var _url2 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter#what_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.syntax.redeclaredVariable", + { + symbol: errSym, + url: _url2, + }, + ), + ); + break; + } + case "MISSINGINITIALIZER": { + //Error if a const variable is not initialized during declaration + //Example => const a; + var _url3 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const#what_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.syntax.missingInitializer", + { + url: _url3, + }, + ), + ); + break; + } + case "BADRETURNORYIELD": { + //Error when a return statement is misplaced(usually outside of a function) + // const a = function(){ + // ..... + // } + // return; -> misplaced return statement + var _url4 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return_or_yield#what_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.syntax.badReturnOrYield", + { + url: _url4, + }, + ), + ); + break; + } + } + break; + } + case "ReferenceError": { + switch (matchedError.type) { + case "NOTDEFINED": { + //Error if there is a non-existent variable referenced somewhere + //let a = 10; + //console.log(x); + var _errSym = matchedError.match[1]; + if (_errSym && handleMisspelling(_errSym, error)) { + break; + } // if the flow gets this far, this is likely not a misspelling + // of a p5 property/function + + var _url5 = + "https://p5js.org/examples/data-variable-scope.html"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.reference.notDefined", + { + url: _url5, + symbol: _errSym, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + }, + ), + ); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case "CANNOTACCESS": { + //Error if a lexical variable was accessed before it was initialized + //console.log(a); -> variable accessed before it was initialized + //let a=100; + var _errSym2 = matchedError.match[1]; + var _url6 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init#what_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.reference.cannotAccess", + { + url: _url6, + symbol: _errSym2, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + }, + ), + ); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + } + break; + } + case "TypeError": { + switch (matchedError.type) { + case "NOTFUNC": { + //Error when some code expects you to provide a function, but that didn't happen + //let a = document.getElementByID('foo'); -> getElementById instead of getElementByID + var _errSym3 = matchedError.match[1]; + var splitSym = _errSym3.split("."); + var _url7 = + "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_a_function#What_went_wrong"; + // if errSym is aa.bb.cc , symbol would be cc and obj would aa.bb + var translationObj = { + url: _url7, + symbol: splitSym[splitSym.length - 1], + obj: splitSym.slice(0, splitSym.length - 1).join("."), + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + }; + // There are two cases to handle here. When the function is called + // as a property of an object and when it's called independently. + // Both have different explanations. + if (splitSym.length > 1) { + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.type.notfuncObj", + translationObj, + ), + ); + } else { + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.type.notfunc", + translationObj, + ), + ); + } + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case "READNULL": { + //Error if a property of null is accessed + //let a = null; + //console.log(a.property); -> a is null + var _errSym4 = matchedError.match[1]; + var _url8 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong"; + /*let url2 = + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null';*/ + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.type.readFromNull", + { + url: _url8, + symbol: _errSym4, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + }, + ), + ); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case "READUDEFINED": { + //Error if a property of undefined is accessed + //let a; -> default value of a is undefined + //console.log(a.property); -> a is undefined + var _errSym5 = matchedError.match[1]; + var _url9 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong"; + /*let url2 = + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined#description';*/ + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.type.readFromUndefined", + { + url: _url9, + symbol: _errSym5, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + }, + ), + ); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case "CONSTASSIGN": { + //Error when a const variable is reassigned a value + //const a = 100; + //a=10; + var _url10 = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment#what_went_wrong"; + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.globalErrors.type.constAssign", + { + url: _url10, + location: locationObj + ? (0, _internationalization.translator)( + "fes.location", + locationObj, + ) + : "", + }, + ), + ); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + } + } + } + }; + _main.default._fesErrorMonitor = fesErrorMonitor; + _main.default._checkForUserDefinedFunctions = + checkForUserDefinedFunctions; + // logger for testing purposes. + _main.default._fesLogger = null; + _main.default._fesLogCache = {}; + window.addEventListener( + "load", + checkForUserDefinedFunctions, + false, + ); + window.addEventListener( + "error", + _main.default._fesErrorMonitor, + false, + ); + window.addEventListener( + "unhandledrejection", + _main.default._fesErrorMonitor, + false, + ); + /** + * Prints out all the colors in the color pallete with white text. + * For color blindness testing. + */ + /* function testColors() { + const str = 'A box of biscuits, a box of mixed biscuits and a biscuit mixer'; + p5._friendlyError(str, 'print', '#ED225D'); // p5.js magenta + p5._friendlyError(str, 'print', '#2D7BB6'); // p5.js blue + p5._friendlyError(str, 'print', '#EE9900'); // p5.js orange + p5._friendlyError(str, 'print', '#A67F59'); // p5.js light brown + p5._friendlyError(str, 'print', '#704F21'); // p5.js gold + p5._friendlyError(str, 'print', '#1CC581'); // auto cyan + p5._friendlyError(str, 'print', '#FF6625'); // auto orange + p5._friendlyError(str, 'print', '#79EB22'); // auto green + p5._friendlyError(str, 'print', '#B40033'); // p5.js darkened magenta + p5._friendlyError(str, 'print', '#084B7F'); // p5.js darkened blue + p5._friendlyError(str, 'print', '#945F00'); // p5.js darkened orange + p5._friendlyError(str, 'print', '#6B441D'); // p5.js darkened brown + p5._friendlyError(str, 'print', '#2E1B00'); // p5.js darkened gold + p5._friendlyError(str, 'print', '#008851'); // auto dark cyan + p5._friendlyError(str, 'print', '#C83C00'); // auto dark orange + p5._friendlyError(str, 'print', '#4DB200'); // auto dark green + } */ + } // This is a lazily-defined list of p5 symbols that may be + // misused by beginners at top-level code, outside of setup/draw. We'd like + // to detect these errors and help the user by suggesting they move them + // into setup/draw. + // + // For more details, see https://github.com/processing/p5.js/issues/1121. + + misusedAtTopLevelCode = null; + var FAQ_URL = + "https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"; + /** + * A helper function for populating misusedAtTopLevel list. + * + * @method defineMisusedAtTopLevelCode + * @private + */ + defineMisusedAtTopLevelCode = function defineMisusedAtTopLevelCode() { + var uniqueNamesFound = {}; + var getSymbols = function getSymbols(obj) { + return Object.getOwnPropertyNames(obj) + .filter(function (name) { + if (name[0] === "_") { + return false; + } + if (name in uniqueNamesFound) { + return false; + } + uniqueNamesFound[name] = true; + return true; + }) + .map(function (name) { + var type; + if (typeof obj[name] === "function") { + type = "function"; + } else if (name === name.toUpperCase()) { + type = "constant"; + } else { + type = "variable"; + } + return { + name: name, + type: type, + }; + }); + }; + misusedAtTopLevelCode = [].concat( + getSymbols(_main.default.prototype), // At present, p5 only adds its constants to p5.prototype during + // construction, which may not have happened at the time a + // ReferenceError is thrown, so we'll manually add them to our list. + getSymbols(_dereq_("../constants")), + ); + // This will ultimately ensure that we report the most specific error + // possible to the user, e.g. advising them about HALF_PI instead of PI + // when their code misuses the former. + misusedAtTopLevelCode.sort(function (a, b) { + return b.name.length - a.name.length; + }); + }; + /** + * Detects browser level error event for p5 constants/functions used outside + * of setup() and draw(). + * + * Generates and prints a friendly error message using key: + * "fes.misusedTopLevel". + * + * @method helpForMisusedAtTopLevelCode + * @private + * @param {Event} e Error event + * @param {Boolean} log false + * + * @returns {Boolean} true + */ + var helpForMisusedAtTopLevelCode = + function helpForMisusedAtTopLevelCode(e, log) { + if (!log) { + log = console.log.bind(console); + } + if (!misusedAtTopLevelCode) { + defineMisusedAtTopLevelCode(); + } // If we find that we're logging lots of false positives, we can + // uncomment the following code to avoid displaying anything if the + // user's code isn't likely to be using p5's global mode. (Note that + // setup/draw are more likely to be defined due to JS function hoisting.) + // + //if (!('setup' in window || 'draw' in window)) { + // return; + //} + + misusedAtTopLevelCode.some(function (symbol) { + // Note that while just checking for the occurrence of the + // symbol name in the error message could result in false positives, + // a more rigorous test is difficult because different browsers + // log different messages, and the format of those messages may + // change over time. + // + // For example, if the user uses 'PI' in their code, it may result + // in any one of the following messages: + // + // * 'PI' is undefined (Microsoft Edge) + // * ReferenceError: PI is undefined (Firefox) + // * Uncaught ReferenceError: PI is not defined (Chrome) + if ( + e.message && + e.message.match("\\W?".concat(symbol.name, "\\W")) !== null + ) { + var symbolName = + symbol.type === "function" + ? "".concat(symbol.name, "()") + : symbol.name; + if (typeof IS_MINIFIED !== "undefined") { + log( + "Did you just try to use p5.js's " + .concat(symbolName, " ") + .concat( + symbol.type, + "? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ", + ) + .concat(FAQ_URL), + ); + } else { + log( + (0, _internationalization.translator)( + "fes.misusedTopLevel", + { + symbolName: symbolName, + symbolType: symbol.type, + url: FAQ_URL, + }, + ), + ); + } + return true; + } + }); + }; + // Exposing this primarily for unit testing. + _main.default.prototype._helpForMisusedAtTopLevelCode = + helpForMisusedAtTopLevelCode; + if (document.readyState !== "complete") { + window.addEventListener( + "error", + helpForMisusedAtTopLevelCode, + false, + ); + // Our job is only to catch ReferenceErrors that are thrown when + // global (non-instance mode) p5 APIs are used at the top-level + // scope of a file, so we'll unbind our error listener now to make + // sure we don't log false positives later. + window.addEventListener("load", function () { + window.removeEventListener( + "error", + helpForMisusedAtTopLevelCode, + false, + ); + }); + } + var _default = _main.default; + exports.default = _default; + }, + { + "../constants": 286, + "../internationalization": 296, + "../main": 298, + "./browser_errors": 288, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.some": 184, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.object.assign": 194, + "core-js/modules/es.object.get-own-property-names": 197, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.constructor": 204, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.match": 211, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.starts-with": 217, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 290: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var _internationalization = _dereq_("../internationalization"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @for p5 + * @requires core + */ + + if (typeof IS_MINIFIED !== "undefined") { + _main.default._friendlyFileLoadError = function () {}; + } else { + // mapping used by `_friendlyFileLoadError` + var fileLoadErrorCases = function fileLoadErrorCases( + num, + filePath, + ) { + var suggestion = (0, _internationalization.translator)( + "fes.fileLoadError.suggestion", + { + filePath: filePath, + url: "https://github.com/processing/p5.js/wiki/Local-server", + }, + ); + switch (num) { + case 0: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.image", + { + suggestion: suggestion, + }, + ), + method: "loadImage", + }; + case 1: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.xml", + { + suggestion: suggestion, + }, + ), + method: "loadXML", + }; + case 2: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.table", + { + suggestion: suggestion, + }, + ), + method: "loadTable", + }; + case 3: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.strings", + { + suggestion: suggestion, + }, + ), + method: "loadStrings", + }; + case 4: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.font", + { + suggestion: suggestion, + }, + ), + method: "loadFont", + }; + case 5: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.json", + { + suggestion: suggestion, + }, + ), + method: "loadJSON", + }; + case 6: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.bytes", + { + suggestion: suggestion, + }, + ), + method: "loadBytes", + }; + case 7: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.large", + ), + method: "loadX", + }; + case 8: + return { + message: (0, _internationalization.translator)( + "fes.fileLoadError.gif", + ), + method: "loadImage", + }; + } + }; + /** + * Called internally if there is an error during file loading. + * + * Generates and prints a friendly error message using key: + * "fes.fileLoadError.[*]". + * + * @method _friendlyFileLoadError + * @private + * @param {Number} errorType Number of file load error type + * @param {String} filePath Path to file caused the error + */ + _main.default._friendlyFileLoadError = function ( + errorType, + filePath, + ) { + var _fileLoadErrorCases = fileLoadErrorCases(errorType, filePath), + message = _fileLoadErrorCases.message, + method = _fileLoadErrorCases.method; + _main.default._friendlyError(message, method, 3); + }; + } + var _default = _main.default; + exports.default = _default; + }, + { + "../internationalization": 296, + "../main": 298, + }, + ], + 291: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var _internationalization = _dereq_("../internationalization"); + var constants = _interopRequireWildcard(_dereq_("../constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @for p5 + * @requires core + */ + /** + * Checks if any p5.js constant/function is declared outside of setup() + * and draw() function. Also checks any reserved constant/function is + * redeclared. + * + * Generates and prints a friendly error message using key: + * "fes.sketchReaderErrors.reservedConst", + * "fes.sketchReaderErrors.reservedFunc". + * + * @method _fesCodeReader + * @private + */ + + if (typeof IS_MINIFIED !== "undefined") { + _main.default._fesCodeReader = function () {}; + } else { + //list of functions to ignore as they either + //are ment to be defined or generate false positive + //outputs + var ignoreFunction = [ + "setup", + "draw", + "preload", + "deviceMoved", + "deviceTurned", + "deviceShaken", + "doubleClicked", + "mousePressed", + "mouseReleased", + "mouseMoved", + "mouseDragged", + "mouseClicked", + "mouseWheel", + "touchStarted", + "touchMoved", + "touchEnded", + "keyPressed", + "keyReleased", + "keyTyped", + "windowResized", + "name", + "parent", + "toString", + "print", + "stop", + "onended", + ]; + /** + * Takes a list of variables defined by the user in the code + * as an array and checks if the list contains p5.js constants and functions. + * + * @method checkForConstsAndFuncs + * @private + * @param {Array} variableArray + */ + var checkForConstsAndFuncs = function checkForConstsAndFuncs( + variableArray, + ) { + for (var i = 0; i < variableArray.length; i++) { + //if the element in variableArray is a p5.js constant then the below condidion + //will be true, hence a match is found + if (constants[variableArray[i]] !== undefined) { + var url = "https://p5js.org/reference/#/p5/".concat( + variableArray[i], + ); + //display the FES message if a match is found + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.sketchReaderErrors.reservedConst", + { + url: url, + symbol: variableArray[i], + }, + ), + ); + return; + //if match found then end search + } + } + var p5Constructors = {}; + for ( + var _i = 0, _Object$keys = Object.keys(_main.default); + _i < _Object$keys.length; + _i++ + ) { + var key = _Object$keys[_i]; + // Get a list of all constructors in p5. They are functions whose names + // start with a capital letter + if ( + typeof _main.default[key] === "function" && + key[0] !== key[0].toLowerCase() + ) { + p5Constructors[key] = _main.default[key]; + } + } + for (var _i2 = 0; _i2 < variableArray.length; _i2++) { + //ignoreFunction contains the list of functions to be ignored + if (!ignoreFunction.includes(variableArray[_i2])) { + var keyArray = Object.keys(p5Constructors); + var j = 0; + //for every function name obtained check if it matches any p5.js function name + for (; j < keyArray.length; j++) { + if ( + p5Constructors[keyArray[j]].prototype[ + variableArray[_i2] + ] !== undefined + ) { + //if a p5.js function is used ie it is in the funcs array + var _url = "https://p5js.org/reference/#/p5/".concat( + variableArray[_i2], + ); + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.sketchReaderErrors.reservedFunc", + { + url: _url, + symbol: variableArray[_i2], + }, + ), + ); + return; + } + } + } + } + }; + //these regex are used to perform variable extraction + //visit https://regexr.com/ for the detailed view + var optionalVarKeyword = /(?:(?:let|const|var)\s+)?/; + // Bracketed expressions start with an opening bracket, some amount of non + // bracket characters, then a closing bracket. Note that this won't properly + // parse nested brackets: `constrain(millis(), 0, 1000)` will match + // `constrain(millis()` only, but will still fail gracefully and not try to + // mistakenly read any subsequent code as assignment expressions. + var roundBracketedExpr = /(?:\([^)]*\))/; + var squareBracketedExpr = /(?:\[[^\]]*\])/; + var curlyBracketedExpr = /(?:\{[^}]*\})/; + var bracketedExpr = new RegExp( + [roundBracketedExpr, squareBracketedExpr, curlyBracketedExpr] + .map(function (regex) { + return regex.source; + }) + .join("|"), + ); + // In an a = b expression, `b` can be any character up to a newline or comma, + // unless the comma is inside of a bracketed expression of some kind (to make + // sure we parse function calls with multiple arguments properly.) + var rightHandSide = new RegExp( + "(?:" + bracketedExpr.source + "|[^\\n,])+", + ); + var leftHandSide = /([\w$]+)/; + var assignmentOperator = /\s*=\s*/; + var singleAssignment = new RegExp( + leftHandSide.source + + assignmentOperator.source + + rightHandSide.source, + ); + var listSeparator = /,\s*/; + var oneOrMoreAssignments = new RegExp( + "(?:" + + singleAssignment.source + + listSeparator.source + + ")*" + + singleAssignment.source, + ); + var assignmentStatement = new RegExp( + "^" + optionalVarKeyword.source + oneOrMoreAssignments.source, + ); + var letConstName = /(?:(?:let|const)\s+)([\w$]+)/; + /** + * Takes an array in which each element is a line of code + * containing a variable definition(Eg: arr=['let x = 100', 'const y = 200']) + * and extracts the variables defined. + * + * @method extractVariables + * @private + * @param {Array} linesArray array of lines of code + */ + var extractVariables = function extractVariables(linesArray) { + //extract variable names from the user's code + var matches = []; + linesArray.forEach(function (ele) { + // Match 0 is the part of the line of code that the regex looked at. + // Matches 1 and onward will be only the variable names on the left hand + // side of assignment expressions. + var match = ele.match(assignmentStatement); + if (!match) return; + matches.push.apply( + matches, + _toConsumableArray( + match.slice(1).filter(function (group) { + return group !== undefined; + }), + ), + ); + }); + //check if the obtained variables are a part of p5.js or not + checkForConstsAndFuncs(matches); + }; + /** + * Takes an array in which each element is a line of code + * containing a function definition(array=['let x = () => {...}']) + * and extracts the functions defined. + * + * @method extractFuncVariables + * @private + * @param {Array} linesArray array of lines of code + */ + var extractFuncVariables = function extractFuncVariables( + linesArray, + ) { + var matches = []; + //RegExp to extract function names from let/const x = function()... + //visit https://regexr.com/ for the detailed view. + linesArray.forEach(function (ele) { + var m = ele.match(letConstName); + if (m !== null) matches.push(ele.match(letConstName)[1]); + }); + //matches array contains the names of the functions + checkForConstsAndFuncs(matches); + }; + /** + * Converts code written by the user to an array + * every element of which is a seperate line of code. + * + * @method codeToLines + * @private + * @param {String} code code written by the user + */ + var codeToLines = function codeToLines(code) { + //convert code to array of code and filter out + //unnecessary lines + var arrayVariables = code + .split("\n") + .map(function (line) { + return line.trim(); + }) + .filter( + function (line) { + return ( + line !== "" && + !line.includes("//") && + (line.includes("let") || line.includes("const")) && + !line.includes("=>") && + !line.includes("function") + ); + }, //filter out lines containing variable names + ); + //filter out lines containing function names + var arrayFunctions = code + .split("\n") + .map(function (line) { + return line.trim(); + }) + .filter(function (line) { + return ( + line !== "" && + !line.includes("//") && + (line.includes("let") || line.includes("const")) && + (line.includes("=>") || line.includes("function")) + ); + }); + //pass the relevant array to a function which will extract all the variables/functions names + extractVariables(arrayVariables); + extractFuncVariables(arrayFunctions); + }; + /** + * Remove multiline comments and the content inside it. + * + * @method removeMultilineComments + * @private + * @param {String} code code written by the user + * @returns {String} + */ + var removeMultilineComments = function removeMultilineComments( + code, + ) { + var start = code.indexOf("/*"); + var end = code.indexOf("*/"); + //create a new string which don't have multiline comments + while (start !== -1 && end !== -1) { + if (start === 0) { + code = code.slice(end + 2); + } else code = code.slice(0, start) + code.slice(end + 2); + start = code.indexOf("/*"); + end = code.indexOf("*/"); + } + return code; + }; + /** + * Checks if any p5.js constant or function is declared outside a function + * and reports it if found. + * + * @method globalConstFuncCheck + * @private + * @returns {Boolean} + */ + var globalConstFuncCheck = function globalConstFuncCheck() { + // generate all the const key data as an array + var tempArray = Object.keys(constants); + var element; + for (var i = 0; i < tempArray.length; i++) { + try { + //if the user has not declared p5.js constant anywhere outside the + //setup or draw function then this will throw an + //error. + element = eval(tempArray[i]); + } catch (e) { + //We are catching the error due to the above mentioned + //reason. Since there is no declaration of constant everything + //is OK so we will skip the current iteration and check for the + //next element. + continue; + } //if we are not getting an error this means + //user have changed the value. We will check + //if the value is changed and if it is changed + //then report. + + if (constants[tempArray[i]] !== element) { + var url = "https://p5js.org/reference/#/p5/".concat( + tempArray[i], + ); + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.sketchReaderErrors.reservedConst", + { + url: url, + symbol: tempArray[i], + }, + ), + ); + //if a p5.js constant is already reported then no need to check + //for p5.js functions. + return true; + } + } //the below code gets a list of p5.js functions + + var p5Constructors = {}; + for ( + var _i3 = 0, _Object$keys2 = Object.keys(_main.default); + _i3 < _Object$keys2.length; + _i3++ + ) { + var key = _Object$keys2[_i3]; + // Get a list of all constructors in p5. They are functions whose names + // start with a capital letter + if ( + typeof _main.default[key] === "function" && + key[0] !== key[0].toLowerCase() + ) { + p5Constructors[key] = _main.default[key]; + } + } + var keyArray = Object.keys(p5Constructors); + var classesWithGlobalFns = [ + "Renderer", + "Renderer2D", + "RendererGL", + ]; + var functionArray = []; + //get the names of all p5.js functions which are available globally + for (var _i4 = 0; _i4 < classesWithGlobalFns.length; _i4++) { + functionArray.push.apply( + functionArray, + _toConsumableArray( + Object.keys( + p5Constructors[classesWithGlobalFns[_i4]].prototype, + ), + ), + ); + } //we have p5.js function names with us so we will check + //if they have been declared or not. + + for (var _i5 = 0; _i5 < functionArray.length; _i5++) { + //ignoreFunction contains the list of functions to be ignored + if (!ignoreFunction.includes(functionArray[_i5])) { + try { + //if we get an error that means the function is not declared + element = eval(functionArray[_i5]); + } catch (e) { + //we will skip the iteration + continue; + } //if we are not getting an error this means + //user have used p5.js function. Check if it is + //changed and if so then report it. + + for (var k = 0; k < keyArray.length; k++) { + if ( + p5Constructors[keyArray[k]].prototype[ + functionArray[_i5] + ] === undefined + ); + else { + if ( + p5Constructors[keyArray[k]].prototype[ + functionArray[_i5] + ] !== element + ) { + var _url2 = "https://p5js.org/reference/#/p5/".concat( + functionArray[_i5], + ); + _main.default._friendlyError( + (0, _internationalization.translator)( + "fes.sketchReaderErrors.reservedFunc", + { + url: _url2, + symbol: functionArray[_i5], + }, + ), + ); + return true; + } + } + } + } + } + }; + /** + * Initiates the sketch_reader's processes. + * Obtains the code in setup and draw function + * and forwards it for further processing and evaluation. + * + * @method fesCodeReader + * @private + */ + var fesCodeReader = function fesCodeReader() { + //moveAhead will determine if a match is found outside + //the setup and draw function. If a match is found then + //to prevent further potential reporting we will exit immidiately + var moveAhead = globalConstFuncCheck(); + if (moveAhead) return; + var code = ""; + try { + //get code from setup + code += "" + setup; + } catch (e) { + code += ""; + } + try { + //get code from draw + code += "\n" + draw; + } catch (e) { + code += ""; + } + if (code === "") return; + code = removeMultilineComments(code); + codeToLines(code); + }; + _main.default._fesCodeReader = fesCodeReader; + window.addEventListener("load", _main.default._fesCodeReader); + } + var _default = _main.default; + exports.default = _default; + }, + { + "../constants": 286, + "../internationalization": 296, + "../main": 298, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.constructor": 204, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.match": 211, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.trim": 219, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 292: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @for p5 + * @requires core + */ + // Borrow from stacktracejs https://github.com/stacktracejs/stacktrace.js with + // minor modifications. The license for the same and the code is included below + // Copyright (c) 2017 Eric Wendelin and other contributors + // 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. + + function ErrorStackParser() { + var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; + var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; + var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; + return { + /** + * Given an Error object, extract the most information from it. + * @private + * @param {Error} error object + * @return {Array} of stack frames + */ + parse: function ErrorStackParser$$parse(error) { + if ( + typeof error.stacktrace !== "undefined" || + typeof error["opera#sourceloc"] !== "undefined" + ) { + return this.parseOpera(error); + } else if ( + error.stack && + error.stack.match(CHROME_IE_STACK_REGEXP) + ) { + return this.parseV8OrIE(error); + } else if (error.stack) { + return this.parseFFOrSafari(error); + } else { + // throw new Error('Cannot parse given Error object'); + } + }, + // Separate line and column numbers from a string of the form: (URI:Line:Column) + extractLocation: function ErrorStackParser$$extractLocation( + urlLike, + ) { + // Fail-fast but return locations like "(native)" + if (urlLike.indexOf(":") === -1) { + return [urlLike]; + } + var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; + var parts = regExp.exec(urlLike.replace(/[()]/g, "")); + return [parts[1], parts[2] || undefined, parts[3] || undefined]; + }, + parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { + var filtered = error.stack.split("\n").filter(function (line) { + return !!line.match(CHROME_IE_STACK_REGEXP); + }, this); + return filtered.map(function (line) { + if (line.indexOf("(eval ") > -1) { + // Throw away eval information until we implement stacktrace.js/stackframe#8 + line = line + .replace(/eval code/g, "eval") + .replace(/(\(eval at [^()]*)|(\),.*$)/g, ""); + } + var sanitizedLine = line + .replace(/^\s+/, "") + .replace(/\(eval code/g, "("); + // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in + // case it has spaces in it, as the string is split on \s+ later on + var location = sanitizedLine.match( + / (\((.+):(\d+):(\d+)\)$)/, + ); + // remove the parenthesized location from the line, if it was matched + sanitizedLine = location + ? sanitizedLine.replace(location[0], "") + : sanitizedLine; + var tokens = sanitizedLine.split(/\s+/).slice(1); + // if a location was matched, pass it to extractLocation() otherwise pop the last token + var locationParts = this.extractLocation( + location ? location[1] : tokens.pop(), + ); + var functionName = tokens.join(" ") || undefined; + var fileName = + ["eval", ""].indexOf(locationParts[0]) > -1 + ? undefined + : locationParts[0]; + return { + functionName: functionName, + fileName: fileName, + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line, + }; + }, this); + }, + parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari( + error, + ) { + var filtered = error.stack.split("\n").filter(function (line) { + return !line.match(SAFARI_NATIVE_CODE_REGEXP); + }, this); + return filtered.map(function (line) { + // Throw away eval information until we implement stacktrace.js/stackframe#8 + if (line.indexOf(" > eval") > -1) { + line = line.replace( + / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, + ":$1", + ); + } + if (line.indexOf("@") === -1 && line.indexOf(":") === -1) { + // Safari eval frames only have function names and nothing else + return { + functionName: line, + }; + } else { + var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; + var matches = line.match(functionNameRegex); + var functionName = + matches && matches[1] ? matches[1] : undefined; + var locationParts = this.extractLocation( + line.replace(functionNameRegex, ""), + ); + return { + functionName: functionName, + fileName: locationParts[0], + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line, + }; + } + }, this); + }, + parseOpera: function ErrorStackParser$$parseOpera(e) { + if ( + !e.stacktrace || + (e.message.indexOf("\n") > -1 && + e.message.split("\n").length > + e.stacktrace.split("\n").length) + ) { + return this.parseOpera9(e); + } else if (!e.stack) { + return this.parseOpera10(e); + } else { + return this.parseOpera11(e); + } + }, + parseOpera9: function ErrorStackParser$$parseOpera9(e) { + var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; + var lines = e.message.split("\n"); + var result = []; + for (var i = 2, len = lines.length; i < len; i += 2) { + var match = lineRE.exec(lines[i]); + if (match) { + result.push({ + fileName: match[2], + lineNumber: match[1], + source: lines[i], + }); + } + } + return result; + }, + parseOpera10: function ErrorStackParser$$parseOpera10(e) { + var lineRE = + /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; + var lines = e.stacktrace.split("\n"); + var result = []; + for (var i = 0, len = lines.length; i < len; i += 2) { + var match = lineRE.exec(lines[i]); + if (match) { + result.push({ + functionName: match[3] || undefined, + fileName: match[2], + lineNumber: match[1], + source: lines[i], + }); + } + } + return result; + }, + // Opera 10.65+ Error.stack very similar to FF/Safari + parseOpera11: function ErrorStackParser$$parseOpera11(error) { + var filtered = error.stack.split("\n").filter(function (line) { + return ( + !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && + !line.match(/^Error created at/) + ); + }, this); + return filtered.map(function (line) { + var tokens = line.split("@"); + var locationParts = this.extractLocation(tokens.pop()); + var functionCall = tokens.shift() || ""; + var functionName = + functionCall + .replace(//, "$2") + .replace(/\([^)]*\)/g, "") || undefined; + var argsRaw; + if (functionCall.match(/\(([^)]*)\)/)) { + argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, "$1"); + } + var args = + argsRaw === undefined || + argsRaw === "[arguments not available]" + ? undefined + : argsRaw.split(","); + return { + functionName: functionName, + args: args, + fileName: locationParts[0], + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line, + }; + }, this); + }, + }; + } // End borrow + // wrapper exposing ErrorStackParser + + _main.default._getErrorStackParser = function getErrorStackParser() { + return new ErrorStackParser(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../main": 298, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.match": 211, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + }, + ], + 293: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.last-index-of"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.last-index-of"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var constants = _interopRequireWildcard(_dereq_("../constants")); + var _internationalization = _dereq_("../internationalization"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct( + Class, + arguments, + _getPrototypeOf(this).constructor, + ); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true, + }, + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); + } + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @for p5 + * @requires core + */ + + if (typeof IS_MINIFIED !== "undefined") { + _main.default._validateParameters = + _main.default._clearValidateParamsCache = function () {}; + } else { + // for parameter validation + var dataDoc = _dereq_("../../../docs/parameterData.json"); + var arrDoc = JSON.parse(JSON.stringify(dataDoc)); + var docCache = {}; + var builtinTypes = new Set([ + "null", + "number", + "string", + "boolean", + "constant", + "function", + "any", + "integer", + ]); + var basicTypes = { + number: true, + boolean: true, + string: true, + function: true, + undefined: true, + }; + // reverse map of all constants + var constantsReverseMap = {}; + for (var key in constants) { + constantsReverseMap[constants[key]] = key; + } // mapping names of p5 types to their constructor function + // p5Constructors: + // - Color: f() + // - Graphics: f() + // - Vector: f() + // and so on + + var p5Constructors = {}; + // For speedup over many runs. funcSpecificConstructors[func] only has the + // constructors for types which were seen earlier as args of "func" + var funcSpecificConstructors = {}; + window.addEventListener("load", function () { + // Make a list of all p5 classes to be used for argument validation + // This must be done only when everything has loaded otherwise we get + // an empty array + for ( + var _i = 0, _Object$keys = Object.keys(_main.default); + _i < _Object$keys.length; + _i++ + ) { + var _key = _Object$keys[_i]; + // Get a list of all constructors in p5. They are functions whose names + // start with a capital letter + if ( + typeof _main.default[_key] === "function" && + _key[0] !== _key[0].toLowerCase() + ) { + p5Constructors[_key] = _main.default[_key]; + } + } + }); + var argumentTree = {}; + // The following two functions are responsible for querying and inserting + // into the argument tree. It stores the types of arguments that each + // function has seen so far. It is used to query if a sequence of + // arguments seen in validate parameters was seen before. + // Lets consider that the following segment of code runs repeatedly, perhaps + // in a loop or in draw() + // color(10, 10, 10); + // color(10, 10); + // color('r', 'g', 'b'); + // After the first of run the code segment, the argument tree looks like + // - color + // - number + // - number + // - number + // - seen: true + // - seen: true + // - string + // - string + // - string + // - seen: true + // seen: true signifies that this argument was also seen as the last + // argument in a call. Now in the second run of the sketch, it would traverse + // the existing tree and see seen: true, i.e this sequence was seen + // before and so scoring can be skipped. This also prevents logging multiple + // validation messages for the same thing. + /** + * Query type and return the result as an object + * + * This would be called repeatedly over and over again, + * so it needs to be as optimized for performance as possible + * @method addType + * @private + */ + var addType = function addType(value, obj, func) { + var type = _typeof(value); + if (basicTypes[type]) { + if (constantsReverseMap[value]) { + // check if the value is a p5 constant and if it is, we would want the + // value itself to be stored in the tree instead of the type + obj = obj[value] || (obj[value] = {}); + } else { + obj = obj[type] || (obj[type] = {}); + } + } else if (value === null) { + // typeof null -> "object". don't want that + obj = obj["null"] || (obj["null"] = {}); + } else { + // objects which are instances of p5 classes have nameless constructors. + // native objects have a constructor named "Object". This check + // differentiates between the two so that we dont waste time finding the + // p5 class if we just have a native object + if (value.constructor && value.constructor.name) { + obj = + obj[value.constructor.name] || + (obj[value.constructor.name] = {}); + return obj; + } // constructors for types defined in p5 do not have a name property. + // e.constructor.name gives "". Code in this segment is a workaround for it + // p5C will only have the name: constructor mapping for types + // which were already seen as args of "func" + + var p5C = funcSpecificConstructors[func]; + // p5C would contain much fewer items than p5Constructors. if we find our + // answer in p5C, we don't have to scan through p5Constructors + if (p5C === undefined) { + // if there isn't an entry yet for func + // make an entry of empty object + p5C = funcSpecificConstructors[func] = {}; + } + for (var _key2 in p5C) { + // search on the constructors we have already seen (smaller search space) + if (value instanceof p5C[_key2]) { + obj = obj[_key2] || (obj[_key2] = {}); + return obj; + } + } + for (var _key3 in p5Constructors) { + // if the above search didn't work, search on all p5 constructors + if (value instanceof p5Constructors[_key3]) { + obj = obj[_key3] || (obj[_key3] = {}); + // if found, add to known constructors for this function + p5C[_key3] = p5Constructors[_key3]; + return obj; + } + } // nothing worked, put the type as it is + + obj = obj[type] || (obj[type] = {}); + } + return obj; + }; + /** + * Build the argument type tree, argumentTree + * + * This would be called repeatedly over and over again, + * so it needs to be as optimized for performance as possible + * @method buildArgTypeCache + * @private + */ + var buildArgTypeCache = function buildArgTypeCache(func, arr) { + // get the if an argument tree for current function already exists + var obj = argumentTree[func]; + if (obj === undefined) { + // if it doesn't, create an empty tree + obj = argumentTree[func] = {}; + } + for (var i = 0, len = arr.length; i < len; ++i) { + var value = arr[i]; + if (value instanceof Array) { + // an array is passed as an argument, expand it and get the type of + // each of its element. We distinguish the start of an array with 'as' + // or arraystart. This would help distinguish between the arguments + // (number, number, number) and (number, [number, number]) + obj = obj["as"] || (obj["as"] = {}); + for (var j = 0, lenA = value.length; j < lenA; ++j) { + obj = addType(value[j], obj, func); + } + } else { + obj = addType(value, obj, func); + } + } + return obj; + }; + /** + * Query data.json + * This is a helper function for validateParameters() + * @method lookupParamDoc + * @private + */ + var lookupParamDoc = function lookupParamDoc(func) { + // look for the docs in the `data.json` datastructure + var ichDot = func.lastIndexOf("."); + var funcName = func.slice(ichDot + 1); + var funcClass = func.slice(0, ichDot !== -1 ? ichDot : 0) || "p5"; + var classitems = arrDoc; + var queryResult = classitems[funcClass][funcName]; + // different JSON structure for funct with multi-format + var overloads = []; + if (queryResult.hasOwnProperty("overloads")) { + // add all the overloads + for (var i = 0; i < queryResult.overloads.length; i++) { + overloads.push({ + formats: queryResult.overloads[i].params, + }); + } + } else { + // no overloads, just add the main method definition + overloads.push({ + formats: queryResult.params || [], + }); + } // parse the parameter types for each overload + + var mapConstants = {}; + var maxParams = 0; + overloads.forEach(function (overload) { + var formats = overload.formats; + // keep a record of the maximum number of arguments + // this method requires. + if (maxParams < formats.length) { + maxParams = formats.length; + } // calculate the minimum number of arguments + // this overload requires. + + var minParams = formats.length; + while (minParams > 0 && formats[minParams - 1].optional) { + minParams--; + } + overload.minParams = minParams; + // loop through each parameter position, and parse its types + formats.forEach(function (format) { + // split this parameter's types + format.types = format.type.split("|").map(function ct(type) { + // array + if (type.slice(-2) === "[]") { + return { + name: type, + array: ct(type.slice(0, -2)), + }; + } + var lowerType = type.toLowerCase(); + // constant + if (lowerType === "constant") { + var constant; + if (mapConstants.hasOwnProperty(format.name)) { + constant = mapConstants[format.name]; + } else { + // parse possible constant values from description + var myRe = + /either\s+(?:[A-Z0-9_]+\s*,?\s*(?:or)?\s*)+/g; + var values = {}; + var names = []; + constant = mapConstants[format.name] = { + values: values, + names: names, + }; + var myArray = myRe.exec(format.description); + if (func === "endShape" && format.name === "mode") { + values[constants.CLOSE] = true; + names.push("CLOSE"); + } else { + var match = myArray[0]; + var reConst = /[A-Z0-9_]+/g; + var matchConst; + while ((matchConst = reConst.exec(match)) !== null) { + var name = matchConst[0]; + if (constants.hasOwnProperty(name)) { + values[constants[name]] = true; + names.push(name); + } + } + } + } + return { + name: type, + builtin: lowerType, + names: constant.names, + values: constant.values, + }; + } // function + + if (lowerType.slice(0, "function".length) === "function") { + lowerType = "function"; + } // builtin + + if (builtinTypes.has(lowerType)) { + return { + name: type, + builtin: lowerType, + }; + } // find type's prototype + + var t = window; + var typeParts = type.split("."); + // special-case 'p5' since it may be non-global + if (typeParts[0] === "p5") { + t = _main.default; + typeParts.shift(); + } + typeParts.forEach(function (p) { + t = t && t[p]; + }); + if (t) { + return { + name: type, + prototype: t, + }; + } + return { + name: type, + type: lowerType, + }; + }); + }); + }); + return { + overloads: overloads, + maxParams: maxParams, + }; + }; + /** + * Checks whether input type is Number + * This is a helper function for validateParameters() + * @method isNumber + * @private + * + * @returns {Boolean} a boolean indicating whether input type is Number + */ + var isNumber = function isNumber(param) { + if (isNaN(parseFloat(param))) return false; + switch (_typeof(param)) { + case "number": + return true; + case "string": + return !isNaN(param); + default: + return false; + } + }; + /** + * Test type for non-object type parameter validation + * @method testParamType + * @private + */ + var testParamType = function testParamType(param, type) { + var isArray = param instanceof Array; + var matches = true; + if (type.array && isArray) { + for (var i = 0; i < param.length; i++) { + var error = testParamType(param[i], type.array); + if (error) return error / 2; // half error for elements + } + } else if (type.prototype) { + matches = param instanceof type.prototype; + } else if (type.builtin) { + switch (type.builtin) { + case "number": + matches = isNumber(param); + break; + case "integer": + matches = + isNumber(param) && Number(param) === Math.floor(param); + break; + case "boolean": + case "any": + matches = true; + break; + case "array": + matches = isArray; + break; + case "string": + matches = + /*typeof param === 'number' ||*/ typeof param === + "string"; + break; + case "constant": + matches = type.values.hasOwnProperty(param); + break; + case "function": + matches = param instanceof Function; + break; + case "null": + matches = param === null; + break; + } + } else { + matches = _typeof(param) === type.t; + } + return matches ? 0 : 1; + }; + /** + * Test type for multiple parameters + * @method testParamTypes + * @private + */ + var testParamTypes = function testParamTypes(param, types) { + var minScore = 9999; + for (var i = 0; minScore > 0 && i < types.length; i++) { + var score = testParamType(param, types[i]); + if (minScore > score) minScore = score; + } + return minScore; + }; + /** + * generate a score (higher is worse) for applying these args to + * this overload. + * @method scoreOverload + * @private + */ + var scoreOverload = function scoreOverload( + args, + argCount, + overload, + minScore, + ) { + var score = 0; + var formats = overload.formats; + var minParams = overload.minParams; + // check for too few/many args + // the score is double number of extra/missing args + if (argCount < minParams) { + score = (minParams - argCount) * 2; + } else if (argCount > formats.length) { + score = (argCount - formats.length) * 2; + } // loop through the formats, adding up the error score for each arg. + // quit early if the score gets higher than the previous best overload. + + for (var p = 0; score <= minScore && p < formats.length; p++) { + var arg = args[p]; + var format = formats[p]; + // '== null' checks for 'null' and typeof 'undefined' + if (arg == null) { + // handle undefined args + if (!format.optional || p < minParams || p < argCount) { + score += 1; + } + } else { + score += testParamTypes(arg, format.types); + } + } + return score; + }; + /** + * Gets a list of errors for this overload + * @method getOverloadErrors + * @private + */ + var getOverloadErrors = function getOverloadErrors( + args, + argCount, + overload, + ) { + var formats = overload.formats; + var minParams = overload.minParams; + // check for too few/many args + if (argCount < minParams) { + return [ + { + type: "TOO_FEW_ARGUMENTS", + argCount: argCount, + minParams: minParams, + }, + ]; + } else if (argCount > formats.length) { + return [ + { + type: "TOO_MANY_ARGUMENTS", + argCount: argCount, + maxParams: formats.length, + }, + ]; + } + var errorArray = []; + for (var p = 0; p < formats.length; p++) { + var arg = args[p]; + var format = formats[p]; + // '== null' checks for 'null' and typeof 'undefined' + if (arg == null) { + // handle undefined args + if (!format.optional || p < minParams || p < argCount) { + errorArray.push({ + type: "EMPTY_VAR", + position: p, + format: format, + }); + } + } else if (testParamTypes(arg, format.types) > 0) { + errorArray.push({ + type: "WRONG_TYPE", + position: p, + format: format, + arg: arg, + }); + } + } + return errorArray; + }; + /** + * a custom error type, used by the mocha + * tests when expecting validation errors + * @method ValidationError + * @private + */ + _main.default.ValidationError = (function (name) { + var err = /*#__PURE__*/ (function (_Error) { + _inherits(err, _Error); + var _super = _createSuper(err); + function err(message, func, type) { + var _this; + _classCallCheck(this, err); + _this = _super.call(this); + _this.message = message; + _this.func = func; + _this.type = type; + if ("captureStackTrace" in Error) + Error.captureStackTrace(_assertThisInitialized(_this), err); + else _this.stack = new Error().stack; + return _this; + } + return err; + })(/*#__PURE__*/ _wrapNativeSuper(Error)); + err.prototype.name = name; + return err; + })("ValidationError"); + /** + * Prints a friendly msg after parameter validation + * @method _friendlyParamError + * @private + */ + _main.default._friendlyParamError = function (errorObj, func) { + var message; + var translationObj; + function formatType() { + var format = errorObj.format; + return format.types + .map(function (type) { + return type.names ? type.names.join("|") : type.name; + }) + .join("|"); + } + switch (errorObj.type) { + case "EMPTY_VAR": { + translationObj = { + func: func, + formatType: formatType(), + // It needs to be this way for i18next-extract to work. The comment + // specifies the values that the context can take so that it can + // statically prepare the translation files with them. + /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ + position: (0, _internationalization.translator)( + "fes.positions.p", + { + context: (errorObj.position + 1).toString(), + defaultValue: (errorObj.position + 1).toString(), + }, + ), + url: "https://p5js.org/examples/data-variable-scope.html", + }; + break; + } + case "WRONG_TYPE": { + var arg = errorObj.arg; + var argType = + arg instanceof Array + ? "array" + : arg === null + ? "null" + : arg === undefined + ? "undefined" + : typeof arg === "number" && isNaN(arg) + ? "NaN" + : arg.name || _typeof(arg); + translationObj = { + func: func, + formatType: formatType(), + argType: argType, + /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ + position: (0, _internationalization.translator)( + "fes.positions.p", + { + context: (errorObj.position + 1).toString(), + defaultValue: (errorObj.position + 1).toString(), + }, + ), + }; + break; + } + case "TOO_FEW_ARGUMENTS": { + translationObj = { + func: func, + minParams: errorObj.minParams, + argCount: errorObj.argCount, + }; + break; + } + case "TOO_MANY_ARGUMENTS": { + translationObj = { + func: func, + maxParams: errorObj.maxParams, + argCount: errorObj.argCount, + }; + break; + } + } + if (translationObj) { + try { + // const re = /Function\.validateParameters.*[\r\n].*[\r\n].*\(([^)]*)/; + var myError = new Error(); + var parsed = _main.default + ._getErrorStackParser() + .parse(myError); + if ( + parsed[3] && + parsed[3].functionName && + parsed[3].functionName.includes(".") && + _main.default.prototype[ + parsed[3].functionName.split(".").slice(-1)[0] + ] + ) { + return; + } + if (_main.default._throwValidationErrors) { + throw new _main.default.ValidationError( + message, + func, + errorObj.type, + ); + } // try to extract the location from where the function was called + + if ( + parsed[3] && + parsed[3].fileName && + parsed[3].lineNumber && + parsed[3].columnNumber + ) { + var location = "" + .concat(parsed[3].fileName, ":") + .concat(parsed[3].lineNumber, ":") + .concat(parsed[3].columnNumber); + translationObj.location = (0, + _internationalization.translator)("fes.location", { + location: location, + // for e.g. get "sketch.js" from "https://example.com/abc/sketch.js" + file: parsed[3].fileName.split("/").slice(-1), + line: parsed[3].lineNumber, + }); + // tell fesErrorMonitor that we have already given a friendly message + // for this line, so it need not to do the same in case of an error + _main.default._fesLogCache[location] = true; + } + } catch (err) { + if (err instanceof _main.default.ValidationError) { + throw err; + } + } + translationObj.context = errorObj.type; + // i18next-extract-mark-context-next-line ["EMPTY_VAR", "TOO_MANY_ARGUMENTS", "TOO_FEW_ARGUMENTS", "WRONG_TYPE"] + message = (0, _internationalization.translator)( + "fes.friendlyParamError.type", + translationObj, + ); + _main.default._friendlyError("".concat(message), func, 3); + } + }; + /** + * Clears cache to avoid having multiple FES messages for the same set of + * parameters. + * + * If a function is called with some set of wrong arguments, and then called + * again with the same set of arguments, the messages due to the second call + * will be supressed. If two tests test on the same wrong arguments, the + * second test won't see the validationError. clearing argumentTree solves it + * + * @method _clearValidateParamsCache + * @private + */ + _main.default._clearValidateParamsCache = + function clearValidateParamsCache() { + for ( + var _i2 = 0, _Object$keys2 = Object.keys(argumentTree); + _i2 < _Object$keys2.length; + _i2++ + ) { + var _key4 = _Object$keys2[_i2]; + delete argumentTree[_key4]; + } + }; + // allowing access to argumentTree for testing + _main.default._getValidateParamsArgTree = + function getValidateParamsArgTree() { + return argumentTree; + }; + /** + * Runs parameter validation by matching the input parameters with information + * from `docs/reference/data.json`. + * Generates and prints a friendly error message using key: + * "fes.friendlyParamError.[*]". + * + * @method _validateParameters + * @private + * @param {String} func Name of the function + * @param {Array} args User input arguments + * + * @example: + * const a; + * ellipse(10,10,a,5); + * console output: + * "It looks like ellipse received an empty variable in spot #2." + * + * @example: + * ellipse(10,"foo",5,5); + * console output: + * "ellipse was expecting a number for parameter #1, + * received "foo" instead." + */ + _main.default._validateParameters = function validateParameters( + func, + args, + ) { + if (_main.default.disableFriendlyErrors) { + return; // skip FES + } // query / build the argument type tree and check if this sequence + // has already been seen before. + + var obj = buildArgTypeCache(func, args); + if (obj.seen) { + return; + } // mark this sequence as seen + + obj.seen = true; + // lookup the docs in the 'data.json' file + var docs = + docCache[func] || (docCache[func] = lookupParamDoc(func)); + var overloads = docs.overloads; + var argCount = args.length; + // the following line ignores trailing undefined arguments, commenting + // it to resolve https://github.com/processing/p5.js/issues/4571 + // '== null' checks for 'null' and typeof 'undefined' + // while (argCount > 0 && args[argCount - 1] == null) argCount--; + // find the overload with the best score + var minScore = 99999; + var minOverload; + for (var i = 0; i < overloads.length; i++) { + var score = scoreOverload( + args, + argCount, + overloads[i], + minScore, + ); + if (score === 0) { + return; // done! + } else if (minScore > score) { + // this score is better that what we have so far... + minScore = score; + minOverload = i; + } + } // this should _always_ be true here... + + if (minScore > 0) { + // get the errors for the best overload + var errorArray = getOverloadErrors( + args, + argCount, + overloads[minOverload], + ); + // generate err msg + for (var n = 0; n < errorArray.length; n++) { + _main.default._friendlyParamError(errorArray[n], func); + } + } + }; + _main.default.prototype._validateParameters = + _main.default.validateParameters; + } + var _default = _main.default; + exports.default = _default; + }, + { + "../../../docs/parameterData.json": 1, + "../constants": 286, + "../internationalization": 296, + "../main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.last-index-of": 181, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.map": 187, + "core-js/modules/es.number.constructor": 191, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.set": 207, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 294: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var constants = _interopRequireWildcard(_dereq_("./constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } /** + * @requires constants + */ + + function modeAdjust(a, b, c, d, mode) { + if (mode === constants.CORNER) { + return { + x: a, + y: b, + w: c, + h: d, + }; + } else if (mode === constants.CORNERS) { + return { + x: a, + y: b, + w: c - a, + h: d - b, + }; + } else if (mode === constants.RADIUS) { + return { + x: a - c, + y: b - d, + w: 2 * c, + h: 2 * d, + }; + } else if (mode === constants.CENTER) { + return { + x: a - c * 0.5, + y: b - d * 0.5, + w: c, + h: d, + }; + } + } + var _default = { + modeAdjust: modeAdjust, + }; + exports.default = _default; + }, + { + "./constants": 286, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 295: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + var _main = _interopRequireDefault(_dereq_("../core/main")); + var _internationalization = _dereq_("./internationalization"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * _globalInit + * + * TODO: ??? + * if sketch is on window + * assume "global" mode + * and instantiate p5 automatically + * otherwise do nothing + * + * @private + * @return {Undefined} + */ + + var _globalInit = function _globalInit() { + // Could have been any property defined within the p5 constructor. + // If that property is already a part of the global object, + // this code has already run before, likely due to a duplicate import + if (typeof window._setupDone !== "undefined") { + console.warn( + "p5.js seems to have been imported multiple times. Please remove the duplicate import", + ); + return; + } + if (!window.mocha) { + // If there is a setup or draw function on the window + // then instantiate p5 in "global" mode + if ( + ((window.setup && typeof window.setup === "function") || + (window.draw && typeof window.draw === "function")) && + !_main.default.instance + ) { + new _main.default(); + } + } + }; + // make a promise that resolves when the document is ready + var waitForDocumentReady = function waitForDocumentReady() { + return new Promise(function (resolve, reject) { + // if the page is ready, initialize p5 immediately + if (document.readyState === "complete") { + resolve(); + // if the page is still loading, add an event listener + // and initialize p5 as soon as it finishes loading + } else { + window.addEventListener("load", resolve, false); + } + }); + }; + // only load translations if we're using the full, un-minified library + var waitingForTranslator = + typeof IS_MINIFIED === "undefined" + ? (0, _internationalization.initialize)() + : Promise.resolve(); + Promise.all([waitForDocumentReady(), waitingForTranslator]).then( + _globalInit, + ); + }, + { + "../core/main": 298, + "./internationalization": 296, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.promise": 201, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 296: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.setTranslatorLanguage = + exports.currentTranslatorLanguage = + exports.availableTranslatorLanguages = + exports.initialize = + exports.translator = + void 0; + var _i18next = _interopRequireDefault(_dereq_("i18next")); + var _i18nextBrowserLanguagedetector = _interopRequireDefault( + _dereq_("i18next-browser-languagedetector"), + ); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + var fallbackResources, languages; + if (typeof IS_MINIFIED === "undefined") { + // internationalization is only for the unminified build + var translationsModule = _dereq_("../../translations"); + fallbackResources = translationsModule.default; + languages = translationsModule.languages; + if (typeof P5_DEV_BUILD !== "undefined") { + // When the library is built in development mode ( using npm run dev ) + // we want to use the current translation files on the disk, which may have + // been updated but not yet pushed to the CDN. + var completeResources = _dereq_("../../translations/dev"); + for ( + var _i = 0, _Object$keys = Object.keys(completeResources); + _i < _Object$keys.length; + _i++ + ) { + var language = _Object$keys[_i]; + // In es_translation, language is es and namespace is translation + // In es_MX_translation, language is es-MX and namespace is translation + var parts = language.split("_"); + var lng = parts.slice(0, parts.length - 1).join("-"); + var ns = parts[parts.length - 1]; + fallbackResources[lng] = fallbackResources[lng] || {}; + fallbackResources[lng][ns] = completeResources[language]; + } + } + } /** + * This is our i18next "backend" plugin. It tries to fetch languages + * from a CDN. + */ + + var FetchResources = /*#__PURE__*/ (function () { + function FetchResources(services, options) { + _classCallCheck(this, FetchResources); + this.init(services, options); + } // run fetch with a timeout. Automatically rejects on timeout + // default timeout = 2000 ms + + _createClass(FetchResources, [ + { + key: "fetchWithTimeout", + value: function fetchWithTimeout(url, options) { + var timeout = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 2000; + return Promise.race([ + fetch(url, options), + new Promise(function (_, reject) { + return setTimeout(function () { + return reject(new Error("timeout")); + }, timeout); + }), + ]); + }, + }, + { + key: "init", + value: function init(services) { + var options = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + this.services = services; + this.options = options; + }, + }, + { + key: "read", + value: function read(language, namespace, callback) { + var loadPath = this.options.loadPath; + if (language === this.options.fallback) { + // if the default language of the user is the same as our inbuilt fallback, + // there's no need to fetch resources from the cdn. This won't actually + // need to run when we use "partialBundledLanguages" in the init + // function. + callback(null, fallbackResources[language][namespace]); + } else if (languages.includes(language)) { + // The user's language is included in the list of languages + // that we so far added translations for. + var url = this.services.interpolator.interpolate(loadPath, { + lng: language, + ns: namespace, + }); + this.loadUrl(url, callback); + } else { + // We don't have translations for this language. i18next will use + // the default language instead. + callback("Not found", false); + } + }, + }, + { + key: "loadUrl", + value: function loadUrl(url, callback) { + this.fetchWithTimeout(url) + .then( + function (response) { + var ok = response.ok; + if (!ok) { + // caught in the catch() below + throw new Error("failed loading ".concat(url)); + } + return response.json(); + }, + function () { + // caught in the catch() below + throw new Error("failed loading ".concat(url)); + }, + ) + .then(function (data) { + return callback(null, data); + }) + .catch(callback); + }, + }, + ]); + return FetchResources; + })(); + FetchResources.type = "backend"; + /** + * This is our translation function. Give it a key and + * it will retrieve the appropriate string + * (within supported languages) according to the + * user's browser's language settings. + * @function translator + * @param {String} key a key that corresponds to a message in our translation files + * @param {Object} values values for use in the message under the given `key` + * @returns {String} message (with values inserted) in the user's browser language + * @private + */ + var translator = function translator(key, values) { + console.debug( + "p5.js translator called before translations were loaded", + ); + // Certain FES functionality may trigger before translations are downloaded. + // Using "partialBundledLanguages" option during initialization, we can + // still use our fallback language to display messages + _i18next.default.t(key, values); /* i18next-extract-disable-line */ + }; + // (We'll set this to a real value in the init function below!) + /** + * Set up our translation function, with loaded languages + */ + exports.translator = translator; + var initialize = function initialize() { + var i18init = _i18next.default + .use(_i18nextBrowserLanguagedetector.default) + .use(FetchResources) + .init({ + fallbackLng: "en", + nestingPrefix: "$tr(", + nestingSuffix: ")", + defaultNS: "translation", + returnEmptyString: false, + interpolation: { + escapeValue: false, + }, + detection: { + checkWhitelist: false, + // prevent storing or locating language from cookie or localStorage + // more info on https://github.com/processing/p5.js/issues/4862 + order: [ + "querystring", + "navigator", + "htmlTag", + "path", + "subdomain", + ], + caches: [], + }, + backend: { + fallback: "en", + loadPath: + "https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json", + }, + partialBundledLanguages: true, + resources: fallbackResources, + }) + .then( + function (translateFn) { + exports.translator = translator = translateFn; + }, + function (e) { + return console.debug( + "Translations failed to load (".concat(e, ")"), + ); + }, + ); + // i18next.init() returns a promise that resolves when the translations + // are loaded. We use this in core/init.js to hold p5 initialization until + // we have the translation files. + return i18init; + }; + /** + * Returns a list of languages we have translations loaded for + */ + exports.initialize = initialize; + var availableTranslatorLanguages = + function availableTranslatorLanguages() { + return _i18next.default.languages; + }; + /** + * Returns the current language selected for translation + */ + exports.availableTranslatorLanguages = availableTranslatorLanguages; + var currentTranslatorLanguage = function currentTranslatorLanguage( + language, + ) { + return _i18next.default.language; + }; + /** + * Sets the current language for translation + * Returns a promise that resolved when loading is finished, + * or rejects if it fails. + */ + exports.currentTranslatorLanguage = currentTranslatorLanguage; + var setTranslatorLanguage = function setTranslatorLanguage(language) { + return _i18next.default.changeLanguage( + language || undefined, + function (e) { + return console.debug( + "Translations failed to load (".concat(e, ")"), + ); + }, + ); + }; + exports.setTranslatorLanguage = setTranslatorLanguage; + }, + { + "../../translations": 360, + "../../translations/dev": undefined, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.promise": 201, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.split": 216, + "core-js/modules/web.dom-collections.iterator": 256, + i18next: 267, + "i18next-browser-languagedetector": 264, + }, + ], + 297: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @for p5 + * @requires core + * These are functions that are part of the Processing API but are not part of + * the p5.js API. In some cases they have a new name, in others, they are + * removed completely. Not all unsupported Processing functions are listed here + * but we try to include ones that a user coming from Processing might likely + * call. + */ + + _main.default.prototype.pushStyle = function () { + throw new Error("pushStyle() not used, see push()"); + }; + _main.default.prototype.popStyle = function () { + throw new Error("popStyle() not used, see pop()"); + }; + _main.default.prototype.popMatrix = function () { + throw new Error("popMatrix() not used, see pop()"); + }; + _main.default.prototype.pushMatrix = function () { + throw new Error("pushMatrix() not used, see push()"); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "./main": 298, + }, + ], + 298: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-own-property-names"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.object.get-own-property-names"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + _dereq_("./shim"); + var constants = _interopRequireWildcard(_dereq_("./constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Structure + * @submodule Structure + * @for p5 + * @requires constants + */ + // Core needs the PVariables object + /** + * This is the p5 instance constructor. + * + * A p5 instance holds all the properties and methods related to + * a p5 sketch. It expects an incoming sketch closure and it can also + * take an optional node parameter for attaching the generated p5 canvas + * to a node. The sketch closure takes the newly created p5 instance as + * its sole argument and may optionally set preload(), + * setup(), and/or + * draw() properties on it for running a sketch. + * + * A p5 sketch can run in "global" or "instance" mode: + * "global" - all properties and methods are attached to the window + * "instance" - all properties and methods are bound to this p5 object + * + * @class p5 + * @constructor + * @param {function(p5)} sketch a closure that can set optional preload(), + * setup(), and/or draw() properties on the + * given p5 instance + * @param {HTMLElement} [node] element to attach canvas to + * @return {p5} a p5 instance + */ + + var p5 = /*#__PURE__*/ (function () { + function p5(sketch, node) { + var _this = this; + _classCallCheck(this, p5); + ////////////////////////////////////////////// + // PUBLIC p5 PROPERTIES AND METHODS + ////////////////////////////////////////////// + /** + * Called directly before setup(), the preload() function is used to handle + * asynchronous loading of external files in a blocking way. If a preload + * function is defined, setup() will wait until any load calls within have + * finished. Nothing besides load calls (loadImage, loadJSON, loadFont, + * loadStrings, etc.) should be inside the preload function. If asynchronous + * loading is preferred, the load methods can instead be called in setup() + * or anywhere else with the use of a callback parameter. + * + * By default the text "loading..." will be displayed. To make your own + * loading page, include an HTML element with id "p5_loading" in your + * page. More information here. + * + * @method preload + * @example + *
                    + * let img; + * let c; + * function preload() { + * // preload() runs once + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * // setup() waits until preload() is done + * img.loadPixels(); + * // get color of middle pixel + * c = img.get(img.width / 2, img.height / 2); + * } + * + * function draw() { + * background(c); + * image(img, 25, 25, 50, 50); + * } + *
                    + * + * @alt + * nothing displayed + * + */ + /** + * The setup() function is called once when the program starts. It's used to + * define initial environment properties such as screen size and background + * color and to load media such as images and fonts as the program starts. + * There can only be one setup() function for each program and it shouldn't + * be called again after its initial execution. + * + * Note: Variables declared within setup() are not accessible within other + * functions, including draw(). + * + * @method setup + * @example + *
                    + * let a = 0; + * + * function setup() { + * background(0); + * noStroke(); + * fill(102); + * } + * + * function draw() { + * rect(a++ % width, 10, 2, 80); + * } + *
                    + * + * @alt + * nothing displayed + * + */ + /** + * Called directly after setup(), the draw() function continuously executes + * the lines of code contained inside its block until the program is stopped + * or noLoop() is called. Note if noLoop() is called in setup(), draw() will + * still be executed once before stopping. draw() is called automatically and + * should never be called explicitly. + * + * It should always be controlled with noLoop(), redraw() and loop(). After + * noLoop() stops the code in draw() from executing, redraw() causes the + * code inside draw() to execute once, and loop() will cause the code + * inside draw() to resume executing continuously. + * + * The number of times draw() executes in each second may be controlled with + * the frameRate() function. + * + * There can only be one draw() function for each sketch, and draw() must + * exist if you want the code to run continuously, or to process events such + * as mousePressed(). Sometimes, you might have an empty call to draw() in + * your program, as shown in the above example. + * + * It is important to note that the drawing coordinate system will be reset + * at the beginning of each draw() call. If any transformations are performed + * within draw() (ex: scale, rotate, translate), their effects will be + * undone at the beginning of draw(), so transformations will not accumulate + * over time. On the other hand, styling applied (ex: fill, stroke, etc) will + * remain in effect. + * + * @method draw + * @example + *
                    + * let yPos = 0; + * function setup() { + * // setup() runs once + * frameRate(30); + * } + * function draw() { + * // draw() loops forever, until stopped + * background(204); + * yPos = yPos - 1; + * if (yPos < 0) { + * yPos = height; + * } + * line(0, yPos, width, yPos); + * } + *
                    + * + * @alt + * nothing displayed + * + */ + ////////////////////////////////////////////// + // PRIVATE p5 PROPERTIES AND METHODS + ////////////////////////////////////////////// + this._setupDone = false; + this._preloadDone = false; + // for handling hidpi + this._pixelDensity = Math.ceil(window.devicePixelRatio) || 1; + this._userNode = node; + this._curElement = null; + this._elements = []; + this._glAttributes = null; + this._requestAnimId = 0; + this._preloadCount = 0; + this._isGlobal = false; + this._loop = true; + this._startListener = null; + this._initializeInstanceVariables(); + this._defaultCanvasSize = { + width: 100, + height: 100, + }; + this._events = { + // keep track of user-events for unregistering later + mousemove: null, + mousedown: null, + mouseup: null, + dragend: null, + dragover: null, + click: null, + dblclick: null, + mouseover: null, + mouseout: null, + keydown: null, + keyup: null, + keypress: null, + touchstart: null, + touchmove: null, + touchend: null, + resize: null, + blur: null, + }; + this._millisStart = -1; + this._recording = false; + // States used in the custom random generators + this._lcg_random_state = null; + this._gaussian_previous = false; + this._events.wheel = null; + this._loadingScreenId = "p5_loading"; + // Allows methods to be registered on an instance that + // are instance-specific. + this._registeredMethods = {}; + var methods = Object.getOwnPropertyNames( + p5.prototype._registeredMethods, + ); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = methods[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var prop = _step.value; + this._registeredMethods[prop] = + p5.prototype._registeredMethods[prop].slice(); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (window.DeviceOrientationEvent) { + this._events.deviceorientation = null; + } + if (window.DeviceMotionEvent && !window._isNodeWebkit) { + this._events.devicemotion = null; + } // Function to invoke registered hooks before or after events such as preload, setup, and pre/post draw. + + p5.prototype.callRegisteredHooksFor = function (hookName) { + var target = this || p5.prototype; + var context = this._isGlobal ? window : this; + if (target._registeredMethods.hasOwnProperty(hookName)) { + var _methods = target._registeredMethods[hookName]; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = _methods[Symbol.iterator](), _step2; + !(_iteratorNormalCompletion2 = (_step2 = + _iterator2.next()).done); + _iteratorNormalCompletion2 = true + ) { + var method = _step2.value; + if (typeof method === "function") { + method.call(context); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + }; + this._start = function () { + // Find node if id given + if (_this._userNode) { + if (typeof _this._userNode === "string") { + _this._userNode = document.getElementById(_this._userNode); + } + } + var context = _this._isGlobal ? window : _this; + if (context.preload) { + _this.callRegisteredHooksFor("beforePreload"); + // Setup loading screen + // Set loading screen into dom if not present + // Otherwise displays and removes user provided loading screen + var loadingScreen = document.getElementById( + _this._loadingScreenId, + ); + if (!loadingScreen) { + loadingScreen = document.createElement("div"); + loadingScreen.innerHTML = "Loading..."; + loadingScreen.style.position = "absolute"; + loadingScreen.id = _this._loadingScreenId; + var _node = _this._userNode || document.body; + _node.appendChild(loadingScreen); + } + var _methods2 = _this._preloadMethods; + for (var method in _methods2) { + // default to p5 if no object defined + _methods2[method] = _methods2[method] || p5; + var obj = _methods2[method]; + //it's p5, check if it's global or instance + if (obj === p5.prototype || obj === p5) { + if (_this._isGlobal) { + window[method] = _this._wrapPreload(_this, method); + } + obj = _this; + } + _this._registeredPreloadMethods[method] = obj[method]; + obj[method] = _this._wrapPreload(obj, method); + } + context.preload(); + _this._runIfPreloadsAreDone(); + } else { + _this._setup(); + if (!_this._recording) { + _this._draw(); + } + } + }; + this._runIfPreloadsAreDone = function () { + var context = this._isGlobal ? window : this; + if (context._preloadCount === 0) { + var loadingScreen = document.getElementById( + context._loadingScreenId, + ); + if (loadingScreen) { + loadingScreen.parentNode.removeChild(loadingScreen); + } + this.callRegisteredHooksFor("afterPreload"); + if (!this._setupDone) { + this._lastTargetFrameTime = window.performance.now(); + this._lastRealFrameTime = window.performance.now(); + context._setup(); + if (!this._recording) { + context._draw(); + } + } + } + }; + this._decrementPreload = function () { + var context = this._isGlobal ? window : this; + if ( + !context._preloadDone && + typeof context.preload === "function" + ) { + context._setProperty( + "_preloadCount", + context._preloadCount - 1, + ); + context._runIfPreloadsAreDone(); + } + }; + this._wrapPreload = function (obj, fnName) { + var _this2 = this; + return function () { + //increment counter + _this2._incrementPreload(); + //call original function + for ( + var _len = arguments.length, + args = new Array(_len), + _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + return _this2._registeredPreloadMethods[fnName].apply( + obj, + args, + ); + }; + }; + this._incrementPreload = function () { + var context = this._isGlobal ? window : this; + // Do nothing if we tried to increment preloads outside of `preload` + if (context._preloadDone) return; + context._setProperty( + "_preloadCount", + context._preloadCount + 1, + ); + }; + this._setup = function () { + _this.callRegisteredHooksFor("beforeSetup"); + // Always create a default canvas. + // Later on if the user calls createCanvas, this default one + // will be replaced + _this.createCanvas( + _this._defaultCanvasSize.width, + _this._defaultCanvasSize.height, + "p2d", + ); + // return preload functions to their normal vals if switched by preload + var context = _this._isGlobal ? window : _this; + if (typeof context.preload === "function") { + for (var f in _this._preloadMethods) { + context[f] = _this._preloadMethods[f][f]; + if (context[f] && _this) { + context[f] = context[f].bind(_this); + } + } + } // Record the time when sketch starts + + _this._millisStart = window.performance.now(); + context._preloadDone = true; + // Short-circuit on this, in case someone used the library in "global" + // mode earlier + if (typeof context.setup === "function") { + context.setup(); + } // unhide any hidden canvases that were created + + var canvases = document.getElementsByTagName("canvas"); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = canvases[Symbol.iterator](), _step3; + !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) + .done); + _iteratorNormalCompletion3 = true + ) { + var k = _step3.value; + if (k.dataset.hidden === "true") { + k.style.visibility = ""; + delete k.dataset.hidden; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion3 && + _iterator3.return != null + ) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + _this._lastTargetFrameTime = window.performance.now(); + _this._lastRealFrameTime = window.performance.now(); + _this._setupDone = true; + if ( + _this._accessibleOutputs.grid || + _this._accessibleOutputs.text + ) { + _this._updateAccsOutput(); + } + _this.callRegisteredHooksFor("afterSetup"); + }; + this._draw = function () { + var now = window.performance.now(); + var time_since_last = now - _this._lastTargetFrameTime; + var target_time_between_frames = 1000 / _this._targetFrameRate; + // only draw if we really need to; don't overextend the browser. + // draw if we're within 5ms of when our next frame should paint + // (this will prevent us from giving up opportunities to draw + // again when it's really about time for us to do so). fixes an + // issue where the frameRate is too low if our refresh loop isn't + // in sync with the browser. note that we have to draw once even + // if looping is off, so we bypass the time delay if that + // is the case. + var epsilon = 5; + if ( + !_this._loop || + time_since_last >= target_time_between_frames - epsilon + ) { + //mandatory update values(matrixes and stack) + _this.deltaTime = now - _this._lastRealFrameTime; + _this._setProperty("deltaTime", _this.deltaTime); + _this._frameRate = 1000 / _this.deltaTime; + _this.redraw(); + _this._lastTargetFrameTime = Math.max( + _this._lastTargetFrameTime + target_time_between_frames, + now, + ); + _this._lastRealFrameTime = now; + // If the user is actually using mouse module, then update + // coordinates, otherwise skip. We can test this by simply + // checking if any of the mouse functions are available or not. + // NOTE : This reflects only in complete build or modular build. + if (typeof _this._updateMouseCoords !== "undefined") { + _this._updateMouseCoords(); + //reset delta values so they reset even if there is no mouse event to set them + // for example if the mouse is outside the screen + _this._setProperty("movedX", 0); + _this._setProperty("movedY", 0); + } + } // get notified the next time the browser gives us + // an opportunity to draw. + + if (_this._loop) { + _this._requestAnimId = window.requestAnimationFrame( + _this._draw, + ); + } + }; + this._setProperty = function (prop, value) { + _this[prop] = value; + if (_this._isGlobal) { + window[prop] = value; + } + }; + /** + * Removes the entire p5 sketch. This will remove the canvas and any + * elements created by p5.js. It will also stop the draw loop and unbind + * any properties or methods from the window global scope. It will + * leave a variable p5 in case you wanted to create a new p5 sketch. + * If you like, you can set p5 = null to erase it. While all functions and + * variables and objects created by the p5 library will be removed, any + * other global variables created by your code will remain. + * + * @method remove + * @example + *
                    + * function draw() { + * ellipse(50, 50, 10, 10); + * } + * + * function mousePressed() { + * remove(); // remove whole sketch on mouse press + * } + *
                    + * + * @alt + * nothing displayed + * + */ + this.remove = function () { + // Remove start listener to prevent orphan canvas being created + if (_this._startListener) { + window.removeEventListener( + "load", + _this._startListener, + false, + ); + } + var loadingScreen = document.getElementById( + _this._loadingScreenId, + ); + if (loadingScreen) { + loadingScreen.parentNode.removeChild(loadingScreen); + // Add 1 to preload counter to prevent the sketch ever executing setup() + _this._incrementPreload(); + } + if (_this._curElement) { + // stop draw + _this._loop = false; + if (_this._requestAnimId) { + window.cancelAnimationFrame(_this._requestAnimId); + } // unregister events sketch-wide + + for (var ev in _this._events) { + window.removeEventListener(ev, _this._events[ev]); + } // remove DOM elements created by p5, and listeners + + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for ( + var _iterator4 = _this._elements[Symbol.iterator](), + _step4; + !(_iteratorNormalCompletion4 = (_step4 = + _iterator4.next()).done); + _iteratorNormalCompletion4 = true + ) { + var e = _step4.value; + if (e.elt && e.elt.parentNode) { + e.elt.parentNode.removeChild(e.elt); + } + for (var elt_ev in e._events) { + e.elt.removeEventListener(elt_ev, e._events[elt_ev]); + } + } // call any registered remove functions + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion4 && + _iterator4.return != null + ) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + var self = _this; + _this._registeredMethods.remove.forEach(function (f) { + if (typeof f !== "undefined") { + f.call(self); + } + }); + } // remove window bound properties and methods + + if (_this._isGlobal) { + for (var p in p5.prototype) { + try { + delete window[p]; + } catch (x) { + window[p] = undefined; + } + } + for (var p2 in _this) { + if (_this.hasOwnProperty(p2)) { + try { + delete window[p2]; + } catch (x) { + window[p2] = undefined; + } + } + } + p5.instance = null; + } + }; + // call any registered init functions + this._registeredMethods.init.forEach(function (f) { + if (typeof f !== "undefined") { + f.call(this); + } + }, this); + // Set up promise preloads + this._setupPromisePreloads(); + var friendlyBindGlobal = + this._createFriendlyGlobalFunctionBinder(); + // If the user has created a global setup or draw function, + // assume "global" mode and make everything global (i.e. on the window) + if (!sketch) { + this._isGlobal = true; + p5.instance = this; + // Loop through methods on the prototype and attach them to the window + for (var p in p5.prototype) { + if (typeof p5.prototype[p] === "function") { + var ev = p.substring(2); + if (!this._events.hasOwnProperty(ev)) { + if ( + Math.hasOwnProperty(p) && + Math[p] === p5.prototype[p] + ) { + // Multiple p5 methods are just native Math functions. These can be + // called without any binding. + friendlyBindGlobal(p, p5.prototype[p]); + } else { + friendlyBindGlobal(p, p5.prototype[p].bind(this)); + } + } + } else { + friendlyBindGlobal(p, p5.prototype[p]); + } + } // Attach its properties to the window + + for (var p2 in this) { + if (this.hasOwnProperty(p2)) { + friendlyBindGlobal(p2, this[p2]); + } + } + } else { + // Else, the user has passed in a sketch closure that may set + // user-provided 'setup', 'draw', etc. properties on this instance of p5 + sketch(this); + // Run a check to see if the user has misspelled 'setup', 'draw', etc + // detects capitalization mistakes only ( Setup, SETUP, MouseClicked, etc) + p5._checkForUserDefinedFunctions(this); + } // Bind events to window (not using container div bc key events don't work) + + for (var e in this._events) { + var f = this["_on".concat(e)]; + if (f) { + var m = f.bind(this); + window.addEventListener(e, m, { + passive: false, + }); + this._events[e] = m; + } + } + var focusHandler = function focusHandler() { + _this._setProperty("focused", true); + }; + var blurHandler = function blurHandler() { + _this._setProperty("focused", false); + }; + window.addEventListener("focus", focusHandler); + window.addEventListener("blur", blurHandler); + this.registerMethod("remove", function () { + window.removeEventListener("focus", focusHandler); + window.removeEventListener("blur", blurHandler); + }); + if (document.readyState === "complete") { + this._start(); + } else { + this._startListener = this._start.bind(this); + window.addEventListener("load", this._startListener, false); + } + } + _createClass(p5, [ + { + key: "_initializeInstanceVariables", + value: function _initializeInstanceVariables() { + this._accessibleOutputs = { + text: false, + grid: false, + textLabel: false, + gridLabel: false, + }; + this._styles = []; + this._bezierDetail = 20; + this._curveDetail = 20; + this._colorMode = constants.RGB; + this._colorMaxes = { + rgb: [255, 255, 255, 255], + hsb: [360, 100, 100, 1], + hsl: [360, 100, 100, 1], + }; + this._downKeys = {}; //Holds the key codes of currently pressed keys + }, + }, + { + key: "registerPreloadMethod", + value: function registerPreloadMethod(fnString, obj) { + // obj = obj || p5.prototype; + if (!p5.prototype._preloadMethods.hasOwnProperty(fnString)) { + p5.prototype._preloadMethods[fnString] = obj; + } + }, + }, + { + key: "registerMethod", + value: function registerMethod(name, m) { + var target = this || p5.prototype; + if (!target._registeredMethods.hasOwnProperty(name)) { + target._registeredMethods[name] = []; + } + target._registeredMethods[name].push(m); + }, + }, + { + key: "unregisterMethod", + value: function unregisterMethod(name, m) { + var target = this || p5.prototype; + if (target._registeredMethods.hasOwnProperty(name)) { + var methods = target._registeredMethods[name]; + var indexesToRemove = []; + // Find all indexes of the method `m` in the array of registered methods + for (var i = 0; i < methods.length; i++) { + if (methods[i] === m) { + indexesToRemove.push(i); + } + } // Remove all instances of the method `m` from the array + + for (var _i = indexesToRemove.length - 1; _i >= 0; _i--) { + methods.splice(indexesToRemove[_i], 1); + } + } + }, // create a function which provides a standardized process for binding + // globals; this is implemented as a factory primarily so that there's a + // way to redefine what "global" means for the binding function so it + // can be used in scenarios like unit testing where the window object + // might not exist + }, + { + key: "_createFriendlyGlobalFunctionBinder", + value: function _createFriendlyGlobalFunctionBinder() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + var globalObject = options.globalObject || window; + var log = options.log || console.log.bind(console); + var propsToForciblyOverwrite = { + // p5.print actually always overwrites an existing global function, + // albeit one that is very unlikely to be used: + // + // https://developer.mozilla.org/en-US/docs/Web/API/Window/print + print: true, + }; + return function (prop, value) { + if ( + !p5.disableFriendlyErrors && + typeof IS_MINIFIED === "undefined" && + typeof value === "function" && + !(prop in p5.prototype._preloadMethods) + ) { + try { + // Because p5 has so many common function names, it's likely + // that users may accidentally overwrite global p5 functions with + // their own variables. Let's allow this but log a warning to + // help users who may be doing this unintentionally. + // + // For more information, see: + // + // https://github.com/processing/p5.js/issues/1317 + if ( + prop in globalObject && + !(prop in propsToForciblyOverwrite) + ) { + throw new Error( + 'global "'.concat(prop, '" already exists'), + ); + } // It's possible that this might throw an error because there + // are a lot of edge-cases in which `Object.defineProperty` might + // not succeed; since this functionality is only intended to + // help beginners anyways, we'll just catch such an exception + // if it occurs, and fall back to legacy behavior. + + Object.defineProperty(globalObject, prop, { + configurable: true, + enumerable: true, + get: function get() { + return value; + }, + set: function set(newValue) { + Object.defineProperty(globalObject, prop, { + configurable: true, + enumerable: true, + value: newValue, + writable: true, + }); + log( + 'You just changed the value of "'.concat( + prop, + "\", which was a p5 function. This could cause problems later if you're not careful.", + ), + ); + }, + }); + } catch (e) { + var message = + 'p5 had problems creating the global function "'.concat( + prop, + '", possibly because your code is already using that name as a variable. You may want to rename your variable to something else.', + ); + p5._friendlyError(message, prop); + globalObject[prop] = value; + } + } else { + globalObject[prop] = value; + } + }; + }, + }, + ]); + return p5; + })(); // This is a pointer to our global mode p5 instance, if we're in + // global mode. + p5.instance = null; + /** + * Turn off some features of the friendly error system (FES), which can give + * a significant boost to performance when needed. + * + * Note that this will disable the parts of the FES that cause performance + * slowdown (like argument checking). Friendly errors that have no performance + * cost (like giving a descriptive error if a file load fails, or warning you + * if you try to override p5.js functions in the global space), + * will remain in place. + * + * See + * disabling the friendly error system. + * + * @property {Boolean} disableFriendlyErrors + * @example + *
                    + * p5.disableFriendlyErrors = true; + * + * function setup() { + * createCanvas(100, 50); + * } + *
                    + */ + p5.disableFriendlyErrors = false; + // attach constants to p5 prototype + for (var k in constants) { + p5.prototype[k] = constants[k]; + } // makes the `VERSION` constant available on the p5 object + // in instance mode, even if it hasn't been instantiated yet + + p5.VERSION = constants.VERSION; + // functions that cause preload to wait + // more can be added by using registerPreloadMethod(func) + p5.prototype._preloadMethods = { + loadJSON: p5.prototype, + loadImage: p5.prototype, + loadStrings: p5.prototype, + loadXML: p5.prototype, + loadBytes: p5.prototype, + loadTable: p5.prototype, + loadFont: p5.prototype, + loadModel: p5.prototype, + loadShader: p5.prototype, + }; + p5.prototype._registeredMethods = { + init: [], + pre: [], + post: [], + remove: [], + }; + p5.prototype._registeredPreloadMethods = {}; + var _default = p5; + exports.default = _default; + }, + { + "./constants": 286, + "./shim": 309, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-own-property-names": 197, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 299: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module DOM + * @submodule DOM + * @for p5.Element + */ + /** + * A class to describe an + * HTML element. + * Sketches can use many elements. Common elements include the drawing canvas, + * buttons, sliders, webcam feeds, and so on. + * + * All elements share the methods of the `p5.Element` class. They're created + * with functions such as createCanvas() and + * createButton(). + * + * @class p5.Element + * @constructor + * @param {HTMLElement} elt wrapped DOM element. + * @param {p5} [pInst] pointer to p5 instance. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Create a button element and + * // place it beneath the canvas. + * let btn = createButton('change'); + * btn.position(0, 100); + * + * // Call randomColor() when + * // the button is pressed. + * btn.mousePressed(randomColor); + * + * describe('A gray square with a button that says "change" beneath it. The square changes color when the user presses the button.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + */ + + _main.default.Element = /*#__PURE__*/ (function () { + function _class(elt, pInst) { + _classCallCheck(this, _class); + /** + * Underlying + * HTMLElement + * object. Its properties and methods can be used directly. + * + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Set the border style for the + * // canvas. + * cnv.elt.style.border = '5px dashed deeppink'; + * + * describe('A gray square with a pink border drawn with dashed lines.'); + * } + * + *
                    + * + * @property elt + * @name elt + * @readOnly + */ + this.elt = elt; + /** + * @private + * @type {p5.Element} + * @name _pInst + */ + this._pInst = this._pixelsState = pInst; + this._events = {}; + /** + * @type {Number} + * @property width + * @name width + */ + this.width = this.elt.offsetWidth; + /** + * @type {Number} + * @property height + * @name height + */ + this.height = this.elt.offsetHeight; + } /** + * Attaches this element to a parent element. + * + * For example, a `<div></div>` element may be used as a box to + * hold two pieces of text, a header and a paragraph. The + * `<div></div>` is the parent element of both the header and + * paragraph. + * + * The parameter `parent` can have one of three types. `parent` can be a + * string with the parent element's ID, as in + * `myElement.parent('container')`. It can also be another + * p5.Element object, as in + * `myElement.parent(myDiv)`. Finally, `parent` can be an `HTMLElement` + * object, as in `myElement.parent(anotherElement)`. + * + * Calling `myElement.parent()` without an argument returns this element's + * parent. + * + * @method parent + * @param {String|p5.Element|Object} parent ID, p5.Element, + * or HTMLElement of desired parent element. + * @chainable + * + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color to white + * div.style('background-color', 'white'); + * // Align any text to the center. + * div.style('text-align', 'center'); + * // Set its ID to "container". + * div.id('container'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent + * // using its ID "container". + * p.parent('container'); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create rectangular div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color and align + * // any text to the center. + * div.style('background-color', 'white'); + * div.style('text-align', 'center'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent. + * p.parent(div); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create rectangular div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color and align + * // any text to the center. + * div.style('background-color', 'white'); + * div.style('text-align', 'center'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent + * // using the underlying + * // HTMLElement. + * p.parent(div.elt); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
                    + */ + /** + * @method parent + * @return {p5.Element} + */ + + _createClass( + _class, + [ + { + key: "parent", + value: function parent(p) { + if (typeof p === "undefined") { + return this.elt.parentNode; + } + if (typeof p === "string") { + if (p[0] === "#") { + p = p.substring(1); + } + p = document.getElementById(p); + } else if (p instanceof _main.default.Element) { + p = p.elt; + } + p.appendChild(this.elt); + return this; + } /** + * Sets this element's ID using a given string. + * + * Calling `myElement.id()` without an argument returns its ID as a string. + * + * @method id + * @param {String} id ID of the element. + * @chainable + * + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Set the canvas' ID + * // to "mycanvas". + * cnv.id('mycanvas'); + * + * // Get the canvas' ID. + * let id = cnv.id(); + * text(id, 24, 54); + * + * describe('The text "mycanvas" written in black on a gray background.'); + * } + * + *
                    + */, + /** + * @method id + * @return {String} ID of the element. + */ + }, + { + key: "id", + value: function id(_id) { + if (typeof _id === "undefined") { + return this.elt.id; + } + this.elt.id = _id; + this.width = this.elt.offsetWidth; + this.height = this.elt.offsetHeight; + return this; + } /** + * Adds a + * class attribute + * to the element. + * + * Calling `myElement.class()` without an argument returns a string with its current classes. + * + * @method class + * @param {String} class class to add. + * @chainable + * + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Add the class "small" to the + * // canvas element. + * cnv.class('small'); + * + * // Get the canvas element's class + * // and display it. + * let c = cnv.class(); + * text(c, 35, 54); + * + * describe('The word "small" written in black on a gray canvas.'); + * + * } + * + *
                    + */, + /** + * @method class + * @return {String} element's classes, if any. + */ + }, + { + key: "class", + value: function _class(c) { + if (typeof c === "undefined") { + return this.elt.className; + } + this.elt.className = c; + return this; + } /** + * Calls a function when the mouse is pressed over the element. + * Calling `myElement.mousePressed(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. + * + * @method mousePressed + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the canvas + * // is pressed. + * cnv.mousePressed(randomColor); + * + * describe('A gray square changes color when the mouse is pressed.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the canvas is pressed. + * cnv.mousePressed(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse is pressed.'); + * } + * + *
                    + */, + }, + { + key: "mousePressed", + value: function mousePressed(fxn) { + // Prepend the mouse property setters to the event-listener. + // This is required so that mouseButton is set correctly prior to calling the callback (fxn). + // For details, see https://github.com/processing/p5.js/issues/3087. + var eventPrependedFxn = function eventPrependedFxn(event) { + this._pInst._setProperty("mouseIsPressed", true); + this._pInst._setMouseButton(event); + // Pass along the return-value of the callback: + return fxn.call(this, event); + }; + // Pass along the event-prepended form of the callback. + _main.default.Element._adjustListener( + "mousedown", + eventPrependedFxn, + this, + ); + return this; + } /** + * Calls a function when the mouse is pressed twice over the element. + * Calling `myElement.doubleClicked(false)` disables the function. + * + * @method doubleClicked + * @param {Function|Boolean} fxn function to call when the mouse is + * double clicked over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // canvas is double-clicked. + * cnv.doubleClicked(randomColor); + * + * describe('A gray square changes color when the user double-clicks the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the canvas is double-clicked. + * cnv.doubleClicked(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user double-clicks the canvas.'); + * } + * + *
                    + */, + }, + { + key: "doubleClicked", + value: function doubleClicked(fxn) { + _main.default.Element._adjustListener( + "dblclick", + fxn, + this, + ); + return this; + } /** + * Calls a function when the mouse wheel scrolls over th element. + * + * The callback function, `fxn`, is passed an `event` object. `event` has + * two numeric properties, `deltaY` and `deltaX`. `event.deltaY` is + * negative if the mouse wheel rotates away from the user. It's positive if + * the mouse wheel rotates toward the user. `event.deltaX` is positive if + * the mouse wheel moves to the right. It's negative if the mouse wheel moves + * to the left. + * + * Calling `myElement.mouseWheel(false)` disables the function. + * + * @method mouseWheel + * @param {Function|Boolean} fxn function to call when the mouse wheel is + * scrolled over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse wheel moves. + * cnv.mouseWheel(randomColor); + * + * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse wheel moves. + * cnv.mouseWheel(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call changeBackground() when the + * // mouse wheel moves. + * cnv.mouseWheel(changeBackground); + * + * describe('A gray square. When the mouse wheel scrolls over the square, it changes color and displays shapes.'); + * } + * + * function changeBackground(event) { + * // Change the background color + * // based on deltaY. + * if (event.deltaY > 0) { + * background('deeppink'); + * } else if (event.deltaY < 0) { + * background('cornflowerblue'); + * } else { + * background(200); + * } + * + * // Draw a shape based on deltaX. + * if (event.deltaX > 0) { + * circle(50, 50, 20); + * } else if (event.deltaX < 0) { + * square(40, 40, 20); + * } + * } + * + *
                    + */, + }, + { + key: "mouseWheel", + value: function mouseWheel(fxn) { + _main.default.Element._adjustListener("wheel", fxn, this); + return this; + } /** + * Calls a function when the mouse is released over the element. Calling + * `myElement.mouseReleased(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. + * + * @method mouseReleased + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when a + * // mouse press ends. + * cnv.mouseReleased(randomColor); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when a mouse press ends. + * cnv.mouseReleased(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + *
                    + */, + }, + { + key: "mouseReleased", + value: function mouseReleased(fxn) { + _main.default.Element._adjustListener("mouseup", fxn, this); + return this; + } /** + * Calls a function when the mouse is pressed and released over the element. + * Calling `myElement.mouseReleased(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. + * + * @method mouseClicked + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed and released over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when a + * // mouse press ends. + * cnv.mouseClicked(randomColor); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when a mouse press ends. + * cnv.mouseClicked(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + *
                    + */, + }, + { + key: "mouseClicked", + value: function mouseClicked(fxn) { + _main.default.Element._adjustListener("click", fxn, this); + return this; + } /** + * Calls a function when the mouse moves over the element. Calling + * `myElement.mouseMoved(false)` disables the function. + * + * @method mouseMoved + * @param {Function|Boolean} fxn function to call when the mouse + * moves over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse moves. + * cnv.mouseMoved(randomColor); + * + * describe('A gray square changes color when the mouse moves over the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves. + * cnv.mouseMoved(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves over the canvas.'); + * } + * + *
                    + */, + }, + { + key: "mouseMoved", + value: function mouseMoved(fxn) { + _main.default.Element._adjustListener( + "mousemove", + fxn, + this, + ); + return this; + } /** + * Calls a function when the mouse moves onto the element. Calling + * `myElement.mouseOver(false)` disables the function. + * + * @method mouseOver + * @param {Function|Boolean} fxn function to call when the mouse + * moves onto the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse moves onto the canvas. + * cnv.mouseOver(randomColor); + * + * describe('A gray square changes color when the mouse moves onto the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves onto + * // the canvas. + * cnv.mouseOver(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves onto the canvas.'); + * } + * + *
                    + */, + }, + { + key: "mouseOver", + value: function mouseOver(fxn) { + _main.default.Element._adjustListener( + "mouseover", + fxn, + this, + ); + return this; + } /** + * Calls a function when the mouse moves off the element. Calling + * `myElement.mouseOut(false)` disables the function. + * + * @method mouseOut + * @param {Function|Boolean} fxn function to call when the mouse + * moves off the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse moves off the canvas. + * cnv.mouseOut(randomColor); + * + * describe('A gray square changes color when the mouse moves off the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves off + * // the canvas. + * cnv.mouseOut(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves off the canvas.'); + * } + * + *
                    + */, + }, + { + key: "mouseOut", + value: function mouseOut(fxn) { + _main.default.Element._adjustListener( + "mouseout", + fxn, + this, + ); + return this; + } /** + * Calls a function when the element is touched. Calling + * `myElement.touchStarted(false)` disables the function. + * + * Note: Touch functions only work on mobile devices. + * + * @method touchStarted + * @param {Function|Boolean} fxn function to call when the touch + * starts. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas. + * cnv.touchStarted(randomColor); + * + * describe('A gray square changes color when the user touches the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas. + * cnv.touchStarted(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas.'); + * } + * + *
                    + */, + }, + { + key: "touchStarted", + value: function touchStarted(fxn) { + _main.default.Element._adjustListener( + "touchstart", + fxn, + this, + ); + return this; + } /** + * Calls a function when the user touches the element and moves their + * finger. Calling `myElement.touchMoved(false)` disables the + * function. + * + * Note: Touch functions only work on mobile devices. + * + * @method touchMoved + * @param {Function|Boolean} fxn function to call when the touch + * moves over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas + * // and moves. + * cnv.touchMoved(randomColor); + * + * describe('A gray square changes color when the user touches the canvas and moves.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas and moves. + * cnv.touchMoved(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas and moves.'); + * } + * + *
                    + */, + }, + { + key: "touchMoved", + value: function touchMoved(fxn) { + _main.default.Element._adjustListener( + "touchmove", + fxn, + this, + ); + return this; + } /** + * Calls a function when the user stops touching the element. Calling + * `myElement.touchMoved(false)` disables the function. + * + * Note: Touch functions only work on mobile devices. + * + * @method touchEnded + * @param {Function|Boolean} fxn function to call when the touch + * ends. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas, + * // then lifts their finger. + * cnv.touchEnded(randomColor); + * + * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas, then lifts their + * // finger. + * cnv.touchEnded(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); + * } + * + *
                    + */, + }, + { + key: "touchEnded", + value: function touchEnded(fxn) { + _main.default.Element._adjustListener( + "touchend", + fxn, + this, + ); + return this; + } /** + * Calls a function when a file is dragged over the element. Calling + * `myElement.dragOver(false)` disables the function. + * + * @method dragOver + * @param {Function|Boolean} fxn function to call when the file is + * dragged over the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * // Drag a file over the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call helloFile() when a + * // file is dragged over + * // the canvas. + * cnv.dragOver(helloFile); + * + * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); + * } + * + * function helloFile() { + * text('hello, file', 50, 50); + * } + * + *
                    + * + *
                    + * + * // Drag a file over the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Say "hello, file" when a + * // file is dragged over + * // the canvas. + * cnv.dragOver(() => { + * text('hello, file', 50, 50); + * }); + * + * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); + * } + * + *
                    + */, + }, + { + key: "dragOver", + value: function dragOver(fxn) { + _main.default.Element._adjustListener( + "dragover", + fxn, + this, + ); + return this; + } /** + * Calls a function when a file is dragged off the element. Calling + * Calling `myElement.dragLeave(false)` disables the function. + * + * @method dragLeave + * @param {Function|Boolean} fxn function to call when the file is + * dragged off the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * // Drag a file over, then off + * // the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call byeFile() when a + * // file is dragged over, + * // then off the canvas. + * cnv.dragLeave(byeFile); + * + * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); + * } + * + * function byeFile() { + * text('bye, file', 50, 50); + * } + * + *
                    + * + *
                    + * + * // Drag a file over, then off + * // the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Say "bye, file" when a + * // file is dragged over, + * // then off the canvas. + * cnv.dragLeave(() => { + * text('bye, file', 50, 50); + * }); + * + * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); + * } + * + *
                    + */, + }, + { + key: "dragLeave", + value: function dragLeave(fxn) { + _main.default.Element._adjustListener( + "dragleave", + fxn, + this, + ); + return this; + } /** + * + * @private + * @static + * @param {String} ev + * @param {Boolean|Function} fxn + * @param {Element} ctx + * @chainable + * @alt + * General handler for event attaching and detaching + */, + }, + { + key: "_setProperty", + /** + * Helper fxn for sharing pixel methods + */ + value: function _setProperty(prop, value) { + this[prop] = value; + }, + }, + ], + [ + { + key: "_adjustListener", + value: function _adjustListener(ev, fxn, ctx) { + if (fxn === false) { + _main.default.Element._detachListener(ev, ctx); + } else { + _main.default.Element._attachListener(ev, fxn, ctx); + } + return this; + } /** + * + * @private + * @static + * @param {String} ev + * @param {Function} fxn + * @param {Element} ctx + */, + }, + { + key: "_attachListener", + value: function _attachListener(ev, fxn, ctx) { + // detach the old listener if there was one + if (ctx._events[ev]) { + _main.default.Element._detachListener(ev, ctx); + } + var f = fxn.bind(ctx); + ctx.elt.addEventListener(ev, f, false); + ctx._events[ev] = f; + } /** + * + * @private + * @static + * @param {String} ev + * @param {Element} ctx + */, + }, + { + key: "_detachListener", + value: function _detachListener(ev, ctx) { + var f = ctx._events[ev]; + ctx.elt.removeEventListener(ev, f, false); + ctx._events[ev] = null; + }, + }, + ], + ); + return _class; + })(); + var _default = _main.default.Element; + exports.default = _default; + }, + { + "./main": 298, + }, + ], + 300: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + var constants = _interopRequireWildcard(_dereq_("./constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + /** + * Thin wrapper around a renderer, to be used for creating a + * graphics buffer object. Use this class if you need + * to draw into an off-screen graphics buffer. The two parameters define the + * width and height in pixels. The fields and methods for this class are + * extensive, but mirror the normal drawing API for p5. + * + * @class p5.Graphics + * @constructor + * @extends p5.Element + * @param {Number} w width + * @param {Number} h height + * @param {Constant} renderer the renderer to use, either P2D or WEBGL + * @param {p5} [pInst] pointer to p5 instance + * @param {HTMLCanvasElement} [canvas] existing html canvas element + */ + + _main.default.Graphics = /*#__PURE__*/ (function (_p5$Element) { + _inherits(_class, _p5$Element); + var _super = _createSuper(_class); + function _class(w, h, renderer, pInst, canvas) { + var _this; + _classCallCheck(this, _class); + var canvasTemp; + if (canvas) { + canvasTemp = canvas; + } else { + canvasTemp = document.createElement("canvas"); + } + _this = _super.call(this, canvasTemp, pInst); + _this.canvas = canvasTemp; + var r = renderer || constants.P2D; + var node = pInst._userNode || document.body; + if (!canvas) { + node.appendChild(_this.canvas); + } // bind methods and props of p5 to the new object + + for (var p in _main.default.prototype) { + if (!_this[p]) { + if (typeof _main.default.prototype[p] === "function") { + _this[p] = _main.default.prototype[p].bind( + _assertThisInitialized(_this), + ); + } else { + _this[p] = _main.default.prototype[p]; + } + } + } + _main.default.prototype._initializeInstanceVariables.apply( + _assertThisInitialized(_this), + ); + _this.width = w; + _this.height = h; + _this._pixelDensity = pInst._pixelDensity; + if (r === constants.WEBGL) { + _this._renderer = new _main.default.RendererGL( + _this.canvas, + _assertThisInitialized(_this), + false, + ); + } else { + _this._renderer = new _main.default.Renderer2D( + _this.canvas, + _assertThisInitialized(_this), + false, + ); + } + pInst._elements.push(_assertThisInitialized(_this)); + Object.defineProperty( + _assertThisInitialized(_this), + "deltaTime", + { + get: function get() { + return this._pInst.deltaTime; + }, + }, + ); + _this._renderer.resize(w, h); + _this._renderer._applyDefaults(); + return _possibleConstructorReturn( + _this, + _assertThisInitialized(_this), + ); + } /** + * Resets certain values such as those modified by functions in the Transform category + * and in the Lights category that are not automatically reset + * with graphics buffer objects. Calling this in draw() will copy the behavior + * of the standard canvas. + * + * @method reset + * @example + * + *
                    + * let pg; + * function setup() { + * createCanvas(100, 100); + * background(0); + * pg = createGraphics(50, 100); + * pg.fill(0); + * frameRate(5); + * } + * + * function draw() { + * image(pg, width / 2, 0); + * pg.background(255); + * // p5.Graphics object behave a bit differently in some cases + * // The normal canvas on the left resets the translate + * // with every loop through draw() + * // the graphics object on the right doesn't automatically reset + * // so translate() is additive and it moves down the screen + * rect(0, 0, width / 2, 5); + * pg.rect(0, 0, width / 2, 5); + * translate(0, 5, 0); + * pg.translate(0, 5, 0); + * } + * function mouseClicked() { + * // if you click you will see that + * // reset() resets the translate back to the initial state + * // of the Graphics object + * pg.reset(); + * } + *
                    + * + * @alt + * A white line on a black background stays still on the top-left half. + * A black line animates from top to bottom on a white background on the right half. + * When clicked, the black line starts back over at the top. + */ + + _createClass(_class, [ + { + key: "reset", + value: function reset() { + this._renderer.resetMatrix(); + if (this._renderer.isP3D) { + this._renderer._update(); + } + } /** + * Removes a Graphics object from the page and frees any resources + * associated with it. + * + * @method remove + * + * @example + *
                    + * let bg; + * function setup() { + * bg = createCanvas(100, 100); + * bg.background(0); + * image(bg, 0, 0); + * bg.remove(); + * } + *
                    + * + *
                    + * let bg; + * function setup() { + * pixelDensity(1); + * createCanvas(100, 100); + * stroke(255); + * fill(0); + * + * // create and draw the background image + * bg = createGraphics(100, 100); + * bg.background(200); + * bg.ellipse(50, 50, 80, 80); + * } + * function draw() { + * let t = millis() / 1000; + * // draw the background + * if (bg) { + * image(bg, frameCount % 100, 0); + * image(bg, frameCount % 100 - 100, 0); + * } + * // draw the foreground + * let p = p5.Vector.fromAngle(t, 35).add(50, 50); + * ellipse(p.x, p.y, 30); + * } + * function mouseClicked() { + * // remove the background + * if (bg) { + * bg.remove(); + * bg = null; + * } + * } + *
                    + * + * @alt + * no image + * a multi-colored circle moving back and forth over a scrolling background. + */, + }, + { + key: "remove", + value: function remove() { + if (this.elt.parentNode) { + this.elt.parentNode.removeChild(this.elt); + } + var idx = this._pInst._elements.indexOf(this); + if (idx !== -1) { + this._pInst._elements.splice(idx, 1); + } + for (var elt_ev in this._events) { + this.elt.removeEventListener(elt_ev, this._events[elt_ev]); + } + } /** + * Creates and returns a new p5.Framebuffer + * inside a p5.Graphics WebGL context. + * + * This takes the same parameters as the global + * createFramebuffer function. + * + * @method createFramebuffer + */, + }, + { + key: "createFramebuffer", + value: function createFramebuffer(options) { + return new _main.default.Framebuffer(this, options); + }, + }, + ]); + return _class; + })(_main.default.Element); + var _default = _main.default.Graphics; + exports.default = _default; + }, + { + "./constants": 286, + "./main": 298, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 301: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + /** + * Main graphics and rendering context, as well as the base API + * implementation for p5.js "core". To be used as the superclass for + * Renderer2D and Renderer3D classes, respectively. + * + * @class p5.Renderer + * @constructor + * @extends p5.Element + * @param {HTMLElement} elt DOM node that is wrapped + * @param {p5} [pInst] pointer to p5 instance + * @param {Boolean} [isMainCanvas] whether we're using it as main canvas + */ + + var Renderer = /*#__PURE__*/ (function (_p5$Element) { + _inherits(Renderer, _p5$Element); + var _super = _createSuper(Renderer); + function Renderer(elt, pInst, isMainCanvas) { + var _this; + _classCallCheck(this, Renderer); + _this = _super.call(this, elt, pInst); + _this.canvas = elt; + _this._pixelsState = pInst; + if (isMainCanvas) { + _this._isMainCanvas = true; + // for pixel method sharing with pimage + _this._pInst._setProperty( + "_curElement", + _assertThisInitialized(_this), + ); + _this._pInst._setProperty("canvas", _this.canvas); + _this._pInst._setProperty("width", _this.width); + _this._pInst._setProperty("height", _this.height); + } else { + // hide if offscreen buffer by default + _this.canvas.style.display = "none"; + _this._styles = []; // non-main elt styles stored in p5.Renderer + } + _this._clipping = false; + _this._clipInvert = false; + _this._textSize = 12; + _this._textLeading = 15; + _this._textFont = "sans-serif"; + _this._textStyle = constants.NORMAL; + _this._textAscent = null; + _this._textDescent = null; + _this._textAlign = constants.LEFT; + _this._textBaseline = constants.BASELINE; + _this._textWrap = constants.WORD; + _this._rectMode = constants.CORNER; + _this._ellipseMode = constants.CENTER; + _this._curveTightness = 0; + _this._imageMode = constants.CORNER; + _this._tint = null; + _this._doStroke = true; + _this._doFill = true; + _this._strokeSet = false; + _this._fillSet = false; + _this._leadingSet = false; + _this._pushPopDepth = 0; + return _this; + } // the renderer should return a 'style' object that it wishes to + // store on the push stack. + + _createClass(Renderer, [ + { + key: "push", + value: function push() { + this._pushPopDepth++; + return { + properties: { + _doStroke: this._doStroke, + _strokeSet: this._strokeSet, + _doFill: this._doFill, + _fillSet: this._fillSet, + _tint: this._tint, + _imageMode: this._imageMode, + _rectMode: this._rectMode, + _ellipseMode: this._ellipseMode, + _textFont: this._textFont, + _textLeading: this._textLeading, + _leadingSet: this._leadingSet, + _textSize: this._textSize, + _textAlign: this._textAlign, + _textBaseline: this._textBaseline, + _textStyle: this._textStyle, + _textWrap: this._textWrap, + }, + }; + }, // a pop() operation is in progress + // the renderer is passed the 'style' object that it returned + // from its push() method. + }, + { + key: "pop", + value: function pop(style) { + this._pushPopDepth--; + if (style.properties) { + // copy the style properties back into the renderer + Object.assign(this, style.properties); + } + }, + }, + { + key: "beginClip", + value: function beginClip() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + if (this._clipping) { + throw new Error( + "It looks like you're trying to clip while already in the middle of clipping. Did you forget to endClip()?", + ); + } + this._clipping = true; + this._clipInvert = options.invert; + }, + }, + { + key: "endClip", + value: function endClip() { + if (!this._clipping) { + throw new Error( + "It looks like you've called endClip() without beginClip(). Did you forget to call beginClip() first?", + ); + } + this._clipping = false; + } /** + * Resize our canvas element. + */, + }, + { + key: "resize", + value: function resize(w, h) { + this.width = w; + this.height = h; + this.elt.width = w * this._pInst._pixelDensity; + this.elt.height = h * this._pInst._pixelDensity; + this.elt.style.width = "".concat(w, "px"); + this.elt.style.height = "".concat(h, "px"); + if (this._isMainCanvas) { + this._pInst._setProperty("width", this.width); + this._pInst._setProperty("height", this.height); + } + }, + }, + { + key: "get", + value: function get(x, y, w, h) { + var pixelsState = this._pixelsState; + var pd = pixelsState._pixelDensity; + var canvas = this.canvas; + if (typeof x === "undefined" && typeof y === "undefined") { + // get() + x = y = 0; + w = pixelsState.width; + h = pixelsState.height; + } else { + x *= pd; + y *= pd; + if (typeof w === "undefined" && typeof h === "undefined") { + // get(x,y) + if ( + x < 0 || + y < 0 || + x >= canvas.width || + y >= canvas.height + ) { + return [0, 0, 0, 0]; + } + return this._getPixel(x, y); + } // get(x,y,w,h) + } + var region = new _main.default.Image(w * pd, h * pd); + region.pixelDensity(pd); + region.canvas + .getContext("2d") + .drawImage( + canvas, + x, + y, + w * pd, + h * pd, + 0, + 0, + w * pd, + h * pd, + ); + return region; + }, + }, + { + key: "textLeading", + value: function textLeading(l) { + if (typeof l === "number") { + this._setProperty("_leadingSet", true); + this._setProperty("_textLeading", l); + return this._pInst; + } + return this._textLeading; + }, + }, + { + key: "textStyle", + value: function textStyle(s) { + if (s) { + if ( + s === constants.NORMAL || + s === constants.ITALIC || + s === constants.BOLD || + s === constants.BOLDITALIC + ) { + this._setProperty("_textStyle", s); + } + return this._applyTextProperties(); + } + return this._textStyle; + }, + }, + { + key: "textAscent", + value: function textAscent() { + if (this._textAscent === null) { + this._updateTextMetrics(); + } + return this._textAscent; + }, + }, + { + key: "textDescent", + value: function textDescent() { + if (this._textDescent === null) { + this._updateTextMetrics(); + } + return this._textDescent; + }, + }, + { + key: "textAlign", + value: function textAlign(h, v) { + if (typeof h !== "undefined") { + this._setProperty("_textAlign", h); + if (typeof v !== "undefined") { + this._setProperty("_textBaseline", v); + } + return this._applyTextProperties(); + } else { + return { + horizontal: this._textAlign, + vertical: this._textBaseline, + }; + } + }, + }, + { + key: "textWrap", + value: function textWrap(wrapStyle) { + this._setProperty("_textWrap", wrapStyle); + return this._textWrap; + }, + }, + { + key: "text", + value: function text(str, x, y, maxWidth, maxHeight) { + var p = this._pInst; + var textWrapStyle = this._textWrap; + var lines; + var line; + var testLine; + var testWidth; + var words; + var chars; + var shiftedY; + var finalMaxHeight = Number.MAX_VALUE; + // fix for #5785 (top of bounding box) + var finalMinHeight = y; + if (!(this._doFill || this._doStroke)) { + return; + } + if (typeof str === "undefined") { + return; + } else if (typeof str !== "string") { + str = str.toString(); + } // Replaces tabs with double-spaces and splits string on any line + // breaks present in the original string + + str = str.replace(/(\t)/g, " "); + lines = str.split("\n"); + if (typeof maxWidth !== "undefined") { + if (this._rectMode === constants.CENTER) { + x -= maxWidth / 2; + } + switch (this._textAlign) { + case constants.CENTER: + x += maxWidth / 2; + break; + case constants.RIGHT: + x += maxWidth; + break; + } + if (typeof maxHeight !== "undefined") { + if (this._rectMode === constants.CENTER) { + y -= maxHeight / 2; + finalMinHeight -= maxHeight / 2; + } + var originalY = y; + var ascent = p.textAscent(); + switch (this._textBaseline) { + case constants.BOTTOM: + shiftedY = y + maxHeight; + y = Math.max(shiftedY, y); + // fix for #5785 (top of bounding box) + finalMinHeight += ascent; + break; + case constants.CENTER: + shiftedY = y + maxHeight / 2; + y = Math.max(shiftedY, y); + // fix for #5785 (top of bounding box) + finalMinHeight += ascent / 2; + break; + } // remember the max-allowed y-position for any line (fix to #928) + + finalMaxHeight = y + maxHeight - ascent; + // fix for #5785 (bottom of bounding box) + if (this._textBaseline === constants.CENTER) { + finalMaxHeight = originalY + maxHeight - ascent / 2; + } + } else { + // no text-height specified, show warning for BOTTOM / CENTER + if ( + this._textBaseline === constants.BOTTOM || + this._textBaseline === constants.CENTER + ) { + // use rectHeight as an approximation for text height + var rectHeight = p.textSize() * this._textLeading; + finalMinHeight = y - rectHeight / 2; + finalMaxHeight = y + rectHeight / 2; + } + } // Render lines of text according to settings of textWrap + // Splits lines at spaces, for loop adds one word + space + // at a time and tests length with next word added + + if (textWrapStyle === constants.WORD) { + var nlines = []; + for ( + var lineIndex = 0; + lineIndex < lines.length; + lineIndex++ + ) { + line = ""; + words = lines[lineIndex].split(" "); + for ( + var wordIndex = 0; + wordIndex < words.length; + wordIndex++ + ) { + testLine = "".concat(line + words[wordIndex]) + " "; + testWidth = this.textWidth(testLine); + if (testWidth > maxWidth && line.length > 0) { + nlines.push(line); + line = "".concat(words[wordIndex]) + " "; + } else { + line = testLine; + } + } + nlines.push(line); + } + var offset = 0; + if (this._textBaseline === constants.CENTER) { + offset = ((nlines.length - 1) * p.textLeading()) / 2; + } else if (this._textBaseline === constants.BOTTOM) { + offset = (nlines.length - 1) * p.textLeading(); + } + for ( + var _lineIndex = 0; + _lineIndex < lines.length; + _lineIndex++ + ) { + line = ""; + words = lines[_lineIndex].split(" "); + for ( + var _wordIndex = 0; + _wordIndex < words.length; + _wordIndex++ + ) { + testLine = "".concat(line + words[_wordIndex]) + " "; + testWidth = this.textWidth(testLine); + if (testWidth > maxWidth && line.length > 0) { + this._renderText( + p, + line.trim(), + x, + y - offset, + finalMaxHeight, + finalMinHeight, + ); + line = "".concat(words[_wordIndex]) + " "; + y += p.textLeading(); + } else { + line = testLine; + } + } + this._renderText( + p, + line.trim(), + x, + y - offset, + finalMaxHeight, + finalMinHeight, + ); + y += p.textLeading(); + } + } else { + var _nlines = []; + for ( + var _lineIndex2 = 0; + _lineIndex2 < lines.length; + _lineIndex2++ + ) { + line = ""; + chars = lines[_lineIndex2].split(""); + for ( + var charIndex = 0; + charIndex < chars.length; + charIndex++ + ) { + testLine = "".concat(line + chars[charIndex]); + testWidth = this.textWidth(testLine); + if (testWidth <= maxWidth) { + line += chars[charIndex]; + } else if (testWidth > maxWidth && line.length > 0) { + _nlines.push(line); + line = "".concat(chars[charIndex]); + } + } + } + _nlines.push(line); + var _offset = 0; + if (this._textBaseline === constants.CENTER) { + _offset = ((_nlines.length - 1) * p.textLeading()) / 2; + } else if (this._textBaseline === constants.BOTTOM) { + _offset = (_nlines.length - 1) * p.textLeading(); + } // Splits lines at characters, for loop adds one char at a time + // and tests length with next char added + + for ( + var _lineIndex3 = 0; + _lineIndex3 < lines.length; + _lineIndex3++ + ) { + line = ""; + chars = lines[_lineIndex3].split(""); + for ( + var _charIndex = 0; + _charIndex < chars.length; + _charIndex++ + ) { + testLine = "".concat(line + chars[_charIndex]); + testWidth = this.textWidth(testLine); + if (testWidth <= maxWidth) { + line += chars[_charIndex]; + } else if (testWidth > maxWidth && line.length > 0) { + this._renderText( + p, + line.trim(), + x, + y - _offset, + finalMaxHeight, + finalMinHeight, + ); + y += p.textLeading(); + line = "".concat(chars[_charIndex]); + } + } + } + this._renderText( + p, + line.trim(), + x, + y - _offset, + finalMaxHeight, + finalMinHeight, + ); + y += p.textLeading(); + } + } else { + // Offset to account for vertically centering multiple lines of text - no + // need to adjust anything for vertical align top or baseline + var _offset2 = 0; + if (this._textBaseline === constants.CENTER) { + _offset2 = ((lines.length - 1) * p.textLeading()) / 2; + } else if (this._textBaseline === constants.BOTTOM) { + _offset2 = (lines.length - 1) * p.textLeading(); + } // Renders lines of text at any line breaks present in the original string + + for (var i = 0; i < lines.length; i++) { + this._renderText( + p, + lines[i], + x, + y - _offset2, + finalMaxHeight, + finalMinHeight - _offset2, + ); + y += p.textLeading(); + } + } + return p; + }, + }, + { + key: "_applyDefaults", + value: function _applyDefaults() { + return this; + } /** + * Helper function to check font type (system or otf) + */, + }, + { + key: "_isOpenType", + value: function _isOpenType() { + var f = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : this._textFont; + return _typeof(f) === "object" && f.font && f.font.supported; + }, + }, + { + key: "_updateTextMetrics", + value: function _updateTextMetrics() { + if (this._isOpenType()) { + this._setProperty( + "_textAscent", + this._textFont._textAscent(), + ); + this._setProperty( + "_textDescent", + this._textFont._textDescent(), + ); + return this; + } // Adapted from http://stackoverflow.com/a/25355178 + + var text = document.createElement("span"); + text.style.fontFamily = this._textFont; + text.style.fontSize = "".concat(this._textSize, "px"); + text.innerHTML = "ABCjgq|"; + var block = document.createElement("div"); + block.style.display = "inline-block"; + block.style.width = "1px"; + block.style.height = "0px"; + var container = document.createElement("div"); + container.appendChild(text); + container.appendChild(block); + container.style.height = "0px"; + container.style.overflow = "hidden"; + document.body.appendChild(container); + block.style.verticalAlign = "baseline"; + var blockOffset = calculateOffset(block); + var textOffset = calculateOffset(text); + var ascent = blockOffset[1] - textOffset[1]; + block.style.verticalAlign = "bottom"; + blockOffset = calculateOffset(block); + textOffset = calculateOffset(text); + var height = blockOffset[1] - textOffset[1]; + var descent = height - ascent; + document.body.removeChild(container); + this._setProperty("_textAscent", ascent); + this._setProperty("_textDescent", descent); + return this; + }, + }, + ]); + return Renderer; + })(_main.default.Element); + /** + * Helper fxn to measure ascent and descent. + * Adapted from http://stackoverflow.com/a/25355178 + */ + function calculateOffset(object) { + var currentLeft = 0, + currentTop = 0; + if (object.offsetParent) { + do { + currentLeft += object.offsetLeft; + currentTop += object.offsetTop; + } while ((object = object.offsetParent)); + } else { + currentLeft += object.offsetLeft; + currentTop += object.offsetTop; + } + return [currentLeft, currentTop]; + } // This caused the test to failed. + + Renderer.prototype.textSize = function (s) { + if (typeof s === "number") { + this._setProperty("_textSize", s); + if (!this._leadingSet) { + // only use a default value if not previously set (#5181) + this._setProperty( + "_textLeading", + s * constants._DEFAULT_LEADMULT, + ); + } + return this._applyTextProperties(); + } + return this._textSize; + }; + _main.default.Renderer = Renderer; + var _default = _main.default.Renderer; + exports.default = _default; + }, + { + "../core/constants": 286, + "./main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.number.constructor": 191, + "core-js/modules/es.object.assign": 194, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.trim": 219, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 302: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.reflect.get"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + var constants = _interopRequireWildcard(_dereq_("./constants")); + _dereq_("./p5.Renderer"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return _get(target, property, receiver || target); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + return object; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * p5.Renderer2D + * The 2D graphics canvas renderer class. + * extends p5.Renderer + */ + + var styleEmpty = "rgba(0,0,0,0)"; + // const alphaThreshold = 0.00125; // minimum visible + var Renderer2D = /*#__PURE__*/ (function (_p5$Renderer) { + _inherits(Renderer2D, _p5$Renderer); + var _super = _createSuper(Renderer2D); + function Renderer2D(elt, pInst, isMainCanvas) { + var _this; + _classCallCheck(this, Renderer2D); + _this = _super.call(this, elt, pInst, isMainCanvas); + _this.drawingContext = _this.canvas.getContext("2d"); + _this._pInst._setProperty("drawingContext", _this.drawingContext); + return _this; + } + _createClass(Renderer2D, [ + { + key: "getFilterGraphicsLayer", + value: function getFilterGraphicsLayer() { + // create hidden webgl renderer if it doesn't exist + if (!this.filterGraphicsLayer) { + // the real _pInst is buried when this is a secondary p5.Graphics + var pInst = + this._pInst instanceof _main.default.Graphics + ? this._pInst._pInst + : this._pInst; + // create secondary layer + this.filterGraphicsLayer = new _main.default.Graphics( + this.width, + this.height, + constants.WEBGL, + pInst, + ); + } + if ( + this.filterGraphicsLayer.width !== this.width || + this.filterGraphicsLayer.height !== this.height + ) { + // Resize the graphics layer + this.filterGraphicsLayer.resizeCanvas( + this.width, + this.height, + ); + } + if ( + this.filterGraphicsLayer.pixelDensity() !== + this._pInst.pixelDensity() + ) { + this.filterGraphicsLayer.pixelDensity( + this._pInst.pixelDensity(), + ); + } + return this.filterGraphicsLayer; + }, + }, + { + key: "_applyDefaults", + value: function _applyDefaults() { + this._cachedFillStyle = this._cachedStrokeStyle = undefined; + this._cachedBlendMode = constants.BLEND; + this._setFill(constants._DEFAULT_FILL); + this._setStroke(constants._DEFAULT_STROKE); + this.drawingContext.lineCap = constants.ROUND; + this.drawingContext.font = "normal 12px sans-serif"; + }, + }, + { + key: "resize", + value: function resize(w, h) { + _get( + _getPrototypeOf(Renderer2D.prototype), + "resize", + this, + ).call(this, w, h); + this.drawingContext.scale( + this._pInst._pixelDensity, + this._pInst._pixelDensity, + ); + }, ////////////////////////////////////////////// + // COLOR | Setting + ////////////////////////////////////////////// + }, + { + key: "background", + value: function background() { + this.drawingContext.save(); + this.resetMatrix(); + if ( + (arguments.length <= 0 + ? undefined + : arguments[0]) instanceof _main.default.Image + ) { + if ( + (arguments.length <= 1 ? undefined : arguments[1]) >= 0 + ) { + // set transparency of background + var img = + arguments.length <= 0 ? undefined : arguments[0]; + this.drawingContext.globalAlpha = + (arguments.length <= 1 ? undefined : arguments[1]) / + 255; + this._pInst.image(img, 0, 0, this.width, this.height); + } else { + this._pInst.image( + arguments.length <= 0 ? undefined : arguments[0], + 0, + 0, + this.width, + this.height, + ); + } + } else { + var _this$_pInst; + var curFill = this._getFill(); + // create background rect + var color = (_this$_pInst = this._pInst).color.apply( + _this$_pInst, + arguments, + ); + //accessible Outputs + if (this._pInst._addAccsOutput()) { + this._pInst._accsBackground(color.levels); + } + var newFill = color.toString(); + this._setFill(newFill); + if (this._isErasing) { + this.blendMode(this._cachedBlendMode); + } + this.drawingContext.fillRect(0, 0, this.width, this.height); + // reset fill + this._setFill(curFill); + if (this._isErasing) { + this._pInst.erase(); + } + } + this.drawingContext.restore(); + }, + }, + { + key: "clear", + value: function clear() { + this.drawingContext.save(); + this.resetMatrix(); + this.drawingContext.clearRect(0, 0, this.width, this.height); + this.drawingContext.restore(); + }, + }, + { + key: "fill", + value: function fill() { + var _this$_pInst2; + var color = (_this$_pInst2 = this._pInst).color.apply( + _this$_pInst2, + arguments, + ); + this._setFill(color.toString()); + //accessible Outputs + if (this._pInst._addAccsOutput()) { + this._pInst._accsCanvasColors("fill", color.levels); + } + }, + }, + { + key: "stroke", + value: function stroke() { + var _this$_pInst3; + var color = (_this$_pInst3 = this._pInst).color.apply( + _this$_pInst3, + arguments, + ); + this._setStroke(color.toString()); + //accessible Outputs + if (this._pInst._addAccsOutput()) { + this._pInst._accsCanvasColors("stroke", color.levels); + } + }, + }, + { + key: "erase", + value: function erase(opacityFill, opacityStroke) { + if (!this._isErasing) { + // cache the fill style + this._cachedFillStyle = this.drawingContext.fillStyle; + var newFill = this._pInst + .color(255, opacityFill) + .toString(); + this.drawingContext.fillStyle = newFill; + // cache the stroke style + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + var newStroke = this._pInst + .color(255, opacityStroke) + .toString(); + this.drawingContext.strokeStyle = newStroke; + // cache blendMode + var tempBlendMode = this._cachedBlendMode; + this.blendMode(constants.REMOVE); + this._cachedBlendMode = tempBlendMode; + this._isErasing = true; + } + }, + }, + { + key: "noErase", + value: function noErase() { + if (this._isErasing) { + this.drawingContext.fillStyle = this._cachedFillStyle; + this.drawingContext.strokeStyle = this._cachedStrokeStyle; + this.blendMode(this._cachedBlendMode); + this._isErasing = false; + } + }, + }, + { + key: "beginClip", + value: function beginClip() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + _get( + _getPrototypeOf(Renderer2D.prototype), + "beginClip", + this, + ).call(this, options); + // cache the fill style + this._cachedFillStyle = this.drawingContext.fillStyle; + var newFill = this._pInst.color(255, 0).toString(); + this.drawingContext.fillStyle = newFill; + // cache the stroke style + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + var newStroke = this._pInst.color(255, 0).toString(); + this.drawingContext.strokeStyle = newStroke; + // cache blendMode + var tempBlendMode = this._cachedBlendMode; + this.blendMode(constants.BLEND); + this._cachedBlendMode = tempBlendMode; + // Start a new path. Everything from here on out should become part of this + // one path so that we can clip to the whole thing. + this.drawingContext.beginPath(); + if (this._clipInvert) { + // Slight hack: draw a big rectangle over everything with reverse winding + // order. This is hopefully large enough to cover most things. + this.drawingContext.moveTo( + -2 * this.width, + -2 * this.height, + ); + this.drawingContext.lineTo( + -2 * this.width, + 2 * this.height, + ); + this.drawingContext.lineTo(2 * this.width, 2 * this.height); + this.drawingContext.lineTo( + 2 * this.width, + -2 * this.height, + ); + this.drawingContext.closePath(); + } + }, + }, + { + key: "endClip", + value: function endClip() { + this._doFillStrokeClose(); + this.drawingContext.clip(); + _get( + _getPrototypeOf(Renderer2D.prototype), + "endClip", + this, + ).call(this); + this.drawingContext.fillStyle = this._cachedFillStyle; + this.drawingContext.strokeStyle = this._cachedStrokeStyle; + this.blendMode(this._cachedBlendMode); + }, ////////////////////////////////////////////// + // IMAGE | Loading & Displaying + ////////////////////////////////////////////// + }, + { + key: "image", + value: function image( + img, + sx, + sy, + sWidth, + sHeight, + dx, + dy, + dWidth, + dHeight, + ) { + var cnv; + if (img.gifProperties) { + img._animateGif(this._pInst); + } + try { + if ( + _main.default.MediaElement && + img instanceof _main.default.MediaElement + ) { + img._ensureCanvas(); + } + if (this._tint && img.canvas) { + cnv = this._getTintedImageCanvas(img); + } + if (!cnv) { + cnv = img.canvas || img.elt; + } + var s = 1; + if (img.width && img.width > 0) { + s = cnv.width / img.width; + } + if (this._isErasing) { + this.blendMode(this._cachedBlendMode); + } + this.drawingContext.drawImage( + cnv, + s * sx, + s * sy, + s * sWidth, + s * sHeight, + dx, + dy, + dWidth, + dHeight, + ); + if (this._isErasing) { + this._pInst.erase(); + } + } catch (e) { + if (e.name !== "NS_ERROR_NOT_AVAILABLE") { + throw e; + } + } + }, + }, + { + key: "_getTintedImageCanvas", + value: function _getTintedImageCanvas(img) { + if (!img.canvas) { + return img; + } + if (!img.tintCanvas) { + // Once an image has been tinted, keep its tint canvas + // around so we don't need to re-incur the cost of + // creating a new one for each tint + img.tintCanvas = document.createElement("canvas"); + } // Keep the size of the tint canvas up-to-date + + if (img.tintCanvas.width !== img.canvas.width) { + img.tintCanvas.width = img.canvas.width; + } + if (img.tintCanvas.height !== img.canvas.height) { + img.tintCanvas.height = img.canvas.height; + } // Goal: multiply the r,g,b,a values of the source by + // the r,g,b,a values of the tint color + + var ctx = img.tintCanvas.getContext("2d"); + ctx.save(); + ctx.clearRect(0, 0, img.canvas.width, img.canvas.height); + if ( + this._tint[0] < 255 || + this._tint[1] < 255 || + this._tint[2] < 255 + ) { + // Color tint: we need to use the multiply blend mode to change the colors. + // However, the canvas implementation of this destroys the alpha channel of + // the image. To accommodate, we first get a version of the image with full + // opacity everywhere, tint using multiply, and then use the destination-in + // blend mode to restore the alpha channel again. + // Start with the original image + ctx.drawImage(img.canvas, 0, 0); + // This blend mode makes everything opaque but forces the luma to match + // the original image again + ctx.globalCompositeOperation = "luminosity"; + ctx.drawImage(img.canvas, 0, 0); + // This blend mode forces the hue and chroma to match the original image. + // After this we should have the original again, but with full opacity. + ctx.globalCompositeOperation = "color"; + ctx.drawImage(img.canvas, 0, 0); + // Apply color tint + ctx.globalCompositeOperation = "multiply"; + ctx.fillStyle = "rgb(".concat( + this._tint.slice(0, 3).join(", "), + ")", + ); + ctx.fillRect(0, 0, img.canvas.width, img.canvas.height); + // Replace the alpha channel with the original alpha * the alpha tint + ctx.globalCompositeOperation = "destination-in"; + ctx.globalAlpha = this._tint[3] / 255; + ctx.drawImage(img.canvas, 0, 0); + } else { + // If we only need to change the alpha, we can skip all the extra work! + ctx.globalAlpha = this._tint[3] / 255; + ctx.drawImage(img.canvas, 0, 0); + } + ctx.restore(); + return img.tintCanvas; + }, ////////////////////////////////////////////// + // IMAGE | Pixels + ////////////////////////////////////////////// + }, + { + key: "blendMode", + value: function blendMode(mode) { + if (mode === constants.SUBTRACT) { + console.warn( + "blendMode(SUBTRACT) only works in WEBGL mode.", + ); + } else if ( + mode === constants.BLEND || + mode === constants.REMOVE || + mode === constants.DARKEST || + mode === constants.LIGHTEST || + mode === constants.DIFFERENCE || + mode === constants.MULTIPLY || + mode === constants.EXCLUSION || + mode === constants.SCREEN || + mode === constants.REPLACE || + mode === constants.OVERLAY || + mode === constants.HARD_LIGHT || + mode === constants.SOFT_LIGHT || + mode === constants.DODGE || + mode === constants.BURN || + mode === constants.ADD + ) { + this._cachedBlendMode = mode; + this.drawingContext.globalCompositeOperation = mode; + } else { + throw new Error("Mode ".concat(mode, " not recognized.")); + } + }, + }, + { + key: "blend", + value: function blend() { + var currBlend = this.drawingContext.globalCompositeOperation; + for ( + var _len = arguments.length, + args = new Array(_len), + _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + var blendMode = args[args.length - 1]; + var copyArgs = Array.prototype.slice.call( + args, + 0, + args.length - 1, + ); + this.drawingContext.globalCompositeOperation = blendMode; + _main.default.prototype.copy.apply(this, copyArgs); + this.drawingContext.globalCompositeOperation = currBlend; + }, // p5.Renderer2D.prototype.get = p5.Renderer.prototype.get; + // .get() is not overridden + // x,y are canvas-relative (pre-scaled by _pixelDensity) + }, + { + key: "_getPixel", + value: function _getPixel(x, y) { + var imageData, index; + imageData = this.drawingContext.getImageData(x, y, 1, 1).data; + index = 0; + return [ + imageData[index + 0], + imageData[index + 1], + imageData[index + 2], + imageData[index + 3], + ]; + }, + }, + { + key: "loadPixels", + value: function loadPixels() { + var pixelsState = this._pixelsState; // if called by p5.Image + var pd = pixelsState._pixelDensity; + var w = this.width * pd; + var h = this.height * pd; + var imageData = this.drawingContext.getImageData(0, 0, w, h); + // @todo this should actually set pixels per object, so diff buffers can + // have diff pixel arrays. + pixelsState._setProperty("imageData", imageData); + pixelsState._setProperty("pixels", imageData.data); + }, + }, + { + key: "set", + value: function set(x, y, imgOrCol) { + // round down to get integer numbers + x = Math.floor(x); + y = Math.floor(y); + var pixelsState = this._pixelsState; + if (imgOrCol instanceof _main.default.Image) { + this.drawingContext.save(); + this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); + this.drawingContext.scale( + pixelsState._pixelDensity, + pixelsState._pixelDensity, + ); + this.drawingContext.clearRect( + x, + y, + imgOrCol.width, + imgOrCol.height, + ); + this.drawingContext.drawImage(imgOrCol.canvas, x, y); + this.drawingContext.restore(); + } else { + var r = 0, + g = 0, + b = 0, + a = 0; + var idx = + 4 * + (y * + pixelsState._pixelDensity * + (this.width * pixelsState._pixelDensity) + + x * pixelsState._pixelDensity); + if (!pixelsState.imageData) { + pixelsState.loadPixels.call(pixelsState); + } + if (typeof imgOrCol === "number") { + if (idx < pixelsState.pixels.length) { + r = imgOrCol; + g = imgOrCol; + b = imgOrCol; + a = 255; + //this.updatePixels.call(this); + } + } else if (imgOrCol instanceof Array) { + if (imgOrCol.length < 4) { + throw new Error( + "pixel array must be of the form [R, G, B, A]", + ); + } + if (idx < pixelsState.pixels.length) { + r = imgOrCol[0]; + g = imgOrCol[1]; + b = imgOrCol[2]; + a = imgOrCol[3]; + //this.updatePixels.call(this); + } + } else if (imgOrCol instanceof _main.default.Color) { + if (idx < pixelsState.pixels.length) { + r = imgOrCol.levels[0]; + g = imgOrCol.levels[1]; + b = imgOrCol.levels[2]; + a = imgOrCol.levels[3]; + //this.updatePixels.call(this); + } + } // loop over pixelDensity * pixelDensity + + for (var i = 0; i < pixelsState._pixelDensity; i++) { + for (var j = 0; j < pixelsState._pixelDensity; j++) { + // loop over + idx = + 4 * + ((y * pixelsState._pixelDensity + j) * + this.width * + pixelsState._pixelDensity + + (x * pixelsState._pixelDensity + i)); + pixelsState.pixels[idx] = r; + pixelsState.pixels[idx + 1] = g; + pixelsState.pixels[idx + 2] = b; + pixelsState.pixels[idx + 3] = a; + } + } + } + }, + }, + { + key: "updatePixels", + value: function updatePixels(x, y, w, h) { + var pixelsState = this._pixelsState; + var pd = pixelsState._pixelDensity; + if ( + x === undefined && + y === undefined && + w === undefined && + h === undefined + ) { + x = 0; + y = 0; + w = this.width; + h = this.height; + } + x *= pd; + y *= pd; + w *= pd; + h *= pd; + if (this.gifProperties) { + this.gifProperties.frames[ + this.gifProperties.displayIndex + ].image = pixelsState.imageData; + } + this.drawingContext.putImageData( + pixelsState.imageData, + x, + y, + 0, + 0, + w, + h, + ); + }, ////////////////////////////////////////////// + // SHAPE | 2D Primitives + ////////////////////////////////////////////// + /** + * Generate a cubic Bezier representing an arc on the unit circle of total + * angle `size` radians, beginning `start` radians above the x-axis. Up to + * four of these curves are combined to make a full arc. + * + * See ecridge.com/bezier.pdf for an explanation of the method. + */ + }, + { + key: "_acuteArcToBezier", + value: function _acuteArcToBezier(start, size) { + // Evaluate constants. + var alpha = size / 2, + cos_alpha = Math.cos(alpha), + sin_alpha = Math.sin(alpha), + cot_alpha = 1 / Math.tan(alpha), + // This is how far the arc needs to be rotated. + phi = start + alpha, + cos_phi = Math.cos(phi), + sin_phi = Math.sin(phi), + lambda = (4 - cos_alpha) / 3, + mu = sin_alpha + (cos_alpha - lambda) * cot_alpha; + // Return rotated waypoints. + return { + ax: Math.cos(start).toFixed(7), + ay: Math.sin(start).toFixed(7), + bx: (lambda * cos_phi + mu * sin_phi).toFixed(7), + by: (lambda * sin_phi - mu * cos_phi).toFixed(7), + cx: (lambda * cos_phi - mu * sin_phi).toFixed(7), + cy: (lambda * sin_phi + mu * cos_phi).toFixed(7), + dx: Math.cos(start + size).toFixed(7), + dy: Math.sin(start + size).toFixed(7), + }; + } /* + * This function requires that: + * + * 0 <= start < TWO_PI + * + * start <= stop < start + TWO_PI + */, + }, + { + key: "arc", + value: function arc(x, y, w, h, start, stop, mode) { + var ctx = this.drawingContext; + var rx = w / 2; + var ry = h / 2; + var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. + var arcToDraw = 0; + var curves = []; + x += rx; + y += ry; + // Create curves + while (stop - start >= epsilon) { + arcToDraw = Math.min(stop - start, constants.HALF_PI); + curves.push(this._acuteArcToBezier(start, arcToDraw)); + start += arcToDraw; + } // Fill curves + + if (this._doFill) { + if (!this._clipping) ctx.beginPath(); + curves.forEach(function (curve, index) { + if (index === 0) { + ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); + } /* eslint-disable indent */ + + ctx.bezierCurveTo( + x + curve.bx * rx, + y + curve.by * ry, + x + curve.cx * rx, + y + curve.cy * ry, + x + curve.dx * rx, + y + curve.dy * ry, + ); + /* eslint-enable indent */ + }); + if (mode === constants.PIE || mode == null) { + ctx.lineTo(x, y); + } + ctx.closePath(); + if (!this._clipping) ctx.fill(); + } // Stroke curves + + if (this._doStroke) { + if (!this._clipping) ctx.beginPath(); + curves.forEach(function (curve, index) { + if (index === 0) { + ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); + } /* eslint-disable indent */ + + ctx.bezierCurveTo( + x + curve.bx * rx, + y + curve.by * ry, + x + curve.cx * rx, + y + curve.cy * ry, + x + curve.dx * rx, + y + curve.dy * ry, + ); + /* eslint-enable indent */ + }); + if (mode === constants.PIE) { + ctx.lineTo(x, y); + ctx.closePath(); + } else if (mode === constants.CHORD) { + ctx.closePath(); + } + if (!this._clipping) ctx.stroke(); + } + return this; + }, + }, + { + key: "ellipse", + value: function ellipse(args) { + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + var x = parseFloat(args[0]), + y = parseFloat(args[1]), + w = parseFloat(args[2]), + h = parseFloat(args[3]); + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + var kappa = 0.5522847498, + // control point offset horizontal + ox = (w / 2) * kappa, + // control point offset vertical + oy = (h / 2) * kappa, + // x-end + xe = x + w, + // y-end + ye = y + h, + // x-middle + xm = x + w / 2, + ym = y + h / 2; // y-middle + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x, ym); + ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); + ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); + ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); + ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); + if (!this._clipping && doFill) { + ctx.fill(); + } + if (!this._clipping && doStroke) { + ctx.stroke(); + } + }, + }, + { + key: "line", + value: function line(x1, y1, x2, y2) { + var ctx = this.drawingContext; + if (!this._doStroke) { + return this; + } else if (this._getStroke() === styleEmpty) { + return this; + } + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + return this; + }, + }, + { + key: "point", + value: function point(x, y) { + var ctx = this.drawingContext; + if (!this._doStroke) { + return this; + } else if (this._getStroke() === styleEmpty) { + return this; + } + var s = this._getStroke(); + var f = this._getFill(); + if (!this._clipping) { + // swapping fill color to stroke and back after for correct point rendering + this._setFill(s); + } + if (!this._clipping) ctx.beginPath(); + ctx.arc(x, y, ctx.lineWidth / 2, 0, constants.TWO_PI, false); + if (!this._clipping) { + ctx.fill(); + this._setFill(f); + } + }, + }, + { + key: "quad", + value: function quad(x1, y1, x2, y2, x3, y3, x4, y4) { + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x3, y3); + ctx.lineTo(x4, y4); + ctx.closePath(); + if (!this._clipping && doFill) { + ctx.fill(); + } + if (!this._clipping && doStroke) { + ctx.stroke(); + } + return this; + }, + }, + { + key: "rect", + value: function rect(args) { + var x = args[0]; + var y = args[1]; + var w = args[2]; + var h = args[3]; + var tl = args[4]; + var tr = args[5]; + var br = args[6]; + var bl = args[7]; + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + if (!this._clipping) ctx.beginPath(); + if (typeof tl === "undefined") { + // No rounded corners + ctx.rect(x, y, w, h); + } else { + // At least one rounded corner + // Set defaults when not specified + if (typeof tr === "undefined") { + tr = tl; + } + if (typeof br === "undefined") { + br = tr; + } + if (typeof bl === "undefined") { + bl = br; + } // corner rounding must always be positive + + var absW = Math.abs(w); + var absH = Math.abs(h); + var hw = absW / 2; + var hh = absH / 2; + // Clip radii + if (absW < 2 * tl) { + tl = hw; + } + if (absH < 2 * tl) { + tl = hh; + } + if (absW < 2 * tr) { + tr = hw; + } + if (absH < 2 * tr) { + tr = hh; + } + if (absW < 2 * br) { + br = hw; + } + if (absH < 2 * br) { + br = hh; + } + if (absW < 2 * bl) { + bl = hw; + } + if (absH < 2 * bl) { + bl = hh; + } // Draw shape + + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x + tl, y); + ctx.arcTo(x + w, y, x + w, y + h, tr); + ctx.arcTo(x + w, y + h, x, y + h, br); + ctx.arcTo(x, y + h, x, y, bl); + ctx.arcTo(x, y, x + w, y, tl); + ctx.closePath(); + } + if (!this._clipping && this._doFill) { + ctx.fill(); + } + if (!this._clipping && this._doStroke) { + ctx.stroke(); + } + return this; + }, + }, + { + key: "triangle", + value: function triangle(args) { + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + var x1 = args[0], + y1 = args[1]; + var x2 = args[2], + y2 = args[3]; + var x3 = args[4], + y3 = args[5]; + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x3, y3); + ctx.closePath(); + if (!this._clipping && doFill) { + ctx.fill(); + } + if (!this._clipping && doStroke) { + ctx.stroke(); + } + }, + }, + { + key: "endShape", + value: function endShape( + mode, + vertices, + isCurve, + isBezier, + isQuadratic, + isContour, + shapeKind, + ) { + if (vertices.length === 0) { + return this; + } + if (!this._doStroke && !this._doFill) { + return this; + } + var closeShape = mode === constants.CLOSE; + var v; + if (closeShape && !isContour) { + vertices.push(vertices[0]); + } + var i, j; + var numVerts = vertices.length; + if (isCurve && shapeKind === null) { + if (numVerts > 3) { + var b = [], + s = 1 - this._curveTightness; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo( + vertices[1][0], + vertices[1][1], + ); + for (i = 1; i + 2 < numVerts; i++) { + v = vertices[i]; + b[0] = [v[0], v[1]]; + b[1] = [ + v[0] + + (s * vertices[i + 1][0] - s * vertices[i - 1][0]) / + 6, + v[1] + + (s * vertices[i + 1][1] - s * vertices[i - 1][1]) / + 6, + ]; + b[2] = [ + vertices[i + 1][0] + + (s * vertices[i][0] - s * vertices[i + 2][0]) / 6, + vertices[i + 1][1] + + (s * vertices[i][1] - s * vertices[i + 2][1]) / 6, + ]; + b[3] = [vertices[i + 1][0], vertices[i + 1][1]]; + this.drawingContext.bezierCurveTo( + b[1][0], + b[1][1], + b[2][0], + b[2][1], + b[3][0], + b[3][1], + ); + } + if (closeShape) { + this.drawingContext.lineTo( + vertices[i + 1][0], + vertices[i + 1][1], + ); + } + this._doFillStrokeClose(closeShape); + } + } else if (isBezier && shapeKind === null) { + if (!this._clipping) this.drawingContext.beginPath(); + for (i = 0; i < numVerts; i++) { + if (vertices[i].isVert) { + if (vertices[i].moveTo) { + this.drawingContext.moveTo( + vertices[i][0], + vertices[i][1], + ); + } else { + this.drawingContext.lineTo( + vertices[i][0], + vertices[i][1], + ); + } + } else { + this.drawingContext.bezierCurveTo( + vertices[i][0], + vertices[i][1], + vertices[i][2], + vertices[i][3], + vertices[i][4], + vertices[i][5], + ); + } + } + this._doFillStrokeClose(closeShape); + } else if (isQuadratic && shapeKind === null) { + if (!this._clipping) this.drawingContext.beginPath(); + for (i = 0; i < numVerts; i++) { + if (vertices[i].isVert) { + if (vertices[i].moveTo) { + this.drawingContext.moveTo( + vertices[i][0], + vertices[i][1], + ); + } else { + this.drawingContext.lineTo( + vertices[i][0], + vertices[i][1], + ); + } + } else { + this.drawingContext.quadraticCurveTo( + vertices[i][0], + vertices[i][1], + vertices[i][2], + vertices[i][3], + ); + } + } + this._doFillStrokeClose(closeShape); + } else { + if (shapeKind === constants.POINTS) { + for (i = 0; i < numVerts; i++) { + v = vertices[i]; + if (this._doStroke) { + this._pInst.stroke(v[6]); + } + this._pInst.point(v[0], v[1]); + } + } else if (shapeKind === constants.LINES) { + for (i = 0; i + 1 < numVerts; i += 2) { + v = vertices[i]; + if (this._doStroke) { + this._pInst.stroke(vertices[i + 1][6]); + } + this._pInst.line( + v[0], + v[1], + vertices[i + 1][0], + vertices[i + 1][1], + ); + } + } else if (shapeKind === constants.TRIANGLES) { + for (i = 0; i + 2 < numVerts; i += 3) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(v[0], v[1]); + this.drawingContext.lineTo( + vertices[i + 1][0], + vertices[i + 1][1], + ); + this.drawingContext.lineTo( + vertices[i + 2][0], + vertices[i + 2][1], + ); + this.drawingContext.closePath(); + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 2][5]); + this.drawingContext.fill(); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 2][6]); + this.drawingContext.stroke(); + } + } + } else if (shapeKind === constants.TRIANGLE_STRIP) { + for (i = 0; i + 1 < numVerts; i++) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo( + vertices[i + 1][0], + vertices[i + 1][1], + ); + this.drawingContext.lineTo(v[0], v[1]); + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 1][6]); + } + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 1][5]); + } + if (i + 2 < numVerts) { + this.drawingContext.lineTo( + vertices[i + 2][0], + vertices[i + 2][1], + ); + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 2][6]); + } + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 2][5]); + } + } + this._doFillStrokeClose(closeShape); + } + } else if (shapeKind === constants.TRIANGLE_FAN) { + if (numVerts > 2) { + // For performance reasons, try to batch as many of the + // fill and stroke calls as possible. + if (!this._clipping) this.drawingContext.beginPath(); + for (i = 2; i < numVerts; i++) { + v = vertices[i]; + this.drawingContext.moveTo( + vertices[0][0], + vertices[0][1], + ); + this.drawingContext.lineTo( + vertices[i - 1][0], + vertices[i - 1][1], + ); + this.drawingContext.lineTo(v[0], v[1]); + this.drawingContext.lineTo( + vertices[0][0], + vertices[0][1], + ); + // If the next colour is going to be different, stroke / fill now + if (i < numVerts - 1) { + if ( + (this._doFill && v[5] !== vertices[i + 1][5]) || + (this._doStroke && v[6] !== vertices[i + 1][6]) + ) { + if (!this._clipping && this._doFill) { + this._pInst.fill(v[5]); + this.drawingContext.fill(); + this._pInst.fill(vertices[i + 1][5]); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(v[6]); + this.drawingContext.stroke(); + this._pInst.stroke(vertices[i + 1][6]); + } + this.drawingContext.closePath(); + if (!this._clipping) + this.drawingContext.beginPath(); // Begin the next one + } + } + } + this._doFillStrokeClose(closeShape); + } + } else if (shapeKind === constants.QUADS) { + for (i = 0; i + 3 < numVerts; i += 4) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(v[0], v[1]); + for (j = 1; j < 4; j++) { + this.drawingContext.lineTo( + vertices[i + j][0], + vertices[i + j][1], + ); + } + this.drawingContext.lineTo(v[0], v[1]); + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 3][5]); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 3][6]); + } + this._doFillStrokeClose(closeShape); + } + } else if (shapeKind === constants.QUAD_STRIP) { + if (numVerts > 3) { + for (i = 0; i + 1 < numVerts; i += 2) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + if (i + 3 < numVerts) { + this.drawingContext.moveTo( + vertices[i + 2][0], + vertices[i + 2][1], + ); + this.drawingContext.lineTo(v[0], v[1]); + this.drawingContext.lineTo( + vertices[i + 1][0], + vertices[i + 1][1], + ); + this.drawingContext.lineTo( + vertices[i + 3][0], + vertices[i + 3][1], + ); + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 3][5]); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 3][6]); + } + } else { + this.drawingContext.moveTo(v[0], v[1]); + this.drawingContext.lineTo( + vertices[i + 1][0], + vertices[i + 1][1], + ); + } + this._doFillStrokeClose(closeShape); + } + } + } else { + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo( + vertices[0][0], + vertices[0][1], + ); + for (i = 1; i < numVerts; i++) { + v = vertices[i]; + if (v.isVert) { + if (v.moveTo) { + if (closeShape) this.drawingContext.closePath(); + this.drawingContext.moveTo(v[0], v[1]); + } else { + this.drawingContext.lineTo(v[0], v[1]); + } + } + } + this._doFillStrokeClose(closeShape); + } + } + isCurve = false; + isBezier = false; + isQuadratic = false; + isContour = false; + if (closeShape) { + vertices.pop(); + } + return this; + }, ////////////////////////////////////////////// + // SHAPE | Attributes + ////////////////////////////////////////////// + }, + { + key: "strokeCap", + value: function strokeCap(cap) { + if ( + cap === constants.ROUND || + cap === constants.SQUARE || + cap === constants.PROJECT + ) { + this.drawingContext.lineCap = cap; + } + return this; + }, + }, + { + key: "strokeJoin", + value: function strokeJoin(join) { + if ( + join === constants.ROUND || + join === constants.BEVEL || + join === constants.MITER + ) { + this.drawingContext.lineJoin = join; + } + return this; + }, + }, + { + key: "strokeWeight", + value: function strokeWeight(w) { + if (typeof w === "undefined" || w === 0) { + // hack because lineWidth 0 doesn't work + this.drawingContext.lineWidth = 0.0001; + } else { + this.drawingContext.lineWidth = w; + } + return this; + }, + }, + { + key: "_getFill", + value: function _getFill() { + if (!this._cachedFillStyle) { + this._cachedFillStyle = this.drawingContext.fillStyle; + } + return this._cachedFillStyle; + }, + }, + { + key: "_setFill", + value: function _setFill(fillStyle) { + if (fillStyle !== this._cachedFillStyle) { + this.drawingContext.fillStyle = fillStyle; + this._cachedFillStyle = fillStyle; + } + }, + }, + { + key: "_getStroke", + value: function _getStroke() { + if (!this._cachedStrokeStyle) { + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + } + return this._cachedStrokeStyle; + }, + }, + { + key: "_setStroke", + value: function _setStroke(strokeStyle) { + if (strokeStyle !== this._cachedStrokeStyle) { + this.drawingContext.strokeStyle = strokeStyle; + this._cachedStrokeStyle = strokeStyle; + } + }, ////////////////////////////////////////////// + // SHAPE | Curves + ////////////////////////////////////////////// + }, + { + key: "bezier", + value: function bezier(x1, y1, x2, y2, x3, y3, x4, y4) { + this._pInst.beginShape(); + this._pInst.vertex(x1, y1); + this._pInst.bezierVertex(x2, y2, x3, y3, x4, y4); + this._pInst.endShape(); + return this; + }, + }, + { + key: "curve", + value: function curve(x1, y1, x2, y2, x3, y3, x4, y4) { + this._pInst.beginShape(); + this._pInst.curveVertex(x1, y1); + this._pInst.curveVertex(x2, y2); + this._pInst.curveVertex(x3, y3); + this._pInst.curveVertex(x4, y4); + this._pInst.endShape(); + return this; + }, ////////////////////////////////////////////// + // SHAPE | Vertex + ////////////////////////////////////////////// + }, + { + key: "_doFillStrokeClose", + value: function _doFillStrokeClose(closeShape) { + if (closeShape) { + this.drawingContext.closePath(); + } + if (!this._clipping && this._doFill) { + this.drawingContext.fill(); + } + if (!this._clipping && this._doStroke) { + this.drawingContext.stroke(); + } + }, ////////////////////////////////////////////// + // TRANSFORM + ////////////////////////////////////////////// + }, + { + key: "applyMatrix", + value: function applyMatrix(a, b, c, d, e, f) { + this.drawingContext.transform(a, b, c, d, e, f); + }, + }, + { + key: "resetMatrix", + value: function resetMatrix() { + this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); + this.drawingContext.scale( + this._pInst._pixelDensity, + this._pInst._pixelDensity, + ); + return this; + }, + }, + { + key: "rotate", + value: function rotate(rad) { + this.drawingContext.rotate(rad); + }, + }, + { + key: "scale", + value: function scale(x, y) { + this.drawingContext.scale(x, y); + return this; + }, + }, + { + key: "translate", + value: function translate(x, y) { + // support passing a vector as the 1st parameter + if (x instanceof _main.default.Vector) { + y = x.y; + x = x.x; + } + this.drawingContext.translate(x, y); + return this; + }, ////////////////////////////////////////////// + // TYPOGRAPHY + // + ////////////////////////////////////////////// + }, + { + key: "_renderText", + value: function _renderText(p, line, x, y, maxY, minY) { + if (y < minY || y >= maxY) { + return; // don't render lines beyond our minY/maxY bounds (see #5785) + } + p.push(); // fix to #803 + if (!this._isOpenType()) { + // a system/browser font + // no stroke unless specified by user + if (this._doStroke && this._strokeSet) { + this.drawingContext.strokeText(line, x, y); + } + if (!this._clipping && this._doFill) { + // if fill hasn't been set by user, use default text fill + if (!this._fillSet) { + this._setFill(constants._DEFAULT_TEXT_FILL); + } + this.drawingContext.fillText(line, x, y); + } + } else { + // an opentype font, let it handle the rendering + this._textFont._renderPath(line, x, y, { + renderer: this, + }); + } + p.pop(); + return p; + }, + }, + { + key: "textWidth", + value: function textWidth(s) { + if (this._isOpenType()) { + return this._textFont._textWidth(s, this._textSize); + } + return this.drawingContext.measureText(s).width; + }, + }, + { + key: "_applyTextProperties", + value: function _applyTextProperties() { + var font; + var p = this._pInst; + this._setProperty("_textAscent", null); + this._setProperty("_textDescent", null); + font = this._textFont; + if (this._isOpenType()) { + font = this._textFont.font.familyName; + this._setProperty( + "_textStyle", + this._textFont.font.styleName, + ); + } + this.drawingContext.font = "" + .concat(this._textStyle || "normal", " ") + .concat(this._textSize || 12, "px ") + .concat(font || "sans-serif"); + this.drawingContext.textAlign = this._textAlign; + if (this._textBaseline === constants.CENTER) { + this.drawingContext.textBaseline = constants._CTX_MIDDLE; + } else { + this.drawingContext.textBaseline = this._textBaseline; + } + return p; + }, ////////////////////////////////////////////// + // STRUCTURE + ////////////////////////////////////////////// + // a push() operation is in progress. + // the renderer should return a 'style' object that it wishes to + // store on the push stack. + // derived renderers should call the base class' push() method + // to fetch the base style object. + }, + { + key: "push", + value: function push() { + this.drawingContext.save(); + // get the base renderer style + return _get( + _getPrototypeOf(Renderer2D.prototype), + "push", + this, + ).call(this); + }, // a pop() operation is in progress + // the renderer is passed the 'style' object that it returned + // from its push() method. + // derived renderers should pass this object to their base + // class' pop method + }, + { + key: "pop", + value: function pop(style) { + this.drawingContext.restore(); + // Re-cache the fill / stroke state + this._cachedFillStyle = this.drawingContext.fillStyle; + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + _get(_getPrototypeOf(Renderer2D.prototype), "pop", this).call( + this, + style, + ); + }, + }, + ]); + return Renderer2D; + })(_main.default.Renderer); // Fix test + Renderer2D.prototype.text = function ( + str, + x, + y, + maxWidth, + maxHeight, + ) { + var baselineHacked; + // baselineHacked: (HACK) + // A temporary fix to conform to Processing's implementation + // of BASELINE vertical alignment in a bounding box + if (typeof maxWidth !== "undefined") { + if (this.drawingContext.textBaseline === constants.BASELINE) { + baselineHacked = true; + this.drawingContext.textBaseline = constants.TOP; + } + } + var p = _main.default.Renderer.prototype.text.apply( + this, + arguments, + ); + if (baselineHacked) { + this.drawingContext.textBaseline = constants.BASELINE; + } + return p; + }; + _main.default.Renderer2D = Renderer2D; + var _default = _main.default.Renderer2D; + exports.default = _default; + }, + { + "./constants": 286, + "./main": 298, + "./p5.Renderer": 301, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.number.to-fixed": 193, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.reflect.get": 203, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 303: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + var _main = _interopRequireDefault(_dereq_("./main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + _main.default.prototype._promisePreloads = [ + /* Example object + { + target: p5.prototype, // The target object to have the method modified + method: 'loadXAsync', // The name of the preload function to wrap + addCallbacks: true, // Whether to automatically handle the p5 callbacks + legacyPreloadSetup: { // Optional object to generate a legacy-style preload + method: 'loadX', // The name of the legacy preload function to generate + createBaseObject: function() { + return {}; + } // An optional function to create the base object for the legacy preload. + } + } + */ + ]; + _main.default.prototype.registerPromisePreload = function (setup) { + _main.default.prototype._promisePreloads.push(setup); + }; + var initialSetupRan = false; + _main.default.prototype._setupPromisePreloads = function () { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = this._promisePreloads[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()).done); + _iteratorNormalCompletion = true + ) { + var preloadSetup = _step.value; + var thisValue = this; + var method = preloadSetup.method, + addCallbacks = preloadSetup.addCallbacks, + legacyPreloadSetup = preloadSetup.legacyPreloadSetup; // Get the target object that the preload gets assigned to by default, + // that is the current object. + var target = preloadSetup.target || this; + var sourceFunction = target[method].bind(target); + // If the target is the p5 prototype, then only set it up on the first run per page + if (target === _main.default.prototype) { + if (initialSetupRan) { + continue; + } + thisValue = null; + sourceFunction = target[method]; + } // Replace the original method with a wrapped version + + target[method] = this._wrapPromisePreload( + thisValue, + sourceFunction, + addCallbacks, + ); + // If a legacy preload is required + if (legacyPreloadSetup) { + // What is the name for this legacy preload + var legacyMethod = legacyPreloadSetup.method; + // Wrap the already wrapped Promise-returning method with the legacy setup + target[legacyMethod] = this._legacyPreloadGenerator( + thisValue, + legacyPreloadSetup, + target[method], + ); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + initialSetupRan = true; + }; + _main.default.prototype._wrapPromisePreload = function ( + thisValue, + fn, + addCallbacks, + ) { + var replacementFunction = function replacementFunction() { + var _this = this; + // Uses the current preload counting mechanism for now. + this._incrementPreload(); + // A variable for the callback function if specified + var callback = null; + // A variable for the errorCallback function if specified + var errorCallback = null; + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + if (addCallbacks) { + // Loop from the end of the args array, pulling up to two functions off of + // the end and putting them in fns + for (var i = args.length - 1; i >= 0 && !errorCallback; i--) { + if (typeof args[i] !== "function") { + break; + } + errorCallback = callback; + callback = args.pop(); + } + } // Call the underlying function and pass it to Promise.resolve, + // so that even if it didn't return a promise we can still + // act on the result as if it did. + + var promise = Promise.resolve(fn.apply(this, args)); + // Add the optional callbacks + if (callback) { + promise.then(callback); + } + if (errorCallback) { + promise.catch(errorCallback); + } // Decrement the preload counter only if the promise resolved + + promise.then(function () { + return _this._decrementPreload(); + }); + // Return the original promise so that neither callback changes the result. + return promise; + }; + if (thisValue) { + replacementFunction = replacementFunction.bind(thisValue); + } + return replacementFunction; + }; + var objectCreator = function objectCreator() { + return {}; + }; + _main.default.prototype._legacyPreloadGenerator = function ( + thisValue, + legacyPreloadSetup, + fn, + ) { + // Create a function that will generate an object before the preload is + // launched. For example, if the object should be an array or be an instance + // of a specific class. + var baseValueGenerator = + legacyPreloadSetup.createBaseObject || objectCreator; + var returnedFunction = function returnedFunction() { + var _this2 = this; + // Our then clause needs to run before setup, so we also increment the preload counter + this._incrementPreload(); + // Generate the return value based on the generator. + for ( + var _len2 = arguments.length, + args = new Array(_len2), + _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + var returnValue = baseValueGenerator.apply(this, args); + // Run the original wrapper + fn.apply(this, args).then(function (data) { + // Copy each key from the resolved value into returnValue + Object.assign(returnValue, data); + // Decrement the preload counter, to allow setup to continue. + _this2._decrementPreload(); + }); + return returnValue; + }; + if (thisValue) { + returnedFunction = returnedFunction.bind(thisValue); + } + return returnedFunction; + }; + }, + { + "./main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.assign": 194, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.promise": 201, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 304: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + var constants = _interopRequireWildcard(_dereq_("./constants")); + _dereq_("./p5.Graphics"); + _dereq_("./p5.Renderer2D"); + _dereq_("../webgl/p5.RendererGL"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + + var defaultId = "defaultCanvas0"; // this gets set again in createCanvas + var defaultClass = "p5Canvas"; + /** + * Creates a canvas element in the document and sets its dimensions + * in pixels. This method should be called only once at the start of setup(). + * Calling createCanvas more than once in a + * sketch will result in very unpredictable behavior. If you want more than + * one drawing canvas you could use createGraphics() + * (hidden by default but it can be shown). + * + * Important note: in 2D mode (i.e. when `p5.Renderer` is not set) the origin (0,0) + * is positioned at the top left of the screen. In 3D mode (i.e. when `p5.Renderer` + * is set to `WEBGL`), the origin is positioned at the center of the canvas. + * See [this issue](https://github.com/processing/p5.js/issues/1545) for more information. + * + * A WebGL canvas will use a WebGL2 context if it is supported by the browser. + * Check the webglVersion property to check what + * version is being used, or call setAttributes({ version: 1 }) + * to create a WebGL1 context. + * + * The system variables width and height are set by the parameters passed to this + * function. If createCanvas() is not used, the + * window will be given a default size of 100×100 pixels. + * + * Optionally, an existing canvas can be passed using a selector, ie. `document.getElementById('')`. + * If specified, avoid using `setAttributes()` afterwards, as this will remove and recreate the existing canvas. + * + * For more ways to position the canvas, see the + * + * positioning the canvas wiki page. + * + * @method createCanvas + * @param {Number} w width of the canvas + * @param {Number} h height of the canvas + * @param {Constant} [renderer] either P2D or WEBGL + * @param {HTMLCanvasElement} [canvas] existing html canvas element + * @return {p5.Renderer} pointer to p5.Renderer holding canvas + * @example + *
                    + * + * function setup() { + * createCanvas(100, 50); + * background(153); + * line(0, 0, width, height); + * } + * + *
                    + * + * @alt + * Black line extending from top-left of canvas to bottom right. + */ + /** + * @method createCanvas + * @param {Number} w + * @param {Number} h + * @param {HTMLCanvasElement} [canvas] + * @return {p5.Renderer} pointer to p5.Renderer holding canvas + */ + _main.default.prototype.createCanvas = function ( + w, + h, + renderer, + canvas, + ) { + _main.default._validateParameters("createCanvas", arguments); + //optional: renderer, otherwise defaults to p2d + var r; + if (arguments[2] instanceof HTMLCanvasElement) { + renderer = constants.P2D; + canvas = arguments[2]; + } else { + r = renderer || constants.P2D; + } + var c; + if (canvas) { + c = document.getElementById(defaultId); + if (c) { + c.parentNode.removeChild(c); //replace the existing defaultCanvas + } + c = canvas; + this._defaultGraphicsCreated = false; + } else { + if (r === constants.WEBGL) { + c = document.getElementById(defaultId); + if (c) { + //if defaultCanvas already exists + c.parentNode.removeChild(c); //replace the existing defaultCanvas + var thisRenderer = this._renderer; + this._elements = this._elements.filter(function (e) { + return e !== thisRenderer; + }); + } + c = document.createElement("canvas"); + c.id = defaultId; + c.classList.add(defaultClass); + } else { + if (!this._defaultGraphicsCreated) { + if (canvas) { + c = canvas; + } else { + c = document.createElement("canvas"); + } + var i = 0; + while (document.getElementById("defaultCanvas".concat(i))) { + i++; + } + defaultId = "defaultCanvas".concat(i); + c.id = defaultId; + c.classList.add(defaultClass); + } else { + // resize the default canvas if new one is created + c = this.canvas; + } + } // set to invisible if still in setup (to prevent flashing with manipulate) + + if (!this._setupDone) { + c.dataset.hidden = true; // tag to show later + c.style.visibility = "hidden"; + } + if (this._userNode) { + // user input node case + this._userNode.appendChild(c); + } else { + //create main element + if (document.getElementsByTagName("main").length === 0) { + var m = document.createElement("main"); + document.body.appendChild(m); + } //append canvas to main + + document.getElementsByTagName("main")[0].appendChild(c); + } + } // Init our graphics renderer + //webgl mode + + if (r === constants.WEBGL) { + this._setProperty( + "_renderer", + new _main.default.RendererGL(c, this, true), + ); + this._elements.push(this._renderer); + } else { + //P2D mode + if (!this._defaultGraphicsCreated) { + this._setProperty( + "_renderer", + new _main.default.Renderer2D(c, this, true), + ); + this._defaultGraphicsCreated = true; + this._elements.push(this._renderer); + } + } + this._renderer.resize(w, h); + this._renderer._applyDefaults(); + return this._renderer; + }; + /** + * Resizes the canvas to given width and height. The canvas will be cleared + * and draw will be called immediately, allowing the sketch to re-render itself + * in the resized canvas. + * @method resizeCanvas + * @param {Number} w width of the canvas + * @param {Number} h height of the canvas + * @param {Boolean} [noRedraw] don't redraw the canvas immediately + * @example + *
                    + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(0, 100, 200); + * } + * + * function windowResized() { + * resizeCanvas(windowWidth, windowHeight); + * } + *
                    + * + * @alt + * No image displayed. + */ + _main.default.prototype.resizeCanvas = function (w, h, noRedraw) { + _main.default._validateParameters("resizeCanvas", arguments); + if (this._renderer) { + // save canvas properties + var props = {}; + for (var key in this.drawingContext) { + var val = this.drawingContext[key]; + if (_typeof(val) !== "object" && typeof val !== "function") { + props[key] = val; + } + } + this.width = w; + this.height = h; + // Make sure width and height are updated before the renderer resizes so + // that framebuffers updated from the resize read the correct size + this._renderer.resize(w, h); + // reset canvas properties + for (var savedKey in props) { + try { + this.drawingContext[savedKey] = props[savedKey]; + } catch (err) { + // ignore read-only property errors + } + } + if (!noRedraw) { + this.redraw(); + } + } //accessible Outputs + + if (this._addAccsOutput()) { + this._updateAccsOutput(); + } + }; + /** + * Removes the default canvas for a p5 sketch that doesn't require a canvas + * @method noCanvas + * @example + *
                    + * + * function setup() { + * noCanvas(); + * } + * + *
                    + * + * @alt + * no image displayed + */ + _main.default.prototype.noCanvas = function () { + if (this.canvas) { + this.canvas.parentNode.removeChild(this.canvas); + } + }; + /** + * Creates and returns a new p5.Graphics object. Use this class if you need + * to draw into an off-screen graphics buffer. The two parameters define the + * width and height in pixels. + * + * A WebGL p5.Graphics will use a WebGL2 context if it is supported by the browser. + * Check the pg.webglVersion property of the renderer + * to check what version is being used, or call pg.setAttributes({ version: 1 }) + * to create a WebGL1 context. + * + * Optionally, an existing canvas can be passed using a selector, ie. document.getElementById(''). + * By default this canvas will be hidden (offscreen buffer), to make visible, set element's style to display:block; + * + * @method createGraphics + * @param {Number} w width of the offscreen graphics buffer + * @param {Number} h height of the offscreen graphics buffer + * @param {Constant} [renderer] either P2D or WEBGL + * undefined defaults to p2d + * @param {HTMLCanvasElement} [canvas] existing html canvas element + * @return {p5.Graphics} offscreen graphics buffer + * @example + *
                    + * + * let pg; + * function setup() { + * createCanvas(100, 100); + * pg = createGraphics(100, 100); + * } + * + * function draw() { + * background(200); + * pg.background(100); + * pg.noStroke(); + * pg.ellipse(pg.width / 2, pg.height / 2, 50, 50); + * image(pg, 50, 50); + * image(pg, 0, 0, 50, 50); + * } + * + *
                    + * + * @alt + * 4 grey squares alternating light and dark grey. White quarter circle mid-left. + */ + /** + * @method createGraphics + * @param {Number} w + * @param {Number} h + * @param {HTMLCanvasElement} [canvas] + * @return {p5.Graphics} offscreen graphics buffer + */ + _main.default.prototype.createGraphics = function (w, h) { + for ( + var _len = arguments.length, + args = new Array(_len > 2 ? _len - 2 : 0), + _key = 2; + _key < _len; + _key++ + ) { + args[_key - 2] = arguments[_key]; + } /** + * args[0] is expected to be renderer + * args[1] is expected to be canvas + */ + + if (args[0] instanceof HTMLCanvasElement) { + args[1] = args[0]; + args[0] = constants.P2D; + } + _main.default._validateParameters("createGraphics", arguments); + return new _main.default.Graphics(w, h, args[0], this, args[1]); + }; + /** + * Creates and returns a new p5.Framebuffer, a + * high-performance WebGL object that you can draw to and then use as a texture. + * + * Options can include: + * - `format`: The data format of the texture, either `UNSIGNED_BYTE`, `FLOAT`, or `HALF_FLOAT`. The default is `UNSIGNED_BYTE`. + * - `channels`: What color channels to store, either `RGB` or `RGBA`. The default is to match the channels in the main canvas (with alpha unless disabled with `setAttributes`.) + * - `depth`: A boolean, whether or not to include a depth buffer. Defaults to true. + * - `depthFormat`: The data format for depth information, either `UNSIGNED_INT` or `FLOAT`. The default is `FLOAT` if available, or `UNSIGNED_INT` otherwise. + * - `stencil`: A boolean, whether or not to include a stencil buffer, which can be used for masking. This may only be used if also using a depth buffer. Defaults to the value of `depth`, which is true if not provided. + * - `antialias`: Boolean or Number, whether or not to render with antialiased edges, and if so, optionally the number of samples to use. Defaults to whether or not the main canvas is antialiased, using a default of 2 samples if so. Antialiasing is only supported when WebGL 2 is available. + * - `width`: The width of the texture. Defaults to matching the main canvas. + * - `height`: The height of the texture. Defaults to matching the main canvas. + * - `density`: The pixel density of the texture. Defaults to the pixel density of the main canvas. + * - `textureFiltering`: Either `LINEAR` (nearby pixels will be interpolated when reading values from the color texture) or `NEAREST` (no interpolation.) Generally, use `LINEAR` when using the texture as an image, and use `NEAREST` if reading the texture as data. Defaults to `LINEAR`. + * + * If `width`, `height`, or `density` are specified, then the framebuffer will + * keep that size until manually changed. Otherwise, it will be autosized, and + * it will update to match the main canvas's size and density when the main + * canvas changes. + * + * @method createFramebuffer + * @param {Object} [options] An optional object with configuration + * + * @example + *
                    + * + * let prev, next, cam; + * function setup() { + * createCanvas(100, 100, WEBGL); + * prev = createFramebuffer({ format: FLOAT }); + * next = createFramebuffer({ format: FLOAT }); + * cam = createCamera(); + * noStroke(); + * } + * + * function draw() { + * // Swap prev and next so that we can use the previous + * // frame as a texture when drawing the current frame + * [prev, next] = [next, prev]; + * + * // Draw to the framebuffer + * next.begin(); + * background(255); + * + * push(); + * // Draw the previous texture farther away, but scaled + * // up to fill the screen, plus a bit extra scale so it grows + * translate(0, 0, -200); + * scale(1.001 * (200 + cam.eyeZ) / cam.eyeZ); + * tint(255, 253); + * image(prev, -width/2, -height/2); + * pop(); + * + * push(); + * normalMaterial(); + * translate(25*sin(frameCount * 0.014), 25*sin(frameCount * 0.02), 0); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(12); + * pop(); + * next.end(); + * + * image(next, -width/2, -height/2); + * } + * + *
                    + * + * @alt + * A red, green, and blue box (using normalMaterial) moves and rotates around + * the canvas, leaving a trail behind it that slowly grows and fades away. + */ + _main.default.prototype.createFramebuffer = function (options) { + return new _main.default.Framebuffer(this, options); + }; + /** + * Blends the pixels in the display window according to the defined mode. + * There is a choice of the following modes to blend the source pixels (A) + * with the ones of pixels already in the display window (B): + *
                      + *
                    • BLEND - linear interpolation of colours: C = + * A*factor + B. This is the default blending mode.
                    • + *
                    • ADD - sum of A and B
                    • + *
                    • DARKEST - only the darkest colour succeeds: C = + * min(A*factor, B).
                    • + *
                    • LIGHTEST - only the lightest colour succeeds: C = + * max(A*factor, B).
                    • + *
                    • DIFFERENCE - subtract colors from underlying image. + * (2D)
                    • + *
                    • EXCLUSION - similar to DIFFERENCE, but less + * extreme.
                    • + *
                    • MULTIPLY - multiply the colors, result will always be + * darker.
                    • + *
                    • SCREEN - opposite multiply, uses inverse values of the + * colors.
                    • + *
                    • REPLACE - the pixels entirely replace the others and + * don't utilize alpha (transparency) values.
                    • + *
                    • REMOVE - removes pixels from B with the alpha strength of A.
                    • + *
                    • OVERLAY - mix of MULTIPLY and SCREEN + * . Multiplies dark values, and screens light values. (2D)
                    • + *
                    • HARD_LIGHT - SCREEN when greater than 50% + * gray, MULTIPLY when lower. (2D)
                    • + *
                    • SOFT_LIGHT - mix of DARKEST and + * LIGHTEST. Works like OVERLAY, but not as harsh. (2D) + *
                    • + *
                    • DODGE - lightens light tones and increases contrast, + * ignores darks. (2D)
                    • + *
                    • BURN - darker areas are applied, increasing contrast, + * ignores lights. (2D)
                    • + *
                    • SUBTRACT - remainder of A and B (3D)
                    • + *
                    + * + * (2D) indicates that this blend mode only works in the 2D renderer.
                    + * (3D) indicates that this blend mode only works in the WEBGL renderer. + * + * @method blendMode + * @param {Constant} mode blend mode to set for canvas. + * either BLEND, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY, + * EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, + * SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT + * @example + *
                    + * + * blendMode(LIGHTEST); + * strokeWeight(30); + * stroke(80, 150, 255); + * line(25, 25, 75, 75); + * stroke(255, 50, 50); + * line(75, 25, 25, 75); + * + *
                    + * + *
                    + * + * blendMode(MULTIPLY); + * strokeWeight(30); + * stroke(80, 150, 255); + * line(25, 25, 75, 75); + * stroke(255, 50, 50); + * line(75, 25, 25, 75); + * + *
                    + * + * @alt + * translucent image thick red & blue diagonal rounded lines intersecting center + * Thick red & blue diagonal rounded lines intersecting center. dark at overlap + */ + _main.default.prototype.blendMode = function (mode) { + _main.default._validateParameters("blendMode", arguments); + if (mode === constants.NORMAL) { + // Warning added 3/26/19, can be deleted in future (1.0 release?) + console.warn( + "NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead.", + ); + mode = constants.BLEND; + } + this._renderer.blendMode(mode); + }; + /** + * The p5.js API provides a lot of functionality for creating graphics, but there is + * some native HTML5 Canvas functionality that is not exposed by p5. You can still call + * it directly using the variable `drawingContext`, as in the example shown. This is + * the equivalent of calling `canvas.getContext('2d');` or `canvas.getContext('webgl');`. + * See this + * + * reference for the native canvas API for possible drawing functions you can call. + * + * @property drawingContext + * @example + *
                    + * + * function setup() { + * drawingContext.shadowOffsetX = 5; + * drawingContext.shadowOffsetY = -5; + * drawingContext.shadowBlur = 10; + * drawingContext.shadowColor = 'black'; + * background(200); + * ellipse(width / 2, height / 2, 50, 50); + * } + * + *
                    + * + * @alt + * white ellipse with shadow blur effect around edges + */ + var _default = _main.default; + exports.default = _default; + }, + { + "../webgl/p5.RendererGL": 355, + "./constants": 286, + "./main": 298, + "./p5.Graphics": 300, + "./p5.Renderer2D": 302, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 305: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.slice"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var constants = _interopRequireWildcard(_dereq_("../constants")); + var _helpers = _interopRequireDefault(_dereq_("../helpers")); + _dereq_("../friendly_errors/fes_core"); + _dereq_("../friendly_errors/file_errors"); + _dereq_("../friendly_errors/validate_params"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Shape + * @submodule 2D Primitives + * @for p5 + * @requires core + * @requires constants + */ + /** + * This function does 3 things: + * + * 1. Bounds the desired start/stop angles for an arc (in radians) so that: + * + * 0 <= start < TWO_PI ; start <= stop < start + TWO_PI + * + * This means that the arc rendering functions don't have to be concerned + * with what happens if stop is smaller than start, or if the arc 'goes + * round more than once', etc.: they can just start at start and increase + * until stop and the correct arc will be drawn. + * + * 2. Optionally adjusts the angles within each quadrant to counter the naive + * scaling of the underlying ellipse up from the unit circle. Without + * this, the angles become arbitrary when width != height: 45 degrees + * might be drawn at 5 degrees on a 'wide' ellipse, or at 85 degrees on + * a 'tall' ellipse. + * + * 3. Flags up when start and stop correspond to the same place on the + * underlying ellipse. This is useful if you want to do something special + * there (like rendering a whole ellipse instead). + */ + + _main.default.prototype._normalizeArcAngles = function ( + start, + stop, + width, + height, + correctForScaling, + ) { + var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. + var separation; + // The order of the steps is important here: each one builds upon the + // adjustments made in the steps that precede it. + // Constrain both start and stop to [0,TWO_PI). + start = + start - constants.TWO_PI * Math.floor(start / constants.TWO_PI); + stop = + stop - constants.TWO_PI * Math.floor(stop / constants.TWO_PI); + // Get the angular separation between the requested start and stop points. + // + // Technically this separation only matches what gets drawn if + // correctForScaling is enabled. We could add a more complicated calculation + // for when the scaling is uncorrected (in which case the drawn points could + // end up pushed together or pulled apart quite dramatically relative to what + // was requested), but it would make things more opaque for little practical + // benefit. + // + // (If you do disable correctForScaling and find that correspondToSamePoint + // is set too aggressively, the easiest thing to do is probably to just make + // epsilon smaller...) + separation = Math.min( + Math.abs(start - stop), + constants.TWO_PI - Math.abs(start - stop), + ); + // Optionally adjust the angles to counter linear scaling. + if (correctForScaling) { + if (start <= constants.HALF_PI) { + start = Math.atan((width / height) * Math.tan(start)); + } else if ( + start > constants.HALF_PI && + start <= 3 * constants.HALF_PI + ) { + start = + Math.atan((width / height) * Math.tan(start)) + constants.PI; + } else { + start = + Math.atan((width / height) * Math.tan(start)) + + constants.TWO_PI; + } + if (stop <= constants.HALF_PI) { + stop = Math.atan((width / height) * Math.tan(stop)); + } else if ( + stop > constants.HALF_PI && + stop <= 3 * constants.HALF_PI + ) { + stop = + Math.atan((width / height) * Math.tan(stop)) + constants.PI; + } else { + stop = + Math.atan((width / height) * Math.tan(stop)) + + constants.TWO_PI; + } + } // Ensure that start <= stop < start + TWO_PI. + + if (start > stop) { + stop += constants.TWO_PI; + } + return { + start: start, + stop: stop, + correspondToSamePoint: separation < epsilon, + }; + }; + /** + * Draws an arc to the canvas. Arcs are drawn along the outer edge of an ellipse + * (oval) defined by the `x`, `y`, `w`, and `h` parameters. Use the `start` and `stop` + * parameters to specify the angles (in radians) at which to draw the arc. Arcs are + * always drawn clockwise from `start` to `stop`. The origin of the arc's ellipse may + * be changed with the ellipseMode() function. + * + * The optional `mode` parameter determines the arc's fill style. The fill modes are + * a semi-circle (`OPEN`), a closed semi-circle (`CHORD`), or a closed pie segment (`PIE`). + * + * @method arc + * @param {Number} x x-coordinate of the arc's ellipse. + * @param {Number} y y-coordinate of the arc's ellipse. + * @param {Number} w width of the arc's ellipse by default. + * @param {Number} h height of the arc's ellipse by default. + * @param {Number} start angle to start the arc, specified in radians. + * @param {Number} stop angle to stop the arc, specified in radians. + * @param {Constant} [mode] optional parameter to determine the way of drawing + * the arc. either CHORD, PIE, or OPEN. + * @param {Integer} [detail] optional parameter for WebGL mode only. This is to + * specify the number of vertices that makes up the + * perimeter of the arc. Default value is 25. Won't + * draw a stroke for a detail of more than 50. + * @chainable + * + * @example + *
                    + * + * arc(50, 55, 50, 50, 0, HALF_PI); + * noFill(); + * arc(50, 55, 60, 60, HALF_PI, PI); + * arc(50, 55, 70, 70, PI, PI + QUARTER_PI); + * arc(50, 55, 80, 80, PI + QUARTER_PI, TWO_PI); + * describe( + * 'A shattered outline of an ellipse with a quarter of a white circle at the bottom-right.' + * ); + * + *
                    + * + *
                    + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI); + * describe('A white ellipse with the top-right third missing. The bottom is outlined in black.'); + * + *
                    + * + *
                    + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN); + * describe( + * 'A white ellipse missing a section from the top-right. The bottom is outlined in black.' + * ); + * + *
                    + * + *
                    + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD); + * describe('A white ellipse with a black outline missing a section from the top-right.'); + * + *
                    + * + *
                    + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE); + * describe('A white ellipse with a black outline. The top-right third is missing.'); + * + *
                    + * + */ + _main.default.prototype.arc = function ( + x, + y, + w, + h, + start, + stop, + mode, + detail, + ) { + _main.default._validateParameters("arc", arguments); + // if the current stroke and fill settings wouldn't result in something + // visible, exit immediately + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } + if (start === stop) { + return this; + } + start = this._toRadians(start); + stop = this._toRadians(stop); + // p5 supports negative width and heights for ellipses + w = Math.abs(w); + h = Math.abs(h); + var vals = _helpers.default.modeAdjust( + x, + y, + w, + h, + this._renderer._ellipseMode, + ); + var angles = this._normalizeArcAngles( + start, + stop, + vals.w, + vals.h, + true, + ); + if (angles.correspondToSamePoint) { + // If the arc starts and ends at (near enough) the same place, we choose to + // draw an ellipse instead. This is preferable to faking an ellipse (by + // making stop ever-so-slightly less than start + TWO_PI) because the ends + // join up to each other rather than at a vertex at the centre (leaving + // an unwanted spike in the stroke/fill). + this._renderer.ellipse([vals.x, vals.y, vals.w, vals.h, detail]); + } else { + this._renderer.arc( + vals.x, + vals.y, + vals.w, + vals.h, + angles.start, // [0, TWO_PI) + angles.stop, // [start, start + TWO_PI) + mode, + detail, + ); + //accessible Outputs + if ( + this._accessibleOutputs.grid || + this._accessibleOutputs.text + ) { + this._accsOutput("arc", [ + vals.x, + vals.y, + vals.w, + vals.h, + angles.start, + angles.stop, + mode, + ]); + } + } + return this; + }; + /** + * Draws an ellipse (oval) to the canvas. An ellipse with equal width and height + * is a circle. By default, the first two parameters set the location of the + * center of the ellipse. The third and fourth parameters set the shape's width + * and height, respectively. The origin may be changed with the + * ellipseMode() function. + * + * If no height is specified, the value of width is used for both the width and + * height. If a negative height or width is specified, the absolute value is + * taken. + * + * @method ellipse + * @param {Number} x x-coordinate of the center of the ellipse. + * @param {Number} y y-coordinate of the center of the ellipse. + * @param {Number} w width of the ellipse. + * @param {Number} [h] height of the ellipse. + * @chainable + * @example + *
                    + * + * ellipse(56, 46, 55, 55); + * describe('A white ellipse with black outline in middle of a gray canvas.'); + * + *
                    + * + */ + /** + * @method ellipse + * @param {Number} x + * @param {Number} y + * @param {Number} w + * @param {Number} h + * @param {Integer} [detail] optional parameter for WebGL mode only. This is to + * specify the number of vertices that makes up the + * perimeter of the ellipse. Default value is 25. Won't + * draw a stroke for a detail of more than 50. + */ + _main.default.prototype.ellipse = function (x, y, w, h, detailX) { + _main.default._validateParameters("ellipse", arguments); + return this._renderEllipse.apply(this, arguments); + }; + /** + * Draws a circle to the canvas. A circle is a round shape. Every point on the + * edge of a circle is the same distance from its center. By default, the first + * two parameters set the location of the center of the circle. The third + * parameter sets the shape's width and height (diameter). The origin may be + * changed with the ellipseMode() function. + * + * @method circle + * @param {Number} x x-coordinate of the center of the circle. + * @param {Number} y y-coordinate of the center of the circle. + * @param {Number} d diameter of the circle. + * @chainable + * @example + *
                    + * + * circle(30, 30, 20); + * describe('A white circle with black outline in the middle of a gray canvas.'); + * + *
                    + * + */ + _main.default.prototype.circle = function () { + _main.default._validateParameters("circle", arguments); + var args = Array.prototype.slice.call(arguments, 0, 2); + args.push(arguments[2]); + args.push(arguments[2]); + return this._renderEllipse.apply(this, _toConsumableArray(args)); + }; + // internal method for drawing ellipses (without parameter validation) + _main.default.prototype._renderEllipse = function ( + x, + y, + w, + h, + detailX, + ) { + // if the current stroke and fill settings wouldn't result in something + // visible, exit immediately + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } // p5 supports negative width and heights for rects + + if (w < 0) { + w = Math.abs(w); + } + if (typeof h === "undefined") { + // Duplicate 3rd argument if only 3 given. + h = w; + } else if (h < 0) { + h = Math.abs(h); + } + var vals = _helpers.default.modeAdjust( + x, + y, + w, + h, + this._renderer._ellipseMode, + ); + this._renderer.ellipse([vals.x, vals.y, vals.w, vals.h, detailX]); + //accessible Outputs + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput("ellipse", [vals.x, vals.y, vals.w, vals.h]); + } + return this; + }; + /** + * Draws a line, a straight path between two points. Its default width is one pixel. + * The version of `line()` with four parameters draws the line in 2D. To color a line, + * use the stroke() function. To change its width, use the + * strokeWeight() function. A line + * can't be filled, so the fill() function won't affect + * the color of a line. + * + * The version of `line()` with six parameters allows the line to be drawn in 3D + * space. Doing so requires adding the `WEBGL` argument to + * createCanvas(). + * + * @method line + * @param {Number} x1 the x-coordinate of the first point. + * @param {Number} y1 the y-coordinate of the first point. + * @param {Number} x2 the x-coordinate of the second point. + * @param {Number} y2 the y-coordinate of the second point. + * @chainable + * @example + *
                    + * + * line(30, 20, 85, 75); + * describe( + * 'A black line on a gray canvas running from top-center to bottom-right.' + * ); + * + *
                    + * + *
                    + * + * line(30, 20, 85, 20); + * stroke(126); + * line(85, 20, 85, 75); + * stroke(255); + * line(85, 75, 30, 75); + * describe( + * 'Three lines drawn in grayscale on a gray canvas. They form the top, right, and bottom sides of a square.' + * ); + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('A black line drawn on a gray canvas.'); + * } + * + * function draw() { + * background(220); + * line(0, 0, 0, 10, 10, 0); + * } + * + *
                    + * + */ + /** + * @method line + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 the z-coordinate of the first point. + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 the z-coordinate of the second point. + * @chainable + */ + _main.default.prototype.line = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("line", args); + if (this._renderer._doStroke) { + var _this$_renderer; + (_this$_renderer = this._renderer).line.apply( + _this$_renderer, + args, + ); + } //accessible Outputs + + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput("line", args); + } + return this; + }; + /** + * Draws a point, a single coordinate in space. Its default size is one pixel. The first two + * parameters are the point's x- and y-coordinates, respectively. To color a point, use + * the stroke() function. To change its size, use the + * strokeWeight() function. + * + * The version of `point()` with three parameters allows the point to be drawn in 3D + * space. Doing so requires adding the `WEBGL` argument to + * createCanvas(). + * + * The version of point() with one parameter allows the point's location to be set with + * a p5.Vector object. + * + * @method point + * @param {Number} x the x-coordinate. + * @param {Number} y the y-coordinate. + * @param {Number} [z] the z-coordinate (for WebGL mode). + * @chainable + * @example + *
                    + * + * point(30, 20); + * point(85, 20); + * point(85, 75); + * point(30, 75); + * describe( + * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' + * ); + * + *
                    + * + *
                    + * + * point(30, 20); + * point(85, 20); + * stroke('purple'); + * strokeWeight(10); + * point(85, 75); + * point(30, 75); + * describe( + * 'Four points drawn on a gray canvas. Two are black and two are purple. The points form the corners of a square.' + * ); + * + *
                    + * + *
                    + * + * let a = createVector(10, 10); + * point(a); + * let b = createVector(10, 20); + * point(b); + * let c = createVector(20, 10); + * point(c); + * let d = createVector(20, 20); + * point(d); + * describe( + * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' + * ); + * + *
                    + * + */ + /** + * @method point + * @param {p5.Vector} coordinateVector the coordinate vector. + * @chainable + */ + _main.default.prototype.point = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("point", args); + if (this._renderer._doStroke) { + if ( + args.length === 1 && + args[0] instanceof _main.default.Vector + ) { + this._renderer.point.call( + this._renderer, + args[0].x, + args[0].y, + args[0].z, + ); + } else { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).point.apply( + _this$_renderer2, + args, + ); + //accessible Outputs + if ( + this._accessibleOutputs.grid || + this._accessibleOutputs.text + ) { + this._accsOutput("point", args); + } + } + } + return this; + }; + /** + * Draws a quad to the canvas. A quad is a quadrilateral, a four-sided + * polygon. Some examples of quads include rectangles, squares, rhombuses, + * and trapezoids. The first pair of parameters (`x1`,`y1`) sets the quad's + * first point. The following pairs of parameters set the coordinates for + * its next three points. Parameters should proceed clockwise or + * counter-clockwise around the shape. + * + * The version of `quad()` with twelve parameters allows the quad to be drawn + * in 3D space. Doing so requires adding the `WEBGL` argument to + * createCanvas(). + * + * @method quad + * @param {Number} x1 the x-coordinate of the first point. + * @param {Number} y1 the y-coordinate of the first point. + * @param {Number} x2 the x-coordinate of the second point. + * @param {Number} y2 the y-coordinate of the second point. + * @param {Number} x3 the x-coordinate of the third point. + * @param {Number} y3 the y-coordinate of the third point. + * @param {Number} x4 the x-coordinate of the fourth point. + * @param {Number} y4 the y-coordinate of the fourth point. + * @param {Integer} [detailX] number of segments in the x-direction. + * @param {Integer} [detailY] number of segments in the y-direction. + * @chainable + * @example + *
                    + * + * quad(20, 20, 80, 20, 80, 80, 20, 80); + * describe('A white square with a black outline drawn on a gray canvas.'); + * + *
                    + * + *
                    + * + * quad(20, 30, 80, 30, 80, 70, 20, 70); + * describe('A white rectangle with a black outline drawn on a gray canvas.'); + * + *
                    + * + *
                    + * + * quad(50, 62, 86, 50, 50, 38, 14, 50); + * describe('A white rhombus with a black outline drawn on a gray canvas.'); + * + *
                    + * + *
                    + * + * quad(20, 50, 80, 30, 80, 70, 20, 70); + * describe('A white trapezoid with a black outline drawn on a gray canvas.'); + * + *
                    + */ + /** + * @method quad + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 the z-coordinate of the first point. + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 the z-coordinate of the second point. + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 the z-coordinate of the third point. + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 the z-coordinate of the fourth point. + * @param {Integer} [detailX] + * @param {Integer} [detailY] + * @chainable + */ + _main.default.prototype.quad = function () { + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters("quad", args); + if (this._renderer._doStroke || this._renderer._doFill) { + if (this._renderer.isP3D && args.length < 12) { + // if 3D and we weren't passed 12 args, assume Z is 0 + this._renderer.quad.call( + this._renderer, + args[0], + args[1], + 0, + args[2], + args[3], + 0, + args[4], + args[5], + 0, + args[6], + args[7], + 0, + args[8], + args[9], + ); + } else { + var _this$_renderer3; + (_this$_renderer3 = this._renderer).quad.apply( + _this$_renderer3, + args, + ); + //accessibile outputs + if ( + this._accessibleOutputs.grid || + this._accessibleOutputs.text + ) { + this._accsOutput("quadrilateral", args); + } + } + } + return this; + }; + /** + * Draws a rectangle to the canvas. A rectangle is a four-sided polygon with + * every angle at ninety degrees. By default, the first two parameters set the + * location of the rectangle's upper-left corner. The third and fourth set the + * shape's the width and height, respectively. The way these parameters are + * interpreted may be changed with the rectMode() + * function. + * + * The version of `rect()` with five parameters creates a rounded rectangle. The + * fifth parameter is used as the radius value for all four corners. + * + * The version of `rect()` with eight parameters also creates a rounded rectangle. + * When using eight parameters, the latter four set the radius of the arc at + * each corner separately. The radii start with the top-left corner and move + * clockwise around the rectangle. If any of these parameters are omitted, they + * are set to the value of the last specified corner radius. + * + * @method rect + * @param {Number} x x-coordinate of the rectangle. + * @param {Number} y y-coordinate of the rectangle. + * @param {Number} w width of the rectangle. + * @param {Number} [h] height of the rectangle. + * @param {Number} [tl] optional radius of top-left corner. + * @param {Number} [tr] optional radius of top-right corner. + * @param {Number} [br] optional radius of bottom-right corner. + * @param {Number} [bl] optional radius of bottom-left corner. + * @chainable + * @example + *
                    + * + * rect(30, 20, 55, 55); + * describe('A white rectangle with a black outline on a gray canvas.'); + * + *
                    + * + *
                    + * + * rect(30, 20, 55, 55, 20); + * describe( + * 'A white rectangle with a black outline and round edges on a gray canvas.' + * ); + * + *
                    + * + *
                    + * + * rect(30, 20, 55, 55, 20, 15, 10, 5); + * describe('A white rectangle with a black outline and round edges of different radii.'); + * + *
                    + * + */ + /** + * @method rect + * @param {Number} x + * @param {Number} y + * @param {Number} w + * @param {Number} h + * @param {Integer} [detailX] number of segments in the x-direction (for WebGL mode). + * @param {Integer} [detailY] number of segments in the y-direction (for WebGL mode). + * @chainable + */ + _main.default.prototype.rect = function () { + for ( + var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; + _key4 < _len4; + _key4++ + ) { + args[_key4] = arguments[_key4]; + } + _main.default._validateParameters("rect", args); + return this._renderRect.apply(this, args); + }; + /** + * Draws a square to the canvas. A square is a four-sided polygon with every + * angle at ninety degrees and equal side lengths. By default, the first two + * parameters set the location of the square's upper-left corner. The third + * parameter sets its side size. The way these parameters are interpreted may + * be changed with the rectMode() function. + * + * The version of `square()` with four parameters creates a rounded square. The + * fourth parameter is used as the radius value for all four corners. + * + * The version of `square()` with seven parameters also creates a rounded square. + * When using seven parameters, the latter four set the radius of the arc at + * each corner separately. The radii start with the top-left corner and move + * clockwise around the square. If any of these parameters are omitted, they + * are set to the value of the last specified corner radius. + * + * @method square + * @param {Number} x x-coordinate of the square. + * @param {Number} y y-coordinate of the square. + * @param {Number} s side size of the square. + * @param {Number} [tl] optional radius of top-left corner. + * @param {Number} [tr] optional radius of top-right corner. + * @param {Number} [br] optional radius of bottom-right corner. + * @param {Number} [bl] optional radius of bottom-left corner. + * @chainable + * @example + *
                    + * + * square(30, 20, 55); + * describe('A white square with a black outline in on a gray canvas.'); + * + *
                    + * + *
                    + * + * square(30, 20, 55, 20); + * describe( + * 'A white square with a black outline and round edges on a gray canvas.' + * ); + * + *
                    + * + *
                    + * + * square(30, 20, 55, 20, 15, 10, 5); + * describe('A white square with a black outline and round edges of different radii.'); + * + *
                    + * + */ + _main.default.prototype.square = function (x, y, s, tl, tr, br, bl) { + _main.default._validateParameters("square", arguments); + // duplicate width for height in case of square + return this._renderRect.call(this, x, y, s, s, tl, tr, br, bl); + }; + // internal method to have renderer draw a rectangle + _main.default.prototype._renderRect = function () { + if (this._renderer._doStroke || this._renderer._doFill) { + // duplicate width for height in case only 3 arguments is provided + if (arguments.length === 3) { + arguments[3] = arguments[2]; + } + var vals = _helpers.default.modeAdjust( + arguments[0], + arguments[1], + arguments[2], + arguments[3], + this._renderer._rectMode, + ); + var args = [vals.x, vals.y, vals.w, vals.h]; + // append the additional arguments (either cornder radii, or + // segment details) to the argument list + for (var i = 4; i < arguments.length; i++) { + args[i] = arguments[i]; + } + this._renderer.rect(args); + //accessible outputs + if ( + this._accessibleOutputs.grid || + this._accessibleOutputs.text + ) { + this._accsOutput("rectangle", [vals.x, vals.y, vals.w, vals.h]); + } + } + return this; + }; + /** + * Draws a triangle to the canvas. A triangle is a three-sided polygon. The + * first two parameters specify the triangle's first point `(x1,y1)`. The middle + * two parameters specify its second point `(x2,y2)`. And the last two parameters + * specify its third point `(x3, y3)`. + * + * @method triangle + * @param {Number} x1 x-coordinate of the first point. + * @param {Number} y1 y-coordinate of the first point. + * @param {Number} x2 x-coordinate of the second point. + * @param {Number} y2 y-coordinate of the second point. + * @param {Number} x3 x-coordinate of the third point. + * @param {Number} y3 y-coordinate of the third point. + * @chainable + * @example + *
                    + * + * triangle(30, 75, 58, 20, 86, 75); + * describe('A white triangle with a black outline on a gray canvas.'); + * + *
                    + * + */ + _main.default.prototype.triangle = function () { + for ( + var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; + _key5 < _len5; + _key5++ + ) { + args[_key5] = arguments[_key5]; + } + _main.default._validateParameters("triangle", args); + if (this._renderer._doStroke || this._renderer._doFill) { + this._renderer.triangle(args); + } //accessible outputs + + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput("triangle", args); + } + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../constants": 286, + "../friendly_errors/fes_core": 289, + "../friendly_errors/file_errors": 290, + "../friendly_errors/validate_params": 293, + "../helpers": 294, + "../main": 298, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 306: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var constants = _interopRequireWildcard(_dereq_("../constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Shape + * @submodule Attributes + * @for p5 + * @requires core + * @requires constants + */ + /** + * Modifies the location from which ellipses, circles, and arcs are drawn. By default, the + * first two parameters are the x- and y-coordinates of the shape's center. The next + * parameters are its width and height. This is equivalent to calling `ellipseMode(CENTER)`. + * + * `ellipseMode(RADIUS)` also uses the first two parameters to set the x- and y-coordinates + * of the shape's center. The next parameters are half of the shapes's width and height. + * Calling `ellipse(0, 0, 10, 15)` draws a shape with a width of 20 and height of 30. + * + * `ellipseMode(CORNER)` uses the first two parameters as the upper-left corner of the + * shape. The next parameters are its width and height. + * + * `ellipseMode(CORNERS)` uses the first two parameters as the location of one corner + * of the ellipse's bounding box. The third and fourth parameters are the location of the + * opposite corner. + * + * The argument passed to `ellipseMode()` must be written in ALL CAPS because the constants + * `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. JavaScript is a + * case-sensitive language. + * + * @method ellipseMode + * @param {Constant} mode either CENTER, RADIUS, CORNER, or CORNERS + * @chainable + * @example + *
                    + * + * ellipseMode(RADIUS); + * fill(255); + * ellipse(50, 50, 30, 30); + * ellipseMode(CENTER); + * fill(100); + * ellipse(50, 50, 30, 30); + * describe('A white circle with a gray circle at its center. Both circles have black outlines.'); + * + *
                    + * + *
                    + * + * ellipseMode(CORNER); + * fill(255); + * ellipse(25, 25, 50, 50); + * ellipseMode(CORNERS); + * fill(100); + * ellipse(25, 25, 50, 50); + * describe('A white circle with a gray circle at its top-left corner. Both circles have black outlines.'); + * + *
                    + */ + + _main.default.prototype.ellipseMode = function (m) { + _main.default._validateParameters("ellipseMode", arguments); + if ( + m === constants.CORNER || + m === constants.CORNERS || + m === constants.RADIUS || + m === constants.CENTER + ) { + this._renderer._ellipseMode = m; + } + return this; + }; + /** + * Draws all geometry with jagged (aliased) edges. + * + * smooth() is active by default in 2D mode. It's necessary to call + * noSmooth() to disable smoothing of geometry, images, and fonts. + * + * In WebGL mode, noSmooth() is active by default. It's necessary + * to call smooth() to draw smooth (antialiased) edges. + * + * @method noSmooth + * @chainable + * @example + *
                    + * + * background(0); + * noStroke(); + * smooth(); + * ellipse(30, 48, 36, 36); + * noSmooth(); + * ellipse(70, 48, 36, 36); + * describe('Two pixelated white circles on a black background.'); + * + *
                    + */ + _main.default.prototype.noSmooth = function () { + if (!this._renderer.isP3D) { + if ("imageSmoothingEnabled" in this.drawingContext) { + this.drawingContext.imageSmoothingEnabled = false; + } + } else { + this.setAttributes("antialias", false); + } + return this; + }; + /** + * Modifies the location from which rectangles and squares are drawn. By default, + * the first two parameters are the x- and y-coordinates of the shape's upper-left + * corner. The next parameters are its width and height. This is equivalent to + * calling `rectMode(CORNER)`. + * + * `rectMode(CORNERS)` also uses the first two parameters as the location of one of + * the corners. The third and fourth parameters are the location of the opposite + * corner. + * + * `rectMode(CENTER)` uses the first two parameters as the x- and y-coordinates of + * the shape's center. The next parameters are its width and height. + * + * `rectMode(RADIUS)` also uses the first two parameters as the x- and y-coordinates + * of the shape's center. The next parameters are half of the shape's width and + * height. + * + * The argument passed to `rectMode()` must be written in ALL CAPS because the + * constants `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. + * JavaScript is a case-sensitive language. + * + * @method rectMode + * @param {Constant} mode either CORNER, CORNERS, CENTER, or RADIUS + * @chainable + * @example + *
                    + * + * rectMode(CORNER); + * fill(255); + * rect(25, 25, 50, 50); + * + * rectMode(CORNERS); + * fill(100); + * rect(25, 25, 50, 50); + * + * describe('A small gray square drawn at the top-left corner of a white square.'); + * + *
                    + * + *
                    + * + * rectMode(RADIUS); + * fill(255); + * rect(50, 50, 30, 30); + * + * rectMode(CENTER); + * fill(100); + * rect(50, 50, 30, 30); + * + * describe('A small gray square drawn at the center of a white square.'); + * + *
                    + */ + _main.default.prototype.rectMode = function (m) { + _main.default._validateParameters("rectMode", arguments); + if ( + m === constants.CORNER || + m === constants.CORNERS || + m === constants.RADIUS || + m === constants.CENTER + ) { + this._renderer._rectMode = m; + } + return this; + }; + /** + * Draws all geometry with smooth (anti-aliased) edges. smooth() will also + * improve image quality of resized images. + * + * smooth() is active by default in 2D mode. It's necessary to call + * noSmooth() to disable smoothing of geometry, images, and fonts. + * + * In WebGL mode, noSmooth() is active by default. It's necessary + * to call smooth() to draw smooth (antialiased) edges. + * + * @method smooth + * @chainable + * @example + *
                    + * + * background(0); + * noStroke(); + * smooth(); + * ellipse(30, 48, 36, 36); + * noSmooth(); + * ellipse(70, 48, 36, 36); + * describe('Two pixelated white circles on a black background.'); + * + *
                    + */ + _main.default.prototype.smooth = function () { + this.setAttributes("antialias", true); + if (!this._renderer.isP3D) { + if ("imageSmoothingEnabled" in this.drawingContext) { + this.drawingContext.imageSmoothingEnabled = true; + } + } + return this; + }; + /** + * Sets the style for rendering line endings. These ends are either rounded + * (`ROUND`), squared (`SQUARE`), or extended (`PROJECT`). The default cap is + * `ROUND`. + * + * The argument passed to `strokeCap()` must be written in ALL CAPS because + * the constants `ROUND`, `SQUARE`, and `PROJECT` are defined this way. + * JavaScript is a case-sensitive language. + * + * @method strokeCap + * @param {Constant} cap either ROUND, SQUARE, or PROJECT + * @chainable + * @example + *
                    + * + * strokeWeight(12.0); + * strokeCap(ROUND); + * line(20, 30, 80, 30); + * strokeCap(SQUARE); + * line(20, 50, 80, 50); + * strokeCap(PROJECT); + * line(20, 70, 80, 70); + * describe('Three horizontal lines. The top line has rounded ends, the middle line has squared ends, and the bottom line has longer, squared ends.'); + * + *
                    + */ + _main.default.prototype.strokeCap = function (cap) { + _main.default._validateParameters("strokeCap", arguments); + if ( + cap === constants.ROUND || + cap === constants.SQUARE || + cap === constants.PROJECT + ) { + this._renderer.strokeCap(cap); + } + return this; + }; + /** + * Sets the style of the joints which connect line segments. These joints are + * either mitered (`MITER`), beveled (`BEVEL`), or rounded (`ROUND`). The default + * joint is `MITER` in 2D mode and `ROUND` in WebGL mode. + * + * The argument passed to `strokeJoin()` must be written in ALL CAPS because + * the constants `MITER`, `BEVEL`, and `ROUND` are defined this way. + * JavaScript is a case-sensitive language. + * + * @method strokeJoin + * @param {Constant} join either MITER, BEVEL, or ROUND + * @chainable + * @example + *
                    + * + * noFill(); + * strokeWeight(10.0); + * strokeJoin(MITER); + * beginShape(); + * vertex(35, 20); + * vertex(65, 50); + * vertex(35, 80); + * endShape(); + * describe('A right-facing arrowhead shape with a pointed tip in center of canvas.'); + * + *
                    + * + *
                    + * + * noFill(); + * strokeWeight(10.0); + * strokeJoin(BEVEL); + * beginShape(); + * vertex(35, 20); + * vertex(65, 50); + * vertex(35, 80); + * endShape(); + * describe('A right-facing arrowhead shape with a flat tip in center of canvas.'); + * + *
                    + * + *
                    + * + * noFill(); + * strokeWeight(10.0); + * strokeJoin(ROUND); + * beginShape(); + * vertex(35, 20); + * vertex(65, 50); + * vertex(35, 80); + * endShape(); + * describe('A right-facing arrowhead shape with a rounded tip in center of canvas.'); + * + *
                    + */ + _main.default.prototype.strokeJoin = function (join) { + _main.default._validateParameters("strokeJoin", arguments); + if ( + join === constants.ROUND || + join === constants.BEVEL || + join === constants.MITER + ) { + this._renderer.strokeJoin(join); + } + return this; + }; + /** + * Sets the width of the stroke used for lines, points, and the border around + * shapes. All widths are set in units of pixels. + * + * Note that `strokeWeight()` is affected by any transformation or scaling that + * has been applied previously. + * + * @method strokeWeight + * @param {Number} weight the weight of the stroke (in pixels). + * @chainable + * @example + *
                    + * + * // Default. + * line(20, 20, 80, 20); + * // Thicker. + * strokeWeight(4); + * line(20, 40, 80, 40); + * // Beastly. + * strokeWeight(10); + * line(20, 70, 80, 70); + * describe('Three horizontal black lines. The top line is thin, the middle is medium, and the bottom is thick.'); + * + *
                    + * + *
                    + * + * // Default. + * line(20, 20, 80, 20); + * // Adding scale transformation. + * scale(5); + * // Coordinates adjusted for scaling. + * line(4, 8, 16, 8); + * describe('Two horizontal black lines. The top line is thin and the bottom is five times thicker than the top.'); + * + *
                    + */ + _main.default.prototype.strokeWeight = function (w) { + _main.default._validateParameters("strokeWeight", arguments); + this._renderer.strokeWeight(w); + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../constants": 286, + "../main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 307: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + _dereq_("../friendly_errors/fes_core"); + _dereq_("../friendly_errors/file_errors"); + _dereq_("../friendly_errors/validate_params"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Shape + * @submodule Curves + * @for p5 + * @requires core + */ + /** + * Draws a cubic Bezier curve on the screen. These curves are defined by a + * series of anchor and control points. The first two parameters specify + * the first anchor point and the last two parameters specify the other + * anchor point, which become the first and last points on the curve. The + * middle parameters specify the two control points which define the shape + * of the curve. Approximately speaking, control points "pull" the curve + * towards them. + * + * Bezier curves were developed by French automotive engineer Pierre Bezier, + * and are commonly used in computer graphics to define gently sloping curves. + * See also curve(). + * + * @method bezier + * @param {Number} x1 x-coordinate for the first anchor point + * @param {Number} y1 y-coordinate for the first anchor point + * @param {Number} x2 x-coordinate for the first control point + * @param {Number} y2 y-coordinate for the first control point + * @param {Number} x3 x-coordinate for the second control point + * @param {Number} y3 y-coordinate for the second control point + * @param {Number} x4 x-coordinate for the second anchor point + * @param {Number} y4 y-coordinate for the second anchor point + * @chainable + * @example + *
                    + * + * noFill(); + * stroke(255, 102, 0); + * line(85, 20, 10, 10); + * line(90, 90, 15, 80); + * stroke(0, 0, 0); + * bezier(85, 20, 10, 10, 90, 90, 15, 80); + * + *
                    + * + *
                    + * + * background(0, 0, 0); + * noFill(); + * stroke(255); + * bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0); + * + *
                    + * + * @alt + * stretched black s-shape in center with orange lines extending from end points. + * a white colored curve on black background from the upper-right corner to the lower right corner. + */ + /** + * @method bezier + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 z-coordinate for the first anchor point + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate for the first control point + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the second control point + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 z-coordinate for the second anchor point + * @chainable + */ + + _main.default.prototype.bezier = function () { + var _this$_renderer; + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("bezier", args); + // if the current stroke and fill settings wouldn't result in something + // visible, exit immediately + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } + (_this$_renderer = this._renderer).bezier.apply( + _this$_renderer, + args, + ); + return this; + }; + /** + * Sets the resolution at which Bezier's curve is displayed. The default value is 20. + * + * Note, This function is only useful when using the WEBGL renderer + * as the default canvas renderer does not use this information. + * + * @method bezierDetail + * @param {Number} detail resolution of the curves + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noFill(); + * bezierDetail(5); + * } + * + * function draw() { + * background(200); + * bezier( + * -40, -40, 0, + * 90, -40, 0, + * -90, 40, 0, + * 40, 40, 0 + * ); + * } + * + *
                    + * + * @alt + * stretched black s-shape with a low level of bezier detail + */ + _main.default.prototype.bezierDetail = function (d) { + _main.default._validateParameters("bezierDetail", arguments); + this._bezierDetail = d; + return this; + }; + /** + * Given the x or y co-ordinate values of control and anchor points of a bezier + * curve, it evaluates the x or y coordinate of the bezier at position t. The + * parameters a and d are the x or y coordinates of first and last points on the + * curve while b and c are of the control points.The final parameter t is the + * position of the resultant point which is given between 0 and 1. + * This can be done once with the x coordinates and a second time + * with the y coordinates to get the location of a bezier curve at t. * - * This is used by various 3d primitive methods (in primitives.js, eg. plane, - * box, torus, etc...) to allow caching of un-scaled geometries. Those - * geometries are generally created with unit-length dimensions, cached as - * such, and then scaled appropriately in this method prior to rendering. + * @method bezierPoint + * @param {Number} a coordinate of first point on the curve + * @param {Number} b coordinate of first control point + * @param {Number} c coordinate of second control point + * @param {Number} d coordinate of second point on the curve + * @param {Number} t value between 0 and 1 + * @return {Number} the value of the Bezier at position t + * @example + *
                    + * + * noFill(); + * let x1 = 85, + x2 = 10, + x3 = 90, + x4 = 15; + * let y1 = 20, + y2 = 10, + y3 = 90, + y4 = 80; + * bezier(x1, y1, x2, y2, x3, y3, x4, y4); + * fill(255); + * let steps = 10; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = bezierPoint(x1, x2, x3, x4, t); + * let y = bezierPoint(y1, y2, y3, y4, t); + * circle(x, y, 5); + * } + * + *
                    * - * @private - * @method drawBuffersScaled - * @param {String} gId ID in our geom hash - * @param {Number} scaleX the amount to scale in the X direction - * @param {Number} scaleY the amount to scale in the Y direction - * @param {Number} scaleZ the amount to scale in the Z direction - */ - _main.default.RendererGL.prototype.drawBuffersScaled = function (gId, scaleX, scaleY, scaleZ) { - var uMVMatrix = this.uMVMatrix.copy(); - try { - this.uMVMatrix.scale(scaleX, scaleY, scaleZ); - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - }; - _main.default.RendererGL.prototype._drawArrays = function (drawMode, gId) { - this.GL.drawArrays(drawMode, 0, this.retainedMode.geometry[gId].lineVertexCount); - return this; - }; - _main.default.RendererGL.prototype._drawElements = function (drawMode, gId) { - var buffers = this.retainedMode.geometry[gId]; - var gl = this.GL; - // render the fill - if (buffers.indexBuffer) { - // If this model is using a Uint32Array we need to ensure the - // OES_element_index_uint WebGL extension is enabled. - if (this._pInst.webglVersion !== constants.WEBGL2 && buffers.indexBufferType === gl.UNSIGNED_INT) { - if (!gl.getExtension('OES_element_index_uint')) { - throw new Error('Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.'); - } - } // we're drawing faces - - gl.drawElements(gl.TRIANGLES, buffers.vertexCount, buffers.indexBufferType, 0); - } else { - // drawing vertices - gl.drawArrays(drawMode || gl.TRIANGLES, 0, buffers.vertexCount); - } - }; - _main.default.RendererGL.prototype._drawPoints = function (vertices, vertexBuffer) { - var gl = this.GL; - var pointShader = this._getImmediatePointShader(); - this._setPointUniforms(pointShader); - this._bindBuffer(vertexBuffer, gl.ARRAY_BUFFER, this._vToNArray(vertices), Float32Array, gl.STATIC_DRAW); - pointShader.enableAttrib(pointShader.attributes.aPosition, 3); - this._applyColorBlend(this.curStrokeColor); - gl.drawArrays(gl.Points, 0, vertices.length); - pointShader.unbindShader(); - }; - var _default = _main.default.RendererGL; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.RenderBuffer': 352, - './p5.RendererGL': 355, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.some': 184, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.float32-array': 229, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint16-array': 250, - 'core-js/modules/es.typed-array.uint32-array': 251, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 355: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.copy-within'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.reflect.get'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.float64-array'); - _dereq_('core-js/modules/es.typed-array.int16-array'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint16-array'); - _dereq_('core-js/modules/es.typed-array.uint32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.concat'); - _dereq_('core-js/modules/es.array.copy-within'); - _dereq_('core-js/modules/es.array.every'); - _dereq_('core-js/modules/es.array.fill'); - _dereq_('core-js/modules/es.array.from'); - _dereq_('core-js/modules/es.array.includes'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.map'); - _dereq_('core-js/modules/es.object.assign'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.set'); - _dereq_('core-js/modules/es.string.includes'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.float32-array'); - _dereq_('core-js/modules/es.typed-array.float64-array'); - _dereq_('core-js/modules/es.typed-array.int16-array'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.uint16-array'); - _dereq_('core-js/modules/es.typed-array.uint32-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.readPixelsWebGL = readPixelsWebGL; - exports.readPixelWebGL = readPixelWebGL; - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - var _GeometryBuilder = _interopRequireDefault(_dereq_('./GeometryBuilder')); - var _libtess = _interopRequireDefault(_dereq_('libtess')); - _dereq_('./p5.Shader'); - _dereq_('./p5.Camera'); - _dereq_('../core/p5.Renderer'); - _dereq_('./p5.Matrix'); - _dereq_('./p5.Framebuffer'); - var _path = _dereq_('path'); - var _p6 = _dereq_('./p5.Texture'); - var _filterShaderFrags; - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError('Invalid attempt to spread non-iterable instance'); - } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _get(target, property, receiver) { - if (typeof Reflect !== 'undefined' && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var STROKE_CAP_ENUM = { - }; - var STROKE_JOIN_ENUM = { - }; - var lineDefs = ''; - var defineStrokeCapEnum = function defineStrokeCapEnum(key, val) { - lineDefs += '#define STROKE_CAP_'.concat(key, ' ').concat(val, '\n'); - STROKE_CAP_ENUM[constants[key]] = val; - }; - var defineStrokeJoinEnum = function defineStrokeJoinEnum(key, val) { - lineDefs += '#define STROKE_JOIN_'.concat(key, ' ').concat(val, '\n'); - STROKE_JOIN_ENUM[constants[key]] = val; - }; - // Define constants in line shaders for each type of cap/join, and also record - // the values in JS objects - defineStrokeCapEnum('ROUND', 0); - defineStrokeCapEnum('PROJECT', 1); - defineStrokeCapEnum('SQUARE', 2); - defineStrokeJoinEnum('ROUND', 0); - defineStrokeJoinEnum('MITER', 1); - defineStrokeJoinEnum('BEVEL', 2); - var lightingShader = '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'; - var webgl2CompatibilityShader = '#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n'; - var defaultShaders = { - immediateVert: 'IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n', - vertexColorVert: 'IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n', - vertexColorFrag: 'IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', - normalVert: 'IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', - normalFrag: 'IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n', - basicFrag: 'IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', - lightVert: lightingShader + '// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', - lightTextureFrag: 'uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n', - phongVert: 'precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', - phongFrag: lightingShader + '// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n', - fontVert: 'IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph\'s rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter\'s line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n', - fontFrag: '#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of \'t\' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n', - lineVert: lineDefs + '/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent\'s z value is 0 if it\'s facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don\'t get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don\'t care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can\'t remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the "elbow" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We\'ll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n', - lineFrag: lineDefs + 'precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', - pointVert: 'IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n', - pointFrag: 'precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n', - imageLightVert: 'precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we\'ll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n', - imageLightDiffusedFrag: 'precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere\'s orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral\'s\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}', - imageLightSpecularFrag: 'precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n' - }; - for (var key in defaultShaders) { - defaultShaders[key] = webgl2CompatibilityShader + defaultShaders[key]; - } - var filterShaderFrags = (_filterShaderFrags = { - }, _defineProperty(_filterShaderFrags, constants.GRAY, 'precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.ERODE, '// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.DILATE, '// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.BLUR, 'precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss\' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn\'t a real Gaussian weight, it\'s a quadratic weight. It\'s what the\n// CPU mode\'s blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n'), _defineProperty(_filterShaderFrags, constants.POSTERIZE, '// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.OPAQUE, '// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n'), _defineProperty(_filterShaderFrags, constants.INVERT, '// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.THRESHOLD, '// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n'), _filterShaderFrags); - var filterShaderVert = 'uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n'; - /** - * @module Rendering - * @submodule Rendering - * @for p5 + * @alt + * 10 points plotted on a given bezier at equal distances. */ - /** - * Set attributes for the WebGL Drawing context. - * This is a way of adjusting how the WebGL - * renderer works to fine-tune the display and performance. - * - * Note that this will reinitialize the drawing context - * if called after the WebGL canvas is made. - * - * If an object is passed as the parameter, all attributes - * not declared in the object will be set to defaults. - * - * The available attributes are: - *
                    - * alpha - indicates if the canvas contains an alpha buffer - * default is true - * - * depth - indicates whether the drawing buffer has a depth buffer - * of at least 16 bits - default is true - * - * stencil - indicates whether the drawing buffer has a stencil buffer - * of at least 8 bits - * - * antialias - indicates whether or not to perform anti-aliasing - * default is false (true in Safari) - * - * premultipliedAlpha - indicates that the page compositor will assume - * the drawing buffer contains colors with pre-multiplied alpha - * default is true + _main.default.prototype.bezierPoint = function (a, b, c, d, t) { + _main.default._validateParameters("bezierPoint", arguments); + var adjustedT = 1 - t; + return ( + Math.pow(adjustedT, 3) * a + + 3 * Math.pow(adjustedT, 2) * t * b + + 3 * adjustedT * Math.pow(t, 2) * c + + Math.pow(t, 3) * d + ); + }; + /** + * Evaluates the tangent to the Bezier at position t for points a, b, c, d. + * The parameters a and d are the first and last points + * on the curve, and b and c are the control points. + * The final parameter t varies between 0 and 1. + * + * @method bezierTangent + * @param {Number} a coordinate of first point on the curve + * @param {Number} b coordinate of first control point + * @param {Number} c coordinate of second control point + * @param {Number} d coordinate of second point on the curve + * @param {Number} t value between 0 and 1 + * @return {Number} the tangent at position t + * @example + *
                    + * + * noFill(); + * bezier(85, 20, 10, 10, 90, 90, 15, 80); + * let steps = 6; + * fill(255); + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * // Get the location of the point + * let x = bezierPoint(85, 10, 90, 15, t); + * let y = bezierPoint(20, 10, 90, 80, t); + * // Get the tangent points + * let tx = bezierTangent(85, 10, 90, 15, t); + * let ty = bezierTangent(20, 10, 90, 80, t); + * // Calculate an angle from the tangent points + * let a = atan2(ty, tx); + * a += PI; + * stroke(255, 102, 0); + * line(x, y, cos(a) * 30 + x, sin(a) * 30 + y); + * // The following line of code makes a line + * // inverse of the above line + * //line(x, y, cos(a)*-30 + x, sin(a)*-30 + y); + * stroke(0); + * ellipse(x, y, 5, 5); + * } + * + *
                    + * + *
                    + * + * noFill(); + * bezier(85, 20, 10, 10, 90, 90, 15, 80); + * stroke(255, 102, 0); + * let steps = 16; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = bezierPoint(85, 10, 90, 15, t); + * let y = bezierPoint(20, 10, 90, 80, t); + * let tx = bezierTangent(85, 10, 90, 15, t); + * let ty = bezierTangent(20, 10, 90, 80, t); + * let a = atan2(ty, tx); + * a -= HALF_PI; + * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); + * } + * + *
                    + * + * @alt + * s-shaped line with 6 short orange lines showing the tangents at those points. + * s-shaped line with 6 short orange lines showing lines coming out the underside of the bezier. + */ + _main.default.prototype.bezierTangent = function (a, b, c, d, t) { + _main.default._validateParameters("bezierTangent", arguments); + var adjustedT = 1 - t; + return ( + 3 * d * Math.pow(t, 2) - + 3 * c * Math.pow(t, 2) + + 6 * c * adjustedT * t - + 6 * b * adjustedT * t + + 3 * b * Math.pow(adjustedT, 2) - + 3 * a * Math.pow(adjustedT, 2) + ); + }; + /** + * Draws a curved line on the screen between two points, given as the + * middle four parameters. The first two parameters are a control point, as + * if the curve came from this point even though it's not drawn. The last + * two parameters similarly describe the other control point.

                    + * Longer curves can be created by putting a series of curve() functions + * together or using curveVertex(). An additional function called + * curveTightness() provides control for the visual quality of the curve. + * The curve() function is an implementation of Catmull-Rom splines. + * + * @method curve + * @param {Number} x1 x-coordinate for the beginning control point + * @param {Number} y1 y-coordinate for the beginning control point + * @param {Number} x2 x-coordinate for the first point + * @param {Number} y2 y-coordinate for the first point + * @param {Number} x3 x-coordinate for the second point + * @param {Number} y3 y-coordinate for the second point + * @param {Number} x4 x-coordinate for the ending control point + * @param {Number} y4 y-coordinate for the ending control point + * @chainable + * @example + *
                    + * + * noFill(); + * stroke(255, 102, 0); + * curve(5, 26, 5, 26, 73, 24, 73, 61); + * stroke(0); + * curve(5, 26, 73, 24, 73, 61, 15, 65); + * stroke(255, 102, 0); + * curve(73, 24, 73, 61, 15, 65, 15, 65); + * + *
                    + * + *
                    + * + * // Define the curve points as JavaScript objects + * let p1 = { x: 5, y: 26 }; + * let p2 = { x: 73, y: 24 }; + * let p3 = { x: 73, y: 61 }; + * let p4 = { x: 15, y: 65 }; + * noFill(); + * stroke(255, 102, 0); + * curve(p1.x, p1.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); + * stroke(0); + * curve(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y); + * stroke(255, 102, 0); + * curve(p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, p4.x, p4.y); + * + *
                    + * + *
                    + * + * noFill(); + * stroke(255, 102, 0); + * curve(5, 26, 0, 5, 26, 0, 73, 24, 0, 73, 61, 0); + * stroke(0); + * curve(5, 26, 0, 73, 24, 0, 73, 61, 0, 15, 65, 0); + * stroke(255, 102, 0); + * curve(73, 24, 0, 73, 61, 0, 15, 65, 0, 15, 65, 0); + * + *
                    + * + * @alt + * horseshoe shape with orange ends facing left and black curved center. + * horseshoe shape with orange ends facing left and black curved center. + * curving black and orange lines. + */ + /** + * @method curve + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 z-coordinate for the beginning control point + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate for the first point + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the second point + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 z-coordinate for the ending control point + * @chainable + */ + _main.default.prototype.curve = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("curve", args); + if (this._renderer._doStroke) { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).curve.apply( + _this$_renderer2, + args, + ); + } + return this; + }; + /** + * Sets the resolution at which curves display. The default value is 20 while + * the minimum value is 3. + * + * This function is only useful when using the WEBGL renderer + * as the default canvas renderer does not use this + * information. + * + * @method curveDetail + * @param {Number} resolution resolution of the curves + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * curveDetail(5); + * } + * function draw() { + * background(200); + * + * curve(250, 600, 0, -30, 40, 0, 30, 30, 0, -250, 600, 0); + * } + * + *
                    + * + * @alt + * white arch shape with a low level of curve detail. + */ + _main.default.prototype.curveDetail = function (d) { + _main.default._validateParameters("curveDetail", arguments); + if (d < 3) { + this._curveDetail = 3; + } else { + this._curveDetail = d; + } + return this; + }; + /** + * Modifies the quality of forms created with curve() + * and curveVertex().The parameter tightness + * determines how the curve fits to the vertex points. The value 0.0 is the + * default value for tightness (this value defines the curves to be Catmull-Rom + * splines) and the value 1.0 connects all the points with straight lines. + * Values within the range -5.0 and 5.0 will deform the curves but will leave + * them recognizable and as values increase in magnitude, they will continue to deform. + * + * @method curveTightness + * @param {Number} amount amount of deformation from the original vertices + * @chainable + * @example + *
                    + * + * // Move the mouse left and right to see the curve change + * function setup() { + * createCanvas(100, 100); + * noFill(); + * } + * + * function draw() { + * background(204); + * let t = map(mouseX, 0, width, -5, 5); + * curveTightness(t); + * beginShape(); + * curveVertex(10, 26); + * curveVertex(10, 26); + * curveVertex(83, 24); + * curveVertex(83, 61); + * curveVertex(25, 65); + * curveVertex(25, 65); + * endShape(); + * } + * + *
                    + * + * @alt + * Line shaped like right-facing arrow,points move with mouse-x and warp shape. + */ + _main.default.prototype.curveTightness = function (t) { + _main.default._validateParameters("curveTightness", arguments); + this._renderer._curveTightness = t; + return this; + }; + /** + * Evaluates the curve at position t for points a, b, c, d. + * The parameter t varies between 0 and 1, a and d are control points + * of the curve, and b and c are the start and end points of the curve. + * This can be done once with the x coordinates and a second time + * with the y coordinates to get the location of a curve at t. + * + * @method curvePoint + * @param {Number} a coordinate of first control point of the curve + * @param {Number} b coordinate of first point + * @param {Number} c coordinate of second point + * @param {Number} d coordinate of second control point + * @param {Number} t value between 0 and 1 + * @return {Number} Curve value at position t + * @example + *
                    + * + * noFill(); + * curve(5, 26, 5, 26, 73, 24, 73, 61); + * curve(5, 26, 73, 24, 73, 61, 15, 65); + * fill(255); + * ellipseMode(CENTER); + * let steps = 6; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = curvePoint(5, 5, 73, 73, t); + * let y = curvePoint(26, 26, 24, 61, t); + * ellipse(x, y, 5, 5); + * x = curvePoint(5, 73, 73, 15, t); + * y = curvePoint(26, 24, 61, 65, t); + * ellipse(x, y, 5, 5); + * } + * + *
                    + * + *line hooking down to right-bottom with 13 5×5 white ellipse points + */ + _main.default.prototype.curvePoint = function (a, b, c, d, t) { + _main.default._validateParameters("curvePoint", arguments); + var s = this._renderer._curveTightness, + t3 = t * t * t, + t2 = t * t, + f1 = ((s - 1) / 2) * t3 + (1 - s) * t2 + ((s - 1) / 2) * t, + f2 = ((s + 3) / 2) * t3 + ((-5 - s) / 2) * t2 + 1, + f3 = ((-3 - s) / 2) * t3 + (s + 2) * t2 + ((1 - s) / 2) * t, + f4 = ((1 - s) / 2) * t3 + ((s - 1) / 2) * t2; + return a * f1 + b * f2 + c * f3 + d * f4; + }; + /** + * Evaluates the tangent to the curve at position t for points a, b, c, d. + * The parameter t varies between 0 and 1, a and d are points on the curve, + * and b and c are the control points. + * + * @method curveTangent + * @param {Number} a coordinate of first control point + * @param {Number} b coordinate of first point on the curve + * @param {Number} c coordinate of second point on the curve + * @param {Number} d coordinate of second conrol point + * @param {Number} t value between 0 and 1 + * @return {Number} the tangent at position t + * @example + *
                    + * + * noFill(); + * curve(5, 26, 73, 24, 73, 61, 15, 65); + * let steps = 6; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = curvePoint(5, 73, 73, 15, t); + * let y = curvePoint(26, 24, 61, 65, t); + * //ellipse(x, y, 5, 5); + * let tx = curveTangent(5, 73, 73, 15, t); + * let ty = curveTangent(26, 24, 61, 65, t); + * let a = atan2(ty, tx); + * a -= PI / 2.0; + * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); + * } + * + *
                    + * + * @alt + * right curving line mid-right of canvas with 7 short lines radiating from it. + */ + _main.default.prototype.curveTangent = function (a, b, c, d, t) { + _main.default._validateParameters("curveTangent", arguments); + var s = this._renderer._curveTightness, + tt3 = t * t * 3, + t2 = t * 2, + f1 = ((s - 1) / 2) * tt3 + (1 - s) * t2 + (s - 1) / 2, + f2 = ((s + 3) / 2) * tt3 + ((-5 - s) / 2) * t2, + f3 = ((-3 - s) / 2) * tt3 + (s + 2) * t2 + (1 - s) / 2, + f4 = ((1 - s) / 2) * tt3 + ((s - 1) / 2) * t2; + return a * f1 + b * f2 + c * f3 + d * f4; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../friendly_errors/fes_core": 289, + "../friendly_errors/file_errors": 290, + "../friendly_errors/validate_params": 293, + "../main": 298, + }, + ], + 308: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.slice"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../main")); + var constants = _interopRequireWildcard(_dereq_("../constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Shape + * @submodule Vertex + * @for p5 + * @requires core + * @requires constants + */ + + var shapeKind = null; + var vertices = []; + var contourVertices = []; + var isBezier = false; + var isCurve = false; + var isQuadratic = false; + var isContour = false; + var isFirstContour = true; + /** + * Use the beginContour() and + * endContour() functions to create negative shapes + * within shapes such as the center of the letter 'O'. beginContour() + * begins recording vertices for the shape and endContour() stops recording. + * The vertices that define a negative shape must "wind" in the opposite direction + * from the exterior shape. First draw vertices for the exterior clockwise order, then for internal shapes, draw vertices + * shape in counter-clockwise. + * + * These functions can only be used within a beginShape()/endShape() pair and + * transformations such as translate(), rotate(), and scale() do not work + * within a beginContour()/endContour() pair. It is also not possible to use + * other shapes, such as ellipse() or rect() within. + * + * @method beginContour + * @chainable + * @example + *
                    + * + * translate(50, 50); + * stroke(255, 0, 0); + * beginShape(); + * // Exterior part of shape, clockwise winding + * vertex(-40, -40); + * vertex(40, -40); + * vertex(40, 40); + * vertex(-40, 40); + * // Interior part of shape, counter-clockwise winding + * beginContour(); + * vertex(-20, -20); + * vertex(-20, 20); + * vertex(20, 20); + * vertex(20, -20); + * endContour(); + * endShape(CLOSE); + * + *
                    + * + * @alt + * white rect and smaller grey rect with red outlines in center of canvas. + */ + _main.default.prototype.beginContour = function () { + if (this._renderer.isP3D) { + this._renderer.beginContour(); + } else { + contourVertices = []; + isContour = true; + } + return this; + }; + /** + * Using the beginShape() and endShape() functions allow creating more + * complex forms. beginShape() begins recording vertices for a shape and + * endShape() stops recording. The value of the kind parameter tells it which + * types of shapes to create from the provided vertices. With no mode + * specified, the shape can be any irregular polygon. + * + * The parameters available for beginShape() are: + * + * POINTS + * Draw a series of points + * + * LINES + * Draw a series of unconnected line segments (individual lines) + * + * TRIANGLES + * Draw a series of separate triangles + * + * TRIANGLE_FAN + * Draw a series of connected triangles sharing the first vertex in a fan-like fashion + * + * TRIANGLE_STRIP + * Draw a series of connected triangles in strip fashion + * + * QUADS + * Draw a series of separate quads + * + * QUAD_STRIP + * Draw quad strip using adjacent edges to form the next quad + * + * TESS (WEBGL only) + * Handle irregular polygon for filling curve by explicit tessellation + * + * After calling the beginShape() function, a series of vertex() commands must follow. To stop + * drawing the shape, call endShape(). Each shape will be outlined with the + * current stroke color and filled with the fill color. + * + * Transformations such as translate(), rotate(), and scale() do not work + * within beginShape(). It is also not possible to use other shapes, such as + * ellipse() or rect() within beginShape(). + * + * @method beginShape + * @param {Constant} [kind] either POINTS, LINES, TRIANGLES, TRIANGLE_FAN + * TRIANGLE_STRIP, QUADS, QUAD_STRIP or TESS + * @chainable + * @example + *
                    + * + * beginShape(); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(CLOSE); + * + *
                    + * + *
                    + * + * beginShape(POINTS); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(LINES); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                    + * + *
                    + * + * noFill(); + * beginShape(); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                    + * + *
                    + * + * noFill(); + * beginShape(); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(CLOSE); + * + *
                    + * + *
                    + * + * beginShape(TRIANGLES); + * vertex(30, 75); + * vertex(40, 20); + * vertex(50, 75); + * vertex(60, 20); + * vertex(70, 75); + * vertex(80, 20); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(TRIANGLE_STRIP); + * vertex(30, 75); + * vertex(40, 20); + * vertex(50, 75); + * vertex(60, 20); + * vertex(70, 75); + * vertex(80, 20); + * vertex(90, 75); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(TRIANGLE_FAN); + * vertex(57.5, 50); + * vertex(57.5, 15); + * vertex(92, 50); + * vertex(57.5, 85); + * vertex(22, 50); + * vertex(57.5, 15); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(QUADS); + * vertex(30, 20); + * vertex(30, 75); + * vertex(50, 75); + * vertex(50, 20); + * vertex(65, 20); + * vertex(65, 75); + * vertex(85, 75); + * vertex(85, 20); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(QUAD_STRIP); + * vertex(30, 20); + * vertex(30, 75); + * vertex(50, 20); + * vertex(50, 75); + * vertex(65, 20); + * vertex(65, 75); + * vertex(85, 20); + * vertex(85, 75); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(TESS); + * vertex(20, 20); + * vertex(80, 20); + * vertex(80, 40); + * vertex(40, 40); + * vertex(40, 60); + * vertex(80, 60); + * vertex(80, 80); + * vertex(20, 80); + * endShape(CLOSE); + * + *
                    + * + * @alt + * white square-shape with black outline in middle-right of canvas. + * 4 black points in a square shape in middle-right of canvas. + * 2 horizontal black lines. In the top-right and bottom-right of canvas. + * 3 line shape with horizontal on top, vertical in middle and horizontal bottom. + * square line shape in middle-right of canvas. + * 2 white triangle shapes mid-right canvas. left one pointing up and right down. + * 5 horizontal interlocking and alternating white triangles in mid-right canvas. + * 4 interlocking white triangles in 45 degree rotated square-shape. + * 2 white rectangle shapes in mid-right canvas. Both 20×55. + * 3 side-by-side white rectangles center rect is smaller in mid-right canvas. + * Thick white l-shape with black outline mid-top-left of canvas. + */ + _main.default.prototype.beginShape = function (kind) { + _main.default._validateParameters("beginShape", arguments); + if (this._renderer.isP3D) { + var _this$_renderer; + (_this$_renderer = this._renderer).beginShape.apply( + _this$_renderer, + arguments, + ); + } else { + if ( + kind === constants.POINTS || + kind === constants.LINES || + kind === constants.TRIANGLES || + kind === constants.TRIANGLE_FAN || + kind === constants.TRIANGLE_STRIP || + kind === constants.QUADS || + kind === constants.QUAD_STRIP + ) { + shapeKind = kind; + } else { + shapeKind = null; + } + vertices = []; + contourVertices = []; + } + return this; + }; + /** + * Specifies vertex coordinates for Bezier curves. Each call to + * bezierVertex() defines the position of two control points and + * one anchor point of a Bezier curve, adding a new segment to a + * line or shape. For WebGL mode bezierVertex() can be used in 2D + * as well as 3D mode. 2D mode expects 6 parameters, while 3D mode + * expects 9 parameters (including z coordinates). + * + * The first time bezierVertex() is used within a beginShape() + * call, it must be prefaced with a call to vertex() to set the first anchor + * point. This function must be used between beginShape() and endShape() + * and only when there is no MODE or POINTS parameter specified to + * beginShape(). + * + * @method bezierVertex + * @param {Number} x2 x-coordinate for the first control point + * @param {Number} y2 y-coordinate for the first control point + * @param {Number} x3 x-coordinate for the second control point + * @param {Number} y3 y-coordinate for the second control point + * @param {Number} x4 x-coordinate for the anchor point + * @param {Number} y4 y-coordinate for the anchor point + * @chainable + * + * @example + *
                    + * + * noFill(); + * beginShape(); + * vertex(30, 20); + * bezierVertex(80, 0, 80, 75, 30, 75); + * endShape(); + * + *
                    + * + *
                    + * + * beginShape(); + * vertex(30, 20); + * bezierVertex(80, 0, 80, 75, 30, 75); + * bezierVertex(50, 80, 60, 25, 30, 20); + * endShape(); + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * } + * function draw() { + * orbitControl(); + * background(50); + * strokeWeight(4); + * stroke(255); + * point(-25, 30); + * point(25, 30); + * point(25, -30); + * point(-25, -30); + * + * strokeWeight(1); + * noFill(); + * + * beginShape(); + * vertex(-25, 30); + * bezierVertex(25, 30, 25, -30, -25, -30); + * endShape(); + * + * beginShape(); + * vertex(-25, 30, 20); + * bezierVertex(25, 30, 20, 25, -30, 20, -25, -30, 20); + * endShape(); + * } + * + *
                    + * + * @alt + * crescent-shaped line in middle of canvas. Points facing left. + * white crescent shape in middle of canvas. Points facing left. + * crescent shape in middle of canvas with another crescent shape on positive z-axis. + */ + /** + * @method bezierVertex + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate for the first control point (for WebGL mode) + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the second control point (for WebGL mode) + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 z-coordinate for the anchor point (for WebGL mode) + * @chainable + */ + _main.default.prototype.bezierVertex = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("bezierVertex", args); + if (this._renderer.isP3D) { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).bezierVertex.apply( + _this$_renderer2, + args, + ); + } else { + if (vertices.length === 0) { + _main.default._friendlyError( + "vertex() must be used once before calling bezierVertex()", + "bezierVertex", + ); + } else { + isBezier = true; + var vert = []; + for (var i = 0; i < args.length; i++) { + vert[i] = args[i]; + } + vert.isVert = false; + if (isContour) { + contourVertices.push(vert); + } else { + vertices.push(vert); + } + } + } + return this; + }; + /** + * Specifies vertex coordinates for curves. This function may only + * be used between beginShape() and endShape() and only when there + * is no MODE parameter specified to beginShape(). + * For WebGL mode curveVertex() can be used in 2D as well as 3D mode. + * 2D mode expects 2 parameters, while 3D mode expects 3 parameters. + * + * The first and last points in a series of curveVertex() lines will be used to + * guide the beginning and end of the curve. A minimum of four + * points is required to draw a tiny curve between the second and + * third points. Adding a fifth point with curveVertex() will draw + * the curve between the second, third, and fourth points. The + * curveVertex() function is an implementation of Catmull-Rom + * splines. + * + * @method curveVertex + * @param {Number} x x-coordinate of the vertex + * @param {Number} y y-coordinate of the vertex + * @chainable + * @example + *
                    + * + * strokeWeight(5); + * point(84, 91); + * point(68, 19); + * point(21, 17); + * point(32, 91); + * strokeWeight(1); + * + * noFill(); + * beginShape(); + * curveVertex(84, 91); + * curveVertex(84, 91); + * curveVertex(68, 19); + * curveVertex(21, 17); + * curveVertex(32, 91); + * curveVertex(32, 91); + * endShape(); + * + *
                    + * + * @alt + * Upside-down u-shape line, mid canvas. left point extends beyond canvas view. + */ + /** + * @method curveVertex + * @param {Number} x + * @param {Number} y + * @param {Number} [z] z-coordinate of the vertex (for WebGL mode) + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * } + * function draw() { + * orbitControl(); + * background(50); + * strokeWeight(4); + * stroke(255); + * + * point(-25, 25); + * point(-25, 25); + * point(-25, -25); + * point(25, -25); + * point(25, 25); + * point(25, 25); + * + * strokeWeight(1); + * noFill(); + * + * beginShape(); + * curveVertex(-25, 25); + * curveVertex(-25, 25); + * curveVertex(-25, -25); + * curveVertex(25, -25); + * curveVertex(25, 25); + * curveVertex(25, 25); + * endShape(); + * + * beginShape(); + * curveVertex(-25, 25, 20); + * curveVertex(-25, 25, 20); + * curveVertex(-25, -25, 20); + * curveVertex(25, -25, 20); + * curveVertex(25, 25, 20); + * curveVertex(25, 25, 20); + * endShape(); + * } + * + *
                    + * + * @alt + * Upside-down u-shape line, mid canvas with the same shape in positive z-axis. + */ + _main.default.prototype.curveVertex = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("curveVertex", args); + if (this._renderer.isP3D) { + var _this$_renderer3; + (_this$_renderer3 = this._renderer).curveVertex.apply( + _this$_renderer3, + args, + ); + } else { + isCurve = true; + this.vertex(args[0], args[1]); + } + return this; + }; + /** + * Use the beginContour() and endContour() functions to create negative + * shapes within shapes such as the center of the letter 'O'. beginContour() + * begins recording vertices for the shape and endContour() stops recording. + * The vertices that define a negative shape must "wind" in the opposite + * direction from the exterior shape. First draw vertices for the exterior + * clockwise order, then for internal shapes, draw vertices + * shape in counter-clockwise. + * + * These functions can only be used within a beginShape()/endShape() pair and + * transformations such as translate(), rotate(), and scale() do not work + * within a beginContour()/endContour() pair. It is also not possible to use + * other shapes, such as ellipse() or rect() within. + * + * @method endContour + * @chainable + * @example + *
                    + * + * translate(50, 50); + * stroke(255, 0, 0); + * beginShape(); + * // Exterior part of shape, clockwise winding + * vertex(-40, -40); + * vertex(40, -40); + * vertex(40, 40); + * vertex(-40, 40); + * // Interior part of shape, counter-clockwise winding + * beginContour(); + * vertex(-20, -20); + * vertex(-20, 20); + * vertex(20, 20); + * vertex(20, -20); + * endContour(); + * endShape(CLOSE); + * + *
                    + * + * @alt + * white rect and smaller grey rect with red outlines in center of canvas. + */ + _main.default.prototype.endContour = function () { + if (this._renderer.isP3D) { + return this; + } + var vert = contourVertices[0].slice(); // copy all data + vert.isVert = contourVertices[0].isVert; + vert.moveTo = false; + contourVertices.push(vert); + // prevent stray lines with multiple contours + if (isFirstContour) { + vertices.push(vertices[0]); + isFirstContour = false; + } + for (var i = 0; i < contourVertices.length; i++) { + vertices.push(contourVertices[i]); + } + return this; + }; + /** + * The endShape() function is the companion to beginShape() and may only be + * called after beginShape(). When endShape() is called, all of the image + * data defined since the previous call to beginShape() is written into the image + * buffer. The constant CLOSE is the value for the `mode` parameter to close + * the shape (to connect the beginning and the end). + * When using instancing with endShape() the instancing will not apply to the strokes. + * When the count parameter is used with a value greater than 1, it enables instancing for shapes built when in WEBGL mode. Instancing + * is a feature that allows the GPU to efficiently draw multiples of the same shape. It's often used for particle effects or other + * times when you need a lot of repetition. In order to take advantage of instancing, you will also need to write your own custom + * shader using the gl_InstanceID keyword. You can read more about instancing + * here or by working from the example on this + * page. + * + * @method endShape + * @param {Constant} [mode] use CLOSE to close the shape + * @param {Integer} [count] number of times you want to draw/instance the shape (for WebGL mode). + * @chainable + * @example + *
                    + * + * noFill(); + * + * beginShape(); + * vertex(20, 20); + * vertex(45, 20); + * vertex(45, 80); + * endShape(CLOSE); + * + * beginShape(); + * vertex(50, 20); + * vertex(75, 20); + * vertex(75, 80); + * endShape(); + * + *
                    + * + * @example + *
                    + * + * let fx; + * let vs = `#version 300 es + * + * precision mediump float; + * + * in vec3 aPosition; + * flat out int instanceID; + * + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * + * void main() { + * + * // copy the instance ID to the fragment shader + * instanceID = gl_InstanceID; + * vec4 positionVec4 = vec4(aPosition, 1.0); + * + * // gl_InstanceID represents a numeric value for each instance + * // using gl_InstanceID allows us to move each instance separately + * // here we move each instance horizontally by id * 40 + * float xOffset = float(gl_InstanceID) * 40.0; + * + * // apply the offset to the final position + * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4 - + * vec4(xOffset, 0.0, 0.0, 0.0); + * } + * `; + * let fs = `#version 300 es + * + * precision mediump float; + * + * out vec4 outColor; + * flat in int instanceID; + * uniform float numInstances; + * + * void main() { + * vec4 red = vec4(1.0, 0.0, 0.0, 1.0); + * vec4 blue = vec4(0.0, 0.0, 1.0, 1.0); + * + * // Normalize the instance id + * float normId = float(instanceID) / numInstances; + * + * // Mix between two colors using the normalized instance id + * outColor = mix(red, blue, normId); + * } + * `; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * fx = createShader(vs, fs); + * } + * + * function draw() { + * background(220); + * + * // strokes aren't instanced, and are rather used for debug purposes + * shader(fx); + * fx.setUniform('numInstances', 4); + * + * // this doesn't have to do with instancing, this is just for centering the squares + * translate(25, -10); + * + * // here we draw the squares we want to instance + * beginShape(); + * vertex(0, 0); + * vertex(0, 20); + * vertex(20, 20); + * vertex(20, 0); + * vertex(0, 0); + * endShape(CLOSE, 4); + * + * resetShader(); + * } + * + *
                    + * + * @alt + * Triangle line shape with smallest interior angle on bottom and upside-down L. + */ + _main.default.prototype.endShape = function (mode) { + var count = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 1; + _main.default._validateParameters("endShape", arguments); + if (count < 1) { + console.log( + "🌸 p5.js says: You can not have less than one instance", + ); + count = 1; + } + if (this._renderer.isP3D) { + this._renderer.endShape( + mode, + isCurve, + isBezier, + isQuadratic, + isContour, + shapeKind, + count, + ); + } else { + if (count !== 1) { + console.log( + "🌸 p5.js says: Instancing is only supported in WebGL2 mode", + ); + } + if (vertices.length === 0) { + return this; + } + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } + var closeShape = mode === constants.CLOSE; + // if the shape is closed, the first element is also the last element + if (closeShape && !isContour) { + vertices.push(vertices[0]); + } + this._renderer.endShape( + mode, + vertices, + isCurve, + isBezier, + isQuadratic, + isContour, + shapeKind, + ); + // Reset some settings + isCurve = false; + isBezier = false; + isQuadratic = false; + isContour = false; + isFirstContour = true; + // If the shape is closed, the first element was added as last element. + // We must remove it again to prevent the list of vertices from growing + // over successive calls to endShape(CLOSE) + if (closeShape) { + vertices.pop(); + } + } + return this; + }; + /** + * Specifies vertex coordinates for quadratic Bezier curves. Each call to + * quadraticVertex() defines the position of one control points and one + * anchor point of a Bezier curve, adding a new segment to a line or shape. + * The first time quadraticVertex() is used within a beginShape() call, it + * must be prefaced with a call to vertex() to set the first anchor point. + * For WebGL mode quadraticVertex() can be used in 2D as well as 3D mode. + * 2D mode expects 4 parameters, while 3D mode expects 6 parameters + * (including z coordinates). + * + * This function must be used between beginShape() and endShape() + * and only when there is no MODE or POINTS parameter specified to + * beginShape(). + * + * @method quadraticVertex + * @param {Number} cx x-coordinate for the control point + * @param {Number} cy y-coordinate for the control point + * @param {Number} x3 x-coordinate for the anchor point + * @param {Number} y3 y-coordinate for the anchor point + * @chainable + * + * @example + *
                    + * + * strokeWeight(5); + * point(20, 20); + * point(80, 20); + * point(50, 50); + * + * noFill(); + * strokeWeight(1); + * beginShape(); + * vertex(20, 20); + * quadraticVertex(80, 20, 50, 50); + * endShape(); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * point(20, 20); + * point(80, 20); + * point(50, 50); + * + * point(20, 80); + * point(80, 80); + * point(80, 60); + * + * noFill(); + * strokeWeight(1); + * beginShape(); + * vertex(20, 20); + * quadraticVertex(80, 20, 50, 50); + * quadraticVertex(20, 80, 80, 80); + * vertex(80, 60); + * endShape(); + * + *
                    + * + * @alt + * arched-shaped black line with 4 pixel thick stroke weight. + * backwards s-shaped black line with 4 pixel thick stroke weight. + */ + /** + * @method quadraticVertex + * @param {Number} cx + * @param {Number} cy + * @param {Number} cz z-coordinate for the control point (for WebGL mode) + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the anchor point (for WebGL mode) + * @chainable + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * } + * function draw() { + * orbitControl(); + * background(50); + * strokeWeight(4); + * stroke(255); + * + * point(-35, -35); + * point(35, -35); + * point(0, 0); + * point(-35, 35); + * point(35, 35); + * point(35, 10); + * + * strokeWeight(1); + * noFill(); + * + * beginShape(); + * vertex(-35, -35); + * quadraticVertex(35, -35, 0, 0); + * quadraticVertex(-35, 35, 35, 35); + * vertex(35, 10); + * endShape(); + * + * beginShape(); + * vertex(-35, -35, 20); + * quadraticVertex(35, -35, 20, 0, 0, 20); + * quadraticVertex(-35, 35, 20, 35, 35, 20); + * vertex(35, 10, 20); + * endShape(); + * } + * + *
                    + * + * @alt + * backwards s-shaped black line with the same s-shaped line in positive z-axis. + */ + _main.default.prototype.quadraticVertex = function () { + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters("quadraticVertex", args); + if (this._renderer.isP3D) { + var _this$_renderer4; + (_this$_renderer4 = this._renderer).quadraticVertex.apply( + _this$_renderer4, + args, + ); + } else { + //if we're drawing a contour, put the points into an + // array for inside drawing + if (this._contourInited) { + var pt = {}; + pt.x = args[0]; + pt.y = args[1]; + pt.x3 = args[2]; + pt.y3 = args[3]; + pt.type = constants.QUADRATIC; + this._contourVertices.push(pt); + return this; + } + if (vertices.length > 0) { + isQuadratic = true; + var vert = []; + for (var i = 0; i < args.length; i++) { + vert[i] = args[i]; + } + vert.isVert = false; + if (isContour) { + contourVertices.push(vert); + } else { + vertices.push(vert); + } + } else { + _main.default._friendlyError( + "vertex() must be used once before calling quadraticVertex()", + "quadraticVertex", + ); + } + } + return this; + }; + /** + * All shapes are constructed by connecting a series of vertices. vertex() + * is used to specify the vertex coordinates for points, lines, triangles, + * quads, and polygons. It is used exclusively within the beginShape() and + * endShape() functions. + * + * @method vertex + * @param {Number} x x-coordinate of the vertex + * @param {Number} y y-coordinate of the vertex + * @chainable + * @example + *
                    + * + * strokeWeight(3); + * beginShape(POINTS); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                    + * + *
                    + * + * createCanvas(100, 100, WEBGL); + * background(240, 240, 240); + * fill(237, 34, 93); + * noStroke(); + * beginShape(); + * vertex(0, 35); + * vertex(35, 0); + * vertex(0, -35); + * vertex(-35, 0); + * endShape(); + * + *
                    + * + *
                    + * + * createCanvas(100, 100, WEBGL); + * background(240, 240, 240); + * fill(237, 34, 93); + * noStroke(); + * beginShape(); + * vertex(-10, 10); + * vertex(0, 35); + * vertex(10, 10); + * vertex(35, 0); + * vertex(10, -8); + * vertex(0, -35); + * vertex(-10, -8); + * vertex(-35, 0); + * endShape(); + * + *
                    + * + *
                    + * + * strokeWeight(3); + * stroke(237, 34, 93); + * beginShape(LINES); + * vertex(10, 35); + * vertex(90, 35); + * vertex(10, 65); + * vertex(90, 65); + * vertex(35, 10); + * vertex(35, 90); + * vertex(65, 10); + * vertex(65, 90); + * endShape(); + * + *
                    + * + *
                    + * + * // Click to change the number of sides. + * // In WebGL mode, custom shapes will only + * // display hollow fill sections when + * // all calls to vertex() use the same z-value. + * + * let sides = 3; + * let angle, px, py; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * fill(237, 34, 93); + * strokeWeight(3); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateZ(frameCount * 0.01); + * ngon(sides, 0, 0, 80); + * } + * + * function mouseClicked() { + * if (sides > 6) { + * sides = 3; + * } else { + * sides++; + * } + * } + * + * function ngon(n, x, y, d) { + * beginShape(TESS); + * for (let i = 0; i < n + 1; i++) { + * angle = TWO_PI / n * i; + * px = x + sin(angle) * d / 2; + * py = y - cos(angle) * d / 2; + * vertex(px, py, 0); + * } + * for (let i = 0; i < n + 1; i++) { + * angle = TWO_PI / n * i; + * px = x + sin(angle) * d / 4; + * py = y - cos(angle) * d / 4; + * vertex(px, py, 0); + * } + * endShape(); + * } + * + *
                    + * @alt + * 4 black points in a square shape in middle-right of canvas. + * 4 points making a diamond shape. + * 8 points making a star. + * 8 points making 4 lines. + * A rotating 3D shape with a hollow section in the middle. + */ + /** + * @method vertex + * @param {Number} x + * @param {Number} y + * @param {Number} [z] z-coordinate of the vertex. + * Defaults to 0 if not specified. + * @chainable + */ + /** + * @method vertex + * @param {Number} x + * @param {Number} y + * @param {Number} [z] + * @param {Number} [u] the vertex's texture u-coordinate + * @param {Number} [v] the vertex's texture v-coordinate + * @chainable + */ + _main.default.prototype.vertex = function (x, y, moveTo, u, v) { + if (this._renderer.isP3D) { + var _this$_renderer5; + (_this$_renderer5 = this._renderer).vertex.apply( + _this$_renderer5, + arguments, + ); + } else { + var vert = []; + vert.isVert = true; + vert[0] = x; + vert[1] = y; + vert[2] = 0; + vert[3] = 0; + vert[4] = 0; + vert[5] = this._renderer._getFill(); + vert[6] = this._renderer._getStroke(); + if (moveTo) { + vert.moveTo = moveTo; + } + if (isContour) { + if (contourVertices.length === 0) { + vert.moveTo = true; + } + contourVertices.push(vert); + } else { + vertices.push(vert); + } + } + return this; + }; + /** + * Sets the 3d vertex normal to use for subsequent vertices drawn with + * vertex(). A normal is a vector that is generally + * nearly perpendicular to a shape's surface which controls how much light will + * be reflected from that part of the surface. + * + * @method normal + * @param {Vector} vector A p5.Vector representing the vertex normal. + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * } + * + * function draw() { + * background(255); + * rotateY(frameCount / 100); + * normalMaterial(); + * beginShape(TRIANGLE_STRIP); + * normal(-0.4, 0.4, 0.8); + * vertex(-30, 30, 0); + * + * normal(0, 0, 1); + * vertex(-30, -30, 30); + * vertex(30, 30, 30); + * + * normal(0.4, -0.4, 0.8); + * vertex(30, -30, 0); + * endShape(); + * } + * + *
                    + */ + /** + * @method normal + * @param {Number} x The x component of the vertex normal. + * @param {Number} y The y component of the vertex normal. + * @param {Number} z The z component of the vertex normal. + * @chainable + */ + _main.default.prototype.normal = function (x, y, z) { + var _this$_renderer6; + this._assert3d("normal"); + _main.default._validateParameters("normal", arguments); + (_this$_renderer6 = this._renderer).normal.apply( + _this$_renderer6, + arguments, + ); + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../constants": 286, + "../main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 309: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } // requestAnim shim layer by Paul Irish + // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + // http://my.opera.com/emoller/blog/2011/12/20/ + // requestanimationframe-for-smart-er-animating + // requestAnimationFrame polyfill by Erik Möller + // fixes from Paul Irish and Tino Zijdel + + window.requestAnimationFrame = (function () { + return ( + window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function (callback, element) { + // should '60' here be framerate? + window.setTimeout(callback, 1000 / 60); + } + ); + })(); + /** + * shim for Uint8ClampedArray.slice + * (allows arrayCopy to work with pixels[]) + * with thanks to http://halfpapstudios.com/blog/tag/html5-canvas/ + * Enumerable set to false to protect for...in from + * Uint8ClampedArray.prototype pollution. + */ + (function () { + if ( + typeof Uint8ClampedArray !== "undefined" && + !Uint8ClampedArray.prototype.slice + ) { + Object.defineProperty(Uint8ClampedArray.prototype, "slice", { + value: Array.prototype.slice, + writable: true, + configurable: true, + enumerable: false, + }); + } + })(); + /** + * this is implementation of Object.assign() which is unavailable in + * IE11 and (non-Chrome) Android browsers. + * The assign() method is used to copy the values of all enumerable + * own properties from one or more source objects to a target object. + * It will return the target object. + * Modified from https://github.com/ljharb/object.assign + */ + (function () { + if (!Object.assign) { + var keys = Object.keys; + var defineProperty = Object.defineProperty; + var canBeObject = function canBeObject(obj) { + return typeof obj !== "undefined" && obj !== null; + }; + var hasSymbols = + typeof Symbol === "function" && _typeof(Symbol()) === "symbol"; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + var isEnumerableOn = function isEnumerableOn(obj) { + return function isEnumerable(prop) { + return propIsEnumerable.call(obj, prop); + }; + }; + // per ES6 spec, this function has to have a length of 2 + var assignShim = function assign(target, source1) { + if (!canBeObject(target)) { + throw new TypeError("target must be an object"); + } + var objTarget = Object(target); + var s, source, i, props; + for (s = 1; s < arguments.length; ++s) { + source = Object(arguments[s]); + props = keys(source); + if (hasSymbols && Object.getOwnPropertySymbols) { + var _props; + (_props = props).push.apply( + _props, + _toConsumableArray( + Object.getOwnPropertySymbols(source).filter( + isEnumerableOn(source), + ), + ), + ); + } + for (i = 0; i < props.length; ++i) { + objTarget[props[i]] = source[props[i]]; + } + } + return objTarget; + }; + defineProperty(Object, "assign", { + value: assignShim, + configurable: true, + enumerable: false, + writable: true, + }); + } + })(); + }, + { + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.assign": 194, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-clamped-array": 253, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 310: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.assign"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Structure + * @submodule Structure + * @for p5 + * @requires core + */ + /** + * Stops p5.js from continuously executing the code within draw(). + * If loop() is called, the code in draw() + * begins to run continuously again. If using noLoop() + * in setup(), it should be the last line inside the block. * - * preserveDrawingBuffer - if true the buffers will not be cleared and - * and will preserve their values until cleared or overwritten by author - * (note that p5 clears automatically on draw loop) - * default is true + * When noLoop() is used, it's not possible to manipulate + * or access the screen inside event handling functions such as + * mousePressed() or + * keyPressed(). Instead, use those functions to + * call redraw() or loop(), + * which will run draw(), which can update the screen + * properly. This means that when noLoop() has been + * called, no drawing can happen, and functions like saveFrames() + * or loadPixels() may not be used. * - * perPixelLighting - if true, per-pixel lighting will be used in the - * lighting shader otherwise per-vertex lighting is used. - * default is true. + * Note that if the sketch is resized, redraw() will + * be called to update the sketch, even after noLoop() + * has been specified. Otherwise, the sketch would enter an odd state until + * loop() was called. * - * version - either 1 or 2, to specify which WebGL version to ask for. By - * default, WebGL 2 will be requested. If WebGL2 is not available, it will - * fall back to WebGL 1. You can check what version is used with by looking at - * the global `webglVersion` property. + * Use isLooping() to check the current state of loop(). * - * @method setAttributes - * @for p5 - * @param {String} key Name of attribute - * @param {Boolean} value New value of named attribute + * @method noLoop * @example *
                    * * function setup() { - * createCanvas(100, 100, WEBGL); + * createCanvas(100, 100); + * background(200); + * noLoop(); * } - * + * function draw() { - * background(255); - * push(); - * rotateZ(frameCount * 0.02); - * rotateX(frameCount * 0.02); - * rotateY(frameCount * 0.02); - * fill(0, 0, 0); - * box(50); - * pop(); + * line(10, 10, 90, 90); * } * *
                    - *
                    - * Now with the antialias attribute set to true. - *
                    + * *
                    * + * let x = 0; * function setup() { - * setAttributes('antialias', true); - * createCanvas(100, 100, WEBGL); + * createCanvas(100, 100); * } * * function draw() { - * background(255); - * push(); - * rotateZ(frameCount * 0.02); - * rotateX(frameCount * 0.02); - * rotateY(frameCount * 0.02); - * fill(0, 0, 0); - * box(50); - * pop(); + * background(204); + * x = x + 0.1; + * if (x > width) { + * x = 0; + * } + * line(x, 0, x, height); * } - * - *
                    * - *
                    - * - * // press the mouse button to disable perPixelLighting - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * fill(255); + * function mousePressed() { + * noLoop(); * } * - * let lights = [ - * { c: '#f00', t: 1.12, p: 1.91, r: 0.2 }, - * { c: '#0f0', t: 1.21, p: 1.31, r: 0.2 }, - * { c: '#00f', t: 1.37, p: 1.57, r: 0.2 }, - * { c: '#ff0', t: 1.12, p: 1.91, r: 0.7 }, - * { c: '#0ff', t: 1.21, p: 1.31, r: 0.7 }, - * { c: '#f0f', t: 1.37, p: 1.57, r: 0.7 } - * ]; + * function mouseReleased() { + * loop(); + * } + * + *
                    * - * function draw() { - * let t = millis() / 1000 + 1000; - * background(0); - * directionalLight(color('#222'), 1, 1, 1); + * @alt + * 113 pixel long line extending from top-left to bottom right of canvas. + * horizontal line moves slowly from left. Loops but stops on mouse press. + */ + + _main.default.prototype.noLoop = function () { + this._loop = false; + }; + /** + * By default, p5.js loops through draw() continuously, executing the code within + * it. However, the draw() loop may be stopped by calling + * noLoop(). In that case, the draw() + * loop can be resumed with loop(). + * + * Avoid calling loop() from inside setup(). + * + * Use isLooping() to check the current state of loop(). + * + * @method loop + * @example + *
                    + * + * let x = 0; + * function setup() { + * createCanvas(100, 100); + * noLoop(); + * } + * + * function draw() { + * background(204); + * x = x + 0.1; + * if (x > width) { + * x = 0; + * } + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * loop(); + * } + * + * function mouseReleased() { + * noLoop(); + * } + * + *
                    + * + * @alt + * horizontal line moves slowly from left. Loops but stops on mouse press. + */ + _main.default.prototype.loop = function () { + if (!this._loop) { + this._loop = true; + if (this._setupDone) { + this._draw(); + } + } + }; + /** + * By default, p5.js loops through draw() continuously, + * executing the code within it. If the sketch is stopped with + * noLoop() or resumed with loop(), + * isLooping() returns the current state for use within custom event handlers. + * + * @method isLooping + * @returns {boolean} + * @example + *
                    + * + * let checkbox, button, colBG, colFill; + * + * function setup() { + * createCanvas(100, 100); + * + * button = createButton('Colorize if loop()'); + * button.position(0, 120); + * button.mousePressed(changeBG); + * + * checkbox = createCheckbox('loop()', true); + * checkbox.changed(checkLoop); + * + * colBG = color(0); + * colFill = color(255); + * } + * + * function changeBG() { + * if (isLooping()) { + * colBG = color(random(255), random(255), random(255)); + * colFill = color(random(255), random(255), random(255)); + * } + * } + * + * function checkLoop() { + * if (this.checked()) { + * loop(); + * } else { + * noLoop(); + * } + * } + * + * function draw() { + * background(colBG); + * fill(colFill); + * ellipse(frameCount % width, height / 2, 50); + * } + * + *
                    + * + * @alt + * Ellipse moves slowly from left. Checkbox toggles loop()/noLoop(). + * Button colorizes sketch if isLooping(). + * + */ + _main.default.prototype.isLooping = function () { + return this._loop; + }; + /** + * The push() function saves the current drawing style + * settings and transformations, while pop() restores these + * settings. Note that these functions are always used together. They allow you to + * change the style and transformation settings and later return to what you had. + * When a new state is started with push(), it builds on + * the current style and transform information. The push() + * and pop() functions can be embedded to provide more + * control. (See the second example for a demonstration.) + * + * push() stores information related to the current transformation state + * and style settings controlled by the following functions: + * fill(), + * noFill(), + * noStroke(), + * stroke(), + * tint(), + * noTint(), + * strokeWeight(), + * strokeCap(), + * strokeJoin(), + * imageMode(), + * rectMode(), + * ellipseMode(), + * colorMode(), + * textAlign(), + * textFont(), + * textSize(), + * textLeading(), + * applyMatrix(), + * resetMatrix(), + * rotate(), + * scale(), + * shearX(), + * shearY(), + * translate(), + * noiseSeed(). + * + * In WEBGL mode additional style settings are stored. These are controlled by the + * following functions: setCamera(), + * ambientLight(), + * directionalLight(), + * pointLight(), texture(), + * specularMaterial(), + * shininess(), + * normalMaterial() + * and shader(). + * + * @method push + * @example + *
                    + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * strokeWeight(10); + * fill(204, 153, 0); + * translate(50, 0); + * ellipse(0, 50, 33, 33); // Middle circle + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                    + * + *
                    + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * strokeWeight(10); + * fill(204, 153, 0); + * ellipse(33, 50, 33, 33); // Left-middle circle + * + * push(); // Start another new drawing state + * stroke(0, 102, 153); + * ellipse(66, 50, 33, 33); // Right-middle circle + * pop(); // Restore previous state + * + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                    + * + * @alt + * Gold ellipse + thick black outline @center 2 white ellipses on left and right. + * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. + */ + _main.default.prototype.push = function () { + this._styles.push({ + props: { + _colorMode: this._colorMode, + }, + renderer: this._renderer.push(), + }); + }; + /** + * The push() function saves the current drawing style + * settings and transformations, while pop() restores + * these settings. Note that these functions are always used together. They allow + * you to change the style and transformation settings and later return to what + * you had. When a new state is started with push(), it + * builds on the current style and transform information. The push() + * and pop() functions can be embedded to provide more + * control. (See the second example for a demonstration.) + * + * push() stores information related to the current transformation state + * and style settings controlled by the following functions: + * fill(), + * noFill(), + * noStroke(), + * stroke(), + * tint(), + * noTint(), + * strokeWeight(), + * strokeCap(), + * strokeJoin(), + * imageMode(), + * rectMode(), + * ellipseMode(), + * colorMode(), + * textAlign(), + * textFont(), + * textSize(), + * textLeading(), + * applyMatrix(), + * resetMatrix(), + * rotate(), + * scale(), + * shearX(), + * shearY(), + * translate(), + * noiseSeed(). + * + * In WEBGL mode additional style settings are stored. These are controlled by + * the following functions: + * setCamera(), + * ambientLight(), + * directionalLight(), + * pointLight(), + * texture(), + * specularMaterial(), + * shininess(), + * normalMaterial() and + * shader(). + * + * @method pop + * @example + *
                    + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * translate(50, 0); + * strokeWeight(10); + * fill(204, 153, 0); + * ellipse(0, 50, 33, 33); // Middle circle + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                    + * + *
                    + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * strokeWeight(10); + * fill(204, 153, 0); + * ellipse(33, 50, 33, 33); // Left-middle circle + * + * push(); // Start another new drawing state + * stroke(0, 102, 153); + * ellipse(66, 50, 33, 33); // Right-middle circle + * pop(); // Restore previous state + * + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                    + * + * @alt + * Gold ellipse + thick black outline @center 2 white ellipses on left and right. + * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. + */ + _main.default.prototype.pop = function () { + var style = this._styles.pop(); + if (style) { + this._renderer.pop(style.renderer); + Object.assign(this, style.props); + } else { + console.warn("pop() was called without matching push()"); + } + }; + /** + * Executes the code within draw() one time. This + * function allows the program to update the display window only when necessary, + * for example when an event registered by mousePressed() + * or keyPressed() occurs. + * + * In structuring a program, it only makes sense to call redraw() + * within events such as mousePressed(). This + * is because redraw() does not run + * draw() immediately (it only sets a flag that indicates + * an update is needed). + * + * The redraw() function does not work properly when + * called inside draw().To enable/disable animations, + * use loop() and noLoop(). + * + * In addition you can set the number of redraws per method call. Just + * add an integer as single parameter for the number of redraws. + * + * @method redraw + * @param {Integer} [n] Redraw for n-times. The default value is 1. + * @example + *
                    + * let x = 0; + * + * function setup() { + * createCanvas(100, 100); + * noLoop(); + * } + * + * function draw() { + * background(204); + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * x += 1; + * redraw(); + * } + * + *
                    + * + *
                    + * + * let x = 0; + * + * function setup() { + * createCanvas(100, 100); + * noLoop(); + * } + * + * function draw() { + * background(204); + * x += 1; + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * redraw(5); + * } + * + *
                    + * + * @alt + * black line on far left of canvas + * black line on far left of canvas + */ + _main.default.prototype.redraw = function (n) { + if (this._inUserDraw || !this._setupDone) { + return; + } + var numberOfRedraws = parseInt(n); + if (isNaN(numberOfRedraws) || numberOfRedraws < 1) { + numberOfRedraws = 1; + } + var context = this._isGlobal ? window : this; + if (typeof context.draw === "function") { + if (typeof context.setup === "undefined") { + context.scale(context._pixelDensity, context._pixelDensity); + } + for ( + var idxRedraw = 0; + idxRedraw < numberOfRedraws; + idxRedraw++ + ) { + context.resetMatrix(); + if ( + this._accessibleOutputs.grid || + this._accessibleOutputs.text + ) { + this._updateAccsOutput(); + } + if (context._renderer.isP3D) { + context._renderer._update(); + } + context._setProperty("frameCount", context.frameCount + 1); + this.callRegisteredHooksFor("pre"); + this._inUserDraw = true; + try { + context.draw(); + } finally { + this._inUserDraw = false; + } + this.callRegisteredHooksFor("post"); + } + } + }; + /** + * The `p5()` constructor enables you to activate "instance mode" instead of normal + * "global mode". This is an advanced topic. A short description and example is + * included below. Please see + * + * Dan Shiffman's Coding Train video tutorial or this + * tutorial page + * for more info. + * + * By default, all p5.js functions are in the global namespace (i.e. bound to the window + * object), meaning you can call them simply `ellipse()`, `fill()`, etc. However, this + * might be inconvenient if you are mixing with other JS libraries (synchronously or + * asynchronously) or writing long programs of your own. p5.js currently supports a + * way around this problem called "instance mode". In instance mode, all p5 functions + * are bound up in a single variable instead of polluting your global namespace. + * + * Optionally, you can specify a default container for the canvas and any other elements + * to append to with a second argument. You can give the ID of an element in your html, + * or an html node itself. + * + * Note that creating instances like this also allows you to have more than one p5 sketch on + * a single web page, as they will each be wrapped up with their own set up variables. Of + * course, you could also use iframes to have multiple sketches in global mode. + * + * @method p5 + * @param {Object} sketch a function containing a p5.js sketch + * @param {String|Object} node ID or pointer to HTML DOM node to contain sketch in + * @example + *
                    + * const s = p => { + * let x = 100; + * let y = 100; + * + * p.setup = function() { + * p.createCanvas(700, 410); + * }; + * + * p.draw = function() { + * p.background(0); + * p.fill(255); + * p.rect(x, y, 50, 50); + * }; + * }; + * + * new p5(s); // invoke p5 + *
                    + * + * @alt + * white rectangle on black background + */ + var _default = _main.default; + exports.default = _default; + }, + { + "./main": 298, + "core-js/modules/es.object.assign": 194, + }, + ], + 311: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("./main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Transform + * @submodule Transform + * @for p5 + * @requires core + * @requires constants + */ + /** + * Multiplies the current matrix by the one specified through the parameters. + * This is a powerful operation that can perform the equivalent of translate, + * scale, shear and rotate all at once. You can learn more about transformation + * matrices on + * Wikipedia. + * + * The naming of the arguments here follows the naming of the + * WHATWG specification and corresponds to a + * transformation matrix of the + * form: + * + * > The transformation matrix used when applyMatrix is called + * + * The transformation matrix used when applyMatrix is called with 4x4 matrix + * + * @method applyMatrix + * @param {Array} arr an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values) + * @chainable + * @example + *
                    + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * background(200); + * // Equivalent to translate(x, y); + * applyMatrix(1, 0, 0, 1, 40 + step, 50); + * rect(0, 0, 50, 50); + * } + * + *
                    + * + *
                    + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * background(200); + * translate(50, 50); + * // Equivalent to scale(x, y); + * applyMatrix(1 / step, 0, 0, 1 / step, 0, 0); + * rect(0, 0, 50, 50); + * } + * + *
                    + * + *
                    + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * let angle = map(step, 0, 20, 0, TWO_PI); + * let cos_a = cos(angle); + * let sin_a = sin(angle); + * background(200); + * translate(50, 50); + * // Equivalent to rotate(angle); + * applyMatrix(cos_a, sin_a, -sin_a, cos_a, 0, 0); + * rect(0, 0, 50, 50); + * } + * + *
                    + * + *
                    + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * let angle = map(step, 0, 20, -PI / 4, PI / 4); + * background(200); + * translate(50, 50); + * // equivalent to shearX(angle); + * let shear_factor = 1 / tan(PI / 2 - angle); + * applyMatrix(1, 0, shear_factor, 1, 0, 0); + * rect(0, 0, 50, 50); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noFill(); + * } + * + * function draw() { + * background(200); + * rotateY(PI / 6); + * stroke(153); + * box(35); + * let rad = millis() / 1000; + * // Set rotation angles + * let ct = cos(rad); + * let st = sin(rad); + * // Matrix for rotation around the Y axis + * applyMatrix( + * ct, 0.0, st, 0.0, + * 0.0, 1.0, 0.0, 0.0, + * -st, 0.0, ct, 0.0, + * 0.0, 0.0, 0.0, 1.0 + * ); + * stroke(255); + * box(50); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * let testMatrix = [1, 0, 0, 1, 0, 0]; + * applyMatrix(testMatrix); + * rect(0, 0, 50, 50); + * } + * + *
                    + * + * @alt + * A rectangle translating to the right + * A rectangle shrinking to the center + * A rectangle rotating clockwise about the center + * A rectangle shearing + * A rectangle in the upper left corner + */ + /** + * @method applyMatrix + * @param {Number} a numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} b numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} c numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} d numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} e numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} f numbers which define the 2×3 or 4×4 matrix to be multiplied + * @chainable + */ + /** + * @method applyMatrix + * @param {Number} a + * @param {Number} b + * @param {Number} c + * @param {Number} d + * @param {Number} e + * @param {Number} f + * @param {Number} g numbers which define the 4×4 matrix to be multiplied + * @param {Number} h numbers which define the 4×4 matrix to be multiplied + * @param {Number} i numbers which define the 4×4 matrix to be multiplied + * @param {Number} j numbers which define the 4×4 matrix to be multiplied + * @param {Number} k numbers which define the 4×4 matrix to be multiplied + * @param {Number} l numbers which define the 4×4 matrix to be multiplied + * @param {Number} m numbers which define the 4×4 matrix to be multiplied + * @param {Number} n numbers which define the 4×4 matrix to be multiplied + * @param {Number} o numbers which define the 4×4 matrix to be multiplied + * @param {Number} p numbers which define the 4×4 matrix to be multiplied + * @chainable + */ + + _main.default.prototype.applyMatrix = function () { + var isTypedArray = + (arguments.length <= 0 ? undefined : arguments[0]) instanceof + Object.getPrototypeOf(Uint8Array); + if ( + Array.isArray(arguments.length <= 0 ? undefined : arguments[0]) || + isTypedArray + ) { + var _this$_renderer; + (_this$_renderer = this._renderer).applyMatrix.apply( + _this$_renderer, + _toConsumableArray( + arguments.length <= 0 ? undefined : arguments[0], + ), + ); + } else { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).applyMatrix.apply( + _this$_renderer2, + arguments, + ); + } + return this; + }; + /** + * Replaces the current matrix with the identity matrix. + * + * @method resetMatrix + * @chainable + * @example + *
                    + * + * translate(50, 50); + * applyMatrix(0.5, 0.5, -0.5, 0.5, 0, 0); + * rect(0, 0, 20, 20); + * // Note that the translate is also reset. + * resetMatrix(); + * rect(0, 0, 20, 20); + * + *
                    + * + * @alt + * A rotated rectangle in the center with another at the top left corner + */ + _main.default.prototype.resetMatrix = function () { + this._renderer.resetMatrix(); + return this; + }; + /** + * Rotates a shape by the amount specified by the angle parameter. This + * function accounts for angleMode, so angles + * can be entered in either RADIANS or DEGREES. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * Transformations apply to everything that happens after and subsequent + * calls to the function accumulate the effect. For example, calling + * rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). + * All transformations are reset when draw() begins again. + * + * Technically, rotate() multiplies the current transformation matrix + * by a rotation matrix. This function can be further controlled by + * push() and pop(). + * + * @method rotate + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @param {p5.Vector|Number[]} [axis] (in 3d) the axis to rotate around + * @chainable + * @example + *
                    + * + * translate(width / 2, height / 2); + * rotate(PI / 3.0); + * rect(-26, -26, 52, 52); + * + *
                    + * + * @alt + * white 52×52 rect with black outline at center rotated counter 45 degrees + */ + _main.default.prototype.rotate = function (angle, axis) { + _main.default._validateParameters("rotate", arguments); + this._renderer.rotate(this._toRadians(angle), axis); + return this; + }; + /** + * Rotates a shape around X axis by the amount specified in angle parameter. + * The angles can be entered in either RADIANS or DEGREES. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * All transformations are reset when draw() begins again. + * + * @method rotateX + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(255); + * rotateX(millis() / 1000); + * box(); + * } + * + *
                    + * + * @alt + * 3d box rotating around the x axis. + */ + _main.default.prototype.rotateX = function (angle) { + this._assert3d("rotateX"); + _main.default._validateParameters("rotateX", arguments); + this._renderer.rotateX(this._toRadians(angle)); + return this; + }; + /** + * Rotates a shape around Y axis by the amount specified in angle parameter. + * The angles can be entered in either RADIANS or DEGREES. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * All transformations are reset when draw() begins again. + * + * @method rotateY + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(255); + * rotateY(millis() / 1000); + * box(); + * } + * + *
                    + * + * @alt + * 3d box rotating around the y axis. + */ + _main.default.prototype.rotateY = function (angle) { + this._assert3d("rotateY"); + _main.default._validateParameters("rotateY", arguments); + this._renderer.rotateY(this._toRadians(angle)); + return this; + }; + /** + * Rotates a shape around Z axis by the amount specified in angle parameter. + * The angles can be entered in either RADIANS or DEGREES. + * + * This method works in WEBGL mode only. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * All transformations are reset when draw() begins again. + * + * @method rotateZ + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(255); + * rotateZ(millis() / 1000); + * box(); + * } + * + *
                    + * + * @alt + * 3d box rotating around the z axis. + */ + _main.default.prototype.rotateZ = function (angle) { + this._assert3d("rotateZ"); + _main.default._validateParameters("rotateZ", arguments); + this._renderer.rotateZ(this._toRadians(angle)); + return this; + }; + /** + * Increases or decreases the size of a shape by expanding or contracting + * vertices. Objects always scale from their relative origin to the + * coordinate system. Scale values are specified as decimal percentages. + * For example, the function call scale(2.0) increases the dimension of a + * shape by 200%. + * + * Transformations apply to everything that happens after and subsequent + * calls to the function multiply the effect. For example, calling scale(2.0) + * and then scale(1.5) is the same as scale(3.0). If scale() is called + * within draw(), the transformation is reset when the loop begins again. + * + * Using this function with the z parameter is only available in WEBGL mode. + * This function can be further controlled with push() and pop(). + * + * @method scale + * @param {Number|p5.Vector|Number[]} s + * percent to scale the object, or percentage to + * scale the object in the x-axis if multiple arguments + * are given + * @param {Number} [y] percent to scale the object in the y-axis + * @param {Number} [z] percent to scale the object in the z-axis (webgl only) + * @chainable + * @example + *
                    + * + * rect(30, 20, 50, 50); + * scale(0.5); + * rect(30, 20, 50, 50); + * + *
                    + * + *
                    + * + * rect(30, 20, 50, 50); + * scale(0.5, 1.3); + * rect(30, 20, 50, 50); + * + *
                    + * + * @alt + * white 52×52 rect with black outline at center rotated counter 45 degrees + * 2 white rects with black outline- 1 50×50 at center. other 25×65 bottom left + */ + /** + * @method scale + * @param {p5.Vector|Number[]} scales per-axis percents to scale the object + * @chainable + */ + _main.default.prototype.scale = function (x, y, z) { + _main.default._validateParameters("scale", arguments); + // Only check for Vector argument type if Vector is available + if (x instanceof _main.default.Vector) { + var v = x; + x = v.x; + y = v.y; + z = v.z; + } else if (x instanceof Array) { + var rg = x; + x = rg[0]; + y = rg[1]; + z = rg[2] || 1; + } + if (isNaN(y)) { + y = z = x; + } else if (isNaN(z)) { + z = 1; + } + this._renderer.scale.call(this._renderer, x, y, z); + return this; + }; + /** + * Shears a shape around the x-axis by the amount specified by the angle + * parameter. Angles should be specified in the current angleMode. + * Objects are always sheared around their relative position to the origin + * and positive numbers shear objects in a clockwise direction. + * + * Transformations apply to everything that happens after and subsequent + * calls to the function accumulates the effect. For example, calling + * shearX(PI/2) and then shearX(PI/2) is the same as shearX(PI). + * If shearX() is called within the draw(), + * the transformation is reset when the loop begins again. + * + * Technically, shearX() multiplies the current + * transformation matrix by a rotation matrix. This function can be further + * controlled by the push() and pop() functions. + * + * @method shearX + * @param {Number} angle angle of shear specified in radians or degrees, + * depending on current angleMode + * @chainable + * @example + *
                    + * + * translate(width / 4, height / 4); + * shearX(PI / 4.0); + * rect(0, 0, 30, 30); + * + *
                    + * + * @alt + * white irregular quadrilateral with black outline at top middle. + */ + _main.default.prototype.shearX = function (angle) { + _main.default._validateParameters("shearX", arguments); + var rad = this._toRadians(angle); + this._renderer.applyMatrix(1, 0, Math.tan(rad), 1, 0, 0); + return this; + }; + /** + * Shears a shape around the y-axis the amount specified by the angle + * parameter. Angles should be specified in the current angleMode. Objects + * are always sheared around their relative position to the origin and + * positive numbers shear objects in a clockwise direction. + * + * Transformations apply to everything that happens after and subsequent + * calls to the function accumulates the effect. For example, calling + * shearY(PI/2) and then shearY(PI/2) is the same as shearY(PI). If + * shearY() is called within the draw(), the transformation is reset when + * the loop begins again. + * + * Technically, shearY() multiplies the current transformation matrix by a + * rotation matrix. This function can be further controlled by the + * push() and pop() functions. + * + * @method shearY + * @param {Number} angle angle of shear specified in radians or degrees, + * depending on current angleMode + * @chainable + * @example + *
                    + * + * translate(width / 4, height / 4); + * shearY(PI / 4.0); + * rect(0, 0, 30, 30); + * + *
                    + * + * @alt + * white irregular quadrilateral with black outline at middle bottom. + */ + _main.default.prototype.shearY = function (angle) { + _main.default._validateParameters("shearY", arguments); + var rad = this._toRadians(angle); + this._renderer.applyMatrix(1, Math.tan(rad), 0, 1, 0, 0); + return this; + }; + /** + * Specifies an amount to displace objects within the display window. + * The x parameter specifies left/right translation, the y parameter + * specifies up/down translation. * - * for (let i = 0; i < lights.length; i++) { - * let light = lights[i]; - * pointLight( - * color(light.c), - * p5.Vector.fromAngles(t * light.t, t * light.p, width * light.r) - * ); - * } + * Transformations are cumulative and apply to everything that happens after + * and subsequent calls to the function accumulates the effect. For example, + * calling translate(50, 0) and then translate(20, 0) is the same as + * translate(70, 0). If translate() is called within draw(), the + * transformation is reset when the loop begins again. This function can be + * further controlled by using push() and pop(). * - * specularMaterial(255); - * sphere(width * 0.1); + * @method translate + * @param {Number} x left/right translation + * @param {Number} y up/down translation + * @param {Number} [z] forward/backward translation (WEBGL only) + * @chainable + * @example + *
                    + * + * translate(30, 20); + * rect(0, 0, 55, 55); + * + *
                    * - * rotateX(t * 0.77); - * rotateY(t * 0.83); - * rotateZ(t * 0.91); - * torus(width * 0.3, width * 0.07, 24, 10); - * } + *
                    + * + * rect(0, 0, 55, 55); // Draw rect at original 0,0 + * translate(30, 20); + * rect(0, 0, 55, 55); // Draw rect at new 0,0 + * translate(14, 14); + * rect(0, 0, 55, 55); // Draw rect at new 0,0 + * + *
                    * - * function mousePressed() { - * setAttributes('perPixelLighting', false); - * noStroke(); - * fill(255); - * } - * function mouseReleased() { - * setAttributes('perPixelLighting', true); - * noStroke(); - * fill(255); + + *
                    + * + * function draw() { + * background(200); + * rectMode(CENTER); + * translate(width / 2, height / 2); + * translate(p5.Vector.fromAngle(millis() / 1000, 40)); + * rect(0, 0, 20, 20); * } * *
                    * - * @alt a rotating cube with smoother edges - */ - /** - * @method setAttributes - * @for p5 - * @param {Object} obj object with key-value pairs - */ - _main.default.prototype.setAttributes = function (key, value) { - if (typeof this._glAttributes === 'undefined') { - console.log('You are trying to use setAttributes on a p5.Graphics object ' + 'that does not use a WEBGL renderer.'); - return; - } - var unchanged = true; - if (typeof value !== 'undefined') { - //first time modifying the attributes - if (this._glAttributes === null) { - this._glAttributes = { - }; - } - if (this._glAttributes[key] !== value) { - //changing value of previously altered attribute - this._glAttributes[key] = value; - unchanged = false; - } //setting all attributes with some change - - } else if (key instanceof Object) { - if (this._glAttributes !== key) { - this._glAttributes = key; - unchanged = false; - } - } //@todo_FES - - if (!this._renderer.isP3D || unchanged) { - return; - } - if (!this._setupDone) { - for (var x in this._renderer.retainedMode.geometry) { - if (this._renderer.retainedMode.geometry.hasOwnProperty(x)) { - _main.default._friendlyError('Sorry, Could not set the attributes, you need to call setAttributes() ' + 'before calling the other drawing methods in setup()'); - return; - } - } - } - this.push(); - this._renderer._resetContext(); - this.pop(); - if (this._renderer._curCamera) { - this._renderer._curCamera._renderer = this._renderer; - } - }; - /** - * @private - * @param {Uint8Array|Float32Array|undefined} pixels An existing pixels array to reuse if the size is the same - * @param {WebGLRenderingContext} gl The WebGL context - * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read - * @param {Number} x The x coordiante to read, premultiplied by pixel density - * @param {Number} y The y coordiante to read, premultiplied by pixel density - * @param {Number} width The width in pixels to be read (factoring in pixel density) - * @param {Number} height The height in pixels to be read (factoring in pixel density) - * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read - * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT - * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about - * @returns {Uint8Array|Float32Array} pixels A pixels array with the current state of the - * WebGL context read into it - */ - function readPixelsWebGL(pixels, gl, framebuffer, x, y, width, height, format, type, flipY) { - // Record the currently bound framebuffer so we can go back to it after, and - // bind the framebuffer we want to read from - var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); - var channels = format === gl.RGBA ? 4 : 3; - // Make a pixels buffer if it doesn't already exist - var len = width * height * channels; - var TypedArrayClass = type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; - if (!(pixels instanceof TypedArrayClass) || pixels.length !== len) { - pixels = new TypedArrayClass(len); - } - gl.readPixels(x, flipY ? flipY - y - height : y, width, height, format, type, pixels); - // Re-bind whatever was previously bound - gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); - if (flipY) { - // WebGL pixels are inverted compared to 2D pixels, so we have to flip - // the resulting rows. Adapted from https://stackoverflow.com/a/41973289 - var halfHeight = Math.floor(height / 2); - var tmpRow = new TypedArrayClass(width * channels); - for (var _y = 0; _y < halfHeight; _y++) { - var topOffset = _y * width * 4; - var bottomOffset = (height - _y - 1) * width * 4; - tmpRow.set(pixels.subarray(topOffset, topOffset + width * 4)); - pixels.copyWithin(topOffset, bottomOffset, bottomOffset + width * 4); - pixels.set(tmpRow, bottomOffset); - } - } - return pixels; - } /** - * @private - * @param {WebGLRenderingContext} gl The WebGL context - * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read - * @param {Number} x The x coordinate to read, premultiplied by pixel density - * @param {Number} y The y coordinate to read, premultiplied by pixel density - * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read - * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT - * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about - * @returns {Number[]} pixels The channel data for the pixel at that location - */ - - function readPixelWebGL(gl, framebuffer, x, y, format, type, flipY) { - // Record the currently bound framebuffer so we can go back to it after, and - // bind the framebuffer we want to read from - var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); - var channels = format === gl.RGBA ? 4 : 3; - var TypedArrayClass = type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; - var pixels = new TypedArrayClass(channels); - gl.readPixels(x, flipY ? flipY - y - 1 : y, 1, 1, format, type, pixels); - // Re-bind whatever was previously bound - gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); - return Array.from(pixels); - } /** - * 3D graphics class - * @private - * @class p5.RendererGL - * @constructor - * @extends p5.Renderer - * @todo extend class to include public method for offscreen - * rendering (FBO). - */ - - _main.default.RendererGL = /*#__PURE__*/ function (_p5$Renderer) { - _inherits(RendererGL, _p5$Renderer); - var _super = _createSuper(RendererGL); - function RendererGL(elt, pInst, isMainCanvas, attr) { - var _this; - _classCallCheck(this, RendererGL); - _this = _super.call(this, elt, pInst, isMainCanvas); - _this._setAttributeDefaults(pInst); - _this._initContext(); - _this.isP3D = true; //lets us know we're in 3d mode - // When constructing a new p5.Geometry, this will represent the builder - _this.geometryBuilder = undefined; - // This redundant property is useful in reminding you that you are - // interacting with WebGLRenderingContext, still worth considering future removal - _this.GL = _this.drawingContext; - _this._pInst._setProperty('drawingContext', _this.drawingContext); - // erasing - _this._isErasing = false; - // clipping - _this._clipDepths = [ - ]; - _this._isClipApplied = false; - _this._stencilTestOn = false; - // lights - _this._enableLighting = false; - _this.ambientLightColors = [ - ]; - _this.specularColors = [ - 1, - 1, - 1 - ]; - _this.directionalLightDirections = [ - ]; - _this.directionalLightDiffuseColors = [ - ]; - _this.directionalLightSpecularColors = [ - ]; - _this.pointLightPositions = [ - ]; - _this.pointLightDiffuseColors = [ - ]; - _this.pointLightSpecularColors = [ - ]; - _this.spotLightPositions = [ - ]; - _this.spotLightDirections = [ - ]; - _this.spotLightDiffuseColors = [ - ]; - _this.spotLightSpecularColors = [ - ]; - _this.spotLightAngle = [ - ]; - _this.spotLightConc = [ - ]; - // This property contains the input image if imageLight function - // is called. - // activeImageLight is checked by _setFillUniforms - // for sending uniforms to the fillshader - _this.activeImageLight = null; - // If activeImageLight property is Null, diffusedTextures, - // specularTextures are Empty. - // Else, it maps a p5.Image used by imageLight() to a p5.Graphics. - // p5.Graphics for this are calculated in getDiffusedTexture function - _this.diffusedTextures = new Map(); - // p5.Graphics for this are calculated in getSpecularTexture function - _this.specularTextures = new Map(); - _this.drawMode = constants.FILL; - _this.curFillColor = _this._cachedFillStyle = [ - 1, - 1, - 1, - 1 - ]; - _this.curAmbientColor = _this._cachedFillStyle = [ - 1, - 1, - 1, - 1 - ]; - _this.curSpecularColor = _this._cachedFillStyle = [ - 0, - 0, - 0, - 0 - ]; - _this.curEmissiveColor = _this._cachedFillStyle = [ - 0, - 0, - 0, - 0 - ]; - _this.curStrokeColor = _this._cachedStrokeStyle = [ - 0, - 0, - 0, - 1 - ]; - _this.curBlendMode = constants.BLEND; - _this._cachedBlendMode = undefined; - if (_this.webglVersion === constants.WEBGL2) { - _this.blendExt = _this.GL; - } else { - _this.blendExt = _this.GL.getExtension('EXT_blend_minmax'); - } - _this._isBlending = false; - _this._hasSetAmbient = false; - _this._useSpecularMaterial = false; - _this._useEmissiveMaterial = false; - _this._useNormalMaterial = false; - _this._useShininess = 1; - _this._useLineColor = false; - _this._useVertexColor = false; - _this.registerEnabled = new Set(); - _this._tint = [ - 255, - 255, - 255, - 255 - ]; - // lightFalloff variables - _this.constantAttenuation = 1; - _this.linearAttenuation = 0; - _this.quadraticAttenuation = 0; - /** - * model view, projection, & normal - * matrices - */ - _this.uMVMatrix = new _main.default.Matrix(); - _this.uPMatrix = new _main.default.Matrix(); - _this.uNMatrix = new _main.default.Matrix('mat3'); - // Current vertex normal - _this._currentNormal = new _main.default.Vector(0, 0, 1); - // Camera - _this._curCamera = new _main.default.Camera(_assertThisInitialized(_this)); - _this._curCamera._computeCameraDefaultSettings(); - _this._curCamera._setDefaultCamera(); - // FilterCamera - _this.filterCamera = new _main.default.Camera(_assertThisInitialized(_this)); - _this.filterCamera._computeCameraDefaultSettings(); - _this.filterCamera._setDefaultCamera(); - // Information about the previous frame's touch object - // for executing orbitControl() - _this.prevTouches = [ - ]; - // Velocity variable for use with orbitControl() - _this.zoomVelocity = 0; - _this.rotateVelocity = new _main.default.Vector(0, 0); - _this.moveVelocity = new _main.default.Vector(0, 0); - // Flags for recording the state of zooming, rotation and moving - _this.executeZoom = false; - _this.executeRotateAndMove = false; - _this._defaultLightShader = undefined; - _this._defaultImmediateModeShader = undefined; - _this._defaultNormalShader = undefined; - _this._defaultColorShader = undefined; - _this._defaultPointShader = undefined; - _this.userFillShader = undefined; - _this.userStrokeShader = undefined; - _this.userPointShader = undefined; - // Default drawing is done in Retained Mode - // Geometry and Material hashes stored here - _this.retainedMode = { - geometry: { - }, - buffers: { - stroke: [ - new _main.default.RenderBuffer(4, 'lineVertexColors', 'lineColorBuffer', 'aVertexColor', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'lineVertices', 'lineVerticesBuffer', 'aPosition', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'lineTangentsIn', 'lineTangentsInBuffer', 'aTangentIn', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'lineTangentsOut', 'lineTangentsOutBuffer', 'aTangentOut', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(1, 'lineSides', 'lineSidesBuffer', 'aSide', _assertThisInitialized(_this)) - ], - fill: [ - new _main.default.RenderBuffer(3, 'vertices', 'vertexBuffer', 'aPosition', _assertThisInitialized(_this), _this._vToNArray), - new _main.default.RenderBuffer(3, 'vertexNormals', 'normalBuffer', 'aNormal', _assertThisInitialized(_this), _this._vToNArray), - new _main.default.RenderBuffer(4, 'vertexColors', 'colorBuffer', 'aVertexColor', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'vertexAmbients', 'ambientBuffer', 'aAmbientColor', _assertThisInitialized(_this)), - //new BufferDef(3, 'vertexSpeculars', 'specularBuffer', 'aSpecularColor'), - new _main.default.RenderBuffer(2, 'uvs', 'uvBuffer', 'aTexCoord', _assertThisInitialized(_this), _this._flatten) - ], - text: [ - new _main.default.RenderBuffer(3, 'vertices', 'vertexBuffer', 'aPosition', _assertThisInitialized(_this), _this._vToNArray), - new _main.default.RenderBuffer(2, 'uvs', 'uvBuffer', 'aTexCoord', _assertThisInitialized(_this), _this._flatten) - ] - } - }; - // Immediate Mode - // Geometry and Material hashes stored here - _this.immediateMode = { - geometry: new _main.default.Geometry(), - shapeMode: constants.TRIANGLE_FAN, - contourIndices: [ - ], - _bezierVertex: [ - ], - _quadraticVertex: [ - ], - _curveVertex: [ - ], - buffers: { - fill: [ - new _main.default.RenderBuffer(3, 'vertices', 'vertexBuffer', 'aPosition', _assertThisInitialized(_this), _this._vToNArray), - new _main.default.RenderBuffer(3, 'vertexNormals', 'normalBuffer', 'aNormal', _assertThisInitialized(_this), _this._vToNArray), - new _main.default.RenderBuffer(4, 'vertexColors', 'colorBuffer', 'aVertexColor', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'vertexAmbients', 'ambientBuffer', 'aAmbientColor', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(2, 'uvs', 'uvBuffer', 'aTexCoord', _assertThisInitialized(_this), _this._flatten) - ], - stroke: [ - new _main.default.RenderBuffer(4, 'lineVertexColors', 'lineColorBuffer', 'aVertexColor', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'lineVertices', 'lineVerticesBuffer', 'aPosition', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'lineTangentsIn', 'lineTangentsInBuffer', 'aTangentIn', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(3, 'lineTangentsOut', 'lineTangentsOutBuffer', 'aTangentOut', _assertThisInitialized(_this)), - new _main.default.RenderBuffer(1, 'lineSides', 'lineSidesBuffer', 'aSide', _assertThisInitialized(_this)) - ], - point: _this.GL.createBuffer() - } - }; - _this.pointSize = 5; //default point size - _this.curStrokeWeight = 1; - _this.curStrokeCap = constants.ROUND; - _this.curStrokeJoin = constants.ROUND; - // map of texture sources to textures created in this gl context via this.getTexture(src) - _this.textures = new Map(); - // set of framebuffers in use - _this.framebuffers = new Set(); - // stack of active framebuffers - _this.activeFramebuffers = [ - ]; - // for post processing step - _this.filterShader = undefined; - _this.filterLayer = undefined; - _this.filterLayerTemp = undefined; - _this.defaultFilterShaders = { - }; - _this.textureMode = constants.IMAGE; - // default wrap settings - _this.textureWrapX = constants.CLAMP; - _this.textureWrapY = constants.CLAMP; - _this._tex = null; - _this._curveTightness = 6; - // lookUpTable for coefficients needed to be calculated for bezierVertex, same are used for curveVertex - _this._lookUpTableBezier = [ - ]; - // lookUpTable for coefficients needed to be calculated for quadraticVertex - _this._lookUpTableQuadratic = [ - ]; - // current curveDetail in the Bezier lookUpTable - _this._lutBezierDetail = 0; - // current curveDetail in the Quadratic lookUpTable - _this._lutQuadraticDetail = 0; - // Used to distinguish between user calls to vertex() and internal calls - _this.isProcessingVertices = false; - _this._tessy = _this._initTessy(); - _this.fontInfos = { - }; - _this._curShader = undefined; - return _this; - } /** - * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added - * to the geometry and then returned when - * endGeometry() is called. One can also use - * buildGeometry() to pass a function that - * draws shapes. - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them upfront with `beginGeometry()` and `endGeometry()` and then - * drawing that will run faster than repeatedly drawing the individual pieces. - * - * @method beginGeometry - */ - - _createClass(RendererGL, [ - { - key: 'beginGeometry', - value: function beginGeometry() { - if (this.geometryBuilder) { - throw new Error('It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.'); - } - this.geometryBuilder = new _GeometryBuilder.default(this); - } /** - * Finishes creating a new p5.Geometry that was - * started using beginGeometry(). One can also - * use buildGeometry() to pass a function that - * draws shapes. - * - * @method endGeometry - * @returns {p5.Geometry} The model that was built. - */ - - }, - { - key: 'endGeometry', - value: function endGeometry() { - if (!this.geometryBuilder) { - throw new Error('Make sure you call beginGeometry() before endGeometry()!'); - } - var geometry = this.geometryBuilder.finish(); - this.geometryBuilder = undefined; - return geometry; - } /** - * Creates a new p5.Geometry that contains all - * the shapes drawn in a provided callback function. The returned combined shape - * can then be drawn all at once using model(). - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them with `buildGeometry()` once and then drawing that will run - * faster than repeatedly drawing the individual pieces. - * - * One can also draw shapes directly between - * beginGeometry() and - * endGeometry() instead of using a callback - * function. - * - * @method buildGeometry - * @param {Function} callback A function that draws shapes. - * @returns {p5.Geometry} The model that was built from the callback function. - */ - - }, - { - key: 'buildGeometry', - value: function buildGeometry(callback) { - this.beginGeometry(); - callback(); - return this.endGeometry(); - } ////////////////////////////////////////////// - // Setting - ////////////////////////////////////////////// - - }, - { - key: '_setAttributeDefaults', - value: function _setAttributeDefaults(pInst) { - // See issue #3850, safer to enable AA in Safari - var applyAA = navigator.userAgent.toLowerCase().includes('safari'); - var defaults = { - alpha: true, - depth: true, - stencil: true, - antialias: applyAA, - premultipliedAlpha: true, - preserveDrawingBuffer: true, - perPixelLighting: true, - version: 2 - }; - if (pInst._glAttributes === null) { - pInst._glAttributes = defaults; - } else { - pInst._glAttributes = Object.assign(defaults, pInst._glAttributes); - } - return; - } - }, - { - key: '_initContext', - value: function _initContext() { - if (this._pInst._glAttributes.version !== 1) { - // Unless WebGL1 is explicitly asked for, try to create a WebGL2 context - this.drawingContext = this.canvas.getContext('webgl2', this._pInst._glAttributes); - } - this.webglVersion = this.drawingContext ? constants.WEBGL2 : constants.WEBGL; - // If this is the main canvas, make sure the global `webglVersion` is set - this._pInst._setProperty('webglVersion', this.webglVersion); - if (!this.drawingContext) { - // If we were unable to create a WebGL2 context (either because it was - // disabled via `setAttributes({ version: 1 })` or because the device - // doesn't support it), fall back to a WebGL1 context - this.drawingContext = this.canvas.getContext('webgl', this._pInst._glAttributes) || this.canvas.getContext('experimental-webgl', this._pInst._glAttributes); - } - if (this.drawingContext === null) { - throw new Error('Error creating webgl context'); - } else { - var gl = this.drawingContext; - gl.enable(gl.DEPTH_TEST); - gl.depthFunc(gl.LEQUAL); - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - // Make sure all images are loaded into the canvas premultiplied so that - // they match the way we render colors. This will make framebuffer textures - // be encoded the same way as textures from everything else. - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - this._viewport = this.drawingContext.getParameter(this.drawingContext.VIEWPORT); - } - } //This is helper function to reset the context anytime the attributes - //are changed with setAttributes() - - }, - { - key: '_resetContext', - value: function _resetContext(options, callback) { - var w = this.width; - var h = this.height; - var defaultId = this.canvas.id; - var isPGraphics = this._pInst instanceof _main.default.Graphics; - if (isPGraphics) { - var pg = this._pInst; - pg.canvas.parentNode.removeChild(pg.canvas); - pg.canvas = document.createElement('canvas'); - var node = pg._pInst._userNode || document.body; - node.appendChild(pg.canvas); - _main.default.Element.call(pg, pg.canvas, pg._pInst); - pg.width = w; - pg.height = h; - } else { - var c = this.canvas; - if (c) { - c.parentNode.removeChild(c); - } - c = document.createElement('canvas'); - c.id = defaultId; - if (this._pInst._userNode) { - this._pInst._userNode.appendChild(c); - } else { - document.body.appendChild(c); - } - this._pInst.canvas = c; - this.canvas = c; - } - var renderer = new _main.default.RendererGL(this._pInst.canvas, this._pInst, !isPGraphics); - this._pInst._setProperty('_renderer', renderer); - renderer.resize(w, h); - renderer._applyDefaults(); - if (!isPGraphics) { - this._pInst._elements.push(renderer); - } - if (typeof callback === 'function') { - //setTimeout with 0 forces the task to the back of the queue, this ensures that - //we finish switching out the renderer - setTimeout(function () { - callback.apply(window._renderer, options); - }, 0); - } - } /** - * @class p5.RendererGL - */ - - }, - { - key: '_update', - value: function _update() { - // reset model view and apply initial camera transform - // (containing only look at info; no projection). - this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0], this._curCamera.cameraMatrix.mat4[1], this._curCamera.cameraMatrix.mat4[2], this._curCamera.cameraMatrix.mat4[3], this._curCamera.cameraMatrix.mat4[4], this._curCamera.cameraMatrix.mat4[5], this._curCamera.cameraMatrix.mat4[6], this._curCamera.cameraMatrix.mat4[7], this._curCamera.cameraMatrix.mat4[8], this._curCamera.cameraMatrix.mat4[9], this._curCamera.cameraMatrix.mat4[10], this._curCamera.cameraMatrix.mat4[11], this._curCamera.cameraMatrix.mat4[12], this._curCamera.cameraMatrix.mat4[13], this._curCamera.cameraMatrix.mat4[14], this._curCamera.cameraMatrix.mat4[15]); - // reset light data for new frame. - this.ambientLightColors.length = 0; - this.specularColors = [ - 1, - 1, - 1 - ]; - this.directionalLightDirections.length = 0; - this.directionalLightDiffuseColors.length = 0; - this.directionalLightSpecularColors.length = 0; - this.pointLightPositions.length = 0; - this.pointLightDiffuseColors.length = 0; - this.pointLightSpecularColors.length = 0; - this.spotLightPositions.length = 0; - this.spotLightDirections.length = 0; - this.spotLightDiffuseColors.length = 0; - this.spotLightSpecularColors.length = 0; - this.spotLightAngle.length = 0; - this.spotLightConc.length = 0; - this._enableLighting = false; - //reset tint value for new frame - this._tint = [ - 255, - 255, - 255, - 255 - ]; - //Clear depth every frame - this.GL.clearStencil(0); - this.GL.clear(this.GL.DEPTH_BUFFER_BIT | this.GL.STENCIL_BUFFER_BIT); - this.GL.disable(this.GL.STENCIL_TEST); - } /** - * [background description] - */ - - }, - { - key: 'background', - value: function background() { - var _this$_pInst; - var _col = (_this$_pInst = this._pInst).color.apply(_this$_pInst, arguments); - var _r = _col.levels[0] / 255; - var _g = _col.levels[1] / 255; - var _b = _col.levels[2] / 255; - var _a = _col.levels[3] / 255; - this.clear(_r, _g, _b, _a); - } ////////////////////////////////////////////// - // COLOR - ////////////////////////////////////////////// - /** - * Basic fill material for geometry with a given color - * @method fill - * @class p5.RendererGL - * @param {Number|Number[]|String|p5.Color} v1 gray value, - * red or hue value (depending on the current color mode), - * or color Array, or CSS color string - * @param {Number} [v2] green or saturation value - * @param {Number} [v3] blue or brightness value - * @param {Number} [a] opacity - * @chainable - * @example - *
                    - * - * function setup() { - * createCanvas(200, 200, WEBGL); - * } - * - * function draw() { - * background(0); - * noStroke(); - * fill(100, 100, 240); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(75, 75, 75); - * } - * - *
                    - * - * @alt - * black canvas with purple cube spinning - */ - - }, - { - key: 'fill', - value: function fill(v1, v2, v3, a) { - //see material.js for more info on color blending in webgl - var color = _main.default.prototype.color.apply(this._pInst, arguments); - this.curFillColor = color._array; - this.drawMode = constants.FILL; - this._useNormalMaterial = false; - this._tex = null; - } /** - * Basic stroke material for geometry with a given color - * @method stroke - * @param {Number|Number[]|String|p5.Color} v1 gray value, - * red or hue value (depending on the current color mode), - * or color Array, or CSS color string - * @param {Number} [v2] green or saturation value - * @param {Number} [v3] blue or brightness value - * @param {Number} [a] opacity - * @example - *
                    - * - * function setup() { - * createCanvas(200, 200, WEBGL); - * } - * - * function draw() { - * background(0); - * stroke(240, 150, 150); - * fill(100, 100, 240); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(75, 75, 75); - * } - * - *
                    - * - * @alt - * black canvas with purple cube with pink outline spinning - */ - - }, - { - key: 'stroke', - value: function stroke(r, g, b, a) { - var color = _main.default.prototype.color.apply(this._pInst, arguments); - this.curStrokeColor = color._array; - } - }, - { - key: 'strokeCap', - value: function strokeCap(cap) { - this.curStrokeCap = cap; - } - }, - { - key: 'strokeJoin', - value: function strokeJoin(join) { - this.curStrokeJoin = join; - } - }, - { - key: 'getFilterLayer', - value: function getFilterLayer() { - if (!this.filterLayer) { - this.filterLayer = this._pInst.createFramebuffer(); - } - return this.filterLayer; - } - }, - { - key: 'getFilterLayerTemp', - value: function getFilterLayerTemp() { - if (!this.filterLayerTemp) { - this.filterLayerTemp = this._pInst.createFramebuffer(); - } - return this.filterLayerTemp; - } - }, - { - key: 'matchSize', - value: function matchSize(fboToMatch, target) { - if (fboToMatch.width !== target.width || fboToMatch.height !== target.height) { - fboToMatch.resize(target.width, target.height); - } - if (fboToMatch.pixelDensity() !== target.pixelDensity()) { - fboToMatch.pixelDensity(target.pixelDensity()); - } - } - }, - { - key: 'filter', - value: function filter() { - var _this2 = this; - var fbo = this.getFilterLayer(); - // use internal shader for filter constants BLUR, INVERT, etc - var filterParameter = undefined; - var operation = undefined; - if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') { - var _defaults; - operation = arguments.length <= 0 ? undefined : arguments[0]; - var defaults = (_defaults = { - }, _defineProperty(_defaults, constants.BLUR, 3), _defineProperty(_defaults, constants.POSTERIZE, 4), _defineProperty(_defaults, constants.THRESHOLD, 0.5), _defaults); - var useDefaultParam = operation in defaults && (arguments.length <= 1 ? undefined : arguments[1]) === undefined; - filterParameter = useDefaultParam ? defaults[operation] : arguments.length <= 1 ? undefined : arguments[1]; - // Create and store shader for constants once on initial filter call. - // Need to store multiple in case user calls different filters, - // eg. filter(BLUR) then filter(GRAY) - if (!(operation in this.defaultFilterShaders)) { - this.defaultFilterShaders[operation] = new _main.default.Shader(fbo._renderer, filterShaderVert, filterShaderFrags[operation]); - } - this.filterShader = this.defaultFilterShaders[operation]; - } // use custom user-supplied shader - else { - this.filterShader = arguments.length <= 0 ? undefined : arguments[0]; - } // Setting the target to the framebuffer when applying a filter to a framebuffer. - - var target = this.activeFramebuffer() || this; - // Resize the framebuffer 'fbo' and adjust its pixel density if it doesn't match the target. - this.matchSize(fbo, target); - // Set filterCamera for framebuffers. - if (target !== this) { - this.filterCamera = this.getFilterLayer().createCamera(); - } - fbo.draw(function () { - return _this2._pInst.clear(); - }); // prevent undesirable feedback effects accumulating secretly. - var texelSize = [ - 1 / (target.width * target.pixelDensity()), - 1 / (target.height * target.pixelDensity()) - ]; - // apply blur shader with multiple passes. - if (operation === constants.BLUR) { - // Treating 'tmp' as a framebuffer. - var tmp = this.getFilterLayerTemp(); - // Resize the framebuffer 'tmp' and adjust its pixel density if it doesn't match the target. - this.matchSize(tmp, target); - // setup - this._pInst.push(); - this._pInst.noStroke(); - // draw main to temp buffer - this._pInst.shader(this.filterShader); - this.filterShader.setUniform('texelSize', texelSize); - this.filterShader.setUniform('canvasSize', [ - target.width, - target.height - ]); - this.filterShader.setUniform('radius', Math.max(1, filterParameter)); - // Horiz pass: draw `target` to `tmp` - tmp.draw(function () { - _this2.filterShader.setUniform('direction', [ - 1, - 0 - ]); - _this2.filterShader.setUniform('tex0', target); - _this2._pInst.clear(); - _this2._pInst.shader(_this2.filterShader); - _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); - }); - // Vert pass: draw `tmp` to `fbo` - fbo.draw(function () { - _this2.filterShader.setUniform('direction', [ - 0, - 1 - ]); - _this2.filterShader.setUniform('tex0', tmp); - _this2._pInst.clear(); - _this2._pInst.shader(_this2.filterShader); - _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); - }); - this._pInst.pop(); - } // every other non-blur shader uses single pass - else { - fbo.draw(function () { - _this2._pInst.noStroke(); - _this2._pInst.shader(_this2.filterShader); - _this2.filterShader.setUniform('tex0', target); - _this2.filterShader.setUniform('texelSize', texelSize); - _this2.filterShader.setUniform('canvasSize', [ - target.width, - target.height - ]); - // filterParameter uniform only used for POSTERIZE, and THRESHOLD - // but shouldn't hurt to always set - _this2.filterShader.setUniform('filterParameter', filterParameter); - _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); - }); - } // draw fbo contents onto main renderer. - - this._pInst.push(); - this._pInst.noStroke(); - this.clear(); - this._pInst.push(); - this._pInst.imageMode(constants.CORNER); - this._pInst.blendMode(constants.BLEND); - this.filterCamera._resize(); - this._pInst.setCamera(this.filterCamera); - this._pInst.resetMatrix(); - this._pInst.image(fbo, - this.width / 2, - this.height / 2, this.width, this.height); - this._pInst.pop(); - this._pInst.pop(); - } // Pass this off to the host instance so that we can treat a renderer and a - // framebuffer the same in filter() - - }, - { - key: 'pixelDensity', - value: function pixelDensity(newDensity) { - if (newDensity) { - return this._pInst.pixelDensity(newDensity); - } - return this._pInst.pixelDensity(); - } - }, - { - key: 'blendMode', - value: function blendMode(mode) { - if (mode === constants.DARKEST || mode === constants.LIGHTEST || mode === constants.ADD || mode === constants.BLEND || mode === constants.SUBTRACT || mode === constants.SCREEN || mode === constants.EXCLUSION || mode === constants.REPLACE || mode === constants.MULTIPLY || mode === constants.REMOVE) this.curBlendMode = mode; - else if (mode === constants.BURN || mode === constants.OVERLAY || mode === constants.HARD_LIGHT || mode === constants.SOFT_LIGHT || mode === constants.DODGE) { - console.warn('BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.'); - } - } - }, - { - key: 'erase', - value: function erase(opacityFill, opacityStroke) { - if (!this._isErasing) { - this._cachedBlendMode = this.curBlendMode; - this._isErasing = true; - this.blendMode(constants.REMOVE); - this._cachedFillStyle = this.curFillColor.slice(); - this.curFillColor = [ - 1, - 1, - 1, - opacityFill / 255 - ]; - this._cachedStrokeStyle = this.curStrokeColor.slice(); - this.curStrokeColor = [ - 1, - 1, - 1, - opacityStroke / 255 - ]; - } - } - }, - { - key: 'noErase', - value: function noErase() { - if (this._isErasing) { - this.curFillColor = this._cachedFillStyle.slice(); - this.curStrokeColor = this._cachedStrokeStyle.slice(); - // It's necessary to restore post-erase state. Needs rework - var temp = this.curBlendMode; - this.blendMode(this._cachedBlendMode); - this._cachedBlendMode = temp; // If we don't do this, applyBlendMode() returns null - this._isErasing = false; - this._applyBlendMode(); // This sets _cachedBlendMode back to the original blendmode - } - } - }, - { - key: 'drawTarget', - value: function drawTarget() { - return this.activeFramebuffers[this.activeFramebuffers.length - 1] || this; - } - }, - { - key: 'beginClip', - value: function beginClip() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; - _get(_getPrototypeOf(RendererGL.prototype), 'beginClip', this).call(this, options); - this.drawTarget()._isClipApplied = true; - var gl = this.GL; - gl.clearStencil(0); - gl.clear(gl.STENCIL_BUFFER_BIT); - gl.enable(gl.STENCIL_TEST); - this._stencilTestOn = true; - gl.stencilFunc(gl.ALWAYS, // the test - 1, // reference value - 255 // mask - ); - gl.stencilOp(gl.KEEP, // what to do if the stencil test fails - gl.KEEP, // what to do if the depth test fails - gl.REPLACE // what to do if both tests pass - ); - gl.disable(gl.DEPTH_TEST); - this._pInst.push(); - this._pInst.resetShader(); - if (this._doFill) this._pInst.fill(0, 0); - if (this._doStroke) this._pInst.stroke(0, 0); - } - }, - { - key: 'endClip', - value: function endClip() { - this._pInst.pop(); - var gl = this.GL; - gl.stencilOp(gl.KEEP, // what to do if the stencil test fails - gl.KEEP, // what to do if the depth test fails - gl.KEEP // what to do if both tests pass - ); - gl.stencilFunc(this._clipInvert ? gl.EQUAL : gl.NOTEQUAL, // the test - 0, // reference value - 255 // mask - ); - gl.enable(gl.DEPTH_TEST); - // Mark the depth at which the clip has been applied so that we can clear it - // when we pop past this depth - this._clipDepths.push(this._pushPopDepth); - _get(_getPrototypeOf(RendererGL.prototype), 'endClip', this).call(this); - } - }, - { - key: '_clearClip', - value: function _clearClip() { - this.GL.clearStencil(1); - this.GL.clear(this.GL.STENCIL_BUFFER_BIT); - if (this._clipDepths.length > 0) { - this._clipDepths.pop(); - } - this.drawTarget()._isClipApplied = false; - } /** - * Change weight of stroke - * @method strokeWeight - * @param {Number} stroke weight to be used for drawing - * @example - *
                    - * - * function setup() { - * createCanvas(200, 400, WEBGL); - * setAttributes('antialias', true); - * } - * - * function draw() { - * background(0); - * noStroke(); - * translate(0, -100, 0); - * stroke(240, 150, 150); - * fill(100, 100, 240); - * push(); - * strokeWeight(8); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * sphere(75); - * pop(); - * push(); - * translate(0, 200, 0); - * strokeWeight(1); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * sphere(75); - * pop(); - * } - * - *
                    - * - * @alt - * black canvas with two purple rotating spheres with pink - * outlines the sphere on top has much heavier outlines, - */ - - }, - { - key: 'strokeWeight', - value: function strokeWeight(w) { - if (this.curStrokeWeight !== w) { - this.pointSize = w; - this.curStrokeWeight = w; - } - } // x,y are canvas-relative (pre-scaled by _pixelDensity) - - }, - { - key: '_getPixel', - value: function _getPixel(x, y) { - var gl = this.GL; - return readPixelWebGL(gl, null, x, y, gl.RGBA, gl.UNSIGNED_BYTE, this._pInst.height * this._pInst.pixelDensity()); - } /** - * Loads the pixels data for this canvas into the pixels[] attribute. - * Note that updatePixels() and set() do not work. - * Any pixel manipulation must be done directly to the pixels[] array. - * - * @private - * @method loadPixels - */ - - }, - { - key: 'loadPixels', - value: function loadPixels() { - var pixelsState = this._pixelsState; - //@todo_FES - if (this._pInst._glAttributes.preserveDrawingBuffer !== true) { - console.log('loadPixels only works in WebGL when preserveDrawingBuffer ' + 'is true.'); - return; - } - var pd = this._pInst._pixelDensity; - var gl = this.GL; - pixelsState._setProperty('pixels', readPixelsWebGL(pixelsState.pixels, gl, null, 0, 0, this.width * pd, this.height * pd, gl.RGBA, gl.UNSIGNED_BYTE, this.height * pd)); - } - }, - { - key: 'updatePixels', - value: function updatePixels() { - var fbo = this._getTempFramebuffer(); - fbo.pixels = this._pixelsState.pixels; - fbo.updatePixels(); - this._pInst.push(); - this._pInst.resetMatrix(); - this._pInst.clear(); - this._pInst.imageMode(constants.CENTER); - this._pInst.image(fbo, 0, 0); - this._pInst.pop(); - this.GL.clearDepth(1); - this.GL.clear(this.GL.DEPTH_BUFFER_BIT); - } /** - * @private - * @returns {p5.Framebuffer} A p5.Framebuffer set to match the size and settings - * of the renderer's canvas. It will be created if it does not yet exist, and - * reused if it does. - */ - - }, - { - key: '_getTempFramebuffer', - value: function _getTempFramebuffer() { - if (!this._tempFramebuffer) { - this._tempFramebuffer = this._pInst.createFramebuffer({ - format: constants.UNSIGNED_BYTE, - useDepth: this._pInst._glAttributes.depth, - depthFormat: constants.UNSIGNED_INT, - antialias: this._pInst._glAttributes.antialias - }); - } - return this._tempFramebuffer; - } ////////////////////////////////////////////// - // HASH | for geometry - ////////////////////////////////////////////// - - }, - { - key: 'geometryInHash', - value: function geometryInHash(gId) { - return this.retainedMode.geometry[gId] !== undefined; - } - }, - { - key: 'viewport', - value: function viewport(w, h) { - this._viewport = [ - 0, - 0, - w, - h - ]; - this.GL.viewport(0, 0, w, h); - } /** - * [resize description] - * @private - * @param {Number} w [description] - * @param {Number} h [description] - */ - - }, - { - key: 'resize', - value: function resize(w, h) { - _main.default.Renderer.prototype.resize.call(this, w, h); - this._origViewport = { - width: this.GL.drawingBufferWidth, - height: this.GL.drawingBufferHeight - }; - this.viewport(this._origViewport.width, this._origViewport.height); - this._curCamera._resize(); - //resize pixels buffer - var pixelsState = this._pixelsState; - if (typeof pixelsState.pixels !== 'undefined') { - pixelsState._setProperty('pixels', new Uint8Array(this.GL.drawingBufferWidth * this.GL.drawingBufferHeight * 4)); - } - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this.framebuffers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var framebuffer = _step.value; - // Notify framebuffers of the resize so that any auto-sized framebuffers - // can also update their size - framebuffer._canvasSizeChanged(); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } /** - * clears color and depth buffers - * with r,g,b,a - * @private - * @param {Number} r normalized red val. - * @param {Number} g normalized green val. - * @param {Number} b normalized blue val. - * @param {Number} a normalized alpha val. - */ - - }, - { - key: 'clear', - value: function clear() { - var _r = (arguments.length <= 0 ? undefined : arguments[0]) || 0; - var _g = (arguments.length <= 1 ? undefined : arguments[1]) || 0; - var _b = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - var _a = (arguments.length <= 3 ? undefined : arguments[3]) || 0; - var activeFramebuffer = this.activeFramebuffer(); - if (activeFramebuffer && activeFramebuffer.format === constants.UNSIGNED_BYTE && !activeFramebuffer.antialias && _a === 0) { - // Drivers on Intel Macs check for 0,0,0,0 exactly when drawing to a - // framebuffer and ignore the command if it's the only drawing command to - // the framebuffer. To work around it, we can set the alpha to a value so - // low that it still rounds down to 0, but that circumvents the buggy - // check in the driver. - _a = 1e-10; - } - this.GL.clearColor(_r * _a, _g * _a, _b * _a, _a); - this.GL.clearDepth(1); - this.GL.clear(this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT); - } - }, - { - key: 'applyMatrix', - value: function applyMatrix(a, b, c, d, e, f) { - if (arguments.length === 16) { - _main.default.Matrix.prototype.apply.apply(this.uMVMatrix, arguments); - } else { - this.uMVMatrix.apply([a, - b, - 0, - 0, - c, - d, - 0, - 0, - 0, - 0, - 1, - 0, - e, - f, - 0, - 1]); - } - } /** - * [translate description] - * @private - * @param {Number} x [description] - * @param {Number} y [description] - * @param {Number} z [description] - * @chainable - * @todo implement handle for components or vector as args - */ - - }, - { - key: 'translate', - value: function translate(x, y, z) { - if (x instanceof _main.default.Vector) { - z = x.z; - y = x.y; - x = x.x; - } - this.uMVMatrix.translate([x, - y, - z]); - return this; - } /** - * Scales the Model View Matrix by a vector - * @private - * @param {Number | p5.Vector | Array} x [description] - * @param {Number} [y] y-axis scalar - * @param {Number} [z] z-axis scalar - * @chainable - */ - - }, - { - key: 'scale', - value: function scale(x, y, z) { - this.uMVMatrix.scale(x, y, z); - return this; - } - }, - { - key: 'rotate', - value: function rotate(rad, axis) { - if (typeof axis === 'undefined') { - return this.rotateZ(rad); - } - _main.default.Matrix.prototype.rotate.apply(this.uMVMatrix, arguments); - return this; - } - }, - { - key: 'rotateX', - value: function rotateX(rad) { - this.rotate(rad, 1, 0, 0); - return this; - } - }, - { - key: 'rotateY', - value: function rotateY(rad) { - this.rotate(rad, 0, 1, 0); - return this; - } - }, - { - key: 'rotateZ', - value: function rotateZ(rad) { - this.rotate(rad, 0, 0, 1); - return this; - } - }, - { - key: 'push', - value: function push() { - // get the base renderer style - var style = _main.default.Renderer.prototype.push.apply(this); - // add webgl-specific style properties - var properties = style.properties; - properties.uMVMatrix = this.uMVMatrix.copy(); - properties.uPMatrix = this.uPMatrix.copy(); - properties._curCamera = this._curCamera; - // make a copy of the current camera for the push state - // this preserves any references stored using 'createCamera' - this._curCamera = this._curCamera.copy(); - properties.ambientLightColors = this.ambientLightColors.slice(); - properties.specularColors = this.specularColors.slice(); - properties.directionalLightDirections = this.directionalLightDirections.slice(); - properties.directionalLightDiffuseColors = this.directionalLightDiffuseColors.slice(); - properties.directionalLightSpecularColors = this.directionalLightSpecularColors.slice(); - properties.pointLightPositions = this.pointLightPositions.slice(); - properties.pointLightDiffuseColors = this.pointLightDiffuseColors.slice(); - properties.pointLightSpecularColors = this.pointLightSpecularColors.slice(); - properties.spotLightPositions = this.spotLightPositions.slice(); - properties.spotLightDirections = this.spotLightDirections.slice(); - properties.spotLightDiffuseColors = this.spotLightDiffuseColors.slice(); - properties.spotLightSpecularColors = this.spotLightSpecularColors.slice(); - properties.spotLightAngle = this.spotLightAngle.slice(); - properties.spotLightConc = this.spotLightConc.slice(); - properties.userFillShader = this.userFillShader; - properties.userStrokeShader = this.userStrokeShader; - properties.userPointShader = this.userPointShader; - properties.pointSize = this.pointSize; - properties.curStrokeWeight = this.curStrokeWeight; - properties.curStrokeColor = this.curStrokeColor; - properties.curFillColor = this.curFillColor; - properties.curAmbientColor = this.curAmbientColor; - properties.curSpecularColor = this.curSpecularColor; - properties.curEmissiveColor = this.curEmissiveColor; - properties._hasSetAmbient = this._hasSetAmbient; - properties._useSpecularMaterial = this._useSpecularMaterial; - properties._useEmissiveMaterial = this._useEmissiveMaterial; - properties._useShininess = this._useShininess; - properties.constantAttenuation = this.constantAttenuation; - properties.linearAttenuation = this.linearAttenuation; - properties.quadraticAttenuation = this.quadraticAttenuation; - properties._enableLighting = this._enableLighting; - properties._useNormalMaterial = this._useNormalMaterial; - properties._tex = this._tex; - properties.drawMode = this.drawMode; - properties._currentNormal = this._currentNormal; - properties.curBlendMode = this.curBlendMode; - // So that the activeImageLight gets reset in push/pop - properties.activeImageLight = this.activeImageLight; - return style; - } - }, - { - key: 'pop', - value: function pop() { - var _get2; - if (this._clipDepths.length > 0 && this._pushPopDepth === this._clipDepths[this._clipDepths.length - 1]) { - this._clearClip(); - } - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - }(_get2 = _get(_getPrototypeOf(RendererGL.prototype), 'pop', this)).call.apply(_get2, [ - this - ].concat(args)); - this._applyStencilTestIfClipping(); - } - }, - { - key: '_applyStencilTestIfClipping', - value: function _applyStencilTestIfClipping() { - var drawTarget = this.drawTarget(); - if (drawTarget._isClipApplied !== this._stencilTestOn) { - if (drawTarget._isClipApplied) { - this.GL.enable(this.GL.STENCIL_TEST); - this._stencilTestOn = true; - } else { - this.GL.disable(this.GL.STENCIL_TEST); - this._stencilTestOn = false; - } - } - } - }, - { - key: 'resetMatrix', - value: function resetMatrix() { - this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0], this._curCamera.cameraMatrix.mat4[1], this._curCamera.cameraMatrix.mat4[2], this._curCamera.cameraMatrix.mat4[3], this._curCamera.cameraMatrix.mat4[4], this._curCamera.cameraMatrix.mat4[5], this._curCamera.cameraMatrix.mat4[6], this._curCamera.cameraMatrix.mat4[7], this._curCamera.cameraMatrix.mat4[8], this._curCamera.cameraMatrix.mat4[9], this._curCamera.cameraMatrix.mat4[10], this._curCamera.cameraMatrix.mat4[11], this._curCamera.cameraMatrix.mat4[12], this._curCamera.cameraMatrix.mat4[13], this._curCamera.cameraMatrix.mat4[14], this._curCamera.cameraMatrix.mat4[15]); - return this; - } ////////////////////////////////////////////// - // SHADER - ////////////////////////////////////////////// - /* - * shaders are created and cached on a per-renderer basis, - * on the grounds that each renderer will have its own gl context - * and the shader must be valid in that context. - */ - - }, - { - key: '_getImmediateStrokeShader', - value: function _getImmediateStrokeShader() { - // select the stroke shader to use - var stroke = this.userStrokeShader; - if (!stroke || !stroke.isStrokeShader()) { - return this._getLineShader(); - } - return stroke; - } - }, - { - key: '_getRetainedStrokeShader', - value: function _getRetainedStrokeShader() { - return this._getImmediateStrokeShader(); - } /* - * selects which fill shader should be used based on renderer state, - * for use with begin/endShape and immediate vertex mode. - */ - - }, - { - key: '_getImmediateFillShader', - value: function _getImmediateFillShader() { - var fill = this.userFillShader; - if (this._useNormalMaterial) { - if (!fill || !fill.isNormalShader()) { - return this._getNormalShader(); - } - } - if (this._enableLighting) { - if (!fill || !fill.isLightShader()) { - return this._getLightShader(); - } - } else if (this._tex) { - if (!fill || !fill.isTextureShader()) { - return this._getLightShader(); - } - } else if (!fill /*|| !fill.isColorShader()*/ ) { - return this._getImmediateModeShader(); - } - return fill; - } /* - * selects which fill shader should be used based on renderer state - * for retained mode. - */ - - }, - { - key: '_getRetainedFillShader', - value: function _getRetainedFillShader() { - if (this._useNormalMaterial) { - return this._getNormalShader(); - } - var fill = this.userFillShader; - if (this._enableLighting) { - if (!fill || !fill.isLightShader()) { - return this._getLightShader(); - } - } else if (this._tex) { - if (!fill || !fill.isTextureShader()) { - return this._getLightShader(); - } - } else if (!fill /* || !fill.isColorShader()*/ ) { - return this._getColorShader(); - } - return fill; - } - }, - { - key: '_getImmediatePointShader', - value: function _getImmediatePointShader() { - // select the point shader to use - var point = this.userPointShader; - if (!point || !point.isPointShader()) { - return this._getPointShader(); - } - return point; - } - }, - { - key: '_getRetainedLineShader', - value: function _getRetainedLineShader() { - return this._getImmediateLineShader(); - } - }, - { - key: '_getLightShader', - value: function _getLightShader() { - if (!this._defaultLightShader) { - if (this._pInst._glAttributes.perPixelLighting) { - this._defaultLightShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.phongVert, this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.phongFrag); - } else { - this._defaultLightShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.lightVert, this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.lightTextureFrag); - } - } - return this._defaultLightShader; - } - }, - { - key: '_getImmediateModeShader', - value: function _getImmediateModeShader() { - if (!this._defaultImmediateModeShader) { - this._defaultImmediateModeShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.immediateVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.vertexColorFrag); - } - return this._defaultImmediateModeShader; - } - }, - { - key: '_getNormalShader', - value: function _getNormalShader() { - if (!this._defaultNormalShader) { - this._defaultNormalShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.normalVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.normalFrag); - } - return this._defaultNormalShader; - } - }, - { - key: '_getColorShader', - value: function _getColorShader() { - if (!this._defaultColorShader) { - this._defaultColorShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.normalVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.basicFrag); - } - return this._defaultColorShader; - } - }, - { - key: '_getPointShader', - value: function _getPointShader() { - if (!this._defaultPointShader) { - this._defaultPointShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.pointVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.pointFrag); - } - return this._defaultPointShader; - } - }, - { - key: '_getLineShader', - value: function _getLineShader() { - if (!this._defaultLineShader) { - this._defaultLineShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.lineVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.lineFrag); - } - return this._defaultLineShader; - } - }, - { - key: '_getFontShader', - value: function _getFontShader() { - if (!this._defaultFontShader) { - if (this.webglVersion === constants.WEBGL) { - this.GL.getExtension('OES_standard_derivatives'); - } - this._defaultFontShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.fontVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.fontFrag); - } - return this._defaultFontShader; - } - }, - { - key: '_webGL2CompatibilityPrefix', - value: function _webGL2CompatibilityPrefix(shaderType, floatPrecision) { - var code = ''; - if (this.webglVersion === constants.WEBGL2) { - code += '#version 300 es\n#define WEBGL2\n'; - } - if (shaderType === 'vert') { - code += '#define VERTEX_SHADER\n'; - } else if (shaderType === 'frag') { - code += '#define FRAGMENT_SHADER\n'; - } - if (floatPrecision) { - code += 'precision '.concat(floatPrecision, ' float;\n'); - } - return code; - } - }, - { - key: '_getEmptyTexture', - value: function _getEmptyTexture() { - if (!this._emptyTexture) { - // a plain white texture RGBA, full alpha, single pixel. - var im = new _main.default.Image(1, 1); - im.set(0, 0, 255); - this._emptyTexture = new _main.default.Texture(this, im); - } - return this._emptyTexture; - } - }, - { - key: 'getTexture', - value: function getTexture(input) { - var src = input; - if (src instanceof _main.default.Framebuffer) { - src = src.color; - } - var texture = this.textures.get(src); - if (texture) { - return texture; - } - var tex = new _main.default.Texture(this, src); - this.textures.set(src, tex); - return tex; - } /* - * used in imageLight, - * To create a blurry image from the input non blurry img, if it doesn't already exist - * Add it to the diffusedTexture map, - * Returns the blurry image - * maps a p5.Image used by imageLight() to a p5.Graphics - */ - - }, - { - key: 'getDiffusedTexture', - value: function getDiffusedTexture(input) { - // if one already exists for a given input image - if (this.diffusedTextures.get(input) != null) { - return this.diffusedTextures.get(input); - } // if not, only then create one - - var newGraphic; // maybe switch to framebuffer - // hardcoded to 200px, because it's going to be blurry and smooth - var smallWidth = 200; - var width = smallWidth; - var height = Math.floor(smallWidth * (input.height / input.width)); - newGraphic = this._pInst.createGraphics(width, height, constants.WEBGL); - // create graphics is like making a new sketch, all functions on main - // sketch it would be available on graphics - var irradiance = newGraphic.createShader(defaultShaders.imageLightVert, defaultShaders.imageLightDiffusedFrag); - newGraphic.shader(irradiance); - irradiance.setUniform('environmentMap', input); - newGraphic.noStroke(); - newGraphic.rectMode(newGraphic.CENTER); - newGraphic.rect(0, 0, newGraphic.width, newGraphic.height); - this.diffusedTextures.set(input, newGraphic); - return newGraphic; - } /* - * used in imageLight, - * To create a texture from the input non blurry image, if it doesn't already exist - * Creating 8 different levels of textures according to different - * sizes and atoring them in `levels` array - * Creating a new Mipmap texture with that `levels` array - * Storing the texture for input image in map called `specularTextures` - * maps the input p5.Image to a p5.MipmapTexture - */ - - }, - { - key: 'getSpecularTexture', - value: function getSpecularTexture(input) { - // check if already exits (there are tex of diff resolution so which one to check) - // currently doing the whole array - if (this.specularTextures.get(input) != null) { - return this.specularTextures.get(input); - } // Hardcoded size - - var size = 512; - var tex; - var levels = [ - ]; - var graphic = this._pInst.createGraphics(size, size, constants.WEBGL); - var count = Math.log(size) / Math.log(2); - graphic.pixelDensity(1); - // currently only 8 levels - // This loop calculates 8 graphics of varying size of canvas - // and corresponding different roughness levels. - // Roughness increases with the decrease in canvas size, - // because rougher surfaces have less detailed/more blurry reflections. - for (var w = size; w >= 1; w /= 2) { - graphic.resizeCanvas(w, w); - var currCount = Math.log(w) / Math.log(2); - var roughness = 1 - currCount / count; - var myShader = graphic.createShader(defaultShaders.imageLightVert, defaultShaders.imageLightSpecularFrag); - graphic.shader(myShader); - graphic.clear(); - myShader.setUniform('environmentMap', input); - myShader.setUniform('roughness', roughness); - graphic.noStroke(); - graphic.plane(w, w); - levels.push(graphic.get().drawingContext.getImageData(0, 0, w, w)); - } - graphic.remove(); - tex = new _p6.MipmapTexture(this, levels, { - }); - this.specularTextures.set(input, tex); - return tex; - } /** - * @method activeFramebuffer - * @private - * @returns {p5.Framebuffer|null} The currently active framebuffer, or null if - * the main canvas is the current draw target. - */ - - }, - { - key: 'activeFramebuffer', - value: function activeFramebuffer() { - return this.activeFramebuffers[this.activeFramebuffers.length - 1] || null; - } - }, - { - key: 'createFramebuffer', - value: function createFramebuffer(options) { - return new _main.default.Framebuffer(this, options); - } - }, - { - key: '_setStrokeUniforms', - value: function _setStrokeUniforms(strokeShader) { - strokeShader.bindShader(); - // set the uniform values - strokeShader.setUniform('uUseLineColor', this._useLineColor); - strokeShader.setUniform('uMaterialColor', this.curStrokeColor); - strokeShader.setUniform('uStrokeWeight', this.curStrokeWeight); - strokeShader.setUniform('uStrokeCap', STROKE_CAP_ENUM[this.curStrokeCap]); - strokeShader.setUniform('uStrokeJoin', STROKE_JOIN_ENUM[this.curStrokeJoin]); - } - }, - { - key: '_setFillUniforms', - value: function _setFillUniforms(fillShader) { - fillShader.bindShader(); - // TODO: optimize - fillShader.setUniform('uUseVertexColor', this._useVertexColor); - fillShader.setUniform('uMaterialColor', this.curFillColor); - fillShader.setUniform('isTexture', !!this._tex); - if (this._tex) { - fillShader.setUniform('uSampler', this._tex); - } - fillShader.setUniform('uTint', this._tint); - fillShader.setUniform('uHasSetAmbient', this._hasSetAmbient); - fillShader.setUniform('uAmbientMatColor', this.curAmbientColor); - fillShader.setUniform('uSpecularMatColor', this.curSpecularColor); - fillShader.setUniform('uEmissiveMatColor', this.curEmissiveColor); - fillShader.setUniform('uSpecular', this._useSpecularMaterial); - fillShader.setUniform('uEmissive', this._useEmissiveMaterial); - fillShader.setUniform('uShininess', this._useShininess); - this._setImageLightUniforms(fillShader); - fillShader.setUniform('uUseLighting', this._enableLighting); - var pointLightCount = this.pointLightDiffuseColors.length / 3; - fillShader.setUniform('uPointLightCount', pointLightCount); - fillShader.setUniform('uPointLightLocation', this.pointLightPositions); - fillShader.setUniform('uPointLightDiffuseColors', this.pointLightDiffuseColors); - fillShader.setUniform('uPointLightSpecularColors', this.pointLightSpecularColors); - var directionalLightCount = this.directionalLightDiffuseColors.length / 3; - fillShader.setUniform('uDirectionalLightCount', directionalLightCount); - fillShader.setUniform('uLightingDirection', this.directionalLightDirections); - fillShader.setUniform('uDirectionalDiffuseColors', this.directionalLightDiffuseColors); - fillShader.setUniform('uDirectionalSpecularColors', this.directionalLightSpecularColors); - // TODO: sum these here... - var ambientLightCount = this.ambientLightColors.length / 3; - fillShader.setUniform('uAmbientLightCount', ambientLightCount); - fillShader.setUniform('uAmbientColor', this.ambientLightColors); - var spotLightCount = this.spotLightDiffuseColors.length / 3; - fillShader.setUniform('uSpotLightCount', spotLightCount); - fillShader.setUniform('uSpotLightAngle', this.spotLightAngle); - fillShader.setUniform('uSpotLightConc', this.spotLightConc); - fillShader.setUniform('uSpotLightDiffuseColors', this.spotLightDiffuseColors); - fillShader.setUniform('uSpotLightSpecularColors', this.spotLightSpecularColors); - fillShader.setUniform('uSpotLightLocation', this.spotLightPositions); - fillShader.setUniform('uSpotLightDirection', this.spotLightDirections); - fillShader.setUniform('uConstantAttenuation', this.constantAttenuation); - fillShader.setUniform('uLinearAttenuation', this.linearAttenuation); - fillShader.setUniform('uQuadraticAttenuation', this.quadraticAttenuation); - fillShader.bindTextures(); - } // getting called from _setFillUniforms - - }, - { - key: '_setImageLightUniforms', - value: function _setImageLightUniforms(shader) { - //set uniform values - shader.setUniform('uUseImageLight', this.activeImageLight != null); - // true - if (this.activeImageLight) { - // this.activeImageLight has image as a key - // look up the texture from the diffusedTexture map - var diffusedLight = this.getDiffusedTexture(this.activeImageLight); - shader.setUniform('environmentMapDiffused', diffusedLight); - var specularLight = this.getSpecularTexture(this.activeImageLight); - // In p5js the range of shininess is >= 1, - // Therefore roughness range will be ([0,1]*8)*20 or [0, 160] - // The factor of 8 is because currently the getSpecularTexture - // only calculated 8 different levels of roughness - // The factor of 20 is just to spread up this range so that, - // [1, max] of shininess is converted to [0,160] of roughness - var roughness = 20 / this._useShininess; - shader.setUniform('levelOfDetail', roughness * 8); - shader.setUniform('environmentMapSpecular', specularLight); - } - } - }, - { - key: '_setPointUniforms', - value: function _setPointUniforms(pointShader) { - pointShader.bindShader(); - // set the uniform values - pointShader.setUniform('uMaterialColor', this.curStrokeColor); - // @todo is there an instance where this isn't stroke weight? - // should be they be same var? - pointShader.setUniform('uPointSize', this.pointSize * this._pInst._pixelDensity); - } /* Binds a buffer to the drawing context - * when passed more than two arguments it also updates or initializes - * the data associated with the buffer - */ - - }, - { - key: '_bindBuffer', - value: function _bindBuffer(buffer, target, values, type, usage) { - if (!target) target = this.GL.ARRAY_BUFFER; - this.GL.bindBuffer(target, buffer); - if (values !== undefined) { - var data = values; - if (values instanceof _main.default.DataArray) { - data = values.dataArray(); - } else if (!(data instanceof (type || Float32Array))) { - data = new (type || Float32Array) (data); - } - this.GL.bufferData(target, data, usage || this.GL.STATIC_DRAW); - } - } /////////////////////////////// - //// UTILITY FUNCTIONS - ////////////////////////////// - - }, - { - key: '_arraysEqual', - value: function _arraysEqual(a, b) { - var aLength = a.length; - if (aLength !== b.length) return false; - return a.every(function (ai, i) { - return ai === b[i]; - }); - } - }, - { - key: '_isTypedArray', - value: function _isTypedArray(arr) { - return [Float32Array, - Float64Array, - Int16Array, - Uint16Array, - Uint32Array].some(function (x) { - return arr instanceof x; - }); - } /** - * turn a two dimensional array into one dimensional array - * @private - * @param {Array} arr 2-dimensional array - * @return {Array} 1-dimensional array - * [[1, 2, 3],[4, 5, 6]] -> [1, 2, 3, 4, 5, 6] - */ - - }, - { - key: '_flatten', - value: function _flatten(arr) { - //when empty, return empty - if (arr.length === 0) { - return []; - } else if (arr.length > 20000) { - //big models , load slower to avoid stack overflow - //faster non-recursive flatten via axelduch - //stackoverflow.com/questions/27266550/how-to-flatten-nested-array-in-javascript - var result = [ - ]; - var nodes = arr.slice(); - var node; - node = nodes.pop(); - do { - if (Array.isArray(node)) { - nodes.push.apply(nodes, _toConsumableArray(node)); - } else { - result.push(node); - } - } while (nodes.length && (node = nodes.pop()) !== undefined); - result.reverse(); // we reverse result to restore the original order - return result; - } else { - var _ref; - //otherwise if model within limits for browser - //use faster recursive loading - return (_ref = [ - ]).concat.apply(_ref, _toConsumableArray(arr)); - } - } /** - * turn a p5.Vector Array into a one dimensional number array - * @private - * @param {p5.Vector[]} arr an array of p5.Vector - * @return {Number[]} a one dimensional array of numbers - * [p5.Vector(1, 2, 3), p5.Vector(4, 5, 6)] -> - * [1, 2, 3, 4, 5, 6] - */ - - }, - { - key: '_vToNArray', - value: function _vToNArray(arr) { - var ret = [ - ]; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = arr[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var item = _step2.value; - ret.push(item.x, item.y, item.z); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return ret; - } // function to calculate BezierVertex Coefficients - - }, - { - key: '_bezierCoefficients', - value: function _bezierCoefficients(t) { - var t2 = t * t; - var t3 = t2 * t; - var mt = 1 - t; - var mt2 = mt * mt; - var mt3 = mt2 * mt; - return [mt3, - 3 * mt2 * t, - 3 * mt * t2, - t3]; - } // function to calculate QuadraticVertex Coefficients - - }, - { - key: '_quadraticCoefficients', - value: function _quadraticCoefficients(t) { - var t2 = t * t; - var mt = 1 - t; - var mt2 = mt * mt; - return [mt2, - 2 * mt * t, - t2]; - } // function to convert Bezier coordinates to Catmull Rom Splines - - }, - { - key: '_bezierToCatmull', - value: function _bezierToCatmull(w) { - var p1 = w[1]; - var p2 = w[1] + (w[2] - w[0]) / this._curveTightness; - var p3 = w[2] - (w[3] - w[1]) / this._curveTightness; - var p4 = w[2]; - var p = [ - p1, - p2, - p3, - p4 - ]; - return p; - } - }, - { - key: '_initTessy', - value: function _initTessy() { - // function called for each vertex of tesselator output - function vertexCallback(data, polyVertArray) { - for (var i = 0; i < data.length; i++) { - polyVertArray.push(data[i]); - } - } - function begincallback(type) { - if (type !== _libtess.default.primitiveType.GL_TRIANGLES) { - console.log('expected TRIANGLES but got type: '.concat(type)); - } - } - function errorcallback(errno) { - console.log('error callback'); - console.log('error number: '.concat(errno)); - } // callback for when segments intersect and must be split - - function combinecallback(coords, data, weight) { - var result = new Array(_main.default.RendererGL.prototype.tessyVertexSize).fill(0); - for (var i = 0; i < weight.length; i++) { - for (var j = 0; j < result.length; j++) { - if (weight[i] === 0 || !data[i]) continue; - result[j] += data[i][j] * weight[i]; - } - } - return result; - } - function edgeCallback(flag) { - // don't really care about the flag, but need no-strip/no-fan behavior - } - var tessy = new _libtess.default.GluTesselator(); - tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_VERTEX_DATA, vertexCallback); - tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_BEGIN, begincallback); - tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_ERROR, errorcallback); - tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_COMBINE, combinecallback); - tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_EDGE_FLAG, edgeCallback); - tessy.gluTessProperty(_libtess.default.gluEnum.GLU_TESS_WINDING_RULE, _libtess.default.windingRule.GLU_TESS_WINDING_NONZERO); - return tessy; - } - }, - { - key: '_triangulate', - value: function _triangulate(contours) { - // libtess will take 3d verts and flatten to a plane for tesselation. - // libtess is capable of calculating a plane to tesselate on, but - // if all of the vertices have the same z values, we'll just - // assume the face is facing the camera, letting us skip any performance - // issues or bugs in libtess's automatic calculation. - var z = contours[0] ? contours[0][2] : undefined; - var allSameZ = true; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = contours[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var contour = _step3.value; - for (var j = 0; j < contour.length; j += _main.default.RendererGL.prototype.tessyVertexSize) { - if (contour[j + 2] !== z) { - allSameZ = false; - break; - } - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - if (allSameZ) { - this._tessy.gluTessNormal(0, 0, 1); - } else { - // Let libtess pick a plane for us - this._tessy.gluTessNormal(0, 0, 0); - } - var triangleVerts = [ - ]; - this._tessy.gluTessBeginPolygon(triangleVerts); - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for (var _iterator4 = contours[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var _contour = _step4.value; - this._tessy.gluTessBeginContour(); - for (var _j = 0; _j < _contour.length; _j += _main.default.RendererGL.prototype.tessyVertexSize) { - var coords = _contour.slice(_j, _j + _main.default.RendererGL.prototype.tessyVertexSize); - this._tessy.gluTessVertex(coords, coords); - } - this._tessy.gluTessEndContour(); - } // finish polygon - - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - this._tessy.gluTessEndPolygon(); - return triangleVerts; - } - } - ]); - return RendererGL; - }(_main.default.Renderer); - /** - * ensures that p5 is using a 3d renderer. throws an error if not. - */ - _main.default.prototype._assert3d = function (name) { - if (!this._renderer.isP3D) throw new Error(''.concat(name, '() is only supported in WEBGL mode. If you\'d like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.')); - }; - // function to initialize GLU Tesselator - _main.default.RendererGL.prototype.tessyVertexSize = 12; - var _default = _main.default.RendererGL; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - '../core/p5.Renderer': 301, - './GeometryBuilder': 342, - './p5.Camera': 347, - './p5.Framebuffer': 349, - './p5.Matrix': 351, - './p5.Shader': 356, - './p5.Texture': 357, - 'core-js/modules/es.array.concat': 169, - 'core-js/modules/es.array.copy-within': 170, - 'core-js/modules/es.array.every': 171, - 'core-js/modules/es.array.fill': 172, - 'core-js/modules/es.array.from': 176, - 'core-js/modules/es.array.includes': 177, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.some': 184, - 'core-js/modules/es.map': 187, - 'core-js/modules/es.object.assign': 194, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.reflect.get': 203, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.set': 207, - 'core-js/modules/es.string.includes': 209, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.float32-array': 229, - 'core-js/modules/es.typed-array.float64-array': 230, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.int16-array': 234, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint16-array': 250, - 'core-js/modules/es.typed-array.uint32-array': 251, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256, - 'libtess': 269, - 'path': 272 - } - ], - 356: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.index-of'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.array.slice'); - _dereq_('core-js/modules/es.array.some'); - _dereq_('core-js/modules/es.function.name'); - _dereq_('core-js/modules/es.object.keys'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * This module defines the p5.Shader class - * @module 3D - * @submodule Material - * @for p5 - * @requires core - */ - /** - * Shader class for WEBGL Mode - * @class p5.Shader - * @constructor - * @param {p5.RendererGL} renderer an instance of p5.RendererGL that - * will provide the GL context for this new p5.Shader - * @param {String} vertSrc source code for the vertex shader (as a string) - * @param {String} fragSrc source code for the fragment shader (as a string) - */ - - _main.default.Shader = /*#__PURE__*/ function () { - function _class(renderer, vertSrc, fragSrc) { - _classCallCheck(this, _class); - // TODO: adapt this to not take ids, but rather, - // to take the source for a vertex and fragment shader - // to enable custom shaders at some later date - this._renderer = renderer; - this._vertSrc = vertSrc; - this._fragSrc = fragSrc; - this._vertShader = - 1; - this._fragShader = - 1; - this._glProgram = 0; - this._loadedAttributes = false; - this.attributes = { - }; - this._loadedUniforms = false; - this.uniforms = { - }; - this._bound = false; - this.samplers = [ - ]; - } /** - * Creates, compiles, and links the shader based on its - * sources for the vertex and fragment shaders (provided - * to the constructor). Populates known attributes and - * uniforms from the shader. - * @method init - * @chainable - * @private - */ - - _createClass(_class, [ - { - key: 'init', - value: function init() { - if (this._glProgram === 0 /* or context is stale? */ ) { - var gl = this._renderer.GL; - // @todo: once custom shading is allowed, - // friendly error messages should be used here to share - // compiler and linker errors. - //set up the shader by - // 1. creating and getting a gl id for the shader program, - // 2. compliling its vertex & fragment sources, - // 3. linking the vertex and fragment shaders - this._vertShader = gl.createShader(gl.VERTEX_SHADER); - //load in our default vertex shader - gl.shaderSource(this._vertShader, this._vertSrc); - gl.compileShader(this._vertShader); - // if our vertex shader failed compilation? - if (!gl.getShaderParameter(this._vertShader, gl.COMPILE_STATUS)) { - _main.default._friendlyError('Yikes! An error occurred compiling the vertex shader:'.concat(gl.getShaderInfoLog(this._vertShader))); - return null; - } - this._fragShader = gl.createShader(gl.FRAGMENT_SHADER); - //load in our material frag shader - gl.shaderSource(this._fragShader, this._fragSrc); - gl.compileShader(this._fragShader); - // if our frag shader failed compilation? - if (!gl.getShaderParameter(this._fragShader, gl.COMPILE_STATUS)) { - _main.default._friendlyError('Darn! An error occurred compiling the fragment shader:'.concat(gl.getShaderInfoLog(this._fragShader))); - return null; - } - this._glProgram = gl.createProgram(); - gl.attachShader(this._glProgram, this._vertShader); - gl.attachShader(this._glProgram, this._fragShader); - gl.linkProgram(this._glProgram); - if (!gl.getProgramParameter(this._glProgram, gl.LINK_STATUS)) { - _main.default._friendlyError('Snap! Error linking shader program: '.concat(gl.getProgramInfoLog(this._glProgram))); - } - this._loadAttributes(); - this._loadUniforms(); - } - return this; - } /** - * Shaders belong to the main canvas or a p5.Graphics. Once they are compiled, - * they can only be used in the context they were compiled on. - * - * Use this method to make a new copy of a shader that gets compiled on a - * different context. - * - * @method copyToContext - * @param {p5|p5.Graphics} context The graphic or instance to copy this shader to. - * Pass `window` if you need to copy to the main canvas. - * @returns {p5.Shader} A new shader on the target context. - * - * @example - *
                    - * - * let graphic = createGraphics(200, 200, WEBGL); - * let graphicShader = graphic.createShader(vert, frag); - * graphic.shader(graphicShader); // Use graphicShader on the graphic - * - * let mainShader = graphicShader.copyToContext(window); - * shader(mainShader); // Use `mainShader` on the main canvas - * - *
                    - */ - - }, - { - key: 'copyToContext', - value: function copyToContext(context) { - var shader = new _main.default.Shader(context._renderer, this._vertSrc, this._fragSrc); - shader.ensureCompiledOnContext(context); - return shader; - } /** - * @private - */ - - }, - { - key: 'ensureCompiledOnContext', - value: function ensureCompiledOnContext(context) { - if (this._glProgram !== 0 && this._renderer !== context._renderer) { - throw new Error('The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?'); - } else if (this._glProgram === 0) { - this._renderer = context._renderer; - this.init(); - } - } /** - * Queries the active attributes for this shader and loads - * their names and locations into the attributes array. - * @method _loadAttributes - * @private - */ - - }, - { - key: '_loadAttributes', - value: function _loadAttributes() { - if (this._loadedAttributes) { - return; - } - this.attributes = { - }; - var gl = this._renderer.GL; - var numAttributes = gl.getProgramParameter(this._glProgram, gl.ACTIVE_ATTRIBUTES); - for (var i = 0; i < numAttributes; ++i) { - var attributeInfo = gl.getActiveAttrib(this._glProgram, i); - var name = attributeInfo.name; - var location = gl.getAttribLocation(this._glProgram, name); - var attribute = { - }; - attribute.name = name; - attribute.location = location; - attribute.index = i; - attribute.type = attributeInfo.type; - attribute.size = attributeInfo.size; - this.attributes[name] = attribute; - } - this._loadedAttributes = true; - } /** - * Queries the active uniforms for this shader and loads - * their names and locations into the uniforms array. - * @method _loadUniforms - * @private - */ - - }, - { - key: '_loadUniforms', - value: function _loadUniforms() { - if (this._loadedUniforms) { - return; - } - var gl = this._renderer.GL; - // Inspect shader and cache uniform info - var numUniforms = gl.getProgramParameter(this._glProgram, gl.ACTIVE_UNIFORMS); - var samplerIndex = 0; - for (var i = 0; i < numUniforms; ++i) { - var uniformInfo = gl.getActiveUniform(this._glProgram, i); - var uniform = { - }; - uniform.location = gl.getUniformLocation(this._glProgram, uniformInfo.name); - uniform.size = uniformInfo.size; - var uniformName = uniformInfo.name; - //uniforms thats are arrays have their name returned as - //someUniform[0] which is a bit silly so we trim it - //off here. The size property tells us that its an array - //so we dont lose any information by doing this - if (uniformInfo.size > 1) { - uniformName = uniformName.substring(0, uniformName.indexOf('[0]')); - } - uniform.name = uniformName; - uniform.type = uniformInfo.type; - uniform._cachedData = undefined; - if (uniform.type === gl.SAMPLER_2D) { - uniform.samplerIndex = samplerIndex; - samplerIndex++; - this.samplers.push(uniform); - } - uniform.isArray = uniformInfo.size > 1 || uniform.type === gl.FLOAT_MAT3 || uniform.type === gl.FLOAT_MAT4 || uniform.type === gl.FLOAT_VEC2 || uniform.type === gl.FLOAT_VEC3 || uniform.type === gl.FLOAT_VEC4 || uniform.type === gl.INT_VEC2 || uniform.type === gl.INT_VEC4 || uniform.type === gl.INT_VEC3; - this.uniforms[uniformName] = uniform; - } - this._loadedUniforms = true; - } - }, - { - key: 'compile', - value: function compile() { - // TODO - } /** - * initializes (if needed) and binds the shader program. - * @method bindShader - * @private - */ - - }, - { - key: 'bindShader', - value: function bindShader() { - this.init(); - if (!this._bound) { - this.useProgram(); - this._bound = true; - this._setMatrixUniforms(); - this.setUniform('uViewport', this._renderer._viewport); - } - } /** - * @method unbindShader - * @chainable - * @private - */ - - }, - { - key: 'unbindShader', - value: function unbindShader() { - if (this._bound) { - this.unbindTextures(); - //this._renderer.GL.useProgram(0); ?? - this._bound = false; - } - return this; - } - }, - { - key: 'bindTextures', - value: function bindTextures() { - var gl = this._renderer.GL; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = this.samplers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var uniform = _step.value; - var tex = uniform.texture; - if (tex === undefined) { - // user hasn't yet supplied a texture for this slot. - // (or there may not be one--maybe just lighting), - // so we supply a default texture instead. - tex = this._renderer._getEmptyTexture(); - } - gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); - tex.bindTexture(); - tex.update(); - gl.uniform1i(uniform.location, uniform.samplerIndex); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - }, - { - key: 'updateTextures', - value: function updateTextures() { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = this.samplers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var uniform = _step2.value; - var tex = uniform.texture; - if (tex) { - tex.update(); - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - } - }, - { - key: 'unbindTextures', - value: function unbindTextures() { - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = this.samplers[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var uniform = _step3.value; - this.setUniform(uniform.name, this._renderer._getEmptyTexture()); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - } - }, - { - key: '_setMatrixUniforms', - value: function _setMatrixUniforms() { - var viewMatrix = this._renderer._curCamera.cameraMatrix; - var projectionMatrix = this._renderer.uPMatrix; - var modelViewMatrix = this._renderer.uMVMatrix; - var modelViewProjectionMatrix = modelViewMatrix.copy(); - modelViewProjectionMatrix.mult(projectionMatrix); - if (this.isStrokeShader()) { - if (this._renderer._curCamera.cameraType === 'default') { - // strokes scale up as they approach camera, default - this.setUniform('uPerspective', 1); - } else { - // strokes have uniform scale regardless of distance from camera - this.setUniform('uPerspective', 0); - } - } - this.setUniform('uViewMatrix', viewMatrix.mat4); - this.setUniform('uProjectionMatrix', projectionMatrix.mat4); - this.setUniform('uModelViewMatrix', modelViewMatrix.mat4); - this.setUniform('uModelViewProjectionMatrix', modelViewProjectionMatrix.mat4); - if (this.uniforms.uNormalMatrix) { - this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix); - this.setUniform('uNormalMatrix', this._renderer.uNMatrix.mat3); - } - } /** - * @method useProgram - * @chainable - * @private - */ - - }, - { - key: 'useProgram', - value: function useProgram() { - var gl = this._renderer.GL; - if (this._renderer._curShader !== this) { - gl.useProgram(this._glProgram); - this._renderer._curShader = this; - } - return this; - } /** - * Used to set the uniforms of a - * p5.Shader object. - * - * Uniforms are used as a way to provide shader programs - * (which run on the GPU) with values from a sketch - * (which runs on the CPU). - * - * Here are some examples of uniforms you can make: - * - booleans - * - Example: `setUniform('x', true)` becomes `uniform float x` with the value `1.0` - * - numbers - * - Example: `setUniform('x', -2)` becomes `uniform float x` with the value `-2.0` - * - arrays of numbers - * - Example: `setUniform('x', [0, 0.5, 1])` becomes `uniform vec3 x` with the value `vec3(0.0, 0.5, 1.0)` - * - a p5.Image, p5.Graphics, p5.MediaElement, or p5.Texture - * - Example: `setUniform('x', img)` becomes `uniform sampler2D x` - * - * @method setUniform - * @chainable - * @param {String} uniformName the name of the uniform. - * Must correspond to the name used in the vertex and fragment shaders - * @param {Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture} - * data the data to associate with the uniform. The type can be - * a boolean (true/false), a number, an array of numbers, or - * an image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture) - * - * @example - *
                    - * - * // Click within the image to toggle the value of uniforms - * // Note: for an alternative approach to the same example, - * // involving toggling between shaders please refer to: - * // https://p5js.org/reference/#/p5/shader - * - * let grad; - * let showRedGreen = false; - * - * function preload() { - * // note that we are using two instances - * // of the same vertex and fragment shaders - * grad = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * shader(grad); - * noStroke(); - * - * describe( - * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' - * ); - * } - * - * function draw() { - * // update the offset values for each scenario, - * // moving the "grad" shader in either vertical or - * // horizontal direction each with differing colors - * - * if (showRedGreen === true) { - * grad.setUniform('colorCenter', [1, 0, 0]); - * grad.setUniform('colorBackground', [0, 1, 0]); - * grad.setUniform('offset', [sin(millis() / 2000), 1]); - * } else { - * grad.setUniform('colorCenter', [1, 0.5, 0]); - * grad.setUniform('colorBackground', [0.226, 0, 0.615]); - * grad.setUniform('offset', [0, sin(millis() / 2000) + 1]); - * } - * quad(-1, -1, 1, -1, 1, 1, -1, 1); - * } - * - * function mouseClicked() { - * showRedGreen = !showRedGreen; - * } - * - *
                    - * - * @alt - * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. - */ - - }, - { - key: 'setUniform', - value: function setUniform(uniformName, data) { - var uniform = this.uniforms[uniformName]; - if (!uniform) { - return; - } - var gl = this._renderer.GL; - if (uniform.isArray) { - if (uniform._cachedData && this._renderer._arraysEqual(uniform._cachedData, data)) { - return; - } else { - uniform._cachedData = data.slice(0); - } - } else if (uniform._cachedData && uniform._cachedData === data) { - return; - } else { - if (Array.isArray(data)) { - uniform._cachedData = data.slice(0); - } else { - uniform._cachedData = data; - } - } - var location = uniform.location; - this.useProgram(); - switch (uniform.type) { - case gl.BOOL: - if (data === true) { - gl.uniform1i(location, 1); - } else { - gl.uniform1i(location, 0); - } - break; - case gl.INT: - if (uniform.size > 1) { - data.length && gl.uniform1iv(location, data); - } else { - gl.uniform1i(location, data); - } - break; - case gl.FLOAT: - if (uniform.size > 1) { - data.length && gl.uniform1fv(location, data); - } else { - gl.uniform1f(location, data); - } - break; - case gl.FLOAT_MAT3: - gl.uniformMatrix3fv(location, false, data); - break; - case gl.FLOAT_MAT4: - gl.uniformMatrix4fv(location, false, data); - break; - case gl.FLOAT_VEC2: - if (uniform.size > 1) { - data.length && gl.uniform2fv(location, data); - } else { - gl.uniform2f(location, data[0], data[1]); - } - break; - case gl.FLOAT_VEC3: - if (uniform.size > 1) { - data.length && gl.uniform3fv(location, data); - } else { - gl.uniform3f(location, data[0], data[1], data[2]); - } - break; - case gl.FLOAT_VEC4: - if (uniform.size > 1) { - data.length && gl.uniform4fv(location, data); - } else { - gl.uniform4f(location, data[0], data[1], data[2], data[3]); - } - break; - case gl.INT_VEC2: - if (uniform.size > 1) { - data.length && gl.uniform2iv(location, data); - } else { - gl.uniform2i(location, data[0], data[1]); - } - break; - case gl.INT_VEC3: - if (uniform.size > 1) { - data.length && gl.uniform3iv(location, data); - } else { - gl.uniform3i(location, data[0], data[1], data[2]); - } - break; - case gl.INT_VEC4: - if (uniform.size > 1) { - data.length && gl.uniform4iv(location, data); - } else { - gl.uniform4i(location, data[0], data[1], data[2], data[3]); - } - break; - case gl.SAMPLER_2D: - gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); - uniform.texture = data instanceof _main.default.Texture ? data : this._renderer.getTexture(data); - gl.uniform1i(location, uniform.samplerIndex); - if (uniform.texture.src.gifProperties) { - uniform.texture.src._animateGif(this._renderer._pInst); - } - break; - //@todo complete all types - } - return this; - } /* NONE OF THIS IS FAST OR EFFICIENT BUT BEAR WITH ME - * - * these shader "type" query methods are used by various - * facilities of the renderer to determine if changing - * the shader type for the required action (for example, - * do we need to load the default lighting shader if the - * current shader cannot handle lighting?) - * - **/ - - }, - { - key: 'isLightShader', - value: function isLightShader() { - return this.attributes.aNormal !== undefined || this.uniforms.uUseLighting !== undefined || this.uniforms.uAmbientLightCount !== undefined || this.uniforms.uDirectionalLightCount !== undefined || this.uniforms.uPointLightCount !== undefined || this.uniforms.uAmbientColor !== undefined || this.uniforms.uDirectionalDiffuseColors !== undefined || this.uniforms.uDirectionalSpecularColors !== undefined || this.uniforms.uPointLightLocation !== undefined || this.uniforms.uPointLightDiffuseColors !== undefined || this.uniforms.uPointLightSpecularColors !== undefined || this.uniforms.uLightingDirection !== undefined || this.uniforms.uSpecular !== undefined; - } - }, - { - key: 'isNormalShader', - value: function isNormalShader() { - return this.attributes.aNormal !== undefined; - } - }, - { - key: 'isTextureShader', - value: function isTextureShader() { - return this.samplers.length > 0; - } - }, - { - key: 'isColorShader', - value: function isColorShader() { - return this.attributes.aVertexColor !== undefined || this.uniforms.uMaterialColor !== undefined; - } - }, - { - key: 'isTexLightShader', - value: function isTexLightShader() { - return this.isLightShader() && this.isTextureShader(); - } - }, - { - key: 'isStrokeShader', - value: function isStrokeShader() { - return this.uniforms.uStrokeWeight !== undefined; - } /** - * @method enableAttrib - * @chainable - * @private - */ - - }, - { - key: 'enableAttrib', - value: function enableAttrib(attr, size, type, normalized, stride, offset) { - if (attr) { - if (typeof IS_MINIFIED === 'undefined' && this.attributes[attr.name] !== attr) { - console.warn('The attribute "'.concat(attr.name, '"passed to enableAttrib does not belong to this shader.')); - } - var loc = attr.location; - if (loc !== - 1) { - var gl = this._renderer.GL; - // Enable register even if it is disabled - if (!this._renderer.registerEnabled.has(loc)) { - gl.enableVertexAttribArray(loc); - // Record register availability - this._renderer.registerEnabled.add(loc); - } - this._renderer.GL.vertexAttribPointer(loc, size, type || gl.FLOAT, normalized || false, stride || 0, offset || 0); - } - } - return this; - } /** - * Once all buffers have been bound, this checks to see if there are any - * remaining active attributes, likely left over from previous renders, - * and disables them so that they don't affect rendering. - * @method disableRemainingAttributes - * @private - */ - - }, - { - key: 'disableRemainingAttributes', - value: function disableRemainingAttributes() { - var _this = this; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - var _loop = function _loop() { - var location = _step4.value; - if (!Object.keys(_this.attributes).some(function (key) { - return _this.attributes[key].location === location; - })) { - _this._renderer.GL.disableVertexAttribArray(location); - _this._renderer.registerEnabled.delete(location); - } - }; - for (var _iterator4 = this._renderer.registerEnabled.values() [Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - _loop(); - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - } - } - ]); - return _class; - }(); - var _default = _main.default.Shader; - exports.default = _default; - }, - { - '../core/main': 298, - 'core-js/modules/es.array.index-of': 178, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.array.slice': 183, - 'core-js/modules/es.array.some': 184, - 'core-js/modules/es.function.name': 186, - 'core-js/modules/es.object.keys': 199, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 357: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.get-prototype-of'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.reflect.construct'); - _dereq_('core-js/modules/es.regexp.to-string'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.typed-array.uint8-array'); - _dereq_('core-js/modules/es.typed-array.copy-within'); - _dereq_('core-js/modules/es.typed-array.every'); - _dereq_('core-js/modules/es.typed-array.fill'); - _dereq_('core-js/modules/es.typed-array.filter'); - _dereq_('core-js/modules/es.typed-array.find'); - _dereq_('core-js/modules/es.typed-array.find-index'); - _dereq_('core-js/modules/es.typed-array.for-each'); - _dereq_('core-js/modules/es.typed-array.includes'); - _dereq_('core-js/modules/es.typed-array.index-of'); - _dereq_('core-js/modules/es.typed-array.iterator'); - _dereq_('core-js/modules/es.typed-array.join'); - _dereq_('core-js/modules/es.typed-array.last-index-of'); - _dereq_('core-js/modules/es.typed-array.map'); - _dereq_('core-js/modules/es.typed-array.reduce'); - _dereq_('core-js/modules/es.typed-array.reduce-right'); - _dereq_('core-js/modules/es.typed-array.reverse'); - _dereq_('core-js/modules/es.typed-array.set'); - _dereq_('core-js/modules/es.typed-array.slice'); - _dereq_('core-js/modules/es.typed-array.some'); - _dereq_('core-js/modules/es.typed-array.sort'); - _dereq_('core-js/modules/es.typed-array.subarray'); - _dereq_('core-js/modules/es.typed-array.to-locale-string'); - _dereq_('core-js/modules/es.typed-array.to-string'); - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.checkWebGLCapabilities = checkWebGLCapabilities; - exports.default = exports.MipmapTexture = void 0; - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call(Reflect.construct(Date, [ - ], function () { - })); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === 'object' || typeof call === 'function')) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * This module defines the p5.Texture class - * @module 3D - * @submodule Material - * @for p5 - * @requires core - */ - /** - * Texture class for WEBGL Mode - * @private - * @class p5.Texture - * @param {p5.RendererGL} renderer an instance of p5.RendererGL that - * will provide the GL context for this new p5.Texture - * @param {p5.Image|p5.Graphics|p5.Element|p5.MediaElement|ImageData|p5.Framebuffer|p5.FramebufferTexture|ImageData} [obj] the - * object containing the image data to store in the texture. - * @param {Object} [settings] optional A javascript object containing texture - * settings. - * @param {Number} [settings.format] optional The internal color component - * format for the texture. Possible values for format include gl.RGBA, - * gl.RGB, gl.ALPHA, gl.LUMINANCE, gl.LUMINANCE_ALPHA. Defaults to gl.RBGA - * @param {Number} [settings.minFilter] optional The texture minification - * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults - * to gl.LINEAR. Note, Mipmaps are not implemented in p5. - * @param {Number} [settings.magFilter] optional The texture magnification - * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults - * to gl.LINEAR. Note, Mipmaps are not implemented in p5. - * @param {Number} [settings.wrapS] optional The texture wrap settings for - * the s coordinate, or x axis. Possible values are gl.CLAMP_TO_EDGE, - * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available - * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE - * @param {Number} [settings.wrapT] optional The texture wrap settings for - * the t coordinate, or y axis. Possible values are gl.CLAMP_TO_EDGE, - * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available - * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE - * @param {Number} [settings.dataType] optional The data type of the texel - * data. Possible values are gl.UNSIGNED_BYTE or gl.FLOAT. There are more - * formats that are not implemented in p5. Defaults to gl.UNSIGNED_BYTE. + * @alt + * white 55×55 rect with black outline at center right. + * 3 white 55×55 rects with black outlines at top-l, center-r and bottom-r. + * a 20×20 white rect moving in a circle around the canvas */ + /** + * @method translate + * @param {p5.Vector} vector the vector to translate by + * @chainable + */ + _main.default.prototype.translate = function (x, y, z) { + _main.default._validateParameters("translate", arguments); + if (this._renderer.isP3D) { + this._renderer.translate(x, y, z); + } else { + this._renderer.translate(x, y); + } + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "./main": 298, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 312: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.ends-with"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.ends-with"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module Data + * @submodule LocalStorage + * @requires core + * + * This module defines the p5 methods for working with local storage + */ + /** + * + * Stores a value in local storage under the key name. + * Local storage is saved in the browser and persists + * between browsing sessions and page reloads. + * The key can be the name of the variable but doesn't + * have to be. To retrieve stored items + * see getItem. + * + * Sensitive data such as passwords or personal information + * should not be stored in local storage. + * + * @method storeItem + * @for p5 + * @param {String} key + * @param {String|Number|Object|Boolean|p5.Color|p5.Vector} value + * + * @example + *
                    + * // Type to change the letter in the + * // center of the canvas. + * // If you reload the page, it will + * // still display the last key you entered + * + * let myText; + * + * function setup() { + * createCanvas(100, 100); + * myText = getItem('myText'); + * if (myText === null) { + * myText = ''; + * } + * describe(`When you type the key name is displayed as black text on white background. + * If you reload the page, the last letter typed is still displaying.`); + * } + * + * function draw() { + * textSize(40); + * background(255); + * text(myText, width / 2, height / 2); + * } + * + * function keyPressed() { + * myText = key; + * storeItem('myText', myText); + * } + *
                    + */ + + _main.default.prototype.storeItem = function (key, value) { + if (typeof key !== "string") { + console.log( + "The argument that you passed to storeItem() - ".concat( + key, + " is not a string.", + ), + ); + } + if (key.endsWith("p5TypeID")) { + console.log( + "The argument that you passed to storeItem() - ".concat( + key, + " must not end with 'p5TypeID'.", + ), + ); + } + if (typeof value === "undefined") { + console.log( + "You cannot store undefined variables using storeItem().", + ); + } + var type = _typeof(value); + switch (type) { + case "number": + case "boolean": + value = value.toString(); + break; + case "object": + if (value instanceof _main.default.Color) { + type = "p5.Color"; + } else if (value instanceof _main.default.Vector) { + type = "p5.Vector"; + var coord = [value.x, value.y, value.z]; + value = coord; + } + value = JSON.stringify(value); + break; + case "string": + default: + break; + } + localStorage.setItem(key, value); + var typeKey = "".concat(key, "p5TypeID"); + localStorage.setItem(typeKey, type); + }; + /** + * + * Returns the value of an item that was stored in local storage + * using storeItem() + * + * @method getItem + * @for p5 + * @param {String} key name that you wish to use to store in local storage + * @return {Number|Object|String|Boolean|p5.Color|p5.Vector} Value of stored item + * + * @example + *
                    + * // Click the mouse to change + * // the color of the background + * // Once you have changed the color + * // it will stay changed even when you + * // reload the page. + * + * let myColor; + * + * function setup() { + * createCanvas(100, 100); + * myColor = getItem('myColor'); + * } + * + * function draw() { + * if (myColor !== null) { + * background(myColor); + * } + * describe(`If you click, the canvas changes to a random color.· + * If you reload the page, the canvas is still the color it was when the + * page was previously loaded.`); + * } + * + * function mousePressed() { + * myColor = color(random(255), random(255), random(255)); + * storeItem('myColor', myColor); + * } + *
                    + */ + _main.default.prototype.getItem = function (key) { + var value = localStorage.getItem(key); + var type = localStorage.getItem("".concat(key, "p5TypeID")); + if (typeof type === "undefined") { + console.log( + "Unable to determine type of item stored under ".concat( + key, + "in local storage. Did you save the item with something other than setItem()?", + ), + ); + } else if (value !== null) { + switch (type) { + case "number": + value = parseFloat(value); + break; + case "boolean": + value = value === "true"; + break; + case "object": + value = JSON.parse(value); + break; + case "p5.Color": + value = JSON.parse(value); + value = this.color.apply( + this, + _toConsumableArray(value.levels), + ); + break; + case "p5.Vector": + value = JSON.parse(value); + value = this.createVector.apply( + this, + _toConsumableArray(value), + ); + break; + case "string": + default: + break; + } + } + return value; + }; + /** + * + * Clears all local storage items set with storeItem() + * for the current domain. + * + * @method clearStorage + * @for p5 + * + * @example + *
                    + * + * function setup() { + * let myNum = 10; + * let myBool = false; + * storeItem('myNum', myNum); + * storeItem('myBool', myBool); + * print(getItem('myNum')); // logs 10 to the console + * print(getItem('myBool')); // logs false to the console + * clearStorage(); + * print(getItem('myNum')); // logs null to the console + * print(getItem('myBool')); // logs null to the console + * } + *
                    + */ + _main.default.prototype.clearStorage = function () { + localStorage.clear(); + }; + /** + * + * Removes an item that was stored with storeItem() + * + * @method removeItem + * @param {String} key + * @for p5 + * + * @example + *
                    + * + * function setup() { + * let myVar = 10; + * storeItem('myVar', myVar); + * print(getItem('myVar')); // logs 10 to the console + * removeItem('myVar'); + * print(getItem('myVar')); // logs null to the console + * } + *
                    + */ + _main.default.prototype.removeItem = function (key) { + if (typeof key !== "string") { + console.log( + "The argument that you passed to removeItem() - ".concat( + key, + " is not a string.", + ), + ); + } + localStorage.removeItem(key); + localStorage.removeItem("".concat(key, "p5TypeID")); + }; + }, + { + "../core/main": 298, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.ends-with": 208, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 313: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.object.keys"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Data + * @submodule Dictionary + * @for p5.TypedDict + * @requires core + * + * This module defines the p5 methods for the p5 Dictionary classes. + * The classes StringDict and NumberDict are for storing and working + * with key-value pairs. + */ + /** + * + * Creates a new instance of p5.StringDict using the key-value pair + * or the object you provide. + * + * @method createStringDict + * @for p5 + * @param {String} key + * @param {String} value + * @return {p5.StringDict} + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * print(myDictionary.hasKey('p5')); // logs true to console + * + * let anotherDictionary = createStringDict({ happy: 'coding' }); + * print(anotherDictionary.hasKey('happy')); // logs true to console + * } + *
                    + */ + /** + * @method createStringDict + * @param {Object} object object + * @return {p5.StringDict} + */ + + _main.default.prototype.createStringDict = function (key, value) { + _main.default._validateParameters("createStringDict", arguments); + return new _main.default.StringDict(key, value); + }; + /** + * + * Creates a new instance of p5.NumberDict using the key-value pair + * or object you provide. + * + * @method createNumberDict + * @for p5 + * @param {Number} key + * @param {Number} value + * @return {p5.NumberDict} + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict(100, 42); + * print(myDictionary.hasKey(100)); // logs true to console + * + * let anotherDictionary = createNumberDict({ 200: 84 }); + * print(anotherDictionary.hasKey(200)); // logs true to console + * } + *
                    + */ + /** + * @method createNumberDict + * @param {Object} object object + * @return {p5.NumberDict} + */ + _main.default.prototype.createNumberDict = function (key, value) { + _main.default._validateParameters("createNumberDict", arguments); + return new _main.default.NumberDict(key, value); + }; + /** + * + * Base class for all p5.Dictionary types. Specifically + * typed Dictionary classes inherit from this class. + * + * @class p5.TypedDict + * @constructor + */ + _main.default.TypedDict = /*#__PURE__*/ (function () { + function TypedDict(key, value) { + _classCallCheck(this, TypedDict); + if (key instanceof Object) { + this.data = key; + } else { + this.data = {}; + this.data[key] = value; + } + return this; + } /** + * Returns the number of key-value pairs currently stored in the Dictionary. + * + * @method size + * @return {Integer} the number of key-value pairs in the Dictionary + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict(1, 10); + * myDictionary.create(2, 20); + * myDictionary.create(3, 30); + * print(myDictionary.size()); // logs 3 to the console + * } + *
                    + */ + + _createClass(TypedDict, [ + { + key: "size", + value: function size() { + return Object.keys(this.data).length; + } /** + * Returns true if the given key exists in the Dictionary, + * otherwise returns false. + * + * @method hasKey + * @param {Number|String} key that you want to look up + * @return {Boolean} whether that key exists in Dictionary + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * print(myDictionary.hasKey('p5')); // logs true to console + * } + *
                    + */, + }, + { + key: "hasKey", + value: function hasKey(key) { + return this.data.hasOwnProperty(key); + } /** + * Returns the value stored at the given key. + * + * @method get + * @param {Number|String} the key you want to access + * @return {Number|String} the value stored at that key + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * let myValue = myDictionary.get('p5'); + * print(myValue === 'js'); // logs true to console + * } + *
                    + */, + }, + { + key: "get", + value: function get(key) { + if (this.data.hasOwnProperty(key)) { + return this.data[key]; + } else { + console.log( + "".concat(key, " does not exist in this Dictionary"), + ); + } + } /** + * Updates the value associated with the given key in case it already exists + * in the Dictionary. Otherwise a new key-value pair is added. + * + * @method set + * @param {Number|String} key + * @param {Number|String} value + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.set('p5', 'JS'); + * myDictionary.print(); // logs "key: p5 - value: JS" to console + * } + *
                    + */, + }, + { + key: "set", + value: function set(key, value) { + if (this._validate(value)) { + this.data[key] = value; + } else { + console.log( + "Those values dont work for this dictionary type.", + ); + } + } /** + * private helper function to handle the user passing in objects + * during construction or calls to create() + */, + }, + { + key: "_addObj", + value: function _addObj(obj) { + for (var key in obj) { + this.set(key, obj[key]); + } + } /** + * Creates a new key-value pair in the Dictionary. + * + * @method create + * @param {Number|String} key + * @param {Number|String} value + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.create('happy', 'coding'); + * myDictionary.print(); + * // above logs "key: p5 - value: js, key: happy - value: coding" to console + * } + *
                    + */, + /** + * @method create + * @param {Object} obj key/value pair + */ + }, + { + key: "create", + value: function create(key, value) { + if (key instanceof Object && typeof value === "undefined") { + this._addObj(key); + } else if (typeof key !== "undefined") { + this.set(key, value); + } else { + console.log( + "In order to create a new Dictionary entry you must pass " + + "an object or a key, value pair", + ); + } + } /** + * Removes all previously stored key-value pairs from the Dictionary. + * + * @method clear + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * print(myDictionary.hasKey('p5')); // prints 'true' + * myDictionary.clear(); + * print(myDictionary.hasKey('p5')); // prints 'false' + * } + * + *
                    + */, + }, + { + key: "clear", + value: function clear() { + this.data = {}; + } /** + * Removes the key-value pair stored at the given key from the Dictionary. + * + * @method remove + * @param {Number|String} key for the pair to remove + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.create('happy', 'coding'); + * myDictionary.print(); + * // above logs "key: p5 - value: js, key: happy - value: coding" to console + * myDictionary.remove('p5'); + * myDictionary.print(); + * // above logs "key: happy value: coding" to console + * } + *
                    + */, + }, + { + key: "remove", + value: function remove(key) { + if (this.data.hasOwnProperty(key)) { + delete this.data[key]; + } else { + throw new Error( + "".concat(key, " does not exist in this Dictionary"), + ); + } + } /** + * Logs the set of items currently stored in the Dictionary to the console. + * + * @method print + * + * @example + *
                    + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.create('happy', 'coding'); + * myDictionary.print(); + * // above logs "key: p5 - value: js, key: happy - value: coding" to console + * } + * + *
                    + */, + }, + { + key: "print", + value: function print() { + for (var item in this.data) { + console.log( + "key:".concat(item, " value:").concat(this.data[item]), + ); + } + } /** + * Converts the Dictionary into a CSV file for local download. + * + * @method saveTable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * createStringDict({ + * john: 1940, + * paul: 1942, + * george: 1943, + * ringo: 1940 + * }).saveTable('beatles'); + * } + * } + * + *
                    + */, + }, + { + key: "saveTable", + value: function saveTable(filename) { + var output = ""; + for (var key in this.data) { + output += "".concat(key, ",").concat(this.data[key], "\n"); + } + var blob = new Blob([output], { + type: "text/csv", + }); + _main.default.prototype.downloadFile( + blob, + filename || "mycsv", + "csv", + ); + } /** + * Converts the Dictionary into a JSON file for local download. + * + * @method saveJSON + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * createStringDict({ + * john: 1940, + * paul: 1942, + * george: 1943, + * ringo: 1940 + * }).saveJSON('beatles'); + * } + * } + * + *
                    + */, + }, + { + key: "saveJSON", + value: function saveJSON(filename, opt) { + _main.default.prototype.saveJSON(this.data, filename, opt); + } /** + * private helper function to ensure that the user passed in valid + * values for the Dictionary type + */, + }, + { + key: "_validate", + value: function _validate(value) { + return true; + }, + }, + ]); + return TypedDict; + })(); + /** + * + * A simple Dictionary class for Strings. + * + * @class p5.StringDict + * @extends p5.TypedDict + */ + _main.default.StringDict = /*#__PURE__*/ (function (_p5$TypedDict) { + _inherits(StringDict, _p5$TypedDict); + var _super = _createSuper(StringDict); + function StringDict() { + _classCallCheck(this, StringDict); + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + return _super.call.apply(_super, [this].concat(args)); + } + _createClass(StringDict, [ + { + key: "_validate", + value: function _validate(value) { + return typeof value === "string"; + }, + }, + ]); + return StringDict; + })(_main.default.TypedDict); + /** + * + * A simple Dictionary class for Numbers. + * + * @class p5.NumberDict + * @constructor + * @extends p5.TypedDict + */ + _main.default.NumberDict = /*#__PURE__*/ (function (_p5$TypedDict2) { + _inherits(NumberDict, _p5$TypedDict2); + var _super2 = _createSuper(NumberDict); + function NumberDict() { + _classCallCheck(this, NumberDict); + for ( + var _len2 = arguments.length, + args = new Array(_len2), + _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + return _super2.call.apply(_super2, [this].concat(args)); + } /** + * private helper function to ensure that the user passed in valid + * values for the Dictionary type + */ + + _createClass(NumberDict, [ + { + key: "_validate", + value: function _validate(value) { + return typeof value === "number"; + } /** + * Add the given number to the value currently stored at the given key. + * The sum then replaces the value previously stored in the Dictionary. + * + * @method add + * @param {Number} Key for the value you wish to add to + * @param {Number} Number to add to the value + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict(2, 5); + * myDictionary.add(2, 2); + * print(myDictionary.get(2)); // logs 7 to console. + * } + *
                    + * + */, + }, + { + key: "add", + value: function add(key, amount) { + if (this.data.hasOwnProperty(key)) { + this.data[key] += amount; + } else { + console.log( + "The key - ".concat( + key, + " does not exist in this dictionary.", + ), + ); + } + } /** + * Subtract the given number from the value currently stored at the given key. + * The difference then replaces the value previously stored in the Dictionary. + * + * @method sub + * @param {Number} Key for the value you wish to subtract from + * @param {Number} Number to subtract from the value + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict(2, 5); + * myDictionary.sub(2, 2); + * print(myDictionary.get(2)); // logs 3 to console. + * } + *
                    + * + */, + }, + { + key: "sub", + value: function sub(key, amount) { + this.add(key, -amount); + } /** + * Multiply the given number with the value currently stored at the given key. + * The product then replaces the value previously stored in the Dictionary. + * + * @method mult + * @param {Number} Key for value you wish to multiply + * @param {Number} Amount to multiply the value by + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict(2, 4); + * myDictionary.mult(2, 2); + * print(myDictionary.get(2)); // logs 8 to console. + * } + *
                    + * + */, + }, + { + key: "mult", + value: function mult(key, amount) { + if (this.data.hasOwnProperty(key)) { + this.data[key] *= amount; + } else { + console.log( + "The key - ".concat( + key, + " does not exist in this dictionary.", + ), + ); + } + } /** + * Divide the given number with the value currently stored at the given key. + * The quotient then replaces the value previously stored in the Dictionary. + * + * @method div + * @param {Number} Key for value you wish to divide + * @param {Number} Amount to divide the value by + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict(2, 8); + * myDictionary.div(2, 2); + * print(myDictionary.get(2)); // logs 4 to console. + * } + *
                    + * + */, + }, + { + key: "div", + value: function div(key, amount) { + if (this.data.hasOwnProperty(key)) { + this.data[key] /= amount; + } else { + console.log( + "The key - ".concat( + key, + " does not exist in this dictionary.", + ), + ); + } + } /** + * private helper function for finding lowest or highest value + * the argument 'flip' is used to flip the comparison arrow + * from 'less than' to 'greater than' + */, + }, + { + key: "_valueTest", + value: function _valueTest(flip) { + if (Object.keys(this.data).length === 0) { + throw new Error( + "Unable to search for a minimum or maximum value on an empty NumberDict", + ); + } else if (Object.keys(this.data).length === 1) { + return this.data[Object.keys(this.data)[0]]; + } else { + var result = this.data[Object.keys(this.data)[0]]; + for (var key in this.data) { + if (this.data[key] * flip < result * flip) { + result = this.data[key]; + } + } + return result; + } + } /** + * Return the lowest number currently stored in the Dictionary. + * + * @method minValue + * @return {Number} + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); + * let lowestValue = myDictionary.minValue(); // value is -10 + * print(lowestValue); + * } + *
                    + */, + }, + { + key: "minValue", + value: function minValue() { + return this._valueTest(1); + } /** + * Return the highest number currently stored in the Dictionary. + * + * @method maxValue + * @return {Number} + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); + * let highestValue = myDictionary.maxValue(); // value is 3 + * print(highestValue); + * } + *
                    + */, + }, + { + key: "maxValue", + value: function maxValue() { + return this._valueTest(-1); + } /** + * private helper function for finding lowest or highest key + * the argument 'flip' is used to flip the comparison arrow + * from 'less than' to 'greater than' + */, + }, + { + key: "_keyTest", + value: function _keyTest(flip) { + if (Object.keys(this.data).length === 0) { + throw new Error( + "Unable to use minValue on an empty NumberDict", + ); + } else if (Object.keys(this.data).length === 1) { + return Object.keys(this.data)[0]; + } else { + var result = Object.keys(this.data)[0]; + for (var i = 1; i < Object.keys(this.data).length; i++) { + if (Object.keys(this.data)[i] * flip < result * flip) { + result = Object.keys(this.data)[i]; + } + } + return result; + } + } /** + * Return the lowest key currently used in the Dictionary. + * + * @method minKey + * @return {Number} + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); + * let lowestKey = myDictionary.minKey(); // value is 1.2 + * print(lowestKey); + * } + *
                    + */, + }, + { + key: "minKey", + value: function minKey() { + return this._keyTest(1); + } /** + * Return the highest key currently used in the Dictionary. + * + * @method maxKey + * @return {Number} + * @example + *
                    + * + * function setup() { + * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); + * let highestKey = myDictionary.maxKey(); // value is 4 + * print(highestKey); + * } + *
                    + */, + }, + { + key: "maxKey", + value: function maxKey() { + return this._keyTest(-1); + }, + }, + ]); + return NumberDict; + })(_main.default.TypedDict); + var _default = _main.default.TypedDict; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 314: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/web.url"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/web.url"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * The web is much more than just canvas and the DOM functionality makes it easy to interact + * with other HTML5 objects, including text, hyperlink, image, input, video, + * audio, and webcam. + * There is a set of creation methods, DOM manipulation methods, and + * an extended p5.Element that supports a range of HTML elements. See the + * + * beyond the canvas tutorial for a full overview of how this addon works. + * + * See tutorial: beyond the canvas + * for more info on how to use this library. + * + * @module DOM + * @submodule DOM + * @for p5 + * @requires p5 + */ + /** + * Searches the page for the first element that matches the given + * CSS selector string. + * The string can be an ID, class, tag name, or a combination. `select()` + * returns a p5.Element object if it finds a match + * and `null` otherwise. + * + * The second parameter, `container`, is optional. It specifies a container to + * search within. container can be CSS selector string, a + * p5.Element object, or an + * HTMLElement object. + * + * @method select + * @param {String} selectors CSS selector string of element to search for. + * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or + * HTMLElement to search within. + * @return {p5.Element|null} p5.Element containing the element. + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * // Select the canvas by its tag. + * let cnv = select('canvas'); + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * let cnv = createCanvas(100, 100); + * // Add a class attribute to the canvas. + * cnv.class('pinkborder'); + * + * background(200); + * + * // Select the canvas by its class. + * cnv = select('.pinkborder'); + * // Style its border. + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * let cnv = createCanvas(100, 100); + * // Set the canvas ID. + * cnv.id('mycanvas'); + * + * background(200); + * + * // Select the canvas by its ID. + * cnv = select('#mycanvas'); + * // Style its border. + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
                    + */ + + _main.default.prototype.select = function (e, p) { + _main.default._validateParameters("select", arguments); + var container = this._getContainer(p); + var res = container.querySelector(e); + if (res) { + return this._wrapElement(res); + } else { + return null; + } + }; + /** + * Searches the page for all elements that matches the given + * CSS selector string. + * The string can be an ID, class, tag name, or a combination. `selectAll()` + * returns an array of p5.Element objects if it + * finds any matches and an empty array otherwise. + * + * The second parameter, `container`, is optional. It specifies a container to + * search within. container can be CSS selector string, a + * p5.Element object, or an + * HTMLElement object. + * + * @method selectAll + * @param {String} selectors CSS selector string of element to search for. + * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or + * HTMLElement to search within. + * @return {p5.Element[]} array of p5.Elements containing any elements found. + * @example + *
                    + * + * function setup() { + * // Create three buttons. + * createButton('1'); + * createButton('2'); + * createButton('3'); + * + * // Select the buttons by their tag. + * let buttons = selectAll('button'); + * + * // Position the buttons. + * for (let i = 0; i < 3; i += 1) { + * buttons[i].position(0, i * 30); + * } + * + * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3".'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * // Create three buttons and position them. + * let b1 = createButton('1'); + * b1.position(0, 0); + * let b2 = createButton('2'); + * b2.position(0, 30); + * let b3 = createButton('3'); + * b3.position(0, 60); + * + * // Add a class attribute to each button. + * b1.class('btn'); + * b2.class('btn btn-pink'); + * b3.class('btn'); + * + * // Select the buttons by their class. + * let buttons = selectAll('.btn'); + * let pinkButtons = selectAll('.btn-pink'); + * + * // Style the selected buttons. + * buttons.forEach(btn => { + * btn.style('font-family', 'Comic Sans MS'); + * }); + * + * pinkButtons.forEach(btn => { + * btn.style('background', 'deeppink'); + * btn.style('color', 'white'); + * }); + * + * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3". Buttons "1" and "3" are gray. Button "2" is pink.'); + * } + * + *
                    + */ + _main.default.prototype.selectAll = function (e, p) { + _main.default._validateParameters("selectAll", arguments); + var arr = []; + var container = this._getContainer(p); + var res = container.querySelectorAll(e); + if (res) { + for (var j = 0; j < res.length; j++) { + var obj = this._wrapElement(res[j]); + arr.push(obj); + } + } + return arr; + }; + /** + * Helper function for select and selectAll + */ + _main.default.prototype._getContainer = function (p) { + var container = document; + if (typeof p === "string") { + container = document.querySelector(p) || document; + } else if (p instanceof _main.default.Element) { + container = p.elt; + } else if (p instanceof HTMLElement) { + container = p; + } + return container; + }; + /** + * Helper function for getElement and getElements. + */ + _main.default.prototype._wrapElement = function (elt) { + var children = Array.prototype.slice.call(elt.children); + if (elt.tagName === "INPUT" && elt.type === "checkbox") { + var converted = new _main.default.Element(elt, this); + converted.checked = function () { + if (arguments.length === 0) { + return this.elt.checked; + } else if (arguments.length <= 0 ? undefined : arguments[0]) { + this.elt.checked = true; + } else { + this.elt.checked = false; + } + return this; + }; + return converted; + } else if (elt.tagName === "VIDEO" || elt.tagName === "AUDIO") { + return new _main.default.MediaElement(elt, this); + } else if (elt.tagName === "SELECT") { + return this.createSelect(new _main.default.Element(elt, this)); + } else if ( + children.length > 0 && + children.every(function (c) { + return c.tagName === "INPUT" || c.tagName === "LABEL"; + }) + ) { + return this.createRadio(new _main.default.Element(elt, this)); + } else { + return new _main.default.Element(elt, this); + } + }; + /** + * Removes all elements created by p5.js, including any event handlers. + * There are two exceptions: + * canvas elements created by createCanvas + * and p5.Render objects created by + * createGraphics. + * + * @method removeElements + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * // Create a paragraph element and place + * // it in the middle of the canvas. + * let p = createP('p5*js'); + * p.position(25, 25); + * + * describe('A gray square with the text "p5*js" written in its center. The text disappears when the mouse is pressed.'); + * } + * + * function mousePressed() { + * removeElements(); + * } + * + *
                    + * + *
                    + * + * let slider; + * + * function setup() { + * createCanvas(100, 100); + * + * // Create a paragraph element and place + * // it at the top of the canvas. + * let p = createP('p5*js'); + * p.position(25, 25); + * + * // Create a slider element and place it + * // beneath the canvas. + * slider = createSlider(0, 255, 200); + * slider.position(0, 100); + * + * describe('A gray square with the text "p5*js" written in its center and a range slider beneath it. The square changes color when the slider is moved. The text and slider disappear when the square is double-clicked.'); + * } + * + * function draw() { + * // Use the slider value to change the background color. + * let g = slider.value(); + * background(g); + * } + * + * function doubleClicked() { + * removeElements(); + * } + * + *
                    + */ + _main.default.prototype.removeElements = function (e) { + _main.default._validateParameters("removeElements", arguments); + // el.remove splices from this._elements, so don't mix iteration with it + var isNotCanvasElement = function isNotCanvasElement(el) { + return !(el.elt instanceof HTMLCanvasElement); + }; + var removeableElements = this._elements.filter(isNotCanvasElement); + removeableElements.map(function (el) { + return el.remove(); + }); + }; + /** + * `myElement.changed()` sets a function to call when the value of the + * p5.Element object changes. Calling + * `myElement.changed(false)` disables the function. + * + * @method changed + * @param {Function|Boolean} fxn function to call when the element changes. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a dropdown menu and add a few color options. + * let drop = createSelect(); + * drop.position(0, 0); + * drop.option('red'); + * drop.option('green'); + * drop.option('blue'); + * + * // When the color option changes, paint the background with + * // that color. + * drop.changed(() => { + * let c = drop.value(); + * background(c); + * }); + * + * describe('A gray square with a dropdown menu at the top. The square changes color when an option is selected.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create a checkbox and place it beneath the canvas. + * let checkbox = createCheckbox(' circle'); + * checkbox.position(0, 100); + * + * // When the checkbox changes, paint the background gray + * // and determine whether to draw a circle. + * checkbox.changed(() => { + * background(200); + * if (checkbox.checked() === true) { + * circle(50, 50, 30); + * } + * }); + * + * describe('A gray square with a checkbox underneath it that says "circle". A white circle appears when the box is checked and disappears otherwise.'); + * } + * + *
                    + */ + _main.default.Element.prototype.changed = function (fxn) { + _main.default.Element._adjustListener("change", fxn, this); + return this; + }; + /** + * `myElement.input()` sets a function to call when input is detected within + * the p5.Element object. It's often used to with + * text inputs and sliders. Calling `myElement.input(false)` disables the + * function. + * + * @method input + * @param {Function|Boolean} fxn function to call when input is detected within + * the element. + * `false` disables the function. + * @chainable + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a slider and place it beneath the canvas. + * let slider = createSlider(0, 255, 200); + * slider.position(0, 100); + * + * // When the slider changes, use its value to paint + * // the background. + * slider.input(() => { + * let g = slider.value(); + * background(g); + * }); + * + * describe('A gray square with a range slider underneath it. The background changes shades of gray when the slider is moved.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create an input and place it beneath the canvas. + * let inp = createInput(''); + * inp.position(0, 100); + * + * // When input is detected, paint the background gray + * // and display the text. + * inp.input(() => { + * background(200); + * let msg = inp.value(); + * text(msg, 5, 50); + * }); + * + * describe('A gray square with a text input bar beneath it. Any text written in the input appears in the middle of the square.'); + * } + * + *
                    + */ + _main.default.Element.prototype.input = function (fxn) { + _main.default.Element._adjustListener("input", fxn, this); + return this; + }; + /** + * Helpers for create methods. + */ + function addElement(elt, pInst, media) { + var node = pInst._userNode ? pInst._userNode : document.body; + node.appendChild(elt); + var c = media + ? new _main.default.MediaElement(elt, pInst) + : new _main.default.Element(elt, pInst); + pInst._elements.push(c); + return c; + } /** + * Creates a `<div></div>` element. It's commonly used as a + * container for other elements. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<div></div>`. + * + * @method createDiv + * @param {String} [html] inner HTML for the new `<div></div>` element. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * let div = createDiv('p5*js'); + * div.position(25, 35); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create an h3 element within the div. + * let div = createDiv('

                    p5*js

                    '); + * div.position(20, 5); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + *
                    + *
                    + */ + + _main.default.prototype.createDiv = function () { + var html = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : ""; + var elt = document.createElement("div"); + elt.innerHTML = html; + return addElement(elt, this); + }; + /** + * Creates a `<p></p>` element. It's commonly used for + * paragraph-length text. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<p></p>`. + * + * @method createP + * @param {String} [html] inner HTML for the new `<p></p>` element. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * let p = createP('Tell me a story.'); + * p.position(5, 0); + * + * describe('A gray square displaying the text "Tell me a story." written in black.'); + * } + * + *
                    + */ + _main.default.prototype.createP = function () { + var html = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : ""; + var elt = document.createElement("p"); + elt.innerHTML = html; + return addElement(elt, this); + }; + /** + * Creates a `<span></span>` element. It's commonly used as a + * container for inline elements. For example, a `<span></span>` + * can hold part of a sentence that's a + * different style. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<span></span>`. + * + * @method createSpan + * @param {String} [html] inner HTML for the new `<span></span>` element. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a span element. + * let span = createSpan('p5*js'); + * span.position(25, 35); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create a div element as + * // a container. + * let div = createDiv(); + * // Place the div at the + * // center. + * div.position(25, 35); + * + * // Create a span element. + * let s1 = createSpan('p5'); + * // Create a second span element. + * let s2 = createSpan('*'); + * // Set the span's font color. + * s2.style('color', 'deeppink'); + * // Create a third span element. + * let s3 = createSpan('js'); + * + * // Add all the spans to the + * // container div. + * s1.parent(div); + * s2.parent(div); + * s3.parent(div); + * + * describe('A gray square with the text "p5*js" written in black at its center. The asterisk is pink.'); + * } + * + *
                    + */ + _main.default.prototype.createSpan = function () { + var html = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : ""; + var elt = document.createElement("span"); + elt.innerHTML = html; + return addElement(elt, this); + }; + /** + * Creates an `<img>` element that can appear outside of the canvas. + * + * The first parameter, `src`, is a string with the path to the image file. + * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as + * in `'https://example.com/image.png'`. + * + * The second parameter, `alt`, is a string with the + * alternate text + * for the image. An empty string `''` can be used for images that aren't displayed. + * + * The third parameter, `crossOrigin`, is optional. It's a string that sets the + * crossOrigin property + * of the image. Use `'anonymous'` or `'use-credentials'` to fetch the image + * with cross-origin access. + * + * The fourth parameter, `callback`, is also optional. It sets a function to + * call after the image loads. The new image is passed to the callback + * function as a p5.Element object. + * + * @method createImg + * @param {String} src relative path or URL for the image. + * @param {String} alt alternate text for the image. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * let img = createImg( + * 'https://p5js.org/assets/img/asterisk-01.png', + * 'The p5.js magenta asterisk.' + * ); + * img.position(0, -10); + * + * describe('A gray square with a magenta asterisk in its center.'); + * } + * + *
                    + */ + /** + * @method createImg + * @param {String} src + * @param {String} alt + * @param {String} [crossOrigin] crossOrigin property to use when fetching the image. + * @param {Function} [successCallback] function to call once the image loads. The new image will be passed + * to the function as a p5.Element object. + * @return {p5.Element} new p5.Element object. + */ + _main.default.prototype.createImg = function () { + _main.default._validateParameters("createImg", arguments); + var elt = document.createElement("img"); + var args = arguments; + var self; + if (args.length > 1 && typeof args[1] === "string") { + elt.alt = args[1]; + } + if (args.length > 2 && typeof args[2] === "string") { + elt.crossOrigin = args[2]; + } + elt.src = args[0]; + self = addElement(elt, this); + elt.addEventListener("load", function () { + self.width = elt.offsetWidth || elt.width; + self.height = elt.offsetHeight || elt.height; + var last = args[args.length - 1]; + if (typeof last === "function") last(self); + }); + return self; + }; + /** + * Creates an `<a></a>` element that links to another web page. + * + * The first parmeter, `href`, is a string that sets the URL of the linked + * page. + * + * The second parameter, `html`, is a string that sets the inner HTML of the + * link. It's common to use text, images, or buttons as links. + * + * The third parameter, `target`, is optional. It's a string that tells the + * web browser where to open the link. By default, links open in the current + * browser tab. Passing `'_blank'` will cause the link to open in a new + * browser tab. MDN describes a few + * other options. + * + * @method createA + * @param {String} href URL of linked page. + * @param {String} html inner HTML of link element to display. + * @param {String} [target] target where the new link should open, + * either `'_blank'`, `'_self'`, `'_parent'`, or `'_top'`. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create an anchor element that links to p5js.org. + * let a = createA('http://p5js.org/', 'p5*js'); + * a.position(25, 35); + * + * describe('The text "p5*js" written at the center of a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create an anchor element that links to p5js.org. + * // Open the link in a new tab. + * let a = createA('http://p5js.org/', 'p5*js', '_blank'); + * a.position(25, 35); + * + * describe('The text "p5*js" written at the center of a gray square.'); + * } + * + *
                    + */ + _main.default.prototype.createA = function (href, html, target) { + _main.default._validateParameters("createA", arguments); + var elt = document.createElement("a"); + elt.href = href; + elt.innerHTML = html; + if (target) elt.target = target; + return addElement(elt, this); + }; + /** INPUT **/ + /** + * Creates a slider `<input></input>` element. Range sliders are + * useful for quickly selecting numbers from a given range. + * + * The first two parameters, `min` and `max`, are numbers that set the + * slider's minimum and maximum. + * + * The third parameter, `value`, is optional. It's a number that sets the + * slider's default value. + * + * The fourth parameter, `step`, is also optional. It's a number that sets the + * spacing between each value in the slider's range. Setting `step` to 0 + * allows the slider to move smoothly from `min` to `max`. + * + * @method createSlider + * @param {Number} min minimum value of the slider. + * @param {Number} max maximum value of the slider. + * @param {Number} [value] default value of the slider. + * @param {Number} [step] size for each step in the slider's range. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * slider = createSlider(0, 255); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A dark gray square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                    + * + *
                    + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * slider = createSlider(0, 255, 0); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                    + * + *
                    + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * // Set its step size to 50. + * slider = createSlider(0, 255, 0, 50); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                    + * + *
                    + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * // Set its step size to 0 so that it moves smoothly. + * slider = createSlider(0, 255, 0, 0); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                    + */ + _main.default.prototype.createSlider = function ( + min, + max, + value, + step, + ) { + _main.default._validateParameters("createSlider", arguments); + var elt = document.createElement("input"); + elt.type = "range"; + elt.min = min; + elt.max = max; + if (step === 0) { + elt.step = 1e-18; // smallest valid step + } else if (step) { + elt.step = step; + } + if (typeof value === "number") elt.value = value; + return addElement(elt, this); + }; + /** + * Creates a `<button></button>` element. + * + * The first parameter, `label`, is a string that sets the label displayed on + * the button. + * + * The second parameter, `value`, is optional. It's a string that sets the + * button's value. See + * MDN + * for more details. + * + * @method createButton + * @param {String} label label displayed on the button. + * @param {String} [value] value of the button. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a button and place it beneath the canvas. + * let button = createButton('click me'); + * button.position(0, 100); + * + * // Use the button to change the background color. + * button.mousePressed(() => { + * let g = random(255); + * background(g); + * }); + * + * describe('A gray square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); + * } + * + *
                    + * + *
                    + * + * let button; + * + * function setup() { + * // Create a button and set its value to 0. + * // Place the button beneath the canvas. + * button = createButton('click me', 'red'); + * button.position(0, 100); + * + * // Change the button's value when the mouse + * // is pressed. + * button.mousePressed(() => { + * let c = random(['red', 'green', 'blue', 'yellow']); + * button.value(c); + * }); + * + * describe('A red square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); + * } + * + * function draw() { + * // Use the button's value to set the background color. + * let c = button.value(); + * background(c); + * } + * + *
                    + */ + _main.default.prototype.createButton = function (label, value) { + _main.default._validateParameters("createButton", arguments); + var elt = document.createElement("button"); + elt.innerHTML = label; + if (value) elt.value = value; + return addElement(elt, this); + }; + /** + * Creates a checkbox `<input></input>` element. Checkboxes extend + * the p5.Element class with a `checked()` method. + * Calling `myBox.checked()` returns `true` if it the box is checked and + * `false` otherwise. + * + * The first parameter, `label`, is optional. It's a string that sets the label + * to display next to the checkbox. + * + * The second parameter, `value`, is also optional. It's a boolean that sets the + * checkbox's value. + * + * @method createCheckbox + * @param {String} [label] label displayed after the checkbox. + * @param {boolean} [value] value of the checkbox. Checked is `true` and unchecked is `false`. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * checkbox = createCheckbox(); + * checkbox.position(0, 100); + * + * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
                    + * + *
                    + * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * // Label the checkbox "white". + * checkbox = createCheckbox(' white'); + * checkbox.position(0, 100); + * + * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
                    + * + *
                    + * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * // Label the checkbox "white" and set its value to true. + * checkbox = createCheckbox(' white', true); + * checkbox.position(0, 100); + * + * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
                    + */ + _main.default.prototype.createCheckbox = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("createCheckbox", args); + // Create a container element + var elt = document.createElement("div"); + // Create checkbox type input element + var checkbox = document.createElement("input"); + checkbox.type = "checkbox"; + // Create label element and wrap it around checkbox + var label = document.createElement("label"); + label.appendChild(checkbox); + // Append label element inside the container + elt.appendChild(label); + //checkbox must be wrapped in p5.Element before label so that label appears after + var self = addElement(elt, this); + self.checked = function () { + var cb = + self.elt.firstElementChild.getElementsByTagName("input")[0]; + if (cb) { + if (arguments.length === 0) { + return cb.checked; + } else if (arguments.length <= 0 ? undefined : arguments[0]) { + cb.checked = true; + } else { + cb.checked = false; + } + } + return self; + }; + this.value = function (val) { + self.value = val; + return this; + }; + // Set the span element innerHTML as the label value if passed + if (args[0]) { + self.value(args[0]); + var span = document.createElement("span"); + span.innerHTML = args[0]; + label.appendChild(span); + } // Set the checked value of checkbox if passed + + if (args[1]) { + checkbox.checked = true; + } + return self; + }; + /** + * Creates a dropdown menu `<select></select>` element. + * + * The parameter is optional. If `true` is passed, as in + * `let mySelect = createSelect(true)`, then the dropdown will support + * multiple selections. If an existing `<select></select>` element + * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing + * element will be wrapped in a new p5.Element + * object. + * + * Dropdowns extend the p5.Element class with a few + * helpful methods for managing options: + * - `mySelect.option(name, [value])` adds an option to the menu. The first paremeter, `name`, is a string that sets the option's name and value. The second parameter, `value`, is optional. If provided, it sets the value that corresponds to the key `name`. If an option with `name` already exists, its value is changed to `value`. + * - `mySelect.value()` returns the currently-selected option's value. + * - `mySelect.selected()` returns the currently-selected option. + * - `mySelect.selected(option)` selects the given option by default. + * - `mySelect.disable()` marks the whole dropdown element as disabled. + * - `mySelect.disable(option)` marks a given option as disabled. + * - `mySelect.enable()` marks the whole dropdown element as enabled. + * - `mySelect.enable(option)` marks a given option as enabled. + * + * @method createSelect + * @param {boolean} [multiple] support multiple selections. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * let mySelect; + * + * function setup() { + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * // Set the selected option to "red". + * mySelect.selected('red'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
                    + * + *
                    + * + * let mySelect; + * + * function setup() { + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * // Set the selected option to "red". + * mySelect.selected('red'); + * + * // Disable the "yellow" option. + * mySelect.disable('yellow'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
                    + * + *
                    + * + * let mySelect; + * + * function setup() { + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options with names and values. + * mySelect.option('one', 'red'); + * mySelect.option('two', 'green'); + * mySelect.option('three', 'blue'); + * mySelect.option('four', 'yellow'); + * + * // Set the selected option to "one". + * mySelect.selected('one'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
                    + * + *
                    + * + * // Hold CTRL to select multiple options on Windows and Linux. + * // Hold CMD to select multiple options on macOS. + * let mySelect; + * + * function setup() { + * // Create a dropdown and allow multiple selections. + * // Place it beneath the canvas. + * mySelect = createSelect(true); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * describe('A gray square with a dropdown menu beneath it. Colorful circles appear when their color is selected.'); + * } + * + * function draw() { + * background(200); + * + * // Use the selected value(s) to draw circles. + * let colors = mySelect.selected(); + * colors.forEach((c, index) => { + * let x = 10 + index * 20; + * fill(c); + * circle(x, 50, 20); + * }); + * } + * + *
                    + */ + /** + * @method createSelect + * @param {Object} existing select element to wrap, either as a p5.Element or + * a HTMLSelectElement. + * @return {p5.Element} + */ + _main.default.prototype.createSelect = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("createSelect", args); + var self; + var arg = args[0]; + if ( + arg instanceof _main.default.Element && + arg.elt instanceof HTMLSelectElement + ) { + // If given argument is p5.Element of select type + self = arg; + this.elt = arg.elt; + } else if (arg instanceof HTMLSelectElement) { + self = addElement(arg, this); + this.elt = arg; + } else { + var elt = document.createElement("select"); + if (arg && typeof arg === "boolean") { + elt.setAttribute("multiple", "true"); + } + self = addElement(elt, this); + this.elt = elt; + } + self.option = function (name, value) { + var index; + // if no name is passed, return + if (name === undefined) { + return; + } //see if there is already an option with this name + + for (var i = 0; i < this.elt.length; i += 1) { + if (this.elt[i].textContent === name) { + index = i; + break; + } + } //if there is an option with this name we will modify it + + if (index !== undefined) { + //if the user passed in false then delete that option + if (value === false) { + this.elt.remove(index); + } else { + // Update the option at index with the value + this.elt[index].value = value; + } + } else { + //if it doesn't exist create it + var opt = document.createElement("option"); + opt.textContent = name; + opt.value = value === undefined ? name : value; + this.elt.appendChild(opt); + this._pInst._elements.push(opt); + } + }; + self.selected = function (value) { + // Update selected status of option + if (value !== undefined) { + for (var i = 0; i < this.elt.length; i += 1) { + if (this.elt[i].value.toString() === value.toString()) { + this.elt.selectedIndex = i; + } + } + return this; + } else { + if (this.elt.getAttribute("multiple")) { + var arr = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = + this.elt.selectedOptions[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var selectedOption = _step.value; + arr.push(selectedOption.value); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return arr; + } else { + return this.elt.value; + } + } + }; + self.disable = function (value) { + if (typeof value === "string") { + for (var i = 0; i < this.elt.length; i++) { + if (this.elt[i].value.toString() === value) { + this.elt[i].disabled = true; + this.elt[i].selected = false; + } + } + } else { + this.elt.disabled = true; + } + return this; + }; + self.enable = function (value) { + if (typeof value === "string") { + for (var i = 0; i < this.elt.length; i++) { + if (this.elt[i].value.toString() === value) { + this.elt[i].disabled = false; + this.elt[i].selected = false; + } + } + } else { + this.elt.disabled = false; + for (var _i = 0; _i < this.elt.length; _i++) { + this.elt[_i].disabled = false; + this.elt[_i].selected = false; + } + } + return this; + }; + return self; + }; + /** + * Creates a radio button element. + * + * The parameter is optional. If a string is passed, as in + * `let myRadio = createSelect('food')`, then each radio option will + * have `"food"` as its `name` parameter: `<input name="food"></input>`. + * If an existing `<div></div>` or `<span></span>` + * element is passed, as in `let myRadio = createSelect(container)`, it will + * become the radio button's parent element. + * + * Radio buttons extend the p5.Element class with a few + * helpful methods for managing options: + * - `myRadio.option(value, [label])` adds an option to the menu. The first paremeter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned. + * - `myRadio.value()` returns the currently-selected option's value. + * - `myRadio.selected()` returns the currently-selected option. + * - `myRadio.selected(value)` selects the given option and returns it as an `HTMLInputElement`. + * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed. + * + * @method createRadio + * @param {Object} [containerElement] container HTML Element, either a `<div></div>` + * or `<span></span>`. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(60); + * + * // Add a few color options. + * myRadio.option('red'); + * myRadio.option('yellow'); + * myRadio.option('blue'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * describe('A yellow square with three color options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let g = myRadio.value(); + * background(g); + * } + * + *
                    + * + *
                    + * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(50); + * + * // Add a few color options. + * // Color values are labeled with + * // emotions they evoke. + * myRadio.option('red', 'love'); + * myRadio.option('yellow', 'joy'); + * myRadio.option('blue', 'trust'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * describe('A yellow square with three options listed, "love", "joy", and "trust". The square changes color when the user selects a new option.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let c = myRadio.value(); + * background(c); + * } + * + *
                    + * + *
                    + * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(50); + * + * // Add a few color options. + * myRadio.option('red'); + * myRadio.option('yellow'); + * myRadio.option('blue'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * // Create a button and place it beneath the canvas. + * let btn = createButton('disable'); + * btn.position(0, 100); + * + * // Use the button to disable the radio button. + * btn.mousePressed(() => { + * myRadio.disable(true); + * }); + * + * describe('A yellow square with three options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option. A "disable" button beneath the canvas disables the color options when pressed.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let c = myRadio.value(); + * background(c); + * } + * + *
                    + */ + /** + * @method createRadio + * @param {String} [name] name parameter assigned to each option's `<input></input>` element. + * @return {p5.Element} new p5.Element object. + */ + /** + * @method createRadio + * @return {p5.Element} new p5.Element object. + */ + _main.default.prototype.createRadio = function () { + // Creates a div, adds each option as an individual input inside it. + // If already given with a containerEl, will search for all input[radio] + // it, create a p5.Element out of it, add options to it and return the p5.Element. + var self; + var radioElement; + var name; + var arg0 = arguments.length <= 0 ? undefined : arguments[0]; + if ( + arg0 instanceof _main.default.Element && + (arg0.elt instanceof HTMLDivElement || + arg0.elt instanceof HTMLSpanElement) + ) { + // If given argument is p5.Element of div/span type + self = arg0; + this.elt = arg0.elt; + } else if ( + // If existing radio Element is provided as argument 0 + arg0 instanceof HTMLDivElement || + arg0 instanceof HTMLSpanElement + ) { + self = addElement(arg0, this); + this.elt = arg0; + radioElement = arg0; + if ( + typeof (arguments.length <= 1 ? undefined : arguments[1]) === + "string" + ) + name = arguments.length <= 1 ? undefined : arguments[1]; + } else { + if (typeof arg0 === "string") name = arg0; + radioElement = document.createElement("div"); + self = addElement(radioElement, this); + this.elt = radioElement; + } + self._name = name || "radioOption"; + // setup member functions + var isRadioInput = function isRadioInput(el) { + return el instanceof HTMLInputElement && el.type === "radio"; + }; + var isLabelElement = function isLabelElement(el) { + return el instanceof HTMLLabelElement; + }; + var isSpanElement = function isSpanElement(el) { + return el instanceof HTMLSpanElement; + }; + self._getOptionsArray = function () { + return Array.from(this.elt.children) + .filter(function (el) { + return ( + isRadioInput(el) || + (isLabelElement(el) && isRadioInput(el.firstElementChild)) + ); + }) + .map(function (el) { + return isRadioInput(el) ? el : el.firstElementChild; + }); + }; + self.option = function (value, label) { + // return an option with this value, create if not exists. + var optionEl; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = self._getOptionsArray()[Symbol.iterator](), + _step2; + !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) + .done); + _iteratorNormalCompletion2 = true + ) { + var option = _step2.value; + if (option.value === value) { + optionEl = option; + break; + } + } // Create a new option, add it to radioElement and return it. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + if (optionEl === undefined) { + optionEl = document.createElement("input"); + optionEl.setAttribute("type", "radio"); + optionEl.setAttribute("value", value); + } + optionEl.setAttribute("name", self._name); + // Check if label element exists, else create it + var labelElement; + if (!isLabelElement(optionEl.parentElement)) { + labelElement = document.createElement("label"); + labelElement.insertAdjacentElement("afterbegin", optionEl); + } else { + labelElement = optionEl.parentElement; + } // Check if span element exists, else create it + + var spanElement; + if (!isSpanElement(labelElement.lastElementChild)) { + spanElement = document.createElement("span"); + optionEl.insertAdjacentElement("afterend", spanElement); + } else { + spanElement = labelElement.lastElementChild; + } // Set the innerHTML of span element as the label text + + spanElement.innerHTML = label === undefined ? value : label; + // Append the label element, which includes option element and + // span element to the radio container element + this.elt.appendChild(labelElement); + return optionEl; + }; + self.remove = function (value) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = self._getOptionsArray()[Symbol.iterator](), + _step3; + !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) + .done); + _iteratorNormalCompletion3 = true + ) { + var optionEl = _step3.value; + if (optionEl.value === value) { + if (isLabelElement(optionEl.parentElement)) { + // Remove parent label which also removes children elements + optionEl.parentElement.remove(); + } else { + // Remove the option input if parent label does not exist + optionEl.remove(); + } + return; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion3 && + _iterator3.return != null + ) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + }; + self.value = function () { + var result = ""; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for ( + var _iterator4 = self._getOptionsArray()[Symbol.iterator](), + _step4; + !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()) + .done); + _iteratorNormalCompletion4 = true + ) { + var option = _step4.value; + if (option.checked) { + result = option.value; + break; + } + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion4 && + _iterator4.return != null + ) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + return result; + }; + self.selected = function (value) { + var result = null; + if (value === undefined) { + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + try { + for ( + var _iterator5 = self._getOptionsArray()[Symbol.iterator](), + _step5; + !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()) + .done); + _iteratorNormalCompletion5 = true + ) { + var option = _step5.value; + if (option.checked) { + result = option; + break; + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion5 && + _iterator5.return != null + ) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + } else { + // forEach loop to uncheck all radio buttons before + // setting any one as checked. + self._getOptionsArray().forEach(function (option) { + option.checked = false; + option.removeAttribute("checked"); + }); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + try { + for ( + var _iterator6 = self._getOptionsArray()[Symbol.iterator](), + _step6; + !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()) + .done); + _iteratorNormalCompletion6 = true + ) { + var _option = _step6.value; + if (_option.value === value) { + _option.setAttribute("checked", true); + _option.checked = true; + result = _option; + } + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion6 && + _iterator6.return != null + ) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + } + return result; + }; + self.disable = function () { + var shouldDisable = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : true; + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + try { + for ( + var _iterator7 = self._getOptionsArray()[Symbol.iterator](), + _step7; + !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()) + .done); + _iteratorNormalCompletion7 = true + ) { + var radioInput = _step7.value; + radioInput.setAttribute("disabled", shouldDisable); + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion7 && + _iterator7.return != null + ) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + }; + return self; + }; + /** + * Creates a color picker element. + * + * The parameter, `value`, is optional. If a color string or + * p5.Color object is passed, it will set the default + * color. + * + * Color pickers extend the p5.Element class with a + * couple of helpful methods for managing colors: + * - `myPicker.value()` returns the current color as a hex string in the format `'#rrggbb'`. + * - `myPicker.color()` returns the current color as a p5.Color object. + * + * + * @method createColorPicker + * @param {String|p5.Color} [value] default color as a CSS color string. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * let myPicker; + * + * function setup() { + * myPicker = createColorPicker('deeppink'); + * myPicker.position(0, 100); + * + * describe('A pink square with a color picker beneath it. The square changes color when the user picks a new color.'); + * } + * + * function draw() { + * // Use the color picker to paint the background. + * let c = myPicker.color(); + * background(c); + * } + * + *
                    + * + *
                    + * + * let myPicker; + * + * function setup() { + * myPicker = createColorPicker('deeppink'); + * myPicker.position(0, 100); + * + * describe('A number with the format "#rrggbb" is displayed on a pink canvas. The background color and number change when the user picks a new color.'); + * } + * + * function draw() { + * // Use the color picker to paint the background. + * let c = myPicker.value(); + * background(c); + * + * // Display the current color as a hex string. + * text(c, 25, 55); + * } + * + *
                    + */ + _main.default.prototype.createColorPicker = function (value) { + _main.default._validateParameters("createColorPicker", arguments); + var elt = document.createElement("input"); + var self; + elt.type = "color"; + if (value) { + if (value instanceof _main.default.Color) { + elt.value = value.toString("#rrggbb"); + } else { + _main.default.prototype._colorMode = "rgb"; + _main.default.prototype._colorMaxes = { + rgb: [255, 255, 255, 255], + hsb: [360, 100, 100, 1], + hsl: [360, 100, 100, 1], + }; + elt.value = _main.default.prototype + .color(value) + .toString("#rrggbb"); + } + } else { + elt.value = "#000000"; + } + self = addElement(elt, this); + // Method to return a p5.Color object for the given color. + self.color = function () { + if (value) { + if (value.mode) { + _main.default.prototype._colorMode = value.mode; + } + if (value.maxes) { + _main.default.prototype._colorMaxes = value.maxes; + } + } + return _main.default.prototype.color(this.elt.value); + }; + return self; + }; + /** + * Creates a text `<input></input>` element. Call `myInput.size()` + * to set the length of the text box. + * + * The first parameter, `value`, is optional. It's a string that sets the + * input's default value. The input is blank by default. + * + * The second parameter, `type`, is also optional. It's a string that + * specifies the type of text being input. See MDN for a full + * list of options. + * The default is `'text'`. + * + * @method createInput + * @param {String} [value] default value of the input box. Defaults to an empty string `''`. + * @param {String} [type] type of input. Defaults to `'text'`. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * let myInput; + * + * function setup() { + * // Create an input element and place it + * // beneath the canvas. + * myInput = createInput(); + * myInput.position(0, 100); + * + * describe('A gray square with a text box beneath it. The text in the square changes when the user types something new in the input bar.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input to display a message. + * let msg = myInput.value(); + * text(msg, 25, 55); + * } + * + *
                    + * + *
                    + * + * let myInput; + * + * function setup() { + * // Create an input element and place it + * // beneath the canvas. Set its default + * // text to "hello!". + * myInput = createInput('hello!'); + * myInput.position(0, 100); + * + * describe('The text "hello!" written at the center of a gray square. A text box beneath the square also says "hello!". The text in the square changes when the user types something new in the input bar.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input to display a message. + * let msg = myInput.value(); + * text(msg, 25, 55); + * } + * + *
                    + */ + /** + * @method createInput + * @param {String} [value] + * @return {p5.Element} + */ + _main.default.prototype.createInput = function () { + var value = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : ""; + var type = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : "text"; + _main.default._validateParameters("createInput", arguments); + var elt = document.createElement("input"); + elt.setAttribute("value", value); + elt.setAttribute("type", type); + return addElement(elt, this); + }; + /** + * Creates an `<input></input>` element of type `'file'`. + * This allows users to select local files for use in a sketch. + * + * The first parameter, `callback`, is a function that's called when the file + * loads. The callback function should have one parameter, `file`, that's a + * p5.File object. + * + * The second parameter, `multiple`, is optional. It's a boolean value that + * allows loading multiple files if set to `true`. If `true`, `callback` + * will be called once per file. + * + * @method createFileInput + * @param {Function} callback function to call once the file loads. + * @param {Boolean} [multiple] allow multiple files to be selected. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * // Use the file input to select an image to + * // load and display. + * let input; + * let img; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. + * input = createFileInput(handleImage); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); + * } + * + * function draw() { + * background(200); + * + * // Draw the image if loaded. + * if (img) { + * image(img, 0, 0, width, height); + * } + * } + * + * // Create an image if the file is an image. + * function handleImage(file) { + * if (file.type === 'image') { + * img = createImg(file.data, ''); + * img.hide(); + * } else { + * img = null; + * } + * } + * + *
                    + * + *
                    + * + * // Use the file input to select multiple images + * // to load and display. + * let input; + * let images = []; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. Allow it to load multiple files. + * input = createFileInput(handleImage, true); + * input.position(0, 100); + * } + * + * function draw() { + * background(200); + * + * // Draw the images if loaded. Each image + * // is drawn 20 pixels lower than the + * // previous image. + * images.forEach((img, index) => { + * let y = index * 20; + * image(img, 0, y, width, height); + * }); + * + * describe('A gray square with a file input beneath it. If the user selects multiple image files to load, they are displayed on the square.'); + * } + * + * // Create an image if the file is an image, + * // then add it to the images array. + * function handleImage(file) { + * if (file.type === 'image') { + * let img = createImg(file.data, ''); + * img.hide(); + * images.push(img); + * } + * } + * + *
                    + */ + _main.default.prototype.createFileInput = function (callback) { + var multiple = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : false; + _main.default._validateParameters("createFileInput", arguments); + var handleFileSelect = function handleFileSelect(event) { + var _iteratorNormalCompletion8 = true; + var _didIteratorError8 = false; + var _iteratorError8 = undefined; + try { + for ( + var _iterator8 = event.target.files[Symbol.iterator](), + _step8; + !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()) + .done); + _iteratorNormalCompletion8 = true + ) { + var file = _step8.value; + _main.default.File._load(file, callback); + } + } catch (err) { + _didIteratorError8 = true; + _iteratorError8 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion8 && + _iterator8.return != null + ) { + _iterator8.return(); + } + } finally { + if (_didIteratorError8) { + throw _iteratorError8; + } + } + } + }; + // If File API's are not supported, throw Error + if ( + !( + window.File && + window.FileReader && + window.FileList && + window.Blob + ) + ) { + console.log( + "The File APIs are not fully supported in this browser. Cannot create element.", + ); + return; + } + var fileInput = document.createElement("input"); + fileInput.setAttribute("type", "file"); + if (multiple) fileInput.setAttribute("multiple", true); + fileInput.addEventListener("change", handleFileSelect, false); + return addElement(fileInput, this); + }; + /** VIDEO STUFF **/ + // Helps perform similar tasks for media element methods. + function createMedia(pInst, type, src, callback) { + var elt = document.createElement(type); + // Create source elements from given sources + src = src || ""; + if (typeof src === "string") { + src = [src]; + } + var _iteratorNormalCompletion9 = true; + var _didIteratorError9 = false; + var _iteratorError9 = undefined; + try { + for ( + var _iterator9 = src[Symbol.iterator](), _step9; + !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()) + .done); + _iteratorNormalCompletion9 = true + ) { + var mediaSource = _step9.value; + var sourceEl = document.createElement("source"); + sourceEl.setAttribute("src", mediaSource); + elt.appendChild(sourceEl); + } // If callback is provided, attach to element + } catch (err) { + _didIteratorError9 = true; + _iteratorError9 = err; + } finally { + try { + if (!_iteratorNormalCompletion9 && _iterator9.return != null) { + _iterator9.return(); + } + } finally { + if (_didIteratorError9) { + throw _iteratorError9; + } + } + } + if (typeof callback === "function") { + var callbackHandler = function callbackHandler() { + callback(); + elt.removeEventListener("canplaythrough", callbackHandler); + }; + elt.addEventListener("canplaythrough", callbackHandler); + } + var mediaEl = addElement(elt, pInst, true); + mediaEl.loadedmetadata = false; + // set width and height onload metadata + elt.addEventListener("loadedmetadata", function () { + mediaEl.width = elt.videoWidth; + mediaEl.height = elt.videoHeight; + // set elt width and height if not set + if (mediaEl.elt.width === 0) mediaEl.elt.width = elt.videoWidth; + if (mediaEl.elt.height === 0) + mediaEl.elt.height = elt.videoHeight; + if (mediaEl.presetPlaybackRate) { + mediaEl.elt.playbackRate = mediaEl.presetPlaybackRate; + delete mediaEl.presetPlaybackRate; + } + mediaEl.loadedmetadata = true; + }); + return mediaEl; + } /** + * Creates a `<video>` element for simple audio/video playback. + * Returns a new p5.MediaElement object. + * + * Videos are shown by default. They can be hidden by calling `video.hide()` + * and drawn to the canvas using image(). + * + * The first parameter, `src`, is the path the video. If a single string is + * passed, as in `'assets/topsecret.mp4'`, a single video is loaded. An array + * of strings can be used to load the same video in different formats. For + * example, `['assets/topsecret.mp4', 'assets/topsecret.ogv', 'assets/topsecret.webm']`. + * This is useful for ensuring that the video can play across different browsers with + * different capabilities. See + * MDN + * for more information about supported formats. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the video is ready to play. + * + * @method createVideo + * @param {String|String[]} src path to a video file, or an array of paths for + * supporting different browsers. + * @param {Function} [callback] function to call once the video is ready to play. + * @return {p5.MediaElement} new p5.MediaElement object. + * @example + *
                    + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Note: this may not work in some browsers. + * let video = createVideo('assets/small.mp4'); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Provide an array options for different file formats. + * let video = createVideo( + * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'] + * ); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + *
                    + * + *
                    + * + * let video; + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Provide an array options for different file formats. + * // Call mute() once the video loads. + * video = createVideo( + * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'], + * muteVideo + * ); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + * // Mute the video once it loads. + * function muteVideo() { + * video.volume(0); + * } + * + *
                    + */ + + _main.default.prototype.createVideo = function (src, callback) { + _main.default._validateParameters("createVideo", arguments); + return createMedia(this, "video", src, callback); + }; + /** AUDIO STUFF **/ + /** + * Creates a hidden `<audio>` element for simple audio playback. + * Returns a new p5.MediaElement object. + * + * The first parameter, `src`, is the path the video. If a single string is + * passed, as in `'assets/video.mp4'`, a single video is loaded. An array + * of strings can be used to load the same video in different formats. For + * example, `['assets/video.mp4', 'assets/video.ogv', 'assets/video.webm']`. + * This is useful for ensuring that the video can play across different + * browsers with different capabilities. See + * MDN + * for more information about supported formats. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the audio is ready to play. + * + * @method createAudio + * @param {String|String[]} [src] path to an audio file, or an array of paths + * for supporting different browsers. + * @param {Function} [callback] function to call once the audio is ready to play. + * @return {p5.MediaElement} new p5.MediaElement object. + * @example + *
                    + * + * function setup() { + * noCanvas(); + * + * // Load the audio. + * let beat = createAudio('assets/beat.mp3'); + * // Show the default audio controls. + * beat.showControls(); + * + * describe('An audio beat plays when the user double-clicks the square.'); + * } + * + *
                    + */ + _main.default.prototype.createAudio = function (src, callback) { + _main.default._validateParameters("createAudio", arguments); + return createMedia(this, "audio", src, callback); + }; + /** CAMERA STUFF **/ + _main.default.prototype.VIDEO = "video"; + _main.default.prototype.AUDIO = "audio"; + // from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia + // Older browsers might not implement mediaDevices at all, so we set an empty object first + if (navigator.mediaDevices === undefined) { + navigator.mediaDevices = {}; + } // Some browsers partially implement mediaDevices. We can't just assign an object + // with getUserMedia as it would overwrite existing properties. + // Here, we will just add the getUserMedia property if it's missing. + + if (navigator.mediaDevices.getUserMedia === undefined) { + navigator.mediaDevices.getUserMedia = function (constraints) { + // First get ahold of the legacy getUserMedia, if present + var getUserMedia = + navigator.webkitGetUserMedia || navigator.mozGetUserMedia; + // Some browsers just don't implement it - return a rejected promise with an error + // to keep a consistent interface + if (!getUserMedia) { + return Promise.reject( + new Error("getUserMedia is not implemented in this browser"), + ); + } // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise + + return new Promise(function (resolve, reject) { + getUserMedia.call(navigator, constraints, resolve, reject); + }); + }; + } /** + * Creates a `<video>` element that "captures" the audio/video stream from + * the webcam and microphone. Returns a new + * p5.Element object. + * + * Videos are shown by default. They can be hidden by calling `capture.hide()` + * and drawn to the canvas using image(). + * + * The first parameter, `type`, is optional. It sets the type of capture to + * use. By default, `createCapture()` captures both audio and video. If `VIDEO` + * is passed, as in `createCapture(VIDEO)`, only video will be captured. + * If `AUDIO` is passed, as in `createCapture(AUDIO)`, only audio will be + * captured. A constraints object can also be passed to customize the stream. + * See the + * W3C documentation for possible properties. Different browsers support different + * properties. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the capture is ready for use. The callback function should have one + * parameter, `stream`, that's a + * MediaStream object. + * + * Note: `createCapture()` only works when running a sketch locally or using HTTPS. Learn more + * here + * and here. + * + * @method createCapture + * @param {String|Constant|Object} [type] type of capture, either AUDIO or VIDEO, + * or a constraints object. Both video and audio + * audio streams are captured by default. + * @param {Function} [callback] function to call once the stream + * has loaded. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * noCanvas(); + * createCapture(VIDEO); + * + * describe('A video stream from the webcam.'); + * } + * + *
                    + * + *
                    + * + * let capture; + * + * function setup() { + * // Create the video capture and hide the element. + * capture = createCapture(VIDEO); + * capture.hide(); + * + * describe('A video stream from the webcam with inverted colors.'); + * } + * + * function draw() { + * // Draw the video capture within the canvas. + * image(capture, 0, 0, width, width * capture.height / capture.width); + * // Invert the colors in the stream. + * filter(INVERT); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(480, 120); + * + * // Create a constraints object. + * let constraints = { + * video: { + * mandatory: { + * minWidth: 1280, + * minHeight: 720 + * }, + * optional: [{ maxFrameRate: 10 }] + * }, + * audio: false + * }; + * + * // Create the video capture. + * createCapture(constraints); + * + * describe('A video stream from the webcam.'); + * } + * + *
                    + */ + + _main.default.prototype.createCapture = function () { + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters("createCapture", args); + // return if getUserMedia is not supported by browser + if ( + !(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) + ) { + throw new DOMException( + "getUserMedia not supported in this browser", + ); + } + var useVideo = true; + var useAudio = true; + var constraints; + var callback; + for (var _i2 = 0, _args = args; _i2 < _args.length; _i2++) { + var arg = _args[_i2]; + if (arg === _main.default.prototype.VIDEO) useAudio = false; + else if (arg === _main.default.prototype.AUDIO) useVideo = false; + else if (_typeof(arg) === "object") constraints = arg; + else if (typeof arg === "function") callback = arg; + } + if (!constraints) + constraints = { + video: useVideo, + audio: useAudio, + }; + var domElement = document.createElement("video"); + // required to work in iOS 11 & up: + domElement.setAttribute("playsinline", ""); + navigator.mediaDevices.getUserMedia(constraints).then(function ( + stream, + ) { + try { + if ("srcObject" in domElement) { + domElement.srcObject = stream; + } else { + domElement.src = window.URL.createObjectURL(stream); + } + } catch (err) { + domElement.src = stream; + } + }, console.log); + var videoEl = addElement(domElement, this, true); + videoEl.loadedmetadata = false; + // set width and height onload metadata + domElement.addEventListener("loadedmetadata", function () { + domElement.play(); + if (domElement.width) { + videoEl.width = domElement.width; + videoEl.height = domElement.height; + } else { + videoEl.width = videoEl.elt.width = domElement.videoWidth; + videoEl.height = videoEl.elt.height = domElement.videoHeight; + } + videoEl.loadedmetadata = true; + if (callback) callback(domElement.srcObject); + }); + return videoEl; + }; + /** + * Creates a new p5.Element object. + * + * The first parameter, `tag`, is a string an HTML tag such as `'h5'`. + * + * The second parameter, `content`, is optional. It's a string that sets the + * HTML content to insert into the new element. New elements have no content + * by default. + * + * @method createElement + * @param {String} tag tag for the new element. + * @param {String} [content] HTML content to insert into the element. + * @return {p5.Element} new p5.Element object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create an h5 element with nothing in it. + * createElement('h5'); + * + * describe('A gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create an h5 element with the content + * // "p5*js". + * let h5 = createElement('h5', 'p5*js'); + * // Set the element's style and position. + * h5.style('color', 'deeppink'); + * h5.position(30, 15); + * + * describe('The text "p5*js" written in pink in the middle of a gray square.'); + * } + * + *
                    + */ + _main.default.prototype.createElement = function (tag, content) { + _main.default._validateParameters("createElement", arguments); + var elt = document.createElement(tag); + if (typeof content !== "undefined") { + elt.innerHTML = content; + } + return addElement(elt, this); + }; + // ============================================================================= + // p5.Element additions + // ============================================================================= + /** + * + * Adds specified class to the element. + * + * @for p5.Element + * @method addClass + * @param {String} class name of class to add + * @chainable + * @example + *
                    + * let div = createDiv('div'); + * div.addClass('myClass'); + *
                    + */ + _main.default.Element.prototype.addClass = function (c) { + if (this.elt.className) { + if (!this.hasClass(c)) { + this.elt.className = this.elt.className + " " + c; + } + } else { + this.elt.className = c; + } + return this; + }; + /** + * + * Removes specified class from the element. + * + * @method removeClass + * @param {String} class name of class to remove + * @chainable + * @example + *
                    + * // In this example, a class is set when the div is created + * // and removed when mouse is pressed. This could link up + * // with a CSS style rule to toggle style properties. + * + * let div; + * + * function setup() { + * div = createDiv('div'); + * div.addClass('myClass'); + * } + * + * function mousePressed() { + * div.removeClass('myClass'); + * } + *
                    + */ + _main.default.Element.prototype.removeClass = function (c) { + // Note: Removing a class that does not exist does NOT throw an error in classList.remove method + this.elt.classList.remove(c); + return this; + }; + /** + * + * Checks if specified class is already applied to element. + * + * @method hasClass + * @returns {boolean} a boolean value if element has specified class + * @param c {String} class name of class to check + * @example + *
                    + * let div; + * + * function setup() { + * div = createDiv('div'); + * div.addClass('show'); + * } + * + * function mousePressed() { + * if (div.hasClass('show')) { + * div.addClass('show'); + * } else { + * div.removeClass('show'); + * } + * } + *
                    + */ + _main.default.Element.prototype.hasClass = function (c) { + return this.elt.classList.contains(c); + }; + /** + * + * Toggles element class. + * + * @method toggleClass + * @param c {String} class name to toggle + * @chainable + * @example + *
                    + * let div; + * + * function setup() { + * div = createDiv('div'); + * div.addClass('show'); + * } + * + * function mousePressed() { + * div.toggleClass('show'); + * } + *
                    + */ + _main.default.Element.prototype.toggleClass = function (c) { + // classList also has a toggle() method, but we cannot use that yet as support is unclear. + // See https://github.com/processing/p5.js/issues/3631 + // this.elt.classList.toggle(c); + if (this.elt.classList.contains(c)) { + this.elt.classList.remove(c); + } else { + this.elt.classList.add(c); + } + return this; + }; + /** + * + * Attaches the element as a child to the parent specified. + * Accepts either a string ID, DOM node, or p5.Element. + * If no argument is specified, an array of children DOM nodes is returned. + * + * @method child + * @returns {Node[]} an array of child nodes + * @example + *
                    + * let div0 = createDiv('this is the parent'); + * let div1 = createDiv('this is the child'); + * div0.child(div1); // use p5.Element + *
                    + *
                    + * let div0 = createDiv('this is the parent'); + * let div1 = createDiv('this is the child'); + * div1.id('apples'); + * div0.child('apples'); // use id + *
                    + *
                    + * // this example assumes there is a div already on the page + * // with id "myChildDiv" + * let div0 = createDiv('this is the parent'); + * let elt = document.getElementById('myChildDiv'); + * div0.child(elt); // use element from page + *
                    + */ + /** + * @method child + * @param {String|p5.Element} [child] the ID, DOM node, or p5.Element + * to add to the current element + * @chainable + */ + _main.default.Element.prototype.child = function (childNode) { + if (typeof childNode === "undefined") { + return this.elt.childNodes; + } + if (typeof childNode === "string") { + if (childNode[0] === "#") { + childNode = childNode.substring(1); + } + childNode = document.getElementById(childNode); + } else if (childNode instanceof _main.default.Element) { + childNode = childNode.elt; + } + if (childNode instanceof HTMLElement) { + this.elt.appendChild(childNode); + } + return this; + }; + /** + * Centers a p5.Element either vertically, horizontally, + * or both, relative to its parent or according to + * the body if the p5.Element has no parent. If no argument is passed + * the p5.Element is aligned both vertically and horizontally. + * + * @method center + * @param {String} [align] passing 'vertical', 'horizontal' aligns element accordingly + * @chainable + * + * @example + *
                    + * function setup() { + * let div = createDiv('').size(10, 10); + * div.style('background-color', 'orange'); + * div.center(); + * } + *
                    + */ + _main.default.Element.prototype.center = function (align) { + var style = this.elt.style.display; + var hidden = this.elt.style.display === "none"; + var parentHidden = this.parent().style.display === "none"; + var pos = { + x: this.elt.offsetLeft, + y: this.elt.offsetTop, + }; + if (hidden) this.show(); + if (parentHidden) this.parent().show(); + this.elt.style.display = "block"; + this.position(0, 0); + var wOffset = Math.abs( + this.parent().offsetWidth - this.elt.offsetWidth, + ); + var hOffset = Math.abs( + this.parent().offsetHeight - this.elt.offsetHeight, + ); + if (align === "both" || align === undefined) { + this.position( + wOffset / 2 + this.parent().offsetLeft, + hOffset / 2 + this.parent().offsetTop, + ); + } else if (align === "horizontal") { + this.position(wOffset / 2 + this.parent().offsetLeft, pos.y); + } else if (align === "vertical") { + this.position(pos.x, hOffset / 2 + this.parent().offsetTop); + } + this.style("display", style); + if (hidden) this.hide(); + if (parentHidden) this.parent().hide(); + return this; + }; + /** + * + * If an argument is given, sets the inner HTML of the element, + * replacing any existing HTML. If true is included as a second + * argument, HTML is appended instead of replacing existing HTML. + * If no arguments are given, returns + * the inner HTML of the element. + * + * @for p5.Element + * @method html + * @returns {String} the inner HTML of the element + * @example + *
                    + * let div = createDiv('').size(100, 100); + * div.html('hi'); + *
                    + *
                    + * let div = createDiv('Hello ').size(100, 100); + * div.html('World', true); + *
                    + */ + /** + * @method html + * @param {String} [html] the HTML to be placed inside the element + * @param {boolean} [append] whether to append HTML to existing + * @chainable + */ + _main.default.Element.prototype.html = function () { + if (arguments.length === 0) { + return this.elt.innerHTML; + } else if (arguments.length <= 1 ? undefined : arguments[1]) { + this.elt.insertAdjacentHTML( + "beforeend", + arguments.length <= 0 ? undefined : arguments[0], + ); + return this; + } else { + this.elt.innerHTML = + arguments.length <= 0 ? undefined : arguments[0]; + return this; + } + }; + /** + * + * Sets the position of the element. If no position type argument is given, the + * position will be relative to (0, 0) of the window. + * Essentially, this sets position:absolute and left and top + * properties of style. If an optional third argument specifying position type is given, + * the x and y-coordinates will be interpreted based on the positioning scheme. + * If no arguments given, the function returns the x and y position of the element. + * + * found documentation on how to be more specific with object type + * https://stackoverflow.com/questions/14714314/how-do-i-comment-object-literals-in-yuidoc + * + * @method position + * @returns {Object} object of form { x: 0, y: 0 } containing the position of the element in an object + * @example + *
                    + * function setup() { + * let cnv = createCanvas(100, 100); + * // positions canvas 50px to the right and 100px + * // below upper left corner of the window + * cnv.position(50, 100); + * } + *
                    + *
                    + * function setup() { + * let cnv = createCanvas(100, 100); + * // positions canvas at upper left corner of the window + * // with a 'fixed' position type + * cnv.position(0, 0, 'fixed'); + * } + *
                    + */ + /** + * @method position + * @param {Number} [x] x-position relative to upper left of window (optional) + * @param {Number} [y] y-position relative to upper left of window (optional) + * @param {String} [positionType] it can be static, fixed, relative, sticky, initial or inherit (optional) + * @chainable + */ + _main.default.Element.prototype.position = function () { + if (arguments.length === 0) { + return { + x: this.elt.offsetLeft, + y: this.elt.offsetTop, + }; + } else { + var positionType = "absolute"; + if ( + (arguments.length <= 2 ? undefined : arguments[2]) === + "static" || + (arguments.length <= 2 ? undefined : arguments[2]) === + "fixed" || + (arguments.length <= 2 ? undefined : arguments[2]) === + "relative" || + (arguments.length <= 2 ? undefined : arguments[2]) === + "sticky" || + (arguments.length <= 2 ? undefined : arguments[2]) === + "initial" || + (arguments.length <= 2 ? undefined : arguments[2]) === "inherit" + ) { + positionType = arguments.length <= 2 ? undefined : arguments[2]; + } + this.elt.style.position = positionType; + this.elt.style.left = + (arguments.length <= 0 ? undefined : arguments[0]) + "px"; + this.elt.style.top = + (arguments.length <= 1 ? undefined : arguments[1]) + "px"; + this.x = arguments.length <= 0 ? undefined : arguments[0]; + this.y = arguments.length <= 1 ? undefined : arguments[1]; + return this; + } + }; + /* Helper method called by p5.Element.style() */ + _main.default.Element.prototype._translate = function () { + this.elt.style.position = "absolute"; + // save out initial non-translate transform styling + var transform = ""; + if (this.elt.style.transform) { + transform = this.elt.style.transform.replace( + /translate3d\(.*\)/g, + "", + ); + transform = transform.replace(/translate[X-Z]?\(.*\)/g, ""); + } + if (arguments.length === 2) { + this.elt.style.transform = + "translate(" + + (arguments.length <= 0 ? undefined : arguments[0]) + + "px, " + + (arguments.length <= 1 ? undefined : arguments[1]) + + "px)"; + } else if (arguments.length > 2) { + this.elt.style.transform = + "translate3d(" + + (arguments.length <= 0 ? undefined : arguments[0]) + + "px," + + (arguments.length <= 1 ? undefined : arguments[1]) + + "px," + + (arguments.length <= 2 ? undefined : arguments[2]) + + "px)"; + if (arguments.length === 3) { + this.elt.parentElement.style.perspective = "1000px"; + } else { + this.elt.parentElement.style.perspective = + (arguments.length <= 3 ? undefined : arguments[3]) + "px"; + } + } // add any extra transform styling back on end + + this.elt.style.transform += transform; + return this; + }; + /* Helper method called by p5.Element.style() */ + _main.default.Element.prototype._rotate = function () { + // save out initial non-rotate transform styling + var transform = ""; + if (this.elt.style.transform) { + transform = this.elt.style.transform.replace( + /rotate3d\(.*\)/g, + "", + ); + transform = transform.replace(/rotate[X-Z]?\(.*\)/g, ""); + } + if (arguments.length === 1) { + this.elt.style.transform = + "rotate(" + + (arguments.length <= 0 ? undefined : arguments[0]) + + "deg)"; + } else if (arguments.length === 2) { + this.elt.style.transform = + "rotate(" + + (arguments.length <= 0 ? undefined : arguments[0]) + + "deg, " + + (arguments.length <= 1 ? undefined : arguments[1]) + + "deg)"; + } else if (arguments.length === 3) { + this.elt.style.transform = + "rotateX(" + + (arguments.length <= 0 ? undefined : arguments[0]) + + "deg)"; + this.elt.style.transform += + "rotateY(" + + (arguments.length <= 1 ? undefined : arguments[1]) + + "deg)"; + this.elt.style.transform += + "rotateZ(" + + (arguments.length <= 2 ? undefined : arguments[2]) + + "deg)"; + } // add remaining transform back on + + this.elt.style.transform += transform; + return this; + }; + /** + * Applies a style to an element by adding a + * CSS declaration. + * + * The first parameter, `property`, is a string. If the name of a style + * property is passed, as in `myElement.style('color')`, the method returns + * the current value as a string or `null` if it hasn't been set. If a + * `property:style` string is passed, as in + * `myElement.style('color:deeppink')`, the method sets `property` to + * `value`. + * + * The second parameter, `value`, is optional. It sets the property's value. + * `value` can be a string, as in + * `myElement.style('color', 'deeppink')`, or a + * p5.Color object, as in + * `myElement.style('color', myColor)`. + * + * @method style + * @param {String} property style property to set. + * @returns {String} value of the property. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a paragraph element and + * // set its font color to "deeppink". + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color', 'deeppink'); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create a p5.Color object. + * let c = color('deeppink'); + * + * // Create a paragraph element and + * // set its font color using a + * // p5.Color object. + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color', c); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create a paragraph element and + * // set its font color to "deeppink" + * // using property:value syntax. + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color:deeppink'); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create an empty paragraph element + * // and set its font color to "deeppink". + * let p = createP(); + * p.position(5, 5); + * p.style('color', 'deeppink'); + * + * // Get the element's color as an + * // RGB color string. + * let c = p.style('color'); + * + * // Set the element's inner HTML + * // using the RGB color string. + * p.html(c); + * + * describe('The text "rgb(255, 20, 147)" written in pink on a gray background.'); + * } + * + *
                    + */ + /** + * @method style + * @param {String} property + * @param {String|p5.Color} value value to assign to the property. + * @return {String} value of the property. + * @chainable + */ + _main.default.Element.prototype.style = function (prop, val) { + var self = this; + if (val instanceof _main.default.Color) { + val = + "rgba(" + + val.levels[0] + + "," + + val.levels[1] + + "," + + val.levels[2] + + "," + + val.levels[3] / 255 + + ")"; + } + if (typeof val === "undefined") { + if (prop.indexOf(":") === -1) { + // no value set, so assume requesting a value + var styles = window.getComputedStyle(self.elt); + var style = styles.getPropertyValue(prop); + return style; + } else { + // value set using `:` in a single line string + var attrs = prop.split(";"); + for (var i = 0; i < attrs.length; i++) { + var parts = attrs[i].split(":"); + if (parts[0] && parts[1]) { + this.elt.style[parts[0].trim()] = parts[1].trim(); + } + } + } + } else { + // input provided as key,val pair + this.elt.style[prop] = val; + if ( + prop === "width" || + prop === "height" || + prop === "left" || + prop === "top" + ) { + var _styles = window.getComputedStyle(self.elt); + var styleVal = _styles.getPropertyValue(prop); + var numVal = styleVal.replace(/[^\d.]/g, ""); + this[prop] = Math.round(parseFloat(numVal, 10)); + } + } + return this; + }; + /** + * Adds an + * attribute + * to the element. This method is useful for advanced tasks. + * + * Most commonly-used attributes, such as `id`, can be set with their + * dedicated methods. For example, `nextButton.id('next')` sets an element's + * `id` attribute. + * + * The first parameter, `attr`, is the attribute's name as a string. Calling + * `myElement.attribute('align')` returns the attribute's current value as a + * string or `null` if it hasn't been set. + * + * The second parameter, `value`, is optional. It's a string used to set the + * attribute's value. For example, calling + * `myElement.attribute('align', 'center')` sets the element's horizontal + * alignment to `center`. + * + * @method attribute + * @return {String} value of the attribute. + * + * @example + *
                    + * + * function setup() { + * // Create a container div and + * // place it at the top-left + * // corner. + * let container = createDiv(); + * container.position(0, 0); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "left". + * let p1 = createP('hi'); + * p1.parent(container); + * p1.attribute('align', 'left'); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "center". + * let p2 = createP('hi'); + * p2.parent(container); + * p2.attribute('align', 'center'); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "right". + * let p3 = createP('hi'); + * p3.parent(container); + * p3.attribute('align', 'right'); + * + * describe('A gray square with the text "hi" written on three separate lines, each placed further to the right.'); + * } + * + *
                    + */ + /** + * @method attribute + * @param {String} attr attribute to set. + * @param {String} value value to assign to the attribute. + * @chainable + */ + _main.default.Element.prototype.attribute = function (attr, value) { + //handling for checkboxes and radios to ensure options get + //attributes not divs + if ( + this.elt.firstChild != null && + (this.elt.firstChild.type === "checkbox" || + this.elt.firstChild.type === "radio") + ) { + if (typeof value === "undefined") { + return this.elt.firstChild.getAttribute(attr); + } else { + for (var i = 0; i < this.elt.childNodes.length; i++) { + this.elt.childNodes[i].setAttribute(attr, value); + } + } + } else if (typeof value === "undefined") { + return this.elt.getAttribute(attr); + } else { + this.elt.setAttribute(attr, value); + return this; + } + }; + /** + * Removes an attribute from the element. + * + * The parameter `attr` is the attribute's name as a string. For example, + * calling `myElement.removeAttribute('align')` removes its `align` + * attribute if it's been set. + * + * @method removeAttribute + * @param {String} attr attribute to remove. + * @chainable + * + * @example + *
                    + * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element and place it + * // in the center of the canvas. + * // Set its "align" attribute to "center". + * p = createP('hi'); + * p.position(0, 20); + * p.attribute('align', 'center'); + * + * describe('The text "hi" written in black at the center of a gray square. The text moves to the left edge when double-clicked.'); + * } + * + * function doubleClicked() { + * p.removeAttribute('align'); + * } + * + *
                    + */ + _main.default.Element.prototype.removeAttribute = function (attr) { + if ( + this.elt.firstChild != null && + (this.elt.firstChild.type === "checkbox" || + this.elt.firstChild.type === "radio") + ) { + for (var i = 0; i < this.elt.childNodes.length; i++) { + this.elt.childNodes[i].removeAttribute(attr); + } + } + this.elt.removeAttribute(attr); + return this; + }; + /** + * Returns or sets the element's value. + * + * Calling `myElement.value()` returns the element's current value. + * + * The parameter, `value`, is an optional number or string. If provided, + * as in `myElement.value(123)`, it's used to set the element's value. + * + * @method value + * @return {String|Number} value of the element. + * @example + *
                    + * + * let inp; + * + * function setup() { + * // Create a text input and place it + * // beneath the canvas. Set its default + * // value to "hello". + * inp = createInput('hello'); + * inp.position(0, 100); + * + * describe('The text from an input box is displayed on a gray square.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input's value to display a message. + * let msg = inp.value(); + * text(msg, 0, 55); + * } + * + *
                    + * + *
                    + * + * let inp; + * + * function setup() { + * // Create a text input and place it + * // beneath the canvas. Set its default + * // value to "hello". + * inp = createInput('hello'); + * inp.position(0, 100); + * + * describe('The text from an input box is displayed on a gray square. The text resets to "hello" when the user double-clicks the square.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input's value to display a message. + * let msg = inp.value(); + * text(msg, 0, 55); + * } + * + * // Reset the input's value. + * function doubleClicked() { + * inp.value('hello'); + * } + * + *
                    + */ + /** + * @method value + * @param {String|Number} value + * @chainable + */ + _main.default.Element.prototype.value = function () { + if (arguments.length > 0) { + this.elt.value = arguments.length <= 0 ? undefined : arguments[0]; + return this; + } else { + if (this.elt.type === "range") { + return parseFloat(this.elt.value); + } else return this.elt.value; + } + }; + /** + * Shows the current element. + * + * @method show + * @chainable + * @example + *
                    + * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element and hide it. + * p = createP('p5*js'); + * p.position(10, 10); + * p.hide(); + * + * describe('A gray square. The text "p5*js" appears when the user double-clicks the square.'); + * } + * + * // Show the paragraph when double-clicked. + * function doubleClicked() { + * p.show(); + * } + * + *
                    + */ + _main.default.Element.prototype.show = function () { + this.elt.style.display = "block"; + return this; + }; + /** + * Hides the current element. + * + * @method hide + * @chainable + * @example + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element. + * p = createP('p5*js'); + * p.position(10, 10); + * + * describe('The text "p5*js" at the center of a gray square. The text disappears when the user double-clicks the square.'); + * } + * + * // Hide the paragraph when double-clicked. + * function doubleClicked() { + * p.hide(); + * } + * + *
                    + */ + _main.default.Element.prototype.hide = function () { + this.elt.style.display = "none"; + return this; + }; + /** + * Sets the element's width and height. + * + * Calling `myElement.size()` without an argument returns the element's size + * as an object with the properties `width` and `height`. For example, + * `{ width: 20, height: 10 }`. + * + * The first parameter, `width`, is optional. It's a number used to set the + * element's width. Calling `myElement.size(10)` + * + * The second parameter, 'height`, is also optional. It's a + * number used to set the element's height. For example, calling + * `myElement.size(20, 10)` sets the element's width to 20 pixels and height + * to 10 pixels. + * + * The constant `AUTO` can be used to adjust one dimension at a time while + * maintaining the aspect ratio, which is `width / height`. For example, + * consider an element that's 200 pixels wide and 100 pixels tall. Calling + * `myElement.size(20, AUTO)` sets the width to 20 pixels and height to 10 + * pixels. + * + * Note: In the case of elements that need to load data, such as images, wait + * to call `myElement.size()` until after the data loads. + * + * @method size + * @return {Object} width and height of the element in an object. + * @example + *
                    + * + * function setup() { + * background(200); + * + * // Create a pink div element and place it at + * // the top-left corner. + * let div = createDiv(); + * div.position(10, 10); + * div.style('background-color', 'deeppink'); + * + * // Set the div's width to 80 pixels and + * // height to 20 pixels. + * div.size(80, 20); + * + * describe('A gray square with a pink rectangle near its top.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Create a pink div element and place it at + * // the top-left corner. + * let div = createDiv(); + * div.position(10, 10); + * div.style('background-color', 'deeppink'); + * + * // Set the div's width to 80 pixels and + * // height to 40 pixels. + * div.size(80, 40); + * + * // Get the div's size as an object. + * let s = div.size(); + * // Write the div's dimensions. + * div.html(`${s.width} x ${s.height}`); + * + * describe('A gray square with a pink rectangle near its top. The text "80 x 40" is written within the rectangle.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * // Load an image of an astronaut on the moon + * // and place it at the top-left of the canvas. + * let img1 = createImg( + * 'assets/moonwalk.jpg', + * 'An astronaut walking on the moon', + * '' + * ); + * img1.position(0, 0); + * + * // Load an image of an astronaut on the moon + * // and place it at the top-left of the canvas. + * // Resize the image once it's loaded. + * let img2 = createImg( + * 'assets/moonwalk.jpg', + * 'An astronaut walking on the moon', + * '', + * () => { + * img2.size(50, AUTO); + * } + * ); + * img2.position(0, 0); + * + * describe('A gray square two copies of a space image at the top-left. The copy in front is smaller.'); + * } + * + *
                    + */ + /** + * @method size + * @param {Number|Constant} w width of the element, either AUTO, or a number. + * @param {Number|Constant} [h] height of the element, either AUTO, or a number. + * @chainable + */ + _main.default.Element.prototype.size = function (w, h) { + if (arguments.length === 0) { + return { + width: this.elt.offsetWidth, + height: this.elt.offsetHeight, + }; + } else { + var aW = w; + var aH = h; + var AUTO = _main.default.prototype.AUTO; + if (aW !== AUTO || aH !== AUTO) { + if (aW === AUTO) { + aW = (h * this.width) / this.height; + } else if (aH === AUTO) { + aH = (w * this.height) / this.width; + } // set diff for cnv vs normal div + + if (this.elt instanceof HTMLCanvasElement) { + var j = {}; + var k = this.elt.getContext("2d"); + var prop; + for (prop in k) { + j[prop] = k[prop]; + } + this.elt.setAttribute( + "width", + aW * this._pInst._pixelDensity, + ); + this.elt.setAttribute( + "height", + aH * this._pInst._pixelDensity, + ); + this.elt.style.width = aW + "px"; + this.elt.style.height = aH + "px"; + this._pInst.scale( + this._pInst._pixelDensity, + this._pInst._pixelDensity, + ); + for (prop in j) { + this.elt.getContext("2d")[prop] = j[prop]; + } + } else { + this.elt.style.width = aW + "px"; + this.elt.style.height = aH + "px"; + this.elt.width = aW; + this.elt.height = aH; + } + this.width = this.elt.offsetWidth; + this.height = this.elt.offsetHeight; + if (this._pInst && this._pInst._curElement) { + // main canvas associated with p5 instance + if (this._pInst._curElement.elt === this.elt) { + this._pInst._setProperty("width", this.elt.offsetWidth); + this._pInst._setProperty("height", this.elt.offsetHeight); + } + } + } + return this; + } + }; + /** + * Removes the element, stops all audio/video streams, and removes all + * callback functions. + * + * @method remove + * @example + *
                    + * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element. + * p = createP('p5*js'); + * p.position(10, 10); + * + * describe('The text "p5*js" written at the center of a gray square. '); + * } + * + * // Remove the paragraph when double-clicked. + * function doubleClicked() { + * p.remove(); + * } + * + *
                    + */ + _main.default.Element.prototype.remove = function () { + // stop all audios/videos and detach all devices like microphone/camera etc + // used as input/output for audios/videos. + if (this instanceof _main.default.MediaElement) { + this.stop(); + var sources = this.elt.srcObject; + if (sources !== null) { + var tracks = sources.getTracks(); + tracks.forEach(function (track) { + track.stop(); + }); + } + } // delete the reference in this._pInst._elements + + var index = this._pInst._elements.indexOf(this); + if (index !== -1) { + this._pInst._elements.splice(index, 1); + } // deregister events + + for (var ev in this._events) { + this.elt.removeEventListener(ev, this._events[ev]); + } + if (this.elt && this.elt.parentNode) { + this.elt.parentNode.removeChild(this.elt); + } + }; + /** + * Sets a function to call when the user drops a file on the element. + * + * The first parameter, `callback`, is a function to call once the file loads. + * The callback function should have one parameter, `file`, that's a + * p5.File object. If the user drops multiple files on + * the element, `callback`, is called once for each file. + * + * The second parameter, `fxn`, is a function to call when the browser detects + * one or more dropped files. The callback function should have one + * parameter, `event`, that's a + * DragEvent. + * + * @method drop + * @param {Function} callback called when a file loads. Called once for each file dropped. + * @param {Function} [fxn] called once when any files are dropped. + * @chainable + * @example + *
                    + * + * // Drop an image on the canvas to view + * // this example. + * let img; + * + * function setup() { + * let c = createCanvas(100, 100); + * + * background(200); + * + * // Call a function when a file + * // dropped on the canvas has + * // loaded. + * c.drop(file => { + * // Remove the current image, if any. + * if (img) { + * img.remove(); + * } + * + * // Create an element with the + * // dropped file. + * img = createImg(file.data, ''); + * img.hide(); + * + * // Draw the image. + * image(img, 0, 0, width, height); + * }); + * + * describe('A gray square. When the user drops an image on the square, it is displayed.'); + * } + * + *
                    + * + *
                    + * + * // Drop an image on the canvas to view + * // this example. + * let img; + * let msg; + * + * function setup() { + * let c = createCanvas(100, 100); + * + * background(200); + * + * // Call functions when the user + * // drops a file on the canvas + * // and when the file loads. + * c.drop(handleFile, handleDrop); + * + * describe('A gray square. When the user drops an image on the square, it is displayed. The id attribute of canvas element is also displayed.'); + * } + * + * function handleFile(file) { + * // Remove the current image, if any. + * if (img) { + * img.remove(); + * } + * + * // Create an element with the + * // dropped file. + * img = createImg(file.data, ''); + * img.hide(); + * + * // Draw the image. + * image(img, 0, 0, width, height); + * } + * + * function handleDrop(event) { + * // Remove current paragraph, if any. + * if (msg) { + * msg.remove(); + * } + * + * // Use event to get the drop + * // target's id. + * let id = event.target.id; + * + * // Write the canvas' id + * // beneath it. + * msg = createP(id); + * msg.position(0, 100); + * + * // Set the font color + * // randomly for each drop. + * let c = random(['red', 'green', 'blue']); + * msg.style('color', c); + * msg.style('font-size', '12px'); + * } + * + *
                    + */ + _main.default.Element.prototype.drop = function (callback, fxn) { + // Is the file stuff supported? + if ( + window.File && + window.FileReader && + window.FileList && + window.Blob + ) { + if (!this._dragDisabled) { + this._dragDisabled = true; + var preventDefault = function preventDefault(evt) { + evt.preventDefault(); + }; + // If you want to be able to drop you've got to turn off + // a lot of default behavior. + // avoid `attachListener` here, since it overrides other handlers. + this.elt.addEventListener("dragover", preventDefault); + // If this is a drag area we need to turn off the default behavior + this.elt.addEventListener("dragleave", preventDefault); + } // Deal with the files + + _main.default.Element._attachListener( + "drop", + function (evt) { + evt.preventDefault(); + // Call the second argument as a callback that receives the raw drop event + if (typeof fxn === "function") { + fxn.call(this, evt); + } // A FileList + + var files = evt.dataTransfer.files; + // Load each one and trigger the callback + var _iteratorNormalCompletion10 = true; + var _didIteratorError10 = false; + var _iteratorError10 = undefined; + try { + for ( + var _iterator10 = files[Symbol.iterator](), _step10; + !(_iteratorNormalCompletion10 = (_step10 = + _iterator10.next()).done); + _iteratorNormalCompletion10 = true + ) { + var f = _step10.value; + _main.default.File._load(f, callback); + } + } catch (err) { + _didIteratorError10 = true; + _iteratorError10 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion10 && + _iterator10.return != null + ) { + _iterator10.return(); + } + } finally { + if (_didIteratorError10) { + throw _iteratorError10; + } + } + } + }, + this, + ); + } else { + console.log( + "The File APIs are not fully supported in this browser.", + ); + } + return this; + }; + /** + * Turns p5.Element into a draggable item. If an argument is given, it will drag that p5.Element instead, ie. drag a entire GUI panel (parent container) with the panel's title bar. + * + * @method draggable + * @param {p5.Element} [elmnt] pass another p5.Element + * @chainable + * + * @example + *
                    + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * createDiv('Post-It') + * .position(5, 5) + * .size(75, 20) + * .style('font-size', '16px') + * .style('background', 'yellow') + * .style('color', '#000') + * .style('border', '1px solid #aaaa00') + * .style('padding', '5px') + * .draggable(); + * // .style('cursor', 'help') // override cursor + * + * let gui = createDiv('') + * .position(5, 40) + * .size(85, 50) + * .style('font-size', '16px') + * .style('background', 'yellow') + * .style('z-index', '100') + * .style('border', '1px solid #00aaaa'); + * + * createDiv('= PANEL =') + * .parent(gui) + * .style('background', 'cyan') + * .style('padding', '2px') + * .style('text-align', 'center') + * .draggable(gui); + * + * createSlider(0, 100, random(100)) + * .style('cursor', 'pointer') + * .size(80, 5) + * .parent(gui); + * } + *
                    + */ + _main.default.Element.prototype.draggable = function (elmMove) { + var isTouch = "ontouchstart" in window; + var x = 0, + y = 0, + px = 0, + py = 0, + elmDrag, + dragMouseDownEvt = isTouch ? "touchstart" : "mousedown", + closeDragElementEvt = isTouch ? "touchend" : "mouseup", + elementDragEvt = isTouch ? "touchmove" : "mousemove"; + if (elmMove === undefined) { + elmMove = this.elt; + elmDrag = elmMove; + } else if (elmMove !== this.elt && elmMove.elt !== this.elt) { + elmMove = elmMove.elt; + elmDrag = this.elt; + } + elmDrag.addEventListener(dragMouseDownEvt, dragMouseDown, false); + elmDrag.style.cursor = "move"; + function dragMouseDown(e) { + e = e || window.event; + if (isTouch) { + var touches = e.changedTouches; + px = parseInt(touches[0].clientX); + py = parseInt(touches[0].clientY); + } else { + px = parseInt(e.clientX); + py = parseInt(e.clientY); + } + document.addEventListener( + closeDragElementEvt, + closeDragElement, + false, + ); + document.addEventListener(elementDragEvt, elementDrag, false); + return false; + } + function elementDrag(e) { + e = e || window.event; + if (isTouch) { + var touches = e.changedTouches; + x = px - parseInt(touches[0].clientX); + y = py - parseInt(touches[0].clientY); + px = parseInt(touches[0].clientX); + py = parseInt(touches[0].clientY); + } else { + x = px - parseInt(e.clientX); + y = py - parseInt(e.clientY); + px = parseInt(e.clientX); + py = parseInt(e.clientY); + } + elmMove.style.left = elmMove.offsetLeft - x + "px"; + elmMove.style.top = elmMove.offsetTop - y + "px"; + } + function closeDragElement() { + document.removeEventListener( + closeDragElementEvt, + closeDragElement, + false, + ); + document.removeEventListener(elementDragEvt, elementDrag, false); + } + return this; + }; + /*** SCHEDULE EVENTS ***/ + // Cue inspired by JavaScript setTimeout, and the + // Tone.js Transport Timeline Event, MIT License Yotam Mann 2015 tonejs.org + // eslint-disable-next-line no-unused-vars + var Cue = function Cue(callback, time, id, val) { + _classCallCheck(this, Cue); + this.callback = callback; + this.time = time; + this.id = id; + this.val = val; + }; // ============================================================================= + // p5.MediaElement additions + // ============================================================================= + /** + * A class to handle audio and video. + * + * `p5.MediaElement` extends p5.Element with + * methods to handle audio and video. `p5.MediaElement` objects are created by + * calling createVideo, + * createAudio, and + * createCapture. + * + * @class p5.MediaElement + * @constructor + * @param {String} elt DOM node that is wrapped + * @extends p5.Element + * @example + *
                    + * + * let capture; + * + * function setup() { + * createCanvas(100, 100); + * + * // Create a p5.MediaElement using createCapture(). + * capture = createCapture(VIDEO); + * capture.hide(); + * } + * + * function draw() { + * // Display the video stream and invert the colors. + * image(capture, 0, 0, width, width * capture.height / capture.width); + * filter(INVERT); + * } + * + *
                    + */ + var MediaElement = /*#__PURE__*/ (function (_p5$Element) { + _inherits(MediaElement, _p5$Element); + var _super = _createSuper(MediaElement); + function MediaElement(elt, pInst) { + var _this; + _classCallCheck(this, MediaElement); + _this = _super.call(this, elt, pInst); + var self = _assertThisInitialized(_this); + _this.elt.crossOrigin = "anonymous"; + _this._prevTime = 0; + _this._cueIDCounter = 0; + _this._cues = []; + _this.pixels = []; + _this._pixelsState = _assertThisInitialized(_this); + _this._pixelDensity = 1; + _this._modified = false; + // Media has an internal canvas that is used when drawing it to the main + // canvas. It will need to be updated each frame as the video itself plays. + // We don't want to update it every time we draw, however, in case the user + // has used load/updatePixels. To handle this, we record the frame drawn to + // the internal canvas so we only update it if the frame has changed. + _this._frameOnCanvas = -1; + /** + * Path to the media element's source as a string. + * + * @property src + * @return {String} src + * @example + *
                    + * + * let beat; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "https://p5js.org/reference/assets/beat.mp3" written in black on a gray background.'); + * } + * + * function draw() { + * background(200); + * + * textWrap(CHAR); + * text(beat.src, 10, 10, 80, 80); + * } + * + *
                    + */ + Object.defineProperty(self, "src", { + get: function get() { + var firstChildSrc = self.elt.children[0].src; + var srcVal = + self.elt.src === window.location.href ? "" : self.elt.src; + var ret = + firstChildSrc === window.location.href + ? srcVal + : firstChildSrc; + return ret; + }, + set: function set(newValue) { + for (var i = 0; i < self.elt.children.length; i++) { + self.elt.removeChild(self.elt.children[i]); + } + var source = document.createElement("source"); + source.src = newValue; + elt.appendChild(source); + self.elt.src = newValue; + self.modified = true; + }, + }); + // private _onended callback, set by the method: onended(callback) + self._onended = function () {}; + self.elt.onended = function () { + self._onended(self); + }; + return _this; + } /** + * Play audio or video from a media element. + * + * @method play + * @chainable + * @example + *
                    + * + * let beat; + * + * function setup() { + * background(200); + * + * textAlign(CENTER); + * text('Click to play', 50, 50); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks the square.'); + * } + * + * // Play the beat when the user + * // presses the mouse. + * function mousePressed() { + * beat.play(); + * } + * + *
                    + */ + + _createClass(MediaElement, [ + { + key: "play", + value: function play() { + var _this2 = this; + if (this.elt.currentTime === this.elt.duration) { + this.elt.currentTime = 0; + } + var promise; + if (this.elt.readyState > 1) { + promise = this.elt.play(); + } else { + // in Chrome, playback cannot resume after being stopped and must reload + this.elt.load(); + promise = this.elt.play(); + } + if (promise && promise.catch) { + promise.catch(function (e) { + // if it's an autoplay failure error + if (e.name === "NotAllowedError") { + if (typeof IS_MINIFIED === "undefined") { + _main.default._friendlyAutoplayError(_this2.src); + } else { + console.error(e); + } + } else { + // any other kind of error + console.error( + "Media play method encountered an unexpected error", + e, + ); + } + }); + } + return this; + } /** + * Stops a media element and sets its current time to zero. Calling + * `media.play()` will restart playing audio/video from the beginning. + * + * @method stop + * @chainable + * @example + *
                    + * + * let beat; + * let isStopped = true; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to start" written in black on a gray background. The beat starts or stops when the user presses the mouse.'); + * } + * + * function draw() { + * background(200); + * + * textAlign(CENTER); + * if (isStopped === true) { + * text('Click to start', 50, 50); + * } else { + * text('Click to stop', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isStopped === true) { + * // If the beat is stopped, + * // play it. + * beat.play(); + * isStopped = false; + * } else { + * // If the beat is playing, + * // stop it. + * beat.stop(); + * isStopped = true; + * } + * } + * + *
                    + */, + }, + { + key: "stop", + value: function stop() { + this.elt.pause(); + this.elt.currentTime = 0; + return this; + } /** + * Pauses a media element. Calling `media.play()` will resume playing + * audio/video from the moment it paused. + * + * @method pause + * @chainable + * @example + *
                    + * + * let beat; + * let isPaused = true; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. The beat plays or pauses when the user clicks the square.'); + * } + * + * function draw() { + * background(200); + * + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isPaused === true) { + * text('Click to play', 50, 50); + * } else { + * text('Click to pause', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isPaused === true) { + * // If the beat is paused, + * // play it. + * beat.play(); + * isPaused = false; + * } else { + * // If the beat is playing, + * // pause it. + * beat.pause(); + * isPaused = true; + * } + * } + * + *
                    + */, + }, + { + key: "pause", + value: function pause() { + this.elt.pause(); + return this; + } /** + * Play the audio/video repeatedly in a loop. + * + * @method loop + * @chainable + * @example + *
                    + * + * let beat; + * let isLooping = false; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to loop" written in black on a gray background. A beat plays repeatedly in a loop when the user clicks. The beat stops when the user clicks again.'); + * } + * + * function draw() { + * background(200); + * + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isLooping === true) { + * text('Click to stop', 50, 50); + * } else { + * text('Click to loop', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isLooping === true) { + * // If the beat is looping, + * // stop it. + * beat.stop(); + * isLooping = false; + * } else { + * // If the beat is stopped, + * // loop it. + * beat.loop(); + * isLooping = true; + * } + * } + * + *
                    + */, + }, + { + key: "loop", + value: function loop() { + this.elt.setAttribute("loop", true); + this.play(); + return this; + } /** + * Stops the audio/video from playing in a loop. It will stop when it + * reaches the end. + * + * @method noLoop + * @chainable + * @example + *
                    + * + * let beat; + * let isPlaying = false; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks. The beat stops when the user clicks again.'); + * } + * + * function draw() { + * background(200); + * + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isPlaying === true) { + * text('Click to stop', 50, 50); + * } else { + * text('Click to play', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isPlaying === true) { + * // If the beat is playing, + * // stop it. + * beat.stop(); + * isPlaying = false; + * } else { + * // If the beat is stopped, + * // play it. + * beat.play(); + * isPlaying = true; + * } + * } + * + *
                    + */, + }, + { + key: "noLoop", + value: function noLoop() { + this.elt.removeAttribute("loop"); + return this; + } /** + * Sets up logic to check that autoplay succeeded. + * + * @method setupAutoplayFailDetection + * @private + */, + }, + { + key: "_setupAutoplayFailDetection", + value: function _setupAutoplayFailDetection() { + var _this3 = this; + var timeout = setTimeout(function () { + if (typeof IS_MINIFIED === "undefined") { + _main.default._friendlyAutoplayError(_this3.src); + } else { + console.error(e); + } + }, 500); + this.elt.addEventListener( + "play", + function () { + return clearTimeout(timeout); + }, + { + passive: true, + once: true, + }, + ); + } /** + * Sets the audio/video to play once it's loaded. + * + * The parameter, `shouldAutoplay`, is optional. Calling + * `media.autoplay()` without an argument causes the media to play + * automatically. If `true` is passed, as in `media.autoplay(true)`, the + * media will automatically play. If `false` is passed, as in + * `media.autoPlay(false)`, it won't play automatically. + * + * @method autoplay + * @param {Boolean} [shouldAutoplay] whether the element should autoplay. + * @chainable + * @example + *
                    + * + * function setup() { + * noCanvas(); + * + * // Load a video and play it automatically. + * let video = createVideo('assets/fingers.mov', () => { + * video.autoplay(); + * video.size(100, 100); + * }); + * + * describe('A video of fingers walking on a treadmill.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * noCanvas(); + * + * // Load a video, but don't play it automatically. + * let video = createVideo('assets/fingers.mov', () => { + * video.autoplay(false); + * video.size(100, 100); + * }); + * + * // Play the video when the user clicks on it. + * video.mousePressed(() => { + * video.play(); + * }); + * + * describe('An image of fingers on a treadmill. They start walking when the user double-clicks on them.'); + * } + * + *
                    + */, + }, + { + key: "autoplay", + value: function autoplay(val) { + var _this4 = this; + var oldVal = this.elt.getAttribute("autoplay"); + this.elt.setAttribute("autoplay", val); + // if we turned on autoplay + if (val && !oldVal) { + // bind method to this scope + var setupAutoplayFailDetection = + function setupAutoplayFailDetection() { + return _this4._setupAutoplayFailDetection(); + }; + // if media is ready to play, schedule check now + if (this.elt.readyState === 4) { + setupAutoplayFailDetection(); + } else { + // otherwise, schedule check whenever it is ready + this.elt.addEventListener( + "canplay", + setupAutoplayFailDetection, + { + passive: true, + once: true, + }, + ); + } + } + return this; + } /** + * Manages the audio/video volume. + * + * Calling `media.volume()` without an argument returns the current volume + * as a number in the range 0 (off) to 1 (maximum). + * + * The parameter, `val`, is optional. It's a number that sets the volume + * from 0 (off) to 1 (maximum). For example, calling `media.volume(0.5)` + * sets the volume to half of its maximum. + * + * @method volume + * @return {Number} current volume. + * + * @example + *
                    + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Volume: V" on a gray square with media controls beneath it. The number "V" oscillates between 0 and 1 as the music plays.'); + * } + * + * function draw() { + * background(200); + * + * // Produce a number between 0 and 1. + * let n = 0.5 * sin(frameCount * 0.01) + 0.5; + * // Use n to set the volume. + * dragon.volume(n); + * + * // Get the current volume + * // and display it. + * let v = dragon.volume(); + * // Round v to 1 decimal place + * // for display. + * v = round(v, 1); + * textAlign(CENTER); + * text(`Volume: ${v}`, 50, 50); + * } + * + *
                    + */, + /** + * @method volume + * @param {Number} val volume between 0.0 and 1.0. + * @chainable + */ + }, + { + key: "volume", + value: function volume(val) { + if (typeof val === "undefined") { + return this.elt.volume; + } else { + this.elt.volume = val; + } + } /** + * Manages the audio/video playback speed. Calling `media.speed()` returns + * the current speed as a number. + * + * The parameter, `val`, is optional. It's a number that sets the playback + * speed. 1 plays the media at normal speed, 0.5 plays it at half speed, 2 + * plays it at double speed, and so on. -1 plays the media at normal speed + * in reverse. + * + * Note: Not all browsers support backward playback. Even if they do, + * playback might not be smooth. + * + * @method speed + * @return {Number} current playback speed. + * + * @example + *
                    + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Speed: S" on a gray square with media controls beneath it. The number "S" oscillates between 0 and 1 as the music plays.'); + * } + * + * function draw() { + * background(200); + * + * // Produce a number between 0 and 2. + * let n = sin(frameCount * 0.01) + 1; + * // Use n to set the playback speed. + * dragon.speed(n); + * + * // Get the current speed + * // and display it. + * let s = dragon.speed(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`Speed: ${s}`, 50, 50); + * } + * + */, + /** + * @method speed + * @param {Number} speed speed multiplier for playback. + * @chainable + */ + }, + { + key: "speed", + value: function speed(val) { + if (typeof val === "undefined") { + return this.presetPlaybackRate || this.elt.playbackRate; + } else { + if (this.loadedmetadata) { + this.elt.playbackRate = val; + } else { + this.presetPlaybackRate = val; + } + } + } /** + * Manages the media element's playback time. Calling `media.time()` + * returns the number of seconds the audio/video has played. Time resets to + * 0 when the looping media restarts. + * + * The parameter, `time`, is optional. It's a number that specifies the + * time, in seconds, to jump to when playback begins. + * + * @method time + * @return {Number} current time (in seconds). + * + * @example + *
                    + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Display the current time. + * let s = dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`${s} seconds`, 50, 50); + * } + * + *
                    + * + *
                    + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * // Jump to 2 seconds + * // to start. + * dragon.time(2); + * + * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Display the current time. + * let s = dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`${s} seconds`, 50, 50); + * } + * + *
                    + */, + /** + * @method time + * @param {Number} time time to jump to (in seconds). + * @chainable + */ + }, + { + key: "time", + value: function time(val) { + if (typeof val === "undefined") { + return this.elt.currentTime; + } else { + this.elt.currentTime = val; + return this; + } + } /** + * Returns the audio/video's duration in seconds. + * + * @method duration + * @return {Number} duration (in seconds). + * + * @example + *
                    + * + * let dragon; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "S seconds left" on a gray square with media controls beneath it. The number "S" decreases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Calculate the time remaining. + * let s = dragon.duration() - dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * + * // Display the time remaining. + * textAlign(CENTER); + * text(`${s} seconds left`, 50, 50); + * } + * + *
                    + */, + }, + { + key: "duration", + value: function duration() { + return this.elt.duration; + }, + }, + { + key: "_ensureCanvas", + value: function _ensureCanvas() { + if (!this.canvas) { + this.canvas = document.createElement("canvas"); + this.drawingContext = this.canvas.getContext("2d"); + this.setModified(true); + } // Don't update the canvas again if we have already updated the canvas with + // the current frame + + var needsRedraw = + this._frameOnCanvas !== this._pInst.frameCount; + if (this.loadedmetadata && needsRedraw) { + // wait for metadata for w/h + if (this.canvas.width !== this.elt.width) { + this.canvas.width = this.elt.width; + this.canvas.height = this.elt.height; + this.width = this.canvas.width; + this.height = this.canvas.height; + } + this.drawingContext.clearRect( + 0, + 0, + this.canvas.width, + this.canvas.height, + ); + this.drawingContext.drawImage( + this.elt, + 0, + 0, + this.canvas.width, + this.canvas.height, + ); + this.setModified(true); + this._frameOnCanvas = this._pInst.frameCount; + } + }, + }, + { + key: "loadPixels", + value: function loadPixels() { + this._ensureCanvas(); + for ( + var _len4 = arguments.length, + args = new Array(_len4), + _key4 = 0; + _key4 < _len4; + _key4++ + ) { + args[_key4] = arguments[_key4]; + } + return _main.default.Renderer2D.prototype.loadPixels.apply( + this, + args, + ); + }, + }, + { + key: "updatePixels", + value: function updatePixels(x, y, w, h) { + if (this.loadedmetadata) { + // wait for metadata + this._ensureCanvas(); + _main.default.Renderer2D.prototype.updatePixels.call( + this, + x, + y, + w, + h, + ); + } + this.setModified(true); + return this; + }, + }, + { + key: "get", + value: function get() { + this._ensureCanvas(); + for ( + var _len5 = arguments.length, + args = new Array(_len5), + _key5 = 0; + _key5 < _len5; + _key5++ + ) { + args[_key5] = arguments[_key5]; + } + return _main.default.Renderer2D.prototype.get.apply( + this, + args, + ); + }, + }, + { + key: "_getPixel", + value: function _getPixel() { + this.loadPixels(); + for ( + var _len6 = arguments.length, + args = new Array(_len6), + _key6 = 0; + _key6 < _len6; + _key6++ + ) { + args[_key6] = arguments[_key6]; + } + return _main.default.Renderer2D.prototype._getPixel.apply( + this, + args, + ); + }, + }, + { + key: "set", + value: function set(x, y, imgOrCol) { + if (this.loadedmetadata) { + // wait for metadata + this._ensureCanvas(); + _main.default.Renderer2D.prototype.set.call( + this, + x, + y, + imgOrCol, + ); + this.setModified(true); + } + }, + }, + { + key: "copy", + value: function copy() { + this._ensureCanvas(); + for ( + var _len7 = arguments.length, + args = new Array(_len7), + _key7 = 0; + _key7 < _len7; + _key7++ + ) { + args[_key7] = arguments[_key7]; + } + _main.default.prototype.copy.apply(this, args); + }, + }, + { + key: "mask", + value: function mask() { + this.loadPixels(); + this.setModified(true); + for ( + var _len8 = arguments.length, + args = new Array(_len8), + _key8 = 0; + _key8 < _len8; + _key8++ + ) { + args[_key8] = arguments[_key8]; + } + _main.default.Image.prototype.mask.apply(this, args); + } /** + * helper method for web GL mode to figure out if the element + * has been modified and might need to be re-uploaded to texture + * memory between frames. + * @method isModified + * @private + * @return {boolean} a boolean indicating whether or not the + * image has been updated or modified since last texture upload. + */, + }, + { + key: "isModified", + value: function isModified() { + return this._modified; + } /** + * helper method for web GL mode to indicate that an element has been + * changed or unchanged since last upload. gl texture upload will + * set this value to false after uploading the texture; or might set + * it to true if metadata has become available but there is no actual + * texture data available yet.. + * @method setModified + * @param {boolean} val sets whether or not the element has been + * modified. + * @private + */, + }, + { + key: "setModified", + value: function setModified(value) { + this._modified = value; + } /** + * Calls a function when the audio/video reaches the end of its playback + * The function won't be called if the media is looping. + * + * The `p5.MediaElement` is passed as an argument to the callback function. + * + * @method onended + * @param {Function} callback function to call when playback ends. + * The `p5.MediaElement` is passed as + * the argument. + * @chainable + * @example + *
                    + * + * let beat; + * let isPlaying = false; + * let isDone = false; + * + * function setup() { + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * // Set isDone to false when + * // the beat finishes. + * beat.onended(() => { + * isDone = true; + * }); + * + * describe('The text "Click to play" written in black on a gray square. A beat plays when the user clicks. The text "Done!" appears when the beat finishes playing.'); + * } + * + * function draw() { + * background(200); + * + * // Display different messages + * // based on playback. + * textAlign(CENTER); + * if (isDone === true) { + * text('Done!', 50, 50); + * } else if (isPlaying === false) { + * text('Click to play', 50, 50); + * } else { + * text('Playing...', 50, 50); + * } + * } + * + * // Play the beat when the + * // user presses the mouse. + * function mousePressed() { + * if (isPlaying === false) { + * isPlaying = true; + * beat.play(); + * } + * } + * + *
                    + */, + }, + { + key: "onended", + value: function onended(callback) { + this._onended = callback; + return this; + } /*** CONNECT TO WEB AUDIO API / p5.sound.js ***/, + /** + * Send the audio output of this element to a specified audioNode or + * p5.sound object. If no element is provided, connects to p5's main + * output. That connection is established when this method is first called. + * All connections are removed by the .disconnect() method. + * + * This method is meant to be used with the p5.sound.js addon library. + * + * @method connect + * @param {AudioNode|Object} audioNode AudioNode from the Web Audio API, + * or an object from the p5.sound library + */ + }, + { + key: "connect", + value: function connect(obj) { + var audioContext, mainOutput; + // if p5.sound exists, same audio context + if ( + typeof _main.default.prototype.getAudioContext === + "function" + ) { + audioContext = _main.default.prototype.getAudioContext(); + mainOutput = _main.default.soundOut.input; + } else { + try { + audioContext = obj.context; + mainOutput = audioContext.destination; + } catch (e) { + throw "connect() is meant to be used with Web Audio API or p5.sound.js"; + } + } // create a Web Audio MediaElementAudioSourceNode if none already exists + + if (!this.audioSourceNode) { + this.audioSourceNode = + audioContext.createMediaElementSource(this.elt); + // connect to main output when this method is first called + this.audioSourceNode.connect(mainOutput); + } // connect to object if provided + + if (obj) { + if (obj.input) { + this.audioSourceNode.connect(obj.input); + } else { + this.audioSourceNode.connect(obj); + } + } else { + // otherwise connect to main output of p5.sound / AudioContext + this.audioSourceNode.connect(mainOutput); + } + } /** + * Disconnect all Web Audio routing, including to main output. + * This is useful if you want to re-route the output through + * audio effects, for example. + * + * @method disconnect + */, + }, + { + key: "disconnect", + value: function disconnect() { + if (this.audioSourceNode) { + this.audioSourceNode.disconnect(); + } else { + throw "nothing to disconnect"; + } + } /*** SHOW / HIDE CONTROLS ***/, + /** + * Show the default + * HTMLMediaElement + * controls. These vary between web browser. + * + * @method showControls + * @example + *
                    + * + * function setup() { + * background('cornflowerblue'); + * + * textAlign(CENTER); + * textSize(50); + * text('🐉', 50, 50); + * + * // Create a p5.MediaElement using createAudio(). + * let dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('A dragon emoji, 🐉, drawn in the center of a blue square. A song plays in the background. Audio controls are displayed beneath the canvas.'); + * } + * + *
                    + */ + }, + { + key: "showControls", + value: function showControls() { + // must set style for the element to show on the page + this.elt.style["text-align"] = "inherit"; + this.elt.controls = true; + } /** + * Hide the default + * HTMLMediaElement + * controls. + * + * @method hideControls + * @example + *
                    + * + * let dragon; + * let isHidden = false; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Double-click to hide controls" written in the middle of a gray square. A song plays in the background. Audio controls are displayed beneath the canvas. The controls appear/disappear when the user double-clicks the square.'); + * } + * + * function draw() { + * background(200); + * + * // Display a different message when + * // controls are hidden or shown. + * textAlign(CENTER); + * if (isHidden === true) { + * text('Double-click to show controls', 10, 20, 80, 80); + * } else { + * text('Double-click to hide controls', 10, 20, 80, 80); + * } + * } + * + * // Show/hide controls based on a double-click. + * function doubleClicked() { + * if (isHidden === true) { + * dragon.showControls(); + * isHidden = false; + * } else { + * dragon.hideControls(); + * isHidden = true; + * } + * } + * + *
                    + */, + }, + { + key: "hideControls", + value: function hideControls() { + this.elt.controls = false; + } /** + * Schedules a function to call when the audio/video reaches a specific time + * during its playback. + * + * The first parameter, `time`, is the time, in seconds, when the function + * should run. This value is passed to `callback` as its first argument. + * + * The second parameter, `callback`, is the function to call at the specified + * cue time. + * + * The third parameter, `value`, is optional and can be any type of value. + * `value` is passed to `callback`. + * + * Calling `media.addCue()` returns an ID as a string. This is useful for + * removing the cue later. + * + * @method addCue + * @param {Number} time cue time to run the callback function. + * @param {Function} callback function to call at the cue time. + * @param {Object} [value] object to pass as the argument to + * `callback`. + * @return {Number} id ID of this cue, + * useful for `media.removeCue(id)`. + * @example + *
                    + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * beat.addCue(6, changeBackground, 'lavender'); + * + * describe('A red square with a beat playing in the background. Its color changes every 2 seconds while the audio plays.'); + * } + * + * function changeBackground(c) { + * background(c); + * } + * + *
                    + */, + }, + { + key: "addCue", + value: function addCue(time, callback, val) { + var id = this._cueIDCounter++; + var cue = new Cue(callback, time, id, val); + this._cues.push(cue); + if (!this.elt.ontimeupdate) { + this.elt.ontimeupdate = this._onTimeUpdate.bind(this); + } + return id; + } /** + * Remove a callback based on its ID. + * + * @method removeCue + * @param {Number} id ID of the cue, created by `media.addCue()`. + * @example + *
                    + * + * let lavenderID; + * let isRemoved = false; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * + * // Record the ID of the "lavender" callback. + * lavenderID = beat.addCue(6, changeBackground, 'lavender'); + * + * describe('The text "Double-click to remove lavender." written on a red square. The color changes every 2 seconds while the audio plays. The lavender option is removed when the user double-clicks the square.'); + * } + * + * function draw() { + * if (isRemoved === false) { + * text('Double-click to remove lavender.', 10, 10, 80, 80); + * } else { + * text('No more lavender.', 10, 10, 80, 80); + * } + * } + * + * function changeBackground(c) { + * background(c); + * } + * + * // Remove the lavender color-change cue + * // when the user double-clicks. + * function doubleClicked() { + * if (isRemoved === false) { + * beat.removeCue(lavenderID); + * isRemoved = true; + * } + * } + * + *
                    + */, + }, + { + key: "removeCue", + value: function removeCue(id) { + for (var i = 0; i < this._cues.length; i++) { + if (this._cues[i].id === id) { + console.log(id); + this._cues.splice(i, 1); + } + } + if (this._cues.length === 0) { + this.elt.ontimeupdate = null; + } + } /** + * Removes all functions scheduled with `media.addCue()`. + * + * @method clearCues + * @example + *
                    + * + * let isChanging = true; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * beat.addCue(6, changeBackground, 'lavender'); + * + * describe('The text "Double-click to stop changing." written on a square. The color changes every 2 seconds while the audio plays. The color stops changing when the user double-clicks the square.'); + * } + * + * function draw() { + * if (isChanging === true) { + * text('Double-click to stop changing.', 10, 10, 80, 80); + * } else { + * text('No more changes.', 10, 10, 80, 80); + * } + * } + * + * function changeBackground(c) { + * background(c); + * } + * + * // Remove cued functions and stop + * // changing colors when the user + * // double-clicks. + * function doubleClicked() { + * if (isChanging === true) { + * beat.clearCues(); + * isChanging = false; + * } + * } + * + *
                    + */, + }, + { + key: "clearCues", + value: function clearCues() { + this._cues = []; + this.elt.ontimeupdate = null; + }, // private method that checks for cues to be fired if events + // have been scheduled using addCue(callback, time). + }, + { + key: "_onTimeUpdate", + value: function _onTimeUpdate() { + var playbackTime = this.time(); + for (var i = 0; i < this._cues.length; i++) { + var callbackTime = this._cues[i].time; + var val = this._cues[i].val; + if ( + this._prevTime < callbackTime && + callbackTime <= playbackTime + ) { + // pass the scheduled callbackTime as parameter to the callback + this._cues[i].callback(val); + } + } + this._prevTime = playbackTime; + }, + }, + ]); + return MediaElement; + })(_main.default.Element); + _main.default.MediaElement = MediaElement; + /** + * A class to describe a file. + * + * `p5.File` objects are used by + * myElement.drop() and + * created by + * createFileInput. + * + * @class p5.File + * @constructor + * @param {File} file wrapped file. + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayInfo() when + * // the file loads. + * let input = createFileInput(displayInfo); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); + * } + * + * // Display the p5.File's info + * // once it loads. + * function displayInfo(file) { + * background(200); + * + * // Display the p5.File's name. + * text(file.name, 10, 10, 80, 40); + * // Display the p5.File's type and subtype. + * text(`${file.type}/${file.subtype}`, 10, 70); + * // Display the p5.File's size in bytes. + * text(file.size, 10, 90); + * } + * + *
                    + * + *
                    + * + * // Use the file input to select an image to + * // load and display. + * let img; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. Call handleImage() when + * // the file image loads. + * let input = createFileInput(handleImage); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); + * } + * + * function draw() { + * background(200); + * + * // Draw the image if it's ready. + * if (img) { + * image(img, 0, 0, width, height); + * } + * } + * + * // Use the p5.File's data once + * // it loads. + * function handleImage(file) { + * // Check the p5.File's type. + * if (file.type === 'image') { + * // Create an image using using + * // the p5.File's data. + * img = createImg(file.data, ''); + * + * // Hide the image element so it + * // doesn't appear twice. + * img.hide(); + * } else { + * img = null; + * } + * } + * + *
                    + */ + var File = /*#__PURE__*/ (function () { + function File(file, pInst) { + _classCallCheck(this, File); + /** + * Underlying + * File + * object. All `File` properties and methods are accessible. + * + * @property file + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayInfo() when + * // the file loads. + * let input = createFileInput(displayInfo); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); + * } + * + * // Use the p5.File once + * // it loads. + * function displayInfo(file) { + * background(200); + * + * // Display the p5.File's name. + * text(file.name, 10, 10, 80, 40); + * // Display the p5.File's type and subtype. + * text(`${file.type}/${file.subtype}`, 10, 70); + * // Display the p5.File's size in bytes. + * text(file.size, 10, 90); + * } + * + *
                    + */ + this.file = file; + this._pInst = pInst; + // Splitting out the file type into two components + // This makes determining if image or text etc simpler + var typeList = file.type.split("/"); + /** + * The file + * MIME type + * as a string. For example, `'image'`, `'text'`, and so on. + * + * @property type + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayType() when + * // the file loads. + * let input = createFileInput(displayType); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its type is written in black.'); + * } + * + * // Display the p5.File's type + * // once it loads. + * function displayType(file) { + * background(200); + * + * // Display the p5.File's type. + * text(`This is file's type is: ${file.type}`, 10, 10, 80, 80); + * } + * + *
                    + */ + this.type = typeList[0]; + /** + * The file subtype as a string. For example, a file with an `'image'` + * MIME type + * may have a subtype such as ``png`` or ``jpeg``. + * + * @property subtype + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displaySubtype() when + * // the file loads. + * let input = createFileInput(displaySubtype); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its subtype is written in black.'); + * } + * + * // Display the p5.File's type + * // once it loads. + * function displaySubtype(file) { + * background(200); + * + * // Display the p5.File's subtype. + * text(`This is file's subtype is: ${file.subtype}`, 10, 10, 80, 80); + * } + * + *
                    + */ + this.subtype = typeList[1]; + /** + * The file name as a string. + * + * @property name + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayName() when + * // the file loads. + * let input = createFileInput(displayName); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its name is written in black.'); + * } + * + * // Display the p5.File's name + * // once it loads. + * function displayName(file) { + * background(200); + * + * // Display the p5.File's name. + * text(`This is file's name is: ${file.name}`, 10, 10, 80, 80); + * } + * + *
                    + */ + this.name = file.name; + /** + * The number of bytes in the file. + * + * @property size + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displaySize() when + * // the file loads. + * let input = createFileInput(displaySize); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its size in bytes is written in black.'); + * } + * + * // Display the p5.File's size + * // in bytes once it loads. + * function displaySize(file) { + * background(200); + * + * // Display the p5.File's size. + * text(`This is file has ${file.size} bytes.`, 10, 10, 80, 80); + * } + * + *
                    + */ + this.size = file.size; + /** + * A string containing either the file's image data, text contents, or + * a parsed object in the case of JSON and + * p5.XML objects. + * + * @property data + * @example + *
                    + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayData() when + * // the file loads. + * let input = createFileInput(displayData); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its data is written in black.'); + * } + * + * // Display the p5.File's data + * // once it loads. + * function displayData(file) { + * background(200); + * + * // Display the p5.File's data, + * // which looks like a random + * // string of characters. + * text(file.data, 10, 10, 80, 80); + * } + * + *
                    + */ + this.data = undefined; + } + _createClass(File, null, [ + { + key: "_createLoader", + value: function _createLoader(theFile, callback) { + var reader = new FileReader(); + reader.onload = function (e) { + var p5file = new _main.default.File(theFile); + if (p5file.file.type === "application/json") { + // Parse JSON and store the result in data + p5file.data = JSON.parse(e.target.result); + } else if (p5file.file.type === "text/xml") { + // Parse XML, wrap it in p5.XML and store the result in data + var parser = new DOMParser(); + var xml = parser.parseFromString( + e.target.result, + "text/xml", + ); + p5file.data = new _main.default.XML(xml.documentElement); + } else { + p5file.data = e.target.result; + } + callback(p5file); + }; + return reader; + }, + }, + { + key: "_load", + value: function _load(f, callback) { + // Text or data? + // This should likely be improved + if (/^text\//.test(f.type) || f.type === "application/json") { + _main.default.File._createLoader(f, callback).readAsText(f); + } else if (!/^(video|audio)\//.test(f.type)) { + _main.default.File._createLoader(f, callback).readAsDataURL( + f, + ); + } else { + var file = new _main.default.File(f); + file.data = URL.createObjectURL(f); + callback(file); + } + }, + }, + ]); + return File; + })(); + _main.default.File = File; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.every": 171, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.promise": 201, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.trim": 219, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + "core-js/modules/web.url": 258, + }, + ], + 315: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Events + * @submodule Acceleration + * @for p5 + * @requires core + * @main Events + */ + /** + * The system variable deviceOrientation always contains the orientation of + * the device. The value of this variable will either be set 'landscape' + * or 'portrait'. If no data is available it will be set to 'undefined'. + * either LANDSCAPE or PORTRAIT. + * + * @property {Constant} deviceOrientation + * @readOnly + */ + + _main.default.prototype.deviceOrientation = + window.innerWidth / window.innerHeight > 1 + ? "landscape" + : "portrait"; + /** + * The system variable accelerationX always contains the acceleration of the + * device along the x axis. Value is represented as meters per second squared. + * + * @property {Number} accelerationX + * @readOnly + * @example + *
                    + * + * // Move a touchscreen device to register + * // acceleration changes. + * function draw() { + * background(220, 50); + * fill('magenta'); + * ellipse(width / 2, height / 2, accelerationX); + * describe('Magnitude of device acceleration is displayed as ellipse size.'); + * } + * + *
                    + */ + _main.default.prototype.accelerationX = 0; + /** + * The system variable accelerationY always contains the acceleration of the + * device along the y axis. Value is represented as meters per second squared. + * + * @property {Number} accelerationY + * @readOnly + * @example + *
                    + * + * // Move a touchscreen device to register + * // acceleration changes. + * function draw() { + * background(220, 50); + * fill('magenta'); + * ellipse(width / 2, height / 2, accelerationY); + * describe('Magnitude of device acceleration is displayed as ellipse size'); + * } + * + *
                    + */ + _main.default.prototype.accelerationY = 0; + /** + * The system variable accelerationZ always contains the acceleration of the + * device along the z axis. Value is represented as meters per second squared. + * + * @property {Number} accelerationZ + * @readOnly + * + * @example + *
                    + * + * // Move a touchscreen device to register + * // acceleration changes. + * function draw() { + * background(220, 50); + * fill('magenta'); + * ellipse(width / 2, height / 2, accelerationZ); + * describe('Magnitude of device acceleration is displayed as ellipse size'); + * } + * + *
                    + */ + _main.default.prototype.accelerationZ = 0; + /** + * The system variable pAccelerationX always contains the acceleration of the + * device along the x axis in the frame previous to the current frame. Value + * is represented as meters per second squared. + * + * @property {Number} pAccelerationX + * @readOnly + */ + _main.default.prototype.pAccelerationX = 0; + /** + * The system variable pAccelerationY always contains the acceleration of the + * device along the y axis in the frame previous to the current frame. Value + * is represented as meters per second squared. + * + * @property {Number} pAccelerationY + * @readOnly + */ + _main.default.prototype.pAccelerationY = 0; + /** + * The system variable pAccelerationZ always contains the acceleration of the + * device along the z axis in the frame previous to the current frame. Value + * is represented as meters per second squared. + * + * @property {Number} pAccelerationZ + * @readOnly + */ + _main.default.prototype.pAccelerationZ = 0; + /** + * _updatePAccelerations updates the pAcceleration values + * + * @private + */ + _main.default.prototype._updatePAccelerations = function () { + this._setProperty("pAccelerationX", this.accelerationX); + this._setProperty("pAccelerationY", this.accelerationY); + this._setProperty("pAccelerationZ", this.accelerationZ); + }; + /** + * The system variable rotationX always contains the rotation of the + * device along the x axis. If the sketch + * angleMode() is set to DEGREES, the value will be -180 to 180. If + * it is set to RADIANS, the value will be -PI to PI. + * + * Note: The order the rotations are called is important, ie. if used + * together, it must be called in the order Z-X-Y or there might be + * unexpected behaviour. + * + * @property {Number} rotationX + * @readOnly + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * //rotateZ(radians(rotationZ)); + * rotateX(radians(rotationX)); + * //rotateY(radians(rotationY)); + * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); + * } + * + *
                    + */ + _main.default.prototype.rotationX = 0; + /** + * The system variable rotationY always contains the rotation of the + * device along the y axis. If the sketch + * angleMode() is set to DEGREES, the value will be -90 to 90. If + * it is set to RADIANS, the value will be -PI/2 to PI/2. + * + * Note: The order the rotations are called is important, ie. if used + * together, it must be called in the order Z-X-Y or there might be + * unexpected behaviour. + * + * @property {Number} rotationY + * @readOnly + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * //rotateZ(radians(rotationZ)); + * //rotateX(radians(rotationX)); + * rotateY(radians(rotationY)); + * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); + * } + * + *
                    + */ + _main.default.prototype.rotationY = 0; + /** + * The system variable rotationZ always contains the rotation of the + * device along the z axis. If the sketch + * angleMode() is set to DEGREES, the value will be 0 to 360. If + * it is set to RADIANS, the value will be 0 to 2*PI. + * + * Unlike rotationX and rotationY, this variable is available for devices + * with a built-in compass only. + * + * Note: The order the rotations are called is important, ie. if used + * together, it must be called in the order Z-X-Y or there might be + * unexpected behaviour. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * rotateZ(radians(rotationZ)); + * //rotateX(radians(rotationX)); + * //rotateY(radians(rotationY)); + * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); + * } + * + *
                    + * + * @property {Number} rotationZ + * @readOnly + */ + _main.default.prototype.rotationZ = 0; + /** + * The system variable pRotationX always contains the rotation of the + * device along the x axis in the frame previous to the current frame. + * If the sketch angleMode() is set to DEGREES, + * the value will be -180 to 180. If it is set to RADIANS, the value will + * be -PI to PI. + * + * pRotationX can also be used with rotationX to determine the rotate + * direction of the device along the X-axis. + * @example + *
                    + * + * // A simple if statement looking at whether + * // rotationX - pRotationX < 0 is true or not will be + * // sufficient for determining the rotate direction + * // in most cases. + * + * // Some extra logic is needed to account for cases where + * // the angles wrap around. + * let rotateDirection = 'clockwise'; + * + * // Simple range conversion to make things simpler. + * // This is not absolutely necessary but the logic + * // will be different in that case. + * + * let rX = rotationX + 180; + * let pRX = pRotationX + 180; + * + * if ((rX - pRX > 0 && rX - pRX < 270) || rX - pRX < -270) { + * rotateDirection = 'clockwise'; + * } else if (rX - pRX < 0 || rX - pRX > 270) { + * rotateDirection = 'counter-clockwise'; + * } + * + * print(rotateDirection); + * describe('no image to display.'); + * + *
                    + * + * @property {Number} pRotationX + * @readOnly + */ + _main.default.prototype.pRotationX = 0; + /** + * The system variable pRotationY always contains the rotation of the + * device along the y axis in the frame previous to the current frame. + * If the sketch angleMode() is set to DEGREES, + * the value will be -90 to 90. If it is set to RADIANS, the value will + * be -PI/2 to PI/2. + * + * pRotationY can also be used with rotationY to determine the rotate + * direction of the device along the Y-axis. + * @example + *
                    + * + * // A simple if statement looking at whether + * // rotationY - pRotationY < 0 is true or not will be + * // sufficient for determining the rotate direction + * // in most cases. + * + * // Some extra logic is needed to account for cases where + * // the angles wrap around. + * let rotateDirection = 'clockwise'; + * + * // Simple range conversion to make things simpler. + * // This is not absolutely necessary but the logic + * // will be different in that case. + * + * let rY = rotationY + 180; + * let pRY = pRotationY + 180; + * + * if ((rY - pRY > 0 && rY - pRY < 270) || rY - pRY < -270) { + * rotateDirection = 'clockwise'; + * } else if (rY - pRY < 0 || rY - pRY > 270) { + * rotateDirection = 'counter-clockwise'; + * } + * print(rotateDirection); + * describe('no image to display.'); + * + *
                    + * + * @property {Number} pRotationY + * @readOnly + */ + _main.default.prototype.pRotationY = 0; + /** + * The system variable pRotationZ always contains the rotation of the + * device along the z axis in the frame previous to the current frame. + * If the sketch angleMode() is set to DEGREES, + * the value will be 0 to 360. If it is set to RADIANS, the value will + * be 0 to 2*PI. + * + * pRotationZ can also be used with rotationZ to determine the rotate + * direction of the device along the Z-axis. + * @example + *
                    + * + * // A simple if statement looking at whether + * // rotationZ - pRotationZ < 0 is true or not will be + * // sufficient for determining the rotate direction + * // in most cases. + * + * // Some extra logic is needed to account for cases where + * // the angles wrap around. + * let rotateDirection = 'clockwise'; + * + * if ( + * (rotationZ - pRotationZ > 0 && rotationZ - pRotationZ < 270) || + * rotationZ - pRotationZ < -270 + * ) { + * rotateDirection = 'clockwise'; + * } else if (rotationZ - pRotationZ < 0 || rotationZ - pRotationZ > 270) { + * rotateDirection = 'counter-clockwise'; + * } + * print(rotateDirection); + * describe('no image to display.'); + * + *
                    + * + * @property {Number} pRotationZ + * @readOnly + */ + _main.default.prototype.pRotationZ = 0; + var startAngleX = 0; + var startAngleY = 0; + var startAngleZ = 0; + var rotateDirectionX = "clockwise"; + var rotateDirectionY = "clockwise"; + var rotateDirectionZ = "clockwise"; + _main.default.prototype.pRotateDirectionX = undefined; + _main.default.prototype.pRotateDirectionY = undefined; + _main.default.prototype.pRotateDirectionZ = undefined; + _main.default.prototype._updatePRotations = function () { + this._setProperty("pRotationX", this.rotationX); + this._setProperty("pRotationY", this.rotationY); + this._setProperty("pRotationZ", this.rotationZ); + }; + /** + * When a device is rotated, the axis that triggers the deviceTurned() + * method is stored in the turnAxis variable. The turnAxis variable is only defined within + * the scope of deviceTurned(). + * @property {String} turnAxis + * @readOnly + * @example + *
                    + * + * // Run this example on a mobile device + * // Rotate the device by 90 degrees in the + * // X-axis to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device turns`); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when x-axis turns`); + * } + * function deviceTurned() { + * if (turnAxis === 'X') { + * if (value === 0) { + * value = 255; + * } else if (value === 255) { + * value = 0; + * } + * } + * } + * + *
                    + */ + _main.default.prototype.turnAxis = undefined; + var move_threshold = 0.5; + var shake_threshold = 30; + /** + * The setMoveThreshold() function is used to set the movement threshold for + * the deviceMoved() function. The default threshold is set to 0.5. + * + * @method setMoveThreshold + * @param {number} value The threshold value + * @example + *
                    + * + * // Run this example on a mobile device + * // You will need to move the device incrementally further + * // the closer the square's color gets to white in order to change the value. + * + * let value = 0; + * let threshold = 0.5; + * function setup() { + * setMoveThreshold(threshold); + * } + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device moves`); + * } + * function deviceMoved() { + * value = value + 5; + * threshold = threshold + 0.1; + * if (value > 255) { + * value = 0; + * threshold = 30; + * } + * setMoveThreshold(threshold); + * } + * + *
                    + */ + _main.default.prototype.setMoveThreshold = function (val) { + _main.default._validateParameters("setMoveThreshold", arguments); + move_threshold = val; + }; + /** + * The setShakeThreshold() function is used to set the movement threshold for + * the deviceShaken() function. The default threshold is set to 30. + * + * @method setShakeThreshold + * @param {number} value The threshold value + * @example + *
                    + * + * // Run this example on a mobile device + * // You will need to shake the device more firmly + * // the closer the box's fill gets to white in order to change the value. + * + * let value = 0; + * let threshold = 30; + * function setup() { + * setShakeThreshold(threshold); + * } + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device is being shaked`); + * } + * function deviceMoved() { + * value = value + 5; + * threshold = threshold + 5; + * if (value > 255) { + * value = 0; + * threshold = 30; + * } + * setShakeThreshold(threshold); + * } + * + *
                    + */ + _main.default.prototype.setShakeThreshold = function (val) { + _main.default._validateParameters("setShakeThreshold", arguments); + shake_threshold = val; + }; + /** + * The deviceMoved() function is called when the device is moved by more than + * the threshold value along X, Y or Z axis. The default threshold is set to 0.5. + * The threshold value can be changed using setMoveThreshold(). + * + * @method deviceMoved + * @example + *
                    + * + * // Run this example on a mobile device + * // Move the device around + * // to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device moves`); + * } + * function deviceMoved() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                    + */ + /** + * The deviceTurned() function is called when the device rotates by + * more than 90 degrees continuously. + * + * The axis that triggers the deviceTurned() method is stored in the turnAxis + * variable. The deviceTurned() method can be locked to trigger on any axis: + * X, Y or Z by comparing the turnAxis variable to 'X', 'Y' or 'Z'. + * + * @method deviceTurned + * @example + *
                    + * + * // Run this example on a mobile device + * // Rotate the device by 90 degrees + * // to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device turns`); + * } + * function deviceTurned() { + * if (value === 0) { + * value = 255; + * } else if (value === 255) { + * value = 0; + * } + * } + * + *
                    + *
                    + * + * // Run this example on a mobile device + * // Rotate the device by 90 degrees in the + * // X-axis to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when x-axis turns`); + * } + * function deviceTurned() { + * if (turnAxis === 'X') { + * if (value === 0) { + * value = 255; + * } else if (value === 255) { + * value = 0; + * } + * } + * } + * + *
                    + */ + /** + * The deviceShaken() function is called when the device total acceleration + * changes of accelerationX and accelerationY values is more than + * the threshold value. The default threshold is set to 30. + * The threshold value can be changed using setShakeThreshold(). + * + * @method deviceShaken + * @example + *
                    + * + * // Run this example on a mobile device + * // Shake the device to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device shakes`); + * } + * function deviceShaken() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                    + */ + _main.default.prototype._ondeviceorientation = function (e) { + this._updatePRotations(); + if (this._angleMode === constants.radians) { + e.beta = e.beta * (_PI / 180); + e.gamma = e.gamma * (_PI / 180); + e.alpha = e.alpha * (_PI / 180); + } + this._setProperty("rotationX", e.beta); + this._setProperty("rotationY", e.gamma); + this._setProperty("rotationZ", e.alpha); + this._handleMotion(); + }; + _main.default.prototype._ondevicemotion = function (e) { + this._updatePAccelerations(); + this._setProperty("accelerationX", e.acceleration.x * 2); + this._setProperty("accelerationY", e.acceleration.y * 2); + this._setProperty("accelerationZ", e.acceleration.z * 2); + this._handleMotion(); + }; + _main.default.prototype._handleMotion = function () { + if (window.orientation === 90 || window.orientation === -90) { + this._setProperty("deviceOrientation", "landscape"); + } else if (window.orientation === 0) { + this._setProperty("deviceOrientation", "portrait"); + } else if (window.orientation === undefined) { + this._setProperty("deviceOrientation", "undefined"); + } + var context = this._isGlobal ? window : this; + if (typeof context.deviceMoved === "function") { + if ( + Math.abs(this.accelerationX - this.pAccelerationX) > + move_threshold || + Math.abs(this.accelerationY - this.pAccelerationY) > + move_threshold || + Math.abs(this.accelerationZ - this.pAccelerationZ) > + move_threshold + ) { + context.deviceMoved(); + } + } + if (typeof context.deviceTurned === "function") { + // The angles given by rotationX etc is from range -180 to 180. + // The following will convert them to 0 to 360 for ease of calculation + // of cases when the angles wrapped around. + // _startAngleX will be converted back at the end and updated. + var wRX = this.rotationX + 180; + var wPRX = this.pRotationX + 180; + var wSAX = startAngleX + 180; + if ((wRX - wPRX > 0 && wRX - wPRX < 270) || wRX - wPRX < -270) { + rotateDirectionX = "clockwise"; + } else if (wRX - wPRX < 0 || wRX - wPRX > 270) { + rotateDirectionX = "counter-clockwise"; + } + if (rotateDirectionX !== this.pRotateDirectionX) { + wSAX = wRX; + } + if (Math.abs(wRX - wSAX) > 90 && Math.abs(wRX - wSAX) < 270) { + wSAX = wRX; + this._setProperty("turnAxis", "X"); + context.deviceTurned(); + } + this.pRotateDirectionX = rotateDirectionX; + startAngleX = wSAX - 180; + // Y-axis is identical to X-axis except for changing some names. + var wRY = this.rotationY + 180; + var wPRY = this.pRotationY + 180; + var wSAY = startAngleY + 180; + if ((wRY - wPRY > 0 && wRY - wPRY < 270) || wRY - wPRY < -270) { + rotateDirectionY = "clockwise"; + } else if (wRY - wPRY < 0 || wRY - this.pRotationY > 270) { + rotateDirectionY = "counter-clockwise"; + } + if (rotateDirectionY !== this.pRotateDirectionY) { + wSAY = wRY; + } + if (Math.abs(wRY - wSAY) > 90 && Math.abs(wRY - wSAY) < 270) { + wSAY = wRY; + this._setProperty("turnAxis", "Y"); + context.deviceTurned(); + } + this.pRotateDirectionY = rotateDirectionY; + startAngleY = wSAY - 180; + // Z-axis is already in the range 0 to 360 + // so no conversion is needed. + if ( + (this.rotationZ - this.pRotationZ > 0 && + this.rotationZ - this.pRotationZ < 270) || + this.rotationZ - this.pRotationZ < -270 + ) { + rotateDirectionZ = "clockwise"; + } else if ( + this.rotationZ - this.pRotationZ < 0 || + this.rotationZ - this.pRotationZ > 270 + ) { + rotateDirectionZ = "counter-clockwise"; + } + if (rotateDirectionZ !== this.pRotateDirectionZ) { + startAngleZ = this.rotationZ; + } + if ( + Math.abs(this.rotationZ - startAngleZ) > 90 && + Math.abs(this.rotationZ - startAngleZ) < 270 + ) { + startAngleZ = this.rotationZ; + this._setProperty("turnAxis", "Z"); + context.deviceTurned(); + } + this.pRotateDirectionZ = rotateDirectionZ; + this._setProperty("turnAxis", undefined); + } + if (typeof context.deviceShaken === "function") { + var accelerationChangeX; + var accelerationChangeY; + // Add accelerationChangeZ if acceleration change on Z is needed + if (this.pAccelerationX !== null) { + accelerationChangeX = Math.abs( + this.accelerationX - this.pAccelerationX, + ); + accelerationChangeY = Math.abs( + this.accelerationY - this.pAccelerationY, + ); + } + if (accelerationChangeX + accelerationChangeY > shake_threshold) { + context.deviceShaken(); + } + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 316: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Events + * @submodule Keyboard + * @for p5 + * @requires core + */ + /** + * The boolean system variable keyIsPressed is true if any key is pressed + * and false if no keys are pressed. + * + * @property {Boolean} keyIsPressed + * @readOnly + * @example + *
                    + * + * function draw() { + * if (keyIsPressed === true) { + * fill(0); + * } else { + * fill(255); + * } + * rect(25, 25, 50, 50); + * describe('50-by-50 white rect that turns black on keypress.'); + * } + * + *
                    + */ + + _main.default.prototype.isKeyPressed = false; + _main.default.prototype.keyIsPressed = false; // khan + /** + * The system variable key always contains the value of the most recent + * key on the keyboard that was typed. To get the proper capitalization, it + * is best to use it within keyTyped(). For non-ASCII keys, use the keyCode + * variable. + * + * @property {String} key + * @readOnly + * @example + *
                    + * // Click any key to display it! + * // (Not Guaranteed to be Case Sensitive) + * function setup() { + * fill(245, 123, 158); + * textSize(50); + * } + * + * function draw() { + * background(200); + * text(key, 33, 65); // Display last key pressed. + * describe('canvas displays any key value that is pressed in pink font.'); + * } + *
                    + */ + _main.default.prototype.key = ""; + /** + * The variable keyCode is used to detect special keys such as BACKSPACE, + * DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, OPTION, ALT, UP_ARROW, + * DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. + * You can also check for custom keys by looking up the keyCode of any key + * on a site like this: keycode.info. + * + * @property {Integer} keyCode + * @readOnly + * @example + *
                    + * let fillVal = 126; + * function draw() { + * fill(fillVal); + * rect(25, 25, 50, 50); + * describe(`Grey rect center. turns white when up arrow pressed and black when down. + * Display key pressed and its keyCode in a yellow box.`); + * } + * + * function keyPressed() { + * if (keyCode === UP_ARROW) { + * fillVal = 255; + * } else if (keyCode === DOWN_ARROW) { + * fillVal = 0; + * } + * } + *
                    + *
                    + * function draw() {} + * function keyPressed() { + * background('yellow'); + * text(`${key} ${keyCode}`, 10, 40); + * print(key, ' ', keyCode); + * } + *
                    + */ + _main.default.prototype.keyCode = 0; + /** + * The keyPressed() function is called once every time a key is pressed. The + * keyCode for the key that was pressed is stored in the keyCode variable. + * + * For non-ASCII keys, use the keyCode variable. You can check if the keyCode + * equals BACKSPACE, DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, + * OPTION, ALT, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. + * + * For ASCII keys, the key that was pressed is stored in the key variable. However, it + * does not distinguish between uppercase and lowercase. For this reason, it + * is recommended to use keyTyped() to read the key variable, in which the + * case of the variable will be distinguished. + * + * Because of how operating systems handle key repeats, holding down a key + * may cause multiple calls to keyTyped() (and keyReleased() as well). The + * rate of repeat is set by the operating system and how each computer is + * configured.

                    + * Browsers may have different default + * behaviors attached to various key events. To prevent any default + * behavior for this event, add "return false" to the end of the method. + * + * @method keyPressed + * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. + * @example + *
                    + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when key pressed and black + * when released.`); + * } + * function keyPressed() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                    + *
                    + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when left arrow pressed and + * black when right.`); + * } + * function keyPressed() { + * if (keyCode === LEFT_ARROW) { + * value = 255; + * } else if (keyCode === RIGHT_ARROW) { + * value = 0; + * } + * } + * + *
                    + *
                    + * + * function keyPressed() { + * // Do something + * return false; // prevent any default behaviour + * } + * + *
                    + */ + _main.default.prototype._onkeydown = function (e) { + if (this._downKeys[e.which]) { + // prevent multiple firings + return; + } + this._setProperty("isKeyPressed", true); + this._setProperty("keyIsPressed", true); + this._setProperty("keyCode", e.which); + this._downKeys[e.which] = true; + this._setProperty( + "key", + e.key || String.fromCharCode(e.which) || e.which, + ); + var context = this._isGlobal ? window : this; + if (typeof context.keyPressed === "function" && !e.charCode) { + var executeDefault = context.keyPressed(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The keyReleased() function is called once every time a key is released. + * See key and keyCode for more information.

                    + * Browsers may have different default + * behaviors attached to various key events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method keyReleased + * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. + * @example + *
                    + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when key pressed and black + * when pressed again`); + * } + * function keyReleased() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * return false; // prevent any default behavior + * } + * + *
                    + */ + _main.default.prototype._onkeyup = function (e) { + this._downKeys[e.which] = false; + if (!this._areDownKeys()) { + this._setProperty("isKeyPressed", false); + this._setProperty("keyIsPressed", false); + } + this._setProperty("_lastKeyCodeTyped", null); + this._setProperty( + "key", + e.key || String.fromCharCode(e.which) || e.which, + ); + this._setProperty("keyCode", e.which); + var context = this._isGlobal ? window : this; + if (typeof context.keyReleased === "function") { + var executeDefault = context.keyReleased(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The keyTyped() function is called once every time a key is pressed, but + * action keys such as Backspace, Delete, Ctrl, Shift, and Alt are ignored. If you are trying to detect + * a keyCode for one of these keys, use the keyPressed() function instead. + * The most recent key typed will be stored in the key variable. + * + * Because of how operating systems handle key repeats, holding down a key + * will cause multiple calls to keyTyped() (and keyReleased() as well). The + * rate of repeat is set by the operating system and how each computer is + * configured.

                    + * Browsers may have different default behaviors attached to various key + * events. To prevent any default behavior for this event, add "return false" + * to the end of the function. + * + * @method keyTyped + * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. + * @example + *
                    + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when 'a' key typed and + * black when 'b' pressed`); + * } + * function keyTyped() { + * if (key === 'a') { + * value = 255; + * } else if (key === 'b') { + * value = 0; + * } + * // uncomment to prevent any default behavior + * // return false; + * } + * + *
                    + */ + _main.default.prototype._onkeypress = function (e) { + if (e.which === this._lastKeyCodeTyped) { + // prevent multiple firings + return; + } + this._setProperty("_lastKeyCodeTyped", e.which); // track last keyCode + this._setProperty( + "key", + e.key || String.fromCharCode(e.which) || e.which, + ); + var context = this._isGlobal ? window : this; + if (typeof context.keyTyped === "function") { + var executeDefault = context.keyTyped(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The onblur function is called when the user is no longer focused + * on the p5 element. Because the keyup events will not fire if the user is + * not focused on the element we must assume all keys currently down have + * been released. + */ + _main.default.prototype._onblur = function (e) { + this._downKeys = {}; + }; + /** + * The keyIsDown() function checks if the key is currently down, i.e. pressed. + * It can be used if you have an object that moves, and you want several keys + * to be able to affect its behaviour simultaneously, such as moving a + * sprite diagonally. You can put in any number representing the keyCode of + * the key, or use any of the variable keyCode names listed + * here. + * + * @method keyIsDown + * @param {Number} code The key to check for. + * @return {Boolean} whether key is down or not + * @example + *
                    + * let x = 100; + * let y = 100; + * + * function setup() { + * createCanvas(512, 512); + * fill(255, 0, 0); + * } + * + * function draw() { + * if (keyIsDown(LEFT_ARROW)) { + * x -= 5; + * } + * + * if (keyIsDown(RIGHT_ARROW)) { + * x += 5; + * } + * + * if (keyIsDown(UP_ARROW)) { + * y -= 5; + * } + * + * if (keyIsDown(DOWN_ARROW)) { + * y += 5; + * } + * + * clear(); + * ellipse(x, y, 50, 50); + * describe(`50-by-50 red ellipse moves left, right, up, and + * down with arrow presses.`); + * } + *
                    + * + *
                    + * let diameter = 50; + * + * function setup() { + * createCanvas(512, 512); + * } + * + * function draw() { + * // 107 and 187 are keyCodes for "+" + * if (keyIsDown(107) || keyIsDown(187)) { + * diameter += 1; + * } + * + * // 109 and 189 are keyCodes for "-" + * if (keyIsDown(109) || keyIsDown(189)) { + * diameter -= 1; + * } + * + * clear(); + * fill(255, 0, 0); + * ellipse(50, 50, diameter, diameter); + * describe(`50-by-50 red ellipse gets bigger or smaller when + * + or - are pressed.`); + * } + *
                    + */ + _main.default.prototype.keyIsDown = function (code) { + _main.default._validateParameters("keyIsDown", arguments); + return this._downKeys[code] || false; + }; + /** + * The _areDownKeys function returns a boolean true if any keys pressed + * and a false if no keys are currently pressed. - _main.default.Texture = /*#__PURE__*/ function () { - function Texture(renderer, obj, settings) { - _classCallCheck(this, Texture); - this._renderer = renderer; - var gl = this._renderer.GL; - settings = settings || { - }; - this.src = obj; - this.glTex = undefined; - this.glTarget = gl.TEXTURE_2D; - this.glFormat = settings.format || gl.RGBA; - this.mipmaps = false; - this.glMinFilter = settings.minFilter || gl.LINEAR; - this.glMagFilter = settings.magFilter || gl.LINEAR; - this.glWrapS = settings.wrapS || gl.CLAMP_TO_EDGE; - this.glWrapT = settings.wrapT || gl.CLAMP_TO_EDGE; - this.glDataType = settings.dataType || gl.UNSIGNED_BYTE; - var support = checkWebGLCapabilities(renderer); - if (this.glFormat === gl.HALF_FLOAT && !support.halfFloat) { - console.log('This device does not support dataType HALF_FLOAT. Falling back to FLOAT.'); - this.glDataType = gl.FLOAT; - } - if (this.glFormat === gl.HALF_FLOAT && (this.glMinFilter === gl.LINEAR || this.glMagFilter === gl.LINEAR) && !support.halfFloatLinear) { - console.log('This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.'); - if (this.glMinFilter === gl.LINEAR) this.glMinFilter = gl.NEAREST; - if (this.glMagFilter === gl.LINEAR) this.glMagFilter = gl.NEAREST; - } - if (this.glFormat === gl.FLOAT && !support.float) { - console.log('This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE.'); - this.glDataType = gl.UNSIGNED_BYTE; - } - if (this.glFormat === gl.FLOAT && (this.glMinFilter === gl.LINEAR || this.glMagFilter === gl.LINEAR) && !support.floatLinear) { - console.log('This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.'); - if (this.glMinFilter === gl.LINEAR) this.glMinFilter = gl.NEAREST; - if (this.glMagFilter === gl.LINEAR) this.glMagFilter = gl.NEAREST; - } // used to determine if this texture might need constant updating - // because it is a video or gif. - - this.isSrcMediaElement = typeof _main.default.MediaElement !== 'undefined' && obj instanceof _main.default.MediaElement; - this._videoPrevUpdateTime = 0; - this.isSrcHTMLElement = typeof _main.default.Element !== 'undefined' && obj instanceof _main.default.Element && !(obj instanceof _main.default.Graphics) && !(obj instanceof _main.default.Renderer); - this.isSrcP5Image = obj instanceof _main.default.Image; - this.isSrcP5Graphics = obj instanceof _main.default.Graphics; - this.isSrcP5Renderer = obj instanceof _main.default.Renderer; - this.isImageData = typeof ImageData !== 'undefined' && obj instanceof ImageData; - this.isFramebufferTexture = obj instanceof _main.default.FramebufferTexture; - var textureData = this._getTextureDataFromSource(); - this.width = textureData.width; - this.height = textureData.height; - this.init(textureData); - return this; - } - _createClass(Texture, [ - { - key: '_getTextureDataFromSource', - value: function _getTextureDataFromSource() { - var textureData; - if (this.isFramebufferTexture) { - textureData = this.src.rawTexture(); - } else if (this.isSrcP5Image) { - // param is a p5.Image - textureData = this.src.canvas; - } else if (this.isSrcMediaElement || this.isSrcP5Graphics || this.isSrcP5Renderer || this.isSrcHTMLElement) { - // if param is a video HTML element - textureData = this.src.elt; - } else if (this.isImageData) { - textureData = this.src; - } - return textureData; - } /** - * Initializes common texture parameters, creates a gl texture, - * tries to upload the texture for the first time if data is - * already available. - * @private - * @method init - */ - - }, - { - key: 'init', - value: function init(data) { - var gl = this._renderer.GL; - if (!this.isFramebufferTexture) { - this.glTex = gl.createTexture(); - } - this.glWrapS = this._renderer.textureWrapX; - this.glWrapT = this._renderer.textureWrapY; - this.setWrapMode(this.glWrapS, this.glWrapT); - this.bindTexture(); - //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); - if (this.isFramebufferTexture) { - // Do nothing, the framebuffer manages its own content - } else if (this.width === 0 || this.height === 0 || this.isSrcMediaElement && !this.src.loadedmetadata) { - // assign a 1×1 empty texture initially, because data is not yet ready, - // so that no errors occur in gl console! - var tmpdata = new Uint8Array([1, - 1, - 1, - 1]); - gl.texImage2D(this.glTarget, 0, gl.RGBA, 1, 1, 0, this.glFormat, this.glDataType, tmpdata); - } else { - // data is ready: just push the texture! - gl.texImage2D(this.glTarget, 0, this.glFormat, this.glFormat, this.glDataType, data); - } - } /** - * Checks if the source data for this texture has changed (if it's - * easy to do so) and reuploads the texture if necessary. If it's not - * possible or to expensive to do a calculation to determine wheter or - * not the data has occurred, this method simply re-uploads the texture. - * @method update - */ - - }, - { - key: 'update', - value: function update() { - var data = this.src; - if (data.width === 0 || data.height === 0) { - return false; // nothing to do! - } // FramebufferTexture instances wrap raw WebGL textures already, which - // don't need any extra updating, as they already live on the GPU - - if (this.isFramebufferTexture) { - return false; - } - var textureData = this._getTextureDataFromSource(); - var updated = false; - var gl = this._renderer.GL; - // pull texture from data, make sure width & height are appropriate - if (textureData.width !== this.width || textureData.height !== this.height) { - updated = true; - // make sure that if the width and height of this.src have changed - // for some reason, we update our metadata and upload the texture again - this.width = textureData.width || data.width; - this.height = textureData.height || data.height; - if (this.isSrcP5Image) { - data.setModified(false); - } else if (this.isSrcMediaElement || this.isSrcHTMLElement) { - // on the first frame the metadata comes in, the size will be changed - // from 0 to actual size, but pixels may not be available. - // flag for update in a future frame. - // if we don't do this, a paused video, for example, may not - // send the first frame to texture memory. - data.setModified(true); - } - } else if (this.isSrcP5Image) { - // for an image, we only update if the modified field has been set, - // for example, by a call to p5.Image.set - if (data.isModified()) { - updated = true; - data.setModified(false); - } - } else if (this.isSrcMediaElement) { - // for a media element (video), we'll check if the current time in - // the video frame matches the last time. if it doesn't match, the - // video has advanced or otherwise been taken to a new frame, - // and we need to upload it. - if (data.isModified()) { - // p5.MediaElement may have also had set/updatePixels, etc. called - // on it and should be updated, or may have been set for the first - // time! - updated = true; - data.setModified(false); - } else if (data.loadedmetadata) { - // if the meta data has been loaded, we can ask the video - // what it's current position (in time) is. - if (this._videoPrevUpdateTime !== data.time()) { - // update the texture in gpu mem only if the current - // video timestamp does not match the timestamp of the last - // time we uploaded this texture (and update the time we - // last uploaded, too) - this._videoPrevUpdateTime = data.time(); - updated = true; - } - } - } else if (this.isImageData) { - if (data._dirty) { - data._dirty = false; - updated = true; - } - } else { - /* data instanceof p5.Graphics, probably */ - // there is not enough information to tell if the texture can be - // conditionally updated; so to be safe, we just go ahead and upload it. - updated = true; - } - if (updated) { - this.bindTexture(); - gl.texImage2D(this.glTarget, 0, this.glFormat, this.glFormat, this.glDataType, textureData); - } - return updated; - } /** - * Binds the texture to the appropriate GL target. - * @method bindTexture - */ - - }, - { - key: 'bindTexture', - value: function bindTexture() { - // bind texture using gl context + glTarget and - // generated gl texture object - var gl = this._renderer.GL; - gl.bindTexture(this.glTarget, this.getTexture()); - return this; - } /** - * Unbinds the texture from the appropriate GL target. - * @method unbindTexture - */ - - }, - { - key: 'unbindTexture', - value: function unbindTexture() { - // unbind per above, disable texturing on glTarget - var gl = this._renderer.GL; - gl.bindTexture(this.glTarget, null); - } - }, - { - key: 'getTexture', - value: function getTexture() { - if (this.isFramebufferTexture) { - return this.src.rawTexture(); - } else { - return this.glTex; - } - } /** - * Sets how a texture is be interpolated when upscaled or downscaled. - * Nearest filtering uses nearest neighbor scaling when interpolating - * Linear filtering uses WebGL's linear scaling when interpolating - * @method setInterpolation - * @param {String} downScale Specifies the texture filtering when - * textures are shrunk. Options are LINEAR or NEAREST - * @param {String} upScale Specifies the texture filtering when - * textures are magnified. Options are LINEAR or NEAREST - * @todo implement mipmapping filters - */ - - }, - { - key: 'setInterpolation', - value: function setInterpolation(downScale, upScale) { - var gl = this._renderer.GL; - this.glMinFilter = this.glFilter(downScale); - this.glMagFilter = this.glFilter(upScale); - this.bindTexture(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); - this.unbindTexture(); - } - }, - { - key: 'glFilter', - value: function glFilter(filter) { - var gl = this._renderer.GL; - if (filter === constants.NEAREST) { - return gl.NEAREST; - } else { - return gl.LINEAR; - } - } /** - * Sets the texture wrapping mode. This controls how textures behave - * when their uv's go outside of the 0 - 1 range. There are three options: - * CLAMP, REPEAT, and MIRROR. REPEAT & MIRROR are only available if the texture - * is a power of two size (128, 256, 512, 1024, etc.). - * @method setWrapMode - * @param {String} wrapX Controls the horizontal texture wrapping behavior - * @param {String} wrapY Controls the vertical texture wrapping behavior - */ - - }, - { - key: 'setWrapMode', - value: function setWrapMode(wrapX, wrapY) { - var gl = this._renderer.GL; - // for webgl 1 we need to check if the texture is power of two - // if it isn't we will set the wrap mode to CLAMP - // webgl2 will support npot REPEAT and MIRROR but we don't check for it yet - var isPowerOfTwo = function isPowerOfTwo(x) { - return (x & x - 1) === 0; - }; - var textureData = this._getTextureDataFromSource(); - var wrapWidth; - var wrapHeight; - if (textureData.naturalWidth && textureData.naturalHeight) { - wrapWidth = textureData.naturalWidth; - wrapHeight = textureData.naturalHeight; - } else { - wrapWidth = this.width; - wrapHeight = this.height; - } - var widthPowerOfTwo = isPowerOfTwo(wrapWidth); - var heightPowerOfTwo = isPowerOfTwo(wrapHeight); - if (wrapX === constants.REPEAT) { - if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { - this.glWrapS = gl.REPEAT; - } else { - console.warn('You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead'); - this.glWrapS = gl.CLAMP_TO_EDGE; - } - } else if (wrapX === constants.MIRROR) { - if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { - this.glWrapS = gl.MIRRORED_REPEAT; - } else { - console.warn('You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead'); - this.glWrapS = gl.CLAMP_TO_EDGE; - } - } else { - // falling back to default if didn't get a proper mode - this.glWrapS = gl.CLAMP_TO_EDGE; - } - if (wrapY === constants.REPEAT) { - if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { - this.glWrapT = gl.REPEAT; - } else { - console.warn('You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead'); - this.glWrapT = gl.CLAMP_TO_EDGE; - } - } else if (wrapY === constants.MIRROR) { - if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { - this.glWrapT = gl.MIRRORED_REPEAT; - } else { - console.warn('You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead'); - this.glWrapT = gl.CLAMP_TO_EDGE; - } - } else { - // falling back to default if didn't get a proper mode - this.glWrapT = gl.CLAMP_TO_EDGE; - } - this.bindTexture(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.glWrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.glWrapT); - this.unbindTexture(); - } - } - ]); - return Texture; - }(); - var MipmapTexture = /*#__PURE__*/ function (_p5$Texture) { - _inherits(MipmapTexture, _p5$Texture); - var _super = _createSuper(MipmapTexture); - function MipmapTexture(renderer, levels, settings) { - var _this; - _classCallCheck(this, MipmapTexture); - _this = _super.call(this, renderer, levels, settings); - var gl = _this._renderer.GL; - if (_this.glMinFilter === gl.LINEAR) { - _this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; - } - return _this; - } - _createClass(MipmapTexture, [ - { - key: 'glFilter', - value: function glFilter(_filter) { - var gl = this._renderer.GL; - // TODO: support others - return gl.LINEAR_MIPMAP_LINEAR; - } - }, - { - key: '_getTextureDataFromSource', - value: function _getTextureDataFromSource() { - return this.src; - } - }, - { - key: 'init', - value: function init(levels) { - var gl = this._renderer.GL; - this.glTex = gl.createTexture(); - this.bindTexture(); - for (var level = 0; level < levels.length; level++) { - gl.texImage2D(this.glTarget, level, this.glFormat, this.glFormat, this.glDataType, levels[level]); - } - this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); - this.unbindTexture(); - } - }, - { - key: 'update', - value: function update() { - } - } - ]); - return MipmapTexture; - }(_main.default.Texture); - exports.MipmapTexture = MipmapTexture; - function checkWebGLCapabilities(_ref) { - var GL = _ref.GL, - webglVersion = _ref.webglVersion; - var gl = GL; - var supportsFloat = webglVersion === constants.WEBGL2 ? gl.getExtension('EXT_color_buffer_float') && gl.getExtension('EXT_float_blend') : gl.getExtension('OES_texture_float'); - var supportsFloatLinear = supportsFloat && gl.getExtension('OES_texture_float_linear'); - var supportsHalfFloat = webglVersion === constants.WEBGL2 ? gl.getExtension('EXT_color_buffer_float') : gl.getExtension('OES_texture_half_float'); - var supportsHalfFloatLinear = supportsHalfFloat && gl.getExtension('OES_texture_half_float_linear'); - return { - float: supportsFloat, - floatLinear: supportsFloatLinear, - halfFloat: supportsHalfFloat, - halfFloatLinear: supportsHalfFloatLinear - }; - } - var _default = _main.default.Texture; - exports.default = _default; - }, - { - '../core/constants': 286, - '../core/main': 298, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.get-prototype-of': 198, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.reflect.construct': 202, - 'core-js/modules/es.regexp.to-string': 206, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.typed-array.copy-within': 223, - 'core-js/modules/es.typed-array.every': 224, - 'core-js/modules/es.typed-array.fill': 225, - 'core-js/modules/es.typed-array.filter': 226, - 'core-js/modules/es.typed-array.find': 228, - 'core-js/modules/es.typed-array.find-index': 227, - 'core-js/modules/es.typed-array.for-each': 231, - 'core-js/modules/es.typed-array.includes': 232, - 'core-js/modules/es.typed-array.index-of': 233, - 'core-js/modules/es.typed-array.iterator': 236, - 'core-js/modules/es.typed-array.join': 237, - 'core-js/modules/es.typed-array.last-index-of': 238, - 'core-js/modules/es.typed-array.map': 239, - 'core-js/modules/es.typed-array.reduce': 241, - 'core-js/modules/es.typed-array.reduce-right': 240, - 'core-js/modules/es.typed-array.reverse': 242, - 'core-js/modules/es.typed-array.set': 243, - 'core-js/modules/es.typed-array.slice': 244, - 'core-js/modules/es.typed-array.some': 245, - 'core-js/modules/es.typed-array.sort': 246, - 'core-js/modules/es.typed-array.subarray': 247, - 'core-js/modules/es.typed-array.to-locale-string': 248, - 'core-js/modules/es.typed-array.to-string': 249, - 'core-js/modules/es.typed-array.uint8-array': 252, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 358: [ - function (_dereq_, module, exports) { - 'use strict'; - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.get-own-property-descriptor'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.sub'); - _dereq_('core-js/modules/es.weak-map'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - function _typeof2(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_('core-js/modules/es.symbol'); - _dereq_('core-js/modules/es.symbol.description'); - _dereq_('core-js/modules/es.symbol.iterator'); - _dereq_('core-js/modules/es.array.iterator'); - _dereq_('core-js/modules/es.object.to-string'); - _dereq_('core-js/modules/es.regexp.exec'); - _dereq_('core-js/modules/es.string.iterator'); - _dereq_('core-js/modules/es.string.split'); - _dereq_('core-js/modules/es.string.sub'); - _dereq_('core-js/modules/web.dom-collections.iterator'); - var _main = _interopRequireDefault(_dereq_('../core/main')); - var constants = _interopRequireWildcard(_dereq_('../core/constants')); - _dereq_('./p5.Shader'); - _dereq_('./p5.RendererGL.Retained'); - function _getRequireWildcardCache() { - if (typeof WeakMap !== 'function') return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { - return { - default: - obj - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = { - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } // Text/Typography - // @TODO: - - _main.default.RendererGL.prototype._applyTextProperties = function () { - //@TODO finish implementation - //console.error('text commands not yet implemented in webgl'); - }; - _main.default.RendererGL.prototype.textWidth = function (s) { - if (this._isOpenType()) { - return this._textFont._textWidth(s, this._textSize); - } - return 0; // TODO: error - }; - // rendering constants - // the number of rows/columns dividing each glyph - var charGridWidth = 9; - var charGridHeight = charGridWidth; - // size of the image holding the bezier stroke info - var strokeImageWidth = 64; - var strokeImageHeight = 64; - // size of the image holding the stroke indices for each row/col - var gridImageWidth = 64; - var gridImageHeight = 64; - // size of the image holding the offset/length of each row/col stripe - var cellImageWidth = 64; - var cellImageHeight = 64; - /** + * Helps avoid instances where multiple keys are pressed simultaneously and + * releasing a single key will then switch the + * keyIsPressed property to true. * @private - * @class ImageInfos - * @param {Integer} width - * @param {Integer} height +**/ + _main.default.prototype._areDownKeys = function () { + for (var key in this._downKeys) { + if ( + this._downKeys.hasOwnProperty(key) && + this._downKeys[key] === true + ) { + return true; + } + } + return false; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + }, + ], + 317: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.string.includes"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Events + * @submodule Mouse + * @for p5 + * @requires core + * @requires constants + */ + /** + * + * The variable movedX contains the horizontal movement of the mouse since the last frame + * @property {Number} movedX + * @readOnly + * @example + *
                    + * + * let x = 50; + * function setup() { + * rectMode(CENTER); + * } + * + * function draw() { + * if (x > 48) { + * x -= 2; + * } else if (x < 48) { + * x += 2; + * } + * x += floor(movedX / 5); + * background(237, 34, 93); + * fill(0); + * rect(x, 50, 50, 50); + * describe(`box moves left and right according to mouse movement + * then slowly back towards the center`); + * } + * + *
                    + */ + + _main.default.prototype.movedX = 0; + /** + * The variable movedY contains the vertical movement of the mouse since the last frame + * @property {Number} movedY + * @readOnly + * @example + *
                    + * + * let y = 50; + * function setup() { + * rectMode(CENTER); + * } + * + * function draw() { + * if (y > 48) { + * y -= 2; + * } else if (y < 48) { + * y += 2; + * } + * y += floor(movedY / 5); + * background(237, 34, 93); + * fill(0); + * rect(50, y, 50, 50); + * describe(`box moves up and down according to mouse movement then + * slowly back towards the center`); + * } + * + *
                    + */ + _main.default.prototype.movedY = 0; + /* + * This is a flag which is false until the first time + * we receive a mouse event. The pmouseX and pmouseY + * values will match the mouseX and mouseY values until + * this interaction takes place. + */ + _main.default.prototype._hasMouseInteracted = false; + /** + * The system variable mouseX always contains the current horizontal + * position of the mouse, relative to (0, 0) of the canvas. The value at + * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. + * If touch is used instead of mouse input, mouseX will hold the x value + * of the most recent touch point. + * + * @property {Number} mouseX + * @readOnly + * + * @example + *
                    + * + * // Move the mouse across the canvas + * function draw() { + * background(244, 248, 252); + * line(mouseX, 0, mouseX, 100); + * describe('horizontal black line moves left and right with mouse x-position'); + * } + * + *
                    + */ + _main.default.prototype.mouseX = 0; + /** + * The system variable mouseY always contains the current vertical + * position of the mouse, relative to (0, 0) of the canvas. The value at + * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. + * If touch is used instead of mouse input, mouseY will hold the y value + * of the most recent touch point. + * + * @property {Number} mouseY + * @readOnly + * + * @example + *
                    + * + * // Move the mouse across the canvas + * function draw() { + * background(244, 248, 252); + * line(0, mouseY, 100, mouseY); + * describe('vertical black line moves up and down with mouse y-position'); + * } + * + *
                    + */ + _main.default.prototype.mouseY = 0; + /** + * The system variable pmouseX always contains the horizontal position of + * the mouse or finger in the frame previous to the current frame, relative to + * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and + * (-width/2, -height/2) for WebGL. Note: pmouseX will be reset to the current mouseX + * value at the start of each touch event. + * + * @property {Number} pmouseX + * @readOnly + * + * @example + *
                    + * + * // Move the mouse across the canvas to leave a trail + * function setup() { + * //slow down the frameRate to make it more visible + * frameRate(10); + * } + * + * function draw() { + * background(244, 248, 252); + * line(mouseX, mouseY, pmouseX, pmouseY); + * print(pmouseX + ' -> ' + mouseX); + * describe(`line trail is created from cursor movements. + * faster movement make longer line.`); + * } + * + *
                    + */ + _main.default.prototype.pmouseX = 0; + /** + * The system variable pmouseY always contains the vertical position of + * the mouse or finger in the frame previous to the current frame, relative to + * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and + * (-width/2, -height/2) for WebGL. Note: pmouseY will be reset to the current mouseY + * value at the start of each touch event. + * + * @property {Number} pmouseY + * @readOnly + * + * @example + *
                    + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * //draw a square only if the mouse is not moving + * if (mouseY === pmouseY && mouseX === pmouseX) { + * rect(20, 20, 60, 60); + * } + * + * print(pmouseY + ' -> ' + mouseY); + * describe(`60-by-60 black rect center, fuchsia background. + * rect flickers on mouse movement`); + * } + * + *
                    + */ + _main.default.prototype.pmouseY = 0; + /** + * The system variable winMouseX always contains the current horizontal + * position of the mouse, relative to (0, 0) of the window. + * + * @property {Number} winMouseX + * @readOnly + * + * @example + *
                    + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * let body = document.getElementsByTagName('body')[0]; + * myCanvas.parent(body); + * } + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * //move the canvas to the horizontal mouse position + * //relative to the window + * myCanvas.position(winMouseX + 1, windowHeight / 2); + * + * //the y of the square is relative to the canvas + * rect(20, mouseY, 60, 60); + * describe(`60-by-60 black rect y moves with mouse y and fuchsia + * canvas moves with mouse x`); + * } + * + *
                    + */ + _main.default.prototype.winMouseX = 0; + /** + * The system variable winMouseY always contains the current vertical + * position of the mouse, relative to (0, 0) of the window. + * + * @property {Number} winMouseY + * @readOnly + * + * @example + *
                    + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * let body = document.getElementsByTagName('body')[0]; + * myCanvas.parent(body); + * } + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * //move the canvas to the vertical mouse position + * //relative to the window + * myCanvas.position(windowWidth / 2, winMouseY + 1); + * + * //the x of the square is relative to the canvas + * rect(mouseX, 20, 60, 60); + * describe(`60-by-60 black rect x moves with mouse x and + * fuchsia canvas y moves with mouse y`); + * } + * + *
                    + */ + _main.default.prototype.winMouseY = 0; + /** + * The system variable pwinMouseX always contains the horizontal position + * of the mouse in the frame previous to the current frame, relative to + * (0, 0) of the window. Note: pwinMouseX will be reset to the current winMouseX + * value at the start of each touch event. + * + * @property {Number} pwinMouseX + * @readOnly + * + * @example + *
                    + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * noStroke(); + * fill(237, 34, 93); + * } + * + * function draw() { + * clear(); + * //the difference between previous and + * //current x position is the horizontal mouse speed + * let speed = abs(winMouseX - pwinMouseX); + * //change the size of the circle + * //according to the horizontal speed + * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); + * //move the canvas to the mouse position + * myCanvas.position(winMouseX + 1, winMouseY + 1); + * describe(`fuchsia ellipse moves with mouse x and y. + * Grows and shrinks with mouse speed`); + * } + * + *
                    + */ + _main.default.prototype.pwinMouseX = 0; + /** + * The system variable pwinMouseY always contains the vertical position of + * the mouse in the frame previous to the current frame, relative to (0, 0) + * of the window. Note: pwinMouseY will be reset to the current winMouseY + * value at the start of each touch event. + * + * @property {Number} pwinMouseY + * @readOnly + * + * @example + *
                    + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * noStroke(); + * fill(237, 34, 93); + * } + * + * function draw() { + * clear(); + * //the difference between previous and + * //current y position is the vertical mouse speed + * let speed = abs(winMouseY - pwinMouseY); + * //change the size of the circle + * //according to the vertical speed + * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); + * //move the canvas to the mouse position + * myCanvas.position(winMouseX + 1, winMouseY + 1); + * describe(`fuchsia ellipse moves with mouse x and y. + * Grows and shrinks with mouse speed`); + * } + * + *
                    + */ + _main.default.prototype.pwinMouseY = 0; + /** + * p5 automatically tracks if the mouse button is pressed and which + * button is pressed. The value of the system variable mouseButton is either + * LEFT, RIGHT, or CENTER depending on which button was pressed last. + * Warning: different browsers may track mouseButton differently. + * + * @property {Constant} mouseButton + * @readOnly + * + * @example + *
                    + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * if (mouseIsPressed === true) { + * if (mouseButton === LEFT) { + * ellipse(50, 50, 50, 50); + * } + * if (mouseButton === RIGHT) { + * rect(25, 25, 50, 50); + * } + * if (mouseButton === CENTER) { + * triangle(23, 75, 50, 20, 78, 75); + * } + * } + * + * print(mouseButton); + * describe(`50-by-50 black ellipse appears on center of fuchsia + * canvas on mouse click/press.`); + * } + * + *
                    + */ + _main.default.prototype.mouseButton = 0; + /** + * The boolean system variable mouseIsPressed is true if the mouse is pressed + * and false if not. + * + * @property {Boolean} mouseIsPressed + * @readOnly + * + * @example + *
                    + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * if (mouseIsPressed === true) { + * ellipse(50, 50, 50, 50); + * } else { + * rect(25, 25, 50, 50); + * } + * + * print(mouseIsPressed); + * describe(`black 50-by-50 rect becomes ellipse with mouse click/press. + * fuchsia background.`); + * } + * + *
                    + */ + _main.default.prototype.mouseIsPressed = false; + _main.default.prototype._updateNextMouseCoords = function (e) { + if ( + this._curElement !== null && + (!e.touches || e.touches.length > 0) + ) { + var mousePos = getMousePos( + this._curElement.elt, + this.width, + this.height, + e, + ); + this._setProperty("movedX", e.movementX); + this._setProperty("movedY", e.movementY); + this._setProperty("mouseX", mousePos.x); + this._setProperty("mouseY", mousePos.y); + this._setProperty("winMouseX", mousePos.winX); + this._setProperty("winMouseY", mousePos.winY); + } + if (!this._hasMouseInteracted) { + // For first draw, make previous and next equal + this._updateMouseCoords(); + this._setProperty("_hasMouseInteracted", true); + } + }; + _main.default.prototype._updateMouseCoords = function () { + this._setProperty("pmouseX", this.mouseX); + this._setProperty("pmouseY", this.mouseY); + this._setProperty("pwinMouseX", this.winMouseX); + this._setProperty("pwinMouseY", this.winMouseY); + this._setProperty("_pmouseWheelDeltaY", this._mouseWheelDeltaY); + }; + function getMousePos(canvas, w, h, evt) { + if (evt && !evt.clientX) { + // use touches if touch and not mouse + if (evt.touches) { + evt = evt.touches[0]; + } else if (evt.changedTouches) { + evt = evt.changedTouches[0]; + } + } + var rect = canvas.getBoundingClientRect(); + var sx = canvas.scrollWidth / w || 1; + var sy = canvas.scrollHeight / h || 1; + return { + x: (evt.clientX - rect.left) / sx, + y: (evt.clientY - rect.top) / sy, + winX: evt.clientX, + winY: evt.clientY, + id: evt.identifier, + }; + } + _main.default.prototype._setMouseButton = function (e) { + if (e.button === 1) { + this._setProperty("mouseButton", constants.CENTER); + } else if (e.button === 2) { + this._setProperty("mouseButton", constants.RIGHT); + } else { + this._setProperty("mouseButton", constants.LEFT); + } + }; + /** + * The mouseMoved() function is called every time the mouse moves and a mouse + * button is not pressed.

                    + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the method. + * + * @method mouseMoved + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                    + * + * // Move the mouse across the page + * // to change its value + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black 50-by-50 rect becomes lighter with mouse movements until + * white then resets no image displayed`); + * } + * function mouseMoved() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function mouseMoved() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                    + * + *
                    + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseMoved(event) { + * console.log(event); + * } + * + *
                    + */ + /** + * The mouseDragged() function is called once every time the mouse moves and + * a mouse button is pressed. If no mouseDragged() function is defined, the + * touchMoved() function will be called instead if it is defined.

                    + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mouseDragged + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                    + * + * // Drag the mouse across the page + * // to change its value + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black 50-by-50 rect turns lighter with mouse click and + * drag until white, resets`); + * } + * function mouseDragged() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function mouseDragged() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                    + * + *
                    + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseDragged(event) { + * console.log(event); + * } + * + *
                    + */ + _main.default.prototype._onmousemove = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._updateNextMouseCoords(e); + if (!this.mouseIsPressed) { + if (typeof context.mouseMoved === "function") { + executeDefault = context.mouseMoved(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + } else { + if (typeof context.mouseDragged === "function") { + executeDefault = context.mouseDragged(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.touchMoved === "function") { + executeDefault = context.touchMoved(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + } + }; + /** + * The mousePressed() function is called once after every time a mouse button + * is pressed. The mouseButton variable (see the related reference entry) + * can be used to determine which button has been pressed. If no + * mousePressed() function is defined, the touchStarted() function will be + * called instead if it is defined.

                    + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mousePressed + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                    + * + * // Click anywhere in the webpage to change + * // the color value of the rectangle + * + * let colorValue = 0; + * function draw() { + * fill(colorValue); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse click/press.'); + * } + * function mousePressed() { + * if (colorValue === 0) { + * colorValue = 255; + * } else { + * colorValue = 0; + * } + * } + * + *
                    + * + *
                    + * + * function mousePressed() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                    + * + *
                    + * + * // returns a MouseEvent object + * // as a callback argument + * function mousePressed(event) { + * console.log(event); + * } + * + *
                    + */ + _main.default.prototype._onmousedown = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._setProperty("mouseIsPressed", true); + this._setMouseButton(e); + this._updateNextMouseCoords(e); + if (typeof context.mousePressed === "function") { + executeDefault = context.mousePressed(e); + if (executeDefault === false) { + e.preventDefault(); + } // only safari needs this manual fallback for consistency + } else if ( + navigator.userAgent.toLowerCase().includes("safari") && + typeof context.touchStarted === "function" + ) { + executeDefault = context.touchStarted(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The mouseReleased() function is called every time a mouse button is + * released. If no mouseReleased() function is defined, the touchEnded() + * function will be called instead if it is defined.

                    + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mouseReleased + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                    + * + * // Click within the image to change + * // the value of the rectangle + * // after the mouse has been clicked + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse click/press.'); + * } + * function mouseReleased() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function mouseReleased() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                    + * + *
                    + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseReleased(event) { + * console.log(event); + * } + * + *
                    + */ + _main.default.prototype._onmouseup = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._setProperty("mouseIsPressed", false); + if (typeof context.mouseReleased === "function") { + executeDefault = context.mouseReleased(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.touchEnded === "function") { + executeDefault = context.touchEnded(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + _main.default.prototype._ondragend = + _main.default.prototype._onmouseup; + _main.default.prototype._ondragover = + _main.default.prototype._onmousemove; + /** + * The mouseClicked() function is called once after a mouse button has been + * pressed and then released.

                    + * Browsers handle clicks differently, so this function is only guaranteed to be + * run when the left mouse button is clicked. To handle other mouse buttons + * being pressed or released, see mousePressed() or mouseReleased().

                    + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mouseClicked + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                    + * + * // Click within the image to change + * // the value of the rectangle + * // after the mouse has been clicked + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse click/press.'); + * } + * + * function mouseClicked() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function mouseClicked() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                    + * + *
                    + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseClicked(event) { + * console.log(event); + * } + * + *
                    + */ + _main.default.prototype._onclick = function (e) { + var context = this._isGlobal ? window : this; + if (typeof context.mouseClicked === "function") { + var executeDefault = context.mouseClicked(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The doubleClicked() function is executed every time a event + * listener has detected a dblclick event which is a part of the + * DOM L3 specification. The doubleClicked event is fired when a + * pointing device button (usually a mouse's primary button) + * is clicked twice on a single element. For more info on the + * dblclick event refer to mozilla's documentation here: + * https://developer.mozilla.org/en-US/docs/Web/Events/dblclick + * + * @method doubleClicked + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                    + * + * // Click within the image to change + * // the value of the rectangle + * // after the mouse has been double clicked + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse doubleClick/press.'); + * } + * + * function doubleClicked() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function doubleClicked() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                    + * + *
                    + * + * // returns a MouseEvent object + * // as a callback argument + * function doubleClicked(event) { + * console.log(event); + * } + * + *
                    + */ + _main.default.prototype._ondblclick = function (e) { + var context = this._isGlobal ? window : this; + if (typeof context.doubleClicked === "function") { + var executeDefault = context.doubleClicked(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * For use with WebGL orbitControl. + * @property {Number} _mouseWheelDeltaY + * @readOnly + * @private + */ + _main.default.prototype._mouseWheelDeltaY = 0; + /** + * For use with WebGL orbitControl. + * @property {Number} _pmouseWheelDeltaY + * @readOnly + * @private + */ + _main.default.prototype._pmouseWheelDeltaY = 0; + /** + * The function mouseWheel() is executed every time a vertical mouse wheel + * event is detected either triggered by an actual mouse wheel or by a + * touchpad.

                    + * The event.delta property returns the amount the mouse wheel + * have scrolled. The values can be positive or negative depending on the + * scroll direction (on macOS with "natural" scrolling enabled, the signs + * are inverted).

                    + * Browsers may have different default behaviors attached to various + * mouse events. To prevent any default behavior for this event, add + * "return false" to the end of the method.

                    + * Due to the current support of the "wheel" event on Safari, the function + * may only work as expected if "return false" is included while using Safari. + * + * @method mouseWheel + * @param {WheelEvent} [event] optional WheelEvent callback argument. + * + * @example + *
                    + * + * let pos = 25; + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * rect(25, pos, 50, 50); + * describe(`black 50-by-50 rect moves up and down with vertical scroll. + * fuchsia background`); + * } + * + * function mouseWheel(event) { + * print(event.delta); + * //move the square according to the vertical scroll amount + * pos += event.delta; + * //uncomment to block page scrolling + * //return false; + * } + * + *
                    + */ + _main.default.prototype._onwheel = function (e) { + var context = this._isGlobal ? window : this; + this._setProperty("_mouseWheelDeltaY", e.deltaY); + if (typeof context.mouseWheel === "function") { + e.delta = e.deltaY; + var executeDefault = context.mouseWheel(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The function requestPointerLock() + * locks the pointer to its current position and makes it invisible. + * Use movedX and movedY to get the difference the mouse was moved since + * the last call of draw. + * Note that not all browsers support this feature. + * This enables you to create experiences that aren't limited by the mouse moving out of the screen + * even if it is repeatedly moved into one direction. + * For example, a first person perspective experience. + * + * @method requestPointerLock + * @example + *
                    + * + * let cam; + * function setup() { + * createCanvas(100, 100, WEBGL); + * requestPointerLock(); + * cam = createCamera(); + * } + * + * function draw() { + * background(255); + * cam.pan(-movedX * 0.001); + * cam.tilt(movedY * 0.001); + * sphere(25); + * describe(`3D scene moves according to mouse mouse movement in a + * first person perspective`); + * } + * + *
                    + */ + _main.default.prototype.requestPointerLock = function () { + // pointer lock object forking for cross browser + var canvas = this._curElement.elt; + canvas.requestPointerLock = + canvas.requestPointerLock || canvas.mozRequestPointerLock; + if (!canvas.requestPointerLock) { + console.log( + "requestPointerLock is not implemented in this browser", + ); + return false; + } + canvas.requestPointerLock(); + return true; + }; + /** + * The function exitPointerLock() + * exits a previously triggered pointer Lock + * for example to make ui elements usable etc + * + * @method exitPointerLock + * @example + *
                    + * + * //click the canvas to lock the pointer + * //click again to exit (otherwise escape) + * let locked = false; + * function draw() { + * background(237, 34, 93); + * describe('cursor gets locked / unlocked on mouse-click'); + * } + * function mouseClicked() { + * if (!locked) { + * locked = true; + * requestPointerLock(); + * } else { + * exitPointerLock(); + * locked = false; + * } + * } + * + *
                    + */ + _main.default.prototype.exitPointerLock = function () { + document.exitPointerLock(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 318: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.string.includes"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Events + * @submodule Touch + * @for p5 + * @requires core + */ + /** + * The system variable touches[] contains an array of the positions of all + * current touch points, relative to (0, 0) of the canvas, and IDs identifying a + * unique touch as it moves. Each element in the array is an object with x, y, + * and id properties. + * + * The touches[] array is not supported on Safari and IE on touch-based + * desktops (laptops). + * + * @property {Object[]} touches + * @readOnly + * + * @example + *
                    + * + * // On a touchscreen device, touch + * // the canvas using one or more fingers + * // at the same time + * function draw() { + * clear(); + * let display = touches.length + ' touches'; + * text(display, 5, 10); + * describe(`Number of touches currently registered are displayed + * on the canvas`); + * } + * + *
                    + */ + + _main.default.prototype.touches = []; + _main.default.prototype._updateTouchCoords = function (e) { + if (this._curElement !== null) { + var touches = []; + for (var i = 0; i < e.touches.length; i++) { + touches[i] = getTouchInfo( + this._curElement.elt, + this.width, + this.height, + e, + i, + ); + } + this._setProperty("touches", touches); + } + }; + function getTouchInfo(canvas, w, h, e) { + var i = + arguments.length > 4 && arguments[4] !== undefined + ? arguments[4] + : 0; + var rect = canvas.getBoundingClientRect(); + var sx = canvas.scrollWidth / w || 1; + var sy = canvas.scrollHeight / h || 1; + var touch = e.touches[i] || e.changedTouches[i]; + return { + x: (touch.clientX - rect.left) / sx, + y: (touch.clientY - rect.top) / sy, + winX: touch.clientX, + winY: touch.clientY, + id: touch.identifier, + }; + } /** + * The touchStarted() function is called once after every time a touch is + * registered. If no touchStarted() function is defined, the mousePressed() + * function will be called instead if it is defined.

                    + * Browsers may have different default behaviors attached to various touch + * events. To prevent any default behavior for this event, add "return false" + * to the end of the method. + * + * @method touchStarted + * @param {TouchEvent} [event] optional TouchEvent callback argument. + * @example + *
                    + * + * // Touch within the image to change + * // the value of the rectangle + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('50-by-50 black rect turns white with touch event.'); + * } + * function touchStarted() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function touchStarted() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * describe('no image displayed'); + * + *
                    + * + *
                    + * + * // returns a TouchEvent object + * // as a callback argument + * function touchStarted(event) { + * console.log(event); + * } + * describe('no image displayed'); + * + *
                    + */ + + _main.default.prototype._ontouchstart = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._setProperty("mouseIsPressed", true); + this._updateTouchCoords(e); + this._updateNextMouseCoords(e); + this._updateMouseCoords(); // reset pmouseXY at the start of each touch event + if (typeof context.touchStarted === "function") { + executeDefault = context.touchStarted(e); + if (executeDefault === false) { + e.preventDefault(); + } // only safari needs this manual fallback for consistency + } else if ( + navigator.userAgent.toLowerCase().includes("safari") && + typeof context.mousePressed === "function" + ) { + executeDefault = context.mousePressed(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The touchMoved() function is called every time a touch move is registered. + * If no touchMoved() function is defined, the mouseDragged() function will + * be called instead if it is defined.

                    + * Browsers may have different default behaviors attached to various touch + * events. To prevent any default behavior for this event, add "return false" + * to the end of the method. + * + * @method touchMoved + * @param {TouchEvent} [event] optional TouchEvent callback argument. + * @example + *
                    + * + * // Move your finger across the page + * // to change its value + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('50-by-50 black rect turns lighter with touch until white. resets'); + * } + * function touchMoved() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function touchMoved() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * describe('no image displayed'); + * + *
                    + * + *
                    + * + * // returns a TouchEvent object + * // as a callback argument + * function touchMoved(event) { + * console.log(event); + * } + * describe('no image displayed'); + * + *
                    + */ + _main.default.prototype._ontouchmove = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._updateTouchCoords(e); + this._updateNextMouseCoords(e); + if (typeof context.touchMoved === "function") { + executeDefault = context.touchMoved(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.mouseDragged === "function") { + executeDefault = context.mouseDragged(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The touchEnded() function is called every time a touch ends. If no + * touchEnded() function is defined, the mouseReleased() function will be + * called instead if it is defined.

                    + * Browsers may have different default behaviors attached to various touch + * events. To prevent any default behavior for this event, add "return false" + * to the end of the method. + * + * @method touchEnded + * @param {TouchEvent} [event] optional TouchEvent callback argument. + * @example + *
                    + * + * // Release touch within the image to + * // change the value of the rectangle + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('50-by-50 black rect turns white with touch.'); + * } + * function touchEnded() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                    + * + *
                    + * + * function touchEnded() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * describe('no image displayed'); + * + *
                    + * + *
                    + * + * // returns a TouchEvent object + * // as a callback argument + * function touchEnded(event) { + * console.log(event); + * } + * describe('no image displayed'); + * + *
                    + */ + _main.default.prototype._ontouchend = function (e) { + this._setProperty("mouseIsPressed", false); + this._updateTouchCoords(e); + this._updateNextMouseCoords(e); + var context = this._isGlobal ? window : this; + var executeDefault; + if (typeof context.touchEnded === "function") { + executeDefault = context.touchEnded(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.mouseReleased === "function") { + executeDefault = context.mouseReleased(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.string.includes": 209, + }, + ], + 319: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.int32-array"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.int32-array"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + /** + * This module defines the filters for use with image buffers. + * + * This module is basically a collection of functions stored in an object + * as opposed to modules. The functions are destructive, modifying + * the passed in canvas rather than creating a copy. + * + * Generally speaking users of this module will use the Filters.apply method + * on a canvas to create an effect. + * + * A number of functions are borrowed/adapted from + * http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ + * or the java processing implementation. + */ + var Filters = { + /* + * Helper functions + */ + /** + * Returns the pixel buffer for a canvas. + * + * @private + * + * @param {Canvas|ImageData} canvas the canvas to get pixels from + * @return {Uint8ClampedArray} a one-dimensional array containing + * the data in the RGBA order, with integer + * values between 0 and 255. + */ + _toPixels: function _toPixels(canvas) { + // Return pixel data if 'canvas' is an ImageData object. + if (canvas instanceof ImageData) { + return canvas.data; + } else { + // Check 2D context support. + if (canvas.getContext("2d")) { + // Retrieve pixel data. + return canvas + .getContext("2d") + .getImageData(0, 0, canvas.width, canvas.height).data; + } else if (canvas.getContext("webgl")) { + //Check WebGL context support + var gl = canvas.getContext("webgl"); + // Calculate the size of pixel data + // (4 bytes per pixel - one byte for each RGBA channel). + var len = gl.drawingBufferWidth * gl.drawingBufferHeight * 4; + var data = new Uint8Array(len); + // Use gl.readPixels to fetch pixel data from the WebGL + // canvas, storing it in the data array as UNSIGNED_BYTE integers. + gl.readPixels( + 0, + 0, + canvas.width, + canvas.height, + gl.RGBA, + gl.UNSIGNED_BYTE, + data, + ); + return data; + } + } + }, + /** + * Returns a 32-bit number containing ARGB data at the ith pixel in the + * 1D array containing pixels data. + * + * @private + * + * @param {Uint8ClampedArray} data array returned by _toPixels() + * @param {Integer} i index of a 1D Image Array + * @return {Integer} 32-bit integer value representing + * ARGB value. + */ + _getARGB: function _getARGB(data, i) { + // Determine the starting position in the 'data' array for the 'i'-th pixel. + var offset = i * 4; + return ( + // Combining the extracted components using bitwise OR operations to form the final ARGB value. + ((data[offset + 3] << 24) & 4278190080) | //Extract alpha component + ((data[offset] << 16) & 16711680) | //Extract Red component + ((data[offset + 1] << 8) & 65280) | //Extract green component + (data[offset + 2] & 255) //Extract blue component + ); + }, + /** + * Modifies pixels RGBA values to values contained in the data object. + * + * @private + * + * @param {Uint8ClampedArray} pixels array returned by _toPixels() + * @param {Int32Array} data source 1D array where each value + * represents ARGB values + */ + _setPixels: function _setPixels(pixels, data) { + var offset = 0; + for (var i = 0, al = pixels.length; i < al; i++) { + offset = i * 4; + pixels[offset + 0] = (data[i] & 16711680) >>> 16; + pixels[offset + 1] = (data[i] & 65280) >>> 8; + pixels[offset + 2] = data[i] & 255; + pixels[offset + 3] = (data[i] & 4278190080) >>> 24; + } + }, + /** + * Returns the ImageData object for a canvas. + * https://developer.mozilla.org/en-US/docs/Web/API/ImageData + * + * @private + * + * @param {Canvas|ImageData} canvas canvas to get image data from + * @return {ImageData} Holder of pixel data (and width and + * height) for a canvas + */ + _toImageData: function _toImageData(canvas) { + if (canvas instanceof ImageData) { + return canvas; + } else { + return canvas + .getContext("2d") + .getImageData(0, 0, canvas.width, canvas.height); + } + }, + /** + * Returns a blank ImageData object. + * + * @private + * + * @param {Integer} width + * @param {Integer} height + * @return {ImageData} + */ + _createImageData: function _createImageData(width, height) { + Filters._tmpCanvas = document.createElement("canvas"); + Filters._tmpCtx = Filters._tmpCanvas.getContext("2d"); + return this._tmpCtx.createImageData(width, height); + }, + /** + * Applys a filter function to a canvas. + * + * The difference between this and the actual filter functions defined below + * is that the filter functions generally modify the pixel buffer but do + * not actually put that data back to the canvas (where it would actually + * update what is visible). By contrast this method does make the changes + * actually visible in the canvas. + * + * The apply method is the method that callers of this module would generally + * use. It has been separated from the actual filters to support an advanced + * use case of creating a filter chain that executes without actually updating + * the canvas in between everystep. + * + * @private + * @param {HTMLCanvasElement} canvas The input canvas to apply the filter on. + * @param {function(ImageData,Object)} func The filter function to apply to the canvas's pixel data. + * @param {Object} filterParam An optional parameter to pass to the filter function. + */ + apply: function apply(canvas, func, filterParam) { + var pixelsState = canvas.getContext("2d"); + var imageData = pixelsState.getImageData( + 0, + 0, + canvas.width, + canvas.height, + ); + //Filters can either return a new ImageData object, or just modify + //the one they received. + var newImageData = func(imageData, filterParam); + //If new ImageData is returned, replace the canvas's pixel data with it. + if (newImageData instanceof ImageData) { + pixelsState.putImageData( + newImageData, + 0, + 0, + 0, + 0, + canvas.width, + canvas.height, + ); + } else { + //Restore the original pixel. + pixelsState.putImageData( + imageData, + 0, + 0, + 0, + 0, + canvas.width, + canvas.height, + ); + } + }, + /* + * Filters + */ + /** + * Converts the image to black and white pixels depending if they are above or + * below the threshold defined by the level parameter. The parameter must be + * between 0.0 (black) and 1.0 (white). If no level is specified, 0.5 is used. + * + * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ + * + * @private + * @param {Canvas} canvas Canvas to apply thershold filter on. + * @param {Float} level Threshold level (0-1). + */ + threshold: function threshold(canvas, level) { + var pixels = Filters._toPixels(canvas); + if (level === undefined) { + level = 0.5; + } // Calculate threshold value on a (0-255) scale. + + var thresh = Math.floor(level * 255); + for (var i = 0; i < pixels.length; i += 4) { + var r = pixels[i]; + var g = pixels[i + 1]; + var b = pixels[i + 2]; + // CIE luminance for RGB + var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; + var val = void 0; + if (gray >= thresh) { + val = 255; + } else { + val = 0; + } + pixels[i] = pixels[i + 1] = pixels[i + 2] = val; //set pixel to val. + } + }, + /** + * Converts any colors in the image to grayscale equivalents. + * No parameter is used. + * + * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ + * + * @private + * @param {Canvas} canvas Canvas to apply gray filter on. + */ + gray: function gray(canvas) { + var pixels = Filters._toPixels(canvas); + for (var i = 0; i < pixels.length; i += 4) { + var r = pixels[i]; + var g = pixels[i + 1]; + var b = pixels[i + 2]; + // CIE luminance for RGB + var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; + pixels[i] = pixels[i + 1] = pixels[i + 2] = gray; // set pixel to gray. + } + }, + /** + * Sets the alpha channel to entirely opaque. No parameter is used. + * + * @private + * @param {Canvas} canvas + */ + opaque: function opaque(canvas) { + var pixels = Filters._toPixels(canvas); + for (var i = 0; i < pixels.length; i += 4) { + pixels[i + 3] = 255; + } + return pixels; + }, + /** + * Sets each pixel to its inverse value. No parameter is used. + * @private + * @param {Canvas} canvas + */ + invert: function invert(canvas) { + var pixels = Filters._toPixels(canvas); + for (var i = 0; i < pixels.length; i += 4) { + pixels[i] = 255 - pixels[i]; + pixels[i + 1] = 255 - pixels[i + 1]; + pixels[i + 2] = 255 - pixels[i + 2]; + } + }, + /** + * Limits each channel of the image to the number of colors specified as + * the parameter. The parameter can be set to values between 2 and 255, but + * results are most noticeable in the lower ranges. + * + * Adapted from java based processing implementation + * + * @private + * @param {Canvas} canvas + * @param {Integer} level + */ + posterize: function posterize(canvas, level) { + var pixels = Filters._toPixels(canvas); + if (level === undefined) { + level = 4; + } + if (level < 2 || level > 255) { + throw new Error( + "Level must be greater than 2 and less than 255 for posterize", + ); + } + var levels1 = level - 1; + for (var i = 0; i < pixels.length; i += 4) { + var rlevel = pixels[i]; + var glevel = pixels[i + 1]; + var blevel = pixels[i + 2]; + // New pixel value by posterizing each color. + pixels[i] = (((rlevel * level) >> 8) * 255) / levels1; + pixels[i + 1] = (((glevel * level) >> 8) * 255) / levels1; + pixels[i + 2] = (((blevel * level) >> 8) * 255) / levels1; + } + }, + /** + * Increases the bright areas in an image. + * @private + * @param {Canvas} canvas + */ + dilate: function dilate(canvas) { + var pixels = Filters._toPixels(canvas); + var currIdx = 0; + var maxIdx = pixels.length ? pixels.length / 4 : 0; + var out = new Int32Array(maxIdx); + var currRowIdx, maxRowIdx, colOrig, colOut, currLum; + var idxRight, idxLeft, idxUp, idxDown; + var colRight, colLeft, colUp, colDown; + var lumRight, lumLeft, lumUp, lumDown; + // Iterates through rows of pixels. + while (currIdx < maxIdx) { + currRowIdx = currIdx; + maxRowIdx = currIdx + canvas.width; + // Iterates through pixels within the current row. + while (currIdx < maxRowIdx) { + // Get original color of current pixel. + colOrig = colOut = Filters._getARGB(pixels, currIdx); + idxLeft = currIdx - 1; + idxRight = currIdx + 1; + idxUp = currIdx - canvas.width; + idxDown = currIdx + canvas.width; + // Adjust the indices to avoid going out of bounds. + if (idxLeft < currRowIdx) { + idxLeft = currIdx; + } + if (idxRight >= maxRowIdx) { + idxRight = currIdx; + } + if (idxUp < 0) { + idxUp = 0; + } + if (idxDown >= maxIdx) { + idxDown = currIdx; + } + colUp = Filters._getARGB(pixels, idxUp); + colLeft = Filters._getARGB(pixels, idxLeft); + colDown = Filters._getARGB(pixels, idxDown); + colRight = Filters._getARGB(pixels, idxRight); + // Compute luminance + currLum = + 77 * ((colOrig >> 16) & 255) + + 151 * ((colOrig >> 8) & 255) + + 28 * (colOrig & 255); + lumLeft = + 77 * ((colLeft >> 16) & 255) + + 151 * ((colLeft >> 8) & 255) + + 28 * (colLeft & 255); + lumRight = + 77 * ((colRight >> 16) & 255) + + 151 * ((colRight >> 8) & 255) + + 28 * (colRight & 255); + lumUp = + 77 * ((colUp >> 16) & 255) + + 151 * ((colUp >> 8) & 255) + + 28 * (colUp & 255); + lumDown = + 77 * ((colDown >> 16) & 255) + + 151 * ((colDown >> 8) & 255) + + 28 * (colDown & 255); + // Update the output color based on the highest luminance value + if (lumLeft > currLum) { + colOut = colLeft; + currLum = lumLeft; + } + if (lumRight > currLum) { + colOut = colRight; + currLum = lumRight; + } + if (lumUp > currLum) { + colOut = colUp; + currLum = lumUp; + } + if (lumDown > currLum) { + colOut = colDown; + currLum = lumDown; + } // Store the updated color. + + out[currIdx++] = colOut; + } + } + Filters._setPixels(pixels, out); + }, + /** + * Reduces the bright areas in an image. + * Similar to `dilate()`, but updates the output color based on the lowest luminance value. + * @private + * @param {Canvas} canvas + */ + erode: function erode(canvas) { + var pixels = Filters._toPixels(canvas); + var currIdx = 0; + var maxIdx = pixels.length ? pixels.length / 4 : 0; + var out = new Int32Array(maxIdx); + var currRowIdx, maxRowIdx, colOrig, colOut, currLum; + var idxRight, idxLeft, idxUp, idxDown; + var colRight, colLeft, colUp, colDown; + var lumRight, lumLeft, lumUp, lumDown; + while (currIdx < maxIdx) { + currRowIdx = currIdx; + maxRowIdx = currIdx + canvas.width; + while (currIdx < maxRowIdx) { + colOrig = colOut = Filters._getARGB(pixels, currIdx); + idxLeft = currIdx - 1; + idxRight = currIdx + 1; + idxUp = currIdx - canvas.width; + idxDown = currIdx + canvas.width; + if (idxLeft < currRowIdx) { + idxLeft = currIdx; + } + if (idxRight >= maxRowIdx) { + idxRight = currIdx; + } + if (idxUp < 0) { + idxUp = 0; + } + if (idxDown >= maxIdx) { + idxDown = currIdx; + } + colUp = Filters._getARGB(pixels, idxUp); + colLeft = Filters._getARGB(pixels, idxLeft); + colDown = Filters._getARGB(pixels, idxDown); + colRight = Filters._getARGB(pixels, idxRight); + //compute luminance + currLum = + 77 * ((colOrig >> 16) & 255) + + 151 * ((colOrig >> 8) & 255) + + 28 * (colOrig & 255); + lumLeft = + 77 * ((colLeft >> 16) & 255) + + 151 * ((colLeft >> 8) & 255) + + 28 * (colLeft & 255); + lumRight = + 77 * ((colRight >> 16) & 255) + + 151 * ((colRight >> 8) & 255) + + 28 * (colRight & 255); + lumUp = + 77 * ((colUp >> 16) & 255) + + 151 * ((colUp >> 8) & 255) + + 28 * (colUp & 255); + lumDown = + 77 * ((colDown >> 16) & 255) + + 151 * ((colDown >> 8) & 255) + + 28 * (colDown & 255); + if (lumLeft < currLum) { + colOut = colLeft; + currLum = lumLeft; + } + if (lumRight < currLum) { + colOut = colRight; + currLum = lumRight; + } + if (lumUp < currLum) { + colOut = colUp; + currLum = lumUp; + } + if (lumDown < currLum) { + colOut = colDown; + currLum = lumDown; + } // Store the updated color. + + out[currIdx++] = colOut; + } + } + Filters._setPixels(pixels, out); + }, + blur: function blur(canvas, radius) { + blurARGB(canvas, radius); + }, + }; + // BLUR + // Internal kernel stuff for the gaussian blur filter. + var blurRadius; + var blurKernelSize; + var blurKernel; + var blurMult; + /* + * Port of https://github.com/processing/processing/blob/ + * main/core/src/processing/core/PImage.java#L1250 + * + * Optimized code for building the blur kernel. + * further optimized blur code (approx. 15% for radius=20) + * bigger speed gains for larger radii (~30%) + * added support for various image types (ALPHA, RGB, ARGB) + * [toxi 050728] + */ + function buildBlurKernel(r) { + var radius = (r * 3.5) | 0; + radius = radius < 1 ? 1 : radius < 248 ? radius : 248; + if (blurRadius !== radius) { + blurRadius = radius; + // Calculating the size of the blur kernel + blurKernelSize = (1 + blurRadius) << 1; + blurKernel = new Int32Array(blurKernelSize); + blurMult = new Array(blurKernelSize); + for (var l = 0; l < blurKernelSize; l++) { + blurMult[l] = new Int32Array(256); + } + var bk, bki; + var bm, bmi; + // Generating blur kernel values. + for (var i = 1, radiusi = radius - 1; i < radius; i++) { + blurKernel[radius + i] = + blurKernel[radiusi] = + bki = + radiusi * radiusi; + bm = blurMult[radius + i]; + bmi = blurMult[radiusi--]; + for (var j = 0; j < 256; j++) { + bm[j] = bmi[j] = bki * j; + } + } + bk = blurKernel[radius] = radius * radius; + bm = blurMult[radius]; + for (var k = 0; k < 256; k++) { + bm[k] = bk * k; + } + } + } // Port of https://github.com/processing/processing/blob/ + // main/core/src/processing/core/PImage.java#L1433 + + function blurARGB(canvas, radius) { + // Get pixel data. + var pixels = Filters._toPixels(canvas); + var width = canvas.width; + var height = canvas.height; + var numPackedPixels = width * height; + var argb = new Int32Array(numPackedPixels); + for (var j = 0; j < numPackedPixels; j++) { + argb[j] = Filters._getARGB(pixels, j); + } + var sum, cr, cg, cb, ca; + var read, ri, ym, ymi, bk0; + var a2 = new Int32Array(numPackedPixels); + var r2 = new Int32Array(numPackedPixels); + var g2 = new Int32Array(numPackedPixels); + var b2 = new Int32Array(numPackedPixels); + var yi = 0; + buildBlurKernel(radius); + var x, y, i; + var bm; + // Horizontal pass. + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + cb = cg = cr = ca = sum = 0; + read = x - blurRadius; + // Handle edge cases. + if (read < 0) { + bk0 = -read; + read = 0; + } else { + if (read >= width) { + break; + } + bk0 = 0; + } + for (i = bk0; i < blurKernelSize; i++) { + if (read >= width) { + break; + } + var c = argb[read + yi]; + bm = blurMult[i]; + ca += bm[(c & -16777216) >>> 24]; + cr += bm[(c & 16711680) >> 16]; + cg += bm[(c & 65280) >> 8]; + cb += bm[c & 255]; + sum += blurKernel[i]; + read++; + } + ri = yi + x; + a2[ri] = ca / sum; + r2[ri] = cr / sum; + g2[ri] = cg / sum; + b2[ri] = cb / sum; + } + yi += width; + } + yi = 0; + ym = -blurRadius; + ymi = ym * width; + // Vertical pass. + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + cb = cg = cr = ca = sum = 0; + // Handle edge cases. + if (ym < 0) { + bk0 = ri = -ym; + read = x; + } else { + if (ym >= height) { + break; + } + bk0 = 0; + ri = ym; + read = x + ymi; + } + for (i = bk0; i < blurKernelSize; i++) { + if (ri >= height) { + break; + } + bm = blurMult[i]; + ca += bm[a2[read]]; + cr += bm[r2[read]]; + cg += bm[g2[read]]; + cb += bm[b2[read]]; + sum += blurKernel[i]; + ri++; + read += width; + } // Set final ARGB value + + argb[x + yi] = + ((ca / sum) << 24) | + ((cr / sum) << 16) | + ((cg / sum) << 8) | + (cb / sum); + } + yi += width; + ymi += width; + ym++; + } + Filters._setPixels(pixels, argb); + } + var _default = Filters; + exports.default = _default; + }, + { + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.int32-array": 235, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-array": 252, + }, + ], + 320: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var _omggif = _interopRequireDefault(_dereq_("omggif")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Image + * @submodule Image + * @for p5 + * @requires core + */ + /** + * This module defines the p5 methods for the p5.Image class + * for drawing images to the main display canvas. + */ + /** + * Creates a new p5.Image object. The new image is + * transparent by default. + * + * `createImage()` uses the `width` and `height` paremeters to set the new + * p5.Image object's dimensions in pixels. The new + * p5.Image can be modified by updating its + * pixels array or by calling its + * get() and + * set() methods. The + * loadPixels() method must be called + * before reading or modifying pixel values. The + * updatePixels() method must be called + * for updates to take effect. + * + * @method createImage + * @param {Integer} width width in pixels. + * @param {Integer} height height in pixels. + * @return {p5.Image} new p5.Image object. + * @example + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * let a = map(x, 0, img.width, 0, 255); + * let c = color(0, a); + * img.set(x, y, c); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A square with a horizontal color gradient that transitions from gray to black.'); + * + *
                    + * + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let d = pixelDensity(); + * let halfImage = 4 * (d * img.width) * (d * img.height / 2); + * for (let i = 0; i < halfImage; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + */ + + _main.default.prototype.createImage = function (width, height) { + _main.default._validateParameters("createImage", arguments); + return new _main.default.Image(width, height); + }; + /** + * Saves the current canvas as an image. The browser will either save the + * file immediately or prompt the user with a dialogue window. + * + * @method saveCanvas + * @param {p5.Framebuffer|p5.Element|HTMLCanvasElement} selectedCanvas reference to a + * specific HTML5 canvas element. + * @param {String} [filename] file name. Defaults to 'untitled'. + * @param {String} [extension] file extension, either 'jpg' or 'png'. Defaults to 'png'. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(255); + * saveCanvas(); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(255); + * saveCanvas('myCanvas.jpg'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(255); + * saveCanvas('myCanvas', 'jpg'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(255); + * saveCanvas(cnv); + * } + * + *
                    + * + *
                    + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(255); + * saveCanvas(cnv, 'myCanvas.jpg'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(255); + * saveCanvas(cnv, 'myCanvas', 'jpg'); + * } + * + *
                    + */ + /** + * @method saveCanvas + * @param {String} [filename] + * @param {String} [extension] + */ + _main.default.prototype.saveCanvas = function () { + _main.default._validateParameters("saveCanvas", arguments); + // copy arguments to array + var args = [].slice.call(arguments); + var htmlCanvas, filename, extension, temporaryGraphics; + if (arguments[0] instanceof HTMLCanvasElement) { + htmlCanvas = arguments[0]; + args.shift(); + } else if (arguments[0] instanceof _main.default.Element) { + htmlCanvas = arguments[0].elt; + args.shift(); + } else if (arguments[0] instanceof _main.default.Framebuffer) { + var framebuffer = arguments[0]; + temporaryGraphics = this.createGraphics( + framebuffer.width, + framebuffer.height, + ); + temporaryGraphics.pixelDensity(pixelDensity()); + framebuffer.loadPixels(); + temporaryGraphics.loadPixels(); + temporaryGraphics.pixels.set(framebuffer.pixels); + temporaryGraphics.updatePixels(); + htmlCanvas = temporaryGraphics.elt; + args.shift(); + } else { + htmlCanvas = this._curElement && this._curElement.elt; + } + if (args.length >= 1) { + filename = args[0]; + } + if (args.length >= 2) { + extension = args[1]; + } + extension = + extension || + _main.default.prototype._checkFileExtension( + filename, + extension, + )[1] || + "png"; + var mimeType; + switch (extension) { + default: + //case 'png': + mimeType = "image/png"; + break; + case "jpeg": + case "jpg": + mimeType = "image/jpeg"; + break; + } + htmlCanvas.toBlob(function (blob) { + _main.default.prototype.downloadFile(blob, filename, extension); + if (temporaryGraphics) temporaryGraphics.remove(); + }, mimeType); + }; + // this is the old saveGif, left here for compatibility purposes + // the only place I found it being used was on image/p5.Image.js, on the + // save function. that has been changed to use this function. + _main.default.prototype.encodeAndDownloadGif = function ( + pImg, + filename, + ) { + var props = pImg.gifProperties; + //convert loopLimit back into Netscape Block formatting + var loopLimit = props.loopLimit; + if (loopLimit === 1) { + loopLimit = null; + } else if (loopLimit === null) { + loopLimit = 0; + } + var buffer = new Uint8Array( + pImg.width * pImg.height * props.numFrames, + ); + var allFramesPixelColors = []; + // Used to determine the occurrence of unique palettes and the frames + // which use them + var paletteFreqsAndFrames = {}; + // Pass 1: + //loop over frames and get the frequency of each palette + for (var i = 0; i < props.numFrames; i++) { + var paletteSet = new Set(); + var data = props.frames[i].image.data; + var dataLength = data.length; + // The color for each pixel in this frame ( for easier lookup later ) + var pixelColors = new Uint32Array(pImg.width * pImg.height); + for (var j = 0, k = 0; j < dataLength; j += 4, k++) { + var r = data[j + 0]; + var g = data[j + 1]; + var b = data[j + 2]; + var color = (r << 16) | (g << 8) | (b << 0); + paletteSet.add(color); + // What color does this pixel have in this frame ? + pixelColors[k] = color; + } // A way to put use the entire palette as an object key + + var paletteStr = _toConsumableArray(paletteSet).sort().toString(); + if (paletteFreqsAndFrames[paletteStr] === undefined) { + paletteFreqsAndFrames[paletteStr] = { + freq: 1, + frames: [i], + }; + } else { + paletteFreqsAndFrames[paletteStr].freq += 1; + paletteFreqsAndFrames[paletteStr].frames.push(i); + } + allFramesPixelColors.push(pixelColors); + } + var framesUsingGlobalPalette = []; + // Now to build the global palette + // Sort all the unique palettes in descending order of their occurrence + var palettesSortedByFreq = Object.keys(paletteFreqsAndFrames).sort( + function (a, b) { + return ( + paletteFreqsAndFrames[b].freq - paletteFreqsAndFrames[a].freq + ); + }, + ); + // The initial global palette is the one with the most occurrence + var globalPalette = palettesSortedByFreq[0] + .split(",") + .map(function (a) { + return parseInt(a); + }); + framesUsingGlobalPalette = framesUsingGlobalPalette.concat( + paletteFreqsAndFrames[globalPalette].frames, + ); + var globalPaletteSet = new Set(globalPalette); + // Build a more complete global palette + // Iterate over the remaining palettes in the order of + // their occurrence and see if the colors in this palette which are + // not in the global palette can be added there, while keeping the length + // of the global palette <= 256 + for (var _i = 1; _i < palettesSortedByFreq.length; _i++) { + var palette = palettesSortedByFreq[_i] + .split(",") + .map(function (a) { + return parseInt(a); + }); + var difference = palette.filter(function (x) { + return !globalPaletteSet.has(x); + }); + if (globalPalette.length + difference.length <= 256) { + for (var _j = 0; _j < difference.length; _j++) { + globalPalette.push(difference[_j]); + globalPaletteSet.add(difference[_j]); + } // All frames using this palette now use the global palette + + framesUsingGlobalPalette = framesUsingGlobalPalette.concat( + paletteFreqsAndFrames[palettesSortedByFreq[_i]].frames, + ); + } + } + framesUsingGlobalPalette = new Set(framesUsingGlobalPalette); + // Build a lookup table of the index of each color in the global palette + // Maps a color to its index + var globalIndicesLookup = {}; + for (var _i2 = 0; _i2 < globalPalette.length; _i2++) { + if (!globalIndicesLookup[globalPalette[_i2]]) { + globalIndicesLookup[globalPalette[_i2]] = _i2; + } + } // force palette to be power of 2 + + var powof2 = 1; + while (powof2 < globalPalette.length) { + powof2 <<= 1; + } + globalPalette.length = powof2; + // global opts + var opts = { + loop: loopLimit, + palette: new Uint32Array(globalPalette), + }; + var gifWriter = new _omggif.default.GifWriter( + buffer, + pImg.width, + pImg.height, + opts, + ); + var previousFrame = {}; + // Pass 2 + // Determine if the frame needs a local palette + // Also apply transparency optimization. This function will often blow up + // the size of a GIF if not for transparency. If a pixel in one frame has + // the same color in the previous frame, that pixel can be marked as + // transparent. We decide one particular color as transparent and make all + // transparent pixels take this color. This helps in later in compression. + var _loop = function _loop(_i3) { + var localPaletteRequired = !framesUsingGlobalPalette.has(_i3); + var palette = localPaletteRequired ? [] : globalPalette; + var pixelPaletteIndex = new Uint8Array(pImg.width * pImg.height); + // Lookup table mapping color to its indices + var colorIndicesLookup = {}; + // All the colors that cannot be marked transparent in this frame + var cannotBeTransparent = new Set(); + allFramesPixelColors[_i3].forEach(function (color, k) { + if (localPaletteRequired) { + if (colorIndicesLookup[color] === undefined) { + colorIndicesLookup[color] = palette.length; + palette.push(color); + } + pixelPaletteIndex[k] = colorIndicesLookup[color]; + } else { + pixelPaletteIndex[k] = globalIndicesLookup[color]; + } + if (_i3 > 0) { + // If even one pixel of this color has changed in this frame + // from the previous frame, we cannot mark it as transparent + if (allFramesPixelColors[_i3 - 1][k] !== color) { + cannotBeTransparent.add(color); + } + } + }); + var frameOpts = {}; + // Transparency optimization + var canBeTransparent = palette.filter(function (a) { + return !cannotBeTransparent.has(a); + }); + if (canBeTransparent.length > 0) { + // Select a color to mark as transparent + var transparent = canBeTransparent[0]; + var transparentIndex = localPaletteRequired + ? colorIndicesLookup[transparent] + : globalIndicesLookup[transparent]; + if (_i3 > 0) { + for ( + var _k = 0; + _k < allFramesPixelColors[_i3].length; + _k++ + ) { + // If this pixel in this frame has the same color in previous frame + if ( + allFramesPixelColors[_i3 - 1][_k] === + allFramesPixelColors[_i3][_k] + ) { + pixelPaletteIndex[_k] = transparentIndex; + } + } + frameOpts.transparent = transparentIndex; + // If this frame has any transparency, do not dispose the previous frame + previousFrame.frameOpts.disposal = 1; + } + } + frameOpts.delay = props.frames[_i3].delay / 10; // Move timing back into GIF formatting + if (localPaletteRequired) { + // force palette to be power of 2 + var _powof = 1; + while (_powof < palette.length) { + _powof <<= 1; + } + palette.length = _powof; + frameOpts.palette = new Uint32Array(palette); + } + if (_i3 > 0) { + // add the frame that came before the current one + gifWriter.addFrame( + 0, + 0, + pImg.width, + pImg.height, + previousFrame.pixelPaletteIndex, + previousFrame.frameOpts, + ); + } // previous frame object should now have details of this frame + + previousFrame = { + pixelPaletteIndex: pixelPaletteIndex, + frameOpts: frameOpts, + }; + }; + for (var _i3 = 0; _i3 < props.numFrames; _i3++) { + _loop(_i3); + } + previousFrame.frameOpts.disposal = 1; + // add the last frame + gifWriter.addFrame( + 0, + 0, + pImg.width, + pImg.height, + previousFrame.pixelPaletteIndex, + previousFrame.frameOpts, + ); + var extension = "gif"; + var blob = new Blob([buffer.slice(0, gifWriter.end())], { + type: "image/gif", + }); + _main.default.prototype.downloadFile(blob, filename, extension); + }; + /** + * Captures a sequence of frames from the canvas that can be used to create a + * movie. Frames are downloaded as individual image files by default. + * + * The first parameter, `filename`, sets the prefix for the file names. For + * example, setting the prefix to `'frame'` would generate the image files + * `frame0.png`, `frame1.png`, and so on. The second parameter, `extension`, + * sets the file type to either `'png'` or `'jpg'`. + * + * The third parameter, `duration`, sets the duration to record in seconds. + * The maximum duration is 15 seconds. The fourth parameter, `framerate`, sets + * the number of frames to record per second. The maximum frame rate value is + * 22. Limits are placed on `duration` and `framerate` to avoid using too much + * memory. Recording large canvases can easily crash sketches or even web + * browsers. + * + * The fifth parameter, `callback`, is optional. If a function is passed, + * image files won't be saved by default. The callback function can be used + * to process an array containing the data for each captured frame. The array + * of image data contains a sequence of objects with three properties for each + * frame: `imageData`, `filename`, and `extension`. + * + * @method saveFrames + * @param {String} filename prefix of file name. + * @param {String} extension file extension, either 'jpg' or 'png'. + * @param {Number} duration duration in seconds to record. This parameter will be constrained to be less or equal to 15. + * @param {Number} framerate number of frames to save per second. This parameter will be constrained to be less or equal to 22. + * @param {function(Array)} [callback] callback function that will be executed + to handle the image data. This function + should accept an array as argument. The + array will contain the specified number of + frames of objects. Each object has three + properties: `imageData`, `filename`, and `extension`. + * @example + *
                    + * + * function draw() { + * let r = frameCount % 255; + * let g = 50; + * let b = 100; + * background(r, g, b); * - * the ImageInfos class holds a list of ImageDatas of a given size. - */ - var ImageInfos = /*#__PURE__*/ function () { - function ImageInfos(width, height) { - _classCallCheck(this, ImageInfos); - this.width = width; - this.height = height; - this.infos = [ - ]; // the list of images - } /** - * - * @method findImage - * @param {Integer} space - * @return {Object} contains the ImageData, and pixel index into that - * ImageData where the free space was allocated. - * - * finds free space of a given size in the ImageData list - */ - - _createClass(ImageInfos, [ - { - key: 'findImage', - value: function findImage(space) { - var imageSize = this.width * this.height; - if (space > imageSize) throw new Error('font is too complex to render in 3D'); - // search through the list of images, looking for one with - // anough unused space. - var imageInfo, - imageData; - for (var ii = this.infos.length - 1; ii >= 0; --ii) { - var imageInfoTest = this.infos[ii]; - if (imageInfoTest.index + space < imageSize) { - // found one - imageInfo = imageInfoTest; - imageData = imageInfoTest.imageData; - break; - } - } - if (!imageInfo) { - try { - // create a new image - imageData = new ImageData(this.width, this.height); - } catch (err) { - // for browsers that don't support ImageData constructors (ie IE11) - // create an ImageData using the old method - var canvas = document.getElementsByTagName('canvas') [0]; - var created = !canvas; - if (!canvas) { - // create a temporary canvas - canvas = document.createElement('canvas'); - canvas.style.display = 'none'; - document.body.appendChild(canvas); - } - var ctx = canvas.getContext('2d'); - if (ctx) { - imageData = ctx.createImageData(this.width, this.height); - } - if (created) { - // distroy the temporary canvas, if necessary - document.body.removeChild(canvas); - } - } // construct & dd the new image info - - imageInfo = { - index: 0, - imageData: imageData - }; - this.infos.push(imageInfo); - } - var index = imageInfo.index; - imageInfo.index += space; // move to the start of the next image - imageData._dirty = true; - return { - imageData: imageData, - index: index - }; - } - } - ]); - return ImageInfos; - }(); - /** - * @function setPixel - * @param {Object} imageInfo - * @param {Number} r - * @param {Number} g - * @param {Number} b - * @param {Number} a + * describe('A square repeatedly changes color from blue to pink.'); + * } * - * writes the next pixel into an indexed ImageData - */ - function setPixel(imageInfo, r, g, b, a) { - var imageData = imageInfo.imageData; - var pixels = imageData.data; - var index = imageInfo.index++ * 4; - pixels[index++] = r; - pixels[index++] = g; - pixels[index++] = b; - pixels[index++] = a; - } - var SQRT3 = Math.sqrt(3); - /** - * @private - * @class FontInfo - * @param {Object} font an opentype.js font object + * function keyPressed() { + * if (key === 's') { + * saveFrames('frame', 'png', 1, 5); + * } + * } + * + *
                    + * + *
                    + * + * function draw() { + * let r = frameCount % 255; + * let g = 50; + * let b = 100; + * background(r, g, b); + * + * describe('A square repeatedly changes color from blue to pink.'); + * } * - * contains cached images and glyph information for an opentype font + * function mousePressed() { + * saveFrames('frame', 'png', 1, 5, data => { + * // Prints an array of objects containing raw image data, + * // filenames, and extensions. + * print(data); + * }); + * } + * + *
                    */ - var FontInfo = /*#__PURE__*/ function () { - function FontInfo(font) { - _classCallCheck(this, FontInfo); - this.font = font; - // the bezier curve coordinates - this.strokeImageInfos = new ImageInfos(strokeImageWidth, strokeImageHeight); - // lists of curve indices for each row/column slice - this.colDimImageInfos = new ImageInfos(gridImageWidth, gridImageHeight); - this.rowDimImageInfos = new ImageInfos(gridImageWidth, gridImageHeight); - // the offset & length of each row/col slice in the glyph - this.colCellImageInfos = new ImageInfos(cellImageWidth, cellImageHeight); - this.rowCellImageInfos = new ImageInfos(cellImageWidth, cellImageHeight); - // the cached information for each glyph - this.glyphInfos = { - }; - } /** - * @method getGlyphInfo - * @param {Glyph} glyph the x positions of points in the curve - * @returns {Object} the glyphInfo for that glyph - * - * calculates rendering info for a glyph, including the curve information, - * row & column stripes compiled into textures. - */ - - _createClass(FontInfo, [ - { - key: 'getGlyphInfo', - value: function getGlyphInfo(glyph) { - // check the cache - var gi = this.glyphInfos[glyph.index]; - if (gi) return gi; - // get the bounding box of the glyph from opentype.js - var bb = glyph.getBoundingBox(); - var xMin = bb.x1; - var yMin = bb.y1; - var gWidth = bb.x2 - xMin; - var gHeight = bb.y2 - yMin; - var cmds = glyph.path.commands; - // don't bother rendering invisible glyphs - if (gWidth === 0 || gHeight === 0 || !cmds.length) { - return this.glyphInfos[glyph.index] = { - }; - } - var i; - var strokes = [ - ]; // the strokes in this glyph - var rows = [ - ]; // the indices of strokes in each row - var cols = [ - ]; // the indices of strokes in each column - for (i = charGridWidth - 1; i >= 0; --i) { - cols.push([]); - } - for (i = charGridHeight - 1; i >= 0; --i) { - rows.push([]); - } /** - * @function push - * @param {Number[]} xs the x positions of points in the curve - * @param {Number[]} ys the y positions of points in the curve - * @param {Object} v the curve information - * - * adds a curve to the rows & columns that it intersects with - */ - - function push(xs, ys, v) { - var index = strokes.length; // the index of this stroke - strokes.push(v); // add this stroke to the list - /** - * @function minMax - * @param {Number[]} rg the list of values to compare - * @param {Number} min the initial minimum value - * @param {Number} max the initial maximum value - * - * find the minimum & maximum value in a list of values - */ - function minMax(rg, min, max) { - for (var _i = rg.length; _i-- > 0; ) { - var _v = rg[_i]; - if (min > _v) min = _v; - if (max < _v) max = _v; - } - return { - min: min, - max: max - }; - } // Expand the bounding box of the glyph by the number of cells below - // before rounding. Curves only partially through a cell won't be added - // to adjacent cells, but ones that are close will be. This helps fix - // small visual glitches that occur when curves are close to grid cell - // boundaries. - - var cellOffset = 0.5; - // loop through the rows & columns that the curve intersects - // adding the curve to those slices - var mmX = minMax(xs, 1, 0); - var ixMin = Math.max(Math.floor(mmX.min * charGridWidth - cellOffset), 0); - var ixMax = Math.min(Math.ceil(mmX.max * charGridWidth + cellOffset), charGridWidth); - for (var iCol = ixMin; iCol < ixMax; ++iCol) { - cols[iCol].push(index); - } - var mmY = minMax(ys, 1, 0); - var iyMin = Math.max(Math.floor(mmY.min * charGridHeight - cellOffset), 0); - var iyMax = Math.min(Math.ceil(mmY.max * charGridHeight + cellOffset), charGridHeight); - for (var iRow = iyMin; iRow < iyMax; ++iRow) { - rows[iRow].push(index); - } - } /** - * @function clamp - * @param {Number} v the value to clamp - * @param {Number} min the minimum value - * @param {Number} max the maxmimum value - * - * clamps a value between a minimum & maximum value - */ - - function clamp(v, min, max) { - if (v < min) return min; - if (v > max) return max; - return v; - } /** - * @function byte - * @param {Number} v the value to scale - * - * converts a floating-point number in the range 0-1 to a byte 0-255 - */ - - function byte(v) { - return clamp(255 * v, 0, 255); - } /** - * @private - * @class Cubic - * @param {Number} p0 the start point of the curve - * @param {Number} c0 the first control point - * @param {Number} c1 the second control point - * @param {Number} p1 the end point - * - * a cubic curve - */ - - var Cubic = /*#__PURE__*/ function () { - function Cubic(p0, c0, c1, p1) { - _classCallCheck(this, Cubic); - this.p0 = p0; - this.c0 = c0; - this.c1 = c1; - this.p1 = p1; - } /** - * @method toQuadratic - * @return {Object} the quadratic approximation - * - * converts the cubic to a quadtratic approximation by - * picking an appropriate quadratic control point - */ - - _createClass(Cubic, [ - { - key: 'toQuadratic', - value: function toQuadratic() { - return { - x: this.p0.x, - y: this.p0.y, - x1: this.p1.x, - y1: this.p1.y, - cx: ((this.c0.x + this.c1.x) * 3 - (this.p0.x + this.p1.x)) / 4, - cy: ((this.c0.y + this.c1.y) * 3 - (this.p0.y + this.p1.y)) / 4 - }; - } /** - * @method quadError - * @return {Number} the error - * - * calculates the magnitude of error of this curve's - * quadratic approximation. - */ - - }, - { - key: 'quadError', - value: function quadError() { - return _main.default.Vector.sub(_main.default.Vector.sub(this.p1, this.p0), _main.default.Vector.mult(_main.default.Vector.sub(this.c1, this.c0), 3)).mag() / 2; - } /** - * @method split - * @param {Number} t the value (0-1) at which to split - * @return {Cubic} the second part of the curve - * - * splits the cubic into two parts at a point 't' along the curve. - * this cubic keeps its start point and its end point becomes the - * point at 't'. the 'end half is returned. - */ - - }, - { - key: 'split', - value: function split(t) { - var m1 = _main.default.Vector.lerp(this.p0, this.c0, t); - var m2 = _main.default.Vector.lerp(this.c0, this.c1, t); - var mm1 = _main.default.Vector.lerp(m1, m2, t); - this.c1 = _main.default.Vector.lerp(this.c1, this.p1, t); - this.c0 = _main.default.Vector.lerp(m2, this.c1, t); - var pt = _main.default.Vector.lerp(mm1, this.c0, t); - var part1 = new Cubic(this.p0, m1, mm1, pt); - this.p0 = pt; - return part1; - } /** - * @method splitInflections - * @return {Cubic[]} the non-inflecting pieces of this cubic - * - * returns an array containing 0, 1 or 2 cubics split resulting - * from splitting this cubic at its inflection points. - * this cubic is (potentially) altered and returned in the list. - */ - - }, - { - key: 'splitInflections', - value: function splitInflections() { - var a = _main.default.Vector.sub(this.c0, this.p0); - var b = _main.default.Vector.sub(_main.default.Vector.sub(this.c1, this.c0), a); - var c = _main.default.Vector.sub(_main.default.Vector.sub(_main.default.Vector.sub(this.p1, this.c1), a), _main.default.Vector.mult(b, 2)); - var cubics = [ - ]; - // find the derivative coefficients - var A = b.x * c.y - b.y * c.x; - if (A !== 0) { - var B = a.x * c.y - a.y * c.x; - var C = a.x * b.y - a.y * b.x; - var disc = B * B - 4 * A * C; - if (disc >= 0) { - if (A < 0) { - A = - A; - B = - B; - C = - C; - } - var Q = Math.sqrt(disc); - var t0 = ( - B - Q) / (2 * A); // the first inflection point - var t1 = ( - B + Q) / (2 * A); // the second inflection point - // test if the first inflection point lies on the curve - if (t0 > 0 && t0 < 1) { - // split at the first inflection point - cubics.push(this.split(t0)); - // scale t2 into the second part - t1 = 1 - (1 - t1) / (1 - t0); - } // test if the second inflection point lies on the curve - - if (t1 > 0 && t1 < 1) { - // split at the second inflection point - cubics.push(this.split(t1)); - } - } - } - cubics.push(this); - return cubics; - } - } - ]); - return Cubic; - }(); - /** - * @function cubicToQuadratics - * @param {Number} x0 - * @param {Number} y0 - * @param {Number} cx0 - * @param {Number} cy0 - * @param {Number} cx1 - * @param {Number} cy1 - * @param {Number} x1 - * @param {Number} y1 - * @returns {Cubic[]} an array of cubics whose quadratic approximations - * closely match the civen cubic. - * - * converts a cubic curve to a list of quadratics. - */ - function cubicToQuadratics(x0, y0, cx0, cy0, cx1, cy1, x1, y1) { - // create the Cubic object and split it at its inflections - var cubics = new Cubic(new _main.default.Vector(x0, y0), new _main.default.Vector(cx0, cy0), new _main.default.Vector(cx1, cy1), new _main.default.Vector(x1, y1)).splitInflections(); - var qs = [ - ]; // the final list of quadratics - var precision = 30 / SQRT3; - // for each of the non-inflected pieces of the original cubic - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for (var _iterator = cubics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var cubic = _step.value; - // the cubic is iteratively split in 3 pieces: - // the first piece is accumulated in 'qs', the result. - // the last piece is accumulated in 'tail', temporarily. - // the middle piece is repeatedly split again, while necessary. - var tail = [ - ]; - var t3 = void 0; - for (; ; ) { - // calculate this cubic's precision - t3 = precision / cubic.quadError(); - if (t3 >= 0.5 * 0.5 * 0.5) { - break; // not too bad, we're done - } // find a split point based on the error - - var t = Math.pow(t3, 1 / 3); - // split the cubic in 3 - var start = cubic.split(t); - var middle = cubic.split(1 - t / (1 - t)); - qs.push(start); // the first part - tail.push(cubic); // the last part - cubic = middle; // iterate on the middle piece - } - if (t3 < 1) { - // a little excess error, split the middle in two - qs.push(cubic.split(0.5)); - } // add the middle piece to the result - - qs.push(cubic); - // finally add the tail, reversed, onto the result - Array.prototype.push.apply(qs, tail.reverse()); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return qs; - } /** - * @function pushLine - * @param {Number} x0 - * @param {Number} y0 - * @param {Number} x1 - * @param {Number} y1 - * - * add a straight line to the row/col grid of a glyph - */ - - function pushLine(x0, y0, x1, y1) { - var mx = (x0 + x1) / 2; - var my = (y0 + y1) / 2; - push([x0, - x1], [ - y0, - y1 - ], { - x: x0, - y: y0, - cx: mx, - cy: my - }); - } /** - * @function samePoint - * @param {Number} x0 - * @param {Number} y0 - * @param {Number} x1 - * @param {Number} y1 - * @return {Boolean} true if the two points are sufficiently close - * - * tests if two points are close enough to be considered the same - */ - - function samePoint(x0, y0, x1, y1) { - return Math.abs(x1 - x0) < 0.00001 && Math.abs(y1 - y0) < 0.00001; - } - var x0, - y0, - xs, - ys; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for (var _iterator2 = cmds[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var cmd = _step2.value; - // scale the coordinates to the range 0-1 - var x1 = (cmd.x - xMin) / gWidth; - var y1 = (cmd.y - yMin) / gHeight; - // don't bother if this point is the same as the last - if (samePoint(x0, y0, x1, y1)) continue; - switch (cmd.type) { - case 'M': - { - // move - xs = x1; - ys = y1; - break; - } - case 'L': - { - // line - pushLine(x0, y0, x1, y1); - break; - } - case 'Q': - { - // quadratic - var cx = (cmd.x1 - xMin) / gWidth; - var cy = (cmd.y1 - yMin) / gHeight; - push([x0, - x1, - cx], [ - y0, - y1, - cy - ], { - x: x0, - y: y0, - cx: cx, - cy: cy - }); - break; - } - case 'Z': - { - // end - if (!samePoint(x0, y0, xs, ys)) { - // add an extra line closing the loop, if necessary - pushLine(x0, y0, xs, ys); - strokes.push({ - x: xs, - y: ys - }); - } else { - strokes.push({ - x: x0, - y: y0 - }); - } - break; - } - case 'C': - { - // cubic - var cx1 = (cmd.x1 - xMin) / gWidth; - var cy1 = (cmd.y1 - yMin) / gHeight; - var cx2 = (cmd.x2 - xMin) / gWidth; - var cy2 = (cmd.y2 - yMin) / gHeight; - var qs = cubicToQuadratics(x0, y0, cx1, cy1, cx2, cy2, x1, y1); - for (var iq = 0; iq < qs.length; iq++) { - var q = qs[iq].toQuadratic(); - push([q.x, - q.x1, - q.cx], [ - q.y, - q.y1, - q.cy - ], q); - } - break; - } - default: - throw new Error('unknown command type: '.concat(cmd.type)); - } - x0 = x1; - y0 = y1; - } // allocate space for the strokes - - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - var strokeCount = strokes.length; - var strokeImageInfo = this.strokeImageInfos.findImage(strokeCount); - var strokeOffset = strokeImageInfo.index; - // fill the stroke image - for (var il = 0; il < strokeCount; ++il) { - var s = strokes[il]; - setPixel(strokeImageInfo, byte(s.x), byte(s.y), byte(s.cx), byte(s.cy)); - } /** - * @function layout - * @param {Number[][]} dim - * @param {ImageInfo[]} dimImageInfos - * @param {ImageInfo[]} cellImageInfos - * @return {Object} - * - * lays out the curves in a dimension (row or col) into two - * images, one for the indices of the curves themselves, and - * one containing the offset and length of those index spans. - */ - - function layout(dim, dimImageInfos, cellImageInfos) { - var dimLength = dim.length; // the number of slices in this dimension - var dimImageInfo = dimImageInfos.findImage(dimLength); - var dimOffset = dimImageInfo.index; - // calculate the total number of stroke indices in this dimension - var totalStrokes = 0; - for (var id = 0; id < dimLength; ++id) { - totalStrokes += dim[id].length; - } // allocate space for the stroke indices - - var cellImageInfo = cellImageInfos.findImage(totalStrokes); - // for each slice in the glyph - for (var _i2 = 0; _i2 < dimLength; ++_i2) { - var strokeIndices = dim[_i2]; - var _strokeCount = strokeIndices.length; - var cellLineIndex = cellImageInfo.index; - // write the offset and count into the glyph slice image - setPixel(dimImageInfo, cellLineIndex >> 7, cellLineIndex & 127, _strokeCount >> 7, _strokeCount & 127); - // for each stroke index in that slice - for (var iil = 0; iil < _strokeCount; ++iil) { - // write the stroke index into the slice's image - var strokeIndex = strokeIndices[iil] + strokeOffset; - setPixel(cellImageInfo, strokeIndex >> 7, strokeIndex & 127, 0, 0); - } - } - return { - cellImageInfo: cellImageInfo, - dimOffset: dimOffset, - dimImageInfo: dimImageInfo - }; - } // initialize the info for this glyph - - gi = this.glyphInfos[glyph.index] = { - glyph: glyph, - uGlyphRect: [ - bb.x1, - - bb.y1, - bb.x2, - - bb.y2 - ], - strokeImageInfo: strokeImageInfo, - strokes: strokes, - colInfo: layout(cols, this.colDimImageInfos, this.colCellImageInfos), - rowInfo: layout(rows, this.rowDimImageInfos, this.rowCellImageInfos) - }; - gi.uGridOffset = [ - gi.colInfo.dimOffset, - gi.rowInfo.dimOffset - ]; - return gi; - } - } - ]); - return FontInfo; - }(); - _main.default.RendererGL.prototype._renderText = function (p, line, x, y, maxY) { - if (!this._textFont || typeof this._textFont === 'string') { - console.log('WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.'); - return; - } - if (y >= maxY || !this._doFill) { - return; // don't render lines beyond our maxY position - } - if (!this._isOpenType()) { - console.log('WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported'); - return p; - } - p.push(); // fix to #803 - // remember this state, so it can be restored later - var doStroke = this._doStroke; - var drawMode = this.drawMode; - this._doStroke = false; - this.drawMode = constants.TEXTURE; - // get the cached FontInfo object - var font = this._textFont.font; - var fontInfo = this._textFont._fontInfo; - if (!fontInfo) { - fontInfo = this._textFont._fontInfo = new FontInfo(font); - } // calculate the alignment and move/scale the view accordingly - - var pos = this._textFont._handleAlignment(this, line, x, y); - var fontSize = this._textSize; - var scale = fontSize / font.unitsPerEm; - this.translate(pos.x, pos.y, 0); - this.scale(scale, scale, 1); - // initialize the font shader - var gl = this.GL; - var initializeShader = !this._defaultFontShader; - var sh = this._getFontShader(); - sh.init(); - sh.bindShader(); // first time around, bind the shader fully - if (initializeShader) { - // these are constants, really. just initialize them one-time. - sh.setUniform('uGridImageSize', [ - gridImageWidth, - gridImageHeight - ]); - sh.setUniform('uCellsImageSize', [ - cellImageWidth, - cellImageHeight - ]); - sh.setUniform('uStrokeImageSize', [ - strokeImageWidth, - strokeImageHeight - ]); - sh.setUniform('uGridSize', [ - charGridWidth, - charGridHeight - ]); - } - this._applyColorBlend(this.curFillColor); - var g = this.retainedMode.geometry['glyph']; - if (!g) { - // create the geometry for rendering a quad - var geom = this._textGeom = new _main.default.Geometry(1, 1, function () { - for (var i = 0; i <= 1; i++) { - for (var j = 0; j <= 1; j++) { - this.vertices.push(new _main.default.Vector(j, i, 0)); - this.uvs.push(j, i); - } - } - }); - geom.computeFaces().computeNormals(); - g = this.createBuffers('glyph', geom); - } // bind the shader buffers - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for (var _iterator3 = this.retainedMode.buffers.text[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var buff = _step3.value; - buff._prepareBuffer(g, sh); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - this._bindBuffer(g.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); - // this will have to do for now... - sh.setUniform('uMaterialColor', this.curFillColor); - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - try { - var dx = 0; // the x position in the line - var glyphPrev = null; // the previous glyph, used for kerning - // fetch the glyphs in the line of text - var glyphs = font.stringToGlyphs(line); - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for (var _iterator4 = glyphs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var glyph = _step4.value; - // kern - if (glyphPrev) dx += font.getKerningValue(glyphPrev, glyph); - var gi = fontInfo.getGlyphInfo(glyph); - if (gi.uGlyphRect) { - var rowInfo = gi.rowInfo; - var colInfo = gi.colInfo; - sh.setUniform('uSamplerStrokes', gi.strokeImageInfo.imageData); - sh.setUniform('uSamplerRowStrokes', rowInfo.cellImageInfo.imageData); - sh.setUniform('uSamplerRows', rowInfo.dimImageInfo.imageData); - sh.setUniform('uSamplerColStrokes', colInfo.cellImageInfo.imageData); - sh.setUniform('uSamplerCols', colInfo.dimImageInfo.imageData); - sh.setUniform('uGridOffset', gi.uGridOffset); - sh.setUniform('uGlyphRect', gi.uGlyphRect); - sh.setUniform('uGlyphOffset', dx); - sh.bindTextures(); // afterwards, only textures need updating - // draw it - gl.drawElements(gl.TRIANGLES, 6, this.GL.UNSIGNED_SHORT, 0); - } - dx += glyph.advanceWidth; - glyphPrev = glyph; - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return != null) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - } finally { - // clean up - sh.unbindShader(); - this._doStroke = doStroke; - this.drawMode = drawMode; - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - p.pop(); - } - return p; - }; - }, - { - '../core/constants': 286, - '../core/main': 298, - './p5.RendererGL.Retained': 354, - './p5.Shader': 356, - 'core-js/modules/es.array.iterator': 179, - 'core-js/modules/es.object.get-own-property-descriptor': 196, - 'core-js/modules/es.object.to-string': 200, - 'core-js/modules/es.regexp.exec': 205, - 'core-js/modules/es.string.iterator': 210, - 'core-js/modules/es.string.split': 216, - 'core-js/modules/es.string.sub': 218, - 'core-js/modules/es.symbol': 222, - 'core-js/modules/es.symbol.description': 220, - 'core-js/modules/es.symbol.iterator': 221, - 'core-js/modules/es.weak-map': 254, - 'core-js/modules/web.dom-collections.iterator': 256 - } - ], - 359: [ - function (_dereq_, module, exports) { - module.exports = { - 'fes': { - 'autoplay': 'The media that tried to play (with \'{{src}}\') wasn\'t allowed to by this browser, most likely due to the browser\'s autoplay policy.\n\n+ More info: {{url}}', - 'checkUserDefinedFns': 'It seems that you may have accidentally written {{name}} instead of {{actualName}}. Please correct it if it\'s not intentional.', - 'fileLoadError': { - 'bytes': 'It looks like there was a problem loading your file. {{suggestion}}', - 'font': 'It looks like there was a problem loading your font. {{suggestion}}', - 'gif': 'There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.', - 'image': 'It looks like there was a problem loading your image. {{suggestion}}', - 'json': 'It looks like there was a problem loading your JSON file. {{suggestion}}', - 'large': 'If your large file isn\'t fetched successfully, we recommend splitting the file into smaller segments and fetching those.', - 'strings': 'It looks like there was a problem loading your text file. {{suggestion}}', - 'suggestion': 'Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server.\n\n+ More info: {{url}}', - 'table': 'It looks like there was a problem loading your table file. {{suggestion}}', - 'xml': 'It looks like there was a problem loading your XML file. {{suggestion}}' - }, - 'friendlyParamError': { - 'type_EMPTY_VAR': '{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received an empty variable instead. If not intentional, this is often a problem with scope.\n\n+ More info: {{url}}', - 'type_TOO_FEW_ARGUMENTS': '{{location}} {{func}}() was expecting at least {{minParams}} arguments, but received only {{argCount}}.', - 'type_TOO_MANY_ARGUMENTS': '{{location}} {{func}}() was expecting no more than {{maxParams}} arguments, but received {{argCount}}.', - 'type_WRONG_TYPE': '{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received {{argType}} instead.' - }, - 'globalErrors': { - 'reference': { - 'cannotAccess': '\n{{location}} "{{symbol}}" is used before declaration. Make sure you have declared the variable before using it.\n\n+ More info: {{url}}', - 'notDefined': '\n{{location}} "{{symbol}}" is not defined in the current scope. If you have defined it in your code, you should check its scope, spelling, and letter-casing (JavaScript is case-sensitive).\n\n+ More info: {{url}}' - }, - 'stackSubseq': '└[{{location}}] \n\t Called from line {{line}} in {{func}}()\n', - 'stackTop': '┌[{{location}}] \n\t Error at line {{line}} in {{func}}()\n', - 'syntax': { - 'badReturnOrYield': '\nSyntax Error - return lies outside of a function. Make sure you’re not missing any brackets, so that return lies inside a function.\n\n+ More info: {{url}}', - 'invalidToken': '\nSyntax Error - Found a symbol that JavaScript doesn\'t recognize or didn\'t expect at it\'s place.\n\n+ More info: {{url}}', - 'missingInitializer': '\nSyntax Error - A const variable is declared but not initialized. In JavaScript, an initializer for a const is required. A value must be specified in the same statement in which the variable is declared. Check the line number in the error and assign the const variable a value.\n\n+ More info: {{url}}', - 'redeclaredVariable': '\nSyntax Error - "{{symbol}}" is being redeclared. JavaScript doesn\'t allow declaring a variable more than once. Check the line number in error for redeclaration of the variable.\n\n+ More info: {{url}}', - 'unexpectedToken': '\nSyntax Error - Symbol present at a place that wasn\'t expected.\nUsually this is due to a typo. Check the line number in the error for anything missing/extra.\n\n+ More info: {{url}}' - }, - 'type': { - 'constAssign': '\n{{location}} A const variable is being re-assigned. In javascript, re-assigning a value to a constant is not allowed. If you want to re-assign new values to a variable, make sure it is declared as var or let.\n\n+ More info: {{url}}', - 'notfunc': '\n{{location}} "{{symbol}}" could not be called as a function.\nCheck the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', - 'notfuncObj': '\n{{location}} "{{symbol}}" could not be called as a function.\nVerify whether "{{obj}}" has "{{symbol}}" in it and check the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', - 'readFromNull': '\n{{location}} The property of null can\'t be read. In javascript the value null indicates that an object has no value.\n\n+ More info: {{url}}', - 'readFromUndefined': '\n{{location}} Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated is not undefined.\n\n + More info: {{url}}' - } - }, - 'libraryError': '{{location}} An error with message "{{error}}" occurred inside the p5js library when {{func}} was called. If not stated otherwise, it might be an issue with the arguments passed to {{func}}.', - 'location': '[{{file}}, line {{line}}]', - 'misspelling': '{{location}} It seems that you may have accidentally written "{{name}}" instead of "{{actualName}}". Please correct it to {{actualName}} if you wish to use the {{type}} from p5.js.', - 'misspelling_plural': '{{location}} It seems that you may have accidentally written "{{name}}".\nYou may have meant one of the following: \n{{suggestions}}', - 'misusedTopLevel': 'Did you just try to use p5.js\'s {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch\'s setup() function.\n\n+ More info: {{url}}', - 'positions': { - 'p_1': 'first', - 'p_10': 'tenth', - 'p_11': 'eleventh', - 'p_12': 'twelfth', - 'p_2': 'second', - 'p_3': 'third', - 'p_4': 'fourth', - 'p_5': 'fifth', - 'p_6': 'sixth', - 'p_7': 'seventh', - 'p_8': 'eighth', - 'p_9': 'ninth' - }, - 'pre': '\n🌸 p5.js says: {{message}}', - 'sketchReaderErrors': { - 'reservedConst': 'you have used a p5.js reserved variable "{{symbol}}" make sure you change the variable name to something else.\n\n+ More info: {{url}}', - 'reservedFunc': 'you have used a p5.js reserved function "{{symbol}}" make sure you change the function name to something else.\n\n+ More info: {{url}}' - }, - 'welcome': 'Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js.', - 'wrongPreload': '{{location}} An error with message "{{error}}" occurred inside the p5js library when "{{func}}" was called. If not stated otherwise, it might be due to "{{func}}" being called from preload. Nothing besides load calls (loadImage, loadJSON, loadFont, loadStrings, etc.) should be inside the preload function.' - } - } - }, - { - } - ], - 360: [ - function (_dereq_, module, exports) { - 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports.languages = exports.default = void 0; - var _translation = _interopRequireDefault(_dereq_('./en/translation')); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: - obj - }; - } // Only one language is imported above. This is intentional as other languages - // will be hosted online and then downloaded whenever needed - /** - * Here, we define a default/fallback language which we can use without internet. - * You won't have to change this when adding a new language. + _main.default.prototype.saveFrames = function ( + fName, + ext, + _duration, + _fps, + callback, + ) { + _main.default._validateParameters("saveFrames", arguments); + var duration = _duration || 3; + duration = _main.default.prototype.constrain(duration, 0, 15); + duration = duration * 1000; + var fps = _fps || 15; + fps = _main.default.prototype.constrain(fps, 0, 22); + var count = 0; + var makeFrame = _main.default.prototype._makeFrame; + var cnv = this._curElement.elt; + var frames = []; + var frameFactory = setInterval(function () { + frames.push(makeFrame(fName + count, ext, cnv)); + count++; + }, 1000 / fps); + setTimeout(function () { + clearInterval(frameFactory); + if (callback) { + callback(frames); + } else { + for ( + var _i4 = 0, _frames = frames; + _i4 < _frames.length; + _i4++ + ) { + var f = _frames[_i4]; + _main.default.prototype.downloadFile( + f.imageData, + f.filename, + f.ext, + ); + } + } + frames = []; // clear frames + }, duration + 0.01); + }; + _main.default.prototype._makeFrame = function ( + filename, + extension, + _cnv, + ) { + var cnv; + if (this) { + cnv = this._curElement.elt; + } else { + cnv = _cnv; + } + var mimeType; + if (!extension) { + extension = "png"; + mimeType = "image/png"; + } else { + switch (extension.toLowerCase()) { + case "png": + mimeType = "image/png"; + break; + case "jpeg": + mimeType = "image/jpeg"; + break; + case "jpg": + mimeType = "image/jpeg"; + break; + default: + mimeType = "image/png"; + break; + } + } + var downloadMime = "image/octet-stream"; + var imageData = cnv.toDataURL(mimeType); + imageData = imageData.replace(mimeType, downloadMime); + var thisFrame = {}; + thisFrame.imageData = imageData; + thisFrame.filename = filename; + thisFrame.ext = extension; + return thisFrame; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.set": 207, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint32-array": 251, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + omggif: 270, + }, + ], + 321: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.copy-within"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.copy-within"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + _dereq_("regenerator-runtime/runtime"); + var _main = _interopRequireDefault(_dereq_("../core/main")); + var _helpers = _interopRequireDefault(_dereq_("../core/helpers")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + var _omggif = _interopRequireDefault(_dereq_("omggif")); + var _gifenc = _dereq_("gifenc"); + _dereq_("../core/friendly_errors/validate_params"); + _dereq_("../core/friendly_errors/file_errors"); + _dereq_("../core/friendly_errors/fes_core"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function asyncGeneratorStep( + gen, + resolve, + reject, + _next, + _throw, + key, + arg, + ) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep( + gen, + resolve, + reject, + _next, + _throw, + "next", + value, + ); + } + function _throw(err) { + asyncGeneratorStep( + gen, + resolve, + reject, + _next, + _throw, + "throw", + err, + ); + } + _next(undefined); + }); + }; + } /** + * @module Image + * @submodule Loading & Displaying + * @for p5 + * @requires core + */ + /** + * Loads an image to create a p5.Image object. + * + * `loadImage()` interprets the first parameter one of three ways. If the path + * to an image file is provided, `loadImage()` will load it. Paths to local + * files should be relative, such as `'assets/thundercat.jpg'`. URLs such as + * `'https://example.com/thundercat.jpg'` may be blocked due to browser + * security. Raw image data can also be passed as a base64 encoded image in + * the form `'data:image/png;base64,arandomsequenceofcharacters'`. + * + * The second parameter is optional. If a function is passed, it will be + * called once the image has loaded. The callback function can optionally use + * the new p5.Image object. + * + * The third parameter is also optional. If a function is passed, it will be + * called if the image fails to load. The callback function can optionally use + * the event error. + * + * Images can take time to load. Calling `loadImage()` in + * preload() ensures images load before they're + * used in setup() or draw(). + * + * @method loadImage + * @param {String} path path of the image to be loaded or base64 encoded image. + * @param {function(p5.Image)} [successCallback] function called with + * p5.Image once it + * loads. + * @param {function(Event)} [failureCallback] function called with event + * error if the image fails to load. + * @return {p5.Image} the p5.Image object. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * describe('Image of the underside of a white umbrella and a gridded ceiling.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * loadImage('assets/laDefense.jpg', img => { + * image(img, 0, 0); + * }); + * describe('Image of the underside of a white umbrella and a gridded ceiling.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * loadImage('assets/laDefense.jpg', success, failure); + * } + * + * function success(img) { + * image(img, 0, 0); + * describe('Image of the underside of a white umbrella and a gridded ceiling.'); + * } + * + * function failure(event) { + * console.error('Oops!', event); + * } + * + *
                    + */ + + _main.default.prototype.loadImage = function ( + path, + successCallback, + failureCallback, + ) { + _main.default._validateParameters("loadImage", arguments); + var pImg = new _main.default.Image(1, 1, this); + var self = this; + var req = new Request(path, { + method: "GET", + mode: "cors", + }); + fetch(path, req) + .then(function (response) { + // GIF section + var contentType = response.headers.get("content-type"); + if (contentType === null) { + console.warn( + "The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset.", + ); + } + if (contentType && contentType.includes("image/gif")) { + response.arrayBuffer().then( + function (arrayBuffer) { + if (arrayBuffer) { + var byteArray = new Uint8Array(arrayBuffer); + _createGif( + byteArray, + pImg, + successCallback, + failureCallback, + function (pImg) { + self._decrementPreload(); + }.bind(self), + ); + } + }, + function (e) { + if (typeof failureCallback === "function") { + failureCallback(e); + self._decrementPreload(); + } else { + console.error(e); + } + }, + ); + } else { + // Non-GIF Section + var img = new Image(); + img.onload = function () { + pImg.width = pImg.canvas.width = img.width; + pImg.height = pImg.canvas.height = img.height; + // Draw the image into the backing canvas of the p5.Image + pImg.drawingContext.drawImage(img, 0, 0); + pImg.modified = true; + if (typeof successCallback === "function") { + successCallback(pImg); + } + self._decrementPreload(); + }; + img.onerror = function (e) { + _main.default._friendlyFileLoadError(0, img.src); + if (typeof failureCallback === "function") { + failureCallback(e); + self._decrementPreload(); + } else { + console.error(e); + } + }; + // Set crossOrigin in case image is served with CORS headers. + // This will let us draw to the canvas without tainting it. + // See https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image + // When using data-uris the file will be loaded locally + // so we don't need to worry about crossOrigin with base64 file types. + if (path.indexOf("data:image/") !== 0) { + img.crossOrigin = "Anonymous"; + } // start loading the image + + img.src = path; + } + pImg.modified = true; + }) + .catch(function (e) { + _main.default._friendlyFileLoadError(0, path); + if (typeof failureCallback === "function") { + failureCallback(e); + self._decrementPreload(); + } else { + console.error(e); + } + }); + return pImg; + }; + /** + * Generates a gif from a sketch and saves it to a file. `saveGif()` may be + * called in setup() or at any point while a sketch + * is running. + * + * The first parameter, `fileName`, sets the gif's file name. The second + * parameter, `duration`, sets the gif's duration in seconds. + * + * The third parameter, `options`, is optional. If an object is passed, + * `saveGif()` will use its properties to customize the gif. `saveGif()` + * recognizes the properties `delay`, `units`, `silent`, + * `notificationDuration`, and `notificationID`. + * + * @method saveGif + * @param {String} filename file name of gif. + * @param {Number} duration duration in seconds to capture from the sketch. + * @param {Object} [options] an object that can contain five more properties: + * `delay`, a Number specifying how much time to wait before recording; + * `units`, a String that can be either 'seconds' or 'frames'. By default it's 'seconds’; + * `silent`, a Boolean that defines presence of progress notifications. By default it’s `false`; + * `notificationDuration`, a Number that defines how long in seconds the final notification + * will live. By default it's `0`, meaning the notification will never be removed; + * `notificationID`, a String that specifies the id of the notification's DOM element. By default it’s `'progressBar’`. + * + * @example + *
                    + * + * function draw() { + * background(200); + * let c = frameCount % 255; + * fill(c); + * circle(50, 50, 25); + * + * describe('A circle drawn in the middle of a gray square. The circle changes color from black to white, then repeats.'); + * } + * + * function keyPressed() { + * if (key === 's') { + * saveGif('mySketch', 5); + * } + * } + * + *
                    + */ + _main.default.prototype.saveGif = /*#__PURE__*/ (function () { + var _ref = _asyncToGenerator( + /*#__PURE__*/ regeneratorRuntime.mark( + function _callee(fileName, duration) { + var options, + delay, + units, + silent, + notificationDuration, + notificationID, + _frameRate, + gifFrameDelay, + nFrames, + nFramesDelay, + totalNumberOfFrames, + frameIterator, + lastPixelDensity, + frames, + p, + pixels, + gl, + data, + gif, + globalPalette, + paletteCache, + getIndexedFrame, + transparentIndex, + prevIndexedFrame, + i, + indexedFrame, + originalIndexedFrame, + _i, + buffer, + extension, + blob, + _args = arguments; + return regeneratorRuntime.wrap( + function _callee$(_context) { + while (1) { + switch ((_context.prev = _context.next)) { + case 0: + options = + _args.length > 2 && _args[2] !== undefined + ? _args[2] + : { + delay: 0, + units: "seconds", + silent: false, + notificationDuration: 0, + notificationID: "progressBar", + }; + if (!(typeof fileName !== "string")) { + _context.next = 3; + break; + } + throw TypeError( + "fileName parameter must be a string", + ); + case 3: + if (!(typeof duration !== "number")) { + _context.next = 5; + break; + } + throw TypeError( + "Duration parameter must be a number", + ); + case 5: + // extract variables for more comfortable use + delay = (options && options.delay) || 0; // in seconds + units = (options && options.units) || "seconds"; // either 'seconds' or 'frames' + silent = (options && options.silent) || false; + notificationDuration = + (options && options.notificationDuration) || 0; + notificationID = + (options && options.notificationID) || + "progressBar"; // if arguments in the options object are not correct, cancel operation + if (!(typeof delay !== "number")) { + _context.next = 12; + break; + } + throw TypeError("Delay parameter must be a number"); + case 12: + if (!(units !== "seconds" && units !== "frames")) { + _context.next = 14; + break; + } + throw TypeError( + 'Units parameter must be either "frames" or "seconds"', + ); + case 14: + if (!(typeof silent !== "boolean")) { + _context.next = 16; + break; + } + throw TypeError( + "Silent parameter must be a boolean", + ); + case 16: + if (!(typeof notificationDuration !== "number")) { + _context.next = 18; + break; + } + throw TypeError( + "Notification duration parameter must be a number", + ); + case 18: + if (!(typeof notificationID !== "string")) { + _context.next = 20; + break; + } + throw TypeError( + "Notification ID parameter must be a string", + ); + case 20: + this._recording = true; + // get the project's framerate + _frameRate = this._targetFrameRate; // if it is undefined or some non useful value, assume it's 60 + if ( + _frameRate === Infinity || + _frameRate === undefined || + _frameRate === 0 + ) { + _frameRate = 60; + } // calculate frame delay based on frameRate + // this delay has nothing to do with the + // delay in options, but rather is the delay + // we have to specify to the gif encoder between frames. + + gifFrameDelay = (1 / _frameRate) * 1000; // constrain it to be always greater than 20, + // otherwise it won't work in some browsers and systems + // reference: https://stackoverflow.com/questions/64473278/gif-frame-duration-seems-slower-than-expected + gifFrameDelay = + gifFrameDelay < 20 ? 20 : gifFrameDelay; + // check the mode we are in and how many frames + // that duration translates to + nFrames = + units === "seconds" + ? duration * _frameRate + : duration; + nFramesDelay = + units === "seconds" ? delay * _frameRate : delay; + totalNumberOfFrames = nFrames + nFramesDelay; // initialize variables for the frames processing + frameIterator = nFramesDelay; + this.frameCount = frameIterator; + lastPixelDensity = this._pixelDensity; + this.pixelDensity(1); + // We first take every frame that we are going to use for the animation + frames = []; + if ( + document.getElementById(notificationID) !== null + ) + document.getElementById(notificationID).remove(); + if (!silent) { + p = this.createP(""); + p.id(notificationID); + p.style("font-size", "16px"); + p.style("font-family", "Montserrat"); + p.style("background-color", "#ffffffa0"); + p.style("padding", "8px"); + p.style("border-radius", "10px"); + p.position(0, 0); + } + if ( + this._renderer instanceof _main.default.RendererGL + ) { + // if we have a WEBGL context, initialize the pixels array + // and the gl context to use them inside the loop + gl = this.drawingContext; + pixels = new Uint8Array( + gl.drawingBufferWidth * + gl.drawingBufferHeight * + 4, + ); + } // stop the loop since we are going to manually redraw + + this.noLoop(); + // Defer execution until the rest of the call stack finishes, allowing the + // rest of `setup` to be called (and, importantly, canvases hidden in setup + // to be unhidden.) + // + // Waiting on this empty promise means we'll continue as soon as setup + // finishes without waiting for another frame. + _context.next = 39; + return Promise.resolve(); + case 39: + if (!(frameIterator < totalNumberOfFrames)) { + _context.next = 50; + break; + } /* + we draw the next frame. this is important, since + busy sketches or low end devices might take longer + to render some frames. So we just wait for the frame + to be drawn and immediately save it to a buffer and continue + */ + + this.redraw(); + // depending on the context we'll extract the pixels one way + // or another + data = undefined; + if ( + this._renderer instanceof _main.default.RendererGL + ) { + pixels = new Uint8Array( + gl.drawingBufferWidth * + gl.drawingBufferHeight * + 4, + ); + gl.readPixels( + 0, + 0, + gl.drawingBufferWidth, + gl.drawingBufferHeight, + gl.RGBA, + gl.UNSIGNED_BYTE, + pixels, + ); + data = _flipPixels(pixels); + } else { + data = this.drawingContext.getImageData( + 0, + 0, + this.width, + this.height, + ).data; + } + frames.push(data); + frameIterator++; + if (!silent) { + p.html( + "Saved frame " + + frames.length.toString() + + " out of " + + nFrames.toString(), + ); + } + _context.next = 48; + return new Promise(function (resolve) { + return setTimeout(resolve, 0); + }); + case 48: + _context.next = 39; + break; + case 50: + if (!silent) + p.html( + "Frames processed, generating color palette...", + ); + this.loop(); + this.pixelDensity(lastPixelDensity); + // create the gif encoder and the colorspace format + gif = (0, _gifenc.GIFEncoder)(); // calculate the global palette for this set of frames + globalPalette = _generateGlobalPalette(frames); // Rather than using applyPalette() from the gifenc library, we use our + // own function to map frame pixels to a palette color. This way, we can + // cache palette color mappings between frames for extra performance, and + // use our own caching mechanism to avoid flickering colors from cache + // key collisions. + paletteCache = {}; + getIndexedFrame = function getIndexedFrame(frame) { + var length = frame.length / 4; + var index = new Uint8Array(length); + for (var i = 0; i < length; i++) { + var key = + (frame[i * 4] << 24) | + (frame[i * 4 + 1] << 16) | + (frame[i * 4 + 2] << 8) | + frame[i * 4 + 3]; + if (paletteCache[key] === undefined) { + paletteCache[key] = (0, + _gifenc.nearestColorIndex)( + globalPalette, + frame.slice(i * 4, (i + 1) * 4), + ); + } + index[i] = paletteCache[key]; + } + return index; + }; // the way we designed the palette means we always take the last index for transparency + transparentIndex = globalPalette.length - 1; // we are going to iterate the frames in pairs, n-1 and n + prevIndexedFrame = []; + i = 0; + case 60: + if (!(i < frames.length)) { + _context.next = 71; + break; + } //const indexedFrame = applyPalette(frames[i], globalPaletteWithoutAlpha, 'rgba565'); + + indexedFrame = getIndexedFrame(frames[i]); // Make a copy of the palette-applied frame before editing the original + // to use transparent pixels + originalIndexedFrame = indexedFrame.slice(); + if (i === 0) { + gif.writeFrame( + indexedFrame, + this.width, + this.height, + { + palette: globalPalette, + delay: gifFrameDelay, + dispose: 1, + }, + ); + } else { + // Matching pixels between frames can be set to full transparency, + // allowing the previous frame's pixels to show through. We only do + // this for pixels that get mapped to the same quantized color so that + // the resulting image would be the same. + for (_i = 0; _i < indexedFrame.length; _i++) { + if (indexedFrame[_i] === prevIndexedFrame[_i]) { + indexedFrame[_i] = transparentIndex; + } + } // Write frame into the encoder + + gif.writeFrame( + indexedFrame, + this.width, + this.height, + { + delay: gifFrameDelay, + transparent: true, + transparentIndex: transparentIndex, + dispose: 1, + }, + ); + } + prevIndexedFrame = originalIndexedFrame; + if (!silent) { + p.html( + "Rendered frame " + + i.toString() + + " out of " + + nFrames.toString(), + ); + } // this just makes the process asynchronous, preventing + // that the encoding locks up the browser + + _context.next = 68; + return new Promise(function (resolve) { + return setTimeout(resolve, 0); + }); + case 68: + i++; + _context.next = 60; + break; + case 71: + gif.finish(); + // Get a direct typed array view into the buffer to avoid copying it + buffer = gif.bytesView(); + extension = "gif"; + blob = new Blob([buffer], { + type: "image/gif", + }); + frames = []; + this._recording = false; + this.loop(); + if (!silent) { + p.html("Done. Downloading your gif!🌸"); + if (notificationDuration > 0) + setTimeout(function () { + return p.remove(); + }, notificationDuration * 1000); + } + _main.default.prototype.downloadFile( + blob, + fileName, + extension, + ); + case 80: + case "end": + return _context.stop(); + } + } + }, + _callee, + this, + ); + }, + ), + ); + return function (_x, _x2) { + return _ref.apply(this, arguments); + }; + })(); + function _flipPixels(pixels) { + // extracting the pixels using readPixels returns + // an upside down image. we have to flip it back + // first. this solution is proposed by gman on + // this stack overflow answer: + // https://stackoverflow.com/questions/41969562/how-can-i-flip-the-result-of-webglrenderingcontext-readpixels + var halfHeight = parseInt(height / 2); + var bytesPerRow = width * 4; + // make a temp buffer to hold one row + var temp = new Uint8Array(width * 4); + for (var y = 0; y < halfHeight; ++y) { + var topOffset = y * bytesPerRow; + var bottomOffset = (height - y - 1) * bytesPerRow; + // make copy of a row on the top half + temp.set(pixels.subarray(topOffset, topOffset + bytesPerRow)); + // copy a row from the bottom half to the top + pixels.copyWithin( + topOffset, + bottomOffset, + bottomOffset + bytesPerRow, + ); + // copy the copy of the top half row to the bottom half + pixels.set(temp, bottomOffset); + } + return pixels; + } + function _generateGlobalPalette(frames) { + // make an array the size of every possible color in every possible frame + // that is: width * height * frames. + var allColors = new Uint8Array(frames.length * frames[0].length); + // put every frame one after the other in sequence. + // this array will hold absolutely every pixel from the animation. + // the set function on the Uint8Array works super fast tho! + for (var f = 0; f < frames.length; f++) { + allColors.set(frames[f], f * frames[0].length); + } // quantize this massive array into 256 colors and return it! + + var colorPalette = (0, _gifenc.quantize)(allColors, 256, { + format: "rgba4444", + oneBitAlpha: true, + }); + // when generating the palette, we have to leave space for 1 of the + // indices to be a random color that does not appear anywhere in our + // animation to use for transparency purposes. So, if the palette is full + // (has 256 colors), we overwrite the last one with a random, fully transparent + // color. Otherwise, we just push a new color into the palette the same way. + // this guarantees that when using the transparency index, there are no matches + // between some colors of the animation and the "holes" we want to dig on them, + // which would cause pieces of some frames to be transparent and thus look glitchy. + if (colorPalette.length === 256) { + colorPalette[colorPalette.length - 1] = [ + Math.random() * 255, + Math.random() * 255, + Math.random() * 255, + 0, + ]; + } else { + colorPalette.push([ + Math.random() * 255, + Math.random() * 255, + Math.random() * 255, + 0, + ]); + } + return colorPalette; + } /** + * Helper function for loading GIF-based images + */ + + function _createGif( + arrayBuffer, + pImg, + successCallback, + failureCallback, + finishCallback, + ) { + var gifReader = new _omggif.default.GifReader(arrayBuffer); + pImg.width = pImg.canvas.width = gifReader.width; + pImg.height = pImg.canvas.height = gifReader.height; + var frames = []; + var numFrames = gifReader.numFrames(); + var framePixels = new Uint8ClampedArray( + pImg.width * pImg.height * 4, + ); + var loadGIFFrameIntoImage = function loadGIFFrameIntoImage( + frameNum, + gifReader, + ) { + try { + gifReader.decodeAndBlitFrameRGBA(frameNum, framePixels); + } catch (e) { + _main.default._friendlyFileLoadError(8, pImg.src); + if (typeof failureCallback === "function") { + failureCallback(e); + } else { + console.error(e); + } + } + }; + for (var j = 0; j < numFrames; j++) { + var frameInfo = gifReader.frameInfo(j); + var prevFrameData = pImg.drawingContext.getImageData( + 0, + 0, + pImg.width, + pImg.height, + ); + framePixels = prevFrameData.data.slice(); + loadGIFFrameIntoImage(j, gifReader); + var imageData = new ImageData( + framePixels, + pImg.width, + pImg.height, + ); + pImg.drawingContext.putImageData(imageData, 0, 0); + var frameDelay = frameInfo.delay; + // To maintain the default of 10FPS when frameInfo.delay equals to 0 + if (frameDelay === 0) { + frameDelay = 10; + } + frames.push({ + image: pImg.drawingContext.getImageData( + 0, + 0, + pImg.width, + pImg.height, + ), + delay: frameDelay * 10, //GIF stores delay in one-hundredth of a second, shift to ms + }); + // Some GIFs are encoded so that they expect the previous frame + // to be under the current frame. This can occur at a sub-frame level + // + // Values : 0 - No disposal specified. The decoder is + // not required to take any action. + // 1 - Do not dispose. The graphic is to be left + // in place. + // 2 - Restore to background color. The area used by the + // graphic must be restored to the background color. + // 3 - Restore to previous. The decoder is required to + // restore the area overwritten by the graphic with + // what was there prior to rendering the graphic. + // 4-7 - To be defined. + if (frameInfo.disposal === 2) { + // Restore background color + pImg.drawingContext.clearRect( + frameInfo.x, + frameInfo.y, + frameInfo.width, + frameInfo.height, + ); + } else if (frameInfo.disposal === 3) { + // Restore previous + pImg.drawingContext.putImageData( + prevFrameData, + 0, + 0, + frameInfo.x, + frameInfo.y, + frameInfo.width, + frameInfo.height, + ); + } + } //Uses Netscape block encoding + //to repeat forever, this will be 0 + //to repeat just once, this will be null + //to repeat N times (1 1) { + pImg.gifProperties = { + displayIndex: 0, + loopLimit: loopLimit, + loopCount: 0, + frames: frames, + numFrames: numFrames, + playing: true, + timeDisplayed: 0, + lastChangeTime: 0, + }; + } + if (typeof successCallback === "function") { + successCallback(pImg); + } + finishCallback(); + } /** + * @private + * @param {Constant} xAlign either LEFT, RIGHT or CENTER + * @param {Constant} yAlign either TOP, BOTTOM or CENTER + * @param {Number} dx + * @param {Number} dy + * @param {Number} dw + * @param {Number} dh + * @param {Number} sw + * @param {Number} sh + * @returns {Object} + */ + + function _imageContain(xAlign, yAlign, dx, dy, dw, dh, sw, sh) { + var r = Math.max(sw / dw, sh / dh); + var adjusted_dw = sw / r, + adjusted_dh = sh / r; + var x = dx; + var y = dy; + if (xAlign === constants.CENTER) { + x += (dw - adjusted_dw) / 2; + } else if (xAlign === constants.RIGHT) { + x += dw - adjusted_dw; + } + if (yAlign === constants.CENTER) { + y += (dh - adjusted_dh) / 2; + } else if (yAlign === constants.BOTTOM) { + y += dh - adjusted_dh; + } + return { + x: x, + y: y, + w: adjusted_dw, + h: adjusted_dh, + }; + } /** + * @private + * @param {Constant} xAlign either LEFT, RIGHT or CENTER + * @param {Constant} yAlign either TOP, BOTTOM or CENTER + * @param {Number} dw + * @param {Number} dh + * @param {Number} sx + * @param {Number} sy + * @param {Number} sw + * @param {Number} sh + * @returns {Object} + */ + + function _imageCover(xAlign, yAlign, dw, dh, sx, sy, sw, sh) { + var r = Math.max(dw / sw, dh / sh); + var adjusted_sw = dw / r, + adjusted_sh = dh / r; + var x = sx; + var y = sy; + if (xAlign === constants.CENTER) { + x += (sw - adjusted_sw) / 2; + } else if (xAlign === constants.RIGHT) { + x += sw - adjusted_sw; + } + if (yAlign === constants.CENTER) { + y += (sh - adjusted_sh) / 2; + } else if (yAlign === constants.BOTTOM) { + y += sh - adjusted_sh; + } + return { + x: x, + y: y, + w: adjusted_sw, + h: adjusted_sh, + }; + } /** + * @private + * @param {Constant} [fit] either CONTAIN or COVER + * @param {Constant} xAlign either LEFT, RIGHT or CENTER + * @param {Constant} yAlign either TOP, BOTTOM or CENTER + * @param {Number} dx + * @param {Number} dy + * @param {Number} dw + * @param {Number} dh + * @param {Number} sx + * @param {Number} sy + * @param {Number} sw + * @param {Number} sh + * @returns {Object} + */ + + function _imageFit( + fit, + xAlign, + yAlign, + dx, + dy, + dw, + dh, + sx, + sy, + sw, + sh, + ) { + if (fit === constants.COVER) { + var _imageCover2 = _imageCover( + xAlign, + yAlign, + dw, + dh, + sx, + sy, + sw, + sh, + ), + x = _imageCover2.x, + y = _imageCover2.y, + w = _imageCover2.w, + h = _imageCover2.h; + sx = x; + sy = y; + sw = w; + sh = h; + } + if (fit === constants.CONTAIN) { + var _imageContain2 = _imageContain( + xAlign, + yAlign, + dx, + dy, + dw, + dh, + sw, + sh, + ), + _x3 = _imageContain2.x, + _y = _imageContain2.y, + _w = _imageContain2.w, + _h = _imageContain2.h; + dx = _x3; + dy = _y; + dw = _w; + dh = _h; + } + return { + sx: sx, + sy: sy, + sw: sw, + sh: sh, + dx: dx, + dy: dy, + dw: dw, + dh: dh, + }; + } /** + * Validates clipping params. Per drawImage spec sWidth and sHight cannot be + * negative or greater than image intrinsic width and height + * @private + * @param {Number} sVal + * @param {Number} iVal + * @returns {Number} + * @private + */ + + function _sAssign(sVal, iVal) { + if (sVal > 0 && sVal < iVal) { + return sVal; + } else { + return iVal; + } + } /** + * Draws a source image to the canvas. + * + * The first parameter, `img`, is the source image to be drawn. The second and + * third parameters, `dx` and `dy`, set the coordinates of the destination + * image's top left corner. See imageMode() for + * other ways to position images. + * + * Here's a diagram that explains how optional parameters work in `image()`: + * + * + * + * The fourth and fifth parameters, `dw` and `dh`, are optional. They set the + * the width and height to draw the destination image. By default, `image()` + * draws the full source image at its original size. + * + * The sixth and seventh parameters, `sx` and `sy`, are also optional. + * These coordinates define the top left corner of a subsection to draw from + * the source image. + * + * The eighth and ninth parameters, `sw` and `sh`, are also optional. + * They define the width and height of a subsection to draw from the source + * image. By default, `image()` draws the full subsection that begins at + * (`sx`, `sy`) and extends to the edges of the source image. + * + * The ninth parameter, `fit`, is also optional. It enables a subsection of + * the source image to be drawn without affecting its aspect ratio. If + * `CONTAIN` is passed, the full subsection will appear within the destination + * rectangle. If `COVER` is passed, the subsection will completely cover the + * destination rectangle. This may have the effect of zooming into the + * subsection. + * + * The tenth and eleventh paremeters, `xAlign` and `yAlign`, are also + * optional. They determine how to align the fitted subsection. `xAlign` can + * be set to either `LEFT`, `RIGHT`, or `CENTER`. `yAlign` can be set to + * either `TOP`, `BOTTOM`, or `CENTER`. By default, both `xAlign` and `yAlign` + * are set to `CENTER`. + * + * @method image + * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img image to display. + * @param {Number} x x-coordinate of the top-left corner of the image. + * @param {Number} y y-coordinate of the top-left corner of the image. + * @param {Number} [width] width to draw the image. + * @param {Number} [height] height to draw the image. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0); + * + * describe('An image of the underside of a white umbrella with a gridded ceiling above.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 10, 10); + * + * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image has dark gray borders on its left and top.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0, 50, 50); + * + * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image is drawn in the top left corner of a dark gray square.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 25, 25, 50, 50, 25, 25, 50, 50); + * + * describe('An image of a gridded ceiling drawn in the center of a dark gray square.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/moonwalk.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0, width, height, 0, 0, img.width, img.height, CONTAIN); + * + * describe('An image of an astronaut on the moon. The top and bottom borders of the image are dark gray.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * // Image is 50 x 50 pixels. + * img = loadImage('assets/laDefense50.png'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0, width, height, 0, 0, img.width, img.height, COVER); + * + * describe('A pixelated image of the underside of a white umbrella with a gridded ceiling above.'); + * } + * + *
                    + */ + /** + * @method image + * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img + * @param {Number} dx the x-coordinate of the destination + * rectangle in which to draw the source image + * @param {Number} dy the y-coordinate of the destination + * rectangle in which to draw the source image + * @param {Number} dWidth the width of the destination rectangle + * @param {Number} dHeight the height of the destination rectangle + * @param {Number} sx the x-coordinate of the subsection of the source + * image to draw into the destination rectangle + * @param {Number} sy the y-coordinate of the subsection of the source + * image to draw into the destination rectangle + * @param {Number} [sWidth] the width of the subsection of the + * source image to draw into the destination + * rectangle + * @param {Number} [sHeight] the height of the subsection of the + * source image to draw into the destination rectangle + * @param {Constant} [fit] either CONTAIN or COVER + * @param {Constant} [xAlign] either LEFT, RIGHT or CENTER default is CENTER + * @param {Constant} [yAlign] either TOP, BOTTOM or CENTER default is CENTER + */ + + _main.default.prototype.image = function ( + img, + dx, + dy, + dWidth, + dHeight, + sx, + sy, + sWidth, + sHeight, + fit, + xAlign, + yAlign, + ) { + // set defaults per spec: https://goo.gl/3ykfOq + _main.default._validateParameters("image", arguments); + var defW = img.width; + var defH = img.height; + yAlign = yAlign || constants.CENTER; + xAlign = xAlign || constants.CENTER; + if (img.elt) { + defW = defW !== undefined ? defW : img.elt.width; + defH = defH !== undefined ? defH : img.elt.height; + } + if (img.elt && img.elt.videoWidth && !img.canvas) { + // video no canvas + defW = defW !== undefined ? defW : img.elt.videoWidth; + defH = defH !== undefined ? defH : img.elt.videoHeight; + } + var _dx = dx; + var _dy = dy; + var _dw = dWidth || defW; + var _dh = dHeight || defH; + var _sx = sx || 0; + var _sy = sy || 0; + var _sw = sWidth !== undefined ? sWidth : defW; + var _sh = sHeight !== undefined ? sHeight : defH; + _sw = _sAssign(_sw, defW); + _sh = _sAssign(_sh, defH); + // This part needs cleanup and unit tests + // see issues https://github.com/processing/p5.js/issues/1741 + // and https://github.com/processing/p5.js/issues/1673 + var pd = 1; + if (img.elt && !img.canvas && img.elt.style.width) { + //if img is video and img.elt.size() has been used and + //no width passed to image() + if (img.elt.videoWidth && !dWidth) { + pd = img.elt.videoWidth; + } else { + //all other cases + pd = img.elt.width; + } + pd /= parseInt(img.elt.style.width, 10); + } + _sx *= pd; + _sy *= pd; + _sh *= pd; + _sw *= pd; + var vals = _helpers.default.modeAdjust( + _dx, + _dy, + _dw, + _dh, + this._renderer._imageMode, + ); + vals = _imageFit( + fit, + xAlign, + yAlign, + vals.x, + vals.y, + vals.w, + vals.h, + _sx, + _sy, + _sw, + _sh, + ); + // tint the image if there is a tint + this._renderer.image( + img, + vals.sx, + vals.sy, + vals.sw, + vals.sh, + vals.dx, + vals.dy, + vals.dw, + vals.dh, + ); + }; + /** + * Tints images using a specified color. + * + * The version of `tint()` with one parameter interprets it one of four ways. + * If the parameter is a number, it's interpreted as a grayscale value. If the + * parameter is a string, it's interpreted as a CSS color string. An array of + * `[R, G, B, A]` values or a p5.Color object can + * also be used to set the tint color. + * + * The version of `tint()` with two parameters uses the first one as a + * grayscale value and the second as an alpha value. For example, calling + * `tint(255, 128)` will make an image 50% transparent. + * + * The version of `tint()` with three parameters interprets them as RGB or + * HSB values, depending on the current + * colorMode(). The optional fourth parameter + * sets the alpha value. For example, `tint(255, 0, 0, 100)` will give images + * a red tint and make them transparent. + * + * @method tint + * @param {Number} v1 red or hue value. + * @param {Number} v2 green or saturation value. + * @param {Number} v3 blue or brightness. + * @param {Number} [alpha] + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint('red'); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint(255, 0, 0); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint(255, 0, 0, 100); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a transparent red tint.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint(255, 180); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right is transparent.'); + * } + * + *
                    + */ + /** + * @method tint + * @param {String} value CSS color string. + */ + /** + * @method tint + * @param {Number} gray grayscale value. + * @param {Number} [alpha] + */ + /** + * @method tint + * @param {Number[]} values array containing the red, green, blue & + * alpha components of the color. + */ + /** + * @method tint + * @param {p5.Color} color the tint color + */ + _main.default.prototype.tint = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("tint", args); + var c = this.color.apply(this, args); + this._renderer._tint = c.levels; + }; + /** + * Removes the current tint set by tint() and restores + * images to their original colors. + * + * @method noTint + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * function setup() { + * tint('red'); + * image(img, 0, 0); + * noTint(); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the left has a red tint.'); + * } + * + *
                    + */ + _main.default.prototype.noTint = function () { + this._renderer._tint = null; + }; + /** + * Apply the current tint color to the input image, return the resulting + * canvas. + * + * @private + * @param {p5.Image} The image to be tinted + * @return {canvas} The resulting tinted canvas + */ + _main.default.prototype._getTintedImageCanvas = + _main.default.Renderer2D.prototype._getTintedImageCanvas; + /** + * Changes the location from which images are drawn when + * image() is called. + * + * By default, the first + * two parameters of image() are the x- and + * y-coordinates of the image's upper-left corner. The next parameters are + * its width and height. This is the same as calling `imageMode(CORNER)`. + * + * `imageMode(CORNERS)` also uses the first two parameters of + * image() as the x- and y-coordinates of the image's + * top-left corner. The third and fourth parameters are the coordinates of its + * bottom-right corner. + * + * `imageMode(CENTER)` uses the first two parameters of + * image() as the x- and y-coordinates of the image's + * center. The next parameters are its width and height. + * + * @method imageMode + * @param {Constant} mode either CORNER, CORNERS, or CENTER. + * @example + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * background(200); + * imageMode(CORNER); + * image(img, 10, 10, 50, 50); + * + * describe('A square image of a brick wall is drawn at the top left of a gray square.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * background(200); + * imageMode(CORNERS); + * image(img, 10, 10, 90, 40); + * + * describe('An image of a brick wall is drawn on a gray square. The image is squeezed into a small rectangular area.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * background(200); + * imageMode(CENTER); + * image(img, 50, 50, 80, 80); + * + * describe('A square image of a brick wall is drawn on a gray square.'); + * } + * + *
                    + */ + _main.default.prototype.imageMode = function (m) { + _main.default._validateParameters("imageMode", arguments); + if ( + m === constants.CORNER || + m === constants.CORNERS || + m === constants.CENTER + ) { + this._renderer._imageMode = m; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/friendly_errors/fes_core": 289, + "../core/friendly_errors/file_errors": 290, + "../core/friendly_errors/validate_params": 293, + "../core/helpers": 294, + "../core/main": 298, + "core-js/modules/es.array.copy-within": 170, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.promise": 201, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/es.typed-array.uint8-clamped-array": 253, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + gifenc: 263, + omggif: 270, + "regenerator-runtime/runtime": 274, + }, + ], + 322: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var _filters = _interopRequireDefault(_dereq_("./filters")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Image + * @submodule Image + * @requires core + * @requires constants + * @requires filters + */ + /** + * This module defines the p5.Image class and P5 methods for + * drawing images to the main display canvas. + */ + /* + * Class methods + */ + /** + * A class to describe an image. Images are rectangular grids of pixels that + * can be displayed and modified. + * + * Existing images can be loaded by calling + * loadImage(). Blank images can be created by + * calling createImage(). `p5.Image` objects + * have methods for common tasks such as applying filters and modifying + * pixel values. + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * + * describe('An image of a brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(GRAY); + * image(img, 0, 0); + * + * describe('A grayscale image of a brick wall.'); + * } + * + *
                    + * + *
                    + * + * background(200); + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + * + * @class p5.Image + * @constructor + * @param {Number} width + * @param {Number} height + */ + + _main.default.Image = /*#__PURE__*/ (function () { + function _class(width, height) { + _classCallCheck(this, _class); + /** + * Image width. + * @type {Number} + * @property {Number} width + * @name width + * @readOnly + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let x = img.width / 2; + * let y = img.height / 2; + * let d = 20; + * circle(x, y, d); + * + * describe('An image of a mountain landscape with a white circle drawn in the middle.'); + * } + * + *
                    + */ + this.width = width; + /** + * Image height. + * @type {Number} + * @property height + * @name height + * @readOnly + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let x = img.width / 2; + * let y = img.height / 2; + * let d = 20; + * circle(x, y, d); + * + * describe('An image of a mountain landscape with a white circle drawn in the middle.'); + * } + * + *
                    + */ + this.height = height; + this.canvas = document.createElement("canvas"); + this.canvas.width = this.width; + this.canvas.height = this.height; + this.drawingContext = this.canvas.getContext("2d"); + this._pixelsState = this; + this._pixelDensity = 1; + //Object for working with GIFs, defaults to null + this.gifProperties = null; + //For WebGL Texturing only: used to determine whether to reupload texture to GPU + this._modified = false; + /** + * An array containing the color of each pixel in the + * p5.Image object. Colors are stored as numbers + * representing red, green, blue, and alpha (RGBA) values. `img.pixels` is a + * one-dimensional array for performance reasons. + * + * Each pixel occupies four elements in the pixels array, one for each + * RGBA value. For example, the pixel at coordinates (0, 0) stores its + * RGBA values at `img.pixels[0]`, `img.pixels[1]`, `img.pixels[2]`, + * and `img.pixels[3]`, respectively. The next pixel at coordinates (1, 0) + * stores its RGBA values at `img.pixels[4]`, `img.pixels[5]`, + * `img.pixels[6]`, and `img.pixels[7]`. And so on. The `img.pixels` array + * for a 100×100 p5.Image object has + * 100 × 100 × 4 = 40,000 elements. + * + * Accessing the RGBA values for a pixel in the + * p5.Image object requires a little math as + * shown below. The img.loadPixels() + * method must be called before accessing the `img.pixels` array. The + * img.updatePixels() method must be + * called after any changes are made. + * + * @property {Number[]} pixels + * @name pixels + * @example + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 255; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A red square drawn in the middle of a gray square.'); + * + *
                    + */ + this.pixels = []; + } /** + * Gets or sets the pixel density for high pixel density displays. By default, + * the density will be set to 1. + * + * Call this method with no arguments to get the default density, or pass + * in a number to set the density. If a non-positive number is provided, + * it defaults to 1. + * + * @method pixelDensity + * @param {Number} [density] A scaling factor for the number of pixels per + * side + * @returns {Number} The current density if called without arguments, or the instance for chaining if setting density. + */ + + _createClass(_class, [ + { + key: "pixelDensity", + value: function pixelDensity(density) { + if (typeof density !== "undefined") { + // Setter: set the density and handle resize + if (density <= 0) { + var errorObj = { + type: "INVALID_VALUE", + format: { + types: ["Number"], + }, + position: 1, + }; + _main.default._friendlyParamError( + errorObj, + "pixelDensity", + ); + // Default to 1 in case of an invalid value + density = 1; + } + this._pixelDensity = density; + // Adjust canvas dimensions based on pixel density + this.width /= density; + this.height /= density; + return this; // Return the image instance for chaining if needed + } else { + // Getter: return the default density + return this._pixelDensity; + } + } /** + * Helper function for animating GIF-based images with time + */, + }, + { + key: "_animateGif", + value: function _animateGif(pInst) { + var props = this.gifProperties; + var curTime = pInst._lastRealFrameTime; + if (props.lastChangeTime === 0) { + props.lastChangeTime = curTime; + } + if (props.playing) { + props.timeDisplayed = curTime - props.lastChangeTime; + var curDelay = props.frames[props.displayIndex].delay; + if (props.timeDisplayed >= curDelay) { + //GIF is bound to 'realtime' so can skip frames + var skips = Math.floor(props.timeDisplayed / curDelay); + props.timeDisplayed = 0; + props.lastChangeTime = curTime; + props.displayIndex += skips; + props.loopCount = Math.floor( + props.displayIndex / props.numFrames, + ); + if ( + props.loopLimit !== null && + props.loopCount >= props.loopLimit + ) { + props.playing = false; + } else { + var ind = props.displayIndex % props.numFrames; + this.drawingContext.putImageData( + props.frames[ind].image, + 0, + 0, + ); + props.displayIndex = ind; + this.setModified(true); + } + } + } + } /** + * Helper fxn for sharing pixel methods + */, + }, + { + key: "_setProperty", + value: function _setProperty(prop, value) { + this[prop] = value; + this.setModified(true); + } /** + * Loads the current value of each pixel in the + * p5.Image object into the `img.pixels` array. + * This method must be called before reading or modifying pixel values. + * + * @method loadPixels + * @example + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + */, + }, + { + key: "loadPixels", + value: function loadPixels() { + _main.default.Renderer2D.prototype.loadPixels.call(this); + this.setModified(true); + } /** + * Updates the canvas with the RGBA values in the + * img.pixels array. + * + * `img.updatePixels()` only needs to be called after changing values in + * the img.pixels array. Such changes can be + * made directly after calling + * img.loadPixels() or by calling + * img.set(). + * + * The optional parameters `x`, `y`, `width`, and `height` define a + * subsection of the p5.Image object to update. + * Doing so can improve performance in some cases. + * + * If the p5.Image object was loaded from a GIF, + * then calling `img.updatePixels()` will update the pixels in current + * frame. + * + * @method updatePixels + * @param {Integer} x x-coordinate of the upper-left corner + * of the subsection to update. + * @param {Integer} y y-coordinate of the upper-left corner + * of the subsection to update. + * @param {Integer} w width of the subsection to update. + * @param {Integer} h height of the subsection to update. + * @example + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                    + */, + /** + * @method updatePixels + */ + }, + { + key: "updatePixels", + value: function updatePixels(x, y, w, h) { + _main.default.Renderer2D.prototype.updatePixels.call( + this, + x, + y, + w, + h, + ); + this.setModified(true); + } /** + * Gets a pixel or a region of pixels from a + * p5.Image object. + * + * `img.get()` is easy to use but it's not as fast as + * img.pixels. Use + * img.pixels to read many pixel values. + * + * The version of `img.get()` with no parameters returns the entire image. + * + * The version of `img.get()` with two parameters interprets them as + * coordinates. It returns an array with the `[R, G, B, A]` values of the + * pixel at the given point. + * + * The version of `img.get()` with four parameters interprets them as + * coordinates and dimensions. It returns a subsection of the canvas as a + * p5.Image object. The first two parameters are + * the coordinates for the upper-left corner of the subsection. The last two + * parameters are the width and height of the subsection. + * + * Use img.get() to work directly with + * p5.Image objects. + * + * @method get + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number} w width of the subsection to be returned. + * @param {Number} h height of the subsection to be returned. + * @return {p5.Image} subsection as a p5.Image object. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let img2 = get(); + * image(img2, width / 2, 0); + * + * describe('Two identical mountain landscapes shown side-by-side.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = img.get(50, 90); + * fill(c); + * noStroke(); + * square(25, 25, 50); + * + * describe('A mountain landscape with an olive green square in its center.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let img2 = img.get(0, 0, img.width / 2, img.height / 2); + * image(img2, width / 2, height / 2); + * + * describe('A mountain landscape drawn on top of another mountain landscape.'); + * } + * + *
                    + */, + /** + * @method get + * @return {p5.Image} whole p5.Image + */ + /** + * @method get + * @param {Number} x + * @param {Number} y + * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. + */ + }, + { + key: "get", + value: function get(x, y, w, h) { + _main.default._validateParameters("p5.Image.get", arguments); + return _main.default.Renderer2D.prototype.get.apply( + this, + arguments, + ); + }, + }, + { + key: "_getPixel", + value: function _getPixel() { + for ( + var _len = arguments.length, + args = new Array(_len), + _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + return _main.default.Renderer2D.prototype._getPixel.apply( + this, + args, + ); + } /** + * Sets the color of one or more pixels within a + * p5.Image object. + * + * `img.set()` is easy to use but it's not as fast as + * img.pixels. Use + * img.pixels to set many pixel values. + * + * `img.set()` interprets the first two parameters as x- and y-coordinates. It + * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel + * array, a p5.Color object, or another + * p5.Image object. + * + * img.updatePixels() must be called + * after using `img.set()` for changes to appear. + * + * @method set + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number|Number[]|Object} a grayscale value | pixel array | + * p5.Color object | + * p5.Image to copy. + * @example + *
                    + * + * let img = createImage(100, 100); + * img.set(30, 20, 0); + * img.set(85, 20, 0); + * img.set(85, 75, 0); + * img.set(30, 75, 0); + * img.updatePixels(); + * image(img, 0, 0); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                    + * + *
                    + * + * let img = createImage(100, 100); + * let black = color(0); + * img.set(30, 20, black); + * img.set(85, 20, black); + * img.set(85, 75, black); + * img.set(30, 75, black); + * img.updatePixels(); + * image(img, 0, 0); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                    + * + *
                    + * + * let img = createImage(66, 66); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * let c = map(x, 0, img.width, 0, 255); + * img.set(x, y, c); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A square with a horiztonal color gradient from black to white drawn on a gray background.'); + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * let img2 = createImage(100, 100); + * img2.set(0, 0, img); + * image(img2, 0, 0); + * + * describe('An image of a mountain landscape.'); + * } + * + *
                    + */, + }, + { + key: "set", + value: function set(x, y, imgOrCol) { + _main.default.Renderer2D.prototype.set.call( + this, + x, + y, + imgOrCol, + ); + this.setModified(true); + } /** + * Resizes the p5.Image object to a given `width` + * and `height`. The image's original aspect ratio can be kept by passing 0 + * for either `width` or `height`. For example, calling `img.resize(50, 0)` + * on an image that was 500 × 300 pixels will resize it to + * 50 × 30 pixels. + * + * @method resize + * @param {Number} width resized image width. + * @param {Number} height resized image height. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * function setup() { + * image(img, 0, 0); + * img.resize(50, 100); + * image(img, 0, 0); + * + * describe('Two images of a mountain landscape. One copy of the image is squeezed horizontally.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * function setup() { + * image(img, 0, 0); + * img.resize(0, 30); + * image(img, 0, 0); + * + * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * function setup() { + * image(img, 0, 0); + * img.resize(60, 0); + * image(img, 0, 0); + * + * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); + * } + * + *
                    + */, + }, + { + key: "resize", + value: function resize(width, height) { + // Copy contents to a temporary canvas, resize the original + // and then copy back. + // + // There is a faster approach that involves just one copy and swapping the + // this.canvas reference. We could switch to that approach if (as i think + // is the case) there an expectation that the user would not hold a + // reference to the backing canvas of a p5.Image. But since we do not + // enforce that at the moment, I am leaving in the slower, but safer + // implementation. + // auto-resize + if (width === 0 && height === 0) { + width = this.canvas.width; + height = this.canvas.height; + } else if (width === 0) { + width = (this.canvas.width * height) / this.canvas.height; + } else if (height === 0) { + height = (this.canvas.height * width) / this.canvas.width; + } + width = Math.floor(width); + height = Math.floor(height); + var tempCanvas = document.createElement("canvas"); + tempCanvas.width = width; + tempCanvas.height = height; + if (this.gifProperties) { + var props = this.gifProperties; + //adapted from github.com/LinusU/resize-image-data + var nearestNeighbor = function nearestNeighbor(src, dst) { + var pos = 0; + for (var y = 0; y < dst.height; y++) { + for (var x = 0; x < dst.width; x++) { + var srcX = Math.floor((x * src.width) / dst.width); + var srcY = Math.floor((y * src.height) / dst.height); + var srcPos = (srcY * src.width + srcX) * 4; + dst.data[pos++] = src.data[srcPos++]; // R + dst.data[pos++] = src.data[srcPos++]; // G + dst.data[pos++] = src.data[srcPos++]; // B + dst.data[pos++] = src.data[srcPos++]; // A + } + } + }; + for (var i = 0; i < props.numFrames; i++) { + var resizedImageData = + this.drawingContext.createImageData(width, height); + nearestNeighbor(props.frames[i].image, resizedImageData); + props.frames[i].image = resizedImageData; + } + } + tempCanvas + .getContext("2d") + .drawImage( + this.canvas, + 0, + 0, + this.canvas.width, + this.canvas.height, + 0, + 0, + tempCanvas.width, + tempCanvas.height, + ); + // Resize the original canvas, which will clear its contents + this.canvas.width = this.width = width; + this.canvas.height = this.height = height; + //Copy the image back + this.drawingContext.drawImage( + tempCanvas, + 0, + 0, + width, + height, + 0, + 0, + width, + height, + ); + if (this.pixels.length > 0) { + this.loadPixels(); + } + this.setModified(true); + } /** + * + * Copies pixels from a source p5.Image + * to this one. Calling `img.copy()` will scale pixels from the source + * region if it isn't the same size as the destination region. + * + * @method copy + * @param {p5.Image|p5.Element} srcImage source image. + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * img.copy(7, 22, 10, 10, 35, 25, 50, 50); + * image(img, 0, 0); + * // Outline copied region. + * stroke(255); + * noFill(); + * square(7, 22, 10); + * + * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); + * } + * + *
                    + * + *
                    + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * let x = bricks.width / 2; + * let y = bricks.height / 2; + * mountains.copy(bricks, 0, 0, x, y, 0, 0, x, y); + * image(mountains, 0, 0); + * + * describe('An image of a brick wall drawn at the top-left of an image of a mountain landscape.'); + * } + * + *
                    + */, + /** + * @method copy + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + */ + }, + { + key: "copy", + value: function copy() { + for ( + var _len2 = arguments.length, + args = new Array(_len2), + _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default.prototype.copy.apply(this, args); + } /** + * Masks part of an image from displaying by loading another + * image and using its alpha channel as an alpha channel for + * this image. Masks are cumulative, once applied to an image + * object, they cannot be removed. + * + * @method mask + * @param {p5.Image} srcImage source image. + * + * @example + *
                    + * + * let photo; + * let maskImage; + * + * function preload() { + * photo = loadImage('assets/rockies.jpg'); + * maskImage = loadImage('assets/mask2.png'); + * } + * + * function setup() { + * photo.mask(maskImage); + * image(photo, 0, 0); + * + * describe('An image of a mountain landscape. The right side of the image has a faded patch of white.'); + * } + * + *
                    + */, + // TODO: - Accept an array of alpha values. + }, + { + key: "mask", + value: function mask(p5Image) { + if (p5Image === undefined) { + p5Image = this; + } + var currBlend = this.drawingContext.globalCompositeOperation; + var scaleFactor = 1; + if (p5Image instanceof _main.default.Renderer) { + scaleFactor = p5Image._pInst._pixelDensity; + } + var copyArgs = [ + p5Image, + 0, + 0, + scaleFactor * p5Image.width, + scaleFactor * p5Image.height, + 0, + 0, + this.width, + this.height, + ]; + this.drawingContext.globalCompositeOperation = + "destination-in"; + if (this.gifProperties) { + for (var i = 0; i < this.gifProperties.frames.length; i++) { + this.drawingContext.putImageData( + this.gifProperties.frames[i].image, + 0, + 0, + ); + this.copy.apply(this, copyArgs); + this.gifProperties.frames[i].image = + this.drawingContext.getImageData( + 0, + 0, + this.width, + this.height, + ); + } + this.drawingContext.putImageData( + this.gifProperties.frames[this.gifProperties.displayIndex] + .image, + 0, + 0, + ); + } else { + this.copy.apply(this, copyArgs); + } + this.drawingContext.globalCompositeOperation = currBlend; + this.setModified(true); + } /** + * Applies an image filter to the p5.Image object. + * The preset options are: + * + * `INVERT` + * Inverts the colors in the image. No parameter is used. + * + * `GRAY` + * Converts the image to grayscale. No parameter is used. + * + * `THRESHOLD` + * Converts the image to black and white. Pixels with a grayscale value + * above a given threshold are converted to white. The rest are converted to + * black. The threshold must be between 0.0 (black) and 1.0 (white). If no + * value is specified, 0.5 is used. + * + * `OPAQUE` + * Sets the alpha channel to be entirely opaque. No parameter is used. + * + * `POSTERIZE` + * Limits the number of colors in the image. Each color channel is limited to + * the number of colors specified. Values between 2 and 255 are valid, but + * results are most noticeable with lower values. The default value is 4. + * + * `BLUR` + * Blurs the image. The level of blurring is specified by a blur radius. Larger + * values increase the blur. The default value is 4. A gaussian blur is used + * in `P2D` mode. A box blur is used in `WEBGL` mode. + * + * `ERODE` + * Reduces the light areas. No parameter is used. + * + * `DILATE` + * Increases the light areas. No parameter is used. + * + * @method filter + * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, + * POSTERIZE, ERODE, DILATE or BLUR. + * @param {Number} [filterParam] parameter unique to each filter. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(INVERT); + * image(img, 0, 0); + * + * describe('A blue brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(GRAY); + * image(img, 0, 0); + * + * describe('A brick wall drawn in grayscale.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(THRESHOLD); + * image(img, 0, 0); + * + * describe('A brick wall drawn in black and white.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(OPAQUE); + * image(img, 0, 0); + * + * describe('A red brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(POSTERIZE, 3); + * image(img, 0, 0); + * + * describe('An image of a red brick wall drawn with a limited color palette.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(BLUR, 3); + * image(img, 0, 0); + * + * describe('A blurry image of a red brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(DILATE); + * image(img, 0, 0); + * + * describe('A red brick wall with bright lines between each brick.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(ERODE); + * image(img, 0, 0); + * + * describe('A red brick wall with faint lines between each brick.'); + * } + * + *
                    + */, + }, + { + key: "filter", + value: function filter(operation, value) { + _filters.default.apply( + this.canvas, + _filters.default[operation], + value, + ); + this.setModified(true); + } /** + * Copies a region of pixels from another + * p5.Image object into this one. The `blendMode` + * parameter blends the images' colors to create different effects. + * + * @method blend + * @param {p5.Image} srcImage source image + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * @param {Constant} blendMode the blend mode. either + * BLEND, DARKEST, LIGHTEST, DIFFERENCE, + * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, + * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. + * + * Available blend modes are: normal | multiply | screen | overlay | + * darken | lighten | color-dodge | color-burn | hard-light | + * soft-light | difference | exclusion | hue | saturation | + * color | luminosity + * + * http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ + * @example + *
                    + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, ADD); + * image(mountains, 0, 0); + * image(bricks, 0, 0); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); + * } + * + *
                    + * + *
                    + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); + * image(mountains, 0, 0); + * image(bricks, 0, 0); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); + * } + * + *
                    + * + *
                    + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); + * image(mountains, 0, 0); + * image(bricks, 0, 0); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); + * } + * + *
                    + */, + /** + * @method blend + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + * @param {Constant} blendMode + */ + }, + { + key: "blend", + value: function blend() { + for ( + var _len3 = arguments.length, + args = new Array(_len3), + _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters( + "p5.Image.blend", + arguments, + ); + _main.default.prototype.blend.apply(this, args); + this.setModified(true); + } /** + * helper method for web GL mode to indicate that an image has been + * changed or unchanged since last upload. gl texture upload will + * set this value to false after uploading the texture. + * @method setModified + * @param {boolean} val sets whether or not the image has been + * modified. + * @private + */, + }, + { + key: "setModified", + value: function setModified(val) { + this._modified = val; //enforce boolean? + } /** + * helper method for web GL mode to figure out if the image + * has been modified and might need to be re-uploaded to texture + * memory between frames. + * @method isModified + * @private + * @return {boolean} a boolean indicating whether or not the + * image has been updated or modified since last texture upload. + */, + }, + { + key: "isModified", + value: function isModified() { + return this._modified; + } /** + * Saves the p5.Image object to a file. + * The browser will either save the file immediately or prompt the user + * with a dialogue window. + * + * By default, calling `img.save()` will save the image as `untitled.png`. + * + * Calling `img.save()` with one argument, as in `img.save('photo.png')`, + * will set the image's filename and type together. + * + * Calling `img.save()` with two arguments, as in + * `image.save('photo', 'png')`, will set the image's filename and type + * separately. + * + * The image will only be downloaded as an animated GIF if the + * p5.Image object was loaded from a GIF file. + * See saveGif() to create new GIFs. + * @method save + * @param {String} filename filename. Defaults to 'untitled'. + * @param {String} [extension] file extension, either 'png' or 'jpg'. + * Defaults to 'png'. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function draw() { + * image(img, 0, 0); + * + * describe('An image of a mountain landscape.'); + * } + * + * function keyPressed() { + * if (key === 's') { + * img.save(); + * } else if (key === 'j') { + * img.save('rockies.jpg'); + * } else if (key === 'p') { + * img.save('rockies', 'png'); + * } + * } + * + *
                    + */, + }, + { + key: "save", + value: function save(filename, extension) { + if (this.gifProperties) { + _main.default.prototype.encodeAndDownloadGif( + this, + filename, + ); + } else { + _main.default.prototype.saveCanvas( + this.canvas, + filename, + extension, + ); + } + }, // GIF Section + /** + * Restarts an animated GIF at its first frame. + * + * @method reset + * @example + *
                    + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-wink-loop-once.gif'); + * } + * + * function draw() { + * background(255); + * image(gif, 0, 0); + * + * describe('A cartoon face winks once and then freezes. Clicking resets the face and makes it wink again.'); + * } + * + * function mousePressed() { + * gif.reset(); + * } + * + *
                    + */ + }, + { + key: "reset", + value: function reset() { + if (this.gifProperties) { + var props = this.gifProperties; + props.playing = true; + props.timeSinceStart = 0; + props.timeDisplayed = 0; + props.lastChangeTime = 0; + props.loopCount = 0; + props.displayIndex = 0; + this.drawingContext.putImageData( + props.frames[0].image, + 0, + 0, + ); + } + } /** + * Gets the index of the current frame in an animated GIF. + * + * @method getCurrentFrame + * @return {Number} index of the GIF's current frame. + * @example + *
                    + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function draw() { + * let index = gif.getCurrentFrame(); + * image(gif, 0, 0); + * text(index, 10, 90); + * + * describe('A cartoon eye repeatedly looks around, then outwards. A number displayed in the bottom-left corner increases from 0 to 124, then repeats.'); + * } + * + *
                    + */, + }, + { + key: "getCurrentFrame", + value: function getCurrentFrame() { + if (this.gifProperties) { + var props = this.gifProperties; + return props.displayIndex % props.numFrames; + } + } /** + * Sets the current frame in an animated GIF. + * + * @method setFrame + * @param {Number} index index of the frame to display. + * @example + *
                    + * + * let gif; + * let frameSlider; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function setup() { + * let maxFrame = gif.numFrames() - 1; + * frameSlider = createSlider(0, maxFrame); + * frameSlider.position(10, 80); + * frameSlider.size(80); + * } + * + * function draw() { + * let index = frameSlider.value(); + * gif.setFrame(index); + * image(gif, 0, 0); + * + * describe('A cartoon eye looks around when a slider is moved.'); + * } + * + *
                    + */, + }, + { + key: "setFrame", + value: function setFrame(index) { + if (this.gifProperties) { + var props = this.gifProperties; + if (index < props.numFrames && index >= 0) { + props.timeDisplayed = 0; + props.lastChangeTime = 0; + props.displayIndex = index; + this.drawingContext.putImageData( + props.frames[index].image, + 0, + 0, + ); + } else { + console.log( + "Cannot set GIF to a frame number that is higher than total number of frames or below zero.", + ); + } + } + } /** + * Returns the number of frames in an animated GIF. + * + * @method numFrames + * @return {Number} number of frames in the GIF. + * + * @example + *
                    + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function draw() { + * image(gif, 0, 0); + * let total = gif.numFrames(); + * let index = gif.getCurrentFrame(); + * text(`${index} / ${total}`, 30, 90); + * + * describe('A cartoon eye looks around. The text "n / 125" is shown at the bottom of the canvas.'); + * } + * + *
                    + */, + }, + { + key: "numFrames", + value: function numFrames() { + if (this.gifProperties) { + return this.gifProperties.numFrames; + } + } /** + * Plays an animated GIF that was paused with + * img.pause(). + * + * @method play + * + * @example + *
                    + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); + * } + * + * function draw() { + * background(255); + * image(gif, 0, 0); + * + * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); + * } + * + * function mousePressed() { + * gif.pause(); + * } + * + * function mouseReleased() { + * gif.play(); + * } + * + *
                    + */, + }, + { + key: "play", + value: function play() { + if (this.gifProperties) { + this.gifProperties.playing = true; + } + } /** + * Pauses an animated GIF. The GIF can be resumed by calling + * img.play(). + * + * @method pause + * + * @example + *
                    + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); + * } + * + * function draw() { + * background(255); + * image(gif, 0, 0); + * + * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); + * } + * + * function mousePressed() { + * gif.pause(); + * } + * + * function mouseReleased() { + * gif.play(); + * } + * + *
                    + */, + }, + { + key: "pause", + value: function pause() { + if (this.gifProperties) { + this.gifProperties.playing = false; + } + } /** + * Changes the delay between frames in an animated GIF. + * + * The second parameter, `index`, is optional. If provided, only the frame + * at `index` will have its delay modified. All other frames will keep + * their default delay. + * + * @method delay + * @param {Number} d delay in milliseconds between switching frames. + * @param {Number} [index] index of the frame that will have its delay modified. + * + * @example + *
                    + * + * let gifFast; + * let gifSlow; + * + * function preload() { + * gifFast = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * gifSlow = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function setup() { + * gifFast.resize(50, 50); + * gifSlow.resize(50, 50); + * gifFast.delay(10); + * gifSlow.delay(100); + * } + * + * function draw() { + * image(gifFast, 0, 0); + * image(gifSlow, 50, 0); + * + * describe('Two animated eyes looking around. The eye on the left moves faster than the eye on the right.'); + * } + * + *
                    + * + *
                    + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function setup() { + * gif.delay(3000, 67); + * } + * + * function draw() { + * image(gif, 0, 0); + * + * describe('An animated eye looking around. It pauses for three seconds while it looks down.'); + * } + * + *
                    + */, + }, + { + key: "delay", + value: function delay(d, index) { + if (this.gifProperties) { + var props = this.gifProperties; + if (index < props.numFrames && index >= 0) { + props.frames[index].delay = d; + } else { + // change all frames + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = props.frames[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = + _iterator.next()).done); + _iteratorNormalCompletion = true + ) { + var frame = _step.value; + frame.delay = d; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + }, + }, + ]); + return _class; + })(); + var _default = _main.default.Image; + exports.default = _default; + }, + { + "../core/main": 298, + "./filters": 319, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 323: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.filter"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var _filters = _interopRequireDefault(_dereq_("./filters")); + _dereq_("../color/p5.Color"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Image + * @submodule Pixels + * @for p5 + * @requires core + */ + /** + * An array containing the color of each pixel on the canvas. Colors are + * stored as numbers representing red, green, blue, and alpha (RGBA) values. + * `pixels` is a one-dimensional array for performance reasons. + * + * Each pixel occupies four elements in the `pixels` array, one for each RGBA + * value. For example, the pixel at coordinates (0, 0) stores its RGBA values + * at `pixels[0]`, `pixels[1]`, `pixels[2]`, and `pixels[3]`, respectively. + * The next pixel at coordinates (1, 0) stores its RGBA values at `pixels[4]`, + * `pixels[5]`, `pixels[6]`, and `pixels[7]`. And so on. The `pixels` array + * for a 100×100 canvas has 100 × 100 × 4 = 40,000 elements. + * + * Some displays use several smaller pixels to set the color at a single + * point. The pixelDensity() function returns + * the pixel density of the canvas. High density displays often have a + * pixelDensity() of 2. On such a display, the + * `pixels` array for a 100×100 canvas has 200 × 200 × 4 = + * 160,000 elements. + * + * Accessing the RGBA values for a point on the canvas requires a little math + * as shown below. The loadPixels() function + * must be called before accessing the `pixels` array. The + * updatePixels() function must be called + * after any changes are made. + * + * @property {Number[]} pixels + * + * @example + *
                    + * + * loadPixels(); + * let x = 50; + * let y = 50; + * let d = pixelDensity(); + * for (let i = 0; i < d; i += 1) { + * for (let j = 0; j < d; j += 1) { + * let index = 4 * ((y * d + j) * width * d + (x * d + i)); + * // Red. + * pixels[index] = 0; + * // Green. + * pixels[index + 1] = 0; + * // Blue. + * pixels[index + 2] = 0; + * // Alpha. + * pixels[index + 3] = 255; + * } + * } + * updatePixels(); + * + * describe('A black dot in the middle of a gray rectangle.'); + * + *
                    + * + *
                    + * + * loadPixels(); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * for (let i = 0; i < halfImage; i += 4) { + * // Red. + * pixels[i] = 255; + * // Green. + * pixels[i + 1] = 0; + * // Blue. + * pixels[i + 2] = 0; + * // Alpha. + * pixels[i + 3] = 255; + * } + * updatePixels(); + * + * describe('A red rectangle drawn above a gray rectangle.'); + * + *
                    + * + *
                    + * + * let pink = color(255, 102, 204); + * loadPixels(); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * for (let i = 0; i < halfImage; i += 4) { + * pixels[i] = red(pink); + * pixels[i + 1] = green(pink); + * pixels[i + 2] = blue(pink); + * pixels[i + 3] = alpha(pink); + * } + * updatePixels(); + * + * describe('A pink rectangle drawn above a gray rectangle.'); + * + *
                    + */ + + _main.default.prototype.pixels = []; + /** + * Copies a region of pixels from one image to another. The `blendMode` + * parameter blends the images' colors to create different effects. + * + * @method blend + * @param {p5.Image} srcImage source image. + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * @param {Constant} blendMode the blend mode. either + * BLEND, DARKEST, LIGHTEST, DIFFERENCE, + * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, + * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. + * + * @example + *
                    + * + * let img0; + * let img1; + * + * function preload() { + * img0 = loadImage('assets/rockies.jpg'); + * img1 = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * background(img0); + * image(img1, 0, 0); + * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); + * } + * + *
                    + * + *
                    + * + * let img0; + * let img1; + * + * function preload() { + * img0 = loadImage('assets/rockies.jpg'); + * img1 = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * background(img0); + * image(img1, 0, 0); + * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); + * } + * + *
                    + * + *
                    + * + * let img0; + * let img1; + * + * function preload() { + * img0 = loadImage('assets/rockies.jpg'); + * img1 = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * background(img0); + * image(img1, 0, 0); + * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, ADD); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); + * } + * + *
                    + */ + /** + * @method blend + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + * @param {Constant} blendMode + */ + _main.default.prototype.blend = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("blend", args); + if (this._renderer) { + var _this$_renderer; + (_this$_renderer = this._renderer).blend.apply( + _this$_renderer, + args, + ); + } else { + _main.default.Renderer2D.prototype.blend.apply(this, args); + } + }; + /** + * Copies pixels from a source image to a region of the canvas. The source + * image can be the canvas itself or a p5.Image + * object. `copy()` will scale pixels from the source region if it isn't the + * same size as the destination region. + * + * @method copy + * @param {p5.Image|p5.Element} srcImage source image. + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * background(img); + * copy(img, 7, 22, 10, 10, 35, 25, 50, 50); + * // Show copied region. + * stroke(255); + * noFill(); + * square(7, 22, 10); + * + * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); + * } + * + *
                    + */ + /** + * @method copy + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + */ + _main.default.prototype.copy = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("copy", args); + var srcImage, sx, sy, sw, sh, dx, dy, dw, dh; + if (args.length === 9) { + srcImage = args[0]; + sx = args[1]; + sy = args[2]; + sw = args[3]; + sh = args[4]; + dx = args[5]; + dy = args[6]; + dw = args[7]; + dh = args[8]; + } else if (args.length === 8) { + srcImage = this; + sx = args[0]; + sy = args[1]; + sw = args[2]; + sh = args[3]; + dx = args[4]; + dy = args[5]; + dw = args[6]; + dh = args[7]; + } else { + throw new Error("Signature not supported"); + } + _main.default.prototype._copyHelper( + this, + srcImage, + sx, + sy, + sw, + sh, + dx, + dy, + dw, + dh, + ); + }; + _main.default.prototype._copyHelper = function ( + dstImage, + srcImage, + sx, + sy, + sw, + sh, + dx, + dy, + dw, + dh, + ) { + var s = srcImage.canvas.width / srcImage.width; + // adjust coord system for 3D when renderer + // ie top-left = -width/2, -height/2 + var sxMod = 0; + var syMod = 0; + if (srcImage._renderer && srcImage._renderer.isP3D) { + sxMod = srcImage.width / 2; + syMod = srcImage.height / 2; + } + if (dstImage._renderer && dstImage._renderer.isP3D) { + _main.default.RendererGL.prototype.image.call( + dstImage._renderer, + srcImage, + sx + sxMod, + sy + syMod, + sw, + sh, + dx, + dy, + dw, + dh, + ); + } else { + dstImage.drawingContext.drawImage( + srcImage.canvas, + s * (sx + sxMod), + s * (sy + syMod), + s * sw, + s * sh, + dx, + dy, + dw, + dh, + ); + } + }; + /** + * Applies an image filter to the canvas. The preset options are: + * + * `INVERT` + * Inverts the colors in the image. No parameter is used. + * + * `GRAY` + * Converts the image to grayscale. No parameter is used. + * + * `THRESHOLD` + * Converts the image to black and white. Pixels with a grayscale value + * above a given threshold are converted to white. The rest are converted to + * black. The threshold must be between 0.0 (black) and 1.0 (white). If no + * value is specified, 0.5 is used. + * + * `OPAQUE` + * Sets the alpha channel to entirely opaque. No parameter is used. + * + * `POSTERIZE` + * Limits the number of colors in the image. Each color channel is limited to + * the number of colors specified. Values between 2 and 255 are valid, but + * results are most noticeable with lower values. The default value is 4. + * + * `BLUR` + * Blurs the image. The level of blurring is specified by a blur radius. Larger + * values increase the blur. The default value is 4. A gaussian blur is used + * in `P2D` mode. A box blur is used in `WEBGL` mode. + * + * `ERODE` + * Reduces the light areas. No parameter is used. + * + * `DILATE` + * Increases the light areas. No parameter is used. + * + * `filter()` uses WebGL in the background by default because it's faster. + * This can be disabled in `P2D` mode by adding a `false` argument, as in + * `filter(BLUR, false)`. This may be useful to keep computation off the GPU + * or to work around a lack of WebGL support. + * + * In `WEBGL` mode, `filter()` can also use custom shaders. See + * createFilterShader() for more + * information. + * + * + * @method filter + * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, + * POSTERIZE, BLUR, ERODE, DILATE or BLUR. + * @param {Number} [filterParam] parameter unique to each filter. + * @param {Boolean} [useWebGL] flag to control whether to use fast + * WebGL filters (GPU) or original image + * filters (CPU); defaults to `true`. + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(INVERT); + * + * describe('A blue brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(GRAY); + * + * describe('A brick wall drawn in grayscale.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(THRESHOLD); + * + * describe('A brick wall drawn in black and white.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(OPAQUE); + * + * describe('A red brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(POSTERIZE, 3); + * + * describe('An image of a red brick wall drawn with limited color palette.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(BLUR, 3); + * + * describe('A blurry image of a red brick wall.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(DILATE); + * + * describe('A red brick wall with bright lines between each brick.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(ERODE); + * + * describe('A red brick wall with faint lines between each brick.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * // Don't use WebGL. + * filter(BLUR, 3, false); + * + * describe('A blurry image of a red brick wall.'); + * } + * + *
                    + */ + /** + * @method getFilterGraphicsLayer + * @private + * @returns {p5.Graphics} + */ + _main.default.prototype.getFilterGraphicsLayer = function () { + return this._renderer.getFilterGraphicsLayer(); + }; + /** + * @method filter + * @param {Constant} filterType + * @param {Boolean} [useWebGL] + */ + /** + * @method filter + * @param {p5.Shader} shaderFilter shader that's been loaded, with the + * frag shader using a `tex0` uniform. + */ + _main.default.prototype.filter = function () { + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters("filter", arguments); + var _parseFilterArgs = parseFilterArgs.apply(void 0, args), + shader = _parseFilterArgs.shader, + operation = _parseFilterArgs.operation, + value = _parseFilterArgs.value, + useWebGL = _parseFilterArgs.useWebGL; // when passed a shader, use it directly + if (this._renderer.isP3D && shader) { + _main.default.RendererGL.prototype.filter.call( + this._renderer, + shader, + ); + return; + } // when opting out of webgl, use old pixels method + + if (!useWebGL && !this._renderer.isP3D) { + if (this.canvas !== undefined) { + _filters.default.apply( + this.canvas, + _filters.default[operation], + value, + ); + } else { + _filters.default.apply( + this.elt, + _filters.default[operation], + value, + ); + } + return; + } + if (!useWebGL && this._renderer.isP3D) { + console.warn( + "filter() with useWebGL=false is not supported in WEBGL", + ); + } // when this is a webgl renderer, apply constant shader filter + + if (this._renderer.isP3D) { + _main.default.RendererGL.prototype.filter.call( + this._renderer, + operation, + value, + ); + } // when this is P2D renderer, create/use hidden webgl renderer + else { + var filterGraphicsLayer = this.getFilterGraphicsLayer(); + // copy p2d canvas contents to secondary webgl renderer + // dest + filterGraphicsLayer.copy( + // src + this._renderer, // src coods + 0, + 0, + this.width, + this.height, // dest coords + -this.width / 2, + -this.height / 2, + this.width, + this.height, + ); + //clearing the main canvas + this._renderer.clear(); + this._renderer.resetMatrix(); + // filter it with shaders + filterGraphicsLayer.filter.apply(filterGraphicsLayer, args); + // copy secondary webgl renderer back to original p2d canvas + this._renderer._pInst.image(filterGraphicsLayer, 0, 0); + filterGraphicsLayer.clear(); // prevent feedback effects on p2d canvas + } + }; + function parseFilterArgs() { + var _ref; + // args could be: + // - operation, value, [useWebGL] + // - operation, [useWebGL] + // - shader + var result = { + shader: undefined, + operation: undefined, + value: undefined, + useWebGL: true, + }; + if ( + (arguments.length <= 0 ? undefined : arguments[0]) instanceof + _main.default.Shader + ) { + result.shader = arguments.length <= 0 ? undefined : arguments[0]; + return result; + } else { + result.operation = + arguments.length <= 0 ? undefined : arguments[0]; + } + if ( + arguments.length > 1 && + typeof (arguments.length <= 1 ? undefined : arguments[1]) === + "number" + ) { + result.value = arguments.length <= 1 ? undefined : arguments[1]; + } + if ( + ((_ref = arguments.length - 1), + _ref < 0 || arguments.length <= _ref + ? undefined + : arguments[_ref]) === false + ) { + result.useWebGL = false; + } + return result; + } /** + * Gets a pixel or a region of pixels from the canvas. + * + * `get()` is easy to use but it's not as fast as + * pixels. Use pixels + * to read many pixel values. + * + * The version of `get()` with no parameters returns the entire canvas. + * + * The version of `get()` with two parameters interprets them as + * coordinates. It returns an array with the `[R, G, B, A]` values of the + * pixel at the given point. + * + * The version of `get()` with four parameters interprets them as coordinates + * and dimensions. It returns a subsection of the canvas as a + * p5.Image object. The first two parameters are the + * coordinates for the upper-left corner of the subsection. The last two + * parameters are the width and height of the subsection. + * + * Use p5.Image.get() to work directly with + * p5.Image objects. + * + * @method get + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number} w width of the subsection to be returned. + * @param {Number} h height of the subsection to be returned. + * @return {p5.Image} subsection as a p5.Image object. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = get(); + * image(c, width / 2, 0); + * + * describe('Two identical mountain landscapes shown side-by-side.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = get(50, 90); + * fill(c); + * noStroke(); + * square(25, 25, 50); + * + * describe('A mountain landscape with an olive green square in its center.'); + * } + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = get(0, 0, width / 2, height / 2); + * image(c, width / 2, height / 2); + * + * describe('A mountain landscape drawn on top of another mountain landscape.'); + * } + * + *
                    + */ + /** + * @method get + * @return {p5.Image} whole canvas as a p5.Image. + */ + /** + * @method get + * @param {Number} x + * @param {Number} y + * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. + */ + + _main.default.prototype.get = function (x, y, w, h) { + var _this$_renderer2; + _main.default._validateParameters("get", arguments); + return (_this$_renderer2 = this._renderer).get.apply( + _this$_renderer2, + arguments, + ); + }; + /** + * Loads the current value of each pixel on the canvas into the + * pixels array. This + * function must be called before reading from or writing to + * pixels. + * + * @method loadPixels + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0, width, height); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * loadPixels(); + * for (let i = 0; i < halfImage; i += 1) { + * pixels[i + halfImage] = pixels[i]; + * } + * updatePixels(); + * + * describe('Two identical images of mountain landscapes, one on top of the other.'); + * } + * + *
                    + */ + _main.default.prototype.loadPixels = function () { + for ( + var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; + _key4 < _len4; + _key4++ + ) { + args[_key4] = arguments[_key4]; + } + _main.default._validateParameters("loadPixels", args); + this._renderer.loadPixels(); + }; + /** + * Sets the color of a pixel or draws an image to the canvas. + * + * `set()` is easy to use but it's not as fast as + * pixels. Use pixels + * to set many pixel values. + * + * `set()` interprets the first two parameters as x- and y-coordinates. It + * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel + * array, a p5.Color object, or a + * p5.Image object. If an image is passed, the first + * two parameters set the coordinates for the image's upper-left corner, + * regardless of the current imageMode(). + * + * updatePixels() must be called after using + * `set()` for changes to appear. + * + * @method set + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number|Number[]|Object} c grayscale value | pixel array | + * p5.Color object | p5.Image to copy. + * @example + *
                    + * + * set(30, 20, 0); + * set(85, 20, 0); + * set(85, 75, 0); + * set(30, 75, 0); + * updatePixels(); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                    + * + *
                    + * + * let black = color(0); + * set(30, 20, black); + * set(85, 20, black); + * set(85, 75, black); + * set(30, 75, black); + * updatePixels(); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                    + * + *
                    + * + * for (let x = 0; x < width; x += 1) { + * for (let y = 0; y < height; y += 1) { + * let c = map(x, 0, width, 0, 255); + * set(x, y, c); + * } + * } + * updatePixels(); + * + * describe('A horiztonal color gradient from black to white.'); + * + *
                    + * + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * set(0, 0, img); + * updatePixels(); + * + * describe('An image of a mountain landscape.'); + * } + * + *
                    + */ + _main.default.prototype.set = function (x, y, imgOrCol) { + this._renderer.set(x, y, imgOrCol); + }; + /** + * Updates the canvas with the RGBA values in the + * pixels array. + * + * `updatePixels()` only needs to be called after changing values in the + * pixels array. Such changes can be made directly + * after calling loadPixels() or by calling + * set(). + * + * @method updatePixels + * @param {Number} [x] x-coordinate of the upper-left corner of region + * to update. + * @param {Number} [y] y-coordinate of the upper-left corner of region + * to update. + * @param {Number} [w] width of region to update. + * @param {Number} [h] height of region to update. + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0, width, height); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * loadPixels(); + * for (let i = 0; i < halfImage; i += 1) { + * pixels[i + halfImage] = pixels[i]; + * } + * updatePixels(); + * + * describe('Two identical images of mountain landscapes, one on top of the other.'); + * } + * + *
                    + */ + _main.default.prototype.updatePixels = function (x, y, w, h) { + _main.default._validateParameters("updatePixels", arguments); + // graceful fail - if loadPixels() or set() has not been called, pixel + // array will be empty, ignore call to updatePixels() + if (this.pixels.length === 0) { + return; + } + this._renderer.updatePixels(x, y, w, h); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../color/p5.Color": 284, + "../core/main": 298, + "./filters": 319, + "core-js/modules/es.array.filter": 173, + }, + ], + 324: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.last-index-of"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.from-entries"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/web.url"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.last-index-of"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.from-entries"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.promise"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/web.url"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + _dereq_("whatwg-fetch"); + _dereq_("es6-promise/auto"); + var _fetchJsonp = _interopRequireDefault(_dereq_("fetch-jsonp")); + var _fileSaver = _interopRequireDefault(_dereq_("file-saver")); + _dereq_("../core/friendly_errors/validate_params"); + _dereq_("../core/friendly_errors/file_errors"); + _dereq_("../core/friendly_errors/fes_core"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module IO + * @submodule Input + * @for p5 + * @requires core + */ + /** + * Loads a JSON file from a file or a URL, and returns an Object. + * Note that even if the JSON file contains an Array, an Object will be + * returned with index numbers as keys. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. JSONP is supported via a polyfill and you + * can pass in as the second argument an object with definitions of the json + * callback following the syntax specified here. + * + * This method is suitable for fetching files up to size of 64MB. + * @method loadJSON + * @param {String} path name of the file or url to load + * @param {Object} [jsonpOptions] options object for jsonp related settings + * @param {String} [datatype] "json" or "jsonp" + * @param {function} [callback] function to be executed after + * loadJSON() completes, data is passed + * in as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Object|Array} JSON data + * @example + * + * Calling loadJSON() inside preload() guarantees to complete the + * operation before setup() and draw() are called. + * + *
                    + * // Examples use USGS Earthquake API: + * // https://earthquake.usgs.gov/fdsnws/event/1/#methods + * let earthquakes; + * function preload() { + * // Get the most recent earthquake in the database + * let url = + 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + + * 'summary/all_day.geojson'; + * earthquakes = loadJSON(url); + * } + * + * function setup() { + * noLoop(); + * } + * + * function draw() { + * background(200); + * // Get the magnitude and name of the earthquake out of the loaded JSON + * let earthquakeMag = earthquakes.features[0].properties.mag; + * let earthquakeName = earthquakes.features[0].properties.place; + * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); + * textAlign(CENTER); + * text(earthquakeName, 0, height - 30, width, 30); + * describe(`50×50 ellipse that changes from black to white + * depending on the current humidity`); + * } + *
                    + * + * Outside of preload(), you may supply a callback function to handle the + * object: + *
                    + * function setup() { + * noLoop(); + * let url = + 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + + * 'summary/all_day.geojson'; + * loadJSON(url, drawEarthquake); + * } + * + * function draw() { + * background(200); + * describe(`50×50 ellipse that changes from black to white + * depending on the current humidity`); + * } * - * `translation` is the namespace we are using for our initial set of strings + * function drawEarthquake(earthquakes) { + * // Get the magnitude and name of the earthquake out of the loaded JSON + * let earthquakeMag = earthquakes.features[0].properties.mag; + * let earthquakeName = earthquakes.features[0].properties.place; + * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); + * textAlign(CENTER); + * text(earthquakeName, 0, height - 30, width, 30); + * } + *
                    */ + /** + * @method loadJSON + * @param {String} path + * @param {String} datatype + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Object|Array} + */ + /** + * @method loadJSON + * @param {String} path + * @param {function} callback + * @param {function} [errorCallback] + * @return {Object|Array} + */ + + _main.default.prototype.loadJSON = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("loadJSON", args); + var path = args[0]; + var callback; + var errorCallback; + var options; + var ret = {}; // object needed for preload + var t = "json"; + // check for explicit data type argument + for (var i = 1; i < args.length; i++) { + var arg = args[i]; + if (typeof arg === "string") { + if (arg === "jsonp" || arg === "json") { + t = arg; + } + } else if (typeof arg === "function") { + if (!callback) { + callback = arg; + } else { + errorCallback = arg; + } + } else if ( + _typeof(arg) === "object" && + (arg.hasOwnProperty("jsonpCallback") || + arg.hasOwnProperty("jsonpCallbackFunction")) + ) { + t = "jsonp"; + options = arg; + } + } + var self = this; + this.httpDo( + path, + "GET", + options, + t, + function (resp) { + for (var k in resp) { + ret[k] = resp[k]; + } + if (typeof callback !== "undefined") { + callback(resp); + } + self._decrementPreload(); + }, + function (err) { + // Error handling + _main.default._friendlyFileLoadError(5, path); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }, + ); + return ret; + }; + /** + * Reads the contents of a file and creates a String array of its individual + * lines. If the name of the file is used as the parameter, as in the above + * example, the file must be located in the sketch directory/folder. + * + * Alternatively, the file may be loaded from anywhere on the local + * computer using an absolute path (something that starts with / on Unix and + * Linux, or a drive letter on Windows), or the filename parameter can be a + * URL for a file found on a network. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. + * + * This method is suitable for fetching files up to size of 64MB. + * @method loadStrings + * @param {String} filename name of the file or url to load + * @param {function} [callback] function to be executed after loadStrings() + * completes, Array is passed in as first + * argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {String[]} Array of Strings + * @example + * + * Calling loadStrings() inside preload() guarantees to complete the + * operation before setup() and draw() are called. + * + *
                    + * let result; + * function preload() { + * result = loadStrings('assets/test.txt'); + * } - var _default = { - en: { - translation: _translation.default - } - }; - /** - * This is a list of languages that we have added so far. - * If you have just added a new language (yay!), add its key to the list below - * (`en` is english, `es` es español). Also add its export to - * dev.js, which is another file in this folder. + * function setup() { + * background(200); + * text(random(result), 10, 10, 80, 80); + * describe(`randomly generated text from a file, + * for example "i smell like butter"`); + * } + *
                    + * + * Outside of preload(), you may supply a callback function to handle the + * object: + * + *
                    + * function setup() { + * loadStrings('assets/test.txt', pickString); + * describe(`randomly generated text from a file, + * for example "i have three feet"`); + * } + * + * function pickString(result) { + * background(200); + * text(random(result), 10, 10, 80, 80); + * } + *
                    */ - exports.default = _default; - var languages = [ - 'en', - 'es', - 'ko', - 'zh', - 'hi' - ]; - exports.languages = languages; - }, - { - './en/translation': 359 - } - ] - }, { - }, [ - 281 - ]) (281) + _main.default.prototype.loadStrings = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("loadStrings", args); + var ret = []; + var callback, errorCallback; + for (var i = 1; i < args.length; i++) { + var arg = args[i]; + if (typeof arg === "function") { + if (typeof callback === "undefined") { + callback = arg; + } else if (typeof errorCallback === "undefined") { + errorCallback = arg; + } + } + } + var self = this; + _main.default.prototype.httpDo.call( + this, + args[0], + "GET", + "text", + function (data) { + // split lines handling mac/windows/linux endings + var lines = data + .replace(/\r\n/g, "\r") + .replace(/\n/g, "\r") + .split(/\r/); + // safe insert approach which will not blow up stack when inserting + // >100k lines, but still be faster than iterating line-by-line. based on + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#Examples + var QUANTUM = 32768; + for (var _i = 0, len = lines.length; _i < len; _i += QUANTUM) { + Array.prototype.push.apply( + ret, + lines.slice(_i, Math.min(_i + QUANTUM, len)), + ); + } + if (typeof callback !== "undefined") { + callback(ret); + } + self._decrementPreload(); + }, + function (err) { + // Error handling + _main.default._friendlyFileLoadError(3, arguments[0]); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }, + ); + return ret; + }; + /** + * Reads the contents of a file or URL and creates a p5.Table object with + * its values. If a file is specified, it must be located in the sketch's + * "data" folder. The filename parameter can also be a URL to a file found + * online. By default, the file is assumed to be comma-separated (in CSV + * format). Table only looks for a header row if the 'header' option is + * included. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. Calling loadTable() inside preload() + * guarantees to complete the operation before setup() and draw() are called. + * Outside of preload(), you may supply a callback function to handle the + * object: + * + * All files loaded and saved use UTF-8 encoding. This method is suitable for fetching files up to size of 64MB. + * @method loadTable + * @param {String} filename name of the file or URL to load + * @param {String} [extension] parse the table by comma-separated values "csv", semicolon-separated + * values "ssv", or tab-separated values "tsv" + * @param {String} [header] "header" to indicate table has header row + * @param {function} [callback] function to be executed after + * loadTable() completes. On success, the + * Table object is passed in as the + * first argument. + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Object} Table object containing data + * + * @example + *
                    + * + * // Given the following CSV file called "mammals.csv" + * // located in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * //the file can be remote + * //table = loadTable("http://p5js.org/reference/assets/mammals.csv", + * // "csv", "header"); + * } + * + * function setup() { + * //count the columns + * print(table.getRowCount() + ' total rows in table'); + * print(table.getColumnCount() + ' total columns in table'); + * + * print(table.getColumn('name')); + * //["Goat", "Leopard", "Zebra"] + * + * //cycle through the table + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) { + * print(table.getString(r, c)); + * } + * describe(`randomly generated text from a file, + * for example "i smell like butter"`); + * } + * + *
                    + */ + _main.default.prototype.loadTable = function (path) { + // p5._validateParameters('loadTable', arguments); + var callback; + var errorCallback; + var options = []; + var header = false; + var ext = path.substring(path.lastIndexOf(".") + 1, path.length); + var sep; + if (ext === "csv") { + sep = ","; + } else if (ext === "ssv") { + sep = ";"; + } else if (ext === "tsv") { + sep = "\t"; + } + for (var i = 1; i < arguments.length; i++) { + if (typeof arguments[i] === "function") { + if (typeof callback === "undefined") { + callback = arguments[i]; + } else if (typeof errorCallback === "undefined") { + errorCallback = arguments[i]; + } + } else if (typeof arguments[i] === "string") { + options.push(arguments[i]); + if (arguments[i] === "header") { + header = true; + } + if (arguments[i] === "csv") { + sep = ","; + } else if (arguments[i] === "ssv") { + sep = ";"; + } else if (arguments[i] === "tsv") { + sep = "\t"; + } + } + } + var t = new _main.default.Table(); + var self = this; + this.httpDo( + path, + "GET", + "table", + function (resp) { + var state = {}; + // define constants + var PRE_TOKEN = 0, + MID_TOKEN = 1, + POST_TOKEN = 2, + POST_RECORD = 4; + var QUOTE = '"', + CR = "\r", + LF = "\n"; + var records = []; + var offset = 0; + var currentRecord = null; + var currentChar; + var tokenBegin = function tokenBegin() { + state.currentState = PRE_TOKEN; + state.token = ""; + }; + var tokenEnd = function tokenEnd() { + currentRecord.push(state.token); + tokenBegin(); + }; + var recordBegin = function recordBegin() { + state.escaped = false; + currentRecord = []; + tokenBegin(); + }; + var recordEnd = function recordEnd() { + state.currentState = POST_RECORD; + records.push(currentRecord); + currentRecord = null; + }; + for (;;) { + currentChar = resp[offset++]; + // EOF + if (currentChar == null) { + if (state.escaped) { + throw new Error("Unclosed quote in file."); + } + if (currentRecord) { + tokenEnd(); + recordEnd(); + break; + } + } + if (currentRecord === null) { + recordBegin(); + } // Handle opening quote + + if (state.currentState === PRE_TOKEN) { + if (currentChar === QUOTE) { + state.escaped = true; + state.currentState = MID_TOKEN; + continue; + } + state.currentState = MID_TOKEN; + } // mid-token and escaped, look for sequences and end quote + + if (state.currentState === MID_TOKEN && state.escaped) { + if (currentChar === QUOTE) { + if (resp[offset] === QUOTE) { + state.token += QUOTE; + offset++; + } else { + state.escaped = false; + state.currentState = POST_TOKEN; + } + } else if (currentChar === CR) { + continue; + } else { + state.token += currentChar; + } + continue; + } // fall-through: mid-token or post-token, not escaped + + if (currentChar === CR) { + if (resp[offset] === LF) { + offset++; + } + tokenEnd(); + recordEnd(); + } else if (currentChar === LF) { + tokenEnd(); + recordEnd(); + } else if (currentChar === sep) { + tokenEnd(); + } else if (state.currentState === MID_TOKEN) { + state.token += currentChar; + } + } // set up column names + + if (header) { + t.columns = records.shift(); + } else { + for (var _i2 = 0; _i2 < records[0].length; _i2++) { + t.columns[_i2] = "null"; + } + } + var row; + for (var _i3 = 0; _i3 < records.length; _i3++) { + //Handles row of 'undefined' at end of some CSVs + if (records[_i3].length === 1) { + if ( + records[_i3][0] === "undefined" || + records[_i3][0] === "" + ) { + continue; + } + } + row = new _main.default.TableRow(); + row.arr = records[_i3]; + row.obj = makeObject(records[_i3], t.columns); + t.addRow(row); + } + if (typeof callback === "function") { + callback(t); + } + self._decrementPreload(); + }, + function (err) { + // Error handling + _main.default._friendlyFileLoadError(2, path); + if (errorCallback) { + errorCallback(err); + } else { + console.error(err); + } + }, + ); + return t; + }; + // helper function to turn a row into a JSON object + function makeObject(row, headers) { + headers = headers || []; + if (typeof headers === "undefined") { + for (var j = 0; j < row.length; j++) { + headers[j.toString()] = j; + } + } + return Object.fromEntries( + headers.map(function (key, i) { + return [key, row[i]]; + }), + ); + } /** + * Reads the contents of a file and creates an XML object with its values. + * If the name of the file is used as the parameter, as in the above example, + * the file must be located in the sketch directory/folder. + * + * Alternatively, the file maybe be loaded from anywhere on the local + * computer using an absolute path (something that starts with / on Unix and + * Linux, or a drive letter on Windows), or the filename parameter can be a + * URL for a file found on a network. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. Calling loadXML() inside preload() + * guarantees to complete the operation before setup() and draw() are called. + * + * Outside of preload(), you may supply a callback function to handle the + * object. + * + * This method is suitable for fetching files up to size of 64MB. + * @method loadXML + * @param {String} filename name of the file or URL to load + * @param {function} [callback] function to be executed after loadXML() + * completes, XML object is passed in as + * first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Object} XML object containing data + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let children = xml.getChildren('animal'); + * + * for (let i = 0; i < children.length; i++) { + * let id = children[i].getNum('id'); + * let coloring = children[i].getString('species'); + * let name = children[i].getContent(); + * print(id + ', ' + coloring + ', ' + name); + * } + * describe('no image displayed'); + * } + * + * // Sketch prints: + * // 0, Capra hircus, Goat + * // 1, Panthera pardus, Leopard + * // 2, Equus zebra, Zebra + *
                    + */ + + _main.default.prototype.loadXML = function () { + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + var ret = new _main.default.XML(); + var callback, errorCallback; + for (var i = 1; i < args.length; i++) { + var arg = args[i]; + if (typeof arg === "function") { + if (typeof callback === "undefined") { + callback = arg; + } else if (typeof errorCallback === "undefined") { + errorCallback = arg; + } + } + } + var self = this; + this.httpDo( + args[0], + "GET", + "xml", + function (xml) { + for (var key in xml) { + ret[key] = xml[key]; + } + if (typeof callback !== "undefined") { + callback(ret); + } + self._decrementPreload(); + }, + function (err) { + // Error handling + _main.default._friendlyFileLoadError(1, arguments[0]); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }, + ); + return ret; + }; + /** + * This method is suitable for fetching files up to size of 64MB. + * @method loadBytes + * @param {string} file name of the file or URL to load + * @param {function} [callback] function to be executed after loadBytes() + * completes + * @param {function} [errorCallback] function to be executed if there + * is an error + * @returns {Object} an object whose 'bytes' property will be the loaded buffer + * + * @example + *
                    + * let data; + * + * function preload() { + * data = loadBytes('assets/mammals.xml'); + * } + * + * function setup() { + * for (let i = 0; i < 5; i++) { + * console.log(data.bytes[i].toString(16)); + * } + * describe('no image displayed'); + * } + *
                    + */ + _main.default.prototype.loadBytes = function ( + file, + callback, + errorCallback, + ) { + var ret = {}; + var self = this; + this.httpDo( + file, + "GET", + "arrayBuffer", + function (arrayBuffer) { + ret.bytes = new Uint8Array(arrayBuffer); + if (typeof callback === "function") { + callback(ret); + } + self._decrementPreload(); + }, + function (err) { + // Error handling + _main.default._friendlyFileLoadError(6, file); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }, + ); + return ret; + }; + /** + * Method for executing an HTTP GET request. If data type is not specified, + * p5 will try to guess based on the URL, defaulting to text. This is equivalent to + * calling httpDo(path, 'GET'). The 'binary' datatype will return + * a Blob object, and the 'arrayBuffer' datatype will return an ArrayBuffer + * which can be used to initialize typed arrays (such as Uint8Array). + * + * @method httpGet + * @param {String} path name of the file or url to load + * @param {String} [datatype] "json", "jsonp", "binary", "arrayBuffer", + * "xml", or "text" + * @param {Object|Boolean} [data] param data passed sent with request + * @param {function} [callback] function to be executed after + * httpGet() completes, data is passed in + * as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Promise} A promise that resolves with the data when the operation + * completes successfully or rejects with the error after + * one occurs. + * @example + *
                    + * // Examples use USGS Earthquake API: + * // https://earthquake.usgs.gov/fdsnws/event/1/#methods + * let earthquakes; + * function preload() { + * // Get the most recent earthquake in the database + * let url = + 'https://earthquake.usgs.gov/fdsnws/event/1/query?' + + * 'format=geojson&limit=1&orderby=time'; + * httpGet(url, 'jsonp', false, function(response) { + * // when the HTTP request completes, populate the variable that holds the + * // earthquake data used in the visualization. + * earthquakes = response; + * }); + * } + * + * function draw() { + * if (!earthquakes) { + * // Wait until the earthquake data has loaded before drawing. + * return; + * } + * background(200); + * // Get the magnitude and name of the earthquake out of the loaded JSON + * let earthquakeMag = earthquakes.features[0].properties.mag; + * let earthquakeName = earthquakes.features[0].properties.place; + * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); + * textAlign(CENTER); + * text(earthquakeName, 0, height - 30, width, 30); + * noLoop(); + * } + *
                    + */ + /** + * @method httpGet + * @param {String} path + * @param {Object|Boolean} data + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Promise} + */ + /** + * @method httpGet + * @param {String} path + * @param {function} callback + * @param {function} [errorCallback] + * @return {Promise} + */ + _main.default.prototype.httpGet = function () { + _main.default._validateParameters("httpGet", arguments); + var args = Array.prototype.slice.call(arguments); + args.splice(1, 0, "GET"); + return _main.default.prototype.httpDo.apply(this, args); + }; + /** + * Method for executing an HTTP POST request. If data type is not specified, + * p5 will try to guess based on the URL, defaulting to text. This is equivalent to + * calling httpDo(path, 'POST'). + * + * @method httpPost + * @param {String} path name of the file or url to load + * @param {String} [datatype] "json", "jsonp", "xml", or "text". + * If omitted, httpPost() will guess. + * @param {Object|Boolean} [data] param data passed sent with request + * @param {function} [callback] function to be executed after + * httpPost() completes, data is passed in + * as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Promise} A promise that resolves with the data when the operation + * completes successfully or rejects with the error after + * one occurs. + * + * @example + *
                    + * + * // Examples use jsonplaceholder.typicode.com for a Mock Data API + * + * let url = 'https://jsonplaceholder.typicode.com/posts'; + * let postData = { userId: 1, title: 'p5 Clicked!', body: 'p5.js is very cool.' }; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * } + * + * function mousePressed() { + * httpPost(url, 'json', postData, function(result) { + * strokeWeight(2); + * text(result.body, mouseX, mouseY); + * }); + * } + * + *
                    + * + *
                    + * let url = 'ttps://invalidURL'; // A bad URL that will cause errors + * let postData = { title: 'p5 Clicked!', body: 'p5.js is very cool.' }; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * } + * + * function mousePressed() { + * httpPost( + * url, + * 'json', + * postData, + * function(result) { + * // ... won't be called + * }, + * function(error) { + * strokeWeight(2); + * text(error.toString(), mouseX, mouseY); + * } + * ); + * } + *
                    + */ + /** + * @method httpPost + * @param {String} path + * @param {Object|Boolean} data + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Promise} + */ + /** + * @method httpPost + * @param {String} path + * @param {function} callback + * @param {function} [errorCallback] + * @return {Promise} + */ + _main.default.prototype.httpPost = function () { + _main.default._validateParameters("httpPost", arguments); + var args = Array.prototype.slice.call(arguments); + args.splice(1, 0, "POST"); + return _main.default.prototype.httpDo.apply(this, args); + }; + /** + * Method for executing an HTTP request. If data type is not specified, + * p5 will try to guess based on the URL, defaulting to text.

                    + * For more advanced use, you may also pass in the path as the first argument + * and a object as the second argument, the signature follows the one specified + * in the Fetch API specification. + * This method is suitable for fetching files up to size of 64MB when "GET" is used. + * + * @method httpDo + * @param {String} path name of the file or url to load + * @param {String} [method] either "GET", "POST", or "PUT", + * defaults to "GET" + * @param {String} [datatype] "json", "jsonp", "xml", or "text" + * @param {Object} [data] param data passed sent with request + * @param {function} [callback] function to be executed after + * httpGet() completes, data is passed in + * as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Promise} A promise that resolves with the data when the operation + * completes successfully or rejects with the error after + * one occurs. + * + * @example + *
                    + * + * // Examples use USGS Earthquake API: + * // https://earthquake.usgs.gov/fdsnws/event/1/#methods + * + * // displays an animation of all USGS earthquakes + * let earthquakes; + * let eqFeatureIndex = 0; + * + * function preload() { + * let url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson'; + * httpDo( + * url, + * { + * method: 'GET', + * // Other Request options, like special headers for apis + * headers: { authorization: 'Bearer secretKey' } + * }, + * function(res) { + * earthquakes = res; + * } + * ); + * } + * + * function draw() { + * // wait until the data is loaded + * if (!earthquakes || !earthquakes.features[eqFeatureIndex]) { + * return; + * } + * clear(); + * + * let feature = earthquakes.features[eqFeatureIndex]; + * let mag = feature.properties.mag; + * let rad = mag / 11 * ((width + height) / 2); + * fill(255, 0, 0, 100); + * ellipse(width / 2 + random(-2, 2), height / 2 + random(-2, 2), rad, rad); + * + * if (eqFeatureIndex >= earthquakes.features.length) { + * eqFeatureIndex = 0; + * } else { + * eqFeatureIndex += 1; + * } + * } + * + *
                    + */ + /** + * @method httpDo + * @param {String} path + * @param {Object} options Request object options as documented in the + * "fetch" API + * reference + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Promise} + */ + _main.default.prototype.httpDo = function () { + var type; + var callback; + var errorCallback; + var request; + var promise; + var jsonpOptions = {}; + var cbCount = 0; + var contentType = "text/plain"; + // Trim the callbacks off the end to get an idea of how many arguments are passed + for (var i = arguments.length - 1; i > 0; i--) { + if ( + typeof (i < 0 || arguments.length <= i + ? undefined + : arguments[i]) === "function" + ) { + cbCount++; + } else { + break; + } + } // The number of arguments minus callbacks + + var argsCount = arguments.length - cbCount; + var path = arguments.length <= 0 ? undefined : arguments[0]; + if ( + argsCount === 2 && + typeof path === "string" && + _typeof(arguments.length <= 1 ? undefined : arguments[1]) === + "object" + ) { + // Intended for more advanced use, pass in Request parameters directly + request = new Request( + path, + arguments.length <= 1 ? undefined : arguments[1], + ); + callback = arguments.length <= 2 ? undefined : arguments[2]; + errorCallback = arguments.length <= 3 ? undefined : arguments[3]; + } else { + // Provided with arguments + var method = "GET"; + var data; + for (var j = 1; j < arguments.length; j++) { + var a = + j < 0 || arguments.length <= j ? undefined : arguments[j]; + if (typeof a === "string") { + if ( + a === "GET" || + a === "POST" || + a === "PUT" || + a === "DELETE" + ) { + method = a; + } else if ( + a === "json" || + a === "jsonp" || + a === "binary" || + a === "arrayBuffer" || + a === "xml" || + a === "text" || + a === "table" + ) { + type = a; + } else { + data = a; + } + } else if (typeof a === "number") { + data = a.toString(); + } else if (_typeof(a) === "object") { + if ( + a.hasOwnProperty("jsonpCallback") || + a.hasOwnProperty("jsonpCallbackFunction") + ) { + for (var attr in a) { + jsonpOptions[attr] = a[attr]; + } + } else if (a instanceof _main.default.XML) { + data = a.serialize(); + contentType = "application/xml"; + } else { + data = JSON.stringify(a); + contentType = "application/json"; + } + } else if (typeof a === "function") { + if (!callback) { + callback = a; + } else { + errorCallback = a; + } + } + } + var headers = + method === "GET" + ? new Headers() + : new Headers({ + "Content-Type": contentType, + }); + request = new Request(path, { + method: method, + mode: "cors", + body: data, + headers: headers, + }); + } // do some sort of smart type checking + + if (!type) { + if (path.includes("json")) { + type = "json"; + } else if (path.includes("xml")) { + type = "xml"; + } else { + type = "text"; + } + } + if (type === "jsonp") { + promise = (0, _fetchJsonp.default)(path, jsonpOptions); + } else { + promise = fetch(request); + } + promise = promise.then(function (res) { + if (!res.ok) { + var err = new Error(res.body); + err.status = res.status; + err.ok = false; + throw err; + } else { + var fileSize = 0; + if (type !== "jsonp") { + fileSize = res.headers.get("content-length"); + } + if (fileSize && fileSize > 64000000) { + _main.default._friendlyFileLoadError(7, path); + } + switch (type) { + case "json": + case "jsonp": + return res.json(); + case "binary": + return res.blob(); + case "arrayBuffer": + return res.arrayBuffer(); + case "xml": + return res.text().then(function (text) { + var parser = new DOMParser(); + var xml = parser.parseFromString(text, "text/xml"); + return new _main.default.XML(xml.documentElement); + }); + default: + return res.text(); + } + } + }); + promise.then(callback || function () {}); + promise.catch(errorCallback || console.error); + return promise; + }; + /** + * @module IO + * @submodule Output + * @for p5 + */ + window.URL = window.URL || window.webkitURL; + // private array of p5.PrintWriter objects + _main.default.prototype._pWriters = []; + /** + * @method createWriter + * @param {String} name name of the file to be created + * @param {String} [extension] + * @return {p5.PrintWriter} + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * const writer = createWriter('squares.txt'); + * for (let i = 0; i < 10; i++) { + * writer.print(i * i); + * } + * writer.close(); + * writer.clear(); + * } + * } + * + *
                    + */ + _main.default.prototype.createWriter = function (name, extension) { + var newPW; + // check that it doesn't already exist + for (var i in _main.default.prototype._pWriters) { + if (_main.default.prototype._pWriters[i].name === name) { + // if a p5.PrintWriter w/ this name already exists... + // return p5.prototype._pWriters[i]; // return it w/ contents intact. + // or, could return a new, empty one with a unique name: + newPW = new _main.default.PrintWriter( + name + this.millis(), + extension, + ); + _main.default.prototype._pWriters.push(newPW); + return newPW; + } + } + newPW = new _main.default.PrintWriter(name, extension); + _main.default.prototype._pWriters.push(newPW); + return newPW; + }; + /** + * @class p5.PrintWriter + * @param {String} filename + * @param {String} [extension] + */ + _main.default.PrintWriter = function (filename, extension) { + var self = this; + this.name = filename; + this.content = ""; + //Changed to write because it was being overloaded by function below. + /** + * Writes data to the PrintWriter stream + * @method write + * @param {Array} data all data to be written by the PrintWriter + * @example + *
                    + * + * // creates a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // write 'Hello world!'' to the file + * writer.write(['Hello world!']); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                    + *
                    + * + * // creates a file called 'newFile2.txt' + * let writer = createWriter('newFile2.txt'); + * // write 'apples,bananas,123' to the file + * writer.write(['apples', 'bananas', 123]); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                    + *
                    + * + * // creates a file called 'newFile3.txt' + * let writer = createWriter('newFile3.txt'); + * // write 'My name is: Teddy' to the file + * writer.write('My name is:'); + * writer.write(' Teddy'); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                    + *
                    + * + * function setup() { + * createCanvas(100, 100); + * button = createButton('SAVE FILE'); + * button.position(21, 40); + * button.mousePressed(createFile); + * } + * + * function createFile() { + * // creates a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // write 'Hello world!'' to the file + * writer.write(['Hello world!']); + * // close the PrintWriter and save the file + * writer.close(); + * } + * + *
                    + */ + this.write = function (data) { + this.content += data; + }; + /** + * Writes data to the PrintWriter stream, and adds a new line at the end + * @method print + * @param {Array} data all data to be printed by the PrintWriter + * @example + *
                    + * + * // creates a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // creates a file containing + * // My name is: + * // Teddy + * writer.print('My name is:'); + * writer.print('Teddy'); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                    + *
                    + * + * let writer; + * + * function setup() { + * createCanvas(400, 400); + * // create a PrintWriter + * writer = createWriter('newFile.txt'); + * } + * + * function draw() { + * writer.print([mouseX, mouseY]); + * } + * + * function mouseClicked() { + * writer.close(); + * } + * + *
                    + */ + this.print = function (data) { + this.content += "".concat(data, "\n"); + }; + /** + * Clears the data already written to the PrintWriter object + * @method clear + * @example + *
                    + * // create writer object + * let writer = createWriter('newFile.txt'); + * writer.write(['clear me']); + * // clear writer object here + * writer.clear(); + * // close writer + * writer.close(); + *
                    + *
                    + * + * function setup() { + * button = createButton('CLEAR ME'); + * button.position(21, 40); + * button.mousePressed(createFile); + * } + * + * function createFile() { + * let writer = createWriter('newFile.txt'); + * writer.write(['clear me']); + * writer.clear(); + * writer.close(); + * } + * + *
                    + * + */ + this.clear = function () { + this.content = ""; + }; + /** + * Closes the PrintWriter + * @method close + * @example + *
                    + * + * // create a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                    + *
                    + * + * // create a file called 'newFile2.txt' + * let writer = createWriter('newFile2.txt'); + * // write some data to the file + * writer.write([100, 101, 102]); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                    + */ + this.close = function () { + // convert String to Array for the writeFile Blob + var arr = []; + arr.push(this.content); + _main.default.prototype.writeFile(arr, filename, extension); + // remove from _pWriters array and delete self + for (var i in _main.default.prototype._pWriters) { + if (_main.default.prototype._pWriters[i].name === this.name) { + // remove from _pWriters array + _main.default.prototype._pWriters.splice(i, 1); + } + } + self.clear(); + self = {}; + }; + }; + /** + * @module IO + * @submodule Output + * @for p5 + */ + // object, filename, options --> saveJSON, saveStrings, + // filename, [extension] [canvas] --> saveImage + /** + * Saves a given element(image, text, json, csv, wav, or html) to the client's + * computer. The first parameter can be a pointer to element we want to save. + * The element can be one of p5.Element,an Array of + * Strings, an Array of JSON, a JSON object, a p5.Table + * , a p5.Image, or a p5.SoundFile (requires + * p5.sound). The second parameter is a filename (including extension).The + * third parameter is for options specific to this type of object. This method + * will save a file that fits the given parameters. + * If it is called without specifying an element, by default it will save the + * whole canvas as an image file. You can optionally specify a filename as + * the first parameter in such a case. + * **Note that it is not recommended to + * call this method within draw, as it will open a new save dialog on every + * render.** + * + * @method save + * @param {Object|String} [objectOrFilename] If filename is provided, will + * save canvas as an image with + * either png or jpg extension + * depending on the filename. + * If object is provided, will + * save depending on the object + * and filename (see examples + * above). + * @param {String} [filename] If an object is provided as the first + * parameter, then the second parameter + * indicates the filename, + * and should include an appropriate + * file extension (see examples above). + * @param {Boolean|String} [options] Additional options depend on + * filetype. For example, when saving JSON, + * true indicates that the + * output will be optimized for filesize, + * rather than readability. + * + * @example + *
                    + * // Saves the canvas as an image + * cnv = createCanvas(300, 300); + * save(cnv, 'myCanvas.jpg'); + * + * // Saves the canvas as an image by default + * save('myCanvas.jpg'); + * describe('An example for saving a canvas as an image.'); + *
                    + * + *
                    + * // Saves p5.Image as an image + * img = createImage(10, 10); + * save(img, 'myImage.png'); + * describe('An example for saving a p5.Image element as an image.'); + *
                    + * + *
                    + * // Saves p5.Renderer object as an image + * obj = createGraphics(100, 100); + * save(obj, 'myObject.png'); + * describe('An example for saving a p5.Renderer element.'); + *
                    + * + *
                    + * let myTable = new p5.Table(); + * // Saves table as html file + * save(myTable, 'myTable.html'); + * + * // Comma Separated Values + * save(myTable, 'myTable.csv'); + * + * // Tab Separated Values + * save(myTable, 'myTable.tsv'); + * + * describe(`An example showing how to save a table in formats of + * HTML, CSV and TSV.`); + *
                    + * + *
                    + * let myJSON = { a: 1, b: true }; + * + * // Saves pretty JSON + * save(myJSON, 'my.json'); + * + * // Optimizes JSON filesize + * save(myJSON, 'my.json', true); + * + * describe('An example for saving JSON to a txt file with some extra arguments.'); + *
                    + * + *
                    + * // Saves array of strings to text file with line breaks after each item + * let arrayOfStrings = ['a', 'b']; + * save(arrayOfStrings, 'my.txt'); + * describe(`An example for saving an array of strings to text file + * with line breaks.`); + *
                    + */ + _main.default.prototype.save = function ( + object, + _filename, + _options, + ) { + // parse the arguments and figure out which things we are saving + var args = arguments; + // ================================================= + // OPTION 1: saveCanvas... + // if no arguments are provided, save canvas + var cnv = this._curElement ? this._curElement.elt : this.elt; + if (args.length === 0) { + _main.default.prototype.saveCanvas(cnv); + return; + } else if ( + args[0] instanceof _main.default.Renderer || + args[0] instanceof _main.default.Graphics + ) { + // otherwise, parse the arguments + // if first param is a p5Graphics, then saveCanvas + _main.default.prototype.saveCanvas(args[0].elt, args[1], args[2]); + return; + } else if (args.length === 1 && typeof args[0] === "string") { + // if 1st param is String and only one arg, assume it is canvas filename + _main.default.prototype.saveCanvas(cnv, args[0]); + } else { + // ================================================= + // OPTION 2: extension clarifies saveStrings vs. saveJSON + var extension = _checkFileExtension(args[1], args[2])[1]; + switch (extension) { + case "json": + _main.default.prototype.saveJSON(args[0], args[1], args[2]); + return; + case "txt": + _main.default.prototype.saveStrings( + args[0], + args[1], + args[2], + ); + return; + // ================================================= + // OPTION 3: decide based on object... + default: + if (args[0] instanceof Array) { + _main.default.prototype.saveStrings( + args[0], + args[1], + args[2], + ); + } else if (args[0] instanceof _main.default.Table) { + _main.default.prototype.saveTable( + args[0], + args[1], + args[2], + ); + } else if (args[0] instanceof _main.default.Image) { + _main.default.prototype.saveCanvas(args[0].canvas, args[1]); + } else if (args[0] instanceof _main.default.SoundFile) { + _main.default.prototype.saveSound( + args[0], + args[1], + args[2], + args[3], + ); + } + } + } + }; + /** + * Writes the contents of an Array or a JSON object to a .json file. + * The file saving process and location of the saved file will + * vary between web browsers. + * + * @method saveJSON + * @param {Array|Object} json + * @param {String} filename + * @param {Boolean} [optimize] If true, removes line breaks + * and spaces from the output + * file to optimize filesize + * (but not readability). + * @example + *
                    + * let json = {}; // new JSON Object + * + * json.id = 0; + * json.species = 'Panthera leo'; + * json.name = 'Lion'; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * describe('no image displayed'); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * saveJSON(json, 'lion.json'); + * } + * } + * + * // saves the following to a file called "lion.json": + * // { + * // "id": 0, + * // "species": "Panthera leo", + * // "name": "Lion" + * // } + *
                    + */ + _main.default.prototype.saveJSON = function (json, filename, opt) { + _main.default._validateParameters("saveJSON", arguments); + var stringify; + if (opt) { + stringify = JSON.stringify(json); + } else { + stringify = JSON.stringify(json, undefined, 2); + } + this.saveStrings(stringify.split("\n"), filename, "json"); + }; + _main.default.prototype.saveJSONObject = + _main.default.prototype.saveJSON; + _main.default.prototype.saveJSONArray = + _main.default.prototype.saveJSON; + /** + * Writes an array of Strings to a text file, one line per String. + * The file saving process and location of the saved file will + * vary between web browsers. + * + * @method saveStrings + * @param {String[]} list string array to be written + * @param {String} filename filename for output + * @param {String} [extension] the filename's extension + * @param {Boolean} [isCRLF] if true, change line-break to CRLF + * @example + *
                    + * let words = 'apple bear cat dog'; + * + * // .split() outputs an Array + * let list = split(words, ' '); + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * describe('no image displayed'); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * saveStrings(list, 'nouns.txt'); + * } + * } + * + * // Saves the following to a file called 'nouns.txt': + * // + * // apple + * // bear + * // cat + * // dog + *
                    + */ + _main.default.prototype.saveStrings = function ( + list, + filename, + extension, + isCRLF, + ) { + _main.default._validateParameters("saveStrings", arguments); + var ext = extension || "txt"; + var pWriter = this.createWriter(filename, ext); + for (var i = 0; i < list.length; i++) { + isCRLF + ? pWriter.write(list[i] + "\r\n") + : pWriter.write(list[i] + "\n"); + } + pWriter.close(); + pWriter.clear(); + }; + // ======= + // HELPERS + // ======= + function escapeHelper(content) { + return content + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + } /** + * Writes the contents of a Table object to a file. Defaults to a + * text file with comma-separated-values ('csv') but can also + * use tab separation ('tsv'), or generate an HTML table ('html'). + * The file saving process and location of the saved file will + * vary between web browsers. + * + * @method saveTable + * @param {p5.Table} Table the Table object to save to a file + * @param {String} filename the filename to which the Table should be saved + * @param {String} [options] can be one of "tsv", "csv", or "html" + * @example + *
                    + * let table; + * + * function setup() { + * table = new p5.Table(); + * + * table.addColumn('id'); + * table.addColumn('species'); + * table.addColumn('name'); + * + * let newRow = table.addRow(); + * newRow.setNum('id', table.getRowCount() - 1); + * newRow.setString('species', 'Panthera leo'); + * newRow.setString('name', 'Lion'); + * + * // To save, un-comment next line then click 'run' + * // saveTable(table, 'new.csv'); + * + * describe('no image displayed'); + * } + * + * // Saves the following to a file called 'new.csv': + * // id,species,name + * // 0,Panthera leo,Lion + *
                    + */ + + _main.default.prototype.saveTable = function ( + table, + filename, + options, + ) { + _main.default._validateParameters("saveTable", arguments); + var ext; + if (options === undefined) { + ext = filename.substring( + filename.lastIndexOf(".") + 1, + filename.length, + ); + } else { + ext = options; + } + var pWriter = this.createWriter(filename, ext); + var header = table.columns; + var sep = ","; // default to CSV + if (ext === "tsv") { + sep = "\t"; + } + if (ext !== "html") { + // make header if it has values + if (header[0] !== "0") { + for (var h = 0; h < header.length; h++) { + if (h < header.length - 1) { + pWriter.write(header[h] + sep); + } else { + pWriter.write(header[h]); + } + } + pWriter.write("\n"); + } // make rows + + for (var i = 0; i < table.rows.length; i++) { + var j = void 0; + for (j = 0; j < table.rows[i].arr.length; j++) { + if (j < table.rows[i].arr.length - 1) { + //double quotes should be inserted in csv only if contains comma separated single value + if ( + ext === "csv" && + String(table.rows[i].arr[j]).includes(",") + ) { + pWriter.write('"' + table.rows[i].arr[j] + '"' + sep); + } else { + pWriter.write(table.rows[i].arr[j] + sep); + } + } else { + //double quotes should be inserted in csv only if contains comma separated single value + if ( + ext === "csv" && + String(table.rows[i].arr[j]).includes(",") + ) { + pWriter.write('"' + table.rows[i].arr[j] + '"'); + } else { + pWriter.write(table.rows[i].arr[j]); + } + } + } + pWriter.write("\n"); + } + } else { + // otherwise, make HTML + pWriter.print(""); + pWriter.print(""); + var str = ' "); + pWriter.print(""); + pWriter.print(" "); + // make header if it has values + if (header[0] !== "0") { + pWriter.print(" "); + for (var k = 0; k < header.length; k++) { + var e = escapeHelper(header[k]); + pWriter.print(" "); + } + pWriter.print(" "); + } // make rows + + for (var row = 0; row < table.rows.length; row++) { + pWriter.print(" "); + for (var col = 0; col < table.columns.length; col++) { + var entry = table.rows[row].getString(col); + var htmlEntry = escapeHelper(entry); + pWriter.print(" "); + } + pWriter.print(" "); + } + pWriter.print("
                    ".concat(e)); + pWriter.print("
                    ".concat(htmlEntry)); + pWriter.print("
                    "); + pWriter.print(""); + pWriter.print(""); + } // close and clear the pWriter + + pWriter.close(); + pWriter.clear(); + }; // end saveTable() + /** + * Generate a blob of file data as a url to prepare for download. + * Accepts an array of data, a filename, and an extension (optional). + * This is a private function because it does not do any formatting, + * but it is used by saveStrings, saveJSON, saveTable etc. + * + * @param {Array} dataToDownload + * @param {String} filename + * @param {String} [extension] + * @private + */ + _main.default.prototype.writeFile = function ( + dataToDownload, + filename, + extension, + ) { + var type = "application/octet-stream"; + if (_main.default.prototype._isSafari()) { + type = "text/plain"; + } + var blob = new Blob(dataToDownload, { + type: type, + }); + _main.default.prototype.downloadFile(blob, filename, extension); + }; + /** + * Forces download. Accepts a url to filedata/blob, a filename, + * and an extension (optional). + * This is a private function because it does not do any formatting, + * but it is used by saveStrings, saveJSON, saveTable etc. + * + * @method downloadFile + * @private + * @param {String|Blob} data either an href generated by createObjectURL, + * or a Blob object containing the data + * @param {String} [filename] + * @param {String} [extension] + */ + _main.default.prototype.downloadFile = function ( + data, + fName, + extension, + ) { + var fx = _checkFileExtension(fName, extension); + var filename = fx[0]; + if (data instanceof Blob) { + _fileSaver.default.saveAs(data, filename); + return; + } + var a = document.createElement("a"); + a.href = data; + a.download = filename; + // Firefox requires the link to be added to the DOM before click() + a.onclick = function (e) { + destroyClickedElement(e); + e.stopPropagation(); + }; + a.style.display = "none"; + document.body.appendChild(a); + // Safari will open this file in the same page as a confusing Blob. + if (_main.default.prototype._isSafari()) { + var aText = "Hello, Safari user! To download this file...\n"; + aText += "1. Go to File --> Save As.\n"; + aText += '2. Choose "Page Source" as the Format.\n'; + aText += '3. Name it with this extension: ."'.concat(fx[1], '"'); + alert(aText); + } + a.click(); + }; + /** + * Returns a file extension, or another string + * if the provided parameter has no extension. + * + * @param {String} filename + * @param {String} [extension] + * @return {String[]} [fileName, fileExtension] + * + * @private + */ + function _checkFileExtension(filename, extension) { + if (!extension || extension === true || extension === "true") { + extension = ""; + } + if (!filename) { + filename = "untitled"; + } + var ext = ""; + // make sure the file will have a name, see if filename needs extension + if (filename && filename.includes(".")) { + ext = filename.split(".").pop(); + } // append extension if it doesn't exist + + if (extension) { + if (ext !== extension) { + ext = extension; + filename = "".concat(filename, ".").concat(ext); + } + } + return [filename, ext]; + } + _main.default.prototype._checkFileExtension = _checkFileExtension; + /** + * Returns true if the browser is Safari, false if not. + * Safari makes trouble for downloading files. + * + * @return {Boolean} [description] + * @private + */ + _main.default.prototype._isSafari = function () { + var x = Object.prototype.toString.call(window.HTMLElement); + return x.indexOf("Constructor") > 0; + }; + /** + * Helper function, a callback for download that deletes + * an invisible anchor element from the DOM once the file + * has been automatically downloaded. + * + * @private + */ + function destroyClickedElement(event) { + document.body.removeChild(event.target); + } + var _default = _main.default; + exports.default = _default; + }, + { + "../core/friendly_errors/fes_core": 289, + "../core/friendly_errors/file_errors": 290, + "../core/friendly_errors/validate_params": 293, + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.last-index-of": 181, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.object.from-entries": 195, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.promise": 201, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/web.dom-collections.iterator": 256, + "core-js/modules/web.url": 258, + "es6-promise/auto": 259, + "fetch-jsonp": 261, + "file-saver": 262, + "whatwg-fetch": 275, + }, + ], + 325: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.replace"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module IO + * @submodule Table + * @requires core + */ + /** + * Table Options + * Generic class for handling tabular data, typically from a + * CSV, TSV, or other sort of spreadsheet file. + * CSV files are + * + * comma separated values, often with the data in quotes. TSV + * files use tabs as separators, and usually don't bother with the + * quotes. + * File names should end with .csv if they're comma separated. + * A rough "spec" for CSV can be found + * here. + * To load files, use the loadTable method. + * To save tables to your computer, use the save method + * or the saveTable method. + * + * Possible options include: + *
                      + *
                    • csv - parse the table as comma-separated values + *
                    • tsv - parse the table as tab-separated values + *
                    • header - this table has a header (title) row + *
                    + */ + /** + * Table objects store data with multiple rows and columns, much + * like in a traditional spreadsheet. Tables can be generated from + * scratch, dynamically, or using data from an existing file. + * + * @class p5.Table + * @constructor + * @param {p5.TableRow[]} [rows] An array of p5.TableRow objects + */ + + _main.default.Table = /*#__PURE__*/ (function () { + /** + * An array containing the names of the columns in the table, if the "header" the table is + * loaded with the "header" parameter. + * @type {String[]} + * @property columns + * @name columns + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //print the column names + * for (let c = 0; c < table.getColumnCount(); c++) { + * print('column ' + c + ' is named ' + table.columns[c]); + * } + * } + * + *
                    + */ + function _class(rows) { + _classCallCheck(this, _class); + this.columns = []; + /** + * An array containing the p5.TableRow objects that make up the + * rows of the table. The same result as calling getRows() + * @type {p5.TableRow[]} + * @property rows + * @name rows + */ + this.rows = []; + } /** + * Use addRow() to add a new row of data to a p5.Table object. By default, + * an empty row is created. Typically, you would store a reference to + * the new row in a TableRow object (see newRow in the example above), + * and then set individual values using set(). + * + * If a p5.TableRow object is included as a parameter, then that row is + * duplicated and added to the table. + * + * @method addRow + * @param {p5.TableRow} [row] row to be added to the table + * @return {p5.TableRow} the row that was added + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //add a row + * let newRow = table.addRow(); + * newRow.setString('id', table.getRowCount() - 1); + * newRow.setString('species', 'Canis Lupus'); + * newRow.setString('name', 'Wolf'); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                    + */ + + _createClass(_class, [ + { + key: "addRow", + value: function addRow(row) { + // make sure it is a valid TableRow + var r = row || new _main.default.TableRow(); + if ( + typeof r.arr === "undefined" || + typeof r.obj === "undefined" + ) { + //r = new p5.prototype.TableRow(r); + throw new Error("invalid TableRow: ".concat(r)); + } + r.table = this; + this.rows.push(r); + return r; + } /** + * Removes a row from the table object. + * + * @method removeRow + * @param {Integer} id ID number of the row to remove + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //remove the first row + * table.removeRow(0); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "removeRow", + value: function removeRow(id) { + this.rows[id].table = null; // remove reference to table + var chunk = this.rows.splice(id + 1, this.rows.length); + this.rows.pop(); + this.rows = this.rows.concat(chunk); + } /** + * Returns a reference to the specified p5.TableRow. The reference + * can then be used to get and set values of the selected row. + * + * @method getRow + * @param {Integer} rowID ID number of the row to get + * @return {p5.TableRow} p5.TableRow object + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let row = table.getRow(1); + * //print it column by column + * //note: a row is an object, not an array + * for (let c = 0; c < table.getColumnCount(); c++) { + * print(row.getString(c)); + * } + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getRow", + value: function getRow(r) { + return this.rows[r]; + } /** + * Gets all rows from the table. Returns an array of p5.TableRows. + * + * @method getRows + * @return {p5.TableRow[]} Array of p5.TableRows + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * + * //warning: rows is an array of objects + * for (let r = 0; r < rows.length; r++) { + * rows[r].set('name', 'Unicorn'); + * } + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getRows", + value: function getRows() { + return this.rows; + } /** + * Finds the first row in the Table that contains the value + * provided, and returns a reference to that row. Even if + * multiple rows are possible matches, only the first matching + * row is returned. The column to search may be specified by + * either its ID or title. + * + * @method findRow + * @param {String} value The value to match + * @param {Integer|String} column ID number or title of the + * column to search + * @return {p5.TableRow} + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //find the animal named zebra + * let row = table.findRow('Zebra', 'name'); + * //find the corresponding species + * print(row.getString('species')); + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "findRow", + value: function findRow(value, column) { + // try the Object + if (typeof column === "string") { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column] === value) { + return this.rows[i]; + } + } + } else { + // try the Array + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column] === value) { + return this.rows[j]; + } + } + } // otherwise... + + return null; + } /** + * Finds the rows in the Table that contain the value + * provided, and returns references to those rows. Returns an + * Array, so for must be used to iterate through all the rows, + * as shown in the example above. The column to search may be + * specified by either its ID or title. + * + * @method findRows + * @param {String} value The value to match + * @param {Integer|String} column ID number or title of the + * column to search + * @return {p5.TableRow[]} An Array of TableRow objects + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //add another goat + * let newRow = table.addRow(); + * newRow.setString('id', table.getRowCount() - 1); + * newRow.setString('species', 'Scape Goat'); + * newRow.setString('name', 'Goat'); + * + * //find the rows containing animals named Goat + * let rows = table.findRows('Goat', 'name'); + * print(rows.length + ' Goats found'); + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "findRows", + value: function findRows(value, column) { + var ret = []; + if (typeof column === "string") { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column] === value) { + ret.push(this.rows[i]); + } + } + } else { + // try the Array + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column] === value) { + ret.push(this.rows[j]); + } + } + } + return ret; + } /** + * Finds the first row in the Table that matches the regular + * expression provided, and returns a reference to that row. + * Even if multiple rows are possible matches, only the first + * matching row is returned. The column to search may be + * specified by either its ID or title. + * + * @method matchRow + * @param {String|RegExp} regexp The regular expression to match + * @param {String|Integer} column The column ID (number) or + * title (string) + * @return {p5.TableRow} TableRow object + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //Search using specified regex on a given column, return TableRow object + * let mammal = table.matchRow(new RegExp('ant'), 1); + * print(mammal.getString(1)); + * //Output "Panthera pardus" + * } + * + *
                    + */, + }, + { + key: "matchRow", + value: function matchRow(regexp, column) { + if (typeof column === "number") { + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column].match(regexp)) { + return this.rows[j]; + } + } + } else { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column].match(regexp)) { + return this.rows[i]; + } + } + } + return null; + } /** + * Finds the rows in the Table that match the regular expression provided, + * and returns references to those rows. Returns an array, so for must be + * used to iterate through all the rows, as shown in the example. The + * column to search may be specified by either its ID or title. + * + * @method matchRows + * @param {String} regexp The regular expression to match + * @param {String|Integer} [column] The column ID (number) or + * title (string) + * @return {p5.TableRow[]} An Array of TableRow objects + * @example + *
                    + * + * let table; + * + * function setup() { + * table = new p5.Table(); + * + * table.addColumn('name'); + * table.addColumn('type'); + * + * let newRow = table.addRow(); + * newRow.setString('name', 'Lion'); + * newRow.setString('type', 'Mammal'); + * + * newRow = table.addRow(); + * newRow.setString('name', 'Snake'); + * newRow.setString('type', 'Reptile'); + * + * newRow = table.addRow(); + * newRow.setString('name', 'Mosquito'); + * newRow.setString('type', 'Insect'); + * + * newRow = table.addRow(); + * newRow.setString('name', 'Lizard'); + * newRow.setString('type', 'Reptile'); + * + * let rows = table.matchRows('R.*', 'type'); + * for (let i = 0; i < rows.length; i++) { + * print(rows[i].getString('name') + ': ' + rows[i].getString('type')); + * } + * } + * // Sketch prints: + * // Snake: Reptile + * // Lizard: Reptile + * + *
                    + */, + }, + { + key: "matchRows", + value: function matchRows(regexp, column) { + var ret = []; + if (typeof column === "number") { + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column].match(regexp)) { + ret.push(this.rows[j]); + } + } + } else { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column].match(regexp)) { + ret.push(this.rows[i]); + } + } + } + return ret; + } /** + * Retrieves all values in the specified column, and returns them + * as an array. The column may be specified by either its ID or title. + * + * @method getColumn + * @param {String|Number} column String or Number of the column to return + * @return {Array} Array of column values + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //getColumn returns an array that can be printed directly + * print(table.getColumn('species')); + * //outputs ["Capra hircus", "Panthera pardus", "Equus zebra"] + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getColumn", + value: function getColumn(value) { + var ret = []; + if (typeof value === "string") { + for (var i = 0; i < this.rows.length; i++) { + ret.push(this.rows[i].obj[value]); + } + } else { + for (var j = 0; j < this.rows.length; j++) { + ret.push(this.rows[j].arr[value]); + } + } + return ret; + } /** + * Removes all rows from a Table. While all rows are removed, + * columns and column titles are maintained. + * + * @method clearRows + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.clearRows(); + * print(table.getRowCount() + ' total rows in table'); + * print(table.getColumnCount() + ' total columns in table'); + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "clearRows", + value: function clearRows() { + delete this.rows; + this.rows = []; + } /** + * Use addColumn() to add a new column to a Table object. + * Typically, you will want to specify a title, so the column + * may be easily referenced later by name. (If no title is + * specified, the new column's title will be null.) + * + * @method addColumn + * @param {String} [title] title of the given column + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.addColumn('carnivore'); + * table.set(0, 'carnivore', 'no'); + * table.set(1, 'carnivore', 'yes'); + * table.set(2, 'carnivore', 'no'); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "addColumn", + value: function addColumn(title) { + var t = title || null; + this.columns.push(t); + } /** + * Returns the total number of columns in a Table. + * + * @method getColumnCount + * @return {Integer} Number of columns in this table + * @example + *
                    + * + * // given the cvs file "blobs.csv" in /assets directory + * // ID, Name, Flavor, Shape, Color + * // Blob1, Blobby, Sweet, Blob, Pink + * // Blob2, Saddy, Savory, Blob, Blue + * + * let table; + * + * function preload() { + * table = loadTable('assets/blobs.csv'); + * } + * + * function setup() { + * createCanvas(200, 100); + * textAlign(CENTER); + * background(255); + * } + * + * function draw() { + * let numOfColumn = table.getColumnCount(); + * text('There are ' + numOfColumn + ' columns in the table.', 100, 50); + * } + * + *
                    + */, + }, + { + key: "getColumnCount", + value: function getColumnCount() { + return this.columns.length; + } /** + * Returns the total number of rows in a Table. + * + * @method getRowCount + * @return {Integer} Number of rows in this table + * @example + *
                    + * + * // given the cvs file "blobs.csv" in /assets directory + * // + * // ID, Name, Flavor, Shape, Color + * // Blob1, Blobby, Sweet, Blob, Pink + * // Blob2, Saddy, Savory, Blob, Blue + * + * let table; + * + * function preload() { + * table = loadTable('assets/blobs.csv'); + * } + * + * function setup() { + * createCanvas(200, 100); + * textAlign(CENTER); + * background(255); + * } + * + * function draw() { + * text('There are ' + table.getRowCount() + ' rows in the table.', 100, 50); + * } + * + *
                    + */, + }, + { + key: "getRowCount", + value: function getRowCount() { + return this.rows.length; + } /** + * Removes any of the specified characters (or "tokens"). + * + * If no column is specified, then the values in all columns and + * rows are processed. A specific column may be referenced by + * either its ID or title. + * + * @method removeTokens + * @param {String} chars String listing characters to be removed + * @param {String|Integer} [column] Column ID (number) + * or name (string) + * + * @example + *
                    + * function setup() { + * let table = new p5.Table(); + * + * table.addColumn('name'); + * table.addColumn('type'); + * + * let newRow = table.addRow(); + * newRow.setString('name', ' $Lion ,'); + * newRow.setString('type', ',,,Mammal'); + * + * newRow = table.addRow(); + * newRow.setString('name', '$Snake '); + * newRow.setString('type', ',,,Reptile'); + * + * table.removeTokens(',$ '); + * print(table.getArray()); + * } + * + * // prints: + * // 0 "Lion" "Mamal" + * // 1 "Snake" "Reptile" + *
                    + */, + }, + { + key: "removeTokens", + value: function removeTokens(chars, column) { + var escape = function escape(s) { + return s.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); + }; + var charArray = []; + for (var i = 0; i < chars.length; i++) { + charArray.push(escape(chars.charAt(i))); + } + var regex = new RegExp(charArray.join("|"), "g"); + if (typeof column === "undefined") { + for (var c = 0; c < this.columns.length; c++) { + for (var d = 0; d < this.rows.length; d++) { + var s = this.rows[d].arr[c]; + s = s.replace(regex, ""); + this.rows[d].arr[c] = s; + this.rows[d].obj[this.columns[c]] = s; + } + } + } else if (typeof column === "string") { + for (var j = 0; j < this.rows.length; j++) { + var val = this.rows[j].obj[column]; + val = val.replace(regex, ""); + this.rows[j].obj[column] = val; + var pos = this.columns.indexOf(column); + this.rows[j].arr[pos] = val; + } + } else { + for (var k = 0; k < this.rows.length; k++) { + var str = this.rows[k].arr[column]; + str = str.replace(regex, ""); + this.rows[k].arr[column] = str; + this.rows[k].obj[this.columns[column]] = str; + } + } + } /** + * Trims leading and trailing whitespace, such as spaces and tabs, + * from String table values. If no column is specified, then the + * values in all columns and rows are trimmed. A specific column + * may be referenced by either its ID or title. + * + * @method trim + * @param {String|Integer} [column] Column ID (number) + * or name (string) + * @example + *
                    + * function setup() { + * let table = new p5.Table(); + * + * table.addColumn('name'); + * table.addColumn('type'); + * + * let newRow = table.addRow(); + * newRow.setString('name', ' Lion ,'); + * newRow.setString('type', ' Mammal '); + * + * newRow = table.addRow(); + * newRow.setString('name', ' Snake '); + * newRow.setString('type', ' Reptile '); + * + * table.trim(); + * print(table.getArray()); + * } + * + * // prints: + * // 0 "Lion" "Mamal" + * // 1 "Snake" "Reptile" + *
                    + */, + }, + { + key: "trim", + value: function trim(column) { + var regex = new RegExp(" ", "g"); + if (typeof column === "undefined") { + for (var c = 0; c < this.columns.length; c++) { + for (var d = 0; d < this.rows.length; d++) { + var s = this.rows[d].arr[c]; + s = s.replace(regex, ""); + this.rows[d].arr[c] = s; + this.rows[d].obj[this.columns[c]] = s; + } + } + } else if (typeof column === "string") { + for (var j = 0; j < this.rows.length; j++) { + var val = this.rows[j].obj[column]; + val = val.replace(regex, ""); + this.rows[j].obj[column] = val; + var pos = this.columns.indexOf(column); + this.rows[j].arr[pos] = val; + } + } else { + for (var k = 0; k < this.rows.length; k++) { + var str = this.rows[k].arr[column]; + str = str.replace(regex, ""); + this.rows[k].arr[column] = str; + this.rows[k].obj[this.columns[column]] = str; + } + } + } /** + * Use removeColumn() to remove an existing column from a Table + * object. The column to be removed may be identified by either + * its title (a String) or its index value (an int). + * removeColumn(0) would remove the first column, removeColumn(1) + * would remove the second column, and so on. + * + * @method removeColumn + * @param {String|Integer} column columnName (string) or ID (number) + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.removeColumn('id'); + * print(table.getColumnCount()); + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "removeColumn", + value: function removeColumn(c) { + var cString; + var cNumber; + if (typeof c === "string") { + // find the position of c in the columns + cString = c; + cNumber = this.columns.indexOf(c); + } else { + cNumber = c; + cString = this.columns[c]; + } + var chunk = this.columns.splice( + cNumber + 1, + this.columns.length, + ); + this.columns.pop(); + this.columns = this.columns.concat(chunk); + for (var i = 0; i < this.rows.length; i++) { + var tempR = this.rows[i].arr; + var chip = tempR.splice(cNumber + 1, tempR.length); + tempR.pop(); + this.rows[i].arr = tempR.concat(chip); + delete this.rows[i].obj[cString]; + } + } /** + * Stores a value in the Table's specified row and column. + * The row is specified by its ID, while the column may be specified + * by either its ID or title. + * + * @method set + * @param {Integer} row row ID + * @param {String|Integer} column column ID (Number) + * or title (String) + * @param {String|Number} value value to assign + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.set(0, 'species', 'Canis Lupus'); + * table.set(0, 'name', 'Wolf'); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "set", + value: function set(row, column, value) { + this.rows[row].set(column, value); + } /** + * Stores a Float value in the Table's specified row and column. + * The row is specified by its ID, while the column may be specified + * by either its ID or title. + * + * @method setNum + * @param {Integer} row row ID + * @param {String|Integer} column column ID (Number) + * or title (String) + * @param {Number} value value to assign + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.setNum(1, 'id', 1); + * + * print(table.getColumn(0)); + * //["0", 1, "2"] + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "setNum", + value: function setNum(row, column, value) { + this.rows[row].setNum(column, value); + } /** + * Stores a String value in the Table's specified row and column. + * The row is specified by its ID, while the column may be specified + * by either its ID or title. + * + * @method setString + * @param {Integer} row row ID + * @param {String|Integer} column column ID (Number) + * or title (String) + * @param {String} value value to assign + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //add a row + * let newRow = table.addRow(); + * newRow.setString('id', table.getRowCount() - 1); + * newRow.setString('species', 'Canis Lupus'); + * newRow.setString('name', 'Wolf'); + * + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                    + */, + }, + { + key: "setString", + value: function setString(row, column, value) { + this.rows[row].setString(column, value); + } /** + * Retrieves a value from the Table's specified row and column. + * The row is specified by its ID, while the column may be specified by + * either its ID or title. + * + * @method get + * @param {Integer} row row ID + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String|Number} + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * print(table.get(0, 1)); + * //Capra hircus + * print(table.get(0, 'species')); + * //Capra hircus + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "get", + value: function get(row, column) { + return this.rows[row].get(column); + } /** + * Retrieves a Float value from the Table's specified row and column. + * The row is specified by its ID, while the column may be specified by + * either its ID or title. + * + * @method getNum + * @param {Integer} row row ID + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {Number} + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * print(table.getNum(1, 0) + 100); + * //id 1 + 100 = 101 + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getNum", + value: function getNum(row, column) { + return this.rows[row].getNum(column); + } /** + * Retrieves a String value from the Table's specified row and column. + * The row is specified by its ID, while the column may be specified by + * either its ID or title. + * + * @method getString + * @param {Integer} row row ID + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String} + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * // table is comma separated value "CSV" + * // and has specifiying header for column labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * print(table.getString(0, 0)); // 0 + * print(table.getString(0, 1)); // Capra hircus + * print(table.getString(0, 2)); // Goat + * print(table.getString(1, 0)); // 1 + * print(table.getString(1, 1)); // Panthera pardus + * print(table.getString(1, 2)); // Leopard + * print(table.getString(2, 0)); // 2 + * print(table.getString(2, 1)); // Equus zebra + * print(table.getString(2, 2)); // Zebra + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getString", + value: function getString(row, column) { + return this.rows[row].getString(column); + } /** + * Retrieves all table data and returns as an object. If a column name is + * passed in, each row object will be stored with that attribute as its + * title. + * + * @method getObject + * @param {String} [headerColumn] Name of the column which should be used to + * title each row object (optional) + * @return {Object} + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let tableObject = table.getObject(); + * + * print(tableObject); + * //outputs an object + * + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getObject", + value: function getObject(headerColumn) { + var tableObject = {}; + var obj, cPos, index; + for (var i = 0; i < this.rows.length; i++) { + obj = this.rows[i].obj; + if (typeof headerColumn === "string") { + cPos = this.columns.indexOf(headerColumn); // index of columnID + if (cPos >= 0) { + index = obj[headerColumn]; + tableObject[index] = obj; + } else { + throw new Error( + 'This table has no column named "'.concat( + headerColumn, + '"', + ), + ); + } + } else { + tableObject[i] = this.rows[i].obj; + } + } + return tableObject; + } /** + * Retrieves all table data and returns it as a multidimensional array. + * + * @method getArray + * @return {Array} + * + * @example + *
                    + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leoperd + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * // table is comma separated value "CSV" + * // and has specifiying header for column labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let tableArray = table.getArray(); + * for (let i = 0; i < tableArray.length; i++) { + * print(tableArray[i]); + * } + * describe('no image displayed'); + * } + * + *
                    + */, + }, + { + key: "getArray", + value: function getArray() { + var tableArray = []; + for (var i = 0; i < this.rows.length; i++) { + tableArray.push(this.rows[i].arr); + } + return tableArray; + }, + }, + ]); + return _class; + })(); + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.regexp.constructor": 204, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.match": 211, + "core-js/modules/es.string.replace": 214, + }, + ], + 326: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.from-entries"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.from-entries"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module IO + * @submodule Table + * @requires core + */ + /** + * A TableRow object represents a single row of data values, + * stored in columns, from a table. + * + * A Table Row contains both an ordered array, and an unordered + * JSON object. + * + * @class p5.TableRow + * @constructor + * @param {String} [str] optional: populate the row with a + * string of values, separated by the + * separator + * @param {String} [separator] comma separated values (csv) by default + */ + + _main.default.TableRow = /*#__PURE__*/ (function () { + function _class(str, separator) { + _classCallCheck(this, _class); + var arr = []; + if (str) { + separator = separator || ","; + arr = str.split(separator); + } + this.arr = arr; + this.obj = Object.fromEntries(arr.entries()); + this.table = null; + } /** + * Stores a value in the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method set + * @param {String|Integer} column Column ID (Number) + * or Title (String) + * @param {String|Number} value The value to be stored + * + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * rows[r].set('name', 'Unicorn'); + * } + * + * //print the results + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                    + */ + + _createClass(_class, [ + { + key: "set", + value: function set(column, value) { + // if typeof column is string, use .obj + if (typeof column === "string") { + var cPos = this.table.columns.indexOf(column); // index of columnID + if (cPos >= 0) { + this.obj[column] = value; + this.arr[cPos] = value; + } else { + throw new Error( + 'This table has no column named "'.concat(column, '"'), + ); + } + } else { + // if typeof column is number, use .arr + if (column < this.table.columns.length) { + this.arr[column] = value; + var cTitle = this.table.columns[column]; + this.obj[cTitle] = value; + } else { + throw new Error( + "Column #".concat( + column, + " is out of the range of this table", + ), + ); + } + } + } /** + * Stores a Float value in the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method setNum + * @param {String|Integer} column Column ID (Number) + * or Title (String) + * @param {Number|String} value The value to be stored + * as a Float + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * rows[r].setNum('id', r + 10); + * } + * + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                    + */, + }, + { + key: "setNum", + value: function setNum(column, value) { + var floatVal = parseFloat(value); + this.set(column, floatVal); + } /** + * Stores a String value in the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method setString + * @param {String|Integer} column Column ID (Number) + * or Title (String) + * @param {String|Number|Boolean|Object} value The value to be stored + * as a String + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * let name = rows[r].getString('name'); + * rows[r].setString('name', 'A ' + name + ' named George'); + * } + * + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                    + */, + }, + { + key: "setString", + value: function setString(column, value) { + var stringVal = value.toString(); + this.set(column, stringVal); + } /** + * Retrieves a value from the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method get + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String|Number} + * + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let names = []; + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * names.push(rows[r].get('name')); + * } + * + * print(names); + * + * describe('no image displayed'); + * } + *
                    + */, + }, + { + key: "get", + value: function get(column) { + if (typeof column === "string") { + return this.obj[column]; + } else { + return this.arr[column]; + } + } /** + * Retrieves a Float value from the TableRow's specified + * column. The column may be specified by either its ID or + * title. + * + * @method getNum + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {Number} Float Floating point number + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * let minId = Infinity; + * let maxId = -Infinity; + * for (let r = 0; r < rows.length; r++) { + * let id = rows[r].getNum('id'); + * minId = min(minId, id); + * maxId = min(maxId, id); + * } + * print('minimum id = ' + minId + ', maximum id = ' + maxId); + * describe('no image displayed'); + * } + *
                    + */, + }, + { + key: "getNum", + value: function getNum(column) { + var ret; + if (typeof column === "string") { + ret = parseFloat(this.obj[column]); + } else { + ret = parseFloat(this.arr[column]); + } + if (ret.toString() === "NaN") { + throw "Error: ".concat( + this.obj[column], + " is NaN (Not a Number)", + ); + } + return ret; + } /** + * Retrieves an String value from the TableRow's specified + * column. The column may be specified by either its ID or + * title. + * + * @method getString + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String} String + * @example + *
                    + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * let longest = ''; + * for (let r = 0; r < rows.length; r++) { + * let species = rows[r].getString('species'); + * if (longest.length < species.length) { + * longest = species; + * } + * } + * + * print('longest: ' + longest); + * + * describe('no image displayed'); + * } + *
                    + */, + }, + { + key: "getString", + value: function getString(column) { + if (typeof column === "string") { + return this.obj[column].toString(); + } else { + return this.arr[column].toString(); + } + }, + }, + ]); + return _class; + })(); + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.from-entries": 195, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.split": 216, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 327: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module IO + * @submodule Input + * @requires core + */ + /** + * XML is a representation of an XML object, able to parse XML code. Use + * loadXML() to load external XML files and create XML objects. + * + * @class p5.XML + * @constructor + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let children = xml.getChildren('animal'); + * + * for (let i = 0; i < children.length; i++) { + * let id = children[i].getNum('id'); + * let coloring = children[i].getString('species'); + * let name = children[i].getContent(); + * print(id + ', ' + coloring + ', ' + name); + * } + * + * describe('no image displayed'); + * } + * + * // Sketch prints: + * // 0, Capra hircus, Goat + * // 1, Panthera pardus, Leopard + * // 2, Equus zebra, Zebra + *
                    + */ + + _main.default.XML = /*#__PURE__*/ (function () { + function _class(DOM) { + _classCallCheck(this, _class); + if (!DOM) { + var xmlDoc = document.implementation.createDocument( + null, + "doc", + ); + this.DOM = xmlDoc.createElement("root"); + } else { + this.DOM = DOM; + } + } /** + * Gets a copy of the element's parent. Returns the parent as another + * p5.XML object. + * + * @method getParent + * @return {p5.XML} element parent + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let children = xml.getChildren('animal'); + * let parent = children[1].getParent(); + * print(parent.getName()); + * } + * + * // Sketch prints: + * // mammals + *
                    + */ + + _createClass(_class, [ + { + key: "getParent", + value: function getParent() { + return new _main.default.XML(this.DOM.parentElement); + } /** + * Gets the element's full name, which is returned as a String. + * + * @method getName + * @return {String} the name of the node + * @example<animal + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.getName()); + * } + * + * // Sketch prints: + * // mammals + *
                    + */, + }, + { + key: "getName", + value: function getName() { + return this.DOM.tagName; + } /** + * Sets the element's name, which is specified as a String. + * + * @method setName + * @param {String} the new name of the node + * @example<animal + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.getName()); + * xml.setName('fish'); + * print(xml.getName()); + * } + * + * // Sketch prints: + * // mammals + * // fish + *
                    + */, + }, + { + key: "setName", + value: function setName(name) { + var content = this.DOM.innerHTML; + var attributes = this.DOM.attributes; + var xmlDoc = document.implementation.createDocument( + null, + "default", + ); + var newDOM = xmlDoc.createElement(name); + newDOM.innerHTML = content; + for (var i = 0; i < attributes.length; i++) { + newDOM.setAttribute( + attributes[i].nodeName, + attributes.nodeValue, + ); + } + this.DOM = newDOM; + } /** + * Checks whether or not the element has any children, and returns the result + * as a boolean. + * + * @method hasChildren + * @return {boolean} + * @example<animal + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.hasChildren()); + * } + * + * // Sketch prints: + * // true + *
                    + */, + }, + { + key: "hasChildren", + value: function hasChildren() { + return this.DOM.children.length > 0; + } /** + * Get the names of all of the element's children, and returns the names as an + * array of Strings. This is the same as looping through and calling getName() + * on each child element individually. + * + * @method listChildren + * @return {String[]} names of the children of the element + * @example<animal + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.listChildren()); + * } + * + * // Sketch prints: + * // ["animal", "animal", "animal"] + *
                    + */, + }, + { + key: "listChildren", + value: function listChildren() { + var arr = []; + for (var i = 0; i < this.DOM.childNodes.length; i++) { + arr.push(this.DOM.childNodes[i].nodeName); + } + return arr; + } /** + * Returns all of the element's children as an array of p5.XML objects. When + * the name parameter is specified, then it will return all children that match + * that name. + * + * @method getChildren + * @param {String} [name] element name + * @return {p5.XML[]} children of the element + * @example<animal + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let animals = xml.getChildren('animal'); + * + * for (let i = 0; i < animals.length; i++) { + * print(animals[i].getContent()); + * } + * } + * + * // Sketch prints: + * // "Goat" + * // "Leopard" + * // "Zebra" + *
                    + */, + }, + { + key: "getChildren", + value: function getChildren(param) { + if (param) { + return elementsToP5XML( + this.DOM.getElementsByTagName(param), + ); + } else { + return elementsToP5XML(this.DOM.children); + } + } /** + * Returns the first of the element's children that matches the name parameter + * or the child of the given index.It returns undefined if no matching + * child is found. + * + * @method getChild + * @param {String|Integer} name element name or index + * @return {p5.XML} + * @example<animal + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getContent()); + * } + * + * // Sketch prints: + * // "Goat" + *
                    + *
                    + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let secondChild = xml.getChild(1); + * print(secondChild.getContent()); + * } + * + * // Sketch prints: + * // "Leopard" + *
                    + */, + }, + { + key: "getChild", + value: function getChild(param) { + if (typeof param === "string") { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = this.DOM.children[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var child = _step.value; + if (child.tagName === param) + return new _main.default.XML(child); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } else { + return new _main.default.XML(this.DOM.children[param]); + } + } /** + * Appends a new child to the element. The child can be specified with + * either a String, which will be used as the new tag's name, or as a + * reference to an existing p5.XML object. + * A reference to the newly created child is returned as an p5.XML object. + * + * @method addChild + * @param {p5.XML} node a p5.XML Object which will be the child to be added + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let child = new p5.XML(); + * child.setName('animal'); + * child.setAttribute('id', '3'); + * child.setAttribute('species', 'Ornithorhynchus anatinus'); + * child.setContent('Platypus'); + * xml.addChild(child); + * + * let animals = xml.getChildren('animal'); + * print(animals[animals.length - 1].getContent()); + * } + * + * // Sketch prints: + * // "Goat" + * // "Leopard" + * // "Zebra" + *
                    + */, + }, + { + key: "addChild", + value: function addChild(node) { + if (node instanceof _main.default.XML) { + this.DOM.appendChild(node.DOM); + } else { + // PEND + } + } /** + * Removes the element specified by name or index. + * + * @method removeChild + * @param {String|Integer} name element name or index + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * xml.removeChild('animal'); + * let children = xml.getChildren(); + * for (let i = 0; i < children.length; i++) { + * print(children[i].getContent()); + * } + * } + * + * // Sketch prints: + * // "Leopard" + * // "Zebra" + *
                    + *
                    + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * xml.removeChild(1); + * let children = xml.getChildren(); + * for (let i = 0; i < children.length; i++) { + * print(children[i].getContent()); + * } + * } + * + * // Sketch prints: + * // "Goat" + * // "Zebra" + *
                    + */, + }, + { + key: "removeChild", + value: function removeChild(param) { + var ind = -1; + if (typeof param === "string") { + for (var i = 0; i < this.DOM.children.length; i++) { + if (this.DOM.children[i].tagName === param) { + ind = i; + break; + } + } + } else { + ind = param; + } + if (ind !== -1) { + this.DOM.removeChild(this.DOM.children[ind]); + } + } /** + * Counts the specified element's number of attributes, returned as an Number. + * + * @method getAttributeCount + * @return {Integer} + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getAttributeCount()); + * } + * + * // Sketch prints: + * // 2 + *
                    + */, + }, + { + key: "getAttributeCount", + value: function getAttributeCount() { + return this.DOM.attributes.length; + } /** + * Gets all of the specified element's attributes, and returns them as an + * array of Strings. + * + * @method listAttributes + * @return {String[]} an array of strings containing the names of attributes + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.listAttributes()); + * } + * + * // Sketch prints: + * // ["id", "species"] + *
                    + */, + }, + { + key: "listAttributes", + value: function listAttributes() { + var arr = []; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = this.DOM.attributes[Symbol.iterator](), + _step2; + !(_iteratorNormalCompletion2 = (_step2 = + _iterator2.next()).done); + _iteratorNormalCompletion2 = true + ) { + var attribute = _step2.value; + arr.push(attribute.nodeName); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + return arr; + } /** + * Checks whether or not an element has the specified attribute. + * + * @method hasAttribute + * @param {String} the attribute to be checked + * @return {boolean} true if attribute found else false + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.hasAttribute('species')); + * print(firstChild.hasAttribute('color')); + * } + * + * // Sketch prints: + * // true + * // false + *
                    + */, + }, + { + key: "hasAttribute", + value: function hasAttribute(name) { + var obj = {}; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = this.DOM.attributes[Symbol.iterator](), + _step3; + !(_iteratorNormalCompletion3 = (_step3 = + _iterator3.next()).done); + _iteratorNormalCompletion3 = true + ) { + var attribute = _step3.value; + obj[attribute.nodeName] = attribute.nodeValue; + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion3 && + _iterator3.return != null + ) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + return obj[name] ? true : false; + } /** + * Returns an attribute value of the element as an Number. If the defaultValue + * parameter is specified and the attribute doesn't exist, then defaultValue + * is returned. If no defaultValue is specified and the attribute doesn't + * exist, the value 0 is returned. + * + * @method getNum + * @param {String} name the non-null full name of the attribute + * @param {Number} [defaultValue] the default value of the attribute + * @return {Number} + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getNum('id')); + * } + * + * // Sketch prints: + * // 0 + *
                    + */, + }, + { + key: "getNum", + value: function getNum(name, defaultValue) { + var obj = {}; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for ( + var _iterator4 = this.DOM.attributes[Symbol.iterator](), + _step4; + !(_iteratorNormalCompletion4 = (_step4 = + _iterator4.next()).done); + _iteratorNormalCompletion4 = true + ) { + var attribute = _step4.value; + obj[attribute.nodeName] = attribute.nodeValue; + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion4 && + _iterator4.return != null + ) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + return Number(obj[name]) || defaultValue || 0; + } /** + * Returns an attribute value of the element as an String. If the defaultValue + * parameter is specified and the attribute doesn't exist, then defaultValue + * is returned. If no defaultValue is specified and the attribute doesn't + * exist, null is returned. + * + * @method getString + * @param {String} name the non-null full name of the attribute + * @param {Number} [defaultValue] the default value of the attribute + * @return {String} + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getString('species')); + * } + * + * // Sketch prints: + * // "Capra hircus" + *
                    + */, + }, + { + key: "getString", + value: function getString(name, defaultValue) { + var obj = {}; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + try { + for ( + var _iterator5 = this.DOM.attributes[Symbol.iterator](), + _step5; + !(_iteratorNormalCompletion5 = (_step5 = + _iterator5.next()).done); + _iteratorNormalCompletion5 = true + ) { + var attribute = _step5.value; + obj[attribute.nodeName] = attribute.nodeValue; + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion5 && + _iterator5.return != null + ) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + return obj[name] ? String(obj[name]) : defaultValue || null; + } /** + * Sets the content of an element's attribute. The first parameter specifies + * the attribute name, while the second specifies the new content. + * + * @method setAttribute + * @param {String} name the full name of the attribute + * @param {Number|String|Boolean} value the value of the attribute + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getString('species')); + * firstChild.setAttribute('species', 'Jamides zebra'); + * print(firstChild.getString('species')); + * } + * + * // Sketch prints: + * // "Capra hircus" + * // "Jamides zebra" + *
                    + */, + }, + { + key: "setAttribute", + value: function setAttribute(name, value) { + this.DOM.setAttribute(name, value); + } /** + * Returns the content of an element. If there is no such content, + * defaultValue is returned if specified, otherwise null is returned. + * + * @method getContent + * @param {String} [defaultValue] value returned if no content is found + * @return {String} + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getContent()); + * } + * + * // Sketch prints: + * // "Goat" + *
                    + */, + }, + { + key: "getContent", + value: function getContent(defaultValue) { + var str; + str = this.DOM.textContent; + str = str.replace(/\s\s+/g, ","); + return str || defaultValue || null; + } /** + * Sets the element's content. + * + * @method setContent + * @param {String} text the new content + * @example + *
                    + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getContent()); + * firstChild.setContent('Mountain Goat'); + * print(firstChild.getContent()); + * } + * + * // Sketch prints: + * // "Goat" + * // "Mountain Goat" + *
                    + */, + }, + { + key: "setContent", + value: function setContent(content) { + if (!this.DOM.children.length) { + this.DOM.textContent = content; + } + } /** + * Serializes the element into a string. This function is useful for preparing + * the content to be sent over a http request or saved to file. + * + * @method serialize + * @return {String} Serialized string of the element + * @example + *
                    + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.serialize()); + * } + * + * // Sketch prints: + * // + * // Goat + * // Leopard + * // Zebra + * // + *
                    + */, + }, + { + key: "serialize", + value: function serialize() { + var xmlSerializer = new XMLSerializer(); + return xmlSerializer.serializeToString(this.DOM); + }, + }, + ]); + return _class; + })(); + function elementsToP5XML(elements) { + var arr = []; + for (var i = 0; i < elements.length; i++) { + arr.push(new _main.default.XML(elements[i])); + } + return arr; + } + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.number.constructor": 191, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 328: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Math + * @submodule Calculation + * @for p5 + * @requires core + */ + /** + * Calculates the absolute value of a number. A number's absolute value is its + * distance from zero on the number line. -5 and 5 are both five units away + * from zero, so calling `abs(-5)` and `abs(5)` both return 5. The absolute + * value of a number is always positive. + * + * @method abs + * @param {Number} n number to compute. + * @return {Number} absolute value of given number. + * @example + *
                    + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let centerX = width / 2; + * let x = frameCount; + * let y = abs(x - centerX); + * point(x, y); + * + * describe('A series of black dots that form a "V" shape.'); + * } + * + *
                    + */ + + _main.default.prototype.abs = Math.abs; + /** + * Calculates the closest integer value that is greater than or equal to the + * parameter's value. For example, calling `ceil(9.03)` returns the value + * 10. + * + * @method ceil + * @param {Number} n number to round up. + * @return {Integer} rounded up number. + * @example + *
                    + * + * // Set the range for RGB values from 0 to 1. + * colorMode(RGB, 1); + * noStroke(); + * + * let r = 0.3; + * fill(r, 0, 0); + * rect(0, 0, width / 2, height); + * + * // Round r up to 1. + * r = ceil(r); + * fill(r, 0, 0); + * rect(width / 2, 0, width / 2, height); + * + * describe('Two rectangles. The one on the left is dark red and the one on the right is bright red.'); + * + *
                    + */ + _main.default.prototype.ceil = Math.ceil; + /** + * Constrains a number between a minimum and maximum value. + * + * @method constrain + * @param {Number} n number to constrain. + * @param {Number} low minimum limit. + * @param {Number} high maximum limit. + * @return {Number} constrained number. + * @example + *
                    + * + * function draw() { + * background(200); + * + * let x = constrain(mouseX, 33, 67); + * let y = 50; + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot drawn on a gray square follows the mouse from left to right. Its movement is constrained to the middle third of the square.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * // Set boundaries and draw them. + * let leftWall = width * 0.25; + * let rightWall = width * 0.75; + * line(leftWall, 0, leftWall, height); + * line(rightWall, 0, rightWall, height); + * + * // Draw a circle that follows the mouse freely. + * fill(255); + * circle(mouseX, height / 3, 9); + * + * // Draw a circle that's constrained. + * let xc = constrain(mouseX, leftWall, rightWall); + * fill(0); + * circle(xc, 2 * height / 3, 9); + * + * describe('Two vertical lines. Two circles move horizontally with the mouse. One circle stops at the vertical lines.'); + * } + * + *
                    + */ + _main.default.prototype.constrain = function (n, low, high) { + _main.default._validateParameters("constrain", arguments); + return Math.max(Math.min(n, high), low); + }; + /** + * Calculates the distance between two points. + * + * The version of `dist()` with four parameters calculates distance in two + * dimensions. + * + * The version of `dist()` with six parameters calculates distance in three + * dimensions. + * + * Use p5.Vector.dist() to calculate the + * distance between two p5.Vector objects. + * + * @method dist + * @param {Number} x1 x-coordinate of the first point. + * @param {Number} y1 y-coordinate of the first point. + * @param {Number} x2 x-coordinate of the second point. + * @param {Number} y2 y-coordinate of the second point. + * @return {Number} distance between the two points. + * + * @example + *
                    + * + * let x1 = 10; + * let y1 = 50; + * let x2 = 90; + * let y2 = 50; + * + * line(x1, y1, x2, y2); + * strokeWeight(5); + * point(x1, y1); + * point(x2, y2); + * + * let d = dist(x1, y1, x2, y2); + * text(d, 43, 40); + * + * describe('Two dots connected by a horizontal line. The number 80 is written above the center of the line.'); + * + *
                    + */ + /** + * @method dist + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 z-coordinate of the first point. + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate of the second point. + * @return {Number} distance between the two points. + */ + _main.default.prototype.dist = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("dist", args); + if (args.length === 4) { + //2D + return Math.hypot(args[2] - args[0], args[3] - args[1]); + } else if (args.length === 6) { + //3D + return Math.hypot( + args[3] - args[0], + args[4] - args[1], + args[5] - args[2], + ); + } + }; + /** + * Returns Euler's number e (2.71828...) raised to the power of the `n` + * parameter. + * + * @method exp + * @param {Number} n exponent to raise. + * @return {Number} e^n + * @example + *
                    + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 0.005 * exp(x * 0.1); + * point(x, y); + * + * describe('A series of black dots that grow exponentially from left to right.'); + * } + * + *
                    + */ + _main.default.prototype.exp = Math.exp; + /** + * Calculates the closest integer value that is less than or equal to the + * value of the `n` parameter. + * + * @method floor + * @param {Number} n number to round down. + * @return {Integer} rounded down number. + * @example + *
                    + * + * // Set the range for RGB values from 0 to 1. + * colorMode(RGB, 1); + * noStroke(); + * + * let r = 0.8; + * fill(r, 0, 0); + * rect(0, 0, width / 2, height); + * + * // Round r down to 0. + * r = floor(r); + * fill(r, 0, 0); + * rect(width / 2, 0, width / 2, height); + * + * describe('Two rectangles. The one on the left is bright red and the one on the right is black.'); + * + *
                    + */ + _main.default.prototype.floor = Math.floor; + /** + * Calculates a number between two numbers at a specific increment. The `amt` + * parameter is the amount to interpolate between the two numbers. 0.0 is + * equal to the first number, 0.1 is very near the first number, 0.5 is + * half-way in between, and 1.0 is equal to the second number. The `lerp()` + * function is convenient for creating motion along a straight path and for + * drawing dotted lines. + * + * If the value of `amt` is less than 0 or more than 1, `lerp()` will return a + * number outside of the original interval. For example, calling + * `lerp(0, 10, 1.5)` will return 15. + * + * @method lerp + * @param {Number} start first value. + * @param {Number} stop second value. + * @param {Number} amt number. + * @return {Number} lerped value. + * @example + *
                    + * + * let a = 20; + * let b = 80; + * let c = lerp(a, b, 0.2); + * let d = lerp(a, b, 0.5); + * let e = lerp(a, b, 0.8); + * + * let y = 50; + * + * strokeWeight(5); + * + * // Draw the original points in black. + * stroke(0); + * point(a, y); + * point(b, y); + * + * // Draw the lerped points in gray. + * stroke(100); + * point(c, y); + * point(d, y); + * point(e, y); + * + * describe('Five points in a horizontal line. The outer points are black and the inner points are gray.'); + * + *
                    + */ + _main.default.prototype.lerp = function (start, stop, amt) { + _main.default._validateParameters("lerp", arguments); + return amt * (stop - start) + start; + }; + /** + * Calculates the natural logarithm (the base-e logarithm) of a number. This + * function expects the `n` parameter to be a value greater than 0.0. + * + * @method log + * @param {Number} n number greater than 0. + * @return {Number} natural logarithm of n. + * @example + *
                    + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 15 * log(x); + * point(x, y); + * + * describe('A series of black dots that get higher slowly from left to right.'); + * } + * + *
                    + */ + _main.default.prototype.log = Math.log; + /** + * Calculates the magnitude, or length, of a vector. A vector is like an arrow + * pointing in space. Vectors are commonly used for programming motion. + * + * Vectors don't have a "start" position because the same arrow can be drawn + * anywhere. A vector's magnitude can be thought of as the distance from the + * origin (0, 0) to its tip at (x, y). `mag(x, y)` is a shortcut for calling + * `dist(0, 0, x, y)`. + * + * @method mag + * @param {Number} x first component. + * @param {Number} y second component. + * @return {Number} magnitude of vector from (0,0) to (x,y). + * @example + *
                    + * + * let x = 30; + * let y = 40; + * let m = mag(x, y); + * + * line(0, 0, x, y); + * text(m, x, y); + * + * describe('A diagonal line is drawn from the top left of the canvas. The number 50 is written at the end of the line.'); + * + *
                    + */ + _main.default.prototype.mag = function (x, y) { + _main.default._validateParameters("mag", arguments); + return Math.hypot(x, y); + }; + /** + * Re-maps a number from one range to another. + * + * For example, calling `map(2, 0, 10, 0, 100)` returns 20. The first three + * arguments set the original value to 2 and the original range from 0 to 10. + * The last two arguments set the target range from 0 to 100. 20's position + * in the target range [0, 100] is proportional to 2's position in the + * original range [0, 10]. + * + * @method map + * @param {Number} value the incoming value to be converted. + * @param {Number} start1 lower bound of the value's current range. + * @param {Number} stop1 upper bound of the value's current range. + * @param {Number} start2 lower bound of the value's target range. + * @param {Number} stop2 upper bound of the value's target range. + * @param {Boolean} [withinBounds] constrain the value to the newly mapped range. + * @return {Number} remapped number. + * @example + *
                    + * + * let n = map(7, 0, 10, 0, 100); + * text(n, 50, 50); + * + * describe('The number 70 written in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let x = map(2, 0, 10, 0, width); + * circle(x, 50, 10); + * + * describe('A white circle drawn on the left side of a gray square.'); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let c = map(mouseX, 0, width, 0, 255); + * fill(c); + * circle(50, 50, 20); + * + * describe('A circle changes color from black to white as the mouse moves from left to right.'); + * } + * + *
                    + */ + _main.default.prototype.map = function ( + n, + start1, + stop1, + start2, + stop2, + withinBounds, + ) { + _main.default._validateParameters("map", arguments); + var newval = + ((n - start1) / (stop1 - start1)) * (stop2 - start2) + start2; + if (!withinBounds) { + return newval; + } + if (start2 < stop2) { + return this.constrain(newval, start2, stop2); + } else { + return this.constrain(newval, stop2, start2); + } + }; + /** + * Returns the largest value in a sequence of numbers. + * + * The version of `max()` with one parameter interprets it as an array of + * numbers and returns the largest number. + * + * The version of `max()` with two or more parameters interprets them as + * individual numbers and returns the largest number. + * + * @method max + * @param {Number} n0 first number to compare. + * @param {Number} n1 second number to compare. + * @return {Number} maximum number. + * @example + *
                    + * + * let m = max(10, 20); + * text(m, 50, 50); + * + * describe('The number 20 written in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let m = max([10, 20]); + * text(m, 50, 50); + * + * describe('The number 20 written in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let numbers = [2, 1, 5, 4, 8, 9]; + * + * // Draw all of the numbers in the array. + * noStroke(); + * let spacing = 15; + * numbers.forEach((n, index) => { + * let x = index * spacing; + * let y = 25; + * text(n, x, y); + * }); + * + * // Draw the maximum value in the array. + * let m = max(numbers); + * let maxX = 33; + * let maxY = 80; + * + * textSize(32); + * text(m, maxX, maxY); + * + * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 9 is written in large text at the center of the square.'); + * + *
                    + */ + /** + * @method max + * @param {Number[]} nums numbers to compare. + * @return {Number} + */ + _main.default.prototype.max = function () { + var findMax = function findMax(arr) { + var max = -Infinity; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = arr[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var x = _step.value; + max = x > max ? x : max; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return max; + }; + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + if (args[0] instanceof Array) { + return findMax(args[0]); + } else { + return findMax(args); + } + }; + /** + * Returns the smallest value in a sequence of numbers. + * + * The version of `min()` with one parameter interprets it as an array of + * numbers and returns the smallest number. + * + * The version of `min()` with two or more parameters interprets them as + * individual numbers and returns the smallest number. + * + * @method min + * @param {Number} n0 first number to compare. + * @param {Number} n1 second number to compare. + * @return {Number} minimum number. + * @example + *
                    + * + * let m = min(10, 20); + * text(m, 50, 50); + * + * describe('The number 10 written in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let m = min([10, 20]); + * text(m, 50, 50); + * + * describe('The number 10 written in the middle of a gray square.'); + * + *
                    + * + *
                    + * + * let numbers = [2, 1, 5, 4, 8, 9]; + * + * // Draw all of the numbers in the array. + * noStroke(); + * let spacing = 15; + * numbers.forEach((n, index) => { + * let x = index * spacing; + * let y = 25; + * text(n, x, y); + * }); + * + * // Draw the minimum value in the array. + * let m = min(numbers); + * let minX = 33; + * let minY = 80; + * + * textSize(32); + * text(m, minX, minY); + * + * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 1 is written in large text at the center of the square.'); + * + *
                    + */ + /** + * @method min + * @param {Number[]} nums numbers to compare. + * @return {Number} + */ + _main.default.prototype.min = function () { + var findMin = function findMin(arr) { + var min = Infinity; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = arr[Symbol.iterator](), _step2; + !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) + .done); + _iteratorNormalCompletion2 = true + ) { + var x = _step2.value; + min = x < min ? x : min; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + return min; + }; + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + if (args[0] instanceof Array) { + return findMin(args[0]); + } else { + return findMin(args); + } + }; + /** + * Maps a number from one range to a value between 0 and 1. + * + * For example, `norm(2, 0, 10)` returns 0.2. 2's position in the original + * range [0, 10] is proportional to 0.2's position in the range [0, 1]. This + * is equivalent to calling `map(2, 0, 10, 0, 1)`. + * + * Numbers outside of the original range are not constrained between 0 and 1. + * Out-of-range values are often intentional and useful. + * + * @method norm + * @param {Number} value incoming value to be normalized. + * @param {Number} start lower bound of the value's current range. + * @param {Number} stop upper bound of the value's current range. + * @return {Number} normalized number. + * @example + *
                    + * + * function draw() { + * // Set the range for RGB values from 0 to 1. + * colorMode(RGB, 1); + * + * let r = norm(mouseX, 0, width); + * background(r, 0, 0); + * + * describe('A square changes color from black to red as the mouse moves from left to right.'); + * } + * + *
                    + */ + _main.default.prototype.norm = function (n, start, stop) { + _main.default._validateParameters("norm", arguments); + return this.map(n, start, stop, 0, 1); + }; + /** + * Calculates exponential expressions such as 2^3. + * + * For example, `pow(2, 3)` is equivalent to the expression + * 2 × 2 × 2. `pow(2, -3)` is equivalent to 1 ÷ + * (2 × 2 × 2). + * + * @method pow + * @param {Number} n base of the exponential expression. + * @param {Number} e power by which to raise the base. + * @return {Number} n^e. + * @example + *
                    + * + * let base = 3; + * + * let d = pow(base, 1); + * circle(10, 10, d); + * + * d = pow(base, 2); + * circle(20, 20, d); + * + * d = pow(base, 3); + * circle(40, 40, d); + * + * d = pow(base, 4); + * circle(80, 80, d); + * + * describe('A series of circles that grow exponentially from top left to bottom right.'); + * + *
                    + */ + _main.default.prototype.pow = Math.pow; + /** + * Calculates the integer closest to the `n` parameter. For example, + * `round(133.8)` returns the value 134. + * + * @method round + * @param {Number} n number to round. + * @param {Number} [decimals] number of decimal places to round to, default is 0. + * @return {Integer} rounded number. + * @example + *
                    + * + * let x = round(3.7); + * text(x, width / 2, height / 2); + * + * describe('The number 4 written in middle of canvas.'); + * + *
                    + * + *
                    + * + * let x = round(12.782383, 2); + * text(x, width / 2, height / 2); + * + * describe('The number 12.78 written in middle of canvas.'); + * + *
                    + */ + _main.default.prototype.round = function (n, decimals) { + if (!decimals) { + return Math.round(n); + } + var multiplier = Math.pow(10, decimals); + return Math.round(n * multiplier) / multiplier; + }; + /** + * Squares a number, which means multiplying the number by itself. The value + * returned is always a positive number. + * + * For example, `sq(3)` evaluates 3 × 3 which is 9. `sq(-3)` evaluates + * -3 × -3 which is also 9. Multiplying two negative numbers produces + * a positive number. + * + * @method sq + * @param {Number} n number to square. + * @return {Number} squared number. + * @example + *
                    + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 0.01 * sq(x); + * point(x, y); + * + * describe('A series of black dots that get higher quickly from left to right.'); + * } + * + *
                    + */ + _main.default.prototype.sq = function (n) { + return n * n; + }; + /** + * Calculates the square root of a number. A number's square root can be + * multiplied by itself to produce the original number. + * + * For example, `sqrt(9)` returns 3 because 3 × 3 = 9. `sqrt()` always + * returns a positive value. `sqrt()` doesn't work with negative arguments + * such as `sqrt(-9)`. + * + * @method sqrt + * @param {Number} n non-negative number to square root. + * @return {Number} square root of number. + * @example + *
                    + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 5 * sqrt(x); + * point(x, y); + * + * describe('A series of black dots that get higher slowly from left to right.'); + * } + * + *
                    + */ + _main.default.prototype.sqrt = Math.sqrt; + /** + * Calculates the fractional part of a number. For example, + * `fract(12.34)` returns 0.34. + * + * @method fract + * @param {Number} n number whose fractional part will be found. + * @returns {Number} fractional part of n. + * @example + *
                    + * + * let n = 56.78; + * text(n, 20, 33); + * let f = fract(n); + * text(f, 20, 66); + * + * describe('The number 56.78 written above the number 0.78.'); + * + *
                    + */ + _main.default.prototype.fract = function (toConvert) { + _main.default._validateParameters("fract", arguments); + var sign = 0; + var num = Number(toConvert); + if (isNaN(num) || Math.abs(num) === Infinity) { + return num; + } else if (num < 0) { + num = -num; + sign = 1; + } + if (String(num).includes(".") && !String(num).includes("e")) { + var toFract = String(num); + toFract = Number("0" + toFract.slice(toFract.indexOf("."))); + return Math.abs(sign - toFract); + } else if (num < 1) { + return Math.abs(sign - num); + } else { + return 0; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.math.hypot": 188, + "core-js/modules/es.number.constructor": 191, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 329: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.slice"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } /** + * @module Math + * @submodule Vector + * @for p5 + * @requires core + */ + /** + * Creates a new p5.Vector object. A vector is like + * an arrow pointing in space. Vectors have both magnitude (length) + * and direction. Calling `createVector()` without arguments sets the new + * vector's components to 0. + * + * p5.Vector objects are often used to program + * motion because they simplify the math. For example, a moving ball has a + * position and a velocity. Position describes where the ball is in space. The + * ball's position vector extends from the origin to the ball's center. + * Velocity describes the ball's speed and the direction it's moving. If the + * ball is moving straight up, its velocity vector points straight up. Adding + * the ball's velocity vector to its position vector moves it, as in + * `pos.add(vel)`. Vector math relies on methods inside the + * p5.Vector class. + * + * @method createVector + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @return {p5.Vector} new p5.Vector object. + * @example + *
                    + * + * let p1 = createVector(25, 25); + * let p2 = createVector(50, 50); + * let p3 = createVector(75, 75); + * + * strokeWeight(5); + * point(p1); + * point(p2); + * point(p3); + * + * describe('Three black dots form a diagonal line from top left to bottom right.'); + * + *
                    + * + *
                    + * + * let pos; + * let vel; + * + * function setup() { + * createCanvas(100, 100); + * pos = createVector(width / 2, height); + * vel = createVector(0, -1); + * } + * + * function draw() { + * background(200); + * + * pos.add(vel); + * + * if (pos.y < 0) { + * pos.y = height; + * } + * + * strokeWeight(5); + * point(pos); + * + * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); + * } + * + *
                    + */ + + _main.default.prototype.createVector = function (x, y, z) { + if (this instanceof _main.default) { + return _construct( + _main.default.Vector, + [ + this._fromRadians.bind(this), + this._toRadians.bind(this), + ].concat(Array.prototype.slice.call(arguments)), + ); + } else { + return new _main.default.Vector(x, y, z); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.to-string": 206, + }, + ], + 330: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } ////////////////////////////////////////////////////////////// + // http://mrl.nyu.edu/~perlin/noise/ + // Adapting from PApplet.java + // which was adapted from toxi + // which was adapted from the german demo group farbrausch + // as used in their demo "art": http://www.farb-rausch.de/fr010src.zip + // someday we might consider using "improved noise" + // http://mrl.nyu.edu/~perlin/paper445.pdf + // See: https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/ + // blob/main/introduction/Noise1D/noise.js + /** + * @module Math + * @submodule Noise + * @for p5 + * @requires core + */ + + var PERLIN_YWRAPB = 4; + var PERLIN_YWRAP = 1 << PERLIN_YWRAPB; + var PERLIN_ZWRAPB = 8; + var PERLIN_ZWRAP = 1 << PERLIN_ZWRAPB; + var PERLIN_SIZE = 4095; + var perlin_octaves = 4; // default to medium smooth + var perlin_amp_falloff = 0.5; // 50% reduction/octave + var scaled_cosine = function scaled_cosine(i) { + return 0.5 * (1 - Math.cos(i * Math.PI)); + }; + var perlin; // will be initialized lazily by noise() or noiseSeed() + /** + * Returns random numbers that can be tuned to feel more organic. The values + * returned will always be between 0 and 1. + * + * Values returned by random() and + * randomGaussian() can change by large + * amounts between function calls. By contrast, values returned by `noise()` + * can be made "smooth". Calls to `noise()` with similar inputs will produce + * similar outputs. `noise()` is used to create textures, motion, shapes, + * terrains, and so on. Ken Perlin invented `noise()` while animating the + * original Tron film in the 1980s. + * + * `noise()` returns the same value for a given input while a sketch is + * running. It produces different results each time a sketch runs. The + * noiseSeed() function can be used to generate + * the same sequence of Perlin noise values each time a sketch runs. + * + * The character of the noise can be adjusted in two ways. The first way is to + * scale the inputs. `noise()` interprets inputs as coordinates. The sequence + * of noise values will be smoother when the input coordinates are closer. The + * second way is to use the noiseDetail() + * function. + * + * The version of `noise()` with one parameter computes noise values in one + * dimension. This dimension can be thought of as space, as in `noise(x)`, or + * time, as in `noise(t)`. + * + * The version of `noise()` with two parameters computes noise values in two + * dimensions. These dimensions can be thought of as space, as in + * `noise(x, y)`, or space and time, as in `noise(x, t)`. + * + * The version of `noise()` with three parameters computes noise values in + * three dimensions. These dimensions can be thought of as space, as in + * `noise(x, y, z)`, or space and time, as in `noise(x, y, t)`. + * + * @method noise + * @param {Number} x x-coordinate in noise space. + * @param {Number} [y] y-coordinate in noise space. + * @param {Number} [z] z-coordinate in noise space. + * @return {Number} Perlin noise value at specified coordinates. + * @example + *
                    + * + * function draw() { + * background(200); + * + * let x = 100 * noise(0.005 * frameCount); + * let y = 100 * noise(0.005 * frameCount + 10000); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves randomly on a gray square.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let noiseLevel = 100; + * let noiseScale = 0.005; + * // Scale input coordinate. + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let x = noiseLevel * noise(nt); + * let y = noiseLevel * noise(nt + 10000); + * // Render. + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves randomly on a gray square.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * let noiseLevel = 100; + * let noiseScale = 0.02; + * // Scale input coordinate. + * let x = frameCount; + * let nx = noiseScale * x; + * // Compute noise value. + * let y = noiseLevel * noise(nx); + * // Render. + * line(x, 0, x, y); + * + * describe('A hilly terrain drawn in gray against a black sky.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let noiseLevel = 100; + * let noiseScale = 0.002; + * for (let x = 0; x < width; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let y = noiseLevel * noise(nx, nt); + * // Render. + * line(x, 0, x, y); + * } + * + * describe('A calm sea drawn in gray against a black sky.'); + * } + * + *
                    + * + *
                    + * + * let noiseLevel = 255; + * let noiseScale = 0.01; + * for (let y = 0; y < height; y += 1) { + * for (let x = 0; x < width; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let ny = noiseScale * y; + * // Compute noise value. + * let c = noiseLevel * noise(nx, ny); + * // Render. + * stroke(c); + * point(x, y); + * } + * } + * + * describe('A gray cloudy pattern.'); + * + *
                    + * + *
                    + * + * function draw() { + * let noiseLevel = 255; + * let noiseScale = 0.009; + * for (let y = 0; y < height; y += 1) { + * for (let x = 0; x < width; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let ny = noiseScale * y; + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let c = noiseLevel * noise(nx, ny, nt); + * // Render. + * stroke(c); + * point(x, y); + * } + * } + * + * describe('A gray cloudy pattern that changes.'); + * } + * + *
                    + */ + _main.default.prototype.noise = function (x) { + var y = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var z = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + if (perlin == null) { + perlin = new Array(PERLIN_SIZE + 1); + for (var i = 0; i < PERLIN_SIZE + 1; i++) { + perlin[i] = Math.random(); + } + } + if (x < 0) { + x = -x; + } + if (y < 0) { + y = -y; + } + if (z < 0) { + z = -z; + } + var xi = Math.floor(x), + yi = Math.floor(y), + zi = Math.floor(z); + var xf = x - xi; + var yf = y - yi; + var zf = z - zi; + var rxf, ryf; + var r = 0; + var ampl = 0.5; + var n1, n2, n3; + for (var o = 0; o < perlin_octaves; o++) { + var of = xi + (yi << PERLIN_YWRAPB) + (zi << PERLIN_ZWRAPB); + rxf = scaled_cosine(xf); + ryf = scaled_cosine(yf); + n1 = perlin[of & PERLIN_SIZE]; + n1 += rxf * (perlin[(of + 1) & PERLIN_SIZE] - n1); + n2 = perlin[(of + PERLIN_YWRAP) & PERLIN_SIZE]; + n2 += rxf * (perlin[(of + PERLIN_YWRAP + 1) & PERLIN_SIZE] - n2); + n1 += ryf * (n2 - n1); + of += PERLIN_ZWRAP; + n2 = perlin[of & PERLIN_SIZE]; + n2 += rxf * (perlin[(of + 1) & PERLIN_SIZE] - n2); + n3 = perlin[(of + PERLIN_YWRAP) & PERLIN_SIZE]; + n3 += rxf * (perlin[(of + PERLIN_YWRAP + 1) & PERLIN_SIZE] - n3); + n2 += ryf * (n3 - n2); + n1 += scaled_cosine(zf) * (n2 - n1); + r += n1 * ampl; + ampl *= perlin_amp_falloff; + xi <<= 1; + xf *= 2; + yi <<= 1; + yf *= 2; + zi <<= 1; + zf *= 2; + if (xf >= 1) { + xi++; + xf--; + } + if (yf >= 1) { + yi++; + yf--; + } + if (zf >= 1) { + zi++; + zf--; + } + } + return r; + }; + /** + * Adjusts the character of the noise produced by the + * noise() function. + * + * Perlin noise values are created by adding layers of noise together. The + * noise layers, called octaves, are similar to harmonics in music. Lower + * octaves contribute more to the output signal. They define the overall + * intensity of the noise. Higher octaves create finer-grained details. + * + * By default, noise values are created by combining four octaves. Each higher + * octave contributes half as much (50% less) compared to its predecessor. + * `noiseDetail()` changes the number of octaves and the falloff amount. For + * example, calling `noiseDetail(6, 0.25)` ensures that + * noise() will use six octaves. Each higher octave + * will contribute 25% as much (75% less) compared to its predecessor. Falloff + * values between 0 and 1 are valid. However, falloff values greater than 0.5 + * might result in noise values greater than 1. + * + * @method noiseDetail + * @param {Number} lod number of octaves to be used by the noise. + * @param {Number} falloff falloff factor for each octave. + * @example + *
                    + * + * let noiseLevel = 255; + * let noiseScale = 0.02; + * for (let y = 0; y < height; y += 1) { + * for (let x = 0; x < width / 2; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let ny = noiseScale * y; + * + * // Compute noise value. + * noiseDetail(6, 0.25); + * let c = noiseLevel * noise(nx, ny); + * // Render left side. + * stroke(c); + * point(x, y); + * + * // Compute noise value. + * noiseDetail(4, 0.5); + * c = noiseLevel * noise(nx, ny); + * // Render right side. + * stroke(c); + * point(x + width / 2, y); + * } + * } + * + * describe('Two gray cloudy patterns. The pattern on the right is cloudier than the pattern on the left.'); + * + *
                    + */ + _main.default.prototype.noiseDetail = function (lod, falloff) { + if (lod > 0) { + perlin_octaves = lod; + } + if (falloff > 0) { + perlin_amp_falloff = falloff; + } + }; + /** + * Sets the seed value for noise(). By default, + * noise() produces different results each time + * a sketch is run. Calling `noiseSeed()` with a constant + * argument, such as `noiseSeed(99)`, makes noise() + * produce the same results each time a sketch is run. + * + * @method noiseSeed + * @param {Number} seed seed value. + * @example + *
                    + * + * function setup() { + * noiseSeed(99); + * background(255); + * } + * + * function draw() { + * let noiseLevel = 100; + * let noiseScale = 0.005; + * // Scale input coordinate. + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let x = noiseLevel * noise(nt); + * // Render. + * line(x, 0, x, height); + * + * describe('A black rectangle that grows randomly, first to the right and then to the left.'); + * } + * + *
                    + */ + _main.default.prototype.noiseSeed = function (seed) { + // Linear Congruential Generator + // Variant of a Lehman Generator + var lcg = (function () { + // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes + // m is basically chosen to be large (as it is the max period) + // and for its relationships to a and c + var m = 4294967296; + // a - 1 should be divisible by m's prime factors + var a = 1664525; + // c and m should be co-prime + var c = 1013904223; + var seed, z; + return { + setSeed: function setSeed(val) { + // pick a random seed if val is undefined or null + // the >>> 0 casts the seed to an unsigned 32-bit integer + z = seed = (val == null ? Math.random() * m : val) >>> 0; + }, + getSeed: function getSeed() { + return seed; + }, + rand: function rand() { + // define the recurrence relationship + z = (a * z + c) % m; + // return a float in [0, 1) + // if z = m then z / m = 0 therefore (z % m) / m < 1 always + return z / m; + }, + }; + })(); + lcg.setSeed(seed); + perlin = new Array(PERLIN_SIZE + 1); + for (var i = 0; i < PERLIN_SIZE + 1; i++) { + perlin[i] = lcg.rand(); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + }, + ], + 331: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.math.sign"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.number.is-finite"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.sub"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.math.sign"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.number.is-finite"); + _dereq_("core-js/modules/es.string.sub"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Math + * @submodule Vector + * @requires constants + */ + /// HELPERS FOR REMAINDER METHOD + + var calculateRemainder2D = function calculateRemainder2D( + xComponent, + yComponent, + ) { + if (xComponent !== 0) { + this.x = this.x % xComponent; + } + if (yComponent !== 0) { + this.y = this.y % yComponent; + } + return this; + }; + var calculateRemainder3D = function calculateRemainder3D( + xComponent, + yComponent, + zComponent, + ) { + if (xComponent !== 0) { + this.x = this.x % xComponent; + } + if (yComponent !== 0) { + this.y = this.y % yComponent; + } + if (zComponent !== 0) { + this.z = this.z % zComponent; + } + return this; + }; + /** + * A class to describe a two or three-dimensional vector. A vector is like an + * arrow pointing in space. Vectors have both magnitude (length) and + * direction. + * + * `p5.Vector` objects are often used to program motion because they simplify + * the math. For example, a moving ball has a position and a velocity. + * Position describes where the ball is in space. The ball's position vector + * extends from the origin to the ball's center. Velocity describes the ball's + * speed and the direction it's moving. If the ball is moving straight up, its + * velocity vector points straight up. Adding the ball's velocity vector to + * its position vector moves it, as in `pos.add(vel)`. Vector math relies on + * methods inside the `p5.Vector` class. + * + * @class p5.Vector + * @constructor + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @example + *
                    + * + * let p1 = createVector(25, 25); + * let p2 = createVector(75, 75); + * + * strokeWeight(5); + * point(p1); + * point(p2.x, p2.y); + * + * describe('Two black dots on a gray square, one at the top left and the other at the bottom right.'); + * + *
                    + * + *
                    + * + * let pos; + * let vel; + * + * function setup() { + * createCanvas(100, 100); + * pos = createVector(width / 2, height); + * vel = createVector(0, -1); + * } + * + * function draw() { + * background(200); + * + * pos.add(vel); + * + * if (pos.y < 0) { + * pos.y = height; + * } + * + * strokeWeight(5); + * point(pos); + * + * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); + * } + * + *
                    + */ + _main.default.Vector = /*#__PURE__*/ (function () { + // This is how it comes in with createVector() + // This check if the first argument is a function + function _class() { + _classCallCheck(this, _class); + var x, y, z; + if ( + typeof (arguments.length <= 0 ? undefined : arguments[0]) === + "function" + ) { + this.isPInst = true; + this._fromRadians = + arguments.length <= 0 ? undefined : arguments[0]; + this._toRadians = + arguments.length <= 1 ? undefined : arguments[1]; + x = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + y = (arguments.length <= 3 ? undefined : arguments[3]) || 0; + z = (arguments.length <= 4 ? undefined : arguments[4]) || 0; + // This is what we'll get with new p5.Vector() + } else { + x = (arguments.length <= 0 ? undefined : arguments[0]) || 0; + y = (arguments.length <= 1 ? undefined : arguments[1]) || 0; + z = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + } + + /** + * The x component of the vector + * @type {Number} + * @property x + * @name x + */ + + this.x = x; + /** + * The y component of the vector + * @type {Number} + * @property y + * @name y + */ + this.y = y; + /** + * The z component of the vector + * @type {Number} + * @property z + * @name z + */ + this.z = z; + } /** + * Returns a string representation of a vector. This method is useful for + * printing vectors to the console while debugging. + * @method toString + * @return {String} string representation of the vector. + * @example + *
                    + * + * function setup() { + * let v = createVector(20, 30); + * // Prints 'p5.Vector Object : [20, 30, 0]'. + * print(v.toString()); + * } + * + *
                    + */ + + _createClass( + _class, + [ + { + key: "toString", + value: function toString() { + return "p5.Vector Object : [" + .concat(this.x, ", ") + .concat(this.y, ", ") + .concat(this.z, "]"); + } /** + * Sets the `x`, `y`, and `z` components of the vector using separate numbers, + * a p5.Vector object, or an array of numbers. + * Calling `set()` with no arguments sets the vector's components to 0. + * + * @method set + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @chainable + * @example + *
                    + * + * strokeWeight(5); + * + * // Top left. + * let pos = createVector(25, 25); + * point(pos); + * + * // Top right. + * pos.set(75, 25); + * point(pos); + * + * // Bottom right. + * let p2 = createVector(75, 75); + * pos.set(p2); + * point(pos); + * + * // Bottom left. + * let arr = [25, 75]; + * pos.set(arr); + * point(pos); + * + * describe('Four black dots arranged in a square on a gray background.'); + * + *
                    + */, + /** + * @method set + * @param {p5.Vector|Number[]} value vector to set. + * @chainable + */ + }, + { + key: "set", + value: function set(x, y, z) { + if (x instanceof _main.default.Vector) { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + return this; + } + if (Array.isArray(x)) { + this.x = x[0] || 0; + this.y = x[1] || 0; + this.z = x[2] || 0; + return this; + } + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + return this; + } /** + * Returns a copy of the p5.Vector object. + * + * @method copy + * @return {p5.Vector} copy of the p5.Vector object. + * @example + *
                    + * + * let pos = createVector(50, 50); + * let pc = pos.copy(); + * + * strokeWeight(5); + * point(pc); + * + * describe('A black point drawn in the middle of a gray square.'); + * + *
                    + */, + }, + { + key: "copy", + value: function copy() { + if (this.isPInst) { + return new _main.default.Vector( + this._fromRadians, + this._toRadians, + this.x, + this.y, + this.z, + ); + } else { + return new _main.default.Vector(this.x, this.y, this.z); + } + } /** + * Adds to a vector's `x`, `y`, and `z` components using separate numbers, + * another p5.Vector object, or an array of numbers. + * Calling `add()` with no arguments has no effect. + * + * The static version of `add()`, as in `p5.Vector.add(v2, v1)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method add + * @param {Number} x x component of the vector to be added. + * @param {Number} [y] y component of the vector to be added. + * @param {Number} [z] z component of the vector to be added. + * @chainable + * @example + *
                    + * + * strokeWeight(5); + * + * // Top left. + * let pos = createVector(25, 25); + * point(pos); + * + * // Top right. + * pos.add(50, 0); + * point(pos); + * + * // Bottom right. + * let p2 = createVector(0, 50); + * pos.add(p2); + * point(pos); + * + * // Bottom left. + * let arr = [-50, 0]; + * pos.add(arr); + * point(pos); + * + * describe('Four black dots arranged in a square on a gray background.'); + * + *
                    + * + *
                    + * + * // Top left. + * let p1 = createVector(25, 25); + * + * // Center. + * let p2 = createVector(50, 50); + * + * // Bottom right. + * let p3 = p5.Vector.add(p1, p2); + * + * strokeWeight(5); + * point(p1); + * point(p2); + * point(p3); + * + * describe('Three black dots in a diagonal line from top left to bottom right.'); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = createVector(-30, 20); + * drawArrow(v1, v2, 'blue'); + * + * let v3 = p5.Vector.add(v1, v2); + * drawArrow(origin, v3, 'purple'); + * + * describe('Three arrows drawn on a gray square. A red arrow extends from the top left corner to the center. A blue arrow extends from the tip of the red arrow. A purple arrow extends from the origin to the tip of the blue arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + /** + * @method add + * @param {p5.Vector|Number[]} value The vector to add + * @chainable + */ + }, + { + key: "add", + value: function add(x, y, z) { + if (x instanceof _main.default.Vector) { + this.x += x.x || 0; + this.y += x.y || 0; + this.z += x.z || 0; + return this; + } + if (Array.isArray(x)) { + this.x += x[0] || 0; + this.y += x[1] || 0; + this.z += x[2] || 0; + return this; + } + this.x += x || 0; + this.y += y || 0; + this.z += z || 0; + return this; + } /** + * Performs modulo (remainder) division with a vector's `x`, `y`, and `z` + * components using separate numbers, another + * p5.Vector object, or an array of numbers. + * + * The static version of `rem()` as in `p5.Vector.rem(v2, v1)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method rem + * @param {Number} x x component of divisor vector. + * @param {Number} y y component of divisor vector. + * @param {Number} z z component of divisor vector. + * @chainable + * @example + *
                    + * + * let v = createVector(3, 4, 5); + * v.rem(2, 3, 4); + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v1 = createVector(3, 4, 5); + * let v2 = createVector(2, 3, 4); + * v1.rem(v2); + * + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * let v = createVector(3, 4, 5); + * let arr = [2, 3, 4]; + * v.rem(arr); + * + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v1 = createVector(3, 4, 5); + * let v2 = createVector(2, 3, 4); + * let v3 = p5.Vector.rem(v1, v2); + * + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v3.toString()); + * + *
                    + */, + /** + * @method rem + * @param {p5.Vector | Number[]} value divisor vector. + * @chainable + */ + }, + { + key: "rem", + value: function rem(x, y, z) { + if (x instanceof _main.default.Vector) { + if ([x.x, x.y, x.z].every(Number.isFinite)) { + var xComponent = parseFloat(x.x); + var yComponent = parseFloat(x.y); + var zComponent = parseFloat(x.z); + return calculateRemainder3D.call( + this, + xComponent, + yComponent, + zComponent, + ); + } + } else if (Array.isArray(x)) { + if ( + x.every(function (element) { + return Number.isFinite(element); + }) + ) { + if (x.length === 2) { + return calculateRemainder2D.call(this, x[0], x[1]); + } + if (x.length === 3) { + return calculateRemainder3D.call( + this, + x[0], + x[1], + x[2], + ); + } + } + } else if (arguments.length === 1) { + if (Number.isFinite(arguments[0]) && arguments[0] !== 0) { + this.x = this.x % arguments[0]; + this.y = this.y % arguments[0]; + this.z = this.z % arguments[0]; + return this; + } + } else if (arguments.length === 2) { + var vectorComponents = + Array.prototype.slice.call(arguments); + if ( + vectorComponents.every(function (element) { + return Number.isFinite(element); + }) + ) { + if (vectorComponents.length === 2) { + return calculateRemainder2D.call( + this, + vectorComponents[0], + vectorComponents[1], + ); + } + } + } else if (arguments.length === 3) { + var _vectorComponents = + Array.prototype.slice.call(arguments); + if ( + _vectorComponents.every(function (element) { + return Number.isFinite(element); + }) + ) { + if (_vectorComponents.length === 3) { + return calculateRemainder3D.call( + this, + _vectorComponents[0], + _vectorComponents[1], + _vectorComponents[2], + ); + } + } + } + } /** + * Subtracts from a vector's `x`, `y`, and `z` components using separate + * numbers, another p5.Vector object, or an array of + * numbers. Calling `sub()` with no arguments has no effect. + * + * The static version of `sub()`, as in `p5.Vector.sub(v2, v1)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method sub + * @param {Number} x x component of the vector to subtract. + * @param {Number} [y] y component of the vector to subtract. + * @param {Number} [z] z component of the vector to subtract. + * @chainable + * @example + *
                    + * + * strokeWeight(5); + * + * // Bottom right. + * let pos = createVector(75, 75); + * point(pos); + * + * // Top right. + * pos.sub(0, 50); + * point(pos); + * + * // Top left. + * let p2 = createVector(50, 0); + * pos.sub(p2); + * point(pos); + * + * // Bottom left. + * let arr = [0, -50]; + * pos.sub(arr); + * point(pos); + * + * describe('Four black dots arranged in a square on a gray background.'); + * + *
                    + * + *
                    + * + * // Bottom right. + * let p1 = createVector(75, 75); + * + * // Center. + * let p2 = createVector(50, 50); + * + * // Top left. + * let p3 = p5.Vector.sub(p1, p2); + * + * strokeWeight(5); + * point(p1); + * point(p2); + * point(p3); + * + * describe('Three black dots in a diagonal line from top left to bottom right.'); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = createVector(20, 70); + * drawArrow(origin, v2, 'blue'); + * + * let v3 = p5.Vector.sub(v2, v1); + * drawArrow(v1, v3, 'purple'); + * + * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + /** + * @method sub + * @param {p5.Vector|Number[]} value the vector to subtract + * @chainable + */ + }, + { + key: "sub", + value: function sub(x, y, z) { + if (x instanceof _main.default.Vector) { + this.x -= x.x || 0; + this.y -= x.y || 0; + this.z -= x.z || 0; + return this; + } + if (Array.isArray(x)) { + this.x -= x[0] || 0; + this.y -= x[1] || 0; + this.z -= x[2] || 0; + return this; + } + this.x -= x || 0; + this.y -= y || 0; + this.z -= z || 0; + return this; + } /** + * Multiplies a vector's `x`, `y`, and `z` components by the same number, + * separate numbers, the components of another + * p5.Vector object, or an array of numbers. Calling + * `mult()` with no arguments has no effect. + * + * The static version of `mult()`, as in `p5.Vector.mult(v, 2)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method mult + * @param {Number} n The number to multiply with the vector + * @chainable + * @example + *
                    + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * p.mult(2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * p.mult(2, 3); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * let arr = [2, 3]; + * p.mult(arr); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * let p2 = createVector(2, 3); + * p.mult(p2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * let p2 = createVector(2, 3); + * let p3 = p5.Vector.mult(p, p2); + * point(p3); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(25, 25); + * drawArrow(origin, v1, 'red'); + * + * let v2 = p5.Vector.mult(v1, 2); + * drawArrow(origin, v2, 'blue'); + * + * describe('Two arrows extending from the top left corner. The blue arrow is twice the length of the red arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + /** + * @method mult + * @param {Number} x number to multiply with the x component of the vector. + * @param {Number} y number to multiply with the y component of the vector. + * @param {Number} [z] number to multiply with the z component of the vector. + * @chainable + */ + /** + * @method mult + * @param {Number[]} arr array to multiply with the components of the vector. + * @chainable + */ + /** + * @method mult + * @param {p5.Vector} v vector to multiply with the components of the original vector. + * @chainable + */ + }, + { + key: "mult", + value: function mult(x, y, z) { + if (x instanceof _main.default.Vector) { + // new p5.Vector will check that values are valid upon construction but it's possible + // that someone could change the value of a component after creation, which is why we still + // perform this check + if ( + Number.isFinite(x.x) && + Number.isFinite(x.y) && + Number.isFinite(x.z) && + typeof x.x === "number" && + typeof x.y === "number" && + typeof x.z === "number" + ) { + this.x *= x.x; + this.y *= x.y; + this.z *= x.z; + } else { + console.warn( + "p5.Vector.prototype.mult:", + "x contains components that are either undefined or not finite numbers", + ); + } + return this; + } + if (Array.isArray(x)) { + if ( + x.every(function (element) { + return Number.isFinite(element); + }) && + x.every(function (element) { + return typeof element === "number"; + }) + ) { + if (x.length === 1) { + this.x *= x[0]; + this.y *= x[0]; + this.z *= x[0]; + } else if (x.length === 2) { + this.x *= x[0]; + this.y *= x[1]; + } else if (x.length === 3) { + this.x *= x[0]; + this.y *= x[1]; + this.z *= x[2]; + } + } else { + console.warn( + "p5.Vector.prototype.mult:", + "x contains elements that are either undefined or not finite numbers", + ); + } + return this; + } + var vectorComponents = + Array.prototype.slice.call(arguments); + if ( + vectorComponents.every(function (element) { + return Number.isFinite(element); + }) && + vectorComponents.every(function (element) { + return typeof element === "number"; + }) + ) { + if (arguments.length === 1) { + this.x *= x; + this.y *= x; + this.z *= x; + } + if (arguments.length === 2) { + this.x *= x; + this.y *= y; + } + if (arguments.length === 3) { + this.x *= x; + this.y *= y; + this.z *= z; + } + } else { + console.warn( + "p5.Vector.prototype.mult:", + "x, y, or z arguments are either undefined or not a finite number", + ); + } + return this; + } /** + * Divides a vector's `x`, `y`, and `z` components by the same number, + * separate numbers, the components of another + * p5.Vector object, or an array of numbers. Calling + * `div()` with no arguments has no effect. + * + * The static version of `div()`, as in `p5.Vector.div(v, 2)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method div + * @param {number} n The number to divide the vector by + * @chainable + * @example + *
                    + * + * strokeWeight(5); + * + * let p = createVector(50, 50); + * point(p); + * + * p.div(2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * p.div(2, 3); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * let arr = [2, 3]; + * p.div(arr); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * let p2 = createVector(2, 3); + * p.div(p2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * let p2 = createVector(2, 3); + * let p3 = p5.Vector.div(p, p2); + * point(p3); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = p5.Vector.div(v1, 2); + * drawArrow(origin, v2, 'blue'); + * + * describe('Two arrows extending from the top left corner. The blue arrow is half the length of the red arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + /** + * @method div + * @param {Number} x number to divide with the x component of the vector. + * @param {Number} y number to divide with the y component of the vector. + * @param {Number} [z] number to divide with the z component of the vector. + * @chainable + */ + /** + * @method div + * @param {Number[]} arr array to divide the components of the vector by. + * @chainable + */ + /** + * @method div + * @param {p5.Vector} v vector to divide the components of the original vector by. + * @chainable + */ + }, + { + key: "div", + value: function div(x, y, z) { + if (x instanceof _main.default.Vector) { + // new p5.Vector will check that values are valid upon construction but it's possible + // that someone could change the value of a component after creation, which is why we still + // perform this check + if ( + Number.isFinite(x.x) && + Number.isFinite(x.y) && + Number.isFinite(x.z) && + typeof x.x === "number" && + typeof x.y === "number" && + typeof x.z === "number" + ) { + var isLikely2D = x.z === 0 && this.z === 0; + if ( + x.x === 0 || + x.y === 0 || + (!isLikely2D && x.z === 0) + ) { + console.warn( + "p5.Vector.prototype.div:", + "divide by 0", + ); + return this; + } + this.x /= x.x; + this.y /= x.y; + if (!isLikely2D) { + this.z /= x.z; + } + } else { + console.warn( + "p5.Vector.prototype.div:", + "x contains components that are either undefined or not finite numbers", + ); + } + return this; + } + if (Array.isArray(x)) { + if ( + x.every(function (element) { + return Number.isFinite(element); + }) && + x.every(function (element) { + return typeof element === "number"; + }) + ) { + if ( + x.some(function (element) { + return element === 0; + }) + ) { + console.warn( + "p5.Vector.prototype.div:", + "divide by 0", + ); + return this; + } + if (x.length === 1) { + this.x /= x[0]; + this.y /= x[0]; + this.z /= x[0]; + } else if (x.length === 2) { + this.x /= x[0]; + this.y /= x[1]; + } else if (x.length === 3) { + this.x /= x[0]; + this.y /= x[1]; + this.z /= x[2]; + } + } else { + console.warn( + "p5.Vector.prototype.div:", + "x contains components that are either undefined or not finite numbers", + ); + } + return this; + } + var vectorComponents = + Array.prototype.slice.call(arguments); + if ( + vectorComponents.every(function (element) { + return Number.isFinite(element); + }) && + vectorComponents.every(function (element) { + return typeof element === "number"; + }) + ) { + if ( + vectorComponents.some(function (element) { + return element === 0; + }) + ) { + console.warn("p5.Vector.prototype.div:", "divide by 0"); + return this; + } + if (arguments.length === 1) { + this.x /= x; + this.y /= x; + this.z /= x; + } + if (arguments.length === 2) { + this.x /= x; + this.y /= y; + } + if (arguments.length === 3) { + this.x /= x; + this.y /= y; + this.z /= z; + } + } else { + console.warn( + "p5.Vector.prototype.div:", + "x, y, or z arguments are either undefined or not a finite number", + ); + } + return this; + } /** + * Returns the magnitude (length) of the vector. + * + * @method mag + * @return {Number} magnitude of the vector. + * @example + *
                    + * + * let p = createVector(30, 40); + * line(0, 0, p.x, p.y); + * + * let m = p.mag(); + * text(m, p.x, p.y); + * + * describe('A diagonal black line extends from the top left corner of a gray square. The number 50 is written at the end of the line.'); + * + *
                    + */, + }, + { + key: "mag", + value: function mag() { + return Math.sqrt(this.magSq()); + } /** + * Returns the magnitude (length) of the vector squared. + * + * @method magSq + * @return {number} squared magnitude of the vector. + * @example + *
                    + * + * let p = createVector(30, 40); + * line(0, 0, p.x, p.y); + * + * let m = p.magSq(); + * text(m, p.x, p.y); + * + * describe('A diagonal black line extends from the top left corner of a gray square. The number 2500 is written at the end of the line.'); + * + *
                    + */, + }, + { + key: "magSq", + value: function magSq() { + var x = this.x; + var y = this.y; + var z = this.z; + return x * x + y * y + z * z; + } /** + * Returns the dot product of two vectors. The dot product is a number that + * describes the overlap between two vectors. Visually, the dot product can be + * thought of as the "shadow" one vector casts on another. The dot product's + * magnitude is largest when two vectors point in the same or opposite + * directions. Its magnitude is 0 when two vectors form a right angle. + * + * The version of `dot()` with one parameter interprets it as another + * p5.Vector object. + * + * The version of `dot()` with multiple parameters interprets them as the + * `x`, `y`, and `z` components of another vector. + * + * The static version of `dot()`, as in `p5.Vector.dot(v1, v2)`, is the same + * as calling `v1.dot(v2)`. + * + * @method dot + * @param {Number} x x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @return {Number} dot product. + * + * @example + *
                    + * + * let v1 = createVector(3, 4); + * let v2 = createVector(3, 0); + * let dp = v1.dot(v2); + * // Prints "9" to the console. + * print(dp); + * + *
                    + * + *
                    + * + * let v1 = createVector(1, 0); + * let v2 = createVector(0, 1); + * let dp = p5.Vector.dot(v1, v2); + * // Prints "0" to the console. + * print(dp); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let v0 = createVector(width / 2, height / 2); + * let v1 = createVector(30, 0); + * drawArrow(v0, v1, 'black'); + * + * let v2 = createVector(mouseX - width / 2, mouseY - height / 2); + * drawArrow(v0, v2, 'red'); + * + * let dp = v2.dot(v1); + * text(`v2 • v1 = ${dp}`, 15, 20); + * + * describe('Two arrows drawn on a gray square. A black arrow points to the right and a red arrow follows the mouse. The text "v1 • v2 = something" changes as the mouse moves.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + /** + * @method dot + * @param {p5.Vector} v p5.Vector to be dotted. + * @return {Number} + */ + }, + { + key: "dot", + value: function dot(x, y, z) { + if (x instanceof _main.default.Vector) { + return this.dot(x.x, x.y, x.z); + } + return ( + this.x * (x || 0) + this.y * (y || 0) + this.z * (z || 0) + ); + } /** + * Returns the cross product of two vectors. The cross product is a vector + * that points straight out of the plane created by two vectors. The cross + * product's magnitude is the area of the parallelogram formed by the original + * two vectors. + * + * The static version of `cross()`, as in `p5.Vector.cross(v1, v2)`, is the same + * as calling `v1.cross(v2)`. + * + * @method cross + * @param {p5.Vector} v p5.Vector to be crossed. + * @return {p5.Vector} cross product as a p5.Vector. + * @example + *
                    + * + * let v1 = createVector(1, 0); + * let v2 = createVector(3, 4); + * let cp = v1.cross(v2); + * // Prints "p5.Vector Object : [0, 0, 4]" to the console. + * print(cp.toString()); + * + *
                    + * + *
                    + * + * let v1 = createVector(1, 0); + * let v2 = createVector(3, 4); + * let cp = p5.Vector.cross(v1, v2); + * // Prints "p5.Vector Object : [0, 0, 4]" to the console. + * print(cp.toString()); + * + *
                    + */, + }, + { + key: "cross", + value: function cross(v) { + var x = this.y * v.z - this.z * v.y; + var y = this.z * v.x - this.x * v.z; + var z = this.x * v.y - this.y * v.x; + if (this.isPInst) { + return new _main.default.Vector( + this._fromRadians, + this._toRadians, + x, + y, + z, + ); + } else { + return new _main.default.Vector(x, y, z); + } + } /** + * Returns the distance between two points represented by vectors. A point's + * coordinates can be thought of as a vector's components. + * + * The static version of `dist()`, as in `p5.Vector.dist(v1, v2)`, is the same + * as calling `v1.dist(v2)`. + * + * Use dist() to calculate the distance between points + * using coordinates as in `dist(x1, y1, x2, y2)`. + * + * @method dist + * @param {p5.Vector} v x, y, and z coordinates of a p5.Vector. + * @return {Number} distance. + * @example + *
                    + * + * let v1 = createVector(1, 0); + * let v2 = createVector(0, 1); + * let d = v1.dist(v2); + * // Prints "1.414..." to the console. + * print(d); + * + *
                    + * + *
                    + * + * let v1 = createVector(1, 0); + * let v2 = createVector(0, 1); + * let d = p5.Vector.dist(v1, v2); + * // Prints "1.414..." to the console. + * print(d); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = createVector(20, 70); + * drawArrow(origin, v2, 'blue'); + * + * let v3 = p5.Vector.sub(v2, v1); + * drawArrow(v1, v3, 'purple'); + * + * let m = floor(v3.mag()); + * text(m, 50, 75); + * + * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow. The number 36 is written in black near the purple arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "dist", + value: function dist(v) { + return v.copy().sub(this).mag(); + } /** + * Scales the components of a p5.Vector object so + * that its magnitude is 1. + * + * The static version of `normalize()`, as in `p5.Vector.normalize(v)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method normalize + * @return {p5.Vector} normalized p5.Vector. + * @example + *
                    + * + * let v = createVector(10, 20, 2); + * v.normalize(); + * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v0 = createVector(10, 20, 2); + * let v1 = p5.Vector.normalize(v0); + * // Prints "p5.Vector Object : [10, 20, 2]" to the console. + * print(v0.toString()); + * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(240); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(mouseX - 50, mouseY - 50); + * + * let r = 25; + * drawArrow(v0, v1, 'red'); + * v1.normalize(); + * drawArrow(v0, v1.mult(r), 'blue'); + * + * noFill(); + * circle(50, 50, r * 2); + * + * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow's length is fixed to the circle's radius."); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "normalize", + value: function normalize() { + var len = this.mag(); + // here we multiply by the reciprocal instead of calling 'div()' + // since div duplicates this zero check. + if (len !== 0) this.mult(1 / len); + return this; + } /** + * Limits a vector's magnitude to a maximum value. + * + * The static version of `limit()`, as in `p5.Vector.limit(v, 5)`, returns a + * new p5.Vector object and doesn't change the + * original. + * + * @method limit + * @param {Number} max maximum magnitude for the vector. + * @chainable + * @example + *
                    + * + * let v = createVector(10, 20, 2); + * v.limit(5); + * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v0 = createVector(10, 20, 2); + * let v1 = p5.Vector.limit(v0, 5); + * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(240); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(mouseX - 50, mouseY - 50); + * + * let r = 25; + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v1.limit(r), 'blue'); + * + * noFill(); + * circle(50, 50, r * 2); + * + * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow never crosses the circle's edge."); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "limit", + value: function limit(max) { + var mSq = this.magSq(); + if (mSq > max * max) { + this.div(Math.sqrt(mSq)) //normalize it + .mult(max); + } + return this; + } /** + * Sets a vector's magnitude to a given value. + * + * The static version of `setMag()`, as in `p5.Vector.setMag(v, 10)`, returns + * a new p5.Vector object and doesn't change the + * original. + * + * @method setMag + * @param {number} len new length for this vector. + * @chainable + * @example + *
                    + * + * let v = createVector(3, 4, 0); + * // Prints "5" to the console. + * print(v.mag()); + * + * v.setMag(10); + * // Prints "p5.Vector Object : [6, 8, 0]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v0 = createVector(3, 4, 0); + * let v1 = p5.Vector.setMag(v0, 10); + * // Prints "5" to the console. + * print(v0.mag()); + * // Prints "p5.Vector Object : [6, 8, 0]" to the console. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(240); + * + * let origin = createVector(0, 0); + * let v = createVector(50, 50); + * + * drawArrow(origin, v, 'red'); + * + * v.setMag(30); + * drawArrow(origin, v, 'blue'); + * + * describe('Two arrows extend from the top left corner of a square toward its center. The red arrow reaches the center and the blue arrow only extends part of the way.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "setMag", + value: function setMag(n) { + return this.normalize().mult(n); + } /** + * Calculates the angle a 2D vector makes with the positive x-axis. Angles + * increase in the clockwise direction. + * + * If the vector was created with + * createVector(), `heading()` returns angles + * in the units of the current angleMode(). + * + * The static version of `heading()`, as in `p5.Vector.heading(v)`, works the + * same way. + * + * @method heading + * @return {Number} angle of rotation. + * @example + *
                    + * + * let v = createVector(1, 1); + * // Prints "0.785..." to the console. + * print(v.heading()); + * + * angleMode(DEGREES); + * // Prints "45" to the console. + * print(v.heading()); + * + *
                    + * + *
                    + * + * let v = createVector(1, 1); + * // Prints "0.785..." to the console. + * print(p5.Vector.heading(v)); + * + * angleMode(DEGREES); + * // Prints "45" to the console. + * print(p5.Vector.heading(v)); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v = createVector(50, 50); + * + * drawArrow(origin, v, 'black'); + * + * angleMode(RADIANS); + * let h = round(v.heading(), 2); + * text(`Radians: ${h}`, 20, 70); + * angleMode(DEGREES); + * h = v.heading(); + * text(`Degrees: ${h}`, 20, 85); + * + * describe('A black arrow extends from the top left of a square to its center. The text "Radians: 0.79" and "Degrees: 45" is written near the tip of the arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "heading", + value: function heading() { + var h = Math.atan2(this.y, this.x); + if (this.isPInst) return this._fromRadians(h); + return h; + } /** + * Rotates a 2D vector to a specific angle without changing its magnitude. + * By convention, the positive x-axis has an angle of 0. Angles increase in + * the clockwise direction. + * + * If the vector was created with + * createVector(), `setHeading()` uses + * the units of the current angleMode(). + * + * @method setHeading + * @param {number} angle angle of rotation. + * @chainable + * @example + *
                    + * + * let v = createVector(0, 1); + * // Prints "1.570..." to the console. + * print(v.heading()); + * + * v.setHeading(PI); + * // Prints "3.141..." to the console. + * print(v.heading()); + * + *
                    + * + *
                    + * + * angleMode(DEGREES); + * let v = createVector(0, 1); + * // Prints "90" to the console. + * print(v.heading()); + * + * v.setHeading(180); + * // Prints "180" to the console. + * print(v.heading()); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 0); + * + * drawArrow(v0, v1, 'red'); + * + * v1.setHeading(HALF_PI); + * drawArrow(v0, v1, 'blue'); + * + * describe('Two arrows extend from the center of a gray square. The red arrow points to the right and the blue arrow points down.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "setHeading", + value: function setHeading(a) { + if (this.isPInst) a = this._toRadians(a); + var m = this.mag(); + this.x = m * Math.cos(a); + this.y = m * Math.sin(a); + return this; + } /** + * Rotates a 2D vector by an angle without changing its magnitude. + * By convention, the positive x-axis has an angle of 0. Angles increase in + * the clockwise direction. + * + * If the vector was created with + * createVector(), `rotate()` uses + * the units of the current angleMode(). + * + * The static version of `rotate()`, as in `p5.Vector.rotate(v, PI)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method rotate + * @param {number} angle angle of rotation. + * @chainable + * @example + *
                    + * + * let v = createVector(1, 0); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v.toString()); + * v.rotate(HALF_PI); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * angleMode(DEGREES); + * let v = createVector(1, 0); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v.toString()); + * v.rotate(90); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v0 = createVector(1, 0); + * let v1 = p5.Vector.rotate(v0, HALF_PI); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v0.toString()); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * angleMode(DEGREES); + * let v0 = createVector(1, 0); + * let v1 = p5.Vector.rotate(v0, 90); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v0.toString()); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * let v0; + * let v1; + * + * function setup() { + * v0 = createVector(50, 50); + * v1 = createVector(30, 0); + * } + * + * function draw() { + * background(240); + * + * v1.rotate(0.01); + * + * drawArrow(v0, v1, 'black'); + * + * describe('A black arrow extends from the center of a gray square. The arrow rotates counterclockwise.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "rotate", + value: function rotate(a) { + var newHeading = this.heading() + a; + if (this.isPInst) newHeading = this._toRadians(newHeading); + var mag = this.mag(); + this.x = Math.cos(newHeading) * mag; + this.y = Math.sin(newHeading) * mag; + return this; + } /** + * Returns the angle between two vectors. The angles returned are signed, + * which means that `v1.angleBetween(v2) === -v2.angleBetween(v1)`. + * + * If the vector was created with + * createVector(), `angleBetween()` returns + * angles in the units of the current + * angleMode(). + * + * @method angleBetween + * @param {p5.Vector} value x, y, and z components of a p5.Vector. + * @return {Number} angle between the vectors. + * @example + *
                    + * + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "1.570..." to the console. + * print(v0.angleBetween(v1)); + * // Prints "-1.570..." to the console. + * print(v1.angleBetween(v0)); + * + *
                    + * + *
                    + * + * angleMode(DEGREES); + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "90" to the console. + * print(v0.angleBetween(v1)); + * // Prints "-90" to the console. + * print(v1.angleBetween(v0)); + * + *
                    + * + *
                    + * + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "1.570..." to the console. + * print(p5.Vector.angleBetween(v0, v1)); + * // Prints "-1.570..." to the console. + * print(p5.Vector.angleBetween(v1, v0)); + * + *
                    + * + *
                    + * + * angleMode(DEGREES); + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "90" to the console. + * print(p5.Vector.angleBetween(v0, v1)); + * // Prints "-90" to the console. + * print(p5.Vector.angleBetween(v1, v0)); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 0); + * let v2 = createVector(0, 30); + * + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * + * angleMode(RADIANS); + * let angle = round(v1.angleBetween(v2), 2); + * text(`Radians: ${angle}`, 20, 20); + * angleMode(DEGREES); + * angle = round(v1.angleBetween(v2), 2); + * text(`Degrees: ${angle}`, 20, 35); + * + * describe('Two arrows extend from the center of a gray square. A red arrow points to the right and a blue arrow points down. The text "Radians: 1.57" and "Degrees: 90" is written above the arrows.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "angleBetween", + value: function angleBetween(v) { + var magSqMult = this.magSq() * v.magSq(); + // Returns NaN if either vector is the zero vector. + if (magSqMult === 0) { + return NaN; + } + var u = this.cross(v); + // The dot product computes the cos value, and the cross product computes + // the sin value. Find the angle based on them. In addition, in the case of + // 2D vectors, a sign is added according to the direction of the vector. + var angle = + Math.atan2(u.mag(), this.dot(v)) * Math.sign(u.z || 1); + if (this.isPInst) { + angle = this._fromRadians(angle); + } + return angle; + } /** + * Calculates new `x`, `y`, and `z` components that are proportionally the + * same distance between two vectors. The `amt` parameter is the amount to + * interpolate between the old vector and the new vector. 0.0 keeps all + * components equal to the old vector's, 0.5 is halfway between, and 1.0 sets + * all components equal to the new vector's. + * + * The static version of `lerp()`, as in `p5.Vector.lerp(v0, v1, 0.5)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method lerp + * @param {Number} x x component. + * @param {Number} y y component. + * @param {Number} z z component. + * @param {Number} amt amount of interpolation between 0.0 (old vector) + * and 1.0 (new vector). 0.5 is halfway between. + * @chainable + * + * @example + *
                    + * + * let v0 = createVector(1, 1, 1); + * let v1 = createVector(3, 3, 3); + * v0.lerp(v1, 0.5); + * // Prints "p5.Vector Object : [2, 2, 2]" to the console. + * print(v0.toString()); + * + *
                    + * + *
                    + * + * let v = createVector(1, 1, 1); + * v.lerp(3, 3, 3, 0.5); + * // Prints "p5.Vector Object : [2, 2, 2]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let v0 = createVector(1, 1, 1); + * let v1 = createVector(3, 3, 3); + * let v2 = p5.Vector.lerp(v0, v1, 0.5); + * // Prints "p5.Vector Object : [2, 2, 2]" to the console. + * print(v2.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 0); + * let v2 = createVector(0, 30); + * let v3 = p5.Vector.lerp(v1, v2, 0.5); + * + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * drawArrow(v0, v3, 'purple'); + * + * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points down, and a purple arrow points to the bottom right.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + /** + * @method lerp + * @param {p5.Vector} v p5.Vector to lerp toward. + * @param {Number} amt + * @chainable + */ + }, + { + key: "lerp", + value: function lerp(x, y, z, amt) { + if (x instanceof _main.default.Vector) { + return this.lerp(x.x, x.y, x.z, y); + } + this.x += (x - this.x) * amt || 0; + this.y += (y - this.y) * amt || 0; + this.z += (z - this.z) * amt || 0; + return this; + } /** + * Calculates a new heading and magnitude that are between two vectors. The + * `amt` parameter is the amount to interpolate between the old vector and + * the new vector. 0.0 keeps the heading and magnitude equal to the old + * vector's, 0.5 sets them halfway between, and 1.0 sets the heading and + * magnitude equal to the new vector's. + * + * `slerp()` differs from lerp() because + * it interpolates magnitude. Calling `v0.slerp(v1, 0.5)` sets `v0`'s + * magnitude to a value halfway between its original magnitude and `v1`'s. + * Calling `v0.lerp(v1, 0.5)` makes no such guarantee. + * + * The static version of `slerp()`, as in `p5.Vector.slerp(v0, v1, 0.5)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method slerp + * @param {p5.Vector} v p5.Vector to slerp toward. + * @param {Number} amt amount of interpolation between 0.0 (old vector) + * and 1.0 (new vector). 0.5 is halfway between. + * @return {p5.Vector} + * + * @example + *
                    + * + * let v0 = createVector(3, 0); + * // Prints "3" to the console. + * print(v0.mag()); + * // Prints "0" to the console. + * print(v0.heading()); + * + * let v1 = createVector(0, 1); + * // Prints "1" to the console. + * print(v1.mag()); + * // Prints "1.570..." to the console. + * print(v1.heading()); + * + * v0.slerp(v1, 0.5); + * // Prints "2" to the console. + * print(v0.mag()); + * // Prints "0.785..." to the console. + * print(v0.heading()); + * + *
                    + * + *
                    + * + * let v0 = createVector(3, 0); + * // Prints "3" to the console. + * print(v0.mag()); + * // Prints "0" to the console. + * print(v0.heading()); + * + * let v1 = createVector(0, 1); + * // Prints "1" to the console. + * print(v1.mag()); + * // Prints "1.570..." to the console. + * print(v1.heading()); + * + * let v3 = p5.Vector.slerp(v0, v1, 0.5); + * // Prints "2" to the console. + * print(v3.mag()); + * // Prints "0.785..." to the console. + * print(v3.heading()); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(20, 0); + * let v2 = createVector(-40, 0); + * let v3 = p5.Vector.slerp(v1, v2, 0.5); + * + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * drawArrow(v0, v3, 'purple'); + * + * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points to the left, and a purple arrow points down.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "slerp", + value: function slerp(v, amt) { + // edge cases. + if (amt === 0) { + return this; + } + if (amt === 1) { + return this.set(v); + } // calculate magnitudes + + var selfMag = this.mag(); + var vMag = v.mag(); + var magmag = selfMag * vMag; + // if either is a zero vector, linearly interpolate by these vectors + if (magmag === 0) { + this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); + return this; + } // the cross product of 'this' and 'v' is the axis of rotation + + var axis = this.cross(v); + var axisMag = axis.mag(); + // Calculates the angle between 'this' and 'v' + var theta = Math.atan2(axisMag, this.dot(v)); + // However, if the norm of axis is 0, normalization cannot be performed, + // so we will divide the cases + if (axisMag > 0) { + axis.x /= axisMag; + axis.y /= axisMag; + axis.z /= axisMag; + } else if (theta < Math.PI * 0.5) { + // if the norm is 0 and the angle is less than PI/2, + // the angle is very close to 0, so do linear interpolation. + this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); + return this; + } else { + // If the norm is 0 and the angle is more than PI/2, the angle is + // very close to PI. + // In this case v can be regarded as '-this', so take any vector + // that is orthogonal to 'this' and use that as the axis. + if (this.z === 0 && v.z === 0) { + // if both this and v are 2D vectors, use (0,0,1) + // this makes the result also a 2D vector. + axis.set(0, 0, 1); + } else if (this.x !== 0) { + // if the x components is not 0, use (y, -x, 0) + axis.set(this.y, -this.x, 0).normalize(); + } else { + // if the x components is 0, use (1,0,0) + axis.set(1, 0, 0); + } + } // Since 'axis' is a unit vector, ey is a vector of the same length as 'this'. + + var ey = axis.cross(this); + // interpolate the length with 'this' and 'v'. + var lerpedMagFactor = 1 - amt + (amt * vMag) / selfMag; + // imagine a situation where 'axis', 'this', and 'ey' are pointing + // along the z, x, and y axes, respectively. + // rotates 'this' around 'axis' by amt * theta towards 'ey'. + var cosMultiplier = lerpedMagFactor * Math.cos(amt * theta); + var sinMultiplier = lerpedMagFactor * Math.sin(amt * theta); + // then, calculate 'result'. + this.x = this.x * cosMultiplier + ey.x * sinMultiplier; + this.y = this.y * cosMultiplier + ey.y * sinMultiplier; + this.z = this.z * cosMultiplier + ey.z * sinMultiplier; + return this; + } /** + * Reflects a vector about a line in 2D or a plane in 3D. The orientation of + * the line or plane is described by a normal vector that points away from the + * shape. + * + * The static version of `reflect()`, as in `p5.Vector.reflect(v, n)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method reflect + * @param {p5.Vector} surfaceNormal p5.Vector + * to reflect about. + * @chainable + * @example + *
                    + * + * let n = createVector(0, 1); + * let v = createVector(4, 6); + * v.reflect(n); + * // Prints "p5.Vector Object : [4, -6, 0]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * let n = createVector(0, 1); + * let v0 = createVector(4, 6); + * let v1 = p5.Vector.reflect(v0, n); + * // Prints "p5.Vector Object : [4, -6, 0]" to the console. + * print(v1.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * line(50, 0, 50, 100); + * let n = createVector(1, 0); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 40); + * let v2 = p5.Vector.reflect(v1, n); + * + * n.setMag(30); + * drawArrow(v0, n, 'black'); + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * + * describe('Three arrows extend from the center of a gray square with a vertical line down its middle. A black arrow points to the right, a blue arrow points to the bottom left, and a red arrow points to the bottom right.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "reflect", + value: function reflect(surfaceNormal) { + surfaceNormal.normalize(); + return this.sub( + surfaceNormal.mult(2 * this.dot(surfaceNormal)), + ); + } /** + * Returns the vector's components as an array of numbers. + * + * @method array + * @return {Number[]} array with the vector's components. + * @example + *
                    + * + * let v = createVector(20, 30); + * // Prints "[20, 30, 0]" to the console. + * print(v.array()); + * + *
                    + */, + }, + { + key: "array", + value: function array() { + return [this.x || 0, this.y || 0, this.z || 0]; + } /** + * Returns `true` if the vector's components are all the same as another + * vector's and `false` if not. + * + * The version of `equals()` with one parameter interprets it as another + * p5.Vector object. + * + * The version of `equals()` with multiple parameters interprets them as the + * components of another vector. Any missing parameters are assigned the value + * 0. + * + * The static version of `equals()`, as in `p5.Vector.equals(v0, v1)`, + * interprets both parameters as p5.Vector objects. + * + * @method equals + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @return {Boolean} whether the vectors are equal. + * @example + *
                    + * + * let v0 = createVector(10, 20, 30); + * let v1 = createVector(10, 20, 30); + * let v2 = createVector(0, 0, 0); + * + * // Prints "true" to the console. + * print(v0.equals(v1)); + * // Prints "false" to the console. + * print(v0.equals(v2)); + * + *
                    + * + *
                    + * + * let v0 = createVector(5, 10, 20); + * let v1 = createVector(5, 10, 20); + * let v2 = createVector(13, 10, 19); + * + * // Prints "true" to the console. + * print(v0.equals(v1.x, v1.y, v1.z)); + * // Prints "false" to the console. + * print(v0.equals(v2.x, v2.y, v2.z)); + * + *
                    + * + *
                    + * + * let v0 = createVector(10, 20, 30); + * let v1 = createVector(10, 20, 30); + * let v2 = createVector(0, 0, 0); + * + * // Prints "true" to the console. + * print(p5.Vector.equals(v0, v1)); + * // Prints "false" to the console. + * print(p5.Vector.equals(v0, v2)); + * + *
                    + */, + /** + * @method equals + * @param {p5.Vector|Array} value vector to compare. + * @return {Boolean} + */ + }, + { + key: "equals", + value: function equals(x, y, z) { + var a, b, c; + if (x instanceof _main.default.Vector) { + a = x.x || 0; + b = x.y || 0; + c = x.z || 0; + } else if (Array.isArray(x)) { + a = x[0] || 0; + b = x[1] || 0; + c = x[2] || 0; + } else { + a = x || 0; + b = y || 0; + c = z || 0; + } + return this.x === a && this.y === b && this.z === c; + }, // Static Methods + /** + * Make a new 2D vector from an angle. + * + * @method fromAngle + * @static + * @param {Number} angle desired angle, in radians. Unaffected by angleMode(). + * @param {Number} [length] length of the new vector (defaults to 1). + * @return {p5.Vector} new p5.Vector object. + * @example + *
                    + * + * let v = p5.Vector.fromAngle(0); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = p5.Vector.fromAngle(0, 30); + * + * drawArrow(v0, v1, 'black'); + * + * describe('A black arrow extends from the center of a gray square. It points to the right.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */ + }, + ], + [ + { + key: "fromAngle", + value: function fromAngle(angle, length) { + if (typeof length === "undefined") { + length = 1; + } + return new _main.default.Vector( + length * Math.cos(angle), + length * Math.sin(angle), + 0, + ); + } /** + * Make a new 3D vector from a pair of ISO spherical angles. + * + * @method fromAngles + * @static + * @param {Number} theta polar angle in radians (zero is up). + * @param {Number} phi azimuthal angle in radians + * (zero is out of the screen). + * @param {Number} [length] length of the new vector (defaults to 1). + * @return {p5.Vector} new p5.Vector object. + * @example + *
                    + * + * let v = p5.Vector.fromAngles(0, 0); + * // Prints "p5.Vector Object : [0, -1, 0]" to the console. + * print(v.toString()); + * + *
                    + * + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(0); + * + * fill(255); + * noStroke(); + * + * let theta = frameCount * 0.05; + * let phi = 0; + * let v = p5.Vector.fromAngles(theta, phi, 100); + * let c = color('deeppink'); + * pointLight(c, v); + * + * sphere(35); + * + * describe('A light shines on a pink sphere as it orbits.'); + * } + * + *
                    + */, + }, + { + key: "fromAngles", + value: function fromAngles(theta, phi, length) { + if (typeof length === "undefined") { + length = 1; + } + var cosPhi = Math.cos(phi); + var sinPhi = Math.sin(phi); + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + return new _main.default.Vector( + length * sinTheta * sinPhi, + -length * cosTheta, + length * sinTheta * cosPhi, + ); + } /** + * Make a new 2D unit vector with a random heading. + * + * @method random2D + * @static + * @return {p5.Vector} new p5.Vector object. + * @example + *
                    + * + * let v = p5.Vector.random2D(); + * // Prints "p5.Vector Object : [x, y, 0]" to the console + * // where x and y are small random numbers. + * print(v.toString()); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * frameRate(1); + * + * let v0 = createVector(50, 50); + * let v1 = p5.Vector.random2D(); + * v1.mult(30); + * drawArrow(v0, v1, 'black'); + * + * describe('A black arrow in extends from the center of a gray square. It changes direction once per second.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                    + */, + }, + { + key: "random2D", + value: function random2D() { + return this.fromAngle(Math.random() * constants.TWO_PI); + } /** + * Make a new 3D unit vector with a random heading. + * + * @method random3D + * @static + * @return {p5.Vector} new p5.Vector object. + * @example + *
                    + * + * let v = p5.Vector.random3D(); + * // Prints "p5.Vector Object : [x, y, z]" to the console + * // where x, y, and z are small random numbers. + * print(v.toString()); + * + *
                    + */, + }, + { + key: "random3D", + value: function random3D() { + var angle = Math.random() * constants.TWO_PI; + var vz = Math.random() * 2 - 1; + var vzBase = Math.sqrt(1 - vz * vz); + var vx = vzBase * Math.cos(angle); + var vy = vzBase * Math.sin(angle); + return new _main.default.Vector(vx, vy, vz); + }, // Returns a copy of a vector. + /** + * @method copy + * @static + * @param {p5.Vector} v the p5.Vector to create a copy of + * @return {p5.Vector} the copy of the p5.Vector object + */ + }, + { + key: "copy", + value: function copy(v) { + return v.copy(v); + }, // Adds two vectors together and returns a new one. + /** + * @method add + * @static + * @param {p5.Vector} v1 A p5.Vector to add + * @param {p5.Vector} v2 A p5.Vector to add + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} resulting p5.Vector. + */ + }, + { + key: "add", + value: function add(v1, v2, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 3) { + _main.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.add", + ); + } + } else { + target.set(v1); + } + target.add(v2); + return target; + }, // Returns a vector remainder when it is divided by another vector + /** + * @method rem + * @static + * @param {p5.Vector} v1 The dividend p5.Vector + * @param {p5.Vector} v2 The divisor p5.Vector + */ + /** + * @method rem + * @static + * @param {p5.Vector} v1 + * @param {p5.Vector} v2 + * @return {p5.Vector} The resulting p5.Vector + */ + }, + { + key: "rem", + value: function rem(v1, v2) { + if ( + v1 instanceof _main.default.Vector && + v2 instanceof _main.default.Vector + ) { + var target = v1.copy(); + target.rem(v2); + return target; + } + } /* + * Subtracts one p5.Vector from another and returns a new one. The second + * vector (`v2`) is subtracted from the first (`v1`), resulting in `v1-v2`. + */, + /** + * @method sub + * @static + * @param {p5.Vector} v1 A p5.Vector to subtract from + * @param {p5.Vector} v2 A p5.Vector to subtract + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} The resulting p5.Vector + */ + }, + { + key: "sub", + value: function sub(v1, v2, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 3) { + _main.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.sub", + ); + } + } else { + target.set(v1); + } + target.sub(v2); + return target; + } /** + * Multiplies a vector by a scalar and returns a new vector. + */, + /** + * @method mult + * @static + * @param {Number} x + * @param {Number} y + * @param {Number} [z] + * @return {p5.Vector} resulting new p5.Vector. + */ + /** + * @method mult + * @static + * @param {p5.Vector} v + * @param {Number} n + * @param {p5.Vector} [target] vector to receive the result. + */ + /** + * @method mult + * @static + * @param {p5.Vector} v0 + * @param {p5.Vector} v1 + * @param {p5.Vector} [target] + */ + /** + * @method mult + * @static + * @param {p5.Vector} v0 + * @param {Number[]} arr + * @param {p5.Vector} [target] + */ + }, + { + key: "mult", + value: function mult(v, n, target) { + if (!target) { + target = v.copy(); + if (arguments.length === 3) { + _main.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.mult", + ); + } + } else { + target.set(v); + } + target.mult(n); + return target; + } /** + * Rotates the vector (only 2D vectors) by the given angle; magnitude remains the same. Returns a new vector. + */, + /** + * @method rotate + * @static + * @param {p5.Vector} v + * @param {Number} angle + * @param {p5.Vector} [target] The vector to receive the result + */ + }, + { + key: "rotate", + value: function rotate(v, a, target) { + if (arguments.length === 2) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.rotate", + ); + } + target.set(v); + } + target.rotate(a); + return target; + } /** + * Divides a vector by a scalar and returns a new vector. + */, + /** + * @method div + * @static + * @param {Number} x + * @param {Number} y + * @param {Number} [z] + * @return {p5.Vector} The resulting new p5.Vector + */ + /** + * @method div + * @static + * @param {p5.Vector} v + * @param {Number} n + * @param {p5.Vector} [target] The vector to receive the result + */ + /** + * @method div + * @static + * @param {p5.Vector} v0 + * @param {p5.Vector} v1 + * @param {p5.Vector} [target] + */ + /** + * @method div + * @static + * @param {p5.Vector} v0 + * @param {Number[]} arr + * @param {p5.Vector} [target] + */ + }, + { + key: "div", + value: function div(v, n, target) { + if (!target) { + target = v.copy(); + if (arguments.length === 3) { + _main.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.div", + ); + } + } else { + target.set(v); + } + target.div(n); + return target; + } /** + * Calculates the dot product of two vectors. + */, + /** + * @method dot + * @static + * @param {p5.Vector} v1 first p5.Vector. + * @param {p5.Vector} v2 second p5.Vector. + * @return {Number} dot product. + */ + }, + { + key: "dot", + value: function dot(v1, v2) { + return v1.dot(v2); + } /** + * Calculates the cross product of two vectors. + */, + /** + * @method cross + * @static + * @param {p5.Vector} v1 first p5.Vector. + * @param {p5.Vector} v2 second p5.Vector. + * @return {Number} cross product. + */ + }, + { + key: "cross", + value: function cross(v1, v2) { + return v1.cross(v2); + } /** + * Calculates the Euclidean distance between two points (considering a + * point as a vector object). + */, + /** + * @method dist + * @static + * @param {p5.Vector} v1 The first p5.Vector + * @param {p5.Vector} v2 The second p5.Vector + * @return {Number} The distance + */ + }, + { + key: "dist", + value: function dist(v1, v2) { + return v1.dist(v2); + } /** + * Linear interpolate a vector to another vector and return the result as a + * new vector. + */, + /** + * @method lerp + * @static + * @param {p5.Vector} v1 + * @param {p5.Vector} v2 + * @param {Number} amt + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The lerped value + */ + }, + { + key: "lerp", + value: function lerp(v1, v2, amt, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 4) { + _main.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.lerp", + ); + } + } else { + target.set(v1); + } + target.lerp(v2, amt); + return target; + } /** + * Performs spherical linear interpolation with the other vector + * and returns the resulting vector. + * This works in both 3D and 2D. As for 2D, the result of slerping + * between 2D vectors is always a 2D vector. + */, + /** + * @method slerp + * @static + * @param {p5.Vector} v1 old vector. + * @param {p5.Vector} v2 new vector. + * @param {Number} amt + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} slerped vector between v1 and v2 + */ + }, + { + key: "slerp", + value: function slerp(v1, v2, amt, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 4) { + _main.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.slerp", + ); + } + } else { + target.set(v1); + } + target.slerp(v2, amt); + return target; + } /** + * Calculates the magnitude (length) of the vector and returns the result as + * a float (this is simply the equation `sqrt(x*x + y*y + z*z)`.) + */, + /** + * @method mag + * @static + * @param {p5.Vector} vecT The vector to return the magnitude of + * @return {Number} The magnitude of vecT + */ + }, + { + key: "mag", + value: function mag(vecT) { + return vecT.mag(); + } /** + * Calculates the squared magnitude of the vector and returns the result + * as a float (this is simply the equation (x\*x + y\*y + z\*z).) + * Faster if the real length is not required in the + * case of comparing vectors, etc. + */, + /** + * @method magSq + * @static + * @param {p5.Vector} vecT the vector to return the squared magnitude of + * @return {Number} the squared magnitude of vecT + */ + }, + { + key: "magSq", + value: function magSq(vecT) { + return vecT.magSq(); + } /** + * Normalize the vector to length 1 (make it a unit vector). + */, + /** + * @method normalize + * @static + * @param {p5.Vector} v The vector to normalize + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The vector v, normalized to a length of 1 + */ + }, + { + key: "normalize", + value: function normalize(v, target) { + if (arguments.length < 2) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.normalize", + ); + } + target.set(v); + } + return target.normalize(); + } /** + * Limit the magnitude of the vector to the value used for the max + * parameter. + */, + /** + * @method limit + * @static + * @param {p5.Vector} v the vector to limit + * @param {Number} max + * @param {p5.Vector} [target] the vector to receive the result (Optional) + * @return {p5.Vector} v with a magnitude limited to max + */ + }, + { + key: "limit", + value: function limit(v, max, target) { + if (arguments.length < 3) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.limit", + ); + } + target.set(v); + } + return target.limit(max); + } /** + * Set the magnitude of the vector to the value used for the len + * parameter. + */, + /** + * @method setMag + * @static + * @param {p5.Vector} v the vector to set the magnitude of + * @param {number} len + * @param {p5.Vector} [target] the vector to receive the result (Optional) + * @return {p5.Vector} v with a magnitude set to len + */ + }, + { + key: "setMag", + value: function setMag(v, len, target) { + if (arguments.length < 3) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.setMag", + ); + } + target.set(v); + } + return target.setMag(len); + } /** + * Calculate the angle of rotation for this vector (only 2D vectors). + * p5.Vectors created using createVector() + * will take the current angleMode into + * consideration, and give the angle in radians or degrees accordingly. + */, + /** + * @method heading + * @static + * @param {p5.Vector} v the vector to find the angle of + * @return {Number} the angle of rotation + */ + }, + { + key: "heading", + value: function heading(v) { + return v.heading(); + } /** + * Calculates and returns the angle between two vectors. This function will take + * the angleMode on v1 into consideration, and + * give the angle in radians or degrees accordingly. + */, + /** + * @method angleBetween + * @static + * @param {p5.Vector} v1 the first vector. + * @param {p5.Vector} v2 the second vector. + * @return {Number} angle between the two vectors. + */ + }, + { + key: "angleBetween", + value: function angleBetween(v1, v2) { + return v1.angleBetween(v2); + } /** + * Reflect a vector about a normal to a line in 2D, or about a normal to a + * plane in 3D. + */, + /** + * @method reflect + * @static + * @param {p5.Vector} incidentVector vector to be reflected. + * @param {p5.Vector} surfaceNormal + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} the reflected vector + */ + }, + { + key: "reflect", + value: function reflect( + incidentVector, + surfaceNormal, + target, + ) { + if (arguments.length < 3) { + target = incidentVector.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.reflect", + ); + } + target.set(incidentVector); + } + return target.reflect(surfaceNormal); + } /** + * Return a representation of this vector as a float array. This is only + * for temporary use. If used in any other fashion, the contents should be + * copied by using the p5.Vector.copy() + * method to copy into your own vector. + */, + /** + * @method array + * @static + * @param {p5.Vector} v the vector to convert to an array + * @return {Number[]} an Array with the 3 values + */ + }, + { + key: "array", + value: function array(v) { + return v.array(); + } /** + * Equality check against a p5.Vector + */, + /** + * @method equals + * @static + * @param {p5.Vector|Array} v1 the first vector to compare + * @param {p5.Vector|Array} v2 the second vector to compare + * @return {Boolean} + */ + }, + { + key: "equals", + value: function equals(v1, v2) { + var v; + if (v1 instanceof _main.default.Vector) { + v = v1; + } else if (v1 instanceof Array) { + v = new _main.default.Vector().set(v1); + } else { + _main.default._friendlyError( + "The v1 parameter should be of type Array or p5.Vector", + "p5.Vector.equals", + ); + } + return v.equals(v2); + }, + }, + ], + ); + return _class; + })(); + var _default = _main.default.Vector; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.every": 171, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.some": 184, + "core-js/modules/es.math.sign": 190, + "core-js/modules/es.number.constructor": 191, + "core-js/modules/es.number.is-finite": 192, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.sub": 218, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 332: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Math + * @submodule Random + * @for p5 + * @requires core + */ + // variables used for random number generators + + var randomStateProp = "_lcg_random_state"; + // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes + // m is basically chosen to be large (as it is the max period) + // and for its relationships to a and c + var m = 4294967296; + // a - 1 should be divisible by m's prime factors + var a = 1664525; + // c and m should be co-prime + var c = 1013904223; + var y2 = 0; + // Linear Congruential Generator that stores its state at instance[stateProperty] + _main.default.prototype._lcg = function (stateProperty) { + // define the recurrence relationship + this[stateProperty] = (a * this[stateProperty] + c) % m; + // return a float in [0, 1) + // we've just used % m, so / m is always < 1 + return this[stateProperty] / m; + }; + _main.default.prototype._lcgSetSeed = function (stateProperty, val) { + // pick a random seed if val is undefined or null + // the >>> 0 casts the seed to an unsigned 32-bit integer + this[stateProperty] = (val == null ? Math.random() * m : val) >>> 0; + }; + /** + * Sets the seed value for random() and + * randomGaussian(). By default, + * random() and + * randomGaussian() produce different + * results each time a sketch is run. Calling `randomSeed()` with a constant + * argument, such as `randomSeed(99)`, makes these functions produce the same + * results each time a sketch is run. + * + * @method randomSeed + * @param {Number} seed seed value. + * @example + *
                    + * + * let x = random(width); + * let y = random(height); + * circle(x, y, 10); + * + * randomSeed(99); + * x = random(width); + * y = random(height); + * fill(0); + * circle(x, y, 10); + * + * describe('A white circle appears at a random position. A black circle appears at (27.4, 25.8).'); + * + *
                    + */ + _main.default.prototype.randomSeed = function (seed) { + this._lcgSetSeed(randomStateProp, seed); + this._gaussian_previous = false; + }; + /** + * Returns a random number or a random element from an array. + * + * `random()` follows uniform distribution, which means that all outcomes are + * equally likely. When `random()` is used to generate numbers, all + * numbers in the output range are equally likely to be returned. When + * `random()` is used to select elements from an array, all elements are + * equally likely to be chosen. + * + * By default, `random()` produces different results each time a sketch runs. + * The randomSeed() function can be used to + * generate the same sequence of numbers or choices each time a sketch runs. + * + * The version of `random()` with no parameters returns a random number from 0 + * up to but not including 1. + * + * The version of `random()` with one parameter works one of two ways. If the + * argument passed is a number, `random()` returns a random number from 0 up + * to but not including the number. For example, calling `random(5)` returns + * values between 0 and 5. If the argument passed is an array, `random()` + * returns a random element from that array. For example, calling + * `random(['🦁', '🐯', '🐻'])` returns either a lion, tiger, or bear emoji. + * + * The version of `random()` with two parameters returns a random number from + * a given range. The arguments passed set the range's lower and upper bounds. + * For example, calling `random(-5, 10.2)` returns values from -5 up to but + * not including 10.2. + * + * @method random + * @param {Number} [min] lower bound (inclusive). + * @param {Number} [max] upper bound (exclusive). + * @return {Number} random number. + * @example + *
                    + * + * let x = random(width); + * let y = random(height); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot appears in a random posiiton on a gray square.'); + * + *
                    + * + *
                    + * + * let animals = ['🦁', '🐯', '🐻']; + * let animal = random(animals); + * text(animal, 50, 50); + * + * describe('An animal face is displayed at random. Either a lion, tiger, or bear.'); + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * frameRate(5); + * let x = random(width); + * let y = random(height); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves around randomly on a gray square.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * background(200); + * + * frameRate(5); + * let x = random(45, 55); + * let y = random(45, 55); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves around randomly in the middle of a gray square.'); + * } + * + *
                    + */ + /** + * @method random + * @param {Array} choices array to choose from. + * @return {*} random element from the array. + * @example + */ + _main.default.prototype.random = function (min, max) { + _main.default._validateParameters("random", arguments); + var rand; + if (this[randomStateProp] != null) { + rand = this._lcg(randomStateProp); + } else { + rand = Math.random(); + } + if (typeof min === "undefined") { + return rand; + } else if (typeof max === "undefined") { + if (min instanceof Array) { + return min[Math.floor(rand * min.length)]; + } else { + return rand * min; + } + } else { + if (min > max) { + var tmp = min; + min = max; + max = tmp; + } + return rand * (max - min) + min; + } + }; + /** + * Returns a random number fitting a Gaussian, or normal, distribution. Normal + * distributions look like bell curves when plotted. Values from a normal + * distribution cluster around a central value called the mean. The cluster's + * standard deviation describes its spread. + * + * By default, `randomGaussian()` produces different results each time a + * sketch runs. The randomSeed() function can be + * used to generate the same sequence of numbers each time a sketch runs. + * + * There's no minimum or maximum value that `randomGaussian()` might return. + * Values far from the mean are very unlikely and values near the mean are + * very likely. + * + * The version of `randomGaussian()` with no parameters returns values with a + * mean of 0 and standard deviation of 1. + * + * The version of `randomGaussian()` with one parameter interprets the + * argument passed as the mean. The standard deviation is 1. + * + * The version of `randomGaussian()` with two parameters interprets the first + * argument passed as the mean and the second as the standard deviation. + * + * @method randomGaussian + * @param {Number} [mean] mean. + * @param {Number} [sd] standard deviation. + * @return {Number} random number. + * @example + *
                    + * + * function draw() { + * noStroke(); + * fill(0, 10); + * + * // Uniform distribution. + * let x = random(width); + * let y = 25; + * circle(x, y, 5); + * + * // Gaussian distribution with sd = 1. + * x = randomGaussian(50); + * y = 50; + * circle(x, y, 5); + * + * // Gaussian distribution with sd = 10. + * x = randomGaussian(50, 10); + * y = 75; + * circle(x, y, 5); + * + * describe('Three horizontal black lines are filled in randomly. The top line spans entire canvas. The middle line is very short. The bottom line spans two-thirds of the canvas.'); + * } + * + *
                    + */ + _main.default.prototype.randomGaussian = function (mean) { + var sd = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 1; + var y1, x1, x2, w; + if (this._gaussian_previous) { + y1 = y2; + this._gaussian_previous = false; + } else { + do { + x1 = this.random(2) - 1; + x2 = this.random(2) - 1; + w = x1 * x1 + x2 * x2; + } while (w >= 1); + w = Math.sqrt((-2 * Math.log(w)) / w); + y1 = x1 * w; + y2 = x2 * w; + this._gaussian_previous = true; + } + var m = mean || 0; + return y1 * sd + m; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + }, + ], + 333: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Math + * @submodule Trigonometry + * @for p5 + * @requires core + * @requires constants + */ + /* + * all DEGREES/RADIANS conversion should be done in the p5 instance + * if possible, using the p5._toRadians(), p5._fromRadians() methods. + */ + + _main.default.prototype._angleMode = constants.RADIANS; + /** + * The inverse of cos(), returns the arc cosine of a + * value. This function expects arguments in the range -1 to 1. By default, + * `acos()` returns values in the range 0 to π (about 3.14). If the + * angleMode() is `DEGREES`, then values are + * returned in the range 0 to 180. + * + * @method acos + * @param {Number} value value whose arc cosine is to be returned. + * @return {Number} arc cosine of the given value. + * + * @example + *
                    + * + * let a = PI; + * let c = cos(a); + * let ac = acos(c); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(c, 3)}`, 35, 50); + * text(`${round(ac, 3)}`, 35, 75); + * + * describe('The numbers 3.142, -1, and 3.142 written on separate rows.'); + * + *
                    + * + *
                    + * + * let a = PI; + * let c = cos(a); + * let ac = acos(c); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(c, 3)}`, 35, 50); + * text(`${round(ac, 3)}`, 35, 75); + * + * describe('The numbers 3.927, -0.707, and 2.356 written on separate rows.'); + * + *
                    + */ + _main.default.prototype.acos = function (ratio) { + return this._fromRadians(Math.acos(ratio)); + }; + /** + * The inverse of sin(), returns the arc sine of a + * value. This function expects input values in the range of -1 to 1. By + * default, `asin()` returns values in the range -π ÷ 2 + * (about -1.57) to π ÷ 2 (about 1.57). If the + * angleMode() is `DEGREES` then values are + * returned in the range -90 to 90. + * + * @method asin + * @param {Number} value value whose arc sine is to be returned. + * @return {Number} arc sine of the given value. + * + * @example + *
                    + * + * let a = PI / 3; + * let s = sin(a); + * let as = asin(s); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(s, 3)}`, 35, 50); + * text(`${round(as, 3)}`, 35, 75); + * + * describe('The numbers 1.047, 0.866, and 1.047 written on separate rows.'); + * + *
                    + * + *
                    + * + * let a = PI + PI / 3; + * let s = sin(a); + * let as = asin(s); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(s, 3)}`, 35, 50); + * text(`${round(as, 3)}`, 35, 75); + * + * describe('The numbers 4.189, -0.866, and -1.047 written on separate rows.'); + * + *
                    + */ + _main.default.prototype.asin = function (ratio) { + return this._fromRadians(Math.asin(ratio)); + }; + /** + * The inverse of tan(), returns the arc tangent of a + * value. This function expects input values in the range of -Infinity to + * Infinity. By default, `atan()` returns values in the range -π ÷ 2 + * (about -1.57) to π ÷ 2 (about 1.57). If the + * angleMode() is `DEGREES` then values are + * returned in the range -90 to 90. + * + * @method atan + * @param {Number} value value whose arc tangent is to be returned. + * @return {Number} arc tangent of the given value. + * + * @example + *
                    + * + * let a = PI / 3; + * let t = tan(a); + * let at = atan(t); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(t, 3)}`, 35, 50); + * text(`${round(at, 3)}`, 35, 75); + * + * describe('The numbers 1.047, 1.732, and 1.047 written on separate rows.'); + * + *
                    + * + *
                    + * + * let a = PI + PI / 3; + * let t = tan(a); + * let at = atan(t); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(t, 3)}`, 35, 50); + * text(`${round(at, 3)}`, 35, 75); + * + * describe('The numbers 4.189, 1.732, and 1.047 written on separate rows.'); + * + *
                    + */ + _main.default.prototype.atan = function (ratio) { + return this._fromRadians(Math.atan(ratio)); + }; + /** + * Calculates the angle formed by a specified point, the origin, and the + * positive x-axis. By default, `atan2()` returns values in the range + * -π (about -3.14) to π (3.14). If the + * angleMode() is `DEGREES`, then values are + * returned in the range -180 to 180. The `atan2()` function is most often + * used for orienting geometry to the mouse's position. + * + * Note: The y-coordinate of the point is the first parameter and the + * x-coordinate is the second parameter. + * + * @method atan2 + * @param {Number} y y-coordinate of the point. + * @param {Number} x x-coordinate of the point. + * @return {Number} arc tangent of the given point. + * + * @example + *
                    + * + * function draw() { + * background(200); + * translate(width / 2, height / 2); + * let x = mouseX - width / 2; + * let y = mouseY - height / 2; + * let a = atan2(y, x); + * rotate(a); + * rect(-30, -5, 60, 10); + * + * describe('A rectangle at the center of the canvas rotates with mouse movements.'); + * } + * + *
                    + */ + _main.default.prototype.atan2 = function (y, x) { + return this._fromRadians(Math.atan2(y, x)); + }; + /** + * Calculates the cosine of an angle. `cos()` is useful for many geometric + * tasks in creative coding. The values returned oscillate between -1 and 1 + * as the input angle increases. `cos()` takes into account the current + * angleMode. + * + * @method cos + * @param {Number} angle the angle. + * @return {Number} cosine of the angle. + * + * @example + *
                    + * + * function draw() { + * background(200); + * + * let t = frameCount; + * let x = 30 * cos(t * 0.05) + 50; + * let y = 50; + * line(50, y, x, y); + * circle(x, y, 20); + * + * describe('A white ball on a string oscillates left and right.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * let x = frameCount; + * let y = 30 * cos(x * 0.1) + 50; + * point(x, y); + * + * describe('A series of black dots form a wave pattern.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * let t = frameCount; + * let x = 30 * cos(t * 0.1) + 50; + * let y = 10 * sin(t * 0.2) + 50; + * point(x, y); + * + * describe('A series of black dots form an infinity symbol.'); + * } + * + *
                    + */ + _main.default.prototype.cos = function (angle) { + return Math.cos(this._toRadians(angle)); + }; + /** + * Calculates the sine of an angle. `sin()` is useful for many geometric tasks + * in creative coding. The values returned oscillate between -1 and 1 as the + * input angle increases. `sin()` takes into account the current + * angleMode. + * + * @method sin + * @param {Number} angle the angle. + * @return {Number} sine of the angle. + * + * @example + *
                    + * + * function draw() { + * background(200); + * + * let t = frameCount; + * let x = 50; + * let y = 30 * sin(t * 0.05) + 50; + * line(x, 50, x, y); + * circle(x, y, 20); + * + * describe('A white ball on a string oscillates up and down.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * let x = frameCount; + * let y = 30 * sin(x * 0.1) + 50; + * point(x, y); + * + * describe('A series of black dots form a wave pattern.'); + * } + * + *
                    + * + *
                    + * + * function draw() { + * let t = frameCount; + * let x = 30 * cos(t * 0.1) + 50; + * let y = 10 * sin(t * 0.2) + 50; + * point(x, y); + * + * describe('A series of black dots form an infinity symbol.'); + * } + * + *
                    + */ + _main.default.prototype.sin = function (angle) { + return Math.sin(this._toRadians(angle)); + }; + /** + * Calculates the tangent of an angle. `tan()` is useful for many geometric + * tasks in creative coding. The values returned range from -Infinity + * to Infinity and repeat periodically as the input angle increases. `tan()` + * takes into account the current angleMode. + * + * @method tan + * @param {Number} angle the angle. + * @return {Number} tangent of the angle. + * + * @example + *
                    + * + * function draw() { + * let x = frameCount; + * let y = 5 * tan(x * 0.1) + 50; + * point(x, y); + * + * describe('A series of identical curves drawn with black dots. Each curve starts from the top of the canvas, continues down at a slight angle, flattens out at the middle of the canvas, then continues to the bottom.'); + * } + * + *
                    + */ + _main.default.prototype.tan = function (angle) { + return Math.tan(this._toRadians(angle)); + }; + /** + * Converts an angle measurement in radians to its corresponding value in + * degrees. Degrees and radians are two ways of measuring the same thing. + * There are 360 degrees in a circle and 2 × π (about 6.28) + * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) + * radians. This function doesn't take into account the current + * angleMode(). + * + * @method degrees + * @param {Number} radians radians value to convert to degrees. + * @return {Number} converted angle. + * + * @example + *
                    + * + * let rad = QUARTER_PI; + * let deg = degrees(rad); + * text(`${round(rad, 2)} rad = ${deg}˚`, 10, 50); + * + * describe('The text "0.79 rad = 45˚".'); + * + *
                    + */ + _main.default.prototype.degrees = function (angle) { + return angle * constants.RAD_TO_DEG; + }; + /** + * Converts an angle measurement in degrees to its corresponding value in + * radians. Degrees and radians are two ways of measuring the same thing. + * There are 360 degrees in a circle and 2 × π (about 6.28) + * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) + * radians. This function doesn't take into account the current + * angleMode(). + * + * @method radians + * @param {Number} degrees degree value to convert to radians. + * @return {Number} converted angle. + * + * @example + *
                    + * + * let deg = 45; + * let rad = radians(deg); + * text(`${deg}˚ = ${round(rad, 3)} rad`, 10, 50); + * + * describe('The text "45˚ = 0.785 rad".'); + * + *
                    + */ + _main.default.prototype.radians = function (angle) { + return angle * constants.DEG_TO_RAD; + }; + /** + * Changes the way trigonometric functions interpret angle values. By default, + * the mode is `RADIANS`. + * + * Calling `angleMode()` with no arguments returns current angle mode. + * @method angleMode + * @param {Constant} mode either RADIANS or DEGREES. + * @example + *
                    + * + * let r = 40; + * push(); + * rotate(PI / 6); + * line(0, 0, r, 0); + * text('0.524 rad', r, 0); + * pop(); + * + * angleMode(DEGREES); + * push(); + * rotate(60); + * line(0, 0, r, 0); + * text('60˚', r, 0); + * pop(); + * + * describe('Two diagonal lines radiating from the top left corner of a square. The lines are oriented 30 degrees from the edges of the square and 30 degrees apart from each other.'); + * + *
                    + * + */ + /** + * @method angleMode + * @return {Constant} mode either RADIANS or DEGREES + */ + _main.default.prototype.angleMode = function (mode) { + _main.default._validateParameters("angleMode", arguments); + if (typeof mode === "undefined") { + return this._angleMode; + } else if ( + mode === constants.DEGREES || + mode === constants.RADIANS + ) { + this._angleMode = mode; + } + }; + /** + * converts angles from the current angleMode to RADIANS + * + * @method _toRadians + * @private + * @param {Number} angle + * @returns {Number} + */ + _main.default.prototype._toRadians = function (angle) { + if (this._angleMode === constants.DEGREES) { + return angle * constants.DEG_TO_RAD; + } + return angle; + }; + /** + * converts angles from the current angleMode to DEGREES + * + * @method _toDegrees + * @private + * @param {Number} angle + * @returns {Number} + */ + _main.default.prototype._toDegrees = function (angle) { + if (this._angleMode === constants.RADIANS) { + return angle * constants.RAD_TO_DEG; + } + return angle; + }; + /** + * converts angles from RADIANS into the current angleMode + * + * @method _fromRadians + * @private + * @param {Number} angle + * @returns {Number} + */ + _main.default.prototype._fromRadians = function (angle) { + if (this._angleMode === constants.DEGREES) { + return angle * constants.RAD_TO_DEG; + } + return angle; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 334: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Typography + * @submodule Attributes + * @for p5 + * @requires core + * @requires constants + */ + /** + * Sets the way text is aligned when text() is called. + * + * By default, calling `text('hi', 10, 20)` places the bottom-left corner of + * the text's bounding box at (10, 20). + * + * The first parameter, `horizAlign`, changes the way + * text() interprets x-coordinates. By default, the + * x-coordinate sets the left edge of the bounding box. `textAlign()` accepts + * the following values for `horizAlign`: `LEFT`, `CENTER`, or `RIGHT`. + * + * The second parameter, `vertAlign`, is optional. It changes the way + * text() interprets y-coordinates. By default, the + * y-coordinate sets the bottom edge of the bounding box. `textAlign()` + * accepts the following values for `vertAlign`: `TOP`, `BOTTOM`, `CENTER`, + * or `BASELINE`. + * + * @method textAlign + * @param {Constant} horizAlign horizontal alignment, either LEFT, + * CENTER, or RIGHT. + * @param {Constant} [vertAlign] vertical alignment, either TOP, + * BOTTOM, CENTER, or BASELINE. + * @chainable + * @example + *
                    + * + * strokeWeight(0.5); + * line(50, 0, 50, 100); + * + * textSize(16); + * textAlign(RIGHT); + * text('ABCD', 50, 30); + * textAlign(CENTER); + * text('EFGH', 50, 50); + * textAlign(LEFT); + * text('IJKL', 50, 70); + * + * describe('The letters ABCD displayed at top-left, EFGH at center, and IJKL at bottom-right. A vertical line divides the canvas in half.'); + * + *
                    + * + *
                    + * + * strokeWeight(0.5); + * + * line(0, 12, width, 12); + * textAlign(CENTER, TOP); + * text('TOP', 50, 12); + * + * line(0, 37, width, 37); + * textAlign(CENTER, CENTER); + * text('CENTER', 50, 37); + * + * line(0, 62, width, 62); + * textAlign(CENTER, BASELINE); + * text('BASELINE', 50, 62); + * + * line(0, 97, width, 97); + * textAlign(CENTER, BOTTOM); + * text('BOTTOM', 50, 97); + * + * describe('The words "TOP", "CENTER", "BASELINE", and "BOTTOM" each drawn relative to a horizontal line. Their positions demonstrate different vertical alignments.'); + * + *
                    + */ + /** + * @method textAlign + * @return {Object} + */ + + _main.default.prototype.textAlign = function (horizAlign, vertAlign) { + var _this$_renderer; + _main.default._validateParameters("textAlign", arguments); + return (_this$_renderer = this._renderer).textAlign.apply( + _this$_renderer, + arguments, + ); + }; + /** + * Sets the spacing between lines of text when + * text() is called. Spacing is measured in pixels. + * + * Calling `textLeading()` without an argument returns the current spacing. + * + * @method textLeading + * @param {Number} leading spacing between lines of text in units of pixels. + * @chainable + * + * @example + *
                    + * + * // "\n" starts a new line of text. + * let lines = 'one\ntwo'; + * + * text(lines, 10, 25); + * + * textLeading(30); + * text(lines, 70, 25); + * + * describe('The words "one" and "two" written on separate lines twice. The words on the left have less vertical spacing than the words on the right.'); + * + *
                    + */ + /** + * @method textLeading + * @return {Number} + */ + _main.default.prototype.textLeading = function (theLeading) { + var _this$_renderer2; + _main.default._validateParameters("textLeading", arguments); + return (_this$_renderer2 = this._renderer).textLeading.apply( + _this$_renderer2, + arguments, + ); + }; + /** + * Sets the font size when + * text() is called. Font size is measured in pixels. + * + * Calling `textSize()` without an arugment returns the current size. + * + * @method textSize + * @param {Number} size size of the letters in units of pixels + * @chainable + * + * @example + *
                    + * + * textSize(12); + * text('Font Size 12', 10, 30); + * textSize(14); + * text('Font Size 14', 10, 60); + * textSize(16); + * text('Font Size 16', 10, 90); + * + * describe('The text "Font Size 12" drawn small, "Font Size 14" drawn medium, and "Font Size 16" drawn large.'); + * + *
                    + */ + /** + * @method textSize + * @return {Number} + */ + _main.default.prototype.textSize = function (theSize) { + var _this$_renderer3; + _main.default._validateParameters("textSize", arguments); + return (_this$_renderer3 = this._renderer).textSize.apply( + _this$_renderer3, + arguments, + ); + }; + /** + * Sets the style for system fonts when + * text() is called. `textStyle()` accepts the + * following values: `NORMAL`, `ITALIC`, `BOLD` or `BOLDITALIC`. + * + * `textStyle()` may be overridden by CSS styling. This function doesn't + * affect fonts loaded with loadFont(). + * + * @method textStyle + * @param {Constant} style styling for text, either NORMAL, + * ITALIC, BOLD or BOLDITALIC + * @chainable + * @example + *
                    + * + * textSize(12); + * textAlign(CENTER); + * + * textStyle(NORMAL); + * text('Normal', 50, 15); + * textStyle(ITALIC); + * text('Italic', 50, 40); + * textStyle(BOLD); + * text('Bold', 50, 65); + * textStyle(BOLDITALIC); + * text('Bold Italic', 50, 90); + * + * describe('The words "Normal" displayed normally, "Italic" in italic, "Bold" in bold, and "Bold Italic" in bold italics.'); + * + *
                    + */ + /** + * @method textStyle + * @return {String} + */ + _main.default.prototype.textStyle = function (theStyle) { + var _this$_renderer4; + _main.default._validateParameters("textStyle", arguments); + return (_this$_renderer4 = this._renderer).textStyle.apply( + _this$_renderer4, + arguments, + ); + }; + /** + * Returns the maximum width of a string of text drawn when + * text() is called. + * + * @method textWidth + * @param {String} str string of text to measure. + * @return {Number} width measured in units of pixels. + * @example + *
                    + * + * function setup() { + * background(200); + * + * textSize(28); + * strokeWeight(0.5); + * let s = 'yoyo'; + * let w = textWidth(s); + * text(s, 22, 55); + * line(22, 55, 22 + w, 55); + * + * describe('The word "yoyo" underlined.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * + * textSize(28); + * strokeWeight(0.5); + * // "\n" starts a new line. + * let s = 'yo\nyo'; + * let w = textWidth(s); + * text(s, 22, 55); + * line(22, 55, 22 + w, 55); + * + * describe('The word "yo" written twice, one copy beneath the other. The words are divided by a horizontal line.'); + * } + * + *
                    + */ + _main.default.prototype.textWidth = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + args[0] += ""; + _main.default._validateParameters("textWidth", args); + if (args[0].length === 0) { + return 0; + } // Only use the line with the longest width, and replace tabs with double-space + + var textLines = args[0].replace(/\t/g, " ").split(/\r?\n|\r|\n/g); + var newArr = []; + // Return the textWidth for every line + for (var i = 0; i < textLines.length; i++) { + newArr.push(this._renderer.textWidth(textLines[i])); + } // Return the largest textWidth + + var largestWidth = Math.max.apply(Math, newArr); + return largestWidth; + }; + /** + * Returns the ascent of the current font at its current size. The ascent + * represents the distance, in pixels, of the tallest character above + * the baseline. + * + * @method textAscent + * @return {Number} ascent measured in units of pixels. + * @example + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * textFont(font); + * + * // Different for each font. + * let fontScale = 0.8; + * + * let baseY = 75; + * strokeWeight(0.5); + * + * // Draw small text. + * textSize(24); + * text('dp', 0, baseY); + * // Draw baseline and ascent. + * let a = textAscent() * fontScale; + * line(0, baseY, 23, baseY); + * line(23, baseY - a, 23, baseY); + * + * // Draw large text. + * textSize(48); + * text('dp', 45, baseY); + * // Draw baseline and ascent. + * a = textAscent() * fontScale; + * line(45, baseY, 91, baseY); + * line(91, baseY - a, 91, baseY); + * + * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends upward from each baseline to the top of the "d".'); + * } + * + *
                    + */ + _main.default.prototype.textAscent = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("textAscent", args); + return this._renderer.textAscent(); + }; + /** + * Returns the descent of the current font at its current size. The descent + * represents the distance, in pixels, of the character with the longest + * descender below the baseline. + * + * @method textDescent + * @return {Number} descent measured in units of pixels. + * @example + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * textFont(font); + * + * // Different for each font. + * let fontScale = 0.9; + * + * let baseY = 75; + * strokeWeight(0.5); + * + * // Draw small text. + * textSize(24); + * text('dp', 0, baseY); + * // Draw baseline and descent. + * let d = textDescent() * fontScale; + * line(0, baseY, 23, baseY); + * line(23, baseY, 23, baseY + d); + * + * // Draw large text. + * textSize(48); + * text('dp', 45, baseY); + * // Draw baseline and descent. + * d = textDescent() * fontScale; + * line(45, baseY, 91, baseY); + * line(91, baseY, 91, baseY + d); + * + * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends downward from each baseline to the bottom of the "p".'); + * } + * + *
                    + */ + _main.default.prototype.textDescent = function () { + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters("textDescent", args); + return this._renderer.textDescent(); + }; + /** + * Helper function to measure ascent and descent. + */ + _main.default.prototype._updateTextMetrics = function () { + return this._renderer._updateTextMetrics(); + }; + /** + * Sets the style for wrapping text when + * text() is called. `textWrap()` accepts the + * following values: + * + * `WORD` starts new lines of text at spaces. If a string of text doesn't + * have spaces, it may overflow the text box and the canvas. This is the + * default style. + * + * `CHAR` starts new lines as needed to stay within the text box. + * + * `textWrap()` only works when the maximum width is set for a text box. For + * example, calling `text('Have a wonderful day', 0, 10, 100)` sets the + * maximum width to 100 pixels. + * + * Calling `textWrap()` without an argument returns the current style. + * + * @method textWrap + * @param {Constant} style text wrapping style, either WORD or CHAR. + * @return {String} style + * @example + *
                    + * + * textSize(20); + * textWrap(WORD); + * text('Have a wonderful day', 0, 10, 100); + * + *
                    + * + *
                    + * + * textSize(20); + * textWrap(CHAR); + * text('Have a wonderful day', 0, 10, 100); + * + *
                    + * + *
                    + * + * textSize(20); + * textWrap(CHAR); + * text('祝你有美好的一天', 0, 10, 100); + * + *
                    + */ + _main.default.prototype.textWrap = function (wrapStyle) { + if (wrapStyle !== "WORD" && wrapStyle !== "CHAR") { + throw "Error: textWrap accepts only WORD or CHAR"; + } + return this._renderer.textWrap(wrapStyle); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + }, + ], + 335: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.last-index-of"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.last-index-of"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.split"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + var opentype = _interopRequireWildcard(_dereq_("opentype.js")); + _dereq_("../core/friendly_errors/validate_params"); + _dereq_("../core/friendly_errors/file_errors"); + _dereq_("../core/friendly_errors/fes_core"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Typography + * @submodule Loading & Displaying + * @for p5 + * @requires core + */ + /** + * Loads a font and creates a p5.Font object. + * `loadFont()` can load fonts in either .otf or .ttf format. Loaded fonts can + * be used to style text on the canvas and in HTML elements. + * + * The first parameter, `path`, is the path to a font file. + * Paths to local files should be relative. For example, + * `'assets/inconsolata.otf'`. The Inconsolata font used in the following + * examples can be downloaded for free + * here. + * Paths to remote files should be URLs. For example, + * `'https://example.com/inconsolata.otf'`. URLs may be blocked due to browser + * security. + * + * The second parameter, `successCallback`, is optional. If a function is + * passed, it will be called once the font has loaded. The callback function + * may use the new p5.Font object if needed. + * + * The third parameter, `failureCallback`, is also optional. If a function is + * passed, it will be called if the font fails to load. The callback function + * may use the error + * Event + * object if needed. + * + * Fonts can take time to load. Calling `loadFont()` in + * preload() ensures fonts load before they're + * used in setup() or + * draw(). + * + * @method loadFont + * @param {String} path path of the font to be loaded. + * @param {Function} [successCallback] function called with the + * p5.Font object after it + * loads. + * @param {Function} [failureCallback] function called with the error + * Event + * object if the font fails to load. + * @return {p5.Font} p5.Font object. + * @example + * + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * loadFont('assets/inconsolata.otf', font => { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * }); + * } + * + *
                    + * + *
                    + * + * function setup() { + * loadFont('assets/inconsolata.otf', success, failure); + * } + * + * function success(font) { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + * function failure(event) { + * console.error('Oops!', event); + * } + * + *
                    + * + *
                    + * + * function preload() { + * loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * let p = createP('p5*js'); + * p.style('color', 'deeppink'); + * p.style('font-family', 'Inconsolata'); + * p.style('font-size', '36px'); + * p.position(10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
                    + */ + + _main.default.prototype.loadFont = function ( + path, + onSuccess, + onError, + ) { + _main.default._validateParameters("loadFont", arguments); + var p5Font = new _main.default.Font(this); + var self = this; + opentype.load(path, function (err, font) { + if (err) { + _main.default._friendlyFileLoadError(4, path); + if (typeof onError !== "undefined") { + return onError(err); + } + console.error(err, path); + return; + } + p5Font.font = font; + if (typeof onSuccess !== "undefined") { + onSuccess(p5Font); + } + self._decrementPreload(); + // check that we have an acceptable font type + var validFontTypes = ["ttf", "otf", "woff", "woff2"]; + var fileNoPath = path.split("\\").pop().split("/").pop(); + var lastDotIdx = fileNoPath.lastIndexOf("."); + var fontFamily; + var newStyle; + var fileExt = + lastDotIdx < 1 ? null : fileNoPath.slice(lastDotIdx + 1); + // if so, add it to the DOM (name-only) for use with DOM module + if (validFontTypes.includes(fileExt)) { + fontFamily = fileNoPath.slice( + 0, + lastDotIdx !== -1 ? lastDotIdx : 0, + ); + newStyle = document.createElement("style"); + newStyle.appendChild( + document.createTextNode( + "\n@font-face {\nfont-family: " + .concat(fontFamily, ";\nsrc: url(") + .concat(path, ");\n}\n"), + ), + ); + document.head.appendChild(newStyle); + } + }); + return p5Font; + }; + /** + * Draws text to the canvas. + * + * The first parameter, `str`, is the text to be drawn. The second and third + * parameters, `x` and `y`, set the coordinates of the text's bottom-left + * corner. See textAlign() for other ways to + * align text. + * + * The fourth and fifth parameters, `maxWidth` and `maxHeight`, are optional. + * They set the dimensions of the invisible rectangle containing the text. By + * default, they set its maximum width and height. See + * rectMode() for other ways to define the + * rectangular text box. Text will wrap to fit within the text box. Text + * outside of the box won't be drawn. + * + * Text can be styled a few ways. Call the fill() + * function to set the text's fill color. Call + * stroke() and + * strokeWeight() to set the text's outline. + * Call textSize() and + * textFont() to set the text's size and font, + * respectively. + * + * Note: `WEBGL` mode only supports fonts loaded with + * loadFont(). Calling + * stroke() has no effect in `WEBGL` mode. + * + * @method text + * @param {String|Object|Array|Number|Boolean} str text to be displayed. + * @param {Number} x x-coordinate of the text box. + * @param {Number} y y-coordinate of the text box. + * @param {Number} [maxWidth] maximum width of the text box. See + * rectMode() for + * other options. + * @param {Number} [maxHeight] maximum height of the text box. See + * rectMode() for + * other options. + * + * @chainable + * @example + *
                    + * + * function setup() { + * background(200); + * text('hi', 50, 50); + * + * describe('The text "hi" written in black in the middle of a gray square.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background('skyblue'); + * textSize(100); + * text('🌈', 0, 100); + * + * describe('A rainbow in a blue sky.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * textSize(32); + * fill(255); + * stroke(0); + * strokeWeight(4); + * text('hi', 50, 50); + * + * describe('The text "hi" written in white with a black outline.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background('black'); + * textSize(22); + * fill('yellow'); + * text('rainbows', 6, 20); + * fill('cornflowerblue'); + * text('rainbows', 6, 45); + * fill('tomato'); + * text('rainbows', 6, 70); + * fill('limegreen'); + * text('rainbows', 6, 95); + * + * describe('The text "rainbows" written on several lines, each in a different color.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * let s = 'The quick brown fox jumps over the lazy dog.'; + * text(s, 10, 10, 70, 80); + * + * describe('The sample text "The quick brown fox..." written in black across several lines.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * rectMode(CENTER); + * let s = 'The quick brown fox jumps over the lazy dog.'; + * text(s, 50, 50, 70, 80); + * + * describe('The sample text "The quick brown fox..." written in black across several lines.'); + * } + * + *
                    + * + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * textFont(font); + * textSize(32); + * textAlign(CENTER, CENTER); + * } + * + * function draw() { + * background(0); + * rotateY(frameCount / 30); + * text('p5*js', 0, 0); + * + * describe('The text "p5*js" written in white and spinning in 3D.'); + * } + * + *
                    + */ + _main.default.prototype.text = function ( + str, + x, + y, + maxWidth, + maxHeight, + ) { + var _this$_renderer; + _main.default._validateParameters("text", arguments); + return !(this._renderer._doFill || this._renderer._doStroke) + ? this + : (_this$_renderer = this._renderer).text.apply( + _this$_renderer, + arguments, + ); + }; + /** + * Sets the font used by the text() function. + * + * The first parameter, `font`, sets the font. `textFont()` recognizes either + * a p5.Font object or a string with the name of a + * system font. For example, `'Courier New'`. + * + * The second parameter, `size`, is optional. It sets the font size in pixels. + * This has the same effect as calling textSize(). + * + * Note: `WEBGL` mode only supports fonts loaded with + * loadFont(). + * + * @method textFont + * @return {Object} current font or p5 Object. + * + * @example + *
                    + * + * function setup() { + * background(200); + * textFont('Courier New'); + * textSize(24); + * text('hi', 35, 55); + * + * describe('The text "hi" written in a black, monospace font on a gray background.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background('black'); + * fill('palegreen'); + * textFont('Courier New', 10); + * text('You turn to the left and see a door. Do you enter?', 5, 5, 90, 90); + * text('>', 5, 70); + * + * describe('A text prompt from a game is written in a green, monospace font on a black background.'); + * } + * + *
                    + * + *
                    + * + * function setup() { + * background(200); + * textFont('Verdana'); + * let currentFont = textFont(); + * text(currentFont, 25, 50); + * + * describe('The text "Verdana" written in a black, sans-serif font on a gray background.'); + * } + * + *
                    + * + *
                    + * + * let fontRegular; + * let fontItalic; + * let fontBold; + * + * function preload() { + * fontRegular = loadFont('assets/Regular.otf'); + * fontItalic = loadFont('assets/Italic.ttf'); + * fontBold = loadFont('assets/Bold.ttf'); + * } + * + * function setup() { + * background(200); + * textFont(fontRegular); + * text('I am Normal', 10, 30); + * textFont(fontItalic); + * text('I am Italic', 10, 50); + * textFont(fontBold); + * text('I am Bold', 10, 70); + * + * describe('The statements "I am Normal", "I am Italic", and "I am Bold" written in black on separate lines. The statements have normal, italic, and bold fonts, respectively.'); + * } + * + *
                    + */ + /** + * @method textFont + * @param {Object|String} font font as a p5.Font object or a string. + * @param {Number} [size] font size in pixels. + * @chainable + */ + _main.default.prototype.textFont = function (theFont, theSize) { + _main.default._validateParameters("textFont", arguments); + if (arguments.length) { + if (!theFont) { + throw new Error("null font passed to textFont"); + } + this._renderer._setProperty("_textFont", theFont); + if (theSize) { + this._renderer._setProperty("_textSize", theSize); + if (!this._renderer._leadingSet) { + // only use a default value if not previously set (#5181) + this._renderer._setProperty( + "_textLeading", + theSize * constants._DEFAULT_LEADMULT, + ); + } + } + return this._renderer._applyTextProperties(); + } + return this._renderer._textFont; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/friendly_errors/fes_core": 289, + "../core/friendly_errors/file_errors": 290, + "../core/friendly_errors/validate_params": 293, + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.last-index-of": 181, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + "opentype.js": 271, + }, + ], + 336: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * This module defines the p5.Font class and functions for + * drawing text to the display canvas. + * @module Typography + * @submodule Loading & Displaying + * @requires core + * @requires constants + */ + /** + * A class to describe fonts. + * @class p5.Font + * @constructor + * @param {p5} [pInst] pointer to p5 instance. + * @example + *
                    + * + * let font; + * + * function preload() { + * // Creates a p5.Font object. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
                    + */ + + _main.default.Font = /*#__PURE__*/ (function () { + function _class(p) { + _classCallCheck(this, _class); + this.parent = p; + this.cache = {}; + /** + * Underlying + * opentype.js + * font object. + * @property font + * @name font + */ + this.font = undefined; + } /** + * Returns the bounding box for a string of text written using this + * p5.Font. + * + * The first parameter, `str`, is a string of text. The second and third + * parameters, `x` and `y`, are the text's position. By default, they set the + * coordinates of the bounding box's bottom-left corner. See + * textAlign() for more ways to align text. + * + * The fourth parameter, `fontSize`, is optional. It sets the font size used to + * determine the bounding box. By default, `font.textBounds()` will use the + * current textSize(). + * + * @method textBounds + * @param {String} str string of text. + * @param {Number} x x-coordinate of the text. + * @param {Number} y y-coordinate of the text. + * @param {Number} [fontSize] font size. Defaults to the current + * textSize(). + * @return {Object} object describing the bounding box with + * properties x, y, w, and h. + * + * @example + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * + * let bbox = font.textBounds('p5*js', 35, 53); + * rect(bbox.x, bbox.y, bbox.w, bbox.h); + * + * textFont(font); + * text('p5*js', 35, 53); + * + * describe('The text "p5*js" written in black inside a white rectangle.'); + * } + * + *
                    + * + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * + * textFont(font); + * textSize(15); + * textAlign(CENTER, CENTER); + * + * let bbox = font.textBounds('p5*js', 50, 50); + * rect(bbox.x, bbox.y, bbox.w, bbox.h); + * + * text('p5*js', 50, 50); + * + * describe('The text "p5*js" written in black inside a white rectangle.'); + * } + * + *
                    + * + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * + * let bbox = font.textBounds('p5*js', 31, 53, 15); + * rect(bbox.x, bbox.y, bbox.w, bbox.h); + * + * textFont(font); + * textSize(15); + * text('p5*js', 31, 53); + * + * describe('The text "p5*js" written in black inside a white rectangle.'); + * } + * + *
                    + */ + + _createClass(_class, [ + { + key: "textBounds", + value: function textBounds(str) { + var x = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var y = + arguments.length > 2 && arguments[2] !== undefined + ? arguments[2] + : 0; + var fontSize = + arguments.length > 3 ? arguments[3] : undefined; + var opts = arguments.length > 4 ? arguments[4] : undefined; + // Check cache for existing bounds. Take into consideration the text alignment + // settings. Default alignment should match opentype's origin: left-aligned & + // alphabetic baseline. + var p = + (opts && opts.renderer && opts.renderer._pInst) || + this.parent; + var ctx = p._renderer.drawingContext; + var alignment = ctx.textAlign || constants.LEFT; + var baseline = ctx.textBaseline || constants.BASELINE; + var cacheResults = false; + var result; + var key; + fontSize = fontSize || p._renderer._textSize; + // NOTE: cache disabled for now pending further discussion of #3436 + if (cacheResults) { + key = cacheKey( + "textBounds", + str, + x, + y, + fontSize, + alignment, + baseline, + ); + result = this.cache[key]; + } + if (!result) { + var minX = []; + var minY; + var maxX = []; + var maxY; + var pos; + var xCoords = []; + xCoords[0] = []; + var yCoords = []; + var scale = this._scale(fontSize); + var lineHeight = p._renderer.textLeading(); + var lineCount = 0; + this.font.forEachGlyph( + str, + x, + y, + fontSize, + opts, + function (glyph, gX, gY, gFontSize) { + var gm = glyph.getMetrics(); + if (glyph.index === 0 || glyph.index === 10) { + lineCount += 1; + xCoords[lineCount] = []; + } else { + xCoords[lineCount].push(gX + gm.xMin * scale); + xCoords[lineCount].push(gX + gm.xMax * scale); + yCoords.push( + gY + lineCount * lineHeight + -gm.yMin * scale, + ); + yCoords.push( + gY + lineCount * lineHeight + -gm.yMax * scale, + ); + } + }, + ); + if (xCoords[lineCount].length > 0) { + minX[lineCount] = Math.min.apply( + null, + xCoords[lineCount], + ); + maxX[lineCount] = Math.max.apply( + null, + xCoords[lineCount], + ); + } + var finalMaxX = 0; + for (var i = 0; i <= lineCount; i++) { + minX[i] = Math.min.apply(null, xCoords[i]); + maxX[i] = Math.max.apply(null, xCoords[i]); + var lineLength = maxX[i] - minX[i]; + if (lineLength > finalMaxX) { + finalMaxX = lineLength; + } + } + var finalMinX = Math.min.apply(null, minX); + minY = Math.min.apply(null, yCoords); + maxY = Math.max.apply(null, yCoords); + result = { + x: finalMinX, + y: minY, + h: maxY - minY, + w: finalMaxX, + advance: finalMinX - x, + }; + // Bounds are now calculated, so shift the x & y to match alignment settings + pos = this._handleAlignment( + p._renderer, + str, + result.x, + result.y, + result.w + result.advance, + ); + result.x = pos.x; + result.y = pos.y; + if (cacheResults) { + this.cache[key] = result; + } + } + return result; + } /** + * Returns an array of points outlining a string of text written using this + * p5.Font. + * + * The first parameter, `str`, is a string of text. The second and third + * parameters, `x` and `y`, are the text's position. By default, they set the + * coordinates of the bounding box's bottom-left corner. See + * textAlign() for more ways to align text. + * + * The fourth parameter, `fontSize`, is optional. It sets the text's font + * size. By default, `font.textToPoints()` will use the current + * textSize(). + * + * The fifth parameter, `options`, is also optional. `font.textToPoints()` + * expects an object with the following properties: + * + * `sampleFactor` is the ratio of the text's path length to the number of + * samples. It defaults to 0.1. Higher values produce more points along the + * path and are more precise. + * + * `simplifyThreshold` removes collinear points if it's set to a number other + * than 0. The value represents the threshold angle to use when determining + * whether two edges are collinear. + * + * @method textToPoints + * @param {String} str string of text. + * @param {Number} x x-coordinate of the text. + * @param {Number} y y-coordinate of the text. + * @param {Number} [fontSize] font size. Defaults to the current + * textSize(). + * @param {Object} [options] object with sampleFactor and simplifyThreshold + * properties. + * @return {Array} array of point objects, each with x, y, and alpha (path angle) properties. + * @example + *
                    + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * let points = font.textToPoints('p5*js', 6, 60, 35, { sampleFactor: 0.5 }); + * points.forEach(p => { + * point(p.x, p.y); + * }); + * + * describe('A set of black dots outlining the text "p5*js" on a gray background.'); + * } + * + *
                    + */, + }, + { + key: "textToPoints", + value: function textToPoints(txt, x, y, fontSize, options) { + var xOriginal = x; + var result = []; + var lines = txt.split(/\r?\n|\r|\n/g); + fontSize = fontSize || this.parent._renderer._textSize; + function isSpace(i, text, glyphsLine) { + return ( + (glyphsLine[i].name && glyphsLine[i].name === "space") || + (text.length === glyphsLine.length && text[i] === " ") //|| + //(glyphs[i].index && glyphs[i].index === 3) + ); + } + for (var i = 0; i < lines.length; i++) { + var xoff = 0; + x = xOriginal; + var line = lines[i]; + line = line.replace("\t", " "); + var glyphs = this._getGlyphs(line); + for (var j = 0; j < glyphs.length; j++) { + if (!isSpace(j, line, glyphs)) { + // fix to #1817, #2069 + var gpath = glyphs[j].getPath(x, y, fontSize), + paths = splitPaths(gpath.commands); + for (var k = 0; k < paths.length; k++) { + var pts = pathToPoints(paths[k], options); + for (var l = 0; l < pts.length; l++) { + pts[l].x += xoff; + result.push(pts[l]); + } + } + } + xoff += glyphs[j].advanceWidth * this._scale(fontSize); + } + y = y + this.parent._renderer._textLeading; + } + return result; + }, // ----------------------------- End API ------------------------------ + /** + * Returns the set of opentype glyphs for the supplied string. + * + * Note that there is not a strict one-to-one mapping between characters + * and glyphs, so the list of returned glyphs can be larger or smaller + * than the length of the given string. + * + * @private + * @param {String} str the string to be converted + * @return {Array} the opentype glyphs + */ + }, + { + key: "_getGlyphs", + value: function _getGlyphs(str) { + return this.font.stringToGlyphs(str); + } /** + * Returns an opentype path for the supplied string and position. + * + * @private + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional) + * @return {Object} the opentype path + */, + }, + { + key: "_getPath", + value: function _getPath(line, x, y, options) { + var p = + (options && + options.renderer && + options.renderer._pInst) || + this.parent, + renderer = p._renderer, + pos = this._handleAlignment(renderer, line, x, y); + return this.font.getPath( + line, + pos.x, + pos.y, + renderer._textSize, + options, + ); + } /* + * Creates an SVG-formatted path-data string + * (See http://www.w3.org/TR/SVG/paths.html#PathData) + * from the given opentype path or string/position + * + * @param {Object} path an opentype path, OR the following: + * + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional), set options.decimals + * to set the decimal precision of the path-data + * + * @return {Object} this p5.Font object + */, + }, + { + key: "_getPathData", + value: function _getPathData(line, x, y, options) { + var decimals = 3; + // create path from string/position + if (typeof line === "string" && arguments.length > 2) { + line = this._getPath(line, x, y, options); + } else if (_typeof(x) === "object") { + // handle options specified in 2nd arg + options = x; + } // handle svg arguments + + if (options && typeof options.decimals === "number") { + decimals = options.decimals; + } + return line.toPathData(decimals); + } /* + * Creates an SVG element, as a string, + * from the given opentype path or string/position + * + * @param {Object} path an opentype path, OR the following: + * + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional), set options.decimals + * to set the decimal precision of the path-data in the element, + * options.fill to set the fill color for the element, + * options.stroke to set the stroke color for the element, + * options.strokeWidth to set the strokeWidth for the element. + * + * @return {Object} this p5.Font object + */, + }, + { + key: "_getSVG", + value: function _getSVG(line, x, y, options) { + var decimals = 3; + // create path from string/position + if (typeof line === "string" && arguments.length > 2) { + line = this._getPath(line, x, y, options); + } else if (_typeof(x) === "object") { + // handle options specified in 2nd arg + options = x; + } // handle svg arguments + + if (options) { + if (typeof options.decimals === "number") { + decimals = options.decimals; + } + if (typeof options.strokeWidth === "number") { + line.strokeWidth = options.strokeWidth; + } + if (typeof options.fill !== "undefined") { + line.fill = options.fill; + } + if (typeof options.stroke !== "undefined") { + line.stroke = options.stroke; + } + } + return line.toSVG(decimals); + } /* + * Renders an opentype path or string/position + * to the current graphics context + * + * @param {Object} path an opentype path, OR the following: + * + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional) + * + * @return {p5.Font} this p5.Font object + */, + }, + { + key: "_renderPath", + value: function _renderPath(line, x, y, options) { + var pdata; + var pg = + (options && options.renderer) || this.parent._renderer; + var ctx = pg.drawingContext; + if (_typeof(line) === "object" && line.commands) { + pdata = line.commands; + } else { + //pos = handleAlignment(p, ctx, line, x, y); + pdata = this._getPath(line, x, y, options).commands; + } + ctx.beginPath(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = pdata[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var cmd = _step.value; + if (cmd.type === "M") { + ctx.moveTo(cmd.x, cmd.y); + } else if (cmd.type === "L") { + ctx.lineTo(cmd.x, cmd.y); + } else if (cmd.type === "C") { + ctx.bezierCurveTo( + cmd.x1, + cmd.y1, + cmd.x2, + cmd.y2, + cmd.x, + cmd.y, + ); + } else if (cmd.type === "Q") { + ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); + } else if (cmd.type === "Z") { + ctx.closePath(); + } + } // only draw stroke if manually set by user + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (pg._doStroke && pg._strokeSet && !pg._clipping) { + ctx.stroke(); + } + if (pg._doFill && !pg._clipping) { + // if fill hasn't been set by user, use default-text-fill + if (!pg._fillSet) { + pg._setFill(constants._DEFAULT_TEXT_FILL); + } + ctx.fill(); + } + return this; + }, + }, + { + key: "_textWidth", + value: function _textWidth(str, fontSize) { + return this.font.getAdvanceWidth(str, fontSize); + }, + }, + { + key: "_textAscent", + value: function _textAscent(fontSize) { + return this.font.ascender * this._scale(fontSize); + }, + }, + { + key: "_textDescent", + value: function _textDescent(fontSize) { + return -this.font.descender * this._scale(fontSize); + }, + }, + { + key: "_scale", + value: function _scale(fontSize) { + return ( + (1 / this.font.unitsPerEm) * + (fontSize || this.parent._renderer._textSize) + ); + }, + }, + { + key: "_handleAlignment", + value: function _handleAlignment( + renderer, + line, + x, + y, + textWidth, + ) { + var fontSize = renderer._textSize; + if (typeof textWidth === "undefined") { + textWidth = this._textWidth(line, fontSize); + } + switch (renderer._textAlign) { + case constants.CENTER: + x -= textWidth / 2; + break; + case constants.RIGHT: + x -= textWidth; + break; + } + switch (renderer._textBaseline) { + case constants.TOP: + y += this._textAscent(fontSize); + break; + case constants.CENTER: + y += this._textAscent(fontSize) / 2; + break; + case constants.BOTTOM: + y -= this._textDescent(fontSize); + break; + } + return { + x: x, + y: y, + }; + }, + }, + ]); + return _class; + })(); + // path-utils + function pathToPoints(cmds, options) { + var opts = parseOpts(options, { + sampleFactor: 0.1, + simplifyThreshold: 0, + }); + var // total-length + len = pointAtLength(cmds, 0, 1), + t = len / (len * opts.sampleFactor), + pts = []; + for (var i = 0; i < len; i += t) { + pts.push(pointAtLength(cmds, i)); + } + if (opts.simplifyThreshold) { + simplify(pts, opts.simplifyThreshold); + } + return pts; + } + function simplify(pts) { + var angle = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 0; + var num = 0; + for (var i = pts.length - 1; pts.length > 3 && i >= 0; --i) { + if ( + collinear(at(pts, i - 1), at(pts, i), at(pts, i + 1), angle) + ) { + // Remove the middle point + pts.splice(i % pts.length, 1); + num++; + } + } + return num; + } + function splitPaths(cmds) { + var paths = []; + var current; + for (var i = 0; i < cmds.length; i++) { + if (cmds[i].type === "M") { + if (current) { + paths.push(current); + } + current = []; + } + current.push(cmdToArr(cmds[i])); + } + paths.push(current); + return paths; + } + function cmdToArr(cmd) { + var arr = [cmd.type]; + if (cmd.type === "M" || cmd.type === "L") { + // moveto or lineto + arr.push(cmd.x, cmd.y); + } else if (cmd.type === "C") { + arr.push(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + } else if (cmd.type === "Q") { + arr.push(cmd.x1, cmd.y1, cmd.x, cmd.y); + } // else if (cmd.type === 'Z') { /* no-op */ } + + return arr; + } + function parseOpts(options, defaults) { + if (_typeof(options) !== "object") { + options = defaults; + } else { + for (var key in defaults) { + if (typeof options[key] === "undefined") { + options[key] = defaults[key]; + } + } + } + return options; + } //////////////////////// Helpers //////////////////////////// + + function at(v, i) { + var s = v.length; + return v[i < 0 ? (i % s) + s : i % s]; + } + function collinear(a, b, c, thresholdAngle) { + if (!thresholdAngle) { + return areaTriangle(a, b, c) === 0; + } + if (typeof collinear.tmpPoint1 === "undefined") { + collinear.tmpPoint1 = []; + collinear.tmpPoint2 = []; + } + var ab = collinear.tmpPoint1, + bc = collinear.tmpPoint2; + ab.x = b.x - a.x; + ab.y = b.y - a.y; + bc.x = c.x - b.x; + bc.y = c.y - b.y; + var dot = ab.x * bc.x + ab.y * bc.y, + magA = Math.sqrt(ab.x * ab.x + ab.y * ab.y), + magB = Math.sqrt(bc.x * bc.x + bc.y * bc.y), + angle = Math.acos(dot / (magA * magB)); + return angle < thresholdAngle; + } + function areaTriangle(a, b, c) { + return ( + (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]) + ); + } // Portions of below code copyright 2008 Dmitry Baranovskiy (via MIT license) + + function findDotsAtSegment( + p1x, + p1y, + c1x, + c1y, + c2x, + c2y, + p2x, + p2y, + t, + ) { + var t1 = 1 - t; + var t13 = Math.pow(t1, 3); + var t12 = Math.pow(t1, 2); + var t2 = t * t; + var t3 = t2 * t; + var x = + t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x; + var y = + t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y; + var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x); + var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y); + var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x); + var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y); + var ax = t1 * p1x + t * c1x; + var ay = t1 * p1y + t * c1y; + var cx = t1 * c2x + t * p2x; + var cy = t1 * c2y + t * p2y; + var alpha = 90 - (Math.atan2(mx - nx, my - ny) * 180) / Math.PI; + if (mx > nx || my < ny) { + alpha += 180; + } + return { + x: x, + y: y, + m: { + x: mx, + y: my, + }, + n: { + x: nx, + y: ny, + }, + start: { + x: ax, + y: ay, + }, + end: { + x: cx, + y: cy, + }, + alpha: alpha, + }; + } + function getPointAtSegmentLength( + p1x, + p1y, + c1x, + c1y, + c2x, + c2y, + p2x, + p2y, + length, + ) { + return length == null + ? bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) + : findDotsAtSegment( + p1x, + p1y, + c1x, + c1y, + c2x, + c2y, + p2x, + p2y, + getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length), + ); + } + function pointAtLength(path, length, istotal) { + path = path2curve(path); + var x; + var y; + var p; + var l; + var sp = ""; + var subpaths = {}; + var point; + var len = 0; + for (var i = 0, ii = path.length; i < ii; i++) { + p = path[i]; + if (p[0] === "M") { + x = +p[1]; + y = +p[2]; + } else { + l = getPointAtSegmentLength( + x, + y, + p[1], + p[2], + p[3], + p[4], + p[5], + p[6], + ); + if (len + l > length) { + if (!istotal) { + point = getPointAtSegmentLength( + x, + y, + p[1], + p[2], + p[3], + p[4], + p[5], + p[6], + length - len, + ); + return { + x: point.x, + y: point.y, + alpha: point.alpha, + }; + } + } + len += l; + x = +p[5]; + y = +p[6]; + } + sp += p.shift() + p; + } + subpaths.end = sp; + point = istotal + ? len + : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); + if (point.alpha) { + point = { + x: point.x, + y: point.y, + alpha: point.alpha, + }; + } + return point; + } + function pathToAbsolute(pathArray) { + var res = [], + x = 0, + y = 0, + mx = 0, + my = 0, + start = 0; + if (!pathArray) { + // console.warn("Unexpected state: undefined pathArray"); // shouldn't happen + return res; + } + if (pathArray[0][0] === "M") { + x = +pathArray[0][1]; + y = +pathArray[0][2]; + mx = x; + my = y; + start++; + res[0] = ["M", x, y]; + } + var dots; + var crz = + pathArray.length === 3 && + pathArray[0][0] === "M" && + pathArray[1][0].toUpperCase() === "R" && + pathArray[2][0].toUpperCase() === "Z"; + for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) { + res.push((r = [])); + pa = pathArray[i]; + if (pa[0] !== String.prototype.toUpperCase.call(pa[0])) { + r[0] = String.prototype.toUpperCase.call(pa[0]); + switch (r[0]) { + case "A": + r[1] = pa[1]; + r[2] = pa[2]; + r[3] = pa[3]; + r[4] = pa[4]; + r[5] = pa[5]; + r[6] = +(pa[6] + x); + r[7] = +(pa[7] + y); + break; + case "V": + r[1] = +pa[1] + y; + break; + case "H": + r[1] = +pa[1] + x; + break; + case "R": + dots = [x, y].concat(pa.slice(1)); + for (var j = 2, jj = dots.length; j < jj; j++) { + dots[j] = +dots[j] + x; + dots[++j] = +dots[j] + y; + } + res.pop(); + res = res.concat(catmullRom2bezier(dots, crz)); + break; + case "M": + mx = +pa[1] + x; + my = +pa[2] + y; + break; + default: + for (var _j = 1, _jj = pa.length; _j < _jj; _j++) { + r[_j] = +pa[_j] + (_j % 2 ? x : y); + } + } + } else if (pa[0] === "R") { + dots = [x, y].concat(pa.slice(1)); + res.pop(); + res = res.concat(catmullRom2bezier(dots, crz)); + r = ["R"].concat(pa.slice(-2)); + } else { + for (var k = 0, kk = pa.length; k < kk; k++) { + r[k] = pa[k]; + } + } + switch (r[0]) { + case "Z": + x = mx; + y = my; + break; + case "H": + x = r[1]; + break; + case "V": + y = r[1]; + break; + case "M": + mx = r[r.length - 2]; + my = r[r.length - 1]; + break; + default: + x = r[r.length - 2]; + y = r[r.length - 1]; + } + } + return res; + } + function path2curve(path, path2) { + var p = pathToAbsolute(path), + p2 = path2 && pathToAbsolute(path2); + var attrs = { + x: 0, + y: 0, + bx: 0, + by: 0, + X: 0, + Y: 0, + qx: null, + qy: null, + }; + var attrs2 = { + x: 0, + y: 0, + bx: 0, + by: 0, + X: 0, + Y: 0, + qx: null, + qy: null, + }; + var pcoms1 = []; // path commands of original path p + var pcoms2 = []; // path commands of original path p2 + var ii; + var processPath = function processPath(path, d, pcom) { + var nx; + var ny; + var tq = { + T: 1, + Q: 1, + }; + if (!path) { + return ["C", d.x, d.y, d.x, d.y, d.x, d.y]; + } + if (!(path[0] in tq)) { + d.qx = d.qy = null; + } + switch (path[0]) { + case "M": + d.X = path[1]; + d.Y = path[2]; + break; + case "A": + path = ["C"].concat( + a2c.apply(0, [d.x, d.y].concat(path.slice(1))), + ); + break; + case "S": + if (pcom === "C" || pcom === "S") { + nx = d.x * 2 - d.bx; + ny = d.y * 2 - d.by; + } else { + nx = d.x; + ny = d.y; + } + path = ["C", nx, ny].concat(path.slice(1)); + break; + case "T": + if (pcom === "Q" || pcom === "T") { + d.qx = d.x * 2 - d.qx; + d.qy = d.y * 2 - d.qy; + } else { + d.qx = d.x; + d.qy = d.y; + } + path = ["C"].concat( + q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]), + ); + break; + case "Q": + d.qx = path[1]; + d.qy = path[2]; + path = ["C"].concat( + q2c(d.x, d.y, path[1], path[2], path[3], path[4]), + ); + break; + case "L": + path = ["C"].concat(l2c(d.x, d.y, path[1], path[2])); + break; + case "H": + path = ["C"].concat(l2c(d.x, d.y, path[1], d.y)); + break; + case "V": + path = ["C"].concat(l2c(d.x, d.y, d.x, path[1])); + break; + case "Z": + path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y)); + break; + } + return path; + }, + fixArc = function fixArc(pp, i) { + if (pp[i].length > 7) { + pp[i].shift(); + var pi = pp[i]; + while (pi.length) { + pcoms1[i] = "A"; + if (p2) { + pcoms2[i] = "A"; + } + pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6))); + } + pp.splice(i, 1); + ii = Math.max(p.length, (p2 && p2.length) || 0); + } + }, + fixM = function fixM(path1, path2, a1, a2, i) { + if ( + path1 && + path2 && + path1[i][0] === "M" && + path2[i][0] !== "M" + ) { + path2.splice(i, 0, ["M", a2.x, a2.y]); + a1.bx = 0; + a1.by = 0; + a1.x = path1[i][1]; + a1.y = path1[i][2]; + ii = Math.max(p.length, (p2 && p2.length) || 0); + } + }; + var pfirst = ""; // temporary holder for original path command + var pcom = ""; // holder for previous path command of original path + ii = Math.max(p.length, (p2 && p2.length) || 0); + for (var i = 0; i < ii; i++) { + if (p[i]) { + pfirst = p[i][0]; + } // save current path command + + if (pfirst !== "C") { + pcoms1[i] = pfirst; // Save current path command + if (i) { + pcom = pcoms1[i - 1]; + } // Get previous path command pcom + } + p[i] = processPath(p[i], attrs, pcom); + if (pcoms1[i] !== "A" && pfirst === "C") { + pcoms1[i] = "C"; + } + fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1 + if (p2) { + // the same procedures is done to p2 + if (p2[i]) { + pfirst = p2[i][0]; + } + if (pfirst !== "C") { + pcoms2[i] = pfirst; + if (i) { + pcom = pcoms2[i - 1]; + } + } + p2[i] = processPath(p2[i], attrs2, pcom); + if (pcoms2[i] !== "A" && pfirst === "C") { + pcoms2[i] = "C"; + } + fixArc(p2, i); + } + fixM(p, p2, attrs, attrs2, i); + fixM(p2, p, attrs2, attrs, i); + var seg = p[i], + seg2 = p2 && p2[i], + seglen = seg.length, + seg2len = p2 && seg2.length; + attrs.x = seg[seglen - 2]; + attrs.y = seg[seglen - 1]; + attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x; + attrs.by = parseFloat(seg[seglen - 3]) || attrs.y; + attrs2.bx = p2 && (parseFloat(seg2[seg2len - 4]) || attrs2.x); + attrs2.by = p2 && (parseFloat(seg2[seg2len - 3]) || attrs2.y); + attrs2.x = p2 && seg2[seg2len - 2]; + attrs2.y = p2 && seg2[seg2len - 1]; + } + return p2 ? [p, p2] : p; + } + function a2c( + x1, + y1, + rx, + ry, + angle, + lac, + sweep_flag, + x2, + y2, + recursive, + ) { + // for more information of where this Math came from visit: + // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes + var PI = Math.PI; + var _120 = (PI * 120) / 180; + var f1; + var f2; + var cx; + var cy; + var rad = (PI / 180) * (+angle || 0); + var res = []; + var xy; + var rotate = function rotate(x, y, rad) { + var X = x * Math.cos(rad) - y * Math.sin(rad), + Y = x * Math.sin(rad) + y * Math.cos(rad); + return { + x: X, + y: Y, + }; + }; + if (!recursive) { + xy = rotate(x1, y1, -rad); + x1 = xy.x; + y1 = xy.y; + xy = rotate(x2, y2, -rad); + x2 = xy.x; + y2 = xy.y; + var x = (x1 - x2) / 2; + var y = (y1 - y2) / 2; + var h = (x * x) / (rx * rx) + (y * y) / (ry * ry); + if (h > 1) { + h = Math.sqrt(h); + rx = h * rx; + ry = h * ry; + } + var rx2 = rx * rx, + ry2 = ry * ry; + var k = + (lac === sweep_flag ? -1 : 1) * + Math.sqrt( + Math.abs( + (rx2 * ry2 - rx2 * y * y - ry2 * x * x) / + (rx2 * y * y + ry2 * x * x), + ), + ); + cx = (k * rx * y) / ry + (x1 + x2) / 2; + cy = (k * -ry * x) / rx + (y1 + y2) / 2; + f1 = Math.asin(((y1 - cy) / ry).toFixed(9)); + f2 = Math.asin(((y2 - cy) / ry).toFixed(9)); + f1 = x1 < cx ? PI - f1 : f1; + f2 = x2 < cx ? PI - f2 : f2; + if (f1 < 0) { + f1 = PI * 2 + f1; + } + if (f2 < 0) { + f2 = PI * 2 + f2; + } + if (sweep_flag && f1 > f2) { + f1 = f1 - PI * 2; + } + if (!sweep_flag && f2 > f1) { + f2 = f2 - PI * 2; + } + } else { + f1 = recursive[0]; + f2 = recursive[1]; + cx = recursive[2]; + cy = recursive[3]; + } + var df = f2 - f1; + if (Math.abs(df) > _120) { + var f2old = f2, + x2old = x2, + y2old = y2; + f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1); + x2 = cx + rx * Math.cos(f2); + y2 = cy + ry * Math.sin(f2); + res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [ + f2, + f2old, + cx, + cy, + ]); + } + df = f2 - f1; + var c1 = Math.cos(f1), + s1 = Math.sin(f1), + c2 = Math.cos(f2), + s2 = Math.sin(f2), + t = Math.tan(df / 4), + hx = (4 / 3) * rx * t, + hy = (4 / 3) * ry * t, + m1 = [x1, y1], + m2 = [x1 + hx * s1, y1 - hy * c1], + m3 = [x2 + hx * s2, y2 - hy * c2], + m4 = [x2, y2]; + m2[0] = 2 * m1[0] - m2[0]; + m2[1] = 2 * m1[1] - m2[1]; + if (recursive) { + return [m2, m3, m4].concat(res); + } else { + res = [m2, m3, m4].concat(res).join().split(","); + var newres = []; + for (var i = 0, ii = res.length; i < ii; i++) { + newres[i] = + i % 2 + ? rotate(res[i - 1], res[i], rad).y + : rotate(res[i], res[i + 1], rad).x; + } + return newres; + } + } // http://schepers.cc/getting-to-the-point + + function catmullRom2bezier(crp, z) { + var d = []; + for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) { + var p = [ + { + x: +crp[i - 2], + y: +crp[i - 1], + }, + { + x: +crp[i], + y: +crp[i + 1], + }, + { + x: +crp[i + 2], + y: +crp[i + 3], + }, + { + x: +crp[i + 4], + y: +crp[i + 5], + }, + ]; + if (z) { + if (!i) { + p[0] = { + x: +crp[iLen - 2], + y: +crp[iLen - 1], + }; + } else if (iLen - 4 === i) { + p[3] = { + x: +crp[0], + y: +crp[1], + }; + } else if (iLen - 2 === i) { + p[2] = { + x: +crp[0], + y: +crp[1], + }; + p[3] = { + x: +crp[2], + y: +crp[3], + }; + } + } else { + if (iLen - 4 === i) { + p[3] = p[2]; + } else if (!i) { + p[0] = { + x: +crp[i], + y: +crp[i + 1], + }; + } + } + d.push([ + "C", + (-p[0].x + 6 * p[1].x + p[2].x) / 6, + (-p[0].y + 6 * p[1].y + p[2].y) / 6, + (p[1].x + 6 * p[2].x - p[3].x) / 6, + (p[1].y + 6 * p[2].y - p[3].y) / 6, + p[2].x, + p[2].y, + ]); + } + return d; + } + function l2c(x1, y1, x2, y2) { + return [x1, y1, x2, y2, x2, y2]; + } + function q2c(x1, y1, ax, ay, x2, y2) { + var _13 = 1 / 3, + _23 = 2 / 3; + return [ + _13 * x1 + _23 * ax, + _13 * y1 + _23 * ay, + _13 * x2 + _23 * ax, + _13 * y2 + _23 * ay, + x2, + y2, + ]; + } + function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) { + if (z == null) { + z = 1; + } + z = z > 1 ? 1 : z < 0 ? 0 : z; + var z2 = z / 2; + var n = 12; + var Tvalues = [ + -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, + 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, + ]; + var sum = 0; + var Cvalues = [ + 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, + 0.1069, 0.1069, 0.0472, 0.0472, + ]; + for (var i = 0; i < n; i++) { + var ct = z2 * Tvalues[i] + z2, + xbase = base3(ct, x1, x2, x3, x4), + ybase = base3(ct, y1, y2, y3, y4), + comb = xbase * xbase + ybase * ybase; + sum += Cvalues[i] * Math.sqrt(comb); + } + return z2 * sum; + } + function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) { + if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) { + return; + } + var t = 1; + var step = t / 2; + var t2 = t - step; + var l; + var e = 0.01; + l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); + while (Math.abs(l - ll) > e) { + step /= 2; + t2 += (l < ll ? 1 : -1) * step; + l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); + } + return t2; + } + function base3(t, p1, p2, p3, p4) { + var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, + t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3; + return t * t2 - 3 * p1 + 3 * p2; + } + function cacheKey() { + var hash = ""; + for (var i = arguments.length - 1; i >= 0; --i) { + hash += "?".concat( + i < 0 || arguments.length <= i ? undefined : arguments[i], + ); + } + return hash; + } + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.number.to-fixed": 193, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 337: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.array-buffer.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.array-buffer.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Data + * @submodule Array Functions + * @for p5 + * @requires core + */ + /** + * Adds a value to the end of an array. Extends the length of + * the array by one. Maps to Array.push(). + * + * @method append + * @deprecated Use array.push(value) instead. + * @param {Array} array Array to append + * @param {any} value to be added to the Array + * @return {Array} the array that was appended to + * @example + *
                    + * function setup() { + * let myArray = ['Mango', 'Apple', 'Papaya']; + * print(myArray); // ['Mango', 'Apple', 'Papaya'] + * + * append(myArray, 'Peach'); + * print(myArray); // ['Mango', 'Apple', 'Papaya', 'Peach'] + * } + *
                    + */ + + _main.default.prototype.append = function (array, value) { + array.push(value); + return array; + }; + /** + * Copies an array (or part of an array) to another array. The src array is + * copied to the dst array, beginning at the position specified by + * srcPosition and into the position specified by dstPosition. The number of + * elements to copy is determined by length. Note that copying values + * overwrites existing values in the destination array. To append values + * instead of overwriting them, use concat(). + * + * The simplified version with only two arguments, arrayCopy(src, dst), + * copies an entire array to another of the same size. It is equivalent to + * arrayCopy(src, 0, dst, 0, src.length). + * + * Using this function is far more efficient for copying array data than + * iterating through a for() loop and copying each element individually. + * + * @method arrayCopy + * @deprecated Use arr1.copyWithin(arr2) instead. + * @param {Array} src the source Array + * @param {Integer} srcPosition starting position in the source Array + * @param {Array} dst the destination Array + * @param {Integer} dstPosition starting position in the destination Array + * @param {Integer} length number of Array elements to be copied + * + * @example + *
                    + * let src = ['A', 'B', 'C']; + * let dst = [1, 2, 3]; + * let srcPosition = 1; + * let dstPosition = 0; + * let length = 2; + * + * print(src); // ['A', 'B', 'C'] + * print(dst); // [ 1 , 2 , 3 ] + * + * arrayCopy(src, srcPosition, dst, dstPosition, length); + * print(dst); // ['B', 'C', 3] + *
                    + */ + /** + * @method arrayCopy + * @deprecated Use arr1.copyWithin(arr2) instead. + * @param {Array} src + * @param {Array} dst + * @param {Integer} [length] + */ + _main.default.prototype.arrayCopy = function ( + src, + srcPosition, + dst, + dstPosition, + length, + ) { + // the index to begin splicing from dst array + var start; + var end; + if (typeof length !== "undefined") { + end = Math.min(length, src.length); + start = dstPosition; + src = src.slice(srcPosition, end + srcPosition); + } else { + if (typeof dst !== "undefined") { + // src, dst, length + // rename so we don't get confused + end = dst; + end = Math.min(end, src.length); + } else { + // src, dst + end = src.length; + } + start = 0; + // rename so we don't get confused + dst = srcPosition; + src = src.slice(0, end); + } // Since we are not returning the array and JavaScript is pass by reference + // we must modify the actual values of the array + // instead of reassigning arrays + + Array.prototype.splice.apply(dst, [start, end].concat(src)); + }; + /** + * Concatenates two arrays, maps to Array.concat(). Does not modify the + * input arrays. + * + * @method concat + * @deprecated Use arr1.concat(arr2) instead. + * @param {Array} a first Array to concatenate + * @param {Array} b second Array to concatenate + * @return {Array} concatenated array + * + * @example + *
                    + * function setup() { + * let arr1 = ['A', 'B', 'C']; + * let arr2 = [1, 2, 3]; + * + * print(arr1); // ['A','B','C'] + * print(arr2); // [1,2,3] + * + * let arr3 = concat(arr1, arr2); + * + * print(arr1); // ['A','B','C'] + * print(arr2); // [1, 2, 3] + * print(arr3); // ['A','B','C', 1, 2, 3] + * } + *
                    + */ + _main.default.prototype.concat = function (list0, list1) { + return list0.concat(list1); + }; + /** + * Reverses the order of an array, maps to Array.reverse() + * + * @method reverse + * @deprecated Use array.reverse() instead. + * @param {Array} list Array to reverse + * @return {Array} the reversed list + * @example + *
                    + * function setup() { + * let myArray = ['A', 'B', 'C']; + * print(myArray); // ['A','B','C'] + * + * reverse(myArray); + * print(myArray); // ['C','B','A'] + * } + *
                    + */ + _main.default.prototype.reverse = function (list) { + return list.reverse(); + }; + /** + * Decreases an array by one element and returns the shortened array, + * maps to Array.pop(). + * + * @method shorten + * @deprecated Use array.pop() instead. + * @param {Array} list Array to shorten + * @return {Array} shortened Array + * @example + *
                    + * function setup() { + * let myArray = ['A', 'B', 'C']; + * print(myArray); // ['A', 'B', 'C'] + * let newArray = shorten(myArray); + * print(myArray); // ['A','B','C'] + * print(newArray); // ['A','B'] + * } + *
                    + */ + _main.default.prototype.shorten = function (list) { + list.pop(); + return list; + }; + /** + * Randomizes the order of the elements of an array. Implements + * + * Fisher-Yates Shuffle Algorithm. + * + * @method shuffle + * @param {Array} array Array to shuffle + * @param {Boolean} [bool] modify passed array + * @return {Array} shuffled Array + * @example + *
                    + * function setup() { + * let regularArr = ['ABC', 'def', createVector(), TAU, Math.E]; + * print(regularArr); + * shuffle(regularArr, true); // force modifications to passed array + * print(regularArr); + * + * // By default shuffle() returns a shuffled cloned array: + * let newArr = shuffle(regularArr); + * print(regularArr); + * print(newArr); + * } + *
                    + */ + _main.default.prototype.shuffle = function (arr, bool) { + var isView = + ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(arr); + arr = bool || isView ? arr : arr.slice(); + var rnd, + tmp, + idx = arr.length; + while (idx > 1) { + rnd = (this.random(0, 1) * idx) | 0; + tmp = arr[--idx]; + arr[idx] = arr[rnd]; + arr[rnd] = tmp; + } + return arr; + }; + /** + * Sorts an array of numbers from smallest to largest, or puts an array of + * words in alphabetical order. The original array is not modified; a + * re-ordered array is returned. The count parameter states the number of + * elements to sort. For example, if there are 12 elements in an array and + * count is set to 5, only the first 5 elements in the array will be sorted. + * + * @method sort + * @deprecated Use array.sort() instead. + * @param {Array} list Array to sort + * @param {Integer} [count] number of elements to sort, starting from 0 + * @return {Array} the sorted list + * + * @example + *
                    + * function setup() { + * let words = ['banana', 'apple', 'pear', 'lime']; + * print(words); // ['banana', 'apple', 'pear', 'lime'] + * let count = 4; // length of array + * + * words = sort(words, count); + * print(words); // ['apple', 'banana', 'lime', 'pear'] + * } + *
                    + *
                    + * function setup() { + * let numbers = [2, 6, 1, 5, 14, 9, 8, 12]; + * print(numbers); // [2, 6, 1, 5, 14, 9, 8, 12] + * let count = 5; // Less than the length of the array + * + * numbers = sort(numbers, count); + * print(numbers); // [1,2,5,6,14,9,8,12] + * } + *
                    + */ + _main.default.prototype.sort = function (list, count) { + var arr = count + ? list.slice(0, Math.min(count, list.length)) + : list; + var rest = count ? list.slice(Math.min(count, list.length)) : []; + if (typeof arr[0] === "string") { + arr = arr.sort(); + } else { + arr = arr.sort(function (a, b) { + return a - b; + }); + } + return arr.concat(rest); + }; + /** + * Inserts a value or an array of values into an existing array. The first + * parameter specifies the initial array to be modified, and the second + * parameter defines the data to be inserted. The third parameter is an index + * value which specifies the array position from which to insert data. + * (Remember that array index numbering starts at zero, so the first position + * is 0, the second position is 1, and so on.) + * + * @method splice + * @deprecated Use array.splice() instead. + * @param {Array} list Array to splice into + * @param {any} value value to be spliced in + * @param {Integer} position in the array from which to insert data + * @return {Array} the list + * + * @example + *
                    + * function setup() { + * let myArray = [0, 1, 2, 3, 4]; + * let insArray = ['A', 'B', 'C']; + * print(myArray); // [0, 1, 2, 3, 4] + * print(insArray); // ['A','B','C'] + * + * splice(myArray, insArray, 3); + * print(myArray); // [0,1,2,'A','B','C',3,4] + * } + *
                    + */ + _main.default.prototype.splice = function (list, value, index) { + // note that splice returns spliced elements and not an array + Array.prototype.splice.apply(list, [index, 0].concat(value)); + return list; + }; + /** + * Extracts an array of elements from an existing array. The list parameter + * defines the array from which the elements will be copied, and the start + * and count parameters specify which elements to extract. If no count is + * given, elements will be extracted from the start to the end of the array. + * When specifying the start, remember that the first array element is 0. + * This function does not change the source array. + * + * @method subset + * @deprecated Use array.slice() instead. + * @param {Array} list Array to extract from + * @param {Integer} start position to begin + * @param {Integer} [count] number of values to extract + * @return {Array} Array of extracted elements + * + * @example + *
                    + * function setup() { + * let myArray = [1, 2, 3, 4, 5]; + * print(myArray); // [1, 2, 3, 4, 5] + * + * let sub1 = subset(myArray, 0, 3); + * let sub2 = subset(myArray, 2, 2); + * print(sub1); // [1,2,3] + * print(sub2); // [3,4] + * } + *
                    + */ + _main.default.prototype.subset = function (list, start, count) { + if (typeof count !== "undefined") { + return list.slice(start, start + count); + } else { + return list.slice(start, list.length); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array-buffer.constructor": 168, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.object.to-string": 200, + }, + ], + 338: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.repeat"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.number.constructor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.repeat"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Data + * @submodule Conversion + * @for p5 + * @requires core + */ + /** + * Converts a string to its floating point representation. The contents of a + * string must resemble a number, or NaN (not a number) will be returned. + * For example, float("1234.56") evaluates to 1234.56, but float("giraffe") + * will return NaN. + * + * When an array of values is passed in, then an array of floats of the same + * length is returned. + * + * @method float + * @param {String} str float string to parse + * @return {Number} floating point representation of string + * @example + *
                    + * let str = '20'; + * let diameter = float(str); + * ellipse(width / 2, height / 2, diameter, diameter); + * describe('20-by-20 white ellipse in the center of the canvas'); + *
                    + *
                    + * print(float('10.31')); // 10.31 + * print(float('Infinity')); // Infinity + * print(float('-Infinity')); // -Infinity + *
                    + */ + + _main.default.prototype.float = function (str) { + if (str instanceof Array) { + return str.map(parseFloat); + } + return parseFloat(str); + }; + /** + * Converts a boolean, string, or float to its integer representation. + * When an array of values is passed in, then an int array of the same length + * is returned. + * + * @method int + * @param {String|Boolean|Number} n value to parse + * @param {Integer} [radix] the radix to convert to (default: 10) + * @return {Number} integer representation of value + * + * @example + *
                    + * print(int('10')); // 10 + * print(int(10.31)); // 10 + * print(int(-10)); // -10 + * print(int(true)); // 1 + * print(int(false)); // 0 + * print(int([false, true, '10.3', 9.8])); // [0, 1, 10, 9] + * print(int(Infinity)); // Infinity + * print(int('-Infinity')); // -Infinity + *
                    + */ + /** + * @method int + * @param {Array} ns values to parse + * @param {Integer} [radix] + * @return {Number[]} integer representation of values + */ + _main.default.prototype.int = function (n) { + var radix = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : 10; + if (n === Infinity || n === "Infinity") { + return Infinity; + } else if (n === -Infinity || n === "-Infinity") { + return -Infinity; + } else if (typeof n === "string") { + return parseInt(n, radix); + } else if (typeof n === "number") { + return n | 0; + } else if (typeof n === "boolean") { + return n ? 1 : 0; + } else if (n instanceof Array) { + return n.map(function (n) { + return _main.default.prototype.int(n, radix); + }); + } + }; + /** + * Converts a boolean, string or number to its string representation. + * When an array of values is passed in, then an array of strings of the same + * length is returned. + * + * @method str + * @param {String|Boolean|Number|Array} n value to parse + * @return {String} string representation of value + * @example + *
                    + * print(str('10')); // "10" + * print(str(10.31)); // "10.31" + * print(str(-10)); // "-10" + * print(str(true)); // "true" + * print(str(false)); // "false" + * print(str([true, '10.3', 9.8])); // [ "true", "10.3", "9.8" ] + *
                    + */ + _main.default.prototype.str = function (n) { + if (n instanceof Array) { + return n.map(_main.default.prototype.str); + } else { + return String(n); + } + }; + /** + * Converts a number or string to its boolean representation. + * For a number, any non-zero value (positive or negative) evaluates to true, + * while zero evaluates to false. For a string, the value "true" evaluates to + * true, while any other value evaluates to false. When an array of number or + * string values is passed in, then a array of booleans of the same length is + * returned. + * + * @method boolean + * @param {String|Boolean|Number|Array} n value to parse + * @return {Boolean} boolean representation of value + * @example + *
                    + * print(boolean(0)); // false + * print(boolean(1)); // true + * print(boolean('true')); // true + * print(boolean('abcd')); // false + * print(boolean([0, 12, 'true'])); // [false, true, true] + *
                    + */ + _main.default.prototype.boolean = function (n) { + if (typeof n === "number") { + return n !== 0; + } else if (typeof n === "string") { + return n.toLowerCase() === "true"; + } else if (typeof n === "boolean") { + return n; + } else if (n instanceof Array) { + return n.map(_main.default.prototype.boolean); + } + }; + /** + * Converts a number, string representation of a number, or boolean to its byte + * representation. A byte can be only a whole number between -128 and 127, so + * when a value outside of this range is converted, it wraps around to the + * corresponding byte representation. When an array of number, string or boolean + * values is passed in, then an array of bytes the same length is returned. + * + * @method byte + * @param {String|Boolean|Number} n value to parse + * @return {Number} byte representation of value + * + * @example + *
                    + * print(byte(127)); // 127 + * print(byte(128)); // -128 + * print(byte(23.4)); // 23 + * print(byte('23.4')); // 23 + * print(byte('hello')); // NaN + * print(byte(true)); // 1 + * print(byte([0, 255, '100'])); // [0, -1, 100] + *
                    + */ + /** + * @method byte + * @param {Array} ns values to parse + * @return {Number[]} array of byte representation of values + */ + _main.default.prototype.byte = function (n) { + var nn = _main.default.prototype.int(n, 10); + if (typeof nn === "number") { + return ((nn + 128) % 256) - 128; + } else if (nn instanceof Array) { + return nn.map(_main.default.prototype.byte); + } + }; + /** + * Converts a number or string to its corresponding single-character + * string representation. If a string parameter is provided, it is first + * parsed as an integer and then translated into a single-character string. + * When an array of number or string values is passed in, then an array of + * single-character strings of the same length is returned. + * + * @method char + * @param {String|Number} n value to parse + * @return {String} string representation of value + * + * @example + *
                    + * print(char(65)); // "A" + * print(char('65')); // "A" + * print(char([65, 66, 67])); // [ "A", "B", "C" ] + * print(join(char([65, 66, 67]), '')); // "ABC" + *
                    + */ + /** + * @method char + * @param {Array} ns values to parse + * @return {String[]} array of string representation of values + */ + _main.default.prototype.char = function (n) { + if (typeof n === "number" && !isNaN(n)) { + return String.fromCharCode(n); + } else if (n instanceof Array) { + return n.map(_main.default.prototype.char); + } else if (typeof n === "string") { + return _main.default.prototype.char(parseInt(n, 10)); + } + }; + /** + * Converts a single-character string to its corresponding integer + * representation. When an array of single-character string values is passed + * in, then an array of integers of the same length is returned. + * + * @method unchar + * @param {String} n value to parse + * @return {Number} integer representation of value + * + * @example + *
                    + * print(unchar('A')); // 65 + * print(unchar(['A', 'B', 'C'])); // [ 65, 66, 67 ] + * print(unchar(split('ABC', ''))); // [ 65, 66, 67 ] + *
                    + */ + /** + * @method unchar + * @param {Array} ns values to parse + * @return {Number[]} integer representation of values + */ + _main.default.prototype.unchar = function (n) { + if (typeof n === "string" && n.length === 1) { + return n.charCodeAt(0); + } else if (n instanceof Array) { + return n.map(_main.default.prototype.unchar); + } + }; + /** + * Converts a number to a string in its equivalent hexadecimal notation. If a + * second parameter is passed, it is used to set the number of characters to + * generate in the hexadecimal notation. When an array is passed in, an + * array of strings in hexadecimal notation of the same length is returned. + * + * @method hex + * @param {Number} n value to parse + * @param {Number} [digits] + * @return {String} hexadecimal string representation of value + * + * @example + *
                    + * print(hex(255)); // "000000FF" + * print(hex(255, 6)); // "0000FF" + * print(hex([0, 127, 255], 6)); // [ "000000", "00007F", "0000FF" ] + * print(Infinity); // "FFFFFFFF" + * print(-Infinity); // "00000000" + *
                    + */ + /** + * @method hex + * @param {Number[]} ns array of values to parse + * @param {Number} [digits] + * @return {String[]} hexadecimal string representation of values + */ + _main.default.prototype.hex = function (n, digits) { + digits = + digits === undefined || digits === null ? (digits = 8) : digits; + if (n instanceof Array) { + return n.map(function (n) { + return _main.default.prototype.hex(n, digits); + }); + } else if (n === Infinity || n === -Infinity) { + var c = n === Infinity ? "F" : "0"; + return c.repeat(digits); + } else if (typeof n === "number") { + if (n < 0) { + n = 4294967295 + n + 1; + } + var hex = Number(n).toString(16).toUpperCase(); + while (hex.length < digits) { + hex = "0".concat(hex); + } + if (hex.length >= digits) { + hex = hex.substring(hex.length - digits, hex.length); + } + return hex; + } + }; + /** + * Converts a string representation of a hexadecimal number to its equivalent + * integer value. When an array of strings in hexadecimal notation is passed + * in, an array of integers of the same length is returned. + * + * @method unhex + * @param {String} n value to parse + * @return {Number} integer representation of hexadecimal value + * + * @example + *
                    + * print(unhex('A')); // 10 + * print(unhex('FF')); // 255 + * print(unhex(['FF', 'AA', '00'])); // [ 255, 170, 0 ] + *
                    + */ + /** + * @method unhex + * @param {Array} ns values to parse + * @return {Number[]} integer representations of hexadecimal value + */ + _main.default.prototype.unhex = function (n) { + if (n instanceof Array) { + return n.map(_main.default.prototype.unhex); + } else { + return parseInt("0x".concat(n), 16); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.number.constructor": 191, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.repeat": 213, + }, + ], + 339: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.pad-start"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.array.filter"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.constructor"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.pad-start"); + _dereq_("core-js/modules/es.string.replace"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + _dereq_("../core/friendly_errors/validate_params"); + _dereq_("../core/friendly_errors/file_errors"); + _dereq_("../core/friendly_errors/fes_core"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _slicedToArray(arr, i) { + return ( + _arrayWithHoles(arr) || + _iterableToArrayLimit(arr, i) || + _nonIterableRest() + ); + } + function _nonIterableRest() { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance", + ); + } + function _iterableToArrayLimit(arr, i) { + if ( + !( + Symbol.iterator in Object(arr) || + Object.prototype.toString.call(arr) === "[object Arguments]" + ) + ) { + return; + } + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for ( + var _i = arr[Symbol.iterator](), _s; + !(_n = (_s = _i.next()).done); + _n = true + ) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } /** + * @module Data + * @submodule String Functions + * @for p5 + * @requires core + */ + //return p5; //LM is this a mistake? + /** + * Combines an array of Strings into one String, each separated by the + * character(s) used for the separator parameter. To join arrays of ints or + * floats, it's necessary to first convert them to Strings using nf() or + * nfs(). + * + * @method join + * @param {Array} list array of Strings to be joined + * @param {String} separator String to be placed between each item + * @return {String} joined String + * @example + *
                    + * + * let array = ['Hello', 'world!']; + * let separator = ' '; + * let message = join(array, separator); + * text(message, 5, 50); + * describe('“Hello world!” displayed middle left of canvas.'); + * + *
                    + */ + + _main.default.prototype.join = function (list, separator) { + _main.default._validateParameters("join", arguments); + return list.join(separator); + }; + /** + * This function is used to apply a regular expression to a piece of text, + * and return matching groups (elements found inside parentheses) as a + * String array. If there are no matches, a null value will be returned. + * If no groups are specified in the regular expression, but the sequence + * matches, an array of length 1 (with the matched text as the first element + * of the array) will be returned. + * + * To use the function, first check to see if the result is null. If the + * result is null, then the sequence did not match at all. If the sequence + * did match, an array is returned. + * + * If there are groups (specified by sets of parentheses) in the regular + * expression, then the contents of each will be returned in the array. + * Element [0] of a regular expression match returns the entire matching + * string, and the match groups start at element [1] (the first group is [1], + * the second [2], and so on). + * + * @method match + * @param {String} str the String to be searched + * @param {String} regexp the regexp to be used for matching + * @return {String[]} Array of Strings found + * @example + *
                    + * + * let string = 'Hello p5js*!'; + * let regexp = 'p5js\\*'; + * let m = match(string, regexp); + * text(m, 5, 50); + * describe('“p5js*” displayed middle left of canvas.'); + * + *
                    + */ + _main.default.prototype.match = function (str, reg) { + _main.default._validateParameters("match", arguments); + return str.match(reg); + }; + /** + * This function is used to apply a regular expression to a piece of text, + * and return a list of matching groups (elements found inside parentheses) + * as a two-dimensional String array. If there are no matches, a null value + * will be returned. If no groups are specified in the regular expression, + * but the sequence matches, a two dimensional array is still returned, but + * the second dimension is only of length one. + * + * To use the function, first check to see if the result is null. If the + * result is null, then the sequence did not match at all. If the sequence + * did match, a 2D array is returned. + * + * If there are groups (specified by sets of parentheses) in the regular + * expression, then the contents of each will be returned in the array. + * Assuming a loop with counter variable i, element [i][0] of a regular + * expression match returns the entire matching string, and the match groups + * start at element [i][1] (the first group is [i][1], the second [i][2], + * and so on). + * + * @method matchAll + * @param {String} str the String to be searched + * @param {String} regexp the regexp to be used for matching + * @return {String[]} 2d Array of Strings found + * @example + *
                    + * + * let string = 'Hello p5js*! Hello world!'; + * let regexp = 'Hello'; + * matchAll(string, regexp); + * + *
                    + */ + _main.default.prototype.matchAll = function (str, reg) { + _main.default._validateParameters("matchAll", arguments); + var re = new RegExp(reg, "g"); + var match = re.exec(str); + var matches = []; + while (match !== null) { + matches.push(match); + // matched text: match[0] + // match start: match.index + // capturing group n: match[n] + match = re.exec(str); + } + return matches; + }; + /** + * Utility function for formatting numbers into strings. There are two + * versions: one for formatting floats, and one for formatting ints. + * + * The values for the digits, left, and right parameters should always + * be positive integers. + * + * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter + * if greater than the current length of the number. + * + * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 + * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than + * the result will be 123.200. + * + * @method nf + * @param {Number|String} num the Number to format + * @param {Integer|String} [left] number of digits to the left of the + * decimal point + * @param {Integer|String} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                    + * + * function setup() { + * background(200); + * let num1 = 321; + * let num2 = -1321; + * + * noStroke(); + * fill(0); + * textSize(16); + * + * text(nf(num1, 4, 2), 10, 30); + * text(nf(num2, 4, 2), 10, 80); + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“0321.00” middle top, “-1321.00” middle bottom canvas'); + * } + * + *
                    + */ + /** + * @method nf + * @param {Array} nums the Numbers to format + * @param {Integer|String} [left] + * @param {Integer|String} [right] + * @return {String[]} formatted Strings + */ + _main.default.prototype.nf = function (nums, left, right) { + _main.default._validateParameters("nf", arguments); + if (nums instanceof Array) { + return nums.map(function (x) { + return doNf(x, left, right); + }); + } else { + var typeOfFirst = Object.prototype.toString.call(nums); + if (typeOfFirst === "[object Arguments]") { + if (nums.length === 3) { + return this.nf(nums[0], nums[1], nums[2]); + } else if (nums.length === 2) { + return this.nf(nums[0], nums[1]); + } else { + return this.nf(nums[0]); + } + } else { + return doNf(nums, left, right); + } + } + }; + function doNf(num, left, right) { + var _num$toString$split = num.toString().split("."), + _num$toString$split2 = _slicedToArray(_num$toString$split, 2), + leftPart = _num$toString$split2[0], + rightPart = _num$toString$split2[1]; + if (typeof right === "undefined") { + leftPart = leftPart.padStart(left, "0"); + return rightPart ? leftPart + "." + rightPart : leftPart; + } else { + var roundedOff = num.toFixed(right); + var _roundedOff$toString$ = roundedOff.toString().split("."); + var _roundedOff$toString$2 = _slicedToArray( + _roundedOff$toString$, + 2, + ); + leftPart = _roundedOff$toString$2[0]; + rightPart = _roundedOff$toString$2[1]; + leftPart = leftPart.padStart(left, "0"); + if (typeof rightPart === "undefined") { + return leftPart; + } else { + return leftPart + "." + rightPart; + } + } + } /** + * Utility function for formatting numbers into strings and placing + * appropriate commas to mark units of 1000. There are two versions: one + * for formatting ints, and one for formatting an array of ints. The value + * for the right parameter should always be a positive integer. + * + * @method nfc + * @param {Number|String} num the Number to format + * @param {Integer|String} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                    + * + * function setup() { + * background(200); + * let num = 11253106.115; + * let numArr = [1, 1, 2]; + * + * noStroke(); + * fill(0); + * textSize(12); + * + * // Draw formatted numbers + * text(nfc(num, 4), 10, 30); + * text(nfc(numArr, 2), 10, 80); + * + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“11,253,106.115” top middle and “1.00,1.00,2.00” displayed bottom mid'); + * } + * + *
                    + */ + /** + * @method nfc + * @param {Array} nums the Numbers to format + * @param {Integer|String} [right] + * @return {String[]} formatted Strings + */ + + _main.default.prototype.nfc = function (num, right) { + _main.default._validateParameters("nfc", arguments); + if (num instanceof Array) { + return num.map(function (x) { + return doNfc(x, right); + }); + } else { + return doNfc(num, right); + } + }; + function doNfc(num, right) { + num = num.toString(); + var dec = num.indexOf("."); + var rem = dec !== -1 ? num.substring(dec) : ""; + var n = dec !== -1 ? num.substring(0, dec) : num; + n = n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + if (right === 0) { + rem = ""; + } else if (typeof right !== "undefined") { + if (right > rem.length) { + rem += dec === -1 ? "." : ""; + var len = right - rem.length + 1; + for (var i = 0; i < len; i++) { + rem += "0"; + } + } else { + rem = rem.substring(0, right + 1); + } + } + return n + rem; + } /** + * Utility function for formatting numbers into strings. Similar to nf() but + * puts a "+" in front of positive numbers and a "-" in front of negative + * numbers. There are two versions: one for formatting floats, and one for + * formatting ints. The values for left, and right parameters + * should always be positive integers. + * + * @method nfp + * @param {Number} num the Number to format + * @param {Integer} [left] number of digits to the left of the decimal + * point + * @param {Integer} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                    + * + * function setup() { + * background(200); + * let num1 = 11253106.115; + * let num2 = -11253106.115; + * + * noStroke(); + * fill(0); + * textSize(12); + * + * // Draw formatted numbers + * text(nfp(num1, 4, 2), 10, 30); + * text(nfp(num2, 4, 2), 10, 80); + * + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“+11253106.11” top middle and “-11253106.11” displayed bottom middle'); + * } + * + *
                    + */ + /** + * @method nfp + * @param {Number[]} nums the Numbers to format + * @param {Integer} [left] + * @param {Integer} [right] + * @return {String[]} formatted Strings + */ + + _main.default.prototype.nfp = function () { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("nfp", args); + var nfRes = _main.default.prototype.nf.apply(this, args); + if (nfRes instanceof Array) { + return nfRes.map(addNfp); + } else { + return addNfp(nfRes); + } + }; + function addNfp(num) { + return parseFloat(num) > 0 + ? "+".concat(num.toString()) + : num.toString(); + } /** + * Utility function for formatting numbers into strings. Similar to nf() but + * puts an additional "_" (space) in front of positive numbers just in case to align it with negative + * numbers which includes "-" (minus) sign. + * + * The main usecase of nfs() can be seen when one wants to align the digits (place values) of a non-negative + * number with some negative number (See the example to get a clear picture). + * There are two versions: one for formatting float, and one for formatting int. + * + * The values for the digits, left, and right parameters should always be positive integers. + * + * (IMP): The result on the canvas basically the expected alignment can vary based on the typeface you are using. + * + * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter + * if greater than the current length of the number. + * + * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 + * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than + * the result will be 123.200. + * + * @method nfs + * @param {Number} num the Number to format + * @param {Integer} [left] number of digits to the left of the decimal + * point + * @param {Integer} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                    + * + * function setup() { + * background(200); + * let num1 = 321; + * let num2 = -1321; + * + * noStroke(); + * fill(0); + * textSize(16); + * + * // nfs() aligns num1 (positive number) with num2 (negative number) by + * // adding a blank space in front of the num1 (positive number) + * // [left = 4] in num1 add one 0 in front, to align the digits with num2 + * // [right = 2] in num1 and num2 adds two 0's after both numbers + * // To see the differences check the example of nf() too. + * text(nfs(num1, 4, 2), 10, 30); + * text(nfs(num2, 4, 2), 10, 80); + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“0321.00” top middle and “-1321.00” displayed bottom middle'); + * } + * + *
                    + */ + /** + * @method nfs + * @param {Array} nums the Numbers to format + * @param {Integer} [left] + * @param {Integer} [right] + * @return {String[]} formatted Strings + */ + + _main.default.prototype.nfs = function () { + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("nfs", args); + var nfRes = _main.default.prototype.nf.apply(this, args); + if (nfRes instanceof Array) { + return nfRes.map(addNfs); + } else { + return addNfs(nfRes); + } + }; + function addNfs(num) { + return parseFloat(num) >= 0 + ? " ".concat(num.toString()) + : num.toString(); + } /** + * The split() function maps to String.split(), it breaks a String into + * pieces using a character or string as the delimiter. The delim parameter + * specifies the character or characters that mark the boundaries between + * each piece. A String[] array is returned that contains each of the pieces. + * + * The splitTokens() function works in a similar fashion, except that it + * splits using a range of characters instead of a specific character or + * sequence. + * + * @method split + * @param {String} value the String to be split + * @param {String} delim the String used to separate the data + * @return {String[]} Array of Strings + * @example + *
                    + * + * let names = 'Pat,Xio,Alex'; + * let splitString = split(names, ','); + * text(splitString[0], 5, 30); + * text(splitString[1], 5, 50); + * text(splitString[2], 5, 70); + * describe('“Pat” top left, “Xio” mid left, and “Alex” displayed bottom left'); + * + *
                    + */ + + _main.default.prototype.split = function (str, delim) { + _main.default._validateParameters("split", arguments); + return str.split(delim); + }; + /** + * The splitTokens() function splits a String at one or many character + * delimiters or "tokens." The delim parameter specifies the character or + * characters to be used as a boundary. + * + * If no delim characters are specified, any whitespace character is used to + * split. Whitespace characters include tab (\t), line feed (\n), carriage + * return (\r), form feed (\f), and space. + * + * @method splitTokens + * @param {String} value the String to be split + * @param {String} [delim] list of individual Strings that will be used as + * separators + * @return {String[]} Array of Strings + * @example + *
                    + * + * function setup() { + * let myStr = 'Mango, Banana, Lime'; + * let myStrArr = splitTokens(myStr, ','); + * + * print(myStrArr); // prints : ["Mango"," Banana"," Lime"] + * } + * + *
                    + */ + _main.default.prototype.splitTokens = function (value, delims) { + _main.default._validateParameters("splitTokens", arguments); + var d; + if (typeof delims !== "undefined") { + var str = delims; + var sqc = /\]/g.exec(str); + var sqo = /\[/g.exec(str); + if (sqo && sqc) { + str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); + sqo = /\[/g.exec(str); + str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); + d = new RegExp("[\\[".concat(str, "\\]]"), "g"); + } else if (sqc) { + str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); + d = new RegExp("[".concat(str, "\\]]"), "g"); + } else if (sqo) { + str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); + d = new RegExp("[".concat(str, "\\[]"), "g"); + } else { + d = new RegExp("[".concat(str, "]"), "g"); + } + } else { + d = /\s/g; + } + return value.split(d).filter(function (n) { + return n; + }); + }; + /** + * Removes whitespace characters from the beginning and end of a String. In + * addition to standard whitespace characters such as space, carriage return, + * and tab, this function also removes the Unicode "nbsp" character. + * + * @method trim + * @param {String} str a String to be trimmed + * @return {String} a trimmed String + * + * @example + *
                    + * + * let string = trim(' No new lines\n '); + * text(string + ' here', 2, 50); + * describe('“No new lines here” displayed center canvas'); + * + *
                    + */ + /** + * @method trim + * @param {Array} strs an Array of Strings to be trimmed + * @return {String[]} an Array of trimmed Strings + */ + _main.default.prototype.trim = function (str) { + _main.default._validateParameters("trim", arguments); + if (str instanceof Array) { + return str.map(this.trim); + } else { + return str.trim(); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/friendly_errors/fes_core": 289, + "../core/friendly_errors/file_errors": 290, + "../core/friendly_errors/validate_params": 293, + "../core/main": 298, + "core-js/modules/es.array.filter": 173, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.number.to-fixed": 193, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.constructor": 204, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.match": 211, + "core-js/modules/es.string.pad-start": 212, + "core-js/modules/es.string.replace": 214, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.trim": 219, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 340: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module IO + * @submodule Time & Date + * @for p5 + * @requires core + */ + /** + * p5.js communicates with the clock on your computer. The day() function + * returns the current day as a value from 1 - 31. + * + * @method day + * @return {Integer} the current day + * @example + *
                    + * + * let d = day(); + * text('Current day: \n' + d, 5, 50); + * describe('Current day is displayed'); + * + *
                    + */ + + _main.default.prototype.day = function () { + return new Date().getDate(); + }; + /** + * p5.js communicates with the clock on your computer. The hour() function + * returns the current hour as a value from 0 - 23. + * + * @method hour + * @return {Integer} the current hour + * @example + *
                    + * + * let h = hour(); + * text('Current hour:\n' + h, 5, 50); + * describe('Current hour is displayed'); + * + *
                    + */ + _main.default.prototype.hour = function () { + return new Date().getHours(); + }; + /** + * p5.js communicates with the clock on your computer. The minute() function + * returns the current minute as a value from 0 - 59. + * + * @method minute + * @return {Integer} the current minute + * @example + *
                    + * + * let m = minute(); + * text('Current minute: \n' + m, 5, 50); + * describe('Current minute is displayed'); + * + *
                    + */ + _main.default.prototype.minute = function () { + return new Date().getMinutes(); + }; + /** + * Returns the number of milliseconds (thousandths of a second) since + * starting the sketch (when `setup()` is called). This information is often + * used for timing events and animation sequences. + * + * @method millis + * @return {Number} the number of milliseconds since starting the sketch + * @example + *
                    + * + * let millisecond = millis(); + * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); + * describe('number of milliseconds since sketch has started displayed'); + * + *
                    + */ + _main.default.prototype.millis = function () { + if (this._millisStart === -1) { + // Sketch has not started + return 0; + } else { + return window.performance.now() - this._millisStart; + } + }; + /** + * p5.js communicates with the clock on your computer. The month() function + * returns the current month as a value from 1 - 12. + * + * @method month + * @return {Integer} the current month + * @example + *
                    + * + * let m = month(); + * text('Current month: \n' + m, 5, 50); + * describe('Current month is displayed'); + * + *
                    + */ + _main.default.prototype.month = function () { + //January is 0! + return new Date().getMonth() + 1; + }; + /** + * p5.js communicates with the clock on your computer. The second() function + * returns the current second as a value from 0 - 59. + * + * @method second + * @return {Integer} the current second + * @example + *
                    + * + * let s = second(); + * text('Current second: \n' + s, 5, 50); + * describe('Current second is displayed'); + * + *
                    + */ + _main.default.prototype.second = function () { + return new Date().getSeconds(); + }; + /** + * p5.js communicates with the clock on your computer. The year() function + * returns the current year as an integer (2014, 2015, 2016, etc). + * + * @method year + * @return {Integer} the current year + * @example + *
                    + * + * let y = year(); + * text('Current year: \n' + y, 5, 50); + * describe('Current year is displayed'); + * + *
                    + */ + _main.default.prototype.year = function () { + return new Date().getFullYear(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + }, + ], + 341: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.math.sign"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.math.sign"); + _dereq_("core-js/modules/es.number.to-fixed"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + _dereq_("./p5.Geometry"); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Shape + * @submodule 3D Primitives + * @for p5 + * @requires core + * @requires p5.Geometry + */ + /** + * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added + * to the geometry and then returned when + * endGeometry() is called. One can also use + * buildGeometry() to pass a function that + * draws shapes. + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them upfront with `beginGeometry()` and `endGeometry()` and then + * drawing that will run faster than repeatedly drawing the individual pieces. + * + * @method beginGeometry + * + * @example + *
                    + * + * let shapes; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * makeShapes(); + * } + * + * function makeShapes() { + * beginGeometry(); + * scale(0.18); + * + * push(); + * translate(100, -50); + * scale(0.5); + * rotateX(PI/4); + * cone(); + * pop(); + * cone(); + * + * beginShape(); + * vertex(-20, -50); + * quadraticVertex( + * -40, -70, + * 0, -60 + * ); + * endShape(); + * + * beginShape(TRIANGLE_STRIP); + * for (let y = 20; y <= 60; y += 10) { + * for (let x of [20, 60]) { + * vertex(x, y); + * } + * } + * endShape(); + * + * beginShape(); + * vertex(-100, -120); + * vertex(-120, -110); + * vertex(-105, -100); + * endShape(); + * + * shapes = endGeometry(); + * } + * + * function draw() { + * background(255); + * lights(); + * orbitControl(); + * model(shapes); + * } + * + *
                    + * + * @alt + * A series of different flat, curved, and 3D shapes floating in space. + */ + + _main.default.prototype.beginGeometry = function () { + return this._renderer.beginGeometry(); + }; + /** + * Finishes creating a new p5.Geometry that was + * started using beginGeometry(). One can also + * use buildGeometry() to pass a function that + * draws shapes. + * + * @method endGeometry + * @returns {p5.Geometry} The model that was built. + */ + _main.default.prototype.endGeometry = function () { + return this._renderer.endGeometry(); + }; + /** + * Creates a new p5.Geometry that contains all + * the shapes drawn in a provided callback function. The returned combined shape + * can then be drawn all at once using model(). + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them with `buildGeometry()` once and then drawing that will run + * faster than repeatedly drawing the individual pieces. + * + * One can also draw shapes directly between + * beginGeometry() and + * endGeometry() instead of using a callback + * function. + * + * @method buildGeometry + * @param {Function} callback A function that draws shapes. + * @returns {p5.Geometry} The model that was built from the callback function. + * + * @example + *
                    + * + * let particles; + * let button; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * button = createButton('New'); + * button.mousePressed(makeParticles); + * makeParticles(); + * } + * + * function makeParticles() { + * if (particles) freeGeometry(particles); + * + * particles = buildGeometry(() => { + * for (let i = 0; i < 60; i++) { + * push(); + * translate( + * randomGaussian(0, 20), + * randomGaussian(0, 20), + * randomGaussian(0, 20) + * ); + * sphere(5); + * pop(); + * } + * }); + * } + * + * function draw() { + * background(255); + * noStroke(); + * lights(); + * orbitControl(); + * model(particles); + * } + * + *
                    + * + * @alt + * A cluster of spheres. + */ + _main.default.prototype.buildGeometry = function (callback) { + return this._renderer.buildGeometry(callback); + }; + /** + * Clears the resources of a model to free up browser memory. A model whose + * resources have been cleared can still be drawn, but the first time it is + * drawn again, it might take longer. + * + * This method works on models generated with + * buildGeometry() as well as those loaded + * from loadModel(). + * + * @method freeGeometry + * @param {p5.Geometry} geometry The geometry whose resources should be freed + */ + _main.default.prototype.freeGeometry = function (geometry) { + this._renderer._freeBuffers(geometry.gid); + }; + /** + * Draw a plane with given a width and height + * @method plane + * @param {Number} [width] width of the plane + * @param {Number} [height] height of the plane + * @param {Integer} [detailX] Optional number of triangle + * subdivisions in x-dimension + * @param {Integer} [detailY] Optional number of triangle + * subdivisions in y-dimension + * @chainable + * @example + *
                    + * + * // draw a plane + * // with width 50 and height 50 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white plane with black wireframe lines'); + * } + * + * function draw() { + * background(200); + * plane(50, 50); + * } + * + *
                    + * + * @alt + * Nothing displayed on canvas + * Rotating interior view of a box with sides that change color. + * 3d red and green gradient. + * Rotating interior view of a cylinder with sides that change color. + * Rotating view of a cylinder with sides that change color. + * 3d red and green gradient. + * rotating view of a multi-colored cylinder with concave sides. + */ + _main.default.prototype.plane = function ( + width, + height, + detailX, + detailY, + ) { + this._assert3d("plane"); + _main.default._validateParameters("plane", arguments); + if (typeof width === "undefined") { + width = 50; + } + if (typeof height === "undefined") { + height = width; + } + if (typeof detailX === "undefined") { + detailX = 1; + } + if (typeof detailY === "undefined") { + detailY = 1; + } + var gId = "plane|".concat(detailX, "|").concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _plane = function _plane() { + var u, v, p; + for (var i = 0; i <= this.detailY; i++) { + v = i / this.detailY; + for (var j = 0; j <= this.detailX; j++) { + u = j / this.detailX; + p = new _main.default.Vector(u - 0.5, v - 0.5, 0); + this.vertices.push(p); + this.uvs.push(u, v); + } + } + }; + var planeGeom = new _main.default.Geometry( + detailX, + detailY, + _plane, + ); + planeGeom.computeFaces().computeNormals(); + if (detailX <= 1 && detailY <= 1) { + planeGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log( + "Cannot draw stroke on plane objects with more" + + " than 1 detailX or 1 detailY", + ); + } + this._renderer.createBuffers(gId, planeGeom); + } + this._renderer.drawBuffersScaled(gId, width, height, 1); + return this; + }; + /** + * Draw a box with given width, height and depth + * @method box + * @param {Number} [width] width of the box + * @param {Number} [height] height of the box + * @param {Number} [depth] depth of the box + * @param {Integer} [detailX] Optional number of triangle + * subdivisions in x-dimension + * @param {Integer} [detailY] Optional number of triangle + * subdivisions in y-dimension + * @chainable + * @example + *
                    + * + * // draw a spinning box + * // with width, height and depth of 50 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white box rotating in 3D space'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(50); + * } + * + *
                    + */ + _main.default.prototype.box = function ( + width, + height, + depth, + detailX, + detailY, + ) { + this._assert3d("box"); + _main.default._validateParameters("box", arguments); + if (typeof width === "undefined") { + width = 50; + } + if (typeof height === "undefined") { + height = width; + } + if (typeof depth === "undefined") { + depth = height; + } + var perPixelLighting = + this._renderer.attributes && + this._renderer.attributes.perPixelLighting; + if (typeof detailX === "undefined") { + detailX = perPixelLighting ? 1 : 4; + } + if (typeof detailY === "undefined") { + detailY = perPixelLighting ? 1 : 4; + } + var gId = "box|".concat(detailX, "|").concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _box = function _box() { + var _this = this; + var cubeIndices = [ + [0, 4, 2, 6], + // -1, 0, 0],// -x + [1, 3, 5, 7], + // +1, 0, 0],// +x + [0, 1, 4, 5], + // 0, -1, 0],// -y + [2, 6, 3, 7], + // 0, +1, 0],// +y + [0, 2, 1, 3], + // 0, 0, -1],// -z + [4, 5, 6, 7], // 0, 0, +1] // +z + ]; + //using custom edges + //to avoid diagonal stroke lines across face of box + this.edges = [ + [0, 1], + [1, 3], + [3, 2], + [6, 7], + [8, 9], + [9, 11], + [14, 15], + [16, 17], + [17, 19], + [18, 19], + [20, 21], + [22, 23], + ]; + cubeIndices.forEach(function (cubeIndex, i) { + var v = i * 4; + for (var j = 0; j < 4; j++) { + var d = cubeIndex[j]; + //inspired by lightgl: + //https://github.com/evanw/lightgl.js + //octants:https://en.wikipedia.org/wiki/Octant_(solid_geometry) + var octant = new _main.default.Vector( + ((d & 1) * 2 - 1) / 2, + ((d & 2) - 1) / 2, + ((d & 4) / 2 - 1) / 2, + ); + _this.vertices.push(octant); + _this.uvs.push(j & 1, (j & 2) / 2); + } + _this.faces.push([v, v + 1, v + 2]); + _this.faces.push([v + 2, v + 1, v + 3]); + }); + }; + var boxGeom = new _main.default.Geometry(detailX, detailY, _box); + boxGeom.computeNormals(); + if (detailX <= 4 && detailY <= 4) { + boxGeom._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log( + "Cannot draw stroke on box objects with more" + + " than 4 detailX or 4 detailY", + ); + } //initialize our geometry buffer with + //the key val pair: + //geometry Id, Geom object + + this._renderer.createBuffers(gId, boxGeom); + } + this._renderer.drawBuffersScaled(gId, width, height, depth); + return this; + }; + /** + * Draw a sphere with given radius. + * + * DetailX and detailY determines the number of subdivisions in the x-dimension + * and the y-dimension of a sphere. More subdivisions make the sphere seem + * smoother. The recommended maximum values are both 24. Using a value greater + * than 24 may cause a warning or slow down the browser. + * @method sphere + * @param {Number} [radius] radius of circle + * @param {Integer} [detailX] optional number of subdivisions in x-dimension + * @param {Integer} [detailY] optional number of subdivisions in y-dimension + * + * @chainable + * @example + *
                    + * + * // draw a sphere with radius 40 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white sphere with black wireframe lines'); + * } + * + * function draw() { + * background(205, 102, 94); + * sphere(40); + * } + * + *
                    + * + * @example + *
                    + * + * let detailX; + * // slide to see how detailX works + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 24, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * sphere(40, detailX.value(), 16); + * } + * + *
                    + * + * @example + *
                    + * + * let detailY; + * // slide to see how detailY works + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(3, 16, 3); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * sphere(40, 16, detailY.value()); + * } + * + *
                    + */ + _main.default.prototype.sphere = function (radius, detailX, detailY) { + this._assert3d("sphere"); + _main.default._validateParameters("sphere", arguments); + if (typeof radius === "undefined") { + radius = 50; + } + if (typeof detailX === "undefined") { + detailX = 24; + } + if (typeof detailY === "undefined") { + detailY = 16; + } + this.ellipsoid(radius, radius, radius, detailX, detailY); + return this; + }; + /** + * @private + * Helper function for creating both cones and cylinders + * Will only generate well-defined geometry when bottomRadius, height > 0 + * and topRadius >= 0 + * If topRadius == 0, topCap should be false + */ + var _truncatedCone = function _truncatedCone( + bottomRadius, + topRadius, + height, + detailX, + detailY, + bottomCap, + topCap, + ) { + bottomRadius = bottomRadius <= 0 ? 1 : bottomRadius; + topRadius = topRadius < 0 ? 0 : topRadius; + height = height <= 0 ? bottomRadius : height; + detailX = detailX < 3 ? 3 : detailX; + detailY = detailY < 1 ? 1 : detailY; + bottomCap = bottomCap === undefined ? true : bottomCap; + topCap = topCap === undefined ? topRadius !== 0 : topCap; + var start = bottomCap ? -2 : 0; + var end = detailY + (topCap ? 2 : 0); + //ensure constant slant for interior vertex normals + var slant = Math.atan2(bottomRadius - topRadius, height); + var sinSlant = Math.sin(slant); + var cosSlant = Math.cos(slant); + var yy, ii, jj; + for (yy = start; yy <= end; ++yy) { + var v = yy / detailY; + var y = height * v; + var ringRadius = void 0; + if (yy < 0) { + //for the bottomCap edge + y = 0; + v = 0; + ringRadius = bottomRadius; + } else if (yy > detailY) { + //for the topCap edge + y = height; + v = 1; + ringRadius = topRadius; + } else { + //for the middle + ringRadius = bottomRadius + (topRadius - bottomRadius) * v; + } + if (yy === -2 || yy === detailY + 2) { + //center of bottom or top caps + ringRadius = 0; + } + y -= height / 2; //shift coordiate origin to the center of object + for (ii = 0; ii < detailX; ++ii) { + var u = ii / (detailX - 1); + var ur = 2 * Math.PI * u; + var sur = Math.sin(ur); + var cur = Math.cos(ur); + //VERTICES + this.vertices.push( + new _main.default.Vector( + sur * ringRadius, + y, + cur * ringRadius, + ), + ); + //VERTEX NORMALS + var vertexNormal = void 0; + if (yy < 0) { + vertexNormal = new _main.default.Vector(0, -1, 0); + } else if (yy > detailY && topRadius) { + vertexNormal = new _main.default.Vector(0, 1, 0); + } else { + vertexNormal = new _main.default.Vector( + sur * cosSlant, + sinSlant, + cur * cosSlant, + ); + } + this.vertexNormals.push(vertexNormal); + //UVs + this.uvs.push(u, v); + } + } + var startIndex = 0; + if (bottomCap) { + for (jj = 0; jj < detailX; ++jj) { + var nextjj = (jj + 1) % detailX; + this.faces.push([ + startIndex + jj, + startIndex + detailX + nextjj, + startIndex + detailX + jj, + ]); + } + startIndex += detailX * 2; + } + for (yy = 0; yy < detailY; ++yy) { + for (ii = 0; ii < detailX; ++ii) { + var nextii = (ii + 1) % detailX; + this.faces.push([ + startIndex + ii, + startIndex + nextii, + startIndex + detailX + nextii, + ]); + this.faces.push([ + startIndex + ii, + startIndex + detailX + nextii, + startIndex + detailX + ii, + ]); + } + startIndex += detailX; + } + if (topCap) { + startIndex += detailX; + for (ii = 0; ii < detailX; ++ii) { + this.faces.push([ + startIndex + ii, + startIndex + ((ii + 1) % detailX), + startIndex + detailX, + ]); + } + } + }; + /** + * Draw a cylinder with given radius and height + * + * DetailX and detailY determines the number of subdivisions in the x-dimension + * and the y-dimension of a cylinder. More subdivisions make the cylinder seem smoother. + * The recommended maximum value for detailX is 24. Using a value greater than 24 + * may cause a warning or slow down the browser. + * + * @method cylinder + * @param {Number} [radius] radius of the surface + * @param {Number} [height] height of the cylinder + * @param {Integer} [detailX] number of subdivisions in x-dimension; + * default is 24 + * @param {Integer} [detailY] number of subdivisions in y-dimension; + * default is 1 + * @param {Boolean} [bottomCap] whether to draw the bottom of the cylinder + * @param {Boolean} [topCap] whether to draw the top of the cylinder + * @chainable + * @example + *
                    + * + * // draw a spinning cylinder + * // with radius 20 and height 50 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a rotating white cylinder'); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateX(frameCount * 0.01); + * rotateZ(frameCount * 0.01); + * cylinder(20, 50); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailX works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 24, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * cylinder(20, 75, detailX.value(), 1); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(1, 16, 1); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * cylinder(20, 75, 16, detailY.value()); + * } + * + *
                    + */ + _main.default.prototype.cylinder = function ( + radius, + height, + detailX, + detailY, + bottomCap, + topCap, + ) { + this._assert3d("cylinder"); + _main.default._validateParameters("cylinder", arguments); + if (typeof radius === "undefined") { + radius = 50; + } + if (typeof height === "undefined") { + height = radius; + } + if (typeof detailX === "undefined") { + detailX = 24; + } + if (typeof detailY === "undefined") { + detailY = 1; + } + if (typeof topCap === "undefined") { + topCap = true; + } + if (typeof bottomCap === "undefined") { + bottomCap = true; + } + var gId = "cylinder|" + .concat(detailX, "|") + .concat(detailY, "|") + .concat(bottomCap, "|") + .concat(topCap); + if (!this._renderer.geometryInHash(gId)) { + var cylinderGeom = new _main.default.Geometry(detailX, detailY); + _truncatedCone.call( + cylinderGeom, + 1, + 1, + 1, + detailX, + detailY, + bottomCap, + topCap, + ); + // normals are computed in call to _truncatedCone + if (detailX <= 24 && detailY <= 16) { + cylinderGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log( + "Cannot draw stroke on cylinder objects with more" + + " than 24 detailX or 16 detailY", + ); + } + this._renderer.createBuffers(gId, cylinderGeom); + } + this._renderer.drawBuffersScaled(gId, radius, height, radius); + return this; + }; + /** + * Draw a cone with given radius and height + * + * DetailX and detailY determine the number of subdivisions in the x-dimension and + * the y-dimension of a cone. More subdivisions make the cone seem smoother. The + * recommended maximum value for detailX is 24. Using a value greater than 24 + * may cause a warning or slow down the browser. + * @method cone + * @param {Number} [radius] radius of the bottom surface + * @param {Number} [height] height of the cone + * @param {Integer} [detailX] number of segments, + * the more segments the smoother geometry + * default is 24 + * @param {Integer} [detailY] number of segments, + * the more segments the smoother geometry + * default is 1 + * @param {Boolean} [cap] whether to draw the base of the cone + * @chainable + * @example + *
                    + * + * // draw a spinning cone + * // with radius 40 and height 70 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a rotating white cone'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateZ(frameCount * 0.01); + * cone(40, 70); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailx works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 16, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * cone(30, 65, detailX.value(), 16); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(3, 16, 3); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * cone(30, 65, 16, detailY.value()); + * } + * + *
                    + */ + _main.default.prototype.cone = function ( + radius, + height, + detailX, + detailY, + cap, + ) { + this._assert3d("cone"); + _main.default._validateParameters("cone", arguments); + if (typeof radius === "undefined") { + radius = 50; + } + if (typeof height === "undefined") { + height = radius; + } + if (typeof detailX === "undefined") { + detailX = 24; + } + if (typeof detailY === "undefined") { + detailY = 1; + } + if (typeof cap === "undefined") { + cap = true; + } + var gId = "cone|" + .concat(detailX, "|") + .concat(detailY, "|") + .concat(cap); + if (!this._renderer.geometryInHash(gId)) { + var coneGeom = new _main.default.Geometry(detailX, detailY); + _truncatedCone.call( + coneGeom, + 1, + 0, + 1, + detailX, + detailY, + cap, + false, + ); + if (detailX <= 24 && detailY <= 16) { + coneGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log( + "Cannot draw stroke on cone objects with more" + + " than 24 detailX or 16 detailY", + ); + } + this._renderer.createBuffers(gId, coneGeom); + } + this._renderer.drawBuffersScaled(gId, radius, height, radius); + return this; + }; + /** + * Draw an ellipsoid with given radius + * + * DetailX and detailY determine the number of subdivisions in the x-dimension and + * the y-dimension of a cone. More subdivisions make the ellipsoid appear to be smoother. + * Avoid detail number above 150, it may crash the browser. + * @method ellipsoid + * @param {Number} [radiusx] x-radius of ellipsoid + * @param {Number} [radiusy] y-radius of ellipsoid + * @param {Number} [radiusz] z-radius of ellipsoid + * @param {Integer} [detailX] number of segments, + * the more segments the smoother geometry + * default is 24. Avoid detail number above + * 150, it may crash the browser. + * @param {Integer} [detailY] number of segments, + * the more segments the smoother geometry + * default is 16. Avoid detail number above + * 150, it may crash the browser. + * @chainable + * @example + *
                    + * + * // draw an ellipsoid + * // with radius 30, 40 and 40. + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white 3d ellipsoid'); + * } + * + * function draw() { + * background(205, 105, 94); + * ellipsoid(30, 40, 40); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailX works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(2, 24, 12); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * ellipsoid(30, 40, 40, detailX.value(), 8); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(2, 24, 6); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 105, 9); + * rotateY(millis() / 1000); + * ellipsoid(30, 40, 40, 12, detailY.value()); + * } + * + *
                    + */ + _main.default.prototype.ellipsoid = function ( + radiusX, + radiusY, + radiusZ, + detailX, + detailY, + ) { + this._assert3d("ellipsoid"); + _main.default._validateParameters("ellipsoid", arguments); + if (typeof radiusX === "undefined") { + radiusX = 50; + } + if (typeof radiusY === "undefined") { + radiusY = radiusX; + } + if (typeof radiusZ === "undefined") { + radiusZ = radiusX; + } + if (typeof detailX === "undefined") { + detailX = 24; + } + if (typeof detailY === "undefined") { + detailY = 16; + } + var gId = "ellipsoid|".concat(detailX, "|").concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _ellipsoid = function _ellipsoid() { + for (var i = 0; i <= this.detailY; i++) { + var v = i / this.detailY; + var phi = Math.PI * v - Math.PI / 2; + var cosPhi = Math.cos(phi); + var sinPhi = Math.sin(phi); + for (var j = 0; j <= this.detailX; j++) { + var u = j / this.detailX; + var theta = 2 * Math.PI * u; + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + var p = new _main.default.Vector( + cosPhi * sinTheta, + sinPhi, + cosPhi * cosTheta, + ); + this.vertices.push(p); + this.vertexNormals.push(p); + this.uvs.push(u, v); + } + } + }; + var ellipsoidGeom = new _main.default.Geometry( + detailX, + detailY, + _ellipsoid, + ); + ellipsoidGeom.computeFaces(); + if (detailX <= 24 && detailY <= 24) { + ellipsoidGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log( + "Cannot draw stroke on ellipsoids with more" + + " than 24 detailX or 24 detailY", + ); + } + this._renderer.createBuffers(gId, ellipsoidGeom); + } + this._renderer.drawBuffersScaled(gId, radiusX, radiusY, radiusZ); + return this; + }; + /** + * Draw a torus with given radius and tube radius + * + * DetailX and detailY determine the number of subdivisions in the x-dimension and + * the y-dimension of a torus. More subdivisions make the torus appear to be smoother. + * The default and maximum values for detailX and detailY are 24 and 16, respectively. + * Setting them to relatively small values like 4 and 6 allows you to create new + * shapes other than a torus. + * @method torus + * @param {Number} [radius] radius of the whole ring + * @param {Number} [tubeRadius] radius of the tube + * @param {Integer} [detailX] number of segments in x-dimension, + * the more segments the smoother geometry + * default is 24 + * @param {Integer} [detailY] number of segments in y-dimension, + * the more segments the smoother geometry + * default is 16 + * @chainable + * @example + *
                    + * + * // draw a spinning torus + * // with ring radius 30 and tube radius 15 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a rotating white torus'); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * torus(30, 15); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailX works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 24, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * torus(30, 15, detailX.value(), 12); + * } + * + *
                    + * + * @example + *
                    + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(3, 16, 3); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * torus(30, 15, 16, detailY.value()); + * } + * + *
                    + */ + _main.default.prototype.torus = function ( + radius, + tubeRadius, + detailX, + detailY, + ) { + this._assert3d("torus"); + _main.default._validateParameters("torus", arguments); + if (typeof radius === "undefined") { + radius = 50; + } else if (!radius) { + return; // nothing to draw + } + if (typeof tubeRadius === "undefined") { + tubeRadius = 10; + } else if (!tubeRadius) { + return; // nothing to draw + } + if (typeof detailX === "undefined") { + detailX = 24; + } + if (typeof detailY === "undefined") { + detailY = 16; + } + var tubeRatio = (tubeRadius / radius).toPrecision(4); + var gId = "torus|" + .concat(tubeRatio, "|") + .concat(detailX, "|") + .concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _torus = function _torus() { + for (var i = 0; i <= this.detailY; i++) { + var v = i / this.detailY; + var phi = 2 * Math.PI * v; + var cosPhi = Math.cos(phi); + var sinPhi = Math.sin(phi); + var r = 1 + tubeRatio * cosPhi; + for (var j = 0; j <= this.detailX; j++) { + var u = j / this.detailX; + var theta = 2 * Math.PI * u; + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + var p = new _main.default.Vector( + r * cosTheta, + r * sinTheta, + tubeRatio * sinPhi, + ); + var n = new _main.default.Vector( + cosPhi * cosTheta, + cosPhi * sinTheta, + sinPhi, + ); + this.vertices.push(p); + this.vertexNormals.push(n); + this.uvs.push(u, v); + } + } + }; + var torusGeom = new _main.default.Geometry( + detailX, + detailY, + _torus, + ); + torusGeom.computeFaces(); + if (detailX <= 24 && detailY <= 16) { + torusGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log( + "Cannot draw strokes on torus object with more" + + " than 24 detailX or 16 detailY", + ); + } + this._renderer.createBuffers(gId, torusGeom); + } + this._renderer.drawBuffersScaled(gId, radius, radius, radius); + return this; + }; + /////////////////////// + /// 2D primitives + ///////////////////////// + // + // Note: Documentation is not generated on the p5.js website for functions on + // the p5.RendererGL prototype. + /** + * Draws a point, a coordinate in space at the dimension of one pixel, + * given x, y and z coordinates. The color of the point is determined + * by the current stroke, while the point size is determined by current + * stroke weight. + * @private + * @param {Number} x x-coordinate of point + * @param {Number} y y-coordinate of point + * @param {Number} z z-coordinate of point + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(50); + * stroke(255); + * strokeWeight(4); + * point(25, 0); + * strokeWeight(3); + * point(-25, 0); + * strokeWeight(2); + * point(0, 25); + * strokeWeight(1); + * point(0, -25); + * } + * + *
                    + */ + _main.default.RendererGL.prototype.point = function (x, y, z) { + if (typeof z === "undefined") { + z = 0; + } + var _vertex = []; + _vertex.push(new _main.default.Vector(x, y, z)); + this._drawPoints(_vertex, this.immediateMode.buffers.point); + return this; + }; + _main.default.RendererGL.prototype.triangle = function (args) { + var x1 = args[0], + y1 = args[1]; + var x2 = args[2], + y2 = args[3]; + var x3 = args[4], + y3 = args[5]; + var gId = "tri"; + if (!this.geometryInHash(gId)) { + var _triangle = function _triangle() { + var vertices = []; + vertices.push(new _main.default.Vector(0, 0, 0)); + vertices.push(new _main.default.Vector(1, 0, 0)); + vertices.push(new _main.default.Vector(0, 1, 0)); + this.edges = [ + [0, 1], + [1, 2], + [2, 0], + ]; + this.vertices = vertices; + this.faces = [[0, 1, 2]]; + this.uvs = [0, 0, 1, 0, 1, 1]; + }; + var triGeom = new _main.default.Geometry(1, 1, _triangle); + triGeom._edgesToVertices(); + triGeom.computeNormals(); + this.createBuffers(gId, triGeom); + } // only one triangle is cached, one point is at the origin, and the + // two adjacent sides are tne unit vectors along the X & Y axes. + // + // this matrix multiplication transforms those two unit vectors + // onto the required vector prior to rendering, and moves the + // origin appropriately. + + var uMVMatrix = this.uMVMatrix.copy(); + try { + // triangle orientation. + var orientation = Math.sign( + x1 * y2 - x2 * y1 + x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3, + ); + var mult = new _main.default.Matrix([ + x2 - x1, + y2 - y1, + 0, + 0, + // the resulting unit X-axis + x3 - x1, + y3 - y1, + 0, + 0, + // the resulting unit Y-axis + 0, + 0, + orientation, + 0, + // the resulting unit Z-axis (Reflect the specified order of vertices) + x1, + y1, + 0, + 1, // the resulting origin + ]).mult(this.uMVMatrix); + this.uMVMatrix = mult; + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + return this; + }; + _main.default.RendererGL.prototype.ellipse = function (args) { + this.arc( + args[0], + args[1], + args[2], + args[3], + 0, + constants.TWO_PI, + constants.OPEN, + args[4], + ); + }; + _main.default.RendererGL.prototype.arc = function (args) { + var x = arguments[0]; + var y = arguments[1]; + var width = arguments[2]; + var height = arguments[3]; + var start = arguments[4]; + var stop = arguments[5]; + var mode = arguments[6]; + var detail = arguments[7] || 25; + var shape; + var gId; + // check if it is an ellipse or an arc + if (Math.abs(stop - start) >= constants.TWO_PI) { + shape = "ellipse"; + gId = "".concat(shape, "|").concat(detail, "|"); + } else { + shape = "arc"; + gId = "" + .concat(shape, "|") + .concat(start, "|") + .concat(stop, "|") + .concat(mode, "|") + .concat(detail, "|"); + } + if (!this.geometryInHash(gId)) { + var _arc = function _arc() { + // if the start and stop angles are not the same, push vertices to the array + if (start.toFixed(10) !== stop.toFixed(10)) { + // if the mode specified is PIE or null, push the mid point of the arc in vertices + if (mode === constants.PIE || typeof mode === "undefined") { + this.vertices.push(new _main.default.Vector(0.5, 0.5, 0)); + this.uvs.push([0.5, 0.5]); + } // vertices for the perimeter of the circle + + for (var i = 0; i <= detail; i++) { + var u = i / detail; + var theta = (stop - start) * u + start; + var _x = 0.5 + Math.cos(theta) / 2; + var _y = 0.5 + Math.sin(theta) / 2; + this.vertices.push(new _main.default.Vector(_x, _y, 0)); + this.uvs.push([_x, _y]); + if (i < detail - 1) { + this.faces.push([0, i + 1, i + 2]); + this.edges.push([i + 1, i + 2]); + } + } // check the mode specified in order to push vertices and faces, different for each mode + + switch (mode) { + case constants.PIE: + this.faces.push([ + 0, + this.vertices.length - 2, + this.vertices.length - 1, + ]); + this.edges.push([0, 1]); + this.edges.push([ + this.vertices.length - 2, + this.vertices.length - 1, + ]); + this.edges.push([0, this.vertices.length - 1]); + break; + case constants.CHORD: + this.edges.push([0, 1]); + this.edges.push([0, this.vertices.length - 1]); + break; + case constants.OPEN: + this.edges.push([0, 1]); + break; + default: + this.faces.push([ + 0, + this.vertices.length - 2, + this.vertices.length - 1, + ]); + this.edges.push([ + this.vertices.length - 2, + this.vertices.length - 1, + ]); + } + } + }; + var arcGeom = new _main.default.Geometry(detail, 1, _arc); + arcGeom.computeNormals(); + if (detail <= 50) { + arcGeom._edgesToVertices(arcGeom); + } else if (this._doStroke) { + console.log( + "Cannot apply a stroke to an ".concat( + shape, + " with more than 50 detail", + ), + ); + } + this.createBuffers(gId, arcGeom); + } + var uMVMatrix = this.uMVMatrix.copy(); + try { + this.uMVMatrix.translate([x, y, 0]); + this.uMVMatrix.scale(width, height, 1); + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + return this; + }; + _main.default.RendererGL.prototype.rect = function (args) { + var x = args[0]; + var y = args[1]; + var width = args[2]; + var height = args[3]; + if (typeof args[4] === "undefined") { + // Use the retained mode for drawing rectangle, + // if args for rounding rectangle is not provided by user. + var perPixelLighting = this._pInst._glAttributes.perPixelLighting; + var detailX = args[4] || (perPixelLighting ? 1 : 24); + var detailY = args[5] || (perPixelLighting ? 1 : 16); + var gId = "rect|".concat(detailX, "|").concat(detailY); + if (!this.geometryInHash(gId)) { + var _rect = function _rect() { + for (var i = 0; i <= this.detailY; i++) { + var v = i / this.detailY; + for (var j = 0; j <= this.detailX; j++) { + var u = j / this.detailX; + var p = new _main.default.Vector(u, v, 0); + this.vertices.push(p); + this.uvs.push(u, v); + } + } // using stroke indices to avoid stroke over face(s) of rectangle + + if (detailX > 0 && detailY > 0) { + this.edges = [ + [0, detailX], + [detailX, (detailX + 1) * (detailY + 1) - 1], + [ + (detailX + 1) * (detailY + 1) - 1, + (detailX + 1) * detailY, + ], + [(detailX + 1) * detailY, 0], + ]; + } + }; + var rectGeom = new _main.default.Geometry( + detailX, + detailY, + _rect, + ); + rectGeom.computeFaces().computeNormals()._edgesToVertices(); + this.createBuffers(gId, rectGeom); + } // only a single rectangle (of a given detail) is cached: a square with + // opposite corners at (0,0) & (1,1). + // + // before rendering, this square is scaled & moved to the required location. + + var uMVMatrix = this.uMVMatrix.copy(); + try { + this.uMVMatrix.translate([x, y, 0]); + this.uMVMatrix.scale(width, height, 1); + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + } else { + // Use Immediate mode to round the rectangle corner, + // if args for rounding corners is provided by user + var tl = args[4]; + var tr = typeof args[5] === "undefined" ? tl : args[5]; + var br = typeof args[6] === "undefined" ? tr : args[6]; + var bl = typeof args[7] === "undefined" ? br : args[7]; + var a = x; + var b = y; + var c = width; + var d = height; + c += a; + d += b; + if (a > c) { + var temp = a; + a = c; + c = temp; + } + if (b > d) { + var _temp = b; + b = d; + d = _temp; + } + var maxRounding = Math.min((c - a) / 2, (d - b) / 2); + if (tl > maxRounding) tl = maxRounding; + if (tr > maxRounding) tr = maxRounding; + if (br > maxRounding) br = maxRounding; + if (bl > maxRounding) bl = maxRounding; + var x1 = a; + var y1 = b; + var x2 = c; + var y2 = d; + this.beginShape(); + if (tr !== 0) { + this.vertex(x2 - tr, y1); + this.quadraticVertex(x2, y1, x2, y1 + tr); + } else { + this.vertex(x2, y1); + } + if (br !== 0) { + this.vertex(x2, y2 - br); + this.quadraticVertex(x2, y2, x2 - br, y2); + } else { + this.vertex(x2, y2); + } + if (bl !== 0) { + this.vertex(x1 + bl, y2); + this.quadraticVertex(x1, y2, x1, y2 - bl); + } else { + this.vertex(x1, y2); + } + if (tl !== 0) { + this.vertex(x1, y1 + tl); + this.quadraticVertex(x1, y1, x1 + tl, y1); + } else { + this.vertex(x1, y1); + } + this.immediateMode.geometry.uvs.length = 0; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = + this.immediateMode.geometry.vertices[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var vert = _step.value; + var u = (vert.x - x1) / width; + var v = (vert.y - y1) / height; + this.immediateMode.geometry.uvs.push(u, v); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + this.endShape(constants.CLOSE); + } + return this; + }; + /* eslint-disable max-len */ + _main.default.RendererGL.prototype.quad = function ( + x1, + y1, + z1, + x2, + y2, + z2, + x3, + y3, + z3, + x4, + y4, + z4, + detailX, + detailY, + ) { + /* eslint-enable max-len */ + if (typeof detailX === "undefined") { + detailX = 2; + } + if (typeof detailY === "undefined") { + detailY = 2; + } + var gId = "quad|" + .concat(x1, "|") + .concat(y1, "|") + .concat(z1, "|") + .concat(x2, "|") + .concat(y2, "|") + .concat(z2, "|") + .concat(x3, "|") + .concat(y3, "|") + .concat(z3, "|") + .concat(x4, "|") + .concat(y4, "|") + .concat(z4, "|") + .concat(detailX, "|") + .concat(detailY); + if (!this.geometryInHash(gId)) { + var quadGeom = new _main.default.Geometry( + detailX, + detailY, + function () { + //algorithm adapted from c++ to js + //https://stackoverflow.com/questions/16989181/whats-the-correct-way-to-draw-a-distorted-plane-in-opengl/16993202#16993202 + var xRes = 1 / (this.detailX - 1); + var yRes = 1 / (this.detailY - 1); + for (var y = 0; y < this.detailY; y++) { + for (var x = 0; x < this.detailX; x++) { + var pctx = x * xRes; + var pcty = y * yRes; + var linePt0x = (1 - pcty) * x1 + pcty * x4; + var linePt0y = (1 - pcty) * y1 + pcty * y4; + var linePt0z = (1 - pcty) * z1 + pcty * z4; + var linePt1x = (1 - pcty) * x2 + pcty * x3; + var linePt1y = (1 - pcty) * y2 + pcty * y3; + var linePt1z = (1 - pcty) * z2 + pcty * z3; + var ptx = (1 - pctx) * linePt0x + pctx * linePt1x; + var pty = (1 - pctx) * linePt0y + pctx * linePt1y; + var ptz = (1 - pctx) * linePt0z + pctx * linePt1z; + this.vertices.push( + new _main.default.Vector(ptx, pty, ptz), + ); + this.uvs.push([pctx, pcty]); + } + } + }, + ); + quadGeom.faces = []; + for (var y = 0; y < detailY - 1; y++) { + for (var x = 0; x < detailX - 1; x++) { + var pt0 = x + y * detailX; + var pt1 = x + 1 + y * detailX; + var pt2 = x + 1 + (y + 1) * detailX; + var pt3 = x + (y + 1) * detailX; + quadGeom.faces.push([pt0, pt1, pt2]); + quadGeom.faces.push([pt0, pt2, pt3]); + } + } + quadGeom.computeNormals(); + quadGeom.edges.length = 0; + var vertexOrder = [0, 2, 3, 1]; + for (var i = 0; i < vertexOrder.length; i++) { + var startVertex = vertexOrder[i]; + var endVertex = vertexOrder[(i + 1) % vertexOrder.length]; + quadGeom.edges.push([startVertex, endVertex]); + } + quadGeom._edgesToVertices(); + this.createBuffers(gId, quadGeom); + } + this.drawBuffers(gId); + return this; + }; + //this implementation of bezier curve + //is based on Bernstein polynomial + // pretier-ignore + _main.default.RendererGL.prototype.bezier = function ( + x1, + y1, + z1, // x2 + x2, // y2 + y2, // x3 + z2, // y3 + x3, // x4 + y3, // y4 + z3, + x4, + y4, + z4, + ) { + if (arguments.length === 8) { + y4 = y3; + x4 = x3; + y3 = z2; + x3 = y2; + y2 = x2; + x2 = z1; + z1 = z2 = z3 = z4 = 0; + } + var bezierDetail = this._pInst._bezierDetail || 20; //value of Bezier detail + this.beginShape(); + for (var i = 0; i <= bezierDetail; i++) { + var c1 = Math.pow(1 - i / bezierDetail, 3); + var c2 = + 3 * (i / bezierDetail) * Math.pow(1 - i / bezierDetail, 2); + var c3 = + 3 * Math.pow(i / bezierDetail, 2) * (1 - i / bezierDetail); + var c4 = Math.pow(i / bezierDetail, 3); + this.vertex( + x1 * c1 + x2 * c2 + x3 * c3 + x4 * c4, + y1 * c1 + y2 * c2 + y3 * c3 + y4 * c4, + z1 * c1 + z2 * c2 + z3 * c3 + z4 * c4, + ); + } + this.endShape(); + return this; + }; + // pretier-ignore + _main.default.RendererGL.prototype.curve = function ( + x1, + y1, + z1, // x2 + x2, // y2 + y2, // x3 + z2, // y3 + x3, // x4 + y3, // y4 + z3, + x4, + y4, + z4, + ) { + if (arguments.length === 8) { + x4 = x3; + y4 = y3; + x3 = y2; + y3 = x2; + x2 = z1; + y2 = x2; + z1 = z2 = z3 = z4 = 0; + } + var curveDetail = this._pInst._curveDetail; + this.beginShape(); + for (var i = 0; i <= curveDetail; i++) { + var c1 = Math.pow(i / curveDetail, 3) * 0.5; + var c2 = Math.pow(i / curveDetail, 2) * 0.5; + var c3 = (i / curveDetail) * 0.5; + var c4 = 0.5; + var vx = + c1 * (-x1 + 3 * x2 - 3 * x3 + x4) + + c2 * (2 * x1 - 5 * x2 + 4 * x3 - x4) + + c3 * (-x1 + x3) + + c4 * (2 * x2); + var vy = + c1 * (-y1 + 3 * y2 - 3 * y3 + y4) + + c2 * (2 * y1 - 5 * y2 + 4 * y3 - y4) + + c3 * (-y1 + y3) + + c4 * (2 * y2); + var vz = + c1 * (-z1 + 3 * z2 - 3 * z3 + z4) + + c2 * (2 * z1 - 5 * z2 + 4 * z3 - z4) + + c3 * (-z1 + z3) + + c4 * (2 * z2); + this.vertex(vx, vy, vz); + } + this.endShape(); + return this; + }; + /** + * Draw a line given two points + * @private + * @param {Number} x0 x-coordinate of first vertex + * @param {Number} y0 y-coordinate of first vertex + * @param {Number} z0 z-coordinate of first vertex + * @param {Number} x1 x-coordinate of second vertex + * @param {Number} y1 y-coordinate of second vertex + * @param {Number} z1 z-coordinate of second vertex + * @chainable + * @example + *
                    + * + * //draw a line + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * // Use fill instead of stroke to change the color of shape. + * fill(255, 0, 0); + * line(10, 10, 0, 60, 60, 20); + * } + * + *
                    + */ + _main.default.RendererGL.prototype.line = function () { + if (arguments.length === 6) { + this.beginShape(constants.LINES); + this.vertex( + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 2 ? undefined : arguments[2], + ); + this.vertex( + arguments.length <= 3 ? undefined : arguments[3], + arguments.length <= 4 ? undefined : arguments[4], + arguments.length <= 5 ? undefined : arguments[5], + ); + this.endShape(); + } else if (arguments.length === 4) { + this.beginShape(constants.LINES); + this.vertex( + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 1 ? undefined : arguments[1], + 0, + ); + this.vertex( + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 3 ? undefined : arguments[3], + 0, + ); + this.endShape(); + } + return this; + }; + _main.default.RendererGL.prototype.bezierVertex = function () { + if (this.immediateMode._bezierVertex.length === 0) { + throw Error( + "vertex() must be used once before calling bezierVertex()", + ); + } else { + var w_x = []; + var w_y = []; + var w_z = []; + var t, _x, _y, _z, i, k, m; + // variable i for bezierPoints, k for components, and m for anchor points. + var argLength = arguments.length; + t = 0; + if ( + this._lookUpTableBezier.length === 0 || + this._lutBezierDetail !== this._pInst._curveDetail + ) { + this._lookUpTableBezier = []; + this._lutBezierDetail = this._pInst._curveDetail; + var step = 1 / this._lutBezierDetail; + var start = 0; + var end = 1; + var j = 0; + while (start < 1) { + t = parseFloat(start.toFixed(6)); + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + if (end.toFixed(6) === step.toFixed(6)) { + t = + parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); + ++j; + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + break; + } + start += step; + end -= step; + ++j; + } + } + var LUTLength = this._lookUpTableBezier.length; + // fillColors[0]: start point color + // fillColors[1],[2]: control point color + // fillColors[3]: end point color + var fillColors = []; + for (m = 0; m < 4; m++) { + fillColors.push([]); + } + fillColors[0] = + this.immediateMode.geometry.vertexColors.slice(-4); + fillColors[3] = this.curFillColor.slice(); + // Do the same for strokeColor. + var strokeColors = []; + for (m = 0; m < 4; m++) { + strokeColors.push([]); + } + strokeColors[0] = + this.immediateMode.geometry.vertexStrokeColors.slice(-4); + strokeColors[3] = this.curStrokeColor.slice(); + if (argLength === 6) { + this.isBezier = true; + w_x = [ + this.immediateMode._bezierVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 4 ? undefined : arguments[4], + ]; + w_y = [ + this.immediateMode._bezierVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 3 ? undefined : arguments[3], + arguments.length <= 5 ? undefined : arguments[5], + ]; + // The ratio of the distance between the start point, the two control- + // points, and the end point determines the intermediate color. + var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); + var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); + var d2 = Math.hypot(w_x[2] - w_x[3], w_y[2] - w_y[3]); + var totalLength = d0 + d1 + d2; + d0 /= totalLength; + d2 /= totalLength; + for (k = 0; k < 4; k++) { + fillColors[1].push( + fillColors[0][k] * (1 - d0) + fillColors[3][k] * d0, + ); + fillColors[2].push( + fillColors[0][k] * d2 + fillColors[3][k] * (1 - d2), + ); + strokeColors[1].push( + strokeColors[0][k] * (1 - d0) + strokeColors[3][k] * d0, + ); + strokeColors[2].push( + strokeColors[0][k] * d2 + strokeColors[3][k] * (1 - d2), + ); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [0, 0, 0, 0]; + this.curStrokeColor = [0, 0, 0, 0]; + _x = _y = 0; + for (m = 0; m < 4; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += + this._lookUpTableBezier[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += + this._lookUpTableBezier[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableBezier[i][m]; + _y += w_y[m] * this._lookUpTableBezier[i][m]; + } + this.vertex(_x, _y); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[3]; + this.curStrokeColor = strokeColors[3]; + this.immediateMode._bezierVertex[0] = + arguments.length <= 4 ? undefined : arguments[4]; + this.immediateMode._bezierVertex[1] = + arguments.length <= 5 ? undefined : arguments[5]; + } else if (argLength === 9) { + this.isBezier = true; + w_x = [ + this.immediateMode._bezierVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 3 ? undefined : arguments[3], + arguments.length <= 6 ? undefined : arguments[6], + ]; + w_y = [ + this.immediateMode._bezierVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 4 ? undefined : arguments[4], + arguments.length <= 7 ? undefined : arguments[7], + ]; + w_z = [ + this.immediateMode._bezierVertex[2], + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 5 ? undefined : arguments[5], + arguments.length <= 8 ? undefined : arguments[8], + ]; + // The ratio of the distance between the start point, the two control- + // points, and the end point determines the intermediate color. + var _d = Math.hypot( + w_x[0] - w_x[1], + w_y[0] - w_y[1], + w_z[0] - w_z[1], + ); + var _d2 = Math.hypot( + w_x[1] - w_x[2], + w_y[1] - w_y[2], + w_z[1] - w_z[2], + ); + var _d3 = Math.hypot( + w_x[2] - w_x[3], + w_y[2] - w_y[3], + w_z[2] - w_z[3], + ); + var _totalLength = _d + _d2 + _d3; + _d /= _totalLength; + _d3 /= _totalLength; + for (k = 0; k < 4; k++) { + fillColors[1].push( + fillColors[0][k] * (1 - _d) + fillColors[3][k] * _d, + ); + fillColors[2].push( + fillColors[0][k] * _d3 + fillColors[3][k] * (1 - _d3), + ); + strokeColors[1].push( + strokeColors[0][k] * (1 - _d) + strokeColors[3][k] * _d, + ); + strokeColors[2].push( + strokeColors[0][k] * _d3 + strokeColors[3][k] * (1 - _d3), + ); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [0, 0, 0, 0]; + this.curStrokeColor = [0, 0, 0, 0]; + _x = _y = _z = 0; + for (m = 0; m < 4; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += + this._lookUpTableBezier[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += + this._lookUpTableBezier[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableBezier[i][m]; + _y += w_y[m] * this._lookUpTableBezier[i][m]; + _z += w_z[m] * this._lookUpTableBezier[i][m]; + } + this.vertex(_x, _y, _z); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[3]; + this.curStrokeColor = strokeColors[3]; + this.immediateMode._bezierVertex[0] = + arguments.length <= 6 ? undefined : arguments[6]; + this.immediateMode._bezierVertex[1] = + arguments.length <= 7 ? undefined : arguments[7]; + this.immediateMode._bezierVertex[2] = + arguments.length <= 8 ? undefined : arguments[8]; + } + } + }; + _main.default.RendererGL.prototype.quadraticVertex = function () { + if (this.immediateMode._quadraticVertex.length === 0) { + throw Error( + "vertex() must be used once before calling quadraticVertex()", + ); + } else { + var w_x = []; + var w_y = []; + var w_z = []; + var t, _x, _y, _z, i, k, m; + // variable i for bezierPoints, k for components, and m for anchor points. + var argLength = arguments.length; + t = 0; + if ( + this._lookUpTableQuadratic.length === 0 || + this._lutQuadraticDetail !== this._pInst._curveDetail + ) { + this._lookUpTableQuadratic = []; + this._lutQuadraticDetail = this._pInst._curveDetail; + var step = 1 / this._lutQuadraticDetail; + var start = 0; + var end = 1; + var j = 0; + while (start < 1) { + t = parseFloat(start.toFixed(6)); + this._lookUpTableQuadratic[j] = + this._quadraticCoefficients(t); + if (end.toFixed(6) === step.toFixed(6)) { + t = + parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); + ++j; + this._lookUpTableQuadratic[j] = + this._quadraticCoefficients(t); + break; + } + start += step; + end -= step; + ++j; + } + } + var LUTLength = this._lookUpTableQuadratic.length; + // fillColors[0]: start point color + // fillColors[1]: control point color + // fillColors[2]: end point color + var fillColors = []; + for (m = 0; m < 3; m++) { + fillColors.push([]); + } + fillColors[0] = + this.immediateMode.geometry.vertexColors.slice(-4); + fillColors[2] = this.curFillColor.slice(); + // Do the same for strokeColor. + var strokeColors = []; + for (m = 0; m < 3; m++) { + strokeColors.push([]); + } + strokeColors[0] = + this.immediateMode.geometry.vertexStrokeColors.slice(-4); + strokeColors[2] = this.curStrokeColor.slice(); + if (argLength === 4) { + this.isQuadratic = true; + w_x = [ + this.immediateMode._quadraticVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 2 ? undefined : arguments[2], + ]; + w_y = [ + this.immediateMode._quadraticVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 3 ? undefined : arguments[3], + ]; + // The ratio of the distance between the start point, the control- + // point, and the end point determines the intermediate color. + var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); + var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); + var totalLength = d0 + d1; + d0 /= totalLength; + for (k = 0; k < 4; k++) { + fillColors[1].push( + fillColors[0][k] * (1 - d0) + fillColors[2][k] * d0, + ); + strokeColors[1].push( + strokeColors[0][k] * (1 - d0) + strokeColors[2][k] * d0, + ); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [0, 0, 0, 0]; + this.curStrokeColor = [0, 0, 0, 0]; + _x = _y = 0; + for (m = 0; m < 3; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += + this._lookUpTableQuadratic[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += + this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableQuadratic[i][m]; + _y += w_y[m] * this._lookUpTableQuadratic[i][m]; + } + this.vertex(_x, _y); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[2]; + this.curStrokeColor = strokeColors[2]; + this.immediateMode._quadraticVertex[0] = + arguments.length <= 2 ? undefined : arguments[2]; + this.immediateMode._quadraticVertex[1] = + arguments.length <= 3 ? undefined : arguments[3]; + } else if (argLength === 6) { + this.isQuadratic = true; + w_x = [ + this.immediateMode._quadraticVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 3 ? undefined : arguments[3], + ]; + w_y = [ + this.immediateMode._quadraticVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 4 ? undefined : arguments[4], + ]; + w_z = [ + this.immediateMode._quadraticVertex[2], + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 5 ? undefined : arguments[5], + ]; + // The ratio of the distance between the start point, the control- + // point, and the end point determines the intermediate color. + var _d4 = Math.hypot( + w_x[0] - w_x[1], + w_y[0] - w_y[1], + w_z[0] - w_z[1], + ); + var _d5 = Math.hypot( + w_x[1] - w_x[2], + w_y[1] - w_y[2], + w_z[1] - w_z[2], + ); + var _totalLength2 = _d4 + _d5; + _d4 /= _totalLength2; + for (k = 0; k < 4; k++) { + fillColors[1].push( + fillColors[0][k] * (1 - _d4) + fillColors[2][k] * _d4, + ); + strokeColors[1].push( + strokeColors[0][k] * (1 - _d4) + strokeColors[2][k] * _d4, + ); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [0, 0, 0, 0]; + this.curStrokeColor = [0, 0, 0, 0]; + _x = _y = _z = 0; + for (m = 0; m < 3; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += + this._lookUpTableQuadratic[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += + this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableQuadratic[i][m]; + _y += w_y[m] * this._lookUpTableQuadratic[i][m]; + _z += w_z[m] * this._lookUpTableQuadratic[i][m]; + } + this.vertex(_x, _y, _z); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[2]; + this.curStrokeColor = strokeColors[2]; + this.immediateMode._quadraticVertex[0] = + arguments.length <= 3 ? undefined : arguments[3]; + this.immediateMode._quadraticVertex[1] = + arguments.length <= 4 ? undefined : arguments[4]; + this.immediateMode._quadraticVertex[2] = + arguments.length <= 5 ? undefined : arguments[5]; + } + } + }; + _main.default.RendererGL.prototype.curveVertex = function () { + var w_x = []; + var w_y = []; + var w_z = []; + var t, _x, _y, _z, i; + t = 0; + var argLength = arguments.length; + if ( + this._lookUpTableBezier.length === 0 || + this._lutBezierDetail !== this._pInst._curveDetail + ) { + this._lookUpTableBezier = []; + this._lutBezierDetail = this._pInst._curveDetail; + var step = 1 / this._lutBezierDetail; + var start = 0; + var end = 1; + var j = 0; + while (start < 1) { + t = parseFloat(start.toFixed(6)); + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + if (end.toFixed(6) === step.toFixed(6)) { + t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); + ++j; + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + break; + } + start += step; + end -= step; + ++j; + } + } + var LUTLength = this._lookUpTableBezier.length; + if (argLength === 2) { + this.immediateMode._curveVertex.push( + arguments.length <= 0 ? undefined : arguments[0], + ); + this.immediateMode._curveVertex.push( + arguments.length <= 1 ? undefined : arguments[1], + ); + if (this.immediateMode._curveVertex.length === 8) { + this.isCurve = true; + w_x = this._bezierToCatmull([ + this.immediateMode._curveVertex[0], + this.immediateMode._curveVertex[2], + this.immediateMode._curveVertex[4], + this.immediateMode._curveVertex[6], + ]); + w_y = this._bezierToCatmull([ + this.immediateMode._curveVertex[1], + this.immediateMode._curveVertex[3], + this.immediateMode._curveVertex[5], + this.immediateMode._curveVertex[7], + ]); + for (i = 0; i < LUTLength; i++) { + _x = + w_x[0] * this._lookUpTableBezier[i][0] + + w_x[1] * this._lookUpTableBezier[i][1] + + w_x[2] * this._lookUpTableBezier[i][2] + + w_x[3] * this._lookUpTableBezier[i][3]; + _y = + w_y[0] * this._lookUpTableBezier[i][0] + + w_y[1] * this._lookUpTableBezier[i][1] + + w_y[2] * this._lookUpTableBezier[i][2] + + w_y[3] * this._lookUpTableBezier[i][3]; + this.vertex(_x, _y); + } + for (i = 0; i < argLength; i++) { + this.immediateMode._curveVertex.shift(); + } + } + } else if (argLength === 3) { + this.immediateMode._curveVertex.push( + arguments.length <= 0 ? undefined : arguments[0], + ); + this.immediateMode._curveVertex.push( + arguments.length <= 1 ? undefined : arguments[1], + ); + this.immediateMode._curveVertex.push( + arguments.length <= 2 ? undefined : arguments[2], + ); + if (this.immediateMode._curveVertex.length === 12) { + this.isCurve = true; + w_x = this._bezierToCatmull([ + this.immediateMode._curveVertex[0], + this.immediateMode._curveVertex[3], + this.immediateMode._curveVertex[6], + this.immediateMode._curveVertex[9], + ]); + w_y = this._bezierToCatmull([ + this.immediateMode._curveVertex[1], + this.immediateMode._curveVertex[4], + this.immediateMode._curveVertex[7], + this.immediateMode._curveVertex[10], + ]); + w_z = this._bezierToCatmull([ + this.immediateMode._curveVertex[2], + this.immediateMode._curveVertex[5], + this.immediateMode._curveVertex[8], + this.immediateMode._curveVertex[11], + ]); + for (i = 0; i < LUTLength; i++) { + _x = + w_x[0] * this._lookUpTableBezier[i][0] + + w_x[1] * this._lookUpTableBezier[i][1] + + w_x[2] * this._lookUpTableBezier[i][2] + + w_x[3] * this._lookUpTableBezier[i][3]; + _y = + w_y[0] * this._lookUpTableBezier[i][0] + + w_y[1] * this._lookUpTableBezier[i][1] + + w_y[2] * this._lookUpTableBezier[i][2] + + w_y[3] * this._lookUpTableBezier[i][3]; + _z = + w_z[0] * this._lookUpTableBezier[i][0] + + w_z[1] * this._lookUpTableBezier[i][1] + + w_z[2] * this._lookUpTableBezier[i][2] + + w_z[3] * this._lookUpTableBezier[i][3]; + this.vertex(_x, _y, _z); + } + for (i = 0; i < argLength; i++) { + this.immediateMode._curveVertex.shift(); + } + } + } + }; + _main.default.RendererGL.prototype.image = function ( + img, + sx, + sy, + sWidth, + sHeight, + dx, + dy, + dWidth, + dHeight, + ) { + if (this._isErasing) { + this.blendMode(this._cachedBlendMode); + } + this._pInst.push(); + this._pInst.noLights(); + this._pInst.noStroke(); + this._pInst.texture(img); + this._pInst.textureMode(constants.NORMAL); + var u0 = 0; + if (sx <= img.width) { + u0 = sx / img.width; + } + var u1 = 1; + if (sx + sWidth <= img.width) { + u1 = (sx + sWidth) / img.width; + } + var v0 = 0; + if (sy <= img.height) { + v0 = sy / img.height; + } + var v1 = 1; + if (sy + sHeight <= img.height) { + v1 = (sy + sHeight) / img.height; + } + this.beginShape(); + this.vertex(dx, dy, 0, u0, v0); + this.vertex(dx + dWidth, dy, 0, u1, v0); + this.vertex(dx + dWidth, dy + dHeight, 0, u1, v1); + this.vertex(dx, dy + dHeight, 0, u0, v1); + this.endShape(constants.CLOSE); + this._pInst.pop(); + if (this._isErasing) { + this.blendMode(constants.REMOVE); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.Geometry": 350, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.math.hypot": 188, + "core-js/modules/es.math.sign": 190, + "core-js/modules/es.number.to-fixed": 193, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 342: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.object.assign"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @private + * A class responsible for converting successive WebGL draw calls into a single + * `p5.Geometry` that can be reused and drawn with `model()`. + */ + + var GeometryBuilder = /*#__PURE__*/ (function () { + function GeometryBuilder(renderer) { + _classCallCheck(this, GeometryBuilder); + this.renderer = renderer; + renderer._pInst.push(); + this.identityMatrix = new _main.default.Matrix(); + renderer.uMVMatrix = new _main.default.Matrix(); + this.geometry = new _main.default.Geometry(); + this.geometry.gid = "_p5_GeometryBuilder_".concat( + GeometryBuilder.nextGeometryId, + ); + GeometryBuilder.nextGeometryId++; + this.hasTransform = false; + } /** + * @private + * Applies the current transformation matrix to each vertex. + */ + + _createClass(GeometryBuilder, [ + { + key: "transformVertices", + value: function transformVertices(vertices) { + var _this = this; + if (!this.hasTransform) return vertices; + return vertices.map(function (v) { + return _this.renderer.uMVMatrix.multiplyPoint(v); + }); + } /** + * @private + * Applies the current normal matrix to each normal. + */, + }, + { + key: "transformNormals", + value: function transformNormals(normals) { + var _this2 = this; + if (!this.hasTransform) return normals; + return normals.map(function (v) { + return _this2.renderer.uNMatrix.multiplyVec3(v); + }); + } /** + * @private + * Adds a p5.Geometry to the builder's combined geometry, flattening + * transformations. + */, + }, + { + key: "addGeometry", + value: function addGeometry(input) { + var _this3 = this, + _this$geometry$vertic, + _this$geometry$vertex, + _this$geometry$uvs, + _this$geometry$vertex2; + this.hasTransform = !this.renderer.uMVMatrix.mat4.every( + function (v, i) { + return v === _this3.identityMatrix.mat4[i]; + }, + ); + if (this.hasTransform) { + this.renderer.uNMatrix.inverseTranspose( + this.renderer.uMVMatrix, + ); + } + var startIdx = this.geometry.vertices.length; + (_this$geometry$vertic = this.geometry.vertices).push.apply( + _this$geometry$vertic, + _toConsumableArray(this.transformVertices(input.vertices)), + ); + (_this$geometry$vertex = + this.geometry.vertexNormals).push.apply( + _this$geometry$vertex, + _toConsumableArray( + this.transformNormals(input.vertexNormals), + ), + ); + (_this$geometry$uvs = this.geometry.uvs).push.apply( + _this$geometry$uvs, + _toConsumableArray(input.uvs), + ); + if (this.renderer._doFill) { + var _this$geometry$faces; + (_this$geometry$faces = this.geometry.faces).push.apply( + _this$geometry$faces, + _toConsumableArray( + input.faces.map(function (f) { + return f.map(function (idx) { + return idx + startIdx; + }); + }), + ), + ); + } + if (this.renderer._doStroke) { + var _this$geometry$edges; + (_this$geometry$edges = this.geometry.edges).push.apply( + _this$geometry$edges, + _toConsumableArray( + input.edges.map(function (edge) { + return edge.map(function (idx) { + return idx + startIdx; + }); + }), + ), + ); + } + var vertexColors = _toConsumableArray(input.vertexColors); + while (vertexColors.length < input.vertices.length * 4) { + vertexColors.push.apply( + vertexColors, + _toConsumableArray(this.renderer.curFillColor), + ); + } + (_this$geometry$vertex2 = + this.geometry.vertexColors).push.apply( + _this$geometry$vertex2, + _toConsumableArray(vertexColors), + ); + } /** + * Adds geometry from the renderer's immediate mode into the builder's + * combined geometry. + */, + }, + { + key: "addImmediate", + value: function addImmediate() { + var geometry = this.renderer.immediateMode.geometry; + var shapeMode = this.renderer.immediateMode.shapeMode; + var faces = []; + if (this.renderer._doFill) { + if ( + shapeMode === constants.TRIANGLE_STRIP || + shapeMode === constants.QUAD_STRIP + ) { + for (var i = 2; i < geometry.vertices.length; i++) { + if (i % 2 === 0) { + faces.push([i, i - 1, i - 2]); + } else { + faces.push([i, i - 2, i - 1]); + } + } + } else if (shapeMode === constants.TRIANGLE_FAN) { + for (var _i = 2; _i < geometry.vertices.length; _i++) { + faces.push([0, _i - 1, _i]); + } + } else { + for ( + var _i2 = 0; + _i2 < geometry.vertices.length; + _i2 += 3 + ) { + faces.push([_i2, _i2 + 1, _i2 + 2]); + } + } + } + this.addGeometry( + Object.assign({}, geometry, { + faces: faces, + }), + ); + } /** + * Adds geometry from the renderer's retained mode into the builder's + * combined geometry. + */, + }, + { + key: "addRetained", + value: function addRetained(geometry) { + this.addGeometry(geometry.model); + } /** + * Cleans up the state of the renderer and returns the combined geometry that + * was built. + * @returns p5.Geometry The flattened, combined geometry + */, + }, + { + key: "finish", + value: function finish() { + this.renderer._pInst.pop(); + return this.geometry; + }, + }, + ]); + return GeometryBuilder; + })(); + /** + * Keeps track of how many custom geometry objects have been made so that each + * can be assigned a unique ID. + */ + GeometryBuilder.nextGeometryId = 0; + var _default = GeometryBuilder; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.every": 171, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.object.assign": 194, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 343: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.math.sign"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.math.sign"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module 3D + * @submodule Interaction + * @for p5 + * @requires core + */ + /** + * Allows movement around a 3D sketch using a mouse or trackpad or touch. + * Left-clicking and dragging or swipe motion will rotate the camera position + * about the center of the sketch, right-clicking and dragging or multi-swipe + * will pan the camera position without rotation, and using the mouse wheel + * (scrolling) or pinch in/out will move the camera further or closer + * from the center of the sketch. This function can be called with parameters + * dictating sensitivity to mouse/touch movement along the X and Y axes. + * Calling this function without parameters is equivalent to calling + * orbitControl(1,1). To reverse direction of movement in either axis, + * enter a negative number for sensitivity. + * @method orbitControl + * @for p5 + * @param {Number} [sensitivityX] sensitivity to mouse movement along X axis + * @param {Number} [sensitivityY] sensitivity to mouse movement along Y axis + * @param {Number} [sensitivityZ] sensitivity to scroll movement along Z axis + * @param {Object} [options] An optional object that can contain additional settings, + * disableTouchActions - Boolean, default value is true. + * Setting this to true makes mobile interactions smoother by preventing + * accidental interactions with the page while orbiting. But if you're already + * doing it via css or want the default touch actions, consider setting it to false. + * freeRotation - Boolean, default value is false. + * By default, horizontal movement of the mouse or touch pointer rotates the camera + * around the y-axis, and vertical movement rotates the camera around the x-axis. + * But if setting this option to true, the camera always rotates in the direction + * the pointer is moving. For zoom and move, the behavior is the same regardless of + * true/false. + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * describe( + * 'Camera orbits around a box when mouse is hold-clicked & then moved.' + * ); + * } + * function draw() { + * background(200); + * + * // If you execute the line commented out instead of next line, the direction of rotation + * // will be the direction the mouse or touch pointer moves, not around the X or Y axis. + * orbitControl(); + * // orbitControl(1, 1, 1, {freeRotation: true}); + * + * rotateY(0.5); + * box(30, 50); + * } + * + *
                    + * + * @alt + * Camera orbits around a box when mouse is hold-clicked & then moved. + */ + // implementation based on three.js 'orbitControls': + // https://github.com/mrdoob/three.js/blob/6afb8595c0bf8b2e72818e42b64e6fe22707d896/examples/jsm/controls/OrbitControls.js#L22 + + _main.default.prototype.orbitControl = function ( + sensitivityX, + sensitivityY, + sensitivityZ, + options, + ) { + var _this = this; + this._assert3d("orbitControl"); + _main.default._validateParameters("orbitControl", arguments); + var cam = this._renderer._curCamera; + if (typeof sensitivityX === "undefined") { + sensitivityX = 1; + } + if (typeof sensitivityY === "undefined") { + sensitivityY = sensitivityX; + } + if (typeof sensitivityZ === "undefined") { + sensitivityZ = 1; + } + if (_typeof(options) !== "object") { + options = {}; + } // default right-mouse and mouse-wheel behaviors (context menu and scrolling, + // respectively) are disabled here to allow use of those events for panning and + // zooming. However, whether or not to disable touch actions is an option. + // disable context menu for canvas element and add 'contextMenuDisabled' + // flag to p5 instance + + if (this.contextMenuDisabled !== true) { + this.canvas.oncontextmenu = function () { + return false; + }; + this._setProperty("contextMenuDisabled", true); + } // disable default scrolling behavior on the canvas element and add + // 'wheelDefaultDisabled' flag to p5 instance + + if (this.wheelDefaultDisabled !== true) { + this.canvas.onwheel = function () { + return false; + }; + this._setProperty("wheelDefaultDisabled", true); + } // disable default touch behavior on the canvas element and add + // 'touchActionsDisabled' flag to p5 instance + + var _options = options, + _options$disableTouch = _options.disableTouchActions, + disableTouchActions = + _options$disableTouch === void 0 ? true : _options$disableTouch; + if (this.touchActionsDisabled !== true && disableTouchActions) { + this.canvas.style["touch-action"] = "none"; + this._setProperty("touchActionsDisabled", true); + } // If option.freeRotation is true, the camera always rotates freely in the direction + // the pointer moves. default value is false (normal behavior) + + var _options2 = options, + _options2$freeRotatio = _options2.freeRotation, + freeRotation = + _options2$freeRotatio === void 0 + ? false + : _options2$freeRotatio; // get moved touches. + var movedTouches = []; + this.touches.forEach(function (curTouch) { + _this._renderer.prevTouches.forEach(function (prevTouch) { + if (curTouch.id === prevTouch.id) { + var movedTouch = { + x: curTouch.x, + y: curTouch.y, + px: prevTouch.x, + py: prevTouch.y, + }; + movedTouches.push(movedTouch); + } + }); + }); + this._renderer.prevTouches = this.touches; + // The idea of using damping is based on the following website. thank you. + // https://github.com/freshfork/p5.EasyCam/blob/9782964680f6a5c4c9bee825c475d9f2021d5134/p5.easycam.js#L1124 + // variables for interaction + var deltaRadius = 0; + var deltaTheta = 0; + var deltaPhi = 0; + var moveDeltaX = 0; + var moveDeltaY = 0; + // constants for dampingProcess + var damping = 0.85; + var rotateAccelerationFactor = 0.6; + var moveAccelerationFactor = 0.15; + // For touches, the appropriate scale is different + // because the distance difference is multiplied. + var mouseZoomScaleFactor = 0.01; + var touchZoomScaleFactor = 0.0004; + var scaleFactor = + this.height < this.width ? this.height : this.width; + // Flag whether the mouse or touch pointer is inside the canvas + var pointersInCanvas = false; + // calculate and determine flags and variables. + if (movedTouches.length > 0) { + /* for touch */ + // if length === 1, rotate + // if length > 1, zoom and move + // for touch, it is calculated based on one moved touch pointer position. + pointersInCanvas = + movedTouches[0].x > 0 && + movedTouches[0].x < this.width && + movedTouches[0].y > 0 && + movedTouches[0].y < this.height; + if (movedTouches.length === 1) { + var t = movedTouches[0]; + deltaTheta = (-sensitivityX * (t.x - t.px)) / scaleFactor; + deltaPhi = (sensitivityY * (t.y - t.py)) / scaleFactor; + } else { + var t0 = movedTouches[0]; + var t1 = movedTouches[1]; + var distWithTouches = Math.hypot(t0.x - t1.x, t0.y - t1.y); + var prevDistWithTouches = Math.hypot( + t0.px - t1.px, + t0.py - t1.py, + ); + var changeDist = distWithTouches - prevDistWithTouches; + // move the camera farther when the distance between the two touch points + // decreases, move the camera closer when it increases. + deltaRadius = -changeDist * sensitivityZ * touchZoomScaleFactor; + // Move the center of the camera along with the movement of + // the center of gravity of the two touch points. + moveDeltaX = 0.5 * (t0.x + t1.x) - 0.5 * (t0.px + t1.px); + moveDeltaY = 0.5 * (t0.y + t1.y) - 0.5 * (t0.py + t1.py); + } + if (this.touches.length > 0) { + if (pointersInCanvas) { + // Initiate an interaction if touched in the canvas + this._renderer.executeRotateAndMove = true; + this._renderer.executeZoom = true; + } + } else { + // End an interaction when the touch is released + this._renderer.executeRotateAndMove = false; + this._renderer.executeZoom = false; + } + } else { + /* for mouse */ + // if wheelDeltaY !== 0, zoom + // if mouseLeftButton is down, rotate + // if mouseRightButton is down, move + // For mouse, it is calculated based on the mouse position. + pointersInCanvas = + this.mouseX > 0 && + this.mouseX < this.width && + this.mouseY > 0 && + this.mouseY < this.height; + if (this._mouseWheelDeltaY !== 0) { + // zoom the camera depending on the value of _mouseWheelDeltaY. + // move away if positive, move closer if negative + deltaRadius = Math.sign(this._mouseWheelDeltaY) * sensitivityZ; + deltaRadius *= mouseZoomScaleFactor; + this._mouseWheelDeltaY = 0; + // start zoom when the mouse is wheeled within the canvas. + if (pointersInCanvas) this._renderer.executeZoom = true; + } else { + // quit zoom when you stop wheeling. + this._renderer.zoomFlag = false; + } + if (this.mouseIsPressed) { + if (this.mouseButton === this.LEFT) { + deltaTheta = (-sensitivityX * this.movedX) / scaleFactor; + deltaPhi = (sensitivityY * this.movedY) / scaleFactor; + } else if (this.mouseButton === this.RIGHT) { + moveDeltaX = this.movedX; + moveDeltaY = this.movedY * cam.yScale; + } // start rotate and move when mouse is pressed within the canvas. + + if (pointersInCanvas) + this._renderer.executeRotateAndMove = true; + } else { + // quit rotate and move if mouse is released. + this._renderer.executeRotateAndMove = false; + } + } // interactions + // zoom process + + if (deltaRadius !== 0 && this._renderer.executeZoom) { + // accelerate zoom velocity + this._renderer.zoomVelocity += deltaRadius; + } + if (Math.abs(this._renderer.zoomVelocity) > 0.001) { + // if freeRotation is true, we use _orbitFree() instead of _orbit() + if (freeRotation) { + cam._orbitFree(0, 0, this._renderer.zoomVelocity); + } else { + cam._orbit(0, 0, this._renderer.zoomVelocity); + } // In orthogonal projection, the scale does not change even if + // the distance to the gaze point is changed, so the projection matrix + // needs to be modified. + + if (cam.projMatrix.mat4[15] !== 0) { + cam.projMatrix.mat4[0] *= Math.pow( + 10, + -this._renderer.zoomVelocity, + ); + cam.projMatrix.mat4[5] *= Math.pow( + 10, + -this._renderer.zoomVelocity, + ); + // modify uPMatrix + this._renderer.uPMatrix.mat4[0] = cam.projMatrix.mat4[0]; + this._renderer.uPMatrix.mat4[5] = cam.projMatrix.mat4[5]; + } // damping + + this._renderer.zoomVelocity *= damping; + } else { + this._renderer.zoomVelocity = 0; + } // rotate process + + if ( + (deltaTheta !== 0 || deltaPhi !== 0) && + this._renderer.executeRotateAndMove + ) { + // accelerate rotate velocity + this._renderer.rotateVelocity.add( + deltaTheta * rotateAccelerationFactor, + deltaPhi * rotateAccelerationFactor, + ); + } + if (this._renderer.rotateVelocity.magSq() > 0.000001) { + // if freeRotation is true, the camera always rotates freely in the direction the pointer moves + if (freeRotation) { + cam._orbitFree( + -this._renderer.rotateVelocity.x, + this._renderer.rotateVelocity.y, + 0, + ); + } else { + cam._orbit( + this._renderer.rotateVelocity.x, + this._renderer.rotateVelocity.y, + 0, + ); + } // damping + + this._renderer.rotateVelocity.mult(damping); + } else { + this._renderer.rotateVelocity.set(0, 0); + } // move process + + if ( + (moveDeltaX !== 0 || moveDeltaY !== 0) && + this._renderer.executeRotateAndMove + ) { + // Normalize movement distance + var ndcX = (moveDeltaX * 2) / this.width; + var ndcY = (-moveDeltaY * 2) / this.height; + // accelerate move velocity + this._renderer.moveVelocity.add( + ndcX * moveAccelerationFactor, + ndcY * moveAccelerationFactor, + ); + } + if (this._renderer.moveVelocity.magSq() > 0.000001) { + // Translate the camera so that the entire object moves + // perpendicular to the line of sight when the mouse is moved + // or when the centers of gravity of the two touch pointers move. + var local = cam._getLocalAxes(); + // Calculate the z coordinate in the view coordinates of + // the center, that is, the distance to the view point + var diffX = cam.eyeX - cam.centerX; + var diffY = cam.eyeY - cam.centerY; + var diffZ = cam.eyeZ - cam.centerZ; + var viewZ = Math.sqrt( + diffX * diffX + diffY * diffY + diffZ * diffZ, + ); + // position vector of the center. + var cv = new _main.default.Vector( + cam.centerX, + cam.centerY, + cam.centerZ, + ); + // Calculate the normalized device coordinates of the center. + cv = cam.cameraMatrix.multiplyPoint(cv); + cv = this._renderer.uPMatrix.multiplyAndNormalizePoint(cv); + // Move the center by this distance + // in the normalized device coordinate system. + cv.x -= this._renderer.moveVelocity.x; + cv.y -= this._renderer.moveVelocity.y; + // Calculate the translation vector + // in the direction perpendicular to the line of sight of center. + var dx, dy; + var uP = this._renderer.uPMatrix.mat4; + if (uP[15] === 0) { + dx = ((uP[8] + cv.x) / uP[0]) * viewZ; + dy = ((uP[9] + cv.y) / uP[5]) * viewZ; + } else { + dx = (cv.x - uP[12]) / uP[0]; + dy = (cv.y - uP[13]) / uP[5]; + } // translate the camera. + + cam.setPosition( + cam.eyeX + dx * local.x[0] + dy * local.y[0], + cam.eyeY + dx * local.x[1] + dy * local.y[1], + cam.eyeZ + dx * local.x[2] + dy * local.y[2], + ); + // damping + this._renderer.moveVelocity.mult(damping); + } else { + this._renderer.moveVelocity.set(0, 0); + } + return this; + }; + /** + * debugMode() helps visualize 3D space by adding a grid to indicate where the + * ‘ground’ is in a sketch and an axes icon which indicates the +X, +Y, and +Z + * directions. This function can be called without parameters to create a + * default grid and axes icon, or it can be called according to the examples + * above to customize the size and position of the grid and/or axes icon. The + * grid is drawn using the most recently set stroke color and weight. To + * specify these parameters, add a call to stroke() and strokeWeight() + * just before the end of the draw() loop. + * + * By default, the grid will run through the origin (0,0,0) of the sketch + * along the XZ plane + * and the axes icon will be offset from the origin. Both the grid and axes + * icon will be sized according to the current canvas size. Note that because the + * grid runs parallel to the default camera view, it is often helpful to use + * debugMode along with orbitControl to allow full view of the grid. + * @method debugMode + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * // Press the spacebar to turn debugMode off! + * if (keyIsDown(32)) { + * noDebugMode(); + * } + * } + * + *
                    + * @alt + * a 3D box is centered on a grid in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. the grid and icon disappear when the + * spacebar is pressed. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(GRID); + * describe('a 3D box is centered on a grid in a 3D sketch.'); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * } + * + *
                    + * @alt + * a 3D box is centered on a grid in a 3D sketch. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(AXES); + * describe( + * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * } + * + *
                    + * @alt + * a 3D box is centered in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(GRID, 100, 10, 0, 0, 0); + * describe('a 3D box is centered on a grid in a 3D sketch'); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * } + * + *
                    + * @alt + * a 3D box is centered on a grid in a 3D sketch + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(100, 10, 0, 0, 0, 20, 0, -40, 0); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); + * } + * + * function draw() { + * noStroke(); + * background(200); + * orbitControl(); + * box(15, 30); + * // set the stroke color and weight for the grid! + * stroke(255, 0, 150); + * strokeWeight(0.8); + * } + * + *
                    + * @alt + * a 3D box is centered on a grid in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. + */ + /** + * @method debugMode + * @param {Constant} mode either GRID or AXES + */ + /** + * @method debugMode + * @param {Constant} mode + * @param {Number} [gridSize] size of one side of the grid + * @param {Number} [gridDivisions] number of divisions in the grid + * @param {Number} [xOff] X axis offset from origin (0,0,0) + * @param {Number} [yOff] Y axis offset from origin (0,0,0) + * @param {Number} [zOff] Z axis offset from origin (0,0,0) + */ + /** + * @method debugMode + * @param {Constant} mode + * @param {Number} [axesSize] size of axes icon + * @param {Number} [xOff] + * @param {Number} [yOff] + * @param {Number} [zOff] + */ + /** + * @method debugMode + * @param {Number} [gridSize] + * @param {Number} [gridDivisions] + * @param {Number} [gridXOff] + * @param {Number} [gridYOff] + * @param {Number} [gridZOff] + * @param {Number} [axesSize] + * @param {Number} [axesXOff] + * @param {Number} [axesYOff] + * @param {Number} [axesZOff] + */ + _main.default.prototype.debugMode = function () { + this._assert3d("debugMode"); + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("debugMode", args); + // start by removing existing 'post' registered debug methods + for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { + // test for equality... + if ( + this._registeredMethods.post[i].toString() === + this._grid().toString() || + this._registeredMethods.post[i].toString() === + this._axesIcon().toString() + ) { + this._registeredMethods.post.splice(i, 1); + } + } // then add new debugMode functions according to the argument list + + if (args[0] === constants.GRID) { + this.registerMethod( + "post", + this._grid.call( + this, + args[1], + args[2], + args[3], + args[4], + args[5], + ), + ); + } else if (args[0] === constants.AXES) { + this.registerMethod( + "post", + this._axesIcon.call(this, args[1], args[2], args[3], args[4]), + ); + } else { + this.registerMethod( + "post", + this._grid.call( + this, + args[0], + args[1], + args[2], + args[3], + args[4], + ), + ); + this.registerMethod( + "post", + this._axesIcon.call(this, args[5], args[6], args[7], args[8]), + ); + } + }; + /** + * Turns off debugMode() in a 3D sketch. + * @method noDebugMode + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * // Press the spacebar to turn debugMode off! + * if (keyIsDown(32)) { + * noDebugMode(); + * } + * } + * + *
                    + * @alt + * a 3D box is centered on a grid in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. the grid and icon disappear when the + * spacebar is pressed. + */ + _main.default.prototype.noDebugMode = function () { + this._assert3d("noDebugMode"); + // start by removing existing 'post' registered debug methods + for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { + // test for equality... + if ( + this._registeredMethods.post[i].toString() === + this._grid().toString() || + this._registeredMethods.post[i].toString() === + this._axesIcon().toString() + ) { + this._registeredMethods.post.splice(i, 1); + } + } + }; + /** + * For use with debugMode + * @private + * @method _grid + * @param {Number} [size] size of grid sides + * @param {Number} [div] number of grid divisions + * @param {Number} [xOff] offset of grid center from origin in X axis + * @param {Number} [yOff] offset of grid center from origin in Y axis + * @param {Number} [zOff] offset of grid center from origin in Z axis + */ + _main.default.prototype._grid = function ( + size, + numDivs, + xOff, + yOff, + zOff, + ) { + if (typeof size === "undefined") { + size = this.width / 2; + } + if (typeof numDivs === "undefined") { + // ensure at least 2 divisions + numDivs = Math.round(size / 30) < 4 ? 4 : Math.round(size / 30); + } + if (typeof xOff === "undefined") { + xOff = 0; + } + if (typeof yOff === "undefined") { + yOff = 0; + } + if (typeof zOff === "undefined") { + zOff = 0; + } + var spacing = size / numDivs; + var halfSize = size / 2; + return function () { + this.push(); + this.stroke( + this._renderer.curStrokeColor[0] * 255, + this._renderer.curStrokeColor[1] * 255, + this._renderer.curStrokeColor[2] * 255, + ); + this._renderer.uMVMatrix.set( + this._renderer._curCamera.cameraMatrix.mat4[0], + this._renderer._curCamera.cameraMatrix.mat4[1], + this._renderer._curCamera.cameraMatrix.mat4[2], + this._renderer._curCamera.cameraMatrix.mat4[3], + this._renderer._curCamera.cameraMatrix.mat4[4], + this._renderer._curCamera.cameraMatrix.mat4[5], + this._renderer._curCamera.cameraMatrix.mat4[6], + this._renderer._curCamera.cameraMatrix.mat4[7], + this._renderer._curCamera.cameraMatrix.mat4[8], + this._renderer._curCamera.cameraMatrix.mat4[9], + this._renderer._curCamera.cameraMatrix.mat4[10], + this._renderer._curCamera.cameraMatrix.mat4[11], + this._renderer._curCamera.cameraMatrix.mat4[12], + this._renderer._curCamera.cameraMatrix.mat4[13], + this._renderer._curCamera.cameraMatrix.mat4[14], + this._renderer._curCamera.cameraMatrix.mat4[15], + ); + // Lines along X axis + for (var q = 0; q <= numDivs; q++) { + this.beginShape(this.LINES); + this.vertex( + -halfSize + xOff, + yOff, + q * spacing - halfSize + zOff, + ); + this.vertex( + +halfSize + xOff, + yOff, + q * spacing - halfSize + zOff, + ); + this.endShape(); + } // Lines along Z axis + + for (var i = 0; i <= numDivs; i++) { + this.beginShape(this.LINES); + this.vertex( + i * spacing - halfSize + xOff, + yOff, + -halfSize + zOff, + ); + this.vertex( + i * spacing - halfSize + xOff, + yOff, + +halfSize + zOff, + ); + this.endShape(); + } + this.pop(); + }; + }; + /** + * For use with debugMode + * @private + * @method _axesIcon + * @param {Number} [size] size of axes icon lines + * @param {Number} [xOff] offset of icon from origin in X axis + * @param {Number} [yOff] offset of icon from origin in Y axis + * @param {Number} [zOff] offset of icon from origin in Z axis + */ + _main.default.prototype._axesIcon = function ( + size, + xOff, + yOff, + zOff, + ) { + if (typeof size === "undefined") { + size = this.width / 20 > 40 ? this.width / 20 : 40; + } + if (typeof xOff === "undefined") { + xOff = -this.width / 4; + } + if (typeof yOff === "undefined") { + yOff = xOff; + } + if (typeof zOff === "undefined") { + zOff = xOff; + } + return function () { + this.push(); + this._renderer.uMVMatrix.set( + this._renderer._curCamera.cameraMatrix.mat4[0], + this._renderer._curCamera.cameraMatrix.mat4[1], + this._renderer._curCamera.cameraMatrix.mat4[2], + this._renderer._curCamera.cameraMatrix.mat4[3], + this._renderer._curCamera.cameraMatrix.mat4[4], + this._renderer._curCamera.cameraMatrix.mat4[5], + this._renderer._curCamera.cameraMatrix.mat4[6], + this._renderer._curCamera.cameraMatrix.mat4[7], + this._renderer._curCamera.cameraMatrix.mat4[8], + this._renderer._curCamera.cameraMatrix.mat4[9], + this._renderer._curCamera.cameraMatrix.mat4[10], + this._renderer._curCamera.cameraMatrix.mat4[11], + this._renderer._curCamera.cameraMatrix.mat4[12], + this._renderer._curCamera.cameraMatrix.mat4[13], + this._renderer._curCamera.cameraMatrix.mat4[14], + this._renderer._curCamera.cameraMatrix.mat4[15], + ); + // X axis + this.strokeWeight(2); + this.stroke(255, 0, 0); + this.beginShape(this.LINES); + this.vertex(xOff, yOff, zOff); + this.vertex(xOff + size, yOff, zOff); + this.endShape(); + // Y axis + this.stroke(0, 255, 0); + this.beginShape(this.LINES); + this.vertex(xOff, yOff, zOff); + this.vertex(xOff, yOff + size, zOff); + this.endShape(); + // Z axis + this.stroke(0, 0, 255); + this.beginShape(this.LINES); + this.vertex(xOff, yOff, zOff); + this.vertex(xOff, yOff, zOff + size); + this.endShape(); + this.pop(); + }; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.math.hypot": 188, + "core-js/modules/es.math.sign": 190, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 344: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module 3D + * @submodule Lights + * @for p5 + * @requires core + */ + /** + * Creates an ambient light with the given color. + * + * Ambient light does not come from a specific direction. + * Objects are evenly lit from all sides. Ambient lights are + * almost always used in combination with other types of lights. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method ambientLight + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @param {Number} [alpha] alpha value relative to current + * color range (default is 0-255) + * @chainable + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe('sphere with coral color under black light'); + * } + * function draw() { + * background(100); + * ambientLight(0); // black light (no light) + * ambientMaterial(255, 127, 80); // coral material + * sphere(40); + * } + * + *
                    + * @alt + * sphere with coral color under black light + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe('sphere with coral color under white light'); + * } + * function draw() { + * background(100); + * ambientLight(255); // white light + * ambientMaterial(255, 127, 80); // coral material + * sphere(40); + * } + * + *
                    + * @alt + * sphere with coral color under white light + * + * @example + *
                    + * + * function setup() { + * createCanvas(100,100,WEBGL); + * camera(0,-100,300); + * } + * function draw() { + * background(230); + * ambientMaterial(237,34,93); //Pink Material + * ambientLight(mouseY); + * //As you move the mouse up to down it changes from no ambient light to full ambient light. + * rotateY(millis()/2000); + * box(100); + * } + * + *
                    + * @alt + * pink ambient material cube under the ambient light + */ + /** + * @method ambientLight + * @param {Number} gray number specifying value between + * white and black + * @param {Number} [alpha] + * @chainable + */ + /** + * @method ambientLight + * @param {String} value a color string + * @chainable + */ + /** + * @method ambientLight + * @param {Number[]} values an array containing the red,green,blue & + * and alpha components of the color + * @chainable + */ + /** + * @method ambientLight + * @param {p5.Color} color color as a p5.Color + * @chainable + */ + + _main.default.prototype.ambientLight = function (v1, v2, v3, a) { + this._assert3d("ambientLight"); + _main.default._validateParameters("ambientLight", arguments); + var color = this.color.apply(this, arguments); + this._renderer.ambientLightColors.push( + color._array[0], + color._array[1], + color._array[2], + ); + this._renderer._enableLighting = true; + return this; + }; + /** + * Sets the color of the specular highlight of a non-ambient light + * (i.e. all lights except ambientLight()). + * + * specularColor() affects only the lights which are created after + * it in the code. + * + * This function is used in combination with + * specularMaterial(). + * If a geometry does not use specularMaterial(), this function + * will have no effect. + * + * The default color is white (255, 255, 255), which is used if + * specularColor() is not explicitly called. + * + * Note: specularColor is equivalent to the Processing function + * lightSpecular. + * + * @method specularColor + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @chainable + * @example + *
                    + * + * let setRedSpecularColor = true; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe( + * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' + * ); + * } + * + * function draw() { + * background(0); + * + * ambientLight(60); + * + * // add a point light to showcase specular color + * // -- use mouse location to position the light + * let lightPosX = mouseX - width / 2; + * let lightPosY = mouseY - height / 2; + * // -- set the light's specular color + * if (setRedSpecularColor) { + * specularColor(255, 0, 0); // red specular highlight + * } + * // -- create the light + * pointLight(200, 200, 200, lightPosX, lightPosY, 50); // white light + * + * // use specular material with high shininess + * specularMaterial(150); + * shininess(50); + * + * sphere(30, 64, 64); + * } + * + * function mouseClicked() { + * setRedSpecularColor = !setRedSpecularColor; + * } + * + *
                    + * + * @alt + * Sphere with specular highlight. Clicking the mouse toggles the + * specular highlight color between red and the default white. + */ + /** + * @method specularColor + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + /** + * @method specularColor + * @param {String} value color as a CSS string + * @chainable + */ + /** + * @method specularColor + * @param {Number[]} values color as an array containing the + * red, green, and blue components + * @chainable + */ + /** + * @method specularColor + * @param {p5.Color} color color as a p5.Color + * @chainable + */ + _main.default.prototype.specularColor = function (v1, v2, v3) { + this._assert3d("specularColor"); + _main.default._validateParameters("specularColor", arguments); + var color = this.color.apply(this, arguments); + this._renderer.specularColors = [ + color._array[0], + color._array[1], + color._array[2], + ]; + return this; + }; + /** + * Creates a directional light with the given color and direction. + * + * Directional light comes from one direction. + * The direction is specified as numbers inclusively between -1 and 1. + * For example, setting the direction as (0, -1, 0) will cause the + * geometry to be lit from below (since the light will be facing + * directly upwards). Similarly, setting the direction as (1, 0, 0) + * will cause the geometry to be lit from the left (since the light + * will be facing directly rightwards). + * + * Directional lights do not have a specific point of origin, and + * therefore cannot be positioned closer or farther away from a geometry. + * + * A maximum of **5** directional lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method directionalLight + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} x x component of direction (inclusive range of -1 to 1) + * @param {Number} y y component of direction (inclusive range of -1 to 1) + * @param {Number} z z component of direction (inclusive range of -1 to 1) + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' + * ); + * } + * function draw() { + * background(0); + * //move your mouse to change light direction + * let dirX = (mouseX / width - 0.5) * 2; + * let dirY = (mouseY / height - 0.5) * 2; + * directionalLight(250, 250, 250, -dirX, -dirY, -1); + * noStroke(); + * sphere(40); + * } + * + *
                    + * + * @alt + * scene with sphere and directional light. The direction of + * the light is controlled with the mouse position. + */ + /** + * @method directionalLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} direction direction of light as a + * p5.Vector + * @chainable + */ + /** + * @method directionalLight + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @chainable + */ + /** + * @method directionalLight + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} direction + * @chainable + */ + _main.default.prototype.directionalLight = function ( + v1, + v2, + v3, + x, + y, + z, + ) { + this._assert3d("directionalLight"); + _main.default._validateParameters("directionalLight", arguments); + //@TODO: check parameters number + var color; + if (v1 instanceof _main.default.Color) { + color = v1; + } else { + color = this.color(v1, v2, v3); + } + var _x, _y, _z; + var v = arguments[arguments.length - 1]; + if (typeof v === "number") { + _x = arguments[arguments.length - 3]; + _y = arguments[arguments.length - 2]; + _z = arguments[arguments.length - 1]; + } else { + _x = v.x; + _y = v.y; + _z = v.z; + } // normalize direction + + var l = Math.sqrt(_x * _x + _y * _y + _z * _z); + this._renderer.directionalLightDirections.push( + _x / l, + _y / l, + _z / l, + ); + this._renderer.directionalLightDiffuseColors.push( + color._array[0], + color._array[1], + color._array[2], + ); + Array.prototype.push.apply( + this._renderer.directionalLightSpecularColors, + this._renderer.specularColors, + ); + this._renderer._enableLighting = true; + return this; + }; + /** + * Creates a point light with the given color and position. + * + * A point light emits light from a single point in all directions. + * Because the light is emitted from a specific point (position), + * it has a different effect when it is positioned farther vs. nearer + * an object. + * + * A maximum of **5** point lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method pointLight + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} x x component of position + * @param {Number} y y component of position + * @param {Number} z z component of position + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' + * ); + * } + * function draw() { + * background(0); + * // move your mouse to change light position + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * // to set the light position, + * // think of the world's coordinate as: + * // -width/2,-height/2 ----------- width/2,-height/2 + * // | | + * // | 0,0 | + * // | | + * // -width/2,height/2 ----------- width/2,height/2 + * pointLight(250, 250, 250, locX, locY, 50); + * noStroke(); + * sphere(40); + * } + * + *
                    + * + * @alt + * scene with sphere and point light. The position of + * the light is controlled with the mouse position. + */ + /** + * @method pointLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position of light as a p5.Vector + * @chainable + */ + /** + * @method pointLight + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @chainable + */ + /** + * @method pointLight + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} position + * @chainable + */ + _main.default.prototype.pointLight = function (v1, v2, v3, x, y, z) { + this._assert3d("pointLight"); + _main.default._validateParameters("pointLight", arguments); + //@TODO: check parameters number + var color; + if (v1 instanceof _main.default.Color) { + color = v1; + } else { + color = this.color(v1, v2, v3); + } + var _x, _y, _z; + var v = arguments[arguments.length - 1]; + if (typeof v === "number") { + _x = arguments[arguments.length - 3]; + _y = arguments[arguments.length - 2]; + _z = arguments[arguments.length - 1]; + } else { + _x = v.x; + _y = v.y; + _z = v.z; + } + this._renderer.pointLightPositions.push(_x, _y, _z); + this._renderer.pointLightDiffuseColors.push( + color._array[0], + color._array[1], + color._array[2], + ); + Array.prototype.push.apply( + this._renderer.pointLightSpecularColors, + this._renderer.specularColors, + ); + this._renderer._enableLighting = true; + return this; + }; + /** + * Creates an image light with the given image. + * + * The image light simulates light from all the directions. + * This is done by using the image as a texture for an infinitely + * large sphere light. This sphere contains + * or encapsulates the whole scene/drawing. + * It will have different effect for varying shininess of the + * object in the drawing. + * Under the hood it is mainly doing 2 types of calculations, + * the first one is creating an irradiance map the + * environment map of the input image. + * The second one is managing reflections based on the shininess + * or roughness of the material used in the scene. + * + * Note: The image's diffuse light will be affected by fill() + * and the specular reflections will be affected by specularMaterial() + * and shininess(). + * + * @method imageLight + * @param {p5.image} img image for the background + * @example + *
                    + * + * let img; + * function preload() { + * img = loadImage('assets/outdoor_image.jpg'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(220); + * imageMode(CENTER); + * push(); + * translate(0, 0, -200); + * scale(2); + * image(img, 0, 0, width, height); + * pop(); + * ambientLight(50); + * imageLight(img); + * specularMaterial(20); + * noStroke(); + * scale(2); + * rotateX(frameCount * 0.005); + * rotateY(frameCount * 0.005); + * box(25); + * } + * + *
                    + * @alt + * image light example + * @example + *
                    + * + * let img; + * let slider; + * function preload() { + * img = loadImage('assets/outdoor_spheremap.jpg'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * slider = createSlider(0, 400, 100, 1); + * slider.position(0, height); + * } + * function draw() { + * background(220); + * imageMode(CENTER); + * push(); + * translate(0, 0, -200); + * scale(2); + * image(img, 0, 0, width, height); + * pop(); + * ambientLight(50); + * imageLight(img); + * specularMaterial(20); + * shininess(slider.value()); + * noStroke(); + * scale(2); + * sphere(15); + * } + * + *
                    + * @alt + * light with slider having a slider for varying roughness + */ + _main.default.prototype.imageLight = function (img) { + // activeImageLight property is checked by _setFillUniforms + // for sending uniforms to the fillshader + this._renderer.activeImageLight = img; + this._renderer._enableLighting = true; + }; + /** + * Places an ambient and directional light in the scene. + * The lights are set to ambientLight(128, 128, 128) and + * directionalLight(128, 128, 128, 0, 0, -1). + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method lights + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('the light is partially ambient and partially directional'); + * } + * function draw() { + * background(0); + * lights(); + * rotateX(millis() / 1000); + * rotateY(millis() / 1000); + * rotateZ(millis() / 1000); + * box(); + * } + * + *
                    + * + * @alt + * the light is partially ambient and partially directional + */ + _main.default.prototype.lights = function () { + this._assert3d("lights"); + // Both specify gray by default. + var grayColor = this.color("rgb(128,128,128)"); + this.ambientLight(grayColor); + this.directionalLight(grayColor, 0, 0, -1); + return this; + }; + /** + * Sets the falloff rate for pointLight() + * and spotLight(). + * + * lightFalloff() affects only the lights which are created after it + * in the code. + * + * The `constant`, `linear`, an `quadratic` parameters are used to calculate falloff as follows: + * + * d = distance from light position to vertex position + * + * falloff = 1 / (CONSTANT + d \* LINEAR + (d \* d) \* QUADRATIC) + * + * @method lightFalloff + * @param {Number} constant CONSTANT value for determining falloff + * @param {Number} linear LINEAR value for determining falloff + * @param {Number} quadratic QUADRATIC value for determining falloff + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe( + * 'Two spheres with different falloff values show different intensity of light' + * ); + * } + * function draw() { + * ortho(); + * background(0); + * + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * locX /= 2; // half scale + * + * lightFalloff(1, 0, 0); + * push(); + * translate(-25, 0, 0); + * pointLight(250, 250, 250, locX - 25, locY, 50); + * sphere(20); + * pop(); + * + * lightFalloff(0.97, 0.03, 0); + * push(); + * translate(25, 0, 0); + * pointLight(250, 250, 250, locX + 25, locY, 50); + * sphere(20); + * pop(); + * } + * + *
                    + * + * @alt + * Two spheres with different falloff values show different intensity of light + */ + _main.default.prototype.lightFalloff = function ( + constantAttenuation, + linearAttenuation, + quadraticAttenuation, + ) { + this._assert3d("lightFalloff"); + _main.default._validateParameters("lightFalloff", arguments); + if (constantAttenuation < 0) { + constantAttenuation = 0; + console.warn( + "Value of constant argument in lightFalloff() should be never be negative. Set to 0.", + ); + } + if (linearAttenuation < 0) { + linearAttenuation = 0; + console.warn( + "Value of linear argument in lightFalloff() should be never be negative. Set to 0.", + ); + } + if (quadraticAttenuation < 0) { + quadraticAttenuation = 0; + console.warn( + "Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.", + ); + } + if ( + constantAttenuation === 0 && + linearAttenuation === 0 && + quadraticAttenuation === 0 + ) { + constantAttenuation = 1; + console.warn( + "Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.", + ); + } + this._renderer.constantAttenuation = constantAttenuation; + this._renderer.linearAttenuation = linearAttenuation; + this._renderer.quadraticAttenuation = quadraticAttenuation; + return this; + }; + /** + * Creates a spot light with the given color, position, + * light direction, angle, and concentration. + * + * Like a pointLight(), a spotLight() + * emits light from a specific point (position). It has a different effect + * when it is positioned farther vs. nearer an object. + * + * However, unlike a pointLight(), the light is emitted in **one direction** + * along a conical shape. The shape of the cone can be controlled using + * the `angle` and `concentration` parameters. + * + * The `angle` parameter is used to + * determine the radius of the cone. And the `concentration` + * parameter is used to focus the light towards the center of + * the cone. Both parameters are optional, however if you want + * to specify `concentration`, you must also specify `angle`. + * The minimum concentration value is 1. + * + * A maximum of **5** spot lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method spotLight + * @param {Number} v1 red or hue value relative to the current color range + * @param {Number} v2 green or saturation value relative to the current color range + * @param {Number} v3 blue or brightness value relative to the current color range + * @param {Number} x x component of position + * @param {Number} y y component of position + * @param {Number} z z component of position + * @param {Number} rx x component of light direction (inclusive range of -1 to 1) + * @param {Number} ry y component of light direction (inclusive range of -1 to 1) + * @param {Number} rz z component of light direction (inclusive range of -1 to 1) + * @param {Number} [angle] angle of cone. Defaults to PI/3 + * @param {Number} [concentration] concentration of cone. Defaults to 100 + * @chainable + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' + * ); + * } + * function draw() { + * background(0); + * // move your mouse to change light position + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * // to set the light position, + * // think of the world's coordinate as: + * // -width/2,-height/2 ----------- width/2,-height/2 + * // | | + * // | 0,0 | + * // | | + * // -width/2,height/2 ----------- width/2,height/2 + * ambientLight(50); + * spotLight(0, 250, 0, locX, locY, 100, 0, 0, -1, Math.PI / 16); + * noStroke(); + * sphere(40); + * } + * + *
                    + * + * @alt + * scene with sphere and spot light. The position of + * the light is controlled with the mouse position. + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {p5.Vector} position position of light as a p5.Vector + * @param {p5.Vector} direction direction of light as a p5.Vector + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position + * @param {p5.Vector} direction + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {p5.Vector} direction + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} position + * @param {Number} rx + * @param {Number} ry + * @param {Number} rz + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {p5.Vector} direction + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position + * @param {Number} rx + * @param {Number} ry + * @param {Number} rz + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {Number} rx + * @param {Number} ry + * @param {Number} rz + * @param {Number} [angle] + * @param {Number} [concentration] + */ + _main.default.prototype.spotLight = function ( + v1, + v2, + v3, + x, + y, + z, + nx, + ny, + nz, + angle, + concentration, + ) { + this._assert3d("spotLight"); + _main.default._validateParameters("spotLight", arguments); + var color, position, direction; + var length = arguments.length; + switch (length) { + case 11: + case 10: + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = new _main.default.Vector(nx, ny, nz); + break; + case 9: + if (v1 instanceof _main.default.Color) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = new _main.default.Vector(y, z, nx); + angle = ny; + concentration = nz; + } else if (x instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = new _main.default.Vector(y, z, nx); + angle = ny; + concentration = nz; + } else if (nx instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = nx; + angle = ny; + concentration = nz; + } else { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = new _main.default.Vector(nx, ny, nz); + } + break; + case 8: + if (v1 instanceof _main.default.Color) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = new _main.default.Vector(y, z, nx); + angle = ny; + } else if (x instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = new _main.default.Vector(y, z, nx); + angle = ny; + } else { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = nx; + angle = ny; + } + break; + case 7: + if ( + v1 instanceof _main.default.Color && + v2 instanceof _main.default.Vector + ) { + color = v1; + position = v2; + direction = new _main.default.Vector(v3, x, y); + angle = z; + concentration = nx; + } else if ( + v1 instanceof _main.default.Color && + y instanceof _main.default.Vector + ) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = y; + angle = z; + concentration = nx; + } else if ( + x instanceof _main.default.Vector && + y instanceof _main.default.Vector + ) { + color = this.color(v1, v2, v3); + position = x; + direction = y; + angle = z; + concentration = nx; + } else if (v1 instanceof _main.default.Color) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = new _main.default.Vector(y, z, nx); + } else if (x instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = new _main.default.Vector(y, z, nx); + } else { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = nx; + } + break; + case 6: + if ( + x instanceof _main.default.Vector && + y instanceof _main.default.Vector + ) { + color = this.color(v1, v2, v3); + position = x; + direction = y; + angle = z; + } else if ( + v1 instanceof _main.default.Color && + y instanceof _main.default.Vector + ) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = y; + angle = z; + } else if ( + v1 instanceof _main.default.Color && + v2 instanceof _main.default.Vector + ) { + color = v1; + position = v2; + direction = new _main.default.Vector(v3, x, y); + angle = z; + } + break; + case 5: + if ( + v1 instanceof _main.default.Color && + v2 instanceof _main.default.Vector && + v3 instanceof _main.default.Vector + ) { + color = v1; + position = v2; + direction = v3; + angle = x; + concentration = y; + } else if ( + x instanceof _main.default.Vector && + y instanceof _main.default.Vector + ) { + color = this.color(v1, v2, v3); + position = x; + direction = y; + } else if ( + v1 instanceof _main.default.Color && + y instanceof _main.default.Vector + ) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = y; + } else if ( + v1 instanceof _main.default.Color && + v2 instanceof _main.default.Vector + ) { + color = v1; + position = v2; + direction = new _main.default.Vector(v3, x, y); + } + break; + case 4: + color = v1; + position = v2; + direction = v3; + angle = x; + break; + case 3: + color = v1; + position = v2; + direction = v3; + break; + default: + console.warn( + "Sorry, input for spotlight() is not in prescribed format. Too ".concat( + length < 3 ? "few" : "many", + " arguments were provided", + ), + ); + return this; + } + this._renderer.spotLightDiffuseColors.push( + color._array[0], + color._array[1], + color._array[2], + ); + Array.prototype.push.apply( + this._renderer.spotLightSpecularColors, + this._renderer.specularColors, + ); + this._renderer.spotLightPositions.push( + position.x, + position.y, + position.z, + ); + direction.normalize(); + this._renderer.spotLightDirections.push( + direction.x, + direction.y, + direction.z, + ); + if (angle === undefined) { + angle = Math.PI / 3; + } + if (concentration !== undefined && concentration < 1) { + concentration = 1; + console.warn( + "Value of concentration needs to be greater than 1. Setting it to 1", + ); + } else if (concentration === undefined) { + concentration = 100; + } + angle = this._renderer._pInst._toRadians(angle); + this._renderer.spotLightAngle.push(Math.cos(angle)); + this._renderer.spotLightConc.push(concentration); + this._renderer._enableLighting = true; + return this; + }; + /** + * Removes all lights present in a sketch. + * + * All subsequent geometry is rendered without lighting (until a new + * light is created with a call to one of the lighting functions + * (lights(), + * ambientLight(), + * directionalLight(), + * pointLight(), + * spotLight()). + * + * @method noLights + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'Three white spheres. Each appears as a different color due to lighting.' + * ); + * } + * function draw() { + * background(200); + * noStroke(); + * + * ambientLight(255, 0, 0); + * translate(-30, 0, 0); + * ambientMaterial(255); + * sphere(13); + * + * noLights(); + * translate(30, 0, 0); + * ambientMaterial(255); + * sphere(13); + * + * ambientLight(0, 255, 0); + * translate(30, 0, 0); + * ambientMaterial(255); + * sphere(13); + * } + * + *
                    + * + * @alt + * Three white spheres. Each appears as a different + * color due to lighting. + */ + _main.default.prototype.noLights = function () { + this._assert3d("noLights"); + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("noLights", args); + this._renderer._enableLighting = false; + this._renderer.ambientLightColors.length = 0; + this._renderer.specularColors = [1, 1, 1]; + this._renderer.directionalLightDirections.length = 0; + this._renderer.directionalLightDiffuseColors.length = 0; + this._renderer.directionalLightSpecularColors.length = 0; + this._renderer.pointLightPositions.length = 0; + this._renderer.pointLightDiffuseColors.length = 0; + this._renderer.pointLightSpecularColors.length = 0; + this._renderer.spotLightPositions.length = 0; + this._renderer.spotLightDirections.length = 0; + this._renderer.spotLightDiffuseColors.length = 0; + this._renderer.spotLightSpecularColors.length = 0; + this._renderer.spotLightAngle.length = 0; + this._renderer.spotLightConc.length = 0; + this._renderer.constantAttenuation = 1; + this._renderer.linearAttenuation = 0; + this._renderer.quadraticAttenuation = 0; + this._renderer._useShininess = 1; + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + }, + ], + 345: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.splice"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.match"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.trim"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + _dereq_("./p5.Geometry"); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module Shape + * @submodule 3D Models + * @for p5 + * @requires core + * @requires p5.Geometry + */ + /** + * Load a 3d model from an OBJ or STL file. + * + * loadModel() should be placed inside of preload(). + * This allows the model to load fully before the rest of your code is run. + * + * One of the limitations of the OBJ and STL format is that it doesn't have a built-in + * sense of scale. This means that models exported from different programs might + * be very different sizes. If your model isn't displaying, try calling + * loadModel() with the normalized parameter set to true. This will resize the + * model to a scale appropriate for p5. You can also make additional changes to + * the final size of your model with the scale() function. + * + * Also, the support for colored STL files is not present. STL files with color will be + * rendered without color properties. + * + * @method loadModel + * @param {String} path Path of the model to be loaded + * @param {Boolean} normalize If true, scale the model to a + * standardized size when loading + * @param {function(p5.Geometry)} [successCallback] Function to be called + * once the model is loaded. Will be passed + * the 3D model object. + * @param {function(Event)} [failureCallback] called with event error if + * the model fails to load. + * @param {String} [fileType] The file extension of the model + * (.stl, .obj). + * @return {p5.Geometry} the p5.Geometry object + * + * @example + *
                    + * + * //draw a spinning octahedron + * let octahedron; + * + * function preload() { + * octahedron = loadModel('assets/octahedron.obj'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d octahedron.'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * model(octahedron); + * } + * + *
                    + * + * @alt + * Vertically rotating 3-d octahedron. + * + * @example + *
                    + * + * //draw a spinning teapot + * let teapot; + * + * function preload() { + * // Load model with normalise parameter set to true + * teapot = loadModel('assets/teapot.obj', true); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); + * } + * + * function draw() { + * background(200); + * scale(0.4); // Scaled to make model fit into canvas + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * normalMaterial(); // For effect + * model(teapot); + * } + * + *
                    + * + * @alt + * Vertically rotating 3-d teapot with red, green and blue gradient. + */ + /** + * @method loadModel + * @param {String} path + * @param {function(p5.Geometry)} [successCallback] + * @param {function(Event)} [failureCallback] + * @param {String} [fileType] + * @return {p5.Geometry} the p5.Geometry object + */ + + _main.default.prototype.loadModel = function (path) { + _main.default._validateParameters("loadModel", arguments); + var normalize; + var successCallback; + var failureCallback; + var fileType = path.slice(-4); + if (typeof arguments[1] === "boolean") { + normalize = arguments[1]; + successCallback = arguments[2]; + failureCallback = arguments[3]; + if (typeof arguments[4] !== "undefined") { + fileType = arguments[4]; + } + } else { + normalize = false; + successCallback = arguments[1]; + failureCallback = arguments[2]; + if (typeof arguments[3] !== "undefined") { + fileType = arguments[3]; + } + } + var model = new _main.default.Geometry(); + model.gid = "".concat(path, "|").concat(normalize); + var self = this; + if (fileType.match(/\.stl$/i)) { + this.httpDo( + path, + "GET", + "arrayBuffer", + function (arrayBuffer) { + parseSTL(model, arrayBuffer); + if (normalize) { + model.normalize(); + } + self._decrementPreload(); + if (typeof successCallback === "function") { + successCallback(model); + } + }, + failureCallback, + ); + } else if (fileType.match(/\.obj$/i)) { + this.loadStrings( + path, + function (strings) { + parseObj(model, strings); + if (normalize) { + model.normalize(); + } + self._decrementPreload(); + if (typeof successCallback === "function") { + successCallback(model); + } + }, + failureCallback, + ); + } else { + _main.default._friendlyFileLoadError(3, path); + if (failureCallback) { + failureCallback(); + } else { + _main.default._friendlyError( + "Sorry, the file type is invalid. Only OBJ and STL files are supported.", + ); + } + } + return model; + }; + /** + * Parse OBJ lines into model. For reference, this is what a simple model of a + * square might look like: + * + * v -0.5 -0.5 0.5 + * v -0.5 -0.5 -0.5 + * v -0.5 0.5 -0.5 + * v -0.5 0.5 0.5 + * + * f 4 3 2 1 + */ + function parseObj(model, lines) { + // OBJ allows a face to specify an index for a vertex (in the above example), + // but it also allows you to specify a custom combination of vertex, UV + // coordinate, and vertex normal. So, "3/4/3" would mean, "use vertex 3 with + // UV coordinate 4 and vertex normal 3". In WebGL, every vertex with different + // parameters must be a different vertex, so loadedVerts is used to + // temporarily store the parsed vertices, normals, etc., and indexedVerts is + // used to map a specific combination (keyed on, for example, the string + // "3/4/3"), to the actual index of the newly created vertex in the final + // object. + var loadedVerts = { + v: [], + vt: [], + vn: [], + }; + var indexedVerts = {}; + for (var line = 0; line < lines.length; ++line) { + // Each line is a separate object (vertex, face, vertex normal, etc) + // For each line, split it into tokens on whitespace. The first token + // describes the type. + var tokens = lines[line].trim().split(/\b\s+/); + if (tokens.length > 0) { + if (tokens[0] === "v" || tokens[0] === "vn") { + // Check if this line describes a vertex or vertex normal. + // It will have three numeric parameters. + var vertex = new _main.default.Vector( + parseFloat(tokens[1]), + parseFloat(tokens[2]), + parseFloat(tokens[3]), + ); + loadedVerts[tokens[0]].push(vertex); + } else if (tokens[0] === "vt") { + // Check if this line describes a texture coordinate. + // It will have two numeric parameters U and V (W is omitted). + // Because of WebGL texture coordinates rendering behaviour, the V + // coordinate is inversed. + var texVertex = [ + parseFloat(tokens[1]), + 1 - parseFloat(tokens[2]), + ]; + loadedVerts[tokens[0]].push(texVertex); + } else if (tokens[0] === "f") { + // Check if this line describes a face. + // OBJ faces can have more than three points. Triangulate points. + for (var tri = 3; tri < tokens.length; ++tri) { + var face = []; + var vertexTokens = [1, tri - 1, tri]; + for ( + var tokenInd = 0; + tokenInd < vertexTokens.length; + ++tokenInd + ) { + // Now, convert the given token into an index + var vertString = tokens[vertexTokens[tokenInd]]; + var vertIndex = 0; + // TODO: Faces can technically use negative numbers to refer to the + // previous nth vertex. I haven't seen this used in practice, but + // it might be good to implement this in the future. + if (indexedVerts[vertString] !== undefined) { + vertIndex = indexedVerts[vertString]; + } else { + var vertParts = vertString.split("/"); + for (var i = 0; i < vertParts.length; i++) { + vertParts[i] = parseInt(vertParts[i]) - 1; + } + vertIndex = indexedVerts[vertString] = + model.vertices.length; + model.vertices.push(loadedVerts.v[vertParts[0]].copy()); + if (loadedVerts.vt[vertParts[1]]) { + model.uvs.push(loadedVerts.vt[vertParts[1]].slice()); + } else { + model.uvs.push([0, 0]); + } + if (loadedVerts.vn[vertParts[2]]) { + model.vertexNormals.push( + loadedVerts.vn[vertParts[2]].copy(), + ); + } + } + face.push(vertIndex); + } + if ( + face[0] !== face[1] && + face[0] !== face[2] && + face[1] !== face[2] + ) { + model.faces.push(face); + } + } + } + } + } // If the model doesn't have normals, compute the normals + + if (model.vertexNormals.length === 0) { + model.computeNormals(); + } + return model; + } /** + * STL files can be of two types, ASCII and Binary, + * + * We need to convert the arrayBuffer to an array of strings, + * to parse it as an ASCII file. + */ + + function parseSTL(model, buffer) { + if (isBinary(buffer)) { + parseBinarySTL(model, buffer); + } else { + var reader = new DataView(buffer); + if (!("TextDecoder" in window)) { + console.warn( + "Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)", + ); + return model; + } + var decoder = new TextDecoder("utf-8"); + var lines = decoder.decode(reader); + var lineArray = lines.split("\n"); + parseASCIISTL(model, lineArray); + } + return model; + } /** + * This function checks if the file is in ASCII format or in Binary format + * + * It is done by searching keyword `solid` at the start of the file. + * + * An ASCII STL data must begin with `solid` as the first six bytes. + * However, ASCII STLs lacking the SPACE after the `d` are known to be + * plentiful. So, check the first 5 bytes for `solid`. + * + * Several encodings, such as UTF-8, precede the text with up to 5 bytes: + * https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding + * Search for `solid` to start anywhere after those prefixes. + */ + + function isBinary(data) { + var reader = new DataView(data); + // US-ASCII ordinal values for `s`, `o`, `l`, `i`, `d` + var solid = [115, 111, 108, 105, 100]; + for (var off = 0; off < 5; off++) { + // If "solid" text is matched to the current offset, declare it to be an ASCII STL. + if (matchDataViewAt(solid, reader, off)) return false; + } // Couldn't find "solid" text at the beginning; it is binary STL. + + return true; + } /** + * This function matches the `query` at the provided `offset` + */ + + function matchDataViewAt(query, reader, offset) { + // Check if each byte in query matches the corresponding byte from the current offset + for (var i = 0, il = query.length; i < il; i++) { + if (query[i] !== reader.getUint8(offset + i, false)) return false; + } + return true; + } /** + * This function parses the Binary STL files. + * https://en.wikipedia.org/wiki/STL_%28file_format%29#Binary_STL + * + * Currently there is no support for the colors provided in STL files. + */ + + function parseBinarySTL(model, buffer) { + var reader = new DataView(buffer); + // Number of faces is present following the header + var faces = reader.getUint32(80, true); + var r, + g, + b, + hasColors = false, + colors; + var defaultR, defaultG, defaultB; + // Binary files contain 80-byte header, which is generally ignored. + for (var index = 0; index < 80 - 10; index++) { + // Check for `COLOR=` + if ( + reader.getUint32(index, false) === 1129270351 /*COLO*/ && + reader.getUint8(index + 4) === 82 /*'R'*/ && + reader.getUint8(index + 5) === 61 /*'='*/ + ) { + hasColors = true; + colors = []; + defaultR = reader.getUint8(index + 6) / 255; + defaultG = reader.getUint8(index + 7) / 255; + defaultB = reader.getUint8(index + 8) / 255; + // To be used when color support is added + // alpha = reader.getUint8(index + 9) / 255; + } + } + var dataOffset = 84; + var faceLength = 12 * 4 + 2; + // Iterate the faces + for (var face = 0; face < faces; face++) { + var start = dataOffset + face * faceLength; + var normalX = reader.getFloat32(start, true); + var normalY = reader.getFloat32(start + 4, true); + var normalZ = reader.getFloat32(start + 8, true); + if (hasColors) { + var packedColor = reader.getUint16(start + 48, true); + if ((packedColor & 32768) === 0) { + // facet has its own unique color + r = (packedColor & 31) / 31; + g = ((packedColor >> 5) & 31) / 31; + b = ((packedColor >> 10) & 31) / 31; + } else { + r = defaultR; + g = defaultG; + b = defaultB; + } + } + var newNormal = new _main.default.Vector( + normalX, + normalY, + normalZ, + ); + for (var i = 1; i <= 3; i++) { + var vertexstart = start + i * 12; + var newVertex = new _main.default.Vector( + reader.getFloat32(vertexstart, true), + reader.getFloat32(vertexstart + 4, true), + reader.getFloat32(vertexstart + 8, true), + ); + model.vertices.push(newVertex); + model.vertexNormals.push(newNormal); + if (hasColors) { + colors.push(r, g, b); + } + } + model.faces.push([3 * face, 3 * face + 1, 3 * face + 2]); + model.uvs.push([0, 0], [0, 0], [0, 0]); + } + if (hasColors) { + // add support for colors here. + } + return model; + } /** + * ASCII STL file starts with `solid 'nameOfFile'` + * Then contain the normal of the face, starting with `facet normal` + * Next contain a keyword indicating the start of face vertex, `outer loop` + * Next comes the three vertex, starting with `vertex x y z` + * Vertices ends with `endloop` + * Face ends with `endfacet` + * Next face starts with `facet normal` + * The end of the file is indicated by `endsolid` + */ + + function parseASCIISTL(model, lines) { + var state = ""; + var curVertexIndex = []; + var newNormal, newVertex; + for (var iterator = 0; iterator < lines.length; ++iterator) { + var line = lines[iterator].trim(); + var parts = line.split(" "); + for ( + var partsiterator = 0; + partsiterator < parts.length; + ++partsiterator + ) { + if (parts[partsiterator] === "") { + // Ignoring multiple whitespaces + parts.splice(partsiterator, 1); + } + } + if (parts.length === 0) { + // Remove newline + continue; + } + switch (state) { + case "": + // First run + if (parts[0] !== "solid") { + // Invalid state + console.error(line); + console.error( + 'Invalid state "'.concat( + parts[0], + '", should be "solid"', + ), + ); + return; + } else { + state = "solid"; + } + break; + case "solid": + // First face + if (parts[0] !== "facet" || parts[1] !== "normal") { + // Invalid state + console.error(line); + console.error( + 'Invalid state "'.concat( + parts[0], + '", should be "facet normal"', + ), + ); + return; + } else { + // Push normal for first face + newNormal = new _main.default.Vector( + parseFloat(parts[2]), + parseFloat(parts[3]), + parseFloat(parts[4]), + ); + model.vertexNormals.push(newNormal, newNormal, newNormal); + state = "facet normal"; + } + break; + case "facet normal": + // After normal is defined + if (parts[0] !== "outer" || parts[1] !== "loop") { + // Invalid State + console.error(line); + console.error( + 'Invalid state "'.concat( + parts[0], + '", should be "outer loop"', + ), + ); + return; + } else { + // Next should be vertices + state = "vertex"; + } + break; + case "vertex": + if (parts[0] === "vertex") { + //Vertex of triangle + newVertex = new _main.default.Vector( + parseFloat(parts[1]), + parseFloat(parts[2]), + parseFloat(parts[3]), + ); + model.vertices.push(newVertex); + model.uvs.push([0, 0]); + curVertexIndex.push(model.vertices.indexOf(newVertex)); + } else if (parts[0] === "endloop") { + // End of vertices + model.faces.push(curVertexIndex); + curVertexIndex = []; + state = "endloop"; + } else { + // Invalid State + console.error(line); + console.error( + 'Invalid state "'.concat( + parts[0], + '", should be "vertex" or "endloop"', + ), + ); + return; + } + break; + case "endloop": + if (parts[0] !== "endfacet") { + // End of face + console.error(line); + console.error( + 'Invalid state "'.concat( + parts[0], + '", should be "endfacet"', + ), + ); + return; + } else { + state = "endfacet"; + } + break; + case "endfacet": + if (parts[0] === "endsolid") { + // End of solid + } else if (parts[0] === "facet" && parts[1] === "normal") { + // Next face + newNormal = new _main.default.Vector( + parseFloat(parts[2]), + parseFloat(parts[3]), + parseFloat(parts[4]), + ); + model.vertexNormals.push(newNormal, newNormal, newNormal); + state = "facet normal"; + } else { + // Invalid State + console.error(line); + console.error( + 'Invalid state "'.concat( + parts[0], + '", should be "endsolid" or "facet normal"', + ), + ); + return; + } + break; + default: + console.error('Invalid state "'.concat(state, '"')); + break; + } + } + return model; + } /** + * Render a 3d model to the screen. + * + * @method model + * @param {p5.Geometry} model Loaded 3d model to be rendered + * @example + *
                    + * + * //draw a spinning octahedron + * let octahedron; + * + * function preload() { + * octahedron = loadModel('assets/octahedron.obj'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d octahedron.'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * model(octahedron); + * } + * + *
                    + * + * @alt + * Vertically rotating 3-d octahedron. + */ + + _main.default.prototype.model = function (model) { + this._assert3d("model"); + _main.default._validateParameters("model", arguments); + if (model.vertices.length > 0) { + if (!this._renderer.geometryInHash(model.gid)) { + if (model.edges.length === 0) { + model._makeTriangleEdges(); + } + model._edgesToVertices(); + this._renderer.createBuffers(model.gid, model); + } + this._renderer.drawBuffers(model.gid); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/main": 298, + "./p5.Geometry": 350, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.splice": 185, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.match": 211, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.trim": 219, + }, + ], + 346: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.join"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + _dereq_("./p5.Texture"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } /** + * @module 3D + * @submodule Material + * @for p5 + * @requires core + */ + /** + * Creates a new p5.Shader object + * from the provided vertex and fragment shader files. + * + * The shader files are loaded asynchronously in the + * background, so this method should be used in preload(). + * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. + * + * Note, shaders can only be used in WEBGL mode. + * + * @method loadShader + * @param {String} vertFilename path to file containing vertex shader + * source code + * @param {String} fragFilename path to file containing fragment shader + * source code + * @param {function} [callback] callback to be executed after loadShader + * completes. On success, the p5.Shader object is passed as the first argument. + * @param {function} [errorCallback] callback to be executed when an error + * occurs inside loadShader. On error, the error is passed as the first + * argument. + * @return {p5.Shader} a shader object created from the provided + * vertex and fragment shader files. + * + * @example + *
                    + * + * let mandel; + * function preload() { + * // load the shader definitions from files + * mandel = loadShader('assets/shader.vert', 'assets/shader.frag'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * // use the shader + * shader(mandel); + * noStroke(); + * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); + * } + * + * function draw() { + * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); + * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * } + * + *
                    + * + * @alt + * zooming Mandelbrot set. a colorful, infinitely detailed fractal. + */ + + _main.default.prototype.loadShader = function ( + vertFilename, + fragFilename, + callback, + errorCallback, + ) { + _main.default._validateParameters("loadShader", arguments); + if (!errorCallback) { + errorCallback = console.error; + } + var loadedShader = new _main.default.Shader(); + var self = this; + var loadedFrag = false; + var loadedVert = false; + var onLoad = function onLoad() { + self._decrementPreload(); + if (callback) { + callback(loadedShader); + } + }; + this.loadStrings( + vertFilename, + function (result) { + loadedShader._vertSrc = result.join("\n"); + loadedVert = true; + if (loadedFrag) { + onLoad(); + } + }, + errorCallback, + ); + this.loadStrings( + fragFilename, + function (result) { + loadedShader._fragSrc = result.join("\n"); + loadedFrag = true; + if (loadedVert) { + onLoad(); + } + }, + errorCallback, + ); + return loadedShader; + }; + /** + * Creates a new p5.Shader object + * from the provided vertex and fragment shader code. + * + * Note, shaders can only be used in WEBGL mode. + * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader shown in the example below. + * + * @method createShader + * @param {String} vertSrc source code for the vertex shader + * @param {String} fragSrc source code for the fragment shader + * @returns {p5.Shader} a shader object created from the provided + * vertex and fragment shaders. + * + * @example + *
                    + * + * + * // the vertex shader is called for each vertex + * let vs = ` + * precision highp float; + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * varying vec2 vTexCoord; + * + * void main() { + * vTexCoord = aTexCoord; + * vec4 positionVec4 = vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; + * } + * `; + * + * + * // the fragment shader is called for each pixel + * let fs = ` + * precision highp float; + * uniform vec2 p; + * uniform float r; + * const int I = 500; + * varying vec2 vTexCoord; + * void main() { + * vec2 c = p + gl_FragCoord.xy * r, z = c; + * float n = 0.0; + * for (int i = I; i > 0; i --) { + * if(z.x*z.x+z.y*z.y > 4.0) { + * n = float(i)/float(I); + * break; + * } + * z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c; + * } + * gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0); + * }`; + * + * let mandel; + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * // create and initialize the shader + * mandel = createShader(vs, fs); + * shader(mandel); + * noStroke(); + * + * // 'p' is the center point of the Mandelbrot image + * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); + * } + * + * function draw() { + * // 'r' is the size of the image in Mandelbrot-space + * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); + * plane(width, height); + * } + * + *
                    + * + * @alt + * zooming Mandelbrot set. a colorful, infinitely detailed fractal. + */ + _main.default.prototype.createShader = function (vertSrc, fragSrc) { + _main.default._validateParameters("createShader", arguments); + return new _main.default.Shader(this._renderer, vertSrc, fragSrc); + }; + /** + * Creates a new p5.Shader using only a fragment shader, as a convenience method for creating image effects. + * It's like createShader() but with a default vertex shader included. + * + * createFilterShader() is intended to be used along with filter() for filtering the contents of a canvas. + * A filter shader will not be applied to any geometries. + * + * The fragment shader receives some uniforms: + * - `sampler2D tex0`, which contains the canvas contents as a texture + * - `vec2 canvasSize`, which is the p5 width and height of the canvas (not including pixel density) + * - `vec2 texelSize`, which is the size of a physical pixel including pixel density (`1.0/(width*density)`, `1.0/(height*density)`) + * + * For more info about filters and shaders, see Adam Ferriss' repo of shader examples + * or the introduction to shaders page. + * + * @method createFilterShader + * @param {String} fragSrc source code for the fragment shader + * @returns {p5.Shader} a shader object created from the provided + * fragment shader. + * @example + *
                    + * + * function setup() { + * let fragSrc = `precision highp float; + * void main() { + * gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + * }`; + * + * createCanvas(100, 100, WEBGL); + * let s = createFilterShader(fragSrc); + * filter(s); + * describe('a yellow canvas'); + * } + * + *
                    + * + *
                    + * + * let img, s; + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * function setup() { + * let fragSrc = `precision highp float; + * + * // x,y coordinates, given from the vertex shader + * varying vec2 vTexCoord; + * + * // the canvas contents, given from filter() + * uniform sampler2D tex0; + * // other useful information from the canvas + * uniform vec2 texelSize; + * uniform vec2 canvasSize; + * // a custom variable from this sketch + * uniform float darkness; + * + * void main() { + * // get the color at current pixel + * vec4 color = texture2D(tex0, vTexCoord); + * // set the output color + * color.b = 1.0; + * color *= darkness; + * gl_FragColor = vec4(color.rgb, 1.0); + * }`; + * + * createCanvas(100, 100, WEBGL); + * s = createFilterShader(fragSrc); + * } + * function draw() { + * image(img, -50, -50); + * s.setUniform('darkness', 0.5); + * filter(s); + * describe('a image of bricks tinted dark blue'); + * } + * + *
                    + */ + _main.default.prototype.createFilterShader = function (fragSrc) { + _main.default._validateParameters("createFilterShader", arguments); + var defaultVertV1 = + "\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n "; + var defaultVertV2 = + "#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n "; + var vertSrc = fragSrc.includes("#version 300 es") + ? defaultVertV2 + : defaultVertV1; + var shader = new _main.default.Shader( + this._renderer, + vertSrc, + fragSrc, + ); + if (this._renderer.GL) { + shader.ensureCompiledOnContext(this); + } else { + shader.ensureCompiledOnContext( + this._renderer.getFilterGraphicsLayer(), + ); + } + return shader; + }; + /** + * Sets the p5.Shader object to + * be used to render subsequent shapes. + * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. + * + * Custom shaders can be created using the + * createShader() and + * loadShader() functions. + * + * Use resetShader() to + * restore the default shaders. + * + * Note, shaders can only be used in WEBGL mode. + * + * @method shader + * @chainable + * @param {p5.Shader} s the p5.Shader object + * to use for rendering shapes. + * + * @example + *
                    + * + * // Click within the image to toggle + * // the shader used by the quad shape + * // Note: for an alternative approach to the same example, + * // involving changing uniforms please refer to: + * // https://p5js.org/reference/#/p5.Shader/setUniform + * + * let redGreen; + * let orangeBlue; + * let showRedGreen = false; + * + * function preload() { + * // note that we are using two instances + * // of the same vertex and fragment shaders + * redGreen = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); + * orangeBlue = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * // initialize the colors for redGreen shader + * shader(redGreen); + * redGreen.setUniform('colorCenter', [1.0, 0.0, 0.0]); + * redGreen.setUniform('colorBackground', [0.0, 1.0, 0.0]); + * + * // initialize the colors for orangeBlue shader + * shader(orangeBlue); + * orangeBlue.setUniform('colorCenter', [1.0, 0.5, 0.0]); + * orangeBlue.setUniform('colorBackground', [0.226, 0.0, 0.615]); + * + * noStroke(); + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); + * } + * + * function draw() { + * // update the offset values for each shader, + * // moving orangeBlue in vertical and redGreen + * // in horizontal direction + * orangeBlue.setUniform('offset', [0, sin(millis() / 2000) + 1]); + * redGreen.setUniform('offset', [sin(millis() / 2000), 1]); + * + * if (showRedGreen === true) { + * shader(redGreen); + * } else { + * shader(orangeBlue); + * } + * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * } + * + * function mouseClicked() { + * showRedGreen = !showRedGreen; + * } + * + *
                    + * + * @alt + * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. + */ + _main.default.prototype.shader = function (s) { + this._assert3d("shader"); + _main.default._validateParameters("shader", arguments); + s.ensureCompiledOnContext(this); + if (s.isStrokeShader()) { + this._renderer.userStrokeShader = s; + } else { + this._renderer.userFillShader = s; + this._renderer._useNormalMaterial = false; + } + return this; + }; + /** + * Restores the default shaders. Code that runs after resetShader() + * will not be affected by the shader previously set by + * shader() + * + * @method resetShader + * @chainable + * @example + *
                    + * + * // This variable will hold our shader object + * let shaderProgram; + * + * // This variable will hold our vertex shader source code + * let vertSrc = ` + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * uniform mat4 uProjectionMatrix; + * uniform mat4 uModelViewMatrix; + * varying vec2 vTexCoord; + * + * void main() { + * vTexCoord = aTexCoord; + * vec4 position = vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * uModelViewMatrix * position; + * } + * `; + * + * // This variable will hold our fragment shader source code + * let fragSrc = ` + * precision mediump float; + * + * varying vec2 vTexCoord; + * + * void main() { + * vec2 uv = vTexCoord; + * vec3 color = vec3(uv.x, uv.y, min(uv.x + uv.y, 1.0)); + * gl_FragColor = vec4(color, 1.0); + * } + * `; + * + * function setup() { + * // Shaders require WEBGL mode to work + * createCanvas(100, 100, WEBGL); + * + * // Create our shader + * shaderProgram = createShader(vertSrc, fragSrc); + * + * describe( + * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' + * ); + * } + * + * function draw() { + * // Clear the scene + * background(200); + * + * // Draw a box using our shader + * // shader() sets the active shader with our shader + * shader(shaderProgram); + * push(); + * translate(-width / 4, 0, 0); + * rotateX(millis() * 0.00025); + * rotateY(millis() * 0.0005); + * box(width / 4); + * pop(); + * + * // Draw a box using the default fill shader + * // resetShader() restores the default fill shader + * resetShader(); + * fill(255, 0, 0); + * push(); + * translate(width / 4, 0, 0); + * rotateX(millis() * 0.00025); + * rotateY(millis() * 0.0005); + * box(width / 4); + * pop(); + * } + * + *
                    + * @alt + * Two rotating cubes. The left one is painted using a custom (user-defined) shader, + * while the right one is painted using the default fill shader. + */ + _main.default.prototype.resetShader = function () { + this._renderer.userFillShader = this._renderer.userStrokeShader = + null; + return this; + }; + /** + * Sets the texture that will be used to render subsequent shapes. + * + * A texture is like a "skin" that wraps around a 3D geometry. Currently + * supported textures are images, video, and offscreen renders. + * + * To texture a geometry created with beginShape(), + * you will need to specify uv coordinates in vertex(). + * + * Note, texture() can only be used in WEBGL mode. + * + * You can view more materials in this + * example. + * + * @method texture + * @param {p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} tex image to use as texture + * @chainable + * @example + *
                    + * + * let img; + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('spinning cube with a texture from an image'); + * } + * + * function draw() { + * background(0); + * rotateZ(frameCount * 0.01); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * //pass image as texture + * texture(img); + * box(width / 2); + * } + * + *
                    + * @alt + * spinning cube with a texture from an image + * + * @example + *
                    + * + * let pg; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * pg = createGraphics(200, 200); + * pg.textSize(75); + * describe('plane with a texture from an image created by createGraphics()'); + * } + * + * function draw() { + * background(0); + * pg.background(255); + * pg.text('hello!', 0, 100); + * //pass image as texture + * texture(pg); + * rotateX(0.5); + * noStroke(); + * plane(50); + * } + * + *
                    + * @alt + * plane with a texture from an image created by createGraphics() + * + * @example + *
                    + * + * let vid; + * function preload() { + * vid = createVideo('assets/fingers.mov'); + * vid.hide(); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('rectangle with video as texture'); + * } + * + * function draw() { + * background(0); + * //pass video frame as texture + * texture(vid); + * rect(-40, -40, 80, 80); + * } + * + * function mousePressed() { + * vid.loop(); + * } + * + *
                    + * + * @alt + * rectangle with video as texture + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using normalized coordinates'); + * } + * + * function draw() { + * background(0); + * texture(img); + * textureMode(NORMAL); + * beginShape(); + * vertex(-40, -40, 0, 0); + * vertex(40, -40, 1, 0); + * vertex(40, 40, 1, 1); + * vertex(-40, 40, 0, 1); + * endShape(); + * } + * + *
                    + * @alt + * quad with a texture, mapped using normalized coordinates + */ + _main.default.prototype.texture = function (tex) { + this._assert3d("texture"); + _main.default._validateParameters("texture", arguments); + if (tex.gifProperties) { + tex._animateGif(this); + } + this._renderer.drawMode = constants.TEXTURE; + this._renderer._useNormalMaterial = false; + this._renderer._tex = tex; + this._renderer._setProperty("_doFill", true); + return this; + }; + /** + * Sets the coordinate space for texture mapping. The default mode is IMAGE + * which refers to the actual coordinates of the image. + * NORMAL refers to a normalized space of values ranging from 0 to 1. + * + * With IMAGE, if an image is 100×200 pixels, mapping the image onto the entire + * size of a quad would require the points (0,0) (100, 0) (100,200) (0,200). + * The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1). + * @method textureMode + * @param {Constant} mode either IMAGE or NORMAL + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using normalized coordinates'); + * } + * + * function draw() { + * texture(img); + * textureMode(NORMAL); + * beginShape(); + * vertex(-50, -50, 0, 0); + * vertex(50, -50, 1, 0); + * vertex(50, 50, 1, 1); + * vertex(-50, 50, 0, 1); + * endShape(); + * } + * + *
                    + * @alt + * quad with a texture, mapped using normalized coordinates + * + * @example + *
                    + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using image coordinates'); + * } + * + * function draw() { + * texture(img); + * textureMode(IMAGE); + * beginShape(); + * vertex(-50, -50, 0, 0); + * vertex(50, -50, img.width, 0); + * vertex(50, 50, img.width, img.height); + * vertex(-50, 50, 0, img.height); + * endShape(); + * } + * + *
                    + * @alt + * quad with a texture, mapped using image coordinates + */ + _main.default.prototype.textureMode = function (mode) { + if (mode !== constants.IMAGE && mode !== constants.NORMAL) { + console.warn( + "You tried to set ".concat( + mode, + " textureMode only supports IMAGE & NORMAL ", + ), + ); + } else { + this._renderer.textureMode = mode; + } + }; + /** + * Sets the global texture wrapping mode. This controls how textures behave + * when their uv's go outside of the 0 to 1 range. There are three options: + * CLAMP, REPEAT, and MIRROR. + * + * CLAMP causes the pixels at the edge of the texture to extend to the bounds. + * REPEAT causes the texture to tile repeatedly until reaching the bounds. + * MIRROR works similarly to REPEAT but it flips the texture with every new tile. + * + * REPEAT & MIRROR are only available if the texture + * is a power of two size (128, 256, 512, 1024, etc.). + * + * This method will affect all textures in your sketch until a subsequent + * textureWrap() call is made. + * + * If only one argument is provided, it will be applied to both the + * horizontal and vertical axes. + * @method textureWrap + * @param {Constant} wrapX either CLAMP, REPEAT, or MIRROR + * @param {Constant} [wrapY] either CLAMP, REPEAT, or MIRROR + * @example + *
                    + * + * let img; + * function preload() { + * img = loadImage('assets/rockies128.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * textureWrap(MIRROR); + * describe('an image of the rocky mountains repeated in mirrored tiles'); + * } + * + * function draw() { + * background(0); + * + * let dX = mouseX; + * let dY = mouseY; + * + * let u = lerp(1.0, 2.0, dX); + * let v = lerp(1.0, 2.0, dY); + * + * scale(width / 2); + * + * texture(img); + * + * beginShape(TRIANGLES); + * vertex(-1, -1, 0, 0, 0); + * vertex(1, -1, 0, u, 0); + * vertex(1, 1, 0, u, v); + * + * vertex(1, 1, 0, u, v); + * vertex(-1, 1, 0, 0, v); + * vertex(-1, -1, 0, 0, 0); + * endShape(); + * } + * + *
                    + * + * @alt + * an image of the rocky mountains repeated in mirrored tiles + */ + _main.default.prototype.textureWrap = function (wrapX) { + var wrapY = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : wrapX; + this._renderer.textureWrapX = wrapX; + this._renderer.textureWrapY = wrapY; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = this._renderer.textures + .values() + [Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()).done); + _iteratorNormalCompletion = true + ) { + var texture = _step.value; + texture.setWrapMode(wrapX, wrapY); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + }; + /** + * Sets the current material as a normal material. + * + * A normal material is not affected by light. It is often used as + * a placeholder material when debugging. + * + * Surfaces facing the X-axis become red, those facing the Y-axis + * become green, and those facing the Z-axis become blue. + * + * You can view more materials in this + * example. + * + * @method normalMaterial + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Sphere with normal material'); + * } + * + * function draw() { + * background(200); + * normalMaterial(); + * sphere(40); + * } + * + *
                    + * @alt + * Sphere with normal material + */ + _main.default.prototype.normalMaterial = function () { + this._assert3d("normalMaterial"); + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("normalMaterial", args); + this._renderer.drawMode = constants.FILL; + this._renderer._useSpecularMaterial = false; + this._renderer._useEmissiveMaterial = false; + this._renderer._useNormalMaterial = true; + this._renderer.curFillColor = [1, 1, 1, 1]; + this._renderer._setProperty("_doFill", true); + this.noStroke(); + return this; + }; + /** + * Sets the ambient color of the material. + * + * The ambientMaterial() color represents the components + * of the **ambientLight()** color that the object reflects. + * + * Consider an ambientMaterial() with the color yellow (255, 255, 0). + * If the ambientLight() emits the color white (255, 255, 255), then the object + * will appear yellow as it will reflect the red and green components + * of the light. If the ambientLight() emits the color red (255, 0, 0), then + * the object will appear red as it will reflect the red component + * of the light. If the ambientLight() emits the color blue (0, 0, 255), + * then the object will appear black, as there is no component of + * the light that it can reflect. + * + * You can view more materials in this + * example. + * + * @method ambientMaterial + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('sphere reflecting red, blue, and green light'); + * } + * function draw() { + * background(0); + * noStroke(); + * ambientLight(255); + * ambientMaterial(70, 130, 230); + * sphere(40); + * } + * + *
                    + * @alt + * sphere reflecting red, blue, and green light + * + * @example + *
                    + * + * // ambientLight is both red and blue (magenta), + * // so object only reflects it's red and blue components + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('box reflecting only red and blue light'); + * } + * function draw() { + * background(70); + * ambientLight(255, 0, 255); // magenta light + * ambientMaterial(255); // white material + * box(30); + * } + * + *
                    + * @alt + * box reflecting only red and blue light + * + * @example + *
                    + * + * // ambientLight is green. Since object does not contain + * // green, it does not reflect any light + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('box reflecting no light'); + * } + * function draw() { + * background(70); + * ambientLight(0, 255, 0); // green light + * ambientMaterial(255, 0, 255); // magenta material + * box(30); + * } + * + *
                    + * @alt + * box reflecting no light + */ + /** + * @method ambientMaterial + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + /** + * @method ambientMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string + * @chainable + */ + _main.default.prototype.ambientMaterial = function (v1, v2, v3) { + this._assert3d("ambientMaterial"); + _main.default._validateParameters("ambientMaterial", arguments); + var color = _main.default.prototype.color.apply(this, arguments); + this._renderer._hasSetAmbient = true; + this._renderer.curAmbientColor = color._array; + this._renderer._useNormalMaterial = false; + this._renderer._enableLighting = true; + this._renderer._setProperty("_doFill", true); + return this; + }; + /** + * Sets the emissive color of the material. + * + * An emissive material will display the emissive color at + * full strength regardless of lighting. This can give the + * appearance that the object is glowing. + * + * Note, "emissive" is a misnomer in the sense that the material + * does not actually emit light that will affect surrounding objects. + * + * You can view more materials in this + * example. + * + * @method emissiveMaterial + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} [alpha] alpha value relative to current color + * range (default is 0-255) + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('sphere with green emissive material'); + * } + * function draw() { + * background(0); + * noStroke(); + * ambientLight(0); + * emissiveMaterial(130, 230, 0); + * sphere(40); + * } + * + *
                    + * + * @alt + * sphere with green emissive material + */ + /** + * @method emissiveMaterial + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + /** + * @method emissiveMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string + * @chainable + */ + _main.default.prototype.emissiveMaterial = function (v1, v2, v3, a) { + this._assert3d("emissiveMaterial"); + _main.default._validateParameters("emissiveMaterial", arguments); + var color = _main.default.prototype.color.apply(this, arguments); + this._renderer.curEmissiveColor = color._array; + this._renderer._useEmissiveMaterial = true; + this._renderer._useNormalMaterial = false; + this._renderer._enableLighting = true; + return this; + }; + /** + * Sets the specular color of the material. + * + * A specular material is reflective (shiny). The shininess can be + * controlled by the shininess() function. + * + * Like ambientMaterial(), + * the specularMaterial() color is the color the object will reflect + * under ambientLight(). + * However unlike ambientMaterial(), for all other types of lights + * (directionalLight(), + * pointLight(), + * spotLight()), + * a specular material will reflect the **color of the light source**. + * This is what gives it its "shiny" appearance. + * + * You can view more materials in this + * example. + * + * @method specularMaterial + * @param {Number} gray number specifying value between white and black. + * @param {Number} [alpha] alpha value relative to current color range + * (default is 0-255) + * @chainable + * + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe('torus with specular material'); + * } + * + * function draw() { + * background(0); + * + * ambientLight(60); + * + * // add point light to showcase specular material + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * pointLight(255, 255, 255, locX, locY, 50); + * + * specularMaterial(250); + * shininess(50); + * torus(30, 10, 64, 64); + * } + * + *
                    + * @alt + * torus with specular material + */ + /** + * @method specularMaterial + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @param {Number} [alpha] + * @chainable + */ + /** + * @method specularMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string + * @chainable + */ + _main.default.prototype.specularMaterial = function ( + v1, + v2, + v3, + alpha, + ) { + this._assert3d("specularMaterial"); + _main.default._validateParameters("specularMaterial", arguments); + var color = _main.default.prototype.color.apply(this, arguments); + this._renderer.curSpecularColor = color._array; + this._renderer._useSpecularMaterial = true; + this._renderer._useNormalMaterial = false; + this._renderer._enableLighting = true; + return this; + }; + /** + * Sets the amount of gloss ("shininess") of a + * specularMaterial(). + * + * The default and minimum value is 1. + * + * @method shininess + * @param {Number} shine degree of shininess + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('two spheres, one more shiny than the other'); + * } + * function draw() { + * background(0); + * noStroke(); + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * ambientLight(60, 60, 60); + * pointLight(255, 255, 255, locX, locY, 50); + * specularMaterial(250); + * translate(-25, 0, 0); + * shininess(1); + * sphere(20); + * translate(50, 0, 0); + * shininess(20); + * sphere(20); + * } + * + *
                    + * @alt + * two spheres, one more shiny than the other + */ + _main.default.prototype.shininess = function (shine) { + this._assert3d("shininess"); + _main.default._validateParameters("shininess", arguments); + if (shine < 1) { + shine = 1; + } + this._renderer._useShininess = shine; + return this; + }; + /** + * @private blends colors according to color components. + * If alpha value is less than 1, or non-standard blendMode + * we need to enable blending on our gl context. + * @param {Number[]} color [description] + * @return {Number[]]} Normalized numbers array + */ + _main.default.RendererGL.prototype._applyColorBlend = function ( + colors, + ) { + var gl = this.GL; + var isTexture = this.drawMode === constants.TEXTURE; + var doBlend = + this.userFillShader || + this.userStrokeShader || + this.userPointShader || + isTexture || + this.curBlendMode !== constants.BLEND || + colors[colors.length - 1] < 1 || + this._isErasing; + if (doBlend !== this._isBlending) { + if ( + doBlend || + (this.curBlendMode !== constants.BLEND && + this.curBlendMode !== constants.ADD) + ) { + gl.enable(gl.BLEND); + } else { + gl.disable(gl.BLEND); + } + gl.depthMask(true); + this._isBlending = doBlend; + } + this._applyBlendMode(); + return colors; + }; + /** + * @private sets blending in gl context to curBlendMode + * @param {Number[]} color [description] + * @return {Number[]]} Normalized numbers array + */ + _main.default.RendererGL.prototype._applyBlendMode = function () { + if (this._cachedBlendMode === this.curBlendMode) { + return; + } + var gl = this.GL; + switch (this.curBlendMode) { + case constants.BLEND: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.ADD: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE); + break; + case constants.REMOVE: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ZERO, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.MULTIPLY: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.SCREEN: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR); + break; + case constants.EXCLUSION: + gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); + gl.blendFuncSeparate( + gl.ONE_MINUS_DST_COLOR, + gl.ONE_MINUS_SRC_COLOR, + gl.ONE, + gl.ONE, + ); + break; + case constants.REPLACE: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ZERO); + break; + case constants.SUBTRACT: + gl.blendEquationSeparate(gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD); + gl.blendFuncSeparate( + gl.ONE, + gl.ONE, + gl.ONE, + gl.ONE_MINUS_SRC_ALPHA, + ); + break; + case constants.DARKEST: + if (this.blendExt) { + gl.blendEquationSeparate( + this.blendExt.MIN || this.blendExt.MIN_EXT, + gl.FUNC_ADD, + ); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); + } else { + console.warn( + "blendMode(DARKEST) does not work in your browser in WEBGL mode.", + ); + } + break; + case constants.LIGHTEST: + if (this.blendExt) { + gl.blendEquationSeparate( + this.blendExt.MAX || this.blendExt.MAX_EXT, + gl.FUNC_ADD, + ); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); + } else { + console.warn( + "blendMode(LIGHTEST) does not work in your browser in WEBGL mode.", + ); + } + break; + default: + console.error( + "Oops! Somehow RendererGL set curBlendMode to an unsupported mode.", + ); + break; + } + if (!this._isErasing) { + this._cachedBlendMode = this.curBlendMode; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.Texture": 357, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.join": 180, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 347: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.string.sub"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.hypot"); + _dereq_("core-js/modules/es.string.sub"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module 3D + * @submodule Camera + * @requires core + */ + //////////////////////////////////////////////////////////////////////////////// + // p5.Prototype Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Sets the position of the current camera in a 3D sketch. + * Parameters for this function define the camera's position, + * the center of the sketch (where the camera is pointing), + * and an up direction (the orientation of the camera). + * + * This function simulates the movements of the camera, allowing objects to be + * viewed from various angles. Remember, it does not move the objects themselves + * but the camera instead. For example when the centerX value is positive, + * and the camera is rotating to the right side of the sketch, + * the object will seem like it's moving to the left. + * + * See this example + * to view the position of your camera. + * + * If no parameters are given, the following default is used: + * camera(0, 0, (height/2) / tan(PI/6), 0, 0, 0, 0, 1, 0) + * @method camera + * @constructor + * @for p5 + * @param {Number} [x] camera position value on x axis + * @param {Number} [y] camera position value on y axis + * @param {Number} [z] camera position value on z axis + * @param {Number} [centerX] x coordinate representing center of the sketch + * @param {Number} [centerY] y coordinate representing center of the sketch + * @param {Number} [centerZ] z coordinate representing center of the sketch + * @param {Number} [upX] x component of direction 'up' from camera + * @param {Number} [upY] y component of direction 'up' from camera + * @param {Number} [upZ] z component of direction 'up' from camera + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a square moving closer and then away from the camera.'); + * } + * function draw() { + * background(204); + * //move the camera away from the plane by a sin wave + * camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); + * plane(10, 10); + * } + * + *
                    + * + * @example + *
                    + * + * //move slider to see changes! + * //sliders control the first 6 parameters of camera() + * let sliderGroup = []; + * let X; + * let Y; + * let Z; + * let centerX; + * let centerY; + * let centerZ; + * let h = 20; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * //create sliders + * for (var i = 0; i < 6; i++) { + * if (i === 2) { + * sliderGroup[i] = createSlider(10, 400, 200); + * } else { + * sliderGroup[i] = createSlider(-400, 400, 0); + * } + * h = map(i, 0, 6, 5, 85); + * sliderGroup[i].position(10, height + h); + * sliderGroup[i].style('width', '80px'); + * } + * describe( + * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' + * ); + * } + * + * function draw() { + * background(60); + * // assigning sliders' value to each parameters + * X = sliderGroup[0].value(); + * Y = sliderGroup[1].value(); + * Z = sliderGroup[2].value(); + * centerX = sliderGroup[3].value(); + * centerY = sliderGroup[4].value(); + * centerZ = sliderGroup[5].value(); + * camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); + * stroke(255); + * fill(255, 102, 94); + * box(85); + * } + * + *
                    + * @alt + * White square repeatedly grows to fill canvas and then shrinks. + * An interactive example of a red cube with 3 sliders for moving it across x, y, + * z axis and 3 sliders for shifting its center. + */ + + _main.default.prototype.camera = function () { + var _this$_renderer$_curC; + this._assert3d("camera"); + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters("camera", args); + (_this$_renderer$_curC = this._renderer._curCamera).camera.apply( + _this$_renderer$_curC, + args, + ); + return this; + }; + /** + * Sets a perspective projection for the current camera in a 3D sketch. + * This projection represents depth through foreshortening: objects + * that are close to the camera appear their actual size while those + * that are further away from the camera appear smaller. + * + * The parameters to this function define the viewing frustum + * (the truncated pyramid within which objects are seen by the camera) through + * vertical field of view, aspect ratio (usually width/height), and near and far + * clipping planes. + * + * If no parameters are given, the default values are used as: + * + * - `fov` : The default field of view for the camera is such that the full height of renderer is visible when it is positioned at a default distance of 800 units from the camera. + * - `aspect` : The default aspect ratio is the ratio of renderer's width to renderer's height. + * - `near` : The default value for the near clipping plane is 80, which is 0.1 times the default distance from the camera to its subject. + * - `far` : The default value for the far clipping plane is 8000, which is 10 times the default distance from the camera to its subject. + * + * If you prefer a fixed field of view, follow these steps: + * 1. Choose your desired field of view angle (`fovy`). This is how wide the camera can see. + * 2. To ensure that you can see the entire width across horizontally and height across vertically, place the camera a distance of `(height / 2) / tan(fovy / 2)` back from its subject. + * 3. Call perspective with the chosen field of view, canvas aspect ratio, and near/far values: + * `perspective(fovy, width / height, cameraDistance / 10, cameraDistance * 10);` + * + * @method perspective + * @for p5 + * @param {Number} [fovy] camera frustum vertical field of view, + * from bottom to top of view, in angleMode units + * @param {Number} [aspect] camera frustum aspect ratio + * @param {Number} [near] frustum near plane length + * @param {Number} [far] frustum far plane length + * @chainable + * @example + *
                    + * + * //drag the mouse to look around! + * function setup() { + * createCanvas(100, 100, WEBGL); + * perspective(PI / 3.0, width / height, 0.1, 500); + * describe( + * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' + * ); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * + * translate(0, 0, 550); + * rotateX(-0.3); + * rotateY(-0.2); + * + * push(); + * translate(-15, 0, sin(frameCount / 30) * 95); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 95); + * box(30); + * pop(); + * } + * + *
                    + * + * @alt + * two colored 3D boxes move back and forth, rotating as mouse is dragged. + */ + _main.default.prototype.perspective = function () { + var _this$_renderer$_curC2; + this._assert3d("perspective"); + for ( + var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; + _key2 < _len2; + _key2++ + ) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters("perspective", args); + (_this$_renderer$_curC2 = + this._renderer._curCamera).perspective.apply( + _this$_renderer$_curC2, + args, + ); + return this; + }; + /** + * Sets an orthographic projection for the current camera in a 3D sketch + * and defines a box-shaped viewing frustum within which objects are seen. + * In this projection, all objects with the same dimension appear the same + * size, regardless of whether they are near or far from the camera. + * + * The parameters to this function specify the viewing frustum where + * left and right are the minimum and maximum x values, top and bottom are + * the minimum and maximum y values, and near and far are the minimum and + * maximum z values. + * + * If no parameters are given, the following default is used: + * ortho(-width/2, width/2, -height/2, height/2). + * @method ortho + * @for p5 + * @param {Number} [left] camera frustum left plane + * @param {Number} [right] camera frustum right plane + * @param {Number} [bottom] camera frustum bottom plane + * @param {Number} [top] camera frustum top plane + * @param {Number} [near] camera frustum near plane + * @param {Number} [far] camera frustum far plane + * @chainable + * @example + *
                    + * + * //drag the mouse to look around! + * //there's no vanishing point + * function setup() { + * createCanvas(100, 100, WEBGL); + * ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * + * translate(0,0,500); + * rotateX(0.2); + * rotateY(-0.2); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 65); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 65); + * box(30); + * pop(); + * } + * + *
                    + * + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. + */ + _main.default.prototype.ortho = function () { + var _this$_renderer$_curC3; + this._assert3d("ortho"); + for ( + var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; + _key3 < _len3; + _key3++ + ) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters("ortho", args); + (_this$_renderer$_curC3 = this._renderer._curCamera).ortho.apply( + _this$_renderer$_curC3, + args, + ); + return this; + }; + /** + * Sets the frustum of the current camera as defined by + * the parameters. + * + * A frustum is a geometric form: a pyramid with its top + * cut off. With the viewer's eye at the imaginary top of + * the pyramid, the six planes of the frustum act as clipping + * planes when rendering a 3D view. Thus, any form inside the + * clipping planes is visible; anything outside + * those planes is not visible. + * + * Setting the frustum changes the perspective of the scene being rendered. + * This can be achieved more simply in many cases by using + * perspective(). + * + * If no parameters are given, the following default is used: + * frustum(-width/20, width/20, height/20, -height/20, eyeZ/10, eyeZ*10), + * where eyeZ is equal to ((height/2) / tan(PI/6)). + * @method frustum + * @for p5 + * @param {Number} [left] camera frustum left plane + * @param {Number} [right] camera frustum right plane + * @param {Number} [bottom] camera frustum bottom plane + * @param {Number} [top] camera frustum top plane + * @param {Number} [near] camera frustum near plane + * @param {Number} [far] camera frustum far plane + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * translate(0,0,700); + * rotateY(-0.2); + * rotateX(-0.3); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 25); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 25); + * box(30); + * pop(); + * } + * + *
                    + * + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. + */ + _main.default.prototype.frustum = function () { + var _this$_renderer$_curC4; + this._assert3d("frustum"); + for ( + var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; + _key4 < _len4; + _key4++ + ) { + args[_key4] = arguments[_key4]; + } + _main.default._validateParameters("frustum", args); + (_this$_renderer$_curC4 = this._renderer._curCamera).frustum.apply( + _this$_renderer$_curC4, + args, + ); + return this; + }; + //////////////////////////////////////////////////////////////////////////////// + // p5.Camera + //////////////////////////////////////////////////////////////////////////////// + /** + * Creates a new p5.Camera object and sets it + * as the current (active) camera. + * + * The new camera is initialized with a default position + * (see camera()) + * and a default perspective projection + * (see perspective()). + * Its properties can be controlled with the p5.Camera + * methods. + * + * Note: Every 3D sketch starts with a default camera initialized. + * This camera can be controlled with the global methods + * camera(), + * perspective(), ortho(), + * and frustum() if it is the only camera + * in the scene. + * @method createCamera + * @return {p5.Camera} The newly created camera object. + * @for p5 + * @example + *
                    + * // Creates a camera object and animates it around a box. + * let camera; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * camera = createCamera(); + * describe('An example that creates a camera and moves it around the box.'); + * } + * + * function draw() { + * background(0); + * // The camera will automatically + * // rotate to look at [0, 0, 0]. + * camera.lookAt(0, 0, 0); + * + * // The camera will move on the + * // x axis. + * camera.setPosition(sin(frameCount / 60) * 200, 0, 100); + * box(20); + * + * // A 'ground' box to give the viewer + * // a better idea of where the camera + * // is looking. + * translate(0, 50, 0); + * rotateX(HALF_PI); + * box(150, 150, 20); + * } + *
                    + * + * @alt + * An example that creates a camera and moves it around the box. + */ + _main.default.prototype.createCamera = function () { + this._assert3d("createCamera"); + var _cam = new _main.default.Camera(this._renderer); + // compute default camera settings, then set a default camera + _cam._computeCameraDefaultSettings(); + _cam._setDefaultCamera(); + // set renderer current camera to the new camera + this._renderer._curCamera = _cam; + return _cam; + }; + /** + * This class describes a camera for use in p5's + * + * WebGL mode. It contains camera position, orientation, and projection + * information necessary for rendering a 3D scene. + * + * New p5.Camera objects can be made through the + * createCamera() function and controlled through + * the methods described below. A camera created in this way will use a default + * position in the scene and a default perspective projection until these + * properties are changed through the various methods available. It is possible + * to create multiple cameras, in which case the current camera + * can be set through the setCamera() method. + * + * Note: + * The methods below operate in two coordinate systems: the 'world' coordinate + * system describe positions in terms of their relationship to the origin along + * the X, Y and Z axes whereas the camera's 'local' coordinate system + * describes positions from the camera's point of view: left-right, up-down, + * and forward-backward. The move() method, + * for instance, moves the camera along its own axes, whereas the + * setPosition() + * method sets the camera's position in world-space. + * + * The camera object propreties + * eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ + * which describes camera position, orientation, and projection + * are also accessible via the camera object generated using + * createCamera() + * + * @class p5.Camera + * @param {rendererGL} rendererGL instance of WebGL renderer + * @example + *
                    + * + * let cam; + * let delta = 0.01; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * // set initial pan angle + * cam.pan(-0.8); + * describe( + * 'camera view pans left and right across a series of rotating 3D boxes.' + * ); + * } + * + * function draw() { + * background(200); + * + * // pan camera according to angle 'delta' + * cam.pan(delta); + * + * // every 160 frames, switch direction + * if (frameCount % 160 === 0) { + * delta *= -1; + * } + * + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                    + * + * @alt + * camera view pans left and right across a series of rotating 3D boxes. + */ + _main.default.Camera = /*#__PURE__*/ (function () { + function Camera(renderer) { + _classCallCheck(this, Camera); + this._renderer = renderer; + this.cameraType = "default"; + this.cameraMatrix = new _main.default.Matrix(); + this.projMatrix = new _main.default.Matrix(); + this.yScale = 1; + } /** + * camera position value on x axis + * @property {Number} eyeX + * @readonly + * @example + * + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * cam = createCamera(); + * div = createDiv(); + * div.position(0, 0); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * div.html('eyeX = ' + cam.eyeX); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * camera position value on y axis + * @property {Number} eyeY + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * cam = createCamera(); + * div = createDiv(); + * div.position(0, 0); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * div.html('eyeY = ' + cam.eyeY); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * camera position value on z axis + * @property {Number} eyeZ + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * cam = createCamera(); + * div = createDiv(); + * div.position(0, 0); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * div.html('eyeZ = ' + cam.eyeZ); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * x coordinate representing center of the sketch + * @property {Number} centerX + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * cam.lookAt(1, 0, 0); + * div = createDiv('centerX = ' + cam.centerX); + * div.position(0, 0); + * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * y coordinate representing center of the sketch + * @property {Number} centerY + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * cam.lookAt(0, 1, 0); + * div = createDiv('centerY = ' + cam.centerY); + * div.position(0, 0); + * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * z coordinate representing center of the sketch + * @property {Number} centerZ + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * cam.lookAt(0, 0, 1); + * div = createDiv('centerZ = ' + cam.centerZ); + * div.position(0, 0); + * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * x component of direction 'up' from camera + * @property {Number} upX + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * div = createDiv('upX = ' + cam.upX); + * div.position(0, 0); + * div.style('color', 'blue'); + * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * y component of direction 'up' from camera + * @property {Number} upY + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * div = createDiv('upY = ' + cam.upY); + * div.position(0, 0); + * div.style('color', 'blue'); + * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * z component of direction 'up' from camera + * @property {Number} upZ + * @readonly + * @example + *
                    + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * div = createDiv('upZ = ' + cam.upZ); + * div.position(0, 0); + * div.style('color', 'blue'); + * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); + * } + *
                    + * + * @alt + * An example showing the use of camera object properties + * + */ + //////////////////////////////////////////////////////////////////////////////// + // Camera Projection Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Sets a perspective projection. + * Accepts the same parameters as the global + * perspective(). + * More information on this function can be found there. + * @method perspective + * @for p5.Camera + * @example + *
                    + * + * // drag the mouse to look around! + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // create a camera + * cam = createCamera(); + * // give it a perspective projection + * cam.perspective(PI / 3.0, width / height, 0.1, 500); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * + * translate(0, 0, 550); + * rotateX(-0.3); + * rotateY(-0.2); + * + * push(); + * translate(-15, 0, sin(frameCount / 30) * 95); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 95); + * box(30); + * pop(); + * } + * + *
                    + * @alt + * two colored 3D boxes move back and forth, rotating as mouse is dragged. + */ + + _createClass(Camera, [ + { + key: "perspective", + value: function perspective(fovy, aspect, near, far) { + this.cameraType = arguments.length > 0 ? "custom" : "default"; + if (typeof fovy === "undefined") { + fovy = this.defaultCameraFOV; + // this avoids issue where setting angleMode(DEGREES) before calling + // perspective leads to a smaller than expected FOV (because + // _computeCameraDefaultSettings computes in radians) + this.cameraFOV = fovy; + } else { + this.cameraFOV = this._renderer._pInst._toRadians(fovy); + } + if (typeof aspect === "undefined") { + aspect = this.defaultAspectRatio; + } + if (typeof near === "undefined") { + near = this.defaultCameraNear; + } + if (typeof far === "undefined") { + far = this.defaultCameraFar; + } + if (near <= 0.0001) { + near = 0.01; + console.log( + "Avoid perspective near plane values close to or below 0. " + + "Setting value to 0.01.", + ); + } + if (far < near) { + console.log( + "Perspective far plane value is less than near plane value. " + + "Nothing will be shown.", + ); + } + this.aspectRatio = aspect; + this.cameraNear = near; + this.cameraFar = far; + this.projMatrix = _main.default.Matrix.identity(); + var f = 1 / Math.tan(this.cameraFOV / 2); + var nf = 1 / (this.cameraNear - this.cameraFar); + /* eslint-disable indent */ + this.projMatrix.set( + f / aspect, + 0, + 0, + 0, + 0, + -f * this.yScale, + 0, + 0, + 0, + 0, + (far + near) * nf, + -1, + 0, + 0, + 2 * far * near * nf, + 0, + ); + /* eslint-enable indent */ + if (this._isActive()) { + this._renderer.uPMatrix.set( + this.projMatrix.mat4[0], + this.projMatrix.mat4[1], + this.projMatrix.mat4[2], + this.projMatrix.mat4[3], + this.projMatrix.mat4[4], + this.projMatrix.mat4[5], + this.projMatrix.mat4[6], + this.projMatrix.mat4[7], + this.projMatrix.mat4[8], + this.projMatrix.mat4[9], + this.projMatrix.mat4[10], + this.projMatrix.mat4[11], + this.projMatrix.mat4[12], + this.projMatrix.mat4[13], + this.projMatrix.mat4[14], + this.projMatrix.mat4[15], + ); + } + } /** + * Sets an orthographic projection. + * Accepts the same parameters as the global + * ortho(). + * More information on this function can be found there. + * @method ortho + * @for p5.Camera + * @example + *
                    + * + * // drag the mouse to look around! + * // there's no vanishing point + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // create a camera + * cam = createCamera(); + * // give it an orthographic projection + * cam.ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * translate(0,0,500); + * rotateX(0.2); + * rotateY(-0.2); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 65); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 65); + * box(30); + * pop(); + * } + * + *
                    + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. + */, + }, + { + key: "ortho", + value: function ortho(left, right, bottom, top, near, far) { + if (left === undefined) left = -this._renderer.width / 2; + if (right === undefined) right = +this._renderer.width / 2; + if (bottom === undefined) bottom = -this._renderer.height / 2; + if (top === undefined) top = +this._renderer.height / 2; + if (near === undefined) near = 0; + if (far === undefined) + far = Math.max(this._renderer.width, this._renderer.height); + this.cameraNear = near; + this.cameraFar = far; + var w = right - left; + var h = top - bottom; + var d = far - near; + var x = +2 / w; + var y = (+2 / h) * this.yScale; + var z = -2 / d; + var tx = -(right + left) / w; + var ty = -(top + bottom) / h; + var tz = -(far + near) / d; + this.projMatrix = _main.default.Matrix.identity(); + /* eslint-disable indent */ + this.projMatrix.set( + x, + 0, + 0, + 0, + 0, + -y, + 0, + 0, + 0, + 0, + z, + 0, + tx, + ty, + tz, + 1, + ); + /* eslint-enable indent */ + if (this._isActive()) { + this._renderer.uPMatrix.set( + this.projMatrix.mat4[0], + this.projMatrix.mat4[1], + this.projMatrix.mat4[2], + this.projMatrix.mat4[3], + this.projMatrix.mat4[4], + this.projMatrix.mat4[5], + this.projMatrix.mat4[6], + this.projMatrix.mat4[7], + this.projMatrix.mat4[8], + this.projMatrix.mat4[9], + this.projMatrix.mat4[10], + this.projMatrix.mat4[11], + this.projMatrix.mat4[12], + this.projMatrix.mat4[13], + this.projMatrix.mat4[14], + this.projMatrix.mat4[15], + ); + } + this.cameraType = "custom"; + } /** + * Sets the camera's frustum. + * Accepts the same parameters as the global + * frustum(). + * More information on this function can be found there. + * @method frustum + * @for p5.Camera + * @example + *
                    + * + * let cam; + * + * function setup() { + * x = createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * // create a camera + * cam = createCamera(); + * // set its frustum + * cam.frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * translate(0,0,700); + * rotateY(-0.2); + * rotateX(-0.3); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 25); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 25); + * box(30); + * pop(); + * } + * + *
                    + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. + */, + }, + { + key: "frustum", + value: function frustum(left, right, bottom, top, near, far) { + if (left === undefined) left = -this._renderer.width * 0.05; + if (right === undefined) right = +this._renderer.width * 0.05; + if (bottom === undefined) + bottom = +this._renderer.height * 0.05; + if (top === undefined) top = -this._renderer.height * 0.05; + if (near === undefined) near = this.defaultCameraNear; + if (far === undefined) far = this.defaultCameraFar; + this.cameraNear = near; + this.cameraFar = far; + var w = right - left; + var h = top - bottom; + var d = far - near; + var x = +(2 * near) / w; + var y = (+(2 * near) / h) * this.yScale; + var z = -(2 * far * near) / d; + var tx = (right + left) / w; + var ty = (top + bottom) / h; + var tz = -(far + near) / d; + this.projMatrix = _main.default.Matrix.identity(); + /* eslint-disable indent */ + this.projMatrix.set( + x, + 0, + 0, + 0, + 0, + -y, + 0, + 0, + tx, + ty, + tz, + -1, + 0, + 0, + z, + 0, + ); + /* eslint-enable indent */ + if (this._isActive()) { + this._renderer.uPMatrix.set( + this.projMatrix.mat4[0], + this.projMatrix.mat4[1], + this.projMatrix.mat4[2], + this.projMatrix.mat4[3], + this.projMatrix.mat4[4], + this.projMatrix.mat4[5], + this.projMatrix.mat4[6], + this.projMatrix.mat4[7], + this.projMatrix.mat4[8], + this.projMatrix.mat4[9], + this.projMatrix.mat4[10], + this.projMatrix.mat4[11], + this.projMatrix.mat4[12], + this.projMatrix.mat4[13], + this.projMatrix.mat4[14], + this.projMatrix.mat4[15], + ); + } + this.cameraType = "custom"; + }, //////////////////////////////////////////////////////////////////////////////// + // Camera Orientation Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Rotate camera view about arbitrary axis defined by x,y,z + * based on http://learnwebgl.brown37.net/07_cameras/camera_rotating_motion.html + * @method _rotateView + * @private + */ + }, + { + key: "_rotateView", + value: function _rotateView(a, x, y, z) { + var centerX = this.centerX; + var centerY = this.centerY; + var centerZ = this.centerZ; + // move center by eye position such that rotation happens around eye position + centerX -= this.eyeX; + centerY -= this.eyeY; + centerZ -= this.eyeZ; + var rotation = _main.default.Matrix.identity( + this._renderer._pInst, + ); + rotation.rotate(this._renderer._pInst._toRadians(a), x, y, z); + /* eslint-disable max-len */ + var rotatedCenter = [ + centerX * rotation.mat4[0] + + centerY * rotation.mat4[4] + + centerZ * rotation.mat4[8], + centerX * rotation.mat4[1] + + centerY * rotation.mat4[5] + + centerZ * rotation.mat4[9], + centerX * rotation.mat4[2] + + centerY * rotation.mat4[6] + + centerZ * rotation.mat4[10], + ]; + /* eslint-enable max-len */ + // add eye position back into center + rotatedCenter[0] += this.eyeX; + rotatedCenter[1] += this.eyeY; + rotatedCenter[2] += this.eyeZ; + this.camera( + this.eyeX, + this.eyeY, + this.eyeZ, + rotatedCenter[0], + rotatedCenter[1], + rotatedCenter[2], + this.upX, + this.upY, + this.upZ, + ); + } /** + * Panning rotates the camera view to the left and right. + * @method pan + * @param {Number} angle amount to rotate camera in current + * angleMode units. + * Greater than 0 values rotate counterclockwise (to the left). + * @example + *
                    + * + * let cam; + * let delta = 0.01; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * // set initial pan angle + * cam.pan(-0.8); + * } + * + * function draw() { + * background(200); + * + * // pan camera according to angle 'delta' + * cam.pan(delta); + * + * // every 160 frames, switch direction + * if (frameCount % 160 === 0) { + * delta *= -1; + * } + * + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                    + * + * @alt + * camera view pans left and right across a series of rotating 3D boxes. + */, + }, + { + key: "pan", + value: function pan(amount) { + var local = this._getLocalAxes(); + this._rotateView(amount, local.y[0], local.y[1], local.y[2]); + } /** + * Tilting rotates the camera view up and down. + * @method tilt + * @param {Number} angle amount to rotate camera in current + * angleMode units. + * Greater than 0 values rotate counterclockwise (to the left). + * @example + *
                    + * + * let cam; + * let delta = 0.01; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * // set initial tilt + * cam.tilt(-0.8); + * } + * + * function draw() { + * background(200); + * + * // pan camera according to angle 'delta' + * cam.tilt(delta); + * + * // every 160 frames, switch direction + * if (frameCount % 160 === 0) { + * delta *= -1; + * } + * + * rotateY(frameCount * 0.01); + * translate(0, -100, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * } + * + *
                    + * + * @alt + * camera view tilts up and down across a series of rotating 3D boxes. + */, + }, + { + key: "tilt", + value: function tilt(amount) { + var local = this._getLocalAxes(); + this._rotateView(amount, local.x[0], local.x[1], local.x[2]); + } /** + * Reorients the camera to look at a position in world space. + * @method lookAt + * @for p5.Camera + * @param {Number} x x position of a point in world space + * @param {Number} y y position of a point in world space + * @param {Number} z z position of a point in world space + * @example + *
                    + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * } + * + * function draw() { + * background(200); + * + * // look at a new random point every 60 frames + * if (frameCount % 60 === 0) { + * cam.lookAt(random(-100, 100), random(-50, 50), 0); + * } + * + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                    + * + * @alt + * camera view of rotating 3D cubes changes to look at a new random + * point every second . + */, + }, + { + key: "lookAt", + value: function lookAt(x, y, z) { + this.camera( + this.eyeX, + this.eyeY, + this.eyeZ, + x, + y, + z, + this.upX, + this.upY, + this.upZ, + ); + }, //////////////////////////////////////////////////////////////////////////////// + // Camera Position Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Sets the camera's position and orientation. + * Accepts the same parameters as the global + * camera(). + * More information on this function can be found there. + * @method camera + * @for p5.Camera + * @example + *
                    + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // Create a camera. + * // createCamera() sets the newly created camera as + * // the current (active) camera. + * cam = createCamera(); + * } + * + * function draw() { + * background(204); + * // Move the camera away from the plane by a sin wave + * cam.camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); + * plane(10, 10); + * } + * + *
                    + * @alt + * White square repeatedly grows to fill canvas and then shrinks. + * + * @example + *
                    + * + * // move slider to see changes! + * // sliders control the first 6 parameters of camera() + * + * let sliderGroup = []; + * let X; + * let Y; + * let Z; + * let centerX; + * let centerY; + * let centerZ; + * let h = 20; + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // create a camera + * cam = createCamera(); + * // create sliders + * for (var i = 0; i < 6; i++) { + * if (i === 2) { + * sliderGroup[i] = createSlider(10, 400, 200); + * } else { + * sliderGroup[i] = createSlider(-400, 400, 0); + * } + * h = map(i, 0, 6, 5, 85); + * sliderGroup[i].position(10, height + h); + * sliderGroup[i].style('width', '80px'); + * } + * } + * + * function draw() { + * background(60); + * // assigning sliders' value to each parameters + * X = sliderGroup[0].value(); + * Y = sliderGroup[1].value(); + * Z = sliderGroup[2].value(); + * centerX = sliderGroup[3].value(); + * centerY = sliderGroup[4].value(); + * centerZ = sliderGroup[5].value(); + * cam.camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); + * stroke(255); + * fill(255, 102, 94); + * box(85); + * } + * + *
                    + * @alt + * An interactive example of a red cube with 3 sliders for moving it across x, y, + * z axis and 3 sliders for shifting its center. + */ + }, + { + key: "camera", + value: function camera( + eyeX, + eyeY, + eyeZ, + centerX, + centerY, + centerZ, + upX, + upY, + upZ, + ) { + if (typeof eyeX === "undefined") { + eyeX = this.defaultEyeX; + eyeY = this.defaultEyeY; + eyeZ = this.defaultEyeZ; + centerX = eyeX; + centerY = eyeY; + centerZ = 0; + upX = 0; + upY = 1; + upZ = 0; + } + this.eyeX = eyeX; + this.eyeY = eyeY; + this.eyeZ = eyeZ; + if (typeof centerX !== "undefined") { + this.centerX = centerX; + this.centerY = centerY; + this.centerZ = centerZ; + } + if (typeof upX !== "undefined") { + this.upX = upX; + this.upY = upY; + this.upZ = upZ; + } + var local = this._getLocalAxes(); + // the camera affects the model view matrix, insofar as it + // inverse translates the world to the eye position of the camera + // and rotates it. + /* eslint-disable indent */ + this.cameraMatrix.set( + local.x[0], + local.y[0], + local.z[0], + 0, + local.x[1], + local.y[1], + local.z[1], + 0, + local.x[2], + local.y[2], + local.z[2], + 0, + 0, + 0, + 0, + 1, + ); + /* eslint-enable indent */ + var tx = -eyeX; + var ty = -eyeY; + var tz = -eyeZ; + this.cameraMatrix.translate([tx, ty, tz]); + if (this._isActive()) { + this._renderer.uMVMatrix.set( + this.cameraMatrix.mat4[0], + this.cameraMatrix.mat4[1], + this.cameraMatrix.mat4[2], + this.cameraMatrix.mat4[3], + this.cameraMatrix.mat4[4], + this.cameraMatrix.mat4[5], + this.cameraMatrix.mat4[6], + this.cameraMatrix.mat4[7], + this.cameraMatrix.mat4[8], + this.cameraMatrix.mat4[9], + this.cameraMatrix.mat4[10], + this.cameraMatrix.mat4[11], + this.cameraMatrix.mat4[12], + this.cameraMatrix.mat4[13], + this.cameraMatrix.mat4[14], + this.cameraMatrix.mat4[15], + ); + } + return this; + } /** + * Move camera along its local axes while maintaining current camera orientation. + * @method move + * @param {Number} x amount to move along camera's left-right axis + * @param {Number} y amount to move along camera's up-down axis + * @param {Number} z amount to move along camera's forward-backward axis + * @example + *
                    + * + * // see the camera move along its own axes while maintaining its orientation + * let cam; + * let delta = 0.5; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * } + * + * function draw() { + * background(200); + * + * // move the camera along its local axes + * cam.move(delta, delta, 0); + * + * // every 100 frames, switch direction + * if (frameCount % 150 === 0) { + * delta *= -1; + * } + * + * translate(-10, -10, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * } + * + *
                    + * + * @alt + * camera view moves along a series of 3D boxes, maintaining the same + * orientation throughout the move + */, + }, + { + key: "move", + value: function move(x, y, z) { + var local = this._getLocalAxes(); + // scale local axes by movement amounts + // based on http://learnwebgl.brown37.net/07_cameras/camera_linear_motion.html + var dx = [local.x[0] * x, local.x[1] * x, local.x[2] * x]; + var dy = [local.y[0] * y, local.y[1] * y, local.y[2] * y]; + var dz = [local.z[0] * z, local.z[1] * z, local.z[2] * z]; + this.camera( + this.eyeX + dx[0] + dy[0] + dz[0], + this.eyeY + dx[1] + dy[1] + dz[1], + this.eyeZ + dx[2] + dy[2] + dz[2], + this.centerX + dx[0] + dy[0] + dz[0], + this.centerY + dx[1] + dy[1] + dz[1], + this.centerZ + dx[2] + dy[2] + dz[2], + this.upX, + this.upY, + this.upZ, + ); + } /** + * Set camera position in world-space while maintaining current camera + * orientation. + * @method setPosition + * @param {Number} x x position of a point in world space + * @param {Number} y y position of a point in world space + * @param {Number} z z position of a point in world space + * @example + *
                    + * + * // press '1' '2' or '3' keys to set camera position + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * } + * + * function draw() { + * background(200); + * + * // '1' key + * if (keyIsDown(49)) { + * cam.setPosition(30, 0, 80); + * } + * // '2' key + * if (keyIsDown(50)) { + * cam.setPosition(0, 0, 80); + * } + * // '3' key + * if (keyIsDown(51)) { + * cam.setPosition(-30, 0, 80); + * } + * + * box(20); + * } + * + *
                    + * + * @alt + * camera position changes as the user presses keys, altering view of a 3D box + */, + }, + { + key: "setPosition", + value: function setPosition(x, y, z) { + var diffX = x - this.eyeX; + var diffY = y - this.eyeY; + var diffZ = z - this.eyeZ; + this.camera( + x, + y, + z, + this.centerX + diffX, + this.centerY + diffY, + this.centerZ + diffZ, + this.upX, + this.upY, + this.upZ, + ); + } /** + * Copies information about the argument camera's view and projection to + * the target camera. If the target camera is active, it will be reflected + * on the screen. + * + * @method set + * @param {p5.Camera} cam source camera + * + * @example + *
                    + * + * let cam, initialCam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * strokeWeight(3); + * + * // Set the initial state to initialCamera and set it to the camera + * // used for drawing. Then set cam to be the active camera. + * cam = createCamera(); + * initialCam = createCamera(); + * initialCam.camera(100, 100, 100, 0, 0, 0, 0, 0, -1); + * cam.set(initialCam); + * + * setCamera(cam); + * } + * + * function draw() { + * orbitControl(); + * background(255); + * box(50); + * translate(0, 0, -25); + * plane(100); + * } + * + * function doubleClicked(){ + * // Double-click to return the camera to its initial position. + * cam.set(initialCam); + * } + * + *
                    + * @alt + * Prepare two cameras. One is the camera that sets the initial state, + * and the other is the camera that moves with interaction. + * Draw a plane and a box on top of it, operate the camera using orbitControl(). + * Double-click to set the camera in the initial state and return to + * the initial state. + */, + }, + { + key: "set", + value: function set(cam) { + var keyNamesOfThePropToCopy = [ + "eyeX", + "eyeY", + "eyeZ", + "centerX", + "centerY", + "centerZ", + "upX", + "upY", + "upZ", + "cameraFOV", + "aspectRatio", + "cameraNear", + "cameraFar", + "cameraType", + "yScale", + ]; + for ( + var _i = 0, _keyNamesOfThePropToC = keyNamesOfThePropToCopy; + _i < _keyNamesOfThePropToC.length; + _i++ + ) { + var keyName = _keyNamesOfThePropToC[_i]; + this[keyName] = cam[keyName]; + } + this.cameraMatrix = cam.cameraMatrix.copy(); + this.projMatrix = cam.projMatrix.copy(); + // If the target camera is active, update uMVMatrix and uPMatrix. + if (this._isActive()) { + this._renderer.uMVMatrix.mat4 = + this.cameraMatrix.mat4.slice(); + this._renderer.uPMatrix.mat4 = this.projMatrix.mat4.slice(); + } + } /** + * For the cameras cam0 and cam1 with the given arguments, their view are combined + * with the parameter amt that represents the quantity, and the obtained view is applied. + * For example, if cam0 is looking straight ahead and cam1 is looking straight + * to the right and amt is 0.5, the applied camera will look to the halfway + * between front and right. + * If the applied camera is active, the applied result will be reflected on the screen. + * When applying this function, all cameras involved must have exactly the same projection + * settings. For example, if one is perspective, ortho, frustum, the other two must also be + * perspective, ortho, frustum respectively. However, if all cameras have ortho settings, + * interpolation is possible if the ratios of left, right, top and bottom are equal to each other. + * For example, when it is changed by orbitControl(). + * + * @method slerp + * @param {p5.Camera} cam0 first p5.Camera + * @param {p5.Camera} cam1 second p5.Camera + * @param {Number} amt amount to use for interpolation during slerp + * + * @example + *
                    + * + * let cam0, cam1, cam; + * function setup() { + * createCanvas(100, 100, WEBGL); + * strokeWeight(3); + * + * // camera for slerp. + * cam = createCamera(); + * // cam0 is looking at the cube from the front. + * // cam1 is pointing straight to the right in the cube + * // at the same position as cam0 by doing a pan(-PI/2). + * cam0 = createCamera(); + * cam1 = createCamera(); + * cam1.pan(-PI/2); + * + * // we only use cam. + * setCamera(cam); + * } + * + * function draw() { + * // calculate amount. + * const amt = 0.5 - 0.5 * cos(frameCount * TAU / 120); + * // slerp cam0 and cam1 with amt, set to cam. + * // When amt moves from 0 to 1, cam moves from cam0 to cam1, + * // shaking the camera to the right. + * cam.slerp(cam0, cam1, amt); + * + * background(255); + * // Every time the camera turns right, the cube drifts left. + * box(40); + * } + * + *
                    + * @alt + * Prepare two cameras. One camera is facing straight ahead to the cube and the other + * camera is in the same position and looking straight to the right. + * If you use a camera which interpolates these with slerp(), the facing direction + * of the camera will change smoothly between the front and the right. + * + * @example + *
                    + * + * let cam, lastCam, initialCam; + * let countForReset = 30; + * // This sample uses orbitControl() to move the camera. + * // Double-clicking the canvas restores the camera to its initial state. + * function setup() { + * createCanvas(100, 100, WEBGL); + * strokeWeight(3); + * + * cam = createCamera(); // main camera + * lastCam = createCamera(); // Camera for recording loc info before reset + * initialCam = createCamera(); // Camera for recording the initial state + * + * setCamera(cam); // set main camera + * } + * + * function draw() { + * if (countForReset < 30) { + * // if the reset count is less than 30, + * // it will move closer to the original camera as it increases. + * countForReset++; + * cam.slerp(lastCam, initialCam, countForReset / 30); + * } else { + * // if the count is 30, + * // you can freely move the main camera with orbitControl(). + * orbitControl(); + * } + * + * background(255); + * box(40); + * } + * // A double-click sets countForReset to 0 and initiates a reset. + * function doubleClicked() { + * if (countForReset === 30) { + * countForReset = 0; + * lastCam.set(cam); + * } + * } + * + *
                    + * @alt + * There is a camera, drawing a cube. The camera can be moved freely with + * orbitControl(). Double-click to smoothly return the camera to its initial state. + * The camera cannot be moved during that time. + */, + }, + { + key: "slerp", + value: function slerp(cam0, cam1, amt) { + // If t is 0 or 1, do not interpolate and set the argument camera. + if (amt === 0) { + this.set(cam0); + return; + } else if (amt === 1) { + this.set(cam1); + return; + } // For this cameras is ortho, assume that cam0 and cam1 are also ortho + // and interpolate the elements of the projection matrix. + // Use logarithmic interpolation for interpolation. + + if (this.projMatrix.mat4[15] !== 0) { + this.projMatrix.mat4[0] = + cam0.projMatrix.mat4[0] * + Math.pow( + cam1.projMatrix.mat4[0] / cam0.projMatrix.mat4[0], + amt, + ); + this.projMatrix.mat4[5] = + cam0.projMatrix.mat4[5] * + Math.pow( + cam1.projMatrix.mat4[5] / cam0.projMatrix.mat4[5], + amt, + ); + // If the camera is active, make uPMatrix reflect changes in projMatrix. + if (this._isActive()) { + this._renderer.uPMatrix.mat4 = + this.projMatrix.mat4.slice(); + } + } // prepare eye vector and center vector of argument cameras. + + var eye0 = new _main.default.Vector( + cam0.eyeX, + cam0.eyeY, + cam0.eyeZ, + ); + var eye1 = new _main.default.Vector( + cam1.eyeX, + cam1.eyeY, + cam1.eyeZ, + ); + var center0 = new _main.default.Vector( + cam0.centerX, + cam0.centerY, + cam0.centerZ, + ); + var center1 = new _main.default.Vector( + cam1.centerX, + cam1.centerY, + cam1.centerZ, + ); + // Calculate the distance between eye and center for each camera. + // Logarithmically interpolate these with amt. + var dist0 = _main.default.Vector.dist(eye0, center0); + var dist1 = _main.default.Vector.dist(eye1, center1); + var lerpedDist = dist0 * Math.pow(dist1 / dist0, amt); + // Next, calculate the ratio to interpolate the eye and center by a constant + // ratio for each camera. This ratio is the same for both. Also, with this ratio + // of points, the distance is the minimum distance of the two points of + // the same ratio. + // With this method, if the viewpoint is fixed, linear interpolation is performed + // at the viewpoint, and if the center is fixed, linear interpolation is performed + // at the center, resulting in reasonable interpolation. If both move, the point + // halfway between them is taken. + var eyeDiff = _main.default.Vector.sub(eye0, eye1); + var diffDiff = eye0 + .copy() + .sub(eye1) + .sub(center0) + .add(center1); + // Suppose there are two line segments. Consider the distance between the points + // above them as if they were taken in the same ratio. This calculation figures out + // a ratio that minimizes this. + // Each line segment is, a line segment connecting the viewpoint and the center + // for each camera. + var divider = diffDiff.magSq(); + var ratio = 1; // default. + if (divider > 0.000001) { + ratio = + _main.default.Vector.dot(eyeDiff, diffDiff) / divider; + ratio = Math.max(0, Math.min(ratio, 1)); + } // Take the appropriate proportions and work out the points + // that are between the new viewpoint and the new center position. + + var lerpedMedium = _main.default.Vector.lerp( + _main.default.Vector.lerp(eye0, center0, ratio), + _main.default.Vector.lerp(eye1, center1, ratio), + amt, + ); + // Prepare each of rotation matrix from their camera matrix + var rotMat0 = cam0.cameraMatrix.createSubMatrix3x3(); + var rotMat1 = cam1.cameraMatrix.createSubMatrix3x3(); + // get front and up vector from local-coordinate-system. + var front0 = rotMat0.row(2); + var front1 = rotMat1.row(2); + var up0 = rotMat0.row(1); + var up1 = rotMat1.row(1); + // prepare new vectors. + var newFront = new _main.default.Vector(); + var newUp = new _main.default.Vector(); + var newEye = new _main.default.Vector(); + var newCenter = new _main.default.Vector(); + // Create the inverse matrix of mat0 by transposing mat0, + // and multiply it to mat1 from the right. + // This matrix represents the difference between the two. + // 'deltaRot' means 'difference of rotation matrices'. + var deltaRot = rotMat1.mult3x3(rotMat0.copy().transpose3x3()); + // Calculate the trace and from it the cos value of the angle. + // An orthogonal matrix is just an orthonormal basis. If this is not the identity + // matrix, it is a centered orthonormal basis plus some angle of rotation about + // some axis. That's the angle. Letting this be theta, trace becomes 1+2cos(theta). + // reference: https://en.wikipedia.org/wiki/Rotation_matrix#Determining_the_angle + var diag = deltaRot.diagonal(); + var cosTheta = 0.5 * (diag[0] + diag[1] + diag[2] - 1); + // If the angle is close to 0, the two matrices are very close, + // so in that case we execute linearly interpolate. + if (1 - cosTheta < 1e-7) { + // Obtain the front vector and up vector by linear interpolation + // and normalize them. + // calculate newEye, newCenter with newFront vector. + newFront + .set(_main.default.Vector.lerp(front0, front1, amt)) + .normalize(); + newEye + .set(newFront) + .mult(ratio * lerpedDist) + .add(lerpedMedium); + newCenter + .set(newFront) + .mult((ratio - 1) * lerpedDist) + .add(lerpedMedium); + newUp + .set(_main.default.Vector.lerp(up0, up1, amt)) + .normalize(); + // set the camera + this.camera( + newEye.x, + newEye.y, + newEye.z, + newCenter.x, + newCenter.y, + newCenter.z, + newUp.x, + newUp.y, + newUp.z, + ); + return; + } // Calculates the axis vector and the angle of the difference orthogonal matrix. + // The axis vector is what I explained earlier in the comments. + // similar calculation is here: + // https://github.com/mrdoob/three.js/blob/883249620049d1632e8791732808fefd1a98c871/src/math/Quaternion.js#L294 + + var a, b, c, sinTheta; + var invOneMinusCosTheta = 1 / (1 - cosTheta); + var maxDiag = Math.max(diag[0], diag[1], diag[2]); + var offDiagSum13 = deltaRot.mat3[1] + deltaRot.mat3[3]; + var offDiagSum26 = deltaRot.mat3[2] + deltaRot.mat3[6]; + var offDiagSum57 = deltaRot.mat3[5] + deltaRot.mat3[7]; + if (maxDiag === diag[0]) { + a = Math.sqrt((diag[0] - cosTheta) * invOneMinusCosTheta); // not zero. + invOneMinusCosTheta /= a; + b = 0.5 * offDiagSum13 * invOneMinusCosTheta; + c = 0.5 * offDiagSum26 * invOneMinusCosTheta; + sinTheta = + (0.5 * (deltaRot.mat3[7] - deltaRot.mat3[5])) / a; + } else if (maxDiag === diag[1]) { + b = Math.sqrt((diag[1] - cosTheta) * invOneMinusCosTheta); // not zero. + invOneMinusCosTheta /= b; + c = 0.5 * offDiagSum57 * invOneMinusCosTheta; + a = 0.5 * offDiagSum13 * invOneMinusCosTheta; + sinTheta = + (0.5 * (deltaRot.mat3[2] - deltaRot.mat3[6])) / b; + } else { + c = Math.sqrt((diag[2] - cosTheta) * invOneMinusCosTheta); // not zero. + invOneMinusCosTheta /= c; + a = 0.5 * offDiagSum26 * invOneMinusCosTheta; + b = 0.5 * offDiagSum57 * invOneMinusCosTheta; + sinTheta = + (0.5 * (deltaRot.mat3[3] - deltaRot.mat3[1])) / c; + } // Constructs a new matrix after interpolating the angles. + // Multiplying mat0 by the first matrix yields mat1, but by creating a state + // in the middle of that matrix, you can obtain a matrix that is + // an intermediate state between mat0 and mat1. + + var angle = amt * Math.atan2(sinTheta, cosTheta); + var cosAngle = Math.cos(angle); + var sinAngle = Math.sin(angle); + var oneMinusCosAngle = 1 - cosAngle; + var ab = a * b; + var bc = b * c; + var ca = c * a; + var lerpedRotMat = new _main.default.Matrix("mat3", [ + cosAngle + oneMinusCosAngle * a * a, + oneMinusCosAngle * ab + sinAngle * c, + oneMinusCosAngle * ca - sinAngle * b, + oneMinusCosAngle * ab - sinAngle * c, + cosAngle + oneMinusCosAngle * b * b, + oneMinusCosAngle * bc + sinAngle * a, + oneMinusCosAngle * ca + sinAngle * b, + oneMinusCosAngle * bc - sinAngle * a, + cosAngle + oneMinusCosAngle * c * c, + ]); + // Multiply this to mat0 from left to get the interpolated front vector. + // calculate newEye, newCenter with newFront vector. + lerpedRotMat.multiplyVec3(front0, newFront); + newEye + .set(newFront) + .mult(ratio * lerpedDist) + .add(lerpedMedium); + newCenter + .set(newFront) + .mult((ratio - 1) * lerpedDist) + .add(lerpedMedium); + lerpedRotMat.multiplyVec3(up0, newUp); + // We also get the up vector in the same way and set the camera. + // The eye position and center position are calculated based on the front vector. + this.camera( + newEye.x, + newEye.y, + newEye.z, + newCenter.x, + newCenter.y, + newCenter.z, + newUp.x, + newUp.y, + newUp.z, + ); + }, //////////////////////////////////////////////////////////////////////////////// + // Camera Helper Methods + //////////////////////////////////////////////////////////////////////////////// + // @TODO: combine this function with _setDefaultCamera to compute these values + // as-needed + }, + { + key: "_computeCameraDefaultSettings", + value: function _computeCameraDefaultSettings() { + this.defaultAspectRatio = + this._renderer.width / this._renderer.height; + this.defaultEyeX = 0; + this.defaultEyeY = 0; + this.defaultEyeZ = 800; + this.defaultCameraFOV = + 2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ); + this.defaultCenterX = 0; + this.defaultCenterY = 0; + this.defaultCenterZ = 0; + this.defaultCameraNear = this.defaultEyeZ * 0.1; + this.defaultCameraFar = this.defaultEyeZ * 10; + }, //detect if user didn't set the camera + //then call this function below + }, + { + key: "_setDefaultCamera", + value: function _setDefaultCamera() { + this.cameraFOV = this.defaultCameraFOV; + this.aspectRatio = this.defaultAspectRatio; + this.eyeX = this.defaultEyeX; + this.eyeY = this.defaultEyeY; + this.eyeZ = this.defaultEyeZ; + this.centerX = this.defaultCenterX; + this.centerY = this.defaultCenterY; + this.centerZ = this.defaultCenterZ; + this.upX = 0; + this.upY = 1; + this.upZ = 0; + this.cameraNear = this.defaultCameraNear; + this.cameraFar = this.defaultCameraFar; + this.perspective(); + this.camera(); + this.cameraType = "default"; + }, + }, + { + key: "_resize", + value: function _resize() { + // If we're using the default camera, update the aspect ratio + if (this.cameraType === "default") { + this._computeCameraDefaultSettings(); + this.cameraFOV = this.defaultCameraFOV; + this.aspectRatio = this.defaultAspectRatio; + this.perspective(); + } + } /** + * Returns a copy of a camera. + * @method copy + * @private + */, + }, + { + key: "copy", + value: function copy() { + var _cam = new _main.default.Camera(this._renderer); + _cam.cameraFOV = this.cameraFOV; + _cam.aspectRatio = this.aspectRatio; + _cam.eyeX = this.eyeX; + _cam.eyeY = this.eyeY; + _cam.eyeZ = this.eyeZ; + _cam.centerX = this.centerX; + _cam.centerY = this.centerY; + _cam.centerZ = this.centerZ; + _cam.upX = this.upX; + _cam.upY = this.upY; + _cam.upZ = this.upZ; + _cam.cameraNear = this.cameraNear; + _cam.cameraFar = this.cameraFar; + _cam.cameraType = this.cameraType; + _cam.cameraMatrix = this.cameraMatrix.copy(); + _cam.projMatrix = this.projMatrix.copy(); + _cam.yScale = this.yScale; + return _cam; + } /** + * Returns a camera's local axes: left-right, up-down, and forward-backward, + * as defined by vectors in world-space. + * @method _getLocalAxes + * @private + */, + }, + { + key: "_getLocalAxes", + value: function _getLocalAxes() { + // calculate camera local Z vector + var z0 = this.eyeX - this.centerX; + var z1 = this.eyeY - this.centerY; + var z2 = this.eyeZ - this.centerZ; + // normalize camera local Z vector + var eyeDist = Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + if (eyeDist !== 0) { + z0 /= eyeDist; + z1 /= eyeDist; + z2 /= eyeDist; + } // calculate camera Y vector + + var y0 = this.upX; + var y1 = this.upY; + var y2 = this.upZ; + // compute camera local X vector as up vector (local Y) cross local Z + var x0 = y1 * z2 - y2 * z1; + var x1 = -y0 * z2 + y2 * z0; + var x2 = y0 * z1 - y1 * z0; + // recompute y = z cross x + y0 = z1 * x2 - z2 * x1; + y1 = -z0 * x2 + z2 * x0; + y2 = z0 * x1 - z1 * x0; + // cross product gives area of parallelogram, which is < 1.0 for + // non-perpendicular unit-length vectors; so normalize x, y here: + var xmag = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (xmag !== 0) { + x0 /= xmag; + x1 /= xmag; + x2 /= xmag; + } + var ymag = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (ymag !== 0) { + y0 /= ymag; + y1 /= ymag; + y2 /= ymag; + } + return { + x: [x0, x1, x2], + y: [y0, y1, y2], + z: [z0, z1, z2], + }; + } /** + * Orbits the camera about center point. For use with orbitControl(). + * @method _orbit + * @private + * @param {Number} dTheta change in spherical coordinate theta + * @param {Number} dPhi change in spherical coordinate phi + * @param {Number} dRadius change in radius + */, + }, + { + key: "_orbit", + value: function _orbit(dTheta, dPhi, dRadius) { + // Calculate the vector and its magnitude from the center to the viewpoint + var diffX = this.eyeX - this.centerX; + var diffY = this.eyeY - this.centerY; + var diffZ = this.eyeZ - this.centerZ; + var camRadius = Math.hypot(diffX, diffY, diffZ); + // front vector. unit vector from center to eye. + var front = new _main.default.Vector( + diffX, + diffY, + diffZ, + ).normalize(); + // up vector. normalized camera's up vector. + var up = new _main.default.Vector( + this.upX, + this.upY, + this.upZ, + ).normalize(); // y-axis + // side vector. Right when viewed from the front + var side = new _main.default.Vector.cross( + up, + front, + ).normalize(); // x-axis + // vertical vector. normalized vector of projection of front vector. + var vertical = new _main.default.Vector.cross(side, up); // z-axis + // update camRadius + camRadius *= Math.pow(10, dRadius); + // prevent zooming through the center: + if (camRadius < this.cameraNear) { + camRadius = this.cameraNear; + } + if (camRadius > this.cameraFar) { + camRadius = this.cameraFar; + } // calculate updated camera angle + // Find the angle between the "up" and the "front", add dPhi to that. + // angleBetween() may return negative value. Since this specification is subject to change + // due to version updates, it cannot be adopted, so here we calculate using a method + // that directly obtains the absolute value. + + var camPhi = + Math.acos( + Math.max( + -1, + Math.min(1, _main.default.Vector.dot(front, up)), + ), + ) + dPhi; + // Rotate by dTheta in the shortest direction from "vertical" to "side" + var camTheta = dTheta; + // Invert camera's upX, upY, upZ if dPhi is below 0 or above PI + if (camPhi <= 0 || camPhi >= Math.PI) { + this.upX *= -1; + this.upY *= -1; + this.upZ *= -1; + } // update eye vector by calculate new front vector + + up.mult(Math.cos(camPhi)); + vertical.mult(Math.cos(camTheta) * Math.sin(camPhi)); + side.mult(Math.sin(camTheta) * Math.sin(camPhi)); + front.set(up).add(vertical).add(side); + this.eyeX = camRadius * front.x + this.centerX; + this.eyeY = camRadius * front.y + this.centerY; + this.eyeZ = camRadius * front.z + this.centerZ; + // update camera + this.camera( + this.eyeX, + this.eyeY, + this.eyeZ, + this.centerX, + this.centerY, + this.centerZ, + this.upX, + this.upY, + this.upZ, + ); + } /** + * Orbits the camera about center point. For use with orbitControl(). + * Unlike _orbit(), the direction of rotation always matches the direction of pointer movement. + * @method _orbitFree + * @private + * @param {Number} dx the x component of the rotation vector. + * @param {Number} dy the y component of the rotation vector. + * @param {Number} dRadius change in radius + */, + }, + { + key: "_orbitFree", + value: function _orbitFree(dx, dy, dRadius) { + // Calculate the vector and its magnitude from the center to the viewpoint + var diffX = this.eyeX - this.centerX; + var diffY = this.eyeY - this.centerY; + var diffZ = this.eyeZ - this.centerZ; + var camRadius = Math.hypot(diffX, diffY, diffZ); + // front vector. unit vector from center to eye. + var front = new _main.default.Vector( + diffX, + diffY, + diffZ, + ).normalize(); + // up vector. camera's up vector. + var up = new _main.default.Vector( + this.upX, + this.upY, + this.upZ, + ); + // side vector. Right when viewed from the front. (like x-axis) + var side = new _main.default.Vector.cross( + up, + front, + ).normalize(); + // down vector. Bottom when viewed from the front. (like y-axis) + var down = new _main.default.Vector.cross(front, side); + // side vector and down vector are no longer used as-is. + // Create a vector representing the direction of rotation + // in the form cos(direction)*side + sin(direction)*down. + // Make the current side vector into this. + var directionAngle = Math.atan2(dy, dx); + down.mult(Math.sin(directionAngle)); + side.mult(Math.cos(directionAngle)).add(down); + // The amount of rotation is the size of the vector (dx, dy). + var rotAngle = Math.sqrt(dx * dx + dy * dy); + // The vector that is orthogonal to both the front vector and + // the rotation direction vector is the rotation axis vector. + var axis = new _main.default.Vector.cross(front, side); + // update camRadius + camRadius *= Math.pow(10, dRadius); + // prevent zooming through the center: + if (camRadius < this.cameraNear) { + camRadius = this.cameraNear; + } + if (camRadius > this.cameraFar) { + camRadius = this.cameraFar; + } // If the axis vector is likened to the z-axis, the front vector is + // the x-axis and the side vector is the y-axis. Rotate the up and front + // vectors respectively by thinking of them as rotations around the z-axis. + // Calculate the components by taking the dot product and + // calculate a rotation based on that. + + var c = Math.cos(rotAngle); + var s = Math.sin(rotAngle); + var dotFront = up.dot(front); + var dotSide = up.dot(side); + var ux = dotFront * c + dotSide * s; + var uy = -dotFront * s + dotSide * c; + var uz = up.dot(axis); + up.x = ux * front.x + uy * side.x + uz * axis.x; + up.y = ux * front.y + uy * side.y + uz * axis.y; + up.z = ux * front.z + uy * side.z + uz * axis.z; + // We won't be using the side vector and the front vector anymore, + // so let's make the front vector into the vector from the center to the new eye. + side.mult(-s); + front.mult(c).add(side).mult(camRadius); + // it's complete. let's update camera. + this.camera( + front.x + this.centerX, + front.y + this.centerY, + front.z + this.centerZ, + this.centerX, + this.centerY, + this.centerZ, + up.x, + up.y, + up.z, + ); + } /** + * Returns true if camera is currently attached to renderer. + * @method _isActive + * @private + */, + }, + { + key: "_isActive", + value: function _isActive() { + return this === this._renderer._curCamera; + }, + }, + ]); + return Camera; + })(); + /** + * Sets the current (active) camera of a 3D sketch. + * Allows for switching between multiple cameras. + * @method setCamera + * @param {p5.Camera} cam p5.Camera object + * @for p5 + * @example + *
                    + * + * let cam1, cam2; + * let currentCamera; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * + * cam1 = createCamera(); + * cam2 = createCamera(); + * cam2.setPosition(30, 0, 50); + * cam2.lookAt(0, 0, 0); + * cam2.ortho(); + * + * // set variable for previously active camera: + * currentCamera = 1; + * + * describe( + * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' + * ); + * } + * + * function draw() { + * background(200); + * + * // camera 1: + * cam1.lookAt(0, 0, 0); + * cam1.setPosition(sin(frameCount / 60) * 200, 0, 100); + * + * // every 100 frames, switch between the two cameras + * if (frameCount % 100 === 0) { + * if (currentCamera === 1) { + * setCamera(cam1); + * currentCamera = 0; + * } else { + * setCamera(cam2); + * currentCamera = 1; + * } + * } + * + * drawBoxes(); + * } + * + * function drawBoxes() { + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                    + * + * @alt + * Canvas switches between two camera views, each showing a series of spinning + * 3D boxes. + */ + _main.default.prototype.setCamera = function (cam) { + this._renderer._curCamera = cam; + // set the projection matrix (which is not normally updated each frame) + this._renderer.uPMatrix.set( + cam.projMatrix.mat4[0], + cam.projMatrix.mat4[1], + cam.projMatrix.mat4[2], + cam.projMatrix.mat4[3], + cam.projMatrix.mat4[4], + cam.projMatrix.mat4[5], + cam.projMatrix.mat4[6], + cam.projMatrix.mat4[7], + cam.projMatrix.mat4[8], + cam.projMatrix.mat4[9], + cam.projMatrix.mat4[10], + cam.projMatrix.mat4[11], + cam.projMatrix.mat4[12], + cam.projMatrix.mat4[13], + cam.projMatrix.mat4[14], + cam.projMatrix.mat4[15], + ); + }; + var _default = _main.default.Camera; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.math.hypot": 188, + "core-js/modules/es.string.sub": 218, + }, + ], + 348: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.log2"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.math.log2"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * An internal class to store data that will be sent to a p5.RenderBuffer. + * Those need to eventually go into a Float32Array, so this class provides a + * variable-length array container backed by a Float32Array so that it can be + * sent to the GPU without allocating a new array each frame. + * + * Like a C++ vector, its fixed-length Float32Array backing its contents will + * double in size when it goes over its capacity. + * + * @example + *
                    + * + * // Initialize storage with a capacity of 4 + * const storage = new DataArray(4); + * console.log(storage.data.length); // 4 + * console.log(storage.length); // 0 + * console.log(storage.dataArray()); // Empty Float32Array + * + * storage.push(1, 2, 3, 4, 5, 6); + * console.log(storage.data.length); // 8 + * console.log(storage.length); // 6 + * console.log(storage.dataArray()); // Float32Array{1, 2, 3, 4, 5, 6} + * + *
                    + */ + + _main.default.DataArray = /*#__PURE__*/ (function () { + function DataArray() { + var initialLength = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : 128; + _classCallCheck(this, DataArray); + this.length = 0; + this.data = new Float32Array(initialLength); + this.initialLength = initialLength; + } /** + * Returns a Float32Array window sized to the exact length of the data + */ + + _createClass(DataArray, [ + { + key: "dataArray", + value: function dataArray() { + return this.subArray(0, this.length); + } /** + * A "soft" clear, which keeps the underlying storage size the same, but + * empties the contents of its dataArray() + */, + }, + { + key: "clear", + value: function clear() { + this.length = 0; + } /** + * Can be used to scale a DataArray back down to fit its contents. + */, + }, + { + key: "rescale", + value: function rescale() { + if (this.length < this.data.length / 2) { + // Find the power of 2 size that fits the data + var targetLength = 1 << Math.ceil(Math.log2(this.length)); + var newData = new Float32Array(targetLength); + newData.set(this.data.subarray(0, this.length), 0); + this.data = newData; + } + } /** + * A full reset, which allocates a new underlying Float32Array at its initial + * length + */, + }, + { + key: "reset", + value: function reset() { + this.clear(); + this.data = new Float32Array(this.initialLength); + } /** + * Adds values to the DataArray, expanding its internal storage to + * accommodate the new items. + */, + }, + { + key: "push", + value: function push() { + for ( + var _len = arguments.length, + values = new Array(_len), + _key = 0; + _key < _len; + _key++ + ) { + values[_key] = arguments[_key]; + } + this.ensureLength(this.length + values.length); + this.data.set(values, this.length); + this.length += values.length; + } /** + * Returns a copy of the data from the index `from`, inclusive, to the index + * `to`, exclusive + */, + }, + { + key: "slice", + value: function slice(from, to) { + return this.data.slice(from, Math.min(to, this.length)); + } /** + * Returns a mutable Float32Array window from the index `from`, inclusive, to + * the index `to`, exclusive + */, + }, + { + key: "subArray", + value: function subArray(from, to) { + return this.data.subarray(from, Math.min(to, this.length)); + } /** + * Expand capacity of the internal storage until it can fit a target size + */, + }, + { + key: "ensureLength", + value: function ensureLength(target) { + while (this.data.length < target) { + var newData = new Float32Array(this.data.length * 2); + newData.set(this.data, 0); + this.data = newData; + } + }, + }, + ]); + return DataArray; + })(); + var _default = _main.default.DataArray; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.math.log2": 189, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.float32-array": 229, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + }, + ], + 349: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.reflect.get"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + var _p = _dereq_("./p5.Texture"); + var _p2 = _dereq_("./p5.RendererGL"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _slicedToArray(arr, i) { + return ( + _arrayWithHoles(arr) || + _iterableToArrayLimit(arr, i) || + _nonIterableRest() + ); + } + function _nonIterableRest() { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance", + ); + } + function _iterableToArrayLimit(arr, i) { + if ( + !( + Symbol.iterator in Object(arr) || + Object.prototype.toString.call(arr) === "[object Arguments]" + ) + ) { + return; + } + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for ( + var _i = arr[Symbol.iterator](), _s; + !(_n = (_s = _i.next()).done); + _n = true + ) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true, + }); + } else { + obj[key] = value; + } + return obj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return _get(target, property, receiver || target); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + return object; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * @module Rendering + * @requires constants + */ + + var FramebufferCamera = /*#__PURE__*/ (function (_p5$Camera) { + _inherits(FramebufferCamera, _p5$Camera); + var _super = _createSuper(FramebufferCamera); + /** + * A p5.Camera attached to a + * p5.Framebuffer. + * + * @class p5.FramebufferCamera + * @constructor + * @param {p5.Framebuffer} framebuffer The framebuffer this camera is + * attached to + * @private + */ + function FramebufferCamera(framebuffer) { + var _this; + _classCallCheck(this, FramebufferCamera); + _this = _super.call(this, framebuffer.target._renderer); + _this.fbo = framebuffer; + // WebGL textures are upside-down compared to textures that come from + // images and graphics. Framebuffer cameras need to invert their y + // axes when being rendered to so that the texture comes out rightway up + // when read in shaders or image(). + _this.yScale = -1; + return _this; + } + _createClass(FramebufferCamera, [ + { + key: "_computeCameraDefaultSettings", + value: function _computeCameraDefaultSettings() { + _get( + _getPrototypeOf(FramebufferCamera.prototype), + "_computeCameraDefaultSettings", + this, + ).call(this); + this.defaultAspectRatio = this.fbo.width / this.fbo.height; + this.defaultCameraFOV = + 2 * Math.atan(this.fbo.height / 2 / this.defaultEyeZ); + }, + }, + ]); + return FramebufferCamera; + })(_main.default.Camera); + _main.default.FramebufferCamera = FramebufferCamera; + var FramebufferTexture = /*#__PURE__*/ (function () { + /** + * A p5.Texture corresponding to a property of a + * p5.Framebuffer. + * + * @class p5.FramebufferTexture + * @param {p5.Framebuffer} framebuffer The framebuffer represented by this + * texture + * @param {String} property The property of the framebuffer represented by + * this texture, either `color` or `depth` + * @private + */ + function FramebufferTexture(framebuffer, property) { + _classCallCheck(this, FramebufferTexture); + this.framebuffer = framebuffer; + this.property = property; + } + _createClass(FramebufferTexture, [ + { + key: "rawTexture", + value: function rawTexture() { + return this.framebuffer[this.property]; + }, + }, + { + key: "width", + get: function get() { + return this.framebuffer.width * this.framebuffer.density; + }, + }, + { + key: "height", + get: function get() { + return this.framebuffer.height * this.framebuffer.density; + }, + }, + ]); + return FramebufferTexture; + })(); + _main.default.FramebufferTexture = FramebufferTexture; + var Framebuffer = /*#__PURE__*/ (function () { + /** + * An object that one can draw to and then read as a texture. While similar + * to a p5.Graphics, using a p5.Framebuffer as a texture will generally run + * much faster, as it lives within the same WebGL context as the canvas it + * is created on. It only works in WebGL mode. + * + * @class p5.Framebuffer + * @constructor + * @param {p5.Graphics|p5} target A p5 global instance or p5.Graphics + * @param {Object} [settings] A settings object + */ + function Framebuffer(target) { + var _this2 = this; + var settings = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}; + _classCallCheck(this, Framebuffer); + this.target = target; + this.target._renderer.framebuffers.add(this); + this._isClipApplied = false; + /** + * A Uint8ClampedArray + * containing the values for all the pixels in the Framebuffer. + * + * Like the main canvas pixels property, call + * loadPixels() before reading + * it, and call updatePixels() + * afterwards to update its data. + * + * Note that updating pixels via this property will be slower than + * drawing to the framebuffer directly. + * Consider using a shader instead of looping over pixels. + * + * @property {Number[]} pixels + */ + this.pixels = []; + this.format = settings.format || constants.UNSIGNED_BYTE; + this.channels = + settings.channels || + (target._renderer._pInst._glAttributes.alpha + ? constants.RGBA + : constants.RGB); + this.useDepth = + settings.depth === undefined ? true : settings.depth; + this.depthFormat = settings.depthFormat || constants.FLOAT; + this.textureFiltering = + settings.textureFiltering || constants.LINEAR; + if (settings.antialias === undefined) { + this.antialiasSamples = target._renderer._pInst._glAttributes + .antialias + ? 2 + : 0; + } else if (typeof settings.antialias === "number") { + this.antialiasSamples = settings.antialias; + } else { + this.antialiasSamples = settings.antialias ? 2 : 0; + } + this.antialias = this.antialiasSamples > 0; + if (this.antialias && target.webglVersion !== constants.WEBGL2) { + console.warn( + "Antialiasing is unsupported in a WebGL 1 context", + ); + this.antialias = false; + } + if (settings.width && settings.height) { + this.width = settings.width; + this.height = settings.height; + this.autoSized = false; + } else { + if ( + (settings.width === undefined) !== + (settings.height === undefined) + ) { + console.warn( + "Please supply both width and height for a framebuffer to give it a " + + "size. Only one was given, so the framebuffer will match the size " + + "of its canvas.", + ); + } + this.width = target.width; + this.height = target.height; + this.autoSized = true; + } + this.density = settings.density || target.pixelDensity(); + var gl = target._renderer.GL; + this.gl = gl; + this._checkIfFormatsAvailable(); + if (settings.stencil && !this.useDepth) { + console.warn( + "A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored.", + ); + } + this.useStencil = + this.useDepth && + (settings.stencil === undefined ? true : settings.stencil); + this.framebuffer = gl.createFramebuffer(); + if (!this.framebuffer) { + throw new Error("Unable to create a framebuffer"); + } + if (this.antialias) { + this.aaFramebuffer = gl.createFramebuffer(); + if (!this.aaFramebuffer) { + throw new Error( + "Unable to create a framebuffer for antialiasing", + ); + } + } + this._recreateTextures(); + var prevCam = this.target._renderer._curCamera; + this.defaultCamera = this.createCamera(); + this.target._renderer._curCamera = prevCam; + this.draw(function () { + return _this2.target.clear(); + }); + } /** + * Resizes the framebuffer to the given width and height. + * + * @method resize + * @param {Number} width + * @param {Number} height + * + * @example + *
                    + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function mouseMoved() { + * framebuffer.resize( + * max(20, mouseX), + * max(20, mouseY) + * ); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * normalMaterial(); + * sphere(20); + * framebuffer.end(); + * + * background(100); + * // Draw the framebuffer to the main canvas + * image(framebuffer, -width/2, -height/2); + * } + * + *
                    + * + * @alt + * A red, green, and blue sphere is drawn in the middle of a white rectangle + * which starts in the top left of the canvas and whose bottom right is at + * the user's mouse + */ + + _createClass(Framebuffer, [ + { + key: "resize", + value: function resize(width, height) { + this.autoSized = false; + this.width = width; + this.height = height; + this._handleResize(); + } /** + * Gets or sets the pixel scaling for high pixel density displays. By + * default, the density will match that of the canvas the framebuffer was + * created on, which will match the display density. + * + * Call this method with no arguments to get the current density, or pass + * in a number to set the density. + * + * @method pixelDensity + * @param {Number} [density] A scaling factor for the number of pixels per + * side of the framebuffer + */, + }, + { + key: "pixelDensity", + value: function pixelDensity(density) { + if (density) { + this.autoSized = false; + this.density = density; + this._handleResize(); + } else { + return this.density; + } + } /** + * Gets or sets whether or not this framebuffer will automatically resize + * along with the canvas it's attached to in order to match its size. + * + * Call this method with no arguments to see if it is currently auto-sized, + * or pass in a boolean to set this property. + * + * @method autoSized + * @param {Boolean} [autoSized] Whether or not the framebuffer should resize + * along with the canvas it's attached to + */, + }, + { + key: "autoSized", + value: function autoSized(_autoSized) { + if (_autoSized === undefined) { + return this.autoSized; + } else { + this.autoSized = _autoSized; + this._handleResize(); + } + } /** + * Checks the capabilities of the current WebGL environment to see if the + * settings supplied by the user are capable of being fulfilled. If they + * are not, warnings will be logged and the settings will be changed to + * something close that can be fulfilled. + * + * @private + */, + }, + { + key: "_checkIfFormatsAvailable", + value: function _checkIfFormatsAvailable() { + var gl = this.gl; + if ( + this.useDepth && + this.target.webglVersion === constants.WEBGL && + !gl.getExtension("WEBGL_depth_texture") + ) { + console.warn( + "Unable to create depth textures in this environment. Falling back " + + "to a framebuffer without depth.", + ); + this.useDepth = false; + } + if ( + this.useDepth && + this.target.webglVersion === constants.WEBGL && + this.depthFormat === constants.FLOAT + ) { + console.warn( + "FLOAT depth format is unavailable in WebGL 1. " + + "Defaulting to UNSIGNED_INT.", + ); + this.depthFormat = constants.UNSIGNED_INT; + } + if ( + ![ + constants.UNSIGNED_BYTE, + constants.FLOAT, + constants.HALF_FLOAT, + ].includes(this.format) + ) { + console.warn( + "Unknown Framebuffer format. " + + "Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. " + + "Defaulting to UNSIGNED_BYTE.", + ); + this.format = constants.UNSIGNED_BYTE; + } + if ( + this.useDepth && + ![constants.UNSIGNED_INT, constants.FLOAT].includes( + this.depthFormat, + ) + ) { + console.warn( + "Unknown Framebuffer depth format. " + + "Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT.", + ); + this.depthFormat = constants.FLOAT; + } + var support = (0, _p.checkWebGLCapabilities)( + this.target._renderer, + ); + if (!support.float && this.format === constants.FLOAT) { + console.warn( + "This environment does not support FLOAT textures. " + + "Falling back to UNSIGNED_BYTE.", + ); + this.format = constants.UNSIGNED_BYTE; + } + if ( + this.useDepth && + !support.float && + this.depthFormat === constants.FLOAT + ) { + console.warn( + "This environment does not support FLOAT depth textures. " + + "Falling back to UNSIGNED_INT.", + ); + this.depthFormat = constants.UNSIGNED_INT; + } + if ( + !support.halfFloat && + this.format === constants.HALF_FLOAT + ) { + console.warn( + "This environment does not support HALF_FLOAT textures. " + + "Falling back to UNSIGNED_BYTE.", + ); + this.format = constants.UNSIGNED_BYTE; + } + if ( + this.channels === constants.RGB && + [constants.FLOAT, constants.HALF_FLOAT].includes( + this.format, + ) + ) { + console.warn( + "FLOAT and HALF_FLOAT formats do not work cross-platform with only " + + "RGB channels. Falling back to RGBA.", + ); + this.channels = constants.RGBA; + } + } /** + * Creates new textures and renderbuffers given the current size of the + * framebuffer. + * + * @private + */, + }, + { + key: "_recreateTextures", + value: function _recreateTextures() { + var gl = this.gl; + this._updateSize(); + var prevBoundTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); + var prevBoundFramebuffer = gl.getParameter( + gl.FRAMEBUFFER_BINDING, + ); + var colorTexture = gl.createTexture(); + if (!colorTexture) { + throw new Error("Unable to create color texture"); + } + gl.bindTexture(gl.TEXTURE_2D, colorTexture); + var colorFormat = this._glColorFormat(); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + colorFormat.internalFormat, + this.width * this.density, + this.height * this.density, + 0, + colorFormat.format, + colorFormat.type, + null, + ); + this.colorTexture = colorTexture; + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + colorTexture, + 0, + ); + if (this.useDepth) { + // Create the depth texture + var depthTexture = gl.createTexture(); + if (!depthTexture) { + throw new Error("Unable to create depth texture"); + } + var depthFormat = this._glDepthFormat(); + gl.bindTexture(gl.TEXTURE_2D, depthTexture); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + depthFormat.internalFormat, + this.width * this.density, + this.height * this.density, + 0, + depthFormat.format, + depthFormat.type, + null, + ); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + this.useStencil + ? gl.DEPTH_STENCIL_ATTACHMENT + : gl.DEPTH_ATTACHMENT, + gl.TEXTURE_2D, + depthTexture, + 0, + ); + this.depthTexture = depthTexture; + } // Create separate framebuffer for antialiasing + + if (this.antialias) { + this.colorRenderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer( + gl.RENDERBUFFER, + this.colorRenderbuffer, + ); + gl.renderbufferStorageMultisample( + gl.RENDERBUFFER, + Math.max( + 0, + Math.min( + this.antialiasSamples, + gl.getParameter(gl.MAX_SAMPLES), + ), + ), + colorFormat.internalFormat, + this.width * this.density, + this.height * this.density, + ); + if (this.useDepth) { + var _depthFormat = this._glDepthFormat(); + this.depthRenderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer( + gl.RENDERBUFFER, + this.depthRenderbuffer, + ); + gl.renderbufferStorageMultisample( + gl.RENDERBUFFER, + Math.max( + 0, + Math.min( + this.antialiasSamples, + gl.getParameter(gl.MAX_SAMPLES), + ), + ), + _depthFormat.internalFormat, + this.width * this.density, + this.height * this.density, + ); + } + gl.bindFramebuffer(gl.FRAMEBUFFER, this.aaFramebuffer); + gl.framebufferRenderbuffer( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.RENDERBUFFER, + this.colorRenderbuffer, + ); + if (this.useDepth) { + gl.framebufferRenderbuffer( + gl.FRAMEBUFFER, + this.useStencil + ? gl.DEPTH_STENCIL_ATTACHMENT + : gl.DEPTH_ATTACHMENT, + gl.RENDERBUFFER, + this.depthRenderbuffer, + ); + } + } + if (this.useDepth) { + this.depth = new FramebufferTexture(this, "depthTexture"); + var depthFilter = gl.NEAREST; + this.depthP5Texture = new _main.default.Texture( + this.target._renderer, + this.depth, + { + minFilter: depthFilter, + magFilter: depthFilter, + }, + ); + this.target._renderer.textures.set( + this.depth, + this.depthP5Texture, + ); + } + this.color = new FramebufferTexture(this, "colorTexture"); + var filter = + this.textureFiltering === constants.LINEAR + ? gl.LINEAR + : gl.NEAREST; + this.colorP5Texture = new _main.default.Texture( + this.target._renderer, + this.color, + { + minFilter: filter, + magFilter: filter, + }, + ); + this.target._renderer.textures.set( + this.color, + this.colorP5Texture, + ); + gl.bindTexture(gl.TEXTURE_2D, prevBoundTexture); + gl.bindFramebuffer(gl.FRAMEBUFFER, prevBoundFramebuffer); + } /** + * To create a WebGL texture, one needs to supply three pieces of information: + * the type (the data type each channel will be stored as, e.g. int or float), + * the format (the color channels that will each be stored in the previously + * specified type, e.g. rgb or rgba), and the internal format (the specifics + * of how data for each channel, in the aforementioned type, will be packed + * together, such as how many bits to use, e.g. RGBA32F or RGB565.) + * + * The format and channels asked for by the user hint at what these values + * need to be, and the WebGL version affects what options are avaiable. + * This method returns the values for these three properties, given the + * framebuffer's settings. + * + * @private + */, + }, + { + key: "_glColorFormat", + value: function _glColorFormat() { + var type, format, internalFormat; + var gl = this.gl; + if (this.format === constants.FLOAT) { + type = gl.FLOAT; + } else if (this.format === constants.HALF_FLOAT) { + type = + this.target.webglVersion === constants.WEBGL2 + ? gl.HALF_FLOAT + : gl.getExtension("OES_texture_half_float") + .HALF_FLOAT_OES; + } else { + type = gl.UNSIGNED_BYTE; + } + if (this.channels === constants.RGBA) { + format = gl.RGBA; + } else { + format = gl.RGB; + } + if (this.target.webglVersion === constants.WEBGL2) { + var _gl$UNSIGNED_BYTE, _table; + // https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html + var table = + ((_table = {}), + _defineProperty( + _table, + gl.FLOAT, + _defineProperty({}, gl.RGBA, gl.RGBA32F), + ), + _defineProperty( + _table, + gl.HALF_FLOAT, + _defineProperty({}, gl.RGBA, gl.RGBA16F), + ), + _defineProperty( + _table, + gl.UNSIGNED_BYTE, + ((_gl$UNSIGNED_BYTE = {}), + _defineProperty(_gl$UNSIGNED_BYTE, gl.RGBA, gl.RGBA8), + _defineProperty(_gl$UNSIGNED_BYTE, gl.RGB, gl.RGB8), + _gl$UNSIGNED_BYTE), + ), + _table); + internalFormat = table[type][format]; + } else if (this.format === constants.HALF_FLOAT) { + internalFormat = gl.RGBA; + } else { + internalFormat = format; + } + return { + internalFormat: internalFormat, + format: format, + type: type, + }; + } /** + * To create a WebGL texture, one needs to supply three pieces of information: + * the type (the data type each channel will be stored as, e.g. int or float), + * the format (the color channels that will each be stored in the previously + * specified type, e.g. rgb or rgba), and the internal format (the specifics + * of how data for each channel, in the aforementioned type, will be packed + * together, such as how many bits to use, e.g. RGBA32F or RGB565.) + * + * This method takes into account the settings asked for by the user and + * returns values for these three properties that can be used for the + * texture storing depth information. + * + * @private + */, + }, + { + key: "_glDepthFormat", + value: function _glDepthFormat() { + var type, format, internalFormat; + var gl = this.gl; + if (this.useStencil) { + if (this.depthFormat === constants.FLOAT) { + type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; + } else if (this.target.webglVersion === constants.WEBGL2) { + type = gl.UNSIGNED_INT_24_8; + } else { + type = gl.getExtension( + "WEBGL_depth_texture", + ).UNSIGNED_INT_24_8_WEBGL; + } + } else { + if (this.depthFormat === constants.FLOAT) { + type = gl.FLOAT; + } else { + type = gl.UNSIGNED_INT; + } + } + if (this.useStencil) { + format = gl.DEPTH_STENCIL; + } else { + format = gl.DEPTH_COMPONENT; + } + if (this.useStencil) { + if (this.depthFormat === constants.FLOAT) { + internalFormat = gl.DEPTH32F_STENCIL8; + } else if (this.target.webglVersion === constants.WEBGL2) { + internalFormat = gl.DEPTH24_STENCIL8; + } else { + internalFormat = gl.DEPTH_STENCIL; + } + } else if (this.target.webglVersion === constants.WEBGL2) { + if (this.depthFormat === constants.FLOAT) { + internalFormat = gl.DEPTH_COMPONENT32F; + } else { + internalFormat = gl.DEPTH_COMPONENT24; + } + } else { + internalFormat = gl.DEPTH_COMPONENT; + } + return { + internalFormat: internalFormat, + format: format, + type: type, + }; + } /** + * A method that will be called when recreating textures. If the framebuffer + * is auto-sized, it will update its width, height, and density properties. + * + * @private + */, + }, + { + key: "_updateSize", + value: function _updateSize() { + if (this.autoSized) { + this.width = this.target.width; + this.height = this.target.height; + this.density = this.target.pixelDensity(); + } + } /** + * Called when the canvas that the framebuffer is attached to resizes. If the + * framebuffer is auto-sized, it will update its textures to match the new + * size. + * + * @private + */, + }, + { + key: "_canvasSizeChanged", + value: function _canvasSizeChanged() { + if (this.autoSized) { + this._handleResize(); + } + } /** + * Called when the size of the framebuffer has changed (either by being + * manually updated or from auto-size updates when its canvas changes size.) + * Old textures and renderbuffers will be deleted, and then recreated with the + * new size. + * + * @private + */, + }, + { + key: "_handleResize", + value: function _handleResize() { + var oldColor = this.color; + var oldDepth = this.depth; + var oldColorRenderbuffer = this.colorRenderbuffer; + var oldDepthRenderbuffer = this.depthRenderbuffer; + this._deleteTexture(oldColor); + if (oldDepth) this._deleteTexture(oldDepth); + var gl = this.gl; + if (oldColorRenderbuffer) + gl.deleteRenderbuffer(oldColorRenderbuffer); + if (oldDepthRenderbuffer) + gl.deleteRenderbuffer(oldDepthRenderbuffer); + this._recreateTextures(); + this.defaultCamera._resize(); + } /** + * Creates and returns a new + * p5.FramebufferCamera to be used + * while drawing to this framebuffer. The camera will be set as the + * currently active camera. + * + * @method createCamera + * @returns {p5.Camera} A new camera + */, + }, + { + key: "createCamera", + value: function createCamera() { + var cam = new FramebufferCamera(this); + cam._computeCameraDefaultSettings(); + cam._setDefaultCamera(); + this.target._renderer._curCamera = cam; + return cam; + } /** + * Given a raw texture wrapper, delete its stored texture from WebGL memory, + * and remove it from p5's list of active textures. + * + * @param {p5.FramebufferTexture} texture + * @private + */, + }, + { + key: "_deleteTexture", + value: function _deleteTexture(texture) { + var gl = this.gl; + gl.deleteTexture(texture.rawTexture()); + this.target._renderer.textures.delete(texture); + } /** + * Removes the framebuffer and frees its resources. + * + * @method remove + * + * @example + *
                    + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * const useFramebuffer = (frameCount % 120) > 60; + * if (useFramebuffer && !framebuffer) { + * // Create a new framebuffer for us to use + * framebuffer = createFramebuffer(); + * } else if (!useFramebuffer && framebuffer) { + * // Free the old framebuffer's resources + * framebuffer.remove(); + * framebuffer = undefined; + * } + * + * background(255); + * if (useFramebuffer) { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * fill(255, 0, 0); + * box(30); + * framebuffer.end(); + * + * image(framebuffer, -width/2, -height/2); + * } + * } + * + *
                    + * + * @alt + * A rotating red cube blinks on and off every second. + */, + }, + { + key: "remove", + value: function remove() { + var gl = this.gl; + this._deleteTexture(this.color); + if (this.depth) this._deleteTexture(this.depth); + gl.deleteFramebuffer(this.framebuffer); + if (this.aaFramebuffer) { + gl.deleteFramebuffer(this.aaFramebuffer); + } + if (this.depthRenderbuffer) { + gl.deleteRenderbuffer(this.depthRenderbuffer); + } + if (this.colorRenderbuffer) { + gl.deleteRenderbuffer(this.colorRenderbuffer); + } + this.target._renderer.framebuffers.delete(this); + } /** + * Begin drawing to this framebuffer. Subsequent drawing functions to the + * canvas the framebuffer is attached to will not be immediately visible, and + * will instead be drawn to the framebuffer's texture. Call + * end() when finished to make draw + * functions go right to the canvas again and to be able to read the + * contents of the framebuffer's texture. + * + * @method begin + * + * @example + *
                    + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * translate(0, 10*sin(frameCount * 0.01), 0); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * fill(255, 0, 0); + * box(50); + * framebuffer.end(); + * + * background(100); + * // Draw the framebuffer to the main canvas + * image(framebuffer, -50, -50, 25, 25); + * image(framebuffer, 0, 0, 35, 35); + * } + * + *
                    + * + * @alt + * A video of a floating and rotating red cube is pasted twice on the + * canvas: once in the top left, and again, larger, in the bottom right. + */, + }, + { + key: "begin", + value: function begin() { + this.prevFramebuffer = + this.target._renderer.activeFramebuffer(); + if (this.prevFramebuffer) { + this.prevFramebuffer._beforeEnd(); + } + this.target._renderer.activeFramebuffers.push(this); + this._beforeBegin(); + this.target.push(); + // Apply the framebuffer's camera. This does almost what + // RendererGL.reset() does, but this does not try to clear any buffers; + // it only sets the camera. + this.target.setCamera(this.defaultCamera); + this.target._renderer.uMVMatrix.set( + this.target._renderer._curCamera.cameraMatrix.mat4[0], + this.target._renderer._curCamera.cameraMatrix.mat4[1], + this.target._renderer._curCamera.cameraMatrix.mat4[2], + this.target._renderer._curCamera.cameraMatrix.mat4[3], + this.target._renderer._curCamera.cameraMatrix.mat4[4], + this.target._renderer._curCamera.cameraMatrix.mat4[5], + this.target._renderer._curCamera.cameraMatrix.mat4[6], + this.target._renderer._curCamera.cameraMatrix.mat4[7], + this.target._renderer._curCamera.cameraMatrix.mat4[8], + this.target._renderer._curCamera.cameraMatrix.mat4[9], + this.target._renderer._curCamera.cameraMatrix.mat4[10], + this.target._renderer._curCamera.cameraMatrix.mat4[11], + this.target._renderer._curCamera.cameraMatrix.mat4[12], + this.target._renderer._curCamera.cameraMatrix.mat4[13], + this.target._renderer._curCamera.cameraMatrix.mat4[14], + this.target._renderer._curCamera.cameraMatrix.mat4[15], + ); + } /** + * When making a p5.Framebuffer active so that it may be drawn to, this method + * returns the underlying WebGL framebuffer that needs to be active to + * support this. Antialiased framebuffers first write to a multisampled + * renderbuffer, while other framebuffers can write directly to their main + * framebuffers. + * + * @method _framebufferToBind + * @private + */, + }, + { + key: "_framebufferToBind", + value: function _framebufferToBind() { + if (this.antialias) { + // If antialiasing, draw to an antialiased renderbuffer rather + // than directly to the texture. In end() we will copy from the + // renderbuffer to the texture. + return this.aaFramebuffer; + } else { + return this.framebuffer; + } + } /** + * Ensures that the framebuffer is ready to be drawn to + * + * @method _beforeBegin + * @private + */, + }, + { + key: "_beforeBegin", + value: function _beforeBegin() { + var gl = this.gl; + gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebufferToBind()); + this.target._renderer.viewport( + this.width * this.density, + this.height * this.density, + ); + } /** + * Ensures that the framebuffer is ready to be read by other framebuffers. + * + * @method _beforeEnd + * @private + */, + }, + { + key: "_beforeEnd", + value: function _beforeEnd() { + if (this.antialias) { + var gl = this.gl; + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.aaFramebuffer); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.framebuffer); + var partsToCopy = [ + [gl.COLOR_BUFFER_BIT, this.colorP5Texture.glMagFilter], + ]; + if (this.useDepth) { + partsToCopy.push([ + gl.DEPTH_BUFFER_BIT, + this.depthP5Texture.glMagFilter, + ]); + } + for ( + var _i = 0, _partsToCopy = partsToCopy; + _i < _partsToCopy.length; + _i++ + ) { + var _partsToCopy$_i = _slicedToArray(_partsToCopy[_i], 2), + flag = _partsToCopy$_i[0], + filter = _partsToCopy$_i[1]; + gl.blitFramebuffer( + 0, + 0, + this.width * this.density, + this.height * this.density, + 0, + 0, + this.width * this.density, + this.height * this.density, + flag, + filter, + ); + } + } + } /** + * After having previously called + * begin(), this method stops drawing + * functions from going to the framebuffer's texture, allowing them to go + * right to the canvas again. After this, one can read from the framebuffer's + * texture. + * + * @method end + */, + }, + { + key: "end", + value: function end() { + var gl = this.gl; + this.target.pop(); + var fbo = this.target._renderer.activeFramebuffers.pop(); + if (fbo !== this) { + throw new Error( + "It looks like you've called end() while another Framebuffer is active.", + ); + } + this._beforeEnd(); + if (this.prevFramebuffer) { + this.prevFramebuffer._beforeBegin(); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + this.target._renderer.viewport( + this.target._renderer._origViewport.width, + this.target._renderer._origViewport.height, + ); + } + this.target._renderer._applyStencilTestIfClipping(); + } /** + * Run a function while drawing to the framebuffer rather than to its canvas. + * This is equivalent to calling `framebuffer.begin()`, running the function, + * and then calling `framebuffer.end()`, but ensures that one never + * accidentally forgets `begin` or `end`. + * + * @method draw + * @param {Function} callback A function to run that draws to the canvas. The + * function will immediately be run, but it will draw to the framebuffer + * instead of the canvas. + * + * @example + *
                    + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.draw(function() { + * background(255); + * translate(0, 10*sin(frameCount * 0.01), 0); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * fill(255, 0, 0); + * box(50); + * }); + * + * background(100); + * // Draw the framebuffer to the main canvas + * image(framebuffer, -50, -50, 25, 25); + * image(framebuffer, 0, 0, 35, 35); + * } + * + *
                    + * + * @alt + * A video of a floating and rotating red cube is pasted twice on the + * canvas: once in the top left, and again, larger, in the bottom right. + */, + }, + { + key: "draw", + value: function draw(callback) { + this.begin(); + callback(); + this.end(); + } /** + * Call this befpre updating pixels + * and calling updatePixels + * to replace the content of the framebuffer with the data in the pixels + * array. + */, + }, + { + key: "loadPixels", + value: function loadPixels() { + var gl = this.gl; + var prevFramebuffer = + this.target._renderer.activeFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); + var colorFormat = this._glColorFormat(); + this.pixels = (0, _p2.readPixelsWebGL)( + this.pixels, + gl, + this.framebuffer, + 0, + 0, + this.width * this.density, + this.height * this.density, + colorFormat.format, + colorFormat.type, + ); + if (prevFramebuffer) { + gl.bindFramebuffer( + gl.FRAMEBUFFER, + prevFramebuffer._framebufferToBind(), + ); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + } /** + * Get a region of pixels from the canvas in the form of a + * p5.Image, or a single pixel as an array of + * numbers. + * + * Returns an array of [R,G,B,A] values for any pixel or grabs a section of + * an image. If the Framebuffer has been set up to not store alpha values, then + * only [R,G,B] will be returned. If no parameters are specified, the entire + * image is returned. + * Use the x and y parameters to get the value of one pixel. Get a section of + * the display window by specifying additional w and h parameters. When + * getting an image, the x and y parameters define the coordinates for the + * upper-left corner of the image, regardless of the current imageMode(). + * + * @method get + * @param {Number} x x-coordinate of the pixel + * @param {Number} y y-coordinate of the pixel + * @param {Number} w width of the section to be returned + * @param {Number} h height of the section to be returned + * @return {p5.Image} the rectangle p5.Image + */, + /** + * @method get + * @return {p5.Image} the whole p5.Image + */ + /** + * @method get + * @param {Number} x + * @param {Number} y + * @return {Number[]} color of pixel at x,y in array format [R, G, B, A] + */ + }, + { + key: "get", + value: function get(x, y, w, h) { + _main.default._validateParameters( + "p5.Framebuffer.get", + arguments, + ); + var colorFormat = this._glColorFormat(); + if (x === undefined && y === undefined) { + x = 0; + y = 0; + w = this.width; + h = this.height; + } else if (w === undefined && h === undefined) { + if (x < 0 || y < 0 || x >= this.width || y >= this.height) { + console.warn( + "The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped.", + ); + x = this.target.constrain(x, 0, this.width - 1); + y = this.target.constrain(y, 0, this.height - 1); + } + return (0, _p2.readPixelWebGL)( + this.gl, + this.framebuffer, + x * this.density, + y * this.density, + colorFormat.format, + colorFormat.type, + ); + } + x = this.target.constrain(x, 0, this.width - 1); + y = this.target.constrain(y, 0, this.height - 1); + w = this.target.constrain(w, 1, this.width - x); + h = this.target.constrain(h, 1, this.height - y); + var rawData = (0, _p2.readPixelsWebGL)( + undefined, + this.gl, + this.framebuffer, + x * this.density, + y * this.density, + w * this.density, + h * this.density, + colorFormat.format, + colorFormat.type, + ); + // Framebuffer data might be either a Uint8Array or Float32Array + // depending on its format, and it may or may not have an alpha channel. + // To turn it into an image, we have to normalize the data into a + // Uint8ClampedArray with alpha. + var fullData = new Uint8ClampedArray( + w * h * this.density * this.density * 4, + ); + // Default channels that aren't in the framebuffer (e.g. alpha, if the + // framebuffer is in RGB mode instead of RGBA) to 255 + fullData.fill(255); + var channels = colorFormat.type === this.gl.RGB ? 3 : 4; + for (var _y = 0; _y < h * this.density; _y++) { + for (var _x = 0; _x < w * this.density; _x++) { + for (var channel = 0; channel < 4; channel++) { + var idx = (_y * w * this.density + _x) * 4 + channel; + if (channel < channels) { + // Find the index of this pixel in `rawData`, which might have a + // different number of channels + var rawDataIdx = + channels === 4 + ? idx + : (_y * w * this.density + _x) * channels + + channel; + fullData[idx] = rawData[rawDataIdx]; + } + } + } + } // Create an image from the data + + var region = new _main.default.Image( + w * this.density, + h * this.density, + ); + region.imageData = region.canvas + .getContext("2d") + .createImageData(region.width, region.height); + region.imageData.data.set(fullData); + region.pixels = region.imageData.data; + region.updatePixels(); + if (this.density !== 1) { + // TODO: support get() at a pixel density > 1 + region.resize(w, h); + } + return region; + } /** + * Call this after initially calling + * loadPixels() and updating pixels + * to replace the content of the framebuffer with the data in the pixels + * array. + * + * This will also clear the depth buffer so that any future drawing done + * afterwards will go on top. + * + * @example + *
                    + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * } + * function draw() { + * noStroke(); + * lights(); + * + * // Draw a sphere to the framebuffer + * framebuffer.begin(); + * background(0); + * sphere(25); + * framebuffer.end(); + * + * // Load its pixels and draw a gradient over the lower half of the canvas + * framebuffer.loadPixels(); + * for (let y = height/2; y < height; y++) { + * for (let x = 0; x < width; x++) { + * const idx = (y * width + x) * 4; + * framebuffer.pixels[idx] = (x / width) * 255; + * framebuffer.pixels[idx + 1] = (y / height) * 255; + * framebuffer.pixels[idx + 2] = 255; + * framebuffer.pixels[idx + 3] = 255; + * } + * } + * framebuffer.updatePixels(); + * + * // Draw a cube on top of the pixels we just wrote + * framebuffer.begin(); + * push(); + * translate(20, 20); + * rotateX(0.5); + * rotateY(0.5); + * box(20); + * pop(); + * framebuffer.end(); + * + * image(framebuffer, -width/2, -height/2); + * noLoop(); + * } + * + *
                    + * + * @alt + * A sphere partly occluded by a gradient from cyan to white to magenta on + * the lower half of the canvas, with a 3D cube drawn on top of that in the + * lower right corner. + */, + }, + { + key: "updatePixels", + value: function updatePixels() { + var gl = this.gl; + this.colorP5Texture.bindTexture(); + var colorFormat = this._glColorFormat(); + var channels = colorFormat.format === gl.RGBA ? 4 : 3; + var len = + this.width * + this.height * + this.density * + this.density * + channels; + var TypedArrayClass = + colorFormat.type === gl.UNSIGNED_BYTE + ? Uint8Array + : Float32Array; + if ( + !(this.pixels instanceof TypedArrayClass) || + this.pixels.length !== len + ) { + throw new Error( + "The pixels array has not been set correctly. Please call loadPixels() before updatePixels().", + ); + } + gl.texImage2D( + gl.TEXTURE_2D, + 0, + colorFormat.internalFormat, + this.width * this.density, + this.height * this.density, + 0, + colorFormat.format, + colorFormat.type, + this.pixels, + ); + this.colorP5Texture.unbindTexture(); + var prevFramebuffer = + this.target._renderer.activeFramebuffer(); + if (this.antialias) { + // We need to make sure the antialiased framebuffer also has the updated + // pixels so that if more is drawn to it, it goes on top of the updated + // pixels instead of replacing them. + // We can't blit the framebuffer to the multisampled antialias + // framebuffer to leave both in the same state, so instead we have + // to use image() to put the framebuffer texture onto the antialiased + // framebuffer. + this.begin(); + this.target.push(); + this.target.imageMode(this.target.CENTER); + this.target.resetMatrix(); + this.target.noStroke(); + this.target.clear(); + this.target.image(this, 0, 0); + this.target.pop(); + if (this.useDepth) { + gl.clearDepth(1); + gl.clear(gl.DEPTH_BUFFER_BIT); + } + this.end(); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); + if (this.useDepth) { + gl.clearDepth(1); + gl.clear(gl.DEPTH_BUFFER_BIT); + } + if (prevFramebuffer) { + gl.bindFramebuffer( + gl.FRAMEBUFFER, + prevFramebuffer._framebufferToBind(), + ); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + } + }, + }, + ]); + return Framebuffer; + })(); + /** + * A texture with the color information of the framebuffer. Pass this (or the + * framebuffer itself) to texture() to draw it to + * the canvas, or pass it to a shader with + * setUniform() to read its data. + * + * Since Framebuffers are controlled by WebGL, their y coordinates are stored + * flipped compared to images and videos. When texturing with a framebuffer + * texture, you may want to flip vertically, e.g. with + * `plane(framebuffer.width, -framebuffer.height)`. + * + * @property {p5.FramebufferTexture} color + * @for p5.Framebuffer + * + * @example + *
                    + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * normalMaterial(); + * sphere(20); + * framebuffer.end(); + * + * // Draw the framebuffer to the main canvas + * image(framebuffer.color, -width/2, -height/2); + * } + * + *
                    + * + * @alt + * A red, green, and blue sphere in the middle of the canvas + */ + /** + * A texture with the depth information of the framebuffer. If the framebuffer + * was created with `{ depth: false }` in its settings, then this property will + * be undefined. Pass this to texture() to draw it to + * the canvas, or pass it to a shader with + * setUniform() to read its data. + * + * Since Framebuffers are controlled by WebGL, their y coordinates are stored + * flipped compared to images and videos. When texturing with a framebuffer + * texture, you may want to flip vertically, e.g. with + * `plane(framebuffer.width, -framebuffer.height)`. + * + * @property {p5.FramebufferTexture|undefined} depth + * @for p5.Framebuffer + * + * @example + *
                    + * + * let framebuffer; + * let depthShader; + * + * const vert = ` + * precision highp float; + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * varying vec2 vTexCoord; + * void main() { + * vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * viewModelPosition; + * vTexCoord = aTexCoord; + * } + * `; + * + * const frag = ` + * precision highp float; + * varying vec2 vTexCoord; + * uniform sampler2D depth; + * void main() { + * float depthVal = texture2D(depth, vTexCoord).r; + * gl_FragColor = mix( + * vec4(1., 1., 0., 1.), // yellow + * vec4(0., 0., 1., 1.), // blue + * pow(depthVal, 6.) + * ); + * } + * `; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * depthShader = createShader(vert, frag); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * rotateX(frameCount * 0.01); + * box(20, 20, 100); + * framebuffer.end(); + * + * push(); + * shader(depthShader); + * depthShader.setUniform('depth', framebuffer.depth); + * plane(framebuffer.width, framebuffer.height); + * pop(); + * } + * + *
                    + * + * @alt + * A video of a rectangular prism rotating, with parts closest to the camera + * appearing yellow and colors getting progressively more blue the farther + * from the camera they go + */ + _main.default.Framebuffer = Framebuffer; + var _default = Framebuffer; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.RendererGL": 355, + "./p5.Texture": 357, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.reflect.get": 203, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.float32-array": 229, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/es.typed-array.uint8-clamped-array": 253, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 350: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.sub"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.for-each"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.sub"); + _dereq_("core-js/modules/web.dom-collections.for-each"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Shape + * @submodule 3D Primitives + * @for p5 + * @requires core + * @requires p5.Geometry + */ + //some of the functions are adjusted from Three.js(http://threejs.org) + /** + * p5 Geometry class + * @class p5.Geometry + * @constructor + * @param {Integer} [detailX] number of vertices along the x-axis. + * @param {Integer} [detailY] number of vertices along the y-axis. + * @param {function} [callback] function to call upon object instantiation. + */ + + _main.default.Geometry = /*#__PURE__*/ (function () { + function Geometry(detailX, detailY, callback) { + _classCallCheck(this, Geometry); + //an array containing every vertex + //@type [p5.Vector] + this.vertices = []; + //an array containing every vertex for stroke drawing + this.lineVertices = new _main.default.DataArray(); + // The tangents going into or out of a vertex on a line. Along a straight + // line segment, both should be equal. At an endpoint, one or the other + // will not exist and will be all 0. In joins between line segments, they + // may be different, as they will be the tangents on either side of the join. + this.lineTangentsIn = new _main.default.DataArray(); + this.lineTangentsOut = new _main.default.DataArray(); + // When drawing lines with thickness, entries in this buffer represent which + // side of the centerline the vertex will be placed. The sign of the number + // will represent the side of the centerline, and the absolute value will be + // used as an enum to determine which part of the cap or join each vertex + // represents. See the doc comments for _addCap and _addJoin for diagrams. + this.lineSides = new _main.default.DataArray(); + //an array containing 1 normal per vertex + //@type [p5.Vector] + //[p5.Vector, p5.Vector, p5.Vector,p5.Vector, p5.Vector, p5.Vector,...] + this.vertexNormals = []; + //an array containing each three vertex indices that form a face + //[[0, 1, 2], [2, 1, 3], ...] + this.faces = []; + //a 2D array containing uvs for every vertex + //[[0.0,0.0],[1.0,0.0], ...] + this.uvs = []; + // a 2D array containing edge connectivity pattern for create line vertices + //based on faces for most objects; + this.edges = []; + this.vertexColors = []; + // One color per vertex representing the stroke color at that vertex + this.vertexStrokeColors = []; + // One color per line vertex, generated automatically based on + // vertexStrokeColors in _edgesToVertices() + this.lineVertexColors = new _main.default.DataArray(); + this.detailX = detailX !== undefined ? detailX : 1; + this.detailY = detailY !== undefined ? detailY : 1; + this.dirtyFlags = {}; + if (callback instanceof Function) { + callback.call(this); + } + return this; // TODO: is this a constructor? + } + _createClass(Geometry, [ + { + key: "reset", + value: function reset() { + this.lineVertices.clear(); + this.lineTangentsIn.clear(); + this.lineTangentsOut.clear(); + this.lineSides.clear(); + this.vertices.length = 0; + this.edges.length = 0; + this.vertexColors.length = 0; + this.vertexStrokeColors.length = 0; + this.lineVertexColors.clear(); + this.vertexNormals.length = 0; + this.uvs.length = 0; + this.dirtyFlags = {}; + } /** + * Removes the internal colors of p5.Geometry. + * Using `clearColors()`, you can use `fill()` to supply new colors before drawing each shape. + * If `clearColors()` is not used, the shapes will use their internal colors by ignoring `fill()`. + * + * @method clearColors + * + * @example + *
                    + * + * let shape01; + * let shape02; + * let points = []; + * + * function setup() { + * createCanvas(600, 600, WEBGL); + * points.push(new p5.Vector(-1, -1, 0), new p5.Vector(-1, 1, 0), + * new p5.Vector(1, -1, 0), new p5.Vector(-1, -1, 0)); + * buildShape01(); + * buildShape02(); + * } + * function draw() { + * background(0); + * fill('pink'); // shape01 retains its internal blue color, so it won't turn pink. + * model(shape01); + * fill('yellow'); // Now, shape02 is yellow. + * model(shape02); + * } + * + * function buildShape01() { + * beginGeometry(); + * fill('blue'); // shape01's color is blue because its internal colors remain. + * beginShape(); + * for (let vec of points) vertex(vec.x * 100, vec.y * 100, vec.z * 100); + * endShape(CLOSE); + * shape01 = endGeometry(); + * } + * + * function buildShape02() { + * beginGeometry(); + * fill('red'); // shape02.clearColors() removes its internal colors. Now, shape02 is red. + * beginShape(); + * for (let vec of points) vertex(vec.x * 200, vec.y * 200, vec.z * 200); + * endShape(CLOSE); + * shape02 = endGeometry(); + * shape02.clearColors(); // Resets shape02's colors. + * } + * + *
                    + */, + }, + { + key: "clearColors", + value: function clearColors() { + this.vertexColors = []; + return this; + } /** + * computes faces for geometry objects based on the vertices. + * @method computeFaces + * @chainable + */, + }, + { + key: "computeFaces", + value: function computeFaces() { + this.faces.length = 0; + var sliceCount = this.detailX + 1; + var a, b, c, d; + for (var i = 0; i < this.detailY; i++) { + for (var j = 0; j < this.detailX; j++) { + a = i * sliceCount + j; // + offset; + b = i * sliceCount + j + 1; // + offset; + c = (i + 1) * sliceCount + j + 1; // + offset; + d = (i + 1) * sliceCount + j; // + offset; + this.faces.push([a, b, d]); + this.faces.push([d, b, c]); + } + } + return this; + }, + }, + { + key: "_getFaceNormal", + value: function _getFaceNormal(faceId) { + //This assumes that vA->vB->vC is a counter-clockwise ordering + var face = this.faces[faceId]; + var vA = this.vertices[face[0]]; + var vB = this.vertices[face[1]]; + var vC = this.vertices[face[2]]; + var ab = _main.default.Vector.sub(vB, vA); + var ac = _main.default.Vector.sub(vC, vA); + var n = _main.default.Vector.cross(ab, ac); + var ln = _main.default.Vector.mag(n); + var sinAlpha = + ln / + (_main.default.Vector.mag(ab) * + _main.default.Vector.mag(ac)); + if (sinAlpha === 0 || isNaN(sinAlpha)) { + console.warn( + "p5.Geometry.prototype._getFaceNormal:", + "face has colinear sides or a repeated vertex", + ); + return n; + } + if (sinAlpha > 1) sinAlpha = 1; // handle float rounding error + return n.mult(Math.asin(sinAlpha) / ln); + } /** + * This function calculates normals for each face, where each vertex's normal is the average of the normals of all faces it's connected to. + * i.e computes smooth normals per vertex as an average of each face. + * + * When using `FLAT` shading, vertices are disconnected/duplicated i.e each face has its own copy of vertices. + * When using `SMOOTH` shading, vertices are connected/deduplicated i.e each face has its vertices shared with other faces. + * + * Options can include: + * - `roundToPrecision`: Precision value for rounding computations. Defaults to 3. + * + * @method computeNormals + * @param {String} [shadingType] shading type (`FLAT` for flat shading or `SMOOTH` for smooth shading) for buildGeometry() outputs. Defaults to `FLAT`. + * @param {Object} [options] An optional object with configuration. + * @chainable + * + * @example + *
                    + * + * let helix; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * helix = buildGeometry(() => { + * beginShape(); + * + * for (let i = 0; i < TWO_PI * 3; i += 0.6) { + * let radius = 20; + * let x = cos(i) * radius; + * let y = sin(i) * radius; + * let z = map(i, 0, TWO_PI * 3, -30, 30); + * vertex(x, y, z); + * } + * endShape(); + * }); + * helix.computeNormals(); + * } + * function draw() { + * background(255); + * stroke(0); + * fill(150, 200, 250); + * lights(); + * rotateX(PI*0.2); + * orbitControl(); + * model(helix); + * } + * + *
                    + * + * @alt + * A 3D helix using the computeNormals() function by default uses `FLAT` to create a flat shading effect on the helix. + * + * @example + *
                    + * + * let star; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * star = buildGeometry(() => { + * beginShape(); + * for (let i = 0; i < TWO_PI; i += PI / 5) { + * let outerRadius = 60; + * let innerRadius = 30; + * let xOuter = cos(i) * outerRadius; + * let yOuter = sin(i) * outerRadius; + * let zOuter = random(-20, 20); + * vertex(xOuter, yOuter, zOuter); + * + * let nextI = i + PI / 5 / 2; + * let xInner = cos(nextI) * innerRadius; + * let yInner = sin(nextI) * innerRadius; + * let zInner = random(-20, 20); + * vertex(xInner, yInner, zInner); + * } + * endShape(CLOSE); + * }); + * star.computeNormals(SMOOTH); + * } + * function draw() { + * background(255); + * stroke(0); + * fill(150, 200, 250); + * lights(); + * rotateX(PI*0.2); + * orbitControl(); + * model(star); + * } + * + *
                    + * + * @alt + * A star-like geometry, here the computeNormals(SMOOTH) is applied for a smooth shading effect. + * This helps to avoid the faceted appearance that can occur with flat shading. + */, + }, + { + key: "computeNormals", + value: function computeNormals() { + var _this = this; + var shadingType = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : constants.FLAT; + var _ref = + arguments.length > 1 && arguments[1] !== undefined + ? arguments[1] + : {}, + _ref$roundToPrecision = _ref.roundToPrecision, + roundToPrecision = + _ref$roundToPrecision === void 0 + ? 3 + : _ref$roundToPrecision; + var vertexNormals = this.vertexNormals; + var vertices = this.vertices; + var faces = this.faces; + var iv; + if (shadingType === constants.SMOOTH) { + var vertexIndices = {}; + var uniqueVertices = []; + var power = Math.pow(10, roundToPrecision); + var rounded = function rounded(val) { + return Math.round(val * power) / power; + }; + var getKey = function getKey(vert) { + return "" + .concat(rounded(vert.x), ",") + .concat(rounded(vert.y), ",") + .concat(rounded(vert.z)); + }; + // loop through each vertex and add uniqueVertices + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + var key = getKey(vertex); + if (vertexIndices[key] === undefined) { + vertexIndices[key] = uniqueVertices.length; + uniqueVertices.push(vertex); + } + } // update face indices to use the deduplicated vertex indices + + faces.forEach(function (face) { + for (var fv = 0; fv < 3; ++fv) { + var originalVertexIndex = face[fv]; + var originalVertex = vertices[originalVertexIndex]; + var _key = getKey(originalVertex); + face[fv] = vertexIndices[_key]; + } + }); + // update edge indices to use the deduplicated vertex indices + this.edges.forEach(function (edge) { + for (var ev = 0; ev < 2; ++ev) { + var originalVertexIndex = edge[ev]; + var originalVertex = vertices[originalVertexIndex]; + var _key2 = getKey(originalVertex); + edge[ev] = vertexIndices[_key2]; + } + }); + // update the deduplicated vertices + this.vertices = vertices = uniqueVertices; + } // initialize the vertexNormals array with empty vectors + + vertexNormals.length = 0; + for (iv = 0; iv < vertices.length; ++iv) { + vertexNormals.push(new _main.default.Vector()); + } // loop through all the faces adding its normal to the normal + // of each of its vertices + + faces.forEach(function (face, f) { + var faceNormal = _this._getFaceNormal(f); + // all three vertices get the normal added + for (var fv = 0; fv < 3; ++fv) { + var vertexIndex = face[fv]; + vertexNormals[vertexIndex].add(faceNormal); + } + }); + // normalize the normals + for (iv = 0; iv < vertices.length; ++iv) { + vertexNormals[iv].normalize(); + } + return this; + } /** + * Averages the vertex normals. Used in curved + * surfaces + * @method averageNormals + * @chainable + */, + }, + { + key: "averageNormals", + value: function averageNormals() { + for (var i = 0; i <= this.detailY; i++) { + var offset = this.detailX + 1; + var temp = _main.default.Vector.add( + this.vertexNormals[i * offset], + this.vertexNormals[i * offset + this.detailX], + ); + temp = _main.default.Vector.div(temp, 2); + this.vertexNormals[i * offset] = temp; + this.vertexNormals[i * offset + this.detailX] = temp; + } + return this; + } /** + * Averages pole normals. Used in spherical primitives + * @method averagePoleNormals + * @chainable + */, + }, + { + key: "averagePoleNormals", + value: function averagePoleNormals() { + //average the north pole + var sum = new _main.default.Vector(0, 0, 0); + for (var i = 0; i < this.detailX; i++) { + sum.add(this.vertexNormals[i]); + } + sum = _main.default.Vector.div(sum, this.detailX); + for (var _i = 0; _i < this.detailX; _i++) { + this.vertexNormals[_i] = sum; + } //average the south pole + + sum = new _main.default.Vector(0, 0, 0); + for ( + var _i2 = this.vertices.length - 1; + _i2 > this.vertices.length - 1 - this.detailX; + _i2-- + ) { + sum.add(this.vertexNormals[_i2]); + } + sum = _main.default.Vector.div(sum, this.detailX); + for ( + var _i3 = this.vertices.length - 1; + _i3 > this.vertices.length - 1 - this.detailX; + _i3-- + ) { + this.vertexNormals[_i3] = sum; + } + return this; + } /** + * Create a 2D array for establishing stroke connections + * @private + * @chainable + */, + }, + { + key: "_makeTriangleEdges", + value: function _makeTriangleEdges() { + this.edges.length = 0; + for (var j = 0; j < this.faces.length; j++) { + this.edges.push([this.faces[j][0], this.faces[j][1]]); + this.edges.push([this.faces[j][1], this.faces[j][2]]); + this.edges.push([this.faces[j][2], this.faces[j][0]]); + } + return this; + } /** + * Converts each line segment into the vertices and vertex attributes needed + * to turn the line into a polygon on screen. This will include: + * - Two triangles line segment to create a rectangle + * - Two triangles per endpoint to create a stroke cap rectangle. A fragment + * shader is responsible for displaying the appropriate cap style within + * that rectangle. + * - Four triangles per join between adjacent line segments, creating a quad on + * either side of the join, perpendicular to the lines. A vertex shader will + * discard the quad in the "elbow" of the join, and a fragment shader will + * display the appropriate join style within the remaining quad. + * + * @private + * @chainable + */, + }, + { + key: "_edgesToVertices", + value: function _edgesToVertices() { + this.lineVertices.clear(); + this.lineTangentsIn.clear(); + this.lineTangentsOut.clear(); + this.lineSides.clear(); + var potentialCaps = new Map(); + var connected = new Set(); + var lastValidDir; + for (var i = 0; i < this.edges.length; i++) { + var prevEdge = this.edges[i - 1]; + var currEdge = this.edges[i]; + var begin = this.vertices[currEdge[0]]; + var end = this.vertices[currEdge[1]]; + var fromColor = + this.vertexStrokeColors.length > 0 + ? this.vertexStrokeColors.slice( + currEdge[0] * 4, + (currEdge[0] + 1) * 4, + ) + : [0, 0, 0, 0]; + var toColor = + this.vertexStrokeColors.length > 0 + ? this.vertexStrokeColors.slice( + currEdge[1] * 4, + (currEdge[1] + 1) * 4, + ) + : [0, 0, 0, 0]; + var dir = end.copy().sub(begin).normalize(); + var dirOK = dir.magSq() > 0; + if (dirOK) { + this._addSegment(begin, end, fromColor, toColor, dir); + } + if (i > 0 && prevEdge[1] === currEdge[0]) { + if (!connected.has(currEdge[0])) { + connected.add(currEdge[0]); + potentialCaps.delete(currEdge[0]); + // Add a join if this segment shares a vertex with the previous. Skip + // actually adding join vertices if either the previous segment or this + // one has a length of 0. + // + // Don't add a join if the tangents point in the same direction, which + // would mean the edges line up exactly, and there is no need for a join. + if ( + lastValidDir && + dirOK && + dir.dot(lastValidDir) < 1 - 1e-8 + ) { + this._addJoin(begin, lastValidDir, dir, fromColor); + } + } + } else { + // Start a new line + if (dirOK && !connected.has(currEdge[0])) { + var existingCap = potentialCaps.get(currEdge[0]); + if (existingCap) { + this._addJoin(begin, existingCap.dir, dir, fromColor); + potentialCaps.delete(currEdge[0]); + connected.add(currEdge[0]); + } else { + potentialCaps.set(currEdge[0], { + point: begin, + dir: dir.copy().mult(-1), + color: fromColor, + }); + } + } + if (lastValidDir && !connected.has(prevEdge[1])) { + var _existingCap = potentialCaps.get(prevEdge[1]); + if (_existingCap) { + this._addJoin( + this.vertices[prevEdge[1]], + lastValidDir, + _existingCap.dir.copy().mult(-1), + fromColor, + ); + potentialCaps.delete(prevEdge[1]); + connected.add(prevEdge[1]); + } else { + // Close off the last segment with a cap + potentialCaps.set(prevEdge[1], { + point: this.vertices[prevEdge[1]], + dir: lastValidDir, + color: fromColor, + }); + } + lastValidDir = undefined; + } + } + if ( + i === this.edges.length - 1 && + !connected.has(currEdge[1]) + ) { + var _existingCap2 = potentialCaps.get(currEdge[1]); + if (_existingCap2) { + this._addJoin( + end, + dir, + _existingCap2.dir.copy().mult(-1), + toColor, + ); + potentialCaps.delete(currEdge[1]); + connected.add(currEdge[1]); + } else { + potentialCaps.set(currEdge[1], { + point: end, + dir: dir, + color: toColor, + }); + } + } + if (dirOK) { + lastValidDir = dir; + } + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = potentialCaps.values()[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var _step$value = _step.value, + point = _step$value.point, + _dir = _step$value.dir, + color = _step$value.color; + this._addCap(point, _dir, color); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return this; + } /** + * Adds the vertices and vertex attributes for two triangles making a rectangle + * for a straight line segment. A vertex shader is responsible for picking + * proper coordinates on the screen given the centerline positions, the tangent, + * and the side of the centerline each vertex belongs to. Sides follow the + * following scheme: + * + * -1 -1 + * o-------------o + * | | + * o-------------o + * 1 1 + * + * @private + * @chainable + */, + }, + { + key: "_addSegment", + value: function _addSegment( + begin, + end, + fromColor, + toColor, + dir, + ) { + var _this$lineVertices, _this$lineVertexColor; + var a = begin.array(); + var b = end.array(); + var dirArr = dir.array(); + this.lineSides.push(1, 1, -1, 1, -1, -1); + for ( + var _i4 = 0, + _arr = [this.lineTangentsIn, this.lineTangentsOut]; + _i4 < _arr.length; + _i4++ + ) { + var tangents = _arr[_i4]; + for (var i = 0; i < 6; i++) { + tangents.push.apply(tangents, _toConsumableArray(dirArr)); + } + } + (_this$lineVertices = this.lineVertices).push.apply( + _this$lineVertices, + _toConsumableArray(a).concat( + _toConsumableArray(b), + _toConsumableArray(a), + _toConsumableArray(b), + _toConsumableArray(b), + _toConsumableArray(a), + ), + ); + (_this$lineVertexColor = this.lineVertexColors).push.apply( + _this$lineVertexColor, + _toConsumableArray(fromColor).concat( + _toConsumableArray(toColor), + _toConsumableArray(fromColor), + _toConsumableArray(toColor), + _toConsumableArray(toColor), + _toConsumableArray(fromColor), + ), + ); + return this; + } /** + * Adds the vertices and vertex attributes for two triangles representing the + * stroke cap of a line. A fragment shader is responsible for displaying the + * appropriate cap style within the rectangle they make. + * + * The lineSides buffer will include the following values for the points on + * the cap rectangle: + * + * -1 -2 + * -----------o---o + * | | + * -----------o---o + * 1 2 + * @private + * @chainable + */, + }, + { + key: "_addCap", + value: function _addCap(point, tangent, color) { + var ptArray = point.array(); + var tanInArray = tangent.array(); + var tanOutArray = [0, 0, 0]; + for (var i = 0; i < 6; i++) { + var _this$lineVertices2, + _this$lineTangentsIn, + _this$lineTangentsOut, + _this$lineVertexColor2; + (_this$lineVertices2 = this.lineVertices).push.apply( + _this$lineVertices2, + _toConsumableArray(ptArray), + ); + (_this$lineTangentsIn = this.lineTangentsIn).push.apply( + _this$lineTangentsIn, + _toConsumableArray(tanInArray), + ); + (_this$lineTangentsOut = this.lineTangentsOut).push.apply( + _this$lineTangentsOut, + tanOutArray, + ); + (_this$lineVertexColor2 = this.lineVertexColors).push.apply( + _this$lineVertexColor2, + _toConsumableArray(color), + ); + } + this.lineSides.push(-1, 2, -2, 1, 2, -1); + return this; + } /** + * Adds the vertices and vertex attributes for four triangles representing a + * join between two adjacent line segments. This creates a quad on either side + * of the shared vertex of the two line segments, with each quad perpendicular + * to the lines. A vertex shader will discard all but the quad in the "elbow" of + * the join, and a fragment shader will display the appropriate join style + * within the remaining quad. + * + * The lineSides buffer will include the following values for the points on + * the join rectangles: + * + * -1 -2 + * -------------o----o + * | | + * 1 o----o----o -3 + * | | 0 | + * --------o----o | + * 2| 3 | + * | | + * | | + * @private + * @chainable + */, + }, + { + key: "_addJoin", + value: function _addJoin(point, fromTangent, toTangent, color) { + var ptArray = point.array(); + var tanInArray = fromTangent.array(); + var tanOutArray = toTangent.array(); + for (var i = 0; i < 12; i++) { + var _this$lineVertices3, + _this$lineTangentsIn2, + _this$lineTangentsOut2, + _this$lineVertexColor3; + (_this$lineVertices3 = this.lineVertices).push.apply( + _this$lineVertices3, + _toConsumableArray(ptArray), + ); + (_this$lineTangentsIn2 = this.lineTangentsIn).push.apply( + _this$lineTangentsIn2, + _toConsumableArray(tanInArray), + ); + (_this$lineTangentsOut2 = this.lineTangentsOut).push.apply( + _this$lineTangentsOut2, + _toConsumableArray(tanOutArray), + ); + (_this$lineVertexColor3 = this.lineVertexColors).push.apply( + _this$lineVertexColor3, + _toConsumableArray(color), + ); + } + this.lineSides.push(-1, -3, -2, -1, 0, -3); + this.lineSides.push(3, 1, 2, 3, 0, 1); + return this; + } /** + * Modifies all vertices to be centered within the range -100 to 100. + * @method normalize + * @chainable + */, + }, + { + key: "normalize", + value: function normalize() { + if (this.vertices.length > 0) { + // Find the corners of our bounding box + var maxPosition = this.vertices[0].copy(); + var minPosition = this.vertices[0].copy(); + for (var i = 0; i < this.vertices.length; i++) { + maxPosition.x = Math.max( + maxPosition.x, + this.vertices[i].x, + ); + minPosition.x = Math.min( + minPosition.x, + this.vertices[i].x, + ); + maxPosition.y = Math.max( + maxPosition.y, + this.vertices[i].y, + ); + minPosition.y = Math.min( + minPosition.y, + this.vertices[i].y, + ); + maxPosition.z = Math.max( + maxPosition.z, + this.vertices[i].z, + ); + minPosition.z = Math.min( + minPosition.z, + this.vertices[i].z, + ); + } + var center = _main.default.Vector.lerp( + maxPosition, + minPosition, + 0.5, + ); + var dist = _main.default.Vector.sub( + maxPosition, + minPosition, + ); + var longestDist = Math.max( + Math.max(dist.x, dist.y), + dist.z, + ); + var scale = 200 / longestDist; + for (var _i5 = 0; _i5 < this.vertices.length; _i5++) { + this.vertices[_i5].sub(center); + this.vertices[_i5].mult(scale); + } + } + return this; + }, + }, + ]); + return Geometry; + })(); + var _default = _main.default.Geometry; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.for-each": 175, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.map": 187, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.set": 207, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.sub": 218, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.for-each": 255, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 351: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @requires constants + * @todo see methods below needing further implementation. + * future consideration: implement SIMD optimizations + * when browser compatibility becomes available + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/ + * Reference/Global_Objects/SIMD + */ + + var GLMAT_ARRAY_TYPE = Array; + var isMatrixArray = function isMatrixArray(x) { + return Array.isArray(x); + }; + if (typeof Float32Array !== "undefined") { + GLMAT_ARRAY_TYPE = Float32Array; + isMatrixArray = function isMatrixArray(x) { + return Array.isArray(x) || x instanceof Float32Array; + }; + } /** + * A class to describe a 4×4 matrix + * for model and view matrix manipulation in the p5js webgl renderer. + * @class p5.Matrix + * @private + * @constructor + * @param {Array} [mat4] column-major array literal of our 4×4 matrix + */ + + _main.default.Matrix = /*#__PURE__*/ (function () { + function _class() { + var _ref; + _classCallCheck(this, _class); + // This is default behavior when object + // instantiated using createMatrix() + // @todo implement createMatrix() in core/math.js + if ( + arguments.length && + ((_ref = arguments.length - 1), + _ref < 0 || arguments.length <= _ref + ? undefined + : arguments[_ref]) instanceof _main.default + ) { + var _ref2; + this.p5 = + ((_ref2 = arguments.length - 1), + _ref2 < 0 || arguments.length <= _ref2 + ? undefined + : arguments[_ref2]); + } + if ( + (arguments.length <= 0 ? undefined : arguments[0]) === "mat3" + ) { + this.mat3 = Array.isArray( + arguments.length <= 1 ? undefined : arguments[1], + ) + ? arguments.length <= 1 + ? undefined + : arguments[1] + : new GLMAT_ARRAY_TYPE([1, 0, 0, 0, 1, 0, 0, 0, 1]); + } else { + this.mat4 = Array.isArray( + arguments.length <= 0 ? undefined : arguments[0], + ) + ? arguments.length <= 0 + ? undefined + : arguments[0] + : new GLMAT_ARRAY_TYPE([ + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, + ]); + } + return this; + } /** + * Sets the x, y, and z component of the vector using two or three separate + * variables, the data from a p5.Matrix, or the values from a float array. + * + * @method set + * @param {p5.Matrix|Float32Array|Number[]} [inMatrix] the input p5.Matrix or + * an Array of length 16 + * @chainable + */ + /** + * @method set + * @param {Number[]} elements 16 numbers passed by value to avoid + * array copying. + * @chainable + */ + + _createClass( + _class, + [ + { + key: "set", + value: function set(inMatrix) { + if (inMatrix instanceof _main.default.Matrix) { + this.mat4 = inMatrix.mat4; + return this; + } else if (isMatrixArray(inMatrix)) { + this.mat4 = inMatrix; + return this; + } else if (arguments.length === 16) { + this.mat4[0] = arguments[0]; + this.mat4[1] = arguments[1]; + this.mat4[2] = arguments[2]; + this.mat4[3] = arguments[3]; + this.mat4[4] = arguments[4]; + this.mat4[5] = arguments[5]; + this.mat4[6] = arguments[6]; + this.mat4[7] = arguments[7]; + this.mat4[8] = arguments[8]; + this.mat4[9] = arguments[9]; + this.mat4[10] = arguments[10]; + this.mat4[11] = arguments[11]; + this.mat4[12] = arguments[12]; + this.mat4[13] = arguments[13]; + this.mat4[14] = arguments[14]; + this.mat4[15] = arguments[15]; + } + return this; + } /** + * Gets a copy of the vector, returns a p5.Matrix object. + * + * @method get + * @return {p5.Matrix} the copy of the p5.Matrix object + */, + }, + { + key: "get", + value: function get() { + return new _main.default.Matrix(this.mat4, this.p5); + } /** + * return a copy of this matrix. + * If this matrix is 4x4, a 4x4 matrix with exactly the same entries will be + * generated. The same is true if this matrix is 3x3. + * + * @method copy + * @return {p5.Matrix} the result matrix + */, + }, + { + key: "copy", + value: function copy() { + if (this.mat3 !== undefined) { + var copied3x3 = new _main.default.Matrix("mat3", this.p5); + copied3x3.mat3[0] = this.mat3[0]; + copied3x3.mat3[1] = this.mat3[1]; + copied3x3.mat3[2] = this.mat3[2]; + copied3x3.mat3[3] = this.mat3[3]; + copied3x3.mat3[4] = this.mat3[4]; + copied3x3.mat3[5] = this.mat3[5]; + copied3x3.mat3[6] = this.mat3[6]; + copied3x3.mat3[7] = this.mat3[7]; + copied3x3.mat3[8] = this.mat3[8]; + return copied3x3; + } + var copied = new _main.default.Matrix(this.p5); + copied.mat4[0] = this.mat4[0]; + copied.mat4[1] = this.mat4[1]; + copied.mat4[2] = this.mat4[2]; + copied.mat4[3] = this.mat4[3]; + copied.mat4[4] = this.mat4[4]; + copied.mat4[5] = this.mat4[5]; + copied.mat4[6] = this.mat4[6]; + copied.mat4[7] = this.mat4[7]; + copied.mat4[8] = this.mat4[8]; + copied.mat4[9] = this.mat4[9]; + copied.mat4[10] = this.mat4[10]; + copied.mat4[11] = this.mat4[11]; + copied.mat4[12] = this.mat4[12]; + copied.mat4[13] = this.mat4[13]; + copied.mat4[14] = this.mat4[14]; + copied.mat4[15] = this.mat4[15]; + return copied; + } /** + * return an identity matrix + * @method identity + * @return {p5.Matrix} the result matrix + */, + }, + { + key: "transpose", + /** + * transpose according to a given matrix + * @method transpose + * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be + * based on to transpose + * @chainable + */ + value: function transpose(a) { + var a01, a02, a03, a12, a13, a23; + if (a instanceof _main.default.Matrix) { + a01 = a.mat4[1]; + a02 = a.mat4[2]; + a03 = a.mat4[3]; + a12 = a.mat4[6]; + a13 = a.mat4[7]; + a23 = a.mat4[11]; + this.mat4[0] = a.mat4[0]; + this.mat4[1] = a.mat4[4]; + this.mat4[2] = a.mat4[8]; + this.mat4[3] = a.mat4[12]; + this.mat4[4] = a01; + this.mat4[5] = a.mat4[5]; + this.mat4[6] = a.mat4[9]; + this.mat4[7] = a.mat4[13]; + this.mat4[8] = a02; + this.mat4[9] = a12; + this.mat4[10] = a.mat4[10]; + this.mat4[11] = a.mat4[14]; + this.mat4[12] = a03; + this.mat4[13] = a13; + this.mat4[14] = a23; + this.mat4[15] = a.mat4[15]; + } else if (isMatrixArray(a)) { + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a12 = a[6]; + a13 = a[7]; + a23 = a[11]; + this.mat4[0] = a[0]; + this.mat4[1] = a[4]; + this.mat4[2] = a[8]; + this.mat4[3] = a[12]; + this.mat4[4] = a01; + this.mat4[5] = a[5]; + this.mat4[6] = a[9]; + this.mat4[7] = a[13]; + this.mat4[8] = a02; + this.mat4[9] = a12; + this.mat4[10] = a[10]; + this.mat4[11] = a[14]; + this.mat4[12] = a03; + this.mat4[13] = a13; + this.mat4[14] = a23; + this.mat4[15] = a[15]; + } + return this; + } /** + * invert matrix according to a give matrix + * @method invert + * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be + * based on to invert + * @chainable + */, + }, + { + key: "invert", + value: function invert(a) { + var a00, a01, a02, a03, a10, a11, a12, a13; + var a20, a21, a22, a23, a30, a31, a32, a33; + if (a instanceof _main.default.Matrix) { + a00 = a.mat4[0]; + a01 = a.mat4[1]; + a02 = a.mat4[2]; + a03 = a.mat4[3]; + a10 = a.mat4[4]; + a11 = a.mat4[5]; + a12 = a.mat4[6]; + a13 = a.mat4[7]; + a20 = a.mat4[8]; + a21 = a.mat4[9]; + a22 = a.mat4[10]; + a23 = a.mat4[11]; + a30 = a.mat4[12]; + a31 = a.mat4[13]; + a32 = a.mat4[14]; + a33 = a.mat4[15]; + } else if (isMatrixArray(a)) { + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; + a30 = a[12]; + a31 = a[13]; + a32 = a[14]; + a33 = a[15]; + } + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + // Calculate the determinant + var det = + b00 * b11 - + b01 * b10 + + b02 * b09 + + b03 * b08 - + b04 * b07 + + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + this.mat4[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + this.mat4[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + this.mat4[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + this.mat4[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + this.mat4[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + this.mat4[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + this.mat4[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + this.mat4[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + this.mat4[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + this.mat4[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + this.mat4[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + this.mat4[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + this.mat4[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + this.mat4[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + this.mat4[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + this.mat4[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return this; + } /** + * Inverts a 3×3 matrix + * @method invert3x3 + * @chainable + */, + }, + { + key: "invert3x3", + value: function invert3x3() { + var a00 = this.mat3[0]; + var a01 = this.mat3[1]; + var a02 = this.mat3[2]; + var a10 = this.mat3[3]; + var a11 = this.mat3[4]; + var a12 = this.mat3[5]; + var a20 = this.mat3[6]; + var a21 = this.mat3[7]; + var a22 = this.mat3[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + this.mat3[0] = b01 * det; + this.mat3[1] = (-a22 * a01 + a02 * a21) * det; + this.mat3[2] = (a12 * a01 - a02 * a11) * det; + this.mat3[3] = b11 * det; + this.mat3[4] = (a22 * a00 - a02 * a20) * det; + this.mat3[5] = (-a12 * a00 + a02 * a10) * det; + this.mat3[6] = b21 * det; + this.mat3[7] = (-a21 * a00 + a01 * a20) * det; + this.mat3[8] = (a11 * a00 - a01 * a10) * det; + return this; + } /** + * This function is only for 3x3 matrices. + * transposes a 3×3 p5.Matrix by a mat3 + * If there is an array of arguments, the matrix obtained by transposing + * the 3x3 matrix generated based on that array is set. + * If no arguments, it transposes itself and returns it. + * + * @method transpose3x3 + * @param {Number[]} mat3 1-dimensional array + * @chainable + */, + }, + { + key: "transpose3x3", + value: function transpose3x3(mat3) { + if (mat3 === undefined) { + mat3 = this.mat3; + } + var a01 = mat3[1]; + var a02 = mat3[2]; + var a12 = mat3[5]; + this.mat3[0] = mat3[0]; + this.mat3[1] = mat3[3]; + this.mat3[2] = mat3[6]; + this.mat3[3] = a01; + this.mat3[4] = mat3[4]; + this.mat3[5] = mat3[7]; + this.mat3[6] = a02; + this.mat3[7] = a12; + this.mat3[8] = mat3[8]; + return this; + } /** + * converts a 4×4 matrix to its 3×3 inverse transform + * commonly used in MVMatrix to NMatrix conversions. + * @method invertTranspose + * @param {p5.Matrix} mat4 the matrix to be based on to invert + * @chainable + * @todo finish implementation + */, + }, + { + key: "inverseTranspose", + value: function inverseTranspose(_ref3) { + var mat4 = _ref3.mat4; + if (this.mat3 === undefined) { + _main.default._friendlyError( + "sorry, this function only works with mat3", + ); + } else { + //convert mat4 -> mat3 + this.mat3[0] = mat4[0]; + this.mat3[1] = mat4[1]; + this.mat3[2] = mat4[2]; + this.mat3[3] = mat4[4]; + this.mat3[4] = mat4[5]; + this.mat3[5] = mat4[6]; + this.mat3[6] = mat4[8]; + this.mat3[7] = mat4[9]; + this.mat3[8] = mat4[10]; + } + var inverse = this.invert3x3(); + // check inverse succeeded + if (inverse) { + inverse.transpose3x3(this.mat3); + } else { + // in case of singularity, just zero the matrix + for (var i = 0; i < 9; i++) { + this.mat3[i] = 0; + } + } + return this; + } /** + * inspired by Toji's mat4 determinant + * @method determinant + * @return {Number} Determinant of our 4×4 matrix + */, + }, + { + key: "determinant", + value: function determinant() { + var d00 = + this.mat4[0] * this.mat4[5] - + this.mat4[1] * this.mat4[4], + d01 = + this.mat4[0] * this.mat4[6] - + this.mat4[2] * this.mat4[4], + d02 = + this.mat4[0] * this.mat4[7] - + this.mat4[3] * this.mat4[4], + d03 = + this.mat4[1] * this.mat4[6] - + this.mat4[2] * this.mat4[5], + d04 = + this.mat4[1] * this.mat4[7] - + this.mat4[3] * this.mat4[5], + d05 = + this.mat4[2] * this.mat4[7] - + this.mat4[3] * this.mat4[6], + d06 = + this.mat4[8] * this.mat4[13] - + this.mat4[9] * this.mat4[12], + d07 = + this.mat4[8] * this.mat4[14] - + this.mat4[10] * this.mat4[12], + d08 = + this.mat4[8] * this.mat4[15] - + this.mat4[11] * this.mat4[12], + d09 = + this.mat4[9] * this.mat4[14] - + this.mat4[10] * this.mat4[13], + d10 = + this.mat4[9] * this.mat4[15] - + this.mat4[11] * this.mat4[13], + d11 = + this.mat4[10] * this.mat4[15] - + this.mat4[11] * this.mat4[14]; + // Calculate the determinant + return ( + d00 * d11 - + d01 * d10 + + d02 * d09 + + d03 * d08 - + d04 * d07 + + d05 * d06 + ); + } /** + * multiply two mat4s + * @method mult + * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix + * we want to multiply by + * @chainable + */, + }, + { + key: "mult", + value: function mult(multMatrix) { + var _src; + if (multMatrix === this || multMatrix === this.mat4) { + _src = this.copy().mat4; // only need to allocate in this rare case + } else if (multMatrix instanceof _main.default.Matrix) { + _src = multMatrix.mat4; + } else if (isMatrixArray(multMatrix)) { + _src = multMatrix; + } else if (arguments.length === 16) { + _src = arguments; + } else { + return; // nothing to do. + } // each row is used for the multiplier + + var b0 = this.mat4[0], + b1 = this.mat4[1], + b2 = this.mat4[2], + b3 = this.mat4[3]; + this.mat4[0] = + b0 * _src[0] + + b1 * _src[4] + + b2 * _src[8] + + b3 * _src[12]; + this.mat4[1] = + b0 * _src[1] + + b1 * _src[5] + + b2 * _src[9] + + b3 * _src[13]; + this.mat4[2] = + b0 * _src[2] + + b1 * _src[6] + + b2 * _src[10] + + b3 * _src[14]; + this.mat4[3] = + b0 * _src[3] + + b1 * _src[7] + + b2 * _src[11] + + b3 * _src[15]; + b0 = this.mat4[4]; + b1 = this.mat4[5]; + b2 = this.mat4[6]; + b3 = this.mat4[7]; + this.mat4[4] = + b0 * _src[0] + + b1 * _src[4] + + b2 * _src[8] + + b3 * _src[12]; + this.mat4[5] = + b0 * _src[1] + + b1 * _src[5] + + b2 * _src[9] + + b3 * _src[13]; + this.mat4[6] = + b0 * _src[2] + + b1 * _src[6] + + b2 * _src[10] + + b3 * _src[14]; + this.mat4[7] = + b0 * _src[3] + + b1 * _src[7] + + b2 * _src[11] + + b3 * _src[15]; + b0 = this.mat4[8]; + b1 = this.mat4[9]; + b2 = this.mat4[10]; + b3 = this.mat4[11]; + this.mat4[8] = + b0 * _src[0] + + b1 * _src[4] + + b2 * _src[8] + + b3 * _src[12]; + this.mat4[9] = + b0 * _src[1] + + b1 * _src[5] + + b2 * _src[9] + + b3 * _src[13]; + this.mat4[10] = + b0 * _src[2] + + b1 * _src[6] + + b2 * _src[10] + + b3 * _src[14]; + this.mat4[11] = + b0 * _src[3] + + b1 * _src[7] + + b2 * _src[11] + + b3 * _src[15]; + b0 = this.mat4[12]; + b1 = this.mat4[13]; + b2 = this.mat4[14]; + b3 = this.mat4[15]; + this.mat4[12] = + b0 * _src[0] + + b1 * _src[4] + + b2 * _src[8] + + b3 * _src[12]; + this.mat4[13] = + b0 * _src[1] + + b1 * _src[5] + + b2 * _src[9] + + b3 * _src[13]; + this.mat4[14] = + b0 * _src[2] + + b1 * _src[6] + + b2 * _src[10] + + b3 * _src[14]; + this.mat4[15] = + b0 * _src[3] + + b1 * _src[7] + + b2 * _src[11] + + b3 * _src[15]; + return this; + }, + }, + { + key: "apply", + value: function apply(multMatrix) { + var _src; + if (multMatrix === this || multMatrix === this.mat4) { + _src = this.copy().mat4; // only need to allocate in this rare case + } else if (multMatrix instanceof _main.default.Matrix) { + _src = multMatrix.mat4; + } else if (isMatrixArray(multMatrix)) { + _src = multMatrix; + } else if (arguments.length === 16) { + _src = arguments; + } else { + return; // nothing to do. + } + var mat4 = this.mat4; + // each row is used for the multiplier + var m0 = mat4[0]; + var m4 = mat4[4]; + var m8 = mat4[8]; + var m12 = mat4[12]; + mat4[0] = + _src[0] * m0 + + _src[1] * m4 + + _src[2] * m8 + + _src[3] * m12; + mat4[4] = + _src[4] * m0 + + _src[5] * m4 + + _src[6] * m8 + + _src[7] * m12; + mat4[8] = + _src[8] * m0 + + _src[9] * m4 + + _src[10] * m8 + + _src[11] * m12; + mat4[12] = + _src[12] * m0 + + _src[13] * m4 + + _src[14] * m8 + + _src[15] * m12; + var m1 = mat4[1]; + var m5 = mat4[5]; + var m9 = mat4[9]; + var m13 = mat4[13]; + mat4[1] = + _src[0] * m1 + + _src[1] * m5 + + _src[2] * m9 + + _src[3] * m13; + mat4[5] = + _src[4] * m1 + + _src[5] * m5 + + _src[6] * m9 + + _src[7] * m13; + mat4[9] = + _src[8] * m1 + + _src[9] * m5 + + _src[10] * m9 + + _src[11] * m13; + mat4[13] = + _src[12] * m1 + + _src[13] * m5 + + _src[14] * m9 + + _src[15] * m13; + var m2 = mat4[2]; + var m6 = mat4[6]; + var m10 = mat4[10]; + var m14 = mat4[14]; + mat4[2] = + _src[0] * m2 + + _src[1] * m6 + + _src[2] * m10 + + _src[3] * m14; + mat4[6] = + _src[4] * m2 + + _src[5] * m6 + + _src[6] * m10 + + _src[7] * m14; + mat4[10] = + _src[8] * m2 + + _src[9] * m6 + + _src[10] * m10 + + _src[11] * m14; + mat4[14] = + _src[12] * m2 + + _src[13] * m6 + + _src[14] * m10 + + _src[15] * m14; + var m3 = mat4[3]; + var m7 = mat4[7]; + var m11 = mat4[11]; + var m15 = mat4[15]; + mat4[3] = + _src[0] * m3 + + _src[1] * m7 + + _src[2] * m11 + + _src[3] * m15; + mat4[7] = + _src[4] * m3 + + _src[5] * m7 + + _src[6] * m11 + + _src[7] * m15; + mat4[11] = + _src[8] * m3 + + _src[9] * m7 + + _src[10] * m11 + + _src[11] * m15; + mat4[15] = + _src[12] * m3 + + _src[13] * m7 + + _src[14] * m11 + + _src[15] * m15; + return this; + } /** + * scales a p5.Matrix by scalars or a vector + * @method scale + * @param {p5.Vector|Float32Array|Number[]} s vector to scale by + * @chainable + */, + }, + { + key: "scale", + value: function scale(x, y, z) { + if (x instanceof _main.default.Vector) { + // x is a vector, extract the components from it. + y = x.y; + z = x.z; + x = x.x; // must be last + } else if (x instanceof Array) { + // x is an array, extract the components from it. + y = x[1]; + z = x[2]; + x = x[0]; // must be last + } + this.mat4[0] *= x; + this.mat4[1] *= x; + this.mat4[2] *= x; + this.mat4[3] *= x; + this.mat4[4] *= y; + this.mat4[5] *= y; + this.mat4[6] *= y; + this.mat4[7] *= y; + this.mat4[8] *= z; + this.mat4[9] *= z; + this.mat4[10] *= z; + this.mat4[11] *= z; + return this; + } /** + * rotate our Matrix around an axis by the given angle. + * @method rotate + * @param {Number} a The angle of rotation in radians + * @param {p5.Vector|Number[]} axis the axis(es) to rotate around + * @chainable + * inspired by Toji's gl-matrix lib, mat4 rotation + */, + }, + { + key: "rotate", + value: function rotate(a, x, y, z) { + if (x instanceof _main.default.Vector) { + // x is a vector, extract the components from it. + y = x.y; + z = x.z; + x = x.x; //must be last + } else if (x instanceof Array) { + // x is an array, extract the components from it. + y = x[1]; + z = x[2]; + x = x[0]; //must be last + } + var len = Math.sqrt(x * x + y * y + z * z); + x *= 1 / len; + y *= 1 / len; + z *= 1 / len; + var a00 = this.mat4[0]; + var a01 = this.mat4[1]; + var a02 = this.mat4[2]; + var a03 = this.mat4[3]; + var a10 = this.mat4[4]; + var a11 = this.mat4[5]; + var a12 = this.mat4[6]; + var a13 = this.mat4[7]; + var a20 = this.mat4[8]; + var a21 = this.mat4[9]; + var a22 = this.mat4[10]; + var a23 = this.mat4[11]; + //sin,cos, and tan of respective angle + var sA = Math.sin(a); + var cA = Math.cos(a); + var tA = 1 - cA; + // Construct the elements of the rotation matrix + var b00 = x * x * tA + cA; + var b01 = y * x * tA + z * sA; + var b02 = z * x * tA - y * sA; + var b10 = x * y * tA - z * sA; + var b11 = y * y * tA + cA; + var b12 = z * y * tA + x * sA; + var b20 = x * z * tA + y * sA; + var b21 = y * z * tA - x * sA; + var b22 = z * z * tA + cA; + // rotation-specific matrix multiplication + this.mat4[0] = a00 * b00 + a10 * b01 + a20 * b02; + this.mat4[1] = a01 * b00 + a11 * b01 + a21 * b02; + this.mat4[2] = a02 * b00 + a12 * b01 + a22 * b02; + this.mat4[3] = a03 * b00 + a13 * b01 + a23 * b02; + this.mat4[4] = a00 * b10 + a10 * b11 + a20 * b12; + this.mat4[5] = a01 * b10 + a11 * b11 + a21 * b12; + this.mat4[6] = a02 * b10 + a12 * b11 + a22 * b12; + this.mat4[7] = a03 * b10 + a13 * b11 + a23 * b12; + this.mat4[8] = a00 * b20 + a10 * b21 + a20 * b22; + this.mat4[9] = a01 * b20 + a11 * b21 + a21 * b22; + this.mat4[10] = a02 * b20 + a12 * b21 + a22 * b22; + this.mat4[11] = a03 * b20 + a13 * b21 + a23 * b22; + return this; + } /** + * @todo finish implementing this method! + * translates + * @method translate + * @param {Number[]} v vector to translate by + * @chainable + */, + }, + { + key: "translate", + value: function translate(v) { + var x = v[0], + y = v[1], + z = v[2] || 0; + this.mat4[12] += + this.mat4[0] * x + this.mat4[4] * y + this.mat4[8] * z; + this.mat4[13] += + this.mat4[1] * x + this.mat4[5] * y + this.mat4[9] * z; + this.mat4[14] += + this.mat4[2] * x + this.mat4[6] * y + this.mat4[10] * z; + this.mat4[15] += + this.mat4[3] * x + this.mat4[7] * y + this.mat4[11] * z; + }, + }, + { + key: "rotateX", + value: function rotateX(a) { + this.rotate(a, 1, 0, 0); + }, + }, + { + key: "rotateY", + value: function rotateY(a) { + this.rotate(a, 0, 1, 0); + }, + }, + { + key: "rotateZ", + value: function rotateZ(a) { + this.rotate(a, 0, 0, 1); + } /** + * sets the perspective matrix + * @method perspective + * @param {Number} fovy [description] + * @param {Number} aspect [description] + * @param {Number} near near clipping plane + * @param {Number} far far clipping plane + * @chainable + */, + }, + { + key: "perspective", + value: function perspective(fovy, aspect, near, far) { + var f = 1 / Math.tan(fovy / 2), + nf = 1 / (near - far); + this.mat4[0] = f / aspect; + this.mat4[1] = 0; + this.mat4[2] = 0; + this.mat4[3] = 0; + this.mat4[4] = 0; + this.mat4[5] = f; + this.mat4[6] = 0; + this.mat4[7] = 0; + this.mat4[8] = 0; + this.mat4[9] = 0; + this.mat4[10] = (far + near) * nf; + this.mat4[11] = -1; + this.mat4[12] = 0; + this.mat4[13] = 0; + this.mat4[14] = 2 * far * near * nf; + this.mat4[15] = 0; + return this; + } /** + * sets the ortho matrix + * @method ortho + * @param {Number} left [description] + * @param {Number} right [description] + * @param {Number} bottom [description] + * @param {Number} top [description] + * @param {Number} near near clipping plane + * @param {Number} far far clipping plane + * @chainable + */, + }, + { + key: "ortho", + value: function ortho(left, right, bottom, top, near, far) { + var lr = 1 / (left - right), + bt = 1 / (bottom - top), + nf = 1 / (near - far); + this.mat4[0] = -2 * lr; + this.mat4[1] = 0; + this.mat4[2] = 0; + this.mat4[3] = 0; + this.mat4[4] = 0; + this.mat4[5] = -2 * bt; + this.mat4[6] = 0; + this.mat4[7] = 0; + this.mat4[8] = 0; + this.mat4[9] = 0; + this.mat4[10] = 2 * nf; + this.mat4[11] = 0; + this.mat4[12] = (left + right) * lr; + this.mat4[13] = (top + bottom) * bt; + this.mat4[14] = (far + near) * nf; + this.mat4[15] = 1; + return this; + } /** + * apply a matrix to a vector with x,y,z,w components + * get the results in the form of an array + * @method multiplyVec4 + * @param {Number} + * @return {Number[]} + */, + }, + { + key: "multiplyVec4", + value: function multiplyVec4(x, y, z, w) { + var result = new Array(4); + var m = this.mat4; + result[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + result[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + result[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + result[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return result; + } /** + * Applies a matrix to a vector. + * The fourth component is set to 1. + * Returns a vector consisting of the first + * through third components of the result. + * + * @method multiplyPoint + * @param {p5.Vector} + * @return {p5.Vector} + */, + }, + { + key: "multiplyPoint", + value: function multiplyPoint(_ref4) { + var x = _ref4.x, + y = _ref4.y, + z = _ref4.z; + var array = this.multiplyVec4(x, y, z, 1); + return new _main.default.Vector( + array[0], + array[1], + array[2], + ); + } /** + * Applies a matrix to a vector. + * The fourth component is set to 1. + * Returns the result of dividing the 1st to 3rd components + * of the result by the 4th component as a vector. + * + * @method multiplyAndNormalizePoint + * @param {p5.Vector} + * @return {p5.Vector} + */, + }, + { + key: "multiplyAndNormalizePoint", + value: function multiplyAndNormalizePoint(_ref5) { + var x = _ref5.x, + y = _ref5.y, + z = _ref5.z; + var array = this.multiplyVec4(x, y, z, 1); + array[0] /= array[3]; + array[1] /= array[3]; + array[2] /= array[3]; + return new _main.default.Vector( + array[0], + array[1], + array[2], + ); + } /** + * Applies a matrix to a vector. + * The fourth component is set to 0. + * Returns a vector consisting of the first + * through third components of the result. + * + * @method multiplyDirection + * @param {p5.Vector} + * @return {p5.Vector} + */, + }, + { + key: "multiplyDirection", + value: function multiplyDirection(_ref6) { + var x = _ref6.x, + y = _ref6.y, + z = _ref6.z; + var array = this.multiplyVec4(x, y, z, 0); + return new _main.default.Vector( + array[0], + array[1], + array[2], + ); + } /** + * This function is only for 3x3 matrices. + * multiply two mat3s. It is an operation to multiply the 3x3 matrix of + * the argument from the right. Arguments can be a 3x3 p5.Matrix, + * a Float32Array of length 9, or a javascript array of length 9. + * In addition, it can also be done by enumerating 9 numbers. + * + * @method mult3x3 + * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix + * we want to multiply by + * @chainable + */, + }, + { + key: "mult3x3", + value: function mult3x3(multMatrix) { + var _src; + if (multMatrix === this || multMatrix === this.mat3) { + _src = this.copy().mat3; // only need to allocate in this rare case + } else if (multMatrix instanceof _main.default.Matrix) { + _src = multMatrix.mat3; + } else if (isMatrixArray(multMatrix)) { + _src = multMatrix; + } else if (arguments.length === 9) { + _src = arguments; + } else { + return; // nothing to do. + } // each row is used for the multiplier + + var b0 = this.mat3[0]; + var b1 = this.mat3[1]; + var b2 = this.mat3[2]; + this.mat3[0] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; + this.mat3[1] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; + this.mat3[2] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; + b0 = this.mat3[3]; + b1 = this.mat3[4]; + b2 = this.mat3[5]; + this.mat3[3] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; + this.mat3[4] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; + this.mat3[5] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; + b0 = this.mat3[6]; + b1 = this.mat3[7]; + b2 = this.mat3[8]; + this.mat3[6] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; + this.mat3[7] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; + this.mat3[8] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; + return this; + } /** + * This function is only for 3x3 matrices. + * A function that returns a column vector of a 3x3 matrix. + * + * @method column + * @param {Number} columnIndex matrix column number + * @return {p5.Vector} + */, + }, + { + key: "column", + value: function column(columnIndex) { + return new _main.default.Vector( + this.mat3[3 * columnIndex], + this.mat3[3 * columnIndex + 1], + this.mat3[3 * columnIndex + 2], + ); + } /** + * This function is only for 3x3 matrices. + * A function that returns a row vector of a 3x3 matrix. + * + * @method row + * @param {Number} rowIndex matrix row number + * @return {p5.Vector} + */, + }, + { + key: "row", + value: function row(rowIndex) { + return new _main.default.Vector( + this.mat3[rowIndex], + this.mat3[rowIndex + 3], + this.mat3[rowIndex + 6], + ); + } /** + * Returns the diagonal elements of the matrix in the form of an array. + * A 3x3 matrix will return an array of length 3. + * A 4x4 matrix will return an array of length 4. + * + * @method diagonal + * @return {Number[]} An array obtained by arranging the diagonal elements + * of the matrix in ascending order of index + */, + }, + { + key: "diagonal", + value: function diagonal() { + if (this.mat3 !== undefined) { + return [this.mat3[0], this.mat3[4], this.mat3[8]]; + } + return [ + this.mat4[0], + this.mat4[5], + this.mat4[10], + this.mat4[15], + ]; + } /** + * This function is only for 3x3 matrices. + * Takes a vector and returns the vector resulting from multiplying to + * that vector by this matrix from left. + * + * @method multiplyVec3 + * @param {p5.Vector} multVector the vector to which this matrix applies + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} + */, + }, + { + key: "multiplyVec3", + value: function multiplyVec3(multVector, target) { + if (target === undefined) { + target = multVector.copy(); + } + target.x = this.row(0).dot(multVector); + target.y = this.row(1).dot(multVector); + target.z = this.row(2).dot(multVector); + return target; + } /** + * This function is only for 4x4 matrices. + * Creates a 3x3 matrix whose entries are the top left 3x3 part and returns it. + * + * @method createSubMatrix3x3 + * @return {p5.Matrix} + */, + }, + { + key: "createSubMatrix3x3", + value: function createSubMatrix3x3() { + var result = new _main.default.Matrix("mat3"); + result.mat3[0] = this.mat4[0]; + result.mat3[1] = this.mat4[1]; + result.mat3[2] = this.mat4[2]; + result.mat3[3] = this.mat4[4]; + result.mat3[4] = this.mat4[5]; + result.mat3[5] = this.mat4[6]; + result.mat3[6] = this.mat4[8]; + result.mat3[7] = this.mat4[9]; + result.mat3[8] = this.mat4[10]; + return result; + } /** + * PRIVATE + */, + // matrix methods adapted from: + // https://developer.mozilla.org/en-US/docs/Web/WebGL/ + // gluPerspective + // + // function _makePerspective(fovy, aspect, znear, zfar){ + // const ymax = znear * Math.tan(fovy * Math.PI / 360.0); + // const ymin = -ymax; + // const xmin = ymin * aspect; + // const xmax = ymax * aspect; + // return _makeFrustum(xmin, xmax, ymin, ymax, znear, zfar); + // } + //// + //// glFrustum + //// + //function _makeFrustum(left, right, bottom, top, znear, zfar){ + // const X = 2*znear/(right-left); + // const Y = 2*znear/(top-bottom); + // const A = (right+left)/(right-left); + // const B = (top+bottom)/(top-bottom); + // const C = -(zfar+znear)/(zfar-znear); + // const D = -2*zfar*znear/(zfar-znear); + // const frustrumMatrix =[ + // X, 0, A, 0, + // 0, Y, B, 0, + // 0, 0, C, D, + // 0, 0, -1, 0 + //]; + //return frustrumMatrix; + // } + // function _setMVPMatrices(){ + ////an identity matrix + ////@TODO use the p5.Matrix class to abstract away our MV matrices and + ///other math + //const _mvMatrix = + //[ + // 1.0,0.0,0.0,0.0, + // 0.0,1.0,0.0,0.0, + // 0.0,0.0,1.0,0.0, + // 0.0,0.0,0.0,1.0 + //]; + }, + ], + [ + { + key: "identity", + value: function identity(pInst) { + return new _main.default.Matrix(pInst); + }, + }, + ], + ); + return _class; + })(); + var _default = _main.default.Matrix; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.float32-array": 229, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + }, + ], + 352: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.map"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + _main.default.RenderBuffer = /*#__PURE__*/ (function () { + function _class(size, src, dst, attr, renderer, map) { + _classCallCheck(this, _class); + this.size = size; // the number of FLOATs in each vertex + this.src = src; // the name of the model's source array + this.dst = dst; // the name of the geometry's buffer + this.attr = attr; // the name of the vertex attribute + this._renderer = renderer; + this.map = map; // optional, a transformation function to apply to src + } /** + * Enables and binds the buffers used by shader when the appropriate data exists in geometry. + * Must always be done prior to drawing geometry in WebGL. + * @param {p5.Geometry} geometry Geometry that is going to be drawn + * @param {p5.Shader} shader Active shader + * @private + */ + + _createClass(_class, [ + { + key: "_prepareBuffer", + value: function _prepareBuffer(geometry, shader) { + var attributes = shader.attributes; + var gl = this._renderer.GL; + var model; + if (geometry.model) { + model = geometry.model; + } else { + model = geometry; + } // loop through each of the buffer definitions + + var attr = attributes[this.attr]; + if (!attr) { + return; + } // check if the model has the appropriate source array + + var buffer = geometry[this.dst]; + var src = model[this.src]; + if (src.length > 0) { + // check if we need to create the GL buffer + var createBuffer = !buffer; + if (createBuffer) { + // create and remember the buffer + geometry[this.dst] = buffer = gl.createBuffer(); + } // bind the buffer + + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + // check if we need to fill the buffer with data + if (createBuffer || model.dirtyFlags[this.src] !== false) { + var map = this.map; + // get the values from the model, possibly transformed + var values = map ? map(src) : src; + // fill the buffer with the values + this._renderer._bindBuffer( + buffer, + gl.ARRAY_BUFFER, + values, + ); + // mark the model's source array as clean + model.dirtyFlags[this.src] = false; + } // enable the attribute + + shader.enableAttrib(attr, this.size); + } else { + var loc = attr.location; + if ( + loc === -1 || + !this._renderer.registerEnabled.has(loc) + ) { + return; + } // Disable register corresponding to unused attribute + + gl.disableVertexAttribArray(loc); + // Record register availability + this._renderer.registerEnabled.delete(loc); + } + }, + }, + ]); + return _class; + })(); + var _default = _main.default.RenderBuffer; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.map": 182, + }, + ], + 353: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.find-index"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.find-index"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.map"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + _dereq_("./p5.RenderBuffer"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * Welcome to RendererGL Immediate Mode. + * Immediate mode is used for drawing custom shapes + * from a set of vertices. Immediate Mode is activated + * when you call beginShape() & de-activated when you call endShape(). + * Immediate mode is a style of programming borrowed + * from OpenGL's (now-deprecated) immediate mode. + * It differs from p5.js' default, Retained Mode, which caches + * geometries and buffers on the CPU to reduce the number of webgl + * draw calls. Retained mode is more efficient & performative, + * however, Immediate Mode is useful for sketching quick + * geometric ideas. + */ + /** + * Begin shape drawing. This is a helpful way of generating + * custom shapes quickly. However in WEBGL mode, application + * performance will likely drop as a result of too many calls to + * beginShape() / endShape(). As a high performance alternative, + * please use p5.js geometry primitives. + * @private + * @method beginShape + * @param {Number} mode webgl primitives mode. beginShape supports the + * following modes: + * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, + * TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP, + * and TESS(WEBGL only) + * @chainable + */ + + _main.default.RendererGL.prototype.beginShape = function (mode) { + this.immediateMode.shapeMode = + mode !== undefined ? mode : constants.TESS; + this.immediateMode.geometry.reset(); + this.immediateMode.contourIndices = []; + return this; + }; + var immediateBufferStrides = { + vertices: 1, + vertexNormals: 1, + vertexColors: 4, + vertexStrokeColors: 4, + uvs: 2, + }; + _main.default.RendererGL.prototype.beginContour = function () { + if (this.immediateMode.shapeMode !== constants.TESS) { + throw new Error( + "WebGL mode can only use contours with beginShape(TESS).", + ); + } + this.immediateMode.contourIndices.push( + this.immediateMode.geometry.vertices.length, + ); + }; + /** + * adds a vertex to be drawn in a custom Shape. + * @private + * @method vertex + * @param {Number} x x-coordinate of vertex + * @param {Number} y y-coordinate of vertex + * @param {Number} z z-coordinate of vertex + * @chainable + * @TODO implement handling of p5.Vector args + */ + _main.default.RendererGL.prototype.vertex = function (x, y) { + // WebGL 1 doesn't support QUADS or QUAD_STRIP, so we duplicate data to turn + // QUADS into TRIANGLES and QUAD_STRIP into TRIANGLE_STRIP. (There is no extra + // work to convert QUAD_STRIP here, since the only difference is in how edges + // are rendered.) + if (this.immediateMode.shapeMode === constants.QUADS) { + // A finished quad turned into triangles should leave 6 vertices in the + // buffer: + // 0--3 0 3--5 + // | | --> | \ \ | + // 1--2 1--2 4 + // When vertex index 3 is being added, add the necessary duplicates. + if (this.immediateMode.geometry.vertices.length % 6 === 3) { + for (var key in immediateBufferStrides) { + var stride = immediateBufferStrides[key]; + var buffer = this.immediateMode.geometry[key]; + buffer.push.apply( + buffer, + _toConsumableArray( + buffer.slice( + buffer.length - 3 * stride, + buffer.length - 2 * stride, + ), + ).concat( + _toConsumableArray( + buffer.slice(buffer.length - stride, buffer.length), + ), + ), + ); + } + } + } + var z, u, v; + // default to (x, y) mode: all other arguments assumed to be 0. + z = u = v = 0; + if (arguments.length === 3) { + // (x, y, z) mode: (u, v) assumed to be 0. + z = arguments[2]; + } else if (arguments.length === 4) { + // (x, y, u, v) mode: z assumed to be 0. + u = arguments[2]; + v = arguments[3]; + } else if (arguments.length === 5) { + // (x, y, z, u, v) mode + z = arguments[2]; + u = arguments[3]; + v = arguments[4]; + } + var vert = new _main.default.Vector(x, y, z); + this.immediateMode.geometry.vertices.push(vert); + this.immediateMode.geometry.vertexNormals.push(this._currentNormal); + var vertexColor = this.curFillColor || [0.5, 0.5, 0.5, 1]; + this.immediateMode.geometry.vertexColors.push( + vertexColor[0], + vertexColor[1], + vertexColor[2], + vertexColor[3], + ); + var lineVertexColor = this.curStrokeColor || [0.5, 0.5, 0.5, 1]; + this.immediateMode.geometry.vertexStrokeColors.push( + lineVertexColor[0], + lineVertexColor[1], + lineVertexColor[2], + lineVertexColor[3], + ); + if ( + this.textureMode === constants.IMAGE && + !this.isProcessingVertices + ) { + if (this._tex !== null) { + if (this._tex.width > 0 && this._tex.height > 0) { + u /= this._tex.width; + v /= this._tex.height; + } + } else if ( + this.userFillShader !== undefined || + this.userStrokeShader !== undefined || + this.userPointShader !== undefined + ) { + // Do nothing if user-defined shaders are present + } else if (this._tex === null && arguments.length >= 4) { + // Only throw this warning if custom uv's have been provided + console.warn( + "You must first call texture() before using" + + " vertex() with image based u and v coordinates", + ); + } + } + this.immediateMode.geometry.uvs.push(u, v); + this.immediateMode._bezierVertex[0] = x; + this.immediateMode._bezierVertex[1] = y; + this.immediateMode._bezierVertex[2] = z; + this.immediateMode._quadraticVertex[0] = x; + this.immediateMode._quadraticVertex[1] = y; + this.immediateMode._quadraticVertex[2] = z; + return this; + }; + /** + * Sets the normal to use for subsequent vertices. + * @method vertexNormal + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @chainable + * + * @method vertexNormal + * @param {Vector} v + * @chainable + */ + _main.default.RendererGL.prototype.normal = function (xorv, y, z) { + if (xorv instanceof _main.default.Vector) { + this._currentNormal = xorv; + } else { + this._currentNormal = new _main.default.Vector(xorv, y, z); + } + return this; + }; + /** + * End shape drawing and render vertices to screen. + * @chainable + */ + _main.default.RendererGL.prototype.endShape = function ( + mode, + isCurve, + isBezier, + isQuadratic, + isContour, + shapeKind, + ) { + var count = + arguments.length > 6 && arguments[6] !== undefined + ? arguments[6] + : 1; + if (this.immediateMode.shapeMode === constants.POINTS) { + this._drawPoints( + this.immediateMode.geometry.vertices, + this.immediateMode.buffers.point, + ); + return this; + } // When we are drawing a shape then the shape mode is TESS, + // but in case of triangle we can skip the breaking into small triangle + // this can optimize performance by skipping the step of breaking it into triangles + + if ( + this.immediateMode.geometry.vertices.length === 3 && + this.immediateMode.shapeMode === constants.TESS + ) { + this.immediateMode.shapeMode === constants.TRIANGLES; + } + this.isProcessingVertices = true; + this._processVertices.apply(this, arguments); + this.isProcessingVertices = false; + // LINE_STRIP and LINES are not used for rendering, instead + // they only indicate a way to modify vertices during the _processVertices() step + if ( + this.immediateMode.shapeMode === constants.LINE_STRIP || + this.immediateMode.shapeMode === constants.LINES + ) { + this.immediateMode.shapeMode = constants.TRIANGLE_FAN; + } // WebGL doesn't support the QUADS and QUAD_STRIP modes, so we + // need to convert them to a supported format. In `vertex()`, we reformat + // the input data into the formats specified below. + + if (this.immediateMode.shapeMode === constants.QUADS) { + this.immediateMode.shapeMode = constants.TRIANGLES; + } else if (this.immediateMode.shapeMode === constants.QUAD_STRIP) { + this.immediateMode.shapeMode = constants.TRIANGLE_STRIP; + } + if (this._doFill) { + if ( + !this.geometryBuilder && + this.immediateMode.geometry.vertices.length >= 3 + ) { + this._drawImmediateFill(count); + } + } + if (this._doStroke) { + if ( + !this.geometryBuilder && + this.immediateMode.geometry.lineVertices.length >= 1 + ) { + this._drawImmediateStroke(); + } + } + if (this.geometryBuilder) { + this.geometryBuilder.addImmediate(); + } + this.isBezier = false; + this.isQuadratic = false; + this.isCurve = false; + this.immediateMode._bezierVertex.length = 0; + this.immediateMode._quadraticVertex.length = 0; + this.immediateMode._curveVertex.length = 0; + return this; + }; + /** + * Called from endShape(). This function calculates the stroke vertices for custom shapes and + * tesselates shapes when applicable. + * @private + * @param {Number} mode webgl primitives mode. beginShape supports the + * following modes: + * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, + * TRIANGLE_STRIP, TRIANGLE_FAN and TESS(WEBGL only) + */ + _main.default.RendererGL.prototype._processVertices = function ( + mode, + ) { + if (this.immediateMode.geometry.vertices.length === 0) return; + var calculateStroke = this._doStroke; + var shouldClose = mode === constants.CLOSE; + if (calculateStroke) { + this.immediateMode.geometry.edges = this._calculateEdges( + this.immediateMode.shapeMode, + this.immediateMode.geometry.vertices, + shouldClose, + ); + if (!this.geometryBuilder) { + this.immediateMode.geometry._edgesToVertices(); + } + } // For hollow shapes, user must set mode to TESS + + var convexShape = this.immediateMode.shapeMode === constants.TESS; + // If the shape has a contour, we have to re-triangulate to cut out the + // contour region + var hasContour = this.immediateMode.contourIndices.length > 0; + // We tesselate when drawing curves or convex shapes + var shouldTess = + this._doFill && + (this.isBezier || + this.isQuadratic || + this.isCurve || + convexShape || + hasContour) && + this.immediateMode.shapeMode !== constants.LINES; + if (shouldTess) { + this._tesselateShape(); + } + }; + /** + * Called from _processVertices(). This function calculates the stroke vertices for custom shapes and + * tesselates shapes when applicable. + * @private + * @returns {Array[Number]} indices for custom shape vertices indicating edges. + */ + _main.default.RendererGL.prototype._calculateEdges = function ( + shapeMode, + verts, + shouldClose, + ) { + var res = []; + var i = 0; + var contourIndices = this.immediateMode.contourIndices.slice(); + var contourStart = 0; + switch (shapeMode) { + case constants.TRIANGLE_STRIP: + for (i = 0; i < verts.length - 2; i++) { + res.push([i, i + 1]); + res.push([i, i + 2]); + } + res.push([i, i + 1]); + break; + case constants.TRIANGLE_FAN: + for (i = 1; i < verts.length - 1; i++) { + res.push([0, i]); + res.push([i, i + 1]); + } + res.push([0, verts.length - 1]); + break; + case constants.TRIANGLES: + for (i = 0; i < verts.length - 2; i = i + 3) { + res.push([i, i + 1]); + res.push([i + 1, i + 2]); + res.push([i + 2, i]); + } + break; + case constants.LINES: + for (i = 0; i < verts.length - 1; i = i + 2) { + res.push([i, i + 1]); + } + break; + case constants.QUADS: + // Quads have been broken up into two triangles by `vertex()`: + // 0 3--5 + // | \ \ | + // 1--2 4 + for (i = 0; i < verts.length - 5; i += 6) { + res.push([i, i + 1]); + res.push([i + 1, i + 2]); + res.push([i + 3, i + 5]); + res.push([i + 4, i + 5]); + } + break; + case constants.QUAD_STRIP: + // 0---2---4 + // | | | + // 1---3---5 + for (i = 0; i < verts.length - 2; i += 2) { + res.push([i, i + 1]); + res.push([i, i + 2]); + res.push([i + 1, i + 3]); + } + res.push([i, i + 1]); + break; + default: + // TODO: handle contours in other modes too + for (i = 0; i < verts.length; i++) { + // Handle breaks between contours + if (i + 1 < verts.length && i + 1 !== contourIndices[0]) { + res.push([i, i + 1]); + } else { + if (shouldClose || contourStart) { + res.push([i, contourStart]); + } + if (contourIndices.length > 0) { + contourStart = contourIndices.shift(); + } + } + } + break; + } + if (shapeMode !== constants.TESS && shouldClose) { + res.push([verts.length - 1, 0]); + } + return res; + }; + /** + * Called from _processVertices() when applicable. This function tesselates immediateMode.geometry. + * @private + */ + _main.default.RendererGL.prototype._tesselateShape = function () { + var _this = this; + // TODO: handle non-TESS shape modes that have contours + this.immediateMode.shapeMode = constants.TRIANGLES; + var contours = [[]]; + for ( + var i = 0; + i < this.immediateMode.geometry.vertices.length; + i++ + ) { + if ( + this.immediateMode.contourIndices.length > 0 && + this.immediateMode.contourIndices[0] === i + ) { + this.immediateMode.contourIndices.shift(); + contours.push([]); + } + contours[contours.length - 1].push( + this.immediateMode.geometry.vertices[i].x, + this.immediateMode.geometry.vertices[i].y, + this.immediateMode.geometry.vertices[i].z, + this.immediateMode.geometry.uvs[i * 2], + this.immediateMode.geometry.uvs[i * 2 + 1], + this.immediateMode.geometry.vertexColors[i * 4], + this.immediateMode.geometry.vertexColors[i * 4 + 1], + this.immediateMode.geometry.vertexColors[i * 4 + 2], + this.immediateMode.geometry.vertexColors[i * 4 + 3], + this.immediateMode.geometry.vertexNormals[i].x, + this.immediateMode.geometry.vertexNormals[i].y, + this.immediateMode.geometry.vertexNormals[i].z, + ); + } + var polyTriangles = this._triangulate(contours); + var originalVertices = this.immediateMode.geometry.vertices; + this.immediateMode.geometry.vertices = []; + this.immediateMode.geometry.vertexNormals = []; + this.immediateMode.geometry.uvs = []; + var colors = []; + for ( + var j = 0, polyTriLength = polyTriangles.length; + j < polyTriLength; + j = j + _main.default.RendererGL.prototype.tessyVertexSize + ) { + colors.push.apply( + colors, + _toConsumableArray(polyTriangles.slice(j + 5, j + 9)), + ); + this.normal.apply( + this, + _toConsumableArray(polyTriangles.slice(j + 9, j + 12)), + ); + this.vertex.apply( + this, + _toConsumableArray(polyTriangles.slice(j, j + 5)), + ); + } + if (this.geometryBuilder) { + // Tesselating the face causes the indices of edge vertices to stop being + // correct. When rendering, this is not a problem, since _edgesToVertices + // will have been called before this, and edge vertex indices are no longer + // needed. However, the geometry builder still needs this information, so + // when one is active, we need to update the indices. + // + // We record index mappings in a Map so that once we have found a + // corresponding vertex, we don't need to loop to find it again. + var newIndex = new Map(); + this.immediateMode.geometry.edges = + this.immediateMode.geometry.edges.map(function (edge) { + return edge.map(function (origIdx) { + if (!newIndex.has(origIdx)) { + var orig = originalVertices[origIdx]; + var newVertIndex = + _this.immediateMode.geometry.vertices.findIndex( + function (v) { + return ( + orig.x === v.x && orig.y === v.y && orig.z === v.z + ); + }, + ); + if (newVertIndex === -1) { + // The tesselation process didn't output a vertex with the exact + // coordinate as before, potentially due to numerical issues. This + // doesn't happen often, but in this case, pick the closest point + var closestDist = Infinity; + var closestIndex = 0; + for ( + var _i = 0; + _i < _this.immediateMode.geometry.vertices.length; + _i++ + ) { + var vert = _this.immediateMode.geometry.vertices[_i]; + var dX = orig.x - vert.x; + var dY = orig.y - vert.y; + var dZ = orig.z - vert.z; + var dist = dX * dX + dY * dY + dZ * dZ; + if (dist < closestDist) { + closestDist = dist; + closestIndex = _i; + } + } + newVertIndex = closestIndex; + } + newIndex.set(origIdx, newVertIndex); + } + return newIndex.get(origIdx); + }); + }); + } + this.immediateMode.geometry.vertexColors = colors; + }; + /** + * Called from endShape(). Responsible for calculating normals, setting shader uniforms, + * enabling all appropriate buffers, applying color blend, and drawing the fill geometry. + * @private + */ + _main.default.RendererGL.prototype._drawImmediateFill = function () { + var count = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : 1; + var gl = this.GL; + this._useVertexColor = + this.immediateMode.geometry.vertexColors.length > 0; + var shader; + shader = this._getImmediateFillShader(); + this._setFillUniforms(shader); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = + this.immediateMode.buffers.fill[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()).done); + _iteratorNormalCompletion = true + ) { + var buff = _step.value; + buff._prepareBuffer(this.immediateMode.geometry, shader); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + shader.disableRemainingAttributes(); + this._applyColorBlend(this.curFillColor); + if (count === 1) { + gl.drawArrays( + this.immediateMode.shapeMode, + 0, + this.immediateMode.geometry.vertices.length, + ); + } else { + try { + gl.drawArraysInstanced( + this.immediateMode.shapeMode, + 0, + this.immediateMode.geometry.vertices.length, + count, + ); + } catch (e) { + console.log( + "🌸 p5.js says: Instancing is only supported in WebGL2 mode", + ); + } + } + shader.unbindShader(); + }; + /** + * Called from endShape(). Responsible for calculating normals, setting shader uniforms, + * enabling all appropriate buffers, applying color blend, and drawing the stroke geometry. + * @private + */ + _main.default.RendererGL.prototype._drawImmediateStroke = + function () { + var gl = this.GL; + this._useLineColor = + this.immediateMode.geometry.vertexStrokeColors.length > 0; + var shader = this._getImmediateStrokeShader(); + this._setStrokeUniforms(shader); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = + this.immediateMode.buffers.stroke[Symbol.iterator](), + _step2; + !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) + .done); + _iteratorNormalCompletion2 = true + ) { + var buff = _step2.value; + buff._prepareBuffer(this.immediateMode.geometry, shader); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + shader.disableRemainingAttributes(); + this._applyColorBlend(this.curStrokeColor); + gl.drawArrays( + gl.TRIANGLES, + 0, + this.immediateMode.geometry.lineVertices.length / 3, + ); + shader.unbindShader(); + }; + var _default = _main.default.RendererGL; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.RenderBuffer": 352, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.find-index": 174, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.map": 182, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.map": 187, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 354: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.uint16-array"); + _dereq_("core-js/modules/es.typed-array.uint32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.uint16-array"); + _dereq_("core-js/modules/es.typed-array.uint32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + _dereq_("./p5.RendererGL"); + _dereq_("./p5.RenderBuffer"); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } //Retained Mode. The default mode for rendering 3D primitives + //in WEBGL. + /** + * @param {p5.Geometry} geometry The model whose resources will be freed + */ + + _main.default.RendererGL.prototype.freeGeometry = function ( + geometry, + ) { + if (!geometry.gid) { + console.warn( + "The model you passed to freeGeometry does not have an id!", + ); + return; + } + this._freeBuffers(geometry.gid); + }; + /** + * _initBufferDefaults + * @private + * @description initializes buffer defaults. runs each time a new geometry is + * registered + * @param {String} gId key of the geometry object + * @returns {Object} a new buffer object + */ + _main.default.RendererGL.prototype._initBufferDefaults = function ( + gId, + ) { + this._freeBuffers(gId); + //@TODO remove this limit on hashes in retainedMode.geometry + if (Object.keys(this.retainedMode.geometry).length > 1000) { + var key = Object.keys(this.retainedMode.geometry)[0]; + this._freeBuffers(key); + } //create a new entry in our retainedMode.geometry + + return (this.retainedMode.geometry[gId] = {}); + }; + _main.default.RendererGL.prototype._freeBuffers = function (gId) { + var buffers = this.retainedMode.geometry[gId]; + if (!buffers) { + return; + } + delete this.retainedMode.geometry[gId]; + var gl = this.GL; + if (buffers.indexBuffer) { + gl.deleteBuffer(buffers.indexBuffer); + } + function freeBuffers(defs) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = defs[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var def = _step.value; + if (buffers[def.dst]) { + gl.deleteBuffer(buffers[def.dst]); + buffers[def.dst] = null; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } // free all the buffers + + freeBuffers(this.retainedMode.buffers.stroke); + freeBuffers(this.retainedMode.buffers.fill); + }; + /** + * creates a buffers object that holds the WebGL render buffers + * for a geometry. + * @private + * @param {String} gId key of the geometry object + * @param {p5.Geometry} model contains geometry data + */ + _main.default.RendererGL.prototype.createBuffers = function ( + gId, + model, + ) { + var gl = this.GL; + //initialize the gl buffers for our geom groups + var buffers = this._initBufferDefaults(gId); + buffers.model = model; + var indexBuffer = buffers.indexBuffer; + if (model.faces.length) { + // allocate space for faces + if (!indexBuffer) + indexBuffer = buffers.indexBuffer = gl.createBuffer(); + var vals = _main.default.RendererGL.prototype._flatten( + model.faces, + ); + // If any face references a vertex with an index greater than the maximum + // un-singed 16 bit integer, then we need to use a Uint32Array instead of a + // Uint16Array + var hasVertexIndicesOverMaxUInt16 = vals.some(function (v) { + return v > 65535; + }); + var type = hasVertexIndicesOverMaxUInt16 + ? Uint32Array + : Uint16Array; + this._bindBuffer( + indexBuffer, + gl.ELEMENT_ARRAY_BUFFER, + vals, + type, + ); + // If we're using a Uint32Array for our indexBuffer we will need to pass a + // different enum value to WebGL draw triangles. This happens in + // the _drawElements function. + buffers.indexBufferType = hasVertexIndicesOverMaxUInt16 + ? gl.UNSIGNED_INT + : gl.UNSIGNED_SHORT; + // the vertex count is based on the number of faces + buffers.vertexCount = model.faces.length * 3; + } else { + // the index buffer is unused, remove it + if (indexBuffer) { + gl.deleteBuffer(indexBuffer); + buffers.indexBuffer = null; + } // the vertex count comes directly from the model + + buffers.vertexCount = model.vertices ? model.vertices.length : 0; + } + buffers.lineVertexCount = model.lineVertices + ? model.lineVertices.length / 3 + : 0; + return buffers; + }; + /** + * Draws buffers given a geometry key ID + * @private + * @param {String} gId ID in our geom hash + * @chainable + */ + _main.default.RendererGL.prototype.drawBuffers = function (gId) { + var gl = this.GL; + var geometry = this.retainedMode.geometry[gId]; + if ( + !this.geometryBuilder && + this._doFill && + this.retainedMode.geometry[gId].vertexCount > 0 + ) { + this._useVertexColor = geometry.model.vertexColors.length > 0; + var fillShader = this._getRetainedFillShader(); + this._setFillUniforms(fillShader); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = + this.retainedMode.buffers.fill[Symbol.iterator](), + _step2; + !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) + .done); + _iteratorNormalCompletion2 = true + ) { + var buff = _step2.value; + buff._prepareBuffer(geometry, fillShader); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + fillShader.disableRemainingAttributes(); + if (geometry.indexBuffer) { + //vertex index buffer + this._bindBuffer(geometry.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); + } + this._applyColorBlend(this.curFillColor); + this._drawElements(gl.TRIANGLES, gId); + fillShader.unbindShader(); + } + if ( + !this.geometryBuilder && + this._doStroke && + geometry.lineVertexCount > 0 + ) { + this._useLineColor = geometry.model.vertexStrokeColors.length > 0; + var strokeShader = this._getRetainedStrokeShader(); + this._setStrokeUniforms(strokeShader); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = + this.retainedMode.buffers.stroke[Symbol.iterator](), + _step3; + !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) + .done); + _iteratorNormalCompletion3 = true + ) { + var _buff = _step3.value; + _buff._prepareBuffer(geometry, strokeShader); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion3 && + _iterator3.return != null + ) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + strokeShader.disableRemainingAttributes(); + this._applyColorBlend(this.curStrokeColor); + this._drawArrays(gl.TRIANGLES, gId); + strokeShader.unbindShader(); + } + if (this.geometryBuilder) { + this.geometryBuilder.addRetained(geometry); + } + return this; + }; + /** + * Calls drawBuffers() with a scaled model/view matrix. + * + * This is used by various 3d primitive methods (in primitives.js, eg. plane, + * box, torus, etc...) to allow caching of un-scaled geometries. Those + * geometries are generally created with unit-length dimensions, cached as + * such, and then scaled appropriately in this method prior to rendering. + * + * @private + * @method drawBuffersScaled + * @param {String} gId ID in our geom hash + * @param {Number} scaleX the amount to scale in the X direction + * @param {Number} scaleY the amount to scale in the Y direction + * @param {Number} scaleZ the amount to scale in the Z direction + */ + _main.default.RendererGL.prototype.drawBuffersScaled = function ( + gId, + scaleX, + scaleY, + scaleZ, + ) { + var uMVMatrix = this.uMVMatrix.copy(); + try { + this.uMVMatrix.scale(scaleX, scaleY, scaleZ); + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + }; + _main.default.RendererGL.prototype._drawArrays = function ( + drawMode, + gId, + ) { + this.GL.drawArrays( + drawMode, + 0, + this.retainedMode.geometry[gId].lineVertexCount, + ); + return this; + }; + _main.default.RendererGL.prototype._drawElements = function ( + drawMode, + gId, + ) { + var buffers = this.retainedMode.geometry[gId]; + var gl = this.GL; + // render the fill + if (buffers.indexBuffer) { + // If this model is using a Uint32Array we need to ensure the + // OES_element_index_uint WebGL extension is enabled. + if ( + this._pInst.webglVersion !== constants.WEBGL2 && + buffers.indexBufferType === gl.UNSIGNED_INT + ) { + if (!gl.getExtension("OES_element_index_uint")) { + throw new Error( + "Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.", + ); + } + } // we're drawing faces + + gl.drawElements( + gl.TRIANGLES, + buffers.vertexCount, + buffers.indexBufferType, + 0, + ); + } else { + // drawing vertices + gl.drawArrays(drawMode || gl.TRIANGLES, 0, buffers.vertexCount); + } + }; + _main.default.RendererGL.prototype._drawPoints = function ( + vertices, + vertexBuffer, + ) { + var gl = this.GL; + var pointShader = this._getImmediatePointShader(); + this._setPointUniforms(pointShader); + this._bindBuffer( + vertexBuffer, + gl.ARRAY_BUFFER, + this._vToNArray(vertices), + Float32Array, + gl.STATIC_DRAW, + ); + pointShader.enableAttrib(pointShader.attributes.aPosition, 3); + this._applyColorBlend(this.curStrokeColor); + gl.drawArrays(gl.Points, 0, vertices.length); + pointShader.unbindShader(); + }; + var _default = _main.default.RendererGL; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.RenderBuffer": 352, + "./p5.RendererGL": 355, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.some": 184, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.float32-array": 229, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint16-array": 250, + "core-js/modules/es.typed-array.uint32-array": 251, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 355: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.copy-within"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.reflect.get"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.float64-array"); + _dereq_("core-js/modules/es.typed-array.int16-array"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint16-array"); + _dereq_("core-js/modules/es.typed-array.uint32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.concat"); + _dereq_("core-js/modules/es.array.copy-within"); + _dereq_("core-js/modules/es.array.every"); + _dereq_("core-js/modules/es.array.fill"); + _dereq_("core-js/modules/es.array.from"); + _dereq_("core-js/modules/es.array.includes"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.map"); + _dereq_("core-js/modules/es.object.assign"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.set"); + _dereq_("core-js/modules/es.string.includes"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.float32-array"); + _dereq_("core-js/modules/es.typed-array.float64-array"); + _dereq_("core-js/modules/es.typed-array.int16-array"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.uint16-array"); + _dereq_("core-js/modules/es.typed-array.uint32-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.readPixelsWebGL = readPixelsWebGL; + exports.readPixelWebGL = readPixelWebGL; + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + var _GeometryBuilder = _interopRequireDefault( + _dereq_("./GeometryBuilder"), + ); + var _libtess = _interopRequireDefault(_dereq_("libtess")); + _dereq_("./p5.Shader"); + _dereq_("./p5.Camera"); + _dereq_("../core/p5.Renderer"); + _dereq_("./p5.Matrix"); + _dereq_("./p5.Framebuffer"); + var _path = _dereq_("path"); + var _p6 = _dereq_("./p5.Texture"); + var _filterShaderFrags; + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _toConsumableArray(arr) { + return ( + _arrayWithoutHoles(arr) || + _iterableToArray(arr) || + _nonIterableSpread() + ); + } + function _nonIterableSpread() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for ( + var i = 0, arr2 = new Array(arr.length); + i < arr.length; + i++ + ) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return _get(target, property, receiver || target); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + return object; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true, + }); + } else { + obj[key] = value; + } + return obj; + } + var STROKE_CAP_ENUM = {}; + var STROKE_JOIN_ENUM = {}; + var lineDefs = ""; + var defineStrokeCapEnum = function defineStrokeCapEnum(key, val) { + lineDefs += "#define STROKE_CAP_" + .concat(key, " ") + .concat(val, "\n"); + STROKE_CAP_ENUM[constants[key]] = val; + }; + var defineStrokeJoinEnum = function defineStrokeJoinEnum(key, val) { + lineDefs += "#define STROKE_JOIN_" + .concat(key, " ") + .concat(val, "\n"); + STROKE_JOIN_ENUM[constants[key]] = val; + }; + // Define constants in line shaders for each type of cap/join, and also record + // the values in JS objects + defineStrokeCapEnum("ROUND", 0); + defineStrokeCapEnum("PROJECT", 1); + defineStrokeCapEnum("SQUARE", 2); + defineStrokeJoinEnum("ROUND", 0); + defineStrokeJoinEnum("MITER", 1); + defineStrokeJoinEnum("BEVEL", 2); + var lightingShader = + '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'; + var webgl2CompatibilityShader = + "#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n"; + var defaultShaders = { + immediateVert: + "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n", + vertexColorVert: + "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n", + vertexColorFrag: + "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", + normalVert: + "IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", + normalFrag: + "IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n", + basicFrag: + "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", + lightVert: + lightingShader + + "// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", + lightTextureFrag: + "uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n", + phongVert: + "precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", + phongFrag: + lightingShader + + "// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n", + fontVert: + "IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n", + fontFrag: + "#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of 't' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n", + lineVert: + lineDefs + + "/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n", + lineFrag: + lineDefs + + "precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", + pointVert: + "IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n", + pointFrag: + "precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n", + imageLightVert: + "precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n", + imageLightDiffusedFrag: + "precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}", + imageLightSpecularFrag: + "precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n", + }; + for (var key in defaultShaders) { + defaultShaders[key] = + webgl2CompatibilityShader + defaultShaders[key]; + } + var filterShaderFrags = + ((_filterShaderFrags = {}), + _defineProperty( + _filterShaderFrags, + constants.GRAY, + "precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.ERODE, + "// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.DILATE, + "// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.BLUR, + "precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.POSTERIZE, + "// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.OPAQUE, + "// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.INVERT, + "// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n", + ), + _defineProperty( + _filterShaderFrags, + constants.THRESHOLD, + "// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n", + ), + _filterShaderFrags); + var filterShaderVert = + "uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n"; + /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + /** + * Set attributes for the WebGL Drawing context. + * This is a way of adjusting how the WebGL + * renderer works to fine-tune the display and performance. + * + * Note that this will reinitialize the drawing context + * if called after the WebGL canvas is made. + * + * If an object is passed as the parameter, all attributes + * not declared in the object will be set to defaults. + * + * The available attributes are: + *
                    + * alpha - indicates if the canvas contains an alpha buffer + * default is true + * + * depth - indicates whether the drawing buffer has a depth buffer + * of at least 16 bits - default is true + * + * stencil - indicates whether the drawing buffer has a stencil buffer + * of at least 8 bits + * + * antialias - indicates whether or not to perform anti-aliasing + * default is false (true in Safari) + * + * premultipliedAlpha - indicates that the page compositor will assume + * the drawing buffer contains colors with pre-multiplied alpha + * default is true + * + * preserveDrawingBuffer - if true the buffers will not be cleared and + * and will preserve their values until cleared or overwritten by author + * (note that p5 clears automatically on draw loop) + * default is true + * + * perPixelLighting - if true, per-pixel lighting will be used in the + * lighting shader otherwise per-vertex lighting is used. + * default is true. + * + * version - either 1 or 2, to specify which WebGL version to ask for. By + * default, WebGL 2 will be requested. If WebGL2 is not available, it will + * fall back to WebGL 1. You can check what version is used with by looking at + * the global `webglVersion` property. + * + * @method setAttributes + * @for p5 + * @param {String} key Name of attribute + * @param {Boolean} value New value of named attribute + * @example + *
                    + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(255); + * push(); + * rotateZ(frameCount * 0.02); + * rotateX(frameCount * 0.02); + * rotateY(frameCount * 0.02); + * fill(0, 0, 0); + * box(50); + * pop(); + * } + * + *
                    + *
                    + * Now with the antialias attribute set to true. + *
                    + *
                    + * + * function setup() { + * setAttributes('antialias', true); + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(255); + * push(); + * rotateZ(frameCount * 0.02); + * rotateX(frameCount * 0.02); + * rotateY(frameCount * 0.02); + * fill(0, 0, 0); + * box(50); + * pop(); + * } + * + *
                    + * + *
                    + * + * // press the mouse button to disable perPixelLighting + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * fill(255); + * } + * + * let lights = [ + * { c: '#f00', t: 1.12, p: 1.91, r: 0.2 }, + * { c: '#0f0', t: 1.21, p: 1.31, r: 0.2 }, + * { c: '#00f', t: 1.37, p: 1.57, r: 0.2 }, + * { c: '#ff0', t: 1.12, p: 1.91, r: 0.7 }, + * { c: '#0ff', t: 1.21, p: 1.31, r: 0.7 }, + * { c: '#f0f', t: 1.37, p: 1.57, r: 0.7 } + * ]; + * + * function draw() { + * let t = millis() / 1000 + 1000; + * background(0); + * directionalLight(color('#222'), 1, 1, 1); + * + * for (let i = 0; i < lights.length; i++) { + * let light = lights[i]; + * pointLight( + * color(light.c), + * p5.Vector.fromAngles(t * light.t, t * light.p, width * light.r) + * ); + * } + * + * specularMaterial(255); + * sphere(width * 0.1); + * + * rotateX(t * 0.77); + * rotateY(t * 0.83); + * rotateZ(t * 0.91); + * torus(width * 0.3, width * 0.07, 24, 10); + * } + * + * function mousePressed() { + * setAttributes('perPixelLighting', false); + * noStroke(); + * fill(255); + * } + * function mouseReleased() { + * setAttributes('perPixelLighting', true); + * noStroke(); + * fill(255); + * } + * + *
                    + * + * @alt a rotating cube with smoother edges + */ + /** + * @method setAttributes + * @for p5 + * @param {Object} obj object with key-value pairs + */ + _main.default.prototype.setAttributes = function (key, value) { + if (typeof this._glAttributes === "undefined") { + console.log( + "You are trying to use setAttributes on a p5.Graphics object " + + "that does not use a WEBGL renderer.", + ); + return; + } + var unchanged = true; + if (typeof value !== "undefined") { + //first time modifying the attributes + if (this._glAttributes === null) { + this._glAttributes = {}; + } + if (this._glAttributes[key] !== value) { + //changing value of previously altered attribute + this._glAttributes[key] = value; + unchanged = false; + } //setting all attributes with some change + } else if (key instanceof Object) { + if (this._glAttributes !== key) { + this._glAttributes = key; + unchanged = false; + } + } //@todo_FES + + if (!this._renderer.isP3D || unchanged) { + return; + } + if (!this._setupDone) { + for (var x in this._renderer.retainedMode.geometry) { + if (this._renderer.retainedMode.geometry.hasOwnProperty(x)) { + _main.default._friendlyError( + "Sorry, Could not set the attributes, you need to call setAttributes() " + + "before calling the other drawing methods in setup()", + ); + return; + } + } + } + this.push(); + this._renderer._resetContext(); + this.pop(); + if (this._renderer._curCamera) { + this._renderer._curCamera._renderer = this._renderer; + } + }; + /** + * @private + * @param {Uint8Array|Float32Array|undefined} pixels An existing pixels array to reuse if the size is the same + * @param {WebGLRenderingContext} gl The WebGL context + * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read + * @param {Number} x The x coordiante to read, premultiplied by pixel density + * @param {Number} y The y coordiante to read, premultiplied by pixel density + * @param {Number} width The width in pixels to be read (factoring in pixel density) + * @param {Number} height The height in pixels to be read (factoring in pixel density) + * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read + * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT + * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about + * @returns {Uint8Array|Float32Array} pixels A pixels array with the current state of the + * WebGL context read into it + */ + function readPixelsWebGL( + pixels, + gl, + framebuffer, + x, + y, + width, + height, + format, + type, + flipY, + ) { + // Record the currently bound framebuffer so we can go back to it after, and + // bind the framebuffer we want to read from + var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + var channels = format === gl.RGBA ? 4 : 3; + // Make a pixels buffer if it doesn't already exist + var len = width * height * channels; + var TypedArrayClass = + type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; + if (!(pixels instanceof TypedArrayClass) || pixels.length !== len) { + pixels = new TypedArrayClass(len); + } + gl.readPixels( + x, + flipY ? flipY - y - height : y, + width, + height, + format, + type, + pixels, + ); + // Re-bind whatever was previously bound + gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); + if (flipY) { + // WebGL pixels are inverted compared to 2D pixels, so we have to flip + // the resulting rows. Adapted from https://stackoverflow.com/a/41973289 + var halfHeight = Math.floor(height / 2); + var tmpRow = new TypedArrayClass(width * channels); + for (var _y = 0; _y < halfHeight; _y++) { + var topOffset = _y * width * 4; + var bottomOffset = (height - _y - 1) * width * 4; + tmpRow.set(pixels.subarray(topOffset, topOffset + width * 4)); + pixels.copyWithin( + topOffset, + bottomOffset, + bottomOffset + width * 4, + ); + pixels.set(tmpRow, bottomOffset); + } + } + return pixels; + } /** + * @private + * @param {WebGLRenderingContext} gl The WebGL context + * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read + * @param {Number} x The x coordinate to read, premultiplied by pixel density + * @param {Number} y The y coordinate to read, premultiplied by pixel density + * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read + * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT + * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about + * @returns {Number[]} pixels The channel data for the pixel at that location + */ + + function readPixelWebGL(gl, framebuffer, x, y, format, type, flipY) { + // Record the currently bound framebuffer so we can go back to it after, and + // bind the framebuffer we want to read from + var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + var channels = format === gl.RGBA ? 4 : 3; + var TypedArrayClass = + type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; + var pixels = new TypedArrayClass(channels); + gl.readPixels( + x, + flipY ? flipY - y - 1 : y, + 1, + 1, + format, + type, + pixels, + ); + // Re-bind whatever was previously bound + gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); + return Array.from(pixels); + } /** + * 3D graphics class + * @private + * @class p5.RendererGL + * @constructor + * @extends p5.Renderer + * @todo extend class to include public method for offscreen + * rendering (FBO). + */ + + _main.default.RendererGL = /*#__PURE__*/ (function (_p5$Renderer) { + _inherits(RendererGL, _p5$Renderer); + var _super = _createSuper(RendererGL); + function RendererGL(elt, pInst, isMainCanvas, attr) { + var _this; + _classCallCheck(this, RendererGL); + _this = _super.call(this, elt, pInst, isMainCanvas); + _this._setAttributeDefaults(pInst); + _this._initContext(); + _this.isP3D = true; //lets us know we're in 3d mode + // When constructing a new p5.Geometry, this will represent the builder + _this.geometryBuilder = undefined; + // This redundant property is useful in reminding you that you are + // interacting with WebGLRenderingContext, still worth considering future removal + _this.GL = _this.drawingContext; + _this._pInst._setProperty("drawingContext", _this.drawingContext); + // erasing + _this._isErasing = false; + // clipping + _this._clipDepths = []; + _this._isClipApplied = false; + _this._stencilTestOn = false; + // lights + _this._enableLighting = false; + _this.ambientLightColors = []; + _this.specularColors = [1, 1, 1]; + _this.directionalLightDirections = []; + _this.directionalLightDiffuseColors = []; + _this.directionalLightSpecularColors = []; + _this.pointLightPositions = []; + _this.pointLightDiffuseColors = []; + _this.pointLightSpecularColors = []; + _this.spotLightPositions = []; + _this.spotLightDirections = []; + _this.spotLightDiffuseColors = []; + _this.spotLightSpecularColors = []; + _this.spotLightAngle = []; + _this.spotLightConc = []; + // This property contains the input image if imageLight function + // is called. + // activeImageLight is checked by _setFillUniforms + // for sending uniforms to the fillshader + _this.activeImageLight = null; + // If activeImageLight property is Null, diffusedTextures, + // specularTextures are Empty. + // Else, it maps a p5.Image used by imageLight() to a p5.Graphics. + // p5.Graphics for this are calculated in getDiffusedTexture function + _this.diffusedTextures = new Map(); + // p5.Graphics for this are calculated in getSpecularTexture function + _this.specularTextures = new Map(); + _this.drawMode = constants.FILL; + _this.curFillColor = _this._cachedFillStyle = [1, 1, 1, 1]; + _this.curAmbientColor = _this._cachedFillStyle = [1, 1, 1, 1]; + _this.curSpecularColor = _this._cachedFillStyle = [0, 0, 0, 0]; + _this.curEmissiveColor = _this._cachedFillStyle = [0, 0, 0, 0]; + _this.curStrokeColor = _this._cachedStrokeStyle = [0, 0, 0, 1]; + _this.curBlendMode = constants.BLEND; + _this._cachedBlendMode = undefined; + if (_this.webglVersion === constants.WEBGL2) { + _this.blendExt = _this.GL; + } else { + _this.blendExt = _this.GL.getExtension("EXT_blend_minmax"); + } + _this._isBlending = false; + _this._hasSetAmbient = false; + _this._useSpecularMaterial = false; + _this._useEmissiveMaterial = false; + _this._useNormalMaterial = false; + _this._useShininess = 1; + _this._useLineColor = false; + _this._useVertexColor = false; + _this.registerEnabled = new Set(); + _this._tint = [255, 255, 255, 255]; + // lightFalloff variables + _this.constantAttenuation = 1; + _this.linearAttenuation = 0; + _this.quadraticAttenuation = 0; + /** + * model view, projection, & normal + * matrices + */ + _this.uMVMatrix = new _main.default.Matrix(); + _this.uPMatrix = new _main.default.Matrix(); + _this.uNMatrix = new _main.default.Matrix("mat3"); + // Current vertex normal + _this._currentNormal = new _main.default.Vector(0, 0, 1); + // Camera + _this._curCamera = new _main.default.Camera( + _assertThisInitialized(_this), + ); + _this._curCamera._computeCameraDefaultSettings(); + _this._curCamera._setDefaultCamera(); + // FilterCamera + _this.filterCamera = new _main.default.Camera( + _assertThisInitialized(_this), + ); + _this.filterCamera._computeCameraDefaultSettings(); + _this.filterCamera._setDefaultCamera(); + // Information about the previous frame's touch object + // for executing orbitControl() + _this.prevTouches = []; + // Velocity variable for use with orbitControl() + _this.zoomVelocity = 0; + _this.rotateVelocity = new _main.default.Vector(0, 0); + _this.moveVelocity = new _main.default.Vector(0, 0); + // Flags for recording the state of zooming, rotation and moving + _this.executeZoom = false; + _this.executeRotateAndMove = false; + _this._defaultLightShader = undefined; + _this._defaultImmediateModeShader = undefined; + _this._defaultNormalShader = undefined; + _this._defaultColorShader = undefined; + _this._defaultPointShader = undefined; + _this.userFillShader = undefined; + _this.userStrokeShader = undefined; + _this.userPointShader = undefined; + // Default drawing is done in Retained Mode + // Geometry and Material hashes stored here + _this.retainedMode = { + geometry: {}, + buffers: { + stroke: [ + new _main.default.RenderBuffer( + 4, + "lineVertexColors", + "lineColorBuffer", + "aVertexColor", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "lineVertices", + "lineVerticesBuffer", + "aPosition", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "lineTangentsIn", + "lineTangentsInBuffer", + "aTangentIn", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "lineTangentsOut", + "lineTangentsOutBuffer", + "aTangentOut", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 1, + "lineSides", + "lineSidesBuffer", + "aSide", + _assertThisInitialized(_this), + ), + ], + fill: [ + new _main.default.RenderBuffer( + 3, + "vertices", + "vertexBuffer", + "aPosition", + _assertThisInitialized(_this), + _this._vToNArray, + ), + new _main.default.RenderBuffer( + 3, + "vertexNormals", + "normalBuffer", + "aNormal", + _assertThisInitialized(_this), + _this._vToNArray, + ), + new _main.default.RenderBuffer( + 4, + "vertexColors", + "colorBuffer", + "aVertexColor", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "vertexAmbients", + "ambientBuffer", + "aAmbientColor", + _assertThisInitialized(_this), + ), + //new BufferDef(3, 'vertexSpeculars', 'specularBuffer', 'aSpecularColor'), + new _main.default.RenderBuffer( + 2, + "uvs", + "uvBuffer", + "aTexCoord", + _assertThisInitialized(_this), + _this._flatten, + ), + ], + text: [ + new _main.default.RenderBuffer( + 3, + "vertices", + "vertexBuffer", + "aPosition", + _assertThisInitialized(_this), + _this._vToNArray, + ), + new _main.default.RenderBuffer( + 2, + "uvs", + "uvBuffer", + "aTexCoord", + _assertThisInitialized(_this), + _this._flatten, + ), + ], + }, + }; + // Immediate Mode + // Geometry and Material hashes stored here + _this.immediateMode = { + geometry: new _main.default.Geometry(), + shapeMode: constants.TRIANGLE_FAN, + contourIndices: [], + _bezierVertex: [], + _quadraticVertex: [], + _curveVertex: [], + buffers: { + fill: [ + new _main.default.RenderBuffer( + 3, + "vertices", + "vertexBuffer", + "aPosition", + _assertThisInitialized(_this), + _this._vToNArray, + ), + new _main.default.RenderBuffer( + 3, + "vertexNormals", + "normalBuffer", + "aNormal", + _assertThisInitialized(_this), + _this._vToNArray, + ), + new _main.default.RenderBuffer( + 4, + "vertexColors", + "colorBuffer", + "aVertexColor", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "vertexAmbients", + "ambientBuffer", + "aAmbientColor", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 2, + "uvs", + "uvBuffer", + "aTexCoord", + _assertThisInitialized(_this), + _this._flatten, + ), + ], + stroke: [ + new _main.default.RenderBuffer( + 4, + "lineVertexColors", + "lineColorBuffer", + "aVertexColor", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "lineVertices", + "lineVerticesBuffer", + "aPosition", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "lineTangentsIn", + "lineTangentsInBuffer", + "aTangentIn", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 3, + "lineTangentsOut", + "lineTangentsOutBuffer", + "aTangentOut", + _assertThisInitialized(_this), + ), + new _main.default.RenderBuffer( + 1, + "lineSides", + "lineSidesBuffer", + "aSide", + _assertThisInitialized(_this), + ), + ], + point: _this.GL.createBuffer(), + }, + }; + _this.pointSize = 5; //default point size + _this.curStrokeWeight = 1; + _this.curStrokeCap = constants.ROUND; + _this.curStrokeJoin = constants.ROUND; + // map of texture sources to textures created in this gl context via this.getTexture(src) + _this.textures = new Map(); + // set of framebuffers in use + _this.framebuffers = new Set(); + // stack of active framebuffers + _this.activeFramebuffers = []; + // for post processing step + _this.filterShader = undefined; + _this.filterLayer = undefined; + _this.filterLayerTemp = undefined; + _this.defaultFilterShaders = {}; + _this.textureMode = constants.IMAGE; + // default wrap settings + _this.textureWrapX = constants.CLAMP; + _this.textureWrapY = constants.CLAMP; + _this._tex = null; + _this._curveTightness = 6; + // lookUpTable for coefficients needed to be calculated for bezierVertex, same are used for curveVertex + _this._lookUpTableBezier = []; + // lookUpTable for coefficients needed to be calculated for quadraticVertex + _this._lookUpTableQuadratic = []; + // current curveDetail in the Bezier lookUpTable + _this._lutBezierDetail = 0; + // current curveDetail in the Quadratic lookUpTable + _this._lutQuadraticDetail = 0; + // Used to distinguish between user calls to vertex() and internal calls + _this.isProcessingVertices = false; + _this._tessy = _this._initTessy(); + _this.fontInfos = {}; + _this._curShader = undefined; + return _this; + } /** + * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added + * to the geometry and then returned when + * endGeometry() is called. One can also use + * buildGeometry() to pass a function that + * draws shapes. + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them upfront with `beginGeometry()` and `endGeometry()` and then + * drawing that will run faster than repeatedly drawing the individual pieces. + * + * @method beginGeometry + */ + + _createClass(RendererGL, [ + { + key: "beginGeometry", + value: function beginGeometry() { + if (this.geometryBuilder) { + throw new Error( + "It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.", + ); + } + this.geometryBuilder = new _GeometryBuilder.default(this); + } /** + * Finishes creating a new p5.Geometry that was + * started using beginGeometry(). One can also + * use buildGeometry() to pass a function that + * draws shapes. + * + * @method endGeometry + * @returns {p5.Geometry} The model that was built. + */, + }, + { + key: "endGeometry", + value: function endGeometry() { + if (!this.geometryBuilder) { + throw new Error( + "Make sure you call beginGeometry() before endGeometry()!", + ); + } + var geometry = this.geometryBuilder.finish(); + this.geometryBuilder = undefined; + return geometry; + } /** + * Creates a new p5.Geometry that contains all + * the shapes drawn in a provided callback function. The returned combined shape + * can then be drawn all at once using model(). + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them with `buildGeometry()` once and then drawing that will run + * faster than repeatedly drawing the individual pieces. + * + * One can also draw shapes directly between + * beginGeometry() and + * endGeometry() instead of using a callback + * function. + * + * @method buildGeometry + * @param {Function} callback A function that draws shapes. + * @returns {p5.Geometry} The model that was built from the callback function. + */, + }, + { + key: "buildGeometry", + value: function buildGeometry(callback) { + this.beginGeometry(); + callback(); + return this.endGeometry(); + }, ////////////////////////////////////////////// + // Setting + ////////////////////////////////////////////// + }, + { + key: "_setAttributeDefaults", + value: function _setAttributeDefaults(pInst) { + // See issue #3850, safer to enable AA in Safari + var applyAA = navigator.userAgent + .toLowerCase() + .includes("safari"); + var defaults = { + alpha: true, + depth: true, + stencil: true, + antialias: applyAA, + premultipliedAlpha: true, + preserveDrawingBuffer: true, + perPixelLighting: true, + version: 2, + }; + if (pInst._glAttributes === null) { + pInst._glAttributes = defaults; + } else { + pInst._glAttributes = Object.assign( + defaults, + pInst._glAttributes, + ); + } + return; + }, + }, + { + key: "_initContext", + value: function _initContext() { + if (this._pInst._glAttributes.version !== 1) { + // Unless WebGL1 is explicitly asked for, try to create a WebGL2 context + this.drawingContext = this.canvas.getContext( + "webgl2", + this._pInst._glAttributes, + ); + } + this.webglVersion = this.drawingContext + ? constants.WEBGL2 + : constants.WEBGL; + // If this is the main canvas, make sure the global `webglVersion` is set + this._pInst._setProperty("webglVersion", this.webglVersion); + if (!this.drawingContext) { + // If we were unable to create a WebGL2 context (either because it was + // disabled via `setAttributes({ version: 1 })` or because the device + // doesn't support it), fall back to a WebGL1 context + this.drawingContext = + this.canvas.getContext( + "webgl", + this._pInst._glAttributes, + ) || + this.canvas.getContext( + "experimental-webgl", + this._pInst._glAttributes, + ); + } + if (this.drawingContext === null) { + throw new Error("Error creating webgl context"); + } else { + var gl = this.drawingContext; + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LEQUAL); + gl.viewport( + 0, + 0, + gl.drawingBufferWidth, + gl.drawingBufferHeight, + ); + // Make sure all images are loaded into the canvas premultiplied so that + // they match the way we render colors. This will make framebuffer textures + // be encoded the same way as textures from everything else. + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); + this._viewport = this.drawingContext.getParameter( + this.drawingContext.VIEWPORT, + ); + } + }, //This is helper function to reset the context anytime the attributes + //are changed with setAttributes() + }, + { + key: "_resetContext", + value: function _resetContext(options, callback) { + var w = this.width; + var h = this.height; + var defaultId = this.canvas.id; + var isPGraphics = + this._pInst instanceof _main.default.Graphics; + if (isPGraphics) { + var pg = this._pInst; + pg.canvas.parentNode.removeChild(pg.canvas); + pg.canvas = document.createElement("canvas"); + var node = pg._pInst._userNode || document.body; + node.appendChild(pg.canvas); + _main.default.Element.call(pg, pg.canvas, pg._pInst); + pg.width = w; + pg.height = h; + } else { + var c = this.canvas; + if (c) { + c.parentNode.removeChild(c); + } + c = document.createElement("canvas"); + c.id = defaultId; + if (this._pInst._userNode) { + this._pInst._userNode.appendChild(c); + } else { + document.body.appendChild(c); + } + this._pInst.canvas = c; + this.canvas = c; + } + var renderer = new _main.default.RendererGL( + this._pInst.canvas, + this._pInst, + !isPGraphics, + ); + this._pInst._setProperty("_renderer", renderer); + renderer.resize(w, h); + renderer._applyDefaults(); + if (!isPGraphics) { + this._pInst._elements.push(renderer); + } + if (typeof callback === "function") { + //setTimeout with 0 forces the task to the back of the queue, this ensures that + //we finish switching out the renderer + setTimeout(function () { + callback.apply(window._renderer, options); + }, 0); + } + } /** + * @class p5.RendererGL + */, + }, + { + key: "_update", + value: function _update() { + // reset model view and apply initial camera transform + // (containing only look at info; no projection). + this.uMVMatrix.set( + this._curCamera.cameraMatrix.mat4[0], + this._curCamera.cameraMatrix.mat4[1], + this._curCamera.cameraMatrix.mat4[2], + this._curCamera.cameraMatrix.mat4[3], + this._curCamera.cameraMatrix.mat4[4], + this._curCamera.cameraMatrix.mat4[5], + this._curCamera.cameraMatrix.mat4[6], + this._curCamera.cameraMatrix.mat4[7], + this._curCamera.cameraMatrix.mat4[8], + this._curCamera.cameraMatrix.mat4[9], + this._curCamera.cameraMatrix.mat4[10], + this._curCamera.cameraMatrix.mat4[11], + this._curCamera.cameraMatrix.mat4[12], + this._curCamera.cameraMatrix.mat4[13], + this._curCamera.cameraMatrix.mat4[14], + this._curCamera.cameraMatrix.mat4[15], + ); + // reset light data for new frame. + this.ambientLightColors.length = 0; + this.specularColors = [1, 1, 1]; + this.directionalLightDirections.length = 0; + this.directionalLightDiffuseColors.length = 0; + this.directionalLightSpecularColors.length = 0; + this.pointLightPositions.length = 0; + this.pointLightDiffuseColors.length = 0; + this.pointLightSpecularColors.length = 0; + this.spotLightPositions.length = 0; + this.spotLightDirections.length = 0; + this.spotLightDiffuseColors.length = 0; + this.spotLightSpecularColors.length = 0; + this.spotLightAngle.length = 0; + this.spotLightConc.length = 0; + this._enableLighting = false; + //reset tint value for new frame + this._tint = [255, 255, 255, 255]; + //Clear depth every frame + this.GL.clearStencil(0); + this.GL.clear( + this.GL.DEPTH_BUFFER_BIT | this.GL.STENCIL_BUFFER_BIT, + ); + this.GL.disable(this.GL.STENCIL_TEST); + } /** + * [background description] + */, + }, + { + key: "background", + value: function background() { + var _this$_pInst; + var _col = (_this$_pInst = this._pInst).color.apply( + _this$_pInst, + arguments, + ); + var _r = _col.levels[0] / 255; + var _g = _col.levels[1] / 255; + var _b = _col.levels[2] / 255; + var _a = _col.levels[3] / 255; + this.clear(_r, _g, _b, _a); + }, ////////////////////////////////////////////// + // COLOR + ////////////////////////////////////////////// + /** + * Basic fill material for geometry with a given color + * @method fill + * @class p5.RendererGL + * @param {Number|Number[]|String|p5.Color} v1 gray value, + * red or hue value (depending on the current color mode), + * or color Array, or CSS color string + * @param {Number} [v2] green or saturation value + * @param {Number} [v3] blue or brightness value + * @param {Number} [a] opacity + * @chainable + * @example + *
                    + * + * function setup() { + * createCanvas(200, 200, WEBGL); + * } + * + * function draw() { + * background(0); + * noStroke(); + * fill(100, 100, 240); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(75, 75, 75); + * } + * + *
                    + * + * @alt + * black canvas with purple cube spinning + */ + }, + { + key: "fill", + value: function fill(v1, v2, v3, a) { + //see material.js for more info on color blending in webgl + var color = _main.default.prototype.color.apply( + this._pInst, + arguments, + ); + this.curFillColor = color._array; + this.drawMode = constants.FILL; + this._useNormalMaterial = false; + this._tex = null; + } /** + * Basic stroke material for geometry with a given color + * @method stroke + * @param {Number|Number[]|String|p5.Color} v1 gray value, + * red or hue value (depending on the current color mode), + * or color Array, or CSS color string + * @param {Number} [v2] green or saturation value + * @param {Number} [v3] blue or brightness value + * @param {Number} [a] opacity + * @example + *
                    + * + * function setup() { + * createCanvas(200, 200, WEBGL); + * } + * + * function draw() { + * background(0); + * stroke(240, 150, 150); + * fill(100, 100, 240); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(75, 75, 75); + * } + * + *
                    + * + * @alt + * black canvas with purple cube with pink outline spinning + */, + }, + { + key: "stroke", + value: function stroke(r, g, b, a) { + var color = _main.default.prototype.color.apply( + this._pInst, + arguments, + ); + this.curStrokeColor = color._array; + }, + }, + { + key: "strokeCap", + value: function strokeCap(cap) { + this.curStrokeCap = cap; + }, + }, + { + key: "strokeJoin", + value: function strokeJoin(join) { + this.curStrokeJoin = join; + }, + }, + { + key: "getFilterLayer", + value: function getFilterLayer() { + if (!this.filterLayer) { + this.filterLayer = this._pInst.createFramebuffer(); + } + return this.filterLayer; + }, + }, + { + key: "getFilterLayerTemp", + value: function getFilterLayerTemp() { + if (!this.filterLayerTemp) { + this.filterLayerTemp = this._pInst.createFramebuffer(); + } + return this.filterLayerTemp; + }, + }, + { + key: "matchSize", + value: function matchSize(fboToMatch, target) { + if ( + fboToMatch.width !== target.width || + fboToMatch.height !== target.height + ) { + fboToMatch.resize(target.width, target.height); + } + if (fboToMatch.pixelDensity() !== target.pixelDensity()) { + fboToMatch.pixelDensity(target.pixelDensity()); + } + }, + }, + { + key: "filter", + value: function filter() { + var _this2 = this; + var fbo = this.getFilterLayer(); + // use internal shader for filter constants BLUR, INVERT, etc + var filterParameter = undefined; + var operation = undefined; + if ( + typeof (arguments.length <= 0 + ? undefined + : arguments[0]) === "string" + ) { + var _defaults; + operation = + arguments.length <= 0 ? undefined : arguments[0]; + var defaults = + ((_defaults = {}), + _defineProperty(_defaults, constants.BLUR, 3), + _defineProperty(_defaults, constants.POSTERIZE, 4), + _defineProperty(_defaults, constants.THRESHOLD, 0.5), + _defaults); + var useDefaultParam = + operation in defaults && + (arguments.length <= 1 ? undefined : arguments[1]) === + undefined; + filterParameter = useDefaultParam + ? defaults[operation] + : arguments.length <= 1 + ? undefined + : arguments[1]; + // Create and store shader for constants once on initial filter call. + // Need to store multiple in case user calls different filters, + // eg. filter(BLUR) then filter(GRAY) + if (!(operation in this.defaultFilterShaders)) { + this.defaultFilterShaders[operation] = + new _main.default.Shader( + fbo._renderer, + filterShaderVert, + filterShaderFrags[operation], + ); + } + this.filterShader = this.defaultFilterShaders[operation]; + } // use custom user-supplied shader + else { + this.filterShader = + arguments.length <= 0 ? undefined : arguments[0]; + } // Setting the target to the framebuffer when applying a filter to a framebuffer. + + var target = this.activeFramebuffer() || this; + // Resize the framebuffer 'fbo' and adjust its pixel density if it doesn't match the target. + this.matchSize(fbo, target); + // Set filterCamera for framebuffers. + if (target !== this) { + this.filterCamera = this.getFilterLayer().createCamera(); + } + fbo.draw(function () { + return _this2._pInst.clear(); + }); // prevent undesirable feedback effects accumulating secretly. + var texelSize = [ + 1 / (target.width * target.pixelDensity()), + 1 / (target.height * target.pixelDensity()), + ]; + // apply blur shader with multiple passes. + if (operation === constants.BLUR) { + // Treating 'tmp' as a framebuffer. + var tmp = this.getFilterLayerTemp(); + // Resize the framebuffer 'tmp' and adjust its pixel density if it doesn't match the target. + this.matchSize(tmp, target); + // setup + this._pInst.push(); + this._pInst.noStroke(); + // draw main to temp buffer + this._pInst.shader(this.filterShader); + this.filterShader.setUniform("texelSize", texelSize); + this.filterShader.setUniform("canvasSize", [ + target.width, + target.height, + ]); + this.filterShader.setUniform( + "radius", + Math.max(1, filterParameter), + ); + // Horiz pass: draw `target` to `tmp` + tmp.draw(function () { + _this2.filterShader.setUniform("direction", [1, 0]); + _this2.filterShader.setUniform("tex0", target); + _this2._pInst.clear(); + _this2._pInst.shader(_this2.filterShader); + _this2._pInst.rect( + -target.width / 2, + -target.height / 2, + target.width, + target.height, + ); + }); + // Vert pass: draw `tmp` to `fbo` + fbo.draw(function () { + _this2.filterShader.setUniform("direction", [0, 1]); + _this2.filterShader.setUniform("tex0", tmp); + _this2._pInst.clear(); + _this2._pInst.shader(_this2.filterShader); + _this2._pInst.rect( + -target.width / 2, + -target.height / 2, + target.width, + target.height, + ); + }); + this._pInst.pop(); + } // every other non-blur shader uses single pass + else { + fbo.draw(function () { + _this2._pInst.noStroke(); + _this2._pInst.shader(_this2.filterShader); + _this2.filterShader.setUniform("tex0", target); + _this2.filterShader.setUniform("texelSize", texelSize); + _this2.filterShader.setUniform("canvasSize", [ + target.width, + target.height, + ]); + // filterParameter uniform only used for POSTERIZE, and THRESHOLD + // but shouldn't hurt to always set + _this2.filterShader.setUniform( + "filterParameter", + filterParameter, + ); + _this2._pInst.rect( + -target.width / 2, + -target.height / 2, + target.width, + target.height, + ); + }); + } // draw fbo contents onto main renderer. + + this._pInst.push(); + this._pInst.noStroke(); + this.clear(); + this._pInst.push(); + this._pInst.imageMode(constants.CORNER); + this._pInst.blendMode(constants.BLEND); + this.filterCamera._resize(); + this._pInst.setCamera(this.filterCamera); + this._pInst.resetMatrix(); + this._pInst.image( + fbo, + -this.width / 2, + -this.height / 2, + this.width, + this.height, + ); + this._pInst.pop(); + this._pInst.pop(); + }, // Pass this off to the host instance so that we can treat a renderer and a + // framebuffer the same in filter() + }, + { + key: "pixelDensity", + value: function pixelDensity(newDensity) { + if (newDensity) { + return this._pInst.pixelDensity(newDensity); + } + return this._pInst.pixelDensity(); + }, + }, + { + key: "blendMode", + value: function blendMode(mode) { + if ( + mode === constants.DARKEST || + mode === constants.LIGHTEST || + mode === constants.ADD || + mode === constants.BLEND || + mode === constants.SUBTRACT || + mode === constants.SCREEN || + mode === constants.EXCLUSION || + mode === constants.REPLACE || + mode === constants.MULTIPLY || + mode === constants.REMOVE + ) + this.curBlendMode = mode; + else if ( + mode === constants.BURN || + mode === constants.OVERLAY || + mode === constants.HARD_LIGHT || + mode === constants.SOFT_LIGHT || + mode === constants.DODGE + ) { + console.warn( + "BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.", + ); + } + }, + }, + { + key: "erase", + value: function erase(opacityFill, opacityStroke) { + if (!this._isErasing) { + this._cachedBlendMode = this.curBlendMode; + this._isErasing = true; + this.blendMode(constants.REMOVE); + this._cachedFillStyle = this.curFillColor.slice(); + this.curFillColor = [1, 1, 1, opacityFill / 255]; + this._cachedStrokeStyle = this.curStrokeColor.slice(); + this.curStrokeColor = [1, 1, 1, opacityStroke / 255]; + } + }, + }, + { + key: "noErase", + value: function noErase() { + if (this._isErasing) { + this.curFillColor = this._cachedFillStyle.slice(); + this.curStrokeColor = this._cachedStrokeStyle.slice(); + // It's necessary to restore post-erase state. Needs rework + var temp = this.curBlendMode; + this.blendMode(this._cachedBlendMode); + this._cachedBlendMode = temp; // If we don't do this, applyBlendMode() returns null + this._isErasing = false; + this._applyBlendMode(); // This sets _cachedBlendMode back to the original blendmode + } + }, + }, + { + key: "drawTarget", + value: function drawTarget() { + return ( + this.activeFramebuffers[ + this.activeFramebuffers.length - 1 + ] || this + ); + }, + }, + { + key: "beginClip", + value: function beginClip() { + var options = + arguments.length > 0 && arguments[0] !== undefined + ? arguments[0] + : {}; + _get( + _getPrototypeOf(RendererGL.prototype), + "beginClip", + this, + ).call(this, options); + this.drawTarget()._isClipApplied = true; + var gl = this.GL; + gl.clearStencil(0); + gl.clear(gl.STENCIL_BUFFER_BIT); + gl.enable(gl.STENCIL_TEST); + this._stencilTestOn = true; + gl.stencilFunc( + gl.ALWAYS, // the test + 1, // reference value + 255, // mask + ); + gl.stencilOp( + gl.KEEP, // what to do if the stencil test fails + gl.KEEP, // what to do if the depth test fails + gl.REPLACE, // what to do if both tests pass + ); + gl.disable(gl.DEPTH_TEST); + this._pInst.push(); + this._pInst.resetShader(); + if (this._doFill) this._pInst.fill(0, 0); + if (this._doStroke) this._pInst.stroke(0, 0); + }, + }, + { + key: "endClip", + value: function endClip() { + this._pInst.pop(); + var gl = this.GL; + gl.stencilOp( + gl.KEEP, // what to do if the stencil test fails + gl.KEEP, // what to do if the depth test fails + gl.KEEP, // what to do if both tests pass + ); + gl.stencilFunc( + this._clipInvert ? gl.EQUAL : gl.NOTEQUAL, // the test + 0, // reference value + 255, // mask + ); + gl.enable(gl.DEPTH_TEST); + // Mark the depth at which the clip has been applied so that we can clear it + // when we pop past this depth + this._clipDepths.push(this._pushPopDepth); + _get( + _getPrototypeOf(RendererGL.prototype), + "endClip", + this, + ).call(this); + }, + }, + { + key: "_clearClip", + value: function _clearClip() { + this.GL.clearStencil(1); + this.GL.clear(this.GL.STENCIL_BUFFER_BIT); + if (this._clipDepths.length > 0) { + this._clipDepths.pop(); + } + this.drawTarget()._isClipApplied = false; + } /** + * Change weight of stroke + * @method strokeWeight + * @param {Number} stroke weight to be used for drawing + * @example + *
                    + * + * function setup() { + * createCanvas(200, 400, WEBGL); + * setAttributes('antialias', true); + * } + * + * function draw() { + * background(0); + * noStroke(); + * translate(0, -100, 0); + * stroke(240, 150, 150); + * fill(100, 100, 240); + * push(); + * strokeWeight(8); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * sphere(75); + * pop(); + * push(); + * translate(0, 200, 0); + * strokeWeight(1); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * sphere(75); + * pop(); + * } + * + *
                    + * + * @alt + * black canvas with two purple rotating spheres with pink + * outlines the sphere on top has much heavier outlines, + */, + }, + { + key: "strokeWeight", + value: function strokeWeight(w) { + if (this.curStrokeWeight !== w) { + this.pointSize = w; + this.curStrokeWeight = w; + } + }, // x,y are canvas-relative (pre-scaled by _pixelDensity) + }, + { + key: "_getPixel", + value: function _getPixel(x, y) { + var gl = this.GL; + return readPixelWebGL( + gl, + null, + x, + y, + gl.RGBA, + gl.UNSIGNED_BYTE, + this._pInst.height * this._pInst.pixelDensity(), + ); + } /** + * Loads the pixels data for this canvas into the pixels[] attribute. + * Note that updatePixels() and set() do not work. + * Any pixel manipulation must be done directly to the pixels[] array. + * + * @private + * @method loadPixels + */, + }, + { + key: "loadPixels", + value: function loadPixels() { + var pixelsState = this._pixelsState; + //@todo_FES + if ( + this._pInst._glAttributes.preserveDrawingBuffer !== true + ) { + console.log( + "loadPixels only works in WebGL when preserveDrawingBuffer " + + "is true.", + ); + return; + } + var pd = this._pInst._pixelDensity; + var gl = this.GL; + pixelsState._setProperty( + "pixels", + readPixelsWebGL( + pixelsState.pixels, + gl, + null, + 0, + 0, + this.width * pd, + this.height * pd, + gl.RGBA, + gl.UNSIGNED_BYTE, + this.height * pd, + ), + ); + }, + }, + { + key: "updatePixels", + value: function updatePixels() { + var fbo = this._getTempFramebuffer(); + fbo.pixels = this._pixelsState.pixels; + fbo.updatePixels(); + this._pInst.push(); + this._pInst.resetMatrix(); + this._pInst.clear(); + this._pInst.imageMode(constants.CENTER); + this._pInst.image(fbo, 0, 0); + this._pInst.pop(); + this.GL.clearDepth(1); + this.GL.clear(this.GL.DEPTH_BUFFER_BIT); + } /** + * @private + * @returns {p5.Framebuffer} A p5.Framebuffer set to match the size and settings + * of the renderer's canvas. It will be created if it does not yet exist, and + * reused if it does. + */, + }, + { + key: "_getTempFramebuffer", + value: function _getTempFramebuffer() { + if (!this._tempFramebuffer) { + this._tempFramebuffer = this._pInst.createFramebuffer({ + format: constants.UNSIGNED_BYTE, + useDepth: this._pInst._glAttributes.depth, + depthFormat: constants.UNSIGNED_INT, + antialias: this._pInst._glAttributes.antialias, + }); + } + return this._tempFramebuffer; + }, ////////////////////////////////////////////// + // HASH | for geometry + ////////////////////////////////////////////// + }, + { + key: "geometryInHash", + value: function geometryInHash(gId) { + return this.retainedMode.geometry[gId] !== undefined; + }, + }, + { + key: "viewport", + value: function viewport(w, h) { + this._viewport = [0, 0, w, h]; + this.GL.viewport(0, 0, w, h); + } /** + * [resize description] + * @private + * @param {Number} w [description] + * @param {Number} h [description] + */, + }, + { + key: "resize", + value: function resize(w, h) { + _main.default.Renderer.prototype.resize.call(this, w, h); + this._origViewport = { + width: this.GL.drawingBufferWidth, + height: this.GL.drawingBufferHeight, + }; + this.viewport( + this._origViewport.width, + this._origViewport.height, + ); + this._curCamera._resize(); + //resize pixels buffer + var pixelsState = this._pixelsState; + if (typeof pixelsState.pixels !== "undefined") { + pixelsState._setProperty( + "pixels", + new Uint8Array( + this.GL.drawingBufferWidth * + this.GL.drawingBufferHeight * + 4, + ), + ); + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = this.framebuffers[Symbol.iterator](), + _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var framebuffer = _step.value; + // Notify framebuffers of the resize so that any auto-sized framebuffers + // can also update their size + framebuffer._canvasSizeChanged(); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } /** + * clears color and depth buffers + * with r,g,b,a + * @private + * @param {Number} r normalized red val. + * @param {Number} g normalized green val. + * @param {Number} b normalized blue val. + * @param {Number} a normalized alpha val. + */, + }, + { + key: "clear", + value: function clear() { + var _r = + (arguments.length <= 0 ? undefined : arguments[0]) || 0; + var _g = + (arguments.length <= 1 ? undefined : arguments[1]) || 0; + var _b = + (arguments.length <= 2 ? undefined : arguments[2]) || 0; + var _a = + (arguments.length <= 3 ? undefined : arguments[3]) || 0; + var activeFramebuffer = this.activeFramebuffer(); + if ( + activeFramebuffer && + activeFramebuffer.format === constants.UNSIGNED_BYTE && + !activeFramebuffer.antialias && + _a === 0 + ) { + // Drivers on Intel Macs check for 0,0,0,0 exactly when drawing to a + // framebuffer and ignore the command if it's the only drawing command to + // the framebuffer. To work around it, we can set the alpha to a value so + // low that it still rounds down to 0, but that circumvents the buggy + // check in the driver. + _a = 1e-10; + } + this.GL.clearColor(_r * _a, _g * _a, _b * _a, _a); + this.GL.clearDepth(1); + this.GL.clear( + this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT, + ); + }, + }, + { + key: "applyMatrix", + value: function applyMatrix(a, b, c, d, e, f) { + if (arguments.length === 16) { + _main.default.Matrix.prototype.apply.apply( + this.uMVMatrix, + arguments, + ); + } else { + this.uMVMatrix.apply([ + a, + b, + 0, + 0, + c, + d, + 0, + 0, + 0, + 0, + 1, + 0, + e, + f, + 0, + 1, + ]); + } + } /** + * [translate description] + * @private + * @param {Number} x [description] + * @param {Number} y [description] + * @param {Number} z [description] + * @chainable + * @todo implement handle for components or vector as args + */, + }, + { + key: "translate", + value: function translate(x, y, z) { + if (x instanceof _main.default.Vector) { + z = x.z; + y = x.y; + x = x.x; + } + this.uMVMatrix.translate([x, y, z]); + return this; + } /** + * Scales the Model View Matrix by a vector + * @private + * @param {Number | p5.Vector | Array} x [description] + * @param {Number} [y] y-axis scalar + * @param {Number} [z] z-axis scalar + * @chainable + */, + }, + { + key: "scale", + value: function scale(x, y, z) { + this.uMVMatrix.scale(x, y, z); + return this; + }, + }, + { + key: "rotate", + value: function rotate(rad, axis) { + if (typeof axis === "undefined") { + return this.rotateZ(rad); + } + _main.default.Matrix.prototype.rotate.apply( + this.uMVMatrix, + arguments, + ); + return this; + }, + }, + { + key: "rotateX", + value: function rotateX(rad) { + this.rotate(rad, 1, 0, 0); + return this; + }, + }, + { + key: "rotateY", + value: function rotateY(rad) { + this.rotate(rad, 0, 1, 0); + return this; + }, + }, + { + key: "rotateZ", + value: function rotateZ(rad) { + this.rotate(rad, 0, 0, 1); + return this; + }, + }, + { + key: "push", + value: function push() { + // get the base renderer style + var style = _main.default.Renderer.prototype.push.apply(this); + // add webgl-specific style properties + var properties = style.properties; + properties.uMVMatrix = this.uMVMatrix.copy(); + properties.uPMatrix = this.uPMatrix.copy(); + properties._curCamera = this._curCamera; + // make a copy of the current camera for the push state + // this preserves any references stored using 'createCamera' + this._curCamera = this._curCamera.copy(); + properties.ambientLightColors = + this.ambientLightColors.slice(); + properties.specularColors = this.specularColors.slice(); + properties.directionalLightDirections = + this.directionalLightDirections.slice(); + properties.directionalLightDiffuseColors = + this.directionalLightDiffuseColors.slice(); + properties.directionalLightSpecularColors = + this.directionalLightSpecularColors.slice(); + properties.pointLightPositions = + this.pointLightPositions.slice(); + properties.pointLightDiffuseColors = + this.pointLightDiffuseColors.slice(); + properties.pointLightSpecularColors = + this.pointLightSpecularColors.slice(); + properties.spotLightPositions = + this.spotLightPositions.slice(); + properties.spotLightDirections = + this.spotLightDirections.slice(); + properties.spotLightDiffuseColors = + this.spotLightDiffuseColors.slice(); + properties.spotLightSpecularColors = + this.spotLightSpecularColors.slice(); + properties.spotLightAngle = this.spotLightAngle.slice(); + properties.spotLightConc = this.spotLightConc.slice(); + properties.userFillShader = this.userFillShader; + properties.userStrokeShader = this.userStrokeShader; + properties.userPointShader = this.userPointShader; + properties.pointSize = this.pointSize; + properties.curStrokeWeight = this.curStrokeWeight; + properties.curStrokeColor = this.curStrokeColor; + properties.curFillColor = this.curFillColor; + properties.curAmbientColor = this.curAmbientColor; + properties.curSpecularColor = this.curSpecularColor; + properties.curEmissiveColor = this.curEmissiveColor; + properties._hasSetAmbient = this._hasSetAmbient; + properties._useSpecularMaterial = this._useSpecularMaterial; + properties._useEmissiveMaterial = this._useEmissiveMaterial; + properties._useShininess = this._useShininess; + properties.constantAttenuation = this.constantAttenuation; + properties.linearAttenuation = this.linearAttenuation; + properties.quadraticAttenuation = this.quadraticAttenuation; + properties._enableLighting = this._enableLighting; + properties._useNormalMaterial = this._useNormalMaterial; + properties._tex = this._tex; + properties.drawMode = this.drawMode; + properties._currentNormal = this._currentNormal; + properties.curBlendMode = this.curBlendMode; + // So that the activeImageLight gets reset in push/pop + properties.activeImageLight = this.activeImageLight; + return style; + }, + }, + { + key: "pop", + value: function pop() { + var _get2; + if ( + this._clipDepths.length > 0 && + this._pushPopDepth === + this._clipDepths[this._clipDepths.length - 1] + ) { + this._clearClip(); + } + for ( + var _len = arguments.length, + args = new Array(_len), + _key = 0; + _key < _len; + _key++ + ) { + args[_key] = arguments[_key]; + } + (_get2 = _get( + _getPrototypeOf(RendererGL.prototype), + "pop", + this, + )).call.apply(_get2, [this].concat(args)); + this._applyStencilTestIfClipping(); + }, + }, + { + key: "_applyStencilTestIfClipping", + value: function _applyStencilTestIfClipping() { + var drawTarget = this.drawTarget(); + if (drawTarget._isClipApplied !== this._stencilTestOn) { + if (drawTarget._isClipApplied) { + this.GL.enable(this.GL.STENCIL_TEST); + this._stencilTestOn = true; + } else { + this.GL.disable(this.GL.STENCIL_TEST); + this._stencilTestOn = false; + } + } + }, + }, + { + key: "resetMatrix", + value: function resetMatrix() { + this.uMVMatrix.set( + this._curCamera.cameraMatrix.mat4[0], + this._curCamera.cameraMatrix.mat4[1], + this._curCamera.cameraMatrix.mat4[2], + this._curCamera.cameraMatrix.mat4[3], + this._curCamera.cameraMatrix.mat4[4], + this._curCamera.cameraMatrix.mat4[5], + this._curCamera.cameraMatrix.mat4[6], + this._curCamera.cameraMatrix.mat4[7], + this._curCamera.cameraMatrix.mat4[8], + this._curCamera.cameraMatrix.mat4[9], + this._curCamera.cameraMatrix.mat4[10], + this._curCamera.cameraMatrix.mat4[11], + this._curCamera.cameraMatrix.mat4[12], + this._curCamera.cameraMatrix.mat4[13], + this._curCamera.cameraMatrix.mat4[14], + this._curCamera.cameraMatrix.mat4[15], + ); + return this; + }, ////////////////////////////////////////////// + // SHADER + ////////////////////////////////////////////// + /* + * shaders are created and cached on a per-renderer basis, + * on the grounds that each renderer will have its own gl context + * and the shader must be valid in that context. + */ + }, + { + key: "_getImmediateStrokeShader", + value: function _getImmediateStrokeShader() { + // select the stroke shader to use + var stroke = this.userStrokeShader; + if (!stroke || !stroke.isStrokeShader()) { + return this._getLineShader(); + } + return stroke; + }, + }, + { + key: "_getRetainedStrokeShader", + value: function _getRetainedStrokeShader() { + return this._getImmediateStrokeShader(); + } /* + * selects which fill shader should be used based on renderer state, + * for use with begin/endShape and immediate vertex mode. + */, + }, + { + key: "_getImmediateFillShader", + value: function _getImmediateFillShader() { + var fill = this.userFillShader; + if (this._useNormalMaterial) { + if (!fill || !fill.isNormalShader()) { + return this._getNormalShader(); + } + } + if (this._enableLighting) { + if (!fill || !fill.isLightShader()) { + return this._getLightShader(); + } + } else if (this._tex) { + if (!fill || !fill.isTextureShader()) { + return this._getLightShader(); + } + } else if (!fill /*|| !fill.isColorShader()*/) { + return this._getImmediateModeShader(); + } + return fill; + } /* + * selects which fill shader should be used based on renderer state + * for retained mode. + */, + }, + { + key: "_getRetainedFillShader", + value: function _getRetainedFillShader() { + if (this._useNormalMaterial) { + return this._getNormalShader(); + } + var fill = this.userFillShader; + if (this._enableLighting) { + if (!fill || !fill.isLightShader()) { + return this._getLightShader(); + } + } else if (this._tex) { + if (!fill || !fill.isTextureShader()) { + return this._getLightShader(); + } + } else if (!fill /* || !fill.isColorShader()*/) { + return this._getColorShader(); + } + return fill; + }, + }, + { + key: "_getImmediatePointShader", + value: function _getImmediatePointShader() { + // select the point shader to use + var point = this.userPointShader; + if (!point || !point.isPointShader()) { + return this._getPointShader(); + } + return point; + }, + }, + { + key: "_getRetainedLineShader", + value: function _getRetainedLineShader() { + return this._getImmediateLineShader(); + }, + }, + { + key: "_getLightShader", + value: function _getLightShader() { + if (!this._defaultLightShader) { + if (this._pInst._glAttributes.perPixelLighting) { + this._defaultLightShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "highp") + + defaultShaders.phongVert, + this._webGL2CompatibilityPrefix("frag", "highp") + + defaultShaders.phongFrag, + ); + } else { + this._defaultLightShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "highp") + + defaultShaders.lightVert, + this._webGL2CompatibilityPrefix("frag", "highp") + + defaultShaders.lightTextureFrag, + ); + } + } + return this._defaultLightShader; + }, + }, + { + key: "_getImmediateModeShader", + value: function _getImmediateModeShader() { + if (!this._defaultImmediateModeShader) { + this._defaultImmediateModeShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + defaultShaders.immediateVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + defaultShaders.vertexColorFrag, + ); + } + return this._defaultImmediateModeShader; + }, + }, + { + key: "_getNormalShader", + value: function _getNormalShader() { + if (!this._defaultNormalShader) { + this._defaultNormalShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + defaultShaders.normalVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + defaultShaders.normalFrag, + ); + } + return this._defaultNormalShader; + }, + }, + { + key: "_getColorShader", + value: function _getColorShader() { + if (!this._defaultColorShader) { + this._defaultColorShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + defaultShaders.normalVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + defaultShaders.basicFrag, + ); + } + return this._defaultColorShader; + }, + }, + { + key: "_getPointShader", + value: function _getPointShader() { + if (!this._defaultPointShader) { + this._defaultPointShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + defaultShaders.pointVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + defaultShaders.pointFrag, + ); + } + return this._defaultPointShader; + }, + }, + { + key: "_getLineShader", + value: function _getLineShader() { + if (!this._defaultLineShader) { + this._defaultLineShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + defaultShaders.lineVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + defaultShaders.lineFrag, + ); + } + return this._defaultLineShader; + }, + }, + { + key: "_getFontShader", + value: function _getFontShader() { + if (!this._defaultFontShader) { + if (this.webglVersion === constants.WEBGL) { + this.GL.getExtension("OES_standard_derivatives"); + } + this._defaultFontShader = new _main.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + defaultShaders.fontVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + defaultShaders.fontFrag, + ); + } + return this._defaultFontShader; + }, + }, + { + key: "_webGL2CompatibilityPrefix", + value: function _webGL2CompatibilityPrefix( + shaderType, + floatPrecision, + ) { + var code = ""; + if (this.webglVersion === constants.WEBGL2) { + code += "#version 300 es\n#define WEBGL2\n"; + } + if (shaderType === "vert") { + code += "#define VERTEX_SHADER\n"; + } else if (shaderType === "frag") { + code += "#define FRAGMENT_SHADER\n"; + } + if (floatPrecision) { + code += "precision ".concat(floatPrecision, " float;\n"); + } + return code; + }, + }, + { + key: "_getEmptyTexture", + value: function _getEmptyTexture() { + if (!this._emptyTexture) { + // a plain white texture RGBA, full alpha, single pixel. + var im = new _main.default.Image(1, 1); + im.set(0, 0, 255); + this._emptyTexture = new _main.default.Texture(this, im); + } + return this._emptyTexture; + }, + }, + { + key: "getTexture", + value: function getTexture(input) { + var src = input; + if (src instanceof _main.default.Framebuffer) { + src = src.color; + } + var texture = this.textures.get(src); + if (texture) { + return texture; + } + var tex = new _main.default.Texture(this, src); + this.textures.set(src, tex); + return tex; + } /* + * used in imageLight, + * To create a blurry image from the input non blurry img, if it doesn't already exist + * Add it to the diffusedTexture map, + * Returns the blurry image + * maps a p5.Image used by imageLight() to a p5.Graphics + */, + }, + { + key: "getDiffusedTexture", + value: function getDiffusedTexture(input) { + // if one already exists for a given input image + if (this.diffusedTextures.get(input) != null) { + return this.diffusedTextures.get(input); + } // if not, only then create one + + var newGraphic; // maybe switch to framebuffer + // hardcoded to 200px, because it's going to be blurry and smooth + var smallWidth = 200; + var width = smallWidth; + var height = Math.floor( + smallWidth * (input.height / input.width), + ); + newGraphic = this._pInst.createGraphics( + width, + height, + constants.WEBGL, + ); + // create graphics is like making a new sketch, all functions on main + // sketch it would be available on graphics + var irradiance = newGraphic.createShader( + defaultShaders.imageLightVert, + defaultShaders.imageLightDiffusedFrag, + ); + newGraphic.shader(irradiance); + irradiance.setUniform("environmentMap", input); + newGraphic.noStroke(); + newGraphic.rectMode(newGraphic.CENTER); + newGraphic.rect(0, 0, newGraphic.width, newGraphic.height); + this.diffusedTextures.set(input, newGraphic); + return newGraphic; + } /* + * used in imageLight, + * To create a texture from the input non blurry image, if it doesn't already exist + * Creating 8 different levels of textures according to different + * sizes and atoring them in `levels` array + * Creating a new Mipmap texture with that `levels` array + * Storing the texture for input image in map called `specularTextures` + * maps the input p5.Image to a p5.MipmapTexture + */, + }, + { + key: "getSpecularTexture", + value: function getSpecularTexture(input) { + // check if already exits (there are tex of diff resolution so which one to check) + // currently doing the whole array + if (this.specularTextures.get(input) != null) { + return this.specularTextures.get(input); + } // Hardcoded size + + var size = 512; + var tex; + var levels = []; + var graphic = this._pInst.createGraphics( + size, + size, + constants.WEBGL, + ); + var count = Math.log(size) / Math.log(2); + graphic.pixelDensity(1); + // currently only 8 levels + // This loop calculates 8 graphics of varying size of canvas + // and corresponding different roughness levels. + // Roughness increases with the decrease in canvas size, + // because rougher surfaces have less detailed/more blurry reflections. + for (var w = size; w >= 1; w /= 2) { + graphic.resizeCanvas(w, w); + var currCount = Math.log(w) / Math.log(2); + var roughness = 1 - currCount / count; + var myShader = graphic.createShader( + defaultShaders.imageLightVert, + defaultShaders.imageLightSpecularFrag, + ); + graphic.shader(myShader); + graphic.clear(); + myShader.setUniform("environmentMap", input); + myShader.setUniform("roughness", roughness); + graphic.noStroke(); + graphic.plane(w, w); + levels.push( + graphic.get().drawingContext.getImageData(0, 0, w, w), + ); + } + graphic.remove(); + tex = new _p6.MipmapTexture(this, levels, {}); + this.specularTextures.set(input, tex); + return tex; + } /** + * @method activeFramebuffer + * @private + * @returns {p5.Framebuffer|null} The currently active framebuffer, or null if + * the main canvas is the current draw target. + */, + }, + { + key: "activeFramebuffer", + value: function activeFramebuffer() { + return ( + this.activeFramebuffers[ + this.activeFramebuffers.length - 1 + ] || null + ); + }, + }, + { + key: "createFramebuffer", + value: function createFramebuffer(options) { + return new _main.default.Framebuffer(this, options); + }, + }, + { + key: "_setStrokeUniforms", + value: function _setStrokeUniforms(strokeShader) { + strokeShader.bindShader(); + // set the uniform values + strokeShader.setUniform("uUseLineColor", this._useLineColor); + strokeShader.setUniform( + "uMaterialColor", + this.curStrokeColor, + ); + strokeShader.setUniform( + "uStrokeWeight", + this.curStrokeWeight, + ); + strokeShader.setUniform( + "uStrokeCap", + STROKE_CAP_ENUM[this.curStrokeCap], + ); + strokeShader.setUniform( + "uStrokeJoin", + STROKE_JOIN_ENUM[this.curStrokeJoin], + ); + }, + }, + { + key: "_setFillUniforms", + value: function _setFillUniforms(fillShader) { + fillShader.bindShader(); + // TODO: optimize + fillShader.setUniform( + "uUseVertexColor", + this._useVertexColor, + ); + fillShader.setUniform("uMaterialColor", this.curFillColor); + fillShader.setUniform("isTexture", !!this._tex); + if (this._tex) { + fillShader.setUniform("uSampler", this._tex); + } + fillShader.setUniform("uTint", this._tint); + fillShader.setUniform("uHasSetAmbient", this._hasSetAmbient); + fillShader.setUniform( + "uAmbientMatColor", + this.curAmbientColor, + ); + fillShader.setUniform( + "uSpecularMatColor", + this.curSpecularColor, + ); + fillShader.setUniform( + "uEmissiveMatColor", + this.curEmissiveColor, + ); + fillShader.setUniform("uSpecular", this._useSpecularMaterial); + fillShader.setUniform("uEmissive", this._useEmissiveMaterial); + fillShader.setUniform("uShininess", this._useShininess); + this._setImageLightUniforms(fillShader); + fillShader.setUniform("uUseLighting", this._enableLighting); + var pointLightCount = this.pointLightDiffuseColors.length / 3; + fillShader.setUniform("uPointLightCount", pointLightCount); + fillShader.setUniform( + "uPointLightLocation", + this.pointLightPositions, + ); + fillShader.setUniform( + "uPointLightDiffuseColors", + this.pointLightDiffuseColors, + ); + fillShader.setUniform( + "uPointLightSpecularColors", + this.pointLightSpecularColors, + ); + var directionalLightCount = + this.directionalLightDiffuseColors.length / 3; + fillShader.setUniform( + "uDirectionalLightCount", + directionalLightCount, + ); + fillShader.setUniform( + "uLightingDirection", + this.directionalLightDirections, + ); + fillShader.setUniform( + "uDirectionalDiffuseColors", + this.directionalLightDiffuseColors, + ); + fillShader.setUniform( + "uDirectionalSpecularColors", + this.directionalLightSpecularColors, + ); + // TODO: sum these here... + var ambientLightCount = this.ambientLightColors.length / 3; + fillShader.setUniform( + "uAmbientLightCount", + ambientLightCount, + ); + fillShader.setUniform( + "uAmbientColor", + this.ambientLightColors, + ); + var spotLightCount = this.spotLightDiffuseColors.length / 3; + fillShader.setUniform("uSpotLightCount", spotLightCount); + fillShader.setUniform("uSpotLightAngle", this.spotLightAngle); + fillShader.setUniform("uSpotLightConc", this.spotLightConc); + fillShader.setUniform( + "uSpotLightDiffuseColors", + this.spotLightDiffuseColors, + ); + fillShader.setUniform( + "uSpotLightSpecularColors", + this.spotLightSpecularColors, + ); + fillShader.setUniform( + "uSpotLightLocation", + this.spotLightPositions, + ); + fillShader.setUniform( + "uSpotLightDirection", + this.spotLightDirections, + ); + fillShader.setUniform( + "uConstantAttenuation", + this.constantAttenuation, + ); + fillShader.setUniform( + "uLinearAttenuation", + this.linearAttenuation, + ); + fillShader.setUniform( + "uQuadraticAttenuation", + this.quadraticAttenuation, + ); + fillShader.bindTextures(); + }, // getting called from _setFillUniforms + }, + { + key: "_setImageLightUniforms", + value: function _setImageLightUniforms(shader) { + //set uniform values + shader.setUniform( + "uUseImageLight", + this.activeImageLight != null, + ); + // true + if (this.activeImageLight) { + // this.activeImageLight has image as a key + // look up the texture from the diffusedTexture map + var diffusedLight = this.getDiffusedTexture( + this.activeImageLight, + ); + shader.setUniform("environmentMapDiffused", diffusedLight); + var specularLight = this.getSpecularTexture( + this.activeImageLight, + ); + // In p5js the range of shininess is >= 1, + // Therefore roughness range will be ([0,1]*8)*20 or [0, 160] + // The factor of 8 is because currently the getSpecularTexture + // only calculated 8 different levels of roughness + // The factor of 20 is just to spread up this range so that, + // [1, max] of shininess is converted to [0,160] of roughness + var roughness = 20 / this._useShininess; + shader.setUniform("levelOfDetail", roughness * 8); + shader.setUniform("environmentMapSpecular", specularLight); + } + }, + }, + { + key: "_setPointUniforms", + value: function _setPointUniforms(pointShader) { + pointShader.bindShader(); + // set the uniform values + pointShader.setUniform("uMaterialColor", this.curStrokeColor); + // @todo is there an instance where this isn't stroke weight? + // should be they be same var? + pointShader.setUniform( + "uPointSize", + this.pointSize * this._pInst._pixelDensity, + ); + } /* Binds a buffer to the drawing context + * when passed more than two arguments it also updates or initializes + * the data associated with the buffer + */, + }, + { + key: "_bindBuffer", + value: function _bindBuffer( + buffer, + target, + values, + type, + usage, + ) { + if (!target) target = this.GL.ARRAY_BUFFER; + this.GL.bindBuffer(target, buffer); + if (values !== undefined) { + var data = values; + if (values instanceof _main.default.DataArray) { + data = values.dataArray(); + } else if (!(data instanceof (type || Float32Array))) { + data = new (type || Float32Array)(data); + } + this.GL.bufferData( + target, + data, + usage || this.GL.STATIC_DRAW, + ); + } + }, /////////////////////////////// + //// UTILITY FUNCTIONS + ////////////////////////////// + }, + { + key: "_arraysEqual", + value: function _arraysEqual(a, b) { + var aLength = a.length; + if (aLength !== b.length) return false; + return a.every(function (ai, i) { + return ai === b[i]; + }); + }, + }, + { + key: "_isTypedArray", + value: function _isTypedArray(arr) { + return [ + Float32Array, + Float64Array, + Int16Array, + Uint16Array, + Uint32Array, + ].some(function (x) { + return arr instanceof x; + }); + } /** + * turn a two dimensional array into one dimensional array + * @private + * @param {Array} arr 2-dimensional array + * @return {Array} 1-dimensional array + * [[1, 2, 3],[4, 5, 6]] -> [1, 2, 3, 4, 5, 6] + */, + }, + { + key: "_flatten", + value: function _flatten(arr) { + //when empty, return empty + if (arr.length === 0) { + return []; + } else if (arr.length > 20000) { + //big models , load slower to avoid stack overflow + //faster non-recursive flatten via axelduch + //stackoverflow.com/questions/27266550/how-to-flatten-nested-array-in-javascript + var result = []; + var nodes = arr.slice(); + var node; + node = nodes.pop(); + do { + if (Array.isArray(node)) { + nodes.push.apply(nodes, _toConsumableArray(node)); + } else { + result.push(node); + } + } while ( + nodes.length && + (node = nodes.pop()) !== undefined + ); + result.reverse(); // we reverse result to restore the original order + return result; + } else { + var _ref; + //otherwise if model within limits for browser + //use faster recursive loading + return (_ref = []).concat.apply( + _ref, + _toConsumableArray(arr), + ); + } + } /** + * turn a p5.Vector Array into a one dimensional number array + * @private + * @param {p5.Vector[]} arr an array of p5.Vector + * @return {Number[]} a one dimensional array of numbers + * [p5.Vector(1, 2, 3), p5.Vector(4, 5, 6)] -> + * [1, 2, 3, 4, 5, 6] + */, + }, + { + key: "_vToNArray", + value: function _vToNArray(arr) { + var ret = []; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = arr[Symbol.iterator](), _step2; + !(_iteratorNormalCompletion2 = (_step2 = + _iterator2.next()).done); + _iteratorNormalCompletion2 = true + ) { + var item = _step2.value; + ret.push(item.x, item.y, item.z); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + return ret; + }, // function to calculate BezierVertex Coefficients + }, + { + key: "_bezierCoefficients", + value: function _bezierCoefficients(t) { + var t2 = t * t; + var t3 = t2 * t; + var mt = 1 - t; + var mt2 = mt * mt; + var mt3 = mt2 * mt; + return [mt3, 3 * mt2 * t, 3 * mt * t2, t3]; + }, // function to calculate QuadraticVertex Coefficients + }, + { + key: "_quadraticCoefficients", + value: function _quadraticCoefficients(t) { + var t2 = t * t; + var mt = 1 - t; + var mt2 = mt * mt; + return [mt2, 2 * mt * t, t2]; + }, // function to convert Bezier coordinates to Catmull Rom Splines + }, + { + key: "_bezierToCatmull", + value: function _bezierToCatmull(w) { + var p1 = w[1]; + var p2 = w[1] + (w[2] - w[0]) / this._curveTightness; + var p3 = w[2] - (w[3] - w[1]) / this._curveTightness; + var p4 = w[2]; + var p = [p1, p2, p3, p4]; + return p; + }, + }, + { + key: "_initTessy", + value: function _initTessy() { + // function called for each vertex of tesselator output + function vertexCallback(data, polyVertArray) { + for (var i = 0; i < data.length; i++) { + polyVertArray.push(data[i]); + } + } + function begincallback(type) { + if (type !== _libtess.default.primitiveType.GL_TRIANGLES) { + console.log( + "expected TRIANGLES but got type: ".concat(type), + ); + } + } + function errorcallback(errno) { + console.log("error callback"); + console.log("error number: ".concat(errno)); + } // callback for when segments intersect and must be split + + function combinecallback(coords, data, weight) { + var result = new Array( + _main.default.RendererGL.prototype.tessyVertexSize, + ).fill(0); + for (var i = 0; i < weight.length; i++) { + for (var j = 0; j < result.length; j++) { + if (weight[i] === 0 || !data[i]) continue; + result[j] += data[i][j] * weight[i]; + } + } + return result; + } + function edgeCallback(flag) { + // don't really care about the flag, but need no-strip/no-fan behavior + } + var tessy = new _libtess.default.GluTesselator(); + tessy.gluTessCallback( + _libtess.default.gluEnum.GLU_TESS_VERTEX_DATA, + vertexCallback, + ); + tessy.gluTessCallback( + _libtess.default.gluEnum.GLU_TESS_BEGIN, + begincallback, + ); + tessy.gluTessCallback( + _libtess.default.gluEnum.GLU_TESS_ERROR, + errorcallback, + ); + tessy.gluTessCallback( + _libtess.default.gluEnum.GLU_TESS_COMBINE, + combinecallback, + ); + tessy.gluTessCallback( + _libtess.default.gluEnum.GLU_TESS_EDGE_FLAG, + edgeCallback, + ); + tessy.gluTessProperty( + _libtess.default.gluEnum.GLU_TESS_WINDING_RULE, + _libtess.default.windingRule.GLU_TESS_WINDING_NONZERO, + ); + return tessy; + }, + }, + { + key: "_triangulate", + value: function _triangulate(contours) { + // libtess will take 3d verts and flatten to a plane for tesselation. + // libtess is capable of calculating a plane to tesselate on, but + // if all of the vertices have the same z values, we'll just + // assume the face is facing the camera, letting us skip any performance + // issues or bugs in libtess's automatic calculation. + var z = contours[0] ? contours[0][2] : undefined; + var allSameZ = true; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = contours[Symbol.iterator](), _step3; + !(_iteratorNormalCompletion3 = (_step3 = + _iterator3.next()).done); + _iteratorNormalCompletion3 = true + ) { + var contour = _step3.value; + for ( + var j = 0; + j < contour.length; + j += _main.default.RendererGL.prototype.tessyVertexSize + ) { + if (contour[j + 2] !== z) { + allSameZ = false; + break; + } + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion3 && + _iterator3.return != null + ) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + if (allSameZ) { + this._tessy.gluTessNormal(0, 0, 1); + } else { + // Let libtess pick a plane for us + this._tessy.gluTessNormal(0, 0, 0); + } + var triangleVerts = []; + this._tessy.gluTessBeginPolygon(triangleVerts); + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for ( + var _iterator4 = contours[Symbol.iterator](), _step4; + !(_iteratorNormalCompletion4 = (_step4 = + _iterator4.next()).done); + _iteratorNormalCompletion4 = true + ) { + var _contour = _step4.value; + this._tessy.gluTessBeginContour(); + for ( + var _j = 0; + _j < _contour.length; + _j += _main.default.RendererGL.prototype.tessyVertexSize + ) { + var coords = _contour.slice( + _j, + _j + + _main.default.RendererGL.prototype.tessyVertexSize, + ); + this._tessy.gluTessVertex(coords, coords); + } + this._tessy.gluTessEndContour(); + } // finish polygon + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion4 && + _iterator4.return != null + ) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + this._tessy.gluTessEndPolygon(); + return triangleVerts; + }, + }, + ]); + return RendererGL; + })(_main.default.Renderer); + /** + * ensures that p5 is using a 3d renderer. throws an error if not. + */ + _main.default.prototype._assert3d = function (name) { + if (!this._renderer.isP3D) + throw new Error( + "".concat( + name, + "() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.", + ), + ); + }; + // function to initialize GLU Tesselator + _main.default.RendererGL.prototype.tessyVertexSize = 12; + var _default = _main.default.RendererGL; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "../core/p5.Renderer": 301, + "./GeometryBuilder": 342, + "./p5.Camera": 347, + "./p5.Framebuffer": 349, + "./p5.Matrix": 351, + "./p5.Shader": 356, + "./p5.Texture": 357, + "core-js/modules/es.array.concat": 169, + "core-js/modules/es.array.copy-within": 170, + "core-js/modules/es.array.every": 171, + "core-js/modules/es.array.fill": 172, + "core-js/modules/es.array.from": 176, + "core-js/modules/es.array.includes": 177, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.some": 184, + "core-js/modules/es.map": 187, + "core-js/modules/es.object.assign": 194, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.reflect.get": 203, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.set": 207, + "core-js/modules/es.string.includes": 209, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.float32-array": 229, + "core-js/modules/es.typed-array.float64-array": 230, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.int16-array": 234, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint16-array": 250, + "core-js/modules/es.typed-array.uint32-array": 251, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + libtess: 269, + path: 272, + }, + ], + 356: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.index-of"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.array.slice"); + _dereq_("core-js/modules/es.array.some"); + _dereq_("core-js/modules/es.function.name"); + _dereq_("core-js/modules/es.object.keys"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * This module defines the p5.Shader class + * @module 3D + * @submodule Material + * @for p5 + * @requires core + */ + /** + * Shader class for WEBGL Mode + * @class p5.Shader + * @constructor + * @param {p5.RendererGL} renderer an instance of p5.RendererGL that + * will provide the GL context for this new p5.Shader + * @param {String} vertSrc source code for the vertex shader (as a string) + * @param {String} fragSrc source code for the fragment shader (as a string) + */ + + _main.default.Shader = /*#__PURE__*/ (function () { + function _class(renderer, vertSrc, fragSrc) { + _classCallCheck(this, _class); + // TODO: adapt this to not take ids, but rather, + // to take the source for a vertex and fragment shader + // to enable custom shaders at some later date + this._renderer = renderer; + this._vertSrc = vertSrc; + this._fragSrc = fragSrc; + this._vertShader = -1; + this._fragShader = -1; + this._glProgram = 0; + this._loadedAttributes = false; + this.attributes = {}; + this._loadedUniforms = false; + this.uniforms = {}; + this._bound = false; + this.samplers = []; + } /** + * Creates, compiles, and links the shader based on its + * sources for the vertex and fragment shaders (provided + * to the constructor). Populates known attributes and + * uniforms from the shader. + * @method init + * @chainable + * @private + */ + + _createClass(_class, [ + { + key: "init", + value: function init() { + if (this._glProgram === 0 /* or context is stale? */) { + var gl = this._renderer.GL; + // @todo: once custom shading is allowed, + // friendly error messages should be used here to share + // compiler and linker errors. + //set up the shader by + // 1. creating and getting a gl id for the shader program, + // 2. compliling its vertex & fragment sources, + // 3. linking the vertex and fragment shaders + this._vertShader = gl.createShader(gl.VERTEX_SHADER); + //load in our default vertex shader + gl.shaderSource(this._vertShader, this._vertSrc); + gl.compileShader(this._vertShader); + // if our vertex shader failed compilation? + if ( + !gl.getShaderParameter( + this._vertShader, + gl.COMPILE_STATUS, + ) + ) { + _main.default._friendlyError( + "Yikes! An error occurred compiling the vertex shader:".concat( + gl.getShaderInfoLog(this._vertShader), + ), + ); + return null; + } + this._fragShader = gl.createShader(gl.FRAGMENT_SHADER); + //load in our material frag shader + gl.shaderSource(this._fragShader, this._fragSrc); + gl.compileShader(this._fragShader); + // if our frag shader failed compilation? + if ( + !gl.getShaderParameter( + this._fragShader, + gl.COMPILE_STATUS, + ) + ) { + _main.default._friendlyError( + "Darn! An error occurred compiling the fragment shader:".concat( + gl.getShaderInfoLog(this._fragShader), + ), + ); + return null; + } + this._glProgram = gl.createProgram(); + gl.attachShader(this._glProgram, this._vertShader); + gl.attachShader(this._glProgram, this._fragShader); + gl.linkProgram(this._glProgram); + if ( + !gl.getProgramParameter(this._glProgram, gl.LINK_STATUS) + ) { + _main.default._friendlyError( + "Snap! Error linking shader program: ".concat( + gl.getProgramInfoLog(this._glProgram), + ), + ); + } + this._loadAttributes(); + this._loadUniforms(); + } + return this; + } /** + * Shaders belong to the main canvas or a p5.Graphics. Once they are compiled, + * they can only be used in the context they were compiled on. + * + * Use this method to make a new copy of a shader that gets compiled on a + * different context. + * + * @method copyToContext + * @param {p5|p5.Graphics} context The graphic or instance to copy this shader to. + * Pass `window` if you need to copy to the main canvas. + * @returns {p5.Shader} A new shader on the target context. + * + * @example + *
                    + * + * let graphic = createGraphics(200, 200, WEBGL); + * let graphicShader = graphic.createShader(vert, frag); + * graphic.shader(graphicShader); // Use graphicShader on the graphic + * + * let mainShader = graphicShader.copyToContext(window); + * shader(mainShader); // Use `mainShader` on the main canvas + * + *
                    + */, + }, + { + key: "copyToContext", + value: function copyToContext(context) { + var shader = new _main.default.Shader( + context._renderer, + this._vertSrc, + this._fragSrc, + ); + shader.ensureCompiledOnContext(context); + return shader; + } /** + * @private + */, + }, + { + key: "ensureCompiledOnContext", + value: function ensureCompiledOnContext(context) { + if ( + this._glProgram !== 0 && + this._renderer !== context._renderer + ) { + throw new Error( + "The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?", + ); + } else if (this._glProgram === 0) { + this._renderer = context._renderer; + this.init(); + } + } /** + * Queries the active attributes for this shader and loads + * their names and locations into the attributes array. + * @method _loadAttributes + * @private + */, + }, + { + key: "_loadAttributes", + value: function _loadAttributes() { + if (this._loadedAttributes) { + return; + } + this.attributes = {}; + var gl = this._renderer.GL; + var numAttributes = gl.getProgramParameter( + this._glProgram, + gl.ACTIVE_ATTRIBUTES, + ); + for (var i = 0; i < numAttributes; ++i) { + var attributeInfo = gl.getActiveAttrib(this._glProgram, i); + var name = attributeInfo.name; + var location = gl.getAttribLocation(this._glProgram, name); + var attribute = {}; + attribute.name = name; + attribute.location = location; + attribute.index = i; + attribute.type = attributeInfo.type; + attribute.size = attributeInfo.size; + this.attributes[name] = attribute; + } + this._loadedAttributes = true; + } /** + * Queries the active uniforms for this shader and loads + * their names and locations into the uniforms array. + * @method _loadUniforms + * @private + */, + }, + { + key: "_loadUniforms", + value: function _loadUniforms() { + if (this._loadedUniforms) { + return; + } + var gl = this._renderer.GL; + // Inspect shader and cache uniform info + var numUniforms = gl.getProgramParameter( + this._glProgram, + gl.ACTIVE_UNIFORMS, + ); + var samplerIndex = 0; + for (var i = 0; i < numUniforms; ++i) { + var uniformInfo = gl.getActiveUniform(this._glProgram, i); + var uniform = {}; + uniform.location = gl.getUniformLocation( + this._glProgram, + uniformInfo.name, + ); + uniform.size = uniformInfo.size; + var uniformName = uniformInfo.name; + //uniforms thats are arrays have their name returned as + //someUniform[0] which is a bit silly so we trim it + //off here. The size property tells us that its an array + //so we dont lose any information by doing this + if (uniformInfo.size > 1) { + uniformName = uniformName.substring( + 0, + uniformName.indexOf("[0]"), + ); + } + uniform.name = uniformName; + uniform.type = uniformInfo.type; + uniform._cachedData = undefined; + if (uniform.type === gl.SAMPLER_2D) { + uniform.samplerIndex = samplerIndex; + samplerIndex++; + this.samplers.push(uniform); + } + uniform.isArray = + uniformInfo.size > 1 || + uniform.type === gl.FLOAT_MAT3 || + uniform.type === gl.FLOAT_MAT4 || + uniform.type === gl.FLOAT_VEC2 || + uniform.type === gl.FLOAT_VEC3 || + uniform.type === gl.FLOAT_VEC4 || + uniform.type === gl.INT_VEC2 || + uniform.type === gl.INT_VEC4 || + uniform.type === gl.INT_VEC3; + this.uniforms[uniformName] = uniform; + } + this._loadedUniforms = true; + }, + }, + { + key: "compile", + value: function compile() { + // TODO + } /** + * initializes (if needed) and binds the shader program. + * @method bindShader + * @private + */, + }, + { + key: "bindShader", + value: function bindShader() { + this.init(); + if (!this._bound) { + this.useProgram(); + this._bound = true; + this._setMatrixUniforms(); + this.setUniform("uViewport", this._renderer._viewport); + } + } /** + * @method unbindShader + * @chainable + * @private + */, + }, + { + key: "unbindShader", + value: function unbindShader() { + if (this._bound) { + this.unbindTextures(); + //this._renderer.GL.useProgram(0); ?? + this._bound = false; + } + return this; + }, + }, + { + key: "bindTextures", + value: function bindTextures() { + var gl = this._renderer.GL; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = this.samplers[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var uniform = _step.value; + var tex = uniform.texture; + if (tex === undefined) { + // user hasn't yet supplied a texture for this slot. + // (or there may not be one--maybe just lighting), + // so we supply a default texture instead. + tex = this._renderer._getEmptyTexture(); + } + gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); + tex.bindTexture(); + tex.update(); + gl.uniform1i(uniform.location, uniform.samplerIndex); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + }, + }, + { + key: "updateTextures", + value: function updateTextures() { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = this.samplers[Symbol.iterator](), _step2; + !(_iteratorNormalCompletion2 = (_step2 = + _iterator2.next()).done); + _iteratorNormalCompletion2 = true + ) { + var uniform = _step2.value; + var tex = uniform.texture; + if (tex) { + tex.update(); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + }, + }, + { + key: "unbindTextures", + value: function unbindTextures() { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = this.samplers[Symbol.iterator](), _step3; + !(_iteratorNormalCompletion3 = (_step3 = + _iterator3.next()).done); + _iteratorNormalCompletion3 = true + ) { + var uniform = _step3.value; + this.setUniform( + uniform.name, + this._renderer._getEmptyTexture(), + ); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion3 && + _iterator3.return != null + ) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + }, + }, + { + key: "_setMatrixUniforms", + value: function _setMatrixUniforms() { + var viewMatrix = this._renderer._curCamera.cameraMatrix; + var projectionMatrix = this._renderer.uPMatrix; + var modelViewMatrix = this._renderer.uMVMatrix; + var modelViewProjectionMatrix = modelViewMatrix.copy(); + modelViewProjectionMatrix.mult(projectionMatrix); + if (this.isStrokeShader()) { + if (this._renderer._curCamera.cameraType === "default") { + // strokes scale up as they approach camera, default + this.setUniform("uPerspective", 1); + } else { + // strokes have uniform scale regardless of distance from camera + this.setUniform("uPerspective", 0); + } + } + this.setUniform("uViewMatrix", viewMatrix.mat4); + this.setUniform("uProjectionMatrix", projectionMatrix.mat4); + this.setUniform("uModelViewMatrix", modelViewMatrix.mat4); + this.setUniform( + "uModelViewProjectionMatrix", + modelViewProjectionMatrix.mat4, + ); + if (this.uniforms.uNormalMatrix) { + this._renderer.uNMatrix.inverseTranspose( + this._renderer.uMVMatrix, + ); + this.setUniform( + "uNormalMatrix", + this._renderer.uNMatrix.mat3, + ); + } + } /** + * @method useProgram + * @chainable + * @private + */, + }, + { + key: "useProgram", + value: function useProgram() { + var gl = this._renderer.GL; + if (this._renderer._curShader !== this) { + gl.useProgram(this._glProgram); + this._renderer._curShader = this; + } + return this; + } /** + * Used to set the uniforms of a + * p5.Shader object. + * + * Uniforms are used as a way to provide shader programs + * (which run on the GPU) with values from a sketch + * (which runs on the CPU). + * + * Here are some examples of uniforms you can make: + * - booleans + * - Example: `setUniform('x', true)` becomes `uniform float x` with the value `1.0` + * - numbers + * - Example: `setUniform('x', -2)` becomes `uniform float x` with the value `-2.0` + * - arrays of numbers + * - Example: `setUniform('x', [0, 0.5, 1])` becomes `uniform vec3 x` with the value `vec3(0.0, 0.5, 1.0)` + * - a p5.Image, p5.Graphics, p5.MediaElement, or p5.Texture + * - Example: `setUniform('x', img)` becomes `uniform sampler2D x` + * + * @method setUniform + * @chainable + * @param {String} uniformName the name of the uniform. + * Must correspond to the name used in the vertex and fragment shaders + * @param {Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture} + * data the data to associate with the uniform. The type can be + * a boolean (true/false), a number, an array of numbers, or + * an image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture) + * + * @example + *
                    + * + * // Click within the image to toggle the value of uniforms + * // Note: for an alternative approach to the same example, + * // involving toggling between shaders please refer to: + * // https://p5js.org/reference/#/p5/shader + * + * let grad; + * let showRedGreen = false; + * + * function preload() { + * // note that we are using two instances + * // of the same vertex and fragment shaders + * grad = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * shader(grad); + * noStroke(); + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); + * } + * + * function draw() { + * // update the offset values for each scenario, + * // moving the "grad" shader in either vertical or + * // horizontal direction each with differing colors + * + * if (showRedGreen === true) { + * grad.setUniform('colorCenter', [1, 0, 0]); + * grad.setUniform('colorBackground', [0, 1, 0]); + * grad.setUniform('offset', [sin(millis() / 2000), 1]); + * } else { + * grad.setUniform('colorCenter', [1, 0.5, 0]); + * grad.setUniform('colorBackground', [0.226, 0, 0.615]); + * grad.setUniform('offset', [0, sin(millis() / 2000) + 1]); + * } + * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * } + * + * function mouseClicked() { + * showRedGreen = !showRedGreen; + * } + * + *
                    + * + * @alt + * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. + */, + }, + { + key: "setUniform", + value: function setUniform(uniformName, data) { + var uniform = this.uniforms[uniformName]; + if (!uniform) { + return; + } + var gl = this._renderer.GL; + if (uniform.isArray) { + if ( + uniform._cachedData && + this._renderer._arraysEqual(uniform._cachedData, data) + ) { + return; + } else { + uniform._cachedData = data.slice(0); + } + } else if ( + uniform._cachedData && + uniform._cachedData === data + ) { + return; + } else { + if (Array.isArray(data)) { + uniform._cachedData = data.slice(0); + } else { + uniform._cachedData = data; + } + } + var location = uniform.location; + this.useProgram(); + switch (uniform.type) { + case gl.BOOL: + if (data === true) { + gl.uniform1i(location, 1); + } else { + gl.uniform1i(location, 0); + } + break; + case gl.INT: + if (uniform.size > 1) { + data.length && gl.uniform1iv(location, data); + } else { + gl.uniform1i(location, data); + } + break; + case gl.FLOAT: + if (uniform.size > 1) { + data.length && gl.uniform1fv(location, data); + } else { + gl.uniform1f(location, data); + } + break; + case gl.FLOAT_MAT3: + gl.uniformMatrix3fv(location, false, data); + break; + case gl.FLOAT_MAT4: + gl.uniformMatrix4fv(location, false, data); + break; + case gl.FLOAT_VEC2: + if (uniform.size > 1) { + data.length && gl.uniform2fv(location, data); + } else { + gl.uniform2f(location, data[0], data[1]); + } + break; + case gl.FLOAT_VEC3: + if (uniform.size > 1) { + data.length && gl.uniform3fv(location, data); + } else { + gl.uniform3f(location, data[0], data[1], data[2]); + } + break; + case gl.FLOAT_VEC4: + if (uniform.size > 1) { + data.length && gl.uniform4fv(location, data); + } else { + gl.uniform4f( + location, + data[0], + data[1], + data[2], + data[3], + ); + } + break; + case gl.INT_VEC2: + if (uniform.size > 1) { + data.length && gl.uniform2iv(location, data); + } else { + gl.uniform2i(location, data[0], data[1]); + } + break; + case gl.INT_VEC3: + if (uniform.size > 1) { + data.length && gl.uniform3iv(location, data); + } else { + gl.uniform3i(location, data[0], data[1], data[2]); + } + break; + case gl.INT_VEC4: + if (uniform.size > 1) { + data.length && gl.uniform4iv(location, data); + } else { + gl.uniform4i( + location, + data[0], + data[1], + data[2], + data[3], + ); + } + break; + case gl.SAMPLER_2D: + gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); + uniform.texture = + data instanceof _main.default.Texture + ? data + : this._renderer.getTexture(data); + gl.uniform1i(location, uniform.samplerIndex); + if (uniform.texture.src.gifProperties) { + uniform.texture.src._animateGif(this._renderer._pInst); + } + break; + //@todo complete all types + } + return this; + } /* NONE OF THIS IS FAST OR EFFICIENT BUT BEAR WITH ME + * + * these shader "type" query methods are used by various + * facilities of the renderer to determine if changing + * the shader type for the required action (for example, + * do we need to load the default lighting shader if the + * current shader cannot handle lighting?) + * + **/, + }, + { + key: "isLightShader", + value: function isLightShader() { + return ( + this.attributes.aNormal !== undefined || + this.uniforms.uUseLighting !== undefined || + this.uniforms.uAmbientLightCount !== undefined || + this.uniforms.uDirectionalLightCount !== undefined || + this.uniforms.uPointLightCount !== undefined || + this.uniforms.uAmbientColor !== undefined || + this.uniforms.uDirectionalDiffuseColors !== undefined || + this.uniforms.uDirectionalSpecularColors !== undefined || + this.uniforms.uPointLightLocation !== undefined || + this.uniforms.uPointLightDiffuseColors !== undefined || + this.uniforms.uPointLightSpecularColors !== undefined || + this.uniforms.uLightingDirection !== undefined || + this.uniforms.uSpecular !== undefined + ); + }, + }, + { + key: "isNormalShader", + value: function isNormalShader() { + return this.attributes.aNormal !== undefined; + }, + }, + { + key: "isTextureShader", + value: function isTextureShader() { + return this.samplers.length > 0; + }, + }, + { + key: "isColorShader", + value: function isColorShader() { + return ( + this.attributes.aVertexColor !== undefined || + this.uniforms.uMaterialColor !== undefined + ); + }, + }, + { + key: "isTexLightShader", + value: function isTexLightShader() { + return this.isLightShader() && this.isTextureShader(); + }, + }, + { + key: "isStrokeShader", + value: function isStrokeShader() { + return this.uniforms.uStrokeWeight !== undefined; + } /** + * @method enableAttrib + * @chainable + * @private + */, + }, + { + key: "enableAttrib", + value: function enableAttrib( + attr, + size, + type, + normalized, + stride, + offset, + ) { + if (attr) { + if ( + typeof IS_MINIFIED === "undefined" && + this.attributes[attr.name] !== attr + ) { + console.warn( + 'The attribute "'.concat( + attr.name, + '"passed to enableAttrib does not belong to this shader.', + ), + ); + } + var loc = attr.location; + if (loc !== -1) { + var gl = this._renderer.GL; + // Enable register even if it is disabled + if (!this._renderer.registerEnabled.has(loc)) { + gl.enableVertexAttribArray(loc); + // Record register availability + this._renderer.registerEnabled.add(loc); + } + this._renderer.GL.vertexAttribPointer( + loc, + size, + type || gl.FLOAT, + normalized || false, + stride || 0, + offset || 0, + ); + } + } + return this; + } /** + * Once all buffers have been bound, this checks to see if there are any + * remaining active attributes, likely left over from previous renders, + * and disables them so that they don't affect rendering. + * @method disableRemainingAttributes + * @private + */, + }, + { + key: "disableRemainingAttributes", + value: function disableRemainingAttributes() { + var _this = this; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + var _loop = function _loop() { + var location = _step4.value; + if ( + !Object.keys(_this.attributes).some(function (key) { + return _this.attributes[key].location === location; + }) + ) { + _this._renderer.GL.disableVertexAttribArray(location); + _this._renderer.registerEnabled.delete(location); + } + }; + for ( + var _iterator4 = this._renderer.registerEnabled + .values() + [Symbol.iterator](), + _step4; + !(_iteratorNormalCompletion4 = (_step4 = + _iterator4.next()).done); + _iteratorNormalCompletion4 = true + ) { + _loop(); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion4 && + _iterator4.return != null + ) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + }, + }, + ]); + return _class; + })(); + var _default = _main.default.Shader; + exports.default = _default; + }, + { + "../core/main": 298, + "core-js/modules/es.array.index-of": 178, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.array.slice": 183, + "core-js/modules/es.array.some": 184, + "core-js/modules/es.function.name": 186, + "core-js/modules/es.object.keys": 199, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 357: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.get-prototype-of"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.reflect.construct"); + _dereq_("core-js/modules/es.regexp.to-string"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.typed-array.uint8-array"); + _dereq_("core-js/modules/es.typed-array.copy-within"); + _dereq_("core-js/modules/es.typed-array.every"); + _dereq_("core-js/modules/es.typed-array.fill"); + _dereq_("core-js/modules/es.typed-array.filter"); + _dereq_("core-js/modules/es.typed-array.find"); + _dereq_("core-js/modules/es.typed-array.find-index"); + _dereq_("core-js/modules/es.typed-array.for-each"); + _dereq_("core-js/modules/es.typed-array.includes"); + _dereq_("core-js/modules/es.typed-array.index-of"); + _dereq_("core-js/modules/es.typed-array.iterator"); + _dereq_("core-js/modules/es.typed-array.join"); + _dereq_("core-js/modules/es.typed-array.last-index-of"); + _dereq_("core-js/modules/es.typed-array.map"); + _dereq_("core-js/modules/es.typed-array.reduce"); + _dereq_("core-js/modules/es.typed-array.reduce-right"); + _dereq_("core-js/modules/es.typed-array.reverse"); + _dereq_("core-js/modules/es.typed-array.set"); + _dereq_("core-js/modules/es.typed-array.slice"); + _dereq_("core-js/modules/es.typed-array.some"); + _dereq_("core-js/modules/es.typed-array.sort"); + _dereq_("core-js/modules/es.typed-array.subarray"); + _dereq_("core-js/modules/es.typed-array.to-locale-string"); + _dereq_("core-js/modules/es.typed-array.to-string"); + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.checkWebGLCapabilities = checkWebGLCapabilities; + exports.default = exports.MipmapTexture = void 0; + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError( + "Super expression must either be null or a function", + ); + } + subClass.prototype = Object.create( + superClass && superClass.prototype, + { + constructor: { + value: subClass, + writable: true, + configurable: true, + }, + }, + ); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if ( + call && + (_typeof(call) === "object" || typeof call === "function") + ) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * This module defines the p5.Texture class + * @module 3D + * @submodule Material + * @for p5 + * @requires core + */ + /** + * Texture class for WEBGL Mode + * @private + * @class p5.Texture + * @param {p5.RendererGL} renderer an instance of p5.RendererGL that + * will provide the GL context for this new p5.Texture + * @param {p5.Image|p5.Graphics|p5.Element|p5.MediaElement|ImageData|p5.Framebuffer|p5.FramebufferTexture|ImageData} [obj] the + * object containing the image data to store in the texture. + * @param {Object} [settings] optional A javascript object containing texture + * settings. + * @param {Number} [settings.format] optional The internal color component + * format for the texture. Possible values for format include gl.RGBA, + * gl.RGB, gl.ALPHA, gl.LUMINANCE, gl.LUMINANCE_ALPHA. Defaults to gl.RBGA + * @param {Number} [settings.minFilter] optional The texture minification + * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults + * to gl.LINEAR. Note, Mipmaps are not implemented in p5. + * @param {Number} [settings.magFilter] optional The texture magnification + * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults + * to gl.LINEAR. Note, Mipmaps are not implemented in p5. + * @param {Number} [settings.wrapS] optional The texture wrap settings for + * the s coordinate, or x axis. Possible values are gl.CLAMP_TO_EDGE, + * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available + * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE + * @param {Number} [settings.wrapT] optional The texture wrap settings for + * the t coordinate, or y axis. Possible values are gl.CLAMP_TO_EDGE, + * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available + * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE + * @param {Number} [settings.dataType] optional The data type of the texel + * data. Possible values are gl.UNSIGNED_BYTE or gl.FLOAT. There are more + * formats that are not implemented in p5. Defaults to gl.UNSIGNED_BYTE. + */ + + _main.default.Texture = /*#__PURE__*/ (function () { + function Texture(renderer, obj, settings) { + _classCallCheck(this, Texture); + this._renderer = renderer; + var gl = this._renderer.GL; + settings = settings || {}; + this.src = obj; + this.glTex = undefined; + this.glTarget = gl.TEXTURE_2D; + this.glFormat = settings.format || gl.RGBA; + this.mipmaps = false; + this.glMinFilter = settings.minFilter || gl.LINEAR; + this.glMagFilter = settings.magFilter || gl.LINEAR; + this.glWrapS = settings.wrapS || gl.CLAMP_TO_EDGE; + this.glWrapT = settings.wrapT || gl.CLAMP_TO_EDGE; + this.glDataType = settings.dataType || gl.UNSIGNED_BYTE; + var support = checkWebGLCapabilities(renderer); + if (this.glFormat === gl.HALF_FLOAT && !support.halfFloat) { + console.log( + "This device does not support dataType HALF_FLOAT. Falling back to FLOAT.", + ); + this.glDataType = gl.FLOAT; + } + if ( + this.glFormat === gl.HALF_FLOAT && + (this.glMinFilter === gl.LINEAR || + this.glMagFilter === gl.LINEAR) && + !support.halfFloatLinear + ) { + console.log( + "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", + ); + if (this.glMinFilter === gl.LINEAR) + this.glMinFilter = gl.NEAREST; + if (this.glMagFilter === gl.LINEAR) + this.glMagFilter = gl.NEAREST; + } + if (this.glFormat === gl.FLOAT && !support.float) { + console.log( + "This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE.", + ); + this.glDataType = gl.UNSIGNED_BYTE; + } + if ( + this.glFormat === gl.FLOAT && + (this.glMinFilter === gl.LINEAR || + this.glMagFilter === gl.LINEAR) && + !support.floatLinear + ) { + console.log( + "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", + ); + if (this.glMinFilter === gl.LINEAR) + this.glMinFilter = gl.NEAREST; + if (this.glMagFilter === gl.LINEAR) + this.glMagFilter = gl.NEAREST; + } // used to determine if this texture might need constant updating + // because it is a video or gif. + + this.isSrcMediaElement = + typeof _main.default.MediaElement !== "undefined" && + obj instanceof _main.default.MediaElement; + this._videoPrevUpdateTime = 0; + this.isSrcHTMLElement = + typeof _main.default.Element !== "undefined" && + obj instanceof _main.default.Element && + !(obj instanceof _main.default.Graphics) && + !(obj instanceof _main.default.Renderer); + this.isSrcP5Image = obj instanceof _main.default.Image; + this.isSrcP5Graphics = obj instanceof _main.default.Graphics; + this.isSrcP5Renderer = obj instanceof _main.default.Renderer; + this.isImageData = + typeof ImageData !== "undefined" && obj instanceof ImageData; + this.isFramebufferTexture = + obj instanceof _main.default.FramebufferTexture; + var textureData = this._getTextureDataFromSource(); + this.width = textureData.width; + this.height = textureData.height; + this.init(textureData); + return this; + } + _createClass(Texture, [ + { + key: "_getTextureDataFromSource", + value: function _getTextureDataFromSource() { + var textureData; + if (this.isFramebufferTexture) { + textureData = this.src.rawTexture(); + } else if (this.isSrcP5Image) { + // param is a p5.Image + textureData = this.src.canvas; + } else if ( + this.isSrcMediaElement || + this.isSrcP5Graphics || + this.isSrcP5Renderer || + this.isSrcHTMLElement + ) { + // if param is a video HTML element + textureData = this.src.elt; + } else if (this.isImageData) { + textureData = this.src; + } + return textureData; + } /** + * Initializes common texture parameters, creates a gl texture, + * tries to upload the texture for the first time if data is + * already available. + * @private + * @method init + */, + }, + { + key: "init", + value: function init(data) { + var gl = this._renderer.GL; + if (!this.isFramebufferTexture) { + this.glTex = gl.createTexture(); + } + this.glWrapS = this._renderer.textureWrapX; + this.glWrapT = this._renderer.textureWrapY; + this.setWrapMode(this.glWrapS, this.glWrapT); + this.bindTexture(); + //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_MAG_FILTER, + this.glMagFilter, + ); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_MIN_FILTER, + this.glMinFilter, + ); + if (this.isFramebufferTexture) { + // Do nothing, the framebuffer manages its own content + } else if ( + this.width === 0 || + this.height === 0 || + (this.isSrcMediaElement && !this.src.loadedmetadata) + ) { + // assign a 1×1 empty texture initially, because data is not yet ready, + // so that no errors occur in gl console! + var tmpdata = new Uint8Array([1, 1, 1, 1]); + gl.texImage2D( + this.glTarget, + 0, + gl.RGBA, + 1, + 1, + 0, + this.glFormat, + this.glDataType, + tmpdata, + ); + } else { + // data is ready: just push the texture! + gl.texImage2D( + this.glTarget, + 0, + this.glFormat, + this.glFormat, + this.glDataType, + data, + ); + } + } /** + * Checks if the source data for this texture has changed (if it's + * easy to do so) and reuploads the texture if necessary. If it's not + * possible or to expensive to do a calculation to determine wheter or + * not the data has occurred, this method simply re-uploads the texture. + * @method update + */, + }, + { + key: "update", + value: function update() { + var data = this.src; + if (data.width === 0 || data.height === 0) { + return false; // nothing to do! + } // FramebufferTexture instances wrap raw WebGL textures already, which + // don't need any extra updating, as they already live on the GPU + + if (this.isFramebufferTexture) { + return false; + } + var textureData = this._getTextureDataFromSource(); + var updated = false; + var gl = this._renderer.GL; + // pull texture from data, make sure width & height are appropriate + if ( + textureData.width !== this.width || + textureData.height !== this.height + ) { + updated = true; + // make sure that if the width and height of this.src have changed + // for some reason, we update our metadata and upload the texture again + this.width = textureData.width || data.width; + this.height = textureData.height || data.height; + if (this.isSrcP5Image) { + data.setModified(false); + } else if ( + this.isSrcMediaElement || + this.isSrcHTMLElement + ) { + // on the first frame the metadata comes in, the size will be changed + // from 0 to actual size, but pixels may not be available. + // flag for update in a future frame. + // if we don't do this, a paused video, for example, may not + // send the first frame to texture memory. + data.setModified(true); + } + } else if (this.isSrcP5Image) { + // for an image, we only update if the modified field has been set, + // for example, by a call to p5.Image.set + if (data.isModified()) { + updated = true; + data.setModified(false); + } + } else if (this.isSrcMediaElement) { + // for a media element (video), we'll check if the current time in + // the video frame matches the last time. if it doesn't match, the + // video has advanced or otherwise been taken to a new frame, + // and we need to upload it. + if (data.isModified()) { + // p5.MediaElement may have also had set/updatePixels, etc. called + // on it and should be updated, or may have been set for the first + // time! + updated = true; + data.setModified(false); + } else if (data.loadedmetadata) { + // if the meta data has been loaded, we can ask the video + // what it's current position (in time) is. + if (this._videoPrevUpdateTime !== data.time()) { + // update the texture in gpu mem only if the current + // video timestamp does not match the timestamp of the last + // time we uploaded this texture (and update the time we + // last uploaded, too) + this._videoPrevUpdateTime = data.time(); + updated = true; + } + } + } else if (this.isImageData) { + if (data._dirty) { + data._dirty = false; + updated = true; + } + } else { + /* data instanceof p5.Graphics, probably */ + // there is not enough information to tell if the texture can be + // conditionally updated; so to be safe, we just go ahead and upload it. + updated = true; + } + if (updated) { + this.bindTexture(); + gl.texImage2D( + this.glTarget, + 0, + this.glFormat, + this.glFormat, + this.glDataType, + textureData, + ); + } + return updated; + } /** + * Binds the texture to the appropriate GL target. + * @method bindTexture + */, + }, + { + key: "bindTexture", + value: function bindTexture() { + // bind texture using gl context + glTarget and + // generated gl texture object + var gl = this._renderer.GL; + gl.bindTexture(this.glTarget, this.getTexture()); + return this; + } /** + * Unbinds the texture from the appropriate GL target. + * @method unbindTexture + */, + }, + { + key: "unbindTexture", + value: function unbindTexture() { + // unbind per above, disable texturing on glTarget + var gl = this._renderer.GL; + gl.bindTexture(this.glTarget, null); + }, + }, + { + key: "getTexture", + value: function getTexture() { + if (this.isFramebufferTexture) { + return this.src.rawTexture(); + } else { + return this.glTex; + } + } /** + * Sets how a texture is be interpolated when upscaled or downscaled. + * Nearest filtering uses nearest neighbor scaling when interpolating + * Linear filtering uses WebGL's linear scaling when interpolating + * @method setInterpolation + * @param {String} downScale Specifies the texture filtering when + * textures are shrunk. Options are LINEAR or NEAREST + * @param {String} upScale Specifies the texture filtering when + * textures are magnified. Options are LINEAR or NEAREST + * @todo implement mipmapping filters + */, + }, + { + key: "setInterpolation", + value: function setInterpolation(downScale, upScale) { + var gl = this._renderer.GL; + this.glMinFilter = this.glFilter(downScale); + this.glMagFilter = this.glFilter(upScale); + this.bindTexture(); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_MIN_FILTER, + this.glMinFilter, + ); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_MAG_FILTER, + this.glMagFilter, + ); + this.unbindTexture(); + }, + }, + { + key: "glFilter", + value: function glFilter(filter) { + var gl = this._renderer.GL; + if (filter === constants.NEAREST) { + return gl.NEAREST; + } else { + return gl.LINEAR; + } + } /** + * Sets the texture wrapping mode. This controls how textures behave + * when their uv's go outside of the 0 - 1 range. There are three options: + * CLAMP, REPEAT, and MIRROR. REPEAT & MIRROR are only available if the texture + * is a power of two size (128, 256, 512, 1024, etc.). + * @method setWrapMode + * @param {String} wrapX Controls the horizontal texture wrapping behavior + * @param {String} wrapY Controls the vertical texture wrapping behavior + */, + }, + { + key: "setWrapMode", + value: function setWrapMode(wrapX, wrapY) { + var gl = this._renderer.GL; + // for webgl 1 we need to check if the texture is power of two + // if it isn't we will set the wrap mode to CLAMP + // webgl2 will support npot REPEAT and MIRROR but we don't check for it yet + var isPowerOfTwo = function isPowerOfTwo(x) { + return (x & (x - 1)) === 0; + }; + var textureData = this._getTextureDataFromSource(); + var wrapWidth; + var wrapHeight; + if (textureData.naturalWidth && textureData.naturalHeight) { + wrapWidth = textureData.naturalWidth; + wrapHeight = textureData.naturalHeight; + } else { + wrapWidth = this.width; + wrapHeight = this.height; + } + var widthPowerOfTwo = isPowerOfTwo(wrapWidth); + var heightPowerOfTwo = isPowerOfTwo(wrapHeight); + if (wrapX === constants.REPEAT) { + if ( + this._renderer.webglVersion === constants.WEBGL2 || + (widthPowerOfTwo && heightPowerOfTwo) + ) { + this.glWrapS = gl.REPEAT; + } else { + console.warn( + "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", + ); + this.glWrapS = gl.CLAMP_TO_EDGE; + } + } else if (wrapX === constants.MIRROR) { + if ( + this._renderer.webglVersion === constants.WEBGL2 || + (widthPowerOfTwo && heightPowerOfTwo) + ) { + this.glWrapS = gl.MIRRORED_REPEAT; + } else { + console.warn( + "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", + ); + this.glWrapS = gl.CLAMP_TO_EDGE; + } + } else { + // falling back to default if didn't get a proper mode + this.glWrapS = gl.CLAMP_TO_EDGE; + } + if (wrapY === constants.REPEAT) { + if ( + this._renderer.webglVersion === constants.WEBGL2 || + (widthPowerOfTwo && heightPowerOfTwo) + ) { + this.glWrapT = gl.REPEAT; + } else { + console.warn( + "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", + ); + this.glWrapT = gl.CLAMP_TO_EDGE; + } + } else if (wrapY === constants.MIRROR) { + if ( + this._renderer.webglVersion === constants.WEBGL2 || + (widthPowerOfTwo && heightPowerOfTwo) + ) { + this.glWrapT = gl.MIRRORED_REPEAT; + } else { + console.warn( + "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", + ); + this.glWrapT = gl.CLAMP_TO_EDGE; + } + } else { + // falling back to default if didn't get a proper mode + this.glWrapT = gl.CLAMP_TO_EDGE; + } + this.bindTexture(); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_WRAP_S, + this.glWrapS, + ); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_WRAP_T, + this.glWrapT, + ); + this.unbindTexture(); + }, + }, + ]); + return Texture; + })(); + var MipmapTexture = /*#__PURE__*/ (function (_p5$Texture) { + _inherits(MipmapTexture, _p5$Texture); + var _super = _createSuper(MipmapTexture); + function MipmapTexture(renderer, levels, settings) { + var _this; + _classCallCheck(this, MipmapTexture); + _this = _super.call(this, renderer, levels, settings); + var gl = _this._renderer.GL; + if (_this.glMinFilter === gl.LINEAR) { + _this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; + } + return _this; + } + _createClass(MipmapTexture, [ + { + key: "glFilter", + value: function glFilter(_filter) { + var gl = this._renderer.GL; + // TODO: support others + return gl.LINEAR_MIPMAP_LINEAR; + }, + }, + { + key: "_getTextureDataFromSource", + value: function _getTextureDataFromSource() { + return this.src; + }, + }, + { + key: "init", + value: function init(levels) { + var gl = this._renderer.GL; + this.glTex = gl.createTexture(); + this.bindTexture(); + for (var level = 0; level < levels.length; level++) { + gl.texImage2D( + this.glTarget, + level, + this.glFormat, + this.glFormat, + this.glDataType, + levels[level], + ); + } + this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_MAG_FILTER, + this.glMagFilter, + ); + gl.texParameteri( + gl.TEXTURE_2D, + gl.TEXTURE_MIN_FILTER, + this.glMinFilter, + ); + this.unbindTexture(); + }, + }, + { + key: "update", + value: function update() {}, + }, + ]); + return MipmapTexture; + })(_main.default.Texture); + exports.MipmapTexture = MipmapTexture; + function checkWebGLCapabilities(_ref) { + var GL = _ref.GL, + webglVersion = _ref.webglVersion; + var gl = GL; + var supportsFloat = + webglVersion === constants.WEBGL2 + ? gl.getExtension("EXT_color_buffer_float") && + gl.getExtension("EXT_float_blend") + : gl.getExtension("OES_texture_float"); + var supportsFloatLinear = + supportsFloat && gl.getExtension("OES_texture_float_linear"); + var supportsHalfFloat = + webglVersion === constants.WEBGL2 + ? gl.getExtension("EXT_color_buffer_float") + : gl.getExtension("OES_texture_half_float"); + var supportsHalfFloatLinear = + supportsHalfFloat && + gl.getExtension("OES_texture_half_float_linear"); + return { + float: supportsFloat, + floatLinear: supportsFloatLinear, + halfFloat: supportsHalfFloat, + halfFloatLinear: supportsHalfFloatLinear, + }; + } + var _default = _main.default.Texture; + exports.default = _default; + }, + { + "../core/constants": 286, + "../core/main": 298, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.get-prototype-of": 198, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.reflect.construct": 202, + "core-js/modules/es.regexp.to-string": 206, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.typed-array.copy-within": 223, + "core-js/modules/es.typed-array.every": 224, + "core-js/modules/es.typed-array.fill": 225, + "core-js/modules/es.typed-array.filter": 226, + "core-js/modules/es.typed-array.find": 228, + "core-js/modules/es.typed-array.find-index": 227, + "core-js/modules/es.typed-array.for-each": 231, + "core-js/modules/es.typed-array.includes": 232, + "core-js/modules/es.typed-array.index-of": 233, + "core-js/modules/es.typed-array.iterator": 236, + "core-js/modules/es.typed-array.join": 237, + "core-js/modules/es.typed-array.last-index-of": 238, + "core-js/modules/es.typed-array.map": 239, + "core-js/modules/es.typed-array.reduce": 241, + "core-js/modules/es.typed-array.reduce-right": 240, + "core-js/modules/es.typed-array.reverse": 242, + "core-js/modules/es.typed-array.set": 243, + "core-js/modules/es.typed-array.slice": 244, + "core-js/modules/es.typed-array.some": 245, + "core-js/modules/es.typed-array.sort": 246, + "core-js/modules/es.typed-array.subarray": 247, + "core-js/modules/es.typed-array.to-locale-string": 248, + "core-js/modules/es.typed-array.to-string": 249, + "core-js/modules/es.typed-array.uint8-array": 252, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 358: [ + function (_dereq_, module, exports) { + "use strict"; + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.get-own-property-descriptor"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.sub"); + _dereq_("core-js/modules/es.weak-map"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + function _typeof2(obj) { + if ( + typeof Symbol === "function" && + typeof Symbol.iterator === "symbol" + ) { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if ( + typeof Symbol === "function" && + _typeof2(Symbol.iterator) === "symbol" + ) { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && + typeof Symbol === "function" && + obj.constructor === Symbol && + obj !== Symbol.prototype + ? "symbol" + : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_("core-js/modules/es.symbol"); + _dereq_("core-js/modules/es.symbol.description"); + _dereq_("core-js/modules/es.symbol.iterator"); + _dereq_("core-js/modules/es.array.iterator"); + _dereq_("core-js/modules/es.object.to-string"); + _dereq_("core-js/modules/es.regexp.exec"); + _dereq_("core-js/modules/es.string.iterator"); + _dereq_("core-js/modules/es.string.split"); + _dereq_("core-js/modules/es.string.sub"); + _dereq_("core-js/modules/web.dom-collections.iterator"); + var _main = _interopRequireDefault(_dereq_("../core/main")); + var constants = _interopRequireWildcard(_dereq_("../core/constants")); + _dereq_("./p5.Shader"); + _dereq_("./p5.RendererGL.Retained"); + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if ( + obj === null || + (_typeof(obj) !== "object" && typeof obj !== "function") + ) { + return { + default: obj, + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } // Text/Typography + // @TODO: + + _main.default.RendererGL.prototype._applyTextProperties = + function () { + //@TODO finish implementation + //console.error('text commands not yet implemented in webgl'); + }; + _main.default.RendererGL.prototype.textWidth = function (s) { + if (this._isOpenType()) { + return this._textFont._textWidth(s, this._textSize); + } + return 0; // TODO: error + }; + // rendering constants + // the number of rows/columns dividing each glyph + var charGridWidth = 9; + var charGridHeight = charGridWidth; + // size of the image holding the bezier stroke info + var strokeImageWidth = 64; + var strokeImageHeight = 64; + // size of the image holding the stroke indices for each row/col + var gridImageWidth = 64; + var gridImageHeight = 64; + // size of the image holding the offset/length of each row/col stripe + var cellImageWidth = 64; + var cellImageHeight = 64; + /** + * @private + * @class ImageInfos + * @param {Integer} width + * @param {Integer} height + * + * the ImageInfos class holds a list of ImageDatas of a given size. + */ + var ImageInfos = /*#__PURE__*/ (function () { + function ImageInfos(width, height) { + _classCallCheck(this, ImageInfos); + this.width = width; + this.height = height; + this.infos = []; // the list of images + } /** + * + * @method findImage + * @param {Integer} space + * @return {Object} contains the ImageData, and pixel index into that + * ImageData where the free space was allocated. + * + * finds free space of a given size in the ImageData list + */ + + _createClass(ImageInfos, [ + { + key: "findImage", + value: function findImage(space) { + var imageSize = this.width * this.height; + if (space > imageSize) + throw new Error("font is too complex to render in 3D"); + // search through the list of images, looking for one with + // anough unused space. + var imageInfo, imageData; + for (var ii = this.infos.length - 1; ii >= 0; --ii) { + var imageInfoTest = this.infos[ii]; + if (imageInfoTest.index + space < imageSize) { + // found one + imageInfo = imageInfoTest; + imageData = imageInfoTest.imageData; + break; + } + } + if (!imageInfo) { + try { + // create a new image + imageData = new ImageData(this.width, this.height); + } catch (err) { + // for browsers that don't support ImageData constructors (ie IE11) + // create an ImageData using the old method + var canvas = document.getElementsByTagName("canvas")[0]; + var created = !canvas; + if (!canvas) { + // create a temporary canvas + canvas = document.createElement("canvas"); + canvas.style.display = "none"; + document.body.appendChild(canvas); + } + var ctx = canvas.getContext("2d"); + if (ctx) { + imageData = ctx.createImageData( + this.width, + this.height, + ); + } + if (created) { + // distroy the temporary canvas, if necessary + document.body.removeChild(canvas); + } + } // construct & dd the new image info + + imageInfo = { + index: 0, + imageData: imageData, + }; + this.infos.push(imageInfo); + } + var index = imageInfo.index; + imageInfo.index += space; // move to the start of the next image + imageData._dirty = true; + return { + imageData: imageData, + index: index, + }; + }, + }, + ]); + return ImageInfos; + })(); + /** + * @function setPixel + * @param {Object} imageInfo + * @param {Number} r + * @param {Number} g + * @param {Number} b + * @param {Number} a + * + * writes the next pixel into an indexed ImageData + */ + function setPixel(imageInfo, r, g, b, a) { + var imageData = imageInfo.imageData; + var pixels = imageData.data; + var index = imageInfo.index++ * 4; + pixels[index++] = r; + pixels[index++] = g; + pixels[index++] = b; + pixels[index++] = a; + } + var SQRT3 = Math.sqrt(3); + /** + * @private + * @class FontInfo + * @param {Object} font an opentype.js font object + * + * contains cached images and glyph information for an opentype font + */ + var FontInfo = /*#__PURE__*/ (function () { + function FontInfo(font) { + _classCallCheck(this, FontInfo); + this.font = font; + // the bezier curve coordinates + this.strokeImageInfos = new ImageInfos( + strokeImageWidth, + strokeImageHeight, + ); + // lists of curve indices for each row/column slice + this.colDimImageInfos = new ImageInfos( + gridImageWidth, + gridImageHeight, + ); + this.rowDimImageInfos = new ImageInfos( + gridImageWidth, + gridImageHeight, + ); + // the offset & length of each row/col slice in the glyph + this.colCellImageInfos = new ImageInfos( + cellImageWidth, + cellImageHeight, + ); + this.rowCellImageInfos = new ImageInfos( + cellImageWidth, + cellImageHeight, + ); + // the cached information for each glyph + this.glyphInfos = {}; + } /** + * @method getGlyphInfo + * @param {Glyph} glyph the x positions of points in the curve + * @returns {Object} the glyphInfo for that glyph + * + * calculates rendering info for a glyph, including the curve information, + * row & column stripes compiled into textures. + */ + + _createClass(FontInfo, [ + { + key: "getGlyphInfo", + value: function getGlyphInfo(glyph) { + // check the cache + var gi = this.glyphInfos[glyph.index]; + if (gi) return gi; + // get the bounding box of the glyph from opentype.js + var bb = glyph.getBoundingBox(); + var xMin = bb.x1; + var yMin = bb.y1; + var gWidth = bb.x2 - xMin; + var gHeight = bb.y2 - yMin; + var cmds = glyph.path.commands; + // don't bother rendering invisible glyphs + if (gWidth === 0 || gHeight === 0 || !cmds.length) { + return (this.glyphInfos[glyph.index] = {}); + } + var i; + var strokes = []; // the strokes in this glyph + var rows = []; // the indices of strokes in each row + var cols = []; // the indices of strokes in each column + for (i = charGridWidth - 1; i >= 0; --i) { + cols.push([]); + } + for (i = charGridHeight - 1; i >= 0; --i) { + rows.push([]); + } /** + * @function push + * @param {Number[]} xs the x positions of points in the curve + * @param {Number[]} ys the y positions of points in the curve + * @param {Object} v the curve information + * + * adds a curve to the rows & columns that it intersects with + */ + + function push(xs, ys, v) { + var index = strokes.length; // the index of this stroke + strokes.push(v); // add this stroke to the list + /** + * @function minMax + * @param {Number[]} rg the list of values to compare + * @param {Number} min the initial minimum value + * @param {Number} max the initial maximum value + * + * find the minimum & maximum value in a list of values + */ + function minMax(rg, min, max) { + for (var _i = rg.length; _i-- > 0; ) { + var _v = rg[_i]; + if (min > _v) min = _v; + if (max < _v) max = _v; + } + return { + min: min, + max: max, + }; + } // Expand the bounding box of the glyph by the number of cells below + // before rounding. Curves only partially through a cell won't be added + // to adjacent cells, but ones that are close will be. This helps fix + // small visual glitches that occur when curves are close to grid cell + // boundaries. + + var cellOffset = 0.5; + // loop through the rows & columns that the curve intersects + // adding the curve to those slices + var mmX = minMax(xs, 1, 0); + var ixMin = Math.max( + Math.floor(mmX.min * charGridWidth - cellOffset), + 0, + ); + var ixMax = Math.min( + Math.ceil(mmX.max * charGridWidth + cellOffset), + charGridWidth, + ); + for (var iCol = ixMin; iCol < ixMax; ++iCol) { + cols[iCol].push(index); + } + var mmY = minMax(ys, 1, 0); + var iyMin = Math.max( + Math.floor(mmY.min * charGridHeight - cellOffset), + 0, + ); + var iyMax = Math.min( + Math.ceil(mmY.max * charGridHeight + cellOffset), + charGridHeight, + ); + for (var iRow = iyMin; iRow < iyMax; ++iRow) { + rows[iRow].push(index); + } + } /** + * @function clamp + * @param {Number} v the value to clamp + * @param {Number} min the minimum value + * @param {Number} max the maxmimum value + * + * clamps a value between a minimum & maximum value + */ + + function clamp(v, min, max) { + if (v < min) return min; + if (v > max) return max; + return v; + } /** + * @function byte + * @param {Number} v the value to scale + * + * converts a floating-point number in the range 0-1 to a byte 0-255 + */ + + function byte(v) { + return clamp(255 * v, 0, 255); + } /** + * @private + * @class Cubic + * @param {Number} p0 the start point of the curve + * @param {Number} c0 the first control point + * @param {Number} c1 the second control point + * @param {Number} p1 the end point + * + * a cubic curve + */ + + var Cubic = /*#__PURE__*/ (function () { + function Cubic(p0, c0, c1, p1) { + _classCallCheck(this, Cubic); + this.p0 = p0; + this.c0 = c0; + this.c1 = c1; + this.p1 = p1; + } /** + * @method toQuadratic + * @return {Object} the quadratic approximation + * + * converts the cubic to a quadtratic approximation by + * picking an appropriate quadratic control point + */ + + _createClass(Cubic, [ + { + key: "toQuadratic", + value: function toQuadratic() { + return { + x: this.p0.x, + y: this.p0.y, + x1: this.p1.x, + y1: this.p1.y, + cx: + ((this.c0.x + this.c1.x) * 3 - + (this.p0.x + this.p1.x)) / + 4, + cy: + ((this.c0.y + this.c1.y) * 3 - + (this.p0.y + this.p1.y)) / + 4, + }; + } /** + * @method quadError + * @return {Number} the error + * + * calculates the magnitude of error of this curve's + * quadratic approximation. + */, + }, + { + key: "quadError", + value: function quadError() { + return ( + _main.default.Vector.sub( + _main.default.Vector.sub(this.p1, this.p0), + _main.default.Vector.mult( + _main.default.Vector.sub(this.c1, this.c0), + 3, + ), + ).mag() / 2 + ); + } /** + * @method split + * @param {Number} t the value (0-1) at which to split + * @return {Cubic} the second part of the curve + * + * splits the cubic into two parts at a point 't' along the curve. + * this cubic keeps its start point and its end point becomes the + * point at 't'. the 'end half is returned. + */, + }, + { + key: "split", + value: function split(t) { + var m1 = _main.default.Vector.lerp( + this.p0, + this.c0, + t, + ); + var m2 = _main.default.Vector.lerp( + this.c0, + this.c1, + t, + ); + var mm1 = _main.default.Vector.lerp(m1, m2, t); + this.c1 = _main.default.Vector.lerp( + this.c1, + this.p1, + t, + ); + this.c0 = _main.default.Vector.lerp(m2, this.c1, t); + var pt = _main.default.Vector.lerp(mm1, this.c0, t); + var part1 = new Cubic(this.p0, m1, mm1, pt); + this.p0 = pt; + return part1; + } /** + * @method splitInflections + * @return {Cubic[]} the non-inflecting pieces of this cubic + * + * returns an array containing 0, 1 or 2 cubics split resulting + * from splitting this cubic at its inflection points. + * this cubic is (potentially) altered and returned in the list. + */, + }, + { + key: "splitInflections", + value: function splitInflections() { + var a = _main.default.Vector.sub(this.c0, this.p0); + var b = _main.default.Vector.sub( + _main.default.Vector.sub(this.c1, this.c0), + a, + ); + var c = _main.default.Vector.sub( + _main.default.Vector.sub( + _main.default.Vector.sub(this.p1, this.c1), + a, + ), + _main.default.Vector.mult(b, 2), + ); + var cubics = []; + // find the derivative coefficients + var A = b.x * c.y - b.y * c.x; + if (A !== 0) { + var B = a.x * c.y - a.y * c.x; + var C = a.x * b.y - a.y * b.x; + var disc = B * B - 4 * A * C; + if (disc >= 0) { + if (A < 0) { + A = -A; + B = -B; + C = -C; + } + var Q = Math.sqrt(disc); + var t0 = (-B - Q) / (2 * A); // the first inflection point + var t1 = (-B + Q) / (2 * A); // the second inflection point + // test if the first inflection point lies on the curve + if (t0 > 0 && t0 < 1) { + // split at the first inflection point + cubics.push(this.split(t0)); + // scale t2 into the second part + t1 = 1 - (1 - t1) / (1 - t0); + } // test if the second inflection point lies on the curve + + if (t1 > 0 && t1 < 1) { + // split at the second inflection point + cubics.push(this.split(t1)); + } + } + } + cubics.push(this); + return cubics; + }, + }, + ]); + return Cubic; + })(); + /** + * @function cubicToQuadratics + * @param {Number} x0 + * @param {Number} y0 + * @param {Number} cx0 + * @param {Number} cy0 + * @param {Number} cx1 + * @param {Number} cy1 + * @param {Number} x1 + * @param {Number} y1 + * @returns {Cubic[]} an array of cubics whose quadratic approximations + * closely match the civen cubic. + * + * converts a cubic curve to a list of quadratics. + */ + function cubicToQuadratics( + x0, + y0, + cx0, + cy0, + cx1, + cy1, + x1, + y1, + ) { + // create the Cubic object and split it at its inflections + var cubics = new Cubic( + new _main.default.Vector(x0, y0), + new _main.default.Vector(cx0, cy0), + new _main.default.Vector(cx1, cy1), + new _main.default.Vector(x1, y1), + ).splitInflections(); + var qs = []; // the final list of quadratics + var precision = 30 / SQRT3; + // for each of the non-inflected pieces of the original cubic + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for ( + var _iterator = cubics[Symbol.iterator](), _step; + !(_iteratorNormalCompletion = (_step = _iterator.next()) + .done); + _iteratorNormalCompletion = true + ) { + var cubic = _step.value; + // the cubic is iteratively split in 3 pieces: + // the first piece is accumulated in 'qs', the result. + // the last piece is accumulated in 'tail', temporarily. + // the middle piece is repeatedly split again, while necessary. + var tail = []; + var t3 = void 0; + for (;;) { + // calculate this cubic's precision + t3 = precision / cubic.quadError(); + if (t3 >= 0.5 * 0.5 * 0.5) { + break; // not too bad, we're done + } // find a split point based on the error + + var t = Math.pow(t3, 1 / 3); + // split the cubic in 3 + var start = cubic.split(t); + var middle = cubic.split(1 - t / (1 - t)); + qs.push(start); // the first part + tail.push(cubic); // the last part + cubic = middle; // iterate on the middle piece + } + if (t3 < 1) { + // a little excess error, split the middle in two + qs.push(cubic.split(0.5)); + } // add the middle piece to the result + + qs.push(cubic); + // finally add the tail, reversed, onto the result + Array.prototype.push.apply(qs, tail.reverse()); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if ( + !_iteratorNormalCompletion && + _iterator.return != null + ) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return qs; + } /** + * @function pushLine + * @param {Number} x0 + * @param {Number} y0 + * @param {Number} x1 + * @param {Number} y1 + * + * add a straight line to the row/col grid of a glyph + */ + + function pushLine(x0, y0, x1, y1) { + var mx = (x0 + x1) / 2; + var my = (y0 + y1) / 2; + push([x0, x1], [y0, y1], { + x: x0, + y: y0, + cx: mx, + cy: my, + }); + } /** + * @function samePoint + * @param {Number} x0 + * @param {Number} y0 + * @param {Number} x1 + * @param {Number} y1 + * @return {Boolean} true if the two points are sufficiently close + * + * tests if two points are close enough to be considered the same + */ + + function samePoint(x0, y0, x1, y1) { + return ( + Math.abs(x1 - x0) < 0.00001 && Math.abs(y1 - y0) < 0.00001 + ); + } + var x0, y0, xs, ys; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for ( + var _iterator2 = cmds[Symbol.iterator](), _step2; + !(_iteratorNormalCompletion2 = (_step2 = + _iterator2.next()).done); + _iteratorNormalCompletion2 = true + ) { + var cmd = _step2.value; + // scale the coordinates to the range 0-1 + var x1 = (cmd.x - xMin) / gWidth; + var y1 = (cmd.y - yMin) / gHeight; + // don't bother if this point is the same as the last + if (samePoint(x0, y0, x1, y1)) continue; + switch (cmd.type) { + case "M": { + // move + xs = x1; + ys = y1; + break; + } + case "L": { + // line + pushLine(x0, y0, x1, y1); + break; + } + case "Q": { + // quadratic + var cx = (cmd.x1 - xMin) / gWidth; + var cy = (cmd.y1 - yMin) / gHeight; + push([x0, x1, cx], [y0, y1, cy], { + x: x0, + y: y0, + cx: cx, + cy: cy, + }); + break; + } + case "Z": { + // end + if (!samePoint(x0, y0, xs, ys)) { + // add an extra line closing the loop, if necessary + pushLine(x0, y0, xs, ys); + strokes.push({ + x: xs, + y: ys, + }); + } else { + strokes.push({ + x: x0, + y: y0, + }); + } + break; + } + case "C": { + // cubic + var cx1 = (cmd.x1 - xMin) / gWidth; + var cy1 = (cmd.y1 - yMin) / gHeight; + var cx2 = (cmd.x2 - xMin) / gWidth; + var cy2 = (cmd.y2 - yMin) / gHeight; + var qs = cubicToQuadratics( + x0, + y0, + cx1, + cy1, + cx2, + cy2, + x1, + y1, + ); + for (var iq = 0; iq < qs.length; iq++) { + var q = qs[iq].toQuadratic(); + push([q.x, q.x1, q.cx], [q.y, q.y1, q.cy], q); + } + break; + } + default: + throw new Error( + "unknown command type: ".concat(cmd.type), + ); + } + x0 = x1; + y0 = y1; + } // allocate space for the strokes + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion2 && + _iterator2.return != null + ) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + var strokeCount = strokes.length; + var strokeImageInfo = + this.strokeImageInfos.findImage(strokeCount); + var strokeOffset = strokeImageInfo.index; + // fill the stroke image + for (var il = 0; il < strokeCount; ++il) { + var s = strokes[il]; + setPixel( + strokeImageInfo, + byte(s.x), + byte(s.y), + byte(s.cx), + byte(s.cy), + ); + } /** + * @function layout + * @param {Number[][]} dim + * @param {ImageInfo[]} dimImageInfos + * @param {ImageInfo[]} cellImageInfos + * @return {Object} + * + * lays out the curves in a dimension (row or col) into two + * images, one for the indices of the curves themselves, and + * one containing the offset and length of those index spans. + */ + + function layout(dim, dimImageInfos, cellImageInfos) { + var dimLength = dim.length; // the number of slices in this dimension + var dimImageInfo = dimImageInfos.findImage(dimLength); + var dimOffset = dimImageInfo.index; + // calculate the total number of stroke indices in this dimension + var totalStrokes = 0; + for (var id = 0; id < dimLength; ++id) { + totalStrokes += dim[id].length; + } // allocate space for the stroke indices + + var cellImageInfo = cellImageInfos.findImage(totalStrokes); + // for each slice in the glyph + for (var _i2 = 0; _i2 < dimLength; ++_i2) { + var strokeIndices = dim[_i2]; + var _strokeCount = strokeIndices.length; + var cellLineIndex = cellImageInfo.index; + // write the offset and count into the glyph slice image + setPixel( + dimImageInfo, + cellLineIndex >> 7, + cellLineIndex & 127, + _strokeCount >> 7, + _strokeCount & 127, + ); + // for each stroke index in that slice + for (var iil = 0; iil < _strokeCount; ++iil) { + // write the stroke index into the slice's image + var strokeIndex = strokeIndices[iil] + strokeOffset; + setPixel( + cellImageInfo, + strokeIndex >> 7, + strokeIndex & 127, + 0, + 0, + ); + } + } + return { + cellImageInfo: cellImageInfo, + dimOffset: dimOffset, + dimImageInfo: dimImageInfo, + }; + } // initialize the info for this glyph + + gi = this.glyphInfos[glyph.index] = { + glyph: glyph, + uGlyphRect: [bb.x1, -bb.y1, bb.x2, -bb.y2], + strokeImageInfo: strokeImageInfo, + strokes: strokes, + colInfo: layout( + cols, + this.colDimImageInfos, + this.colCellImageInfos, + ), + rowInfo: layout( + rows, + this.rowDimImageInfos, + this.rowCellImageInfos, + ), + }; + gi.uGridOffset = [gi.colInfo.dimOffset, gi.rowInfo.dimOffset]; + return gi; + }, + }, + ]); + return FontInfo; + })(); + _main.default.RendererGL.prototype._renderText = function ( + p, + line, + x, + y, + maxY, + ) { + if (!this._textFont || typeof this._textFont === "string") { + console.log( + "WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.", + ); + return; + } + if (y >= maxY || !this._doFill) { + return; // don't render lines beyond our maxY position + } + if (!this._isOpenType()) { + console.log( + "WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported", + ); + return p; + } + p.push(); // fix to #803 + // remember this state, so it can be restored later + var doStroke = this._doStroke; + var drawMode = this.drawMode; + this._doStroke = false; + this.drawMode = constants.TEXTURE; + // get the cached FontInfo object + var font = this._textFont.font; + var fontInfo = this._textFont._fontInfo; + if (!fontInfo) { + fontInfo = this._textFont._fontInfo = new FontInfo(font); + } // calculate the alignment and move/scale the view accordingly + + var pos = this._textFont._handleAlignment(this, line, x, y); + var fontSize = this._textSize; + var scale = fontSize / font.unitsPerEm; + this.translate(pos.x, pos.y, 0); + this.scale(scale, scale, 1); + // initialize the font shader + var gl = this.GL; + var initializeShader = !this._defaultFontShader; + var sh = this._getFontShader(); + sh.init(); + sh.bindShader(); // first time around, bind the shader fully + if (initializeShader) { + // these are constants, really. just initialize them one-time. + sh.setUniform("uGridImageSize", [ + gridImageWidth, + gridImageHeight, + ]); + sh.setUniform("uCellsImageSize", [ + cellImageWidth, + cellImageHeight, + ]); + sh.setUniform("uStrokeImageSize", [ + strokeImageWidth, + strokeImageHeight, + ]); + sh.setUniform("uGridSize", [charGridWidth, charGridHeight]); + } + this._applyColorBlend(this.curFillColor); + var g = this.retainedMode.geometry["glyph"]; + if (!g) { + // create the geometry for rendering a quad + var geom = (this._textGeom = new _main.default.Geometry( + 1, + 1, + function () { + for (var i = 0; i <= 1; i++) { + for (var j = 0; j <= 1; j++) { + this.vertices.push(new _main.default.Vector(j, i, 0)); + this.uvs.push(j, i); + } + } + }, + )); + geom.computeFaces().computeNormals(); + g = this.createBuffers("glyph", geom); + } // bind the shader buffers + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for ( + var _iterator3 = + this.retainedMode.buffers.text[Symbol.iterator](), + _step3; + !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) + .done); + _iteratorNormalCompletion3 = true + ) { + var buff = _step3.value; + buff._prepareBuffer(g, sh); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + this._bindBuffer(g.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); + // this will have to do for now... + sh.setUniform("uMaterialColor", this.curFillColor); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + try { + var dx = 0; // the x position in the line + var glyphPrev = null; // the previous glyph, used for kerning + // fetch the glyphs in the line of text + var glyphs = font.stringToGlyphs(line); + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for ( + var _iterator4 = glyphs[Symbol.iterator](), _step4; + !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()) + .done); + _iteratorNormalCompletion4 = true + ) { + var glyph = _step4.value; + // kern + if (glyphPrev) dx += font.getKerningValue(glyphPrev, glyph); + var gi = fontInfo.getGlyphInfo(glyph); + if (gi.uGlyphRect) { + var rowInfo = gi.rowInfo; + var colInfo = gi.colInfo; + sh.setUniform( + "uSamplerStrokes", + gi.strokeImageInfo.imageData, + ); + sh.setUniform( + "uSamplerRowStrokes", + rowInfo.cellImageInfo.imageData, + ); + sh.setUniform( + "uSamplerRows", + rowInfo.dimImageInfo.imageData, + ); + sh.setUniform( + "uSamplerColStrokes", + colInfo.cellImageInfo.imageData, + ); + sh.setUniform( + "uSamplerCols", + colInfo.dimImageInfo.imageData, + ); + sh.setUniform("uGridOffset", gi.uGridOffset); + sh.setUniform("uGlyphRect", gi.uGlyphRect); + sh.setUniform("uGlyphOffset", dx); + sh.bindTextures(); // afterwards, only textures need updating + // draw it + gl.drawElements(gl.TRIANGLES, 6, this.GL.UNSIGNED_SHORT, 0); + } + dx += glyph.advanceWidth; + glyphPrev = glyph; + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if ( + !_iteratorNormalCompletion4 && + _iterator4.return != null + ) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } finally { + // clean up + sh.unbindShader(); + this._doStroke = doStroke; + this.drawMode = drawMode; + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); + p.pop(); + } + return p; + }; + }, + { + "../core/constants": 286, + "../core/main": 298, + "./p5.RendererGL.Retained": 354, + "./p5.Shader": 356, + "core-js/modules/es.array.iterator": 179, + "core-js/modules/es.object.get-own-property-descriptor": 196, + "core-js/modules/es.object.to-string": 200, + "core-js/modules/es.regexp.exec": 205, + "core-js/modules/es.string.iterator": 210, + "core-js/modules/es.string.split": 216, + "core-js/modules/es.string.sub": 218, + "core-js/modules/es.symbol": 222, + "core-js/modules/es.symbol.description": 220, + "core-js/modules/es.symbol.iterator": 221, + "core-js/modules/es.weak-map": 254, + "core-js/modules/web.dom-collections.iterator": 256, + }, + ], + 359: [ + function (_dereq_, module, exports) { + module.exports = { + fes: { + autoplay: + "The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy.\n\n+ More info: {{url}}", + checkUserDefinedFns: + "It seems that you may have accidentally written {{name}} instead of {{actualName}}. Please correct it if it's not intentional.", + fileLoadError: { + bytes: + "It looks like there was a problem loading your file. {{suggestion}}", + font: "It looks like there was a problem loading your font. {{suggestion}}", + gif: "There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.", + image: + "It looks like there was a problem loading your image. {{suggestion}}", + json: "It looks like there was a problem loading your JSON file. {{suggestion}}", + large: + "If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.", + strings: + "It looks like there was a problem loading your text file. {{suggestion}}", + suggestion: + "Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server.\n\n+ More info: {{url}}", + table: + "It looks like there was a problem loading your table file. {{suggestion}}", + xml: "It looks like there was a problem loading your XML file. {{suggestion}}", + }, + friendlyParamError: { + type_EMPTY_VAR: + "{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received an empty variable instead. If not intentional, this is often a problem with scope.\n\n+ More info: {{url}}", + type_TOO_FEW_ARGUMENTS: + "{{location}} {{func}}() was expecting at least {{minParams}} arguments, but received only {{argCount}}.", + type_TOO_MANY_ARGUMENTS: + "{{location}} {{func}}() was expecting no more than {{maxParams}} arguments, but received {{argCount}}.", + type_WRONG_TYPE: + "{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received {{argType}} instead.", + }, + globalErrors: { + reference: { + cannotAccess: + '\n{{location}} "{{symbol}}" is used before declaration. Make sure you have declared the variable before using it.\n\n+ More info: {{url}}', + notDefined: + '\n{{location}} "{{symbol}}" is not defined in the current scope. If you have defined it in your code, you should check its scope, spelling, and letter-casing (JavaScript is case-sensitive).\n\n+ More info: {{url}}', + }, + stackSubseq: + "└[{{location}}] \n\t Called from line {{line}} in {{func}}()\n", + stackTop: + "┌[{{location}}] \n\t Error at line {{line}} in {{func}}()\n", + syntax: { + badReturnOrYield: + "\nSyntax Error - return lies outside of a function. Make sure you’re not missing any brackets, so that return lies inside a function.\n\n+ More info: {{url}}", + invalidToken: + "\nSyntax Error - Found a symbol that JavaScript doesn't recognize or didn't expect at it's place.\n\n+ More info: {{url}}", + missingInitializer: + "\nSyntax Error - A const variable is declared but not initialized. In JavaScript, an initializer for a const is required. A value must be specified in the same statement in which the variable is declared. Check the line number in the error and assign the const variable a value.\n\n+ More info: {{url}}", + redeclaredVariable: + '\nSyntax Error - "{{symbol}}" is being redeclared. JavaScript doesn\'t allow declaring a variable more than once. Check the line number in error for redeclaration of the variable.\n\n+ More info: {{url}}', + unexpectedToken: + "\nSyntax Error - Symbol present at a place that wasn't expected.\nUsually this is due to a typo. Check the line number in the error for anything missing/extra.\n\n+ More info: {{url}}", + }, + type: { + constAssign: + "\n{{location}} A const variable is being re-assigned. In javascript, re-assigning a value to a constant is not allowed. If you want to re-assign new values to a variable, make sure it is declared as var or let.\n\n+ More info: {{url}}", + notfunc: + '\n{{location}} "{{symbol}}" could not be called as a function.\nCheck the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', + notfuncObj: + '\n{{location}} "{{symbol}}" could not be called as a function.\nVerify whether "{{obj}}" has "{{symbol}}" in it and check the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', + readFromNull: + "\n{{location}} The property of null can't be read. In javascript the value null indicates that an object has no value.\n\n+ More info: {{url}}", + readFromUndefined: + "\n{{location}} Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated is not undefined.\n\n + More info: {{url}}", + }, + }, + libraryError: + '{{location}} An error with message "{{error}}" occurred inside the p5js library when {{func}} was called. If not stated otherwise, it might be an issue with the arguments passed to {{func}}.', + location: "[{{file}}, line {{line}}]", + misspelling: + '{{location}} It seems that you may have accidentally written "{{name}}" instead of "{{actualName}}". Please correct it to {{actualName}} if you wish to use the {{type}} from p5.js.', + misspelling_plural: + '{{location}} It seems that you may have accidentally written "{{name}}".\nYou may have meant one of the following: \n{{suggestions}}', + misusedTopLevel: + "Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\n+ More info: {{url}}", + positions: { + p_1: "first", + p_10: "tenth", + p_11: "eleventh", + p_12: "twelfth", + p_2: "second", + p_3: "third", + p_4: "fourth", + p_5: "fifth", + p_6: "sixth", + p_7: "seventh", + p_8: "eighth", + p_9: "ninth", + }, + pre: "\n🌸 p5.js says: {{message}}", + sketchReaderErrors: { + reservedConst: + 'you have used a p5.js reserved variable "{{symbol}}" make sure you change the variable name to something else.\n\n+ More info: {{url}}', + reservedFunc: + 'you have used a p5.js reserved function "{{symbol}}" make sure you change the function name to something else.\n\n+ More info: {{url}}', + }, + welcome: + "Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js.", + wrongPreload: + '{{location}} An error with message "{{error}}" occurred inside the p5js library when "{{func}}" was called. If not stated otherwise, it might be due to "{{func}}" being called from preload. Nothing besides load calls (loadImage, loadJSON, loadFont, loadStrings, etc.) should be inside the preload function.', + }, + }; + }, + {}, + ], + 360: [ + function (_dereq_, module, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true, + }); + exports.languages = exports.default = void 0; + var _translation = _interopRequireDefault( + _dereq_("./en/translation"), + ); + function _interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj, + }; + } // Only one language is imported above. This is intentional as other languages + // will be hosted online and then downloaded whenever needed + /** + * Here, we define a default/fallback language which we can use without internet. + * You won't have to change this when adding a new language. + * + * `translation` is the namespace we are using for our initial set of strings + */ + + var _default = { + en: { + translation: _translation.default, + }, + }; + /** + * This is a list of languages that we have added so far. + * If you have just added a new language (yay!), add its key to the list below + * (`en` is english, `es` es español). Also add its export to + * dev.js, which is another file in this folder. + */ + exports.default = _default; + var languages = ["en", "es", "ko", "zh", "hi"]; + exports.languages = languages; + }, + { + "./en/translation": 359, + }, + ], + }, + {}, + [281], + )(281); }); diff --git a/public/lib/p5.min.js b/public/lib/p5.min.js index 7b436a7..88aa40d 100644 --- a/public/lib/p5.min.js +++ b/public/lib/p5.min.js @@ -1,2 +1,55917 @@ /*! p5.js v1.9.0 November 28, 2023 */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n>>1;case"base64":return E(e).length;default:if(n)return o?-1:M(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function T(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var h=o,f=h.length;if(f<=v)return String.fromCharCode.apply(String,h);for(var p="",m=0;mt&&(e+=" ... "),""},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(C(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,h=r,f=(d=Number(d)||0,u.length-d);(!h||f<(h=Number(h)))&&(h=f),(f=c.length)/2e.length)throw new RangeError("Index out of range")}function j(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function E(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function O(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,A("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:246}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":148}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(M,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,j=g&&p(g),_=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),T=s&&!!m&&"Opera"!==c(a.opera),e=!1,M={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in M)a[n]||(T=!1);if((!T||"function"!=typeof j||j===Function.prototype)&&(j=function(){throw TypeError("Incorrect invocation")},T))for(n in M)a[n]&&m(a[n],j);if((!T||!_||_===x)&&(_=j.prototype,T))for(n in M)a[n]&&m(a[n].prototype,_);if(T&&p(b)!==_&&m(b,_),i&&!u(_,y))for(n in e=!0,f(_,y,{get:function(){return l(this)?this[S]:void 0}}),M)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(j,e))return e}else for(var t in M)if(u(M,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in M){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}_[e]&&!r||h(_,e,!r&&T&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in M)(n=a[o])&&u(n,e)&&delete n[e];if(j[e]&&!r)return;try{return h(j,e,!r&&T&&g[e]||t)}catch(e){}}for(o in M)!(n=a[o])||n[e]&&!r||h(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(M,e)},isTypedArray:o,TypedArray:j,TypedArrayPrototype:_}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":145,"../internals/well-known-symbol":148}],13:[function(e,t,D){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return O(e,23,4)}function F(e){return O(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;uR;)(A=L[R++])in M||N(M,A,T[A]);c.constructor=M}g&&V(e)!==k&&g(e,k);var y=new E(new M(2)),I=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||h(e,{setInt8:function(e,t){I.call(this,e,t<<24>>24)},setUint8:function(e,t){I.call(this,e,t<<24>>24)}},{unsafe:!0})}else M=function(e){p(this,M,_);e=m(e);j(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},E=function(e,t,r){p(this,E,x),p(e,M,x);var o=b(e).byteLength,t=B(t);if(t<0||o>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1>16},getUint16:function(e){e=l(this,2,e,1>>0},getFloat32:function(e){return P(l(this,4,e,1"+e+""}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":140}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),j=e("../internals/set-to-string-tag"),_=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/iterators"),e=e("../internals/iterators-core"),T=e.IteratorPrototype,M=e.BUGGY_SAFARI_ITERATORS,E=o("iterator"),k="values",C="entries";t.exports=function(e,t,r,o,n,s,i){g(r,t,o);function a(e){if(e===n&&f)return f;if(!M&&e in d)return d[e];switch(e){case"keys":case k:case C:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,u,o=t+" Iterator",c=!1,d=e.prototype,h=d[E]||d["@@iterator"]||n&&d[n],f=!M&&h||a(n),p="Array"==t&&d.entries||h;if(p&&(p=v(p.call(new e)),T!==Object.prototype&&p.next&&(w||v(p)===T||(b?b(p,T):"function"!=typeof p[E]&&_(p,E,m)),j(p,o,!0,!0),w&&(S[o]=m))),n==k&&h&&h.name!==k&&(c=!0,f=function(){return h.call(this)}),w&&!i||d[E]===f||_(d,E,f),S[t]=f,n)if(l={values:a(k),keys:s?f:a("keys"),entries:a(C)},i)for(u in l)!M&&!c&&u in d||x(d,u,l[u]);else y({target:t,proto:!0,forced:M||c},l);return l}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":148}],42:[function(e,t,r){var o=e("../internals/path"),n=e("../internals/has"),s=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});n(t,e)||i(t,e,{value:s.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":147}],43:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/is-object"),n=o.document,s=e(n)&&e(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,n,s=e("../internals/global"),e=e("../internals/engine-user-agent"),s=s.process,s=s&&s.versions,s=s&&s.v8;s?n=(o=s.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(n=o[1]),t.exports=n&&+n},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var u=e("../internals/global"),c=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/set-global"),p=e("../internals/copy-constructor-properties"),m=e("../internals/is-forced");t.exports=function(e,t){var r,o,n,s=e.target,i=e.global,a=e.stat,l=i?u:a?u[s]||f(s,{}):(u[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.noTargetGet?(n=c(l,r))&&n.value:l[r],!m(i?r:s+(a?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;p(o,n)}(e.sham||n&&n.sham)&&d(o,"sham",!0),h(l,r,o,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var u=e("../internals/redefine"),c=e("../internals/fails"),d=e("../internals/well-known-symbol"),h=e("../internals/regexp-exec"),f=e("../internals/create-non-enumerable-property"),p=d("species"),m=!c(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),y="$0"==="a".replace(/./,"$0"),e=d("replace"),g=!!/./[e]&&""===/./[e]("a","$0"),v=!c(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(r,e,t,o){var s,n,i=d(r),a=!c(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),l=a&&!c(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[p]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});a&&l&&("replace"!==r||m&&y&&!g)&&("split"!==r||v)||(s=/./[i],t=(l=t(i,""[r],function(e,t,r,o,n){return t.exec===h?a&&!n?{done:!0,value:s.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}))[0],n=l[1],u(String.prototype,r,t),u(RegExp.prototype,i,2==e?function(e,t){return n.call(e,this,t)}:function(e){return n.call(e,this)})),o&&f(RegExp.prototype[i],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":148,"../modules/es.regexp.exec":187}],53:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(e,t,r){var s=e("../internals/a-function");t.exports=function(o,n,e){if(s(o),void 0===n)return o;switch(e){case 0:return function(){return o.call(n)};case 1:return function(e){return o.call(n,e)};case 2:return function(e,t){return o.call(n,e,t)};case 3:return function(e,t,r){return o.call(n,e,t,r)}}return function(){return o.apply(n,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){"use strict";var o=e("../internals/a-function"),n=e("../internals/is-object"),c=[].slice,d={};t.exports=Function.bind||function(i){var a=o(this),l=c.call(arguments,1),u=function(){var e=l.concat(c.call(arguments));if(this instanceof u){var t=a,r=e.length,o=e;if(!(r in d)){for(var n=[],s=0;s>1,u=23===t?f(2,-24)-f(2,-77):0,c=e<0||0===e&&1/e<0?1:0,d=0;for((e=h(e))!=e||e===1/0?(n=e!=e?1:0,o=r):(o=p(m(e)/y),e*(s=f(2,-o))<1&&(o--,s*=2),2<=(e+=1<=o+l?u/s:u*f(2,1-l))*s&&(o++,s/=2),r<=o+l?(n=0,o=r):1<=o+l?(n=(e*s-1)*f(2,t),o+=l):(n=e*f(2,l-1)*f(2,t),o=0));8<=t;i[d++]=255&n,n/=256,t-=8);for(o=o<>1,a=n-7,l=o-1,n=e[l--],u=127&n;for(n>>=7;0>=-a,a+=t;0"+e+""},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=n?((e=n).write(p("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=c("iframe"),t="java"+h+":",e.style.display="none",u.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[f]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=s(e),r=new o,o[d]=null,r[f]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),l=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){a(e);for(var r,o=l(t),n=o.length,s=0;sn;)!i(o,r=t[n++])||~l(s,r)||s.push(r);return s}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":134}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){"use strict";var o={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!o.call({1:2},1);r.f=s?function(e){e=n(this,e);return!!e&&e.enumerable}:o},{}],101:[function(e,t,r){var n=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return n(e),s(t),o?r.call(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){"use strict";var o=e("../internals/to-string-tag-support"),n=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+n(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":141}],103:[function(e,t,r){var o=e("../internals/get-built-in"),n=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=n.f(i(e)),r=s.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global");t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/is-object"),s=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),n(t)&&t.constructor===e?t:((0,(e=s.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var i=e("../internals/global"),a=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),u=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),n=e.get,c=e.enforce,d=String(String).split("String");(t.exports=function(e,t,r,o){var n=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,o=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||l(r,"name")||a(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e===i?s?e[t]=r:u(t,r):(n?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=r:a(e,t,r))})(Function.prototype,"toString",function(){return"function"==typeof this&&n(this).source||o(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),n=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){r=r.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return n.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){"use strict";var o,n,d=e("./regexp-flags"),e=e("./regexp-sticky-helpers"),h=RegExp.prototype.exec,f=String.prototype.replace,s=h,p=(o=/a/,n=/b*/g,h.call(o,"a"),h.call(n,"a"),0!==o.lastIndex||0!==n.lastIndex),m=e.UNSUPPORTED_Y||e.BROKEN_CARET,y=void 0!==/()??/.exec("")[1];t.exports=s=p||y||m?function(e){var t,r,o,n,s=this,i=m&&s.sticky,a=d.call(s),l=s.source,u=0,c=e;return i&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),c=String(e).slice(s.lastIndex),0t&&(o=o.slice(0,t)),n?e+o:o+e)}}var s=e("../internals/to-length"),i=e("../internals/string-repeat"),a=e("../internals/require-object-coercible"),l=Math.ceil;t.exports={start:o(!1),end:o(!0)}},{"../internals/require-object-coercible":113,"../internals/string-repeat":127,"../internals/to-length":136}],126:[function(e,t,r){"use strict";function g(e){return e+22+75*(e<26)}function s(e){var t,r=[],o=(e=function(e){for(var t=[],r=0,o=e.length;rT((v-s)/d))throw RangeError(w);for(s+=(u-n)*d,n=u,c=0;cv)throw RangeError(w);if(t==n){for(var h=s,f=b;;f+=b){var p=f<=i?1:i+j<=f?j:f-i;if(h>1,e+=T(e/t);S*j>>1>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":135}],128:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/whitespaces");t.exports=function(e){return o(function(){return!!n[e]()||"​…᠎"!="​…᠎"[e]()||n[e].name!==e})}},{"../internals/fails":51,"../internals/whitespaces":149}],129:[function(e,t,r){function o(t){return function(e){e=String(n(e));return 1&t&&(e=e.replace(s,"")),e=2&t?e.replace(i,""):e}}var n=e("../internals/require-object-coercible"),e="["+e("../internals/whitespaces")+"]",s=RegExp("^"+e+e+"*"),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":149}],130:[function(e,t,r){function o(e){return function(){x(e)}}function n(e){x(e.data)}function s(e){a.postMessage(e+"",f.protocol+"//"+f.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),u=e("../internals/classof-raw"),c=e("../internals/function-bind-context"),d=e("../internals/html"),h=e("../internals/document-create-element"),e=e("../internals/engine-is-ios"),f=a.location,p=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,j={},_="onreadystatechange",x=function(e){var t;j.hasOwnProperty(e)&&(t=j[e],delete j[e],t())};p&&m||(p=function(e){for(var t=[],r=1;r=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":134}],162:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),i=[].join,n=n!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:n||!e},{join:function(e){return i.call(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":134}],163:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/array-last-index-of");o({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],164:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").map,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("map"),e=e("map");o({target:"Array",proto:!0,forced:!s||!e},{map:function(e){return n(this,e,1T;T++)l(b,x=S[T])&&!l(w,x)&&y(w,x,m(b,x));(w.prototype=j).constructor=w,a(s,v,w)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":129,"../internals/to-primitive":140}],174:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],175:[function(e,t,r){"use strict";function c(e,t,r){return 0===t?r:t%2==1?c(e,t-1,r*e):c(e*e,t/2,r)}var o=e("../internals/export"),d=e("../internals/to-integer"),h=e("../internals/this-number-value"),f=e("../internals/string-repeat"),e=e("../internals/fails"),n=1..toFixed,p=Math.floor;o({target:"Number",proto:!0,forced:n&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!e(function(){n.call({})})},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*a[r],a[r]=o%1e7,o=p(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=a[t],a[t]=p(r/e),r=r%e*1e7}function o(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===a[t]||(e=String(a[t]),r=""===r?e:r+f.call("0",7-e.length)+e);return r}var n,s,i=h(this),e=d(e),a=[0,0,0,0,0,0],l="",u="0";if(e<0||20n;){var s,i,a,l=y[n++],u=t?l.ok:l.fail,c=l.resolve,d=l.reject,h=l.domain;try{u?(t||(p.rejection===oe&&function(e,t){v.call(g,function(){if(k)T.emit("rejectionHandled",e);else se(te,e,t.value)})}(f,p),p.rejection=P),!0===u?s=e:(h&&h.enter(),s=u(e),h&&(h.exit(),a=!0)),s===l.promise?d(w("Promise-chain cycle")):(i=ne(s))?i.call(s,c,d):c(s)):d(e)}catch(e){h&&!a&&h.exit(),d(e)}}p.reactions=[],p.notified=!1,m&&!p.rejection&&(r=f,o=p,v.call(g,function(){var e=o.value,t=ie(o);if(t&&(t=b(function(){k?T.emit("unhandledRejection",e,r):se(C,r,e)}),o.rejection=k||ie(o)?oe:P,t.error))throw t.value}))}))},se=function(e,t,r){var o;ee?((o=S.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),g.dispatchEvent(o)):o={promise:t,reason:r},(t=g["on"+e])?t(o):e===C&&Y("Unhandled promise rejection",r)},ie=function(e){return e.rejection!==P&&!e.parent},L=function(t,r,o,n){return function(e){t(r,o,e,n)}},R=function(e,t,r,o){t.done||(t.done=!0,(t=o?o:t).value=r,t.state=re,A(e,t,!0))},I=function(r,o,e,t){if(!o.done){o.done=!0,t&&(o=t);try{if(r===e)throw w("Promise can't be resolved itself");var n=ne(e);n?u(function(){var t={done:!1};try{n.call(e,L(I,r,t,o),L(R,r,t,o))}catch(e){R(r,t,e,o)}}):(o.value=e,o.state=O,A(r,o,!1))}catch(e){R(r,{done:!1},e,o)}}};e&&(x=function(e){z(this,x,j),c(e),r.call(this);var t=_(this);try{e(L(I,this,t),L(R,this,t))}catch(e){R(this,t,e)}},(r=function(e){J(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=N(x.prototype,{then:function(e,t){var r=K(this),o=E(X(this,x));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=k?T.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&A(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),t=function(){var e=new r,t=_(e);this.promise=e,this.resolve=L(I,e,t),this.reject=L(R,e,t)},f.f=E=function(e){return e===x||e===o?new t:$(e)},i||"function"!=typeof l||(n=l.prototype.then,U(l.prototype,"then",function(e,t){var r=this;return new x(function(e,t){n.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof M&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return h(x,M.apply(g,arguments))}}))),s({global:!0,wrap:!0,forced:e},{Promise:x}),B(x,j,!1,!0),G(j),o=a(j),s({target:j,stat:!0,forced:e},{reject:function(e){var t=E(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:i||e},{resolve:function(e){return h(i&&this===o?x:this,e)}}),s({target:j,stat:!0,forced:m},{all:function(e){var a=this,t=E(a),l=t.resolve,u=t.reject,r=b(function(){var o=c(a.resolve),n=[],s=0,i=1;d(e,function(e){var t=s++,r=!1;n.push(void 0),i++,o.call(a,e).then(function(e){r||(r=!0,n[t]=e,--i||l(n))},u)}),--i||l(n)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,o=E(r),n=o.reject,t=b(function(){var t=c(r.resolve);d(e,function(e){t.call(r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":130,"../internals/well-known-symbol":148}],184:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/get-built-in"),s=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),c=n("Reflect","construct"),d=e(function(){function e(){}return!(c(function(){},[],e)instanceof e)}),h=!e(function(){c(function(){})}),n=d||h;o({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(e,t){s(e),i(t);var r=arguments.length<3?e:s(arguments[2]);if(h&&!d)return c(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(u.apply(e,o))}o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t);return a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],185:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/is-object"),i=e("../internals/an-object"),a=e("../internals/has"),l=e("../internals/object-get-own-property-descriptor"),u=e("../internals/object-get-prototype-of");o({target:"Reflect",stat:!0},{get:function e(t,r){var o,n=arguments.length<3?t:arguments[2];return i(t)===n?t[r]:(o=l.f(t,r))?a(o,"value")?o.value:void 0===o.get?void 0:o.get.call(n):s(o=u(t))?e(o,r,n):void 0}})},{"../internals/an-object":10,"../internals/export":50,"../internals/has":60,"../internals/is-object":74,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-prototype-of":97}],186:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/global"),s=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,u=e("../internals/is-regexp"),c=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),h=e("../internals/redefine"),f=e("../internals/fails"),p=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=n.RegExp,v=g.prototype,b=/a/g,j=/a/g,_=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&s("RegExp",!_||x||f(function(){return j[y]=!1,g(b)!=b||g(j)==j||"/a/i"!=g(b,"i")}))){for(var w=function(e,t){var r,o=this instanceof w,n=u(e),s=void 0===t;if(!o&&n&&e.constructor===w&&s)return e;_?n&&!s&&(e=e.source):e instanceof w&&(s&&(t=c.call(e)),e=e.source),x&&(r=!!t&&-1T;)!function(t){t in w||a(w,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})}(S[T++]);(v.constructor=w).prototype=v,h(n,"RegExp",w)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":148}],187:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],188:[function(e,t,r){"use strict";var o=e("../internals/redefine"),n=e("../internals/an-object"),s=e("../internals/fails"),i=e("../internals/regexp-flags"),e="toString",a=RegExp.prototype,l=a[e],s=s(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),u=l.name!=e;(s||u)&&o(RegExp.prototype,e,function(){var e=n(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],189:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],190:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),e=e("../internals/is-pure"),u="".endsWith,c=Math.min,l=l("endsWith");o({target:"String",proto:!0,forced:!!(e||l||(!(o=n(String.prototype,"endsWith"))||o.writable))&&!l},{endsWith:function(e){var t=String(a(this)),r=(i(e),1=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],193:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/an-object"),d=e("../internals/to-length"),n=e("../internals/require-object-coercible"),h=e("../internals/advance-string-index"),f=e("../internals/regexp-exec-abstract");o("match",1,function(o,l,u){return[function(e){var t=n(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=u(l,e,this);if(t.done)return t.value;var r=c(e),o=String(this);if(!r.global)return f(r,o);for(var n=r.unicode,s=[],i=r.lastIndex=0;null!==(a=f(r,o));){var a=String(a[0]);""===(s[i]=a)&&(r.lastIndex=h(o,d(r.lastIndex),n)),i++}return 0===i?null:s}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":136}],194:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/string-pad").start;o({target:"String",proto:!0,forced:e("../internals/string-pad-webkit-bug")},{padStart:function(e){return n(this,e,1]*>)/g,I=/\$([$&'`]|\d\d?)/g;o("replace",2,function(n,j,_,e){var x=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=e.REPLACE_KEEPS_$0,S=x?"$":"$0";return[function(e,t){var r=s(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):j.call(String(r),e,t)},function(e,t){if(!x&&w||"string"==typeof t&&-1===t.indexOf(S)){var r=_(j,e,this,t);if(r.done)return r.value}for(var o,n=T(e),s=String(this),i="function"==typeof t,a=(i||(t=String(t)),n.global),l=(a&&(o=n.unicode,n.lastIndex=0),[]);null!==(f=O(n,s))&&(l.push(f),a);)""===String(f[0])&&(n.lastIndex=C(s,E(n.lastIndex),o));for(var u,c="",d=0,h=0;h>>0;if(0==o)return[];if(void 0===e)return[r];if(!c(e))return p.call(r,e,o);for(var n,s,i,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=new RegExp(e.source,t+"g");(n=h.call(u,r))&&!(l<(s=u.lastIndex)&&(a.push(r.slice(l,n.index)),1=o));)u.lastIndex===n.index&&u.lastIndex++;return l===r.length?!i&&u.test("")||a.push(""):a.push(r.slice(l)),a.length>o?a.slice(0,o):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)}:p;return[function(e,t){var r=d(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):y.call(String(r),e,t)},function(e,t){var r=m(y,e,this,t,y!==p);if(r.done)return r.value;var r=g(e),o=String(this),e=v(r,RegExp),n=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"y":"g"),i=new e(S?r:"^(?:"+r.source+")",s),a=void 0===t?w:t>>>0;if(0==a)return[];if(0===o.length)return null===_(i,o)?[o]:[];for(var l=0,u=0,c=[];ue.key){o.splice(t,0,e);break}t===s&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=P(this).entries,o=v(e,16)return;a=0;while(h()){l=null;if(a>0)if(h()=="."&&a<4)n++;else return;if(!x.test(h()))return;while(x.test(h())){u=parseInt(h(),10);if(l===null)l=u;else if(l==0)return;else l=l*10+u;if(l>255)return;n++}t[r]=t[r]*256+l;a++;if(a==2||a==4)r++}if(a!=4)return;break}else if(h()==":"){n++;if(!h())return}else if(h())return;t[r++]=s}if(o!==null){c=r-o;r=7;while(r!=0&&c>0){d=t[r];t[r--]=t[o+c-1];t[o+--c]=d}}else if(r!=8)return;return t}(t.slice(1,-1)))?void(e.host=r):_;if(k(e))return t=z(t),ne.test(t)||null===(r=function(e){var t=e.split("."),r,o,n,s,i,a,l;if(t.length&&t[t.length-1]=="")t.pop();if((r=t.length)>4)return e;for(o=[],n=0;n1&&s.charAt(0)=="0"){i=ee.test(s)?16:8;s=s.slice(i==8?1:2)}if(s==="")a=0;else{if(!(i==10?re:i==8?te:oe).test(s))return e;a=parseInt(s,i)}o.push(a)}for(n=0;n=Z(256,5-r))return null}else if(a>255)return null}for(l=o.pop(),n=0;n":1,"`":1}),ce=d({},ue,{"#":1,"?":1,"{":1,"}":1}),T=d({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),M=function(e,t){var r=V(e,0);return 32h,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,c=l>>16&255,d=l>>8&255,l=255&l,h=P(l,d,c,u),h=h in a?a[h]:a[h]=function(t,r,o,n,s){let i=0,a=1e100;for(let e=0;ea||(l=u[0],(c+=v(l-t))>a||(l=u[1],(c+=v(l-r))>a||(l=u[2],(c+=v(l-o))>a||(a=c,i=e))))}return i}(l,d,c,u,t);i[e]=h}else{const g="rgb444"===r?A:O;for(let e=0;e>16&255,m=f>>8&255,f=255&f,y=g(f,m,p),y=y in a?a[y]:a[y]=function(t,r,o,n){let s=0,i=1e100;for(let e=0;ei||(a=l[1],(u+=v(a-r))>i||(a=l[2],(u+=v(a-o))>i||(i=u,s=e)))}return s}(f,m,p,t);i[e]=y}}return i},default:()=>f,nearestColor:()=>function(e,t,r=u){return e[l(e,t,r)]},nearestColorIndex:()=>l,nearestColorIndexWithDistance:()=>d,prequantize:()=>function(e,{roundRGB:r=5,roundAlpha:o=10,oneBitAlpha:n=null}={}){const s=new Uint32Array(e.buffer);for(let t=0;t>24&255;var a,l=i>>16&255,u=i>>8&255,i=255&i;e=c(e,o),n&&(a="number"==typeof n?n:127,e=e<=a?0:255),i=c(i,r),u=c(u,r),l=c(l,r),s[t]=e<<24|l<<16|u<<8|i<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:n=!0,clearAlphaColor:s=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const u="rgba4444"===o,c=function(r,e){const t="rgb444"===e?4096:65536,o=new Array(t),n=r.length;if("rgba4444"===e)for(let t=0;t>24&255,a=s>>16&255,l=s>>8&255,s=255&s,u=P(s,l,a,i);let e=u in o?o[u]:o[u]=D();e.rc+=s,e.gc+=l,e.bc+=a,e.ac+=i,e.cnt++}else if("rgb444"===e)for(let t=0;t>16&255,h=c>>8&255,c=255&c,f=A(c,h,d);let e=f in o?o[f]:o[f]=D();e.rc+=c,e.gc+=h,e.bc+=d,e.cnt++}else for(let t=0;t>16&255,y=p>>8&255,p=255&p,g=O(p,y,m);let e=g in o?o[g]:o[g]=D();e.rc+=p,e.gc+=y,e.bc+=m,e.cnt++}return o}(e,o),d=c.length,h=d-1,f=new Uint32Array(d+1);for(var p=0,m=0;m>1,!(c[y=f[v]].err<=b));g=v)f[g]=y;f[g]=m}var j,_=p-t;for(m=0;m<_;){for(;;){var x=f[1];if((j=c[x]).tm>=j.mtm&&c[j.nn].mtm<=j.tm)break;j.mtm==h?x=f[1]=f[f[0]--]:(I(c,x,!1),j.tm=m);b=c[x].err;for(g=1;(v=g+g)<=f[0]&&(vc[f[v+1]].err&&v++,!(b<=c[y=f[v]].err));g=v)f[g]=y;f[g]=x}var w=c[j.nn],S=j.cnt,T=w.cnt,M=1/(S+T);u&&(j.ac=M*(S*j.ac+T*w.ac)),j.rc=M*(S*j.rc+T*w.rc),j.gc=M*(S*j.gc+T*w.gc),j.bc=M*(S*j.bc+T*w.bc),j.cnt+=w.cnt,j.mtm=++m,c[w.bk].fw=w.fw,c[w.fw].bk=w.bk,w.mtm=h}let E=[];for(m=0;;0){let e=L(Math.round(c[m].rc),0,255),t=L(Math.round(c[m].gc),0,255),r=L(Math.round(c[m].bc),0,255),o=255;u&&(o=L(Math.round(c[m].ac),0,255),a&&(k="number"==typeof a?a:127,o=o<=k?0:255),n&&o<=i&&(e=t=r=s,o=0));var k=u?[e,t,r,o]:[e,t,r];if(function(t,r){for(let e=0;efunction(r,o,e=5){if(r.length&&o.length){var n=r.map(e=>e.slice(0,3)),s=e*e,i=r[0].length;for(let t=0;ti?e.slice(0,3):e.slice();var a=d(n,e.slice(0,3),u),l=a[0],a=a[1];0>>0),0!=t&&(e=Math.max(e,256));const r=s;s=new Uint8Array(e),0>=8,c-=8;if((v>m||f)&&(f?(p=h,m=(1<>=8,c-=8;0>3}function P(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function A(e,t,r){return e>>4<<8|240&t|r>>4}function L(e,t,r){return e>8&255)}function C(e,t){for(var r=0;r>1,c=-7,d=r?n-1:0,h=r?-1:1,n=e[t+d];for(d+=h,s=n&(1<<-c)-1,n>>=-c,c+=a;0>=-c,c+=o;0>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:s-1,f=o?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+c?d/o:d*Math.pow(2,1-c))*o&&(i++,o/=2),u<=i+c?(a=0,i=u):1<=i+c?(a=(t*o-1)*Math.pow(2,n),i+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),i=0));8<=n;e[r+h]=255&a,h+=f,a/=256,n-=8);for(i=i<Math.abs(e[0])&&(t=1),t=Math.abs(e[2])>Math.abs(e[t])?2:t}function E(e,t){e.f+=t.f,e.b.f+=t.b.f}function h(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 k(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function C(e,t){m(e.a),e.c=!1,(e.a=t).i=e}function O(e){for(var t=e.a.a;(e=G(e)).a.a===t;);return e.c&&(C(e,t=S(B(e).a.b,e.a.e)),e=G(e)),e}function q(e,t,r){var o=new N;return o.a=r,o.e=p(e.f,t.e,o),r.i=o}function X(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],a[i[u]])?U:ue)(r,u),a[s]=null,l[s]=r.b,r.b=s}else for(r.c[-(s+1)]=null;0Math.max(i.a,l.a))){if(g(s,i)){if(0r.f&&(r.f*=2,r.c=ae(r.c,r.f+1)),0===r.b?n=o:(n=r.b,r.b=r.c[r.b]),r.e[n]=t,r.c[n]=o,r.d[o]=n,r.h&&ue(r,o),n):(r=e.a++,e.c[r]=t,-(r+1))}function se(e){if(0===e.a)return le(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(F(e.b),t))return le(e.b);for(;--e.a,0e.a||g(o[i],o[l])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function ue(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s>>1,l=r[a];if(0==a||g(o[l],o[i])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function N(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function B(e){return e.e.c.b}function G(e){return e.e.a.b}(t=r.prototype).x=function(){I(this,0)},t.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 l(this,100900)}l(this,100901)},t.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:l(this,100900)}return!1},t.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},t.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:l(this,100900)}},t.C=function(e,t){var r=!1,o=[0,0,0];I(this,2);for(var n=0;n<3;++n){var s=e[n];s<-1e150&&(s=-1e150,r=!0),1e150o[u]&&(o[u]=c,n[u]=r)}if(o[1]-a[1]>o[r=0]-a[0]&&(r=1),a[r=o[2]-a[2]>o[r]-a[r]?2:r]>=o[r])i[0]=0,i[1]=0,i[2]=1;else{for(a=l[r],n=n[r],l=[o=0,0,0],a=[a.g[0]-n.g[0],a.g[1]-n.g[1],a.g[2]-n.g[2]],u=[0,0,0],r=s.e;r!==s;r=r.e)u[0]=r.g[0]-n.g[0],u[1]=r.g[1]-n.g[1],u[2]=r.g[2]-n.g[2],l[0]=a[1]*u[2]-a[2]*u[1],l[1]=a[2]*u[0]-a[0]*u[2],l[2]=a[0]*u[1]-a[1]*u[0],o<(c=l[0]*l[0]+l[1]*l[1]+l[2]*l[2])&&(o=c,i[0]=l[0],i[1]=l[1],i[2]=l[2]);o<=0&&(i[0]=i[1]=i[2]=0,i[W(a)]=1)}s=!0}for(l=W(i),r=this.b.c,o=(l+1)%3,n=(l+2)%3,l=0>=1;)++n;if(i=1<>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|n,g[v++]=s,g[v++]=0,null!==b)for(var a=0,l=b.length;a>16&255,g[v++]=u>>8&255,g[v++]=255&u}if(null!==o){if(o<0||65535>8&255,g[v++]=0}var _=!1;this.addFrame=function(e,t,r,o,n,s){if(!0===_&&(--v,_=!1),s=void 0===s?{}:s,e<0||t<0||65535>=1;)++u;var l=1<>8&255,g[v++]=f,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&o,g[v++]=o>>8&255,g[v++]=!0===i?128|u-1:0,!0===i)for(var p=0,m=a.length;p>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,o){t[r++]=e;var n=r++,s=1<>=8,c-=8,r===n+256&&(t[n]=255,n=r++)}function f(e){d|=e<>=8,c-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(f(s),l=1+a,u=e+1,m={}):(1<>=l,c-=l,y==s)a=1+i,u=(1<<(l=n+1))-1,m=null;else{if(y==i)break;for(var g=y>8,++v;var j=b;if(o>=8;null!==m&&a<4096&&(p[a++]=m<<8|j,u+1<=a&&l<12&&(++l,u=u<<1|1)),m=y}}h!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=o,r.GifReader=function(b){var e=0;if(71!==b[e++]||73!==b[e++]||70!==b[e++]||56!==b[e++]||56!=(b[e++]+1&253)||97!==b[e++])throw new Error("Invalid GIF 87a/89a header.");var j=b[e++]|b[e++]<<8,t=b[e++]|b[e++]<<8,r=b[e++],o=1<<1+(7&r),n=(b[e++],b[e++],null),s=null,i=(r>>7&&(n=e,e+=3*(s=o)),!0),a=[],l=0,u=null,c=0,d=null;for(this.width=j,this.height=t;i&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}break;default:throw new Error("Unknown graphic control label: 0x"+b[e-1].toString(16))}break;case 44:var f,p=b[e++]|b[e++]<<8,m=b[e++]|b[e++]<<8,y=b[e++]|b[e++]<<8,g=b[e++]|b[e++]<<8,v=b[e++],_=v>>6&1,x=1<<1+(7&v),w=n,S=s,T=!1,v=(v>>7&&(T=!0,w=e,e+=3*(S=x)),e);for(e++;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}a.push({x:p,y:m,width:y,height:g,has_local_palette:T,palette_offset:w,palette_size:S,data_offset:v,data_length:e-v,transparent_index:u,interlaced:!!_,delay:l,disposal:c});break;case 59:i=!1;break;default:throw new Error("Unknown gif block: 0x"+b[e-1].toString(16))}this.numFrames=function(){return a.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=a.length)throw new Error("Frame index out of range.");return a[e]},this.decodeAndBlitFrameBGRA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(M(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=v,t[d++]=g,t[d++]=y,t[d++]=255),--l}},this.decodeAndBlitFrameRGBA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(M(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=y,t[d++]=g,t[d++]=v,t[d++]=255),--l}}}}catch(e){}},{}],249:[function(Ar,r,o){!function(Pr){var e,t;e=this,t=function(j){"use strict";function D(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length,e=e?Number(e):0;if(!((e=e!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function $(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,r+=t.table[++n],0<=(o-=t.table[n]););return e.tag=s,e.bitcount-=n,t.trans[r+o]}function ee(e,t,r){for(;;){var o=$(e,t);if(256===o)return U;if(o<256)e.dest[e.destLen++]=o;else for(var n,s=b(e,H[o-=257],W[o]),o=$(e,r),i=n=e.destLen-b(e,q[o],X[o]);i>>=1,o=n,b(s,2,0)){case 0:r=function(e){for(var t,r;8this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,r,o,n,s,i,a){var l=[e,t],u=[r,o],c=[n,s],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var h=0;h<=1;h++){var f,p=6*l[h]-12*u[h]+6*c[h],m=-3*l[h]+9*u[h]-9*c[h]+3*d[h],y=3*u[h]-3*l[h];0==m?0==p||0<(f=-y/p)&&f<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],f)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],f))):(f=Math.pow(p,2)-4*y*m)<0||(0<(y=(-p+Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))),0<(y=(-p-Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))))}},a.prototype.addQuad=function(e,t,r,o,n,s){r=e+2/3*(r-e),o=t+2/3*(o-t);this.addBezier(e,t,r,o,r+1/3*(n-e),o+1/3*(s-t),n,s)},h.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},h.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},h.prototype.curveTo=h.prototype.bezierCurveTo=function(e,t,r,o,n,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:n,y:s})},h.prototype.quadTo=h.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},h.prototype.close=h.prototype.closePath=function(){this.commands.push({type:"Z"})},h.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof a)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},h.prototype.getBoundingBox=function(){for(var e=new a,t=0,r=0,o=0,n=0,s=0;s>8&255,255&e]},l.USHORT=r(2),w.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},l.SHORT=r(2),w.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},l.UINT24=r(3),w.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.ULONG=r(4),w.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},l.LONG=r(4),w.FIXED=w.ULONG,l.FIXED=l.ULONG,w.FWORD=w.SHORT,l.FWORD=l.SHORT,w.UFWORD=w.USHORT,l.UFWORD=l.USHORT,w.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},l.LONGDATETIME=r(8),w.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)]},l.TAG=r(4),w.Card8=w.BYTE,l.Card8=l.BYTE,w.Card16=w.USHORT,l.Card16=l.USHORT,w.OffSize=w.BYTE,l.OffSize=l.BYTE,w.SID=w.USHORT,l.SID=l.USHORT,w.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?w.NUMBER16(e):w.NUMBER32(e)},l.NUMBER=function(e){return w.NUMBER(e).length},w.NUMBER16=function(e){return[28,e>>8&255,255&e]},l.NUMBER16=r(3),w.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},l.NUMBER32=r(5),w.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),n=0,s=t.length;n>8&255,t[t.length]=255&o}return t},l.UTF16=function(e){return 2*e.length};var se,ie={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(m.MACSTRING=function(e,t,r,o){var n=ie[o];if(void 0!==n){for(var s="",i=0;i>8&255,l+256&255)}return s})(e,t,r);return r},w.INDEX=function(e){for(var t=1,r=[t],o=[],n=0;n>8,t[c+1]=255&d,t=t.concat(o[u])}return t},l.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o>1,a.skip("uShort",3),y.glyphIndexMap={};for(var j,_=new R.Parser(g,v+b+14),x=new R.Parser(g,v+b+16+2*j),w=new R.Parser(g,v+b+16+4*j),S=new R.Parser(g,v+b+16+6*j),T=v+b+16+8*j,M=0;M>4,s=15&s;if(15==i)break;if(o+=n[i],15==s)break;o+=n[s]}return parseFloat(o)}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 Ie(e,t,r){var o=new R.Parser(e,t=void 0!==t?t:0),n=[],s=[];for(r=void 0!==r?r:e.length;o.relativeOffset>1,M.length=0,k=!0}return function e(t){for(var r,o,n,s,i,a,l,u,c,d,h,f,p=0;pMath.abs(f-P)?O=h+M.shift():P=f+M.shift(),T.curveTo(v,b,j,_,l,u),T.curveTo(c,d,h,f,O,P);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+m),M.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:i=M.pop()+y.gsubrsBias,(a=y.gsubrs[i])&&e(a);break;case 30:for(;0=r.begin&&e=c.length&&(s=o.parseChar(),r.names.push(o.parseString(s)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;at.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(n),t}function xt(e,t,r){for(var o=0;o 123 are reserved for internal usage");f|=1<>>1,s=e[n].tag;if(s===t)return n;s>>1,s=e[n];if(s===t)return n;s>>1,i=(n=e[s]).start;if(i===t)return n;i(n=e[r-1]).end?0:n}function Et(e,t){this.font=e,this.tableName=t}function kt(e){Et.call(this,e,"gpos")}function i(e){Et.call(this,e,"gsub")}function Ct(e,t,r){for(var o=e.subtables,n=0;nt.points.length-1||o.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=n.points[o.matchedPoints[1]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0},a=Lt([a],o)[0];o.dx=i.x-a.x,o.dy=i.y-a.y,s=Lt(n.points,o)}t.points=t.points.concat(s)}}return Rt(t.points)}(kt.prototype=Et.prototype={searchTag:St,binSearch:Tt,getTable:function(e){var t=this.font.tables[this.tableName];return t=!t&&e?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=i[t-1].tag,"Features must be added in alphabetical order."),i.push(n={tag:r,feature:{params:0,lookupListIndexes:[]}}),s.push(t),n.feature}},getLookupTables:function(e,t,r,o,n){var e=this.getFeatureTable(e,t,r,n),s=[];if(e){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u",s),t.stack.push(Math.round(64*s))}function hr(e,t){var r=t.stack,o=r.pop(),n=t.fv,s=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;j.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,r);for(var c=0;c>4)===i&&(0<=(h=(15&h)-8)&&h++,j.DEBUG&&console.log(t.step,"DELTAPFIX",d,"by",h*l),d=u[d],n.setRelative(d,d,h*l,s))}}function fr(e,t){var r=t.stack,o=r.pop();j.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(o/64))}function pr(e,t){var r=t.stack,o=r.pop(),n=t.ppem,s=t.deltaBase+16*(e-1),i=t.deltaShift;j.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,r);for(var a=0;a>4)===n&&(0<=(u=(15&u)-8)&&u++,u=u*i,j.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",u),t.cvt[l]+=u)}}function mr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.dpv=qt(r,n)}function k(e,t){var r=t.stack,o=t.prog,n=t.ip;j.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var s=0;s":"_")+(o?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+a+")":"",l,"(d =",i,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",o),a.interpolate(d,s,i,l),a.touch(d)}e.loop=1},lr.bind(void 0,0),lr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,o=e.z0[r],n=e.loop,s=e.fv,i=e.pv,a=e.z1;n--;){var l=t.pop(),u=a[l];j.DEBUG&&console.log(e.step,(1'.concat(n,"").concat(t,""),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},s.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+i))?this.dummyDOM.querySelector("#"+o+l).insertAdjacentHTML("beforebegin",'

                    ')):(r='

                    '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(a)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+u))?this.dummyDOM.querySelector("#".concat(o+d))&&this.dummyDOM.querySelector("#".concat(o+d)).insertAdjacentHTML("beforebegin",'

                    ')):(r='

                    '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+c),this.descriptions.label.innerHTML=t)},s.default.prototype._describeElementHTML=function(e,t,r){var o,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+l)||this.dummyDOM.querySelector("#"+n+a).insertAdjacentHTML("afterend",'
                    Canvas elements and their descriptions
                    ')):(o='
                    Canvas elements and their descriptions
                    '),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).innerHTML=o),(o=document.createElement("tr")).id=n+"_fte_"+t,this.dummyDOM.querySelector("#"+n+l).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+u))?this.dummyDOM.querySelector("#".concat(n+d))||this.dummyDOM.querySelector("#"+n+c).insertAdjacentHTML("afterend",'
                    ')):(o='
                    '),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=n+"_lte_"+t,this.dummyDOM.querySelector("#"+n+d).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)};e=s.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.ends-with":190,"core-js/modules/es.string.replace":196}],256:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateGridOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]);t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1]);return t}((r=function(e,t){var r,o="",n="",s=0;for(r in t){var i,a=0;for(i in t[r]){var l='
                  • ').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="
                  • "),o+=l,a++,s++}n=1').concat(t[r][a].color," ").concat(r,"
                    "):'').concat(t[r][a].color," ").concat(r," midpoint"),i[t[r][a].loc.locY][t[r][a].loc.locX]?i[t[r][a].loc.locY][t[r][a].loc.locX]=i[t[r][a].loc.locY][t[r][a].loc.locX]+" "+l:i[t[r][a].loc.locY][t[r][a].loc.locX]=l,n++}for(o in i){var u,c="";for(u in i[o])c+="",void 0!==i[o][u]&&(c+=i[o][u]),c+="";s=s+c+""}return s}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.from":158,"core-js/modules/es.array.map":164,"core-js/modules/es.string.iterator":192}],257:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t
                    ')):this.dummyDOM.querySelector("#".concat(s)).innerHTML='
                    '))):"Label"===t&&(r=s+e+(i=t),this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(s,"_Label"))?this.dummyDOM.querySelector("#".concat(s,"_Label")):this.dummyDOM.querySelector("#".concat(s))).insertAdjacentHTML("afterend",'
                    '))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(s,"gridOutput").concat(i),n='
                    Text Output

                      '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(s,"textOutput").concat(i),n='
                      Grid Output

                      '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,n={},s=!0,i=function(e,t){var r;e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,e]}(e,t);if("line"===e?(n.color=this.ingredients.colors.stroke,n.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=this._getPos(t[0],[1]),o=this._getPos(t[2],[3]),n.loc=u(i,this.width,this.height),n.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?n.color=this.ingredients.colors.stroke:(n.color=this.ingredients.colors.fill,n.area=this._getArea(e,t)),n.pos=this._getPos.apply(this,l(i)),n.loc=u(i,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[n]){for(var a in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][a])===JSON.stringify(n)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(n)}}else this.ingredients.shapes[e]=[n]},o.default.prototype._getPos=function(e,t){var e=new DOMPointReadOnly(e,t),t=this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform(),e=e.matrixTransform(t),t=e.x,e=e.y,r=this.width,o=this.height;return t<.4*r?e<.4*o?"top left":.6*oMath.PI?n+=o:n-=o)):"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),this.width*this._pixelDensity),i=this.height*this._pixelDensity,a=[new DOMPoint(0,0),new DOMPoint(s,0),new DOMPoint(s,i),new DOMPoint(0,i)],l=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),u=a.map(function(e){return e.matrixTransform(l)}),c=Math.abs((u[3].x+u[0].x)*(u[3].y-u[0].y)+(u[0].x+u[1].x)*(u[0].y-u[1].y)+(u[1].x+u[2].x)*(u[1].y-u[2].y)+(u[2].x+u[3].x)*(u[2].y-u[3].y))/2;return Math.round(100*n/c)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.from":158,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.number.to-fixed":175,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/web.dom-collections.iterator":238}],258:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateTextOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following");r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:");return r}((r=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='
                    • ').concat(t[r][s].color," ").concat(r,"");"line"===r?i+=", ".concat(t[r][s].pos,", ").concat(t[r][s].length," pixels long.
                    • "):(i+=", at ".concat(t[r][s].pos),"point"!==r&&(i+=", covering ".concat(t[r][s].area,"% of the canvas")),i+="."),o+=i,n++}return{numShapes:n,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='').concat(t[r][s].color," ").concat(r,"");"line"===r?i+="location = ".concat(t[r][s].pos,"length = ").concat(t[r][s].length," pixels"):(i+="location = ".concat(t[r][s].pos,""),"point"!==r&&(i+=" area = ".concat(t[r][s].area,"%")),i+=""),o+=i,n++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151}],259:[function(e,t,r){"use strict";var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.DataArray"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Framebuffer"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":254,"./accessibility/describe":255,"./accessibility/gridOutput":256,"./accessibility/outputs":257,"./accessibility/textOutput":258,"./color/color_conversion":260,"./color/creating_reading":261,"./color/p5.Color":262,"./color/setting":263,"./core/constants":264,"./core/environment":265,"./core/friendly_errors/fes_core":266,"./core/friendly_errors/file_errors":267,"./core/friendly_errors/sketch_reader":268,"./core/friendly_errors/stacktrace":269,"./core/friendly_errors/validate_params":270,"./core/helpers":271,"./core/init":272,"./core/legacy":274,"./core/main":275,"./core/p5.Element":276,"./core/p5.Graphics":277,"./core/p5.Renderer":278,"./core/p5.Renderer2D":279,"./core/preload":280,"./core/rendering":281,"./core/shape/2d_primitives":282,"./core/shape/attributes":283,"./core/shape/curves":284,"./core/shape/vertex":285,"./core/shim":286,"./core/structure":287,"./core/transform":288,"./data/local_storage.js":289,"./data/p5.TypedDict":290,"./dom/dom":291,"./events/acceleration":292,"./events/keyboard":293,"./events/mouse":294,"./events/touch":295,"./image/filters":296,"./image/image":297,"./image/loading_displaying":298,"./image/p5.Image":299,"./image/pixels":300,"./io/files":301,"./io/p5.Table":302,"./io/p5.TableRow":303,"./io/p5.XML":304,"./math/calculation":305,"./math/math":306,"./math/noise":307,"./math/p5.Vector":308,"./math/random":309,"./math/trigonometry":310,"./typography/attributes":311,"./typography/loading_displaying":312,"./typography/p5.Font":313,"./utilities/array_functions":314,"./utilities/conversion":315,"./utilities/string_functions":316,"./utilities/time_date":317,"./webgl/3d_primitives":318,"./webgl/interaction":320,"./webgl/light":321,"./webgl/loading":322,"./webgl/material":323,"./webgl/p5.Camera":324,"./webgl/p5.DataArray":325,"./webgl/p5.Framebuffer":326,"./webgl/p5.Geometry":327,"./webgl/p5.Matrix":328,"./webgl/p5.RenderBuffer":329,"./webgl/p5.RendererGL":332,"./webgl/p5.RendererGL.Immediate":330,"./webgl/p5.RendererGL.Retained":331,"./webgl/p5.Shader":333,"./webgl/p5.Texture":334,"./webgl/text":335}],260:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.ColorConversion={_hsbaToHSLA:function(e){var t=e[0],r=e[1],o=e[2],n=(2-r)*o/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*o/(2-2*n)),[t,r,n,e[3]]},_hsbaToRGBA:function(e){var t,r,o,n,s,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(n=o,s=l,r):2===t?(n=r,s=l,a):3===t?(n=r,s=o,l):4===t?(n=a,s=r,l):5===t?(n=l,s=r,o):(n=l,s=a,r),[n,s,i,e[3]])},_hslaToHSBA:function(e){var t=e[0],r=e[1],o=e[2],n=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(n-o)/n,n,e[3]]},_hslaToRGBA:function(e){var t,r=6*e[0],o=e[1],n=e[2];return 0===o?[n,n,n,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*n-(n=n<.5?(1+o)*n:n+o-n*o),n),t(r,o,n),t(r-2,o,n),e[3]]},_rgbaToHSBA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=i-Math.min(o,n,s);return 0==a?r=t=0:(r=a/i,o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},_rgbaToHSLA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=Math.min(o,n,s),l=i+a,a=i-a;return 0==a?r=t=0:(r=l<1?a/l:a/(2-l),o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]}};e=e.default.ColorConversion;r.default=e},{"../core/main":275}],261:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.alpha=function(e){return l.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},l.default.prototype.blue=function(e){return l.default._validateParameters("blue",arguments),this.color(e)._getBlue()},l.default.prototype.brightness=function(e){return l.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},l.default.prototype.color=function(){var e;return l.default._validateParameters("color",arguments),arguments[0]instanceof l.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new l.default.Color(this,e))},l.default.prototype.green=function(e){return l.default._validateParameters("green",arguments),this.color(e)._getGreen()},l.default.prototype.hue=function(e){return l.default._validateParameters("hue",arguments),this.color(e)._getHue()},l.default.prototype.lerpColor=function(e,t,r){l.default._validateParameters("lerpColor",arguments);var o,n,s,i=this._colorMode,a=this._colorMaxes;if(i===u.RGB)n=e.levels.map(function(e){return e/255}),s=t.levels.map(function(e){return e/255});else if(i===u.HSB)e._getBrightness(),t._getBrightness(),n=e.hsba,s=t.hsba;else{if(i!==u.HSL)throw new Error("".concat(i,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),n=e.hsla,s=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(n[0],s[0],r),t=this.lerp(n[1],s[1],r),o=this.lerp(n[2],s[2],r),n=this.lerp(n[3],s[3],r),e*=a[i][0],t*=a[i][1],o*=a[i][2],n*=a[i][3],this.color(e,t,o,n)},l.default.prototype.lightness=function(e){return l.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},l.default.prototype.red=function(e){return l.default._validateParameters("red",arguments),this.color(e)._getRed()},l.default.prototype.saturation=function(e){return l.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=l.default;r.default=n},{"../core/constants":264,"../core/friendly_errors/fes_core":266,"../core/friendly_errors/file_errors":267,"../core/friendly_errors/validate_params":270,"../core/main":275,"./p5.Color":262,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],262:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(e("../core/main")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),h=s(e("./color_conversion"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r"].indexOf(r[0])?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(o)},this).map(function(e){var t,r;return-1===(e=-1 eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[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"),o=[],n=2,s=r.length;n/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}},this)}}}e.default._getErrorStackParser=function(){return new o};e=e.default;r.default=e},{"../main":275,"core-js/modules/es.array.filter":155,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.join":162,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.match":193,"core-js/modules/es.string.replace":196,"core-js/modules/es.string.split":198}],270:[function(e,t,r){"use strict";function o(e){return(o="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)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==a(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o)})(e("../constants")),e("../internationalization");function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};e=n.default;r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":264,"../internationalization":273,"../main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.for-each":157,"core-js/modules/es.array.includes":159,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.join":162,"core-js/modules/es.array.last-index-of":163,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.function.name":168,"core-js/modules/es.map":169,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.get-prototype-of":180,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.reflect.construct":184,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.set":189,"core-js/modules/es.string.includes":191,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.for-each":237,"core-js/modules/web.dom-collections.iterator":238}],271:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,n){return n===s.CORNER?{x:e,y:t,w:r,h:o}:n===s.CORNERS?{x:e,y:t,w:r-e,h:o-t}:n===s.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:n===s.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":264,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],272:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var n=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),n]).then(function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default})},{"../core/main":275,"./internationalization":273,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.to-string":182,"core-js/modules/es.promise":183,"core-js/modules/es.string.iterator":192,"core-js/modules/web.dom-collections.iterator":238}],273:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,s,o=a(e("i18next")),i=a(e("i18next-browser-languagedetector"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r*s,o*s);return n.pixelDensity(s),n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r*s,o*s),n}},{key:"textLeading",value:function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading}},{key:"textStyle",value:function(e){return e?(e!==P.NORMAL&&e!==P.ITALIC&&e!==P.BOLD&&e!==P.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle}},{key:"textAscent",value:function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent}},{key:"textDescent",value:function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent}},{key:"textAlign",value: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}}},{key:"textWrap",value:function(e){return this._setProperty("_textWrap",e),this._textWrap}},{key:"text",value:function(e,t,r,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,h=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===P.CENTER&&(t-=o/2),this._textAlign){case P.CENTER:t+=o/2;break;case P.RIGHT:t+=o}if(void 0!==n){this._rectMode===P.CENTER&&(r-=n/2,h-=n/2);var e=r,f=u.textAscent();switch(this._textBaseline){case P.BOTTOM:l=r+n,r=Math.max(l,r),h+=f;break;case P.CENTER:l=r+n/2,r=Math.max(l,r),h+=f/2}d=r+n-f,this._textBaseline===P.CENTER&&(d=e+n-f/2)}else this._textBaseline!==P.BOTTOM&&this._textBaseline!==P.CENTER||(h=r-(e=u.textSize()*this._textLeading)/2,d=r+e/2);if(c===P.WORD){for(var p=[],m=0;ma.HALF_PI&&e<=3*a.HALF_PI?Math.atan(r/o*Math.tan(e))+a.PI:Math.atan(r/o*Math.tan(e))+a.TWO_PI,t=t<=a.HALF_PI?Math.atan(r/o*Math.tan(t)):t>a.HALF_PI&&t<=3*a.HALF_PI?Math.atan(r/o*Math.tan(t))+a.PI:Math.atan(r/o*Math.tan(t))+a.TWO_PI),tp||Math.abs(this.accelerationY-this.pAccelerationY)>p||Math.abs(this.accelerationZ-this.pAccelerationZ)>p)&&s.deviceMoved(),"function"==typeof s.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},_toImageData:function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},_createImageData:function(e,t){return V._tmpCanvas=document.createElement("canvas"),V._tmpCtx=V._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},apply:function(e,t,r){var o=e.getContext("2d"),n=o.getImageData(0,0,e.width,e.height),t=t(n,r);t instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(n,0,0,0,0,e.width,e.height)},threshold:function(e,t){for(var r=V._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),n=0;n>8)/o,r[n+1]=255*(i*t>>8)/o,r[n+2]=255*(a*t>>8)/o}},dilate:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(n>>8&255)+28*(255&n))<(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=s,n=l),n<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,n=u),f[d++]=o;V._setPixels(c,f)},erode:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(u>>8&255)+28*(255&u))<(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=u,n=a),(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(s>>8&255)+28*(255&s))>16&255)+151*(i>>8&255)+28*(255&i))>>24],r+=j[(16711680&I)>>16],o+=j[(65280&I)>>8],n+=j[255&I],t+=B[b],i++}T[a=k+g]=s/t,M[a]=r/t,E[a]=o/t,F[a]=n/t}k+=h}for(u=(l=-U)*h,v=k=0;v"+p.length.toString()+" out of "+c.toString()),e.next=48,new Promise(function(e){return setTimeout(e,0)});e.next=50;break;case 48:e.next=39;break;case 50:i||m.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(f),v=(0,P.GIFEncoder)(),b=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r"+S.toString()+" out of "+c.toString()),e.next=68,new Promise(function(e){return setTimeout(e,0)});case 68:S++,e.next=60;break;case 71:v.finish(),k=v.bytesView(),k=new Blob([k],{type:"image/gif"}),p=[],this._recording=!1,this.loop(),i||(m.html("Done. Downloading your gif!🌸"),0=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))}},{key:"_setProperty",value:function(e,t){this[e]=t,this.setModified(!0)}},{key:"loadPixels",value:function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)}},{key:"updatePixels",value:function(e,t,r,o){s.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o),this.setModified(!0)}},{key:"get",value:function(e,t,r,o){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)}},{key:"_getPixel",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(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"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==s[0]){n.print(" ");for(var c=0;c".concat(d)),n.print(" ")}n.print(" ")}for(var h=0;h");for(var f=0;f".concat(p)),n.print(" ")}n.print(" ")}n.print("
                      "),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream",e=(v.default.prototype._isSafari()&&(o="text/plain"),new Blob(e,{type:o}));v.default.prototype.downloadFile(e,t,r)},v.default.prototype.downloadFile=function(e,t,r){var o,t=i(t,r),r=t[0];e instanceof Blob?n.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},v.default.prototype._checkFileExtension=i,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%o)/o}};n.setSeed(e),j=new Array(4096);for(var s=0;s<4096;s++)j[s]=n.rand()},e.default);r.default=e},{"../core/main":275}],308:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("../core/main"))&&n.__esModule?n:{default:n},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function u(e,t){for(var r=0;r>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(tf&&(b=d,v=a,s=l,d=x+f*(i&&x=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.map":164,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.repeat":195}],316:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(u=e("../core/main"))&&u.__esModule?u:{default:u};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t,r){var o=i(e.toString().split("."),2),n=o[0],o=o[1];return void 0===r?(n=n.padStart(t,"0"),o?n+"."+o:n):(n=(e=i(e.toFixed(r).toString().split("."),2))[0],o=e[1],n=n.padStart(t,"0"),void 0===o?n:n+"."+o)}function n(e,t){var r=(e=e.toString()).indexOf("."),o=-1!==r?e.substring(r):"",e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(0===t)o="";else if(void 0!==t)if(t>o.length)for(var n=t-(o+=-1===r?".":"").length+1,s=0;s=_.TWO_PI?"".concat(c="ellipse","|"):"".concat(c="arc","|").concat(s,"|").concat(i,"|").concat(a,"|")).concat(l,"|"),c=(this.geometryInHash(u)||((t=new S.default.Geometry(l,1,function(){if(s.toFixed(10)!==i.toFixed(10)){a!==_.PIE&&void 0!==a||(this.vertices.push(new S.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=l;e++){var t=(i-s)*(e/l)+s,r=.5+Math.cos(t)/2,t=.5+Math.sin(t)/2;this.vertices.push(new S.default.Vector(r,t,0)),this.uvs.push([r,t]),e>5&31)/31,(p>>10&31)/31):(r=i,o=a,l)),new x.default.Vector(y,g,v)),j=1;j<=3;j++){var _=m+12*j,_=new x.default.Vector(u.getFloat32(_,!0),u.getFloat32(4+_,!0),u.getFloat32(8+_,!0));e.vertices.push(_),e.vertexNormals.push(b),d&&s.push(r,o,n)}e.faces.push([3*f,3*f+1,3*f+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{t=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");t=new TextDecoder("utf-8").decode(t).split("\n");!function(e,t){for(var r,o,n="",s=[],i=0;ithis.cameraFar&&(i=this.cameraFar),Math.acos(Math.max(-1,Math.min(1,_.default.Vector.dot(o,n))))+t),t=e;(r<=0||r>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),n.mult(Math.cos(r)),a.mult(Math.cos(t)*Math.sin(r)),s.mult(Math.sin(t)*Math.sin(r)),o.set(n).add(a).add(s),this.eyeX=i*o.x+this.centerX,this.eyeY=i*o.y+this.centerY,this.eyeZ=i*o.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.hypot(o,n,s),o=new _.default.Vector(o,n,s).normalize(),n=new _.default.Vector(this.upX,this.upY,this.upZ),s=new _.default.Vector.cross(n,o).normalize(),a=new _.default.Vector.cross(o,s),l=Math.atan2(t,e),l=(a.mult(Math.sin(l)),s.mult(Math.cos(l)).add(a),Math.sqrt(e*e+t*t)),a=new _.default.Vector.cross(o,s),e=((i=(i*=Math.pow(10,r))this.cameraFar&&(i=this.cameraFar),Math.cos(l)),t=Math.sin(l),r=n.dot(o),l=n.dot(s),u=r*e+l*t,r=-r*t+l*e,l=n.dot(a);n.x=u*o.x+r*s.x+l*a.x,n.y=u*o.y+r*s.y+l*a.y,n.z=u*o.z+r*s.z+l*a.z,s.mult(-t),o.mult(e).add(s).mult(i),this.camera(o.x+this.centerX,o.y+this.centerY,o.z+this.centerZ,this.centerX,this.centerY,this.centerZ,n.x,n.y,n.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&n(e.prototype,r),o&&n(e,o),t}(),_.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};e=_.default.Camera;r.default=e},{"../core/main":275,"core-js/modules/es.array.slice":165,"core-js/modules/es.math.hypot":170,"core-js/modules/es.string.sub":200}],325:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t){for(var r=0;r=this.width||t>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1)),(0,p.readPixelWebGL)(this.gl,this.framebuffer,e*this.density,t*this.density,n.format,n.type);e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1),r=this.target.constrain(r,1,this.width-e),o=this.target.constrain(o,1,this.height-t);for(var s=(0,p.readPixelsWebGL)(void 0,this.gl,this.framebuffer,e*this.density,t*this.density,r*this.density,o*this.density,n.format,n.type),i=new Uint8ClampedArray(r*o*this.density*this.density*4),a=(i.fill(255),n.type===this.gl.RGB?3:4),l=0;lthis.vertices.length-1-this.detailX;o--)e.add(this.vertexNormals[o]);e=m.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this}},{key:"_makeTriangleEdges",value:function(){for(var e=this.edges.length=0;e 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},a.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),this._applyColorBlend(this.curStrokeColor),r.drawArrays(r.Points,0,e.length),o.unbindShader()};var s=a.default.RendererGL;r.default=s},{"../core/constants":264,"../core/main":275,"./p5.RenderBuffer":329,"./p5.RendererGL":332,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.some":166,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.typed-array.copy-within":205,"core-js/modules/es.typed-array.every":206,"core-js/modules/es.typed-array.fill":207,"core-js/modules/es.typed-array.filter":208,"core-js/modules/es.typed-array.find":210,"core-js/modules/es.typed-array.find-index":209,"core-js/modules/es.typed-array.float32-array":211,"core-js/modules/es.typed-array.for-each":213,"core-js/modules/es.typed-array.includes":214,"core-js/modules/es.typed-array.index-of":215,"core-js/modules/es.typed-array.iterator":218,"core-js/modules/es.typed-array.join":219,"core-js/modules/es.typed-array.last-index-of":220,"core-js/modules/es.typed-array.map":221,"core-js/modules/es.typed-array.reduce":223,"core-js/modules/es.typed-array.reduce-right":222,"core-js/modules/es.typed-array.reverse":224,"core-js/modules/es.typed-array.set":225,"core-js/modules/es.typed-array.slice":226,"core-js/modules/es.typed-array.some":227,"core-js/modules/es.typed-array.sort":228,"core-js/modules/es.typed-array.subarray":229,"core-js/modules/es.typed-array.to-locale-string":230,"core-js/modules/es.typed-array.to-string":231,"core-js/modules/es.typed-array.uint16-array":232,"core-js/modules/es.typed-array.uint32-array":233,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],332:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.readPixelsWebGL=k,r.readPixelWebGL=C,r.default=void 0;var g=n(e("../core/main")),l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),a=n(e("./GeometryBuilder")),u=n(e("libtess")),c=(e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("./p5.Framebuffer"),e("path"),e("./p5.Texture"));function d(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,d=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n",lineVert:T+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:T+"precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n",pointFrag:"precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n",imageLightVert:"precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n",imageLightDiffusedFrag:"precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}",imageLightSpecularFrag:"precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n"};for(x in M)M[x]="#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n"+M[x];j(e={},l.GRAY,"precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n"),j(e,l.ERODE,"// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),j(e,l.DILATE,"// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),j(e,l.BLUR,"precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n"),j(e,l.POSTERIZE,"// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n"),j(e,l.OPAQUE,"// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n"),j(e,l.INVERT,"// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n"),j(e,l.THRESHOLD,"// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n");var E=e;function k(e,t,r,o,n,s,i,a,l,u){var c=t.getParameter(t.FRAMEBUFFER_BINDING),r=(t.bindFramebuffer(t.FRAMEBUFFER,r),a===t.RGBA?4:3),d=s*i*r,h=l===t.UNSIGNED_BYTE?Uint8Array:Float32Array;if(e instanceof h&&e.length===d||(e=new h(d)),t.readPixels(o,u?u-n-i:n,s,i,a,l,e),t.bindFramebuffer(t.FRAMEBUFFER,c),u)for(var f=Math.floor(i/2),p=new h(s*r),m=0;m>7,127&d,c>>7,127&c);for(var h=0;h>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}]),t}();B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=M.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new E(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var h,f=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(h=f.next()).done);d=!0)h.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==f.return||f.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var j,_=y[Symbol.iterator]();!(g=(j=_.next()).done);g=!0){var x,w,S=j.value,T=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));T.uGlyphRect&&(x=T.rowInfo,w=T.colInfo,u.setUniform("uSamplerStrokes",T.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",T.uGridOffset),u.setUniform("uGlyphRect",T.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":264,"../core/main":275,"./p5.RendererGL.Retained":331,"./p5.Shader":333,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.string.sub":200,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}]},{},[259])(259)}); \ No newline at end of file +!(function (e) { + "object" == typeof exports && "undefined" != typeof module + ? (module.exports = e()) + : "function" == typeof define && define.amd + ? define([], e) + : (("undefined" != typeof window + ? window + : "undefined" != typeof global + ? global + : "undefined" != typeof self + ? self + : this + ).p5 = e()); +})(function () { + var s, t, r; + return (function o(n, s, i) { + function a(t, e) { + if (!s[t]) { + if (!n[t]) { + var r = "function" == typeof require && require; + if (!e && r) return r(t, !0); + if (l) return l(t, !0); + throw ( + (((e = new Error("Cannot find module '" + t + "'")).code = + "MODULE_NOT_FOUND"), + e) + ); + } + (r = s[t] = { exports: {} }), + n[t][0].call( + r.exports, + function (e) { + return a(n[t][1][e] || e); + }, + r, + r.exports, + o, + n, + s, + i, + ); + } + return s[t].exports; + } + for ( + var l = "function" == typeof require && require, e = 0; + e < i.length; + e++ + ) + a(i[e]); + return a; + })( + { + 1: [ + function (e, t, r) { + "use strict"; + (r.byteLength = function (e) { + var e = c(e), + t = e[0], + e = e[1]; + return (3 * (t + e)) / 4 - e; + }), + (r.toByteArray = function (e) { + var t, + r, + o = c(e), + n = o[0], + o = o[1], + s = new u( + (function (e, t) { + return (3 * (e + t)) / 4 - t; + })(n, o), + ), + i = 0, + a = 0 < o ? n - 4 : n; + for (r = 0; r < a; r += 4) + (t = + (l[e.charCodeAt(r)] << 18) | + (l[e.charCodeAt(r + 1)] << 12) | + (l[e.charCodeAt(r + 2)] << 6) | + l[e.charCodeAt(r + 3)]), + (s[i++] = (t >> 16) & 255), + (s[i++] = (t >> 8) & 255), + (s[i++] = 255 & t); + 2 === o && + ((t = + (l[e.charCodeAt(r)] << 2) | (l[e.charCodeAt(r + 1)] >> 4)), + (s[i++] = 255 & t)); + 1 === o && + ((t = + (l[e.charCodeAt(r)] << 10) | + (l[e.charCodeAt(r + 1)] << 4) | + (l[e.charCodeAt(r + 2)] >> 2)), + (s[i++] = (t >> 8) & 255), + (s[i++] = 255 & t)); + return s; + }), + (r.fromByteArray = function (e) { + for ( + var t, r = e.length, o = r % 3, n = [], s = 0, i = r - o; + s < i; + s += 16383 + ) + n.push( + (function (e, t, r) { + for (var o, n = [], s = t; s < r; s += 3) + (o = + ((e[s] << 16) & 16711680) + + ((e[s + 1] << 8) & 65280) + + (255 & e[s + 2])), + n.push( + (function (e) { + return ( + a[(e >> 18) & 63] + + a[(e >> 12) & 63] + + a[(e >> 6) & 63] + + a[63 & e] + ); + })(o), + ); + return n.join(""); + })(e, s, i < s + 16383 ? i : s + 16383), + ); + 1 == o + ? ((t = e[r - 1]), n.push(a[t >> 2] + a[(t << 4) & 63] + "==")) + : 2 == o && + ((t = (e[r - 2] << 8) + e[r - 1]), + n.push( + a[t >> 10] + a[(t >> 4) & 63] + a[(t << 2) & 63] + "=", + )); + return n.join(""); + }); + for ( + var a = [], + l = [], + u = "undefined" != typeof Uint8Array ? Uint8Array : Array, + o = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", + n = 0, + s = o.length; + n < s; + ++n + ) + (a[n] = o[n]), (l[o.charCodeAt(n)] = n); + function c(e) { + var t = e.length; + if (0 < t % 4) + throw new Error("Invalid string. Length must be a multiple of 4"); + (e = e.indexOf("=")), + (t = (e = -1 === e ? t : e) === t ? 0 : 4 - (e % 4)); + return [e, t]; + } + (l["-".charCodeAt(0)] = 62), (l["_".charCodeAt(0)] = 63); + }, + {}, + ], + 2: [function (e, t, r) {}, {}], + 3: [function (e, t, r) {}, {}], + 4: [ + function (A, e, L) { + !function (d) { + "use strict"; + var S = A("base64-js"), + s = A("ieee754"), + e = + "function" == typeof Symbol && "function" == typeof Symbol.for + ? Symbol.for("nodejs.util.inspect.custom") + : null, + t = + ((L.Buffer = d), + (L.SlowBuffer = function (e) { + +e != e && (e = 0); + return d.alloc(+e); + }), + (L.INSPECT_MAX_BYTES = 50), + 2147483647); + function l(e) { + if (t < e) + throw new RangeError( + 'The value "' + e + '" is invalid for option "size"', + ); + e = new Uint8Array(e); + return Object.setPrototypeOf(e, d.prototype), e; + } + function d(e, t, r) { + if ("number" != typeof e) return o(e, t, r); + if ("string" == typeof t) + throw new TypeError( + 'The "string" argument must be of type string. Received type number', + ); + return i(e); + } + function o(e, t, r) { + if ("string" == typeof e) { + var o = e, + n = t; + if ( + d.isEncoding( + (n = "string" == typeof n && "" !== n ? n : "utf8"), + ) + ) + return ( + (s = 0 | h(o, n)), + (i = l(s)), + (i = (o = i.write(o, n)) !== s ? i.slice(0, o) : i) + ); + throw new TypeError("Unknown encoding: " + n); + } + if (ArrayBuffer.isView(e)) return u(e); + if (null != e) { + if (C(e, ArrayBuffer) || (e && C(e.buffer, ArrayBuffer))) { + var s = e, + o = t, + i = r; + if (o < 0 || s.byteLength < o) + throw new RangeError( + '"offset" is outside of buffer bounds', + ); + if (s.byteLength < o + (i || 0)) + throw new RangeError( + '"length" is outside of buffer bounds', + ); + return ( + (s = + void 0 === o && void 0 === i + ? new Uint8Array(s) + : void 0 === i + ? new Uint8Array(s, o) + : new Uint8Array(s, o, i)), + Object.setPrototypeOf(s, d.prototype), + s + ); + } + if ("number" == typeof e) + throw new TypeError( + 'The "value" argument must not be of type number. Received type number', + ); + n = e.valueOf && e.valueOf(); + if (null != n && n !== e) return d.from(n, t, r); + var a = (function (e) { + { + var t, r; + if (d.isBuffer(e)) + return ( + (t = 0 | c(e.length)), + 0 !== (r = l(t)).length && e.copy(r, 0, 0, t), + r + ); + } + if (void 0 !== e.length) + return "number" != typeof e.length || O(e.length) + ? l(0) + : u(e); + if ("Buffer" === e.type && Array.isArray(e.data)) + return u(e.data); + })(e); + if (a) return a; + if ( + "undefined" != typeof Symbol && + null != Symbol.toPrimitive && + "function" == typeof e[Symbol.toPrimitive] + ) + return d.from(e[Symbol.toPrimitive]("string"), t, r); + } + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + + typeof e, + ); + } + function n(e) { + if ("number" != typeof e) + throw new TypeError('"size" argument must be of type number'); + if (e < 0) + throw new RangeError( + 'The value "' + e + '" is invalid for option "size"', + ); + } + function i(e) { + return n(e), l(e < 0 ? 0 : 0 | c(e)); + } + function u(e) { + for ( + var t = e.length < 0 ? 0 : 0 | c(e.length), r = l(t), o = 0; + o < t; + o += 1 + ) + r[o] = 255 & e[o]; + return r; + } + function c(e) { + if (t <= e) + throw new RangeError( + "Attempt to allocate Buffer larger than maximum size: 0x" + + t.toString(16) + + " bytes", + ); + return 0 | e; + } + function h(e, t) { + if (d.isBuffer(e)) return e.length; + if (ArrayBuffer.isView(e) || C(e, ArrayBuffer)) + return e.byteLength; + if ("string" != typeof e) + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + + typeof e, + ); + var r = e.length, + o = 2 < arguments.length && !0 === arguments[2]; + if (!o && 0 === r) return 0; + for (var n = !1; ; ) + switch (t) { + case "ascii": + case "latin1": + case "binary": + return r; + case "utf8": + case "utf-8": + return M(e).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return 2 * r; + case "hex": + return r >>> 1; + case "base64": + return E(e).length; + default: + if (n) return o ? -1 : M(e).length; + (t = ("" + t).toLowerCase()), (n = !0); + } + } + function r(e, t, r) { + var o, + n = !1; + if ((t = void 0 === t || t < 0 ? 0 : t) > this.length) return ""; + if ((r = void 0 === r || r > this.length ? this.length : r) <= 0) + return ""; + if ((r >>>= 0) <= (t >>>= 0)) return ""; + for (e = e || "utf8"; ; ) + switch (e) { + case "hex": + var s = this, + i = t, + a = r, + l = s.length; + (!a || a < 0 || l < a) && (a = l); + for (var u = "", c = (i = !i || i < 0 ? 0 : i); c < a; ++c) + u += P[s[c]]; + return u; + case "utf8": + case "utf-8": + return T(this, t, r); + case "ascii": + var d = this, + l = t, + h = r, + f = ""; + h = Math.min(d.length, h); + for (var p = l; p < h; ++p) + f += String.fromCharCode(127 & d[p]); + return f; + case "latin1": + case "binary": + var m = this, + i = t, + y = r, + g = ""; + y = Math.min(m.length, y); + for (var v = i; v < y; ++v) g += String.fromCharCode(m[v]); + return g; + case "base64": + return ( + (b = this), + (o = r), + 0 === (j = t) && o === b.length + ? S.fromByteArray(b) + : S.fromByteArray(b.slice(j, o)) + ); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + for ( + var b = t, j = r, _ = this.slice(b, j), x = "", w = 0; + w < _.length; + w += 2 + ) + x += String.fromCharCode(_[w] + 256 * _[w + 1]); + return x; + default: + if (n) throw new TypeError("Unknown encoding: " + e); + (e = (e + "").toLowerCase()), (n = !0); + } + } + function a(e, t, r) { + var o = e[t]; + (e[t] = e[r]), (e[r] = o); + } + function f(e, t, r, o, n) { + if (0 === e.length) return -1; + if ( + ("string" == typeof r + ? ((o = r), (r = 0)) + : 2147483647 < r + ? (r = 2147483647) + : r < -2147483648 && (r = -2147483648), + (r = + (r = O((r = +r)) ? (n ? 0 : e.length - 1) : r) < 0 + ? e.length + r + : r) >= e.length) + ) { + if (n) return -1; + r = e.length - 1; + } else if (r < 0) { + if (!n) return -1; + r = 0; + } + if (("string" == typeof t && (t = d.from(t, o)), d.isBuffer(t))) + return 0 === t.length ? -1 : p(e, t, r, o, n); + if ("number" == typeof t) + return ( + (t &= 255), + "function" == typeof Uint8Array.prototype.indexOf + ? (n + ? Uint8Array.prototype.indexOf + : Uint8Array.prototype.lastIndexOf + ).call(e, t, r) + : p(e, [t], r, o, n) + ); + throw new TypeError("val must be string, number or Buffer"); + } + function p(e, t, r, o, n) { + var s = 1, + i = e.length, + a = t.length; + if ( + void 0 !== o && + ("ucs2" === (o = String(o).toLowerCase()) || + "ucs-2" === o || + "utf16le" === o || + "utf-16le" === o) + ) { + if (e.length < 2 || t.length < 2) return -1; + (i /= s = 2), (a /= 2), (r /= 2); + } + function l(e, t) { + return 1 === s ? e[t] : e.readUInt16BE(t * s); + } + if (n) + for (var u = -1, c = r; c < i; c++) + if (l(e, c) === l(t, -1 === u ? 0 : c - u)) { + if (c - (u = -1 === u ? c : u) + 1 === a) return u * s; + } else -1 !== u && (c -= c - u), (u = -1); + else + for (c = r = i < r + a ? i - a : r; 0 <= c; c--) { + for (var d = !0, h = 0; h < a; h++) + if (l(e, c + h) !== l(t, h)) { + d = !1; + break; + } + if (d) return c; + } + return -1; + } + function y(e, t, r, o) { + return k( + (function (e) { + for (var t = [], r = 0; r < e.length; ++r) + t.push(255 & e.charCodeAt(r)); + return t; + })(t), + e, + r, + o, + ); + } + function g(e, t, r, o) { + return k( + (function (e, t) { + for ( + var r, o, n = [], s = 0; + s < e.length && !((t -= 2) < 0); + ++s + ) + (o = e.charCodeAt(s)), + (r = o >> 8), + (o = o % 256), + n.push(o), + n.push(r); + return n; + })(t, e.length - r), + e, + r, + o, + ); + } + function T(e, t, r) { + r = Math.min(e.length, r); + for (var o = [], n = t; n < r; ) { + var s, + i, + a, + l, + u = e[n], + c = null, + d = 239 < u ? 4 : 223 < u ? 3 : 191 < u ? 2 : 1; + if (n + d <= r) + switch (d) { + case 1: + u < 128 && (c = u); + break; + case 2: + 128 == (192 & (s = e[n + 1])) && + 127 < (l = ((31 & u) << 6) | (63 & s)) && + (c = l); + break; + case 3: + (s = e[n + 1]), + (i = e[n + 2]), + 128 == (192 & s) && + 128 == (192 & i) && + 2047 < + (l = + ((15 & u) << 12) | ((63 & s) << 6) | (63 & i)) && + (l < 55296 || 57343 < l) && + (c = l); + break; + case 4: + (s = e[n + 1]), + (i = e[n + 2]), + (a = e[n + 3]), + 128 == (192 & s) && + 128 == (192 & i) && + 128 == (192 & a) && + 65535 < + (l = + ((15 & u) << 18) | + ((63 & s) << 12) | + ((63 & i) << 6) | + (63 & a)) && + l < 1114112 && + (c = l); + } + null === c + ? ((c = 65533), (d = 1)) + : 65535 < c && + ((c -= 65536), + o.push(((c >>> 10) & 1023) | 55296), + (c = 56320 | (1023 & c))), + o.push(c), + (n += d); + } + var h = o, + f = h.length; + if (f <= v) return String.fromCharCode.apply(String, h); + for (var p = "", m = 0; m < f; ) + p += String.fromCharCode.apply(String, h.slice(m, (m += v))); + return p; + } + (L.kMaxLength = t), + (d.TYPED_ARRAY_SUPPORT = (function () { + try { + var e = new Uint8Array(1), + t = { + foo: function () { + return 42; + }, + }; + return ( + Object.setPrototypeOf(t, Uint8Array.prototype), + Object.setPrototypeOf(e, t), + 42 === e.foo() + ); + } catch (e) { + return !1; + } + })()) || + "undefined" == typeof console || + "function" != typeof console.error || + console.error( + "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.", + ), + Object.defineProperty(d.prototype, "parent", { + enumerable: !0, + get: function () { + if (d.isBuffer(this)) return this.buffer; + }, + }), + Object.defineProperty(d.prototype, "offset", { + enumerable: !0, + get: function () { + if (d.isBuffer(this)) return this.byteOffset; + }, + }), + "undefined" != typeof Symbol && + null != Symbol.species && + d[Symbol.species] === d && + Object.defineProperty(d, Symbol.species, { + value: null, + configurable: !0, + enumerable: !1, + writable: !1, + }), + (d.poolSize = 8192), + (d.from = o), + Object.setPrototypeOf(d.prototype, Uint8Array.prototype), + Object.setPrototypeOf(d, Uint8Array), + (d.alloc = function (e, t, r) { + return ( + (t = t), + (r = r), + n((e = e)), + !(e <= 0) && void 0 !== t + ? "string" == typeof r + ? l(e).fill(t, r) + : l(e).fill(t) + : l(e) + ); + }), + (d.allocUnsafe = i), + (d.allocUnsafeSlow = i), + (d.isBuffer = function (e) { + return null != e && !0 === e._isBuffer && e !== d.prototype; + }), + (d.compare = function (e, t) { + if ( + (C(e, Uint8Array) && (e = d.from(e, e.offset, e.byteLength)), + C(t, Uint8Array) && (t = d.from(t, t.offset, t.byteLength)), + !d.isBuffer(e) || !d.isBuffer(t)) + ) + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array', + ); + if (e === t) return 0; + for ( + var r = e.length, o = t.length, n = 0, s = Math.min(r, o); + n < s; + ++n + ) + if (e[n] !== t[n]) { + (r = e[n]), (o = t[n]); + break; + } + return r < o ? -1 : o < r ? 1 : 0; + }), + (d.isEncoding = function (e) { + switch (String(e).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return !0; + default: + return !1; + } + }), + (d.concat = function (e, t) { + if (!Array.isArray(e)) + throw new TypeError( + '"list" argument must be an Array of Buffers', + ); + if (0 === e.length) return d.alloc(0); + if (void 0 === t) + for (n = t = 0; n < e.length; ++n) t += e[n].length; + for ( + var r = d.allocUnsafe(t), o = 0, n = 0; + n < e.length; + ++n + ) { + var s = e[n]; + if ((C(s, Uint8Array) && (s = d.from(s)), !d.isBuffer(s))) + throw new TypeError( + '"list" argument must be an Array of Buffers', + ); + s.copy(r, o), (o += s.length); + } + return r; + }), + (d.byteLength = h), + (d.prototype._isBuffer = !0), + (d.prototype.swap16 = function () { + var e = this.length; + if (e % 2 != 0) + throw new RangeError( + "Buffer size must be a multiple of 16-bits", + ); + for (var t = 0; t < e; t += 2) a(this, t, t + 1); + return this; + }), + (d.prototype.swap32 = function () { + var e = this.length; + if (e % 4 != 0) + throw new RangeError( + "Buffer size must be a multiple of 32-bits", + ); + for (var t = 0; t < e; t += 4) + a(this, t, t + 3), a(this, t + 1, t + 2); + return this; + }), + (d.prototype.swap64 = function () { + var e = this.length; + if (e % 8 != 0) + throw new RangeError( + "Buffer size must be a multiple of 64-bits", + ); + for (var t = 0; t < e; t += 8) + a(this, t, t + 7), + a(this, t + 1, t + 6), + a(this, t + 2, t + 5), + a(this, t + 3, t + 4); + return this; + }), + (d.prototype.toLocaleString = d.prototype.toString = + function () { + var e = this.length; + return 0 === e + ? "" + : 0 === arguments.length + ? T(this, 0, e) + : r.apply(this, arguments); + }), + (d.prototype.equals = function (e) { + if (d.isBuffer(e)) + return this === e || 0 === d.compare(this, e); + throw new TypeError("Argument must be a Buffer"); + }), + (d.prototype.inspect = function () { + var e = "", + t = L.INSPECT_MAX_BYTES, + e = this.toString("hex", 0, t) + .replace(/(.{2})/g, "$1 ") + .trim(); + return this.length > t && (e += " ... "), ""; + }), + e && (d.prototype[e] = d.prototype.inspect), + (d.prototype.compare = function (e, t, r, o, n) { + if ( + (C(e, Uint8Array) && (e = d.from(e, e.offset, e.byteLength)), + !d.isBuffer(e)) + ) + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + + typeof e, + ); + if ( + (void 0 === r && (r = e ? e.length : 0), + void 0 === o && (o = 0), + void 0 === n && (n = this.length), + (t = void 0 === t ? 0 : t) < 0 || + r > e.length || + o < 0 || + n > this.length) + ) + throw new RangeError("out of range index"); + if (n <= o && r <= t) return 0; + if (n <= o) return -1; + if (r <= t) return 1; + if (this === e) return 0; + for ( + var s = (n >>>= 0) - (o >>>= 0), + i = (r >>>= 0) - (t >>>= 0), + a = Math.min(s, i), + l = this.slice(o, n), + u = e.slice(t, r), + c = 0; + c < a; + ++c + ) + if (l[c] !== u[c]) { + (s = l[c]), (i = u[c]); + break; + } + return s < i ? -1 : i < s ? 1 : 0; + }), + (d.prototype.includes = function (e, t, r) { + return -1 !== this.indexOf(e, t, r); + }), + (d.prototype.indexOf = function (e, t, r) { + return f(this, e, t, r, !0); + }), + (d.prototype.lastIndexOf = function (e, t, r) { + return f(this, e, t, r, !1); + }), + (d.prototype.write = function (e, t, r, o) { + if (void 0 === t) (o = "utf8"), (r = this.length), (t = 0); + else if (void 0 === r && "string" == typeof t) + (o = t), (r = this.length), (t = 0); + else { + if (!isFinite(t)) + throw new Error( + "Buffer.write(string, encoding, offset[, length]) is no longer supported", + ); + (t >>>= 0), + isFinite(r) + ? ((r >>>= 0), void 0 === o && (o = "utf8")) + : ((o = r), (r = void 0)); + } + var n = this.length - t; + if ( + ((void 0 === r || n < r) && (r = n), + (0 < e.length && (r < 0 || t < 0)) || t > this.length) + ) + throw new RangeError( + "Attempt to write outside buffer bounds", + ); + o = o || "utf8"; + for (var s, i, a, l = !1; ; ) + switch (o) { + case "hex": + var u = this, + c = e, + d = t, + h = r, + f = ((d = Number(d) || 0), u.length - d); + (!h || f < (h = Number(h))) && (h = f), + (f = c.length) / 2 < h && (h = f / 2); + for (var p = 0; p < h; ++p) { + var m = parseInt(c.substr(2 * p, 2), 16); + if (O(m)) return p; + u[d + p] = m; + } + return p; + case "utf8": + case "utf-8": + return ( + (f = t), + (a = r), + k(M(e, (i = this).length - f), i, f, a) + ); + case "ascii": + return y(this, e, t, r); + case "latin1": + case "binary": + return y(this, e, t, r); + case "base64": + return (i = this), (a = t), (s = r), k(E(e), i, a, s); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return g(this, e, t, r); + default: + if (l) throw new TypeError("Unknown encoding: " + o); + (o = ("" + o).toLowerCase()), (l = !0); + } + }), + (d.prototype.toJSON = function () { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0), + }; + }); + var v = 4096; + function m(e, t, r) { + if (e % 1 != 0 || e < 0) + throw new RangeError("offset is not uint"); + if (r < e + t) + throw new RangeError("Trying to access beyond buffer length"); + } + function b(e, t, r, o, n, s) { + if (!d.isBuffer(e)) + throw new TypeError( + '"buffer" argument must be a Buffer instance', + ); + if (n < t || t < s) + throw new RangeError('"value" argument is out of bounds'); + if (r + o > e.length) throw new RangeError("Index out of range"); + } + function j(e, t, r, o) { + if (r + o > e.length) throw new RangeError("Index out of range"); + if (r < 0) throw new RangeError("Index out of range"); + } + function _(e, t, r, o, n) { + return ( + (t = +t), + (r >>>= 0), + n || j(e, 0, r, 4), + s.write(e, t, r, o, 23, 4), + r + 4 + ); + } + function x(e, t, r, o, n) { + return ( + (t = +t), + (r >>>= 0), + n || j(e, 0, r, 8), + s.write(e, t, r, o, 52, 8), + r + 8 + ); + } + (d.prototype.slice = function (e, t) { + var r = this.length, + r = + ((e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : r < e && (e = r), + (t = void 0 === t ? r : ~~t) < 0 + ? (t += r) < 0 && (t = 0) + : r < t && (t = r), + t < e && (t = e), + this.subarray(e, t)); + return Object.setPrototypeOf(r, d.prototype), r; + }), + (d.prototype.readUIntLE = function (e, t, r) { + (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); + for (var o = this[e], n = 1, s = 0; ++s < t && (n *= 256); ) + o += this[e + s] * n; + return o; + }), + (d.prototype.readUIntBE = function (e, t, r) { + (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); + for (var o = this[e + --t], n = 1; 0 < t && (n *= 256); ) + o += this[e + --t] * n; + return o; + }), + (d.prototype.readUInt8 = function (e, t) { + return (e >>>= 0), t || m(e, 1, this.length), this[e]; + }), + (d.prototype.readUInt16LE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 2, this.length), + this[e] | (this[e + 1] << 8) + ); + }), + (d.prototype.readUInt16BE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 2, this.length), + (this[e] << 8) | this[e + 1] + ); + }), + (d.prototype.readUInt32LE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 4, this.length), + (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + + 16777216 * this[e + 3] + ); + }), + (d.prototype.readUInt32BE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 4, this.length), + 16777216 * this[e] + + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]) + ); + }), + (d.prototype.readIntLE = function (e, t, r) { + (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); + for (var o = this[e], n = 1, s = 0; ++s < t && (n *= 256); ) + o += this[e + s] * n; + return (n *= 128) <= o && (o -= Math.pow(2, 8 * t)), o; + }), + (d.prototype.readIntBE = function (e, t, r) { + (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); + for (var o = t, n = 1, s = this[e + --o]; 0 < o && (n *= 256); ) + s += this[e + --o] * n; + return (n *= 128) <= s && (s -= Math.pow(2, 8 * t)), s; + }), + (d.prototype.readInt8 = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 1, this.length), + 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e] + ); + }), + (d.prototype.readInt16LE = function (e, t) { + (e >>>= 0), t || m(e, 2, this.length); + t = this[e] | (this[e + 1] << 8); + return 32768 & t ? 4294901760 | t : t; + }), + (d.prototype.readInt16BE = function (e, t) { + (e >>>= 0), t || m(e, 2, this.length); + t = this[e + 1] | (this[e] << 8); + return 32768 & t ? 4294901760 | t : t; + }), + (d.prototype.readInt32LE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 4, this.length), + this[e] | + (this[e + 1] << 8) | + (this[e + 2] << 16) | + (this[e + 3] << 24) + ); + }), + (d.prototype.readInt32BE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 4, this.length), + (this[e] << 24) | + (this[e + 1] << 16) | + (this[e + 2] << 8) | + this[e + 3] + ); + }), + (d.prototype.readFloatLE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 4, this.length), + s.read(this, e, !0, 23, 4) + ); + }), + (d.prototype.readFloatBE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 4, this.length), + s.read(this, e, !1, 23, 4) + ); + }), + (d.prototype.readDoubleLE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 8, this.length), + s.read(this, e, !0, 52, 8) + ); + }), + (d.prototype.readDoubleBE = function (e, t) { + return ( + (e >>>= 0), + t || m(e, 8, this.length), + s.read(this, e, !1, 52, 8) + ); + }), + (d.prototype.writeUIntLE = function (e, t, r, o) { + (e = +e), + (t >>>= 0), + (r >>>= 0), + o || b(this, e, t, r, Math.pow(2, 8 * r) - 1, 0); + var n = 1, + s = 0; + for (this[t] = 255 & e; ++s < r && (n *= 256); ) + this[t + s] = (e / n) & 255; + return t + r; + }), + (d.prototype.writeUIntBE = function (e, t, r, o) { + (e = +e), + (t >>>= 0), + (r >>>= 0), + o || b(this, e, t, r, Math.pow(2, 8 * r) - 1, 0); + var n = r - 1, + s = 1; + for (this[t + n] = 255 & e; 0 <= --n && (s *= 256); ) + this[t + n] = (e / s) & 255; + return t + r; + }), + (d.prototype.writeUInt8 = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 1, 255, 0), + (this[t] = 255 & e), + t + 1 + ); + }), + (d.prototype.writeUInt16LE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 2, 65535, 0), + (this[t] = 255 & e), + (this[t + 1] = e >>> 8), + t + 2 + ); + }), + (d.prototype.writeUInt16BE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 2, 65535, 0), + (this[t] = e >>> 8), + (this[t + 1] = 255 & e), + t + 2 + ); + }), + (d.prototype.writeUInt32LE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(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 + ); + }), + (d.prototype.writeUInt32BE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(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 + ); + }), + (d.prototype.writeIntLE = function (e, t, r, o) { + (e = +e), + (t >>>= 0), + o || b(this, e, t, r, (o = Math.pow(2, 8 * r - 1)) - 1, -o); + var n = 0, + s = 1, + i = 0; + for (this[t] = 255 & e; ++n < r && (s *= 256); ) + e < 0 && 0 === i && 0 !== this[t + n - 1] && (i = 1), + (this[t + n] = (((e / s) >> 0) - i) & 255); + return t + r; + }), + (d.prototype.writeIntBE = function (e, t, r, o) { + (e = +e), + (t >>>= 0), + o || b(this, e, t, r, (o = Math.pow(2, 8 * r - 1)) - 1, -o); + var n = r - 1, + s = 1, + i = 0; + for (this[t + n] = 255 & e; 0 <= --n && (s *= 256); ) + e < 0 && 0 === i && 0 !== this[t + n + 1] && (i = 1), + (this[t + n] = (((e / s) >> 0) - i) & 255); + return t + r; + }), + (d.prototype.writeInt8 = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 1, 127, -128), + (this[t] = 255 & (e = e < 0 ? 255 + e + 1 : e)), + t + 1 + ); + }), + (d.prototype.writeInt16LE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 2, 32767, -32768), + (this[t] = 255 & e), + (this[t + 1] = e >>> 8), + t + 2 + ); + }), + (d.prototype.writeInt16BE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 2, 32767, -32768), + (this[t] = e >>> 8), + (this[t + 1] = 255 & e), + t + 2 + ); + }), + (d.prototype.writeInt32LE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(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 + ); + }), + (d.prototype.writeInt32BE = function (e, t, r) { + return ( + (e = +e), + (t >>>= 0), + r || b(this, e, t, 4, 2147483647, -2147483648), + (this[t] = (e = e < 0 ? 4294967295 + e + 1 : e) >>> 24), + (this[t + 1] = e >>> 16), + (this[t + 2] = e >>> 8), + (this[t + 3] = 255 & e), + t + 4 + ); + }), + (d.prototype.writeFloatLE = function (e, t, r) { + return _(this, e, t, !0, r); + }), + (d.prototype.writeFloatBE = function (e, t, r) { + return _(this, e, t, !1, r); + }), + (d.prototype.writeDoubleLE = function (e, t, r) { + return x(this, e, t, !0, r); + }), + (d.prototype.writeDoubleBE = function (e, t, r) { + return x(this, e, t, !1, r); + }), + (d.prototype.copy = function (e, t, r, o) { + if (!d.isBuffer(e)) + throw new TypeError("argument should be a Buffer"); + if ( + ((r = r || 0), + o || 0 === o || (o = this.length), + t >= e.length && (t = e.length), + (o = 0 < o && o < r ? r : o) === r) + ) + return 0; + if (0 === e.length || 0 === this.length) return 0; + if ((t = t || 0) < 0) + throw new RangeError("targetStart out of bounds"); + if (r < 0 || r >= this.length) + throw new RangeError("Index out of range"); + if (o < 0) throw new RangeError("sourceEnd out of bounds"); + o > this.length && (o = this.length); + var n = (o = e.length - t < o - r ? e.length - t + r : o) - r; + if ( + this === e && + "function" == typeof Uint8Array.prototype.copyWithin + ) + this.copyWithin(t, r, o); + else if (this === e && r < t && t < o) + for (var s = n - 1; 0 <= s; --s) e[s + t] = this[s + r]; + else Uint8Array.prototype.set.call(e, this.subarray(r, o), t); + return n; + }), + (d.prototype.fill = function (e, t, r, o) { + if ("string" == typeof e) { + if ( + ("string" == typeof t + ? ((o = t), (t = 0), (r = this.length)) + : "string" == typeof r && ((o = r), (r = this.length)), + void 0 !== o && "string" != typeof o) + ) + throw new TypeError("encoding must be a string"); + if ("string" == typeof o && !d.isEncoding(o)) + throw new TypeError("Unknown encoding: " + o); + var n; + 1 === e.length && + ((n = e.charCodeAt(0)), + (("utf8" === o && n < 128) || "latin1" === o) && (e = n)); + } else + "number" == typeof e + ? (e &= 255) + : "boolean" == typeof e && (e = Number(e)); + if (t < 0 || this.length < t || this.length < r) + throw new RangeError("Out of range index"); + var s; + if (!(r <= t)) + if ( + ((t >>>= 0), + (r = void 0 === r ? this.length : r >>> 0), + "number" == typeof (e = e || 0)) + ) + for (s = t; s < r; ++s) this[s] = e; + else { + var i = d.isBuffer(e) ? e : d.from(e, o), + a = i.length; + if (0 === a) + throw new TypeError( + 'The value "' + e + '" is invalid for argument "value"', + ); + for (s = 0; s < r - t; ++s) this[s + t] = i[s % a]; + } + return this; + }); + var w = /[^+/0-9A-Za-z-_]/g; + function M(e, t) { + t = t || 1 / 0; + for (var r, o = e.length, n = null, s = [], i = 0; i < o; ++i) { + if (55295 < (r = e.charCodeAt(i)) && r < 57344) { + if (!n) { + if (56319 < r) { + -1 < (t -= 3) && s.push(239, 191, 189); + continue; + } + if (i + 1 === o) { + -1 < (t -= 3) && s.push(239, 191, 189); + continue; + } + n = r; + continue; + } + if (r < 56320) { + -1 < (t -= 3) && s.push(239, 191, 189), (n = r); + continue; + } + r = 65536 + (((n - 55296) << 10) | (r - 56320)); + } else n && -1 < (t -= 3) && s.push(239, 191, 189); + if (((n = null), r < 128)) { + if (--t < 0) break; + s.push(r); + } else if (r < 2048) { + if ((t -= 2) < 0) break; + s.push((r >> 6) | 192, (63 & r) | 128); + } else if (r < 65536) { + if ((t -= 3) < 0) break; + s.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; + s.push( + (r >> 18) | 240, + ((r >> 12) & 63) | 128, + ((r >> 6) & 63) | 128, + (63 & r) | 128, + ); + } + } + return s; + } + function E(e) { + return S.toByteArray( + (function (e) { + if ( + (e = (e = e.split("=")[0]).trim().replace(w, "")).length < 2 + ) + return ""; + for (; e.length % 4 != 0; ) e += "="; + return e; + })(e), + ); + } + function k(e, t, r, o) { + for ( + var n = 0; + n < o && !(n + r >= t.length || n >= e.length); + ++n + ) + t[n + r] = e[n]; + return n; + } + function C(e, t) { + return ( + e instanceof t || + (null != e && + null != e.constructor && + null != e.constructor.name && + e.constructor.name === t.name) + ); + } + function O(e) { + return e != e; + } + var P = (function () { + for ( + var e = "0123456789abcdef", t = new Array(256), r = 0; + r < 16; + ++r + ) + for (var o = 16 * r, n = 0; n < 16; ++n) t[o + n] = e[r] + e[n]; + return t; + })(); + }.call(this, A("buffer").Buffer); + }, + { "base64-js": 1, buffer: 4, ieee754: 246 }, + ], + 5: [ + function (e, t, r) { + t.exports = function (e) { + if ("function" != typeof e) + throw TypeError(String(e) + " is not a function"); + return e; + }; + }, + {}, + ], + 6: [ + function (e, t, r) { + var o = e("../internals/is-object"); + t.exports = function (e) { + if (o(e) || null === e) return e; + throw TypeError("Can't set " + String(e) + " as a prototype"); + }; + }, + { "../internals/is-object": 74 }, + ], + 7: [ + function (e, t, r) { + var o = e("../internals/well-known-symbol"), + n = e("../internals/object-create"), + e = e("../internals/object-define-property"), + s = o("unscopables"), + i = Array.prototype; + null == i[s] && e.f(i, s, { configurable: !0, value: n(null) }), + (t.exports = function (e) { + i[s][e] = !0; + }); + }, + { + "../internals/object-create": 90, + "../internals/object-define-property": 92, + "../internals/well-known-symbol": 148, + }, + ], + 8: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/string-multibyte").charAt; + t.exports = function (e, t, r) { + return t + (r ? o(e, t).length : 1); + }; + }, + { "../internals/string-multibyte": 123 }, + ], + 9: [ + function (e, t, r) { + t.exports = function (e, t, r) { + if (e instanceof t) return e; + throw TypeError("Incorrect " + (r ? r + " " : "") + "invocation"); + }; + }, + {}, + ], + 10: [ + function (e, t, r) { + var o = e("../internals/is-object"); + t.exports = function (e) { + if (o(e)) return e; + throw TypeError(String(e) + " is not an object"); + }; + }, + { "../internals/is-object": 74 }, + ], + 11: [ + function (e, t, r) { + t.exports = + "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView; + }, + {}, + ], + 12: [ + function (e, t, r) { + "use strict"; + function o(e) { + return l(e) && u(M, c(e)); + } + var n, + s = e("../internals/array-buffer-native"), + i = e("../internals/descriptors"), + a = e("../internals/global"), + l = e("../internals/is-object"), + u = e("../internals/has"), + c = e("../internals/classof"), + d = e("../internals/create-non-enumerable-property"), + h = e("../internals/redefine"), + f = e("../internals/object-define-property").f, + p = e("../internals/object-get-prototype-of"), + m = e("../internals/object-set-prototype-of"), + y = e("../internals/well-known-symbol"), + e = e("../internals/uid"), + g = a.Int8Array, + v = g && g.prototype, + b = a.Uint8ClampedArray, + b = b && b.prototype, + j = g && p(g), + _ = v && p(v), + x = Object.prototype, + w = x.isPrototypeOf, + y = y("toStringTag"), + S = e("TYPED_ARRAY_TAG"), + T = s && !!m && "Opera" !== c(a.opera), + e = !1, + M = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8, + }; + for (n in M) a[n] || (T = !1); + if ( + (!T || "function" != typeof j || j === Function.prototype) && + ((j = function () { + throw TypeError("Incorrect invocation"); + }), + T) + ) + for (n in M) a[n] && m(a[n], j); + if ((!T || !_ || _ === x) && ((_ = j.prototype), T)) + for (n in M) a[n] && m(a[n].prototype, _); + if ((T && p(b) !== _ && m(b, _), i && !u(_, y))) + for (n in ((e = !0), + f(_, y, { + get: function () { + return l(this) ? this[S] : void 0; + }, + }), + M)) + a[n] && d(a[n], S, n); + t.exports = { + NATIVE_ARRAY_BUFFER_VIEWS: T, + TYPED_ARRAY_TAG: e && S, + aTypedArray: function (e) { + if (o(e)) return e; + throw TypeError("Target is not a typed array"); + }, + aTypedArrayConstructor: function (e) { + if (m) { + if (w.call(j, e)) return e; + } else + for (var t in M) + if (u(M, n)) { + t = a[t]; + if (t && (e === t || w.call(t, e))) return e; + } + throw TypeError("Target is not a typed array constructor"); + }, + exportTypedArrayMethod: function (e, t, r) { + if (i) { + if (r) + for (var o in M) { + o = a[o]; + o && u(o.prototype, e) && delete o.prototype[e]; + } + (_[e] && !r) || h(_, e, (!r && T && v[e]) || t); + } + }, + exportTypedArrayStaticMethod: function (e, t, r) { + var o, n; + if (i) { + if (m) { + if (r) for (o in M) (n = a[o]) && u(n, e) && delete n[e]; + if (j[e] && !r) return; + try { + return h(j, e, (!r && T && g[e]) || t); + } catch (e) {} + } + for (o in M) !(n = a[o]) || (n[e] && !r) || h(n, e, t); + } + }, + isView: function (e) { + e = c(e); + return "DataView" === e || u(M, e); + }, + isTypedArray: o, + TypedArray: j, + TypedArrayPrototype: _, + }; + }, + { + "../internals/array-buffer-native": 11, + "../internals/classof": 29, + "../internals/create-non-enumerable-property": 38, + "../internals/descriptors": 43, + "../internals/global": 59, + "../internals/has": 60, + "../internals/is-object": 74, + "../internals/object-define-property": 92, + "../internals/object-get-prototype-of": 97, + "../internals/object-set-prototype-of": 101, + "../internals/redefine": 108, + "../internals/uid": 145, + "../internals/well-known-symbol": 148, + }, + ], + 13: [ + function (e, t, D) { + "use strict"; + function r(e) { + return [255 & e]; + } + function o(e) { + return [255 & e, (e >> 8) & 255]; + } + function n(e) { + return [255 & e, (e >> 8) & 255, (e >> 16) & 255, (e >> 24) & 255]; + } + function s(e) { + return (e[3] << 24) | (e[2] << 16) | (e[1] << 8) | e[0]; + } + function i(e) { + return O(e, 23, 4); + } + function F(e) { + return O(e, 52, 8); + } + function a(e, t) { + H(e[w], t, { + get: function () { + return b(this)[t]; + }, + }); + } + function l(e, t, r, o) { + if (((r = m(r)), (e = b(e)), r + t > e.byteLength)) throw C(S); + var n = b(e.buffer).bytes, + r = r + e.byteOffset, + e = n.slice(r, r + t); + return o ? e : e.reverse(); + } + function u(e, t, r, o, n, s) { + if (((r = m(r)), (e = b(e)), r + t > e.byteLength)) throw C(S); + for ( + var i = b(e.buffer).bytes, a = r + e.byteOffset, l = o(+n), u = 0; + u < t; + u++ + ) + i[a + u] = l[s ? u : t - u - 1]; + } + var c = e("../internals/global"), + d = e("../internals/descriptors"), + U = e("../internals/array-buffer-native"), + N = e("../internals/create-non-enumerable-property"), + h = e("../internals/redefine-all"), + f = e("../internals/fails"), + p = e("../internals/an-instance"), + B = e("../internals/to-integer"), + G = e("../internals/to-length"), + m = e("../internals/to-index"), + y = e("../internals/ieee754"), + V = e("../internals/object-get-prototype-of"), + g = e("../internals/object-set-prototype-of"), + z = e("../internals/object-get-own-property-names").f, + H = e("../internals/object-define-property").f, + W = e("../internals/array-fill"), + v = e("../internals/set-to-string-tag"), + e = e("../internals/internal-state"), + b = e.get, + j = e.set, + _ = "ArrayBuffer", + x = "DataView", + w = "prototype", + S = "Wrong index", + T = c[_], + M = T, + E = c[x], + e = E && E[w], + k = Object.prototype, + C = c.RangeError, + O = y.pack, + P = y.unpack; + if (U) { + if ( + !f(function () { + T(1); + }) || + !f(function () { + new T(-1); + }) || + f(function () { + return new T(), new T(1.5), new T(NaN), T.name != _; + }) + ) { + for ( + var A, + c = ((M = function (e) { + return p(this, M), new T(m(e)); + })[w] = T[w]), + L = z(T), + R = 0; + L.length > R; + + ) + (A = L[R++]) in M || N(M, A, T[A]); + c.constructor = M; + } + g && V(e) !== k && g(e, k); + var y = new E(new M(2)), + I = e.setInt8; + y.setInt8(0, 2147483648), + y.setInt8(1, 2147483649), + (!y.getInt8(0) && y.getInt8(1)) || + h( + e, + { + setInt8: function (e, t) { + I.call(this, e, (t << 24) >> 24); + }, + setUint8: function (e, t) { + I.call(this, e, (t << 24) >> 24); + }, + }, + { unsafe: !0 }, + ); + } else + (M = function (e) { + p(this, M, _); + e = m(e); + j(this, { bytes: W.call(new Array(e), 0), byteLength: e }), + d || (this.byteLength = e); + }), + (E = function (e, t, r) { + p(this, E, x), p(e, M, x); + var o = b(e).byteLength, + t = B(t); + if (t < 0 || o < t) throw C("Wrong offset"); + if (o < t + (r = void 0 === r ? o - t : G(r))) + throw C("Wrong length"); + j(this, { buffer: e, byteLength: r, byteOffset: t }), + d || + ((this.buffer = e), + (this.byteLength = r), + (this.byteOffset = t)); + }), + d && + (a(M, "byteLength"), + a(E, "buffer"), + a(E, "byteLength"), + a(E, "byteOffset")), + h(E[w], { + getInt8: function (e) { + return (l(this, 1, e)[0] << 24) >> 24; + }, + getUint8: function (e) { + return l(this, 1, e)[0]; + }, + getInt16: function (e) { + e = l( + this, + 2, + e, + 1 < arguments.length ? arguments[1] : void 0, + ); + return (((e[1] << 8) | e[0]) << 16) >> 16; + }, + getUint16: function (e) { + e = l( + this, + 2, + e, + 1 < arguments.length ? arguments[1] : void 0, + ); + return (e[1] << 8) | e[0]; + }, + getInt32: function (e) { + return s( + l(this, 4, e, 1 < arguments.length ? arguments[1] : void 0), + ); + }, + getUint32: function (e) { + return ( + s( + l( + this, + 4, + e, + 1 < arguments.length ? arguments[1] : void 0, + ), + ) >>> 0 + ); + }, + getFloat32: function (e) { + return P( + l(this, 4, e, 1 < arguments.length ? arguments[1] : void 0), + 23, + ); + }, + getFloat64: function (e) { + return P( + l(this, 8, e, 1 < arguments.length ? arguments[1] : void 0), + 52, + ); + }, + setInt8: function (e, t) { + u(this, 1, e, r, t); + }, + setUint8: function (e, t) { + u(this, 1, e, r, t); + }, + setInt16: function (e, t) { + u( + this, + 2, + e, + o, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }, + setUint16: function (e, t) { + u( + this, + 2, + e, + o, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }, + setInt32: function (e, t) { + u( + this, + 4, + e, + n, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }, + setUint32: function (e, t) { + u( + this, + 4, + e, + n, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }, + setFloat32: function (e, t) { + u( + this, + 4, + e, + i, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }, + setFloat64: function (e, t) { + u( + this, + 8, + e, + F, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }, + }); + v(M, _), v(E, x), (t.exports = { ArrayBuffer: M, DataView: E }); + }, + { + "../internals/an-instance": 9, + "../internals/array-buffer-native": 11, + "../internals/array-fill": 15, + "../internals/create-non-enumerable-property": 38, + "../internals/descriptors": 43, + "../internals/fails": 51, + "../internals/global": 59, + "../internals/ieee754": 65, + "../internals/internal-state": 70, + "../internals/object-define-property": 92, + "../internals/object-get-own-property-names": 95, + "../internals/object-get-prototype-of": 97, + "../internals/object-set-prototype-of": 101, + "../internals/redefine-all": 107, + "../internals/set-to-string-tag": 117, + "../internals/to-index": 133, + "../internals/to-integer": 135, + "../internals/to-length": 136, + }, + ], + 14: [ + function (e, t, r) { + "use strict"; + var l = e("../internals/to-object"), + u = e("../internals/to-absolute-index"), + c = e("../internals/to-length"), + d = Math.min; + t.exports = + [].copyWithin || + function (e, t) { + var r = l(this), + o = c(r.length), + n = u(e, o), + s = u(t, o), + e = 2 < arguments.length ? arguments[2] : void 0, + i = d((void 0 === e ? o : u(e, o)) - s, o - n), + a = 1; + for ( + s < n && n < s + i && ((a = -1), (s += i - 1), (n += i - 1)); + 0 < i--; + + ) + s in r ? (r[n] = r[s]) : delete r[n], (n += a), (s += a); + return r; + }; + }, + { + "../internals/to-absolute-index": 132, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 15: [ + function (e, t, r) { + "use strict"; + var i = e("../internals/to-object"), + a = e("../internals/to-absolute-index"), + l = e("../internals/to-length"); + t.exports = function (e) { + for ( + var t = i(this), + r = l(t.length), + o = arguments.length, + n = a(1 < o ? arguments[1] : void 0, r), + o = 2 < o ? arguments[2] : void 0, + s = void 0 === o ? r : a(o, r); + n < s; + + ) + t[n++] = e; + return t; + }; + }, + { + "../internals/to-absolute-index": 132, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 16: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-iteration").forEach, + n = e("../internals/array-method-is-strict"), + e = e("../internals/array-method-uses-to-length"), + n = n("forEach"), + e = e("forEach"); + t.exports = + n && e + ? [].forEach + : function (e) { + return o( + this, + e, + 1 < arguments.length ? arguments[1] : void 0, + ); + }; + }, + { + "../internals/array-iteration": 19, + "../internals/array-method-is-strict": 22, + "../internals/array-method-uses-to-length": 23, + }, + ], + 17: [ + function (e, t, r) { + "use strict"; + var f = e("../internals/function-bind-context"), + p = e("../internals/to-object"), + m = e("../internals/call-with-safe-iteration-closing"), + y = e("../internals/is-array-iterator-method"), + g = e("../internals/to-length"), + v = e("../internals/create-property"), + b = e("../internals/get-iterator-method"); + t.exports = function (e) { + var t, + r, + o, + n, + s, + i, + a = p(e), + e = "function" == typeof this ? this : Array, + l = arguments.length, + u = 1 < l ? arguments[1] : void 0, + c = void 0 !== u, + d = b(a), + h = 0; + if ( + (c && (u = f(u, 2 < l ? arguments[2] : void 0, 2)), + null == d || (e == Array && y(d))) + ) + for (r = new e((t = g(a.length))); h < t; h++) + (i = c ? u(a[h], h) : a[h]), v(r, h, i); + else + for ( + s = (n = d.call(a)).next, r = new e(); + !(o = s.call(n)).done; + h++ + ) + (i = c ? m(n, u, [o.value, h], !0) : o.value), v(r, h, i); + return (r.length = h), r; + }; + }, + { + "../internals/call-with-safe-iteration-closing": 26, + "../internals/create-property": 40, + "../internals/function-bind-context": 54, + "../internals/get-iterator-method": 57, + "../internals/is-array-iterator-method": 71, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 18: [ + function (e, t, r) { + function o(a) { + return function (e, t, r) { + var o, + n = l(e), + s = u(n.length), + i = c(r, s); + if (a && t != t) { + for (; i < s; ) if ((o = n[i++]) != o) return !0; + } else + for (; i < s; i++) + if ((a || i in n) && n[i] === t) return a || i || 0; + return !a && -1; + }; + } + var l = e("../internals/to-indexed-object"), + u = e("../internals/to-length"), + c = e("../internals/to-absolute-index"); + t.exports = { includes: o(!0), indexOf: o(!1) }; + }, + { + "../internals/to-absolute-index": 132, + "../internals/to-indexed-object": 134, + "../internals/to-length": 136, + }, + ], + 19: [ + function (e, t, r) { + function o(h) { + var f = 1 == h, + p = 2 == h, + m = 3 == h, + y = 4 == h, + g = 6 == h, + v = 5 == h || g; + return function (e, t, r, o) { + for ( + var n, + s, + i = _(e), + a = j(i), + l = b(t, r, 3), + u = x(a.length), + c = 0, + t = o || w, + d = f ? t(e, u) : p ? t(e, 0) : void 0; + c < u; + c++ + ) + if ((v || c in a) && ((s = l((n = a[c]), c, i)), h)) + if (f) d[c] = s; + else if (s) + switch (h) { + case 3: + return !0; + case 5: + return n; + case 6: + return c; + case 2: + S.call(d, n); + } + else if (y) return !1; + return g ? -1 : m || y ? y : d; + }; + } + var b = e("../internals/function-bind-context"), + j = e("../internals/indexed-object"), + _ = e("../internals/to-object"), + x = e("../internals/to-length"), + w = e("../internals/array-species-create"), + S = [].push; + t.exports = { + forEach: o(0), + map: o(1), + filter: o(2), + some: o(3), + every: o(4), + find: o(5), + findIndex: o(6), + }; + }, + { + "../internals/array-species-create": 25, + "../internals/function-bind-context": 54, + "../internals/indexed-object": 66, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 20: [ + function (e, t, r) { + "use strict"; + var n = e("../internals/to-indexed-object"), + s = e("../internals/to-integer"), + i = e("../internals/to-length"), + o = e("../internals/array-method-is-strict"), + e = e("../internals/array-method-uses-to-length"), + a = Math.min, + l = [].lastIndexOf, + u = !!l && 1 / [1].lastIndexOf(1, -0) < 0, + o = o("lastIndexOf"), + e = e("indexOf", { ACCESSORS: !0, 1: 0 }); + t.exports = + u || !o || !e + ? function (e) { + if (u) return l.apply(this, arguments) || 0; + var t = n(this), + r = i(t.length), + o = r - 1; + for ( + (o = 1 < arguments.length ? a(o, s(arguments[1])) : o) < + 0 && (o = r + o); + 0 <= o; + o-- + ) + if (o in t && t[o] === e) return o || 0; + return -1; + } + : l; + }, + { + "../internals/array-method-is-strict": 22, + "../internals/array-method-uses-to-length": 23, + "../internals/to-indexed-object": 134, + "../internals/to-integer": 135, + "../internals/to-length": 136, + }, + ], + 21: [ + function (e, t, r) { + var o = e("../internals/fails"), + n = e("../internals/well-known-symbol"), + s = e("../internals/engine-v8-version"), + i = n("species"); + t.exports = function (t) { + return ( + 51 <= s || + !o(function () { + var e = []; + return ( + ((e.constructor = {})[i] = function () { + return { foo: 1 }; + }), + 1 !== e[t](Boolean).foo + ); + }) + ); + }; + }, + { + "../internals/engine-v8-version": 48, + "../internals/fails": 51, + "../internals/well-known-symbol": 148, + }, + ], + 22: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/fails"); + t.exports = function (e, t) { + var r = [][e]; + return ( + !!r && + o(function () { + r.call( + null, + t || + function () { + throw 1; + }, + 1, + ); + }) + ); + }; + }, + { "../internals/fails": 51 }, + ], + 23: [ + function (e, t, r) { + function i(e) { + throw e; + } + var a = e("../internals/descriptors"), + l = e("../internals/fails"), + u = e("../internals/has"), + c = Object.defineProperty, + d = {}; + t.exports = function (e, t) { + var r, o, n, s; + return u(d, e) + ? d[e] + : ((r = [][e]), + (o = !!u((t = t || {}), "ACCESSORS") && t.ACCESSORS), + (n = u(t, 0) ? t[0] : i), + (s = u(t, 1) ? t[1] : void 0), + (d[e] = + !!r && + !l(function () { + if (o && !a) return !0; + var e = { length: -1 }; + o ? c(e, 1, { enumerable: !0, get: i }) : (e[1] = 1), + r.call(e, n, s); + }))); + }; + }, + { + "../internals/descriptors": 43, + "../internals/fails": 51, + "../internals/has": 60, + }, + ], + 24: [ + function (e, t, r) { + function o(u) { + return function (e, t, r, o) { + c(t); + var n = d(e), + s = h(n), + i = f(n.length), + a = u ? i - 1 : 0, + l = u ? -1 : 1; + if (r < 2) + for (;;) { + if (a in s) { + (o = s[a]), (a += l); + break; + } + if (((a += l), u ? a < 0 : i <= a)) + throw TypeError( + "Reduce of empty array with no initial value", + ); + } + for (; u ? 0 <= a : a < i; a += l) + a in s && (o = t(o, s[a], a, n)); + return o; + }; + } + var c = e("../internals/a-function"), + d = e("../internals/to-object"), + h = e("../internals/indexed-object"), + f = e("../internals/to-length"); + t.exports = { left: o(!1), right: o(!0) }; + }, + { + "../internals/a-function": 5, + "../internals/indexed-object": 66, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 25: [ + function (e, t, r) { + var o = e("../internals/is-object"), + n = e("../internals/is-array"), + s = e("../internals/well-known-symbol")("species"); + t.exports = function (e, t) { + var r; + return new ( + void 0 === + (r = + n(e) && + (("function" == typeof (r = e.constructor) && + (r === Array || n(r.prototype))) || + (o(r) && null === (r = r[s]))) + ? void 0 + : r) + ? Array + : r + )(0 === t ? 0 : t); + }; + }, + { + "../internals/is-array": 72, + "../internals/is-object": 74, + "../internals/well-known-symbol": 148, + }, + ], + 26: [ + function (e, t, r) { + var n = e("../internals/an-object"); + t.exports = function (t, e, r, o) { + try { + return o ? e(n(r)[0], r[1]) : e(r); + } catch (e) { + o = t.return; + throw (void 0 !== o && n(o.call(t)), e); + } + }; + }, + { "../internals/an-object": 10 }, + ], + 27: [ + function (e, t, r) { + var n = e("../internals/well-known-symbol")("iterator"), + s = !1; + try { + var o = 0, + i = { + next: function () { + return { done: !!o++ }; + }, + return: function () { + s = !0; + }, + }; + (i[n] = function () { + return this; + }), + Array.from(i, function () { + throw 2; + }); + } catch (e) {} + t.exports = function (e, t) { + if (!t && !s) return !1; + var r = !1; + try { + var o = {}; + (o[n] = function () { + return { + next: function () { + return { done: (r = !0) }; + }, + }; + }), + e(o); + } catch (e) {} + return r; + }; + }, + { "../internals/well-known-symbol": 148 }, + ], + 28: [ + function (e, t, r) { + var o = {}.toString; + t.exports = function (e) { + return o.call(e).slice(8, -1); + }; + }, + {}, + ], + 29: [ + function (e, t, r) { + var o = e("../internals/to-string-tag-support"), + n = e("../internals/classof-raw"), + s = e("../internals/well-known-symbol")("toStringTag"), + i = + "Arguments" == + n( + (function () { + return arguments; + })(), + ); + t.exports = o + ? n + : function (e) { + var t; + return void 0 === e + ? "Undefined" + : null === e + ? "Null" + : "string" == + typeof (t = (function (e, t) { + try { + return e[t]; + } catch (e) {} + })((e = Object(e)), s)) + ? t + : i + ? n(e) + : "Object" == (t = n(e)) && + "function" == typeof e.callee + ? "Arguments" + : t; + }; + }, + { + "../internals/classof-raw": 28, + "../internals/to-string-tag-support": 141, + "../internals/well-known-symbol": 148, + }, + ], + 30: [ + function (e, t, r) { + "use strict"; + var u = e("../internals/object-define-property").f, + c = e("../internals/object-create"), + d = e("../internals/redefine-all"), + h = e("../internals/function-bind-context"), + f = e("../internals/an-instance"), + p = e("../internals/iterate"), + i = e("../internals/define-iterator"), + a = e("../internals/set-species"), + m = e("../internals/descriptors"), + y = e("../internals/internal-metadata").fastKey, + e = e("../internals/internal-state"), + g = e.set, + v = e.getterFor; + t.exports = { + getConstructor: function (e, r, o, n) { + function s(e, t, r) { + var o, + n = l(e), + s = i(e, t); + return ( + s + ? (s.value = r) + : ((n.last = s = + { + index: (o = y(t, !0)), + key: t, + value: r, + previous: (t = n.last), + next: void 0, + removed: !1, + }), + n.first || (n.first = s), + t && (t.next = s), + m ? n.size++ : e.size++, + "F" !== o && (n.index[o] = s)), + e + ); + } + function i(e, t) { + var r, + e = l(e), + o = y(t); + if ("F" !== o) return e.index[o]; + for (r = e.first; r; r = r.next) if (r.key == t) return r; + } + var a = e(function (e, t) { + f(e, a, r), + g(e, { + type: r, + index: c(null), + first: void 0, + last: void 0, + size: 0, + }), + m || (e.size = 0), + null != t && p(t, e[n], e, o); + }), + l = v(r); + return ( + d(a.prototype, { + clear: function () { + for (var e = l(this), t = e.index, r = e.first; r; ) + (r.removed = !0), + r.previous && (r.previous = r.previous.next = void 0), + delete t[r.index], + (r = r.next); + (e.first = e.last = void 0), + m ? (e.size = 0) : (this.size = 0); + }, + delete: function (e) { + var t, + r, + o = l(this), + e = i(this, e); + return ( + e && + ((t = e.next), + (r = e.previous), + delete o.index[e.index], + (e.removed = !0), + r && (r.next = t), + t && (t.previous = r), + o.first == e && (o.first = t), + o.last == e && (o.last = r), + m ? o.size-- : this.size--), + !!e + ); + }, + forEach: function (e) { + for ( + var t, + r = l(this), + o = h( + e, + 1 < arguments.length ? arguments[1] : void 0, + 3, + ); + (t = t ? t.next : r.first); + + ) + for (o(t.value, t.key, this); t && t.removed; ) + t = t.previous; + }, + has: function (e) { + return !!i(this, e); + }, + }), + d( + a.prototype, + o + ? { + get: function (e) { + e = i(this, e); + return e && e.value; + }, + set: function (e, t) { + return s(this, 0 === e ? 0 : e, t); + }, + } + : { + add: function (e) { + return s(this, (e = 0 === e ? 0 : e), e); + }, + }, + ), + m && + u(a.prototype, "size", { + get: function () { + return l(this).size; + }, + }), + a + ); + }, + setStrong: function (e, t, r) { + var o = t + " Iterator", + n = v(t), + s = v(o); + i( + e, + t, + function (e, t) { + g(this, { + type: o, + target: e, + state: n(e), + kind: t, + last: void 0, + }); + }, + function () { + for ( + var e = s(this), t = e.kind, r = e.last; + r && r.removed; + + ) + r = r.previous; + return e.target && (e.last = r = r ? r.next : e.state.first) + ? "keys" == t + ? { value: r.key, done: !1 } + : "values" == t + ? { value: r.value, done: !1 } + : { value: [r.key, r.value], done: !1 } + : { value: (e.target = void 0), done: !0 }; + }, + r ? "entries" : "values", + !r, + !0, + ), + a(t); + }, + }; + }, + { + "../internals/an-instance": 9, + "../internals/define-iterator": 41, + "../internals/descriptors": 43, + "../internals/function-bind-context": 54, + "../internals/internal-metadata": 69, + "../internals/internal-state": 70, + "../internals/iterate": 77, + "../internals/object-create": 90, + "../internals/object-define-property": 92, + "../internals/redefine-all": 107, + "../internals/set-species": 116, + }, + ], + 31: [ + function (e, t, r) { + "use strict"; + function l(e) { + return e.frozen || (e.frozen = new o()); + } + function o() { + this.entries = []; + } + function n(e, t) { + return i(e.entries, function (e) { + return e[0] === t; + }); + } + var u = e("../internals/redefine-all"), + c = e("../internals/internal-metadata").getWeakData, + d = e("../internals/an-object"), + h = e("../internals/is-object"), + f = e("../internals/an-instance"), + p = e("../internals/iterate"), + s = e("../internals/array-iteration"), + m = e("../internals/has"), + e = e("../internals/internal-state"), + y = e.set, + g = e.getterFor, + i = s.find, + a = s.findIndex, + v = 0; + (o.prototype = { + get: function (e) { + e = n(this, e); + if (e) return e[1]; + }, + has: function (e) { + return !!n(this, e); + }, + set: function (e, t) { + var r = n(this, e); + r ? (r[1] = t) : this.entries.push([e, t]); + }, + delete: function (t) { + var e = a(this.entries, function (e) { + return e[0] === t; + }); + return ~e && this.entries.splice(e, 1), !!~e; + }, + }), + (t.exports = { + getConstructor: function (e, r, o, n) { + function s(e, t, r) { + var o = a(e), + n = c(d(t), !0); + return !0 === n ? l(o).set(t, r) : (n[o.id] = r), e; + } + var i = e(function (e, t) { + f(e, i, r), + y(e, { type: r, id: v++, frozen: void 0 }), + null != t && p(t, e[n], e, o); + }), + a = g(r); + return ( + u(i.prototype, { + delete: function (e) { + var t, + r = a(this); + return ( + !!h(e) && + (!0 === (t = c(e)) + ? l(r).delete(e) + : t && m(t, r.id) && delete t[r.id]) + ); + }, + has: function (e) { + var t, + r = a(this); + return ( + !!h(e) && + (!0 === (t = c(e)) ? l(r).has(e) : t && m(t, r.id)) + ); + }, + }), + u( + i.prototype, + o + ? { + get: function (e) { + var t, + r = a(this); + if (h(e)) + return !0 === (t = c(e)) + ? l(r).get(e) + : t + ? t[r.id] + : void 0; + }, + set: function (e, t) { + return s(this, e, t); + }, + } + : { + add: function (e) { + return s(this, e, !0); + }, + }, + ), + i + ); + }, + }); + }, + { + "../internals/an-instance": 9, + "../internals/an-object": 10, + "../internals/array-iteration": 19, + "../internals/has": 60, + "../internals/internal-metadata": 69, + "../internals/internal-state": 70, + "../internals/is-object": 74, + "../internals/iterate": 77, + "../internals/redefine-all": 107, + }, + ], + 32: [ + function (e, t, r) { + "use strict"; + var y = e("../internals/export"), + g = e("../internals/global"), + v = e("../internals/is-forced"), + b = e("../internals/redefine"), + j = e("../internals/internal-metadata"), + _ = e("../internals/iterate"), + x = e("../internals/an-instance"), + w = e("../internals/is-object"), + S = e("../internals/fails"), + T = e("../internals/check-correctness-of-iteration"), + M = e("../internals/set-to-string-tag"), + E = e("../internals/inherit-if-required"); + t.exports = function (r, e, t) { + function o(e) { + var r = f[e]; + b( + f, + e, + "add" == e + ? function (e) { + return r.call(this, 0 === e ? 0 : e), this; + } + : "delete" == e + ? function (e) { + return !(c && !w(e)) && r.call(this, 0 === e ? 0 : e); + } + : "get" == e + ? function (e) { + return c && !w(e) + ? void 0 + : r.call(this, 0 === e ? 0 : e); + } + : "has" == e + ? function (e) { + return ( + !(c && !w(e)) && r.call(this, 0 === e ? 0 : e) + ); + } + : function (e, t) { + return r.call(this, 0 === e ? 0 : e, t), this; + }, + ); + } + var n, + s, + i, + a, + l, + u = -1 !== r.indexOf("Map"), + c = -1 !== r.indexOf("Weak"), + d = u ? "set" : "add", + h = g[r], + f = h && h.prototype, + p = h, + m = {}; + return ( + v( + r, + "function" != typeof h || + !( + c || + (f.forEach && + !S(function () { + new h().entries().next(); + })) + ), + ) + ? ((p = t.getConstructor(e, r, u, d)), (j.REQUIRED = !0)) + : v(r, !0) && + ((s = (n = new p())[d](c ? {} : -0, 1) != n), + (i = S(function () { + n.has(1); + })), + (a = T(function (e) { + new h(e); + })), + (l = + !c && + S(function () { + for (var e = new h(), t = 5; t--; ) e[d](t, t); + return !e.has(-0); + })), + a || + (((p = e(function (e, t) { + x(e, p, r); + e = E(new h(), e, p); + return null != t && _(t, e[d], e, u), e; + })).prototype = f).constructor = p), + (i || l) && (o("delete"), o("has"), u && o("get")), + (l || s) && o(d), + c && f.clear && delete f.clear), + (m[r] = p), + y({ global: !0, forced: p != h }, m), + M(p, r), + c || t.setStrong(p, r, u), + p + ); + }; + }, + { + "../internals/an-instance": 9, + "../internals/check-correctness-of-iteration": 27, + "../internals/export": 50, + "../internals/fails": 51, + "../internals/global": 59, + "../internals/inherit-if-required": 67, + "../internals/internal-metadata": 69, + "../internals/is-forced": 73, + "../internals/is-object": 74, + "../internals/iterate": 77, + "../internals/redefine": 108, + "../internals/set-to-string-tag": 117, + }, + ], + 33: [ + function (e, t, r) { + var a = e("../internals/has"), + l = e("../internals/own-keys"), + u = e("../internals/object-get-own-property-descriptor"), + c = e("../internals/object-define-property"); + t.exports = function (e, t) { + for (var r = l(t), o = c.f, n = u.f, s = 0; s < r.length; s++) { + var i = r[s]; + a(e, i) || o(e, i, n(t, i)); + } + }; + }, + { + "../internals/has": 60, + "../internals/object-define-property": 92, + "../internals/object-get-own-property-descriptor": 93, + "../internals/own-keys": 103, + }, + ], + 34: [ + function (e, t, r) { + var o = e("../internals/well-known-symbol")("match"); + t.exports = function (t) { + var r = /./; + try { + "/./"[t](r); + } catch (e) { + try { + return (r[o] = !1), "/./"[t](r); + } catch (e) {} + } + return !1; + }; + }, + { "../internals/well-known-symbol": 148 }, + ], + 35: [ + function (e, t, r) { + e = e("../internals/fails"); + t.exports = !e(function () { + function e() {} + return ( + (e.prototype.constructor = null), + Object.getPrototypeOf(new e()) !== e.prototype + ); + }); + }, + { "../internals/fails": 51 }, + ], + 36: [ + function (e, t, r) { + var s = e("../internals/require-object-coercible"), + i = /"/g; + t.exports = function (e, t, r, o) { + var e = String(s(e)), + n = "<" + t; + return ( + "" !== r && + (n += " " + r + '="' + String(o).replace(i, """) + '"'), + n + ">" + e + "" + ); + }; + }, + { "../internals/require-object-coercible": 113 }, + ], + 37: [ + function (e, t, r) { + "use strict"; + function o() { + return this; + } + var n = e("../internals/iterators-core").IteratorPrototype, + s = e("../internals/object-create"), + i = e("../internals/create-property-descriptor"), + a = e("../internals/set-to-string-tag"), + l = e("../internals/iterators"); + t.exports = function (e, t, r) { + t += " Iterator"; + return ( + (e.prototype = s(n, { next: i(1, r) })), + a(e, t, !1, !0), + (l[t] = o), + e + ); + }; + }, + { + "../internals/create-property-descriptor": 39, + "../internals/iterators": 79, + "../internals/iterators-core": 78, + "../internals/object-create": 90, + "../internals/set-to-string-tag": 117, + }, + ], + 38: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + n = e("../internals/object-define-property"), + s = e("../internals/create-property-descriptor"); + t.exports = o + ? function (e, t, r) { + return n.f(e, t, s(1, r)); + } + : function (e, t, r) { + return (e[t] = r), e; + }; + }, + { + "../internals/create-property-descriptor": 39, + "../internals/descriptors": 43, + "../internals/object-define-property": 92, + }, + ], + 39: [ + function (e, t, r) { + t.exports = function (e, t) { + return { + enumerable: !(1 & e), + configurable: !(2 & e), + writable: !(4 & e), + value: t, + }; + }; + }, + {}, + ], + 40: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/to-primitive"), + n = e("../internals/object-define-property"), + s = e("../internals/create-property-descriptor"); + t.exports = function (e, t, r) { + t = o(t); + t in e ? n.f(e, t, s(0, r)) : (e[t] = r); + }; + }, + { + "../internals/create-property-descriptor": 39, + "../internals/object-define-property": 92, + "../internals/to-primitive": 140, + }, + ], + 41: [ + function (e, t, r) { + "use strict"; + function m() { + return this; + } + var y = e("../internals/export"), + g = e("../internals/create-iterator-constructor"), + v = e("../internals/object-get-prototype-of"), + b = e("../internals/object-set-prototype-of"), + j = e("../internals/set-to-string-tag"), + _ = e("../internals/create-non-enumerable-property"), + x = e("../internals/redefine"), + o = e("../internals/well-known-symbol"), + w = e("../internals/is-pure"), + S = e("../internals/iterators"), + e = e("../internals/iterators-core"), + T = e.IteratorPrototype, + M = e.BUGGY_SAFARI_ITERATORS, + E = o("iterator"), + k = "values", + C = "entries"; + t.exports = function (e, t, r, o, n, s, i) { + g(r, t, o); + function a(e) { + if (e === n && f) return f; + if (!M && e in d) return d[e]; + switch (e) { + case "keys": + case k: + case C: + return function () { + return new r(this, e); + }; + } + return function () { + return new r(this); + }; + } + var l, + u, + o = t + " Iterator", + c = !1, + d = e.prototype, + h = d[E] || d["@@iterator"] || (n && d[n]), + f = (!M && h) || a(n), + p = ("Array" == t && d.entries) || h; + if ( + (p && + ((p = v(p.call(new e()))), + T !== Object.prototype && + p.next && + (w || + v(p) === T || + (b ? b(p, T) : "function" != typeof p[E] && _(p, E, m)), + j(p, o, !0, !0), + w && (S[o] = m))), + n == k && + h && + h.name !== k && + ((c = !0), + (f = function () { + return h.call(this); + })), + (w && !i) || d[E] === f || _(d, E, f), + (S[t] = f), + n) + ) + if ( + ((l = { values: a(k), keys: s ? f : a("keys"), entries: a(C) }), + i) + ) + for (u in l) (!M && !c && u in d) || x(d, u, l[u]); + else y({ target: t, proto: !0, forced: M || c }, l); + return l; + }; + }, + { + "../internals/create-iterator-constructor": 37, + "../internals/create-non-enumerable-property": 38, + "../internals/export": 50, + "../internals/is-pure": 75, + "../internals/iterators": 79, + "../internals/iterators-core": 78, + "../internals/object-get-prototype-of": 97, + "../internals/object-set-prototype-of": 101, + "../internals/redefine": 108, + "../internals/set-to-string-tag": 117, + "../internals/well-known-symbol": 148, + }, + ], + 42: [ + function (e, t, r) { + var o = e("../internals/path"), + n = e("../internals/has"), + s = e("../internals/well-known-symbol-wrapped"), + i = e("../internals/object-define-property").f; + t.exports = function (e) { + var t = o.Symbol || (o.Symbol = {}); + n(t, e) || i(t, e, { value: s.f(e) }); + }; + }, + { + "../internals/has": 60, + "../internals/object-define-property": 92, + "../internals/path": 104, + "../internals/well-known-symbol-wrapped": 147, + }, + ], + 43: [ + function (e, t, r) { + e = e("../internals/fails"); + t.exports = !e(function () { + return ( + 7 != + Object.defineProperty({}, 1, { + get: function () { + return 7; + }, + })[1] + ); + }); + }, + { "../internals/fails": 51 }, + ], + 44: [ + function (e, t, r) { + var o = e("../internals/global"), + e = e("../internals/is-object"), + n = o.document, + s = e(n) && e(n.createElement); + t.exports = function (e) { + return s ? n.createElement(e) : {}; + }; + }, + { "../internals/global": 59, "../internals/is-object": 74 }, + ], + 45: [ + function (e, t, r) { + t.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0, + }; + }, + {}, + ], + 46: [ + function (e, t, r) { + e = e("../internals/engine-user-agent"); + t.exports = /(iphone|ipod|ipad).*applewebkit/i.test(e); + }, + { "../internals/engine-user-agent": 47 }, + ], + 47: [ + function (e, t, r) { + e = e("../internals/get-built-in"); + t.exports = e("navigator", "userAgent") || ""; + }, + { "../internals/get-built-in": 56 }, + ], + 48: [ + function (e, t, r) { + var o, + n, + s = e("../internals/global"), + e = e("../internals/engine-user-agent"), + s = s.process, + s = s && s.versions, + s = s && s.v8; + s + ? (n = (o = s.split("."))[0] + o[1]) + : e && + (!(o = e.match(/Edge\/(\d+)/)) || 74 <= o[1]) && + (o = e.match(/Chrome\/(\d+)/)) && + (n = o[1]), + (t.exports = n && +n); + }, + { "../internals/engine-user-agent": 47, "../internals/global": 59 }, + ], + 49: [ + function (e, t, r) { + t.exports = [ + "constructor", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "toLocaleString", + "toString", + "valueOf", + ]; + }, + {}, + ], + 50: [ + function (e, t, r) { + var u = e("../internals/global"), + c = e("../internals/object-get-own-property-descriptor").f, + d = e("../internals/create-non-enumerable-property"), + h = e("../internals/redefine"), + f = e("../internals/set-global"), + p = e("../internals/copy-constructor-properties"), + m = e("../internals/is-forced"); + t.exports = function (e, t) { + var r, + o, + n, + s = e.target, + i = e.global, + a = e.stat, + l = i ? u : a ? u[s] || f(s, {}) : (u[s] || {}).prototype; + if (l) + for (r in t) { + if ( + ((o = t[r]), + (n = e.noTargetGet ? (n = c(l, r)) && n.value : l[r]), + !m(i ? r : s + (a ? "." : "#") + r, e.forced) && void 0 !== n) + ) { + if (typeof o == typeof n) continue; + p(o, n); + } + (e.sham || (n && n.sham)) && d(o, "sham", !0), h(l, r, o, e); + } + }; + }, + { + "../internals/copy-constructor-properties": 33, + "../internals/create-non-enumerable-property": 38, + "../internals/global": 59, + "../internals/is-forced": 73, + "../internals/object-get-own-property-descriptor": 93, + "../internals/redefine": 108, + "../internals/set-global": 115, + }, + ], + 51: [ + function (e, t, r) { + t.exports = function (e) { + try { + return !!e(); + } catch (e) { + return !0; + } + }; + }, + {}, + ], + 52: [ + function (e, t, r) { + "use strict"; + e("../modules/es.regexp.exec"); + var u = e("../internals/redefine"), + c = e("../internals/fails"), + d = e("../internals/well-known-symbol"), + h = e("../internals/regexp-exec"), + f = e("../internals/create-non-enumerable-property"), + p = d("species"), + m = !c(function () { + var e = /./; + return ( + (e.exec = function () { + var e = []; + return (e.groups = { a: "7" }), e; + }), + "7" !== "".replace(e, "$") + ); + }), + y = "$0" === "a".replace(/./, "$0"), + e = d("replace"), + g = !!/./[e] && "" === /./[e]("a", "$0"), + v = !c(function () { + var e = /(?:)/, + t = e.exec, + e = + ((e.exec = function () { + return t.apply(this, arguments); + }), + "ab".split(e)); + return 2 !== e.length || "a" !== e[0] || "b" !== e[1]; + }); + t.exports = function (r, e, t, o) { + var s, + n, + i = d(r), + a = !c(function () { + var e = {}; + return ( + (e[i] = function () { + return 7; + }), + 7 != ""[r](e) + ); + }), + l = + a && + !c(function () { + var e = !1, + t = /a/; + return ( + "split" === r && + (((t = { constructor: {} }).constructor[p] = function () { + return t; + }), + (t.flags = ""), + (t[i] = /./[i])), + (t.exec = function () { + return (e = !0), null; + }), + t[i](""), + !e + ); + }); + (a && + l && + ("replace" !== r || (m && y && !g)) && + ("split" !== r || v)) || + ((s = /./[i]), + (t = (l = t( + i, + ""[r], + function (e, t, r, o, n) { + return t.exec === h + ? a && !n + ? { done: !0, value: s.call(t, r, o) } + : { done: !0, value: e.call(r, t, o) } + : { done: !1 }; + }, + { + REPLACE_KEEPS_$0: y, + REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: g, + }, + ))[0]), + (n = l[1]), + u(String.prototype, r, t), + u( + RegExp.prototype, + i, + 2 == e + ? function (e, t) { + return n.call(e, this, t); + } + : function (e) { + return n.call(e, this); + }, + )), + o && f(RegExp.prototype[i], "sham", !0); + }; + }, + { + "../internals/create-non-enumerable-property": 38, + "../internals/fails": 51, + "../internals/redefine": 108, + "../internals/regexp-exec": 110, + "../internals/well-known-symbol": 148, + "../modules/es.regexp.exec": 187, + }, + ], + 53: [ + function (e, t, r) { + e = e("../internals/fails"); + t.exports = !e(function () { + return Object.isExtensible(Object.preventExtensions({})); + }); + }, + { "../internals/fails": 51 }, + ], + 54: [ + function (e, t, r) { + var s = e("../internals/a-function"); + t.exports = function (o, n, e) { + if ((s(o), void 0 === n)) return o; + switch (e) { + case 0: + return function () { + return o.call(n); + }; + case 1: + return function (e) { + return o.call(n, e); + }; + case 2: + return function (e, t) { + return o.call(n, e, t); + }; + case 3: + return function (e, t, r) { + return o.call(n, e, t, r); + }; + } + return function () { + return o.apply(n, arguments); + }; + }; + }, + { "../internals/a-function": 5 }, + ], + 55: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/a-function"), + n = e("../internals/is-object"), + c = [].slice, + d = {}; + t.exports = + Function.bind || + function (i) { + var a = o(this), + l = c.call(arguments, 1), + u = function () { + var e = l.concat(c.call(arguments)); + if (this instanceof u) { + var t = a, + r = e.length, + o = e; + if (!(r in d)) { + for (var n = [], s = 0; s < r; s++) n[s] = "a[" + s + "]"; + d[r] = Function( + "C,a", + "return new C(" + n.join(",") + ")", + ); + } + return d[r](t, o); + } + return a.apply(i, e); + }; + return n(a.prototype) && (u.prototype = a.prototype), u; + }; + }, + { "../internals/a-function": 5, "../internals/is-object": 74 }, + ], + 56: [ + function (e, t, r) { + function o(e) { + return "function" == typeof e ? e : void 0; + } + var n = e("../internals/path"), + s = e("../internals/global"); + t.exports = function (e, t) { + return arguments.length < 2 + ? o(n[e]) || o(s[e]) + : (n[e] && n[e][t]) || (s[e] && s[e][t]); + }; + }, + { "../internals/global": 59, "../internals/path": 104 }, + ], + 57: [ + function (e, t, r) { + var o = e("../internals/classof"), + n = e("../internals/iterators"), + s = e("../internals/well-known-symbol")("iterator"); + t.exports = function (e) { + if (null != e) return e[s] || e["@@iterator"] || n[o(e)]; + }; + }, + { + "../internals/classof": 29, + "../internals/iterators": 79, + "../internals/well-known-symbol": 148, + }, + ], + 58: [ + function (e, t, r) { + var o = e("../internals/an-object"), + n = e("../internals/get-iterator-method"); + t.exports = function (e) { + var t = n(e); + if ("function" != typeof t) + throw TypeError(String(e) + " is not iterable"); + return o(t.call(e)); + }; + }, + { + "../internals/an-object": 10, + "../internals/get-iterator-method": 57, + }, + ], + 59: [ + function (e, r, t) { + !function (e) { + function t(e) { + return e && e.Math == Math && e; + } + r.exports = + t("object" == typeof globalThis && globalThis) || + t("object" == typeof window && window) || + t("object" == typeof self && self) || + t("object" == typeof e && e) || + Function("return this")(); + }.call( + this, + "undefined" != typeof global + ? global + : "undefined" != typeof self + ? self + : "undefined" != typeof window + ? window + : {}, + ); + }, + {}, + ], + 60: [ + function (e, t, r) { + var o = {}.hasOwnProperty; + t.exports = function (e, t) { + return o.call(e, t); + }; + }, + {}, + ], + 61: [ + function (e, t, r) { + t.exports = {}; + }, + {}, + ], + 62: [ + function (e, t, r) { + var o = e("../internals/global"); + t.exports = function (e, t) { + var r = o.console; + r && + r.error && + (1 === arguments.length ? r.error(e) : r.error(e, t)); + }; + }, + { "../internals/global": 59 }, + ], + 63: [ + function (e, t, r) { + e = e("../internals/get-built-in"); + t.exports = e("document", "documentElement"); + }, + { "../internals/get-built-in": 56 }, + ], + 64: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + n = e("../internals/fails"), + s = e("../internals/document-create-element"); + t.exports = + !o && + !n(function () { + return ( + 7 != + Object.defineProperty(s("div"), "a", { + get: function () { + return 7; + }, + }).a + ); + }); + }, + { + "../internals/descriptors": 43, + "../internals/document-create-element": 44, + "../internals/fails": 51, + }, + ], + 65: [ + function (e, t, r) { + var h = Math.abs, + f = Math.pow, + p = Math.floor, + m = Math.log, + y = Math.LN2; + t.exports = { + pack: function (e, t, r) { + var o, + n, + s, + i = new Array(r), + a = 8 * r - t - 1, + r = (1 << a) - 1, + l = r >> 1, + u = 23 === t ? f(2, -24) - f(2, -77) : 0, + c = e < 0 || (0 === e && 1 / e < 0) ? 1 : 0, + d = 0; + for ( + (e = h(e)) != e || e === 1 / 0 + ? ((n = e != e ? 1 : 0), (o = r)) + : ((o = p(m(e) / y)), + e * (s = f(2, -o)) < 1 && (o--, (s *= 2)), + 2 <= (e += 1 <= o + l ? u / s : u * f(2, 1 - l)) * s && + (o++, (s /= 2)), + r <= o + l + ? ((n = 0), (o = r)) + : 1 <= o + l + ? ((n = (e * s - 1) * f(2, t)), (o += l)) + : ((n = e * f(2, l - 1) * f(2, t)), (o = 0))); + 8 <= t; + i[d++] = 255 & n, n /= 256, t -= 8 + ); + for ( + o = (o << t) | n, a += t; + 0 < a; + i[d++] = 255 & o, o /= 256, a -= 8 + ); + return (i[--d] |= 128 * c), i; + }, + unpack: function (e, t) { + var r, + o = e.length, + n = 8 * o - t - 1, + s = (1 << n) - 1, + i = s >> 1, + a = n - 7, + l = o - 1, + n = e[l--], + u = 127 & n; + for (n >>= 7; 0 < a; u = 256 * u + e[l], l--, a -= 8); + for ( + r = u & ((1 << -a) - 1), u >>= -a, a += t; + 0 < a; + r = 256 * r + e[l], l--, a -= 8 + ); + if (0 === u) u = 1 - i; + else { + if (u === s) return r ? NaN : n ? -1 / 0 : 1 / 0; + (r += f(2, t)), (u -= i); + } + return (n ? -1 : 1) * r * f(2, u - t); + }, + }; + }, + {}, + ], + 66: [ + function (e, t, r) { + var o = e("../internals/fails"), + n = e("../internals/classof-raw"), + s = "".split; + t.exports = o(function () { + return !Object("z").propertyIsEnumerable(0); + }) + ? function (e) { + return "String" == n(e) ? s.call(e, "") : Object(e); + } + : Object; + }, + { "../internals/classof-raw": 28, "../internals/fails": 51 }, + ], + 67: [ + function (e, t, r) { + var o = e("../internals/is-object"), + n = e("../internals/object-set-prototype-of"); + t.exports = function (e, t, r) { + return ( + n && + "function" == typeof (t = t.constructor) && + t !== r && + o((t = t.prototype)) && + t !== r.prototype && + n(e, t), + e + ); + }; + }, + { + "../internals/is-object": 74, + "../internals/object-set-prototype-of": 101, + }, + ], + 68: [ + function (e, t, r) { + var e = e("../internals/shared-store"), + o = Function.toString; + "function" != typeof e.inspectSource && + (e.inspectSource = function (e) { + return o.call(e); + }), + (t.exports = e.inspectSource); + }, + { "../internals/shared-store": 119 }, + ], + 69: [ + function (e, t, r) { + function o(e) { + a(e, c, { value: { objectID: "O" + ++d, weakData: {} } }); + } + var n = e("../internals/hidden-keys"), + s = e("../internals/is-object"), + i = e("../internals/has"), + a = e("../internals/object-define-property").f, + l = e("../internals/uid"), + u = e("../internals/freezing"), + c = l("meta"), + d = 0, + h = + Object.isExtensible || + function () { + return !0; + }, + f = (t.exports = { + REQUIRED: !1, + fastKey: function (e, t) { + if (!s(e)) + return "symbol" == typeof e + ? e + : ("string" == typeof e ? "S" : "P") + e; + if (!i(e, c)) { + if (!h(e)) return "F"; + if (!t) return "E"; + o(e); + } + return e[c].objectID; + }, + getWeakData: function (e, t) { + if (!i(e, c)) { + if (!h(e)) return !0; + if (!t) return !1; + o(e); + } + return e[c].weakData; + }, + onFreeze: function (e) { + return u && f.REQUIRED && h(e) && !i(e, c) && o(e), e; + }, + }); + n[c] = !0; + }, + { + "../internals/freezing": 53, + "../internals/has": 60, + "../internals/hidden-keys": 61, + "../internals/is-object": 74, + "../internals/object-define-property": 92, + "../internals/uid": 145, + }, + ], + 70: [ + function (e, t, r) { + var o, + n, + s, + i, + a, + l, + u, + c, + d = e("../internals/native-weak-map"), + h = e("../internals/global"), + f = e("../internals/is-object"), + p = e("../internals/create-non-enumerable-property"), + m = e("../internals/has"), + y = e("../internals/shared-key"), + e = e("../internals/hidden-keys"), + h = h.WeakMap; + (u = d + ? ((o = new h()), + (n = o.get), + (s = o.has), + (i = o.set), + (a = function (e, t) { + return i.call(o, e, t), t; + }), + (l = function (e) { + return n.call(o, e) || {}; + }), + function (e) { + return s.call(o, e); + }) + : ((e[(c = y("state"))] = !0), + (a = function (e, t) { + return p(e, c, t), t; + }), + (l = function (e) { + return m(e, c) ? e[c] : {}; + }), + function (e) { + return m(e, c); + })), + (t.exports = { + set: a, + get: l, + has: u, + enforce: function (e) { + return u(e) ? l(e) : a(e, {}); + }, + getterFor: function (t) { + return function (e) { + if (f(e) && (e = l(e)).type === t) return e; + throw TypeError("Incompatible receiver, " + t + " required"); + }; + }, + }); + }, + { + "../internals/create-non-enumerable-property": 38, + "../internals/global": 59, + "../internals/has": 60, + "../internals/hidden-keys": 61, + "../internals/is-object": 74, + "../internals/native-weak-map": 85, + "../internals/shared-key": 118, + }, + ], + 71: [ + function (e, t, r) { + var o = e("../internals/well-known-symbol"), + n = e("../internals/iterators"), + s = o("iterator"), + i = Array.prototype; + t.exports = function (e) { + return void 0 !== e && (n.Array === e || i[s] === e); + }; + }, + { "../internals/iterators": 79, "../internals/well-known-symbol": 148 }, + ], + 72: [ + function (e, t, r) { + var o = e("../internals/classof-raw"); + t.exports = + Array.isArray || + function (e) { + return "Array" == o(e); + }; + }, + { "../internals/classof-raw": 28 }, + ], + 73: [ + function (e, t, r) { + function o(e, t) { + return ( + (e = a[i(e)]) == u || + (e != l && ("function" == typeof t ? n(t) : !!t)) + ); + } + var n = e("../internals/fails"), + s = /#|\.prototype\./, + i = (o.normalize = function (e) { + return String(e).replace(s, ".").toLowerCase(); + }), + a = (o.data = {}), + l = (o.NATIVE = "N"), + u = (o.POLYFILL = "P"); + t.exports = o; + }, + { "../internals/fails": 51 }, + ], + 74: [ + function (e, t, r) { + t.exports = function (e) { + return "object" == typeof e ? null !== e : "function" == typeof e; + }; + }, + {}, + ], + 75: [ + function (e, t, r) { + t.exports = !1; + }, + {}, + ], + 76: [ + function (e, t, r) { + var o = e("../internals/is-object"), + n = e("../internals/classof-raw"), + s = e("../internals/well-known-symbol")("match"); + t.exports = function (e) { + var t; + return o(e) && (void 0 !== (t = e[s]) ? !!t : "RegExp" == n(e)); + }; + }, + { + "../internals/classof-raw": 28, + "../internals/is-object": 74, + "../internals/well-known-symbol": 148, + }, + ], + 77: [ + function (e, t, r) { + function h(e, t) { + (this.stopped = e), (this.result = t); + } + var f = e("../internals/an-object"), + p = e("../internals/is-array-iterator-method"), + m = e("../internals/to-length"), + y = e("../internals/function-bind-context"), + g = e("../internals/get-iterator-method"), + v = e("../internals/call-with-safe-iteration-closing"); + (t.exports = function (e, t, r, o, n) { + var s, + i, + a, + l, + u, + c, + d = y(t, r, o ? 2 : 1); + if (n) s = e; + else { + if ("function" != typeof (t = g(e))) + throw TypeError("Target is not iterable"); + if (p(t)) { + for (i = 0, a = m(e.length); i < a; i++) + if ( + (l = o ? d(f((c = e[i]))[0], c[1]) : d(e[i])) && + l instanceof h + ) + return l; + return new h(!1); + } + s = t.call(e); + } + for (u = s.next; !(c = u.call(s)).done; ) + if ( + "object" == typeof (l = v(s, d, c.value, o)) && + l && + l instanceof h + ) + return l; + return new h(!1); + }).stop = function (e) { + return new h(!0, e); + }; + }, + { + "../internals/an-object": 10, + "../internals/call-with-safe-iteration-closing": 26, + "../internals/function-bind-context": 54, + "../internals/get-iterator-method": 57, + "../internals/is-array-iterator-method": 71, + "../internals/to-length": 136, + }, + ], + 78: [ + function (e, t, r) { + "use strict"; + var o, + n, + s = e("../internals/object-get-prototype-of"), + i = e("../internals/create-non-enumerable-property"), + a = e("../internals/has"), + l = e("../internals/well-known-symbol"), + e = e("../internals/is-pure"), + l = l("iterator"), + u = !1; + [].keys && + ("next" in (n = [].keys()) + ? (s = s(s(n))) !== Object.prototype && (o = s) + : (u = !0)), + null == o && (o = {}), + e || + a(o, l) || + i(o, l, function () { + return this; + }), + (t.exports = { IteratorPrototype: o, BUGGY_SAFARI_ITERATORS: u }); + }, + { + "../internals/create-non-enumerable-property": 38, + "../internals/has": 60, + "../internals/is-pure": 75, + "../internals/object-get-prototype-of": 97, + "../internals/well-known-symbol": 148, + }, + ], + 79: [ + function (e, t, r) { + t.exports = {}; + }, + {}, + ], + 80: [ + function (e, t, r) { + t.exports = + Math.sign || + function (e) { + return 0 == (e = +e) || e != e ? e : e < 0 ? -1 : 1; + }; + }, + {}, + ], + 81: [ + function (e, t, r) { + var o, + n, + s, + i, + a, + l, + u, + c, + d = e("../internals/global"), + h = e("../internals/object-get-own-property-descriptor").f, + f = e("../internals/classof-raw"), + p = e("../internals/task").set, + e = e("../internals/engine-is-ios"), + m = d.MutationObserver || d.WebKitMutationObserver, + y = d.process, + g = d.Promise, + v = "process" == f(y), + f = h(d, "queueMicrotask"), + h = f && f.value; + h || + ((o = function () { + var e, t; + for (v && (e = y.domain) && e.exit(); n; ) { + (t = n.fn), (n = n.next); + try { + t(); + } catch (e) { + throw (n ? i() : (s = void 0), e); + } + } + (s = void 0), e && e.enter(); + }), + (i = v + ? function () { + y.nextTick(o); + } + : m && !e + ? ((a = !0), + (l = document.createTextNode("")), + new m(o).observe(l, { characterData: !0 }), + function () { + l.data = a = !a; + }) + : g && g.resolve + ? ((u = g.resolve(void 0)), + (c = u.then), + function () { + c.call(u, o); + }) + : function () { + p.call(d, o); + })), + (t.exports = + h || + function (e) { + e = { fn: e, next: void 0 }; + s && (s.next = e), n || ((n = e), i()), (s = e); + }); + }, + { + "../internals/classof-raw": 28, + "../internals/engine-is-ios": 46, + "../internals/global": 59, + "../internals/object-get-own-property-descriptor": 93, + "../internals/task": 130, + }, + ], + 82: [ + function (e, t, r) { + e = e("../internals/global"); + t.exports = e.Promise; + }, + { "../internals/global": 59 }, + ], + 83: [ + function (e, t, r) { + e = e("../internals/fails"); + t.exports = + !!Object.getOwnPropertySymbols && + !e(function () { + return !String(Symbol()); + }); + }, + { "../internals/fails": 51 }, + ], + 84: [ + function (e, t, r) { + var o = e("../internals/fails"), + n = e("../internals/well-known-symbol"), + s = e("../internals/is-pure"), + i = n("iterator"); + t.exports = !o(function () { + var e = new URL("b?a=1&b=2&c=3", "http://a"), + r = e.searchParams, + o = ""; + return ( + (e.pathname = "c%20d"), + r.forEach(function (e, t) { + r.delete("b"), (o += t + e); + }), + (s && !e.toJSON) || + !r.sort || + "http://a/c%20d?a=1&c=3" !== e.href || + "3" !== r.get("c") || + "a=1" !== String(new URLSearchParams("?a=1")) || + !r[i] || + "a" !== new URL("https://a@b").username || + "b" !== + new URLSearchParams(new URLSearchParams("a=b")).get("a") || + "xn--e1aybc" !== new URL("http://тест").host || + "#%D0%B1" !== new URL("http://a#б").hash || + "a1c3" !== o || + "x" !== new URL("http://x", void 0).host + ); + }); + }, + { + "../internals/fails": 51, + "../internals/is-pure": 75, + "../internals/well-known-symbol": 148, + }, + ], + 85: [ + function (e, t, r) { + var o = e("../internals/global"), + e = e("../internals/inspect-source"), + o = o.WeakMap; + t.exports = "function" == typeof o && /native code/.test(e(o)); + }, + { "../internals/global": 59, "../internals/inspect-source": 68 }, + ], + 86: [ + function (e, t, r) { + "use strict"; + function o(e) { + var r, o; + (this.promise = new e(function (e, t) { + if (void 0 !== r || void 0 !== o) + throw TypeError("Bad Promise constructor"); + (r = e), (o = t); + })), + (this.resolve = n(r)), + (this.reject = n(o)); + } + var n = e("../internals/a-function"); + t.exports.f = function (e) { + return new o(e); + }; + }, + { "../internals/a-function": 5 }, + ], + 87: [ + function (e, t, r) { + var o = e("../internals/is-regexp"); + t.exports = function (e) { + if (o(e)) + throw TypeError("The method doesn't accept regular expressions"); + return e; + }; + }, + { "../internals/is-regexp": 76 }, + ], + 88: [ + function (e, t, r) { + var o = e("../internals/global").isFinite; + t.exports = + Number.isFinite || + function (e) { + return "number" == typeof e && o(e); + }; + }, + { "../internals/global": 59 }, + ], + 89: [ + function (e, t, r) { + "use strict"; + var h = e("../internals/descriptors"), + o = e("../internals/fails"), + f = e("../internals/object-keys"), + p = e("../internals/object-get-own-property-symbols"), + m = e("../internals/object-property-is-enumerable"), + y = e("../internals/to-object"), + g = e("../internals/indexed-object"), + n = Object.assign, + s = Object.defineProperty; + t.exports = + !n || + o(function () { + var e, t, r, o; + return ( + !( + !h || + 1 === + n( + { b: 1 }, + n( + s({}, "a", { + enumerable: !0, + get: function () { + s(this, "b", { value: 3, enumerable: !1 }); + }, + }), + { b: 2 }, + ), + ).b + ) || + ((t = {}), + (o = "abcdefghijklmnopqrst"), + ((e = {})[(r = Symbol())] = 7), + o.split("").forEach(function (e) { + t[e] = e; + }), + 7 != n({}, e)[r] || f(n({}, t)).join("") != o) + ); + }) + ? function (e, t) { + for ( + var r = y(e), o = arguments.length, n = 1, s = p.f, i = m.f; + n < o; + + ) + for ( + var a, + l = g(arguments[n++]), + u = s ? f(l).concat(s(l)) : f(l), + c = u.length, + d = 0; + d < c; + + ) + (a = u[d++]), (h && !i.call(l, a)) || (r[a] = l[a]); + return r; + } + : n; + }, + { + "../internals/descriptors": 43, + "../internals/fails": 51, + "../internals/indexed-object": 66, + "../internals/object-get-own-property-symbols": 96, + "../internals/object-keys": 99, + "../internals/object-property-is-enumerable": 100, + "../internals/to-object": 137, + }, + ], + 90: [ + function (e, t, r) { + function o() {} + var n, + s = e("../internals/an-object"), + i = e("../internals/object-define-properties"), + a = e("../internals/enum-bug-keys"), + l = e("../internals/hidden-keys"), + u = e("../internals/html"), + c = e("../internals/document-create-element"), + e = e("../internals/shared-key"), + d = "prototype", + h = "script", + f = e("IE_PROTO"), + p = function (e) { + return "<" + h + ">" + e + ""; + }, + m = function () { + try { + n = document.domain && new ActiveXObject("htmlfile"); + } catch (e) {} + m = n + ? ((e = n).write(p("")), + e.close(), + (t = e.parentWindow.Object), + (e = null), + t) + : ((e = c("iframe")), + (t = "java" + h + ":"), + (e.style.display = "none"), + u.appendChild(e), + (e.src = String(t)), + (t = e.contentWindow.document).open(), + t.write(p("document.F=Object")), + t.close(), + t.F); + for (var e, t, r = a.length; r--; ) delete m[d][a[r]]; + return m(); + }; + (l[f] = !0), + (t.exports = + Object.create || + function (e, t) { + var r; + return ( + null !== e + ? ((o[d] = s(e)), (r = new o()), (o[d] = null), (r[f] = e)) + : (r = m()), + void 0 === t ? r : i(r, t) + ); + }); + }, + { + "../internals/an-object": 10, + "../internals/document-create-element": 44, + "../internals/enum-bug-keys": 49, + "../internals/hidden-keys": 61, + "../internals/html": 63, + "../internals/object-define-properties": 91, + "../internals/shared-key": 118, + }, + ], + 91: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + i = e("../internals/object-define-property"), + a = e("../internals/an-object"), + l = e("../internals/object-keys"); + t.exports = o + ? Object.defineProperties + : function (e, t) { + a(e); + for (var r, o = l(t), n = o.length, s = 0; s < n; ) + i.f(e, (r = o[s++]), t[r]); + return e; + }; + }, + { + "../internals/an-object": 10, + "../internals/descriptors": 43, + "../internals/object-define-property": 92, + "../internals/object-keys": 99, + }, + ], + 92: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + n = e("../internals/ie8-dom-define"), + s = e("../internals/an-object"), + i = e("../internals/to-primitive"), + a = Object.defineProperty; + r.f = o + ? a + : function (e, t, r) { + if ((s(e), (t = i(t, !0)), s(r), n)) + try { + return a(e, t, r); + } catch (e) {} + if ("get" in r || "set" in r) + throw TypeError("Accessors not supported"); + return "value" in r && (e[t] = r.value), e; + }; + }, + { + "../internals/an-object": 10, + "../internals/descriptors": 43, + "../internals/ie8-dom-define": 64, + "../internals/to-primitive": 140, + }, + ], + 93: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + n = e("../internals/object-property-is-enumerable"), + s = e("../internals/create-property-descriptor"), + i = e("../internals/to-indexed-object"), + a = e("../internals/to-primitive"), + l = e("../internals/has"), + u = e("../internals/ie8-dom-define"), + c = Object.getOwnPropertyDescriptor; + r.f = o + ? c + : function (e, t) { + if (((e = i(e)), (t = a(t, !0)), u)) + try { + return c(e, t); + } catch (e) {} + if (l(e, t)) return s(!n.f.call(e, t), e[t]); + }; + }, + { + "../internals/create-property-descriptor": 39, + "../internals/descriptors": 43, + "../internals/has": 60, + "../internals/ie8-dom-define": 64, + "../internals/object-property-is-enumerable": 100, + "../internals/to-indexed-object": 134, + "../internals/to-primitive": 140, + }, + ], + 94: [ + function (e, t, r) { + var o = e("../internals/to-indexed-object"), + n = e("../internals/object-get-own-property-names").f, + s = {}.toString, + i = + "object" == typeof window && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) + : []; + t.exports.f = function (e) { + if (!i || "[object Window]" != s.call(e)) return n(o(e)); + try { + return n(e); + } catch (e) { + return i.slice(); + } + }; + }, + { + "../internals/object-get-own-property-names": 95, + "../internals/to-indexed-object": 134, + }, + ], + 95: [ + function (e, t, r) { + var o = e("../internals/object-keys-internal"), + n = e("../internals/enum-bug-keys").concat("length", "prototype"); + r.f = + Object.getOwnPropertyNames || + function (e) { + return o(e, n); + }; + }, + { + "../internals/enum-bug-keys": 49, + "../internals/object-keys-internal": 98, + }, + ], + 96: [ + function (e, t, r) { + r.f = Object.getOwnPropertySymbols; + }, + {}, + ], + 97: [ + function (e, t, r) { + var o = e("../internals/has"), + n = e("../internals/to-object"), + s = e("../internals/shared-key"), + e = e("../internals/correct-prototype-getter"), + i = s("IE_PROTO"), + a = Object.prototype; + t.exports = e + ? Object.getPrototypeOf + : function (e) { + return ( + (e = n(e)), + o(e, i) + ? e[i] + : "function" == typeof e.constructor && + e instanceof e.constructor + ? e.constructor.prototype + : e instanceof Object + ? a + : null + ); + }; + }, + { + "../internals/correct-prototype-getter": 35, + "../internals/has": 60, + "../internals/shared-key": 118, + "../internals/to-object": 137, + }, + ], + 98: [ + function (e, t, r) { + var i = e("../internals/has"), + a = e("../internals/to-indexed-object"), + l = e("../internals/array-includes").indexOf, + u = e("../internals/hidden-keys"); + t.exports = function (e, t) { + var r, + o = a(e), + n = 0, + s = []; + for (r in o) !i(u, r) && i(o, r) && s.push(r); + for (; t.length > n; ) !i(o, (r = t[n++])) || ~l(s, r) || s.push(r); + return s; + }; + }, + { + "../internals/array-includes": 18, + "../internals/has": 60, + "../internals/hidden-keys": 61, + "../internals/to-indexed-object": 134, + }, + ], + 99: [ + function (e, t, r) { + var o = e("../internals/object-keys-internal"), + n = e("../internals/enum-bug-keys"); + t.exports = + Object.keys || + function (e) { + return o(e, n); + }; + }, + { + "../internals/enum-bug-keys": 49, + "../internals/object-keys-internal": 98, + }, + ], + 100: [ + function (e, t, r) { + "use strict"; + var o = {}.propertyIsEnumerable, + n = Object.getOwnPropertyDescriptor, + s = n && !o.call({ 1: 2 }, 1); + r.f = s + ? function (e) { + e = n(this, e); + return !!e && e.enumerable; + } + : o; + }, + {}, + ], + 101: [ + function (e, t, r) { + var n = e("../internals/an-object"), + s = e("../internals/a-possible-prototype"); + t.exports = + Object.setPrototypeOf || + ("__proto__" in {} + ? (function () { + var r, + o = !1, + e = {}; + try { + (r = Object.getOwnPropertyDescriptor( + Object.prototype, + "__proto__", + ).set).call(e, []), + (o = e instanceof Array); + } catch (e) {} + return function (e, t) { + return n(e), s(t), o ? r.call(e, t) : (e.__proto__ = t), e; + }; + })() + : void 0); + }, + { + "../internals/a-possible-prototype": 6, + "../internals/an-object": 10, + }, + ], + 102: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/to-string-tag-support"), + n = e("../internals/classof"); + t.exports = o + ? {}.toString + : function () { + return "[object " + n(this) + "]"; + }; + }, + { + "../internals/classof": 29, + "../internals/to-string-tag-support": 141, + }, + ], + 103: [ + function (e, t, r) { + var o = e("../internals/get-built-in"), + n = e("../internals/object-get-own-property-names"), + s = e("../internals/object-get-own-property-symbols"), + i = e("../internals/an-object"); + t.exports = + o("Reflect", "ownKeys") || + function (e) { + var t = n.f(i(e)), + r = s.f; + return r ? t.concat(r(e)) : t; + }; + }, + { + "../internals/an-object": 10, + "../internals/get-built-in": 56, + "../internals/object-get-own-property-names": 95, + "../internals/object-get-own-property-symbols": 96, + }, + ], + 104: [ + function (e, t, r) { + e = e("../internals/global"); + t.exports = e; + }, + { "../internals/global": 59 }, + ], + 105: [ + function (e, t, r) { + t.exports = function (e) { + try { + return { error: !1, value: e() }; + } catch (e) { + return { error: !0, value: e }; + } + }; + }, + {}, + ], + 106: [ + function (e, t, r) { + var o = e("../internals/an-object"), + n = e("../internals/is-object"), + s = e("../internals/new-promise-capability"); + t.exports = function (e, t) { + return ( + o(e), + n(t) && t.constructor === e + ? t + : ((0, (e = s.f(e)).resolve)(t), e.promise) + ); + }; + }, + { + "../internals/an-object": 10, + "../internals/is-object": 74, + "../internals/new-promise-capability": 86, + }, + ], + 107: [ + function (e, t, r) { + var n = e("../internals/redefine"); + t.exports = function (e, t, r) { + for (var o in t) n(e, o, t[o], r); + return e; + }; + }, + { "../internals/redefine": 108 }, + ], + 108: [ + function (e, t, r) { + var i = e("../internals/global"), + a = e("../internals/create-non-enumerable-property"), + l = e("../internals/has"), + u = e("../internals/set-global"), + o = e("../internals/inspect-source"), + e = e("../internals/internal-state"), + n = e.get, + c = e.enforce, + d = String(String).split("String"); + (t.exports = function (e, t, r, o) { + var n = !!o && !!o.unsafe, + s = !!o && !!o.enumerable, + o = !!o && !!o.noTargetGet; + "function" == typeof r && + ("string" != typeof t || l(r, "name") || a(r, "name", t), + (c(r).source = d.join("string" == typeof t ? t : ""))), + e === i + ? s + ? (e[t] = r) + : u(t, r) + : (n ? !o && e[t] && (s = !0) : delete e[t], + s ? (e[t] = r) : a(e, t, r)); + })(Function.prototype, "toString", function () { + return ("function" == typeof this && n(this).source) || o(this); + }); + }, + { + "../internals/create-non-enumerable-property": 38, + "../internals/global": 59, + "../internals/has": 60, + "../internals/inspect-source": 68, + "../internals/internal-state": 70, + "../internals/set-global": 115, + }, + ], + 109: [ + function (e, t, r) { + var o = e("./classof-raw"), + n = e("./regexp-exec"); + t.exports = function (e, t) { + var r = e.exec; + if ("function" == typeof r) { + r = r.call(e, t); + if ("object" != typeof r) + throw TypeError( + "RegExp exec method returned something other than an Object or null", + ); + return r; + } + if ("RegExp" !== o(e)) + throw TypeError("RegExp#exec called on incompatible receiver"); + return n.call(e, t); + }; + }, + { "./classof-raw": 28, "./regexp-exec": 110 }, + ], + 110: [ + function (e, t, r) { + "use strict"; + var o, + n, + d = e("./regexp-flags"), + e = e("./regexp-sticky-helpers"), + h = RegExp.prototype.exec, + f = String.prototype.replace, + s = h, + p = + ((o = /a/), + (n = /b*/g), + h.call(o, "a"), + h.call(n, "a"), + 0 !== o.lastIndex || 0 !== n.lastIndex), + m = e.UNSUPPORTED_Y || e.BROKEN_CARET, + y = void 0 !== /()??/.exec("")[1]; + t.exports = s = + p || y || m + ? function (e) { + var t, + r, + o, + n, + s = this, + i = m && s.sticky, + a = d.call(s), + l = s.source, + u = 0, + c = e; + return ( + i && + (-1 === (a = a.replace("y", "")).indexOf("g") && + (a += "g"), + (c = String(e).slice(s.lastIndex)), + 0 < s.lastIndex && + (!s.multiline || + (s.multiline && "\n" !== e[s.lastIndex - 1])) && + ((l = "(?: " + l + ")"), (c = " " + c), u++), + (r = new RegExp("^(?:" + l + ")", a))), + y && (r = new RegExp("^" + l + "$(?!\\s)", a)), + p && (t = s.lastIndex), + (o = h.call(i ? r : s, c)), + i + ? o + ? ((o.input = o.input.slice(u)), + (o[0] = o[0].slice(u)), + (o.index = s.lastIndex), + (s.lastIndex += o[0].length)) + : (s.lastIndex = 0) + : p && + o && + (s.lastIndex = s.global ? o.index + o[0].length : t), + y && + o && + 1 < o.length && + f.call(o[0], r, function () { + for (n = 1; n < arguments.length - 2; n++) + void 0 === arguments[n] && (o[n] = void 0); + }), + o + ); + } + : s; + }, + { "./regexp-flags": 111, "./regexp-sticky-helpers": 112 }, + ], + 111: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/an-object"); + t.exports = function () { + var e = o(this), + t = ""; + return ( + e.global && (t += "g"), + e.ignoreCase && (t += "i"), + e.multiline && (t += "m"), + e.dotAll && (t += "s"), + e.unicode && (t += "u"), + e.sticky && (t += "y"), + t + ); + }; + }, + { "../internals/an-object": 10 }, + ], + 112: [ + function (e, t, r) { + "use strict"; + e = e("./fails"); + function o(e, t) { + return RegExp(e, t); + } + (r.UNSUPPORTED_Y = e(function () { + var e = o("a", "y"); + return (e.lastIndex = 2), null != e.exec("abcd"); + })), + (r.BROKEN_CARET = e(function () { + var e = o("^r", "gy"); + return (e.lastIndex = 2), null != e.exec("str"); + })); + }, + { "./fails": 51 }, + ], + 113: [ + function (e, t, r) { + t.exports = function (e) { + if (null == e) throw TypeError("Can't call method on " + e); + return e; + }; + }, + {}, + ], + 114: [ + function (e, t, r) { + t.exports = + Object.is || + function (e, t) { + return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t; + }; + }, + {}, + ], + 115: [ + function (e, t, r) { + var o = e("../internals/global"), + n = e("../internals/create-non-enumerable-property"); + t.exports = function (t, r) { + try { + n(o, t, r); + } catch (e) { + o[t] = r; + } + return r; + }; + }, + { + "../internals/create-non-enumerable-property": 38, + "../internals/global": 59, + }, + ], + 116: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/get-built-in"), + n = e("../internals/object-define-property"), + s = e("../internals/well-known-symbol"), + i = e("../internals/descriptors"), + a = s("species"); + t.exports = function (e) { + var e = o(e), + t = n.f; + i && + e && + !e[a] && + t(e, a, { + configurable: !0, + get: function () { + return this; + }, + }); + }; + }, + { + "../internals/descriptors": 43, + "../internals/get-built-in": 56, + "../internals/object-define-property": 92, + "../internals/well-known-symbol": 148, + }, + ], + 117: [ + function (e, t, r) { + var o = e("../internals/object-define-property").f, + n = e("../internals/has"), + s = e("../internals/well-known-symbol")("toStringTag"); + t.exports = function (e, t, r) { + e && + !n((e = r ? e : e.prototype), s) && + o(e, s, { configurable: !0, value: t }); + }; + }, + { + "../internals/has": 60, + "../internals/object-define-property": 92, + "../internals/well-known-symbol": 148, + }, + ], + 118: [ + function (e, t, r) { + var o = e("../internals/shared"), + n = e("../internals/uid"), + s = o("keys"); + t.exports = function (e) { + return s[e] || (s[e] = n(e)); + }; + }, + { "../internals/shared": 120, "../internals/uid": 145 }, + ], + 119: [ + function (e, t, r) { + var o = e("../internals/global"), + e = e("../internals/set-global"), + n = "__core-js_shared__", + o = o[n] || e(n, {}); + t.exports = o; + }, + { "../internals/global": 59, "../internals/set-global": 115 }, + ], + 120: [ + function (e, t, r) { + var o = e("../internals/is-pure"), + n = e("../internals/shared-store"); + (t.exports = function (e, t) { + return n[e] || (n[e] = void 0 !== t ? t : {}); + })("versions", []).push({ + version: "3.6.5", + mode: o ? "pure" : "global", + copyright: "© 2020 Denis Pushkarev (zloirock.ru)", + }); + }, + { "../internals/is-pure": 75, "../internals/shared-store": 119 }, + ], + 121: [ + function (e, t, r) { + var o = e("../internals/an-object"), + n = e("../internals/a-function"), + s = e("../internals/well-known-symbol")("species"); + t.exports = function (e, t) { + var e = o(e).constructor; + return void 0 === e || null == (e = o(e)[s]) ? t : n(e); + }; + }, + { + "../internals/a-function": 5, + "../internals/an-object": 10, + "../internals/well-known-symbol": 148, + }, + ], + 122: [ + function (e, t, r) { + var o = e("../internals/fails"); + t.exports = function (t) { + return o(function () { + var e = ""[t]('"'); + return e !== e.toLowerCase() || 3 < e.split('"').length; + }); + }; + }, + { "../internals/fails": 51 }, + ], + 123: [ + function (e, t, r) { + function o(n) { + return function (e, t) { + var r, + e = String(i(e)), + t = s(t), + o = e.length; + return t < 0 || o <= t + ? n + ? "" + : void 0 + : (r = e.charCodeAt(t)) < 55296 || + 56319 < r || + t + 1 === o || + (o = e.charCodeAt(t + 1)) < 56320 || + 57343 < o + ? n + ? e.charAt(t) + : r + : n + ? e.slice(t, t + 2) + : o - 56320 + ((r - 55296) << 10) + 65536; + }; + } + var s = e("../internals/to-integer"), + i = e("../internals/require-object-coercible"); + t.exports = { codeAt: o(!1), charAt: o(!0) }; + }, + { + "../internals/require-object-coercible": 113, + "../internals/to-integer": 135, + }, + ], + 124: [ + function (e, t, r) { + e = e("../internals/engine-user-agent"); + t.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test( + e, + ); + }, + { "../internals/engine-user-agent": 47 }, + ], + 125: [ + function (e, t, r) { + function o(n) { + return function (e, t, r) { + var e = String(a(e)), + o = e.length, + r = void 0 === r ? " " : String(r), + t = s(t); + return t <= o || "" == r + ? e + : ((o = i.call(r, l((t = t - o) / r.length))).length > t && + (o = o.slice(0, t)), + n ? e + o : o + e); + }; + } + var s = e("../internals/to-length"), + i = e("../internals/string-repeat"), + a = e("../internals/require-object-coercible"), + l = Math.ceil; + t.exports = { start: o(!1), end: o(!0) }; + }, + { + "../internals/require-object-coercible": 113, + "../internals/string-repeat": 127, + "../internals/to-length": 136, + }, + ], + 126: [ + function (e, t, r) { + "use strict"; + function g(e) { + return e + 22 + 75 * (e < 26); + } + function s(e) { + var t, + r = [], + o = (e = (function (e) { + for (var t = [], r = 0, o = e.length; r < o; ) { + var n, + s = e.charCodeAt(r++); + 55296 <= s && s <= 56319 && r < o + ? 56320 == (64512 & (n = e.charCodeAt(r++))) + ? t.push(((1023 & s) << 10) + (1023 & n) + 65536) + : (t.push(s), r--) + : t.push(s); + } + return t; + })(e)).length, + n = 128, + s = 0, + i = 72; + for (c = 0; c < e.length; c++) (t = e[c]) < 128 && r.push(M(t)); + var a = r.length, + l = a; + for (a && r.push("-"); l < o; ) { + for (var u = v, c = 0; c < e.length; c++) + n <= (t = e[c]) && t < u && (u = t); + var d = l + 1; + if (u - n > T((v - s) / d)) throw RangeError(w); + for (s += (u - n) * d, n = u, c = 0; c < e.length; c++) { + if ((t = e[c]) < n && ++s > v) throw RangeError(w); + if (t == n) { + for (var h = s, f = b; ; f += b) { + var p = f <= i ? 1 : i + j <= f ? j : f - i; + if (h < p) break; + var m = h - p, + y = b - p; + r.push(M(g(p + (m % y)))), (h = T(m / y)); + } + r.push(M(g(h))), + (i = (function (e, t, r) { + var o = 0; + for ( + e = r ? T(e / x) : e >> 1, e += T(e / t); + (S * j) >> 1 < e; + o += b + ) + e = T(e / S); + return T(o + ((S + 1) * e) / (e + _)); + })(s, d, l == a)), + (s = 0), + ++l; + } + } + ++s, ++n; + } + return r.join(""); + } + var v = 2147483647, + b = 36, + j = 26, + _ = 38, + x = 700, + i = /[^\0-\u007E]/, + a = /[.\u3002\uFF0E\uFF61]/g, + w = "Overflow: input needs wider integers to process", + S = b - 1, + T = Math.floor, + M = String.fromCharCode; + t.exports = function (e) { + for ( + var t, + r = [], + o = e.toLowerCase().replace(a, ".").split("."), + n = 0; + n < o.length; + n++ + ) + (t = o[n]), r.push(i.test(t) ? "xn--" + s(t) : t); + return r.join("."); + }; + }, + {}, + ], + 127: [ + function (e, t, r) { + "use strict"; + var n = e("../internals/to-integer"), + s = e("../internals/require-object-coercible"); + t.exports = + "".repeat || + function (e) { + var t = String(s(this)), + r = "", + o = n(e); + if (o < 0 || o == 1 / 0) + throw RangeError("Wrong number of repetitions"); + for (; 0 < o; (o >>>= 1) && (t += t)) 1 & o && (r += t); + return r; + }; + }, + { + "../internals/require-object-coercible": 113, + "../internals/to-integer": 135, + }, + ], + 128: [ + function (e, t, r) { + var o = e("../internals/fails"), + n = e("../internals/whitespaces"); + t.exports = function (e) { + return o(function () { + return !!n[e]() || "​…᠎" != "​…᠎"[e]() || n[e].name !== e; + }); + }; + }, + { "../internals/fails": 51, "../internals/whitespaces": 149 }, + ], + 129: [ + function (e, t, r) { + function o(t) { + return function (e) { + e = String(n(e)); + return ( + 1 & t && (e = e.replace(s, "")), + (e = 2 & t ? e.replace(i, "") : e) + ); + }; + } + var n = e("../internals/require-object-coercible"), + e = "[" + e("../internals/whitespaces") + "]", + s = RegExp("^" + e + e + "*"), + i = RegExp(e + e + "*$"); + t.exports = { start: o(1), end: o(2), trim: o(3) }; + }, + { + "../internals/require-object-coercible": 113, + "../internals/whitespaces": 149, + }, + ], + 130: [ + function (e, t, r) { + function o(e) { + return function () { + x(e); + }; + } + function n(e) { + x(e.data); + } + function s(e) { + a.postMessage(e + "", f.protocol + "//" + f.host); + } + var i, + a = e("../internals/global"), + l = e("../internals/fails"), + u = e("../internals/classof-raw"), + c = e("../internals/function-bind-context"), + d = e("../internals/html"), + h = e("../internals/document-create-element"), + e = e("../internals/engine-is-ios"), + f = a.location, + p = a.setImmediate, + m = a.clearImmediate, + y = a.process, + g = a.MessageChannel, + v = a.Dispatch, + b = 0, + j = {}, + _ = "onreadystatechange", + x = function (e) { + var t; + j.hasOwnProperty(e) && ((t = j[e]), delete j[e], t()); + }; + (p && m) || + ((p = function (e) { + for (var t = [], r = 1; r < arguments.length; ) + t.push(arguments[r++]); + return ( + (j[++b] = function () { + ("function" == typeof e ? e : Function(e)).apply(void 0, t); + }), + i(b), + b + ); + }), + (m = function (e) { + delete j[e]; + }), + "process" == u(y) + ? (i = function (e) { + y.nextTick(o(e)); + }) + : v && v.now + ? (i = function (e) { + v.now(o(e)); + }) + : g && !e + ? ((e = (u = new g()).port2), + (u.port1.onmessage = n), + (i = c(e.postMessage, e, 1))) + : !a.addEventListener || + "function" != typeof postMessage || + a.importScripts || + l(s) || + "file:" === f.protocol + ? (i = + _ in h("script") + ? function (e) { + d.appendChild(h("script"))[_] = function () { + d.removeChild(this), x(e); + }; + } + : function (e) { + setTimeout(o(e), 0); + }) + : ((i = s), a.addEventListener("message", n, !1))), + (t.exports = { set: p, clear: m }); + }, + { + "../internals/classof-raw": 28, + "../internals/document-create-element": 44, + "../internals/engine-is-ios": 46, + "../internals/fails": 51, + "../internals/function-bind-context": 54, + "../internals/global": 59, + "../internals/html": 63, + }, + ], + 131: [ + function (e, t, r) { + var o = e("../internals/classof-raw"); + t.exports = function (e) { + if ("number" != typeof e && "Number" != o(e)) + throw TypeError("Incorrect invocation"); + return +e; + }; + }, + { "../internals/classof-raw": 28 }, + ], + 132: [ + function (e, t, r) { + var o = e("../internals/to-integer"), + n = Math.max, + s = Math.min; + t.exports = function (e, t) { + e = o(e); + return e < 0 ? n(e + t, 0) : s(e, t); + }; + }, + { "../internals/to-integer": 135 }, + ], + 133: [ + function (e, t, r) { + var o = e("../internals/to-integer"), + n = e("../internals/to-length"); + t.exports = function (e) { + if (void 0 === e) return 0; + var e = o(e), + t = n(e); + if (e !== t) throw RangeError("Wrong length or index"); + return t; + }; + }, + { "../internals/to-integer": 135, "../internals/to-length": 136 }, + ], + 134: [ + function (e, t, r) { + var o = e("../internals/indexed-object"), + n = e("../internals/require-object-coercible"); + t.exports = function (e) { + return o(n(e)); + }; + }, + { + "../internals/indexed-object": 66, + "../internals/require-object-coercible": 113, + }, + ], + 135: [ + function (e, t, r) { + var o = Math.ceil, + n = Math.floor; + t.exports = function (e) { + return isNaN((e = +e)) ? 0 : (0 < e ? n : o)(e); + }; + }, + {}, + ], + 136: [ + function (e, t, r) { + var o = e("../internals/to-integer"), + n = Math.min; + t.exports = function (e) { + return 0 < e ? n(o(e), 9007199254740991) : 0; + }; + }, + { "../internals/to-integer": 135 }, + ], + 137: [ + function (e, t, r) { + var o = e("../internals/require-object-coercible"); + t.exports = function (e) { + return Object(o(e)); + }; + }, + { "../internals/require-object-coercible": 113 }, + ], + 138: [ + function (e, t, r) { + var o = e("../internals/to-positive-integer"); + t.exports = function (e, t) { + e = o(e); + if (e % t) throw RangeError("Wrong offset"); + return e; + }; + }, + { "../internals/to-positive-integer": 139 }, + ], + 139: [ + function (e, t, r) { + var o = e("../internals/to-integer"); + t.exports = function (e) { + e = o(e); + if (e < 0) throw RangeError("The argument can't be less than 0"); + return e; + }; + }, + { "../internals/to-integer": 135 }, + ], + 140: [ + function (e, t, r) { + var n = e("../internals/is-object"); + t.exports = function (e, t) { + if (!n(e)) return e; + var r, o; + if ( + (t && + "function" == typeof (r = e.toString) && + !n((o = r.call(e)))) || + ("function" == typeof (r = e.valueOf) && !n((o = r.call(e)))) || + (!t && + "function" == typeof (r = e.toString) && + !n((o = r.call(e)))) + ) + return o; + throw TypeError("Can't convert object to primitive value"); + }; + }, + { "../internals/is-object": 74 }, + ], + 141: [ + function (e, t, r) { + var o = {}; + (o[e("../internals/well-known-symbol")("toStringTag")] = "z"), + (t.exports = "[object z]" === String(o)); + }, + { "../internals/well-known-symbol": 148 }, + ], + 142: [ + function (e, t, D) { + "use strict"; + function f(e, t) { + for (var r = 0, o = t.length, n = new (Q(e))(o); r < o; ) + n[r] = t[r++]; + return n; + } + function r(e, t) { + M(e, t, { + get: function () { + return T(this)[t]; + }, + }); + } + function p(e) { + return ( + e instanceof k || + "ArrayBuffer" == (e = B(e)) || + "SharedArrayBuffer" == e + ); + } + function o(e, t) { + return ( + L(e) && "symbol" != typeof t && t in e && String(+t) == String(t) + ); + } + function n(e, t) { + return o(e, (t = d(t, !0))) ? U(2, e[t]) : X(e, t); + } + function s(e, t, r) { + return !(o(e, (t = d(t, !0))) && b(r) && h(r, "value")) || + h(r, "get") || + h(r, "set") || + r.configurable || + (h(r, "writable") && !r.writable) || + (h(r, "enumerable") && !r.enumerable) + ? M(e, t, r) + : ((e[t] = r.value), e); + } + var a = e("../internals/export"), + l = e("../internals/global"), + i = e("../internals/descriptors"), + F = e("../internals/typed-array-constructors-require-wrappers"), + u = e("../internals/array-buffer-view-core"), + c = e("../internals/array-buffer"), + m = e("../internals/an-instance"), + U = e("../internals/create-property-descriptor"), + y = e("../internals/create-non-enumerable-property"), + N = e("../internals/to-length"), + g = e("../internals/to-index"), + v = e("../internals/to-offset"), + d = e("../internals/to-primitive"), + h = e("../internals/has"), + B = e("../internals/classof"), + b = e("../internals/is-object"), + G = e("../internals/object-create"), + j = e("../internals/object-set-prototype-of"), + V = e("../internals/object-get-own-property-names").f, + _ = e("../internals/typed-array-from"), + z = e("../internals/array-iteration").forEach, + H = e("../internals/set-species"), + x = e("../internals/object-define-property"), + w = e("../internals/object-get-own-property-descriptor"), + S = e("../internals/internal-state"), + W = e("../internals/inherit-if-required"), + T = S.get, + q = S.set, + M = x.f, + X = w.f, + Y = Math.round, + E = l.RangeError, + k = c.ArrayBuffer, + Z = c.DataView, + C = u.NATIVE_ARRAY_BUFFER_VIEWS, + O = u.TYPED_ARRAY_TAG, + P = u.TypedArray, + A = u.TypedArrayPrototype, + Q = u.aTypedArrayConstructor, + L = u.isTypedArray, + R = "BYTES_PER_ELEMENT", + I = "Wrong length"; + i + ? (C || + ((w.f = n), + (x.f = s), + r(A, "buffer"), + r(A, "byteOffset"), + r(A, "byteLength"), + r(A, "length")), + a( + { target: "Object", stat: !0, forced: !C }, + { getOwnPropertyDescriptor: n, defineProperty: s }, + ), + (t.exports = function (e, t, n) { + function u(e, o) { + M(e, o, { + get: function () { + var e = this, + t = o; + return (e = T(e)).view[r](t * c + e.byteOffset, !0); + }, + set: function (e) { + var t = this, + r = o; + (t = T(t)), + n && (e = (e = Y(e)) < 0 ? 0 : 255 < e ? 255 : 255 & e), + t.view[s](r * c + t.byteOffset, e, !0); + }, + enumerable: !0, + }); + } + var c = e.match(/\d+$/)[0] / 8, + d = e + (n ? "Clamped" : "") + "Array", + r = "get" + e, + s = "set" + e, + i = l[d], + h = i, + e = h && h.prototype, + o = {}; + C + ? F && + ((h = t(function (e, t, r, o) { + return ( + m(e, h, d), + W( + b(t) + ? p(t) + ? void 0 !== o + ? new i(t, v(r, c), o) + : void 0 !== r + ? new i(t, v(r, c)) + : new i(t) + : L(t) + ? f(h, t) + : _.call(h, t) + : new i(g(t)), + e, + h, + ) + ); + })), + j && j(h, P), + z(V(i), function (e) { + e in h || y(h, e, i[e]); + }), + (h.prototype = e)) + : ((h = t(function (e, t, r, o) { + m(e, h, d); + var n, + s, + i = 0, + a = 0; + if (b(t)) { + if (!p(t)) return L(t) ? f(h, t) : _.call(h, t); + var l = t, + a = v(r, c), + r = t.byteLength; + if (void 0 === o) { + if (r % c) throw E(I); + if ((n = r - a) < 0) throw E(I); + } else if (r < (n = N(o) * c) + a) throw E(I); + s = n / c; + } else (s = g(t)), (l = new k((n = s * c))); + for ( + q(e, { + buffer: l, + byteOffset: a, + byteLength: n, + length: s, + view: new Z(l), + }); + i < s; + + ) + u(e, i++); + })), + j && j(h, P), + (e = h.prototype = G(A))), + e.constructor !== h && y(e, "constructor", h), + O && y(e, O, d), + (o[d] = h), + a({ global: !0, forced: h != i, sham: !C }, o), + R in h || y(h, R, c), + R in e || y(e, R, c), + H(d); + })) + : (t.exports = function () {}); + }, + { + "../internals/an-instance": 9, + "../internals/array-buffer": 13, + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + "../internals/classof": 29, + "../internals/create-non-enumerable-property": 38, + "../internals/create-property-descriptor": 39, + "../internals/descriptors": 43, + "../internals/export": 50, + "../internals/global": 59, + "../internals/has": 60, + "../internals/inherit-if-required": 67, + "../internals/internal-state": 70, + "../internals/is-object": 74, + "../internals/object-create": 90, + "../internals/object-define-property": 92, + "../internals/object-get-own-property-descriptor": 93, + "../internals/object-get-own-property-names": 95, + "../internals/object-set-prototype-of": 101, + "../internals/set-species": 116, + "../internals/to-index": 133, + "../internals/to-length": 136, + "../internals/to-offset": 138, + "../internals/to-primitive": 140, + "../internals/typed-array-constructors-require-wrappers": 143, + "../internals/typed-array-from": 144, + }, + ], + 143: [ + function (e, t, r) { + var o = e("../internals/global"), + n = e("../internals/fails"), + s = e("../internals/check-correctness-of-iteration"), + e = e( + "../internals/array-buffer-view-core", + ).NATIVE_ARRAY_BUFFER_VIEWS, + i = o.ArrayBuffer, + a = o.Int8Array; + t.exports = + !e || + !n(function () { + a(1); + }) || + !n(function () { + new a(-1); + }) || + !s(function (e) { + new a(), new a(null), new a(1.5), new a(e); + }, !0) || + n(function () { + return 1 !== new a(new i(2), 1, void 0).length; + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/check-correctness-of-iteration": 27, + "../internals/fails": 51, + "../internals/global": 59, + }, + ], + 144: [ + function (e, t, r) { + var h = e("../internals/to-object"), + f = e("../internals/to-length"), + p = e("../internals/get-iterator-method"), + m = e("../internals/is-array-iterator-method"), + y = e("../internals/function-bind-context"), + g = e("../internals/array-buffer-view-core").aTypedArrayConstructor; + t.exports = function (e) { + var t, + r, + o, + n, + s, + i, + a = h(e), + l = arguments.length, + u = 1 < l ? arguments[1] : void 0, + c = void 0 !== u, + d = p(a); + if (null != d && !m(d)) + for (i = (s = d.call(a)).next, a = []; !(n = i.call(s)).done; ) + a.push(n.value); + for ( + c && 2 < l && (u = y(u, arguments[2], 2)), + r = f(a.length), + o = new (g(this))(r), + t = 0; + t < r; + t++ + ) + o[t] = c ? u(a[t], t) : a[t]; + return o; + }; + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/function-bind-context": 54, + "../internals/get-iterator-method": 57, + "../internals/is-array-iterator-method": 71, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 145: [ + function (e, t, r) { + var o = 0, + n = Math.random(); + t.exports = function (e) { + return ( + "Symbol(" + + String(void 0 === e ? "" : e) + + ")_" + + (++o + n).toString(36) + ); + }; + }, + {}, + ], + 146: [ + function (e, t, r) { + e = e("../internals/native-symbol"); + t.exports = e && !Symbol.sham && "symbol" == typeof Symbol.iterator; + }, + { "../internals/native-symbol": 83 }, + ], + 147: [ + function (e, t, r) { + e = e("../internals/well-known-symbol"); + r.f = e; + }, + { "../internals/well-known-symbol": 148 }, + ], + 148: [ + function (e, t, r) { + var o = e("../internals/global"), + n = e("../internals/shared"), + s = e("../internals/has"), + i = e("../internals/uid"), + a = e("../internals/native-symbol"), + e = e("../internals/use-symbol-as-uid"), + l = n("wks"), + u = o.Symbol, + c = e ? u : (u && u.withoutSetter) || i; + t.exports = function (e) { + return ( + s(l, e) || + (a && s(u, e) ? (l[e] = u[e]) : (l[e] = c("Symbol." + e))), + l[e] + ); + }; + }, + { + "../internals/global": 59, + "../internals/has": 60, + "../internals/native-symbol": 83, + "../internals/shared": 120, + "../internals/uid": 145, + "../internals/use-symbol-as-uid": 146, + }, + ], + 149: [ + function (e, t, r) { + t.exports = "\t\n\v\f\r                 \u2028\u2029\ufeff"; + }, + {}, + ], + 150: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/global"), + s = e("../internals/array-buffer"), + e = e("../internals/set-species"), + i = "ArrayBuffer", + s = s[i]; + o({ global: !0, forced: n[i] !== s }, { ArrayBuffer: s }), e(i); + }, + { + "../internals/array-buffer": 13, + "../internals/export": 50, + "../internals/global": 59, + "../internals/set-species": 116, + }, + ], + 151: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/fails"), + d = e("../internals/is-array"), + h = e("../internals/is-object"), + f = e("../internals/to-object"), + p = e("../internals/to-length"), + m = e("../internals/create-property"), + y = e("../internals/array-species-create"), + s = e("../internals/array-method-has-species-support"), + i = e("../internals/well-known-symbol"), + e = e("../internals/engine-v8-version"), + g = i("isConcatSpreadable"), + v = 9007199254740991, + b = "Maximum allowed index exceeded", + i = + 51 <= e || + !n(function () { + var e = []; + return (e[g] = !1), e.concat()[0] !== e; + }), + e = s("concat"); + o( + { target: "Array", proto: !0, forced: !i || !e }, + { + concat: function (e) { + for ( + var t, + r, + o, + n, + s, + i = f(this), + a = y(i, 0), + l = 0, + u = -1, + c = arguments.length; + u < c; + u++ + ) + if ( + ((s = void 0), + !h((n = o = -1 === u ? i : arguments[u])) || + (void 0 !== (s = n[g]) ? !s : !d(n))) + ) { + if (v <= l) throw TypeError(b); + m(a, l++, o); + } else { + if (((r = p(o.length)), v < l + r)) throw TypeError(b); + for (t = 0; t < r; t++, l++) t in o && m(a, l, o[t]); + } + return (a.length = l), a; + }, + }, + ); + }, + { + "../internals/array-method-has-species-support": 21, + "../internals/array-species-create": 25, + "../internals/create-property": 40, + "../internals/engine-v8-version": 48, + "../internals/export": 50, + "../internals/fails": 51, + "../internals/is-array": 72, + "../internals/is-object": 74, + "../internals/to-length": 136, + "../internals/to-object": 137, + "../internals/well-known-symbol": 148, + }, + ], + 152: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/array-copy-within"), + e = e("../internals/add-to-unscopables"); + o({ target: "Array", proto: !0 }, { copyWithin: n }), e("copyWithin"); + }, + { + "../internals/add-to-unscopables": 7, + "../internals/array-copy-within": 14, + "../internals/export": 50, + }, + ], + 153: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-iteration").every, + s = e("../internals/array-method-is-strict"), + e = e("../internals/array-method-uses-to-length"), + s = s("every"), + e = e("every"); + o( + { target: "Array", proto: !0, forced: !s || !e }, + { + every: function (e) { + return n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ); + }, + { + "../internals/array-iteration": 19, + "../internals/array-method-is-strict": 22, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 154: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/array-fill"), + e = e("../internals/add-to-unscopables"); + o({ target: "Array", proto: !0 }, { fill: n }), e("fill"); + }, + { + "../internals/add-to-unscopables": 7, + "../internals/array-fill": 15, + "../internals/export": 50, + }, + ], + 155: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-iteration").filter, + s = e("../internals/array-method-has-species-support"), + e = e("../internals/array-method-uses-to-length"), + s = s("filter"), + e = e("filter"); + o( + { target: "Array", proto: !0, forced: !s || !e }, + { + filter: function (e) { + return n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ); + }, + { + "../internals/array-iteration": 19, + "../internals/array-method-has-species-support": 21, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 156: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-iteration").findIndex, + s = e("../internals/add-to-unscopables"), + e = e("../internals/array-method-uses-to-length"), + i = "findIndex", + a = !0, + e = e(i); + i in [] && + Array(1)[i](function () { + a = !1; + }), + o( + { target: "Array", proto: !0, forced: a || !e }, + { + findIndex: function (e) { + return n( + this, + e, + 1 < arguments.length ? arguments[1] : void 0, + ); + }, + }, + ), + s(i); + }, + { + "../internals/add-to-unscopables": 7, + "../internals/array-iteration": 19, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 157: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + e = e("../internals/array-for-each"); + o( + { target: "Array", proto: !0, forced: [].forEach != e }, + { forEach: e }, + ); + }, + { "../internals/array-for-each": 16, "../internals/export": 50 }, + ], + 158: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/array-from"); + o( + { + target: "Array", + stat: !0, + forced: !e("../internals/check-correctness-of-iteration")( + function (e) { + Array.from(e); + }, + ), + }, + { from: n }, + ); + }, + { + "../internals/array-from": 17, + "../internals/check-correctness-of-iteration": 27, + "../internals/export": 50, + }, + ], + 159: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-includes").includes, + s = e("../internals/add-to-unscopables"); + o( + { + target: "Array", + proto: !0, + forced: !e("../internals/array-method-uses-to-length")( + "indexOf", + { ACCESSORS: !0, 1: 0 }, + ), + }, + { + includes: function (e) { + return n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ), + s("includes"); + }, + { + "../internals/add-to-unscopables": 7, + "../internals/array-includes": 18, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 160: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-includes").indexOf, + s = e("../internals/array-method-is-strict"), + e = e("../internals/array-method-uses-to-length"), + i = [].indexOf, + a = !!i && 1 / [1].indexOf(1, -0) < 0, + s = s("indexOf"), + e = e("indexOf", { ACCESSORS: !0, 1: 0 }); + o( + { target: "Array", proto: !0, forced: a || !s || !e }, + { + indexOf: function (e) { + return a + ? i.apply(this, arguments) || 0 + : n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ); + }, + { + "../internals/array-includes": 18, + "../internals/array-method-is-strict": 22, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 161: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/to-indexed-object"), + n = e("../internals/add-to-unscopables"), + s = e("../internals/iterators"), + i = e("../internals/internal-state"), + e = e("../internals/define-iterator"), + a = "Array Iterator", + l = i.set, + u = i.getterFor(a); + (t.exports = e( + Array, + "Array", + function (e, t) { + l(this, { type: a, target: o(e), index: 0, kind: t }); + }, + function () { + var e = u(this), + t = e.target, + r = e.kind, + o = e.index++; + return !t || o >= t.length + ? { value: (e.target = void 0), done: !0 } + : "keys" == r + ? { value: o, done: !1 } + : "values" == r + ? { value: t[o], done: !1 } + : { value: [o, t[o]], done: !1 }; + }, + "values", + )), + (s.Arguments = s.Array), + n("keys"), + n("values"), + n("entries"); + }, + { + "../internals/add-to-unscopables": 7, + "../internals/define-iterator": 41, + "../internals/internal-state": 70, + "../internals/iterators": 79, + "../internals/to-indexed-object": 134, + }, + ], + 162: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/indexed-object"), + s = e("../internals/to-indexed-object"), + e = e("../internals/array-method-is-strict"), + i = [].join, + n = n != Object, + e = e("join", ","); + o( + { target: "Array", proto: !0, forced: n || !e }, + { + join: function (e) { + return i.call(s(this), void 0 === e ? "," : e); + }, + }, + ); + }, + { + "../internals/array-method-is-strict": 22, + "../internals/export": 50, + "../internals/indexed-object": 66, + "../internals/to-indexed-object": 134, + }, + ], + 163: [ + function (e, t, r) { + var o = e("../internals/export"), + e = e("../internals/array-last-index-of"); + o( + { target: "Array", proto: !0, forced: e !== [].lastIndexOf }, + { lastIndexOf: e }, + ); + }, + { "../internals/array-last-index-of": 20, "../internals/export": 50 }, + ], + 164: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-iteration").map, + s = e("../internals/array-method-has-species-support"), + e = e("../internals/array-method-uses-to-length"), + s = s("map"), + e = e("map"); + o( + { target: "Array", proto: !0, forced: !s || !e }, + { + map: function (e) { + return n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ); + }, + { + "../internals/array-iteration": 19, + "../internals/array-method-has-species-support": 21, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 165: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + u = e("../internals/is-object"), + c = e("../internals/is-array"), + d = e("../internals/to-absolute-index"), + h = e("../internals/to-length"), + f = e("../internals/to-indexed-object"), + p = e("../internals/create-property"), + n = e("../internals/well-known-symbol"), + s = e("../internals/array-method-has-species-support"), + e = e("../internals/array-method-uses-to-length"), + s = s("slice"), + e = e("slice", { ACCESSORS: !0, 0: 0, 1: 2 }), + m = n("species"), + y = [].slice, + g = Math.max; + o( + { target: "Array", proto: !0, forced: !s || !e }, + { + slice: function (e, t) { + var r, + o, + n, + s = f(this), + i = h(s.length), + a = d(e, i), + l = d(void 0 === t ? i : t, i); + if ( + c(s) && + ((r = + ("function" == typeof (r = s.constructor) && + (r === Array || c(r.prototype))) || + (u(r) && null === (r = r[m])) + ? void 0 + : r) === Array || + void 0 === r) + ) + return y.call(s, a, l); + for ( + o = new (void 0 === r ? Array : r)(g(l - a, 0)), n = 0; + a < l; + a++, n++ + ) + a in s && p(o, n, s[a]); + return (o.length = n), o; + }, + }, + ); + }, + { + "../internals/array-method-has-species-support": 21, + "../internals/array-method-uses-to-length": 23, + "../internals/create-property": 40, + "../internals/export": 50, + "../internals/is-array": 72, + "../internals/is-object": 74, + "../internals/to-absolute-index": 132, + "../internals/to-indexed-object": 134, + "../internals/to-length": 136, + "../internals/well-known-symbol": 148, + }, + ], + 166: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/array-iteration").some, + s = e("../internals/array-method-is-strict"), + e = e("../internals/array-method-uses-to-length"), + s = s("some"), + e = e("some"); + o( + { target: "Array", proto: !0, forced: !s || !e }, + { + some: function (e) { + return n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ); + }, + { + "../internals/array-iteration": 19, + "../internals/array-method-is-strict": 22, + "../internals/array-method-uses-to-length": 23, + "../internals/export": 50, + }, + ], + 167: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + d = e("../internals/to-absolute-index"), + h = e("../internals/to-integer"), + f = e("../internals/to-length"), + p = e("../internals/to-object"), + m = e("../internals/array-species-create"), + y = e("../internals/create-property"), + n = e("../internals/array-method-has-species-support"), + e = e("../internals/array-method-uses-to-length"), + n = n("splice"), + e = e("splice", { ACCESSORS: !0, 0: 0, 1: 2 }), + g = Math.max, + v = Math.min; + o( + { target: "Array", proto: !0, forced: !n || !e }, + { + splice: function (e, t) { + var r, + o, + n, + s, + i, + a, + l = p(this), + u = f(l.length), + c = d(e, u), + e = arguments.length; + if ( + (0 === e + ? (r = o = 0) + : (o = + 1 === e + ? ((r = 0), u - c) + : ((r = e - 2), v(g(h(t), 0), u - c))), + 9007199254740991 < u + r - o) + ) + throw TypeError("Maximum allowed length exceeded"); + for (n = m(l, o), s = 0; s < o; s++) + (i = c + s) in l && y(n, s, l[i]); + if (r < (n.length = o)) { + for (s = c; s < u - o; s++) + (a = s + r), (i = s + o) in l ? (l[a] = l[i]) : delete l[a]; + for (s = u; u - o + r < s; s--) delete l[s - 1]; + } else if (o < r) + for (s = u - o; c < s; s--) + (a = s + r - 1), + (i = s + o - 1) in l ? (l[a] = l[i]) : delete l[a]; + for (s = 0; s < r; s++) l[s + c] = arguments[s + 2]; + return (l.length = u - o + r), n; + }, + }, + ); + }, + { + "../internals/array-method-has-species-support": 21, + "../internals/array-method-uses-to-length": 23, + "../internals/array-species-create": 25, + "../internals/create-property": 40, + "../internals/export": 50, + "../internals/to-absolute-index": 132, + "../internals/to-integer": 135, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 168: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + e = e("../internals/object-define-property").f, + n = Function.prototype, + s = n.toString, + i = /^\s*function ([^ (]*)/; + !o || + "name" in n || + e(n, "name", { + configurable: !0, + get: function () { + try { + return s.call(this).match(i)[1]; + } catch (e) { + return ""; + } + }, + }); + }, + { + "../internals/descriptors": 43, + "../internals/object-define-property": 92, + }, + ], + 169: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/collection"), + e = e("../internals/collection-strong"); + t.exports = o( + "Map", + function (e) { + return function () { + return e(this, arguments.length ? arguments[0] : void 0); + }; + }, + e, + ); + }, + { "../internals/collection": 32, "../internals/collection-strong": 30 }, + ], + 170: [ + function (e, t, r) { + var e = e("../internals/export"), + o = Math.hypot, + l = Math.abs, + u = Math.sqrt; + e( + { + target: "Math", + stat: !0, + forced: !!o && o(1 / 0, NaN) !== 1 / 0, + }, + { + hypot: function (e, t) { + for ( + var r, o, n = 0, s = 0, i = arguments.length, a = 0; + s < i; + + ) + a < (r = l(arguments[s++])) + ? ((n = n * (o = a / r) * o + 1), (a = r)) + : (n += 0 < r ? (o = r / a) * o : r); + return a === 1 / 0 ? 1 / 0 : a * u(n); + }, + }, + ); + }, + { "../internals/export": 50 }, + ], + 171: [ + function (e, t, r) { + var e = e("../internals/export"), + o = Math.log, + n = Math.LN2; + e( + { target: "Math", stat: !0 }, + { + log2: function (e) { + return o(e) / n; + }, + }, + ); + }, + { "../internals/export": 50 }, + ], + 172: [ + function (e, t, r) { + e("../internals/export")( + { target: "Math", stat: !0 }, + { sign: e("../internals/math-sign") }, + ); + }, + { "../internals/export": 50, "../internals/math-sign": 80 }, + ], + 173: [ + function (e, t, r) { + "use strict"; + function o(e) { + var t, + r, + o, + n, + s, + i, + a, + l = d(e, !1); + if ("string" == typeof l && 2 < l.length) + if (43 === (e = (l = g(l)).charCodeAt(0)) || 45 === e) { + if (88 === (t = l.charCodeAt(2)) || 120 === t) return NaN; + } else if (48 === e) { + switch (l.charCodeAt(1)) { + case 66: + case 98: + (r = 2), (o = 49); + break; + case 79: + case 111: + (r = 8), (o = 55); + break; + default: + return +l; + } + for (s = (n = l.slice(2)).length, i = 0; i < s; i++) + if ((a = n.charCodeAt(i)) < 48 || o < a) return NaN; + return parseInt(n, r); + } + return +l; + } + var n = e("../internals/descriptors"), + s = e("../internals/global"), + i = e("../internals/is-forced"), + a = e("../internals/redefine"), + l = e("../internals/has"), + u = e("../internals/classof-raw"), + c = e("../internals/inherit-if-required"), + d = e("../internals/to-primitive"), + h = e("../internals/fails"), + f = e("../internals/object-create"), + p = e("../internals/object-get-own-property-names").f, + m = e("../internals/object-get-own-property-descriptor").f, + y = e("../internals/object-define-property").f, + g = e("../internals/string-trim").trim, + v = "Number", + b = s[v], + j = b.prototype, + _ = u(f(j)) == v; + if (i(v, !b(" 0o1") || !b("0b1") || b("+0x1"))) { + for ( + var x, + w = function (e) { + var e = arguments.length < 1 ? 0 : e, + t = this; + return t instanceof w && + (_ + ? h(function () { + j.valueOf.call(t); + }) + : u(t) != v) + ? c(new b(o(e)), t, w) + : o(e); + }, + S = n + ? p(b) + : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split( + ",", + ), + T = 0; + S.length > T; + T++ + ) + l(b, (x = S[T])) && !l(w, x) && y(w, x, m(b, x)); + ((w.prototype = j).constructor = w), a(s, v, w); + } + }, + { + "../internals/classof-raw": 28, + "../internals/descriptors": 43, + "../internals/fails": 51, + "../internals/global": 59, + "../internals/has": 60, + "../internals/inherit-if-required": 67, + "../internals/is-forced": 73, + "../internals/object-create": 90, + "../internals/object-define-property": 92, + "../internals/object-get-own-property-descriptor": 93, + "../internals/object-get-own-property-names": 95, + "../internals/redefine": 108, + "../internals/string-trim": 129, + "../internals/to-primitive": 140, + }, + ], + 174: [ + function (e, t, r) { + e("../internals/export")( + { target: "Number", stat: !0 }, + { isFinite: e("../internals/number-is-finite") }, + ); + }, + { "../internals/export": 50, "../internals/number-is-finite": 88 }, + ], + 175: [ + function (e, t, r) { + "use strict"; + function c(e, t, r) { + return 0 === t + ? r + : t % 2 == 1 + ? c(e, t - 1, r * e) + : c(e * e, t / 2, r); + } + var o = e("../internals/export"), + d = e("../internals/to-integer"), + h = e("../internals/this-number-value"), + f = e("../internals/string-repeat"), + e = e("../internals/fails"), + n = (1).toFixed, + p = Math.floor; + o( + { + target: "Number", + proto: !0, + forced: + (n && + ("0.000" !== (8e-5).toFixed(3) || + "1" !== (0.9).toFixed(0) || + "1.25" !== (1.255).toFixed(2) || + "1000000000000000128" !== + (0xde0b6b3a7640080).toFixed(0))) || + !e(function () { + n.call({}); + }), + }, + { + toFixed: function (e) { + function t(e, t) { + for (var r = -1, o = t; ++r < 6; ) + (o += e * a[r]), (a[r] = o % 1e7), (o = p(o / 1e7)); + } + function r(e) { + for (var t = 6, r = 0; 0 <= --t; ) + (r += a[t]), (a[t] = p(r / e)), (r = (r % e) * 1e7); + } + function o() { + for (var e, t = 6, r = ""; 0 <= --t; ) + ("" === r && 0 !== t && 0 === a[t]) || + ((e = String(a[t])), + (r = "" === r ? e : r + f.call("0", 7 - e.length) + e)); + return r; + } + var n, + s, + i = h(this), + e = d(e), + a = [0, 0, 0, 0, 0, 0], + l = "", + u = "0"; + if (e < 0 || 20 < e) + throw RangeError("Incorrect fraction digits"); + if (i != i) return "NaN"; + if (i <= -1e21 || 1e21 <= i) return String(i); + if ((i < 0 && ((l = "-"), (i = -i)), 1e-21 < i)) + if ( + ((i = + (n = + (function (e) { + for (var t = 0, r = e; 4096 <= r; ) + (t += 12), (r /= 4096); + for (; 2 <= r; ) (t += 1), (r /= 2); + return t; + })(i * c(2, 69, 1)) - 69) < 0 + ? i * c(2, -n, 1) + : i / c(2, n, 1)), + (i *= 4503599627370496), + 0 < (n = 52 - n)) + ) { + for (t(0, i), s = e; 7 <= s; ) t(1e7, 0), (s -= 7); + for (t(c(10, s, 1), 0), s = n - 1; 23 <= s; ) + r(1 << 23), (s -= 23); + r(1 << s), t(1, 1), r(2), (u = o()); + } else t(0, i), t(1 << -n, 0), (u = o() + f.call("0", e)); + return (u = + 0 < e + ? l + + ((i = u.length) <= e + ? "0." + f.call("0", e - i) + u + : u.slice(0, i - e) + "." + u.slice(i - e)) + : l + u); + }, + }, + ); + }, + { + "../internals/export": 50, + "../internals/fails": 51, + "../internals/string-repeat": 127, + "../internals/this-number-value": 131, + "../internals/to-integer": 135, + }, + ], + 176: [ + function (e, t, r) { + var o = e("../internals/export"), + e = e("../internals/object-assign"); + o( + { target: "Object", stat: !0, forced: Object.assign !== e }, + { assign: e }, + ); + }, + { "../internals/export": 50, "../internals/object-assign": 89 }, + ], + 177: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/iterate"), + s = e("../internals/create-property"); + o( + { target: "Object", stat: !0 }, + { + fromEntries: function (e) { + var r = {}; + return ( + n( + e, + function (e, t) { + s(r, e, t); + }, + void 0, + !0, + ), + r + ); + }, + }, + ); + }, + { + "../internals/create-property": 40, + "../internals/export": 50, + "../internals/iterate": 77, + }, + ], + 178: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/fails"), + s = e("../internals/to-indexed-object"), + i = e("../internals/object-get-own-property-descriptor").f, + e = e("../internals/descriptors"), + n = n(function () { + i(1); + }); + o( + { target: "Object", stat: !0, forced: !e || n, sham: !e }, + { + getOwnPropertyDescriptor: function (e, t) { + return i(s(e), t); + }, + }, + ); + }, + { + "../internals/descriptors": 43, + "../internals/export": 50, + "../internals/fails": 51, + "../internals/object-get-own-property-descriptor": 93, + "../internals/to-indexed-object": 134, + }, + ], + 179: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/fails"), + e = e("../internals/object-get-own-property-names-external").f; + o( + { + target: "Object", + stat: !0, + forced: n(function () { + return !Object.getOwnPropertyNames(1); + }), + }, + { getOwnPropertyNames: e }, + ); + }, + { + "../internals/export": 50, + "../internals/fails": 51, + "../internals/object-get-own-property-names-external": 94, + }, + ], + 180: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/fails"), + s = e("../internals/to-object"), + i = e("../internals/object-get-prototype-of"), + e = e("../internals/correct-prototype-getter"); + o( + { + target: "Object", + stat: !0, + forced: n(function () { + i(1); + }), + sham: !e, + }, + { + getPrototypeOf: function (e) { + return i(s(e)); + }, + }, + ); + }, + { + "../internals/correct-prototype-getter": 35, + "../internals/export": 50, + "../internals/fails": 51, + "../internals/object-get-prototype-of": 97, + "../internals/to-object": 137, + }, + ], + 181: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/to-object"), + s = e("../internals/object-keys"); + o( + { + target: "Object", + stat: !0, + forced: e("../internals/fails")(function () { + s(1); + }), + }, + { + keys: function (e) { + return s(n(e)); + }, + }, + ); + }, + { + "../internals/export": 50, + "../internals/fails": 51, + "../internals/object-keys": 99, + "../internals/to-object": 137, + }, + ], + 182: [ + function (e, t, r) { + var o = e("../internals/to-string-tag-support"), + n = e("../internals/redefine"), + e = e("../internals/object-to-string"); + o || n(Object.prototype, "toString", e, { unsafe: !0 }); + }, + { + "../internals/object-to-string": 102, + "../internals/redefine": 108, + "../internals/to-string-tag-support": 141, + }, + ], + 183: [ + function (e, D, F) { + "use strict"; + var r, + t, + o, + n, + s = e("../internals/export"), + i = e("../internals/is-pure"), + g = e("../internals/global"), + a = e("../internals/get-built-in"), + l = e("../internals/native-promise-constructor"), + U = e("../internals/redefine"), + N = e("../internals/redefine-all"), + B = e("../internals/set-to-string-tag"), + G = e("../internals/set-species"), + V = e("../internals/is-object"), + c = e("../internals/a-function"), + z = e("../internals/an-instance"), + H = e("../internals/classof-raw"), + W = e("../internals/inspect-source"), + d = e("../internals/iterate"), + q = e("../internals/check-correctness-of-iteration"), + X = e("../internals/species-constructor"), + v = e("../internals/task").set, + u = e("../internals/microtask"), + h = e("../internals/promise-resolve"), + Y = e("../internals/host-report-errors"), + f = e("../internals/new-promise-capability"), + b = e("../internals/perform"), + p = e("../internals/internal-state"), + Z = e("../internals/is-forced"), + m = e("../internals/well-known-symbol"), + y = e("../internals/engine-v8-version"), + Q = m("species"), + j = "Promise", + _ = p.get, + J = p.set, + K = p.getterFor(j), + x = l, + w = g.TypeError, + S = g.document, + T = g.process, + M = a("fetch"), + E = f.f, + $ = E, + k = "process" == H(T), + ee = !!(S && S.createEvent && g.dispatchEvent), + C = "unhandledrejection", + te = "rejectionhandled", + O = 1, + re = 2, + P = 1, + oe = 2, + e = Z(j, function () { + var e, t; + if (!(W(x) !== String(x))) { + if (66 === y) return !0; + if (!k && "function" != typeof PromiseRejectionEvent) return !0; + } + return ( + !(!i || x.prototype.finally) || + (!(51 <= y && /native code/.test(x)) && + ((t = function (e) { + e( + function () {}, + function () {}, + ); + }), + (((e = x.resolve(1)).constructor = {})[Q] = t), + !(e.then(function () {}) instanceof t))) + ); + }), + m = + e || + !q(function (e) { + x.all(e).catch(function () {}); + }), + ne = function (e) { + var t; + return !(!V(e) || "function" != typeof (t = e.then)) && t; + }, + A = function (f, p, m) { + var y; + p.notified || + ((p.notified = !0), + (y = p.reactions), + u(function () { + for ( + var r, o, e = p.value, t = p.state == O, n = 0; + y.length > n; + + ) { + var s, + i, + a, + l = y[n++], + u = t ? l.ok : l.fail, + c = l.resolve, + d = l.reject, + h = l.domain; + try { + u + ? (t || + (p.rejection === oe && + (function (e, t) { + v.call(g, function () { + if (k) T.emit("rejectionHandled", e); + else se(te, e, t.value); + }); + })(f, p), + (p.rejection = P)), + !0 === u + ? (s = e) + : (h && h.enter(), + (s = u(e)), + h && (h.exit(), (a = !0))), + s === l.promise + ? d(w("Promise-chain cycle")) + : (i = ne(s)) + ? i.call(s, c, d) + : c(s)) + : d(e); + } catch (e) { + h && !a && h.exit(), d(e); + } + } + (p.reactions = []), + (p.notified = !1), + m && + !p.rejection && + ((r = f), + (o = p), + v.call(g, function () { + var e = o.value, + t = ie(o); + if ( + t && + ((t = b(function () { + k + ? T.emit("unhandledRejection", e, r) + : se(C, r, e); + })), + (o.rejection = k || ie(o) ? oe : P), + t.error) + ) + throw t.value; + })); + })); + }, + se = function (e, t, r) { + var o; + ee + ? (((o = S.createEvent("Event")).promise = t), + (o.reason = r), + o.initEvent(e, !1, !0), + g.dispatchEvent(o)) + : (o = { promise: t, reason: r }), + (t = g["on" + e]) + ? t(o) + : e === C && Y("Unhandled promise rejection", r); + }, + ie = function (e) { + return e.rejection !== P && !e.parent; + }, + L = function (t, r, o, n) { + return function (e) { + t(r, o, e, n); + }; + }, + R = function (e, t, r, o) { + t.done || + ((t.done = !0), + ((t = o ? o : t).value = r), + (t.state = re), + A(e, t, !0)); + }, + I = function (r, o, e, t) { + if (!o.done) { + (o.done = !0), t && (o = t); + try { + if (r === e) throw w("Promise can't be resolved itself"); + var n = ne(e); + n + ? u(function () { + var t = { done: !1 }; + try { + n.call(e, L(I, r, t, o), L(R, r, t, o)); + } catch (e) { + R(r, t, e, o); + } + }) + : ((o.value = e), (o.state = O), A(r, o, !1)); + } catch (e) { + R(r, { done: !1 }, e, o); + } + } + }; + e && + ((x = function (e) { + z(this, x, j), c(e), r.call(this); + var t = _(this); + try { + e(L(I, this, t), L(R, this, t)); + } catch (e) { + R(this, t, e); + } + }), + ((r = function (e) { + J(this, { + type: j, + done: !1, + notified: !1, + parent: !1, + reactions: [], + rejection: !1, + state: 0, + value: void 0, + }); + }).prototype = N(x.prototype, { + then: function (e, t) { + var r = K(this), + o = E(X(this, x)); + return ( + (o.ok = "function" != typeof e || e), + (o.fail = "function" == typeof t && t), + (o.domain = k ? T.domain : void 0), + (r.parent = !0), + r.reactions.push(o), + 0 != r.state && A(this, r, !1), + o.promise + ); + }, + catch: function (e) { + return this.then(void 0, e); + }, + })), + (t = function () { + var e = new r(), + t = _(e); + (this.promise = e), + (this.resolve = L(I, e, t)), + (this.reject = L(R, e, t)); + }), + (f.f = E = + function (e) { + return e === x || e === o ? new t() : $(e); + }), + i || + "function" != typeof l || + ((n = l.prototype.then), + U( + l.prototype, + "then", + function (e, t) { + var r = this; + return new x(function (e, t) { + n.call(r, e, t); + }).then(e, t); + }, + { unsafe: !0 }, + ), + "function" == typeof M && + s( + { global: !0, enumerable: !0, forced: !0 }, + { + fetch: function (e) { + return h(x, M.apply(g, arguments)); + }, + }, + ))), + s({ global: !0, wrap: !0, forced: e }, { Promise: x }), + B(x, j, !1, !0), + G(j), + (o = a(j)), + s( + { target: j, stat: !0, forced: e }, + { + reject: function (e) { + var t = E(this); + return t.reject.call(void 0, e), t.promise; + }, + }, + ), + s( + { target: j, stat: !0, forced: i || e }, + { + resolve: function (e) { + return h(i && this === o ? x : this, e); + }, + }, + ), + s( + { target: j, stat: !0, forced: m }, + { + all: function (e) { + var a = this, + t = E(a), + l = t.resolve, + u = t.reject, + r = b(function () { + var o = c(a.resolve), + n = [], + s = 0, + i = 1; + d(e, function (e) { + var t = s++, + r = !1; + n.push(void 0), + i++, + o.call(a, e).then(function (e) { + r || ((r = !0), (n[t] = e), --i || l(n)); + }, u); + }), + --i || l(n); + }); + return r.error && u(r.value), t.promise; + }, + race: function (e) { + var r = this, + o = E(r), + n = o.reject, + t = b(function () { + var t = c(r.resolve); + d(e, function (e) { + t.call(r, e).then(o.resolve, n); + }); + }); + return t.error && n(t.value), o.promise; + }, + }, + ); + }, + { + "../internals/a-function": 5, + "../internals/an-instance": 9, + "../internals/check-correctness-of-iteration": 27, + "../internals/classof-raw": 28, + "../internals/engine-v8-version": 48, + "../internals/export": 50, + "../internals/get-built-in": 56, + "../internals/global": 59, + "../internals/host-report-errors": 62, + "../internals/inspect-source": 68, + "../internals/internal-state": 70, + "../internals/is-forced": 73, + "../internals/is-object": 74, + "../internals/is-pure": 75, + "../internals/iterate": 77, + "../internals/microtask": 81, + "../internals/native-promise-constructor": 82, + "../internals/new-promise-capability": 86, + "../internals/perform": 105, + "../internals/promise-resolve": 106, + "../internals/redefine": 108, + "../internals/redefine-all": 107, + "../internals/set-species": 116, + "../internals/set-to-string-tag": 117, + "../internals/species-constructor": 121, + "../internals/task": 130, + "../internals/well-known-symbol": 148, + }, + ], + 184: [ + function (e, t, r) { + var o = e("../internals/export"), + n = e("../internals/get-built-in"), + s = e("../internals/a-function"), + i = e("../internals/an-object"), + a = e("../internals/is-object"), + l = e("../internals/object-create"), + u = e("../internals/function-bind"), + e = e("../internals/fails"), + c = n("Reflect", "construct"), + d = e(function () { + function e() {} + return !(c(function () {}, [], e) instanceof e); + }), + h = !e(function () { + c(function () {}); + }), + n = d || h; + o( + { target: "Reflect", stat: !0, forced: n, sham: n }, + { + construct: function (e, t) { + s(e), i(t); + var r = arguments.length < 3 ? e : s(arguments[2]); + if (h && !d) return c(e, t, r); + if (e == r) { + switch (t.length) { + case 0: + return new e(); + case 1: + return new e(t[0]); + case 2: + return new e(t[0], t[1]); + case 3: + return new e(t[0], t[1], t[2]); + case 4: + return new e(t[0], t[1], t[2], t[3]); + } + var o = [null]; + return o.push.apply(o, t), new (u.apply(e, o))(); + } + (o = r.prototype), + (r = l(a(o) ? o : Object.prototype)), + (o = Function.apply.call(e, r, t)); + return a(o) ? o : r; + }, + }, + ); + }, + { + "../internals/a-function": 5, + "../internals/an-object": 10, + "../internals/export": 50, + "../internals/fails": 51, + "../internals/function-bind": 55, + "../internals/get-built-in": 56, + "../internals/is-object": 74, + "../internals/object-create": 90, + }, + ], + 185: [ + function (e, t, r) { + var o = e("../internals/export"), + s = e("../internals/is-object"), + i = e("../internals/an-object"), + a = e("../internals/has"), + l = e("../internals/object-get-own-property-descriptor"), + u = e("../internals/object-get-prototype-of"); + o( + { target: "Reflect", stat: !0 }, + { + get: function e(t, r) { + var o, + n = arguments.length < 3 ? t : arguments[2]; + return i(t) === n + ? t[r] + : (o = l.f(t, r)) + ? a(o, "value") + ? o.value + : void 0 === o.get + ? void 0 + : o.get.call(n) + : s((o = u(t))) + ? e(o, r, n) + : void 0; + }, + }, + ); + }, + { + "../internals/an-object": 10, + "../internals/export": 50, + "../internals/has": 60, + "../internals/is-object": 74, + "../internals/object-get-own-property-descriptor": 93, + "../internals/object-get-prototype-of": 97, + }, + ], + 186: [ + function (e, t, r) { + var o = e("../internals/descriptors"), + n = e("../internals/global"), + s = e("../internals/is-forced"), + i = e("../internals/inherit-if-required"), + a = e("../internals/object-define-property").f, + l = e("../internals/object-get-own-property-names").f, + u = e("../internals/is-regexp"), + c = e("../internals/regexp-flags"), + d = e("../internals/regexp-sticky-helpers"), + h = e("../internals/redefine"), + f = e("../internals/fails"), + p = e("../internals/internal-state").set, + m = e("../internals/set-species"), + y = e("../internals/well-known-symbol")("match"), + g = n.RegExp, + v = g.prototype, + b = /a/g, + j = /a/g, + _ = new g(b) !== b, + x = d.UNSUPPORTED_Y; + if ( + o && + s( + "RegExp", + !_ || + x || + f(function () { + return ( + (j[y] = !1), g(b) != b || g(j) == j || "/a/i" != g(b, "i") + ); + }), + ) + ) { + for ( + var w = function (e, t) { + var r, + o = this instanceof w, + n = u(e), + s = void 0 === t; + if (!o && n && e.constructor === w && s) return e; + _ + ? n && !s && (e = e.source) + : e instanceof w && (s && (t = c.call(e)), (e = e.source)), + x && + (r = !!t && -1 < t.indexOf("y")) && + (t = t.replace(/y/g, "")); + n = i(_ ? new g(e, t) : g(e, t), o ? this : v, w); + return x && r && p(n, { sticky: r }), n; + }, + S = l(g), + T = 0; + S.length > T; + + ) + !(function (t) { + t in w || + a(w, t, { + configurable: !0, + get: function () { + return g[t]; + }, + set: function (e) { + g[t] = e; + }, + }); + })(S[T++]); + ((v.constructor = w).prototype = v), h(n, "RegExp", w); + } + m("RegExp"); + }, + { + "../internals/descriptors": 43, + "../internals/fails": 51, + "../internals/global": 59, + "../internals/inherit-if-required": 67, + "../internals/internal-state": 70, + "../internals/is-forced": 73, + "../internals/is-regexp": 76, + "../internals/object-define-property": 92, + "../internals/object-get-own-property-names": 95, + "../internals/redefine": 108, + "../internals/regexp-flags": 111, + "../internals/regexp-sticky-helpers": 112, + "../internals/set-species": 116, + "../internals/well-known-symbol": 148, + }, + ], + 187: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + e = e("../internals/regexp-exec"); + o( + { target: "RegExp", proto: !0, forced: /./.exec !== e }, + { exec: e }, + ); + }, + { "../internals/export": 50, "../internals/regexp-exec": 110 }, + ], + 188: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/redefine"), + n = e("../internals/an-object"), + s = e("../internals/fails"), + i = e("../internals/regexp-flags"), + e = "toString", + a = RegExp.prototype, + l = a[e], + s = s(function () { + return "/a/b" != l.call({ source: "a", flags: "b" }); + }), + u = l.name != e; + (s || u) && + o( + RegExp.prototype, + e, + function () { + var e = n(this), + t = String(e.source), + r = e.flags; + return ( + "/" + + t + + "/" + + String( + void 0 === r && e instanceof RegExp && !("flags" in a) + ? i.call(e) + : r, + ) + ); + }, + { unsafe: !0 }, + ); + }, + { + "../internals/an-object": 10, + "../internals/fails": 51, + "../internals/redefine": 108, + "../internals/regexp-flags": 111, + }, + ], + 189: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/collection"), + e = e("../internals/collection-strong"); + t.exports = o( + "Set", + function (e) { + return function () { + return e(this, arguments.length ? arguments[0] : void 0); + }; + }, + e, + ); + }, + { "../internals/collection": 32, "../internals/collection-strong": 30 }, + ], + 190: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/object-get-own-property-descriptor").f, + s = e("../internals/to-length"), + i = e("../internals/not-a-regexp"), + a = e("../internals/require-object-coercible"), + l = e("../internals/correct-is-regexp-logic"), + e = e("../internals/is-pure"), + u = "".endsWith, + c = Math.min, + l = l("endsWith"); + o( + { + target: "String", + proto: !0, + forced: + !!( + e || + l || + !(o = n(String.prototype, "endsWith")) || + o.writable + ) && !l, + }, + { + endsWith: function (e) { + var t = String(a(this)), + r = (i(e), 1 < arguments.length ? arguments[1] : void 0), + o = s(t.length), + r = void 0 === r ? o : c(s(r), o), + o = String(e); + return u ? u.call(t, o, r) : t.slice(r - o.length, r) === o; + }, + }, + ); + }, + { + "../internals/correct-is-regexp-logic": 34, + "../internals/export": 50, + "../internals/is-pure": 75, + "../internals/not-a-regexp": 87, + "../internals/object-get-own-property-descriptor": 93, + "../internals/require-object-coercible": 113, + "../internals/to-length": 136, + }, + ], + 191: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/not-a-regexp"), + s = e("../internals/require-object-coercible"); + o( + { + target: "String", + proto: !0, + forced: !e("../internals/correct-is-regexp-logic")("includes"), + }, + { + includes: function (e) { + return !!~String(s(this)).indexOf( + n(e), + 1 < arguments.length ? arguments[1] : void 0, + ); + }, + }, + ); + }, + { + "../internals/correct-is-regexp-logic": 34, + "../internals/export": 50, + "../internals/not-a-regexp": 87, + "../internals/require-object-coercible": 113, + }, + ], + 192: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/string-multibyte").charAt, + n = e("../internals/internal-state"), + e = e("../internals/define-iterator"), + s = "String Iterator", + i = n.set, + a = n.getterFor(s); + e( + String, + "String", + function (e) { + i(this, { type: s, string: String(e), index: 0 }); + }, + function () { + var e = a(this), + t = e.string, + r = e.index; + return r >= t.length + ? { value: void 0, done: !0 } + : ((t = o(t, r)), + (e.index += t.length), + { value: t, done: !1 }); + }, + ); + }, + { + "../internals/define-iterator": 41, + "../internals/internal-state": 70, + "../internals/string-multibyte": 123, + }, + ], + 193: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/fix-regexp-well-known-symbol-logic"), + c = e("../internals/an-object"), + d = e("../internals/to-length"), + n = e("../internals/require-object-coercible"), + h = e("../internals/advance-string-index"), + f = e("../internals/regexp-exec-abstract"); + o("match", 1, function (o, l, u) { + return [ + function (e) { + var t = n(this), + r = null == e ? void 0 : e[o]; + return void 0 !== r + ? r.call(e, t) + : new RegExp(e)[o](String(t)); + }, + function (e) { + var t = u(l, e, this); + if (t.done) return t.value; + var r = c(e), + o = String(this); + if (!r.global) return f(r, o); + for ( + var n = r.unicode, s = [], i = (r.lastIndex = 0); + null !== (a = f(r, o)); + + ) { + var a = String(a[0]); + "" === (s[i] = a) && (r.lastIndex = h(o, d(r.lastIndex), n)), + i++; + } + return 0 === i ? null : s; + }, + ]; + }); + }, + { + "../internals/advance-string-index": 8, + "../internals/an-object": 10, + "../internals/fix-regexp-well-known-symbol-logic": 52, + "../internals/regexp-exec-abstract": 109, + "../internals/require-object-coercible": 113, + "../internals/to-length": 136, + }, + ], + 194: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/string-pad").start; + o( + { + target: "String", + proto: !0, + forced: e("../internals/string-pad-webkit-bug"), + }, + { + padStart: function (e) { + return n(this, e, 1 < arguments.length ? arguments[1] : void 0); + }, + }, + ); + }, + { + "../internals/export": 50, + "../internals/string-pad": 125, + "../internals/string-pad-webkit-bug": 124, + }, + ], + 195: [ + function (e, t, r) { + e("../internals/export")( + { target: "String", proto: !0 }, + { repeat: e("../internals/string-repeat") }, + ); + }, + { "../internals/export": 50, "../internals/string-repeat": 127 }, + ], + 196: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/fix-regexp-well-known-symbol-logic"), + T = e("../internals/an-object"), + M = e("../internals/to-object"), + E = e("../internals/to-length"), + k = e("../internals/to-integer"), + s = e("../internals/require-object-coercible"), + C = e("../internals/advance-string-index"), + O = e("../internals/regexp-exec-abstract"), + P = Math.max, + A = Math.min, + L = Math.floor, + R = /\$([$&'`]|\d\d?|<[^>]*>)/g, + I = /\$([$&'`]|\d\d?)/g; + o("replace", 2, function (n, j, _, e) { + var x = e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE, + w = e.REPLACE_KEEPS_$0, + S = x ? "$" : "$0"; + return [ + function (e, t) { + var r = s(this), + o = null == e ? void 0 : e[n]; + return void 0 !== o ? o.call(e, r, t) : j.call(String(r), e, t); + }, + function (e, t) { + if ( + (!x && w) || + ("string" == typeof t && -1 === t.indexOf(S)) + ) { + var r = _(j, e, this, t); + if (r.done) return r.value; + } + for ( + var o, + n = T(e), + s = String(this), + i = "function" == typeof t, + a = (i || (t = String(t)), n.global), + l = (a && ((o = n.unicode), (n.lastIndex = 0)), []); + null !== (f = O(n, s)) && (l.push(f), a); + + ) + "" === String(f[0]) && + (n.lastIndex = C(s, E(n.lastIndex), o)); + for (var u, c = "", d = 0, h = 0; h < l.length; h++) { + for ( + var f = l[h], + p = String(f[0]), + m = P(A(k(f.index), s.length), 0), + y = [], + g = 1; + g < f.length; + g++ + ) + y.push(void 0 === (u = f[g]) ? u : String(u)); + var v = f.groups, + b = i + ? ((b = [p].concat(y, m, s)), + void 0 !== v && b.push(v), + String(t.apply(void 0, b))) + : (function (s, i, a, l, u, e) { + var c = a + s.length, + d = l.length, + t = I; + void 0 !== u && ((u = M(u)), (t = R)); + return j.call(e, t, function (e, t) { + var r; + switch (t.charAt(0)) { + case "$": + return "$"; + case "&": + return s; + case "`": + return i.slice(0, a); + case "'": + return i.slice(c); + case "<": + r = u[t.slice(1, -1)]; + break; + default: + var o, + n = +t; + if (0 == n) return e; + if (d < n) + return 0 !== (o = L(n / 10)) && o <= d + ? void 0 === l[o - 1] + ? t.charAt(1) + : l[o - 1] + t.charAt(1) + : e; + r = l[n - 1]; + } + return void 0 === r ? "" : r; + }); + })(p, s, m, y, v, t); + d <= m && ((c += s.slice(d, m) + b), (d = m + p.length)); + } + return c + s.slice(d); + }, + ]; + }); + }, + { + "../internals/advance-string-index": 8, + "../internals/an-object": 10, + "../internals/fix-regexp-well-known-symbol-logic": 52, + "../internals/regexp-exec-abstract": 109, + "../internals/require-object-coercible": 113, + "../internals/to-integer": 135, + "../internals/to-length": 136, + "../internals/to-object": 137, + }, + ], + 197: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/fix-regexp-well-known-symbol-logic"), + i = e("../internals/an-object"), + a = e("../internals/require-object-coercible"), + l = e("../internals/same-value"), + u = e("../internals/regexp-exec-abstract"); + o("search", 1, function (o, n, s) { + return [ + function (e) { + var t = a(this), + r = null == e ? void 0 : e[o]; + return void 0 !== r + ? r.call(e, t) + : new RegExp(e)[o](String(t)); + }, + function (e) { + var t, + r = s(n, e, this); + return r.done + ? r.value + : ((r = i(e)), + (e = String(this)), + (t = r.lastIndex), + l(t, 0) || (r.lastIndex = 0), + (e = u(r, e)), + l(r.lastIndex, t) || (r.lastIndex = t), + null === e ? -1 : e.index); + }, + ]; + }); + }, + { + "../internals/an-object": 10, + "../internals/fix-regexp-well-known-symbol-logic": 52, + "../internals/regexp-exec-abstract": 109, + "../internals/require-object-coercible": 113, + "../internals/same-value": 114, + }, + ], + 198: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/fix-regexp-well-known-symbol-logic"), + c = e("../internals/is-regexp"), + g = e("../internals/an-object"), + d = e("../internals/require-object-coercible"), + v = e("../internals/species-constructor"), + b = e("../internals/advance-string-index"), + j = e("../internals/to-length"), + _ = e("../internals/regexp-exec-abstract"), + h = e("../internals/regexp-exec"), + e = e("../internals/fails"), + f = [].push, + x = Math.min, + w = 4294967295, + S = !e(function () { + return !RegExp(w, "y"); + }); + o( + "split", + 2, + function (n, p, m) { + var y = + "c" == "abbc".split(/(b)*/)[1] || + 4 != "test".split(/(?:)/, -1).length || + 2 != "ab".split(/(?:ab)*/).length || + 4 != ".".split(/(.?)(.?)/).length || + 1 < ".".split(/()()/).length || + "".split(/.?/).length + ? function (e, t) { + var r = String(d(this)), + o = void 0 === t ? w : t >>> 0; + if (0 == o) return []; + if (void 0 === e) return [r]; + if (!c(e)) return p.call(r, e, o); + for ( + var n, + s, + i, + a = [], + t = + (e.ignoreCase ? "i" : "") + + (e.multiline ? "m" : "") + + (e.unicode ? "u" : "") + + (e.sticky ? "y" : ""), + l = 0, + u = new RegExp(e.source, t + "g"); + (n = h.call(u, r)) && + !( + l < (s = u.lastIndex) && + (a.push(r.slice(l, n.index)), + 1 < n.length && + n.index < r.length && + f.apply(a, n.slice(1)), + (i = n[0].length), + (l = s), + a.length >= o) + ); + + ) + u.lastIndex === n.index && u.lastIndex++; + return ( + l === r.length + ? (!i && u.test("")) || a.push("") + : a.push(r.slice(l)), + a.length > o ? a.slice(0, o) : a + ); + } + : "0".split(void 0, 0).length + ? function (e, t) { + return void 0 === e && 0 === t + ? [] + : p.call(this, e, t); + } + : p; + return [ + function (e, t) { + var r = d(this), + o = null == e ? void 0 : e[n]; + return void 0 !== o + ? o.call(e, r, t) + : y.call(String(r), e, t); + }, + function (e, t) { + var r = m(y, e, this, t, y !== p); + if (r.done) return r.value; + var r = g(e), + o = String(this), + e = v(r, RegExp), + n = r.unicode, + s = + (r.ignoreCase ? "i" : "") + + (r.multiline ? "m" : "") + + (r.unicode ? "u" : "") + + (S ? "y" : "g"), + i = new e(S ? r : "^(?:" + r.source + ")", s), + a = void 0 === t ? w : t >>> 0; + if (0 == a) return []; + if (0 === o.length) return null === _(i, o) ? [o] : []; + for (var l = 0, u = 0, c = []; u < o.length; ) { + i.lastIndex = S ? u : 0; + var d, + h = _(i, S ? o : o.slice(u)); + if ( + null === h || + (d = x(j(i.lastIndex + (S ? 0 : u)), o.length)) === l + ) + u = b(o, u, n); + else { + if ((c.push(o.slice(l, u)), c.length === a)) return c; + for (var f = 1; f <= h.length - 1; f++) + if ((c.push(h[f]), c.length === a)) return c; + u = l = d; + } + } + return c.push(o.slice(l)), c; + }, + ]; + }, + !S, + ); + }, + { + "../internals/advance-string-index": 8, + "../internals/an-object": 10, + "../internals/fails": 51, + "../internals/fix-regexp-well-known-symbol-logic": 52, + "../internals/is-regexp": 76, + "../internals/regexp-exec": 110, + "../internals/regexp-exec-abstract": 109, + "../internals/require-object-coercible": 113, + "../internals/species-constructor": 121, + "../internals/to-length": 136, + }, + ], + 199: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/object-get-own-property-descriptor").f, + s = e("../internals/to-length"), + i = e("../internals/not-a-regexp"), + a = e("../internals/require-object-coercible"), + l = e("../internals/correct-is-regexp-logic"), + e = e("../internals/is-pure"), + u = "".startsWith, + c = Math.min, + l = l("startsWith"); + o( + { + target: "String", + proto: !0, + forced: + !!( + e || + l || + !(o = n(String.prototype, "startsWith")) || + o.writable + ) && !l, + }, + { + startsWith: function (e) { + var t = String(a(this)), + r = + (i(e), + s( + c(1 < arguments.length ? arguments[1] : void 0, t.length), + )), + e = String(e); + return u ? u.call(t, e, r) : t.slice(r, r + e.length) === e; + }, + }, + ); + }, + { + "../internals/correct-is-regexp-logic": 34, + "../internals/export": 50, + "../internals/is-pure": 75, + "../internals/not-a-regexp": 87, + "../internals/object-get-own-property-descriptor": 93, + "../internals/require-object-coercible": 113, + "../internals/to-length": 136, + }, + ], + 200: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/create-html"); + o( + { + target: "String", + proto: !0, + forced: e("../internals/string-html-forced")("sub"), + }, + { + sub: function () { + return n(this, "sub", "", ""); + }, + }, + ); + }, + { + "../internals/create-html": 36, + "../internals/export": 50, + "../internals/string-html-forced": 122, + }, + ], + 201: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/export"), + n = e("../internals/string-trim").trim; + o( + { + target: "String", + proto: !0, + forced: e("../internals/string-trim-forced")("trim"), + }, + { + trim: function () { + return n(this); + }, + }, + ); + }, + { + "../internals/export": 50, + "../internals/string-trim": 129, + "../internals/string-trim-forced": 128, + }, + ], + 202: [ + function (e, t, r) { + "use strict"; + var o, + n, + s, + i, + a, + l = e("../internals/export"), + u = e("../internals/descriptors"), + c = e("../internals/global"), + d = e("../internals/has"), + h = e("../internals/is-object"), + f = e("../internals/object-define-property").f, + e = e("../internals/copy-constructor-properties"), + p = c.Symbol; + !u || + "function" != typeof p || + ("description" in p.prototype && void 0 === p().description) || + ((o = {}), + e( + (n = function () { + var e = + arguments.length < 1 || void 0 === arguments[0] + ? void 0 + : String(arguments[0]), + t = this instanceof n ? new p(e) : void 0 === e ? p() : p(e); + return "" === e && (o[t] = !0), t; + }), + p, + ), + ((c = n.prototype = p.prototype).constructor = n), + (s = c.toString), + (i = "Symbol(test)" == String(p("test"))), + (a = /^Symbol\((.*)\)[^)]+$/), + f(c, "description", { + configurable: !0, + get: function () { + var e = h(this) ? this.valueOf() : this, + t = s.call(e); + return d(o, e) + ? "" + : "" === (e = i ? t.slice(7, -1) : t.replace(a, "$1")) + ? void 0 + : e; + }, + }), + l({ global: !0, forced: !0 }, { Symbol: n })); + }, + { + "../internals/copy-constructor-properties": 33, + "../internals/descriptors": 43, + "../internals/export": 50, + "../internals/global": 59, + "../internals/has": 60, + "../internals/is-object": 74, + "../internals/object-define-property": 92, + }, + ], + 203: [ + function (e, t, r) { + e("../internals/define-well-known-symbol")("iterator"); + }, + { "../internals/define-well-known-symbol": 42 }, + ], + 204: [ + function (e, D, F) { + "use strict"; + function o(e, t) { + var r = (M[e] = f(w[_])); + return ( + ie(r, { type: j, tag: e, description: t }), + s || (r.description = t), + r + ); + } + function r(t, e) { + u(t); + var r = c(e), + e = q(r).concat(I(r)); + return ( + v(e, function (e) { + (s && !R.call(r, e)) || L(t, e, r[e]); + }), + t + ); + } + function t(e, t) { + var r, + e = c(e), + t = d(t, !0); + if (e !== x || !l(M, t) || l(E, t)) + return ( + !(r = le(e, t)) || + !l(M, t) || + (l(e, b) && e[b][t]) || + (r.enumerable = !0), + r + ); + } + function U(e) { + var e = ue(c(e)), + t = []; + return ( + v(e, function (e) { + l(M, e) || l(ee, e) || t.push(e); + }), + t + ); + } + var n = e("../internals/export"), + N = e("../internals/global"), + B = e("../internals/get-built-in"), + G = e("../internals/is-pure"), + s = e("../internals/descriptors"), + i = e("../internals/native-symbol"), + V = e("../internals/use-symbol-as-uid"), + a = e("../internals/fails"), + l = e("../internals/has"), + z = e("../internals/is-array"), + H = e("../internals/is-object"), + u = e("../internals/an-object"), + W = e("../internals/to-object"), + c = e("../internals/to-indexed-object"), + d = e("../internals/to-primitive"), + h = e("../internals/create-property-descriptor"), + f = e("../internals/object-create"), + q = e("../internals/object-keys"), + X = e("../internals/object-get-own-property-names"), + Y = e("../internals/object-get-own-property-names-external"), + p = e("../internals/object-get-own-property-symbols"), + Z = e("../internals/object-get-own-property-descriptor"), + Q = e("../internals/object-define-property"), + J = e("../internals/object-property-is-enumerable"), + K = e("../internals/create-non-enumerable-property"), + m = e("../internals/redefine"), + y = e("../internals/shared"), + $ = e("../internals/shared-key"), + ee = e("../internals/hidden-keys"), + te = e("../internals/uid"), + re = e("../internals/well-known-symbol"), + oe = e("../internals/well-known-symbol-wrapped"), + ne = e("../internals/define-well-known-symbol"), + se = e("../internals/set-to-string-tag"), + g = e("../internals/internal-state"), + v = e("../internals/array-iteration").forEach, + b = $("hidden"), + j = "Symbol", + _ = "prototype", + e = re("toPrimitive"), + ie = g.set, + ae = g.getterFor(j), + x = Object[_], + w = N.Symbol, + S = B("JSON", "stringify"), + le = Z.f, + T = Q.f, + ue = Y.f, + ce = J.f, + M = y("symbols"), + E = y("op-symbols"), + k = y("string-to-symbol-registry"), + C = y("symbol-to-string-registry"), + $ = y("wks"), + g = N.QObject, + O = !g || !g[_] || !g[_].findChild, + P = + s && + a(function () { + return ( + 7 != + f( + T({}, "a", { + get: function () { + return T(this, "a", { value: 7 }).a; + }, + }), + ).a + ); + }) + ? function (e, t, r) { + var o = le(x, t); + o && delete x[t], T(e, t, r), o && e !== x && T(x, t, o); + } + : T, + A = V + ? function (e) { + return "symbol" == typeof e; + } + : function (e) { + return Object(e) instanceof w; + }, + L = function (e, t, r) { + e === x && L(E, t, r), u(e); + t = d(t, !0); + return ( + u(r), + (l(M, t) + ? (r.enumerable + ? (l(e, b) && e[b][t] && (e[b][t] = !1), + (r = f(r, { enumerable: h(0, !1) }))) + : (l(e, b) || T(e, b, h(1, {})), (e[b][t] = !0)), + P) + : T)(e, t, r) + ); + }, + R = function (e) { + var e = d(e, !0), + t = ce.call(this, e); + return ( + !(this === x && l(M, e) && !l(E, e)) && + (!( + t || + !l(this, e) || + !l(M, e) || + (l(this, b) && this[b][e]) + ) || + t) + ); + }, + I = function (e) { + var t = e === x, + e = ue(t ? E : c(e)), + r = []; + return ( + v(e, function (e) { + !l(M, e) || (t && !l(x, e)) || r.push(M[e]); + }), + r + ); + }; + i || + (m( + (w = function () { + if (this instanceof w) + throw TypeError("Symbol is not a constructor"); + var e = + arguments.length && void 0 !== arguments[0] + ? String(arguments[0]) + : void 0, + t = te(e), + r = function (e) { + this === x && r.call(E, e), + l(this, b) && l(this[b], t) && (this[b][t] = !1), + P(this, t, h(1, e)); + }; + return s && O && P(x, t, { configurable: !0, set: r }), o(t, e); + })[_], + "toString", + function () { + return ae(this).tag; + }, + ), + m(w, "withoutSetter", function (e) { + return o(te(e), e); + }), + (J.f = R), + (Q.f = L), + (Z.f = t), + (X.f = Y.f = U), + (p.f = I), + (oe.f = function (e) { + return o(re(e), e); + }), + s && + (T(w[_], "description", { + configurable: !0, + get: function () { + return ae(this).description; + }, + }), + G || m(x, "propertyIsEnumerable", R, { unsafe: !0 }))), + n({ global: !0, wrap: !0, forced: !i, sham: !i }, { Symbol: w }), + v(q($), function (e) { + ne(e); + }), + n( + { target: j, stat: !0, forced: !i }, + { + for: function (e) { + var t, + e = String(e); + return l(k, e) + ? k[e] + : ((t = w(e)), (k[e] = t), (C[t] = e), t); + }, + keyFor: function (e) { + if (!A(e)) throw TypeError(e + " is not a symbol"); + if (l(C, e)) return C[e]; + }, + useSetter: function () { + O = !0; + }, + useSimple: function () { + O = !1; + }, + }, + ), + n( + { target: "Object", stat: !0, forced: !i, sham: !s }, + { + create: function (e, t) { + return void 0 === t ? f(e) : r(f(e), t); + }, + defineProperty: L, + defineProperties: r, + getOwnPropertyDescriptor: t, + }, + ), + n( + { target: "Object", stat: !0, forced: !i }, + { getOwnPropertyNames: U, getOwnPropertySymbols: I }, + ), + n( + { + target: "Object", + stat: !0, + forced: a(function () { + p.f(1); + }), + }, + { + getOwnPropertySymbols: function (e) { + return p.f(W(e)); + }, + }, + ), + S && + n( + { + target: "JSON", + stat: !0, + forced: + !i || + a(function () { + var e = w(); + return ( + "[null]" != S([e]) || + "{}" != S({ a: e }) || + "{}" != S(Object(e)) + ); + }), + }, + { + stringify: function (e, t, r) { + for (var o, n = [e], s = 1; s < arguments.length; ) + n.push(arguments[s++]); + if ((H((o = t)) || void 0 !== e) && !A(e)) + return ( + z(t) || + (t = function (e, t) { + if ( + ("function" == typeof o && + (t = o.call(this, e, t)), + !A(t)) + ) + return t; + }), + (n[1] = t), + S.apply(null, n) + ); + }, + }, + ), + w[_][e] || K(w[_], e, w[_].valueOf), + se(w, j), + (ee[b] = !0); + }, + { + "../internals/an-object": 10, + "../internals/array-iteration": 19, + "../internals/create-non-enumerable-property": 38, + "../internals/create-property-descriptor": 39, + "../internals/define-well-known-symbol": 42, + "../internals/descriptors": 43, + "../internals/export": 50, + "../internals/fails": 51, + "../internals/get-built-in": 56, + "../internals/global": 59, + "../internals/has": 60, + "../internals/hidden-keys": 61, + "../internals/internal-state": 70, + "../internals/is-array": 72, + "../internals/is-object": 74, + "../internals/is-pure": 75, + "../internals/native-symbol": 83, + "../internals/object-create": 90, + "../internals/object-define-property": 92, + "../internals/object-get-own-property-descriptor": 93, + "../internals/object-get-own-property-names": 95, + "../internals/object-get-own-property-names-external": 94, + "../internals/object-get-own-property-symbols": 96, + "../internals/object-keys": 99, + "../internals/object-property-is-enumerable": 100, + "../internals/redefine": 108, + "../internals/set-to-string-tag": 117, + "../internals/shared": 120, + "../internals/shared-key": 118, + "../internals/to-indexed-object": 134, + "../internals/to-object": 137, + "../internals/to-primitive": 140, + "../internals/uid": 145, + "../internals/use-symbol-as-uid": 146, + "../internals/well-known-symbol": 148, + "../internals/well-known-symbol-wrapped": 147, + }, + ], + 205: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-copy-within"), + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("copyWithin", function (e, t) { + return n.call( + s(this), + e, + t, + 2 < arguments.length ? arguments[2] : void 0, + ); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-copy-within": 14, + }, + ], + 206: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-iteration").every, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("every", function (e) { + return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + }, + ], + 207: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-fill"), + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("fill", function (e) { + return n.apply(s(this), arguments); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-fill": 15, + }, + ], + 208: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + s = e("../internals/array-iteration").filter, + i = e("../internals/species-constructor"), + a = o.aTypedArray, + l = o.aTypedArrayConstructor; + (0, o.exportTypedArrayMethod)("filter", function (e) { + for ( + var t = s( + a(this), + e, + 1 < arguments.length ? arguments[1] : void 0, + ), + e = i(this, this.constructor), + r = 0, + o = t.length, + n = new (l(e))(o); + r < o; + + ) + n[r] = t[r++]; + return n; + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + "../internals/species-constructor": 121, + }, + ], + 209: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-iteration").findIndex, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("findIndex", function (e) { + return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + }, + ], + 210: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-iteration").find, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("find", function (e) { + return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + }, + ], + 211: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Float32", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 212: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Float64", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 213: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-iteration").forEach, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("forEach", function (e) { + n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + }, + ], + 214: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-includes").includes, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("includes", function (e) { + return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-includes": 18, + }, + ], + 215: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-includes").indexOf, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("indexOf", function (e) { + return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-includes": 18, + }, + ], + 216: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Int16", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 217: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Int32", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 218: [ + function (e, t, r) { + "use strict"; + function o() { + return a.call(c(this)); + } + var n = e("../internals/global"), + s = e("../internals/array-buffer-view-core"), + i = e("../modules/es.array.iterator"), + e = e("../internals/well-known-symbol")("iterator"), + n = n.Uint8Array, + a = i.values, + l = i.keys, + u = i.entries, + c = s.aTypedArray, + i = s.exportTypedArrayMethod, + s = n && n.prototype[e], + n = !!s && ("values" == s.name || null == s.name); + i("entries", function () { + return u.call(c(this)); + }), + i("keys", function () { + return l.call(c(this)); + }), + i("values", o, !n), + i(e, o, !n); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/global": 59, + "../internals/well-known-symbol": 148, + "../modules/es.array.iterator": 161, + }, + ], + 219: [ + function (e, t, r) { + "use strict"; + var e = e("../internals/array-buffer-view-core"), + o = e.aTypedArray, + e = e.exportTypedArrayMethod, + n = [].join; + e("join", function (e) { + return n.apply(o(this), arguments); + }); + }, + { "../internals/array-buffer-view-core": 12 }, + ], + 220: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-last-index-of"), + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("lastIndexOf", function (e) { + return n.apply(s(this), arguments); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-last-index-of": 20, + }, + ], + 221: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-iteration").map, + s = e("../internals/species-constructor"), + i = o.aTypedArray, + a = o.aTypedArrayConstructor; + (0, o.exportTypedArrayMethod)("map", function (e) { + return n( + i(this), + e, + 1 < arguments.length ? arguments[1] : void 0, + function (e, t) { + return new (a(s(e, e.constructor)))(t); + }, + ); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + "../internals/species-constructor": 121, + }, + ], + 222: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-reduce").right, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("reduceRight", function (e) { + return n( + s(this), + e, + arguments.length, + 1 < arguments.length ? arguments[1] : void 0, + ); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-reduce": 24, + }, + ], + 223: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-reduce").left, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("reduce", function (e) { + return n( + s(this), + e, + arguments.length, + 1 < arguments.length ? arguments[1] : void 0, + ); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-reduce": 24, + }, + ], + 224: [ + function (e, t, r) { + "use strict"; + var e = e("../internals/array-buffer-view-core"), + n = e.aTypedArray, + e = e.exportTypedArrayMethod, + s = Math.floor; + e("reverse", function () { + for (var e, t = n(this).length, r = s(t / 2), o = 0; o < r; ) + (e = this[o]), (this[o++] = this[--t]), (this[t] = e); + return this; + }); + }, + { "../internals/array-buffer-view-core": 12 }, + ], + 225: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + i = e("../internals/to-length"), + a = e("../internals/to-offset"), + l = e("../internals/to-object"), + e = e("../internals/fails"), + u = o.aTypedArray; + (0, o.exportTypedArrayMethod)( + "set", + function (e) { + u(this); + var t = a(1 < arguments.length ? arguments[1] : void 0, 1), + r = this.length, + o = l(e), + n = i(o.length), + s = 0; + if (r < n + t) throw RangeError("Wrong length"); + for (; s < n; ) this[t + s] = o[s++]; + }, + e(function () { + new Int8Array(1).set({}); + }), + ); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/fails": 51, + "../internals/to-length": 136, + "../internals/to-object": 137, + "../internals/to-offset": 138, + }, + ], + 226: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + i = e("../internals/species-constructor"), + e = e("../internals/fails"), + a = o.aTypedArray, + l = o.aTypedArrayConstructor, + o = o.exportTypedArrayMethod, + u = [].slice; + o( + "slice", + function (e, t) { + for ( + var r = u.call(a(this), e, t), + e = i(this, this.constructor), + o = 0, + n = r.length, + s = new (l(e))(n); + o < n; + + ) + s[o] = r[o++]; + return s; + }, + e(function () { + new Int8Array(1).slice(); + }), + ); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/fails": 51, + "../internals/species-constructor": 121, + }, + ], + 227: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/array-iteration").some, + s = o.aTypedArray; + (0, o.exportTypedArrayMethod)("some", function (e) { + return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/array-iteration": 19, + }, + ], + 228: [ + function (e, t, r) { + "use strict"; + var e = e("../internals/array-buffer-view-core"), + o = e.aTypedArray, + e = e.exportTypedArrayMethod, + n = [].sort; + e("sort", function (e) { + return n.call(o(this), e); + }); + }, + { "../internals/array-buffer-view-core": 12 }, + ], + 229: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/array-buffer-view-core"), + n = e("../internals/to-length"), + s = e("../internals/to-absolute-index"), + i = e("../internals/species-constructor"), + a = o.aTypedArray; + (0, o.exportTypedArrayMethod)("subarray", function (e, t) { + var r = a(this), + o = r.length, + e = s(e, o); + return new (i(r, r.constructor))( + r.buffer, + r.byteOffset + e * r.BYTES_PER_ELEMENT, + n((void 0 === t ? o : s(t, o)) - e), + ); + }); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/species-constructor": 121, + "../internals/to-absolute-index": 132, + "../internals/to-length": 136, + }, + ], + 230: [ + function (e, t, r) { + "use strict"; + var o = e("../internals/global"), + n = e("../internals/array-buffer-view-core"), + e = e("../internals/fails"), + s = o.Int8Array, + i = n.aTypedArray, + o = n.exportTypedArrayMethod, + a = [].toLocaleString, + l = [].slice, + u = + !!s && + e(function () { + a.call(new s(1)); + }); + o( + "toLocaleString", + function () { + return a.apply(u ? l.call(i(this)) : i(this), arguments); + }, + e(function () { + return [1, 2].toLocaleString() != new s([1, 2]).toLocaleString(); + }) || + !e(function () { + s.prototype.toLocaleString.call([1, 2]); + }), + ); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/fails": 51, + "../internals/global": 59, + }, + ], + 231: [ + function (e, t, r) { + "use strict"; + var o = e( + "../internals/array-buffer-view-core", + ).exportTypedArrayMethod, + n = e("../internals/fails"), + e = e("../internals/global").Uint8Array, + e = (e && e.prototype) || {}, + s = [].toString, + i = [].join, + n = + (n(function () { + s.call({}); + }) && + (s = function () { + return i.call(this); + }), + e.toString != s); + o("toString", s, n); + }, + { + "../internals/array-buffer-view-core": 12, + "../internals/fails": 51, + "../internals/global": 59, + }, + ], + 232: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Uint16", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 233: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Uint32", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 234: [ + function (e, t, r) { + e("../internals/typed-array-constructor")("Uint8", function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 235: [ + function (e, t, r) { + e("../internals/typed-array-constructor")( + "Uint8", + function (o) { + return function (e, t, r) { + return o(this, e, t, r); + }; + }, + !0, + ); + }, + { "../internals/typed-array-constructor": 142 }, + ], + 236: [ + function (e, t, r) { + "use strict"; + function o(e) { + return function () { + return e(this, arguments.length ? arguments[0] : void 0); + }; + } + var n, + s, + i, + a, + l, + u = e("../internals/global"), + c = e("../internals/redefine-all"), + d = e("../internals/internal-metadata"), + h = e("../internals/collection"), + f = e("../internals/collection-weak"), + p = e("../internals/is-object"), + m = e("../internals/internal-state").enforce, + e = e("../internals/native-weak-map"), + u = !u.ActiveXObject && "ActiveXObject" in u, + y = Object.isExtensible, + t = (t.exports = h("WeakMap", o, f)); + e && + u && + ((n = f.getConstructor(o, "WeakMap", !0)), + (d.REQUIRED = !0), + (h = t.prototype), + (s = h.delete), + (i = h.has), + (a = h.get), + (l = h.set), + c(h, { + delete: function (e) { + var t; + return p(e) && !y(e) + ? ((t = m(this)).frozen || (t.frozen = new n()), + s.call(this, e) || t.frozen.delete(e)) + : s.call(this, e); + }, + has: function (e) { + var t; + return p(e) && !y(e) + ? ((t = m(this)).frozen || (t.frozen = new n()), + i.call(this, e) || t.frozen.has(e)) + : i.call(this, e); + }, + get: function (e) { + var t; + return !p(e) || + y(e) || + ((t = m(this)).frozen || (t.frozen = new n()), + i.call(this, e)) + ? a.call(this, e) + : t.frozen.get(e); + }, + set: function (e, t) { + var r; + return ( + !p(e) || + y(e) || + ((r = m(this)).frozen || (r.frozen = new n()), + i.call(this, e)) + ? l.call(this, e, t) + : r.frozen.set(e, t), + this + ); + }, + })); + }, + { + "../internals/collection": 32, + "../internals/collection-weak": 31, + "../internals/global": 59, + "../internals/internal-metadata": 69, + "../internals/internal-state": 70, + "../internals/is-object": 74, + "../internals/native-weak-map": 85, + "../internals/redefine-all": 107, + }, + ], + 237: [ + function (e, t, r) { + var o, + n = e("../internals/global"), + s = e("../internals/dom-iterables"), + i = e("../internals/array-for-each"), + a = e("../internals/create-non-enumerable-property"); + for (o in s) { + var l = n[o], + l = l && l.prototype; + if (l && l.forEach !== i) + try { + a(l, "forEach", i); + } catch (e) { + l.forEach = i; + } + } + }, + { + "../internals/array-for-each": 16, + "../internals/create-non-enumerable-property": 38, + "../internals/dom-iterables": 45, + "../internals/global": 59, + }, + ], + 238: [ + function (e, t, r) { + var o, + n = e("../internals/global"), + s = e("../internals/dom-iterables"), + i = e("../modules/es.array.iterator"), + a = e("../internals/create-non-enumerable-property"), + e = e("../internals/well-known-symbol"), + l = e("iterator"), + u = e("toStringTag"), + c = i.values; + for (o in s) { + var d = n[o], + h = d && d.prototype; + if (h) { + if (h[l] !== c) + try { + a(h, l, c); + } catch (e) { + h[l] = c; + } + if ((h[u] || a(h, u, o), s[o])) + for (var f in i) + if (h[f] !== i[f]) + try { + a(h, f, i[f]); + } catch (e) { + h[f] = i[f]; + } + } + } + }, + { + "../internals/create-non-enumerable-property": 38, + "../internals/dom-iterables": 45, + "../internals/global": 59, + "../internals/well-known-symbol": 148, + "../modules/es.array.iterator": 161, + }, + ], + 239: [ + function (e, t, D) { + "use strict"; + e("../modules/es.array.iterator"); + function n(t) { + try { + return decodeURIComponent(t); + } catch (e) { + return t; + } + } + function r(e) { + return B[e]; + } + function s(e) { + return encodeURIComponent(e).replace(N, r); + } + function c(e) { + (this.entries.length = 0), R(this.entries, e); + } + function u(e, t) { + if (e < t) throw TypeError("Not enough arguments"); + } + function d() { + y(this, d, k); + var e, + t, + r, + o, + n, + s, + i, + a, + l = 0 < arguments.length ? arguments[0] : void 0, + u = []; + if ( + (O(this, { + type: k, + entries: u, + updateURL: function () {}, + updateSearchParams: c, + }), + void 0 !== l) + ) + if (_(l)) + if ("function" == typeof (e = T(l))) + for (r = (t = e.call(l)).next; !(o = r.call(t)).done; ) { + if ( + (s = (n = (o = S(j(o.value))).next).call(o)).done || + (i = n.call(o)).done || + !n.call(o).done + ) + throw TypeError("Expected sequence with length 2"); + u.push({ key: s.value + "", value: i.value + "" }); + } + else + for (a in l) g(l, a) && u.push({ key: a, value: l[a] + "" }); + else + R( + u, + "string" == typeof l + ? "?" === l.charAt(0) + ? l.slice(1) + : l + : l + "", + ); + } + var o = e("../internals/export"), + i = e("../internals/get-built-in"), + a = e("../internals/native-url"), + l = e("../internals/redefine"), + h = e("../internals/redefine-all"), + f = e("../internals/set-to-string-tag"), + p = e("../internals/create-iterator-constructor"), + m = e("../internals/internal-state"), + y = e("../internals/an-instance"), + g = e("../internals/has"), + v = e("../internals/function-bind-context"), + b = e("../internals/classof"), + j = e("../internals/an-object"), + _ = e("../internals/is-object"), + x = e("../internals/object-create"), + w = e("../internals/create-property-descriptor"), + S = e("../internals/get-iterator"), + T = e("../internals/get-iterator-method"), + e = e("../internals/well-known-symbol"), + M = i("fetch"), + E = i("Headers"), + i = e("iterator"), + k = "URLSearchParams", + C = k + "Iterator", + O = m.set, + P = m.getterFor(k), + F = m.getterFor(C), + U = /\+/g, + A = Array(4), + L = function (e) { + var t, + r = e.replace(U, " "), + o = 4; + try { + return decodeURIComponent(r); + } catch (e) { + for (; o; ) + r = r.replace( + ((t = o--), + A[t - 1] || + (A[t - 1] = RegExp( + "((?:%[\\da-f]{2}){" + t + "})", + "gi", + ))), + n, + ); + return r; + } + }, + N = /[!'()~]|%20/g, + B = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+", + }, + R = function (e, t) { + if (t) + for (var r, o = t.split("&"), n = 0; n < o.length; ) + (r = o[n++]).length && + ((r = r.split("=")), + e.push({ key: L(r.shift()), value: L(r.join("=")) })); + }, + I = p( + function (e, t) { + O(this, { type: C, iterator: S(P(e).entries), kind: t }); + }, + "Iterator", + function () { + var e = F(this), + t = e.kind, + e = e.iterator.next(), + r = e.value; + return ( + e.done || + (e.value = + "keys" === t + ? r.key + : "values" === t + ? r.value + : [r.key, r.value]), + e + ); + }, + ), + e = d.prototype; + h( + e, + { + append: function (e, t) { + u(arguments.length, 2); + var r = P(this); + r.entries.push({ key: e + "", value: t + "" }), r.updateURL(); + }, + delete: function (e) { + u(arguments.length, 1); + for ( + var t = P(this), r = t.entries, o = e + "", n = 0; + n < r.length; + + ) + r[n].key === o ? r.splice(n, 1) : n++; + t.updateURL(); + }, + get: function (e) { + u(arguments.length, 1); + for ( + var t = P(this).entries, r = e + "", o = 0; + o < t.length; + o++ + ) + if (t[o].key === r) return t[o].value; + return null; + }, + getAll: function (e) { + u(arguments.length, 1); + for ( + var t = P(this).entries, r = e + "", o = [], n = 0; + n < t.length; + n++ + ) + t[n].key === r && o.push(t[n].value); + return o; + }, + has: function (e) { + u(arguments.length, 1); + for (var t = P(this).entries, r = e + "", o = 0; o < t.length; ) + if (t[o++].key === r) return !0; + return !1; + }, + set: function (e, t) { + u(arguments.length, 1); + for ( + var r, + o = P(this), + n = o.entries, + s = !1, + i = e + "", + a = t + "", + l = 0; + l < n.length; + l++ + ) + (r = n[l]).key === i && + (s ? n.splice(l--, 1) : ((s = !0), (r.value = a))); + s || n.push({ key: i, value: a }), o.updateURL(); + }, + sort: function () { + for ( + var e, + t, + r = P(this), + o = r.entries, + n = o.slice(), + s = (o.length = 0); + s < n.length; + s++ + ) { + for (e = n[s], t = 0; t < s; t++) + if (o[t].key > e.key) { + o.splice(t, 0, e); + break; + } + t === s && o.push(e); + } + r.updateURL(); + }, + forEach: function (e) { + for ( + var t, + r = P(this).entries, + o = v(e, 1 < arguments.length ? arguments[1] : void 0, 3), + n = 0; + n < r.length; + + ) + o((t = r[n++]).value, t.key, this); + }, + keys: function () { + return new I(this, "keys"); + }, + values: function () { + return new I(this, "values"); + }, + entries: function () { + return new I(this, "entries"); + }, + }, + { enumerable: !0 }, + ), + l(e, i, e.entries), + l( + e, + "toString", + function () { + for (var e, t = P(this).entries, r = [], o = 0; o < t.length; ) + (e = t[o++]), r.push(s(e.key) + "=" + s(e.value)); + return r.join("&"); + }, + { enumerable: !0 }, + ), + f(d, k), + o({ global: !0, forced: !a }, { URLSearchParams: d }), + a || + "function" != typeof M || + "function" != typeof E || + o( + { global: !0, enumerable: !0, forced: !0 }, + { + fetch: function (e) { + var t, + r, + o, + e = [e]; + return ( + 1 < arguments.length && + (_((t = arguments[1])) && + ((r = t.body), + b(r) === k && + ((o = t.headers ? new E(t.headers) : new E()).has( + "content-type", + ) || + o.set( + "content-type", + "application/x-www-form-urlencoded;charset=UTF-8", + ), + (t = x(t, { + body: w(0, String(r)), + headers: w(0, o), + })))), + e.push(t)), + M.apply(this, e) + ); + }, + }, + ), + (t.exports = { URLSearchParams: d, getState: P }); + }, + { + "../internals/an-instance": 9, + "../internals/an-object": 10, + "../internals/classof": 29, + "../internals/create-iterator-constructor": 37, + "../internals/create-property-descriptor": 39, + "../internals/export": 50, + "../internals/function-bind-context": 54, + "../internals/get-built-in": 56, + "../internals/get-iterator": 58, + "../internals/get-iterator-method": 57, + "../internals/has": 60, + "../internals/internal-state": 70, + "../internals/is-object": 74, + "../internals/native-url": 84, + "../internals/object-create": 90, + "../internals/redefine": 108, + "../internals/redefine-all": 107, + "../internals/set-to-string-tag": 117, + "../internals/well-known-symbol": 148, + "../modules/es.array.iterator": 161, + }, + ], + 240: [ + function (e, y, F) { + "use strict"; + e("../modules/es.string.iterator"); + function c(e) { + var t, r, o, n; + if ("number" == typeof e) { + for (t = [], r = 0; r < 4; r++) + t.unshift(e % 256), (e = Y(e / 256)); + return t.join("."); + } + if ("object" != typeof e) return e; + for (t = "", o = le(e), r = 0; r < 8; r++) + (n && 0 === e[r]) || + ((n = n && !1), + o === r + ? ((t += r ? ":" : "::"), (n = !0)) + : ((t += e[r].toString(16)), r < 7 && (t += ":"))); + return "[" + t + "]"; + } + function n(e) { + return !e.host || e.cannotBeABaseURL || "file" == e.scheme; + } + function a(e, t, r, o) { + var n, + s, + i, + a = r || me, + l = 0, + u = "", + c = !1, + d = !1, + h = !1; + for ( + r || + ((e.scheme = ""), + (e.username = ""), + (e.password = ""), + (e.host = null), + (e.port = null), + (e.path = []), + (e.query = null), + (e.fragment = null), + (e.cannotBeABaseURL = !1), + (t = t.replace(ie, ""))), + t = t.replace(ae, ""), + n = b(t); + l <= n.length; + + ) { + switch (((s = n[l]), a)) { + case me: + if (!s || !K.test(s)) { + if (r) return j; + a = ge; + continue; + } + (u += s.toLowerCase()), (a = ye); + break; + case ye: + if (s && ($.test(s) || "+" == s || "-" == s || "." == s)) + u += s.toLowerCase(); + else { + if (":" != s) { + if (r) return j; + (u = ""), (a = ge), (l = 0); + continue; + } + if ( + r && + (k(e) != v(E, u) || + ("file" == u && (C(e) || null !== e.port)) || + ("file" == e.scheme && !e.host)) + ) + return; + if (((e.scheme = u), r)) + return void ( + k(e) && + E[e.scheme] == e.port && + (e.port = null) + ); + (u = ""), + "file" == e.scheme + ? (a = Me) + : k(e) && o && o.scheme == e.scheme + ? (a = ve) + : k(e) + ? (a = xe) + : "/" == n[l + 1] + ? ((a = be), l++) + : ((e.cannotBeABaseURL = !0), + e.path.push(""), + (a = Ce)); + } + break; + case ge: + if (!o || (o.cannotBeABaseURL && "#" != s)) return j; + if (o.cannotBeABaseURL && "#" == s) { + (e.scheme = o.scheme), + (e.path = o.path.slice()), + (e.query = o.query), + (e.fragment = ""), + (e.cannotBeABaseURL = !0), + (a = D); + break; + } + a = "file" == o.scheme ? Me : je; + continue; + case ve: + if ("/" != s || "/" != n[l + 1]) { + a = je; + continue; + } + (a = P), l++; + break; + case be: + if ("/" == s) { + a = A; + break; + } + a = R; + continue; + case je: + if (((e.scheme = o.scheme), s == g)) + (e.username = o.username), + (e.password = o.password), + (e.host = o.host), + (e.port = o.port), + (e.path = o.path.slice()), + (e.query = o.query); + else if ("/" == s || ("\\" == s && k(e))) a = _e; + else if ("?" == s) + (e.username = o.username), + (e.password = o.password), + (e.host = o.host), + (e.port = o.port), + (e.path = o.path.slice()), + (e.query = ""), + (a = I); + else { + if ("#" != s) { + (e.username = o.username), + (e.password = o.password), + (e.host = o.host), + (e.port = o.port), + (e.path = o.path.slice()), + e.path.pop(), + (a = R); + continue; + } + (e.username = o.username), + (e.password = o.password), + (e.host = o.host), + (e.port = o.port), + (e.path = o.path.slice()), + (e.query = o.query), + (e.fragment = ""), + (a = D); + } + break; + case _e: + if (!k(e) || ("/" != s && "\\" != s)) { + if ("/" != s) { + (e.username = o.username), + (e.password = o.password), + (e.host = o.host), + (e.port = o.port), + (a = R); + continue; + } + a = A; + } else a = P; + break; + case xe: + if (((a = P), "/" != s || "/" != u.charAt(l + 1))) continue; + l++; + break; + case P: + if ("/" == s || "\\" == s) break; + a = A; + continue; + case A: + if ("@" == s) { + c && (u = "%40" + u); + for (var c = !0, f = b(u), p = 0; p < f.length; p++) { + var m = f[p]; + ":" != m || h + ? ((m = M(m, T)), + h ? (e.password += m) : (e.username += m)) + : (h = !0); + } + u = ""; + } else if ( + s == g || + "/" == s || + "?" == s || + "#" == s || + ("\\" == s && k(e)) + ) { + if (c && "" == u) return Q; + (l -= b(u).length + 1), (u = ""), (a = we); + } else u += s; + break; + case we: + case Se: + if (r && "file" == e.scheme) { + a = ke; + continue; + } + if (":" != s || d) { + if ( + s == g || + "/" == s || + "?" == s || + "#" == s || + ("\\" == s && k(e)) + ) { + if (k(e) && "" == u) return _; + if (r && "" == u && (C(e) || null !== e.port)) return; + if ((i = w(e, u))) return i; + if (((u = ""), (a = L), r)) return; + continue; + } + "[" == s ? (d = !0) : "]" == s && (d = !1), (u += s); + } else { + if ("" == u) return _; + if ((i = w(e, u))) return i; + if (((u = ""), (a = Te), r == Se)) return; + } + break; + case Te: + if (!x.test(s)) { + if ( + s == g || + "/" == s || + "?" == s || + "#" == s || + ("\\" == s && k(e)) || + r + ) { + if ("" != u) { + var y = parseInt(u, 10); + if (65535 < y) return J; + (e.port = k(e) && y === E[e.scheme] ? null : y), + (u = ""); + } + if (r) return; + a = L; + continue; + } + return J; + } + u += s; + break; + case Me: + if (((e.scheme = "file"), "/" == s || "\\" == s)) a = Ee; + else { + if (!o || "file" != o.scheme) { + a = R; + continue; + } + if (s == g) + (e.host = o.host), + (e.path = o.path.slice()), + (e.query = o.query); + else if ("?" == s) + (e.host = o.host), + (e.path = o.path.slice()), + (e.query = ""), + (a = I); + else { + if ("#" != s) { + de(n.slice(l).join("")) || + ((e.host = o.host), (e.path = o.path.slice()), he(e)), + (a = R); + continue; + } + (e.host = o.host), + (e.path = o.path.slice()), + (e.query = o.query), + (e.fragment = ""), + (a = D); + } + } + break; + case Ee: + if ("/" == s || "\\" == s) { + a = ke; + break; + } + o && + "file" == o.scheme && + !de(n.slice(l).join("")) && + (O(o.path[0], !0) + ? e.path.push(o.path[0]) + : (e.host = o.host)), + (a = R); + continue; + case ke: + if (s == g || "/" == s || "\\" == s || "?" == s || "#" == s) { + if (!r && O(u)) a = R; + else { + if ("" == u) { + if (((e.host = ""), r)) return; + } else { + if ((i = w(e, u))) return i; + if (("localhost" == e.host && (e.host = ""), r)) return; + u = ""; + } + a = L; + } + continue; + } + u += s; + break; + case L: + if (k(e)) { + if (((a = R), "/" != s && "\\" != s)) continue; + } else if (r || "?" != s) + if (r || "#" != s) { + if (s != g && ((a = R), "/" != s)) continue; + } else (e.fragment = ""), (a = D); + else (e.query = ""), (a = I); + break; + case R: + if ( + s == g || + "/" == s || + ("\\" == s && k(e)) || + (!r && ("?" == s || "#" == s)) + ) { + if ( + (pe(u) + ? (he(e), + "/" == s || ("\\" == s && k(e)) || e.path.push("")) + : fe(u) + ? "/" == s || ("\\" == s && k(e)) || e.path.push("") + : ("file" == e.scheme && + !e.path.length && + O(u) && + (e.host && (e.host = ""), + (u = u.charAt(0) + ":")), + e.path.push(u)), + (u = ""), + "file" == e.scheme && (s == g || "?" == s || "#" == s)) + ) + for (; 1 < e.path.length && "" === e.path[0]; ) + e.path.shift(); + "?" == s + ? ((e.query = ""), (a = I)) + : "#" == s && ((e.fragment = ""), (a = D)); + } else u += M(s, ce); + break; + case Ce: + "?" == s + ? ((e.query = ""), (a = I)) + : "#" == s + ? ((e.fragment = ""), (a = D)) + : s != g && (e.path[0] += M(s, S)); + break; + case I: + r || "#" != s + ? s != g && + ("'" == s && k(e) + ? (e.query += "%27") + : (e.query += "#" == s ? "%23" : M(s, S))) + : ((e.fragment = ""), (a = D)); + break; + case D: + s != g && (e.fragment += M(s, ue)); + } + l++; + } + } + function l(e) { + var t, + r, + o = G(this, l, "URL"), + n = 1 < arguments.length ? arguments[1] : void 0, + e = String(e), + s = X(o, { type: "URL" }); + if (void 0 !== n) + if (n instanceof l) t = p(n); + else if ((r = a((t = {}), String(n)))) throw TypeError(r); + if ((r = a(s, e, null, t))) throw TypeError(r); + var i = (s.searchParams = new q()); + (n = f(i)).updateSearchParams(s.query), + (n.updateURL = function () { + s.query = String(i) || null; + }), + u || + ((o.href = m.call(o)), + (o.origin = Oe.call(o)), + (o.protocol = Pe.call(o)), + (o.username = Ae.call(o)), + (o.password = Le.call(o)), + (o.host = Re.call(o)), + (o.hostname = Ie.call(o)), + (o.port = De.call(o)), + (o.pathname = Fe.call(o)), + (o.search = Ue.call(o)), + (o.searchParams = Ne.call(o)), + (o.hash = Be.call(o))); + } + function t(e, t) { + return { get: e, set: t, configurable: !0, enumerable: !0 }; + } + var g, + r, + o, + U = e("../internals/export"), + u = e("../internals/descriptors"), + N = e("../internals/native-url"), + s = e("../internals/global"), + B = e("../internals/object-define-properties"), + i = e("../internals/redefine"), + G = e("../internals/an-instance"), + v = e("../internals/has"), + d = e("../internals/object-assign"), + b = e("../internals/array-from"), + V = e("../internals/string-multibyte").codeAt, + z = e("../internals/string-punycode-to-ascii"), + H = e("../internals/set-to-string-tag"), + W = e("../modules/web.url-search-params"), + e = e("../internals/internal-state"), + h = s.URL, + q = W.URLSearchParams, + f = W.getState, + X = e.set, + p = e.getterFor("URL"), + Y = Math.floor, + Z = Math.pow, + Q = "Invalid authority", + j = "Invalid scheme", + _ = "Invalid host", + J = "Invalid port", + K = /[A-Za-z]/, + $ = /[\d+-.A-Za-z]/, + x = /\d/, + ee = /^(0x|0X)/, + te = /^[0-7]+$/, + re = /^\d+$/, + oe = /^[\dA-Fa-f]+$/, + ne = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/, + se = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/, + ie = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g, + ae = /[\u0009\u000A\u000D]/g, + w = function (e, t) { + var r, o, n; + if ("[" == t.charAt(0)) + return "]" == t.charAt(t.length - 1) && + (r = (function (e) { + var t = [0, 0, 0, 0, 0, 0, 0, 0], + r = 0, + o = null, + n = 0, + s, + i, + a, + l, + u, + c, + d, + h = function () { + return e.charAt(n); + }; + if (h() == ":") { + if (e.charAt(1) != ":") return; + n += 2; + r++; + o = r; + } + while (h()) { + if (r == 8) return; + if (h() == ":") { + if (o !== null) return; + n++; + r++; + o = r; + continue; + } + s = i = 0; + while (i < 4 && oe.test(h())) { + s = s * 16 + parseInt(h(), 16); + n++; + i++; + } + if (h() == ".") { + if (i == 0) return; + n -= i; + if (r > 6) return; + a = 0; + while (h()) { + l = null; + if (a > 0) + if (h() == "." && a < 4) n++; + else return; + if (!x.test(h())) return; + while (x.test(h())) { + u = parseInt(h(), 10); + if (l === null) l = u; + else if (l == 0) return; + else l = l * 10 + u; + if (l > 255) return; + n++; + } + t[r] = t[r] * 256 + l; + a++; + if (a == 2 || a == 4) r++; + } + if (a != 4) return; + break; + } else if (h() == ":") { + n++; + if (!h()) return; + } else if (h()) return; + t[r++] = s; + } + if (o !== null) { + c = r - o; + r = 7; + while (r != 0 && c > 0) { + d = t[r]; + t[r--] = t[o + c - 1]; + t[o + --c] = d; + } + } else if (r != 8) return; + return t; + })(t.slice(1, -1))) + ? void (e.host = r) + : _; + if (k(e)) + return ( + (t = z(t)), + ne.test(t) || + null === + (r = (function (e) { + var t = e.split("."), + r, + o, + n, + s, + i, + a, + l; + if (t.length && t[t.length - 1] == "") t.pop(); + if ((r = t.length) > 4) return e; + for (o = [], n = 0; n < r; n++) { + s = t[n]; + if (s == "") return e; + i = 10; + if (s.length > 1 && s.charAt(0) == "0") { + i = ee.test(s) ? 16 : 8; + s = s.slice(i == 8 ? 1 : 2); + } + if (s === "") a = 0; + else { + if (!(i == 10 ? re : i == 8 ? te : oe).test(s)) + return e; + a = parseInt(s, i); + } + o.push(a); + } + for (n = 0; n < r; n++) { + a = o[n]; + if (n == r - 1) { + if (a >= Z(256, 5 - r)) return null; + } else if (a > 255) return null; + } + for (l = o.pop(), n = 0; n < o.length; n++) + l += o[n] * Z(256, 3 - n); + return l; + })(t)) + ? _ + : void (e.host = r) + ); + if (se.test(t)) return _; + for (r = "", o = b(t), n = 0; n < o.length; n++) r += M(o[n], S); + e.host = r; + }, + le = function (e) { + for (var t = null, r = 1, o = null, n = 0, s = 0; s < 8; s++) + 0 !== e[s] + ? (r < n && ((t = o), (r = n)), (o = null), (n = 0)) + : (null === o && (o = s), ++n); + return r < n && ((t = o), (r = n)), t; + }, + S = {}, + ue = d({}, S, { " ": 1, '"': 1, "<": 1, ">": 1, "`": 1 }), + ce = d({}, ue, { "#": 1, "?": 1, "{": 1, "}": 1 }), + T = d({}, ce, { + "/": 1, + ":": 1, + ";": 1, + "=": 1, + "@": 1, + "[": 1, + "\\": 1, + "]": 1, + "^": 1, + "|": 1, + }), + M = function (e, t) { + var r = V(e, 0); + return 32 < r && r < 127 && !v(t, e) ? e : encodeURIComponent(e); + }, + E = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }, + k = function (e) { + return v(E, e.scheme); + }, + C = function (e) { + return "" != e.username || "" != e.password; + }, + O = function (e, t) { + return ( + 2 == e.length && + K.test(e.charAt(0)) && + (":" == (e = e.charAt(1)) || (!t && "|" == e)) + ); + }, + de = function (e) { + return ( + 1 < e.length && + O(e.slice(0, 2)) && + (2 == e.length || + "/" === (e = e.charAt(2)) || + "\\" === e || + "?" === e || + "#" === e) + ); + }, + he = function (e) { + var t = e.path, + r = t.length; + !r || ("file" == e.scheme && 1 == r && O(t[0], !0)) || t.pop(); + }, + fe = function (e) { + return "." === e || "%2e" === e.toLowerCase(); + }, + pe = function (e) { + return ( + ".." === (e = e.toLowerCase()) || + "%2e." === e || + ".%2e" === e || + "%2e%2e" === e + ); + }, + me = {}, + ye = {}, + ge = {}, + ve = {}, + be = {}, + je = {}, + _e = {}, + xe = {}, + P = {}, + A = {}, + we = {}, + Se = {}, + Te = {}, + Me = {}, + Ee = {}, + ke = {}, + L = {}, + R = {}, + Ce = {}, + I = {}, + D = {}, + s = l.prototype, + m = function () { + var e = p(this), + t = e.scheme, + r = e.username, + o = e.password, + n = e.host, + s = e.port, + i = e.path, + a = e.query, + l = e.fragment, + u = t + ":"; + return ( + null !== n + ? ((u += "//"), + C(e) && (u += r + (o ? ":" + o : "") + "@"), + (u += c(n)), + null !== s && (u += ":" + s)) + : "file" == t && (u += "//"), + (u += e.cannotBeABaseURL + ? i[0] + : i.length + ? "/" + i.join("/") + : ""), + null !== a && (u += "?" + a), + null !== l && (u += "#" + l), + u + ); + }, + Oe = function () { + var e = p(this), + t = e.scheme, + r = e.port; + if ("blob" == t) + try { + return new URL(t.path[0]).origin; + } catch (e) { + return "null"; + } + return "file" != t && k(e) + ? t + "://" + c(e.host) + (null !== r ? ":" + r : "") + : "null"; + }, + Pe = function () { + return p(this).scheme + ":"; + }, + Ae = function () { + return p(this).username; + }, + Le = function () { + return p(this).password; + }, + Re = function () { + var e = p(this), + t = e.host, + e = e.port; + return null === t ? "" : null === e ? c(t) : c(t) + ":" + e; + }, + Ie = function () { + var e = p(this).host; + return null === e ? "" : c(e); + }, + De = function () { + var e = p(this).port; + return null === e ? "" : String(e); + }, + Fe = function () { + var e = p(this), + t = e.path; + return e.cannotBeABaseURL + ? t[0] + : t.length + ? "/" + t.join("/") + : ""; + }, + Ue = function () { + var e = p(this).query; + return e ? "?" + e : ""; + }, + Ne = function () { + return p(this).searchParams; + }, + Be = function () { + var e = p(this).fragment; + return e ? "#" + e : ""; + }; + u && + B(s, { + href: t(m, function (e) { + var t = p(this), + e = String(e), + e = a(t, e); + if (e) throw TypeError(e); + f(t.searchParams).updateSearchParams(t.query); + }), + origin: t(Oe), + protocol: t(Pe, function (e) { + var t = p(this); + a(t, String(e) + ":", me); + }), + username: t(Ae, function (e) { + var t = p(this), + r = b(String(e)); + if (!n(t)) { + t.username = ""; + for (var o = 0; o < r.length; o++) t.username += M(r[o], T); + } + }), + password: t(Le, function (e) { + var t = p(this), + r = b(String(e)); + if (!n(t)) { + t.password = ""; + for (var o = 0; o < r.length; o++) t.password += M(r[o], T); + } + }), + host: t(Re, function (e) { + var t = p(this); + t.cannotBeABaseURL || a(t, String(e), we); + }), + hostname: t(Ie, function (e) { + var t = p(this); + t.cannotBeABaseURL || a(t, String(e), Se); + }), + port: t(De, function (e) { + var t = p(this); + n(t) || ("" == (e = String(e)) ? (t.port = null) : a(t, e, Te)); + }), + pathname: t(Fe, function (e) { + var t = p(this); + t.cannotBeABaseURL || ((t.path = []), a(t, e + "", L)); + }), + search: t(Ue, function (e) { + var t = p(this); + "" == (e = String(e)) + ? (t.query = null) + : ("?" == e.charAt(0) && (e = e.slice(1)), + (t.query = ""), + a(t, e, I)), + f(t.searchParams).updateSearchParams(t.query); + }), + searchParams: t(Ne), + hash: t(Be, function (e) { + var t = p(this); + "" == (e = String(e)) + ? (t.fragment = null) + : ("#" == e.charAt(0) && (e = e.slice(1)), + (t.fragment = ""), + a(t, e, D)); + }), + }), + i( + s, + "toJSON", + function () { + return m.call(this); + }, + { enumerable: !0 }, + ), + i( + s, + "toString", + function () { + return m.call(this); + }, + { enumerable: !0 }, + ), + h && + ((r = h.createObjectURL), + (o = h.revokeObjectURL), + r && + i(l, "createObjectURL", function (e) { + return r.apply(h, arguments); + }), + o && + i(l, "revokeObjectURL", function (e) { + return o.apply(h, arguments); + })), + H(l, "URL"), + U({ global: !0, forced: !N, sham: !u }, { URL: l }); + }, + { + "../internals/an-instance": 9, + "../internals/array-from": 17, + "../internals/descriptors": 43, + "../internals/export": 50, + "../internals/global": 59, + "../internals/has": 60, + "../internals/internal-state": 70, + "../internals/native-url": 84, + "../internals/object-assign": 89, + "../internals/object-define-properties": 91, + "../internals/redefine": 108, + "../internals/set-to-string-tag": 117, + "../internals/string-multibyte": 123, + "../internals/string-punycode-to-ascii": 126, + "../modules/es.string.iterator": 192, + "../modules/web.url-search-params": 239, + }, + ], + 241: [ + function (e, t, r) { + "use strict"; + t.exports = e("./").polyfill(); + }, + { "./": 242 }, + ], + 242: [ + function (V, r, o) { + !function (B, G) { + var e, t; + (e = this), + (t = function () { + "use strict"; + function l(e) { + return "function" == typeof e; + } + var r = + Array.isArray || + function (e) { + return ( + "[object Array]" === Object.prototype.toString.call(e) + ); + }, + o = 0, + t = void 0, + n = void 0, + i = function (e, t) { + (d[o] = e), + (d[o + 1] = t), + 2 === (o += 2) && (n ? n(h) : D()); + }; + var e = "undefined" != typeof window ? window : void 0, + s = e || {}, + s = s.MutationObserver || s.WebKitMutationObserver, + a = + "undefined" == typeof self && + void 0 !== B && + "[object process]" === {}.toString.call(B), + 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 < o; e += 2) + (0, d[e])(d[e + 1]), (d[e] = void 0), (d[e + 1] = void 0); + o = 0; + } + function f() { + try { + var e = Function("return this")().require("vertx"); + return void 0 !== (t = e.runOnLoop || e.runOnContext) + ? function () { + t(h); + } + : c(); + } catch (e) { + return c(); + } + } + var p, + m, + y, + D = void 0; + function g(e, t) { + var r, + o = this, + n = new this.constructor(j), + s = (void 0 === n[b] && A(n), o._state); + return ( + s + ? ((r = arguments[s - 1]), + i(function () { + return O(s, n, r, o._result); + })) + : k(o, n, e, t), + n + ); + } + function v(e) { + var t; + return e && "object" == typeof e && e.constructor === this + ? e + : (T((t = new this(j)), e), t); + } + var D = a + ? function () { + return B.nextTick(h); + } + : s + ? ((m = 0), + (a = new s(h)), + (y = document.createTextNode("")), + a.observe(y, { characterData: !0 }), + function () { + y.data = m = ++m % 2; + }) + : u + ? (((p = new MessageChannel()).port1.onmessage = h), + function () { + return p.port2.postMessage(0); + }) + : (void 0 === e && "function" == typeof V ? f : c)(), + b = Math.random().toString(36).substring(2); + function j() {} + var _ = void 0, + x = 1, + w = 2; + function F(e, o, n) { + i(function (t) { + var r = !1, + e = (function (e, t, r, o) { + try { + e.call(t, r, o); + } catch (e) { + return e; + } + })( + n, + o, + function (e) { + r || ((r = !0), (o !== e ? T : M)(t, e)); + }, + function (e) { + r || ((r = !0), E(t, e)); + }, + t._label, + ); + !r && e && ((r = !0), E(t, e)); + }, e); + } + function S(e, t, r) { + var o, n; + t.constructor === e.constructor && + r === g && + t.constructor.resolve === v + ? ((o = e), + (n = t)._state === x + ? M(o, n._result) + : n._state === w + ? E(o, n._result) + : k( + n, + void 0, + function (e) { + return T(o, e); + }, + function (e) { + return E(o, e); + }, + )) + : void 0 !== r && l(r) + ? F(e, t, r) + : M(e, t); + } + function T(t, e) { + if (t === e) + E( + t, + new TypeError("You cannot resolve a promise with itself"), + ); + else if ( + ((r = typeof e), + null === e || ("object" != r && "function" != r)) + ) + M(t, e); + else { + r = void 0; + try { + r = e.then; + } catch (e) { + return void E(t, e); + } + S(t, e, r); + } + var r; + } + function U(e) { + e._onerror && e._onerror(e._result), C(e); + } + function M(e, t) { + e._state === _ && + ((e._result = t), + (e._state = x), + 0 !== e._subscribers.length && i(C, e)); + } + function E(e, t) { + e._state === _ && ((e._state = w), (e._result = t), i(U, e)); + } + function k(e, t, r, o) { + var n = e._subscribers, + s = n.length; + (e._onerror = null), + (n[s] = t), + (n[s + x] = r), + (n[s + w] = o), + 0 === s && e._state && i(C, e); + } + function C(e) { + var t = e._subscribers, + r = e._state; + if (0 !== t.length) { + for ( + var o, n = void 0, s = e._result, i = 0; + i < t.length; + i += 3 + ) + (o = t[i]), (n = t[i + r]), o ? O(r, o, n, s) : n(s); + e._subscribers.length = 0; + } + } + function O(e, t, r, o) { + var n = l(r), + s = void 0, + i = void 0, + a = !0; + if (n) { + try { + s = r(o); + } catch (e) { + (a = !1), (i = e); + } + if (t === s) + return void E( + t, + new TypeError( + "A promises callback cannot return that same promise.", + ), + ); + } else s = o; + t._state === _ && + (n && a + ? T(t, s) + : !1 === a + ? E(t, i) + : e === x + ? M(t, s) + : e === w && E(t, s)); + } + var P = 0; + function A(e) { + (e[b] = P++), + (e._state = void 0), + (e._result = void 0), + (e._subscribers = []); + } + (L.prototype._enumerate = function (e) { + for (var t = 0; this._state === _ && t < e.length; t++) + this._eachEntry(e[t], t); + }), + (L.prototype._eachEntry = function (t, e) { + var r = this._instanceConstructor, + o = r.resolve; + if (o === v) { + var n, + s = void 0, + i = void 0, + a = !1; + try { + s = t.then; + } catch (e) { + (a = !0), (i = e); + } + s === g && t._state !== _ + ? this._settledAt(t._state, e, t._result) + : "function" != typeof s + ? (this._remaining--, (this._result[e] = t)) + : r === R + ? ((n = new r(j)), + a ? E(n, i) : S(n, t, s), + this._willSettleAt(n, e)) + : this._willSettleAt( + new r(function (e) { + return e(t); + }), + e, + ); + } else this._willSettleAt(o(t), e); + }), + (L.prototype._settledAt = function (e, t, r) { + var o = this.promise; + o._state === _ && + (this._remaining--, + e === w ? E(o, r) : (this._result[t] = r)), + 0 === this._remaining && M(o, this._result); + }), + (L.prototype._willSettleAt = function (e, t) { + var r = this; + k( + e, + void 0, + function (e) { + return r._settledAt(x, t, e); + }, + function (e) { + return r._settledAt(w, t, e); + }, + ); + }); + var N = L; + function L(e, t) { + (this._instanceConstructor = e), + (this.promise = new e(j)), + this.promise[b] || A(this.promise), + r(t) + ? ((this.length = t.length), + (this._remaining = t.length), + (this._result = new Array(this.length)), + (0 !== this.length && + ((this.length = this.length || 0), + this._enumerate(t), + 0 !== this._remaining)) || + M(this.promise, this._result)) + : E( + this.promise, + new Error("Array Methods must be provided an Array"), + ); + } + (I.prototype.catch = function (e) { + return this.then(null, e); + }), + (I.prototype.finally = function (t) { + var r = this.constructor; + return l(t) + ? this.then( + function (e) { + return r.resolve(t()).then(function () { + return e; + }); + }, + function (e) { + return r.resolve(t()).then(function () { + throw e; + }); + }, + ) + : this.then(t, t); + }); + var R = I; + function I(e) { + if ( + ((this[b] = P++), + (this._result = this._state = void 0), + (this._subscribers = []), + j !== e) + ) { + if ("function" != typeof e) + throw new TypeError( + "You must pass a resolver function as the first argument to the promise constructor", + ); + if (!(this instanceof I)) + throw new TypeError( + "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.", + ); + var t = this; + try { + e( + function (e) { + T(t, e); + }, + function (e) { + E(t, e); + }, + ); + } catch (e) { + E(t, e); + } + } + } + return ( + (R.prototype.then = g), + (R.all = function (e) { + return new N(this, e).promise; + }), + (R.race = function (n) { + var s = this; + return r(n) + ? new s(function (e, t) { + for (var r = n.length, o = 0; o < r; o++) + s.resolve(n[o]).then(e, t); + }) + : new s(function (e, t) { + return t( + new TypeError("You must pass an array to race."), + ); + }); + }), + (R.resolve = v), + (R.reject = function (e) { + var t = new this(j); + return E(t, e), t; + }), + (R._setScheduler = function (e) { + n = e; + }), + (R._setAsap = function (e) { + i = e; + }), + (R._asap = i), + (R.polyfill = function () { + var e = void 0; + if (void 0 !== G) e = G; + else if ("undefined" != typeof self) e = self; + else + try { + e = Function("return this")(); + } catch (e) { + throw new Error( + "polyfill failed because global object is unavailable in this environment", + ); + } + var t = e.Promise; + if (t) { + var r = null; + try { + r = Object.prototype.toString.call(t.resolve()); + } catch (e) {} + if ("[object Promise]" === r && !t.cast) return; + } + e.Promise = R; + }), + (R.Promise = R) + ); + }), + "object" == typeof o && void 0 !== r + ? (r.exports = t()) + : "function" == typeof s && s.amd + ? s(t) + : (e.ES6Promise = t()); + }.call( + this, + V("_process"), + "undefined" != typeof global + ? global + : "undefined" != typeof self + ? self + : "undefined" != typeof window + ? window + : {}, + ); + }, + { _process: 251 }, + ], + 243: [ + function (e, t, r) { + var o, n; + (o = this), + (n = function (e, t) { + "use strict"; + var r = 5e3, + o = "callback"; + function d(t) { + try { + delete window[t]; + } catch (e) { + window[t] = void 0; + } + } + function h(e) { + e = document.getElementById(e); + e && document.getElementsByTagName("head")[0].removeChild(e); + } + t.exports = function (s) { + var i = + arguments.length <= 1 || void 0 === arguments[1] + ? {} + : arguments[1], + a = s, + l = i.timeout || r, + u = i.jsonpCallback || o, + c = void 0; + return new Promise(function (t, e) { + var r = + i.jsonpCallbackFunction || + "jsonp_" + + Date.now() + + "_" + + Math.ceil(1e5 * Math.random()), + o = u + "_" + r, + n = + ((window[r] = function (e) { + t({ + ok: !0, + json: function () { + return Promise.resolve(e); + }, + }), + c && clearTimeout(c), + h(o), + d(r); + }), + (a += -1 === a.indexOf("?") ? "?" : "&"), + document.createElement("script")); + n.setAttribute("src", "" + a + u + "=" + r), + i.charset && n.setAttribute("charset", i.charset), + (n.id = o), + document.getElementsByTagName("head")[0].appendChild(n), + (c = setTimeout(function () { + e(new Error("JSONP request to " + s + " timed out")), + d(r), + h(o), + (window[r] = function () { + d(r); + }); + }, l)), + (n.onerror = function () { + e(new Error("JSONP request to " + s + " failed")), + d(r), + h(o), + c && clearTimeout(c); + }); + }); + }; + }), + "function" == typeof s && s.amd + ? s(["exports", "module"], n) + : void 0 !== r && void 0 !== t + ? n(0, t) + : (n((n = { exports: {} }), n), (o.fetchJsonp = n.exports)); + }, + {}, + ], + 244: [ + function (e, t, r) { + var o = (function (a) { + "use strict"; + var l, u, c, d, h, f, t, p, m, o, e; + if ( + !( + void 0 === a || + ("undefined" != typeof navigator && + /MSIE [1-9]\./.test(navigator.userAgent)) + ) + ) + return ( + (e = a.document), + (l = function () { + return a.URL || a.webkitURL || a; + }), + (u = e.createElementNS("http://www.w3.org/1999/xhtml", "a")), + (c = "download" in u), + (d = /constructor/i.test(a.HTMLElement) || a.safari), + (h = /CriOS\/[\d]+/.test(navigator.userAgent)), + (f = function (e) { + (a.setImmediate || a.setTimeout)(function () { + throw e; + }, 0); + }), + (t = 4e4), + (p = function (e) { + setTimeout(function () { + "string" == typeof e ? l().revokeObjectURL(e) : e.remove(); + }, t); + }), + (m = function (e) { + return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test( + e.type, + ) + ? new Blob([String.fromCharCode(65279), e], { + type: e.type, + }) + : e; + }), + (e = (o = function (e, r, t) { + t || (e = m(e)); + var o, + n, + s = this, + t = "application/octet-stream" === e.type, + i = function () { + for ( + var e = s, + t = "writestart progress write writeend".split(" "), + r = void 0, + o = (t = [].concat(t)).length; + o--; + + ) { + var n = e["on" + t[o]]; + if ("function" == typeof n) + try { + n.call(e, r || e); + } catch (e) { + f(e); + } + } + }; + (s.readyState = s.INIT), + c + ? ((o = l().createObjectURL(e)), + setTimeout(function () { + var e, t; + (u.href = o), + (u.download = r), + (e = u), + (t = new MouseEvent("click")), + e.dispatchEvent(t), + i(), + p(o), + (s.readyState = s.DONE); + })) + : (h || (t && d)) && a.FileReader + ? (((n = new FileReader()).onloadend = function () { + var e = h + ? n.result + : n.result.replace( + /^data:[^;]*;/, + "data:attachment/file;", + ); + a.open(e, "_blank") || (a.location.href = e), + (e = void 0), + (s.readyState = s.DONE), + i(); + }), + n.readAsDataURL(e), + (s.readyState = s.INIT)) + : ((o = o || l().createObjectURL(e)), + (!t && a.open(o, "_blank")) || (a.location.href = o), + (s.readyState = s.DONE), + i(), + p(o)); + }).prototype), + "undefined" != typeof navigator && navigator.msSaveOrOpenBlob + ? function (e, t, r) { + return ( + (t = t || e.name || "download"), + r || (e = m(e)), + navigator.msSaveOrOpenBlob(e, t) + ); + } + : ((e.abort = function () {}), + (e.readyState = e.INIT = 0), + (e.WRITING = 1), + (e.DONE = 2), + (e.error = + e.onwritestart = + e.onprogress = + e.onwrite = + e.onabort = + e.onerror = + e.onwriteend = + null), + function (e, t, r) { + return new o(e, t || e.name || "download", r); + }) + ); + })( + ("undefined" != typeof self && self) || + ("undefined" != typeof window && window) || + this.content, + ); + void 0 !== t && t.exports + ? (t.exports.saveAs = o) + : null != s && + null !== s.amd && + s("FileSaver.js", function () { + return o; + }); + }, + {}, + ], + 245: [ + function (e, t, r) { + var o, + n = Object.defineProperty, + s = (n(r, "__esModule", { value: !0 }), r), + i = { + GIFEncoder: () => h, + applyPalette: () => + function (e, t, r = "rgb565") { + if (!e || !e.buffer) + throw new Error("quantize() expected RGBA Uint8Array data"); + if ( + !(e instanceof Uint8Array || e instanceof Uint8ClampedArray) + ) + throw new Error("quantize() expected RGBA Uint8Array data"); + if (256 < t.length) + throw new Error( + "applyPalette() only works with 256 colors or less", + ); + const o = new Uint32Array(e.buffer), + n = o.length, + s = "rgb444" === r ? 4096 : 65536, + i = new Uint8Array(n), + a = new Array(s); + if ("rgba4444" === r) + for (let e = 0; e < n; e++) { + var l = o[e], + u = (l >> 24) & 255, + c = (l >> 16) & 255, + d = (l >> 8) & 255, + l = 255 & l, + h = P(l, d, c, u), + h = + h in a + ? a[h] + : (a[h] = (function (t, r, o, n, s) { + let i = 0, + a = 1e100; + for (let e = 0; e < s.length; e++) { + var l, + u = s[e], + c = v(u[3] - n); + c > a || + ((l = u[0]), + (c += v(l - t)) > a || + ((l = u[1]), + (c += v(l - r)) > a || + ((l = u[2]), + (c += v(l - o)) > a || + ((a = c), (i = e))))); + } + return i; + })(l, d, c, u, t)); + i[e] = h; + } + else { + const g = "rgb444" === r ? A : O; + for (let e = 0; e < n; e++) { + var f = o[e], + p = (f >> 16) & 255, + m = (f >> 8) & 255, + f = 255 & f, + y = g(f, m, p), + y = + y in a + ? a[y] + : (a[y] = (function (t, r, o, n) { + let s = 0, + i = 1e100; + for (let e = 0; e < n.length; e++) { + var a, + l = n[e], + u = v(l[0] - t); + u > i || + ((a = l[1]), + (u += v(a - r)) > i || + ((a = l[2]), + (u += v(a - o)) > i || + ((i = u), (s = e)))); + } + return s; + })(f, m, p, t)); + i[e] = y; + } + } + return i; + }, + default: () => f, + nearestColor: () => + function (e, t, r = u) { + return e[l(e, t, r)]; + }, + nearestColorIndex: () => l, + nearestColorIndexWithDistance: () => d, + prequantize: () => + function ( + e, + { + roundRGB: r = 5, + roundAlpha: o = 10, + oneBitAlpha: n = null, + } = {}, + ) { + const s = new Uint32Array(e.buffer); + for (let t = 0; t < s.length; t++) { + var i = s[t]; + let e = (i >> 24) & 255; + var a, + l = (i >> 16) & 255, + u = (i >> 8) & 255, + i = 255 & i; + (e = c(e, o)), + n && + ((a = "number" == typeof n ? n : 127), + (e = e <= a ? 0 : 255)), + (i = c(i, r)), + (u = c(u, r)), + (l = c(l, r)), + (s[t] = (e << 24) | (l << 16) | (u << 8) | (i << 0)); + } + }, + quantize: () => + function (e, t, r = {}) { + var { + format: o = "rgb565", + clearAlpha: n = !0, + clearAlphaColor: s = 0, + clearAlphaThreshold: i = 0, + oneBitAlpha: a = !1, + } = r; + if (!e || !e.buffer) + throw new Error("quantize() expected RGBA Uint8Array data"); + if ( + !(e instanceof Uint8Array || e instanceof Uint8ClampedArray) + ) + throw new Error("quantize() expected RGBA Uint8Array data"); + e = new Uint32Array(e.buffer); + let l = !1 !== r.useSqrt; + const u = "rgba4444" === o, + c = (function (r, e) { + const t = "rgb444" === e ? 4096 : 65536, + o = new Array(t), + n = r.length; + if ("rgba4444" === e) + for (let t = 0; t < n; ++t) { + var s = r[t], + i = (s >> 24) & 255, + a = (s >> 16) & 255, + l = (s >> 8) & 255, + s = 255 & s, + u = P(s, l, a, i); + let e = u in o ? o[u] : (o[u] = D()); + (e.rc += s), + (e.gc += l), + (e.bc += a), + (e.ac += i), + e.cnt++; + } + else if ("rgb444" === e) + for (let t = 0; t < n; ++t) { + var c = r[t], + d = (c >> 16) & 255, + h = (c >> 8) & 255, + c = 255 & c, + f = A(c, h, d); + let e = f in o ? o[f] : (o[f] = D()); + (e.rc += c), (e.gc += h), (e.bc += d), e.cnt++; + } + else + for (let t = 0; t < n; ++t) { + var p = r[t], + m = (p >> 16) & 255, + y = (p >> 8) & 255, + p = 255 & p, + g = O(p, y, m); + let e = g in o ? o[g] : (o[g] = D()); + (e.rc += p), (e.gc += y), (e.bc += m), e.cnt++; + } + return o; + })(e, o), + d = c.length, + h = d - 1, + f = new Uint32Array(d + 1); + for (var p = 0, m = 0; m < d; ++m) { + const C = c[m]; + null != C && + ((M = 1 / C.cnt), + u && (C.ac *= M), + (C.rc *= M), + (C.gc *= M), + (C.bc *= M), + (c[p++] = C)); + } + R(t) / p < 0.022 && (l = !1); + for (var y, g, v, m = 0; m < p - 1; ++m) + (c[m].fw = m + 1), + (c[m + 1].bk = m), + l && (c[m].cnt = Math.sqrt(c[m].cnt)); + l && (c[m].cnt = Math.sqrt(c[m].cnt)); + for (m = 0; m < p; ++m) { + I(c, m, !1); + var b = c[m].err; + for ( + g = ++f[0]; + 1 < g && ((v = g >> 1), !(c[(y = f[v])].err <= b)); + g = v + ) + f[g] = y; + f[g] = m; + } + var j, + _ = p - t; + for (m = 0; m < _; ) { + for (;;) { + var x = f[1]; + if ((j = c[x]).tm >= j.mtm && c[j.nn].mtm <= j.tm) break; + j.mtm == h + ? (x = f[1] = f[f[0]--]) + : (I(c, x, !1), (j.tm = m)); + b = c[x].err; + for ( + g = 1; + (v = g + g) <= f[0] && + (v < f[0] && c[f[v]].err > c[f[v + 1]].err && v++, + !(b <= c[(y = f[v])].err)); + g = v + ) + f[g] = y; + f[g] = x; + } + var w = c[j.nn], + S = j.cnt, + T = w.cnt, + M = 1 / (S + T); + u && (j.ac = M * (S * j.ac + T * w.ac)), + (j.rc = M * (S * j.rc + T * w.rc)), + (j.gc = M * (S * j.gc + T * w.gc)), + (j.bc = M * (S * j.bc + T * w.bc)), + (j.cnt += w.cnt), + (j.mtm = ++m), + (c[w.bk].fw = w.fw), + (c[w.fw].bk = w.bk), + (w.mtm = h); + } + let E = []; + for (m = 0; ; 0) { + let e = L(Math.round(c[m].rc), 0, 255), + t = L(Math.round(c[m].gc), 0, 255), + r = L(Math.round(c[m].bc), 0, 255), + o = 255; + u && + ((o = L(Math.round(c[m].ac), 0, 255)), + a && + ((k = "number" == typeof a ? a : 127), + (o = o <= k ? 0 : 255)), + n && o <= i && ((e = t = r = s), (o = 0))); + var k = u ? [e, t, r, o] : [e, t, r]; + if ( + ((function (t, r) { + for (let e = 0; e < t.length; e++) { + var o = t[e], + n = o[0] === r[0] && o[1] === r[1] && o[2] === r[2], + o = + !(4 <= o.length && 4 <= r.length) || + o[3] === r[3]; + if (n && o) return !0; + } + return !1; + })(E, k) || E.push(k), + 0 == (m = c[m].fw)) + ) + break; + } + return E; + }, + snapColorsToPalette: () => + function (r, o, e = 5) { + if (r.length && o.length) { + var n = r.map((e) => e.slice(0, 3)), + s = e * e, + i = r[0].length; + for (let t = 0; t < o.length; t++) { + let e = o[t]; + e = + e.length < i + ? [e[0], e[1], e[2], 255] + : e.length > i + ? e.slice(0, 3) + : e.slice(); + var a = d(n, e.slice(0, 3), u), + l = a[0], + a = a[1]; + 0 < a && a <= s && (r[l] = e); + } + } + }, + }; + for (o in i) n(s, o, { get: i[o], enumerable: !0 }); + var a = { + signature: "GIF", + version: "89a", + trailer: 59, + extensionIntroducer: 33, + applicationExtensionLabel: 255, + graphicControlExtensionLabel: 249, + imageSeparator: 44, + signatureSize: 3, + versionSize: 3, + globalColorTableFlagMask: 128, + colorResolutionMask: 112, + sortFlagMask: 8, + globalColorTableSizeMask: 7, + applicationIdentifierSize: 8, + applicationAuthCodeSize: 3, + disposalMethodMask: 28, + userInputFlagMask: 2, + transparentColorFlagMask: 1, + localColorTableFlagMask: 128, + interlaceFlagMask: 64, + idSortFlagMask: 32, + localColorTableSizeMask: 7, + }; + function E(e = 256) { + let n = 0, + s = new Uint8Array(e); + return { + get buffer() { + return s.buffer; + }, + reset() { + n = 0; + }, + bytesView() { + return s.subarray(0, n); + }, + bytes() { + return s.slice(0, n); + }, + writeByte(e) { + i(n + 1), (s[n] = e), n++; + }, + writeBytes(t, r = 0, o = t.length) { + i(n + o); + for (let e = 0; e < o; e++) s[n++] = t[e + r]; + }, + writeBytesView(e, t = 0, r = e.byteLength) { + i(n + r), s.set(e.subarray(t, t + r), n), (n += r); + }, + }; + function i(e) { + var t = s.length; + if (!(e <= t)) { + (e = Math.max(e, (t * (t < 1048576 ? 2 : 1.125)) >>> 0)), + 0 != t && (e = Math.max(e, 256)); + const r = s; + (s = new Uint8Array(e)), 0 < n && s.set(r.subarray(0, n), 0); + } + } + } + var k = [ + 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, + 16383, 32767, 65535, + ]; + var S = function ( + e, + t, + r, + o, + n = E(512), + s = new Uint8Array(256), + i = new Int32Array(5003), + a = new Int32Array(5003), + ) { + var l = i.length, + o = Math.max(2, o); + s.fill(0), a.fill(0), i.fill(-1); + let u = 0, + c = 0; + var d = o + 1; + const h = d; + let f = !1, + p = h, + m = (1 << p) - 1; + var y = 1 << (d - 1); + const g = 1 + y; + let v = 2 + y, + b = 0, + j = r[0], + _ = 0; + for (let e = l; e < 65536; e *= 2) ++_; + (_ = 8 - _), n.writeByte(o), M(y); + var x = r.length; + for (let t = 1; t < x; t++) + e: { + var w = r[t], + S = (w << 12) + j; + let e = (w << _) ^ j; + if (i[e] === S) j = a[e]; + else { + for (var T = 0 === e ? 1 : l - e; 0 <= i[e]; ) + if (((e -= T) < 0 && (e += l), i[e] === S)) { + j = a[e]; + break e; + } + M(j), + (j = w), + v < 4096 + ? ((a[e] = v++), (i[e] = S)) + : (i.fill(-1), (v = 2 + y), (f = !0), M(y)); + } + } + return M(j), M(g), n.writeByte(0), n.bytesView(); + function M(e) { + for (u &= k[c], 0 < c ? (u |= e << c) : (u = e), c += p; 8 <= c; ) + (s[b++] = 255 & u), + 254 <= b && + (n.writeByte(b), n.writeBytesView(s, 0, b), (b = 0)), + (u >>= 8), + (c -= 8); + if ( + ((v > m || f) && + (f + ? ((p = h), (m = (1 << p) - 1), (f = !1)) + : (++p, (m = 12 === p ? 1 << p : (1 << p) - 1))), + e == g) + ) { + for (; 0 < c; ) + (s[b++] = 255 & u), + 254 <= b && + (n.writeByte(b), n.writeBytesView(s, 0, b), (b = 0)), + (u >>= 8), + (c -= 8); + 0 < b && (n.writeByte(b), n.writeBytesView(s, 0, b), (b = 0)); + } + } + }; + function O(e, t, r) { + return ((e << 8) & 63488) | ((t << 2) & 992) | (r >> 3); + } + function P(e, t, r, o) { + return (e >> 4) | (240 & t) | ((240 & r) << 4) | ((240 & o) << 8); + } + function A(e, t, r) { + return ((e >> 4) << 8) | (240 & t) | (r >> 4); + } + function L(e, t, r) { + return e < t ? t : r < e ? r : e; + } + function R(e) { + return e * e; + } + function I(e, t, r) { + var o = 0, + n = 1e100; + const s = e[t]; + for ( + var i = s.cnt, a = s.ac, l = s.rc, u = s.gc, c = s.bc, d = s.fw; + 0 != d; + d = e[d].fw + ) { + var h, + f = e[d], + p = f.cnt, + p = (i * p) / (i + p); + n <= p || + ((h = 0), + (r && n <= (h += p * R(f.ac - a))) || + n <= (h += p * R(f.rc - l)) || + n <= (h += p * R(f.gc - u)) || + n <= (h += p * R(f.bc - c)) || + ((n = h), (o = d))); + } + (s.err = n), (s.nn = o); + } + function D() { + return { + ac: 0, + rc: 0, + gc: 0, + bc: 0, + cnt: 0, + nn: 0, + fw: 0, + bk: 0, + tm: 0, + mtm: 0, + err: 0, + }; + } + function u(e, t) { + for (var r = 0, o = 0; o < e.length; o++) { + var n = e[o] - t[o]; + r += n * n; + } + return r; + } + function c(e, t) { + return 1 < t ? Math.round(e / t) * t : e; + } + function v(e) { + return e * e; + } + function l(t, r, o = u) { + let n = 1 / 0, + s = -1; + for (let e = 0; e < t.length; e++) { + var i = o(r, t[e]); + i < n && ((n = i), (s = e)); + } + return s; + } + function d(t, r, o = u) { + let n = 1 / 0, + s = -1; + for (let e = 0; e < t.length; e++) { + var i = o(r, t[e]); + i < n && ((n = i), (s = e)); + } + return [s, n]; + } + function h(e = {}) { + const { initialCapacity: t = 4096, auto: g = !0 } = e, + v = E(t); + const b = new Uint8Array(256), + j = new Int32Array(5003), + _ = new Int32Array(5003); + let x = !1; + return { + reset() { + v.reset(), (x = !1); + }, + finish() { + v.writeByte(a.trailer); + }, + bytes() { + return v.bytes(); + }, + bytesView() { + return v.bytesView(); + }, + get buffer() { + return v.buffer; + }, + get stream() { + return v; + }, + writeHeader: w, + writeFrame(e, t, r, o = {}) { + var { + transparent: n = !1, + transparentIndex: s = 0, + delay: i = 0, + palette: a = null, + repeat: l = 0, + colorDepth: u = 8, + dispose: c = -1, + } = o; + let d = !1; + if ( + (g ? x || ((d = !0), w(), (x = !0)) : (d = Boolean(o.first)), + (t = Math.max(0, Math.floor(t))), + (r = Math.max(0, Math.floor(r))), + d) + ) { + if (!a) + throw new Error( + "First frame must include a { palette } option", + ); + var [o, h, f, p, m = 8] = [v, t, r, a, u]; + (p = F(p.length) - 1), + (m = 128 | ((m - 1) << 4) | p), + M(o, h), + M(o, f), + o.writeBytes([m, 0, 0]), + T(v, a), + 0 <= l && + ((p = v), + (h = l), + p.writeByte(33), + p.writeByte(255), + p.writeByte(11), + C(p, "NETSCAPE2.0"), + p.writeByte(3), + p.writeByte(1), + M(p, h), + p.writeByte(0)); + } + var y, + f = Math.round(i / 10), + o = v, + m = c, + l = f, + h = n, + p = s, + i = + (o.writeByte(33), + o.writeByte(249), + o.writeByte(4), + p < 0 && ((p = 0), (h = !1)), + (h = h ? ((y = 1), 2) : (y = 0)), + 0 <= m && (h = 7 & m), + (h <<= 2), + o.writeByte(0 | h | y), + M(o, l), + o.writeByte(p || 0), + o.writeByte(0), + Boolean(a) && !d); + (c = v), + (n = t), + (s = r), + (y = i ? a : null), + c.writeByte(44), + M(c, 0), + M(c, 0), + M(c, n), + M(c, s), + y + ? ((n = F(y.length) - 1), c.writeByte(128 | n)) + : c.writeByte(0), + i && T(v, a), + ([l, o, s, n, c = 8, i, a, e] = [v, e, t, r, u, b, j, _]), + S(s, n, o, c, l, i, a, e); + }, + }; + function w() { + C(v, "GIF89a"); + } + } + function T(r, o) { + var e = 1 << F(o.length); + for (let t = 0; t < e; t++) { + let e = [0, 0, 0]; + t < o.length && (e = o[t]), + r.writeByte(e[0]), + r.writeByte(e[1]), + r.writeByte(e[2]); + } + } + function M(e, t) { + e.writeByte(255 & t), e.writeByte((t >> 8) & 255); + } + function C(e, t) { + for (var r = 0; r < t.length; r++) e.writeByte(t.charCodeAt(r)); + } + function F(e) { + return Math.max(Math.ceil(Math.log2(e)), 1); + } + var f = h; + }, + {}, + ], + 246: [ + function (e, t, r) { + (r.read = function (e, t, r, o, n) { + var s, + i, + a = 8 * n - o - 1, + l = (1 << a) - 1, + u = l >> 1, + c = -7, + d = r ? n - 1 : 0, + h = r ? -1 : 1, + n = e[t + d]; + for ( + d += h, s = n & ((1 << -c) - 1), n >>= -c, c += a; + 0 < c; + s = 256 * s + e[t + d], d += h, c -= 8 + ); + for ( + i = s & ((1 << -c) - 1), s >>= -c, c += o; + 0 < c; + i = 256 * i + e[t + d], d += h, c -= 8 + ); + if (0 === s) s = 1 - u; + else { + if (s === l) return i ? NaN : (1 / 0) * (n ? -1 : 1); + (i += Math.pow(2, o)), (s -= u); + } + return (n ? -1 : 1) * i * Math.pow(2, s - o); + }), + (r.write = function (e, t, r, o, n, s) { + var i, + a, + l = 8 * s - n - 1, + u = (1 << l) - 1, + c = u >> 1, + d = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, + h = o ? 0 : s - 1, + f = o ? 1 : -1, + s = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0; + for ( + t = Math.abs(t), + isNaN(t) || t === 1 / 0 + ? ((a = isNaN(t) ? 1 : 0), (i = u)) + : ((i = Math.floor(Math.log(t) / Math.LN2)), + t * (o = Math.pow(2, -i)) < 1 && (i--, (o *= 2)), + 2 <= + (t += 1 <= i + c ? d / o : d * Math.pow(2, 1 - c)) * + o && (i++, (o /= 2)), + u <= i + c + ? ((a = 0), (i = u)) + : 1 <= i + c + ? ((a = (t * o - 1) * Math.pow(2, n)), (i += c)) + : ((a = t * Math.pow(2, c - 1) * Math.pow(2, n)), + (i = 0))); + 8 <= n; + e[r + h] = 255 & a, h += f, a /= 256, n -= 8 + ); + for ( + i = (i << n) | a, l += n; + 0 < l; + e[r + h] = 255 & i, h += f, i /= 256, l -= 8 + ); + e[r + h - f] |= 128 * s; + }); + }, + {}, + ], + 247: [ + function (o, e, c) { + "use strict"; + var t; + function y(e, t) { + return e.b === t.b && e.a === t.a; + } + function g(e, t) { + return e.b < t.b || (e.b === t.b && e.a <= t.a); + } + function v(e, t, r) { + var o = t.b - e.b, + n = r.b - t.b; + return 0 < o + n + ? o < n + ? t.a - e.a + (o / (o + n)) * (e.a - r.a) + : t.a - r.a + (n / (o + n)) * (r.a - e.a) + : 0; + } + function b(e, t, r) { + var o = t.b - e.b, + n = r.b - t.b; + return 0 < o + n ? (t.a - r.a) * o + (t.a - e.a) * n : 0; + } + function j(e, t) { + return e.a < t.a || (e.a === t.a && e.b <= t.b); + } + function V(e, t, r) { + var o = t.a - e.a, + n = r.a - t.a; + return 0 < o + n + ? o < n + ? t.b - e.b + (o / (o + n)) * (e.b - r.b) + : t.b - r.b + (n / (o + n)) * (r.b - e.b) + : 0; + } + function z(e, t, r) { + var o = t.a - e.a, + n = r.a - t.a; + return 0 < o + n ? (t.b - r.b) * o + (t.b - e.b) * n : 0; + } + function _(e, t, r, o) { + return (e = e < 0 ? 0 : e) <= (r = r < 0 ? 0 : r) + ? 0 === r + ? (t + o) / 2 + : t + (e / (e + r)) * (o - t) + : o + (r / (e + r)) * (t - o); + } + function d(e) { + var t = s(e.b); + return n(t, e.c), n(t.b, e.c), i(t, e.a), t; + } + function x(e, t) { + var r = !1, + o = !1; + e !== t && + (t.a !== e.a && ((o = !0), M(t.a, e.a)), + t.d !== e.d && ((r = !0), a(t.d, e.d)), + T(t, e), + o || (n(t, e.a), (e.a.c = e)), + r || (i(t, e.d), (e.d.a = e))); + } + function m(e) { + var t = e.b, + r = !1; + e.d !== e.b.d && ((r = !0), a(e.d, e.b.d)), + e.c === e + ? M(e.a, null) + : ((e.b.d.a = e.b.e), + (e.a.c = e.c), + T(e, e.b.e), + r || i(e, e.d)), + t.c === t + ? (M(t.a, null), a(t.d, null)) + : ((e.d.a = t.b.e), (t.a.c = t.c), T(t, t.b.e)), + H(e); + } + function w(e) { + var t = s(e), + r = t.b; + return ( + T(t, e.e), + (t.a = e.b.a), + n(r, t.a), + (t.d = r.d = e.d), + (t = t.b), + T(e.b, e.b.b.e), + T(e.b, t), + (e.b.a = t.a), + (t.b.a.c = t.b), + (t.b.d = e.b.d), + (t.f = e.f), + (t.b.f = e.b.f), + t + ); + } + function S(e, t) { + var r = !1, + o = s(e), + n = o.b; + return ( + t.d !== e.d && ((r = !0), a(t.d, e.d)), + T(o, e.e), + T(n, t), + (o.a = e.b.a), + (n.a = t.a), + (o.d = n.d = e.d), + (e.d.a = n), + r || i(o, e.d), + o + ); + } + function s(e) { + var t = new u(), + r = new u(), + o = e.b.h; + return ( + ((((r.h = o).b.h = t).h = e).b.h = r), + (t.b = r), + (((t.c = t).e = r).b = t), + ((r.c = r).e = t) + ); + } + function T(e, t) { + var r = e.c, + o = t.c; + (r.b.e = t), ((o.b.e = e).c = o), (t.c = r); + } + function n(e, t) { + var r = t.f, + o = new D(t, r); + for (r.e = o, r = (t.f = o).c = e; (r.a = o), (r = r.c) !== e; ); + } + function i(e, t) { + var r = t.d, + o = new te(t, r); + for ( + r.b = o, (t.d = o).a = e, o.c = t.c, r = e; + (r.d = o), (r = r.e) !== e; + + ); + } + function H(e) { + var t = e.h; + (e = e.b.h), ((t.b.h = e).b.h = t); + } + function M(e, t) { + for (var r = e.c, o = r; (o.a = t), (o = o.c) !== r; ); + (r = e.f), (((o = e.e).f = r).e = o); + } + function a(e, t) { + for (var r = e.a, o = r; (o.d = t), (o = o.e) !== r; ); + (r = e.d), (((o = e.b).d = r).b = o); + } + function W(e) { + var t = 0; + return ( + Math.abs(e[1]) > Math.abs(e[0]) && (t = 1), + (t = Math.abs(e[2]) > Math.abs(e[t]) ? 2 : t) + ); + } + function E(e, t) { + (e.f += t.f), (e.b.f += t.b.f); + } + function h(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 k(e) { + e.a.i = null; + var t = e.e; + (t.a.c = t.c), (t.c.a = t.a), (e.e = null); + } + function C(e, t) { + m(e.a), (e.c = !1), ((e.a = t).i = e); + } + function O(e) { + for (var t = e.a.a; (e = G(e)).a.a === t; ); + return e.c && (C(e, (t = S(B(e).a.b, e.a.e))), (e = G(e))), e; + } + function q(e, t, r) { + var o = new N(); + return (o.a = r), (o.e = p(e.f, t.e, o)), (r.i = o); + } + function X(e, t) { + switch (e.s) { + case 100130: + return 0 != (1 & t); + case 100131: + return 0 !== t; + case 100132: + return 0 < t; + case 100133: + return t < 0; + case 100134: + return 2 <= t || t <= -2; + } + return !1; + } + function f(e) { + var t = e.a, + r = t.d; + (r.c = e.d), (r.a = t), k(e); + } + function P(e, t, r) { + for (t = (e = t).a; e !== r; ) { + e.c = !1; + var o = B(e), + n = o.a; + if (n.a !== t.a) { + if (!o.c) { + f(e); + break; + } + C(o, (n = S(t.c.b, n.b))); + } + t.c !== n && (x(n.b.e, n), x(t, n)), f(e), (t = o.a), (e = o); + } + return t; + } + function A(e, t, r, o, n, s) { + for (var i = !0; q(e, t, r.b), (r = r.c) !== o; ); + for ( + null === n && (n = B(t).a.b.c); + (r = (o = B(t)).a.b).a === n.a; + + ) + r.c !== n && (x(r.b.e, r), x(n.b.e, r)), + (o.f = t.f - r.f), + (o.d = X(e, o.f)), + (t.b = !0), + !i && R(e, t) && (E(r, n), k(t), m(n)), + (i = !1), + (t = o), + (n = r); + (t.b = !0), s && J(e, t); + } + function Y(e, t, r, o, n) { + var s = [t.g[0], t.g[1], t.g[2]]; + (t.d = null), + (t.d = (e.o && e.o(s, r, o, e.c)) || null), + null === t.d && + (n ? e.n || (l(e, 100156), (e.n = !0)) : (t.d = r[0])); + } + function L(e, t, r) { + var o = [null, null, null, null]; + (o[0] = t.a.d), + (o[1] = r.a.d), + Y(e, t.a, o, [0.5, 0.5, 0, 0], !1), + x(t, r); + } + function Z(e, t, r, o, n) { + var s = Math.abs(t.b - e.b) + Math.abs(t.a - e.a), + i = Math.abs(r.b - e.b) + Math.abs(r.a - e.a), + a = n + 1; + (o[n] = (0.5 * i) / (s + i)), + (o[a] = (0.5 * s) / (s + i)), + (e.g[0] += o[n] * t.g[0] + o[a] * r.g[0]), + (e.g[1] += o[n] * t.g[1] + o[a] * r.g[1]), + (e.g[2] += o[n] * t.g[2] + o[a] * r.g[2]); + } + function R(e, t) { + var r = B(t), + o = t.a, + n = r.a; + if (g(o.a, n.a)) { + if (0 < b(n.b.a, o.a, n.a)) return; + if (y(o.a, n.a)) { + if (o.a !== n.a) { + var r = e.e, + s = o.a.h; + if (0 <= s) { + var i = (r = r.b).d, + a = r.e, + l = r.c, + u = l[s]; + (i[u] = i[r.a]), + (l[i[u]] = u) <= --r.a && + (u <= 1 || g(a[i[u >> 1]], a[i[u]]) ? U : ue)(r, u), + (a[s] = null), + (l[s] = r.b), + (r.b = s); + } else + for ( + r.c[-(s + 1)] = null; + 0 < r.a && null === r.c[r.d[r.a - 1]]; + + ) + --r.a; + L(e, n.b.e, o); + } + } else w(n.b), x(o, n.b.e), (t.b = r.b = !0); + } else { + if (b(o.b.a, n.a, o.a) < 0) return; + (G(t).b = t.b = !0), w(o.b), x(n.b.e, o); + } + return 1; + } + function Q(e, t) { + var r = B(t), + o = t.a, + n = r.a, + s = o.a, + i = n.a, + a = o.b.a, + l = n.b.a, + u = new D(); + if ( + (b(a, e.a, s), + b(l, e.a, i), + !(s === i || Math.min(s.a, a.a) > Math.max(i.a, l.a))) + ) { + if (g(s, i)) { + if (0 < b(l, s, i)) return; + } else if (b(a, i, s) < 0) return; + var c, + d, + h = a, + f = s, + p = l, + m = i; + if ( + (g(h, f) || ((c = h), (h = f), (f = c)), + g(p, m) || ((c = p), (p = m), (m = c)), + g(h, p) || + ((c = h), (h = p), (p = c), (c = f), (f = m), (m = c)), + g(p, f) + ? g(f, m) + ? ((c = v(h, p, f)) + (d = v(p, f, m)) < 0 && + ((c = -c), (d = -d)), + (u.b = _(c, p.b, d, f.b))) + : ((c = b(h, p, f)) + (d = -b(h, m, f)) < 0 && + ((c = -c), (d = -d)), + (u.b = _(c, p.b, d, m.b))) + : (u.b = (p.b + f.b) / 2), + j(h, f) || ((c = h), (h = f), (f = c)), + j(p, m) || ((c = p), (p = m), (m = c)), + j(h, p) || + ((c = h), (h = p), (p = c), (c = f), (f = m), (m = c)), + j(p, f) + ? j(f, m) + ? ((c = V(h, p, f)) + (d = V(p, f, m)) < 0 && + ((c = -c), (d = -d)), + (u.a = _(c, p.a, d, f.a))) + : ((c = z(h, p, f)) + (d = -z(h, m, f)) < 0 && + ((c = -c), (d = -d)), + (u.a = _(c, p.a, d, m.a))) + : (u.a = (p.a + f.a) / 2), + g(u, e.a) && ((u.b = e.a.b), (u.a = e.a.a)), + (h = g(s, i) ? s : i), + g(h, u) && ((u.b = h.b), (u.a = h.a)), + y(u, s) || y(u, i)) + ) + return R(e, t), 0; + if ( + (!y(a, e.a) && 0 <= b(a, e.a, u)) || + (!y(l, e.a) && b(l, e.a, u) <= 0) + ) { + if (l === e.a) + w(o.b), + x(n.b, o), + (o = B((t = O(t))).a), + P(e, B(t), r), + A(e, t, o.b.e, o, o, !0); + else { + if (a !== e.a) + return ( + 0 <= b(a, e.a, u) && + ((G(t).b = t.b = !0), + w(o.b), + (o.a.b = e.a.b), + (o.a.a = e.a.a)), + void ( + b(l, e.a, u) <= 0 && + ((t.b = r.b = !0), + w(n.b), + (n.a.b = e.a.b), + (n.a.a = e.a.a)) + ) + ); + for ( + w(n.b), x(o.e, n.b.e), i = (s = r = t).a.b.a; + (s = G(s)).a.b.a === i; + + ); + (s = B((t = s)).a.b.c), + (r.a = n.b.e), + A(e, t, (n = P(e, r, null)).c, o.b.c, s, !0); + } + return 1; + } + w(o.b), + w(n.b), + x(n.b.e, o), + (o.a.b = u.b), + (o.a.a = u.a), + (o.a.h = ne(e.e, o.a)), + (o = o.a), + (n = [0, 0, 0, 0]), + (u = [s.d, a.d, i.d, l.d]), + (o.g[0] = o.g[1] = o.g[2] = 0), + Z(o, s, a, n, 0), + Z(o, i, l, n, 2), + Y(e, o, u, n, !0), + (G(t).b = t.b = r.b = !0); + } + } + function J(e, t) { + for (var r = B(t); ; ) { + for (; r.b; ) r = B((t = r)); + if (!t.b && (null === (t = G((r = t))) || !t.b)) break; + t.b = !1; + var o = t.a, + n = r.a; + if ((s = o.b.a !== n.b.a)) + e: { + var s, + i = B((s = t)), + a = s.a, + l = i.a, + u = void 0; + if (g(a.b.a, l.b.a)) { + if (b(a.b.a, l.b.a, a.a) < 0) { + s = !1; + break e; + } + (G(s).b = s.b = !0), (u = w(a)), x(l.b, u), (u.d.c = s.d); + } else { + if (0 < b(l.b.a, a.b.a, l.a)) { + s = !1; + break e; + } + (s.b = i.b = !0), (u = w(l)), x(a.e, l.b), (u.b.d.c = s.d); + } + s = !0; + } + if ( + (s && + (r.c + ? (k(r), m(n), (n = (r = B(t)).a)) + : t.c && (k(t), m(o), (o = (t = G(r)).a))), + o.a !== n.a) + ) + if ( + o.b.a === n.b.a || + t.c || + r.c || + (o.b.a !== e.a && n.b.a !== e.a) + ) + R(e, t); + else if (Q(e, t)) break; + o.a === n.a && + o.b.a === n.b.a && + (E(n, o), k(t), m(o), (t = G(r))); + } + } + function K(e, t) { + var r = new N(), + o = d(e.b); + (o.a.b = 4e150), + (o.a.a = t), + (o.b.a.b = -4e150), + (o.b.a.a = t), + (e.a = o.b.a), + (r.a = o), + (r.f = 0), + (r.d = !1), + (r.c = !1), + (r.h = !0), + (r.b = !1), + (o = p((o = e.f), o.a, r)), + (r.e = o); + } + function $(e) { + (this.a = new ee()), (this.b = e), (this.c = h); + } + function p(e, t, r) { + for (; null !== (t = t.c).b && !e.c(e.b, t.b, r); ); + return (e = new ee(r, t.a, t)), (t.a.c = e), (t.a = e); + } + function ee(e, t, r) { + (this.b = e || null), (this.a = t || this), (this.c = r || this); + } + function r() { + (this.d = 0), + (this.p = this.b = this.q = null), + (this.j = [0, 0, 0]), + (this.s = 100130), + (this.n = !1), + (this.o = this.a = this.e = this.f = null), + (this.m = !1), + (this.c = this.r = this.i = this.k = this.l = this.h = null); + } + function I(e, t) { + if (e.d !== t) + for (; e.d !== t; ) + if (e.d < t) + switch (e.d) { + case 0: + l(e, 100151), e.u(null); + break; + case 1: + l(e, 100152), e.t(); + } + else + switch (e.d) { + case 2: + l(e, 100154), e.v(); + break; + case 1: + l(e, 100153), e.w(); + } + } + function l(e, t) { + e.p && e.p(t, e.c); + } + function te(e, t) { + (this.b = e || this), + (this.d = t || this), + (this.a = null), + (this.c = !1); + } + function u() { + ((this.h = this).i = + this.d = + this.a = + this.e = + this.c = + this.b = + null), + (this.f = 0); + } + function re() { + (this.c = new D()), + (this.a = new te()), + (this.b = new u()), + (this.d = new u()), + (this.b.b = this.d), + (this.d.b = this.b); + } + function D(e, t) { + (this.e = e || this), + (this.f = t || this), + (this.d = this.c = null), + (this.g = [0, 0, 0]), + (this.h = this.a = this.b = 0); + } + function oe() { + (this.c = []), + (this.d = null), + (this.a = 0), + (this.e = !1), + (this.b = new ie()); + } + function ne(e, t) { + var r, o, n; + return e.e + ? (2 * (o = ++(r = e.b).a) > r.f && + ((r.f *= 2), (r.c = ae(r.c, r.f + 1))), + 0 === r.b ? (n = o) : ((n = r.b), (r.b = r.c[r.b])), + (r.e[n] = t), + (r.c[n] = o), + (r.d[o] = n), + r.h && ue(r, o), + n) + : ((r = e.a++), (e.c[r] = t), -(r + 1)); + } + function se(e) { + if (0 === e.a) return le(e.b); + var t = e.c[e.d[e.a - 1]]; + if (0 !== e.b.a && g(F(e.b), t)) return le(e.b); + for (; --e.a, 0 < e.a && null === e.c[e.d[e.a - 1]]; ); + return t; + } + function ie() { + (this.d = ae([0], 33)), + (this.e = [null, null]), + (this.c = [0, 0]), + (this.a = 0), + (this.f = 32), + (this.b = 0), + (this.h = !1), + (this.d[1] = 1); + } + function ae(e, t) { + for (var r = Array(t), o = 0; o < e.length; o++) r[o] = e[o]; + for (; o < t; o++) r[o] = 0; + return r; + } + function F(e) { + return e.e[e.d[1]]; + } + function le(e) { + var t = e.d, + r = e.e, + o = e.c, + n = t[1], + s = r[n]; + return ( + 0 < e.a && + ((t[1] = t[e.a]), + (o[t[1]] = 1), + (r[n] = null), + (o[n] = e.b), + (e.b = n), + 0 < --e.a && U(e, 1)), + s + ); + } + function U(e, t) { + for (var r = e.d, o = e.e, n = e.c, s = t, i = r[s]; ; ) { + var a = s << 1, + l = (a < e.a && g(o[r[a + 1]], o[r[a]]) && (a += 1), r[a]); + if (a > e.a || g(o[i], o[l])) { + n[(r[s] = i)] = s; + break; + } + (n[(r[s] = l)] = s), (s = a); + } + } + function ue(e, t) { + for (var r = e.d, o = e.e, n = e.c, s = t, i = r[s]; ; ) { + var a = s >> 1, + l = r[a]; + if (0 == a || g(o[l], o[i])) { + n[(r[s] = i)] = s; + break; + } + (n[(r[s] = l)] = s), (s = a); + } + } + function N() { + (this.e = this.a = null), + (this.f = 0), + (this.c = this.b = this.h = this.d = !1); + } + function B(e) { + return e.e.c.b; + } + function G(e) { + return e.e.a.b; + } + ((t = r.prototype).x = function () { + I(this, 0); + }), + (t.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 l(this, 100900); + } + l(this, 100901); + }), + (t.y = function (e) { + switch (e) { + case 100142: + return 0; + case 100140: + return this.s; + case 100141: + return this.m; + default: + l(this, 100900); + } + return !1; + }), + (t.A = function (e, t, r) { + (this.j[0] = e), (this.j[1] = t), (this.j[2] = r); + }), + (t.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: + l(this, 100900); + } + }), + (t.C = function (e, t) { + var r = !1, + o = [0, 0, 0]; + I(this, 2); + for (var n = 0; n < 3; ++n) { + var s = e[n]; + s < -1e150 && ((s = -1e150), (r = !0)), + 1e150 < s && ((s = 1e150), (r = !0)), + (o[n] = s); + } + r && l(this, 100155), + null === (r = this.q) + ? x((r = d(this.b)), r.b) + : (w(r), (r = r.e)), + (r.a.d = t), + (r.a.g[0] = o[0]), + (r.a.g[1] = o[1]), + (r.a.g[2] = o[2]), + (r.f = 1), + (r.b.f = -1), + (this.q = r); + }), + (t.u = function (e) { + I(this, 0), (this.d = 1), (this.b = new re()), (this.c = e); + }), + (t.t = function () { + I(this, 1), (this.d = 2), (this.q = null); + }), + (t.v = function () { + I(this, 2), (this.d = 1); + }), + (t.w = function () { + I(this, 1), (this.d = 0); + var e, + t, + r = this.j[0], + o = this.j[1], + n = this.j[2], + s = !1, + i = [r, o, n]; + if (0 === r && 0 === o && 0 === n) { + for ( + var o = [-2e150, -2e150, -2e150], + a = [2e150, 2e150, 2e150], + n = [], + l = [], + r = (s = this.b.c).e; + r !== s; + r = r.e + ) + for (var u = 0; u < 3; ++u) { + var c = r.g[u]; + c < a[u] && ((a[u] = c), (l[u] = r)), + c > o[u] && ((o[u] = c), (n[u] = r)); + } + if ( + (o[1] - a[1] > o[(r = 0)] - a[0] && (r = 1), + a[(r = o[2] - a[2] > o[r] - a[r] ? 2 : r)] >= o[r]) + ) + (i[0] = 0), (i[1] = 0), (i[2] = 1); + else { + for ( + a = l[r], + n = n[r], + l = [(o = 0), 0, 0], + a = [a.g[0] - n.g[0], a.g[1] - n.g[1], a.g[2] - n.g[2]], + u = [0, 0, 0], + r = s.e; + r !== s; + r = r.e + ) + (u[0] = r.g[0] - n.g[0]), + (u[1] = r.g[1] - n.g[1]), + (u[2] = r.g[2] - n.g[2]), + (l[0] = a[1] * u[2] - a[2] * u[1]), + (l[1] = a[2] * u[0] - a[0] * u[2]), + (l[2] = a[0] * u[1] - a[1] * u[0]), + o < (c = l[0] * l[0] + l[1] * l[1] + l[2] * l[2]) && + ((o = c), (i[0] = l[0]), (i[1] = l[1]), (i[2] = l[2])); + o <= 0 && ((i[0] = i[1] = i[2] = 0), (i[W(a)] = 1)); + } + s = !0; + } + for ( + l = W(i), + r = this.b.c, + o = (l + 1) % 3, + n = (l + 2) % 3, + l = 0 < i[l] ? 1 : -1, + i = r.e; + i !== r; + i = i.e + ) + (i.b = i.g[o]), (i.a = l * i.g[n]); + if (s) { + for (i = 0, r = (s = this.b.a).b; r !== s; r = r.b) + if (!((o = r.a).f <= 0)) + for ( + ; + (i += (o.a.b - o.b.a.b) * (o.a.a + o.b.a.a)), + (o = o.e) !== r.a; + + ); + if (i < 0) + for (s = (i = this.b.c).e; s !== i; s = s.e) s.a = -s.a; + } + for (this.n = !1, i = this.b.b, r = i.h; r !== i; r = s) + (s = r.h), + (o = r.e), + y(r.a, r.b.a) && + r.e.e !== r && + (L(this, o, r), m(r), (o = (r = o).e)), + o.e === r && + (o !== r && ((o !== s && o !== s.b) || (s = s.h), m(o)), + (r !== s && r !== s.b) || (s = s.h), + m(r)); + for ( + this.e = i = new oe(), s = this.b.c, r = s.e; + r !== s; + r = r.e + ) + r.h = ne(i, r); + var d = i; + d.d = []; + for (var h = 0; h < d.a; h++) d.d[h] = h; + d.d.sort( + (function (r) { + return function (e, t) { + return g(r[e], r[t]) ? 1 : -1; + }; + })(d.c), + ), + (d.e = !0); + for (var f = d.b, p = f.a; 1 <= p; --p) U(f, p); + for ( + f.h = !0, this.f = new $(this), K(this, -4e150), K(this, 4e150); + null !== (i = se(this.e)); + + ) { + for (;;) { + e: if (0 === (r = this.e).a) s = F(r.b); + else if ( + ((s = r.c[r.d[r.a - 1]]), 0 !== r.b.a && g((r = F(r.b)), s)) + ) { + s = r; + break e; + } + if (null === s || !y(s, i)) break; + (s = se(this.e)), L(this, i.c, s.c); + } + !(function e(t, r) { + for (var o, n = (t.a = r).c; null === n.i; ) + if ((n = n.c) === r.c) { + var n = t, + s = r; + (c = new N()).a = s.c.b; + for ( + var i = (a = n.f).a; + null !== (i = i.a).b && !a.c(a.b, c, i.b); + + ); + var a, + l, + u = B((a = i.b)), + c = a.a, + i = u.a; + return void (0 === b(c.b.a, s, c.a) + ? y((c = a.a).a, s) || + y(c.b.a, s) || + (w(c.b), + a.c && (m(c.c), (a.c = !1)), + x(s.c, c), + e(n, s)) + : ((l = g(i.b.a, c.b.a) ? a : u), + (u = void 0), + a.d || l.c + ? ((u = + l === a ? S(s.c.b, c.e) : S(i.b.c.b, s.c).b), + l.c + ? C(l, u) + : (((a = q((c = n), a, u)).f = G(a).f + a.a.f), + (a.d = X(c, a.f))), + e(n, s)) + : A(n, a, s.c, s.c, null, !0))); + } + (a = (c = B((n = O(n.i)))).a), + (c = P(t, c, null)).c === a + ? ((c = (a = c).c), + (i = B(n)), + (u = n.a), + (l = i.a), + (o = !1), + u.b.a !== l.b.a && Q(t, n), + y(u.a, t.a) && + (x(c.b.e, u), + (c = B((n = O(n))).a), + P(t, B(n), i), + (o = !0)), + y(l.a, t.a) && + (x(a, l.b.e), (a = P(t, i, null)), (o = !0)), + o + ? A(t, n, a.c, c, c, !0) + : ((s = g(l.a, u.a) ? l.b.e : u), + A(t, n, (s = S(a.c.b, s)), s.c, s.c, !1), + (s.b.i.c = !0), + J(t, n))) + : A(t, n, c.c, a, a, !0); + })(this, i); + } + for ( + this.a = this.f.a.a.b.a.a, i = 0; + null !== (s = this.f.a.a.b); + + ) + s.h || ++i, k(s); + for ( + this.f = null, + (i = this.e).b = null, + i.d = null, + this.e = i.c = null, + i = this.b, + r = i.a.b; + r !== i.a; + r = s + ) + (s = r.b), (r = r.a).e.e === r && (E(r.c, r), m(r)); + if (!this.n) { + if (((i = this.b), this.m)) + for (r = i.b.h; r !== i.b; r = s) + (s = r.h), + r.b.d.c !== r.d.c ? (r.f = r.d.c ? 1 : -1) : m(r); + else + for (r = i.a.b; r !== i.a; r = s) + if (((s = r.b), r.c)) { + for (r = r.a; g(r.b.a, r.a); r = r.c.b); + for (; g(r.a, r.b.a); r = r.e); + for (o = r.c.b, n = void 0; r.e !== o; ) + if (g(r.b.a, o.a)) { + for ( + ; + o.e !== r && + (g((t = o.e).b.a, t.a) || + b(o.a, o.b.a, o.e.b.a) <= 0); + + ) + o = (n = S(o.e, o)).b; + o = o.c.b; + } else { + for ( + ; + o.e !== r && + (g((e = r.c.b).a, e.b.a) || + 0 <= b(r.b.a, r.a, r.c.b.a)); + + ) + r = (n = S(r, r.c.b)).b; + r = r.e; + } + for (; o.e.e !== r; ) (n = S(o.e, o)), (o = n.b); + } + if (this.h || this.i || this.k || this.l) + if (this.m) { + for (s = (i = this.b).a.b; s !== i.a; s = s.b) + if (s.c) { + for ( + this.h && this.h(2, this.c), r = s.a; + this.k && this.k(r.a.d, this.c), (r = r.e) !== s.a; + + ); + this.i && this.i(this.c); + } + } else { + for ( + i = this.b, s = !!this.l, r = !1, o = -1, n = i.a.d; + n !== i.a; + n = n.d + ) + if (n.c) + for ( + r || (this.h && this.h(4, this.c), (r = !0)), l = n.a; + s && + ((a = l.b.d.c ? 0 : 1), + o !== a && + ((o = a), this.l && this.l(!!o, this.c))), + this.k && this.k(l.a.d, this.c), + (l = l.e) !== n.a; + + ); + r && this.i && this.i(this.c); + } + if (this.r) { + for (i = this.b, r = i.a.b; r !== i.a; r = s) + if (((s = r.b), !r.c)) { + for ( + n = (o = r.a).e, l = void 0; + (n = (l = n).e), + (l.d = null) === l.b.d && + (l.c === l + ? M(l.a, null) + : ((l.a.c = l.c), T(l, l.b.e)), + (a = l.b).c === a + ? M(a.a, null) + : ((a.a.c = a.c), T(a, a.b.e)), + H(l)), + l !== o; + + ); + (o = r.d), (((r = r.b).d = o).b = r); + } + return this.r(this.b), void (this.c = this.b = null); + } + } + this.b = this.c = null; + }), + (this.libtess = { + GluTesselator: r, + windingRule: { + GLU_TESS_WINDING_ODD: 100130, + GLU_TESS_WINDING_NONZERO: 100131, + GLU_TESS_WINDING_POSITIVE: 100132, + GLU_TESS_WINDING_NEGATIVE: 100133, + GLU_TESS_WINDING_ABS_GEQ_TWO: 100134, + }, + primitiveType: { + GL_LINE_LOOP: 2, + GL_TRIANGLES: 4, + GL_TRIANGLE_STRIP: 5, + GL_TRIANGLE_FAN: 6, + }, + errorType: { + GLU_TESS_MISSING_BEGIN_POLYGON: 100151, + GLU_TESS_MISSING_END_POLYGON: 100153, + GLU_TESS_MISSING_BEGIN_CONTOUR: 100152, + GLU_TESS_MISSING_END_CONTOUR: 100154, + GLU_TESS_COORD_TOO_LARGE: 100155, + GLU_TESS_NEED_COMBINE_CALLBACK: 100156, + }, + gluEnum: { + GLU_TESS_MESH: 100112, + GLU_TESS_TOLERANCE: 100142, + GLU_TESS_WINDING_RULE: 100140, + GLU_TESS_BOUNDARY_ONLY: 100141, + GLU_INVALID_ENUM: 100900, + GLU_INVALID_VALUE: 100901, + GLU_TESS_BEGIN: 100100, + GLU_TESS_VERTEX: 100101, + GLU_TESS_END: 100102, + GLU_TESS_ERROR: 100103, + GLU_TESS_EDGE_FLAG: 100104, + GLU_TESS_COMBINE: 100105, + GLU_TESS_BEGIN_DATA: 100106, + GLU_TESS_VERTEX_DATA: 100107, + GLU_TESS_END_DATA: 100108, + GLU_TESS_ERROR_DATA: 100109, + GLU_TESS_EDGE_FLAG_DATA: 100110, + GLU_TESS_COMBINE_DATA: 100111, + }, + }), + (r.prototype.gluDeleteTess = r.prototype.x), + (r.prototype.gluTessProperty = r.prototype.B), + (r.prototype.gluGetTessProperty = r.prototype.y), + (r.prototype.gluTessNormal = r.prototype.A), + (r.prototype.gluTessCallback = r.prototype.z), + (r.prototype.gluTessVertex = r.prototype.C), + (r.prototype.gluTessBeginPolygon = r.prototype.u), + (r.prototype.gluTessBeginContour = r.prototype.t), + (r.prototype.gluTessEndContour = r.prototype.v), + (r.prototype.gluTessEndPolygon = r.prototype.w), + void 0 !== e && (e.exports = this.libtess); + }, + {}, + ], + 248: [ + function (e, t, r) { + "use strict"; + function o(g, e, t, r) { + var v = 0, + o = 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 < e || 65535 < t) + throw new Error("Width/Height invalid."); + function j(e) { + e = e.length; + if (e < 2 || 256 < e || e & (e - 1)) + throw new Error( + "Invalid code/color length, must be power of 2 and 2 .. 256.", + ); + return e; + } + (g[v++] = 71), + (g[v++] = 73), + (g[v++] = 70), + (g[v++] = 56), + (g[v++] = 57), + (g[v++] = 97); + var n = 0, + s = 0; + if (null !== b) { + for (var i = j(b); (i >>= 1); ) ++n; + if (((i = 1 << n), --n, void 0 !== r.background)) { + if (i <= (s = r.background)) + throw new Error("Background index out of range."); + if (0 === s) + throw new Error("Background index explicitly passed as 0."); + } + } + if ( + ((g[v++] = 255 & e), + (g[v++] = (e >> 8) & 255), + (g[v++] = 255 & t), + (g[v++] = (t >> 8) & 255), + (g[v++] = (null !== b ? 128 : 0) | n), + (g[v++] = s), + (g[v++] = 0), + null !== b) + ) + for (var a = 0, l = b.length; a < l; ++a) { + var u = b[a]; + (g[v++] = (u >> 16) & 255), + (g[v++] = (u >> 8) & 255), + (g[v++] = 255 & u); + } + if (null !== o) { + if (o < 0 || 65535 < o) throw new Error("Loop count invalid."); + (g[v++] = 33), + (g[v++] = 255), + (g[v++] = 11), + (g[v++] = 78), + (g[v++] = 69), + (g[v++] = 84), + (g[v++] = 83), + (g[v++] = 67), + (g[v++] = 65), + (g[v++] = 80), + (g[v++] = 69), + (g[v++] = 50), + (g[v++] = 46), + (g[v++] = 48), + (g[v++] = 3), + (g[v++] = 1), + (g[v++] = 255 & o), + (g[v++] = (o >> 8) & 255), + (g[v++] = 0); + } + var _ = !1; + (this.addFrame = function (e, t, r, o, n, s) { + if ( + (!0 === _ && (--v, (_ = !1)), + (s = void 0 === s ? {} : s), + e < 0 || t < 0 || 65535 < e || 65535 < t) + ) + throw new Error("x/y invalid."); + if (r <= 0 || o <= 0 || 65535 < r || 65535 < o) + throw new Error("Width/Height invalid."); + if (n.length < r * o) + throw new Error("Not enough pixels for the frame size."); + var i = !0, + a = s.palette; + if ((null == a && ((i = !1), (a = b)), null == a)) + throw new Error( + "Must supply either a local or global palette.", + ); + for (var l = j(a), u = 0; (l >>= 1); ) ++u; + var l = 1 << u, + c = void 0 === s.delay ? 0 : s.delay, + d = void 0 === s.disposal ? 0 : s.disposal; + if (d < 0 || 3 < d) throw new Error("Disposal out of range."); + var h = !1, + f = 0; + if ( + void 0 !== s.transparent && + null !== s.transparent && + ((h = !0), (f = s.transparent) < 0 || l <= f) + ) + throw new Error("Transparent color index."); + if ( + ((0 === d && !h && 0 === c) || + ((g[v++] = 33), + (g[v++] = 249), + (g[v++] = 4), + (g[v++] = (d << 2) | (!0 === h ? 1 : 0)), + (g[v++] = 255 & c), + (g[v++] = (c >> 8) & 255), + (g[v++] = f), + (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 & o), + (g[v++] = (o >> 8) & 255), + (g[v++] = !0 === i ? 128 | (u - 1) : 0), + !0 === i) + ) + for (var p = 0, m = a.length; p < m; ++p) { + var y = a[p]; + (g[v++] = (y >> 16) & 255), + (g[v++] = (y >> 8) & 255), + (g[v++] = 255 & y); + } + return (v = (function (t, r, e, o) { + t[r++] = e; + var n = r++, + s = 1 << e, + i = s - 1, + a = 1 + s, + l = 1 + a, + u = e + 1, + c = 0, + d = 0; + function h(e) { + for (; e <= c; ) + (t[r++] = 255 & d), + (d >>= 8), + (c -= 8), + r === n + 256 && ((t[n] = 255), (n = r++)); + } + function f(e) { + (d |= e << c), (c += u), h(8); + } + var p = o[0] & i, + m = {}; + f(s); + for (var y = 1, g = o.length; y < g; ++y) { + var v = o[y] & i, + b = (p << 8) | v, + j = m[b]; + if (void 0 === j) { + for (d |= p << c, c += u; 8 <= c; ) + (t[r++] = 255 & d), + (d >>= 8), + (c -= 8), + r === n + 256 && ((t[n] = 255), (n = r++)); + 4096 === l + ? (f(s), (l = 1 + a), (u = e + 1), (m = {})) + : (1 << u <= l && ++u, (m[b] = l++)), + (p = v); + } else p = j; + } + f(p), + f(a), + h(1), + n + 1 === r ? (t[n] = 0) : ((t[n] = r - n - 1), (t[r++] = 0)); + return r; + })(g, v, u < 2 ? 2 : u, n)); + }), + (this.end = function () { + return !1 === _ && ((g[v++] = 59), (_ = !0)), v; + }), + (this.getOutputBuffer = function () { + return g; + }), + (this.setOutputBuffer = function (e) { + g = e; + }), + (this.getOutputBufferPosition = function () { + return v; + }), + (this.setOutputBufferPosition = function (e) { + v = e; + }); + } + function M(e, t, r, o) { + for ( + var n = e[t++], + s = 1 << n, + i = 1 + s, + a = 1 + i, + l = n + 1, + u = (1 << l) - 1, + c = 0, + d = 0, + h = 0, + f = e[t++], + p = new Int32Array(4096), + m = null; + ; + + ) { + for (; c < 16 && 0 !== f; ) + (d |= e[t++] << c), (c += 8), 1 === f ? (f = e[t++]) : --f; + if (c < l) break; + var y = d & u; + if (((d >>= l), (c -= l), y == s)) + (a = 1 + i), (u = (1 << (l = n + 1)) - 1), (m = null); + else { + if (y == i) break; + for (var g = y < a ? y : m, v = 0, b = g; s < b; ) + (b = p[b] >> 8), ++v; + var j = b; + if (o < h + v + (g !== y ? 1 : 0)) + return void console.log( + "Warning, gif stream longer than expected.", + ); + r[h++] = j; + var _ = (h += v); + for (g !== y && (r[h++] = j), b = g; v--; ) + (b = p[b]), (r[--_] = 255 & b), (b >>= 8); + null !== m && + a < 4096 && + ((p[a++] = (m << 8) | j), + u + 1 <= a && l < 12 && (++l, (u = (u << 1) | 1))), + (m = y); + } + } + h !== o && + console.log("Warning, gif stream shorter than expected."); + } + try { + (r.GifWriter = o), + (r.GifReader = function (b) { + var e = 0; + if ( + 71 !== b[e++] || + 73 !== b[e++] || + 70 !== b[e++] || + 56 !== b[e++] || + 56 != ((b[e++] + 1) & 253) || + 97 !== b[e++] + ) + throw new Error("Invalid GIF 87a/89a header."); + var j = b[e++] | (b[e++] << 8), + t = b[e++] | (b[e++] << 8), + r = b[e++], + o = 1 << (1 + (7 & r)), + n = (b[e++], b[e++], null), + s = null, + i = (r >> 7 && ((n = e), (e += 3 * (s = o))), !0), + a = [], + l = 0, + u = null, + c = 0, + d = null; + for (this.width = j, this.height = t; i && e < b.length; ) + switch (b[e++]) { + case 33: + switch (b[e++]) { + case 255: + if ( + 11 !== b[e] || + (78 == b[e + 1] && + 69 == b[e + 2] && + 84 == b[e + 3] && + 83 == b[e + 4] && + 67 == b[e + 5] && + 65 == b[e + 6] && + 80 == b[e + 7] && + 69 == b[e + 8] && + 50 == b[e + 9] && + 46 == b[e + 10] && + 48 == b[e + 11] && + 3 == b[e + 12] && + 1 == b[e + 13] && + 0 == b[e + 16]) + ) + (e += 14), (d = b[e++] | (b[e++] << 8)), e++; + else + for (e += 12; ; ) { + if (!(0 <= (f = b[e++]))) + throw Error("Invalid block size"); + if (0 === f) break; + e += f; + } + break; + case 249: + if (4 !== b[e++] || 0 !== b[e + 4]) + throw new Error( + "Invalid graphics extension block.", + ); + var h = b[e++], + l = b[e++] | (b[e++] << 8), + u = b[e++]; + 0 == (1 & h) && (u = null), (c = (h >> 2) & 7), e++; + break; + case 254: + for (;;) { + if (!(0 <= (f = b[e++]))) + throw Error("Invalid block size"); + if (0 === f) break; + e += f; + } + break; + default: + throw new Error( + "Unknown graphic control label: 0x" + + b[e - 1].toString(16), + ); + } + break; + case 44: + var f, + p = b[e++] | (b[e++] << 8), + m = b[e++] | (b[e++] << 8), + y = b[e++] | (b[e++] << 8), + g = b[e++] | (b[e++] << 8), + v = b[e++], + _ = (v >> 6) & 1, + x = 1 << (1 + (7 & v)), + w = n, + S = s, + T = !1, + v = + (v >> 7 && ((T = !0), (w = e), (e += 3 * (S = x))), + e); + for (e++; ; ) { + if (!(0 <= (f = b[e++]))) + throw Error("Invalid block size"); + if (0 === f) break; + e += f; + } + a.push({ + x: p, + y: m, + width: y, + height: g, + has_local_palette: T, + palette_offset: w, + palette_size: S, + data_offset: v, + data_length: e - v, + transparent_index: u, + interlaced: !!_, + delay: l, + disposal: c, + }); + break; + case 59: + i = !1; + break; + default: + throw new Error( + "Unknown gif block: 0x" + b[e - 1].toString(16), + ); + } + (this.numFrames = function () { + return a.length; + }), + (this.loopCount = function () { + return d; + }), + (this.frameInfo = function (e) { + if (e < 0 || e >= a.length) + throw new Error("Frame index out of range."); + return a[e]; + }), + (this.decodeAndBlitFrameBGRA = function (e, t) { + for ( + var e = this.frameInfo(e), + r = e.width * e.height, + o = new Uint8Array(r), + n = (M(b, e.data_offset, o, r), e.palette_offset), + s = e.transparent_index, + i = (null === s && (s = 256), e.width), + a = j - i, + l = i, + u = 4 * (e.y * j + e.x), + c = 4 * ((e.y + e.height) * j + e.x), + d = u, + h = 4 * a, + f = (!0 === e.interlaced && (h += 4 * j * 7), 8), + p = 0, + m = o.length; + p < m; + ++p + ) { + var y, + g, + v = o[p]; + 0 === l && + ((l = i), + c <= (d += h) && + ((h = 4 * a + 4 * j * (f - 1)), + (d = u + (i + a) * (f << 1)), + (f >>= 1))), + v === s + ? (d += 4) + : ((y = b[n + 3 * v]), + (g = b[n + 3 * v + 1]), + (v = b[n + 3 * v + 2]), + (t[d++] = v), + (t[d++] = g), + (t[d++] = y), + (t[d++] = 255)), + --l; + } + }), + (this.decodeAndBlitFrameRGBA = function (e, t) { + for ( + var e = this.frameInfo(e), + r = e.width * e.height, + o = new Uint8Array(r), + n = (M(b, e.data_offset, o, r), e.palette_offset), + s = e.transparent_index, + i = (null === s && (s = 256), e.width), + a = j - i, + l = i, + u = 4 * (e.y * j + e.x), + c = 4 * ((e.y + e.height) * j + e.x), + d = u, + h = 4 * a, + f = (!0 === e.interlaced && (h += 4 * j * 7), 8), + p = 0, + m = o.length; + p < m; + ++p + ) { + var y, + g, + v = o[p]; + 0 === l && + ((l = i), + c <= (d += h) && + ((h = 4 * a + 4 * j * (f - 1)), + (d = u + (i + a) * (f << 1)), + (f >>= 1))), + v === s + ? (d += 4) + : ((y = b[n + 3 * v]), + (g = b[n + 3 * v + 1]), + (v = b[n + 3 * v + 2]), + (t[d++] = y), + (t[d++] = g), + (t[d++] = v), + (t[d++] = 255)), + --l; + } + }); + }); + } catch (e) {} + }, + {}, + ], + 249: [ + function (Ar, r, o) { + !function (Pr) { + var e, t; + (e = this), + (t = function (j) { + "use strict"; + function D(e) { + if (null == this) throw TypeError(); + var t, + r = String(this), + o = r.length, + e = e ? Number(e) : 0; + if (!((e = e != e ? 0 : e) < 0 || o <= e)) + return 55296 <= (t = r.charCodeAt(e)) && + t <= 56319 && + e + 1 < o && + 56320 <= (o = r.charCodeAt(e + 1)) && + o <= 57343 + ? 1024 * (t - 55296) + o - 56320 + 65536 + : t; + } + String.prototype.codePointAt || + ((F = (function () { + try { + var e = {}, + t = Object.defineProperty, + r = t(e, e, e) && t; + } catch (e) {} + return r; + })()) + ? F(String.prototype, "codePointAt", { + value: D, + configurable: !0, + writable: !0, + }) + : (String.prototype.codePointAt = D)); + var F, + U = 0, + N = -3; + function B() { + (this.table = new Uint16Array(16)), + (this.trans = new Uint16Array(288)); + } + function G(e, t) { + (this.source = e), + (this.sourceIndex = 0), + (this.tag = 0), + (this.bitcount = 0), + (this.dest = t), + (this.destLen = 0), + (this.ltree = new B()), + (this.dtree = new B()); + } + var V = new B(), + z = new B(), + H = new Uint8Array(30), + W = new Uint16Array(30), + q = new Uint8Array(30), + X = new Uint16Array(30), + Y = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, + 1, 15, + ]), + Z = new B(), + v = new Uint8Array(320); + function Q(e, t, r, o) { + for (var n, s = 0; s < r; ++s) e[s] = 0; + for (s = 0; s < 30 - r; ++s) e[s + r] = (s / r) | 0; + for (n = o, s = 0; s < 30; ++s) (t[s] = n), (n += 1 << e[s]); + } + var J = new Uint16Array(16); + function K(e, t, r, o) { + for (var n, s = 0; s < 16; ++s) e.table[s] = 0; + for (s = 0; s < o; ++s) e.table[t[r + s]]++; + for (s = n = e.table[0] = 0; s < 16; ++s) + (J[s] = n), (n += e.table[s]); + for (s = 0; s < o; ++s) + t[r + s] && (e.trans[J[t[r + s]]++] = s); + } + function b(e, t, r) { + if (!t) return r; + for (; e.bitcount < 24; ) + (e.tag |= e.source[e.sourceIndex++] << e.bitcount), + (e.bitcount += 8); + var o = e.tag & (65535 >>> (16 - t)); + return (e.tag >>>= t), (e.bitcount -= t), o + r; + } + function $(e, t) { + for (; e.bitcount < 24; ) + (e.tag |= e.source[e.sourceIndex++] << e.bitcount), + (e.bitcount += 8); + for ( + var r = 0, o = 0, n = 0, s = e.tag; + (o = 2 * o + (1 & s)), + (s >>>= 1), + (r += t.table[++n]), + 0 <= (o -= t.table[n]); + + ); + return (e.tag = s), (e.bitcount -= n), t.trans[r + o]; + } + function ee(e, t, r) { + for (;;) { + var o = $(e, t); + if (256 === o) return U; + if (o < 256) e.dest[e.destLen++] = o; + else + for ( + var n, + s = b(e, H[(o -= 257)], W[o]), + o = $(e, r), + i = (n = e.destLen - b(e, q[o], X[o])); + i < n + s; + ++i + ) + e.dest[e.destLen++] = e.dest[i]; + } + } + for (var e = V, te = z, t = 0; t < 7; ++t) e.table[t] = 0; + for ( + e.table[7] = 24, e.table[8] = 152, e.table[9] = 112, t = 0; + t < 24; + ++t + ) + e.trans[t] = 256 + t; + for (t = 0; t < 144; ++t) e.trans[24 + t] = t; + for (t = 0; t < 8; ++t) e.trans[168 + t] = 280 + t; + for (t = 0; t < 112; ++t) e.trans[176 + t] = 144 + t; + for (t = 0; t < 5; ++t) te.table[t] = 0; + for (te.table[5] = 32, t = 0; t < 32; ++t) te.trans[t] = t; + Q(H, W, 4, 3), Q(q, X, 2, 1), (H[28] = 0), (W[28] = 258); + var re = function (e, t) { + var r, + o, + n, + s = new G(e, t); + do { + switch ( + ((n = void 0), + (o = s).bitcount-- || + ((o.tag = o.source[o.sourceIndex++]), (o.bitcount = 7)), + (n = 1 & o.tag), + (o.tag >>>= 1), + (o = n), + b(s, 2, 0)) + ) { + case 0: + r = (function (e) { + for (var t, r; 8 < e.bitcount; ) + e.sourceIndex--, (e.bitcount -= 8); + if ( + (t = + 256 * e.source[e.sourceIndex + 1] + + e.source[e.sourceIndex]) !== + (65535 & + ~( + 256 * e.source[e.sourceIndex + 3] + + e.source[e.sourceIndex + 2] + )) + ) + return N; + for (e.sourceIndex += 4, r = t; r; --r) + e.dest[e.destLen++] = e.source[e.sourceIndex++]; + return (e.bitcount = 0), U; + })(s); + break; + case 1: + r = ee(s, V, z); + break; + case 2: + y = m = p = g = i = f = h = d = c = u = l = a = void 0; + for ( + var i, + a = s, + l = s.ltree, + u = s.dtree, + c = b(a, 5, 257), + d = b(a, 5, 1), + h = b(a, 4, 4), + f = 0; + f < 19; + ++f + ) + v[f] = 0; + for (f = 0; f < h; ++f) { + var p = b(a, 3, 0); + v[Y[f]] = p; + } + for (K(Z, v, 0, 19), i = 0; i < c + d; ) { + var m = $(a, Z); + switch (m) { + case 16: + for (var y = v[i - 1], g = b(a, 2, 3); g; --g) + v[i++] = y; + break; + case 17: + for (g = b(a, 3, 3); g; --g) v[i++] = 0; + break; + case 18: + for (g = b(a, 7, 11); g; --g) v[i++] = 0; + break; + default: + v[i++] = m; + } + } + K(l, v, 0, c), + K(u, v, c, d), + (r = ee(s, s.ltree, s.dtree)); + break; + default: + r = N; + } + if (r !== U) throw new Error("Data error"); + } while (!o); + return s.destLen < s.dest.length + ? "function" == typeof s.dest.slice + ? s.dest.slice(0, s.destLen) + : s.dest.subarray(0, s.destLen) + : s.dest; + }; + function g(e, t, r, o, n) { + return ( + Math.pow(1 - n, 3) * e + + 3 * Math.pow(1 - n, 2) * n * t + + 3 * (1 - n) * Math.pow(n, 2) * r + + Math.pow(n, 3) * o + ); + } + function a() { + (this.x1 = Number.NaN), + (this.y1 = Number.NaN), + (this.x2 = Number.NaN), + (this.y2 = Number.NaN); + } + function h() { + (this.commands = []), + (this.fill = "black"), + (this.stroke = null), + (this.strokeWidth = 1); + } + function oe(e) { + throw new Error(e); + } + function ne(e, t) { + e || oe(t); + } + (a.prototype.isEmpty = function () { + return ( + isNaN(this.x1) || + isNaN(this.y1) || + isNaN(this.x2) || + isNaN(this.y2) + ); + }), + (a.prototype.addPoint = function (e, t) { + "number" == typeof e && + ((isNaN(this.x1) || isNaN(this.x2)) && + ((this.x1 = e), (this.x2 = e)), + e < this.x1 && (this.x1 = e), + e > this.x2 && (this.x2 = e)), + "number" == typeof t && + ((isNaN(this.y1) || isNaN(this.y2)) && + ((this.y1 = t), (this.y2 = t)), + t < this.y1 && (this.y1 = t), + t > this.y2 && (this.y2 = t)); + }), + (a.prototype.addX = function (e) { + this.addPoint(e, null); + }), + (a.prototype.addY = function (e) { + this.addPoint(null, e); + }), + (a.prototype.addBezier = function (e, t, r, o, n, s, i, a) { + var l = [e, t], + u = [r, o], + c = [n, s], + d = [i, a]; + this.addPoint(e, t), this.addPoint(i, a); + for (var h = 0; h <= 1; h++) { + var f, + p = 6 * l[h] - 12 * u[h] + 6 * c[h], + m = -3 * l[h] + 9 * u[h] - 9 * c[h] + 3 * d[h], + y = 3 * u[h] - 3 * l[h]; + 0 == m + ? 0 == p || + (0 < (f = -y / p) && + f < 1 && + (0 === h && this.addX(g(l[h], u[h], c[h], d[h], f)), + 1 === h && this.addY(g(l[h], u[h], c[h], d[h], f)))) + : (f = Math.pow(p, 2) - 4 * y * m) < 0 || + (0 < (y = (-p + Math.sqrt(f)) / (2 * m)) && + y < 1 && + (0 === h && this.addX(g(l[h], u[h], c[h], d[h], y)), + 1 === h && this.addY(g(l[h], u[h], c[h], d[h], y))), + 0 < (y = (-p - Math.sqrt(f)) / (2 * m)) && + y < 1 && + (0 === h && this.addX(g(l[h], u[h], c[h], d[h], y)), + 1 === h && + this.addY(g(l[h], u[h], c[h], d[h], y)))); + } + }), + (a.prototype.addQuad = function (e, t, r, o, n, s) { + (r = e + (2 / 3) * (r - e)), (o = t + (2 / 3) * (o - t)); + this.addBezier( + e, + t, + r, + o, + r + (1 / 3) * (n - e), + o + (1 / 3) * (s - t), + n, + s, + ); + }), + (h.prototype.moveTo = function (e, t) { + this.commands.push({ type: "M", x: e, y: t }); + }), + (h.prototype.lineTo = function (e, t) { + this.commands.push({ type: "L", x: e, y: t }); + }), + (h.prototype.curveTo = h.prototype.bezierCurveTo = + function (e, t, r, o, n, s) { + this.commands.push({ + type: "C", + x1: e, + y1: t, + x2: r, + y2: o, + x: n, + y: s, + }); + }), + (h.prototype.quadTo = h.prototype.quadraticCurveTo = + function (e, t, r, o) { + this.commands.push({ + type: "Q", + x1: e, + y1: t, + x: r, + y: o, + }); + }), + (h.prototype.close = h.prototype.closePath = + function () { + this.commands.push({ type: "Z" }); + }), + (h.prototype.extend = function (e) { + var t; + if (e.commands) e = e.commands; + else if (e instanceof a) + return ( + (t = e), + this.moveTo(t.x1, t.y1), + this.lineTo(t.x2, t.y1), + this.lineTo(t.x2, t.y2), + this.lineTo(t.x1, t.y2), + void this.close() + ); + Array.prototype.push.apply(this.commands, e); + }), + (h.prototype.getBoundingBox = function () { + for ( + var e = new a(), t = 0, r = 0, o = 0, n = 0, s = 0; + s < this.commands.length; + s++ + ) { + var i = this.commands[s]; + switch (i.type) { + case "M": + e.addPoint(i.x, i.y), (t = o = i.x), (r = n = i.y); + break; + case "L": + e.addPoint(i.x, i.y), (o = i.x), (n = i.y); + break; + case "Q": + e.addQuad(o, n, i.x1, i.y1, i.x, i.y), + (o = i.x), + (n = i.y); + break; + case "C": + e.addBezier(o, n, i.x1, i.y1, i.x2, i.y2, i.x, i.y), + (o = i.x), + (n = i.y); + break; + case "Z": + (o = t), (n = r); + break; + default: + throw new Error("Unexpected path command " + i.type); + } + } + return e.isEmpty() && e.addPoint(0, 0), e; + }), + (h.prototype.draw = function (e) { + e.beginPath(); + for (var t = 0; t < this.commands.length; t += 1) { + var r = this.commands[t]; + "M" === r.type + ? e.moveTo(r.x, r.y) + : "L" === r.type + ? e.lineTo(r.x, r.y) + : "C" === r.type + ? e.bezierCurveTo(r.x1, r.y1, r.x2, r.y2, r.x, r.y) + : "Q" === r.type + ? e.quadraticCurveTo(r.x1, r.y1, r.x, r.y) + : "Z" === r.type && e.closePath(); + } + this.fill && ((e.fillStyle = this.fill), e.fill()), + this.stroke && + ((e.strokeStyle = this.stroke), + (e.lineWidth = this.strokeWidth), + e.stroke()); + }), + (h.prototype.toPathData = function (n) { + function e() { + for ( + var e = arguments, t = "", r = 0; + r < arguments.length; + r += 1 + ) { + var o = e[r]; + 0 <= o && 0 < r && (t += " "), + (t += + ((o = o), + Math.round(o) === o + ? "" + Math.round(o) + : o.toFixed(n))); + } + return t; + } + n = void 0 !== n ? n : 2; + for (var t = "", r = 0; r < this.commands.length; r += 1) { + var o = this.commands[r]; + "M" === o.type + ? (t += "M" + e(o.x, o.y)) + : "L" === o.type + ? (t += "L" + e(o.x, o.y)) + : "C" === o.type + ? (t += "C" + e(o.x1, o.y1, o.x2, o.y2, o.x, o.y)) + : "Q" === o.type + ? (t += "Q" + e(o.x1, o.y1, o.x, o.y)) + : "Z" === o.type && (t += "Z"); + } + return t; + }), + (h.prototype.toSVG = function (e) { + var t = (t = '> 8) & 255, 255 & e]; + }), + (l.USHORT = r(2)), + (w.SHORT = function (e) { + return [ + ((e = 32768 <= e ? -(65536 - e) : e) >> 8) & 255, + 255 & e, + ]; + }), + (l.SHORT = r(2)), + (w.UINT24 = function (e) { + return [(e >> 16) & 255, (e >> 8) & 255, 255 & e]; + }), + (l.UINT24 = r(3)), + (w.ULONG = function (e) { + return [ + (e >> 24) & 255, + (e >> 16) & 255, + (e >> 8) & 255, + 255 & e, + ]; + }), + (l.ULONG = r(4)), + (w.LONG = function (e) { + return [ + ((e = 2147483648 <= e ? -(4294967296 - e) : e) >> 24) & + 255, + (e >> 16) & 255, + (e >> 8) & 255, + 255 & e, + ]; + }), + (l.LONG = r(4)), + (w.FIXED = w.ULONG), + (l.FIXED = l.ULONG), + (w.FWORD = w.SHORT), + (l.FWORD = l.SHORT), + (w.UFWORD = w.USHORT), + (l.UFWORD = l.USHORT), + (w.LONGDATETIME = function (e) { + return [ + 0, + 0, + 0, + 0, + (e >> 24) & 255, + (e >> 16) & 255, + (e >> 8) & 255, + 255 & e, + ]; + }), + (l.LONGDATETIME = r(8)), + (w.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), + ] + ); + }), + (l.TAG = r(4)), + (w.Card8 = w.BYTE), + (l.Card8 = l.BYTE), + (w.Card16 = w.USHORT), + (l.Card16 = l.USHORT), + (w.OffSize = w.BYTE), + (l.OffSize = l.BYTE), + (w.SID = w.USHORT), + (l.SID = l.USHORT), + (w.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 + ? w.NUMBER16(e) + : w.NUMBER32(e); + }), + (l.NUMBER = function (e) { + return w.NUMBER(e).length; + }), + (w.NUMBER16 = function (e) { + return [28, (e >> 8) & 255, 255 & e]; + }), + (l.NUMBER16 = r(3)), + (w.NUMBER32 = function (e) { + return [ + 29, + (e >> 24) & 255, + (e >> 16) & 255, + (e >> 8) & 255, + 255 & e, + ]; + }), + (l.NUMBER32 = r(5)), + (w.REAL = function (e) { + for ( + var t = e.toString(), + r = + /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec( + t, + ), + o = + (r && + ((r = parseFloat( + "1e" + ((r[2] ? +r[2] : 0) + r[1].length), + )), + (t = (Math.round(e * r) / r).toString())), + ""), + n = 0, + s = t.length; + n < s; + n += 1 + ) { + var i = t[n]; + o += + "e" === i + ? "-" === t[++n] + ? "c" + : "b" + : "." === i + ? "a" + : "-" === i + ? "e" + : i; + } + for ( + var a = [30], + l = 0, + u = (o += 1 & o.length ? "f" : "ff").length; + l < u; + l += 2 + ) + a.push(parseInt(o.substr(l, 2), 16)); + return a; + }), + (l.REAL = function (e) { + return w.REAL(e).length; + }), + (w.NAME = w.CHARARRAY), + (l.NAME = l.CHARARRAY), + (w.STRING = w.CHARARRAY), + (l.STRING = l.CHARARRAY), + (m.UTF8 = function (e, t, r) { + for (var o = [], n = r, s = 0; s < n; s++, t += 1) + o[s] = e.getUint8(t); + return String.fromCharCode.apply(null, o); + }), + (m.UTF16 = function (e, t, r) { + for (var o = [], n = r / 2, s = 0; s < n; s++, t += 2) + o[s] = e.getUint16(t); + return String.fromCharCode.apply(null, o); + }), + (w.UTF16 = function (e) { + for (var t = [], r = 0; r < e.length; r += 1) { + var o = e.charCodeAt(r); + (t[t.length] = (o >> 8) & 255), (t[t.length] = 255 & o); + } + return t; + }), + (l.UTF16 = function (e) { + return 2 * e.length; + }); + var se, + ie = { + "x-mac-croatian": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ", + "x-mac-cyrillic": + "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю", + "x-mac-gaelic": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ", + "x-mac-greek": + "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­", + "x-mac-icelandic": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", + "x-mac-inuit": + "ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł", + "x-mac-ce": + "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", + macintosh: + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", + "x-mac-romanian": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", + "x-mac-turkish": + "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ", + }, + ae = + ((m.MACSTRING = function (e, t, r, o) { + var n = ie[o]; + if (void 0 !== n) { + for (var s = "", i = 0; i < r; i++) { + var a = e.getUint8(t + i); + s += a <= 127 ? String.fromCharCode(a) : n[127 & a]; + } + return s; + } + }), + "function" == typeof WeakMap && new WeakMap()); + function le(e) { + return -128 <= e && e <= 127; + } + (w.MACSTRING = function (e, t) { + var r = (function (e) { + if (!se) + for (var t in ((se = {}), ie)) se[t] = new String(t); + var r = se[e]; + if (void 0 !== r) { + if (ae) { + var o = ae.get(r); + if (void 0 !== o) return o; + } + var n = ie[e]; + if (void 0 !== n) { + for (var s = {}, i = 0; i < n.length; i++) + s[n.charCodeAt(i)] = i + 128; + return ae && ae.set(r, s), s; + } + } + })(t); + if (void 0 !== r) { + for (var o = [], n = 0; n < e.length; n++) { + var s = e.charCodeAt(n); + if (128 <= s && void 0 === (s = r[s])) return; + o[n] = s; + } + return o; + } + }), + (l.MACSTRING = function (e, t) { + e = w.MACSTRING(e, t); + return void 0 !== e ? e.length : 0; + }), + (w.VARDELTAS = function (e) { + for (var t = 0, r = []; t < e.length; ) + var o = e[t], + t = ( + 0 === o + ? function (e, t, r) { + for ( + var o = 0, n = e.length; + t < n && o < 64 && 0 === e[t]; + + ) + ++t, ++o; + return r.push(128 | (o - 1)), t; + } + : -128 <= o && o <= 127 + ? function (e, t, r) { + for ( + var o = 0, n = e.length, s = t; + s < n && o < 64; + + ) { + var i = e[s]; + if (!le(i)) break; + if (0 === i && s + 1 < n && 0 === e[s + 1]) + break; + ++s, ++o; + } + r.push(o - 1); + for (var a = t; a < s; ++a) + r.push((e[a] + 256) & 255); + return s; + } + : function (e, t, r) { + for ( + var o = 0, n = e.length, s = t; + s < n && o < 64; + + ) { + var i = e[s]; + if (0 === i) break; + if (le(i) && s + 1 < n && le(e[s + 1])) + break; + ++s, ++o; + } + r.push(64 | (o - 1)); + for (var a = t; a < s; ++a) { + var l = e[a]; + r.push( + ((l + 65536) >> 8) & 255, + (l + 256) & 255, + ); + } + return s; + } + )(e, t, r); + return r; + }), + (w.INDEX = function (e) { + for ( + var t = 1, r = [t], o = [], n = 0; + n < e.length; + n += 1 + ) { + var s = w.OBJECT(e[n]); + Array.prototype.push.apply(o, s), + (t += s.length), + r.push(t); + } + if (0 === o.length) return [0, 0]; + for ( + var i = [], + a = (1 + Math.floor(Math.log(t) / Math.log(2)) / 8) | 0, + l = [void 0, w.BYTE, w.USHORT, w.UINT24, w.ULONG][a], + u = 0; + u < r.length; + u += 1 + ) { + var c = l(r[u]); + Array.prototype.push.apply(i, c); + } + return Array.prototype.concat( + w.Card16(e.length), + w.OffSize(a), + i, + o, + ); + }), + (l.INDEX = function (e) { + return w.INDEX(e).length; + }), + (w.DICT = function (e) { + for ( + var t = [], r = Object.keys(e), o = r.length, n = 0; + n < o; + n += 1 + ) { + var s = parseInt(r[n], 0), + i = e[s]; + t = (t = t.concat(w.OPERAND(i.value, i.type))).concat( + w.OPERATOR(s), + ); + } + return t; + }), + (l.DICT = function (e) { + return w.DICT(e).length; + }), + (w.OPERATOR = function (e) { + return e < 1200 ? [e] : [12, e - 1200]; + }), + (w.OPERAND = function (e, t) { + var r = []; + if (Array.isArray(t)) + for (var o = 0; o < t.length; o += 1) + L.argument( + e.length === t.length, + "Not enough arguments given for type" + t, + ), + (r = r.concat(w.OPERAND(e[o], t[o]))); + else if ("SID" === t) r = r.concat(w.NUMBER(e)); + else if ("offset" === t) r = r.concat(w.NUMBER32(e)); + else if ("number" === t) r = r.concat(w.NUMBER(e)); + else { + if ("real" !== t) + throw new Error("Unknown operand type " + t); + r = r.concat(w.REAL(e)); + } + return r; + }), + (w.OP = w.BYTE), + (l.OP = l.BYTE); + var ue = "function" == typeof WeakMap && new WeakMap(); + function n(e, t, r) { + for (var o = 0; o < t.length; o += 1) { + var n = t[o]; + this[n.name] = n.value; + } + if (((this.tableName = e), (this.fields = t), r)) + for (var s = Object.keys(r), i = 0; i < s.length; i += 1) { + var a = s[i], + l = r[a]; + void 0 !== this[a] && (this[a] = l); + } + } + function ce(e, t, r) { + void 0 === r && (r = t.length); + var o = new Array(t.length + 1); + o[0] = { name: e + "Count", type: "USHORT", value: r }; + for (var n = 0; n < t.length; n++) + o[n + 1] = { name: e + n, type: "USHORT", value: t[n] }; + return o; + } + function de(e, t, r) { + var o = t.length, + n = new Array(o + 1); + n[0] = { name: e + "Count", type: "USHORT", value: o }; + for (var s = 0; s < o; s++) + n[s + 1] = { + name: e + s, + type: "TABLE", + value: r(t[s], s), + }; + return n; + } + function he(e, t, r) { + var o = t.length, + n = []; + n[0] = { name: e + "Count", type: "USHORT", value: o }; + for (var s = 0; s < o; s++) n = n.concat(r(t[s], s)); + return n; + } + function fe(e) { + 1 === e.format + ? n.call( + this, + "coverageTable", + [ + { name: "coverageFormat", type: "USHORT", value: 1 }, + ].concat(ce("glyph", e.glyphs)), + ) + : L.assert(!1, "Can't create coverage table format 2 yet."); + } + function pe(e) { + n.call( + this, + "scriptListTable", + he("scriptRecord", e, function (e, t) { + var r = e.script, + o = r.defaultLangSys; + return ( + L.assert( + !!o, + "Unable to write GSUB: script " + + e.tag + + " has no default language system.", + ), + [ + { name: "scriptTag" + t, type: "TAG", value: e.tag }, + { + name: "script" + t, + type: "TABLE", + value: new n( + "scriptTable", + [ + { + name: "defaultLangSys", + type: "TABLE", + value: new n( + "defaultLangSys", + [ + { + name: "lookupOrder", + type: "USHORT", + value: 0, + }, + { + name: "reqFeatureIndex", + type: "USHORT", + value: o.reqFeatureIndex, + }, + ].concat( + ce("featureIndex", o.featureIndexes), + ), + ), + }, + ].concat( + he( + "langSys", + r.langSysRecords, + function (e, t) { + var r = e.langSys; + return [ + { + name: "langSysTag" + t, + type: "TAG", + value: e.tag, + }, + { + name: "langSys" + t, + type: "TABLE", + value: new n( + "langSys", + [ + { + name: "lookupOrder", + type: "USHORT", + value: 0, + }, + { + name: "reqFeatureIndex", + type: "USHORT", + value: r.reqFeatureIndex, + }, + ].concat( + ce( + "featureIndex", + r.featureIndexes, + ), + ), + ), + }, + ]; + }, + ), + ), + ), + }, + ] + ); + }), + ); + } + function me(e) { + n.call( + this, + "featureListTable", + he("featureRecord", e, function (e, t) { + var r = e.feature; + return [ + { name: "featureTag" + t, type: "TAG", value: e.tag }, + { + name: "feature" + t, + type: "TABLE", + value: new n( + "featureTable", + [ + { + name: "featureParams", + type: "USHORT", + value: r.featureParams, + }, + ].concat( + ce("lookupListIndex", r.lookupListIndexes), + ), + ), + }, + ]; + }), + ); + } + function ye(e, r) { + n.call( + this, + "lookupListTable", + de("lookup", e, function (e) { + var t = r[e.lookupType]; + return ( + L.assert( + !!t, + "Unable to write GSUB lookup type " + + e.lookupType + + " tables.", + ), + new n( + "lookupTable", + [ + { + name: "lookupType", + type: "USHORT", + value: e.lookupType, + }, + { + name: "lookupFlag", + type: "USHORT", + value: e.lookupFlag, + }, + ].concat(de("subtable", e.subtables, t)), + ) + ); + }), + ); + } + (w.CHARSTRING = function (e) { + if (ue) { + var t = ue.get(e); + if (void 0 !== t) return t; + } + for (var r = [], o = e.length, n = 0; n < o; n += 1) + var s = e[n], r = r.concat(w[s.type](s.value)); + return ue && ue.set(e, r), r; + }), + (l.CHARSTRING = function (e) { + return w.CHARSTRING(e).length; + }), + (w.OBJECT = function (e) { + var t = w[e.type]; + return ( + L.argument( + void 0 !== t, + "No encoding function for type " + e.type, + ), + t(e.value) + ); + }), + (l.OBJECT = function (e) { + var t = l[e.type]; + return ( + L.argument( + void 0 !== t, + "No sizeOf function for type " + e.type, + ), + t(e.value) + ); + }), + (w.TABLE = function (e) { + for ( + var t = [], r = e.fields.length, o = [], n = [], s = 0; + s < r; + s += 1 + ) { + var i = e.fields[s], + a = w[i.type], + l = + (L.argument( + void 0 !== a, + "No encoding function for field type " + + i.type + + " (" + + i.name + + ")", + ), + e[i.name]), + a = a((l = void 0 === l ? i.value : l)); + "TABLE" === i.type + ? (n.push(t.length), (t = t.concat([0, 0])), o.push(a)) + : (t = t.concat(a)); + } + for (var u = 0; u < o.length; u += 1) { + var c = n[u], + d = t.length; + L.argument( + d < 65536, + "Table " + e.tableName + " too big.", + ), + (t[c] = d >> 8), + (t[c + 1] = 255 & d), + (t = t.concat(o[u])); + } + return t; + }), + (l.TABLE = function (e) { + for (var t = 0, r = e.fields.length, o = 0; o < r; o += 1) { + var n = e.fields[o], + s = l[n.type], + i = + (L.argument( + void 0 !== s, + "No sizeOf function for field type " + + n.type + + " (" + + n.name + + ")", + ), + e[n.name]); + (t += s((i = void 0 === i ? n.value : i))), + "TABLE" === n.type && (t += 2); + } + return t; + }), + (w.RECORD = w.TABLE), + (l.RECORD = l.TABLE), + (w.LITERAL = function (e) { + return e; + }), + (l.LITERAL = function (e) { + return e.length; + }), + (n.prototype.encode = function () { + return w.TABLE(this); + }), + (n.prototype.sizeOf = function () { + return l.TABLE(this); + }); + var S = { + Table: n, + Record: n, + Coverage: ((fe.prototype = Object.create( + n.prototype, + )).constructor = fe), + ScriptList: ((pe.prototype = Object.create( + n.prototype, + )).constructor = pe), + FeatureList: ((me.prototype = Object.create( + n.prototype, + )).constructor = me), + LookupList: ((ye.prototype = Object.create( + n.prototype, + )).constructor = ye), + ushortList: ce, + tableList: de, + recordList: he, + }; + function ge(e, t) { + return e.getUint8(t); + } + function ve(e, t) { + return e.getUint16(t, !1); + } + function be(e, t) { + return e.getUint32(t, !1); + } + function je(e, t) { + return e.getInt16(t, !1) + e.getUint16(t + 2, !1) / 65535; + } + var _e = { + byte: 1, + uShort: 2, + short: 2, + uLong: 4, + fixed: 4, + longDateTime: 8, + tag: 4, + }; + function u(e, t) { + (this.data = e), (this.offset = t), (this.relativeOffset = 0); + } + (u.prototype.parseByte = function () { + var e = this.data.getUint8(this.offset + this.relativeOffset); + return (this.relativeOffset += 1), e; + }), + (u.prototype.parseChar = function () { + var e = this.data.getInt8( + this.offset + this.relativeOffset, + ); + return (this.relativeOffset += 1), e; + }), + (u.prototype.parseCard8 = u.prototype.parseByte), + (u.prototype.parseCard16 = u.prototype.parseUShort = + function () { + var e = this.data.getUint16( + this.offset + this.relativeOffset, + ); + return (this.relativeOffset += 2), e; + }), + (u.prototype.parseSID = u.prototype.parseUShort), + (u.prototype.parseOffset16 = u.prototype.parseUShort), + (u.prototype.parseShort = function () { + var e = this.data.getInt16( + this.offset + this.relativeOffset, + ); + return (this.relativeOffset += 2), e; + }), + (u.prototype.parseF2Dot14 = function () { + var e = + this.data.getInt16(this.offset + this.relativeOffset) / + 16384; + return (this.relativeOffset += 2), e; + }), + (u.prototype.parseOffset32 = u.prototype.parseULong = + function () { + var e = be(this.data, this.offset + this.relativeOffset); + return (this.relativeOffset += 4), e; + }), + (u.prototype.parseFixed = function () { + var e = je(this.data, this.offset + this.relativeOffset); + return (this.relativeOffset += 4), e; + }), + (u.prototype.parseString = function (e) { + var t = this.data, + r = this.offset + this.relativeOffset, + o = ""; + this.relativeOffset += e; + for (var n = 0; n < e; n++) + o += String.fromCharCode(t.getUint8(r + n)); + return o; + }), + (u.prototype.parseTag = function () { + return this.parseString(4); + }), + (u.prototype.parseLongDateTime = function () { + var e = be( + this.data, + this.offset + this.relativeOffset + 4, + ); + return (e -= 2082844800), (this.relativeOffset += 8), e; + }), + (u.prototype.parseVersion = function (e) { + var t = ve(this.data, this.offset + this.relativeOffset), + r = ve(this.data, this.offset + this.relativeOffset + 2); + return ( + (this.relativeOffset += 4), + t + r / (e = void 0 === e ? 4096 : e) / 10 + ); + }), + (u.prototype.skip = function (e, t) { + this.relativeOffset += _e[e] * (t = void 0 === t ? 1 : t); + }), + (u.prototype.parseULongList = function (e) { + void 0 === e && (e = this.parseULong()); + for ( + var t = new Array(e), + r = this.data, + o = this.offset + this.relativeOffset, + n = 0; + n < e; + n++ + ) + (t[n] = r.getUint32(o)), (o += 4); + return (this.relativeOffset += 4 * e), t; + }), + (u.prototype.parseOffset16List = u.prototype.parseUShortList = + function (e) { + void 0 === e && (e = this.parseUShort()); + for ( + var t = new Array(e), + r = this.data, + o = this.offset + this.relativeOffset, + n = 0; + n < e; + n++ + ) + (t[n] = r.getUint16(o)), (o += 2); + return (this.relativeOffset += 2 * e), t; + }), + (u.prototype.parseShortList = function (e) { + for ( + var t = new Array(e), + r = this.data, + o = this.offset + this.relativeOffset, + n = 0; + n < e; + n++ + ) + (t[n] = r.getInt16(o)), (o += 2); + return (this.relativeOffset += 2 * e), t; + }), + (u.prototype.parseByteList = function (e) { + for ( + var t = new Array(e), + r = this.data, + o = this.offset + this.relativeOffset, + n = 0; + n < e; + n++ + ) + t[n] = r.getUint8(o++); + return (this.relativeOffset += e), t; + }), + (u.prototype.parseList = function (e, t) { + t || ((t = e), (e = this.parseUShort())); + for (var r = new Array(e), o = 0; o < e; o++) + r[o] = t.call(this); + return r; + }), + (u.prototype.parseList32 = function (e, t) { + t || ((t = e), (e = this.parseULong())); + for (var r = new Array(e), o = 0; o < e; o++) + r[o] = t.call(this); + return r; + }), + (u.prototype.parseRecordList = function (e, t) { + t || ((t = e), (e = this.parseUShort())); + for ( + var r = new Array(e), o = Object.keys(t), n = 0; + n < e; + n++ + ) { + for (var s = {}, i = 0; i < o.length; i++) { + var a = o[i], + l = t[a]; + s[a] = l.call(this); + } + r[n] = s; + } + return r; + }), + (u.prototype.parseRecordList32 = function (e, t) { + t || ((t = e), (e = this.parseULong())); + for ( + var r = new Array(e), o = Object.keys(t), n = 0; + n < e; + n++ + ) { + for (var s = {}, i = 0; i < o.length; i++) { + var a = o[i], + l = t[a]; + s[a] = l.call(this); + } + r[n] = s; + } + return r; + }), + (u.prototype.parseStruct = function (e) { + if ("function" == typeof e) return e.call(this); + for ( + var t = Object.keys(e), r = {}, o = 0; + o < t.length; + o++ + ) { + var n = t[o], + s = e[n]; + r[n] = s.call(this); + } + return r; + }), + (u.prototype.parseValueRecord = function (e) { + var t; + if (0 !== (e = void 0 === e ? this.parseUShort() : e)) + return ( + (t = {}), + 1 & e && (t.xPlacement = this.parseShort()), + 2 & e && (t.yPlacement = this.parseShort()), + 4 & e && (t.xAdvance = this.parseShort()), + 8 & e && (t.yAdvance = this.parseShort()), + 16 & e && ((t.xPlaDevice = void 0), this.parseShort()), + 32 & e && ((t.yPlaDevice = void 0), this.parseShort()), + 64 & e && ((t.xAdvDevice = void 0), this.parseShort()), + 128 & e && ((t.yAdvDevice = void 0), this.parseShort()), + t + ); + }), + (u.prototype.parseValueRecordList = function () { + for ( + var e = this.parseUShort(), + t = this.parseUShort(), + r = new Array(t), + o = 0; + o < t; + o++ + ) + r[o] = this.parseValueRecord(e); + return r; + }), + (u.prototype.parsePointer = function (e) { + var t = this.parseOffset16(); + if (0 < t) + return new u(this.data, this.offset + t).parseStruct(e); + }), + (u.prototype.parsePointer32 = function (e) { + var t = this.parseOffset32(); + if (0 < t) + return new u(this.data, this.offset + t).parseStruct(e); + }), + (u.prototype.parseListOfLists = function (e) { + for ( + var t = this.parseOffset16List(), + r = t.length, + o = this.relativeOffset, + n = new Array(r), + s = 0; + s < r; + s++ + ) { + var i = t[s]; + if (0 === i) n[s] = void 0; + else if (((this.relativeOffset = i), e)) { + for ( + var a = this.parseOffset16List(), + l = new Array(a.length), + u = 0; + u < a.length; + u++ + ) + (this.relativeOffset = i + a[u]), + (l[u] = e.call(this)); + n[s] = l; + } else n[s] = this.parseUShortList(); + } + return (this.relativeOffset = o), n; + }), + (u.prototype.parseCoverage = function () { + var e = this.offset + this.relativeOffset, + t = this.parseUShort(), + r = this.parseUShort(); + if (1 === t) + return { format: 1, glyphs: this.parseUShortList(r) }; + if (2 !== t) + throw new Error( + "0x" + + e.toString(16) + + ": Coverage format must be 1 or 2.", + ); + for (var o = new Array(r), n = 0; n < r; n++) + o[n] = { + start: this.parseUShort(), + end: this.parseUShort(), + index: this.parseUShort(), + }; + return { format: 2, ranges: o }; + }), + (u.prototype.parseClassDef = function () { + var e = this.offset + this.relativeOffset, + t = this.parseUShort(); + if (1 === t) + return { + format: 1, + startGlyph: this.parseUShort(), + classes: this.parseUShortList(), + }; + if (2 === t) + return { + format: 2, + ranges: this.parseRecordList({ + start: u.uShort, + end: u.uShort, + classId: u.uShort, + }), + }; + throw new Error( + "0x" + + e.toString(16) + + ": ClassDef format must be 1 or 2.", + ); + }), + (u.list = function (e, t) { + return function () { + return this.parseList(e, t); + }; + }), + (u.list32 = function (e, t) { + return function () { + return this.parseList32(e, t); + }; + }), + (u.recordList = function (e, t) { + return function () { + return this.parseRecordList(e, t); + }; + }), + (u.recordList32 = function (e, t) { + return function () { + return this.parseRecordList32(e, t); + }; + }), + (u.pointer = function (e) { + return function () { + return this.parsePointer(e); + }; + }), + (u.pointer32 = function (e) { + return function () { + return this.parsePointer32(e); + }; + }), + (u.tag = u.prototype.parseTag), + (u.byte = u.prototype.parseByte), + (u.uShort = u.offset16 = u.prototype.parseUShort), + (u.uShortList = u.prototype.parseUShortList), + (u.uLong = u.offset32 = u.prototype.parseULong), + (u.uLongList = u.prototype.parseULongList), + (u.struct = u.prototype.parseStruct), + (u.coverage = u.prototype.parseCoverage), + (u.classDef = u.prototype.parseClassDef); + var xe = { + reserved: u.uShort, + reqFeatureIndex: u.uShort, + featureIndexes: u.uShortList, + }, + R = + ((u.prototype.parseScriptList = function () { + return ( + this.parsePointer( + u.recordList({ + tag: u.tag, + script: u.pointer({ + defaultLangSys: u.pointer(xe), + langSysRecords: u.recordList({ + tag: u.tag, + langSys: u.pointer(xe), + }), + }), + }), + ) || [] + ); + }), + (u.prototype.parseFeatureList = function () { + return ( + this.parsePointer( + u.recordList({ + tag: u.tag, + feature: u.pointer({ + featureParams: u.offset16, + lookupListIndexes: u.uShortList, + }), + }), + ) || [] + ); + }), + (u.prototype.parseLookupList = function (o) { + return ( + this.parsePointer( + u.list( + u.pointer(function () { + var e = this.parseUShort(), + t = + (L.argument( + 1 <= e && e <= 9, + "GPOS/GSUB lookup type " + e + " unknown.", + ), + this.parseUShort()), + r = 16 & t; + return { + lookupType: e, + lookupFlag: t, + subtables: this.parseList(u.pointer(o[e])), + markFilteringSet: r + ? this.parseUShort() + : void 0, + }; + }), + ), + ) || [] + ); + }), + (u.prototype.parseFeatureVariationsList = function () { + return ( + this.parsePointer32(function () { + var e = this.parseUShort(), + t = this.parseUShort(); + return ( + L.argument( + 1 === e && t < 1, + "GPOS/GSUB feature variations table unknown.", + ), + this.parseRecordList32({ + conditionSetOffset: u.offset32, + featureTableSubstitutionOffset: u.offset32, + }) + ); + }) || [] + ); + }), + { + getByte: ge, + getCard8: ge, + getUShort: ve, + getCard16: ve, + getShort: function (e, t) { + return e.getInt16(t, !1); + }, + getULong: be, + getFixed: je, + getTag: function (e, t) { + for (var r = "", o = t; o < t + 4; o += 1) + r += String.fromCharCode(e.getInt8(o)); + return r; + }, + getOffset: function (e, t, r) { + for (var o = 0, n = 0; n < r; n += 1) + o = (o <<= 8) + e.getUint8(t + n); + return o; + }, + getBytes: function (e, t, r) { + for (var o = [], n = t; n < r; n += 1) + o.push(e.getUint8(n)); + return o; + }, + bytesToString: function (e) { + for (var t = "", r = 0; r < e.length; r += 1) + t += String.fromCharCode(e[r]); + return t; + }, + Parser: u, + }); + var we = { + parse: function (e, t) { + for ( + var r = {}, + o = + ((r.version = R.getUShort(e, t)), + L.argument( + 0 === r.version, + "cmap table version should be 0.", + ), + (r.numTables = R.getUShort(e, t + 2)), + -1), + n = r.numTables - 1; + 0 <= n; + --n + ) { + var s = R.getUShort(e, t + 4 + 8 * n), + i = R.getUShort(e, t + 4 + 8 * n + 2); + if ( + (3 === s && (0 === i || 1 === i || 10 === i)) || + (0 === s && + (0 === i || + 1 === i || + 2 === i || + 3 === i || + 4 === i)) + ) { + o = R.getULong(e, t + 4 + 8 * n + 4); + break; + } + } + if (-1 === o) + throw new Error("No valid cmap sub-tables found."); + var a = new R.Parser(e, t + o); + if (((r.format = a.parseUShort()), 12 === r.format)) { + var l, + u = r, + c = a; + c.parseUShort(), + (u.length = c.parseULong()), + (u.language = c.parseULong()), + (u.groupCount = l = c.parseULong()), + (u.glyphIndexMap = {}); + for (var d = 0; d < l; d += 1) + for ( + var h = c.parseULong(), + f = c.parseULong(), + p = c.parseULong(), + m = h; + m <= f; + m += 1 + ) + (u.glyphIndexMap[m] = p), p++; + } else { + if (4 !== r.format) + throw new Error( + "Only format 4 and 12 cmap tables are supported (found format " + + r.format + + ").", + ); + var y = r, + g = e, + v = t, + b = o; + (y.length = a.parseUShort()), + (y.language = a.parseUShort()), + (y.segCount = j = a.parseUShort() >> 1), + a.skip("uShort", 3), + (y.glyphIndexMap = {}); + for ( + var j, + _ = new R.Parser(g, v + b + 14), + x = new R.Parser(g, v + b + 16 + 2 * j), + w = new R.Parser(g, v + b + 16 + 4 * j), + S = new R.Parser(g, v + b + 16 + 6 * j), + T = v + b + 16 + 8 * j, + M = 0; + M < j - 1; + M += 1 + ) + for ( + var E = void 0, + k = _.parseUShort(), + C = x.parseUShort(), + O = w.parseShort(), + P = S.parseUShort(), + A = C; + A <= k; + A += 1 + ) + 0 !== P + ? ((T = + (T = S.offset + S.relativeOffset - 2) + + P + + 2 * (A - C)), + 0 !== (E = R.getUShort(g, T)) && + (E = (E + O) & 65535)) + : (E = (A + O) & 65535), + (y.glyphIndexMap[A] = E); + } + return r; + }, + make: function (e) { + for (var t = !0, r = e.length - 1; 0 < r; --r) + if (65535 < e.get(r).unicode) { + console.log("Adding CMAP format 12 (needed!)"), + (t = !1); + break; + } + var o, + n, + s = [ + { name: "version", type: "USHORT", value: 0 }, + { + name: "numTables", + type: "USHORT", + value: t ? 1 : 2, + }, + { name: "platformID", type: "USHORT", value: 3 }, + { name: "encodingID", type: "USHORT", value: 1 }, + { name: "offset", type: "ULONG", value: t ? 12 : 20 }, + ], + i = + ((s = (s = t + ? s + : s.concat([ + { + name: "cmap12PlatformID", + type: "USHORT", + value: 3, + }, + { + name: "cmap12EncodingID", + type: "USHORT", + value: 10, + }, + { + name: "cmap12Offset", + type: "ULONG", + value: 0, + }, + ])).concat([ + { name: "format", type: "USHORT", value: 4 }, + { name: "cmap4Length", type: "USHORT", value: 0 }, + { name: "language", type: "USHORT", value: 0 }, + { name: "segCountX2", type: "USHORT", value: 0 }, + { name: "searchRange", type: "USHORT", value: 0 }, + { name: "entrySelector", type: "USHORT", value: 0 }, + { name: "rangeShift", type: "USHORT", value: 0 }, + ])), + new S.Table("cmap", s)); + for (i.segments = [], r = 0; r < e.length; r += 1) { + for ( + var a = e.get(r), l = 0; + l < a.unicodes.length; + l += 1 + ) + (o = a.unicodes[l]), + (n = r), + i.segments.push({ + end: o, + start: o, + delta: -(o - n), + offset: 0, + glyphIndex: n, + }); + i.segments = i.segments.sort(function (e, t) { + return e.start - t.start; + }); + } + i.segments.push({ + end: 65535, + start: 65535, + delta: 1, + offset: 0, + }); + var u = i.segments.length, + c = 0, + d = [], + h = [], + f = [], + p = [], + m = [], + y = []; + for (r = 0; r < u; r += 1) { + var g = i.segments[r]; + g.end <= 65535 && g.start <= 65535 + ? ((d = d.concat({ + name: "end_" + r, + type: "USHORT", + value: g.end, + })), + (h = h.concat({ + name: "start_" + r, + type: "USHORT", + value: g.start, + })), + (f = f.concat({ + name: "idDelta_" + r, + type: "SHORT", + value: g.delta, + })), + (p = p.concat({ + name: "idRangeOffset_" + r, + type: "USHORT", + value: g.offset, + })), + void 0 !== g.glyphId && + (m = m.concat({ + name: "glyph_" + r, + type: "USHORT", + value: g.glyphId, + }))) + : (c += 1), + t || + void 0 === g.glyphIndex || + (y = (y = (y = y.concat({ + name: "cmap12Start_" + r, + type: "ULONG", + value: g.start, + })).concat({ + name: "cmap12End_" + r, + type: "ULONG", + value: g.end, + })).concat({ + name: "cmap12Glyph_" + r, + type: "ULONG", + value: g.glyphIndex, + })); + } + return ( + (i.segCountX2 = 2 * (u - c)), + (i.searchRange = + 2 * + Math.pow( + 2, + Math.floor(Math.log(u - c) / Math.log(2)), + )), + (i.entrySelector = + Math.log(i.searchRange / 2) / Math.log(2)), + (i.rangeShift = i.segCountX2 - i.searchRange), + (i.fields = i.fields.concat(d)), + i.fields.push({ + name: "reservedPad", + type: "USHORT", + value: 0, + }), + (i.fields = i.fields.concat(h)), + (i.fields = i.fields.concat(f)), + (i.fields = i.fields.concat(p)), + (i.fields = i.fields.concat(m)), + (i.cmap4Length = + 14 + + 2 * d.length + + 2 + + 2 * h.length + + 2 * f.length + + 2 * p.length + + 2 * m.length), + t || + ((s = 16 + 4 * y.length), + (i.cmap12Offset = 20 + i.cmap4Length), + (i.fields = i.fields.concat([ + { name: "cmap12Format", type: "USHORT", value: 12 }, + { + name: "cmap12Reserved", + type: "USHORT", + value: 0, + }, + { name: "cmap12Length", type: "ULONG", value: s }, + { name: "cmap12Language", type: "ULONG", value: 0 }, + { + name: "cmap12nGroups", + type: "ULONG", + value: y.length / 3, + }, + ])), + (i.fields = i.fields.concat(y))), + i + ); + }, + }, + Se = [ + ".notdef", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "questiondown", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "AE", + "ordfeminine", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "ae", + "dotlessi", + "lslash", + "oslash", + "oe", + "germandbls", + "onesuperior", + "logicalnot", + "mu", + "trademark", + "Eth", + "onehalf", + "plusminus", + "Thorn", + "onequarter", + "divide", + "brokenbar", + "degree", + "thorn", + "threequarters", + "twosuperior", + "registered", + "minus", + "eth", + "multiply", + "threesuperior", + "copyright", + "Aacute", + "Acircumflex", + "Adieresis", + "Agrave", + "Aring", + "Atilde", + "Ccedilla", + "Eacute", + "Ecircumflex", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Ntilde", + "Oacute", + "Ocircumflex", + "Odieresis", + "Ograve", + "Otilde", + "Scaron", + "Uacute", + "Ucircumflex", + "Udieresis", + "Ugrave", + "Yacute", + "Ydieresis", + "Zcaron", + "aacute", + "acircumflex", + "adieresis", + "agrave", + "aring", + "atilde", + "ccedilla", + "eacute", + "ecircumflex", + "edieresis", + "egrave", + "iacute", + "icircumflex", + "idieresis", + "igrave", + "ntilde", + "oacute", + "ocircumflex", + "odieresis", + "ograve", + "otilde", + "scaron", + "uacute", + "ucircumflex", + "udieresis", + "ugrave", + "yacute", + "ydieresis", + "zcaron", + "exclamsmall", + "Hungarumlautsmall", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "266 ff", + "onedotenleader", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "isuperior", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "rsuperior", + "ssuperior", + "tsuperior", + "ff", + "ffi", + "ffl", + "parenleftinferior", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "Dotaccentsmall", + "Macronsmall", + "figuredash", + "hypheninferior", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "zerosuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", + "001.000", + "001.001", + "001.002", + "001.003", + "Black", + "Bold", + "Book", + "Light", + "Medium", + "Regular", + "Roman", + "Semibold", + ], + Te = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quoteright", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "quoteleft", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "exclamdown", + "cent", + "sterling", + "fraction", + "yen", + "florin", + "section", + "currency", + "quotesingle", + "quotedblleft", + "guillemotleft", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "", + "endash", + "dagger", + "daggerdbl", + "periodcentered", + "", + "paragraph", + "bullet", + "quotesinglbase", + "quotedblbase", + "quotedblright", + "guillemotright", + "ellipsis", + "perthousand", + "", + "questiondown", + "", + "grave", + "acute", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "dieresis", + "", + "ring", + "cedilla", + "", + "hungarumlaut", + "ogonek", + "caron", + "emdash", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "AE", + "", + "ordfeminine", + "", + "", + "", + "", + "Lslash", + "Oslash", + "OE", + "ordmasculine", + "", + "", + "", + "", + "", + "ae", + "", + "", + "", + "dotlessi", + "", + "", + "lslash", + "oslash", + "oe", + "germandbls", + ], + Me = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "space", + "exclamsmall", + "Hungarumlautsmall", + "", + "dollaroldstyle", + "dollarsuperior", + "ampersandsmall", + "Acutesmall", + "parenleftsuperior", + "parenrightsuperior", + "twodotenleader", + "onedotenleader", + "comma", + "hyphen", + "period", + "fraction", + "zerooldstyle", + "oneoldstyle", + "twooldstyle", + "threeoldstyle", + "fouroldstyle", + "fiveoldstyle", + "sixoldstyle", + "sevenoldstyle", + "eightoldstyle", + "nineoldstyle", + "colon", + "semicolon", + "commasuperior", + "threequartersemdash", + "periodsuperior", + "questionsmall", + "", + "asuperior", + "bsuperior", + "centsuperior", + "dsuperior", + "esuperior", + "", + "", + "isuperior", + "", + "", + "lsuperior", + "msuperior", + "nsuperior", + "osuperior", + "", + "", + "rsuperior", + "ssuperior", + "tsuperior", + "", + "ff", + "fi", + "fl", + "ffi", + "ffl", + "parenleftinferior", + "", + "parenrightinferior", + "Circumflexsmall", + "hyphensuperior", + "Gravesmall", + "Asmall", + "Bsmall", + "Csmall", + "Dsmall", + "Esmall", + "Fsmall", + "Gsmall", + "Hsmall", + "Ismall", + "Jsmall", + "Ksmall", + "Lsmall", + "Msmall", + "Nsmall", + "Osmall", + "Psmall", + "Qsmall", + "Rsmall", + "Ssmall", + "Tsmall", + "Usmall", + "Vsmall", + "Wsmall", + "Xsmall", + "Ysmall", + "Zsmall", + "colonmonetary", + "onefitted", + "rupiah", + "Tildesmall", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "exclamdownsmall", + "centoldstyle", + "Lslashsmall", + "", + "", + "Scaronsmall", + "Zcaronsmall", + "Dieresissmall", + "Brevesmall", + "Caronsmall", + "", + "Dotaccentsmall", + "", + "", + "Macronsmall", + "", + "", + "figuredash", + "hypheninferior", + "", + "", + "Ogoneksmall", + "Ringsmall", + "Cedillasmall", + "", + "", + "", + "onequarter", + "onehalf", + "threequarters", + "questiondownsmall", + "oneeighth", + "threeeighths", + "fiveeighths", + "seveneighths", + "onethird", + "twothirds", + "", + "", + "zerosuperior", + "onesuperior", + "twosuperior", + "threesuperior", + "foursuperior", + "fivesuperior", + "sixsuperior", + "sevensuperior", + "eightsuperior", + "ninesuperior", + "zeroinferior", + "oneinferior", + "twoinferior", + "threeinferior", + "fourinferior", + "fiveinferior", + "sixinferior", + "seveninferior", + "eightinferior", + "nineinferior", + "centinferior", + "dollarinferior", + "periodinferior", + "commainferior", + "Agravesmall", + "Aacutesmall", + "Acircumflexsmall", + "Atildesmall", + "Adieresissmall", + "Aringsmall", + "AEsmall", + "Ccedillasmall", + "Egravesmall", + "Eacutesmall", + "Ecircumflexsmall", + "Edieresissmall", + "Igravesmall", + "Iacutesmall", + "Icircumflexsmall", + "Idieresissmall", + "Ethsmall", + "Ntildesmall", + "Ogravesmall", + "Oacutesmall", + "Ocircumflexsmall", + "Otildesmall", + "Odieresissmall", + "OEsmall", + "Oslashsmall", + "Ugravesmall", + "Uacutesmall", + "Ucircumflexsmall", + "Udieresissmall", + "Yacutesmall", + "Thornsmall", + "Ydieresissmall", + ], + c = [ + ".notdef", + ".null", + "nonmarkingreturn", + "space", + "exclam", + "quotedbl", + "numbersign", + "dollar", + "percent", + "ampersand", + "quotesingle", + "parenleft", + "parenright", + "asterisk", + "plus", + "comma", + "hyphen", + "period", + "slash", + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "colon", + "semicolon", + "less", + "equal", + "greater", + "question", + "at", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "bracketleft", + "backslash", + "bracketright", + "asciicircum", + "underscore", + "grave", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "braceleft", + "bar", + "braceright", + "asciitilde", + "Adieresis", + "Aring", + "Ccedilla", + "Eacute", + "Ntilde", + "Odieresis", + "Udieresis", + "aacute", + "agrave", + "acircumflex", + "adieresis", + "atilde", + "aring", + "ccedilla", + "eacute", + "egrave", + "ecircumflex", + "edieresis", + "iacute", + "igrave", + "icircumflex", + "idieresis", + "ntilde", + "oacute", + "ograve", + "ocircumflex", + "odieresis", + "otilde", + "uacute", + "ugrave", + "ucircumflex", + "udieresis", + "dagger", + "degree", + "cent", + "sterling", + "section", + "bullet", + "paragraph", + "germandbls", + "registered", + "copyright", + "trademark", + "acute", + "dieresis", + "notequal", + "AE", + "Oslash", + "infinity", + "plusminus", + "lessequal", + "greaterequal", + "yen", + "mu", + "partialdiff", + "summation", + "product", + "pi", + "integral", + "ordfeminine", + "ordmasculine", + "Omega", + "ae", + "oslash", + "questiondown", + "exclamdown", + "logicalnot", + "radical", + "florin", + "approxequal", + "Delta", + "guillemotleft", + "guillemotright", + "ellipsis", + "nonbreakingspace", + "Agrave", + "Atilde", + "Otilde", + "OE", + "oe", + "endash", + "emdash", + "quotedblleft", + "quotedblright", + "quoteleft", + "quoteright", + "divide", + "lozenge", + "ydieresis", + "Ydieresis", + "fraction", + "currency", + "guilsinglleft", + "guilsinglright", + "fi", + "fl", + "daggerdbl", + "periodcentered", + "quotesinglbase", + "quotedblbase", + "perthousand", + "Acircumflex", + "Ecircumflex", + "Aacute", + "Edieresis", + "Egrave", + "Iacute", + "Icircumflex", + "Idieresis", + "Igrave", + "Oacute", + "Ocircumflex", + "apple", + "Ograve", + "Uacute", + "Ucircumflex", + "Ugrave", + "dotlessi", + "circumflex", + "tilde", + "macron", + "breve", + "dotaccent", + "ring", + "cedilla", + "hungarumlaut", + "ogonek", + "caron", + "Lslash", + "lslash", + "Scaron", + "scaron", + "Zcaron", + "zcaron", + "brokenbar", + "Eth", + "eth", + "Yacute", + "yacute", + "Thorn", + "thorn", + "minus", + "multiply", + "onesuperior", + "twosuperior", + "threesuperior", + "onehalf", + "onequarter", + "threequarters", + "franc", + "Gbreve", + "gbreve", + "Idotaccent", + "Scedilla", + "scedilla", + "Cacute", + "cacute", + "Ccaron", + "ccaron", + "dcroat", + ]; + function Ee(e) { + this.font = e; + } + function ke(e) { + this.cmap = e; + } + function Ce(e, t) { + (this.encoding = e), (this.charset = t); + } + function Oe(e) { + switch (e.version) { + case 1: + this.names = c.slice(); + break; + case 2: + this.names = new Array(e.numberOfGlyphs); + for (var t = 0; t < e.numberOfGlyphs; t++) + e.glyphNameIndex[t] < c.length + ? (this.names[t] = c[e.glyphNameIndex[t]]) + : (this.names[t] = + e.names[e.glyphNameIndex[t] - c.length]); + break; + case 2.5: + this.names = new Array(e.numberOfGlyphs); + for (var r = 0; r < e.numberOfGlyphs; r++) + this.names[r] = c[r + e.glyphNameIndex[r]]; + break; + default: + this.names = []; + } + } + (Ee.prototype.charToGlyphIndex = function (e) { + var t = e.codePointAt(0), + r = this.font.glyphs; + if (r) + for (var o = 0; o < r.length; o += 1) + for ( + var n = r.get(o), s = 0; + s < n.unicodes.length; + s += 1 + ) + if (n.unicodes[s] === t) return o; + return null; + }), + (ke.prototype.charToGlyphIndex = function (e) { + return this.cmap.glyphIndexMap[e.codePointAt(0)] || 0; + }), + (Ce.prototype.charToGlyphIndex = function (e) { + (e = e.codePointAt(0)), (e = this.encoding[e]); + return this.charset.indexOf(e); + }), + (Oe.prototype.nameToGlyphIndex = function (e) { + return this.names.indexOf(e); + }), + (Oe.prototype.glyphIndexToName = function (e) { + return this.names[e]; + }); + var d = { + line: function (e, t, r, o, n) { + e.beginPath(), e.moveTo(t, r), e.lineTo(o, n), e.stroke(); + }, + }; + function f(e) { + this.bindConstructorValues(e); + } + function Pe(t, e, r) { + Object.defineProperty(t, e, { + get: function () { + return t.path, t[r]; + }, + set: function (e) { + t[r] = e; + }, + enumerable: !0, + configurable: !0, + }); + } + function Ae(e, t) { + if (((this.font = e), (this.glyphs = {}), Array.isArray(t))) + for (var r = 0; r < t.length; r++) this.glyphs[r] = t[r]; + this.length = (t && t.length) || 0; + } + (f.prototype.bindConstructorValues = function (e) { + var t; + (this.index = e.index || 0), + (this.name = e.name || null), + (this.unicode = e.unicode || void 0), + (this.unicodes = + e.unicodes || void 0 !== e.unicode ? [e.unicode] : []), + e.xMin && (this.xMin = e.xMin), + e.yMin && (this.yMin = e.yMin), + e.xMax && (this.xMax = e.xMax), + e.yMax && (this.yMax = e.yMax), + e.advanceWidth && (this.advanceWidth = e.advanceWidth), + Object.defineProperty( + this, + "path", + ((e = e.path), + (t = e || new h()), + { + configurable: !0, + get: function () { + return (t = "function" == typeof t ? t() : t); + }, + set: function (e) { + t = e; + }, + }), + ); + }), + (f.prototype.addUnicode = function (e) { + 0 === this.unicodes.length && (this.unicode = e), + this.unicodes.push(e); + }), + (f.prototype.getBoundingBox = function () { + return this.path.getBoundingBox(); + }), + (f.prototype.getPath = function (e, t, r, o, n) { + (e = void 0 !== e ? e : 0), + (t = void 0 !== t ? t : 0), + (r = void 0 !== r ? r : 72); + for ( + var s, + i, + a = (o = o || {}).xScale, + l = o.yScale, + u = + ((s = + o.hinting && n && n.hinting + ? this.path && n.hinting.exec(this, r) + : s) + ? ((i = n.hinting.getCommands(s)), + (e = Math.round(e)), + (t = Math.round(t)), + (a = l = 1)) + : ((i = this.path.commands), + (o = (1 / this.path.unitsPerEm) * r), + void 0 === a && (a = o), + void 0 === l && (l = o)), + new h()), + c = 0; + c < i.length; + c += 1 + ) { + var d = i[c]; + "M" === d.type + ? u.moveTo(e + d.x * a, t + -d.y * l) + : "L" === d.type + ? u.lineTo(e + d.x * a, t + -d.y * l) + : "Q" === d.type + ? u.quadraticCurveTo( + e + d.x1 * a, + t + -d.y1 * l, + e + d.x * a, + t + -d.y * l, + ) + : "C" === d.type + ? u.curveTo( + e + d.x1 * a, + t + -d.y1 * l, + e + d.x2 * a, + t + -d.y2 * l, + e + d.x * a, + t + -d.y * l, + ) + : "Z" === d.type && u.closePath(); + } + return u; + }), + (f.prototype.getContours = function () { + if (void 0 === this.points) return []; + for ( + var e = [], t = [], r = 0; + r < this.points.length; + r += 1 + ) { + var o = this.points[r]; + t.push(o), o.lastPointOfContour && (e.push(t), (t = [])); + } + return ( + L.argument( + 0 === t.length, + "There are still points left in the current contour.", + ), + e + ); + }), + (f.prototype.getMetrics = function () { + for ( + var e = this.path.commands, t = [], r = [], o = 0; + o < e.length; + o += 1 + ) { + var n = e[o]; + "Z" !== n.type && (t.push(n.x), r.push(n.y)), + ("Q" !== n.type && "C" !== n.type) || + (t.push(n.x1), r.push(n.y1)), + "C" === n.type && (t.push(n.x2), r.push(n.y2)); + } + var s = { + xMin: Math.min.apply(null, t), + yMin: Math.min.apply(null, r), + xMax: Math.max.apply(null, t), + yMax: Math.max.apply(null, r), + leftSideBearing: this.leftSideBearing, + }; + return ( + isFinite(s.xMin) || (s.xMin = 0), + isFinite(s.xMax) || (s.xMax = this.advanceWidth), + isFinite(s.yMin) || (s.yMin = 0), + isFinite(s.yMax) || (s.yMax = 0), + (s.rightSideBearing = + this.advanceWidth - + s.leftSideBearing - + (s.xMax - s.xMin)), + s + ); + }), + (f.prototype.draw = function (e, t, r, o, n) { + this.getPath(t, r, o, n).draw(e); + }), + (f.prototype.drawPoints = function (i, e, t, r) { + function o(e, t, r, o) { + var n = 2 * Math.PI; + i.beginPath(); + for (var s = 0; s < e.length; s += 1) + i.moveTo(t + e[s].x * o, r + e[s].y * o), + i.arc(t + e[s].x * o, r + e[s].y * o, 2, 0, n, !1); + i.closePath(), i.fill(); + } + (e = void 0 !== e ? e : 0), (t = void 0 !== t ? t : 0); + for ( + var r = + (1 / this.path.unitsPerEm) * + (r = void 0 !== r ? r : 24), + n = [], + s = [], + a = this.path, + l = 0; + l < a.commands.length; + l += 1 + ) { + var u = a.commands[l]; + void 0 !== u.x && n.push({ x: u.x, y: -u.y }), + void 0 !== u.x1 && s.push({ x: u.x1, y: -u.y1 }), + void 0 !== u.x2 && s.push({ x: u.x2, y: -u.y2 }); + } + (i.fillStyle = "blue"), + o(n, e, t, r), + (i.fillStyle = "red"), + o(s, e, t, r); + }), + (f.prototype.drawMetrics = function (e, t, r, o) { + (t = void 0 !== t ? t : 0), + (r = void 0 !== r ? r : 0), + (o = + (1 / this.path.unitsPerEm) * + (o = void 0 !== o ? o : 24)), + (e.lineWidth = 1), + (e.strokeStyle = "black"), + d.line(e, t, -1e4, t, 1e4), + d.line(e, -1e4, r, 1e4, r); + var n = this.xMin || 0, + s = this.yMin || 0, + i = this.xMax || 0, + a = this.yMax || 0, + l = this.advanceWidth || 0; + (e.strokeStyle = "blue"), + d.line(e, t + n * o, -1e4, t + n * o, 1e4), + d.line(e, t + i * o, -1e4, t + i * o, 1e4), + d.line(e, -1e4, r + -s * o, 1e4, r + -s * o), + d.line(e, -1e4, r + -a * o, 1e4, r + -a * o), + (e.strokeStyle = "green"), + d.line(e, t + l * o, -1e4, t + l * o, 1e4); + }), + (Ae.prototype.get = function (e) { + return ( + "function" == typeof this.glyphs[e] && + (this.glyphs[e] = this.glyphs[e]()), + this.glyphs[e] + ); + }), + (Ae.prototype.push = function (e, t) { + (this.glyphs[e] = t), this.length++; + }); + var p = { + GlyphSet: Ae, + glyphLoader: function (e, t) { + return new f({ index: t, font: e }); + }, + ttfGlyphLoader: function (r, e, o, n, s, i) { + return function () { + var t = new f({ index: e, font: r }); + return ( + (t.path = function () { + o(t, n, s); + var e = i(r.glyphs, t); + return (e.unitsPerEm = r.unitsPerEm), e; + }), + Pe(t, "xMin", "_xMin"), + Pe(t, "xMax", "_xMax"), + Pe(t, "yMin", "_yMin"), + Pe(t, "yMax", "_yMax"), + t + ); + }; + }, + cffGlyphLoader: function (r, e, o, n) { + return function () { + var t = new f({ index: e, font: r }); + return ( + (t.path = function () { + var e = o(r, t, n); + return (e.unitsPerEm = r.unitsPerEm), e; + }), + t + ); + }; + }, + }; + function Le(e) { + e = e.length < 1240 ? 107 : e.length < 33900 ? 1131 : 32768; + return e; + } + function y(e, t, r) { + var o, + n = [], + s = [], + i = R.getCard16(e, t); + if (0 !== i) { + for ( + var a = R.getByte(e, t + 2), + l = t + (i + 1) * a + 2, + u = t + 3, + c = 0; + c < i + 1; + c += 1 + ) + n.push(R.getOffset(e, u, a)), (u += a); + o = l + n[i]; + } else o = t + 2; + for (var d = 0; d < n.length - 1; d += 1) { + var h = R.getBytes(e, l + n[d], l + n[d + 1]); + r && (h = r(h)), s.push(h); + } + return { objects: s, startOffset: t, endOffset: o }; + } + function Re(e, t) { + if (28 === t) return (e.parseByte() << 8) | e.parseByte(); + if (29 === t) + return ( + (e.parseByte() << 24) | + (e.parseByte() << 16) | + (e.parseByte() << 8) | + e.parseByte() + ); + if (30 === t) { + for ( + var r = e, + o = "", + n = [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ".", + "E", + "E-", + null, + "-", + ]; + ; + + ) { + var s = r.parseByte(), + i = s >> 4, + s = 15 & s; + if (15 == i) break; + if (((o += n[i]), 15 == s)) break; + o += n[s]; + } + return parseFloat(o); + } + 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 Ie(e, t, r) { + var o = new R.Parser(e, (t = void 0 !== t ? t : 0)), + n = [], + s = []; + for ( + r = void 0 !== r ? r : e.length; + o.relativeOffset < r; + + ) { + var i = o.parseByte(); + i <= 21 + ? (12 === i && (i = 1200 + o.parseByte()), + n.push([i, s]), + (s = [])) + : s.push(Re(o, i)); + } + for (var a = n, l = {}, u = 0; u < a.length; u += 1) { + var c = a[u][0], + d = a[u][1], + h = void 0, + h = 1 === d.length ? d[0] : d; + if (l.hasOwnProperty(c) && !isNaN(l[c])) + throw new Error("Object " + l + " already has key " + c); + l[c] = h; + } + return l; + } + function De(e, t) { + return (t = t <= 390 ? Se[t] : e[t - 391]); + } + function Fe(e, t, r) { + for (var o, n = {}, s = 0; s < t.length; s += 1) { + var i = t[s]; + if (Array.isArray(i.type)) { + var a = []; + a.length = i.type.length; + for (var l = 0; l < i.type.length; l++) + void 0 === + (o = void 0 !== e[i.op] ? e[i.op][l] : void 0) && + (o = + void 0 !== i.value && void 0 !== i.value[l] + ? i.value[l] + : null), + "SID" === i.type[l] && (o = De(r, o)), + (a[l] = o); + n[i.name] = a; + } else + void 0 === (o = e[i.op]) && + (o = void 0 !== i.value ? i.value : null), + "SID" === i.type && (o = De(r, o)), + (n[i.name] = o); + } + return n; + } + var Ue = [ + { name: "version", op: 0, type: "SID" }, + { name: "notice", op: 1, type: "SID" }, + { name: "copyright", op: 1200, type: "SID" }, + { name: "fullName", op: 2, type: "SID" }, + { name: "familyName", op: 3, type: "SID" }, + { name: "weight", op: 4, type: "SID" }, + { + name: "isFixedPitch", + op: 1201, + type: "number", + value: 0, + }, + { name: "italicAngle", op: 1202, type: "number", value: 0 }, + { + name: "underlinePosition", + op: 1203, + type: "number", + value: -100, + }, + { + name: "underlineThickness", + op: 1204, + type: "number", + value: 50, + }, + { name: "paintType", op: 1205, type: "number", value: 0 }, + { + name: "charstringType", + op: 1206, + type: "number", + value: 2, + }, + { + name: "fontMatrix", + op: 1207, + type: ["real", "real", "real", "real", "real", "real"], + value: [0.001, 0, 0, 0.001, 0, 0], + }, + { name: "uniqueId", op: 13, type: "number" }, + { + name: "fontBBox", + op: 5, + type: ["number", "number", "number", "number"], + value: [0, 0, 0, 0], + }, + { name: "strokeWidth", op: 1208, type: "number", value: 0 }, + { name: "xuid", op: 14, type: [], value: null }, + { name: "charset", op: 15, type: "offset", value: 0 }, + { name: "encoding", op: 16, type: "offset", value: 0 }, + { name: "charStrings", op: 17, type: "offset", value: 0 }, + { + name: "private", + op: 18, + type: ["number", "offset"], + value: [0, 0], + }, + { name: "ros", op: 1230, type: ["SID", "SID", "number"] }, + { + name: "cidFontVersion", + op: 1231, + type: "number", + value: 0, + }, + { + name: "cidFontRevision", + op: 1232, + type: "number", + value: 0, + }, + { name: "cidFontType", op: 1233, type: "number", value: 0 }, + { name: "cidCount", op: 1234, type: "number", value: 8720 }, + { name: "uidBase", op: 1235, type: "number" }, + { name: "fdArray", op: 1236, type: "offset" }, + { name: "fdSelect", op: 1237, type: "offset" }, + { name: "fontName", op: 1238, type: "SID" }, + ], + Ne = [ + { name: "subrs", op: 19, type: "offset", value: 0 }, + { name: "defaultWidthX", op: 20, type: "number", value: 0 }, + { name: "nominalWidthX", op: 21, type: "number", value: 0 }, + ]; + function Be(e, t, r, o) { + return Fe(Ie(e, t, r), Ne, o); + } + function Ge(e, t, r, o) { + for (var n = [], s = 0; s < r.length; s += 1) { + var i = new DataView(new Uint8Array(r[s]).buffer), + i = ((a = o), Fe(Ie(i, 0, i.byteLength), Ue, a)), + a = ((i._subrs = []), (i._subrsBias = 0), i.private[0]), + l = i.private[1]; + 0 !== a && + 0 !== l && + ((a = Be(e, l + t, a, o)), + (i._defaultWidthX = a.defaultWidthX), + (i._nominalWidthX = a.nominalWidthX), + 0 !== a.subrs && + ((l = y(e, l + a.subrs + t)), + (i._subrs = l.objects), + (i._subrsBias = Le(i._subrs))), + (i._privateDict = a)), + n.push(i); + } + return n; + } + function Ve(y, g, e) { + var v, + b, + j, + _, + t, + x, + w, + r, + S, + T = new h(), + M = [], + E = 0, + k = !1, + C = !1, + O = 0, + P = 0, + A = + ((S = ( + y.isCIDFont + ? ((t = y.tables.cff.topDict._fdSelect[g.index]), + (t = y.tables.cff.topDict._fdArray[t]), + (x = t._subrs), + (w = t._subrsBias), + (r = t._defaultWidthX), + t) + : ((x = y.tables.cff.topDict._subrs), + (w = y.tables.cff.topDict._subrsBias), + (r = y.tables.cff.topDict._defaultWidthX), + y.tables.cff.topDict) + )._nominalWidthX), + r); + function L(e, t) { + C && T.closePath(), T.moveTo(e, t), (C = !0); + } + function R() { + M.length % 2 == 0 || k || (A = M.shift() + S), + (E += M.length >> 1), + (M.length = 0), + (k = !0); + } + return ( + (function e(t) { + for ( + var r, o, n, s, i, a, l, u, c, d, h, f, p = 0; + p < t.length; + + ) { + var m = t[p]; + switch (((p += 1), m)) { + case 1: + case 3: + R(); + break; + case 4: + 1 < M.length && + !k && + ((A = M.shift() + S), (k = !0)), + (P += M.pop()), + L(O, P); + break; + case 5: + for (; 0 < M.length; ) + (O += M.shift()), + (P += M.shift()), + T.lineTo(O, P); + break; + case 6: + for ( + ; + 0 < M.length && + ((O += M.shift()), + T.lineTo(O, P), + 0 !== M.length); + + ) + (P += M.shift()), T.lineTo(O, P); + break; + case 7: + for ( + ; + 0 < M.length && + ((P += M.shift()), + T.lineTo(O, P), + 0 !== M.length); + + ) + (O += M.shift()), T.lineTo(O, P); + break; + case 8: + for (; 0 < M.length; ) + (v = O + M.shift()), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j + M.shift()), + (P = _ + M.shift()), + T.curveTo(v, b, j, _, O, P); + break; + case 10: + (i = M.pop() + w), (a = x[i]) && e(a); + break; + case 11: + return; + case 12: + switch (((m = t[p]), (p += 1), m)) { + case 35: + (v = O + M.shift()), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (l = j + M.shift()), + (u = _ + M.shift()), + (c = l + M.shift()), + (d = u + M.shift()), + (h = c + M.shift()), + (f = d + M.shift()), + (O = h + M.shift()), + (P = f + M.shift()), + M.shift(), + T.curveTo(v, b, j, _, l, u), + T.curveTo(c, d, h, f, O, P); + break; + case 34: + (v = O + M.shift()), + (b = P), + (j = v + M.shift()), + (_ = b + M.shift()), + (l = j + M.shift()), + (u = _), + (c = l + M.shift()), + (d = _), + (h = c + M.shift()), + (f = P), + (O = h + M.shift()), + T.curveTo(v, b, j, _, l, u), + T.curveTo(c, d, h, f, O, P); + break; + case 36: + (v = O + M.shift()), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (l = j + M.shift()), + (u = _), + (c = l + M.shift()), + (d = _), + (h = c + M.shift()), + (f = d + M.shift()), + (O = h + M.shift()), + T.curveTo(v, b, j, _, l, u), + T.curveTo(c, d, h, f, O, P); + break; + case 37: + (v = O + M.shift()), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (l = j + M.shift()), + (u = _ + M.shift()), + (c = l + M.shift()), + (d = u + M.shift()), + (h = c + M.shift()), + (f = d + M.shift()), + Math.abs(h - O) > Math.abs(f - P) + ? (O = h + M.shift()) + : (P = f + M.shift()), + T.curveTo(v, b, j, _, l, u), + T.curveTo(c, d, h, f, O, P); + break; + default: + console.log( + "Glyph " + + g.index + + ": unknown operator 1200" + + m, + ), + (M.length = 0); + } + break; + case 14: + 0 < M.length && + !k && + ((A = M.shift() + S), (k = !0)), + C && (T.closePath(), (C = !1)); + break; + case 18: + R(); + break; + case 19: + case 20: + R(), (p += (E + 7) >> 3); + break; + case 21: + 2 < M.length && + !k && + ((A = M.shift() + S), (k = !0)), + (P += M.pop()), + L((O += M.pop()), P); + break; + case 22: + 1 < M.length && + !k && + ((A = M.shift() + S), (k = !0)), + L((O += M.pop()), P); + break; + case 23: + R(); + break; + case 24: + for (; 2 < M.length; ) + (v = O + M.shift()), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j + M.shift()), + (P = _ + M.shift()), + T.curveTo(v, b, j, _, O, P); + (O += M.shift()), (P += M.shift()), T.lineTo(O, P); + break; + case 25: + for (; 6 < M.length; ) + (O += M.shift()), + (P += M.shift()), + T.lineTo(O, P); + (v = O + M.shift()), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j + M.shift()), + (P = _ + M.shift()), + T.curveTo(v, b, j, _, O, P); + break; + case 26: + for ( + M.length % 2 && (O += M.shift()); + 0 < M.length; + + ) + (v = O), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j), + (P = _ + M.shift()), + T.curveTo(v, b, j, _, O, P); + break; + case 27: + for ( + M.length % 2 && (P += M.shift()); + 0 < M.length; + + ) + (v = O + M.shift()), + (b = P), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j + M.shift()), + (P = _), + T.curveTo(v, b, j, _, O, P); + break; + case 28: + (r = t[p]), + (o = t[p + 1]), + M.push(((r << 24) | (o << 16)) >> 16), + (p += 2); + break; + case 29: + (i = M.pop() + y.gsubrsBias), + (a = y.gsubrs[i]) && e(a); + break; + case 30: + for ( + ; + 0 < M.length && + ((v = O), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j + M.shift()), + (P = _ + (1 === M.length ? M.shift() : 0)), + T.curveTo(v, b, j, _, O, P), + 0 !== M.length); + + ) + (v = O + M.shift()), + (b = P), + (j = v + M.shift()), + (_ = b + M.shift()), + (P = _ + M.shift()), + (O = j + (1 === M.length ? M.shift() : 0)), + T.curveTo(v, b, j, _, O, P); + break; + case 31: + for ( + ; + 0 < M.length && + ((v = O + M.shift()), + (b = P), + (j = v + M.shift()), + (_ = b + M.shift()), + (P = _ + M.shift()), + (O = j + (1 === M.length ? M.shift() : 0)), + T.curveTo(v, b, j, _, O, P), + 0 !== M.length); + + ) + (v = O), + (b = P + M.shift()), + (j = v + M.shift()), + (_ = b + M.shift()), + (O = j + M.shift()), + (P = _ + (1 === M.length ? M.shift() : 0)), + T.curveTo(v, b, j, _, O, P); + break; + default: + m < 32 + ? console.log( + "Glyph " + + g.index + + ": unknown operator " + + m, + ) + : m < 247 + ? M.push(m - 139) + : m < 251 + ? ((r = t[p]), + (p += 1), + M.push(256 * (m - 247) + r + 108)) + : m < 255 + ? ((r = t[p]), + (p += 1), + M.push(256 * -(m - 251) - r - 108)) + : ((r = t[p]), + (o = t[p + 1]), + (n = t[p + 2]), + (s = t[p + 3]), + (p += 4), + M.push( + ((r << 24) | (o << 16) | (n << 8) | s) / + 65536, + )); + } + } + })(e), + (g.advanceWidth = A), + T + ); + } + function ze(e, t) { + var r, + o = Se.indexOf(e); + return ( + 0 <= o && (r = o), + 0 <= (o = t.indexOf(e)) + ? (r = o + Se.length) + : ((r = Se.length + t.length), t.push(e)), + r + ); + } + function He(e, t, r) { + for (var o = {}, n = 0; n < e.length; n += 1) { + var s = e[n], + i = t[s.name]; + void 0 === i || + (function e(t, r) { + if (t === r) return 1; + if ( + Array.isArray(t) && + Array.isArray(r) && + t.length === r.length + ) { + for (var o = 0; o < t.length; o += 1) + if (!e(t[o], r[o])) return; + return 1; + } + })(i, s.value) || + ("SID" === s.type && (i = ze(i, r)), + (o[s.op] = { name: s.name, type: s.type, value: i })); + } + return o; + } + function We(e, t) { + var r = new S.Record("Top DICT", [ + { name: "dict", type: "DICT", value: {} }, + ]); + return (r.dict = He(Ue, e, t)), r; + } + function qe(e) { + var t = new S.Record("Top DICT INDEX", [ + { name: "topDicts", type: "INDEX", value: [] }, + ]); + return ( + (t.topDicts = [ + { name: "topDict_0", type: "TABLE", value: e }, + ]), + t + ); + } + function Xe(e) { + for ( + var t = new S.Record("CharStrings INDEX", [ + { name: "charStrings", type: "INDEX", value: [] }, + ]), + r = 0; + r < e.length; + r += 1 + ) { + var o = e.get(r), + n = (function (e) { + for ( + var t = [], + r = e.path, + o = + (t.push({ + name: "width", + type: "NUMBER", + value: e.advanceWidth, + }), + 0), + n = 0, + s = 0; + s < r.commands.length; + s += 1 + ) { + var i, + a, + l, + u, + c = void 0, + d = void 0, + h = r.commands[s]; + "M" === + (h = + "Q" === h.type + ? { + type: "C", + x: h.x, + y: h.y, + x1: (1 / 3) * o + (2 / 3) * h.x1, + y1: (1 / 3) * n + (2 / 3) * h.y1, + x2: (1 / 3) * h.x + (2 / 3) * h.x1, + y2: (1 / 3) * h.y + (2 / 3) * h.y1, + } + : h).type + ? ((c = Math.round(h.x - o)), + (d = Math.round(h.y - n)), + t.push({ name: "dx", type: "NUMBER", value: c }), + t.push({ name: "dy", type: "NUMBER", value: d }), + t.push({ + name: "rmoveto", + type: "OP", + value: 21, + }), + (o = Math.round(h.x)), + (n = Math.round(h.y))) + : "L" === h.type + ? ((c = Math.round(h.x - o)), + (d = Math.round(h.y - n)), + t.push({ + name: "dx", + type: "NUMBER", + value: c, + }), + t.push({ + name: "dy", + type: "NUMBER", + value: d, + }), + t.push({ + name: "rlineto", + type: "OP", + value: 5, + }), + (o = Math.round(h.x)), + (n = Math.round(h.y))) + : "C" === h.type && + ((i = Math.round(h.x1 - o)), + (a = Math.round(h.y1 - n)), + (l = Math.round(h.x2 - h.x1)), + (u = Math.round(h.y2 - h.y1)), + (c = Math.round(h.x - h.x2)), + (d = Math.round(h.y - h.y2)), + t.push({ + name: "dx1", + type: "NUMBER", + value: i, + }), + t.push({ + name: "dy1", + type: "NUMBER", + value: a, + }), + t.push({ + name: "dx2", + type: "NUMBER", + value: l, + }), + t.push({ + name: "dy2", + type: "NUMBER", + value: u, + }), + t.push({ + name: "dx", + type: "NUMBER", + value: c, + }), + t.push({ + name: "dy", + type: "NUMBER", + value: d, + }), + t.push({ + name: "rrcurveto", + type: "OP", + value: 8, + }), + (o = Math.round(h.x)), + (n = Math.round(h.y))); + } + return ( + t.push({ name: "endchar", type: "OP", value: 14 }), t + ); + })(o); + t.charStrings.push({ + name: o.name, + type: "CHARSTRING", + value: n, + }); + } + return t; + } + var Ye = { + parse: function (e, t, r) { + (r.tables.cff = {}), + (o = e), + (n = t), + ((s = {}).formatMajor = R.getCard8(o, n)), + (s.formatMinor = R.getCard8(o, n + 1)), + (s.size = R.getCard8(o, n + 2)), + (s.offsetSize = R.getCard8(o, n + 3)), + (s.startOffset = n), + (s.endOffset = n + 4); + var o = y(e, s.endOffset, R.bytesToString), + n = y(e, o.endOffset), + s = y(e, n.endOffset, R.bytesToString), + o = y(e, s.endOffset); + if ( + ((r.gsubrs = o.objects), + (r.gsubrsBias = Le(r.gsubrs)), + 1 !== (o = Ge(e, t, n.objects, s.objects)).length) + ) + throw new Error( + "CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + + o.length, + ); + if ( + ((n = o[0]), + (r.tables.cff.topDict = n)._privateDict && + ((r.defaultWidthX = n._privateDict.defaultWidthX), + (r.nominalWidthX = n._privateDict.nominalWidthX)), + void 0 !== n.ros[0] && + void 0 !== n.ros[1] && + (r.isCIDFont = !0), + r.isCIDFont) + ) { + var o = n.fdArray, + i = n.fdSelect; + if (0 === o || 0 === i) + throw new Error( + "Font is marked as a CID font, but FDArray and/or FDSelect information is missing", + ); + o = Ge(e, t, y(e, (o += t)).objects, s.objects); + (n._fdArray = o), + (n._fdSelect = (function (e, t, r, o) { + var n, + s = [], + i = new R.Parser(e, t); + if (0 === (e = i.parseCard8())) + for (var a = 0; a < r; a++) { + if (o <= (n = i.parseCard8())) + throw new Error( + "CFF table CID Font FDSelect has bad FD index value " + + n + + " (FD count " + + o + + ")", + ); + s.push(n); + } + else { + if (3 !== e) + throw new Error( + "CFF Table CID Font FDSelect table has unsupported format " + + e, + ); + var l, + u = i.parseCard16(), + c = i.parseCard16(); + if (0 !== c) + throw new Error( + "CFF Table CID Font FDSelect format 3 range has bad initial GID " + + c, + ); + for (var d = 0; d < u; d++) { + if ( + ((n = i.parseCard8()), + (l = i.parseCard16()), + o <= n) + ) + throw new Error( + "CFF table CID Font FDSelect has bad FD index value " + + n + + " (FD count " + + o + + ")", + ); + if (r < l) + throw new Error( + "CFF Table CID Font FDSelect format 3 range has bad GID " + + l, + ); + for (; c < l; c++) s.push(n); + c = l; + } + if (l !== r) + throw new Error( + "CFF Table CID Font FDSelect format 3 range has bad final GID " + + l, + ); + } + return s; + })(e, (i += t), r.numGlyphs, o.length)); + } + var i = t + n.private[1], + o = Be(e, i, n.private[0], s.objects), + a = + ((r.defaultWidthX = o.defaultWidthX), + (r.nominalWidthX = o.nominalWidthX), + 0 !== o.subrs + ? ((i = y(e, i + o.subrs)), + (r.subrs = i.objects), + (r.subrsBias = Le(r.subrs))) + : ((r.subrs = []), (r.subrsBias = 0)), + y(e, t + n.charStrings)), + o = + ((r.nGlyphs = a.objects.length), + (function (e, t, r, o) { + var n = new R.Parser(e, t), + s = (--r, [".notdef"]); + if (0 === (e = n.parseCard8())) + for (var i = 0; i < r; i += 1) + (a = n.parseSID()), s.push(De(o, a)); + else if (1 === e) + for (; s.length <= r; ) + for ( + var a = n.parseSID(), l = n.parseCard8(), u = 0; + u <= l; + u += 1 + ) + s.push(De(o, a)), (a += 1); + else { + if (2 !== e) + throw new Error("Unknown charset format " + e); + for (; s.length <= r; ) { + (a = n.parseSID()), (l = n.parseCard16()); + for (var c = 0; c <= l; c += 1) + s.push(De(o, a)), (a += 1); + } + } + return s; + })(e, t + n.charset, r.nGlyphs, s.objects)); + 0 === n.encoding + ? (r.cffEncoding = new Ce(Te, o)) + : 1 === n.encoding + ? (r.cffEncoding = new Ce(Me, o)) + : (r.cffEncoding = (function (e, t, r) { + var o = {}, + n = new R.Parser(e, t); + if (0 === (e = n.parseCard8())) + for (var s = n.parseCard8(), i = 0; i < s; i += 1) + o[(l = n.parseCard8())] = i; + else { + if (1 !== e) + throw new Error("Unknown encoding format " + e); + for ( + var a = n.parseCard8(), l = 1, u = 0; + u < a; + u += 1 + ) + for ( + var c = n.parseCard8(), + d = n.parseCard8(), + h = c; + h <= c + d; + h += 1 + ) + (o[h] = l), (l += 1); + } + return new Ce(o, r); + })(e, t + n.encoding, o)), + (r.encoding = r.encoding || r.cffEncoding), + (r.glyphs = new p.GlyphSet(r)); + for (var l = 0; l < r.nGlyphs; l += 1) { + var u = a.objects[l]; + r.glyphs.push(l, p.cffGlyphLoader(r, l, Ve, u)); + } + }, + make: function (e, t) { + for ( + var r, + o = new S.Table("CFF ", [ + { name: "header", type: "RECORD" }, + { name: "nameIndex", type: "RECORD" }, + { name: "topDictIndex", type: "RECORD" }, + { name: "stringIndex", type: "RECORD" }, + { name: "globalSubrIndex", type: "RECORD" }, + { name: "charsets", type: "RECORD" }, + { name: "charStringsIndex", type: "RECORD" }, + { name: "privateDict", type: "RECORD" }, + ]), + n = 1 / t.unitsPerEm, + n = { + version: t.version, + fullName: t.fullName, + familyName: t.familyName, + weight: t.weightName, + fontBBox: t.fontBBox || [0, 0, 0, 0], + fontMatrix: [n, 0, 0, n, 0, 0], + charset: 999, + encoding: 0, + charStrings: 999, + private: [0, 999], + }, + s = [], + i = 1; + i < e.length; + i += 1 + ) + (r = e.get(i)), s.push(r.name); + var a, + l, + u = [], + t = + ((o.header = new S.Record("Header", [ + { name: "major", type: "Card8", value: 1 }, + { name: "minor", type: "Card8", value: 0 }, + { name: "hdrSize", type: "Card8", value: 4 }, + { name: "major", type: "Card8", value: 1 }, + ])), + (o.nameIndex = (function (e) { + var t = new S.Record("Name INDEX", [ + { name: "names", type: "INDEX", value: [] }, + ]); + t.names = []; + for (var r = 0; r < e.length; r += 1) + t.names.push({ + name: "name_" + r, + type: "NAME", + value: e[r], + }); + return t; + })([t.postScriptName])), + We(n, u)), + c = + ((o.topDictIndex = qe(t)), + (o.globalSubrIndex = new S.Record("Global Subr INDEX", [ + { name: "subrs", type: "INDEX", value: [] }, + ])), + (o.charsets = (function (e, t) { + for ( + var r = new S.Record("Charsets", [ + { name: "format", type: "Card8", value: 0 }, + ]), + o = 0; + o < e.length; + o += 1 + ) { + var n = ze(e[o], t); + r.fields.push({ + name: "glyph_" + o, + type: "SID", + value: n, + }); + } + return r; + })(s, u)), + (o.charStringsIndex = Xe(e)), + (o.privateDict = + ((c = {}), + (a = u), + ((l = new S.Record("Private DICT", [ + { name: "dict", type: "DICT", value: {} }, + ])).dict = He(Ne, c, a)), + l)), + (o.stringIndex = (function (e) { + var t = new S.Record("String INDEX", [ + { name: "strings", type: "INDEX", value: [] }, + ]); + t.strings = []; + for (var r = 0; r < e.length; r += 1) + t.strings.push({ + name: "string_" + r, + type: "STRING", + value: e[r], + }); + return t; + })(u)), + o.header.sizeOf() + + o.nameIndex.sizeOf() + + o.topDictIndex.sizeOf() + + o.stringIndex.sizeOf() + + o.globalSubrIndex.sizeOf()); + return ( + (n.charset = c), + (n.encoding = 0), + (n.charStrings = n.charset + o.charsets.sizeOf()), + (n.private[1] = + n.charStrings + o.charStringsIndex.sizeOf()), + (t = We(n, u)), + (o.topDictIndex = qe(t)), + o + ); + }, + }; + var Ze = { + parse: function (e, t) { + var r = {}, + e = new R.Parser(e, t); + return ( + (r.version = e.parseVersion()), + (r.fontRevision = Math.round(1e3 * e.parseFixed()) / 1e3), + (r.checkSumAdjustment = e.parseULong()), + (r.magicNumber = e.parseULong()), + L.argument( + 1594834165 === r.magicNumber, + "Font header has wrong magic number.", + ), + (r.flags = e.parseUShort()), + (r.unitsPerEm = e.parseUShort()), + (r.created = e.parseLongDateTime()), + (r.modified = e.parseLongDateTime()), + (r.xMin = e.parseShort()), + (r.yMin = e.parseShort()), + (r.xMax = e.parseShort()), + (r.yMax = e.parseShort()), + (r.macStyle = e.parseUShort()), + (r.lowestRecPPEM = e.parseUShort()), + (r.fontDirectionHint = e.parseShort()), + (r.indexToLocFormat = e.parseShort()), + (r.glyphDataFormat = e.parseShort()), + r + ); + }, + make: function (e) { + var t = Math.round(new Date().getTime() / 1e3) + 2082844800, + r = t; + return ( + e.createdTimestamp && + (r = e.createdTimestamp + 2082844800), + new S.Table( + "head", + [ + { name: "version", type: "FIXED", value: 65536 }, + { name: "fontRevision", type: "FIXED", value: 65536 }, + { + name: "checkSumAdjustment", + type: "ULONG", + value: 0, + }, + { + name: "magicNumber", + type: "ULONG", + value: 1594834165, + }, + { name: "flags", type: "USHORT", value: 0 }, + { name: "unitsPerEm", type: "USHORT", value: 1e3 }, + { name: "created", type: "LONGDATETIME", value: r }, + { name: "modified", type: "LONGDATETIME", value: t }, + { name: "xMin", type: "SHORT", value: 0 }, + { name: "yMin", type: "SHORT", value: 0 }, + { name: "xMax", type: "SHORT", value: 0 }, + { name: "yMax", type: "SHORT", value: 0 }, + { name: "macStyle", type: "USHORT", value: 0 }, + { name: "lowestRecPPEM", type: "USHORT", value: 0 }, + { + name: "fontDirectionHint", + type: "SHORT", + value: 2, + }, + { name: "indexToLocFormat", type: "SHORT", value: 0 }, + { name: "glyphDataFormat", type: "SHORT", value: 0 }, + ], + e, + ) + ); + }, + }; + var Qe = { + parse: function (e, t) { + var r = {}, + e = new R.Parser(e, t); + return ( + (r.version = e.parseVersion()), + (r.ascender = e.parseShort()), + (r.descender = e.parseShort()), + (r.lineGap = e.parseShort()), + (r.advanceWidthMax = e.parseUShort()), + (r.minLeftSideBearing = e.parseShort()), + (r.minRightSideBearing = e.parseShort()), + (r.xMaxExtent = e.parseShort()), + (r.caretSlopeRise = e.parseShort()), + (r.caretSlopeRun = e.parseShort()), + (r.caretOffset = e.parseShort()), + (e.relativeOffset += 8), + (r.metricDataFormat = e.parseShort()), + (r.numberOfHMetrics = e.parseUShort()), + r + ); + }, + make: function (e) { + return new S.Table( + "hhea", + [ + { name: "version", type: "FIXED", value: 65536 }, + { name: "ascender", type: "FWORD", value: 0 }, + { name: "descender", type: "FWORD", value: 0 }, + { name: "lineGap", type: "FWORD", value: 0 }, + { name: "advanceWidthMax", type: "UFWORD", value: 0 }, + { name: "minLeftSideBearing", type: "FWORD", value: 0 }, + { + name: "minRightSideBearing", + type: "FWORD", + value: 0, + }, + { name: "xMaxExtent", type: "FWORD", value: 0 }, + { name: "caretSlopeRise", type: "SHORT", value: 1 }, + { name: "caretSlopeRun", type: "SHORT", value: 0 }, + { name: "caretOffset", type: "SHORT", value: 0 }, + { name: "reserved1", type: "SHORT", value: 0 }, + { name: "reserved2", type: "SHORT", value: 0 }, + { name: "reserved3", type: "SHORT", value: 0 }, + { name: "reserved4", type: "SHORT", value: 0 }, + { name: "metricDataFormat", type: "SHORT", value: 0 }, + { name: "numberOfHMetrics", type: "USHORT", value: 0 }, + ], + e, + ); + }, + }; + var Je = { + parse: function (e, t, r, o, n) { + for ( + var s, i, a = new R.Parser(e, t), l = 0; + l < o; + l += 1 + ) { + l < r && ((s = a.parseUShort()), (i = a.parseShort())); + var u = n.get(l); + (u.advanceWidth = s), (u.leftSideBearing = i); + } + }, + make: function (e) { + for ( + var t = new S.Table("hmtx", []), r = 0; + r < e.length; + r += 1 + ) { + var o = e.get(r), + n = o.advanceWidth || 0, + o = o.leftSideBearing || 0; + t.fields.push({ + name: "advanceWidth_" + r, + type: "USHORT", + value: n, + }), + t.fields.push({ + name: "leftSideBearing_" + r, + type: "SHORT", + value: o, + }); + } + return t; + }, + }; + var Ke = { + make: function (e) { + for ( + var t = new S.Table("ltag", [ + { name: "version", type: "ULONG", value: 1 }, + { name: "flags", type: "ULONG", value: 0 }, + { name: "numTags", type: "ULONG", value: e.length }, + ]), + r = "", + o = 12 + 4 * e.length, + n = 0; + n < e.length; + ++n + ) { + var s = r.indexOf(e[n]); + s < 0 && ((s = r.length), (r += e[n])), + t.fields.push({ + name: "offset " + n, + type: "USHORT", + value: o + s, + }), + t.fields.push({ + name: "length " + n, + type: "USHORT", + value: e[n].length, + }); + } + return ( + t.fields.push({ + name: "stringPool", + type: "CHARARRAY", + value: r, + }), + t + ); + }, + parse: function (e, t) { + for ( + var r = new R.Parser(e, t), + o = r.parseULong(), + n = + (L.argument( + 1 === o, + "Unsupported ltag table version.", + ), + r.skip("uLong", 1), + r.parseULong()), + s = [], + i = 0; + i < n; + i++ + ) { + for ( + var a = "", + l = t + r.parseUShort(), + u = r.parseUShort(), + c = l; + c < l + u; + ++c + ) + a += String.fromCharCode(e.getInt8(c)); + s.push(a); + } + return s; + }, + }; + var $e = { + parse: function (e, t) { + var r = {}, + e = new R.Parser(e, t); + return ( + (r.version = e.parseVersion()), + (r.numGlyphs = e.parseUShort()), + 1 === r.version && + ((r.maxPoints = e.parseUShort()), + (r.maxContours = e.parseUShort()), + (r.maxCompositePoints = e.parseUShort()), + (r.maxCompositeContours = e.parseUShort()), + (r.maxZones = e.parseUShort()), + (r.maxTwilightPoints = e.parseUShort()), + (r.maxStorage = e.parseUShort()), + (r.maxFunctionDefs = e.parseUShort()), + (r.maxInstructionDefs = e.parseUShort()), + (r.maxStackElements = e.parseUShort()), + (r.maxSizeOfInstructions = e.parseUShort()), + (r.maxComponentElements = e.parseUShort()), + (r.maxComponentDepth = e.parseUShort())), + r + ); + }, + make: function (e) { + return new S.Table("maxp", [ + { name: "version", type: "FIXED", value: 20480 }, + { name: "numGlyphs", type: "USHORT", value: e }, + ]); + }, + }, + et = [ + "copyright", + "fontFamily", + "fontSubfamily", + "uniqueID", + "fullName", + "version", + "postScriptName", + "trademark", + "manufacturer", + "designer", + "description", + "manufacturerURL", + "designerURL", + "license", + "licenseURL", + "reserved", + "preferredFamily", + "preferredSubfamily", + "compatibleFullName", + "sampleText", + "postScriptFindFontName", + "wwsFamily", + "wwsSubfamily", + ], + tt = { + 0: "en", + 1: "fr", + 2: "de", + 3: "it", + 4: "nl", + 5: "sv", + 6: "es", + 7: "da", + 8: "pt", + 9: "no", + 10: "he", + 11: "ja", + 12: "ar", + 13: "fi", + 14: "el", + 15: "is", + 16: "mt", + 17: "tr", + 18: "hr", + 19: "zh-Hant", + 20: "ur", + 21: "hi", + 22: "th", + 23: "ko", + 24: "lt", + 25: "pl", + 26: "hu", + 27: "es", + 28: "lv", + 29: "se", + 30: "fo", + 31: "fa", + 32: "ru", + 33: "zh", + 34: "nl-BE", + 35: "ga", + 36: "sq", + 37: "ro", + 38: "cz", + 39: "sk", + 40: "si", + 41: "yi", + 42: "sr", + 43: "mk", + 44: "bg", + 45: "uk", + 46: "be", + 47: "uz", + 48: "kk", + 49: "az-Cyrl", + 50: "az-Arab", + 51: "hy", + 52: "ka", + 53: "mo", + 54: "ky", + 55: "tg", + 56: "tk", + 57: "mn-CN", + 58: "mn", + 59: "ps", + 60: "ks", + 61: "ku", + 62: "sd", + 63: "bo", + 64: "ne", + 65: "sa", + 66: "mr", + 67: "bn", + 68: "as", + 69: "gu", + 70: "pa", + 71: "or", + 72: "ml", + 73: "kn", + 74: "ta", + 75: "te", + 76: "si", + 77: "my", + 78: "km", + 79: "lo", + 80: "vi", + 81: "id", + 82: "tl", + 83: "ms", + 84: "ms-Arab", + 85: "am", + 86: "ti", + 87: "om", + 88: "so", + 89: "sw", + 90: "rw", + 91: "rn", + 92: "ny", + 93: "mg", + 94: "eo", + 128: "cy", + 129: "eu", + 130: "ca", + 131: "la", + 132: "qu", + 133: "gn", + 134: "ay", + 135: "tt", + 136: "ug", + 137: "dz", + 138: "jv", + 139: "su", + 140: "gl", + 141: "af", + 142: "br", + 143: "iu", + 144: "gd", + 145: "gv", + 146: "ga", + 147: "to", + 148: "el-polyton", + 149: "kl", + 150: "az", + 151: "nn", + }, + rt = { + 0: 0, + 1: 0, + 2: 0, + 3: 0, + 4: 0, + 5: 0, + 6: 0, + 7: 0, + 8: 0, + 9: 0, + 10: 5, + 11: 1, + 12: 4, + 13: 0, + 14: 6, + 15: 0, + 16: 0, + 17: 0, + 18: 0, + 19: 2, + 20: 4, + 21: 9, + 22: 21, + 23: 3, + 24: 29, + 25: 29, + 26: 29, + 27: 29, + 28: 29, + 29: 0, + 30: 0, + 31: 4, + 32: 7, + 33: 25, + 34: 0, + 35: 0, + 36: 0, + 37: 0, + 38: 29, + 39: 29, + 40: 0, + 41: 5, + 42: 7, + 43: 7, + 44: 7, + 45: 7, + 46: 7, + 47: 7, + 48: 7, + 49: 7, + 50: 4, + 51: 24, + 52: 23, + 53: 7, + 54: 7, + 55: 7, + 56: 7, + 57: 27, + 58: 7, + 59: 4, + 60: 4, + 61: 4, + 62: 4, + 63: 26, + 64: 9, + 65: 9, + 66: 9, + 67: 13, + 68: 13, + 69: 11, + 70: 10, + 71: 12, + 72: 17, + 73: 16, + 74: 14, + 75: 15, + 76: 18, + 77: 19, + 78: 20, + 79: 22, + 80: 30, + 81: 0, + 82: 0, + 83: 0, + 84: 4, + 85: 28, + 86: 28, + 87: 28, + 88: 0, + 89: 0, + 90: 0, + 91: 0, + 92: 0, + 93: 0, + 94: 0, + 128: 0, + 129: 0, + 130: 0, + 131: 0, + 132: 0, + 133: 0, + 134: 0, + 135: 7, + 136: 4, + 137: 26, + 138: 0, + 139: 0, + 140: 0, + 141: 0, + 142: 0, + 143: 28, + 144: 0, + 145: 0, + 146: 0, + 147: 0, + 148: 6, + 149: 0, + 150: 0, + 151: 0, + }, + ot = { + 1078: "af", + 1052: "sq", + 1156: "gsw", + 1118: "am", + 5121: "ar-DZ", + 15361: "ar-BH", + 3073: "ar", + 2049: "ar-IQ", + 11265: "ar-JO", + 13313: "ar-KW", + 12289: "ar-LB", + 4097: "ar-LY", + 6145: "ary", + 8193: "ar-OM", + 16385: "ar-QA", + 1025: "ar-SA", + 10241: "ar-SY", + 7169: "aeb", + 14337: "ar-AE", + 9217: "ar-YE", + 1067: "hy", + 1101: "as", + 2092: "az-Cyrl", + 1068: "az", + 1133: "ba", + 1069: "eu", + 1059: "be", + 2117: "bn", + 1093: "bn-IN", + 8218: "bs-Cyrl", + 5146: "bs", + 1150: "br", + 1026: "bg", + 1027: "ca", + 3076: "zh-HK", + 5124: "zh-MO", + 2052: "zh", + 4100: "zh-SG", + 1028: "zh-TW", + 1155: "co", + 1050: "hr", + 4122: "hr-BA", + 1029: "cs", + 1030: "da", + 1164: "prs", + 1125: "dv", + 2067: "nl-BE", + 1043: "nl", + 3081: "en-AU", + 10249: "en-BZ", + 4105: "en-CA", + 9225: "en-029", + 16393: "en-IN", + 6153: "en-IE", + 8201: "en-JM", + 17417: "en-MY", + 5129: "en-NZ", + 13321: "en-PH", + 18441: "en-SG", + 7177: "en-ZA", + 11273: "en-TT", + 2057: "en-GB", + 1033: "en", + 12297: "en-ZW", + 1061: "et", + 1080: "fo", + 1124: "fil", + 1035: "fi", + 2060: "fr-BE", + 3084: "fr-CA", + 1036: "fr", + 5132: "fr-LU", + 6156: "fr-MC", + 4108: "fr-CH", + 1122: "fy", + 1110: "gl", + 1079: "ka", + 3079: "de-AT", + 1031: "de", + 5127: "de-LI", + 4103: "de-LU", + 2055: "de-CH", + 1032: "el", + 1135: "kl", + 1095: "gu", + 1128: "ha", + 1037: "he", + 1081: "hi", + 1038: "hu", + 1039: "is", + 1136: "ig", + 1057: "id", + 1117: "iu", + 2141: "iu-Latn", + 2108: "ga", + 1076: "xh", + 1077: "zu", + 1040: "it", + 2064: "it-CH", + 1041: "ja", + 1099: "kn", + 1087: "kk", + 1107: "km", + 1158: "quc", + 1159: "rw", + 1089: "sw", + 1111: "kok", + 1042: "ko", + 1088: "ky", + 1108: "lo", + 1062: "lv", + 1063: "lt", + 2094: "dsb", + 1134: "lb", + 1071: "mk", + 2110: "ms-BN", + 1086: "ms", + 1100: "ml", + 1082: "mt", + 1153: "mi", + 1146: "arn", + 1102: "mr", + 1148: "moh", + 1104: "mn", + 2128: "mn-CN", + 1121: "ne", + 1044: "nb", + 2068: "nn", + 1154: "oc", + 1096: "or", + 1123: "ps", + 1045: "pl", + 1046: "pt", + 2070: "pt-PT", + 1094: "pa", + 1131: "qu-BO", + 2155: "qu-EC", + 3179: "qu", + 1048: "ro", + 1047: "rm", + 1049: "ru", + 9275: "smn", + 4155: "smj-NO", + 5179: "smj", + 3131: "se-FI", + 1083: "se", + 2107: "se-SE", + 8251: "sms", + 6203: "sma-NO", + 7227: "sms", + 1103: "sa", + 7194: "sr-Cyrl-BA", + 3098: "sr", + 6170: "sr-Latn-BA", + 2074: "sr-Latn", + 1132: "nso", + 1074: "tn", + 1115: "si", + 1051: "sk", + 1060: "sl", + 11274: "es-AR", + 16394: "es-BO", + 13322: "es-CL", + 9226: "es-CO", + 5130: "es-CR", + 7178: "es-DO", + 12298: "es-EC", + 17418: "es-SV", + 4106: "es-GT", + 18442: "es-HN", + 2058: "es-MX", + 19466: "es-NI", + 6154: "es-PA", + 15370: "es-PY", + 10250: "es-PE", + 20490: "es-PR", + 3082: "es", + 1034: "es", + 21514: "es-US", + 14346: "es-UY", + 8202: "es-VE", + 2077: "sv-FI", + 1053: "sv", + 1114: "syr", + 1064: "tg", + 2143: "tzm", + 1097: "ta", + 1092: "tt", + 1098: "te", + 1054: "th", + 1105: "bo", + 1055: "tr", + 1090: "tk", + 1152: "ug", + 1058: "uk", + 1070: "hsb", + 1056: "ur", + 2115: "uz-Cyrl", + 1091: "uz", + 1066: "vi", + 1106: "cy", + 1160: "wo", + 1157: "sah", + 1144: "ii", + 1130: "yo", + }; + var nt = "utf-16", + st = { + 0: "macintosh", + 1: "x-mac-japanese", + 2: "x-mac-chinesetrad", + 3: "x-mac-korean", + 6: "x-mac-greek", + 7: "x-mac-cyrillic", + 9: "x-mac-devanagai", + 10: "x-mac-gurmukhi", + 11: "x-mac-gujarati", + 12: "x-mac-oriya", + 13: "x-mac-bengali", + 14: "x-mac-tamil", + 15: "x-mac-telugu", + 16: "x-mac-kannada", + 17: "x-mac-malayalam", + 18: "x-mac-sinhalese", + 19: "x-mac-burmese", + 20: "x-mac-khmer", + 21: "x-mac-thai", + 22: "x-mac-lao", + 23: "x-mac-georgian", + 24: "x-mac-armenian", + 25: "x-mac-chinesesimp", + 26: "x-mac-tibetan", + 27: "x-mac-mongolian", + 28: "x-mac-ethiopic", + 29: "x-mac-ce", + 30: "x-mac-vietnamese", + 31: "x-mac-extarabic", + }, + it = { + 15: "x-mac-icelandic", + 17: "x-mac-turkish", + 18: "x-mac-croatian", + 24: "x-mac-ce", + 25: "x-mac-ce", + 26: "x-mac-ce", + 27: "x-mac-ce", + 28: "x-mac-ce", + 30: "x-mac-icelandic", + 37: "x-mac-romanian", + 38: "x-mac-ce", + 39: "x-mac-ce", + 40: "x-mac-ce", + 143: "x-mac-inuit", + 146: "x-mac-gaelic", + }; + function at(e, t, r) { + switch (e) { + case 0: + return nt; + case 1: + return it[r] || st[t]; + case 3: + if (1 === t || 10 === t) return nt; + } + } + function lt(e) { + var t, + r = {}; + for (t in e) r[e[t]] = parseInt(t); + return r; + } + function ut(e, t, r, o, n, s) { + return new S.Record("NameRecord", [ + { name: "platformID", type: "USHORT", value: e }, + { name: "encodingID", type: "USHORT", value: t }, + { name: "languageID", type: "USHORT", value: r }, + { name: "nameID", type: "USHORT", value: o }, + { name: "length", type: "USHORT", value: n }, + { name: "offset", type: "USHORT", value: s }, + ]); + } + function ct(e, t) { + if ( + (r = (function (e, t) { + var r = e.length, + o = t.length - r + 1; + e: for (var n = 0; n < o; n++) + for (; n < o; n++) { + for (var s = 0; s < r; s++) + if (t[n + s] !== e[s]) continue e; + return n; + } + return -1; + })(e, t)) < 0 + ) + for (var r = t.length, o = 0, n = e.length; o < n; ++o) + t.push(e[o]); + return r; + } + var dt = { + parse: function (e, t, r) { + for ( + var o = {}, + n = new R.Parser(e, t), + t = n.parseUShort(), + s = n.parseUShort(), + i = n.offset + n.parseUShort(), + a = 0; + a < s; + a++ + ) { + var l = n.parseUShort(), + u = n.parseUShort(), + c = n.parseUShort(), + d = n.parseUShort(), + d = et[d] || d, + h = n.parseUShort(), + f = n.parseUShort(), + p = (function (e, t, r) { + switch (e) { + case 0: + if (65535 === t) return "und"; + if (r) return r[t]; + break; + case 1: + return tt[t]; + case 3: + return ot[t]; + } + })(l, c, r), + l = at(l, u, c); + void 0 !== l && + void 0 !== p && + ((u = void 0), + (u = + l === nt + ? m.UTF16(e, i + f, h) + : m.MACSTRING(e, i + f, h, l)) && + ((c = void 0 === (c = o[d]) ? (o[d] = {}) : c)[p] = + u)); + } + return 1 === t && n.parseUShort(), o; + }, + make: function (e, t) { + var r, + o = [], + n = {}, + s = lt(et); + for (r in e) { + var i = s[r]; + if ( + (void 0 === i && (i = r), (h = parseInt(i)), isNaN(h)) + ) + throw new Error( + 'Name table entry "' + + r + + '" does not exist, see nameTableNames for complete list.', + ); + (n[h] = e[r]), o.push(h); + } + for ( + var a = lt(tt), l = lt(ot), u = [], c = [], d = 0; + d < o.length; + d++ + ) { + var h, + f, + p = n[(h = o[d])]; + for (f in p) { + var m = p[f], + y = 1, + g = a[f], + v = rt[g], + b = at(y, v, g), + b = w.MACSTRING(m, b), + j = + (void 0 === b && + ((y = 0), + (g = t.indexOf(f)) < 0 && + ((g = t.length), t.push(f)), + (v = 4), + (b = w.UTF16(m))), + ct(b, c)), + y = (u.push(ut(y, v, g, h, b.length, j)), l[f]); + void 0 !== y && + ((g = ct((v = w.UTF16(m)), c)), + u.push(ut(3, 1, y, h, v.length, g))); + } + } + u.sort(function (e, t) { + return ( + e.platformID - t.platformID || + e.encodingID - t.encodingID || + e.languageID - t.languageID || + e.nameID - t.nameID + ); + }); + for ( + var _ = new S.Table("name", [ + { name: "format", type: "USHORT", value: 0 }, + { name: "count", type: "USHORT", value: u.length }, + { + name: "stringOffset", + type: "USHORT", + value: 6 + 12 * u.length, + }, + ]), + x = 0; + x < u.length; + x++ + ) + _.fields.push({ + name: "record_" + x, + type: "RECORD", + value: u[x], + }); + return ( + _.fields.push({ + name: "strings", + type: "LITERAL", + value: c, + }), + _ + ); + }, + }, + ht = [ + { begin: 0, end: 127 }, + { begin: 128, end: 255 }, + { begin: 256, end: 383 }, + { begin: 384, end: 591 }, + { begin: 592, end: 687 }, + { begin: 688, end: 767 }, + { begin: 768, end: 879 }, + { begin: 880, end: 1023 }, + { begin: 11392, end: 11519 }, + { begin: 1024, end: 1279 }, + { begin: 1328, end: 1423 }, + { begin: 1424, end: 1535 }, + { begin: 42240, end: 42559 }, + { begin: 1536, end: 1791 }, + { begin: 1984, end: 2047 }, + { begin: 2304, end: 2431 }, + { begin: 2432, end: 2559 }, + { begin: 2560, end: 2687 }, + { begin: 2688, end: 2815 }, + { begin: 2816, end: 2943 }, + { begin: 2944, end: 3071 }, + { begin: 3072, end: 3199 }, + { begin: 3200, end: 3327 }, + { begin: 3328, end: 3455 }, + { begin: 3584, end: 3711 }, + { begin: 3712, end: 3839 }, + { begin: 4256, end: 4351 }, + { begin: 6912, end: 7039 }, + { begin: 4352, end: 4607 }, + { begin: 7680, end: 7935 }, + { begin: 7936, end: 8191 }, + { begin: 8192, end: 8303 }, + { begin: 8304, end: 8351 }, + { begin: 8352, end: 8399 }, + { begin: 8400, end: 8447 }, + { begin: 8448, end: 8527 }, + { begin: 8528, end: 8591 }, + { begin: 8592, end: 8703 }, + { begin: 8704, end: 8959 }, + { begin: 8960, end: 9215 }, + { begin: 9216, end: 9279 }, + { begin: 9280, end: 9311 }, + { begin: 9312, end: 9471 }, + { begin: 9472, end: 9599 }, + { begin: 9600, end: 9631 }, + { begin: 9632, end: 9727 }, + { begin: 9728, end: 9983 }, + { begin: 9984, end: 10175 }, + { begin: 12288, end: 12351 }, + { begin: 12352, end: 12447 }, + { begin: 12448, end: 12543 }, + { begin: 12544, end: 12591 }, + { begin: 12592, end: 12687 }, + { begin: 43072, end: 43135 }, + { begin: 12800, end: 13055 }, + { begin: 13056, end: 13311 }, + { begin: 44032, end: 55215 }, + { begin: 55296, end: 57343 }, + { begin: 67840, end: 67871 }, + { begin: 19968, end: 40959 }, + { begin: 57344, end: 63743 }, + { begin: 12736, end: 12783 }, + { begin: 64256, end: 64335 }, + { begin: 64336, end: 65023 }, + { begin: 65056, end: 65071 }, + { begin: 65040, end: 65055 }, + { begin: 65104, end: 65135 }, + { begin: 65136, end: 65279 }, + { begin: 65280, end: 65519 }, + { begin: 65520, end: 65535 }, + { begin: 3840, end: 4095 }, + { begin: 1792, end: 1871 }, + { begin: 1920, end: 1983 }, + { begin: 3456, end: 3583 }, + { begin: 4096, end: 4255 }, + { begin: 4608, end: 4991 }, + { begin: 5024, end: 5119 }, + { begin: 5120, end: 5759 }, + { begin: 5760, end: 5791 }, + { begin: 5792, end: 5887 }, + { begin: 6016, end: 6143 }, + { begin: 6144, end: 6319 }, + { begin: 10240, end: 10495 }, + { begin: 40960, end: 42127 }, + { begin: 5888, end: 5919 }, + { begin: 66304, end: 66351 }, + { begin: 66352, end: 66383 }, + { begin: 66560, end: 66639 }, + { begin: 118784, end: 119039 }, + { begin: 119808, end: 120831 }, + { begin: 1044480, end: 1048573 }, + { begin: 65024, end: 65039 }, + { begin: 917504, end: 917631 }, + { begin: 6400, end: 6479 }, + { begin: 6480, end: 6527 }, + { begin: 6528, end: 6623 }, + { begin: 6656, end: 6687 }, + { begin: 11264, end: 11359 }, + { begin: 11568, end: 11647 }, + { begin: 19904, end: 19967 }, + { begin: 43008, end: 43055 }, + { begin: 65536, end: 65663 }, + { begin: 65856, end: 65935 }, + { begin: 66432, end: 66463 }, + { begin: 66464, end: 66527 }, + { begin: 66640, end: 66687 }, + { begin: 66688, end: 66735 }, + { begin: 67584, end: 67647 }, + { begin: 68096, end: 68191 }, + { begin: 119552, end: 119647 }, + { begin: 73728, end: 74751 }, + { begin: 119648, end: 119679 }, + { begin: 7040, end: 7103 }, + { begin: 7168, end: 7247 }, + { begin: 7248, end: 7295 }, + { begin: 43136, end: 43231 }, + { begin: 43264, end: 43311 }, + { begin: 43312, end: 43359 }, + { begin: 43520, end: 43615 }, + { begin: 65936, end: 65999 }, + { begin: 66e3, end: 66047 }, + { begin: 66208, end: 66271 }, + { begin: 127024, end: 127135 }, + ]; + var ft = { + parse: function (e, t) { + var r = {}, + o = new R.Parser(e, t); + (r.version = o.parseUShort()), + (r.xAvgCharWidth = o.parseShort()), + (r.usWeightClass = o.parseUShort()), + (r.usWidthClass = o.parseUShort()), + (r.fsType = o.parseUShort()), + (r.ySubscriptXSize = o.parseShort()), + (r.ySubscriptYSize = o.parseShort()), + (r.ySubscriptXOffset = o.parseShort()), + (r.ySubscriptYOffset = o.parseShort()), + (r.ySuperscriptXSize = o.parseShort()), + (r.ySuperscriptYSize = o.parseShort()), + (r.ySuperscriptXOffset = o.parseShort()), + (r.ySuperscriptYOffset = o.parseShort()), + (r.yStrikeoutSize = o.parseShort()), + (r.yStrikeoutPosition = o.parseShort()), + (r.sFamilyClass = o.parseShort()), + (r.panose = []); + for (var n = 0; n < 10; n++) r.panose[n] = o.parseByte(); + return ( + (r.ulUnicodeRange1 = o.parseULong()), + (r.ulUnicodeRange2 = o.parseULong()), + (r.ulUnicodeRange3 = o.parseULong()), + (r.ulUnicodeRange4 = o.parseULong()), + (r.achVendID = String.fromCharCode( + o.parseByte(), + o.parseByte(), + o.parseByte(), + o.parseByte(), + )), + (r.fsSelection = o.parseUShort()), + (r.usFirstCharIndex = o.parseUShort()), + (r.usLastCharIndex = o.parseUShort()), + (r.sTypoAscender = o.parseShort()), + (r.sTypoDescender = o.parseShort()), + (r.sTypoLineGap = o.parseShort()), + (r.usWinAscent = o.parseUShort()), + (r.usWinDescent = o.parseUShort()), + 1 <= r.version && + ((r.ulCodePageRange1 = o.parseULong()), + (r.ulCodePageRange2 = o.parseULong())), + 2 <= r.version && + ((r.sxHeight = o.parseShort()), + (r.sCapHeight = o.parseShort()), + (r.usDefaultChar = o.parseUShort()), + (r.usBreakChar = o.parseUShort()), + (r.usMaxContent = o.parseUShort())), + r + ); + }, + make: function (e) { + return new S.Table( + "OS/2", + [ + { name: "version", type: "USHORT", value: 3 }, + { name: "xAvgCharWidth", type: "SHORT", value: 0 }, + { name: "usWeightClass", type: "USHORT", value: 0 }, + { name: "usWidthClass", type: "USHORT", value: 0 }, + { name: "fsType", type: "USHORT", value: 0 }, + { name: "ySubscriptXSize", type: "SHORT", value: 650 }, + { name: "ySubscriptYSize", type: "SHORT", value: 699 }, + { name: "ySubscriptXOffset", type: "SHORT", value: 0 }, + { + name: "ySubscriptYOffset", + type: "SHORT", + value: 140, + }, + { + name: "ySuperscriptXSize", + type: "SHORT", + value: 650, + }, + { + name: "ySuperscriptYSize", + type: "SHORT", + value: 699, + }, + { + name: "ySuperscriptXOffset", + type: "SHORT", + value: 0, + }, + { + name: "ySuperscriptYOffset", + type: "SHORT", + value: 479, + }, + { name: "yStrikeoutSize", type: "SHORT", value: 49 }, + { + name: "yStrikeoutPosition", + type: "SHORT", + value: 258, + }, + { name: "sFamilyClass", type: "SHORT", value: 0 }, + { name: "bFamilyType", type: "BYTE", value: 0 }, + { name: "bSerifStyle", type: "BYTE", value: 0 }, + { name: "bWeight", type: "BYTE", value: 0 }, + { name: "bProportion", type: "BYTE", value: 0 }, + { name: "bContrast", type: "BYTE", value: 0 }, + { name: "bStrokeVariation", type: "BYTE", value: 0 }, + { name: "bArmStyle", type: "BYTE", value: 0 }, + { name: "bLetterform", type: "BYTE", value: 0 }, + { name: "bMidline", type: "BYTE", value: 0 }, + { name: "bXHeight", type: "BYTE", value: 0 }, + { name: "ulUnicodeRange1", type: "ULONG", value: 0 }, + { name: "ulUnicodeRange2", type: "ULONG", value: 0 }, + { name: "ulUnicodeRange3", type: "ULONG", value: 0 }, + { name: "ulUnicodeRange4", type: "ULONG", value: 0 }, + { name: "achVendID", type: "CHARARRAY", value: "XXXX" }, + { name: "fsSelection", type: "USHORT", value: 0 }, + { name: "usFirstCharIndex", type: "USHORT", value: 0 }, + { name: "usLastCharIndex", type: "USHORT", value: 0 }, + { name: "sTypoAscender", type: "SHORT", value: 0 }, + { name: "sTypoDescender", type: "SHORT", value: 0 }, + { name: "sTypoLineGap", type: "SHORT", value: 0 }, + { name: "usWinAscent", type: "USHORT", value: 0 }, + { name: "usWinDescent", type: "USHORT", value: 0 }, + { name: "ulCodePageRange1", type: "ULONG", value: 0 }, + { name: "ulCodePageRange2", type: "ULONG", value: 0 }, + { name: "sxHeight", type: "SHORT", value: 0 }, + { name: "sCapHeight", type: "SHORT", value: 0 }, + { name: "usDefaultChar", type: "USHORT", value: 0 }, + { name: "usBreakChar", type: "USHORT", value: 0 }, + { name: "usMaxContext", type: "USHORT", value: 0 }, + ], + e, + ); + }, + unicodeRanges: ht, + getUnicodeRange: function (e) { + for (var t = 0; t < ht.length; t += 1) { + var r = ht[t]; + if (e >= r.begin && e < r.end) return t; + } + return -1; + }, + }; + var pt = { + parse: function (e, t) { + var r = {}, + o = new R.Parser(e, t); + switch ( + ((r.version = o.parseVersion()), + (r.italicAngle = o.parseFixed()), + (r.underlinePosition = o.parseShort()), + (r.underlineThickness = o.parseShort()), + (r.isFixedPitch = o.parseULong()), + (r.minMemType42 = o.parseULong()), + (r.maxMemType42 = o.parseULong()), + (r.minMemType1 = o.parseULong()), + (r.maxMemType1 = o.parseULong()), + r.version) + ) { + case 1: + r.names = c.slice(); + break; + case 2: + (r.numberOfGlyphs = o.parseUShort()), + (r.glyphNameIndex = new Array(r.numberOfGlyphs)); + for (var n = 0; n < r.numberOfGlyphs; n++) + r.glyphNameIndex[n] = o.parseUShort(); + r.names = []; + for (var s, i = 0; i < r.numberOfGlyphs; i++) + r.glyphNameIndex[i] >= c.length && + ((s = o.parseChar()), + r.names.push(o.parseString(s))); + break; + case 2.5: + (r.numberOfGlyphs = o.parseUShort()), + (r.offset = new Array(r.numberOfGlyphs)); + for (var a = 0; a < r.numberOfGlyphs; a++) + r.offset[a] = o.parseChar(); + } + return r; + }, + make: function () { + return new S.Table("post", [ + { name: "version", type: "FIXED", value: 196608 }, + { name: "italicAngle", type: "FIXED", value: 0 }, + { name: "underlinePosition", type: "FWORD", value: 0 }, + { name: "underlineThickness", type: "FWORD", value: 0 }, + { name: "isFixedPitch", type: "ULONG", value: 0 }, + { name: "minMemType42", type: "ULONG", value: 0 }, + { name: "maxMemType42", type: "ULONG", value: 0 }, + { name: "minMemType1", type: "ULONG", value: 0 }, + { name: "maxMemType1", type: "ULONG", value: 0 }, + ]); + }, + }, + o = new Array(9), + s = + ((o[1] = function () { + var e = this.offset + this.relativeOffset, + t = this.parseUShort(); + return 1 === t + ? { + substFormat: 1, + coverage: this.parsePointer(u.coverage), + deltaGlyphId: this.parseUShort(), + } + : 2 === t + ? { + substFormat: 2, + coverage: this.parsePointer(u.coverage), + substitute: this.parseOffset16List(), + } + : void L.assert( + !1, + "0x" + + e.toString(16) + + ": lookup type 1 format must be 1 or 2.", + ); + }), + (o[2] = function () { + var e = this.parseUShort(); + return ( + L.argument( + 1 === e, + "GSUB Multiple Substitution Subtable identifier-format must be 1", + ), + { + substFormat: e, + coverage: this.parsePointer(u.coverage), + sequences: this.parseListOfLists(), + } + ); + }), + (o[3] = function () { + var e = this.parseUShort(); + return ( + L.argument( + 1 === e, + "GSUB Alternate Substitution Subtable identifier-format must be 1", + ), + { + substFormat: e, + coverage: this.parsePointer(u.coverage), + alternateSets: this.parseListOfLists(), + } + ); + }), + (o[4] = function () { + var e = this.parseUShort(); + return ( + L.argument( + 1 === e, + "GSUB ligature table identifier-format must be 1", + ), + { + substFormat: e, + coverage: this.parsePointer(u.coverage), + ligatureSets: this.parseListOfLists(function () { + return { + ligGlyph: this.parseUShort(), + components: this.parseUShortList( + this.parseUShort() - 1, + ), + }; + }), + } + ); + }), + { sequenceIndex: u.uShort, lookupListIndex: u.uShort }); + (o[5] = function () { + var e, + t, + r = this.offset + this.relativeOffset, + o = this.parseUShort(); + return 1 === o + ? { + substFormat: o, + coverage: this.parsePointer(u.coverage), + ruleSets: this.parseListOfLists(function () { + var e = this.parseUShort(), + t = this.parseUShort(); + return { + input: this.parseUShortList(e - 1), + lookupRecords: this.parseRecordList(t, s), + }; + }), + } + : 2 === o + ? { + substFormat: o, + coverage: this.parsePointer(u.coverage), + classDef: this.parsePointer(u.classDef), + classSets: this.parseListOfLists(function () { + var e = this.parseUShort(), + t = this.parseUShort(); + return { + classes: this.parseUShortList(e - 1), + lookupRecords: this.parseRecordList(t, s), + }; + }), + } + : 3 === o + ? ((e = this.parseUShort()), + (t = this.parseUShort()), + { + substFormat: o, + coverages: this.parseList(e, u.pointer(u.coverage)), + lookupRecords: this.parseRecordList(t, s), + }) + : void L.assert( + !1, + "0x" + + r.toString(16) + + ": lookup type 5 format must be 1, 2 or 3.", + ); + }), + (o[6] = function () { + var e = this.offset + this.relativeOffset, + t = this.parseUShort(); + return 1 === t + ? { + substFormat: 1, + coverage: this.parsePointer(u.coverage), + chainRuleSets: this.parseListOfLists(function () { + return { + backtrack: this.parseUShortList(), + input: this.parseUShortList( + this.parseShort() - 1, + ), + lookahead: this.parseUShortList(), + lookupRecords: this.parseRecordList(s), + }; + }), + } + : 2 === t + ? { + substFormat: 2, + coverage: this.parsePointer(u.coverage), + backtrackClassDef: this.parsePointer(u.classDef), + inputClassDef: this.parsePointer(u.classDef), + lookaheadClassDef: this.parsePointer(u.classDef), + chainClassSet: this.parseListOfLists(function () { + return { + backtrack: this.parseUShortList(), + input: this.parseUShortList( + this.parseShort() - 1, + ), + lookahead: this.parseUShortList(), + lookupRecords: this.parseRecordList(s), + }; + }), + } + : 3 === t + ? { + substFormat: 3, + backtrackCoverage: this.parseList( + u.pointer(u.coverage), + ), + inputCoverage: this.parseList( + u.pointer(u.coverage), + ), + lookaheadCoverage: this.parseList( + u.pointer(u.coverage), + ), + lookupRecords: this.parseRecordList(s), + } + : void L.assert( + !1, + "0x" + + e.toString(16) + + ": lookup type 6 format must be 1, 2 or 3.", + ); + }), + (o[7] = function () { + var e = this.parseUShort(), + e = + (L.argument( + 1 === e, + "GSUB Extension Substitution subtable identifier-format must be 1", + ), + this.parseUShort()), + t = new u(this.data, this.offset + this.parseULong()); + return { + substFormat: 1, + lookupType: e, + extension: o[e].call(t), + }; + }), + (o[8] = function () { + var e = this.parseUShort(); + return ( + L.argument( + 1 === e, + "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1", + ), + { + substFormat: e, + coverage: this.parsePointer(u.coverage), + backtrackCoverage: this.parseList( + u.pointer(u.coverage), + ), + lookaheadCoverage: this.parseList( + u.pointer(u.coverage), + ), + substitutes: this.parseUShortList(), + } + ); + }); + var mt = new Array(9); + (mt[1] = function (e) { + return 1 === e.substFormat + ? new S.Table("substitutionTable", [ + { name: "substFormat", type: "USHORT", value: 1 }, + { + name: "coverage", + type: "TABLE", + value: new S.Coverage(e.coverage), + }, + { + name: "deltaGlyphID", + type: "USHORT", + value: e.deltaGlyphId, + }, + ]) + : new S.Table( + "substitutionTable", + [ + { name: "substFormat", type: "USHORT", value: 2 }, + { + name: "coverage", + type: "TABLE", + value: new S.Coverage(e.coverage), + }, + ].concat(S.ushortList("substitute", e.substitute)), + ); + }), + (mt[3] = function (e) { + return ( + L.assert( + 1 === e.substFormat, + "Lookup type 3 substFormat must be 1.", + ), + new S.Table( + "substitutionTable", + [ + { name: "substFormat", type: "USHORT", value: 1 }, + { + name: "coverage", + type: "TABLE", + value: new S.Coverage(e.coverage), + }, + ].concat( + S.tableList("altSet", e.alternateSets, function (e) { + return new S.Table( + "alternateSetTable", + S.ushortList("alternate", e), + ); + }), + ), + ) + ); + }), + (mt[4] = function (e) { + return ( + L.assert( + 1 === e.substFormat, + "Lookup type 4 substFormat must be 1.", + ), + new S.Table( + "substitutionTable", + [ + { name: "substFormat", type: "USHORT", value: 1 }, + { + name: "coverage", + type: "TABLE", + value: new S.Coverage(e.coverage), + }, + ].concat( + S.tableList("ligSet", e.ligatureSets, function (e) { + return new S.Table( + "ligatureSetTable", + S.tableList("ligature", e, function (e) { + return new S.Table( + "ligatureTable", + [ + { + name: "ligGlyph", + type: "USHORT", + value: e.ligGlyph, + }, + ].concat( + S.ushortList( + "component", + e.components, + e.components.length + 1, + ), + ), + ); + }), + ); + }), + ), + ) + ); + }); + var yt = { + parse: function (e, t) { + return ( + (t = (e = new u(e, (t = t || 0))).parseVersion(1)), + L.argument( + 1 === t || 1.1 === t, + "Unsupported GSUB table version.", + ), + 1 === t + ? { + version: t, + scripts: e.parseScriptList(), + features: e.parseFeatureList(), + lookups: e.parseLookupList(o), + } + : { + version: t, + scripts: e.parseScriptList(), + features: e.parseFeatureList(), + lookups: e.parseLookupList(o), + variations: e.parseFeatureVariationsList(), + } + ); + }, + make: function (e) { + return new S.Table("GSUB", [ + { name: "version", type: "ULONG", value: 65536 }, + { + name: "scripts", + type: "TABLE", + value: new S.ScriptList(e.scripts), + }, + { + name: "features", + type: "TABLE", + value: new S.FeatureList(e.features), + }, + { + name: "lookups", + type: "TABLE", + value: new S.LookupList(e.lookups, mt), + }, + ]); + }, + }; + var gt = { + parse: function (e, t) { + for ( + var r = new R.Parser(e, t), + o = r.parseULong(), + n = + (L.argument( + 1 === o, + "Unsupported META table version.", + ), + r.parseULong(), + r.parseULong(), + r.parseULong()), + s = {}, + i = 0; + i < n; + i++ + ) { + var a = r.parseTag(), + l = r.parseULong(), + u = r.parseULong(), + l = m.UTF8(e, t + l, u); + s[a] = l; + } + return s; + }, + make: function (e) { + var t, + r = Object.keys(e).length, + o = "", + n = 16 + 12 * r, + s = new S.Table("meta", [ + { name: "version", type: "ULONG", value: 1 }, + { name: "flags", type: "ULONG", value: 0 }, + { name: "offset", type: "ULONG", value: n }, + { name: "numTags", type: "ULONG", value: r }, + ]); + for (t in e) { + var i = o.length; + (o += e[t]), + s.fields.push({ + name: "tag " + t, + type: "TAG", + value: t, + }), + s.fields.push({ + name: "offset " + t, + type: "ULONG", + value: n + i, + }), + s.fields.push({ + name: "length " + t, + type: "ULONG", + value: e[t].length, + }); + } + return ( + s.fields.push({ + name: "stringPool", + type: "CHARARRAY", + value: o, + }), + s + ); + }, + }; + function vt(e) { + return (Math.log(e) / Math.log(2)) | 0; + } + function bt(e) { + for (; e.length % 4 != 0; ) e.push(0); + for (var t = 0, r = 0; r < e.length; r += 4) + t += + (e[r] << 24) + + (e[r + 1] << 16) + + (e[r + 2] << 8) + + e[r + 3]; + return (t %= Math.pow(2, 32)); + } + function jt(e, t, r, o) { + return new S.Record("Table Record", [ + { name: "tag", type: "TAG", value: void 0 !== e ? e : "" }, + { + name: "checkSum", + type: "ULONG", + value: void 0 !== t ? t : 0, + }, + { + name: "offset", + type: "ULONG", + value: void 0 !== r ? r : 0, + }, + { + name: "length", + type: "ULONG", + value: void 0 !== o ? o : 0, + }, + ]); + } + function _t(e) { + for ( + var t = new S.Table("sfnt", [ + { name: "version", type: "TAG", value: "OTTO" }, + { name: "numTables", type: "USHORT", value: 0 }, + { name: "searchRange", type: "USHORT", value: 0 }, + { name: "entrySelector", type: "USHORT", value: 0 }, + { name: "rangeShift", type: "USHORT", value: 0 }, + ]), + r = + ((t.tables = e), + (t.numTables = e.length), + Math.pow(2, vt(t.numTables))), + o = + ((t.searchRange = 16 * r), + (t.entrySelector = vt(r)), + (t.rangeShift = 16 * t.numTables - t.searchRange), + []), + n = [], + s = t.sizeOf() + jt().sizeOf() * t.numTables; + s % 4 != 0; + + ) + (s += 1), + n.push({ name: "padding", type: "BYTE", value: 0 }); + for (var i = 0; i < e.length; i += 1) { + var a = e[i], + l = + (L.argument( + 4 === a.tableName.length, + "Table name" + a.tableName + " is invalid.", + ), + a.sizeOf()), + u = jt(a.tableName, bt(a.encode()), s, l); + for ( + o.push({ + name: u.tag + " Table Record", + type: "RECORD", + value: u, + }), + n.push({ + name: a.tableName + " table", + type: "RECORD", + value: a, + }), + s += l, + L.argument( + !isNaN(s), + "Something went wrong calculating the offset.", + ); + s % 4 != 0; + + ) + (s += 1), + n.push({ name: "padding", type: "BYTE", value: 0 }); + } + return ( + o.sort(function (e, t) { + return e.value.tag > t.value.tag ? 1 : -1; + }), + (t.fields = t.fields.concat(o)), + (t.fields = t.fields.concat(n)), + t + ); + } + function xt(e, t, r) { + for (var o = 0; o < t.length; o += 1) { + var n = e.charToGlyphIndex(t[o]); + if (0 < n) return e.glyphs.get(n).getMetrics(); + } + return r; + } + var wt = { + make: _t, + fontToTable: function (e) { + for ( + var t, + r = [], + o = [], + n = [], + s = [], + i = [], + a = [], + l = [], + u = 0, + c = 0, + d = 0, + h = 0, + f = 0, + p = 0; + p < e.glyphs.length; + p += 1 + ) { + var m = e.glyphs.get(p), + y = 0 | m.unicode; + if (isNaN(m.advanceWidth)) + throw new Error( + "Glyph " + + m.name + + " (" + + p + + "): advanceWidth is not a number.", + ); + (y < t || void 0 === t) && 0 < y && (t = y), + u < y && (u = y); + var y = ft.getUnicodeRange(y); + if (y < 32) c |= 1 << y; + else if (y < 64) d |= 1 << (y - 32); + else if (y < 96) h |= 1 << (y - 64); + else { + if (!(y < 123)) + throw new Error( + "Unicode ranges bits > 123 are reserved for internal usage", + ); + f |= 1 << (y - 96); + } + ".notdef" !== m.name && + ((y = m.getMetrics()), + r.push(y.xMin), + o.push(y.yMin), + n.push(y.xMax), + s.push(y.yMax), + a.push(y.leftSideBearing), + l.push(y.rightSideBearing), + i.push(m.advanceWidth)); + } + var g, + v = { + xMin: Math.min.apply(null, r), + yMin: Math.min.apply(null, o), + xMax: Math.max.apply(null, n), + yMax: Math.max.apply(null, s), + advanceWidthMax: Math.max.apply(null, i), + advanceWidthAvg: (function (e) { + for (var t = 0, r = 0; r < e.length; r += 1) + t += e[r]; + return t / e.length; + })(i), + minLeftSideBearing: Math.min.apply(null, a), + maxLeftSideBearing: Math.max.apply(null, a), + minRightSideBearing: Math.min.apply(null, l), + }, + b = + ((v.ascender = e.ascender), + (v.descender = e.descender), + Ze.make({ + flags: 3, + unitsPerEm: e.unitsPerEm, + xMin: v.xMin, + yMin: v.yMin, + xMax: v.xMax, + yMax: v.yMax, + lowestRecPPEM: 3, + createdTimestamp: e.createdTimestamp, + })), + j = Qe.make({ + ascender: v.ascender, + descender: v.descender, + advanceWidthMax: v.advanceWidthMax, + minLeftSideBearing: v.minLeftSideBearing, + minRightSideBearing: v.minRightSideBearing, + xMaxExtent: v.maxLeftSideBearing + (v.xMax - v.xMin), + numberOfHMetrics: e.glyphs.length, + }), + _ = $e.make(e.glyphs.length), + x = ft.make({ + xAvgCharWidth: Math.round(v.advanceWidthAvg), + usWeightClass: e.tables.os2.usWeightClass, + usWidthClass: e.tables.os2.usWidthClass, + usFirstCharIndex: t, + usLastCharIndex: u, + ulUnicodeRange1: c, + ulUnicodeRange2: d, + ulUnicodeRange3: h, + ulUnicodeRange4: f, + fsSelection: e.tables.os2.fsSelection, + sTypoAscender: v.ascender, + sTypoDescender: v.descender, + sTypoLineGap: 0, + usWinAscent: v.yMax, + usWinDescent: Math.abs(v.yMin), + ulCodePageRange1: 1, + sxHeight: xt(e, "xyvw", { + yMax: Math.round(v.ascender / 2), + }).yMax, + sCapHeight: xt(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", v).yMax, + usDefaultChar: e.hasChar(" ") ? 32 : 0, + usBreakChar: e.hasChar(" ") ? 32 : 0, + }), + w = Je.make(e.glyphs), + S = we.make(e.glyphs), + T = e.getEnglishName("fontFamily"), + M = e.getEnglishName("fontSubfamily"), + E = T + " " + M, + k = + (k = e.getEnglishName("postScriptName")) || + T.replace(/\s/g, "") + "-" + M, + C = {}; + for (g in e.names) C[g] = e.names[g]; + C.uniqueID || + (C.uniqueID = { + en: e.getEnglishName("manufacturer") + ":" + E, + }), + C.postScriptName || (C.postScriptName = { en: k }), + C.preferredFamily || + (C.preferredFamily = e.names.fontFamily), + C.preferredSubfamily || + (C.preferredSubfamily = e.names.fontSubfamily); + var O = [], + P = dt.make(C, O), + O = 0 < O.length ? Ke.make(O) : void 0, + A = pt.make(), + E = Ye.make(e.glyphs, { + version: e.getEnglishName("version"), + fullName: E, + familyName: T, + weightName: M, + postScriptName: k, + unitsPerEm: e.unitsPerEm, + fontBBox: [0, v.yMin, v.ascender, v.advanceWidthMax], + }), + T = + e.metas && 0 < Object.keys(e.metas).length + ? gt.make(e.metas) + : void 0, + M = [b, j, _, x, P, S, A, E, w]; + O && M.push(O), + e.tables.gsub && M.push(yt.make(e.tables.gsub)), + T && M.push(T); + for ( + var D = bt((k = _t(M)).encode()), + L = k.fields, + R = !1, + I = 0; + I < L.length; + I += 1 + ) + if ("head table" === L[I].name) { + (L[I].value.checkSumAdjustment = 2981146554 - D), + (R = !0); + break; + } + if (R) return k; + throw new Error( + "Could not find head table with checkSum to adjust.", + ); + }, + computeCheckSum: bt, + }; + function St(e, t) { + for (var r = 0, o = e.length - 1; r <= o; ) { + var n = (r + o) >>> 1, + s = e[n].tag; + if (s === t) return n; + s < t ? (r = 1 + n) : (o = n - 1); + } + return -r - 1; + } + function Tt(e, t) { + for (var r = 0, o = e.length - 1; r <= o; ) { + var n = (r + o) >>> 1, + s = e[n]; + if (s === t) return n; + s < t ? (r = 1 + n) : (o = n - 1); + } + return -r - 1; + } + function Mt(e, t) { + for (var r = 0, o = e.length - 1; r <= o; ) { + var n, + s = (r + o) >>> 1, + i = (n = e[s]).start; + if (i === t) return n; + i < t ? (r = 1 + s) : (o = s - 1); + } + if (0 < r) return t > (n = e[r - 1]).end ? 0 : n; + } + function Et(e, t) { + (this.font = e), (this.tableName = t); + } + function kt(e) { + Et.call(this, e, "gpos"); + } + function i(e) { + Et.call(this, e, "gsub"); + } + function Ct(e, t, r) { + for (var o = e.subtables, n = 0; n < o.length; n++) { + var s = o[n]; + if (s.substFormat === t) return s; + } + if (r) return o.push(r), r; + } + function Ot(e) { + for ( + var t = new ArrayBuffer(e.length), + r = new Uint8Array(t), + o = 0; + o < e.length; + ++o + ) + r[o] = e[o]; + return t; + } + function _(e, t) { + if (!e) throw t; + } + function Pt(e, t, r, o, n) { + var s = + 0 < (t & o) + ? ((s = e.parseByte()), r + (s = 0 == (t & n) ? -s : s)) + : 0 < (t & n) + ? r + : r + e.parseShort(); + return s; + } + function At(e, t, r) { + var o, + n = new R.Parser(t, r); + if ( + ((e.numberOfContours = n.parseShort()), + (e._xMin = n.parseShort()), + (e._yMin = n.parseShort()), + (e._xMax = n.parseShort()), + (e._yMax = n.parseShort()), + 0 < e.numberOfContours) + ) { + for ( + var s = (e.endPointIndices = []), i = 0; + i < e.numberOfContours; + i += 1 + ) + s.push(n.parseUShort()); + (e.instructionLength = n.parseUShort()), + (e.instructions = []); + for (var a = 0; a < e.instructionLength; a += 1) + e.instructions.push(n.parseByte()); + for ( + var l = s[s.length - 1] + 1, u = [], c = 0; + c < l; + c += 1 + ) + if (((o = n.parseByte()), u.push(o), 0 < (8 & o))) + for (var d = n.parseByte(), h = 0; h < d; h += 1) + u.push(o), (c += 1); + if ( + (L.argument(u.length === l, "Bad flags."), 0 < s.length) + ) { + var f, + p = []; + if (0 < l) { + for (var m = 0; m < l; m += 1) + (o = u[m]), + ((f = {}).onCurve = !!(1 & o)), + (f.lastPointOfContour = 0 <= s.indexOf(m)), + p.push(f); + for (var y = 0, g = 0; g < l; g += 1) + (o = u[g]), + ((f = p[g]).x = Pt(n, o, y, 2, 16)), + (y = f.x); + for (var v = 0, b = 0; b < l; b += 1) + (o = u[b]), + ((f = p[b]).y = Pt(n, o, v, 4, 32)), + (v = f.y); + } + e.points = p; + } else e.points = []; + } else if (0 === e.numberOfContours) e.points = []; + else { + (e.isComposite = !0), (e.points = []), (e.components = []); + for (var j = !0; j; ) { + u = n.parseUShort(); + var _ = { + glyphIndex: n.parseUShort(), + xScale: 1, + scale01: 0, + scale10: 0, + yScale: 1, + dx: 0, + dy: 0, + }; + 0 < (1 & u) + ? 0 < (2 & u) + ? ((_.dx = n.parseShort()), (_.dy = n.parseShort())) + : (_.matchedPoints = [ + n.parseUShort(), + n.parseUShort(), + ]) + : 0 < (2 & u) + ? ((_.dx = n.parseChar()), (_.dy = n.parseChar())) + : (_.matchedPoints = [n.parseByte(), n.parseByte()]), + 0 < (8 & u) + ? (_.xScale = _.yScale = n.parseF2Dot14()) + : 0 < (64 & u) + ? ((_.xScale = n.parseF2Dot14()), + (_.yScale = n.parseF2Dot14())) + : 0 < (128 & u) && + ((_.xScale = n.parseF2Dot14()), + (_.scale01 = n.parseF2Dot14()), + (_.scale10 = n.parseF2Dot14()), + (_.yScale = n.parseF2Dot14())), + e.components.push(_), + (j = !!(32 & u)); + } + if (256 & u) { + (e.instructionLength = n.parseUShort()), + (e.instructions = []); + for (var x = 0; x < e.instructionLength; x += 1) + e.instructions.push(n.parseByte()); + } + } + } + function Lt(e, t) { + for (var r = [], o = 0; o < e.length; o += 1) { + var n = e[o], + n = { + x: t.xScale * n.x + t.scale01 * n.y + t.dx, + y: t.scale10 * n.x + t.yScale * n.y + t.dy, + onCurve: n.onCurve, + lastPointOfContour: n.lastPointOfContour, + }; + r.push(n); + } + return r; + } + function Rt(e) { + var t = new h(); + if (e) + for ( + var r = (function (e) { + for ( + var t = [], r = [], o = 0; + o < e.length; + o += 1 + ) { + var n = e[o]; + r.push(n), + n.lastPointOfContour && (t.push(r), (r = [])); + } + return ( + L.argument( + 0 === r.length, + "There are still points left in the current contour.", + ), + t + ); + })(e), + o = 0; + o < r.length; + ++o + ) { + var n, + s = r[o], + i = s[s.length - 1], + a = s[0]; + i.onCurve + ? t.moveTo(i.x, i.y) + : a.onCurve + ? t.moveTo(a.x, a.y) + : ((n = { + x: 0.5 * (i.x + a.x), + y: 0.5 * (i.y + a.y), + }), + t.moveTo(n.x, n.y)); + for (var l = 0; l < s.length; ++l) { + var u, + c = i, + i = a, + a = s[(l + 1) % s.length]; + i.onCurve + ? t.lineTo(i.x, i.y) + : ((u = a), + c.onCurve || (i.x, c.x, i.y, c.y), + a.onCurve || + (u = { + x: 0.5 * (i.x + a.x), + y: 0.5 * (i.y + a.y), + }), + t.quadraticCurveTo(i.x, i.y, u.x, u.y)); + } + t.closePath(); + } + return t; + } + function It(e, t) { + if (t.isComposite) + for (var r = 0; r < t.components.length; r += 1) { + var o = t.components[r], + n = e.get(o.glyphIndex); + if ((n.getPath(), n.points)) { + var s = void 0; + if (void 0 === o.matchedPoints) s = Lt(n.points, o); + else { + if ( + o.matchedPoints[0] > t.points.length - 1 || + o.matchedPoints[1] > n.points.length - 1 + ) + throw Error( + "Matched points out of range in " + t.name, + ); + var i = t.points[o.matchedPoints[0]], + a = n.points[o.matchedPoints[1]], + o = { + xScale: o.xScale, + scale01: o.scale01, + scale10: o.scale10, + yScale: o.yScale, + dx: 0, + dy: 0, + }, + a = Lt([a], o)[0]; + (o.dx = i.x - a.x), + (o.dy = i.y - a.y), + (s = Lt(n.points, o)); + } + t.points = t.points.concat(s); + } + } + return Rt(t.points); + } + ((kt.prototype = Et.prototype = + { + searchTag: St, + binSearch: Tt, + getTable: function (e) { + var t = this.font.tables[this.tableName]; + return (t = + !t && e + ? (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 < e.scripts.length; r++) { + var o = e.scripts[r].tag; + if ("DFLT" === o) return o; + "latn" === o && (t = !0); + } + return t ? "latn" : void 0; + } + }, + getScriptTable: function (e, t) { + var r, + o = this.getTable(t); + if (o) + return ( + (r = o.scripts), + 0 <= (o = St(o.scripts, (e = e || "DFLT"))) + ? r[o].script + : t + ? (r.splice( + -1 - o, + 0, + (t = { + tag: e, + script: { + defaultLangSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [], + }, + langSysRecords: [], + }, + }), + ), + t.script) + : void 0 + ); + }, + getLangSysTable: function (e, t, r) { + var o, + e = this.getScriptTable(e, r); + if (e) + return t && "dflt" !== t && "DFLT" !== t + ? 0 <= (o = St(e.langSysRecords, t)) + ? e.langSysRecords[o].langSys + : r + ? (e.langSysRecords.splice( + -1 - o, + 0, + (r = { + tag: t, + langSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [], + }, + }), + ), + r.langSys) + : void 0 + : e.defaultLangSys; + }, + getFeatureTable: function (e, t, r, o) { + e = this.getLangSysTable(e, t, o); + if (e) { + for ( + var n, + s = e.featureIndexes, + i = this.font.tables[this.tableName].features, + a = 0; + a < s.length; + a++ + ) + if ((n = i[s[a]]).tag === r) return n.feature; + if (o) + return ( + (t = i.length), + L.assert( + 0 === t || r >= i[t - 1].tag, + "Features must be added in alphabetical order.", + ), + i.push( + (n = { + tag: r, + feature: { params: 0, lookupListIndexes: [] }, + }), + ), + s.push(t), + n.feature + ); + } + }, + getLookupTables: function (e, t, r, o, n) { + var e = this.getFeatureTable(e, t, r, n), + s = []; + if (e) { + for ( + var i, + a = e.lookupListIndexes, + l = this.font.tables[this.tableName].lookups, + u = 0; + u < a.length; + u++ + ) + (i = l[a[u]]).lookupType === o && s.push(i); + if (0 === s.length && n) + return ( + (t = l.length), + l.push( + (i = { + lookupType: o, + lookupFlag: 0, + subtables: [], + markFilteringSet: void 0, + }), + ), + a.push(t), + [i] + ); + } + return s; + }, + getGlyphClass: function (e, t) { + switch (e.format) { + case 1: + return e.startGlyph <= t && + t < e.startGlyph + e.classes.length + ? e.classes[t - e.startGlyph] + : 0; + case 2: + var r = Mt(e.ranges, t); + return r ? r.classId : 0; + } + }, + getCoverageIndex: function (e, t) { + switch (e.format) { + case 1: + var r = Tt(e.glyphs, t); + return 0 <= r ? r : -1; + case 2: + r = Mt(e.ranges, t); + return r ? r.index + t - r.start : -1; + } + }, + expandCoverage: function (e) { + if (1 === e.format) return e.glyphs; + for (var t = [], r = e.ranges, o = 0; o < r.length; o++) + for ( + var n = r[o], s = n.start, i = n.end, a = s; + a <= i; + a++ + ) + t.push(a); + return t; + }, + }).init = function () { + var e = this.getDefaultScriptName(); + this.defaultKerningTables = this.getKerningTables(e); + }), + (kt.prototype.getKerningValue = function (e, t, r) { + for (var o = 0; o < e.length; o++) + for (var n = e[o].subtables, s = 0; s < n.length; s++) { + var i = n[s], + a = this.getCoverageIndex(i.coverage, t); + if (!(a < 0)) + switch (i.posFormat) { + case 1: + for ( + var l = i.pairSets[a], u = 0; + u < l.length; + u++ + ) { + var c = l[u]; + if (c.secondGlyph === r) + return (c.value1 && c.value1.xAdvance) || 0; + } + break; + case 2: + var d = this.getGlyphClass(i.classDef1, t), + h = this.getGlyphClass(i.classDef2, r), + d = i.classRecords[d][h]; + return (d.value1 && d.value1.xAdvance) || 0; + } + } + return 0; + }), + (kt.prototype.getKerningTables = function (e, t) { + if (this.font.tables.gpos) + return this.getLookupTables(e, t, "kern", 2); + }), + ((i.prototype = Et.prototype).createDefaultTable = + function () { + return { + version: 1, + scripts: [ + { + tag: "DFLT", + script: { + defaultLangSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [], + }, + langSysRecords: [], + }, + }, + ], + features: [], + lookups: [], + }; + }), + (i.prototype.getSingle = function (e, t, r) { + for ( + var o = [], n = this.getLookupTables(t, r, e, 1), s = 0; + s < n.length; + s++ + ) + for (var i = n[s].subtables, a = 0; a < i.length; a++) { + var l = i[a], + u = this.expandCoverage(l.coverage), + c = void 0; + if (1 === l.substFormat) + for ( + var d = l.deltaGlyphId, c = 0; + c < u.length; + c++ + ) { + var h = u[c]; + o.push({ sub: h, by: h + d }); + } + else { + var f = l.substitute; + for (c = 0; c < u.length; c++) + o.push({ sub: u[c], by: f[c] }); + } + } + return o; + }), + (i.prototype.getAlternates = function (e, t, r) { + for ( + var o = [], n = this.getLookupTables(t, r, e, 3), s = 0; + s < n.length; + s++ + ) + for (var i = n[s].subtables, a = 0; a < i.length; a++) + for ( + var l = i[a], + u = this.expandCoverage(l.coverage), + c = l.alternateSets, + d = 0; + d < u.length; + d++ + ) + o.push({ sub: u[d], by: c[d] }); + return o; + }), + (i.prototype.getLigatures = function (e, t, r) { + for ( + var o = [], n = this.getLookupTables(t, r, e, 4), s = 0; + s < n.length; + s++ + ) + for (var i = n[s].subtables, a = 0; a < i.length; a++) + for ( + var l = i[a], + u = this.expandCoverage(l.coverage), + c = l.ligatureSets, + d = 0; + d < u.length; + d++ + ) + for ( + var h = u[d], f = c[d], p = 0; + p < f.length; + p++ + ) { + var m = f[p]; + o.push({ + sub: [h].concat(m.components), + by: m.ligGlyph, + }); + } + return o; + }), + (i.prototype.addSingle = function (e, t, r, o) { + (r = Ct(this.getLookupTables(r, o, e, 1, !0)[0], 2, { + substFormat: 2, + coverage: { format: 1, glyphs: [] }, + substitute: [], + })), + L.assert( + 1 === r.coverage.format, + "Ligature: unable to modify coverage table format " + + r.coverage.format, + ), + (o = t.sub), + (e = this.binSearch(r.coverage.glyphs, o)); + e < 0 && + (r.coverage.glyphs.splice((e = -1 - e), 0, o), + r.substitute.splice(e, 0, 0)), + (r.substitute[e] = t.by); + }), + (i.prototype.addAlternate = function (e, t, r, o) { + (r = Ct(this.getLookupTables(r, o, e, 3, !0)[0], 1, { + substFormat: 1, + coverage: { format: 1, glyphs: [] }, + alternateSets: [], + })), + L.assert( + 1 === r.coverage.format, + "Ligature: unable to modify coverage table format " + + r.coverage.format, + ), + (o = t.sub), + (e = this.binSearch(r.coverage.glyphs, o)); + e < 0 && + (r.coverage.glyphs.splice((e = -1 - e), 0, o), + r.alternateSets.splice(e, 0, 0)), + (r.alternateSets[e] = t.by); + }), + (i.prototype.addLigature = function (e, t, r, o) { + var r = this.getLookupTables(r, o, e, 4, !0)[0], + o = r.subtables[0], + e = + (o || + (r.subtables[0] = o = + { + substFormat: 1, + coverage: { format: 1, glyphs: [] }, + ligatureSets: [], + }), + L.assert( + 1 === o.coverage.format, + "Ligature: unable to modify coverage table format " + + o.coverage.format, + ), + t.sub[0]), + n = t.sub.slice(1), + r = { ligGlyph: t.by, components: n }, + t = this.binSearch(o.coverage.glyphs, e); + if (0 <= t) { + for (var s = o.ligatureSets[t], i = 0; i < s.length; i++) + if ( + (function (e, t) { + var r = e.length; + if (r === t.length) { + for (var o = 0; o < r; o++) + if (e[o] !== t[o]) return; + return 1; + } + })(s[i].components, n) + ) + return; + s.push(r); + } else + o.coverage.glyphs.splice((t = -1 - t), 0, e), + o.ligatureSets.splice(t, 0, [r]); + }), + (i.prototype.getFeature = function (e, t, r) { + if (/ss\d\d/.test(e)) return this.getSingle(e, t, r); + switch (e) { + case "aalt": + case "salt": + return this.getSingle(e, t, r).concat( + this.getAlternates(e, t, r), + ); + case "dlig": + case "liga": + case "rlig": + return this.getLigatures(e, t, r); + } + }), + (i.prototype.add = function (e, t, r, o) { + if (/ss\d\d/.test(e)) return this.addSingle(e, t, r, o); + switch (e) { + case "aalt": + case "salt": + return "number" == typeof t.by + ? this.addSingle(e, t, r, o) + : this.addAlternate(e, t, r, o); + case "dlig": + case "liga": + case "rlig": + return this.addLigature(e, t, r, o); + } + }); + var Dt = { + getPath: Rt, + parse: function (e, t, r, o) { + for ( + var n = new p.GlyphSet(o), s = 0; + s < r.length - 1; + s += 1 + ) { + var i = r[s]; + i !== r[s + 1] + ? n.push(s, p.ttfGlyphLoader(o, s, At, e, t + i, It)) + : n.push(s, p.glyphLoader(o, s)); + } + return n; + }, + }; + function Ft(e) { + (this.font = e), + (this.getCommands = function (e) { + return Dt.getPath(e).commands; + }), + (this._fpgmState = this._prepState = void 0), + (this._errorState = 0); + } + function Ut(e) { + return e; + } + function Nt(e) { + return Math.sign(e) * Math.round(Math.abs(e)); + } + function Bt(e) { + return (Math.sign(e) * Math.round(Math.abs(2 * e))) / 2; + } + function Gt(e) { + return Math.sign(e) * (Math.round(Math.abs(e) + 0.5) - 0.5); + } + function Vt(e) { + return Math.sign(e) * Math.ceil(Math.abs(e)); + } + function zt(e) { + return Math.sign(e) * Math.floor(Math.abs(e)); + } + function Ht(e) { + var t = this.srPeriod, + r = this.srPhase, + o = 1; + return ( + e < 0 && ((e = -e), (o = -1)), + (e += this.srThreshold - r), + (e = Math.trunc(e / t) * t), + (e += r) < 0 ? r * o : e * o + ); + } + var x = { + x: 1, + y: 0, + axis: "x", + distance: function (e, t, r, o) { + return (r ? e.xo : e.x) - (o ? t.xo : t.x); + }, + interpolate: function (e, t, r, o) { + var n, s, i, a, l, u, c; + if (!o || o === this) + return ( + (n = e.xo - t.xo), + (s = e.xo - r.xo), + (l = t.x - t.xo), + (u = r.x - r.xo), + 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) + ? void (e.x = e.xo + (l + u) / 2) + : void (e.x = e.xo + (l * a + u * i) / c) + ); + (n = o.distance(e, t, !0, !0)), + (s = o.distance(e, r, !0, !0)), + (l = o.distance(t, t, !1, !0)), + (u = o.distance(r, r, !1, !0)), + 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) + ? x.setRelative(e, e, (l + u) / 2, o, !0) + : x.setRelative(e, e, (l * a + u * i) / c, o, !0); + }, + normalSlope: Number.NEGATIVE_INFINITY, + setRelative: function (e, t, r, o, n) { + var s, i; + o && o !== this + ? ((s = n ? t.xo : t.x), + (i = n ? t.yo : t.y), + (s += r * o.x), + (i += r * o.y), + (e.x = s + (e.y - i) / o.normalSlope)) + : (e.x = (n ? t.xo : t.x) + r); + }, + slope: 0, + touch: function (e) { + e.xTouched = !0; + }, + touched: function (e) { + return e.xTouched; + }, + untouch: function (e) { + e.xTouched = !1; + }, + }, + T = { + x: 0, + y: 1, + axis: "y", + distance: function (e, t, r, o) { + return (r ? e.yo : e.y) - (o ? t.yo : t.y); + }, + interpolate: function (e, t, r, o) { + var n, s, i, a, l, u, c; + if (!o || o === this) + return ( + (n = e.yo - t.yo), + (s = e.yo - r.yo), + (l = t.y - t.yo), + (u = r.y - r.yo), + 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) + ? void (e.y = e.yo + (l + u) / 2) + : void (e.y = e.yo + (l * a + u * i) / c) + ); + (n = o.distance(e, t, !0, !0)), + (s = o.distance(e, r, !0, !0)), + (l = o.distance(t, t, !1, !0)), + (u = o.distance(r, r, !1, !0)), + 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) + ? T.setRelative(e, e, (l + u) / 2, o, !0) + : T.setRelative(e, e, (l * a + u * i) / c, o, !0); + }, + normalSlope: 0, + setRelative: function (e, t, r, o, n) { + var s, i; + o && o !== this + ? ((s = n ? t.xo : t.x), + (i = n ? t.yo : t.y), + (s += r * o.x), + (i += r * o.y), + (e.y = i + o.normalSlope * (e.x - s))) + : (e.y = (n ? t.yo : t.y) + r); + }, + slope: Number.POSITIVE_INFINITY, + touch: function (e) { + e.yTouched = !0; + }, + touched: function (e) { + return e.yTouched; + }, + untouch: function (e) { + e.yTouched = !1; + }, + }; + function Wt(e, t) { + (this.x = e), + (this.y = t), + (this.axis = void 0), + (this.slope = t / e), + (this.normalSlope = -e / t), + Object.freeze(this); + } + function qt(e, t) { + var r = Math.sqrt(e * e + t * t); + return ( + (t /= r), + 1 === (e /= r) && 0 === t + ? x + : 0 === e && 1 === t + ? T + : new Wt(e, t) + ); + } + function M(e, t, r, o) { + (this.x = this.xo = Math.round(64 * e) / 64), + (this.y = this.yo = Math.round(64 * t) / 64), + (this.lastPointOfContour = r), + (this.onCurve = o), + (this.prevPointOnContour = void 0), + (this.nextPointOnContour = void 0), + (this.xTouched = !1), + (this.yTouched = !1), + Object.preventExtensions(this); + } + Object.freeze(x), + Object.freeze(T), + (Wt.prototype.distance = function (e, t, r, o) { + return ( + this.x * x.distance(e, t, r, o) + + this.y * T.distance(e, t, r, o) + ); + }), + (Wt.prototype.interpolate = function (e, t, r, o) { + var n = o.distance(e, t, !0, !0), + s = o.distance(e, r, !0, !0), + t = o.distance(t, t, !1, !0), + r = o.distance(r, r, !1, !0), + n = Math.abs(n), + s = Math.abs(s), + i = n + s; + 0 === i + ? this.setRelative(e, e, (t + r) / 2, o, !0) + : this.setRelative(e, e, (t * s + r * n) / i, o, !0); + }), + (Wt.prototype.setRelative = function (e, t, r, o, n) { + var s = n ? t.xo : t.x, + n = n ? t.yo : t.y, + t = s + r * (o = o || this).x, + s = n + r * o.y, + n = o.normalSlope, + r = this.slope, + o = e.x, + i = e.y; + (e.x = (r * o - n * t + s - i) / (r - n)), + (e.y = r * (e.x - o) + i); + }), + (Wt.prototype.touch = function (e) { + (e.xTouched = !0), (e.yTouched = !0); + }), + (M.prototype.nextTouched = function (e) { + for ( + var t = this.nextPointOnContour; + !e.touched(t) && t !== this; + + ) + t = t.nextPointOnContour; + return t; + }), + (M.prototype.prevTouched = function (e) { + for ( + var t = this.prevPointOnContour; + !e.touched(t) && t !== this; + + ) + t = t.prevPointOnContour; + return t; + }); + var Xt = Object.freeze(new M(0, 0)), + Yt = { + cvCutIn: 17 / 16, + deltaBase: 9, + deltaShift: 0.125, + loop: 1, + minDis: 1, + autoFlip: !0, + }; + function E(e, t) { + switch ( + ((this.env = e), (this.stack = []), (this.prog = t), e) + ) { + case "glyf": + (this.zp0 = this.zp1 = this.zp2 = 1), + (this.rp0 = this.rp1 = this.rp2 = 0); + case "prep": + (this.fv = this.pv = this.dpv = x), (this.round = Nt); + } + } + function Zt(e) { + for ( + var t = (e.tZone = new Array(e.gZone.length)), r = 0; + r < t.length; + r++ + ) + t[r] = new M(0, 0); + } + function Qt(e, t) { + var r, + o = e.prog, + n = e.ip, + s = 1; + do { + if (88 === (r = o[++n])) s++; + else if (89 === r) s--; + else if (64 === r) n += o[n + 1] + 1; + else if (65 === r) n += 2 * o[n + 1] + 1; + else if (176 <= r && r <= 183) n += r - 176 + 1; + else if (184 <= r && r <= 191) n += 2 * (r - 184 + 1); + else if (t && 1 === s && 27 === r) break; + } while (0 < s); + e.ip = n; + } + function Jt(e, t) { + j.DEBUG && console.log(t.step, "SVTCA[" + e.axis + "]"), + (t.fv = t.pv = t.dpv = e); + } + function Kt(e, t) { + j.DEBUG && console.log(t.step, "SPVTCA[" + e.axis + "]"), + (t.pv = t.dpv = e); + } + function $t(e, t) { + j.DEBUG && console.log(t.step, "SFVTCA[" + e.axis + "]"), + (t.fv = e); + } + function er(e, t) { + var r, + o = t.stack, + n = o.pop(), + o = o.pop(), + s = t.z2[n], + i = t.z1[o]; + j.DEBUG && console.log("SPVTL[" + e + "]", n, o), + (n = e + ? ((r = s.y - i.y), i.x - s.x) + : ((r = i.x - s.x), i.y - s.y)), + (t.pv = t.dpv = qt(r, n)); + } + function tr(e, t) { + var r, + o = t.stack, + n = o.pop(), + o = o.pop(), + s = t.z2[n], + i = t.z1[o]; + j.DEBUG && console.log("SFVTL[" + e + "]", n, o), + (n = e + ? ((r = s.y - i.y), i.x - s.x) + : ((r = i.x - s.x), i.y - s.y)), + (t.fv = qt(r, n)); + } + function rr(e) { + j.DEBUG && console.log(e.step, "POP[]"), e.stack.pop(); + } + function or(e, t) { + var r = t.stack.pop(), + o = t.z0[r], + n = t.fv, + s = t.pv, + i = + (j.DEBUG && console.log(t.step, "MDAP[" + e + "]", r), + s.distance(o, Xt)); + e && (i = t.round(i)), + n.setRelative(o, Xt, i, s), + n.touch(o), + (t.rp0 = t.rp1 = r); + } + function nr(e, t) { + var r, + o, + n, + s = t.z2, + i = s.length - 2; + j.DEBUG && console.log(t.step, "IUP[" + e.axis + "]"); + for (var a = 0; a < i; a++) + (r = s[a]), + e.touched(r) || + ((o = r.prevTouched(e)) !== r && + (o === (n = r.nextTouched(e)) && + e.setRelative( + r, + r, + e.distance(o, o, !1, !0), + e, + !0, + ), + e.interpolate(r, o, n, e))); + } + function sr(e, t) { + for ( + var r = t.stack, + o = e ? t.rp1 : t.rp2, + n = (e ? t.z0 : t.z1)[o], + s = t.fv, + i = t.pv, + a = t.loop, + l = t.z2; + a--; + + ) { + var u = r.pop(), + c = l[u], + d = i.distance(n, n, !1, !0); + s.setRelative(c, c, d, i), + s.touch(c), + j.DEBUG && + console.log( + t.step, + (1 < t.loop ? "loop " + (t.loop - a) + ": " : "") + + "SHP[" + + (e ? "rp1" : "rp2") + + "]", + u, + ); + } + t.loop = 1; + } + function ir(e, t) { + for ( + var r = t.stack, + o = e ? t.rp1 : t.rp2, + n = (e ? t.z0 : t.z1)[o], + s = t.fv, + i = t.pv, + o = r.pop(), + a = t.z2[t.contours[o]], + l = a, + u = + (j.DEBUG && console.log(t.step, "SHC[" + e + "]", o), + i.distance(n, n, !1, !0)); + l !== n && s.setRelative(l, l, u, i), + (l = l.nextPointOnContour) !== a; + + ); + } + function ar(e, t) { + var r, + o, + n = t.stack, + s = e ? t.rp1 : t.rp2, + s = (e ? t.z0 : t.z1)[s], + i = t.fv, + a = t.pv, + n = n.pop(); + switch ( + (j.DEBUG && console.log(t.step, "SHZ[" + e + "]", n), n) + ) { + case 0: + r = t.tZone; + break; + case 1: + r = t.gZone; + break; + default: + throw new Error("Invalid zone"); + } + for ( + var l = a.distance(s, s, !1, !0), u = r.length - 2, c = 0; + c < u; + c++ + ) + (o = r[c]), i.setRelative(o, o, l, a); + } + function lr(e, t) { + var r = t.stack, + o = r.pop() / 64, + r = r.pop(), + n = t.z1[r], + s = t.z0[t.rp0], + i = t.fv, + a = t.pv; + i.setRelative(n, s, o, a), + i.touch(n), + j.DEBUG && console.log(t.step, "MSIRP[" + e + "]", o, r), + (t.rp1 = t.rp0), + (t.rp2 = r), + e && (t.rp0 = r); + } + function ur(e, t) { + var r = t.stack, + o = r.pop(), + r = r.pop(), + n = t.z0[r], + s = t.fv, + i = t.pv, + a = t.cvt[o], + o = + (j.DEBUG && + console.log( + t.step, + "MIAP[" + e + "]", + o, + "(", + a, + ")", + r, + ), + i.distance(n, Xt)); + e && + (Math.abs(o - a) < t.cvCutIn && (o = a), (o = t.round(o))), + s.setRelative(n, Xt, o, i), + 0 === t.zp0 && ((n.xo = n.x), (n.yo = n.y)), + s.touch(n), + (t.rp0 = t.rp1 = r); + } + function cr(e, t) { + var r = t.stack, + o = r.pop(), + n = t.z2[o]; + j.DEBUG && console.log(t.step, "GC[" + e + "]", o), + r.push(64 * t.dpv.distance(n, Xt, e, !1)); + } + function dr(e, t) { + var r = t.stack, + o = r.pop(), + r = r.pop(), + n = t.z1[o], + s = t.z0[r], + s = t.dpv.distance(s, n, e, e); + j.DEBUG && + console.log(t.step, "MD[" + e + "]", o, r, "->", s), + t.stack.push(Math.round(64 * s)); + } + function hr(e, t) { + var r = t.stack, + o = r.pop(), + n = t.fv, + s = t.pv, + i = t.ppem, + a = t.deltaBase + 16 * (e - 1), + l = t.deltaShift, + u = t.z0; + j.DEBUG && console.log(t.step, "DELTAP[" + e + "]", o, r); + for (var c = 0; c < o; c++) { + var d = r.pop(), + h = r.pop(); + a + ((240 & h) >> 4) === i && + (0 <= (h = (15 & h) - 8) && h++, + j.DEBUG && + console.log(t.step, "DELTAPFIX", d, "by", h * l), + (d = u[d]), + n.setRelative(d, d, h * l, s)); + } + } + function fr(e, t) { + var r = t.stack, + o = r.pop(); + j.DEBUG && console.log(t.step, "ROUND[]"), + r.push(64 * t.round(o / 64)); + } + function pr(e, t) { + var r = t.stack, + o = r.pop(), + n = t.ppem, + s = t.deltaBase + 16 * (e - 1), + i = t.deltaShift; + j.DEBUG && console.log(t.step, "DELTAC[" + e + "]", o, r); + for (var a = 0; a < o; a++) { + var l = r.pop(), + u = r.pop(); + s + ((240 & u) >> 4) === n && + (0 <= (u = (15 & u) - 8) && u++, + (u = u * i), + j.DEBUG && console.log(t.step, "DELTACFIX", l, "by", u), + (t.cvt[l] += u)); + } + } + function mr(e, t) { + var r, + o = t.stack, + n = o.pop(), + o = o.pop(), + s = t.z2[n], + i = t.z1[o]; + j.DEBUG && console.log(t.step, "SDPVTL[" + e + "]", n, o), + (n = e + ? ((r = s.y - i.y), i.x - s.x) + : ((r = i.x - s.x), i.y - s.y)), + (t.dpv = qt(r, n)); + } + function k(e, t) { + var r = t.stack, + o = t.prog, + n = t.ip; + j.DEBUG && console.log(t.step, "PUSHB[" + e + "]"); + for (var s = 0; s < e; s++) r.push(o[++n]); + t.ip = n; + } + function C(e, t) { + var r = t.ip, + o = t.prog, + n = t.stack; + j.DEBUG && console.log(t.ip, "PUSHW[" + e + "]"); + for (var s = 0; s < e; s++) { + var i = (o[++r] << 8) | o[++r]; + 32768 & i && (i = -(1 + (65535 ^ i))), n.push(i); + } + t.ip = r; + } + function O(e, t, r, o, n, s) { + var i, + a, + l = s.stack, + u = e && l.pop(), + l = l.pop(), + c = s.rp0, + c = s.z0[c], + d = s.z1[l], + h = s.minDis, + f = s.fv, + p = s.dpv, + m = (i = p.distance(d, c, !0, !0)), + y = 0 <= m ? 1 : -1; + (m = Math.abs(m)), + e && + ((a = s.cvt[u]), + o && Math.abs(m - a) < s.cvCutIn && (m = a)), + r && m < h && (m = h), + o && (m = s.round(m)), + f.setRelative(d, c, y * m, p), + f.touch(d), + j.DEBUG && + console.log( + s.step, + (e ? "MIRP[" : "MDRP[") + + (t ? "M" : "m") + + (r ? ">" : "_") + + (o ? "R" : "_") + + (0 === n + ? "Gr" + : 1 === n + ? "Bl" + : 2 === n + ? "Wh" + : "") + + "]", + e ? u + "(" + s.cvt[u] + "," + a + ")" : "", + l, + "(d =", + i, + "->", + y * m, + ")", + ), + (s.rp1 = s.rp0), + (s.rp2 = l), + t && (s.rp0 = l); + } + Ft.prototype.exec = function (e, t) { + if ("number" != typeof t) + throw new Error("Point size is not a number!"); + if (!(2 < this._errorState)) { + var r = this.font, + o = this._prepState; + if (!o || o.ppem !== t) { + var n = this._fpgmState; + if (!n) { + (E.prototype = Yt), + ((n = this._fpgmState = + new E("fpgm", r.tables.fpgm)).funcs = []), + (n.font = r), + j.DEBUG && + (console.log("---EXEC FPGM---"), (n.step = -1)); + try { + vr(n); + } catch (e) { + return ( + console.log("Hinting error in FPGM:" + e), + void (this._errorState = 3) + ); + } + } + (E.prototype = n), + ((o = this._prepState = + new E("prep", r.tables.prep)).ppem = t); + var s = r.tables.cvt; + if (s) + for ( + var i = (o.cvt = new Array(s.length)), + a = t / r.unitsPerEm, + l = 0; + l < s.length; + l++ + ) + i[l] = s[l] * a; + else o.cvt = []; + j.DEBUG && + (console.log("---EXEC PREP---"), (o.step = -1)); + try { + vr(o); + } catch (e) { + this._errorState < 2 && + console.log("Hinting error in PREP:" + e), + (this._errorState = 2); + } + } + if (!(1 < this._errorState)) + try { + return yr(e, o); + } catch (e) { + this._errorState < 1 && + (console.log("Hinting error:" + e), + console.log( + "Note: further hinting errors are silenced", + )), + (this._errorState = 1); + } + } + }; + var yr = function (e, t) { + var r = t.ppem / t.font.unitsPerEm, + o = r, + n = e.components; + if (((E.prototype = t), n)) { + for ( + var s = t.font, i = [], a = [], l = 0; + l < n.length; + l++ + ) { + var u = n[l], + c = s.glyphs.get(u.glyphIndex), + d = new E("glyf", c.instructions); + j.DEBUG && + (console.log("---EXEC COMP " + l + "---"), + (d.step = -1)), + gr(c, d, r, o); + for ( + var h = Math.round(u.dx * r), + f = Math.round(u.dy * o), + p = d.gZone, + m = d.contours, + y = 0; + y < p.length; + y++ + ) { + var g = p[y]; + (g.xTouched = g.yTouched = !1), + (g.xo = g.x = g.x + h), + (g.yo = g.y = g.y + f); + } + var v = i.length; + i.push.apply(i, p); + for (var b = 0; b < m.length; b++) a.push(m[b] + v); + } + e.instructions && + !d.inhibitGridFit && + (((d = new E("glyf", e.instructions)).gZone = + d.z0 = + d.z1 = + d.z2 = + i), + (d.contours = a), + i.push( + new M(0, 0), + new M(Math.round(e.advanceWidth * r), 0), + ), + j.DEBUG && + (console.log("---EXEC COMPOSITE---"), (d.step = -1)), + vr(d), + (i.length -= 2)); + } else + (d = new E("glyf", e.instructions)), + j.DEBUG && + (console.log("---EXEC GLYPH---"), (d.step = -1)), + gr(e, d, r, o), + (i = d.gZone); + return i; + }, + gr = function (e, t, r, o) { + for ( + var n, + s, + i, + a = e.points || [], + l = a.length, + u = (t.gZone = t.z0 = t.z1 = t.z2 = []), + c = (t.contours = []), + d = 0; + d < l; + d++ + ) + (n = a[d]), + (u[d] = new M( + n.x * r, + n.y * o, + n.lastPointOfContour, + n.onCurve, + )); + for (var h = 0; h < l; h++) + (n = u[h]), + s || ((s = n), c.push(h)), + n.lastPointOfContour + ? (((n.nextPointOnContour = s).prevPointOnContour = + n), + (s = void 0)) + : ((i = u[h + 1]), + ((n.nextPointOnContour = i).prevPointOnContour = + n)); + if (!t.inhibitGridFit) { + if (j.DEBUG) { + console.log("PROCESSING GLYPH", t.stack); + for (var f = 0; f < l; f++) + console.log(f, u[f].x, u[f].y); + } + if ( + (u.push( + new M(0, 0), + new M(Math.round(e.advanceWidth * r), 0), + ), + vr(t), + (u.length -= 2), + j.DEBUG) + ) { + console.log("FINISHED GLYPH", t.stack); + for (var p = 0; p < l; p++) + console.log(p, u[p].x, u[p].y); + } + } + }, + vr = function (e) { + var t = e.prog; + if (t) { + var r, + o = t.length; + for (e.ip = 0; e.ip < o; e.ip++) { + if ((j.DEBUG && e.step++, !(r = br[t[e.ip]]))) + throw new Error( + "unknown instruction: 0x" + + Number(t[e.ip]).toString(16), + ); + r(e); + } + } + }, + br = [ + Jt.bind(void 0, T), + Jt.bind(void 0, x), + Kt.bind(void 0, T), + Kt.bind(void 0, x), + $t.bind(void 0, T), + $t.bind(void 0, x), + er.bind(void 0, 0), + er.bind(void 0, 1), + tr.bind(void 0, 0), + tr.bind(void 0, 1), + function (e) { + var t = (r = e.stack).pop(), + r = r.pop(); + j.DEBUG && console.log(e.step, "SPVFS[]", t, r), + (e.pv = e.dpv = qt(r, t)); + }, + function (e) { + var t = (r = e.stack).pop(), + r = r.pop(); + j.DEBUG && console.log(e.step, "SPVFS[]", t, r), + (e.fv = qt(r, t)); + }, + function (e) { + var t = e.stack, + r = e.pv; + j.DEBUG && console.log(e.step, "GPV[]"), + t.push(16384 * r.x), + t.push(16384 * r.y); + }, + function (e) { + var t = e.stack, + r = e.fv; + j.DEBUG && console.log(e.step, "GFV[]"), + t.push(16384 * r.x), + t.push(16384 * r.y); + }, + function (e) { + (e.fv = e.pv), j.DEBUG && console.log(e.step, "SFVTPV[]"); + }, + function (e) { + var t = (s = e.stack).pop(), + r = s.pop(), + o = s.pop(), + n = s.pop(), + s = s.pop(), + i = e.z0, + a = e.z1, + l = i[t], + i = i[r], + u = a[o], + a = a[n], + e = e.z2[s], + t = + (j.DEBUG && console.log("ISECT[], ", t, r, o, n, s), + l.x), + r = l.y, + o = i.x, + n = i.y, + s = u.x, + l = u.y, + i = a.x, + u = a.y, + a = (t - o) * (l - u) - (r - n) * (s - i), + c = t * n - r * o, + d = s * u - l * i; + (e.x = (c * (s - i) - d * (t - o)) / a), + (e.y = (c * (l - u) - d * (r - n)) / a); + }, + function (e) { + (e.rp0 = e.stack.pop()), + j.DEBUG && console.log(e.step, "SRP0[]", e.rp0); + }, + function (e) { + (e.rp1 = e.stack.pop()), + j.DEBUG && console.log(e.step, "SRP1[]", e.rp1); + }, + function (e) { + (e.rp2 = e.stack.pop()), + j.DEBUG && console.log(e.step, "SRP2[]", e.rp2); + }, + function (e) { + var t = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "SZP0[]", t), + (e.zp0 = t)) + ) { + case 0: + e.tZone || Zt(e), (e.z0 = e.tZone); + break; + case 1: + e.z0 = e.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + }, + function (e) { + var t = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "SZP1[]", t), + (e.zp1 = t)) + ) { + case 0: + e.tZone || Zt(e), (e.z1 = e.tZone); + break; + case 1: + e.z1 = e.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + }, + function (e) { + var t = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "SZP2[]", t), + (e.zp2 = t)) + ) { + case 0: + e.tZone || Zt(e), (e.z2 = e.tZone); + break; + case 1: + e.z2 = e.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + }, + function (e) { + var t = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "SZPS[]", t), + (e.zp0 = e.zp1 = e.zp2 = t)) + ) { + case 0: + e.tZone || Zt(e), (e.z0 = e.z1 = e.z2 = e.tZone); + break; + case 1: + e.z0 = e.z1 = e.z2 = e.gZone; + break; + default: + throw new Error("Invalid zone pointer"); + } + }, + function (e) { + (e.loop = e.stack.pop()), + j.DEBUG && console.log(e.step, "SLOOP[]", e.loop); + }, + function (e) { + j.DEBUG && console.log(e.step, "RTG[]"), (e.round = Nt); + }, + function (e) { + j.DEBUG && console.log(e.step, "RTHG[]"), (e.round = Gt); + }, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "SMD[]", t), + (e.minDis = t / 64); + }, + function (e) { + j.DEBUG && console.log(e.step, "ELSE[]"), Qt(e, !1); + }, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "JMPR[]", t), + (e.ip += t - 1); + }, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "SCVTCI[]", t), + (e.cvCutIn = t / 64); + }, + void 0, + void 0, + function (e) { + var t = e.stack; + j.DEBUG && console.log(e.step, "DUP[]"), + t.push(t[t.length - 1]); + }, + rr, + function (e) { + j.DEBUG && console.log(e.step, "CLEAR[]"), + (e.stack.length = 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "SWAP[]"), + t.push(r), + t.push(o); + }, + function (e) { + var t = e.stack; + j.DEBUG && console.log(e.step, "DEPTH[]"), + t.push(t.length); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "CINDEX[]", r), + t.push(t[t.length - r]); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "MINDEX[]", r), + t.push(t.splice(t.length - r, 1)[0]); + }, + void 0, + void 0, + void 0, + function (e) { + var t = (o = e.stack).pop(), + r = o.pop(), + o = + (j.DEBUG && console.log(e.step, "LOOPCALL[]", t, r), + e.ip), + n = e.prog; + e.prog = e.funcs[t]; + for (var s = 0; s < r; s++) + vr(e), + j.DEBUG && + console.log( + ++e.step, + s + 1 < r ? "next loopcall" : "done loopcall", + s, + ); + (e.ip = o), (e.prog = n); + }, + function (e) { + var t = e.stack.pop(), + r = (j.DEBUG && console.log(e.step, "CALL[]", t), e.ip), + o = e.prog; + (e.prog = e.funcs[t]), + vr(e), + (e.ip = r), + (e.prog = o), + j.DEBUG && console.log(++e.step, "returning from", t); + }, + function (e) { + if ("fpgm" !== e.env) + throw new Error("FDEF not allowed here"); + var t = e.stack, + r = e.prog, + o = e.ip, + t = t.pop(), + n = o; + for ( + j.DEBUG && console.log(e.step, "FDEF[]", t); + 45 !== r[++o]; + + ); + (e.ip = o), (e.funcs[t] = r.slice(n + 1, o)); + }, + void 0, + or.bind(void 0, 0), + or.bind(void 0, 1), + nr.bind(void 0, T), + nr.bind(void 0, x), + sr.bind(void 0, 0), + sr.bind(void 0, 1), + ir.bind(void 0, 0), + ir.bind(void 0, 1), + ar.bind(void 0, 0), + ar.bind(void 0, 1), + function (e) { + for ( + var t = e.stack, + r = e.loop, + o = e.fv, + n = t.pop() / 64, + s = e.z2; + r--; + + ) { + var i = t.pop(), + a = s[i]; + j.DEBUG && + console.log( + e.step, + (1 < e.loop ? "loop " + (e.loop - r) + ": " : "") + + "SHPIX[]", + i, + n, + ), + o.setRelative(a, a, n), + o.touch(a); + } + e.loop = 1; + }, + function (e) { + for ( + var t = e.stack, + r = e.rp1, + o = e.rp2, + n = e.loop, + s = e.z0[r], + i = e.z1[o], + a = e.fv, + l = e.dpv, + u = e.z2; + n--; + + ) { + var c = t.pop(), + d = u[c]; + j.DEBUG && + console.log( + e.step, + (1 < e.loop ? "loop " + (e.loop - n) + ": " : "") + + "IP[]", + c, + r, + "<->", + o, + ), + a.interpolate(d, s, i, l), + a.touch(d); + } + e.loop = 1; + }, + lr.bind(void 0, 0), + lr.bind(void 0, 1), + function (e) { + for ( + var t = e.stack, + r = e.rp0, + o = e.z0[r], + n = e.loop, + s = e.fv, + i = e.pv, + a = e.z1; + n--; + + ) { + var l = t.pop(), + u = a[l]; + j.DEBUG && + console.log( + e.step, + (1 < e.loop ? "loop " + (e.loop - n) + ": " : "") + + "ALIGNRP[]", + l, + ), + s.setRelative(u, o, 0, i), + s.touch(u); + } + e.loop = 1; + }, + function (e) { + j.DEBUG && console.log(e.step, "RTDG[]"), (e.round = Bt); + }, + ur.bind(void 0, 0), + ur.bind(void 0, 1), + function (e) { + var t = e.prog, + r = e.ip, + o = e.stack, + n = t[++r]; + j.DEBUG && console.log(e.step, "NPUSHB[]", n); + for (var s = 0; s < n; s++) o.push(t[++r]); + e.ip = r; + }, + function (e) { + var t = e.ip, + r = e.prog, + o = e.stack, + n = r[++t]; + j.DEBUG && console.log(e.step, "NPUSHW[]", n); + for (var s = 0; s < n; s++) { + var i = (r[++t] << 8) | r[++t]; + 32768 & i && (i = -(1 + (65535 ^ i))), o.push(i); + } + e.ip = t; + }, + function (e) { + var t = e.stack, + r = (r = e.store) || (e.store = []), + o = t.pop(), + t = t.pop(); + j.DEBUG && console.log(e.step, "WS", o, t), (r[t] = o); + }, + function (e) { + var t = e.stack, + r = e.store, + o = t.pop(), + e = + (j.DEBUG && console.log(e.step, "RS", o), + (r && r[o]) || 0); + t.push(e); + }, + function (e) { + var t = (r = e.stack).pop(), + r = r.pop(); + j.DEBUG && console.log(e.step, "WCVTP", t, r), + (e.cvt[r] = t / 64); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "RCVT", r), + t.push(64 * e.cvt[r]); + }, + cr.bind(void 0, 0), + cr.bind(void 0, 1), + void 0, + dr.bind(void 0, 0), + dr.bind(void 0, 1), + function (e) { + j.DEBUG && console.log(e.step, "MPPEM[]"), + e.stack.push(e.ppem); + }, + void 0, + function (e) { + j.DEBUG && console.log(e.step, "FLIPON[]"), + (e.autoFlip = !0); + }, + void 0, + void 0, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "LT[]", r, o), + t.push(o < r ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "LTEQ[]", r, o), + t.push(o <= r ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "GT[]", r, o), + t.push(r < o ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "GTEQ[]", r, o), + t.push(r <= o ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "EQ[]", r, o), + t.push(r === o ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "NEQ[]", r, o), + t.push(r !== o ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "ODD[]", r), + t.push(Math.trunc(r) % 2 ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "EVEN[]", r), + t.push(Math.trunc(r) % 2 ? 0 : 1); + }, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "IF[]", t), + t || + (Qt(e, !0), j.DEBUG && console.log(e.step, "EIF[]")); + }, + function (e) { + j.DEBUG && console.log(e.step, "EIF[]"); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "AND[]", r, o), + t.push(r && o ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "OR[]", r, o), + t.push(r || o ? 1 : 0); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "NOT[]", r), + t.push(r ? 0 : 1); + }, + hr.bind(void 0, 1), + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "SDB[]", t), + (e.deltaBase = t); + }, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "SDS[]", t), + (e.deltaShift = Math.pow(0.5, t)); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "ADD[]", r, o), + t.push(o + r); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "SUB[]", r, o), + t.push(o - r); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "DIV[]", r, o), + t.push((64 * o) / r); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "MUL[]", r, o), + t.push((o * r) / 64); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "ABS[]", r), + t.push(Math.abs(r)); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "NEG[]", r), t.push(-r); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "FLOOR[]", r), + t.push(64 * Math.floor(r / 64)); + }, + function (e) { + var t = e.stack, + r = t.pop(); + j.DEBUG && console.log(e.step, "CEILING[]", r), + t.push(64 * Math.ceil(r / 64)); + }, + fr.bind(void 0, 0), + fr.bind(void 0, 1), + fr.bind(void 0, 2), + fr.bind(void 0, 3), + void 0, + void 0, + void 0, + void 0, + function (e) { + var t = (r = e.stack).pop(), + r = r.pop(); + j.DEBUG && console.log(e.step, "WCVTF[]", t, r), + (e.cvt[r] = (t * e.ppem) / e.font.unitsPerEm); + }, + hr.bind(void 0, 2), + hr.bind(void 0, 3), + pr.bind(void 0, 1), + pr.bind(void 0, 2), + pr.bind(void 0, 3), + function (e) { + var t, + r = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "SROUND[]", r), + (e.round = Ht), + 192 & r) + ) { + case 0: + t = 0.5; + break; + case 64: + t = 1; + break; + case 128: + t = 2; + break; + default: + throw new Error("invalid SROUND value"); + } + switch (((e.srPeriod = t), 48 & r)) { + case 0: + e.srPhase = 0; + break; + case 16: + e.srPhase = 0.25 * t; + break; + case 32: + e.srPhase = 0.5 * t; + break; + case 48: + e.srPhase = 0.75 * t; + break; + default: + throw new Error("invalid SROUND value"); + } + e.srThreshold = 0 === (r &= 15) ? 0 : (r / 8 - 0.5) * t; + }, + function (e) { + var t, + r = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "S45ROUND[]", r), + (e.round = Ht), + 192 & r) + ) { + case 0: + t = Math.sqrt(2) / 2; + break; + case 64: + t = Math.sqrt(2); + break; + case 128: + t = 2 * Math.sqrt(2); + break; + default: + throw new Error("invalid S45ROUND value"); + } + switch (((e.srPeriod = t), 48 & r)) { + case 0: + e.srPhase = 0; + break; + case 16: + e.srPhase = 0.25 * t; + break; + case 32: + e.srPhase = 0.5 * t; + break; + case 48: + e.srPhase = 0.75 * t; + break; + default: + throw new Error("invalid S45ROUND value"); + } + e.srThreshold = 0 === (r &= 15) ? 0 : (r / 8 - 0.5) * t; + }, + void 0, + void 0, + function (e) { + j.DEBUG && console.log(e.step, "ROFF[]"), (e.round = Ut); + }, + void 0, + function (e) { + j.DEBUG && console.log(e.step, "RUTG[]"), (e.round = Vt); + }, + function (e) { + j.DEBUG && console.log(e.step, "RDTG[]"), (e.round = zt); + }, + rr, + rr, + void 0, + void 0, + void 0, + void 0, + void 0, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "SCANCTRL[]", t); + }, + mr.bind(void 0, 0), + mr.bind(void 0, 1), + function (e) { + var t = e.stack, + r = t.pop(), + o = 0; + j.DEBUG && console.log(e.step, "GETINFO[]", r), + 1 & r && (o = 35), + 32 & r && (o |= 4096), + t.push(o); + }, + void 0, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(), + n = t.pop(); + j.DEBUG && console.log(e.step, "ROLL[]"), + t.push(o), + t.push(r), + t.push(n); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "MAX[]", r, o), + t.push(Math.max(o, r)); + }, + function (e) { + var t = e.stack, + r = t.pop(), + o = t.pop(); + j.DEBUG && console.log(e.step, "MIN[]", r, o), + t.push(Math.min(o, r)); + }, + function (e) { + var t = e.stack.pop(); + j.DEBUG && console.log(e.step, "SCANTYPE[]", t); + }, + function (e) { + var t = e.stack.pop(), + r = e.stack.pop(); + switch ( + (j.DEBUG && console.log(e.step, "INSTCTRL[]", t, r), t) + ) { + case 1: + return void (e.inhibitGridFit = !!r); + case 2: + return void (e.ignoreCvt = !!r); + default: + throw new Error("invalid INSTCTRL[] selector"); + } + }, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + void 0, + k.bind(void 0, 1), + k.bind(void 0, 2), + k.bind(void 0, 3), + k.bind(void 0, 4), + k.bind(void 0, 5), + k.bind(void 0, 6), + k.bind(void 0, 7), + k.bind(void 0, 8), + C.bind(void 0, 1), + C.bind(void 0, 2), + C.bind(void 0, 3), + C.bind(void 0, 4), + C.bind(void 0, 5), + C.bind(void 0, 6), + C.bind(void 0, 7), + C.bind(void 0, 8), + O.bind(void 0, 0, 0, 0, 0, 0), + O.bind(void 0, 0, 0, 0, 0, 1), + O.bind(void 0, 0, 0, 0, 0, 2), + O.bind(void 0, 0, 0, 0, 0, 3), + O.bind(void 0, 0, 0, 0, 1, 0), + O.bind(void 0, 0, 0, 0, 1, 1), + O.bind(void 0, 0, 0, 0, 1, 2), + O.bind(void 0, 0, 0, 0, 1, 3), + O.bind(void 0, 0, 0, 1, 0, 0), + O.bind(void 0, 0, 0, 1, 0, 1), + O.bind(void 0, 0, 0, 1, 0, 2), + O.bind(void 0, 0, 0, 1, 0, 3), + O.bind(void 0, 0, 0, 1, 1, 0), + O.bind(void 0, 0, 0, 1, 1, 1), + O.bind(void 0, 0, 0, 1, 1, 2), + O.bind(void 0, 0, 0, 1, 1, 3), + O.bind(void 0, 0, 1, 0, 0, 0), + O.bind(void 0, 0, 1, 0, 0, 1), + O.bind(void 0, 0, 1, 0, 0, 2), + O.bind(void 0, 0, 1, 0, 0, 3), + O.bind(void 0, 0, 1, 0, 1, 0), + O.bind(void 0, 0, 1, 0, 1, 1), + O.bind(void 0, 0, 1, 0, 1, 2), + O.bind(void 0, 0, 1, 0, 1, 3), + O.bind(void 0, 0, 1, 1, 0, 0), + O.bind(void 0, 0, 1, 1, 0, 1), + O.bind(void 0, 0, 1, 1, 0, 2), + O.bind(void 0, 0, 1, 1, 0, 3), + O.bind(void 0, 0, 1, 1, 1, 0), + O.bind(void 0, 0, 1, 1, 1, 1), + O.bind(void 0, 0, 1, 1, 1, 2), + O.bind(void 0, 0, 1, 1, 1, 3), + O.bind(void 0, 1, 0, 0, 0, 0), + O.bind(void 0, 1, 0, 0, 0, 1), + O.bind(void 0, 1, 0, 0, 0, 2), + O.bind(void 0, 1, 0, 0, 0, 3), + O.bind(void 0, 1, 0, 0, 1, 0), + O.bind(void 0, 1, 0, 0, 1, 1), + O.bind(void 0, 1, 0, 0, 1, 2), + O.bind(void 0, 1, 0, 0, 1, 3), + O.bind(void 0, 1, 0, 1, 0, 0), + O.bind(void 0, 1, 0, 1, 0, 1), + O.bind(void 0, 1, 0, 1, 0, 2), + O.bind(void 0, 1, 0, 1, 0, 3), + O.bind(void 0, 1, 0, 1, 1, 0), + O.bind(void 0, 1, 0, 1, 1, 1), + O.bind(void 0, 1, 0, 1, 1, 2), + O.bind(void 0, 1, 0, 1, 1, 3), + O.bind(void 0, 1, 1, 0, 0, 0), + O.bind(void 0, 1, 1, 0, 0, 1), + O.bind(void 0, 1, 1, 0, 0, 2), + O.bind(void 0, 1, 1, 0, 0, 3), + O.bind(void 0, 1, 1, 0, 1, 0), + O.bind(void 0, 1, 1, 0, 1, 1), + O.bind(void 0, 1, 1, 0, 1, 2), + O.bind(void 0, 1, 1, 0, 1, 3), + O.bind(void 0, 1, 1, 1, 0, 0), + O.bind(void 0, 1, 1, 1, 0, 1), + O.bind(void 0, 1, 1, 1, 0, 2), + O.bind(void 0, 1, 1, 1, 0, 3), + O.bind(void 0, 1, 1, 1, 1, 0), + O.bind(void 0, 1, 1, 1, 1, 1), + O.bind(void 0, 1, 1, 1, 1, 2), + O.bind(void 0, 1, 1, 1, 1, 3), + ], + jr = + Array.from || + function (e) { + return ( + e.match( + /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g, + ) || [] + ); + }; + function P(e) { + (e = e || {}).empty || + (_( + e.familyName, + "When creating a new Font object, familyName is required.", + ), + _( + e.styleName, + "When creating a new Font object, styleName is required.", + ), + _( + e.unitsPerEm, + "When creating a new Font object, unitsPerEm is required.", + ), + _( + e.ascender, + "When creating a new Font object, ascender is required.", + ), + _( + e.descender, + "When creating a new Font object, descender is required.", + ), + _( + e.descender < 0, + "Descender should be negative (e.g. -512).", + ), + (this.names = { + fontFamily: { en: e.familyName || " " }, + fontSubfamily: { en: e.styleName || " " }, + fullName: { + en: e.fullName || e.familyName + " " + e.styleName, + }, + postScriptName: { + en: + e.postScriptName || + (e.familyName + e.styleName).replace(/\s/g, ""), + }, + designer: { en: e.designer || " " }, + designerURL: { en: e.designerURL || " " }, + manufacturer: { en: e.manufacturer || " " }, + manufacturerURL: { en: e.manufacturerURL || " " }, + license: { en: e.license || " " }, + licenseURL: { en: e.licenseURL || " " }, + version: { en: e.version || "Version 0.1" }, + description: { en: e.description || " " }, + copyright: { en: e.copyright || " " }, + trademark: { en: e.trademark || " " }, + }), + (this.unitsPerEm = e.unitsPerEm || 1e3), + (this.ascender = e.ascender), + (this.descender = e.descender), + (this.createdTimestamp = e.createdTimestamp), + (this.tables = { + os2: { + usWeightClass: + e.weightClass || this.usWeightClasses.MEDIUM, + usWidthClass: + e.widthClass || this.usWidthClasses.MEDIUM, + fsSelection: + e.fsSelection || this.fsSelectionValues.REGULAR, + }, + })), + (this.supported = !0), + (this.glyphs = new p.GlyphSet(this, e.glyphs || [])), + (this.encoding = new Ee(this)), + (this.position = new kt(this)), + (this.substitution = new i(this)), + (this.tables = this.tables || {}), + Object.defineProperty(this, "hinting", { + get: function () { + return ( + this._hinting || + ("truetype" === this.outlinesFormat + ? (this._hinting = new Ft(this)) + : void 0) + ); + }, + }); + } + function _r(e, t) { + var r, + o = JSON.stringify(e), + n = 256; + for (r in t) { + var s = parseInt(r); + if (s && !(s < 256)) { + if (JSON.stringify(t[r]) === o) return s; + n <= s && (n = s + 1); + } + } + return (t[n] = e), n; + } + (P.prototype.hasChar = function (e) { + return null !== this.encoding.charToGlyphIndex(e); + }), + (P.prototype.charToGlyphIndex = function (e) { + return this.encoding.charToGlyphIndex(e); + }), + (P.prototype.charToGlyph = function (e) { + e = this.charToGlyphIndex(e); + return this.glyphs.get(e) || this.glyphs.get(0); + }), + (P.prototype.stringToGlyphs = function (e, t) { + t = t || this.defaultRenderOptions; + for (var r = jr(e), o = [], n = 0; n < r.length; n += 1) { + var s = r[n]; + o.push(this.charToGlyphIndex(s)); + } + var i = o.length; + if (t.features) { + var e = + t.script || this.substitution.getDefaultScriptName(), + a = []; + t.features.liga && + (a = a.concat( + this.substitution.getFeature("liga", e, t.language), + )), + t.features.rlig && + (a = a.concat( + this.substitution.getFeature("rlig", e, t.language), + )); + for (var l = 0; l < i; l += 1) + for (var u = 0; u < a.length; u++) { + for ( + var c = a[u], d = c.sub, h = d.length, f = 0; + f < h && d[f] === o[l + f]; + + ) + f++; + f === h && (o.splice(l, h, c.by), (i = i - h + 1)); + } + } + for ( + var p = new Array(i), m = this.glyphs.get(0), y = 0; + y < i; + y += 1 + ) + p[y] = this.glyphs.get(o[y]) || m; + return p; + }), + (P.prototype.nameToGlyphIndex = function (e) { + return this.glyphNames.nameToGlyphIndex(e); + }), + (P.prototype.nameToGlyph = function (e) { + e = this.nameToGlyphIndex(e); + return this.glyphs.get(e) || this.glyphs.get(0); + }), + (P.prototype.glyphIndexToName = function (e) { + return this.glyphNames.glyphIndexToName + ? this.glyphNames.glyphIndexToName(e) + : ""; + }), + (P.prototype.getKerningValue = function (e, t) { + (e = e.index || e), (t = t.index || t); + var r = this.position.defaultKerningTables; + return r + ? this.position.getKerningValue(r, e, t) + : this.kerningPairs[e + "," + t] || 0; + }), + (P.prototype.defaultRenderOptions = { + kerning: !0, + features: { liga: !0, rlig: !0 }, + }), + (P.prototype.forEachGlyph = function (e, t, r, o, n, s) { + (t = void 0 !== t ? t : 0), + (r = void 0 !== r ? r : 0), + (n = n || this.defaultRenderOptions); + var i, + a = (1 / this.unitsPerEm) * (o = void 0 !== o ? o : 72), + l = this.stringToGlyphs(e, n); + n.kerning && + ((e = n.script || this.position.getDefaultScriptName()), + (i = this.position.getKerningTables(e, n.language))); + for (var u = 0; u < l.length; u += 1) { + var c = l[u]; + s.call(this, c, t, r, o, n), + c.advanceWidth && (t += c.advanceWidth * a), + n.kerning && + u < l.length - 1 && + (t += + (i + ? this.position.getKerningValue( + i, + c.index, + l[u + 1].index, + ) + : this.getKerningValue(c, l[u + 1])) * a), + n.letterSpacing + ? (t += n.letterSpacing * o) + : n.tracking && (t += (n.tracking / 1e3) * o); + } + return t; + }), + (P.prototype.getPath = function (e, t, r, o, n) { + var s = new h(); + return ( + this.forEachGlyph(e, t, r, o, n, function (e, t, r, o) { + e = e.getPath(t, r, o, n, this); + s.extend(e); + }), + s + ); + }), + (P.prototype.getPaths = function (e, t, r, o, n) { + var s = []; + return ( + this.forEachGlyph(e, t, r, o, n, function (e, t, r, o) { + e = e.getPath(t, r, o, n, this); + s.push(e); + }), + s + ); + }), + (P.prototype.getAdvanceWidth = function (e, t, r) { + return this.forEachGlyph(e, 0, 0, t, r, function () {}); + }), + (P.prototype.draw = function (e, t, r, o, n, s) { + this.getPath(t, r, o, n, s).draw(e); + }), + (P.prototype.drawPoints = function (n, e, t, r, o, s) { + this.forEachGlyph(e, t, r, o, s, function (e, t, r, o) { + e.drawPoints(n, t, r, o); + }); + }), + (P.prototype.drawMetrics = function (n, e, t, r, o, s) { + this.forEachGlyph(e, t, r, o, s, function (e, t, r, o) { + e.drawMetrics(n, t, r, o); + }); + }), + (P.prototype.getEnglishName = function (e) { + e = this.names[e]; + if (e) return e.en; + }), + (P.prototype.validate = function () { + var t = this; + function e(e) { + e = t.getEnglishName(e); + e && e.trim().length; + } + e("fontFamily"), + e("weightName"), + e("manufacturer"), + e("copyright"), + e("version"), + this.unitsPerEm; + }), + (P.prototype.toTables = function () { + return wt.fontToTable(this); + }), + (P.prototype.toBuffer = function () { + return ( + console.warn( + "Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.", + ), + this.toArrayBuffer() + ); + }), + (P.prototype.toArrayBuffer = function () { + for ( + var e = this.toTables().encode(), + t = new ArrayBuffer(e.length), + r = new Uint8Array(t), + o = 0; + o < e.length; + o++ + ) + r[o] = e[o]; + return t; + }), + (P.prototype.download = function (t) { + var e = this.getEnglishName("fontFamily"), + r = this.getEnglishName("fontSubfamily"), + o = + ((t = t || e.replace(/\s/g, "") + "-" + r + ".otf"), + this.toArrayBuffer()); + "undefined" != typeof window + ? ((window.requestFileSystem = + window.requestFileSystem || + window.webkitRequestFileSystem), + window.requestFileSystem( + window.TEMPORARY, + o.byteLength, + function (e) { + e.root.getFile(t, { create: !0 }, function (r) { + r.createWriter(function (e) { + var t = new DataView(o), + t = new Blob([t], { type: "font/opentype" }); + e.write(t), + e.addEventListener( + "writeend", + function () { + location.href = r.toURL(); + }, + !1, + ); + }); + }); + }, + function (e) { + throw new Error(e.name + ": " + e.message); + }, + )) + : ((e = Ar("fs")), + (r = (function (e) { + for ( + var t = new Pr(e.byteLength), + r = new Uint8Array(e), + o = 0; + o < t.length; + ++o + ) + t[o] = r[o]; + return t; + })(o)), + e.writeFileSync(t, r)); + }), + (P.prototype.fsSelectionValues = { + ITALIC: 1, + UNDERSCORE: 2, + NEGATIVE: 4, + OUTLINED: 8, + STRIKEOUT: 16, + BOLD: 32, + REGULAR: 64, + USER_TYPO_METRICS: 128, + WWS: 256, + OBLIQUE: 512, + }), + (P.prototype.usWidthClasses = { + ULTRA_CONDENSED: 1, + EXTRA_CONDENSED: 2, + CONDENSED: 3, + SEMI_CONDENSED: 4, + MEDIUM: 5, + SEMI_EXPANDED: 6, + EXPANDED: 7, + EXTRA_EXPANDED: 8, + ULTRA_EXPANDED: 9, + }), + (P.prototype.usWeightClasses = { + THIN: 100, + EXTRA_LIGHT: 200, + LIGHT: 300, + NORMAL: 400, + MEDIUM: 500, + SEMI_BOLD: 600, + BOLD: 700, + EXTRA_BOLD: 800, + BLACK: 900, + }); + var xr = { + make: function (e, t) { + var r = new S.Table("fvar", [ + { name: "version", type: "ULONG", value: 65536 }, + { name: "offsetToData", type: "USHORT", value: 0 }, + { name: "countSizePairs", type: "USHORT", value: 2 }, + { + name: "axisCount", + type: "USHORT", + value: e.axes.length, + }, + { name: "axisSize", type: "USHORT", value: 20 }, + { + name: "instanceCount", + type: "USHORT", + value: e.instances.length, + }, + { + name: "instanceSize", + type: "USHORT", + value: 4 + 4 * e.axes.length, + }, + ]); + r.offsetToData = r.sizeOf(); + for (var o, n, s, i = 0; i < e.axes.length; i++) + r.fields = r.fields.concat( + ((o = i), + (n = e.axes[i]), + (s = t), + (s = _r(n.name, t)), + [ + { name: "tag_" + o, type: "TAG", value: n.tag }, + { + name: "minValue_" + o, + type: "FIXED", + value: n.minValue << 16, + }, + { + name: "defaultValue_" + o, + type: "FIXED", + value: n.defaultValue << 16, + }, + { + name: "maxValue_" + o, + type: "FIXED", + value: n.maxValue << 16, + }, + { name: "flags_" + o, type: "USHORT", value: 0 }, + { name: "nameID_" + o, type: "USHORT", value: s }, + ]), + ); + for (var a = 0; a < e.instances.length; a++) + r.fields = r.fields.concat( + (function (e, t, r, o) { + for ( + var n = [ + { + name: "nameID_" + e, + type: "USHORT", + value: _r(t.name, o), + }, + { + name: "flags_" + e, + type: "USHORT", + value: 0, + }, + ], + s = 0; + s < r.length; + ++s + ) { + var i = r[s].tag; + n.push({ + name: "axis_" + e + " " + i, + type: "FIXED", + value: t.coordinates[i] << 16, + }); + } + return n; + })(a, e.instances[a], e.axes, t), + ); + return r; + }, + parse: function (e, t, r) { + for ( + var o, + n, + s, + i, + a = new R.Parser(e, t), + l = a.parseULong(), + u = + (L.argument( + 65536 === l, + "Unsupported fvar table version.", + ), + a.parseOffset16()), + c = (a.skip("uShort", 1), a.parseUShort()), + d = a.parseUShort(), + h = a.parseUShort(), + f = a.parseUShort(), + p = [], + m = 0; + m < c; + m++ + ) + p.push( + ((o = e), + (n = t + u + m * d), + (s = r), + void 0, + (i = {}), + (o = new R.Parser(o, n)), + (i.tag = o.parseTag()), + (i.minValue = o.parseFixed()), + (i.defaultValue = o.parseFixed()), + (i.maxValue = o.parseFixed()), + o.skip("uShort", 1), + (i.name = s[o.parseUShort()] || {}), + i), + ); + for (var y = [], g = t + u + c * d, v = 0; v < h; v++) + y.push( + (function (e, t, r, o) { + var n = {}, + s = new R.Parser(e, t); + (n.name = o[s.parseUShort()] || {}), + s.skip("uShort", 1), + (n.coordinates = {}); + for (var i = 0; i < r.length; ++i) + n.coordinates[r[i].tag] = s.parseFixed(); + return n; + })(e, g + v * f, p, r), + ); + return { axes: p, instances: y }; + }, + }, + A = new Array(10); + (A[1] = function () { + var e = this.offset + this.relativeOffset, + t = this.parseUShort(); + return 1 === t + ? { + posFormat: 1, + coverage: this.parsePointer(u.coverage), + value: this.parseValueRecord(), + } + : 2 === t + ? { + posFormat: 2, + coverage: this.parsePointer(u.coverage), + values: this.parseValueRecordList(), + } + : void L.assert( + !1, + "0x" + + e.toString(16) + + ": GPOS lookup type 1 format must be 1 or 2.", + ); + }), + (A[2] = function () { + var e, + t, + r, + o, + n = this.offset + this.relativeOffset, + s = this.parseUShort(), + n = + (L.assert( + 1 === s || 2 === s, + "0x" + + n.toString(16) + + ": GPOS lookup type 2 format must be 1 or 2.", + ), + this.parsePointer(u.coverage)), + i = this.parseUShort(), + a = this.parseUShort(); + return 1 === s + ? { + posFormat: s, + coverage: n, + valueFormat1: i, + valueFormat2: a, + pairSets: this.parseList( + u.pointer( + u.list(function () { + return { + secondGlyph: this.parseUShort(), + value1: this.parseValueRecord(i), + value2: this.parseValueRecord(a), + }; + }), + ), + ), + } + : 2 === s + ? ((e = this.parsePointer(u.classDef)), + (t = this.parsePointer(u.classDef)), + (r = this.parseUShort()), + (o = this.parseUShort()), + { + posFormat: s, + coverage: n, + valueFormat1: i, + valueFormat2: a, + classDef1: e, + classDef2: t, + class1Count: r, + class2Count: o, + classRecords: this.parseList( + r, + u.list(o, function () { + return { + value1: this.parseValueRecord(i), + value2: this.parseValueRecord(a), + }; + }), + ), + }) + : void 0; + }), + (A[3] = function () { + return { error: "GPOS Lookup 3 not supported" }; + }), + (A[4] = function () { + return { error: "GPOS Lookup 4 not supported" }; + }), + (A[5] = function () { + return { error: "GPOS Lookup 5 not supported" }; + }), + (A[6] = function () { + return { error: "GPOS Lookup 6 not supported" }; + }), + (A[7] = function () { + return { error: "GPOS Lookup 7 not supported" }; + }), + (A[8] = function () { + return { error: "GPOS Lookup 8 not supported" }; + }), + (A[9] = function () { + return { error: "GPOS Lookup 9 not supported" }; + }); + var wr = new Array(10); + var Sr = { + parse: function (e, t) { + return ( + (t = (e = new u(e, (t = t || 0))).parseVersion(1)), + L.argument( + 1 === t || 1.1 === t, + "Unsupported GPOS table version " + t, + ), + 1 === t + ? { + version: t, + scripts: e.parseScriptList(), + features: e.parseFeatureList(), + lookups: e.parseLookupList(A), + } + : { + version: t, + scripts: e.parseScriptList(), + features: e.parseFeatureList(), + lookups: e.parseLookupList(A), + variations: e.parseFeatureVariationsList(), + } + ); + }, + make: function (e) { + return new S.Table("GPOS", [ + { name: "version", type: "ULONG", value: 65536 }, + { + name: "scripts", + type: "TABLE", + value: new S.ScriptList(e.scripts), + }, + { + name: "features", + type: "TABLE", + value: new S.FeatureList(e.features), + }, + { + name: "lookups", + type: "TABLE", + value: new S.LookupList(e.lookups, wr), + }, + ]); + }, + }; + var Tr = { + parse: function (e, t) { + if ( + ((e = new R.Parser(e, t)), 0 === (t = e.parseUShort())) + ) { + var r = e, + o = {}, + n = (r.skip("uShort"), r.parseUShort()), + s = + (L.argument( + 0 === n, + "Unsupported kern sub-table version.", + ), + r.skip("uShort", 2), + r.parseUShort()); + r.skip("uShort", 3); + for (var i = 0; i < s; i += 1) { + var a = r.parseUShort(), + l = r.parseUShort(), + u = r.parseShort(); + o[a + "," + l] = u; + } + return o; + } + if (1 !== t) + throw new Error( + "Unsupported kern table version (" + t + ").", + ); + var c = e, + d = {}, + n = + (c.skip("uShort"), + 1 < c.parseULong() && + console.warn( + "Only the first kern subtable is supported.", + ), + c.skip("uLong"), + 255 & c.parseUShort()); + if ((c.skip("uShort"), 0 == n)) { + var h = c.parseUShort(); + c.skip("uShort", 3); + for (var f = 0; f < h; f += 1) { + var p = c.parseUShort(), + m = c.parseUShort(), + y = c.parseShort(); + d[p + "," + m] = y; + } + } + return d; + }, + }; + var Mr = { + parse: function (e, t, r, o) { + for ( + var n = new R.Parser(e, t), + s = o ? n.parseUShort : n.parseULong, + i = [], + a = 0; + a < r + 1; + a += 1 + ) { + var l = s.call(n); + o && (l *= 2), i.push(l); + } + return i; + }, + }; + function Er(e, r) { + Ar("fs").readFile(e, function (e, t) { + if (e) return r(e.message); + r(null, Ot(t)); + }); + } + function kr(e, t) { + var r = new XMLHttpRequest(); + r.open("get", e, !0), + (r.responseType = "arraybuffer"), + (r.onload = function () { + return r.response + ? t(null, r.response) + : t("Font could not be loaded: " + r.statusText); + }), + (r.onerror = function () { + t("Font could not be loaded"); + }), + r.send(); + } + function Cr(e, t) { + for (var r = [], o = 12, n = 0; n < t; n += 1) { + var s = R.getTag(e, o), + i = R.getULong(e, o + 4), + a = R.getULong(e, o + 8), + l = R.getULong(e, o + 12); + r.push({ + tag: s, + checksum: i, + offset: a, + length: l, + compression: !1, + }), + (o += 16); + } + return r; + } + function I(e, t) { + if ("WOFF" !== t.compression) + return { data: e, offset: t.offset }; + var e = new Uint8Array( + e.buffer, + t.offset + 2, + t.compressedLength - 2, + ), + r = new Uint8Array(t.length); + if ((re(e, r), r.byteLength !== t.length)) + throw new Error( + "Decompression error: " + + t.tag + + " decompressed length doesn't match recorded length", + ); + return { data: new DataView(r.buffer, 0), offset: 0 }; + } + function Or(e) { + var t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + d, + h, + f, + p, + m = new P({ empty: !0 }), + y = new DataView(e, 0), + g = [], + e = R.getTag(y, 0); + if ( + e === String.fromCharCode(0, 1, 0, 0) || + "true" === e || + "typ1" === e + ) + (m.outlinesFormat = "truetype"), + (g = Cr(y, (o = R.getUShort(y, 4)))); + else if ("OTTO" === e) + (m.outlinesFormat = "cff"), + (g = Cr(y, (o = R.getUShort(y, 4)))); + else { + if ("wOFF" !== e) + throw new Error("Unsupported OpenType signature " + e); + var v = R.getTag(y, 4); + if (v === String.fromCharCode(0, 1, 0, 0)) + m.outlinesFormat = "truetype"; + else { + if ("OTTO" !== v) + throw new Error("Unsupported OpenType flavor " + e); + m.outlinesFormat = "cff"; + } + g = (function (e, t) { + for (var r = [], o = 44, n = 0; n < t; n += 1) { + var s = R.getTag(e, o), + i = R.getULong(e, o + 4), + a = R.getULong(e, o + 8), + l = R.getULong(e, o + 12), + u = void 0, + u = a < l && "WOFF"; + r.push({ + tag: s, + offset: i, + compression: u, + compressedLength: a, + length: l, + }), + (o += 20); + } + return r; + })(y, (o = R.getUShort(y, 12))); + } + for (var b = 0; b < o; b += 1) { + var j = g[b], + _ = void 0; + switch (j.tag) { + case "cmap": + (_ = I(y, j)), + (m.tables.cmap = we.parse(_.data, _.offset)), + (m.encoding = new ke(m.tables.cmap)); + break; + case "cvt ": + (_ = I(y, j)), + (p = new R.Parser(_.data, _.offset)), + (m.tables.cvt = p.parseShortList(j.length / 2)); + break; + case "fvar": + s = j; + break; + case "fpgm": + (_ = I(y, j)), + (p = new R.Parser(_.data, _.offset)), + (m.tables.fpgm = p.parseByteList(j.length)); + break; + case "head": + (_ = I(y, j)), + (m.tables.head = Ze.parse(_.data, _.offset)), + (m.unitsPerEm = m.tables.head.unitsPerEm), + (t = m.tables.head.indexToLocFormat); + break; + case "hhea": + (_ = I(y, j)), + (m.tables.hhea = Qe.parse(_.data, _.offset)), + (m.ascender = m.tables.hhea.ascender), + (m.descender = m.tables.hhea.descender), + (m.numberOfHMetrics = m.tables.hhea.numberOfHMetrics); + break; + case "hmtx": + u = j; + break; + case "ltag": + (_ = I(y, j)), (r = Ke.parse(_.data, _.offset)); + break; + case "maxp": + (_ = I(y, j)), + (m.tables.maxp = $e.parse(_.data, _.offset)), + (m.numGlyphs = m.tables.maxp.numGlyphs); + break; + case "name": + h = j; + break; + case "OS/2": + (_ = I(y, j)), + (m.tables.os2 = ft.parse(_.data, _.offset)); + break; + case "post": + (_ = I(y, j)), + (m.tables.post = pt.parse(_.data, _.offset)), + (m.glyphNames = new Oe(m.tables.post)); + break; + case "prep": + (_ = I(y, j)), + (p = new R.Parser(_.data, _.offset)), + (m.tables.prep = p.parseByteList(j.length)); + break; + case "glyf": + i = j; + break; + case "loca": + d = j; + break; + case "CFF ": + n = j; + break; + case "kern": + c = j; + break; + case "GPOS": + a = j; + break; + case "GSUB": + l = j; + break; + case "meta": + f = j; + } + } + v = I(y, h); + if ( + ((m.tables.name = dt.parse(v.data, v.offset, r)), + (m.names = m.tables.name), + i && d) + ) { + (e = 0 === t), + (v = I(y, d)), + (v = Mr.parse(v.data, v.offset, m.numGlyphs, e)), + (e = I(y, i)); + m.glyphs = Dt.parse(e.data, e.offset, v, m); + } else { + if (!n) + throw new Error( + "Font doesn't contain TrueType or CFF outlines.", + ); + e = I(y, n); + Ye.parse(e.data, e.offset, m); + } + for ( + var v = I(y, u), + x = + (Je.parse( + v.data, + v.offset, + m.numberOfHMetrics, + m.numGlyphs, + m.glyphs, + ), + m), + w = x.tables.cmap.glyphIndexMap, + S = Object.keys(w), + T = 0; + T < S.length; + T += 1 + ) { + var M, + E = S[T], + k = w[E]; + (M = x.glyphs.get(k)).addUnicode(parseInt(E)); + } + for (var C = 0; C < x.glyphs.length; C += 1) + (M = x.glyphs.get(C)), + x.cffEncoding + ? x.isCIDFont + ? (M.name = "gid" + C) + : (M.name = x.cffEncoding.charset[C]) + : x.glyphNames.names && + (M.name = x.glyphNames.glyphIndexToName(C)); + return ( + c + ? ((e = I(y, c)), + (m.kerningPairs = Tr.parse(e.data, e.offset))) + : (m.kerningPairs = {}), + a && + ((v = I(y, a)), + (m.tables.gpos = Sr.parse(v.data, v.offset)), + m.position.init()), + l && + ((e = I(y, l)), + (m.tables.gsub = yt.parse(e.data, e.offset))), + s && + ((v = I(y, s)), + (m.tables.fvar = xr.parse(v.data, v.offset, m.names))), + f && + ((e = I(y, f)), + (m.tables.meta = gt.parse(e.data, e.offset)), + (m.metas = m.tables.meta)), + m + ); + } + (j.Font = P), + (j.Glyph = f), + (j.Path = h), + (j.BoundingBox = a), + (j._parse = R), + (j.parse = Or), + (j.load = function (e, o) { + ("undefined" == typeof window ? Er : kr)( + e, + function (e, t) { + if (e) return o(e); + var r; + try { + r = Or(t); + } catch (e) { + return o(e, null); + } + return o(null, r); + }, + ); + }), + (j.loadSync = function (e) { + return Or(Ot(Ar("fs").readFileSync(e))); + }), + Object.defineProperty(j, "__esModule", { value: !0 }); + }), + "object" == typeof o && void 0 !== r + ? t(o) + : "function" == typeof s && s.amd + ? s(["exports"], t) + : t((e.opentype = {})); + }.call(this, Ar("buffer").Buffer); + }, + { buffer: 4, fs: 2 }, + ], + 250: [ + function (e, t, u) { + !function (n) { + function s(e, t) { + for (var r = 0, o = e.length - 1; 0 <= o; o--) { + var n = e[o]; + "." === n + ? e.splice(o, 1) + : ".." === n + ? (e.splice(o, 1), r++) + : r && (e.splice(o, 1), r--); + } + if (t) for (; r--; ) e.unshift(".."); + return e; + } + function i(e, t) { + if (e.filter) return e.filter(t); + for (var r = [], o = 0; o < e.length; o++) + t(e[o], o, e) && r.push(e[o]); + return r; + } + (u.resolve = function () { + for ( + var e = "", t = !1, r = arguments.length - 1; + -1 <= r && !t; + r-- + ) { + var o = 0 <= r ? arguments[r] : n.cwd(); + if ("string" != typeof o) + throw new TypeError( + "Arguments to path.resolve must be strings", + ); + o && ((e = o + "/" + e), (t = "/" === o.charAt(0))); + } + return ( + (t ? "/" : "") + + (e = s( + i(e.split("/"), function (e) { + return !!e; + }), + !t, + ).join("/")) || "." + ); + }), + (u.normalize = function (e) { + var t = u.isAbsolute(e), + r = "/" === o(e, -1); + return ( + (e = + (e = s( + i(e.split("/"), function (e) { + return !!e; + }), + !t, + ).join("/")) || t + ? e + : ".") && + r && + (e += "/"), + (t ? "/" : "") + e + ); + }), + (u.isAbsolute = function (e) { + return "/" === e.charAt(0); + }), + (u.join = function () { + var e = Array.prototype.slice.call(arguments, 0); + return u.normalize( + i(e, function (e, t) { + if ("string" != typeof e) + throw new TypeError( + "Arguments to path.join must be strings", + ); + return e; + }).join("/"), + ); + }), + (u.relative = function (e, t) { + function r(e) { + for (var t = 0; t < e.length && "" === e[t]; t++); + for (var r = e.length - 1; 0 <= r && "" === e[r]; r--); + return r < t ? [] : e.slice(t, r - t + 1); + } + (e = u.resolve(e).substr(1)), (t = u.resolve(t).substr(1)); + for ( + var o = r(e.split("/")), + n = r(t.split("/")), + s = Math.min(o.length, n.length), + i = s, + a = 0; + a < s; + a++ + ) + if (o[a] !== n[a]) { + i = a; + break; + } + for (var l = [], a = i; a < o.length; a++) l.push(".."); + return (l = l.concat(n.slice(i))).join("/"); + }), + (u.sep = "/"), + (u.delimiter = ":"), + (u.dirname = function (e) { + if (("string" != typeof e && (e += ""), 0 === e.length)) + return "."; + for ( + var t = 47 === e.charCodeAt(0), + r = -1, + o = !0, + n = e.length - 1; + 1 <= n; + --n + ) + if (47 === e.charCodeAt(n)) { + if (!o) { + r = n; + break; + } + } else o = !1; + return -1 === r + ? t + ? "/" + : "." + : t && 1 === r + ? "/" + : e.slice(0, r); + }), + (u.basename = function (e, t) { + e = (function (e) { + "string" != typeof e && (e += ""); + for (var t = 0, r = -1, o = !0, n = e.length - 1; 0 <= n; --n) + if (47 === e.charCodeAt(n)) { + if (!o) { + t = n + 1; + break; + } + } else -1 === r && ((o = !1), (r = n + 1)); + return -1 === r ? "" : e.slice(t, r); + })(e); + return (e = + t && e.substr(-1 * t.length) === t + ? e.substr(0, e.length - t.length) + : e); + }), + (u.extname = function (e) { + "string" != typeof e && (e += ""); + for ( + var t = -1, r = 0, o = -1, n = !0, s = 0, i = e.length - 1; + 0 <= i; + --i + ) { + var a = e.charCodeAt(i); + if (47 === a) { + if (n) continue; + r = i + 1; + break; + } + -1 === o && ((n = !1), (o = i + 1)), + 46 === a + ? -1 === t + ? (t = i) + : 1 !== s && (s = 1) + : -1 !== t && (s = -1); + } + return -1 === t || + -1 === o || + 0 === s || + (1 === s && t === o - 1 && t === r + 1) + ? "" + : e.slice(t, o); + }); + var o = + "b" === "ab".substr(-1) + ? function (e, t, r) { + return e.substr(t, r); + } + : function (e, t, r) { + return t < 0 && (t = e.length + t), e.substr(t, r); + }; + }.call(this, e("_process")); + }, + { _process: 251 }, + ], + 251: [ + function (e, t, r) { + var o, + n, + t = (t.exports = {}); + function s() { + throw new Error("setTimeout has not been defined"); + } + function i() { + throw new Error("clearTimeout has not been defined"); + } + try { + o = "function" == typeof setTimeout ? setTimeout : s; + } catch (e) { + o = s; + } + try { + n = "function" == typeof clearTimeout ? clearTimeout : i; + } catch (e) { + n = i; + } + function a(t) { + if (o === setTimeout) return setTimeout(t, 0); + if ((o === s || !o) && setTimeout) return (o = setTimeout)(t, 0); + try { + return o(t, 0); + } catch (e) { + try { + return o.call(null, t, 0); + } catch (e) { + return o.call(this, t, 0); + } + } + } + var l, + u = [], + c = !1, + d = -1; + function h() { + c && + l && + ((c = !1), + l.length ? (u = l.concat(u)) : (d = -1), + u.length && f()); + } + function f() { + if (!c) { + for (var e = a(h), t = ((c = !0), u.length); t; ) { + for (l = u, u = []; ++d < t; ) l && l[d].run(); + (d = -1), (t = u.length); + } + (l = null), + (c = !1), + !(function (t) { + if (n === clearTimeout) return clearTimeout(t); + if ((n === i || !n) && clearTimeout) + return (n = clearTimeout)(t); + try { + n(t); + } catch (e) { + try { + return n.call(null, t); + } catch (e) { + return n.call(this, t); + } + } + })(e); + } + } + function p(e, t) { + (this.fun = e), (this.array = t); + } + function m() {} + (t.nextTick = function (e) { + var t = new Array(arguments.length - 1); + if (1 < arguments.length) + for (var r = 1; r < arguments.length; r++) + t[r - 1] = arguments[r]; + u.push(new p(e, t)), 1 !== u.length || c || a(f); + }), + (p.prototype.run = function () { + this.fun.apply(null, this.array); + }), + (t.title = "browser"), + (t.browser = !0), + (t.env = {}), + (t.argv = []), + (t.version = ""), + (t.versions = {}), + (t.on = m), + (t.addListener = m), + (t.once = m), + (t.off = m), + (t.removeListener = m), + (t.removeAllListeners = m), + (t.emit = m), + (t.prependListener = m), + (t.prependOnceListener = m), + (t.listeners = function (e) { + return []; + }), + (t.binding = function (e) { + throw new Error("process.binding is not supported"); + }), + (t.cwd = function () { + return "/"; + }), + (t.chdir = function (e) { + throw new Error("process.chdir is not supported"); + }), + (t.umask = function () { + return 0; + }); + }, + {}, + ], + 252: [ + function (e, t, r) { + t = (function (s) { + "use strict"; + var l, + e = Object.prototype, + u = e.hasOwnProperty, + t = "function" == typeof Symbol ? Symbol : {}, + o = t.iterator || "@@iterator", + r = t.asyncIterator || "@@asyncIterator", + n = t.toStringTag || "@@toStringTag"; + function i(e, t, r, o) { + var n, + s, + i, + a, + t = t && t.prototype instanceof y ? t : y, + t = Object.create(t.prototype), + o = new S(o || []); + return ( + (t._invoke = + ((n = e), + (s = r), + (i = o), + (a = d), + function (e, t) { + if (a === f) + throw new Error("Generator is already running"); + if (a === p) { + if ("throw" === e) throw t; + return M(); + } + for (i.method = e, i.arg = t; ; ) { + var r = i.delegate; + if (r) { + r = (function e(t, r) { + var o = t.iterator[r.method]; + if (o === l) { + if (((r.delegate = null), "throw" === r.method)) { + if ( + t.iterator.return && + ((r.method = "return"), + (r.arg = l), + e(t, r), + "throw" === r.method) + ) + return m; + (r.method = "throw"), + (r.arg = new TypeError( + "The iterator does not provide a 'throw' method", + )); + } + return m; + } + o = c(o, t.iterator, r.arg); + if ("throw" === o.type) + return ( + (r.method = "throw"), + (r.arg = o.arg), + (r.delegate = null), + m + ); + o = o.arg; + if (!o) + return ( + (r.method = "throw"), + (r.arg = new TypeError( + "iterator result is not an object", + )), + (r.delegate = null), + m + ); + { + if (!o.done) return o; + (r[t.resultName] = o.value), + (r.next = t.nextLoc), + "return" !== r.method && + ((r.method = "next"), (r.arg = l)); + } + r.delegate = null; + return m; + })(r, i); + if (r) { + if (r === m) continue; + return r; + } + } + if ("next" === i.method) i.sent = i._sent = i.arg; + else if ("throw" === i.method) { + if (a === d) throw ((a = p), i.arg); + i.dispatchException(i.arg); + } else "return" === i.method && i.abrupt("return", i.arg); + a = f; + r = c(n, s, i); + if ("normal" === r.type) { + if (((a = i.done ? p : h), r.arg !== m)) + return { value: r.arg, done: i.done }; + } else + "throw" === r.type && + ((a = p), (i.method = "throw"), (i.arg = r.arg)); + } + })), + t + ); + } + function c(e, t, r) { + try { + return { type: "normal", arg: e.call(t, r) }; + } catch (e) { + return { type: "throw", arg: e }; + } + } + s.wrap = i; + var d = "suspendedStart", + h = "suspendedYield", + f = "executing", + p = "completed", + m = {}; + function y() {} + function a() {} + function g() {} + var t = {}, + v = + ((t[o] = function () { + return this; + }), + Object.getPrototypeOf), + v = v && v(v(T([]))), + b = + (v && v !== e && u.call(v, o) && (t = v), + (g.prototype = y.prototype = Object.create(t))); + function j(e) { + ["next", "throw", "return"].forEach(function (t) { + e[t] = function (e) { + return this._invoke(t, e); + }; + }); + } + function _(i) { + var t; + this._invoke = function (r, o) { + function e() { + return new Promise(function (e, t) { + !(function t(e, r, o, n) { + var s, + e = c(i[e], i, r); + if ("throw" !== e.type) + return (r = (s = e.arg).value) && + "object" == typeof r && + u.call(r, "__await") + ? Promise.resolve(r.__await).then( + function (e) { + t("next", e, o, n); + }, + function (e) { + t("throw", e, o, n); + }, + ) + : Promise.resolve(r).then( + function (e) { + (s.value = e), o(s); + }, + function (e) { + return t("throw", e, o, n); + }, + ); + n(e.arg); + })(r, o, e, t); + }); + } + return (t = t ? t.then(e, e) : e()); + }; + } + function x(e) { + var t = { tryLoc: e[0] }; + 1 in e && (t.catchLoc = e[1]), + 2 in e && ((t.finallyLoc = e[2]), (t.afterLoc = e[3])), + this.tryEntries.push(t); + } + function w(e) { + var t = e.completion || {}; + (t.type = "normal"), delete t.arg, (e.completion = t); + } + function S(e) { + (this.tryEntries = [{ tryLoc: "root" }]), + e.forEach(x, this), + this.reset(!0); + } + function T(t) { + if (t) { + var r, + e = t[o]; + if (e) return e.call(t); + if ("function" == typeof t.next) return t; + if (!isNaN(t.length)) + return ( + (r = -1), + ((e = function e() { + for (; ++r < t.length; ) + if (u.call(t, r)) + return (e.value = t[r]), (e.done = !1), e; + return (e.value = l), (e.done = !0), e; + }).next = e) + ); + } + return { next: M }; + } + function M() { + return { value: l, done: !0 }; + } + return ( + ((a.prototype = b.constructor = g).constructor = a), + (g[n] = a.displayName = "GeneratorFunction"), + (s.isGeneratorFunction = function (e) { + e = "function" == typeof e && e.constructor; + return ( + !!e && + (e === a || "GeneratorFunction" === (e.displayName || e.name)) + ); + }), + (s.mark = function (e) { + return ( + Object.setPrototypeOf + ? Object.setPrototypeOf(e, g) + : ((e.__proto__ = g), + n in e || (e[n] = "GeneratorFunction")), + (e.prototype = Object.create(b)), + e + ); + }), + (s.awrap = function (e) { + return { __await: e }; + }), + j(_.prototype), + (_.prototype[r] = function () { + return this; + }), + (s.AsyncIterator = _), + (s.async = function (e, t, r, o) { + var n = new _(i(e, t, r, o)); + return s.isGeneratorFunction(t) + ? n + : n.next().then(function (e) { + return e.done ? e.value : n.next(); + }); + }), + j(b), + (b[n] = "Generator"), + (b[o] = function () { + return this; + }), + (b.toString = function () { + return "[object Generator]"; + }), + (s.keys = function (r) { + var e, + o = []; + for (e in r) o.push(e); + return ( + o.reverse(), + function e() { + for (; o.length; ) { + var t = o.pop(); + if (t in r) return (e.value = t), (e.done = !1), e; + } + return (e.done = !0), e; + } + ); + }), + (s.values = T), + (S.prototype = { + constructor: S, + reset: function (e) { + if ( + ((this.prev = 0), + (this.next = 0), + (this.sent = this._sent = l), + (this.done = !1), + (this.delegate = null), + (this.method = "next"), + (this.arg = l), + this.tryEntries.forEach(w), + !e) + ) + for (var t in this) + "t" === t.charAt(0) && + u.call(this, t) && + !isNaN(+t.slice(1)) && + (this[t] = l); + }, + stop: function () { + this.done = !0; + var e = this.tryEntries[0].completion; + if ("throw" === e.type) throw e.arg; + return this.rval; + }, + dispatchException: function (r) { + if (this.done) throw r; + var o = this; + function e(e, t) { + return ( + (s.type = "throw"), + (s.arg = r), + (o.next = e), + t && ((o.method = "next"), (o.arg = l)), + !!t + ); + } + for (var t = this.tryEntries.length - 1; 0 <= t; --t) { + var n = this.tryEntries[t], + s = n.completion; + if ("root" === n.tryLoc) return e("end"); + if (n.tryLoc <= this.prev) { + var i = u.call(n, "catchLoc"), + a = u.call(n, "finallyLoc"); + if (i && a) { + if (this.prev < n.catchLoc) return e(n.catchLoc, !0); + if (this.prev < n.finallyLoc) return e(n.finallyLoc); + } else if (i) { + if (this.prev < n.catchLoc) return e(n.catchLoc, !0); + } else { + if (!a) + throw new Error( + "try statement without catch or finally", + ); + if (this.prev < n.finallyLoc) return e(n.finallyLoc); + } + } + } + }, + abrupt: function (e, t) { + for (var r = this.tryEntries.length - 1; 0 <= r; --r) { + var o = this.tryEntries[r]; + if ( + o.tryLoc <= this.prev && + u.call(o, "finallyLoc") && + this.prev < o.finallyLoc + ) { + var n = o; + break; + } + } + var s = (n = + n && + ("break" === e || "continue" === e) && + n.tryLoc <= t && + t <= n.finallyLoc + ? null + : n) + ? n.completion + : {}; + return ( + (s.type = e), + (s.arg = t), + n + ? ((this.method = "next"), (this.next = n.finallyLoc), m) + : this.complete(s) + ); + }, + complete: function (e, t) { + if ("throw" === e.type) throw e.arg; + return ( + "break" === e.type || "continue" === e.type + ? (this.next = e.arg) + : "return" === e.type + ? ((this.rval = this.arg = e.arg), + (this.method = "return"), + (this.next = "end")) + : "normal" === e.type && t && (this.next = t), + m + ); + }, + finish: function (e) { + for (var t = this.tryEntries.length - 1; 0 <= t; --t) { + var r = this.tryEntries[t]; + if (r.finallyLoc === e) + return this.complete(r.completion, r.afterLoc), w(r), m; + } + }, + catch: function (e) { + for (var t = this.tryEntries.length - 1; 0 <= t; --t) { + var r, + o, + n = this.tryEntries[t]; + if (n.tryLoc === e) + return ( + "throw" === (r = n.completion).type && + ((o = r.arg), w(n)), + o + ); + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function (e, t, r) { + return ( + (this.delegate = { + iterator: T(e), + resultName: t, + nextLoc: r, + }), + "next" === this.method && (this.arg = l), + m + ); + }, + }), + s + ); + })("object" == typeof t ? t.exports : {}); + try { + regeneratorRuntime = t; + } catch (e) { + Function("r", "regeneratorRuntime = r")(t); + } + }, + {}, + ], + 253: [ + function (e, t, r) { + !(function (e) { + "use strict"; + var t, r, i, o, n, s, a, l, u, c; + function d(e) { + if ( + ("string" != typeof e && (e = String(e)), + /[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e)) + ) + throw new TypeError("Invalid character in header field name"); + return e.toLowerCase(); + } + function h(e) { + return (e = "string" != typeof e ? String(e) : e); + } + function f(t) { + var e = { + next: function () { + var e = t.shift(); + return { done: void 0 === e, value: e }; + }, + }; + return ( + r && + (e[Symbol.iterator] = function () { + return e; + }), + e + ); + } + function p(t) { + (this.map = {}), + t instanceof p + ? t.forEach(function (e, t) { + this.append(t, e); + }, this) + : Array.isArray(t) + ? t.forEach(function (e) { + this.append(e[0], e[1]); + }, this) + : t && + Object.getOwnPropertyNames(t).forEach(function (e) { + this.append(e, t[e]); + }, this); + } + function m(e) { + if (e.bodyUsed) + return Promise.reject(new TypeError("Already read")); + e.bodyUsed = !0; + } + function y(r) { + return new Promise(function (e, t) { + (r.onload = function () { + e(r.result); + }), + (r.onerror = function () { + t(r.error); + }); + }); + } + function g(e) { + var t = new FileReader(), + r = y(t); + return t.readAsArrayBuffer(e), r; + } + function v(e) { + var t; + return e.slice + ? e.slice(0) + : ((t = new Uint8Array(e.byteLength)).set(new Uint8Array(e)), + t.buffer); + } + function b() { + return ( + (this.bodyUsed = !1), + (this._initBody = function (e) { + if ((this._bodyInit = e)) + if ("string" == typeof e) this._bodyText = e; + else if (i && Blob.prototype.isPrototypeOf(e)) + this._bodyBlob = e; + else if (o && FormData.prototype.isPrototypeOf(e)) + this._bodyFormData = e; + else if (t && URLSearchParams.prototype.isPrototypeOf(e)) + this._bodyText = e.toString(); + else if (n && i && a(e)) + (this._bodyArrayBuffer = v(e.buffer)), + (this._bodyInit = new Blob([this._bodyArrayBuffer])); + else { + if ( + !n || + (!ArrayBuffer.prototype.isPrototypeOf(e) && !l(e)) + ) + throw new Error("unsupported BodyInit type"); + this._bodyArrayBuffer = v(e); + } + else this._bodyText = ""; + this.headers.get("content-type") || + ("string" == typeof e + ? this.headers.set( + "content-type", + "text/plain;charset=UTF-8", + ) + : this._bodyBlob && this._bodyBlob.type + ? this.headers.set("content-type", this._bodyBlob.type) + : t && + URLSearchParams.prototype.isPrototypeOf(e) && + this.headers.set( + "content-type", + "application/x-www-form-urlencoded;charset=UTF-8", + )); + }), + i && + ((this.blob = function () { + var e = m(this); + if (e) return e; + if (this._bodyBlob) return Promise.resolve(this._bodyBlob); + if (this._bodyArrayBuffer) + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + if (this._bodyFormData) + throw new Error("could not read FormData body as blob"); + return Promise.resolve(new Blob([this._bodyText])); + }), + (this.arrayBuffer = function () { + return this._bodyArrayBuffer + ? m(this) || Promise.resolve(this._bodyArrayBuffer) + : this.blob().then(g); + })), + (this.text = function () { + var e, + t, + r = m(this); + if (r) return r; + if (this._bodyBlob) + return ( + (r = this._bodyBlob), + (e = new FileReader()), + (t = y(e)), + e.readAsText(r), + t + ); + if (this._bodyArrayBuffer) + return Promise.resolve( + (function (e) { + for ( + var t = new Uint8Array(e), + r = new Array(t.length), + o = 0; + o < t.length; + o++ + ) + r[o] = String.fromCharCode(t[o]); + return r.join(""); + })(this._bodyArrayBuffer), + ); + if (this._bodyFormData) + throw new Error("could not read FormData body as text"); + return Promise.resolve(this._bodyText); + }), + o && + (this.formData = function () { + return this.text().then(_); + }), + (this.json = function () { + return this.text().then(JSON.parse); + }), + this + ); + } + function j(e, t) { + var r, + o = (t = t || {}).body; + if (e instanceof j) { + if (e.bodyUsed) throw new TypeError("Already read"); + (this.url = e.url), + (this.credentials = e.credentials), + t.headers || (this.headers = new p(e.headers)), + (this.method = e.method), + (this.mode = e.mode), + o || + null == e._bodyInit || + ((o = e._bodyInit), (e.bodyUsed = !0)); + } else this.url = String(e); + if ( + ((this.credentials = + t.credentials || this.credentials || "omit"), + (!t.headers && this.headers) || + (this.headers = new p(t.headers)), + (this.method = + ((e = t.method || this.method || "GET"), + (r = e.toUpperCase()), + -1 < u.indexOf(r) ? r : e)), + (this.mode = t.mode || this.mode || null), + (this.referrer = null), + ("GET" === this.method || "HEAD" === this.method) && o) + ) + throw new TypeError( + "Body not allowed for GET or HEAD requests", + ); + this._initBody(o); + } + function _(e) { + var r = new FormData(); + return ( + e + .trim() + .split("&") + .forEach(function (e) { + var t; + e && + ((t = (e = e.split("=")).shift().replace(/\+/g, " ")), + (e = e.join("=").replace(/\+/g, " ")), + r.append(decodeURIComponent(t), decodeURIComponent(e))); + }), + r + ); + } + function x(e, t) { + (t = t || {}), + (this.type = "default"), + (this.status = void 0 === t.status ? 200 : t.status), + (this.ok = 200 <= this.status && this.status < 300), + (this.statusText = "statusText" in t ? t.statusText : "OK"), + (this.headers = new p(t.headers)), + (this.url = t.url || ""), + this._initBody(e); + } + e.fetch || + ((t = "URLSearchParams" in e), + (r = "Symbol" in e && "iterator" in Symbol), + (i = + "FileReader" in e && + "Blob" in e && + (function () { + try { + return new Blob(), !0; + } catch (e) { + return !1; + } + })()), + (o = "FormData" in e), + (n = "ArrayBuffer" in e) && + ((s = [ + "[object Int8Array]", + "[object Uint8Array]", + "[object Uint8ClampedArray]", + "[object Int16Array]", + "[object Uint16Array]", + "[object Int32Array]", + "[object Uint32Array]", + "[object Float32Array]", + "[object Float64Array]", + ]), + (a = function (e) { + return e && DataView.prototype.isPrototypeOf(e); + }), + (l = + ArrayBuffer.isView || + function (e) { + return ( + e && -1 < s.indexOf(Object.prototype.toString.call(e)) + ); + })), + (p.prototype.append = function (e, t) { + (e = d(e)), (t = h(t)); + var r = this.map[e]; + this.map[e] = r ? r + "," + t : t; + }), + (p.prototype.delete = function (e) { + delete this.map[d(e)]; + }), + (p.prototype.get = function (e) { + return (e = d(e)), this.has(e) ? this.map[e] : null; + }), + (p.prototype.has = function (e) { + return this.map.hasOwnProperty(d(e)); + }), + (p.prototype.set = function (e, t) { + this.map[d(e)] = h(t); + }), + (p.prototype.forEach = function (e, t) { + for (var r in this.map) + this.map.hasOwnProperty(r) && e.call(t, this.map[r], r, this); + }), + (p.prototype.keys = function () { + var r = []; + return ( + this.forEach(function (e, t) { + r.push(t); + }), + f(r) + ); + }), + (p.prototype.values = function () { + var t = []; + return ( + this.forEach(function (e) { + t.push(e); + }), + f(t) + ); + }), + (p.prototype.entries = function () { + var r = []; + return ( + this.forEach(function (e, t) { + r.push([t, e]); + }), + f(r) + ); + }), + r && (p.prototype[Symbol.iterator] = p.prototype.entries), + (u = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]), + (j.prototype.clone = function () { + return new j(this, { body: this._bodyInit }); + }), + b.call(j.prototype), + b.call(x.prototype), + (x.prototype.clone = function () { + return new x(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new p(this.headers), + url: this.url, + }); + }), + (x.error = function () { + var e = new x(null, { status: 0, statusText: "" }); + return (e.type = "error"), e; + }), + (c = [301, 302, 303, 307, 308]), + (x.redirect = function (e, t) { + if (-1 === c.indexOf(t)) + throw new RangeError("Invalid status code"); + return new x(null, { status: t, headers: { location: e } }); + }), + (e.Headers = p), + (e.Request = j), + (e.Response = x), + (e.fetch = function (r, s) { + return new Promise(function (o, e) { + var t = new j(r, s), + n = new XMLHttpRequest(); + (n.onload = function () { + var r, + e = { + status: n.status, + statusText: n.statusText, + headers: + ((e = n.getAllResponseHeaders() || ""), + (r = new p()), + e + .replace(/\r?\n[\t ]+/g, " ") + .split(/\r?\n/) + .forEach(function (e) { + var e = e.split(":"), + t = e.shift().trim(); + t && ((e = e.join(":").trim()), r.append(t, e)); + }), + r), + }, + t = + ((e.url = + "responseURL" in n + ? n.responseURL + : e.headers.get("X-Request-URL")), + "response" in n ? n.response : n.responseText); + o(new x(t, e)); + }), + (n.onerror = function () { + e(new TypeError("Network request failed")); + }), + (n.ontimeout = function () { + e(new TypeError("Network request failed")); + }), + n.open(t.method, t.url, !0), + "include" === t.credentials + ? (n.withCredentials = !0) + : "omit" === t.credentials && (n.withCredentials = !1), + "responseType" in n && i && (n.responseType = "blob"), + t.headers.forEach(function (e, t) { + n.setRequestHeader(t, e); + }), + n.send(void 0 === t._bodyInit ? null : t._bodyInit); + }); + }), + (e.fetch.polyfill = !0)); + })("undefined" != typeof self ? self : this); + }, + {}, + ], + 254: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.function.name"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.split"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l, + o = n(e("../core/main")), + u = n(e("../color/color_conversion")); + function n(e) { + return e && e.__esModule ? e : { default: e }; + } + var c = [ + { h: 0, s: 0, b: 0.8275, name: "gray" }, + { h: 0, s: 0, b: 0.8627, name: "gray" }, + { h: 0, s: 0, b: 0.7529, name: "gray" }, + { h: 0.0167, s: 0.1176, b: 1, name: "light pink" }, + ], + d = [ + { h: 0, s: 0, b: 0, name: "black" }, + { h: 0, s: 0, b: 0.5, name: "gray" }, + { h: 0, s: 0, b: 1, name: "white" }, + { h: 0, s: 0.5, b: 0.5, name: "dark maroon" }, + { h: 0, s: 0.5, b: 1, name: "salmon pink" }, + { h: 0, s: 1, b: 0, name: "black" }, + { h: 0, s: 1, b: 0.5, name: "dark red" }, + { h: 0, s: 1, b: 1, name: "red" }, + { h: 5, s: 0, b: 1, name: "very light peach" }, + { h: 5, s: 0.5, b: 0.5, name: "brown" }, + { h: 5, s: 0.5, b: 1, name: "peach" }, + { h: 5, s: 1, b: 0.5, name: "brick red" }, + { h: 5, s: 1, b: 1, name: "crimson" }, + { h: 10, s: 0, b: 1, name: "light peach" }, + { h: 10, s: 0.5, b: 0.5, name: "brown" }, + { h: 10, s: 0.5, b: 1, name: "light orange" }, + { h: 10, s: 1, b: 0.5, name: "brown" }, + { h: 10, s: 1, b: 1, name: "orange" }, + { h: 15, s: 0, b: 1, name: "very light yellow" }, + { h: 15, s: 0.5, b: 0.5, name: "olive green" }, + { h: 15, s: 0.5, b: 1, name: "light yellow" }, + { h: 15, s: 1, b: 0, name: "dark olive green" }, + { h: 15, s: 1, b: 0.5, name: "olive green" }, + { h: 15, s: 1, b: 1, name: "yellow" }, + { h: 20, s: 0, b: 1, name: "very light yellow" }, + { h: 20, s: 0.5, b: 0.5, name: "olive green" }, + { h: 20, s: 0.5, b: 1, name: "light yellow green" }, + { h: 20, s: 1, b: 0, name: "dark olive green" }, + { h: 20, s: 1, b: 0.5, name: "dark yellow green" }, + { h: 20, s: 1, b: 1, name: "yellow green" }, + { h: 25, s: 0.5, b: 0.5, name: "dark yellow green" }, + { h: 25, s: 0.5, b: 1, name: "light green" }, + { h: 25, s: 1, b: 0.5, name: "dark green" }, + { h: 25, s: 1, b: 1, name: "green" }, + { h: 30, s: 0.5, b: 1, name: "light green" }, + { h: 30, s: 1, b: 0.5, name: "dark green" }, + { h: 30, s: 1, b: 1, name: "green" }, + { h: 35, s: 0, b: 0.5, name: "light green" }, + { h: 35, s: 0, b: 1, name: "very light green" }, + { h: 35, s: 0.5, b: 0.5, name: "dark green" }, + { h: 35, s: 0.5, b: 1, name: "light green" }, + { h: 35, s: 1, b: 0, name: "very dark green" }, + { h: 35, s: 1, b: 0.5, name: "dark green" }, + { h: 35, s: 1, b: 1, name: "green" }, + { h: 40, s: 0, b: 1, name: "very light green" }, + { h: 40, s: 0.5, b: 0.5, name: "dark green" }, + { h: 40, s: 0.5, b: 1, name: "light green" }, + { h: 40, s: 1, b: 0.5, name: "dark green" }, + { h: 40, s: 1, b: 1, name: "green" }, + { h: 45, s: 0.5, b: 1, name: "light turquoise" }, + { h: 45, s: 1, b: 0.5, name: "dark turquoise" }, + { h: 45, s: 1, b: 1, name: "turquoise" }, + { h: 50, s: 0, b: 1, name: "light sky blue" }, + { h: 50, s: 0.5, b: 0.5, name: "dark cyan" }, + { h: 50, s: 0.5, b: 1, name: "light cyan" }, + { h: 50, s: 1, b: 0.5, name: "dark cyan" }, + { h: 50, s: 1, b: 1, name: "cyan" }, + { h: 55, s: 0, b: 1, name: "light sky blue" }, + { h: 55, s: 0.5, b: 1, name: "light sky blue" }, + { h: 55, s: 1, b: 0.5, name: "dark blue" }, + { h: 55, s: 1, b: 1, name: "sky blue" }, + { h: 60, s: 0, b: 0.5, name: "gray" }, + { h: 60, s: 0, b: 1, name: "very light blue" }, + { h: 60, s: 0.5, b: 0.5, name: "blue" }, + { h: 60, s: 0.5, b: 1, name: "light blue" }, + { h: 60, s: 1, b: 0.5, name: "navy blue" }, + { h: 60, s: 1, b: 1, name: "blue" }, + { h: 65, s: 0, b: 1, name: "lavender" }, + { h: 65, s: 0.5, b: 0.5, name: "navy blue" }, + { h: 65, s: 0.5, b: 1, name: "light purple" }, + { h: 65, s: 1, b: 0.5, name: "dark navy blue" }, + { h: 65, s: 1, b: 1, name: "blue" }, + { h: 70, s: 0, b: 1, name: "lavender" }, + { h: 70, s: 0.5, b: 0.5, name: "navy blue" }, + { h: 70, s: 0.5, b: 1, name: "lavender blue" }, + { h: 70, s: 1, b: 0.5, name: "dark navy blue" }, + { h: 70, s: 1, b: 1, name: "blue" }, + { h: 75, s: 0.5, b: 1, name: "lavender" }, + { h: 75, s: 1, b: 0.5, name: "dark purple" }, + { h: 75, s: 1, b: 1, name: "purple" }, + { h: 80, s: 0.5, b: 1, name: "pinkish purple" }, + { h: 80, s: 1, b: 0.5, name: "dark purple" }, + { h: 80, s: 1, b: 1, name: "purple" }, + { h: 85, s: 0, b: 1, name: "light pink" }, + { h: 85, s: 0.5, b: 0.5, name: "purple" }, + { h: 85, s: 0.5, b: 1, name: "light fuchsia" }, + { h: 85, s: 1, b: 0.5, name: "dark fuchsia" }, + { h: 85, s: 1, b: 1, name: "fuchsia" }, + { h: 90, s: 0.5, b: 0.5, name: "dark fuchsia" }, + { h: 90, s: 0.5, b: 1, name: "hot pink" }, + { h: 90, s: 1, b: 0.5, name: "dark fuchsia" }, + { h: 90, s: 1, b: 1, name: "fuchsia" }, + { h: 95, s: 0, b: 1, name: "pink" }, + { h: 95, s: 0.5, b: 1, name: "light pink" }, + { h: 95, s: 1, b: 0.5, name: "dark magenta" }, + { h: 95, s: 1, b: 1, name: "magenta" }, + ]; + o.default.prototype._rgbColorName = function (e) { + var t, + r, + e = u.default._rgbaToHSBA(e), + o = [(l = e)[0], e[1], e[2]]; + 0 !== o[0] && + ((o[0] = Math.round(100 * o[0])), + ((e = o[0].toString().split(""))[(r = e.length - 1)] = parseInt( + e[r], + )), + e[r] < 2.5 ? (e[r] = 0) : 2.5 <= e[r] && e[r] < 7.5 && (e[r] = 5), + 2 === e.length + ? ((e[0] = parseInt(e[0])), + 7.5 <= e[r] && ((e[r] = 0), (e[0] = e[0] + 1)), + (o[0] = 10 * e[0] + e[1])) + : 7.5 <= e[r] + ? (o[0] = 10) + : (o[0] = e[r])), + (o[2] = o[2] / 255); + for (var n = o.length - 1; 1 <= n; n--) + o[n] <= 0.25 + ? (o[n] = 0) + : 0.25 < o[n] && o[n] < 0.75 + ? (o[n] = 0.5) + : (o[n] = 1); + if (0 === o[0] && 0 === o[1] && 1 === o[2]) { + for (var s = 2; 0 <= s; s--) l[s] = Math.round(1e4 * l[s]) / 1e4; + for (var i = 0; i < c.length; i++) { + if (c[i].h === l[0] && c[i].s === l[1] && c[i].b === l[2]) { + t = c[i].name; + break; + } + t = "white"; + } + } else + for (var a = 0; a < d.length; a++) + if (d[a].h === o[0] && d[a].s === o[1] && d[a].b === o[2]) { + t = d[a].name; + break; + } + return t; + }; + e = o.default; + r.default = e; + }, + { + "../color/color_conversion": 260, + "../core/main": 275, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.split": 198, + }, + ], + 255: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.ends-with"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.ends-with"), + e("core-js/modules/es.string.replace"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + var i = "_Description", + a = "_fallbackDesc", + l = "_fallbackTable", + u = "_Label", + c = "_labelDesc", + d = "_labelTable"; + function h(e) { + if ("label" === e || "fallback" === e) + throw new Error("description should not be LABEL or FALLBACK"); + return ( + e.endsWith(".") || + e.endsWith(";") || + e.endsWith(",") || + e.endsWith("?") || + e.endsWith("!") || + (e += "."), + e + ); + } + (s.default.prototype.describe = function (e, t) { + var r; + s.default._validateParameters("describe", arguments), + "string" == typeof e && + ((r = this.canvas.id), + (e = h(e)), + this.dummyDOM || + (this.dummyDOM = document.getElementById(r).parentNode), + this.descriptions || (this.descriptions = {}), + this.descriptions.fallback + ? this.descriptions.fallback.innerHTML !== e && + (this.descriptions.fallback.innerHTML = e) + : this._describeHTML("fallback", e), + t === this.LABEL && + (this.descriptions.label + ? this.descriptions.label.innerHTML !== e && + (this.descriptions.label.innerHTML = e) + : this._describeHTML("label", e))); + }), + (s.default.prototype.describeElement = function (e, t, r) { + var o, n; + s.default._validateParameters("describeElement", arguments), + "string" == typeof t && + "string" == typeof e && + ((o = this.canvas.id), + (t = h(t)), + (n = (function (e) { + if ("label" === e || "fallback" === e) + throw new Error( + "element name should not be LABEL or FALLBACK", + ); + e.endsWith(".") || e.endsWith(";") || e.endsWith(",") + ? (e = e.replace(/.$/, ":")) + : e.endsWith(":") || (e += ":"); + return e; + })(e)), + (e = e.replace(/[^a-zA-Z0-9]/g, "")), + (n = '' + .concat(n, "") + .concat(t, "")), + this.dummyDOM || + (this.dummyDOM = document.getElementById(o).parentNode), + this.descriptions + ? this.descriptions.fallbackElements || + (this.descriptions.fallbackElements = {}) + : (this.descriptions = { fallbackElements: {} }), + this.descriptions.fallbackElements[e] + ? this.descriptions.fallbackElements[e].innerHTML !== n && + (this.descriptions.fallbackElements[e].innerHTML = n) + : this._describeElementHTML("fallback", e, n), + r === this.LABEL && + (this.descriptions.labelElements || + (this.descriptions.labelElements = {}), + this.descriptions.labelElements[e] + ? this.descriptions.labelElements[e].innerHTML !== n && + (this.descriptions.labelElements[e].innerHTML = n) + : this._describeElementHTML("label", e, n))); + }), + (s.default.prototype._describeHTML = function (e, t) { + var r, + o = this.canvas.id; + "fallback" === e + ? (this.dummyDOM.querySelector("#".concat(o + i)) + ? this.dummyDOM + .querySelector("#" + o + l) + .insertAdjacentHTML( + "beforebegin", + '

                      '), + ) + : ((r = '

                      ')), + this.dummyDOM.querySelector( + "#".concat(o, "accessibleOutput"), + ) + ? this.dummyDOM + .querySelector("#".concat(o, "accessibleOutput")) + .insertAdjacentHTML("beforebegin", r) + : (this.dummyDOM.querySelector( + "#".concat(o), + ).innerHTML = r)), + (this.descriptions.fallback = this.dummyDOM.querySelector( + "#".concat(o).concat(a), + )), + (this.descriptions.fallback.innerHTML = t)) + : "label" === e && + (this.dummyDOM.querySelector("#".concat(o + u)) + ? this.dummyDOM.querySelector("#".concat(o + d)) && + this.dummyDOM + .querySelector("#".concat(o + d)) + .insertAdjacentHTML( + "beforebegin", + '

                      '), + ) + : ((r = '

                      ')), + this.dummyDOM.querySelector( + "#".concat(o, "accessibleOutputLabel"), + ) + ? this.dummyDOM + .querySelector( + "#".concat(o, "accessibleOutputLabel"), + ) + .insertAdjacentHTML("beforebegin", r) + : this.dummyDOM + .querySelector("#" + o) + .insertAdjacentHTML("afterend", r)), + (this.descriptions.label = this.dummyDOM.querySelector( + "#" + o + c, + )), + (this.descriptions.label.innerHTML = t)); + }), + (s.default.prototype._describeElementHTML = function (e, t, r) { + var o, + n = this.canvas.id; + "fallback" === e + ? (this.dummyDOM.querySelector("#".concat(n + i)) + ? this.dummyDOM.querySelector("#" + n + l) || + this.dummyDOM + .querySelector("#" + n + a) + .insertAdjacentHTML( + "afterend", + '
                      Canvas elements and their descriptions
                      ', + ), + ) + : ((o = '
                      Canvas elements and their descriptions
                      ', + )), + this.dummyDOM.querySelector( + "#".concat(n, "accessibleOutput"), + ) + ? this.dummyDOM + .querySelector("#".concat(n, "accessibleOutput")) + .insertAdjacentHTML("beforebegin", o) + : (this.dummyDOM.querySelector("#" + n).innerHTML = o)), + ((o = document.createElement("tr")).id = n + "_fte_" + t), + this.dummyDOM.querySelector("#" + n + l).appendChild(o), + (this.descriptions.fallbackElements[t] = + this.dummyDOM.querySelector( + "#".concat(n).concat("_fte_").concat(t), + )), + (this.descriptions.fallbackElements[t].innerHTML = r)) + : "label" === e && + (this.dummyDOM.querySelector("#".concat(n + u)) + ? this.dummyDOM.querySelector("#".concat(n + d)) || + this.dummyDOM + .querySelector("#" + n + c) + .insertAdjacentHTML( + "afterend", + '
                      '), + ) + : ((o = '
                      ')), + this.dummyDOM.querySelector( + "#".concat(n, "accessibleOutputLabel"), + ) + ? this.dummyDOM + .querySelector( + "#".concat(n, "accessibleOutputLabel"), + ) + .insertAdjacentHTML("beforebegin", o) + : this.dummyDOM + .querySelector("#" + n) + .insertAdjacentHTML("afterend", o)), + ((e = document.createElement("tr")).id = n + "_lte_" + t), + this.dummyDOM.querySelector("#" + n + d).appendChild(e), + (this.descriptions.labelElements[t] = + this.dummyDOM.querySelector( + "#".concat(n).concat("_lte_").concat(t), + )), + (this.descriptions.labelElements[t].innerHTML = r)); + }); + e = s.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.ends-with": 190, + "core-js/modules/es.string.replace": 196, + }, + ], + 256: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.string.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + e.default.prototype._updateGridOutput = function (e) { + var t, r, o, n; + this.dummyDOM.querySelector("#".concat(e, "_summary")) && + ((t = this._accessibleOutputs[e]), + (o = (function (e, t, r, o) { + t = "" + .concat(t, " canvas, ") + .concat(r, " by ") + .concat(o, " pixels, contains ") + .concat(e[0]); + t = ( + 1 === e[0] + ? "".concat(t, " shape: ") + : "".concat(t, " shapes: ") + ).concat(e[1]); + return t; + })( + (r = (function (e, t) { + var r, + o = "", + n = "", + s = 0; + for (r in t) { + var i, + a = 0; + for (i in t[r]) { + var l = '
                    • ') + .concat(t[r][i].color, " ") + .concat(r, ","); + "line" === r + ? (l += " location = " + .concat(t[r][i].pos, ", length = ") + .concat(t[r][i].length, " pixels")) + : ((l += " location = ".concat(t[r][i].pos)), + "point" !== r && + (l += ", area = ".concat(t[r][i].area, " %")), + (l += "
                    • ")), + (o += l), + a++, + s++; + } + n = + 1 < a + ? "".concat(n, " ").concat(a, " ").concat(r, "s") + : "".concat(n, " ").concat(a, " ").concat(r); + } + return { numShapes: [s, n], details: o }; + })(e, this.ingredients.shapes)).numShapes, + this.ingredients.colors.background, + this.width, + this.height, + )), + (n = (function (e, t) { + var r, + o, + n = 0, + s = "", + i = Array.from(Array(10), function () { + return Array(10); + }); + for (r in t) + for (var a in t[r]) { + var l = void 0; + (l = + "line" !== r + ? '
                      ') + .concat(t[r][a].color, " ") + .concat(r, "") + : '') + .concat(t[r][a].color, " ") + .concat(r, " midpoint")), + i[t[r][a].loc.locY][t[r][a].loc.locX] + ? (i[t[r][a].loc.locY][t[r][a].loc.locX] = + i[t[r][a].loc.locY][t[r][a].loc.locX] + " " + l) + : (i[t[r][a].loc.locY][t[r][a].loc.locX] = l), + n++; + } + for (o in i) { + var u, + c = ""; + for (u in i[o]) + (c += ""), + void 0 !== i[o][u] && (c += i[o][u]), + (c += ""); + s = s + c + ""; + } + return s; + })(e, this.ingredients.shapes)), + o !== t.summary.innerHTML && (t.summary.innerHTML = o), + n !== t.map.innerHTML && (t.map.innerHTML = n), + r.details !== t.shapeDetails.innerHTML && + (t.shapeDetails.innerHTML = r.details), + (this._accessibleOutputs[e] = t)); + }; + e = e.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.string.iterator": 192, + }, + ], + 257: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.number.to-fixed"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function l(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + function u(e, t, r) { + (t = Math.floor((e[0] / t) * 10)), + (e = Math.floor((e[1] / r) * 10)); + return ( + 10 === t && (t -= 1), 10 === e && (e -= 1), { locX: t, locY: e } + ); + } + (o.default.prototype.textOutput = function (e) { + o.default._validateParameters("textOutput", arguments), + this._accessibleOutputs.text || + ((this._accessibleOutputs.text = !0), + this._createOutput("textOutput", "Fallback"), + e === this.LABEL && + ((this._accessibleOutputs.textLabel = !0), + this._createOutput("textOutput", "Label"))); + }), + (o.default.prototype.gridOutput = function (e) { + o.default._validateParameters("gridOutput", arguments), + this._accessibleOutputs.grid || + ((this._accessibleOutputs.grid = !0), + this._createOutput("gridOutput", "Fallback"), + e === this.LABEL && + ((this._accessibleOutputs.gridLabel = !0), + this._createOutput("gridOutput", "Label"))); + }), + (o.default.prototype._addAccsOutput = function () { + return ( + this._accessibleOutputs || + (this._accessibleOutputs = { + text: !1, + grid: !1, + textLabel: !1, + gridLabel: !1, + }), + this._accessibleOutputs.grid || this._accessibleOutputs.text + ); + }), + (o.default.prototype._createOutput = function (e, t) { + var r, + o, + n, + s = this.canvas.id, + i = + (this.ingredients || + (this.ingredients = { + shapes: {}, + colors: { + background: "white", + fill: "white", + stroke: "black", + }, + pShapes: "", + }), + this.dummyDOM || + (this.dummyDOM = document.getElementById(s).parentNode), + ""); + "Fallback" === t + ? ((r = s + e), + this.dummyDOM.querySelector( + "#".concat((o = s + "accessibleOutput")), + ) || + (this.dummyDOM.querySelector("#".concat(s, "_Description")) + ? this.dummyDOM + .querySelector("#".concat(s, "_Description")) + .insertAdjacentHTML( + "afterend", + '
                      ', + ), + ) + : (this.dummyDOM.querySelector("#".concat(s)).innerHTML = + '
                      ', + )))) + : "Label" === t && + ((r = s + e + (i = t)), + this.dummyDOM.querySelector( + "#".concat((o = s + "accessibleOutput" + t)), + ) || + (this.dummyDOM.querySelector("#".concat(s, "_Label")) + ? this.dummyDOM.querySelector("#".concat(s, "_Label")) + : this.dummyDOM.querySelector("#".concat(s)) + ).insertAdjacentHTML( + "afterend", + '
                      '), + )), + (this._accessibleOutputs[r] = {}), + "textOutput" === e + ? ((i = "#".concat(s, "gridOutput").concat(i)), + (n = '
                      Text Output

                        ', + )), + this.dummyDOM.querySelector(i) + ? this.dummyDOM + .querySelector(i) + .insertAdjacentHTML("beforebegin", n) + : (this.dummyDOM.querySelector("#".concat(o)).innerHTML = + n), + (this._accessibleOutputs[r].list = + this.dummyDOM.querySelector("#".concat(r, "_list")))) + : "gridOutput" === e && + ((i = "#".concat(s, "textOutput").concat(i)), + (n = '
                        Grid Output

                          ', + )), + this.dummyDOM.querySelector(i) + ? this.dummyDOM + .querySelector(i) + .insertAdjacentHTML("afterend", n) + : (this.dummyDOM.querySelector("#".concat(o)).innerHTML = + n), + (this._accessibleOutputs[r].map = + this.dummyDOM.querySelector("#".concat(r, "_map")))), + (this._accessibleOutputs[r].shapeDetails = + this.dummyDOM.querySelector("#".concat(r, "_shapeDetails"))), + (this._accessibleOutputs[r].summary = + this.dummyDOM.querySelector("#".concat(r, "_summary"))); + }), + (o.default.prototype._updateAccsOutput = function () { + var e = this.canvas.id; + JSON.stringify(this.ingredients.shapes) !== + this.ingredients.pShapes && + ((this.ingredients.pShapes = JSON.stringify( + this.ingredients.shapes, + )), + this._accessibleOutputs.text && + this._updateTextOutput(e + "textOutput"), + this._accessibleOutputs.grid && + this._updateGridOutput(e + "gridOutput"), + this._accessibleOutputs.textLabel && + this._updateTextOutput(e + "textOutputLabel"), + this._accessibleOutputs.gridLabel && + this._updateGridOutput(e + "gridOutputLabel")); + }), + (o.default.prototype._accsBackground = function (e) { + (this.ingredients.pShapes = JSON.stringify( + this.ingredients.shapes, + )), + (this.ingredients.shapes = {}), + this.ingredients.colors.backgroundRGBA !== e && + ((this.ingredients.colors.backgroundRGBA = e), + (this.ingredients.colors.background = this._rgbColorName(e))); + }), + (o.default.prototype._accsCanvasColors = function (e, t) { + "fill" === e + ? this.ingredients.colors.fillRGBA !== t && + ((this.ingredients.colors.fillRGBA = t), + (this.ingredients.colors.fill = this._rgbColorName(t))) + : "stroke" === e && + this.ingredients.colors.strokeRGBA !== t && + ((this.ingredients.colors.strokeRGBA = t), + (this.ingredients.colors.stroke = this._rgbColorName(t))); + }), + (o.default.prototype._accsOutput = function (e, t) { + "ellipse" === e && t[2] === t[3] + ? (e = "circle") + : "rectangle" === e && t[2] === t[3] && (e = "square"); + var r, + o, + n = {}, + s = !0, + i = (function (e, t) { + var r; + e = + "rectangle" === e || + "ellipse" === e || + "arc" === e || + "circle" === e || + "square" === e + ? ((r = Math.round(t[0] + t[2] / 2)), + Math.round(t[1] + t[3] / 2)) + : "triangle" === e + ? ((r = (t[0] + t[2] + t[4]) / 3), + (t[1] + t[3] + t[5]) / 3) + : "quadrilateral" === e + ? ((r = (t[0] + t[2] + t[4] + t[6]) / 4), + (t[1] + t[3] + t[5] + t[7]) / 4) + : "line" === e + ? ((r = (t[0] + t[2]) / 2), (t[1] + t[3]) / 2) + : ((r = t[0]), t[1]); + return [r, e]; + })(e, t); + if ( + ("line" === e + ? ((n.color = this.ingredients.colors.stroke), + (n.length = Math.round(this.dist(t[0], t[1], t[2], t[3]))), + (r = this._getPos(t[0], [1])), + (o = this._getPos(t[2], [3])), + (n.loc = u(i, this.width, this.height)), + (n.pos = + r === o + ? "at ".concat(r) + : "from ".concat(r, " to ").concat(o))) + : ("point" === e + ? (n.color = this.ingredients.colors.stroke) + : ((n.color = this.ingredients.colors.fill), + (n.area = this._getArea(e, t))), + (n.pos = this._getPos.apply(this, l(i))), + (n.loc = u(i, this.width, this.height))), + this.ingredients.shapes[e]) + ) { + if (this.ingredients.shapes[e] !== [n]) { + for (var a in this.ingredients.shapes[e]) + JSON.stringify(this.ingredients.shapes[e][a]) === + JSON.stringify(n) && (s = !1); + !0 === s && this.ingredients.shapes[e].push(n); + } + } else this.ingredients.shapes[e] = [n]; + }), + (o.default.prototype._getPos = function (e, t) { + var e = new DOMPointReadOnly(e, t), + t = this._renderer.isP3D + ? new DOMMatrix(this._renderer.uMVMatrix.mat4) + : this.drawingContext.getTransform(), + e = e.matrixTransform(t), + t = e.x, + e = e.y, + r = this.width, + o = this.height; + return t < 0.4 * r + ? e < 0.4 * o + ? "top left" + : 0.6 * o < e + ? "bottom left" + : "mid left" + : 0.6 * r < t + ? e < 0.4 * o + ? "top right" + : 0.6 * o < e + ? "bottom right" + : "mid right" + : e < 0.4 * o + ? "top middle" + : 0.6 * o < e + ? "bottom middle" + : "middle"; + }), + (o.default.prototype._getArea = function (e, t) { + var r, + o, + n = 0, + s = + ("arc" === e + ? ((n = + ((r = + (((t[5] - t[4]) % (2 * Math.PI)) + 2 * Math.PI) % + (2 * Math.PI)) * + t[2] * + t[3]) / + 8), + ("open" !== t[6] && "chord" !== t[6]) || + ((o = t[0]), + (u = t[1]), + (s = t[0] + (t[2] / 2) * Math.cos(t[4]).toFixed(2)), + (c = t[1] + (t[3] / 2) * Math.sin(t[4]).toFixed(2)), + (a = t[0] + (t[2] / 2) * Math.cos(t[5]).toFixed(2)), + (i = t[1] + (t[3] / 2) * Math.sin(t[5]).toFixed(2)), + (o = + Math.abs(o * (c - i) + s * (i - u) + a * (u - c)) / + 2), + r > Math.PI ? (n += o) : (n -= o))) + : "ellipse" === e || "circle" === e + ? (n = (((3.14 * t[2]) / 2) * t[3]) / 2) + : "line" === e || "point" === e + ? (n = 0) + : "quadrilateral" === e + ? (n = + Math.abs( + (t[6] + t[0]) * (t[7] - t[1]) + + (t[0] + t[2]) * (t[1] - t[3]) + + (t[2] + t[4]) * (t[3] - t[5]) + + (t[4] + t[6]) * (t[5] - t[7]), + ) / 2) + : "rectangle" === e || "square" === e + ? (n = t[2] * t[3]) + : "triangle" === e && + (n = + Math.abs( + t[0] * (t[3] - t[5]) + + t[2] * (t[5] - t[1]) + + t[4] * (t[1] - t[3]), + ) / 2), + this.width * this._pixelDensity), + i = this.height * this._pixelDensity, + a = [ + new DOMPoint(0, 0), + new DOMPoint(s, 0), + new DOMPoint(s, i), + new DOMPoint(0, i), + ], + l = ( + this._renderer.isP3D + ? new DOMMatrix(this._renderer.uMVMatrix.mat4) + : this.drawingContext.getTransform() + ).inverse(), + u = a.map(function (e) { + return e.matrixTransform(l); + }), + c = + Math.abs( + (u[3].x + u[0].x) * (u[3].y - u[0].y) + + (u[0].x + u[1].x) * (u[0].y - u[1].y) + + (u[1].x + u[2].x) * (u[1].y - u[2].y) + + (u[2].x + u[3].x) * (u[2].y - u[3].y), + ) / 2; + return Math.round((100 * n) / c); + }); + e = o.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.number.to-fixed": 175, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 258: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.concat"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + e.default.prototype._updateTextOutput = function (e) { + var t, r, o, n; + this.dummyDOM.querySelector("#".concat(e, "_summary")) && + ((t = this._accessibleOutputs[e]), + (o = (function (e, t, r, o) { + r = "Your output is a, " + .concat(r, " by ") + .concat(o, " pixels, ") + .concat(t, " canvas containing the following"); + r = + 1 === e + ? "".concat(r, " shape:") + : "".concat(r, " ").concat(e, " shapes:"); + return r; + })( + (r = (function (e, t) { + var r, + o = "", + n = 0; + for (r in t) + for (var s in t[r]) { + var i = '
                        • ') + .concat(t[r][s].color, " ") + .concat(r, ""); + "line" === r + ? (i += ", " + .concat(t[r][s].pos, ", ") + .concat(t[r][s].length, " pixels long.
                        • ")) + : ((i += ", at ".concat(t[r][s].pos)), + "point" !== r && + (i += ", covering ".concat( + t[r][s].area, + "% of the canvas", + )), + (i += ".")), + (o += i), + n++; + } + return { numShapes: n, listShapes: o }; + })(e, this.ingredients.shapes)).numShapes, + this.ingredients.colors.background, + this.width, + this.height, + )), + (n = (function (e, t) { + var r, + o = "", + n = 0; + for (r in t) + for (var s in t[r]) { + var i = '') + .concat(t[r][s].color, " ") + .concat(r, ""); + "line" === r + ? (i += "location = " + .concat(t[r][s].pos, "length = ") + .concat(t[r][s].length, " pixels")) + : ((i += "location = ".concat(t[r][s].pos, "")), + "point" !== r && + (i += " area = ".concat(t[r][s].area, "%")), + (i += "")), + (o += i), + n++; + } + return o; + })(e, this.ingredients.shapes)), + o !== t.summary.innerHTML && (t.summary.innerHTML = o), + r.listShapes !== t.list.innerHTML && + (t.list.innerHTML = r.listShapes), + n !== t.shapeDetails.innerHTML && (t.shapeDetails.innerHTML = n), + (this._accessibleOutputs[e] = t)); + }; + e = e.default; + r.default = e; + }, + { "../core/main": 275, "core-js/modules/es.array.concat": 151 }, + ], + 259: [ + function (e, t, r) { + "use strict"; + var o = (o = e("./core/main")) && o.__esModule ? o : { default: o }; + e("./core/constants"), + e("./core/environment"), + e("./core/friendly_errors/stacktrace"), + e("./core/friendly_errors/validate_params"), + e("./core/friendly_errors/file_errors"), + e("./core/friendly_errors/fes_core"), + e("./core/friendly_errors/sketch_reader"), + e("./core/helpers"), + e("./core/legacy"), + e("./core/preload"), + e("./core/p5.Element"), + e("./core/p5.Graphics"), + e("./core/p5.Renderer"), + e("./core/p5.Renderer2D"), + e("./core/rendering"), + e("./core/shim"), + e("./core/structure"), + e("./core/transform"), + e("./core/shape/2d_primitives"), + e("./core/shape/attributes"), + e("./core/shape/curves"), + e("./core/shape/vertex"), + e("./accessibility/outputs"), + e("./accessibility/textOutput"), + e("./accessibility/gridOutput"), + e("./accessibility/color_namer"), + e("./color/color_conversion"), + e("./color/creating_reading"), + e("./color/p5.Color"), + e("./color/setting"), + e("./data/p5.TypedDict"), + e("./data/local_storage.js"), + e("./dom/dom"), + e("./accessibility/describe"), + e("./events/acceleration"), + e("./events/keyboard"), + e("./events/mouse"), + e("./events/touch"), + e("./image/filters"), + e("./image/image"), + e("./image/loading_displaying"), + e("./image/p5.Image"), + e("./image/pixels"), + e("./io/files"), + e("./io/p5.Table"), + e("./io/p5.TableRow"), + e("./io/p5.XML"), + e("./math/calculation"), + e("./math/math"), + e("./math/noise"), + e("./math/p5.Vector"), + e("./math/random"), + e("./math/trigonometry"), + e("./typography/attributes"), + e("./typography/loading_displaying"), + e("./typography/p5.Font"), + e("./utilities/array_functions"), + e("./utilities/conversion"), + e("./utilities/string_functions"), + e("./utilities/time_date"), + e("./webgl/3d_primitives"), + e("./webgl/interaction"), + e("./webgl/light"), + e("./webgl/loading"), + e("./webgl/material"), + e("./webgl/p5.Camera"), + e("./webgl/p5.DataArray"), + e("./webgl/p5.Geometry"), + e("./webgl/p5.Matrix"), + e("./webgl/p5.RendererGL.Immediate"), + e("./webgl/p5.RendererGL"), + e("./webgl/p5.RendererGL.Retained"), + e("./webgl/p5.Framebuffer"), + e("./webgl/p5.Shader"), + e("./webgl/p5.RenderBuffer"), + e("./webgl/p5.Texture"), + e("./webgl/text"), + e("./core/init"), + (t.exports = o.default); + }, + { + "./accessibility/color_namer": 254, + "./accessibility/describe": 255, + "./accessibility/gridOutput": 256, + "./accessibility/outputs": 257, + "./accessibility/textOutput": 258, + "./color/color_conversion": 260, + "./color/creating_reading": 261, + "./color/p5.Color": 262, + "./color/setting": 263, + "./core/constants": 264, + "./core/environment": 265, + "./core/friendly_errors/fes_core": 266, + "./core/friendly_errors/file_errors": 267, + "./core/friendly_errors/sketch_reader": 268, + "./core/friendly_errors/stacktrace": 269, + "./core/friendly_errors/validate_params": 270, + "./core/helpers": 271, + "./core/init": 272, + "./core/legacy": 274, + "./core/main": 275, + "./core/p5.Element": 276, + "./core/p5.Graphics": 277, + "./core/p5.Renderer": 278, + "./core/p5.Renderer2D": 279, + "./core/preload": 280, + "./core/rendering": 281, + "./core/shape/2d_primitives": 282, + "./core/shape/attributes": 283, + "./core/shape/curves": 284, + "./core/shape/vertex": 285, + "./core/shim": 286, + "./core/structure": 287, + "./core/transform": 288, + "./data/local_storage.js": 289, + "./data/p5.TypedDict": 290, + "./dom/dom": 291, + "./events/acceleration": 292, + "./events/keyboard": 293, + "./events/mouse": 294, + "./events/touch": 295, + "./image/filters": 296, + "./image/image": 297, + "./image/loading_displaying": 298, + "./image/p5.Image": 299, + "./image/pixels": 300, + "./io/files": 301, + "./io/p5.Table": 302, + "./io/p5.TableRow": 303, + "./io/p5.XML": 304, + "./math/calculation": 305, + "./math/math": 306, + "./math/noise": 307, + "./math/p5.Vector": 308, + "./math/random": 309, + "./math/trigonometry": 310, + "./typography/attributes": 311, + "./typography/loading_displaying": 312, + "./typography/p5.Font": 313, + "./utilities/array_functions": 314, + "./utilities/conversion": 315, + "./utilities/string_functions": 316, + "./utilities/time_date": 317, + "./webgl/3d_primitives": 318, + "./webgl/interaction": 320, + "./webgl/light": 321, + "./webgl/loading": 322, + "./webgl/material": 323, + "./webgl/p5.Camera": 324, + "./webgl/p5.DataArray": 325, + "./webgl/p5.Framebuffer": 326, + "./webgl/p5.Geometry": 327, + "./webgl/p5.Matrix": 328, + "./webgl/p5.RenderBuffer": 329, + "./webgl/p5.RendererGL": 332, + "./webgl/p5.RendererGL.Immediate": 330, + "./webgl/p5.RendererGL.Retained": 331, + "./webgl/p5.Shader": 333, + "./webgl/p5.Texture": 334, + "./webgl/text": 335, + }, + ], + 260: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + e.default.ColorConversion = { + _hsbaToHSLA: function (e) { + var t = e[0], + r = e[1], + o = e[2], + n = ((2 - r) * o) / 2; + return ( + 0 != n && + (1 == n + ? (r = 0) + : n < 0.5 + ? (r /= 2 - r) + : (r = (r * o) / (2 - 2 * n))), + [t, r, n, e[3]] + ); + }, + _hsbaToRGBA: function (e) { + var t, + r, + o, + n, + s, + i = 6 * e[0], + a = e[1], + l = e[2]; + return 0 === a + ? [l, l, l, e[3]] + : ((r = l * (1 - a)), + (o = l * (1 - a * (i - (t = Math.floor(i))))), + (a = l * (1 - a * (1 + t - i))), + (i = + 1 === t + ? ((n = o), (s = l), r) + : 2 === t + ? ((n = r), (s = l), a) + : 3 === t + ? ((n = r), (s = o), l) + : 4 === t + ? ((n = a), (s = r), l) + : 5 === t + ? ((n = l), (s = r), o) + : ((n = l), (s = a), r)), + [n, s, i, e[3]]); + }, + _hslaToHSBA: function (e) { + var t = e[0], + r = e[1], + o = e[2], + n = o < 0.5 ? (1 + r) * o : o + r - o * r; + return [t, (r = (2 * (n - o)) / n), n, e[3]]; + }, + _hslaToRGBA: function (e) { + var t, + r = 6 * e[0], + o = e[1], + n = e[2]; + return 0 === o + ? [n, n, n, e[3]] + : [ + (t = function (e, t, r) { + return ( + e < 0 ? (e += 6) : 6 <= e && (e -= 6), + e < 1 + ? t + (r - t) * e + : e < 3 + ? r + : e < 4 + ? t + (r - t) * (4 - e) + : t + ); + })( + 2 + r, + (o = 2 * n - (n = n < 0.5 ? (1 + o) * n : n + o - n * o)), + n, + ), + t(r, o, n), + t(r - 2, o, n), + e[3], + ]; + }, + _rgbaToHSBA: function (e) { + var t, + r, + o = e[0], + n = e[1], + s = e[2], + i = Math.max(o, n, s), + a = i - Math.min(o, n, s); + return ( + 0 == a + ? (r = t = 0) + : ((r = a / i), + o === i + ? (t = (n - s) / a) + : n === i + ? (t = 2 + (s - o) / a) + : s === i && (t = 4 + (o - n) / a), + t < 0 ? (t += 6) : 6 <= t && (t -= 6)), + [t / 6, r, i, e[3]] + ); + }, + _rgbaToHSLA: function (e) { + var t, + r, + o = e[0], + n = e[1], + s = e[2], + i = Math.max(o, n, s), + a = Math.min(o, n, s), + l = i + a, + a = i - a; + return ( + 0 == a + ? (r = t = 0) + : ((r = l < 1 ? a / l : a / (2 - l)), + o === i + ? (t = (n - s) / a) + : n === i + ? (t = 2 + (s - o) / a) + : s === i && (t = 4 + (o - n) / a), + t < 0 ? (t += 6) : 6 <= t && (t -= 6)), + [t / 6, r, l / 2, e[3]] + ); + }, + }; + e = e.default.ColorConversion; + r.default = e; + }, + { "../core/main": 275 }, + ], + 261: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.map"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + u = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + e("./p5.Color"), + e("../core/friendly_errors/validate_params"), + e("../core/friendly_errors/file_errors"), + e("../core/friendly_errors/fes_core"), + (l.default.prototype.alpha = function (e) { + return ( + l.default._validateParameters("alpha", arguments), + this.color(e)._getAlpha() + ); + }), + (l.default.prototype.blue = function (e) { + return ( + l.default._validateParameters("blue", arguments), + this.color(e)._getBlue() + ); + }), + (l.default.prototype.brightness = function (e) { + return ( + l.default._validateParameters("brightness", arguments), + this.color(e)._getBrightness() + ); + }), + (l.default.prototype.color = function () { + var e; + return ( + l.default._validateParameters("color", arguments), + arguments[0] instanceof l.default.Color + ? arguments[0] + : ((e = + arguments[0] instanceof Array ? arguments[0] : arguments), + new l.default.Color(this, e)) + ); + }), + (l.default.prototype.green = function (e) { + return ( + l.default._validateParameters("green", arguments), + this.color(e)._getGreen() + ); + }), + (l.default.prototype.hue = function (e) { + return ( + l.default._validateParameters("hue", arguments), + this.color(e)._getHue() + ); + }), + (l.default.prototype.lerpColor = function (e, t, r) { + l.default._validateParameters("lerpColor", arguments); + var o, + n, + s, + i = this._colorMode, + a = this._colorMaxes; + if (i === u.RGB) + (n = e.levels.map(function (e) { + return e / 255; + })), + (s = t.levels.map(function (e) { + return e / 255; + })); + else if (i === u.HSB) + e._getBrightness(), + t._getBrightness(), + (n = e.hsba), + (s = t.hsba); + else { + if (i !== u.HSL) + throw new Error( + "".concat(i, "cannot be used for interpolation."), + ); + e._getLightness(), + t._getLightness(), + (n = e.hsla), + (s = t.hsla); + } + return ( + (r = Math.max(Math.min(r, 1), 0)), + void 0 === this.lerp && + (this.lerp = function (e, t, r) { + return r * (t - e) + e; + }), + (e = this.lerp(n[0], s[0], r)), + (t = this.lerp(n[1], s[1], r)), + (o = this.lerp(n[2], s[2], r)), + (n = this.lerp(n[3], s[3], r)), + (e *= a[i][0]), + (t *= a[i][1]), + (o *= a[i][2]), + (n *= a[i][3]), + this.color(e, t, o, n) + ); + }), + (l.default.prototype.lightness = function (e) { + return ( + l.default._validateParameters("lightness", arguments), + this.color(e)._getLightness() + ); + }), + (l.default.prototype.red = function (e) { + return ( + l.default._validateParameters("red", arguments), + this.color(e)._getRed() + ); + }), + (l.default.prototype.saturation = function (e) { + return ( + l.default._validateParameters("saturation", arguments), + this.color(e)._getSaturation() + ); + }); + var n = l.default; + r.default = n; + }, + { + "../core/constants": 264, + "../core/friendly_errors/fes_core": 266, + "../core/friendly_errors/file_errors": 267, + "../core/friendly_errors/validate_params": 270, + "../core/main": 275, + "./p5.Color": 262, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 262: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.trim"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.trim"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = s(e("../core/main")), + d = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")), + h = s(e("./color_conversion")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function s(e) { + return e && e.__esModule ? e : { default: e }; + } + function l(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + var f = { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyan: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + rebeccapurple: "#663399", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + steelblue: "#4682b4", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + tomato: "#ff6347", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32", + }, + e = /\s*/, + u = /(\d{1,3})/, + c = /((?:\d+(?:\.\d+)?)|(?:\.\d+))/, + p = new RegExp("".concat(c.source, "%")), + m = { + HEX3: /^#([a-f0-9])([a-f0-9])([a-f0-9])$/i, + HEX4: /^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i, + HEX6: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, + HEX8: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, + RGB: new RegExp( + [ + "^rgb\\(", + u.source, + ",", + u.source, + ",", + u.source, + "\\)$", + ].join(e.source), + "i", + ), + RGB_PERCENT: new RegExp( + [ + "^rgb\\(", + p.source, + ",", + p.source, + ",", + p.source, + "\\)$", + ].join(e.source), + "i", + ), + RGBA: new RegExp( + [ + "^rgba\\(", + u.source, + ",", + u.source, + ",", + u.source, + ",", + c.source, + "\\)$", + ].join(e.source), + "i", + ), + RGBA_PERCENT: new RegExp( + [ + "^rgba\\(", + p.source, + ",", + p.source, + ",", + p.source, + ",", + c.source, + "\\)$", + ].join(e.source), + "i", + ), + HSL: new RegExp( + [ + "^hsl\\(", + u.source, + ",", + p.source, + ",", + p.source, + "\\)$", + ].join(e.source), + "i", + ), + HSLA: new RegExp( + [ + "^hsla\\(", + u.source, + ",", + p.source, + ",", + p.source, + ",", + c.source, + "\\)$", + ].join(e.source), + "i", + ), + HSB: new RegExp( + [ + "^hsb\\(", + u.source, + ",", + p.source, + ",", + p.source, + "\\)$", + ].join(e.source), + "i", + ), + HSBA: new RegExp( + [ + "^hsba\\(", + u.source, + ",", + p.source, + ",", + p.source, + ",", + c.source, + "\\)$", + ].join(e.source), + "i", + ), + }, + u = + ((n.default.Color = (function () { + function c(e, t) { + if (!(this instanceof c)) + throw new TypeError("Cannot call a class as a function"); + if ( + (this._storeModeAndMaxes(e._colorMode, e._colorMaxes), + ![d.RGB, d.HSL, d.HSB].includes(this.mode)) + ) + throw new Error( + "".concat(this.mode, " is an invalid colorMode."), + ); + (this._array = c._parseInputs.apply(this, t)), + this._calculateLevels(); + } + var e, t, r; + return ( + (e = c), + (r = [ + { + key: "_parseInputs", + value: function (e, t, r, o) { + var n, + s = arguments.length, + i = this.mode, + a = this.maxes[i], + l = []; + if (3 <= s) { + for ( + l[0] = e / a[0], + l[1] = t / a[1], + l[2] = r / a[2], + l[3] = "number" == typeof o ? o / a[3] : 1, + n = l.length - 1; + 0 <= n; + --n + ) { + var u = l[n]; + u < 0 ? (l[n] = 0) : 1 < u && (l[n] = 1); + } + return i === d.HSL + ? h.default._hslaToRGBA(l) + : i === d.HSB + ? h.default._hsbaToRGBA(l) + : l; + } + if (1 === s && "string" == typeof e) { + r = e.trim().toLowerCase(); + if (f[r]) return c._parseInputs.call(this, f[r]); + if (m.HEX3.test(r)) + return ( + ((l = m.HEX3.exec(r) + .slice(1) + .map(function (e) { + return parseInt(e + e, 16) / 255; + }))[3] = 1), + l + ); + if (m.HEX6.test(r)) + return ( + ((l = m.HEX6.exec(r) + .slice(1) + .map(function (e) { + return parseInt(e, 16) / 255; + }))[3] = 1), + l + ); + if (m.HEX4.test(r)) + return (l = m.HEX4.exec(r) + .slice(1) + .map(function (e) { + return parseInt(e + e, 16) / 255; + })); + if (m.HEX8.test(r)) + return (l = m.HEX8.exec(r) + .slice(1) + .map(function (e) { + return parseInt(e, 16) / 255; + })); + if (m.RGB.test(r)) + return ( + ((l = m.RGB.exec(r) + .slice(1) + .map(function (e) { + return e / 255; + }))[3] = 1), + l + ); + if (m.RGB_PERCENT.test(r)) + return ( + ((l = m.RGB_PERCENT.exec(r) + .slice(1) + .map(function (e) { + return parseFloat(e) / 100; + }))[3] = 1), + l + ); + if (m.RGBA.test(r)) + return (l = m.RGBA.exec(r) + .slice(1) + .map(function (e, t) { + return 3 === t ? parseFloat(e) : e / 255; + })); + if (m.RGBA_PERCENT.test(r)) + return (l = m.RGBA_PERCENT.exec(r) + .slice(1) + .map(function (e, t) { + return 3 === t + ? parseFloat(e) + : parseFloat(e) / 100; + })); + if ( + (m.HSL.test(r) + ? ((l = m.HSL.exec(r) + .slice(1) + .map(function (e, t) { + return 0 === t + ? parseInt(e, 10) / 360 + : parseInt(e, 10) / 100; + }))[3] = 1) + : m.HSLA.test(r) && + (l = m.HSLA.exec(r) + .slice(1) + .map(function (e, t) { + return 0 === t + ? parseInt(e, 10) / 360 + : 3 === t + ? parseFloat(e) + : parseInt(e, 10) / 100; + })), + (l = l.map(function (e) { + return Math.max(Math.min(e, 1), 0); + })).length) + ) + return h.default._hslaToRGBA(l); + if ( + (m.HSB.test(r) + ? ((l = m.HSB.exec(r) + .slice(1) + .map(function (e, t) { + return 0 === t + ? parseInt(e, 10) / 360 + : parseInt(e, 10) / 100; + }))[3] = 1) + : m.HSBA.test(r) && + (l = m.HSBA.exec(r) + .slice(1) + .map(function (e, t) { + return 0 === t + ? parseInt(e, 10) / 360 + : 3 === t + ? parseFloat(e) + : parseInt(e, 10) / 100; + })), + l.length) + ) { + for (n = l.length - 1; 0 <= n; --n) + l[n] = Math.max(Math.min(l[n], 1), 0); + return h.default._hsbaToRGBA(l); + } + l = [1, 1, 1, 1]; + } else { + if ((1 !== s && 2 !== s) || "number" != typeof e) + throw new Error( + "".concat( + arguments, + "is not a valid color representation.", + ), + ); + (l[0] = e / a[2]), + (l[1] = e / a[2]), + (l[2] = e / a[2]), + (l[3] = "number" == typeof t ? t / a[3] : 1), + (l = l.map(function (e) { + return Math.max(Math.min(e, 1), 0); + })); + } + return l; + }, + }, + ]), + (t = [ + { + key: "toString", + value: function (e) { + var t = this.levels, + r = this._array, + o = r[3]; + switch (e) { + case "#rrggbb": + return "#".concat( + t[0] < 16 + ? "0".concat(t[0].toString(16)) + : t[0].toString(16), + t[1] < 16 + ? "0".concat(t[1].toString(16)) + : t[1].toString(16), + t[2] < 16 + ? "0".concat(t[2].toString(16)) + : t[2].toString(16), + ); + case "#rrggbbaa": + return "#".concat( + t[0] < 16 + ? "0".concat(t[0].toString(16)) + : t[0].toString(16), + t[1] < 16 + ? "0".concat(t[1].toString(16)) + : t[1].toString(16), + t[2] < 16 + ? "0".concat(t[2].toString(16)) + : t[2].toString(16), + t[3] < 16 + ? "0".concat(t[3].toString(16)) + : t[3].toString(16), + ); + case "#rgb": + return "#".concat( + Math.round(15 * r[0]).toString(16), + Math.round(15 * r[1]).toString(16), + Math.round(15 * r[2]).toString(16), + ); + case "#rgba": + return "#".concat( + Math.round(15 * r[0]).toString(16), + Math.round(15 * r[1]).toString(16), + Math.round(15 * r[2]).toString(16), + Math.round(15 * r[3]).toString(16), + ); + case "rgb": + return "rgb(".concat( + t[0], + ", ", + t[1], + ", ", + t[2], + ")", + ); + case "rgb%": + return "rgb(".concat( + (100 * r[0]).toPrecision(3), + "%, ", + (100 * r[1]).toPrecision(3), + "%, ", + (100 * r[2]).toPrecision(3), + "%)", + ); + case "rgba%": + return "rgba(".concat( + (100 * r[0]).toPrecision(3), + "%, ", + (100 * r[1]).toPrecision(3), + "%, ", + (100 * r[2]).toPrecision(3), + "%, ", + (100 * r[3]).toPrecision(3), + "%)", + ); + case "hsb": + case "hsv": + return ( + this.hsba || + (this.hsba = h.default._rgbaToHSBA( + this._array, + )), + "hsb(".concat( + this.hsba[0] * this.maxes[d.HSB][0], + ", ", + this.hsba[1] * this.maxes[d.HSB][1], + ", ", + this.hsba[2] * this.maxes[d.HSB][2], + ")", + ) + ); + case "hsb%": + case "hsv%": + return ( + this.hsba || + (this.hsba = h.default._rgbaToHSBA( + this._array, + )), + "hsb(".concat( + (100 * this.hsba[0]).toPrecision(3), + "%, ", + (100 * this.hsba[1]).toPrecision(3), + "%, ", + (100 * this.hsba[2]).toPrecision(3), + "%)", + ) + ); + case "hsba": + case "hsva": + return ( + this.hsba || + (this.hsba = h.default._rgbaToHSBA( + this._array, + )), + "hsba(".concat( + this.hsba[0] * this.maxes[d.HSB][0], + ", ", + this.hsba[1] * this.maxes[d.HSB][1], + ", ", + this.hsba[2] * this.maxes[d.HSB][2], + ", ", + o, + ")", + ) + ); + case "hsba%": + case "hsva%": + return ( + this.hsba || + (this.hsba = h.default._rgbaToHSBA( + this._array, + )), + "hsba(".concat( + (100 * this.hsba[0]).toPrecision(3), + "%, ", + (100 * this.hsba[1]).toPrecision(3), + "%, ", + (100 * this.hsba[2]).toPrecision(3), + "%, ", + (100 * o).toPrecision(3), + "%)", + ) + ); + case "hsl": + return ( + this.hsla || + (this.hsla = h.default._rgbaToHSLA( + this._array, + )), + "hsl(".concat( + this.hsla[0] * this.maxes[d.HSL][0], + ", ", + this.hsla[1] * this.maxes[d.HSL][1], + ", ", + this.hsla[2] * this.maxes[d.HSL][2], + ")", + ) + ); + case "hsl%": + return ( + this.hsla || + (this.hsla = h.default._rgbaToHSLA( + this._array, + )), + "hsl(".concat( + (100 * this.hsla[0]).toPrecision(3), + "%, ", + (100 * this.hsla[1]).toPrecision(3), + "%, ", + (100 * this.hsla[2]).toPrecision(3), + "%)", + ) + ); + case "hsla": + return ( + this.hsla || + (this.hsla = h.default._rgbaToHSLA( + this._array, + )), + "hsla(".concat( + this.hsla[0] * this.maxes[d.HSL][0], + ", ", + this.hsla[1] * this.maxes[d.HSL][1], + ", ", + this.hsla[2] * this.maxes[d.HSL][2], + ", ", + o, + ")", + ) + ); + case "hsla%": + return ( + this.hsla || + (this.hsla = h.default._rgbaToHSLA( + this._array, + )), + "hsl(".concat( + (100 * this.hsla[0]).toPrecision(3), + "%, ", + (100 * this.hsla[1]).toPrecision(3), + "%, ", + (100 * this.hsla[2]).toPrecision(3), + "%, ", + (100 * o).toPrecision(3), + "%)", + ) + ); + default: + return "rgba(".concat( + t[0], + ",", + t[1], + ",", + t[2], + ",", + o, + ")", + ); + } + }, + }, + { + key: "setRed", + value: function (e) { + (this._array[0] = e / this.maxes[d.RGB][0]), + this._calculateLevels(); + }, + }, + { + key: "setGreen", + value: function (e) { + (this._array[1] = e / this.maxes[d.RGB][1]), + this._calculateLevels(); + }, + }, + { + key: "setBlue", + value: function (e) { + (this._array[2] = e / this.maxes[d.RGB][2]), + this._calculateLevels(); + }, + }, + { + key: "setAlpha", + value: function (e) { + (this._array[3] = e / this.maxes[this.mode][3]), + this._calculateLevels(); + }, + }, + { + key: "_calculateLevels", + value: function () { + for ( + var e = this._array, + t = (this.levels = new Array(e.length)), + r = e.length - 1; + 0 <= r; + --r + ) + t[r] = Math.round(255 * e[r]); + (this.hsla = null), (this.hsba = null); + }, + }, + { + key: "_getAlpha", + value: function () { + return this._array[3] * this.maxes[this.mode][3]; + }, + }, + { + key: "_storeModeAndMaxes", + value: function (e, t) { + (this.mode = e), (this.maxes = t); + }, + }, + { + key: "_getMode", + value: function () { + return this.mode; + }, + }, + { + key: "_getMaxes", + value: function () { + return this.maxes; + }, + }, + { + key: "_getBlue", + value: function () { + return this._array[2] * this.maxes[d.RGB][2]; + }, + }, + { + key: "_getBrightness", + value: function () { + return ( + this.hsba || + (this.hsba = h.default._rgbaToHSBA(this._array)), + this.hsba[2] * this.maxes[d.HSB][2] + ); + }, + }, + { + key: "_getGreen", + value: function () { + return this._array[1] * this.maxes[d.RGB][1]; + }, + }, + { + key: "_getHue", + value: function () { + return this.mode === d.HSB + ? (this.hsba || + (this.hsba = h.default._rgbaToHSBA(this._array)), + this.hsba[0] * this.maxes[d.HSB][0]) + : (this.hsla || + (this.hsla = h.default._rgbaToHSLA(this._array)), + this.hsla[0] * this.maxes[d.HSL][0]); + }, + }, + { + key: "_getLightness", + value: function () { + return ( + this.hsla || + (this.hsla = h.default._rgbaToHSLA(this._array)), + this.hsla[2] * this.maxes[d.HSL][2] + ); + }, + }, + { + key: "_getRed", + value: function () { + return this._array[0] * this.maxes[d.RGB][0]; + }, + }, + { + key: "_getSaturation", + value: function () { + return this.mode === d.HSB + ? (this.hsba || + (this.hsba = h.default._rgbaToHSBA(this._array)), + this.hsba[1] * this.maxes[d.HSB][1]) + : (this.hsla || + (this.hsla = h.default._rgbaToHSLA(this._array)), + this.hsla[1] * this.maxes[d.HSL][1]); + }, + }, + ]) && l(e.prototype, t), + r && l(e, r), + c + ); + })()), + n.default.Color); + r.default = u; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./color_conversion": 260, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.constructor": 186, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.trim": 201, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 263: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.fill"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + a = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = l(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function l() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (l = function () { + return e; + }), + e); + } + e("./p5.Color"), + (s.default.prototype.beginClip = function () { + this._renderer.beginClip( + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : {}, + ); + }), + (s.default.prototype.endClip = function () { + this._renderer.endClip(); + }), + (s.default.prototype.clip = function (e, t) { + this._renderer.beginClip(t), e(), this._renderer.endClip(t); + }), + (s.default.prototype.background = function () { + var e; + return (e = this._renderer).background.apply(e, arguments), this; + }), + (s.default.prototype.clear = function () { + return ( + this._renderer.clear( + (arguments.length <= 0 ? void 0 : arguments[0]) || 0, + (arguments.length <= 1 ? void 0 : arguments[1]) || 0, + (arguments.length <= 2 ? void 0 : arguments[2]) || 0, + (arguments.length <= 3 ? void 0 : arguments[3]) || 0, + ), + this + ); + }), + (s.default.prototype.colorMode = function (e, t, r, o, n) { + return ( + s.default._validateParameters("colorMode", arguments), + (e !== a.RGB && e !== a.HSB && e !== a.HSL) || + ((this._colorMode = e), + (e = this._colorMaxes[e]), + 2 === arguments.length + ? ((e[0] = t), (e[1] = t), (e[2] = t), (e[3] = t)) + : 4 === arguments.length + ? ((e[0] = t), (e[1] = r), (e[2] = o)) + : 5 === arguments.length && + ((e[0] = t), (e[1] = r), (e[2] = o), (e[3] = n))), + this + ); + }), + (s.default.prototype.fill = function () { + var e; + return ( + this._renderer._setProperty("_fillSet", !0), + this._renderer._setProperty("_doFill", !0), + (e = this._renderer).fill.apply(e, arguments), + this + ); + }), + (s.default.prototype.noFill = function () { + return this._renderer._setProperty("_doFill", !1), this; + }), + (s.default.prototype.noStroke = function () { + return this._renderer._setProperty("_doStroke", !1), this; + }), + (s.default.prototype.stroke = function () { + var e; + return ( + this._renderer._setProperty("_strokeSet", !0), + this._renderer._setProperty("_doStroke", !0), + (e = this._renderer).stroke.apply(e, arguments), + this + ); + }), + (s.default.prototype.erase = function () { + return ( + this._renderer.erase( + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : 255, + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : 255, + ), + this + ); + }), + (s.default.prototype.noErase = function () { + return this._renderer.noErase(), this; + }); + var n = s.default; + r.default = n; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.Color": 262, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 264: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.QUADRATIC = + r.LINEAR = + r._CTX_MIDDLE = + r._DEFAULT_LEADMULT = + r._DEFAULT_TEXT_FILL = + r.WORD = + r.CHAR = + r.BOLDITALIC = + r.BOLD = + r.ITALIC = + r.NORMAL = + r.BLUR = + r.ERODE = + r.DILATE = + r.POSTERIZE = + r.INVERT = + r.OPAQUE = + r.GRAY = + r.THRESHOLD = + r.BURN = + r.DODGE = + r.SOFT_LIGHT = + r.HARD_LIGHT = + r.OVERLAY = + r.REPLACE = + r.SCREEN = + r.MULTIPLY = + r.EXCLUSION = + r.SUBTRACT = + r.DIFFERENCE = + r.LIGHTEST = + r.DARKEST = + r.ADD = + r.REMOVE = + r.BLEND = + r.UP_ARROW = + r.TAB = + r.SHIFT = + r.RIGHT_ARROW = + r.RETURN = + r.OPTION = + r.LEFT_ARROW = + r.ESCAPE = + r.ENTER = + r.DOWN_ARROW = + r.DELETE = + r.CONTROL = + r.BACKSPACE = + r.ALT = + r.AUTO = + r.HSL = + r.HSB = + r.RGB = + r.MITER = + r.BEVEL = + r.ROUND = + r.SQUARE = + r.PROJECT = + r.PIE = + r.CHORD = + r.OPEN = + r.CLOSE = + r.TESS = + r.QUAD_STRIP = + r.QUADS = + r.TRIANGLE_STRIP = + r.TRIANGLE_FAN = + r.TRIANGLES = + r.LINE_LOOP = + r.LINE_STRIP = + r.LINES = + r.POINTS = + r.BASELINE = + r.BOTTOM = + r.TOP = + r.CENTER = + r.LEFT = + r.RIGHT = + r.RADIUS = + r.CORNERS = + r.CORNER = + r.RAD_TO_DEG = + r.DEG_TO_RAD = + r.RADIANS = + r.DEGREES = + r.TWO_PI = + r.TAU = + r.QUARTER_PI = + r.PI = + r.HALF_PI = + r.WAIT = + r.TEXT = + r.MOVE = + r.HAND = + r.CROSS = + r.ARROW = + r.WEBGL2 = + r.WEBGL = + r.P2D = + r.VERSION = + void 0), + (r.RGBA = + r.HALF_FLOAT = + r.FLOAT = + r.UNSIGNED_INT = + r.UNSIGNED_BYTE = + r.COVER = + r.CONTAIN = + r.FALLBACK = + r.LABEL = + r.AXES = + r.GRID = + r._DEFAULT_FILL = + r._DEFAULT_STROKE = + r.PORTRAIT = + r.LANDSCAPE = + r.SMOOTH = + r.FLAT = + r.MIRROR = + r.CLAMP = + r.REPEAT = + r.NEAREST = + r.IMAGE = + r.IMMEDIATE = + r.TEXTURE = + r.FILL = + r.STROKE = + r.CURVE = + r.BEZIER = + void 0); + var o = Math.PI, + n = + ((r.VERSION = "1.9.0"), + (r.P2D = "p2d"), + (r.WEBGL = "webgl"), + (r.WEBGL2 = "webgl2"), + (r.ARROW = "default"), + (r.CROSS = "crosshair"), + (r.HAND = "pointer"), + (r.MOVE = "move"), + (r.TEXT = "text"), + (r.WAIT = "wait"), + o / 2), + n = ((r.HALF_PI = n), o), + n = ((r.PI = n), o / 4), + n = ((r.QUARTER_PI = n), 2 * o), + n = ((r.TAU = n), 2 * o), + n = + ((r.TWO_PI = n), + (r.DEGREES = "degrees"), + (r.RADIANS = "radians"), + o / 180), + n = ((r.DEG_TO_RAD = n), 180 / o); + (r.RAD_TO_DEG = n), + (r.CORNER = "corner"), + (r.CORNERS = "corners"), + (r.RADIUS = "radius"), + (r.RIGHT = "right"), + (r.LEFT = "left"), + (r.CENTER = "center"), + (r.TOP = "top"), + (r.BOTTOM = "bottom"), + (r.BASELINE = "alphabetic"), + (r.POINTS = 0), + (r.LINES = 1), + (r.LINE_STRIP = 3), + (r.LINE_LOOP = 2), + (r.TRIANGLES = 4), + (r.TRIANGLE_FAN = 6), + (r.TRIANGLE_STRIP = 5), + (r.QUADS = "quads"), + (r.QUAD_STRIP = "quad_strip"), + (r.TESS = "tess"), + (r.CLOSE = "close"), + (r.OPEN = "open"), + (r.CHORD = "chord"), + (r.PIE = "pie"), + (r.PROJECT = "square"), + (r.SQUARE = "butt"), + (r.ROUND = "round"), + (r.BEVEL = "bevel"), + (r.MITER = "miter"), + (r.RGB = "rgb"), + (r.HSB = "hsb"), + (r.HSL = "hsl"), + (r.AUTO = "auto"), + (r.ALT = 18), + (r.BACKSPACE = 8), + (r.CONTROL = 17), + (r.DELETE = 46), + (r.DOWN_ARROW = 40), + (r.ENTER = 13), + (r.ESCAPE = 27), + (r.LEFT_ARROW = 37), + (r.OPTION = 18), + (r.RETURN = 13), + (r.RIGHT_ARROW = 39), + (r.SHIFT = 16), + (r.TAB = 9), + (r.UP_ARROW = 38), + (r.BLEND = "source-over"), + (r.REMOVE = "destination-out"), + (r.ADD = "lighter"), + (r.DARKEST = "darken"), + (r.LIGHTEST = "lighten"), + (r.DIFFERENCE = "difference"), + (r.SUBTRACT = "subtract"), + (r.EXCLUSION = "exclusion"), + (r.MULTIPLY = "multiply"), + (r.SCREEN = "screen"), + (r.REPLACE = "copy"), + (r.OVERLAY = "overlay"), + (r.HARD_LIGHT = "hard-light"), + (r.SOFT_LIGHT = "soft-light"), + (r.DODGE = "color-dodge"), + (r.BURN = "color-burn"), + (r.THRESHOLD = "threshold"), + (r.GRAY = "gray"), + (r.OPAQUE = "opaque"), + (r.INVERT = "invert"), + (r.POSTERIZE = "posterize"), + (r.DILATE = "dilate"), + (r.ERODE = "erode"), + (r.BLUR = "blur"), + (r.NORMAL = "normal"), + (r.ITALIC = "italic"), + (r.BOLD = "bold"), + (r.BOLDITALIC = "bold italic"), + (r.CHAR = "CHAR"), + (r.WORD = "WORD"), + (r._DEFAULT_TEXT_FILL = "#000000"), + (r._DEFAULT_LEADMULT = 1.25), + (r._CTX_MIDDLE = "middle"), + (r.LINEAR = "linear"), + (r.QUADRATIC = "quadratic"), + (r.BEZIER = "bezier"), + (r.CURVE = "curve"), + (r.STROKE = "stroke"), + (r.FILL = "fill"), + (r.TEXTURE = "texture"), + (r.IMMEDIATE = "immediate"), + (r.IMAGE = "image"), + (r.NEAREST = "nearest"), + (r.REPEAT = "repeat"), + (r.CLAMP = "clamp"), + (r.MIRROR = "mirror"), + (r.FLAT = "flat"), + (r.SMOOTH = "smooth"), + (r.LANDSCAPE = "landscape"), + (r.PORTRAIT = "portrait"), + (r._DEFAULT_STROKE = "#000000"), + (r._DEFAULT_FILL = "#FFFFFF"), + (r.GRID = "grid"), + (r.AXES = "axes"), + (r.LABEL = "label"), + (r.FALLBACK = "fallback"), + (r.CONTAIN = "contain"), + (r.COVER = "cover"), + (r.UNSIGNED_BYTE = "unsigned-byte"), + (r.UNSIGNED_INT = "unsigned-int"), + (r.FLOAT = "float"), + (r.HALF_FLOAT = "half-float"); + r.RGBA = "rgba"; + }, + {}, + ], + 265: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.search"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.search"), + e("core-js/modules/es.string.split"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (s = e("./main")) && s.__esModule ? s : { default: s }, + s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("./constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + var l = [s.ARROW, s.CROSS, s.HAND, s.MOVE, s.TEXT, s.WAIT], + u = + ((n.default.prototype._frameRate = 0), + (n.default.prototype._lastFrameTime = window.performance.now()), + (n.default.prototype._targetFrameRate = 60), + window.print), + c = !1; + function d() { + return ( + window.innerWidth || + (document.documentElement && + document.documentElement.clientWidth) || + (document.body && document.body.clientWidth) || + 0 + ); + } + function h() { + return ( + window.innerHeight || + (document.documentElement && + document.documentElement.clientHeight) || + (document.body && document.body.clientHeight) || + 0 + ); + } + (n.default.prototype.print = function () { + var e; + arguments.length + ? (e = console).log.apply(e, arguments) + : c || + (u(), + window.confirm( + "You just tried to print the webpage. Do you want to prevent this from running again?", + ) && (c = !0)); + }), + (n.default.prototype.frameCount = 0), + (n.default.prototype.deltaTime = 0), + (n.default.prototype.focused = document.hasFocus()), + (n.default.prototype.cursor = function (e, t, r) { + var o, + n = "auto", + s = this._curElement.elt; + l.includes(e) + ? (n = e) + : "string" == typeof e && + ((o = ""), + t && + r && + "number" == typeof t && + "number" == typeof r && + (o = "".concat(t, " ").concat(r)), + (n = + "http://" === e.substring(0, 7) || + "https://" === e.substring(0, 8) || + /\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(e) + ? "url(".concat(e, ") ").concat(o, ", auto") + : e)), + (s.style.cursor = n); + }), + (n.default.prototype.frameRate = function (e) { + return ( + n.default._validateParameters("frameRate", arguments), + "number" != typeof e || e < 0 + ? this._frameRate + : (this._setProperty("_targetFrameRate", e), + 0 === e && this._setProperty("_frameRate", e), + this) + ); + }), + (n.default.prototype.getFrameRate = function () { + return this.frameRate(); + }), + (n.default.prototype.setFrameRate = function (e) { + return this.frameRate(e); + }), + (n.default.prototype.getTargetFrameRate = function () { + return this._targetFrameRate; + }), + (n.default.prototype.noCursor = function () { + this._curElement.elt.style.cursor = "none"; + }), + (n.default.prototype.webglVersion = s.P2D), + (n.default.prototype.displayWidth = screen.width), + (n.default.prototype.displayHeight = screen.height), + (n.default.prototype.windowWidth = d()), + (n.default.prototype.windowHeight = h()), + (n.default.prototype._onresize = function (e) { + this._setProperty("windowWidth", d()), + this._setProperty("windowHeight", h()); + var t = this._isGlobal ? window : this; + "function" != typeof t.windowResized || + void 0 === (t = t.windowResized(e)) || + t || + e.preventDefault(); + }), + (n.default.prototype.width = 0), + (n.default.prototype.height = 0), + (n.default.prototype.fullscreen = function (e) { + if ( + (n.default._validateParameters("fullscreen", arguments), + void 0 === e) + ) + return ( + document.fullscreenElement || + document.webkitFullscreenElement || + document.mozFullScreenElement || + document.msFullscreenElement + ); + if (e) { + e = document.documentElement; + if ( + !( + document.fullscreenEnabled || + document.webkitFullscreenEnabled || + document.mozFullScreenEnabled || + document.msFullscreenEnabled + ) + ) + throw new Error("Fullscreen not enabled in this browser."); + e.requestFullscreen + ? e.requestFullscreen() + : e.mozRequestFullScreen + ? e.mozRequestFullScreen() + : e.webkitRequestFullscreen + ? e.webkitRequestFullscreen() + : e.msRequestFullscreen && e.msRequestFullscreen(); + } else + document.exitFullscreen + ? document.exitFullscreen() + : document.mozCancelFullScreen + ? document.mozCancelFullScreen() + : document.webkitExitFullscreen + ? document.webkitExitFullscreen() + : document.msExitFullscreen && + document.msExitFullscreen(); + }), + (n.default.prototype.pixelDensity = function (e) { + var t; + return ( + n.default._validateParameters("pixelDensity", arguments), + "number" == typeof e + ? (e !== this._pixelDensity && (this._pixelDensity = e), + (t = this).resizeCanvas(this.width, this.height, !0)) + : (t = this._pixelDensity), + t + ); + }), + (n.default.prototype.displayDensity = function () { + return window.devicePixelRatio; + }), + (n.default.prototype.getURL = function () { + return location.href; + }), + (n.default.prototype.getURLPath = function () { + return location.pathname.split("/").filter(function (e) { + return "" !== e; + }); + }), + (n.default.prototype.getURLParams = function () { + for ( + var e, t = /[?&]([^&=]+)(?:[&=])([^&=]+)/gim, r = {}; + null != (e = t.exec(location.search)); + + ) + e.index === t.lastIndex && t.lastIndex++, (r[e[1]] = e[2]); + return r; + }); + e = n.default; + r.default = e; + }, + { + "./constants": 264, + "./main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.search": 197, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 266: [ + function (r, e, t) { + "use strict"; + r("core-js/modules/es.symbol"), + r("core-js/modules/es.symbol.description"), + r("core-js/modules/es.symbol.iterator"), + r("core-js/modules/es.array.concat"), + r("core-js/modules/es.array.filter"), + r("core-js/modules/es.array.for-each"), + r("core-js/modules/es.array.includes"), + r("core-js/modules/es.array.iterator"), + r("core-js/modules/es.array.join"), + r("core-js/modules/es.array.map"), + r("core-js/modules/es.array.slice"), + r("core-js/modules/es.array.some"), + r("core-js/modules/es.function.name"), + r("core-js/modules/es.object.assign"), + r("core-js/modules/es.object.get-own-property-names"), + r("core-js/modules/es.object.keys"), + r("core-js/modules/es.object.to-string"), + r("core-js/modules/es.regexp.constructor"), + r("core-js/modules/es.regexp.exec"), + r("core-js/modules/es.regexp.to-string"), + r("core-js/modules/es.string.iterator"), + r("core-js/modules/es.string.match"), + r("core-js/modules/es.string.replace"), + r("core-js/modules/es.string.split"), + r("core-js/modules/es.string.starts-with"), + r("core-js/modules/web.dom-collections.for-each"), + r("core-js/modules/web.dom-collections.iterator"), + r("core-js/modules/es.symbol"), + r("core-js/modules/es.symbol.description"), + r("core-js/modules/es.symbol.iterator"), + r("core-js/modules/es.array.concat"), + r("core-js/modules/es.array.filter"), + r("core-js/modules/es.array.for-each"), + r("core-js/modules/es.array.includes"), + r("core-js/modules/es.array.iterator"), + r("core-js/modules/es.array.join"), + r("core-js/modules/es.array.map"), + r("core-js/modules/es.array.slice"), + r("core-js/modules/es.array.some"), + r("core-js/modules/es.function.name"), + r("core-js/modules/es.object.assign"), + r("core-js/modules/es.object.get-own-property-names"), + r("core-js/modules/es.object.keys"), + r("core-js/modules/es.object.to-string"), + r("core-js/modules/es.regexp.constructor"), + r("core-js/modules/es.regexp.exec"), + r("core-js/modules/es.regexp.to-string"), + r("core-js/modules/es.string.iterator"), + r("core-js/modules/es.string.match"), + r("core-js/modules/es.string.replace"), + r("core-js/modules/es.string.split"), + r("core-js/modules/es.string.starts-with"), + r("core-js/modules/web.dom-collections.for-each"), + r("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(t, "__esModule", { value: !0 }), + (t.default = void 0); + var o = (l = r("../main")) && l.__esModule ? l : { default: l }; + r("../internationalization"); + function n(r, o) { + (o = o || console.log.bind(console)), + s || i(), + s.some(function (e) { + var t; + if ( + r.message && + null !== r.message.match("\\W?".concat(e.name, "\\W")) + ) + return ( + (t = + "function" === e.type ? "".concat(e.name, "()") : e.name), + o( + "Did you just try to use p5.js's " + .concat(t, " ") + .concat( + e.type, + "? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ", + ) + .concat(a), + ), + !0 + ); + }); + } + var s = null, + i = null, + a = + ((o.default._friendlyError = + o.default._checkForUserDefinedFunctions = + o.default._fesErrorMonitor = + function () {}), + (s = null), + "https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"), + i = function () { + function e(r) { + return Object.getOwnPropertyNames(r) + .filter(function (e) { + return "_" !== e[0] && !(e in t) && (t[e] = !0); + }) + .map(function (e) { + var t = + "function" == typeof r[e] + ? "function" + : e === e.toUpperCase() + ? "constant" + : "variable"; + return { name: e, type: t }; + }); + } + var t = {}; + (s = [].concat( + e(o.default.prototype), + e(r("../constants")), + )).sort(function (e, t) { + return t.name.length - e.name.length; + }); + }, + l = + ((o.default.prototype._helpForMisusedAtTopLevelCode = n), + "complete" !== document.readyState && + (window.addEventListener("error", n, !1), + window.addEventListener("load", function () { + window.removeEventListener("error", n, !1); + })), + o.default); + t.default = l; + }, + { + "../constants": 264, + "../internationalization": 273, + "../main": 275, + "./browser_errors": void 0, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.some": 166, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.object.assign": 176, + "core-js/modules/es.object.get-own-property-names": 179, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.constructor": 186, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.match": 193, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.starts-with": 199, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 267: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var o = (o = e("../main")) && o.__esModule ? o : { default: o }; + e("../internationalization"); + o.default._friendlyFileLoadError = function () {}; + e = o.default; + r.default = e; + }, + { "../internationalization": 273, "../main": 275 }, + ], + 268: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + e("core-js/modules/web.dom-collections.for-each"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = O(e("../main")), + s = e("../internationalization"), + a = C(e("../constants")), + l, + u, + c, + d, + h, + f, + p, + m, + y, + g, + v, + b, + j, + _, + x, + w, + S, + T, + M, + E, + I; + function k() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (k = function () { + return e; + }), + e); + } + function C(e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = k(); + if (t && t.has(e)) return t.get(e); + var r, + o, + n = {}, + s = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) + Object.prototype.hasOwnProperty.call(e, r) && + ((o = s ? Object.getOwnPropertyDescriptor(e, r) : null) && + (o.get || o.set) + ? Object.defineProperty(n, r, o) + : (n[r] = e[r])); + return (n.default = e), t && t.set(e, n), n; + } + function O(e) { + return e && e.__esModule ? e : { default: e }; + } + function D(e) { + return L(e) || A(e) || P(); + } + function P() { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + } + function A(e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + } + function L(e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + } + n.default._fesCodeReader = function () {}; + var R = n.default; + r.default = R; + }, + { + "../constants": 264, + "../internationalization": 273, + "../main": 275, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.constructor": 186, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.match": 193, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.trim": 201, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 269: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../main")) && e.__esModule ? e : { default: e }; + function o() { + var t = /(^|@)\S+:\d+/, + r = /^\s*at .*(\S+:\d+|\(native\))/m, + o = /^(eval@)?(\[native code])?$/; + return { + parse: function (e) { + return void 0 !== e.stacktrace || + void 0 !== e["opera#sourceloc"] + ? this.parseOpera(e) + : e.stack && e.stack.match(r) + ? this.parseV8OrIE(e) + : e.stack + ? this.parseFFOrSafari(e) + : void 0; + }, + extractLocation: function (e) { + return -1 === e.indexOf(":") + ? [e] + : [ + (e = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec( + e.replace(/[()]/g, ""), + ))[1], + e[2] || void 0, + e[3] || void 0, + ]; + }, + parseV8OrIE: function (e) { + return e.stack + .split("\n") + .filter(function (e) { + return !!e.match(r); + }, this) + .map(function (e) { + var t = (e = + -1 < e.indexOf("(eval ") + ? e + .replace(/eval code/g, "eval") + .replace(/(\(eval at [^()]*)|(\),.*$)/g, "") + : e) + .replace(/^\s+/, "") + .replace(/\(eval code/g, "("), + r = t.match(/ (\((.+):(\d+):(\d+)\)$)/), + t = (t = r ? t.replace(r[0], "") : t) + .split(/\s+/) + .slice(1), + r = this.extractLocation(r ? r[1] : t.pop()); + return { + functionName: t.join(" ") || void 0, + fileName: + -1 < ["eval", ""].indexOf(r[0]) + ? void 0 + : r[0], + lineNumber: r[1], + columnNumber: r[2], + source: e, + }; + }, this); + }, + parseFFOrSafari: function (e) { + return e.stack + .split("\n") + .filter(function (e) { + return !e.match(o); + }, this) + .map(function (e) { + var t, r; + return -1 === + (e = + -1 < e.indexOf(" > eval") + ? e.replace( + / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, + ":$1", + ) + : e).indexOf("@") && -1 === e.indexOf(":") + ? { functionName: e } + : { + functionName: + (r = e.match((t = /((.*".+"[^@]*)?[^@]*)(?:@)/))) && + r[1] + ? r[1] + : void 0, + fileName: (r = this.extractLocation( + e.replace(t, ""), + ))[0], + lineNumber: r[1], + columnNumber: r[2], + source: e, + }; + }, this); + }, + parseOpera: function (e) { + return !e.stacktrace || + (-1 < e.message.indexOf("\n") && + e.message.split("\n").length > + e.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"), + o = [], + n = 2, + s = r.length; + n < s; + n += 2 + ) { + var i = t.exec(r[n]); + i && + o.push({ fileName: i[2], lineNumber: i[1], source: r[n] }); + } + return o; + }, + parseOpera10: function (e) { + for ( + var t = + /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, + r = e.stacktrace.split("\n"), + o = [], + n = 0, + s = r.length; + n < s; + n += 2 + ) { + var i = t.exec(r[n]); + i && + o.push({ + functionName: i[3] || void 0, + fileName: i[2], + lineNumber: i[1], + source: r[n], + }); + } + return o; + }, + parseOpera11: function (e) { + return e.stack + .split("\n") + .filter(function (e) { + return !!e.match(t) && !e.match(/^Error created at/); + }, this) + .map(function (e) { + var t, + r = e.split("@"), + o = this.extractLocation(r.pop()), + r = r.shift() || ""; + return { + functionName: + r + .replace(//, "$2") + .replace(/\([^)]*\)/g, "") || void 0, + args: + void 0 === + (t = r.match(/\(([^)]*)\)/) + ? r.replace(/^[^(]+\(([^)]*)\)$/, "$1") + : t) || "[arguments not available]" === t + ? void 0 + : t.split(","), + fileName: o[0], + lineNumber: o[1], + columnNumber: o[2], + source: e, + }; + }, this); + }, + }; + } + e.default._getErrorStackParser = function () { + return new o(); + }; + e = e.default; + r.default = e; + }, + { + "../main": 275, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.match": 193, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + }, + ], + 270: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.last-index-of"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.map"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.last-index-of"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (n = e("../main")) && n.__esModule ? n : { default: n }; + (function (e) { + if (e && e.__esModule) return; + if (null === e || ("object" !== a(e) && "function" != typeof e)) + return; + var t = i(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + })(e("../constants")), + e("../internationalization"); + function i() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (i = function () { + return e; + }), + e); + } + function a(e) { + return (a = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + n.default._validateParameters = n.default._clearValidateParamsCache = + function () {}; + e = n.default; + r.default = e; + }, + { + "../../../docs/parameterData.json": void 0, + "../constants": 264, + "../internationalization": 273, + "../main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.last-index-of": 163, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.map": 169, + "core-js/modules/es.number.constructor": 173, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.set": 189, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 271: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("./constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + r.default = { + modeAdjust: function (e, t, r, o, n) { + return n === s.CORNER + ? { x: e, y: t, w: r, h: o } + : n === s.CORNERS + ? { x: e, y: t, w: r - e, h: o - t } + : n === s.RADIUS + ? { x: e - r, y: t - o, w: 2 * r, h: 2 * o } + : n === s.CENTER + ? { x: e - 0.5 * r, y: t - 0.5 * o, w: r, h: o } + : void 0; + }, + }; + }, + { + "./constants": 264, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 272: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"); + var o = (n = e("../core/main")) && n.__esModule ? n : { default: n }; + e("./internationalization"); + var n = Promise.resolve(); + Promise.all([ + new Promise(function (e, t) { + "complete" === document.readyState + ? e() + : window.addEventListener("load", e, !1); + }), + n, + ]).then(function () { + void 0 !== window._setupDone + ? console.warn( + "p5.js seems to have been imported multiple times. Please remove the duplicate import", + ) + : window.mocha || + (((window.setup && "function" == typeof window.setup) || + (window.draw && "function" == typeof window.draw)) && + !o.default.instance && + new o.default()); + }); + }, + { + "../core/main": 275, + "./internationalization": 273, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.promise": 183, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 273: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.setTranslatorLanguage = + r.currentTranslatorLanguage = + r.availableTranslatorLanguages = + r.initialize = + r.translator = + void 0); + var n, + s, + o = a(e("i18next")), + i = a(e("i18next-browser-languagedetector")); + function a(e) { + return e && e.__esModule ? e : { default: e }; + } + function l(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + var u = (function () { + function r(e, t) { + if (!(this instanceof r)) + throw new TypeError("Cannot call a class as a function"); + this.init(e, t); + } + var e, t, o; + return ( + (e = r), + (t = [ + { + key: "fetchWithTimeout", + value: function (e, t) { + var r = + 2 < arguments.length && void 0 !== arguments[2] + ? arguments[2] + : 2e3; + return Promise.race([ + fetch(e, t), + new Promise(function (e, t) { + return setTimeout(function () { + return t(new Error("timeout")); + }, r); + }), + ]); + }, + }, + { + key: "init", + value: function (e) { + var t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : {}; + (this.services = e), (this.options = t); + }, + }, + { + key: "read", + value: function (e, t, r) { + var o = this.options.loadPath; + e === this.options.fallback + ? r(null, n[e][t]) + : s.includes(e) + ? ((o = this.services.interpolator.interpolate(o, { + lng: e, + ns: t, + })), + this.loadUrl(o, r)) + : r("Not found", !1); + }, + }, + { + key: "loadUrl", + value: function (t, r) { + this.fetchWithTimeout(t) + .then( + function (e) { + if (e.ok) return e.json(); + throw new Error("failed loading ".concat(t)); + }, + function () { + throw new Error("failed loading ".concat(t)); + }, + ) + .then(function (e) { + return r(null, e); + }) + .catch(r); + }, + }, + ]) && l(e.prototype, t), + o && l(e, o), + r + ); + })(); + (u.type = "backend"), + (r.translator = function (e, t) { + console.debug( + "p5.js translator called before translations were loaded", + ), + o.default.t(e, t); + }), + (r.initialize = function () { + return o.default + .use(i.default) + .use(u) + .init({ + fallbackLng: "en", + nestingPrefix: "$tr(", + nestingSuffix: ")", + defaultNS: "translation", + returnEmptyString: !1, + interpolation: { escapeValue: !1 }, + detection: { + checkWhitelist: !1, + order: [ + "querystring", + "navigator", + "htmlTag", + "path", + "subdomain", + ], + caches: [], + }, + backend: { + fallback: "en", + loadPath: + "https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json", + }, + partialBundledLanguages: !0, + resources: n, + }) + .then( + function (e) { + r.translator = e; + }, + function (e) { + return console.debug( + "Translations failed to load (".concat(e, ")"), + ); + }, + ); + }), + (r.availableTranslatorLanguages = function () { + return o.default.languages; + }), + (r.currentTranslatorLanguage = function (e) { + return o.default.language; + }); + r.setTranslatorLanguage = function (e) { + return o.default.changeLanguage(e || void 0, function (e) { + return console.debug( + "Translations failed to load (".concat(e, ")"), + ); + }); + }; + }, + { + "../../translations": void 0, + "../../translations/dev": void 0, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.promise": 183, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.split": 198, + "core-js/modules/web.dom-collections.iterator": 238, + i18next: 3, + "i18next-browser-languagedetector": 3, + }, + ], + 274: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("./main")) && e.__esModule ? e : { default: e }; + (e.default.prototype.pushStyle = function () { + throw new Error("pushStyle() not used, see push()"); + }), + (e.default.prototype.popStyle = function () { + throw new Error("popStyle() not used, see pop()"); + }), + (e.default.prototype.popMatrix = function () { + throw new Error("popMatrix() not used, see pop()"); + }), + (e.default.prototype.pushMatrix = function () { + throw new Error("pushMatrix() not used, see push()"); + }); + e = e.default; + r.default = e; + }, + { "./main": 275 }, + ], + 275: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-own-property-names"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.object.get-own-property-names"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + 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 = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("./constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + var l, + u = (function () { + function g(e, t) { + var d = this; + if (!(this instanceof g)) + throw new TypeError("Cannot call a class as a function"); + (this._setupDone = !1), + (this._preloadDone = !1), + (this._pixelDensity = + Math.ceil(window.devicePixelRatio) || 1), + (this._userNode = t), + (this._curElement = null), + (this._elements = []), + (this._glAttributes = null), + (this._requestAnimId = 0), + (this._preloadCount = 0), + (this._isGlobal = !1), + (this._loop = !0), + (this._startListener = null), + this._initializeInstanceVariables(), + (this._defaultCanvasSize = { width: 100, height: 100 }), + (this._events = { + mousemove: null, + mousedown: null, + mouseup: null, + dragend: null, + dragover: null, + click: null, + dblclick: null, + mouseover: null, + mouseout: null, + keydown: null, + keyup: null, + keypress: null, + touchstart: null, + touchmove: null, + touchend: null, + resize: null, + blur: null, + }), + (this._millisStart = -1), + (this._recording = !1), + (this._lcg_random_state = null), + (this._gaussian_previous = !1), + (this._events.wheel = null), + (this._loadingScreenId = "p5_loading"), + (this._registeredMethods = {}); + var t = Object.getOwnPropertyNames( + g.prototype._registeredMethods, + ), + r = !0, + o = !1, + n = void 0; + try { + for ( + var s, i = t[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) { + var a = s.value; + this._registeredMethods[a] = + g.prototype._registeredMethods[a].slice(); + } + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + window.DeviceOrientationEvent && + (this._events.deviceorientation = null), + window.DeviceMotionEvent && + !window._isNodeWebkit && + (this._events.devicemotion = null), + (g.prototype.callRegisteredHooksFor = function (t) { + var e = this || g.prototype, + r = this._isGlobal ? window : this; + if (e._registeredMethods.hasOwnProperty(t)) { + var e = e._registeredMethods[t], + o = !0, + t = !1, + n = void 0; + try { + for ( + var s, i = e[Symbol.iterator](); + !(o = (s = i.next()).done); + o = !0 + ) { + var a = s.value; + "function" == typeof a && a.call(r); + } + } catch (e) { + (t = !0), (n = e); + } finally { + try { + o || null == i.return || i.return(); + } finally { + if (t) throw n; + } + } + } + }), + (this._start = function () { + d._userNode && + "string" == typeof d._userNode && + (d._userNode = document.getElementById(d._userNode)); + var e = d._isGlobal ? window : d; + if (e.preload) { + d.callRegisteredHooksFor("beforePreload"); + var t, + r = document.getElementById(d._loadingScreenId), + o = + (r || + (((r = document.createElement("div")).innerHTML = + "Loading..."), + (r.style.position = "absolute"), + (r.id = d._loadingScreenId), + (d._userNode || document.body).appendChild(r)), + d._preloadMethods); + for (t in o) { + o[t] = o[t] || g; + var n = o[t]; + (n !== g.prototype && n !== g) || + (d._isGlobal && (window[t] = d._wrapPreload(d, t)), + (n = d)), + (d._registeredPreloadMethods[t] = n[t]), + (n[t] = d._wrapPreload(n, t)); + } + e.preload(), d._runIfPreloadsAreDone(); + } else d._setup(), d._recording || d._draw(); + }), + (this._runIfPreloadsAreDone = function () { + var e, + t = this._isGlobal ? window : this; + 0 === t._preloadCount && + ((e = document.getElementById(t._loadingScreenId)) && + e.parentNode.removeChild(e), + this.callRegisteredHooksFor("afterPreload"), + this._setupDone || + ((this._lastTargetFrameTime = window.performance.now()), + (this._lastRealFrameTime = window.performance.now()), + t._setup(), + this._recording || t._draw())); + }), + (this._decrementPreload = function () { + var e = this._isGlobal ? window : this; + e._preloadDone || + "function" != typeof e.preload || + (e._setProperty("_preloadCount", e._preloadCount - 1), + e._runIfPreloadsAreDone()); + }), + (this._wrapPreload = function (o, n) { + var s = this; + return function () { + s._incrementPreload(); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return s._registeredPreloadMethods[n].apply(o, t); + }; + }), + (this._incrementPreload = function () { + var e = this._isGlobal ? window : this; + e._preloadDone || + e._setProperty("_preloadCount", e._preloadCount + 1); + }), + (this._setup = function () { + d.callRegisteredHooksFor("beforeSetup"), + d.createCanvas( + d._defaultCanvasSize.width, + d._defaultCanvasSize.height, + "p2d", + ); + var e = d._isGlobal ? window : d; + if ("function" == typeof e.preload) + for (var t in d._preloadMethods) + (e[t] = d._preloadMethods[t][t]), + e[t] && d && (e[t] = e[t].bind(d)); + (d._millisStart = window.performance.now()), + (e._preloadDone = !0), + "function" == typeof e.setup && e.setup(); + var r = document.getElementsByTagName("canvas"), + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = r[Symbol.iterator](); + !(o = (i = a.next()).done); + o = !0 + ) { + var l = i.value; + "true" === l.dataset.hidden && + ((l.style.visibility = ""), delete l.dataset.hidden); + } + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + (d._lastTargetFrameTime = window.performance.now()), + (d._lastRealFrameTime = window.performance.now()), + (d._setupDone = !0), + (d._accessibleOutputs.grid || + d._accessibleOutputs.text) && + d._updateAccsOutput(), + d.callRegisteredHooksFor("afterSetup"); + }), + (this._draw = function () { + var e = window.performance.now(), + t = e - d._lastTargetFrameTime, + r = 1e3 / d._targetFrameRate; + (!d._loop || r - 5 <= t) && + ((d.deltaTime = e - d._lastRealFrameTime), + d._setProperty("deltaTime", d.deltaTime), + (d._frameRate = 1e3 / d.deltaTime), + d.redraw(), + (d._lastTargetFrameTime = Math.max( + d._lastTargetFrameTime + r, + e, + )), + (d._lastRealFrameTime = e), + void 0 !== d._updateMouseCoords && + (d._updateMouseCoords(), + d._setProperty("movedX", 0), + d._setProperty("movedY", 0))), + d._loop && + (d._requestAnimId = window.requestAnimationFrame( + d._draw, + )); + }), + (this._setProperty = function (e, t) { + (d[e] = t), d._isGlobal && (window[e] = t); + }), + (this.remove = function () { + d._startListener && + window.removeEventListener("load", d._startListener, !1); + var t = document.getElementById(d._loadingScreenId); + if ( + (t && + (t.parentNode.removeChild(t), d._incrementPreload()), + d._curElement) + ) { + for (var e in ((d._loop = !1), + d._requestAnimId && + window.cancelAnimationFrame(d._requestAnimId), + d._events)) + window.removeEventListener(e, d._events[e]); + var r = !0, + t = !1, + o = void 0; + try { + for ( + var n, s = d._elements[Symbol.iterator](); + !(r = (n = s.next()).done); + r = !0 + ) { + var i, + a = n.value; + for (i in (a.elt && + a.elt.parentNode && + a.elt.parentNode.removeChild(a.elt), + a._events)) + a.elt.removeEventListener(i, a._events[i]); + } + } catch (e) { + (t = !0), (o = e); + } finally { + try { + r || null == s.return || s.return(); + } finally { + if (t) throw o; + } + } + var l = d; + d._registeredMethods.remove.forEach(function (e) { + void 0 !== e && e.call(l); + }); + } + if (d._isGlobal) { + for (var u in g.prototype) + try { + delete window[u]; + } catch (e) { + window[u] = void 0; + } + for (var c in d) + if (d.hasOwnProperty(c)) + try { + delete window[c]; + } catch (e) { + window[c] = void 0; + } + g.instance = null; + } + }), + this._registeredMethods.init.forEach(function (e) { + void 0 !== e && e.call(this); + }, this), + this._setupPromisePreloads(); + var l, + u, + c = this._createFriendlyGlobalFunctionBinder(); + if (e) e(this), g._checkForUserDefinedFunctions(this); + else { + for (var h in ((this._isGlobal = !0), + (g.instance = this), + g.prototype)) + "function" == typeof g.prototype[h] + ? ((l = h.substring(2)), + this._events.hasOwnProperty(l) || + (Math.hasOwnProperty(h) && Math[h] === g.prototype[h] + ? c(h, g.prototype[h]) + : c(h, g.prototype[h].bind(this)))) + : c(h, g.prototype[h]); + for (var f in this) this.hasOwnProperty(f) && c(f, this[f]); + } + for (u in this._events) { + var p = this["_on".concat(u)]; + p && + ((p = p.bind(this)), + window.addEventListener(u, p, { passive: !1 }), + (this._events[u] = p)); + } + function m() { + d._setProperty("focused", !0); + } + function y() { + d._setProperty("focused", !1); + } + window.addEventListener("focus", m), + window.addEventListener("blur", y), + this.registerMethod("remove", function () { + window.removeEventListener("focus", m), + window.removeEventListener("blur", y); + }), + "complete" === document.readyState + ? this._start() + : ((this._startListener = this._start.bind(this)), + window.addEventListener("load", this._startListener, !1)); + } + var e, t, r; + return ( + (e = g), + (t = [ + { + key: "_initializeInstanceVariables", + value: function () { + (this._accessibleOutputs = { + text: !1, + grid: !1, + textLabel: !1, + gridLabel: !1, + }), + (this._styles = []), + (this._bezierDetail = 20), + (this._curveDetail = 20), + (this._colorMode = n.RGB), + (this._colorMaxes = { + rgb: [255, 255, 255, 255], + hsb: [360, 100, 100, 1], + hsl: [360, 100, 100, 1], + }), + (this._downKeys = {}); + }, + }, + { + key: "registerPreloadMethod", + value: function (e, t) { + g.prototype._preloadMethods.hasOwnProperty(e) || + (g.prototype._preloadMethods[e] = t); + }, + }, + { + key: "registerMethod", + value: function (e, t) { + var r = this || g.prototype; + r._registeredMethods.hasOwnProperty(e) || + (r._registeredMethods[e] = []), + r._registeredMethods[e].push(t); + }, + }, + { + key: "unregisterMethod", + value: function (e, t) { + var r = this || g.prototype; + if (r._registeredMethods.hasOwnProperty(e)) { + for ( + var o = r._registeredMethods[e], n = [], s = 0; + s < o.length; + s++ + ) + o[s] === t && n.push(s); + for (var i = n.length - 1; 0 <= i; i--) + o.splice(n[i], 1); + } + }, + }, + { + key: "_createFriendlyGlobalFunctionBinder", + value: function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : {}, + r = e.globalObject || window; + e.log || console.log.bind(console); + return function (e, t) { + g.disableFriendlyErrors, (r[e] = t); + }; + }, + }, + ]) && s(e.prototype, t), + r && s(e, r), + g + ); + })(); + for (l in ((u.instance = null), (u.disableFriendlyErrors = !1), n)) + u.prototype[l] = n[l]; + (u.VERSION = n.VERSION), + (u.prototype._preloadMethods = { + loadJSON: u.prototype, + loadImage: u.prototype, + loadStrings: u.prototype, + loadXML: u.prototype, + loadBytes: u.prototype, + loadTable: u.prototype, + loadFont: u.prototype, + loadModel: u.prototype, + loadShader: u.prototype, + }), + (u.prototype._registeredMethods = { + init: [], + pre: [], + post: [], + remove: [], + }), + (u.prototype._registeredPreloadMethods = {}), + (r.default = u); + }, + { + "./constants": 264, + "./shim": 286, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-own-property-names": 179, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 276: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (e = e("./main")) && e.__esModule ? e : { default: e }; + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + n.default.Element = (function () { + function r(e, t) { + if (!(this instanceof r)) + throw new TypeError("Cannot call a class as a function"); + (this.elt = e), + (this._pInst = this._pixelsState = t), + (this._events = {}), + (this.width = this.elt.offsetWidth), + (this.height = this.elt.offsetHeight); + } + var e, t, o; + return ( + (e = r), + (o = [ + { + key: "_adjustListener", + value: function (e, t, r) { + return ( + !1 === t + ? n.default.Element._detachListener(e, r) + : n.default.Element._attachListener(e, t, r), + this + ); + }, + }, + { + key: "_attachListener", + value: function (e, t, r) { + r._events[e] && n.default.Element._detachListener(e, r); + t = t.bind(r); + r.elt.addEventListener(e, t, !1), (r._events[e] = t); + }, + }, + { + key: "_detachListener", + value: function (e, t) { + var r = t._events[e]; + t.elt.removeEventListener(e, r, !1), (t._events[e] = null); + }, + }, + ]), + (t = [ + { + key: "parent", + value: function (e) { + return void 0 === e + ? this.elt.parentNode + : ("string" == typeof e + ? ("#" === e[0] && (e = e.substring(1)), + (e = document.getElementById(e))) + : e instanceof n.default.Element && (e = e.elt), + e.appendChild(this.elt), + this); + }, + }, + { + key: "id", + value: function (e) { + return void 0 === e + ? this.elt.id + : ((this.elt.id = e), + (this.width = this.elt.offsetWidth), + (this.height = this.elt.offsetHeight), + this); + }, + }, + { + key: "class", + value: function (e) { + return void 0 === e + ? this.elt.className + : ((this.elt.className = e), this); + }, + }, + { + key: "mousePressed", + value: function (t) { + return ( + n.default.Element._adjustListener( + "mousedown", + function (e) { + return ( + this._pInst._setProperty("mouseIsPressed", !0), + this._pInst._setMouseButton(e), + t.call(this, e) + ); + }, + this, + ), + this + ); + }, + }, + { + key: "doubleClicked", + value: function (e) { + return ( + n.default.Element._adjustListener("dblclick", e, this), + this + ); + }, + }, + { + key: "mouseWheel", + value: function (e) { + return ( + n.default.Element._adjustListener("wheel", e, this), this + ); + }, + }, + { + key: "mouseReleased", + value: function (e) { + return ( + n.default.Element._adjustListener("mouseup", e, this), + this + ); + }, + }, + { + key: "mouseClicked", + value: function (e) { + return ( + n.default.Element._adjustListener("click", e, this), this + ); + }, + }, + { + key: "mouseMoved", + value: function (e) { + return ( + n.default.Element._adjustListener("mousemove", e, this), + this + ); + }, + }, + { + key: "mouseOver", + value: function (e) { + return ( + n.default.Element._adjustListener("mouseover", e, this), + this + ); + }, + }, + { + key: "mouseOut", + value: function (e) { + return ( + n.default.Element._adjustListener("mouseout", e, this), + this + ); + }, + }, + { + key: "touchStarted", + value: function (e) { + return ( + n.default.Element._adjustListener("touchstart", e, this), + this + ); + }, + }, + { + key: "touchMoved", + value: function (e) { + return ( + n.default.Element._adjustListener("touchmove", e, this), + this + ); + }, + }, + { + key: "touchEnded", + value: function (e) { + return ( + n.default.Element._adjustListener("touchend", e, this), + this + ); + }, + }, + { + key: "dragOver", + value: function (e) { + return ( + n.default.Element._adjustListener("dragover", e, this), + this + ); + }, + }, + { + key: "dragLeave", + value: function (e) { + return ( + n.default.Element._adjustListener("dragleave", e, this), + this + ); + }, + }, + { + key: "_setProperty", + value: function (e, t) { + this[e] = t; + }, + }, + ]) && s(e.prototype, t), + o && s(e, o), + r + ); + })(); + e = n.default.Element; + r.default = e; + }, + { "./main": 275 }, + ], + 277: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.object.get-prototype-of"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var c = (u = e("./main")) && u.__esModule ? u : { default: u }, + d = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("./constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function s(e, t) { + return (s = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function h(r) { + return function () { + var e, + t = l(r); + return f( + this, + (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = l(this).constructor), + Reflect.construct(t, arguments, e)) + : t.apply(this, arguments), + ); + }; + } + function f(e, t) { + return !t || ("object" !== i(t) && "function" != typeof t) + ? p(e) + : t; + } + function p(e) { + if (void 0 === e) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return e; + } + function l(e) { + return (l = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + c.default.Graphics = (function (e) { + var t = u; + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && s(t, e); + var r, + l = h(u); + function u(e, t, r, o, n) { + var s; + if (!(this instanceof u)) + throw new TypeError("Cannot call a class as a function"); + (a = n || document.createElement("canvas")), + ((s = l.call(this, a, o)).canvas = a); + var i, + a = r || d.P2D, + r = o._userNode || document.body; + for (i in (n || r.appendChild(s.canvas), c.default.prototype)) + s[i] || + ("function" == typeof c.default.prototype[i] + ? (s[i] = c.default.prototype[i].bind(p(s))) + : (s[i] = c.default.prototype[i])); + return ( + c.default.prototype._initializeInstanceVariables.apply(p(s)), + (s.width = e), + (s.height = t), + (s._pixelDensity = o._pixelDensity), + a === d.WEBGL + ? (s._renderer = new c.default.RendererGL(s.canvas, p(s), !1)) + : (s._renderer = new c.default.Renderer2D( + s.canvas, + p(s), + !1, + )), + o._elements.push(p(s)), + Object.defineProperty(p(s), "deltaTime", { + get: function () { + return this._pInst.deltaTime; + }, + }), + s._renderer.resize(e, t), + s._renderer._applyDefaults(), + f(s, p(s)) + ); + } + return ( + (t = u), + (e = [ + { + key: "reset", + value: function () { + this._renderer.resetMatrix(), + this._renderer.isP3D && this._renderer._update(); + }, + }, + { + key: "remove", + value: function () { + this.elt.parentNode && + this.elt.parentNode.removeChild(this.elt); + var e, + t = this._pInst._elements.indexOf(this); + for (e in (-1 !== t && this._pInst._elements.splice(t, 1), + this._events)) + this.elt.removeEventListener(e, this._events[e]); + }, + }, + { + key: "createFramebuffer", + value: function (e) { + return new c.default.Framebuffer(this, e); + }, + }, + ]) && n(t.prototype, e), + r && n(t, r), + u + ); + })(c.default.Element); + var u = c.default.Graphics; + r.default = u; + }, + { + "./constants": 264, + "./main": 275, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 278: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var a = (s = e("./main")) && s.__esModule ? s : { default: s }, + P = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== l(e) && "function" != typeof e)) + return { default: e }; + var t = i(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function i() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (i = function () { + return e; + }), + e); + } + function l(e) { + return (l = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + function u(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function c(e, t) { + return (c = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function d(o) { + return function () { + var e, + t, + r = n(o); + return ( + (e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = n(this).constructor), + Reflect.construct(r, arguments, e)) + : r.apply(this, arguments)), + (r = this), + !(t = e) || ("object" !== l(t) && "function" != typeof t) + ? h(r) + : t + ); + }; + } + function h(e) { + if (void 0 === e) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return e; + } + function n(e) { + return (n = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + var s = (function (e) { + var t = s; + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && c(t, e); + var r, + n = d(s); + function s(e, t, r) { + var o; + if (this instanceof s) + return ( + ((o = n.call(this, e, t)).canvas = e), + (o._pixelsState = t), + r + ? ((o._isMainCanvas = !0), + o._pInst._setProperty("_curElement", h(o)), + o._pInst._setProperty("canvas", o.canvas), + o._pInst._setProperty("width", o.width), + o._pInst._setProperty("height", o.height)) + : ((o.canvas.style.display = "none"), (o._styles = [])), + (o._clipping = !1), + (o._clipInvert = !1), + (o._textSize = 12), + (o._textLeading = 15), + (o._textFont = "sans-serif"), + (o._textStyle = P.NORMAL), + (o._textAscent = null), + (o._textDescent = null), + (o._textAlign = P.LEFT), + (o._textBaseline = P.BASELINE), + (o._textWrap = P.WORD), + (o._rectMode = P.CORNER), + (o._ellipseMode = P.CENTER), + (o._curveTightness = 0), + (o._imageMode = P.CORNER), + (o._tint = null), + (o._doStroke = !0), + (o._doFill = !0), + (o._strokeSet = !1), + (o._fillSet = !1), + (o._leadingSet = !1), + (o._pushPopDepth = 0), + o + ); + throw new TypeError("Cannot call a class as a function"); + } + return ( + (t = s), + (e = [ + { + key: "push", + value: function () { + return ( + this._pushPopDepth++, + { + properties: { + _doStroke: this._doStroke, + _strokeSet: this._strokeSet, + _doFill: this._doFill, + _fillSet: this._fillSet, + _tint: this._tint, + _imageMode: this._imageMode, + _rectMode: this._rectMode, + _ellipseMode: this._ellipseMode, + _textFont: this._textFont, + _textLeading: this._textLeading, + _leadingSet: this._leadingSet, + _textSize: this._textSize, + _textAlign: this._textAlign, + _textBaseline: this._textBaseline, + _textStyle: this._textStyle, + _textWrap: this._textWrap, + }, + } + ); + }, + }, + { + key: "pop", + value: function (e) { + this._pushPopDepth--, + e.properties && Object.assign(this, e.properties); + }, + }, + { + key: "beginClip", + value: function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : {}; + if (this._clipping) + throw new Error( + "It looks like you're trying to clip while already in the middle of clipping. Did you forget to endClip()?", + ); + (this._clipping = !0), (this._clipInvert = e.invert); + }, + }, + { + key: "endClip", + value: function () { + if (!this._clipping) + throw new Error( + "It looks like you've called endClip() without beginClip(). Did you forget to call beginClip() first?", + ); + this._clipping = !1; + }, + }, + { + key: "resize", + value: function (e, t) { + (this.width = e), + (this.height = t), + (this.elt.width = e * this._pInst._pixelDensity), + (this.elt.height = t * this._pInst._pixelDensity), + (this.elt.style.width = "".concat(e, "px")), + (this.elt.style.height = "".concat(t, "px")), + this._isMainCanvas && + (this._pInst._setProperty("width", this.width), + this._pInst._setProperty("height", this.height)); + }, + }, + { + key: "get", + value: function (e, t, r, o) { + var n = this._pixelsState, + s = n._pixelDensity, + i = this.canvas; + if (void 0 === e && void 0 === t) + (e = t = 0), (r = n.width), (o = n.height); + else if (((e *= s), (t *= s), void 0 === r && void 0 === o)) + return e < 0 || t < 0 || e >= i.width || t >= i.height + ? [0, 0, 0, 0] + : this._getPixel(e, t); + n = new a.default.Image(r * s, o * s); + return ( + n.pixelDensity(s), + n.canvas + .getContext("2d") + .drawImage(i, e, t, r * s, o * s, 0, 0, r * s, o * s), + n + ); + }, + }, + { + key: "textLeading", + value: function (e) { + return "number" == typeof e + ? (this._setProperty("_leadingSet", !0), + this._setProperty("_textLeading", e), + this._pInst) + : this._textLeading; + }, + }, + { + key: "textStyle", + value: function (e) { + return e + ? ((e !== P.NORMAL && + e !== P.ITALIC && + e !== P.BOLD && + e !== P.BOLDITALIC) || + this._setProperty("_textStyle", e), + this._applyTextProperties()) + : this._textStyle; + }, + }, + { + key: "textAscent", + value: function () { + return ( + null === this._textAscent && this._updateTextMetrics(), + this._textAscent + ); + }, + }, + { + key: "textDescent", + value: function () { + return ( + null === this._textDescent && this._updateTextMetrics(), + this._textDescent + ); + }, + }, + { + key: "textAlign", + value: 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, + }; + }, + }, + { + key: "textWrap", + value: function (e) { + return this._setProperty("_textWrap", e), this._textWrap; + }, + }, + { + key: "text", + value: function (e, t, r, o, n) { + var s, + i, + a, + l, + u = this._pInst, + c = this._textWrap, + d = Number.MAX_VALUE, + h = r; + if ((this._doFill || this._doStroke) && void 0 !== e) { + if ( + ((s = (e = (e = + "string" != typeof e ? e.toString() : e).replace( + /(\t)/g, + " ", + )).split("\n")), + void 0 !== o) + ) { + switch ( + (this._rectMode === P.CENTER && (t -= o / 2), + this._textAlign) + ) { + case P.CENTER: + t += o / 2; + break; + case P.RIGHT: + t += o; + } + if (void 0 !== n) { + this._rectMode === P.CENTER && + ((r -= n / 2), (h -= n / 2)); + var e = r, + f = u.textAscent(); + switch (this._textBaseline) { + case P.BOTTOM: + (l = r + n), (r = Math.max(l, r)), (h += f); + break; + case P.CENTER: + (l = r + n / 2), + (r = Math.max(l, r)), + (h += f / 2); + } + (d = r + n - f), + this._textBaseline === P.CENTER && + (d = e + n - f / 2); + } else + (this._textBaseline !== P.BOTTOM && + this._textBaseline !== P.CENTER) || + ((h = + r - (e = u.textSize() * this._textLeading) / 2), + (d = r + e / 2)); + if (c === P.WORD) { + for (var p = [], m = 0; m < s.length; m++) { + for ( + var y = "", g = s[m].split(" "), v = 0; + v < g.length; + v++ + ) + (i = "".concat(y + g[v]) + " "), + (y = + o < (a = this.textWidth(i)) && 0 < y.length + ? (p.push(y), "".concat(g[v]) + " ") + : i); + p.push(y); + } + var b = 0; + this._textBaseline === P.CENTER + ? (b = ((p.length - 1) * u.textLeading()) / 2) + : this._textBaseline === P.BOTTOM && + (b = (p.length - 1) * u.textLeading()); + for (var j = 0; j < s.length; j++) { + (y = ""), (g = s[j].split(" ")); + for (var _ = 0; _ < g.length; _++) + (i = "".concat(y + g[_]) + " "), + o < (a = this.textWidth(i)) && 0 < y.length + ? (this._renderText( + u, + y.trim(), + t, + r - b, + d, + h, + ), + (y = "".concat(g[_]) + " "), + (r += u.textLeading())) + : (y = i); + this._renderText(u, y.trim(), t, r - b, d, h), + (r += u.textLeading()); + } + } else { + for (var x = [], w = 0; w < s.length; w++) + for ( + var S = s[w].split((y = "")), T = 0; + T < S.length; + T++ + ) + (i = "".concat(y + S[T])), + (a = this.textWidth(i)) <= o + ? (y += S[T]) + : o < a && + 0 < y.length && + (x.push(y), (y = "".concat(S[T]))); + x.push(y); + var M = 0; + this._textBaseline === P.CENTER + ? (M = ((x.length - 1) * u.textLeading()) / 2) + : this._textBaseline === P.BOTTOM && + (M = (x.length - 1) * u.textLeading()); + for (var E = 0; E < s.length; E++) { + S = s[E].split((y = "")); + for (var k = 0; k < S.length; k++) + (i = "".concat(y + S[k])), + (a = this.textWidth(i)) <= o + ? (y += S[k]) + : o < a && + 0 < y.length && + (this._renderText( + u, + y.trim(), + t, + r - M, + d, + h, + ), + (r += u.textLeading()), + (y = "".concat(S[k]))); + } + this._renderText(u, y.trim(), t, r - M, d, h), + (r += u.textLeading()); + } + } else { + var C = 0; + this._textBaseline === P.CENTER + ? (C = ((s.length - 1) * u.textLeading()) / 2) + : this._textBaseline === P.BOTTOM && + (C = (s.length - 1) * u.textLeading()); + for (var O = 0; O < s.length; O++) + this._renderText(u, s[O], t, r - C, d, h - C), + (r += u.textLeading()); + } + return u; + } + }, + }, + { + key: "_applyDefaults", + value: function () { + return this; + }, + }, + { + key: "_isOpenType", + value: function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : this._textFont; + return "object" === l(e) && e.font && e.font.supported; + }, + }, + { + key: "_updateTextMetrics", + value: function () { + var e, t, r, o, n, s; + return ( + this._isOpenType() + ? (this._setProperty( + "_textAscent", + this._textFont._textAscent(), + ), + this._setProperty( + "_textDescent", + this._textFont._textDescent(), + )) + : (((e = + document.createElement("span")).style.fontFamily = + this._textFont), + (e.style.fontSize = "".concat(this._textSize, "px")), + (e.innerHTML = "ABCjgq|"), + ((s = document.createElement("div")).style.display = + "inline-block"), + (s.style.width = "1px"), + (s.style.height = "0px"), + (o = + ((t = document.createElement("div")).appendChild(e), + t.appendChild(s), + (t.style.height = "0px"), + (t.style.overflow = "hidden"), + document.body.appendChild(t), + (s.style.verticalAlign = "baseline"), + f(s))), + (n = f(e)), + (r = o[1] - n[1]), + (o = ((s.style.verticalAlign = "bottom"), f(s))), + (n = f(e)), + (s = o[1] - n[1] - r), + document.body.removeChild(t), + this._setProperty("_textAscent", r), + this._setProperty("_textDescent", s)), + this + ); + }, + }, + ]) && u(t.prototype, e), + r && u(t, r), + s + ); + })(a.default.Element); + function f(e) { + var t = 0, + r = 0; + if (e.offsetParent) + for ( + ; + (t += e.offsetLeft), (r += e.offsetTop), (e = e.offsetParent); + + ); + else (t += e.offsetLeft), (r += e.offsetTop); + return [t, r]; + } + (s.prototype.textSize = function (e) { + return "number" == typeof e + ? (this._setProperty("_textSize", e), + this._leadingSet || + this._setProperty("_textLeading", e * P._DEFAULT_LEADMULT), + this._applyTextProperties()) + : this._textSize; + }), + (a.default.Renderer = s); + e = a.default.Renderer; + r.default = e; + }, + { + "../core/constants": 264, + "./main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.number.constructor": 173, + "core-js/modules/es.object.assign": 176, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.trim": 201, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 279: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.reflect.get"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var d = (n = e("./main")) && n.__esModule ? n : { default: n }, + p = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("./constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function l(e, t, r) { + return (l = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (e, t, r) { + var e = (function (e, t) { + for ( + ; + !Object.prototype.hasOwnProperty.call(e, t) && + null !== (e = h(e)); + + ); + return e; + })(e, t); + if (e) + return (e = Object.getOwnPropertyDescriptor(e, t)).get + ? e.get.call(r) + : e.value; + })(e, t, r || e); + } + function u(e, t) { + return (u = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function c(r) { + return function () { + var e, + t = h(r), + t = + ((e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = h(this).constructor), + Reflect.construct(t, arguments, e)) + : t.apply(this, arguments)), + this); + if (!e || ("object" !== i(e) && "function" != typeof e)) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return e; + }; + } + function h(e) { + return (h = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + e("./p5.Renderer"); + var f = "rgba(0,0,0,0)", + n = (function (e) { + var t = n; + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && u(t, e); + var r, + o = c(n); + function n(e, t, r) { + if (this instanceof n) + return ( + ((e = o.call(this, e, t, r)).drawingContext = + e.canvas.getContext("2d")), + e._pInst._setProperty("drawingContext", e.drawingContext), + e + ); + throw new TypeError("Cannot call a class as a function"); + } + return ( + (t = n), + (e = [ + { + key: "getFilterGraphicsLayer", + value: function () { + var e; + return ( + this.filterGraphicsLayer || + ((e = ( + this._pInst instanceof d.default.Graphics + ? this._pInst + : this + )._pInst), + (this.filterGraphicsLayer = new d.default.Graphics( + this.width, + this.height, + p.WEBGL, + e, + ))), + (this.filterGraphicsLayer.width === this.width && + this.filterGraphicsLayer.height === this.height) || + this.filterGraphicsLayer.resizeCanvas( + this.width, + this.height, + ), + this.filterGraphicsLayer.pixelDensity() !== + this._pInst.pixelDensity() && + this.filterGraphicsLayer.pixelDensity( + this._pInst.pixelDensity(), + ), + this.filterGraphicsLayer + ); + }, + }, + { + key: "_applyDefaults", + value: function () { + (this._cachedFillStyle = this._cachedStrokeStyle = + void 0), + (this._cachedBlendMode = p.BLEND), + this._setFill(p._DEFAULT_FILL), + this._setStroke(p._DEFAULT_STROKE), + (this.drawingContext.lineCap = p.ROUND), + (this.drawingContext.font = "normal 12px sans-serif"); + }, + }, + { + key: "resize", + value: function (e, t) { + l(h(n.prototype), "resize", this).call(this, e, t), + this.drawingContext.scale( + this._pInst._pixelDensity, + this._pInst._pixelDensity, + ); + }, + }, + { + key: "background", + value: function () { + var e, t; + this.drawingContext.save(), + this.resetMatrix(), + (arguments.length <= 0 + ? void 0 + : arguments[0]) instanceof d.default.Image + ? 0 <= (arguments.length <= 1 ? void 0 : arguments[1]) + ? ((e = + arguments.length <= 0 ? void 0 : arguments[0]), + (this.drawingContext.globalAlpha = + (arguments.length <= 1 + ? void 0 + : arguments[1]) / 255), + this._pInst.image( + e, + 0, + 0, + this.width, + this.height, + )) + : this._pInst.image( + arguments.length <= 0 ? void 0 : arguments[0], + 0, + 0, + this.width, + this.height, + ) + : ((e = this._getFill()), + (t = (t = this._pInst).color.apply(t, arguments)), + this._pInst._addAccsOutput() && + this._pInst._accsBackground(t.levels), + (t = t.toString()), + this._setFill(t), + this._isErasing && + this.blendMode(this._cachedBlendMode), + this.drawingContext.fillRect( + 0, + 0, + this.width, + this.height, + ), + this._setFill(e), + this._isErasing && this._pInst.erase()), + this.drawingContext.restore(); + }, + }, + { + key: "clear", + value: function () { + this.drawingContext.save(), + this.resetMatrix(), + this.drawingContext.clearRect( + 0, + 0, + this.width, + this.height, + ), + this.drawingContext.restore(); + }, + }, + { + key: "fill", + value: function () { + var e = (e = this._pInst).color.apply(e, arguments); + this._setFill(e.toString()), + this._pInst._addAccsOutput() && + this._pInst._accsCanvasColors("fill", e.levels); + }, + }, + { + key: "stroke", + value: function () { + var e = (e = this._pInst).color.apply(e, arguments); + this._setStroke(e.toString()), + this._pInst._addAccsOutput() && + this._pInst._accsCanvasColors("stroke", e.levels); + }, + }, + { + key: "erase", + value: function (e, t) { + this._isErasing || + ((this._cachedFillStyle = + this.drawingContext.fillStyle), + (e = this._pInst.color(255, e).toString()), + (this.drawingContext.fillStyle = e), + (this._cachedStrokeStyle = + this.drawingContext.strokeStyle), + (e = this._pInst.color(255, t).toString()), + (this.drawingContext.strokeStyle = e), + (t = this._cachedBlendMode), + this.blendMode(p.REMOVE), + (this._cachedBlendMode = t), + (this._isErasing = !0)); + }, + }, + { + key: "noErase", + value: function () { + this._isErasing && + ((this.drawingContext.fillStyle = + this._cachedFillStyle), + (this.drawingContext.strokeStyle = + this._cachedStrokeStyle), + this.blendMode(this._cachedBlendMode), + (this._isErasing = !1)); + }, + }, + { + key: "beginClip", + value: function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : {}, + e = + (l(h(n.prototype), "beginClip", this).call(this, e), + (this._cachedFillStyle = + this.drawingContext.fillStyle), + this._pInst.color(255, 0).toString()), + e = + ((this.drawingContext.fillStyle = e), + (this._cachedStrokeStyle = + this.drawingContext.strokeStyle), + this._pInst.color(255, 0).toString()), + e = + ((this.drawingContext.strokeStyle = e), + this._cachedBlendMode); + this.blendMode(p.BLEND), + (this._cachedBlendMode = e), + this.drawingContext.beginPath(), + this._clipInvert && + (this.drawingContext.moveTo( + -2 * this.width, + -2 * this.height, + ), + this.drawingContext.lineTo( + -2 * this.width, + 2 * this.height, + ), + this.drawingContext.lineTo( + 2 * this.width, + 2 * this.height, + ), + this.drawingContext.lineTo( + 2 * this.width, + -2 * this.height, + ), + this.drawingContext.closePath()); + }, + }, + { + key: "endClip", + value: function () { + this._doFillStrokeClose(), + this.drawingContext.clip(), + l(h(n.prototype), "endClip", this).call(this), + (this.drawingContext.fillStyle = this._cachedFillStyle), + (this.drawingContext.strokeStyle = + this._cachedStrokeStyle), + this.blendMode(this._cachedBlendMode); + }, + }, + { + key: "image", + value: function (e, t, r, o, n, s, i, a, l) { + e.gifProperties && e._animateGif(this._pInst); + try { + d.default.MediaElement && + e instanceof d.default.MediaElement && + e._ensureCanvas(); + var u = + (u = + this._tint && e.canvas + ? this._getTintedImageCanvas(e) + : u) || + e.canvas || + e.elt, + c = 1; + e.width && 0 < e.width && (c = u.width / e.width), + this._isErasing && + this.blendMode(this._cachedBlendMode), + this.drawingContext.drawImage( + u, + c * t, + c * r, + c * o, + c * n, + s, + i, + a, + l, + ), + this._isErasing && this._pInst.erase(); + } catch (e) { + if ("NS_ERROR_NOT_AVAILABLE" !== e.name) throw e; + } + }, + }, + { + key: "_getTintedImageCanvas", + value: function (e) { + if (!e.canvas) return e; + e.tintCanvas || + (e.tintCanvas = document.createElement("canvas")), + e.tintCanvas.width !== e.canvas.width && + (e.tintCanvas.width = e.canvas.width), + e.tintCanvas.height !== e.canvas.height && + (e.tintCanvas.height = e.canvas.height); + var t = e.tintCanvas.getContext("2d"); + return ( + t.save(), + t.clearRect(0, 0, e.canvas.width, e.canvas.height), + (this._tint[0] < 255 || + this._tint[1] < 255 || + this._tint[2] < 255) && + (t.drawImage(e.canvas, 0, 0), + (t.globalCompositeOperation = "luminosity"), + t.drawImage(e.canvas, 0, 0), + (t.globalCompositeOperation = "color"), + t.drawImage(e.canvas, 0, 0), + (t.globalCompositeOperation = "multiply"), + (t.fillStyle = "rgb(".concat( + this._tint.slice(0, 3).join(", "), + ")", + )), + t.fillRect(0, 0, e.canvas.width, e.canvas.height), + (t.globalCompositeOperation = "destination-in")), + (t.globalAlpha = this._tint[3] / 255), + t.drawImage(e.canvas, 0, 0), + t.restore(), + e.tintCanvas + ); + }, + }, + { + key: "blendMode", + value: function (e) { + if (e === p.SUBTRACT) + console.warn( + "blendMode(SUBTRACT) only works in WEBGL mode.", + ); + else { + if ( + e !== p.BLEND && + e !== p.REMOVE && + e !== p.DARKEST && + e !== p.LIGHTEST && + e !== p.DIFFERENCE && + e !== p.MULTIPLY && + e !== p.EXCLUSION && + e !== p.SCREEN && + e !== p.REPLACE && + e !== p.OVERLAY && + e !== p.HARD_LIGHT && + e !== p.SOFT_LIGHT && + e !== p.DODGE && + e !== p.BURN && + e !== p.ADD + ) + throw new Error( + "Mode ".concat(e, " not recognized."), + ); + (this._cachedBlendMode = e), + (this.drawingContext.globalCompositeOperation = e); + } + }, + }, + { + key: "blend", + value: function () { + for ( + var e = this.drawingContext.globalCompositeOperation, + t = arguments.length, + r = new Array(t), + o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + var n = r[r.length - 1], + s = Array.prototype.slice.call(r, 0, r.length - 1); + (this.drawingContext.globalCompositeOperation = n), + d.default.prototype.copy.apply(this, s), + (this.drawingContext.globalCompositeOperation = e); + }, + }, + { + key: "_getPixel", + value: function (e, t) { + e = this.drawingContext.getImageData(e, t, 1, 1).data; + return [e[0], e[1], e[2], e[3]]; + }, + }, + { + key: "loadPixels", + value: function () { + var e = this._pixelsState, + t = e._pixelDensity, + r = this.width * t, + t = this.height * t, + r = this.drawingContext.getImageData(0, 0, r, t); + e._setProperty("imageData", r), + e._setProperty("pixels", r.data); + }, + }, + { + key: "set", + value: function (e, t, r) { + (e = Math.floor(e)), (t = Math.floor(t)); + var o = this._pixelsState; + if (r instanceof d.default.Image) + this.drawingContext.save(), + this.drawingContext.setTransform(1, 0, 0, 1, 0, 0), + this.drawingContext.scale( + o._pixelDensity, + o._pixelDensity, + ), + this.drawingContext.clearRect( + e, + t, + r.width, + r.height, + ), + this.drawingContext.drawImage(r.canvas, e, t), + this.drawingContext.restore(); + else { + var n = 0, + s = 0, + i = 0, + a = 0, + l = + 4 * + (t * + o._pixelDensity * + (this.width * o._pixelDensity) + + e * o._pixelDensity); + if ( + (o.imageData || o.loadPixels.call(o), + "number" == typeof r) + ) + l < o.pixels.length && ((i = s = n = r), (a = 255)); + else if (r instanceof Array) { + if (r.length < 4) + throw new Error( + "pixel array must be of the form [R, G, B, A]", + ); + l < o.pixels.length && + ((n = r[0]), (s = r[1]), (i = r[2]), (a = r[3])); + } else + r instanceof d.default.Color && + l < o.pixels.length && + ((n = r.levels[0]), + (s = r.levels[1]), + (i = r.levels[2]), + (a = r.levels[3])); + for (var u = 0; u < o._pixelDensity; u++) + for (var c = 0; c < o._pixelDensity; c++) + (l = + 4 * + ((t * o._pixelDensity + c) * + this.width * + o._pixelDensity + + (e * o._pixelDensity + u))), + (o.pixels[l] = n), + (o.pixels[l + 1] = s), + (o.pixels[l + 2] = i), + (o.pixels[l + 3] = a); + } + }, + }, + { + key: "updatePixels", + value: function (e, t, r, o) { + var n = this._pixelsState, + s = n._pixelDensity; + void 0 === e && + void 0 === t && + void 0 === r && + void 0 === o && + ((t = e = 0), (r = this.width), (o = this.height)), + (e *= s), + (t *= s), + (r *= s), + (o *= s), + this.gifProperties && + (this.gifProperties.frames[ + this.gifProperties.displayIndex + ].image = n.imageData), + this.drawingContext.putImageData( + n.imageData, + e, + t, + 0, + 0, + r, + o, + ); + }, + }, + { + key: "_acuteArcToBezier", + value: function (e, t) { + var r = t / 2, + o = Math.cos(r), + n = Math.sin(r), + s = 1 / Math.tan(r), + r = e + r, + i = Math.cos(r), + r = Math.sin(r), + a = (4 - o) / 3, + n = n + (o - a) * s; + return { + ax: Math.cos(e).toFixed(7), + ay: Math.sin(e).toFixed(7), + bx: (a * i + n * r).toFixed(7), + by: (a * r - n * i).toFixed(7), + cx: (a * i - n * r).toFixed(7), + cy: (a * r + n * i).toFixed(7), + dx: Math.cos(e + t).toFixed(7), + dy: Math.sin(e + t).toFixed(7), + }; + }, + }, + { + key: "arc", + value: function (r, o, e, t, n, s, i) { + var a, + l = this.drawingContext, + u = e / 2, + c = t / 2, + d = []; + for (r += u, o += c; 1e-5 <= s - n; ) + (a = Math.min(s - n, p.HALF_PI)), + d.push(this._acuteArcToBezier(n, a)), + (n += a); + return ( + this._doFill && + (this._clipping || l.beginPath(), + d.forEach(function (e, t) { + 0 === t && l.moveTo(r + e.ax * u, o + e.ay * c), + l.bezierCurveTo( + r + e.bx * u, + o + e.by * c, + r + e.cx * u, + o + e.cy * c, + r + e.dx * u, + o + e.dy * c, + ); + }), + (i !== p.PIE && null != i) || l.lineTo(r, o), + l.closePath(), + this._clipping || l.fill()), + this._doStroke && + (this._clipping || l.beginPath(), + d.forEach(function (e, t) { + 0 === t && l.moveTo(r + e.ax * u, o + e.ay * c), + l.bezierCurveTo( + r + e.bx * u, + o + e.by * c, + r + e.cx * u, + o + e.cy * c, + r + e.dx * u, + o + e.dy * c, + ); + }), + i === p.PIE + ? (l.lineTo(r, o), l.closePath()) + : i === p.CHORD && l.closePath(), + this._clipping || l.stroke()), + this + ); + }, + }, + { + key: "ellipse", + value: function (e) { + var t = this.drawingContext, + r = this._doFill, + o = this._doStroke, + n = parseFloat(e[0]), + s = parseFloat(e[1]), + i = parseFloat(e[2]), + e = parseFloat(e[3]); + if (r && !o) { + if (this._getFill() === f) return this; + } else if (!r && o && this._getStroke() === f) + return this; + var a = (i / 2) * 0.5522847498, + l = (e / 2) * 0.5522847498, + u = n + i, + c = s + e, + i = n + i / 2, + e = s + e / 2; + this._clipping || t.beginPath(), + t.moveTo(n, e), + t.bezierCurveTo(n, e - l, i - a, s, i, s), + t.bezierCurveTo(i + a, s, u, e - l, u, e), + t.bezierCurveTo(u, e + l, i + a, c, i, c), + t.bezierCurveTo(i - a, c, n, e + l, n, e), + !this._clipping && r && t.fill(), + !this._clipping && o && t.stroke(); + }, + }, + { + key: "line", + value: function (e, t, r, o) { + var n = this.drawingContext; + return ( + this._doStroke && + this._getStroke() !== f && + (this._clipping || n.beginPath(), + n.moveTo(e, t), + n.lineTo(r, o), + n.stroke()), + this + ); + }, + }, + { + key: "point", + value: function (e, t) { + var r, + o, + n = this.drawingContext; + return !this._doStroke || this._getStroke() === f + ? this + : ((r = this._getStroke()), + (o = this._getFill()), + this._clipping || this._setFill(r), + this._clipping || n.beginPath(), + n.arc(e, t, n.lineWidth / 2, 0, p.TWO_PI, !1), + void ( + this._clipping || (n.fill(), this._setFill(o)) + )); + }, + }, + { + key: "quad", + value: function (e, t, r, o, n, s, i, a) { + var l = this.drawingContext, + u = this._doFill, + c = this._doStroke; + if (u && !c) { + if (this._getFill() === f) return this; + } else if (!u && c && this._getStroke() === f) + return this; + return ( + this._clipping || l.beginPath(), + l.moveTo(e, t), + l.lineTo(r, o), + l.lineTo(n, s), + l.lineTo(i, a), + l.closePath(), + !this._clipping && u && l.fill(), + !this._clipping && c && l.stroke(), + this + ); + }, + }, + { + key: "rect", + value: function (e) { + var t, + r, + o = e[0], + n = e[1], + s = e[2], + i = e[3], + a = e[4], + l = e[5], + u = e[6], + e = e[7], + c = this.drawingContext, + d = this._doFill, + h = this._doStroke; + if (d && !h) { + if (this._getFill() === f) return this; + } else if (!d && h && this._getStroke() === f) + return this; + return ( + this._clipping || c.beginPath(), + void 0 === a + ? c.rect(o, n, s, i) + : (void 0 === l && (l = a), + void 0 === u && (u = l), + void 0 === e && (e = u), + (h = (d = Math.abs(s)) / 2), + (r = (t = Math.abs(i)) / 2), + t < 2 * (a = d < 2 * a ? h : a) && (a = r), + t < 2 * (l = d < 2 * l ? h : l) && (l = r), + t < 2 * (u = d < 2 * u ? h : u) && (u = r), + t < 2 * (e = d < 2 * e ? h : e) && (e = r), + this._clipping || c.beginPath(), + c.moveTo(o + a, n), + c.arcTo(o + s, n, o + s, n + i, l), + c.arcTo(o + s, n + i, o, n + i, u), + c.arcTo(o, n + i, o, n, e), + c.arcTo(o, n, o + s, n, a), + c.closePath()), + !this._clipping && this._doFill && c.fill(), + !this._clipping && this._doStroke && c.stroke(), + this + ); + }, + }, + { + key: "triangle", + value: function (e) { + var t = this.drawingContext, + r = this._doFill, + o = this._doStroke, + n = e[0], + s = e[1], + i = e[2], + a = e[3], + l = e[4], + e = e[5]; + if (r && !o) { + if (this._getFill() === f) return this; + } else if (!r && o && this._getStroke() === f) + return this; + this._clipping || t.beginPath(), + t.moveTo(n, s), + t.lineTo(i, a), + t.lineTo(l, e), + t.closePath(), + !this._clipping && r && t.fill(), + !this._clipping && o && t.stroke(); + }, + }, + { + key: "endShape", + value: function (e, t, r, o, n, s, i) { + if (0 !== t.length && (this._doStroke || this._doFill)) { + var a, + l, + u, + c = e === p.CLOSE, + d = (c && !s && t.push(t[0]), t.length); + if (r && null === i) { + if (3 < d) { + var h = [], + f = 1 - this._curveTightness; + for ( + this._clipping || this.drawingContext.beginPath(), + this.drawingContext.moveTo(t[1][0], t[1][1]), + l = 1; + l + 2 < d; + l++ + ) + (a = t[l]), + (h[0] = [a[0], a[1]]), + (h[1] = [ + a[0] + + (f * t[l + 1][0] - f * t[l - 1][0]) / 6, + a[1] + + (f * t[l + 1][1] - f * t[l - 1][1]) / 6, + ]), + (h[2] = [ + t[l + 1][0] + + (f * t[l][0] - f * t[l + 2][0]) / 6, + t[l + 1][1] + + (f * t[l][1] - f * t[l + 2][1]) / 6, + ]), + (h[3] = [t[l + 1][0], t[l + 1][1]]), + this.drawingContext.bezierCurveTo( + h[1][0], + h[1][1], + h[2][0], + h[2][1], + h[3][0], + h[3][1], + ); + c && + this.drawingContext.lineTo( + t[l + 1][0], + t[l + 1][1], + ), + this._doFillStrokeClose(c); + } + } else if (o && null === i) { + for ( + this._clipping || this.drawingContext.beginPath(), + l = 0; + l < d; + l++ + ) + t[l].isVert + ? t[l].moveTo + ? this.drawingContext.moveTo(t[l][0], t[l][1]) + : this.drawingContext.lineTo(t[l][0], t[l][1]) + : this.drawingContext.bezierCurveTo( + t[l][0], + t[l][1], + t[l][2], + t[l][3], + t[l][4], + t[l][5], + ); + this._doFillStrokeClose(c); + } else if (n && null === i) { + for ( + this._clipping || this.drawingContext.beginPath(), + l = 0; + l < d; + l++ + ) + t[l].isVert + ? t[l].moveTo + ? this.drawingContext.moveTo(t[l][0], t[l][1]) + : this.drawingContext.lineTo(t[l][0], t[l][1]) + : this.drawingContext.quadraticCurveTo( + t[l][0], + t[l][1], + t[l][2], + t[l][3], + ); + this._doFillStrokeClose(c); + } else if (i === p.POINTS) + for (l = 0; l < d; l++) + (a = t[l]), + this._doStroke && this._pInst.stroke(a[6]), + this._pInst.point(a[0], a[1]); + else if (i === p.LINES) + for (l = 0; l + 1 < d; l += 2) + (a = t[l]), + this._doStroke && this._pInst.stroke(t[l + 1][6]), + this._pInst.line( + a[0], + a[1], + t[l + 1][0], + t[l + 1][1], + ); + else if (i === p.TRIANGLES) + for (l = 0; l + 2 < d; l += 3) + (a = t[l]), + this._clipping || this.drawingContext.beginPath(), + this.drawingContext.moveTo(a[0], a[1]), + this.drawingContext.lineTo( + t[l + 1][0], + t[l + 1][1], + ), + this.drawingContext.lineTo( + t[l + 2][0], + t[l + 2][1], + ), + this.drawingContext.closePath(), + !this._clipping && + this._doFill && + (this._pInst.fill(t[l + 2][5]), + this.drawingContext.fill()), + !this._clipping && + this._doStroke && + (this._pInst.stroke(t[l + 2][6]), + this.drawingContext.stroke()); + else if (i === p.TRIANGLE_STRIP) + for (l = 0; l + 1 < d; l++) + (a = t[l]), + this._clipping || this.drawingContext.beginPath(), + this.drawingContext.moveTo( + t[l + 1][0], + t[l + 1][1], + ), + this.drawingContext.lineTo(a[0], a[1]), + !this._clipping && + this._doStroke && + this._pInst.stroke(t[l + 1][6]), + !this._clipping && + this._doFill && + this._pInst.fill(t[l + 1][5]), + l + 2 < d && + (this.drawingContext.lineTo( + t[l + 2][0], + t[l + 2][1], + ), + !this._clipping && + this._doStroke && + this._pInst.stroke(t[l + 2][6]), + !this._clipping && + this._doFill && + this._pInst.fill(t[l + 2][5])), + this._doFillStrokeClose(c); + else if (i === p.TRIANGLE_FAN) { + if (2 < d) { + for ( + this._clipping || this.drawingContext.beginPath(), + l = 2; + l < d; + l++ + ) + (a = t[l]), + this.drawingContext.moveTo(t[0][0], t[0][1]), + this.drawingContext.lineTo( + t[l - 1][0], + t[l - 1][1], + ), + this.drawingContext.lineTo(a[0], a[1]), + this.drawingContext.lineTo(t[0][0], t[0][1]), + l < d - 1 && + ((this._doFill && a[5] !== t[l + 1][5]) || + (this._doStroke && a[6] !== t[l + 1][6])) && + (!this._clipping && + this._doFill && + (this._pInst.fill(a[5]), + this.drawingContext.fill(), + this._pInst.fill(t[l + 1][5])), + !this._clipping && + this._doStroke && + (this._pInst.stroke(a[6]), + this.drawingContext.stroke(), + this._pInst.stroke(t[l + 1][6])), + this.drawingContext.closePath(), + this._clipping || + this.drawingContext.beginPath()); + this._doFillStrokeClose(c); + } + } else if (i === p.QUADS) + for (l = 0; l + 3 < d; l += 4) { + for ( + a = t[l], + this._clipping || + this.drawingContext.beginPath(), + this.drawingContext.moveTo(a[0], a[1]), + u = 1; + u < 4; + u++ + ) + this.drawingContext.lineTo( + t[l + u][0], + t[l + u][1], + ); + this.drawingContext.lineTo(a[0], a[1]), + !this._clipping && + this._doFill && + this._pInst.fill(t[l + 3][5]), + !this._clipping && + this._doStroke && + this._pInst.stroke(t[l + 3][6]), + this._doFillStrokeClose(c); + } + else if (i === p.QUAD_STRIP) { + if (3 < d) + for (l = 0; l + 1 < d; l += 2) + (a = t[l]), + this._clipping || + this.drawingContext.beginPath(), + l + 3 < d + ? (this.drawingContext.moveTo( + t[l + 2][0], + t[l + 2][1], + ), + this.drawingContext.lineTo(a[0], a[1]), + this.drawingContext.lineTo( + t[l + 1][0], + t[l + 1][1], + ), + this.drawingContext.lineTo( + t[l + 3][0], + t[l + 3][1], + ), + !this._clipping && + this._doFill && + this._pInst.fill(t[l + 3][5]), + !this._clipping && + this._doStroke && + this._pInst.stroke(t[l + 3][6])) + : (this.drawingContext.moveTo(a[0], a[1]), + this.drawingContext.lineTo( + t[l + 1][0], + t[l + 1][1], + )), + this._doFillStrokeClose(c); + } else { + for ( + this._clipping || this.drawingContext.beginPath(), + this.drawingContext.moveTo(t[0][0], t[0][1]), + l = 1; + l < d; + l++ + ) + (a = t[l]).isVert && + (a.moveTo + ? (c && this.drawingContext.closePath(), + this.drawingContext.moveTo(a[0], a[1])) + : this.drawingContext.lineTo(a[0], a[1])); + this._doFillStrokeClose(c); + } + (s = n = o = r = !1), c && t.pop(); + } + return this; + }, + }, + { + key: "strokeCap", + value: function (e) { + return ( + (e !== p.ROUND && e !== p.SQUARE && e !== p.PROJECT) || + (this.drawingContext.lineCap = e), + this + ); + }, + }, + { + key: "strokeJoin", + value: function (e) { + return ( + (e !== p.ROUND && e !== p.BEVEL && e !== p.MITER) || + (this.drawingContext.lineJoin = e), + this + ); + }, + }, + { + key: "strokeWeight", + value: function (e) { + return ( + (this.drawingContext.lineWidth = + void 0 === e || 0 === e ? 1e-4 : e), + this + ); + }, + }, + { + key: "_getFill", + value: function () { + return ( + this._cachedFillStyle || + (this._cachedFillStyle = + this.drawingContext.fillStyle), + this._cachedFillStyle + ); + }, + }, + { + key: "_setFill", + value: function (e) { + e !== this._cachedFillStyle && + ((this.drawingContext.fillStyle = e), + (this._cachedFillStyle = e)); + }, + }, + { + key: "_getStroke", + value: function () { + return ( + this._cachedStrokeStyle || + (this._cachedStrokeStyle = + this.drawingContext.strokeStyle), + this._cachedStrokeStyle + ); + }, + }, + { + key: "_setStroke", + value: function (e) { + e !== this._cachedStrokeStyle && + ((this.drawingContext.strokeStyle = e), + (this._cachedStrokeStyle = e)); + }, + }, + { + key: "bezier", + value: function (e, t, r, o, n, s, i, a) { + return ( + this._pInst.beginShape(), + this._pInst.vertex(e, t), + this._pInst.bezierVertex(r, o, n, s, i, a), + this._pInst.endShape(), + this + ); + }, + }, + { + key: "curve", + value: function (e, t, r, o, n, s, i, a) { + return ( + this._pInst.beginShape(), + this._pInst.curveVertex(e, t), + this._pInst.curveVertex(r, o), + this._pInst.curveVertex(n, s), + this._pInst.curveVertex(i, a), + this._pInst.endShape(), + this + ); + }, + }, + { + key: "_doFillStrokeClose", + value: function (e) { + e && this.drawingContext.closePath(), + !this._clipping && + this._doFill && + this.drawingContext.fill(), + !this._clipping && + this._doStroke && + this.drawingContext.stroke(); + }, + }, + { + key: "applyMatrix", + value: function (e, t, r, o, n, s) { + this.drawingContext.transform(e, t, r, o, n, s); + }, + }, + { + key: "resetMatrix", + value: function () { + return ( + this.drawingContext.setTransform(1, 0, 0, 1, 0, 0), + this.drawingContext.scale( + this._pInst._pixelDensity, + this._pInst._pixelDensity, + ), + this + ); + }, + }, + { + key: "rotate", + value: function (e) { + this.drawingContext.rotate(e); + }, + }, + { + key: "scale", + value: function (e, t) { + return this.drawingContext.scale(e, t), this; + }, + }, + { + key: "translate", + value: function (e, t) { + return ( + e instanceof d.default.Vector && ((t = e.y), (e = e.x)), + this.drawingContext.translate(e, t), + this + ); + }, + }, + { + key: "_renderText", + value: function (e, t, r, o, n, s) { + if (!(o < s || n <= o)) + return ( + e.push(), + this._isOpenType() + ? this._textFont._renderPath(t, r, o, { + renderer: this, + }) + : (this._doStroke && + this._strokeSet && + this.drawingContext.strokeText(t, r, o), + !this._clipping && + this._doFill && + (this._fillSet || + this._setFill(p._DEFAULT_TEXT_FILL), + this.drawingContext.fillText(t, r, o))), + e.pop(), + e + ); + }, + }, + { + key: "textWidth", + value: function (e) { + return this._isOpenType() + ? this._textFont._textWidth(e, this._textSize) + : this.drawingContext.measureText(e).width; + }, + }, + { + key: "_applyTextProperties", + value: function () { + var e, + t = this._pInst; + return ( + this._setProperty("_textAscent", null), + this._setProperty("_textDescent", null), + (e = this._textFont), + this._isOpenType() && + ((e = this._textFont.font.familyName), + this._setProperty( + "_textStyle", + this._textFont.font.styleName, + )), + (this.drawingContext.font = "" + .concat(this._textStyle || "normal", " ") + .concat(this._textSize || 12, "px ") + .concat(e || "sans-serif")), + (this.drawingContext.textAlign = this._textAlign), + this._textBaseline === p.CENTER + ? (this.drawingContext.textBaseline = p._CTX_MIDDLE) + : (this.drawingContext.textBaseline = + this._textBaseline), + t + ); + }, + }, + { + key: "push", + value: function () { + return ( + this.drawingContext.save(), + l(h(n.prototype), "push", this).call(this) + ); + }, + }, + { + key: "pop", + value: function (e) { + this.drawingContext.restore(), + (this._cachedFillStyle = this.drawingContext.fillStyle), + (this._cachedStrokeStyle = + this.drawingContext.strokeStyle), + l(h(n.prototype), "pop", this).call(this, e); + }, + }, + ]) && s(t.prototype, e), + r && s(t, r), + n + ); + })(d.default.Renderer), + e = + ((n.prototype.text = function (e, t, r, o, n) { + void 0 !== o && + this.drawingContext.textBaseline === p.BASELINE && + ((s = !0), (this.drawingContext.textBaseline = p.TOP)); + var s, + o = d.default.Renderer.prototype.text.apply(this, arguments); + return s && (this.drawingContext.textBaseline = p.BASELINE), o; + }), + (d.default.Renderer2D = n), + d.default.Renderer2D); + r.default = e; + }, + { + "./constants": 264, + "./main": 275, + "./p5.Renderer": 278, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.number.to-fixed": 175, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.reflect.get": 185, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 280: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"); + var h = (e = e("./main")) && e.__esModule ? e : { default: e }; + h.default.prototype._promisePreloads = []; + function o() { + return {}; + } + var f = !(h.default.prototype.registerPromisePreload = function (e) { + h.default.prototype._promisePreloads.push(e); + }); + (h.default.prototype._setupPromisePreloads = function () { + var e = !0, + t = !1, + r = void 0; + try { + for ( + var o, n = this._promisePreloads[Symbol.iterator](); + !(e = (o = n.next()).done); + e = !0 + ) { + var s = o.value, + i = this, + a = s.method, + l = s.addCallbacks, + u = s.legacyPreloadSetup, + c = s.target || this, + d = c[a].bind(c); + if (c === h.default.prototype) { + if (f) continue; + (i = null), (d = c[a]); + } + (c[a] = this._wrapPromisePreload(i, d, l)), + u && (c[u.method] = this._legacyPreloadGenerator(i, u, c[a])); + } + } catch (e) { + (t = !0), (r = e); + } finally { + try { + e || null == n.return || n.return(); + } finally { + if (t) throw r; + } + } + f = !0; + }), + (h.default.prototype._wrapPromisePreload = function (e, l, u) { + var t = function () { + for ( + var e = this, + t = (this._incrementPreload(), null), + r = null, + o = arguments.length, + n = new Array(o), + s = 0; + s < o; + s++ + ) + n[s] = arguments[s]; + if (u) + for ( + var i = n.length - 1; + 0 <= i && !r && "function" == typeof n[i]; + i-- + ) + (r = t), (t = n.pop()); + var a = Promise.resolve(l.apply(this, n)); + return ( + t && a.then(t), + r && a.catch(r), + a.then(function () { + return e._decrementPreload(); + }), + a + ); + }; + return (t = e ? t.bind(e) : t); + }); + h.default.prototype._legacyPreloadGenerator = function (e, t, s) { + var i = t.createBaseObject || o, + t = function () { + var t = this; + this._incrementPreload(); + for ( + var e = arguments.length, r = new Array(e), o = 0; + o < e; + o++ + ) + r[o] = arguments[o]; + var n = i.apply(this, r); + return ( + s.apply(this, r).then(function (e) { + Object.assign(n, e), t._decrementPreload(); + }), + n + ); + }; + return (t = e ? t.bind(e) : t); + }; + }, + { + "./main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.assign": 176, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.promise": 183, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 281: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l = (n = e("./main")) && n.__esModule ? n : { default: n }, + u = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== a(e) && "function" != typeof e)) + return { default: e }; + var t = i(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("./constants")); + function i() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (i = function () { + return e; + }), + e); + } + function a(e) { + return (a = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("./p5.Graphics"), e("./p5.Renderer2D"), e("../webgl/p5.RendererGL"); + var c = "defaultCanvas0", + n = + ((l.default.prototype.createCanvas = function (e, t, r, o) { + var n, s, i; + if ( + (l.default._validateParameters("createCanvas", arguments), + arguments[2] instanceof HTMLCanvasElement + ? ((r = u.P2D), (o = arguments[2])) + : (n = r || u.P2D), + o) + ) + (i = document.getElementById(c)) && + i.parentNode.removeChild(i), + (i = o), + (this._defaultGraphicsCreated = !1); + else { + if (n === u.WEBGL) + (i = document.getElementById(c)) && + (i.parentNode.removeChild(i), + (s = this._renderer), + (this._elements = this._elements.filter(function (e) { + return e !== s; + }))), + ((i = document.createElement("canvas")).id = c), + i.classList.add("p5Canvas"); + else if (this._defaultGraphicsCreated) i = this.canvas; + else { + i = o || document.createElement("canvas"); + for ( + var a = 0; + document.getElementById("defaultCanvas".concat(a)); + + ) + a++; + (c = "defaultCanvas".concat(a)), + (i.id = c), + i.classList.add("p5Canvas"); + } + this._setupDone || + ((i.dataset.hidden = !0), (i.style.visibility = "hidden")), + ( + this._userNode || + (0 === document.getElementsByTagName("main").length && + ((r = document.createElement("main")), + document.body.appendChild(r)), + document.getElementsByTagName("main")[0]) + ).appendChild(i); + } + return ( + n === u.WEBGL + ? (this._setProperty( + "_renderer", + new l.default.RendererGL(i, this, !0), + ), + this._elements.push(this._renderer)) + : this._defaultGraphicsCreated || + (this._setProperty( + "_renderer", + new l.default.Renderer2D(i, this, !0), + ), + (this._defaultGraphicsCreated = !0), + this._elements.push(this._renderer)), + this._renderer.resize(e, t), + this._renderer._applyDefaults(), + this._renderer + ); + }), + (l.default.prototype.resizeCanvas = function (e, t, r) { + if ( + (l.default._validateParameters("resizeCanvas", arguments), + this._renderer) + ) { + var o, + n, + s = {}; + for (o in this.drawingContext) { + var i = this.drawingContext[o]; + "object" !== a(i) && "function" != typeof i && (s[o] = i); + } + for (n in ((this.width = e), + (this.height = t), + this._renderer.resize(e, t), + s)) + try { + this.drawingContext[n] = s[n]; + } catch (e) {} + r || this.redraw(); + } + this._addAccsOutput() && this._updateAccsOutput(); + }), + (l.default.prototype.noCanvas = function () { + this.canvas && this.canvas.parentNode.removeChild(this.canvas); + }), + (l.default.prototype.createGraphics = function (e, t) { + for ( + var r = arguments.length, + o = new Array(2 < r ? r - 2 : 0), + n = 2; + n < r; + n++ + ) + o[n - 2] = arguments[n]; + return ( + o[0] instanceof HTMLCanvasElement && + ((o[1] = o[0]), (o[0] = u.P2D)), + l.default._validateParameters("createGraphics", arguments), + new l.default.Graphics(e, t, o[0], this, o[1]) + ); + }), + (l.default.prototype.createFramebuffer = function (e) { + return new l.default.Framebuffer(this, e); + }), + (l.default.prototype.blendMode = function (e) { + l.default._validateParameters("blendMode", arguments), + e === u.NORMAL && + (console.warn( + "NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead.", + ), + (e = u.BLEND)), + this._renderer.blendMode(e); + }), + l.default); + r.default = n; + }, + { + "../webgl/p5.RendererGL": 332, + "./constants": 264, + "./main": 275, + "./p5.Graphics": 277, + "./p5.Renderer2D": 279, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 282: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.slice"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l = n(e("../main")), + a = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = c(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../constants")), + u = n(e("../helpers")); + function c() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (c = function () { + return e; + }), + e); + } + function n(e) { + return e && e.__esModule ? e : { default: e }; + } + function s(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + e("../friendly_errors/fes_core"), + e("../friendly_errors/file_errors"), + e("../friendly_errors/validate_params"), + (l.default.prototype._normalizeArcAngles = function ( + e, + t, + r, + o, + n, + ) { + var s; + return ( + (e -= a.TWO_PI * Math.floor(e / a.TWO_PI)), + (t -= a.TWO_PI * Math.floor(t / a.TWO_PI)), + (s = Math.min(Math.abs(e - t), a.TWO_PI - Math.abs(e - t))), + n && + ((e = + e <= a.HALF_PI + ? Math.atan((r / o) * Math.tan(e)) + : e > a.HALF_PI && e <= 3 * a.HALF_PI + ? Math.atan((r / o) * Math.tan(e)) + a.PI + : Math.atan((r / o) * Math.tan(e)) + a.TWO_PI), + (t = + t <= a.HALF_PI + ? Math.atan((r / o) * Math.tan(t)) + : t > a.HALF_PI && t <= 3 * a.HALF_PI + ? Math.atan((r / o) * Math.tan(t)) + a.PI + : Math.atan((r / o) * Math.tan(t)) + a.TWO_PI)), + t < e && (t += a.TWO_PI), + { start: e, stop: t, correspondToSamePoint: s < 1e-5 } + ); + }), + (l.default.prototype.arc = function (e, t, r, o, n, s, i, a) { + return ( + l.default._validateParameters("arc", arguments), + (this._renderer._doStroke || this._renderer._doFill) && + n !== s && + ((n = this._toRadians(n)), + (s = this._toRadians(s)), + (r = Math.abs(r)), + (o = Math.abs(o)), + (e = u.default.modeAdjust( + e, + t, + r, + o, + this._renderer._ellipseMode, + )), + (t = this._normalizeArcAngles(n, s, e.w, e.h, !0)) + .correspondToSamePoint + ? this._renderer.ellipse([e.x, e.y, e.w, e.h, a]) + : (this._renderer.arc( + e.x, + e.y, + e.w, + e.h, + t.start, + t.stop, + i, + a, + ), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("arc", [ + e.x, + e.y, + e.w, + e.h, + t.start, + t.stop, + i, + ]))), + this + ); + }), + (l.default.prototype.ellipse = function (e, t, r, o, n) { + return ( + l.default._validateParameters("ellipse", arguments), + this._renderEllipse.apply(this, arguments) + ); + }), + (l.default.prototype.circle = function () { + l.default._validateParameters("circle", arguments); + var e = Array.prototype.slice.call(arguments, 0, 2); + return ( + e.push(arguments[2]), + e.push(arguments[2]), + this._renderEllipse.apply(this, s(e)) + ); + }), + (l.default.prototype._renderEllipse = function (e, t, r, o, n) { + return ( + (this._renderer._doStroke || this._renderer._doFill) && + (r < 0 && (r = Math.abs(r)), + void 0 === o ? (o = r) : o < 0 && (o = Math.abs(o)), + (e = u.default.modeAdjust( + e, + t, + r, + o, + this._renderer._ellipseMode, + )), + this._renderer.ellipse([e.x, e.y, e.w, e.h, n]), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("ellipse", [e.x, e.y, e.w, e.h])), + this + ); + }), + (l.default.prototype.line = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + l.default._validateParameters("line", r), + this._renderer._doStroke && + (e = this._renderer).line.apply(e, r), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("line", r), + this + ); + }), + (l.default.prototype.point = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + l.default._validateParameters("point", r), + this._renderer._doStroke && + (1 === r.length && r[0] instanceof l.default.Vector + ? this._renderer.point.call( + this._renderer, + r[0].x, + r[0].y, + r[0].z, + ) + : ((e = this._renderer).point.apply(e, r), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("point", r))), + this + ); + }), + (l.default.prototype.quad = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + l.default._validateParameters("quad", r), + (this._renderer._doStroke || this._renderer._doFill) && + (this._renderer.isP3D && r.length < 12 + ? this._renderer.quad.call( + this._renderer, + r[0], + r[1], + 0, + r[2], + r[3], + 0, + r[4], + r[5], + 0, + r[6], + r[7], + 0, + r[8], + r[9], + ) + : ((e = this._renderer).quad.apply(e, r), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("quadrilateral", r))), + this + ); + }), + (l.default.prototype.rect = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + l.default._validateParameters("rect", t), + this._renderRect.apply(this, t) + ); + }), + (l.default.prototype.square = function (e, t, r, o, n, s, i) { + return ( + l.default._validateParameters("square", arguments), + this._renderRect.call(this, e, t, r, r, o, n, s, i) + ); + }), + (l.default.prototype._renderRect = function () { + if (this._renderer._doStroke || this._renderer._doFill) { + 3 === arguments.length && (arguments[3] = arguments[2]); + for ( + var e = u.default.modeAdjust( + arguments[0], + arguments[1], + arguments[2], + arguments[3], + this._renderer._rectMode, + ), + t = [e.x, e.y, e.w, e.h], + r = 4; + r < arguments.length; + r++ + ) + t[r] = arguments[r]; + this._renderer.rect(t), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("rectangle", [e.x, e.y, e.w, e.h]); + } + return this; + }), + (l.default.prototype.triangle = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + l.default._validateParameters("triangle", t), + (this._renderer._doStroke || this._renderer._doFill) && + this._renderer.triangle(t), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._accsOutput("triangle", t), + this + ); + }); + e = l.default; + r.default = e; + }, + { + "../constants": 264, + "../friendly_errors/fes_core": 266, + "../friendly_errors/file_errors": 267, + "../friendly_errors/validate_params": 270, + "../helpers": 271, + "../main": 275, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 283: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (l = e("../main")) && l.__esModule ? l : { default: l }, + s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + (n.default.prototype.ellipseMode = function (e) { + return ( + n.default._validateParameters("ellipseMode", arguments), + (e !== s.CORNER && + e !== s.CORNERS && + e !== s.RADIUS && + e !== s.CENTER) || + (this._renderer._ellipseMode = e), + this + ); + }), + (n.default.prototype.noSmooth = function () { + return ( + this._renderer.isP3D + ? this.setAttributes("antialias", !1) + : "imageSmoothingEnabled" in this.drawingContext && + (this.drawingContext.imageSmoothingEnabled = !1), + this + ); + }), + (n.default.prototype.rectMode = function (e) { + return ( + n.default._validateParameters("rectMode", arguments), + (e !== s.CORNER && + e !== s.CORNERS && + e !== s.RADIUS && + e !== s.CENTER) || + (this._renderer._rectMode = e), + this + ); + }), + (n.default.prototype.smooth = function () { + return ( + this.setAttributes("antialias", !0), + this._renderer.isP3D || + ("imageSmoothingEnabled" in this.drawingContext && + (this.drawingContext.imageSmoothingEnabled = !0)), + this + ); + }), + (n.default.prototype.strokeCap = function (e) { + return ( + n.default._validateParameters("strokeCap", arguments), + (e !== s.ROUND && e !== s.SQUARE && e !== s.PROJECT) || + this._renderer.strokeCap(e), + this + ); + }), + (n.default.prototype.strokeJoin = function (e) { + return ( + n.default._validateParameters("strokeJoin", arguments), + (e !== s.ROUND && e !== s.BEVEL && e !== s.MITER) || + this._renderer.strokeJoin(e), + this + ); + }), + (n.default.prototype.strokeWeight = function (e) { + return ( + n.default._validateParameters("strokeWeight", arguments), + this._renderer.strokeWeight(e), + this + ); + }); + var l = n.default; + r.default = l; + }, + { + "../constants": 264, + "../main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 284: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l = (o = e("../main")) && o.__esModule ? o : { default: o }; + e("../friendly_errors/fes_core"), + e("../friendly_errors/file_errors"), + e("../friendly_errors/validate_params"), + (l.default.prototype.bezier = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + l.default._validateParameters("bezier", r), + (this._renderer._doStroke || this._renderer._doFill) && + (e = this._renderer).bezier.apply(e, r), + this + ); + }), + (l.default.prototype.bezierDetail = function (e) { + return ( + l.default._validateParameters("bezierDetail", arguments), + (this._bezierDetail = e), + this + ); + }), + (l.default.prototype.bezierPoint = function (e, t, r, o, n) { + l.default._validateParameters("bezierPoint", arguments); + var s = 1 - n; + return ( + Math.pow(s, 3) * e + + 3 * Math.pow(s, 2) * n * t + + 3 * s * Math.pow(n, 2) * r + + Math.pow(n, 3) * o + ); + }), + (l.default.prototype.bezierTangent = function (e, t, r, o, n) { + l.default._validateParameters("bezierTangent", arguments); + var s = 1 - n; + return ( + 3 * o * Math.pow(n, 2) - + 3 * r * Math.pow(n, 2) + + 6 * r * s * n - + 6 * t * s * n + + 3 * t * Math.pow(s, 2) - + 3 * e * Math.pow(s, 2) + ); + }), + (l.default.prototype.curve = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + l.default._validateParameters("curve", r), + this._renderer._doStroke && + (e = this._renderer).curve.apply(e, r), + this + ); + }), + (l.default.prototype.curveDetail = function (e) { + return ( + l.default._validateParameters("curveDetail", arguments), + (this._curveDetail = e < 3 ? 3 : e), + this + ); + }), + (l.default.prototype.curveTightness = function (e) { + return ( + l.default._validateParameters("curveTightness", arguments), + (this._renderer._curveTightness = e), + this + ); + }), + (l.default.prototype.curvePoint = function (e, t, r, o, n) { + l.default._validateParameters("curvePoint", arguments); + var s = this._renderer._curveTightness, + i = n * n * n, + a = n * n; + return ( + e * (((s - 1) / 2) * i + (1 - s) * a + ((s - 1) / 2) * n) + + t * (((s + 3) / 2) * i + ((-5 - s) / 2) * a + 1) + + r * (((-3 - s) / 2) * i + (s + 2) * a + ((1 - s) / 2) * n) + + o * (((1 - s) / 2) * i + ((s - 1) / 2) * a) + ); + }), + (l.default.prototype.curveTangent = function (e, t, r, o, n) { + l.default._validateParameters("curveTangent", arguments); + var s = this._renderer._curveTightness, + i = n * n * 3, + n = 2 * n; + return ( + e * (((s - 1) / 2) * i + (1 - s) * n + (s - 1) / 2) + + t * (((s + 3) / 2) * i + ((-5 - s) / 2) * n) + + r * (((-3 - s) / 2) * i + (s + 2) * n + (1 - s) / 2) + + o * (((1 - s) / 2) * i + ((s - 1) / 2) * n) + ); + }); + var o = l.default; + r.default = o; + }, + { + "../friendly_errors/fes_core": 266, + "../friendly_errors/file_errors": 267, + "../friendly_errors/validate_params": 270, + "../main": 275, + }, + ], + 285: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.slice"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var a = (y = e("../main")) && y.__esModule ? y : { default: y }, + l = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = u(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../constants")); + function u() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (u = function () { + return e; + }), + e); + } + var n = null, + c = [], + d = [], + h = !1, + s = !1, + f = !1, + p = !1, + m = !0, + y = + ((a.default.prototype.beginContour = function () { + return ( + this._renderer.isP3D + ? this._renderer.beginContour() + : ((d = []), (p = !0)), + this + ); + }), + (a.default.prototype.beginShape = function (e) { + var t; + return ( + a.default._validateParameters("beginShape", arguments), + this._renderer.isP3D + ? (t = this._renderer).beginShape.apply(t, arguments) + : ((n = + e === l.POINTS || + e === l.LINES || + e === l.TRIANGLES || + e === l.TRIANGLE_FAN || + e === l.TRIANGLE_STRIP || + e === l.QUADS || + e === l.QUAD_STRIP + ? e + : null), + (c = []), + (d = [])), + this + ); + }), + (a.default.prototype.bezierVertex = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + if ( + (a.default._validateParameters("bezierVertex", r), + this._renderer.isP3D) + ) + (e = this._renderer).bezierVertex.apply(e, r); + else if (0 === c.length) + a.default._friendlyError( + "vertex() must be used once before calling bezierVertex()", + "bezierVertex", + ); + else { + h = !0; + for (var n = [], s = 0; s < r.length; s++) n[s] = r[s]; + (n.isVert = !1), (p ? d : c).push(n); + } + return this; + }), + (a.default.prototype.curveVertex = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + a.default._validateParameters("curveVertex", r), + this._renderer.isP3D + ? (e = this._renderer).curveVertex.apply(e, r) + : ((s = !0), this.vertex(r[0], r[1])), + this + ); + }), + (a.default.prototype.endContour = function () { + if (!this._renderer.isP3D) { + var e = d[0].slice(); + (e.isVert = d[0].isVert), + (e.moveTo = !1), + d.push(e), + m && (c.push(c[0]), (m = !1)); + for (var t = 0; t < d.length; t++) c.push(d[t]); + } + return this; + }), + (a.default.prototype.endShape = function (e) { + var t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : 1; + if ( + (a.default._validateParameters("endShape", arguments), + t < 1 && + (console.log( + "🌸 p5.js says: You can not have less than one instance", + ), + (t = 1)), + this._renderer.isP3D) + ) + this._renderer.endShape(e, s, h, f, p, n, t); + else { + if ( + (1 !== t && + console.log( + "🌸 p5.js says: Instancing is only supported in WebGL2 mode", + ), + 0 === c.length) + ) + return this; + if (!this._renderer._doStroke && !this._renderer._doFill) + return this; + t = e === l.CLOSE; + t && !p && c.push(c[0]), + this._renderer.endShape(e, c, s, h, f, p, n), + (m = !(p = f = h = s = !1)), + t && c.pop(); + } + return this; + }), + (a.default.prototype.quadraticVertex = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + if ( + (a.default._validateParameters("quadraticVertex", r), + this._renderer.isP3D) + ) + (e = this._renderer).quadraticVertex.apply(e, r); + else { + if (this._contourInited) + return ( + ((e = {}).x = r[0]), + (e.y = r[1]), + (e.x3 = r[2]), + (e.y3 = r[3]), + (e.type = l.QUADRATIC), + this._contourVertices.push(e), + this + ); + if (0 < c.length) { + f = !0; + for (var n = [], s = 0; s < r.length; s++) n[s] = r[s]; + (n.isVert = !1), (p ? d : c).push(n); + } else + a.default._friendlyError( + "vertex() must be used once before calling quadraticVertex()", + "quadraticVertex", + ); + } + return this; + }), + (a.default.prototype.vertex = function (e, t, r, o, n) { + var s; + return ( + this._renderer.isP3D + ? (s = this._renderer).vertex.apply(s, arguments) + : (((s = []).isVert = !0), + (s[0] = e), + (s[1] = t), + (s[2] = 0), + (s[3] = 0), + (s[4] = 0), + (s[5] = this._renderer._getFill()), + (s[6] = this._renderer._getStroke()), + r && (s.moveTo = r), + (p ? (0 === d.length && (s.moveTo = !0), d) : c).push(s)), + this + ); + }), + (a.default.prototype.normal = function (e, t, r) { + var o; + return ( + this._assert3d("normal"), + a.default._validateParameters("normal", arguments), + (o = this._renderer).normal.apply(o, arguments), + this + ); + }), + a.default); + r.default = y; + }, + { + "../constants": 264, + "../main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 286: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function a(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + function n(e) { + return (n = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + var l, u, c; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.uint8-clamped-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.uint8-clamped-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + (window.requestAnimationFrame = + window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function (e, t) { + window.setTimeout(e, 1e3 / 60); + }), + "undefined" == typeof Uint8ClampedArray || + Uint8ClampedArray.prototype.slice || + Object.defineProperty(Uint8ClampedArray.prototype, "slice", { + value: Array.prototype.slice, + writable: !0, + configurable: !0, + enumerable: !1, + }), + Object.assign || + ((l = Object.keys), + (e = Object.defineProperty), + (u = "function" == typeof Symbol && "symbol" === n(Symbol())), + (c = Object.prototype.propertyIsEnumerable), + e(Object, "assign", { + value: function (e, t) { + if (null == e) + throw new TypeError("target must be an object"); + for (var r, o = Object(e), n = 1; n < arguments.length; ++n) { + var s = Object(arguments[n]), + i = l(s); + for ( + u && + Object.getOwnPropertySymbols && + i.push.apply( + i, + a( + Object.getOwnPropertySymbols(s).filter( + (function (t) { + return function (e) { + return c.call(t, e); + }; + })(s), + ), + ), + ), + r = 0; + r < i.length; + ++r + ) + o[i[r]] = s[i[r]]; + } + return o; + }, + configurable: !0, + enumerable: !1, + writable: !0, + })); + }, + { + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.assign": 176, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-clamped-array": 235, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 287: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.assign"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("./main")) && e.__esModule ? e : { default: e }; + (e.default.prototype.noLoop = function () { + this._loop = !1; + }), + (e.default.prototype.loop = function () { + this._loop || + ((this._loop = !0), this._setupDone && this._draw()); + }), + (e.default.prototype.isLooping = function () { + return this._loop; + }), + (e.default.prototype.push = function () { + this._styles.push({ + props: { _colorMode: this._colorMode }, + renderer: this._renderer.push(), + }); + }), + (e.default.prototype.pop = function () { + var e = this._styles.pop(); + e + ? (this._renderer.pop(e.renderer), Object.assign(this, e.props)) + : console.warn("pop() was called without matching push()"); + }), + (e.default.prototype.redraw = function (e) { + if (!this._inUserDraw && this._setupDone) { + var t = parseInt(e), + r = + ((isNaN(t) || t < 1) && (t = 1), + this._isGlobal ? window : this); + if ("function" == typeof r.draw) { + void 0 === r.setup && + r.scale(r._pixelDensity, r._pixelDensity); + for (var o = 0; o < t; o++) { + r.resetMatrix(), + (this._accessibleOutputs.grid || + this._accessibleOutputs.text) && + this._updateAccsOutput(), + r._renderer.isP3D && r._renderer._update(), + r._setProperty("frameCount", r.frameCount + 1), + this.callRegisteredHooksFor("pre"), + (this._inUserDraw = !0); + try { + r.draw(); + } finally { + this._inUserDraw = !1; + } + this.callRegisteredHooksFor("post"); + } + } + } + }); + e = e.default; + r.default = e; + }, + { "./main": 275, "core-js/modules/es.object.assign": 176 }, + ], + 288: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (e = e("./main")) && e.__esModule ? e : { default: e }; + function o(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + (n.default.prototype.applyMatrix = function () { + var e = + (arguments.length <= 0 ? void 0 : arguments[0]) instanceof + Object.getPrototypeOf(Uint8Array); + return ( + Array.isArray(arguments.length <= 0 ? void 0 : arguments[0]) || e + ? (e = this._renderer).applyMatrix.apply( + e, + o(arguments.length <= 0 ? void 0 : arguments[0]), + ) + : (e = this._renderer).applyMatrix.apply(e, arguments), + this + ); + }), + (n.default.prototype.resetMatrix = function () { + return this._renderer.resetMatrix(), this; + }), + (n.default.prototype.rotate = function (e, t) { + return ( + n.default._validateParameters("rotate", arguments), + this._renderer.rotate(this._toRadians(e), t), + this + ); + }), + (n.default.prototype.rotateX = function (e) { + return ( + this._assert3d("rotateX"), + n.default._validateParameters("rotateX", arguments), + this._renderer.rotateX(this._toRadians(e)), + this + ); + }), + (n.default.prototype.rotateY = function (e) { + return ( + this._assert3d("rotateY"), + n.default._validateParameters("rotateY", arguments), + this._renderer.rotateY(this._toRadians(e)), + this + ); + }), + (n.default.prototype.rotateZ = function (e) { + return ( + this._assert3d("rotateZ"), + n.default._validateParameters("rotateZ", arguments), + this._renderer.rotateZ(this._toRadians(e)), + this + ); + }), + (n.default.prototype.scale = function (e, t, r) { + var o; + return ( + n.default._validateParameters("scale", arguments), + e instanceof n.default.Vector + ? ((e = (o = e).x), (t = o.y), (r = o.z)) + : e instanceof Array && + ((e = (o = e)[0]), (t = o[1]), (r = o[2] || 1)), + isNaN(t) ? (t = r = e) : isNaN(r) && (r = 1), + this._renderer.scale.call(this._renderer, e, t, r), + this + ); + }), + (n.default.prototype.shearX = function (e) { + n.default._validateParameters("shearX", arguments); + e = this._toRadians(e); + return ( + this._renderer.applyMatrix(1, 0, Math.tan(e), 1, 0, 0), this + ); + }), + (n.default.prototype.shearY = function (e) { + n.default._validateParameters("shearY", arguments); + e = this._toRadians(e); + return ( + this._renderer.applyMatrix(1, Math.tan(e), 0, 1, 0, 0), this + ); + }), + (n.default.prototype.translate = function (e, t, r) { + return ( + n.default._validateParameters("translate", arguments), + this._renderer.isP3D + ? this._renderer.translate(e, t, r) + : this._renderer.translate(e, t), + this + ); + }); + e = n.default; + r.default = e; + }, + { + "./main": 275, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 289: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.ends-with"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.ends-with"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"); + var n = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function s(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + (n.default.prototype.storeItem = function (e, t) { + "string" != typeof e && + console.log( + "The argument that you passed to storeItem() - ".concat( + e, + " is not a string.", + ), + ), + e.endsWith("p5TypeID") && + console.log( + "The argument that you passed to storeItem() - ".concat( + e, + " must not end with 'p5TypeID'.", + ), + ), + void 0 === t && + console.log( + "You cannot store undefined variables using storeItem().", + ); + var r = i(t); + switch (r) { + case "number": + case "boolean": + t = t.toString(); + break; + case "object": + t instanceof n.default.Color + ? (r = "p5.Color") + : t instanceof n.default.Vector && + ((r = "p5.Vector"), (t = [t.x, t.y, t.z])), + (t = JSON.stringify(t)); + } + localStorage.setItem(e, t); + e = "".concat(e, "p5TypeID"); + localStorage.setItem(e, r); + }), + (n.default.prototype.getItem = function (e) { + var t = localStorage.getItem(e), + r = localStorage.getItem("".concat(e, "p5TypeID")); + if (void 0 === r) + console.log( + "Unable to determine type of item stored under ".concat( + e, + "in local storage. Did you save the item with something other than setItem()?", + ), + ); + else if (null !== t) + switch (r) { + case "number": + t = parseFloat(t); + break; + case "boolean": + t = "true" === t; + break; + case "object": + t = JSON.parse(t); + break; + case "p5.Color": + (t = JSON.parse(t)), + (t = this.color.apply(this, s(t.levels))); + break; + case "p5.Vector": + (t = JSON.parse(t)), + (t = this.createVector.apply(this, s(t))); + } + return t; + }), + (n.default.prototype.clearStorage = function () { + localStorage.clear(); + }), + (n.default.prototype.removeItem = function (e) { + "string" != typeof e && + console.log( + "The argument that you passed to removeItem() - ".concat( + e, + " is not a string.", + ), + ), + localStorage.removeItem(e), + localStorage.removeItem("".concat(e, "p5TypeID")); + }); + }, + { + "../core/main": 275, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.ends-with": 190, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 290: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function n(e) { + return (n = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.object.keys"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function i(e, t) { + if ("function" != typeof t && null !== t) + throw new TypeError( + "Super expression must either be null or a function", + ); + (e.prototype = Object.create(t && t.prototype, { + constructor: { value: e, writable: !0, configurable: !0 }, + })), + t && a(e, t); + } + function a(e, t) { + return (a = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function l(r) { + return function () { + var e, + t = u(r), + t = + ((e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = u(this).constructor), + Reflect.construct(t, arguments, e)) + : t.apply(this, arguments)), + this); + if (!e || ("object" !== n(e) && "function" != typeof e)) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return e; + }; + } + function u(e) { + return (u = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + function c(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + } + function d(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function h(e, t, r) { + t && d(e.prototype, t), r && d(e, r); + } + (s.default.prototype.createStringDict = function (e, t) { + return ( + s.default._validateParameters("createStringDict", arguments), + new s.default.StringDict(e, t) + ); + }), + (s.default.prototype.createNumberDict = function (e, t) { + return ( + s.default._validateParameters("createNumberDict", arguments), + new s.default.NumberDict(e, t) + ); + }), + (s.default.TypedDict = (function () { + function r(e, t) { + return ( + c(this, r), + e instanceof Object + ? (this.data = e) + : ((this.data = {}), (this.data[e] = t)), + this + ); + } + return ( + h(r, [ + { + key: "size", + value: function () { + return Object.keys(this.data).length; + }, + }, + { + key: "hasKey", + value: function (e) { + return this.data.hasOwnProperty(e); + }, + }, + { + key: "get", + value: function (e) { + if (this.data.hasOwnProperty(e)) return this.data[e]; + console.log( + "".concat(e, " does not exist in this Dictionary"), + ); + }, + }, + { + key: "set", + value: function (e, t) { + this._validate(t) + ? (this.data[e] = t) + : console.log( + "Those values dont work for this dictionary type.", + ); + }, + }, + { + key: "_addObj", + value: function (e) { + for (var t in e) this.set(t, e[t]); + }, + }, + { + key: "create", + value: function (e, t) { + e instanceof Object && void 0 === t + ? this._addObj(e) + : void 0 !== e + ? this.set(e, t) + : console.log( + "In order to create a new Dictionary entry you must pass an object or a key, value pair", + ); + }, + }, + { + key: "clear", + value: function () { + this.data = {}; + }, + }, + { + key: "remove", + value: function (e) { + if (!this.data.hasOwnProperty(e)) + throw new Error( + "".concat(e, " does not exist in this Dictionary"), + ); + delete this.data[e]; + }, + }, + { + key: "print", + value: function () { + for (var e in this.data) + console.log( + "key:".concat(e, " value:").concat(this.data[e]), + ); + }, + }, + { + key: "saveTable", + value: function (e) { + var t, + r = ""; + for (t in this.data) + r += "".concat(t, ",").concat(this.data[t], "\n"); + var o = new Blob([r], { type: "text/csv" }); + s.default.prototype.downloadFile(o, e || "mycsv", "csv"); + }, + }, + { + key: "saveJSON", + value: function (e, t) { + s.default.prototype.saveJSON(this.data, e, t); + }, + }, + { + key: "_validate", + value: function (e) { + return !0; + }, + }, + ]), + r + ); + })()), + (s.default.StringDict = (function () { + i(n, s.default.TypedDict); + var o = l(n); + function n() { + c(this, n); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return o.call.apply(o, [this].concat(t)); + } + return ( + h(n, [ + { + key: "_validate", + value: function (e) { + return "string" == typeof e; + }, + }, + ]), + n + ); + })()), + (s.default.NumberDict = (function () { + i(n, s.default.TypedDict); + var o = l(n); + function n() { + c(this, n); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return o.call.apply(o, [this].concat(t)); + } + return ( + h(n, [ + { + key: "_validate", + value: function (e) { + return "number" == typeof e; + }, + }, + { + key: "add", + value: function (e, t) { + this.data.hasOwnProperty(e) + ? (this.data[e] += t) + : console.log( + "The key - ".concat( + e, + " does not exist in this dictionary.", + ), + ); + }, + }, + { + key: "sub", + value: function (e, t) { + this.add(e, -t); + }, + }, + { + key: "mult", + value: function (e, t) { + this.data.hasOwnProperty(e) + ? (this.data[e] *= t) + : console.log( + "The key - ".concat( + e, + " does not exist in this dictionary.", + ), + ); + }, + }, + { + key: "div", + value: function (e, t) { + this.data.hasOwnProperty(e) + ? (this.data[e] /= t) + : console.log( + "The key - ".concat( + e, + " does not exist in this dictionary.", + ), + ); + }, + }, + { + key: "_valueTest", + value: function (e) { + if (0 === Object.keys(this.data).length) + throw new Error( + "Unable to search for a minimum or maximum value on an empty NumberDict", + ); + if (1 === Object.keys(this.data).length) + return this.data[Object.keys(this.data)[0]]; + var t, + r = this.data[Object.keys(this.data)[0]]; + for (t in this.data) + this.data[t] * e < r * e && (r = this.data[t]); + return r; + }, + }, + { + key: "minValue", + value: function () { + return this._valueTest(1); + }, + }, + { + key: "maxValue", + value: function () { + return this._valueTest(-1); + }, + }, + { + key: "_keyTest", + value: function (e) { + if (0 === Object.keys(this.data).length) + throw new Error( + "Unable to use minValue on an empty NumberDict", + ); + if (1 === Object.keys(this.data).length) + return Object.keys(this.data)[0]; + for ( + var t = Object.keys(this.data)[0], r = 1; + r < Object.keys(this.data).length; + r++ + ) + Object.keys(this.data)[r] * e < t * e && + (t = Object.keys(this.data)[r]); + return t; + }, + }, + { + key: "minKey", + value: function () { + return this._keyTest(1); + }, + }, + { + key: "maxKey", + value: function () { + return this._keyTest(-1); + }, + }, + ]), + n + ); + })()); + e = s.default.TypedDict; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 291: [ + function (t, r, o) { + "use strict"; + function n(e) { + return (n = + "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); + } + t("core-js/modules/es.symbol"), + t("core-js/modules/es.symbol.description"), + t("core-js/modules/es.symbol.iterator"), + t("core-js/modules/es.array.every"), + t("core-js/modules/es.array.filter"), + t("core-js/modules/es.array.for-each"), + t("core-js/modules/es.array.from"), + t("core-js/modules/es.array.index-of"), + t("core-js/modules/es.array.iterator"), + t("core-js/modules/es.array.map"), + t("core-js/modules/es.array.slice"), + t("core-js/modules/es.array.splice"), + t("core-js/modules/es.function.name"), + t("core-js/modules/es.object.get-prototype-of"), + t("core-js/modules/es.object.to-string"), + t("core-js/modules/es.promise"), + t("core-js/modules/es.reflect.construct"), + t("core-js/modules/es.regexp.exec"), + t("core-js/modules/es.regexp.to-string"), + t("core-js/modules/es.string.iterator"), + t("core-js/modules/es.string.replace"), + t("core-js/modules/es.string.split"), + t("core-js/modules/es.string.trim"), + t("core-js/modules/web.dom-collections.for-each"), + t("core-js/modules/web.dom-collections.iterator"), + t("core-js/modules/web.url"), + t("core-js/modules/es.symbol"), + t("core-js/modules/es.symbol.description"), + t("core-js/modules/es.symbol.iterator"), + t("core-js/modules/es.array.every"), + t("core-js/modules/es.array.filter"), + t("core-js/modules/es.array.for-each"), + t("core-js/modules/es.array.from"), + t("core-js/modules/es.array.index-of"), + t("core-js/modules/es.array.iterator"), + t("core-js/modules/es.array.map"), + t("core-js/modules/es.array.slice"), + t("core-js/modules/es.array.splice"), + t("core-js/modules/es.function.name"), + t("core-js/modules/es.object.to-string"), + t("core-js/modules/es.promise"), + t("core-js/modules/es.regexp.exec"), + t("core-js/modules/es.regexp.to-string"), + t("core-js/modules/es.string.iterator"), + t("core-js/modules/es.string.replace"), + t("core-js/modules/es.string.split"), + t("core-js/modules/es.string.trim"), + t("core-js/modules/web.dom-collections.for-each"), + t("core-js/modules/web.dom-collections.iterator"), + t("core-js/modules/web.url"), + Object.defineProperty(o, "__esModule", { value: !0 }), + (o.default = void 0); + var f = (t = t("../core/main")) && t.__esModule ? t : { default: t }; + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function a(e, t, r) { + t && s(e.prototype, t), r && s(e, r); + } + function l(e, t) { + return (l = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function u(o) { + return function () { + var e, + t, + r = i(o); + return ( + (e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = i(this).constructor), + Reflect.construct(r, arguments, e)) + : r.apply(this, arguments)), + (r = this), + !(t = e) || ("object" !== h(t) && "function" != typeof t) + ? c(r) + : t + ); + }; + } + function c(e) { + if (void 0 === e) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return e; + } + function i(e) { + return (i = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + function d(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + } + function h(e) { + return (h = + "function" == typeof Symbol && "symbol" === n(Symbol.iterator) + ? function (e) { + return n(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : n(e); + })(e); + } + function p(e, t, r) { + (t._userNode || document.body).appendChild(e); + r = new (r ? f.default.MediaElement : f.default.Element)(e, t); + return t._elements.push(r), r; + } + function m(e, t, r, o) { + var n = document.createElement(t), + s = ("string" == typeof (r = r || "") && (r = [r]), !0), + t = !1, + i = void 0; + try { + for ( + var a, l = r[Symbol.iterator](); + !(s = (a = l.next()).done); + s = !0 + ) { + var u = a.value, + c = document.createElement("source"); + c.setAttribute("src", u), n.appendChild(c); + } + } catch (e) { + (t = !0), (i = e); + } finally { + try { + s || null == l.return || l.return(); + } finally { + if (t) throw i; + } + } + "function" == typeof o && + n.addEventListener("canplaythrough", function e() { + o(), n.removeEventListener("canplaythrough", e); + }); + var d = p(n, e, !0); + return ( + (d.loadedmetadata = !1), + n.addEventListener("loadedmetadata", function () { + (d.width = n.videoWidth), + (d.height = n.videoHeight), + 0 === d.elt.width && (d.elt.width = n.videoWidth), + 0 === d.elt.height && (d.elt.height = n.videoHeight), + d.presetPlaybackRate && + ((d.elt.playbackRate = d.presetPlaybackRate), + delete d.presetPlaybackRate), + (d.loadedmetadata = !0); + }), + d + ); + } + (f.default.prototype.select = function (e, t) { + f.default._validateParameters("select", arguments); + t = this._getContainer(t).querySelector(e); + return t ? this._wrapElement(t) : null; + }), + (f.default.prototype.selectAll = function (e, t) { + f.default._validateParameters("selectAll", arguments); + var r = [], + o = this._getContainer(t).querySelectorAll(e); + if (o) + for (var n = 0; n < o.length; n++) { + var s = this._wrapElement(o[n]); + r.push(s); + } + return r; + }), + (f.default.prototype._getContainer = function (e) { + var t = document; + return ( + "string" == typeof e + ? (t = document.querySelector(e) || document) + : e instanceof f.default.Element + ? (t = e.elt) + : e instanceof HTMLElement && (t = e), + t + ); + }), + (f.default.prototype._wrapElement = function (e) { + var t, + r = Array.prototype.slice.call(e.children); + return "INPUT" === e.tagName && "checkbox" === e.type + ? (((t = new f.default.Element(e, this)).checked = function () { + return 0 === arguments.length + ? this.elt.checked + : ((this.elt.checked = !( + arguments.length <= 0 || !arguments[0] + )), + this); + }), + t) + : "VIDEO" === e.tagName || "AUDIO" === e.tagName + ? new f.default.MediaElement(e, this) + : "SELECT" === e.tagName + ? this.createSelect(new f.default.Element(e, this)) + : 0 < r.length && + r.every(function (e) { + return "INPUT" === e.tagName || "LABEL" === e.tagName; + }) + ? this.createRadio(new f.default.Element(e, this)) + : new f.default.Element(e, this); + }), + (f.default.prototype.removeElements = function (e) { + f.default._validateParameters("removeElements", arguments); + this._elements + .filter(function (e) { + return !(e.elt instanceof HTMLCanvasElement); + }) + .map(function (e) { + return e.remove(); + }); + }), + (f.default.Element.prototype.changed = function (e) { + return f.default.Element._adjustListener("change", e, this), this; + }), + (f.default.Element.prototype.input = function (e) { + return f.default.Element._adjustListener("input", e, this), this; + }), + (f.default.prototype.createDiv = function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : "", + t = document.createElement("div"); + return (t.innerHTML = e), p(t, this); + }), + (f.default.prototype.createP = function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : "", + t = document.createElement("p"); + return (t.innerHTML = e), p(t, this); + }), + (f.default.prototype.createSpan = function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : "", + t = document.createElement("span"); + return (t.innerHTML = e), p(t, this); + }), + (f.default.prototype.createImg = function () { + f.default._validateParameters("createImg", arguments); + var t, + r = document.createElement("img"), + o = arguments; + return ( + 1 < o.length && "string" == typeof o[1] && (r.alt = o[1]), + 2 < o.length && + "string" == typeof o[2] && + (r.crossOrigin = o[2]), + (r.src = o[0]), + (t = p(r, this)), + r.addEventListener("load", function () { + (t.width = r.offsetWidth || r.width), + (t.height = r.offsetHeight || r.height); + var e = o[o.length - 1]; + "function" == typeof e && e(t); + }), + t + ); + }), + (f.default.prototype.createA = function (e, t, r) { + f.default._validateParameters("createA", arguments); + var o = document.createElement("a"); + return ( + (o.href = e), (o.innerHTML = t), r && (o.target = r), p(o, this) + ); + }), + (f.default.prototype.createSlider = function (e, t, r, o) { + f.default._validateParameters("createSlider", arguments); + var n = document.createElement("input"); + return ( + (n.type = "range"), + (n.min = e), + (n.max = t), + 0 === o ? (n.step = 1e-18) : o && (n.step = o), + "number" == typeof r && (n.value = r), + p(n, this) + ); + }), + (f.default.prototype.createButton = function (e, t) { + f.default._validateParameters("createButton", arguments); + var r = document.createElement("button"); + return (r.innerHTML = e), t && (r.value = t), p(r, this); + }), + (f.default.prototype.createCheckbox = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + f.default._validateParameters("createCheckbox", t); + var o = document.createElement("div"), + n = document.createElement("input"), + s = ((n.type = "checkbox"), document.createElement("label")), + i = (s.appendChild(n), o.appendChild(s), p(o, this)); + return ( + (i.checked = function () { + var e = + i.elt.firstElementChild.getElementsByTagName("input")[0]; + if (e) { + if (0 === arguments.length) return e.checked; + e.checked = !(arguments.length <= 0 || !arguments[0]); + } + return i; + }), + (this.value = function (e) { + return (i.value = e), this; + }), + t[0] && + (i.value(t[0]), + ((o = document.createElement("span")).innerHTML = t[0]), + s.appendChild(o)), + t[1] && (n.checked = !0), + i + ); + }), + (f.default.prototype.createSelect = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + f.default._validateParameters("createSelect", r); + var n, + s = r[0]; + return ( + s instanceof f.default.Element && + s.elt instanceof HTMLSelectElement + ? (this.elt = (e = s).elt) + : s instanceof HTMLSelectElement + ? ((e = p(s, this)), (this.elt = s)) + : ((n = document.createElement("select")), + s && + "boolean" == typeof s && + n.setAttribute("multiple", "true"), + (e = p(n, this)), + (this.elt = n)), + (e.option = function (e, t) { + var r; + if (void 0 !== e) { + for (var o, n = 0; n < this.elt.length; n += 1) + if (this.elt[n].textContent === e) { + r = n; + break; + } + void 0 !== r + ? !1 === t + ? this.elt.remove(r) + : (this.elt[r].value = t) + : (((o = document.createElement("option")).textContent = + e), + (o.value = void 0 === t ? e : t), + this.elt.appendChild(o), + this._pInst._elements.push(o)); + } + }), + (e.selected = function (e) { + if (void 0 !== e) { + for (var t = 0; t < this.elt.length; t += 1) + this.elt[t].value.toString() === e.toString() && + (this.elt.selectedIndex = t); + return this; + } + if (this.elt.getAttribute("multiple")) { + var r = [], + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = this.elt.selectedOptions[Symbol.iterator](); + !(o = (i = a.next()).done); + o = !0 + ) { + var l = i.value; + r.push(l.value); + } + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + return r; + } + return this.elt.value; + }), + (e.disable = function (e) { + if ("string" == typeof e) + for (var t = 0; t < this.elt.length; t++) + this.elt[t].value.toString() === e && + ((this.elt[t].disabled = !0), + (this.elt[t].selected = !1)); + else this.elt.disabled = !0; + return this; + }), + (e.enable = function (e) { + if ("string" == typeof e) + for (var t = 0; t < this.elt.length; t++) + this.elt[t].value.toString() === e && + ((this.elt[t].disabled = !1), + (this.elt[t].selected = !1)); + else { + this.elt.disabled = !1; + for (var r = 0; r < this.elt.length; r++) + (this.elt[r].disabled = !1), (this.elt[r].selected = !1); + } + return this; + }), + e + ); + }), + (f.default.prototype.createRadio = function () { + function t(e) { + return e instanceof HTMLInputElement && "radio" === e.type; + } + function d(e) { + return e instanceof HTMLLabelElement; + } + var h, + e, + r, + o = arguments.length <= 0 ? void 0 : arguments[0]; + o instanceof f.default.Element && + (o.elt instanceof HTMLDivElement || + o.elt instanceof HTMLSpanElement) + ? ((h = o), (this.elt = o.elt)) + : o instanceof HTMLDivElement || o instanceof HTMLSpanElement + ? ((h = p(o, this)), + (e = this.elt = o), + "string" == + typeof (arguments.length <= 1 ? void 0 : arguments[1]) && + (r = arguments.length <= 1 ? void 0 : arguments[1])) + : ("string" == typeof o && (r = o), + (e = document.createElement("div")), + (h = p(e, this)), + (this.elt = e)), + (h._name = r || "radioOption"); + return ( + (h._getOptionsArray = function () { + return Array.from(this.elt.children) + .filter(function (e) { + return t(e) || (d(e) && t(e.firstElementChild)); + }) + .map(function (e) { + return t(e) ? e : e.firstElementChild; + }); + }), + (h.option = function (e, t) { + var r, + o, + n, + s = !0, + i = !1, + a = void 0; + try { + for ( + var l, u = h._getOptionsArray()[Symbol.iterator](); + !(s = (l = u.next()).done); + s = !0 + ) { + var c = l.value; + if (c.value === e) { + r = c; + break; + } + } + } catch (e) { + (i = !0), (a = e); + } finally { + try { + s || null == u.return || u.return(); + } finally { + if (i) throw a; + } + } + return ( + void 0 === r && + ((r = document.createElement("input")).setAttribute( + "type", + "radio", + ), + r.setAttribute("value", e)), + r.setAttribute("name", h._name), + d(r.parentElement) + ? (o = r.parentElement) + : (o = + document.createElement( + "label", + )).insertAdjacentElement("afterbegin", r), + o.lastElementChild instanceof HTMLSpanElement + ? (n = o.lastElementChild) + : ((n = document.createElement("span")), + r.insertAdjacentElement("afterend", n)), + (n.innerHTML = void 0 === t ? e : t), + this.elt.appendChild(o), + r + ); + }), + (h.remove = function (e) { + var t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = h._getOptionsArray()[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + if (i.value === e) + return void ( + d(i.parentElement) ? i.parentElement : i + ).remove(); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + }), + (h.value = function () { + var e = "", + t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = h._getOptionsArray()[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + if (i.checked) { + e = i.value; + break; + } + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + return e; + }), + (h.selected = function (e) { + var t = null; + if (void 0 === e) { + var r = !0, + o = !1, + n = void 0; + try { + for ( + var s, i = h._getOptionsArray()[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) { + var a = s.value; + if (a.checked) { + t = a; + break; + } + } + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + } else { + h._getOptionsArray().forEach(function (e) { + (e.checked = !1), e.removeAttribute("checked"); + }); + var l = !0, + o = !1, + n = void 0; + try { + for ( + var u, c = h._getOptionsArray()[Symbol.iterator](); + !(l = (u = c.next()).done); + l = !0 + ) { + var d = u.value; + d.value === e && + (d.setAttribute("checked", !0), + (d.checked = !0), + (t = d)); + } + } catch (e) { + (o = !0), (n = e); + } finally { + try { + l || null == c.return || c.return(); + } finally { + if (o) throw n; + } + } + } + return t; + }), + (h.disable = function () { + var e = + !(0 < arguments.length && void 0 !== arguments[0]) || + arguments[0], + t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = h._getOptionsArray()[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) + n.value.setAttribute("disabled", e); + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + }), + h + ); + }), + (f.default.prototype.createColorPicker = function (e) { + f.default._validateParameters("createColorPicker", arguments); + var t = document.createElement("input"); + return ( + (t.type = "color"), + e + ? e instanceof f.default.Color + ? (t.value = e.toString("#rrggbb")) + : ((f.default.prototype._colorMode = "rgb"), + (f.default.prototype._colorMaxes = { + rgb: [255, 255, 255, 255], + hsb: [360, 100, 100, 1], + hsl: [360, 100, 100, 1], + }), + (t.value = f.default.prototype + .color(e) + .toString("#rrggbb"))) + : (t.value = "#000000"), + ((t = p(t, this)).color = function () { + return ( + e && + (e.mode && (f.default.prototype._colorMode = e.mode), + e.maxes && (f.default.prototype._colorMaxes = e.maxes)), + f.default.prototype.color(this.elt.value) + ); + }), + t + ); + }), + (f.default.prototype.createInput = function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : "", + t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : "text", + r = + (f.default._validateParameters("createInput", arguments), + document.createElement("input")); + return ( + r.setAttribute("value", e), + r.setAttribute("type", t), + p(r, this) + ); + }), + (f.default.prototype.createFileInput = function (a) { + var e, + t = + 1 < arguments.length && + void 0 !== arguments[1] && + arguments[1]; + f.default._validateParameters("createFileInput", arguments); + if ( + window.File && + window.FileReader && + window.FileList && + window.Blob + ) + return ( + (e = document.createElement("input")).setAttribute( + "type", + "file", + ), + t && e.setAttribute("multiple", !0), + e.addEventListener( + "change", + function (e) { + var t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = e.target.files[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + f.default.File._load(i, a); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + }, + !1, + ), + p(e, this) + ); + console.log( + "The File APIs are not fully supported in this browser. Cannot create element.", + ); + }), + (f.default.prototype.createVideo = function (e, t) { + return ( + f.default._validateParameters("createVideo", arguments), + m(this, "video", e, t) + ); + }), + (f.default.prototype.createAudio = function (e, t) { + return ( + f.default._validateParameters("createAudio", arguments), + m(this, "audio", e, t) + ); + }), + (f.default.prototype.VIDEO = "video"), + (f.default.prototype.AUDIO = "audio"), + void 0 === navigator.mediaDevices && (navigator.mediaDevices = {}), + void 0 === navigator.mediaDevices.getUserMedia && + (navigator.mediaDevices.getUserMedia = function (r) { + var o = + navigator.webkitGetUserMedia || navigator.mozGetUserMedia; + return o + ? new Promise(function (e, t) { + o.call(navigator, r, e, t); + }) + : Promise.reject( + new Error( + "getUserMedia is not implemented in this browser", + ), + ); + }), + (f.default.prototype.createCapture = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + if ( + (f.default._validateParameters("createCapture", t), + !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) + ) + throw new DOMException( + "getUserMedia not supported in this browser", + ); + for (var o, n = !0, s = !0, i = 0, a = t; i < a.length; i++) { + var l = a[i]; + l === f.default.prototype.VIDEO + ? (s = !1) + : l === f.default.prototype.AUDIO + ? (n = !1) + : "object" === h(l) + ? (u = l) + : "function" == typeof l && (o = l); + } + var u = u || { video: n, audio: s }, + c = document.createElement("video"), + d = + (c.setAttribute("playsinline", ""), + navigator.mediaDevices.getUserMedia(u).then(function (t) { + try { + "srcObject" in c + ? (c.srcObject = t) + : (c.src = window.URL.createObjectURL(t)); + } catch (e) { + c.src = t; + } + }, console.log), + p(c, this, !0)); + return ( + (d.loadedmetadata = !1), + c.addEventListener("loadedmetadata", function () { + c.play(), + c.width + ? ((d.width = c.width), (d.height = c.height)) + : ((d.width = d.elt.width = c.videoWidth), + (d.height = d.elt.height = c.videoHeight)), + (d.loadedmetadata = !0), + o && o(c.srcObject); + }), + d + ); + }), + (f.default.prototype.createElement = function (e, t) { + f.default._validateParameters("createElement", arguments); + e = document.createElement(e); + return void 0 !== t && (e.innerHTML = t), p(e, this); + }), + (f.default.Element.prototype.addClass = function (e) { + return ( + this.elt.className + ? this.hasClass(e) || + (this.elt.className = this.elt.className + " " + e) + : (this.elt.className = e), + this + ); + }), + (f.default.Element.prototype.removeClass = function (e) { + return this.elt.classList.remove(e), this; + }), + (f.default.Element.prototype.hasClass = function (e) { + return this.elt.classList.contains(e); + }), + (f.default.Element.prototype.toggleClass = function (e) { + return ( + this.elt.classList.contains(e) + ? this.elt.classList.remove(e) + : this.elt.classList.add(e), + this + ); + }), + (f.default.Element.prototype.child = function (e) { + return void 0 === e + ? this.elt.childNodes + : ("string" == typeof e + ? ("#" === e[0] && (e = e.substring(1)), + (e = document.getElementById(e))) + : e instanceof f.default.Element && (e = e.elt), + e instanceof HTMLElement && this.elt.appendChild(e), + this); + }), + (f.default.Element.prototype.center = function (e) { + var t = this.elt.style.display, + r = "none" === this.elt.style.display, + o = "none" === this.parent().style.display, + n = { x: this.elt.offsetLeft, y: this.elt.offsetTop }, + s = + (r && this.show(), + o && this.parent().show(), + (this.elt.style.display = "block"), + this.position(0, 0), + Math.abs(this.parent().offsetWidth - this.elt.offsetWidth)), + i = Math.abs( + this.parent().offsetHeight - this.elt.offsetHeight, + ); + return ( + "both" === e || void 0 === e + ? this.position( + s / 2 + this.parent().offsetLeft, + i / 2 + this.parent().offsetTop, + ) + : "horizontal" === e + ? this.position(s / 2 + this.parent().offsetLeft, n.y) + : "vertical" === e && + this.position(n.x, i / 2 + this.parent().offsetTop), + this.style("display", t), + r && this.hide(), + o && this.parent().hide(), + this + ); + }), + (f.default.Element.prototype.html = function () { + return 0 === arguments.length + ? this.elt.innerHTML + : (arguments.length <= 1 || !arguments[1] + ? (this.elt.innerHTML = + arguments.length <= 0 ? void 0 : arguments[0]) + : this.elt.insertAdjacentHTML( + "beforeend", + arguments.length <= 0 ? void 0 : arguments[0], + ), + this); + }), + (f.default.Element.prototype.position = function () { + return 0 === arguments.length + ? { x: this.elt.offsetLeft, y: this.elt.offsetTop } + : ((this.elt.style.position = + "static" !== + (arguments.length <= 2 ? void 0 : arguments[2]) && + "fixed" !== + (arguments.length <= 2 ? void 0 : arguments[2]) && + "relative" !== + (arguments.length <= 2 ? void 0 : arguments[2]) && + "sticky" !== + (arguments.length <= 2 ? void 0 : arguments[2]) && + "initial" !== + (arguments.length <= 2 ? void 0 : arguments[2]) && + "inherit" !== + (arguments.length <= 2 ? void 0 : arguments[2]) + ? "absolute" + : arguments.length <= 2 + ? void 0 + : arguments[2]), + (this.elt.style.left = + (arguments.length <= 0 ? void 0 : arguments[0]) + "px"), + (this.elt.style.top = + (arguments.length <= 1 ? void 0 : arguments[1]) + "px"), + (this.x = arguments.length <= 0 ? void 0 : arguments[0]), + (this.y = arguments.length <= 1 ? void 0 : arguments[1]), + this); + }), + (f.default.Element.prototype._translate = function () { + this.elt.style.position = "absolute"; + var e = ""; + return ( + this.elt.style.transform && + (e = (e = this.elt.style.transform.replace( + /translate3d\(.*\)/g, + "", + )).replace(/translate[X-Z]?\(.*\)/g, "")), + 2 === arguments.length + ? (this.elt.style.transform = + "translate(" + + (arguments.length <= 0 ? void 0 : arguments[0]) + + "px, " + + (arguments.length <= 1 ? void 0 : arguments[1]) + + "px)") + : 2 < arguments.length && + ((this.elt.style.transform = + "translate3d(" + + (arguments.length <= 0 ? void 0 : arguments[0]) + + "px," + + (arguments.length <= 1 ? void 0 : arguments[1]) + + "px," + + (arguments.length <= 2 ? void 0 : arguments[2]) + + "px)"), + (this.elt.parentElement.style.perspective = + 3 === arguments.length + ? "1000px" + : (arguments.length <= 3 ? void 0 : arguments[3]) + + "px")), + (this.elt.style.transform += e), + this + ); + }), + (f.default.Element.prototype._rotate = function () { + var e = ""; + return ( + this.elt.style.transform && + (e = (e = this.elt.style.transform.replace( + /rotate3d\(.*\)/g, + "", + )).replace(/rotate[X-Z]?\(.*\)/g, "")), + 1 === arguments.length + ? (this.elt.style.transform = + "rotate(" + + (arguments.length <= 0 ? void 0 : arguments[0]) + + "deg)") + : 2 === arguments.length + ? (this.elt.style.transform = + "rotate(" + + (arguments.length <= 0 ? void 0 : arguments[0]) + + "deg, " + + (arguments.length <= 1 ? void 0 : arguments[1]) + + "deg)") + : 3 === arguments.length && + ((this.elt.style.transform = + "rotateX(" + + (arguments.length <= 0 ? void 0 : arguments[0]) + + "deg)"), + (this.elt.style.transform += + "rotateY(" + + (arguments.length <= 1 ? void 0 : arguments[1]) + + "deg)"), + (this.elt.style.transform += + "rotateZ(" + + (arguments.length <= 2 ? void 0 : arguments[2]) + + "deg)")), + (this.elt.style.transform += e), + this + ); + }), + (f.default.Element.prototype.style = function (e, t) { + if ( + void 0 === + (t = + t instanceof f.default.Color + ? "rgba(" + + t.levels[0] + + "," + + t.levels[1] + + "," + + t.levels[2] + + "," + + t.levels[3] / 255 + + ")" + : t) + ) { + if (-1 === e.indexOf(":")) + return window.getComputedStyle(this.elt).getPropertyValue(e); + for (var r = e.split(";"), o = 0; o < r.length; o++) { + var n = r[o].split(":"); + n[0] && n[1] && (this.elt.style[n[0].trim()] = n[1].trim()); + } + } else + (this.elt.style[e] = t), + ("width" !== e && + "height" !== e && + "left" !== e && + "top" !== e) || + ((t = window + .getComputedStyle(this.elt) + .getPropertyValue(e) + .replace(/[^\d.]/g, "")), + (this[e] = Math.round(parseFloat(t, 10)))); + return this; + }), + (f.default.Element.prototype.attribute = function (e, t) { + if ( + null == this.elt.firstChild || + ("checkbox" !== this.elt.firstChild.type && + "radio" !== this.elt.firstChild.type) + ) + return void 0 === t + ? this.elt.getAttribute(e) + : (this.elt.setAttribute(e, t), this); + if (void 0 === t) return this.elt.firstChild.getAttribute(e); + for (var r = 0; r < this.elt.childNodes.length; r++) + this.elt.childNodes[r].setAttribute(e, t); + }), + (f.default.Element.prototype.removeAttribute = function (e) { + if ( + null != this.elt.firstChild && + ("checkbox" === this.elt.firstChild.type || + "radio" === this.elt.firstChild.type) + ) + for (var t = 0; t < this.elt.childNodes.length; t++) + this.elt.childNodes[t].removeAttribute(e); + return this.elt.removeAttribute(e), this; + }), + (f.default.Element.prototype.value = function () { + return 0 < arguments.length + ? ((this.elt.value = + arguments.length <= 0 ? void 0 : arguments[0]), + this) + : "range" === this.elt.type + ? parseFloat(this.elt.value) + : this.elt.value; + }), + (f.default.Element.prototype.show = function () { + return (this.elt.style.display = "block"), this; + }), + (f.default.Element.prototype.hide = function () { + return (this.elt.style.display = "none"), this; + }), + (f.default.Element.prototype.size = function (e, t) { + if (0 === arguments.length) + return { + width: this.elt.offsetWidth, + height: this.elt.offsetHeight, + }; + var r = e, + o = t, + n = f.default.prototype.AUTO; + if (r !== n || o !== n) { + if ( + (r === n + ? (r = (t * this.width) / this.height) + : o === n && (o = (e * this.height) / this.width), + this.elt instanceof HTMLCanvasElement) + ) { + var s, + i = {}, + a = this.elt.getContext("2d"); + for (s in a) i[s] = a[s]; + for (s in (this.elt.setAttribute( + "width", + r * this._pInst._pixelDensity, + ), + this.elt.setAttribute( + "height", + o * this._pInst._pixelDensity, + ), + (this.elt.style.width = r + "px"), + (this.elt.style.height = o + "px"), + this._pInst.scale( + this._pInst._pixelDensity, + this._pInst._pixelDensity, + ), + i)) + this.elt.getContext("2d")[s] = i[s]; + } else + (this.elt.style.width = r + "px"), + (this.elt.style.height = o + "px"), + (this.elt.width = r), + (this.elt.height = o); + (this.width = this.elt.offsetWidth), + (this.height = this.elt.offsetHeight), + this._pInst && + this._pInst._curElement && + this._pInst._curElement.elt === this.elt && + (this._pInst._setProperty("width", this.elt.offsetWidth), + this._pInst._setProperty("height", this.elt.offsetHeight)); + } + return this; + }), + (f.default.Element.prototype.remove = function () { + this instanceof f.default.MediaElement && + (this.stop(), + null !== (t = this.elt.srcObject) && + t.getTracks().forEach(function (e) { + e.stop(); + })); + var e, + t = this._pInst._elements.indexOf(this); + for (e in (-1 !== t && this._pInst._elements.splice(t, 1), + this._events)) + this.elt.removeEventListener(e, this._events[e]); + this.elt && + this.elt.parentNode && + this.elt.parentNode.removeChild(this.elt); + }), + (f.default.Element.prototype.drop = function (a, l) { + var e; + return ( + window.File && + window.FileReader && + window.FileList && + window.Blob + ? (this._dragDisabled || + ((this._dragDisabled = !0), + this.elt.addEventListener( + "dragover", + (e = function (e) { + e.preventDefault(); + }), + ), + this.elt.addEventListener("dragleave", e)), + f.default.Element._attachListener( + "drop", + function (e) { + e.preventDefault(), + "function" == typeof l && l.call(this, e); + var e = e.dataTransfer.files, + t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = e[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + f.default.File._load(i, a); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + }, + this, + )) + : console.log( + "The File APIs are not fully supported in this browser.", + ), + this + ); + }), + (f.default.Element.prototype.draggable = function (r) { + var e, + o = "ontouchstart" in window, + n = 0, + s = 0, + i = 0, + a = 0, + l = o ? "touchend" : "mouseup", + u = o ? "touchmove" : "mousemove"; + function c(e) { + var t; + (e = e || window.event), + (a = o + ? ((t = e.changedTouches), + (n = i - parseInt(t[0].clientX)), + (s = a - parseInt(t[0].clientY)), + (i = parseInt(t[0].clientX)), + parseInt(t[0].clientY)) + : ((n = i - parseInt(e.clientX)), + (s = a - parseInt(e.clientY)), + (i = parseInt(e.clientX)), + parseInt(e.clientY))), + (r.style.left = r.offsetLeft - n + "px"), + (r.style.top = r.offsetTop - s + "px"); + } + function d() { + document.removeEventListener(l, d, !1), + document.removeEventListener(u, c, !1); + } + return ( + void 0 === r + ? (e = r = this.elt) + : r !== this.elt && + r.elt !== this.elt && + ((r = r.elt), (e = this.elt)), + e.addEventListener( + o ? "touchstart" : "mousedown", + function (e) { + { + var t; + (e = e || window.event), + (a = o + ? ((t = e.changedTouches), + (i = parseInt(t[0].clientX)), + parseInt(t[0].clientY)) + : ((i = parseInt(e.clientX)), parseInt(e.clientY))); + } + return ( + document.addEventListener(l, d, !1), + document.addEventListener(u, c, !1), + !1 + ); + }, + !1, + ), + (e.style.cursor = "move"), + this + ); + }); + function y(e, t, r, o) { + d(this, y), + (this.callback = e), + (this.time = t), + (this.id = r), + (this.val = o); + } + (t = (function (t) { + var r = i; + if ("function" != typeof t && null !== t) + throw new TypeError( + "Super expression must either be null or a function", + ); + (r.prototype = Object.create(t && t.prototype, { + constructor: { value: r, writable: !0, configurable: !0 }, + })), + t && l(r, t); + var s = u(i); + function i(o, e) { + d(this, i); + var n = c((e = s.call(this, o, e))); + return ( + (e.elt.crossOrigin = "anonymous"), + (e._prevTime = 0), + (e._cueIDCounter = 0), + (e._cues = []), + (e.pixels = []), + (e._pixelsState = c(e)), + (e._pixelDensity = 1), + (e._modified = !1), + (e._frameOnCanvas = -1), + Object.defineProperty(n, "src", { + get: function () { + var e = n.elt.children[0].src, + t = n.elt.src === window.location.href ? "" : n.elt.src; + return e === window.location.href ? t : e; + }, + set: function (e) { + for (var t = 0; t < n.elt.children.length; t++) + n.elt.removeChild(n.elt.children[t]); + var r = document.createElement("source"); + (r.src = e), + o.appendChild(r), + (n.elt.src = e), + (n.modified = !0); + }, + }), + (n._onended = function () {}), + (n.elt.onended = function () { + n._onended(n); + }), + e + ); + } + return ( + a(i, [ + { + key: "play", + value: function () { + var e; + return ( + this.elt.currentTime === this.elt.duration && + (this.elt.currentTime = 0), + 1 < this.elt.readyState || this.elt.load(), + (e = this.elt.play()) && + e.catch && + e.catch(function (e) { + "NotAllowedError" === e.name + ? console.error(e) + : console.error( + "Media play method encountered an unexpected error", + e, + ); + }), + this + ); + }, + }, + { + key: "stop", + value: function () { + return this.elt.pause(), (this.elt.currentTime = 0), this; + }, + }, + { + key: "pause", + value: function () { + return this.elt.pause(), this; + }, + }, + { + key: "loop", + value: function () { + return this.elt.setAttribute("loop", !0), this.play(), this; + }, + }, + { + key: "noLoop", + value: function () { + return this.elt.removeAttribute("loop"), this; + }, + }, + { + key: "_setupAutoplayFailDetection", + value: function () { + var t = setTimeout(function () { + console.error(e); + }, 500); + this.elt.addEventListener( + "play", + function () { + return clearTimeout(t); + }, + { passive: !0, once: !0 }, + ); + }, + }, + { + key: "autoplay", + value: function (e) { + var t = this, + r = this.elt.getAttribute("autoplay"); + return ( + this.elt.setAttribute("autoplay", e), + e && + !r && + ((e = function () { + return t._setupAutoplayFailDetection(); + }), + 4 === this.elt.readyState + ? e() + : this.elt.addEventListener("canplay", e, { + passive: !0, + once: !0, + })), + this + ); + }, + }, + { + key: "volume", + value: function (e) { + if (void 0 === e) return this.elt.volume; + this.elt.volume = e; + }, + }, + { + key: "speed", + value: function (e) { + if (void 0 === e) + return this.presetPlaybackRate || this.elt.playbackRate; + this.loadedmetadata + ? (this.elt.playbackRate = e) + : (this.presetPlaybackRate = e); + }, + }, + { + key: "time", + value: function (e) { + return void 0 === e + ? this.elt.currentTime + : ((this.elt.currentTime = e), this); + }, + }, + { + key: "duration", + value: function () { + return this.elt.duration; + }, + }, + { + key: "_ensureCanvas", + value: function () { + this.canvas || + ((this.canvas = document.createElement("canvas")), + (this.drawingContext = this.canvas.getContext("2d")), + this.setModified(!0)); + var e = this._frameOnCanvas !== this._pInst.frameCount; + this.loadedmetadata && + e && + (this.canvas.width !== this.elt.width && + ((this.canvas.width = this.elt.width), + (this.canvas.height = this.elt.height), + (this.width = this.canvas.width), + (this.height = this.canvas.height)), + this.drawingContext.clearRect( + 0, + 0, + this.canvas.width, + this.canvas.height, + ), + this.drawingContext.drawImage( + this.elt, + 0, + 0, + this.canvas.width, + this.canvas.height, + ), + this.setModified(!0), + (this._frameOnCanvas = this._pInst.frameCount)); + }, + }, + { + key: "loadPixels", + value: function () { + this._ensureCanvas(); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return f.default.Renderer2D.prototype.loadPixels.apply( + this, + t, + ); + }, + }, + { + key: "updatePixels", + value: function (e, t, r, o) { + return ( + this.loadedmetadata && + (this._ensureCanvas(), + f.default.Renderer2D.prototype.updatePixels.call( + this, + e, + t, + r, + o, + )), + this.setModified(!0), + this + ); + }, + }, + { + key: "get", + value: function () { + this._ensureCanvas(); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return f.default.Renderer2D.prototype.get.apply(this, t); + }, + }, + { + key: "_getPixel", + value: function () { + this.loadPixels(); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return f.default.Renderer2D.prototype._getPixel.apply( + this, + t, + ); + }, + }, + { + key: "set", + value: function (e, t, r) { + this.loadedmetadata && + (this._ensureCanvas(), + f.default.Renderer2D.prototype.set.call(this, e, t, r), + this.setModified(!0)); + }, + }, + { + key: "copy", + value: function () { + this._ensureCanvas(); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + f.default.prototype.copy.apply(this, t); + }, + }, + { + key: "mask", + value: function () { + this.loadPixels(), this.setModified(!0); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + f.default.Image.prototype.mask.apply(this, t); + }, + }, + { + key: "isModified", + value: function () { + return this._modified; + }, + }, + { + key: "setModified", + value: function (e) { + this._modified = e; + }, + }, + { + key: "onended", + value: function (e) { + return (this._onended = e), this; + }, + }, + { + key: "connect", + value: function (e) { + var t, r; + if ( + "function" == typeof f.default.prototype.getAudioContext + ) + (t = f.default.prototype.getAudioContext()), + (r = f.default.soundOut.input); + else + try { + r = (t = e.context).destination; + } catch (e) { + throw "connect() is meant to be used with Web Audio API or p5.sound.js"; + } + this.audioSourceNode || + ((this.audioSourceNode = t.createMediaElementSource( + this.elt, + )), + this.audioSourceNode.connect(r)), + e + ? e.input + ? this.audioSourceNode.connect(e.input) + : this.audioSourceNode.connect(e) + : this.audioSourceNode.connect(r); + }, + }, + { + key: "disconnect", + value: function () { + if (!this.audioSourceNode) throw "nothing to disconnect"; + this.audioSourceNode.disconnect(); + }, + }, + { + key: "showControls", + value: function () { + (this.elt.style["text-align"] = "inherit"), + (this.elt.controls = !0); + }, + }, + { + key: "hideControls", + value: function () { + this.elt.controls = !1; + }, + }, + { + key: "addCue", + value: function (e, t, r) { + var o = this._cueIDCounter++, + t = new y(t, e, o, r); + return ( + this._cues.push(t), + this.elt.ontimeupdate || + (this.elt.ontimeupdate = this._onTimeUpdate.bind(this)), + o + ); + }, + }, + { + key: "removeCue", + value: function (e) { + for (var t = 0; t < this._cues.length; t++) + this._cues[t].id === e && + (console.log(e), this._cues.splice(t, 1)); + 0 === this._cues.length && (this.elt.ontimeupdate = null); + }, + }, + { + key: "clearCues", + value: function () { + (this._cues = []), (this.elt.ontimeupdate = null); + }, + }, + { + key: "_onTimeUpdate", + value: function () { + for ( + var e = this.time(), t = 0; + t < this._cues.length; + t++ + ) { + var r = this._cues[t].time, + o = this._cues[t].val; + this._prevTime < r && r <= e && this._cues[t].callback(o); + } + this._prevTime = e; + }, + }, + ]), + i + ); + })(f.default.Element)), + (f.default.MediaElement = t), + (t = (function () { + function r(e, t) { + d(this, r), (this.file = e), (this._pInst = t); + t = e.type.split("/"); + (this.type = t[0]), + (this.subtype = t[1]), + (this.name = e.name), + (this.size = e.size), + (this.data = void 0); + } + return ( + a(r, null, [ + { + key: "_createLoader", + value: function (o, n) { + var e = new FileReader(); + return ( + (e.onload = function (e) { + var t, + r = new f.default.File(o); + "application/json" === r.file.type + ? (r.data = JSON.parse(e.target.result)) + : "text/xml" === r.file.type + ? ((t = new DOMParser().parseFromString( + e.target.result, + "text/xml", + )), + (r.data = new f.default.XML(t.documentElement))) + : (r.data = e.target.result), + n(r); + }), + e + ); + }, + }, + { + key: "_load", + value: function (e, t) { + var r; + /^text\//.test(e.type) || "application/json" === e.type + ? f.default.File._createLoader(e, t).readAsText(e) + : /^(video|audio)\//.test(e.type) + ? (((r = new f.default.File(e)).data = + URL.createObjectURL(e)), + t(r)) + : f.default.File._createLoader(e, t).readAsDataURL(e); + }, + }, + ]), + r + ); + })()), + (f.default.File = t), + (t = f.default); + o.default = t; + }, + { + "../core/main": 275, + "core-js/modules/es.array.every": 153, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.promise": 183, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.trim": 201, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + "core-js/modules/web.url": 240, + }, + ], + 292: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (y = e("../core/main")) && y.__esModule ? y : { default: y }, + s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + (n.default.prototype.deviceOrientation = + 1 < window.innerWidth / window.innerHeight + ? "landscape" + : "portrait"), + (n.default.prototype.accelerationX = 0), + (n.default.prototype.accelerationY = 0), + (n.default.prototype.accelerationZ = 0), + (n.default.prototype.pAccelerationX = 0), + (n.default.prototype.pAccelerationY = 0), + (n.default.prototype.pAccelerationZ = 0), + (n.default.prototype._updatePAccelerations = function () { + this._setProperty("pAccelerationX", this.accelerationX), + this._setProperty("pAccelerationY", this.accelerationY), + this._setProperty("pAccelerationZ", this.accelerationZ); + }), + (n.default.prototype.rotationX = 0), + (n.default.prototype.rotationY = 0), + (n.default.prototype.rotationZ = 0), + (n.default.prototype.pRotationX = 0), + (n.default.prototype.pRotationY = 0); + var l = (n.default.prototype.pRotationZ = 0), + u = 0, + c = 0, + d = "clockwise", + h = "clockwise", + f = "clockwise", + p = + ((n.default.prototype.pRotateDirectionX = void 0), + (n.default.prototype.pRotateDirectionY = void 0), + (n.default.prototype.pRotateDirectionZ = void 0), + (n.default.prototype._updatePRotations = function () { + this._setProperty("pRotationX", this.rotationX), + this._setProperty("pRotationY", this.rotationY), + this._setProperty("pRotationZ", this.rotationZ); + }), + (n.default.prototype.turnAxis = void 0), + 0.5), + m = 30, + y = + ((n.default.prototype.setMoveThreshold = function (e) { + n.default._validateParameters("setMoveThreshold", arguments), + (p = e); + }), + (n.default.prototype.setShakeThreshold = function (e) { + n.default._validateParameters("setShakeThreshold", arguments), + (m = e); + }), + (n.default.prototype._ondeviceorientation = function (e) { + this._updatePRotations(), + this._angleMode === s.radians && + ((e.beta = e.beta * (_PI / 180)), + (e.gamma = e.gamma * (_PI / 180)), + (e.alpha = e.alpha * (_PI / 180))), + this._setProperty("rotationX", e.beta), + this._setProperty("rotationY", e.gamma), + this._setProperty("rotationZ", e.alpha), + this._handleMotion(); + }), + (n.default.prototype._ondevicemotion = function (e) { + this._updatePAccelerations(), + this._setProperty("accelerationX", 2 * e.acceleration.x), + this._setProperty("accelerationY", 2 * e.acceleration.y), + this._setProperty("accelerationZ", 2 * e.acceleration.z), + this._handleMotion(); + }), + (n.default.prototype._handleMotion = function () { + 90 === window.orientation || -90 === window.orientation + ? this._setProperty("deviceOrientation", "landscape") + : 0 === window.orientation + ? this._setProperty("deviceOrientation", "portrait") + : void 0 === window.orientation && + this._setProperty("deviceOrientation", "undefined"); + var e, + t, + r, + o, + n, + s = this._isGlobal ? window : this; + "function" == typeof s.deviceMoved && + (Math.abs(this.accelerationX - this.pAccelerationX) > p || + Math.abs(this.accelerationY - this.pAccelerationY) > p || + Math.abs(this.accelerationZ - this.pAccelerationZ) > p) && + s.deviceMoved(), + "function" == typeof s.deviceTurned && + ((t = this.rotationX + 180), + (e = this.pRotationX + 180), + (r = l + 180), + (0 < t - e && t - e < 270) || t - e < -270 + ? (d = "clockwise") + : (t - e < 0 || 270 < t - e) && (d = "counter-clockwise"), + d !== this.pRotateDirectionX && (r = t), + 90 < Math.abs(t - r) && + Math.abs(t - r) < 270 && + ((r = t), + this._setProperty("turnAxis", "X"), + s.deviceTurned()), + (this.pRotateDirectionX = d), + (l = r - 180), + (e = this.rotationY + 180), + (t = this.pRotationY + 180), + (r = u + 180), + (0 < e - t && e - t < 270) || e - t < -270 + ? (h = "clockwise") + : (e - t < 0 || 270 < e - this.pRotationY) && + (h = "counter-clockwise"), + h !== this.pRotateDirectionY && (r = e), + 90 < Math.abs(e - r) && + Math.abs(e - r) < 270 && + ((r = e), + this._setProperty("turnAxis", "Y"), + s.deviceTurned()), + (this.pRotateDirectionY = h), + (u = r - 180), + (0 < this.rotationZ - this.pRotationZ && + this.rotationZ - this.pRotationZ < 270) || + this.rotationZ - this.pRotationZ < -270 + ? (f = "clockwise") + : (this.rotationZ - this.pRotationZ < 0 || + 270 < this.rotationZ - this.pRotationZ) && + (f = "counter-clockwise"), + f !== this.pRotateDirectionZ && (c = this.rotationZ), + 90 < Math.abs(this.rotationZ - c) && + Math.abs(this.rotationZ - c) < 270 && + ((c = this.rotationZ), + this._setProperty("turnAxis", "Z"), + s.deviceTurned()), + (this.pRotateDirectionZ = f), + this._setProperty("turnAxis", void 0)), + "function" == typeof s.deviceShaken && + (null !== this.pAccelerationX && + ((o = Math.abs(this.accelerationX - this.pAccelerationX)), + (n = Math.abs(this.accelerationY - this.pAccelerationY))), + m < o + n && s.deviceShaken()); + }), + n.default); + r.default = y; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 293: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (o.default.prototype.isKeyPressed = !1), + (o.default.prototype.keyIsPressed = !1), + (o.default.prototype.key = ""), + (o.default.prototype.keyCode = 0), + (o.default.prototype._onkeydown = function (e) { + var t; + this._downKeys[e.which] || + (this._setProperty("isKeyPressed", !0), + this._setProperty("keyIsPressed", !0), + this._setProperty("keyCode", e.which), + (this._downKeys[e.which] = !0), + this._setProperty( + "key", + e.key || String.fromCharCode(e.which) || e.which, + ), + "function" != + typeof (t = this._isGlobal ? window : this).keyPressed || + e.charCode || + (!1 === t.keyPressed(e) && e.preventDefault())); + }), + (o.default.prototype._onkeyup = function (e) { + (this._downKeys[e.which] = !1), + this._areDownKeys() || + (this._setProperty("isKeyPressed", !1), + this._setProperty("keyIsPressed", !1)), + this._setProperty("_lastKeyCodeTyped", null), + this._setProperty( + "key", + e.key || String.fromCharCode(e.which) || e.which, + ), + this._setProperty("keyCode", e.which); + var t = this._isGlobal ? window : this; + "function" == typeof t.keyReleased && + !1 === t.keyReleased(e) && + e.preventDefault(); + }), + (o.default.prototype._onkeypress = function (e) { + var t; + e.which !== this._lastKeyCodeTyped && + (this._setProperty("_lastKeyCodeTyped", e.which), + this._setProperty( + "key", + e.key || String.fromCharCode(e.which) || e.which, + ), + "function" == + typeof (t = this._isGlobal ? window : this).keyTyped && + !1 === t.keyTyped(e) && + e.preventDefault()); + }), + (o.default.prototype._onblur = function (e) { + this._downKeys = {}; + }), + (o.default.prototype.keyIsDown = function (e) { + return ( + o.default._validateParameters("keyIsDown", arguments), + this._downKeys[e] || !1 + ); + }), + (o.default.prototype._areDownKeys = function () { + for (var e in this._downKeys) + if ( + this._downKeys.hasOwnProperty(e) && + !0 === this._downKeys[e] + ) + return !0; + return !1; + }); + e = o.default; + r.default = e; + }, + { "../core/main": 275 }, + ], + 294: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.string.includes"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + (n.default.prototype.movedX = 0), + (n.default.prototype.movedY = 0), + (n.default.prototype._hasMouseInteracted = !1), + (n.default.prototype.mouseX = 0), + (n.default.prototype.mouseY = 0), + (n.default.prototype.pmouseX = 0), + (n.default.prototype.pmouseY = 0), + (n.default.prototype.winMouseX = 0), + (n.default.prototype.winMouseY = 0), + (n.default.prototype.pwinMouseX = 0), + (n.default.prototype.pwinMouseY = 0), + (n.default.prototype.mouseButton = 0), + (n.default.prototype.mouseIsPressed = !1), + (n.default.prototype._updateNextMouseCoords = function (e) { + var t, r, o, n, s; + null !== this._curElement && + (!e.touches || 0 < e.touches.length) && + ((t = this._curElement.elt), + (r = this.width), + (o = this.height), + (n = e) && + !n.clientX && + (n.touches + ? (n = n.touches[0]) + : n.changedTouches && (n = n.changedTouches[0])), + (s = t.getBoundingClientRect()), + (r = t.scrollWidth / r || 1), + (t = t.scrollHeight / o || 1), + (o = { + x: (n.clientX - s.left) / r, + y: (n.clientY - s.top) / t, + winX: n.clientX, + winY: n.clientY, + id: n.identifier, + }), + this._setProperty("movedX", e.movementX), + this._setProperty("movedY", e.movementY), + this._setProperty("mouseX", o.x), + this._setProperty("mouseY", o.y), + this._setProperty("winMouseX", o.winX), + this._setProperty("winMouseY", o.winY)), + this._hasMouseInteracted || + (this._updateMouseCoords(), + this._setProperty("_hasMouseInteracted", !0)); + }), + (n.default.prototype._updateMouseCoords = function () { + this._setProperty("pmouseX", this.mouseX), + this._setProperty("pmouseY", this.mouseY), + this._setProperty("pwinMouseX", this.winMouseX), + this._setProperty("pwinMouseY", this.winMouseY), + this._setProperty("_pmouseWheelDeltaY", this._mouseWheelDeltaY); + }), + (n.default.prototype._setMouseButton = function (e) { + 1 === e.button + ? this._setProperty("mouseButton", s.CENTER) + : 2 === e.button + ? this._setProperty("mouseButton", s.RIGHT) + : this._setProperty("mouseButton", s.LEFT); + }), + (n.default.prototype._onmousemove = function (e) { + var t = this._isGlobal ? window : this; + this._updateNextMouseCoords(e), + this.mouseIsPressed + ? "function" == typeof t.mouseDragged + ? !1 === t.mouseDragged(e) && e.preventDefault() + : "function" == typeof t.touchMoved && + !1 === t.touchMoved(e) && + e.preventDefault() + : "function" == typeof t.mouseMoved && + !1 === t.mouseMoved(e) && + e.preventDefault(); + }), + (n.default.prototype._onmousedown = function (e) { + var t = this._isGlobal ? window : this; + this._setProperty("mouseIsPressed", !0), + this._setMouseButton(e), + this._updateNextMouseCoords(e), + "function" == typeof t.mousePressed + ? !1 === t.mousePressed(e) && e.preventDefault() + : navigator.userAgent.toLowerCase().includes("safari") && + "function" == typeof t.touchStarted && + !1 === t.touchStarted(e) && + e.preventDefault(); + }), + (n.default.prototype._onmouseup = function (e) { + var t = this._isGlobal ? window : this; + this._setProperty("mouseIsPressed", !1), + "function" == typeof t.mouseReleased + ? !1 === t.mouseReleased(e) && e.preventDefault() + : "function" == typeof t.touchEnded && + !1 === t.touchEnded(e) && + e.preventDefault(); + }), + (n.default.prototype._ondragend = n.default.prototype._onmouseup), + (n.default.prototype._ondragover = + n.default.prototype._onmousemove), + (n.default.prototype._onclick = function (e) { + var t = this._isGlobal ? window : this; + "function" == typeof t.mouseClicked && + !1 === t.mouseClicked(e) && + e.preventDefault(); + }), + (n.default.prototype._ondblclick = function (e) { + var t = this._isGlobal ? window : this; + "function" == typeof t.doubleClicked && + !1 === t.doubleClicked(e) && + e.preventDefault(); + }), + (n.default.prototype._mouseWheelDeltaY = 0), + (n.default.prototype._pmouseWheelDeltaY = 0), + (n.default.prototype._onwheel = function (e) { + var t = this._isGlobal ? window : this; + this._setProperty("_mouseWheelDeltaY", e.deltaY), + "function" == typeof t.mouseWheel && + ((e.delta = e.deltaY), + !1 === t.mouseWheel(e) && e.preventDefault()); + }), + (n.default.prototype.requestPointerLock = function () { + var e = this._curElement.elt; + return ( + (e.requestPointerLock = + e.requestPointerLock || e.mozRequestPointerLock), + e.requestPointerLock + ? (e.requestPointerLock(), !0) + : (console.log( + "requestPointerLock is not implemented in this browser", + ), + !1) + ); + }), + (n.default.prototype.exitPointerLock = function () { + document.exitPointerLock(); + }); + e = n.default; + r.default = e; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 295: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.string.includes"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (e.default.prototype.touches = []), + (e.default.prototype._updateTouchCoords = function (e) { + if (null !== this._curElement) { + for (var t = [], r = 0; r < e.touches.length; r++) + t[r] = (function (e, t, r, o) { + var n = + 4 < arguments.length && void 0 !== arguments[4] + ? arguments[4] + : 0, + s = e.getBoundingClientRect(), + t = e.scrollWidth / t || 1, + e = e.scrollHeight / r || 1, + r = o.touches[n] || o.changedTouches[n]; + return { + x: (r.clientX - s.left) / t, + y: (r.clientY - s.top) / e, + winX: r.clientX, + winY: r.clientY, + id: r.identifier, + }; + })(this._curElement.elt, this.width, this.height, e, r); + this._setProperty("touches", t); + } + }), + (e.default.prototype._ontouchstart = function (e) { + var t = this._isGlobal ? window : this; + this._setProperty("mouseIsPressed", !0), + this._updateTouchCoords(e), + this._updateNextMouseCoords(e), + this._updateMouseCoords(), + "function" == typeof t.touchStarted + ? !1 === t.touchStarted(e) && e.preventDefault() + : navigator.userAgent.toLowerCase().includes("safari") && + "function" == typeof t.mousePressed && + !1 === t.mousePressed(e) && + e.preventDefault(); + }), + (e.default.prototype._ontouchmove = function (e) { + var t = this._isGlobal ? window : this; + this._updateTouchCoords(e), + this._updateNextMouseCoords(e), + "function" == typeof t.touchMoved + ? !1 === t.touchMoved(e) && e.preventDefault() + : "function" == typeof t.mouseDragged && + !1 === t.mouseDragged(e) && + e.preventDefault(); + }), + (e.default.prototype._ontouchend = function (e) { + this._setProperty("mouseIsPressed", !1), + this._updateTouchCoords(e), + this._updateNextMouseCoords(e); + var t = this._isGlobal ? window : this; + "function" == typeof t.touchEnded + ? !1 === t.touchEnded(e) && e.preventDefault() + : "function" == typeof t.mouseReleased && + !1 === t.mouseReleased(e) && + e.preventDefault(); + }); + e = e.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.string.includes": 191, + }, + ], + 296: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.int32-array"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.int32-array"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var U, + N, + B, + G, + V = { + _toPixels: function (e) { + var t, r; + return e instanceof ImageData + ? e.data + : e.getContext("2d") + ? e.getContext("2d").getImageData(0, 0, e.width, e.height) + .data + : e.getContext("webgl") + ? ((r = + (t = e.getContext("webgl")).drawingBufferWidth * + t.drawingBufferHeight * + 4), + (r = new Uint8Array(r)), + t.readPixels( + 0, + 0, + e.width, + e.height, + t.RGBA, + t.UNSIGNED_BYTE, + r, + ), + r) + : void 0; + }, + _getARGB: function (e, t) { + t *= 4; + return ( + ((e[3 + t] << 24) & 4278190080) | + ((e[t] << 16) & 16711680) | + ((e[1 + t] << 8) & 65280) | + (255 & e[2 + t]) + ); + }, + _setPixels: function (e, t) { + for (var r, o = 0, n = e.length; o < n; o++) + (e[0 + (r = 4 * o)] = (16711680 & t[o]) >>> 16), + (e[1 + r] = (65280 & t[o]) >>> 8), + (e[2 + r] = 255 & t[o]), + (e[3 + r] = (4278190080 & t[o]) >>> 24); + }, + _toImageData: function (e) { + return e instanceof ImageData + ? e + : e.getContext("2d").getImageData(0, 0, e.width, e.height); + }, + _createImageData: function (e, t) { + return ( + (V._tmpCanvas = document.createElement("canvas")), + (V._tmpCtx = V._tmpCanvas.getContext("2d")), + this._tmpCtx.createImageData(e, t) + ); + }, + apply: function (e, t, r) { + var o = e.getContext("2d"), + n = o.getImageData(0, 0, e.width, e.height), + t = t(n, r); + t instanceof ImageData + ? o.putImageData(t, 0, 0, 0, 0, e.width, e.height) + : o.putImageData(n, 0, 0, 0, 0, e.width, e.height); + }, + threshold: function (e, t) { + for ( + var r = V._toPixels(e), + o = (void 0 === t && (t = 0.5), Math.floor(255 * t)), + n = 0; + n < r.length; + n += 4 + ) { + var s = void 0, + s = + o <= 0.2126 * r[n] + 0.7152 * r[n + 1] + 0.0722 * r[n + 2] + ? 255 + : 0; + r[n] = r[n + 1] = r[n + 2] = s; + } + }, + gray: function (e) { + for (var t = V._toPixels(e), r = 0; r < t.length; r += 4) { + var o = t[r], + n = t[r + 1], + s = t[r + 2]; + t[r] = + t[r + 1] = + t[r + 2] = + 0.2126 * o + 0.7152 * n + 0.0722 * s; + } + }, + opaque: function (e) { + for (var t = V._toPixels(e), r = 0; r < t.length; r += 4) + t[r + 3] = 255; + return t; + }, + invert: function (e) { + for (var t = V._toPixels(e), r = 0; r < t.length; r += 4) + (t[r] = 255 - t[r]), + (t[r + 1] = 255 - t[r + 1]), + (t[r + 2] = 255 - t[r + 2]); + }, + posterize: function (e, t) { + var r = V._toPixels(e); + if ((t = void 0 === t ? 4 : t) < 2 || 255 < t) + throw new Error( + "Level must be greater than 2 and less than 255 for posterize", + ); + for (var o = t - 1, n = 0; n < r.length; n += 4) { + var s = r[n], + i = r[n + 1], + a = r[n + 2]; + (r[n] = (255 * ((s * t) >> 8)) / o), + (r[n + 1] = (255 * ((i * t) >> 8)) / o), + (r[n + 2] = (255 * ((a * t) >> 8)) / o); + } + }, + dilate: function (e) { + for ( + var t, + r, + o, + n, + s, + i, + a, + l, + u, + c = V._toPixels(e), + d = 0, + h = c.length ? c.length / 4 : 0, + f = new Int32Array(h); + d < h; + + ) + for (r = (t = d) + e.width; d < r; ) + (n = o = V._getARGB(c, d)), + (u = d - 1) < t && (u = d), + r <= (l = d + 1) && (l = d), + (s = d - e.width) < 0 && (s = 0), + h <= (i = d + e.width) && (i = d), + (s = V._getARGB(c, s)), + (u = V._getARGB(c, u)), + (i = V._getARGB(c, i)), + (n = + 77 * ((n >> 16) & 255) + + 151 * ((n >> 8) & 255) + + 28 * (255 & n)) < + (a = + 77 * ((u >> 16) & 255) + + 151 * ((u >> 8) & 255) + + 28 * (255 & u)) && ((o = u), (n = a)), + n < + (a = + 77 * (((u = V._getARGB(c, l)) >> 16) & 255) + + 151 * ((u >> 8) & 255) + + 28 * (255 & u)) && ((o = u), (n = a)), + n < + (l = + 77 * ((s >> 16) & 255) + + 151 * ((s >> 8) & 255) + + 28 * (255 & s)) && ((o = s), (n = l)), + n < + (u = + 77 * ((i >> 16) & 255) + + 151 * ((i >> 8) & 255) + + 28 * (255 & i)) && ((o = i), (n = u)), + (f[d++] = o); + V._setPixels(c, f); + }, + erode: function (e) { + for ( + var t, + r, + o, + n, + s, + i, + a, + l, + u, + c = V._toPixels(e), + d = 0, + h = c.length ? c.length / 4 : 0, + f = new Int32Array(h); + d < h; + + ) + for (r = (t = d) + e.width; d < r; ) + (n = o = V._getARGB(c, d)), + (u = d - 1) < t && (u = d), + r <= (l = d + 1) && (l = d), + (s = d - e.width) < 0 && (s = 0), + h <= (i = d + e.width) && (i = d), + (s = V._getARGB(c, s)), + (u = V._getARGB(c, u)), + (i = V._getARGB(c, i)), + (a = + 77 * ((u >> 16) & 255) + + 151 * ((u >> 8) & 255) + + 28 * (255 & u)) < + (n = + 77 * ((n >> 16) & 255) + + 151 * ((n >> 8) & 255) + + 28 * (255 & n)) && ((o = u), (n = a)), + (a = + 77 * (((u = V._getARGB(c, l)) >> 16) & 255) + + 151 * ((u >> 8) & 255) + + 28 * (255 & u)) < n && ((o = u), (n = a)), + (l = + 77 * ((s >> 16) & 255) + + 151 * ((s >> 8) & 255) + + 28 * (255 & s)) < n && ((o = s), (n = l)), + (u = + 77 * ((i >> 16) & 255) + + 151 * ((i >> 8) & 255) + + 28 * (255 & i)) < n && ((o = i), (n = u)), + (f[d++] = o); + V._setPixels(c, f); + }, + blur: function (e, D) { + for ( + var t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + d = V._toPixels(e), + h = e.width, + f = e.height, + p = h * f, + m = new Int32Array(p), + y = 0; + y < p; + y++ + ) + m[y] = V._getARGB(d, y); + var g, + v, + b, + j, + _, + x, + w, + S, + T = new Int32Array(p), + M = new Int32Array(p), + E = new Int32Array(p), + F = new Int32Array(p), + k = 0, + C = (3.5 * D) | 0; + if (U !== (C = C < 1 ? 1 : C < 248 ? C : 248)) { + (N = (1 + (U = C)) << 1), + (B = new Int32Array(N)), + (G = new Array(N)); + for (var O = 0; O < N; O++) G[O] = new Int32Array(256); + for (var P = 1, A = C - 1; P < C; P++) { + (B[C + P] = B[A] = x = A * A), (w = G[C + P]), (S = G[A--]); + for (var L = 0; L < 256; L++) w[L] = S[L] = x * L; + } + (_ = B[C] = C * C), (w = G[C]); + for (var R = 0; R < 256; R++) w[R] = _ * R; + } + for (v = 0; v < f; v++) { + for (g = 0; g < h; g++) { + if (((n = o = r = s = t = 0), (i = g - U) < 0)) + (c = -i), (i = 0); + else { + if (h <= i) break; + c = 0; + } + for (b = c; b < N && !(h <= i); b++) { + var I = m[i + k]; + (j = G[b]), + (s += j[(-16777216 & I) >>> 24]), + (r += j[(16711680 & I) >> 16]), + (o += j[(65280 & I) >> 8]), + (n += j[255 & I]), + (t += B[b]), + i++; + } + (T[(a = k + g)] = s / t), + (M[a] = r / t), + (E[a] = o / t), + (F[a] = n / t); + } + k += h; + } + for (u = (l = -U) * h, v = k = 0; v < f; v++) { + for (g = 0; g < h; g++) { + if (((n = o = r = s = t = 0), l < 0)) (c = a = -l), (i = g); + else { + if (f <= l) break; + (c = 0), (a = l), (i = g + u); + } + for (b = c; b < N && !(f <= a); b++) + (j = G[b]), + (s += j[T[i]]), + (r += j[M[i]]), + (o += j[E[i]]), + (n += j[F[i]]), + (t += B[b]), + a++, + (i += h); + m[g + k] = + ((s / t) << 24) | + ((r / t) << 16) | + ((o / t) << 8) | + (n / t); + } + (k += h), (u += h), l++; + } + V._setPixels(d, m); + }, + }; + r.default = V; + }, + { + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.int32-array": 217, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-array": 234, + }, + ], + 297: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var C = o(e("../core/main")), + O = o(e("omggif")); + function o(e) { + return e && e.__esModule ? e : { default: e }; + } + function P(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + (C.default.prototype.createImage = function (e, t) { + return ( + C.default._validateParameters("createImage", arguments), + new C.default.Image(e, t) + ); + }), + (C.default.prototype.saveCanvas = function () { + C.default._validateParameters("saveCanvas", arguments); + var e, + t, + r, + o, + n, + s, + i = [].slice.call(arguments); + switch ( + (arguments[0] instanceof HTMLCanvasElement + ? ((e = arguments[0]), i.shift()) + : arguments[0] instanceof C.default.Element + ? ((e = arguments[0].elt), i.shift()) + : arguments[0] instanceof C.default.Framebuffer + ? ((n = this.createGraphics( + (o = arguments[0]).width, + o.height, + )).pixelDensity(pixelDensity()), + o.loadPixels(), + n.loadPixels(), + n.pixels.set(o.pixels), + n.updatePixels(), + (e = n.elt), + i.shift()) + : (e = this._curElement && this._curElement.elt), + 1 <= i.length && (t = i[0]), + (r = + (r = 2 <= i.length ? i[1] : r) || + C.default.prototype._checkFileExtension(t, r)[1] || + "png")) + ) { + default: + s = "image/png"; + break; + case "jpeg": + case "jpg": + s = "image/jpeg"; + } + e.toBlob(function (e) { + C.default.prototype.downloadFile(e, t, r), n && n.remove(); + }, s); + }), + (C.default.prototype.encodeAndDownloadGif = function (d, e) { + for ( + var h = d.gifProperties, + t = h.loopLimit, + r = + (1 === t ? (t = null) : null === t && (t = 0), + new Uint8Array(d.width * d.height * h.numFrames)), + f = [], + o = {}, + n = 0; + n < h.numFrames; + n++ + ) { + for ( + var s = new Set(), + i = h.frames[n].image.data, + a = i.length, + l = new Uint32Array(d.width * d.height), + u = 0, + c = 0; + u < a; + u += 4, c++ + ) { + var p = (i[u + 0] << 16) | (i[u + 1] << 8) | (i[u + 2] << 0); + s.add(p), (l[c] = p); + } + var m = P(s).sort().toString(); + void 0 === o[m] + ? (o[m] = { freq: 1, frames: [n] }) + : ((o[m].freq += 1), o[m].frames.push(n)), + f.push(l); + } + for ( + var y = [], + g = Object.keys(o).sort(function (e, t) { + return o[t].freq - o[e].freq; + }), + v = g[0].split(",").map(function (e) { + return parseInt(e); + }), + y = y.concat(o[v].frames), + b = new Set(v), + j = 1; + j < g.length; + j++ + ) { + var _ = g[j] + .split(",") + .map(function (e) { + return parseInt(e); + }) + .filter(function (e) { + return !b.has(e); + }); + if (v.length + _.length <= 256) { + for (var x = 0; x < _.length; x++) v.push(_[x]), b.add(_[x]); + y = y.concat(o[g[j]].frames); + } + } + y = new Set(y); + for (var w = {}, S = 0; S < v.length; S++) + w[v[S]] || (w[v[S]] = S); + for (var T = 1; T < v.length; ) T <<= 1; + v.length = T; + for ( + var t = { loop: t, palette: new Uint32Array(v) }, + M = new O.default.GifWriter(r, d.width, d.height, t), + E = {}, + k = 0; + k < h.numFrames; + k++ + ) + !(function (r) { + var o = !y.has(r), + n = o ? [] : v, + s = new Uint8Array(d.width * d.height), + i = {}, + a = new Set(), + e = + (f[r].forEach(function (e, t) { + o + ? (void 0 === i[e] && ((i[e] = n.length), n.push(e)), + (s[t] = i[e])) + : (s[t] = w[e]), + 0 < r && f[r - 1][t] !== e && a.add(e); + }), + {}), + t = n.filter(function (e) { + return !a.has(e); + }); + if (0 < t.length) { + var t = t[0], + l = (o ? i : w)[t]; + if (0 < r) { + for (var u = 0; u < f[r].length; u++) + f[r - 1][u] === f[r][u] && (s[u] = l); + (e.transparent = l), (E.frameOpts.disposal = 1); + } + } + if (((e.delay = h.frames[r].delay / 10), o)) { + for (var c = 1; c < n.length; ) c <<= 1; + (n.length = c), (e.palette = new Uint32Array(n)); + } + 0 < r && + M.addFrame( + 0, + 0, + d.width, + d.height, + E.pixelPaletteIndex, + E.frameOpts, + ), + (E = { pixelPaletteIndex: s, frameOpts: e }); + })(k); + (E.frameOpts.disposal = 1), + M.addFrame( + 0, + 0, + d.width, + d.height, + E.pixelPaletteIndex, + E.frameOpts, + ); + t = new Blob([r.slice(0, M.end())], { type: "image/gif" }); + C.default.prototype.downloadFile(t, e, "gif"); + }), + (C.default.prototype.saveFrames = function (e, t, r, o, n) { + C.default._validateParameters("saveFrames", arguments); + r = C.default.prototype.constrain((r = r || 3), 0, 15); + r *= 1e3; + var o = C.default.prototype.constrain(o || 15, 0, 22), + s = 0, + i = C.default.prototype._makeFrame, + a = this._curElement.elt, + l = [], + u = setInterval(function () { + l.push(i(e + s, t, a)), s++; + }, 1e3 / o); + setTimeout(function () { + if ((clearInterval(u), n)) n(l); + else + for (var e = 0, t = l; e < t.length; e++) { + var r = t[e]; + C.default.prototype.downloadFile( + r.imageData, + r.filename, + r.ext, + ); + } + l = []; + }, 0.01 + r); + }), + (C.default.prototype._makeFrame = function (e, t, r) { + var o, + r = this ? this._curElement.elt : r; + if (t) + switch (t.toLowerCase()) { + case "png": + o = "image/png"; + break; + case "jpeg": + case "jpg": + o = "image/jpeg"; + break; + default: + o = "image/png"; + } + else (t = "png"), (o = "image/png"); + var r = (r = r.toDataURL(o)).replace(o, "image/octet-stream"), + n = {}; + return (n.imageData = r), (n.filename = e), (n.ext = t), n; + }); + e = C.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.set": 189, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint32-array": 233, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + omggif: 248, + }, + ], + 298: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.copy-within"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint8-clamped-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.copy-within"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint8-clamped-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0), + e("regenerator-runtime/runtime"); + var O = n(e("../core/main")), + m = n(e("../core/helpers")), + j = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")), + g = n(e("omggif")), + P = e("gifenc"); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function n(e) { + return e && e.__esModule ? e : { default: e }; + } + function l(e, t, r, o, n, s, i) { + try { + var a = e[s](i), + l = a.value; + } catch (e) { + return void r(e); + } + a.done ? t(l) : Promise.resolve(l).then(o, n); + } + function y(e, t, r, o, n, s, i, a, l, u, c) { + var d, h, f, p, m, y, g, v, b; + return ( + e === j.COVER && + ((d = t), + (f = r), + (g = s), + (v = i), + (y = a), + (b = l), + (h = u), + (p = c), + (m = Math.max(g / h, v / p)), + (g /= m), + (v /= m), + (m = y), + (y = b), + d === j.CENTER + ? (m += (h - g) / 2) + : d === j.RIGHT && (m += h - g), + f === j.CENTER + ? (y += (p - v) / 2) + : f === j.BOTTOM && (y += p - v), + (a = (b = { x: m, y: y, w: g, h: v }).x), + (l = b.y), + (u = b.w), + (c = b.h)), + e === j.CONTAIN && + ((d = t), + (h = r), + (f = o), + (p = n), + (m = s), + (y = i), + (g = u), + (v = c), + (b = Math.max(g / m, v / y)), + (g /= b), + (v /= b), + (b = f), + (f = p), + d === j.CENTER + ? (b += (m - g) / 2) + : d === j.RIGHT && (b += m - g), + h === j.CENTER + ? (f += (y - v) / 2) + : h === j.BOTTOM && (f += y - v), + (o = (e = { x: b, y: f, w: g, h: v }).x), + (n = e.y), + (s = e.w), + (i = e.h)), + { sx: a, sy: l, sw: u, sh: c, dx: o, dy: n, dw: s, dh: i } + ); + } + function v(e, t) { + return 0 < e && e < t ? e : t; + } + e("../core/friendly_errors/validate_params"), + e("../core/friendly_errors/file_errors"), + e("../core/friendly_errors/fes_core"), + (O.default.prototype.loadImage = function (o, f, p) { + O.default._validateParameters("loadImage", arguments); + var m = new O.default.Image(1, 1, this), + y = this, + e = new Request(o, { method: "GET", mode: "cors" }); + return ( + fetch(o, e) + .then(function (e) { + var t, + r = e.headers.get("content-type"); + null === r && + console.warn( + "The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset.", + ), + r && r.includes("image/gif") + ? e.arrayBuffer().then( + function (e) { + if (e) { + for ( + var e = new Uint8Array(e), + r = m, + t = f, + o = p, + n = function (e) { + y._decrementPreload(); + }.bind(y), + s = new g.default.GifReader(e), + i = + ((r.width = r.canvas.width = s.width), + (r.height = r.canvas.height = s.height), + []), + a = s.numFrames(), + l = new Uint8ClampedArray( + r.width * r.height * 4, + ), + u = 0; + u < a; + u++ + ) { + var c = s.frameInfo(u), + d = r.drawingContext.getImageData( + 0, + 0, + r.width, + r.height, + ), + h = + ((l = d.data.slice()), + !(function (e, t) { + try { + t.decodeAndBlitFrameRGBA(e, l); + } catch (e) { + O.default._friendlyFileLoadError( + 8, + r.src, + ), + "function" == typeof o + ? o(e) + : console.error(e); + } + })(u, s), + new ImageData(l, r.width, r.height)), + h = + (r.drawingContext.putImageData(h, 0, 0), + c.delay); + 0 === h && (h = 10), + i.push({ + image: r.drawingContext.getImageData( + 0, + 0, + r.width, + r.height, + ), + delay: 10 * h, + }), + 2 === c.disposal + ? r.drawingContext.clearRect( + c.x, + c.y, + c.width, + c.height, + ) + : 3 === c.disposal && + r.drawingContext.putImageData( + d, + 0, + 0, + c.x, + c.y, + c.width, + c.height, + ); + } + null === (e = s.loopCount()) + ? (e = 1) + : 0 === e && (e = null), + r.drawingContext.putImageData( + i[0].image, + 0, + 0, + ), + 1 < i.length && + (r.gifProperties = { + displayIndex: 0, + loopLimit: e, + loopCount: 0, + frames: i, + numFrames: a, + playing: !0, + timeDisplayed: 0, + lastChangeTime: 0, + }), + "function" == typeof t && t(r), + n(); + } + }, + function (e) { + "function" == typeof p + ? (p(e), y._decrementPreload()) + : console.error(e); + }, + ) + : (((t = new Image()).onload = function () { + (m.width = m.canvas.width = t.width), + (m.height = m.canvas.height = t.height), + m.drawingContext.drawImage(t, 0, 0), + (m.modified = !0), + "function" == typeof f && f(m), + y._decrementPreload(); + }), + (t.onerror = function (e) { + O.default._friendlyFileLoadError(0, t.src), + "function" == typeof p + ? (p(e), y._decrementPreload()) + : console.error(e); + }), + 0 !== o.indexOf("data:image/") && + (t.crossOrigin = "Anonymous"), + (t.src = o)), + (m.modified = !0); + }) + .catch(function (e) { + O.default._friendlyFileLoadError(0, o), + "function" == typeof p + ? (p(e), y._decrementPreload()) + : console.error(e); + }), + m + ); + }), + (O.default.prototype.saveGif = (function () { + a = regeneratorRuntime.mark(function e(t, r) { + var o, + n, + s, + i, + a, + l, + u, + c, + d, + h, + f, + p, + m, + y, + g, + v, + b, + j, + _, + x, + w, + S, + T, + M, + E, + k, + C = arguments; + return regeneratorRuntime.wrap( + function (e) { + for (;;) + switch ((e.prev = e.next)) { + case 0: + if ( + ((o = + 2 < C.length && void 0 !== C[2] + ? C[2] + : { + delay: 0, + units: "seconds", + silent: !1, + notificationDuration: 0, + notificationID: "progressBar", + }), + "string" != typeof t) + ) + throw TypeError( + "fileName parameter must be a string", + ); + e.next = 3; + break; + case 3: + if ("number" != typeof r) + throw TypeError( + "Duration parameter must be a number", + ); + e.next = 5; + break; + case 5: + if ( + ((n = (o && o.delay) || 0), + (s = (o && o.units) || "seconds"), + (i = (o && o.silent) || !1), + (a = (o && o.notificationDuration) || 0), + (l = (o && o.notificationID) || "progressBar"), + "number" != typeof n) + ) + throw TypeError("Delay parameter must be a number"); + e.next = 12; + break; + case 12: + if ("seconds" !== s && "frames" !== s) + throw TypeError( + 'Units parameter must be either "frames" or "seconds"', + ); + e.next = 14; + break; + case 14: + if ("boolean" != typeof i) + throw TypeError( + "Silent parameter must be a boolean", + ); + e.next = 16; + break; + case 16: + if ("number" != typeof a) + throw TypeError( + "Notification duration parameter must be a number", + ); + e.next = 18; + break; + case 18: + if ("string" != typeof l) + throw TypeError( + "Notification ID parameter must be a string", + ); + e.next = 20; + break; + case 20: + return ( + (this._recording = !0), + (h = this._targetFrameRate), + (u = + (u = + (1 / + (h = + h !== 1 / 0 && void 0 !== h && 0 !== h + ? h + : 60)) * + 1e3) < 20 + ? 20 + : u), + (d = + (c = "seconds" === s ? r * h : r) + + (h = "seconds" === s ? n * h : n)), + (h = h), + (this.frameCount = h), + (f = this._pixelDensity), + this.pixelDensity(1), + (p = []), + null !== document.getElementById(l) && + document.getElementById(l).remove(), + i || + ((m = this.createP("")).id(l), + m.style("font-size", "16px"), + m.style("font-family", "Montserrat"), + m.style("background-color", "#ffffffa0"), + m.style("padding", "8px"), + m.style("border-radius", "10px"), + m.position(0, 0)), + this._renderer instanceof O.default.RendererGL && + ((g = this.drawingContext), + (y = new Uint8Array( + g.drawingBufferWidth * + g.drawingBufferHeight * + 4, + ))), + this.noLoop(), + (e.next = 39), + Promise.resolve() + ); + case 39: + if (h < d) + return ( + this.redraw(), + (M = void 0), + (M = + this._renderer instanceof O.default.RendererGL + ? ((y = new Uint8Array( + g.drawingBufferWidth * + g.drawingBufferHeight * + 4, + )), + g.readPixels( + 0, + 0, + g.drawingBufferWidth, + g.drawingBufferHeight, + g.RGBA, + g.UNSIGNED_BYTE, + y, + ), + (function (e) { + for ( + var t = parseInt(height / 2), + r = 4 * width, + o = new Uint8Array(4 * width), + n = 0; + n < t; + ++n + ) { + var s = n * r, + i = (height - n - 1) * r; + o.set(e.subarray(s, s + r)), + e.copyWithin(s, i, i + r), + e.set(o, i); + } + return e; + })(y)) + : this.drawingContext.getImageData( + 0, + 0, + this.width, + this.height, + ).data), + p.push(M), + h++, + i || + m.html( + "Saved frame " + + p.length.toString() + + " out of " + + c.toString(), + ), + (e.next = 48), + new Promise(function (e) { + return setTimeout(e, 0); + }) + ); + e.next = 50; + break; + case 48: + e.next = 39; + break; + case 50: + i || + m.html( + "Frames processed, generating color palette...", + ), + this.loop(), + this.pixelDensity(f), + (v = (0, P.GIFEncoder)()), + (b = (function (e) { + for ( + var t = new Uint8Array(e.length * e[0].length), + r = 0; + r < e.length; + r++ + ) + t.set(e[r], r * e[0].length); + var o = (0, P.quantize)(t, 256, { + format: "rgba4444", + oneBitAlpha: !0, + }); + 256 === o.length + ? (o[o.length - 1] = [ + 255 * Math.random(), + 255 * Math.random(), + 255 * Math.random(), + 0, + ]) + : o.push([ + 255 * Math.random(), + 255 * Math.random(), + 255 * Math.random(), + 0, + ]); + return o; + })(p)), + (j = {}), + (_ = function (e) { + for ( + var t = e.length / 4, + r = new Uint8Array(t), + o = 0; + o < t; + o++ + ) { + var n = + (e[4 * o] << 24) | + (e[4 * o + 1] << 16) | + (e[4 * o + 2] << 8) | + e[4 * o + 3]; + void 0 === j[n] && + (j[n] = (0, P.nearestColorIndex)( + b, + e.slice(4 * o, 4 * (o + 1)), + )), + (r[o] = j[n]); + } + return r; + }), + (x = b.length - 1), + (w = []), + (S = 0); + case 60: + if (!(S < p.length)) { + e.next = 71; + break; + } + if (((T = _(p[S])), (M = T.slice()), 0 === S)) + v.writeFrame(T, this.width, this.height, { + palette: b, + delay: u, + dispose: 1, + }); + else { + for (E = 0; E < T.length; E++) + T[E] === w[E] && (T[E] = x); + v.writeFrame(T, this.width, this.height, { + delay: u, + transparent: !0, + transparentIndex: x, + dispose: 1, + }); + } + return ( + (w = M), + i || + m.html( + "Rendered frame " + + S.toString() + + " out of " + + c.toString(), + ), + (e.next = 68), + new Promise(function (e) { + return setTimeout(e, 0); + }) + ); + case 68: + S++, (e.next = 60); + break; + case 71: + v.finish(), + (k = v.bytesView()), + (k = new Blob([k], { type: "image/gif" })), + (p = []), + (this._recording = !1), + this.loop(), + i || + (m.html("Done. Downloading your gif!🌸"), + 0 < a && + setTimeout(function () { + return m.remove(); + }, 1e3 * a)), + O.default.prototype.downloadFile(k, t, "gif"); + case 80: + case "end": + return e.stop(); + } + }, + e, + this, + ); + }); + var a, + r = function () { + var e = this, + i = arguments; + return new Promise(function (t, r) { + var o = a.apply(e, i); + function n(e) { + l(o, t, r, n, s, "next", e); + } + function s(e) { + l(o, t, r, n, s, "throw", e); + } + n(void 0); + }); + }; + return function (e, t) { + return r.apply(this, arguments); + }; + })()), + (O.default.prototype.image = function ( + e, + t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + d, + ) { + O.default._validateParameters("image", arguments); + var h = e.width, + f = e.height, + p = + ((d = d || j.CENTER), + (c = c || j.CENTER), + e.elt && + ((h = void 0 !== h ? h : e.elt.width), + (f = void 0 !== f ? f : e.elt.height)), + e.elt && + e.elt.videoWidth && + !e.canvas && + ((h = void 0 !== h ? h : e.elt.videoWidth), + (f = void 0 !== f ? f : e.elt.videoHeight)), + o || h), + n = n || f, + s = s || 0, + i = i || 0, + a = v(void 0 !== a ? a : h, h), + h = v(void 0 !== l ? l : f, f), + l = 1; + e.elt && + !e.canvas && + e.elt.style.width && + ((l = e.elt.videoWidth && !o ? e.elt.videoWidth : e.elt.width), + (l /= parseInt(e.elt.style.width, 10))), + (s *= l), + (i *= l), + (h *= l), + (a *= l); + f = y( + u, + c, + d, + (f = m.default.modeAdjust( + t, + r, + p, + n, + this._renderer._imageMode, + )).x, + f.y, + f.w, + f.h, + s, + i, + a, + h, + ); + this._renderer.image( + e, + f.sx, + f.sy, + f.sw, + f.sh, + f.dx, + f.dy, + f.dw, + f.dh, + ); + }), + (O.default.prototype.tint = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + O.default._validateParameters("tint", t); + var o = this.color.apply(this, t); + this._renderer._tint = o.levels; + }), + (O.default.prototype.noTint = function () { + this._renderer._tint = null; + }), + (O.default.prototype._getTintedImageCanvas = + O.default.Renderer2D.prototype._getTintedImageCanvas), + (O.default.prototype.imageMode = function (e) { + O.default._validateParameters("imageMode", arguments), + (e !== j.CORNER && e !== j.CORNERS && e !== j.CENTER) || + (this._renderer._imageMode = e); + }); + e = O.default; + r.default = e; + }, + { + "../core/constants": 264, + "../core/friendly_errors/fes_core": 266, + "../core/friendly_errors/file_errors": 267, + "../core/friendly_errors/validate_params": 270, + "../core/helpers": 271, + "../core/main": 275, + "core-js/modules/es.array.copy-within": 152, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.promise": 183, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/es.typed-array.uint8-clamped-array": 235, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + gifenc: 245, + omggif: 248, + "regenerator-runtime/runtime": 252, + }, + ], + 299: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = o(e("../core/main")), + n = o(e("./filters")); + function o(e) { + return e && e.__esModule ? e : { default: e }; + } + function i(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + s.default.Image = (function () { + function r(e, t) { + if (!(this instanceof r)) + throw new TypeError("Cannot call a class as a function"); + (this.width = e), + (this.height = t), + (this.canvas = document.createElement("canvas")), + (this.canvas.width = this.width), + (this.canvas.height = this.height), + (this.drawingContext = this.canvas.getContext("2d")), + ((this._pixelsState = this)._pixelDensity = 1), + (this.gifProperties = null), + (this._modified = !1), + (this.pixels = []); + } + var e, t, o; + return ( + (e = r), + (t = [ + { + key: "pixelDensity", + value: function (e) { + return void 0 !== e + ? (e <= 0 && + (s.default._friendlyParamError( + { + type: "INVALID_VALUE", + format: { types: ["Number"] }, + position: 1, + }, + "pixelDensity", + ), + (e = 1)), + (this._pixelDensity = e), + (this.width /= e), + (this.height /= e), + this) + : this._pixelDensity; + }, + }, + { + key: "_animateGif", + value: function (e) { + var t, + r = this.gifProperties, + e = e._lastRealFrameTime; + 0 === r.lastChangeTime && (r.lastChangeTime = e), + r.playing && + ((r.timeDisplayed = e - r.lastChangeTime), + (t = r.frames[r.displayIndex].delay), + r.timeDisplayed >= t && + ((t = Math.floor(r.timeDisplayed / t)), + (r.timeDisplayed = 0), + (r.lastChangeTime = e), + (r.displayIndex += t), + (r.loopCount = Math.floor( + r.displayIndex / r.numFrames, + )), + null !== r.loopLimit && r.loopCount >= r.loopLimit + ? (r.playing = !1) + : ((e = r.displayIndex % r.numFrames), + this.drawingContext.putImageData( + r.frames[e].image, + 0, + 0, + ), + (r.displayIndex = e), + this.setModified(!0)))); + }, + }, + { + key: "_setProperty", + value: function (e, t) { + (this[e] = t), this.setModified(!0); + }, + }, + { + key: "loadPixels", + value: function () { + s.default.Renderer2D.prototype.loadPixels.call(this), + this.setModified(!0); + }, + }, + { + key: "updatePixels", + value: function (e, t, r, o) { + s.default.Renderer2D.prototype.updatePixels.call( + this, + e, + t, + r, + o, + ), + this.setModified(!0); + }, + }, + { + key: "get", + value: function (e, t, r, o) { + return ( + s.default._validateParameters("p5.Image.get", arguments), + s.default.Renderer2D.prototype.get.apply(this, arguments) + ); + }, + }, + { + key: "_getPixel", + value: function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return s.default.Renderer2D.prototype._getPixel.apply( + this, + t, + ); + }, + }, + { + key: "set", + value: function (e, t, r) { + s.default.Renderer2D.prototype.set.call(this, e, t, r), + this.setModified(!0); + }, + }, + { + key: "resize", + value: 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 o = this.gifProperties, n = 0; + n < o.numFrames; + n++ + ) { + for ( + var s = this.drawingContext.createImageData(e, t), + i = + ((d = d = c = u = l = void 0), o.frames[n].image), + a = s, + l = 0, + u = 0; + u < a.height; + u++ + ) + for (var c = 0; c < a.width; c++) { + var d = Math.floor((c * i.width) / a.width), + d = + 4 * + (Math.floor((u * i.height) / a.height) * + i.width + + d); + (a.data[l++] = i.data[d++]), + (a.data[l++] = i.data[d++]), + (a.data[l++] = i.data[d++]), + (a.data[l++] = i.data[+d]); + } + o.frames[n].image = s; + } + r + .getContext("2d") + .drawImage( + this.canvas, + 0, + 0, + this.canvas.width, + this.canvas.height, + 0, + 0, + r.width, + r.height, + ), + (this.canvas.width = this.width = e), + (this.canvas.height = this.height = t), + this.drawingContext.drawImage(r, 0, 0, e, t, 0, 0, e, t), + 0 < this.pixels.length && this.loadPixels(), + this.setModified(!0); + }, + }, + { + key: "copy", + value: function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + s.default.prototype.copy.apply(this, t); + }, + }, + { + key: "mask", + value: function (e) { + var t = this.drawingContext.globalCompositeOperation, + r = 1, + o = [ + (e = void 0 === e ? this : e), + 0, + 0, + (r = + e instanceof s.default.Renderer + ? e._pInst._pixelDensity + : r) * e.width, + r * e.height, + 0, + 0, + this.width, + this.height, + ]; + if ( + ((this.drawingContext.globalCompositeOperation = + "destination-in"), + this.gifProperties) + ) { + for (var n = 0; n < this.gifProperties.frames.length; n++) + this.drawingContext.putImageData( + this.gifProperties.frames[n].image, + 0, + 0, + ), + this.copy.apply(this, o), + (this.gifProperties.frames[n].image = + this.drawingContext.getImageData( + 0, + 0, + this.width, + this.height, + )); + this.drawingContext.putImageData( + this.gifProperties.frames[ + this.gifProperties.displayIndex + ].image, + 0, + 0, + ); + } else this.copy.apply(this, o); + (this.drawingContext.globalCompositeOperation = t), + this.setModified(!0); + }, + }, + { + key: "filter", + value: function (e, t) { + n.default.apply(this.canvas, n.default[e], t), + this.setModified(!0); + }, + }, + { + key: "blend", + value: function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + s.default._validateParameters("p5.Image.blend", arguments), + s.default.prototype.blend.apply(this, t), + this.setModified(!0); + }, + }, + { + key: "setModified", + value: function (e) { + this._modified = e; + }, + }, + { + key: "isModified", + value: function () { + return this._modified; + }, + }, + { + key: "save", + value: function (e, t) { + this.gifProperties + ? s.default.prototype.encodeAndDownloadGif(this, e) + : s.default.prototype.saveCanvas(this.canvas, e, t); + }, + }, + { + key: "reset", + value: function () { + var e; + this.gifProperties && + (((e = this.gifProperties).playing = !0), + (e.timeSinceStart = 0), + (e.timeDisplayed = 0), + (e.lastChangeTime = 0), + (e.loopCount = 0), + (e.displayIndex = 0), + this.drawingContext.putImageData( + e.frames[0].image, + 0, + 0, + )); + }, + }, + { + key: "getCurrentFrame", + value: function () { + var e; + if (this.gifProperties) + return ( + (e = this.gifProperties).displayIndex % e.numFrames + ); + }, + }, + { + key: "setFrame", + value: function (e) { + var t; + this.gifProperties && + (e < (t = this.gifProperties).numFrames && 0 <= e + ? ((t.timeDisplayed = 0), + (t.lastChangeTime = 0), + (t.displayIndex = e), + this.drawingContext.putImageData( + t.frames[e].image, + 0, + 0, + )) + : console.log( + "Cannot set GIF to a frame number that is higher than total number of frames or below zero.", + )); + }, + }, + { + key: "numFrames", + value: function () { + if (this.gifProperties) return this.gifProperties.numFrames; + }, + }, + { + key: "play", + value: function () { + this.gifProperties && (this.gifProperties.playing = !0); + }, + }, + { + key: "pause", + value: function () { + this.gifProperties && (this.gifProperties.playing = !1); + }, + }, + { + key: "delay", + value: function (e, t) { + if (this.gifProperties) { + var r = this.gifProperties; + if (t < r.numFrames && 0 <= t) r.frames[t].delay = e; + else { + var o = !0, + t = !1, + n = void 0; + try { + for ( + var s, i = r.frames[Symbol.iterator](); + !(o = (s = i.next()).done); + o = !0 + ) + s.value.delay = e; + } catch (e) { + (t = !0), (n = e); + } finally { + try { + o || null == i.return || i.return(); + } finally { + if (t) throw n; + } + } + } + } + }, + }, + ]) && i(e.prototype, t), + o && i(e, o), + r + ); + })(); + e = s.default.Image; + r.default = e; + }, + { + "../core/main": 275, + "./filters": 296, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 300: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.filter"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var f = o(e("../core/main")), + a = o(e("./filters")); + function o(e) { + return e && e.__esModule ? e : { default: e }; + } + e("../color/p5.Color"), + (f.default.prototype.pixels = []), + (f.default.prototype.blend = function () { + for ( + var e, t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + f.default._validateParameters("blend", r), + this._renderer + ? (e = this._renderer).blend.apply(e, r) + : f.default.Renderer2D.prototype.blend.apply(this, r); + }), + (f.default.prototype.copy = function () { + for ( + var e, + t, + r, + o, + n, + s, + i, + a, + l, + u = arguments.length, + c = new Array(u), + d = 0; + d < u; + d++ + ) + c[d] = arguments[d]; + if ((f.default._validateParameters("copy", c), 9 === c.length)) + (e = c[0]), + (t = c[1]), + (r = c[2]), + (o = c[3]), + (n = c[4]), + (s = c[5]), + (i = c[6]), + (a = c[7]), + (l = c[8]); + else { + if (8 !== c.length) throw new Error("Signature not supported"); + (e = this), + (t = c[0]), + (r = c[1]), + (o = c[2]), + (n = c[3]), + (s = c[4]), + (i = c[5]), + (a = c[6]), + (l = c[7]); + } + f.default.prototype._copyHelper(this, e, t, r, o, n, s, i, a, l); + }), + (f.default.prototype._copyHelper = function ( + e, + t, + r, + o, + n, + s, + i, + a, + l, + u, + ) { + var c = t.canvas.width / t.width, + d = 0, + h = 0; + t._renderer && + t._renderer.isP3D && + ((d = t.width / 2), (h = t.height / 2)), + e._renderer && e._renderer.isP3D + ? f.default.RendererGL.prototype.image.call( + e._renderer, + t, + r + d, + o + h, + n, + s, + i, + a, + l, + u, + ) + : e.drawingContext.drawImage( + t.canvas, + c * (r + d), + c * (o + h), + c * n, + c * s, + i, + a, + l, + u, + ); + }), + (f.default.prototype.getFilterGraphicsLayer = function () { + return this._renderer.getFilterGraphicsLayer(); + }), + (f.default.prototype.filter = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + f.default._validateParameters("filter", arguments); + var o = function () { + var e, + t = { + shader: void 0, + operation: void 0, + value: void 0, + useWebGL: !0, + }; + return ( + (arguments.length <= 0 ? void 0 : arguments[0]) instanceof + f.default.Shader + ? (t.shader = + arguments.length <= 0 ? void 0 : arguments[0]) + : ((t.operation = + arguments.length <= 0 ? void 0 : arguments[0]), + 1 < arguments.length && + "number" == + typeof (arguments.length <= 1 + ? void 0 + : arguments[1]) && + (t.value = + arguments.length <= 1 ? void 0 : arguments[1]), + !1 === + ((e = arguments.length - 1) < 0 || + arguments.length <= e + ? void 0 + : arguments[e]) && (t.useWebGL = !1)), + t + ); + }.apply(void 0, t), + n = o.shader, + s = o.operation, + i = o.value, + o = o.useWebGL; + this._renderer.isP3D && n + ? f.default.RendererGL.prototype.filter.call(this._renderer, n) + : o || this._renderer.isP3D + ? (!o && + this._renderer.isP3D && + console.warn( + "filter() with useWebGL=false is not supported in WEBGL", + ), + this._renderer.isP3D + ? f.default.RendererGL.prototype.filter.call( + this._renderer, + s, + i, + ) + : ((n = this.getFilterGraphicsLayer()).copy( + this._renderer, + 0, + 0, + this.width, + this.height, + -this.width / 2, + -this.height / 2, + this.width, + this.height, + ), + this._renderer.clear(), + this._renderer.resetMatrix(), + n.filter.apply(n, t), + this._renderer._pInst.image(n, 0, 0), + n.clear())) + : void 0 !== this.canvas + ? a.default.apply(this.canvas, a.default[s], i) + : a.default.apply(this.elt, a.default[s], i); + }), + (f.default.prototype.get = function (e, t, r, o) { + var n; + return ( + f.default._validateParameters("get", arguments), + (n = this._renderer).get.apply(n, arguments) + ); + }), + (f.default.prototype.loadPixels = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + f.default._validateParameters("loadPixels", t), + this._renderer.loadPixels(); + }), + (f.default.prototype.set = function (e, t, r) { + this._renderer.set(e, t, r); + }), + (f.default.prototype.updatePixels = function (e, t, r, o) { + f.default._validateParameters("updatePixels", arguments), + 0 !== this.pixels.length && + this._renderer.updatePixels(e, t, r, o); + }); + e = f.default; + r.default = e; + }, + { + "../color/p5.Color": 262, + "../core/main": 275, + "./filters": 296, + "core-js/modules/es.array.filter": 155, + }, + ], + 301: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.last-index-of"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.object.from-entries"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/web.url"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.last-index-of"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.object.from-entries"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.promise"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/web.url"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var v = s(e("../core/main")), + m = (e("whatwg-fetch"), e("es6-promise/auto"), s(e("fetch-jsonp"))), + n = s(e("file-saver")); + function s(e) { + return e && e.__esModule ? e : { default: e }; + } + function y(e) { + return (y = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + function g(e) { + return e + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + } + function i(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"), + (v.default.prototype.loadJSON = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + v.default._validateParameters("loadJSON", t); + for ( + var o, n, s, i = t[0], a = {}, l = "json", u = 1; + u < t.length; + u++ + ) { + var c = t[u]; + "string" == typeof c + ? ("jsonp" !== c && "json" !== c) || (l = c) + : "function" == typeof c + ? o + ? (n = c) + : (o = c) + : "object" === y(c) && + (c.hasOwnProperty("jsonpCallback") || + c.hasOwnProperty("jsonpCallbackFunction")) && + ((l = "jsonp"), (s = c)); + } + var d = this; + return ( + this.httpDo( + i, + "GET", + s, + l, + function (e) { + for (var t in e) a[t] = e[t]; + void 0 !== o && o(e), d._decrementPreload(); + }, + function (e) { + if ((v.default._friendlyFileLoadError(5, i), !n)) throw e; + n(e); + }, + ), + a + ); + }), + (v.default.prototype.loadStrings = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + v.default._validateParameters("loadStrings", t); + for (var n, o, s = [], i = 1; i < t.length; i++) { + var a = t[i]; + "function" == typeof a && + (void 0 === n ? (n = a) : void 0 === o && (o = a)); + } + var l = this; + return ( + v.default.prototype.httpDo.call( + this, + t[0], + "GET", + "text", + function (e) { + for ( + var t = e + .replace(/\r\n/g, "\r") + .replace(/\n/g, "\r") + .split(/\r/), + r = 0, + o = t.length; + r < o; + r += 32768 + ) + Array.prototype.push.apply( + s, + t.slice(r, Math.min(r + 32768, o)), + ); + void 0 !== n && n(s), l._decrementPreload(); + }, + function (e) { + if ((v.default._friendlyFileLoadError(3, e), !o)) throw e; + o(e); + }, + ), + s + ); + }), + (v.default.prototype.loadTable = function (t) { + var f, + r, + p, + e = [], + m = !1, + o = t.substring(t.lastIndexOf(".") + 1, t.length); + "csv" === o + ? (p = ",") + : "ssv" === o + ? (p = ";") + : "tsv" === o && (p = "\t"); + for (var n = 1; n < arguments.length; n++) + "function" == typeof arguments[n] + ? void 0 === f + ? (f = arguments[n]) + : void 0 === r && (r = arguments[n]) + : "string" == typeof arguments[n] && + (e.push(arguments[n]), + "header" === arguments[n] && (m = !0), + "csv" === arguments[n] + ? (p = ",") + : "ssv" === arguments[n] + ? (p = ";") + : "tsv" === arguments[n] && (p = "\t")); + var y = new v.default.Table(), + g = this; + return ( + this.httpDo( + t, + "GET", + "table", + function (e) { + for ( + var t, + r, + o = {}, + n = 0, + s = [], + i = 0, + a = null, + l = function () { + (o.currentState = n), (o.token = ""); + }, + u = function () { + a.push(o.token), l(); + }, + c = function () { + (o.currentState = 4), s.push(a), (a = null); + }; + ; + + ) { + if (null == (t = e[i++])) { + if (o.escaped) + throw new Error("Unclosed quote in file."); + if (a) { + u(), c(); + break; + } + } + if ( + (null === a && ((o.escaped = !1), (a = []), l()), + o.currentState === n) + ) { + if ('"' === t) { + (o.escaped = !0), (o.currentState = 1); + continue; + } + o.currentState = 1; + } + if (1 === o.currentState && o.escaped) + if ('"' === t) + '"' === e[i] + ? ((o.token += '"'), i++) + : ((o.escaped = !1), (o.currentState = 2)); + else { + if ("\r" === t) continue; + o.token += t; + } + else + "\r" === t + ? ("\n" === e[i] && i++, u(), c()) + : "\n" === t + ? (u(), c()) + : t === p + ? u() + : 1 === o.currentState && (o.token += t); + } + if (m) y.columns = s.shift(); + else + for (var d = 0; d < s[0].length; d++) + y.columns[d] = "null"; + for (var h = 0; h < s.length; h++) + (1 !== s[h].length || + ("undefined" !== s[h][0] && "" !== s[h][0])) && + (((r = new v.default.TableRow()).arr = s[h]), + (r.obj = (function (r, e) { + if (void 0 === (e = e || [])) + for (var t = 0; t < r.length; t++) + e[t.toString()] = t; + return Object.fromEntries( + e.map(function (e, t) { + return [e, r[t]]; + }), + ); + })(s[h], y.columns)), + y.addRow(r)); + "function" == typeof f && f(y), g._decrementPreload(); + }, + function (e) { + v.default._friendlyFileLoadError(2, t), + r ? r(e) : console.error(e); + }, + ), + y + ); + }), + (v.default.prototype.loadXML = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + for ( + var o, n, s = new v.default.XML(), i = 1; + i < t.length; + i++ + ) { + var a = t[i]; + "function" == typeof a && + (void 0 === o ? (o = a) : void 0 === n && (n = a)); + } + var l = this; + return ( + this.httpDo( + t[0], + "GET", + "xml", + function (e) { + for (var t in e) s[t] = e[t]; + void 0 !== o && o(s), l._decrementPreload(); + }, + function (e) { + if ((v.default._friendlyFileLoadError(1, e), !n)) throw e; + n(e); + }, + ), + s + ); + }), + (v.default.prototype.loadBytes = function (t, r, o) { + var n = {}, + s = this; + return ( + this.httpDo( + t, + "GET", + "arrayBuffer", + function (e) { + (n.bytes = new Uint8Array(e)), + "function" == typeof r && r(n), + s._decrementPreload(); + }, + function (e) { + if ((v.default._friendlyFileLoadError(6, t), !o)) throw e; + o(e); + }, + ), + n + ); + }), + (v.default.prototype.httpGet = function () { + v.default._validateParameters("httpGet", arguments); + var e = Array.prototype.slice.call(arguments); + return ( + e.splice(1, 0, "GET"), v.default.prototype.httpDo.apply(this, e) + ); + }), + (v.default.prototype.httpPost = function () { + v.default._validateParameters("httpPost", arguments); + var e = Array.prototype.slice.call(arguments); + return ( + e.splice(1, 0, "POST"), + v.default.prototype.httpDo.apply(this, e) + ); + }), + (v.default.prototype.httpDo = function () { + for ( + var r, + e, + t, + o = {}, + n = 0, + s = "text/plain", + i = arguments.length - 1; + 0 < i && + "function" == + typeof (i < 0 || arguments.length <= i + ? void 0 + : arguments[i]); + i-- + ) + n++; + var a = arguments.length - n, + l = arguments.length <= 0 ? void 0 : arguments[0]; + if ( + 2 == a && + "string" == typeof l && + "object" === y(arguments.length <= 1 ? void 0 : arguments[1]) + ) + (p = new Request( + l, + arguments.length <= 1 ? void 0 : arguments[1], + )), + (e = arguments.length <= 2 ? void 0 : arguments[2]), + (t = arguments.length <= 3 ? void 0 : arguments[3]); + else { + for (var u, c = "GET", d = 1; d < arguments.length; d++) { + var h = + d < 0 || arguments.length <= d ? void 0 : arguments[d]; + if ("string" == typeof h) + "GET" === h || "POST" === h || "PUT" === h || "DELETE" === h + ? (c = h) + : "json" === h || + "jsonp" === h || + "binary" === h || + "arrayBuffer" === h || + "xml" === h || + "text" === h || + "table" === h + ? (r = h) + : (u = h); + else if ("number" == typeof h) u = h.toString(); + else if ("object" === y(h)) + if ( + h.hasOwnProperty("jsonpCallback") || + h.hasOwnProperty("jsonpCallbackFunction") + ) + for (var f in h) o[f] = h[f]; + else + s = + h instanceof v.default.XML + ? ((u = h.serialize()), "application/xml") + : ((u = JSON.stringify(h)), "application/json"); + else "function" == typeof h && (e ? (t = h) : (e = h)); + } + var a = + "GET" === c + ? new Headers() + : new Headers({ "Content-Type": s }), + p = new Request(l, { + method: c, + mode: "cors", + body: u, + headers: a, + }); + } + return ( + (a = (a = + "jsonp" === + (r = + r || + (l.includes("json") + ? "json" + : l.includes("xml") + ? "xml" + : "text")) + ? (0, m.default)(l, o) + : fetch(p)).then(function (e) { + if (!e.ok) + throw ( + (((t = new Error(e.body)).status = e.status), + (t.ok = !1), + t) + ); + var t = 0; + switch ( + ((t = + "jsonp" !== r ? e.headers.get("content-length") : t) && + 64e6 < t && + v.default._friendlyFileLoadError(7, l), + r) + ) { + case "json": + case "jsonp": + return e.json(); + case "binary": + return e.blob(); + case "arrayBuffer": + return e.arrayBuffer(); + case "xml": + return e.text().then(function (e) { + e = new DOMParser().parseFromString(e, "text/xml"); + return new v.default.XML(e.documentElement); + }); + default: + return e.text(); + } + })).then(e || function () {}), + a.catch(t || console.error), + a + ); + }), + (window.URL = window.URL || window.webkitURL), + (v.default.prototype._pWriters = []), + (v.default.prototype.createWriter = function (e, t) { + var r, o; + for (o in v.default.prototype._pWriters) + if (v.default.prototype._pWriters[o].name === e) + return ( + (r = new v.default.PrintWriter(e + this.millis(), t)), + v.default.prototype._pWriters.push(r), + r + ); + return ( + (r = new v.default.PrintWriter(e, t)), + v.default.prototype._pWriters.push(r), + r + ); + }), + (v.default.PrintWriter = function (r, o) { + var n = this; + (this.name = r), + (this.content = ""), + (this.write = function (e) { + this.content += e; + }), + (this.print = function (e) { + this.content += "".concat(e, "\n"); + }), + (this.clear = function () { + this.content = ""; + }), + (this.close = function () { + var e, + t = []; + for (e in (t.push(this.content), + v.default.prototype.writeFile(t, r, o), + v.default.prototype._pWriters)) + v.default.prototype._pWriters[e].name === this.name && + v.default.prototype._pWriters.splice(e, 1); + n.clear(), (n = {}); + }); + }), + (v.default.prototype.save = function (e, t, r) { + var o = arguments, + n = (this._curElement || this).elt; + if (0 === o.length) v.default.prototype.saveCanvas(n); + else if ( + o[0] instanceof v.default.Renderer || + o[0] instanceof v.default.Graphics + ) + v.default.prototype.saveCanvas(o[0].elt, o[1], o[2]); + else if (1 === o.length && "string" == typeof o[0]) + v.default.prototype.saveCanvas(n, o[0]); + else + switch (i(o[1], o[2])[1]) { + case "json": + return void v.default.prototype.saveJSON(o[0], o[1], o[2]); + case "txt": + return void v.default.prototype.saveStrings( + o[0], + o[1], + o[2], + ); + default: + o[0] instanceof Array + ? v.default.prototype.saveStrings(o[0], o[1], o[2]) + : o[0] instanceof v.default.Table + ? v.default.prototype.saveTable(o[0], o[1], o[2]) + : o[0] instanceof v.default.Image + ? v.default.prototype.saveCanvas(o[0].canvas, o[1]) + : o[0] instanceof v.default.SoundFile && + v.default.prototype.saveSound( + o[0], + o[1], + o[2], + o[3], + ); + } + }), + (v.default.prototype.saveJSON = function (e, t, r) { + v.default._validateParameters("saveJSON", arguments), + (r = r ? JSON.stringify(e) : JSON.stringify(e, void 0, 2)), + this.saveStrings(r.split("\n"), t, "json"); + }), + (v.default.prototype.saveJSONObject = v.default.prototype.saveJSON), + (v.default.prototype.saveJSONArray = v.default.prototype.saveJSON), + (v.default.prototype.saveStrings = function (e, t, r, o) { + v.default._validateParameters("saveStrings", arguments); + for ( + var n = this.createWriter(t, r || "txt"), s = 0; + s < e.length; + s++ + ) + o ? n.write(e[s] + "\r\n") : n.write(e[s] + "\n"); + n.close(), n.clear(); + }), + (v.default.prototype.saveTable = function (e, t, r) { + v.default._validateParameters("saveTable", arguments), + (o = + void 0 === r + ? t.substring(t.lastIndexOf(".") + 1, t.length) + : r); + var o, + n = this.createWriter(t, o), + s = e.columns, + i = "tsv" === o ? "\t" : ","; + if ("html" !== o) { + if ("0" !== s[0]) { + for (var a = 0; a < s.length; a++) + a < s.length - 1 ? n.write(s[a] + i) : n.write(s[a]); + n.write("\n"); + } + for (var l = 0; l < e.rows.length; l++) { + for (var u = void 0, u = 0; u < e.rows[l].arr.length; u++) + u < e.rows[l].arr.length - 1 + ? "csv" === o && String(e.rows[l].arr[u]).includes(",") + ? n.write('"' + e.rows[l].arr[u] + '"' + i) + : n.write(e.rows[l].arr[u] + i) + : "csv" === o && String(e.rows[l].arr[u]).includes(",") + ? n.write('"' + e.rows[l].arr[u] + '"') + : n.write(e.rows[l].arr[u]); + n.write("\n"); + } + } else { + n.print(""), n.print(""); + if ( + (n.print( + ' ', + ), + n.print(""), + n.print(""), + n.print(" "), + "0" !== s[0]) + ) { + n.print(" "); + for (var c = 0; c < s.length; c++) { + var d = g(s[c]); + n.print(" "); + } + n.print(" "); + } + for (var h = 0; h < e.rows.length; h++) { + n.print(" "); + for (var f = 0; f < e.columns.length; f++) { + var p = g(e.rows[h].getString(f)); + n.print(" "); + } + n.print(" "); + } + n.print("
                          ".concat(d)), n.print("
                          ".concat(p)), n.print("
                          "), n.print(""), n.print(""); + } + n.close(), n.clear(); + }), + (v.default.prototype.writeFile = function (e, t, r) { + var o = "application/octet-stream", + e = + (v.default.prototype._isSafari() && (o = "text/plain"), + new Blob(e, { type: o })); + v.default.prototype.downloadFile(e, t, r); + }), + (v.default.prototype.downloadFile = function (e, t, r) { + var o, + t = i(t, r), + r = t[0]; + e instanceof Blob + ? n.default.saveAs(e, r) + : (((o = document.createElement("a")).href = e), + (o.download = r), + (o.onclick = function (e) { + document.body.removeChild(e.target), e.stopPropagation(); + }), + (o.style.display = "none"), + document.body.appendChild(o), + v.default.prototype._isSafari() && + ((e = + (e = + 'Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n') + + '3. Name it with this extension: ."'.concat(t[1], '"')), + alert(e)), + o.click()); + }), + (v.default.prototype._checkFileExtension = i), + (v.default.prototype._isSafari = function () { + return ( + 0 < + Object.prototype.toString + .call(window.HTMLElement) + .indexOf("Constructor") + ); + }); + e = v.default; + r.default = e; + }, + { + "../core/friendly_errors/fes_core": 266, + "../core/friendly_errors/file_errors": 267, + "../core/friendly_errors/validate_params": 270, + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.last-index-of": 163, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.object.from-entries": 177, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.promise": 183, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/web.dom-collections.iterator": 238, + "core-js/modules/web.url": 240, + "es6-promise/auto": 241, + "fetch-jsonp": 243, + "file-saver": 244, + "whatwg-fetch": 253, + }, + ], + 302: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.replace"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + n.default.Table = (function () { + function t(e) { + if (!(this instanceof t)) + throw new TypeError("Cannot call a class as a function"); + (this.columns = []), (this.rows = []); + } + var e, r, o; + return ( + (e = t), + (r = [ + { + key: "addRow", + value: function (e) { + e = e || new n.default.TableRow(); + if (void 0 === e.arr || void 0 === e.obj) + throw new Error("invalid TableRow: ".concat(e)); + return (e.table = this).rows.push(e), e; + }, + }, + { + key: "removeRow", + value: function (e) { + this.rows[e].table = null; + e = this.rows.splice(e + 1, this.rows.length); + this.rows.pop(), (this.rows = this.rows.concat(e)); + }, + }, + { + key: "getRow", + value: function (e) { + return this.rows[e]; + }, + }, + { + key: "getRows", + value: function () { + return this.rows; + }, + }, + { + key: "findRow", + value: function (e, t) { + if ("string" == typeof t) { + for (var r = 0; r < this.rows.length; r++) + if (this.rows[r].obj[t] === e) return this.rows[r]; + } else + for (var o = 0; o < this.rows.length; o++) + if (this.rows[o].arr[t] === e) return this.rows[o]; + return null; + }, + }, + { + key: "findRows", + value: function (e, t) { + var r = []; + if ("string" == typeof t) + for (var o = 0; o < this.rows.length; o++) + this.rows[o].obj[t] === e && r.push(this.rows[o]); + else + for (var n = 0; n < this.rows.length; n++) + this.rows[n].arr[t] === e && r.push(this.rows[n]); + return r; + }, + }, + { + key: "matchRow", + value: function (e, t) { + if ("number" == typeof t) { + for (var r = 0; r < this.rows.length; r++) + if (this.rows[r].arr[t].match(e)) return this.rows[r]; + } else + for (var o = 0; o < this.rows.length; o++) + if (this.rows[o].obj[t].match(e)) return this.rows[o]; + return null; + }, + }, + { + key: "matchRows", + value: function (e, t) { + var r = []; + if ("number" == typeof t) + for (var o = 0; o < this.rows.length; o++) + this.rows[o].arr[t].match(e) && r.push(this.rows[o]); + else + for (var n = 0; n < this.rows.length; n++) + this.rows[n].obj[t].match(e) && r.push(this.rows[n]); + return r; + }, + }, + { + key: "getColumn", + value: function (e) { + var t = []; + if ("string" == typeof e) + for (var r = 0; r < this.rows.length; r++) + t.push(this.rows[r].obj[e]); + else + for (var o = 0; o < this.rows.length; o++) + t.push(this.rows[o].arr[e]); + return t; + }, + }, + { + key: "clearRows", + value: function () { + delete this.rows, (this.rows = []); + }, + }, + { + key: "addColumn", + value: function (e) { + this.columns.push(e || null); + }, + }, + { + key: "getColumnCount", + value: function () { + return this.columns.length; + }, + }, + { + key: "getRowCount", + value: function () { + return this.rows.length; + }, + }, + { + key: "removeTokens", + value: function (e, t) { + for (var r = [], o = 0; o < e.length; o++) + r.push( + e.charAt(o).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), + ); + var n = new RegExp(r.join("|"), "g"); + if (void 0 === t) + for (var s = 0; s < this.columns.length; s++) + for (var i = 0; i < this.rows.length; i++) { + var a = (a = this.rows[i].arr[s]).replace(n, ""); + (this.rows[i].arr[s] = a), + (this.rows[i].obj[this.columns[s]] = a); + } + else if ("string" == typeof t) + for (var l = 0; l < this.rows.length; l++) { + var u = (u = this.rows[l].obj[t]).replace(n, ""), + c = + ((this.rows[l].obj[t] = u), + this.columns.indexOf(t)); + this.rows[l].arr[c] = u; + } + else + for (var d = 0; d < this.rows.length; d++) { + var h = (h = this.rows[d].arr[t]).replace(n, ""); + (this.rows[d].arr[t] = h), + (this.rows[d].obj[this.columns[t]] = h); + } + }, + }, + { + key: "trim", + value: function (e) { + var t = new RegExp(" ", "g"); + if (void 0 === e) + for (var r = 0; r < this.columns.length; r++) + for (var o = 0; o < this.rows.length; o++) { + var n = (n = this.rows[o].arr[r]).replace(t, ""); + (this.rows[o].arr[r] = n), + (this.rows[o].obj[this.columns[r]] = n); + } + else if ("string" == typeof e) + for (var s = 0; s < this.rows.length; s++) { + var i = (i = this.rows[s].obj[e]).replace(t, ""), + a = + ((this.rows[s].obj[e] = i), + this.columns.indexOf(e)); + this.rows[s].arr[a] = i; + } + else + for (var l = 0; l < this.rows.length; l++) { + var u = (u = this.rows[l].arr[e]).replace(t, ""); + (this.rows[l].arr[e] = u), + (this.rows[l].obj[this.columns[e]] = u); + } + }, + }, + { + key: "removeColumn", + value: function (e) { + "string" == typeof e + ? (r = this.columns.indexOf((t = e))) + : (t = this.columns[(r = e)]); + var t, + r, + e = this.columns.splice(r + 1, this.columns.length); + this.columns.pop(), (this.columns = this.columns.concat(e)); + for (var o = 0; o < this.rows.length; o++) { + var n = this.rows[o].arr, + s = n.splice(r + 1, n.length); + n.pop(), + (this.rows[o].arr = n.concat(s)), + delete this.rows[o].obj[t]; + } + }, + }, + { + key: "set", + value: function (e, t, r) { + this.rows[e].set(t, r); + }, + }, + { + key: "setNum", + value: function (e, t, r) { + this.rows[e].setNum(t, r); + }, + }, + { + key: "setString", + value: function (e, t, r) { + this.rows[e].setString(t, r); + }, + }, + { + key: "get", + value: function (e, t) { + return this.rows[e].get(t); + }, + }, + { + key: "getNum", + value: function (e, t) { + return this.rows[e].getNum(t); + }, + }, + { + key: "getString", + value: function (e, t) { + return this.rows[e].getString(t); + }, + }, + { + key: "getObject", + value: function (e) { + for (var t, r = {}, o = 0; o < this.rows.length; o++) + if (((t = this.rows[o].obj), "string" == typeof e)) { + if (!(0 <= this.columns.indexOf(e))) + throw new Error( + 'This table has no column named "'.concat(e, '"'), + ); + r[t[e]] = t; + } else r[o] = this.rows[o].obj; + return r; + }, + }, + { + key: "getArray", + value: function () { + for (var e = [], t = 0; t < this.rows.length; t++) + e.push(this.rows[t].arr); + return e; + }, + }, + ]) && s(e.prototype, r), + o && s(e, o), + t + ); + })(); + e = n.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.regexp.constructor": 186, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.match": 193, + "core-js/modules/es.string.replace": 196, + }, + ], + 303: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.from-entries"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.split"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.from-entries"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.split"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + e.default.TableRow = (function () { + function o(e, t) { + if (!(this instanceof o)) + throw new TypeError("Cannot call a class as a function"); + var r = []; + e && (r = e.split((t = t || ","))), + (this.arr = r), + (this.obj = Object.fromEntries(r.entries())), + (this.table = null); + } + var e, t, r; + return ( + (e = o), + (t = [ + { + key: "set", + value: function (e, t) { + if ("string" == typeof e) { + var r = this.table.columns.indexOf(e); + if (!(0 <= r)) + throw new Error( + 'This table has no column named "'.concat(e, '"'), + ); + (this.obj[e] = t), (this.arr[r] = t); + } else { + if (!(e < this.table.columns.length)) + throw new Error( + "Column #".concat( + e, + " is out of the range of this table", + ), + ); + this.arr[e] = t; + r = this.table.columns[e]; + this.obj[r] = t; + } + }, + }, + { + key: "setNum", + value: function (e, t) { + t = parseFloat(t); + this.set(e, t); + }, + }, + { + key: "setString", + value: function (e, t) { + t = t.toString(); + this.set(e, t); + }, + }, + { + key: "get", + value: function (e) { + return ("string" == typeof e ? this.obj : this.arr)[e]; + }, + }, + { + key: "getNum", + value: function (e) { + var t = + "string" == typeof e + ? parseFloat(this.obj[e]) + : parseFloat(this.arr[e]); + if ("NaN" === t.toString()) + throw "Error: ".concat( + this.obj[e], + " is NaN (Not a Number)", + ); + return t; + }, + }, + { + key: "getString", + value: function (e) { + return ("string" == typeof e ? this.obj : this.arr)[ + e + ].toString(); + }, + }, + ]) && n(e.prototype, t), + r && n(e, r), + o + ); + })(); + e = e.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.from-entries": 177, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.split": 198, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 304: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var a = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function s(e) { + for (var t = [], r = 0; r < e.length; r++) + t.push(new a.default.XML(e[r])); + return t; + } + a.default.XML = (function () { + function t(e) { + if (!(this instanceof t)) + throw new TypeError("Cannot call a class as a function"); + e + ? (this.DOM = e) + : ((e = document.implementation.createDocument(null, "doc")), + (this.DOM = e.createElement("root"))); + } + var e, r, o; + return ( + (e = t), + (r = [ + { + key: "getParent", + value: function () { + return new a.default.XML(this.DOM.parentElement); + }, + }, + { + key: "getName", + value: function () { + return this.DOM.tagName; + }, + }, + { + key: "setName", + value: function (e) { + var t = this.DOM.innerHTML, + r = this.DOM.attributes, + o = document.implementation + .createDocument(null, "default") + .createElement(e); + o.innerHTML = t; + for (var n = 0; n < r.length; n++) + o.setAttribute(r[n].nodeName, r.nodeValue); + this.DOM = o; + }, + }, + { + key: "hasChildren", + value: function () { + return 0 < this.DOM.children.length; + }, + }, + { + key: "listChildren", + value: function () { + for (var e = [], t = 0; t < this.DOM.childNodes.length; t++) + e.push(this.DOM.childNodes[t].nodeName); + return e; + }, + }, + { + key: "getChildren", + value: function (e) { + return s( + e ? this.DOM.getElementsByTagName(e) : this.DOM.children, + ); + }, + }, + { + key: "getChild", + value: function (e) { + if ("string" != typeof e) + return new a.default.XML(this.DOM.children[e]); + var t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = this.DOM.children[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + if (i.tagName === e) return new a.default.XML(i); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + }, + }, + { + key: "addChild", + value: function (e) { + e instanceof a.default.XML && this.DOM.appendChild(e.DOM); + }, + }, + { + key: "removeChild", + value: function (e) { + var t = -1; + if ("string" == typeof e) { + for (var r = 0; r < this.DOM.children.length; r++) + if (this.DOM.children[r].tagName === e) { + t = r; + break; + } + } else t = e; + -1 !== t && this.DOM.removeChild(this.DOM.children[t]); + }, + }, + { + key: "getAttributeCount", + value: function () { + return this.DOM.attributes.length; + }, + }, + { + key: "listAttributes", + value: function () { + var e = [], + t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = this.DOM.attributes[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + e.push(i.nodeName); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + return e; + }, + }, + { + key: "hasAttribute", + value: function (e) { + var t = {}, + r = !0, + o = !1, + n = void 0; + try { + for ( + var s, i = this.DOM.attributes[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) { + var a = s.value; + t[a.nodeName] = a.nodeValue; + } + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + return !!t[e]; + }, + }, + { + key: "getNum", + value: function (e, t) { + var r = {}, + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = this.DOM.attributes[Symbol.iterator](); + !(o = (i = a.next()).done); + o = !0 + ) { + var l = i.value; + r[l.nodeName] = l.nodeValue; + } + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + return Number(r[e]) || t || 0; + }, + }, + { + key: "getString", + value: function (e, t) { + var r = {}, + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = this.DOM.attributes[Symbol.iterator](); + !(o = (i = a.next()).done); + o = !0 + ) { + var l = i.value; + r[l.nodeName] = l.nodeValue; + } + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + return r[e] ? String(r[e]) : t || null; + }, + }, + { + key: "setAttribute", + value: function (e, t) { + this.DOM.setAttribute(e, t); + }, + }, + { + key: "getContent", + value: function (e) { + var t = this.DOM.textContent; + return (t = t.replace(/\s\s+/g, ",")) || e || null; + }, + }, + { + key: "setContent", + value: function (e) { + this.DOM.children.length || (this.DOM.textContent = e); + }, + }, + { + key: "serialize", + value: function () { + return new XMLSerializer().serializeToString(this.DOM); + }, + }, + ]) && n(e.prototype, r), + o && n(e, o), + t + ); + })(); + e = a.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.number.constructor": 173, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 305: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var i = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (i.default.prototype.abs = Math.abs), + (i.default.prototype.ceil = Math.ceil), + (i.default.prototype.constrain = function (e, t, r) { + return ( + i.default._validateParameters("constrain", arguments), + Math.max(Math.min(e, r), t) + ); + }), + (i.default.prototype.dist = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + i.default._validateParameters("dist", t), + 4 === t.length + ? Math.hypot(t[2] - t[0], t[3] - t[1]) + : 6 === t.length + ? Math.hypot(t[3] - t[0], t[4] - t[1], t[5] - t[2]) + : void 0 + ); + }), + (i.default.prototype.exp = Math.exp), + (i.default.prototype.floor = Math.floor), + (i.default.prototype.lerp = function (e, t, r) { + return ( + i.default._validateParameters("lerp", arguments), + r * (t - e) + e + ); + }), + (i.default.prototype.log = Math.log), + (i.default.prototype.mag = function (e, t) { + return ( + i.default._validateParameters("mag", arguments), + Math.hypot(e, t) + ); + }), + (i.default.prototype.map = function (e, t, r, o, n, s) { + i.default._validateParameters("map", arguments); + e = ((e - t) / (r - t)) * (n - o) + o; + return s + ? o < n + ? this.constrain(e, o, n) + : this.constrain(e, n, o) + : e; + }), + (i.default.prototype.max = function () { + for ( + var e = function (e) { + var t = -1 / 0, + r = !0, + o = !1, + n = void 0; + try { + for ( + var s, i = e[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) + var a = s.value, t = t < a ? a : t; + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + return t; + }, + t = arguments.length, + r = new Array(t), + o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return r[0] instanceof Array ? e(r[0]) : e(r); + }), + (i.default.prototype.min = function () { + for ( + var e = function (e) { + var t = 1 / 0, + r = !0, + o = !1, + n = void 0; + try { + for ( + var s, i = e[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) + var a = s.value, t = a < t ? a : t; + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + return t; + }, + t = arguments.length, + r = new Array(t), + o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return r[0] instanceof Array ? e(r[0]) : e(r); + }), + (i.default.prototype.norm = function (e, t, r) { + return ( + i.default._validateParameters("norm", arguments), + this.map(e, t, r, 0, 1) + ); + }), + (i.default.prototype.pow = Math.pow), + (i.default.prototype.round = function (e, t) { + return t + ? ((t = Math.pow(10, t)), Math.round(e * t) / t) + : Math.round(e); + }), + (i.default.prototype.sq = function (e) { + return e * e; + }), + (i.default.prototype.sqrt = Math.sqrt), + (i.default.prototype.fract = function (e) { + i.default._validateParameters("fract", arguments); + var t, + r = 0, + e = Number(e); + return isNaN(e) || Math.abs(e) === 1 / 0 + ? e + : (e < 0 && ((e = -e), (r = 1)), + String(e).includes(".") && !String(e).includes("e") + ? ((t = String(e)), + (t = Number("0" + t.slice(t.indexOf(".")))), + Math.abs(r - t)) + : e < 1 + ? Math.abs(r - e) + : 0); + }); + e = i.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.math.hypot": 170, + "core-js/modules/es.number.constructor": 173, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 306: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.slice"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t, r) { + return (n = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? Reflect.construct + : function (e, t, r) { + var o = [null]; + o.push.apply(o, t); + t = new (Function.bind.apply(e, o))(); + return r && s(t, r.prototype), t; + }).apply(null, arguments); + } + function s(e, t) { + return (s = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + o.default.prototype.createVector = function (e, t, r) { + return this instanceof o.default + ? n( + o.default.Vector, + [ + this._fromRadians.bind(this), + this._toRadians.bind(this), + ].concat(Array.prototype.slice.call(arguments)), + ) + : new o.default.Vector(e, t, r); + }; + e = o.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.to-string": 188, + }, + ], + 307: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function b(e) { + return 0.5 * (1 - Math.cos(e * Math.PI)); + } + var j, + _ = 4095, + x = 4, + w = 0.5, + e = + ((e.default.prototype.noise = function (e) { + var t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : 0, + r = + 2 < arguments.length && void 0 !== arguments[2] + ? arguments[2] + : 0; + if (null == j) { + j = new Array(4096); + for (var o = 0; o < 4096; o++) j[o] = Math.random(); + } + e < 0 && (e = -e), t < 0 && (t = -t), r < 0 && (r = -r); + for ( + var n, + s, + i = Math.floor(e), + a = Math.floor(t), + l = Math.floor(r), + u = e - i, + c = t - a, + d = r - l, + h = 0, + f = 0.5, + p = 0; + p < x; + p++ + ) { + var m = i + (a << 4) + (l << 8), + y = b(u), + g = b(c), + v = j[m & _]; + (v += y * (j[(m + 1) & _] - v)), + (n = j[(m + 16) & _]), + (v += g * ((n += y * (j[(m + 16 + 1) & _] - n)) - v)), + (n = j[(m += 256) & _]), + (n += y * (j[(m + 1) & _] - n)), + (s = j[(m + 16) & _]), + (n += g * ((s += y * (j[(m + 16 + 1) & _] - s)) - n)), + (h += (v += b(d) * (n - v)) * f), + (f *= w), + (i <<= 1), + (a <<= 1), + (l <<= 1), + 1 <= (u *= 2) && (i++, u--), + 1 <= (c *= 2) && (a++, c--), + 1 <= (d *= 2) && (l++, d--); + } + return h; + }), + (e.default.prototype.noiseDetail = function (e, t) { + 0 < e && (x = e), 0 < t && (w = t); + }), + (e.default.prototype.noiseSeed = function (e) { + o = 4294967296; + var t, + r, + o, + n = { + setSeed: function (e) { + r = t = (null == e ? Math.random() * o : e) >>> 0; + }, + getSeed: function () { + return t; + }, + rand: function () { + return (r = (1664525 * r + 1013904223) % o) / o; + }, + }; + n.setSeed(e), (j = new Array(4096)); + for (var s = 0; s < 4096; s++) j[s] = n.rand(); + }), + e.default); + r.default = e; + }, + { "../core/main": 275 }, + ], + 308: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.every"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.math.sign"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.number.is-finite"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.sub"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.every"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.math.sign"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.number.is-finite"), + e("core-js/modules/es.string.sub"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var a = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = l(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function l() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (l = function () { + return e; + }), + e); + } + function u(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function c(e, t) { + return ( + 0 !== e && (this.x = this.x % e), + 0 !== t && (this.y = this.y % t), + this + ); + } + function d(e, t, r) { + return ( + 0 !== e && (this.x = this.x % e), + 0 !== t && (this.y = this.y % t), + 0 !== r && (this.z = this.z % r), + this + ); + } + a.default.Vector = (function () { + function n() { + var e = this, + t = n; + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + var r, + o, + e = + "function" == + typeof (arguments.length <= 0 ? void 0 : arguments[0]) + ? ((this.isPInst = !0), + (this._fromRadians = + arguments.length <= 0 ? void 0 : arguments[0]), + (this._toRadians = + arguments.length <= 1 ? void 0 : arguments[1]), + (r = + (arguments.length <= 2 ? void 0 : arguments[2]) || 0), + (o = + (arguments.length <= 3 ? void 0 : arguments[3]) || 0), + (arguments.length <= 4 ? void 0 : arguments[4]) || 0) + : ((r = + (arguments.length <= 0 ? void 0 : arguments[0]) || 0), + (o = + (arguments.length <= 1 ? void 0 : arguments[1]) || 0), + (arguments.length <= 2 ? void 0 : arguments[2]) || 0); + (this.x = r), (this.y = o), (this.z = e); + } + var e, t, r; + return ( + (e = n), + (r = [ + { + key: "fromAngle", + value: function (e, t) { + return new a.default.Vector( + (t = void 0 === t ? 1 : t) * Math.cos(e), + t * Math.sin(e), + 0, + ); + }, + }, + { + key: "fromAngles", + value: function (e, t, r) { + void 0 === r && (r = 1); + var o = Math.cos(t), + t = Math.sin(t), + n = Math.cos(e), + e = Math.sin(e); + return new a.default.Vector(r * e * t, -r * n, r * e * o); + }, + }, + { + key: "random2D", + value: function () { + return this.fromAngle(Math.random() * s.TWO_PI); + }, + }, + { + key: "random3D", + value: function () { + var e = Math.random() * s.TWO_PI, + t = 2 * Math.random() - 1, + r = Math.sqrt(1 - t * t), + o = r * Math.cos(e), + r = r * Math.sin(e); + return new a.default.Vector(o, r, t); + }, + }, + { + key: "copy", + value: function (e) { + return e.copy(e); + }, + }, + { + key: "add", + value: function (e, t, r) { + return ( + r + ? r.set(e) + : ((r = e.copy()), + 3 === arguments.length && + a.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.add", + )), + r.add(t), + r + ); + }, + }, + { + key: "rem", + value: function (e, t) { + if ( + e instanceof a.default.Vector && + t instanceof a.default.Vector + ) + return (e = e.copy()).rem(t), e; + }, + }, + { + key: "sub", + value: function (e, t, r) { + return ( + r + ? r.set(e) + : ((r = e.copy()), + 3 === arguments.length && + a.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.sub", + )), + r.sub(t), + r + ); + }, + }, + { + key: "mult", + value: function (e, t, r) { + return ( + r + ? r.set(e) + : ((r = e.copy()), + 3 === arguments.length && + a.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.mult", + )), + r.mult(t), + r + ); + }, + }, + { + key: "rotate", + value: function (e, t, r) { + return ( + 2 === arguments.length + ? (r = e.copy()) + : (r instanceof a.default.Vector || + a.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.rotate", + ), + r.set(e)), + r.rotate(t), + r + ); + }, + }, + { + key: "div", + value: function (e, t, r) { + return ( + r + ? r.set(e) + : ((r = e.copy()), + 3 === arguments.length && + a.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.div", + )), + r.div(t), + r + ); + }, + }, + { + key: "dot", + value: function (e, t) { + return e.dot(t); + }, + }, + { + key: "cross", + value: function (e, t) { + return e.cross(t); + }, + }, + { + key: "dist", + value: function (e, t) { + return e.dist(t); + }, + }, + { + key: "lerp", + value: function (e, t, r, o) { + return ( + o + ? o.set(e) + : ((o = e.copy()), + 4 === arguments.length && + a.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.lerp", + )), + o.lerp(t, r), + o + ); + }, + }, + { + key: "slerp", + value: function (e, t, r, o) { + return ( + o + ? o.set(e) + : ((o = e.copy()), + 4 === arguments.length && + a.default._friendlyError( + "The target parameter is undefined, it should be of type p5.Vector", + "p5.Vector.slerp", + )), + o.slerp(t, r), + o + ); + }, + }, + { + key: "mag", + value: function (e) { + return e.mag(); + }, + }, + { + key: "magSq", + value: function (e) { + return e.magSq(); + }, + }, + { + key: "normalize", + value: function (e, t) { + return ( + arguments.length < 2 + ? (t = e.copy()) + : (t instanceof a.default.Vector || + a.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.normalize", + ), + t.set(e)), + t.normalize() + ); + }, + }, + { + key: "limit", + value: function (e, t, r) { + return ( + arguments.length < 3 + ? (r = e.copy()) + : (r instanceof a.default.Vector || + a.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.limit", + ), + r.set(e)), + r.limit(t) + ); + }, + }, + { + key: "setMag", + value: function (e, t, r) { + return ( + arguments.length < 3 + ? (r = e.copy()) + : (r instanceof a.default.Vector || + a.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.setMag", + ), + r.set(e)), + r.setMag(t) + ); + }, + }, + { + key: "heading", + value: function (e) { + return e.heading(); + }, + }, + { + key: "angleBetween", + value: function (e, t) { + return e.angleBetween(t); + }, + }, + { + key: "reflect", + value: function (e, t, r) { + return ( + arguments.length < 3 + ? (r = e.copy()) + : (r instanceof a.default.Vector || + a.default._friendlyError( + "The target parameter should be of type p5.Vector", + "p5.Vector.reflect", + ), + r.set(e)), + r.reflect(t) + ); + }, + }, + { + key: "array", + value: function (e) { + return e.array(); + }, + }, + { + key: "equals", + value: function (e, t) { + var r; + return ( + e instanceof a.default.Vector + ? (r = e) + : e instanceof Array + ? (r = new a.default.Vector().set(e)) + : a.default._friendlyError( + "The v1 parameter should be of type Array or p5.Vector", + "p5.Vector.equals", + ), + r.equals(t) + ); + }, + }, + ]), + (t = [ + { + key: "toString", + value: function () { + return "p5.Vector Object : [" + .concat(this.x, ", ") + .concat(this.y, ", ") + .concat(this.z, "]"); + }, + }, + { + key: "set", + value: function (e, t, r) { + return ( + e instanceof a.default.Vector + ? ((this.x = e.x || 0), + (this.y = e.y || 0), + (this.z = e.z || 0)) + : Array.isArray(e) + ? ((this.x = e[0] || 0), + (this.y = e[1] || 0), + (this.z = e[2] || 0)) + : ((this.x = e || 0), + (this.y = t || 0), + (this.z = r || 0)), + this + ); + }, + }, + { + key: "copy", + value: function () { + return this.isPInst + ? new a.default.Vector( + this._fromRadians, + this._toRadians, + this.x, + this.y, + this.z, + ) + : new a.default.Vector(this.x, this.y, this.z); + }, + }, + { + key: "add", + value: function (e, t, r) { + return ( + e instanceof a.default.Vector + ? ((this.x += e.x || 0), + (this.y += e.y || 0), + (this.z += e.z || 0)) + : Array.isArray(e) + ? ((this.x += e[0] || 0), + (this.y += e[1] || 0), + (this.z += e[2] || 0)) + : ((this.x += e || 0), + (this.y += t || 0), + (this.z += r || 0)), + this + ); + }, + }, + { + key: "rem", + value: function (e, t, r) { + var o; + if (e instanceof a.default.Vector) { + if ([e.x, e.y, e.z].every(Number.isFinite)) + return ( + (n = parseFloat(e.x)), + (s = parseFloat(e.y)), + (o = parseFloat(e.z)), + d.call(this, n, s, o) + ); + } else if (Array.isArray(e)) { + if ( + e.every(function (e) { + return Number.isFinite(e); + }) + ) + return 2 === e.length + ? c.call(this, e[0], e[1]) + : 3 === e.length + ? d.call(this, e[0], e[1], e[2]) + : void 0; + } else if (1 === arguments.length) { + if (Number.isFinite(e) && 0 !== e) + return ( + (this.x = this.x % e), + (this.y = this.y % e), + (this.z = this.z % e), + this + ); + } else if (2 === arguments.length) { + var n = Array.prototype.slice.call(arguments); + if ( + n.every(function (e) { + return Number.isFinite(e); + }) && + 2 === n.length + ) + return c.call(this, n[0], n[1]); + } else if (3 === arguments.length) { + var s = Array.prototype.slice.call(arguments); + if ( + s.every(function (e) { + return Number.isFinite(e); + }) && + 3 === s.length + ) + return d.call(this, s[0], s[1], s[2]); + } + }, + }, + { + key: "sub", + value: function (e, t, r) { + return ( + e instanceof a.default.Vector + ? ((this.x -= e.x || 0), + (this.y -= e.y || 0), + (this.z -= e.z || 0)) + : Array.isArray(e) + ? ((this.x -= e[0] || 0), + (this.y -= e[1] || 0), + (this.z -= e[2] || 0)) + : ((this.x -= e || 0), + (this.y -= t || 0), + (this.z -= r || 0)), + this + ); + }, + }, + { + key: "mult", + value: function (e, t, r) { + var o; + return ( + e instanceof a.default.Vector + ? Number.isFinite(e.x) && + Number.isFinite(e.y) && + Number.isFinite(e.z) && + "number" == typeof e.x && + "number" == typeof e.y && + "number" == typeof e.z + ? ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z)) + : console.warn( + "p5.Vector.prototype.mult:", + "x contains components that are either undefined or not finite numbers", + ) + : Array.isArray(e) + ? e.every(function (e) { + return Number.isFinite(e); + }) && + e.every(function (e) { + return "number" == typeof e; + }) + ? 1 === e.length + ? ((this.x *= e[0]), + (this.y *= e[0]), + (this.z *= e[0])) + : 2 === e.length + ? ((this.x *= e[0]), (this.y *= e[1])) + : 3 === e.length && + ((this.x *= e[0]), + (this.y *= e[1]), + (this.z *= e[2])) + : console.warn( + "p5.Vector.prototype.mult:", + "x contains elements that are either undefined or not finite numbers", + ) + : (o = Array.prototype.slice.call(arguments)).every( + function (e) { + return Number.isFinite(e); + }, + ) && + o.every(function (e) { + return "number" == typeof e; + }) + ? (1 === arguments.length && + ((this.x *= e), (this.y *= e), (this.z *= e)), + 2 === arguments.length && + ((this.x *= e), (this.y *= t)), + 3 === arguments.length && + ((this.x *= e), (this.y *= t), (this.z *= r))) + : console.warn( + "p5.Vector.prototype.mult:", + "x, y, or z arguments are either undefined or not a finite number", + ), + this + ); + }, + }, + { + key: "div", + value: function (e, t, r) { + if (e instanceof a.default.Vector) + if ( + Number.isFinite(e.x) && + Number.isFinite(e.y) && + Number.isFinite(e.z) && + "number" == typeof e.x && + "number" == typeof e.y && + "number" == typeof e.z + ) { + var o = 0 === e.z && 0 === this.z; + if (0 === e.x || 0 === e.y || (!o && 0 === e.z)) + return ( + console.warn( + "p5.Vector.prototype.div:", + "divide by 0", + ), + this + ); + (this.x /= e.x), (this.y /= e.y), o || (this.z /= e.z); + } else + console.warn( + "p5.Vector.prototype.div:", + "x contains components that are either undefined or not finite numbers", + ); + else if (Array.isArray(e)) + if ( + e.every(function (e) { + return Number.isFinite(e); + }) && + e.every(function (e) { + return "number" == typeof e; + }) + ) { + if ( + e.some(function (e) { + return 0 === e; + }) + ) + return ( + console.warn( + "p5.Vector.prototype.div:", + "divide by 0", + ), + this + ); + 1 === e.length + ? ((this.x /= e[0]), + (this.y /= e[0]), + (this.z /= e[0])) + : 2 === e.length + ? ((this.x /= e[0]), (this.y /= e[1])) + : 3 === e.length && + ((this.x /= e[0]), + (this.y /= e[1]), + (this.z /= e[2])); + } else + console.warn( + "p5.Vector.prototype.div:", + "x contains components that are either undefined or not finite numbers", + ); + else { + o = Array.prototype.slice.call(arguments); + if ( + o.every(function (e) { + return Number.isFinite(e); + }) && + o.every(function (e) { + return "number" == typeof e; + }) + ) { + if ( + o.some(function (e) { + return 0 === e; + }) + ) + return ( + console.warn( + "p5.Vector.prototype.div:", + "divide by 0", + ), + this + ); + 1 === arguments.length && + ((this.x /= e), (this.y /= e), (this.z /= e)), + 2 === arguments.length && + ((this.x /= e), (this.y /= t)), + 3 === arguments.length && + ((this.x /= e), (this.y /= t), (this.z /= r)); + } else + console.warn( + "p5.Vector.prototype.div:", + "x, y, or z arguments are either undefined or not a finite number", + ); + } + return this; + }, + }, + { + key: "mag", + value: function () { + return Math.sqrt(this.magSq()); + }, + }, + { + key: "magSq", + value: function () { + var e = this.x, + t = this.y, + r = this.z; + return e * e + t * t + r * r; + }, + }, + { + key: "dot", + value: function (e, t, r) { + return e instanceof a.default.Vector + ? this.dot(e.x, e.y, e.z) + : this.x * (e || 0) + + this.y * (t || 0) + + this.z * (r || 0); + }, + }, + { + key: "cross", + value: function (e) { + var t = this.y * e.z - this.z * e.y, + r = this.z * e.x - this.x * e.z, + e = this.x * e.y - this.y * e.x; + return this.isPInst + ? new a.default.Vector( + this._fromRadians, + this._toRadians, + t, + r, + e, + ) + : new a.default.Vector(t, r, e); + }, + }, + { + key: "dist", + value: function (e) { + return e.copy().sub(this).mag(); + }, + }, + { + key: "normalize", + value: function () { + var e = this.mag(); + return 0 !== e && this.mult(1 / e), this; + }, + }, + { + key: "limit", + value: function (e) { + var t = this.magSq(); + return e * e < t && this.div(Math.sqrt(t)).mult(e), this; + }, + }, + { + key: "setMag", + value: function (e) { + return this.normalize().mult(e); + }, + }, + { + key: "heading", + value: function () { + var e = Math.atan2(this.y, this.x); + return this.isPInst ? this._fromRadians(e) : e; + }, + }, + { + key: "setHeading", + value: function (e) { + this.isPInst && (e = this._toRadians(e)); + var t = this.mag(); + return ( + (this.x = t * Math.cos(e)), + (this.y = t * Math.sin(e)), + this + ); + }, + }, + { + key: "rotate", + value: function (e) { + var e = this.heading() + e, + t = + (this.isPInst && (e = this._toRadians(e)), this.mag()); + return ( + (this.x = Math.cos(e) * t), + (this.y = Math.sin(e) * t), + this + ); + }, + }, + { + key: "angleBetween", + value: function (e) { + var t; + return 0 == this.magSq() * e.magSq() + ? NaN + : ((t = this.cross(e)), + (e = + Math.atan2(t.mag(), this.dot(e)) * + Math.sign(t.z || 1)), + this.isPInst ? this._fromRadians(e) : e); + }, + }, + { + key: "lerp", + value: function (e, t, r, o) { + return e instanceof a.default.Vector + ? this.lerp(e.x, e.y, e.z, t) + : ((this.x += (e - this.x) * o || 0), + (this.y += (t - this.y) * o || 0), + (this.z += (r - this.z) * o || 0), + this); + }, + }, + { + key: "slerp", + value: function (e, t) { + if (0 !== t) { + if (1 === t) return this.set(e); + var r = this.mag(), + o = e.mag(); + if (0 == r * o) + this.mult(1 - t).add(e.x * t, e.y * t, e.z * t); + else { + var n = this.cross(e), + s = n.mag(), + i = Math.atan2(s, this.dot(e)); + if (0 < s) (n.x /= s), (n.y /= s), (n.z /= s); + else { + if (i < 0.5 * Math.PI) + return ( + this.mult(1 - t).add(e.x * t, e.y * t, e.z * t), + this + ); + 0 === this.z && 0 === e.z + ? n.set(0, 0, 1) + : 0 !== this.x + ? n.set(this.y, -this.x, 0).normalize() + : n.set(1, 0, 0); + } + (s = n.cross(this)), + (e = 1 - t + (t * o) / r), + (n = e * Math.cos(t * i)), + (o = e * Math.sin(t * i)); + (this.x = this.x * n + s.x * o), + (this.y = this.y * n + s.y * o), + (this.z = this.z * n + s.z * o); + } + } + return this; + }, + }, + { + key: "reflect", + value: function (e) { + return e.normalize(), this.sub(e.mult(2 * this.dot(e))); + }, + }, + { + key: "array", + value: function () { + return [this.x || 0, this.y || 0, this.z || 0]; + }, + }, + { + key: "equals", + value: function (e, t, r) { + var o, + n, + e = + e instanceof a.default.Vector + ? ((o = e.x || 0), (n = e.y || 0), e.z || 0) + : Array.isArray(e) + ? ((o = e[0] || 0), (n = e[1] || 0), e[2] || 0) + : ((o = e || 0), (n = t || 0), r || 0); + return this.x === o && this.y === n && this.z === e; + }, + }, + ]) && u(e.prototype, t), + r && u(e, r), + n + ); + })(); + var n = a.default.Vector; + r.default = n; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.every": 153, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.some": 166, + "core-js/modules/es.math.sign": 172, + "core-js/modules/es.number.constructor": 173, + "core-js/modules/es.number.is-finite": 174, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.sub": 200, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 309: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + var s = "_lcg_random_state", + o = 4294967296, + i = 0, + e = + ((n.default.prototype._lcg = function (e) { + return ( + (this[e] = (1664525 * this[e] + 1013904223) % o), this[e] / o + ); + }), + (n.default.prototype._lcgSetSeed = function (e, t) { + this[e] = (null == t ? Math.random() * o : t) >>> 0; + }), + (n.default.prototype.randomSeed = function (e) { + this._lcgSetSeed(s, e), (this._gaussian_previous = !1); + }), + (n.default.prototype.random = function (e, t) { + var r, o; + return ( + n.default._validateParameters("random", arguments), + (r = null != this[s] ? this._lcg(s) : Math.random()), + void 0 === e + ? r + : void 0 === t + ? e instanceof Array + ? e[Math.floor(r * e.length)] + : r * e + : (t < e && ((o = e), (e = t), (t = o)), r * (t - e) + e) + ); + }), + (n.default.prototype.randomGaussian = function (e) { + var t, + r, + o, + n, + s = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : 1; + if (this._gaussian_previous) + (t = i), (this._gaussian_previous = !1); + else { + for ( + ; + 1 <= + (n = + (r = this.random(2) - 1) * r + + (o = this.random(2) - 1) * o); + + ); + (t = r * (n = Math.sqrt((-2 * Math.log(n)) / n))), + (i = o * n), + (this._gaussian_previous = !0); + } + return t * s + (e || 0); + }), + n.default); + r.default = e; + }, + { "../core/main": 275 }, + ], + 310: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (l = e("../core/main")) && l.__esModule ? l : { default: l }, + s = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + (n.default.prototype._angleMode = s.RADIANS), + (n.default.prototype.acos = function (e) { + return this._fromRadians(Math.acos(e)); + }), + (n.default.prototype.asin = function (e) { + return this._fromRadians(Math.asin(e)); + }), + (n.default.prototype.atan = function (e) { + return this._fromRadians(Math.atan(e)); + }), + (n.default.prototype.atan2 = function (e, t) { + return this._fromRadians(Math.atan2(e, t)); + }), + (n.default.prototype.cos = function (e) { + return Math.cos(this._toRadians(e)); + }), + (n.default.prototype.sin = function (e) { + return Math.sin(this._toRadians(e)); + }), + (n.default.prototype.tan = function (e) { + return Math.tan(this._toRadians(e)); + }), + (n.default.prototype.degrees = function (e) { + return e * s.RAD_TO_DEG; + }), + (n.default.prototype.radians = function (e) { + return e * s.DEG_TO_RAD; + }), + (n.default.prototype.angleMode = function (e) { + if ( + (n.default._validateParameters("angleMode", arguments), + void 0 === e) + ) + return this._angleMode; + (e !== s.DEGREES && e !== s.RADIANS) || (this._angleMode = e); + }), + (n.default.prototype._toRadians = function (e) { + return this._angleMode === s.DEGREES ? e * s.DEG_TO_RAD : e; + }), + (n.default.prototype._toDegrees = function (e) { + return this._angleMode === s.RADIANS ? e * s.RAD_TO_DEG : e; + }), + (n.default.prototype._fromRadians = function (e) { + return this._angleMode === s.DEGREES ? e * s.RAD_TO_DEG : e; + }); + var l = n.default; + r.default = l; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 311: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var i = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (i.default.prototype.textAlign = function (e, t) { + var r; + return ( + i.default._validateParameters("textAlign", arguments), + (r = this._renderer).textAlign.apply(r, arguments) + ); + }), + (i.default.prototype.textLeading = function (e) { + var t; + return ( + i.default._validateParameters("textLeading", arguments), + (t = this._renderer).textLeading.apply(t, arguments) + ); + }), + (i.default.prototype.textSize = function (e) { + var t; + return ( + i.default._validateParameters("textSize", arguments), + (t = this._renderer).textSize.apply(t, arguments) + ); + }), + (i.default.prototype.textStyle = function (e) { + var t; + return ( + i.default._validateParameters("textStyle", arguments), + (t = this._renderer).textStyle.apply(t, arguments) + ); + }), + (i.default.prototype.textWidth = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + if ( + ((t[0] += ""), + i.default._validateParameters("textWidth", t), + 0 === t[0].length) + ) + return 0; + for ( + var o = t[0].replace(/\t/g, " ").split(/\r?\n|\r|\n/g), + n = [], + s = 0; + s < o.length; + s++ + ) + n.push(this._renderer.textWidth(o[s])); + return Math.max.apply(Math, n); + }), + (i.default.prototype.textAscent = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + i.default._validateParameters("textAscent", t), + this._renderer.textAscent() + ); + }), + (i.default.prototype.textDescent = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + i.default._validateParameters("textDescent", t), + this._renderer.textDescent() + ); + }), + (i.default.prototype._updateTextMetrics = function () { + return this._renderer._updateTextMetrics(); + }), + (i.default.prototype.textWrap = function (e) { + if ("WORD" !== e && "CHAR" !== e) + throw "Error: textWrap accepts only WORD or CHAR"; + return this._renderer.textWrap(e); + }); + e = i.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + }, + ], + 312: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.last-index-of"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.last-index-of"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.split"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l = (c = e("../core/main")) && c.__esModule ? c : { default: c }, + n = s(e("../core/constants")), + u = s(e("opentype.js")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function s(e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o, + n = {}, + s = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) + Object.prototype.hasOwnProperty.call(e, r) && + ((o = s ? Object.getOwnPropertyDescriptor(e, r) : null) && + (o.get || o.set) + ? Object.defineProperty(n, r, o) + : (n[r] = e[r])); + return (n.default = e), t && t.set(e, n), n; + } + e("../core/friendly_errors/validate_params"), + e("../core/friendly_errors/file_errors"), + e("../core/friendly_errors/fes_core"), + (l.default.prototype.loadFont = function (o, n, s) { + l.default._validateParameters("loadFont", arguments); + var i = new l.default.Font(this), + a = this; + return ( + u.load(o, function (e, t) { + if (e) + return ( + l.default._friendlyFileLoadError(4, o), + void 0 !== s ? s(e) : void console.error(e, o) + ); + (i.font = t), void 0 !== n && n(i), a._decrementPreload(); + var e = o.split("\\").pop().split("/").pop(), + t = e.lastIndexOf("."), + r = t < 1 ? null : e.slice(t + 1); + ["ttf", "otf", "woff", "woff2"].includes(r) && + ((r = e.slice(0, -1 !== t ? t : 0)), + (e = document.createElement("style")).appendChild( + document.createTextNode( + "\n@font-face {\nfont-family: " + .concat(r, ";\nsrc: url(") + .concat(o, ");\n}\n"), + ), + ), + document.head.appendChild(e)); + }), + i + ); + }), + (l.default.prototype.text = function (e, t, r, o, n) { + var s; + return ( + l.default._validateParameters("text", arguments), + this._renderer._doFill || this._renderer._doStroke + ? (s = this._renderer).text.apply(s, arguments) + : this + ); + }), + (l.default.prototype.textFont = function (e, t) { + if ( + (l.default._validateParameters("textFont", arguments), + arguments.length) + ) { + if (e) + return ( + this._renderer._setProperty("_textFont", e), + t && + (this._renderer._setProperty("_textSize", t), + this._renderer._leadingSet || + this._renderer._setProperty( + "_textLeading", + t * n._DEFAULT_LEADMULT, + )), + this._renderer._applyTextProperties() + ); + throw new Error("null font passed to textFont"); + } + return this._renderer._textFont; + }); + var c = l.default; + r.default = c; + }, + { + "../core/constants": 264, + "../core/friendly_errors/fes_core": 266, + "../core/friendly_errors/file_errors": 267, + "../core/friendly_errors/validate_params": 270, + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.last-index-of": 163, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + "opentype.js": 249, + }, + ], + 313: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + v = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== j(e) && "function" != typeof e)) + return { default: e }; + var t = i(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function i() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (i = function () { + return e; + }), + e); + } + function j(e) { + return (j = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function _(e, t) { + var r = e.length; + return e[t < 0 ? (t % r) + r : t % r]; + } + function x(e, t, r, o) { + var n, s, i; + return o + ? (void 0 === x.tmpPoint1 && + ((x.tmpPoint1 = []), (x.tmpPoint2 = [])), + (s = x.tmpPoint1), + (i = x.tmpPoint2), + (s.x = t.x - e.x), + (s.y = t.y - e.y), + (i.x = r.x - t.x), + (i.y = r.y - t.y), + (n = s.x * i.x + s.y * i.y), + (s = Math.sqrt(s.x * s.x + s.y * s.y)), + (i = Math.sqrt(i.x * i.x + i.y * i.y)), + Math.acos(n / (s * i)) < o) + : 0 == + (t[0] - e[0]) * (r[1] - e[1]) - (r[0] - e[0]) * (t[1] - e[1]); + } + function d(e, t, r, o, n, s, i, a, l) { + var u = 1 - l, + c = Math.pow(u, 3), + d = Math.pow(u, 2), + h = l * l, + f = h * l, + p = c * e + 3 * d * l * r + 3 * u * l * l * n + f * i, + c = c * t + 3 * d * l * o + 3 * u * l * l * s + f * a, + d = e + 2 * l * (r - e) + h * (n - 2 * r + e), + f = t + 2 * l * (o - t) + h * (s - 2 * o + t), + m = r + 2 * l * (n - r) + h * (i - 2 * n + r), + h = o + 2 * l * (s - o) + h * (a - 2 * s + o), + e = u * e + l * r, + r = u * t + l * o, + t = u * n + l * i, + o = u * s + l * a, + n = 90 - (180 * Math.atan2(d - m, f - h)) / Math.PI; + return ( + (m < d || f < h) && (n += 180), + { + x: p, + y: c, + m: { x: d, y: f }, + n: { x: m, y: h }, + start: { x: e, y: r }, + end: { x: t, y: o }, + alpha: n, + } + ); + } + function h(e, t, r, o, n, s, i, a, l) { + return null == l + ? f(e, t, r, o, n, s, i, a) + : d( + e, + t, + r, + o, + n, + s, + i, + a, + (function (e, t, r, o, n, s, i, a, l) { + if (!(l < 0 || f(e, t, r, o, n, s, i, a) < l)) { + var u, + c = 0.5, + d = 1 - c; + for ( + u = f(e, t, r, o, n, s, i, a, d); + 0.01 < Math.abs(u - l); + + ) + u = f( + e, + t, + r, + o, + n, + s, + i, + a, + (d += (u < l ? 1 : -1) * (c /= 2)), + ); + return d; + } + })(e, t, r, o, n, s, i, a, l), + ); + } + function w(e, t, r) { + for ( + var o, + n, + s, + i, + a, + l = 0, + u = 0, + c = (e = (function (e, t) { + function r(e, t, r) { + var o, n; + if (!e) return ["C", t.x, t.y, t.x, t.y, t.x, t.y]; + switch ( + ((e[0] in { T: 1, Q: 1 }) || (t.qx = t.qy = null), e[0]) + ) { + case "M": + (t.X = e[1]), (t.Y = e[2]); + break; + case "A": + e = ["C"].concat( + M.apply(0, [t.x, t.y].concat(e.slice(1))), + ); + break; + case "S": + (n = + "C" === r || "S" === r + ? ((o = 2 * t.x - t.bx), 2 * t.y - t.by) + : ((o = t.x), t.y)), + (e = ["C", o, n].concat(e.slice(1))); + break; + case "T": + "Q" === r || "T" === r + ? ((t.qx = 2 * t.x - t.qx), (t.qy = 2 * t.y - t.qy)) + : ((t.qx = t.x), (t.qy = t.y)), + (e = ["C"].concat( + E(t.x, t.y, t.qx, t.qy, e[1], e[2]), + )); + break; + case "Q": + (t.qx = e[1]), + (t.qy = e[2]), + (e = ["C"].concat( + E(t.x, t.y, e[1], e[2], e[3], e[4]), + )); + break; + case "L": + e = ["C"].concat(T(t.x, t.y, e[1], e[2])); + break; + case "H": + e = ["C"].concat(T(t.x, t.y, e[1], t.y)); + break; + case "V": + e = ["C"].concat(T(t.x, t.y, t.x, e[1])); + break; + case "Z": + e = ["C"].concat(T(t.x, t.y, t.X, t.Y)); + } + return e; + } + function o(e, t) { + if (7 < e[t].length) { + e[t].shift(); + for (var r = e[t]; r.length; ) + (c[t] = "A"), + a && (d[t] = "A"), + e.splice(t++, 0, ["C"].concat(r.splice(0, 6))); + e.splice(t, 1), + (s = Math.max(i.length, (a && a.length) || 0)); + } + } + function n(e, t, r, o, n) { + e && + t && + "M" === e[n][0] && + "M" !== t[n][0] && + (t.splice(n, 0, ["M", o.x, o.y]), + (r.bx = 0), + (r.by = 0), + (r.x = e[n][1]), + (r.y = e[n][2]), + (s = Math.max(i.length, (a && a.length) || 0))); + } + var s, + i = b(e), + a = t && b(t), + l = { + x: 0, + y: 0, + bx: 0, + by: 0, + X: 0, + Y: 0, + qx: null, + qy: null, + }, + u = { + x: 0, + y: 0, + bx: 0, + by: 0, + X: 0, + Y: 0, + qx: null, + qy: null, + }, + c = [], + d = [], + h = "", + f = ""; + s = Math.max(i.length, (a && a.length) || 0); + for (var p = 0; p < s; p++) { + "C" !== (h = i[p] ? i[p][0] : h) && + ((c[p] = h), p && (f = c[p - 1])), + (i[p] = r(i[p], l, f)), + "A" !== c[p] && "C" === h && (c[p] = "C"), + o(i, p), + a && + ("C" !== (h = a[p] ? a[p][0] : h) && + ((d[p] = h), p && (f = d[p - 1])), + (a[p] = r(a[p], u, f)), + "A" !== d[p] && "C" === h && (d[p] = "C"), + o(a, p)), + n(i, a, l, u, p), + n(a, i, u, l, p); + var m = i[p], + y = a && a[p], + g = m.length, + v = a && y.length; + (l.x = m[g - 2]), + (l.y = m[g - 1]), + (l.bx = parseFloat(m[g - 4]) || l.x), + (l.by = parseFloat(m[g - 3]) || l.y), + (u.bx = a && (parseFloat(y[v - 4]) || u.x)), + (u.by = a && (parseFloat(y[v - 3]) || u.y)), + (u.x = a && y[v - 2]), + (u.y = a && y[v - 1]); + } + return a ? [i, a] : i; + })(e)).length; + u < c; + u++ + ) { + if ("M" === (s = e[u])[0]) (o = +s[1]), (n = +s[2]); + else { + if ( + t < l + (i = h(o, n, s[1], s[2], s[3], s[4], s[5], s[6])) && + !r + ) + return { + x: (a = h(o, n, s[1], s[2], s[3], s[4], s[5], s[6], t - l)) + .x, + y: a.y, + alpha: a.alpha, + }; + (l += i), (o = +s[5]), (n = +s[6]); + } + s.shift(); + } + return (a = (a = r + ? l + : d(o, n, s[0], s[1], s[2], s[3], s[4], s[5], 1)).alpha + ? { x: a.x, y: a.y, alpha: a.alpha } + : a); + } + function b(e) { + var t = [], + r = 0, + o = 0, + n = 0, + s = 0, + i = 0; + if (e) { + "M" === e[0][0] && + ((n = r = +e[0][1]), + (s = o = +e[0][2]), + i++, + (t[0] = ["M", r, o])); + for ( + var a, + l, + u = + 3 === e.length && + "M" === e[0][0] && + "R" === e[1][0].toUpperCase() && + "Z" === e[2][0].toUpperCase(), + c = i, + d = e.length; + c < d; + c++ + ) { + if ( + (t.push((a = [])), + (l = e[c])[0] !== String.prototype.toUpperCase.call(l[0])) + ) + switch ( + ((a[0] = String.prototype.toUpperCase.call(l[0])), a[0]) + ) { + case "A": + (a[1] = l[1]), + (a[2] = l[2]), + (a[3] = l[3]), + (a[4] = l[4]), + (a[5] = l[5]), + (a[6] = +(l[6] + r)), + (a[7] = +(l[7] + o)); + break; + case "V": + a[1] = +l[1] + o; + break; + case "H": + a[1] = +l[1] + r; + break; + case "R": + for ( + var h, + f = 2, + p = (h = [r, o].concat(l.slice(1))).length; + f < p; + f++ + ) + (h[f] = +h[f] + r), (h[++f] = +h[f] + o); + t.pop(), (t = t.concat(S(h, u))); + break; + case "M": + (n = +l[1] + r), (s = +l[2] + o); + break; + default: + for (var m = 1, y = l.length; m < y; m++) + a[m] = +l[m] + (m % 2 ? r : o); + } + else if ("R" === l[0]) + (h = [r, o].concat(l.slice(1))), + t.pop(), + (t = t.concat(S(h, u))), + (a = ["R"].concat(l.slice(-2))); + else for (var g = 0, v = l.length; g < v; g++) a[g] = l[g]; + switch (a[0]) { + case "Z": + (r = n), (o = s); + break; + case "H": + r = a[1]; + break; + case "V": + o = a[1]; + break; + case "M": + (n = a[a.length - 2]), (s = a[a.length - 1]); + break; + default: + (r = a[a.length - 2]), (o = a[a.length - 1]); + } + } + } + return t; + } + function M(e, t, r, o, n, s, i, a, l, u) { + function c(e, t, r) { + return { + x: e * Math.cos(r) - t * Math.sin(r), + y: e * Math.sin(r) + t * Math.cos(r), + }; + } + var d, + h = Math.PI, + f = (120 * h) / 180, + p = (h / 180) * (+n || 0), + m = [], + y = + (u + ? ((x = u[0]), (d = u[1]), (j = u[2]), (_ = u[3])) + : ((e = (v = c(e, t, -p)).x), + (t = v.y), + 1 < + (y = + ((g = (e - (a = (v = c(a, l, -p)).x)) / 2) * g) / + (r * r) + + ((v = (t - (l = v.y)) / 2) * v) / (o * o)) && + ((r *= y = Math.sqrt(y)), (o *= y)), + (y = r * r), + (b = o * o), + (j = + ((s = + (s === i ? -1 : 1) * + Math.sqrt( + Math.abs( + (y * b - y * v * v - b * g * g) / + (y * v * v + b * g * g), + ), + )) * + r * + v) / + o + + (e + a) / 2), + (_ = (s * -o * g) / r + (t + l) / 2), + (x = Math.asin(((t - _) / o).toFixed(9))), + (d = Math.asin(((l - _) / o).toFixed(9))), + (x = e < j ? h - x : x) < 0 && (x = 2 * h + x), + (d = a < j ? h - d : d) < 0 && (d = 2 * h + d), + i && d < x && (x -= 2 * h), + !i && x < d && (d -= 2 * h)), + d - x), + g = + (Math.abs(y) > f && + ((b = d), + (v = a), + (s = l), + (d = x + f * (i && x < d ? 1 : -1)), + (m = M( + (a = j + r * Math.cos(d)), + (l = _ + o * Math.sin(d)), + r, + o, + n, + 0, + i, + v, + s, + [d, b, j, _], + ))), + (y = d - x), + Math.cos(x)), + h = Math.sin(x), + f = Math.cos(d), + n = Math.sin(d), + i = Math.tan(y / 4), + v = (4 / 3) * r * i, + s = (4 / 3) * o * i, + b = [e, t], + j = [e + v * h, t - s * g], + _ = [a + v * n, l - s * f], + x = [a, l]; + if (((j[0] = 2 * b[0] - j[0]), (j[1] = 2 * b[1] - j[1]), u)) + return [j, _, x].concat(m); + for ( + var w = [], + S = 0, + T = (m = [j, _, x].concat(m).join().split(",")).length; + S < T; + S++ + ) + w[S] = S % 2 ? c(m[S - 1], m[S], p).y : c(m[S], m[S + 1], p).x; + return w; + } + function S(e, t) { + for (var r = [], o = 0, n = e.length; o < n - 2 * !t; o += 2) { + var s = [ + { x: +e[o - 2], y: +e[o - 1] }, + { x: +e[o], y: +e[o + 1] }, + { x: +e[o + 2], y: +e[o + 3] }, + { x: +e[o + 4], y: +e[o + 5] }, + ]; + t + ? o + ? n - 4 === o + ? (s[3] = { x: +e[0], y: +e[1] }) + : n - 2 === o && + ((s[2] = { x: +e[0], y: +e[1] }), + (s[3] = { x: +e[2], y: +e[3] })) + : (s[0] = { x: +e[n - 2], y: +e[n - 1] }) + : n - 4 === o + ? (s[3] = s[2]) + : o || (s[0] = { x: +e[o], y: +e[o + 1] }), + r.push([ + "C", + (-s[0].x + 6 * s[1].x + s[2].x) / 6, + (-s[0].y + 6 * s[1].y + s[2].y) / 6, + (s[1].x + 6 * s[2].x - s[3].x) / 6, + (s[1].y + 6 * s[2].y - s[3].y) / 6, + s[2].x, + s[2].y, + ]); + } + return r; + } + function T(e, t, r, o) { + return [e, t, r, o, r, o]; + } + function E(e, t, r, o, n, s) { + return [ + (1 / 3) * e + (2 / 3) * r, + (1 / 3) * t + (2 / 3) * o, + (1 / 3) * n + (2 / 3) * r, + (1 / 3) * s + (2 / 3) * o, + n, + s, + ]; + } + function f(e, t, r, o, n, s, i, a, l) { + for ( + var u = (l = 1 < (l = null == l ? 1 : l) ? 1 : l < 0 ? 0 : l) / 2, + c = [ + -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, + 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, + ], + d = 0, + h = [ + 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, + 0.1601, 0.1069, 0.1069, 0.0472, 0.0472, + ], + f = 0; + f < 12; + f++ + ) { + var p = u * c[f] + u, + m = y(p, e, r, n, i), + p = y(p, t, o, s, a); + d += h[f] * Math.sqrt(m * m + p * p); + } + return u * d; + } + function y(e, t, r, o, n) { + return ( + e * + (e * (-3 * t + 9 * r - 9 * o + 3 * n) + + 6 * t - + 12 * r + + 6 * o) - + 3 * t + + 3 * r + ); + } + n.default.Font = (function () { + function t(e) { + if (!(this instanceof t)) + throw new TypeError("Cannot call a class as a function"); + (this.parent = e), (this.cache = {}), (this.font = void 0); + } + var e, r, o; + return ( + (e = t), + (r = [ + { + key: "textBounds", + value: function (e) { + var t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : 0, + r = + 2 < arguments.length && void 0 !== arguments[2] + ? arguments[2] + : 0, + o = 3 < arguments.length ? arguments[3] : void 0, + n = 4 < arguments.length ? arguments[4] : void 0, + s = (n && n.renderer && n.renderer._pInst) || this.parent, + i = s._renderer.drawingContext, + o = + (i.textAlign || v.LEFT, + i.textBaseline || v.BASELINE, + o || s._renderer._textSize); + if (!g) { + for ( + var a = [], + l = [], + u = [], + c = ((u[0] = []), []), + d = this._scale(o), + h = s._renderer.textLeading(), + f = 0, + p = + (this.font.forEachGlyph( + e, + t, + r, + o, + n, + function (e, t, r, o) { + var n = e.getMetrics(); + 0 === e.index || 10 === e.index + ? (u[(f += 1)] = []) + : (u[f].push(t + n.xMin * d), + u[f].push(t + n.xMax * d), + c.push(r + f * h + -n.yMin * d), + c.push(r + f * h + -n.yMax * d)); + }, + ), + 0 < u[f].length && + ((a[f] = Math.min.apply(null, u[f])), + (l[f] = Math.max.apply(null, u[f]))), + 0), + m = 0; + m <= f; + m++ + ) { + (a[m] = Math.min.apply(null, u[m])), + (l[m] = Math.max.apply(null, u[m])); + var y = l[m] - a[m]; + p < y && (p = y); + } + var i = Math.min.apply(null, a), + g = { + x: i, + y: (r = Math.min.apply(null, c)), + h: Math.max.apply(null, c) - r, + w: p, + advance: i - t, + }, + o = this._handleAlignment( + s._renderer, + e, + g.x, + g.y, + g.w + g.advance, + ); + (g.x = o.x), (g.y = o.y); + } + return g; + }, + }, + { + key: "textToPoints", + value: function (e, t, r, o, n) { + var s = t, + i = [], + a = e.split(/\r?\n|\r|\n/g); + o = o || this.parent._renderer._textSize; + for (var l, u, c, d = 0; d < a.length; d++) { + var h = 0; + t = s; + for ( + var f = (f = a[d]).replace("\t", " "), + p = this._getGlyphs(f), + m = 0; + m < p.length; + m++ + ) { + if ( + ((u = f), + !( + ((c = p)[(l = m)].name && "space" === c[l].name) || + (u.length === c.length && " " === u[l]) + )) + ) + for ( + var y = (function (e) { + for (var t, r = [], o = 0; o < e.length; o++) + "M" === e[o].type && + (t && r.push(t), (t = [])), + t.push( + (function (e) { + var t = [e.type]; + "M" === e.type || "L" === e.type + ? t.push(e.x, e.y) + : "C" === e.type + ? t.push( + e.x1, + e.y1, + e.x2, + e.y2, + e.x, + e.y, + ) + : "Q" === e.type && + t.push(e.x1, e.y1, e.x, e.y); + return t; + })(e[o]), + ); + return r.push(t), r; + })(p[m].getPath(t, r, o).commands), + g = 0; + g < y.length; + g++ + ) + for ( + var v = (function (e, t) { + for ( + var t = (function (e, t) { + if ("object" !== j(e)) e = t; + else + for (var r in t) + void 0 === e[r] && (e[r] = t[r]); + return e; + })(t, { + sampleFactor: 0.1, + simplifyThreshold: 0, + }), + r = w(e, 0, 1), + o = r / (r * t.sampleFactor), + n = [], + s = 0; + s < r; + s += o + ) + n.push(w(e, s)); + t.simplifyThreshold && + !(function (e) { + for ( + var t = + 1 < arguments.length && + void 0 !== arguments[1] + ? arguments[1] + : 0, + r = 0, + o = e.length - 1; + 3 < e.length && 0 <= o; + --o + ) + x( + _(e, o - 1), + _(e, o), + _(e, o + 1), + t, + ) && (e.splice(o % e.length, 1), r++); + })(n, t.simplifyThreshold); + return n; + })(y[g], n), + b = 0; + b < v.length; + b++ + ) + (v[b].x += h), i.push(v[b]); + h += p[m].advanceWidth * this._scale(o); + } + r += this.parent._renderer._textLeading; + } + return i; + }, + }, + { + key: "_getGlyphs", + value: function (e) { + return this.font.stringToGlyphs(e); + }, + }, + { + key: "_getPath", + value: function (e, t, r, o) { + var n = ( + (o && o.renderer && o.renderer._pInst) || + this.parent + )._renderer, + t = this._handleAlignment(n, e, t, r); + return this.font.getPath(e, t.x, t.y, n._textSize, o); + }, + }, + { + key: "_getPathData", + value: function (e, t, r, o) { + var n = 3; + return ( + "string" == typeof e && 2 < arguments.length + ? (e = this._getPath(e, t, r, o)) + : "object" === j(t) && (o = t), + o && "number" == typeof o.decimals && (n = o.decimals), + e.toPathData(n) + ); + }, + }, + { + key: "_getSVG", + value: function (e, t, r, o) { + var n = 3; + return ( + "string" == typeof e && 2 < arguments.length + ? (e = this._getPath(e, t, r, o)) + : "object" === j(t) && (o = t), + o && + ("number" == typeof o.decimals && (n = o.decimals), + "number" == typeof o.strokeWidth && + (e.strokeWidth = o.strokeWidth), + void 0 !== o.fill && (e.fill = o.fill), + void 0 !== o.stroke && (e.stroke = o.stroke)), + e.toSVG(n) + ); + }, + }, + { + key: "_renderPath", + value: function (e, t, r, o) { + var n = (o && o.renderer) || this.parent._renderer, + s = n.drawingContext, + e = ( + "object" === j(e) && e.commands + ? e + : this._getPath(e, t, r, o) + ).commands, + i = (s.beginPath(), !0), + t = !1, + r = void 0; + try { + for ( + var a, l = e[Symbol.iterator](); + !(i = (a = l.next()).done); + i = !0 + ) { + var u = a.value; + "M" === u.type + ? s.moveTo(u.x, u.y) + : "L" === u.type + ? s.lineTo(u.x, u.y) + : "C" === u.type + ? s.bezierCurveTo( + u.x1, + u.y1, + u.x2, + u.y2, + u.x, + u.y, + ) + : "Q" === u.type + ? s.quadraticCurveTo(u.x1, u.y1, u.x, u.y) + : "Z" === u.type && s.closePath(); + } + } catch (e) { + (t = !0), (r = e); + } finally { + try { + i || null == l.return || l.return(); + } finally { + if (t) throw r; + } + } + return ( + n._doStroke && n._strokeSet && !n._clipping && s.stroke(), + n._doFill && + !n._clipping && + (n._fillSet || n._setFill(v._DEFAULT_TEXT_FILL), + s.fill()), + this + ); + }, + }, + { + key: "_textWidth", + value: function (e, t) { + return this.font.getAdvanceWidth(e, t); + }, + }, + { + key: "_textAscent", + value: function (e) { + return this.font.ascender * this._scale(e); + }, + }, + { + key: "_textDescent", + value: function (e) { + return -this.font.descender * this._scale(e); + }, + }, + { + key: "_scale", + value: function (e) { + return ( + (1 / this.font.unitsPerEm) * + (e || this.parent._renderer._textSize) + ); + }, + }, + { + key: "_handleAlignment", + value: function (e, t, r, o, n) { + var s = e._textSize; + switch ( + (void 0 === n && (n = this._textWidth(t, s)), + e._textAlign) + ) { + case v.CENTER: + r -= n / 2; + break; + case v.RIGHT: + r -= n; + } + switch (e._textBaseline) { + case v.TOP: + o += this._textAscent(s); + break; + case v.CENTER: + o += this._textAscent(s) / 2; + break; + case v.BOTTOM: + o -= this._textDescent(s); + } + return { x: r, y: o }; + }, + }, + ]) && s(e.prototype, r), + o && s(e, o), + t + ); + })(); + e = n.default; + r.default = e; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.number.to-fixed": 175, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 314: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.array-buffer.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.array-buffer.constructor"), + e("core-js/modules/es.object.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (e.default.prototype.append = function (e, t) { + return e.push(t), e; + }), + (e.default.prototype.arrayCopy = function (e, t, r, o, n) { + var s, i; + (e = + void 0 !== n + ? ((i = Math.min(n, e.length)), (s = o), e.slice(t, i + t)) + : ((i = + void 0 !== r + ? ((i = r), Math.min(i, e.length)) + : e.length), + (r = t), + e.slice((s = 0), i))), + Array.prototype.splice.apply(r, [s, i].concat(e)); + }), + (e.default.prototype.concat = function (e, t) { + return e.concat(t); + }), + (e.default.prototype.reverse = function (e) { + return e.reverse(); + }), + (e.default.prototype.shorten = function (e) { + return e.pop(), e; + }), + (e.default.prototype.shuffle = function (e, t) { + for ( + var r, + o, + n = + ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(e), + s = (e = t || n ? e : e.slice()).length; + 1 < s; + + ) + (r = (this.random(0, 1) * s) | 0), + (o = e[--s]), + (e[s] = e[r]), + (e[r] = o); + return e; + }), + (e.default.prototype.sort = function (e, t) { + var r = t ? e.slice(0, Math.min(t, e.length)) : e, + t = t ? e.slice(Math.min(t, e.length)) : []; + return (r = + "string" == typeof r[0] + ? r.sort() + : r.sort(function (e, t) { + return e - t; + })).concat(t); + }), + (e.default.prototype.splice = function (e, t, r) { + return Array.prototype.splice.apply(e, [r, 0].concat(t)), e; + }), + (e.default.prototype.subset = function (e, t, r) { + return void 0 !== r ? e.slice(t, t + r) : e.slice(t, e.length); + }); + e = e.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array-buffer.constructor": 150, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.object.to-string": 182, + }, + ], + 315: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.map"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.repeat"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.number.constructor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.repeat"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (o.default.prototype.float = function (e) { + return e instanceof Array ? e.map(parseFloat) : parseFloat(e); + }), + (o.default.prototype.int = function (e) { + var t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : 10; + return e === 1 / 0 || "Infinity" === e + ? 1 / 0 + : e === -1 / 0 || "-Infinity" === e + ? -1 / 0 + : "string" == typeof e + ? parseInt(e, t) + : "number" == typeof e + ? 0 | e + : "boolean" == typeof e + ? e + ? 1 + : 0 + : e instanceof Array + ? e.map(function (e) { + return o.default.prototype.int(e, t); + }) + : void 0; + }), + (o.default.prototype.str = function (e) { + return e instanceof Array + ? e.map(o.default.prototype.str) + : String(e); + }), + (o.default.prototype.boolean = function (e) { + return "number" == typeof e + ? 0 !== e + : "string" == typeof e + ? "true" === e.toLowerCase() + : "boolean" == typeof e + ? e + : e instanceof Array + ? e.map(o.default.prototype.boolean) + : void 0; + }), + (o.default.prototype.byte = function (e) { + e = o.default.prototype.int(e, 10); + return "number" == typeof e + ? ((e + 128) % 256) - 128 + : e instanceof Array + ? e.map(o.default.prototype.byte) + : void 0; + }), + (o.default.prototype.char = function (e) { + return "number" != typeof e || isNaN(e) + ? e instanceof Array + ? e.map(o.default.prototype.char) + : "string" == typeof e + ? o.default.prototype.char(parseInt(e, 10)) + : void 0 + : String.fromCharCode(e); + }), + (o.default.prototype.unchar = function (e) { + return "string" == typeof e && 1 === e.length + ? e.charCodeAt(0) + : e instanceof Array + ? e.map(o.default.prototype.unchar) + : void 0; + }), + (o.default.prototype.hex = function (e, t) { + if (((t = null == t ? 8 : t), e instanceof Array)) + return e.map(function (e) { + return o.default.prototype.hex(e, t); + }); + if (e === 1 / 0 || e === -1 / 0) + return (e === 1 / 0 ? "F" : "0").repeat(t); + if ("number" == typeof e) { + e < 0 && (e = 4294967295 + e + 1); + for ( + var r = Number(e).toString(16).toUpperCase(); + r.length < t; + + ) + r = "0".concat(r); + return (r = + r.length >= t ? r.substring(r.length - t, r.length) : r); + } + }), + (o.default.prototype.unhex = function (e) { + return e instanceof Array + ? e.map(o.default.prototype.unhex) + : parseInt("0x".concat(e), 16); + }); + e = o.default; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.number.constructor": 173, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.repeat": 195, + }, + ], + 316: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.pad-start"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.filter"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.constructor"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.pad-start"), + e("core-js/modules/es.string.replace"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = (u = e("../core/main")) && u.__esModule ? u : { default: u }; + function i(e, t) { + return ( + (function (e) { + if (Array.isArray(e)) return e; + })(e) || + (function (e, t) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) { + var r = [], + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = e[Symbol.iterator](); + !(o = (i = a.next()).done) && + (r.push(i.value), !t || r.length !== t); + o = !0 + ); + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + return r; + } + })(e, t) || + (function () { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance", + ); + })() + ); + } + function o(e, t, r) { + var o = i(e.toString().split("."), 2), + n = o[0], + o = o[1]; + return void 0 === r + ? ((n = n.padStart(t, "0")), o ? n + "." + o : n) + : ((n = (e = i(e.toFixed(r).toString().split("."), 2))[0]), + (o = e[1]), + (n = n.padStart(t, "0")), + void 0 === o ? n : n + "." + o); + } + function n(e, t) { + var r = (e = e.toString()).indexOf("."), + o = -1 !== r ? e.substring(r) : "", + e = (e = -1 !== r ? e.substring(0, r) : e) + .toString() + .replace(/\B(?=(\d{3})+(?!\d))/g, ","); + if (0 === t) o = ""; + else if (void 0 !== t) + if (t > o.length) + for ( + var n = t - (o += -1 === r ? "." : "").length + 1, s = 0; + s < n; + s++ + ) + o += "0"; + else o = o.substring(0, t + 1); + return e + o; + } + function a(e) { + return 0 < parseFloat(e) ? "+".concat(e.toString()) : e.toString(); + } + function l(e) { + return 0 <= parseFloat(e) ? " ".concat(e.toString()) : e.toString(); + } + e("../core/friendly_errors/validate_params"), + e("../core/friendly_errors/file_errors"), + e("../core/friendly_errors/fes_core"), + (s.default.prototype.join = function (e, t) { + return ( + s.default._validateParameters("join", arguments), e.join(t) + ); + }), + (s.default.prototype.match = function (e, t) { + return ( + s.default._validateParameters("match", arguments), e.match(t) + ); + }), + (s.default.prototype.matchAll = function (e, t) { + s.default._validateParameters("matchAll", arguments); + for ( + var r = new RegExp(t, "g"), o = r.exec(e), n = []; + null !== o; + + ) + n.push(o), (o = r.exec(e)); + return n; + }), + (s.default.prototype.nf = function (e, t, r) { + return ( + s.default._validateParameters("nf", arguments), + e instanceof Array + ? e.map(function (e) { + return o(e, t, r); + }) + : "[object Arguments]" === Object.prototype.toString.call(e) + ? 3 === e.length + ? this.nf(e[0], e[1], e[2]) + : 2 === e.length + ? this.nf(e[0], e[1]) + : this.nf(e[0]) + : o(e, t, r) + ); + }), + (s.default.prototype.nfc = function (e, t) { + return ( + s.default._validateParameters("nfc", arguments), + e instanceof Array + ? e.map(function (e) { + return n(e, t); + }) + : n(e, t) + ); + }), + (s.default.prototype.nfp = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + s.default._validateParameters("nfp", t); + var o = s.default.prototype.nf.apply(this, t); + return o instanceof Array ? o.map(a) : a(o); + }), + (s.default.prototype.nfs = function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + s.default._validateParameters("nfs", t); + var o = s.default.prototype.nf.apply(this, t); + return o instanceof Array ? o.map(l) : l(o); + }), + (s.default.prototype.split = function (e, t) { + return ( + s.default._validateParameters("split", arguments), e.split(t) + ); + }), + (s.default.prototype.splitTokens = function (e, t) { + var r, o; + return ( + s.default._validateParameters("splitTokens", arguments), + (o = + void 0 !== t + ? ((o = /\]/g.exec((t = t))), + (r = /\[/g.exec(t)) && o + ? ((t = t.slice(0, o.index) + t.slice(o.index + 1)), + (r = /\[/g.exec(t)), + (t = t.slice(0, r.index) + t.slice(r.index + 1)), + new RegExp("[\\[".concat(t, "\\]]"), "g")) + : o + ? ((t = t.slice(0, o.index) + t.slice(o.index + 1)), + new RegExp("[".concat(t, "\\]]"), "g")) + : r + ? ((t = t.slice(0, r.index) + t.slice(r.index + 1)), + new RegExp("[".concat(t, "\\[]"), "g")) + : new RegExp("[".concat(t, "]"), "g")) + : /\s/g), + e.split(o).filter(function (e) { + return e; + }) + ); + }), + (s.default.prototype.trim = function (e) { + return ( + s.default._validateParameters("trim", arguments), + e instanceof Array ? e.map(this.trim) : e.trim() + ); + }); + var u = s.default; + r.default = u; + }, + { + "../core/friendly_errors/fes_core": 266, + "../core/friendly_errors/file_errors": 267, + "../core/friendly_errors/validate_params": 270, + "../core/main": 275, + "core-js/modules/es.array.filter": 155, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.number.to-fixed": 175, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.constructor": 186, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.match": 193, + "core-js/modules/es.string.pad-start": 194, + "core-js/modules/es.string.replace": 196, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.trim": 201, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 317: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (e.default.prototype.day = function () { + return new Date().getDate(); + }), + (e.default.prototype.hour = function () { + return new Date().getHours(); + }), + (e.default.prototype.minute = function () { + return new Date().getMinutes(); + }), + (e.default.prototype.millis = function () { + return -1 === this._millisStart + ? 0 + : window.performance.now() - this._millisStart; + }), + (e.default.prototype.month = function () { + return new Date().getMonth() + 1; + }), + (e.default.prototype.second = function () { + return new Date().getSeconds(); + }), + (e.default.prototype.year = function () { + return new Date().getFullYear(); + }); + e = e.default; + r.default = e; + }, + { "../core/main": 275 }, + ], + 318: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.math.sign"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.math.sign"), + e("core-js/modules/es.number.to-fixed"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var S = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + _ = + (e("./p5.Geometry"), + (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants"))); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + (S.default.prototype.beginGeometry = function () { + return this._renderer.beginGeometry(); + }), + (S.default.prototype.endGeometry = function () { + return this._renderer.endGeometry(); + }), + (S.default.prototype.buildGeometry = function (e) { + return this._renderer.buildGeometry(e); + }), + (S.default.prototype.freeGeometry = function (e) { + this._renderer._freeBuffers(e.gid); + }), + (S.default.prototype.plane = function (e, t, r, o) { + this._assert3d("plane"), + S.default._validateParameters("plane", arguments), + void 0 === e && (e = 50), + void 0 === t && (t = e), + void 0 === o && (o = 1); + var n, + s = "plane|".concat((r = void 0 === r ? 1 : r), "|").concat(o); + return ( + this._renderer.geometryInHash(s) || + ((n = new S.default.Geometry(r, o, function () { + for (var e, t, r = 0; r <= this.detailY; r++) + for ( + var o = r / this.detailY, n = 0; + n <= this.detailX; + n++ + ) + (e = n / this.detailX), + (t = new S.default.Vector(e - 0.5, o - 0.5, 0)), + this.vertices.push(t), + this.uvs.push(e, o); + })) + .computeFaces() + .computeNormals(), + r <= 1 && o <= 1 + ? n._makeTriangleEdges()._edgesToVertices() + : this._renderer._doStroke && + console.log( + "Cannot draw stroke on plane objects with more than 1 detailX or 1 detailY", + ), + this._renderer.createBuffers(s, n)), + this._renderer.drawBuffersScaled(s, e, t, 1), + this + ); + }), + (S.default.prototype.box = function (e, t, r, o, n) { + this._assert3d("box"), + S.default._validateParameters("box", arguments), + void 0 === e && (e = 50), + void 0 === t && (t = e), + void 0 === r && (r = t); + var s, + i = + this._renderer.attributes && + this._renderer.attributes.perPixelLighting, + i = + (void 0 === n && (n = i ? 1 : 4), + "box|" + .concat((o = void 0 === o ? (i ? 1 : 4) : o), "|") + .concat(n)); + return ( + this._renderer.geometryInHash(i) || + ((s = new S.default.Geometry(o, n, function () { + var n = this; + (this.edges = [ + [0, 1], + [1, 3], + [3, 2], + [6, 7], + [8, 9], + [9, 11], + [14, 15], + [16, 17], + [17, 19], + [18, 19], + [20, 21], + [22, 23], + ]), + [ + [0, 4, 2, 6], + [1, 3, 5, 7], + [0, 1, 4, 5], + [2, 6, 3, 7], + [0, 2, 1, 3], + [4, 5, 6, 7], + ].forEach(function (e, t) { + for (var t = 4 * t, r = 0; r < 4; r++) { + var o = e[r], + o = new S.default.Vector( + (2 * (1 & o) - 1) / 2, + ((2 & o) - 1) / 2, + ((4 & o) / 2 - 1) / 2, + ); + n.vertices.push(o), n.uvs.push(1 & r, (2 & r) / 2); + } + n.faces.push([t, 1 + t, 2 + t]), + n.faces.push([2 + t, 1 + t, 3 + t]); + }); + })).computeNormals(), + o <= 4 && n <= 4 + ? s._edgesToVertices() + : this._renderer._doStroke && + console.log( + "Cannot draw stroke on box objects with more than 4 detailX or 4 detailY", + ), + this._renderer.createBuffers(i, s)), + this._renderer.drawBuffersScaled(i, e, t, r), + this + ); + }), + (S.default.prototype.sphere = function (e, t, r) { + return ( + this._assert3d("sphere"), + S.default._validateParameters("sphere", arguments), + this.ellipsoid( + (e = void 0 === e ? 50 : e), + e, + e, + (t = void 0 === t ? 24 : t), + (r = void 0 === r ? 16 : r), + ), + this + ); + }); + function l(e, t, r, o, n, s, i) { + (e = e <= 0 ? 1 : e), + (t = t < 0 ? 0 : t), + (r = r <= 0 ? e : r), + (o = o < 3 ? 3 : o); + for ( + var a, + l, + u = (s = void 0 === s || s) ? -2 : 0, + c = + (n = n < 1 ? 1 : n) + + ((i = void 0 === i ? 0 !== t : i) ? 2 : 0), + d = Math.atan2(e - t, r), + h = Math.sin(d), + f = Math.cos(d), + p = u; + p <= c; + ++p + ) { + var m = p / n, + y = r * m, + g = void 0, + g = + p < 0 + ? ((m = y = 0), e) + : n < p + ? ((y = r), (m = 1), t) + : e + (t - e) * m; + for ( + (-2 !== p && p !== n + 2) || (g = 0), y -= r / 2, a = 0; + a < o; + ++a + ) { + var v = a / (o - 1), + b = 2 * Math.PI * v, + j = Math.sin(b), + b = Math.cos(b), + _ = + (this.vertices.push(new S.default.Vector(j * g, y, b * g)), + void 0), + _ = + p < 0 + ? new S.default.Vector(0, -1, 0) + : n < p && t + ? new S.default.Vector(0, 1, 0) + : new S.default.Vector(j * f, h, b * f); + this.vertexNormals.push(_), this.uvs.push(v, m); + } + } + var x = 0; + if (s) { + for (l = 0; l < o; ++l) + this.faces.push([x + l, x + o + ((l + 1) % o), x + o + l]); + x += 2 * o; + } + for (p = 0; p < n; ++p) { + for (a = 0; a < o; ++a) { + var w = (a + 1) % o; + this.faces.push([x + a, x + w, x + o + w]), + this.faces.push([x + a, x + o + w, x + o + a]); + } + x += o; + } + if (i) + for (x += o, a = 0; a < o; ++a) + this.faces.push([x + a, x + ((a + 1) % o), x + o]); + } + (S.default.prototype.cylinder = function (e, t, r, o, n, s) { + this._assert3d("cylinder"), + S.default._validateParameters("cylinder", arguments), + void 0 === e && (e = 50), + void 0 === t && (t = e), + void 0 === o && (o = 1), + void 0 === s && (s = !0), + void 0 === n && (n = !0); + var i, + a = "cylinder|" + .concat((r = void 0 === r ? 24 : r), "|") + .concat(o, "|") + .concat(n, "|") + .concat(s); + return ( + this._renderer.geometryInHash(a) || + ((i = new S.default.Geometry(r, o)), + l.call(i, 1, 1, 1, r, o, n, s), + r <= 24 && o <= 16 + ? i._makeTriangleEdges()._edgesToVertices() + : this._renderer._doStroke && + console.log( + "Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY", + ), + this._renderer.createBuffers(a, i)), + this._renderer.drawBuffersScaled(a, e, t, e), + this + ); + }), + (S.default.prototype.cone = function (e, t, r, o, n) { + this._assert3d("cone"), + S.default._validateParameters("cone", arguments), + void 0 === e && (e = 50), + void 0 === t && (t = e), + void 0 === o && (o = 1), + void 0 === n && (n = !0); + var s, + i = "cone|" + .concat((r = void 0 === r ? 24 : r), "|") + .concat(o, "|") + .concat(n); + return ( + this._renderer.geometryInHash(i) || + ((s = new S.default.Geometry(r, o)), + l.call(s, 1, 0, 1, r, o, n, !1), + r <= 24 && o <= 16 + ? s._makeTriangleEdges()._edgesToVertices() + : this._renderer._doStroke && + console.log( + "Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY", + ), + this._renderer.createBuffers(i, s)), + this._renderer.drawBuffersScaled(i, e, t, e), + this + ); + }), + (S.default.prototype.ellipsoid = function (e, t, r, o, n) { + this._assert3d("ellipsoid"), + S.default._validateParameters("ellipsoid", arguments), + void 0 === e && (e = 50), + void 0 === t && (t = e), + void 0 === r && (r = e), + void 0 === n && (n = 16); + var s, + i = "ellipsoid|" + .concat((o = void 0 === o ? 24 : o), "|") + .concat(n); + return ( + this._renderer.geometryInHash(i) || + ((s = new S.default.Geometry(o, n, function () { + for (var e = 0; e <= this.detailY; e++) + for ( + var t = e / this.detailY, + r = Math.PI * t - Math.PI / 2, + o = Math.cos(r), + n = Math.sin(r), + s = 0; + s <= this.detailX; + s++ + ) { + var i = s / this.detailX, + a = 2 * Math.PI * i, + l = Math.cos(a), + a = Math.sin(a), + a = new S.default.Vector(o * a, n, o * l); + this.vertices.push(a), + this.vertexNormals.push(a), + this.uvs.push(i, t); + } + })).computeFaces(), + o <= 24 && n <= 24 + ? s._makeTriangleEdges()._edgesToVertices() + : this._renderer._doStroke && + console.log( + "Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY", + ), + this._renderer.createBuffers(i, s)), + this._renderer.drawBuffersScaled(i, e, t, r), + this + ); + }), + (S.default.prototype.torus = function (e, t, r, o) { + if ( + (this._assert3d("torus"), + S.default._validateParameters("torus", arguments), + void 0 === e) + ) + e = 50; + else if (!e) return; + if (void 0 === t) t = 10; + else if (!t) return; + void 0 === r && (r = 24), void 0 === o && (o = 16); + var n, + d = (t / e).toPrecision(4), + t = "torus|".concat(d, "|").concat(r, "|").concat(o); + return ( + this._renderer.geometryInHash(t) || + ((n = new S.default.Geometry(r, o, function () { + for (var e = 0; e <= this.detailY; e++) + for ( + var t = e / this.detailY, + r = 2 * Math.PI * t, + o = Math.cos(r), + n = Math.sin(r), + s = 1 + d * o, + i = 0; + i <= this.detailX; + i++ + ) { + var a = i / this.detailX, + l = 2 * Math.PI * a, + u = Math.cos(l), + l = Math.sin(l), + c = new S.default.Vector(s * u, s * l, d * n), + u = new S.default.Vector(o * u, o * l, n); + this.vertices.push(c), + this.vertexNormals.push(u), + this.uvs.push(a, t); + } + })).computeFaces(), + r <= 24 && o <= 16 + ? n._makeTriangleEdges()._edgesToVertices() + : this._renderer._doStroke && + console.log( + "Cannot draw strokes on torus object with more than 24 detailX or 16 detailY", + ), + this._renderer.createBuffers(t, n)), + this._renderer.drawBuffersScaled(t, e, e, e), + this + ); + }), + (S.default.RendererGL.prototype.point = function (e, t, r) { + var o = []; + return ( + o.push(new S.default.Vector(e, t, (r = void 0 === r ? 0 : r))), + this._drawPoints(o, this.immediateMode.buffers.point), + this + ); + }), + (S.default.RendererGL.prototype.triangle = function (e) { + var t = e[0], + r = e[1], + o = e[2], + n = e[3], + s = e[4], + e = e[5], + i = + (this.geometryInHash("tri") || + ((i = new S.default.Geometry(1, 1, function () { + var e = []; + e.push(new S.default.Vector(0, 0, 0)), + e.push(new S.default.Vector(1, 0, 0)), + e.push(new S.default.Vector(0, 1, 0)), + (this.edges = [ + [0, 1], + [1, 2], + [2, 0], + ]), + (this.vertices = e), + (this.faces = [[0, 1, 2]]), + (this.uvs = [0, 0, 1, 0, 1, 1]); + }))._edgesToVertices(), + i.computeNormals(), + this.createBuffers("tri", i)), + this.uMVMatrix.copy()); + try { + var a = Math.sign( + t * n - o * r + o * e - s * n + s * r - t * e, + ), + l = new S.default.Matrix([ + o - t, + n - r, + 0, + 0, + s - t, + e - r, + 0, + 0, + 0, + 0, + a, + 0, + t, + r, + 0, + 1, + ]).mult(this.uMVMatrix); + (this.uMVMatrix = l), this.drawBuffers("tri"); + } finally { + this.uMVMatrix = i; + } + return this; + }), + (S.default.RendererGL.prototype.ellipse = function (e) { + this.arc(e[0], e[1], e[2], e[3], 0, _.TWO_PI, _.OPEN, e[4]); + }), + (S.default.RendererGL.prototype.arc = function (e) { + var t, + r = arguments[1], + o = arguments[2], + n = arguments[3], + s = arguments[4], + i = arguments[5], + a = arguments[6], + l = arguments[7] || 25, + u = ( + Math.abs(i - s) >= _.TWO_PI + ? "".concat((c = "ellipse"), "|") + : "" + .concat((c = "arc"), "|") + .concat(s, "|") + .concat(i, "|") + .concat(a, "|") + ).concat(l, "|"), + c = + (this.geometryInHash(u) || + ((t = new S.default.Geometry(l, 1, function () { + if (s.toFixed(10) !== i.toFixed(10)) { + (a !== _.PIE && void 0 !== a) || + (this.vertices.push( + new S.default.Vector(0.5, 0.5, 0), + ), + this.uvs.push([0.5, 0.5])); + for (var e = 0; e <= l; e++) { + var t = (i - s) * (e / l) + s, + r = 0.5 + Math.cos(t) / 2, + t = 0.5 + Math.sin(t) / 2; + this.vertices.push(new S.default.Vector(r, t, 0)), + this.uvs.push([r, t]), + e < l - 1 && + (this.faces.push([0, e + 1, e + 2]), + this.edges.push([e + 1, e + 2])); + } + switch (a) { + case _.PIE: + this.faces.push([ + 0, + this.vertices.length - 2, + this.vertices.length - 1, + ]), + this.edges.push([0, 1]), + this.edges.push([ + this.vertices.length - 2, + this.vertices.length - 1, + ]), + this.edges.push([0, this.vertices.length - 1]); + break; + case _.CHORD: + this.edges.push([0, 1]), + this.edges.push([0, this.vertices.length - 1]); + break; + case _.OPEN: + this.edges.push([0, 1]); + break; + default: + this.faces.push([ + 0, + this.vertices.length - 2, + this.vertices.length - 1, + ]), + this.edges.push([ + this.vertices.length - 2, + this.vertices.length - 1, + ]); + } + } + })).computeNormals(), + l <= 50 + ? t._edgesToVertices(t) + : this._doStroke && + console.log( + "Cannot apply a stroke to an ".concat( + c, + " with more than 50 detail", + ), + ), + this.createBuffers(u, t)), + this.uMVMatrix.copy()); + try { + this.uMVMatrix.translate([e, r, 0]), + this.uMVMatrix.scale(o, n, 1), + this.drawBuffers(u); + } finally { + this.uMVMatrix = c; + } + return this; + }), + (S.default.RendererGL.prototype.rect = function (e) { + var t = e[0], + r = e[1], + o = e[2], + n = e[3]; + if (void 0 === e[4]) { + var s = this._pInst._glAttributes.perPixelLighting, + i = e[4] || (s ? 1 : 24), + a = e[5] || (s ? 1 : 16), + s = "rect|".concat(i, "|").concat(a), + l = + (this.geometryInHash(s) || + ((l = new S.default.Geometry(i, a, function () { + for (var e = 0; e <= this.detailY; e++) + for ( + var t = e / this.detailY, r = 0; + r <= this.detailX; + r++ + ) { + var o = r / this.detailX, + n = new S.default.Vector(o, t, 0); + this.vertices.push(n), this.uvs.push(o, t); + } + 0 < i && + 0 < a && + (this.edges = [ + [0, i], + [i, (i + 1) * (a + 1) - 1], + [(i + 1) * (a + 1) - 1, (i + 1) * a], + [(i + 1) * a, 0], + ]); + })) + .computeFaces() + .computeNormals() + ._edgesToVertices(), + this.createBuffers(s, l)), + this.uMVMatrix.copy()); + try { + this.uMVMatrix.translate([t, r, 0]), + this.uMVMatrix.scale(o, n, 1), + this.drawBuffers(s); + } finally { + this.uMVMatrix = l; + } + } else { + var s = e[4], + l = void 0 === e[5] ? s : e[5], + u = void 0 === e[6] ? l : e[6], + e = void 0 === e[7] ? u : e[7], + c = o, + d = n, + h = + ((c += t) < t && ((h = t), (t = c), (c = h)), + (d += r) < r && ((h = r), (r = d), (d = h)), + Math.min((c - t) / 2, (d - r) / 2)), + f = + (h < s && (s = h), + h < l && (l = h), + h < u && (u = h), + h < e && (e = h), + t), + p = r, + h = c, + t = d, + m = + (this.beginShape(), + 0 !== l + ? (this.vertex(h - l, p), + this.quadraticVertex(h, p, h, p + l)) + : this.vertex(h, p), + 0 !== u + ? (this.vertex(h, t - u), + this.quadraticVertex(h, t, h - u, t)) + : this.vertex(h, t), + 0 !== e + ? (this.vertex(f + e, t), + this.quadraticVertex(f, t, f, t - e)) + : this.vertex(f, t), + 0 !== s + ? (this.vertex(f, p + s), + this.quadraticVertex(f, p, f + s, p)) + : this.vertex(f, p), + !(this.immediateMode.geometry.uvs.length = 0)), + r = !1, + c = void 0; + try { + for ( + var y, + g = + this.immediateMode.geometry.vertices[Symbol.iterator](); + !(m = (y = g.next()).done); + m = !0 + ) { + var v = y.value, + b = (v.x - f) / o, + j = (v.y - p) / n; + this.immediateMode.geometry.uvs.push(b, j); + } + } catch (e) { + (r = !0), (c = e); + } finally { + try { + m || null == g.return || g.return(); + } finally { + if (r) throw c; + } + } + this.endShape(_.CLOSE); + } + return this; + }), + (S.default.RendererGL.prototype.quad = function ( + i, + a, + l, + u, + c, + d, + h, + f, + p, + m, + y, + g, + e, + t, + ) { + void 0 === e && (e = 2), void 0 === t && (t = 2); + var r = "quad|" + .concat(i, "|") + .concat(a, "|") + .concat(l, "|") + .concat(u, "|") + .concat(c, "|") + .concat(d, "|") + .concat(h, "|") + .concat(f, "|") + .concat(p, "|") + .concat(m, "|") + .concat(y, "|") + .concat(g, "|") + .concat(e, "|") + .concat(t); + if (!this.geometryInHash(r)) { + var o = new S.default.Geometry(e, t, function () { + for ( + var e = 1 / (this.detailX - 1), + t = 1 / (this.detailY - 1), + r = 0; + r < this.detailY; + r++ + ) + for (var o = 0; o < this.detailX; o++) { + var n = o * e, + s = r * t; + this.vertices.push( + new S.default.Vector( + (1 - n) * ((1 - s) * i + s * m) + + n * ((1 - s) * u + s * h), + (1 - n) * ((1 - s) * a + s * y) + + n * ((1 - s) * c + s * f), + (1 - n) * ((1 - s) * l + s * g) + + n * ((1 - s) * d + s * p), + ), + ), + this.uvs.push([n, s]); + } + }); + o.faces = []; + for (var n = 0; n < t - 1; n++) + for (var s = 0; s < e - 1; s++) { + var v = s + n * e, + b = s + 1 + (n + 1) * e, + j = s + (n + 1) * e; + o.faces.push([v, s + 1 + n * e, b]), + o.faces.push([v, b, j]); + } + o.computeNormals(); + for ( + var _ = [(o.edges.length = 0), 2, 3, 1], x = 0; + x < _.length; + x++ + ) + o.edges.push([_[x], _[(x + 1) % _.length]]); + o._edgesToVertices(), this.createBuffers(r, o); + } + return this.drawBuffers(r), this; + }), + (S.default.RendererGL.prototype.bezier = function ( + e, + t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + d, + ) { + 8 === arguments.length && + ((c = a), + (u = i), + (a = s), + (i = n), + (n = o), + (o = r), + (r = s = l = d = 0)); + var h = this._pInst._bezierDetail || 20; + this.beginShape(); + for (var f = 0; f <= h; f++) { + var p = Math.pow(1 - f / h, 3), + m = (f / h) * 3 * Math.pow(1 - f / h, 2), + y = 3 * Math.pow(f / h, 2) * (1 - f / h), + g = Math.pow(f / h, 3); + this.vertex( + e * p + o * m + i * y + u * g, + t * p + n * m + a * y + c * g, + r * p + s * m + l * y + d * g, + ); + } + return this.endShape(), this; + }), + (S.default.RendererGL.prototype.curve = function ( + e, + t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + d, + ) { + 8 === arguments.length && + ((u = i), + (c = a), + (i = n), + (a = o), + (n = o = r), + (r = s = l = d = 0)); + var h = this._pInst._curveDetail; + this.beginShape(); + for (var f = 0; f <= h; f++) { + var p = 0.5 * Math.pow(f / h, 3), + m = 0.5 * Math.pow(f / h, 2), + y = (f / h) * 0.5; + this.vertex( + p * (3 * o - e - 3 * i + u) + + m * (2 * e - 5 * o + 4 * i - u) + + y * (-e + i) + + 2 * o * 0.5, + p * (3 * n - t - 3 * a + c) + + m * (2 * t - 5 * n + 4 * a - c) + + y * (-t + a) + + 2 * n * 0.5, + p * (3 * s - r - 3 * l + d) + + m * (2 * r - 5 * s + 4 * l - d) + + y * (-r + l) + + 2 * s * 0.5, + ); + } + return this.endShape(), this; + }), + (S.default.RendererGL.prototype.line = function () { + return ( + 6 === arguments.length + ? (this.beginShape(_.LINES), + this.vertex( + arguments.length <= 0 ? void 0 : arguments[0], + arguments.length <= 1 ? void 0 : arguments[1], + arguments.length <= 2 ? void 0 : arguments[2], + ), + this.vertex( + arguments.length <= 3 ? void 0 : arguments[3], + arguments.length <= 4 ? void 0 : arguments[4], + arguments.length <= 5 ? void 0 : arguments[5], + ), + this.endShape()) + : 4 === arguments.length && + (this.beginShape(_.LINES), + this.vertex( + arguments.length <= 0 ? void 0 : arguments[0], + arguments.length <= 1 ? void 0 : arguments[1], + 0, + ), + this.vertex( + arguments.length <= 2 ? void 0 : arguments[2], + arguments.length <= 3 ? void 0 : arguments[3], + 0, + ), + this.endShape()), + this + ); + }), + (S.default.RendererGL.prototype.bezierVertex = function () { + if (0 === this.immediateMode._bezierVertex.length) + throw Error( + "vertex() must be used once before calling bezierVertex()", + ); + var e, + t, + r, + o, + n, + s, + i = [], + a = [], + l = arguments.length; + if ( + 0 === this._lookUpTableBezier.length || + this._lutBezierDetail !== this._pInst._curveDetail + ) { + (this._lookUpTableBezier = []), + (this._lutBezierDetail = this._pInst._curveDetail); + for ( + var u = 1 / this._lutBezierDetail, c = 0, d = 1, h = 0; + c < 1; + + ) { + if ( + ((s = parseFloat(c.toFixed(6))), + (this._lookUpTableBezier[h] = this._bezierCoefficients(s)), + d.toFixed(6) === u.toFixed(6)) + ) { + (s = parseFloat(d.toFixed(6)) + parseFloat(c.toFixed(6))), + ++h, + (this._lookUpTableBezier[h] = + this._bezierCoefficients(s)); + break; + } + (c += u), (d -= u), ++h; + } + } + for ( + var f = this._lookUpTableBezier.length, p = [], m = 0; + m < 4; + m++ + ) + p.push([]); + (p[0] = this.immediateMode.geometry.vertexColors.slice(-4)), + (p[3] = this.curFillColor.slice()); + var y = []; + for (m = 0; m < 4; m++) y.push([]); + if ( + ((y[0] = + this.immediateMode.geometry.vertexStrokeColors.slice(-4)), + (y[3] = this.curStrokeColor.slice()), + 6 === l) + ) { + this.isBezier = !0; + var i = [ + this.immediateMode._bezierVertex[0], + arguments.length <= 0 ? void 0 : arguments[0], + arguments.length <= 2 ? void 0 : arguments[2], + arguments.length <= 4 ? void 0 : arguments[4], + ], + a = [ + this.immediateMode._bezierVertex[1], + arguments.length <= 1 ? void 0 : arguments[1], + arguments.length <= 3 ? void 0 : arguments[3], + arguments.length <= 5 ? void 0 : arguments[5], + ], + g = Math.hypot(i[0] - i[1], a[0] - a[1]), + v = Math.hypot(i[1] - i[2], a[1] - a[2]), + b = Math.hypot(i[2] - i[3], a[2] - a[3]), + v = g + v + b; + for (g /= v, b /= v, n = 0; n < 4; n++) + p[1].push(p[0][n] * (1 - g) + p[3][n] * g), + p[2].push(p[0][n] * b + p[3][n] * (1 - b)), + y[1].push(y[0][n] * (1 - g) + y[3][n] * g), + y[2].push(y[0][n] * b + y[3][n] * (1 - b)); + for (o = 0; o < f; o++) { + for ( + this.curFillColor = [0, 0, 0, 0], + this.curStrokeColor = [0, 0, 0, 0], + m = e = t = 0; + m < 4; + m++ + ) { + for (n = 0; n < 4; n++) + (this.curFillColor[n] += + this._lookUpTableBezier[o][m] * p[m][n]), + (this.curStrokeColor[n] += + this._lookUpTableBezier[o][m] * y[m][n]); + (e += i[m] * this._lookUpTableBezier[o][m]), + (t += a[m] * this._lookUpTableBezier[o][m]); + } + this.vertex(e, t); + } + (this.curFillColor = p[3]), + (this.curStrokeColor = y[3]), + (this.immediateMode._bezierVertex[0] = + arguments.length <= 4 ? void 0 : arguments[4]), + (this.immediateMode._bezierVertex[1] = + arguments.length <= 5 ? void 0 : arguments[5]); + } else if (9 === l) { + (this.isBezier = !0), + (i = [ + this.immediateMode._bezierVertex[0], + arguments.length <= 0 ? void 0 : arguments[0], + arguments.length <= 3 ? void 0 : arguments[3], + arguments.length <= 6 ? void 0 : arguments[6], + ]), + (a = [ + this.immediateMode._bezierVertex[1], + arguments.length <= 1 ? void 0 : arguments[1], + arguments.length <= 4 ? void 0 : arguments[4], + arguments.length <= 7 ? void 0 : arguments[7], + ]); + var j = [ + this.immediateMode._bezierVertex[2], + arguments.length <= 2 ? void 0 : arguments[2], + arguments.length <= 5 ? void 0 : arguments[5], + arguments.length <= 8 ? void 0 : arguments[8], + ], + _ = Math.hypot(i[0] - i[1], a[0] - a[1], j[0] - j[1]), + v = Math.hypot(i[1] - i[2], a[1] - a[2], j[1] - j[2]), + x = Math.hypot(i[2] - i[3], a[2] - a[3], j[2] - j[3]), + l = _ + v + x; + for (_ /= l, x /= l, n = 0; n < 4; n++) + p[1].push(p[0][n] * (1 - _) + p[3][n] * _), + p[2].push(p[0][n] * x + p[3][n] * (1 - x)), + y[1].push(y[0][n] * (1 - _) + y[3][n] * _), + y[2].push(y[0][n] * x + y[3][n] * (1 - x)); + for (o = 0; o < f; o++) { + for ( + this.curFillColor = [0, 0, 0, 0], + this.curStrokeColor = [0, 0, 0, 0], + m = e = t = r = 0; + m < 4; + m++ + ) { + for (n = 0; n < 4; n++) + (this.curFillColor[n] += + this._lookUpTableBezier[o][m] * p[m][n]), + (this.curStrokeColor[n] += + this._lookUpTableBezier[o][m] * y[m][n]); + (e += i[m] * this._lookUpTableBezier[o][m]), + (t += a[m] * this._lookUpTableBezier[o][m]), + (r += j[m] * this._lookUpTableBezier[o][m]); + } + this.vertex(e, t, r); + } + (this.curFillColor = p[3]), + (this.curStrokeColor = y[3]), + (this.immediateMode._bezierVertex[0] = + arguments.length <= 6 ? void 0 : arguments[6]), + (this.immediateMode._bezierVertex[1] = + arguments.length <= 7 ? void 0 : arguments[7]), + (this.immediateMode._bezierVertex[2] = + arguments.length <= 8 ? void 0 : arguments[8]); + } + }), + (S.default.RendererGL.prototype.quadraticVertex = function () { + if (0 === this.immediateMode._quadraticVertex.length) + throw Error( + "vertex() must be used once before calling quadraticVertex()", + ); + var e, + t, + r, + o, + n, + s, + i = [], + a = [], + l = arguments.length; + if ( + 0 === this._lookUpTableQuadratic.length || + this._lutQuadraticDetail !== this._pInst._curveDetail + ) { + (this._lookUpTableQuadratic = []), + (this._lutQuadraticDetail = this._pInst._curveDetail); + for ( + var u = 1 / this._lutQuadraticDetail, c = 0, d = 1, h = 0; + c < 1; + + ) { + if ( + ((s = parseFloat(c.toFixed(6))), + (this._lookUpTableQuadratic[h] = + this._quadraticCoefficients(s)), + d.toFixed(6) === u.toFixed(6)) + ) { + (s = parseFloat(d.toFixed(6)) + parseFloat(c.toFixed(6))), + ++h, + (this._lookUpTableQuadratic[h] = + this._quadraticCoefficients(s)); + break; + } + (c += u), (d -= u), ++h; + } + } + for ( + var f = this._lookUpTableQuadratic.length, p = [], m = 0; + m < 3; + m++ + ) + p.push([]); + (p[0] = this.immediateMode.geometry.vertexColors.slice(-4)), + (p[2] = this.curFillColor.slice()); + var y = []; + for (m = 0; m < 3; m++) y.push([]); + if ( + ((y[0] = + this.immediateMode.geometry.vertexStrokeColors.slice(-4)), + (y[2] = this.curStrokeColor.slice()), + 4 === l) + ) { + this.isQuadratic = !0; + var i = [ + this.immediateMode._quadraticVertex[0], + arguments.length <= 0 ? void 0 : arguments[0], + arguments.length <= 2 ? void 0 : arguments[2], + ], + a = [ + this.immediateMode._quadraticVertex[1], + arguments.length <= 1 ? void 0 : arguments[1], + arguments.length <= 3 ? void 0 : arguments[3], + ], + g = Math.hypot(i[0] - i[1], a[0] - a[1]); + for ( + g /= g + Math.hypot(i[1] - i[2], a[1] - a[2]), n = 0; + n < 4; + n++ + ) + p[1].push(p[0][n] * (1 - g) + p[2][n] * g), + y[1].push(y[0][n] * (1 - g) + y[2][n] * g); + for (o = 0; o < f; o++) { + for ( + this.curFillColor = [0, 0, 0, 0], + this.curStrokeColor = [0, 0, 0, 0], + m = e = t = 0; + m < 3; + m++ + ) { + for (n = 0; n < 4; n++) + (this.curFillColor[n] += + this._lookUpTableQuadratic[o][m] * p[m][n]), + (this.curStrokeColor[n] += + this._lookUpTableQuadratic[o][m] * y[m][n]); + (e += i[m] * this._lookUpTableQuadratic[o][m]), + (t += a[m] * this._lookUpTableQuadratic[o][m]); + } + this.vertex(e, t); + } + (this.curFillColor = p[2]), + (this.curStrokeColor = y[2]), + (this.immediateMode._quadraticVertex[0] = + arguments.length <= 2 ? void 0 : arguments[2]), + (this.immediateMode._quadraticVertex[1] = + arguments.length <= 3 ? void 0 : arguments[3]); + } else if (6 === l) { + (this.isQuadratic = !0), + (i = [ + this.immediateMode._quadraticVertex[0], + arguments.length <= 0 ? void 0 : arguments[0], + arguments.length <= 3 ? void 0 : arguments[3], + ]), + (a = [ + this.immediateMode._quadraticVertex[1], + arguments.length <= 1 ? void 0 : arguments[1], + arguments.length <= 4 ? void 0 : arguments[4], + ]); + var v = [ + this.immediateMode._quadraticVertex[2], + arguments.length <= 2 ? void 0 : arguments[2], + arguments.length <= 5 ? void 0 : arguments[5], + ], + b = Math.hypot(i[0] - i[1], a[0] - a[1], v[0] - v[1]); + for ( + b /= b + Math.hypot(i[1] - i[2], a[1] - a[2], v[1] - v[2]), + n = 0; + n < 4; + n++ + ) + p[1].push(p[0][n] * (1 - b) + p[2][n] * b), + y[1].push(y[0][n] * (1 - b) + y[2][n] * b); + for (o = 0; o < f; o++) { + for ( + this.curFillColor = [0, 0, 0, 0], + this.curStrokeColor = [0, 0, 0, 0], + m = e = t = r = 0; + m < 3; + m++ + ) { + for (n = 0; n < 4; n++) + (this.curFillColor[n] += + this._lookUpTableQuadratic[o][m] * p[m][n]), + (this.curStrokeColor[n] += + this._lookUpTableQuadratic[o][m] * y[m][n]); + (e += i[m] * this._lookUpTableQuadratic[o][m]), + (t += a[m] * this._lookUpTableQuadratic[o][m]), + (r += v[m] * this._lookUpTableQuadratic[o][m]); + } + this.vertex(e, t, r); + } + (this.curFillColor = p[2]), + (this.curStrokeColor = y[2]), + (this.immediateMode._quadraticVertex[0] = + arguments.length <= 3 ? void 0 : arguments[3]), + (this.immediateMode._quadraticVertex[1] = + arguments.length <= 4 ? void 0 : arguments[4]), + (this.immediateMode._quadraticVertex[2] = + arguments.length <= 5 ? void 0 : arguments[5]); + } + }), + (S.default.RendererGL.prototype.curveVertex = function () { + var e, + t, + r, + o, + n, + s, + i = [], + a = [], + l = arguments.length; + if ( + 0 === this._lookUpTableBezier.length || + this._lutBezierDetail !== this._pInst._curveDetail + ) { + (this._lookUpTableBezier = []), + (this._lutBezierDetail = this._pInst._curveDetail); + for ( + var u = 1 / this._lutBezierDetail, c = 0, d = 1, h = 0; + c < 1; + + ) { + if ( + ((s = parseFloat(c.toFixed(6))), + (this._lookUpTableBezier[h] = this._bezierCoefficients(s)), + d.toFixed(6) === u.toFixed(6)) + ) { + (s = parseFloat(d.toFixed(6)) + parseFloat(c.toFixed(6))), + ++h, + (this._lookUpTableBezier[h] = + this._bezierCoefficients(s)); + break; + } + (c += u), (d -= u), ++h; + } + } + var f = this._lookUpTableBezier.length; + if (2 === l) { + if ( + (this.immediateMode._curveVertex.push( + arguments.length <= 0 ? void 0 : arguments[0], + ), + this.immediateMode._curveVertex.push( + arguments.length <= 1 ? void 0 : arguments[1], + ), + 8 === this.immediateMode._curveVertex.length) + ) { + for ( + this.isCurve = !0, + i = this._bezierToCatmull([ + this.immediateMode._curveVertex[0], + this.immediateMode._curveVertex[2], + this.immediateMode._curveVertex[4], + this.immediateMode._curveVertex[6], + ]), + a = this._bezierToCatmull([ + this.immediateMode._curveVertex[1], + this.immediateMode._curveVertex[3], + this.immediateMode._curveVertex[5], + this.immediateMode._curveVertex[7], + ]), + n = 0; + n < f; + n++ + ) + (t = + i[0] * this._lookUpTableBezier[n][0] + + i[1] * this._lookUpTableBezier[n][1] + + i[2] * this._lookUpTableBezier[n][2] + + i[3] * this._lookUpTableBezier[n][3]), + (r = + a[0] * this._lookUpTableBezier[n][0] + + a[1] * this._lookUpTableBezier[n][1] + + a[2] * this._lookUpTableBezier[n][2] + + a[3] * this._lookUpTableBezier[n][3]), + this.vertex(t, r); + for (n = 0; n < l; n++) + this.immediateMode._curveVertex.shift(); + } + } else if ( + 3 === l && + (this.immediateMode._curveVertex.push( + arguments.length <= 0 ? void 0 : arguments[0], + ), + this.immediateMode._curveVertex.push( + arguments.length <= 1 ? void 0 : arguments[1], + ), + this.immediateMode._curveVertex.push( + arguments.length <= 2 ? void 0 : arguments[2], + ), + 12 === this.immediateMode._curveVertex.length) + ) { + for ( + this.isCurve = !0, + i = this._bezierToCatmull([ + this.immediateMode._curveVertex[0], + this.immediateMode._curveVertex[3], + this.immediateMode._curveVertex[6], + this.immediateMode._curveVertex[9], + ]), + a = this._bezierToCatmull([ + this.immediateMode._curveVertex[1], + this.immediateMode._curveVertex[4], + this.immediateMode._curveVertex[7], + this.immediateMode._curveVertex[10], + ]), + e = this._bezierToCatmull([ + this.immediateMode._curveVertex[2], + this.immediateMode._curveVertex[5], + this.immediateMode._curveVertex[8], + this.immediateMode._curveVertex[11], + ]), + n = 0; + n < f; + n++ + ) + (t = + i[0] * this._lookUpTableBezier[n][0] + + i[1] * this._lookUpTableBezier[n][1] + + i[2] * this._lookUpTableBezier[n][2] + + i[3] * this._lookUpTableBezier[n][3]), + (r = + a[0] * this._lookUpTableBezier[n][0] + + a[1] * this._lookUpTableBezier[n][1] + + a[2] * this._lookUpTableBezier[n][2] + + a[3] * this._lookUpTableBezier[n][3]), + (o = + e[0] * this._lookUpTableBezier[n][0] + + e[1] * this._lookUpTableBezier[n][1] + + e[2] * this._lookUpTableBezier[n][2] + + e[3] * this._lookUpTableBezier[n][3]), + this.vertex(t, r, o); + for (n = 0; n < l; n++) this.immediateMode._curveVertex.shift(); + } + }), + (S.default.RendererGL.prototype.image = function ( + e, + t, + r, + o, + n, + s, + i, + a, + l, + ) { + this._isErasing && this.blendMode(this._cachedBlendMode), + this._pInst.push(), + this._pInst.noLights(), + this._pInst.noStroke(), + this._pInst.texture(e), + this._pInst.textureMode(_.NORMAL); + var u = 0, + c = (t <= e.width && (u = t / e.width), 1), + t = (t + o <= e.width && (c = (t + o) / e.width), 0), + o = (r <= e.height && (t = r / e.height), 1); + r + n <= e.height && (o = (r + n) / e.height), + this.beginShape(), + this.vertex(s, i, 0, u, t), + this.vertex(s + a, i, 0, c, t), + this.vertex(s + a, i + l, 0, c, o), + this.vertex(s, i + l, 0, u, o), + this.endShape(_.CLOSE), + this._pInst.pop(), + this._isErasing && this.blendMode(_.REMOVE); + }); + var n = S.default; + r.default = n; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.Geometry": 327, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.math.hypot": 170, + "core-js/modules/es.math.sign": 172, + "core-js/modules/es.number.to-fixed": 175, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 319: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.every"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.every"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.object.assign"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var n = (c = e("../core/main")) && c.__esModule ? c : { default: c }, + a = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = l(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function l() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (l = function () { + return e; + }), + e); + } + function s(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + function u(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + var c = (function () { + function t(e) { + if (!(this instanceof t)) + throw new TypeError("Cannot call a class as a function"); + (this.renderer = e)._pInst.push(), + (this.identityMatrix = new n.default.Matrix()), + (e.uMVMatrix = new n.default.Matrix()), + (this.geometry = new n.default.Geometry()), + (this.geometry.gid = "_p5_GeometryBuilder_".concat( + t.nextGeometryId, + )), + t.nextGeometryId++, + (this.hasTransform = !1); + } + var e, r, o; + return ( + (e = t), + (r = [ + { + key: "transformVertices", + value: function (e) { + var t = this; + return this.hasTransform + ? e.map(function (e) { + return t.renderer.uMVMatrix.multiplyPoint(e); + }) + : e; + }, + }, + { + key: "transformNormals", + value: function (e) { + var t = this; + return this.hasTransform + ? e.map(function (e) { + return t.renderer.uNMatrix.multiplyVec3(e); + }) + : e; + }, + }, + { + key: "addGeometry", + value: function (e) { + for ( + var t, + r = this, + o = + ((this.hasTransform = + !this.renderer.uMVMatrix.mat4.every( + function (e, t) { + return e === r.identityMatrix.mat4[t]; + }, + )), + this.hasTransform && + this.renderer.uNMatrix.inverseTranspose( + this.renderer.uMVMatrix, + ), + this.geometry.vertices.length), + n = + ((t = this.geometry.vertices).push.apply( + t, + s(this.transformVertices(e.vertices)), + ), + (t = this.geometry.vertexNormals).push.apply( + t, + s(this.transformNormals(e.vertexNormals)), + ), + (t = this.geometry.uvs).push.apply(t, s(e.uvs)), + this.renderer._doFill && + (t = this.geometry.faces).push.apply( + t, + s( + e.faces.map(function (e) { + return e.map(function (e) { + return e + o; + }); + }), + ), + ), + this.renderer._doStroke && + (t = this.geometry.edges).push.apply( + t, + s( + e.edges.map(function (e) { + return e.map(function (e) { + return e + o; + }); + }), + ), + ), + s(e.vertexColors)); + n.length < 4 * e.vertices.length; + + ) + n.push.apply(n, s(this.renderer.curFillColor)); + (t = this.geometry.vertexColors).push.apply(t, s(n)); + }, + }, + { + key: "addImmediate", + value: function () { + var e = this.renderer.immediateMode.geometry, + t = this.renderer.immediateMode.shapeMode, + r = []; + if (this.renderer._doFill) + if (t === a.TRIANGLE_STRIP || t === a.QUAD_STRIP) + for (var o = 2; o < e.vertices.length; o++) + o % 2 == 0 + ? r.push([o, o - 1, o - 2]) + : r.push([o, o - 2, o - 1]); + else if (t === a.TRIANGLE_FAN) + for (var n = 2; n < e.vertices.length; n++) + r.push([0, n - 1, n]); + else + for (var s = 0; s < e.vertices.length; s += 3) + r.push([s, s + 1, s + 2]); + this.addGeometry(Object.assign({}, e, { faces: r })); + }, + }, + { + key: "addRetained", + value: function (e) { + this.addGeometry(e.model); + }, + }, + { + key: "finish", + value: function () { + return this.renderer._pInst.pop(), this.geometry; + }, + }, + ]) && u(e.prototype, r), + o && u(e, o), + t + ); + })(); + (c.nextGeometryId = 0), (r.default = c); + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.every": 153, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.object.assign": 176, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 320: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.math.sign"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.math.sign"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var g = (s = e("../core/main")) && s.__esModule ? s : { default: s }, + n = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== v(e) && "function" != typeof e)) + return { default: e }; + var t = i(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function i() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (i = function () { + return e; + }), + e); + } + function v(e) { + return (v = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + (g.default.prototype.orbitControl = function (e, t, r, o) { + var n = this, + s = + (this._assert3d("orbitControl"), + g.default._validateParameters("orbitControl", arguments), + this._renderer._curCamera); + void 0 === e && (e = 1), + void 0 === t && (t = e), + void 0 === r && (r = 1), + "object" !== v(o) && (o = {}), + !0 !== this.contextMenuDisabled && + ((this.canvas.oncontextmenu = function () { + return !1; + }), + this._setProperty("contextMenuDisabled", !0)), + !0 !== this.wheelDefaultDisabled && + ((this.canvas.onwheel = function () { + return !1; + }), + this._setProperty("wheelDefaultDisabled", !0)); + var i = o.disableTouchActions; + !0 === this.touchActionsDisabled || + (void 0 !== i && !i) || + ((this.canvas.style["touch-action"] = "none"), + this._setProperty("touchActionsDisabled", !0)); + var a, + l, + u, + i = o.freeRotation, + o = void 0 !== i && i, + c = [], + i = + (this.touches.forEach(function (t) { + n._renderer.prevTouches.forEach(function (e) { + t.id === e.id && + ((e = { x: t.x, y: t.y, px: e.x, py: e.y }), c.push(e)); + }); + }), + (this._renderer.prevTouches = this.touches), + 0), + d = 0, + h = 0, + f = 0, + p = 0, + m = this.height < this.width ? this.height : this.width, + y = !1; + return ( + 0 < c.length + ? ((y = + 0 < c[0].x && + c[0].x < this.width && + 0 < c[0].y && + c[0].y < this.height), + 1 === c.length + ? ((d = (-e * ((a = c[0]).x - a.px)) / m), + (h = (t * (a.y - a.py)) / m)) + : ((a = c[0]), + (l = c[1]), + (i = + -( + Math.hypot(a.x - l.x, a.y - l.y) - + Math.hypot(a.px - l.px, a.py - l.py) + ) * + r * + 4e-4), + (f = 0.5 * (a.x + l.x) - 0.5 * (a.px + l.px)), + (p = 0.5 * (a.y + l.y) - 0.5 * (a.py + l.py))), + 0 < this.touches.length + ? y && + ((this._renderer.executeRotateAndMove = !0), + (this._renderer.executeZoom = !0)) + : ((this._renderer.executeRotateAndMove = !1), + (this._renderer.executeZoom = !1))) + : ((y = + 0 < this.mouseX && + this.mouseX < this.width && + 0 < this.mouseY && + this.mouseY < this.height), + 0 !== this._mouseWheelDeltaY + ? ((i = Math.sign(this._mouseWheelDeltaY) * r), + (i *= 0.01), + (this._mouseWheelDeltaY = 0), + y && (this._renderer.executeZoom = !0)) + : (this._renderer.zoomFlag = !1), + this.mouseIsPressed + ? (this.mouseButton === this.LEFT + ? ((d = (-e * this.movedX) / m), + (h = (t * this.movedY) / m)) + : this.mouseButton === this.RIGHT && + ((f = this.movedX), (p = this.movedY * s.yScale)), + y && (this._renderer.executeRotateAndMove = !0)) + : (this._renderer.executeRotateAndMove = !1)), + 0 !== i && + this._renderer.executeZoom && + (this._renderer.zoomVelocity += i), + 0.001 < Math.abs(this._renderer.zoomVelocity) + ? (o + ? s._orbitFree(0, 0, this._renderer.zoomVelocity) + : s._orbit(0, 0, this._renderer.zoomVelocity), + 0 !== s.projMatrix.mat4[15] && + ((s.projMatrix.mat4[0] *= Math.pow( + 10, + -this._renderer.zoomVelocity, + )), + (s.projMatrix.mat4[5] *= Math.pow( + 10, + -this._renderer.zoomVelocity, + )), + (this._renderer.uPMatrix.mat4[0] = s.projMatrix.mat4[0]), + (this._renderer.uPMatrix.mat4[5] = s.projMatrix.mat4[5])), + (this._renderer.zoomVelocity *= 0.85)) + : (this._renderer.zoomVelocity = 0), + (0 === d && 0 === h) || + !this._renderer.executeRotateAndMove || + this._renderer.rotateVelocity.add(0.6 * d, 0.6 * h), + 1e-6 < this._renderer.rotateVelocity.magSq() + ? (o + ? s._orbitFree( + -this._renderer.rotateVelocity.x, + this._renderer.rotateVelocity.y, + 0, + ) + : s._orbit( + this._renderer.rotateVelocity.x, + this._renderer.rotateVelocity.y, + 0, + ), + this._renderer.rotateVelocity.mult(0.85)) + : this._renderer.rotateVelocity.set(0, 0), + (0 === f && 0 === p) || + !this._renderer.executeRotateAndMove || + ((a = (2 * f) / this.width), + (l = (2 * -p) / this.height), + this._renderer.moveVelocity.add(0.15 * a, 0.15 * l)), + 1e-6 < this._renderer.moveVelocity.magSq() + ? ((r = s._getLocalAxes()), + (e = s.eyeX - s.centerX), + (t = s.eyeY - s.centerY), + (m = s.eyeZ - s.centerZ), + (y = Math.sqrt(e * e + t * t + m * m)), + (i = new g.default.Vector(s.centerX, s.centerY, s.centerZ)), + (i = s.cameraMatrix.multiplyPoint(i)), + ((i = + this._renderer.uPMatrix.multiplyAndNormalizePoint(i)).x -= + this._renderer.moveVelocity.x), + (i.y -= this._renderer.moveVelocity.y), + (h = + 0 === (d = this._renderer.uPMatrix.mat4)[15] + ? ((u = ((d[8] + i.x) / d[0]) * y), + ((d[9] + i.y) / d[5]) * y) + : ((u = (i.x - d[12]) / d[0]), (i.y - d[13]) / d[5])), + s.setPosition( + s.eyeX + u * r.x[0] + h * r.y[0], + s.eyeY + u * r.x[1] + h * r.y[1], + s.eyeZ + u * r.x[2] + h * r.y[2], + ), + this._renderer.moveVelocity.mult(0.85)) + : this._renderer.moveVelocity.set(0, 0), + this + ); + }), + (g.default.prototype.debugMode = function () { + this._assert3d("debugMode"); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + g.default._validateParameters("debugMode", t); + for (var o = this._registeredMethods.post.length - 1; 0 <= o; o--) + (this._registeredMethods.post[o].toString() !== + this._grid().toString() && + this._registeredMethods.post[o].toString() !== + this._axesIcon().toString()) || + this._registeredMethods.post.splice(o, 1); + t[0] === n.GRID + ? this.registerMethod( + "post", + this._grid.call(this, t[1], t[2], t[3], t[4], t[5]), + ) + : t[0] === n.AXES + ? this.registerMethod( + "post", + this._axesIcon.call(this, t[1], t[2], t[3], t[4]), + ) + : (this.registerMethod( + "post", + this._grid.call(this, t[0], t[1], t[2], t[3], t[4]), + ), + this.registerMethod( + "post", + this._axesIcon.call(this, t[5], t[6], t[7], t[8]), + )); + }), + (g.default.prototype.noDebugMode = function () { + this._assert3d("noDebugMode"); + for (var e = this._registeredMethods.post.length - 1; 0 <= e; e--) + (this._registeredMethods.post[e].toString() !== + this._grid().toString() && + this._registeredMethods.post[e].toString() !== + this._axesIcon().toString()) || + this._registeredMethods.post.splice(e, 1); + }), + (g.default.prototype._grid = function (e, r, o, n, s) { + void 0 === e && (e = this.width / 2), + void 0 === r && + (r = Math.round(e / 30) < 4 ? 4 : Math.round(e / 30)), + void 0 === o && (o = 0), + void 0 === n && (n = 0), + void 0 === s && (s = 0); + var i = e / r, + a = e / 2; + return function () { + this.push(), + this.stroke( + 255 * this._renderer.curStrokeColor[0], + 255 * this._renderer.curStrokeColor[1], + 255 * this._renderer.curStrokeColor[2], + ), + this._renderer.uMVMatrix.set( + this._renderer._curCamera.cameraMatrix.mat4[0], + this._renderer._curCamera.cameraMatrix.mat4[1], + this._renderer._curCamera.cameraMatrix.mat4[2], + this._renderer._curCamera.cameraMatrix.mat4[3], + this._renderer._curCamera.cameraMatrix.mat4[4], + this._renderer._curCamera.cameraMatrix.mat4[5], + this._renderer._curCamera.cameraMatrix.mat4[6], + this._renderer._curCamera.cameraMatrix.mat4[7], + this._renderer._curCamera.cameraMatrix.mat4[8], + this._renderer._curCamera.cameraMatrix.mat4[9], + this._renderer._curCamera.cameraMatrix.mat4[10], + this._renderer._curCamera.cameraMatrix.mat4[11], + this._renderer._curCamera.cameraMatrix.mat4[12], + this._renderer._curCamera.cameraMatrix.mat4[13], + this._renderer._curCamera.cameraMatrix.mat4[14], + this._renderer._curCamera.cameraMatrix.mat4[15], + ); + for (var e = 0; e <= r; e++) + this.beginShape(this.LINES), + this.vertex(-a + o, n, e * i - a + s), + this.vertex(a + o, n, e * i - a + s), + this.endShape(); + for (var t = 0; t <= r; t++) + this.beginShape(this.LINES), + this.vertex(t * i - a + o, n, -a + s), + this.vertex(t * i - a + o, n, a + s), + this.endShape(); + this.pop(); + }; + }), + (g.default.prototype._axesIcon = function (e, t, r, o) { + return ( + void 0 === e && + (e = 40 < this.width / 20 ? this.width / 20 : 40), + void 0 === t && (t = -this.width / 4), + void 0 === r && (r = t), + void 0 === o && (o = t), + function () { + this.push(), + this._renderer.uMVMatrix.set( + this._renderer._curCamera.cameraMatrix.mat4[0], + this._renderer._curCamera.cameraMatrix.mat4[1], + this._renderer._curCamera.cameraMatrix.mat4[2], + this._renderer._curCamera.cameraMatrix.mat4[3], + this._renderer._curCamera.cameraMatrix.mat4[4], + this._renderer._curCamera.cameraMatrix.mat4[5], + this._renderer._curCamera.cameraMatrix.mat4[6], + this._renderer._curCamera.cameraMatrix.mat4[7], + this._renderer._curCamera.cameraMatrix.mat4[8], + this._renderer._curCamera.cameraMatrix.mat4[9], + this._renderer._curCamera.cameraMatrix.mat4[10], + this._renderer._curCamera.cameraMatrix.mat4[11], + this._renderer._curCamera.cameraMatrix.mat4[12], + this._renderer._curCamera.cameraMatrix.mat4[13], + this._renderer._curCamera.cameraMatrix.mat4[14], + this._renderer._curCamera.cameraMatrix.mat4[15], + ), + this.strokeWeight(2), + this.stroke(255, 0, 0), + this.beginShape(this.LINES), + this.vertex(t, r, o), + this.vertex(t + e, r, o), + this.endShape(), + this.stroke(0, 255, 0), + this.beginShape(this.LINES), + this.vertex(t, r, o), + this.vertex(t, r + e, o), + this.endShape(), + this.stroke(0, 0, 255), + this.beginShape(this.LINES), + this.vertex(t, r, o), + this.vertex(t, r, o + e), + this.endShape(), + this.pop(); + } + ); + }); + var s = g.default; + r.default = s; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.math.hypot": 170, + "core-js/modules/es.math.sign": 172, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 321: [ + function (e, t, r) { + "use strict"; + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var m = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + (m.default.prototype.ambientLight = function (e, t, r, o) { + this._assert3d("ambientLight"), + m.default._validateParameters("ambientLight", arguments); + var n = this.color.apply(this, arguments); + return ( + this._renderer.ambientLightColors.push( + n._array[0], + n._array[1], + n._array[2], + ), + (this._renderer._enableLighting = !0), + this + ); + }), + (m.default.prototype.specularColor = function (e, t, r) { + this._assert3d("specularColor"), + m.default._validateParameters("specularColor", arguments); + var o = this.color.apply(this, arguments); + return ( + (this._renderer.specularColors = [ + o._array[0], + o._array[1], + o._array[2], + ]), + this + ); + }), + (m.default.prototype.directionalLight = function ( + e, + t, + r, + o, + n, + s, + ) { + this._assert3d("directionalLight"), + m.default._validateParameters("directionalLight", arguments), + (e = e instanceof m.default.Color ? e : this.color(e, t, r)); + var i, + a, + t = arguments[arguments.length - 1], + r = + "number" == typeof t + ? ((i = arguments[arguments.length - 3]), + (a = arguments[arguments.length - 2]), + arguments[arguments.length - 1]) + : ((i = t.x), (a = t.y), t.z), + t = Math.sqrt(i * i + a * a + r * r); + return ( + this._renderer.directionalLightDirections.push( + i / t, + a / t, + r / t, + ), + this._renderer.directionalLightDiffuseColors.push( + e._array[0], + e._array[1], + e._array[2], + ), + Array.prototype.push.apply( + this._renderer.directionalLightSpecularColors, + this._renderer.specularColors, + ), + (this._renderer._enableLighting = !0), + this + ); + }), + (m.default.prototype.pointLight = function (e, t, r, o, n, s) { + this._assert3d("pointLight"), + m.default._validateParameters("pointLight", arguments), + (e = e instanceof m.default.Color ? e : this.color(e, t, r)); + var i, + a, + t = arguments[arguments.length - 1], + r = + "number" == typeof t + ? ((i = arguments[arguments.length - 3]), + (a = arguments[arguments.length - 2]), + arguments[arguments.length - 1]) + : ((i = t.x), (a = t.y), t.z); + return ( + this._renderer.pointLightPositions.push(i, a, r), + this._renderer.pointLightDiffuseColors.push( + e._array[0], + e._array[1], + e._array[2], + ), + Array.prototype.push.apply( + this._renderer.pointLightSpecularColors, + this._renderer.specularColors, + ), + (this._renderer._enableLighting = !0), + this + ); + }), + (m.default.prototype.imageLight = function (e) { + (this._renderer.activeImageLight = e), + (this._renderer._enableLighting = !0); + }), + (m.default.prototype.lights = function () { + this._assert3d("lights"); + var e = this.color("rgb(128,128,128)"); + return ( + this.ambientLight(e), this.directionalLight(e, 0, 0, -1), this + ); + }), + (m.default.prototype.lightFalloff = function (e, t, r) { + return ( + this._assert3d("lightFalloff"), + m.default._validateParameters("lightFalloff", arguments), + e < 0 && + ((e = 0), + console.warn( + "Value of constant argument in lightFalloff() should be never be negative. Set to 0.", + )), + t < 0 && + ((t = 0), + console.warn( + "Value of linear argument in lightFalloff() should be never be negative. Set to 0.", + )), + r < 0 && + ((r = 0), + console.warn( + "Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.", + )), + 0 === e && + 0 === t && + 0 === r && + ((e = 1), + console.warn( + "Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.", + )), + (this._renderer.constantAttenuation = e), + (this._renderer.linearAttenuation = t), + (this._renderer.quadraticAttenuation = r), + this + ); + }), + (m.default.prototype.spotLight = function ( + e, + t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + ) { + this._assert3d("spotLight"), + m.default._validateParameters("spotLight", arguments); + var d, + h, + f, + p = arguments.length; + switch (p) { + case 11: + case 10: + (d = this.color(e, t, r)), + (h = new m.default.Vector(o, n, s)), + (f = new m.default.Vector(i, a, l)); + break; + case 9: + e instanceof m.default.Color + ? ((d = e), + (h = new m.default.Vector(t, r, o)), + (f = new m.default.Vector(n, s, i)), + (u = a), + (c = l)) + : o instanceof m.default.Vector + ? ((d = this.color(e, t, r)), + (h = o), + (f = new m.default.Vector(n, s, i)), + (u = a), + (c = l)) + : i instanceof m.default.Vector + ? ((d = this.color(e, t, r)), + (h = new m.default.Vector(o, n, s)), + (f = i), + (u = a), + (c = l)) + : ((d = this.color(e, t, r)), + (h = new m.default.Vector(o, n, s)), + (f = new m.default.Vector(i, a, l))); + break; + case 8: + u = + ((f = + e instanceof m.default.Color + ? ((d = e), + (h = new m.default.Vector(t, r, o)), + new m.default.Vector(n, s, i)) + : o instanceof m.default.Vector + ? ((d = this.color(e, t, r)), + (h = o), + new m.default.Vector(n, s, i)) + : ((d = this.color(e, t, r)), + (h = new m.default.Vector(o, n, s)), + i)), + a); + break; + case 7: + e instanceof m.default.Color && t instanceof m.default.Vector + ? ((d = e), + (h = t), + (f = new m.default.Vector(r, o, n)), + (u = s), + (c = i)) + : e instanceof m.default.Color && + n instanceof m.default.Vector + ? ((d = e), + (h = new m.default.Vector(t, r, o)), + (f = n), + (u = s), + (c = i)) + : o instanceof m.default.Vector && + n instanceof m.default.Vector + ? ((d = this.color(e, t, r)), + (h = o), + (f = n), + (u = s), + (c = i)) + : (f = + e instanceof m.default.Color + ? ((d = e), + (h = new m.default.Vector(t, r, o)), + new m.default.Vector(n, s, i)) + : o instanceof m.default.Vector + ? ((d = this.color(e, t, r)), + (h = o), + new m.default.Vector(n, s, i)) + : ((d = this.color(e, t, r)), + (h = new m.default.Vector(o, n, s)), + i)); + break; + case 6: + o instanceof m.default.Vector && n instanceof m.default.Vector + ? ((d = this.color(e, t, r)), (h = o), (f = n), (u = s)) + : e instanceof m.default.Color && + n instanceof m.default.Vector + ? ((d = e), + (h = new m.default.Vector(t, r, o)), + (f = n), + (u = s)) + : e instanceof m.default.Color && + t instanceof m.default.Vector && + ((d = e), + (h = t), + (f = new m.default.Vector(r, o, n)), + (u = s)); + break; + case 5: + e instanceof m.default.Color && + t instanceof m.default.Vector && + r instanceof m.default.Vector + ? ((d = e), (h = t), (f = r), (u = o), (c = n)) + : o instanceof m.default.Vector && + n instanceof m.default.Vector + ? ((d = this.color(e, t, r)), (h = o), (f = n)) + : e instanceof m.default.Color && + n instanceof m.default.Vector + ? ((d = e), + (h = new m.default.Vector(t, r, o)), + (f = n)) + : e instanceof m.default.Color && + t instanceof m.default.Vector && + ((d = e), + (h = t), + (f = new m.default.Vector(r, o, n))); + break; + case 4: + (d = e), (h = t), (f = r), (u = o); + break; + case 3: + (d = e), (h = t), (f = r); + break; + default: + return ( + console.warn( + "Sorry, input for spotlight() is not in prescribed format. Too ".concat( + p < 3 ? "few" : "many", + " arguments were provided", + ), + ), + this + ); + } + return ( + this._renderer.spotLightDiffuseColors.push( + d._array[0], + d._array[1], + d._array[2], + ), + Array.prototype.push.apply( + this._renderer.spotLightSpecularColors, + this._renderer.specularColors, + ), + this._renderer.spotLightPositions.push(h.x, h.y, h.z), + f.normalize(), + this._renderer.spotLightDirections.push(f.x, f.y, f.z), + void 0 === u && (u = Math.PI / 3), + void 0 !== c && c < 1 + ? ((c = 1), + console.warn( + "Value of concentration needs to be greater than 1. Setting it to 1", + )) + : void 0 === c && (c = 100), + (u = this._renderer._pInst._toRadians(u)), + this._renderer.spotLightAngle.push(Math.cos(u)), + this._renderer.spotLightConc.push(c), + (this._renderer._enableLighting = !0), + this + ); + }), + (m.default.prototype.noLights = function () { + this._assert3d("noLights"); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + m.default._validateParameters("noLights", t), + (this._renderer._enableLighting = !1), + (this._renderer.ambientLightColors.length = 0), + (this._renderer.specularColors = [1, 1, 1]), + (this._renderer.directionalLightDirections.length = 0), + (this._renderer.directionalLightDiffuseColors.length = 0), + (this._renderer.directionalLightSpecularColors.length = 0), + (this._renderer.pointLightPositions.length = 0), + (this._renderer.pointLightDiffuseColors.length = 0), + (this._renderer.pointLightSpecularColors.length = 0), + (this._renderer.spotLightPositions.length = 0), + (this._renderer.spotLightDirections.length = 0), + (this._renderer.spotLightDiffuseColors.length = 0), + (this._renderer.spotLightSpecularColors.length = 0), + (this._renderer.spotLightAngle.length = 0), + (this._renderer.spotLightConc.length = 0), + (this._renderer.constantAttenuation = 1), + (this._renderer.linearAttenuation = 0), + (this._renderer.quadraticAttenuation = 0), + (this._renderer._useShininess = 1), + this + ); + }); + e = m.default; + r.default = e; + }, + { "../core/main": 275 }, + ], + 322: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.splice"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.match"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.trim"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var x = (o = e("../core/main")) && o.__esModule ? o : { default: o }; + e("./p5.Geometry"), + (x.default.prototype.loadModel = function (e) { + x.default._validateParameters("loadModel", arguments); + var y, + g, + t, + r = e.slice(-4), + v = + ("boolean" == typeof arguments[1] + ? ((y = arguments[1]), + (g = arguments[2]), + (t = arguments[3]), + void 0 !== arguments[4] && (r = arguments[4])) + : ((y = !1), + (g = arguments[1]), + (t = arguments[2]), + void 0 !== arguments[3] && (r = arguments[3])), + new x.default.Geometry()), + b = ((v.gid = "".concat(e, "|").concat(y)), this); + return ( + r.match(/\.stl$/i) + ? this.httpDo( + e, + "GET", + "arrayBuffer", + function (e) { + !(function (e, t) { + if ( + (function (e) { + for ( + var t = new DataView(e), + r = [115, 111, 108, 105, 100], + o = 0; + o < 5; + o++ + ) + if ( + (function (e, t, r) { + for (var o = 0, n = e.length; o < n; o++) + if (e[o] !== t.getUint8(r + o, !1)) + return; + return 1; + })(r, t, o) + ) + return; + return 1; + })(t) + ) + !(function (e, t) { + for ( + var r, + o, + n, + s, + i, + a, + l, + u = new DataView(t), + c = u.getUint32(80, !0), + d = !1, + h = 0; + h < 70; + h++ + ) + 1129270351 === u.getUint32(h, !1) && + 82 === u.getUint8(h + 4) && + 61 === u.getUint8(h + 5) && + ((d = !0), + (s = []), + (i = u.getUint8(h + 6) / 255), + (a = u.getUint8(h + 7) / 255), + (l = u.getUint8(h + 8) / 255)); + for (var f = 0; f < c; f++) { + for ( + var p, + m = 84 + 50 * f, + y = u.getFloat32(m, !0), + g = u.getFloat32(4 + m, !0), + v = u.getFloat32(8 + m, !0), + b = + (d && + ((p = u.getUint16(48 + m, !0)), + (n = + 0 == (32768 & p) + ? ((r = (31 & p) / 31), + (o = ((p >> 5) & 31) / 31), + ((p >> 10) & 31) / 31) + : ((r = i), (o = a), l))), + new x.default.Vector(y, g, v)), + j = 1; + j <= 3; + j++ + ) { + var _ = m + 12 * j, + _ = new x.default.Vector( + u.getFloat32(_, !0), + u.getFloat32(4 + _, !0), + u.getFloat32(8 + _, !0), + ); + e.vertices.push(_), + e.vertexNormals.push(b), + d && s.push(r, o, n); + } + e.faces.push([3 * f, 3 * f + 1, 3 * f + 2]), + e.uvs.push([0, 0], [0, 0], [0, 0]); + } + })(e, t); + else { + t = new DataView(t); + if (!("TextDecoder" in window)) + return console.warn( + "Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)", + ); + t = new TextDecoder("utf-8").decode(t).split("\n"); + !(function (e, t) { + for ( + var r, o, n = "", s = [], i = 0; + i < t.length; + ++i + ) { + for ( + var a = t[i].trim(), l = a.split(" "), u = 0; + u < l.length; + ++u + ) + "" === l[u] && l.splice(u, 1); + if (0 !== l.length) + switch (n) { + case "": + if ("solid" !== l[0]) + return ( + console.error(a), + console.error( + 'Invalid state "'.concat( + l[0], + '", should be "solid"', + ), + ) + ); + n = "solid"; + break; + case "solid": + if ("facet" !== l[0] || "normal" !== l[1]) + return ( + console.error(a), + console.error( + 'Invalid state "'.concat( + l[0], + '", should be "facet normal"', + ), + ) + ); + (r = new x.default.Vector( + parseFloat(l[2]), + parseFloat(l[3]), + parseFloat(l[4]), + )), + e.vertexNormals.push(r, r, r), + (n = "facet normal"); + break; + case "facet normal": + if ("outer" !== l[0] || "loop" !== l[1]) + return ( + console.error(a), + console.error( + 'Invalid state "'.concat( + l[0], + '", should be "outer loop"', + ), + ) + ); + n = "vertex"; + break; + case "vertex": + if ("vertex" === l[0]) + (o = new x.default.Vector( + parseFloat(l[1]), + parseFloat(l[2]), + parseFloat(l[3]), + )), + e.vertices.push(o), + e.uvs.push([0, 0]), + s.push(e.vertices.indexOf(o)); + else { + if ("endloop" !== l[0]) + return ( + console.error(a), + console.error( + 'Invalid state "'.concat( + l[0], + '", should be "vertex" or "endloop"', + ), + ) + ); + e.faces.push(s), + (s = []), + (n = "endloop"); + } + break; + case "endloop": + if ("endfacet" !== l[0]) + return ( + console.error(a), + console.error( + 'Invalid state "'.concat( + l[0], + '", should be "endfacet"', + ), + ) + ); + n = "endfacet"; + break; + case "endfacet": + if ("endsolid" !== l[0]) { + if ( + "facet" !== l[0] || + "normal" !== l[1] + ) + return ( + console.error(a), + console.error( + 'Invalid state "'.concat( + l[0], + '", should be "endsolid" or "facet normal"', + ), + ) + ); + (r = new x.default.Vector( + parseFloat(l[2]), + parseFloat(l[3]), + parseFloat(l[4]), + )), + e.vertexNormals.push(r, r, r), + (n = "facet normal"); + } + break; + default: + console.error( + 'Invalid state "'.concat(n, '"'), + ); + } + } + })(e, t); + } + })(v, e), + y && v.normalize(), + b._decrementPreload(), + "function" == typeof g && g(v); + }, + t, + ) + : r.match(/\.obj$/i) + ? this.loadStrings( + e, + function (e) { + for ( + var t = v, + r = e, + o = { v: [], vt: [], vn: [] }, + n = {}, + s = 0; + s < r.length; + ++s + ) { + var i = r[s].trim().split(/\b\s+/); + if (0 < i.length) + if ("v" === i[0] || "vn" === i[0]) { + var a = new x.default.Vector( + parseFloat(i[1]), + parseFloat(i[2]), + parseFloat(i[3]), + ); + o[i[0]].push(a); + } else if ("vt" === i[0]) { + a = [parseFloat(i[1]), 1 - parseFloat(i[2])]; + o[i[0]].push(a); + } else if ("f" === i[0]) + for (var l = 3; l < i.length; ++l) { + for ( + var u = [], c = [1, l - 1, l], d = 0; + d < c.length; + ++d + ) { + var h = i[c[d]], + f = 0; + if (void 0 !== n[h]) f = n[h]; + else { + for ( + var p = h.split("/"), m = 0; + m < p.length; + m++ + ) + p[m] = parseInt(p[m]) - 1; + (f = n[h] = t.vertices.length), + t.vertices.push(o.v[p[0]].copy()), + o.vt[p[1]] + ? t.uvs.push(o.vt[p[1]].slice()) + : t.uvs.push([0, 0]), + o.vn[p[2]] && + t.vertexNormals.push( + o.vn[p[2]].copy(), + ); + } + u.push(f); + } + u[0] !== u[1] && + u[0] !== u[2] && + u[1] !== u[2] && + t.faces.push(u); + } + } + 0 === t.vertexNormals.length && t.computeNormals(), + y && v.normalize(), + b._decrementPreload(), + "function" == typeof g && g(v); + }, + t, + ) + : (x.default._friendlyFileLoadError(3, e), + t + ? t() + : x.default._friendlyError( + "Sorry, the file type is invalid. Only OBJ and STL files are supported.", + )), + v + ); + }), + (x.default.prototype.model = function (e) { + this._assert3d("model"), + x.default._validateParameters("model", arguments), + 0 < e.vertices.length && + (this._renderer.geometryInHash(e.gid) || + (0 === e.edges.length && e._makeTriangleEdges(), + e._edgesToVertices(), + this._renderer.createBuffers(e.gid, e)), + this._renderer.drawBuffers(e.gid)); + }); + var o = x.default; + r.default = o; + }, + { + "../core/main": 275, + "./p5.Geometry": 327, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.splice": 167, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.match": 193, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.trim": 201, + }, + ], + 323: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.join"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var u = (s = e("../core/main")) && s.__esModule ? s : { default: s }, + n = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + e("./p5.Texture"), + (u.default.prototype.loadShader = function (e, t, r, o) { + u.default._validateParameters("loadShader", arguments), + (o = o || console.error); + function n() { + i._decrementPreload(), r && r(s); + } + var s = new u.default.Shader(), + i = this, + a = !1, + l = !1; + return ( + this.loadStrings( + e, + function (e) { + (s._vertSrc = e.join("\n")), (l = !0), a && n(); + }, + o, + ), + this.loadStrings( + t, + function (e) { + (s._fragSrc = e.join("\n")), (a = !0), l && n(); + }, + o, + ), + s + ); + }), + (u.default.prototype.createShader = function (e, t) { + return ( + u.default._validateParameters("createShader", arguments), + new u.default.Shader(this._renderer, e, t) + ); + }), + (u.default.prototype.createFilterShader = function (e) { + u.default._validateParameters("createFilterShader", arguments); + var t = e.includes("#version 300 es") + ? "#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n " + : "\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n ", + t = new u.default.Shader(this._renderer, t, e); + return ( + this._renderer.GL + ? t.ensureCompiledOnContext(this) + : t.ensureCompiledOnContext( + this._renderer.getFilterGraphicsLayer(), + ), + t + ); + }), + (u.default.prototype.shader = function (e) { + return ( + this._assert3d("shader"), + u.default._validateParameters("shader", arguments), + e.ensureCompiledOnContext(this), + e.isStrokeShader() + ? (this._renderer.userStrokeShader = e) + : ((this._renderer.userFillShader = e), + (this._renderer._useNormalMaterial = !1)), + this + ); + }), + (u.default.prototype.resetShader = function () { + return ( + (this._renderer.userFillShader = + this._renderer.userStrokeShader = + null), + this + ); + }), + (u.default.prototype.texture = function (e) { + return ( + this._assert3d("texture"), + u.default._validateParameters("texture", arguments), + e.gifProperties && e._animateGif(this), + (this._renderer.drawMode = n.TEXTURE), + (this._renderer._useNormalMaterial = !1), + (this._renderer._tex = e), + this._renderer._setProperty("_doFill", !0), + this + ); + }), + (u.default.prototype.textureMode = function (e) { + e !== n.IMAGE && e !== n.NORMAL + ? console.warn( + "You tried to set ".concat( + e, + " textureMode only supports IMAGE & NORMAL ", + ), + ) + : (this._renderer.textureMode = e); + }), + (u.default.prototype.textureWrap = function (e) { + var t = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : e, + r = + ((this._renderer.textureWrapX = e), + (this._renderer.textureWrapY = t), + !0), + o = !1, + n = void 0; + try { + for ( + var s, + i = this._renderer.textures.values()[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) + s.value.setWrapMode(e, t); + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + }), + (u.default.prototype.normalMaterial = function () { + this._assert3d("normalMaterial"); + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + return ( + u.default._validateParameters("normalMaterial", t), + (this._renderer.drawMode = n.FILL), + (this._renderer._useSpecularMaterial = !1), + (this._renderer._useEmissiveMaterial = !1), + (this._renderer._useNormalMaterial = !0), + (this._renderer.curFillColor = [1, 1, 1, 1]), + this._renderer._setProperty("_doFill", !0), + this.noStroke(), + this + ); + }), + (u.default.prototype.ambientMaterial = function (e, t, r) { + this._assert3d("ambientMaterial"), + u.default._validateParameters("ambientMaterial", arguments); + var o = u.default.prototype.color.apply(this, arguments); + return ( + (this._renderer._hasSetAmbient = !0), + (this._renderer.curAmbientColor = o._array), + (this._renderer._useNormalMaterial = !1), + (this._renderer._enableLighting = !0), + this._renderer._setProperty("_doFill", !0), + this + ); + }), + (u.default.prototype.emissiveMaterial = function (e, t, r, o) { + this._assert3d("emissiveMaterial"), + u.default._validateParameters("emissiveMaterial", arguments); + var n = u.default.prototype.color.apply(this, arguments); + return ( + (this._renderer.curEmissiveColor = n._array), + (this._renderer._useEmissiveMaterial = !0), + (this._renderer._useNormalMaterial = !1), + (this._renderer._enableLighting = !0), + this + ); + }), + (u.default.prototype.specularMaterial = function (e, t, r, o) { + this._assert3d("specularMaterial"), + u.default._validateParameters("specularMaterial", arguments); + var n = u.default.prototype.color.apply(this, arguments); + return ( + (this._renderer.curSpecularColor = n._array), + (this._renderer._useSpecularMaterial = !0), + (this._renderer._useNormalMaterial = !1), + (this._renderer._enableLighting = !0), + this + ); + }), + (u.default.prototype.shininess = function (e) { + return ( + this._assert3d("shininess"), + u.default._validateParameters("shininess", arguments), + (this._renderer._useShininess = e = e < 1 ? 1 : e), + this + ); + }), + (u.default.RendererGL.prototype._applyColorBlend = function (e) { + var t = this.GL, + r = this.drawMode === n.TEXTURE, + r = + this.userFillShader || + this.userStrokeShader || + this.userPointShader || + r || + this.curBlendMode !== n.BLEND || + e[e.length - 1] < 1 || + this._isErasing; + return ( + r !== this._isBlending && + (r || + (this.curBlendMode !== n.BLEND && this.curBlendMode !== n.ADD) + ? t.enable(t.BLEND) + : t.disable(t.BLEND), + t.depthMask(!0), + (this._isBlending = r)), + this._applyBlendMode(), + e + ); + }), + (u.default.RendererGL.prototype._applyBlendMode = function () { + if (this._cachedBlendMode !== this.curBlendMode) { + var e = this.GL; + switch (this.curBlendMode) { + case n.BLEND: + e.blendEquation(e.FUNC_ADD), + e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA); + break; + case n.ADD: + e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ONE); + break; + case n.REMOVE: + e.blendEquation(e.FUNC_ADD), + e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_ALPHA); + break; + case n.MULTIPLY: + e.blendEquation(e.FUNC_ADD), + e.blendFunc(e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA); + break; + case n.SCREEN: + e.blendEquation(e.FUNC_ADD), + e.blendFunc(e.ONE, e.ONE_MINUS_SRC_COLOR); + break; + case n.EXCLUSION: + e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), + e.blendFuncSeparate( + e.ONE_MINUS_DST_COLOR, + e.ONE_MINUS_SRC_COLOR, + e.ONE, + e.ONE, + ); + break; + case n.REPLACE: + e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO); + break; + case n.SUBTRACT: + e.blendEquationSeparate( + e.FUNC_REVERSE_SUBTRACT, + e.FUNC_ADD, + ), + e.blendFuncSeparate( + e.ONE, + e.ONE, + e.ONE, + e.ONE_MINUS_SRC_ALPHA, + ); + break; + case n.DARKEST: + this.blendExt + ? (e.blendEquationSeparate( + this.blendExt.MIN || this.blendExt.MIN_EXT, + e.FUNC_ADD, + ), + e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) + : console.warn( + "blendMode(DARKEST) does not work in your browser in WEBGL mode.", + ); + break; + case n.LIGHTEST: + this.blendExt + ? (e.blendEquationSeparate( + this.blendExt.MAX || this.blendExt.MAX_EXT, + e.FUNC_ADD, + ), + e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) + : console.warn( + "blendMode(LIGHTEST) does not work in your browser in WEBGL mode.", + ); + break; + default: + console.error( + "Oops! Somehow RendererGL set curBlendMode to an unsupported mode.", + ); + } + this._isErasing || (this._cachedBlendMode = this.curBlendMode); + } + }); + var s = u.default; + r.default = s; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.Texture": 334, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.join": 162, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 324: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.string.sub"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.hypot"), + e("core-js/modules/es.string.sub"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var _ = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + (_.default.prototype.camera = function () { + var e; + this._assert3d("camera"); + for (var t = arguments.length, r = new Array(t), o = 0; o < t; o++) + r[o] = arguments[o]; + return ( + _.default._validateParameters("camera", r), + (e = this._renderer._curCamera).camera.apply(e, r), + this + ); + }), + (_.default.prototype.perspective = function () { + var e; + this._assert3d("perspective"); + for ( + var t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + _.default._validateParameters("perspective", r), + (e = this._renderer._curCamera).perspective.apply(e, r), + this + ); + }), + (_.default.prototype.ortho = function () { + var e; + this._assert3d("ortho"); + for ( + var t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + _.default._validateParameters("ortho", r), + (e = this._renderer._curCamera).ortho.apply(e, r), + this + ); + }), + (_.default.prototype.frustum = function () { + var e; + this._assert3d("frustum"); + for ( + var t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + return ( + _.default._validateParameters("frustum", r), + (e = this._renderer._curCamera).frustum.apply(e, r), + this + ); + }), + (_.default.prototype.createCamera = function () { + this._assert3d("createCamera"); + var e = new _.default.Camera(this._renderer); + return ( + e._computeCameraDefaultSettings(), + e._setDefaultCamera(), + (this._renderer._curCamera = e) + ); + }), + (_.default.Camera = (function () { + function t(e) { + if (!(this instanceof t)) + throw new TypeError("Cannot call a class as a function"); + (this._renderer = e), + (this.cameraType = "default"), + (this.cameraMatrix = new _.default.Matrix()), + (this.projMatrix = new _.default.Matrix()), + (this.yScale = 1); + } + var e, r, o; + return ( + (e = t), + (r = [ + { + key: "perspective", + value: function (e, t, r, o) { + (this.cameraType = + 0 < arguments.length ? "custom" : "default"), + void 0 === e + ? ((e = this.defaultCameraFOV), (this.cameraFOV = e)) + : (this.cameraFOV = + this._renderer._pInst._toRadians(e)), + void 0 === t && (t = this.defaultAspectRatio), + void 0 === r && (r = this.defaultCameraNear), + void 0 === o && (o = this.defaultCameraFar), + r <= 1e-4 && + ((r = 0.01), + console.log( + "Avoid perspective near plane values close to or below 0. Setting value to 0.01.", + )), + o < r && + console.log( + "Perspective far plane value is less than near plane value. Nothing will be shown.", + ), + (this.aspectRatio = t), + (this.cameraNear = r), + (this.cameraFar = o), + (this.projMatrix = _.default.Matrix.identity()); + var e = 1 / Math.tan(this.cameraFOV / 2), + n = 1 / (this.cameraNear - this.cameraFar); + this.projMatrix.set( + e / t, + 0, + 0, + 0, + 0, + -e * this.yScale, + 0, + 0, + 0, + 0, + (o + r) * n, + -1, + 0, + 0, + 2 * o * r * n, + 0, + ), + this._isActive() && + this._renderer.uPMatrix.set( + this.projMatrix.mat4[0], + this.projMatrix.mat4[1], + this.projMatrix.mat4[2], + this.projMatrix.mat4[3], + this.projMatrix.mat4[4], + this.projMatrix.mat4[5], + this.projMatrix.mat4[6], + this.projMatrix.mat4[7], + this.projMatrix.mat4[8], + this.projMatrix.mat4[9], + this.projMatrix.mat4[10], + this.projMatrix.mat4[11], + this.projMatrix.mat4[12], + this.projMatrix.mat4[13], + this.projMatrix.mat4[14], + this.projMatrix.mat4[15], + ); + }, + }, + { + key: "ortho", + value: function (e, t, r, o, n, s) { + void 0 === e && (e = -this._renderer.width / 2), + void 0 === t && (t = +this._renderer.width / 2), + void 0 === r && (r = -this._renderer.height / 2), + void 0 === o && (o = +this._renderer.height / 2), + void 0 === n && (n = 0), + void 0 === s && + (s = Math.max( + this._renderer.width, + this._renderer.height, + )), + (this.cameraNear = n); + var i = t - e, + a = o - r, + l = (this.cameraFar = s) - n, + u = 2 / i, + c = (2 / a) * this.yScale, + d = -2 / l, + t = -(t + e) / i, + e = -(o + r) / a, + i = -(s + n) / l; + (this.projMatrix = _.default.Matrix.identity()), + this.projMatrix.set( + u, + 0, + 0, + 0, + 0, + -c, + 0, + 0, + 0, + 0, + d, + 0, + t, + e, + i, + 1, + ), + this._isActive() && + this._renderer.uPMatrix.set( + this.projMatrix.mat4[0], + this.projMatrix.mat4[1], + this.projMatrix.mat4[2], + this.projMatrix.mat4[3], + this.projMatrix.mat4[4], + this.projMatrix.mat4[5], + this.projMatrix.mat4[6], + this.projMatrix.mat4[7], + this.projMatrix.mat4[8], + this.projMatrix.mat4[9], + this.projMatrix.mat4[10], + this.projMatrix.mat4[11], + this.projMatrix.mat4[12], + this.projMatrix.mat4[13], + this.projMatrix.mat4[14], + this.projMatrix.mat4[15], + ), + (this.cameraType = "custom"); + }, + }, + { + key: "frustum", + value: function (e, t, r, o, n, s) { + void 0 === e && (e = 0.05 * -this._renderer.width), + void 0 === t && (t = 0.05 * +this._renderer.width), + void 0 === r && (r = 0.05 * +this._renderer.height), + void 0 === o && (o = 0.05 * -this._renderer.height), + void 0 === n && (n = this.defaultCameraNear), + void 0 === s && (s = this.defaultCameraFar), + (this.cameraNear = n); + var i = t - e, + a = o - r, + l = (this.cameraFar = s) - n, + u = (2 * n) / i, + c = ((2 * n) / a) * this.yScale, + d = (-2 * s * n) / l, + t = (t + e) / i, + e = (o + r) / a, + i = -(s + n) / l; + (this.projMatrix = _.default.Matrix.identity()), + this.projMatrix.set( + u, + 0, + 0, + 0, + 0, + -c, + 0, + 0, + t, + e, + i, + -1, + 0, + 0, + d, + 0, + ), + this._isActive() && + this._renderer.uPMatrix.set( + this.projMatrix.mat4[0], + this.projMatrix.mat4[1], + this.projMatrix.mat4[2], + this.projMatrix.mat4[3], + this.projMatrix.mat4[4], + this.projMatrix.mat4[5], + this.projMatrix.mat4[6], + this.projMatrix.mat4[7], + this.projMatrix.mat4[8], + this.projMatrix.mat4[9], + this.projMatrix.mat4[10], + this.projMatrix.mat4[11], + this.projMatrix.mat4[12], + this.projMatrix.mat4[13], + this.projMatrix.mat4[14], + this.projMatrix.mat4[15], + ), + (this.cameraType = "custom"); + }, + }, + { + key: "_rotateView", + value: function (e, t, r, o) { + var n = this.centerX, + s = this.centerY, + i = this.centerZ, + a = + ((n -= this.eyeX), + (s -= this.eyeY), + (i -= this.eyeZ), + _.default.Matrix.identity(this._renderer._pInst)), + e = + (a.rotate( + this._renderer._pInst._toRadians(e), + t, + r, + o, + ), + [ + n * a.mat4[0] + s * a.mat4[4] + i * a.mat4[8], + n * a.mat4[1] + s * a.mat4[5] + i * a.mat4[9], + n * a.mat4[2] + s * a.mat4[6] + i * a.mat4[10], + ]); + (e[0] += this.eyeX), + (e[1] += this.eyeY), + (e[2] += this.eyeZ), + this.camera( + this.eyeX, + this.eyeY, + this.eyeZ, + e[0], + e[1], + e[2], + this.upX, + this.upY, + this.upZ, + ); + }, + }, + { + key: "pan", + value: function (e) { + var t = this._getLocalAxes(); + this._rotateView(e, t.y[0], t.y[1], t.y[2]); + }, + }, + { + key: "tilt", + value: function (e) { + var t = this._getLocalAxes(); + this._rotateView(e, t.x[0], t.x[1], t.x[2]); + }, + }, + { + key: "lookAt", + value: function (e, t, r) { + this.camera( + this.eyeX, + this.eyeY, + this.eyeZ, + e, + t, + r, + this.upX, + this.upY, + this.upZ, + ); + }, + }, + { + key: "camera", + value: function (e, t, r, o, n, s, i, a, l) { + void 0 === e && + ((e = this.defaultEyeX), + (t = this.defaultEyeY), + (r = this.defaultEyeZ), + (o = e), + (n = t), + (a = 1), + (l = i = s = 0)), + (this.eyeX = e), + (this.eyeY = t), + (this.eyeZ = r), + void 0 !== o && + ((this.centerX = o), + (this.centerY = n), + (this.centerZ = s)), + void 0 !== i && + ((this.upX = i), (this.upY = a), (this.upZ = l)); + (o = this._getLocalAxes()), + this.cameraMatrix.set( + o.x[0], + o.y[0], + o.z[0], + 0, + o.x[1], + o.y[1], + o.z[1], + 0, + o.x[2], + o.y[2], + o.z[2], + 0, + 0, + 0, + 0, + 1, + ), + (n = -e); + return ( + this.cameraMatrix.translate([n, -t, -r]), + this._isActive() && + this._renderer.uMVMatrix.set( + this.cameraMatrix.mat4[0], + this.cameraMatrix.mat4[1], + this.cameraMatrix.mat4[2], + this.cameraMatrix.mat4[3], + this.cameraMatrix.mat4[4], + this.cameraMatrix.mat4[5], + this.cameraMatrix.mat4[6], + this.cameraMatrix.mat4[7], + this.cameraMatrix.mat4[8], + this.cameraMatrix.mat4[9], + this.cameraMatrix.mat4[10], + this.cameraMatrix.mat4[11], + this.cameraMatrix.mat4[12], + this.cameraMatrix.mat4[13], + this.cameraMatrix.mat4[14], + this.cameraMatrix.mat4[15], + ), + this + ); + }, + }, + { + key: "move", + value: function (e, t, r) { + var o = this._getLocalAxes(), + e = [o.x[0] * e, o.x[1] * e, o.x[2] * e], + t = [o.y[0] * t, o.y[1] * t, o.y[2] * t], + o = [o.z[0] * r, o.z[1] * r, o.z[2] * r]; + this.camera( + this.eyeX + e[0] + t[0] + o[0], + this.eyeY + e[1] + t[1] + o[1], + this.eyeZ + e[2] + t[2] + o[2], + this.centerX + e[0] + t[0] + o[0], + this.centerY + e[1] + t[1] + o[1], + this.centerZ + e[2] + t[2] + o[2], + this.upX, + this.upY, + this.upZ, + ); + }, + }, + { + key: "setPosition", + value: function (e, t, r) { + var o = e - this.eyeX, + n = t - this.eyeY, + s = r - this.eyeZ; + this.camera( + e, + t, + r, + this.centerX + o, + this.centerY + n, + this.centerZ + s, + this.upX, + this.upY, + this.upZ, + ); + }, + }, + { + key: "set", + value: function (e) { + for ( + var t = 0, + r = [ + "eyeX", + "eyeY", + "eyeZ", + "centerX", + "centerY", + "centerZ", + "upX", + "upY", + "upZ", + "cameraFOV", + "aspectRatio", + "cameraNear", + "cameraFar", + "cameraType", + "yScale", + ]; + t < r.length; + t++ + ) { + var o = r[t]; + this[o] = e[o]; + } + (this.cameraMatrix = e.cameraMatrix.copy()), + (this.projMatrix = e.projMatrix.copy()), + this._isActive() && + ((this._renderer.uMVMatrix.mat4 = + this.cameraMatrix.mat4.slice()), + (this._renderer.uPMatrix.mat4 = + this.projMatrix.mat4.slice())); + }, + }, + { + key: "slerp", + value: function (e, t, r) { + var o, n, s, i, a, l, u, c, d, h, f, p, m, y, g, v, b, j; + 0 === r + ? this.set(e) + : 1 === r + ? this.set(t) + : (0 !== this.projMatrix.mat4[15] && + ((this.projMatrix.mat4[0] = + e.projMatrix.mat4[0] * + Math.pow( + t.projMatrix.mat4[0] / e.projMatrix.mat4[0], + r, + )), + (this.projMatrix.mat4[5] = + e.projMatrix.mat4[5] * + Math.pow( + t.projMatrix.mat4[5] / e.projMatrix.mat4[5], + r, + )), + this._isActive() && + (this._renderer.uPMatrix.mat4 = + this.projMatrix.mat4.slice())), + (i = new _.default.Vector(e.eyeX, e.eyeY, e.eyeZ)), + (a = new _.default.Vector(t.eyeX, t.eyeY, t.eyeZ)), + (v = new _.default.Vector( + e.centerX, + e.centerY, + e.centerZ, + )), + (j = new _.default.Vector( + t.centerX, + t.centerY, + t.centerZ, + )), + (s = _.default.Vector.dist(i, v)), + (o = _.default.Vector.dist(a, j)), + (o = s * Math.pow(o / s, r)), + (s = _.default.Vector.sub(i, a)), + (n = 1), + 1e-6 < + (b = (y = i + .copy() + .sub(a) + .sub(v) + .add(j)).magSq()) && + ((n = _.default.Vector.dot(s, y) / b), + (n = Math.max(0, Math.min(n, 1)))), + (s = _.default.Vector.lerp( + _.default.Vector.lerp(i, v, n), + _.default.Vector.lerp(a, j, n), + r, + )), + (y = e.cameraMatrix.createSubMatrix3x3()), + (b = t.cameraMatrix.createSubMatrix3x3()), + (i = y.row(2)), + (v = b.row(2)), + (a = y.row(1)), + (j = b.row(1)), + (e = new _.default.Vector()), + (t = new _.default.Vector()), + (l = new _.default.Vector()), + (u = new _.default.Vector()), + 1 - + (c = + 0.5 * + ((y = (b = b.mult3x3( + y.copy().transpose3x3(), + )).diagonal())[0] + + y[1] + + y[2] - + 1)) < + 1e-7 + ? (e + .set(_.default.Vector.lerp(i, v, r)) + .normalize(), + l + .set(e) + .mult(n * o) + .add(s), + u + .set(e) + .mult((n - 1) * o) + .add(s), + t + .set(_.default.Vector.lerp(a, j, r)) + .normalize()) + : ((v = 1 / (1 - c)), + (j = Math.max(y[0], y[1], y[2])), + (p = b.mat3[1] + b.mat3[3]), + (m = b.mat3[2] + b.mat3[6]), + (g = b.mat3[5] + b.mat3[7]), + (j = + j === y[0] + ? ((h = + 0.5 * + p * + (v /= d = Math.sqrt((y[0] - c) * v))), + (f = 0.5 * m * v), + (0.5 * (b.mat3[7] - b.mat3[5])) / d) + : j === y[1] + ? ((f = + 0.5 * + g * + (v /= h = Math.sqrt((y[1] - c) * v))), + (d = 0.5 * p * v), + (0.5 * (b.mat3[2] - b.mat3[6])) / h) + : ((d = + 0.5 * + m * + (v /= f = Math.sqrt((y[2] - c) * v))), + (h = 0.5 * g * v), + (0.5 * (b.mat3[3] - b.mat3[1])) / f)), + (p = r * Math.atan2(j, c)), + (m = Math.cos(p)), + (y = Math.sin(p)), + (j = new _.default.Matrix("mat3", [ + m + (g = 1 - m) * d * d, + g * (v = d * h) + y * f, + g * (b = f * d) - y * h, + g * v - y * f, + m + g * h * h, + g * (r = h * f) + y * d, + g * b + y * h, + g * r - y * d, + m + g * f * f, + ])).multiplyVec3(i, e), + l + .set(e) + .mult(n * o) + .add(s), + u + .set(e) + .mult((n - 1) * o) + .add(s), + j.multiplyVec3(a, t)), + this.camera( + l.x, + l.y, + l.z, + u.x, + u.y, + u.z, + t.x, + t.y, + t.z, + )); + }, + }, + { + key: "_computeCameraDefaultSettings", + value: function () { + (this.defaultAspectRatio = + this._renderer.width / this._renderer.height), + (this.defaultEyeX = 0), + (this.defaultEyeY = 0), + (this.defaultEyeZ = 800), + (this.defaultCameraFOV = + 2 * + Math.atan( + this._renderer.height / 2 / this.defaultEyeZ, + )), + (this.defaultCenterX = 0), + (this.defaultCenterY = 0), + (this.defaultCenterZ = 0), + (this.defaultCameraNear = 0.1 * this.defaultEyeZ), + (this.defaultCameraFar = 10 * this.defaultEyeZ); + }, + }, + { + key: "_setDefaultCamera", + value: function () { + (this.cameraFOV = this.defaultCameraFOV), + (this.aspectRatio = this.defaultAspectRatio), + (this.eyeX = this.defaultEyeX), + (this.eyeY = this.defaultEyeY), + (this.eyeZ = this.defaultEyeZ), + (this.centerX = this.defaultCenterX), + (this.centerY = this.defaultCenterY), + (this.centerZ = this.defaultCenterZ), + (this.upX = 0), + (this.upY = 1), + (this.upZ = 0), + (this.cameraNear = this.defaultCameraNear), + (this.cameraFar = this.defaultCameraFar), + this.perspective(), + this.camera(), + (this.cameraType = "default"); + }, + }, + { + key: "_resize", + value: function () { + "default" === this.cameraType && + (this._computeCameraDefaultSettings(), + (this.cameraFOV = this.defaultCameraFOV), + (this.aspectRatio = this.defaultAspectRatio), + this.perspective()); + }, + }, + { + key: "copy", + value: function () { + var e = new _.default.Camera(this._renderer); + return ( + (e.cameraFOV = this.cameraFOV), + (e.aspectRatio = this.aspectRatio), + (e.eyeX = this.eyeX), + (e.eyeY = this.eyeY), + (e.eyeZ = this.eyeZ), + (e.centerX = this.centerX), + (e.centerY = this.centerY), + (e.centerZ = this.centerZ), + (e.upX = this.upX), + (e.upY = this.upY), + (e.upZ = this.upZ), + (e.cameraNear = this.cameraNear), + (e.cameraFar = this.cameraFar), + (e.cameraType = this.cameraType), + (e.cameraMatrix = this.cameraMatrix.copy()), + (e.projMatrix = this.projMatrix.copy()), + (e.yScale = this.yScale), + e + ); + }, + }, + { + key: "_getLocalAxes", + value: function () { + var e = this.eyeX - this.centerX, + t = this.eyeY - this.centerY, + r = this.eyeZ - this.centerZ, + o = Math.sqrt(e * e + t * t + r * r), + o = + (0 !== o && ((e /= o), (t /= o), (r /= o)), this.upX), + n = (a = this.upY) * r - (l = this.upZ) * t, + s = -o * r + l * e, + i = o * t - a * e, + o = t * i - r * s, + a = -e * i + r * n, + l = e * s - t * n, + u = Math.sqrt(n * n + s * s + i * i), + u = + (0 !== u && ((n /= u), (s /= u), (i /= u)), + Math.sqrt(o * o + a * a + l * l)); + return ( + 0 !== u && ((o /= u), (a /= u), (l /= u)), + { x: [n, s, i], y: [o, a, l], z: [e, t, r] } + ); + }, + }, + { + key: "_orbit", + value: function (e, t, r) { + var o = this.eyeX - this.centerX, + n = this.eyeY - this.centerY, + s = this.eyeZ - this.centerZ, + i = Math.hypot(o, n, s), + o = new _.default.Vector(o, n, s).normalize(), + n = new _.default.Vector( + this.upX, + this.upY, + this.upZ, + ).normalize(), + s = new _.default.Vector.cross(n, o).normalize(), + a = new _.default.Vector.cross(s, n), + r = + ((i = + (i *= Math.pow(10, r)) < this.cameraNear + ? this.cameraNear + : i) > this.cameraFar && (i = this.cameraFar), + Math.acos( + Math.max( + -1, + Math.min(1, _.default.Vector.dot(o, n)), + ), + ) + t), + t = e; + (r <= 0 || r >= Math.PI) && + ((this.upX *= -1), (this.upY *= -1), (this.upZ *= -1)), + n.mult(Math.cos(r)), + a.mult(Math.cos(t) * Math.sin(r)), + s.mult(Math.sin(t) * Math.sin(r)), + o.set(n).add(a).add(s), + (this.eyeX = i * o.x + this.centerX), + (this.eyeY = i * o.y + this.centerY), + (this.eyeZ = i * o.z + this.centerZ), + this.camera( + this.eyeX, + this.eyeY, + this.eyeZ, + this.centerX, + this.centerY, + this.centerZ, + this.upX, + this.upY, + this.upZ, + ); + }, + }, + { + key: "_orbitFree", + value: function (e, t, r) { + var o = this.eyeX - this.centerX, + n = this.eyeY - this.centerY, + s = this.eyeZ - this.centerZ, + i = Math.hypot(o, n, s), + o = new _.default.Vector(o, n, s).normalize(), + n = new _.default.Vector(this.upX, this.upY, this.upZ), + s = new _.default.Vector.cross(n, o).normalize(), + a = new _.default.Vector.cross(o, s), + l = Math.atan2(t, e), + l = + (a.mult(Math.sin(l)), + s.mult(Math.cos(l)).add(a), + Math.sqrt(e * e + t * t)), + a = new _.default.Vector.cross(o, s), + e = + ((i = + (i *= Math.pow(10, r)) < this.cameraNear + ? this.cameraNear + : i) > this.cameraFar && (i = this.cameraFar), + Math.cos(l)), + t = Math.sin(l), + r = n.dot(o), + l = n.dot(s), + u = r * e + l * t, + r = -r * t + l * e, + l = n.dot(a); + (n.x = u * o.x + r * s.x + l * a.x), + (n.y = u * o.y + r * s.y + l * a.y), + (n.z = u * o.z + r * s.z + l * a.z), + s.mult(-t), + o.mult(e).add(s).mult(i), + this.camera( + o.x + this.centerX, + o.y + this.centerY, + o.z + this.centerZ, + this.centerX, + this.centerY, + this.centerZ, + n.x, + n.y, + n.z, + ); + }, + }, + { + key: "_isActive", + value: function () { + return this === this._renderer._curCamera; + }, + }, + ]) && n(e.prototype, r), + o && n(e, o), + t + ); + })()), + (_.default.prototype.setCamera = function (e) { + (this._renderer._curCamera = e), + this._renderer.uPMatrix.set( + e.projMatrix.mat4[0], + e.projMatrix.mat4[1], + e.projMatrix.mat4[2], + e.projMatrix.mat4[3], + e.projMatrix.mat4[4], + e.projMatrix.mat4[5], + e.projMatrix.mat4[6], + e.projMatrix.mat4[7], + e.projMatrix.mat4[8], + e.projMatrix.mat4[9], + e.projMatrix.mat4[10], + e.projMatrix.mat4[11], + e.projMatrix.mat4[12], + e.projMatrix.mat4[13], + e.projMatrix.mat4[14], + e.projMatrix.mat4[15], + ); + }); + e = _.default.Camera; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.math.hypot": 170, + "core-js/modules/es.string.sub": 200, + }, + ], + 325: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.log2"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.math.log2"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + e.default.DataArray = (function () { + function o() { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : 128, + t = this, + r = o; + if (!(t instanceof r)) + throw new TypeError("Cannot call a class as a function"); + (this.length = 0), + (this.data = new Float32Array(e)), + (this.initialLength = e); + } + var e, t, r; + return ( + (e = o), + (t = [ + { + key: "dataArray", + value: function () { + return this.subArray(0, this.length); + }, + }, + { + key: "clear", + value: function () { + this.length = 0; + }, + }, + { + key: "rescale", + value: function () { + var e; + this.length < this.data.length / 2 && + ((e = 1 << Math.ceil(Math.log2(this.length))), + (e = new Float32Array(e)).set( + this.data.subarray(0, this.length), + 0, + ), + (this.data = e)); + }, + }, + { + key: "reset", + value: function () { + this.clear(), + (this.data = new Float32Array(this.initialLength)); + }, + }, + { + key: "push", + value: function () { + for ( + var e = arguments.length, t = new Array(e), r = 0; + r < e; + r++ + ) + t[r] = arguments[r]; + this.ensureLength(this.length + t.length), + this.data.set(t, this.length), + (this.length += t.length); + }, + }, + { + key: "slice", + value: function (e, t) { + return this.data.slice(e, Math.min(t, this.length)); + }, + }, + { + key: "subArray", + value: function (e, t) { + return this.data.subarray(e, Math.min(t, this.length)); + }, + }, + { + key: "ensureLength", + value: function (e) { + for (; this.data.length < e; ) { + var t = new Float32Array(2 * this.data.length); + t.set(this.data, 0), (this.data = t); + } + }, + }, + ]) && n(e.prototype, t), + r && n(e, r), + o + ); + })(); + e = e.default.DataArray; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.math.log2": 171, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.float32-array": 211, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + }, + ], + 326: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.reflect.get"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint8-clamped-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint8-clamped-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var f = (_ = e("../core/main")) && _.__esModule ? _ : { default: _ }, + a = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = l(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")), + n = e("./p5.Texture"), + p = e("./p5.RendererGL"); + function l() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (l = function () { + return e; + }), + e); + } + function u(e, t) { + return ( + (function (e) { + if (Array.isArray(e)) return e; + })(e) || + (function (e, t) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) { + var r = [], + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = e[Symbol.iterator](); + !(o = (i = a.next()).done) && + (r.push(i.value), !t || r.length !== t); + o = !0 + ); + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + return r; + } + })(e, t) || + (function () { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance", + ); + })() + ); + } + function s(e, t, r) { + return ( + t in e + ? Object.defineProperty(e, t, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (e[t] = r), + e + ); + } + function c(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + } + function d(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function h(e, t, r) { + t && d(e.prototype, t), r && d(e, r); + } + function m(e, t, r) { + return (m = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (e, t, r) { + var e = (function (e, t) { + for ( + ; + !Object.prototype.hasOwnProperty.call(e, t) && + null !== (e = v(e)); + + ); + return e; + })(e, t); + if (e) + return (e = Object.getOwnPropertyDescriptor(e, t)).get + ? e.get.call(r) + : e.value; + })(e, t, r || e); + } + function y(e, t) { + return (y = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function g(r) { + return function () { + var e, + t = v(r), + t = + ((e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = v(this).constructor), + Reflect.construct(t, arguments, e)) + : t.apply(this, arguments)), + this); + if (!e || ("object" !== i(e) && "function" != typeof e)) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return e; + }; + } + function v(e) { + return (v = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + var b = (function (e) { + var t = o; + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && y(t, e); + var r = g(o); + function o(e) { + var t; + return ( + c(this, o), + ((t = r.call(this, e.target._renderer)).fbo = e), + (t.yScale = -1), + t + ); + } + return ( + h(o, [ + { + key: "_computeCameraDefaultSettings", + value: function () { + m( + v(o.prototype), + "_computeCameraDefaultSettings", + this, + ).call(this), + (this.defaultAspectRatio = + this.fbo.width / this.fbo.height), + (this.defaultCameraFOV = + 2 * + Math.atan(this.fbo.height / 2 / this.defaultEyeZ)); + }, + }, + ]), + o + ); + })(f.default.Camera), + j = + ((f.default.FramebufferCamera = b), + (function () { + function r(e, t) { + c(this, r), (this.framebuffer = e), (this.property = t); + } + return ( + h(r, [ + { + key: "rawTexture", + value: function () { + return this.framebuffer[this.property]; + }, + }, + { + key: "width", + get: function () { + return ( + this.framebuffer.width * this.framebuffer.density + ); + }, + }, + { + key: "height", + get: function () { + return ( + this.framebuffer.height * this.framebuffer.density + ); + }, + }, + ]), + r + ); + })()), + _ = + ((f.default.FramebufferTexture = j), + (function () { + function o(e) { + var t = this, + r = + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : {}, + e = + (c(this, o), + (this.target = e), + this.target._renderer.framebuffers.add(this), + (this._isClipApplied = !1), + (this.pixels = []), + (this.format = r.format || a.UNSIGNED_BYTE), + (this.channels = + r.channels || + (e._renderer._pInst._glAttributes.alpha + ? a.RGBA + : a.RGB)), + (this.useDepth = void 0 === r.depth || r.depth), + (this.depthFormat = r.depthFormat || a.FLOAT), + (this.textureFiltering = r.textureFiltering || a.LINEAR), + void 0 === r.antialias + ? (this.antialiasSamples = e._renderer._pInst + ._glAttributes.antialias + ? 2 + : 0) + : "number" == typeof r.antialias + ? (this.antialiasSamples = r.antialias) + : (this.antialiasSamples = r.antialias ? 2 : 0), + (this.antialias = 0 < this.antialiasSamples), + this.antialias && + e.webglVersion !== a.WEBGL2 && + (console.warn( + "Antialiasing is unsupported in a WebGL 1 context", + ), + (this.antialias = !1)), + r.width && r.height + ? ((this.width = r.width), + (this.height = r.height), + (this.autoSized = !1)) + : ((void 0 === r.width) != (void 0 === r.height) && + console.warn( + "Please supply both width and height for a framebuffer to give it a size. Only one was given, so the framebuffer will match the size of its canvas.", + ), + (this.width = e.width), + (this.height = e.height), + (this.autoSized = !0)), + (this.density = r.density || e.pixelDensity()), + e._renderer.GL); + if ( + ((this.gl = e), + this._checkIfFormatsAvailable(), + r.stencil && + !this.useDepth && + console.warn( + "A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored.", + ), + (this.useStencil = + this.useDepth && (void 0 === r.stencil || r.stencil)), + (this.framebuffer = e.createFramebuffer()), + !this.framebuffer) + ) + throw new Error("Unable to create a framebuffer"); + if ( + this.antialias && + ((this.aaFramebuffer = e.createFramebuffer()), + !this.aaFramebuffer) + ) + throw new Error( + "Unable to create a framebuffer for antialiasing", + ); + this._recreateTextures(); + r = this.target._renderer._curCamera; + (this.defaultCamera = this.createCamera()), + (this.target._renderer._curCamera = r), + this.draw(function () { + return t.target.clear(); + }); + } + return ( + h(o, [ + { + key: "resize", + value: function (e, t) { + (this.autoSized = !1), + (this.width = e), + (this.height = t), + this._handleResize(); + }, + }, + { + key: "pixelDensity", + value: function (e) { + if (!e) return this.density; + (this.autoSized = !1), + (this.density = e), + this._handleResize(); + }, + }, + { + key: "autoSized", + value: function (e) { + if (void 0 === e) return this.autoSized; + (this.autoSized = e), this._handleResize(); + }, + }, + { + key: "_checkIfFormatsAvailable", + value: function () { + var e = this.gl, + e = + (this.useDepth && + this.target.webglVersion === a.WEBGL && + !e.getExtension("WEBGL_depth_texture") && + (console.warn( + "Unable to create depth textures in this environment. Falling back to a framebuffer without depth.", + ), + (this.useDepth = !1)), + this.useDepth && + this.target.webglVersion === a.WEBGL && + this.depthFormat === a.FLOAT && + (console.warn( + "FLOAT depth format is unavailable in WebGL 1. Defaulting to UNSIGNED_INT.", + ), + (this.depthFormat = a.UNSIGNED_INT)), + [a.UNSIGNED_BYTE, a.FLOAT, a.HALF_FLOAT].includes( + this.format, + ) || + (console.warn( + "Unknown Framebuffer format. Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. Defaulting to UNSIGNED_BYTE.", + ), + (this.format = a.UNSIGNED_BYTE)), + this.useDepth && + ![a.UNSIGNED_INT, a.FLOAT].includes( + this.depthFormat, + ) && + (console.warn( + "Unknown Framebuffer depth format. Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT.", + ), + (this.depthFormat = a.FLOAT)), + (0, n.checkWebGLCapabilities)( + this.target._renderer, + )); + e.float || + this.format !== a.FLOAT || + (console.warn( + "This environment does not support FLOAT textures. Falling back to UNSIGNED_BYTE.", + ), + (this.format = a.UNSIGNED_BYTE)), + this.useDepth && + !e.float && + this.depthFormat === a.FLOAT && + (console.warn( + "This environment does not support FLOAT depth textures. Falling back to UNSIGNED_INT.", + ), + (this.depthFormat = a.UNSIGNED_INT)), + e.halfFloat || + this.format !== a.HALF_FLOAT || + (console.warn( + "This environment does not support HALF_FLOAT textures. Falling back to UNSIGNED_BYTE.", + ), + (this.format = a.UNSIGNED_BYTE)), + this.channels === a.RGB && + [a.FLOAT, a.HALF_FLOAT].includes(this.format) && + (console.warn( + "FLOAT and HALF_FLOAT formats do not work cross-platform with only RGB channels. Falling back to RGBA.", + ), + (this.channels = a.RGBA)); + }, + }, + { + key: "_recreateTextures", + value: function () { + var e = this.gl, + t = + (this._updateSize(), + e.getParameter(e.TEXTURE_BINDING_2D)), + r = e.getParameter(e.FRAMEBUFFER_BINDING), + o = e.createTexture(); + if (!o) + throw new Error("Unable to create color texture"); + e.bindTexture(e.TEXTURE_2D, o); + var n = this._glColorFormat(); + if ( + (e.texImage2D( + e.TEXTURE_2D, + 0, + n.internalFormat, + this.width * this.density, + this.height * this.density, + 0, + n.format, + n.type, + null, + ), + (this.colorTexture = o), + e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer), + e.framebufferTexture2D( + e.FRAMEBUFFER, + e.COLOR_ATTACHMENT0, + e.TEXTURE_2D, + o, + 0, + ), + this.useDepth) + ) { + var o = e.createTexture(); + if (!o) + throw new Error("Unable to create depth texture"); + var s = this._glDepthFormat(); + e.bindTexture(e.TEXTURE_2D, o), + e.texImage2D( + e.TEXTURE_2D, + 0, + s.internalFormat, + this.width * this.density, + this.height * this.density, + 0, + s.format, + s.type, + null, + ), + e.framebufferTexture2D( + e.FRAMEBUFFER, + this.useStencil + ? e.DEPTH_STENCIL_ATTACHMENT + : e.DEPTH_ATTACHMENT, + e.TEXTURE_2D, + o, + 0, + ), + (this.depthTexture = o); + } + this.antialias && + ((this.colorRenderbuffer = e.createRenderbuffer()), + e.bindRenderbuffer( + e.RENDERBUFFER, + this.colorRenderbuffer, + ), + e.renderbufferStorageMultisample( + e.RENDERBUFFER, + Math.max( + 0, + Math.min( + this.antialiasSamples, + e.getParameter(e.MAX_SAMPLES), + ), + ), + n.internalFormat, + this.width * this.density, + this.height * this.density, + ), + this.useDepth && + ((s = this._glDepthFormat()), + (this.depthRenderbuffer = e.createRenderbuffer()), + e.bindRenderbuffer( + e.RENDERBUFFER, + this.depthRenderbuffer, + ), + e.renderbufferStorageMultisample( + e.RENDERBUFFER, + Math.max( + 0, + Math.min( + this.antialiasSamples, + e.getParameter(e.MAX_SAMPLES), + ), + ), + s.internalFormat, + this.width * this.density, + this.height * this.density, + )), + e.bindFramebuffer(e.FRAMEBUFFER, this.aaFramebuffer), + e.framebufferRenderbuffer( + e.FRAMEBUFFER, + e.COLOR_ATTACHMENT0, + e.RENDERBUFFER, + this.colorRenderbuffer, + ), + this.useDepth && + e.framebufferRenderbuffer( + e.FRAMEBUFFER, + this.useStencil + ? e.DEPTH_STENCIL_ATTACHMENT + : e.DEPTH_ATTACHMENT, + e.RENDERBUFFER, + this.depthRenderbuffer, + )), + this.useDepth && + ((this.depth = new j(this, "depthTexture")), + (o = e.NEAREST), + (this.depthP5Texture = new f.default.Texture( + this.target._renderer, + this.depth, + { minFilter: o, magFilter: o }, + )), + this.target._renderer.textures.set( + this.depth, + this.depthP5Texture, + )), + (this.color = new j(this, "colorTexture")); + n = + this.textureFiltering === a.LINEAR + ? e.LINEAR + : e.NEAREST; + (this.colorP5Texture = new f.default.Texture( + this.target._renderer, + this.color, + { minFilter: n, magFilter: n }, + )), + this.target._renderer.textures.set( + this.color, + this.colorP5Texture, + ), + e.bindTexture(e.TEXTURE_2D, t), + e.bindFramebuffer(e.FRAMEBUFFER, r); + }, + }, + { + key: "_glColorFormat", + value: function () { + var e, + t, + r = this.gl, + o = + this.format === a.FLOAT + ? r.FLOAT + : this.format === a.HALF_FLOAT + ? this.target.webglVersion === a.WEBGL2 + ? r.HALF_FLOAT + : r.getExtension("OES_texture_half_float") + .HALF_FLOAT_OES + : r.UNSIGNED_BYTE, + n = this.channels === a.RGBA ? r.RGBA : r.RGB; + return { + internalFormat: + this.target.webglVersion === a.WEBGL2 + ? (s((t = {}), r.FLOAT, s({}, r.RGBA, r.RGBA32F)), + s(t, r.HALF_FLOAT, s({}, r.RGBA, r.RGBA16F)), + s( + t, + r.UNSIGNED_BYTE, + (s((e = {}), r.RGBA, r.RGBA8), + s(e, r.RGB, r.RGB8), + e), + ), + t[o][n]) + : this.format === a.HALF_FLOAT + ? r.RGBA + : n, + format: n, + type: o, + }; + }, + }, + { + key: "_glDepthFormat", + value: function () { + var e = this.gl, + t = this.useStencil + ? this.depthFormat === a.FLOAT + ? e.FLOAT_32_UNSIGNED_INT_24_8_REV + : this.target.webglVersion === a.WEBGL2 + ? e.UNSIGNED_INT_24_8 + : e.getExtension("WEBGL_depth_texture") + .UNSIGNED_INT_24_8_WEBGL + : this.depthFormat === a.FLOAT + ? e.FLOAT + : e.UNSIGNED_INT, + r = this.useStencil + ? e.DEPTH_STENCIL + : e.DEPTH_COMPONENT, + e = this.useStencil + ? this.depthFormat === a.FLOAT + ? e.DEPTH32F_STENCIL8 + : this.target.webglVersion === a.WEBGL2 + ? e.DEPTH24_STENCIL8 + : e.DEPTH_STENCIL + : this.target.webglVersion === a.WEBGL2 + ? this.depthFormat === a.FLOAT + ? e.DEPTH_COMPONENT32F + : e.DEPTH_COMPONENT24 + : e.DEPTH_COMPONENT; + return { internalFormat: e, format: r, type: t }; + }, + }, + { + key: "_updateSize", + value: function () { + this.autoSized && + ((this.width = this.target.width), + (this.height = this.target.height), + (this.density = this.target.pixelDensity())); + }, + }, + { + key: "_canvasSizeChanged", + value: function () { + this.autoSized && this._handleResize(); + }, + }, + { + key: "_handleResize", + value: function () { + var e = this.color, + t = this.depth, + r = this.colorRenderbuffer, + o = this.depthRenderbuffer, + e = + (this._deleteTexture(e), + t && this._deleteTexture(t), + this.gl); + r && e.deleteRenderbuffer(r), + o && e.deleteRenderbuffer(o), + this._recreateTextures(), + this.defaultCamera._resize(); + }, + }, + { + key: "createCamera", + value: function () { + var e = new b(this); + return ( + e._computeCameraDefaultSettings(), + e._setDefaultCamera(), + (this.target._renderer._curCamera = e) + ); + }, + }, + { + key: "_deleteTexture", + value: function (e) { + this.gl.deleteTexture(e.rawTexture()), + this.target._renderer.textures.delete(e); + }, + }, + { + key: "remove", + value: function () { + var e = this.gl; + this._deleteTexture(this.color), + this.depth && this._deleteTexture(this.depth), + e.deleteFramebuffer(this.framebuffer), + this.aaFramebuffer && + e.deleteFramebuffer(this.aaFramebuffer), + this.depthRenderbuffer && + e.deleteRenderbuffer(this.depthRenderbuffer), + this.colorRenderbuffer && + e.deleteRenderbuffer(this.colorRenderbuffer), + this.target._renderer.framebuffers.delete(this); + }, + }, + { + key: "begin", + value: function () { + (this.prevFramebuffer = + this.target._renderer.activeFramebuffer()), + this.prevFramebuffer && + this.prevFramebuffer._beforeEnd(), + this.target._renderer.activeFramebuffers.push(this), + this._beforeBegin(), + this.target.push(), + this.target.setCamera(this.defaultCamera), + this.target._renderer.uMVMatrix.set( + this.target._renderer._curCamera.cameraMatrix + .mat4[0], + this.target._renderer._curCamera.cameraMatrix + .mat4[1], + this.target._renderer._curCamera.cameraMatrix + .mat4[2], + this.target._renderer._curCamera.cameraMatrix + .mat4[3], + this.target._renderer._curCamera.cameraMatrix + .mat4[4], + this.target._renderer._curCamera.cameraMatrix + .mat4[5], + this.target._renderer._curCamera.cameraMatrix + .mat4[6], + this.target._renderer._curCamera.cameraMatrix + .mat4[7], + this.target._renderer._curCamera.cameraMatrix + .mat4[8], + this.target._renderer._curCamera.cameraMatrix + .mat4[9], + this.target._renderer._curCamera.cameraMatrix + .mat4[10], + this.target._renderer._curCamera.cameraMatrix + .mat4[11], + this.target._renderer._curCamera.cameraMatrix + .mat4[12], + this.target._renderer._curCamera.cameraMatrix + .mat4[13], + this.target._renderer._curCamera.cameraMatrix + .mat4[14], + this.target._renderer._curCamera.cameraMatrix + .mat4[15], + ); + }, + }, + { + key: "_framebufferToBind", + value: function () { + return this.antialias + ? this.aaFramebuffer + : this.framebuffer; + }, + }, + { + key: "_beforeBegin", + value: function () { + var e = this.gl; + e.bindFramebuffer( + e.FRAMEBUFFER, + this._framebufferToBind(), + ), + this.target._renderer.viewport( + this.width * this.density, + this.height * this.density, + ); + }, + }, + { + key: "_beforeEnd", + value: function () { + if (this.antialias) { + var e = this.gl, + t = + (e.bindFramebuffer( + e.READ_FRAMEBUFFER, + this.aaFramebuffer, + ), + e.bindFramebuffer( + e.DRAW_FRAMEBUFFER, + this.framebuffer, + ), + [ + [ + e.COLOR_BUFFER_BIT, + this.colorP5Texture.glMagFilter, + ], + ]); + this.useDepth && + t.push([ + e.DEPTH_BUFFER_BIT, + this.depthP5Texture.glMagFilter, + ]); + for (var r = 0, o = t; r < o.length; r++) { + var n = u(o[r], 2), + s = n[0], + n = n[1]; + e.blitFramebuffer( + 0, + 0, + this.width * this.density, + this.height * this.density, + 0, + 0, + this.width * this.density, + this.height * this.density, + s, + n, + ); + } + } + }, + }, + { + key: "end", + value: function () { + var e = this.gl; + if ( + (this.target.pop(), + this.target._renderer.activeFramebuffers.pop() !== + this) + ) + throw new Error( + "It looks like you've called end() while another Framebuffer is active.", + ); + this._beforeEnd(), + this.prevFramebuffer + ? this.prevFramebuffer._beforeBegin() + : (e.bindFramebuffer(e.FRAMEBUFFER, null), + this.target._renderer.viewport( + this.target._renderer._origViewport.width, + this.target._renderer._origViewport.height, + )), + this.target._renderer._applyStencilTestIfClipping(); + }, + }, + { + key: "draw", + value: function (e) { + this.begin(), e(), this.end(); + }, + }, + { + key: "loadPixels", + value: function () { + var e = this.gl, + t = this.target._renderer.activeFramebuffer(), + r = + (e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer), + this._glColorFormat()); + (this.pixels = (0, p.readPixelsWebGL)( + this.pixels, + e, + this.framebuffer, + 0, + 0, + this.width * this.density, + this.height * this.density, + r.format, + r.type, + )), + t + ? e.bindFramebuffer( + e.FRAMEBUFFER, + t._framebufferToBind(), + ) + : e.bindFramebuffer(e.FRAMEBUFFER, null); + }, + }, + { + key: "get", + value: function (e, t, r, o) { + f.default._validateParameters( + "p5.Framebuffer.get", + arguments, + ); + var n = this._glColorFormat(); + if (void 0 === e && void 0 === t) + (t = e = 0), (r = this.width), (o = this.height); + else if (void 0 === r && void 0 === o) + return ( + (e < 0 || + t < 0 || + e >= this.width || + t >= this.height) && + (console.warn( + "The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped.", + ), + (e = this.target.constrain(e, 0, this.width - 1)), + (t = this.target.constrain( + t, + 0, + this.height - 1, + ))), + (0, p.readPixelWebGL)( + this.gl, + this.framebuffer, + e * this.density, + t * this.density, + n.format, + n.type, + ) + ); + (e = this.target.constrain(e, 0, this.width - 1)), + (t = this.target.constrain(t, 0, this.height - 1)), + (r = this.target.constrain(r, 1, this.width - e)), + (o = this.target.constrain(o, 1, this.height - t)); + for ( + var s = (0, p.readPixelsWebGL)( + void 0, + this.gl, + this.framebuffer, + e * this.density, + t * this.density, + r * this.density, + o * this.density, + n.format, + n.type, + ), + i = new Uint8ClampedArray( + r * o * this.density * this.density * 4, + ), + a = (i.fill(255), n.type === this.gl.RGB ? 3 : 4), + l = 0; + l < o * this.density; + l++ + ) + for (var u = 0; u < r * this.density; u++) + for (var c = 0; c < 4; c++) { + var d, + h = 4 * (l * r * this.density + u) + c; + c < a && + ((d = + 4 == a + ? h + : (l * r * this.density + u) * a + c), + (i[h] = s[d])); + } + e = new f.default.Image( + r * this.density, + o * this.density, + ); + return ( + (e.imageData = e.canvas + .getContext("2d") + .createImageData(e.width, e.height)), + e.imageData.data.set(i), + (e.pixels = e.imageData.data), + e.updatePixels(), + 1 !== this.density && e.resize(r, o), + e + ); + }, + }, + { + key: "updatePixels", + value: function () { + var e = this.gl, + t = + (this.colorP5Texture.bindTexture(), + this._glColorFormat()), + r = t.format === e.RGBA ? 4 : 3, + r = + this.width * + this.height * + this.density * + this.density * + r, + o = + t.type === e.UNSIGNED_BYTE + ? Uint8Array + : Float32Array; + if ( + !(this.pixels instanceof o) || + this.pixels.length !== r + ) + throw new Error( + "The pixels array has not been set correctly. Please call loadPixels() before updatePixels().", + ); + e.texImage2D( + e.TEXTURE_2D, + 0, + t.internalFormat, + this.width * this.density, + this.height * this.density, + 0, + t.format, + t.type, + this.pixels, + ), + this.colorP5Texture.unbindTexture(); + o = this.target._renderer.activeFramebuffer(); + this.antialias + ? (this.begin(), + this.target.push(), + this.target.imageMode(this.target.CENTER), + this.target.resetMatrix(), + this.target.noStroke(), + this.target.clear(), + this.target.image(this, 0, 0), + this.target.pop(), + this.useDepth && + (e.clearDepth(1), e.clear(e.DEPTH_BUFFER_BIT)), + this.end()) + : (e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer), + this.useDepth && + (e.clearDepth(1), e.clear(e.DEPTH_BUFFER_BIT)), + o + ? e.bindFramebuffer( + e.FRAMEBUFFER, + o._framebufferToBind(), + ) + : e.bindFramebuffer(e.FRAMEBUFFER, null)); + }, + }, + ]), + o + ); + })()), + e = (f.default.Framebuffer = _); + r.default = e; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.RendererGL": 332, + "./p5.Texture": 334, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.reflect.get": 185, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.float32-array": 211, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/es.typed-array.uint8-clamped-array": 235, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 327: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.map"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.sub"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.for-each"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.map"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.sub"), + e("core-js/modules/web.dom-collections.for-each"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var m = (s = e("../core/main")) && s.__esModule ? s : { default: s }, + y = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function c(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + m.default.Geometry = (function () { + function o(e, t, r) { + if (this instanceof o) + return ( + (this.vertices = []), + (this.lineVertices = new m.default.DataArray()), + (this.lineTangentsIn = new m.default.DataArray()), + (this.lineTangentsOut = new m.default.DataArray()), + (this.lineSides = new m.default.DataArray()), + (this.vertexNormals = []), + (this.faces = []), + (this.uvs = []), + (this.edges = []), + (this.vertexColors = []), + (this.vertexStrokeColors = []), + (this.lineVertexColors = new m.default.DataArray()), + (this.detailX = void 0 !== e ? e : 1), + (this.detailY = void 0 !== t ? t : 1), + (this.dirtyFlags = {}), + r instanceof Function && r.call(this), + this + ); + throw new TypeError("Cannot call a class as a function"); + } + var e, t, r; + return ( + (e = o), + (t = [ + { + key: "reset", + value: function () { + this.lineVertices.clear(), + this.lineTangentsIn.clear(), + this.lineTangentsOut.clear(), + this.lineSides.clear(), + (this.vertices.length = 0), + (this.edges.length = 0), + (this.vertexColors.length = 0), + (this.vertexStrokeColors.length = 0), + this.lineVertexColors.clear(), + (this.vertexNormals.length = 0), + (this.uvs.length = 0), + (this.dirtyFlags = {}); + }, + }, + { + key: "clearColors", + value: function () { + return (this.vertexColors = []), this; + }, + }, + { + key: "computeFaces", + value: function () { + this.faces.length = 0; + for ( + var e, t, r, o = this.detailX + 1, n = 0; + n < this.detailY; + n++ + ) + for (var s = 0; s < this.detailX; s++) + (t = (n + 1) * o + s + 1), + this.faces.push([ + n * o + s, + (e = n * o + s + 1), + (r = (n + 1) * o + s), + ]), + this.faces.push([r, e, t]); + return this; + }, + }, + { + key: "_getFaceNormal", + value: function (e) { + var e = this.faces[e], + t = this.vertices[e[0]], + r = this.vertices[e[1]], + e = this.vertices[e[2]], + r = m.default.Vector.sub(r, t), + e = m.default.Vector.sub(e, t), + t = m.default.Vector.cross(r, e), + o = m.default.Vector.mag(t), + r = + o / (m.default.Vector.mag(r) * m.default.Vector.mag(e)); + return 0 === r || isNaN(r) + ? (console.warn( + "p5.Geometry.prototype._getFaceNormal:", + "face has colinear sides or a repeated vertex", + ), + t) + : (1 < r && (r = 1), t.mult(Math.asin(r) / o)); + }, + }, + { + key: "computeNormals", + value: function () { + var e, + s = this, + t = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : y.FLAT, + r = ( + 1 < arguments.length && void 0 !== arguments[1] + ? arguments[1] + : {} + ).roundToPrecision, + i = this.vertexNormals, + o = this.vertices, + n = this.faces; + if (t === y.SMOOTH) { + for ( + var a = {}, + l = [], + u = Math.pow(10, void 0 === r ? 3 : r), + c = function (e) { + return Math.round(e * u) / u; + }, + d = function (e) { + return "" + .concat(c(e.x), ",") + .concat(c(e.y), ",") + .concat(c(e.z)); + }, + h = 0; + h < o.length; + h++ + ) { + var f = o[h], + p = d(f); + void 0 === a[p] && ((a[p] = l.length), l.push(f)); + } + n.forEach(function (e) { + for (var t = 0; t < 3; ++t) { + var r = e[t], + r = o[r], + r = d(r); + e[t] = a[r]; + } + }), + this.edges.forEach(function (e) { + for (var t = 0; t < 2; ++t) { + var r = e[t], + r = o[r], + r = d(r); + e[t] = a[r]; + } + }), + (this.vertices = o = l); + } + for (e = i.length = 0; e < o.length; ++e) + i.push(new m.default.Vector()); + for ( + n.forEach(function (e, t) { + for (var r = s._getFaceNormal(t), o = 0; o < 3; ++o) { + var n = e[o]; + i[n].add(r); + } + }), + e = 0; + e < o.length; + ++e + ) + i[e].normalize(); + return this; + }, + }, + { + key: "averageNormals", + value: function () { + for (var e = 0; e <= this.detailY; e++) { + var t = this.detailX + 1, + r = m.default.Vector.add( + this.vertexNormals[e * t], + this.vertexNormals[e * t + this.detailX], + ), + r = m.default.Vector.div(r, 2); + (this.vertexNormals[e * t] = r), + (this.vertexNormals[e * t + this.detailX] = r); + } + return this; + }, + }, + { + key: "averagePoleNormals", + value: function () { + for ( + var e = new m.default.Vector(0, 0, 0), t = 0; + t < this.detailX; + t++ + ) + e.add(this.vertexNormals[t]); + for ( + var e = m.default.Vector.div(e, this.detailX), r = 0; + r < this.detailX; + r++ + ) + this.vertexNormals[r] = e; + e = new m.default.Vector(0, 0, 0); + for ( + var o = this.vertices.length - 1; + o > this.vertices.length - 1 - this.detailX; + o-- + ) + e.add(this.vertexNormals[o]); + e = m.default.Vector.div(e, this.detailX); + for ( + var n = this.vertices.length - 1; + n > this.vertices.length - 1 - this.detailX; + n-- + ) + this.vertexNormals[n] = e; + return this; + }, + }, + { + key: "_makeTriangleEdges", + value: function () { + for ( + var e = (this.edges.length = 0); + e < this.faces.length; + e++ + ) + this.edges.push([this.faces[e][0], this.faces[e][1]]), + this.edges.push([this.faces[e][1], this.faces[e][2]]), + this.edges.push([this.faces[e][2], this.faces[e][0]]); + return this; + }, + }, + { + key: "_edgesToVertices", + value: function () { + this.lineVertices.clear(), + this.lineTangentsIn.clear(), + this.lineTangentsOut.clear(), + this.lineSides.clear(); + for ( + var e, t = new Map(), r = new Set(), o = 0; + o < this.edges.length; + o++ + ) { + var n, + s = this.edges[o - 1], + i = this.edges[o], + a = this.vertices[i[0]], + l = this.vertices[i[1]], + u = + 0 < this.vertexStrokeColors.length + ? this.vertexStrokeColors.slice( + 4 * i[0], + 4 * (i[0] + 1), + ) + : [0, 0, 0, 0], + c = + 0 < this.vertexStrokeColors.length + ? this.vertexStrokeColors.slice( + 4 * i[1], + 4 * (i[1] + 1), + ) + : [0, 0, 0, 0], + d = l.copy().sub(a).normalize(), + h = 0 < d.magSq(); + h && this._addSegment(a, l, u, c, d), + 0 < o && s[1] === i[0] + ? r.has(i[0]) || + (r.add(i[0]), + t.delete(i[0]), + e && + h && + d.dot(e) < 1 - 1e-8 && + this._addJoin(a, e, d, u)) + : (h && + !r.has(i[0]) && + ((n = t.get(i[0])) + ? (this._addJoin(a, n.dir, d, u), + t.delete(i[0]), + r.add(i[0])) + : t.set(i[0], { + point: a, + dir: d.copy().mult(-1), + color: u, + })), + e && + !r.has(s[1]) && + ((n = t.get(s[1])) + ? (this._addJoin( + this.vertices[s[1]], + e, + n.dir.copy().mult(-1), + u, + ), + t.delete(s[1]), + r.add(s[1])) + : t.set(s[1], { + point: this.vertices[s[1]], + dir: e, + color: u, + }), + (e = void 0))), + o !== this.edges.length - 1 || + r.has(i[1]) || + ((a = t.get(i[1])) + ? (this._addJoin(l, d, a.dir.copy().mult(-1), c), + t.delete(i[1]), + r.add(i[1])) + : t.set(i[1], { point: l, dir: d, color: c })), + h && (e = d); + } + var f = !0, + p = !1, + m = void 0; + try { + for ( + var y, g = t.values()[Symbol.iterator](); + !(f = (y = g.next()).done); + f = !0 + ) { + var v = y.value, + b = v.point, + j = v.dir, + _ = v.color; + this._addCap(b, j, _); + } + } catch (e) { + (p = !0), (m = e); + } finally { + try { + f || null == g.return || g.return(); + } finally { + if (p) throw m; + } + } + return this; + }, + }, + { + key: "_addSegment", + value: function (e, t, r, o, n) { + var e = e.array(), + t = t.array(), + s = n.array(); + this.lineSides.push(1, 1, -1, 1, -1, -1); + for ( + var i = 0, + a = [this.lineTangentsIn, this.lineTangentsOut]; + i < a.length; + i++ + ) + for (var l = a[i], u = 0; u < 6; u++) + l.push.apply(l, c(s)); + return ( + (n = this.lineVertices).push.apply( + n, + c(e).concat(c(t), c(e), c(t), c(t), c(e)), + ), + (n = this.lineVertexColors).push.apply( + n, + c(r).concat(c(o), c(r), c(o), c(o), c(r)), + ), + this + ); + }, + }, + { + key: "_addCap", + value: function (e, t, r) { + for ( + var o, n = e.array(), s = t.array(), i = [0, 0, 0], a = 0; + a < 6; + a++ + ) + (o = this.lineVertices).push.apply(o, c(n)), + (o = this.lineTangentsIn).push.apply(o, c(s)), + (o = this.lineTangentsOut).push.apply(o, i), + (o = this.lineVertexColors).push.apply(o, c(r)); + return this.lineSides.push(-1, 2, -2, 1, 2, -1), this; + }, + }, + { + key: "_addJoin", + value: function (e, t, r, o) { + for ( + var n, s = e.array(), i = t.array(), a = r.array(), l = 0; + l < 12; + l++ + ) + (n = this.lineVertices).push.apply(n, c(s)), + (n = this.lineTangentsIn).push.apply(n, c(i)), + (n = this.lineTangentsOut).push.apply(n, c(a)), + (n = this.lineVertexColors).push.apply(n, c(o)); + return ( + this.lineSides.push(-1, -3, -2, -1, 0, -3), + this.lineSides.push(3, 1, 2, 3, 0, 1), + this + ); + }, + }, + { + key: "normalize", + value: function () { + if (0 < this.vertices.length) { + for ( + var e = this.vertices[0].copy(), + t = this.vertices[0].copy(), + r = 0; + r < this.vertices.length; + r++ + ) + (e.x = Math.max(e.x, this.vertices[r].x)), + (t.x = Math.min(t.x, this.vertices[r].x)), + (e.y = Math.max(e.y, this.vertices[r].y)), + (t.y = Math.min(t.y, this.vertices[r].y)), + (e.z = Math.max(e.z, this.vertices[r].z)), + (t.z = Math.min(t.z, this.vertices[r].z)); + for ( + var o = m.default.Vector.lerp(e, t, 0.5), + n = m.default.Vector.sub(e, t), + s = 200 / Math.max(Math.max(n.x, n.y), n.z), + i = 0; + i < this.vertices.length; + i++ + ) + this.vertices[i].sub(o), this.vertices[i].mult(s); + } + return this; + }, + }, + ]) && n(e.prototype, t), + r && n(e, r), + o + ); + })(); + var s = m.default.Geometry; + r.default = s; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.for-each": 157, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.map": 169, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.set": 189, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.sub": 200, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.for-each": 237, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 328: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var C = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + var s = Array, + O = function (e) { + return Array.isArray(e); + }, + e = + ("undefined" != typeof Float32Array && + ((s = Float32Array), + (O = function (e) { + return Array.isArray(e) || e instanceof Float32Array; + })), + (C.default.Matrix = (function () { + function r() { + var e = this, + t = r; + if (e instanceof t) + return ( + arguments.length && + ((e = arguments.length - 1) < 0 || arguments.length <= e + ? void 0 + : arguments[e]) instanceof C.default && + (this.p5 = + (t = arguments.length - 1) < 0 || + arguments.length <= t + ? void 0 + : arguments[t]), + "mat3" === (arguments.length <= 0 ? void 0 : arguments[0]) + ? (this.mat3 = Array.isArray( + arguments.length <= 1 ? void 0 : arguments[1], + ) + ? arguments.length <= 1 + ? void 0 + : arguments[1] + : new s([1, 0, 0, 0, 1, 0, 0, 0, 1])) + : (this.mat4 = Array.isArray( + arguments.length <= 0 ? void 0 : arguments[0], + ) + ? arguments.length <= 0 + ? void 0 + : arguments[0] + : new s([ + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, + ])), + this + ); + throw new TypeError("Cannot call a class as a function"); + } + var e, t, o; + return ( + (e = r), + (o = [ + { + key: "identity", + value: function (e) { + return new C.default.Matrix(e); + }, + }, + ]), + (t = [ + { + key: "set", + value: function (e) { + return ( + e instanceof C.default.Matrix + ? (this.mat4 = e.mat4) + : O(e) + ? (this.mat4 = e) + : 16 === arguments.length && + ((this.mat4[0] = e), + (this.mat4[1] = arguments[1]), + (this.mat4[2] = arguments[2]), + (this.mat4[3] = arguments[3]), + (this.mat4[4] = arguments[4]), + (this.mat4[5] = arguments[5]), + (this.mat4[6] = arguments[6]), + (this.mat4[7] = arguments[7]), + (this.mat4[8] = arguments[8]), + (this.mat4[9] = arguments[9]), + (this.mat4[10] = arguments[10]), + (this.mat4[11] = arguments[11]), + (this.mat4[12] = arguments[12]), + (this.mat4[13] = arguments[13]), + (this.mat4[14] = arguments[14]), + (this.mat4[15] = arguments[15])), + this + ); + }, + }, + { + key: "get", + value: function () { + return new C.default.Matrix(this.mat4, this.p5); + }, + }, + { + key: "copy", + value: function () { + var e; + return ( + void 0 !== this.mat3 + ? (((e = new C.default.Matrix( + "mat3", + this.p5, + )).mat3[0] = this.mat3[0]), + (e.mat3[1] = this.mat3[1]), + (e.mat3[2] = this.mat3[2]), + (e.mat3[3] = this.mat3[3]), + (e.mat3[4] = this.mat3[4]), + (e.mat3[5] = this.mat3[5]), + (e.mat3[6] = this.mat3[6]), + (e.mat3[7] = this.mat3[7]), + (e.mat3[8] = this.mat3[8])) + : (((e = new C.default.Matrix(this.p5)).mat4[0] = + this.mat4[0]), + (e.mat4[1] = this.mat4[1]), + (e.mat4[2] = this.mat4[2]), + (e.mat4[3] = this.mat4[3]), + (e.mat4[4] = this.mat4[4]), + (e.mat4[5] = this.mat4[5]), + (e.mat4[6] = this.mat4[6]), + (e.mat4[7] = this.mat4[7]), + (e.mat4[8] = this.mat4[8]), + (e.mat4[9] = this.mat4[9]), + (e.mat4[10] = this.mat4[10]), + (e.mat4[11] = this.mat4[11]), + (e.mat4[12] = this.mat4[12]), + (e.mat4[13] = this.mat4[13]), + (e.mat4[14] = this.mat4[14]), + (e.mat4[15] = this.mat4[15])), + e + ); + }, + }, + { + key: "transpose", + value: function (e) { + var t, r, o, n, s, i; + return ( + e instanceof C.default.Matrix + ? ((t = e.mat4[1]), + (r = e.mat4[2]), + (o = e.mat4[3]), + (n = e.mat4[6]), + (s = e.mat4[7]), + (i = e.mat4[11]), + (this.mat4[0] = e.mat4[0]), + (this.mat4[1] = e.mat4[4]), + (this.mat4[2] = e.mat4[8]), + (this.mat4[3] = e.mat4[12]), + (this.mat4[4] = t), + (this.mat4[5] = e.mat4[5]), + (this.mat4[6] = e.mat4[9]), + (this.mat4[7] = e.mat4[13]), + (this.mat4[8] = r), + (this.mat4[9] = n), + (this.mat4[10] = e.mat4[10]), + (this.mat4[11] = e.mat4[14]), + (this.mat4[12] = o), + (this.mat4[13] = s), + (this.mat4[14] = i), + (this.mat4[15] = e.mat4[15])) + : O(e) && + ((t = e[1]), + (r = e[2]), + (o = e[3]), + (n = e[6]), + (s = e[7]), + (i = e[11]), + (this.mat4[0] = e[0]), + (this.mat4[1] = e[4]), + (this.mat4[2] = e[8]), + (this.mat4[3] = e[12]), + (this.mat4[4] = t), + (this.mat4[5] = e[5]), + (this.mat4[6] = e[9]), + (this.mat4[7] = e[13]), + (this.mat4[8] = r), + (this.mat4[9] = n), + (this.mat4[10] = e[10]), + (this.mat4[11] = e[14]), + (this.mat4[12] = o), + (this.mat4[13] = s), + (this.mat4[14] = i), + (this.mat4[15] = e[15])), + this + ); + }, + }, + { + key: "invert", + value: function (e) { + e instanceof C.default.Matrix + ? ((t = e.mat4[0]), + (r = e.mat4[1]), + (o = e.mat4[2]), + (n = e.mat4[3]), + (s = e.mat4[4]), + (i = e.mat4[5]), + (a = e.mat4[6]), + (l = e.mat4[7]), + (u = e.mat4[8]), + (c = e.mat4[9]), + (d = e.mat4[10]), + (h = e.mat4[11]), + (f = e.mat4[12]), + (p = e.mat4[13]), + (m = e.mat4[14]), + (y = e.mat4[15])) + : O(e) && + ((t = e[0]), + (r = e[1]), + (o = e[2]), + (n = e[3]), + (s = e[4]), + (i = e[5]), + (a = e[6]), + (l = e[7]), + (u = e[8]), + (c = e[9]), + (d = e[10]), + (h = e[11]), + (f = e[12]), + (p = e[13]), + (m = e[14]), + (y = e[15])); + var t, + r, + o, + n, + s, + i, + a, + l, + u, + c, + d, + h, + f, + p, + m, + y, + e = t * i - r * s, + g = t * a - o * s, + v = t * l - n * s, + b = r * a - o * i, + j = r * l - n * i, + _ = o * l - n * a, + x = u * p - c * f, + w = u * m - d * f, + S = u * y - h * f, + T = c * m - d * p, + M = c * y - h * p, + E = d * y - h * m, + k = e * E - g * M + v * T + b * S - j * w + _ * x; + return k + ? ((this.mat4[0] = + (i * E - a * M + l * T) * (k = 1 / k)), + (this.mat4[1] = (o * M - r * E - n * T) * k), + (this.mat4[2] = (p * _ - m * j + y * b) * k), + (this.mat4[3] = (d * j - c * _ - h * b) * k), + (this.mat4[4] = (a * S - s * E - l * w) * k), + (this.mat4[5] = (t * E - o * S + n * w) * k), + (this.mat4[6] = (m * v - f * _ - y * g) * k), + (this.mat4[7] = (u * _ - d * v + h * g) * k), + (this.mat4[8] = (s * M - i * S + l * x) * k), + (this.mat4[9] = (r * S - t * M - n * x) * k), + (this.mat4[10] = (f * j - p * v + y * e) * k), + (this.mat4[11] = (c * v - u * j - h * e) * k), + (this.mat4[12] = (i * w - s * T - a * x) * k), + (this.mat4[13] = (t * T - r * w + o * x) * k), + (this.mat4[14] = (p * g - f * b - m * e) * k), + (this.mat4[15] = (u * b - c * g + d * e) * k), + this) + : null; + }, + }, + { + key: "invert3x3", + value: function () { + var e = this.mat3[0], + t = this.mat3[1], + r = this.mat3[2], + o = this.mat3[3], + n = this.mat3[4], + s = this.mat3[5], + i = this.mat3[6], + a = this.mat3[7], + l = this.mat3[8], + u = l * n - s * a, + c = -l * o + s * i, + d = a * o - n * i, + h = e * u + t * c + r * d; + return h + ? ((this.mat3[0] = u * (h = 1 / h)), + (this.mat3[1] = (-l * t + r * a) * h), + (this.mat3[2] = (s * t - r * n) * h), + (this.mat3[3] = c * h), + (this.mat3[4] = (l * e - r * i) * h), + (this.mat3[5] = (-s * e + r * o) * h), + (this.mat3[6] = d * h), + (this.mat3[7] = (-a * e + t * i) * h), + (this.mat3[8] = (n * e - t * o) * h), + this) + : null; + }, + }, + { + key: "transpose3x3", + value: function (e) { + var t = (e = void 0 === e ? this.mat3 : e)[1], + r = e[2], + o = e[5]; + return ( + (this.mat3[0] = e[0]), + (this.mat3[1] = e[3]), + (this.mat3[2] = e[6]), + (this.mat3[3] = t), + (this.mat3[4] = e[4]), + (this.mat3[5] = e[7]), + (this.mat3[6] = r), + (this.mat3[7] = o), + (this.mat3[8] = e[8]), + this + ); + }, + }, + { + key: "inverseTranspose", + value: function (e) { + (e = e.mat4), + void 0 === this.mat3 + ? C.default._friendlyError( + "sorry, this function only works with mat3", + ) + : ((this.mat3[0] = e[0]), + (this.mat3[1] = e[1]), + (this.mat3[2] = e[2]), + (this.mat3[3] = e[4]), + (this.mat3[4] = e[5]), + (this.mat3[5] = e[6]), + (this.mat3[6] = e[8]), + (this.mat3[7] = e[9]), + (this.mat3[8] = e[10])), + (e = this.invert3x3()); + if (e) e.transpose3x3(this.mat3); + else for (var t = 0; t < 9; t++) this.mat3[t] = 0; + return this; + }, + }, + { + key: "determinant", + value: function () { + var e = + this.mat4[0] * this.mat4[5] - + this.mat4[1] * this.mat4[4], + t = + this.mat4[0] * this.mat4[6] - + this.mat4[2] * this.mat4[4], + r = + this.mat4[0] * this.mat4[7] - + this.mat4[3] * this.mat4[4], + o = + this.mat4[1] * this.mat4[6] - + this.mat4[2] * this.mat4[5], + n = + this.mat4[1] * this.mat4[7] - + this.mat4[3] * this.mat4[5], + s = + this.mat4[2] * this.mat4[7] - + this.mat4[3] * this.mat4[6], + i = + this.mat4[8] * this.mat4[13] - + this.mat4[9] * this.mat4[12], + a = + this.mat4[8] * this.mat4[14] - + this.mat4[10] * this.mat4[12], + l = + this.mat4[8] * this.mat4[15] - + this.mat4[11] * this.mat4[12], + u = + this.mat4[9] * this.mat4[14] - + this.mat4[10] * this.mat4[13], + c = + this.mat4[9] * this.mat4[15] - + this.mat4[11] * this.mat4[13]; + return ( + e * + (this.mat4[10] * this.mat4[15] - + this.mat4[11] * this.mat4[14]) - + t * c + + r * u + + o * l - + n * a + + s * i + ); + }, + }, + { + key: "mult", + value: function (e) { + var t; + if (e === this || e === this.mat4) t = this.copy().mat4; + else if (e instanceof C.default.Matrix) t = e.mat4; + else if (O(e)) t = e; + else { + if (16 !== arguments.length) return; + t = arguments; + } + var e = this.mat4[0], + r = this.mat4[1], + o = this.mat4[2], + n = this.mat4[3]; + return ( + (this.mat4[0] = + e * t[0] + r * t[4] + o * t[8] + n * t[12]), + (this.mat4[1] = + e * t[1] + r * t[5] + o * t[9] + n * t[13]), + (this.mat4[2] = + e * t[2] + r * t[6] + o * t[10] + n * t[14]), + (this.mat4[3] = + e * t[3] + r * t[7] + o * t[11] + n * t[15]), + (e = this.mat4[4]), + (r = this.mat4[5]), + (o = this.mat4[6]), + (n = this.mat4[7]), + (this.mat4[4] = + e * t[0] + r * t[4] + o * t[8] + n * t[12]), + (this.mat4[5] = + e * t[1] + r * t[5] + o * t[9] + n * t[13]), + (this.mat4[6] = + e * t[2] + r * t[6] + o * t[10] + n * t[14]), + (this.mat4[7] = + e * t[3] + r * t[7] + o * t[11] + n * t[15]), + (e = this.mat4[8]), + (r = this.mat4[9]), + (o = this.mat4[10]), + (n = this.mat4[11]), + (this.mat4[8] = + e * t[0] + r * t[4] + o * t[8] + n * t[12]), + (this.mat4[9] = + e * t[1] + r * t[5] + o * t[9] + n * t[13]), + (this.mat4[10] = + e * t[2] + r * t[6] + o * t[10] + n * t[14]), + (this.mat4[11] = + e * t[3] + r * t[7] + o * t[11] + n * t[15]), + (e = this.mat4[12]), + (r = this.mat4[13]), + (o = this.mat4[14]), + (n = this.mat4[15]), + (this.mat4[12] = + e * t[0] + r * t[4] + o * t[8] + n * t[12]), + (this.mat4[13] = + e * t[1] + r * t[5] + o * t[9] + n * t[13]), + (this.mat4[14] = + e * t[2] + r * t[6] + o * t[10] + n * t[14]), + (this.mat4[15] = + e * t[3] + r * t[7] + o * t[11] + n * t[15]), + this + ); + }, + }, + { + key: "apply", + value: function (e) { + var t; + if (e === this || e === this.mat4) t = this.copy().mat4; + else if (e instanceof C.default.Matrix) t = e.mat4; + else if (O(e)) t = e; + else { + if (16 !== arguments.length) return; + t = arguments; + } + var e = this.mat4, + r = e[0], + o = e[4], + n = e[8], + s = e[12], + r = + ((e[0] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), + (e[4] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), + (e[8] = + t[8] * r + t[9] * o + t[10] * n + t[11] * s), + (e[12] = + t[12] * r + t[13] * o + t[14] * n + t[15] * s), + e[1]), + o = e[5], + n = e[9], + s = e[13], + r = + ((e[1] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), + (e[5] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), + (e[9] = + t[8] * r + t[9] * o + t[10] * n + t[11] * s), + (e[13] = + t[12] * r + t[13] * o + t[14] * n + t[15] * s), + e[2]), + o = e[6], + n = e[10], + s = e[14], + r = + ((e[2] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), + (e[6] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), + (e[10] = + t[8] * r + t[9] * o + t[10] * n + t[11] * s), + (e[14] = + t[12] * r + t[13] * o + t[14] * n + t[15] * s), + e[3]), + o = e[7], + n = e[11], + s = e[15]; + return ( + (e[3] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), + (e[7] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), + (e[11] = t[8] * r + t[9] * o + t[10] * n + t[11] * s), + (e[15] = + t[12] * r + t[13] * o + t[14] * n + t[15] * s), + this + ); + }, + }, + { + key: "scale", + value: function (e, t, r) { + return ( + e instanceof C.default.Vector + ? ((t = e.y), (r = e.z), (e = e.x)) + : e instanceof Array && + ((t = e[1]), (r = e[2]), (e = e[0])), + (this.mat4[0] *= e), + (this.mat4[1] *= e), + (this.mat4[2] *= e), + (this.mat4[3] *= e), + (this.mat4[4] *= t), + (this.mat4[5] *= t), + (this.mat4[6] *= t), + (this.mat4[7] *= t), + (this.mat4[8] *= r), + (this.mat4[9] *= r), + (this.mat4[10] *= r), + (this.mat4[11] *= r), + this + ); + }, + }, + { + key: "rotate", + value: function (e, t, r, o) { + t instanceof C.default.Vector + ? ((r = t.y), (o = t.z), (t = t.x)) + : t instanceof Array && + ((r = t[1]), (o = t[2]), (t = t[0])); + var n = Math.sqrt(t * t + r * r + o * o), + n = + ((t *= 1 / n), + (r *= 1 / n), + (o *= 1 / n), + this.mat4[0]), + s = this.mat4[1], + i = this.mat4[2], + a = this.mat4[3], + l = this.mat4[4], + u = this.mat4[5], + c = this.mat4[6], + d = this.mat4[7], + h = this.mat4[8], + f = this.mat4[9], + p = this.mat4[10], + m = this.mat4[11], + y = Math.sin(e), + e = Math.cos(e), + g = 1 - e, + v = t * t * g + e, + b = r * t * g + o * y, + j = o * t * g - r * y, + _ = t * r * g - o * y, + x = r * r * g + e, + w = o * r * g + t * y, + S = t * o * g + r * y, + r = r * o * g - t * y, + t = o * o * g + e; + return ( + (this.mat4[0] = n * v + l * b + h * j), + (this.mat4[1] = s * v + u * b + f * j), + (this.mat4[2] = i * v + c * b + p * j), + (this.mat4[3] = a * v + d * b + m * j), + (this.mat4[4] = n * _ + l * x + h * w), + (this.mat4[5] = s * _ + u * x + f * w), + (this.mat4[6] = i * _ + c * x + p * w), + (this.mat4[7] = a * _ + d * x + m * w), + (this.mat4[8] = n * S + l * r + h * t), + (this.mat4[9] = s * S + u * r + f * t), + (this.mat4[10] = i * S + c * r + p * t), + (this.mat4[11] = a * S + d * r + m * t), + this + ); + }, + }, + { + key: "translate", + value: function (e) { + var t = e[0], + r = e[1], + e = e[2] || 0; + (this.mat4[12] += + this.mat4[0] * t + + this.mat4[4] * r + + this.mat4[8] * e), + (this.mat4[13] += + this.mat4[1] * t + + this.mat4[5] * r + + this.mat4[9] * e), + (this.mat4[14] += + this.mat4[2] * t + + this.mat4[6] * r + + this.mat4[10] * e), + (this.mat4[15] += + this.mat4[3] * t + + this.mat4[7] * r + + this.mat4[11] * e); + }, + }, + { + key: "rotateX", + value: function (e) { + this.rotate(e, 1, 0, 0); + }, + }, + { + key: "rotateY", + value: function (e) { + this.rotate(e, 0, 1, 0); + }, + }, + { + key: "rotateZ", + value: function (e) { + this.rotate(e, 0, 0, 1); + }, + }, + { + key: "perspective", + value: function (e, t, r, o) { + var e = 1 / Math.tan(e / 2), + n = 1 / (r - o); + return ( + (this.mat4[0] = e / t), + (this.mat4[1] = 0), + (this.mat4[2] = 0), + (this.mat4[3] = 0), + (this.mat4[4] = 0), + (this.mat4[5] = e), + (this.mat4[6] = 0), + (this.mat4[7] = 0), + (this.mat4[8] = 0), + (this.mat4[9] = 0), + (this.mat4[10] = (o + r) * n), + (this.mat4[11] = -1), + (this.mat4[12] = 0), + (this.mat4[13] = 0), + (this.mat4[14] = 2 * o * r * n), + (this.mat4[15] = 0), + this + ); + }, + }, + { + key: "ortho", + value: function (e, t, r, o, n, s) { + var i = 1 / (e - t), + a = 1 / (r - o), + l = 1 / (n - s); + return ( + (this.mat4[0] = -2 * i), + (this.mat4[1] = 0), + (this.mat4[2] = 0), + (this.mat4[3] = 0), + (this.mat4[4] = 0), + (this.mat4[5] = -2 * a), + (this.mat4[6] = 0), + (this.mat4[7] = 0), + (this.mat4[8] = 0), + (this.mat4[9] = 0), + (this.mat4[10] = 2 * l), + (this.mat4[11] = 0), + (this.mat4[12] = (e + t) * i), + (this.mat4[13] = (o + r) * a), + (this.mat4[14] = (s + n) * l), + (this.mat4[15] = 1), + this + ); + }, + }, + { + key: "multiplyVec4", + value: function (e, t, r, o) { + var n = new Array(4), + s = this.mat4; + return ( + (n[0] = s[0] * e + s[4] * t + s[8] * r + s[12] * o), + (n[1] = s[1] * e + s[5] * t + s[9] * r + s[13] * o), + (n[2] = s[2] * e + s[6] * t + s[10] * r + s[14] * o), + (n[3] = s[3] * e + s[7] * t + s[11] * r + s[15] * o), + n + ); + }, + }, + { + key: "multiplyPoint", + value: function (e) { + var t = e.x, + r = e.y, + e = e.z, + t = this.multiplyVec4(t, r, e, 1); + return new C.default.Vector(t[0], t[1], t[2]); + }, + }, + { + key: "multiplyAndNormalizePoint", + value: function (e) { + var t = e.x, + r = e.y, + e = e.z, + t = this.multiplyVec4(t, r, e, 1); + return ( + (t[0] /= t[3]), + (t[1] /= t[3]), + (t[2] /= t[3]), + new C.default.Vector(t[0], t[1], t[2]) + ); + }, + }, + { + key: "multiplyDirection", + value: function (e) { + var t = e.x, + r = e.y, + e = e.z, + t = this.multiplyVec4(t, r, e, 0); + return new C.default.Vector(t[0], t[1], t[2]); + }, + }, + { + key: "mult3x3", + value: function (e) { + var t; + if (e === this || e === this.mat3) t = this.copy().mat3; + else if (e instanceof C.default.Matrix) t = e.mat3; + else if (O(e)) t = e; + else { + if (9 !== arguments.length) return; + t = arguments; + } + var e = this.mat3[0], + r = this.mat3[1], + o = this.mat3[2]; + return ( + (this.mat3[0] = e * t[0] + r * t[3] + o * t[6]), + (this.mat3[1] = e * t[1] + r * t[4] + o * t[7]), + (this.mat3[2] = e * t[2] + r * t[5] + o * t[8]), + (e = this.mat3[3]), + (r = this.mat3[4]), + (o = this.mat3[5]), + (this.mat3[3] = e * t[0] + r * t[3] + o * t[6]), + (this.mat3[4] = e * t[1] + r * t[4] + o * t[7]), + (this.mat3[5] = e * t[2] + r * t[5] + o * t[8]), + (e = this.mat3[6]), + (r = this.mat3[7]), + (o = this.mat3[8]), + (this.mat3[6] = e * t[0] + r * t[3] + o * t[6]), + (this.mat3[7] = e * t[1] + r * t[4] + o * t[7]), + (this.mat3[8] = e * t[2] + r * t[5] + o * t[8]), + this + ); + }, + }, + { + key: "column", + value: function (e) { + return new C.default.Vector( + this.mat3[3 * e], + this.mat3[3 * e + 1], + this.mat3[3 * e + 2], + ); + }, + }, + { + key: "row", + value: function (e) { + return new C.default.Vector( + this.mat3[e], + this.mat3[e + 3], + this.mat3[e + 6], + ); + }, + }, + { + key: "diagonal", + value: function () { + return void 0 !== this.mat3 + ? [this.mat3[0], this.mat3[4], this.mat3[8]] + : [ + this.mat4[0], + this.mat4[5], + this.mat4[10], + this.mat4[15], + ]; + }, + }, + { + key: "multiplyVec3", + value: function (e, t) { + return ( + ((t = void 0 === t ? e.copy() : t).x = + this.row(0).dot(e)), + (t.y = this.row(1).dot(e)), + (t.z = this.row(2).dot(e)), + t + ); + }, + }, + { + key: "createSubMatrix3x3", + value: function () { + var e = new C.default.Matrix("mat3"); + return ( + (e.mat3[0] = this.mat4[0]), + (e.mat3[1] = this.mat4[1]), + (e.mat3[2] = this.mat4[2]), + (e.mat3[3] = this.mat4[4]), + (e.mat3[4] = this.mat4[5]), + (e.mat3[5] = this.mat4[6]), + (e.mat3[6] = this.mat4[8]), + (e.mat3[7] = this.mat4[9]), + (e.mat3[8] = this.mat4[10]), + e + ); + }, + }, + ]) && n(e.prototype, t), + o && n(e, o), + r + ); + })()), + C.default.Matrix); + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.float32-array": 211, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + }, + ], + 329: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.map"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function o(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + e.default.RenderBuffer = (function () { + function i(e, t, r, o, n, s) { + if (!(this instanceof i)) + throw new TypeError("Cannot call a class as a function"); + (this.size = e), + (this.src = t), + (this.dst = r), + (this.attr = o), + (this._renderer = n), + (this.map = s); + } + var e, t, r; + return ( + (e = i), + (t = [ + { + key: "_prepareBuffer", + value: function (e, t) { + var r, + o, + n, + s = t.attributes, + i = this._renderer.GL, + a = e.model || e, + s = s[this.attr]; + s && + ((r = e[this.dst]), + 0 < (o = a[this.src]).length + ? ((n = !r) && (e[this.dst] = r = i.createBuffer()), + i.bindBuffer(i.ARRAY_BUFFER, r), + (!n && !1 === a.dirtyFlags[this.src]) || + ((n = (e = this.map) ? e(o) : o), + this._renderer._bindBuffer(r, i.ARRAY_BUFFER, n), + (a.dirtyFlags[this.src] = !1)), + t.enableAttrib(s, this.size)) + : -1 !== (e = s.location) && + this._renderer.registerEnabled.has(e) && + (i.disableVertexAttribArray(e), + this._renderer.registerEnabled.delete(e))); + }, + }, + ]) && o(e.prototype, t), + r && o(e, r), + i + ); + })(); + e = e.default.RenderBuffer; + r.default = e; + }, + { "../core/main": 275, "core-js/modules/es.array.map": 164 }, + ], + 330: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.find-index"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.map"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.find-index"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.map"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.map"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var l = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + h = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function f(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + e("./p5.RenderBuffer"), + (l.default.RendererGL.prototype.beginShape = function (e) { + return ( + (this.immediateMode.shapeMode = void 0 !== e ? e : h.TESS), + this.immediateMode.geometry.reset(), + (this.immediateMode.contourIndices = []), + this + ); + }); + var u = { + vertices: 1, + vertexNormals: 1, + vertexColors: 4, + vertexStrokeColors: 4, + uvs: 2, + }, + n = + ((l.default.RendererGL.prototype.beginContour = function () { + if (this.immediateMode.shapeMode !== h.TESS) + throw new Error( + "WebGL mode can only use contours with beginShape(TESS).", + ); + this.immediateMode.contourIndices.push( + this.immediateMode.geometry.vertices.length, + ); + }), + (l.default.RendererGL.prototype.vertex = function (e, t) { + if ( + this.immediateMode.shapeMode === h.QUADS && + this.immediateMode.geometry.vertices.length % 6 == 3 + ) + for (var r in u) { + var o = u[r], + r = this.immediateMode.geometry[r]; + r.push.apply( + r, + f(r.slice(r.length - 3 * o, r.length - 2 * o)).concat( + f(r.slice(r.length - o, r.length)), + ), + ); + } + var n, + s, + i = (n = s = 0), + a = + (3 === arguments.length + ? (i = arguments[2]) + : 4 === arguments.length + ? ((n = arguments[2]), (s = arguments[3])) + : 5 === arguments.length && + ((i = arguments[2]), + (n = arguments[3]), + (s = arguments[4])), + new l.default.Vector(e, t, i)), + a = + (this.immediateMode.geometry.vertices.push(a), + this.immediateMode.geometry.vertexNormals.push( + this._currentNormal, + ), + this.curFillColor || [0.5, 0.5, 0.5, 1]), + a = + (this.immediateMode.geometry.vertexColors.push( + a[0], + a[1], + a[2], + a[3], + ), + this.curStrokeColor || [0.5, 0.5, 0.5, 1]); + return ( + this.immediateMode.geometry.vertexStrokeColors.push( + a[0], + a[1], + a[2], + a[3], + ), + this.textureMode !== h.IMAGE || + this.isProcessingVertices || + (null !== this._tex + ? 0 < this._tex.width && + 0 < this._tex.height && + ((n /= this._tex.width), (s /= this._tex.height)) + : void 0 === this.userFillShader && + void 0 === this.userStrokeShader && + void 0 === this.userPointShader && + null === this._tex && + 4 <= arguments.length && + console.warn( + "You must first call texture() before using vertex() with image based u and v coordinates", + )), + this.immediateMode.geometry.uvs.push(n, s), + (this.immediateMode._bezierVertex[0] = e), + (this.immediateMode._bezierVertex[1] = t), + (this.immediateMode._bezierVertex[2] = i), + (this.immediateMode._quadraticVertex[0] = e), + (this.immediateMode._quadraticVertex[1] = t), + (this.immediateMode._quadraticVertex[2] = i), + this + ); + }), + (l.default.RendererGL.prototype.normal = function (e, t, r) { + return ( + e instanceof l.default.Vector + ? (this._currentNormal = e) + : (this._currentNormal = new l.default.Vector(e, t, r)), + this + ); + }), + (l.default.RendererGL.prototype.endShape = function ( + e, + t, + r, + o, + n, + s, + ) { + var i = + 6 < arguments.length && void 0 !== arguments[6] + ? arguments[6] + : 1; + return ( + this.immediateMode.shapeMode === h.POINTS + ? this._drawPoints( + this.immediateMode.geometry.vertices, + this.immediateMode.buffers.point, + ) + : (3 === this.immediateMode.geometry.vertices.length && + this.immediateMode.shapeMode === h.TESS && + (this.immediateMode.shapeMode, h.TRIANGLES), + (this.isProcessingVertices = !0), + this._processVertices.apply(this, arguments), + (this.isProcessingVertices = !1), + (this.immediateMode.shapeMode !== h.LINE_STRIP && + this.immediateMode.shapeMode !== h.LINES) || + (this.immediateMode.shapeMode = h.TRIANGLE_FAN), + this.immediateMode.shapeMode === h.QUADS + ? (this.immediateMode.shapeMode = h.TRIANGLES) + : this.immediateMode.shapeMode === h.QUAD_STRIP && + (this.immediateMode.shapeMode = h.TRIANGLE_STRIP), + this._doFill && + !this.geometryBuilder && + 3 <= this.immediateMode.geometry.vertices.length && + this._drawImmediateFill(i), + this._doStroke && + !this.geometryBuilder && + 1 <= this.immediateMode.geometry.lineVertices.length && + this._drawImmediateStroke(), + this.geometryBuilder && + this.geometryBuilder.addImmediate(), + (this.isBezier = !1), + (this.isQuadratic = !1), + (this.isCurve = !1), + (this.immediateMode._bezierVertex.length = 0), + (this.immediateMode._quadraticVertex.length = 0), + (this.immediateMode._curveVertex.length = 0)), + this + ); + }), + (l.default.RendererGL.prototype._processVertices = function (e) { + var t; + 0 !== this.immediateMode.geometry.vertices.length && + ((t = this._doStroke), + (e = e === h.CLOSE), + t && + ((this.immediateMode.geometry.edges = this._calculateEdges( + this.immediateMode.shapeMode, + this.immediateMode.geometry.vertices, + e, + )), + this.geometryBuilder || + this.immediateMode.geometry._edgesToVertices()), + (t = this.immediateMode.shapeMode === h.TESS), + (e = 0 < this.immediateMode.contourIndices.length), + this._doFill && + (this.isBezier || + this.isQuadratic || + this.isCurve || + t || + e) && + this.immediateMode.shapeMode !== h.LINES && + this._tesselateShape()); + }), + (l.default.RendererGL.prototype._calculateEdges = function ( + e, + t, + r, + ) { + var o = [], + n = 0, + s = this.immediateMode.contourIndices.slice(), + i = 0; + switch (e) { + case h.TRIANGLE_STRIP: + for (n = 0; n < t.length - 2; n++) + o.push([n, n + 1]), o.push([n, n + 2]); + o.push([n, n + 1]); + break; + case h.TRIANGLE_FAN: + for (n = 1; n < t.length - 1; n++) + o.push([0, n]), o.push([n, n + 1]); + o.push([0, t.length - 1]); + break; + case h.TRIANGLES: + for (n = 0; n < t.length - 2; n += 3) + o.push([n, n + 1]), + o.push([n + 1, n + 2]), + o.push([n + 2, n]); + break; + case h.LINES: + for (n = 0; n < t.length - 1; n += 2) o.push([n, n + 1]); + break; + case h.QUADS: + for (n = 0; n < t.length - 5; n += 6) + o.push([n, n + 1]), + o.push([n + 1, n + 2]), + o.push([n + 3, n + 5]), + o.push([n + 4, n + 5]); + break; + case h.QUAD_STRIP: + for (n = 0; n < t.length - 2; n += 2) + o.push([n, n + 1]), + o.push([n, n + 2]), + o.push([n + 1, n + 3]); + o.push([n, n + 1]); + break; + default: + for (n = 0; n < t.length; n++) + n + 1 < t.length && n + 1 !== s[0] + ? o.push([n, n + 1]) + : ((r || i) && o.push([n, i]), + 0 < s.length && (i = s.shift())); + } + return e !== h.TESS && r && o.push([t.length - 1, 0]), o; + }), + (l.default.RendererGL.prototype._tesselateShape = function () { + for ( + var u = this, + e = ((this.immediateMode.shapeMode = h.TRIANGLES), [[]]), + t = 0; + t < this.immediateMode.geometry.vertices.length; + t++ + ) + 0 < this.immediateMode.contourIndices.length && + this.immediateMode.contourIndices[0] === t && + (this.immediateMode.contourIndices.shift(), e.push([])), + e[e.length - 1].push( + this.immediateMode.geometry.vertices[t].x, + this.immediateMode.geometry.vertices[t].y, + this.immediateMode.geometry.vertices[t].z, + this.immediateMode.geometry.uvs[2 * t], + this.immediateMode.geometry.uvs[2 * t + 1], + this.immediateMode.geometry.vertexColors[4 * t], + this.immediateMode.geometry.vertexColors[4 * t + 1], + this.immediateMode.geometry.vertexColors[4 * t + 2], + this.immediateMode.geometry.vertexColors[4 * t + 3], + this.immediateMode.geometry.vertexNormals[t].x, + this.immediateMode.geometry.vertexNormals[t].y, + this.immediateMode.geometry.vertexNormals[t].z, + ); + for ( + var c, + r = this._triangulate(e), + d = this.immediateMode.geometry.vertices, + o = + ((this.immediateMode.geometry.vertices = []), + (this.immediateMode.geometry.vertexNormals = []), + (this.immediateMode.geometry.uvs = []), + []), + n = 0, + s = r.length; + n < s; + n += l.default.RendererGL.prototype.tessyVertexSize + ) + o.push.apply(o, f(r.slice(n + 5, n + 9))), + this.normal.apply(this, f(r.slice(n + 9, n + 12))), + this.vertex.apply(this, f(r.slice(n, n + 5))); + this.geometryBuilder && + ((c = new Map()), + (this.immediateMode.geometry.edges = + this.immediateMode.geometry.edges.map(function (e) { + return e.map(function (e) { + if (!c.has(e)) { + var t = d[e], + r = u.immediateMode.geometry.vertices.findIndex( + function (e) { + return ( + t.x === e.x && t.y === e.y && t.z === e.z + ); + }, + ); + if (-1 === r) { + for ( + var o = 1 / 0, n = 0, s = 0; + s < u.immediateMode.geometry.vertices.length; + s++ + ) { + var i = u.immediateMode.geometry.vertices[s], + a = t.x - i.x, + l = t.y - i.y, + i = t.z - i.z, + a = a * a + l * l + i * i; + a < o && ((o = a), (n = s)); + } + r = n; + } + c.set(e, r); + } + return c.get(e); + }); + }))), + (this.immediateMode.geometry.vertexColors = o); + }), + (l.default.RendererGL.prototype._drawImmediateFill = function () { + var e, + t = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : 1, + r = this.GL, + o = + ((this._useVertexColor = + 0 < this.immediateMode.geometry.vertexColors.length), + (e = this._getImmediateFillShader()), + this._setFillUniforms(e), + !0), + n = !1, + s = void 0; + try { + for ( + var i, + a = this.immediateMode.buffers.fill[Symbol.iterator](); + !(o = (i = a.next()).done); + o = !0 + ) + i.value._prepareBuffer(this.immediateMode.geometry, e); + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + if ( + (e.disableRemainingAttributes(), + this._applyColorBlend(this.curFillColor), + 1 === t) + ) + r.drawArrays( + this.immediateMode.shapeMode, + 0, + this.immediateMode.geometry.vertices.length, + ); + else + try { + r.drawArraysInstanced( + this.immediateMode.shapeMode, + 0, + this.immediateMode.geometry.vertices.length, + t, + ); + } catch (e) { + console.log( + "🌸 p5.js says: Instancing is only supported in WebGL2 mode", + ); + } + e.unbindShader(); + }), + (l.default.RendererGL.prototype._drawImmediateStroke = + function () { + var e = this.GL, + t = + ((this._useLineColor = + 0 < + this.immediateMode.geometry.vertexStrokeColors.length), + this._getImmediateStrokeShader()), + r = (this._setStrokeUniforms(t), !0), + o = !1, + n = void 0; + try { + for ( + var s, + i = + this.immediateMode.buffers.stroke[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) + s.value._prepareBuffer(this.immediateMode.geometry, t); + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + t.disableRemainingAttributes(), + this._applyColorBlend(this.curStrokeColor), + e.drawArrays( + e.TRIANGLES, + 0, + this.immediateMode.geometry.lineVertices.length / 3, + ), + t.unbindShader(); + }), + l.default.RendererGL); + r.default = n; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.RenderBuffer": 329, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.find-index": 156, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.map": 164, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.map": 169, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 331: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.uint16-array"), + e("core-js/modules/es.typed-array.uint32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.uint16-array"), + e("core-js/modules/es.typed-array.uint32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var a = (s = e("../core/main")) && s.__esModule ? s : { default: s }, + n = + (e("./p5.RendererGL"), + e("./p5.RenderBuffer"), + (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = l(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants"))); + function l() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (l = function () { + return e; + }), + e); + } + (a.default.RendererGL.prototype.freeGeometry = function (e) { + e.gid + ? this._freeBuffers(e.gid) + : console.warn( + "The model you passed to freeGeometry does not have an id!", + ); + }), + (a.default.RendererGL.prototype._initBufferDefaults = function (e) { + var t; + return ( + this._freeBuffers(e), + 1e3 < Object.keys(this.retainedMode.geometry).length && + ((t = Object.keys(this.retainedMode.geometry)[0]), + this._freeBuffers(t)), + (this.retainedMode.geometry[e] = {}) + ); + }), + (a.default.RendererGL.prototype._freeBuffers = function (e) { + var a, + l = this.retainedMode.geometry[e]; + function t(e) { + var t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = e[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value; + l[i.dst] && (a.deleteBuffer(l[i.dst]), (l[i.dst] = null)); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + } + l && + (delete this.retainedMode.geometry[e], + (a = this.GL), + l.indexBuffer && a.deleteBuffer(l.indexBuffer), + t(this.retainedMode.buffers.stroke), + t(this.retainedMode.buffers.fill)); + }), + (a.default.RendererGL.prototype.createBuffers = function (e, t) { + var r, + o, + n, + s = this.GL, + e = this._initBufferDefaults(e), + i = ((e.model = t), e.indexBuffer); + return ( + t.faces.length + ? ((i = i || (e.indexBuffer = s.createBuffer())), + (n = (o = (r = a.default.RendererGL.prototype._flatten( + t.faces, + )).some(function (e) { + return 65535 < e; + })) + ? Uint32Array + : Uint16Array), + this._bindBuffer(i, s.ELEMENT_ARRAY_BUFFER, r, n), + (e.indexBufferType = o ? s.UNSIGNED_INT : s.UNSIGNED_SHORT), + (e.vertexCount = 3 * t.faces.length)) + : (i && (s.deleteBuffer(i), (e.indexBuffer = null)), + (e.vertexCount = t.vertices ? t.vertices.length : 0)), + (e.lineVertexCount = t.lineVertices + ? t.lineVertices.length / 3 + : 0), + e + ); + }), + (a.default.RendererGL.prototype.drawBuffers = function (e) { + var t = this.GL, + r = this.retainedMode.geometry[e]; + if ( + !this.geometryBuilder && + this._doFill && + 0 < this.retainedMode.geometry[e].vertexCount + ) { + this._useVertexColor = 0 < r.model.vertexColors.length; + var o = this._getRetainedFillShader(), + n = (this._setFillUniforms(o), !0), + s = !1, + i = void 0; + try { + for ( + var a, + l = this.retainedMode.buffers.fill[Symbol.iterator](); + !(n = (a = l.next()).done); + n = !0 + ) + a.value._prepareBuffer(r, o); + } catch (e) { + (s = !0), (i = e); + } finally { + try { + n || null == l.return || l.return(); + } finally { + if (s) throw i; + } + } + o.disableRemainingAttributes(), + r.indexBuffer && + this._bindBuffer(r.indexBuffer, t.ELEMENT_ARRAY_BUFFER), + this._applyColorBlend(this.curFillColor), + this._drawElements(t.TRIANGLES, e), + o.unbindShader(); + } + if ( + !this.geometryBuilder && + this._doStroke && + 0 < r.lineVertexCount + ) { + this._useLineColor = 0 < r.model.vertexStrokeColors.length; + var u = this._getRetainedStrokeShader(), + c = (this._setStrokeUniforms(u), !0), + s = !1, + i = void 0; + try { + for ( + var d, + h = this.retainedMode.buffers.stroke[Symbol.iterator](); + !(c = (d = h.next()).done); + c = !0 + ) + d.value._prepareBuffer(r, u); + } catch (e) { + (s = !0), (i = e); + } finally { + try { + c || null == h.return || h.return(); + } finally { + if (s) throw i; + } + } + u.disableRemainingAttributes(), + this._applyColorBlend(this.curStrokeColor), + this._drawArrays(t.TRIANGLES, e), + u.unbindShader(); + } + return ( + this.geometryBuilder && this.geometryBuilder.addRetained(r), + this + ); + }), + (a.default.RendererGL.prototype.drawBuffersScaled = function ( + e, + t, + r, + o, + ) { + var n = this.uMVMatrix.copy(); + try { + this.uMVMatrix.scale(t, r, o), this.drawBuffers(e); + } finally { + this.uMVMatrix = n; + } + }), + (a.default.RendererGL.prototype._drawArrays = function (e, t) { + return ( + this.GL.drawArrays( + e, + 0, + this.retainedMode.geometry[t].lineVertexCount, + ), + this + ); + }), + (a.default.RendererGL.prototype._drawElements = function (e, t) { + var t = this.retainedMode.geometry[t], + r = this.GL; + if (t.indexBuffer) { + if ( + this._pInst.webglVersion !== n.WEBGL2 && + t.indexBufferType === r.UNSIGNED_INT && + !r.getExtension("OES_element_index_uint") + ) + throw new Error( + "Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.", + ); + r.drawElements( + r.TRIANGLES, + t.vertexCount, + t.indexBufferType, + 0, + ); + } else r.drawArrays(e || r.TRIANGLES, 0, t.vertexCount); + }), + (a.default.RendererGL.prototype._drawPoints = function (e, t) { + var r = this.GL, + o = this._getImmediatePointShader(); + this._setPointUniforms(o), + this._bindBuffer( + t, + r.ARRAY_BUFFER, + this._vToNArray(e), + Float32Array, + r.STATIC_DRAW, + ), + o.enableAttrib(o.attributes.aPosition, 3), + this._applyColorBlend(this.curStrokeColor), + r.drawArrays(r.Points, 0, e.length), + o.unbindShader(); + }); + var s = a.default.RendererGL; + r.default = s; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.RenderBuffer": 329, + "./p5.RendererGL": 332, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.some": 166, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.float32-array": 211, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint16-array": 232, + "core-js/modules/es.typed-array.uint32-array": 233, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 332: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.copy-within"), + e("core-js/modules/es.array.every"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.map"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.reflect.get"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.float64-array"), + e("core-js/modules/es.typed-array.int16-array"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint16-array"), + e("core-js/modules/es.typed-array.uint32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.concat"), + e("core-js/modules/es.array.copy-within"), + e("core-js/modules/es.array.every"), + e("core-js/modules/es.array.fill"), + e("core-js/modules/es.array.from"), + e("core-js/modules/es.array.includes"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.map"), + e("core-js/modules/es.object.assign"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.set"), + e("core-js/modules/es.string.includes"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.float32-array"), + e("core-js/modules/es.typed-array.float64-array"), + e("core-js/modules/es.typed-array.int16-array"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.uint16-array"), + e("core-js/modules/es.typed-array.uint32-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.readPixelsWebGL = k), + (r.readPixelWebGL = C), + (r.default = void 0); + var g = n(e("../core/main")), + l = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = d(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")), + a = n(e("./GeometryBuilder")), + u = n(e("libtess")), + c = + (e("./p5.Shader"), + e("./p5.Camera"), + e("../core/p5.Renderer"), + e("./p5.Matrix"), + e("./p5.Framebuffer"), + e("path"), + e("./p5.Texture")); + function d() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (d = function () { + return e; + }), + e); + } + function n(e) { + return e && e.__esModule ? e : { default: e }; + } + function h(e) { + return ( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, r = new Array(e.length); t < e.length; t++) + r[t] = e[t]; + return r; + } + })(e) || + (function (e) { + if ( + Symbol.iterator in Object(e) || + "[object Arguments]" === Object.prototype.toString.call(e) + ) + return Array.from(e); + })(e) || + (function () { + throw new TypeError( + "Invalid attempt to spread non-iterable instance", + ); + })() + ); + } + function f(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function p(e, t, r) { + return (p = + "undefined" != typeof Reflect && Reflect.get + ? Reflect.get + : function (e, t, r) { + var e = (function (e, t) { + for ( + ; + !Object.prototype.hasOwnProperty.call(e, t) && + null !== (e = b(e)); + + ); + return e; + })(e, t); + if (e) + return (e = Object.getOwnPropertyDescriptor(e, t)).get + ? e.get.call(r) + : e.value; + })(e, t, r || e); + } + function m(e, t) { + return (m = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function y(o) { + return function () { + var e, + t, + r = b(o); + return ( + (e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = b(this).constructor), + Reflect.construct(r, arguments, e)) + : r.apply(this, arguments)), + (r = this), + !(t = e) || ("object" !== i(t) && "function" != typeof t) + ? v(r) + : t + ); + }; + } + function v(e) { + if (void 0 === e) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + return e; + } + function b(e) { + return (b = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + function j(e, t, r) { + t in e + ? Object.defineProperty(e, t, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (e[t] = r); + } + function s(e, t) { + (T += "#define STROKE_CAP_".concat(e, " ").concat(t, "\n")), + (w[l[e]] = t); + } + function _(e, t) { + (T += "#define STROKE_JOIN_".concat(e, " ").concat(t, "\n")), + (S[l[e]] = t); + } + var x, + w = {}, + S = {}, + T = "", + e = + (s("ROUND", 0), + s("PROJECT", 1), + s("SQUARE", 2), + _("ROUND", 0), + _("MITER", 1), + _("BEVEL", 2), + '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'), + M = { + immediateVert: + "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n", + vertexColorVert: + "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n", + vertexColorFrag: + "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", + normalVert: + "IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", + normalFrag: + "IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n", + basicFrag: + "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", + lightVert: + e + + "// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", + lightTextureFrag: + "uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n", + phongVert: + "precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", + phongFrag: + e + + "// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n", + fontVert: + "IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n", + fontFrag: + "#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of 't' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n", + lineVert: + T + + "/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n", + lineFrag: + T + + "precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", + pointVert: + "IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n", + pointFrag: + "precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n", + imageLightVert: + "precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n", + imageLightDiffusedFrag: + "precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}", + imageLightSpecularFrag: + "precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n", + }; + for (x in M) + M[x] = + "#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n" + + M[x]; + j( + (e = {}), + l.GRAY, + "precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n", + ), + j( + e, + l.ERODE, + "// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", + ), + j( + e, + l.DILATE, + "// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", + ), + j( + e, + l.BLUR, + "precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n", + ), + j( + e, + l.POSTERIZE, + "// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n", + ), + j( + e, + l.OPAQUE, + "// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n", + ), + j( + e, + l.INVERT, + "// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n", + ), + j( + e, + l.THRESHOLD, + "// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n", + ); + var E = e; + function k(e, t, r, o, n, s, i, a, l, u) { + var c = t.getParameter(t.FRAMEBUFFER_BINDING), + r = (t.bindFramebuffer(t.FRAMEBUFFER, r), a === t.RGBA ? 4 : 3), + d = s * i * r, + h = l === t.UNSIGNED_BYTE ? Uint8Array : Float32Array; + if ( + ((e instanceof h && e.length === d) || (e = new h(d)), + t.readPixels(o, u ? u - n - i : n, s, i, a, l, e), + t.bindFramebuffer(t.FRAMEBUFFER, c), + u) + ) + for ( + var f = Math.floor(i / 2), p = new h(s * r), m = 0; + m < f; + m++ + ) { + var y = m * s * 4, + g = (i - m - 1) * s * 4; + p.set(e.subarray(y, y + 4 * s)), + e.copyWithin(y, g, g + 4 * s), + e.set(p, g); + } + return e; + } + function C(e, t, r, o, n, s, i) { + var a = e.getParameter(e.FRAMEBUFFER_BINDING), + t = (e.bindFramebuffer(e.FRAMEBUFFER, t), n === e.RGBA ? 4 : 3), + t = new (s === e.UNSIGNED_BYTE ? Uint8Array : Float32Array)(t); + return ( + e.readPixels(r, i ? i - o - 1 : o, 1, 1, n, s, t), + e.bindFramebuffer(e.FRAMEBUFFER, a), + Array.from(t) + ); + } + (g.default.prototype.setAttributes = function (e, t) { + if (void 0 === this._glAttributes) + console.log( + "You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.", + ); + else { + var r = !0; + if ( + (void 0 !== t + ? (null === this._glAttributes && (this._glAttributes = {}), + this._glAttributes[e] !== t && + ((this._glAttributes[e] = t), (r = !1))) + : e instanceof Object && + this._glAttributes !== e && + ((this._glAttributes = e), (r = !1)), + this._renderer.isP3D && !r) + ) { + if (!this._setupDone) + for (var o in this._renderer.retainedMode.geometry) + if (this._renderer.retainedMode.geometry.hasOwnProperty(o)) + return void g.default._friendlyError( + "Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()", + ); + this.push(), + this._renderer._resetContext(), + this.pop(), + this._renderer._curCamera && + (this._renderer._curCamera._renderer = this._renderer); + } + } + }), + (g.default.RendererGL = (function (e) { + var t = s; + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && m(t, e); + var r, + n = y(s); + function s(e, t, r, o) { + if (this instanceof s) + return ( + (e = n.call(this, e, t, r))._setAttributeDefaults(t), + e._initContext(), + (e.isP3D = !0), + (e.geometryBuilder = void 0), + (e.GL = e.drawingContext), + e._pInst._setProperty("drawingContext", e.drawingContext), + (e._isErasing = !1), + (e._clipDepths = []), + (e._isClipApplied = !1), + (e._stencilTestOn = !1), + (e._enableLighting = !1), + (e.ambientLightColors = []), + (e.specularColors = [1, 1, 1]), + (e.directionalLightDirections = []), + (e.directionalLightDiffuseColors = []), + (e.directionalLightSpecularColors = []), + (e.pointLightPositions = []), + (e.pointLightDiffuseColors = []), + (e.pointLightSpecularColors = []), + (e.spotLightPositions = []), + (e.spotLightDirections = []), + (e.spotLightDiffuseColors = []), + (e.spotLightSpecularColors = []), + (e.spotLightAngle = []), + (e.spotLightConc = []), + (e.activeImageLight = null), + (e.diffusedTextures = new Map()), + (e.specularTextures = new Map()), + (e.drawMode = l.FILL), + (e.curFillColor = e._cachedFillStyle = [1, 1, 1, 1]), + (e.curAmbientColor = e._cachedFillStyle = [1, 1, 1, 1]), + (e.curSpecularColor = e._cachedFillStyle = [0, 0, 0, 0]), + (e.curEmissiveColor = e._cachedFillStyle = [0, 0, 0, 0]), + (e.curStrokeColor = e._cachedStrokeStyle = [0, 0, 0, 1]), + (e.curBlendMode = l.BLEND), + (e._cachedBlendMode = void 0), + e.webglVersion === l.WEBGL2 + ? (e.blendExt = e.GL) + : (e.blendExt = e.GL.getExtension("EXT_blend_minmax")), + (e._isBlending = !1), + (e._hasSetAmbient = !1), + (e._useSpecularMaterial = !1), + (e._useEmissiveMaterial = !1), + (e._useNormalMaterial = !1), + (e._useShininess = 1), + (e._useLineColor = !1), + (e._useVertexColor = !1), + (e.registerEnabled = new Set()), + (e._tint = [255, 255, 255, 255]), + (e.constantAttenuation = 1), + (e.linearAttenuation = 0), + (e.quadraticAttenuation = 0), + (e.uMVMatrix = new g.default.Matrix()), + (e.uPMatrix = new g.default.Matrix()), + (e.uNMatrix = new g.default.Matrix("mat3")), + (e._currentNormal = new g.default.Vector(0, 0, 1)), + (e._curCamera = new g.default.Camera(v(e))), + e._curCamera._computeCameraDefaultSettings(), + e._curCamera._setDefaultCamera(), + (e.filterCamera = new g.default.Camera(v(e))), + e.filterCamera._computeCameraDefaultSettings(), + e.filterCamera._setDefaultCamera(), + (e.prevTouches = []), + (e.zoomVelocity = 0), + (e.rotateVelocity = new g.default.Vector(0, 0)), + (e.moveVelocity = new g.default.Vector(0, 0)), + (e.executeZoom = !1), + (e.executeRotateAndMove = !1), + (e._defaultLightShader = void 0), + (e._defaultImmediateModeShader = void 0), + (e._defaultNormalShader = void 0), + (e._defaultColorShader = void 0), + (e._defaultPointShader = void 0), + (e.userFillShader = void 0), + (e.userStrokeShader = void 0), + (e.userPointShader = void 0), + (e.retainedMode = { + geometry: {}, + buffers: { + stroke: [ + new g.default.RenderBuffer( + 4, + "lineVertexColors", + "lineColorBuffer", + "aVertexColor", + v(e), + ), + new g.default.RenderBuffer( + 3, + "lineVertices", + "lineVerticesBuffer", + "aPosition", + v(e), + ), + new g.default.RenderBuffer( + 3, + "lineTangentsIn", + "lineTangentsInBuffer", + "aTangentIn", + v(e), + ), + new g.default.RenderBuffer( + 3, + "lineTangentsOut", + "lineTangentsOutBuffer", + "aTangentOut", + v(e), + ), + new g.default.RenderBuffer( + 1, + "lineSides", + "lineSidesBuffer", + "aSide", + v(e), + ), + ], + fill: [ + new g.default.RenderBuffer( + 3, + "vertices", + "vertexBuffer", + "aPosition", + v(e), + e._vToNArray, + ), + new g.default.RenderBuffer( + 3, + "vertexNormals", + "normalBuffer", + "aNormal", + v(e), + e._vToNArray, + ), + new g.default.RenderBuffer( + 4, + "vertexColors", + "colorBuffer", + "aVertexColor", + v(e), + ), + new g.default.RenderBuffer( + 3, + "vertexAmbients", + "ambientBuffer", + "aAmbientColor", + v(e), + ), + new g.default.RenderBuffer( + 2, + "uvs", + "uvBuffer", + "aTexCoord", + v(e), + e._flatten, + ), + ], + text: [ + new g.default.RenderBuffer( + 3, + "vertices", + "vertexBuffer", + "aPosition", + v(e), + e._vToNArray, + ), + new g.default.RenderBuffer( + 2, + "uvs", + "uvBuffer", + "aTexCoord", + v(e), + e._flatten, + ), + ], + }, + }), + (e.immediateMode = { + geometry: new g.default.Geometry(), + shapeMode: l.TRIANGLE_FAN, + contourIndices: [], + _bezierVertex: [], + _quadraticVertex: [], + _curveVertex: [], + buffers: { + fill: [ + new g.default.RenderBuffer( + 3, + "vertices", + "vertexBuffer", + "aPosition", + v(e), + e._vToNArray, + ), + new g.default.RenderBuffer( + 3, + "vertexNormals", + "normalBuffer", + "aNormal", + v(e), + e._vToNArray, + ), + new g.default.RenderBuffer( + 4, + "vertexColors", + "colorBuffer", + "aVertexColor", + v(e), + ), + new g.default.RenderBuffer( + 3, + "vertexAmbients", + "ambientBuffer", + "aAmbientColor", + v(e), + ), + new g.default.RenderBuffer( + 2, + "uvs", + "uvBuffer", + "aTexCoord", + v(e), + e._flatten, + ), + ], + stroke: [ + new g.default.RenderBuffer( + 4, + "lineVertexColors", + "lineColorBuffer", + "aVertexColor", + v(e), + ), + new g.default.RenderBuffer( + 3, + "lineVertices", + "lineVerticesBuffer", + "aPosition", + v(e), + ), + new g.default.RenderBuffer( + 3, + "lineTangentsIn", + "lineTangentsInBuffer", + "aTangentIn", + v(e), + ), + new g.default.RenderBuffer( + 3, + "lineTangentsOut", + "lineTangentsOutBuffer", + "aTangentOut", + v(e), + ), + new g.default.RenderBuffer( + 1, + "lineSides", + "lineSidesBuffer", + "aSide", + v(e), + ), + ], + point: e.GL.createBuffer(), + }, + }), + (e.pointSize = 5), + (e.curStrokeWeight = 1), + (e.curStrokeCap = l.ROUND), + (e.curStrokeJoin = l.ROUND), + (e.textures = new Map()), + (e.framebuffers = new Set()), + (e.activeFramebuffers = []), + (e.filterShader = void 0), + (e.filterLayer = void 0), + (e.filterLayerTemp = void 0), + (e.defaultFilterShaders = {}), + (e.textureMode = l.IMAGE), + (e.textureWrapX = l.CLAMP), + (e.textureWrapY = l.CLAMP), + (e._tex = null), + (e._curveTightness = 6), + (e._lookUpTableBezier = []), + (e._lookUpTableQuadratic = []), + (e._lutBezierDetail = 0), + (e._lutQuadraticDetail = 0), + (e.isProcessingVertices = !1), + (e._tessy = e._initTessy()), + (e.fontInfos = {}), + (e._curShader = void 0), + e + ); + throw new TypeError("Cannot call a class as a function"); + } + return ( + (t = s), + (e = [ + { + key: "beginGeometry", + value: function () { + if (this.geometryBuilder) + throw new Error( + "It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.", + ); + this.geometryBuilder = new a.default(this); + }, + }, + { + key: "endGeometry", + value: function () { + var e; + if (this.geometryBuilder) + return ( + (e = this.geometryBuilder.finish()), + (this.geometryBuilder = void 0), + e + ); + throw new Error( + "Make sure you call beginGeometry() before endGeometry()!", + ); + }, + }, + { + key: "buildGeometry", + value: function (e) { + return this.beginGeometry(), e(), this.endGeometry(); + }, + }, + { + key: "_setAttributeDefaults", + value: function (e) { + var t = { + alpha: !0, + depth: !0, + stencil: !0, + antialias: navigator.userAgent + .toLowerCase() + .includes("safari"), + premultipliedAlpha: !0, + preserveDrawingBuffer: !0, + perPixelLighting: !0, + version: 2, + }; + null === e._glAttributes + ? (e._glAttributes = t) + : (e._glAttributes = Object.assign(t, e._glAttributes)); + }, + }, + { + key: "_initContext", + value: function () { + if ( + (1 !== this._pInst._glAttributes.version && + (this.drawingContext = this.canvas.getContext( + "webgl2", + this._pInst._glAttributes, + )), + (this.webglVersion = this.drawingContext + ? l.WEBGL2 + : l.WEBGL), + this._pInst._setProperty( + "webglVersion", + this.webglVersion, + ), + this.drawingContext || + (this.drawingContext = + this.canvas.getContext( + "webgl", + this._pInst._glAttributes, + ) || + this.canvas.getContext( + "experimental-webgl", + this._pInst._glAttributes, + )), + null === this.drawingContext) + ) + throw new Error("Error creating webgl context"); + var e = this.drawingContext; + e.enable(e.DEPTH_TEST), + e.depthFunc(e.LEQUAL), + e.viewport( + 0, + 0, + e.drawingBufferWidth, + e.drawingBufferHeight, + ), + e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), + (this._viewport = this.drawingContext.getParameter( + this.drawingContext.VIEWPORT, + )); + }, + }, + { + key: "_resetContext", + value: function (e, t) { + var r, + o = this.width, + n = this.height, + s = this.canvas.id, + i = this._pInst instanceof g.default.Graphics, + s = + (i + ? ((r = this._pInst).canvas.parentNode.removeChild( + r.canvas, + ), + (r.canvas = document.createElement("canvas")), + (r._pInst._userNode || document.body).appendChild( + r.canvas, + ), + g.default.Element.call(r, r.canvas, r._pInst), + (r.width = o), + (r.height = n)) + : ((r = this.canvas) && r.parentNode.removeChild(r), + ((r = document.createElement("canvas")).id = s), + ( + this._pInst._userNode || document.body + ).appendChild(r), + (this._pInst.canvas = r), + (this.canvas = r)), + new g.default.RendererGL( + this._pInst.canvas, + this._pInst, + !i, + )); + this._pInst._setProperty("_renderer", s), + s.resize(o, n), + s._applyDefaults(), + i || this._pInst._elements.push(s), + "function" == typeof t && + setTimeout(function () { + t.apply(window._renderer, e); + }, 0); + }, + }, + { + key: "_update", + value: function () { + this.uMVMatrix.set( + this._curCamera.cameraMatrix.mat4[0], + this._curCamera.cameraMatrix.mat4[1], + this._curCamera.cameraMatrix.mat4[2], + this._curCamera.cameraMatrix.mat4[3], + this._curCamera.cameraMatrix.mat4[4], + this._curCamera.cameraMatrix.mat4[5], + this._curCamera.cameraMatrix.mat4[6], + this._curCamera.cameraMatrix.mat4[7], + this._curCamera.cameraMatrix.mat4[8], + this._curCamera.cameraMatrix.mat4[9], + this._curCamera.cameraMatrix.mat4[10], + this._curCamera.cameraMatrix.mat4[11], + this._curCamera.cameraMatrix.mat4[12], + this._curCamera.cameraMatrix.mat4[13], + this._curCamera.cameraMatrix.mat4[14], + this._curCamera.cameraMatrix.mat4[15], + ), + (this.ambientLightColors.length = 0), + (this.specularColors = [1, 1, 1]), + (this.directionalLightDirections.length = 0), + (this.directionalLightDiffuseColors.length = 0), + (this.directionalLightSpecularColors.length = 0), + (this.pointLightPositions.length = 0), + (this.pointLightDiffuseColors.length = 0), + (this.pointLightSpecularColors.length = 0), + (this.spotLightPositions.length = 0), + (this.spotLightDirections.length = 0), + (this.spotLightDiffuseColors.length = 0), + (this.spotLightSpecularColors.length = 0), + (this.spotLightAngle.length = 0), + (this.spotLightConc.length = 0), + (this._enableLighting = !1), + (this._tint = [255, 255, 255, 255]), + this.GL.clearStencil(0), + this.GL.clear( + this.GL.DEPTH_BUFFER_BIT | this.GL.STENCIL_BUFFER_BIT, + ), + this.GL.disable(this.GL.STENCIL_TEST); + }, + }, + { + key: "background", + value: function () { + var e = (e = this._pInst).color.apply(e, arguments), + t = e.levels[0] / 255, + r = e.levels[1] / 255, + o = e.levels[2] / 255, + e = e.levels[3] / 255; + this.clear(t, r, o, e); + }, + }, + { + key: "fill", + value: function (e, t, r, o) { + var n = g.default.prototype.color.apply( + this._pInst, + arguments, + ); + (this.curFillColor = n._array), + (this.drawMode = l.FILL), + (this._useNormalMaterial = !1), + (this._tex = null); + }, + }, + { + key: "stroke", + value: function (e, t, r, o) { + var n = g.default.prototype.color.apply( + this._pInst, + arguments, + ); + this.curStrokeColor = n._array; + }, + }, + { + key: "strokeCap", + value: function (e) { + this.curStrokeCap = e; + }, + }, + { + key: "strokeJoin", + value: function (e) { + this.curStrokeJoin = e; + }, + }, + { + key: "getFilterLayer", + value: function () { + return ( + this.filterLayer || + (this.filterLayer = this._pInst.createFramebuffer()), + this.filterLayer + ); + }, + }, + { + key: "getFilterLayerTemp", + value: function () { + return ( + this.filterLayerTemp || + (this.filterLayerTemp = + this._pInst.createFramebuffer()), + this.filterLayerTemp + ); + }, + }, + { + key: "matchSize", + value: function (e, t) { + (e.width === t.width && e.height === t.height) || + e.resize(t.width, t.height), + e.pixelDensity() !== t.pixelDensity() && + e.pixelDensity(t.pixelDensity()); + }, + }, + { + key: "filter", + value: function () { + var e, + t, + r = this, + o = this.getFilterLayer(), + n = void 0, + s = void 0, + i = + ("string" == + typeof (arguments.length <= 0 ? void 0 : arguments[0]) + ? ((s = + arguments.length <= 0 ? void 0 : arguments[0]), + j((e = {}), l.BLUR, 3), + j(e, l.POSTERIZE, 4), + j(e, l.THRESHOLD, 0.5), + (n = + s in (e = e) && + void 0 === + (arguments.length <= 1 + ? void 0 + : arguments[1]) + ? e[s] + : arguments.length <= 1 + ? void 0 + : arguments[1]), + s in this.defaultFilterShaders || + (this.defaultFilterShaders[s] = + new g.default.Shader( + o._renderer, + "uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n", + E[s], + )), + (this.filterShader = + this.defaultFilterShaders[s])) + : (this.filterShader = + arguments.length <= 0 ? void 0 : arguments[0]), + this.activeFramebuffer() || this), + a = + (this.matchSize(o, i), + i !== this && + (this.filterCamera = + this.getFilterLayer().createCamera()), + o.draw(function () { + return r._pInst.clear(); + }), + [ + 1 / (i.width * i.pixelDensity()), + 1 / (i.height * i.pixelDensity()), + ]); + s === l.BLUR + ? ((t = this.getFilterLayerTemp()), + this.matchSize(t, i), + this._pInst.push(), + this._pInst.noStroke(), + this._pInst.shader(this.filterShader), + this.filterShader.setUniform("texelSize", a), + this.filterShader.setUniform("canvasSize", [ + i.width, + i.height, + ]), + this.filterShader.setUniform( + "radius", + Math.max(1, n), + ), + t.draw(function () { + r.filterShader.setUniform("direction", [1, 0]), + r.filterShader.setUniform("tex0", i), + r._pInst.clear(), + r._pInst.shader(r.filterShader), + r._pInst.rect( + -i.width / 2, + -i.height / 2, + i.width, + i.height, + ); + }), + o.draw(function () { + r.filterShader.setUniform("direction", [0, 1]), + r.filterShader.setUniform("tex0", t), + r._pInst.clear(), + r._pInst.shader(r.filterShader), + r._pInst.rect( + -i.width / 2, + -i.height / 2, + i.width, + i.height, + ); + }), + this._pInst.pop()) + : o.draw(function () { + r._pInst.noStroke(), + r._pInst.shader(r.filterShader), + r.filterShader.setUniform("tex0", i), + r.filterShader.setUniform("texelSize", a), + r.filterShader.setUniform("canvasSize", [ + i.width, + i.height, + ]), + r.filterShader.setUniform("filterParameter", n), + r._pInst.rect( + -i.width / 2, + -i.height / 2, + i.width, + i.height, + ); + }), + this._pInst.push(), + this._pInst.noStroke(), + this.clear(), + this._pInst.push(), + this._pInst.imageMode(l.CORNER), + this._pInst.blendMode(l.BLEND), + this.filterCamera._resize(), + this._pInst.setCamera(this.filterCamera), + this._pInst.resetMatrix(), + this._pInst.image( + o, + -this.width / 2, + -this.height / 2, + this.width, + this.height, + ), + this._pInst.pop(), + this._pInst.pop(); + }, + }, + { + key: "pixelDensity", + value: function (e) { + return e + ? this._pInst.pixelDensity(e) + : this._pInst.pixelDensity(); + }, + }, + { + key: "blendMode", + value: function (e) { + e === l.DARKEST || + e === l.LIGHTEST || + e === l.ADD || + e === l.BLEND || + e === l.SUBTRACT || + e === l.SCREEN || + e === l.EXCLUSION || + e === l.REPLACE || + e === l.MULTIPLY || + e === l.REMOVE + ? (this.curBlendMode = e) + : (e !== l.BURN && + e !== l.OVERLAY && + e !== l.HARD_LIGHT && + e !== l.SOFT_LIGHT && + e !== l.DODGE) || + console.warn( + "BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.", + ); + }, + }, + { + key: "erase", + value: function (e, t) { + this._isErasing || + ((this._cachedBlendMode = this.curBlendMode), + (this._isErasing = !0), + this.blendMode(l.REMOVE), + (this._cachedFillStyle = this.curFillColor.slice()), + (this.curFillColor = [1, 1, 1, e / 255]), + (this._cachedStrokeStyle = this.curStrokeColor.slice()), + (this.curStrokeColor = [1, 1, 1, t / 255])); + }, + }, + { + key: "noErase", + value: function () { + var e; + this._isErasing && + ((this.curFillColor = this._cachedFillStyle.slice()), + (this.curStrokeColor = this._cachedStrokeStyle.slice()), + (e = this.curBlendMode), + this.blendMode(this._cachedBlendMode), + (this._cachedBlendMode = e), + (this._isErasing = !1), + this._applyBlendMode()); + }, + }, + { + key: "drawTarget", + value: function () { + return ( + this.activeFramebuffers[ + this.activeFramebuffers.length - 1 + ] || this + ); + }, + }, + { + key: "beginClip", + value: function () { + var e = + 0 < arguments.length && void 0 !== arguments[0] + ? arguments[0] + : {}, + e = + (p(b(s.prototype), "beginClip", this).call(this, e), + (this.drawTarget()._isClipApplied = !0), + this.GL); + e.clearStencil(0), + e.clear(e.STENCIL_BUFFER_BIT), + e.enable(e.STENCIL_TEST), + (this._stencilTestOn = !0), + e.stencilFunc(e.ALWAYS, 1, 255), + e.stencilOp(e.KEEP, e.KEEP, e.REPLACE), + e.disable(e.DEPTH_TEST), + this._pInst.push(), + this._pInst.resetShader(), + this._doFill && this._pInst.fill(0, 0), + this._doStroke && this._pInst.stroke(0, 0); + }, + }, + { + key: "endClip", + value: function () { + this._pInst.pop(); + var e = this.GL; + e.stencilOp(e.KEEP, e.KEEP, e.KEEP), + e.stencilFunc( + this._clipInvert ? e.EQUAL : e.NOTEQUAL, + 0, + 255, + ), + e.enable(e.DEPTH_TEST), + this._clipDepths.push(this._pushPopDepth), + p(b(s.prototype), "endClip", this).call(this); + }, + }, + { + key: "_clearClip", + value: function () { + this.GL.clearStencil(1), + this.GL.clear(this.GL.STENCIL_BUFFER_BIT), + 0 < this._clipDepths.length && this._clipDepths.pop(), + (this.drawTarget()._isClipApplied = !1); + }, + }, + { + key: "strokeWeight", + value: function (e) { + this.curStrokeWeight !== e && + ((this.pointSize = e), (this.curStrokeWeight = e)); + }, + }, + { + key: "_getPixel", + value: function (e, t) { + var r = this.GL; + return C( + r, + null, + e, + t, + r.RGBA, + r.UNSIGNED_BYTE, + this._pInst.height * this._pInst.pixelDensity(), + ); + }, + }, + { + key: "loadPixels", + value: function () { + var e, + t, + r = this._pixelsState; + !0 !== this._pInst._glAttributes.preserveDrawingBuffer + ? console.log( + "loadPixels only works in WebGL when preserveDrawingBuffer is true.", + ) + : ((e = this._pInst._pixelDensity), + (t = this.GL), + r._setProperty( + "pixels", + k( + r.pixels, + t, + null, + 0, + 0, + this.width * e, + this.height * e, + t.RGBA, + t.UNSIGNED_BYTE, + this.height * e, + ), + )); + }, + }, + { + key: "updatePixels", + value: function () { + var e = this._getTempFramebuffer(); + (e.pixels = this._pixelsState.pixels), + e.updatePixels(), + this._pInst.push(), + this._pInst.resetMatrix(), + this._pInst.clear(), + this._pInst.imageMode(l.CENTER), + this._pInst.image(e, 0, 0), + this._pInst.pop(), + this.GL.clearDepth(1), + this.GL.clear(this.GL.DEPTH_BUFFER_BIT); + }, + }, + { + key: "_getTempFramebuffer", + value: function () { + return ( + this._tempFramebuffer || + (this._tempFramebuffer = + this._pInst.createFramebuffer({ + format: l.UNSIGNED_BYTE, + useDepth: this._pInst._glAttributes.depth, + depthFormat: l.UNSIGNED_INT, + antialias: this._pInst._glAttributes.antialias, + })), + this._tempFramebuffer + ); + }, + }, + { + key: "geometryInHash", + value: function (e) { + return void 0 !== this.retainedMode.geometry[e]; + }, + }, + { + key: "viewport", + value: function (e, t) { + (this._viewport = [0, 0, e, t]), + this.GL.viewport(0, 0, e, t); + }, + }, + { + key: "resize", + value: function (t, r) { + g.default.Renderer.prototype.resize.call(this, t, r), + (this._origViewport = { + width: this.GL.drawingBufferWidth, + height: this.GL.drawingBufferHeight, + }), + this.viewport( + this._origViewport.width, + this._origViewport.height, + ), + this._curCamera._resize(); + var t = this._pixelsState, + e = + (void 0 !== t.pixels && + t._setProperty( + "pixels", + new Uint8Array( + this.GL.drawingBufferWidth * + this.GL.drawingBufferHeight * + 4, + ), + ), + !0), + r = !1, + t = void 0; + try { + for ( + var o, n = this.framebuffers[Symbol.iterator](); + !(e = (o = n.next()).done); + e = !0 + ) + o.value._canvasSizeChanged(); + } catch (e) { + (r = !0), (t = e); + } finally { + try { + e || null == n.return || n.return(); + } finally { + if (r) throw t; + } + } + }, + }, + { + key: "clear", + value: function () { + var e = + (arguments.length <= 0 ? void 0 : arguments[0]) || 0, + t = + (arguments.length <= 1 ? void 0 : arguments[1]) || 0, + r = + (arguments.length <= 2 ? void 0 : arguments[2]) || 0, + o = + (arguments.length <= 3 ? void 0 : arguments[3]) || 0, + n = this.activeFramebuffer(); + n && + n.format === l.UNSIGNED_BYTE && + !n.antialias && + 0 === o && + (o = 1e-10), + this.GL.clearColor(e * o, t * o, r * o, o), + this.GL.clearDepth(1), + this.GL.clear( + this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT, + ); + }, + }, + { + key: "applyMatrix", + value: function (e, t, r, o, n, s) { + 16 === arguments.length + ? g.default.Matrix.prototype.apply.apply( + this.uMVMatrix, + arguments, + ) + : this.uMVMatrix.apply([ + e, + t, + 0, + 0, + r, + o, + 0, + 0, + 0, + 0, + 1, + 0, + n, + s, + 0, + 1, + ]); + }, + }, + { + key: "translate", + value: function (e, t, r) { + return ( + e instanceof g.default.Vector && + ((r = e.z), (t = e.y), (e = e.x)), + this.uMVMatrix.translate([e, t, r]), + this + ); + }, + }, + { + key: "scale", + value: function (e, t, r) { + return this.uMVMatrix.scale(e, t, r), this; + }, + }, + { + key: "rotate", + value: function (e, t) { + return void 0 === t + ? this.rotateZ(e) + : (g.default.Matrix.prototype.rotate.apply( + this.uMVMatrix, + arguments, + ), + this); + }, + }, + { + key: "rotateX", + value: function (e) { + return this.rotate(e, 1, 0, 0), this; + }, + }, + { + key: "rotateY", + value: function (e) { + return this.rotate(e, 0, 1, 0), this; + }, + }, + { + key: "rotateZ", + value: function (e) { + return this.rotate(e, 0, 0, 1), this; + }, + }, + { + key: "push", + value: function () { + var e = g.default.Renderer.prototype.push.apply(this), + t = e.properties; + return ( + (t.uMVMatrix = this.uMVMatrix.copy()), + (t.uPMatrix = this.uPMatrix.copy()), + (t._curCamera = this._curCamera), + (this._curCamera = this._curCamera.copy()), + (t.ambientLightColors = + this.ambientLightColors.slice()), + (t.specularColors = this.specularColors.slice()), + (t.directionalLightDirections = + this.directionalLightDirections.slice()), + (t.directionalLightDiffuseColors = + this.directionalLightDiffuseColors.slice()), + (t.directionalLightSpecularColors = + this.directionalLightSpecularColors.slice()), + (t.pointLightPositions = + this.pointLightPositions.slice()), + (t.pointLightDiffuseColors = + this.pointLightDiffuseColors.slice()), + (t.pointLightSpecularColors = + this.pointLightSpecularColors.slice()), + (t.spotLightPositions = + this.spotLightPositions.slice()), + (t.spotLightDirections = + this.spotLightDirections.slice()), + (t.spotLightDiffuseColors = + this.spotLightDiffuseColors.slice()), + (t.spotLightSpecularColors = + this.spotLightSpecularColors.slice()), + (t.spotLightAngle = this.spotLightAngle.slice()), + (t.spotLightConc = this.spotLightConc.slice()), + (t.userFillShader = this.userFillShader), + (t.userStrokeShader = this.userStrokeShader), + (t.userPointShader = this.userPointShader), + (t.pointSize = this.pointSize), + (t.curStrokeWeight = this.curStrokeWeight), + (t.curStrokeColor = this.curStrokeColor), + (t.curFillColor = this.curFillColor), + (t.curAmbientColor = this.curAmbientColor), + (t.curSpecularColor = this.curSpecularColor), + (t.curEmissiveColor = this.curEmissiveColor), + (t._hasSetAmbient = this._hasSetAmbient), + (t._useSpecularMaterial = this._useSpecularMaterial), + (t._useEmissiveMaterial = this._useEmissiveMaterial), + (t._useShininess = this._useShininess), + (t.constantAttenuation = this.constantAttenuation), + (t.linearAttenuation = this.linearAttenuation), + (t.quadraticAttenuation = this.quadraticAttenuation), + (t._enableLighting = this._enableLighting), + (t._useNormalMaterial = this._useNormalMaterial), + (t._tex = this._tex), + (t.drawMode = this.drawMode), + (t._currentNormal = this._currentNormal), + (t.curBlendMode = this.curBlendMode), + (t.activeImageLight = this.activeImageLight), + e + ); + }, + }, + { + key: "pop", + value: function () { + var e; + 0 < this._clipDepths.length && + this._pushPopDepth === + this._clipDepths[this._clipDepths.length - 1] && + this._clearClip(); + for ( + var t = arguments.length, r = new Array(t), o = 0; + o < t; + o++ + ) + r[o] = arguments[o]; + (e = p(b(s.prototype), "pop", this)).call.apply( + e, + [this].concat(r), + ), + this._applyStencilTestIfClipping(); + }, + }, + { + key: "_applyStencilTestIfClipping", + value: function () { + var e = this.drawTarget(); + e._isClipApplied !== this._stencilTestOn && + (e._isClipApplied + ? (this.GL.enable(this.GL.STENCIL_TEST), + (this._stencilTestOn = !0)) + : (this.GL.disable(this.GL.STENCIL_TEST), + (this._stencilTestOn = !1))); + }, + }, + { + key: "resetMatrix", + value: function () { + return ( + this.uMVMatrix.set( + this._curCamera.cameraMatrix.mat4[0], + this._curCamera.cameraMatrix.mat4[1], + this._curCamera.cameraMatrix.mat4[2], + this._curCamera.cameraMatrix.mat4[3], + this._curCamera.cameraMatrix.mat4[4], + this._curCamera.cameraMatrix.mat4[5], + this._curCamera.cameraMatrix.mat4[6], + this._curCamera.cameraMatrix.mat4[7], + this._curCamera.cameraMatrix.mat4[8], + this._curCamera.cameraMatrix.mat4[9], + this._curCamera.cameraMatrix.mat4[10], + this._curCamera.cameraMatrix.mat4[11], + this._curCamera.cameraMatrix.mat4[12], + this._curCamera.cameraMatrix.mat4[13], + this._curCamera.cameraMatrix.mat4[14], + this._curCamera.cameraMatrix.mat4[15], + ), + this + ); + }, + }, + { + key: "_getImmediateStrokeShader", + value: function () { + var e = this.userStrokeShader; + return e && e.isStrokeShader() + ? e + : this._getLineShader(); + }, + }, + { + key: "_getRetainedStrokeShader", + value: function () { + return this._getImmediateStrokeShader(); + }, + }, + { + key: "_getImmediateFillShader", + value: function () { + var e = this.userFillShader; + if ( + this._useNormalMaterial && + (!e || !e.isNormalShader()) + ) + return this._getNormalShader(); + if (this._enableLighting) { + if (!e || !e.isLightShader()) + return this._getLightShader(); + } else if (this._tex) { + if (!e || !e.isTextureShader()) + return this._getLightShader(); + } else if (!e) return this._getImmediateModeShader(); + return e; + }, + }, + { + key: "_getRetainedFillShader", + value: function () { + if (this._useNormalMaterial) + return this._getNormalShader(); + var e = this.userFillShader; + if (this._enableLighting) { + if (!e || !e.isLightShader()) + return this._getLightShader(); + } else if (this._tex) { + if (!e || !e.isTextureShader()) + return this._getLightShader(); + } else if (!e) return this._getColorShader(); + return e; + }, + }, + { + key: "_getImmediatePointShader", + value: function () { + var e = this.userPointShader; + return e && e.isPointShader() + ? e + : this._getPointShader(); + }, + }, + { + key: "_getRetainedLineShader", + value: function () { + return this._getImmediateLineShader(); + }, + }, + { + key: "_getLightShader", + value: function () { + return ( + this._defaultLightShader || + (this._pInst._glAttributes.perPixelLighting + ? (this._defaultLightShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix( + "vert", + "highp", + ) + M.phongVert, + this._webGL2CompatibilityPrefix( + "frag", + "highp", + ) + M.phongFrag, + )) + : (this._defaultLightShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix( + "vert", + "highp", + ) + M.lightVert, + this._webGL2CompatibilityPrefix( + "frag", + "highp", + ) + M.lightTextureFrag, + ))), + this._defaultLightShader + ); + }, + }, + { + key: "_getImmediateModeShader", + value: function () { + return ( + this._defaultImmediateModeShader || + (this._defaultImmediateModeShader = + new g.default.Shader( + this, + this._webGL2CompatibilityPrefix( + "vert", + "mediump", + ) + M.immediateVert, + this._webGL2CompatibilityPrefix( + "frag", + "mediump", + ) + M.vertexColorFrag, + )), + this._defaultImmediateModeShader + ); + }, + }, + { + key: "_getNormalShader", + value: function () { + return ( + this._defaultNormalShader || + (this._defaultNormalShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + M.normalVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + M.normalFrag, + )), + this._defaultNormalShader + ); + }, + }, + { + key: "_getColorShader", + value: function () { + return ( + this._defaultColorShader || + (this._defaultColorShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + M.normalVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + M.basicFrag, + )), + this._defaultColorShader + ); + }, + }, + { + key: "_getPointShader", + value: function () { + return ( + this._defaultPointShader || + (this._defaultPointShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + M.pointVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + M.pointFrag, + )), + this._defaultPointShader + ); + }, + }, + { + key: "_getLineShader", + value: function () { + return ( + this._defaultLineShader || + (this._defaultLineShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + M.lineVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + M.lineFrag, + )), + this._defaultLineShader + ); + }, + }, + { + key: "_getFontShader", + value: function () { + return ( + this._defaultFontShader || + (this.webglVersion === l.WEBGL && + this.GL.getExtension("OES_standard_derivatives"), + (this._defaultFontShader = new g.default.Shader( + this, + this._webGL2CompatibilityPrefix("vert", "mediump") + + M.fontVert, + this._webGL2CompatibilityPrefix("frag", "mediump") + + M.fontFrag, + ))), + this._defaultFontShader + ); + }, + }, + { + key: "_webGL2CompatibilityPrefix", + value: function (e, t) { + var r = ""; + return ( + this.webglVersion === l.WEBGL2 && + (r += "#version 300 es\n#define WEBGL2\n"), + "vert" === e + ? (r += "#define VERTEX_SHADER\n") + : "frag" === e && (r += "#define FRAGMENT_SHADER\n"), + t && (r += "precision ".concat(t, " float;\n")), + r + ); + }, + }, + { + key: "_getEmptyTexture", + value: function () { + var e; + return ( + this._emptyTexture || + ((e = new g.default.Image(1, 1)).set(0, 0, 255), + (this._emptyTexture = new g.default.Texture( + this, + e, + ))), + this._emptyTexture + ); + }, + }, + { + key: "getTexture", + value: function (e) { + e instanceof g.default.Framebuffer && (e = e.color); + var t = this.textures.get(e); + return ( + t || + ((t = new g.default.Texture(this, e)), + this.textures.set(e, t), + t) + ); + }, + }, + { + key: "getDiffusedTexture", + value: function (e) { + var t, r; + return null != this.diffusedTextures.get(e) + ? this.diffusedTextures.get(e) + : (0, + (t = Math.floor((e.height / e.width) * 200)), + (r = (t = this._pInst.createGraphics( + 200, + t, + l.WEBGL, + )).createShader( + M.imageLightVert, + M.imageLightDiffusedFrag, + )), + t.shader(r), + r.setUniform("environmentMap", e), + t.noStroke(), + t.rectMode(t.CENTER), + t.rect(0, 0, t.width, t.height), + this.diffusedTextures.set(e, t), + t); + }, + }, + { + key: "getSpecularTexture", + value: function (e) { + if (null != this.specularTextures.get(e)) + return this.specularTextures.get(e); + var t, + r = [], + o = this._pInst.createGraphics(512, 512, l.WEBGL), + n = Math.log(512) / Math.log(2); + o.pixelDensity(1); + for (var s = 512; 1 <= s; s /= 2) { + o.resizeCanvas(s, s); + var i = 1 - Math.log(s) / Math.log(2) / n, + a = o.createShader( + M.imageLightVert, + M.imageLightSpecularFrag, + ); + o.shader(a), + o.clear(), + a.setUniform("environmentMap", e), + a.setUniform("roughness", i), + o.noStroke(), + o.plane(s, s), + r.push( + o.get().drawingContext.getImageData(0, 0, s, s), + ); + } + return ( + o.remove(), + (t = new c.MipmapTexture(this, r, {})), + this.specularTextures.set(e, t), + t + ); + }, + }, + { + key: "activeFramebuffer", + value: function () { + return ( + this.activeFramebuffers[ + this.activeFramebuffers.length - 1 + ] || null + ); + }, + }, + { + key: "createFramebuffer", + value: function (e) { + return new g.default.Framebuffer(this, e); + }, + }, + { + key: "_setStrokeUniforms", + value: function (e) { + e.bindShader(), + e.setUniform("uUseLineColor", this._useLineColor), + e.setUniform("uMaterialColor", this.curStrokeColor), + e.setUniform("uStrokeWeight", this.curStrokeWeight), + e.setUniform("uStrokeCap", w[this.curStrokeCap]), + e.setUniform("uStrokeJoin", S[this.curStrokeJoin]); + }, + }, + { + key: "_setFillUniforms", + value: function (e) { + e.bindShader(), + e.setUniform("uUseVertexColor", this._useVertexColor), + e.setUniform("uMaterialColor", this.curFillColor), + e.setUniform("isTexture", !!this._tex), + this._tex && e.setUniform("uSampler", this._tex), + e.setUniform("uTint", this._tint), + e.setUniform("uHasSetAmbient", this._hasSetAmbient), + e.setUniform("uAmbientMatColor", this.curAmbientColor), + e.setUniform( + "uSpecularMatColor", + this.curSpecularColor, + ), + e.setUniform( + "uEmissiveMatColor", + this.curEmissiveColor, + ), + e.setUniform("uSpecular", this._useSpecularMaterial), + e.setUniform("uEmissive", this._useEmissiveMaterial), + e.setUniform("uShininess", this._useShininess), + this._setImageLightUniforms(e), + e.setUniform("uUseLighting", this._enableLighting); + var t = this.pointLightDiffuseColors.length / 3, + t = + (e.setUniform("uPointLightCount", t), + e.setUniform( + "uPointLightLocation", + this.pointLightPositions, + ), + e.setUniform( + "uPointLightDiffuseColors", + this.pointLightDiffuseColors, + ), + e.setUniform( + "uPointLightSpecularColors", + this.pointLightSpecularColors, + ), + this.directionalLightDiffuseColors.length / 3), + t = + (e.setUniform("uDirectionalLightCount", t), + e.setUniform( + "uLightingDirection", + this.directionalLightDirections, + ), + e.setUniform( + "uDirectionalDiffuseColors", + this.directionalLightDiffuseColors, + ), + e.setUniform( + "uDirectionalSpecularColors", + this.directionalLightSpecularColors, + ), + this.ambientLightColors.length / 3), + t = + (e.setUniform("uAmbientLightCount", t), + e.setUniform( + "uAmbientColor", + this.ambientLightColors, + ), + this.spotLightDiffuseColors.length / 3); + e.setUniform("uSpotLightCount", t), + e.setUniform("uSpotLightAngle", this.spotLightAngle), + e.setUniform("uSpotLightConc", this.spotLightConc), + e.setUniform( + "uSpotLightDiffuseColors", + this.spotLightDiffuseColors, + ), + e.setUniform( + "uSpotLightSpecularColors", + this.spotLightSpecularColors, + ), + e.setUniform( + "uSpotLightLocation", + this.spotLightPositions, + ), + e.setUniform( + "uSpotLightDirection", + this.spotLightDirections, + ), + e.setUniform( + "uConstantAttenuation", + this.constantAttenuation, + ), + e.setUniform( + "uLinearAttenuation", + this.linearAttenuation, + ), + e.setUniform( + "uQuadraticAttenuation", + this.quadraticAttenuation, + ), + e.bindTextures(); + }, + }, + { + key: "_setImageLightUniforms", + value: function (e) { + var t, r; + e.setUniform( + "uUseImageLight", + null != this.activeImageLight, + ), + this.activeImageLight && + ((t = this.getDiffusedTexture(this.activeImageLight)), + e.setUniform("environmentMapDiffused", t), + (t = this.getSpecularTexture(this.activeImageLight)), + (r = 20 / this._useShininess), + e.setUniform("levelOfDetail", 8 * r), + e.setUniform("environmentMapSpecular", t)); + }, + }, + { + key: "_setPointUniforms", + value: function (e) { + e.bindShader(), + e.setUniform("uMaterialColor", this.curStrokeColor), + e.setUniform( + "uPointSize", + this.pointSize * this._pInst._pixelDensity, + ); + }, + }, + { + key: "_bindBuffer", + value: function (e, t, r, o, n) { + (t = t || this.GL.ARRAY_BUFFER), + this.GL.bindBuffer(t, e), + void 0 !== r && + ((e = r) instanceof g.default.DataArray + ? (e = r.dataArray()) + : e instanceof (o || Float32Array) || + (e = new (o || Float32Array)(e)), + this.GL.bufferData(t, e, n || this.GL.STATIC_DRAW)); + }, + }, + { + key: "_arraysEqual", + value: function (e, r) { + return ( + e.length === r.length && + e.every(function (e, t) { + return e === r[t]; + }) + ); + }, + }, + { + key: "_isTypedArray", + value: function (t) { + return [ + Float32Array, + Float64Array, + Int16Array, + Uint16Array, + Uint32Array, + ].some(function (e) { + return t instanceof e; + }); + }, + }, + { + key: "_flatten", + value: function (e) { + if (0 === e.length) return []; + var t; + if (2e4 < e.length) { + for ( + var r = [], o = e.slice(), n = o.pop(); + Array.isArray(n) ? o.push.apply(o, h(n)) : r.push(n), + o.length && void 0 !== (n = o.pop()); + + ); + return r.reverse(), r; + } + return (t = []).concat.apply(t, h(e)); + }, + }, + { + key: "_vToNArray", + value: function (e) { + var t = [], + r = !0, + o = !1, + n = void 0; + try { + for ( + var s, i = e[Symbol.iterator](); + !(r = (s = i.next()).done); + r = !0 + ) { + var a = s.value; + t.push(a.x, a.y, a.z); + } + } catch (e) { + (o = !0), (n = e); + } finally { + try { + r || null == i.return || i.return(); + } finally { + if (o) throw n; + } + } + return t; + }, + }, + { + key: "_bezierCoefficients", + value: function (e) { + var t = e * e, + r = 1 - e, + o = r * r; + return [o * r, 3 * o * e, 3 * r * t, t * e]; + }, + }, + { + key: "_quadraticCoefficients", + value: function (e) { + var t = 1 - e; + return [t * t, 2 * t * e, e * e]; + }, + }, + { + key: "_bezierToCatmull", + value: function (e) { + return [ + e[1], + e[1] + (e[2] - e[0]) / this._curveTightness, + e[2] - (e[3] - e[1]) / this._curveTightness, + e[2], + ]; + }, + }, + { + key: "_initTessy", + value: function () { + var e = new u.default.GluTesselator(); + return ( + e.gluTessCallback( + u.default.gluEnum.GLU_TESS_VERTEX_DATA, + function (e, t) { + for (var r = 0; r < e.length; r++) t.push(e[r]); + }, + ), + e.gluTessCallback( + u.default.gluEnum.GLU_TESS_BEGIN, + function (e) { + e !== u.default.primitiveType.GL_TRIANGLES && + console.log( + "expected TRIANGLES but got type: ".concat(e), + ); + }, + ), + e.gluTessCallback( + u.default.gluEnum.GLU_TESS_ERROR, + function (e) { + console.log("error callback"), + console.log("error number: ".concat(e)); + }, + ), + e.gluTessCallback( + u.default.gluEnum.GLU_TESS_COMBINE, + function (e, t, r) { + for ( + var o = new Array( + g.default.RendererGL.prototype.tessyVertexSize, + ).fill(0), + n = 0; + n < r.length; + n++ + ) + for (var s = 0; s < o.length; s++) + 0 !== r[n] && t[n] && (o[s] += t[n][s] * r[n]); + return o; + }, + ), + e.gluTessCallback( + u.default.gluEnum.GLU_TESS_EDGE_FLAG, + function (e) {}, + ), + e.gluTessProperty( + u.default.gluEnum.GLU_TESS_WINDING_RULE, + u.default.windingRule.GLU_TESS_WINDING_NONZERO, + ), + e + ); + }, + }, + { + key: "_triangulate", + value: function (e) { + var t = e[0] ? e[0][2] : void 0, + r = !0, + o = !0, + n = !1, + s = void 0; + try { + for ( + var i, a = e[Symbol.iterator](); + !(o = (i = a.next()).done); + o = !0 + ) + for ( + var l = i.value, u = 0; + u < l.length; + u += g.default.RendererGL.prototype.tessyVertexSize + ) + if (l[u + 2] !== t) { + r = !1; + break; + } + } catch (e) { + (n = !0), (s = e); + } finally { + try { + o || null == a.return || a.return(); + } finally { + if (n) throw s; + } + } + r + ? this._tessy.gluTessNormal(0, 0, 1) + : this._tessy.gluTessNormal(0, 0, 0); + var n = [], + c = (this._tessy.gluTessBeginPolygon(n), !0), + s = !1, + d = void 0; + try { + for ( + var h, f = e[Symbol.iterator](); + !(c = (h = f.next()).done); + c = !0 + ) { + var p = h.value; + this._tessy.gluTessBeginContour(); + for ( + var m = 0; + m < p.length; + m += g.default.RendererGL.prototype.tessyVertexSize + ) { + var y = p.slice( + m, + m + + g.default.RendererGL.prototype.tessyVertexSize, + ); + this._tessy.gluTessVertex(y, y); + } + this._tessy.gluTessEndContour(); + } + } catch (e) { + (s = !0), (d = e); + } finally { + try { + c || null == f.return || f.return(); + } finally { + if (s) throw d; + } + } + return this._tessy.gluTessEndPolygon(), n; + }, + }, + ]) && f(t.prototype, e), + r && f(t, r), + s + ); + })(g.default.Renderer)), + (g.default.prototype._assert3d = function (e) { + if (!this._renderer.isP3D) + throw new Error( + "".concat( + e, + "() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.", + ), + ); + }), + (g.default.RendererGL.prototype.tessyVertexSize = 12); + e = g.default.RendererGL; + r.default = e; + }, + { + "../core/constants": 264, + "../core/main": 275, + "../core/p5.Renderer": 278, + "./GeometryBuilder": 319, + "./p5.Camera": 324, + "./p5.Framebuffer": 326, + "./p5.Matrix": 328, + "./p5.Shader": 333, + "./p5.Texture": 334, + "core-js/modules/es.array.concat": 151, + "core-js/modules/es.array.copy-within": 152, + "core-js/modules/es.array.every": 153, + "core-js/modules/es.array.fill": 154, + "core-js/modules/es.array.from": 158, + "core-js/modules/es.array.includes": 159, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.some": 166, + "core-js/modules/es.map": 169, + "core-js/modules/es.object.assign": 176, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.reflect.get": 185, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.set": 189, + "core-js/modules/es.string.includes": 191, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.float32-array": 211, + "core-js/modules/es.typed-array.float64-array": 212, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.int16-array": 216, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint16-array": 232, + "core-js/modules/es.typed-array.uint32-array": 233, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + libtess: 247, + path: 250, + }, + ], + 333: [ + function (e, t, r) { + "use strict"; + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.index-of"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.array.slice"), + e("core-js/modules/es.array.some"), + e("core-js/modules/es.function.name"), + e("core-js/modules/es.object.keys"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/web.dom-collections.iterator"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.default = void 0); + var s = (e = e("../core/main")) && e.__esModule ? e : { default: e }; + function n(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + s.default.Shader = (function () { + function o(e, t, r) { + if (!(this instanceof o)) + throw new TypeError("Cannot call a class as a function"); + (this._renderer = e), + (this._vertSrc = t), + (this._fragSrc = r), + (this._vertShader = -1), + (this._fragShader = -1), + (this._glProgram = 0), + (this._loadedAttributes = !1), + (this.attributes = {}), + (this._loadedUniforms = !1), + (this.uniforms = {}), + (this._bound = !1), + (this.samplers = []); + } + var e, t, r; + return ( + (e = o), + (t = [ + { + key: "init", + value: function () { + if (0 === this._glProgram) { + var e = this._renderer.GL; + if ( + ((this._vertShader = e.createShader(e.VERTEX_SHADER)), + e.shaderSource(this._vertShader, this._vertSrc), + e.compileShader(this._vertShader), + !e.getShaderParameter( + this._vertShader, + e.COMPILE_STATUS, + )) + ) + return ( + s.default._friendlyError( + "Yikes! An error occurred compiling the vertex shader:".concat( + e.getShaderInfoLog(this._vertShader), + ), + ), + null + ); + if ( + ((this._fragShader = e.createShader(e.FRAGMENT_SHADER)), + e.shaderSource(this._fragShader, this._fragSrc), + e.compileShader(this._fragShader), + !e.getShaderParameter( + this._fragShader, + e.COMPILE_STATUS, + )) + ) + return ( + s.default._friendlyError( + "Darn! An error occurred compiling the fragment shader:".concat( + e.getShaderInfoLog(this._fragShader), + ), + ), + null + ); + (this._glProgram = e.createProgram()), + e.attachShader(this._glProgram, this._vertShader), + e.attachShader(this._glProgram, this._fragShader), + e.linkProgram(this._glProgram), + e.getProgramParameter(this._glProgram, e.LINK_STATUS) || + s.default._friendlyError( + "Snap! Error linking shader program: ".concat( + e.getProgramInfoLog(this._glProgram), + ), + ), + this._loadAttributes(), + this._loadUniforms(); + } + return this; + }, + }, + { + key: "copyToContext", + value: function (e) { + var t = new s.default.Shader( + e._renderer, + this._vertSrc, + this._fragSrc, + ); + return t.ensureCompiledOnContext(e), t; + }, + }, + { + key: "ensureCompiledOnContext", + value: function (e) { + if (0 !== this._glProgram && this._renderer !== e._renderer) + throw new Error( + "The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?", + ); + 0 === this._glProgram && + ((this._renderer = e._renderer), this.init()); + }, + }, + { + key: "_loadAttributes", + value: function () { + if (!this._loadedAttributes) { + this.attributes = {}; + for ( + var e = this._renderer.GL, + t = e.getProgramParameter( + this._glProgram, + e.ACTIVE_ATTRIBUTES, + ), + r = 0; + r < t; + ++r + ) { + var o = e.getActiveAttrib(this._glProgram, r), + n = o.name, + s = e.getAttribLocation(this._glProgram, n), + i = {}; + (i.name = n), + (i.location = s), + (i.index = r), + (i.type = o.type), + (i.size = o.size), + (this.attributes[n] = i); + } + this._loadedAttributes = !0; + } + }, + }, + { + key: "_loadUniforms", + value: function () { + if (!this._loadedUniforms) { + for ( + var e = this._renderer.GL, + t = e.getProgramParameter( + this._glProgram, + e.ACTIVE_UNIFORMS, + ), + r = 0, + o = 0; + o < t; + ++o + ) { + var n = e.getActiveUniform(this._glProgram, o), + s = {}, + i = + ((s.location = e.getUniformLocation( + this._glProgram, + n.name, + )), + (s.size = n.size), + n.name); + 1 < n.size && (i = i.substring(0, i.indexOf("[0]"))), + (s.name = i), + (s.type = n.type), + (s._cachedData = void 0), + s.type === e.SAMPLER_2D && + ((s.samplerIndex = r), r++, this.samplers.push(s)), + (s.isArray = + 1 < n.size || + s.type === e.FLOAT_MAT3 || + s.type === e.FLOAT_MAT4 || + s.type === e.FLOAT_VEC2 || + s.type === e.FLOAT_VEC3 || + s.type === e.FLOAT_VEC4 || + s.type === e.INT_VEC2 || + s.type === e.INT_VEC4 || + s.type === e.INT_VEC3), + (this.uniforms[i] = s); + } + this._loadedUniforms = !0; + } + }, + }, + { key: "compile", value: function () {} }, + { + key: "bindShader", + value: function () { + this.init(), + this._bound || + (this.useProgram(), + (this._bound = !0), + this._setMatrixUniforms(), + this.setUniform("uViewport", this._renderer._viewport)); + }, + }, + { + key: "unbindShader", + value: function () { + return ( + this._bound && + (this.unbindTextures(), (this._bound = !1)), + this + ); + }, + }, + { + key: "bindTextures", + value: function () { + var e = this._renderer.GL, + t = !0, + r = !1, + o = void 0; + try { + for ( + var n, s = this.samplers[Symbol.iterator](); + !(t = (n = s.next()).done); + t = !0 + ) { + var i = n.value, + a = i.texture; + void 0 === a && (a = this._renderer._getEmptyTexture()), + e.activeTexture(e.TEXTURE0 + i.samplerIndex), + a.bindTexture(), + a.update(), + e.uniform1i(i.location, i.samplerIndex); + } + } catch (e) { + (r = !0), (o = e); + } finally { + try { + t || null == s.return || s.return(); + } finally { + if (r) throw o; + } + } + }, + }, + { + key: "updateTextures", + value: function () { + var e = !0, + t = !1, + r = void 0; + try { + for ( + var o, n = this.samplers[Symbol.iterator](); + !(e = (o = n.next()).done); + e = !0 + ) { + var s = o.value.texture; + s && s.update(); + } + } catch (e) { + (t = !0), (r = e); + } finally { + try { + e || null == n.return || n.return(); + } finally { + if (t) throw r; + } + } + }, + }, + { + key: "unbindTextures", + value: function () { + var e = !0, + t = !1, + r = void 0; + try { + for ( + var o, n = this.samplers[Symbol.iterator](); + !(e = (o = n.next()).done); + e = !0 + ) { + var s = o.value; + this.setUniform( + s.name, + this._renderer._getEmptyTexture(), + ); + } + } catch (e) { + (t = !0), (r = e); + } finally { + try { + e || null == n.return || n.return(); + } finally { + if (t) throw r; + } + } + }, + }, + { + key: "_setMatrixUniforms", + value: function () { + var e = this._renderer._curCamera.cameraMatrix, + t = this._renderer.uPMatrix, + r = this._renderer.uMVMatrix, + o = r.copy(); + o.mult(t), + this.isStrokeShader() && + ("default" === this._renderer._curCamera.cameraType + ? this.setUniform("uPerspective", 1) + : this.setUniform("uPerspective", 0)), + this.setUniform("uViewMatrix", e.mat4), + this.setUniform("uProjectionMatrix", t.mat4), + this.setUniform("uModelViewMatrix", r.mat4), + this.setUniform("uModelViewProjectionMatrix", o.mat4), + this.uniforms.uNormalMatrix && + (this._renderer.uNMatrix.inverseTranspose( + this._renderer.uMVMatrix, + ), + this.setUniform( + "uNormalMatrix", + this._renderer.uNMatrix.mat3, + )); + }, + }, + { + key: "useProgram", + value: function () { + var e = this._renderer.GL; + return ( + this._renderer._curShader !== this && + (e.useProgram(this._glProgram), + (this._renderer._curShader = this)), + this + ); + }, + }, + { + key: "setUniform", + value: function (e, t) { + var r = this.uniforms[e]; + if (r) { + var o = this._renderer.GL; + if (r.isArray) { + if ( + r._cachedData && + this._renderer._arraysEqual(r._cachedData, t) + ) + return; + r._cachedData = t.slice(0); + } else { + if (r._cachedData && r._cachedData === t) return; + Array.isArray(t) + ? (r._cachedData = t.slice(0)) + : (r._cachedData = t); + } + var n = r.location; + switch ((this.useProgram(), r.type)) { + case o.BOOL: + !0 === t ? o.uniform1i(n, 1) : o.uniform1i(n, 0); + break; + case o.INT: + 1 < r.size + ? t.length && o.uniform1iv(n, t) + : o.uniform1i(n, t); + break; + case o.FLOAT: + 1 < r.size + ? t.length && o.uniform1fv(n, t) + : o.uniform1f(n, t); + break; + case o.FLOAT_MAT3: + o.uniformMatrix3fv(n, !1, t); + break; + case o.FLOAT_MAT4: + o.uniformMatrix4fv(n, !1, t); + break; + case o.FLOAT_VEC2: + 1 < r.size + ? t.length && o.uniform2fv(n, t) + : o.uniform2f(n, t[0], t[1]); + break; + case o.FLOAT_VEC3: + 1 < r.size + ? t.length && o.uniform3fv(n, t) + : o.uniform3f(n, t[0], t[1], t[2]); + break; + case o.FLOAT_VEC4: + 1 < r.size + ? t.length && o.uniform4fv(n, t) + : o.uniform4f(n, t[0], t[1], t[2], t[3]); + break; + case o.INT_VEC2: + 1 < r.size + ? t.length && o.uniform2iv(n, t) + : o.uniform2i(n, t[0], t[1]); + break; + case o.INT_VEC3: + 1 < r.size + ? t.length && o.uniform3iv(n, t) + : o.uniform3i(n, t[0], t[1], t[2]); + break; + case o.INT_VEC4: + 1 < r.size + ? t.length && o.uniform4iv(n, t) + : o.uniform4i(n, t[0], t[1], t[2], t[3]); + break; + case o.SAMPLER_2D: + o.activeTexture(o.TEXTURE0 + r.samplerIndex), + (r.texture = + t instanceof s.default.Texture + ? t + : this._renderer.getTexture(t)), + o.uniform1i(n, r.samplerIndex), + r.texture.src.gifProperties && + r.texture.src._animateGif(this._renderer._pInst); + } + return this; + } + }, + }, + { + key: "isLightShader", + value: function () { + return ( + void 0 !== this.attributes.aNormal || + void 0 !== this.uniforms.uUseLighting || + void 0 !== this.uniforms.uAmbientLightCount || + void 0 !== this.uniforms.uDirectionalLightCount || + void 0 !== this.uniforms.uPointLightCount || + void 0 !== this.uniforms.uAmbientColor || + void 0 !== this.uniforms.uDirectionalDiffuseColors || + void 0 !== this.uniforms.uDirectionalSpecularColors || + void 0 !== this.uniforms.uPointLightLocation || + void 0 !== this.uniforms.uPointLightDiffuseColors || + void 0 !== this.uniforms.uPointLightSpecularColors || + void 0 !== this.uniforms.uLightingDirection || + void 0 !== this.uniforms.uSpecular + ); + }, + }, + { + key: "isNormalShader", + value: function () { + return void 0 !== this.attributes.aNormal; + }, + }, + { + key: "isTextureShader", + value: function () { + return 0 < this.samplers.length; + }, + }, + { + key: "isColorShader", + value: function () { + return ( + void 0 !== this.attributes.aVertexColor || + void 0 !== this.uniforms.uMaterialColor + ); + }, + }, + { + key: "isTexLightShader", + value: function () { + return this.isLightShader() && this.isTextureShader(); + }, + }, + { + key: "isStrokeShader", + value: function () { + return void 0 !== this.uniforms.uStrokeWeight; + }, + }, + { + key: "enableAttrib", + value: function (e, t, r, o, n, s) { + var i; + return ( + e && + -1 !== (e = e.location) && + ((i = this._renderer.GL), + this._renderer.registerEnabled.has(e) || + (i.enableVertexAttribArray(e), + this._renderer.registerEnabled.add(e)), + this._renderer.GL.vertexAttribPointer( + e, + t, + r || i.FLOAT, + o || !1, + n || 0, + s || 0, + )), + this + ); + }, + }, + { + key: "disableRemainingAttributes", + value: function () { + var r = this, + e = !0, + t = !1, + o = void 0; + try { + for ( + var n, + s = this._renderer.registerEnabled + .values() + [Symbol.iterator](); + !(e = (n = s.next()).done); + e = !0 + ) + !(function () { + var t = n.value; + Object.keys(r.attributes).some(function (e) { + return r.attributes[e].location === t; + }) || + (r._renderer.GL.disableVertexAttribArray(t), + r._renderer.registerEnabled.delete(t)); + })(); + } catch (e) { + (t = !0), (o = e); + } finally { + try { + e || null == s.return || s.return(); + } finally { + if (t) throw o; + } + } + }, + }, + ]) && n(e.prototype, t), + r && n(e, r), + o + ); + })(); + e = s.default.Shader; + r.default = e; + }, + { + "../core/main": 275, + "core-js/modules/es.array.index-of": 160, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.array.slice": 165, + "core-js/modules/es.array.some": 166, + "core-js/modules/es.function.name": 168, + "core-js/modules/es.object.keys": 181, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 334: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.get-prototype-of"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.reflect.construct"), + e("core-js/modules/es.regexp.to-string"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.typed-array.uint8-array"), + e("core-js/modules/es.typed-array.copy-within"), + e("core-js/modules/es.typed-array.every"), + e("core-js/modules/es.typed-array.fill"), + e("core-js/modules/es.typed-array.filter"), + e("core-js/modules/es.typed-array.find"), + e("core-js/modules/es.typed-array.find-index"), + e("core-js/modules/es.typed-array.for-each"), + e("core-js/modules/es.typed-array.includes"), + e("core-js/modules/es.typed-array.index-of"), + e("core-js/modules/es.typed-array.iterator"), + e("core-js/modules/es.typed-array.join"), + e("core-js/modules/es.typed-array.last-index-of"), + e("core-js/modules/es.typed-array.map"), + e("core-js/modules/es.typed-array.reduce"), + e("core-js/modules/es.typed-array.reduce-right"), + e("core-js/modules/es.typed-array.reverse"), + e("core-js/modules/es.typed-array.set"), + e("core-js/modules/es.typed-array.slice"), + e("core-js/modules/es.typed-array.some"), + e("core-js/modules/es.typed-array.sort"), + e("core-js/modules/es.typed-array.subarray"), + e("core-js/modules/es.typed-array.to-locale-string"), + e("core-js/modules/es.typed-array.to-string"), + Object.defineProperty(r, "__esModule", { value: !0 }), + (r.checkWebGLCapabilities = m), + (r.default = r.MipmapTexture = void 0); + var s = (p = e("../core/main")) && p.__esModule ? p : { default: p }, + a = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = l(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function l() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (l = function () { + return e; + }), + e); + } + function u(e, t) { + return (u = + Object.setPrototypeOf || + function (e, t) { + return (e.__proto__ = t), e; + })(e, t); + } + function c(r) { + return function () { + var e, + t = n(r), + t = + ((e = (function () { + if ( + "undefined" != typeof Reflect && + Reflect.construct && + !Reflect.construct.sham + ) { + if ("function" == typeof Proxy) return 1; + try { + return ( + Date.prototype.toString.call( + Reflect.construct(Date, [], function () {}), + ), + 1 + ); + } catch (e) {} + } + })() + ? ((e = n(this).constructor), + Reflect.construct(t, arguments, e)) + : t.apply(this, arguments)), + this); + if (!e || ("object" !== i(e) && "function" != typeof e)) { + if (void 0 !== t) return t; + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called", + ); + } + return e; + }; + } + function n(e) { + return (n = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (e) { + return e.__proto__ || Object.getPrototypeOf(e); + })(e); + } + function d(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + } + function h(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function f(e, t, r) { + t && h(e.prototype, t), r && h(e, r); + } + s.default.Texture = (function () { + function n(e, t, r) { + d(this, n), (this._renderer = e); + var o = this._renderer.GL, + r = + ((r = r || {}), + (this.src = t), + (this.glTex = void 0), + (this.glTarget = o.TEXTURE_2D), + (this.glFormat = r.format || o.RGBA), + (this.mipmaps = !1), + (this.glMinFilter = r.minFilter || o.LINEAR), + (this.glMagFilter = r.magFilter || o.LINEAR), + (this.glWrapS = r.wrapS || o.CLAMP_TO_EDGE), + (this.glWrapT = r.wrapT || o.CLAMP_TO_EDGE), + (this.glDataType = r.dataType || o.UNSIGNED_BYTE), + m(e)), + e = + (this.glFormat !== o.HALF_FLOAT || + r.halfFloat || + (console.log( + "This device does not support dataType HALF_FLOAT. Falling back to FLOAT.", + ), + (this.glDataType = o.FLOAT)), + this.glFormat !== o.HALF_FLOAT || + (this.glMinFilter !== o.LINEAR && + this.glMagFilter !== o.LINEAR) || + r.halfFloatLinear || + (console.log( + "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", + ), + this.glMinFilter === o.LINEAR && + (this.glMinFilter = o.NEAREST), + this.glMagFilter === o.LINEAR && + (this.glMagFilter = o.NEAREST)), + this.glFormat !== o.FLOAT || + r.float || + (console.log( + "This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE.", + ), + (this.glDataType = o.UNSIGNED_BYTE)), + this.glFormat !== o.FLOAT || + (this.glMinFilter !== o.LINEAR && + this.glMagFilter !== o.LINEAR) || + r.floatLinear || + (console.log( + "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", + ), + this.glMinFilter === o.LINEAR && + (this.glMinFilter = o.NEAREST), + this.glMagFilter === o.LINEAR && + (this.glMagFilter = o.NEAREST)), + (this.isSrcMediaElement = + void 0 !== s.default.MediaElement && + t instanceof s.default.MediaElement), + (this._videoPrevUpdateTime = 0), + (this.isSrcHTMLElement = + void 0 !== s.default.Element && + t instanceof s.default.Element && + !(t instanceof s.default.Graphics) && + !(t instanceof s.default.Renderer)), + (this.isSrcP5Image = t instanceof s.default.Image), + (this.isSrcP5Graphics = t instanceof s.default.Graphics), + (this.isSrcP5Renderer = t instanceof s.default.Renderer), + (this.isImageData = + "undefined" != typeof ImageData && t instanceof ImageData), + (this.isFramebufferTexture = + t instanceof s.default.FramebufferTexture), + this._getTextureDataFromSource()); + return ( + (this.width = e.width), + (this.height = e.height), + this.init(e), + this + ); + } + return ( + f(n, [ + { + key: "_getTextureDataFromSource", + value: function () { + var e; + return ( + this.isFramebufferTexture + ? (e = this.src.rawTexture()) + : this.isSrcP5Image + ? (e = this.src.canvas) + : this.isSrcMediaElement || + this.isSrcP5Graphics || + this.isSrcP5Renderer || + this.isSrcHTMLElement + ? (e = this.src.elt) + : this.isImageData && (e = this.src), + e + ); + }, + }, + { + key: "init", + value: function (e) { + var t, + r = this._renderer.GL; + this.isFramebufferTexture || + (this.glTex = r.createTexture()), + (this.glWrapS = this._renderer.textureWrapX), + (this.glWrapT = this._renderer.textureWrapY), + this.setWrapMode(this.glWrapS, this.glWrapT), + this.bindTexture(), + r.texParameteri( + r.TEXTURE_2D, + r.TEXTURE_MAG_FILTER, + this.glMagFilter, + ), + r.texParameteri( + r.TEXTURE_2D, + r.TEXTURE_MIN_FILTER, + this.glMinFilter, + ), + this.isFramebufferTexture || + (0 === this.width || + 0 === this.height || + (this.isSrcMediaElement && !this.src.loadedmetadata) + ? ((t = new Uint8Array([1, 1, 1, 1])), + r.texImage2D( + this.glTarget, + 0, + r.RGBA, + 1, + 1, + 0, + this.glFormat, + this.glDataType, + t, + )) + : r.texImage2D( + this.glTarget, + 0, + this.glFormat, + this.glFormat, + this.glDataType, + e, + )); + }, + }, + { + key: "update", + value: function () { + var e, + t, + r, + o = this.src; + return ( + 0 !== o.width && + 0 !== o.height && + !this.isFramebufferTexture && + ((e = this._getTextureDataFromSource()), + (t = !1), + (r = this._renderer.GL), + e.width !== this.width || e.height !== this.height + ? ((t = !0), + (this.width = e.width || o.width), + (this.height = e.height || o.height), + this.isSrcP5Image + ? o.setModified(!1) + : (this.isSrcMediaElement || + this.isSrcHTMLElement) && + o.setModified(!0)) + : this.isSrcP5Image + ? o.isModified() && o.setModified(!(t = !0)) + : this.isSrcMediaElement + ? o.isModified() + ? o.setModified(!(t = !0)) + : o.loadedmetadata && + this._videoPrevUpdateTime !== o.time() && + ((this._videoPrevUpdateTime = o.time()), + (t = !0)) + : this.isImageData + ? o._dirty && (t = !(o._dirty = !1)) + : (t = !0), + t && + (this.bindTexture(), + r.texImage2D( + this.glTarget, + 0, + this.glFormat, + this.glFormat, + this.glDataType, + e, + )), + t) + ); + }, + }, + { + key: "bindTexture", + value: function () { + return ( + this._renderer.GL.bindTexture( + this.glTarget, + this.getTexture(), + ), + this + ); + }, + }, + { + key: "unbindTexture", + value: function () { + this._renderer.GL.bindTexture(this.glTarget, null); + }, + }, + { + key: "getTexture", + value: function () { + return this.isFramebufferTexture + ? this.src.rawTexture() + : this.glTex; + }, + }, + { + key: "setInterpolation", + value: function (e, t) { + var r = this._renderer.GL; + (this.glMinFilter = this.glFilter(e)), + (this.glMagFilter = this.glFilter(t)), + this.bindTexture(), + r.texParameteri( + r.TEXTURE_2D, + r.TEXTURE_MIN_FILTER, + this.glMinFilter, + ), + r.texParameteri( + r.TEXTURE_2D, + r.TEXTURE_MAG_FILTER, + this.glMagFilter, + ), + this.unbindTexture(); + }, + }, + { + key: "glFilter", + value: function (e) { + var t = this._renderer.GL; + return e === a.NEAREST ? t.NEAREST : t.LINEAR; + }, + }, + { + key: "setWrapMode", + value: function (e, t) { + function r(e) { + return 0 == (e & (e - 1)); + } + var o = this._renderer.GL, + n = this._getTextureDataFromSource(), + n = + n.naturalWidth && n.naturalHeight + ? ((s = n.naturalWidth), n.naturalHeight) + : ((s = this.width), this.height), + s = r(s), + n = r(n); + e === a.REPEAT + ? this._renderer.webglVersion === a.WEBGL2 || (s && n) + ? (this.glWrapS = o.REPEAT) + : (console.warn( + "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", + ), + (this.glWrapS = o.CLAMP_TO_EDGE)) + : e === a.MIRROR + ? this._renderer.webglVersion === a.WEBGL2 || (s && n) + ? (this.glWrapS = o.MIRRORED_REPEAT) + : (console.warn( + "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", + ), + (this.glWrapS = o.CLAMP_TO_EDGE)) + : (this.glWrapS = o.CLAMP_TO_EDGE), + t === a.REPEAT + ? this._renderer.webglVersion === a.WEBGL2 || (s && n) + ? (this.glWrapT = o.REPEAT) + : (console.warn( + "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", + ), + (this.glWrapT = o.CLAMP_TO_EDGE)) + : t === a.MIRROR + ? this._renderer.webglVersion === a.WEBGL2 || (s && n) + ? (this.glWrapT = o.MIRRORED_REPEAT) + : (console.warn( + "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", + ), + (this.glWrapT = o.CLAMP_TO_EDGE)) + : (this.glWrapT = o.CLAMP_TO_EDGE), + this.bindTexture(), + o.texParameteri( + o.TEXTURE_2D, + o.TEXTURE_WRAP_S, + this.glWrapS, + ), + o.texParameteri( + o.TEXTURE_2D, + o.TEXTURE_WRAP_T, + this.glWrapT, + ), + this.unbindTexture(); + }, + }, + ]), + n + ); + })(); + var p = (function (e) { + var t = n; + if ("function" != typeof e && null !== e) + throw new TypeError( + "Super expression must either be null or a function", + ); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && u(t, e); + var o = c(n); + function n(e, t, r) { + d(this, n); + t = (e = o.call(this, e, t, r))._renderer.GL; + return ( + e.glMinFilter === t.LINEAR && + (e.glMinFilter = t.LINEAR_MIPMAP_LINEAR), + e + ); + } + return ( + f(n, [ + { + key: "glFilter", + value: function (e) { + return this._renderer.GL.LINEAR_MIPMAP_LINEAR; + }, + }, + { + key: "_getTextureDataFromSource", + value: function () { + return this.src; + }, + }, + { + key: "init", + value: function (e) { + var t = this._renderer.GL; + (this.glTex = t.createTexture()), this.bindTexture(); + for (var r = 0; r < e.length; r++) + t.texImage2D( + this.glTarget, + r, + this.glFormat, + this.glFormat, + this.glDataType, + e[r], + ); + (this.glMinFilter = t.LINEAR_MIPMAP_LINEAR), + t.texParameteri( + t.TEXTURE_2D, + t.TEXTURE_MAG_FILTER, + this.glMagFilter, + ), + t.texParameteri( + t.TEXTURE_2D, + t.TEXTURE_MIN_FILTER, + this.glMinFilter, + ), + this.unbindTexture(); + }, + }, + { key: "update", value: function () {} }, + ]), + n + ); + })(s.default.Texture); + function m(e) { + var t = e.GL, + e = e.webglVersion, + r = + e === a.WEBGL2 + ? t.getExtension("EXT_color_buffer_float") && + t.getExtension("EXT_float_blend") + : t.getExtension("OES_texture_float"), + o = r && t.getExtension("OES_texture_float_linear"), + e = + e === a.WEBGL2 + ? t.getExtension("EXT_color_buffer_float") + : t.getExtension("OES_texture_half_float"); + return { + float: r, + floatLinear: o, + halfFloat: e, + halfFloatLinear: + e && t.getExtension("OES_texture_half_float_linear"), + }; + } + r.MipmapTexture = p; + e = s.default.Texture; + r.default = e; + }, + { + "../core/constants": 264, + "../core/main": 275, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.get-prototype-of": 180, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.reflect.construct": 184, + "core-js/modules/es.regexp.to-string": 188, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.typed-array.copy-within": 205, + "core-js/modules/es.typed-array.every": 206, + "core-js/modules/es.typed-array.fill": 207, + "core-js/modules/es.typed-array.filter": 208, + "core-js/modules/es.typed-array.find": 210, + "core-js/modules/es.typed-array.find-index": 209, + "core-js/modules/es.typed-array.for-each": 213, + "core-js/modules/es.typed-array.includes": 214, + "core-js/modules/es.typed-array.index-of": 215, + "core-js/modules/es.typed-array.iterator": 218, + "core-js/modules/es.typed-array.join": 219, + "core-js/modules/es.typed-array.last-index-of": 220, + "core-js/modules/es.typed-array.map": 221, + "core-js/modules/es.typed-array.reduce": 223, + "core-js/modules/es.typed-array.reduce-right": 222, + "core-js/modules/es.typed-array.reverse": 224, + "core-js/modules/es.typed-array.set": 225, + "core-js/modules/es.typed-array.slice": 226, + "core-js/modules/es.typed-array.some": 227, + "core-js/modules/es.typed-array.sort": 228, + "core-js/modules/es.typed-array.subarray": 229, + "core-js/modules/es.typed-array.to-locale-string": 230, + "core-js/modules/es.typed-array.to-string": 231, + "core-js/modules/es.typed-array.uint8-array": 234, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + 335: [ + function (e, t, r) { + "use strict"; + function o(e) { + return (o = + "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); + } + function i(e) { + return (i = + "function" == typeof Symbol && "symbol" === o(Symbol.iterator) + ? function (e) { + return o(e); + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : o(e); + })(e); + } + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.get-own-property-descriptor"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.sub"), + e("core-js/modules/es.weak-map"), + e("core-js/modules/web.dom-collections.iterator"), + e("core-js/modules/es.symbol"), + e("core-js/modules/es.symbol.description"), + e("core-js/modules/es.symbol.iterator"), + e("core-js/modules/es.array.iterator"), + e("core-js/modules/es.object.to-string"), + e("core-js/modules/es.regexp.exec"), + e("core-js/modules/es.string.iterator"), + e("core-js/modules/es.string.split"), + e("core-js/modules/es.string.sub"), + e("core-js/modules/web.dom-collections.iterator"); + var n, + B = (n = e("../core/main")) && n.__esModule ? n : { default: n }, + M = (function (e) { + if (e && e.__esModule) return e; + if (null === e || ("object" !== i(e) && "function" != typeof e)) + return { default: e }; + var t = a(); + if (t && t.has(e)) return t.get(e); + var r, + o = {}, + n = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (r in e) { + var s; + Object.prototype.hasOwnProperty.call(e, r) && + ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && + (s.get || s.set) + ? Object.defineProperty(o, r, s) + : (o[r] = e[r])); + } + (o.default = e), t && t.set(e, o); + return o; + })(e("../core/constants")); + function a() { + var e; + return "function" != typeof WeakMap + ? null + : ((e = new WeakMap()), + (a = function () { + return e; + }), + e); + } + function G(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + } + function s(e, t) { + for (var r = 0; r < t.length; r++) { + var o = t[r]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function V(e, t, r) { + t && s(e.prototype, t), r && s(e, r); + } + e("./p5.Shader"), + e("./p5.RendererGL.Retained"), + (B.default.RendererGL.prototype._applyTextProperties = + function () {}), + (B.default.RendererGL.prototype.textWidth = function (e) { + return this._isOpenType() + ? this._textFont._textWidth(e, this._textSize) + : 0; + }); + var l = (function () { + function r(e, t) { + G(this, r), + (this.width = e), + (this.height = t), + (this.infos = []); + } + return ( + V(r, [ + { + key: "findImage", + value: function (e) { + var t, + r, + o = this.width * this.height; + if (o < e) + throw new Error("font is too complex to render in 3D"); + for (var n = this.infos.length - 1; 0 <= n; --n) { + var s = this.infos[n]; + if (s.index + e < o) { + r = (t = s).imageData; + break; + } + } + if (!t) { + try { + r = new ImageData(this.width, this.height); + } catch (e) { + var i = document.getElementsByTagName("canvas")[0], + a = !i, + l = + (i || + (((i = + document.createElement( + "canvas", + )).style.display = "none"), + document.body.appendChild(i)), + i.getContext("2d")); + l && (r = l.createImageData(this.width, this.height)), + a && document.body.removeChild(i); + } + this.infos.push((t = { index: 0, imageData: r })); + } + l = t.index; + return ( + (t.index += e), + (r._dirty = !0), + { imageData: r, index: l } + ); + }, + }, + ]), + r + ); + })(); + function z(e, t, r, o, n) { + var s = e.imageData.data, + e = 4 * e.index++; + (s[e++] = t), (s[e++] = r), (s[e++] = o), (s[+e] = n); + } + var H = Math.sqrt(3), + E = (function () { + function t(e) { + G(this, t), + (this.font = e), + (this.strokeImageInfos = new l(64, 64)), + (this.colDimImageInfos = new l(64, 64)), + (this.rowDimImageInfos = new l(64, 64)), + (this.colCellImageInfos = new l(64, 64)), + (this.rowCellImageInfos = new l(64, 64)), + (this.glyphInfos = {}); + } + return ( + V(t, [ + { + key: "getGlyphInfo", + value: function (e) { + var t = this.glyphInfos[e.index]; + if (!t) { + var r = e.getBoundingBox(), + o = r.x1, + n = r.y1, + s = r.x2 - o, + i = r.y2 - n, + a = e.path.commands; + if (0 == s || 0 == i || !a.length) + return (this.glyphInfos[e.index] = {}); + for (var u = [], c = [], d = [], l = 8; 0 <= l; --l) + d.push([]); + for (l = 8; 0 <= l; --l) c.push([]); + var h, + f, + p, + m, + D = (function () { + function n(e, t, r, o) { + G(this, n), + (this.p0 = e), + (this.c0 = t), + (this.c1 = r), + (this.p1 = o); + } + return ( + V(n, [ + { + key: "toQuadratic", + value: function () { + return { + x: this.p0.x, + y: this.p0.y, + x1: this.p1.x, + y1: this.p1.y, + cx: + (3 * (this.c0.x + this.c1.x) - + (this.p0.x + this.p1.x)) / + 4, + cy: + (3 * (this.c0.y + this.c1.y) - + (this.p0.y + this.p1.y)) / + 4, + }; + }, + }, + { + key: "quadError", + value: function () { + return ( + B.default.Vector.sub( + B.default.Vector.sub(this.p1, this.p0), + B.default.Vector.mult( + B.default.Vector.sub( + this.c1, + this.c0, + ), + 3, + ), + ).mag() / 2 + ); + }, + }, + { + key: "split", + value: function (e) { + var t = B.default.Vector.lerp( + this.p0, + this.c0, + e, + ), + r = B.default.Vector.lerp( + this.c0, + this.c1, + e, + ), + o = B.default.Vector.lerp(t, r, e), + r = + ((this.c1 = B.default.Vector.lerp( + this.c1, + this.p1, + e, + )), + (this.c0 = B.default.Vector.lerp( + r, + this.c1, + e, + )), + B.default.Vector.lerp(o, this.c0, e)), + e = new n(this.p0, t, o, r); + return (this.p0 = r), e; + }, + }, + { + key: "splitInflections", + value: function () { + var e = B.default.Vector.sub( + this.c0, + this.p0, + ), + t = B.default.Vector.sub( + B.default.Vector.sub(this.c1, this.c0), + e, + ), + r = B.default.Vector.sub( + B.default.Vector.sub( + B.default.Vector.sub( + this.p1, + this.c1, + ), + e, + ), + B.default.Vector.mult(t, 2), + ), + o = [], + n = t.x * r.y - t.y * r.x; + return ( + 0 !== n && + 0 <= + (e = + (r = e.x * r.y - e.y * r.x) * r - + 4 * n * (e.x * t.y - e.y * t.x)) && + (n < 0 && ((n = -n), (r = -r), 0), + (e = + (-r + (t = Math.sqrt(e))) / (2 * n)), + 0 < (r = (-r - t) / (2 * n)) && + r < 1 && + (o.push(this.split(r)), + (e = 1 - (1 - e) / (1 - r))), + 0 < e && + e < 1 && + o.push(this.split(e))), + o.push(this), + o + ); + }, + }, + ]), + n + ); + })(), + y = !0, + g = !1, + v = void 0; + try { + for ( + var b, j = a[Symbol.iterator](); + !(y = (b = j.next()).done); + y = !0 + ) { + var _ = b.value, + x = (_.x - o) / s, + w = (_.y - n) / i; + if (!U(h, f, x, w)) { + switch (_.type) { + case "M": + (p = x), (m = w); + break; + case "L": + I(h, f, x, w); + break; + case "Q": + var S = (_.x1 - o) / s, + T = (_.y1 - n) / i; + L([h, x, S], [f, w, T], { + x: h, + y: f, + cx: S, + cy: T, + }); + break; + case "Z": + U(h, f, p, m) + ? u.push({ x: h, y: f }) + : (I(h, f, p, m), u.push({ x: p, y: m })); + break; + case "C": + for ( + var M = (function (e, t, r, o, n, s, i, a) { + var e = new D( + new B.default.Vector(e, t), + new B.default.Vector(r, o), + new B.default.Vector(n, s), + new B.default.Vector(i, a), + ).splitInflections(), + l = [], + u = 30 / H, + c = !0, + t = !1, + r = void 0; + try { + for ( + var d, h = e[Symbol.iterator](); + !(c = (d = h.next()).done); + c = !0 + ) { + for ( + var f = d.value, + p = [], + m = void 0; + !( + 0.125 <= (m = u / f.quadError()) + ); + + ) { + var y = Math.pow(m, 1 / 3), + g = f.split(y), + v = f.split(1 - y / (1 - y)); + l.push(g), p.push(f), (f = v); + } + m < 1 && l.push(f.split(0.5)), + l.push(f), + Array.prototype.push.apply( + l, + p.reverse(), + ); + } + } catch (e) { + (t = !0), (r = e); + } finally { + try { + c || null == h.return || h.return(); + } finally { + if (t) throw r; + } + } + return l; + })( + h, + f, + (_.x1 - o) / s, + (_.y1 - n) / i, + (_.x2 - o) / s, + (_.y2 - n) / i, + x, + w, + ), + E = 0; + E < M.length; + E++ + ) { + var k = M[E].toQuadratic(); + L([k.x, k.x1, k.cx], [k.y, k.y1, k.cy], k); + } + break; + default: + throw new Error( + "unknown command type: ".concat(_.type), + ); + } + (h = x), (f = w); + } + } + } catch (e) { + (g = !0), (v = e); + } finally { + try { + y || null == j.return || j.return(); + } finally { + if (g) throw v; + } + } + for ( + var C = u.length, + O = this.strokeImageInfos.findImage(C), + F = O.index, + P = 0; + P < C; + ++P + ) { + var A = u[P]; + z(O, R(A.x), R(A.y), R(A.cx), R(A.cy)); + } + (t = this.glyphInfos[e.index] = + { + glyph: e, + uGlyphRect: [r.x1, -r.y1, r.x2, -r.y2], + strokeImageInfo: O, + strokes: u, + colInfo: N( + d, + this.colDimImageInfos, + this.colCellImageInfos, + ), + rowInfo: N( + c, + this.rowDimImageInfos, + this.rowCellImageInfos, + ), + }).uGridOffset = [ + t.colInfo.dimOffset, + t.rowInfo.dimOffset, + ]; + } + return t; + function L(e, t, r) { + var o = u.length; + function n(e, t, r) { + for (var o = e.length; 0 < o--; ) { + var n = e[o]; + n < t && (t = n), r < n && (r = n); + } + return { min: t, max: r }; + } + u.push(r); + for ( + var r = n(e, 1, 0), + e = Math.max(Math.floor(9 * r.min - 0.5), 0), + s = Math.min(Math.ceil(9 * r.max + 0.5), 9), + i = e; + i < s; + ++i + ) + d[i].push(o); + for ( + var r = n(t, 1, 0), + e = Math.max(Math.floor(9 * r.min - 0.5), 0), + a = Math.min(Math.ceil(9 * r.max + 0.5), 9), + l = e; + l < a; + ++l + ) + c[l].push(o); + } + function R(e) { + return (e = (r = 255) * e) < (t = 0) + ? t + : r < e + ? r + : e; + var t, r; + } + function I(e, t, r, o) { + L([e, r], [t, o], { + x: e, + y: t, + cx: (e + r) / 2, + cy: (t + o) / 2, + }); + } + function U(e, t, r, o) { + return Math.abs(r - e) < 1e-5 && Math.abs(o - t) < 1e-5; + } + function N(e, t, r) { + for ( + var o = e.length, + n = t.findImage(o), + t = n.index, + s = 0, + i = 0; + i < o; + ++i + ) + s += e[i].length; + for (var a = r.findImage(s), l = 0; l < o; ++l) { + var u = e[l], + c = u.length, + d = a.index; + z(n, d >> 7, 127 & d, c >> 7, 127 & c); + for (var h = 0; h < c; ++h) { + var f = u[h] + F; + z(a, f >> 7, 127 & f, 0, 0); + } + } + return { + cellImageInfo: a, + dimOffset: t, + dimImageInfo: n, + }; + } + }, + }, + ]), + t + ); + })(); + B.default.RendererGL.prototype._renderText = function ( + e, + t, + r, + o, + n, + ) { + if (this._textFont && "string" != typeof this._textFont) { + if (!(n <= o) && this._doFill) { + if (this._isOpenType()) { + e.push(); + var n = this._doStroke, + s = this.drawMode, + i = + ((this._doStroke = !1), + (this.drawMode = M.TEXTURE), + this._textFont.font), + a = + (a = this._textFont._fontInfo) || + (this._textFont._fontInfo = new E(i)), + r = this._textFont._handleAlignment(this, t, r, o), + o = this._textSize / i.unitsPerEm, + l = + (this.translate(r.x, r.y, 0), + this.scale(o, o, 1), + this.GL), + r = !this._defaultFontShader, + u = this._getFontShader(), + c = + (u.init(), + u.bindShader(), + r && + (u.setUniform("uGridImageSize", [64, 64]), + u.setUniform("uCellsImageSize", [64, 64]), + u.setUniform("uStrokeImageSize", [64, 64]), + u.setUniform("uGridSize", [9, 9])), + this._applyColorBlend(this.curFillColor), + this.retainedMode.geometry.glyph), + d = + (c || + ((o = this._textGeom = + new B.default.Geometry(1, 1, function () { + for (var e = 0; e <= 1; e++) + for (var t = 0; t <= 1; t++) + this.vertices.push( + new B.default.Vector(t, e, 0), + ), + this.uvs.push(t, e); + })) + .computeFaces() + .computeNormals(), + (c = this.createBuffers("glyph", o))), + !0), + r = !1, + o = void 0; + try { + for ( + var h, + f = this.retainedMode.buffers.text[Symbol.iterator](); + !(d = (h = f.next()).done); + d = !0 + ) + h.value._prepareBuffer(c, u); + } catch (e) { + (r = !0), (o = e); + } finally { + try { + d || null == f.return || f.return(); + } finally { + if (r) throw o; + } + } + this._bindBuffer(c.indexBuffer, l.ELEMENT_ARRAY_BUFFER), + u.setUniform("uMaterialColor", this.curFillColor), + l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1); + try { + var p = 0, + m = null, + y = i.stringToGlyphs(t), + g = !0, + v = !1, + b = void 0; + try { + for ( + var j, _ = y[Symbol.iterator](); + !(g = (j = _.next()).done); + g = !0 + ) { + var x, + w, + S = j.value, + T = + (m && (p += i.getKerningValue(m, S)), + a.getGlyphInfo(S)); + T.uGlyphRect && + ((x = T.rowInfo), + (w = T.colInfo), + u.setUniform( + "uSamplerStrokes", + T.strokeImageInfo.imageData, + ), + u.setUniform( + "uSamplerRowStrokes", + x.cellImageInfo.imageData, + ), + u.setUniform( + "uSamplerRows", + x.dimImageInfo.imageData, + ), + u.setUniform( + "uSamplerColStrokes", + w.cellImageInfo.imageData, + ), + u.setUniform( + "uSamplerCols", + w.dimImageInfo.imageData, + ), + u.setUniform("uGridOffset", T.uGridOffset), + u.setUniform("uGlyphRect", T.uGlyphRect), + u.setUniform("uGlyphOffset", p), + u.bindTextures(), + l.drawElements( + l.TRIANGLES, + 6, + this.GL.UNSIGNED_SHORT, + 0, + )), + (p += S.advanceWidth), + (m = S); + } + } catch (e) { + (v = !0), (b = e); + } finally { + try { + g || null == _.return || _.return(); + } finally { + if (v) throw b; + } + } + } finally { + u.unbindShader(), + (this._doStroke = n), + (this.drawMode = s), + l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), + e.pop(); + } + } else + console.log( + "WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported", + ); + return e; + } + } else + console.log( + "WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.", + ); + }; + }, + { + "../core/constants": 264, + "../core/main": 275, + "./p5.RendererGL.Retained": 331, + "./p5.Shader": 333, + "core-js/modules/es.array.iterator": 161, + "core-js/modules/es.object.get-own-property-descriptor": 178, + "core-js/modules/es.object.to-string": 182, + "core-js/modules/es.regexp.exec": 187, + "core-js/modules/es.string.iterator": 192, + "core-js/modules/es.string.split": 198, + "core-js/modules/es.string.sub": 200, + "core-js/modules/es.symbol": 204, + "core-js/modules/es.symbol.description": 202, + "core-js/modules/es.symbol.iterator": 203, + "core-js/modules/es.weak-map": 236, + "core-js/modules/web.dom-collections.iterator": 238, + }, + ], + }, + {}, + [259], + )(259); +}); diff --git a/src/components/Sandbox.tsx b/src/components/Sandbox.tsx index e9825ae..c2295cf 100644 --- a/src/components/Sandbox.tsx +++ b/src/components/Sandbox.tsx @@ -1,206 +1,206 @@ -import debounce from 'lodash.debounce'; -import React from 'react'; -import './sandox.css'; +import debounce from "lodash.debounce"; +import React from "react"; +import "./sandox.css"; -import * as prettier from 'prettier/standalone'; -import parserBabel from 'prettier/plugins/babel'; -import * as prettierPluginEstree from 'prettier/plugins/estree'; +import * as prettier from "prettier/standalone"; +import parserBabel from "prettier/plugins/babel"; +import * as prettierPluginEstree from "prettier/plugins/estree"; import { - Editor, - type BeforeMount, - type OnChange, - type OnMount, -} from '@monaco-editor/react'; + Editor, + type BeforeMount, + type OnChange, + type OnMount, +} from "@monaco-editor/react"; //@ts-ignore -import globals from '@types/p5/global.d.ts?raw'; +import globals from "@types/p5/global.d.ts?raw"; //@ts-ignore -import constants from '@types/p5/constants.d.ts?raw'; +import constants from "@types/p5/constants.d.ts?raw"; //@ts-ignore -import index from '@types/p5/index.d.ts?raw'; +import index from "@types/p5/index.d.ts?raw"; //@ts-ignore -import literals from '@types/p5/literals.d.ts?raw'; +import literals from "@types/p5/literals.d.ts?raw"; //@ts-ignore -import sound from '@types/p5/lib/addons/p5.sound.d.ts?raw'; -import { useLocalStorage } from '../hooks/use-local-storage'; -import { iframeSource } from '../lib/iframe-source'; +import sound from "@types/p5/lib/addons/p5.sound.d.ts?raw"; +import { useLocalStorage } from "../hooks/use-local-storage"; +import { iframeSource } from "../lib/iframe-source"; interface SandboxProps { - title: string; - description: string; - initialCode: string; - disableStorage: boolean; + title: string; + description: string; + initialCode: string; + disableStorage: boolean; } export default function Sandbox({ disableStorage, initialCode }: SandboxProps) { - const iframeRef = React.useRef(null); - const [viewportWidth, setViewportWidth] = React.useState(window.innerWidth); - const [viewportHeight, setViewportHeight] = React.useState( - window.innerHeight, - ); + const iframeRef = React.useRef(null); + const [viewportWidth, setViewportWidth] = React.useState(window.innerWidth); + const [viewportHeight, setViewportHeight] = React.useState( + window.innerHeight, + ); - const [code, setCode] = useLocalStorage( - 'p5.inpayjamas.dev', - initialCode, - disableStorage, - ); + const [code, setCode] = useLocalStorage( + "p5.inpayjamas.dev", + initialCode, + disableStorage, + ); - const debouncedSetCode = debounce((value) => setCode(value), 500); - React.useEffect(() => { - const handleResize = () => setViewportWidth(window.innerWidth); - window.addEventListener('resize', handleResize); - return () => window.removeEventListener('resize', handleResize); - }, []); - React.useEffect(() => { - const handleResize = () => setViewportHeight(window.innerHeight); - window.addEventListener('resize', handleResize); - return () => window.removeEventListener('resize', handleResize); - }, []); - React.useEffect(() => { - if (iframeRef.current) { - const iframe = iframeRef.current; + const debouncedSetCode = debounce((value) => setCode(value), 500); + React.useEffect(() => { + const handleResize = () => setViewportWidth(window.innerWidth); + window.addEventListener("resize", handleResize); + return () => window.removeEventListener("resize", handleResize); + }, []); + React.useEffect(() => { + const handleResize = () => setViewportHeight(window.innerHeight); + window.addEventListener("resize", handleResize); + return () => window.removeEventListener("resize", handleResize); + }, []); + React.useEffect(() => { + if (iframeRef.current) { + const iframe = iframeRef.current; - const source = iframeSource(code); - const iframeParent = iframe.parentElement; + const source = iframeSource(code); + const iframeParent = iframe.parentElement; - if (iframeParent) { - iframeParent.removeChild(iframe); - const blob = new Blob([source], { type: 'text/html' }); - const blobUrl = URL.createObjectURL(blob); - iframe.src = blobUrl; - iframeParent.appendChild(iframe); - } - } - }, [code]); - const handleEditorChange: OnChange = (value, event) => { - debouncedSetCode(value); - // here is the current value - // debounce(() => setCode((prev) => value)); - }; + if (iframeParent) { + iframeParent.removeChild(iframe); + const blob = new Blob([source], { type: "text/html" }); + const blobUrl = URL.createObjectURL(blob); + iframe.src = blobUrl; + iframeParent.appendChild(iframe); + } + } + }, [code]); + const handleEditorChange: OnChange = (value, event) => { + debouncedSetCode(value); + // here is the current value + // debounce(() => setCode((prev) => value)); + }; - const handleEditorDidMount: OnMount = (editor, monaco) => { - // console.log("onMount: the editor instance:", editor); - // console.log("onMount: the monaco instance:", monaco); - }; + const handleEditorDidMount: OnMount = (editor, monaco) => { + // console.log("onMount: the editor instance:", editor); + // console.log("onMount: the monaco instance:", monaco); + }; - const handleEditorWillMount: BeforeMount = (monaco) => { - monaco.languages.registerDocumentFormattingEditProvider('javascript', { - provideDocumentFormattingEdits: async (model) => { - const text = await prettier.format(model.getValue(), { - parser: 'babel', - printWidth: 50, - useTabs: true, - proseWrap: 'always', - semi: true, - singleQuote: true, - trailingComma: 'es5', - bracketSpacing: true, - singleAttributePerLine: true, - plugins: [parserBabel, prettierPluginEstree], - }); - return [ - { - range: model.getFullModelRange(), - text, - }, - ]; - }, - }); + const handleEditorWillMount: BeforeMount = (monaco) => { + monaco.languages.registerDocumentFormattingEditProvider("javascript", { + provideDocumentFormattingEdits: async (model) => { + const text = await prettier.format(model.getValue(), { + parser: "babel", + printWidth: 50, + useTabs: true, + proseWrap: "always", + semi: true, + singleQuote: true, + trailingComma: "es5", + bracketSpacing: true, + singleAttributePerLine: true, + plugins: [parserBabel, prettierPluginEstree], + }); + return [ + { + range: model.getFullModelRange(), + text, + }, + ]; + }, + }); - monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({ - ...monaco.languages.typescript.javascriptDefaults.getDiagnosticsOptions(), - noSemanticValidation: true, - noSuggestionDiagnostics: false, - noSyntaxValidation: false, - }); + monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({ + ...monaco.languages.typescript.javascriptDefaults.getDiagnosticsOptions(), + noSemanticValidation: true, + noSuggestionDiagnostics: false, + noSyntaxValidation: false, + }); - monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ - checkJs: true, - allowJs: true, - alwaysStrict: true, - target: monaco.languages.typescript.ScriptTarget.ES2016, - allowNonTsExtensions: true, - moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs, - }); - const opts = - monaco.languages.typescript.typescriptDefaults.getCompilerOptions(); - monaco.languages.typescript.javascriptDefaults.setCompilerOptions(opts); - monaco.languages.typescript.javascriptDefaults.addExtraLib( - globals, - '@types/p5/global.d.ts', - ); - monaco.languages.typescript.javascriptDefaults.addExtraLib( - constants, - '@types/p5/constants.d.ts', - ); - monaco.languages.typescript.javascriptDefaults.addExtraLib( - literals, - '@types/p5/literals.d.ts', - ); - monaco.languages.typescript.javascriptDefaults.addExtraLib( - index, - '@types/p5/index.d.ts', - ); - monaco.languages.typescript.javascriptDefaults.addExtraLib( - sound, - '@types/p5/lib/addons/p5.sound.d.ts', - ); - monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ - ...monaco.languages.typescript.javascriptDefaults.getCompilerOptions(), - }); - // console.log("beforeMount: the monaco instance:", monaco); - }; + monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ + checkJs: true, + allowJs: true, + alwaysStrict: true, + target: monaco.languages.typescript.ScriptTarget.ES2016, + allowNonTsExtensions: true, + moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs, + }); + const opts = + monaco.languages.typescript.typescriptDefaults.getCompilerOptions(); + monaco.languages.typescript.javascriptDefaults.setCompilerOptions(opts); + monaco.languages.typescript.javascriptDefaults.addExtraLib( + globals, + "@types/p5/global.d.ts", + ); + monaco.languages.typescript.javascriptDefaults.addExtraLib( + constants, + "@types/p5/constants.d.ts", + ); + monaco.languages.typescript.javascriptDefaults.addExtraLib( + literals, + "@types/p5/literals.d.ts", + ); + monaco.languages.typescript.javascriptDefaults.addExtraLib( + index, + "@types/p5/index.d.ts", + ); + monaco.languages.typescript.javascriptDefaults.addExtraLib( + sound, + "@types/p5/lib/addons/p5.sound.d.ts", + ); + monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ + ...monaco.languages.typescript.javascriptDefaults.getCompilerOptions(), + }); + // console.log("beforeMount: the monaco instance:", monaco); + }; - function handleEditorValidation(markers) { - // model markers - // markers.forEach(marker => console.log('onValidate:', marker.message)); - } - return ( -
                          - {/*
                          + function handleEditorValidation(markers) { + // model markers + // markers.forEach(marker => console.log('onValidate:', marker.message)); + } + return ( +
                          + {/*

                          Loading P5.js Sandbox

                          */} -
                          - -
                          +
                          + +
                          -
                          -
                          - -
                          -
                          -
                          - ); +
                          +
                          + +
                          +
                          +
                          + ); } diff --git a/src/components/sandox.css b/src/components/sandox.css index 5afd350..a241910 100644 --- a/src/components/sandox.css +++ b/src/components/sandox.css @@ -1,180 +1,180 @@ :root { - --font-size: 1rem; - --spacing: 2rem; - --sans-serif: system-ui, sans-serif; - --mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, - 'DejaVu Sans Mono', monospace; - font-weight: normal; - --fadeIn: fadeIn 0.3s ease; + --font-size: 1rem; + --spacing: 2rem; + --sans-serif: system-ui, sans-serif; + --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, + "DejaVu Sans Mono", monospace; + font-weight: normal; + --fadeIn: fadeIn 0.3s ease; } * { - margin: 0; - padding: 0; - box-sizing: border-box; + margin: 0; + padding: 0; + box-sizing: border-box; } .sandbox { - display: flex; - color: seashell; - font-family: var(--sans-serif); - font-size: var(--font-size); - overflow: hidden; - flex-direction: row; + display: flex; + color: seashell; + font-family: var(--sans-serif); + font-size: var(--font-size); + overflow: hidden; + flex-direction: row; } h3 { - position: absolute; - right: 20px; - font-size: 1rem; - background-color: wheat; - color: hsl(0 0% 12%); - padding: 0.4rem 0.8rem; - border-radius: 4px; + position: absolute; + right: 20px; + font-size: 1rem; + background-color: wheat; + color: hsl(0 0% 12%); + padding: 0.4rem 0.8rem; + border-radius: 4px; } .code, .result { - height: 100vh; - width: 50vw; + height: 100vh; + width: 50vw; } .editor { - height: 100%; - min-width: 50vw; - max-width: 100vw; - resize: horizontal; - overflow: hidden; - border-right: 1px solid hsl(0 0% 70%); + height: 100%; + min-width: 50vw; + max-width: 100vw; + resize: horizontal; + overflow: hidden; + border-right: 1px solid hsl(0 0% 70%); } .output { - position: relative; - height: 100%; - overflow-x: hidden; - margin: 0; - background-color: white; + position: relative; + height: 100%; + overflow-x: hidden; + margin: 0; + background-color: white; } iframe { - height: 100%; - width: 100%; - border: none; - animation: var(--fadeIn); + height: 100%; + width: 100%; + border: none; + animation: var(--fadeIn); } .errors { - padding: var(--spacing); - color: tomato; - animation: var(--fadeIn); + padding: var(--spacing); + color: tomato; + animation: var(--fadeIn); } .errors xmp { - max-width: 80%; + max-width: 80%; } pre, xmp { - font-family: var(--mono); - white-space: pre-wrap; - word-wrap: break-word; + font-family: var(--mono); + white-space: pre-wrap; + word-wrap: break-word; } @media (max-width: 800px) { - body { - flex-direction: column; - /* display: block; */ - overflow: scroll; - } - - .code, - .result { - height: 50vh; - width: 100vw; - } - - .sandbox { - flex-direction: column; - } - .editor { - resize: none; - border-right: none; - } - - .output { - height: 100%; - border-top: 1px solid hsl(0 0% 90%); - } - - .source { - display: none; - } - - .code > section { - height: 50vh; - } + body { + flex-direction: column; + /* display: block; */ + overflow: scroll; + } + + .code, + .result { + height: 50vh; + width: 100vw; + } + + .sandbox { + flex-direction: column; + } + .editor { + resize: none; + border-right: none; + } + + .output { + height: 100%; + border-top: 1px solid hsl(0 0% 90%); + } + + .source { + display: none; + } + + .code > section { + height: 50vh; + } } .loading { - display: grid; - gap: 1rem; - place-content: center; - position: absolute; - inset: 0; - background-color: hsl(0 0 100); - z-index: 1; + display: grid; + gap: 1rem; + place-content: center; + position: absolute; + inset: 0; + background-color: hsl(0 0 100); + z-index: 1; } .loader { - width: 40px; - height: 40px; - margin: 0 auto; - background-color: hsl(0 0% 100%); - background: linear-gradient( - to right, - hsl(0 0% 100%) 10%, - hsla(0 0% 100% / 0%) 42% - ); - transform: translateZ(0); - border-radius: 50%; - animation: spin 1.4s infinite linear; + width: 40px; + height: 40px; + margin: 0 auto; + background-color: hsl(0 0% 100%); + background: linear-gradient( + to right, + hsl(0 0% 100%) 10%, + hsla(0 0% 100% / 0%) 42% + ); + transform: translateZ(0); + border-radius: 50%; + animation: spin 1.4s infinite linear; } .loader:before { - content: ''; - height: 50%; - width: 50%; - position: absolute; - inset: 0; - background-color: hsl(0 0% 100%); - border-radius: 100% 0 0 0; + content: ""; + height: 50%; + width: 50%; + position: absolute; + inset: 0; + background-color: hsl(0 0% 100%); + border-radius: 100% 0 0 0; } .loader:after { - content: ''; - position: absolute; - inset: 0; - height: 75%; - width: 75%; - margin: auto; - background-color: hsl(200 20% 14%); - border-radius: 50%; + content: ""; + position: absolute; + inset: 0; + height: 75%; + width: 75%; + margin: auto; + background-color: hsl(200 20% 14%); + border-radius: 50%; } @keyframes spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } @keyframes fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } + from { + opacity: 0; + } + to { + opacity: 1; + } } From fc62141f4131c1dbe56a2bdec1c9f9e8ae46f53d Mon Sep 17 00:00:00 2001 From: ff6347 Date: Wed, 28 Feb 2024 09:31:04 +0100 Subject: [PATCH 09/26] ci(npm issue): Regenerate lock file --- .prettierignore | 2 + package-lock.json | 3860 +- public/lib/addons/p5.sound.js | 29418 ++- public/lib/addons/p5.sound.min.js | 9488 +- public/lib/p5.js | 256026 +++++++++++++-------------- public/lib/p5.min.js | 55917 +----- 6 files changed, 136383 insertions(+), 218328 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3c4584e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +public/lib/addons/*.js +public/lib/*.js diff --git a/package-lock.json b/package-lock.json index f0e8fff..d2e9f5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,8 @@ }, "node_modules/@ampproject/remapping": { "version": "2.2.1", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -60,7 +61,8 @@ }, "node_modules/@astrojs/check": { "version": "0.3.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.3.4.tgz", + "integrity": "sha512-Wi4KwW38J3GCd/U6LH2UuU4uc4P/K1WYaqhoKm2o7rVoGhQfO+RWrSO26rUPRXYbmae8JugAgpCmsHC8bt5RlA==", "dependencies": { "@astrojs/language-server": "^2.5.5", "chokidar": "^3.5.3", @@ -77,15 +79,18 @@ }, "node_modules/@astrojs/compiler": { "version": "2.6.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.6.0.tgz", + "integrity": "sha512-c74k8iGHL3DzkosSJ0tGcHIEBEiIfBhr7eadSaPyvWlVKaieDVzVs8OW1tnRSQyBsfMc8DZQ4RcN2KAcESD8UQ==" }, "node_modules/@astrojs/internal-helpers": { "version": "0.2.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.2.1.tgz", + "integrity": "sha512-06DD2ZnItMwUnH81LBLco3tWjcZ1lGU9rLCCBaeUCGYe9cI0wKyY2W3kDyoW1I6GmcWgt1fu+D1CTvz+FIKf8A==" }, "node_modules/@astrojs/language-server": { "version": "2.7.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/language-server/-/language-server-2.7.6.tgz", + "integrity": "sha512-NhMSmMAuKBMXnvpfn9eYPR7R6zOasAjRb+ta8L+rCHHuKzUc0lBgAF5M6rx01FJqlpGqeqao13eYt4287Ze49g==", "dependencies": { "@astrojs/compiler": "^2.4.0", "@jridgewell/sourcemap-codec": "^1.4.15", @@ -122,7 +127,8 @@ }, "node_modules/@astrojs/markdown-remark": { "version": "4.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-4.0.1.tgz", + "integrity": "sha512-RU4ESnqvyLpj8WZs0n5elS6idaDdtIIm7mIpMaRNPCebpxMjfcfdwcmBwz83ktAj5d2eO5bC3z92TcGdli+lRw==", "dependencies": { "@astrojs/prism": "^3.0.0", "github-slugger": "^2.0.0", @@ -142,7 +148,8 @@ }, "node_modules/@astrojs/prism": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.0.0.tgz", + "integrity": "sha512-g61lZupWq1bYbcBnYZqdjndShr/J3l/oFobBKPA3+qMat146zce3nz2kdO4giGbhYDt4gYdhmoBz0vZJ4sIurQ==", "dependencies": { "prismjs": "^1.29.0" }, @@ -152,7 +159,8 @@ }, "node_modules/@astrojs/react": { "version": "3.0.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-3.0.9.tgz", + "integrity": "sha512-31J5yF5p9yBFV1axBooLA9PB4B2+MYm7swWhtlezSsJiUNXRFo5Is9qI3teJ7cKgmaCv+ZA593Smskko0NGaDQ==", "dependencies": { "@vitejs/plugin-react": "^4.2.0", "ultrahtml": "^1.3.0" @@ -169,7 +177,8 @@ }, "node_modules/@astrojs/telemetry": { "version": "3.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.0.4.tgz", + "integrity": "sha512-A+0c7k/Xy293xx6odsYZuXiaHO0PL+bnDoXOc47sGDF5ffIKdKQGRPFl2NMlCF4L0NqN4Ynbgnaip+pPF0s7pQ==", "dependencies": { "ci-info": "^3.8.0", "debug": "^4.3.4", @@ -185,20 +194,22 @@ }, "node_modules/@astrojs/telemetry/node_modules/ci-info": { "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/sibiraj-s" } ], - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@babel/code-frame": { "version": "7.23.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" @@ -209,7 +220,8 @@ }, "node_modules/@babel/code-frame/node_modules/ansi-styles": { "version": "3.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dependencies": { "color-convert": "^1.9.0" }, @@ -219,7 +231,8 @@ }, "node_modules/@babel/code-frame/node_modules/chalk": { "version": "2.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -231,32 +244,37 @@ }, "node_modules/@babel/code-frame/node_modules/color-convert": { "version": "1.9.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dependencies": { "color-name": "1.1.3" } }, "node_modules/@babel/code-frame/node_modules/color-name": { "version": "1.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { "version": "1.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { "node": ">=0.8.0" } }, "node_modules/@babel/code-frame/node_modules/has-flag": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { "node": ">=4" } }, "node_modules/@babel/code-frame/node_modules/supports-color": { "version": "5.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dependencies": { "has-flag": "^3.0.0" }, @@ -266,14 +284,16 @@ }, "node_modules/@babel/compat-data": { "version": "7.23.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { "version": "7.23.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", + "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.23.5", @@ -301,14 +321,16 @@ }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { "version": "7.23.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dependencies": { "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", @@ -321,7 +343,8 @@ }, "node_modules/@babel/helper-annotate-as-pure": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -331,7 +354,8 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.23.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dependencies": { "@babel/compat-data": "^7.23.5", "@babel/helper-validator-option": "^7.23.5", @@ -345,21 +369,24 @@ }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { "version": "7.23.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dependencies": { "@babel/template": "^7.22.15", "@babel/types": "^7.23.0" @@ -370,7 +397,8 @@ }, "node_modules/@babel/helper-hoist-variables": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -380,7 +408,8 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.22.15", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dependencies": { "@babel/types": "^7.22.15" }, @@ -390,7 +419,8 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -407,14 +437,16 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { "version": "7.22.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -424,7 +456,8 @@ }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.22.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dependencies": { "@babel/types": "^7.22.5" }, @@ -434,28 +467,32 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.23.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.23.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { "version": "7.23.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", + "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", "dependencies": { "@babel/template": "^7.23.9", "@babel/traverse": "^7.23.9", @@ -467,7 +504,8 @@ }, "node_modules/@babel/highlight": { "version": "7.23.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -479,7 +517,8 @@ }, "node_modules/@babel/highlight/node_modules/ansi-styles": { "version": "3.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dependencies": { "color-convert": "^1.9.0" }, @@ -489,7 +528,8 @@ }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -501,32 +541,37 @@ }, "node_modules/@babel/highlight/node_modules/color-convert": { "version": "1.9.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dependencies": { "color-name": "1.1.3" } }, "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { "node": ">=0.8.0" } }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dependencies": { "has-flag": "^3.0.0" }, @@ -536,7 +581,8 @@ }, "node_modules/@babel/parser": { "version": "7.23.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -546,7 +592,8 @@ }, "node_modules/@babel/plugin-syntax-jsx": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -559,7 +606,8 @@ }, "node_modules/@babel/plugin-transform-react-jsx": { "version": "7.23.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", + "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-module-imports": "^7.22.15", @@ -576,7 +624,8 @@ }, "node_modules/@babel/plugin-transform-react-jsx-self": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", + "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -589,7 +638,8 @@ }, "node_modules/@babel/plugin-transform-react-jsx-source": { "version": "7.23.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", + "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -602,8 +652,9 @@ }, "node_modules/@babel/runtime": { "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", + "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", "dev": true, - "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -613,7 +664,8 @@ }, "node_modules/@babel/template": { "version": "7.23.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", "dependencies": { "@babel/code-frame": "^7.23.5", "@babel/parser": "^7.23.9", @@ -625,7 +677,8 @@ }, "node_modules/@babel/traverse": { "version": "7.23.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", "dependencies": { "@babel/code-frame": "^7.23.5", "@babel/generator": "^7.23.6", @@ -644,7 +697,8 @@ }, "node_modules/@babel/types": { "version": "7.23.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -656,157 +710,894 @@ }, "node_modules/@colors/colors": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, - "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.1.90" } }, "node_modules/@emmetio/abbreviation": { "version": "2.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz", + "integrity": "sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==", "dependencies": { "@emmetio/scanner": "^1.0.4" } }, "node_modules/@emmetio/css-abbreviation": { "version": "2.1.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz", + "integrity": "sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==", "dependencies": { "@emmetio/scanner": "^1.0.4" } }, "node_modules/@emmetio/scanner": { "version": "1.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz", + "integrity": "sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==" }, - "node_modules/@esbuild/darwin-arm64": { + "node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", "cpu": [ - "arm64" + "ppc64" ], - "license": "MIT", "optional": true, "os": [ - "darwin" + "aix" ], "engines": { "node": ">=12" } }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.2", + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", "cpu": [ - "arm64" + "arm" ], - "license": "Apache-2.0", "optional": true, "os": [ - "darwin" + "android" ], "engines": { - "glibc": ">=2.26", - "node": "^18.17.0 || ^20.3.0 || >=21.0.0", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.1" + "node": ">=12" } }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.1", + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", "cpu": [ "arm64" ], - "license": "LGPL-3.0-or-later", "optional": true, "os": [ - "darwin" + "android" ], "engines": { - "macos": ">=11", - "npm": ">=9.6.5", - "pnpm": ">=7.1.0", - "yarn": ">=3.2.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" + "node": ">=12" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.4", - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "license": "MIT", + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "license": "MIT", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=6.0.0" + "node": ">=12" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "license": "MIT" + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.23", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@monaco-editor/loader": { - "version": "1.4.0", - "license": "MIT", - "dependencies": { - "state-local": "^1.0.6" - }, - "peerDependencies": { - "monaco-editor": ">= 0.21.0 < 1" + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@monaco-editor/react": { - "version": "4.6.0", - "license": "MIT", - "dependencies": { - "@monaco-editor/loader": "^1.4.0" - }, - "peerDependencies": { + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz", + "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz", + "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz", + "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz", + "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz", + "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz", + "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz", + "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz", + "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz", + "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz", + "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz", + "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz", + "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz", + "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz", + "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz", + "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz", + "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.45.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz", + "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz", + "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", + "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", + "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@monaco-editor/loader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.4.0.tgz", + "integrity": "sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==", + "dependencies": { + "state-local": "^1.0.6" + }, + "peerDependencies": { + "monaco-editor": ">= 0.21.0 < 1" + } + }, + "node_modules/@monaco-editor/react": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.6.0.tgz", + "integrity": "sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==", + "dependencies": { + "@monaco-editor/loader": "^1.4.0" + }, + "peerDependencies": { "monaco-editor": ">= 0.25.0 < 1", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" @@ -814,7 +1605,8 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -825,14 +1617,16 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -843,16 +1637,18 @@ }, "node_modules/@octokit/auth-token": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@octokit/core": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", + "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.0.0", @@ -868,8 +1664,9 @@ }, "node_modules/@octokit/endpoint": { "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", + "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^12.0.0", "universal-user-agent": "^6.0.0" @@ -880,8 +1677,9 @@ }, "node_modules/@octokit/graphql": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", + "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/request": "^8.0.1", "@octokit/types": "^12.0.0", @@ -892,14 +1690,16 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "20.0.0", - "dev": true, - "license": "MIT" + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-8.0.0.tgz", + "integrity": "sha512-2xZ+baZWUg+qudVXnnvXz7qfrTmDeYPCzangBVq/1gXxii/OiS//4shJp9dnCCvj1x+JAm9ji1Egwm1BA47lPQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^11.0.0" }, @@ -912,21 +1712,24 @@ }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", + "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/@octokit/plugin-retry": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/request-error": "^5.0.0", "@octokit/types": "^12.0.0", @@ -941,8 +1744,9 @@ }, "node_modules/@octokit/plugin-throttling": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-7.0.0.tgz", + "integrity": "sha512-KL2k/d0uANc8XqP5S64YcNFCudR3F5AaKO39XWdUtlJIjT9Ni79ekWJ6Kj5xvAw87udkOMEPcVf9xEge2+ahew==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^11.0.0", "bottleneck": "^2.15.3" @@ -956,21 +1760,24 @@ }, "node_modules/@octokit/plugin-throttling/node_modules/@octokit/openapi-types": { "version": "18.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", + "dev": true }, "node_modules/@octokit/plugin-throttling/node_modules/@octokit/types": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-11.1.0.tgz", + "integrity": "sha512-Fz0+7GyLm/bHt8fwEqgvRBWwIV1S6wRRyq+V6exRKLVWaKGsuy6H9QFYeBVDV7rK6fO3XwHgQOPxv+cLj2zpXQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^18.0.0" } }, "node_modules/@octokit/request": { "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", + "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/endpoint": "^9.0.0", "@octokit/request-error": "^5.0.0", @@ -983,8 +1790,9 @@ }, "node_modules/@octokit/request-error": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", + "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/types": "^12.0.0", "deprecation": "^2.0.0", @@ -996,8 +1804,9 @@ }, "node_modules/@octokit/types": { "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/openapi-types": "^20.0.0" } @@ -1019,16 +1828,18 @@ }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.22.0" } }, "node_modules/@pnpm/network.ca-file": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "4.2.10" }, @@ -1038,13 +1849,15 @@ }, "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { "version": "4.2.10", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/@pnpm/npm-conf": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", + "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", "dev": true, - "license": "MIT", "dependencies": { "@pnpm/config.env-replace": "^1.1.0", "@pnpm/network.ca-file": "^1.0.1", @@ -1054,21 +1867,167 @@ "node": ">=12" } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ] + }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "darwin" ] }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@semantic-release/changelog": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", "dev": true, - "license": "MIT", "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -1084,8 +2043,9 @@ }, "node_modules/@semantic-release/commit-analyzer": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-11.0.0.tgz", + "integrity": "sha512-uEXyf4Z0AWJuxI9TbSQP5kkIYqus1/E1NcmE7pIv6d6/m/5EJcNWAGR4FOo34vrV26FhEaRVkxFfYzp/M7BKIg==", "dev": true, - "license": "MIT", "dependencies": { "conventional-changelog-angular": "^7.0.0", "conventional-commits-filter": "^4.0.0", @@ -1104,16 +2064,18 @@ }, "node_modules/@semantic-release/error": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.17" } }, "node_modules/@semantic-release/git": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", + "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", "dev": true, - "license": "MIT", "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -1133,8 +2095,9 @@ }, "node_modules/@semantic-release/github": { "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-9.0.5.tgz", + "integrity": "sha512-d1ZZjMvXpSa4E1L3XjdNOqgUy00o9QZX55L75pMsb/w+1NV6CCfDYOvH8qwKygHS/rKzI3FkBTcR40ahOodsgg==", "dev": true, - "license": "MIT", "dependencies": { "@octokit/core": "^5.0.0", "@octokit/plugin-paginate-rest": "^8.0.0", @@ -1162,16 +2125,18 @@ }, "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@semantic-release/github/node_modules/aggregate-error": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^4.0.0", "indent-string": "^5.0.0" @@ -1185,8 +2150,9 @@ }, "node_modules/@semantic-release/github/node_modules/clean-stack": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -1199,8 +2165,9 @@ }, "node_modules/@semantic-release/github/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1210,8 +2177,9 @@ }, "node_modules/@semantic-release/npm": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-11.0.0.tgz", + "integrity": "sha512-ozNCiPUp14Xp2rgeY7j96yFTEhDncLSWOJr0IAUr888+ax6fH5xgYkNVv08vpkV8C5GIXBgnGd9coRiOCD6oqQ==", "dev": true, - "license": "MIT", "dependencies": { "@semantic-release/error": "^4.0.0", "aggregate-error": "^5.0.0", @@ -1236,16 +2204,18 @@ }, "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@semantic-release/npm/node_modules/aggregate-error": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^5.2.0", "indent-string": "^5.0.0" @@ -1259,8 +2229,9 @@ }, "node_modules/@semantic-release/npm/node_modules/clean-stack": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -1273,8 +2244,9 @@ }, "node_modules/@semantic-release/npm/node_modules/execa": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -1295,8 +2267,9 @@ }, "node_modules/@semantic-release/npm/node_modules/get-stream": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" }, @@ -1306,16 +2279,18 @@ }, "node_modules/@semantic-release/npm/node_modules/human-signals": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=16.17.0" } }, "node_modules/@semantic-release/npm/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1325,8 +2300,9 @@ }, "node_modules/@semantic-release/npm/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -1336,8 +2312,9 @@ }, "node_modules/@semantic-release/npm/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1347,8 +2324,9 @@ }, "node_modules/@semantic-release/npm/node_modules/npm-run-path": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -1361,8 +2339,9 @@ }, "node_modules/@semantic-release/npm/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -1375,8 +2354,9 @@ }, "node_modules/@semantic-release/npm/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1386,8 +2366,9 @@ }, "node_modules/@semantic-release/npm/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "engines": { "node": ">=14" }, @@ -1397,8 +2378,9 @@ }, "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1408,8 +2390,9 @@ }, "node_modules/@semantic-release/release-notes-generator": { "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-12.0.0.tgz", + "integrity": "sha512-m7Ds8ComP1KJgA2Lke2xMwE1TOOU40U7AzP4lT8hJ2tUAeicziPz/1GeDFmRkTOkMFlfHvE6kuvMkvU+mIzIDQ==", "dev": true, - "license": "MIT", "dependencies": { "conventional-changelog-angular": "^7.0.0", "conventional-changelog-writer": "^7.0.0", @@ -1437,8 +2420,9 @@ }, "node_modules/@sindresorhus/is": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -1449,8 +2433,9 @@ }, "node_modules/@technologiestiftung/semantic-release-config": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@technologiestiftung/semantic-release-config/-/semantic-release-config-1.2.4.tgz", + "integrity": "sha512-MlZmQJEXbHjJN3uPnu4I2cIAmIQy94TVUamxLka9vRVKZrCKACMNp7dkmXEL++roj9SK5X2DAh+GvHn/LkaWgQ==", "dev": true, - "license": "MIT", "dependencies": { "@semantic-release/changelog": "6.0.3", "@semantic-release/commit-analyzer": "11.0.0", @@ -1464,8 +2449,9 @@ }, "node_modules/@testing-library/dom": { "version": "9.3.4", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", + "integrity": "sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -1482,8 +2468,9 @@ }, "node_modules/@testing-library/react": { "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", + "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", "@testing-library/dom": "^9.0.0", @@ -1499,12 +2486,14 @@ }, "node_modules/@types/aria-query": { "version": "5.0.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true }, "node_modules/@types/babel__core": { "version": "7.20.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -1515,14 +2504,16 @@ }, "node_modules/@types/babel__generator": { "version": "7.6.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { "version": "7.4.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -1530,63 +2521,73 @@ }, "node_modules/@types/babel__traverse": { "version": "7.20.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dependencies": { "@babel/types": "^7.20.7" } }, "node_modules/@types/debug": { "version": "4.1.12", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/estree": { "version": "1.0.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@types/hast": { "version": "3.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/lodash": { "version": "4.14.202", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dev": true }, "node_modules/@types/lodash.debounce": { "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.9.tgz", + "integrity": "sha512-Ma5JcgTREwpLRwMM+XwBR7DaWe96nC38uCBDFKZWbNKD+osjVzdpnUSwBcqCptrp16sSOLBAUb50Car5I0TCsQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/lodash": "*" } }, "node_modules/@types/mdast": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/ms": { "version": "0.7.34", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/nlcst": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.4.tgz", + "integrity": "sha512-ABoYdNQ/kBSsLvZAekMhIPMQ3YUZvavStpKYs7BjLLuKVmIMA0LUgZ7b54zzuWJRbHF80v1cNf4r90Vd6eMQDg==", "dependencies": { "@types/unist": "^2" } }, "node_modules/@types/nlcst/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { "version": "20.11.20", @@ -1599,20 +2600,24 @@ }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true }, "node_modules/@types/p5": { "version": "1.7.6", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/p5/-/p5-1.7.6.tgz", + "integrity": "sha512-6pLTOo0V3N5jZb5nTwjiv3lPHLK3Z/TjbhQUj8CTWXocUk1Z/f6OHTp3Pcwi1BhWnf5gqKUcyEb1gP0KIJuQgw==" }, "node_modules/@types/prop-types": { "version": "15.7.11", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", + "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { "version": "18.2.45", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz", + "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1621,26 +2626,31 @@ }, "node_modules/@types/react-dom": { "version": "18.2.18", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.18.tgz", + "integrity": "sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==", "dependencies": { "@types/react": "*" } }, "node_modules/@types/scheduler": { "version": "0.16.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", + "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" }, "node_modules/@types/unist": { "version": "3.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, "node_modules/@vitejs/plugin-react": { "version": "4.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", + "integrity": "sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==", "dependencies": { "@babel/core": "^7.23.5", "@babel/plugin-transform-react-jsx-self": "^7.23.3", @@ -1790,7 +2800,8 @@ }, "node_modules/@volar/kit": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.4.tgz", + "integrity": "sha512-USRx/o0jKz7o8+lEKWMxWqbqvC46XFrf3IE6CZBYzRo9kM7RERQLwUYaoT2bOcHt5DQWublpnTgdgHMm37Gysg==", "dependencies": { "@volar/language-service": "2.0.4", "@volar/typescript": "2.0.4", @@ -1804,14 +2815,16 @@ }, "node_modules/@volar/language-core": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.0.4.tgz", + "integrity": "sha512-VhC8i03P0x9LKGLTBi81xNTNWm40yxQ/Iba8IpH+LFr+Yb7c/D7fF90Cvf31MzPDM4G5rjIOlCfs+eQKPBkwQw==", "dependencies": { "@volar/source-map": "2.0.4" } }, "node_modules/@volar/language-server": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/language-server/-/language-server-2.0.4.tgz", + "integrity": "sha512-VnljhooQjT6RhmvwwJK9+3YYs2ovFmav4IVNHiQgnTMfiOiyABzcghwvJrJrI39rJDI6LNOWF7BYUJq7K07BKQ==", "dependencies": { "@volar/language-core": "2.0.4", "@volar/language-service": "2.0.4", @@ -1828,7 +2841,8 @@ }, "node_modules/@volar/language-service": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.0.4.tgz", + "integrity": "sha512-DoanyU9I9Nl85lUytDl8jgyk+nrUDR5CFNVMrxWXGXclP4WTqBayBgSFAeF1L/5AwP3MywmWoK4GLAEVvl8D+Q==", "dependencies": { "@volar/language-core": "2.0.4", "vscode-languageserver-protocol": "^3.17.5", @@ -1838,7 +2852,8 @@ }, "node_modules/@volar/snapshot-document": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/snapshot-document/-/snapshot-document-2.0.4.tgz", + "integrity": "sha512-YzgdmvpdRFxiBFCOVWga67naAtbPtKmPaFtGnmxWx+KXrjGkpUXT/2tzeKn5FLdtoYV+DRTdpMdP/45ArnVwZQ==", "dependencies": { "vscode-languageserver-protocol": "^3.17.5", "vscode-languageserver-textdocument": "^1.0.11" @@ -1846,14 +2861,16 @@ }, "node_modules/@volar/source-map": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.0.4.tgz", + "integrity": "sha512-BbxUinEMoJZqrHsSj1aBa0boCBnN3BoXnf7j9IBwjxosxGXOhCvqmH2L9raJemadaKjeVR8ZQLhV7AOhyoHt/Q==", "dependencies": { "muggle-string": "^0.4.0" } }, "node_modules/@volar/typescript": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.0.4.tgz", + "integrity": "sha512-KF7yh7GIo4iWuAQOKf/ONeFHdQA+wFriitW8LtGZB4iOOT6MdlRlYNsRL8do7XxmXvsBKcs4jTMtGn+uZRwlWg==", "dependencies": { "@volar/language-core": "2.0.4", "path-browserify": "^1.0.1" @@ -1861,7 +2878,8 @@ }, "node_modules/@vscode/emmet-helper": { "version": "2.9.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.9.2.tgz", + "integrity": "sha512-MaGuyW+fa13q3aYsluKqclmh62Hgp0BpKIqS66fCxfOaBcVQ1OnMQxRRgQUYnCkxFISAQlkJ0qWWPyXjro1Qrg==", "dependencies": { "emmet": "^2.4.3", "jsonc-parser": "^2.3.0", @@ -1872,19 +2890,23 @@ }, "node_modules/@vscode/emmet-helper/node_modules/jsonc-parser": { "version": "2.3.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", + "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" }, "node_modules/@vscode/emmet-helper/node_modules/vscode-uri": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", + "integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==" }, "node_modules/@vscode/l10n": { "version": "0.0.16", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.16.tgz", + "integrity": "sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==" }, "node_modules/acorn": { "version": "8.11.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "bin": { "acorn": "bin/acorn" }, @@ -1894,16 +2916,18 @@ }, "node_modules/acorn-walk": { "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/agent-base": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", "dev": true, - "license": "MIT", "dependencies": { "debug": "^4.3.4" }, @@ -1913,8 +2937,9 @@ }, "node_modules/aggregate-error": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -1925,18 +2950,21 @@ }, "node_modules/ansi-align": { "version": "3.0.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dependencies": { "string-width": "^4.1.0" } }, "node_modules/ansi-align/node_modules/emoji-regex": { "version": "8.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/ansi-align/node_modules/string-width": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1948,7 +2976,8 @@ }, "node_modules/ansi-align/node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1958,8 +2987,9 @@ }, "node_modules/ansi-escapes": { "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^3.0.0" }, @@ -1972,8 +3002,9 @@ }, "node_modules/ansi-escapes/node_modules/type-fest": { "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -1983,14 +3014,16 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { "version": "4.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { "color-convert": "^2.0.1" }, @@ -2003,13 +3036,15 @@ }, "node_modules/any-promise": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/anymatch": { "version": "3.1.3", - "license": "ISC", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -2020,26 +3055,30 @@ }, "node_modules/argparse": { "version": "2.0.1", - "license": "Python-2.0" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/argv-formatter": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", + "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/aria-query": { "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "deep-equal": "^2.0.5" } }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -2053,12 +3092,14 @@ }, "node_modules/array-ify": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true }, "node_modules/array-iterate": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2075,7 +3116,8 @@ }, "node_modules/astro": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.1.0.tgz", + "integrity": "sha512-xbLWqvMn2JFyv7FpzHiXFn17bRS0P/b4cdEPXMMZOpBI9V8ZC33o6Xs+c59/pYSZpYiNd1HTg778XT5MhcpyKw==", "dependencies": { "@astrojs/compiler": "^2.3.4", "@astrojs/internal-helpers": "0.2.1", @@ -2154,14 +3196,16 @@ }, "node_modules/astro/node_modules/aria-query": { "version": "5.3.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dependencies": { "dequal": "^2.0.3" } }, "node_modules/astro/node_modules/execa": { "version": "8.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -2182,7 +3226,8 @@ }, "node_modules/astro/node_modules/get-stream": { "version": "8.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "engines": { "node": ">=16" }, @@ -2192,14 +3237,16 @@ }, "node_modules/astro/node_modules/human-signals": { "version": "5.0.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "engines": { "node": ">=16.17.0" } }, "node_modules/astro/node_modules/is-stream": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -2209,7 +3256,8 @@ }, "node_modules/astro/node_modules/mimic-fn": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "engines": { "node": ">=12" }, @@ -2219,7 +3267,8 @@ }, "node_modules/astro/node_modules/npm-run-path": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dependencies": { "path-key": "^4.0.0" }, @@ -2232,7 +3281,8 @@ }, "node_modules/astro/node_modules/onetime": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -2245,7 +3295,8 @@ }, "node_modules/astro/node_modules/path-key": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "engines": { "node": ">=12" }, @@ -2255,7 +3306,8 @@ }, "node_modules/astro/node_modules/signal-exit": { "version": "4.1.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "engines": { "node": ">=14" }, @@ -2265,7 +3317,8 @@ }, "node_modules/astro/node_modules/strip-final-newline": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "engines": { "node": ">=12" }, @@ -2275,13 +3328,15 @@ }, "node_modules/asynckit": { "version": "0.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/available-typed-arrays": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, - "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -2294,14 +3349,16 @@ }, "node_modules/axobject-query": { "version": "4.0.0", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", + "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", "dependencies": { "dequal": "^2.0.3" } }, "node_modules/bail": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2309,15 +3366,19 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/base-64": { "version": "1.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -2331,13 +3392,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/before-after-hook": { "version": "2.2.3", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true }, "node_modules/bidi-js": { "version": "1.0.3", @@ -2350,14 +3411,16 @@ }, "node_modules/binary-extensions": { "version": "2.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "engines": { "node": ">=8" } }, "node_modules/bl": { "version": "5.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", "dependencies": { "buffer": "^6.0.3", "inherits": "^2.0.4", @@ -2366,7 +3429,8 @@ }, "node_modules/bl/node_modules/readable-stream": { "version": "3.6.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -2378,12 +3442,14 @@ }, "node_modules/bottleneck": { "version": "2.19.5", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dev": true }, "node_modules/boxen": { "version": "7.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^7.0.1", @@ -2403,7 +3469,8 @@ }, "node_modules/boxen/node_modules/chalk": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -2413,11 +3480,13 @@ }, "node_modules/boxen/node_modules/emoji-regex": { "version": "9.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/boxen/node_modules/string-width": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -2432,8 +3501,9 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2441,7 +3511,8 @@ }, "node_modules/braces": { "version": "3.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dependencies": { "fill-range": "^7.0.1" }, @@ -2451,6 +3522,8 @@ }, "node_modules/browserslist": { "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "funding": [ { "type": "opencollective", @@ -2465,7 +3538,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "caniuse-lite": "^1.0.30001587", "electron-to-chromium": "^1.4.668", @@ -2481,6 +3553,8 @@ }, "node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -2495,7 +3569,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -2512,8 +3585,9 @@ }, "node_modules/call-bind": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -2530,8 +3604,9 @@ }, "node_modules/callsites": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -2539,7 +3614,8 @@ }, "node_modules/camelcase": { "version": "7.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", "engines": { "node": ">=14.16" }, @@ -2549,6 +3625,8 @@ }, "node_modules/caniuse-lite": { "version": "1.0.30001591", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", + "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", "funding": [ { "type": "opencollective", @@ -2562,12 +3640,12 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/ccount": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2593,8 +3671,9 @@ }, "node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2608,8 +3687,9 @@ }, "node_modules/char-regex": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -2617,7 +3697,8 @@ }, "node_modules/character-entities": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2625,7 +3706,8 @@ }, "node_modules/character-entities-html4": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2633,7 +3715,8 @@ }, "node_modules/character-entities-legacy": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2653,7 +3736,8 @@ }, "node_modules/chokidar": { "version": "3.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -2675,28 +3759,31 @@ }, "node_modules/ci-info": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/sibiraj-s" } ], - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/clean-stack": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/cli-boxes": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", "engines": { "node": ">=10" }, @@ -2706,7 +3793,8 @@ }, "node_modules/cli-cursor": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dependencies": { "restore-cursor": "^4.0.0" }, @@ -2719,8 +3807,9 @@ }, "node_modules/cli-highlight": { "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", "dev": true, - "license": "ISC", "peer": true, "dependencies": { "chalk": "^4.0.0", @@ -2740,8 +3829,9 @@ }, "node_modules/cli-highlight/node_modules/cliui": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, - "license": "ISC", "peer": true, "dependencies": { "string-width": "^4.2.0", @@ -2751,20 +3841,23 @@ }, "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true }, "node_modules/cli-highlight/node_modules/parse5": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -2777,8 +3870,9 @@ }, "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -2789,8 +3883,9 @@ }, "node_modules/cli-highlight/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { "ansi-styles": "^4.0.0", @@ -2806,8 +3901,9 @@ }, "node_modules/cli-highlight/node_modules/yargs": { "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "cliui": "^7.0.2", @@ -2824,8 +3920,9 @@ }, "node_modules/cli-highlight/node_modules/yargs-parser": { "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, - "license": "ISC", "peer": true, "engines": { "node": ">=10" @@ -2833,7 +3930,8 @@ }, "node_modules/cli-spinners": { "version": "2.9.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "engines": { "node": ">=6" }, @@ -2843,9 +3941,9 @@ }, "node_modules/cli-table3": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, - "license": "MIT", - "peer": true, "dependencies": { "string-width": "^4.2.0" }, @@ -2858,15 +3956,15 @@ }, "node_modules/cli-table3/node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, - "license": "MIT", - "peer": true + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/cli-table3/node_modules/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, - "license": "MIT", - "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2878,9 +3976,9 @@ }, "node_modules/cli-table3/node_modules/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, - "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2890,7 +3988,8 @@ }, "node_modules/cliui": { "version": "8.0.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -2902,11 +4001,13 @@ }, "node_modules/cliui/node_modules/emoji-regex": { "version": "8.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/cliui/node_modules/string-width": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2918,7 +4019,8 @@ }, "node_modules/cliui/node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2928,7 +4030,8 @@ }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2943,14 +4046,16 @@ }, "node_modules/clsx": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", "engines": { "node": ">=6" } }, "node_modules/color": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", "optional": true, "dependencies": { "color-convert": "^2.0.1", @@ -2962,7 +4067,8 @@ }, "node_modules/color-convert": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { "color-name": "~1.1.4" }, @@ -2972,11 +4078,13 @@ }, "node_modules/color-name": { "version": "1.1.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/color-string": { "version": "1.9.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", "optional": true, "dependencies": { "color-name": "^1.0.0", @@ -2985,8 +4093,9 @@ }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2996,7 +4105,8 @@ }, "node_modules/comma-separated-tokens": { "version": "2.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3004,12 +4114,14 @@ }, "node_modules/common-ancestor-path": { "version": "1.0.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==" }, "node_modules/compare-func": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, - "license": "MIT", "dependencies": { "array-ify": "^1.0.0", "dot-prop": "^5.1.0" @@ -3017,13 +4129,15 @@ }, "node_modules/concat-map": { "version": "0.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/config-chain": { "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "dev": true, - "license": "MIT", "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" @@ -3031,8 +4145,9 @@ }, "node_modules/conventional-changelog-angular": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", "dev": true, - "license": "ISC", "dependencies": { "compare-func": "^2.0.0" }, @@ -3042,8 +4157,9 @@ }, "node_modules/conventional-changelog-writer": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.1.tgz", + "integrity": "sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==", "dev": true, - "license": "MIT", "dependencies": { "conventional-commits-filter": "^4.0.0", "handlebars": "^4.7.7", @@ -3061,16 +4177,18 @@ }, "node_modules/conventional-commits-filter": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-4.0.0.tgz", + "integrity": "sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" } }, "node_modules/conventional-commits-parser": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", "dev": true, - "license": "MIT", "dependencies": { "is-text-path": "^2.0.0", "JSONStream": "^1.3.5", @@ -3086,24 +4204,28 @@ }, "node_modules/convert-source-map": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/cookie": { "version": "0.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "engines": { "node": ">= 0.6" } }, "node_modules/core-util-is": { "version": "1.0.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true }, "node_modules/cosmiconfig": { "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "env-paths": "^2.2.1", @@ -3128,20 +4250,23 @@ }, "node_modules/cosmiconfig/node_modules/json-parse-even-better-errors": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/cosmiconfig/node_modules/lines-and-columns": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/cosmiconfig/node_modules/parse-json": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", @@ -3158,7 +4283,8 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -3170,8 +4296,9 @@ }, "node_modules/crypto-random-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^1.0.1" }, @@ -3184,8 +4311,9 @@ }, "node_modules/crypto-random-string/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -3220,12 +4348,14 @@ }, "node_modules/csstype": { "version": "3.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/data-urls": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0" @@ -3236,7 +4366,8 @@ }, "node_modules/debug": { "version": "4.3.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -3251,12 +4382,14 @@ }, "node_modules/decimal.js": { "version": "10.4.3", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true }, "node_modules/decode-named-character-reference": { "version": "1.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", + "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", "dependencies": { "character-entities": "^2.0.0" }, @@ -3279,8 +4412,9 @@ }, "node_modules/deep-equal": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", "dev": true, - "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.5", @@ -3310,16 +4444,18 @@ }, "node_modules/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, - "license": "MIT", "engines": { "node": ">=4.0.0" } }, "node_modules/define-data-property": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -3334,8 +4470,9 @@ }, "node_modules/define-properties": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -3350,27 +4487,31 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/deprecation": { "version": "2.3.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true }, "node_modules/dequal": { "version": "2.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "engines": { "node": ">=6" } }, "node_modules/detect-libc": { "version": "2.0.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", "optional": true, "engines": { "node": ">=8" @@ -3378,7 +4519,8 @@ }, "node_modules/deterministic-object-hash": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", + "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", "dependencies": { "base-64": "^1.0.0" }, @@ -3388,11 +4530,13 @@ }, "node_modules/devalue": { "version": "4.3.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.2.tgz", + "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==" }, "node_modules/devlop": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dependencies": { "dequal": "^2.0.0" }, @@ -3403,7 +4547,8 @@ }, "node_modules/diff": { "version": "5.2.0", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "engines": { "node": ">=0.3.1" } @@ -3419,8 +4564,9 @@ }, "node_modules/dir-glob": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, - "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -3430,17 +4576,20 @@ }, "node_modules/dlv": { "version": "1.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" }, "node_modules/dom-accessibility-api": { "version": "0.5.16", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true }, "node_modules/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, - "license": "MIT", "dependencies": { "is-obj": "^2.0.0" }, @@ -3450,15 +4599,17 @@ }, "node_modules/dset": { "version": "3.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", "engines": { "node": ">=4" } }, "node_modules/duplexer2": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dev": true, - "license": "BSD-3-Clause", "peer": true, "dependencies": { "readable-stream": "^2.0.2" @@ -3466,21 +4617,18 @@ }, "node_modules/eastasianwidth": { "version": "0.2.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/electron-to-chromium": { "version": "1.4.685", - "license": "ISC" + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.685.tgz", + "integrity": "sha512-yDYeobbTEe4TNooEzOQO6xFqg9XnAkVy2Lod1C1B2it8u47JNLYvl9nLDWBamqUakWB8Jc1hhS1uHUNYTNQdfw==" }, "node_modules/emmet": { "version": "2.4.6", - "license": "MIT", - "workspaces": [ - "./packages/scanner", - "./packages/abbreviation", - "./packages/css-abbreviation", - "./" - ], + "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.6.tgz", + "integrity": "sha512-dJfbdY/hfeTyf/Ef7Y7ubLYzkBvPQ912wPaeVYpAxvFxkEBf/+hJu4H6vhAvFN6HlxqedlfVn2x1S44FfQ97pg==", "dependencies": { "@emmetio/abbreviation": "^2.3.3", "@emmetio/css-abbreviation": "^2.1.8" @@ -3488,17 +4636,20 @@ }, "node_modules/emoji-regex": { "version": "10.3.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" }, "node_modules/emojilib": { "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/entities": { "version": "4.5.0", - "license": "BSD-2-Clause", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "engines": { "node": ">=0.12" }, @@ -3508,8 +4659,9 @@ }, "node_modules/env-ci": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.0.0.tgz", + "integrity": "sha512-apikxMgkipkgTvMdRT9MNqWx5VLOci79F4VBd7Op/7OPjjoanjdAvn6fglMCCEf/1bAh8eOiuEVCUs4V3qP3nQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "execa": "^8.0.0", @@ -3521,8 +4673,9 @@ }, "node_modules/env-ci/node_modules/execa": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "cross-spawn": "^7.0.3", @@ -3544,8 +4697,9 @@ }, "node_modules/env-ci/node_modules/get-stream": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=16" @@ -3556,8 +4710,9 @@ }, "node_modules/env-ci/node_modules/human-signals": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, - "license": "Apache-2.0", "peer": true, "engines": { "node": ">=16.17.0" @@ -3565,8 +4720,9 @@ }, "node_modules/env-ci/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -3577,8 +4733,9 @@ }, "node_modules/env-ci/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -3589,8 +4746,9 @@ }, "node_modules/env-ci/node_modules/npm-run-path": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "path-key": "^4.0.0" @@ -3604,8 +4762,9 @@ }, "node_modules/env-ci/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "mimic-fn": "^4.0.0" @@ -3619,8 +4778,9 @@ }, "node_modules/env-ci/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -3631,8 +4791,9 @@ }, "node_modules/env-ci/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "peer": true, "engines": { "node": ">=14" @@ -3643,8 +4804,9 @@ }, "node_modules/env-ci/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -3655,24 +4817,27 @@ }, "node_modules/env-paths": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/error-ex": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/es-define-property": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", "dev": true, - "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -3682,16 +4847,18 @@ }, "node_modules/es-errors": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-get-iterator": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -3709,12 +4876,14 @@ }, "node_modules/es-module-lexer": { "version": "1.4.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" }, "node_modules/esbuild": { "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -3749,14 +4918,16 @@ }, "node_modules/escalade": { "version": "3.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "engines": { "node": ">=12" }, @@ -3766,7 +4937,8 @@ }, "node_modules/esprima": { "version": "4.0.1", - "license": "BSD-2-Clause", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -3777,19 +4949,22 @@ }, "node_modules/estree-walker": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dependencies": { "@types/estree": "^1.0.0" } }, "node_modules/eventemitter3": { "version": "5.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "node_modules/execa": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -3810,8 +4985,9 @@ }, "node_modules/execa/node_modules/get-stream": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -3821,11 +4997,13 @@ }, "node_modules/extend": { "version": "3.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "node_modules/extend-shallow": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dependencies": { "is-extendable": "^0.1.0" }, @@ -3835,7 +5013,8 @@ }, "node_modules/fast-glob": { "version": "3.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3849,15 +5028,17 @@ }, "node_modules/fastq": { "version": "1.17.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/figures": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", + "integrity": "sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "is-unicode-supported": "^2.0.0" @@ -3871,8 +5052,9 @@ }, "node_modules/figures/node_modules/is-unicode-supported": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", + "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -3883,7 +5065,8 @@ }, "node_modules/fill-range": { "version": "7.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3893,7 +5076,8 @@ }, "node_modules/find-up": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3907,8 +5091,9 @@ }, "node_modules/find-up-simple": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -3919,8 +5104,9 @@ }, "node_modules/find-versions": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "semver-regex": "^4.0.5" @@ -3934,7 +5120,8 @@ }, "node_modules/find-yarn-workspace-root2": { "version": "1.2.16", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", "dependencies": { "micromatch": "^4.0.2", "pkg-dir": "^4.2.0" @@ -3942,23 +5129,26 @@ }, "node_modules/flattie": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.0.tgz", + "integrity": "sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==", "engines": { "node": ">=8" } }, "node_modules/for-each": { "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, - "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/form-data": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3970,8 +5160,9 @@ }, "node_modules/from2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", "dev": true, - "license": "MIT", "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" @@ -3979,8 +5170,9 @@ }, "node_modules/fs-extra": { "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -3992,12 +5184,15 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -4008,36 +5203,41 @@ }, "node_modules/function-bind": { "version": "1.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "engines": { "node": ">=6.9.0" } }, "node_modules/get-caller-file": { "version": "2.0.5", - "license": "ISC", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-east-asian-width": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", "engines": { "node": ">=18" }, @@ -4056,8 +5256,9 @@ }, "node_modules/get-intrinsic": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -4074,8 +5275,9 @@ }, "node_modules/get-stream": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", + "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" }, @@ -4085,8 +5287,9 @@ }, "node_modules/git-log-parser": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", + "integrity": "sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "argv-formatter": "~1.0.0", @@ -4099,8 +5302,9 @@ }, "node_modules/git-log-parser/node_modules/split2": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", + "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", "dev": true, - "license": "ISC", "peer": true, "dependencies": { "through2": "~2.0.0" @@ -4108,12 +5312,14 @@ }, "node_modules/github-slugger": { "version": "2.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" }, "node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4131,7 +5337,8 @@ }, "node_modules/glob-parent": { "version": "5.1.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dependencies": { "is-glob": "^4.0.1" }, @@ -4141,15 +5348,17 @@ }, "node_modules/globals": { "version": "11.12.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "engines": { "node": ">=4" } }, "node_modules/globby": { "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, - "license": "MIT", "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.3.0", @@ -4166,8 +5375,9 @@ }, "node_modules/gopd": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -4177,11 +5387,13 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", - "license": "ISC" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/gray-matter": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", "dependencies": { "js-yaml": "^3.13.1", "kind-of": "^6.0.2", @@ -4194,14 +5406,16 @@ }, "node_modules/gray-matter/node_modules/argparse": { "version": "1.0.10", - "license": "MIT", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/gray-matter/node_modules/js-yaml": { "version": "3.14.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -4212,8 +5426,9 @@ }, "node_modules/handlebars": { "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -4232,24 +5447,27 @@ }, "node_modules/has-bigints": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, - "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -4259,8 +5477,9 @@ }, "node_modules/has-proto": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -4270,8 +5489,9 @@ }, "node_modules/has-symbols": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -4281,8 +5501,9 @@ }, "node_modules/has-tostringtag": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, - "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -4295,7 +5516,8 @@ }, "node_modules/hasown": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", "dependencies": { "function-bind": "^1.1.2" }, @@ -4305,7 +5527,8 @@ }, "node_modules/hast-util-from-html": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz", + "integrity": "sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==", "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.1.0", @@ -4321,7 +5544,8 @@ }, "node_modules/hast-util-from-parse5": { "version": "8.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -4339,7 +5563,8 @@ }, "node_modules/hast-util-parse-selector": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", "dependencies": { "@types/hast": "^3.0.0" }, @@ -4350,7 +5575,8 @@ }, "node_modules/hast-util-raw": { "version": "9.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.2.tgz", + "integrity": "sha512-PldBy71wO9Uq1kyaMch9AHIghtQvIwxBUkv823pKmkTM3oV1JxtsTNYdevMxvUHqcnOAuO65JKU2+0NOxc2ksA==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -4373,7 +5599,8 @@ }, "node_modules/hast-util-to-html": { "version": "9.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", + "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", @@ -4395,7 +5622,8 @@ }, "node_modules/hast-util-to-parse5": { "version": "8.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", + "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", @@ -4412,7 +5640,8 @@ }, "node_modules/hast-util-whitespace": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", "dependencies": { "@types/hast": "^3.0.0" }, @@ -4423,7 +5652,8 @@ }, "node_modules/hastscript": { "version": "8.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", @@ -4438,8 +5668,9 @@ }, "node_modules/highlight.js": { "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", "dev": true, - "license": "BSD-3-Clause", "peer": true, "engines": { "node": "*" @@ -4447,8 +5678,9 @@ }, "node_modules/hook-std": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -4459,8 +5691,9 @@ }, "node_modules/hosted-git-info": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^10.0.1" }, @@ -4470,16 +5703,18 @@ }, "node_modules/hosted-git-info/node_modules/lru-cache": { "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "dev": true, - "license": "ISC", "engines": { "node": "14 || >=16.14" } }, "node_modules/html-encoding-sniffer": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-encoding": "^3.1.1" }, @@ -4489,11 +5724,13 @@ }, "node_modules/html-escaper": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", + "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" }, "node_modules/html-void-elements": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4501,12 +5738,14 @@ }, "node_modules/http-cache-semantics": { "version": "4.1.1", - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http-proxy-agent": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" @@ -4517,8 +5756,9 @@ }, "node_modules/https-proxy-agent": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -4529,15 +5769,17 @@ }, "node_modules/human-signals": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } }, "node_modules/iconv-lite": { "version": "0.4.24", - "license": "MIT", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -4547,6 +5789,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -4560,21 +5804,22 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/ignore": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "parent-module": "^1.0.0", @@ -4589,8 +5834,9 @@ }, "node_modules/import-fresh/node_modules/resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -4598,8 +5844,9 @@ }, "node_modules/import-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", + "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.2" }, @@ -4609,8 +5856,9 @@ }, "node_modules/import-from-esm": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/import-from-esm/-/import-from-esm-1.3.3.tgz", + "integrity": "sha512-U3Qt/CyfFpTUv6LOP2jRTLYjphH6zg3okMfHbyqRa/W2w6hr8OsJWVggNlR4jxuojQy81TgTJTxgSkyoteRGMQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "debug": "^4.3.4", @@ -4622,7 +5870,8 @@ }, "node_modules/import-meta-resolve": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4630,16 +5879,18 @@ }, "node_modules/indent-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/index-to-position": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -4650,8 +5901,9 @@ }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, - "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4659,17 +5911,20 @@ }, "node_modules/inherits": { "version": "2.0.4", - "license": "ISC" + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "1.3.8", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/internal-slot": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, - "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -4681,16 +5936,18 @@ }, "node_modules/interpret": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/into-stream": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", + "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", "dev": true, - "license": "MIT", "dependencies": { "from2": "^2.3.0", "p-is-promise": "^3.0.0" @@ -4704,8 +5961,9 @@ }, "node_modules/is-arguments": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4719,8 +5977,9 @@ }, "node_modules/is-array-buffer": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -4734,13 +5993,15 @@ }, "node_modules/is-arrayish": { "version": "0.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, - "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -4750,7 +6011,8 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -4760,8 +6022,9 @@ }, "node_modules/is-boolean-object": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4775,6 +6038,8 @@ }, "node_modules/is-buffer": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "funding": [ { "type": "github", @@ -4789,15 +6054,15 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -4807,7 +6072,8 @@ }, "node_modules/is-core-module": { "version": "2.13.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dependencies": { "hasown": "^2.0.0" }, @@ -4817,8 +6083,9 @@ }, "node_modules/is-date-object": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4831,7 +6098,8 @@ }, "node_modules/is-docker": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", "bin": { "is-docker": "cli.js" }, @@ -4844,28 +6112,32 @@ }, "node_modules/is-extendable": { "version": "0.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "engines": { "node": ">=0.10.0" } }, "node_modules/is-extglob": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "engines": { "node": ">=8" } }, "node_modules/is-glob": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dependencies": { "is-extglob": "^2.1.1" }, @@ -4875,7 +6147,8 @@ }, "node_modules/is-inside-container": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", "dependencies": { "is-docker": "^3.0.0" }, @@ -4891,7 +6164,8 @@ }, "node_modules/is-interactive": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "engines": { "node": ">=12" }, @@ -4901,23 +6175,26 @@ }, "node_modules/is-map": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4930,15 +6207,17 @@ }, "node_modules/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, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-plain-obj": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "engines": { "node": ">=12" }, @@ -4948,13 +6227,15 @@ }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true }, "node_modules/is-regex": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4968,16 +6249,18 @@ }, "node_modules/is-set": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7" }, @@ -4990,8 +6273,9 @@ }, "node_modules/is-stream": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -5001,8 +6285,9 @@ }, "node_modules/is-string": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -5015,8 +6300,9 @@ }, "node_modules/is-symbol": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, - "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -5029,8 +6315,9 @@ }, "node_modules/is-text-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", "dev": true, - "license": "MIT", "dependencies": { "text-extensions": "^2.0.0" }, @@ -5040,7 +6327,8 @@ }, "node_modules/is-unicode-supported": { "version": "1.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "engines": { "node": ">=12" }, @@ -5050,16 +6338,18 @@ }, "node_modules/is-weakmap": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakset": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -5070,7 +6360,8 @@ }, "node_modules/is-wsl": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", "dependencies": { "is-inside-container": "^1.0.0" }, @@ -5083,17 +6374,20 @@ }, "node_modules/isarray": { "version": "2.0.5", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/issue-parser": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", + "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", "dev": true, - "license": "MIT", "dependencies": { "lodash.capitalize": "^4.2.1", "lodash.escaperegexp": "^4.1.2", @@ -5107,8 +6401,9 @@ }, "node_modules/java-properties": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", + "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">= 0.6.0" @@ -5116,11 +6411,13 @@ }, "node_modules/js-tokens": { "version": "4.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dependencies": { "argparse": "^2.0.1" }, @@ -5170,7 +6467,8 @@ }, "node_modules/jsesc": { "version": "2.5.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "bin": { "jsesc": "bin/jsesc" }, @@ -5180,26 +6478,30 @@ }, "node_modules/json-parse-better-errors": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/json-parse-even-better-errors": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz", + "integrity": "sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==", "dev": true, - "license": "MIT", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true }, "node_modules/json5": { "version": "2.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": { "json5": "lib/cli.js" }, @@ -5209,13 +6511,15 @@ }, "node_modules/jsonc-parser": { "version": "3.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true }, "node_modules/jsonfile": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -5225,16 +6529,18 @@ }, "node_modules/jsonparse": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true, "engines": [ "node >= 0.2.0" - ], - "license": "MIT" + ] }, "node_modules/JSONStream": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, - "license": "(MIT OR Apache-2.0)", "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -5248,30 +6554,34 @@ }, "node_modules/kind-of": { "version": "6.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "engines": { "node": ">=0.10.0" } }, "node_modules/kleur": { "version": "4.1.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "engines": { "node": ">=6" } }, "node_modules/lines-and-columns": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/load-json-file": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "graceful-fs": "^4.1.2", @@ -5285,8 +6595,9 @@ }, "node_modules/load-json-file/node_modules/parse-json": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "error-ex": "^1.3.1", @@ -5298,7 +6609,8 @@ }, "node_modules/load-yaml-file": { "version": "0.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", "dependencies": { "graceful-fs": "^4.1.5", "js-yaml": "^3.13.0", @@ -5311,14 +6623,16 @@ }, "node_modules/load-yaml-file/node_modules/argparse": { "version": "1.0.10", - "license": "MIT", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/load-yaml-file/node_modules/js-yaml": { "version": "3.14.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -5329,15 +6643,17 @@ }, "node_modules/load-yaml-file/node_modules/pify": { "version": "4.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "engines": { "node": ">=6" } }, "node_modules/local-pkg": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", "dev": true, - "license": "MIT", "dependencies": { "mlly": "^1.4.2", "pkg-types": "^1.0.3" @@ -5351,7 +6667,8 @@ }, "node_modules/locate-path": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dependencies": { "p-locate": "^5.0.0" }, @@ -5364,50 +6681,60 @@ }, "node_modules/lodash": { "version": "4.17.21", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/lodash-es": { "version": "4.17.21", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true }, "node_modules/lodash.capitalize": { "version": "4.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", + "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", + "dev": true }, "node_modules/lodash.debounce": { "version": "4.0.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true }, "node_modules/lodash.isstring": { "version": "4.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lodash.uniqby": { "version": "4.7.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", + "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", + "dev": true }, "node_modules/log-symbols": { "version": "5.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", "dependencies": { "chalk": "^5.0.0", "is-unicode-supported": "^1.1.0" @@ -5421,7 +6748,8 @@ }, "node_modules/log-symbols/node_modules/chalk": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -5431,7 +6759,8 @@ }, "node_modules/longest-streak": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5439,7 +6768,8 @@ }, "node_modules/loose-envify": { "version": "1.4.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -5458,22 +6788,25 @@ }, "node_modules/lru-cache": { "version": "5.1.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/lz-string": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, - "license": "MIT", "bin": { "lz-string": "bin/bin.js" } }, "node_modules/magic-string": { "version": "0.30.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", + "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -5483,7 +6816,8 @@ }, "node_modules/markdown-table": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5491,8 +6825,9 @@ }, "node_modules/marked": { "version": "12.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", + "integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", "dev": true, - "license": "MIT", "peer": true, "bin": { "marked": "bin/marked.js" @@ -5503,8 +6838,9 @@ }, "node_modules/marked-terminal": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-7.0.0.tgz", + "integrity": "sha512-sNEx8nn9Ktcm6pL0TnRz8tnXq/mSS0Q1FRSwJOAqw4lAB4l49UeDf85Gm1n9RPFm5qurCPjwi1StAQT2XExhZw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "ansi-escapes": "^6.2.0", @@ -5523,8 +6859,9 @@ }, "node_modules/marked-terminal/node_modules/chalk": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -5535,7 +6872,8 @@ }, "node_modules/mdast-util-definitions": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", + "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -5548,7 +6886,8 @@ }, "node_modules/mdast-util-find-and-replace": { "version": "3.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", @@ -5562,7 +6901,8 @@ }, "node_modules/mdast-util-from-markdown": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -5584,7 +6924,8 @@ }, "node_modules/mdast-util-gfm": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", @@ -5601,7 +6942,8 @@ }, "node_modules/mdast-util-gfm-autolink-literal": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", @@ -5616,7 +6958,8 @@ }, "node_modules/mdast-util-gfm-footnote": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", @@ -5631,7 +6974,8 @@ }, "node_modules/mdast-util-gfm-strikethrough": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", @@ -5644,7 +6988,8 @@ }, "node_modules/mdast-util-gfm-table": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", @@ -5659,7 +7004,8 @@ }, "node_modules/mdast-util-gfm-task-list-item": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", @@ -5673,7 +7019,8 @@ }, "node_modules/mdast-util-phrasing": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" @@ -5685,7 +7032,8 @@ }, "node_modules/mdast-util-to-hast": { "version": "13.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -5703,7 +7051,8 @@ }, "node_modules/mdast-util-to-markdown": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -5721,7 +7070,8 @@ }, "node_modules/mdast-util-to-string": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dependencies": { "@types/mdast": "^4.0.0" }, @@ -5738,8 +7088,9 @@ }, "node_modules/meow": { "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", "dev": true, - "license": "MIT", "engines": { "node": ">=16.10" }, @@ -5749,17 +7100,21 @@ }, "node_modules/merge-stream": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/merge2": { "version": "1.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "engines": { "node": ">= 8" } }, "node_modules/micromark": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", "funding": [ { "type": "GitHub Sponsors", @@ -5770,7 +7125,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", @@ -5793,6 +7147,8 @@ }, "node_modules/micromark-core-commonmark": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", "funding": [ { "type": "GitHub Sponsors", @@ -5803,7 +7159,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", @@ -5825,7 +7180,8 @@ }, "node_modules/micromark-extension-gfm": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", "dependencies": { "micromark-extension-gfm-autolink-literal": "^2.0.0", "micromark-extension-gfm-footnote": "^2.0.0", @@ -5843,7 +7199,8 @@ }, "node_modules/micromark-extension-gfm-autolink-literal": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", @@ -5857,7 +7214,8 @@ }, "node_modules/micromark-extension-gfm-footnote": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", @@ -5875,7 +7233,8 @@ }, "node_modules/micromark-extension-gfm-strikethrough": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -5891,7 +7250,8 @@ }, "node_modules/micromark-extension-gfm-table": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", + "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -5906,7 +7266,8 @@ }, "node_modules/micromark-extension-gfm-tagfilter": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", "dependencies": { "micromark-util-types": "^2.0.0" }, @@ -5917,7 +7278,8 @@ }, "node_modules/micromark-extension-gfm-task-list-item": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", + "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", @@ -5932,6 +7294,8 @@ }, "node_modules/micromark-factory-destination": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", "funding": [ { "type": "GitHub Sponsors", @@ -5942,7 +7306,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -5951,6 +7314,8 @@ }, "node_modules/micromark-factory-label": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", "funding": [ { "type": "GitHub Sponsors", @@ -5961,7 +7326,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -5971,6 +7335,8 @@ }, "node_modules/micromark-factory-space": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", "funding": [ { "type": "GitHub Sponsors", @@ -5981,7 +7347,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -5989,6 +7354,8 @@ }, "node_modules/micromark-factory-title": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", "funding": [ { "type": "GitHub Sponsors", @@ -5999,7 +7366,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -6009,6 +7375,8 @@ }, "node_modules/micromark-factory-whitespace": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", "funding": [ { "type": "GitHub Sponsors", @@ -6019,7 +7387,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -6029,6 +7396,8 @@ }, "node_modules/micromark-util-character": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", "funding": [ { "type": "GitHub Sponsors", @@ -6039,7 +7408,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -6047,6 +7415,8 @@ }, "node_modules/micromark-util-chunked": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", "funding": [ { "type": "GitHub Sponsors", @@ -6057,13 +7427,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-classify-character": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", "funding": [ { "type": "GitHub Sponsors", @@ -6074,7 +7445,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -6083,6 +7453,8 @@ }, "node_modules/micromark-util-combine-extensions": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", "funding": [ { "type": "GitHub Sponsors", @@ -6093,7 +7465,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -6101,6 +7472,8 @@ }, "node_modules/micromark-util-decode-numeric-character-reference": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", "funding": [ { "type": "GitHub Sponsors", @@ -6111,13 +7484,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-decode-string": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", "funding": [ { "type": "GitHub Sponsors", @@ -6128,7 +7502,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -6138,6 +7511,8 @@ }, "node_modules/micromark-util-encode": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", "funding": [ { "type": "GitHub Sponsors", @@ -6147,11 +7522,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromark-util-html-tag-name": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", "funding": [ { "type": "GitHub Sponsors", @@ -6161,11 +7537,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromark-util-normalize-identifier": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", "funding": [ { "type": "GitHub Sponsors", @@ -6176,13 +7553,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-resolve-all": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", "funding": [ { "type": "GitHub Sponsors", @@ -6193,13 +7571,14 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-sanitize-uri": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", "funding": [ { "type": "GitHub Sponsors", @@ -6210,7 +7589,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", @@ -6219,6 +7597,8 @@ }, "node_modules/micromark-util-subtokenize": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", "funding": [ { "type": "GitHub Sponsors", @@ -6229,7 +7609,6 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -6239,6 +7618,8 @@ }, "node_modules/micromark-util-symbol": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", "funding": [ { "type": "GitHub Sponsors", @@ -6248,11 +7629,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromark-util-types": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", "funding": [ { "type": "GitHub Sponsors", @@ -6262,12 +7644,12 @@ "type": "OpenCollective", "url": "https://opencollective.com/unified" } - ], - "license": "MIT" + ] }, "node_modules/micromatch": { "version": "4.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -6278,7 +7660,8 @@ }, "node_modules/mime": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "bin": { "mime": "cli.js" }, @@ -6288,16 +7671,18 @@ }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -6307,15 +7692,17 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "engines": { "node": ">=6" } }, "node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6325,16 +7712,18 @@ }, "node_modules/minimist": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/mkdirp": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", "dev": true, - "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -6347,8 +7736,9 @@ }, "node_modules/mlly": { "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", "dev": true, - "license": "MIT", "dependencies": { "acorn": "^8.11.3", "pathe": "^1.1.2", @@ -6358,21 +7748,25 @@ }, "node_modules/monaco-editor": { "version": "0.46.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.46.0.tgz", + "integrity": "sha512-ADwtLIIww+9FKybWscd7OCfm9odsFYHImBRI1v9AviGce55QY8raT+9ihH8jX/E/e6QVSGM+pKj4jSUSRmALNQ==", "peer": true }, "node_modules/ms": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/muggle-string": { "version": "0.4.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==" }, "node_modules/mz": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "any-promise": "^1.0.0", @@ -6382,13 +7776,14 @@ }, "node_modules/nanoid": { "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -6398,7 +7793,8 @@ }, "node_modules/needle": { "version": "2.9.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", "dependencies": { "debug": "^3.2.6", "iconv-lite": "^0.4.4", @@ -6413,20 +7809,23 @@ }, "node_modules/needle/node_modules/debug": { "version": "3.2.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dependencies": { "ms": "^2.1.1" } }, "node_modules/neo-async": { "version": "2.6.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true }, "node_modules/nerf-dart": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", + "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", + "dev": true }, "node_modules/netlify-cli": { "version": "17.17.1", @@ -22522,7 +23921,8 @@ }, "node_modules/nlcst-to-string": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", + "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", "dependencies": { "@types/nlcst": "^1.0.0" }, @@ -22533,8 +23933,9 @@ }, "node_modules/node-emoji": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@sindresorhus/is": "^4.6.0", @@ -22548,12 +23949,14 @@ }, "node_modules/node-releases": { "version": "2.0.14", - "license": "MIT" + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/normalize-package-data": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^7.0.0", "is-core-module": "^2.8.1", @@ -22566,15 +23969,17 @@ }, "node_modules/normalize-path": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "engines": { "node": ">=0.10.0" } }, "node_modules/normalize-url": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" }, @@ -22584,6 +23989,8 @@ }, "node_modules/npm": { "version": "10.4.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.4.0.tgz", + "integrity": "sha512-RS7Mx0OVfXlOcQLRePuDIYdFCVBPCNapWHplDK+mh7GDdP/Tvor4ocuybRRPSvfcRb2vjRJt1fHCqw3cr8qACQ==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -22657,14 +24064,6 @@ "write-file-atomic" ], "dev": true, - "license": "Artistic-2.0", - "workspaces": [ - "docs", - "smoke-tests", - "mock-globals", - "mock-registry", - "workspaces/*" - ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^7.2.1", @@ -22747,8 +24146,9 @@ }, "node_modules/npm-run-path": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -25347,8 +26747,9 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=0.10.0" @@ -25356,16 +26757,18 @@ }, "node_modules/object-inspect": { "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-is": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" @@ -25379,16 +26782,18 @@ }, "node_modules/object-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -25404,15 +26809,17 @@ }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, - "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -25425,7 +26832,8 @@ }, "node_modules/ora": { "version": "7.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^4.0.0", @@ -25446,7 +26854,8 @@ }, "node_modules/ora/node_modules/chalk": { "version": "5.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -25456,7 +26865,8 @@ }, "node_modules/ora/node_modules/string-width": { "version": "6.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^10.2.1", @@ -25471,8 +26881,9 @@ }, "node_modules/p-each-series": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -25483,8 +26894,9 @@ }, "node_modules/p-filter": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", "dev": true, - "license": "MIT", "dependencies": { "p-map": "^5.1.0" }, @@ -25497,15 +26909,17 @@ }, "node_modules/p-is-promise": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-limit": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -25518,7 +26932,8 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dependencies": { "p-limit": "^3.0.2" }, @@ -25531,7 +26946,8 @@ }, "node_modules/p-locate/node_modules/p-limit": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -25544,7 +26960,8 @@ }, "node_modules/p-locate/node_modules/yocto-queue": { "version": "0.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "engines": { "node": ">=10" }, @@ -25554,8 +26971,9 @@ }, "node_modules/p-map": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", "dev": true, - "license": "MIT", "dependencies": { "aggregate-error": "^4.0.0" }, @@ -25568,8 +26986,9 @@ }, "node_modules/p-map/node_modules/aggregate-error": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", "dev": true, - "license": "MIT", "dependencies": { "clean-stack": "^4.0.0", "indent-string": "^5.0.0" @@ -25583,8 +27002,9 @@ }, "node_modules/p-map/node_modules/clean-stack": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", "dev": true, - "license": "MIT", "dependencies": { "escape-string-regexp": "5.0.0" }, @@ -25597,8 +27017,9 @@ }, "node_modules/p-map/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -25608,7 +27029,8 @@ }, "node_modules/p-queue": { "version": "8.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", "dependencies": { "eventemitter3": "^5.0.1", "p-timeout": "^6.1.2" @@ -25622,15 +27044,17 @@ }, "node_modules/p-reduce": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", + "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/p-timeout": { "version": "6.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "engines": { "node": ">=14.16" }, @@ -25640,8 +27064,9 @@ }, "node_modules/p-try": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -25649,12 +27074,14 @@ }, "node_modules/p5": { "version": "1.9.0", - "license": "LGPL-2.1" + "resolved": "https://registry.npmjs.org/p5/-/p5-1.9.0.tgz", + "integrity": "sha512-+5/hz0ZokCDf7BMMAeemE7FIo7gFZK7ImL62acHLXZwerGjqj+171bnaAWj4aCFCx6fwysAr2U7/AKuPyPhehA==" }, "node_modules/parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "callsites": "^3.0.0" @@ -25665,8 +27092,9 @@ }, "node_modules/parse-json": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.1.tgz", + "integrity": "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.21.4", "error-ex": "^1.3.2", @@ -25683,8 +27111,9 @@ }, "node_modules/parse-json/node_modules/type-fest": { "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -25694,7 +27123,8 @@ }, "node_modules/parse-latin": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz", + "integrity": "sha512-b/K8ExXaWC9t34kKeDV8kGXBkXZ1HCSAZRYE7HR14eA1GlXX5L8iWhs8USJNhQU9q5ci413jCKF0gOyovvyRBg==", "dependencies": { "nlcst-to-string": "^3.0.0", "unist-util-modify-children": "^3.0.0", @@ -25707,7 +27137,8 @@ }, "node_modules/parse5": { "version": "7.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dependencies": { "entities": "^4.4.0" }, @@ -25717,8 +27148,9 @@ }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "parse5": "^6.0.1" @@ -25726,56 +27158,65 @@ }, "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/path-browserify": { "version": "1.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, "node_modules/path-exists": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "engines": { "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/path-key": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "engines": { "node": ">=8" } }, "node_modules/path-parse": { "version": "1.0.7", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { "version": "6.2.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "node_modules/path-type": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/pathe": { "version": "1.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true }, "node_modules/pathval": { "version": "1.1.1", @@ -25788,11 +27229,13 @@ }, "node_modules/picocolors": { "version": "1.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { "node": ">=8.6" }, @@ -25802,8 +27245,9 @@ }, "node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -25811,8 +27255,9 @@ }, "node_modules/pkg-conf": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "find-up": "^2.0.0", @@ -25824,8 +27269,9 @@ }, "node_modules/pkg-conf/node_modules/find-up": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "locate-path": "^2.0.0" @@ -25836,8 +27282,9 @@ }, "node_modules/pkg-conf/node_modules/locate-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "p-locate": "^2.0.0", @@ -25849,8 +27296,9 @@ }, "node_modules/pkg-conf/node_modules/p-limit": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "p-try": "^1.0.0" @@ -25861,8 +27309,9 @@ }, "node_modules/pkg-conf/node_modules/p-locate": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "p-limit": "^1.1.0" @@ -25873,8 +27322,9 @@ }, "node_modules/pkg-conf/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -25882,7 +27332,8 @@ }, "node_modules/pkg-dir": { "version": "4.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dependencies": { "find-up": "^4.0.0" }, @@ -25892,7 +27343,8 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -25903,7 +27355,8 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dependencies": { "p-locate": "^4.1.0" }, @@ -25913,7 +27366,8 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dependencies": { "p-try": "^2.0.0" }, @@ -25926,7 +27380,8 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dependencies": { "p-limit": "^2.2.0" }, @@ -25936,15 +27391,17 @@ }, "node_modules/pkg-dir/node_modules/p-try": { "version": "2.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "engines": { "node": ">=6" } }, "node_modules/pkg-types": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", "dev": true, - "license": "MIT", "dependencies": { "jsonc-parser": "^3.2.0", "mlly": "^1.2.0", @@ -25997,14 +27454,17 @@ }, "node_modules/possible-typed-array-names": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/postcss": { "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "funding": [ { "type": "opencollective", @@ -26019,7 +27479,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", @@ -26031,7 +27490,8 @@ }, "node_modules/preferred-pm": { "version": "3.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.3.tgz", + "integrity": "sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==", "dependencies": { "find-up": "^5.0.0", "find-yarn-workspace-root2": "1.2.16", @@ -26044,7 +27504,8 @@ }, "node_modules/preferred-pm/node_modules/which-pm": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", + "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", "dependencies": { "load-yaml-file": "^0.2.0", "path-exists": "^4.0.0" @@ -26055,7 +27516,8 @@ }, "node_modules/prettier": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "bin": { "prettier": "bin/prettier.cjs" }, @@ -26068,8 +27530,9 @@ }, "node_modules/pretty-format": { "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -26081,8 +27544,9 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -26092,14 +27556,16 @@ }, "node_modules/prismjs": { "version": "1.29.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", "engines": { "node": ">=6" } }, "node_modules/probe-image-size": { "version": "7.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", + "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", "dependencies": { "lodash.merge": "^4.6.2", "needle": "^2.5.2", @@ -26108,12 +27574,14 @@ }, "node_modules/process-nextick-args": { "version": "2.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "node_modules/prompts": { "version": "2.4.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -26124,14 +27592,16 @@ }, "node_modules/prompts/node_modules/kleur": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "engines": { "node": ">=6" } }, "node_modules/property-information": { "version": "6.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz", + "integrity": "sha512-OHYtXfu5aI2sS2LWFSN5rgJjrQ4pCy8i1jubJLe2QvMF8JJ++HXTUIVWFLfXJoaOfvYYjk2SN8J2wFUWIGXT4w==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -26139,29 +27609,35 @@ }, "node_modules/proto-list": { "version": "1.2.4", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true }, "node_modules/psl": { "version": "1.9.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true }, "node_modules/punycode": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/querystringify": { "version": "2.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true }, "node_modules/queue-microtask": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "funding": [ { "type": "github", @@ -26175,13 +27651,13 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/rc": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -26194,7 +27670,8 @@ }, "node_modules/react": { "version": "18.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -26204,7 +27681,8 @@ }, "node_modules/react-dom": { "version": "18.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" @@ -26215,20 +27693,23 @@ }, "node_modules/react-is": { "version": "17.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true }, "node_modules/react-refresh": { "version": "0.14.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", + "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/read-pkg": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", + "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/normalize-package-data": "^2.4.1", "normalize-package-data": "^6.0.0", @@ -26244,8 +27725,9 @@ }, "node_modules/read-pkg-up": { "version": "10.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-10.1.0.tgz", + "integrity": "sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==", "dev": true, - "license": "MIT", "dependencies": { "find-up": "^6.3.0", "read-pkg": "^8.1.0", @@ -26260,8 +27742,9 @@ }, "node_modules/read-pkg-up/node_modules/find-up": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, - "license": "MIT", "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" @@ -26275,8 +27758,9 @@ }, "node_modules/read-pkg-up/node_modules/locate-path": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, - "license": "MIT", "dependencies": { "p-locate": "^6.0.0" }, @@ -26289,8 +27773,9 @@ }, "node_modules/read-pkg-up/node_modules/p-limit": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -26303,8 +27788,9 @@ }, "node_modules/read-pkg-up/node_modules/p-locate": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, - "license": "MIT", "dependencies": { "p-limit": "^4.0.0" }, @@ -26317,16 +27803,18 @@ }, "node_modules/read-pkg-up/node_modules/path-exists": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/read-pkg-up/node_modules/type-fest": { "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -26336,8 +27824,9 @@ }, "node_modules/read-pkg/node_modules/type-fest": { "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -26347,8 +27836,9 @@ }, "node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, - "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -26361,12 +27851,14 @@ }, "node_modules/readable-stream/node_modules/isarray": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true }, "node_modules/readdirp": { "version": "3.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dependencies": { "picomatch": "^2.2.1" }, @@ -26376,6 +27868,8 @@ }, "node_modules/rechoir": { "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "dependencies": { "resolve": "^1.1.6" @@ -26386,13 +27880,15 @@ }, "node_modules/regenerator-runtime": { "version": "0.14.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "define-properties": "^1.2.1", @@ -26408,8 +27904,9 @@ }, "node_modules/registry-auth-token": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", "dev": true, - "license": "MIT", "dependencies": { "@pnpm/npm-conf": "^2.1.0" }, @@ -26419,7 +27916,8 @@ }, "node_modules/rehype": { "version": "13.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", + "integrity": "sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg==", "dependencies": { "@types/hast": "^3.0.0", "rehype-parse": "^9.0.0", @@ -26433,7 +27931,8 @@ }, "node_modules/rehype-parse": { "version": "9.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz", + "integrity": "sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==", "dependencies": { "@types/hast": "^3.0.0", "hast-util-from-html": "^2.0.0", @@ -26446,7 +27945,8 @@ }, "node_modules/rehype-raw": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", "dependencies": { "@types/hast": "^3.0.0", "hast-util-raw": "^9.0.0", @@ -26459,7 +27959,8 @@ }, "node_modules/rehype-stringify": { "version": "10.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz", + "integrity": "sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ==", "dependencies": { "@types/hast": "^3.0.0", "hast-util-to-html": "^9.0.0", @@ -26472,7 +27973,8 @@ }, "node_modules/remark-gfm": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", @@ -26488,7 +27990,8 @@ }, "node_modules/remark-parse": { "version": "11.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", @@ -26502,7 +28005,8 @@ }, "node_modules/remark-rehype": { "version": "11.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", + "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -26517,7 +28021,8 @@ }, "node_modules/remark-smartypants": { "version": "2.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.1.0.tgz", + "integrity": "sha512-qoF6Vz3BjU2tP6OfZqHOvCU0ACmu/6jhGaINSQRI9mM7wCxNQTKB3JUAN4SVoN2ybElEDTxBIABRep7e569iJw==", "dependencies": { "retext": "^8.1.0", "retext-smartypants": "^5.2.0", @@ -26529,7 +28034,8 @@ }, "node_modules/remark-stringify": { "version": "11.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-to-markdown": "^2.0.0", @@ -26542,11 +28048,13 @@ }, "node_modules/request-light": { "version": "0.7.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", + "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==" }, "node_modules/require-directory": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "engines": { "node": ">=0.10.0" } @@ -26562,12 +28070,14 @@ }, "node_modules/requires-port": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true }, "node_modules/resolve": { "version": "1.22.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -26582,8 +28092,9 @@ }, "node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=8" @@ -26591,7 +28102,8 @@ }, "node_modules/restore-cursor": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -26605,7 +28117,8 @@ }, "node_modules/retext": { "version": "8.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext/-/retext-8.1.0.tgz", + "integrity": "sha512-N9/Kq7YTn6ZpzfiGW45WfEGJqFf1IM1q8OsRa1CGzIebCJBNCANDRmOrholiDRGKo/We7ofKR4SEvcGAWEMD3Q==", "dependencies": { "@types/nlcst": "^1.0.0", "retext-latin": "^3.0.0", @@ -26619,7 +28132,8 @@ }, "node_modules/retext-latin": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-3.1.0.tgz", + "integrity": "sha512-5MrD1tuebzO8ppsja5eEu+ZbBeUNCjoEarn70tkXOS7Bdsdf6tNahsv2bY0Z8VooFF6cw7/6S+d3yI/TMlMVVQ==", "dependencies": { "@types/nlcst": "^1.0.0", "parse-latin": "^5.0.0", @@ -26633,11 +28147,13 @@ }, "node_modules/retext-latin/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext-latin/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -26654,7 +28170,8 @@ }, "node_modules/retext-latin/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26665,7 +28182,8 @@ }, "node_modules/retext-latin/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -26679,7 +28197,8 @@ }, "node_modules/retext-latin/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -26691,7 +28210,8 @@ }, "node_modules/retext-smartypants": { "version": "5.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-5.2.0.tgz", + "integrity": "sha512-Do8oM+SsjrbzT2UNIKgheP0hgUQTDDQYyZaIY3kfq0pdFzoPk+ZClYJ+OERNXveog4xf1pZL4PfRxNoVL7a/jw==", "dependencies": { "@types/nlcst": "^1.0.0", "nlcst-to-string": "^3.0.0", @@ -26705,11 +28225,13 @@ }, "node_modules/retext-smartypants/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext-smartypants/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -26726,7 +28248,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-is": { "version": "5.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26737,7 +28260,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26748,7 +28272,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-visit": { "version": "4.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0", @@ -26761,7 +28286,8 @@ }, "node_modules/retext-smartypants/node_modules/unist-util-visit-parents": { "version": "5.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0" @@ -26773,7 +28299,8 @@ }, "node_modules/retext-smartypants/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -26787,7 +28314,8 @@ }, "node_modules/retext-smartypants/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -26799,7 +28327,8 @@ }, "node_modules/retext-stringify": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", + "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", "dependencies": { "@types/nlcst": "^1.0.0", "nlcst-to-string": "^3.0.0", @@ -26812,11 +28341,13 @@ }, "node_modules/retext-stringify/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext-stringify/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -26833,7 +28364,8 @@ }, "node_modules/retext-stringify/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26844,7 +28376,8 @@ }, "node_modules/retext-stringify/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -26858,7 +28391,8 @@ }, "node_modules/retext-stringify/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -26870,11 +28404,13 @@ }, "node_modules/retext/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/retext/node_modules/unified": { "version": "10.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", @@ -26891,7 +28427,8 @@ }, "node_modules/retext/node_modules/unist-util-stringify-position": { "version": "3.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -26902,7 +28439,8 @@ }, "node_modules/retext/node_modules/vfile": { "version": "5.3.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -26916,7 +28454,8 @@ }, "node_modules/retext/node_modules/vfile-message": { "version": "3.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -26928,7 +28467,8 @@ }, "node_modules/reusify": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -26936,7 +28476,8 @@ }, "node_modules/rollup": { "version": "4.12.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", "dependencies": { "@types/estree": "1.0.5" }, @@ -26972,6 +28513,8 @@ }, "node_modules/run-parallel": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "funding": [ { "type": "github", @@ -26986,27 +28529,30 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/safe-buffer": { "version": "5.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safer-buffer": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sax": { "version": "1.3.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" }, "node_modules/saxes": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, - "license": "ISC", "dependencies": { "xmlchars": "^2.2.0" }, @@ -27016,14 +28562,16 @@ }, "node_modules/scheduler": { "version": "0.23.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dependencies": { "loose-envify": "^1.1.0" } }, "node_modules/section-matter": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", "dependencies": { "extend-shallow": "^2.0.1", "kind-of": "^6.0.0" @@ -27034,8 +28582,9 @@ }, "node_modules/semantic-release": { "version": "23.0.2", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-23.0.2.tgz", + "integrity": "sha512-OnVYJ6Xgzwe1x8MKswba7RU9+5djS1MWRTrTn5qsq3xZYpslroZkV9Pt0dA2YcIuieeuSZWJhn+yUWoBUHO5Fw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@semantic-release/commit-analyzer": "^11.0.0", @@ -27077,8 +28626,9 @@ }, "node_modules/semantic-release/node_modules/@semantic-release/error": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -27086,8 +28636,9 @@ }, "node_modules/semantic-release/node_modules/aggregate-error": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "clean-stack": "^5.2.0", @@ -27102,8 +28653,9 @@ }, "node_modules/semantic-release/node_modules/clean-stack": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz", + "integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "escape-string-regexp": "5.0.0" @@ -27117,8 +28669,9 @@ }, "node_modules/semantic-release/node_modules/execa": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "cross-spawn": "^7.0.3", @@ -27140,8 +28693,9 @@ }, "node_modules/semantic-release/node_modules/execa/node_modules/get-stream": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=16" @@ -27152,8 +28706,9 @@ }, "node_modules/semantic-release/node_modules/get-stream": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=10" @@ -27164,8 +28719,9 @@ }, "node_modules/semantic-release/node_modules/human-signals": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, - "license": "Apache-2.0", "peer": true, "engines": { "node": ">=16.17.0" @@ -27173,8 +28729,9 @@ }, "node_modules/semantic-release/node_modules/indent-string": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -27185,8 +28742,9 @@ }, "node_modules/semantic-release/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -27197,8 +28755,9 @@ }, "node_modules/semantic-release/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -27209,8 +28768,9 @@ }, "node_modules/semantic-release/node_modules/npm-run-path": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "path-key": "^4.0.0" @@ -27224,8 +28784,9 @@ }, "node_modules/semantic-release/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "mimic-fn": "^4.0.0" @@ -27239,8 +28800,9 @@ }, "node_modules/semantic-release/node_modules/p-reduce": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -27251,8 +28813,9 @@ }, "node_modules/semantic-release/node_modules/parse-json": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.22.13", @@ -27268,8 +28831,9 @@ }, "node_modules/semantic-release/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -27280,8 +28844,9 @@ }, "node_modules/semantic-release/node_modules/read-pkg": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "@types/normalize-package-data": "^2.4.3", @@ -27299,8 +28864,10 @@ }, "node_modules/semantic-release/node_modules/read-pkg-up": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-11.0.0.tgz", + "integrity": "sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==", + "deprecated": "Renamed to read-package-up", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "find-up-simple": "^1.0.0", @@ -27316,8 +28883,9 @@ }, "node_modules/semantic-release/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "peer": true, "engines": { "node": ">=14" @@ -27328,8 +28896,9 @@ }, "node_modules/semantic-release/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -27340,8 +28909,9 @@ }, "node_modules/semantic-release/node_modules/type-fest": { "version": "4.10.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.10.3.tgz", + "integrity": "sha512-JLXyjizi072smKGGcZiAJDCNweT8J+AuRxmPZ1aG7TERg4ijx9REl8CNhbr36RV4qXqL1gO1FF9HL8OkVmmrsA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "peer": true, "engines": { "node": ">=16" @@ -27352,7 +28922,8 @@ }, "node_modules/semver": { "version": "7.6.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -27365,8 +28936,9 @@ }, "node_modules/semver-diff": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "semver": "^7.3.5" @@ -27380,8 +28952,9 @@ }, "node_modules/semver-regex": { "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=12" @@ -27392,7 +28965,8 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { "yallist": "^4.0.0" }, @@ -27402,16 +28976,19 @@ }, "node_modules/semver/node_modules/yallist": { "version": "4.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/server-destroy": { "version": "1.0.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==" }, "node_modules/set-function-length": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.1.2", "es-errors": "^1.3.0", @@ -27426,8 +29003,9 @@ }, "node_modules/set-function-name": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, - "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -27440,8 +29018,9 @@ }, "node_modules/sharp": { "version": "0.33.2", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", + "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==", "hasInstallScript": true, - "license": "Apache-2.0", "optional": true, "dependencies": { "color": "^4.2.3", @@ -27479,7 +29058,8 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -27489,15 +29069,17 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "engines": { "node": ">=8" } }, "node_modules/shelljs": { "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -27512,15 +29094,17 @@ }, "node_modules/shikiji": { "version": "0.6.13", - "license": "MIT", + "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.6.13.tgz", + "integrity": "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA==", "dependencies": { "hast-util-to-html": "^9.0.0" } }, "node_modules/shx": { "version": "0.3.4", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.4.tgz", + "integrity": "sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.3", "shelljs": "^0.8.5" @@ -27534,8 +29118,9 @@ }, "node_modules/side-channel": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", + "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -27551,17 +29136,20 @@ }, "node_modules/siginfo": { "version": "2.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true }, "node_modules/signal-exit": { "version": "3.0.7", - "license": "ISC" + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/signale": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", + "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "chalk": "^2.3.2", @@ -27574,8 +29162,9 @@ }, "node_modules/signale/node_modules/ansi-styles": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "color-convert": "^1.9.0" @@ -27586,8 +29175,9 @@ }, "node_modules/signale/node_modules/chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "ansi-styles": "^3.2.1", @@ -27600,8 +29190,9 @@ }, "node_modules/signale/node_modules/color-convert": { "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "color-name": "1.1.3" @@ -27609,14 +29200,16 @@ }, "node_modules/signale/node_modules/color-name": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/signale/node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=0.8.0" @@ -27624,8 +29217,9 @@ }, "node_modules/signale/node_modules/figures": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5" @@ -27636,8 +29230,9 @@ }, "node_modules/signale/node_modules/has-flag": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -27645,8 +29240,9 @@ }, "node_modules/signale/node_modules/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, - "license": "MIT", "peer": true, "dependencies": { "has-flag": "^3.0.0" @@ -27657,7 +29253,8 @@ }, "node_modules/simple-swizzle": { "version": "0.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", "optional": true, "dependencies": { "is-arrayish": "^0.3.1" @@ -27665,17 +29262,20 @@ }, "node_modules/simple-swizzle/node_modules/is-arrayish": { "version": "0.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", "optional": true }, "node_modules/sisteransi": { "version": "1.0.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, "node_modules/skin-tone": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "unicode-emoji-modifier-base": "^1.0.0" @@ -27686,8 +29286,9 @@ }, "node_modules/slash": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -27697,22 +29298,25 @@ }, "node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-js": { "version": "1.0.2", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "engines": { "node": ">=0.10.0" } }, "node_modules/space-separated-tokens": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -27720,14 +29324,16 @@ }, "node_modules/spawn-error-forwarder": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", + "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", "dev": true, - "license": "MIT", "peer": true }, "node_modules/spdx-correct": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, - "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -27735,13 +29341,15 @@ }, "node_modules/spdx-exceptions": { "version": "2.5.0", - "dev": true, - "license": "CC-BY-3.0" + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true }, "node_modules/spdx-expression-parse": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, - "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -27749,38 +29357,45 @@ }, "node_modules/spdx-license-ids": { "version": "3.0.17", - "dev": true, - "license": "CC0-1.0" + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true }, "node_modules/split2": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, - "license": "ISC", "engines": { "node": ">= 10.x" } }, "node_modules/sprintf-js": { "version": "1.0.3", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/stackback": { "version": "0.0.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true }, "node_modules/state-local": { "version": "1.0.7", - "license": "MIT" + "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", + "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==" }, "node_modules/std-env": { "version": "3.7.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true }, "node_modules/stdin-discarder": { "version": "0.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", "dependencies": { "bl": "^5.0.0" }, @@ -27793,8 +29408,9 @@ }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", "dev": true, - "license": "MIT", "dependencies": { "internal-slot": "^1.0.4" }, @@ -27804,8 +29420,9 @@ }, "node_modules/stream-combiner2": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "duplexer2": "~0.1.0", @@ -27814,32 +29431,37 @@ }, "node_modules/stream-parser": { "version": "0.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", "dependencies": { "debug": "2" } }, "node_modules/stream-parser/node_modules/debug": { "version": "2.6.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dependencies": { "ms": "2.0.0" } }, "node_modules/stream-parser/node_modules/ms": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/string_decoder": { "version": "1.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { "safe-buffer": "~5.1.0" } }, "node_modules/string-width": { "version": "7.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", @@ -27854,7 +29476,8 @@ }, "node_modules/stringify-entities": { "version": "4.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" @@ -27866,7 +29489,8 @@ }, "node_modules/strip-ansi": { "version": "7.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -27879,7 +29503,8 @@ }, "node_modules/strip-ansi/node_modules/ansi-regex": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "engines": { "node": ">=12" }, @@ -27889,30 +29514,34 @@ }, "node_modules/strip-bom": { "version": "3.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "engines": { "node": ">=4" } }, "node_modules/strip-bom-string": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", "engines": { "node": ">=0.10.0" } }, "node_modules/strip-final-newline": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/strip-json-comments": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -27937,8 +29566,9 @@ }, "node_modules/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, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -27948,8 +29578,9 @@ }, "node_modules/supports-hyperlinks": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "has-flag": "^4.0.0", @@ -27961,7 +29592,8 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "engines": { "node": ">= 0.4" }, @@ -27971,21 +29603,24 @@ }, "node_modules/symbol-tree": { "version": "3.2.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true }, "node_modules/temp-dir": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.16" } }, "node_modules/tempy": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", "dev": true, - "license": "MIT", "dependencies": { "is-stream": "^3.0.0", "temp-dir": "^3.0.0", @@ -28001,8 +29636,9 @@ }, "node_modules/tempy/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -28012,8 +29648,9 @@ }, "node_modules/text-extensions": { "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -28023,8 +29660,9 @@ }, "node_modules/thenify": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "any-promise": "^1.0.0" @@ -28032,8 +29670,9 @@ }, "node_modules/thenify-all": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "thenify": ">= 3.1.0 < 4" @@ -28044,13 +29683,15 @@ }, "node_modules/through": { "version": "2.3.8", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true }, "node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "readable-stream": "~2.3.6", @@ -28059,13 +29700,15 @@ }, "node_modules/tinybench": { "version": "2.6.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true }, "node_modules/tinypool": { "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -28081,14 +29724,16 @@ }, "node_modules/to-fast-properties": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "engines": { "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dependencies": { "is-number": "^7.0.0" }, @@ -28098,8 +29743,9 @@ }, "node_modules/tough-cookie": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -28112,16 +29758,18 @@ }, "node_modules/tough-cookie/node_modules/universalify": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4.0.0" } }, "node_modules/tr46": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dev": true, - "license": "MIT", "dependencies": { "punycode": "^2.3.1" }, @@ -28131,8 +29779,9 @@ }, "node_modules/traverse": { "version": "0.6.8", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", + "integrity": "sha512-aXJDbk6SnumuaZSANd21XAo15ucCDE38H4fkqiGsc3MhCK+wOlZvLP9cB/TvpHT0mOyWgC4Z8EwRlzqYSUzdsA==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">= 0.4" @@ -28143,7 +29792,8 @@ }, "node_modules/trim-lines": { "version": "3.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -28151,7 +29801,8 @@ }, "node_modules/trough": { "version": "2.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -28159,7 +29810,8 @@ }, "node_modules/tsconfck": { "version": "3.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", + "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", "bin": { "tsconfck": "bin/tsconfck.js" }, @@ -28175,6 +29827,12 @@ } } }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "optional": true + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -28186,7 +29844,8 @@ }, "node_modules/type-fest": { "version": "2.19.0", - "license": "(MIT OR CC0-1.0)", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "engines": { "node": ">=12.20" }, @@ -28196,11 +29855,13 @@ }, "node_modules/typesafe-path": { "version": "0.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", + "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" }, "node_modules/typescript": { "version": "5.3.3", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -28211,20 +29872,23 @@ }, "node_modules/typescript-auto-import-cache": { "version": "0.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.2.tgz", + "integrity": "sha512-+laqe5SFL1vN62FPOOJSUDTZxtgsoOXjneYOXIpx5rQ4UMiN89NAtJLpqLqyebv9fgQ/IMeeTX+mQyRnwvJzvg==", "dependencies": { "semver": "^7.3.8" } }, "node_modules/ufo": { "version": "1.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", + "dev": true }, "node_modules/uglify-js": { "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, - "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -28235,16 +29899,19 @@ }, "node_modules/ultrahtml": { "version": "1.5.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.3.tgz", + "integrity": "sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==" }, "node_modules/undici-types": { "version": "5.26.5", - "devOptional": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "devOptional": true }, "node_modules/unherit": { "version": "3.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", + "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -28252,8 +29919,9 @@ }, "node_modules/unicode-emoji-modifier-base": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -28261,8 +29929,9 @@ }, "node_modules/unicorn-magic": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=18" @@ -28273,7 +29942,8 @@ }, "node_modules/unified": { "version": "11.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", @@ -28290,8 +29960,9 @@ }, "node_modules/unique-string": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", "dev": true, - "license": "MIT", "dependencies": { "crypto-random-string": "^4.0.0" }, @@ -28304,7 +29975,8 @@ }, "node_modules/unist-util-is": { "version": "6.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", "dependencies": { "@types/unist": "^3.0.0" }, @@ -28315,7 +29987,8 @@ }, "node_modules/unist-util-modify-children": { "version": "3.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", + "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", "dependencies": { "@types/unist": "^2.0.0", "array-iterate": "^2.0.0" @@ -28327,11 +30000,13 @@ }, "node_modules/unist-util-modify-children/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/unist-util-position": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dependencies": { "@types/unist": "^3.0.0" }, @@ -28342,7 +30017,8 @@ }, "node_modules/unist-util-stringify-position": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dependencies": { "@types/unist": "^3.0.0" }, @@ -28353,7 +30029,8 @@ }, "node_modules/unist-util-visit": { "version": "5.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", @@ -28366,7 +30043,8 @@ }, "node_modules/unist-util-visit-children": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", + "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", "dependencies": { "@types/unist": "^2.0.0" }, @@ -28377,11 +30055,13 @@ }, "node_modules/unist-util-visit-children/node_modules/@types/unist": { "version": "2.0.10", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/unist-util-visit-parents": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" @@ -28393,19 +30073,23 @@ }, "node_modules/universal-user-agent": { "version": "6.0.1", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true }, "node_modules/universalify": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 10.0.0" } }, "node_modules/update-browserslist-db": { "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "funding": [ { "type": "opencollective", @@ -28420,7 +30104,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" @@ -28434,16 +30117,18 @@ }, "node_modules/url-join": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/url-parse": { "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "dev": true, - "license": "MIT", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -28451,12 +30136,14 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/validate-npm-package-license": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, - "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -28464,7 +30151,8 @@ }, "node_modules/vfile": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0", @@ -28477,7 +30165,8 @@ }, "node_modules/vfile-location": { "version": "5.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", "dependencies": { "@types/unist": "^3.0.0", "vfile": "^6.0.0" @@ -28489,7 +30178,8 @@ }, "node_modules/vfile-message": { "version": "4.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" @@ -28501,7 +30191,8 @@ }, "node_modules/vite": { "version": "5.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", "dependencies": { "esbuild": "^0.19.3", "postcss": "^8.4.35", @@ -28576,7 +30267,8 @@ }, "node_modules/vitefu": { "version": "0.2.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", + "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, @@ -28653,8 +30345,9 @@ }, "node_modules/vitest/node_modules/execa": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -28675,8 +30368,9 @@ }, "node_modules/vitest/node_modules/get-stream": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, - "license": "MIT", "engines": { "node": ">=16" }, @@ -28686,16 +30380,18 @@ }, "node_modules/vitest/node_modules/human-signals": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=16.17.0" } }, "node_modules/vitest/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -28705,8 +30401,9 @@ }, "node_modules/vitest/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -28716,8 +30413,9 @@ }, "node_modules/vitest/node_modules/npm-run-path": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -28730,8 +30428,9 @@ }, "node_modules/vitest/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -28744,8 +30443,9 @@ }, "node_modules/vitest/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -28755,8 +30455,9 @@ }, "node_modules/vitest/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "engines": { "node": ">=14" }, @@ -28766,8 +30467,9 @@ }, "node_modules/vitest/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -28777,7 +30479,8 @@ }, "node_modules/volar-service-css": { "version": "0.0.30", - "license": "MIT", + "resolved": "https://registry.npmjs.org/volar-service-css/-/volar-service-css-0.0.30.tgz", + "integrity": "sha512-jui+1N0HBfjW43tRfhyZp0axhBee4997BRyX4os8xQm/7cjD2KjAuyz92nMIPRt1QDoG4/7uQT28xNhy0TPJTA==", "dependencies": { "vscode-css-languageservice": "^6.2.10", "vscode-uri": "^3.0.8" @@ -28793,7 +30496,8 @@ }, "node_modules/volar-service-emmet": { "version": "0.0.30", - "license": "MIT", + "resolved": "https://registry.npmjs.org/volar-service-emmet/-/volar-service-emmet-0.0.30.tgz", + "integrity": "sha512-HEeIrmqQ/DTfuQDI9ER5+YReXXjE9f7W6MlBmn5biUuPyizVTGfuILN8pJhmYvmPHCA7qHhU7CJqwE9DAh9AJg==", "dependencies": { "@vscode/emmet-helper": "^2.9.2", "volar-service-html": "0.0.30" @@ -28809,7 +30513,8 @@ }, "node_modules/volar-service-html": { "version": "0.0.30", - "license": "MIT", + "resolved": "https://registry.npmjs.org/volar-service-html/-/volar-service-html-0.0.30.tgz", + "integrity": "sha512-wW3TEeRTeHv/3mC8Ik6T62SwewMWFungb8ydyEK/2GDHEntBEG/J9wtuh01/J0kYqPerhlT9zhdGB6PGYHAGuA==", "dependencies": { "vscode-html-languageservice": "^5.1.0", "vscode-uri": "^3.0.8" @@ -28825,7 +30530,8 @@ }, "node_modules/volar-service-prettier": { "version": "0.0.30", - "license": "MIT", + "resolved": "https://registry.npmjs.org/volar-service-prettier/-/volar-service-prettier-0.0.30.tgz", + "integrity": "sha512-Qdc5Zc0y4hJmJbpIQ52cSDjs0uvVug/e2nuL/XZWPJM6Cr5/3RjjoRVKtDQbKItFYlGk+JH+LSXvwQeD5TXZqg==", "dependencies": { "vscode-uri": "^3.0.8" }, @@ -28844,7 +30550,8 @@ }, "node_modules/volar-service-typescript": { "version": "0.0.30", - "license": "MIT", + "resolved": "https://registry.npmjs.org/volar-service-typescript/-/volar-service-typescript-0.0.30.tgz", + "integrity": "sha512-jA8c0Mhy9rgAsrgtwocK95Smws1M2E0MxlQ/SVo/rmOGH32cX9UGgI0IENWKa3yagp/khfoemOIQDz/KNhI3zg==", "dependencies": { "path-browserify": "^1.0.1", "semver": "^7.5.4", @@ -28865,7 +30572,8 @@ }, "node_modules/volar-service-typescript-twoslash-queries": { "version": "0.0.30", - "license": "MIT", + "resolved": "https://registry.npmjs.org/volar-service-typescript-twoslash-queries/-/volar-service-typescript-twoslash-queries-0.0.30.tgz", + "integrity": "sha512-ahj6woBxhkZu7icQR58x5TnUaS8ZRKn7a+UvY+andmiTWsOaSu85zj36+LPZgZQi1MG+BtjNwUjKoxtZiN51PA==", "peerDependencies": { "@volar/language-service": "~2.0.1" }, @@ -28877,7 +30585,8 @@ }, "node_modules/vscode-css-languageservice": { "version": "6.2.12", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.2.12.tgz", + "integrity": "sha512-PS9r7HgNjqzRl3v91sXpCyZPc8UDotNo6gntFNtGCKPhGA9Frk7g/VjX1Mbv3F00pn56D+rxrFzR9ep4cawOgA==", "dependencies": { "@vscode/l10n": "^0.0.18", "vscode-languageserver-textdocument": "^1.0.11", @@ -28887,11 +30596,13 @@ }, "node_modules/vscode-css-languageservice/node_modules/@vscode/l10n": { "version": "0.0.18", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" }, "node_modules/vscode-html-languageservice": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.1.2.tgz", + "integrity": "sha512-wkWfEx/IIR3s2P5yD4aTGHiOb8IAzFxgkSt1uSC3itJ4oDAm23yG7o0L29JljUdnXDDgLafPAvhv8A2I/8riHw==", "dependencies": { "@vscode/l10n": "^0.0.18", "vscode-languageserver-textdocument": "^1.0.11", @@ -28901,18 +30612,21 @@ }, "node_modules/vscode-html-languageservice/node_modules/@vscode/l10n": { "version": "0.0.18", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { "version": "9.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, @@ -28922,7 +30636,8 @@ }, "node_modules/vscode-languageserver-protocol": { "version": "3.17.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" @@ -28930,24 +30645,29 @@ }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.11", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, "node_modules/vscode-nls": { "version": "5.2.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==" }, "node_modules/vscode-uri": { "version": "3.0.8", - "license": "MIT" + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, - "license": "MIT", "dependencies": { "xml-name-validator": "^5.0.0" }, @@ -28957,7 +30677,8 @@ }, "node_modules/web-namespaces": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -28965,16 +30686,18 @@ }, "node_modules/webidl-conversions": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=12" } }, "node_modules/whatwg-encoding": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, - "license": "MIT", "dependencies": { "iconv-lite": "0.6.3" }, @@ -28984,8 +30707,9 @@ }, "node_modules/whatwg-encoding/node_modules/iconv-lite": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, - "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -28995,16 +30719,18 @@ }, "node_modules/whatwg-mimetype": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/whatwg-url": { "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", "dev": true, - "license": "MIT", "dependencies": { "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" @@ -29015,7 +30741,8 @@ }, "node_modules/which": { "version": "2.0.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dependencies": { "isexe": "^2.0.0" }, @@ -29028,8 +30755,9 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, - "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -29043,8 +30771,9 @@ }, "node_modules/which-collection": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "dev": true, - "license": "MIT", "dependencies": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -29057,7 +30786,8 @@ }, "node_modules/which-pm": { "version": "2.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", + "integrity": "sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ==", "dependencies": { "load-yaml-file": "^0.2.0", "path-exists": "^4.0.0" @@ -29068,15 +30798,17 @@ }, "node_modules/which-pm-runs": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", "engines": { "node": ">=4" } }, "node_modules/which-typed-array": { "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dev": true, - "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.6", "call-bind": "^1.0.5", @@ -29093,8 +30825,9 @@ }, "node_modules/why-is-node-running": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", "dev": true, - "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -29108,7 +30841,8 @@ }, "node_modules/widest-line": { "version": "4.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", "dependencies": { "string-width": "^5.0.1" }, @@ -29121,11 +30855,13 @@ }, "node_modules/widest-line/node_modules/emoji-regex": { "version": "9.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/widest-line/node_modules/string-width": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -29140,12 +30876,14 @@ }, "node_modules/wordwrap": { "version": "1.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true }, "node_modules/wrap-ansi": { "version": "8.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -29160,7 +30898,8 @@ }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "6.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "engines": { "node": ">=12" }, @@ -29170,11 +30909,13 @@ }, "node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -29189,13 +30930,15 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/ws": { "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -29214,21 +30957,24 @@ }, "node_modules/xml-name-validator": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=18" } }, "node_modules/xmlchars": { "version": "2.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true }, "node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=0.4" @@ -29236,18 +30982,21 @@ }, "node_modules/y18n": { "version": "5.0.8", - "license": "ISC", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "3.1.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yargs": { "version": "17.7.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -29263,18 +31012,21 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "engines": { "node": ">=12" } }, "node_modules/yargs/node_modules/emoji-regex": { "version": "8.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/yargs/node_modules/string-width": { "version": "4.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -29286,7 +31038,8 @@ }, "node_modules/yargs/node_modules/strip-ansi": { "version": "6.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -29296,7 +31049,8 @@ }, "node_modules/yocto-queue": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "engines": { "node": ">=12.20" }, @@ -29306,14 +31060,16 @@ }, "node_modules/zod": { "version": "3.22.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zwitch": { "version": "2.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" diff --git a/public/lib/addons/p5.sound.js b/public/lib/addons/p5.sound.js index b293d62..a8a7e3f 100644 --- a/public/lib/addons/p5.sound.js +++ b/public/lib/addons/p5.sound.js @@ -1,5 +1,5 @@ -/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ -/** +/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ + /** *

                          p5.sound extends p5 with Web Audio functionality including audio input, * playback, analysis and synthesis. @@ -50,7 +50,7 @@ */ /** - * p5.sound + * p5.sound * https://p5js.org/reference/#/libraries/p5.sound * * From the Processing Foundation and contributors @@ -70,17267 +70,12199 @@ * Web Audio API: http://w3.org/TR/webaudio/ */ -(function (modules) { - var installedModules = {}; - function __webpack_require__(moduleId) { - if (installedModules[moduleId]) { - return installedModules[moduleId].exports; - } - var module = (installedModules[moduleId] = { - i: moduleId, - l: false, - exports: {}, - }); - modules[moduleId].call( - module.exports, - module, - module.exports, - __webpack_require__, - ); - module.l = true; - return module.exports; - } - __webpack_require__.m = modules; - __webpack_require__.c = installedModules; - __webpack_require__.d = function (exports, name, getter) { - if (!__webpack_require__.o(exports, name)) { - Object.defineProperty(exports, name, { enumerable: true, get: getter }); - } - }; - __webpack_require__.r = function (exports) { - if (typeof Symbol !== "undefined" && Symbol.toStringTag) { - Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); - } - Object.defineProperty(exports, "__esModule", { value: true }); - }; - __webpack_require__.t = function (value, mode) { - if (mode & 1) value = __webpack_require__(value); - if (mode & 8) return value; - if (mode & 4 && typeof value === "object" && value && value.__esModule) - return value; - var ns = Object.create(null); - __webpack_require__.r(ns); - Object.defineProperty(ns, "default", { enumerable: true, value: value }); - if (mode & 2 && typeof value != "string") - for (var key in value) - __webpack_require__.d( - ns, - key, - function (key) { - return value[key]; - }.bind(null, key), - ); - return ns; - }; - __webpack_require__.n = function (module) { - var getter = - module && module.__esModule - ? function getDefault() { - return module["default"]; - } - : function getModuleExports() { - return module; - }; - __webpack_require__.d(getter, "a", getter); - return getter; - }; - __webpack_require__.o = function (object, property) { - return Object.prototype.hasOwnProperty.call(object, property); - }; - __webpack_require__.p = ""; - return __webpack_require__((__webpack_require__.s = 40)); -})([ - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_RESULT__ = function () { - "use strict"; - function a(t, e) { - this.isUndef(t) || 1 === t - ? (this.input = this.context.createGain()) - : 1 < t && (this.input = new Array(t)), - this.isUndef(e) || 1 === e - ? (this.output = this.context.createGain()) - : 1 < e && (this.output = new Array(t)); - } - var e; - return ( - (a.prototype.set = function (t, e, n) { - if (this.isObject(t)) n = e; - else if (this.isString(t)) { - var o = {}; - (o[t] = e), (t = o); - } - t: for (var i in t) { - e = t[i]; - var r = this; - if (-1 !== i.indexOf(".")) { - for (var s = i.split("."), u = 0; u < s.length - 1; u++) - if ((r = r[s[u]]) instanceof a) { - s.splice(0, u + 1); - var p = s.join("."); - r.set(p, e); - continue t; - } - i = s[s.length - 1]; - } - var c = r[i]; - this.isUndef(c) || - ((a.Signal && c instanceof a.Signal) || - (a.Param && c instanceof a.Param) - ? c.value !== e && - (this.isUndef(n) ? (c.value = e) : c.rampTo(e, n)) - : c instanceof AudioParam - ? c.value !== e && (c.value = e) - : c instanceof a - ? c.set(e) - : c !== e && (r[i] = e)); - } - return this; - }), - (a.prototype.get = function (t) { - this.isUndef(t) - ? (t = this._collectDefaults(this.constructor)) - : this.isString(t) && (t = [t]); - for (var e = {}, n = 0; n < t.length; n++) { - var o = t[n], - i = this, - r = e; - if (-1 !== o.indexOf(".")) { - for (var s = o.split("."), u = 0; u < s.length - 1; u++) { - var p = s[u]; - (r[p] = r[p] || {}), (r = r[p]), (i = i[p]); - } - o = s[s.length - 1]; - } - var c = i[o]; - this.isObject(t[o]) - ? (r[o] = c.get()) - : a.Signal && c instanceof a.Signal - ? (r[o] = c.value) - : a.Param && c instanceof a.Param - ? (r[o] = c.value) - : c instanceof AudioParam - ? (r[o] = c.value) - : c instanceof a - ? (r[o] = c.get()) - : this.isFunction(c) || this.isUndef(c) || (r[o] = c); - } - return e; - }), - (a.prototype._collectDefaults = function (t) { - var e = []; - if ( - (this.isUndef(t.defaults) || (e = Object.keys(t.defaults)), - !this.isUndef(t._super)) - ) - for ( - var n = this._collectDefaults(t._super), o = 0; - o < n.length; - o++ - ) - -1 === e.indexOf(n[o]) && e.push(n[o]); - return e; - }), - (a.prototype.toString = function () { - for (var t in a) { - var e = t[0].match(/^[A-Z]$/), - n = a[t] === this.constructor; - if (this.isFunction(a[t]) && e && n) return t; - } - return "Tone"; - }), - Object.defineProperty(a.prototype, "numberOfInputs", { - get: function () { - return this.input - ? this.isArray(this.input) - ? this.input.length - : 1 - : 0; - }, - }), - Object.defineProperty(a.prototype, "numberOfOutputs", { - get: function () { - return this.output - ? this.isArray(this.output) - ? this.output.length - : 1 - : 0; - }, - }), - (a.prototype.dispose = function () { - return ( - this.isUndef(this.input) || - (this.input instanceof AudioNode && this.input.disconnect(), - (this.input = null)), - this.isUndef(this.output) || - (this.output instanceof AudioNode && this.output.disconnect(), - (this.output = null)), - this - ); - }), - (a.prototype.connect = function (t, e, n) { - return ( - Array.isArray(this.output) - ? ((e = this.defaultArg(e, 0)), this.output[e].connect(t, 0, n)) - : this.output.connect(t, e, n), - this - ); - }), - (a.prototype.disconnect = function (t, e, n) { - this.isArray(this.output) - ? this.isNumber(t) - ? this.output[t].disconnect() - : ((e = this.defaultArg(e, 0)), - this.output[e].disconnect(t, 0, n)) - : this.output.disconnect.apply(this.output, arguments); - }), - (a.prototype.connectSeries = function () { - if (1 < arguments.length) - for (var t = arguments[0], e = 1; e < arguments.length; e++) { - var n = arguments[e]; - t.connect(n), (t = n); - } - return this; - }), - (a.prototype.chain = function () { - if (0 < arguments.length) - for (var t = this, e = 0; e < arguments.length; e++) { - var n = arguments[e]; - t.connect(n), (t = n); - } - return this; - }), - (a.prototype.fan = function () { - if (0 < arguments.length) - for (var t = 0; t < arguments.length; t++) - this.connect(arguments[t]); - return this; - }), - (AudioNode.prototype.chain = a.prototype.chain), - (AudioNode.prototype.fan = a.prototype.fan), - (a.prototype.defaultArg = function (t, e) { - if (this.isObject(t) && this.isObject(e)) { - var n = {}; - for (var o in t) n[o] = this.defaultArg(e[o], t[o]); - for (var i in e) n[i] = this.defaultArg(t[i], e[i]); - return n; - } - return this.isUndef(t) ? e : t; - }), - (a.prototype.optionsObject = function (t, e, n) { - var o = {}; - if (1 === t.length && this.isObject(t[0])) o = t[0]; - else for (var i = 0; i < e.length; i++) o[e[i]] = t[i]; - return this.isUndef(n) ? o : this.defaultArg(o, n); - }), - (a.prototype.isUndef = function (t) { - return void 0 === t; - }), - (a.prototype.isFunction = function (t) { - return "function" == typeof t; - }), - (a.prototype.isNumber = function (t) { - return "number" == typeof t; - }), - (a.prototype.isObject = function (t) { - return ( - "[object Object]" === Object.prototype.toString.call(t) && - t.constructor === Object - ); - }), - (a.prototype.isBoolean = function (t) { - return "boolean" == typeof t; - }), - (a.prototype.isArray = function (t) { - return Array.isArray(t); - }), - (a.prototype.isString = function (t) { - return "string" == typeof t; - }), - (a.noOp = function () {}), - (a.prototype._readOnly = function (t) { - if (Array.isArray(t)) - for (var e = 0; e < t.length; e++) this._readOnly(t[e]); - else Object.defineProperty(this, t, { writable: !1, enumerable: !0 }); - }), - (a.prototype._writable = function (t) { - if (Array.isArray(t)) - for (var e = 0; e < t.length; e++) this._writable(t[e]); - else Object.defineProperty(this, t, { writable: !0 }); - }), - (a.State = { - Started: "started", - Stopped: "stopped", - Paused: "paused", - }), - (a.prototype.equalPowerScale = function (t) { - var e = 0.5 * Math.PI; - return Math.sin(t * e); - }), - (a.prototype.dbToGain = function (t) { - return Math.pow(2, t / 6); - }), - (a.prototype.gainToDb = function (t) { - return (Math.log(t) / Math.LN10) * 20; - }), - (a.prototype.intervalToFrequencyRatio = function (t) { - return Math.pow(2, t / 12); - }), - (a.prototype.now = function () { - return a.context.now(); - }), - (a.now = function () { - return a.context.now(); - }), - (a.extend = function (t, e) { - function n() {} - a.prototype.isUndef(e) && (e = a), - (n.prototype = e.prototype), - (t.prototype = new n()), - ((t.prototype.constructor = t)._super = e); - }), - Object.defineProperty(a, "context", { - get: function () { - return e; - }, - set: function (t) { - (e = a.Context && t instanceof a.Context ? t : new a.Context(t)), - a.Context && a.Context.emit("init", e); - }, - }), - Object.defineProperty(a.prototype, "context", { - get: function () { - return a.context; - }, - }), - (a.setContext = function (t) { - a.context = t; - }), - Object.defineProperty(a.prototype, "blockTime", { - get: function () { - return 128 / this.context.sampleRate; - }, - }), - Object.defineProperty(a.prototype, "sampleTime", { - get: function () { - return 1 / this.context.sampleRate; - }, - }), - Object.defineProperty(a, "supported", { - get: function () { - var t = - window.hasOwnProperty("AudioContext") || - window.hasOwnProperty("webkitAudioContext"), - e = window.hasOwnProperty("Promise"), - n = window.hasOwnProperty("Worker"); - return t && e && n; - }, - }), - (a.version = "r10"), - window.TONE_SILENCE_VERSION_LOGGING || - console.log( - "%c * Tone.js " + a.version + " * ", - "background: #000; color: #fff", - ), - a - ); - }.call(exports, __webpack_require__, exports, module)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(2), - __webpack_require__(10), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - (i.Multiply = function (t) { - this.createInsOuts(2, 0), - (this._mult = this.input[0] = this.output = new i.Gain()), - (this._param = this.input[1] = this.output.gain), - (this._param.value = this.defaultArg(t, 0)); - }), - i.extend(i.Multiply, i.Signal), - (i.Multiply.prototype.dispose = function () { - return ( - i.prototype.dispose.call(this), - this._mult.dispose(), - (this._mult = null), - (this._param = null), - this - ); - }), - i.Multiply - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(6), - __webpack_require__(9), - __webpack_require__(18), - __webpack_require__(10), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { - "use strict"; - return ( - (n.Signal = function () { - var t = this.optionsObject( - arguments, - ["value", "units"], - n.Signal.defaults, - ); - (this.output = this._gain = this.context.createGain()), - (t.param = this._gain.gain), - n.Param.call(this, t), - (this.input = this._param = this._gain.gain), - this.context.getConstant(1).chain(this._gain); - }), - n.extend(n.Signal, n.Param), - (n.Signal.defaults = { value: 0, units: n.Type.Default, convert: !0 }), - (n.Signal.prototype.connect = n.SignalBase.prototype.connect), - (n.Signal.prototype.dispose = function () { - return ( - n.Param.prototype.dispose.call(this), - (this._param = null), - this._gain.disconnect(), - (this._gain = null), - this - ); - }), - n.Signal - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, __webpack_exports__, __webpack_require__) { - "use strict"; - (function (global) { - __webpack_require__.d(__webpack_exports__, "b", function () { - return getAudioContext; - }); - __webpack_require__.d(__webpack_exports__, "c", function () { - return userStartAudio; - }); - var startaudiocontext__WEBPACK_IMPORTED_MODULE_0__ = - __webpack_require__(22); - var startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default = - __webpack_require__.n(startaudiocontext__WEBPACK_IMPORTED_MODULE_0__); - var Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); - var Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1___default = - __webpack_require__.n(Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1__); - var Tone_core_Context__WEBPACK_IMPORTED_MODULE_2__ = - __webpack_require__(12); - var Tone_core_Context__WEBPACK_IMPORTED_MODULE_2___default = - __webpack_require__.n(Tone_core_Context__WEBPACK_IMPORTED_MODULE_2__); - global.TONE_SILENCE_VERSION_LOGGING = true; - - var audiocontext = new window.AudioContext(); - - Tone_core_Tone__WEBPACK_IMPORTED_MODULE_1___default.a.setContext( - audiocontext, - ); - /** - *

                          Returns the Audio Context for this sketch. Useful for users - * who would like to dig deeper into the Web Audio API - * .

                          - * - *

                          Some browsers require users to startAudioContext - * with a user gesture, such as touchStarted in the example below.

                          - * - * @for p5 - * @method getAudioContext - * @return {Object} AudioContext for this sketch - * @example - *
                          - * function draw() { - * background(255); - * textAlign(CENTER); - * - * if (getAudioContext().state !== 'running') { - * text('click to start audio', width/2, height/2); - * } else { - * text('audio is enabled', width/2, height/2); - * } - * } - * - * function touchStarted() { - * if (getAudioContext().state !== 'running') { - * getAudioContext().resume(); - * } - * var synth = new p5.MonoSynth(); - * synth.play('A4', 0.5, 0, 0.2); - * } - * - *
                          - */ - - function getAudioContext() { - return audiocontext; - } - /** - *

                          It is not only a good practice to give users control over starting - * audio. This policy is enforced by many web browsers, including iOS and - * Google Chrome, which create the Web Audio API's - * Audio Context - * in a suspended state.

                          - * - *

                          In these browser-specific policies, sound will not play until a user - * interaction event (i.e. mousePressed()) explicitly resumes - * the AudioContext, or starts an audio node. This can be accomplished by - * calling start() on a p5.Oscillator, - * play() on a p5.SoundFile, or simply - * userStartAudio().

                          - * - *

                          userStartAudio() starts the AudioContext on a user - * gesture. The default behavior will enable audio on any - * mouseUp or touchEnd event. It can also be placed in a specific - * interaction function, such as mousePressed() as in the - * example below. This method utilizes - * StartAudioContext - * , a library by Yotam Mann (MIT Licence, 2016).

                          - * @param {Element|Array} [elements] This argument can be an Element, - * Selector String, NodeList, p5.Element, - * jQuery Element, or an Array of any of those. - * @param {Function} [callback] Callback to invoke when the AudioContext - * has started - * @return {Promise} Returns a Promise that resolves when - * the AudioContext state is 'running' - * @method userStartAudio - * @for p5 - * @example - *
                          - * function setup() { - * // mimics the autoplay policy - * getAudioContext().suspend(); - * - * let mySynth = new p5.MonoSynth(); - * - * // This won't play until the context has resumed - * mySynth.play('A6'); - * } - * function draw() { - * background(220); - * textAlign(CENTER, CENTER); - * text(getAudioContext().state, width/2, height/2); - * } - * function mousePressed() { - * userStartAudio(); - * } - *
                          - */ - - function userStartAudio(elements, callback) { - var elt = elements; - - if (elements instanceof p5.Element) { - elt = elements.elt; - } else if ( - elements instanceof Array && - elements[0] instanceof p5.Element - ) { - elt = elements.map(function (e) { - return e.elt; - }); - } - - return startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default()( - audiocontext, - elt, - callback, - ); - } - __webpack_exports__["a"] = audiocontext; - }).call(this, __webpack_require__(26)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(2), - __webpack_require__(10), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - (i.Add = function (t) { - this.createInsOuts(2, 0), - (this._sum = - this.input[0] = - this.input[1] = - this.output = - new i.Gain()), - (this._param = this.input[1] = new i.Signal(t)), - this._param.connect(this._sum); - }), - i.extend(i.Add, i.Signal), - (i.Add.prototype.dispose = function () { - return ( - i.prototype.dispose.call(this), - this._sum.dispose(), - (this._sum = null), - this._param.dispose(), - (this._param = null), - this - ); - }), - i.Add - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports) { - module.exports = { - recorderProcessor: "recorder-processor", - soundFileProcessor: "sound-file-processor", - amplitudeProcessor: "amplitude-processor", - }; - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(15), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { - "use strict"; - return ( - (e.WaveShaper = function (e, t) { - (this._shaper = - this.input = - this.output = - this.context.createWaveShaper()), - (this._curve = null), - Array.isArray(e) - ? (this.curve = e) - : isFinite(e) || this.isUndef(e) - ? (this._curve = new Float32Array(this.defaultArg(e, 1024))) - : this.isFunction(e) && - ((this._curve = new Float32Array(this.defaultArg(t, 1024))), - this.setMap(e)); - }), - e.extend(e.WaveShaper, e.SignalBase), - (e.WaveShaper.prototype.setMap = function (e) { - for (var t = 0, r = this._curve.length; t < r; t++) { - var s = (t / (r - 1)) * 2 - 1; - this._curve[t] = e(s, t); - } - return (this._shaper.curve = this._curve), this; - }), - Object.defineProperty(e.WaveShaper.prototype, "curve", { - get: function () { - return this._shaper.curve; - }, - set: function (e) { - (this._curve = new Float32Array(e)), - (this._shaper.curve = this._curve); - }, - }), - Object.defineProperty(e.WaveShaper.prototype, "oversample", { - get: function () { - return this._shaper.oversample; - }, - set: function (e) { - if (-1 === ["none", "2x", "4x"].indexOf(e)) - throw new RangeError( - "Tone.WaveShaper: oversampling must be either 'none', '2x', or '4x'", - ); - this._shaper.oversample = e; - }, - }), - (e.WaveShaper.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._shaper.disconnect(), - (this._shaper = null), - (this._curve = null), - this - ); - }), - e.WaveShaper - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(2), - __webpack_require__(19), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - "use strict"; - return ( - (o.TimelineSignal = function () { - var e = this.optionsObject( - arguments, - ["value", "units"], - o.Signal.defaults, - ); - (this._events = new o.Timeline(10)), - o.Signal.apply(this, e), - (e.param = this._param), - o.Param.call(this, e), - (this._initial = this._fromUnits(this._param.value)); - }), - o.extend(o.TimelineSignal, o.Param), - (o.TimelineSignal.Type = { - Linear: "linear", - Exponential: "exponential", - Target: "target", - Curve: "curve", - Set: "set", - }), - Object.defineProperty(o.TimelineSignal.prototype, "value", { - get: function () { - var e = this.now(), - t = this.getValueAtTime(e); - return this._toUnits(t); - }, - set: function (e) { - var t = this._fromUnits(e); - (this._initial = t), - this.cancelScheduledValues(), - (this._param.value = t); - }, - }), - (o.TimelineSignal.prototype.setValueAtTime = function (e, t) { - return ( - (e = this._fromUnits(e)), - (t = this.toSeconds(t)), - this._events.add({ - type: o.TimelineSignal.Type.Set, - value: e, - time: t, - }), - this._param.setValueAtTime(e, t), - this - ); - }), - (o.TimelineSignal.prototype.linearRampToValueAtTime = function (e, t) { - return ( - (e = this._fromUnits(e)), - (t = this.toSeconds(t)), - this._events.add({ - type: o.TimelineSignal.Type.Linear, - value: e, - time: t, - }), - this._param.linearRampToValueAtTime(e, t), - this - ); - }), - (o.TimelineSignal.prototype.exponentialRampToValueAtTime = function ( - e, - t, - ) { - t = this.toSeconds(t); - var i = this._searchBefore(t); - i && 0 === i.value && this.setValueAtTime(this._minOutput, i.time), - (e = this._fromUnits(e)); - var n = Math.max(e, this._minOutput); - return ( - this._events.add({ - type: o.TimelineSignal.Type.Exponential, - value: n, - time: t, - }), - e < this._minOutput - ? (this._param.exponentialRampToValueAtTime( - this._minOutput, - t - this.sampleTime, - ), - this.setValueAtTime(0, t)) - : this._param.exponentialRampToValueAtTime(e, t), - this - ); - }), - (o.TimelineSignal.prototype.setTargetAtTime = function (e, t, i) { - return ( - (e = this._fromUnits(e)), - (e = Math.max(this._minOutput, e)), - (i = Math.max(this._minOutput, i)), - (t = this.toSeconds(t)), - this._events.add({ - type: o.TimelineSignal.Type.Target, - value: e, - time: t, - constant: i, - }), - this._param.setTargetAtTime(e, t, i), - this - ); - }), - (o.TimelineSignal.prototype.setValueCurveAtTime = function ( - e, - t, - i, - n, - ) { - n = this.defaultArg(n, 1); - for (var a = new Array(e.length), l = 0; l < a.length; l++) - a[l] = this._fromUnits(e[l]) * n; - (t = this.toSeconds(t)), - (i = this.toSeconds(i)), - this._events.add({ - type: o.TimelineSignal.Type.Curve, - value: a, - time: t, - duration: i, - }), - this._param.setValueAtTime(a[0], t); - for (var s = 1; s < a.length; s++) { - var r = t + (s / (a.length - 1)) * i; - this._param.linearRampToValueAtTime(a[s], r); - } - return this; - }), - (o.TimelineSignal.prototype.cancelScheduledValues = function (e) { - return ( - (e = this.toSeconds(e)), - this._events.cancel(e), - this._param.cancelScheduledValues(e), - this - ); - }), - (o.TimelineSignal.prototype.setRampPoint = function (e) { - e = this.toSeconds(e); - var t = this._toUnits(this.getValueAtTime(e)), - i = this._searchBefore(e); - if (i && i.time === e) - this.cancelScheduledValues(e + this.sampleTime); - else if ( - i && - i.type === o.TimelineSignal.Type.Curve && - i.time + i.duration > e - ) - this.cancelScheduledValues(e), this.linearRampToValueAtTime(t, e); - else { - var n = this._searchAfter(e); - n && - (this.cancelScheduledValues(e), - n.type === o.TimelineSignal.Type.Linear - ? this.linearRampToValueAtTime(t, e) - : n.type === o.TimelineSignal.Type.Exponential && - this.exponentialRampToValueAtTime(t, e)), - this.setValueAtTime(t, e); - } - return this; - }), - (o.TimelineSignal.prototype.linearRampToValueBetween = function ( - e, - t, - i, - ) { - return this.setRampPoint(t), this.linearRampToValueAtTime(e, i), this; - }), - (o.TimelineSignal.prototype.exponentialRampToValueBetween = function ( - e, - t, - i, - ) { - return ( - this.setRampPoint(t), this.exponentialRampToValueAtTime(e, i), this - ); - }), - (o.TimelineSignal.prototype._searchBefore = function (e) { - return this._events.get(e); - }), - (o.TimelineSignal.prototype._searchAfter = function (e) { - return this._events.getAfter(e); - }), - (o.TimelineSignal.prototype.getValueAtTime = function (e) { - e = this.toSeconds(e); - var t = this._searchAfter(e), - i = this._searchBefore(e), - n = this._initial; - if (null === i) n = this._initial; - else if (i.type === o.TimelineSignal.Type.Target) { - var a, - l = this._events.getBefore(i.time); - (a = null === l ? this._initial : l.value), - (n = this._exponentialApproach( - i.time, - a, - i.value, - i.constant, - e, - )); - } else - n = - i.type === o.TimelineSignal.Type.Curve - ? this._curveInterpolate(i.time, i.value, i.duration, e) - : null === t - ? i.value - : t.type === o.TimelineSignal.Type.Linear - ? this._linearInterpolate( - i.time, - i.value, - t.time, - t.value, - e, - ) - : t.type === o.TimelineSignal.Type.Exponential - ? this._exponentialInterpolate( - i.time, - i.value, - t.time, - t.value, - e, - ) - : i.value; - return n; - }), - (o.TimelineSignal.prototype.connect = o.SignalBase.prototype.connect), - (o.TimelineSignal.prototype._exponentialApproach = function ( - e, - t, - i, - n, - a, - ) { - return i + (t - i) * Math.exp(-(a - e) / n); - }), - (o.TimelineSignal.prototype._linearInterpolate = function ( - e, - t, - i, - n, - a, - ) { - return t + ((a - e) / (i - e)) * (n - t); - }), - (o.TimelineSignal.prototype._exponentialInterpolate = function ( - e, - t, - i, - n, - a, - ) { - return ( - (t = Math.max(this._minOutput, t)) * - Math.pow(n / t, (a - e) / (i - e)) - ); - }), - (o.TimelineSignal.prototype._curveInterpolate = function (e, t, i, n) { - var a = t.length; - if (e + i <= n) return t[a - 1]; - if (n <= e) return t[0]; - var l = (n - e) / i, - s = Math.floor((a - 1) * l), - r = Math.ceil((a - 1) * l), - o = t[s], - p = t[r]; - return r === s ? o : this._linearInterpolate(s, o, r, p, l * (a - 1)); - }), - (o.TimelineSignal.prototype.dispose = function () { - o.Signal.prototype.dispose.call(this), - o.Param.prototype.dispose.call(this), - this._events.dispose(), - (this._events = null); - }), - o.TimelineSignal - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(4), - __webpack_require__(1), - __webpack_require__(2), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - (i.Scale = function (t, e) { - (this._outputMin = this.defaultArg(t, 0)), - (this._outputMax = this.defaultArg(e, 1)), - (this._scale = this.input = new i.Multiply(1)), - (this._add = this.output = new i.Add(0)), - this._scale.connect(this._add), - this._setRange(); - }), - i.extend(i.Scale, i.SignalBase), - Object.defineProperty(i.Scale.prototype, "min", { - get: function () { - return this._outputMin; - }, - set: function (t) { - (this._outputMin = t), this._setRange(); - }, - }), - Object.defineProperty(i.Scale.prototype, "max", { - get: function () { - return this._outputMax; - }, - set: function (t) { - (this._outputMax = t), this._setRange(); - }, - }), - (i.Scale.prototype._setRange = function () { - (this._add.value = this._outputMin), - (this._scale.value = this._outputMax - this._outputMin); - }), - (i.Scale.prototype.dispose = function () { - return ( - i.prototype.dispose.call(this), - this._add.dispose(), - (this._add = null), - this._scale.dispose(), - (this._scale = null), - this - ); - }), - i.Scale - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(16), - __webpack_require__(30), - __webpack_require__(31), - __webpack_require__(12), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = 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 - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(18), - __webpack_require__(9), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - window.GainNode && - !AudioContext.prototype.createGain && - (AudioContext.prototype.createGain = - AudioContext.prototype.createGainNode), - (i.Gain = function () { - var t = this.optionsObject( - arguments, - ["gain", "units"], - i.Gain.defaults, - ); - (this.input = - this.output = - this._gainNode = - this.context.createGain()), - (this.gain = new i.Param({ - param: this._gainNode.gain, - units: t.units, - value: t.gain, - convert: t.convert, - })), - this._readOnly("gain"); - }), - i.extend(i.Gain), - (i.Gain.defaults = { gain: 1, convert: !0 }), - (i.Gain.prototype.dispose = function () { - i.Param.prototype.dispose.call(this), - this._gainNode.disconnect(), - (this._gainNode = null), - this._writable("gain"), - this.gain.dispose(), - (this.gain = null); - }), - (i.prototype.createInsOuts = function (t, n) { - 1 === t - ? (this.input = new i.Gain()) - : 1 < t && (this.input = new Array(t)), - 1 === n - ? (this.output = new i.Gain()) - : 1 < n && (this.output = new Array(t)); - }), - i.Gain - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(7), - __webpack_require__(39), - __webpack_require__(14), - __webpack_require__(12), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - "use strict"; - return ( - (o.Clock = function () { - o.Emitter.call(this); - var t = this.optionsObject( - arguments, - ["callback", "frequency"], - o.Clock.defaults, - ); - (this.callback = t.callback), - (this._nextTick = 0), - (this._lastState = o.State.Stopped), - (this.frequency = new o.TimelineSignal( - t.frequency, - o.Type.Frequency, - )), - this._readOnly("frequency"), - (this.ticks = 0), - (this._state = new o.TimelineState(o.State.Stopped)), - (this._boundLoop = this._loop.bind(this)), - this.context.on("tick", this._boundLoop); - }), - o.extend(o.Clock, o.Emitter), - (o.Clock.defaults = { - callback: o.noOp, - frequency: 1, - lookAhead: "auto", - }), - Object.defineProperty(o.Clock.prototype, "state", { - get: function () { - return this._state.getValueAtTime(this.now()); - }, - }), - (o.Clock.prototype.start = function (t, e) { - return ( - (t = this.toSeconds(t)), - this._state.getValueAtTime(t) !== o.State.Started && - this._state.add({ state: o.State.Started, time: t, offset: e }), - this - ); - }), - (o.Clock.prototype.stop = function (t) { - return ( - (t = this.toSeconds(t)), - this._state.cancel(t), - this._state.setStateAtTime(o.State.Stopped, t), - this - ); - }), - (o.Clock.prototype.pause = function (t) { - return ( - (t = this.toSeconds(t)), - this._state.getValueAtTime(t) === o.State.Started && - this._state.setStateAtTime(o.State.Paused, t), - this - ); - }), - (o.Clock.prototype._loop = function () { - for ( - var t = - this.now() + - this.context.lookAhead + - this.context.updateInterval + - 2 * this.context.lag; - t > this._nextTick && this._state; - - ) { - var e = this._state.getValueAtTime(this._nextTick); - if (e !== this._lastState) { - this._lastState = e; - var i = this._state.get(this._nextTick); - e === o.State.Started - ? ((this._nextTick = i.time), - this.isUndef(i.offset) || (this.ticks = i.offset), - this.emit("start", i.time, this.ticks)) - : e === o.State.Stopped - ? ((this.ticks = 0), this.emit("stop", i.time)) - : e === o.State.Paused && this.emit("pause", i.time); - } - var s = this._nextTick; - this.frequency && - ((this._nextTick += - 1 / this.frequency.getValueAtTime(this._nextTick)), - e === o.State.Started && (this.callback(s), this.ticks++)); - } - }), - (o.Clock.prototype.getStateAtTime = function (t) { - return (t = this.toSeconds(t)), this._state.getValueAtTime(t); - }), - (o.Clock.prototype.dispose = function () { - o.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); - }), - o.Clock - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(14), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - function t(e, t, n) { - if (e.input) - Array.isArray(e.input) - ? (o.prototype.isUndef(n) && (n = 0), this.connect(e.input[n])) - : this.connect(e.input, t, n); - else - try { - e instanceof AudioNode ? i.call(this, e, t, n) : i.call(this, e, t); - } catch (t) { - throw new Error("error connecting to node: " + e + "\n" + t); - } - } - var i, r; - return ( - !window.hasOwnProperty("AudioContext") && - window.hasOwnProperty("webkitAudioContext") && - (window.AudioContext = window.webkitAudioContext), - (o.Context = function (t) { - for (var e in (o.Emitter.call(this), - (t = t || new window.AudioContext()), - (this._context = t), - this._context)) - this._defineProperty(this._context, e); - (this._latencyHint = "interactive"), - (this._lookAhead = 0.1), - (this._updateInterval = this._lookAhead / 3), - (this._computedUpdateInterval = 0), - (this._worker = this._createWorker()), - (this._constants = {}); - }), - o.extend(o.Context, o.Emitter), - o.Emitter.mixin(o.Context), - (o.Context.prototype._defineProperty = function (e, n) { - this.isUndef(this[n]) && - Object.defineProperty(this, n, { - get: function () { - return "function" == typeof e[n] ? e[n].bind(e) : e[n]; - }, - set: function (t) { - e[n] = t; - }, - }); - }), - (o.Context.prototype.now = function () { - return this._context.currentTime; - }), - (o.Context.prototype._createWorker = function () { - window.URL = window.URL || window.webkitURL; - var t = new Blob([ - "var timeoutTime = " + - (1e3 * this._updateInterval).toFixed(1) + - ";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();", - ]), - e = URL.createObjectURL(t), - n = new Worker(e); - return ( - n.addEventListener( - "message", - function () { - this.emit("tick"); - }.bind(this), - ), - n.addEventListener( - "message", - function () { - var t = this.now(); - if (this.isNumber(this._lastUpdate)) { - var e = t - this._lastUpdate; - this._computedUpdateInterval = Math.max( - e, - 0.97 * this._computedUpdateInterval, - ); - } - this._lastUpdate = t; - }.bind(this), - ), - n - ); - }), - (o.Context.prototype.getConstant = function (t) { - if (this._constants[t]) return this._constants[t]; - for ( - var e = this._context.createBuffer( - 1, - 128, - this._context.sampleRate, - ), - n = e.getChannelData(0), - o = 0; - o < n.length; - o++ - ) - n[o] = t; - var i = this._context.createBufferSource(); - return ( - (i.channelCount = 1), - (i.channelCountMode = "explicit"), - (i.buffer = e), - (i.loop = !0), - i.start(0), - (this._constants[t] = i) - ); - }), - Object.defineProperty(o.Context.prototype, "lag", { - get: function () { - var t = this._computedUpdateInterval - this._updateInterval; - return (t = Math.max(t, 0)); - }, - }), - Object.defineProperty(o.Context.prototype, "lookAhead", { - get: function () { - return this._lookAhead; - }, - set: function (t) { - this._lookAhead = t; - }, - }), - Object.defineProperty(o.Context.prototype, "updateInterval", { - get: function () { - return this._updateInterval; - }, - set: function (t) { - (this._updateInterval = Math.max(t, o.prototype.blockTime)), - this._worker.postMessage(Math.max(1e3 * t, 1)); - }, - }), - Object.defineProperty(o.Context.prototype, "latencyHint", { - get: function () { - return this._latencyHint; - }, - set: function (t) { - var e = t; - if (((this._latencyHint = t), this.isString(t))) - switch (t) { - case "interactive": - (e = 0.1), (this._context.latencyHint = t); - break; - case "playback": - (e = 0.8), (this._context.latencyHint = t); - break; - case "balanced": - (e = 0.25), (this._context.latencyHint = t); - break; - case "fastest": - e = 0.01; - } - (this.lookAhead = e), (this.updateInterval = e / 3); - }, - }), - o.supported - ? ((i = AudioNode.prototype.connect), - (r = AudioNode.prototype.disconnect), - AudioNode.prototype.connect !== t && - ((AudioNode.prototype.connect = t), - (AudioNode.prototype.disconnect = function (e, t, n) { - if (e && e.input && Array.isArray(e.input)) - o.prototype.isUndef(n) && (n = 0), - this.disconnect(e.input[n], t, n); - else if (e && e.input) this.disconnect(e.input, t, n); - else - try { - r.apply(this, arguments); - } catch (t) { - throw new Error( - "error disconnecting node: " + e + "\n" + t, - ); - } - })), - (o.context = new o.Context())) - : console.warn("This browser does not support Tone.js"), - o.Context - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(4), - __webpack_require__(20), - __webpack_require__(2), - __webpack_require__(10), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { - "use strict"; - return ( - (n.Subtract = function (t) { - this.createInsOuts(2, 0), - (this._sum = this.input[0] = this.output = new n.Gain()), - (this._neg = new n.Negate()), - (this._param = this.input[1] = new n.Signal(t)), - this._param.chain(this._neg, this._sum); - }), - n.extend(n.Subtract, n.Signal), - (n.Subtract.prototype.dispose = function () { - return ( - n.prototype.dispose.call(this), - this._neg.dispose(), - (this._neg = null), - this._sum.disconnect(), - (this._sum = null), - this._param.dispose(), - (this._param = null), - this - ); - }), - n.Subtract - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - "use strict"; - return ( - (o.Emitter = function () { - this._events = {}; - }), - o.extend(o.Emitter), - (o.Emitter.prototype.on = function (t, e) { - for (var i = t.split(/\W+/), r = 0; r < i.length; r++) { - var n = i[r]; - this._events.hasOwnProperty(n) || (this._events[n] = []), - this._events[n].push(e); - } - return this; - }), - (o.Emitter.prototype.off = function (t, e) { - for (var i = t.split(/\W+/), r = 0; r < i.length; r++) - if (((t = i[r]), this._events.hasOwnProperty(t))) - if (o.prototype.isUndef(e)) this._events[t] = []; - else - for (var n = this._events[t], s = 0; s < n.length; s++) - n[s] === e && n.splice(s, 1); - return this; - }), - (o.Emitter.prototype.emit = function (t) { - if (this._events) { - var e = Array.apply(null, arguments).slice(1); - if (this._events.hasOwnProperty(t)) - for (var i = this._events[t], r = 0, n = i.length; r < n; r++) - i[r].apply(this, e); - } - return this; - }), - (o.Emitter.mixin = function (t) { - var e = ["on", "off", "emit"]; - t._events = {}; - for (var i = 0; i < e.length; i++) { - var r = e[i], - n = o.Emitter.prototype[r]; - t[r] = n; - } - }), - (o.Emitter.prototype.dispose = function () { - return o.prototype.dispose.call(this), (this._events = null), this; - }), - o.Emitter - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (c) { - "use strict"; - return ( - (c.SignalBase = function () {}), - c.extend(c.SignalBase), - (c.SignalBase.prototype.connect = function (e, n, a) { - return ( - (c.Signal && c.Signal === e.constructor) || - (c.Param && c.Param === e.constructor) || - (c.TimelineSignal && c.TimelineSignal === e.constructor) - ? (e._param.cancelScheduledValues(0), - (e._param.value = 0), - (e.overridden = !0)) - : e instanceof AudioParam && - (e.cancelScheduledValues(0), (e.value = 0)), - c.prototype.connect.call(this, e, n, a), - this - ); - }), - c.SignalBase - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(17), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - return ( - (o.Time = function (t, e) { - if (!(this instanceof o.Time)) return new o.Time(t, e); - (this._plusNow = !1), o.TimeBase.call(this, t, e); - }), - o.extend(o.Time, o.TimeBase), - (o.Time.prototype._unaryExpressions = Object.create( - o.TimeBase.prototype._unaryExpressions, - )), - (o.Time.prototype._unaryExpressions.quantize = { - regexp: /^@/, - method: function (t) { - return o.Transport.nextSubdivision(t()); - }, - }), - (o.Time.prototype._unaryExpressions.now = { - regexp: /^\+/, - method: function (t) { - return (this._plusNow = !0), t(); - }, - }), - (o.Time.prototype.quantize = function (t, e) { - return ( - (e = this.defaultArg(e, 1)), - (this._expr = function (t, e, o) { - return ( - (t = t()), - (e = e.toSeconds()), - t + (Math.round(t / e) * e - t) * o - ); - }.bind(this, this._expr, new this.constructor(t), e)), - this - ); - }), - (o.Time.prototype.addNow = function () { - return (this._plusNow = !0), this; - }), - (o.Time.prototype._defaultExpr = function () { - return (this._plusNow = !0), this._noOp; - }), - (o.Time.prototype.copy = function (t) { - return ( - o.TimeBase.prototype.copy.call(this, t), - (this._plusNow = t._plusNow), - this - ); - }), - (o.Time.prototype.toNotation = function () { - var t = this.toSeconds(), - e = this._toNotationHelper(t, [ - "1m", - "2n", - "4n", - "8n", - "16n", - "32n", - "64n", - "128n", - ]), - o = this._toNotationHelper(t, [ - "1m", - "2n", - "2t", - "4n", - "4t", - "8n", - "8t", - "16n", - "16t", - "32n", - "32t", - "64n", - "64t", - "128n", - ]); - return o.split("+").length < e.split("+").length ? o : e; - }), - (o.Time.prototype._toNotationHelper = function (t, e) { - for ( - var o = this._notationToUnits(e[e.length - 1]), n = "", i = 0; - i < e.length; - i++ - ) { - var r = this._notationToUnits(e[i]), - s = t / r; - if ((1 - (s % 1) < 1e-6 && (s += 1e-6), 0 < (s = Math.floor(s)))) { - if ( - ((n += 1 === s ? e[i] : s.toString() + "*" + e[i]), - (t -= s * r) < o) - ) - break; - n += " + "; - } - } - return "" === n && (n = "0"), n; - }), - (o.Time.prototype._notationToUnits = function (t) { - for ( - var e = this._primaryExpressions, o = [e.n, e.t, e.m], n = 0; - n < o.length; - n++ - ) { - var i = o[n], - r = t.match(i.regexp); - if (r) return i.method.call(this, r[1]); - } - }), - (o.Time.prototype.toBarsBeatsSixteenths = function () { - var t = this._beatsToUnits(1), - e = this.toSeconds() / t, - o = Math.floor(e / this._timeSignature()), - n = (e % 1) * 4; - return ( - (e = Math.floor(e) % this._timeSignature()), - 3 < (n = n.toString()).length && (n = parseFloat(n).toFixed(3)), - [o, e, n].join(":") - ); - }), - (o.Time.prototype.toTicks = function () { - var t = this._beatsToUnits(1), - e = this.valueOf() / t; - return Math.floor(e * o.Transport.PPQ); - }), - (o.Time.prototype.toSamples = function () { - return this.toSeconds() * this.context.sampleRate; - }), - (o.Time.prototype.toFrequency = function () { - return 1 / this.toSeconds(); - }), - (o.Time.prototype.toSeconds = function () { - return this.valueOf(); - }), - (o.Time.prototype.toMilliseconds = function () { - return 1e3 * this.toSeconds(); - }), - (o.Time.prototype.valueOf = function () { - return this._expr() + (this._plusNow ? this.now() : 0); - }), - o.Time - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { - return ( - (n.TimeBase = function (e, t) { - if (!(this instanceof n.TimeBase)) return new n.TimeBase(e, t); - if (((this._expr = this._noOp), e instanceof n.TimeBase)) - this.copy(e); - else if (!this.isUndef(t) || this.isNumber(e)) { - t = this.defaultArg(t, this._defaultUnits); - var r = this._primaryExpressions[t].method; - this._expr = r.bind(this, e); - } else - this.isString(e) - ? this.set(e) - : this.isUndef(e) && (this._expr = this._defaultExpr()); - }), - n.extend(n.TimeBase), - (n.TimeBase.prototype.set = function (e) { - return (this._expr = this._parseExprString(e)), this; - }), - (n.TimeBase.prototype.clone = function () { - var e = new this.constructor(); - return e.copy(this), e; - }), - (n.TimeBase.prototype.copy = function (e) { - var t = e._expr(); - return this.set(t); - }), - (n.TimeBase.prototype._primaryExpressions = { - n: { - regexp: /^(\d+)n/i, - method: function (e) { - return 1 === (e = parseInt(e)) - ? this._beatsToUnits(this._timeSignature()) - : this._beatsToUnits(4 / e); - }, - }, - t: { - regexp: /^(\d+)t/i, - method: function (e) { - return ( - (e = parseInt(e)), this._beatsToUnits(8 / (3 * parseInt(e))) - ); - }, - }, - m: { - regexp: /^(\d+)m/i, - method: function (e) { - return this._beatsToUnits(parseInt(e) * this._timeSignature()); - }, - }, - i: { - regexp: /^(\d+)i/i, - method: function (e) { - return this._ticksToUnits(parseInt(e)); - }, - }, - hz: { - regexp: /^(\d+(?:\.\d+)?)hz/i, - method: function (e) { - return this._frequencyToUnits(parseFloat(e)); - }, - }, - tr: { - regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, - method: function (e, t, r) { - var n = 0; - return ( - e && - "0" !== e && - (n += this._beatsToUnits( - this._timeSignature() * parseFloat(e), - )), - t && "0" !== t && (n += this._beatsToUnits(parseFloat(t))), - r && "0" !== r && (n += this._beatsToUnits(parseFloat(r) / 4)), - n - ); - }, - }, - s: { - regexp: /^(\d+(?:\.\d+)?s)/, - method: function (e) { - return this._secondsToUnits(parseFloat(e)); - }, - }, - samples: { - regexp: /^(\d+)samples/, - method: function (e) { - return parseInt(e) / this.context.sampleRate; - }, - }, - default: { - regexp: /^(\d+(?:\.\d+)?)/, - method: function (e) { - return this._primaryExpressions[this._defaultUnits].method.call( - this, - e, - ); - }, - }, - }), - (n.TimeBase.prototype._binaryExpressions = { - "+": { - regexp: /^\+/, - precedence: 2, - method: function (e, t) { - return e() + t(); - }, - }, - "-": { - regexp: /^\-/, - precedence: 2, - method: function (e, t) { - return e() - t(); - }, - }, - "*": { - regexp: /^\*/, - precedence: 1, - method: function (e, t) { - return e() * t(); - }, - }, - "/": { - regexp: /^\//, - precedence: 1, - method: function (e, t) { - return e() / t(); - }, - }, - }), - (n.TimeBase.prototype._unaryExpressions = { - neg: { - regexp: /^\-/, - method: function (e) { - return -e(); - }, - }, - }), - (n.TimeBase.prototype._syntaxGlue = { - "(": { regexp: /^\(/ }, - ")": { regexp: /^\)/ }, - }), - (n.TimeBase.prototype._tokenize = function (e) { - for (var t = -1, r = []; 0 < e.length; ) { - var n = i((e = e.trim()), this); - r.push(n), (e = e.substr(n.value.length)); - } - function i(e, t) { - for ( - var r = [ - "_binaryExpressions", - "_unaryExpressions", - "_primaryExpressions", - "_syntaxGlue", - ], - n = 0; - n < r.length; - n++ - ) { - var i = t[r[n]]; - for (var s in i) { - var o = i[s], - p = o.regexp, - a = e.match(p); - if (null !== a) - return { - method: o.method, - precedence: o.precedence, - regexp: o.regexp, - value: a[0], - }; - } - } - throw new SyntaxError("Tone.TimeBase: Unexpected token " + e); - } - return { - next: function () { - return r[++t]; - }, - peek: function () { - return r[t + 1]; - }, - }; - }), - (n.TimeBase.prototype._matchGroup = function (e, t, r) { - if (!this.isUndef(e)) - for (var n in t) { - var i = t[n]; - if (i.regexp.test(e.value)) { - if (this.isUndef(r)) return i; - if (i.precedence === r) return i; - } - } - return !1; - }), - (n.TimeBase.prototype._parseBinary = function (e, t) { - var r; - this.isUndef(t) && (t = 2), - (r = t < 0 ? this._parseUnary(e) : this._parseBinary(e, t - 1)); - for ( - var n = e.peek(); - n && this._matchGroup(n, this._binaryExpressions, t); - - ) - (r = (n = e.next()).method.bind( - this, - r, - this._parseBinary(e, t - 1), - )), - (n = e.peek()); - return r; - }), - (n.TimeBase.prototype._parseUnary = function (e) { - var t, r; - t = e.peek(); - var n = this._matchGroup(t, this._unaryExpressions); - return n - ? ((t = e.next()), - (r = this._parseUnary(e)), - n.method.bind(this, r)) - : this._parsePrimary(e); - }), - (n.TimeBase.prototype._parsePrimary = function (e) { - var t, r; - if (((t = e.peek()), this.isUndef(t))) - throw new SyntaxError( - "Tone.TimeBase: Unexpected end of expression", - ); - if (this._matchGroup(t, this._primaryExpressions)) { - var n = (t = e.next()).value.match(t.regexp); - return t.method.bind(this, n[1], n[2], n[3]); - } - if (t && "(" === t.value) { - if ( - (e.next(), - (r = this._parseBinary(e)), - !(t = e.next()) || ")" !== t.value) - ) - throw new SyntaxError("Expected )"); - return r; - } - throw new SyntaxError( - "Tone.TimeBase: Cannot process token " + t.value, - ); - }), - (n.TimeBase.prototype._parseExprString = function (e) { - this.isString(e) || (e = e.toString()); - var t = this._tokenize(e); - return this._parseBinary(t); - }), - (n.TimeBase.prototype._noOp = function () { - return 0; - }), - (n.TimeBase.prototype._defaultExpr = function () { - return this._noOp; - }), - (n.TimeBase.prototype._defaultUnits = "s"), - (n.TimeBase.prototype._frequencyToUnits = function (e) { - return 1 / e; - }), - (n.TimeBase.prototype._beatsToUnits = function (e) { - return (60 / n.Transport.bpm.value) * e; - }), - (n.TimeBase.prototype._secondsToUnits = function (e) { - return e; - }), - (n.TimeBase.prototype._ticksToUnits = function (e) { - return e * (this._beatsToUnits(1) / n.Transport.PPQ); - }), - (n.TimeBase.prototype._timeSignature = function () { - return n.Transport.timeSignature; - }), - (n.TimeBase.prototype._pushExpr = function (e, t, r) { - return ( - e instanceof n.TimeBase || (e = new this.constructor(e, r)), - (this._expr = this._binaryExpressions[t].method.bind( - this, - this._expr, - e._expr, - )), - this - ); - }), - (n.TimeBase.prototype.add = function (e, t) { - return this._pushExpr(e, "+", t); - }), - (n.TimeBase.prototype.sub = function (e, t) { - return this._pushExpr(e, "-", t); - }), - (n.TimeBase.prototype.mult = function (e, t) { - return this._pushExpr(e, "*", t); - }), - (n.TimeBase.prototype.div = function (e, t) { - return this._pushExpr(e, "/", t); - }), - (n.TimeBase.prototype.valueOf = function () { - return this._expr(); - }), - (n.TimeBase.prototype.dispose = function () { - this._expr = null; - }), - n.TimeBase - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(9), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (a) { - "use strict"; - return ( - (a.Param = function () { - var t = this.optionsObject( - arguments, - ["param", "units", "convert"], - a.Param.defaults, - ); - (this._param = this.input = t.param), - (this.units = t.units), - (this.convert = t.convert), - (this.overridden = !1), - (this._lfo = null), - this.isObject(t.lfo) - ? (this.value = t.lfo) - : this.isUndef(t.value) || (this.value = t.value); - }), - a.extend(a.Param), - (a.Param.defaults = { - units: a.Type.Default, - convert: !0, - param: void 0, - }), - Object.defineProperty(a.Param.prototype, "value", { - get: function () { - return this._toUnits(this._param.value); - }, - set: function (t) { - if (this.isObject(t)) { - if (this.isUndef(a.LFO)) - throw new Error( - "Include 'Tone.LFO' to use an LFO as a Param value.", - ); - this._lfo && this._lfo.dispose(), - (this._lfo = new a.LFO(t).start()), - this._lfo.connect(this.input); - } else { - var e = this._fromUnits(t); - this._param.cancelScheduledValues(0), (this._param.value = e); - } - }, - }), - (a.Param.prototype._fromUnits = function (t) { - if (!this.convert && !this.isUndef(this.convert)) return t; - switch (this.units) { - case a.Type.Time: - return this.toSeconds(t); - case a.Type.Frequency: - return this.toFrequency(t); - case a.Type.Decibels: - return this.dbToGain(t); - case a.Type.NormalRange: - return Math.min(Math.max(t, 0), 1); - case a.Type.AudioRange: - return Math.min(Math.max(t, -1), 1); - case a.Type.Positive: - return Math.max(t, 0); - default: - return t; - } - }), - (a.Param.prototype._toUnits = function (t) { - if (!this.convert && !this.isUndef(this.convert)) return t; - switch (this.units) { - case a.Type.Decibels: - return this.gainToDb(t); - default: - return t; - } - }), - (a.Param.prototype._minOutput = 1e-5), - (a.Param.prototype.setValueAtTime = function (t, e) { - return ( - (t = this._fromUnits(t)), - (e = this.toSeconds(e)) <= this.now() + this.blockTime - ? (this._param.value = t) - : this._param.setValueAtTime(t, e), - this - ); - }), - (a.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 - ); - }), - (a.Param.prototype.linearRampToValueAtTime = function (t, e) { - return ( - (t = this._fromUnits(t)), - this._param.linearRampToValueAtTime(t, this.toSeconds(e)), - this - ); - }), - (a.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 - ); - }), - (a.Param.prototype.exponentialRampToValue = function (t, e, i) { - return ( - (i = this.toSeconds(i)), - this.setRampPoint(i), - this.exponentialRampToValueAtTime(t, i + this.toSeconds(e)), - this - ); - }), - (a.Param.prototype.linearRampToValue = function (t, e, i) { - return ( - (i = this.toSeconds(i)), - this.setRampPoint(i), - this.linearRampToValueAtTime(t, i + this.toSeconds(e)), - this - ); - }), - (a.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 - ); - }), - (a.Param.prototype.setValueCurveAtTime = function (t, e, i) { - for (var a = 0; a < t.length; a++) t[a] = this._fromUnits(t[a]); - return ( - this._param.setValueCurveAtTime( - t, - this.toSeconds(e), - this.toSeconds(i), - ), - this - ); - }), - (a.Param.prototype.cancelScheduledValues = function (t) { - return this._param.cancelScheduledValues(this.toSeconds(t)), this; - }), - (a.Param.prototype.rampTo = function (t, e, i) { - return ( - (e = this.defaultArg(e, 0)), - this.units === a.Type.Frequency || - this.units === a.Type.BPM || - this.units === a.Type.Decibels - ? this.exponentialRampToValue(t, e, i) - : this.linearRampToValue(t, e, i), - this - ); - }), - Object.defineProperty(a.Param.prototype, "lfo", { - get: function () { - return this._lfo; - }, - }), - (a.Param.prototype.dispose = function () { - return ( - a.prototype.dispose.call(this), - (this._param = null), - this._lfo && (this._lfo.dispose(), (this._lfo = null)), - this - ); - }), - a.Param - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(9), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - (i.Timeline = function () { - var e = this.optionsObject( - arguments, - ["memory"], - i.Timeline.defaults, - ); - (this._timeline = []), - (this._toRemove = []), - (this._iterating = !1), - (this.memory = e.memory); - }), - i.extend(i.Timeline), - (i.Timeline.defaults = { memory: 1 / 0 }), - Object.defineProperty(i.Timeline.prototype, "length", { - get: function () { - return this._timeline.length; - }, - }), - (i.Timeline.prototype.add = function (e) { - if (this.isUndef(e.time)) - throw new Error("Tone.Timeline: events must have a time attribute"); - if (this._timeline.length) { - var i = this._search(e.time); - this._timeline.splice(i + 1, 0, e); - } else this._timeline.push(e); - if (this.length > this.memory) { - var t = this.length - this.memory; - this._timeline.splice(0, t); - } - return this; - }), - (i.Timeline.prototype.remove = function (e) { - if (this._iterating) this._toRemove.push(e); - else { - var i = this._timeline.indexOf(e); - -1 !== i && this._timeline.splice(i, 1); - } - return this; - }), - (i.Timeline.prototype.get = function (e) { - var i = this._search(e); - return -1 !== i ? this._timeline[i] : null; - }), - (i.Timeline.prototype.peek = function () { - return this._timeline[0]; - }), - (i.Timeline.prototype.shift = function () { - return this._timeline.shift(); - }), - (i.Timeline.prototype.getAfter = function (e) { - var i = this._search(e); - return i + 1 < this._timeline.length ? this._timeline[i + 1] : null; - }), - (i.Timeline.prototype.getBefore = function (e) { - var i = this._timeline.length; - if (0 < i && this._timeline[i - 1].time < e) - return this._timeline[i - 1]; - var t = this._search(e); - return 0 <= t - 1 ? this._timeline[t - 1] : null; - }), - (i.Timeline.prototype.cancel = function (e) { - if (1 < this._timeline.length) { - var i = this._search(e); - if (0 <= i) - if (this._timeline[i].time === e) { - for (var t = i; 0 <= t && this._timeline[t].time === e; t--) - i = t; - this._timeline = this._timeline.slice(0, i); - } else this._timeline = this._timeline.slice(0, i + 1); - else this._timeline = []; - } else - 1 === this._timeline.length && - this._timeline[0].time >= e && - (this._timeline = []); - return this; - }), - (i.Timeline.prototype.cancelBefore = function (e) { - if (this._timeline.length) { - var i = this._search(e); - 0 <= i && (this._timeline = this._timeline.slice(i + 1)); - } - return this; - }), - (i.Timeline.prototype._search = function (e) { - var i = 0, - t = this._timeline.length, - n = t; - if (0 < t && this._timeline[t - 1].time <= e) return t - 1; - for (; i < n; ) { - var r = Math.floor(i + (n - i) / 2), - s = this._timeline[r], - h = this._timeline[r + 1]; - if (s.time === e) { - for (var l = r; l < this._timeline.length; l++) { - this._timeline[l].time === e && (r = l); - } - return r; - } - if (s.time < e && h.time > e) return r; - s.time > e ? (n = r) : s.time < e && (i = r + 1); - } - return -1; - }), - (i.Timeline.prototype._iterate = function (e, i, t) { - (this._iterating = !0), - (i = this.defaultArg(i, 0)), - (t = this.defaultArg(t, this._timeline.length - 1)); - for (var n = i; n <= t; n++) e(this._timeline[n]); - if (((this._iterating = !1), 0 < this._toRemove.length)) { - for (var r = 0; r < this._toRemove.length; r++) { - var s = this._timeline.indexOf(this._toRemove[r]); - -1 !== s && this._timeline.splice(s, 1); - } - this._toRemove = []; - } - }), - (i.Timeline.prototype.forEach = function (e) { - return this._iterate(e), this; - }), - (i.Timeline.prototype.forEachBefore = function (e, i) { - var t = this._search(e); - return -1 !== t && this._iterate(i, 0, t), this; - }), - (i.Timeline.prototype.forEachAfter = function (e, i) { - var t = this._search(e); - return this._iterate(i, t + 1), this; - }), - (i.Timeline.prototype.forEachFrom = function (e, i) { - for (var t = this._search(e); 0 <= t && this._timeline[t].time >= e; ) - t--; - return this._iterate(i, t + 1), this; - }), - (i.Timeline.prototype.forEachAtTime = function (i, t) { - var e = this._search(i); - return ( - -1 !== e && - this._iterate( - function (e) { - e.time === i && t(e); - }, - 0, - e, - ), - this - ); - }), - (i.Timeline.prototype.dispose = function () { - i.prototype.dispose.call(this), - (this._timeline = null), - (this._toRemove = null); - }), - i.Timeline - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(1), - __webpack_require__(2), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (t) { - "use strict"; - return ( - (t.Negate = function () { - this._multiply = this.input = this.output = new t.Multiply(-1); - }), - t.extend(t.Negate, t.SignalBase), - (t.Negate.prototype.dispose = function () { - return ( - t.prototype.dispose.call(this), - this._multiply.dispose(), - (this._multiply = null), - this - ); - }), - t.Negate - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(2), - __webpack_require__(1), - __webpack_require__(6), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { - "use strict"; - return ( - (e.GreaterThanZero = function () { - (this._thresh = this.output = - new e.WaveShaper(function (e) { - return e <= 0 ? 0 : 1; - }, 127)), - (this._scale = this.input = new e.Multiply(1e4)), - this._scale.connect(this._thresh); - }), - e.extend(e.GreaterThanZero, e.SignalBase), - (e.GreaterThanZero.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._scale.dispose(), - (this._scale = null), - this._thresh.dispose(), - (this._thresh = null), - this - ); - }), - e.GreaterThanZero - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_FACTORY__, - __WEBPACK_AMD_DEFINE_ARRAY__, - __WEBPACK_AMD_DEFINE_RESULT__; - !(function (e, t) { - true - ? !((__WEBPACK_AMD_DEFINE_ARRAY__ = []), - (__WEBPACK_AMD_DEFINE_FACTORY__ = t), - (__WEBPACK_AMD_DEFINE_RESULT__ = - typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" - ? __WEBPACK_AMD_DEFINE_FACTORY__.apply( - exports, - __WEBPACK_AMD_DEFINE_ARRAY__, - ) - : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) - : undefined; - })(this, function () { - var r = function (e, t) { - (this._dragged = !1), - (this._element = e), - (this._bindedMove = this._moved.bind(this)), - (this._bindedEnd = this._ended.bind(this, t)), - e.addEventListener("touchstart", this._bindedEnd), - e.addEventListener("touchmove", this._bindedMove), - e.addEventListener("touchend", this._bindedEnd), - e.addEventListener("mouseup", this._bindedEnd); - }; - function o(e) { - return "running" === e.state; - } - return ( - (r.prototype._moved = function (e) { - this._dragged = !0; - }), - (r.prototype._ended = function (e) { - this._dragged || - (function (e) { - var t = e.createBuffer(1, 1, e.sampleRate), - n = e.createBufferSource(); - (n.buffer = t), - n.connect(e.destination), - n.start(0), - e.resume && e.resume(); - })(e), - (this._dragged = !1); - }), - (r.prototype.dispose = function () { - this._element.removeEventListener("touchstart", this._bindedEnd), - this._element.removeEventListener("touchmove", this._bindedMove), - this._element.removeEventListener("touchend", this._bindedEnd), - this._element.removeEventListener("mouseup", this._bindedEnd), - (this._bindedMove = null), - (this._bindedEnd = null), - (this._element = null); - }), - function (t, e, n) { - var i = new Promise(function (e) { - !(function (t, n) { - o(t) - ? n() - : (function e() { - o(t) - ? n() - : (requestAnimationFrame(e), t.resume && t.resume()); - })(); - })(t, e); - }), - d = []; - return ( - (function e(t, n, i) { - if (Array.isArray(t) || (NodeList && t instanceof NodeList)) - for (var d = 0; d < t.length; d++) e(t[d], n, i); - else if ("string" == typeof t) - e(document.querySelectorAll(t), n, i); - else if (t.jquery && "function" == typeof t.toArray) - e(t.toArray(), n, i); - else if (Element && t instanceof Element) { - var o = new r(t, i); - n.push(o); - } - })((e = e || document.body), d, t), - i.then(function () { - for (var e = 0; e < d.length; e++) d[e].dispose(); - (d = null), n && n(); - }), - i - ); - } - ); - }); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(2), - __webpack_require__(32), - __webpack_require__(38), - __webpack_require__(10), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - (i.CrossFade = function (e) { - this.createInsOuts(2, 1), - (this.a = this.input[0] = new i.Gain()), - (this.b = this.input[1] = new i.Gain()), - (this.fade = new i.Signal( - this.defaultArg(e, 0.5), - i.Type.NormalRange, - )), - (this._equalPowerA = new i.EqualPowerGain()), - (this._equalPowerB = new i.EqualPowerGain()), - (this._invert = new i.Expr("1 - $0")), - this.a.connect(this.output), - this.b.connect(this.output), - this.fade.chain(this._equalPowerB, this.b.gain), - this.fade.chain(this._invert, this._equalPowerA, this.a.gain), - this._readOnly("fade"); - }), - i.extend(i.CrossFade), - (i.CrossFade.prototype.dispose = function () { - return ( - i.prototype.dispose.call(this), - this._writable("fade"), - this._equalPowerA.dispose(), - (this._equalPowerA = null), - this._equalPowerB.dispose(), - (this._equalPowerB = null), - this.fade.dispose(), - (this.fade = null), - this._invert.dispose(), - (this._invert = null), - this.a.dispose(), - (this.a = null), - this.b.dispose(), - (this.b = null), - this - ); - }), - i.CrossFade - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports) { - !(function () { - var l, - s = []; - function p(e) { - var o = this, - n = {}, - i = -1; - this.parameters.forEach(function (e, t) { - var r = s[++i] || (s[i] = new Float32Array(o.bufferSize)); - r.fill(e.value), (n[t] = r); - }), - this.processor.realm.exec( - "self.sampleRate=sampleRate=" + - this.context.sampleRate + - ";self.currentTime=currentTime=" + - this.context.currentTime, - ); - var t = a(e.inputBuffer), - r = a(e.outputBuffer); - this.instance.process([t], [r], n); - } - function a(e) { - for (var t = [], r = 0; r < e.numberOfChannels; r++) - t[r] = e.getChannelData(r); - return t; - } - function f(e) { - return e.$$processors || (e.$$processors = {}); - } - function e(e) { - this.$$context = e; - } - "function" != typeof AudioWorkletNode && - ((self.AudioWorkletNode = function (e, t, r) { - var o = f(e)[t], - n = e.createScriptProcessor( - void 0, - 2, - r && r.outputChannelCount ? r.outputChannelCount[0] : 2, - ); - if (((n.parameters = new Map()), o.properties)) - for (var i = 0; i < o.properties.length; i++) { - var s = o.properties[i], - a = e.createGain().gain; - (a.value = s.defaultValue), n.parameters.set(s.name, a); - } - var u = new MessageChannel(); - l = u.port2; - var c = new o.Processor(r || {}); - return ( - (l = null), - (n.port = u.port1), - (n.processor = o), - (n.instance = c), - (n.onaudioprocess = p), - n - ); - }), - Object.defineProperty( - (self.AudioContext || self.webkitAudioContext).prototype, - "audioWorklet", - { - get: function () { - return ( - this.$$audioWorklet || - (this.$$audioWorklet = new self.AudioWorklet(this)) - ); - }, - }, - ), - (self.AudioWorklet = - ((e.prototype.addModule = function (e, t) { - var n = this; - return fetch(e) - .then(function (e) { - if (!e.ok) throw Error(e.status); - return e.text(); - }) - .then(function (e) { - var r = { - sampleRate: 0, - currentTime: 0, - AudioWorkletProcessor: function () { - this.port = l; - }, - registerProcessor: function (e, t) { - f(n.$$context)[e] = { - realm: o, - context: r, - Processor: t, - properties: t.parameterDescriptors || [], - }; - }, - }, - o = new (function (e, t) { - var r = document.createElement("iframe"); - (r.style.cssText = - "position:absolute;left:0;top:-999px;width:1px;height:1px;"), - t.appendChild(r); - var o = r.contentWindow, - n = o.document, - i = "var window,$hook"; - for (var s in o) - s in e || "eval" === s || ((i += ","), (i += s)); - for (var a in e) - (i += ","), (i += a), (i += "=self."), (i += a); - var u = n.createElement("script"); - u.appendChild( - n.createTextNode( - 'function $hook(self,console) {"use strict";\n ' + - i + - ";return function() {return eval(arguments[0])}}", - ), - ), - n.body.appendChild(u), - (this.exec = o.$hook(e, console)); - })((r.self = r), document.documentElement); - return o.exec(((t && t.transpile) || String)(e)), null; - }); - }), - e))); - })(); - }, - function (module, exports) { - /** - * This module has shims - */ - - (function () { - function fixSetTarget(param) { - if (!param) return; - if (!param.setTargetAtTime) - param.setTargetAtTime = param.setTargetValueAtTime; - } - - if ( - window.hasOwnProperty("webkitAudioContext") && - !window.hasOwnProperty("AudioContext") - ) { - window.AudioContext = window.webkitAudioContext; - if (typeof AudioContext.prototype.createGain !== "function") - AudioContext.prototype.createGain = - AudioContext.prototype.createGainNode; - if (typeof AudioContext.prototype.createDelay !== "function") - AudioContext.prototype.createDelay = - AudioContext.prototype.createDelayNode; - if (typeof AudioContext.prototype.createScriptProcessor !== "function") - AudioContext.prototype.createScriptProcessor = - AudioContext.prototype.createJavaScriptNode; - if (typeof AudioContext.prototype.createPeriodicWave !== "function") - AudioContext.prototype.createPeriodicWave = - AudioContext.prototype.createWaveTable; - AudioContext.prototype.internal_createGain = - AudioContext.prototype.createGain; - - AudioContext.prototype.createGain = function () { - var node = this.internal_createGain(); - fixSetTarget(node.gain); - return node; - }; - - AudioContext.prototype.internal_createDelay = - AudioContext.prototype.createDelay; - - AudioContext.prototype.createDelay = function (maxDelayTime) { - var node = maxDelayTime - ? this.internal_createDelay(maxDelayTime) - : this.internal_createDelay(); - fixSetTarget(node.delayTime); - return node; - }; - - AudioContext.prototype.internal_createBufferSource = - AudioContext.prototype.createBufferSource; - - AudioContext.prototype.createBufferSource = function () { - var node = this.internal_createBufferSource(); - - if (!node.start) { - node.start = function (when, offset, duration) { - if (offset || duration) - this.noteGrainOn(when || 0, offset, duration); - else this.noteOn(when || 0); - }; - } else { - node.internal_start = node.start; - - node.start = function (when, offset, duration) { - if (typeof duration !== "undefined") - node.internal_start(when || 0, offset, duration); - else node.internal_start(when || 0, offset || 0); - }; - } - - if (!node.stop) { - node.stop = function (when) { - this.noteOff(when || 0); - }; - } else { - node.internal_stop = node.stop; - - node.stop = function (when) { - node.internal_stop(when || 0); - }; - } - - fixSetTarget(node.playbackRate); - return node; - }; - - AudioContext.prototype.internal_createDynamicsCompressor = - AudioContext.prototype.createDynamicsCompressor; - - AudioContext.prototype.createDynamicsCompressor = function () { - var node = this.internal_createDynamicsCompressor(); - fixSetTarget(node.threshold); - fixSetTarget(node.knee); - fixSetTarget(node.ratio); - fixSetTarget(node.reduction); - fixSetTarget(node.attack); - fixSetTarget(node.release); - return node; - }; - - AudioContext.prototype.internal_createBiquadFilter = - AudioContext.prototype.createBiquadFilter; - - AudioContext.prototype.createBiquadFilter = function () { - var node = this.internal_createBiquadFilter(); - fixSetTarget(node.frequency); - fixSetTarget(node.detune); - fixSetTarget(node.Q); - fixSetTarget(node.gain); - return node; - }; - - if (typeof AudioContext.prototype.createOscillator !== "function") { - AudioContext.prototype.internal_createOscillator = - AudioContext.prototype.createOscillator; - - AudioContext.prototype.createOscillator = function () { - var node = this.internal_createOscillator(); - - if (!node.start) { - node.start = function (when) { - this.noteOn(when || 0); - }; - } else { - node.internal_start = node.start; - - node.start = function (when) { - node.internal_start(when || 0); - }; - } - - if (!node.stop) { - node.stop = function (when) { - this.noteOff(when || 0); - }; - } else { - node.internal_stop = node.stop; - - node.stop = function (when) { - node.internal_stop(when || 0); - }; - } - - if (!node.setPeriodicWave) node.setPeriodicWave = node.setWaveTable; - fixSetTarget(node.frequency); - fixSetTarget(node.detune); - return node; - }; - } - } - - if ( - window.hasOwnProperty("webkitOfflineAudioContext") && - !window.hasOwnProperty("OfflineAudioContext") - ) { - window.OfflineAudioContext = window.webkitOfflineAudioContext; - } - })(window); - - navigator.getUserMedia = - navigator.getUserMedia || - navigator.webkitGetUserMedia || - navigator.mozGetUserMedia || - navigator.msGetUserMedia; - /** - * Determine which filetypes are supported (inspired by buzz.js) - * The audio element (el) will only be used to test browser support for various audio formats - */ - - var el = document.createElement("audio"); - - p5.prototype.isSupported = function () { - return !!el.canPlayType; - }; - - var isOGGSupported = function isOGGSupported() { - return !!el.canPlayType && el.canPlayType('audio/ogg; codecs="vorbis"'); - }; - - var isMP3Supported = function isMP3Supported() { - return !!el.canPlayType && el.canPlayType("audio/mpeg;"); - }; - - var isWAVSupported = function isWAVSupported() { - return !!el.canPlayType && el.canPlayType('audio/wav; codecs="1"'); - }; - - var isAACSupported = function isAACSupported() { - return ( - !!el.canPlayType && - (el.canPlayType("audio/x-m4a;") || el.canPlayType("audio/aac;")) - ); - }; - - var isAIFSupported = function isAIFSupported() { - return !!el.canPlayType && el.canPlayType("audio/x-aiff;"); - }; - - p5.prototype.isFileSupported = function (extension) { - switch (extension.toLowerCase()) { - case "mp3": - return isMP3Supported(); - - case "wav": - return isWAVSupported(); - - case "ogg": - return isOGGSupported(); - - case "aac": - case "m4a": - case "mp4": - return isAACSupported(); - - case "aif": - case "aiff": - return isAIFSupported(); - - default: - return false; - } - }; - }, - function (module, exports) { - var g; - g = (function () { - return this; - })(); - try { - g = g || new Function("return this")(); - } catch (t) { - "object" == typeof window && (g = window); - } - module.exports = g; - }, - function (module, __webpack_exports__, __webpack_require__) { - "use strict"; - __webpack_require__.r(__webpack_exports__); - __webpack_exports__["default"] = - 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'start\') {\n _this.record(data.duration);\n } else if (data.name === \'stop\') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: "process",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: "record",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: "stop",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: \'buffers\',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: "getBuffers",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: "mergeBuffers",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: "clear",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);'; - }, - function (module, __webpack_exports__, __webpack_require__) { - "use strict"; - __webpack_require__.r(__webpack_exports__); - __webpack_exports__["default"] = - 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: "process",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: \'position\',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);'; - }, - function (module, __webpack_exports__, __webpack_require__) { - "use strict"; - __webpack_require__.r(__webpack_exports__); - __webpack_exports__["default"] = - 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'toggleNormalize\') {\n _this.normalize = data.normalize;\n } else if (data.name === \'smoothing\') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: "process",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: \'amplitude\',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);'; - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(17), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - (o.Frequency = function (e, t) { - if (!(this instanceof o.Frequency)) return new o.Frequency(e, t); - o.TimeBase.call(this, e, t); - }), - o.extend(o.Frequency, o.TimeBase), - (o.Frequency.prototype._primaryExpressions = Object.create( - o.TimeBase.prototype._primaryExpressions, - )), - (o.Frequency.prototype._primaryExpressions.midi = { - regexp: /^(\d+(?:\.\d+)?midi)/, - method: function (e) { - return this.midiToFrequency(e); - }, - }), - (o.Frequency.prototype._primaryExpressions.note = { - regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i, - method: function (e, t) { - var r = n[e.toLowerCase()] + 12 * (parseInt(t) + 1); - return this.midiToFrequency(r); - }, - }), - (o.Frequency.prototype._primaryExpressions.tr = { - regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, - method: function (e, t, r) { - var n = 1; - return ( - e && - "0" !== e && - (n *= this._beatsToUnits( - this._timeSignature() * parseFloat(e), - )), - t && "0" !== t && (n *= this._beatsToUnits(parseFloat(t))), - r && "0" !== r && (n *= this._beatsToUnits(parseFloat(r) / 4)), - n - ); - }, - }), - (o.Frequency.prototype.transpose = function (e) { - return ( - (this._expr = function (e, t) { - return e() * this.intervalToFrequencyRatio(t); - }.bind(this, this._expr, e)), - this - ); - }), - (o.Frequency.prototype.harmonize = function (e) { - return ( - (this._expr = function (e, t) { - for (var r = e(), n = [], o = 0; o < t.length; o++) - n[o] = r * this.intervalToFrequencyRatio(t[o]); - return n; - }.bind(this, this._expr, e)), - this - ); - }), - (o.Frequency.prototype.toMidi = function () { - return this.frequencyToMidi(this.valueOf()); - }), - (o.Frequency.prototype.toNote = function () { - var e = this.valueOf(), - t = Math.log(e / o.Frequency.A4) / Math.LN2, - r = Math.round(12 * t) + 57, - n = Math.floor(r / 12); - return n < 0 && (r += -12 * n), i[r % 12] + n.toString(); - }), - (o.Frequency.prototype.toSeconds = function () { - return 1 / this.valueOf(); - }), - (o.Frequency.prototype.toFrequency = function () { - return this.valueOf(); - }), - (o.Frequency.prototype.toTicks = function () { - var e = this._beatsToUnits(1), - t = this.valueOf() / e; - return Math.floor(t * o.Transport.PPQ); - }), - (o.Frequency.prototype._frequencyToUnits = function (e) { - return e; - }), - (o.Frequency.prototype._ticksToUnits = function (e) { - return 1 / ((60 * e) / (o.Transport.bpm.value * o.Transport.PPQ)); - }), - (o.Frequency.prototype._beatsToUnits = function (e) { - return 1 / o.TimeBase.prototype._beatsToUnits.call(this, e); - }), - (o.Frequency.prototype._secondsToUnits = function (e) { - return 1 / e; - }), - (o.Frequency.prototype._defaultUnits = "hz"); - var n = { - 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 ( - (o.Frequency.A4 = 440), - (o.Frequency.prototype.midiToFrequency = function (e) { - return o.Frequency.A4 * Math.pow(2, (e - 69) / 12); - }), - (o.Frequency.prototype.frequencyToMidi = function (e) { - return 69 + (12 * Math.log(e / o.Frequency.A4)) / Math.LN2; - }), - o.Frequency - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(16), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (o) { - return ( - (o.TransportTime = function (t, r) { - if (!(this instanceof o.TransportTime)) - return new o.TransportTime(t, r); - o.Time.call(this, t, r); - }), - o.extend(o.TransportTime, o.Time), - (o.TransportTime.prototype._unaryExpressions = Object.create( - o.Time.prototype._unaryExpressions, - )), - (o.TransportTime.prototype._unaryExpressions.quantize = { - regexp: /^@/, - method: function (t) { - var r = this._secondsToTicks(t()), - e = Math.ceil(o.Transport.ticks / r); - return this._ticksToUnits(e * r); - }, - }), - (o.TransportTime.prototype._secondsToTicks = function (t) { - var r = t / this._beatsToUnits(1); - return Math.round(r * o.Transport.PPQ); - }), - (o.TransportTime.prototype.valueOf = function () { - return ( - this._secondsToTicks(this._expr()) + - (this._plusNow ? o.Transport.ticks : 0) - ); - }), - (o.TransportTime.prototype.toTicks = function () { - return this.valueOf(); - }), - (o.TransportTime.prototype.toSeconds = function () { - return this._expr() + (this._plusNow ? o.Transport.seconds : 0); - }), - (o.TransportTime.prototype.toFrequency = function () { - return 1 / this.toSeconds(); - }), - o.TransportTime - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(4), - __webpack_require__(13), - __webpack_require__(1), - __webpack_require__(33), - __webpack_require__(21), - __webpack_require__(34), - __webpack_require__(20), - __webpack_require__(35), - __webpack_require__(36), - __webpack_require__(37), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (p) { - "use strict"; - function r(e, n, r) { - var t = new e(); - return ( - r._eval(n[0]).connect(t, 0, 0), r._eval(n[1]).connect(t, 0, 1), t - ); - } - function t(e, n, r) { - var t = new e(); - return r._eval(n[0]).connect(t, 0, 0), t; - } - function o(e) { - return e ? parseFloat(e) : void 0; - } - function i(e) { - return e && e.args ? parseFloat(e.args) : void 0; - } - return ( - (p.Expr = function () { - var n = this._replacements(Array.prototype.slice.call(arguments)), - e = this._parseInputs(n); - (this._nodes = []), (this.input = new Array(e)); - for (var r = 0; r < e; r++) this.input[r] = this.context.createGain(); - var t, - o = this._parseTree(n); - try { - t = this._eval(o); - } catch (e) { - throw ( - (this._disposeNodes(), - new Error("Tone.Expr: Could evaluate expression: " + n)) - ); - } - this.output = t; - }), - p.extend(p.Expr, p.SignalBase), - (p.Expr._Expressions = { - value: { - signal: { - regexp: /^\d+\.\d+|^\d+/, - method: function (e) { - return new p.Signal(o(e)); - }, - }, - input: { - regexp: /^\$\d/, - method: function (e, n) { - return n.input[o(e.substr(1))]; - }, - }, - }, - glue: { - "(": { regexp: /^\(/ }, - ")": { regexp: /^\)/ }, - ",": { regexp: /^,/ }, - }, - func: { - abs: { regexp: /^abs/, method: t.bind(this, p.Abs) }, - mod: { - regexp: /^mod/, - method: function (e, n) { - var r = i(e[1]), - t = new p.Modulo(r); - return n._eval(e[0]).connect(t), t; - }, - }, - pow: { - regexp: /^pow/, - method: function (e, n) { - var r = i(e[1]), - t = new p.Pow(r); - return n._eval(e[0]).connect(t), t; - }, - }, - a2g: { - regexp: /^a2g/, - method: function (e, n) { - var r = new p.AudioToGain(); - return n._eval(e[0]).connect(r), r; - }, - }, - }, - binary: { - "+": { regexp: /^\+/, precedence: 1, method: r.bind(this, p.Add) }, - "-": { - regexp: /^\-/, - precedence: 1, - method: function (e, n) { - return 1 === e.length ? t(p.Negate, e, n) : r(p.Subtract, e, n); - }, - }, - "*": { - regexp: /^\*/, - precedence: 0, - method: r.bind(this, p.Multiply), - }, - }, - unary: { - "-": { regexp: /^\-/, method: t.bind(this, p.Negate) }, - "!": { regexp: /^\!/, method: t.bind(this, p.NOT) }, - }, - }), - (p.Expr.prototype._parseInputs = function (e) { - var n = e.match(/\$\d/g), - r = 0; - if (null !== n) - for (var t = 0; t < n.length; t++) { - var o = parseInt(n[t].substr(1)) + 1; - r = Math.max(r, o); - } - return r; - }), - (p.Expr.prototype._replacements = function (e) { - for (var n = e.shift(), r = 0; r < e.length; r++) - n = n.replace(/\%/i, e[r]); - return n; - }), - (p.Expr.prototype._tokenize = function (e) { - for (var n = -1, r = []; 0 < e.length; ) { - var t = o((e = e.trim())); - r.push(t), (e = e.substr(t.value.length)); - } - function o(e) { - for (var n in p.Expr._Expressions) { - var r = p.Expr._Expressions[n]; - for (var t in r) { - var o = r[t], - i = o.regexp, - a = e.match(i); - if (null !== a) - return { type: n, value: a[0], method: o.method }; - } - } - throw new SyntaxError("Tone.Expr: Unexpected token " + e); - } - return { - next: function () { - return r[++n]; - }, - peek: function () { - return r[n + 1]; - }, - }; - }), - (p.Expr.prototype._parseTree = function (e) { - var t = this._tokenize(e), - a = this.isUndef.bind(this); - function r(e, n) { - return !a(e) && "glue" === e.type && e.value === n; - } - function o(e, n, r) { - var t = p.Expr._Expressions[n]; - if (!a(e)) - for (var o in t) { - var i = t[o]; - if (i.regexp.test(e.value)) { - if (a(r)) return !0; - if (i.precedence === r) return !0; - } - } - return !1; - } - function i(e) { - var n; - a(e) && (e = 5), - (n = - e < 0 - ? (function e() { - var n, r; - n = t.peek(); - if (o(n, "unary")) - return ( - (n = t.next()), - (r = e()), - { operator: n.value, method: n.method, args: [r] } - ); - return s(); - })() - : i(e - 1)); - for (var r = t.peek(); o(r, "binary", e); ) - (n = { - operator: (r = t.next()).value, - method: r.method, - args: [n, i(e - 1)], - }), - (r = t.peek()); - return n; - } - function s() { - var e, n; - if (((e = t.peek()), a(e))) - throw new SyntaxError( - "Tone.Expr: Unexpected termination of expression", - ); - if ("func" === e.type) - return (function (e) { - var n = []; - if (!r(t.next(), "(")) - throw new SyntaxError( - 'Tone.Expr: Expected ( in a function call "' + - e.value + - '"', - ); - r(t.peek(), ")") || - (n = (function () { - var e, - n = []; - for (; (e = i()), !a(e) && (n.push(e), r(t.peek(), ",")); ) - t.next(); - return n; - })()); - if (r(t.next(), ")")) - return { method: e.method, args: n, name: name }; - throw new SyntaxError( - 'Tone.Expr: Expected ) in a function call "' + e.value + '"', - ); - })((e = t.next())); - if ("value" === e.type) - return { method: (e = t.next()).method, args: e.value }; - if (r(e, "(")) { - if ((t.next(), (n = i()), !r((e = t.next()), ")"))) - throw new SyntaxError("Expected )"); - return n; - } - throw new SyntaxError( - "Tone.Expr: Parse error, cannot process token " + e.value, - ); - } - return i(); - }), - (p.Expr.prototype._eval = function (e) { - if (!this.isUndef(e)) { - var n = e.method(e.args, this); - return this._nodes.push(n), n; - } - }), - (p.Expr.prototype._disposeNodes = function () { - for (var e = 0; e < this._nodes.length; e++) { - var n = this._nodes[e]; - this.isFunction(n.dispose) - ? n.dispose() - : this.isFunction(n.disconnect) && n.disconnect(), - (n = null), - (this._nodes[e] = null); - } - this._nodes = null; - }), - (p.Expr.prototype.dispose = function () { - p.prototype.dispose.call(this), this._disposeNodes(); - }), - p.Expr - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(21), - __webpack_require__(13), - __webpack_require__(2), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { - "use strict"; - return ( - (e.GreaterThan = function (t) { - this.createInsOuts(2, 0), - (this._param = this.input[0] = new e.Subtract(t)), - (this.input[1] = this._param.input[1]), - (this._gtz = this.output = new e.GreaterThanZero()), - this._param.connect(this._gtz); - }), - e.extend(e.GreaterThan, e.Signal), - (e.GreaterThan.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._param.dispose(), - (this._param = null), - this._gtz.dispose(), - (this._gtz = null), - this - ); - }), - e.GreaterThan - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(6), - __webpack_require__(15), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (s) { - "use strict"; - return ( - (s.Abs = function () { - this._abs = - this.input = - this.output = - new s.WaveShaper(function (s) { - return 0 === s ? 0 : Math.abs(s); - }, 127); - }), - s.extend(s.Abs, s.SignalBase), - (s.Abs.prototype.dispose = function () { - return ( - s.prototype.dispose.call(this), - this._abs.dispose(), - (this._abs = null), - this - ); - }), - s.Abs - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(6), - __webpack_require__(1), - __webpack_require__(13), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (i) { - "use strict"; - return ( - (i.Modulo = function (t) { - this.createInsOuts(1, 0), - (this._shaper = new i.WaveShaper(Math.pow(2, 16))), - (this._multiply = new i.Multiply()), - (this._subtract = this.output = new i.Subtract()), - (this._modSignal = new i.Signal(t)), - 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(t); - }), - i.extend(i.Modulo, i.SignalBase), - (i.Modulo.prototype._setWaveShaper = function (i) { - this._shaper.setMap(function (t) { - return Math.floor((t + 1e-4) / i); - }); - }), - Object.defineProperty(i.Modulo.prototype, "value", { - get: function () { - return this._modSignal.value; - }, - set: function (t) { - (this._modSignal.value = t), this._setWaveShaper(t); - }, - }), - (i.Modulo.prototype.dispose = function () { - return ( - i.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 - ); - }), - i.Modulo - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(6), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = 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 (e) { - (this._exp = e), 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 - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(6), - __webpack_require__(2), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (n) { - "use strict"; - return ( - (n.AudioToGain = function () { - this._norm = - this.input = - this.output = - new n.WaveShaper(function (n) { - return (n + 1) / 2; - }); - }), - n.extend(n.AudioToGain, n.SignalBase), - (n.AudioToGain.prototype.dispose = function () { - return ( - n.prototype.dispose.call(this), - this._norm.dispose(), - (this._norm = null), - this - ); - }), - n.AudioToGain - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(6), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (e) { - "use strict"; - return ( - (e.EqualPowerGain = function () { - this._eqPower = - this.input = - this.output = - new e.WaveShaper( - function (e) { - return Math.abs(e) < 0.001 ? 0 : this.equalPowerScale(e); - }.bind(this), - 4096, - ); - }), - e.extend(e.EqualPowerGain, e.SignalBase), - (e.EqualPowerGain.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._eqPower.dispose(), - (this._eqPower = null), - this - ); - }), - e.EqualPowerGain - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - !((__WEBPACK_AMD_DEFINE_ARRAY__ = [ - __webpack_require__(0), - __webpack_require__(19), - __webpack_require__(9), - ]), - (__WEBPACK_AMD_DEFINE_RESULT__ = function (t) { - "use strict"; - return ( - (t.TimelineState = function (e) { - t.Timeline.call(this), (this._initial = e); - }), - t.extend(t.TimelineState, t.Timeline), - (t.TimelineState.prototype.getValueAtTime = function (e) { - var t = this.get(e); - return null !== t ? t.state : this._initial; - }), - (t.TimelineState.prototype.setStateAtTime = function (e, t) { - this.add({ state: e, time: t }); - }), - t.TimelineState - ); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }, - function (module, __webpack_exports__, __webpack_require__) { - "use strict"; - __webpack_require__.r(__webpack_exports__); - - var audioworklet_polyfill = __webpack_require__(24); - - var shims = __webpack_require__(25); - - var audiocontext = __webpack_require__(3); - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var main_Main = function Main() { - _classCallCheck(this, Main); - - this.input = audiocontext["a"].createGain(); - this.output = audiocontext["a"].createGain(); - - this.limiter = audiocontext["a"].createDynamicsCompressor(); - this.limiter.threshold.value = -3; - this.limiter.ratio.value = 20; - this.limiter.knee.value = 1; - this.audiocontext = audiocontext["a"]; - this.output.disconnect(); - - this.input.connect(this.limiter); - - this.limiter.connect(this.output); - - this.meter = audiocontext["a"].createGain(); - this.fftMeter = audiocontext["a"].createGain(); - this.output.connect(this.meter); - this.output.connect(this.fftMeter); - - this.output.connect(this.audiocontext.destination); - - this.soundArray = []; - - this.parts = []; - - this.extensions = []; - }; - - var p5sound = new main_Main(); - /** - * Returns a number representing the output volume for sound - * in this sketch. - * - * @method getOutputVolume - * @return {Number} Output volume for sound in this sketch. - * Should be between 0.0 (silence) and 1.0. - */ - - p5.prototype.getOutputVolume = function () { - return p5sound.output.gain.value; - }; - /** - *

                          Scale the output of all sound in this sketch

                          - * Scaled between 0.0 (silence) and 1.0 (full volume). - * 1.0 is the maximum amplitude of a digital sound, so multiplying - * by greater than 1.0 may cause digital distortion. To - * fade, provide a rampTime parameter. For more - * complex fades, see the Envelope class. - * - * Alternately, you can pass in a signal source such as an - * oscillator to modulate the amplitude with an audio signal. - * - *

                          How This Works: When you load the p5.sound module, it - * creates a single instance of p5sound. All sound objects in this - * module output to p5sound before reaching your computer's output. - * So if you change the amplitude of p5sound, it impacts all of the - * sound in this module.

                          - * - *

                          If no value is provided, returns a Web Audio API Gain Node

                          - * - * @method outputVolume - * @param {Number|Object} volume Volume (amplitude) between 0.0 - * and 1.0 or modulating signal/oscillator - * @param {Number} [rampTime] Fade for t seconds - * @param {Number} [timeFromNow] Schedule this event to happen at - * t seconds in the future - */ - - p5.prototype.outputVolume = function (vol) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var tFromNow = - arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - if (typeof vol === "number") { - var now = p5sound.audiocontext.currentTime; - var currentVol = p5sound.output.gain.value; - p5sound.output.gain.cancelScheduledValues(now + tFromNow); - p5sound.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); - p5sound.output.gain.linearRampToValueAtTime( - vol, - now + tFromNow + rampTime, - ); - } else if (vol) { - vol.connect(p5sound.output.gain); - } else { - return p5sound.output.gain; - } - }; - /** - * `p5.soundOut` is the p5.sound final output bus. It sends output to - * the destination of this window's web audio context. It contains - * Web Audio API nodes including a dyanmicsCompressor (.limiter), - * and Gain Nodes for .input and .output. - * - * @property {Object} soundOut - */ - - p5.prototype.soundOut = p5.soundOut = p5sound; - - p5.soundOut._silentNode = p5sound.audiocontext.createGain(); - p5.soundOut._silentNode.gain.value = 0; - - p5.soundOut._silentNode.connect(p5sound.audiocontext.destination); - - var main = p5sound; - var processorNames = __webpack_require__(5); - var processorNames_default = __webpack_require__.n(processorNames); - - function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof(obj); - } - - /** - * @for p5 - */ - - /** - * Returns a number representing the sample rate, in samples per second, - * of all sound objects in this audio context. It is determined by the - * sampling rate of your operating system's sound card, and it is not - * currently possile to change. - * It is often 44100, or twice the range of human hearing. - * - * @method sampleRate - * @return {Number} samplerate samples per second - */ - - function sampleRate() { - return main.audiocontext.sampleRate; - } - /** - * Returns the closest MIDI note value for - * a given frequency. - * - * @method freqToMidi - * @param {Number} frequency A freqeuncy, for example, the "A" - * above Middle C is 440Hz - * @return {Number} MIDI note value - */ - - function freqToMidi(f) { - var mathlog2 = Math.log(f / 440) / Math.log(2); - var m = Math.round(12 * mathlog2) + 69; - return m; - } - /** - * Returns the frequency value of a MIDI note value. - * General MIDI treats notes as integers where middle C - * is 60, C# is 61, D is 62 etc. Useful for generating - * musical frequencies with oscillators. - * - * @method midiToFreq - * @param {Number} midiNote The number of a MIDI note - * @return {Number} Frequency value of the given MIDI note - * @example - *
                          - * let midiNotes = [60, 64, 67, 72]; - * let noteIndex = 0; - * let midiVal, freq; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(startSound); - * osc = new p5.TriOsc(); - * env = new p5.Envelope(); - * } - * - * function draw() { - * background(220); - * text('tap to play', 10, 20); - * if (midiVal) { - * text('MIDI: ' + midiVal, 10, 40); - * text('Freq: ' + freq, 10, 60); - * } - * } - * - * function startSound() { - * // see also: userStartAudio(); - * osc.start(); - * - * midiVal = midiNotes[noteIndex % midiNotes.length]; - * freq = midiToFreq(midiVal); - * osc.freq(freq); - * env.ramp(osc, 0, 1.0, 0); - * - * noteIndex++; - * } - *
                          - */ - - function midiToFreq(m) { - return 440 * Math.pow(2, (m - 69) / 12.0); - } - - function noteToFreq(note) { - if (typeof note !== "string") { - return note; - } - - var wholeNotes = { - A: 21, - B: 23, - C: 24, - D: 26, - E: 28, - F: 29, - G: 31, - }; - var value = wholeNotes[note[0].toUpperCase()]; - var octave = ~~note.slice(-1); - value += 12 * (octave - 1); - - switch (note[1]) { - case "#": - value += 1; - break; - - case "b": - value -= 1; - break; - - default: - break; - } - - return midiToFreq(value); - } - /** - * List the SoundFile formats that you will include. LoadSound - * will search your directory for these extensions, and will pick - * a format that is compatable with the client's web browser. - * Here is a free online file - * converter. - * - * @method soundFormats - * @param {String} [...formats] i.e. 'mp3', 'wav', 'ogg' - * @example - *
                          - * function preload() { - * // set the global sound formats - * soundFormats('mp3', 'ogg'); - * - * // load either beatbox.mp3, or .ogg, depending on browser - * mySound = loadSound('assets/beatbox.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * text('sound loaded! tap to play', 10, 20, width - 20); - * cnv.mousePressed(function() { - * mySound.play(); - * }); - * } - *
                          - */ - - function soundFormats() { - main.extensions = []; - - for (var i = 0; i < arguments.length; i++) { - arguments[i] = arguments[i].toLowerCase(); - - if (["mp3", "wav", "ogg", "m4a", "aac"].indexOf(arguments[i]) > -1) { - main.extensions.push(arguments[i]); - } else { - throw arguments[i] + " is not a valid sound format!"; - } - } - } - - function disposeSound() { - for (var i = 0; i < main.soundArray.length; i++) { - main.soundArray[i].dispose(); - } - } - - function _checkFileFormats(paths) { - var path; - - if (typeof paths === "string") { - path = paths; - - var extTest = path.split(".").pop(); - - if (["mp3", "wav", "ogg", "m4a", "aac"].indexOf(extTest) > -1) { - if (!p5.prototype.isFileSupported(extTest)) { - var pathSplit = path.split("."); - var pathCore = pathSplit[pathSplit.length - 1]; - - for (var _i = 0; _i < main.extensions.length; _i++) { - var _extension = main.extensions[_i]; - - var _supported = p5.prototype.isFileSupported(_extension); - - if (_supported) { - pathCore = ""; - - if (pathSplit.length === 2) { - pathCore += pathSplit[0]; - } - - for (var _i2 = 1; _i2 <= pathSplit.length - 2; _i2++) { - var p = pathSplit[_i2]; - pathCore += "." + p; - } - - path = pathCore += "."; - path = path += _extension; - break; - } - } - } - } else { - for (var _i3 = 0; _i3 < main.extensions.length; _i3++) { - var _extension2 = main.extensions[_i3]; - - var _supported2 = p5.prototype.isFileSupported(_extension2); - - if (_supported2) { - path = path + "." + _extension2; - break; - } - } - } - } else if (_typeof(paths) === "object") { - for (var i = 0; i < paths.length; i++) { - var extension = paths[i].split(".").pop(); - var supported = p5.prototype.isFileSupported(extension); - - if (supported) { - path = paths[i]; - break; - } - } - } - - return path; - } - /** - * Used by Osc and Envelope to chain signal math - */ - - function _mathChain(o, math, thisChain, nextChain, type) { - for (var i in o.mathOps) { - if (o.mathOps[i] instanceof type) { - o.mathOps[i].dispose(); - thisChain = i; - - if (thisChain < o.mathOps.length - 1) { - nextChain = o.mathOps[i + 1]; - } - } - } - - o.mathOps[thisChain - 1].disconnect(); - o.mathOps[thisChain - 1].connect(math); - math.connect(nextChain); - o.mathOps[thisChain] = math; - return o; - } - - function convertToWav(audioBuffer) { - var leftChannel, rightChannel; - leftChannel = audioBuffer.getChannelData(0); - - if (audioBuffer.numberOfChannels > 1) { - rightChannel = audioBuffer.getChannelData(1); - } else { - rightChannel = leftChannel; - } - - var interleaved = interleave(leftChannel, rightChannel); - - var buffer = new window.ArrayBuffer(44 + interleaved.length * 2); - var view = new window.DataView(buffer); - - writeUTFBytes(view, 0, "RIFF"); - view.setUint32(4, 36 + interleaved.length * 2, true); - writeUTFBytes(view, 8, "WAVE"); - - writeUTFBytes(view, 12, "fmt "); - view.setUint32(16, 16, true); - view.setUint16(20, 1, true); - - view.setUint16(22, 2, true); - view.setUint32(24, main.audiocontext.sampleRate, true); - view.setUint32(28, main.audiocontext.sampleRate * 4, true); - view.setUint16(32, 4, true); - view.setUint16(34, 16, true); - - writeUTFBytes(view, 36, "data"); - view.setUint32(40, interleaved.length * 2, true); - - var lng = interleaved.length; - var index = 44; - var volume = 1; - - for (var i = 0; i < lng; i++) { - view.setInt16(index, interleaved[i] * (0x7fff * volume), true); - index += 2; - } - - return view; - } - - function interleave(leftChannel, rightChannel) { - var length = leftChannel.length + rightChannel.length; - var result = new Float32Array(length); - var inputIndex = 0; - - for (var index = 0; index < length; ) { - result[index++] = leftChannel[inputIndex]; - result[index++] = rightChannel[inputIndex]; - inputIndex++; - } - - return result; - } - - function writeUTFBytes(view, offset, string) { - var lng = string.length; - - for (var i = 0; i < lng; i++) { - view.setUint8(offset + i, string.charCodeAt(i)); - } - } - - function safeBufferSize(idealBufferSize) { - var bufferSize = idealBufferSize; - - var tempAudioWorkletNode = new AudioWorkletNode( - main.audiocontext, - processorNames_default.a.soundFileProcessor, - ); - - if (tempAudioWorkletNode instanceof ScriptProcessorNode) { - bufferSize = tempAudioWorkletNode.bufferSize; - } - - tempAudioWorkletNode.disconnect(); - tempAudioWorkletNode = null; - return bufferSize; - } - /** - * Save a p5.SoundFile as a .wav file. The browser will prompt the user - * to download the file to their device. - * For uploading audio to a server, use - * `p5.SoundFile.saveBlob`. - * - * @for p5 - * @method saveSound - * @param {p5.SoundFile} soundFile p5.SoundFile that you wish to save - * @param {String} fileName name of the resulting .wav file. - */ - - function saveSound(soundFile, fileName) { - var dataView = convertToWav(soundFile.buffer); - p5.prototype.writeFile([dataView], fileName, "wav"); - } - - var CustomError = function CustomError(name, errorTrace, failedPath) { - var err = new Error(); - var tempStack, splitStack; - err.name = name; - err.originalStack = err.stack + errorTrace; - tempStack = err.stack + errorTrace; - err.failedPath = failedPath; - - splitStack = tempStack.split("\n").filter(function (ln) { - return !ln.match(/(p5.|native code|globalInit)/g); - }); - err.stack = splitStack.join("\n"); - return err; - }; - - var errorHandler = CustomError; - - var moduleSources = [ - __webpack_require__(27)["default"], - __webpack_require__(28)["default"], - __webpack_require__(29)["default"], - ]; - var audioWorklet_ac = main.audiocontext; - var initializedAudioWorklets = false; - - function loadAudioWorkletModules() { - return Promise.all( - moduleSources.map(function (moduleSrc) { - var blob = new Blob([moduleSrc], { - type: "application/javascript", - }); - var objectURL = URL.createObjectURL(blob); - return audioWorklet_ac.audioWorklet.addModule(objectURL); - }), - ); - } - - p5.prototype.registerMethod("init", function () { - if (initializedAudioWorklets) return; - - if (!this.preload && !window.preload) { - this.preload = function () {}; - } - - this._incrementPreload(); - - var onWorkletModulesLoad = function () { - initializedAudioWorklets = true; - - this._decrementPreload(); - }.bind(this); - - loadAudioWorkletModules().then(onWorkletModulesLoad); - }); - function panner_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - - var panner_ac = main.audiocontext; - var panner; - - if (typeof panner_ac.createStereoPanner !== "undefined") { - var Panner = (function () { - function Panner(input, output) { - panner_classCallCheck(this, Panner); - - this.stereoPanner = this.input = panner_ac.createStereoPanner(); - input.connect(this.stereoPanner); - this.stereoPanner.connect(output); - } - - _createClass(Panner, [ - { - key: "pan", - value: function pan(val, tFromNow) { - var time = tFromNow || 0; - var t = panner_ac.currentTime + time; - this.stereoPanner.pan.linearRampToValueAtTime(val, t); - }, - }, - { - key: "inputChannels", - value: function inputChannels() {}, - }, - { - key: "connect", - value: function connect(obj) { - this.stereoPanner.connect(obj); - }, - }, - { - key: "disconnect", - value: function disconnect() { - if (this.stereoPanner) { - this.stereoPanner.disconnect(); - } - }, - }, - ]); - - return Panner; - })(); - - panner = Panner; - } else { - var _Panner = (function () { - function _Panner(input, output, numInputChannels) { - panner_classCallCheck(this, _Panner); - - this.input = panner_ac.createGain(); - input.connect(this.input); - this.left = panner_ac.createGain(); - this.right = panner_ac.createGain(); - this.left.channelInterpretation = "discrete"; - this.right.channelInterpretation = "discrete"; - - if (numInputChannels > 1) { - this.splitter = panner_ac.createChannelSplitter(2); - this.input.connect(this.splitter); - this.splitter.connect(this.left, 1); - this.splitter.connect(this.right, 0); - } else { - this.input.connect(this.left); - this.input.connect(this.right); - } - - this.output = panner_ac.createChannelMerger(2); - this.left.connect(this.output, 0, 1); - this.right.connect(this.output, 0, 0); - this.output.connect(output); - } - - _createClass(_Panner, [ - { - key: "pan", - value: function pan(val, tFromNow) { - var time = tFromNow || 0; - var t = panner_ac.currentTime + time; - var v = (val + 1) / 2; - var rightVal = Math.cos((v * Math.PI) / 2); - var leftVal = Math.sin((v * Math.PI) / 2); - this.left.gain.linearRampToValueAtTime(leftVal, t); - this.right.gain.linearRampToValueAtTime(rightVal, t); - }, - }, - { - key: "inputChannels", - value: function inputChannels(numChannels) { - if (numChannels === 1) { - this.input.disconnect(); - this.input.connect(this.left); - this.input.connect(this.right); - } else if (numChannels === 2) { - if (typeof this.splitter === "undefined") { - this.splitter = panner_ac.createChannelSplitter(2); - } - - this.input.disconnect(); - this.input.connect(this.splitter); - this.splitter.connect(this.left, 1); - this.splitter.connect(this.right, 0); - } - }, - }, - { - key: "connect", - value: function connect(obj) { - this.output.connect(obj); - }, - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - }, - }, - ]); - - return _Panner; - })(); - - panner = _Panner; - } - - var panner_0 = panner; - function soundfile_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - soundfile_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - soundfile_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return soundfile_typeof(obj); - } - - function soundfile_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function soundfile_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - soundfile_defineProperties(Constructor.prototype, protoProps); - if (staticProps) soundfile_defineProperties(Constructor, staticProps); - return Constructor; - } - - function soundfile_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var soundfile_ac = main.audiocontext; - - var _createCounterBuffer = function _createCounterBuffer(buffer) { - var len = buffer.length; - var audioBuf = soundfile_ac.createBuffer( - 1, - buffer.length, - soundfile_ac.sampleRate, - ); - var arrayBuffer = audioBuf.getChannelData(0); - - for (var index = 0; index < len; index++) { - arrayBuffer[index] = index; - } - - return audioBuf; - }; - - var Cue = function Cue(callback, time, id, val) { - soundfile_classCallCheck(this, Cue); - - this.callback = callback; - this.time = time; - this.id = id; - this.val = val; - }; - - function _clearOnEnd(e) { - var thisBufferSourceNode = e.target; - var soundFile = this; - - thisBufferSourceNode._playing = false; - thisBufferSourceNode.removeEventListener("ended", soundFile._clearOnEnd); - - soundFile._onended(soundFile); - - soundFile.bufferSourceNodes - .map(function (_, i) { - return i; - }) - .reverse() - .forEach(function (i) { - var n = soundFile.bufferSourceNodes[i]; - - if (n._playing === false) { - soundFile.bufferSourceNodes.splice(i, 1); - } - }); - - if (soundFile.bufferSourceNodes.length === 0) { - soundFile._playing = false; - } - } - /** - *

                          SoundFile object with a path to a file.

                          - * - *

                          The p5.SoundFile may not be available immediately because - * it loads the file information asynchronously.

                          - * - *

                          To do something with the sound as soon as it loads - * pass the name of a function as the second parameter.

                          - * - *

                          Only one file path is required. However, audio file formats - * (i.e. mp3, ogg, wav and m4a/aac) are not supported by all - * web browsers. If you want to ensure compatability, instead of a single - * file path, you may include an Array of filepaths, and the browser will - * choose a format that works.

                          - * - * @class p5.SoundFile - * @constructor - * @param {String|Array} path path to a sound file (String). Optionally, - * you may include multiple file formats in - * an array. Alternately, accepts an object - * from the HTML5 File API, or a p5.File. - * @param {Function} [successCallback] Name of a function to call once file loads - * @param {Function} [errorCallback] Name of a function to call if file fails to - * load. This function will receive an error or - * XMLHttpRequest object with information - * about what went wrong. - * @param {Function} [whileLoadingCallback] Name of a function to call while file - * is loading. That function will - * receive progress of the request to - * load the sound file - * (between 0 and 1) as its first - * parameter. This progress - * does not account for the additional - * time needed to decode the audio data. - * - * @example - *
                          - * let mySound; - * function preload() { - * soundFormats('mp3', 'ogg'); - * mySound = loadSound('assets/doorbell'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap here to play', 10, 20); - * } - * - * function canvasPressed() { - * // playing a sound file on a user gesture - * // is equivalent to `userStartAudio()` - * mySound.play(); - * } - *
                          - */ - - var soundfile_SoundFile = (function () { - function SoundFile(paths, onload, onerror, whileLoading) { - soundfile_classCallCheck(this, SoundFile); - - if (typeof paths !== "undefined") { - if (typeof paths === "string" || typeof paths[0] === "string") { - var path = p5.prototype._checkFileFormats(paths); - - this.url = path; - } else if (soundfile_typeof(paths) === "object") { - if ( - !( - window.File && - window.FileReader && - window.FileList && - window.Blob - ) - ) { - throw "Unable to load file because the File API is not supported"; - } - } - - if (paths.file) { - paths = paths.file; - } - - this.file = paths; - } - - this._onended = function () {}; - - this._looping = false; - this._playing = false; - this._paused = false; - this._pauseTime = 0; - - this._cues = []; - this._cueIDCounter = 0; - - this._lastPos = 0; - this._counterNode = null; - this._workletNode = null; - - this.bufferSourceNodes = []; - - this.bufferSourceNode = null; - this.buffer = null; - this.playbackRate = 1; - this.input = main.audiocontext.createGain(); - this.output = main.audiocontext.createGain(); - this.reversed = false; - - this.startTime = 0; - this.endTime = null; - this.pauseTime = 0; - - this.mode = "sustain"; - - this.startMillis = null; - - this.panPosition = 0.0; - this.panner = new panner_0(this.output, main.input, 2); - - if (this.url || this.file) { - this.load(onload, onerror); - } - - main.soundArray.push(this); - - if (typeof whileLoading === "function") { - this._whileLoading = whileLoading; - } else { - this._whileLoading = function () {}; - } - - this._clearOnEnd = _clearOnEnd.bind(this); - - this.amp = this.setVolume; - - this.fade = this.setVolume; - } - /** - * This is a helper function that the p5.SoundFile calls to load - * itself. Accepts a callback (the name of another function) - * as an optional parameter. - * - * @private - * @for p5.SoundFile - * @param {Function} [successCallback] Name of a function to call once file loads - * @param {Function} [errorCallback] Name of a function to call if there is an error - */ - - soundfile_createClass(SoundFile, [ - { - key: "load", - value: function load(callback, errorCallback) { - var self = this; - var errorTrace = new Error().stack; - - if (this.url !== undefined && this.url !== "") { - var request = new XMLHttpRequest(); - request.addEventListener( - "progress", - function (evt) { - self._updateProgress(evt); - }, - false, - ); - request.open("GET", this.url, true); - request.responseType = "arraybuffer"; - - request.onload = function () { - if (request.status === 200) { - if (!self.panner) return; - soundfile_ac.decodeAudioData( - request.response, - function (buff) { - if (!self.panner) return; - self.buffer = buff; - self.panner.inputChannels(buff.numberOfChannels); - - if (callback) { - callback(self); - } - }, - function () { - if (!self.panner) return; - var err = new errorHandler( - "decodeAudioData", - errorTrace, - self.url, - ); - var msg = - "AudioContext error at decodeAudioData for " + self.url; - - if (errorCallback) { - err.msg = msg; - errorCallback(err); - } else { - console.error( - msg + - "\n The error stack trace includes: \n" + - err.stack, - ); - } - }, - ); - } else { - if (!self.panner) return; - var err = new errorHandler("loadSound", errorTrace, self.url); - var msg = - "Unable to load " + - self.url + - ". The request status was: " + - request.status + - " (" + - request.statusText + - ")"; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error( - msg + "\n The error stack trace includes: \n" + err.stack, - ); - } - } - }; - - request.onerror = function () { - var err = new errorHandler("loadSound", errorTrace, self.url); - var msg = - "There was no response from the server at " + - self.url + - ". Check the url and internet connectivity."; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error( - msg + "\n The error stack trace includes: \n" + err.stack, - ); - } - }; - - request.send(); - } else if (this.file !== undefined) { - var reader = new FileReader(); - - reader.onload = function () { - if (!self.panner) return; - soundfile_ac.decodeAudioData(reader.result, function (buff) { - if (!self.panner) return; - self.buffer = buff; - self.panner.inputChannels(buff.numberOfChannels); - - if (callback) { - callback(self); - } - }); - }; - - reader.onerror = function (e) { - if (!self.panner) return; - - if (onerror) { - onerror(e); - } - }; - - reader.readAsArrayBuffer(this.file); - } - }, - }, - { - key: "_updateProgress", - value: function _updateProgress(evt) { - if (evt.lengthComputable) { - var percentComplete = (evt.loaded / evt.total) * 0.99; - - this._whileLoading(percentComplete, evt); - } else { - this._whileLoading("size unknown"); - } - }, - /** - * Returns true if the sound file finished loading successfully. - * - * @method isLoaded - * @for p5.SoundFile - * @return {Boolean} - */ - }, - { - key: "isLoaded", - value: function isLoaded() { - if (this.buffer) { - return true; - } else { - return false; - } - }, - /** - * Play the p5.SoundFile - * - * @method play - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule playback to start (in seconds from now). - * @param {Number} [rate] (optional) playback rate - * @param {Number} [amp] (optional) amplitude (volume) - * of playback - * @param {Number} [cueStart] (optional) cue start time in seconds - * @param {Number} [duration] (optional) duration of playback in seconds - */ - }, - { - key: "play", - value: function play(startTime, rate, amp, _cueStart, duration) { - if (!this.output) { - console.warn("SoundFile.play() called after dispose"); - return; - } - - var now = main.audiocontext.currentTime; - var cueStart, cueEnd; - var time = startTime || 0; - - if (time < 0) { - time = 0; - } - - time = time + now; - - if (typeof rate !== "undefined") { - this.rate(rate); - } - - if (typeof amp !== "undefined") { - this.setVolume(amp); - } - - if (this.buffer) { - this._pauseTime = 0; - - if ( - this.mode === "restart" && - this.buffer && - this.bufferSourceNode - ) { - this.bufferSourceNode.stop(time); - - this._counterNode.stop(time); - } - - if (this.mode === "untildone" && this.isPlaying()) { - return; - } - - this.bufferSourceNode = this._initSourceNode(); - - delete this._counterNode; - this._counterNode = this._initCounterNode(); - - if (_cueStart) { - if (_cueStart >= 0 && _cueStart < this.buffer.duration) { - cueStart = _cueStart; - } else { - throw "start time out of range"; - } - } else { - cueStart = 0; - } - - if (duration) { - duration = - duration <= this.buffer.duration - cueStart - ? duration - : this.buffer.duration; - } - - if (this._paused) { - this.bufferSourceNode.start(time, this.pauseTime, duration); - - this._counterNode.start(time, this.pauseTime, duration); - } else { - this.bufferSourceNode.start(time, cueStart, duration); - - this._counterNode.start(time, cueStart, duration); - } - - this._playing = true; - this._paused = false; - - this.bufferSourceNodes.push(this.bufferSourceNode); - this.bufferSourceNode._arrayIndex = - this.bufferSourceNodes.length - 1; - this.bufferSourceNode.addEventListener("ended", this._clearOnEnd); - } else { - throw "not ready to play file, buffer has yet to load. Try preload()"; - } - - this.bufferSourceNode.loop = this._looping; - this._counterNode.loop = this._looping; - - if (this._looping === true) { - cueEnd = duration ? duration : cueStart - 0.000000000000001; - this.bufferSourceNode.loopStart = cueStart; - this.bufferSourceNode.loopEnd = cueEnd; - this._counterNode.loopStart = cueStart; - this._counterNode.loopEnd = cueEnd; - } - }, - /** - * p5.SoundFile has two play modes: restart and - * sustain. Play Mode determines what happens to a - * p5.SoundFile if it is triggered while in the middle of playback. - * In sustain mode, playback will continue simultaneous to the - * new playback. In restart mode, play() will stop playback - * and start over. With untilDone, a sound will play only if it's - * not already playing. Sustain is the default mode. - * - * @method playMode - * @for p5.SoundFile - * @param {String} str 'restart' or 'sustain' or 'untilDone' - * @example - *
                          - * let mySound; - * function preload(){ - * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * noFill(); - * rect(0, height/2, width - 1, height/2 - 1); - * rect(0, 0, width - 1, height/2); - * textAlign(CENTER, CENTER); - * fill(20); - * text('restart', width/2, 1 * height/4); - * text('sustain', width/2, 3 * height/4); - * } - * function canvasPressed() { - * if (mouseX < height/2) { - * mySound.playMode('restart'); - * } else { - * mySound.playMode('sustain'); - * } - * mySound.play(); - * } - * - *
                          - */ - }, - { - key: "playMode", - value: function playMode(str) { - var s = str.toLowerCase(); - - if (s === "restart" && this.buffer && this.bufferSourceNode) { - for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { - var now = main.audiocontext.currentTime; - this.bufferSourceNodes[i].stop(now); - } - } - - if (s === "restart" || s === "sustain" || s === "untildone") { - this.mode = s; - } else { - throw 'Invalid play mode. Must be either "restart" or "sustain"'; - } - }, - /** - * Pauses a file that is currently playing. If the file is not - * playing, then nothing will happen. - * - * After pausing, .play() will resume from the paused - * position. - * If p5.SoundFile had been set to loop before it was paused, - * it will continue to loop after it is unpaused with .play(). - * - * @method pause - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule event to occur - * seconds from now - * @example - *
                          - * let soundFile; - * function preload() { - * soundFormats('ogg', 'mp3'); - * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play, release to pause', 10, 20, width - 20); - * } - * function canvasPressed() { - * soundFile.loop(); - * background(0, 200, 50); - * } - * function mouseReleased() { - * soundFile.pause(); - * background(220); - * } - * - *
                          - */ - }, - { - key: "pause", - value: function pause(startTime) { - var now = main.audiocontext.currentTime; - var time = startTime || 0; - var pTime = time + now; - - if (this.isPlaying() && this.buffer && this.bufferSourceNode) { - this._paused = true; - this._playing = false; - this.pauseTime = this.currentTime(); - this.bufferSourceNode.stop(pTime); - - this._counterNode.stop(pTime); - - this._pauseTime = this.currentTime(); - } else { - this._pauseTime = 0; - } - }, - /** - * Loop the p5.SoundFile. Accepts optional parameters to set the - * playback rate, playback volume, loopStart, loopEnd. - * - * @method loop - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule event to occur - * seconds from now - * @param {Number} [rate] (optional) playback rate - * @param {Number} [amp] (optional) playback volume - * @param {Number} [cueLoopStart] (optional) startTime in seconds - * @param {Number} [duration] (optional) loop duration in seconds - * @example - *
                          - * let soundFile; - * let loopStart = 0.5; - * let loopDuration = 0.2; - * function preload() { - * soundFormats('ogg', 'mp3'); - * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play, release to pause', 10, 20, width - 20); - * } - * function canvasPressed() { - * soundFile.loop(); - * background(0, 200, 50); - * } - * function mouseReleased() { - * soundFile.pause(); - * background(220); - * } - * - *
                          - */ - }, - { - key: "loop", - value: function loop(startTime, rate, amp, loopStart, duration) { - this._looping = true; - this.play(startTime, rate, amp, loopStart, duration); - }, - /** - * Set a p5.SoundFile's looping flag to true or false. If the sound - * is currently playing, this change will take effect when it - * reaches the end of the current playback. - * - * @method setLoop - * @for p5.SoundFile - * @param {Boolean} Boolean set looping to true or false - */ - }, - { - key: "setLoop", - value: function setLoop(bool) { - if (bool === true) { - this._looping = true; - } else if (bool === false) { - this._looping = false; - } else { - throw "Error: setLoop accepts either true or false"; - } - - if (this.bufferSourceNode) { - this.bufferSourceNode.loop = this._looping; - this._counterNode.loop = this._looping; - } - }, - /** - * Returns 'true' if a p5.SoundFile is currently looping and playing, 'false' if not. - * - * @method isLooping - * @for p5.SoundFile - * @return {Boolean} - */ - }, - { - key: "isLooping", - value: function isLooping() { - if (!this.bufferSourceNode) { - return false; - } - - if (this._looping === true && this.isPlaying() === true) { - return true; - } - - return false; - }, - /** - * Returns true if a p5.SoundFile is playing, false if not (i.e. - * paused or stopped). - * - * @method isPlaying - * @for p5.SoundFile - * @return {Boolean} - */ - }, - { - key: "isPlaying", - value: function isPlaying() { - return this._playing; - }, - /** - * Returns true if a p5.SoundFile is paused, false if not (i.e. - * playing or stopped). - * - * @method isPaused - * @for p5.SoundFile - * @return {Boolean} - */ - }, - { - key: "isPaused", - value: function isPaused() { - return this._paused; - }, - /** - * Stop soundfile playback. - * - * @method stop - * @for p5.SoundFile - * @param {Number} [startTime] (optional) schedule event to occur - * in seconds from now - */ - }, - { - key: "stop", - value: function stop(timeFromNow) { - var time = timeFromNow || 0; - - if (this.mode === "sustain" || this.mode === "untildone") { - this.stopAll(time); - this._playing = false; - this.pauseTime = 0; - this._paused = false; - } else if (this.buffer && this.bufferSourceNode) { - var now = main.audiocontext.currentTime; - var t = time || 0; - this.pauseTime = 0; - this.bufferSourceNode.stop(now + t); - - this._counterNode.stop(now + t); - - this._playing = false; - this._paused = false; - } - }, - /** - * Stop playback on all of this soundfile's sources. - * @private - */ - }, - { - key: "stopAll", - value: function stopAll(_time) { - var now = main.audiocontext.currentTime; - var time = _time || 0; - - if (this.buffer && this.bufferSourceNode) { - for (var i in this.bufferSourceNodes) { - var bufferSourceNode = this.bufferSourceNodes[i]; - - if (bufferSourceNode) { - try { - bufferSourceNode.stop(now + time); - } catch (e) {} - } - } - - this._counterNode.stop(now + time); - } - }, - }, - { - key: "getVolume", - value: function getVolume() { - return this.output.gain.value; - }, - /** - * Set the stereo panning of a p5.sound object to - * a floating point number between -1.0 (left) and 1.0 (right). - * Default is 0.0 (center). - * - * @method pan - * @for p5.SoundFile - * @param {Number} [panValue] Set the stereo panner - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @example - *
                          - * let ballX = 0; - * let soundFile; - * - * function preload() { - * soundFormats('ogg', 'mp3'); - * soundFile = loadSound('assets/beatbox.mp3'); - * } - * - * function draw() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * ballX = constrain(mouseX, 0, width); - * ellipse(ballX, height/2, 20, 20); - * } - * - * function canvasPressed(){ - * // map the ball's x location to a panning degree - * // between -1.0 (left) and 1.0 (right) - * let panning = map(ballX, 0., width,-1.0, 1.0); - * soundFile.pan(panning); - * soundFile.play(); - * } - *
                          - */ - }, - { - key: "pan", - value: function pan(pval, tFromNow) { - this.panPosition = pval; - this.panner.pan(pval, tFromNow); - }, - /** - * Returns the current stereo pan position (-1.0 to 1.0) - * - * @method getPan - * @for p5.SoundFile - * @return {Number} Returns the stereo pan setting of the Oscillator - * as a number between -1.0 (left) and 1.0 (right). - * 0.0 is center and default. - */ - }, - { - key: "getPan", - value: function getPan() { - return this.panPosition; - }, - /** - * Set the playback rate of a sound file. Will change the speed and the pitch. - * Values less than zero will reverse the audio buffer. - * - * @method rate - * @for p5.SoundFile - * @param {Number} [playbackRate] Set the playback rate. 1.0 is normal, - * .5 is half-speed, 2.0 is twice as fast. - * Values less than zero play backwards. - * @example - *
                          - * let mySound; - * - * function preload() { - * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * } - * function canvasPressed() { - * mySound.loop(); - * } - * function mouseReleased() { - * mySound.pause(); - * } - * function draw() { - * background(220); - * - * // Set the rate to a range between 0.1 and 4 - * // Changing the rate also alters the pitch - * let playbackRate = map(mouseY, 0.1, height, 2, 0); - * playbackRate = constrain(playbackRate, 0.01, 4); - * mySound.rate(playbackRate); - * - * line(0, mouseY, width, mouseY); - * text('rate: ' + round(playbackRate * 100) + '%', 10, 20); - * } - * - * - *
                          - * - */ - }, - { - key: "rate", - value: function rate(playbackRate) { - var reverse = false; - - if (typeof playbackRate === "undefined") { - return this.playbackRate; - } - - this.playbackRate = playbackRate; - - if (playbackRate === 0) { - playbackRate = 0.0000000000001; - } else if (playbackRate < 0 && !this.reversed) { - playbackRate = Math.abs(playbackRate); - reverse = true; - } else if (playbackRate > 0 && this.reversed) { - reverse = true; - } - - if (this.bufferSourceNode) { - var now = main.audiocontext.currentTime; - this.bufferSourceNode.playbackRate.cancelScheduledValues(now); - this.bufferSourceNode.playbackRate.linearRampToValueAtTime( - Math.abs(playbackRate), - now, - ); - - this._counterNode.playbackRate.cancelScheduledValues(now); - - this._counterNode.playbackRate.linearRampToValueAtTime( - Math.abs(playbackRate), - now, - ); - } - - if (reverse) { - this.reverseBuffer(); - } - - return this.playbackRate; - }, - }, - { - key: "setPitch", - value: function setPitch(num) { - var newPlaybackRate = midiToFreq(num) / midiToFreq(60); - this.rate(newPlaybackRate); - }, - }, - { - key: "getPlaybackRate", - value: function getPlaybackRate() { - return this.playbackRate; - }, - /** - * Multiply the output volume (amplitude) of a sound file - * between 0.0 (silence) and 1.0 (full volume). - * 1.0 is the maximum amplitude of a digital sound, so multiplying - * by greater than 1.0 may cause digital distortion. To - * fade, provide a rampTime parameter. For more - * complex fades, see the Envelope class. - * - * Alternately, you can pass in a signal source such as an - * oscillator to modulate the amplitude with an audio signal. - * - * @method setVolume - * @for p5.SoundFile - * @param {Number|Object} volume Volume (amplitude) between 0.0 - * and 1.0 or modulating signal/oscillator - * @param {Number} [rampTime] Fade for t seconds - * @param {Number} [timeFromNow] Schedule this event to happen at - * t seconds in the future - */ - }, - { - key: "setVolume", - value: function setVolume(vol, _rampTime, _tFromNow) { - if (typeof vol === "number") { - var rampTime = _rampTime || 0; - var tFromNow = _tFromNow || 0; - var now = main.audiocontext.currentTime; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(now + tFromNow); - this.output.gain.linearRampToValueAtTime( - currentVol, - now + tFromNow, - ); - this.output.gain.linearRampToValueAtTime( - vol, - now + tFromNow + rampTime, - ); - } else if (vol) { - vol.connect(this.output.gain); - } else { - return this.output.gain; - } - }, - /** - * Returns the duration of a sound file in seconds. - * - * @method duration - * @for p5.SoundFile - * @return {Number} The duration of the soundFile in seconds. - */ - }, - { - key: "duration", - value: function duration() { - if (this.buffer) { - return this.buffer.duration; - } else { - return 0; - } - }, - /** - * Return the current position of the p5.SoundFile playhead, in seconds. - * Time is relative to the normal buffer direction, so if `reverseBuffer` - * has been called, currentTime will count backwards. - * - * @method currentTime - * @for p5.SoundFile - * @return {Number} currentTime of the soundFile in seconds. - */ - }, - { - key: "currentTime", - value: function currentTime() { - return this.reversed - ? Math.abs(this._lastPos - this.buffer.length) / - soundfile_ac.sampleRate - : this._lastPos / soundfile_ac.sampleRate; - }, - /** - * Move the playhead of a soundfile that is currently playing to a - * new position and a new duration, in seconds. - * If none are given, will reset the file to play entire duration - * from start to finish. To set the position of a soundfile that is - * not currently playing, use the `play` or `loop` methods. - * - * @method jump - * @for p5.SoundFile - * @param {Number} cueTime cueTime of the soundFile in seconds. - * @param {Number} duration duration in seconds. - */ - }, - { - key: "jump", - value: function jump(cueTime, duration) { - if (cueTime < 0 || cueTime > this.buffer.duration) { - throw "jump time out of range"; - } - - if (duration > this.buffer.duration - cueTime) { - throw "end time out of range"; - } - - var cTime = cueTime || 0; - var dur = duration || undefined; - - if (this.isPlaying()) { - this.stop(0); - this.play( - 0, - this.playbackRate, - this.output.gain.value, - cTime, - dur, - ); - } - }, - /** - * Return the number of channels in a sound file. - * For example, Mono = 1, Stereo = 2. - * - * @method channels - * @for p5.SoundFile - * @return {Number} [channels] - */ - }, - { - key: "channels", - value: function channels() { - return this.buffer.numberOfChannels; - }, - /** - * Return the sample rate of the sound file. - * - * @method sampleRate - * @for p5.SoundFile - * @return {Number} [sampleRate] - */ - }, - { - key: "sampleRate", - value: function sampleRate() { - return this.buffer.sampleRate; - }, - /** - * Return the number of samples in a sound file. - * Equal to sampleRate * duration. - * - * @method frames - * @for p5.SoundFile - * @return {Number} [sampleCount] - */ - }, - { - key: "frames", - value: function frames() { - return this.buffer.length; - }, - /** - * Returns an array of amplitude peaks in a p5.SoundFile that can be - * used to draw a static waveform. Scans through the p5.SoundFile's - * audio buffer to find the greatest amplitudes. Accepts one - * parameter, 'length', which determines size of the array. - * Larger arrays result in more precise waveform visualizations. - * - * Inspired by Wavesurfer.js. - * - * @method getPeaks - * @for p5.SoundFile - * @params {Number} [length] length is the size of the returned array. - * Larger length results in more precision. - * Defaults to 5*width of the browser window. - * @returns {Float32Array} Array of peaks. - */ - }, - { - key: "getPeaks", - value: function getPeaks(length) { - if (this.buffer) { - if (!length) { - length = window.width * 5; - } - - if (this.buffer) { - var buffer = this.buffer; - var sampleSize = buffer.length / length; - var sampleStep = ~~(sampleSize / 10) || 1; - var channels = buffer.numberOfChannels; - var peaks = new Float32Array(Math.round(length)); - - for (var c = 0; c < channels; c++) { - var chan = buffer.getChannelData(c); - - for (var i = 0; i < length; i++) { - var start = ~~(i * sampleSize); - var end = ~~(start + sampleSize); - var max = 0; - - for (var j = start; j < end; j += sampleStep) { - var value = chan[j]; - - if (value > max) { - max = value; - } else if (-value > max) { - max = value; - } - } - - if (c === 0 || Math.abs(max) > peaks[i]) { - peaks[i] = max; - } - } - } - - return peaks; - } - } else { - throw "Cannot load peaks yet, buffer is not loaded"; - } - }, - /** - * Reverses the p5.SoundFile's buffer source. - * Playback must be handled separately (see example). - * - * @method reverseBuffer - * @for p5.SoundFile - * @example - *
                          - * let drum; - * function preload() { - * drum = loadSound('assets/drum.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function canvasPressed() { - * drum.stop(); - * drum.reverseBuffer(); - * drum.play(); - * } - * - *
                          - */ - }, - { - key: "reverseBuffer", - value: function reverseBuffer() { - if (this.buffer) { - var currentPos = this._lastPos / soundfile_ac.sampleRate; - var curVol = this.getVolume(); - this.setVolume(0, 0.001); - var numChannels = this.buffer.numberOfChannels; - - for (var i = 0; i < numChannels; i++) { - this.buffer.getChannelData(i).reverse(); - } - - this.reversed = !this.reversed; - - if (this.isPlaying() && currentPos) { - this.jump(this.duration() - currentPos); - } - - this.setVolume(curVol, 0.001); - } else { - throw "SoundFile is not done loading"; - } - }, - /** - * Schedule an event to be called when the soundfile - * reaches the end of a buffer. If the soundfile is - * playing through once, this will be called when it - * ends. If it is looping, it will be called when - * stop is called. - * - * @method onended - * @for p5.SoundFile - * @param {Function} callback function to call when the - * soundfile has ended. - */ - }, - { - key: "onended", - value: function onended(callback) { - this._onended = callback; - return this; - }, - }, - { - key: "add", - value: function add() {}, - }, - { - key: "dispose", - value: function dispose() { - var now = main.audiocontext.currentTime; - - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.stop(now); - - if (this.buffer && this.bufferSourceNode) { - for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { - if (this.bufferSourceNodes[i] !== null) { - this.bufferSourceNodes[i].disconnect(); - - try { - this.bufferSourceNodes[i].stop(now); - } catch (e) { - console.warn("no buffer source node to dispose"); - } - - this.bufferSourceNodes[i] = null; - } - } - - if (this.isPlaying()) { - try { - this._counterNode.stop(now); - } catch (e) { - console.log(e); - } - - this._counterNode = null; - } - } - - if (this.output) { - this.output.disconnect(); - this.output = null; - } - - if (this.panner) { - this.panner.disconnect(); - this.panner = null; - } - }, - /** - * Connects the output of a p5sound object to input of another - * p5.sound object. For example, you may connect a p5.SoundFile to an - * FFT or an Effect. If no parameter is given, it will connect to - * the main output. Most p5sound objects connect to the master - * output when they are created. - * - * @method connect - * @for p5.SoundFile - * @param {Object} [object] Audio object that accepts an input - */ - }, - { - key: "connect", - value: function connect(unit) { - if (!unit) { - this.panner.connect(main.input); - } else { - if (unit.hasOwnProperty("input")) { - this.panner.connect(unit.input); - } else { - this.panner.connect(unit); - } - } - }, - /** - * Disconnects the output of this p5sound object. - * - * @method disconnect - * @for p5.SoundFile - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.panner) { - this.panner.disconnect(); - } - }, - /** - */ - }, - { - key: "getLevel", - value: function getLevel() { - console.warn( - "p5.SoundFile.getLevel has been removed from the library. Use p5.Amplitude instead", - ); - }, - /** - * Reset the source for this SoundFile to a - * new path (URL). - * - * @method setPath - * @for p5.SoundFile - * @param {String} path path to audio file - * @param {Function} callback Callback - */ - }, - { - key: "setPath", - value: function setPath(p, callback) { - var path = p5.prototype._checkFileFormats(p); - - this.url = path; - this.load(callback); - }, - /** - * Replace the current Audio Buffer with a new Buffer. - * - * @method setBuffer - * @for p5.SoundFile - * @param {Array} buf Array of Float32 Array(s). 2 Float32 Arrays - * will create a stereo source. 1 will create - * a mono source. - */ - }, - { - key: "setBuffer", - value: function setBuffer(buf) { - var numChannels = buf.length; - var size = buf[0].length; - var newBuffer = soundfile_ac.createBuffer( - numChannels, - size, - soundfile_ac.sampleRate, - ); - - if (!(buf[0] instanceof Float32Array)) { - buf[0] = new Float32Array(buf[0]); - } - - for (var channelNum = 0; channelNum < numChannels; channelNum++) { - var channel = newBuffer.getChannelData(channelNum); - channel.set(buf[channelNum]); - } - - this.buffer = newBuffer; - - this.panner.inputChannels(numChannels); - }, - }, - { - key: "_initCounterNode", - value: function _initCounterNode() { - var _this = this; - - var self = this; - var now = soundfile_ac.currentTime; - var cNode = soundfile_ac.createBufferSource(); - var workletBufferSize = safeBufferSize(256); - - if (self._workletNode) { - self._workletNode.disconnect(); - - delete self._workletNode; - } - - self._workletNode = new AudioWorkletNode( - soundfile_ac, - processorNames_default.a.soundFileProcessor, - { - processorOptions: { - bufferSize: workletBufferSize, - }, - }, - ); - - self._workletNode.port.onmessage = function (event) { - if (event.data.name === "position") { - if (event.data.position === 0) { - return; - } - - _this._lastPos = event.data.position; - - _this._onTimeUpdate(self._lastPos); - } - }; - - cNode.buffer = _createCounterBuffer(self.buffer); - cNode.playbackRate.setValueAtTime(self.playbackRate, now); - cNode.connect(self._workletNode); - - self._workletNode.connect(p5.soundOut._silentNode); - - return cNode; - }, - }, - { - key: "_initSourceNode", - value: function _initSourceNode() { - var bufferSourceNode = soundfile_ac.createBufferSource(); - bufferSourceNode.buffer = this.buffer; - bufferSourceNode.playbackRate.value = this.playbackRate; - bufferSourceNode.connect(this.output); - return bufferSourceNode; - }, - }, - { - key: "processPeaks", - value: function processPeaks( - callback, - _initThreshold, - _minThreshold, - _minPeaks, - ) { - console.warn("processPeaks is deprecated"); - }, - /** - * Schedule events to trigger every time a MediaElement - * (audio/video) reaches a playback cue point. - * - * Accepts a callback function, a time (in seconds) at which to trigger - * the callback, and an optional parameter for the callback. - * - * Time will be passed as the first parameter to the callback function, - * and param will be the second parameter. - * - * - * @method addCue - * @for p5.SoundFile - * @param {Number} time Time in seconds, relative to this media - * element's playback. For example, to trigger - * an event every time playback reaches two - * seconds, pass in the number 2. This will be - * passed as the first parameter to - * the callback function. - * @param {Function} callback Name of a function that will be - * called at the given time. The callback will - * receive time and (optionally) param as its - * two parameters. - * @param {Object} [value] An object to be passed as the - * second parameter to the - * callback function. - * @return {Number} id ID of this cue, - * useful for removeCue(id) - * @example - *
                          - * let mySound; - * function preload() { - * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to play', 10, 20); - * - * // schedule calls to changeText - * mySound.addCue(0, changeText, "hello" ); - * mySound.addCue(0.5, changeText, "hello," ); - * mySound.addCue(1, changeText, "hello, p5!"); - * mySound.addCue(1.5, changeText, "hello, p5!!"); - * mySound.addCue(2, changeText, "hello, p5!!!!!"); - * } - * - * function changeText(val) { - * background(220); - * text(val, 10, 20); - * } - * - * function canvasPressed() { - * mySound.play(); - * } - *
                          - */ - }, - { - key: "addCue", - value: function addCue(time, callback, val) { - var id = this._cueIDCounter++; - var cue = new Cue(callback, time, id, val); - - this._cues.push(cue); - - return id; - }, - /** - * Remove a callback based on its ID. The ID is returned by the - * addCue method. - * - * @method removeCue - * @for p5.SoundFile - * @param {Number} id ID of the cue, as returned by addCue - */ - }, - { - key: "removeCue", - value: function removeCue(id) { - var cueLength = this._cues.length; - - for (var i = 0; i < cueLength; i++) { - var cue = this._cues[i]; - - if (cue.id === id) { - this._cues.splice(i, 1); - - break; - } - } - - if (this._cues.length === 0) { - } - }, - /** - * Remove all of the callbacks that had originally been scheduled - * via the addCue method. - * - * @method clearCues - */ - }, - { - key: "clearCues", - value: function clearCues() { - this._cues = []; - }, - }, - { - key: "_onTimeUpdate", - value: function _onTimeUpdate(position) { - var playbackTime = position / this.buffer.sampleRate; - var cueLength = this._cues.length; - - for (var i = 0; i < cueLength; i++) { - var cue = this._cues[i]; - var callbackTime = cue.time; - var val = cue.val; - var leftLimit = this._prevUpdateTime || 0; - var rightLimit = playbackTime; - - if (leftLimit <= callbackTime && callbackTime <= rightLimit) { - cue.callback(val); - } - } - - this._prevUpdateTime = playbackTime; - }, - /** - * Save a p5.SoundFile as a .wav file. The browser will prompt the user - * to download the file to their device. To upload a file to a server, see - * getBlob - * - * @method save - * @for p5.SoundFile - * @param {String} [fileName] name of the resulting .wav file. - * @example - *
                          - * let mySound; - * function preload() { - * mySound = loadSound('assets/doorbell.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap to download', 10, 20); - * } - * - * function canvasPressed() { - * mySound.save('my cool filename'); - * } - *
                          - */ - }, - { - key: "save", - value: function save(fileName) { - p5.prototype.saveSound(this, fileName, "wav"); - }, - /** - * This method is useful for sending a SoundFile to a server. It returns the - * .wav-encoded audio data as a "Blob". - * A Blob is a file-like data object that can be uploaded to a server - * with an http request. We'll - * use the `httpDo` options object to send a POST request with some - * specific options: we encode the request as `multipart/form-data`, - * and attach the blob as one of the form values using `FormData`. - * - * - * @method getBlob - * @for p5.SoundFile - * @returns {Blob} A file-like data object - * @example - *
                          - * function preload() { - * mySound = loadSound('assets/doorbell.mp3'); - * } - * - * function setup() { - * noCanvas(); - * let soundBlob = mySound.getBlob(); - * - * // Now we can send the blob to a server... - * let serverUrl = 'https://jsonplaceholder.typicode.com/posts'; - * let httpRequestOptions = { - * method: 'POST', - * body: new FormData().append('soundBlob', soundBlob), - * headers: new Headers({ - * 'Content-Type': 'multipart/form-data' - * }) - * }; - * httpDo(serverUrl, httpRequestOptions); - * - * // We can also create an `ObjectURL` pointing to the Blob - * let blobUrl = URL.createObjectURL(soundBlob); - * - * // The `
                          - */ - }, - { - key: "getBlob", - value: function getBlob() { - var dataView = convertToWav(this.buffer); - return new Blob([dataView], { - type: "audio/wav", - }); - }, - }, - ]); - - return SoundFile; - })(); - /** - * loadSound() returns a new p5.SoundFile from a specified - * path. If called during preload(), the p5.SoundFile will be ready - * to play in time for setup() and draw(). If called outside of - * preload, the p5.SoundFile will not be ready immediately, so - * loadSound accepts a callback as the second parameter. Using a - * - * local server is recommended when loading external files. - * - * @method loadSound - * @for p5 - * @param {String|Array} path Path to the sound file, or an array with - * paths to soundfiles in multiple formats - * i.e. ['sound.ogg', 'sound.mp3']. - * Alternately, accepts an object: either - * from the HTML5 File API, or a p5.File. - * @param {Function} [successCallback] Name of a function to call once file loads - * @param {Function} [errorCallback] Name of a function to call if there is - * an error loading the file. - * @param {Function} [whileLoading] Name of a function to call while file is loading. - * This function will receive the percentage loaded - * so far, from 0.0 to 1.0. - * @return {SoundFile} Returns a p5.SoundFile - * @example - *
                          - * let mySound; - * function preload() { - * soundFormats('mp3', 'ogg'); - * mySound = loadSound('assets/doorbell'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * text('tap here to play', 10, 20); - * } - * - * function canvasPressed() { - * // playing a sound file on a user gesture - * // is equivalent to `userStartAudio()` - * mySound.play(); - * } - *
                          - */ - - function loadSound(path, callback, onerror, whileLoading) { - if ( - window.location.origin.indexOf("file://") > -1 && - window.cordova === "undefined" - ) { - window.alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ); - } - - var self = this; - var s = new soundfile_SoundFile( - path, - function () { - if (typeof callback === "function") { - callback.apply(self, arguments); - } - - if (typeof self._decrementPreload === "function") { - self._decrementPreload(); - } - }, - onerror, - whileLoading, - ); - return s; - } - - var soundfile = soundfile_SoundFile; - - function amplitude_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function amplitude_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function amplitude_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - amplitude_defineProperties(Constructor.prototype, protoProps); - if (staticProps) amplitude_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * Amplitude measures volume between 0.0 and 1.0. - * Listens to all p5sound by default, or use setInput() - * to listen to a specific sound source. Accepts an optional - * smoothing value, which defaults to 0. - * - * @class p5.Amplitude - * @constructor - * @param {Number} [smoothing] between 0.0 and .999 to smooth - * amplitude readings (defaults to 0) - * @example - *
                          - * let sound, amplitude; - * - * function preload(){ - * sound = loadSound('assets/beat.mp3'); - * } - * function setup() { - * let cnv = createCanvas(100,100); - * cnv.mouseClicked(togglePlay); - * amplitude = new p5.Amplitude(); - * } - * - * function draw() { - * background(220); - * text('tap to play', 20, 20); - * - * let level = amplitude.getLevel(); - * let size = map(level, 0, 1, 0, 200); - * ellipse(width/2, height/2, size, size); - * } - * - * function togglePlay() { - * if (sound.isPlaying() ){ - * sound.pause(); - * } else { - * sound.loop(); - * amplitude = new p5.Amplitude(); - * amplitude.setInput(sound); - * } - * } - * - *
                          - */ - - var amplitude_Amplitude = (function () { - function Amplitude(smoothing) { - amplitude_classCallCheck(this, Amplitude); - - this.bufferSize = safeBufferSize(2048); - - this.audiocontext = main.audiocontext; - this._workletNode = new AudioWorkletNode( - this.audiocontext, - processorNames_default.a.amplitudeProcessor, - { - outputChannelCount: [1], - parameterData: { - smoothing: smoothing || 0, - }, - processorOptions: { - normalize: false, - smoothing: smoothing || 0, - numInputChannels: 2, - bufferSize: this.bufferSize, - }, - }, - ); - - this._workletNode.port.onmessage = function (event) { - if (event.data.name === "amplitude") { - this.volume = event.data.volume; - this.volNorm = event.data.volNorm; - this.stereoVol = event.data.stereoVol; - this.stereoVolNorm = event.data.stereoVolNorm; - } - }.bind(this); - - this.input = this._workletNode; - this.output = this.audiocontext.createGain(); - - this.volume = 0; - this.volNorm = 0; - this.stereoVol = [0, 0]; - this.stereoVolNorm = [0, 0]; - this.normalize = false; - - this._workletNode.connect(this.output); - - this.output.gain.value = 0; - - this.output.connect(this.audiocontext.destination); - - main.meter.connect(this._workletNode); - - main.soundArray.push(this); - } - /** - * Connects to the p5sound instance (main output) by default. - * Optionally, you can pass in a specific source (i.e. a soundfile). - * - * @method setInput - * @for p5.Amplitude - * @param {soundObject|undefined} [snd] set the sound source - * (optional, defaults to - * main output) - * @param {Number|undefined} [smoothing] a range between 0.0 and 1.0 - * to smooth amplitude readings - * @example - *
                          - * function preload(){ - * sound1 = loadSound('assets/beat.mp3'); - * sound2 = loadSound('assets/drum.mp3'); - * } - * function setup(){ - * cnv = createCanvas(100, 100); - * cnv.mouseClicked(toggleSound); - * - * amplitude = new p5.Amplitude(); - * amplitude.setInput(sound2); - * } - * - * function draw() { - * background(220); - * text('tap to play', 20, 20); - * - * let level = amplitude.getLevel(); - * let size = map(level, 0, 1, 0, 200); - * ellipse(width/2, height/2, size, size); - * } - * - * function toggleSound(){ - * if (sound1.isPlaying() && sound2.isPlaying()) { - * sound1.stop(); - * sound2.stop(); - * } else { - * sound1.play(); - * sound2.play(); - * } - * } - *
                          - */ - - amplitude_createClass(Amplitude, [ - { - key: "setInput", - value: function setInput(source, smoothing) { - main.meter.disconnect(); - - if (smoothing) { - this._workletNode.parameters.get("smoothing").value = smoothing; - } - - if (source == null) { - console.log( - "Amplitude input source is not ready! Connecting to main output instead", - ); - main.meter.connect(this._workletNode); - } else if (source) { - source.connect(this._workletNode); - - this._workletNode.disconnect(); - - this._workletNode.connect(this.output); - } else { - main.meter.connect(this._workletNode); - } - }, - }, - { - key: "connect", - value: function connect(unit) { - if (unit) { - if (unit.hasOwnProperty("input")) { - this.output.connect(unit.input); - } else { - this.output.connect(unit); - } - } else { - this.output.connect(this.panner.connect(main.input)); - } - }, - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - }, - /** - * Returns a single Amplitude reading at the moment it is called. - * For continuous readings, run in the draw loop. - * - * @method getLevel - * @for p5.Amplitude - * @param {Number} [channel] Optionally return only channel 0 (left) or 1 (right) - * @return {Number} Amplitude as a number between 0.0 and 1.0 - * @example - *
                          - * function preload(){ - * sound = loadSound('assets/beat.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mouseClicked(toggleSound); - * amplitude = new p5.Amplitude(); - * } - * - * function draw() { - * background(220, 150); - * textAlign(CENTER); - * text('tap to play', width/2, 20); - * - * let level = amplitude.getLevel(); - * let size = map(level, 0, 1, 0, 200); - * ellipse(width/2, height/2, size, size); - * } - * - * function toggleSound(){ - * if (sound.isPlaying()) { - * sound.stop(); - * } else { - * sound.play(); - * } - * } - *
                          - */ - }, - { - key: "getLevel", - value: function getLevel(channel) { - if (typeof channel !== "undefined") { - if (this.normalize) { - return this.stereoVolNorm[channel]; - } else { - return this.stereoVol[channel]; - } - } else if (this.normalize) { - return this.volNorm; - } else { - return this.volume; - } - }, - /** - * Determines whether the results of Amplitude.process() will be - * Normalized. To normalize, Amplitude finds the difference the - * loudest reading it has processed and the maximum amplitude of - * 1.0. Amplitude adds this difference to all values to produce - * results that will reliably map between 0.0 and 1.0. However, - * if a louder moment occurs, the amount that Normalize adds to - * all the values will change. Accepts an optional boolean parameter - * (true or false). Normalizing is off by default. - * - * @method toggleNormalize - * @for p5.Amplitude - * @param {boolean} [boolean] set normalize to true (1) or false (0) - */ - }, - { - key: "toggleNormalize", - value: function toggleNormalize(bool) { - if (typeof bool === "boolean") { - this.normalize = bool; - } else { - this.normalize = !this.normalize; - } - - this._workletNode.port.postMessage({ - name: "toggleNormalize", - normalize: this.normalize, - }); - }, - /** - * Smooth Amplitude analysis by averaging with the last analysis - * frame. Off by default. - * - * @method smooth - * @for p5.Amplitude - * @param {Number} set smoothing from 0.0 <= 1 - */ - }, - { - key: "smooth", - value: function smooth(s) { - if (s >= 0 && s < 1) { - this._workletNode.port.postMessage({ - name: "smoothing", - smoothing: s, - }); - } else { - console.log("Error: smoothing must be between 0 and 1"); - } - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.input) { - this.input.disconnect(); - delete this.input; - } - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - - this._workletNode.disconnect(); - - delete this._workletNode; - }, - }, - ]); - - return Amplitude; - })(); - - var amplitude = amplitude_Amplitude; - function fft_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function fft_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function fft_createClass(Constructor, protoProps, staticProps) { - if (protoProps) fft_defineProperties(Constructor.prototype, protoProps); - if (staticProps) fft_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - *

                          FFT (Fast Fourier Transform) is an analysis algorithm that - * isolates individual - * - * audio frequencies within a waveform.

                          - * - *

                          Once instantiated, a p5.FFT object can return an array based on - * two types of analyses:
                          FFT.waveform() computes - * amplitude values along the time domain. The array indices correspond - * to samples across a brief moment in time. Each value represents - * amplitude of the waveform at that sample of time.
                          - * • FFT.analyze() computes amplitude values along the - * frequency domain. The array indices correspond to frequencies (i.e. - * pitches), from the lowest to the highest that humans can hear. Each - * value represents amplitude at that slice of the frequency spectrum. - * Use with getEnergy() to measure amplitude at specific - * frequencies, or within a range of frequencies.

                          - * - *

                          FFT analyzes a very short snapshot of sound called a sample - * buffer. It returns an array of amplitude measurements, referred - * to as bins. The array is 1024 bins long by default. - * You can change the bin array length, but it must be a power of 2 - * between 16 and 1024 in order for the FFT algorithm to function - * correctly. The actual size of the FFT buffer is twice the - * number of bins, so given a standard sample rate, the buffer is - * 2048/44100 seconds long.

                          - * - * - * @class p5.FFT - * @constructor - * @param {Number} [smoothing] Smooth results of Freq Spectrum. - * 0.0 < smoothing < 1.0. - * Defaults to 0.8. - * @param {Number} [bins] Length of resulting array. - * Must be a power of two between - * 16 and 1024. Defaults to 1024. - * @example - *
                          - * function preload(){ - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup(){ - * let cnv = createCanvas(100,100); - * cnv.mouseClicked(togglePlay); - * fft = new p5.FFT(); - * sound.amp(0.2); - * } - * - * function draw(){ - * background(220); - * - * let spectrum = fft.analyze(); - * noStroke(); - * fill(255, 0, 255); - * for (let i = 0; i< spectrum.length; i++){ - * let x = map(i, 0, spectrum.length, 0, width); - * let h = -height + map(spectrum[i], 0, 255, height, 0); - * rect(x, height, width / spectrum.length, h ) - * } - * - * let waveform = fft.waveform(); - * noFill(); - * beginShape(); - * stroke(20); - * for (let i = 0; i < waveform.length; i++){ - * let x = map(i, 0, waveform.length, 0, width); - * let y = map( waveform[i], -1, 1, 0, height); - * vertex(x,y); - * } - * endShape(); - * - * text('tap to play', 20, 20); - * } - * - * function togglePlay() { - * if (sound.isPlaying()) { - * sound.pause(); - * } else { - * sound.loop(); - * } - * } - *
                          - */ - - var fft_FFT = (function () { - function FFT(smoothing, bins) { - fft_classCallCheck(this, FFT); - - this.input = this.analyser = main.audiocontext.createAnalyser(); - Object.defineProperties(this, { - bins: { - get: function get() { - return this.analyser.fftSize / 2; - }, - set: function set(b) { - this.analyser.fftSize = b * 2; - }, - configurable: true, - enumerable: true, - }, - smoothing: { - get: function get() { - return this.analyser.smoothingTimeConstant; - }, - set: function set(s) { - this.analyser.smoothingTimeConstant = s; - }, - configurable: true, - enumerable: true, - }, - }); - - this.smooth(smoothing); - this.bins = bins || 1024; - - main.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, 14000]; - - main.soundArray.push(this); - } - /** - * Set the input source for the FFT analysis. If no source is - * provided, FFT will analyze all sound in the sketch. - * - * @method setInput - * @for p5.FFT - * @param {Object} [source] p5.sound object (or web audio API source node) - */ - - fft_createClass(FFT, [ - { - key: "setInput", - value: function setInput(source) { - if (!source) { - main.fftMeter.connect(this.analyser); - } else { - if (source.output) { - source.output.connect(this.analyser); - } else if (source.connect) { - source.connect(this.analyser); - } - - main.fftMeter.disconnect(); - } - }, - /** - * Returns an array of amplitude values (between -1.0 and +1.0) that represent - * a snapshot of amplitude readings in a single buffer. Length will be - * equal to bins (defaults to 1024). Can be used to draw the waveform - * of a sound. - * - * @method waveform - * @for p5.FFT - * @param {Number} [bins] Must be a power of two between - * 16 and 1024. Defaults to 1024. - * @param {String} [precision] If any value is provided, will return results - * in a Float32 Array which is more precise - * than a regular array. - * @return {Array} Array Array of amplitude values (-1 to 1) - * over time. Array length = bins. - * - */ - }, - { - key: "waveform", - value: function waveform() { - var bins, mode; - var normalArray = new Array(); - - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] === "number") { - bins = arguments[i]; - this.analyser.fftSize = bins * 2; - } - - if (typeof arguments[i] === "string") { - mode = arguments[i]; - } - } - - if (mode && !p5.prototype._isSafari()) { - timeToFloat(this, this.timeDomain); - this.analyser.getFloatTimeDomainData(this.timeDomain); - return this.timeDomain; - } else { - timeToInt(this, this.timeDomain); - this.analyser.getByteTimeDomainData(this.timeDomain); - - for (var j = 0; j < this.timeDomain.length; j++) { - var scaled = p5.prototype.map( - this.timeDomain[j], - 0, - 255, - -1, - 1, - ); - normalArray.push(scaled); - } - - return normalArray; - } - }, - /** - * Returns an array of amplitude values (between 0 and 255) - * across the frequency spectrum. Length is equal to FFT bins - * (1024 by default). The array indices correspond to frequencies - * (i.e. pitches), from the lowest to the highest that humans can - * hear. Each value represents amplitude at that slice of the - * frequency spectrum. Must be called prior to using - * getEnergy(). - * - * @method analyze - * @for p5.FFT - * @param {Number} [bins] Must be a power of two between - * 16 and 1024. Defaults to 1024. - * @param {Number} [scale] If "dB," returns decibel - * float measurements between - * -140 and 0 (max). - * Otherwise returns integers from 0-255. - * @return {Array} spectrum Array of energy (amplitude/volume) - * values across the frequency spectrum. - * Lowest energy (silence) = 0, highest - * possible is 255. - * @example - *
                          - * let osc, fft; - * - * function setup(){ - * let cnv = createCanvas(100,100); - * cnv.mousePressed(startSound); - * osc = new p5.Oscillator(); - * osc.amp(0); - * fft = new p5.FFT(); - * } - * - * function draw(){ - * background(220); - * - * let freq = map(mouseX, 0, windowWidth, 20, 10000); - * freq = constrain(freq, 1, 20000); - * osc.freq(freq); - * - * let spectrum = fft.analyze(); - * noStroke(); - * fill(255, 0, 255); - * for (let i = 0; i< spectrum.length; i++){ - * let x = map(i, 0, spectrum.length, 0, width); - * let h = -height + map(spectrum[i], 0, 255, height, 0); - * rect(x, height, width / spectrum.length, h ); - * } - * - * stroke(255); - * if (!osc.started) { - * text('tap here and drag to change frequency', 10, 20, width - 20); - * } else { - * text(round(freq)+'Hz', 10, 20); - * } - * } - * - * function startSound() { - * osc.start(); - * osc.amp(0.5, 0.2); - * } - * - * function mouseReleased() { - * osc.amp(0, 0.2); - * } - *
                          - * - * - */ - }, - { - key: "analyze", - value: function analyze() { - var mode; - - for (var i = 0; i < arguments.length; i++) { - if (typeof arguments[i] === "number") { - this.bins = arguments[i]; - this.analyser.fftSize = this.bins * 2; - } - - if (typeof arguments[i] === "string") { - mode = arguments[i]; - } - } - - if (mode && mode.toLowerCase() === "db") { - freqToFloat(this); - this.analyser.getFloatFrequencyData(this.freqDomain); - return this.freqDomain; - } else { - freqToInt(this, this.freqDomain); - this.analyser.getByteFrequencyData(this.freqDomain); - var normalArray = Array.apply([], this.freqDomain); - return normalArray; - } - }, - /** - * Returns the amount of energy (volume) at a specific - * - * frequency, or the average amount of energy between two - * frequencies. Accepts Number(s) corresponding - * to frequency (in Hz), or a "string" corresponding to predefined - * frequency ranges ("bass", "lowMid", "mid", "highMid", "treble"). - * Returns a range between 0 (no energy/volume at that frequency) and - * 255 (maximum energy). - * NOTE: analyze() must be called prior to getEnergy(). analyze() - * tells the FFT to analyze frequency data, and getEnergy() uses - * the results to determine the value at a specific frequency or - * range of frequencies.

                          - * - * @method getEnergy - * @for p5.FFT - * @param {Number|String} frequency1 Will return a value representing - * energy at this frequency. Alternately, - * the strings "bass", "lowMid" "mid", - * "highMid", and "treble" will return - * predefined frequency ranges. - * @param {Number} [frequency2] If a second frequency is given, - * will return average amount of - * energy that exists between the - * two frequencies. - * @return {Number} Energy Energy (volume/amplitude) from - * 0 and 255. - * - */ - }, - { - key: "getEnergy", - value: function getEnergy(frequency1, frequency2) { - var nyquist = main.audiocontext.sampleRate / 2; - - if (frequency1 === "bass") { - frequency1 = this.bass[0]; - frequency2 = this.bass[1]; - } else if (frequency1 === "lowMid") { - frequency1 = this.lowMid[0]; - frequency2 = this.lowMid[1]; - } else if (frequency1 === "mid") { - frequency1 = this.mid[0]; - frequency2 = this.mid[1]; - } else if (frequency1 === "highMid") { - frequency1 = this.highMid[0]; - frequency2 = this.highMid[1]; - } else if (frequency1 === "treble") { - frequency1 = this.treble[0]; - frequency2 = this.treble[1]; - } - - if (typeof frequency1 !== "number") { - throw "invalid input for getEnergy()"; - } else if (!frequency2) { - var index = Math.round( - (frequency1 / nyquist) * this.freqDomain.length, - ); - return this.freqDomain[index]; - } else if (frequency1 && frequency2) { - if (frequency1 > frequency2) { - var swap = frequency2; - frequency2 = frequency1; - frequency1 = swap; - } - - var lowIndex = Math.round( - (frequency1 / nyquist) * this.freqDomain.length, - ); - var highIndex = Math.round( - (frequency2 / nyquist) * this.freqDomain.length, - ); - var total = 0; - var numFrequencies = 0; - - for (var i = lowIndex; i <= highIndex; i++) { - total += this.freqDomain[i]; - numFrequencies += 1; - } - - var toReturn = total / numFrequencies; - return toReturn; - } else { - throw "invalid input for getEnergy()"; - } - }, - }, - { - key: "getFreq", - value: function getFreq(freq1, freq2) { - console.log( - "getFreq() is deprecated. Please use getEnergy() instead.", - ); - var x = this.getEnergy(freq1, freq2); - return x; - }, - /** - * Returns the - * - * spectral centroid of the input signal. - * NOTE: analyze() must be called prior to getCentroid(). Analyze() - * tells the FFT to analyze frequency data, and getCentroid() uses - * the results determine the spectral centroid.

                          - * - * @method getCentroid - * @for p5.FFT - * @return {Number} Spectral Centroid Frequency of the spectral centroid in Hz. - * - * - * @example - *
                          - * function setup(){ - * cnv = createCanvas(100,100); - * cnv.mousePressed(userStartAudio); - * sound = new p5.AudioIn(); - * sound.start(); - * fft = new p5.FFT(); - * sound.connect(fft); - *} - * - *function draw() { - * if (getAudioContext().state !== 'running') { - * background(220); - * text('tap here and enable mic to begin', 10, 20, width - 20); - * return; - * } - * let centroidplot = 0.0; - * let spectralCentroid = 0; - * - * background(0); - * stroke(0,255,0); - * let spectrum = fft.analyze(); - * fill(0,255,0); // spectrum is green - * - * //draw the spectrum - * for (let i = 0; i < spectrum.length; i++){ - * let x = map(log(i), 0, log(spectrum.length), 0, width); - * let h = map(spectrum[i], 0, 255, 0, height); - * let rectangle_width = (log(i+1)-log(i))*(width/log(spectrum.length)); - * rect(x, height, rectangle_width, -h ) - * } - * let nyquist = 22050; - * - * // get the centroid - * spectralCentroid = fft.getCentroid(); - * - * // the mean_freq_index calculation is for the display. - * let mean_freq_index = spectralCentroid/(nyquist/spectrum.length); - * - * centroidplot = map(log(mean_freq_index), 0, log(spectrum.length), 0, width); - * - * stroke(255,0,0); // the line showing where the centroid is will be red - * - * rect(centroidplot, 0, width / spectrum.length, height) - * noStroke(); - * fill(255,255,255); // text is white - * text('centroid: ', 10, 20); - * text(round(spectralCentroid)+' Hz', 10, 40); - *} - *
                          - */ - }, - { - key: "getCentroid", - value: function getCentroid() { - var nyquist = main.audiocontext.sampleRate / 2; - var cumulative_sum = 0; - var centroid_normalization = 0; - - for (var i = 0; i < this.freqDomain.length; i++) { - cumulative_sum += i * this.freqDomain[i]; - centroid_normalization += this.freqDomain[i]; - } - - var mean_freq_index = 0; - - if (centroid_normalization !== 0) { - mean_freq_index = cumulative_sum / centroid_normalization; - } - - var spec_centroid_freq = - mean_freq_index * (nyquist / this.freqDomain.length); - return spec_centroid_freq; - }, - /** - * Smooth FFT analysis by averaging with the last analysis frame. - * - * @method smooth - * @param {Number} smoothing 0.0 < smoothing < 1.0. - * Defaults to 0.8. - */ - }, - { - key: "smooth", - value: function smooth(s) { - if (typeof s !== "undefined") { - this.smoothing = s; - } - - return this.smoothing; - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.analyser) { - this.analyser.disconnect(); - delete this.analyser; - } - }, - /** - * Returns an array of average amplitude values for a given number - * of frequency bands split equally. N defaults to 16. - * NOTE: analyze() must be called prior to linAverages(). Analyze() - * tells the FFT to analyze frequency data, and linAverages() uses - * the results to group them into a smaller set of averages.

                          - * - * @method linAverages - * @for p5.FFT - * @param {Number} N Number of returned frequency groups - * @return {Array} linearAverages Array of average amplitude values for each group - */ - }, - { - key: "linAverages", - value: function linAverages(_N) { - var N = _N || 16; - - var spectrum = this.freqDomain; - var spectrumLength = spectrum.length; - var spectrumStep = Math.floor(spectrumLength / N); - var linearAverages = new Array(N); - - var groupIndex = 0; - - for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { - linearAverages[groupIndex] = - linearAverages[groupIndex] !== undefined - ? (linearAverages[groupIndex] + spectrum[specIndex]) / 2 - : spectrum[specIndex]; - - if (specIndex % spectrumStep === spectrumStep - 1) { - groupIndex++; - } - } - - return linearAverages; - }, - /** - * Returns an array of average amplitude values of the spectrum, for a given - * set of - * Octave Bands - * NOTE: analyze() must be called prior to logAverages(). Analyze() - * tells the FFT to analyze frequency data, and logAverages() uses - * the results to group them into a smaller set of averages.

                          - * - * @method logAverages - * @for p5.FFT - * @param {Array} octaveBands Array of Octave Bands objects for grouping - * @return {Array} logAverages Array of average amplitude values for each group - */ - }, - { - key: "logAverages", - value: function logAverages(octaveBands) { - var nyquist = main.audiocontext.sampleRate / 2; - var spectrum = this.freqDomain; - var spectrumLength = spectrum.length; - var logAverages = new Array(octaveBands.length); - - var octaveIndex = 0; - - for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { - var specIndexFrequency = Math.round( - (specIndex * nyquist) / this.freqDomain.length, - ); - - if (specIndexFrequency > octaveBands[octaveIndex].hi) { - octaveIndex++; - } - - logAverages[octaveIndex] = - logAverages[octaveIndex] !== undefined - ? (logAverages[octaveIndex] + spectrum[specIndex]) / 2 - : spectrum[specIndex]; - } - - return logAverages; - }, - /** - * Calculates and Returns the 1/N - * Octave Bands - * N defaults to 3 and minimum central frequency to 15.625Hz. - * (1/3 Octave Bands ~= 31 Frequency Bands) - * Setting fCtr0 to a central value of a higher octave will ignore the lower bands - * and produce less frequency groups. - * - * @method getOctaveBands - * @for p5.FFT - * @param {Number} N Specifies the 1/N type of generated octave bands - * @param {Number} fCtr0 Minimum central frequency for the lowest band - * @return {Array} octaveBands Array of octave band objects with their bounds - */ - }, - { - key: "getOctaveBands", - value: function getOctaveBands(_N, _fCtr0) { - var N = _N || 3; - - var fCtr0 = _fCtr0 || 15.625; - - var octaveBands = []; - var lastFrequencyBand = { - lo: fCtr0 / Math.pow(2, 1 / (2 * N)), - ctr: fCtr0, - hi: fCtr0 * Math.pow(2, 1 / (2 * N)), - }; - octaveBands.push(lastFrequencyBand); - var nyquist = main.audiocontext.sampleRate / 2; - - while (lastFrequencyBand.hi < nyquist) { - var newFrequencyBand = {}; - newFrequencyBand.lo = lastFrequencyBand.hi; - newFrequencyBand.ctr = lastFrequencyBand.ctr * Math.pow(2, 1 / N); - newFrequencyBand.hi = - newFrequencyBand.ctr * Math.pow(2, 1 / (2 * N)); - octaveBands.push(newFrequencyBand); - lastFrequencyBand = newFrequencyBand; - } - - return octaveBands; - }, - }, - ]); - - return FFT; - })(); - - function freqToFloat(fft) { - if (fft.freqDomain instanceof Float32Array === false) { - fft.freqDomain = new Float32Array(fft.analyser.frequencyBinCount); - } - } - - function freqToInt(fft) { - if (fft.freqDomain instanceof Uint8Array === false) { - fft.freqDomain = new Uint8Array(fft.analyser.frequencyBinCount); - } - } - - function timeToFloat(fft) { - if (fft.timeDomain instanceof Float32Array === false) { - fft.timeDomain = new Float32Array(fft.analyser.frequencyBinCount); - } - } - - function timeToInt(fft) { - if (fft.timeDomain instanceof Uint8Array === false) { - fft.timeDomain = new Uint8Array(fft.analyser.frequencyBinCount); - } - } - - var fft = fft_FFT; - var Add = __webpack_require__(4); - var Add_default = __webpack_require__.n(Add); - - var Multiply = __webpack_require__(1); - var Multiply_default = __webpack_require__.n(Multiply); - - var Scale = __webpack_require__(8); - var Scale_default = __webpack_require__.n(Scale); - - function oscillator_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - oscillator_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - oscillator_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return oscillator_typeof(obj); - } - - function _possibleConstructorReturn(self, call) { - if ( - call && - (oscillator_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - - function oscillator_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function oscillator_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function oscillator_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - oscillator_defineProperties(Constructor.prototype, protoProps); - if (staticProps) oscillator_defineProperties(Constructor, staticProps); - return Constructor; - } - - function sigChain(o, mathObj, thisChain, nextChain, type) { - var chainSource = o.oscillator; - - for (var i in o.mathOps) { - if (o.mathOps[i] instanceof type) { - chainSource.disconnect(); - o.mathOps[i].dispose(); - thisChain = i; - - if (thisChain < o.mathOps.length - 2) { - nextChain = o.mathOps[i + 1]; - } - } - } - - if (thisChain === o.mathOps.length - 1) { - o.mathOps.push(nextChain); - } - - if (i > 0) { - chainSource = o.mathOps[i - 1]; - } - - chainSource.disconnect(); - chainSource.connect(mathObj); - mathObj.connect(nextChain); - o.mathOps[thisChain] = mathObj; - return o; - } - /** - *

                          Creates a signal that oscillates between -1.0 and 1.0. - * By default, the oscillation takes the form of a sinusoidal - * shape ('sine'). Additional types include 'triangle', - * 'sawtooth' and 'square'. The frequency defaults to - * 440 oscillations per second (440Hz, equal to the pitch of an - * 'A' note).

                          - * - *

                          Set the type of oscillation with setType(), or by instantiating a - * specific oscillator: p5.SinOsc, p5.TriOsc, p5.SqrOsc, or p5.SawOsc. - *

                          - * - * @class p5.Oscillator - * @constructor - * @param {Number} [freq] frequency defaults to 440Hz - * @param {String} [type] type of oscillator. Options: - * 'sine' (default), 'triangle', - * 'sawtooth', 'square' - * @example - *
                          - * let osc, playing, freq, amp; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playOscillator); - * osc = new p5.Oscillator('sine'); - * } - * - * function draw() { - * background(220) - * freq = constrain(map(mouseX, 0, width, 100, 500), 100, 500); - * amp = constrain(map(mouseY, height, 0, 0, 1), 0, 1); - * - * text('tap to play', 20, 20); - * text('freq: ' + freq, 20, 40); - * text('amp: ' + amp, 20, 60); - * - * if (playing) { - * // smooth the transitions by 0.1 seconds - * osc.freq(freq, 0.1); - * osc.amp(amp, 0.1); - * } - * } - * - * function playOscillator() { - * // starting an oscillator on a user gesture will enable audio - * // in browsers that have a strict autoplay policy. - * // See also: userStartAudio(); - * osc.start(); - * playing = true; - * } - * - * function mouseReleased() { - * // ramp amplitude to 0 over 0.5 seconds - * osc.amp(0, 0.5); - * playing = false; - * } - *
                          - */ - - var oscillator_Oscillator = (function () { - function Oscillator(freq, type) { - oscillator_classCallCheck(this, Oscillator); - - if (typeof freq === "string") { - var f = type; - type = freq; - freq = f; - } - - if (typeof type === "number") { - var _f = type; - type = freq; - freq = _f; - } - - this.started = false; - - this.phaseAmount = undefined; - this.oscillator = main.audiocontext.createOscillator(); - this.f = freq || 440.0; - - this.oscillator.type = type || "sine"; - this.oscillator.frequency.setValueAtTime( - this.f, - main.audiocontext.currentTime, - ); - - this.output = main.audiocontext.createGain(); - this._freqMods = []; - - this.output.gain.value = 0.5; - this.output.gain.setValueAtTime(0.5, main.audiocontext.currentTime); - this.oscillator.connect(this.output); - - this.panPosition = 0.0; - this.connection = main.input; - - this.panner = new panner_0(this.output, this.connection, 1); - - this.mathOps = [this.output]; - - main.soundArray.push(this); - - this.fade = this.amp; - } - /** - * Start an oscillator. - * - * Starting an oscillator on a user gesture will enable audio in browsers - * that have a strict autoplay policy, including Chrome and most mobile - * devices. See also: `userStartAudio()`. - * - * @method start - * @for p5.Oscillator - * @param {Number} [time] startTime in seconds from now. - * @param {Number} [frequency] frequency in Hz. - */ - - oscillator_createClass(Oscillator, [ - { - key: "start", - value: function start(time, f) { - if (this.started) { - var now = main.audiocontext.currentTime; - this.stop(now); - } - - if (!this.started) { - var freq = f || this.f; - var type = this.oscillator.type; - - if (this.oscillator) { - this.oscillator.disconnect(); - delete this.oscillator; - } - - this.oscillator = main.audiocontext.createOscillator(); - this.oscillator.frequency.value = Math.abs(freq); - this.oscillator.type = type; - - this.oscillator.connect(this.output); - time = time || 0; - this.oscillator.start(time + main.audiocontext.currentTime); - this.freqNode = this.oscillator.frequency; - - for (var i in this._freqMods) { - if (typeof this._freqMods[i].connect !== "undefined") { - this._freqMods[i].connect(this.oscillator.frequency); - } - } - - this.started = true; - } - }, - /** - * Stop an oscillator. Accepts an optional parameter - * to determine how long (in seconds from now) until the - * oscillator stops. - * - * @method stop - * @for p5.Oscillator - * @param {Number} secondsFromNow Time, in seconds from now. - */ - }, - { - key: "stop", - value: function stop(time) { - if (this.started) { - var t = time || 0; - var now = main.audiocontext.currentTime; - this.oscillator.stop(t + now); - this.started = false; - } - }, - /** - * Set the amplitude between 0 and 1.0. Or, pass in an object - * such as an oscillator to modulate amplitude with an audio signal. - * - * @method amp - * @for p5.Oscillator - * @param {Number|Object} vol between 0 and 1.0 - * or a modulating signal/oscillator - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @return {AudioParam} gain If no value is provided, - * returns the Web Audio API - * AudioParam that controls - * this oscillator's - * gain/amplitude/volume) - */ - }, - { - key: "amp", - value: function amp(vol) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var tFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - - if (typeof vol === "number") { - var now = main.audiocontext.currentTime; - this.output.gain.linearRampToValueAtTime( - vol, - now + tFromNow + rampTime, - ); - } else if (vol) { - vol.connect(this.output.gain); - } else { - return this.output.gain; - } - }, - /** - * Returns the value of output gain - * - * @method getAmp - * @for p5.Oscillator - * - * @returns {number} Amplitude value between 0.0 and 1.0 - */ - }, - { - key: "getAmp", - value: function getAmp() { - return this.output.gain.value; - }, - /** - * Set frequency of an oscillator to a value. Or, pass in an object - * such as an oscillator to modulate the frequency with an audio signal. - * - * @method freq - * @for p5.Oscillator - * @param {Number|Object} Frequency Frequency in Hz - * or modulating signal/oscillator - * @param {Number} [rampTime] Ramp time (in seconds) - * @param {Number} [timeFromNow] Schedule this event to happen - * at x seconds from now - * @return {AudioParam} Frequency If no value is provided, - * returns the Web Audio API - * AudioParam that controls - * this oscillator's frequency - * @example - *
                          - * let osc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playOscillator); - * osc = new p5.Oscillator(300); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function playOscillator() { - * osc.start(); - * osc.amp(0.5); - * // start at 700Hz - * osc.freq(700); - * // ramp to 60Hz over 0.7 seconds - * osc.freq(60, 0.7); - * osc.amp(0, 0.1, 0.7); - * } - *
                          - */ - }, - { - key: "freq", - value: function freq(val) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var tFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - - if (typeof val === "number" && !isNaN(val)) { - this.f = val; - var now = main.audiocontext.currentTime; - - if (rampTime === 0) { - this.oscillator.frequency.setValueAtTime(val, tFromNow + now); - } else { - if (val > 0) { - this.oscillator.frequency.exponentialRampToValueAtTime( - val, - tFromNow + rampTime + now, - ); - } else { - this.oscillator.frequency.linearRampToValueAtTime( - val, - tFromNow + rampTime + now, - ); - } - } - - if (this.phaseAmount) { - this.phase(this.phaseAmount); - } - } else if (val) { - if (val.output) { - val = val.output; - } - - val.connect(this.oscillator.frequency); - - this._freqMods.push(val); - } else { - return this.oscillator.frequency; - } - }, - /** - * Returns the value of frequency of oscillator - * - * @method getFreq - * @for p5.Oscillator - * @returns {number} Frequency of oscillator in Hertz - */ - }, - { - key: "getFreq", - value: function getFreq() { - return this.oscillator.frequency.value; - }, - /** - * Set type to 'sine', 'triangle', 'sawtooth' or 'square'. - * - * @method setType - * @for p5.Oscillator - * @param {String} type 'sine', 'triangle', 'sawtooth' or 'square'. - */ - }, - { - key: "setType", - value: function setType(type) { - this.oscillator.type = type; - }, - /** - * Returns current type of oscillator eg. 'sine', 'triangle', 'sawtooth' or 'square'. - * - * @method getType - * @for p5.Oscillator - * @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'. - */ - }, - { - key: "getType", - value: function getType() { - return this.oscillator.type; - }, - /** - * Connect to a p5.sound / Web Audio object. - * - * @method connect - * @for p5.Oscillator - * @param {Object} unit A p5.sound or Web Audio object - */ - }, - { - key: "connect", - value: function connect(unit) { - if (!unit) { - this.panner.connect(main.input); - } else if (unit.hasOwnProperty("input")) { - this.panner.connect(unit.input); - this.connection = unit.input; - } else { - this.panner.connect(unit); - this.connection = unit; - } - }, - /** - * Disconnect all outputs - * - * @method disconnect - * @for p5.Oscillator - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - - if (this.panner) { - this.panner.disconnect(); - - if (this.output) { - this.output.connect(this.panner); - } - } - - this.oscMods = []; - }, - /** - * Pan between Left (-1) and Right (1) - * - * @method pan - * @for p5.Oscillator - * @param {Number} panning Number between -1 and 1 - * @param {Number} timeFromNow schedule this event to happen - * seconds from now - */ - }, - { - key: "pan", - value: function pan(pval, tFromNow) { - this.panPosition = pval; - this.panner.pan(pval, tFromNow); - }, - /** - * Returns the current value of panPosition , between Left (-1) and Right (1) - * - * @method getPan - * @for p5.Oscillator - * - * @returns {number} panPosition of oscillator , between Left (-1) and Right (1) - */ - }, - { - key: "getPan", - value: function getPan() { - return this.panPosition; - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.oscillator) { - var now = main.audiocontext.currentTime; - this.stop(now); - this.disconnect(); - this.panner = null; - this.oscillator = null; - } - - if (this.osc2) { - this.osc2.dispose(); - } - }, - /** - * Set the phase of an oscillator between 0.0 and 1.0. - * In this implementation, phase is a delay time - * based on the oscillator's current frequency. - * - * @method phase - * @for p5.Oscillator - * @param {Number} phase float between 0.0 and 1.0 - */ - }, - { - key: "phase", - value: function phase(p) { - var delayAmt = p5.prototype.map(p, 0, 1.0, 0, 1 / this.f); - var now = main.audiocontext.currentTime; - this.phaseAmount = p; - - if (!this.dNode) { - this.dNode = main.audiocontext.createDelay(); - - this.oscillator.disconnect(); - this.oscillator.connect(this.dNode); - this.dNode.connect(this.output); - } - - this.dNode.delayTime.setValueAtTime(delayAmt, now); - }, - /** - * Add a value to the p5.Oscillator's output amplitude, - * and return the oscillator. Calling this method again - * will override the initial add() with a new value. - * - * @method add - * @for p5.Oscillator - * @param {Number} number Constant number to add - * @return {p5.Oscillator} Oscillator Returns this oscillator - * with scaled output - * - */ - }, - { - key: "add", - value: function add(num) { - var add = new Add_default.a(num); - var thisChain = this.mathOps.length - 1; - var nextChain = this.output; - return sigChain(this, add, thisChain, nextChain, Add_default.a); - }, - /** - * Multiply the p5.Oscillator's output amplitude - * by a fixed value (i.e. turn it up!). Calling this method - * again will override the initial mult() with a new value. - * - * @method mult - * @for p5.Oscillator - * @param {Number} number Constant number to multiply - * @return {p5.Oscillator} Oscillator Returns this oscillator - * with multiplied output - */ - }, - { - key: "mult", - value: function mult(num) { - var mult = new Multiply_default.a(num); - var thisChain = this.mathOps.length - 1; - var nextChain = this.output; - return sigChain( - this, - mult, - thisChain, - nextChain, - Multiply_default.a, - ); - }, - /** - * Scale this oscillator's amplitude values to a given - * range, and return the oscillator. Calling this method - * again will override the initial scale() with new values. - * - * @method scale - * @for p5.Oscillator - * @param {Number} inMin input range minumum - * @param {Number} inMax input range maximum - * @param {Number} outMin input range minumum - * @param {Number} outMax input range maximum - * @return {p5.Oscillator} Oscillator Returns this oscillator - * with scaled output - */ - }, - { - key: "scale", - value: function scale(inMin, inMax, outMin, outMax) { - var mapOutMin, mapOutMax; - - if (arguments.length === 4) { - mapOutMin = p5.prototype.map(outMin, inMin, inMax, 0, 1) - 0.5; - - mapOutMax = p5.prototype.map(outMax, inMin, inMax, 0, 1) - 0.5; - } else { - mapOutMin = arguments[0]; - mapOutMax = arguments[1]; - } - - var scale = new Scale_default.a(mapOutMin, mapOutMax); - var thisChain = this.mathOps.length - 1; - var nextChain = this.output; - return sigChain(this, scale, thisChain, nextChain, Scale_default.a); - }, - }, - ]); - - return Oscillator; - })(); - - /** - * Constructor: new p5.SinOsc(). - * This creates a Sine Wave Oscillator and is - * equivalent to new p5.Oscillator('sine') - * or creating a p5.Oscillator and then calling - * its method setType('sine'). - * See p5.Oscillator for methods. - * - * @class p5.SinOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - var SinOsc = (function (_Oscillator) { - _inherits(SinOsc, _Oscillator); - - function SinOsc(freq) { - oscillator_classCallCheck(this, SinOsc); - - return _possibleConstructorReturn( - this, - _getPrototypeOf(SinOsc).call(this, freq, "sine"), - ); - } - - return SinOsc; - })(oscillator_Oscillator); - /** - * Constructor: new p5.TriOsc(). - * This creates a Triangle Wave Oscillator and is - * equivalent to new p5.Oscillator('triangle') - * or creating a p5.Oscillator and then calling - * its method setType('triangle'). - * See p5.Oscillator for methods. - * - * @class p5.TriOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - var TriOsc = (function (_Oscillator2) { - _inherits(TriOsc, _Oscillator2); - - function TriOsc(freq) { - oscillator_classCallCheck(this, TriOsc); - - return _possibleConstructorReturn( - this, - _getPrototypeOf(TriOsc).call(this, freq, "triangle"), - ); - } - - return TriOsc; - })(oscillator_Oscillator); - /** - * Constructor: new p5.SawOsc(). - * This creates a SawTooth Wave Oscillator and is - * equivalent to new p5.Oscillator('sawtooth') - * or creating a p5.Oscillator and then calling - * its method setType('sawtooth'). - * See p5.Oscillator for methods. - * - * @class p5.SawOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - var SawOsc = (function (_Oscillator3) { - _inherits(SawOsc, _Oscillator3); - - function SawOsc(freq) { - oscillator_classCallCheck(this, SawOsc); - - return _possibleConstructorReturn( - this, - _getPrototypeOf(SawOsc).call(this, freq, "sawtooth"), - ); - } - - return SawOsc; - })(oscillator_Oscillator); - /** - * Constructor: new p5.SqrOsc(). - * This creates a Square Wave Oscillator and is - * equivalent to new p5.Oscillator('square') - * or creating a p5.Oscillator and then calling - * its method setType('square'). - * See p5.Oscillator for methods. - * - * @class p5.SqrOsc - * @constructor - * @extends p5.Oscillator - * @param {Number} [freq] Set the frequency - */ - - var SqrOsc = (function (_Oscillator4) { - _inherits(SqrOsc, _Oscillator4); - - function SqrOsc(freq) { - oscillator_classCallCheck(this, SqrOsc); - - return _possibleConstructorReturn( - this, - _getPrototypeOf(SqrOsc).call(this, freq, "square"), - ); - } - - return SqrOsc; - })(oscillator_Oscillator); - - var oscillator = oscillator_Oscillator; - - var TimelineSignal = __webpack_require__(7); - var TimelineSignal_default = __webpack_require__.n(TimelineSignal); - - /** - *

                          Envelopes are pre-defined amplitude distribution over time. - * Typically, envelopes are used to control the output volume - * of an object, a series of fades referred to as Attack, Decay, - * Sustain and Release ( - * ADSR - * ). Envelopes can also control other Web Audio Parameters—for example, a p5.Envelope can - * control an Oscillator's frequency like this: osc.freq(env).

                          - *

                          Use setRange to change the attack/release level. - * Use setADSR to change attackTime, decayTime, sustainPercent and releaseTime.

                          - *

                          Use the play method to play the entire envelope, - * the ramp method for a pingable trigger, - * or triggerAttack/ - * triggerRelease to trigger noteOn/noteOff.

                          - * - * @class p5.Envelope - * @constructor - * @example - *
                          - * let t1 = 0.1; // attack time in seconds - * let l1 = 0.7; // attack level 0.0 to 1.0 - * let t2 = 0.3; // decay time in seconds - * let l2 = 0.1; // decay level 0.0 to 1.0 - * - * let env; - * let triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * text('tap to play', 20, 20); - * cnv.mousePressed(playSound); - * - * env = new p5.Envelope(t1, l1, t2, l2); - * triOsc = new p5.Oscillator('triangle'); - * } - * - * function playSound() { - * // starting the oscillator ensures that audio is enabled. - * triOsc.start(); - * env.play(triOsc); - * } - *
                          - */ - - p5.Envelope = function (t1, l1, t2, l2, t3, l3) { - /** - * Time until envelope reaches attackLevel - * @property attackTime - */ - this.aTime = t1 || 0.1; - /** - * Level once attack is complete. - * @property attackLevel - */ - - this.aLevel = l1 || 1; - /** - * Time until envelope reaches decayLevel. - * @property decayTime - */ - - this.dTime = t2 || 0.5; - /** - * Level after decay. The envelope will sustain here until it is released. - * @property decayLevel - */ - - this.dLevel = l2 || 0; - /** - * Duration of the release portion of the envelope. - * @property releaseTime - */ - - this.rTime = t3 || 0; - /** - * Level at the end of the release. - * @property releaseLevel - */ - - this.rLevel = l3 || 0; - this._rampHighPercentage = 0.98; - this._rampLowPercentage = 0.02; - this.output = main.audiocontext.createGain(); - this.control = new TimelineSignal_default.a(); - - this._init(); - - this.control.connect(this.output); - - this.connection = null; - - this.mathOps = [this.control]; - - this.isExponential = false; - - this.sourceToClear = null; - - this.wasTriggered = false; - - main.soundArray.push(this); - }; - - p5.Envelope.prototype._init = function () { - var now = main.audiocontext.currentTime; - var t = now; - this.control.setTargetAtTime(0.00001, t, 0.001); - - this._setRampAD(this.aTime, this.dTime); - }; - /** - * Reset the envelope with a series of time/value pairs. - * - * @method set - * @for p5.Envelope - * @param {Number} attackTime Time (in seconds) before level - * reaches attackLevel - * @param {Number} attackLevel Typically an amplitude between - * 0.0 and 1.0 - * @param {Number} decayTime Time - * @param {Number} decayLevel Amplitude (In a standard ADSR envelope, - * decayLevel = sustainLevel) - * @param {Number} releaseTime Release Time (in seconds) - * @param {Number} releaseLevel Amplitude - * @example - *
                          - * let attackTime; - * let l1 = 0.7; // attack level 0.0 to 1.0 - * let t2 = 0.3; // decay time in seconds - * let l2 = 0.1; // decay level 0.0 to 1.0 - * let l3 = 0.2; // release time in seconds - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * - * attackTime = map(mouseX, 0, width, 0.0, 1.0); - * text('attack time: ' + attackTime, 5, height - 20); - * } - * - * // mouseClick triggers envelope if over canvas - * function playSound() { - * env.set(attackTime, l1, t2, l2, l3); - * - * triOsc.start(); - * env.play(triOsc); - * } - *
                          - * - */ - - p5.Envelope.prototype.set = function (t1, l1, t2, l2, t3, l3) { - this.aTime = t1; - this.aLevel = l1; - this.dTime = t2 || 0; - this.dLevel = l2 || 0; - this.rTime = t3 || 0; - this.rLevel = l3 || 0; - - this._setRampAD(t1, t2); - }; - /** - * Set values like a traditional - * - * ADSR envelope - * . - * - * @method setADSR - * @for p5.Envelope - * @param {Number} attackTime Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - * @example - *
                          - * let attackLevel = 1.0; - * let releaseLevel = 0; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.2; - * let releaseTime = 0.5; - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playEnv); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.amp(env); - * triOsc.freq(220); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * attackTime = map(mouseX, 0, width, 0, 1.0); - * text('attack time: ' + attackTime, 5, height - 40); - * } - * - * function playEnv() { - * triOsc.start(); - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.play(); - * } - *
                          - */ - - p5.Envelope.prototype.setADSR = function (aTime, dTime, sPercent, rTime) { - this.aTime = aTime; - this.dTime = dTime || 0; - - this.sPercent = sPercent || 0; - this.dLevel = - typeof sPercent !== "undefined" - ? sPercent * (this.aLevel - this.rLevel) + this.rLevel - : 0; - this.rTime = rTime || 0; - - this._setRampAD(aTime, dTime); - }; - /** - * Set max (attackLevel) and min (releaseLevel) of envelope. - * - * @method setRange - * @for p5.Envelope - * @param {Number} aLevel attack level (defaults to 1) - * @param {Number} rLevel release level (defaults to 0) - * @example - *
                          - * let attackLevel = 1.0; - * let releaseLevel = 0; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.2; - * let releaseTime = 0.5; - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playEnv); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.amp(env); - * triOsc.freq(220); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * attackLevel = map(mouseY, height, 0, 0, 1.0); - * text('attack level: ' + attackLevel, 5, height - 20); - * } - * - * function playEnv() { - * triOsc.start(); - * env.setRange(attackLevel, releaseLevel); - * env.play(); - * } - *
                          - */ - - p5.Envelope.prototype.setRange = function (aLevel, rLevel) { - this.aLevel = aLevel || 1; - this.rLevel = rLevel || 0; - }; - - p5.Envelope.prototype._setRampAD = function (t1, t2) { - this._rampAttackTime = this.checkExpInput(t1); - this._rampDecayTime = this.checkExpInput(t2); - var TCDenominator = 1.0; - - TCDenominator = Math.log( - 1.0 / this.checkExpInput(1.0 - this._rampHighPercentage), - ); - this._rampAttackTC = t1 / this.checkExpInput(TCDenominator); - TCDenominator = Math.log(1.0 / this._rampLowPercentage); - this._rampDecayTC = t2 / this.checkExpInput(TCDenominator); - }; - - p5.Envelope.prototype.setRampPercentages = function (p1, p2) { - this._rampHighPercentage = this.checkExpInput(p1); - this._rampLowPercentage = this.checkExpInput(p2); - var TCDenominator = 1.0; - - TCDenominator = Math.log( - 1.0 / this.checkExpInput(1.0 - this._rampHighPercentage), - ); - this._rampAttackTC = - this._rampAttackTime / this.checkExpInput(TCDenominator); - TCDenominator = Math.log(1.0 / this._rampLowPercentage); - this._rampDecayTC = - this._rampDecayTime / this.checkExpInput(TCDenominator); - }; - /** - * Assign a parameter to be controlled by this envelope. - * If a p5.Sound object is given, then the p5.Envelope will control its - * output gain. If multiple inputs are provided, the env will - * control all of them. - * - * @method setInput - * @for p5.Envelope - * @param {Object} [...inputs] A p5.sound object or - * Web Audio Param. - */ - - p5.Envelope.prototype.setInput = function () { - for (var i = 0; i < arguments.length; i++) { - this.connect(arguments[i]); - } - }; - /** - * Set whether the envelope ramp is linear (default) or exponential. - * Exponential ramps can be useful because we perceive amplitude - * and frequency logarithmically. - * - * @method setExp - * @for p5.Envelope - * @param {Boolean} isExp true is exponential, false is linear - */ - - p5.Envelope.prototype.setExp = function (isExp) { - this.isExponential = isExp; - }; - - p5.Envelope.prototype.checkExpInput = function (value) { - if (value <= 0) { - value = 0.00000001; - } - - return value; - }; - /** - *

                          Play tells the envelope to start acting on a given input. - * If the input is a p5.sound object (i.e. AudioIn, Oscillator, - * SoundFile), then Envelope will control its output volume. - * Envelopes can also be used to control any - * Web Audio Audio Param.

                          - * - * @method play - * @for p5.Envelope - * @param {Object} unit A p5.sound object or - * Web Audio Param. - * @param {Number} [startTime] time from now (in seconds) at which to play - * @param {Number} [sustainTime] time to sustain before releasing the envelope - * @example - *
                          - * let attackLevel = 1.0; - * let releaseLevel = 0; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.2; - * let releaseTime = 0.5; - * - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playEnv); - * - * env = new p5.Envelope(); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.amp(env); - * triOsc.freq(220); - * triOsc.start(); - * } - * - * function draw() { - * background(220); - * text('tap here to play', 5, 20); - * attackTime = map(mouseX, 0, width, 0, 1.0); - * attackLevel = map(mouseY, height, 0, 0, 1.0); - * text('attack time: ' + attackTime, 5, height - 40); - * text('attack level: ' + attackLevel, 5, height - 20); - * } - * - * function playEnv() { - * // ensure that audio is enabled - * userStartAudio(); - * - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.setRange(attackLevel, releaseLevel); - * env.play(); - * } - *
                          - */ - - p5.Envelope.prototype.play = function (unit, secondsFromNow, susTime) { - var tFromNow = secondsFromNow || 0; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - this.triggerAttack(unit, tFromNow); - this.triggerRelease(unit, tFromNow + this.aTime + this.dTime + ~~susTime); - }; - /** - * Trigger the Attack, and Decay portion of the Envelope. - * Similar to holding down a key on a piano, but it will - * hold the sustain level until you let go. Input can be - * any p5.sound object, or a - * Web Audio Param. - * - * @method triggerAttack - * @for p5.Envelope - * @param {Object} unit p5.sound Object or Web Audio Param - * @param {Number} secondsFromNow time from now (in seconds) - * @example - *
                          - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.3; - * let releaseTime = 0.4; - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * textAlign(CENTER); - * textSize(10); - * text('tap to triggerAttack', width/2, height/2); - * - * env = new p5.Envelope(); - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.setRange(1.0, 0.0); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.freq(220); - * - * cnv.mousePressed(envAttack); - * } - * - * function envAttack() { - * background(0, 255, 255); - * text('release to release', width/2, height/2); - * - * // ensures audio is enabled. See also: `userStartAudio` - * triOsc.start(); - * - * env.triggerAttack(triOsc); - * } - * - * function mouseReleased() { - * background(220); - * text('tap to triggerAttack', width/2, height/2); - * - * env.triggerRelease(triOsc); - * } - *
                          - */ - - p5.Envelope.prototype.triggerAttack = function (unit, secondsFromNow) { - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - this.lastAttack = t; - this.wasTriggered = true; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - var valToSet = this.control.getValueAtTime(t); - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime( - this.checkExpInput(valToSet), - t, - ); - } else { - this.control.linearRampToValueAtTime(valToSet, t); - } - - t += this.aTime; - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime( - this.checkExpInput(this.aLevel), - t, - ); - valToSet = this.checkExpInput(this.control.getValueAtTime(t)); - this.control.cancelScheduledValues(t); - this.control.exponentialRampToValueAtTime(valToSet, t); - } else { - this.control.linearRampToValueAtTime(this.aLevel, t); - valToSet = this.control.getValueAtTime(t); - this.control.cancelScheduledValues(t); - this.control.linearRampToValueAtTime(valToSet, t); - } - - t += this.dTime; - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime( - this.checkExpInput(this.dLevel), - t, - ); - valToSet = this.checkExpInput(this.control.getValueAtTime(t)); - this.control.cancelScheduledValues(t); - this.control.exponentialRampToValueAtTime(valToSet, t); - } else { - this.control.linearRampToValueAtTime(this.dLevel, t); - valToSet = this.control.getValueAtTime(t); - this.control.cancelScheduledValues(t); - this.control.linearRampToValueAtTime(valToSet, t); - } - }; - /** - * Trigger the Release of the Envelope. This is similar to releasing - * the key on a piano and letting the sound fade according to the - * release level and release time. - * - * @method triggerRelease - * @for p5.Envelope - * @param {Object} unit p5.sound Object or Web Audio Param - * @param {Number} secondsFromNow time to trigger the release - * @example - *
                          - * let attackTime = 0.001; - * let decayTime = 0.2; - * let susPercent = 0.3; - * let releaseTime = 0.4; - * let env, triOsc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * textAlign(CENTER); - * textSize(10); - * text('tap to triggerAttack', width/2, height/2); - * - * env = new p5.Envelope(); - * env.setADSR(attackTime, decayTime, susPercent, releaseTime); - * env.setRange(1.0, 0.0); - * triOsc = new p5.Oscillator('triangle'); - * triOsc.freq(220); - * - * cnv.mousePressed(envAttack); - * } - * - * function envAttack() { - * background(0, 255, 255); - * text('release to release', width/2, height/2); - * - * // ensures audio is enabled. See also: `userStartAudio` - * triOsc.start(); - * - * env.triggerAttack(triOsc); - * } - * - * function mouseReleased() { - * background(220); - * text('tap to triggerAttack', width/2, height/2); - * - * env.triggerRelease(triOsc); - * } - *
                          - */ - - p5.Envelope.prototype.triggerRelease = function (unit, secondsFromNow) { - if (!this.wasTriggered) { - return; - } - - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - var valToSet = this.control.getValueAtTime(t); - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime( - this.checkExpInput(valToSet), - t, - ); - } else { - this.control.linearRampToValueAtTime(valToSet, t); - } - - t += this.rTime; - - if (this.isExponential === true) { - this.control.exponentialRampToValueAtTime( - this.checkExpInput(this.rLevel), - t, - ); - valToSet = this.checkExpInput(this.control.getValueAtTime(t)); - this.control.cancelScheduledValues(t); - this.control.exponentialRampToValueAtTime(valToSet, t); - } else { - this.control.linearRampToValueAtTime(this.rLevel, t); - valToSet = this.control.getValueAtTime(t); - this.control.cancelScheduledValues(t); - this.control.linearRampToValueAtTime(valToSet, t); - } - - this.wasTriggered = false; - }; - /** - * Exponentially ramp to a value using the first two - * values from setADSR(attackTime, decayTime) - * as - * time constants for simple exponential ramps. - * If the value is higher than current value, it uses attackTime, - * while a decrease uses decayTime. - * - * @method ramp - * @for p5.Envelope - * @param {Object} unit p5.sound Object or Web Audio Param - * @param {Number} secondsFromNow When to trigger the ramp - * @param {Number} v Target value - * @param {Number} [v2] Second target value - * @example - *
                          - * let env, osc, amp; - * - * let attackTime = 0.001; - * let decayTime = 0.2; - * let attackLevel = 1; - * let decayLevel = 0; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * fill(0,255,0); - * noStroke(); - * - * env = new p5.Envelope(); - * env.setADSR(attackTime, decayTime); - * osc = new p5.Oscillator(); - * osc.amp(env); - * amp = new p5.Amplitude(); - * - * cnv.mousePressed(triggerRamp); - * } - * - * function triggerRamp() { - * // ensures audio is enabled. See also: `userStartAudio` - * osc.start(); - * - * env.ramp(osc, 0, attackLevel, decayLevel); - * } - * - * function draw() { - * background(20); - * text('tap to play', 10, 20); - * let h = map(amp.getLevel(), 0, 0.4, 0, height);; - * rect(0, height, width, -h); - * } - *
                          - */ - - p5.Envelope.prototype.ramp = function (unit, secondsFromNow, v1, v2) { - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - var destination1 = this.checkExpInput(v1); - var destination2 = - typeof v2 !== "undefined" ? this.checkExpInput(v2) : undefined; - - if (unit) { - if (this.connection !== unit) { - this.connect(unit); - } - } - - var currentVal = this.checkExpInput(this.control.getValueAtTime(t)); - - if (destination1 > currentVal) { - this.control.setTargetAtTime(destination1, t, this._rampAttackTC); - t += this._rampAttackTime; - } else if (destination1 < currentVal) { - this.control.setTargetAtTime(destination1, t, this._rampDecayTC); - t += this._rampDecayTime; - } - - if (destination2 === undefined) return; - - if (destination2 > destination1) { - this.control.setTargetAtTime(destination2, t, this._rampAttackTC); - } else if (destination2 < destination1) { - this.control.setTargetAtTime(destination2, t, this._rampDecayTC); - } - }; - - p5.Envelope.prototype.connect = function (unit) { - this.connection = unit; - - if ( - unit instanceof p5.Oscillator || - unit instanceof p5.SoundFile || - unit instanceof p5.AudioIn || - unit instanceof p5.Reverb || - unit instanceof p5.Noise || - unit instanceof p5.Filter || - unit instanceof p5.Delay - ) { - unit = unit.output.gain; - } - - if (unit instanceof AudioParam) { - unit.setValueAtTime(0, main.audiocontext.currentTime); - } - - this.output.connect(unit); - }; - - p5.Envelope.prototype.disconnect = function () { - if (this.output) { - this.output.disconnect(); - } - }; - - /** - * Add a value to the p5.Oscillator's output amplitude, - * and return the oscillator. Calling this method - * again will override the initial add() with new values. - * - * @method add - * @for p5.Envelope - * @param {Number} number Constant number to add - * @return {p5.Envelope} Envelope Returns this envelope - * with scaled output - */ - - p5.Envelope.prototype.add = function (num) { - var add = new Add_default.a(num); - var thisChain = this.mathOps.length; - var nextChain = this.output; - return p5.prototype._mathChain( - this, - add, - thisChain, - nextChain, - Add_default.a, - ); - }; - /** - * Multiply the p5.Envelope's output amplitude - * by a fixed value. Calling this method - * again will override the initial mult() with new values. - * - * @method mult - * @for p5.Envelope - * @param {Number} number Constant number to multiply - * @return {p5.Envelope} Envelope Returns this envelope - * with scaled output - */ - - p5.Envelope.prototype.mult = function (num) { - var mult = new Multiply_default.a(num); - var thisChain = this.mathOps.length; - var nextChain = this.output; - return p5.prototype._mathChain( - this, - mult, - thisChain, - nextChain, - Multiply_default.a, - ); - }; - /** - * Scale this envelope's amplitude values to a given - * range, and return the envelope. Calling this method - * again will override the initial scale() with new values. - * - * @method scale - * @for p5.Envelope - * @param {Number} inMin input range minumum - * @param {Number} inMax input range maximum - * @param {Number} outMin input range minumum - * @param {Number} outMax input range maximum - * @return {p5.Envelope} Envelope Returns this envelope - * with scaled output - */ - - p5.Envelope.prototype.scale = function (inMin, inMax, outMin, outMax) { - var scale = new Scale_default.a(inMin, inMax, outMin, outMax); - var thisChain = this.mathOps.length; - var nextChain = this.output; - return p5.prototype._mathChain( - this, - scale, - thisChain, - nextChain, - Scale_default.a, - ); - }; - - p5.Envelope.prototype.dispose = function () { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.disconnect(); - - if (this.control) { - this.control.dispose(); - this.control = null; - } - - for (var i = 1; i < this.mathOps.length; i++) { - this.mathOps[i].dispose(); - } - }; - - p5.Env = function (t1, l1, t2, l2, t3, l3) { - console.warn( - "WARNING: p5.Env is now deprecated and may be removed in future versions. " + - "Please use the new p5.Envelope instead.", - ); - p5.Envelope.call(this, t1, l1, t2, l2, t3, l3); - }; - - p5.Env.prototype = Object.create(p5.Envelope.prototype); - var Envelope = p5.Envelope; - var envelope = Envelope; - function noise_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - noise_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - noise_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return noise_typeof(obj); - } - - function noise_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function noise_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function noise_createClass(Constructor, protoProps, staticProps) { - if (protoProps) noise_defineProperties(Constructor.prototype, protoProps); - if (staticProps) noise_defineProperties(Constructor, staticProps); - return Constructor; - } - - function noise_possibleConstructorReturn(self, call) { - if ( - call && - (noise_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return noise_assertThisInitialized(self); - } - - function noise_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function noise_getPrototypeOf(o) { - noise_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return noise_getPrototypeOf(o); - } - - function noise_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) noise_setPrototypeOf(subClass, superClass); - } - - function noise_setPrototypeOf(o, p) { - noise_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return noise_setPrototypeOf(o, p); - } - - var _whiteNoiseBuffer = (function () { - var bufferSize = 2 * main.audiocontext.sampleRate; - var whiteBuffer = main.audiocontext.createBuffer( - 1, - bufferSize, - main.audiocontext.sampleRate, - ); - var noiseData = whiteBuffer.getChannelData(0); - - for (var i = 0; i < bufferSize; i++) { - noiseData[i] = Math.random() * 2 - 1; - } - - whiteBuffer.type = "white"; - return whiteBuffer; - })(); - - var _pinkNoiseBuffer = (function () { - var bufferSize = 2 * main.audiocontext.sampleRate; - var pinkBuffer = main.audiocontext.createBuffer( - 1, - bufferSize, - main.audiocontext.sampleRate, - ); - var noiseData = pinkBuffer.getChannelData(0); - var b0, b1, b2, b3, b4, b5, b6; - b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0.0; - - for (var i = 0; i < bufferSize; i++) { - var white = Math.random() * 2 - 1; - b0 = 0.99886 * b0 + white * 0.0555179; - b1 = 0.99332 * b1 + white * 0.0750759; - b2 = 0.969 * b2 + white * 0.153852; - b3 = 0.8665 * b3 + white * 0.3104856; - b4 = 0.55 * b4 + white * 0.5329522; - b5 = -0.7616 * b5 - white * 0.016898; - noiseData[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362; - noiseData[i] *= 0.11; - - b6 = white * 0.115926; - } - - pinkBuffer.type = "pink"; - return pinkBuffer; - })(); - - var _brownNoiseBuffer = (function () { - var bufferSize = 2 * main.audiocontext.sampleRate; - var brownBuffer = main.audiocontext.createBuffer( - 1, - bufferSize, - main.audiocontext.sampleRate, - ); - var noiseData = brownBuffer.getChannelData(0); - var lastOut = 0.0; - - for (var i = 0; i < bufferSize; i++) { - var white = Math.random() * 2 - 1; - noiseData[i] = (lastOut + 0.02 * white) / 1.02; - lastOut = noiseData[i]; - noiseData[i] *= 3.5; - } - - brownBuffer.type = "brown"; - return brownBuffer; - })(); - /** - * Noise is a type of oscillator that generates a buffer with random values. - * - * @class p5.Noise - * @extends p5.Oscillator - * @constructor - * @param {String} type Type of noise can be 'white' (default), - * 'brown' or 'pink'. - */ - - var noise_Noise = (function (_Oscillator) { - noise_inherits(Noise, _Oscillator); - - function Noise(type) { - var _this; - - noise_classCallCheck(this, Noise); - - _this = noise_possibleConstructorReturn( - this, - noise_getPrototypeOf(Noise).call(this), - ); - var assignType; - delete _this.f; - delete _this.freq; - delete _this.oscillator; - - if (type === "brown") { - assignType = _brownNoiseBuffer; - } else if (type === "pink") { - assignType = _pinkNoiseBuffer; - } else { - assignType = _whiteNoiseBuffer; - } - - _this.buffer = assignType; - return _this; - } - /** - * Set type of noise to 'white', 'pink' or 'brown'. - * White is the default. - * - * @method setType - * @param {String} [type] 'white', 'pink' or 'brown' - */ - - noise_createClass(Noise, [ - { - key: "setType", - value: function setType(type) { - switch (type) { - case "white": - this.buffer = _whiteNoiseBuffer; - break; - - case "pink": - this.buffer = _pinkNoiseBuffer; - break; - - case "brown": - this.buffer = _brownNoiseBuffer; - break; - - default: - this.buffer = _whiteNoiseBuffer; - } - - if (this.started) { - var now = main.audiocontext.currentTime; - this.stop(now); - this.start(now + 0.01); - } - }, - }, - { - key: "getType", - value: function getType() { - return this.buffer.type; - }, - }, - { - key: "start", - value: function start() { - if (this.started) { - this.stop(); - } - - this.noise = main.audiocontext.createBufferSource(); - this.noise.buffer = this.buffer; - this.noise.loop = true; - this.noise.connect(this.output); - var now = main.audiocontext.currentTime; - this.noise.start(now); - this.started = true; - }, - }, - { - key: "stop", - value: function stop() { - var now = main.audiocontext.currentTime; - - if (this.noise) { - this.noise.stop(now); - this.started = false; - } - }, - }, - { - key: "dispose", - value: function dispose() { - var now = main.audiocontext.currentTime; - - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.noise) { - this.noise.disconnect(); - this.stop(now); - } - - if (this.output) { - this.output.disconnect(); - } - - if (this.panner) { - this.panner.disconnect(); - } - - this.output = null; - this.panner = null; - this.buffer = null; - this.noise = null; - }, - }, - ]); - - return Noise; - })(oscillator); - - var noise = noise_Noise; - var Signal = __webpack_require__(2); - var Signal_default = __webpack_require__.n(Signal); - - function pulse_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - pulse_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - pulse_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return pulse_typeof(obj); - } - - function pulse_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function pulse_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function pulse_createClass(Constructor, protoProps, staticProps) { - if (protoProps) pulse_defineProperties(Constructor.prototype, protoProps); - if (staticProps) pulse_defineProperties(Constructor, staticProps); - return Constructor; - } - - function pulse_possibleConstructorReturn(self, call) { - if ( - call && - (pulse_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return pulse_assertThisInitialized(self); - } - - function pulse_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function pulse_getPrototypeOf(o) { - pulse_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return pulse_getPrototypeOf(o); - } - - function pulse_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) pulse_setPrototypeOf(subClass, superClass); - } - - function pulse_setPrototypeOf(o, p) { - pulse_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return pulse_setPrototypeOf(o, p); - } - - /** - * Creates a Pulse object, an oscillator that implements - * Pulse Width Modulation. - * The pulse is created with two oscillators. - * Accepts a parameter for frequency, and to set the - * width between the pulses. See - * p5.Oscillator for a full list of methods. - * - * @class p5.Pulse - * @extends p5.Oscillator - * @constructor - * @param {Number} [freq] Frequency in oscillations per second (Hz) - * @param {Number} [w] Width between the pulses (0 to 1.0, - * defaults to 0) - * @example - *
                          - * let pulse; - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(startPulse); - * background(220); - * - * pulse = new p5.Pulse(); - * pulse.amp(0.5); - * pulse.freq(220); - * } - * function startPulse() { - * pulse.start(); - * pulse.amp(0.5, 0.02); - * } - * function mouseReleased() { - * pulse.amp(0, 0.2); - * } - * function draw() { - * background(220); - * text('tap to play', 5, 20, width - 20); - * let w = map(mouseX, 0, width, 0, 1); - * w = constrain(w, 0, 1); - * pulse.width(w); - * text('pulse width: ' + w, 5, height - 20); - * } - *
                          - */ - - var pulse_Pulse = (function (_Oscillator) { - pulse_inherits(Pulse, _Oscillator); - - function Pulse(freq, w) { - var _this; - - pulse_classCallCheck(this, Pulse); - - _this = pulse_possibleConstructorReturn( - this, - pulse_getPrototypeOf(Pulse).call(this, freq, "sawtooth"), - ); - - _this.w = w || 0; - - _this.osc2 = new SawOsc(freq); - - _this.dNode = main.audiocontext.createDelay(); - - _this.dcOffset = createDCOffset(); - _this.dcGain = main.audiocontext.createGain(); - - _this.dcOffset.connect(_this.dcGain); - - _this.dcGain.connect(_this.output); - - _this.f = freq || 440; - var mW = _this.w / _this.oscillator.frequency.value; - _this.dNode.delayTime.value = mW; - _this.dcGain.gain.value = 1.7 * (0.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); - - return _this; - } - /** - * Set the width of a Pulse object (an oscillator that implements - * Pulse Width Modulation). - * - * @method width - * @param {Number} [width] Width between the pulses (0 to 1.0, - * defaults to 0) - */ - - pulse_createClass(Pulse, [ - { - key: "width", - value: function width(w) { - if (typeof w === "number") { - if (w <= 1.0 && w >= 0.0) { - this.w = w; - - var mW = this.w / this.oscillator.frequency.value; - this.dNode.delayTime.value = mW; - } - - this.dcGain.gain.value = 1.7 * (0.5 - this.w); - } else { - w.connect(this.dNode.delayTime); - var sig = new Signal_default.a(-0.5); - - w.connect(sig); - var mult1 = new Multiply_default.a(-1); - var mult2 = new Multiply_default.a(1.7); - sig = sig.connect(mult1).connect(mult2); - sig.connect(this.dcGain.gain); - } - }, - }, - { - key: "start", - value: function start(f, time) { - var now = main.audiocontext.currentTime; - var t = time || 0; - - if (!this.started) { - var freq = f || this.f; - var type = this.oscillator.type; - this.oscillator = main.audiocontext.createOscillator(); - this.oscillator.frequency.setValueAtTime(freq, now); - this.oscillator.type = type; - this.oscillator.connect(this.output); - this.oscillator.start(t + now); - - this.osc2.oscillator = main.audiocontext.createOscillator(); - this.osc2.oscillator.frequency.setValueAtTime(freq, t + now); - this.osc2.oscillator.type = type; - this.osc2.oscillator.connect(this.osc2.output); - this.osc2.start(t + now); - this.freqNode = [ - this.oscillator.frequency, - this.osc2.oscillator.frequency, - ]; - - this.dcOffset = createDCOffset(); - this.dcOffset.connect(this.dcGain); - this.dcOffset.start(t + now); - - if ( - this.mods !== undefined && - this.mods.frequency !== undefined - ) { - this.mods.frequency.connect(this.freqNode[0]); - this.mods.frequency.connect(this.freqNode[1]); - } - - this.started = true; - this.osc2.started = true; - } - }, - }, - { - key: "stop", - value: function stop(time) { - if (this.started) { - var t = time || 0; - var now = main.audiocontext.currentTime; - this.oscillator.stop(t + now); - - if (this.osc2.oscillator) { - this.osc2.oscillator.stop(t + now); - } - - this.dcOffset.stop(t + now); - this.started = false; - this.osc2.started = false; - } - }, - }, - { - key: "freq", - value: function freq(val) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var tFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - - if (typeof val === "number") { - this.f = val; - var now = main.audiocontext.currentTime; - var currentFreq = this.oscillator.frequency.value; - this.oscillator.frequency.cancelScheduledValues(now); - this.oscillator.frequency.setValueAtTime( - currentFreq, - now + tFromNow, - ); - this.oscillator.frequency.exponentialRampToValueAtTime( - val, - tFromNow + rampTime + now, - ); - this.osc2.oscillator.frequency.cancelScheduledValues(now); - this.osc2.oscillator.frequency.setValueAtTime( - currentFreq, - now + tFromNow, - ); - this.osc2.oscillator.frequency.exponentialRampToValueAtTime( - val, - tFromNow + rampTime + now, - ); - - if (this.freqMod) { - this.freqMod.output.disconnect(); - this.freqMod = null; - } - } else if (val.output) { - val.output.disconnect(); - val.output.connect(this.oscillator.frequency); - val.output.connect(this.osc2.oscillator.frequency); - this.freqMod = val; - } - }, - }, - ]); - - return Pulse; - })(oscillator); - - function createDCOffset() { - var ac = main.audiocontext; - var buffer = ac.createBuffer(1, 2048, ac.sampleRate); - var data = buffer.getChannelData(0); - - for (var i = 0; i < 2048; i++) { - data[i] = 1.0; - } - - var bufferSource = ac.createBufferSource(); - bufferSource.buffer = buffer; - bufferSource.loop = true; - return bufferSource; - } - - var pulse = pulse_Pulse; - function audioin_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function audioin_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function audioin_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - audioin_defineProperties(Constructor.prototype, protoProps); - if (staticProps) audioin_defineProperties(Constructor, staticProps); - return Constructor; - } - - main.inputSources = []; - /** - *

                          Get audio from an input, i.e. your computer's microphone.

                          - * - *

                          Turn the mic on/off with the start() and stop() methods. When the mic - * is on, its volume can be measured with getLevel or by connecting an - * FFT object.

                          - * - *

                          If you want to hear the AudioIn, use the .connect() method. - * AudioIn does not connect to p5.sound output by default to prevent - * feedback.

                          - * - *

                          Note: This uses the getUserMedia/ - * Stream API, which is not supported by certain browsers. Access in Chrome browser - * is limited to localhost and https, but access over http may be limited.

                          - * - * @class p5.AudioIn - * @constructor - * @param {Function} [errorCallback] A function to call if there is an error - * accessing the AudioIn. For example, - * Safari and iOS devices do not - * currently allow microphone access. - * @example - *
                          - * let mic; - * - * function setup(){ - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(userStartAudio); - * textAlign(CENTER); - * mic = new p5.AudioIn(); - * mic.start(); - * } - * - * function draw(){ - * background(0); - * fill(255); - * text('tap to start', width/2, 20); - * - * micLevel = mic.getLevel(); - * let y = height - micLevel * height; - * ellipse(width/2, y, 10, 10); - * } - *
                          - */ - - var audioin_AudioIn = (function () { - function AudioIn(errorCallback) { - audioin_classCallCheck(this, AudioIn); - - /** - * @property {GainNode} input - */ - this.input = main.audiocontext.createGain(); - /** - * @property {GainNode} output - */ - - this.output = main.audiocontext.createGain(); - /** - * @property {MediaStream|null} stream - */ - - this.stream = null; - /** - * @property {MediaStreamAudioSourceNode|null} mediaStream - */ - - this.mediaStream = null; - /** - * @property {Number|null} currentSource - */ - - this.currentSource = null; - /** - * Client must allow browser to access their microphone / audioin source. - * Default: false. Will become true when the client enables access. - * - * @property {Boolean} enabled - */ - - this.enabled = false; - /** - * Input amplitude, connect to it by default but not to master out - * - * @property {p5.Amplitude} amplitude - */ - - this.amplitude = new amplitude(); - this.output.connect(this.amplitude.input); - - if ( - !window.MediaStreamTrack || - !window.navigator.mediaDevices || - !window.navigator.mediaDevices.getUserMedia - ) { - errorCallback - ? errorCallback() - : window.alert( - "This browser does not support MediaStreamTrack and mediaDevices", - ); - } - - main.soundArray.push(this); - } - /** - * Start processing audio input. This enables the use of other - * AudioIn methods like getLevel(). Note that by default, AudioIn - * is not connected to p5.sound's output. So you won't hear - * anything unless you use the connect() method.
                          - * - * Certain browsers limit access to the user's microphone. For example, - * Chrome only allows access from localhost and over https. For this reason, - * you may want to include an errorCallback—a function that is called in case - * the browser won't provide mic access. - * - * @method start - * @for p5.AudioIn - * @param {Function} [successCallback] Name of a function to call on - * success. - * @param {Function} [errorCallback] Name of a function to call if - * there was an error. For example, - * some browsers do not support - * getUserMedia. - */ - - audioin_createClass(AudioIn, [ - { - key: "start", - value: function start(successCallback, errorCallback) { - var self = this; - - if (this.stream) { - this.stop(); - } - - var audioSource = main.inputSources[self.currentSource]; - var constraints = { - audio: { - sampleRate: main.audiocontext.sampleRate, - echoCancellation: false, - }, - }; - - if (main.inputSources[this.currentSource]) { - constraints.audio.deviceId = audioSource.deviceId; - } - - window.navigator.mediaDevices - .getUserMedia(constraints) - .then(function (stream) { - self.stream = stream; - self.enabled = true; - - self.mediaStream = - main.audiocontext.createMediaStreamSource(stream); - self.mediaStream.connect(self.output); - - self.amplitude.setInput(self.output); - if (successCallback) successCallback(); - }) - ["catch"](function (err) { - if (errorCallback) errorCallback(err); - else console.error(err); - }); - }, - /** - * Turn the AudioIn off. If the AudioIn is stopped, it cannot getLevel(). - * If re-starting, the user may be prompted for permission access. - * - * @method stop - * @for p5.AudioIn - */ - }, - { - key: "stop", - value: function stop() { - if (this.stream) { - this.stream.getTracks().forEach(function (track) { - track.stop(); - }); - this.mediaStream.disconnect(); - delete this.mediaStream; - delete this.stream; - } - }, - /** - * Connect to an audio unit. If no parameter is provided, will - * connect to the main output (i.e. your speakers).
                          - * - * @method connect - * @for p5.AudioIn - * @param {Object} [unit] An object that accepts audio input, - * such as an FFT - */ - }, - { - key: "connect", - value: function connect(unit) { - if (unit) { - if (unit.hasOwnProperty("input")) { - this.output.connect(unit.input); - } else if (unit.hasOwnProperty("analyser")) { - this.output.connect(unit.analyser); - } else { - this.output.connect(unit); - } - } else { - this.output.connect(main.input); - } - }, - /** - * Disconnect the AudioIn from all audio units. For example, if - * connect() had been called, disconnect() will stop sending - * signal to your speakers.
                          - * - * @method disconnect - * @for p5.AudioIn - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - - this.output.connect(this.amplitude.input); - } - }, - /** - * Read the Amplitude (volume level) of an AudioIn. The AudioIn - * class contains its own instance of the Amplitude class to help - * make it easy to get a microphone's volume level. Accepts an - * optional smoothing value (0.0 < 1.0). NOTE: AudioIn must - * .start() before using .getLevel().
                          - * - * @method getLevel - * @for p5.AudioIn - * @param {Number} [smoothing] Smoothing is 0.0 by default. - * Smooths values based on previous values. - * @return {Number} Volume level (between 0.0 and 1.0) - */ - }, - { - key: "getLevel", - value: function getLevel(smoothing) { - if (smoothing) { - this.amplitude.smoothing = smoothing; - } - - return this.amplitude.getLevel(); - }, - /** - * Set amplitude (volume) of a mic input between 0 and 1.0.
                          - * - * @method amp - * @for p5.AudioIn - * @param {Number} vol between 0 and 1.0 - * @param {Number} [time] ramp time (optional) - */ - }, - { - key: "amp", - value: function amp(vol, t) { - if (t) { - var rampTime = t || 0; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues( - main.audiocontext.currentTime, - ); - this.output.gain.setValueAtTime( - currentVol, - main.audiocontext.currentTime, - ); - this.output.gain.linearRampToValueAtTime( - vol, - rampTime + main.audiocontext.currentTime, - ); - } else { - this.output.gain.cancelScheduledValues( - main.audiocontext.currentTime, - ); - this.output.gain.setValueAtTime( - vol, - main.audiocontext.currentTime, - ); - } - }, - /** - * Returns a list of available input sources. This is a wrapper - * for - * MediaDevices.enumerateDevices() - Web APIs | MDN - * and it returns a Promise. - * @method getSources - * @for p5.AudioIn - * @param {Function} [successCallback] This callback function handles the sources when they - * have been enumerated. The callback function - * receives the deviceList array as its only argument - * @param {Function} [errorCallback] This optional callback receives the error - * message as its argument. - * @returns {Promise} Returns a Promise that can be used in place of the callbacks, similar - * to the enumerateDevices() method - * @example - *
                          - * let audioIn; - * - * function setup(){ - * text('getting sources...', 0, 20); - * audioIn = new p5.AudioIn(); - * audioIn.getSources(gotSources); - * } - * - * function gotSources(deviceList) { - * if (deviceList.length > 0) { - * //set the source to the first item in the deviceList array - * audioIn.setSource(0); - * let currentSource = deviceList[audioIn.currentSource]; - * text('set source to: ' + currentSource.deviceId, 5, 20, width); - * } - * } - *
                          - */ - }, - { - key: "getSources", - value: function getSources(onSuccess, onError) { - return new Promise(function (resolve, reject) { - window.navigator.mediaDevices - .enumerateDevices() - .then(function (devices) { - main.inputSources = devices.filter(function (device) { - return device.kind === "audioinput"; - }); - resolve(main.inputSources); - - if (onSuccess) { - onSuccess(main.inputSources); - } - }) - ["catch"](function (error) { - reject(error); - - if (onError) { - onError(error); - } else { - console.error( - "This browser does not support MediaStreamTrack.getSources()", - ); - } - }); - }); - }, - /** - * Set the input source. Accepts a number representing a - * position in the array returned by getSources(). - * This is only available in browsers that support - * - * navigator.mediaDevices.enumerateDevices() - * - * @method setSource - * @for p5.AudioIn - * @param {number} num position of input source in the array - * @example - *
                          - * let audioIn; - * - * function setup(){ - * text('getting sources...', 0, 20); - * audioIn = new p5.AudioIn(); - * audioIn.getSources(gotSources); - * } - * - * function gotSources(deviceList) { - * if (deviceList.length > 0) { - * //set the source to the first item in the deviceList array - * audioIn.setSource(0); - * let currentSource = deviceList[audioIn.currentSource]; - * text('set source to: ' + currentSource.deviceId, 5, 20, width); - * } - * } - *
                          - */ - }, - { - key: "setSource", - value: function setSource(num) { - if ( - main.inputSources.length > 0 && - num < main.inputSources.length - ) { - this.currentSource = num; - console.log( - "set source to ", - main.inputSources[this.currentSource], - ); - } else { - console.log("unable to set input source"); - } - - if (this.stream && this.stream.active) { - this.start(); - } - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.stop(); - - if (this.output) { - this.output.disconnect(); - } - - if (this.amplitude) { - this.amplitude.disconnect(); - } - - delete this.amplitude; - delete this.output; - }, - }, - ]); - - return AudioIn; - })(); - - var audioin = audioin_AudioIn; - var CrossFade = __webpack_require__(23); - var CrossFade_default = __webpack_require__.n(CrossFade); - - function effect_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function effect_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function effect_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - effect_defineProperties(Constructor.prototype, protoProps); - if (staticProps) effect_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * Effect is a base class for audio effects in p5.
                          - * This module handles the nodes and methods that are - * common and useful for current and future effects. - * - * - * This class is extended by p5.Distortion, - * p5.Compressor, - * p5.Delay, - * p5.Filter, - * p5.Reverb. - * - * @class p5.Effect - * @constructor - * - * @param {Object} [ac] Reference to the audio context of the p5 object - * @param {AudioNode} [input] Gain Node effect wrapper - * @param {AudioNode} [output] Gain Node effect wrapper - * @param {Object} [_drywet] Tone.JS CrossFade node (defaults to value: 1) - * @param {AudioNode} [wet] Effects that extend this class should connect - * to the wet signal to this gain node, so that dry and wet - * signals are mixed properly. - */ - - var effect_Effect = (function () { - function Effect() { - effect_classCallCheck(this, Effect); - - this.ac = main.audiocontext; - this.input = this.ac.createGain(); - this.output = this.ac.createGain(); - /** - * The p5.Effect class is built - * using Tone.js CrossFade - * @private - */ - - this._drywet = new CrossFade_default.a(1); - /** - * In classes that extend - * p5.Effect, connect effect nodes - * to the wet parameter - */ - - this.wet = this.ac.createGain(); - this.input.connect(this._drywet.a); - this.wet.connect(this._drywet.b); - - this._drywet.connect(this.output); - - this.connect(); - - main.soundArray.push(this); - } - /** - * Set the output volume of the filter. - * - * @method amp - * @for p5.Effect - * @param {Number} [vol] amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts until rampTime - * @param {Number} [tFromNow] schedule this event to happen in tFromNow seconds - */ - - effect_createClass(Effect, [ - { - key: "amp", - value: function amp(vol) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var tFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - var now = main.audiocontext.currentTime; - var startTime = now + tFromNow; - var endTime = startTime + rampTime + 0.001; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(now); - this.output.gain.linearRampToValueAtTime( - currentVol, - startTime + 0.001, - ); - this.output.gain.linearRampToValueAtTime(vol, endTime); - }, - /** - * Link effects together in a chain - * Example usage: filter.chain(reverb, delay, panner); - * May be used with an open-ended number of arguments - * - * @method chain - * @for p5.Effect - * @param {Object} [arguments] Chain together multiple sound objects - */ - }, - { - key: "chain", - value: function chain() { - if (arguments.length > 0) { - this.connect(arguments[0]); - - for (var i = 1; i < arguments.length; i += 1) { - arguments[i - 1].connect(arguments[i]); - } - } - - return this; - }, - /** - * Adjust the dry/wet value. - * - * @method drywet - * @for p5.Effect - * @param {Number} [fade] The desired drywet value (0 - 1.0) - */ - }, - { - key: "drywet", - value: function drywet(fade) { - if (typeof fade !== "undefined") { - this._drywet.fade.value = fade; - } - - return this._drywet.fade.value; - }, - /** - * Send output to a p5.js-sound, Web Audio Node, or use signal to - * control an AudioParam - * - * @method connect - * @for p5.Effect - * @param {Object} unit - */ - }, - { - key: "connect", - value: function connect(unit) { - var u = unit || p5.soundOut.input; - this.output.connect(u.input ? u.input : u); - }, - /** - * Disconnect all output. - * @method disconnect - * @for p5.Effect - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.input) { - this.input.disconnect(); - delete this.input; - } - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - - if (this._drywet) { - this._drywet.disconnect(); - - delete this._drywet; - } - - if (this.wet) { - this.wet.disconnect(); - delete this.wet; - } - - this.ac = undefined; - }, - }, - ]); - - return Effect; - })(); - - var effect = effect_Effect; - function filter_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - filter_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - filter_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return filter_typeof(obj); - } - - function filter_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function filter_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function filter_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - filter_defineProperties(Constructor.prototype, protoProps); - if (staticProps) filter_defineProperties(Constructor, staticProps); - return Constructor; - } - - function filter_possibleConstructorReturn(self, call) { - if ( - call && - (filter_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return filter_assertThisInitialized(self); - } - - function filter_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = filter_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function filter_getPrototypeOf(o) { - filter_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return filter_getPrototypeOf(o); - } - - function filter_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) filter_setPrototypeOf(subClass, superClass); - } - - function filter_setPrototypeOf(o, p) { - filter_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return filter_setPrototypeOf(o, p); - } - - /** - *

                          A p5.Filter uses a Web Audio Biquad Filter to filter - * the frequency response of an input source. Subclasses - * include:

                          - * p5.LowPass: - * Allows frequencies below the cutoff frequency to pass through, - * and attenuates frequencies above the cutoff.
                          - * p5.HighPass: - * The opposite of a lowpass filter.
                          - * p5.BandPass: - * Allows a range of frequencies to pass through and attenuates - * the frequencies below and above this frequency range.
                          - * - * The .res() method controls either width of the - * bandpass, or resonance of the low/highpass cutoff frequency. - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Filter - * @extends p5.Effect - * @constructor - * @param {String} [type] 'lowpass' (default), 'highpass', 'bandpass' - * @example - *
                          - * let fft, noise, filter; - * - * function setup() { - * let cnv = createCanvas(100,100); - * cnv.mousePressed(makeNoise); - * fill(255, 0, 255); - * - * filter = new p5.BandPass(); - * noise = new p5.Noise(); - * noise.disconnect(); - * noise.connect(filter); - * - * fft = new p5.FFT(); - * } - * - * function draw() { - * background(220); - * - * // set the BandPass frequency based on mouseX - * let freq = map(mouseX, 0, width, 20, 10000); - * freq = constrain(freq, 0, 22050); - * filter.freq(freq); - * // give the filter a narrow band (lower res = wider bandpass) - * filter.res(50); - * - * // draw filtered spectrum - * let spectrum = fft.analyze(); - * noStroke(); - * for (let i = 0; i < spectrum.length; i++) { - * let x = map(i, 0, spectrum.length, 0, width); - * let h = -height + map(spectrum[i], 0, 255, height, 0); - * rect(x, height, width/spectrum.length, h); - * } - * if (!noise.started) { - * text('tap here and drag to change frequency', 10, 20, width - 20); - * } else { - * text('Frequency: ' + round(freq)+'Hz', 20, 20, width - 20); - * } - * } - * - * function makeNoise() { - * // see also: `userStartAudio()` - * noise.start(); - * noise.amp(0.5, 0.2); - * } - * - * function mouseReleased() { - * noise.amp(0, 0.2); - * } - * - *
                          - */ - - var Filter = (function (_Effect) { - filter_inherits(Filter, _Effect); - - function Filter(type) { - var _this; - - filter_classCallCheck(this, Filter); - - _this = filter_possibleConstructorReturn( - this, - filter_getPrototypeOf(Filter).call(this), - ); - - /** - * The p5.Filter is built with a - * - * Web Audio BiquadFilter Node. - * - * @property {DelayNode} biquadFilter - */ - - _this.biquad = _this.ac.createBiquadFilter(); - - _this.input.connect(_this.biquad); - - _this.biquad.connect(_this.wet); - - if (type) { - _this.setType(type); - } - - _this._on = true; - _this._untoggledType = _this.biquad.type; - return _this; - } - /** - * Filter an audio signal according to a set - * of filter parameters. - * - * @method process - * @param {Object} Signal An object that outputs audio - * @param {Number} [freq] Frequency in Hz, from 10 to 22050 - * @param {Number} [res] Resonance/Width of the filter frequency - * from 0.001 to 1000 - */ - - filter_createClass(Filter, [ - { - key: "process", - value: function process(src, freq, res, time) { - src.connect(this.input); - this.set(freq, res, time); - }, - /** - * Set the frequency and the resonance of the filter. - * - * @method set - * @param {Number} [freq] Frequency in Hz, from 10 to 22050 - * @param {Number} [res] Resonance (Q) from 0.001 to 1000 - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - }, - { - key: "set", - value: function set(freq, res, time) { - if (freq) { - this.freq(freq, time); - } - - if (res) { - this.res(res, time); - } - }, - /** - * Set the filter frequency, in Hz, from 10 to 22050 (the range of - * human hearing, although in reality most people hear in a narrower - * range). - * - * @method freq - * @param {Number} freq Filter Frequency - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @return {Number} value Returns the current frequency value - */ - }, - { - key: "freq", - value: function freq(_freq, time) { - var t = time || 0; - - if (_freq <= 0) { - _freq = 1; - } - - if (typeof _freq === "number") { - this.biquad.frequency.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.biquad.frequency.exponentialRampToValueAtTime( - _freq, - this.ac.currentTime + 0.02 + t, - ); - } else if (_freq) { - _freq.connect(this.biquad.frequency); - } - - return this.biquad.frequency.value; - }, - /** - * Controls either width of a bandpass frequency, - * or the resonance of a low/highpass cutoff frequency. - * - * @method res - * @param {Number} res Resonance/Width of filter freq - * from 0.001 to 1000 - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - * @return {Number} value Returns the current res value - */ - }, - { - key: "res", - value: function res(_res, time) { - var t = time || 0; - - if (typeof _res === "number") { - this.biquad.Q.value = _res; - this.biquad.Q.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.biquad.Q.linearRampToValueAtTime( - _res, - this.ac.currentTime + 0.02 + t, - ); - } else if (_res) { - _res.connect(this.biquad.Q); - } - - return this.biquad.Q.value; - }, - /** - * Controls the gain attribute of a Biquad Filter. - * This is distinctly different from .amp() which is inherited from p5.Effect - * .amp() controls the volume via the output gain node - * p5.Filter.gain() controls the gain parameter of a Biquad Filter node. - * - * @method gain - * @param {Number} gain - * @return {Number} Returns the current or updated gain value - */ - }, - { - key: "gain", - value: function gain(_gain, time) { - var t = time || 0; - - if (typeof _gain === "number") { - this.biquad.gain.value = _gain; - this.biquad.gain.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.biquad.gain.linearRampToValueAtTime( - _gain, - this.ac.currentTime + 0.02 + t, - ); - } else if (_gain) { - _gain.connect(this.biquad.gain); - } - - return this.biquad.gain.value; - }, - /** - * Toggle function. Switches between the specified type and allpass - * - * @method toggle - * @return {boolean} [Toggle value] - */ - }, - { - key: "toggle", - value: function toggle() { - this._on = !this._on; - - if (this._on === true) { - this.biquad.type = this._untoggledType; - } else if (this._on === false) { - this.biquad.type = "allpass"; - } - - return this._on; - }, - /** - * Set the type of a p5.Filter. Possible types include: - * "lowpass" (default), "highpass", "bandpass", - * "lowshelf", "highshelf", "peaking", "notch", - * "allpass". - * - * @method setType - * @param {String} t - */ - }, - { - key: "setType", - value: function setType(t) { - this.biquad.type = t; - this._untoggledType = this.biquad.type; - }, - }, - { - key: "dispose", - value: function dispose() { - _get(filter_getPrototypeOf(Filter.prototype), "dispose", this).call( - this, - ); - - if (this.biquad) { - this.biquad.disconnect(); - delete this.biquad; - } - }, - }, - ]); - - return Filter; - })(effect); - /** - * Constructor: new p5.LowPass() Filter. - * This is the same as creating a p5.Filter and then calling - * its method setType('lowpass'). - * See p5.Filter for methods. - * - * @class p5.LowPass - * @constructor - * @extends p5.Filter - */ - - var LowPass = (function (_Filter) { - filter_inherits(LowPass, _Filter); - - function LowPass() { - filter_classCallCheck(this, LowPass); - - return filter_possibleConstructorReturn( - this, - filter_getPrototypeOf(LowPass).call(this, "lowpass"), - ); - } - - return LowPass; - })(Filter); - /** - * Constructor: new p5.HighPass() Filter. - * This is the same as creating a p5.Filter and then calling - * its method setType('highpass'). - * See p5.Filter for methods. - * - * @class p5.HighPass - * @constructor - * @extends p5.Filter - */ - - var HighPass = (function (_Filter2) { - filter_inherits(HighPass, _Filter2); - - function HighPass() { - filter_classCallCheck(this, HighPass); - - return filter_possibleConstructorReturn( - this, - filter_getPrototypeOf(HighPass).call(this, "highpass"), - ); - } - - return HighPass; - })(Filter); - /** - * Constructor: new p5.BandPass() Filter. - * This is the same as creating a p5.Filter and then calling - * its method setType('bandpass'). - * See p5.Filter for methods. - * - * @class p5.BandPass - * @constructor - * @extends p5.Filter - */ - - var BandPass = (function (_Filter3) { - filter_inherits(BandPass, _Filter3); - - function BandPass() { - filter_classCallCheck(this, BandPass); - - return filter_possibleConstructorReturn( - this, - filter_getPrototypeOf(BandPass).call(this, "bandpass"), - ); - } - - return BandPass; - })(Filter); - - var filter = Filter; - - function eqFilter_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - eqFilter_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - eqFilter_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return eqFilter_typeof(obj); - } - - function eqFilter_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function eqFilter_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function eqFilter_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - eqFilter_defineProperties(Constructor.prototype, protoProps); - if (staticProps) eqFilter_defineProperties(Constructor, staticProps); - return Constructor; - } - - function eqFilter_possibleConstructorReturn(self, call) { - if ( - call && - (eqFilter_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return eqFilter_assertThisInitialized(self); - } - - function eqFilter_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function eqFilter_getPrototypeOf(o) { - eqFilter_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return eqFilter_getPrototypeOf(o); - } - - function eqFilter_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) eqFilter_setPrototypeOf(subClass, superClass); - } - - function eqFilter_setPrototypeOf(o, p) { - eqFilter_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return eqFilter_setPrototypeOf(o, p); - } - - /** - * EQFilter extends p5.Filter with constraints - * necessary for the p5.EQ - * - * @private - */ - - var eqFilter_EQFilter = (function (_Filter) { - eqFilter_inherits(EQFilter, _Filter); - - function EQFilter(freq, res) { - var _this; - - eqFilter_classCallCheck(this, EQFilter); - - _this = eqFilter_possibleConstructorReturn( - this, - eqFilter_getPrototypeOf(EQFilter).call(this, "peaking"), - ); - - _this.disconnect(); - - _this.set(freq, res); - - _this.biquad.gain.value = 0; - delete _this.input; - delete _this.output; - delete _this._drywet; - delete _this.wet; - return _this; - } - - eqFilter_createClass(EQFilter, [ - { - key: "amp", - value: function amp() { - console.warn( - "`amp()` is not available for p5.EQ bands. Use `.gain()`", - ); - }, - }, - { - key: "drywet", - value: function drywet() { - console.warn("`drywet()` is not available for p5.EQ bands."); - }, - }, - { - key: "connect", - value: function connect(unit) { - var u = unit || p5.soundOut.input; - - if (this.biquad) { - this.biquad.connect(u.input ? u.input : u); - } else { - this.output.connect(u.input ? u.input : u); - } - }, - }, - { - key: "disconnect", - value: function disconnect() { - if (this.biquad) { - this.biquad.disconnect(); - } - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - this.disconnect(); - delete this.biquad; - }, - }, - ]); - - return EQFilter; - })(filter); - - var eqFilter = eqFilter_EQFilter; - function eq_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - eq_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - eq_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return eq_typeof(obj); - } - - function eq_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function eq_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function eq_createClass(Constructor, protoProps, staticProps) { - if (protoProps) eq_defineProperties(Constructor.prototype, protoProps); - if (staticProps) eq_defineProperties(Constructor, staticProps); - return Constructor; - } - - function eq_possibleConstructorReturn(self, call) { - if ( - call && - (eq_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return eq_assertThisInitialized(self); - } - - function eq_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function eq_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - eq_get = Reflect.get; - } else { - eq_get = function _get(target, property, receiver) { - var base = eq_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return eq_get(target, property, receiver || target); - } - - function eq_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = eq_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function eq_getPrototypeOf(o) { - eq_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return eq_getPrototypeOf(o); - } - - function eq_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) eq_setPrototypeOf(subClass, superClass); - } - - function eq_setPrototypeOf(o, p) { - eq_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return eq_setPrototypeOf(o, p); - } - - /** - * p5.EQ is an audio effect that performs the function of a multiband - * audio equalizer. Equalization is used to adjust the balance of - * frequency compoenents of an audio signal. This process is commonly used - * in sound production and recording to change the waveform before it reaches - * a sound output device. EQ can also be used as an audio effect to create - * interesting distortions by filtering out parts of the spectrum. p5.EQ is - * built using a chain of Web Audio Biquad Filter Nodes and can be - * instantiated with 3 or 8 bands. Bands can be added or removed from - * the EQ by directly modifying p5.EQ.bands (the array that stores filters). - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.EQ - * @constructor - * @extends p5.Effect - * @param {Number} [_eqsize] Constructor will accept 3 or 8, defaults to 3 - * @return {Object} p5.EQ object - * - * @example - *
                          - * let eq, soundFile - * let eqBandIndex = 0; - * let eqBandNames = ['lows', 'mids', 'highs']; - * - * function preload() { - * soundFormats('mp3', 'ogg'); - * soundFile = loadSound('assets/beat'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(toggleSound); - * - * eq = new p5.EQ(eqBandNames.length); - * soundFile.disconnect(); - * eq.process(soundFile); - * } - * - * function draw() { - * background(30); - * noStroke(); - * fill(255); - * textAlign(CENTER); - * text('filtering ', 50, 25); - * - * fill(255, 40, 255); - * textSize(26); - * text(eqBandNames[eqBandIndex], 50, 55); - * - * fill(255); - * textSize(9); - * - * if (!soundFile.isPlaying()) { - * text('tap to play', 50, 80); - * } else { - * text('tap to filter next band', 50, 80) - * } - * } - * - * function toggleSound() { - * if (!soundFile.isPlaying()) { - * soundFile.play(); - * } else { - * eqBandIndex = (eqBandIndex + 1) % eq.bands.length; - * } - * - * for (let i = 0; i < eq.bands.length; i++) { - * eq.bands[i].gain(0); - * } - * // filter the band we want to filter - * eq.bands[eqBandIndex].gain(-40); - * } - *
                          - */ - - var eq_EQ = (function (_Effect) { - eq_inherits(EQ, _Effect); - - function EQ(_eqsize) { - var _this; - - eq_classCallCheck(this, EQ); - - _this = eq_possibleConstructorReturn( - this, - eq_getPrototypeOf(EQ).call(this), - ); - - _eqsize = _eqsize === 3 || _eqsize === 8 ? _eqsize : 3; - var factor; - _eqsize === 3 ? (factor = Math.pow(2, 3)) : (factor = 2); - /** - * The p5.EQ is built with abstracted p5.Filter objects. - * To modify any bands, use methods of the - * p5.Filter API, especially `gain` and `freq`. - * Bands are stored in an array, with indices 0 - 3, or 0 - 7 - * @property {Array} bands - * - */ - - _this.bands = []; - var freq, res; - - for (var i = 0; i < _eqsize; i++) { - if (i === _eqsize - 1) { - freq = 21000; - res = 0.01; - } else if (i === 0) { - freq = 100; - res = 0.1; - } else if (i === 1) { - freq = _eqsize === 3 ? 360 * factor : 360; - res = 1; - } else { - freq = _this.bands[i - 1].freq() * factor; - res = 1; - } - - _this.bands[i] = _this._newBand(freq, res); - - if (i > 0) { - _this.bands[i - 1].connect(_this.bands[i].biquad); - } else { - _this.input.connect(_this.bands[i].biquad); - } - } - - _this.bands[_eqsize - 1].connect(_this.output); - - return _this; - } - /** - * Process an input by connecting it to the EQ - * @method process - * @param {Object} src Audio source - */ - - eq_createClass(EQ, [ - { - key: "process", - value: function process(src) { - src.connect(this.input); - }, - // * Set the frequency and gain of each band in the EQ. This method should be - // * called with 3 or 8 frequency and gain pairs, depending on the size of the EQ. - // * ex. eq.set(freq0, gain0, freq1, gain1, freq2, gain2); - // * - // * @method set - // * @for p5.EQ - // * @param {Number} [freq0] Frequency value for band with index 0 - // * @param {Number} [gain0] Gain value for band with index 0 - // * @param {Number} [freq1] Frequency value for band with index 1 - // * @param {Number} [gain1] Gain value for band with index 1 - // * @param {Number} [freq2] Frequency value for band with index 2 - // * @param {Number} [gain2] Gain value for band with index 2 - // * @param {Number} [freq3] Frequency value for band with index 3 - // * @param {Number} [gain3] Gain value for band with index 3 - // * @param {Number} [freq4] Frequency value for band with index 4 - // * @param {Number} [gain4] Gain value for band with index 4 - // * @param {Number} [freq5] Frequency value for band with index 5 - // * @param {Number} [gain5] Gain value for band with index 5 - // * @param {Number} [freq6] Frequency value for band with index 6 - // * @param {Number} [gain6] Gain value for band with index 6 - // * @param {Number} [freq7] Frequency value for band with index 7 - // * @param {Number} [gain7] Gain value for band with index 7 - // */ - }, - { - key: "set", - value: function set() { - if (arguments.length === this.bands.length * 2) { - for (var i = 0; i < arguments.length; i += 2) { - this.bands[i / 2].freq(arguments[i]); - this.bands[i / 2].gain(arguments[i + 1]); - } - } else { - console.error( - "Argument mismatch. .set() should be called with " + - this.bands.length * 2 + - " arguments. (one frequency and gain value pair for each band of the eq)", - ); - } - }, - /** - * Add a new band. Creates a p5.Filter and strips away everything but - * the raw biquad filter. This method returns an abstracted p5.Filter, - * which can be added to p5.EQ.bands, in order to create new EQ bands. - * @private - * @for p5.EQ - * @method _newBand - * @param {Number} freq - * @param {Number} res - * @return {Object} Abstracted Filter - */ - }, - { - key: "_newBand", - value: function _newBand(freq, res) { - return new eqFilter(freq, res); - }, - }, - { - key: "dispose", - value: function dispose() { - eq_get(eq_getPrototypeOf(EQ.prototype), "dispose", this).call(this); - - if (this.bands) { - while (this.bands.length > 0) { - delete this.bands.pop().dispose(); - } - - delete this.bands; - } - }, - }, - ]); - - return EQ; - })(effect); - - var eq = eq_EQ; - function listener3d_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function listener3d_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function listener3d_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - listener3d_defineProperties(Constructor.prototype, protoProps); - if (staticProps) listener3d_defineProperties(Constructor, staticProps); - return Constructor; - } - - // * listener is a class that can construct both a Spatial Panner - // * and a Spatial Listener. The panner is based on the - // * Web Audio Spatial Panner Node - // * https://www.w3.org/TR/webaudio/#the-listenernode-interface - // * This panner is a spatial processing node that allows audio to be positioned - // * and oriented in 3D space. - // * - // * The Listener modifies the properties of the Audio Context Listener. - // * Both objects types use the same methods. The default is a spatial panner. - // * - // * p5.Panner3D - Constructs a Spatial Panner
                          - // * p5.Listener3D - Constructs a Spatial Listener
                          - // * - // * @class listener - // * @constructor - // * @return {Object} p5.Listener3D Object - // * - // * @param {Web Audio Node} listener Web Audio Spatial Panning Node - // * @param {AudioParam} listener.panningModel "equal power" or "HRTF" - // * @param {AudioParam} listener.distanceModel "linear", "inverse", or "exponential" - // * @param {String} [type] [Specify construction of a spatial panner or listener] - // */ - - var listener3d_Listener3D = (function () { - function Listener3D(type) { - listener3d_classCallCheck(this, Listener3D); - - this.ac = main.audiocontext; - this.listener = this.ac.listener; - } - // * Connect an audio sorce - // * @param {Object} src Input source - // */ - - listener3d_createClass(Listener3D, [ - { - key: "process", - value: function process(src) { - src.connect(this.input); - }, - // * Set the X,Y,Z position of the Panner - // * @param {[Number]} xVal - // * @param {[Number]} yVal - // * @param {[Number]} zVal - // * @param {[Number]} time - // * @return {[Array]} [Updated x, y, z values as an array] - // */ - }, - { - key: "position", - value: function position(xVal, yVal, zVal, time) { - this.positionX(xVal, time); - this.positionY(yVal, time); - this.positionZ(zVal, time); - return [ - this.listener.positionX.value, - this.listener.positionY.value, - this.listener.positionZ.value, - ]; - }, - // * Getter and setter methods for position coordinates - // * @return {Number} [updated coordinate value] - // */ - }, - { - key: "positionX", - value: function positionX(xVal, time) { - var t = time || 0; - - if (typeof xVal === "number") { - this.listener.positionX.value = xVal; - this.listener.positionX.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.positionX.linearRampToValueAtTime( - xVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (xVal) { - xVal.connect(this.listener.positionX); - } - - return this.listener.positionX.value; - }, - }, - { - key: "positionY", - value: function positionY(yVal, time) { - var t = time || 0; - - if (typeof yVal === "number") { - this.listener.positionY.value = yVal; - this.listener.positionY.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.positionY.linearRampToValueAtTime( - yVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (yVal) { - yVal.connect(this.listener.positionY); - } - - return this.listener.positionY.value; - }, - }, - { - key: "positionZ", - value: function positionZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === "number") { - this.listener.positionZ.value = zVal; - this.listener.positionZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.positionZ.linearRampToValueAtTime( - zVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (zVal) { - zVal.connect(this.listener.positionZ); - } - - return this.listener.positionZ.value; - }, - // * Overrides the listener orient() method because Listener has slightly - // * different params. In human terms, Forward vectors are the direction the - // * nose is pointing. Up vectors are the direction of the top of the head. - // * - // * @method orient - // * @param {Number} xValF Forward vector X direction - // * @param {Number} yValF Forward vector Y direction - // * @param {Number} zValF Forward vector Z direction - // * @param {Number} xValU Up vector X direction - // * @param {Number} yValU Up vector Y direction - // * @param {Number} zValU Up vector Z direction - // * @param {Number} time - // * @return {Array} All orienation params - // */ - }, - { - key: "orient", - value: function orient( - xValF, - yValF, - zValF, - xValU, - yValU, - zValU, - time, - ) { - if (arguments.length === 3 || arguments.length === 4) { - time = arguments[3]; - this.orientForward(xValF, yValF, zValF, time); - } else if (arguments.length === 6 || arguments === 7) { - this.orientForward(xValF, yValF, zValF); - this.orientUp(xValU, yValU, zValU, time); - } - - return [ - this.listener.forwardX.value, - this.listener.forwardY.value, - this.listener.forwardZ.value, - this.listener.upX.value, - this.listener.upY.value, - this.listener.upZ.value, - ]; - }, - }, - { - key: "orientForward", - value: function orientForward(xValF, yValF, zValF, time) { - this.forwardX(xValF, time); - this.forwardY(yValF, time); - this.forwardZ(zValF, time); - return [ - this.listener.forwardX, - this.listener.forwardY, - this.listener.forwardZ, - ]; - }, - }, - { - key: "orientUp", - value: function orientUp(xValU, yValU, zValU, time) { - this.upX(xValU, time); - this.upY(yValU, time); - this.upZ(zValU, time); - return [this.listener.upX, this.listener.upY, this.listener.upZ]; - }, - // * Getter and setter methods for orient coordinates - // * @return {Number} [updated coordinate value] - // */ - }, - { - key: "forwardX", - value: function forwardX(xVal, time) { - var t = time || 0; - - if (typeof xVal === "number") { - this.listener.forwardX.value = xVal; - this.listener.forwardX.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.forwardX.linearRampToValueAtTime( - xVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (xVal) { - xVal.connect(this.listener.forwardX); - } - - return this.listener.forwardX.value; - }, - }, - { - key: "forwardY", - value: function forwardY(yVal, time) { - var t = time || 0; - - if (typeof yVal === "number") { - this.listener.forwardY.value = yVal; - this.listener.forwardY.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.forwardY.linearRampToValueAtTime( - yVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (yVal) { - yVal.connect(this.listener.forwardY); - } - - return this.listener.forwardY.value; - }, - }, - { - key: "forwardZ", - value: function forwardZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === "number") { - this.listener.forwardZ.value = zVal; - this.listener.forwardZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.forwardZ.linearRampToValueAtTime( - zVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (zVal) { - zVal.connect(this.listener.forwardZ); - } - - return this.listener.forwardZ.value; - }, - }, - { - key: "upX", - value: function upX(xVal, time) { - var t = time || 0; - - if (typeof xVal === "number") { - this.listener.upX.value = xVal; - this.listener.upX.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.upX.linearRampToValueAtTime( - xVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (xVal) { - xVal.connect(this.listener.upX); - } - - return this.listener.upX.value; - }, - }, - { - key: "upY", - value: function upY(yVal, time) { - var t = time || 0; - - if (typeof yVal === "number") { - this.listener.upY.value = yVal; - this.listener.upY.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.upY.linearRampToValueAtTime( - yVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (yVal) { - yVal.connect(this.listener.upY); - } - - return this.listener.upY.value; - }, - }, - { - key: "upZ", - value: function upZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === "number") { - this.listener.upZ.value = zVal; - this.listener.upZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.listener.upZ.linearRampToValueAtTime( - zVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (zVal) { - zVal.connect(this.listener.upZ); - } - - return this.listener.upZ.value; - }, - }, - ]); - - return Listener3D; - })(); - - var listener3d = listener3d_Listener3D; - function panner3d_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - panner3d_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - panner3d_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return panner3d_typeof(obj); - } - - function panner3d_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function panner3d_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function panner3d_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - panner3d_defineProperties(Constructor.prototype, protoProps); - if (staticProps) panner3d_defineProperties(Constructor, staticProps); - return Constructor; - } - - function panner3d_possibleConstructorReturn(self, call) { - if ( - call && - (panner3d_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return panner3d_assertThisInitialized(self); - } - - function panner3d_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function panner3d_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - panner3d_get = Reflect.get; - } else { - panner3d_get = function _get(target, property, receiver) { - var base = panner3d_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return panner3d_get(target, property, receiver || target); - } - - function panner3d_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = panner3d_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function panner3d_getPrototypeOf(o) { - panner3d_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return panner3d_getPrototypeOf(o); - } - - function panner3d_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) panner3d_setPrototypeOf(subClass, superClass); - } - - function panner3d_setPrototypeOf(o, p) { - panner3d_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return panner3d_setPrototypeOf(o, p); - } - - /** - * Panner3D is based on the - * Web Audio Spatial Panner Node. - * This panner is a spatial processing node that allows audio to be positioned - * and oriented in 3D space. - * - * The position is relative to an - * Audio Context Listener, which can be accessed - * by p5.soundOut.audiocontext.listener - * - * - * @class p5.Panner3D - * @constructor - */ - - var Panner3D = (function (_Effect) { - panner3d_inherits(Panner3D, _Effect); - - function Panner3D() { - var _this; - - panner3d_classCallCheck(this, Panner3D); - - _this = panner3d_possibleConstructorReturn( - this, - panner3d_getPrototypeOf(Panner3D).call(this), - ); - /** - * - * Web Audio Spatial Panner Node - * - * Properties include
                          - * [Panning Model](https://www.w3.org/TR/webaudio/#idl-def-PanningModelType) - * : "equal power" or "HRTF"
                          - * [DistanceModel](https://www.w3.org/TR/webaudio/#idl-def-DistanceModelType) - * : "linear", "inverse", or "exponential" - * - * @property {AudioNode} panner - * - */ - - _this.panner = _this.ac.createPanner(); - _this.panner.panningModel = "HRTF"; - _this.panner.distanceModel = "linear"; - - _this.panner.connect(_this.output); - - _this.input.connect(_this.panner); - - return _this; - } - /** - * Connect an audio sorce - * - * @method process - * @for p5.Panner3D - * @param {Object} src Input source - */ - - panner3d_createClass(Panner3D, [ - { - key: "process", - value: function process(src) { - src.connect(this.input); - }, - /** - * Set the X,Y,Z position of the Panner - * @method set - * @for p5.Panner3D - * @param {Number} xVal - * @param {Number} yVal - * @param {Number} zVal - * @param {Number} time - * @return {Array} Updated x, y, z values as an array - */ - }, - { - key: "set", - value: function set(xVal, yVal, zVal, time) { - this.positionX(xVal, time); - this.positionY(yVal, time); - this.positionZ(zVal, time); - return [ - this.panner.positionX.value, - this.panner.positionY.value, - this.panner.positionZ.value, - ]; - }, - /** - * Getter and setter methods for position coordinates - * @method positionX - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for position coordinates - * @method positionY - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for position coordinates - * @method positionZ - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - }, - { - key: "positionX", - value: function positionX(xVal, time) { - var t = time || 0; - - if (typeof xVal === "number") { - this.panner.positionX.value = xVal; - this.panner.positionX.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.panner.positionX.linearRampToValueAtTime( - xVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (xVal) { - xVal.connect(this.panner.positionX); - } - - return this.panner.positionX.value; - }, - }, - { - key: "positionY", - value: function positionY(yVal, time) { - var t = time || 0; - - if (typeof yVal === "number") { - this.panner.positionY.value = yVal; - this.panner.positionY.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.panner.positionY.linearRampToValueAtTime( - yVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (yVal) { - yVal.connect(this.panner.positionY); - } - - return this.panner.positionY.value; - }, - }, - { - key: "positionZ", - value: function positionZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === "number") { - this.panner.positionZ.value = zVal; - this.panner.positionZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.panner.positionZ.linearRampToValueAtTime( - zVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (zVal) { - zVal.connect(this.panner.positionZ); - } - - return this.panner.positionZ.value; - }, - /** - * Set the X,Y,Z position of the Panner - * @method orient - * @for p5.Panner3D - * @param {Number} xVal - * @param {Number} yVal - * @param {Number} zVal - * @param {Number} time - * @return {Array} Updated x, y, z values as an array - */ - }, - { - key: "orient", - value: function orient(xVal, yVal, zVal, time) { - this.orientX(xVal, time); - this.orientY(yVal, time); - this.orientZ(zVal, time); - return [ - this.panner.orientationX.value, - this.panner.orientationY.value, - this.panner.orientationZ.value, - ]; - }, - /** - * Getter and setter methods for orient coordinates - * @method orientX - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for orient coordinates - * @method orientY - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - - /** - * Getter and setter methods for orient coordinates - * @method orientZ - * @for p5.Panner3D - * @return {Number} updated coordinate value - */ - }, - { - key: "orientX", - value: function orientX(xVal, time) { - var t = time || 0; - - if (typeof xVal === "number") { - this.panner.orientationX.value = xVal; - this.panner.orientationX.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.panner.orientationX.linearRampToValueAtTime( - xVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (xVal) { - xVal.connect(this.panner.orientationX); - } - - return this.panner.orientationX.value; - }, - }, - { - key: "orientY", - value: function orientY(yVal, time) { - var t = time || 0; - - if (typeof yVal === "number") { - this.panner.orientationY.value = yVal; - this.panner.orientationY.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.panner.orientationY.linearRampToValueAtTime( - yVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (yVal) { - yVal.connect(this.panner.orientationY); - } - - return this.panner.orientationY.value; - }, - }, - { - key: "orientZ", - value: function orientZ(zVal, time) { - var t = time || 0; - - if (typeof zVal === "number") { - this.panner.orientationZ.value = zVal; - this.panner.orientationZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.panner.orientationZ.linearRampToValueAtTime( - zVal, - this.ac.currentTime + 0.02 + t, - ); - } else if (zVal) { - zVal.connect(this.panner.orientationZ); - } - - return this.panner.orientationZ.value; - }, - /** - * Set the rolloff factor and max distance - * @method setFalloff - * @for p5.Panner3D - * @param {Number} [maxDistance] - * @param {Number} [rolloffFactor] - */ - }, - { - key: "setFalloff", - value: function setFalloff(maxDistance, rolloffFactor) { - this.maxDist(maxDistance); - this.rolloff(rolloffFactor); - }, - /** - * Maxium distance between the source and the listener - * @method maxDist - * @for p5.Panner3D - * @param {Number} maxDistance - * @return {Number} updated value - */ - }, - { - key: "maxDist", - value: function maxDist(maxDistance) { - if (typeof maxDistance === "number") { - this.panner.maxDistance = maxDistance; - } - - return this.panner.maxDistance; - }, - /** - * How quickly the volume is reduced as the source moves away from the listener - * @method rollof - * @for p5.Panner3D - * @param {Number} rolloffFactor - * @return {Number} updated value - */ - }, - { - key: "rolloff", - value: function rolloff(rolloffFactor) { - if (typeof rolloffFactor === "number") { - this.panner.rolloffFactor = rolloffFactor; - } - - return this.panner.rolloffFactor; - }, - }, - { - key: "dispose", - value: function dispose() { - panner3d_get( - panner3d_getPrototypeOf(Panner3D.prototype), - "dispose", - this, - ).call(this); - - if (this.panner) { - this.panner.disconnect(); - delete this.panner; - } - }, - }, - ]); - - return Panner3D; - })(effect); - - var panner3d = Panner3D; - function delay_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - delay_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - delay_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return delay_typeof(obj); - } - - function delay_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function delay_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function delay_createClass(Constructor, protoProps, staticProps) { - if (protoProps) delay_defineProperties(Constructor.prototype, protoProps); - if (staticProps) delay_defineProperties(Constructor, staticProps); - return Constructor; - } - - function delay_possibleConstructorReturn(self, call) { - if ( - call && - (delay_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return delay_assertThisInitialized(self); - } - - function delay_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function delay_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - delay_get = Reflect.get; - } else { - delay_get = function _get(target, property, receiver) { - var base = delay_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return delay_get(target, property, receiver || target); - } - - function delay_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = delay_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function delay_getPrototypeOf(o) { - delay_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return delay_getPrototypeOf(o); - } - - function delay_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) delay_setPrototypeOf(subClass, superClass); - } - - function delay_setPrototypeOf(o, p) { - delay_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return delay_setPrototypeOf(o, p); - } - - /** - * Delay is an echo effect. It processes an existing sound source, - * and outputs a delayed version of that sound. The p5.Delay can - * produce different effects depending on the delayTime, feedback, - * filter, and type. In the example below, a feedback of 0.5 (the - * default value) will produce a looping delay that decreases in - * volume by 50% each repeat. A filter will cut out the high - * frequencies so that the delay does not sound as piercing as the - * original source. - * - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * @class p5.Delay - * @extends p5.Effect - * @constructor - * @example - *
                          - * let osc; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(220); - * textAlign(CENTER); - * text('tap to play', width/2, height/2); - * - * osc = new p5.Oscillator('square'); - * osc.amp(0.5); - * delay = new p5.Delay(); - * - * // delay.process() accepts 4 parameters: - * // source, delayTime (in seconds), feedback, filter frequency - * delay.process(osc, 0.12, .7, 2300); - * - * cnv.mousePressed(oscStart); - * } - * - * function oscStart() { - * osc.start(); - * } - * - * function mouseReleased() { - * osc.stop(); - * } - *
                          - */ - - var delay_Delay = (function (_Effect) { - delay_inherits(Delay, _Effect); - - function Delay() { - var _this; - - delay_classCallCheck(this, Delay); - - _this = delay_possibleConstructorReturn( - this, - delay_getPrototypeOf(Delay).call(this), - ); - _this._split = _this.ac.createChannelSplitter(2); - _this._merge = _this.ac.createChannelMerger(2); - _this._leftGain = _this.ac.createGain(); - _this._rightGain = _this.ac.createGain(); - /** - * The p5.Delay is built with two - * - * Web Audio Delay Nodes, one for each stereo channel. - * - * @for p5.Delay - * @property {DelayNode} leftDelay - */ - - _this.leftDelay = _this.ac.createDelay(); - /** - * The p5.Delay is built with two - * - * Web Audio Delay Nodes, one for each stereo channel. - * @for p5.Delay - * @property {DelayNode} rightDelay - */ - - _this.rightDelay = _this.ac.createDelay(); - _this._leftFilter = new filter(); - _this._rightFilter = new filter(); - - _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(0.3, _this.ac.currentTime); - - _this._rightFilter.biquad.Q.setValueAtTime(0.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(0.5); - - return _this; - } - /** - * Add delay to an audio signal according to a set - * of delay parameters. - * - * @method process - * @for p5.Delay - * @param {Object} Signal An object that outputs audio - * @param {Number} [delayTime] Time (in seconds) of the delay/echo. - * Some browsers limit delayTime to - * 1 second. - * @param {Number} [feedback] sends the delay back through itself - * in a loop that decreases in volume - * each time. - * @param {Number} [lowPass] Cutoff frequency. Only frequencies - * below the lowPass will be part of the - * delay. - */ - - delay_createClass(Delay, [ - { - key: "process", - value: function process(src, _delayTime, _feedback, _filter) { - var feedback = _feedback || 0; - var delayTime = _delayTime || 0; - - if (feedback >= 1.0) { - throw new Error( - "Feedback value will force a positive feedback loop.", - ); - } - - if (delayTime >= this._maxDelay) { - throw new Error( - "Delay Time exceeds maximum delay time of " + - this._maxDelay + - " second.", - ); - } - - src.connect(this.input); - this.leftDelay.delayTime.setValueAtTime( - delayTime, - this.ac.currentTime, - ); - this.rightDelay.delayTime.setValueAtTime( - delayTime, - this.ac.currentTime, - ); - this._leftGain.gain.value = feedback; - this._rightGain.gain.value = feedback; - - if (_filter) { - this._leftFilter.freq(_filter); - - this._rightFilter.freq(_filter); - } - }, - /** - * Set the delay (echo) time, in seconds. Usually this value will be - * a floating point number between 0.0 and 1.0. - * - * @method delayTime - * @for p5.Delay - * @param {Number} delayTime Time (in seconds) of the delay - */ - }, - { - key: "delayTime", - value: function delayTime(t) { - if (typeof t !== "number") { - t.connect(this.leftDelay.delayTime); - t.connect(this.rightDelay.delayTime); - } else { - 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, - ); - } - }, - /** - * Feedback occurs when Delay sends its signal back through its input - * in a loop. The feedback amount determines how much signal to send each - * time through the loop. A feedback greater than 1.0 is not desirable because - * it will increase the overall output each time through the loop, - * creating an infinite feedback loop. The default value is 0.5 - * - * @method feedback - * @for p5.Delay - * @param {Number|Object} feedback 0.0 to 1.0, or an object such as an - * Oscillator that can be used to - * modulate this param - * @returns {Number} Feedback value - * - */ - }, - { - key: "feedback", - value: function feedback(f) { - if (f && typeof f !== "number") { - f.connect(this._leftGain.gain); - f.connect(this._rightGain.gain); - } else if (f >= 1.0) { - throw new Error( - "Feedback value will force a positive feedback loop.", - ); - } else if (typeof f === "number") { - this._leftGain.gain.value = f; - this._rightGain.gain.value = f; - } - - return this._leftGain.gain.value; - }, - /** - * Set a lowpass filter frequency for the delay. A lowpass filter - * will cut off any frequencies higher than the filter frequency. - * - * @method filter - * @for p5.Delay - * @param {Number|Object} cutoffFreq A lowpass filter will cut off any - * frequencies higher than the filter frequency. - * @param {Number|Object} res Resonance of the filter frequency - * cutoff, or an object (i.e. a p5.Oscillator) - * that can be used to modulate this parameter. - * High numbers (i.e. 15) will produce a resonance, - * low numbers (i.e. .2) will produce a slope. - */ - }, - { - key: "filter", - value: function filter(freq, q) { - this._leftFilter.set(freq, q); - - this._rightFilter.set(freq, q); - }, - /** - * Choose a preset type of delay. 'pingPong' bounces the signal - * from the left to the right channel to produce a stereo effect. - * Any other parameter will revert to the default delay setting. - * - * @method setType - * @for p5.Delay - * @param {String|Number} type 'pingPong' (1) or 'default' (0) - */ - }, - { - key: "setType", - value: function setType(t) { - if (t === 1) { - t = "pingPong"; - } - - this._split.disconnect(); - - this._leftFilter.disconnect(); - - this._rightFilter.disconnect(); - - this._split.connect(this.leftDelay, 0); - - this._split.connect(this.rightDelay, 1); - - switch (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); - } - }, - - /** - * Set the output level of the delay effect. - * - * @method amp - * @for p5.Delay - * @param {Number} volume amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - - /** - * Send output to a p5.sound or web audio object - * - * @method connect - * @for p5.Delay - * @param {Object} unit - */ - - /** - * Disconnect all output. - * - * @method disconnect - * @for p5.Delay - */ - }, - { - key: "dispose", - value: function dispose() { - delay_get( - delay_getPrototypeOf(Delay.prototype), - "dispose", - this, - ).call(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 = undefined; - this._leftFilter = undefined; - this._rightFilter = undefined; - this._merge = undefined; - this._leftGain = undefined; - this._rightGain = undefined; - this.leftDelay = undefined; - this.rightDelay = undefined; - }, - }, - ]); - - return Delay; - })(effect); - - var delay = delay_Delay; - function reverb_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - reverb_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - reverb_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return reverb_typeof(obj); - } - - function reverb_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function reverb_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function reverb_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - reverb_defineProperties(Constructor.prototype, protoProps); - if (staticProps) reverb_defineProperties(Constructor, staticProps); - return Constructor; - } - - function reverb_possibleConstructorReturn(self, call) { - if ( - call && - (reverb_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return reverb_assertThisInitialized(self); - } - - function reverb_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function reverb_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - reverb_get = Reflect.get; - } else { - reverb_get = function _get(target, property, receiver) { - var base = reverb_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return reverb_get(target, property, receiver || target); - } - - function reverb_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = reverb_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function reverb_getPrototypeOf(o) { - reverb_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return reverb_getPrototypeOf(o); - } - - function reverb_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) reverb_setPrototypeOf(subClass, superClass); - } - - function reverb_setPrototypeOf(o, p) { - reverb_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return reverb_setPrototypeOf(o, p); - } - - /** - * Reverb adds depth to a sound through a large number of decaying - * echoes. It creates the perception that sound is occurring in a - * physical space. The p5.Reverb has paramters for Time (how long does the - * reverb last) and decayRate (how much the sound decays with each echo) - * that can be set with the .set() or .process() methods. The p5.Convolver - * extends p5.Reverb allowing you to recreate the sound of actual physical - * spaces through convolution. - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Reverb - * @extends p5.Effect - * @constructor - * @example - *
                          - * let soundFile, reverb; - * function preload() { - * soundFile = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * - * reverb = new p5.Reverb(); - * soundFile.disconnect(); // so we'll only hear reverb... - * - * // connect soundFile to reverb, process w/ - * // 3 second reverbTime, decayRate of 2% - * reverb.process(soundFile, 3, 2); - * } - * - * function draw() { - * let dryWet = constrain(map(mouseX, 0, width, 0, 1), 0, 1); - * // 1 = all reverb, 0 = no reverb - * reverb.drywet(dryWet); - * - * background(220); - * text('tap to play', 10, 20); - * text('dry/wet: ' + round(dryWet * 100) + '%', 10, height - 20); - * } - * - * function playSound() { - * soundFile.play(); - * } - *
                          - */ - - var Reverb = (function (_Effect) { - reverb_inherits(Reverb, _Effect); - - function Reverb() { - var _this; - - reverb_classCallCheck(this, Reverb); - - _this = reverb_possibleConstructorReturn( - this, - reverb_getPrototypeOf(Reverb).call(this), - ); - - _this._initConvolverNode(); - - _this.input.gain.value = 0.5; - - _this._seconds = 3; - _this._decay = 2; - _this._reverse = false; - - _this._buildImpulse(); - - return _this; - } - - reverb_createClass(Reverb, [ - { - key: "_initConvolverNode", - value: function _initConvolverNode() { - this.convolverNode = this.ac.createConvolver(); - this.input.connect(this.convolverNode); - this.convolverNode.connect(this.wet); - }, - }, - { - key: "_teardownConvolverNode", - value: function _teardownConvolverNode() { - if (this.convolverNode) { - this.convolverNode.disconnect(); - delete this.convolverNode; - } - }, - }, - { - key: "_setBuffer", - value: function _setBuffer(audioBuffer) { - this._teardownConvolverNode(); - - this._initConvolverNode(); - - this.convolverNode.buffer = audioBuffer; - }, - /** - * Connect a source to the reverb, and assign reverb parameters. - * - * @method process - * @for p5.Reverb - * @param {Object} src p5.sound / Web Audio object with a sound - * output. - * @param {Number} [seconds] Duration of the reverb, in seconds. - * Min: 0, Max: 10. Defaults to 3. - * @param {Number} [decayRate] Percentage of decay with each echo. - * Min: 0, Max: 100. Defaults to 2. - * @param {Boolean} [reverse] Play the reverb backwards or forwards. - */ - }, - { - key: "process", - value: function process(src, seconds, decayRate, reverse) { - src.connect(this.input); - var rebuild = false; - - if (seconds) { - this._seconds = seconds; - rebuild = true; - } - - if (decayRate) { - this._decay = decayRate; - } - - if (reverse) { - this._reverse = reverse; - } - - if (rebuild) { - this._buildImpulse(); - } - }, - /** - * Set the reverb settings. Similar to .process(), but without - * assigning a new input. - * - * @method set - * @for p5.Reverb - * @param {Number} [seconds] Duration of the reverb, in seconds. - * Min: 0, Max: 10. Defaults to 3. - * @param {Number} [decayRate] Percentage of decay with each echo. - * Min: 0, Max: 100. Defaults to 2. - * @param {Boolean} [reverse] Play the reverb backwards or forwards. - */ - }, - { - key: "set", - value: function set(seconds, decayRate, reverse) { - var rebuild = false; - - if (seconds) { - this._seconds = seconds; - rebuild = true; - } - - if (decayRate) { - this._decay = decayRate; - } - - if (reverse) { - this._reverse = reverse; - } - - if (rebuild) { - this._buildImpulse(); - } - }, - - /** - * Set the output level of the reverb effect. - * - * @method amp - * @for p5.Reverb - * @param {Number} volume amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - - /** - * Send output to a p5.sound or web audio object - * - * @method connect - * @for p5.Reverb - * @param {Object} unit - */ - - /** - * Disconnect all output. - * - * @method disconnect - * @for p5.Reverb - */ - - /** - * Inspired by Simple Reverb by Jordan Santell - * https://github.com/web-audio-components/simple-reverb/blob/master/index.js - * - * Utility function for building an impulse response - * based on the module parameters. - * - * @private - */ - }, - { - key: "_buildImpulse", - value: function _buildImpulse() { - var rate = this.ac.sampleRate; - var length = rate * this._seconds; - var decay = this._decay; - var impulse = this.ac.createBuffer(2, length, rate); - var impulseL = impulse.getChannelData(0); - var impulseR = impulse.getChannelData(1); - var n, i; - - for (i = 0; i < length; i++) { - n = this._reverse ? length - i : i; - impulseL[i] = - (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); - impulseR[i] = - (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); - } - - this._setBuffer(impulse); - }, - }, - { - key: "dispose", - value: function dispose() { - reverb_get( - reverb_getPrototypeOf(Reverb.prototype), - "dispose", - this, - ).call(this); - - this._teardownConvolverNode(); - }, - }, - ]); - - return Reverb; - })(effect); - - /** - *

                          p5.Convolver extends p5.Reverb. It can emulate the sound of real - * physical spaces through a process called - * convolution.

                          - * - *

                          Convolution multiplies any audio input by an "impulse response" - * to simulate the dispersion of sound over time. The impulse response is - * generated from an audio file that you provide. One way to - * generate an impulse response is to pop a balloon in a reverberant space - * and record the echo. Convolution can also be used to experiment with - * sound.

                          - * - *

                          Use the method createConvolution(path) to instantiate a - * p5.Convolver with a path to your impulse response audio file.

                          - * - * @class p5.Convolver - * @extends p5.Effect - * @constructor - * @param {String} path path to a sound file - * @param {Function} [callback] function to call when loading succeeds - * @param {Function} [errorCallback] function to call if loading fails. - * This function will receive an error or - * XMLHttpRequest object with information - * about what went wrong. - * @example - *
                          - * let cVerb, sound; - * function preload() { - * // We have both MP3 and OGG versions of all sound assets - * soundFormats('ogg', 'mp3'); - * - * // Try replacing 'bx-spring' with other soundfiles like - * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' - * cVerb = createConvolver('assets/bx-spring.mp3'); - * - * // Try replacing 'Damscray_DancingTiger' with - * // 'beat', 'doorbell', lucky_dragons_-_power_melody' - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * background(220); - * text('tap to play', 20, 20); - * - * // disconnect from main output... - * sound.disconnect(); - * - * // ...and process with cVerb - * // so that we only hear the convolution - * cVerb.process(sound); - * } - * - * function playSound() { - * sound.play(); - * } - *
                          - */ - - var reverb_Convolver = (function (_Reverb) { - reverb_inherits(Convolver, _Reverb); - - function Convolver(path, callback, errorCallback) { - var _this2; - - reverb_classCallCheck(this, Convolver); - - _this2 = reverb_possibleConstructorReturn( - this, - reverb_getPrototypeOf(Convolver).call(this), - ); - /** - * Internally, the p5.Convolver uses the a - * - * Web Audio Convolver Node. - * - * @property {ConvolverNode} convolverNode - */ - - _this2._initConvolverNode(); - - _this2.input.gain.value = 0.5; - - if (path) { - _this2.impulses = []; - - _this2._loadBuffer(path, callback, errorCallback); - } else { - _this2._seconds = 3; - _this2._decay = 2; - _this2._reverse = false; - - _this2._buildImpulse(); - } - /** - * If you load multiple impulse files using the .addImpulse method, - * they will be stored as Objects in this Array. Toggle between them - * with the toggleImpulse(id) method. - * - * @property {Array} impulses - * @for p5.Convolver - */ - - _this2.impulses = []; - _this2.set = null; - return _this2; - } - /** - * Private method to load a buffer as an Impulse Response, - * assign it to the convolverNode, and add to the Array of .impulses. - * - * @param {String} path - * @param {Function} callback - * @param {Function} errorCallback - * @private - */ - - reverb_createClass(Convolver, [ - { - key: "_loadBuffer", - value: function _loadBuffer(_path, callback, errorCallback) { - var path = p5.prototype._checkFileFormats(_path); - - var self = this; - var errorTrace = new Error().stack; - var ac = Object(audiocontext["b"])(); - var request = new XMLHttpRequest(); - request.open("GET", path, true); - request.responseType = "arraybuffer"; - - request.onload = function () { - if (request.status === 200) { - ac.decodeAudioData( - request.response, - function (buff) { - var buffer = {}; - var chunks = path.split("/"); - buffer.name = chunks[chunks.length - 1]; - buffer.audioBuffer = buff; - self.impulses.push(buffer); - - self._setBuffer(buffer.audioBuffer); - - if (callback) { - callback(buffer); - } - }, - function () { - var err = new errorHandler( - "decodeAudioData", - errorTrace, - self.url, - ); - var msg = - "AudioContext error at decodeAudioData for " + self.url; - - if (errorCallback) { - err.msg = msg; - errorCallback(err); - } else { - console.error( - msg + - "\n The error stack trace includes: \n" + - err.stack, - ); - } - }, - ); - } else { - var err = new errorHandler( - "loadConvolver", - errorTrace, - self.url, - ); - var msg = - "Unable to load " + - self.url + - ". The request status was: " + - request.status + - " (" + - request.statusText + - ")"; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error( - msg + "\n The error stack trace includes: \n" + err.stack, - ); - } - } - }; - - request.onerror = function () { - var err = new errorHandler("loadConvolver", errorTrace, self.url); - var msg = - "There was no response from the server at " + - self.url + - ". Check the url and internet connectivity."; - - if (errorCallback) { - err.message = msg; - errorCallback(err); - } else { - console.error( - msg + "\n The error stack trace includes: \n" + err.stack, - ); - } - }; - - request.send(); - }, - /** - * Connect a source to the convolver. - * - * @method process - * @for p5.Convolver - * @param {Object} src p5.sound / Web Audio object with a sound - * output. - * @example - *
                          - * let cVerb, sound; - * function preload() { - * // We have both MP3 and OGG versions of all sound assets - * soundFormats('ogg', 'mp3'); - * - * // Try replacing 'bx-spring' with other soundfiles like - * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' - * cVerb = createConvolver('assets/bx-spring.mp3'); - * - * // Try replacing 'Damscray_DancingTiger' with - * // 'beat', 'doorbell', lucky_dragons_-_power_melody' - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * background(220); - * text('tap to play', 20, 20); - * - * // disconnect from main output... - * sound.disconnect(); - * - * // ...and process with cVerb - * // so that we only hear the convolution - * cVerb.process(sound); - * } - * - * function playSound() { - * sound.play(); - * } - * - *
                          - */ - }, - { - key: "process", - value: function process(src) { - src.connect(this.input); - }, - /** - * Load and assign a new Impulse Response to the p5.Convolver. - * The impulse is added to the .impulses array. Previous - * impulses can be accessed with the .toggleImpulse(id) - * method. - * - * @method addImpulse - * @for p5.Convolver - * @param {String} path path to a sound file - * @param {Function} callback function (optional) - * @param {Function} errorCallback function (optional) - */ - }, - { - key: "addImpulse", - value: function addImpulse(path, callback, errorCallback) { - if ( - window.location.origin.indexOf("file://") > -1 && - window.cordova === "undefined" - ) { - alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ); - } - - this._loadBuffer(path, callback, errorCallback); - }, - /** - * Similar to .addImpulse, except that the .impulses - * Array is reset to save memory. A new .impulses - * array is created with this impulse as the only item. - * - * @method resetImpulse - * @for p5.Convolver - * @param {String} path path to a sound file - * @param {Function} callback function (optional) - * @param {Function} errorCallback function (optional) - */ - }, - { - key: "resetImpulse", - value: function resetImpulse(path, callback, errorCallback) { - if ( - window.location.origin.indexOf("file://") > -1 && - window.cordova === "undefined" - ) { - alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ); - } - - this.impulses = []; - - this._loadBuffer(path, callback, errorCallback); - }, - /** - * If you have used .addImpulse() to add multiple impulses - * to a p5.Convolver, then you can use this method to toggle between - * the items in the .impulses Array. Accepts a parameter - * to identify which impulse you wish to use, identified either by its - * original filename (String) or by its position in the .impulses - * Array (Number).
                          - * You can access the objects in the .impulses Array directly. Each - * Object has two attributes: an .audioBuffer (type: - * Web Audio - * AudioBuffer) and a .name, a String that corresponds - * with the original filename. - * - * @method toggleImpulse - * @for p5.Convolver - * @param {String|Number} id Identify the impulse by its original filename - * (String), or by its position in the - * .impulses Array (Number). - */ - }, - { - key: "toggleImpulse", - value: function toggleImpulse(id) { - if (typeof id === "number" && id < this.impulses.length) { - this._setBuffer(this.impulses[id].audioBuffer); - } - - if (typeof id === "string") { - for (var i = 0; i < this.impulses.length; i++) { - if (this.impulses[i].name === id) { - this._setBuffer(this.impulses[i].audioBuffer); - - break; - } - } - } - }, - }, - { - key: "dispose", - value: function dispose() { - reverb_get( - reverb_getPrototypeOf(Convolver.prototype), - "dispose", - this, - ).call(this); - - for (var i in this.impulses) { - if (this.impulses[i]) { - this.impulses[i] = null; - } - } - }, - }, - ]); - - return Convolver; - })(Reverb); - /** - * Create a p5.Convolver. Accepts a path to a soundfile - * that will be used to generate an impulse response. - * - * @method createConvolver - * @for p5 - * @param {String} path path to a sound file - * @param {Function} [callback] function to call if loading is successful. - * The object will be passed in as the argument - * to the callback function. - * @param {Function} [errorCallback] function to call if loading is not successful. - * A custom error will be passed in as the argument - * to the callback function. - * @return {p5.Convolver} - * @example - *
                          - * let cVerb, sound; - * function preload() { - * // We have both MP3 and OGG versions of all sound assets - * soundFormats('ogg', 'mp3'); - * - * // Try replacing 'bx-spring' with other soundfiles like - * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' - * cVerb = createConvolver('assets/bx-spring.mp3'); - * - * // Try replacing 'Damscray_DancingTiger' with - * // 'beat', 'doorbell', lucky_dragons_-_power_melody' - * sound = loadSound('assets/Damscray_DancingTiger.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSound); - * background(220); - * text('tap to play', 20, 20); - * - * // disconnect from main output... - * sound.disconnect(); - * - * // ...and process with cVerb - * // so that we only hear the convolution - * cVerb.process(sound); - * } - * - * function playSound() { - * sound.play(); - * } - *
                          - */ - - function createConvolver(path, callback, errorCallback) { - if ( - window.location.origin.indexOf("file://") > -1 && - window.cordova === "undefined" - ) { - alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ); - } - - var self = this; - var cReverb = new reverb_Convolver( - path, - function (buffer) { - if (typeof callback === "function") { - callback(buffer); - } - - if (typeof self._decrementPreload === "function") { - self._decrementPreload(); - } - }, - errorCallback, - ); - cReverb.impulses = []; - return cReverb; - } - - var Clock = __webpack_require__(11); - var Clock_default = __webpack_require__.n(Clock); - - function metro_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function metro_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function metro_createClass(Constructor, protoProps, staticProps) { - if (protoProps) metro_defineProperties(Constructor.prototype, protoProps); - if (staticProps) metro_defineProperties(Constructor, staticProps); - return Constructor; - } - - var metro_Metro = (function () { - function Metro() { - metro_classCallCheck(this, Metro); - - this.clock = new Clock_default.a({ - callback: this.ontick.bind(this), - }); - this.syncedParts = []; - this.bpm = 120; - - this._init(); - - this.prevTick = 0; - this.tatumTime = 0; - - this.tickCallback = function () {}; - } - - metro_createClass(Metro, [ - { - key: "ontick", - value: function ontick(tickTime) { - var elapsedTime = tickTime - this.prevTick; - var secondsFromNow = tickTime - main.audiocontext.currentTime; - - if (elapsedTime - this.tatumTime <= -0.02) { - return; - } else { - this.prevTick = tickTime; - - var self = this; - this.syncedParts.forEach(function (thisPart) { - if (!thisPart.isPlaying) return; - thisPart.incrementStep(secondsFromNow); - - thisPart.phrases.forEach(function (thisPhrase) { - var phraseArray = thisPhrase.sequence; - var bNum = self.metroTicks % phraseArray.length; - - if ( - phraseArray[bNum] !== 0 && - (self.metroTicks < phraseArray.length || - !thisPhrase.looping) - ) { - thisPhrase.callback(secondsFromNow, phraseArray[bNum]); - } - }); - }); - this.metroTicks += 1; - this.tickCallback(secondsFromNow); - } - }, - }, - { - key: "setBPM", - value: function setBPM(bpm) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var beatTime = 60 / (bpm * this.tatums); - var now = main.audiocontext.currentTime; - this.tatumTime = beatTime; - this.clock.frequency.setValueAtTime( - this.clock.frequency.value, - now, - ); - this.clock.frequency.linearRampToValueAtTime(bpm, now + rampTime); - this.bpm = bpm; - }, - }, - { - key: "getBPM", - value: function getBPM() { - return (this.clock.getRate() / this.tatums) * 60; - }, - }, - { - key: "_init", - value: function _init() { - this.metroTicks = 0; - }, - }, - { - key: "resetSync", - value: function resetSync(part) { - this.syncedParts = [part]; - }, - }, - { - key: "pushSync", - value: function pushSync(part) { - this.syncedParts.push(part); - }, - }, - { - key: "start", - value: function start(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - this.clock.start(now + t); - this.setBPM(this.bpm); - }, - }, - { - key: "stop", - value: function stop(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - this.clock.stop(now + t); - }, - }, - { - key: "beatLength", - value: function beatLength(tatums) { - this.tatums = 1 / tatums / 4; - }, - }, - ]); - - return Metro; - })(); - - var metro = metro_Metro; - function looper_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function looper_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - looper_defineProperties(Constructor.prototype, protoProps); - if (staticProps) looper_defineProperties(Constructor, staticProps); - return Constructor; - } - - function looper_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var BPM = 120; - /** - * Set the global tempo, in beats per minute, for all - * p5.Parts. This method will impact all active p5.Parts. - * - * @method setBPM - * @for p5 - * @param {Number} BPM Beats Per Minute - * @param {Number} rampTime Seconds from now - */ - - p5.prototype.setBPM = function (bpm, rampTime) { - BPM = bpm; - - for (var i in main.parts) { - if (main.parts[i]) { - main.parts[i].setBPM(bpm, rampTime); - } - } - }; - /** - *

                          A phrase is a pattern of musical events over time, i.e. - * a series of notes and rests.

                          - * - *

                          Phrases must be added to a p5.Part for playback, and - * each part can play multiple phrases at the same time. - * For example, one Phrase might be a kick drum, another - * could be a snare, and another could be the bassline.

                          - * - *

                          The first parameter is a name so that the phrase can be - * modified or deleted later. The callback is a a function that - * this phrase will call at every step—for example it might be - * called playNote(value){}. The array determines - * which value is passed into the callback at each step of the - * phrase. It can be numbers, an object with multiple numbers, - * or a zero (0) indicates a rest so the callback won't be called).

                          - * - * @class p5.Phrase - * @constructor - * @param {String} name Name so that you can access the Phrase. - * @param {Function} callback The name of a function that this phrase - * will call. Typically it will play a sound, - * and accept two parameters: a time at which - * to play the sound (in seconds from now), - * and a value from the sequence array. The - * time should be passed into the play() or - * start() method to ensure precision. - * @param {Array} sequence Array of values to pass into the callback - * at each step of the phrase. - * @example - *
                          - * let mySound, myPhrase, myPart; - * let pattern = [1,0,0,2,0,2,0,0]; - * - * function preload() { - * mySound = loadSound('assets/beatbox.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playMyPart); - * background(220); - * text('tap to play', width/2, height/2); - * textAlign(CENTER, CENTER); - * - * myPhrase = new p5.Phrase('bbox', onEachStep, pattern); - * myPart = new p5.Part(); - * myPart.addPhrase(myPhrase); - * myPart.setBPM(60); - * } - * - * function onEachStep(time, playbackRate) { - * mySound.rate(playbackRate); - * mySound.play(time); - * } - * - * function playMyPart() { - * userStartAudio(); - * myPart.start(); - * } - *
                          - */ - - var Phrase = function Phrase(name, callback, sequence) { - looper_classCallCheck(this, Phrase); - - this.phraseStep = 0; - this.name = name; - this.callback = callback; - /** - * Array of values to pass into the callback - * at each step of the phrase. Depending on the callback - * function's requirements, these values may be numbers, - * strings, or an object with multiple parameters. - * Zero (0) indicates a rest. - * - * @property {Array} sequence - */ - - this.sequence = sequence; - }; - /** - *

                          A p5.Part plays back one or more p5.Phrases. Instantiate a part - * with steps and tatums. By default, each step represents a 1/16th note.

                          - * - *

                          See p5.Phrase for more about musical timing.

                          - * - * @class p5.Part - * @constructor - * @param {Number} [steps] Steps in the part - * @param {Number} [tatums] Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note) - * @example - *
                          - * let box, drum, myPart; - * let boxPat = [1,0,0,2,0,2,0,0]; - * let drumPat = [0,1,1,0,2,0,1,0]; - * - * function preload() { - * box = loadSound('assets/beatbox.mp3'); - * drum = loadSound('assets/drum.mp3'); - * } - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playMyPart); - * background(220); - * textAlign(CENTER, CENTER); - * text('tap to play', width/2, height/2); - * - * let boxPhrase = new p5.Phrase('box', playBox, boxPat); - * let drumPhrase = new p5.Phrase('drum', playDrum, drumPat); - * myPart = new p5.Part(); - * myPart.addPhrase(boxPhrase); - * myPart.addPhrase(drumPhrase); - * myPart.setBPM(60); - * } - * - * function playBox(time, playbackRate) { - * box.rate(playbackRate); - * box.play(time); - * } - * - * function playDrum(time, playbackRate) { - * drum.rate(playbackRate); - * drum.play(time); - * } - * - * function playMyPart() { - * userStartAudio(); - * - * myPart.start(); - * } - *
                          - */ - - var looper_Part = (function () { - function Part(steps, bLength) { - looper_classCallCheck(this, Part); - - this.length = steps || 0; - - this.partStep = 0; - this.phrases = []; - this.isPlaying = false; - this.noLoop(); - this.tatums = bLength || 0.0625; - - this.metro = new metro(); - - this.metro._init(); - - this.metro.beatLength(this.tatums); - this.metro.setBPM(BPM); - main.parts.push(this); - - this.callback = function () {}; - } - /** - * Set the tempo of this part, in Beats Per Minute. - * - * @method setBPM - * @for p5.Part - * @param {Number} BPM Beats Per Minute - * @param {Number} [rampTime] Seconds from now - */ - - looper_createClass(Part, [ - { - key: "setBPM", - value: function setBPM(tempo, rampTime) { - this.metro.setBPM(tempo, rampTime); - }, - /** - * Returns the tempo, in Beats Per Minute, of this part. - * - * @method getBPM - * @for p5.Part - * @return {Number} - */ - }, - { - key: "getBPM", - value: function getBPM() { - return this.metro.getBPM(); - }, - /** - * Start playback of this part. It will play - * through all of its phrases at a speed - * determined by setBPM. - * - * @method start - * @for p5.Part - * @param {Number} [time] seconds from now - */ - }, - { - key: "start", - value: function start(time) { - if (!this.isPlaying) { - this.isPlaying = true; - this.metro.resetSync(this); - var t = time || 0; - this.metro.start(t); - } - }, - /** - * Loop playback of this part. It will begin - * looping through all of its phrases at a speed - * determined by setBPM. - * - * @method loop - * @for p5.Part - * @param {Number} [time] seconds from now - */ - }, - { - key: "loop", - value: function loop(time) { - this.looping = true; - - this.onended = function () { - this.partStep = 0; - }; - - var t = time || 0; - this.start(t); - }, - /** - * Tell the part to stop looping. - * - * @method noLoop - * @for p5.Part - */ - }, - { - key: "noLoop", - value: function noLoop() { - this.looping = false; - - this.onended = function () { - this.stop(); - }; - }, - /** - * Stop the part and cue it to step 0. Playback will resume from the begining of the Part when it is played again. - * - * @method stop - * @for p5.Part - * @param {Number} [time] seconds from now - */ - }, - { - key: "stop", - value: function stop(time) { - this.partStep = 0; - this.pause(time); - }, - /** - * Pause the part. Playback will resume - * from the current step. - * - * @method pause - * @for p5.Part - * @param {Number} time seconds from now - */ - }, - { - key: "pause", - value: function pause(time) { - this.isPlaying = false; - var t = time || 0; - this.metro.stop(t); - }, - /** - * Add a p5.Phrase to this Part. - * - * @method addPhrase - * @for p5.Part - * @param {p5.Phrase} phrase reference to a p5.Phrase - */ - }, - { - key: "addPhrase", - value: function addPhrase(name, callback, array) { - var p; - - if (arguments.length === 3) { - p = new Phrase(name, callback, array); - } else if (arguments[0] instanceof Phrase) { - p = arguments[0]; - } else { - throw "invalid input. addPhrase accepts name, callback, array or a p5.Phrase"; - } - - this.phrases.push(p); - - if (p.sequence.length > this.length) { - this.length = p.sequence.length; - } - }, - /** - * Remove a phrase from this part, based on the name it was - * given when it was created. - * - * @method removePhrase - * @for p5.Part - * @param {String} phraseName - */ - }, - { - key: "removePhrase", - value: function removePhrase(name) { - for (var i in this.phrases) { - if (this.phrases[i].name === name) { - this.phrases.splice(i, 1); - } - } - }, - /** - * Get a phrase from this part, based on the name it was - * given when it was created. Now you can modify its array. - * - * @method getPhrase - * @for p5.Part - * @param {String} phraseName - */ - }, - { - key: "getPhrase", - value: function getPhrase(name) { - for (var i in this.phrases) { - if (this.phrases[i].name === name) { - return this.phrases[i]; - } - } - }, - /** - * Find all sequences with the specified name, and replace their patterns with the specified array. - * - * @method replaceSequence - * @for p5.Part - * @param {String} phraseName - * @param {Array} sequence Array of values to pass into the callback - * at each step of the phrase. - */ - }, - { - key: "replaceSequence", - value: function replaceSequence(name, array) { - for (var i in this.phrases) { - if (this.phrases[i].name === name) { - this.phrases[i].sequence = array; - } - } - }, - }, - { - key: "incrementStep", - value: function incrementStep(time) { - if (this.partStep < this.length - 1) { - this.callback(time); - this.partStep += 1; - } else { - if (!this.looping && this.partStep === this.length - 1) { - this.onended(); - } - } - }, - /** - * Set the function that will be called at every step. This will clear the previous function. - * - * @method onStep - * @for p5.Part - * @param {Function} callback The name of the callback - * you want to fire - * on every beat/tatum. - */ - }, - { - key: "onStep", - value: function onStep(callback) { - this.callback = callback; - }, - }, - ]); - - return Part; - })(); - - /** - * A Score consists of a series of Parts. The parts will - * be played back in order. For example, you could have an - * A part, a B part, and a C part, and play them back in this order - * new p5.Score(a, a, b, a, c) - * - * @class p5.Score - * @constructor - * @param {p5.Part} [...parts] One or multiple parts, to be played in sequence. - */ - - var Score = (function () { - function Score() { - looper_classCallCheck(this, Score); - - this.parts = []; - this.currentPart = new Array(arguments.length); - var thisScore = this; - - for (var i in arguments) { - this.parts[i] = arguments[i]; - this.parts[i].nextPart = this.parts[i + 1]; - - this.parts[i].onended = function () { - thisScore.resetPart(i); - playNextPart(thisScore); - }; - } - - this.looping = false; - } - - looper_createClass(Score, [ - { - key: "onended", - value: function onended() { - if (this.looping) { - this.parts[0].start(); - } else { - this.parts[this.parts.length - 1].onended = function () { - this.stop(); - this.resetParts(); - }; - } - - this.currentPart = 0; - }, - /** - * Start playback of the score. - * - * @method start - * @for p5.Score - */ - }, - { - key: "start", - value: function start() { - this.parts[this.currentPart].start(); - this.scoreStep = 0; - }, - /** - * Stop playback of the score. - * - * @method stop - * @for p5.Score - */ - }, - { - key: "stop", - value: function stop() { - this.parts[this.currentPart].stop(); - this.currentPart = 0; - this.scoreStep = 0; - }, - /** - * Pause playback of the score. - * - * @method pause - * @for p5.Score - */ - }, - { - key: "pause", - value: function pause() { - this.parts[this.currentPart].stop(); - }, - /** - * Loop playback of the score. - * - * @method loop - * @for p5.Score - */ - }, - { - key: "loop", - value: function loop() { - this.looping = true; - this.start(); - }, - /** - * Stop looping playback of the score. If it - * is currently playing, this will go into effect - * after the current round of playback completes. - * - * @method noLoop - * @for p5.Score - */ - }, - { - key: "noLoop", - value: function noLoop() { - this.looping = false; - }, - }, - { - key: "resetParts", - value: function resetParts() { - var self = this; - this.parts.forEach(function (part) { - self.resetParts[part]; - }); - }, - }, - { - key: "resetPart", - value: function resetPart(i) { - this.parts[i].stop(); - this.parts[i].partStep = 0; - - for (var p in this.parts[i].phrases) { - if (this.parts[i]) { - this.parts[i].phrases[p].phraseStep = 0; - } - } - }, - /** - * Set the tempo for all parts in the score - * - * @method setBPM - * @for p5.Score - * @param {Number} BPM Beats Per Minute - * @param {Number} rampTime Seconds from now - */ - }, - { - key: "setBPM", - value: function setBPM(bpm, rampTime) { - for (var i in this.parts) { - if (this.parts[i]) { - this.parts[i].setBPM(bpm, rampTime); - } - } - }, - }, - ]); - - return Score; - })(); - - function playNextPart(aScore) { - aScore.currentPart++; - - if (aScore.currentPart >= aScore.parts.length) { - aScore.scoreStep = 0; - aScore.onended(); - } else { - aScore.scoreStep = 0; - aScore.parts[aScore.currentPart - 1].stop(); - aScore.parts[aScore.currentPart].start(); - } - } - - function soundLoop_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function soundLoop_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function soundLoop_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - soundLoop_defineProperties(Constructor.prototype, protoProps); - if (staticProps) soundLoop_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * SoundLoop - * - * @class p5.SoundLoop - * @constructor - * - * @param {Function} callback this function will be called on each iteration of theloop - * @param {Number|String} [interval] amount of time (if a number) or beats (if a string, following Tone.Time convention) for each iteration of the loop. Defaults to 1 second. - * - * @example - *
                          - * let synth, soundLoop; - * let notePattern = [60, 62, 64, 67, 69, 72]; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * colorMode(HSB); - * background(0, 0, 86); - * text('tap to start/stop', 10, 20); - * - * //the looper's callback is passed the timeFromNow - * //this value should be used as a reference point from - * //which to schedule sounds - * let intervalInSeconds = 0.2; - * soundLoop = new p5.SoundLoop(onSoundLoop, intervalInSeconds); - * - * synth = new p5.MonoSynth(); - * } - * - * function canvasPressed() { - * // ensure audio is enabled - * userStartAudio(); - * - * if (soundLoop.isPlaying) { - * soundLoop.stop(); - * } else { - * // start the loop - * soundLoop.start(); - * } - * } - * - * function onSoundLoop(timeFromNow) { - * let noteIndex = (soundLoop.iterations - 1) % notePattern.length; - * let note = midiToFreq(notePattern[noteIndex]); - * synth.play(note, 0.5, timeFromNow); - * background(noteIndex * 360 / notePattern.length, 50, 100); - * } - *
                          - */ - - var soundLoop_SoundLoop = (function () { - function SoundLoop(callback, interval) { - soundLoop_classCallCheck(this, SoundLoop); - - /** - * Getters and Setters, setting any paramter will result in a change in the clock's - * frequency, that will be reflected after the next callback - * beats per minute (defaults to 60) - * @property {Number} bpm - * @for p5.SoundLoop - */ - Object.defineProperty(this, "bpm", { - get: function get() { - return this._bpm; - }, - set: function set(bpm) { - if (!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 = bpm; - - this._update(); - }, - }); - /** - * number of quarter notes in a measure (defaults to 4) - * @property {Number} timeSignature - * @for p5.SoundLoop - */ - - Object.defineProperty(this, "timeSignature", { - get: function get() { - return this._timeSignature; - }, - set: function set(timeSig) { - if (!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 = timeSig; - - this._update(); - }, - }); - /** - * length of the loops interval - * @property {Number|String} interval - * @for p5.SoundLoop - */ - - Object.defineProperty(this, "interval", { - get: function get() { - return this._interval; - }, - set: function set(interval) { - this.musicalTimeMode = typeof interval === "number" ? false : true; - this._interval = interval; - - this._update(); - }, - }); - /** - * how many times the callback has been called so far - * @property {Number} iterations - * @for p5.SoundLoop - * @readonly - */ - - Object.defineProperty(this, "iterations", { - get: function get() { - return this.clock.ticks; - }, - }); - this.callback = callback; - /** - * musicalTimeMode uses Tone.Time convention - * true if string, false if number - * @property {Boolean} musicalTimeMode - */ - - this.musicalTimeMode = - typeof this._interval === "number" ? false : true; - this._interval = interval || 1; - /** - * musicalTimeMode variables - * modify these only when the interval is specified in musicalTime format as a string - */ - - this._timeSignature = 4; - this._bpm = 60; - this.isPlaying = false; - /** - * Set a limit to the number of loops to play. defaults to Infinity - * @property {Number} maxIterations - */ - - this.maxIterations = Infinity; - var self = this; - this.clock = new Clock_default.a({ - callback: function callback(time) { - var timeFromNow = time - main.audiocontext.currentTime; - /** - * Do not initiate the callback if timeFromNow is < 0 - * This ususually occurs for a few milliseconds when the page - * is not fully loaded - * - * The callback should only be called until maxIterations is reached - */ - - if (timeFromNow > 0 && self.iterations <= self.maxIterations) { - self.callback(timeFromNow); - } - }, - frequency: this._calcFreq(), - }); - } - /** - * Start the loop - * @method start - * @for p5.SoundLoop - * @param {Number} [timeFromNow] schedule a starting time - */ - - soundLoop_createClass(SoundLoop, [ - { - key: "start", - value: function start(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (!this.isPlaying) { - this.clock.start(now + t); - this.isPlaying = true; - } - }, - /** - * Stop the loop - * @method stop - * @for p5.SoundLoop - * @param {Number} [timeFromNow] schedule a stopping time - */ - }, - { - key: "stop", - value: function stop(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (this.isPlaying) { - this.clock.stop(now + t); - this.isPlaying = false; - } - }, - /** - * Pause the loop - * @method pause - * @for p5.SoundLoop - * @param {Number} [timeFromNow] schedule a pausing time - */ - }, - { - key: "pause", - value: function pause(timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (this.isPlaying) { - this.clock.pause(now + t); - this.isPlaying = false; - } - }, - /** - * Synchronize loops. Use this method to start two or more loops in synchronization - * or to start a loop in synchronization with a loop that is already playing - * This method will schedule the implicit loop in sync with the explicit master loop - * i.e. loopToStart.syncedStart(loopToSyncWith) - * - * @method syncedStart - * @for p5.SoundLoop - * @param {Object} otherLoop a p5.SoundLoop to sync with - * @param {Number} [timeFromNow] Start the loops in sync after timeFromNow seconds - */ - }, - { - key: "syncedStart", - value: function syncedStart(otherLoop, timeFromNow) { - var t = timeFromNow || 0; - var now = main.audiocontext.currentTime; - - if (!otherLoop.isPlaying) { - otherLoop.clock.start(now + t); - otherLoop.isPlaying = true; - this.clock.start(now + t); - this.isPlaying = true; - } else if (otherLoop.isPlaying) { - var time = - otherLoop.clock._nextTick - main.audiocontext.currentTime; - this.clock.start(now + time); - this.isPlaying = true; - } - }, - /** - * Updates frequency value, reflected in next callback - * @private - * @for p5.SoundLoop - * @method _update - */ - }, - { - key: "_update", - value: function _update() { - this.clock.frequency.value = this._calcFreq(); - }, - /** - * Calculate the frequency of the clock's callback based on bpm, interval, and timesignature - * @private - * @for p5.SoundLoop - * @method _calcFreq - * @return {Number} new clock frequency value - */ - }, - { - key: "_calcFreq", - value: function _calcFreq() { - if (typeof this._interval === "number") { - this.musicalTimeMode = false; - return 1 / this._interval; - } else if (typeof this._interval === "string") { - this.musicalTimeMode = true; - return ( - (this._bpm / 60 / this._convertNotation(this._interval)) * - (this._timeSignature / 4) - ); - } - }, - /** - * Convert notation from musical time format to seconds - * Uses Tone.Time convention - * @private - * @for p5.SoundLoop - * @method _convertNotation - * @param {String} value value to be converted - * @return {Number} converted value in seconds - */ - }, - { - key: "_convertNotation", - value: function _convertNotation(value) { - var type = value.slice(-1); - value = Number(value.slice(0, -1)); - - switch (type) { - case "m": - return this._measure(value); - - case "n": - return this._note(value); - - 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", - ); - } - }, - /** - * Helper conversion methods of measure and note - * @private - * @for p5.SoundLoop - * @method _measure - */ - }, - { - key: "_measure", - value: function _measure(value) { - return value * this._timeSignature; - }, - /** - * @private - * @method _note - * @for p5.SoundLoop - */ - }, - { - key: "_note", - value: function _note(value) { - return this._timeSignature / value; - }, - }, - ]); - - return SoundLoop; - })(); - - var soundLoop = soundLoop_SoundLoop; - function compressor_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - compressor_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - compressor_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return compressor_typeof(obj); - } - - function compressor_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function compressor_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function compressor_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - compressor_defineProperties(Constructor.prototype, protoProps); - if (staticProps) compressor_defineProperties(Constructor, staticProps); - return Constructor; - } - - function compressor_possibleConstructorReturn(self, call) { - if ( - call && - (compressor_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return compressor_assertThisInitialized(self); - } - - function compressor_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function compressor_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - compressor_get = Reflect.get; - } else { - compressor_get = function _get(target, property, receiver) { - var base = compressor_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return compressor_get(target, property, receiver || target); - } - - function compressor_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = compressor_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function compressor_getPrototypeOf(o) { - compressor_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return compressor_getPrototypeOf(o); - } - - function compressor_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) compressor_setPrototypeOf(subClass, superClass); - } - - function compressor_setPrototypeOf(o, p) { - compressor_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return compressor_setPrototypeOf(o, p); - } - - /** - * Compressor is an audio effect class that performs dynamics compression - * on an audio input source. This is a very commonly used technique in music - * and sound production. Compression creates an overall louder, richer, - * and fuller sound by lowering the volume of louds and raising that of softs. - * Compression can be used to avoid clipping (sound distortion due to - * peaks in volume) and is especially useful when many sounds are played - * at once. Compression can be used on indivudal sound sources in addition - * to the main output. - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Compressor - * @constructor - * @extends p5.Effect - * - * - */ - - var Compressor = (function (_Effect) { - compressor_inherits(Compressor, _Effect); - - function Compressor() { - var _this; - - compressor_classCallCheck(this, Compressor); - - _this = compressor_possibleConstructorReturn( - this, - compressor_getPrototypeOf(Compressor).call(this), - ); - /** - * - * The p5.Compressor is built with a Web Audio Dynamics Compressor Node - * - * @property {AudioNode} compressor - */ - - _this.compressor = _this.ac.createDynamicsCompressor(); - - _this.input.connect(_this.compressor); - - _this.compressor.connect(_this.wet); - - return _this; - } - /** - * Performs the same function as .connect, but also accepts - * optional parameters to set compressor's audioParams - * @method process - * @for p5.Compressor - * - * @param {Object} src Sound source to be connected - * - * @param {Number} [attack] The amount of time (in seconds) to reduce the gain by 10dB, - * default = .003, range 0 - 1 - * @param {Number} [knee] A decibel value representing the range above the - * threshold where the curve smoothly transitions to the "ratio" portion. - * default = 30, range 0 - 40 - * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output - * default = 12, range 1 - 20 - * @param {Number} [threshold] The decibel value above which the compression will start taking effect - * default = -24, range -100 - 0 - * @param {Number} [release] The amount of time (in seconds) to increase the gain by 10dB - * default = .25, range 0 - 1 - */ - - compressor_createClass(Compressor, [ - { - key: "process", - value: function process( - src, - attack, - knee, - ratio, - threshold, - release, - ) { - src.connect(this.input); - this.set(attack, knee, ratio, threshold, release); - }, - /** - * Set the paramters of a compressor. - * @method set - * @for p5.Compressor - * @param {Number} attack The amount of time (in seconds) to reduce the gain by 10dB, - * default = .003, range 0 - 1 - * @param {Number} knee A decibel value representing the range above the - * threshold where the curve smoothly transitions to the "ratio" portion. - * default = 30, range 0 - 40 - * @param {Number} ratio The amount of dB change in input for a 1 dB change in output - * default = 12, range 1 - 20 - * @param {Number} threshold The decibel value above which the compression will start taking effect - * default = -24, range -100 - 0 - * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB - * default = .25, range 0 - 1 - */ - }, - { - key: "set", - value: function set(attack, knee, ratio, threshold, release) { - if (typeof attack !== "undefined") { - this.attack(attack); - } - - if (typeof knee !== "undefined") { - this.knee(knee); - } - - if (typeof ratio !== "undefined") { - this.ratio(ratio); - } - - if (typeof threshold !== "undefined") { - this.threshold(threshold); - } - - if (typeof release !== "undefined") { - this.release(release); - } - }, - /** - * Get current attack or set value w/ time ramp - * - * - * @method attack - * @for p5.Compressor - * @param {Number} [attack] Attack is the amount of time (in seconds) to reduce the gain by 10dB, - * default = .003, range 0 - 1 - * @param {Number} [time] Assign time value to schedule the change in value - */ - }, - { - key: "attack", - value: function attack(_attack, time) { - var t = time || 0; - - if (typeof _attack === "number") { - this.compressor.attack.value = _attack; - this.compressor.attack.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.compressor.attack.linearRampToValueAtTime( - _attack, - this.ac.currentTime + 0.02 + t, - ); - } else if (typeof _attack !== "undefined") { - _attack.connect(this.compressor.attack); - } - - return this.compressor.attack.value; - }, - /** - * Get current knee or set value w/ time ramp - * - * @method knee - * @for p5.Compressor - * @param {Number} [knee] A decibel value representing the range above the - * threshold where the curve smoothly transitions to the "ratio" portion. - * default = 30, range 0 - 40 - * @param {Number} [time] Assign time value to schedule the change in value - */ - }, - { - key: "knee", - value: function knee(_knee, time) { - var t = time || 0; - - if (typeof _knee === "number") { - this.compressor.knee.value = _knee; - this.compressor.knee.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.compressor.knee.linearRampToValueAtTime( - _knee, - this.ac.currentTime + 0.02 + t, - ); - } else if (typeof _knee !== "undefined") { - _knee.connect(this.compressor.knee); - } - - return this.compressor.knee.value; - }, - /** - * Get current ratio or set value w/ time ramp - * @method ratio - * @for p5.Compressor - * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output - * default = 12, range 1 - 20 - * @param {Number} [time] Assign time value to schedule the change in value - */ - }, - { - key: "ratio", - value: function ratio(_ratio, time) { - var t = time || 0; - - if (typeof _ratio === "number") { - this.compressor.ratio.value = _ratio; - this.compressor.ratio.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.compressor.ratio.linearRampToValueAtTime( - _ratio, - this.ac.currentTime + 0.02 + t, - ); - } else if (typeof _ratio !== "undefined") { - _ratio.connect(this.compressor.ratio); - } - - return this.compressor.ratio.value; - }, - /** - * Get current threshold or set value w/ time ramp - * @method threshold - * @for p5.Compressor - * @param {Number} threshold The decibel value above which the compression will start taking effect - * default = -24, range -100 - 0 - * @param {Number} [time] Assign time value to schedule the change in value - */ - }, - { - key: "threshold", - value: function threshold(_threshold, time) { - var t = time || 0; - - if (typeof _threshold === "number") { - this.compressor.threshold.value = _threshold; - this.compressor.threshold.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.compressor.threshold.linearRampToValueAtTime( - _threshold, - this.ac.currentTime + 0.02 + t, - ); - } else if (typeof _threshold !== "undefined") { - _threshold.connect(this.compressor.threshold); - } - - return this.compressor.threshold.value; - }, - /** - * Get current release or set value w/ time ramp - * @method release - * @for p5.Compressor - * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB - * default = .25, range 0 - 1 - * - * @param {Number} [time] Assign time value to schedule the change in value - */ - }, - { - key: "release", - value: function release(_release, time) { - var t = time || 0; - - if (typeof _release === "number") { - this.compressor.release.value = _release; - this.compressor.release.cancelScheduledValues( - this.ac.currentTime + 0.01 + t, - ); - this.compressor.release.linearRampToValueAtTime( - _release, - this.ac.currentTime + 0.02 + t, - ); - } else if (typeof number !== "undefined") { - _release.connect(this.compressor.release); - } - - return this.compressor.release.value; - }, - /** - * Return the current reduction value - * - * @method reduction - * @for p5.Compressor - * @return {Number} Value of the amount of gain reduction that is applied to the signal - */ - }, - { - key: "reduction", - value: function reduction() { - return this.compressor.reduction.value; - }, - }, - { - key: "dispose", - value: function dispose() { - compressor_get( - compressor_getPrototypeOf(Compressor.prototype), - "dispose", - this, - ).call(this); - - if (this.compressor) { - this.compressor.disconnect(); - delete this.compressor; - } - }, - }, - ]); - - return Compressor; - })(effect); - - var compressor = Compressor; - function peakDetect_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function peakDetect_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function peakDetect_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - peakDetect_defineProperties(Constructor.prototype, protoProps); - if (staticProps) peakDetect_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - *

                          PeakDetect works in conjunction with p5.FFT to - * look for onsets in some or all of the frequency spectrum. - *

                          - *

                          - * To use p5.PeakDetect, call update in the draw loop - * and pass in a p5.FFT object. - *

                          - *

                          - * You can listen for a specific part of the frequency spectrum by - * setting the range between freq1 and freq2. - *

                          - * - *

                          threshold is the threshold for detecting a peak, - * scaled between 0 and 1. It is logarithmic, so 0.1 is half as loud - * as 1.0.

                          - * - *

                          - * The update method is meant to be run in the draw loop, and - * frames determines how many loops must pass before - * another peak can be detected. - * For example, if the frameRate() = 60, you could detect the beat of a - * 120 beat-per-minute song with this equation: - * framesPerPeak = 60 / (estimatedBPM / 60 ); - *

                          - * - *

                          - * Based on example contribtued by @b2renger, and a simple beat detection - * explanation by Felix Turner. - *

                          - * - * @class p5.PeakDetect - * @constructor - * @param {Number} [freq1] lowFrequency - defaults to 20Hz - * @param {Number} [freq2] highFrequency - defaults to 20000 Hz - * @param {Number} [threshold] Threshold for detecting a beat between 0 and 1 - * scaled logarithmically where 0.1 is 1/2 the loudness - * of 1.0. Defaults to 0.35. - * @param {Number} [framesPerPeak] Defaults to 20. - * @example - *
                          - * - * var cnv, soundFile, fft, peakDetect; - * var ellipseWidth = 10; - * - * function preload() { - * soundFile = loadSound('assets/beat.mp3'); - * } - * - * function setup() { - * background(0); - * noStroke(); - * fill(255); - * textAlign(CENTER); - * - * // p5.PeakDetect requires a p5.FFT - * fft = new p5.FFT(); - * peakDetect = new p5.PeakDetect(); - * } - * - * function draw() { - * background(0); - * text('click to play/pause', width/2, height/2); - * - * // peakDetect accepts an fft post-analysis - * fft.analyze(); - * peakDetect.update(fft); - * - * if ( peakDetect.isDetected ) { - * ellipseWidth = 50; - * } else { - * ellipseWidth *= 0.95; - * } - * - * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); - * } - * - * // toggle play/stop when canvas is clicked - * function mouseClicked() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * if (soundFile.isPlaying() ) { - * soundFile.stop(); - * } else { - * soundFile.play(); - * } - * } - * } - *
                          - */ - var PeakDetect = (function () { - function PeakDetect(freq1, freq2, threshold, _framesPerPeak) { - peakDetect_classCallCheck(this, PeakDetect); - - this.framesPerPeak = _framesPerPeak || 20; - this.framesSinceLastPeak = 0; - this.decayRate = 0.95; - this.threshold = threshold || 0.35; - this.cutoff = 0; - - this.cutoffMult = 1.5; - this.energy = 0; - this.penergy = 0; - - this.currentValue = 0; - /** - * isDetected is set to true when a peak is detected. - * - * @attribute isDetected {Boolean} - * @default false - */ - - this.isDetected = false; - this.f1 = freq1 || 40; - this.f2 = freq2 || 20000; - - this._onPeak = function () {}; - } - /** - * The update method is run in the draw loop. - * - * Accepts an FFT object. You must call .analyze() - * on the FFT object prior to updating the peakDetect - * because it relies on a completed FFT analysis. - * - * @method update - * @param {p5.FFT} fftObject A p5.FFT object - */ - - peakDetect_createClass(PeakDetect, [ - { - key: "update", - value: function update(fftObject) { - var nrg = (this.energy = - fftObject.getEnergy(this.f1, this.f2) / 255); - - if ( - nrg > this.cutoff && - nrg > this.threshold && - nrg - this.penergy > 0 - ) { - this._onPeak(); - - this.isDetected = true; - - this.cutoff = nrg * this.cutoffMult; - this.framesSinceLastPeak = 0; - } else { - this.isDetected = false; - - if (this.framesSinceLastPeak <= this.framesPerPeak) { - this.framesSinceLastPeak++; - } else { - this.cutoff *= this.decayRate; - this.cutoff = Math.max(this.cutoff, this.threshold); - } - } - - this.currentValue = nrg; - this.penergy = nrg; - }, - /** - * onPeak accepts two arguments: a function to call when - * a peak is detected. The value of the peak, - * between 0.0 and 1.0, is passed to the callback. - * - * @method onPeak - * @param {Function} callback Name of a function that will - * be called when a peak is - * detected. - * @param {Object} [val] Optional value to pass - * into the function when - * a peak is detected. - * @example - *
                          - * var cnv, soundFile, fft, peakDetect; - * var ellipseWidth = 0; - * - * function preload() { - * soundFile = loadSound('assets/beat.mp3'); - * } - * - * function setup() { - * cnv = createCanvas(100,100); - * textAlign(CENTER); - * - * fft = new p5.FFT(); - * peakDetect = new p5.PeakDetect(); - * - * setupSound(); - * - * // when a beat is detected, call triggerBeat() - * peakDetect.onPeak(triggerBeat); - * } - * - * function draw() { - * background(0); - * fill(255); - * text('click to play', width/2, height/2); - * - * fft.analyze(); - * peakDetect.update(fft); - * - * ellipseWidth *= 0.95; - * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); - * } - * - * // this function is called by peakDetect.onPeak - * function triggerBeat() { - * ellipseWidth = 50; - * } - * - * // mouseclick starts/stops sound - * function setupSound() { - * cnv.mouseClicked( function() { - * if (soundFile.isPlaying() ) { - * soundFile.stop(); - * } else { - * soundFile.play(); - * } - * }); - * } - *
                          - */ - }, - { - key: "onPeak", - value: function onPeak(callback, val) { - var self = this; - - self._onPeak = function () { - callback(self.energy, val); - }; - }, - }, - ]); - - return PeakDetect; - })(); - - var peakDetect = PeakDetect; - function soundRecorder_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function soundRecorder_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function soundRecorder_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - soundRecorder_defineProperties(Constructor.prototype, protoProps); - if (staticProps) soundRecorder_defineProperties(Constructor, staticProps); - return Constructor; - } - - var soundRecorder_ac = main.audiocontext; - /** - *

                          Record sounds for playback and/or to save as a .wav file. - * The p5.SoundRecorder records all sound output from your sketch, - * or can be assigned a specific source with setInput().

                          - *

                          The record() method accepts a p5.SoundFile as a parameter. - * When playback is stopped (either after the given amount of time, - * or with the stop() method), the p5.SoundRecorder will send its - * recording to that p5.SoundFile for playback.

                          - * - * @class p5.SoundRecorder - * @constructor - * @example - *
                          - * let mic, recorder, soundFile; - * let state = 0; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(canvasPressed); - * background(220); - * textAlign(CENTER, CENTER); - * - * // create an audio in - * mic = new p5.AudioIn(); - * - * // prompts user to enable their browser mic - * mic.start(); - * - * // create a sound recorder - * recorder = new p5.SoundRecorder(); - * - * // connect the mic to the recorder - * recorder.setInput(mic); - * - * // this sound file will be used to - * // playback & save the recording - * soundFile = new p5.SoundFile(); - * - * text('tap to record', width/2, height/2); - * } - * - * function canvasPressed() { - * // ensure audio is enabled - * userStartAudio(); - * - * // make sure user enabled the mic - * if (state === 0 && mic.enabled) { - * - * // record to our p5.SoundFile - * recorder.record(soundFile); - * - * background(255,0,0); - * text('Recording!', width/2, height/2); - * state++; - * } - * else if (state === 1) { - * background(0,255,0); - * - * // stop recorder and - * // send result to soundFile - * recorder.stop(); - * - * text('Done! Tap to play and download', width/2, height/2, width - 20); - * state++; - * } - * - * else if (state === 2) { - * soundFile.play(); // play the result! - * save(soundFile, 'mySound.wav'); - * state++; - * } - * } - *
                          - */ - - var soundRecorder_SoundRecorder = (function () { - function SoundRecorder() { - soundRecorder_classCallCheck(this, SoundRecorder); - - this.input = soundRecorder_ac.createGain(); - this.output = soundRecorder_ac.createGain(); - this._inputChannels = 2; - this._outputChannels = 2; - - var workletBufferSize = safeBufferSize(1024); - this._workletNode = new AudioWorkletNode( - soundRecorder_ac, - processorNames_default.a.recorderProcessor, - { - outputChannelCount: [this._outputChannels], - processorOptions: { - numInputChannels: this._inputChannels, - bufferSize: workletBufferSize, - }, - }, - ); - - this._workletNode.port.onmessage = function (event) { - if (event.data.name === "buffers") { - var buffers = [ - new Float32Array(event.data.leftBuffer), - new Float32Array(event.data.rightBuffer), - ]; - - this._callback(buffers); - } - }.bind(this); - /** - * callback invoked when the recording is over - * @private - * @type Function(Float32Array) - */ - - this._callback = function () {}; - - this._workletNode.connect(p5.soundOut._silentNode); - - this.setInput(); - - main.soundArray.push(this); - } - /** - * Connect a specific device to the p5.SoundRecorder. - * If no parameter is given, p5.SoundRecorer will record - * all audible p5.sound from your sketch. - * - * @method setInput - * @for p5.SoundRecorder - * @param {Object} [unit] p5.sound object or a web audio unit - * that outputs sound - */ - - soundRecorder_createClass(SoundRecorder, [ - { - key: "setInput", - value: function setInput(unit) { - this.input.disconnect(); - this.input = null; - this.input = soundRecorder_ac.createGain(); - this.input.connect(this._workletNode); - this.input.connect(this.output); - - if (unit) { - unit.connect(this.input); - } else { - p5.soundOut.output.connect(this.input); - } - }, - /** - * Start recording. To access the recording, provide - * a p5.SoundFile as the first parameter. The p5.SoundRecorder - * will send its recording to that p5.SoundFile for playback once - * recording is complete. Optional parameters include duration - * (in seconds) of the recording, and a callback function that - * will be called once the complete recording has been - * transfered to the p5.SoundFile. - * - * @method record - * @for p5.SoundRecorder - * @param {p5.SoundFile} soundFile p5.SoundFile - * @param {Number} [duration] Time (in seconds) - * @param {Function} [callback] The name of a function that will be - * called once the recording completes - */ - }, - { - key: "record", - value: function record(sFile, duration, callback) { - this._workletNode.port.postMessage({ - name: "start", - duration: duration, - }); - - if (sFile && callback) { - this._callback = function (buffer) { - sFile.setBuffer(buffer); - callback(); - }; - } else if (sFile) { - this._callback = function (buffer) { - sFile.setBuffer(buffer); - }; - } - }, - /** - * Stop the recording. Once the recording is stopped, - * the results will be sent to the p5.SoundFile that - * was given on .record(), and if a callback function - * was provided on record, that function will be called. - * - * @method stop - * @for p5.SoundRecorder - */ - }, - { - key: "stop", - value: function stop() { - this._workletNode.port.postMessage({ - name: "stop", - }); - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - this._callback = function () {}; - - if (this.input) { - this.input.disconnect(); - } - - this.input = null; - this._workletNode = null; - }, - }, - ]); - - return SoundRecorder; - })(); - - var soundRecorder = soundRecorder_SoundRecorder; - function distortion_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - distortion_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - distortion_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return distortion_typeof(obj); - } - - function distortion_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function distortion_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function distortion_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - distortion_defineProperties(Constructor.prototype, protoProps); - if (staticProps) distortion_defineProperties(Constructor, staticProps); - return Constructor; - } - - function distortion_possibleConstructorReturn(self, call) { - if ( - call && - (distortion_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return distortion_assertThisInitialized(self); - } - - function distortion_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function distortion_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - distortion_get = Reflect.get; - } else { - distortion_get = function _get(target, property, receiver) { - var base = distortion_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return distortion_get(target, property, receiver || target); - } - - function distortion_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = distortion_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function distortion_getPrototypeOf(o) { - distortion_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return distortion_getPrototypeOf(o); - } - - function distortion_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) distortion_setPrototypeOf(subClass, superClass); - } - - function distortion_setPrototypeOf(o, p) { - distortion_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return distortion_setPrototypeOf(o, p); - } - - function makeDistortionCurve(amount) { - var k = typeof amount === "number" ? amount : 50; - var numSamples = 44100; - var curve = new Float32Array(numSamples); - var deg = Math.PI / 180; - var i = 0; - var x; - - for (; i < numSamples; ++i) { - x = (i * 2) / numSamples - 1; - curve[i] = ((3 + k) * x * 20 * deg) / (Math.PI + k * Math.abs(x)); - } - - return curve; - } - /** - * A Distortion effect created with a Waveshaper Node, - * with an approach adapted from - * [Kevin Ennis](http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion) - * - * This class extends p5.Effect. - * Methods amp(), chain(), - * drywet(), connect(), and - * disconnect() are available. - * - * @class p5.Distortion - * @extends p5.Effect - * @constructor - * @param {Number} [amount=0.25] Unbounded distortion amount. - * Normal values range from 0-1. - * @param {String} [oversample='none'] 'none', '2x', or '4x'. - * - */ - - var Distortion = (function (_Effect) { - distortion_inherits(Distortion, _Effect); - - function Distortion(amount, oversample) { - var _this; - - distortion_classCallCheck(this, Distortion); - - _this = distortion_possibleConstructorReturn( - this, - distortion_getPrototypeOf(Distortion).call(this), - ); - - if (typeof amount === "undefined") { - amount = 0.25; - } - - if (typeof amount !== "number") { - throw new Error("amount must be a number"); - } - - if (typeof oversample === "undefined") { - oversample = "2x"; - } - - if (typeof oversample !== "string") { - throw new Error("oversample must be a String"); - } - - var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); - /** - * The p5.Distortion is built with a - * - * Web Audio WaveShaper Node. - * - * @property {AudioNode} WaveShaperNode - */ - - _this.waveShaperNode = _this.ac.createWaveShaper(); - _this.amount = curveAmount; - _this.waveShaperNode.curve = makeDistortionCurve(curveAmount); - _this.waveShaperNode.oversample = oversample; - - _this.input.connect(_this.waveShaperNode); - - _this.waveShaperNode.connect(_this.wet); - - return _this; - } - /** - * Process a sound source, optionally specify amount and oversample values. - * - * @method process - * @for p5.Distortion - * @param {Number} [amount=0.25] Unbounded distortion amount. - * Normal values range from 0-1. - * @param {String} [oversample='none'] 'none', '2x', or '4x'. - */ - - distortion_createClass(Distortion, [ - { - key: "process", - value: function process(src, amount, oversample) { - src.connect(this.input); - this.set(amount, oversample); - }, - /** - * Set the amount and oversample of the waveshaper distortion. - * - * @method set - * @for p5.Distortion - * @param {Number} [amount=0.25] Unbounded distortion amount. - * Normal values range from 0-1. - * @param {String} [oversample='none'] 'none', '2x', or '4x'. - */ - }, - { - key: "set", - value: function set(amount, oversample) { - if (amount) { - var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); - this.amount = curveAmount; - this.waveShaperNode.curve = makeDistortionCurve(curveAmount); - } - - if (oversample) { - this.waveShaperNode.oversample = oversample; - } - }, - /** - * Return the distortion amount, typically between 0-1. - * - * @method getAmount - * @for p5.Distortion - * @return {Number} Unbounded distortion amount. - * Normal values range from 0-1. - */ - }, - { - key: "getAmount", - value: function getAmount() { - return this.amount; - }, - /** - * Return the oversampling. - * - * @method getOversample - * @for p5.Distortion - * @return {String} Oversample can either be 'none', '2x', or '4x'. - */ - }, - { - key: "getOversample", - value: function getOversample() { - return this.waveShaperNode.oversample; - }, - }, - { - key: "dispose", - value: function dispose() { - distortion_get( - distortion_getPrototypeOf(Distortion.prototype), - "dispose", - this, - ).call(this); - - if (this.waveShaperNode) { - this.waveShaperNode.disconnect(); - this.waveShaperNode = null; - } - }, - }, - ]); - - return Distortion; - })(effect); - - var distortion = Distortion; - function gain_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function gain_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function gain_createClass(Constructor, protoProps, staticProps) { - if (protoProps) gain_defineProperties(Constructor.prototype, protoProps); - if (staticProps) gain_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * A gain node is usefull to set the relative volume of sound. - * It's typically used to build mixers. - * - * @class p5.Gain - * @constructor - * @example - *
                          - * - * // load two soundfile and crossfade beetween them - * let sound1,sound2; - * let sound1Gain, sound2Gain, mixGain; - * function preload(){ - * soundFormats('ogg', 'mp3'); - * sound1 = loadSound('assets/Damscray_-_Dancing_Tiger_01'); - * sound2 = loadSound('assets/beat'); - * } - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(startSound); - * // create a 'mix' gain bus to which we will connect both soundfiles - * mixGain = new p5.Gain(); - * mixGain.connect(); - * sound1.disconnect(); // diconnect from p5 output - * sound1Gain = new p5.Gain(); // setup a gain node - * sound1Gain.setInput(sound1); // connect the first sound to its input - * sound1Gain.connect(mixGain); // connect its output to the final mix bus - * sound2.disconnect(); - * sound2Gain = new p5.Gain(); - * sound2Gain.setInput(sound2); - * sound2Gain.connect(mixGain); - * } - * function startSound() { - * sound1.loop(); - * sound2.loop(); - * loop(); - * } - * function mouseReleased() { - * sound1.stop(); - * sound2.stop(); - * } - * function draw(){ - * background(220); - * textAlign(CENTER); - * textSize(11); - * fill(0); - * if (!sound1.isPlaying()) { - * text('tap and drag to play', width/2, height/2); - * return; - * } - * // map the horizontal position of the mouse to values useable for volume * control of sound1 - * var sound1Volume = constrain(map(mouseX,width,0,0,1), 0, 1); - * var sound2Volume = 1-sound1Volume; - * sound1Gain.amp(sound1Volume); - * sound2Gain.amp(sound2Volume); - * // map the vertical position of the mouse to values useable for 'output * volume control' - * var outputVolume = constrain(map(mouseY,height,0,0,1), 0, 1); - * mixGain.amp(outputVolume); - * text('output', width/2, height - outputVolume * height * 0.9) - * fill(255, 0, 255); - * textAlign(LEFT); - * text('sound1', 5, height - sound1Volume * height * 0.9); - * textAlign(RIGHT); - * text('sound2', width - 5, height - sound2Volume * height * 0.9); - * } - *
                          - */ - - var gain_Gain = (function () { - function Gain() { - gain_classCallCheck(this, Gain); - - this.ac = main.audiocontext; - this.input = this.ac.createGain(); - this.output = this.ac.createGain(); - - this.input.gain.value = 0.5; - this.input.connect(this.output); - - main.soundArray.push(this); - } - /** - * Connect a source to the gain node. - * - * @method setInput - * @for p5.Gain - * @param {Object} src p5.sound / Web Audio object with a sound - * output. - */ - - gain_createClass(Gain, [ - { - key: "setInput", - value: function setInput(src) { - src.connect(this.input); - }, - /** - * Send output to a p5.sound or web audio object - * - * @method connect - * @for p5.Gain - * @param {Object} unit - */ - }, - { - key: "connect", - value: function connect(unit) { - var u = unit || p5.soundOut.input; - this.output.connect(u.input ? u.input : u); - }, - /** - * Disconnect all output. - * - * @method disconnect - * @for p5.Gain - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - }, - /** - * Set the output level of the gain node. - * - * @method amp - * @for p5.Gain - * @param {Number} volume amplitude between 0 and 1.0 - * @param {Number} [rampTime] create a fade that lasts rampTime - * @param {Number} [timeFromNow] schedule this event to happen - * seconds from now - */ - }, - { - key: "amp", - value: function amp(vol) { - var rampTime = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var tFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - var now = main.audiocontext.currentTime; - var currentVol = this.output.gain.value; - this.output.gain.cancelScheduledValues(now); - this.output.gain.linearRampToValueAtTime( - currentVol, - now + tFromNow, - ); - this.output.gain.linearRampToValueAtTime( - vol, - now + tFromNow + rampTime, - ); - }, - }, - { - key: "dispose", - value: function dispose() { - var index = main.soundArray.indexOf(this); - main.soundArray.splice(index, 1); - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - - if (this.input) { - this.input.disconnect(); - delete this.input; - } - }, - }, - ]); - - return Gain; - })(); - - var gain = gain_Gain; - function audioVoice_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function audioVoice_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function audioVoice_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - audioVoice_defineProperties(Constructor.prototype, protoProps); - if (staticProps) audioVoice_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * Base class for monophonic synthesizers. Any extensions of this class - * should follow the API and implement the methods below in order to - * remain compatible with p5.PolySynth(); - * - * @class p5.AudioVoice - * @constructor - */ - - var audioVoice_AudioVoice = (function () { - function AudioVoice() { - audioVoice_classCallCheck(this, AudioVoice); - - this.ac = main.audiocontext; - this.output = this.ac.createGain(); - this.connect(); - main.soundArray.push(this); - } - - audioVoice_createClass(AudioVoice, [ - { - key: "play", - value: function play(note, velocity, secondsFromNow, sustime) {}, - }, - { - key: "triggerAttack", - value: function triggerAttack(note, velocity, secondsFromNow) {}, - }, - { - key: "triggerRelease", - value: function triggerRelease(secondsFromNow) {}, - }, - { - key: "amp", - value: function amp(vol, rampTime) {}, - /** - * Connect to p5 objects or Web Audio Nodes - * @method connect - * @for p5.AudioVoice - * @param {Object} unit - */ - }, - { - key: "connect", - value: function connect(unit) { - var u = unit || main.input; - this.output.connect(u.input ? u.input : u); - }, - /** - * Disconnect from soundOut - * @method disconnect - * @for p5.AudioVoice - */ - }, - { - key: "disconnect", - value: function disconnect() { - this.output.disconnect(); - }, - }, - { - key: "dispose", - value: function dispose() { - if (this.output) { - this.output.disconnect(); - delete this.output; - } - }, - }, - ]); - - return AudioVoice; - })(); - - var audioVoice_0 = audioVoice_AudioVoice; - function monosynth_typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - monosynth_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - monosynth_typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return monosynth_typeof(obj); - } - - function monosynth_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function monosynth_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function monosynth_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - monosynth_defineProperties(Constructor.prototype, protoProps); - if (staticProps) monosynth_defineProperties(Constructor, staticProps); - return Constructor; - } - - function monosynth_possibleConstructorReturn(self, call) { - if ( - call && - (monosynth_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return monosynth_assertThisInitialized(self); - } - - function monosynth_assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - - function monosynth_get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - monosynth_get = Reflect.get; - } else { - monosynth_get = function _get(target, property, receiver) { - var base = monosynth_superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return monosynth_get(target, property, receiver || target); - } - - function monosynth_superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = monosynth_getPrototypeOf(object); - if (object === null) break; - } - return object; - } - - function monosynth_getPrototypeOf(o) { - monosynth_getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return monosynth_getPrototypeOf(o); - } - - function monosynth_inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { value: subClass, writable: true, configurable: true }, - }); - if (superClass) monosynth_setPrototypeOf(subClass, superClass); - } - - function monosynth_setPrototypeOf(o, p) { - monosynth_setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return monosynth_setPrototypeOf(o, p); - } - - var DEFAULT_SUSTAIN = 0.15; - /** - * A MonoSynth is used as a single voice for sound synthesis. - * This is a class to be used in conjunction with the PolySynth - * class. Custom synthetisers should be built inheriting from - * this class. - * - * @class p5.MonoSynth - * @constructor - * @example - *
                          - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * textAlign(CENTER); - * text('tap to play', width/2, height/2); - * - * monoSynth = new p5.MonoSynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * let note = random(['Fb4', 'G4']); - * // note velocity (volume, from 0 to 1) - * let velocity = random(); - * // time from now (in seconds) - * let time = 0; - * // note duration (in seconds) - * let dur = 1/6; - * - * monoSynth.play(note, velocity, time, dur); - * } - *
                          - **/ - - var monosynth_MonoSynth = (function (_AudioVoice) { - monosynth_inherits(MonoSynth, _AudioVoice); - - function MonoSynth() { - var _this; - - monosynth_classCallCheck(this, MonoSynth); - - _this = monosynth_possibleConstructorReturn( - this, - monosynth_getPrototypeOf(MonoSynth).call(this), - ); - _this.oscillator = new oscillator(); - _this.env = new envelope(); - - _this.env.setRange(1, 0); - - _this.env.setExp(true); - - _this.setADSR(0.02, 0.25, 0.05, 0.35); - - _this.oscillator.disconnect(); - - _this.oscillator.connect(_this.output); - - _this.env.disconnect(); - - _this.env.setInput(_this.output.gain); - - _this.oscillator.output.gain.value = 1.0; - - _this.oscillator.start(); - - _this.connect(); - - main.soundArray.push(monosynth_assertThisInitialized(_this)); - /** - * Getters and Setters - * @property {Number} attack - * @for p5.MonoSynth - */ - - /** - * @property {Number} decay - * @for p5.MonoSynth - */ - - /** - * @property {Number} sustain - * @for p5.MonoSynth - */ - - /** - * @property {Number} release - * @for p5.MonoSynth - */ - - Object.defineProperties(monosynth_assertThisInitialized(_this), { - attack: { - get: function get() { - return this.env.aTime; - }, - set: function set(attack) { - this.env.setADSR( - attack, - this.env.dTime, - this.env.sPercent, - this.env.rTime, - ); - }, - }, - decay: { - get: function get() { - return this.env.dTime; - }, - set: function set(decay) { - this.env.setADSR( - this.env.aTime, - decay, - this.env.sPercent, - this.env.rTime, - ); - }, - }, - sustain: { - get: function get() { - return this.env.sPercent; - }, - set: function set(sustain) { - this.env.setADSR( - this.env.aTime, - this.env.dTime, - sustain, - this.env.rTime, - ); - }, - }, - release: { - get: function get() { - return this.env.rTime; - }, - set: function set(release) { - this.env.setADSR( - this.env.aTime, - this.env.dTime, - this.env.sPercent, - release, - ); - }, - }, - }); - return _this; - } - /** - * Play tells the MonoSynth to start playing a note. This method schedules - * the calling of .triggerAttack and .triggerRelease. - * - * @method play - * @for p5.MonoSynth - * @param {String | Number} note the note you want to play, specified as a - * frequency in Hertz (Number) or as a midi - * value in Note/Octave format ("C4", "Eb3"...etc") - * See - * Tone. Defaults to 440 hz. - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) - * @param {Number} [secondsFromNow] time from now (in seconds) at which to play - * @param {Number} [sustainTime] time to sustain before releasing the envelope. Defaults to 0.15 seconds. - * @example - *
                          - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * textAlign(CENTER); - * text('tap to play', width/2, height/2); - * - * monoSynth = new p5.MonoSynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * let note = random(['Fb4', 'G4']); - * // note velocity (volume, from 0 to 1) - * let velocity = random(); - * // time from now (in seconds) - * let time = 0; - * // note duration (in seconds) - * let dur = 1/6; - * - * monoSynth.play(note, velocity, time, dur); - * } - *
                          - * - */ - - monosynth_createClass(MonoSynth, [ - { - key: "play", - value: function play(note, velocity, secondsFromNow, susTime) { - this.triggerAttack(note, velocity, ~~secondsFromNow); - this.triggerRelease( - ~~secondsFromNow + (susTime || DEFAULT_SUSTAIN), - ); - }, - /** - * Trigger the Attack, and Decay portion of the Envelope. - * Similar to holding down a key on a piano, but it will - * hold the sustain level until you let go. - * - * @param {String | Number} note the note you want to play, specified as a - * frequency in Hertz (Number) or as a midi - * value in Note/Octave format ("C4", "Eb3"...etc") - * See - * Tone. Defaults to 440 hz - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) - * @param {Number} [secondsFromNow] time from now (in seconds) at which to play - * @method triggerAttack - * @for p5.MonoSynth - * @example - *
                          - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(triggerAttack); - * background(220); - * text('tap here for attack, let go to release', 5, 20, width - 20); - * monoSynth = new p5.MonoSynth(); - * } - * - * function triggerAttack() { - * userStartAudio(); - * - * monoSynth.triggerAttack("E3"); - * } - * - * function mouseReleased() { - * monoSynth.triggerRelease(); - * } - *
                          - */ - }, - { - key: "triggerAttack", - value: function triggerAttack(note, velocity) { - var secondsFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - var freq = noteToFreq(note); - var vel = velocity || 0.1; - this.oscillator.freq(freq, 0, secondsFromNow); - this.env.ramp(this.output.gain, secondsFromNow, vel); - }, - /** - * Trigger the release of the Envelope. This is similar to releasing - * the key on a piano and letting the sound fade according to the - * release level and release time. - * - * @param {Number} secondsFromNow time to trigger the release - * @method triggerRelease - * @for p5.MonoSynth - * @example - *
                          - * let monoSynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(triggerAttack); - * background(220); - * text('tap here for attack, let go to release', 5, 20, width - 20); - * monoSynth = new p5.MonoSynth(); - * } - * - * function triggerAttack() { - * userStartAudio(); - * - * monoSynth.triggerAttack("E3"); - * } - * - * function mouseReleased() { - * monoSynth.triggerRelease(); - * } - *
                          - */ - }, - { - key: "triggerRelease", - value: function triggerRelease() { - var secondsFromNow = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : 0; - this.env.ramp(this.output.gain, secondsFromNow, 0); - }, - /** - * Set values like a traditional - * - * ADSR envelope - * . - * - * @method setADSR - * @for p5.MonoSynth - * @param {Number} attackTime Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - */ - }, - { - key: "setADSR", - value: function setADSR(attack, decay, sustain, release) { - this.env.setADSR(attack, decay, sustain, release); - }, - /** - * MonoSynth amp - * @method amp - * @for p5.MonoSynth - * @param {Number} vol desired volume - * @param {Number} [rampTime] Time to reach new volume - * @return {Number} new volume value - */ - }, - { - key: "amp", - value: function amp(vol, rampTime) { - var t = rampTime || 0; - - if (typeof vol !== "undefined") { - this.oscillator.amp(vol, t); - } - - return this.oscillator.amp().value; - }, - /** - * Connect to a p5.sound / Web Audio object. - * - * @method connect - * @for p5.MonoSynth - * @param {Object} unit A p5.sound or Web Audio object - */ - }, - { - key: "connect", - value: function connect(unit) { - var u = unit || main.input; - this.output.connect(u.input ? u.input : u); - }, - /** - * Disconnect all outputs - * - * @method disconnect - * @for p5.MonoSynth - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - }, - /** - * Get rid of the MonoSynth and free up its resources / memory. - * - * @method dispose - * @for p5.MonoSynth - */ - }, - { - key: "dispose", - value: function dispose() { - monosynth_get( - monosynth_getPrototypeOf(MonoSynth.prototype), - "dispose", - this, - ).call(this); - - if (this.env) { - this.env.dispose(); - } - - if (this.oscillator) { - this.oscillator.dispose(); - } - }, - }, - ]); - - return MonoSynth; - })(audioVoice_0); - - var monosynth = monosynth_MonoSynth; - function onsetDetect_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function onsetDetect_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function onsetDetect_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - onsetDetect_defineProperties(Constructor.prototype, protoProps); - if (staticProps) onsetDetect_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * Listen for onsets (a sharp increase in volume) within a given - * frequency range. - * - * @class p5.OnsetDetect - * @constructor - * @param {Number} freqLow Low frequency - * @param {Number} freqHigh High frequency - * @param {Number} threshold Amplitude threshold between 0 (no energy) and 1 (maximum) - * @param {Function} callback Function to call when an onset is detected - */ - var OnsetDetect = (function () { - function OnsetDetect(freqLow, freqHigh, threshold, callback) { - onsetDetect_classCallCheck(this, OnsetDetect); - - this.isDetected = false; - this.freqLow = freqLow; - this.freqHigh = freqHigh; - this.treshold = threshold; - this.energy = 0; - this.penergy = 0; - - this.sensitivity = 500; - this.callback = callback; - } - - onsetDetect_createClass(OnsetDetect, [ - { - key: "update", - value: function update(fftObject, callback) { - this.energy = - fftObject.getEnergy(this.freqLow, this.freqHigh) / 255; - - if (this.isDetected === false) { - if (this.energy - this.penergy > this.treshold) { - this.isDetected = true; - - if (this.callback) { - this.callback(this.energy); - } else if (callback) { - callback(this.energy); - } - - var self = this; - setTimeout(function () { - self.isDetected = false; - }, this.sensitivity); - } - } - - this.penergy = this.energy; - }, - }, - ]); - - return OnsetDetect; - })(); - - var onsetDetect = OnsetDetect; - function polysynth_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function polysynth_defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function polysynth_createClass(Constructor, protoProps, staticProps) { - if (protoProps) - polysynth_defineProperties(Constructor.prototype, protoProps); - if (staticProps) polysynth_defineProperties(Constructor, staticProps); - return Constructor; - } - - /** - * An AudioVoice is used as a single voice for sound synthesis. - * The PolySynth class holds an array of AudioVoice, and deals - * with voices allocations, with setting notes to be played, and - * parameters to be set. - * - * @class p5.PolySynth - * @constructor - * - * @param {Number} [synthVoice] A monophonic synth voice inheriting - * the AudioVoice class. Defaults to p5.MonoSynth - * @param {Number} [maxVoices] Number of voices, defaults to 8; - * @example - *
                          - * let polySynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * text('click to play', 20, 20); - * - * polySynth = new p5.PolySynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * // note duration (in seconds) - * let dur = 1.5; - * - * // time from now (in seconds) - * let time = 0; - * - * // velocity (volume, from 0 to 1) - * let vel = 0.1; - * - * // notes can overlap with each other - * polySynth.play('G2', vel, 0, dur); - * polySynth.play('C3', vel, time += 1/3, dur); - * polySynth.play('G3', vel, time += 1/3, dur); - * } - *
                          - **/ - - var polysynth_PolySynth = (function () { - function PolySynth(audioVoice, maxVoices) { - polysynth_classCallCheck(this, PolySynth); - - this.audiovoices = []; - /** - * An object that holds information about which notes have been played and - * which notes are currently being played. New notes are added as keys - * on the fly. While a note has been attacked, but not released, the value of the - * key is the audiovoice which is generating that note. When notes are released, - * the value of the key becomes undefined. - * @property notes - */ - - this.notes = {}; - - this._newest = 0; - this._oldest = 0; - /** - * A PolySynth must have at least 1 voice, defaults to 8 - * @property polyvalue - */ - - this.maxVoices = maxVoices || 8; - /** - * Monosynth that generates the sound for each note that is triggered. The - * p5.PolySynth defaults to using the p5.MonoSynth as its voice. - * @property AudioVoice - */ - - this.AudioVoice = audioVoice === undefined ? p5.MonoSynth : audioVoice; - /** - * This value must only change as a note is attacked or released. Due to delay - * and sustain times, Tone.TimelineSignal is required to schedule the change in value. - * @private - * @property {Tone.TimelineSignal} _voicesInUse - */ - - this._voicesInUse = new TimelineSignal_default.a(0); - this.output = main.audiocontext.createGain(); - this.connect(); - - this._allocateVoices(); - - main.soundArray.push(this); - } - /** - * Construct the appropriate number of audiovoices - * @private - * @for p5.PolySynth - * @method _allocateVoices - */ - - polysynth_createClass(PolySynth, [ - { - key: "_allocateVoices", - value: function _allocateVoices() { - for (var i = 0; i < this.maxVoices; i++) { - this.audiovoices.push(new this.AudioVoice()); - this.audiovoices[i].disconnect(); - this.audiovoices[i].connect(this.output); - } - }, - /** - * Play a note by triggering noteAttack and noteRelease with sustain time - * - * @method play - * @for p5.PolySynth - * @param {Number} [note] midi note to play (ranging from 0 to 127 - 60 being a middle C) - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) - * @param {Number} [secondsFromNow] time from now (in seconds) at which to play - * @param {Number} [sustainTime] time to sustain before releasing the envelope - * @example - *
                          - * let polySynth; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playSynth); - * background(220); - * text('click to play', 20, 20); - * - * polySynth = new p5.PolySynth(); - * } - * - * function playSynth() { - * userStartAudio(); - * - * // note duration (in seconds) - * let dur = 1.5; - * - * // time from now (in seconds) - * let time = 0; - * - * // velocity (volume, from 0 to 1) - * let vel = 0.1; - * - * // notes can overlap with each other - * polySynth.play('G2', vel, 0, dur); - * polySynth.play('C3', vel, time += 1/3, dur); - * polySynth.play('G3', vel, time += 1/3, dur); - * } - *
                          - */ - }, - { - key: "play", - value: function play(note, velocity, secondsFromNow) { - var susTime = - arguments.length > 3 && arguments[3] !== undefined - ? arguments[3] - : 1; - this.noteAttack(note, velocity, secondsFromNow); - this.noteRelease(note, secondsFromNow + susTime); - }, - /** - * noteADSR sets the envelope for a specific note that has just been triggered. - * Using this method modifies the envelope of whichever audiovoice is being used - * to play the desired note. The envelope should be reset before noteRelease is called - * in order to prevent the modified envelope from being used on other notes. - * - * @method noteADSR - * @for p5.PolySynth - * @param {Number} [note] Midi note on which ADSR should be set. - * @param {Number} [attackTime] Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - **/ - }, - { - key: "noteADSR", - value: function noteADSR(note, a, d, s, r) { - var timeFromNow = - arguments.length > 5 && arguments[5] !== undefined - ? arguments[5] - : 0; - var now = main.audiocontext.currentTime; - var t = now + timeFromNow; - this.audiovoices[this.notes[note].getValueAtTime(t)].setADSR( - a, - d, - s, - r, - ); - }, - /** - * Set the PolySynths global envelope. This method modifies the envelopes of each - * monosynth so that all notes are played with this envelope. - * - * @method setADSR - * @for p5.PolySynth - * @param {Number} [attackTime] Time (in seconds before envelope - * reaches Attack Level - * @param {Number} [decayTime] Time (in seconds) before envelope - * reaches Decay/Sustain Level - * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, - * where 1.0 = attackLevel, 0.0 = releaseLevel. - * The susRatio determines the decayLevel and the level at which the - * sustain portion of the envelope will sustain. - * For example, if attackLevel is 0.4, releaseLevel is 0, - * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is - * increased to 1.0 (using setRange), - * then decayLevel would increase proportionally, to become 0.5. - * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) - **/ - }, - { - key: "setADSR", - value: function setADSR(a, d, s, r) { - this.audiovoices.forEach(function (voice) { - voice.setADSR(a, d, s, r); - }); - }, - /** - * Trigger the Attack, and Decay portion of a MonoSynth. - * Similar to holding down a key on a piano, but it will - * hold the sustain level until you let go. - * - * @method noteAttack - * @for p5.PolySynth - * @param {Number} [note] midi note on which attack should be triggered. - * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1)/ - * @param {Number} [secondsFromNow] time from now (in seconds) - * @example - *
                          - * let polySynth = new p5.PolySynth(); - * let pitches = ['G', 'D', 'G', 'C']; - * let octaves = [2, 3, 4]; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playChord); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function playChord() { - * userStartAudio(); - * - * // play a chord: multiple notes at the same time - * for (let i = 0; i < 4; i++) { - * let note = random(pitches) + random(octaves); - * polySynth.noteAttack(note, 0.1); - * } - * } - * - * function mouseReleased() { - * // release all voices - * polySynth.noteRelease(); - * } - *
                          - */ - }, - { - key: "noteAttack", - value: function noteAttack(_note, _velocity) { - var secondsFromNow = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - var acTime = main.audiocontext.currentTime + secondsFromNow; - - var note = noteToFreq(_note); - var velocity = _velocity || 0.1; - var currentVoice; - - if ( - this.notes[note] && - this.notes[note].getValueAtTime(acTime) !== null - ) { - this.noteRelease(note, 0); - } - - if (this._voicesInUse.getValueAtTime(acTime) < this.maxVoices) { - currentVoice = Math.max( - ~~this._voicesInUse.getValueAtTime(acTime), - 0, - ); - } else { - currentVoice = this._oldest; - oldestNote = freqToMidi( - this.audiovoices[this._oldest].oscillator.freq().value, - ); - this.noteRelease(oldestNote); - this._oldest = (this._oldest + 1) % (this.maxVoices - 1); - } - - this.notes[note] = new TimelineSignal_default.a(); - this.notes[note].setValueAtTime(currentVoice, acTime); - - var previousVal = - this._voicesInUse._searchBefore(acTime) === null - ? 0 - : this._voicesInUse._searchBefore(acTime).value; - - this._voicesInUse.setValueAtTime(previousVal + 1, acTime); - - this._updateAfter(acTime, 1); - - this._newest = currentVoice; - - if (typeof velocity === "number") { - var maxRange = (1 / this._voicesInUse.getValueAtTime(acTime)) * 2; - velocity = velocity > maxRange ? maxRange : velocity; - } - - this.audiovoices[currentVoice].triggerAttack( - note, - velocity, - secondsFromNow, - ); - }, - /** - * Private method to ensure accurate values of this._voicesInUse - * Any time a new value is scheduled, it is necessary to increment all subsequent - * scheduledValues after attack, and decrement all subsequent - * scheduledValues after release - * - * @private - * @for p5.PolySynth - * @param {[type]} time [description] - * @param {[type]} value [description] - * @return {[type]} [description] - */ - }, - { - key: "_updateAfter", - value: function _updateAfter(time, value) { - if (this._voicesInUse._searchAfter(time) === null) { - return; - } else { - this._voicesInUse._searchAfter(time).value += value; - - var nextTime = this._voicesInUse._searchAfter(time).time; - - this._updateAfter(nextTime, value); - } - }, - /** - * Trigger the Release of an AudioVoice note. This is similar to releasing - * the key on a piano and letting the sound fade according to the - * release level and release time. - * - * @method noteRelease - * @for p5.PolySynth - * @param {Number} [note] midi note on which attack should be triggered. - * If no value is provided, all notes will be released. - * @param {Number} [secondsFromNow] time to trigger the release - * @example - *
                          - * let polySynth = new p5.PolySynth(); - * let pitches = ['G', 'D', 'G', 'C']; - * let octaves = [2, 3, 4]; - * - * function setup() { - * let cnv = createCanvas(100, 100); - * cnv.mousePressed(playChord); - * background(220); - * text('tap to play', 20, 20); - * } - * - * function playChord() { - * userStartAudio(); - * - * // play a chord: multiple notes at the same time - * for (let i = 0; i < 4; i++) { - * let note = random(pitches) + random(octaves); - * polySynth.noteAttack(note, 0.1); - * } - * } - * - * function mouseReleased() { - * // release all voices - * polySynth.noteRelease(); - * } - *
                          - * - */ - }, - { - key: "noteRelease", - value: function noteRelease(_note, secondsFromNow) { - var now = main.audiocontext.currentTime; - var tFromNow = secondsFromNow || 0; - var t = now + tFromNow; - - if (!_note) { - this.audiovoices.forEach(function (voice) { - voice.triggerRelease(tFromNow); - }); - - this._voicesInUse.setValueAtTime(0, t); - - for (var n in this.notes) { - this.notes[n].dispose(); - delete this.notes[n]; - } - - return; - } - - var note = noteToFreq(_note); - - if ( - !this.notes[note] || - this.notes[note].getValueAtTime(t) === null - ) { - console.warn("Cannot release a note that is not already playing"); - } else { - var previousVal = Math.max( - ~~this._voicesInUse.getValueAtTime(t).value, - 1, - ); - - this._voicesInUse.setValueAtTime(previousVal - 1, t); - - if (previousVal > 0) { - this._updateAfter(t, -1); - } - - this.audiovoices[ - this.notes[note].getValueAtTime(t) - ].triggerRelease(tFromNow); - this.notes[note].dispose(); - delete this.notes[note]; - this._newest = - this._newest === 0 - ? 0 - : (this._newest - 1) % (this.maxVoices - 1); - } - }, - /** - * Connect to a p5.sound / Web Audio object. - * - * @method connect - * @for p5.PolySynth - * @param {Object} unit A p5.sound or Web Audio object - */ - }, - { - key: "connect", - value: function connect(unit) { - var u = unit || main.input; - this.output.connect(u.input ? u.input : u); - }, - /** - * Disconnect all outputs - * - * @method disconnect - * @for p5.PolySynth - */ - }, - { - key: "disconnect", - value: function disconnect() { - if (this.output) { - this.output.disconnect(); - } - }, - /** - * Get rid of the MonoSynth and free up its resources / memory. - * - * @method dispose - * @for p5.PolySynth - */ - }, - { - key: "dispose", - value: function dispose() { - this.audiovoices.forEach(function (voice) { - voice.dispose(); - }); - - if (this.output) { - this.output.disconnect(); - delete this.output; - } - }, - }, - ]); - - return PolySynth; - })(); - - var polysynth = polysynth_PolySynth; - function Signal_classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var Signal_Signal = function Signal() { - Signal_classCallCheck(this, Signal); - - console.warn("p5.Signal is deprecated , Use Tone.js Signal instead "); - }; - - var deprecations_Signal = Signal_Signal; - - p5.prototype.getAudioContext = audiocontext["b"]; - p5.prototype.userStartAudio = audiocontext["c"]; - - p5.prototype.sampleRate = sampleRate; - p5.prototype.freqToMidi = freqToMidi; - p5.prototype.midiToFreq = midiToFreq; - p5.prototype.noteToFreq = noteToFreq; - p5.prototype.soundFormats = soundFormats; - p5.prototype.disposeSound = disposeSound; - p5.prototype._checkFileFormats = _checkFileFormats; - p5.prototype._mathChain = _mathChain; - p5.prototype.convertToWav = convertToWav; - p5.prototype.interleave = interleave; - p5.prototype.writeUTFBytes = writeUTFBytes; - p5.prototype.safeBufferSize = safeBufferSize; - p5.prototype.saveSound = saveSound; - - p5.prototype.registerMethod("remove", p5.prototype.disposeSound); - - p5.Panner = panner_0; - - p5.SoundFile = soundfile; - p5.prototype.loadSound = loadSound; - - p5.prototype.registerPreloadMethod("loadSound", p5.prototype); - - p5.Amplitude = amplitude; - - p5.FFT = fft; - - p5.Oscillator = oscillator; - p5.SinOsc = SinOsc; - p5.TriOsc = TriOsc; - p5.SawOsc = SawOsc; - p5.SqrOsc = SqrOsc; + (function(modules) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if(installedModules[moduleId]) { + return installedModules[moduleId].exports; + } + var module = installedModules[moduleId] = { + i: moduleId, + l: false, + exports: {} + }; + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + module.l = true; + return module.exports; + } + __webpack_require__.m = modules; + __webpack_require__.c = installedModules; + __webpack_require__.d = function(exports, name, getter) { + if(!__webpack_require__.o(exports, name)) { + Object.defineProperty(exports, name, { enumerable: true, get: getter }); + } + }; + __webpack_require__.r = function(exports) { + if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { + Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + } + Object.defineProperty(exports, '__esModule', { value: true }); + }; + __webpack_require__.t = function(value, mode) { + if(mode & 1) value = __webpack_require__(value); + if(mode & 8) return value; + if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; + var ns = Object.create(null); + __webpack_require__.r(ns); + Object.defineProperty(ns, 'default', { enumerable: true, value: value }); + if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); + return ns; + }; + __webpack_require__.n = function(module) { + var getter = module && module.__esModule ? + function getDefault() { return module['default']; } : + function getModuleExports() { return module; }; + __webpack_require__.d(getter, 'a', getter); + return getter; + }; + __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; + __webpack_require__.p = ""; + return __webpack_require__(__webpack_require__.s = 40); + }) + ([ + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){"use strict";function a(t,e){this.isUndef(t)||1===t?this.input=this.context.createGain():1Returns the Audio Context for this sketch. Useful for users + * who would like to dig deeper into the Web Audio API + * .

                          + * + *

                          Some browsers require users to startAudioContext + * with a user gesture, such as touchStarted in the example below.

                          + * + * @for p5 + * @method getAudioContext + * @return {Object} AudioContext for this sketch + * @example + *
                          + * function draw() { + * background(255); + * textAlign(CENTER); + * + * if (getAudioContext().state !== 'running') { + * text('click to start audio', width/2, height/2); + * } else { + * text('audio is enabled', width/2, height/2); + * } + * } + * + * function touchStarted() { + * if (getAudioContext().state !== 'running') { + * getAudioContext().resume(); + * } + * var synth = new p5.MonoSynth(); + * synth.play('A4', 0.5, 0, 0.2); + * } + * + *
                          + */ + +function getAudioContext() { + return audiocontext; +} +/** + *

                          It is not only a good practice to give users control over starting + * audio. This policy is enforced by many web browsers, including iOS and + * Google Chrome, which create the Web Audio API's + * Audio Context + * in a suspended state.

                          + * + *

                          In these browser-specific policies, sound will not play until a user + * interaction event (i.e. mousePressed()) explicitly resumes + * the AudioContext, or starts an audio node. This can be accomplished by + * calling start() on a p5.Oscillator, + * play() on a p5.SoundFile, or simply + * userStartAudio().

                          + * + *

                          userStartAudio() starts the AudioContext on a user + * gesture. The default behavior will enable audio on any + * mouseUp or touchEnd event. It can also be placed in a specific + * interaction function, such as mousePressed() as in the + * example below. This method utilizes + * StartAudioContext + * , a library by Yotam Mann (MIT Licence, 2016).

                          + * @param {Element|Array} [elements] This argument can be an Element, + * Selector String, NodeList, p5.Element, + * jQuery Element, or an Array of any of those. + * @param {Function} [callback] Callback to invoke when the AudioContext + * has started + * @return {Promise} Returns a Promise that resolves when + * the AudioContext state is 'running' + * @method userStartAudio + * @for p5 + * @example + *
                          + * function setup() { + * // mimics the autoplay policy + * getAudioContext().suspend(); + * + * let mySynth = new p5.MonoSynth(); + * + * // This won't play until the context has resumed + * mySynth.play('A6'); + * } + * function draw() { + * background(220); + * textAlign(CENTER, CENTER); + * text(getAudioContext().state, width/2, height/2); + * } + * function mousePressed() { + * userStartAudio(); + * } + *
                          + */ + +function userStartAudio(elements, callback) { + var elt = elements; + + if (elements instanceof p5.Element) { + elt = elements.elt; + } else if (elements instanceof Array && elements[0] instanceof p5.Element) { + elt = elements.map(function (e) { + return e.elt; + }); + } + + return startaudiocontext__WEBPACK_IMPORTED_MODULE_0___default()(audiocontext, elt, callback); +} + __webpack_exports__["a"] = (audiocontext); +}.call(this, __webpack_require__(26))) + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(2),__webpack_require__(10)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(i){"use strict";return i.Add=function(t){this.createInsOuts(2,0),this._sum=this.input[0]=this.input[1]=this.output=new i.Gain,this._param=this.input[1]=new i.Signal(t),this._param.connect(this._sum)},i.extend(i.Add,i.Signal),i.Add.prototype.dispose=function(){return i.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this._param.dispose(),this._param=null,this},i.Add}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports) { + +module.exports = { + recorderProcessor: 'recorder-processor', + soundFileProcessor: 'sound-file-processor', + amplitudeProcessor: 'amplitude-processor' +}; + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(15)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){"use strict";return e.WaveShaper=function(e,t){this._shaper=this.input=this.output=this.context.createWaveShaper(),this._curve=null,Array.isArray(e)?this.curve=e:isFinite(e)||this.isUndef(e)?this._curve=new Float32Array(this.defaultArg(e,1024)):this.isFunction(e)&&(this._curve=new Float32Array(this.defaultArg(t,1024)),this.setMap(e))},e.extend(e.WaveShaper,e.SignalBase),e.WaveShaper.prototype.setMap=function(e){for(var t=0,r=this._curve.length;te)this.cancelScheduledValues(e),this.linearRampToValueAtTime(t,e);else{var n=this._searchAfter(e);n&&(this.cancelScheduledValues(e),n.type===o.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(t,e):n.type===o.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(t,e)),this.setValueAtTime(t,e)}return this},o.TimelineSignal.prototype.linearRampToValueBetween=function(e,t,i){return this.setRampPoint(t),this.linearRampToValueAtTime(e,i),this},o.TimelineSignal.prototype.exponentialRampToValueBetween=function(e,t,i){return this.setRampPoint(t),this.exponentialRampToValueAtTime(e,i),this},o.TimelineSignal.prototype._searchBefore=function(e){return this._events.get(e)},o.TimelineSignal.prototype._searchAfter=function(e){return this._events.getAfter(e)},o.TimelineSignal.prototype.getValueAtTime=function(e){e=this.toSeconds(e);var t=this._searchAfter(e),i=this._searchBefore(e),n=this._initial;if(null===i)n=this._initial;else if(i.type===o.TimelineSignal.Type.Target){var a,l=this._events.getBefore(i.time);a=null===l?this._initial:l.value,n=this._exponentialApproach(i.time,a,i.value,i.constant,e)}else n=i.type===o.TimelineSignal.Type.Curve?this._curveInterpolate(i.time,i.value,i.duration,e):null===t?i.value:t.type===o.TimelineSignal.Type.Linear?this._linearInterpolate(i.time,i.value,t.time,t.value,e):t.type===o.TimelineSignal.Type.Exponential?this._exponentialInterpolate(i.time,i.value,t.time,t.value,e):i.value;return n},o.TimelineSignal.prototype.connect=o.SignalBase.prototype.connect,o.TimelineSignal.prototype._exponentialApproach=function(e,t,i,n,a){return i+(t-i)*Math.exp(-(a-e)/n)},o.TimelineSignal.prototype._linearInterpolate=function(e,t,i,n,a){return t+(a-e)/(i-e)*(n-t)},o.TimelineSignal.prototype._exponentialInterpolate=function(e,t,i,n,a){return(t=Math.max(this._minOutput,t))*Math.pow(n/t,(a-e)/(i-e))},o.TimelineSignal.prototype._curveInterpolate=function(e,t,i,n){var a=t.length;if(e+i<=n)return t[a-1];if(n<=e)return t[0];var l=(n-e)/i,s=Math.floor((a-1)*l),r=Math.ceil((a-1)*l),o=t[s],p=t[r];return r===s?o:this._linearInterpolate(s,o,r,p,l*(a-1))},o.TimelineSignal.prototype.dispose=function(){o.Signal.prototype.dispose.call(this),o.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},o.TimelineSignal}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(4),__webpack_require__(1),__webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(i){"use strict";return i.Scale=function(t,e){this._outputMin=this.defaultArg(t,0),this._outputMax=this.defaultArg(e,1),this._scale=this.input=new i.Multiply(1),this._add=this.output=new i.Add(0),this._scale.connect(this._add),this._setRange()},i.extend(i.Scale,i.SignalBase),Object.defineProperty(i.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(i.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),i.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},i.Scale.prototype.dispose=function(){return i.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},i.Scale}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(16),__webpack_require__(30),__webpack_require__(31),__webpack_require__(12)], __WEBPACK_AMD_DEFINE_RESULT__ = (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}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(18),__webpack_require__(9)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(i){"use strict";return window.GainNode&&!AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),i.Gain=function(){var t=this.optionsObject(arguments,["gain","units"],i.Gain.defaults);this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new i.Param({param:this._gainNode.gain,units:t.units,value:t.gain,convert:t.convert}),this._readOnly("gain")},i.extend(i.Gain),i.Gain.defaults={gain:1,convert:!0},i.Gain.prototype.dispose=function(){i.Param.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},i.prototype.createInsOuts=function(t,n){1===t?this.input=new i.Gain:1this._nextTick&&this._state;){var e=this._state.getValueAtTime(this._nextTick);if(e!==this._lastState){this._lastState=e;var i=this._state.get(this._nextTick);e===o.State.Started?(this._nextTick=i.time,this.isUndef(i.offset)||(this.ticks=i.offset),this.emit("start",i.time,this.ticks)):e===o.State.Stopped?(this.ticks=0,this.emit("stop",i.time)):e===o.State.Paused&&this.emit("pause",i.time)}var s=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),e===o.State.Started&&(this.callback(s),this.ticks++))}},o.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},o.Clock.prototype.dispose=function(){o.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},o.Clock}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(14)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(o){function t(e,t,n){if(e.input)Array.isArray(e.input)?(o.prototype.isUndef(n)&&(n=0),this.connect(e.input[n])):this.connect(e.input,t,n);else try{e instanceof AudioNode?i.call(this,e,t,n):i.call(this,e,t)}catch(t){throw new Error("error connecting to node: "+e+"\n"+t)}}var i,r;return!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),o.Context=function(t){for(var e in o.Emitter.call(this),t=t||new window.AudioContext,this._context=t,this._context)this._defineProperty(this._context,e);this._latencyHint="interactive",this._lookAhead=.1,this._updateInterval=this._lookAhead/3,this._computedUpdateInterval=0,this._worker=this._createWorker(),this._constants={}},o.extend(o.Context,o.Emitter),o.Emitter.mixin(o.Context),o.Context.prototype._defineProperty=function(e,n){this.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},o.Context.prototype.now=function(){return this._context.currentTime},o.Context.prototype._createWorker=function(){window.URL=window.URL||window.webkitURL;var t=new Blob(["var timeoutTime = "+(1e3*this._updateInterval).toFixed(1)+";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();"]),e=URL.createObjectURL(t),n=new Worker(e);return n.addEventListener("message",function(){this.emit("tick")}.bind(this)),n.addEventListener("message",function(){var t=this.now();if(this.isNumber(this._lastUpdate)){var e=t-this._lastUpdate;this._computedUpdateInterval=Math.max(e,.97*this._computedUpdateInterval)}this._lastUpdate=t}.bind(this)),n},o.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),o=0;othis.memory){var t=this.length-this.memory;this._timeline.splice(0,t)}return this},i.Timeline.prototype.remove=function(e){if(this._iterating)this._toRemove.push(e);else{var i=this._timeline.indexOf(e);-1!==i&&this._timeline.splice(i,1)}return this},i.Timeline.prototype.get=function(e){var i=this._search(e);return-1!==i?this._timeline[i]:null},i.Timeline.prototype.peek=function(){return this._timeline[0]},i.Timeline.prototype.shift=function(){return this._timeline.shift()},i.Timeline.prototype.getAfter=function(e){var i=this._search(e);return i+1=e&&(this._timeline=[]);return this},i.Timeline.prototype.cancelBefore=function(e){if(this._timeline.length){var i=this._search(e);0<=i&&(this._timeline=this._timeline.slice(i+1))}return this},i.Timeline.prototype._search=function(e){var i=0,t=this._timeline.length,n=t;if(0e)return r;s.time>e?n=r:s.time=e;)t--;return this._iterate(i,t+1),this},i.Timeline.prototype.forEachAtTime=function(i,t){var e=this._search(i);return-1!==e&&this._iterate(function(e){e.time===i&&t(e)},0,e),this},i.Timeline.prototype.dispose=function(){i.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},i.Timeline}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(1),__webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(t){"use strict";return t.Negate=function(){this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(2),__webpack_require__(1),__webpack_require__(6)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(e){"use strict";return e.GreaterThanZero=function(){this._thresh=this.output=new e.WaveShaper(function(e){return e<=0?0:1},127),this._scale=this.input=new e.Multiply(1e4),this._scale.connect(this._thresh)},e.extend(e.GreaterThanZero,e.SignalBase),e.GreaterThanZero.prototype.dispose=function(){return e.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},e.GreaterThanZero}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(e,t){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (t), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):undefined}(this,function(){var r=function(e,t){this._dragged=!1,this._element=e,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this,t),e.addEventListener("touchstart",this._bindedEnd),e.addEventListener("touchmove",this._bindedMove),e.addEventListener("touchend",this._bindedEnd),e.addEventListener("mouseup",this._bindedEnd)};function o(e){return"running"===e.state}return r.prototype._moved=function(e){this._dragged=!0},r.prototype._ended=function(e){this._dragged||function(e){var t=e.createBuffer(1,1,e.sampleRate),n=e.createBufferSource();n.buffer=t,n.connect(e.destination),n.start(0),e.resume&&e.resume()}(e),this._dragged=!1},r.prototype.dispose=function(){this._element.removeEventListener("touchstart",this._bindedEnd),this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},function(t,e,n){var i=new Promise(function(e){!function(t,n){o(t)?n():function e(){o(t)?n():(requestAnimationFrame(e),t.resume&&t.resume())}()}(t,e)}),d=[];return function e(t,n,i){if(Array.isArray(t)||NodeList&&t instanceof NodeList)for(var d=0;d= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: \"pull\",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: \"framesAvailable\",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}[\"default\"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === 'start') {\n _this.record(data.duration);\n } else if (data.name === 'stop') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: \"process\",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: \"record\",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: 'buffers',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: \"getBuffers\",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: \"mergeBuffers\",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);"); + + }), + (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + __webpack_exports__["default"] = ("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they're available as values at compile time\nvar processorNames = {\n \"recorderProcessor\": \"recorder-processor\",\n \"soundFileProcessor\": \"sound-file-processor\",\n \"amplitudeProcessor\": \"amplitude-processor\"\n};\nvar RingBuffer = {\n \"default\":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: \"push\",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: \"pull\",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: \"framesAvailable\",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}[\"default\"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: \"process\",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: 'position',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);"); + + }), + (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); + __webpack_exports__["default"] = ("function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they're available as values at compile time\nvar processorNames = {\n \"recorderProcessor\": \"recorder-processor\",\n \"soundFileProcessor\": \"sound-file-processor\",\n \"amplitudeProcessor\": \"amplitude-processor\"\n};\nvar RingBuffer = {\n \"default\":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: \"push\",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: \"pull\",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: \"framesAvailable\",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}[\"default\"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === 'toggleNormalize') {\n _this.normalize = data.normalize;\n } else if (data.name === 'smoothing') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: \"process\",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: 'amplitude',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);"); + + }), + (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(17)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(o){o.Frequency=function(e,t){if(!(this instanceof o.Frequency))return new o.Frequency(e,t);o.TimeBase.call(this,e,t)},o.extend(o.Frequency,o.TimeBase),o.Frequency.prototype._primaryExpressions=Object.create(o.TimeBase.prototype._primaryExpressions),o.Frequency.prototype._primaryExpressions.midi={regexp:/^(\d+(?:\.\d+)?midi)/,method:function(e){return this.midiToFrequency(e)}},o.Frequency.prototype._primaryExpressions.note={regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(e,t){var r=n[e.toLowerCase()]+12*(parseInt(t)+1);return this.midiToFrequency(r)}},o.Frequency.prototype._primaryExpressions.tr={regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(e,t,r){var n=1;return e&&"0"!==e&&(n*=this._beatsToUnits(this._timeSignature()*parseFloat(e))),t&&"0"!==t&&(n*=this._beatsToUnits(parseFloat(t))),r&&"0"!==r&&(n*=this._beatsToUnits(parseFloat(r)/4)),n}},o.Frequency.prototype.transpose=function(e){return this._expr=function(e,t){return e()*this.intervalToFrequencyRatio(t)}.bind(this,this._expr,e),this},o.Frequency.prototype.harmonize=function(e){return this._expr=function(e,t){for(var r=e(),n=[],o=0;oScale the output of all sound in this sketch

                          + * Scaled between 0.0 (silence) and 1.0 (full volume). + * 1.0 is the maximum amplitude of a digital sound, so multiplying + * by greater than 1.0 may cause digital distortion. To + * fade, provide a rampTime parameter. For more + * complex fades, see the Envelope class. + * + * Alternately, you can pass in a signal source such as an + * oscillator to modulate the amplitude with an audio signal. + * + *

                          How This Works: When you load the p5.sound module, it + * creates a single instance of p5sound. All sound objects in this + * module output to p5sound before reaching your computer's output. + * So if you change the amplitude of p5sound, it impacts all of the + * sound in this module.

                          + * + *

                          If no value is provided, returns a Web Audio API Gain Node

                          + * + * @method outputVolume + * @param {Number|Object} volume Volume (amplitude) between 0.0 + * and 1.0 or modulating signal/oscillator + * @param {Number} [rampTime] Fade for t seconds + * @param {Number} [timeFromNow] Schedule this event to happen at + * t seconds in the future + */ + + +p5.prototype.outputVolume = function (vol) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (typeof vol === 'number') { + var now = p5sound.audiocontext.currentTime; + var currentVol = p5sound.output.gain.value; + p5sound.output.gain.cancelScheduledValues(now + tFromNow); + p5sound.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); + p5sound.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); + } else if (vol) { + vol.connect(p5sound.output.gain); + } else { + return p5sound.output.gain; + } +}; +/** + * `p5.soundOut` is the p5.sound final output bus. It sends output to + * the destination of this window's web audio context. It contains + * Web Audio API nodes including a dyanmicsCompressor (.limiter), + * and Gain Nodes for .input and .output. + * + * @property {Object} soundOut + */ + + +p5.prototype.soundOut = p5.soundOut = p5sound; + +p5.soundOut._silentNode = p5sound.audiocontext.createGain(); +p5.soundOut._silentNode.gain.value = 0; + +p5.soundOut._silentNode.connect(p5sound.audiocontext.destination); + + var main = (p5sound); +var processorNames = __webpack_require__(5); +var processorNames_default = __webpack_require__.n(processorNames); + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + +/** + * @for p5 + */ + +/** + * Returns a number representing the sample rate, in samples per second, + * of all sound objects in this audio context. It is determined by the + * sampling rate of your operating system's sound card, and it is not + * currently possile to change. + * It is often 44100, or twice the range of human hearing. + * + * @method sampleRate + * @return {Number} samplerate samples per second + */ + +function sampleRate() { + return main.audiocontext.sampleRate; +} +/** + * Returns the closest MIDI note value for + * a given frequency. + * + * @method freqToMidi + * @param {Number} frequency A freqeuncy, for example, the "A" + * above Middle C is 440Hz + * @return {Number} MIDI note value + */ + + +function freqToMidi(f) { + var mathlog2 = Math.log(f / 440) / Math.log(2); + var m = Math.round(12 * mathlog2) + 69; + return m; +} +/** + * Returns the frequency value of a MIDI note value. + * General MIDI treats notes as integers where middle C + * is 60, C# is 61, D is 62 etc. Useful for generating + * musical frequencies with oscillators. + * + * @method midiToFreq + * @param {Number} midiNote The number of a MIDI note + * @return {Number} Frequency value of the given MIDI note + * @example + *
                          + * let midiNotes = [60, 64, 67, 72]; + * let noteIndex = 0; + * let midiVal, freq; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(startSound); + * osc = new p5.TriOsc(); + * env = new p5.Envelope(); + * } + * + * function draw() { + * background(220); + * text('tap to play', 10, 20); + * if (midiVal) { + * text('MIDI: ' + midiVal, 10, 40); + * text('Freq: ' + freq, 10, 60); + * } + * } + * + * function startSound() { + * // see also: userStartAudio(); + * osc.start(); + * + * midiVal = midiNotes[noteIndex % midiNotes.length]; + * freq = midiToFreq(midiVal); + * osc.freq(freq); + * env.ramp(osc, 0, 1.0, 0); + * + * noteIndex++; + * } + *
                          + */ + + +function midiToFreq(m) { + return 440 * Math.pow(2, (m - 69) / 12.0); +} + + +function noteToFreq(note) { + if (typeof note !== 'string') { + return note; + } + + var wholeNotes = { + A: 21, + B: 23, + C: 24, + D: 26, + E: 28, + F: 29, + G: 31 + }; + var value = wholeNotes[note[0].toUpperCase()]; + var octave = ~~note.slice(-1); + value += 12 * (octave - 1); + + switch (note[1]) { + case '#': + value += 1; + break; + + case 'b': + value -= 1; + break; + + default: + break; + } + + return midiToFreq(value); +} +/** + * List the SoundFile formats that you will include. LoadSound + * will search your directory for these extensions, and will pick + * a format that is compatable with the client's web browser. + * Here is a free online file + * converter. + * + * @method soundFormats + * @param {String} [...formats] i.e. 'mp3', 'wav', 'ogg' + * @example + *
                          + * function preload() { + * // set the global sound formats + * soundFormats('mp3', 'ogg'); + * + * // load either beatbox.mp3, or .ogg, depending on browser + * mySound = loadSound('assets/beatbox.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * text('sound loaded! tap to play', 10, 20, width - 20); + * cnv.mousePressed(function() { + * mySound.play(); + * }); + * } + *
                          + */ + + +function soundFormats() { + main.extensions = []; + + for (var i = 0; i < arguments.length; i++) { + arguments[i] = arguments[i].toLowerCase(); + + if (['mp3', 'wav', 'ogg', 'm4a', 'aac'].indexOf(arguments[i]) > -1) { + main.extensions.push(arguments[i]); + } else { + throw arguments[i] + ' is not a valid sound format!'; + } + } +} + +function disposeSound() { + for (var i = 0; i < main.soundArray.length; i++) { + main.soundArray[i].dispose(); + } +} + +function _checkFileFormats(paths) { + var path; + + if (typeof paths === 'string') { + path = paths; + + var extTest = path.split('.').pop(); + + if (['mp3', 'wav', 'ogg', 'm4a', 'aac'].indexOf(extTest) > -1) { + if (!p5.prototype.isFileSupported(extTest)) { + var pathSplit = path.split('.'); + var pathCore = pathSplit[pathSplit.length - 1]; + + for (var _i = 0; _i < main.extensions.length; _i++) { + var _extension = main.extensions[_i]; + + var _supported = p5.prototype.isFileSupported(_extension); + + if (_supported) { + pathCore = ''; + + if (pathSplit.length === 2) { + pathCore += pathSplit[0]; + } + + for (var _i2 = 1; _i2 <= pathSplit.length - 2; _i2++) { + var p = pathSplit[_i2]; + pathCore += '.' + p; + } + + path = pathCore += '.'; + path = path += _extension; + break; + } + } + } + } + else { + for (var _i3 = 0; _i3 < main.extensions.length; _i3++) { + var _extension2 = main.extensions[_i3]; + + var _supported2 = p5.prototype.isFileSupported(_extension2); + + if (_supported2) { + path = path + '.' + _extension2; + break; + } + } + } + } + else if (_typeof(paths) === 'object') { + for (var i = 0; i < paths.length; i++) { + var extension = paths[i].split('.').pop(); + var supported = p5.prototype.isFileSupported(extension); + + if (supported) { + path = paths[i]; + break; + } + } + } + + return path; +} +/** + * Used by Osc and Envelope to chain signal math + */ + + +function _mathChain(o, math, thisChain, nextChain, type) { + for (var i in o.mathOps) { + if (o.mathOps[i] instanceof type) { + o.mathOps[i].dispose(); + thisChain = i; + + if (thisChain < o.mathOps.length - 1) { + nextChain = o.mathOps[i + 1]; + } + } + } + + o.mathOps[thisChain - 1].disconnect(); + o.mathOps[thisChain - 1].connect(math); + math.connect(nextChain); + o.mathOps[thisChain] = math; + return o; +} + + +function convertToWav(audioBuffer) { + var leftChannel, rightChannel; + leftChannel = audioBuffer.getChannelData(0); + + if (audioBuffer.numberOfChannels > 1) { + rightChannel = audioBuffer.getChannelData(1); + } else { + rightChannel = leftChannel; + } + + var interleaved = interleave(leftChannel, rightChannel); + + var buffer = new window.ArrayBuffer(44 + interleaved.length * 2); + var view = new window.DataView(buffer); + + writeUTFBytes(view, 0, 'RIFF'); + view.setUint32(4, 36 + interleaved.length * 2, true); + writeUTFBytes(view, 8, 'WAVE'); + + writeUTFBytes(view, 12, 'fmt '); + view.setUint32(16, 16, true); + view.setUint16(20, 1, true); + + view.setUint16(22, 2, true); + view.setUint32(24, main.audiocontext.sampleRate, true); + view.setUint32(28, main.audiocontext.sampleRate * 4, true); + view.setUint16(32, 4, true); + view.setUint16(34, 16, true); + + writeUTFBytes(view, 36, 'data'); + view.setUint32(40, interleaved.length * 2, true); + + var lng = interleaved.length; + var index = 44; + var volume = 1; + + for (var i = 0; i < lng; i++) { + view.setInt16(index, interleaved[i] * (0x7fff * volume), true); + index += 2; + } + + return view; +} + + +function interleave(leftChannel, rightChannel) { + var length = leftChannel.length + rightChannel.length; + var result = new Float32Array(length); + var inputIndex = 0; + + for (var index = 0; index < length;) { + result[index++] = leftChannel[inputIndex]; + result[index++] = rightChannel[inputIndex]; + inputIndex++; + } + + return result; +} + +function writeUTFBytes(view, offset, string) { + var lng = string.length; + + for (var i = 0; i < lng; i++) { + view.setUint8(offset + i, string.charCodeAt(i)); + } +} + +function safeBufferSize(idealBufferSize) { + var bufferSize = idealBufferSize; + + var tempAudioWorkletNode = new AudioWorkletNode(main.audiocontext, processorNames_default.a.soundFileProcessor); + + if (tempAudioWorkletNode instanceof ScriptProcessorNode) { + bufferSize = tempAudioWorkletNode.bufferSize; + } + + tempAudioWorkletNode.disconnect(); + tempAudioWorkletNode = null; + return bufferSize; +} +/** + * Save a p5.SoundFile as a .wav file. The browser will prompt the user + * to download the file to their device. + * For uploading audio to a server, use + * `p5.SoundFile.saveBlob`. + * + * @for p5 + * @method saveSound + * @param {p5.SoundFile} soundFile p5.SoundFile that you wish to save + * @param {String} fileName name of the resulting .wav file. + */ + + +function saveSound(soundFile, fileName) { + var dataView = convertToWav(soundFile.buffer); + p5.prototype.writeFile([dataView], fileName, 'wav'); +} + + +var CustomError = function CustomError(name, errorTrace, failedPath) { + var err = new Error(); + var tempStack, splitStack; + err.name = name; + err.originalStack = err.stack + errorTrace; + tempStack = err.stack + errorTrace; + err.failedPath = failedPath; + + splitStack = tempStack.split('\n').filter(function (ln) { + return !ln.match(/(p5.|native code|globalInit)/g); + }); + err.stack = splitStack.join('\n'); + return err; +}; + + var errorHandler = (CustomError); + +var moduleSources = [__webpack_require__(27)["default"], __webpack_require__(28)["default"], __webpack_require__(29)["default"]]; +var audioWorklet_ac = main.audiocontext; +var initializedAudioWorklets = false; + +function loadAudioWorkletModules() { + return Promise.all(moduleSources.map(function (moduleSrc) { + var blob = new Blob([moduleSrc], { + type: 'application/javascript' + }); + var objectURL = URL.createObjectURL(blob); + return audioWorklet_ac.audioWorklet.addModule(objectURL); + })); +} + +p5.prototype.registerMethod('init', function () { + if (initializedAudioWorklets) return; + + if (!this.preload && !window.preload) { + this.preload = function () {}; + } + + + this._incrementPreload(); + + var onWorkletModulesLoad = function () { + initializedAudioWorklets = true; + + this._decrementPreload(); + }.bind(this); + + loadAudioWorkletModules().then(onWorkletModulesLoad); +}); +function panner_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + + +var panner_ac = main.audiocontext; +var panner; + +if (typeof panner_ac.createStereoPanner !== 'undefined') { + var Panner = + function () { + function Panner(input, output) { + panner_classCallCheck(this, Panner); + + this.stereoPanner = this.input = panner_ac.createStereoPanner(); + input.connect(this.stereoPanner); + this.stereoPanner.connect(output); + } + + _createClass(Panner, [{ + key: "pan", + value: function pan(val, tFromNow) { + var time = tFromNow || 0; + var t = panner_ac.currentTime + time; + this.stereoPanner.pan.linearRampToValueAtTime(val, t); + } + + }, { + key: "inputChannels", + value: function inputChannels() {} + }, { + key: "connect", + value: function connect(obj) { + this.stereoPanner.connect(obj); + } + }, { + key: "disconnect", + value: function disconnect() { + if (this.stereoPanner) { + this.stereoPanner.disconnect(); + } + } + }]); + + return Panner; + }(); + + panner = Panner; +} else { + var _Panner = + function () { + function _Panner(input, output, numInputChannels) { + panner_classCallCheck(this, _Panner); + + this.input = panner_ac.createGain(); + input.connect(this.input); + this.left = panner_ac.createGain(); + this.right = panner_ac.createGain(); + this.left.channelInterpretation = 'discrete'; + this.right.channelInterpretation = 'discrete'; + + if (numInputChannels > 1) { + this.splitter = panner_ac.createChannelSplitter(2); + this.input.connect(this.splitter); + this.splitter.connect(this.left, 1); + this.splitter.connect(this.right, 0); + } else { + this.input.connect(this.left); + this.input.connect(this.right); + } + + this.output = panner_ac.createChannelMerger(2); + this.left.connect(this.output, 0, 1); + this.right.connect(this.output, 0, 0); + this.output.connect(output); + } + + + _createClass(_Panner, [{ + key: "pan", + value: function pan(val, tFromNow) { + var time = tFromNow || 0; + var t = panner_ac.currentTime + time; + var v = (val + 1) / 2; + var rightVal = Math.cos(v * Math.PI / 2); + var leftVal = Math.sin(v * Math.PI / 2); + this.left.gain.linearRampToValueAtTime(leftVal, t); + this.right.gain.linearRampToValueAtTime(rightVal, t); + } + }, { + key: "inputChannels", + value: function inputChannels(numChannels) { + if (numChannels === 1) { + this.input.disconnect(); + this.input.connect(this.left); + this.input.connect(this.right); + } else if (numChannels === 2) { + if (typeof this.splitter === 'undefined') { + this.splitter = panner_ac.createChannelSplitter(2); + } + + this.input.disconnect(); + this.input.connect(this.splitter); + this.splitter.connect(this.left, 1); + this.splitter.connect(this.right, 0); + } + } + }, { + key: "connect", + value: function connect(obj) { + this.output.connect(obj); + } + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + } + }]); + + return _Panner; + }(); + + panner = _Panner; +} + + var panner_0 = (panner); +function soundfile_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { soundfile_typeof = function _typeof(obj) { return typeof obj; }; } else { soundfile_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return soundfile_typeof(obj); } + +function soundfile_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function soundfile_createClass(Constructor, protoProps, staticProps) { if (protoProps) soundfile_defineProperties(Constructor.prototype, protoProps); if (staticProps) soundfile_defineProperties(Constructor, staticProps); return Constructor; } + +function soundfile_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + + + + +var soundfile_ac = main.audiocontext; + +var _createCounterBuffer = function _createCounterBuffer(buffer) { + var len = buffer.length; + var audioBuf = soundfile_ac.createBuffer(1, buffer.length, soundfile_ac.sampleRate); + var arrayBuffer = audioBuf.getChannelData(0); + + for (var index = 0; index < len; index++) { + arrayBuffer[index] = index; + } + + return audioBuf; +}; + + +var Cue = function Cue(callback, time, id, val) { + soundfile_classCallCheck(this, Cue); + + this.callback = callback; + this.time = time; + this.id = id; + this.val = val; +}; + + +function _clearOnEnd(e) { + var thisBufferSourceNode = e.target; + var soundFile = this; + + thisBufferSourceNode._playing = false; + thisBufferSourceNode.removeEventListener('ended', soundFile._clearOnEnd); + + soundFile._onended(soundFile); + + + soundFile.bufferSourceNodes.map(function (_, i) { + return i; + }).reverse().forEach(function (i) { + var n = soundFile.bufferSourceNodes[i]; + + if (n._playing === false) { + soundFile.bufferSourceNodes.splice(i, 1); + } + }); + + if (soundFile.bufferSourceNodes.length === 0) { + soundFile._playing = false; + } +} +/** + *

                          SoundFile object with a path to a file.

                          + * + *

                          The p5.SoundFile may not be available immediately because + * it loads the file information asynchronously.

                          + * + *

                          To do something with the sound as soon as it loads + * pass the name of a function as the second parameter.

                          + * + *

                          Only one file path is required. However, audio file formats + * (i.e. mp3, ogg, wav and m4a/aac) are not supported by all + * web browsers. If you want to ensure compatability, instead of a single + * file path, you may include an Array of filepaths, and the browser will + * choose a format that works.

                          + * + * @class p5.SoundFile + * @constructor + * @param {String|Array} path path to a sound file (String). Optionally, + * you may include multiple file formats in + * an array. Alternately, accepts an object + * from the HTML5 File API, or a p5.File. + * @param {Function} [successCallback] Name of a function to call once file loads + * @param {Function} [errorCallback] Name of a function to call if file fails to + * load. This function will receive an error or + * XMLHttpRequest object with information + * about what went wrong. + * @param {Function} [whileLoadingCallback] Name of a function to call while file + * is loading. That function will + * receive progress of the request to + * load the sound file + * (between 0 and 1) as its first + * parameter. This progress + * does not account for the additional + * time needed to decode the audio data. + * + * @example + *
                          + * let mySound; + * function preload() { + * soundFormats('mp3', 'ogg'); + * mySound = loadSound('assets/doorbell'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap here to play', 10, 20); + * } + * + * function canvasPressed() { + * // playing a sound file on a user gesture + * // is equivalent to `userStartAudio()` + * mySound.play(); + * } + *
                          + */ + + +var soundfile_SoundFile = +function () { + function SoundFile(paths, onload, onerror, whileLoading) { + soundfile_classCallCheck(this, SoundFile); + + if (typeof paths !== 'undefined') { + if (typeof paths === 'string' || typeof paths[0] === 'string') { + var path = p5.prototype._checkFileFormats(paths); + + this.url = path; + } else if (soundfile_typeof(paths) === 'object') { + if (!(window.File && window.FileReader && window.FileList && window.Blob)) { + throw 'Unable to load file because the File API is not supported'; + } + } + + + if (paths.file) { + paths = paths.file; + } + + this.file = paths; + } + + + this._onended = function () {}; + + this._looping = false; + this._playing = false; + this._paused = false; + this._pauseTime = 0; + + this._cues = []; + this._cueIDCounter = 0; + + this._lastPos = 0; + this._counterNode = null; + this._workletNode = null; + + this.bufferSourceNodes = []; + + this.bufferSourceNode = null; + this.buffer = null; + this.playbackRate = 1; + this.input = main.audiocontext.createGain(); + this.output = main.audiocontext.createGain(); + this.reversed = false; + + this.startTime = 0; + this.endTime = null; + this.pauseTime = 0; + + this.mode = 'sustain'; + + this.startMillis = null; + + this.panPosition = 0.0; + this.panner = new panner_0(this.output, main.input, 2); + + if (this.url || this.file) { + this.load(onload, onerror); + } + + + main.soundArray.push(this); + + if (typeof whileLoading === 'function') { + this._whileLoading = whileLoading; + } else { + this._whileLoading = function () {}; + } + + this._clearOnEnd = _clearOnEnd.bind(this); + + this.amp = this.setVolume; + + this.fade = this.setVolume; + } + /** + * This is a helper function that the p5.SoundFile calls to load + * itself. Accepts a callback (the name of another function) + * as an optional parameter. + * + * @private + * @for p5.SoundFile + * @param {Function} [successCallback] Name of a function to call once file loads + * @param {Function} [errorCallback] Name of a function to call if there is an error + */ + + + soundfile_createClass(SoundFile, [{ + key: "load", + value: function load(callback, errorCallback) { + var self = this; + var errorTrace = new Error().stack; + + if (this.url !== undefined && this.url !== '') { + var request = new XMLHttpRequest(); + request.addEventListener('progress', function (evt) { + self._updateProgress(evt); + }, false); + request.open('GET', this.url, true); + request.responseType = 'arraybuffer'; + + request.onload = function () { + if (request.status === 200) { + if (!self.panner) return; + soundfile_ac.decodeAudioData(request.response, + function (buff) { + if (!self.panner) return; + self.buffer = buff; + self.panner.inputChannels(buff.numberOfChannels); + + if (callback) { + callback(self); + } + }, + function () { + if (!self.panner) return; + var err = new errorHandler('decodeAudioData', errorTrace, self.url); + var msg = 'AudioContext error at decodeAudioData for ' + self.url; + + if (errorCallback) { + err.msg = msg; + errorCallback(err); + } else { + console.error(msg + '\n The error stack trace includes: \n' + err.stack); + } + }); + } + else { + if (!self.panner) return; + var err = new errorHandler('loadSound', errorTrace, self.url); + var msg = 'Unable to load ' + self.url + '. The request status was: ' + request.status + ' (' + request.statusText + ')'; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error(msg + '\n The error stack trace includes: \n' + err.stack); + } + } + }; + + + request.onerror = function () { + var err = new errorHandler('loadSound', errorTrace, self.url); + var msg = 'There was no response from the server at ' + self.url + '. Check the url and internet connectivity.'; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error(msg + '\n The error stack trace includes: \n' + err.stack); + } + }; + + request.send(); + } else if (this.file !== undefined) { + var reader = new FileReader(); + + reader.onload = function () { + if (!self.panner) return; + soundfile_ac.decodeAudioData(reader.result, function (buff) { + if (!self.panner) return; + self.buffer = buff; + self.panner.inputChannels(buff.numberOfChannels); + + if (callback) { + callback(self); + } + }); + }; + + reader.onerror = function (e) { + if (!self.panner) return; + + if (onerror) { + onerror(e); + } + }; + + reader.readAsArrayBuffer(this.file); + } + } + + }, { + key: "_updateProgress", + value: function _updateProgress(evt) { + if (evt.lengthComputable) { + var percentComplete = evt.loaded / evt.total * 0.99; + + this._whileLoading(percentComplete, evt); + + } else { + this._whileLoading('size unknown'); + } + } + /** + * Returns true if the sound file finished loading successfully. + * + * @method isLoaded + * @for p5.SoundFile + * @return {Boolean} + */ + + }, { + key: "isLoaded", + value: function isLoaded() { + if (this.buffer) { + return true; + } else { + return false; + } + } + /** + * Play the p5.SoundFile + * + * @method play + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule playback to start (in seconds from now). + * @param {Number} [rate] (optional) playback rate + * @param {Number} [amp] (optional) amplitude (volume) + * of playback + * @param {Number} [cueStart] (optional) cue start time in seconds + * @param {Number} [duration] (optional) duration of playback in seconds + */ + + }, { + key: "play", + value: function play(startTime, rate, amp, _cueStart, duration) { + if (!this.output) { + console.warn('SoundFile.play() called after dispose'); + return; + } + + var now = main.audiocontext.currentTime; + var cueStart, cueEnd; + var time = startTime || 0; + + if (time < 0) { + time = 0; + } + + time = time + now; + + if (typeof rate !== 'undefined') { + this.rate(rate); + } + + if (typeof amp !== 'undefined') { + this.setVolume(amp); + } + + + if (this.buffer) { + this._pauseTime = 0; + + if (this.mode === 'restart' && this.buffer && this.bufferSourceNode) { + this.bufferSourceNode.stop(time); + + this._counterNode.stop(time); + } + + + if (this.mode === 'untildone' && this.isPlaying()) { + return; + } + + + this.bufferSourceNode = this._initSourceNode(); + + delete this._counterNode; + this._counterNode = this._initCounterNode(); + + if (_cueStart) { + if (_cueStart >= 0 && _cueStart < this.buffer.duration) { + cueStart = _cueStart; + } else { + throw 'start time out of range'; + } + } else { + cueStart = 0; + } + + if (duration) { + duration = duration <= this.buffer.duration - cueStart ? duration : this.buffer.duration; + } + + + if (this._paused) { + this.bufferSourceNode.start(time, this.pauseTime, duration); + + this._counterNode.start(time, this.pauseTime, duration); + } else { + this.bufferSourceNode.start(time, cueStart, duration); + + this._counterNode.start(time, cueStart, duration); + } + + this._playing = true; + this._paused = false; + + this.bufferSourceNodes.push(this.bufferSourceNode); + this.bufferSourceNode._arrayIndex = this.bufferSourceNodes.length - 1; + this.bufferSourceNode.addEventListener('ended', this._clearOnEnd); + } + else { + throw 'not ready to play file, buffer has yet to load. Try preload()'; + } + + + this.bufferSourceNode.loop = this._looping; + this._counterNode.loop = this._looping; + + if (this._looping === true) { + cueEnd = duration ? duration : cueStart - 0.000000000000001; + this.bufferSourceNode.loopStart = cueStart; + this.bufferSourceNode.loopEnd = cueEnd; + this._counterNode.loopStart = cueStart; + this._counterNode.loopEnd = cueEnd; + } + } + /** + * p5.SoundFile has two play modes: restart and + * sustain. Play Mode determines what happens to a + * p5.SoundFile if it is triggered while in the middle of playback. + * In sustain mode, playback will continue simultaneous to the + * new playback. In restart mode, play() will stop playback + * and start over. With untilDone, a sound will play only if it's + * not already playing. Sustain is the default mode. + * + * @method playMode + * @for p5.SoundFile + * @param {String} str 'restart' or 'sustain' or 'untilDone' + * @example + *
                          + * let mySound; + * function preload(){ + * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * noFill(); + * rect(0, height/2, width - 1, height/2 - 1); + * rect(0, 0, width - 1, height/2); + * textAlign(CENTER, CENTER); + * fill(20); + * text('restart', width/2, 1 * height/4); + * text('sustain', width/2, 3 * height/4); + * } + * function canvasPressed() { + * if (mouseX < height/2) { + * mySound.playMode('restart'); + * } else { + * mySound.playMode('sustain'); + * } + * mySound.play(); + * } + * + *
                          + */ + + }, { + key: "playMode", + value: function playMode(str) { + var s = str.toLowerCase(); + + if (s === 'restart' && this.buffer && this.bufferSourceNode) { + for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { + var now = main.audiocontext.currentTime; + this.bufferSourceNodes[i].stop(now); + } + } + + + if (s === 'restart' || s === 'sustain' || s === 'untildone') { + this.mode = s; + } else { + throw 'Invalid play mode. Must be either "restart" or "sustain"'; + } + } + /** + * Pauses a file that is currently playing. If the file is not + * playing, then nothing will happen. + * + * After pausing, .play() will resume from the paused + * position. + * If p5.SoundFile had been set to loop before it was paused, + * it will continue to loop after it is unpaused with .play(). + * + * @method pause + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule event to occur + * seconds from now + * @example + *
                          + * let soundFile; + * function preload() { + * soundFormats('ogg', 'mp3'); + * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play, release to pause', 10, 20, width - 20); + * } + * function canvasPressed() { + * soundFile.loop(); + * background(0, 200, 50); + * } + * function mouseReleased() { + * soundFile.pause(); + * background(220); + * } + * + *
                          + */ + + }, { + key: "pause", + value: function pause(startTime) { + var now = main.audiocontext.currentTime; + var time = startTime || 0; + var pTime = time + now; + + if (this.isPlaying() && this.buffer && this.bufferSourceNode) { + this._paused = true; + this._playing = false; + this.pauseTime = this.currentTime(); + this.bufferSourceNode.stop(pTime); + + this._counterNode.stop(pTime); + + this._pauseTime = this.currentTime(); + } else { + this._pauseTime = 0; + } + } + /** + * Loop the p5.SoundFile. Accepts optional parameters to set the + * playback rate, playback volume, loopStart, loopEnd. + * + * @method loop + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule event to occur + * seconds from now + * @param {Number} [rate] (optional) playback rate + * @param {Number} [amp] (optional) playback volume + * @param {Number} [cueLoopStart] (optional) startTime in seconds + * @param {Number} [duration] (optional) loop duration in seconds + * @example + *
                          + * let soundFile; + * let loopStart = 0.5; + * let loopDuration = 0.2; + * function preload() { + * soundFormats('ogg', 'mp3'); + * soundFile = loadSound('assets/Damscray_-_Dancing_Tiger_02.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play, release to pause', 10, 20, width - 20); + * } + * function canvasPressed() { + * soundFile.loop(); + * background(0, 200, 50); + * } + * function mouseReleased() { + * soundFile.pause(); + * background(220); + * } + * + *
                          + */ + + }, { + key: "loop", + value: function loop(startTime, rate, amp, loopStart, duration) { + this._looping = true; + this.play(startTime, rate, amp, loopStart, duration); + } + /** + * Set a p5.SoundFile's looping flag to true or false. If the sound + * is currently playing, this change will take effect when it + * reaches the end of the current playback. + * + * @method setLoop + * @for p5.SoundFile + * @param {Boolean} Boolean set looping to true or false + */ + + }, { + key: "setLoop", + value: function setLoop(bool) { + if (bool === true) { + this._looping = true; + } else if (bool === false) { + this._looping = false; + } else { + throw 'Error: setLoop accepts either true or false'; + } + + if (this.bufferSourceNode) { + this.bufferSourceNode.loop = this._looping; + this._counterNode.loop = this._looping; + } + } + /** + * Returns 'true' if a p5.SoundFile is currently looping and playing, 'false' if not. + * + * @method isLooping + * @for p5.SoundFile + * @return {Boolean} + */ + + }, { + key: "isLooping", + value: function isLooping() { + if (!this.bufferSourceNode) { + return false; + } + + if (this._looping === true && this.isPlaying() === true) { + return true; + } + + return false; + } + /** + * Returns true if a p5.SoundFile is playing, false if not (i.e. + * paused or stopped). + * + * @method isPlaying + * @for p5.SoundFile + * @return {Boolean} + */ + + }, { + key: "isPlaying", + value: function isPlaying() { + return this._playing; + } + /** + * Returns true if a p5.SoundFile is paused, false if not (i.e. + * playing or stopped). + * + * @method isPaused + * @for p5.SoundFile + * @return {Boolean} + */ + + }, { + key: "isPaused", + value: function isPaused() { + return this._paused; + } + /** + * Stop soundfile playback. + * + * @method stop + * @for p5.SoundFile + * @param {Number} [startTime] (optional) schedule event to occur + * in seconds from now + */ + + }, { + key: "stop", + value: function stop(timeFromNow) { + var time = timeFromNow || 0; + + if (this.mode === 'sustain' || this.mode === 'untildone') { + this.stopAll(time); + this._playing = false; + this.pauseTime = 0; + this._paused = false; + } else if (this.buffer && this.bufferSourceNode) { + var now = main.audiocontext.currentTime; + var t = time || 0; + this.pauseTime = 0; + this.bufferSourceNode.stop(now + t); + + this._counterNode.stop(now + t); + + this._playing = false; + this._paused = false; + } + } + /** + * Stop playback on all of this soundfile's sources. + * @private + */ + + }, { + key: "stopAll", + value: function stopAll(_time) { + var now = main.audiocontext.currentTime; + var time = _time || 0; + + if (this.buffer && this.bufferSourceNode) { + for (var i in this.bufferSourceNodes) { + var bufferSourceNode = this.bufferSourceNodes[i]; + + if (bufferSourceNode) { + try { + bufferSourceNode.stop(now + time); + } catch (e) { + } + } + } + + this._counterNode.stop(now + time); + } + } + }, { + key: "getVolume", + value: function getVolume() { + return this.output.gain.value; + } + /** + * Set the stereo panning of a p5.sound object to + * a floating point number between -1.0 (left) and 1.0 (right). + * Default is 0.0 (center). + * + * @method pan + * @for p5.SoundFile + * @param {Number} [panValue] Set the stereo panner + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @example + *
                          + * let ballX = 0; + * let soundFile; + * + * function preload() { + * soundFormats('ogg', 'mp3'); + * soundFile = loadSound('assets/beatbox.mp3'); + * } + * + * function draw() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * ballX = constrain(mouseX, 0, width); + * ellipse(ballX, height/2, 20, 20); + * } + * + * function canvasPressed(){ + * // map the ball's x location to a panning degree + * // between -1.0 (left) and 1.0 (right) + * let panning = map(ballX, 0., width,-1.0, 1.0); + * soundFile.pan(panning); + * soundFile.play(); + * } + *
                          + */ + + }, { + key: "pan", + value: function pan(pval, tFromNow) { + this.panPosition = pval; + this.panner.pan(pval, tFromNow); + } + /** + * Returns the current stereo pan position (-1.0 to 1.0) + * + * @method getPan + * @for p5.SoundFile + * @return {Number} Returns the stereo pan setting of the Oscillator + * as a number between -1.0 (left) and 1.0 (right). + * 0.0 is center and default. + */ + + }, { + key: "getPan", + value: function getPan() { + return this.panPosition; + } + /** + * Set the playback rate of a sound file. Will change the speed and the pitch. + * Values less than zero will reverse the audio buffer. + * + * @method rate + * @for p5.SoundFile + * @param {Number} [playbackRate] Set the playback rate. 1.0 is normal, + * .5 is half-speed, 2.0 is twice as fast. + * Values less than zero play backwards. + * @example + *
                          + * let mySound; + * + * function preload() { + * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * } + * function canvasPressed() { + * mySound.loop(); + * } + * function mouseReleased() { + * mySound.pause(); + * } + * function draw() { + * background(220); + * + * // Set the rate to a range between 0.1 and 4 + * // Changing the rate also alters the pitch + * let playbackRate = map(mouseY, 0.1, height, 2, 0); + * playbackRate = constrain(playbackRate, 0.01, 4); + * mySound.rate(playbackRate); + * + * line(0, mouseY, width, mouseY); + * text('rate: ' + round(playbackRate * 100) + '%', 10, 20); + * } + * + * + *
                          + * + */ + + }, { + key: "rate", + value: function rate(playbackRate) { + var reverse = false; + + if (typeof playbackRate === 'undefined') { + return this.playbackRate; + } + + this.playbackRate = playbackRate; + + if (playbackRate === 0) { + playbackRate = 0.0000000000001; + } else if (playbackRate < 0 && !this.reversed) { + playbackRate = Math.abs(playbackRate); + reverse = true; + } else if (playbackRate > 0 && this.reversed) { + reverse = true; + } + + if (this.bufferSourceNode) { + var now = main.audiocontext.currentTime; + this.bufferSourceNode.playbackRate.cancelScheduledValues(now); + this.bufferSourceNode.playbackRate.linearRampToValueAtTime(Math.abs(playbackRate), now); + + this._counterNode.playbackRate.cancelScheduledValues(now); + + this._counterNode.playbackRate.linearRampToValueAtTime(Math.abs(playbackRate), now); + } + + if (reverse) { + this.reverseBuffer(); + } + + return this.playbackRate; + } + + }, { + key: "setPitch", + value: function setPitch(num) { + var newPlaybackRate = midiToFreq(num) / midiToFreq(60); + this.rate(newPlaybackRate); + } + }, { + key: "getPlaybackRate", + value: function getPlaybackRate() { + return this.playbackRate; + } + /** + * Multiply the output volume (amplitude) of a sound file + * between 0.0 (silence) and 1.0 (full volume). + * 1.0 is the maximum amplitude of a digital sound, so multiplying + * by greater than 1.0 may cause digital distortion. To + * fade, provide a rampTime parameter. For more + * complex fades, see the Envelope class. + * + * Alternately, you can pass in a signal source such as an + * oscillator to modulate the amplitude with an audio signal. + * + * @method setVolume + * @for p5.SoundFile + * @param {Number|Object} volume Volume (amplitude) between 0.0 + * and 1.0 or modulating signal/oscillator + * @param {Number} [rampTime] Fade for t seconds + * @param {Number} [timeFromNow] Schedule this event to happen at + * t seconds in the future + */ + + }, { + key: "setVolume", + value: function setVolume(vol, _rampTime, _tFromNow) { + if (typeof vol === 'number') { + var rampTime = _rampTime || 0; + var tFromNow = _tFromNow || 0; + var now = main.audiocontext.currentTime; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(now + tFromNow); + this.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); + this.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); + } else if (vol) { + vol.connect(this.output.gain); + } else { + return this.output.gain; + } + } + /** + * Returns the duration of a sound file in seconds. + * + * @method duration + * @for p5.SoundFile + * @return {Number} The duration of the soundFile in seconds. + */ + + }, { + key: "duration", + value: function duration() { + if (this.buffer) { + return this.buffer.duration; + } else { + return 0; + } + } + /** + * Return the current position of the p5.SoundFile playhead, in seconds. + * Time is relative to the normal buffer direction, so if `reverseBuffer` + * has been called, currentTime will count backwards. + * + * @method currentTime + * @for p5.SoundFile + * @return {Number} currentTime of the soundFile in seconds. + */ + + }, { + key: "currentTime", + value: function currentTime() { + return this.reversed ? Math.abs(this._lastPos - this.buffer.length) / soundfile_ac.sampleRate : this._lastPos / soundfile_ac.sampleRate; + } + /** + * Move the playhead of a soundfile that is currently playing to a + * new position and a new duration, in seconds. + * If none are given, will reset the file to play entire duration + * from start to finish. To set the position of a soundfile that is + * not currently playing, use the `play` or `loop` methods. + * + * @method jump + * @for p5.SoundFile + * @param {Number} cueTime cueTime of the soundFile in seconds. + * @param {Number} duration duration in seconds. + */ + + }, { + key: "jump", + value: function jump(cueTime, duration) { + if (cueTime < 0 || cueTime > this.buffer.duration) { + throw 'jump time out of range'; + } + + if (duration > this.buffer.duration - cueTime) { + throw 'end time out of range'; + } + + var cTime = cueTime || 0; + var dur = duration || undefined; + + if (this.isPlaying()) { + this.stop(0); + this.play(0, this.playbackRate, this.output.gain.value, cTime, dur); + } + } + /** + * Return the number of channels in a sound file. + * For example, Mono = 1, Stereo = 2. + * + * @method channels + * @for p5.SoundFile + * @return {Number} [channels] + */ + + }, { + key: "channels", + value: function channels() { + return this.buffer.numberOfChannels; + } + /** + * Return the sample rate of the sound file. + * + * @method sampleRate + * @for p5.SoundFile + * @return {Number} [sampleRate] + */ + + }, { + key: "sampleRate", + value: function sampleRate() { + return this.buffer.sampleRate; + } + /** + * Return the number of samples in a sound file. + * Equal to sampleRate * duration. + * + * @method frames + * @for p5.SoundFile + * @return {Number} [sampleCount] + */ + + }, { + key: "frames", + value: function frames() { + return this.buffer.length; + } + /** + * Returns an array of amplitude peaks in a p5.SoundFile that can be + * used to draw a static waveform. Scans through the p5.SoundFile's + * audio buffer to find the greatest amplitudes. Accepts one + * parameter, 'length', which determines size of the array. + * Larger arrays result in more precise waveform visualizations. + * + * Inspired by Wavesurfer.js. + * + * @method getPeaks + * @for p5.SoundFile + * @params {Number} [length] length is the size of the returned array. + * Larger length results in more precision. + * Defaults to 5*width of the browser window. + * @returns {Float32Array} Array of peaks. + */ + + }, { + key: "getPeaks", + value: function getPeaks(length) { + if (this.buffer) { + if (!length) { + length = window.width * 5; + } + + if (this.buffer) { + var buffer = this.buffer; + var sampleSize = buffer.length / length; + var sampleStep = ~~(sampleSize / 10) || 1; + var channels = buffer.numberOfChannels; + var peaks = new Float32Array(Math.round(length)); + + for (var c = 0; c < channels; c++) { + var chan = buffer.getChannelData(c); + + for (var i = 0; i < length; i++) { + var start = ~~(i * sampleSize); + var end = ~~(start + sampleSize); + var max = 0; + + for (var j = start; j < end; j += sampleStep) { + var value = chan[j]; + + if (value > max) { + max = value; + } else if (-value > max) { + max = value; + } + } + + if (c === 0 || Math.abs(max) > peaks[i]) { + peaks[i] = max; + } + } + } + + return peaks; + } + } else { + throw 'Cannot load peaks yet, buffer is not loaded'; + } + } + /** + * Reverses the p5.SoundFile's buffer source. + * Playback must be handled separately (see example). + * + * @method reverseBuffer + * @for p5.SoundFile + * @example + *
                          + * let drum; + * function preload() { + * drum = loadSound('assets/drum.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function canvasPressed() { + * drum.stop(); + * drum.reverseBuffer(); + * drum.play(); + * } + * + *
                          + */ + + }, { + key: "reverseBuffer", + value: function reverseBuffer() { + if (this.buffer) { + var currentPos = this._lastPos / soundfile_ac.sampleRate; + var curVol = this.getVolume(); + this.setVolume(0, 0.001); + var numChannels = this.buffer.numberOfChannels; + + for (var i = 0; i < numChannels; i++) { + this.buffer.getChannelData(i).reverse(); + } + + + this.reversed = !this.reversed; + + if (this.isPlaying() && currentPos) { + this.jump(this.duration() - currentPos); + } + + this.setVolume(curVol, 0.001); + } else { + throw 'SoundFile is not done loading'; + } + } + /** + * Schedule an event to be called when the soundfile + * reaches the end of a buffer. If the soundfile is + * playing through once, this will be called when it + * ends. If it is looping, it will be called when + * stop is called. + * + * @method onended + * @for p5.SoundFile + * @param {Function} callback function to call when the + * soundfile has ended. + */ + + }, { + key: "onended", + value: function onended(callback) { + this._onended = callback; + return this; + } + }, { + key: "add", + value: function add() { + } + }, { + key: "dispose", + value: function dispose() { + var now = main.audiocontext.currentTime; + + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.stop(now); + + if (this.buffer && this.bufferSourceNode) { + for (var i = 0; i < this.bufferSourceNodes.length - 1; i++) { + if (this.bufferSourceNodes[i] !== null) { + this.bufferSourceNodes[i].disconnect(); + + try { + this.bufferSourceNodes[i].stop(now); + } catch (e) { + console.warn('no buffer source node to dispose'); + } + + this.bufferSourceNodes[i] = null; + } + } + + if (this.isPlaying()) { + try { + this._counterNode.stop(now); + } catch (e) { + console.log(e); + } + + this._counterNode = null; + } + } + + if (this.output) { + this.output.disconnect(); + this.output = null; + } + + if (this.panner) { + this.panner.disconnect(); + this.panner = null; + } + } + /** + * Connects the output of a p5sound object to input of another + * p5.sound object. For example, you may connect a p5.SoundFile to an + * FFT or an Effect. If no parameter is given, it will connect to + * the main output. Most p5sound objects connect to the master + * output when they are created. + * + * @method connect + * @for p5.SoundFile + * @param {Object} [object] Audio object that accepts an input + */ + + }, { + key: "connect", + value: function connect(unit) { + if (!unit) { + this.panner.connect(main.input); + } else { + if (unit.hasOwnProperty('input')) { + this.panner.connect(unit.input); + } else { + this.panner.connect(unit); + } + } + } + /** + * Disconnects the output of this p5sound object. + * + * @method disconnect + * @for p5.SoundFile + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.panner) { + this.panner.disconnect(); + } + } + /** + */ + + }, { + key: "getLevel", + value: function getLevel() { + console.warn('p5.SoundFile.getLevel has been removed from the library. Use p5.Amplitude instead'); + } + /** + * Reset the source for this SoundFile to a + * new path (URL). + * + * @method setPath + * @for p5.SoundFile + * @param {String} path path to audio file + * @param {Function} callback Callback + */ + + }, { + key: "setPath", + value: function setPath(p, callback) { + var path = p5.prototype._checkFileFormats(p); + + this.url = path; + this.load(callback); + } + /** + * Replace the current Audio Buffer with a new Buffer. + * + * @method setBuffer + * @for p5.SoundFile + * @param {Array} buf Array of Float32 Array(s). 2 Float32 Arrays + * will create a stereo source. 1 will create + * a mono source. + */ + + }, { + key: "setBuffer", + value: function setBuffer(buf) { + var numChannels = buf.length; + var size = buf[0].length; + var newBuffer = soundfile_ac.createBuffer(numChannels, size, soundfile_ac.sampleRate); + + if (!(buf[0] instanceof Float32Array)) { + buf[0] = new Float32Array(buf[0]); + } + + for (var channelNum = 0; channelNum < numChannels; channelNum++) { + var channel = newBuffer.getChannelData(channelNum); + channel.set(buf[channelNum]); + } + + this.buffer = newBuffer; + + this.panner.inputChannels(numChannels); + } + + }, { + key: "_initCounterNode", + value: function _initCounterNode() { + var _this = this; + + var self = this; + var now = soundfile_ac.currentTime; + var cNode = soundfile_ac.createBufferSource(); + var workletBufferSize = safeBufferSize(256); + + if (self._workletNode) { + self._workletNode.disconnect(); + + delete self._workletNode; + } + + self._workletNode = new AudioWorkletNode(soundfile_ac, processorNames_default.a.soundFileProcessor, { + processorOptions: { + bufferSize: workletBufferSize + } + }); + + self._workletNode.port.onmessage = function (event) { + if (event.data.name === 'position') { + if (event.data.position === 0) { + return; + } + + _this._lastPos = event.data.position; + + _this._onTimeUpdate(self._lastPos); + } + }; + + + cNode.buffer = _createCounterBuffer(self.buffer); + cNode.playbackRate.setValueAtTime(self.playbackRate, now); + cNode.connect(self._workletNode); + + self._workletNode.connect(p5.soundOut._silentNode); + + return cNode; + } + + }, { + key: "_initSourceNode", + value: function _initSourceNode() { + var bufferSourceNode = soundfile_ac.createBufferSource(); + bufferSourceNode.buffer = this.buffer; + bufferSourceNode.playbackRate.value = this.playbackRate; + bufferSourceNode.connect(this.output); + return bufferSourceNode; + } + }, { + key: "processPeaks", + value: function processPeaks(callback, _initThreshold, _minThreshold, _minPeaks) { + console.warn('processPeaks is deprecated'); + } + /** + * Schedule events to trigger every time a MediaElement + * (audio/video) reaches a playback cue point. + * + * Accepts a callback function, a time (in seconds) at which to trigger + * the callback, and an optional parameter for the callback. + * + * Time will be passed as the first parameter to the callback function, + * and param will be the second parameter. + * + * + * @method addCue + * @for p5.SoundFile + * @param {Number} time Time in seconds, relative to this media + * element's playback. For example, to trigger + * an event every time playback reaches two + * seconds, pass in the number 2. This will be + * passed as the first parameter to + * the callback function. + * @param {Function} callback Name of a function that will be + * called at the given time. The callback will + * receive time and (optionally) param as its + * two parameters. + * @param {Object} [value] An object to be passed as the + * second parameter to the + * callback function. + * @return {Number} id ID of this cue, + * useful for removeCue(id) + * @example + *
                          + * let mySound; + * function preload() { + * mySound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to play', 10, 20); + * + * // schedule calls to changeText + * mySound.addCue(0, changeText, "hello" ); + * mySound.addCue(0.5, changeText, "hello," ); + * mySound.addCue(1, changeText, "hello, p5!"); + * mySound.addCue(1.5, changeText, "hello, p5!!"); + * mySound.addCue(2, changeText, "hello, p5!!!!!"); + * } + * + * function changeText(val) { + * background(220); + * text(val, 10, 20); + * } + * + * function canvasPressed() { + * mySound.play(); + * } + *
                          + */ + + }, { + key: "addCue", + value: function addCue(time, callback, val) { + var id = this._cueIDCounter++; + var cue = new Cue(callback, time, id, val); + + this._cues.push(cue); + + + return id; + } + /** + * Remove a callback based on its ID. The ID is returned by the + * addCue method. + * + * @method removeCue + * @for p5.SoundFile + * @param {Number} id ID of the cue, as returned by addCue + */ + + }, { + key: "removeCue", + value: function removeCue(id) { + var cueLength = this._cues.length; + + for (var i = 0; i < cueLength; i++) { + var cue = this._cues[i]; + + if (cue.id === id) { + this._cues.splice(i, 1); + + break; + } + } + + if (this._cues.length === 0) { + } + } + /** + * Remove all of the callbacks that had originally been scheduled + * via the addCue method. + * + * @method clearCues + */ + + }, { + key: "clearCues", + value: function clearCues() { + this._cues = []; + } + + }, { + key: "_onTimeUpdate", + value: function _onTimeUpdate(position) { + var playbackTime = position / this.buffer.sampleRate; + var cueLength = this._cues.length; + + for (var i = 0; i < cueLength; i++) { + var cue = this._cues[i]; + var callbackTime = cue.time; + var val = cue.val; + var leftLimit = this._prevUpdateTime || 0; + var rightLimit = playbackTime; + + if (leftLimit <= callbackTime && callbackTime <= rightLimit) { + cue.callback(val); + } + } + + this._prevUpdateTime = playbackTime; + } + /** + * Save a p5.SoundFile as a .wav file. The browser will prompt the user + * to download the file to their device. To upload a file to a server, see + * getBlob + * + * @method save + * @for p5.SoundFile + * @param {String} [fileName] name of the resulting .wav file. + * @example + *
                          + * let mySound; + * function preload() { + * mySound = loadSound('assets/doorbell.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap to download', 10, 20); + * } + * + * function canvasPressed() { + * mySound.save('my cool filename'); + * } + *
                          + */ + + }, { + key: "save", + value: function save(fileName) { + p5.prototype.saveSound(this, fileName, 'wav'); + } + /** + * This method is useful for sending a SoundFile to a server. It returns the + * .wav-encoded audio data as a "Blob". + * A Blob is a file-like data object that can be uploaded to a server + * with an http request. We'll + * use the `httpDo` options object to send a POST request with some + * specific options: we encode the request as `multipart/form-data`, + * and attach the blob as one of the form values using `FormData`. + * + * + * @method getBlob + * @for p5.SoundFile + * @returns {Blob} A file-like data object + * @example + *
                          + * function preload() { + * mySound = loadSound('assets/doorbell.mp3'); + * } + * + * function setup() { + * noCanvas(); + * let soundBlob = mySound.getBlob(); + * + * // Now we can send the blob to a server... + * let serverUrl = 'https://jsonplaceholder.typicode.com/posts'; + * let httpRequestOptions = { + * method: 'POST', + * body: new FormData().append('soundBlob', soundBlob), + * headers: new Headers({ + * 'Content-Type': 'multipart/form-data' + * }) + * }; + * httpDo(serverUrl, httpRequestOptions); + * + * // We can also create an `ObjectURL` pointing to the Blob + * let blobUrl = URL.createObjectURL(soundBlob); + * + * // The `
                          + */ + + }, { + key: "getBlob", + value: function getBlob() { + var dataView = convertToWav(this.buffer); + return new Blob([dataView], { + type: 'audio/wav' + }); + } + }]); + + return SoundFile; +}(); +/** + * loadSound() returns a new p5.SoundFile from a specified + * path. If called during preload(), the p5.SoundFile will be ready + * to play in time for setup() and draw(). If called outside of + * preload, the p5.SoundFile will not be ready immediately, so + * loadSound accepts a callback as the second parameter. Using a + * + * local server is recommended when loading external files. + * + * @method loadSound + * @for p5 + * @param {String|Array} path Path to the sound file, or an array with + * paths to soundfiles in multiple formats + * i.e. ['sound.ogg', 'sound.mp3']. + * Alternately, accepts an object: either + * from the HTML5 File API, or a p5.File. + * @param {Function} [successCallback] Name of a function to call once file loads + * @param {Function} [errorCallback] Name of a function to call if there is + * an error loading the file. + * @param {Function} [whileLoading] Name of a function to call while file is loading. + * This function will receive the percentage loaded + * so far, from 0.0 to 1.0. + * @return {SoundFile} Returns a p5.SoundFile + * @example + *
                          + * let mySound; + * function preload() { + * soundFormats('mp3', 'ogg'); + * mySound = loadSound('assets/doorbell'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * text('tap here to play', 10, 20); + * } + * + * function canvasPressed() { + * // playing a sound file on a user gesture + * // is equivalent to `userStartAudio()` + * mySound.play(); + * } + *
                          + */ + + +function loadSound(path, callback, onerror, whileLoading) { + if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { + window.alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); + } + + var self = this; + var s = new soundfile_SoundFile(path, function () { + if (typeof callback === 'function') { + callback.apply(self, arguments); + } + + if (typeof self._decrementPreload === 'function') { + self._decrementPreload(); + } + }, onerror, whileLoading); + return s; +} + + var soundfile = (soundfile_SoundFile); + +function amplitude_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function amplitude_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function amplitude_createClass(Constructor, protoProps, staticProps) { if (protoProps) amplitude_defineProperties(Constructor.prototype, protoProps); if (staticProps) amplitude_defineProperties(Constructor, staticProps); return Constructor; } + + + + +/** + * Amplitude measures volume between 0.0 and 1.0. + * Listens to all p5sound by default, or use setInput() + * to listen to a specific sound source. Accepts an optional + * smoothing value, which defaults to 0. + * + * @class p5.Amplitude + * @constructor + * @param {Number} [smoothing] between 0.0 and .999 to smooth + * amplitude readings (defaults to 0) + * @example + *
                          + * let sound, amplitude; + * + * function preload(){ + * sound = loadSound('assets/beat.mp3'); + * } + * function setup() { + * let cnv = createCanvas(100,100); + * cnv.mouseClicked(togglePlay); + * amplitude = new p5.Amplitude(); + * } + * + * function draw() { + * background(220); + * text('tap to play', 20, 20); + * + * let level = amplitude.getLevel(); + * let size = map(level, 0, 1, 0, 200); + * ellipse(width/2, height/2, size, size); + * } + * + * function togglePlay() { + * if (sound.isPlaying() ){ + * sound.pause(); + * } else { + * sound.loop(); + * amplitude = new p5.Amplitude(); + * amplitude.setInput(sound); + * } + * } + * + *
                          + */ + +var amplitude_Amplitude = +function () { + function Amplitude(smoothing) { + amplitude_classCallCheck(this, Amplitude); + + this.bufferSize = safeBufferSize(2048); + + this.audiocontext = main.audiocontext; + this._workletNode = new AudioWorkletNode(this.audiocontext, processorNames_default.a.amplitudeProcessor, { + outputChannelCount: [1], + parameterData: { + smoothing: smoothing || 0 + }, + processorOptions: { + normalize: false, + smoothing: smoothing || 0, + numInputChannels: 2, + bufferSize: this.bufferSize + } + }); + + this._workletNode.port.onmessage = function (event) { + if (event.data.name === 'amplitude') { + this.volume = event.data.volume; + this.volNorm = event.data.volNorm; + this.stereoVol = event.data.stereoVol; + this.stereoVolNorm = event.data.stereoVolNorm; + } + }.bind(this); + + + this.input = this._workletNode; + this.output = this.audiocontext.createGain(); + + this.volume = 0; + this.volNorm = 0; + this.stereoVol = [0, 0]; + this.stereoVolNorm = [0, 0]; + this.normalize = false; + + this._workletNode.connect(this.output); + + this.output.gain.value = 0; + + this.output.connect(this.audiocontext.destination); + + main.meter.connect(this._workletNode); + + main.soundArray.push(this); + } + /** + * Connects to the p5sound instance (main output) by default. + * Optionally, you can pass in a specific source (i.e. a soundfile). + * + * @method setInput + * @for p5.Amplitude + * @param {soundObject|undefined} [snd] set the sound source + * (optional, defaults to + * main output) + * @param {Number|undefined} [smoothing] a range between 0.0 and 1.0 + * to smooth amplitude readings + * @example + *
                          + * function preload(){ + * sound1 = loadSound('assets/beat.mp3'); + * sound2 = loadSound('assets/drum.mp3'); + * } + * function setup(){ + * cnv = createCanvas(100, 100); + * cnv.mouseClicked(toggleSound); + * + * amplitude = new p5.Amplitude(); + * amplitude.setInput(sound2); + * } + * + * function draw() { + * background(220); + * text('tap to play', 20, 20); + * + * let level = amplitude.getLevel(); + * let size = map(level, 0, 1, 0, 200); + * ellipse(width/2, height/2, size, size); + * } + * + * function toggleSound(){ + * if (sound1.isPlaying() && sound2.isPlaying()) { + * sound1.stop(); + * sound2.stop(); + * } else { + * sound1.play(); + * sound2.play(); + * } + * } + *
                          + */ + + + amplitude_createClass(Amplitude, [{ + key: "setInput", + value: function setInput(source, smoothing) { + main.meter.disconnect(); + + if (smoothing) { + this._workletNode.parameters.get('smoothing').value = smoothing; + } + + + if (source == null) { + console.log('Amplitude input source is not ready! Connecting to main output instead'); + main.meter.connect(this._workletNode); + } + else if (source) { + source.connect(this._workletNode); + + this._workletNode.disconnect(); + + this._workletNode.connect(this.output); + } + else { + main.meter.connect(this._workletNode); + } + } + }, { + key: "connect", + value: function connect(unit) { + if (unit) { + if (unit.hasOwnProperty('input')) { + this.output.connect(unit.input); + } else { + this.output.connect(unit); + } + } else { + this.output.connect(this.panner.connect(main.input)); + } + } + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + } + /** + * Returns a single Amplitude reading at the moment it is called. + * For continuous readings, run in the draw loop. + * + * @method getLevel + * @for p5.Amplitude + * @param {Number} [channel] Optionally return only channel 0 (left) or 1 (right) + * @return {Number} Amplitude as a number between 0.0 and 1.0 + * @example + *
                          + * function preload(){ + * sound = loadSound('assets/beat.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mouseClicked(toggleSound); + * amplitude = new p5.Amplitude(); + * } + * + * function draw() { + * background(220, 150); + * textAlign(CENTER); + * text('tap to play', width/2, 20); + * + * let level = amplitude.getLevel(); + * let size = map(level, 0, 1, 0, 200); + * ellipse(width/2, height/2, size, size); + * } + * + * function toggleSound(){ + * if (sound.isPlaying()) { + * sound.stop(); + * } else { + * sound.play(); + * } + * } + *
                          + */ + + }, { + key: "getLevel", + value: function getLevel(channel) { + if (typeof channel !== 'undefined') { + if (this.normalize) { + return this.stereoVolNorm[channel]; + } else { + return this.stereoVol[channel]; + } + } else if (this.normalize) { + return this.volNorm; + } else { + return this.volume; + } + } + /** + * Determines whether the results of Amplitude.process() will be + * Normalized. To normalize, Amplitude finds the difference the + * loudest reading it has processed and the maximum amplitude of + * 1.0. Amplitude adds this difference to all values to produce + * results that will reliably map between 0.0 and 1.0. However, + * if a louder moment occurs, the amount that Normalize adds to + * all the values will change. Accepts an optional boolean parameter + * (true or false). Normalizing is off by default. + * + * @method toggleNormalize + * @for p5.Amplitude + * @param {boolean} [boolean] set normalize to true (1) or false (0) + */ + + }, { + key: "toggleNormalize", + value: function toggleNormalize(bool) { + if (typeof bool === 'boolean') { + this.normalize = bool; + } else { + this.normalize = !this.normalize; + } + + this._workletNode.port.postMessage({ + name: 'toggleNormalize', + normalize: this.normalize + }); + } + /** + * Smooth Amplitude analysis by averaging with the last analysis + * frame. Off by default. + * + * @method smooth + * @for p5.Amplitude + * @param {Number} set smoothing from 0.0 <= 1 + */ + + }, { + key: "smooth", + value: function smooth(s) { + if (s >= 0 && s < 1) { + this._workletNode.port.postMessage({ + name: 'smoothing', + smoothing: s + }); + } else { + console.log('Error: smoothing must be between 0 and 1'); + } + } + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.input) { + this.input.disconnect(); + delete this.input; + } + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + + this._workletNode.disconnect(); + + delete this._workletNode; + } + }]); + + return Amplitude; +}(); + + var amplitude = (amplitude_Amplitude); +function fft_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function fft_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function fft_createClass(Constructor, protoProps, staticProps) { if (protoProps) fft_defineProperties(Constructor.prototype, protoProps); if (staticProps) fft_defineProperties(Constructor, staticProps); return Constructor; } + + +/** + *

                          FFT (Fast Fourier Transform) is an analysis algorithm that + * isolates individual + * + * audio frequencies within a waveform.

                          + * + *

                          Once instantiated, a p5.FFT object can return an array based on + * two types of analyses:
                          FFT.waveform() computes + * amplitude values along the time domain. The array indices correspond + * to samples across a brief moment in time. Each value represents + * amplitude of the waveform at that sample of time.
                          + * • FFT.analyze() computes amplitude values along the + * frequency domain. The array indices correspond to frequencies (i.e. + * pitches), from the lowest to the highest that humans can hear. Each + * value represents amplitude at that slice of the frequency spectrum. + * Use with getEnergy() to measure amplitude at specific + * frequencies, or within a range of frequencies.

                          + * + *

                          FFT analyzes a very short snapshot of sound called a sample + * buffer. It returns an array of amplitude measurements, referred + * to as bins. The array is 1024 bins long by default. + * You can change the bin array length, but it must be a power of 2 + * between 16 and 1024 in order for the FFT algorithm to function + * correctly. The actual size of the FFT buffer is twice the + * number of bins, so given a standard sample rate, the buffer is + * 2048/44100 seconds long.

                          + * + * + * @class p5.FFT + * @constructor + * @param {Number} [smoothing] Smooth results of Freq Spectrum. + * 0.0 < smoothing < 1.0. + * Defaults to 0.8. + * @param {Number} [bins] Length of resulting array. + * Must be a power of two between + * 16 and 1024. Defaults to 1024. + * @example + *
                          + * function preload(){ + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup(){ + * let cnv = createCanvas(100,100); + * cnv.mouseClicked(togglePlay); + * fft = new p5.FFT(); + * sound.amp(0.2); + * } + * + * function draw(){ + * background(220); + * + * let spectrum = fft.analyze(); + * noStroke(); + * fill(255, 0, 255); + * for (let i = 0; i< spectrum.length; i++){ + * let x = map(i, 0, spectrum.length, 0, width); + * let h = -height + map(spectrum[i], 0, 255, height, 0); + * rect(x, height, width / spectrum.length, h ) + * } + * + * let waveform = fft.waveform(); + * noFill(); + * beginShape(); + * stroke(20); + * for (let i = 0; i < waveform.length; i++){ + * let x = map(i, 0, waveform.length, 0, width); + * let y = map( waveform[i], -1, 1, 0, height); + * vertex(x,y); + * } + * endShape(); + * + * text('tap to play', 20, 20); + * } + * + * function togglePlay() { + * if (sound.isPlaying()) { + * sound.pause(); + * } else { + * sound.loop(); + * } + * } + *
                          + */ + +var fft_FFT = +function () { + function FFT(smoothing, bins) { + fft_classCallCheck(this, FFT); + + this.input = this.analyser = main.audiocontext.createAnalyser(); + Object.defineProperties(this, { + bins: { + get: function get() { + return this.analyser.fftSize / 2; + }, + set: function set(b) { + this.analyser.fftSize = b * 2; + }, + configurable: true, + enumerable: true + }, + smoothing: { + get: function get() { + return this.analyser.smoothingTimeConstant; + }, + set: function set(s) { + this.analyser.smoothingTimeConstant = s; + }, + configurable: true, + enumerable: true + } + }); + + this.smooth(smoothing); + this.bins = bins || 1024; + + main.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, 14000]; + + main.soundArray.push(this); + } + /** + * Set the input source for the FFT analysis. If no source is + * provided, FFT will analyze all sound in the sketch. + * + * @method setInput + * @for p5.FFT + * @param {Object} [source] p5.sound object (or web audio API source node) + */ + + + fft_createClass(FFT, [{ + key: "setInput", + value: function setInput(source) { + if (!source) { + main.fftMeter.connect(this.analyser); + } else { + if (source.output) { + source.output.connect(this.analyser); + } else if (source.connect) { + source.connect(this.analyser); + } + + main.fftMeter.disconnect(); + } + } + /** + * Returns an array of amplitude values (between -1.0 and +1.0) that represent + * a snapshot of amplitude readings in a single buffer. Length will be + * equal to bins (defaults to 1024). Can be used to draw the waveform + * of a sound. + * + * @method waveform + * @for p5.FFT + * @param {Number} [bins] Must be a power of two between + * 16 and 1024. Defaults to 1024. + * @param {String} [precision] If any value is provided, will return results + * in a Float32 Array which is more precise + * than a regular array. + * @return {Array} Array Array of amplitude values (-1 to 1) + * over time. Array length = bins. + * + */ + + }, { + key: "waveform", + value: function waveform() { + var bins, mode; + var normalArray = new Array(); + + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] === 'number') { + bins = arguments[i]; + this.analyser.fftSize = bins * 2; + } + + if (typeof arguments[i] === 'string') { + mode = arguments[i]; + } + } + + + if (mode && !p5.prototype._isSafari()) { + timeToFloat(this, this.timeDomain); + this.analyser.getFloatTimeDomainData(this.timeDomain); + return this.timeDomain; + } else { + timeToInt(this, this.timeDomain); + this.analyser.getByteTimeDomainData(this.timeDomain); + + for (var j = 0; j < this.timeDomain.length; j++) { + var scaled = p5.prototype.map(this.timeDomain[j], 0, 255, -1, 1); + normalArray.push(scaled); + } + + return normalArray; + } + } + /** + * Returns an array of amplitude values (between 0 and 255) + * across the frequency spectrum. Length is equal to FFT bins + * (1024 by default). The array indices correspond to frequencies + * (i.e. pitches), from the lowest to the highest that humans can + * hear. Each value represents amplitude at that slice of the + * frequency spectrum. Must be called prior to using + * getEnergy(). + * + * @method analyze + * @for p5.FFT + * @param {Number} [bins] Must be a power of two between + * 16 and 1024. Defaults to 1024. + * @param {Number} [scale] If "dB," returns decibel + * float measurements between + * -140 and 0 (max). + * Otherwise returns integers from 0-255. + * @return {Array} spectrum Array of energy (amplitude/volume) + * values across the frequency spectrum. + * Lowest energy (silence) = 0, highest + * possible is 255. + * @example + *
                          + * let osc, fft; + * + * function setup(){ + * let cnv = createCanvas(100,100); + * cnv.mousePressed(startSound); + * osc = new p5.Oscillator(); + * osc.amp(0); + * fft = new p5.FFT(); + * } + * + * function draw(){ + * background(220); + * + * let freq = map(mouseX, 0, windowWidth, 20, 10000); + * freq = constrain(freq, 1, 20000); + * osc.freq(freq); + * + * let spectrum = fft.analyze(); + * noStroke(); + * fill(255, 0, 255); + * for (let i = 0; i< spectrum.length; i++){ + * let x = map(i, 0, spectrum.length, 0, width); + * let h = -height + map(spectrum[i], 0, 255, height, 0); + * rect(x, height, width / spectrum.length, h ); + * } + * + * stroke(255); + * if (!osc.started) { + * text('tap here and drag to change frequency', 10, 20, width - 20); + * } else { + * text(round(freq)+'Hz', 10, 20); + * } + * } + * + * function startSound() { + * osc.start(); + * osc.amp(0.5, 0.2); + * } + * + * function mouseReleased() { + * osc.amp(0, 0.2); + * } + *
                          + * + * + */ + + }, { + key: "analyze", + value: function analyze() { + var mode; + + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] === 'number') { + this.bins = arguments[i]; + this.analyser.fftSize = this.bins * 2; + } + + if (typeof arguments[i] === 'string') { + mode = arguments[i]; + } + } + + if (mode && mode.toLowerCase() === 'db') { + freqToFloat(this); + this.analyser.getFloatFrequencyData(this.freqDomain); + return this.freqDomain; + } else { + freqToInt(this, this.freqDomain); + this.analyser.getByteFrequencyData(this.freqDomain); + var normalArray = Array.apply([], this.freqDomain); + return normalArray; + } + } + /** + * Returns the amount of energy (volume) at a specific + * + * frequency, or the average amount of energy between two + * frequencies. Accepts Number(s) corresponding + * to frequency (in Hz), or a "string" corresponding to predefined + * frequency ranges ("bass", "lowMid", "mid", "highMid", "treble"). + * Returns a range between 0 (no energy/volume at that frequency) and + * 255 (maximum energy). + * NOTE: analyze() must be called prior to getEnergy(). analyze() + * tells the FFT to analyze frequency data, and getEnergy() uses + * the results to determine the value at a specific frequency or + * range of frequencies.

                          + * + * @method getEnergy + * @for p5.FFT + * @param {Number|String} frequency1 Will return a value representing + * energy at this frequency. Alternately, + * the strings "bass", "lowMid" "mid", + * "highMid", and "treble" will return + * predefined frequency ranges. + * @param {Number} [frequency2] If a second frequency is given, + * will return average amount of + * energy that exists between the + * two frequencies. + * @return {Number} Energy Energy (volume/amplitude) from + * 0 and 255. + * + */ + + }, { + key: "getEnergy", + value: function getEnergy(frequency1, frequency2) { + var nyquist = main.audiocontext.sampleRate / 2; + + if (frequency1 === 'bass') { + frequency1 = this.bass[0]; + frequency2 = this.bass[1]; + } else if (frequency1 === 'lowMid') { + frequency1 = this.lowMid[0]; + frequency2 = this.lowMid[1]; + } else if (frequency1 === 'mid') { + frequency1 = this.mid[0]; + frequency2 = this.mid[1]; + } else if (frequency1 === 'highMid') { + frequency1 = this.highMid[0]; + frequency2 = this.highMid[1]; + } else if (frequency1 === 'treble') { + frequency1 = this.treble[0]; + frequency2 = this.treble[1]; + } + + if (typeof frequency1 !== 'number') { + throw 'invalid input for getEnergy()'; + } else if (!frequency2) { + var index = Math.round(frequency1 / nyquist * this.freqDomain.length); + return this.freqDomain[index]; + } else if (frequency1 && frequency2) { + if (frequency1 > frequency2) { + var swap = frequency2; + frequency2 = frequency1; + frequency1 = swap; + } + + var lowIndex = Math.round(frequency1 / nyquist * this.freqDomain.length); + var highIndex = Math.round(frequency2 / nyquist * this.freqDomain.length); + var total = 0; + var numFrequencies = 0; + + for (var i = lowIndex; i <= highIndex; i++) { + total += this.freqDomain[i]; + numFrequencies += 1; + } + + + var toReturn = total / numFrequencies; + return toReturn; + } else { + throw 'invalid input for getEnergy()'; + } + } + + }, { + key: "getFreq", + value: function getFreq(freq1, freq2) { + console.log('getFreq() is deprecated. Please use getEnergy() instead.'); + var x = this.getEnergy(freq1, freq2); + return x; + } + /** + * Returns the + * + * spectral centroid of the input signal. + * NOTE: analyze() must be called prior to getCentroid(). Analyze() + * tells the FFT to analyze frequency data, and getCentroid() uses + * the results determine the spectral centroid.

                          + * + * @method getCentroid + * @for p5.FFT + * @return {Number} Spectral Centroid Frequency of the spectral centroid in Hz. + * + * + * @example + *
                          + * function setup(){ + * cnv = createCanvas(100,100); + * cnv.mousePressed(userStartAudio); + * sound = new p5.AudioIn(); + * sound.start(); + * fft = new p5.FFT(); + * sound.connect(fft); + *} + * + *function draw() { + * if (getAudioContext().state !== 'running') { + * background(220); + * text('tap here and enable mic to begin', 10, 20, width - 20); + * return; + * } + * let centroidplot = 0.0; + * let spectralCentroid = 0; + * + * background(0); + * stroke(0,255,0); + * let spectrum = fft.analyze(); + * fill(0,255,0); // spectrum is green + * + * //draw the spectrum + * for (let i = 0; i < spectrum.length; i++){ + * let x = map(log(i), 0, log(spectrum.length), 0, width); + * let h = map(spectrum[i], 0, 255, 0, height); + * let rectangle_width = (log(i+1)-log(i))*(width/log(spectrum.length)); + * rect(x, height, rectangle_width, -h ) + * } + * let nyquist = 22050; + * + * // get the centroid + * spectralCentroid = fft.getCentroid(); + * + * // the mean_freq_index calculation is for the display. + * let mean_freq_index = spectralCentroid/(nyquist/spectrum.length); + * + * centroidplot = map(log(mean_freq_index), 0, log(spectrum.length), 0, width); + * + * stroke(255,0,0); // the line showing where the centroid is will be red + * + * rect(centroidplot, 0, width / spectrum.length, height) + * noStroke(); + * fill(255,255,255); // text is white + * text('centroid: ', 10, 20); + * text(round(spectralCentroid)+' Hz', 10, 40); + *} + *
                          + */ + + }, { + key: "getCentroid", + value: function getCentroid() { + var nyquist = main.audiocontext.sampleRate / 2; + var cumulative_sum = 0; + var centroid_normalization = 0; + + for (var i = 0; i < this.freqDomain.length; i++) { + cumulative_sum += i * this.freqDomain[i]; + centroid_normalization += this.freqDomain[i]; + } + + var mean_freq_index = 0; + + if (centroid_normalization !== 0) { + mean_freq_index = cumulative_sum / centroid_normalization; + } + + var spec_centroid_freq = mean_freq_index * (nyquist / this.freqDomain.length); + return spec_centroid_freq; + } + /** + * Smooth FFT analysis by averaging with the last analysis frame. + * + * @method smooth + * @param {Number} smoothing 0.0 < smoothing < 1.0. + * Defaults to 0.8. + */ + + }, { + key: "smooth", + value: function smooth(s) { + if (typeof s !== 'undefined') { + this.smoothing = s; + } + + return this.smoothing; + } + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.analyser) { + this.analyser.disconnect(); + delete this.analyser; + } + } + /** + * Returns an array of average amplitude values for a given number + * of frequency bands split equally. N defaults to 16. + * NOTE: analyze() must be called prior to linAverages(). Analyze() + * tells the FFT to analyze frequency data, and linAverages() uses + * the results to group them into a smaller set of averages.

                          + * + * @method linAverages + * @for p5.FFT + * @param {Number} N Number of returned frequency groups + * @return {Array} linearAverages Array of average amplitude values for each group + */ + + }, { + key: "linAverages", + value: function linAverages(_N) { + var N = _N || 16; + + var spectrum = this.freqDomain; + var spectrumLength = spectrum.length; + var spectrumStep = Math.floor(spectrumLength / N); + var linearAverages = new Array(N); + + var groupIndex = 0; + + for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { + linearAverages[groupIndex] = linearAverages[groupIndex] !== undefined ? (linearAverages[groupIndex] + spectrum[specIndex]) / 2 : spectrum[specIndex]; + + if (specIndex % spectrumStep === spectrumStep - 1) { + groupIndex++; + } + } + + return linearAverages; + } + /** + * Returns an array of average amplitude values of the spectrum, for a given + * set of + * Octave Bands + * NOTE: analyze() must be called prior to logAverages(). Analyze() + * tells the FFT to analyze frequency data, and logAverages() uses + * the results to group them into a smaller set of averages.

                          + * + * @method logAverages + * @for p5.FFT + * @param {Array} octaveBands Array of Octave Bands objects for grouping + * @return {Array} logAverages Array of average amplitude values for each group + */ + + }, { + key: "logAverages", + value: function logAverages(octaveBands) { + var nyquist = main.audiocontext.sampleRate / 2; + var spectrum = this.freqDomain; + var spectrumLength = spectrum.length; + var logAverages = new Array(octaveBands.length); + + var octaveIndex = 0; + + for (var specIndex = 0; specIndex < spectrumLength; specIndex++) { + var specIndexFrequency = Math.round(specIndex * nyquist / this.freqDomain.length); + + if (specIndexFrequency > octaveBands[octaveIndex].hi) { + octaveIndex++; + } + + logAverages[octaveIndex] = logAverages[octaveIndex] !== undefined ? (logAverages[octaveIndex] + spectrum[specIndex]) / 2 : spectrum[specIndex]; + } + + return logAverages; + } + /** + * Calculates and Returns the 1/N + * Octave Bands + * N defaults to 3 and minimum central frequency to 15.625Hz. + * (1/3 Octave Bands ~= 31 Frequency Bands) + * Setting fCtr0 to a central value of a higher octave will ignore the lower bands + * and produce less frequency groups. + * + * @method getOctaveBands + * @for p5.FFT + * @param {Number} N Specifies the 1/N type of generated octave bands + * @param {Number} fCtr0 Minimum central frequency for the lowest band + * @return {Array} octaveBands Array of octave band objects with their bounds + */ + + }, { + key: "getOctaveBands", + value: function getOctaveBands(_N, _fCtr0) { + var N = _N || 3; + + var fCtr0 = _fCtr0 || 15.625; + + var octaveBands = []; + var lastFrequencyBand = { + lo: fCtr0 / Math.pow(2, 1 / (2 * N)), + ctr: fCtr0, + hi: fCtr0 * Math.pow(2, 1 / (2 * N)) + }; + octaveBands.push(lastFrequencyBand); + var nyquist = main.audiocontext.sampleRate / 2; + + while (lastFrequencyBand.hi < nyquist) { + var newFrequencyBand = {}; + newFrequencyBand.lo = lastFrequencyBand.hi; + newFrequencyBand.ctr = lastFrequencyBand.ctr * Math.pow(2, 1 / N); + newFrequencyBand.hi = newFrequencyBand.ctr * Math.pow(2, 1 / (2 * N)); + octaveBands.push(newFrequencyBand); + lastFrequencyBand = newFrequencyBand; + } + + return octaveBands; + } + }]); + + return FFT; +}(); + + +function freqToFloat(fft) { + if (fft.freqDomain instanceof Float32Array === false) { + fft.freqDomain = new Float32Array(fft.analyser.frequencyBinCount); + } +} + +function freqToInt(fft) { + if (fft.freqDomain instanceof Uint8Array === false) { + fft.freqDomain = new Uint8Array(fft.analyser.frequencyBinCount); + } +} + +function timeToFloat(fft) { + if (fft.timeDomain instanceof Float32Array === false) { + fft.timeDomain = new Float32Array(fft.analyser.frequencyBinCount); + } +} + +function timeToInt(fft) { + if (fft.timeDomain instanceof Uint8Array === false) { + fft.timeDomain = new Uint8Array(fft.analyser.frequencyBinCount); + } +} + + var fft = (fft_FFT); +var Add = __webpack_require__(4); +var Add_default = __webpack_require__.n(Add); + +var Multiply = __webpack_require__(1); +var Multiply_default = __webpack_require__.n(Multiply); + +var Scale = __webpack_require__(8); +var Scale_default = __webpack_require__.n(Scale); + +function oscillator_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { oscillator_typeof = function _typeof(obj) { return typeof obj; }; } else { oscillator_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return oscillator_typeof(obj); } + +function _possibleConstructorReturn(self, call) { if (call && (oscillator_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function oscillator_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function oscillator_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function oscillator_createClass(Constructor, protoProps, staticProps) { if (protoProps) oscillator_defineProperties(Constructor.prototype, protoProps); if (staticProps) oscillator_defineProperties(Constructor, staticProps); return Constructor; } + + + + + + +function sigChain(o, mathObj, thisChain, nextChain, type) { + var chainSource = o.oscillator; + + for (var i in o.mathOps) { + if (o.mathOps[i] instanceof type) { + chainSource.disconnect(); + o.mathOps[i].dispose(); + thisChain = i; + + if (thisChain < o.mathOps.length - 2) { + nextChain = o.mathOps[i + 1]; + } + } + } + + if (thisChain === o.mathOps.length - 1) { + o.mathOps.push(nextChain); + } + + + if (i > 0) { + chainSource = o.mathOps[i - 1]; + } + + chainSource.disconnect(); + chainSource.connect(mathObj); + mathObj.connect(nextChain); + o.mathOps[thisChain] = mathObj; + return o; +} +/** + *

                          Creates a signal that oscillates between -1.0 and 1.0. + * By default, the oscillation takes the form of a sinusoidal + * shape ('sine'). Additional types include 'triangle', + * 'sawtooth' and 'square'. The frequency defaults to + * 440 oscillations per second (440Hz, equal to the pitch of an + * 'A' note).

                          + * + *

                          Set the type of oscillation with setType(), or by instantiating a + * specific oscillator: p5.SinOsc, p5.TriOsc, p5.SqrOsc, or p5.SawOsc. + *

                          + * + * @class p5.Oscillator + * @constructor + * @param {Number} [freq] frequency defaults to 440Hz + * @param {String} [type] type of oscillator. Options: + * 'sine' (default), 'triangle', + * 'sawtooth', 'square' + * @example + *
                          + * let osc, playing, freq, amp; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playOscillator); + * osc = new p5.Oscillator('sine'); + * } + * + * function draw() { + * background(220) + * freq = constrain(map(mouseX, 0, width, 100, 500), 100, 500); + * amp = constrain(map(mouseY, height, 0, 0, 1), 0, 1); + * + * text('tap to play', 20, 20); + * text('freq: ' + freq, 20, 40); + * text('amp: ' + amp, 20, 60); + * + * if (playing) { + * // smooth the transitions by 0.1 seconds + * osc.freq(freq, 0.1); + * osc.amp(amp, 0.1); + * } + * } + * + * function playOscillator() { + * // starting an oscillator on a user gesture will enable audio + * // in browsers that have a strict autoplay policy. + * // See also: userStartAudio(); + * osc.start(); + * playing = true; + * } + * + * function mouseReleased() { + * // ramp amplitude to 0 over 0.5 seconds + * osc.amp(0, 0.5); + * playing = false; + * } + *
                          + */ + + +var oscillator_Oscillator = +function () { + function Oscillator(freq, type) { + oscillator_classCallCheck(this, Oscillator); + + if (typeof freq === 'string') { + var f = type; + type = freq; + freq = f; + } + + if (typeof type === 'number') { + var _f = type; + type = freq; + freq = _f; + } + + this.started = false; + + this.phaseAmount = undefined; + this.oscillator = main.audiocontext.createOscillator(); + this.f = freq || 440.0; + + this.oscillator.type = type || 'sine'; + this.oscillator.frequency.setValueAtTime(this.f, main.audiocontext.currentTime); + + this.output = main.audiocontext.createGain(); + this._freqMods = []; + + this.output.gain.value = 0.5; + this.output.gain.setValueAtTime(0.5, main.audiocontext.currentTime); + this.oscillator.connect(this.output); + + this.panPosition = 0.0; + this.connection = main.input; + + this.panner = new panner_0(this.output, this.connection, 1); + + this.mathOps = [this.output]; + + main.soundArray.push(this); + + this.fade = this.amp; + } + /** + * Start an oscillator. + * + * Starting an oscillator on a user gesture will enable audio in browsers + * that have a strict autoplay policy, including Chrome and most mobile + * devices. See also: `userStartAudio()`. + * + * @method start + * @for p5.Oscillator + * @param {Number} [time] startTime in seconds from now. + * @param {Number} [frequency] frequency in Hz. + */ + + + oscillator_createClass(Oscillator, [{ + key: "start", + value: function start(time, f) { + if (this.started) { + var now = main.audiocontext.currentTime; + this.stop(now); + } + + if (!this.started) { + var freq = f || this.f; + var type = this.oscillator.type; + + if (this.oscillator) { + this.oscillator.disconnect(); + delete this.oscillator; + } + + + this.oscillator = main.audiocontext.createOscillator(); + this.oscillator.frequency.value = Math.abs(freq); + this.oscillator.type = type; + + this.oscillator.connect(this.output); + time = time || 0; + this.oscillator.start(time + main.audiocontext.currentTime); + this.freqNode = this.oscillator.frequency; + + for (var i in this._freqMods) { + if (typeof this._freqMods[i].connect !== 'undefined') { + this._freqMods[i].connect(this.oscillator.frequency); + } + } + + this.started = true; + } + } + /** + * Stop an oscillator. Accepts an optional parameter + * to determine how long (in seconds from now) until the + * oscillator stops. + * + * @method stop + * @for p5.Oscillator + * @param {Number} secondsFromNow Time, in seconds from now. + */ + + }, { + key: "stop", + value: function stop(time) { + if (this.started) { + var t = time || 0; + var now = main.audiocontext.currentTime; + this.oscillator.stop(t + now); + this.started = false; + } + } + /** + * Set the amplitude between 0 and 1.0. Or, pass in an object + * such as an oscillator to modulate amplitude with an audio signal. + * + * @method amp + * @for p5.Oscillator + * @param {Number|Object} vol between 0 and 1.0 + * or a modulating signal/oscillator + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @return {AudioParam} gain If no value is provided, + * returns the Web Audio API + * AudioParam that controls + * this oscillator's + * gain/amplitude/volume) + */ + + }, { + key: "amp", + value: function amp(vol) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (typeof vol === 'number') { + var now = main.audiocontext.currentTime; + this.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); + } else if (vol) { + vol.connect(this.output.gain); + } else { + return this.output.gain; + } + } + /** + * Returns the value of output gain + * + * @method getAmp + * @for p5.Oscillator + * + * @returns {number} Amplitude value between 0.0 and 1.0 + */ + + }, { + key: "getAmp", + value: function getAmp() { + return this.output.gain.value; + } + /** + * Set frequency of an oscillator to a value. Or, pass in an object + * such as an oscillator to modulate the frequency with an audio signal. + * + * @method freq + * @for p5.Oscillator + * @param {Number|Object} Frequency Frequency in Hz + * or modulating signal/oscillator + * @param {Number} [rampTime] Ramp time (in seconds) + * @param {Number} [timeFromNow] Schedule this event to happen + * at x seconds from now + * @return {AudioParam} Frequency If no value is provided, + * returns the Web Audio API + * AudioParam that controls + * this oscillator's frequency + * @example + *
                          + * let osc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playOscillator); + * osc = new p5.Oscillator(300); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function playOscillator() { + * osc.start(); + * osc.amp(0.5); + * // start at 700Hz + * osc.freq(700); + * // ramp to 60Hz over 0.7 seconds + * osc.freq(60, 0.7); + * osc.amp(0, 0.1, 0.7); + * } + *
                          + */ + + }, { + key: "freq", + value: function freq(val) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (typeof val === 'number' && !isNaN(val)) { + this.f = val; + var now = main.audiocontext.currentTime; + + if (rampTime === 0) { + this.oscillator.frequency.setValueAtTime(val, tFromNow + now); + } else { + if (val > 0) { + this.oscillator.frequency.exponentialRampToValueAtTime(val, tFromNow + rampTime + now); + } else { + this.oscillator.frequency.linearRampToValueAtTime(val, tFromNow + rampTime + now); + } + } + + + if (this.phaseAmount) { + this.phase(this.phaseAmount); + } + } else if (val) { + if (val.output) { + val = val.output; + } + + val.connect(this.oscillator.frequency); + + this._freqMods.push(val); + } else { + return this.oscillator.frequency; + } + } + /** + * Returns the value of frequency of oscillator + * + * @method getFreq + * @for p5.Oscillator + * @returns {number} Frequency of oscillator in Hertz + */ + + }, { + key: "getFreq", + value: function getFreq() { + return this.oscillator.frequency.value; + } + /** + * Set type to 'sine', 'triangle', 'sawtooth' or 'square'. + * + * @method setType + * @for p5.Oscillator + * @param {String} type 'sine', 'triangle', 'sawtooth' or 'square'. + */ + + }, { + key: "setType", + value: function setType(type) { + this.oscillator.type = type; + } + /** + * Returns current type of oscillator eg. 'sine', 'triangle', 'sawtooth' or 'square'. + * + * @method getType + * @for p5.Oscillator + * @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'. + */ + + }, { + key: "getType", + value: function getType() { + return this.oscillator.type; + } + /** + * Connect to a p5.sound / Web Audio object. + * + * @method connect + * @for p5.Oscillator + * @param {Object} unit A p5.sound or Web Audio object + */ + + }, { + key: "connect", + value: function connect(unit) { + if (!unit) { + this.panner.connect(main.input); + } else if (unit.hasOwnProperty('input')) { + this.panner.connect(unit.input); + this.connection = unit.input; + } else { + this.panner.connect(unit); + this.connection = unit; + } + } + /** + * Disconnect all outputs + * + * @method disconnect + * @for p5.Oscillator + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + + if (this.panner) { + this.panner.disconnect(); + + if (this.output) { + this.output.connect(this.panner); + } + } + + this.oscMods = []; + } + /** + * Pan between Left (-1) and Right (1) + * + * @method pan + * @for p5.Oscillator + * @param {Number} panning Number between -1 and 1 + * @param {Number} timeFromNow schedule this event to happen + * seconds from now + */ + + }, { + key: "pan", + value: function pan(pval, tFromNow) { + this.panPosition = pval; + this.panner.pan(pval, tFromNow); + } + /** + * Returns the current value of panPosition , between Left (-1) and Right (1) + * + * @method getPan + * @for p5.Oscillator + * + * @returns {number} panPosition of oscillator , between Left (-1) and Right (1) + */ + + }, { + key: "getPan", + value: function getPan() { + return this.panPosition; + } + + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.oscillator) { + var now = main.audiocontext.currentTime; + this.stop(now); + this.disconnect(); + this.panner = null; + this.oscillator = null; + } + + + if (this.osc2) { + this.osc2.dispose(); + } + } + /** + * Set the phase of an oscillator between 0.0 and 1.0. + * In this implementation, phase is a delay time + * based on the oscillator's current frequency. + * + * @method phase + * @for p5.Oscillator + * @param {Number} phase float between 0.0 and 1.0 + */ + + }, { + key: "phase", + value: function phase(p) { + var delayAmt = p5.prototype.map(p, 0, 1.0, 0, 1 / this.f); + var now = main.audiocontext.currentTime; + this.phaseAmount = p; + + if (!this.dNode) { + this.dNode = main.audiocontext.createDelay(); + + this.oscillator.disconnect(); + this.oscillator.connect(this.dNode); + this.dNode.connect(this.output); + } + + + this.dNode.delayTime.setValueAtTime(delayAmt, now); + } + /** + * Add a value to the p5.Oscillator's output amplitude, + * and return the oscillator. Calling this method again + * will override the initial add() with a new value. + * + * @method add + * @for p5.Oscillator + * @param {Number} number Constant number to add + * @return {p5.Oscillator} Oscillator Returns this oscillator + * with scaled output + * + */ + + }, { + key: "add", + value: function add(num) { + var add = new Add_default.a(num); + var thisChain = this.mathOps.length - 1; + var nextChain = this.output; + return sigChain(this, add, thisChain, nextChain, Add_default.a); + } + /** + * Multiply the p5.Oscillator's output amplitude + * by a fixed value (i.e. turn it up!). Calling this method + * again will override the initial mult() with a new value. + * + * @method mult + * @for p5.Oscillator + * @param {Number} number Constant number to multiply + * @return {p5.Oscillator} Oscillator Returns this oscillator + * with multiplied output + */ + + }, { + key: "mult", + value: function mult(num) { + var mult = new Multiply_default.a(num); + var thisChain = this.mathOps.length - 1; + var nextChain = this.output; + return sigChain(this, mult, thisChain, nextChain, Multiply_default.a); + } + /** + * Scale this oscillator's amplitude values to a given + * range, and return the oscillator. Calling this method + * again will override the initial scale() with new values. + * + * @method scale + * @for p5.Oscillator + * @param {Number} inMin input range minumum + * @param {Number} inMax input range maximum + * @param {Number} outMin input range minumum + * @param {Number} outMax input range maximum + * @return {p5.Oscillator} Oscillator Returns this oscillator + * with scaled output + */ + + }, { + key: "scale", + value: function scale(inMin, inMax, outMin, outMax) { + var mapOutMin, mapOutMax; + + if (arguments.length === 4) { + mapOutMin = p5.prototype.map(outMin, inMin, inMax, 0, 1) - 0.5; + + mapOutMax = p5.prototype.map(outMax, inMin, inMax, 0, 1) - 0.5; + } else { + mapOutMin = arguments[0]; + mapOutMax = arguments[1]; + } + + var scale = new Scale_default.a(mapOutMin, mapOutMax); + var thisChain = this.mathOps.length - 1; + var nextChain = this.output; + return sigChain(this, scale, thisChain, nextChain, Scale_default.a); + } + }]); + + return Oscillator; +}(); + +/** + * Constructor: new p5.SinOsc(). + * This creates a Sine Wave Oscillator and is + * equivalent to new p5.Oscillator('sine') + * or creating a p5.Oscillator and then calling + * its method setType('sine'). + * See p5.Oscillator for methods. + * + * @class p5.SinOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + +var SinOsc = +function (_Oscillator) { + _inherits(SinOsc, _Oscillator); + + function SinOsc(freq) { + oscillator_classCallCheck(this, SinOsc); + + return _possibleConstructorReturn(this, _getPrototypeOf(SinOsc).call(this, freq, 'sine')); + } + + return SinOsc; +}(oscillator_Oscillator); +/** + * Constructor: new p5.TriOsc(). + * This creates a Triangle Wave Oscillator and is + * equivalent to new p5.Oscillator('triangle') + * or creating a p5.Oscillator and then calling + * its method setType('triangle'). + * See p5.Oscillator for methods. + * + * @class p5.TriOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + +var TriOsc = +function (_Oscillator2) { + _inherits(TriOsc, _Oscillator2); + + function TriOsc(freq) { + oscillator_classCallCheck(this, TriOsc); + + return _possibleConstructorReturn(this, _getPrototypeOf(TriOsc).call(this, freq, 'triangle')); + } + + return TriOsc; +}(oscillator_Oscillator); +/** + * Constructor: new p5.SawOsc(). + * This creates a SawTooth Wave Oscillator and is + * equivalent to new p5.Oscillator('sawtooth') + * or creating a p5.Oscillator and then calling + * its method setType('sawtooth'). + * See p5.Oscillator for methods. + * + * @class p5.SawOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + +var SawOsc = +function (_Oscillator3) { + _inherits(SawOsc, _Oscillator3); + + function SawOsc(freq) { + oscillator_classCallCheck(this, SawOsc); + + return _possibleConstructorReturn(this, _getPrototypeOf(SawOsc).call(this, freq, 'sawtooth')); + } + + return SawOsc; +}(oscillator_Oscillator); +/** + * Constructor: new p5.SqrOsc(). + * This creates a Square Wave Oscillator and is + * equivalent to new p5.Oscillator('square') + * or creating a p5.Oscillator and then calling + * its method setType('square'). + * See p5.Oscillator for methods. + * + * @class p5.SqrOsc + * @constructor + * @extends p5.Oscillator + * @param {Number} [freq] Set the frequency + */ + + +var SqrOsc = +function (_Oscillator4) { + _inherits(SqrOsc, _Oscillator4); + + function SqrOsc(freq) { + oscillator_classCallCheck(this, SqrOsc); + + return _possibleConstructorReturn(this, _getPrototypeOf(SqrOsc).call(this, freq, 'square')); + } + + return SqrOsc; +}(oscillator_Oscillator); + + var oscillator = (oscillator_Oscillator); + +var TimelineSignal = __webpack_require__(7); +var TimelineSignal_default = __webpack_require__.n(TimelineSignal); + + + + + + +/** + *

                          Envelopes are pre-defined amplitude distribution over time. + * Typically, envelopes are used to control the output volume + * of an object, a series of fades referred to as Attack, Decay, + * Sustain and Release ( + * ADSR + * ). Envelopes can also control other Web Audio Parameters—for example, a p5.Envelope can + * control an Oscillator's frequency like this: osc.freq(env).

                          + *

                          Use setRange to change the attack/release level. + * Use setADSR to change attackTime, decayTime, sustainPercent and releaseTime.

                          + *

                          Use the play method to play the entire envelope, + * the ramp method for a pingable trigger, + * or triggerAttack/ + * triggerRelease to trigger noteOn/noteOff.

                          + * + * @class p5.Envelope + * @constructor + * @example + *
                          + * let t1 = 0.1; // attack time in seconds + * let l1 = 0.7; // attack level 0.0 to 1.0 + * let t2 = 0.3; // decay time in seconds + * let l2 = 0.1; // decay level 0.0 to 1.0 + * + * let env; + * let triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * text('tap to play', 20, 20); + * cnv.mousePressed(playSound); + * + * env = new p5.Envelope(t1, l1, t2, l2); + * triOsc = new p5.Oscillator('triangle'); + * } + * + * function playSound() { + * // starting the oscillator ensures that audio is enabled. + * triOsc.start(); + * env.play(triOsc); + * } + *
                          + */ + +p5.Envelope = function (t1, l1, t2, l2, t3, l3) { + /** + * Time until envelope reaches attackLevel + * @property attackTime + */ + this.aTime = t1 || 0.1; + /** + * Level once attack is complete. + * @property attackLevel + */ + + this.aLevel = l1 || 1; + /** + * Time until envelope reaches decayLevel. + * @property decayTime + */ + + this.dTime = t2 || 0.5; + /** + * Level after decay. The envelope will sustain here until it is released. + * @property decayLevel + */ + + this.dLevel = l2 || 0; + /** + * Duration of the release portion of the envelope. + * @property releaseTime + */ + + this.rTime = t3 || 0; + /** + * Level at the end of the release. + * @property releaseLevel + */ + + this.rLevel = l3 || 0; + this._rampHighPercentage = 0.98; + this._rampLowPercentage = 0.02; + this.output = main.audiocontext.createGain(); + this.control = new TimelineSignal_default.a(); + + this._init(); + + + this.control.connect(this.output); + + this.connection = null; + + this.mathOps = [this.control]; + + this.isExponential = false; + + this.sourceToClear = null; + + this.wasTriggered = false; + + main.soundArray.push(this); +}; + + +p5.Envelope.prototype._init = function () { + var now = main.audiocontext.currentTime; + var t = now; + this.control.setTargetAtTime(0.00001, t, 0.001); + + this._setRampAD(this.aTime, this.dTime); +}; +/** + * Reset the envelope with a series of time/value pairs. + * + * @method set + * @for p5.Envelope + * @param {Number} attackTime Time (in seconds) before level + * reaches attackLevel + * @param {Number} attackLevel Typically an amplitude between + * 0.0 and 1.0 + * @param {Number} decayTime Time + * @param {Number} decayLevel Amplitude (In a standard ADSR envelope, + * decayLevel = sustainLevel) + * @param {Number} releaseTime Release Time (in seconds) + * @param {Number} releaseLevel Amplitude + * @example + *
                          + * let attackTime; + * let l1 = 0.7; // attack level 0.0 to 1.0 + * let t2 = 0.3; // decay time in seconds + * let l2 = 0.1; // decay level 0.0 to 1.0 + * let l3 = 0.2; // release time in seconds + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * + * attackTime = map(mouseX, 0, width, 0.0, 1.0); + * text('attack time: ' + attackTime, 5, height - 20); + * } + * + * // mouseClick triggers envelope if over canvas + * function playSound() { + * env.set(attackTime, l1, t2, l2, l3); + * + * triOsc.start(); + * env.play(triOsc); + * } + *
                          + * + */ + + +p5.Envelope.prototype.set = function (t1, l1, t2, l2, t3, l3) { + this.aTime = t1; + this.aLevel = l1; + this.dTime = t2 || 0; + this.dLevel = l2 || 0; + this.rTime = t3 || 0; + this.rLevel = l3 || 0; + + this._setRampAD(t1, t2); +}; +/** + * Set values like a traditional + * + * ADSR envelope + * . + * + * @method setADSR + * @for p5.Envelope + * @param {Number} attackTime Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + * @example + *
                          + * let attackLevel = 1.0; + * let releaseLevel = 0; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.2; + * let releaseTime = 0.5; + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playEnv); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.amp(env); + * triOsc.freq(220); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * attackTime = map(mouseX, 0, width, 0, 1.0); + * text('attack time: ' + attackTime, 5, height - 40); + * } + * + * function playEnv() { + * triOsc.start(); + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.play(); + * } + *
                          + */ + + +p5.Envelope.prototype.setADSR = function (aTime, dTime, sPercent, rTime) { + this.aTime = aTime; + this.dTime = dTime || 0; + + this.sPercent = sPercent || 0; + this.dLevel = typeof sPercent !== 'undefined' ? sPercent * (this.aLevel - this.rLevel) + this.rLevel : 0; + this.rTime = rTime || 0; + + this._setRampAD(aTime, dTime); +}; +/** + * Set max (attackLevel) and min (releaseLevel) of envelope. + * + * @method setRange + * @for p5.Envelope + * @param {Number} aLevel attack level (defaults to 1) + * @param {Number} rLevel release level (defaults to 0) + * @example + *
                          + * let attackLevel = 1.0; + * let releaseLevel = 0; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.2; + * let releaseTime = 0.5; + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playEnv); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.amp(env); + * triOsc.freq(220); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * attackLevel = map(mouseY, height, 0, 0, 1.0); + * text('attack level: ' + attackLevel, 5, height - 20); + * } + * + * function playEnv() { + * triOsc.start(); + * env.setRange(attackLevel, releaseLevel); + * env.play(); + * } + *
                          + */ + + +p5.Envelope.prototype.setRange = function (aLevel, rLevel) { + this.aLevel = aLevel || 1; + this.rLevel = rLevel || 0; +}; + + +p5.Envelope.prototype._setRampAD = function (t1, t2) { + this._rampAttackTime = this.checkExpInput(t1); + this._rampDecayTime = this.checkExpInput(t2); + var TCDenominator = 1.0; + + TCDenominator = Math.log(1.0 / this.checkExpInput(1.0 - this._rampHighPercentage)); + this._rampAttackTC = t1 / this.checkExpInput(TCDenominator); + TCDenominator = Math.log(1.0 / this._rampLowPercentage); + this._rampDecayTC = t2 / this.checkExpInput(TCDenominator); +}; + + +p5.Envelope.prototype.setRampPercentages = function (p1, p2) { + this._rampHighPercentage = this.checkExpInput(p1); + this._rampLowPercentage = this.checkExpInput(p2); + var TCDenominator = 1.0; + + TCDenominator = Math.log(1.0 / this.checkExpInput(1.0 - this._rampHighPercentage)); + this._rampAttackTC = this._rampAttackTime / this.checkExpInput(TCDenominator); + TCDenominator = Math.log(1.0 / this._rampLowPercentage); + this._rampDecayTC = this._rampDecayTime / this.checkExpInput(TCDenominator); +}; +/** + * Assign a parameter to be controlled by this envelope. + * If a p5.Sound object is given, then the p5.Envelope will control its + * output gain. If multiple inputs are provided, the env will + * control all of them. + * + * @method setInput + * @for p5.Envelope + * @param {Object} [...inputs] A p5.sound object or + * Web Audio Param. + */ + + +p5.Envelope.prototype.setInput = function () { + for (var i = 0; i < arguments.length; i++) { + this.connect(arguments[i]); + } +}; +/** + * Set whether the envelope ramp is linear (default) or exponential. + * Exponential ramps can be useful because we perceive amplitude + * and frequency logarithmically. + * + * @method setExp + * @for p5.Envelope + * @param {Boolean} isExp true is exponential, false is linear + */ + + +p5.Envelope.prototype.setExp = function (isExp) { + this.isExponential = isExp; +}; + + +p5.Envelope.prototype.checkExpInput = function (value) { + if (value <= 0) { + value = 0.00000001; + } + + return value; +}; +/** + *

                          Play tells the envelope to start acting on a given input. + * If the input is a p5.sound object (i.e. AudioIn, Oscillator, + * SoundFile), then Envelope will control its output volume. + * Envelopes can also be used to control any + * Web Audio Audio Param.

                          + * + * @method play + * @for p5.Envelope + * @param {Object} unit A p5.sound object or + * Web Audio Param. + * @param {Number} [startTime] time from now (in seconds) at which to play + * @param {Number} [sustainTime] time to sustain before releasing the envelope + * @example + *
                          + * let attackLevel = 1.0; + * let releaseLevel = 0; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.2; + * let releaseTime = 0.5; + * + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playEnv); + * + * env = new p5.Envelope(); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.amp(env); + * triOsc.freq(220); + * triOsc.start(); + * } + * + * function draw() { + * background(220); + * text('tap here to play', 5, 20); + * attackTime = map(mouseX, 0, width, 0, 1.0); + * attackLevel = map(mouseY, height, 0, 0, 1.0); + * text('attack time: ' + attackTime, 5, height - 40); + * text('attack level: ' + attackLevel, 5, height - 20); + * } + * + * function playEnv() { + * // ensure that audio is enabled + * userStartAudio(); + * + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.setRange(attackLevel, releaseLevel); + * env.play(); + * } + *
                          + */ + + +p5.Envelope.prototype.play = function (unit, secondsFromNow, susTime) { + var tFromNow = secondsFromNow || 0; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + this.triggerAttack(unit, tFromNow); + this.triggerRelease(unit, tFromNow + this.aTime + this.dTime + ~~susTime); +}; +/** + * Trigger the Attack, and Decay portion of the Envelope. + * Similar to holding down a key on a piano, but it will + * hold the sustain level until you let go. Input can be + * any p5.sound object, or a + * Web Audio Param. + * + * @method triggerAttack + * @for p5.Envelope + * @param {Object} unit p5.sound Object or Web Audio Param + * @param {Number} secondsFromNow time from now (in seconds) + * @example + *
                          + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.3; + * let releaseTime = 0.4; + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * textAlign(CENTER); + * textSize(10); + * text('tap to triggerAttack', width/2, height/2); + * + * env = new p5.Envelope(); + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.setRange(1.0, 0.0); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.freq(220); + * + * cnv.mousePressed(envAttack); + * } + * + * function envAttack() { + * background(0, 255, 255); + * text('release to release', width/2, height/2); + * + * // ensures audio is enabled. See also: `userStartAudio` + * triOsc.start(); + * + * env.triggerAttack(triOsc); + * } + * + * function mouseReleased() { + * background(220); + * text('tap to triggerAttack', width/2, height/2); + * + * env.triggerRelease(triOsc); + * } + *
                          + */ + + +p5.Envelope.prototype.triggerAttack = function (unit, secondsFromNow) { + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + this.lastAttack = t; + this.wasTriggered = true; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + + var valToSet = this.control.getValueAtTime(t); + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime(this.checkExpInput(valToSet), t); + } else { + this.control.linearRampToValueAtTime(valToSet, t); + } + + + t += this.aTime; + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime(this.checkExpInput(this.aLevel), t); + valToSet = this.checkExpInput(this.control.getValueAtTime(t)); + this.control.cancelScheduledValues(t); + this.control.exponentialRampToValueAtTime(valToSet, t); + } else { + this.control.linearRampToValueAtTime(this.aLevel, t); + valToSet = this.control.getValueAtTime(t); + this.control.cancelScheduledValues(t); + this.control.linearRampToValueAtTime(valToSet, t); + } + + + t += this.dTime; + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime(this.checkExpInput(this.dLevel), t); + valToSet = this.checkExpInput(this.control.getValueAtTime(t)); + this.control.cancelScheduledValues(t); + this.control.exponentialRampToValueAtTime(valToSet, t); + } else { + this.control.linearRampToValueAtTime(this.dLevel, t); + valToSet = this.control.getValueAtTime(t); + this.control.cancelScheduledValues(t); + this.control.linearRampToValueAtTime(valToSet, t); + } +}; +/** + * Trigger the Release of the Envelope. This is similar to releasing + * the key on a piano and letting the sound fade according to the + * release level and release time. + * + * @method triggerRelease + * @for p5.Envelope + * @param {Object} unit p5.sound Object or Web Audio Param + * @param {Number} secondsFromNow time to trigger the release + * @example + *
                          + * let attackTime = 0.001; + * let decayTime = 0.2; + * let susPercent = 0.3; + * let releaseTime = 0.4; + * let env, triOsc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * textAlign(CENTER); + * textSize(10); + * text('tap to triggerAttack', width/2, height/2); + * + * env = new p5.Envelope(); + * env.setADSR(attackTime, decayTime, susPercent, releaseTime); + * env.setRange(1.0, 0.0); + * triOsc = new p5.Oscillator('triangle'); + * triOsc.freq(220); + * + * cnv.mousePressed(envAttack); + * } + * + * function envAttack() { + * background(0, 255, 255); + * text('release to release', width/2, height/2); + * + * // ensures audio is enabled. See also: `userStartAudio` + * triOsc.start(); + * + * env.triggerAttack(triOsc); + * } + * + * function mouseReleased() { + * background(220); + * text('tap to triggerAttack', width/2, height/2); + * + * env.triggerRelease(triOsc); + * } + *
                          + */ + + +p5.Envelope.prototype.triggerRelease = function (unit, secondsFromNow) { + if (!this.wasTriggered) { + return; + } + + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + + var valToSet = this.control.getValueAtTime(t); + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime(this.checkExpInput(valToSet), t); + } else { + this.control.linearRampToValueAtTime(valToSet, t); + } + + + t += this.rTime; + + if (this.isExponential === true) { + this.control.exponentialRampToValueAtTime(this.checkExpInput(this.rLevel), t); + valToSet = this.checkExpInput(this.control.getValueAtTime(t)); + this.control.cancelScheduledValues(t); + this.control.exponentialRampToValueAtTime(valToSet, t); + } else { + this.control.linearRampToValueAtTime(this.rLevel, t); + valToSet = this.control.getValueAtTime(t); + this.control.cancelScheduledValues(t); + this.control.linearRampToValueAtTime(valToSet, t); + } + + this.wasTriggered = false; +}; +/** + * Exponentially ramp to a value using the first two + * values from setADSR(attackTime, decayTime) + * as + * time constants for simple exponential ramps. + * If the value is higher than current value, it uses attackTime, + * while a decrease uses decayTime. + * + * @method ramp + * @for p5.Envelope + * @param {Object} unit p5.sound Object or Web Audio Param + * @param {Number} secondsFromNow When to trigger the ramp + * @param {Number} v Target value + * @param {Number} [v2] Second target value + * @example + *
                          + * let env, osc, amp; + * + * let attackTime = 0.001; + * let decayTime = 0.2; + * let attackLevel = 1; + * let decayLevel = 0; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * fill(0,255,0); + * noStroke(); + * + * env = new p5.Envelope(); + * env.setADSR(attackTime, decayTime); + * osc = new p5.Oscillator(); + * osc.amp(env); + * amp = new p5.Amplitude(); + * + * cnv.mousePressed(triggerRamp); + * } + * + * function triggerRamp() { + * // ensures audio is enabled. See also: `userStartAudio` + * osc.start(); + * + * env.ramp(osc, 0, attackLevel, decayLevel); + * } + * + * function draw() { + * background(20); + * text('tap to play', 10, 20); + * let h = map(amp.getLevel(), 0, 0.4, 0, height);; + * rect(0, height, width, -h); + * } + *
                          + */ + + +p5.Envelope.prototype.ramp = function (unit, secondsFromNow, v1, v2) { + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + var destination1 = this.checkExpInput(v1); + var destination2 = typeof v2 !== 'undefined' ? this.checkExpInput(v2) : undefined; + + if (unit) { + if (this.connection !== unit) { + this.connect(unit); + } + } + + + var currentVal = this.checkExpInput(this.control.getValueAtTime(t)); + + if (destination1 > currentVal) { + this.control.setTargetAtTime(destination1, t, this._rampAttackTC); + t += this._rampAttackTime; + } + else if (destination1 < currentVal) { + this.control.setTargetAtTime(destination1, t, this._rampDecayTC); + t += this._rampDecayTime; + } + + + if (destination2 === undefined) return; + + if (destination2 > destination1) { + this.control.setTargetAtTime(destination2, t, this._rampAttackTC); + } + else if (destination2 < destination1) { + this.control.setTargetAtTime(destination2, t, this._rampDecayTC); + } +}; + +p5.Envelope.prototype.connect = function (unit) { + this.connection = unit; + + if (unit instanceof p5.Oscillator || unit instanceof p5.SoundFile || unit instanceof p5.AudioIn || unit instanceof p5.Reverb || unit instanceof p5.Noise || unit instanceof p5.Filter || unit instanceof p5.Delay) { + unit = unit.output.gain; + } + + if (unit instanceof AudioParam) { + unit.setValueAtTime(0, main.audiocontext.currentTime); + } + + this.output.connect(unit); +}; + +p5.Envelope.prototype.disconnect = function () { + if (this.output) { + this.output.disconnect(); + } +}; + +/** + * Add a value to the p5.Oscillator's output amplitude, + * and return the oscillator. Calling this method + * again will override the initial add() with new values. + * + * @method add + * @for p5.Envelope + * @param {Number} number Constant number to add + * @return {p5.Envelope} Envelope Returns this envelope + * with scaled output + */ + + +p5.Envelope.prototype.add = function (num) { + var add = new Add_default.a(num); + var thisChain = this.mathOps.length; + var nextChain = this.output; + return p5.prototype._mathChain(this, add, thisChain, nextChain, Add_default.a); +}; +/** + * Multiply the p5.Envelope's output amplitude + * by a fixed value. Calling this method + * again will override the initial mult() with new values. + * + * @method mult + * @for p5.Envelope + * @param {Number} number Constant number to multiply + * @return {p5.Envelope} Envelope Returns this envelope + * with scaled output + */ + + +p5.Envelope.prototype.mult = function (num) { + var mult = new Multiply_default.a(num); + var thisChain = this.mathOps.length; + var nextChain = this.output; + return p5.prototype._mathChain(this, mult, thisChain, nextChain, Multiply_default.a); +}; +/** + * Scale this envelope's amplitude values to a given + * range, and return the envelope. Calling this method + * again will override the initial scale() with new values. + * + * @method scale + * @for p5.Envelope + * @param {Number} inMin input range minumum + * @param {Number} inMax input range maximum + * @param {Number} outMin input range minumum + * @param {Number} outMax input range maximum + * @return {p5.Envelope} Envelope Returns this envelope + * with scaled output + */ + + +p5.Envelope.prototype.scale = function (inMin, inMax, outMin, outMax) { + var scale = new Scale_default.a(inMin, inMax, outMin, outMax); + var thisChain = this.mathOps.length; + var nextChain = this.output; + return p5.prototype._mathChain(this, scale, thisChain, nextChain, Scale_default.a); +}; + + +p5.Envelope.prototype.dispose = function () { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.disconnect(); + + if (this.control) { + this.control.dispose(); + this.control = null; + } + + for (var i = 1; i < this.mathOps.length; i++) { + this.mathOps[i].dispose(); + } +}; + + +p5.Env = function (t1, l1, t2, l2, t3, l3) { + console.warn('WARNING: p5.Env is now deprecated and may be removed in future versions. ' + 'Please use the new p5.Envelope instead.'); + p5.Envelope.call(this, t1, l1, t2, l2, t3, l3); +}; + +p5.Env.prototype = Object.create(p5.Envelope.prototype); +var Envelope = p5.Envelope; + var envelope = (Envelope); +function noise_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { noise_typeof = function _typeof(obj) { return typeof obj; }; } else { noise_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return noise_typeof(obj); } + +function noise_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function noise_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function noise_createClass(Constructor, protoProps, staticProps) { if (protoProps) noise_defineProperties(Constructor.prototype, protoProps); if (staticProps) noise_defineProperties(Constructor, staticProps); return Constructor; } + +function noise_possibleConstructorReturn(self, call) { if (call && (noise_typeof(call) === "object" || typeof call === "function")) { return call; } return noise_assertThisInitialized(self); } + +function noise_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function noise_getPrototypeOf(o) { noise_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return noise_getPrototypeOf(o); } + +function noise_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) noise_setPrototypeOf(subClass, superClass); } + +function noise_setPrototypeOf(o, p) { noise_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return noise_setPrototypeOf(o, p); } + + + +var _whiteNoiseBuffer = function () { + var bufferSize = 2 * main.audiocontext.sampleRate; + var whiteBuffer = main.audiocontext.createBuffer(1, bufferSize, main.audiocontext.sampleRate); + var noiseData = whiteBuffer.getChannelData(0); + + for (var i = 0; i < bufferSize; i++) { + noiseData[i] = Math.random() * 2 - 1; + } + + whiteBuffer.type = 'white'; + return whiteBuffer; +}(); + +var _pinkNoiseBuffer = function () { + var bufferSize = 2 * main.audiocontext.sampleRate; + var pinkBuffer = main.audiocontext.createBuffer(1, bufferSize, main.audiocontext.sampleRate); + var noiseData = pinkBuffer.getChannelData(0); + var b0, b1, b2, b3, b4, b5, b6; + b0 = b1 = b2 = b3 = b4 = b5 = b6 = 0.0; + + for (var i = 0; i < bufferSize; i++) { + var white = Math.random() * 2 - 1; + b0 = 0.99886 * b0 + white * 0.0555179; + b1 = 0.99332 * b1 + white * 0.0750759; + b2 = 0.969 * b2 + white * 0.153852; + b3 = 0.8665 * b3 + white * 0.3104856; + b4 = 0.55 * b4 + white * 0.5329522; + b5 = -0.7616 * b5 - white * 0.016898; + noiseData[i] = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362; + noiseData[i] *= 0.11; + + b6 = white * 0.115926; + } + + pinkBuffer.type = 'pink'; + return pinkBuffer; +}(); + +var _brownNoiseBuffer = function () { + var bufferSize = 2 * main.audiocontext.sampleRate; + var brownBuffer = main.audiocontext.createBuffer(1, bufferSize, main.audiocontext.sampleRate); + var noiseData = brownBuffer.getChannelData(0); + var lastOut = 0.0; + + for (var i = 0; i < bufferSize; i++) { + var white = Math.random() * 2 - 1; + noiseData[i] = (lastOut + 0.02 * white) / 1.02; + lastOut = noiseData[i]; + noiseData[i] *= 3.5; + } + + brownBuffer.type = 'brown'; + return brownBuffer; +}(); +/** + * Noise is a type of oscillator that generates a buffer with random values. + * + * @class p5.Noise + * @extends p5.Oscillator + * @constructor + * @param {String} type Type of noise can be 'white' (default), + * 'brown' or 'pink'. + */ + + +var noise_Noise = +function (_Oscillator) { + noise_inherits(Noise, _Oscillator); + + function Noise(type) { + var _this; + + noise_classCallCheck(this, Noise); + + _this = noise_possibleConstructorReturn(this, noise_getPrototypeOf(Noise).call(this)); + var assignType; + delete _this.f; + delete _this.freq; + delete _this.oscillator; + + if (type === 'brown') { + assignType = _brownNoiseBuffer; + } else if (type === 'pink') { + assignType = _pinkNoiseBuffer; + } else { + assignType = _whiteNoiseBuffer; + } + + _this.buffer = assignType; + return _this; + } + /** + * Set type of noise to 'white', 'pink' or 'brown'. + * White is the default. + * + * @method setType + * @param {String} [type] 'white', 'pink' or 'brown' + */ + + + noise_createClass(Noise, [{ + key: "setType", + value: function setType(type) { + switch (type) { + case 'white': + this.buffer = _whiteNoiseBuffer; + break; + + case 'pink': + this.buffer = _pinkNoiseBuffer; + break; + + case 'brown': + this.buffer = _brownNoiseBuffer; + break; + + default: + this.buffer = _whiteNoiseBuffer; + } + + if (this.started) { + var now = main.audiocontext.currentTime; + this.stop(now); + this.start(now + 0.01); + } + } + }, { + key: "getType", + value: function getType() { + return this.buffer.type; + } + }, { + key: "start", + value: function start() { + if (this.started) { + this.stop(); + } + + this.noise = main.audiocontext.createBufferSource(); + this.noise.buffer = this.buffer; + this.noise.loop = true; + this.noise.connect(this.output); + var now = main.audiocontext.currentTime; + this.noise.start(now); + this.started = true; + } + }, { + key: "stop", + value: function stop() { + var now = main.audiocontext.currentTime; + + if (this.noise) { + this.noise.stop(now); + this.started = false; + } + } + }, { + key: "dispose", + value: function dispose() { + var now = main.audiocontext.currentTime; + + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.noise) { + this.noise.disconnect(); + this.stop(now); + } + + if (this.output) { + this.output.disconnect(); + } + + if (this.panner) { + this.panner.disconnect(); + } + + this.output = null; + this.panner = null; + this.buffer = null; + this.noise = null; + } + }]); + + return Noise; +}(oscillator); + + var noise = (noise_Noise); +var Signal = __webpack_require__(2); +var Signal_default = __webpack_require__.n(Signal); + +function pulse_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { pulse_typeof = function _typeof(obj) { return typeof obj; }; } else { pulse_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return pulse_typeof(obj); } + +function pulse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function pulse_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function pulse_createClass(Constructor, protoProps, staticProps) { if (protoProps) pulse_defineProperties(Constructor.prototype, protoProps); if (staticProps) pulse_defineProperties(Constructor, staticProps); return Constructor; } + +function pulse_possibleConstructorReturn(self, call) { if (call && (pulse_typeof(call) === "object" || typeof call === "function")) { return call; } return pulse_assertThisInitialized(self); } + +function pulse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function pulse_getPrototypeOf(o) { pulse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return pulse_getPrototypeOf(o); } + +function pulse_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) pulse_setPrototypeOf(subClass, superClass); } + +function pulse_setPrototypeOf(o, p) { pulse_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return pulse_setPrototypeOf(o, p); } + + + + + +/** + * Creates a Pulse object, an oscillator that implements + * Pulse Width Modulation. + * The pulse is created with two oscillators. + * Accepts a parameter for frequency, and to set the + * width between the pulses. See + * p5.Oscillator for a full list of methods. + * + * @class p5.Pulse + * @extends p5.Oscillator + * @constructor + * @param {Number} [freq] Frequency in oscillations per second (Hz) + * @param {Number} [w] Width between the pulses (0 to 1.0, + * defaults to 0) + * @example + *
                          + * let pulse; + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(startPulse); + * background(220); + * + * pulse = new p5.Pulse(); + * pulse.amp(0.5); + * pulse.freq(220); + * } + * function startPulse() { + * pulse.start(); + * pulse.amp(0.5, 0.02); + * } + * function mouseReleased() { + * pulse.amp(0, 0.2); + * } + * function draw() { + * background(220); + * text('tap to play', 5, 20, width - 20); + * let w = map(mouseX, 0, width, 0, 1); + * w = constrain(w, 0, 1); + * pulse.width(w); + * text('pulse width: ' + w, 5, height - 20); + * } + *
                          + */ + +var pulse_Pulse = +function (_Oscillator) { + pulse_inherits(Pulse, _Oscillator); + + function Pulse(freq, w) { + var _this; + + pulse_classCallCheck(this, Pulse); + + _this = pulse_possibleConstructorReturn(this, pulse_getPrototypeOf(Pulse).call(this, freq, 'sawtooth')); + + _this.w = w || 0; + + _this.osc2 = new SawOsc(freq); + + _this.dNode = main.audiocontext.createDelay(); + + _this.dcOffset = createDCOffset(); + _this.dcGain = main.audiocontext.createGain(); + + _this.dcOffset.connect(_this.dcGain); + + _this.dcGain.connect(_this.output); + + + _this.f = freq || 440; + var mW = _this.w / _this.oscillator.frequency.value; + _this.dNode.delayTime.value = mW; + _this.dcGain.gain.value = 1.7 * (0.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); + + return _this; + } + /** + * Set the width of a Pulse object (an oscillator that implements + * Pulse Width Modulation). + * + * @method width + * @param {Number} [width] Width between the pulses (0 to 1.0, + * defaults to 0) + */ + + + pulse_createClass(Pulse, [{ + key: "width", + value: function width(w) { + if (typeof w === 'number') { + if (w <= 1.0 && w >= 0.0) { + this.w = w; + + var mW = this.w / this.oscillator.frequency.value; + this.dNode.delayTime.value = mW; + } + + this.dcGain.gain.value = 1.7 * (0.5 - this.w); + } else { + w.connect(this.dNode.delayTime); + var sig = new Signal_default.a(-0.5); + + w.connect(sig); + var mult1 = new Multiply_default.a(-1); + var mult2 = new Multiply_default.a(1.7); + sig = sig.connect(mult1).connect(mult2); + sig.connect(this.dcGain.gain); + } + } + }, { + key: "start", + value: function start(f, time) { + var now = main.audiocontext.currentTime; + var t = time || 0; + + if (!this.started) { + var freq = f || this.f; + var type = this.oscillator.type; + this.oscillator = main.audiocontext.createOscillator(); + this.oscillator.frequency.setValueAtTime(freq, now); + this.oscillator.type = type; + this.oscillator.connect(this.output); + this.oscillator.start(t + now); + + this.osc2.oscillator = main.audiocontext.createOscillator(); + this.osc2.oscillator.frequency.setValueAtTime(freq, t + now); + this.osc2.oscillator.type = type; + this.osc2.oscillator.connect(this.osc2.output); + this.osc2.start(t + now); + this.freqNode = [this.oscillator.frequency, this.osc2.oscillator.frequency]; + + this.dcOffset = createDCOffset(); + this.dcOffset.connect(this.dcGain); + this.dcOffset.start(t + now); + + if (this.mods !== undefined && this.mods.frequency !== undefined) { + this.mods.frequency.connect(this.freqNode[0]); + this.mods.frequency.connect(this.freqNode[1]); + } + + this.started = true; + this.osc2.started = true; + } + } + }, { + key: "stop", + value: function stop(time) { + if (this.started) { + var t = time || 0; + var now = main.audiocontext.currentTime; + this.oscillator.stop(t + now); + + if (this.osc2.oscillator) { + this.osc2.oscillator.stop(t + now); + } + + this.dcOffset.stop(t + now); + this.started = false; + this.osc2.started = false; + } + } + }, { + key: "freq", + value: function freq(val) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (typeof val === 'number') { + this.f = val; + var now = main.audiocontext.currentTime; + var currentFreq = this.oscillator.frequency.value; + this.oscillator.frequency.cancelScheduledValues(now); + this.oscillator.frequency.setValueAtTime(currentFreq, now + tFromNow); + this.oscillator.frequency.exponentialRampToValueAtTime(val, tFromNow + rampTime + now); + this.osc2.oscillator.frequency.cancelScheduledValues(now); + this.osc2.oscillator.frequency.setValueAtTime(currentFreq, now + tFromNow); + this.osc2.oscillator.frequency.exponentialRampToValueAtTime(val, tFromNow + rampTime + now); + + if (this.freqMod) { + this.freqMod.output.disconnect(); + this.freqMod = null; + } + } else if (val.output) { + val.output.disconnect(); + val.output.connect(this.oscillator.frequency); + val.output.connect(this.osc2.oscillator.frequency); + this.freqMod = val; + } + } + }]); + + return Pulse; +}(oscillator); + + +function createDCOffset() { + var ac = main.audiocontext; + var buffer = ac.createBuffer(1, 2048, ac.sampleRate); + var data = buffer.getChannelData(0); + + for (var i = 0; i < 2048; i++) { + data[i] = 1.0; + } + + var bufferSource = ac.createBufferSource(); + bufferSource.buffer = buffer; + bufferSource.loop = true; + return bufferSource; +} + + var pulse = (pulse_Pulse); +function audioin_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function audioin_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function audioin_createClass(Constructor, protoProps, staticProps) { if (protoProps) audioin_defineProperties(Constructor.prototype, protoProps); if (staticProps) audioin_defineProperties(Constructor, staticProps); return Constructor; } + + + +main.inputSources = []; +/** + *

                          Get audio from an input, i.e. your computer's microphone.

                          + * + *

                          Turn the mic on/off with the start() and stop() methods. When the mic + * is on, its volume can be measured with getLevel or by connecting an + * FFT object.

                          + * + *

                          If you want to hear the AudioIn, use the .connect() method. + * AudioIn does not connect to p5.sound output by default to prevent + * feedback.

                          + * + *

                          Note: This uses the getUserMedia/ + * Stream API, which is not supported by certain browsers. Access in Chrome browser + * is limited to localhost and https, but access over http may be limited.

                          + * + * @class p5.AudioIn + * @constructor + * @param {Function} [errorCallback] A function to call if there is an error + * accessing the AudioIn. For example, + * Safari and iOS devices do not + * currently allow microphone access. + * @example + *
                          + * let mic; + * + * function setup(){ + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(userStartAudio); + * textAlign(CENTER); + * mic = new p5.AudioIn(); + * mic.start(); + * } + * + * function draw(){ + * background(0); + * fill(255); + * text('tap to start', width/2, 20); + * + * micLevel = mic.getLevel(); + * let y = height - micLevel * height; + * ellipse(width/2, y, 10, 10); + * } + *
                          + */ + +var audioin_AudioIn = +function () { + function AudioIn(errorCallback) { + audioin_classCallCheck(this, AudioIn); + + + /** + * @property {GainNode} input + */ + this.input = main.audiocontext.createGain(); + /** + * @property {GainNode} output + */ + + this.output = main.audiocontext.createGain(); + /** + * @property {MediaStream|null} stream + */ + + this.stream = null; + /** + * @property {MediaStreamAudioSourceNode|null} mediaStream + */ + + this.mediaStream = null; + /** + * @property {Number|null} currentSource + */ + + this.currentSource = null; + /** + * Client must allow browser to access their microphone / audioin source. + * Default: false. Will become true when the client enables access. + * + * @property {Boolean} enabled + */ + + this.enabled = false; + /** + * Input amplitude, connect to it by default but not to master out + * + * @property {p5.Amplitude} amplitude + */ + + this.amplitude = new amplitude(); + this.output.connect(this.amplitude.input); + + if (!window.MediaStreamTrack || !window.navigator.mediaDevices || !window.navigator.mediaDevices.getUserMedia) { + errorCallback ? errorCallback() : window.alert('This browser does not support MediaStreamTrack and mediaDevices'); + } + + + main.soundArray.push(this); + } + /** + * Start processing audio input. This enables the use of other + * AudioIn methods like getLevel(). Note that by default, AudioIn + * is not connected to p5.sound's output. So you won't hear + * anything unless you use the connect() method.
                          + * + * Certain browsers limit access to the user's microphone. For example, + * Chrome only allows access from localhost and over https. For this reason, + * you may want to include an errorCallback—a function that is called in case + * the browser won't provide mic access. + * + * @method start + * @for p5.AudioIn + * @param {Function} [successCallback] Name of a function to call on + * success. + * @param {Function} [errorCallback] Name of a function to call if + * there was an error. For example, + * some browsers do not support + * getUserMedia. + */ + + + audioin_createClass(AudioIn, [{ + key: "start", + value: function start(successCallback, errorCallback) { + var self = this; + + if (this.stream) { + this.stop(); + } + + + var audioSource = main.inputSources[self.currentSource]; + var constraints = { + audio: { + sampleRate: main.audiocontext.sampleRate, + echoCancellation: false + } + }; + + if (main.inputSources[this.currentSource]) { + constraints.audio.deviceId = audioSource.deviceId; + } + + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + self.stream = stream; + self.enabled = true; + + self.mediaStream = main.audiocontext.createMediaStreamSource(stream); + self.mediaStream.connect(self.output); + + self.amplitude.setInput(self.output); + if (successCallback) successCallback(); + })["catch"](function (err) { + if (errorCallback) errorCallback(err);else console.error(err); + }); + } + /** + * Turn the AudioIn off. If the AudioIn is stopped, it cannot getLevel(). + * If re-starting, the user may be prompted for permission access. + * + * @method stop + * @for p5.AudioIn + */ + + }, { + key: "stop", + value: function stop() { + if (this.stream) { + this.stream.getTracks().forEach(function (track) { + track.stop(); + }); + this.mediaStream.disconnect(); + delete this.mediaStream; + delete this.stream; + } + } + /** + * Connect to an audio unit. If no parameter is provided, will + * connect to the main output (i.e. your speakers).
                          + * + * @method connect + * @for p5.AudioIn + * @param {Object} [unit] An object that accepts audio input, + * such as an FFT + */ + + }, { + key: "connect", + value: function connect(unit) { + if (unit) { + if (unit.hasOwnProperty('input')) { + this.output.connect(unit.input); + } else if (unit.hasOwnProperty('analyser')) { + this.output.connect(unit.analyser); + } else { + this.output.connect(unit); + } + } else { + this.output.connect(main.input); + } + } + /** + * Disconnect the AudioIn from all audio units. For example, if + * connect() had been called, disconnect() will stop sending + * signal to your speakers.
                          + * + * @method disconnect + * @for p5.AudioIn + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + + this.output.connect(this.amplitude.input); + } + } + /** + * Read the Amplitude (volume level) of an AudioIn. The AudioIn + * class contains its own instance of the Amplitude class to help + * make it easy to get a microphone's volume level. Accepts an + * optional smoothing value (0.0 < 1.0). NOTE: AudioIn must + * .start() before using .getLevel().
                          + * + * @method getLevel + * @for p5.AudioIn + * @param {Number} [smoothing] Smoothing is 0.0 by default. + * Smooths values based on previous values. + * @return {Number} Volume level (between 0.0 and 1.0) + */ + + }, { + key: "getLevel", + value: function getLevel(smoothing) { + if (smoothing) { + this.amplitude.smoothing = smoothing; + } + + return this.amplitude.getLevel(); + } + /** + * Set amplitude (volume) of a mic input between 0 and 1.0.
                          + * + * @method amp + * @for p5.AudioIn + * @param {Number} vol between 0 and 1.0 + * @param {Number} [time] ramp time (optional) + */ + + }, { + key: "amp", + value: function amp(vol, t) { + if (t) { + var rampTime = t || 0; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(main.audiocontext.currentTime); + this.output.gain.setValueAtTime(currentVol, main.audiocontext.currentTime); + this.output.gain.linearRampToValueAtTime(vol, rampTime + main.audiocontext.currentTime); + } else { + this.output.gain.cancelScheduledValues(main.audiocontext.currentTime); + this.output.gain.setValueAtTime(vol, main.audiocontext.currentTime); + } + } + /** + * Returns a list of available input sources. This is a wrapper + * for + * MediaDevices.enumerateDevices() - Web APIs | MDN + * and it returns a Promise. + * @method getSources + * @for p5.AudioIn + * @param {Function} [successCallback] This callback function handles the sources when they + * have been enumerated. The callback function + * receives the deviceList array as its only argument + * @param {Function} [errorCallback] This optional callback receives the error + * message as its argument. + * @returns {Promise} Returns a Promise that can be used in place of the callbacks, similar + * to the enumerateDevices() method + * @example + *
                          + * let audioIn; + * + * function setup(){ + * text('getting sources...', 0, 20); + * audioIn = new p5.AudioIn(); + * audioIn.getSources(gotSources); + * } + * + * function gotSources(deviceList) { + * if (deviceList.length > 0) { + * //set the source to the first item in the deviceList array + * audioIn.setSource(0); + * let currentSource = deviceList[audioIn.currentSource]; + * text('set source to: ' + currentSource.deviceId, 5, 20, width); + * } + * } + *
                          + */ + + }, { + key: "getSources", + value: function getSources(onSuccess, onError) { + return new Promise(function (resolve, reject) { + window.navigator.mediaDevices.enumerateDevices().then(function (devices) { + main.inputSources = devices.filter(function (device) { + return device.kind === 'audioinput'; + }); + resolve(main.inputSources); + + if (onSuccess) { + onSuccess(main.inputSources); + } + })["catch"](function (error) { + reject(error); + + if (onError) { + onError(error); + } else { + console.error('This browser does not support MediaStreamTrack.getSources()'); + } + }); + }); + } + /** + * Set the input source. Accepts a number representing a + * position in the array returned by getSources(). + * This is only available in browsers that support + * + * navigator.mediaDevices.enumerateDevices() + * + * @method setSource + * @for p5.AudioIn + * @param {number} num position of input source in the array + * @example + *
                          + * let audioIn; + * + * function setup(){ + * text('getting sources...', 0, 20); + * audioIn = new p5.AudioIn(); + * audioIn.getSources(gotSources); + * } + * + * function gotSources(deviceList) { + * if (deviceList.length > 0) { + * //set the source to the first item in the deviceList array + * audioIn.setSource(0); + * let currentSource = deviceList[audioIn.currentSource]; + * text('set source to: ' + currentSource.deviceId, 5, 20, width); + * } + * } + *
                          + */ + + }, { + key: "setSource", + value: function setSource(num) { + if (main.inputSources.length > 0 && num < main.inputSources.length) { + this.currentSource = num; + console.log('set source to ', main.inputSources[this.currentSource]); + } else { + console.log('unable to set input source'); + } + + + if (this.stream && this.stream.active) { + this.start(); + } + } + + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.stop(); + + if (this.output) { + this.output.disconnect(); + } + + if (this.amplitude) { + this.amplitude.disconnect(); + } + + delete this.amplitude; + delete this.output; + } + }]); + + return AudioIn; +}(); + + var audioin = (audioin_AudioIn); +var CrossFade = __webpack_require__(23); +var CrossFade_default = __webpack_require__.n(CrossFade); + +function effect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function effect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function effect_createClass(Constructor, protoProps, staticProps) { if (protoProps) effect_defineProperties(Constructor.prototype, protoProps); if (staticProps) effect_defineProperties(Constructor, staticProps); return Constructor; } + + + +/** + * Effect is a base class for audio effects in p5.
                          + * This module handles the nodes and methods that are + * common and useful for current and future effects. + * + * + * This class is extended by p5.Distortion, + * p5.Compressor, + * p5.Delay, + * p5.Filter, + * p5.Reverb. + * + * @class p5.Effect + * @constructor + * + * @param {Object} [ac] Reference to the audio context of the p5 object + * @param {AudioNode} [input] Gain Node effect wrapper + * @param {AudioNode} [output] Gain Node effect wrapper + * @param {Object} [_drywet] Tone.JS CrossFade node (defaults to value: 1) + * @param {AudioNode} [wet] Effects that extend this class should connect + * to the wet signal to this gain node, so that dry and wet + * signals are mixed properly. + */ + +var effect_Effect = +function () { + function Effect() { + effect_classCallCheck(this, Effect); + + this.ac = main.audiocontext; + this.input = this.ac.createGain(); + this.output = this.ac.createGain(); + /** + * The p5.Effect class is built + * using Tone.js CrossFade + * @private + */ + + this._drywet = new CrossFade_default.a(1); + /** + * In classes that extend + * p5.Effect, connect effect nodes + * to the wet parameter + */ + + this.wet = this.ac.createGain(); + this.input.connect(this._drywet.a); + this.wet.connect(this._drywet.b); + + this._drywet.connect(this.output); + + this.connect(); + + main.soundArray.push(this); + } + /** + * Set the output volume of the filter. + * + * @method amp + * @for p5.Effect + * @param {Number} [vol] amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts until rampTime + * @param {Number} [tFromNow] schedule this event to happen in tFromNow seconds + */ + + + effect_createClass(Effect, [{ + key: "amp", + value: function amp(vol) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var now = main.audiocontext.currentTime; + var startTime = now + tFromNow; + var endTime = startTime + rampTime + 0.001; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(now); + this.output.gain.linearRampToValueAtTime(currentVol, startTime + 0.001); + this.output.gain.linearRampToValueAtTime(vol, endTime); + } + /** + * Link effects together in a chain + * Example usage: filter.chain(reverb, delay, panner); + * May be used with an open-ended number of arguments + * + * @method chain + * @for p5.Effect + * @param {Object} [arguments] Chain together multiple sound objects + */ + + }, { + key: "chain", + value: function chain() { + if (arguments.length > 0) { + this.connect(arguments[0]); + + for (var i = 1; i < arguments.length; i += 1) { + arguments[i - 1].connect(arguments[i]); + } + } + + return this; + } + /** + * Adjust the dry/wet value. + * + * @method drywet + * @for p5.Effect + * @param {Number} [fade] The desired drywet value (0 - 1.0) + */ + + }, { + key: "drywet", + value: function drywet(fade) { + if (typeof fade !== 'undefined') { + this._drywet.fade.value = fade; + } + + return this._drywet.fade.value; + } + /** + * Send output to a p5.js-sound, Web Audio Node, or use signal to + * control an AudioParam + * + * @method connect + * @for p5.Effect + * @param {Object} unit + */ + + }, { + key: "connect", + value: function connect(unit) { + var u = unit || p5.soundOut.input; + this.output.connect(u.input ? u.input : u); + } + /** + * Disconnect all output. + * @method disconnect + * @for p5.Effect + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + } + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.input) { + this.input.disconnect(); + delete this.input; + } + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + + if (this._drywet) { + this._drywet.disconnect(); + + delete this._drywet; + } + + if (this.wet) { + this.wet.disconnect(); + delete this.wet; + } + + this.ac = undefined; + } + }]); + + return Effect; +}(); + + var effect = (effect_Effect); +function filter_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { filter_typeof = function _typeof(obj) { return typeof obj; }; } else { filter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return filter_typeof(obj); } + +function filter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function filter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function filter_createClass(Constructor, protoProps, staticProps) { if (protoProps) filter_defineProperties(Constructor.prototype, protoProps); if (staticProps) filter_defineProperties(Constructor, staticProps); return Constructor; } + +function filter_possibleConstructorReturn(self, call) { if (call && (filter_typeof(call) === "object" || typeof call === "function")) { return call; } return filter_assertThisInitialized(self); } + +function filter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } + +function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = filter_getPrototypeOf(object); if (object === null) break; } return object; } + +function filter_getPrototypeOf(o) { filter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return filter_getPrototypeOf(o); } + +function filter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) filter_setPrototypeOf(subClass, superClass); } + +function filter_setPrototypeOf(o, p) { filter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return filter_setPrototypeOf(o, p); } + + +/** + *

                          A p5.Filter uses a Web Audio Biquad Filter to filter + * the frequency response of an input source. Subclasses + * include:

                          + * p5.LowPass: + * Allows frequencies below the cutoff frequency to pass through, + * and attenuates frequencies above the cutoff.
                          + * p5.HighPass: + * The opposite of a lowpass filter.
                          + * p5.BandPass: + * Allows a range of frequencies to pass through and attenuates + * the frequencies below and above this frequency range.
                          + * + * The .res() method controls either width of the + * bandpass, or resonance of the low/highpass cutoff frequency. + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Filter + * @extends p5.Effect + * @constructor + * @param {String} [type] 'lowpass' (default), 'highpass', 'bandpass' + * @example + *
                          + * let fft, noise, filter; + * + * function setup() { + * let cnv = createCanvas(100,100); + * cnv.mousePressed(makeNoise); + * fill(255, 0, 255); + * + * filter = new p5.BandPass(); + * noise = new p5.Noise(); + * noise.disconnect(); + * noise.connect(filter); + * + * fft = new p5.FFT(); + * } + * + * function draw() { + * background(220); + * + * // set the BandPass frequency based on mouseX + * let freq = map(mouseX, 0, width, 20, 10000); + * freq = constrain(freq, 0, 22050); + * filter.freq(freq); + * // give the filter a narrow band (lower res = wider bandpass) + * filter.res(50); + * + * // draw filtered spectrum + * let spectrum = fft.analyze(); + * noStroke(); + * for (let i = 0; i < spectrum.length; i++) { + * let x = map(i, 0, spectrum.length, 0, width); + * let h = -height + map(spectrum[i], 0, 255, height, 0); + * rect(x, height, width/spectrum.length, h); + * } + * if (!noise.started) { + * text('tap here and drag to change frequency', 10, 20, width - 20); + * } else { + * text('Frequency: ' + round(freq)+'Hz', 20, 20, width - 20); + * } + * } + * + * function makeNoise() { + * // see also: `userStartAudio()` + * noise.start(); + * noise.amp(0.5, 0.2); + * } + * + * function mouseReleased() { + * noise.amp(0, 0.2); + * } + * + *
                          + */ + +var Filter = +function (_Effect) { + filter_inherits(Filter, _Effect); + + function Filter(type) { + var _this; + + filter_classCallCheck(this, Filter); + + _this = filter_possibleConstructorReturn(this, filter_getPrototypeOf(Filter).call(this)); + + /** + * The p5.Filter is built with a + * + * Web Audio BiquadFilter Node. + * + * @property {DelayNode} biquadFilter + */ + + _this.biquad = _this.ac.createBiquadFilter(); + + _this.input.connect(_this.biquad); + + _this.biquad.connect(_this.wet); + + if (type) { + _this.setType(type); + } + + + _this._on = true; + _this._untoggledType = _this.biquad.type; + return _this; + } + /** + * Filter an audio signal according to a set + * of filter parameters. + * + * @method process + * @param {Object} Signal An object that outputs audio + * @param {Number} [freq] Frequency in Hz, from 10 to 22050 + * @param {Number} [res] Resonance/Width of the filter frequency + * from 0.001 to 1000 + */ + + + filter_createClass(Filter, [{ + key: "process", + value: function process(src, freq, res, time) { + src.connect(this.input); + this.set(freq, res, time); + } + /** + * Set the frequency and the resonance of the filter. + * + * @method set + * @param {Number} [freq] Frequency in Hz, from 10 to 22050 + * @param {Number} [res] Resonance (Q) from 0.001 to 1000 + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + + }, { + key: "set", + value: function set(freq, res, time) { + if (freq) { + this.freq(freq, time); + } + + if (res) { + this.res(res, time); + } + } + /** + * Set the filter frequency, in Hz, from 10 to 22050 (the range of + * human hearing, although in reality most people hear in a narrower + * range). + * + * @method freq + * @param {Number} freq Filter Frequency + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @return {Number} value Returns the current frequency value + */ + + }, { + key: "freq", + value: function freq(_freq, time) { + var t = time || 0; + + if (_freq <= 0) { + _freq = 1; + } + + if (typeof _freq === 'number') { + this.biquad.frequency.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.biquad.frequency.exponentialRampToValueAtTime(_freq, this.ac.currentTime + 0.02 + t); + } else if (_freq) { + _freq.connect(this.biquad.frequency); + } + + return this.biquad.frequency.value; + } + /** + * Controls either width of a bandpass frequency, + * or the resonance of a low/highpass cutoff frequency. + * + * @method res + * @param {Number} res Resonance/Width of filter freq + * from 0.001 to 1000 + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + * @return {Number} value Returns the current res value + */ + + }, { + key: "res", + value: function res(_res, time) { + var t = time || 0; + + if (typeof _res === 'number') { + this.biquad.Q.value = _res; + this.biquad.Q.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.biquad.Q.linearRampToValueAtTime(_res, this.ac.currentTime + 0.02 + t); + } else if (_res) { + _res.connect(this.biquad.Q); + } + + return this.biquad.Q.value; + } + /** + * Controls the gain attribute of a Biquad Filter. + * This is distinctly different from .amp() which is inherited from p5.Effect + * .amp() controls the volume via the output gain node + * p5.Filter.gain() controls the gain parameter of a Biquad Filter node. + * + * @method gain + * @param {Number} gain + * @return {Number} Returns the current or updated gain value + */ + + }, { + key: "gain", + value: function gain(_gain, time) { + var t = time || 0; + + if (typeof _gain === 'number') { + this.biquad.gain.value = _gain; + this.biquad.gain.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.biquad.gain.linearRampToValueAtTime(_gain, this.ac.currentTime + 0.02 + t); + } else if (_gain) { + _gain.connect(this.biquad.gain); + } + + return this.biquad.gain.value; + } + /** + * Toggle function. Switches between the specified type and allpass + * + * @method toggle + * @return {boolean} [Toggle value] + */ + + }, { + key: "toggle", + value: function toggle() { + this._on = !this._on; + + if (this._on === true) { + this.biquad.type = this._untoggledType; + } else if (this._on === false) { + this.biquad.type = 'allpass'; + } + + return this._on; + } + /** + * Set the type of a p5.Filter. Possible types include: + * "lowpass" (default), "highpass", "bandpass", + * "lowshelf", "highshelf", "peaking", "notch", + * "allpass". + * + * @method setType + * @param {String} t + */ + + }, { + key: "setType", + value: function setType(t) { + this.biquad.type = t; + this._untoggledType = this.biquad.type; + } + }, { + key: "dispose", + value: function dispose() { + _get(filter_getPrototypeOf(Filter.prototype), "dispose", this).call(this); + + if (this.biquad) { + this.biquad.disconnect(); + delete this.biquad; + } + } + }]); + + return Filter; +}(effect); +/** + * Constructor: new p5.LowPass() Filter. + * This is the same as creating a p5.Filter and then calling + * its method setType('lowpass'). + * See p5.Filter for methods. + * + * @class p5.LowPass + * @constructor + * @extends p5.Filter + */ + + +var LowPass = +function (_Filter) { + filter_inherits(LowPass, _Filter); + + function LowPass() { + filter_classCallCheck(this, LowPass); + + return filter_possibleConstructorReturn(this, filter_getPrototypeOf(LowPass).call(this, 'lowpass')); + } + + return LowPass; +}(Filter); +/** + * Constructor: new p5.HighPass() Filter. + * This is the same as creating a p5.Filter and then calling + * its method setType('highpass'). + * See p5.Filter for methods. + * + * @class p5.HighPass + * @constructor + * @extends p5.Filter + */ + + +var HighPass = +function (_Filter2) { + filter_inherits(HighPass, _Filter2); + + function HighPass() { + filter_classCallCheck(this, HighPass); + + return filter_possibleConstructorReturn(this, filter_getPrototypeOf(HighPass).call(this, 'highpass')); + } + + return HighPass; +}(Filter); +/** + * Constructor: new p5.BandPass() Filter. + * This is the same as creating a p5.Filter and then calling + * its method setType('bandpass'). + * See p5.Filter for methods. + * + * @class p5.BandPass + * @constructor + * @extends p5.Filter + */ + + +var BandPass = +function (_Filter3) { + filter_inherits(BandPass, _Filter3); + + function BandPass() { + filter_classCallCheck(this, BandPass); + + return filter_possibleConstructorReturn(this, filter_getPrototypeOf(BandPass).call(this, 'bandpass')); + } + + return BandPass; +}(Filter); + + var filter = (Filter); + +function eqFilter_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { eqFilter_typeof = function _typeof(obj) { return typeof obj; }; } else { eqFilter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return eqFilter_typeof(obj); } + +function eqFilter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function eqFilter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function eqFilter_createClass(Constructor, protoProps, staticProps) { if (protoProps) eqFilter_defineProperties(Constructor.prototype, protoProps); if (staticProps) eqFilter_defineProperties(Constructor, staticProps); return Constructor; } + +function eqFilter_possibleConstructorReturn(self, call) { if (call && (eqFilter_typeof(call) === "object" || typeof call === "function")) { return call; } return eqFilter_assertThisInitialized(self); } + +function eqFilter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function eqFilter_getPrototypeOf(o) { eqFilter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return eqFilter_getPrototypeOf(o); } + +function eqFilter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) eqFilter_setPrototypeOf(subClass, superClass); } + +function eqFilter_setPrototypeOf(o, p) { eqFilter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return eqFilter_setPrototypeOf(o, p); } + + + +/** + * EQFilter extends p5.Filter with constraints + * necessary for the p5.EQ + * + * @private + */ + +var eqFilter_EQFilter = +function (_Filter) { + eqFilter_inherits(EQFilter, _Filter); + + function EQFilter(freq, res) { + var _this; + + eqFilter_classCallCheck(this, EQFilter); + + _this = eqFilter_possibleConstructorReturn(this, eqFilter_getPrototypeOf(EQFilter).call(this, 'peaking')); + + _this.disconnect(); + + _this.set(freq, res); + + _this.biquad.gain.value = 0; + delete _this.input; + delete _this.output; + delete _this._drywet; + delete _this.wet; + return _this; + } + + eqFilter_createClass(EQFilter, [{ + key: "amp", + value: function amp() { + console.warn('`amp()` is not available for p5.EQ bands. Use `.gain()`'); + } + }, { + key: "drywet", + value: function drywet() { + console.warn('`drywet()` is not available for p5.EQ bands.'); + } + }, { + key: "connect", + value: function connect(unit) { + var u = unit || p5.soundOut.input; + + if (this.biquad) { + this.biquad.connect(u.input ? u.input : u); + } else { + this.output.connect(u.input ? u.input : u); + } + } + }, { + key: "disconnect", + value: function disconnect() { + if (this.biquad) { + this.biquad.disconnect(); + } + } + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + this.disconnect(); + delete this.biquad; + } + }]); + + return EQFilter; +}(filter); + + var eqFilter = (eqFilter_EQFilter); +function eq_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { eq_typeof = function _typeof(obj) { return typeof obj; }; } else { eq_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return eq_typeof(obj); } + +function eq_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function eq_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function eq_createClass(Constructor, protoProps, staticProps) { if (protoProps) eq_defineProperties(Constructor.prototype, protoProps); if (staticProps) eq_defineProperties(Constructor, staticProps); return Constructor; } + +function eq_possibleConstructorReturn(self, call) { if (call && (eq_typeof(call) === "object" || typeof call === "function")) { return call; } return eq_assertThisInitialized(self); } + +function eq_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function eq_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { eq_get = Reflect.get; } else { eq_get = function _get(target, property, receiver) { var base = eq_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return eq_get(target, property, receiver || target); } + +function eq_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = eq_getPrototypeOf(object); if (object === null) break; } return object; } + +function eq_getPrototypeOf(o) { eq_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return eq_getPrototypeOf(o); } + +function eq_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) eq_setPrototypeOf(subClass, superClass); } + +function eq_setPrototypeOf(o, p) { eq_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return eq_setPrototypeOf(o, p); } + + + +/** + * p5.EQ is an audio effect that performs the function of a multiband + * audio equalizer. Equalization is used to adjust the balance of + * frequency compoenents of an audio signal. This process is commonly used + * in sound production and recording to change the waveform before it reaches + * a sound output device. EQ can also be used as an audio effect to create + * interesting distortions by filtering out parts of the spectrum. p5.EQ is + * built using a chain of Web Audio Biquad Filter Nodes and can be + * instantiated with 3 or 8 bands. Bands can be added or removed from + * the EQ by directly modifying p5.EQ.bands (the array that stores filters). + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.EQ + * @constructor + * @extends p5.Effect + * @param {Number} [_eqsize] Constructor will accept 3 or 8, defaults to 3 + * @return {Object} p5.EQ object + * + * @example + *
                          + * let eq, soundFile + * let eqBandIndex = 0; + * let eqBandNames = ['lows', 'mids', 'highs']; + * + * function preload() { + * soundFormats('mp3', 'ogg'); + * soundFile = loadSound('assets/beat'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(toggleSound); + * + * eq = new p5.EQ(eqBandNames.length); + * soundFile.disconnect(); + * eq.process(soundFile); + * } + * + * function draw() { + * background(30); + * noStroke(); + * fill(255); + * textAlign(CENTER); + * text('filtering ', 50, 25); + * + * fill(255, 40, 255); + * textSize(26); + * text(eqBandNames[eqBandIndex], 50, 55); + * + * fill(255); + * textSize(9); + * + * if (!soundFile.isPlaying()) { + * text('tap to play', 50, 80); + * } else { + * text('tap to filter next band', 50, 80) + * } + * } + * + * function toggleSound() { + * if (!soundFile.isPlaying()) { + * soundFile.play(); + * } else { + * eqBandIndex = (eqBandIndex + 1) % eq.bands.length; + * } + * + * for (let i = 0; i < eq.bands.length; i++) { + * eq.bands[i].gain(0); + * } + * // filter the band we want to filter + * eq.bands[eqBandIndex].gain(-40); + * } + *
                          + */ + +var eq_EQ = +function (_Effect) { + eq_inherits(EQ, _Effect); + + function EQ(_eqsize) { + var _this; + + eq_classCallCheck(this, EQ); + + _this = eq_possibleConstructorReturn(this, eq_getPrototypeOf(EQ).call(this)); + + _eqsize = _eqsize === 3 || _eqsize === 8 ? _eqsize : 3; + var factor; + _eqsize === 3 ? factor = Math.pow(2, 3) : factor = 2; + /** + * The p5.EQ is built with abstracted p5.Filter objects. + * To modify any bands, use methods of the + * p5.Filter API, especially `gain` and `freq`. + * Bands are stored in an array, with indices 0 - 3, or 0 - 7 + * @property {Array} bands + * + */ + + _this.bands = []; + var freq, res; + + for (var i = 0; i < _eqsize; i++) { + if (i === _eqsize - 1) { + freq = 21000; + res = 0.01; + } else if (i === 0) { + freq = 100; + res = 0.1; + } else if (i === 1) { + freq = _eqsize === 3 ? 360 * factor : 360; + res = 1; + } else { + freq = _this.bands[i - 1].freq() * factor; + res = 1; + } + + _this.bands[i] = _this._newBand(freq, res); + + if (i > 0) { + _this.bands[i - 1].connect(_this.bands[i].biquad); + } else { + _this.input.connect(_this.bands[i].biquad); + } + } + + _this.bands[_eqsize - 1].connect(_this.output); + + return _this; + } + /** + * Process an input by connecting it to the EQ + * @method process + * @param {Object} src Audio source + */ + + + eq_createClass(EQ, [{ + key: "process", + value: function process(src) { + src.connect(this.input); + } + // * Set the frequency and gain of each band in the EQ. This method should be + // * called with 3 or 8 frequency and gain pairs, depending on the size of the EQ. + // * ex. eq.set(freq0, gain0, freq1, gain1, freq2, gain2); + // * + // * @method set + // * @for p5.EQ + // * @param {Number} [freq0] Frequency value for band with index 0 + // * @param {Number} [gain0] Gain value for band with index 0 + // * @param {Number} [freq1] Frequency value for band with index 1 + // * @param {Number} [gain1] Gain value for band with index 1 + // * @param {Number} [freq2] Frequency value for band with index 2 + // * @param {Number} [gain2] Gain value for band with index 2 + // * @param {Number} [freq3] Frequency value for band with index 3 + // * @param {Number} [gain3] Gain value for band with index 3 + // * @param {Number} [freq4] Frequency value for band with index 4 + // * @param {Number} [gain4] Gain value for band with index 4 + // * @param {Number} [freq5] Frequency value for band with index 5 + // * @param {Number} [gain5] Gain value for band with index 5 + // * @param {Number} [freq6] Frequency value for band with index 6 + // * @param {Number} [gain6] Gain value for band with index 6 + // * @param {Number} [freq7] Frequency value for band with index 7 + // * @param {Number} [gain7] Gain value for band with index 7 + // */ + + }, { + key: "set", + value: function set() { + if (arguments.length === this.bands.length * 2) { + for (var i = 0; i < arguments.length; i += 2) { + this.bands[i / 2].freq(arguments[i]); + this.bands[i / 2].gain(arguments[i + 1]); + } + } else { + console.error('Argument mismatch. .set() should be called with ' + this.bands.length * 2 + ' arguments. (one frequency and gain value pair for each band of the eq)'); + } + } + /** + * Add a new band. Creates a p5.Filter and strips away everything but + * the raw biquad filter. This method returns an abstracted p5.Filter, + * which can be added to p5.EQ.bands, in order to create new EQ bands. + * @private + * @for p5.EQ + * @method _newBand + * @param {Number} freq + * @param {Number} res + * @return {Object} Abstracted Filter + */ + + }, { + key: "_newBand", + value: function _newBand(freq, res) { + return new eqFilter(freq, res); + } + }, { + key: "dispose", + value: function dispose() { + eq_get(eq_getPrototypeOf(EQ.prototype), "dispose", this).call(this); + + if (this.bands) { + while (this.bands.length > 0) { + delete this.bands.pop().dispose(); + } + + delete this.bands; + } + } + }]); + + return EQ; +}(effect); + + var eq = (eq_EQ); +function listener3d_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function listener3d_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function listener3d_createClass(Constructor, protoProps, staticProps) { if (protoProps) listener3d_defineProperties(Constructor.prototype, protoProps); if (staticProps) listener3d_defineProperties(Constructor, staticProps); return Constructor; } + +// * listener is a class that can construct both a Spatial Panner +// * and a Spatial Listener. The panner is based on the +// * Web Audio Spatial Panner Node +// * https://www.w3.org/TR/webaudio/#the-listenernode-interface +// * This panner is a spatial processing node that allows audio to be positioned +// * and oriented in 3D space. +// * +// * The Listener modifies the properties of the Audio Context Listener. +// * Both objects types use the same methods. The default is a spatial panner. +// * +// * p5.Panner3D - Constructs a Spatial Panner
                          +// * p5.Listener3D - Constructs a Spatial Listener
                          +// * +// * @class listener +// * @constructor +// * @return {Object} p5.Listener3D Object +// * +// * @param {Web Audio Node} listener Web Audio Spatial Panning Node +// * @param {AudioParam} listener.panningModel "equal power" or "HRTF" +// * @param {AudioParam} listener.distanceModel "linear", "inverse", or "exponential" +// * @param {String} [type] [Specify construction of a spatial panner or listener] +// */ + +var listener3d_Listener3D = +function () { + function Listener3D(type) { + listener3d_classCallCheck(this, Listener3D); + + this.ac = main.audiocontext; + this.listener = this.ac.listener; + } + // * Connect an audio sorce + // * @param {Object} src Input source + // */ + + + listener3d_createClass(Listener3D, [{ + key: "process", + value: function process(src) { + src.connect(this.input); + } + // * Set the X,Y,Z position of the Panner + // * @param {[Number]} xVal + // * @param {[Number]} yVal + // * @param {[Number]} zVal + // * @param {[Number]} time + // * @return {[Array]} [Updated x, y, z values as an array] + // */ + + }, { + key: "position", + value: function position(xVal, yVal, zVal, time) { + this.positionX(xVal, time); + this.positionY(yVal, time); + this.positionZ(zVal, time); + return [this.listener.positionX.value, this.listener.positionY.value, this.listener.positionZ.value]; + } + // * Getter and setter methods for position coordinates + // * @return {Number} [updated coordinate value] + // */ + + }, { + key: "positionX", + value: function positionX(xVal, time) { + var t = time || 0; + + if (typeof xVal === 'number') { + this.listener.positionX.value = xVal; + this.listener.positionX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.positionX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); + } else if (xVal) { + xVal.connect(this.listener.positionX); + } + + return this.listener.positionX.value; + } + }, { + key: "positionY", + value: function positionY(yVal, time) { + var t = time || 0; + + if (typeof yVal === 'number') { + this.listener.positionY.value = yVal; + this.listener.positionY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.positionY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); + } else if (yVal) { + yVal.connect(this.listener.positionY); + } + + return this.listener.positionY.value; + } + }, { + key: "positionZ", + value: function positionZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === 'number') { + this.listener.positionZ.value = zVal; + this.listener.positionZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.positionZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); + } else if (zVal) { + zVal.connect(this.listener.positionZ); + } + + return this.listener.positionZ.value; + } + // * Overrides the listener orient() method because Listener has slightly + // * different params. In human terms, Forward vectors are the direction the + // * nose is pointing. Up vectors are the direction of the top of the head. + // * + // * @method orient + // * @param {Number} xValF Forward vector X direction + // * @param {Number} yValF Forward vector Y direction + // * @param {Number} zValF Forward vector Z direction + // * @param {Number} xValU Up vector X direction + // * @param {Number} yValU Up vector Y direction + // * @param {Number} zValU Up vector Z direction + // * @param {Number} time + // * @return {Array} All orienation params + // */ + + }, { + key: "orient", + value: function orient(xValF, yValF, zValF, xValU, yValU, zValU, time) { + if (arguments.length === 3 || arguments.length === 4) { + time = arguments[3]; + this.orientForward(xValF, yValF, zValF, time); + } else if (arguments.length === 6 || arguments === 7) { + this.orientForward(xValF, yValF, zValF); + this.orientUp(xValU, yValU, zValU, time); + } + + return [this.listener.forwardX.value, this.listener.forwardY.value, this.listener.forwardZ.value, this.listener.upX.value, this.listener.upY.value, this.listener.upZ.value]; + } + }, { + key: "orientForward", + value: function orientForward(xValF, yValF, zValF, time) { + this.forwardX(xValF, time); + this.forwardY(yValF, time); + this.forwardZ(zValF, time); + return [this.listener.forwardX, this.listener.forwardY, this.listener.forwardZ]; + } + }, { + key: "orientUp", + value: function orientUp(xValU, yValU, zValU, time) { + this.upX(xValU, time); + this.upY(yValU, time); + this.upZ(zValU, time); + return [this.listener.upX, this.listener.upY, this.listener.upZ]; + } + // * Getter and setter methods for orient coordinates + // * @return {Number} [updated coordinate value] + // */ + + }, { + key: "forwardX", + value: function forwardX(xVal, time) { + var t = time || 0; + + if (typeof xVal === 'number') { + this.listener.forwardX.value = xVal; + this.listener.forwardX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.forwardX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); + } else if (xVal) { + xVal.connect(this.listener.forwardX); + } + + return this.listener.forwardX.value; + } + }, { + key: "forwardY", + value: function forwardY(yVal, time) { + var t = time || 0; + + if (typeof yVal === 'number') { + this.listener.forwardY.value = yVal; + this.listener.forwardY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.forwardY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); + } else if (yVal) { + yVal.connect(this.listener.forwardY); + } + + return this.listener.forwardY.value; + } + }, { + key: "forwardZ", + value: function forwardZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === 'number') { + this.listener.forwardZ.value = zVal; + this.listener.forwardZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.forwardZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); + } else if (zVal) { + zVal.connect(this.listener.forwardZ); + } + + return this.listener.forwardZ.value; + } + }, { + key: "upX", + value: function upX(xVal, time) { + var t = time || 0; + + if (typeof xVal === 'number') { + this.listener.upX.value = xVal; + this.listener.upX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.upX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); + } else if (xVal) { + xVal.connect(this.listener.upX); + } + + return this.listener.upX.value; + } + }, { + key: "upY", + value: function upY(yVal, time) { + var t = time || 0; + + if (typeof yVal === 'number') { + this.listener.upY.value = yVal; + this.listener.upY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.upY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); + } else if (yVal) { + yVal.connect(this.listener.upY); + } + + return this.listener.upY.value; + } + }, { + key: "upZ", + value: function upZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === 'number') { + this.listener.upZ.value = zVal; + this.listener.upZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.listener.upZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); + } else if (zVal) { + zVal.connect(this.listener.upZ); + } + + return this.listener.upZ.value; + } + }]); + + return Listener3D; +}(); + + var listener3d = (listener3d_Listener3D); +function panner3d_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { panner3d_typeof = function _typeof(obj) { return typeof obj; }; } else { panner3d_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return panner3d_typeof(obj); } + +function panner3d_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function panner3d_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function panner3d_createClass(Constructor, protoProps, staticProps) { if (protoProps) panner3d_defineProperties(Constructor.prototype, protoProps); if (staticProps) panner3d_defineProperties(Constructor, staticProps); return Constructor; } + +function panner3d_possibleConstructorReturn(self, call) { if (call && (panner3d_typeof(call) === "object" || typeof call === "function")) { return call; } return panner3d_assertThisInitialized(self); } + +function panner3d_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function panner3d_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { panner3d_get = Reflect.get; } else { panner3d_get = function _get(target, property, receiver) { var base = panner3d_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return panner3d_get(target, property, receiver || target); } + +function panner3d_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = panner3d_getPrototypeOf(object); if (object === null) break; } return object; } + +function panner3d_getPrototypeOf(o) { panner3d_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return panner3d_getPrototypeOf(o); } + +function panner3d_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) panner3d_setPrototypeOf(subClass, superClass); } + +function panner3d_setPrototypeOf(o, p) { panner3d_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return panner3d_setPrototypeOf(o, p); } + + +/** + * Panner3D is based on the + * Web Audio Spatial Panner Node. + * This panner is a spatial processing node that allows audio to be positioned + * and oriented in 3D space. + * + * The position is relative to an + * Audio Context Listener, which can be accessed + * by p5.soundOut.audiocontext.listener + * + * + * @class p5.Panner3D + * @constructor + */ + +var Panner3D = +function (_Effect) { + panner3d_inherits(Panner3D, _Effect); + + function Panner3D() { + var _this; + + panner3d_classCallCheck(this, Panner3D); + + _this = panner3d_possibleConstructorReturn(this, panner3d_getPrototypeOf(Panner3D).call(this)); + /** + * + * Web Audio Spatial Panner Node + * + * Properties include
                          + * [Panning Model](https://www.w3.org/TR/webaudio/#idl-def-PanningModelType) + * : "equal power" or "HRTF"
                          + * [DistanceModel](https://www.w3.org/TR/webaudio/#idl-def-DistanceModelType) + * : "linear", "inverse", or "exponential" + * + * @property {AudioNode} panner + * + */ + + _this.panner = _this.ac.createPanner(); + _this.panner.panningModel = 'HRTF'; + _this.panner.distanceModel = 'linear'; + + _this.panner.connect(_this.output); + + _this.input.connect(_this.panner); + + return _this; + } + /** + * Connect an audio sorce + * + * @method process + * @for p5.Panner3D + * @param {Object} src Input source + */ + + + panner3d_createClass(Panner3D, [{ + key: "process", + value: function process(src) { + src.connect(this.input); + } + /** + * Set the X,Y,Z position of the Panner + * @method set + * @for p5.Panner3D + * @param {Number} xVal + * @param {Number} yVal + * @param {Number} zVal + * @param {Number} time + * @return {Array} Updated x, y, z values as an array + */ + + }, { + key: "set", + value: function set(xVal, yVal, zVal, time) { + this.positionX(xVal, time); + this.positionY(yVal, time); + this.positionZ(zVal, time); + return [this.panner.positionX.value, this.panner.positionY.value, this.panner.positionZ.value]; + } + /** + * Getter and setter methods for position coordinates + * @method positionX + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for position coordinates + * @method positionY + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for position coordinates + * @method positionZ + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + }, { + key: "positionX", + value: function positionX(xVal, time) { + var t = time || 0; + + if (typeof xVal === 'number') { + this.panner.positionX.value = xVal; + this.panner.positionX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.panner.positionX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); + } else if (xVal) { + xVal.connect(this.panner.positionX); + } + + return this.panner.positionX.value; + } + }, { + key: "positionY", + value: function positionY(yVal, time) { + var t = time || 0; + + if (typeof yVal === 'number') { + this.panner.positionY.value = yVal; + this.panner.positionY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.panner.positionY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); + } else if (yVal) { + yVal.connect(this.panner.positionY); + } + + return this.panner.positionY.value; + } + }, { + key: "positionZ", + value: function positionZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === 'number') { + this.panner.positionZ.value = zVal; + this.panner.positionZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.panner.positionZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); + } else if (zVal) { + zVal.connect(this.panner.positionZ); + } + + return this.panner.positionZ.value; + } + /** + * Set the X,Y,Z position of the Panner + * @method orient + * @for p5.Panner3D + * @param {Number} xVal + * @param {Number} yVal + * @param {Number} zVal + * @param {Number} time + * @return {Array} Updated x, y, z values as an array + */ + + }, { + key: "orient", + value: function orient(xVal, yVal, zVal, time) { + this.orientX(xVal, time); + this.orientY(yVal, time); + this.orientZ(zVal, time); + return [this.panner.orientationX.value, this.panner.orientationY.value, this.panner.orientationZ.value]; + } + /** + * Getter and setter methods for orient coordinates + * @method orientX + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for orient coordinates + * @method orientY + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + /** + * Getter and setter methods for orient coordinates + * @method orientZ + * @for p5.Panner3D + * @return {Number} updated coordinate value + */ + + }, { + key: "orientX", + value: function orientX(xVal, time) { + var t = time || 0; + + if (typeof xVal === 'number') { + this.panner.orientationX.value = xVal; + this.panner.orientationX.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.panner.orientationX.linearRampToValueAtTime(xVal, this.ac.currentTime + 0.02 + t); + } else if (xVal) { + xVal.connect(this.panner.orientationX); + } + + return this.panner.orientationX.value; + } + }, { + key: "orientY", + value: function orientY(yVal, time) { + var t = time || 0; + + if (typeof yVal === 'number') { + this.panner.orientationY.value = yVal; + this.panner.orientationY.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.panner.orientationY.linearRampToValueAtTime(yVal, this.ac.currentTime + 0.02 + t); + } else if (yVal) { + yVal.connect(this.panner.orientationY); + } + + return this.panner.orientationY.value; + } + }, { + key: "orientZ", + value: function orientZ(zVal, time) { + var t = time || 0; + + if (typeof zVal === 'number') { + this.panner.orientationZ.value = zVal; + this.panner.orientationZ.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.panner.orientationZ.linearRampToValueAtTime(zVal, this.ac.currentTime + 0.02 + t); + } else if (zVal) { + zVal.connect(this.panner.orientationZ); + } + + return this.panner.orientationZ.value; + } + /** + * Set the rolloff factor and max distance + * @method setFalloff + * @for p5.Panner3D + * @param {Number} [maxDistance] + * @param {Number} [rolloffFactor] + */ + + }, { + key: "setFalloff", + value: function setFalloff(maxDistance, rolloffFactor) { + this.maxDist(maxDistance); + this.rolloff(rolloffFactor); + } + /** + * Maxium distance between the source and the listener + * @method maxDist + * @for p5.Panner3D + * @param {Number} maxDistance + * @return {Number} updated value + */ + + }, { + key: "maxDist", + value: function maxDist(maxDistance) { + if (typeof maxDistance === 'number') { + this.panner.maxDistance = maxDistance; + } + + return this.panner.maxDistance; + } + /** + * How quickly the volume is reduced as the source moves away from the listener + * @method rollof + * @for p5.Panner3D + * @param {Number} rolloffFactor + * @return {Number} updated value + */ + + }, { + key: "rolloff", + value: function rolloff(rolloffFactor) { + if (typeof rolloffFactor === 'number') { + this.panner.rolloffFactor = rolloffFactor; + } + + return this.panner.rolloffFactor; + } + }, { + key: "dispose", + value: function dispose() { + panner3d_get(panner3d_getPrototypeOf(Panner3D.prototype), "dispose", this).call(this); + + if (this.panner) { + this.panner.disconnect(); + delete this.panner; + } + } + }]); + + return Panner3D; +}(effect); + + var panner3d = (Panner3D); +function delay_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { delay_typeof = function _typeof(obj) { return typeof obj; }; } else { delay_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return delay_typeof(obj); } + +function delay_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function delay_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function delay_createClass(Constructor, protoProps, staticProps) { if (protoProps) delay_defineProperties(Constructor.prototype, protoProps); if (staticProps) delay_defineProperties(Constructor, staticProps); return Constructor; } + +function delay_possibleConstructorReturn(self, call) { if (call && (delay_typeof(call) === "object" || typeof call === "function")) { return call; } return delay_assertThisInitialized(self); } + +function delay_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function delay_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { delay_get = Reflect.get; } else { delay_get = function _get(target, property, receiver) { var base = delay_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return delay_get(target, property, receiver || target); } + +function delay_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = delay_getPrototypeOf(object); if (object === null) break; } return object; } + +function delay_getPrototypeOf(o) { delay_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return delay_getPrototypeOf(o); } + +function delay_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) delay_setPrototypeOf(subClass, superClass); } + +function delay_setPrototypeOf(o, p) { delay_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return delay_setPrototypeOf(o, p); } + + + +/** + * Delay is an echo effect. It processes an existing sound source, + * and outputs a delayed version of that sound. The p5.Delay can + * produce different effects depending on the delayTime, feedback, + * filter, and type. In the example below, a feedback of 0.5 (the + * default value) will produce a looping delay that decreases in + * volume by 50% each repeat. A filter will cut out the high + * frequencies so that the delay does not sound as piercing as the + * original source. + * + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * @class p5.Delay + * @extends p5.Effect + * @constructor + * @example + *
                          + * let osc; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(220); + * textAlign(CENTER); + * text('tap to play', width/2, height/2); + * + * osc = new p5.Oscillator('square'); + * osc.amp(0.5); + * delay = new p5.Delay(); + * + * // delay.process() accepts 4 parameters: + * // source, delayTime (in seconds), feedback, filter frequency + * delay.process(osc, 0.12, .7, 2300); + * + * cnv.mousePressed(oscStart); + * } + * + * function oscStart() { + * osc.start(); + * } + * + * function mouseReleased() { + * osc.stop(); + * } + *
                          + */ + +var delay_Delay = +function (_Effect) { + delay_inherits(Delay, _Effect); + + function Delay() { + var _this; + + delay_classCallCheck(this, Delay); + + _this = delay_possibleConstructorReturn(this, delay_getPrototypeOf(Delay).call(this)); + _this._split = _this.ac.createChannelSplitter(2); + _this._merge = _this.ac.createChannelMerger(2); + _this._leftGain = _this.ac.createGain(); + _this._rightGain = _this.ac.createGain(); + /** + * The p5.Delay is built with two + * + * Web Audio Delay Nodes, one for each stereo channel. + * + * @for p5.Delay + * @property {DelayNode} leftDelay + */ + + _this.leftDelay = _this.ac.createDelay(); + /** + * The p5.Delay is built with two + * + * Web Audio Delay Nodes, one for each stereo channel. + * @for p5.Delay + * @property {DelayNode} rightDelay + */ + + _this.rightDelay = _this.ac.createDelay(); + _this._leftFilter = new filter(); + _this._rightFilter = new filter(); + + _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(0.3, _this.ac.currentTime); + + _this._rightFilter.biquad.Q.setValueAtTime(0.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(0.5); + + return _this; + } + /** + * Add delay to an audio signal according to a set + * of delay parameters. + * + * @method process + * @for p5.Delay + * @param {Object} Signal An object that outputs audio + * @param {Number} [delayTime] Time (in seconds) of the delay/echo. + * Some browsers limit delayTime to + * 1 second. + * @param {Number} [feedback] sends the delay back through itself + * in a loop that decreases in volume + * each time. + * @param {Number} [lowPass] Cutoff frequency. Only frequencies + * below the lowPass will be part of the + * delay. + */ + + + delay_createClass(Delay, [{ + key: "process", + value: function process(src, _delayTime, _feedback, _filter) { + var feedback = _feedback || 0; + var delayTime = _delayTime || 0; + + if (feedback >= 1.0) { + throw new Error('Feedback value will force a positive feedback loop.'); + } + + if (delayTime >= this._maxDelay) { + throw new Error('Delay Time exceeds maximum delay time of ' + this._maxDelay + ' second.'); + } + + src.connect(this.input); + this.leftDelay.delayTime.setValueAtTime(delayTime, this.ac.currentTime); + this.rightDelay.delayTime.setValueAtTime(delayTime, this.ac.currentTime); + this._leftGain.gain.value = feedback; + this._rightGain.gain.value = feedback; + + if (_filter) { + this._leftFilter.freq(_filter); + + this._rightFilter.freq(_filter); + } + } + /** + * Set the delay (echo) time, in seconds. Usually this value will be + * a floating point number between 0.0 and 1.0. + * + * @method delayTime + * @for p5.Delay + * @param {Number} delayTime Time (in seconds) of the delay + */ + + }, { + key: "delayTime", + value: function delayTime(t) { + if (typeof t !== 'number') { + t.connect(this.leftDelay.delayTime); + t.connect(this.rightDelay.delayTime); + } else { + 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); + } + } + /** + * Feedback occurs when Delay sends its signal back through its input + * in a loop. The feedback amount determines how much signal to send each + * time through the loop. A feedback greater than 1.0 is not desirable because + * it will increase the overall output each time through the loop, + * creating an infinite feedback loop. The default value is 0.5 + * + * @method feedback + * @for p5.Delay + * @param {Number|Object} feedback 0.0 to 1.0, or an object such as an + * Oscillator that can be used to + * modulate this param + * @returns {Number} Feedback value + * + */ + + }, { + key: "feedback", + value: function feedback(f) { + if (f && typeof f !== 'number') { + f.connect(this._leftGain.gain); + f.connect(this._rightGain.gain); + } else if (f >= 1.0) { + throw new Error('Feedback value will force a positive feedback loop.'); + } else if (typeof f === 'number') { + this._leftGain.gain.value = f; + this._rightGain.gain.value = f; + } + + + return this._leftGain.gain.value; + } + /** + * Set a lowpass filter frequency for the delay. A lowpass filter + * will cut off any frequencies higher than the filter frequency. + * + * @method filter + * @for p5.Delay + * @param {Number|Object} cutoffFreq A lowpass filter will cut off any + * frequencies higher than the filter frequency. + * @param {Number|Object} res Resonance of the filter frequency + * cutoff, or an object (i.e. a p5.Oscillator) + * that can be used to modulate this parameter. + * High numbers (i.e. 15) will produce a resonance, + * low numbers (i.e. .2) will produce a slope. + */ + + }, { + key: "filter", + value: function filter(freq, q) { + this._leftFilter.set(freq, q); + + this._rightFilter.set(freq, q); + } + /** + * Choose a preset type of delay. 'pingPong' bounces the signal + * from the left to the right channel to produce a stereo effect. + * Any other parameter will revert to the default delay setting. + * + * @method setType + * @for p5.Delay + * @param {String|Number} type 'pingPong' (1) or 'default' (0) + */ + + }, { + key: "setType", + value: function setType(t) { + if (t === 1) { + t = 'pingPong'; + } + + this._split.disconnect(); + + this._leftFilter.disconnect(); + + this._rightFilter.disconnect(); + + this._split.connect(this.leftDelay, 0); + + this._split.connect(this.rightDelay, 1); + + switch (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); + + } + } + + /** + * Set the output level of the delay effect. + * + * @method amp + * @for p5.Delay + * @param {Number} volume amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + + /** + * Send output to a p5.sound or web audio object + * + * @method connect + * @for p5.Delay + * @param {Object} unit + */ + + /** + * Disconnect all output. + * + * @method disconnect + * @for p5.Delay + */ + + }, { + key: "dispose", + value: function dispose() { + delay_get(delay_getPrototypeOf(Delay.prototype), "dispose", this).call(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 = undefined; + this._leftFilter = undefined; + this._rightFilter = undefined; + this._merge = undefined; + this._leftGain = undefined; + this._rightGain = undefined; + this.leftDelay = undefined; + this.rightDelay = undefined; + } + }]); + + return Delay; +}(effect); + + var delay = (delay_Delay); +function reverb_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { reverb_typeof = function _typeof(obj) { return typeof obj; }; } else { reverb_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return reverb_typeof(obj); } + +function reverb_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function reverb_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function reverb_createClass(Constructor, protoProps, staticProps) { if (protoProps) reverb_defineProperties(Constructor.prototype, protoProps); if (staticProps) reverb_defineProperties(Constructor, staticProps); return Constructor; } + +function reverb_possibleConstructorReturn(self, call) { if (call && (reverb_typeof(call) === "object" || typeof call === "function")) { return call; } return reverb_assertThisInitialized(self); } + +function reverb_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function reverb_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { reverb_get = Reflect.get; } else { reverb_get = function _get(target, property, receiver) { var base = reverb_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return reverb_get(target, property, receiver || target); } + +function reverb_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = reverb_getPrototypeOf(object); if (object === null) break; } return object; } + +function reverb_getPrototypeOf(o) { reverb_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return reverb_getPrototypeOf(o); } + +function reverb_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) reverb_setPrototypeOf(subClass, superClass); } + +function reverb_setPrototypeOf(o, p) { reverb_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return reverb_setPrototypeOf(o, p); } + + + + +/** + * Reverb adds depth to a sound through a large number of decaying + * echoes. It creates the perception that sound is occurring in a + * physical space. The p5.Reverb has paramters for Time (how long does the + * reverb last) and decayRate (how much the sound decays with each echo) + * that can be set with the .set() or .process() methods. The p5.Convolver + * extends p5.Reverb allowing you to recreate the sound of actual physical + * spaces through convolution. + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Reverb + * @extends p5.Effect + * @constructor + * @example + *
                          + * let soundFile, reverb; + * function preload() { + * soundFile = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * + * reverb = new p5.Reverb(); + * soundFile.disconnect(); // so we'll only hear reverb... + * + * // connect soundFile to reverb, process w/ + * // 3 second reverbTime, decayRate of 2% + * reverb.process(soundFile, 3, 2); + * } + * + * function draw() { + * let dryWet = constrain(map(mouseX, 0, width, 0, 1), 0, 1); + * // 1 = all reverb, 0 = no reverb + * reverb.drywet(dryWet); + * + * background(220); + * text('tap to play', 10, 20); + * text('dry/wet: ' + round(dryWet * 100) + '%', 10, height - 20); + * } + * + * function playSound() { + * soundFile.play(); + * } + *
                          + */ + +var Reverb = +function (_Effect) { + reverb_inherits(Reverb, _Effect); + + function Reverb() { + var _this; + + reverb_classCallCheck(this, Reverb); + + _this = reverb_possibleConstructorReturn(this, reverb_getPrototypeOf(Reverb).call(this)); + + _this._initConvolverNode(); + + + _this.input.gain.value = 0.5; + + _this._seconds = 3; + _this._decay = 2; + _this._reverse = false; + + _this._buildImpulse(); + + return _this; + } + + reverb_createClass(Reverb, [{ + key: "_initConvolverNode", + value: function _initConvolverNode() { + this.convolverNode = this.ac.createConvolver(); + this.input.connect(this.convolverNode); + this.convolverNode.connect(this.wet); + } + }, { + key: "_teardownConvolverNode", + value: function _teardownConvolverNode() { + if (this.convolverNode) { + this.convolverNode.disconnect(); + delete this.convolverNode; + } + } + }, { + key: "_setBuffer", + value: function _setBuffer(audioBuffer) { + this._teardownConvolverNode(); + + this._initConvolverNode(); + + this.convolverNode.buffer = audioBuffer; + } + /** + * Connect a source to the reverb, and assign reverb parameters. + * + * @method process + * @for p5.Reverb + * @param {Object} src p5.sound / Web Audio object with a sound + * output. + * @param {Number} [seconds] Duration of the reverb, in seconds. + * Min: 0, Max: 10. Defaults to 3. + * @param {Number} [decayRate] Percentage of decay with each echo. + * Min: 0, Max: 100. Defaults to 2. + * @param {Boolean} [reverse] Play the reverb backwards or forwards. + */ + + }, { + key: "process", + value: function process(src, seconds, decayRate, reverse) { + src.connect(this.input); + var rebuild = false; + + if (seconds) { + this._seconds = seconds; + rebuild = true; + } + + if (decayRate) { + this._decay = decayRate; + } + + if (reverse) { + this._reverse = reverse; + } + + if (rebuild) { + this._buildImpulse(); + } + } + /** + * Set the reverb settings. Similar to .process(), but without + * assigning a new input. + * + * @method set + * @for p5.Reverb + * @param {Number} [seconds] Duration of the reverb, in seconds. + * Min: 0, Max: 10. Defaults to 3. + * @param {Number} [decayRate] Percentage of decay with each echo. + * Min: 0, Max: 100. Defaults to 2. + * @param {Boolean} [reverse] Play the reverb backwards or forwards. + */ + + }, { + key: "set", + value: function set(seconds, decayRate, reverse) { + var rebuild = false; + + if (seconds) { + this._seconds = seconds; + rebuild = true; + } + + if (decayRate) { + this._decay = decayRate; + } + + if (reverse) { + this._reverse = reverse; + } + + if (rebuild) { + this._buildImpulse(); + } + } + + /** + * Set the output level of the reverb effect. + * + * @method amp + * @for p5.Reverb + * @param {Number} volume amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + + /** + * Send output to a p5.sound or web audio object + * + * @method connect + * @for p5.Reverb + * @param {Object} unit + */ + + /** + * Disconnect all output. + * + * @method disconnect + * @for p5.Reverb + */ + + /** + * Inspired by Simple Reverb by Jordan Santell + * https://github.com/web-audio-components/simple-reverb/blob/master/index.js + * + * Utility function for building an impulse response + * based on the module parameters. + * + * @private + */ + + }, { + key: "_buildImpulse", + value: function _buildImpulse() { + var rate = this.ac.sampleRate; + var length = rate * this._seconds; + var decay = this._decay; + var impulse = this.ac.createBuffer(2, length, rate); + var impulseL = impulse.getChannelData(0); + var impulseR = impulse.getChannelData(1); + var n, i; + + for (i = 0; i < length; i++) { + n = this._reverse ? length - i : i; + impulseL[i] = (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); + impulseR[i] = (Math.random() * 2 - 1) * Math.pow(1 - n / length, decay); + } + + this._setBuffer(impulse); + } + }, { + key: "dispose", + value: function dispose() { + reverb_get(reverb_getPrototypeOf(Reverb.prototype), "dispose", this).call(this); + + this._teardownConvolverNode(); + } + }]); + + return Reverb; +}(effect); + +/** + *

                          p5.Convolver extends p5.Reverb. It can emulate the sound of real + * physical spaces through a process called + * convolution.

                          + * + *

                          Convolution multiplies any audio input by an "impulse response" + * to simulate the dispersion of sound over time. The impulse response is + * generated from an audio file that you provide. One way to + * generate an impulse response is to pop a balloon in a reverberant space + * and record the echo. Convolution can also be used to experiment with + * sound.

                          + * + *

                          Use the method createConvolution(path) to instantiate a + * p5.Convolver with a path to your impulse response audio file.

                          + * + * @class p5.Convolver + * @extends p5.Effect + * @constructor + * @param {String} path path to a sound file + * @param {Function} [callback] function to call when loading succeeds + * @param {Function} [errorCallback] function to call if loading fails. + * This function will receive an error or + * XMLHttpRequest object with information + * about what went wrong. + * @example + *
                          + * let cVerb, sound; + * function preload() { + * // We have both MP3 and OGG versions of all sound assets + * soundFormats('ogg', 'mp3'); + * + * // Try replacing 'bx-spring' with other soundfiles like + * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' + * cVerb = createConvolver('assets/bx-spring.mp3'); + * + * // Try replacing 'Damscray_DancingTiger' with + * // 'beat', 'doorbell', lucky_dragons_-_power_melody' + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * background(220); + * text('tap to play', 20, 20); + * + * // disconnect from main output... + * sound.disconnect(); + * + * // ...and process with cVerb + * // so that we only hear the convolution + * cVerb.process(sound); + * } + * + * function playSound() { + * sound.play(); + * } + *
                          + */ + + +var reverb_Convolver = +function (_Reverb) { + reverb_inherits(Convolver, _Reverb); + + function Convolver(path, callback, errorCallback) { + var _this2; + + reverb_classCallCheck(this, Convolver); + + _this2 = reverb_possibleConstructorReturn(this, reverb_getPrototypeOf(Convolver).call(this)); + /** + * Internally, the p5.Convolver uses the a + * + * Web Audio Convolver Node. + * + * @property {ConvolverNode} convolverNode + */ + + _this2._initConvolverNode(); + + + _this2.input.gain.value = 0.5; + + if (path) { + _this2.impulses = []; + + _this2._loadBuffer(path, callback, errorCallback); + } else { + _this2._seconds = 3; + _this2._decay = 2; + _this2._reverse = false; + + _this2._buildImpulse(); + } + /** + * If you load multiple impulse files using the .addImpulse method, + * they will be stored as Objects in this Array. Toggle between them + * with the toggleImpulse(id) method. + * + * @property {Array} impulses + * @for p5.Convolver + */ + + + _this2.impulses = []; + _this2.set = null; + return _this2; + } + /** + * Private method to load a buffer as an Impulse Response, + * assign it to the convolverNode, and add to the Array of .impulses. + * + * @param {String} path + * @param {Function} callback + * @param {Function} errorCallback + * @private + */ + + + reverb_createClass(Convolver, [{ + key: "_loadBuffer", + value: function _loadBuffer(_path, callback, errorCallback) { + var path = p5.prototype._checkFileFormats(_path); + + var self = this; + var errorTrace = new Error().stack; + var ac = Object(audiocontext["b" ])(); + var request = new XMLHttpRequest(); + request.open('GET', path, true); + request.responseType = 'arraybuffer'; + + request.onload = function () { + if (request.status === 200) { + ac.decodeAudioData(request.response, function (buff) { + var buffer = {}; + var chunks = path.split('/'); + buffer.name = chunks[chunks.length - 1]; + buffer.audioBuffer = buff; + self.impulses.push(buffer); + + self._setBuffer(buffer.audioBuffer); + + if (callback) { + callback(buffer); + } + }, + function () { + var err = new errorHandler('decodeAudioData', errorTrace, self.url); + var msg = 'AudioContext error at decodeAudioData for ' + self.url; + + if (errorCallback) { + err.msg = msg; + errorCallback(err); + } else { + console.error(msg + '\n The error stack trace includes: \n' + err.stack); + } + }); + } + else { + var err = new errorHandler('loadConvolver', errorTrace, self.url); + var msg = 'Unable to load ' + self.url + '. The request status was: ' + request.status + ' (' + request.statusText + ')'; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error(msg + '\n The error stack trace includes: \n' + err.stack); + } + } + }; + + + request.onerror = function () { + var err = new errorHandler('loadConvolver', errorTrace, self.url); + var msg = 'There was no response from the server at ' + self.url + '. Check the url and internet connectivity.'; + + if (errorCallback) { + err.message = msg; + errorCallback(err); + } else { + console.error(msg + '\n The error stack trace includes: \n' + err.stack); + } + }; + + request.send(); + } + /** + * Connect a source to the convolver. + * + * @method process + * @for p5.Convolver + * @param {Object} src p5.sound / Web Audio object with a sound + * output. + * @example + *
                          + * let cVerb, sound; + * function preload() { + * // We have both MP3 and OGG versions of all sound assets + * soundFormats('ogg', 'mp3'); + * + * // Try replacing 'bx-spring' with other soundfiles like + * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' + * cVerb = createConvolver('assets/bx-spring.mp3'); + * + * // Try replacing 'Damscray_DancingTiger' with + * // 'beat', 'doorbell', lucky_dragons_-_power_melody' + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * background(220); + * text('tap to play', 20, 20); + * + * // disconnect from main output... + * sound.disconnect(); + * + * // ...and process with cVerb + * // so that we only hear the convolution + * cVerb.process(sound); + * } + * + * function playSound() { + * sound.play(); + * } + * + *
                          + */ + + }, { + key: "process", + value: function process(src) { + src.connect(this.input); + } + /** + * Load and assign a new Impulse Response to the p5.Convolver. + * The impulse is added to the .impulses array. Previous + * impulses can be accessed with the .toggleImpulse(id) + * method. + * + * @method addImpulse + * @for p5.Convolver + * @param {String} path path to a sound file + * @param {Function} callback function (optional) + * @param {Function} errorCallback function (optional) + */ + + }, { + key: "addImpulse", + value: function addImpulse(path, callback, errorCallback) { + if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { + alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); + } + + this._loadBuffer(path, callback, errorCallback); + } + /** + * Similar to .addImpulse, except that the .impulses + * Array is reset to save memory. A new .impulses + * array is created with this impulse as the only item. + * + * @method resetImpulse + * @for p5.Convolver + * @param {String} path path to a sound file + * @param {Function} callback function (optional) + * @param {Function} errorCallback function (optional) + */ + + }, { + key: "resetImpulse", + value: function resetImpulse(path, callback, errorCallback) { + if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { + alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); + } + + this.impulses = []; + + this._loadBuffer(path, callback, errorCallback); + } + /** + * If you have used .addImpulse() to add multiple impulses + * to a p5.Convolver, then you can use this method to toggle between + * the items in the .impulses Array. Accepts a parameter + * to identify which impulse you wish to use, identified either by its + * original filename (String) or by its position in the .impulses + * Array (Number).
                          + * You can access the objects in the .impulses Array directly. Each + * Object has two attributes: an .audioBuffer (type: + * Web Audio + * AudioBuffer) and a .name, a String that corresponds + * with the original filename. + * + * @method toggleImpulse + * @for p5.Convolver + * @param {String|Number} id Identify the impulse by its original filename + * (String), or by its position in the + * .impulses Array (Number). + */ + + }, { + key: "toggleImpulse", + value: function toggleImpulse(id) { + if (typeof id === 'number' && id < this.impulses.length) { + this._setBuffer(this.impulses[id].audioBuffer); + } + + if (typeof id === 'string') { + for (var i = 0; i < this.impulses.length; i++) { + if (this.impulses[i].name === id) { + this._setBuffer(this.impulses[i].audioBuffer); + + break; + } + } + } + } + }, { + key: "dispose", + value: function dispose() { + reverb_get(reverb_getPrototypeOf(Convolver.prototype), "dispose", this).call(this); + + + for (var i in this.impulses) { + if (this.impulses[i]) { + this.impulses[i] = null; + } + } + } + }]); + + return Convolver; +}(Reverb); +/** + * Create a p5.Convolver. Accepts a path to a soundfile + * that will be used to generate an impulse response. + * + * @method createConvolver + * @for p5 + * @param {String} path path to a sound file + * @param {Function} [callback] function to call if loading is successful. + * The object will be passed in as the argument + * to the callback function. + * @param {Function} [errorCallback] function to call if loading is not successful. + * A custom error will be passed in as the argument + * to the callback function. + * @return {p5.Convolver} + * @example + *
                          + * let cVerb, sound; + * function preload() { + * // We have both MP3 and OGG versions of all sound assets + * soundFormats('ogg', 'mp3'); + * + * // Try replacing 'bx-spring' with other soundfiles like + * // 'concrete-tunnel' 'small-plate' 'drum' 'beatbox' + * cVerb = createConvolver('assets/bx-spring.mp3'); + * + * // Try replacing 'Damscray_DancingTiger' with + * // 'beat', 'doorbell', lucky_dragons_-_power_melody' + * sound = loadSound('assets/Damscray_DancingTiger.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSound); + * background(220); + * text('tap to play', 20, 20); + * + * // disconnect from main output... + * sound.disconnect(); + * + * // ...and process with cVerb + * // so that we only hear the convolution + * cVerb.process(sound); + * } + * + * function playSound() { + * sound.play(); + * } + *
                          + */ + + +function createConvolver(path, callback, errorCallback) { + if (window.location.origin.indexOf('file://') > -1 && window.cordova === 'undefined') { + alert('This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS'); + } + + var self = this; + var cReverb = new reverb_Convolver(path, function (buffer) { + if (typeof callback === 'function') { + callback(buffer); + } + + if (typeof self._decrementPreload === 'function') { + self._decrementPreload(); + } + }, errorCallback); + cReverb.impulses = []; + return cReverb; +} + + +var Clock = __webpack_require__(11); +var Clock_default = __webpack_require__.n(Clock); + +function metro_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function metro_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function metro_createClass(Constructor, protoProps, staticProps) { if (protoProps) metro_defineProperties(Constructor.prototype, protoProps); if (staticProps) metro_defineProperties(Constructor, staticProps); return Constructor; } + + + + +var metro_Metro = +function () { + function Metro() { + metro_classCallCheck(this, Metro); + + this.clock = new Clock_default.a({ + callback: this.ontick.bind(this) + }); + this.syncedParts = []; + this.bpm = 120; + + this._init(); + + this.prevTick = 0; + this.tatumTime = 0; + + this.tickCallback = function () {}; + } + + metro_createClass(Metro, [{ + key: "ontick", + value: function ontick(tickTime) { + var elapsedTime = tickTime - this.prevTick; + var secondsFromNow = tickTime - main.audiocontext.currentTime; + + if (elapsedTime - this.tatumTime <= -0.02) { + return; + } else { + this.prevTick = tickTime; + + var self = this; + this.syncedParts.forEach(function (thisPart) { + if (!thisPart.isPlaying) return; + thisPart.incrementStep(secondsFromNow); + + thisPart.phrases.forEach(function (thisPhrase) { + var phraseArray = thisPhrase.sequence; + var bNum = self.metroTicks % phraseArray.length; + + if (phraseArray[bNum] !== 0 && (self.metroTicks < phraseArray.length || !thisPhrase.looping)) { + thisPhrase.callback(secondsFromNow, phraseArray[bNum]); + } + }); + }); + this.metroTicks += 1; + this.tickCallback(secondsFromNow); + } + } + }, { + key: "setBPM", + value: function setBPM(bpm) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var beatTime = 60 / (bpm * this.tatums); + var now = main.audiocontext.currentTime; + this.tatumTime = beatTime; + this.clock.frequency.setValueAtTime(this.clock.frequency.value, now); + this.clock.frequency.linearRampToValueAtTime(bpm, now + rampTime); + this.bpm = bpm; + } + }, { + key: "getBPM", + value: function getBPM() { + return this.clock.getRate() / this.tatums * 60; + } + }, { + key: "_init", + value: function _init() { + this.metroTicks = 0; + } + + }, { + key: "resetSync", + value: function resetSync(part) { + this.syncedParts = [part]; + } + + }, { + key: "pushSync", + value: function pushSync(part) { + this.syncedParts.push(part); + } + }, { + key: "start", + value: function start(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + this.clock.start(now + t); + this.setBPM(this.bpm); + } + }, { + key: "stop", + value: function stop(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + this.clock.stop(now + t); + } + }, { + key: "beatLength", + value: function beatLength(tatums) { + this.tatums = 1 / tatums / 4; + } + }]); + + return Metro; +}(); + + var metro = (metro_Metro); +function looper_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function looper_createClass(Constructor, protoProps, staticProps) { if (protoProps) looper_defineProperties(Constructor.prototype, protoProps); if (staticProps) looper_defineProperties(Constructor, staticProps); return Constructor; } + +function looper_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + +var BPM = 120; +/** + * Set the global tempo, in beats per minute, for all + * p5.Parts. This method will impact all active p5.Parts. + * + * @method setBPM + * @for p5 + * @param {Number} BPM Beats Per Minute + * @param {Number} rampTime Seconds from now + */ + +p5.prototype.setBPM = function (bpm, rampTime) { + BPM = bpm; + + for (var i in main.parts) { + if (main.parts[i]) { + main.parts[i].setBPM(bpm, rampTime); + } + } +}; +/** + *

                          A phrase is a pattern of musical events over time, i.e. + * a series of notes and rests.

                          + * + *

                          Phrases must be added to a p5.Part for playback, and + * each part can play multiple phrases at the same time. + * For example, one Phrase might be a kick drum, another + * could be a snare, and another could be the bassline.

                          + * + *

                          The first parameter is a name so that the phrase can be + * modified or deleted later. The callback is a a function that + * this phrase will call at every step—for example it might be + * called playNote(value){}. The array determines + * which value is passed into the callback at each step of the + * phrase. It can be numbers, an object with multiple numbers, + * or a zero (0) indicates a rest so the callback won't be called).

                          + * + * @class p5.Phrase + * @constructor + * @param {String} name Name so that you can access the Phrase. + * @param {Function} callback The name of a function that this phrase + * will call. Typically it will play a sound, + * and accept two parameters: a time at which + * to play the sound (in seconds from now), + * and a value from the sequence array. The + * time should be passed into the play() or + * start() method to ensure precision. + * @param {Array} sequence Array of values to pass into the callback + * at each step of the phrase. + * @example + *
                          + * let mySound, myPhrase, myPart; + * let pattern = [1,0,0,2,0,2,0,0]; + * + * function preload() { + * mySound = loadSound('assets/beatbox.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playMyPart); + * background(220); + * text('tap to play', width/2, height/2); + * textAlign(CENTER, CENTER); + * + * myPhrase = new p5.Phrase('bbox', onEachStep, pattern); + * myPart = new p5.Part(); + * myPart.addPhrase(myPhrase); + * myPart.setBPM(60); + * } + * + * function onEachStep(time, playbackRate) { + * mySound.rate(playbackRate); + * mySound.play(time); + * } + * + * function playMyPart() { + * userStartAudio(); + * myPart.start(); + * } + *
                          + */ + + +var Phrase = function Phrase(name, callback, sequence) { + looper_classCallCheck(this, Phrase); + + this.phraseStep = 0; + this.name = name; + this.callback = callback; + /** + * Array of values to pass into the callback + * at each step of the phrase. Depending on the callback + * function's requirements, these values may be numbers, + * strings, or an object with multiple parameters. + * Zero (0) indicates a rest. + * + * @property {Array} sequence + */ + + this.sequence = sequence; +}; +/** + *

                          A p5.Part plays back one or more p5.Phrases. Instantiate a part + * with steps and tatums. By default, each step represents a 1/16th note.

                          + * + *

                          See p5.Phrase for more about musical timing.

                          + * + * @class p5.Part + * @constructor + * @param {Number} [steps] Steps in the part + * @param {Number} [tatums] Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note) + * @example + *
                          + * let box, drum, myPart; + * let boxPat = [1,0,0,2,0,2,0,0]; + * let drumPat = [0,1,1,0,2,0,1,0]; + * + * function preload() { + * box = loadSound('assets/beatbox.mp3'); + * drum = loadSound('assets/drum.mp3'); + * } + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playMyPart); + * background(220); + * textAlign(CENTER, CENTER); + * text('tap to play', width/2, height/2); + * + * let boxPhrase = new p5.Phrase('box', playBox, boxPat); + * let drumPhrase = new p5.Phrase('drum', playDrum, drumPat); + * myPart = new p5.Part(); + * myPart.addPhrase(boxPhrase); + * myPart.addPhrase(drumPhrase); + * myPart.setBPM(60); + * } + * + * function playBox(time, playbackRate) { + * box.rate(playbackRate); + * box.play(time); + * } + * + * function playDrum(time, playbackRate) { + * drum.rate(playbackRate); + * drum.play(time); + * } + * + * function playMyPart() { + * userStartAudio(); + * + * myPart.start(); + * } + *
                          + */ + + +var looper_Part = +function () { + function Part(steps, bLength) { + looper_classCallCheck(this, Part); + + this.length = steps || 0; + + this.partStep = 0; + this.phrases = []; + this.isPlaying = false; + this.noLoop(); + this.tatums = bLength || 0.0625; + + this.metro = new metro(); + + this.metro._init(); + + this.metro.beatLength(this.tatums); + this.metro.setBPM(BPM); + main.parts.push(this); + + this.callback = function () {}; + } + /** + * Set the tempo of this part, in Beats Per Minute. + * + * @method setBPM + * @for p5.Part + * @param {Number} BPM Beats Per Minute + * @param {Number} [rampTime] Seconds from now + */ + + + looper_createClass(Part, [{ + key: "setBPM", + value: function setBPM(tempo, rampTime) { + this.metro.setBPM(tempo, rampTime); + } + /** + * Returns the tempo, in Beats Per Minute, of this part. + * + * @method getBPM + * @for p5.Part + * @return {Number} + */ + + }, { + key: "getBPM", + value: function getBPM() { + return this.metro.getBPM(); + } + /** + * Start playback of this part. It will play + * through all of its phrases at a speed + * determined by setBPM. + * + * @method start + * @for p5.Part + * @param {Number} [time] seconds from now + */ + + }, { + key: "start", + value: function start(time) { + if (!this.isPlaying) { + this.isPlaying = true; + this.metro.resetSync(this); + var t = time || 0; + this.metro.start(t); + } + } + /** + * Loop playback of this part. It will begin + * looping through all of its phrases at a speed + * determined by setBPM. + * + * @method loop + * @for p5.Part + * @param {Number} [time] seconds from now + */ + + }, { + key: "loop", + value: function loop(time) { + this.looping = true; + + this.onended = function () { + this.partStep = 0; + }; + + var t = time || 0; + this.start(t); + } + /** + * Tell the part to stop looping. + * + * @method noLoop + * @for p5.Part + */ + + }, { + key: "noLoop", + value: function noLoop() { + this.looping = false; + + this.onended = function () { + this.stop(); + }; + } + /** + * Stop the part and cue it to step 0. Playback will resume from the begining of the Part when it is played again. + * + * @method stop + * @for p5.Part + * @param {Number} [time] seconds from now + */ + + }, { + key: "stop", + value: function stop(time) { + this.partStep = 0; + this.pause(time); + } + /** + * Pause the part. Playback will resume + * from the current step. + * + * @method pause + * @for p5.Part + * @param {Number} time seconds from now + */ + + }, { + key: "pause", + value: function pause(time) { + this.isPlaying = false; + var t = time || 0; + this.metro.stop(t); + } + /** + * Add a p5.Phrase to this Part. + * + * @method addPhrase + * @for p5.Part + * @param {p5.Phrase} phrase reference to a p5.Phrase + */ + + }, { + key: "addPhrase", + value: function addPhrase(name, callback, array) { + var p; + + if (arguments.length === 3) { + p = new Phrase(name, callback, array); + } else if (arguments[0] instanceof Phrase) { + p = arguments[0]; + } else { + throw 'invalid input. addPhrase accepts name, callback, array or a p5.Phrase'; + } + + this.phrases.push(p); + + if (p.sequence.length > this.length) { + this.length = p.sequence.length; + } + } + /** + * Remove a phrase from this part, based on the name it was + * given when it was created. + * + * @method removePhrase + * @for p5.Part + * @param {String} phraseName + */ + + }, { + key: "removePhrase", + value: function removePhrase(name) { + for (var i in this.phrases) { + if (this.phrases[i].name === name) { + this.phrases.splice(i, 1); + } + } + } + /** + * Get a phrase from this part, based on the name it was + * given when it was created. Now you can modify its array. + * + * @method getPhrase + * @for p5.Part + * @param {String} phraseName + */ + + }, { + key: "getPhrase", + value: function getPhrase(name) { + for (var i in this.phrases) { + if (this.phrases[i].name === name) { + return this.phrases[i]; + } + } + } + /** + * Find all sequences with the specified name, and replace their patterns with the specified array. + * + * @method replaceSequence + * @for p5.Part + * @param {String} phraseName + * @param {Array} sequence Array of values to pass into the callback + * at each step of the phrase. + */ + + }, { + key: "replaceSequence", + value: function replaceSequence(name, array) { + for (var i in this.phrases) { + if (this.phrases[i].name === name) { + this.phrases[i].sequence = array; + } + } + } + }, { + key: "incrementStep", + value: function incrementStep(time) { + if (this.partStep < this.length - 1) { + this.callback(time); + this.partStep += 1; + } else { + if (!this.looping && this.partStep === this.length - 1) { + this.onended(); + } + } + } + /** + * Set the function that will be called at every step. This will clear the previous function. + * + * @method onStep + * @for p5.Part + * @param {Function} callback The name of the callback + * you want to fire + * on every beat/tatum. + */ + + }, { + key: "onStep", + value: function onStep(callback) { + this.callback = callback; + } + }]); + + return Part; +}(); + +/** + * A Score consists of a series of Parts. The parts will + * be played back in order. For example, you could have an + * A part, a B part, and a C part, and play them back in this order + * new p5.Score(a, a, b, a, c) + * + * @class p5.Score + * @constructor + * @param {p5.Part} [...parts] One or multiple parts, to be played in sequence. + */ + + +var Score = +function () { + function Score() { + looper_classCallCheck(this, Score); + + this.parts = []; + this.currentPart = new Array(arguments.length); + ; + var thisScore = this; + + for (var i in arguments) { + this.parts[i] = arguments[i]; + this.parts[i].nextPart = this.parts[i + 1]; + + this.parts[i].onended = function () { + thisScore.resetPart(i); + playNextPart(thisScore); + }; + } + + this.looping = false; + } + + looper_createClass(Score, [{ + key: "onended", + value: function onended() { + if (this.looping) { + this.parts[0].start(); + } else { + this.parts[this.parts.length - 1].onended = function () { + this.stop(); + this.resetParts(); + }; + } + + this.currentPart = 0; + } + /** + * Start playback of the score. + * + * @method start + * @for p5.Score + */ + + }, { + key: "start", + value: function start() { + this.parts[this.currentPart].start(); + this.scoreStep = 0; + } + /** + * Stop playback of the score. + * + * @method stop + * @for p5.Score + */ + + }, { + key: "stop", + value: function stop() { + this.parts[this.currentPart].stop(); + this.currentPart = 0; + this.scoreStep = 0; + } + /** + * Pause playback of the score. + * + * @method pause + * @for p5.Score + */ + + }, { + key: "pause", + value: function pause() { + this.parts[this.currentPart].stop(); + } + /** + * Loop playback of the score. + * + * @method loop + * @for p5.Score + */ + + }, { + key: "loop", + value: function loop() { + this.looping = true; + this.start(); + } + /** + * Stop looping playback of the score. If it + * is currently playing, this will go into effect + * after the current round of playback completes. + * + * @method noLoop + * @for p5.Score + */ + + }, { + key: "noLoop", + value: function noLoop() { + this.looping = false; + } + }, { + key: "resetParts", + value: function resetParts() { + var self = this; + this.parts.forEach(function (part) { + self.resetParts[part]; + }); + } + }, { + key: "resetPart", + value: function resetPart(i) { + this.parts[i].stop(); + this.parts[i].partStep = 0; + + for (var p in this.parts[i].phrases) { + if (this.parts[i]) { + this.parts[i].phrases[p].phraseStep = 0; + } + } + } + /** + * Set the tempo for all parts in the score + * + * @method setBPM + * @for p5.Score + * @param {Number} BPM Beats Per Minute + * @param {Number} rampTime Seconds from now + */ + + }, { + key: "setBPM", + value: function setBPM(bpm, rampTime) { + for (var i in this.parts) { + if (this.parts[i]) { + this.parts[i].setBPM(bpm, rampTime); + } + } + } + }]); + + return Score; +}(); + +function playNextPart(aScore) { + aScore.currentPart++; + + if (aScore.currentPart >= aScore.parts.length) { + aScore.scoreStep = 0; + aScore.onended(); + } else { + aScore.scoreStep = 0; + aScore.parts[aScore.currentPart - 1].stop(); + aScore.parts[aScore.currentPart].start(); + } +} + + +function soundLoop_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function soundLoop_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function soundLoop_createClass(Constructor, protoProps, staticProps) { if (protoProps) soundLoop_defineProperties(Constructor.prototype, protoProps); if (staticProps) soundLoop_defineProperties(Constructor, staticProps); return Constructor; } + + + +/** + * SoundLoop + * + * @class p5.SoundLoop + * @constructor + * + * @param {Function} callback this function will be called on each iteration of theloop + * @param {Number|String} [interval] amount of time (if a number) or beats (if a string, following Tone.Time convention) for each iteration of the loop. Defaults to 1 second. + * + * @example + *
                          + * let synth, soundLoop; + * let notePattern = [60, 62, 64, 67, 69, 72]; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * colorMode(HSB); + * background(0, 0, 86); + * text('tap to start/stop', 10, 20); + * + * //the looper's callback is passed the timeFromNow + * //this value should be used as a reference point from + * //which to schedule sounds + * let intervalInSeconds = 0.2; + * soundLoop = new p5.SoundLoop(onSoundLoop, intervalInSeconds); + * + * synth = new p5.MonoSynth(); + * } + * + * function canvasPressed() { + * // ensure audio is enabled + * userStartAudio(); + * + * if (soundLoop.isPlaying) { + * soundLoop.stop(); + * } else { + * // start the loop + * soundLoop.start(); + * } + * } + * + * function onSoundLoop(timeFromNow) { + * let noteIndex = (soundLoop.iterations - 1) % notePattern.length; + * let note = midiToFreq(notePattern[noteIndex]); + * synth.play(note, 0.5, timeFromNow); + * background(noteIndex * 360 / notePattern.length, 50, 100); + * } + *
                          + */ + +var soundLoop_SoundLoop = +function () { + function SoundLoop(callback, interval) { + soundLoop_classCallCheck(this, SoundLoop); + + /** + * Getters and Setters, setting any paramter will result in a change in the clock's + * frequency, that will be reflected after the next callback + * beats per minute (defaults to 60) + * @property {Number} bpm + * @for p5.SoundLoop + */ + Object.defineProperty(this, 'bpm', { + get: function get() { + return this._bpm; + }, + set: function set(bpm) { + if (!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 = bpm; + + this._update(); + } + }); + /** + * number of quarter notes in a measure (defaults to 4) + * @property {Number} timeSignature + * @for p5.SoundLoop + */ + + Object.defineProperty(this, 'timeSignature', { + get: function get() { + return this._timeSignature; + }, + set: function set(timeSig) { + if (!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 = timeSig; + + this._update(); + } + }); + /** + * length of the loops interval + * @property {Number|String} interval + * @for p5.SoundLoop + */ + + Object.defineProperty(this, 'interval', { + get: function get() { + return this._interval; + }, + set: function set(interval) { + this.musicalTimeMode = typeof interval === 'number' ? false : true; + this._interval = interval; + + this._update(); + } + }); + /** + * how many times the callback has been called so far + * @property {Number} iterations + * @for p5.SoundLoop + * @readonly + */ + + Object.defineProperty(this, 'iterations', { + get: function get() { + return this.clock.ticks; + } + }); + this.callback = callback; + /** + * musicalTimeMode uses Tone.Time convention + * true if string, false if number + * @property {Boolean} musicalTimeMode + */ + + this.musicalTimeMode = typeof this._interval === 'number' ? false : true; + this._interval = interval || 1; + /** + * musicalTimeMode variables + * modify these only when the interval is specified in musicalTime format as a string + */ + + this._timeSignature = 4; + this._bpm = 60; + this.isPlaying = false; + /** + * Set a limit to the number of loops to play. defaults to Infinity + * @property {Number} maxIterations + */ + + this.maxIterations = Infinity; + var self = this; + this.clock = new Clock_default.a({ + callback: function callback(time) { + var timeFromNow = time - main.audiocontext.currentTime; + /** + * Do not initiate the callback if timeFromNow is < 0 + * This ususually occurs for a few milliseconds when the page + * is not fully loaded + * + * The callback should only be called until maxIterations is reached + */ + + if (timeFromNow > 0 && self.iterations <= self.maxIterations) { + self.callback(timeFromNow); + } + }, + frequency: this._calcFreq() + }); + } + /** + * Start the loop + * @method start + * @for p5.SoundLoop + * @param {Number} [timeFromNow] schedule a starting time + */ + + + soundLoop_createClass(SoundLoop, [{ + key: "start", + value: function start(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (!this.isPlaying) { + this.clock.start(now + t); + this.isPlaying = true; + } + } + /** + * Stop the loop + * @method stop + * @for p5.SoundLoop + * @param {Number} [timeFromNow] schedule a stopping time + */ + + }, { + key: "stop", + value: function stop(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (this.isPlaying) { + this.clock.stop(now + t); + this.isPlaying = false; + } + } + /** + * Pause the loop + * @method pause + * @for p5.SoundLoop + * @param {Number} [timeFromNow] schedule a pausing time + */ + + }, { + key: "pause", + value: function pause(timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (this.isPlaying) { + this.clock.pause(now + t); + this.isPlaying = false; + } + } + /** + * Synchronize loops. Use this method to start two or more loops in synchronization + * or to start a loop in synchronization with a loop that is already playing + * This method will schedule the implicit loop in sync with the explicit master loop + * i.e. loopToStart.syncedStart(loopToSyncWith) + * + * @method syncedStart + * @for p5.SoundLoop + * @param {Object} otherLoop a p5.SoundLoop to sync with + * @param {Number} [timeFromNow] Start the loops in sync after timeFromNow seconds + */ + + }, { + key: "syncedStart", + value: function syncedStart(otherLoop, timeFromNow) { + var t = timeFromNow || 0; + var now = main.audiocontext.currentTime; + + if (!otherLoop.isPlaying) { + otherLoop.clock.start(now + t); + otherLoop.isPlaying = true; + this.clock.start(now + t); + this.isPlaying = true; + } else if (otherLoop.isPlaying) { + var time = otherLoop.clock._nextTick - main.audiocontext.currentTime; + this.clock.start(now + time); + this.isPlaying = true; + } + } + /** + * Updates frequency value, reflected in next callback + * @private + * @for p5.SoundLoop + * @method _update + */ + + }, { + key: "_update", + value: function _update() { + this.clock.frequency.value = this._calcFreq(); + } + /** + * Calculate the frequency of the clock's callback based on bpm, interval, and timesignature + * @private + * @for p5.SoundLoop + * @method _calcFreq + * @return {Number} new clock frequency value + */ + + }, { + key: "_calcFreq", + value: function _calcFreq() { + if (typeof this._interval === 'number') { + this.musicalTimeMode = false; + return 1 / this._interval; + } + else if (typeof this._interval === 'string') { + this.musicalTimeMode = true; + return this._bpm / 60 / this._convertNotation(this._interval) * (this._timeSignature / 4); + } + } + /** + * Convert notation from musical time format to seconds + * Uses Tone.Time convention + * @private + * @for p5.SoundLoop + * @method _convertNotation + * @param {String} value value to be converted + * @return {Number} converted value in seconds + */ + + }, { + key: "_convertNotation", + value: function _convertNotation(value) { + var type = value.slice(-1); + value = Number(value.slice(0, -1)); + + switch (type) { + case 'm': + return this._measure(value); + + case 'n': + return this._note(value); + + 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'); + } + } + /** + * Helper conversion methods of measure and note + * @private + * @for p5.SoundLoop + * @method _measure + */ + + }, { + key: "_measure", + value: function _measure(value) { + return value * this._timeSignature; + } + /** + * @private + * @method _note + * @for p5.SoundLoop + */ + + }, { + key: "_note", + value: function _note(value) { + return this._timeSignature / value; + } + }]); + + return SoundLoop; +}(); + + var soundLoop = (soundLoop_SoundLoop); +function compressor_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { compressor_typeof = function _typeof(obj) { return typeof obj; }; } else { compressor_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return compressor_typeof(obj); } + +function compressor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function compressor_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function compressor_createClass(Constructor, protoProps, staticProps) { if (protoProps) compressor_defineProperties(Constructor.prototype, protoProps); if (staticProps) compressor_defineProperties(Constructor, staticProps); return Constructor; } + +function compressor_possibleConstructorReturn(self, call) { if (call && (compressor_typeof(call) === "object" || typeof call === "function")) { return call; } return compressor_assertThisInitialized(self); } + +function compressor_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function compressor_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { compressor_get = Reflect.get; } else { compressor_get = function _get(target, property, receiver) { var base = compressor_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return compressor_get(target, property, receiver || target); } + +function compressor_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = compressor_getPrototypeOf(object); if (object === null) break; } return object; } + +function compressor_getPrototypeOf(o) { compressor_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return compressor_getPrototypeOf(o); } + +function compressor_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) compressor_setPrototypeOf(subClass, superClass); } + +function compressor_setPrototypeOf(o, p) { compressor_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return compressor_setPrototypeOf(o, p); } + + +/** + * Compressor is an audio effect class that performs dynamics compression + * on an audio input source. This is a very commonly used technique in music + * and sound production. Compression creates an overall louder, richer, + * and fuller sound by lowering the volume of louds and raising that of softs. + * Compression can be used to avoid clipping (sound distortion due to + * peaks in volume) and is especially useful when many sounds are played + * at once. Compression can be used on indivudal sound sources in addition + * to the main output. + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Compressor + * @constructor + * @extends p5.Effect + * + * + */ + +var Compressor = +function (_Effect) { + compressor_inherits(Compressor, _Effect); + + function Compressor() { + var _this; + + compressor_classCallCheck(this, Compressor); + + _this = compressor_possibleConstructorReturn(this, compressor_getPrototypeOf(Compressor).call(this)); + /** + * + * The p5.Compressor is built with a Web Audio Dynamics Compressor Node + * + * @property {AudioNode} compressor + */ + + _this.compressor = _this.ac.createDynamicsCompressor(); + + _this.input.connect(_this.compressor); + + _this.compressor.connect(_this.wet); + + return _this; + } + /** + * Performs the same function as .connect, but also accepts + * optional parameters to set compressor's audioParams + * @method process + * @for p5.Compressor + * + * @param {Object} src Sound source to be connected + * + * @param {Number} [attack] The amount of time (in seconds) to reduce the gain by 10dB, + * default = .003, range 0 - 1 + * @param {Number} [knee] A decibel value representing the range above the + * threshold where the curve smoothly transitions to the "ratio" portion. + * default = 30, range 0 - 40 + * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output + * default = 12, range 1 - 20 + * @param {Number} [threshold] The decibel value above which the compression will start taking effect + * default = -24, range -100 - 0 + * @param {Number} [release] The amount of time (in seconds) to increase the gain by 10dB + * default = .25, range 0 - 1 + */ + + + compressor_createClass(Compressor, [{ + key: "process", + value: function process(src, attack, knee, ratio, threshold, release) { + src.connect(this.input); + this.set(attack, knee, ratio, threshold, release); + } + /** + * Set the paramters of a compressor. + * @method set + * @for p5.Compressor + * @param {Number} attack The amount of time (in seconds) to reduce the gain by 10dB, + * default = .003, range 0 - 1 + * @param {Number} knee A decibel value representing the range above the + * threshold where the curve smoothly transitions to the "ratio" portion. + * default = 30, range 0 - 40 + * @param {Number} ratio The amount of dB change in input for a 1 dB change in output + * default = 12, range 1 - 20 + * @param {Number} threshold The decibel value above which the compression will start taking effect + * default = -24, range -100 - 0 + * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB + * default = .25, range 0 - 1 + */ + + }, { + key: "set", + value: function set(attack, knee, ratio, threshold, release) { + if (typeof attack !== 'undefined') { + this.attack(attack); + } + + if (typeof knee !== 'undefined') { + this.knee(knee); + } + + if (typeof ratio !== 'undefined') { + this.ratio(ratio); + } + + if (typeof threshold !== 'undefined') { + this.threshold(threshold); + } + + if (typeof release !== 'undefined') { + this.release(release); + } + } + /** + * Get current attack or set value w/ time ramp + * + * + * @method attack + * @for p5.Compressor + * @param {Number} [attack] Attack is the amount of time (in seconds) to reduce the gain by 10dB, + * default = .003, range 0 - 1 + * @param {Number} [time] Assign time value to schedule the change in value + */ + + }, { + key: "attack", + value: function attack(_attack, time) { + var t = time || 0; + + if (typeof _attack === 'number') { + this.compressor.attack.value = _attack; + this.compressor.attack.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.compressor.attack.linearRampToValueAtTime(_attack, this.ac.currentTime + 0.02 + t); + } else if (typeof _attack !== 'undefined') { + _attack.connect(this.compressor.attack); + } + + return this.compressor.attack.value; + } + /** + * Get current knee or set value w/ time ramp + * + * @method knee + * @for p5.Compressor + * @param {Number} [knee] A decibel value representing the range above the + * threshold where the curve smoothly transitions to the "ratio" portion. + * default = 30, range 0 - 40 + * @param {Number} [time] Assign time value to schedule the change in value + */ + + }, { + key: "knee", + value: function knee(_knee, time) { + var t = time || 0; + + if (typeof _knee === 'number') { + this.compressor.knee.value = _knee; + this.compressor.knee.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.compressor.knee.linearRampToValueAtTime(_knee, this.ac.currentTime + 0.02 + t); + } else if (typeof _knee !== 'undefined') { + _knee.connect(this.compressor.knee); + } + + return this.compressor.knee.value; + } + /** + * Get current ratio or set value w/ time ramp + * @method ratio + * @for p5.Compressor + * @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output + * default = 12, range 1 - 20 + * @param {Number} [time] Assign time value to schedule the change in value + */ + + }, { + key: "ratio", + value: function ratio(_ratio, time) { + var t = time || 0; + + if (typeof _ratio === 'number') { + this.compressor.ratio.value = _ratio; + this.compressor.ratio.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.compressor.ratio.linearRampToValueAtTime(_ratio, this.ac.currentTime + 0.02 + t); + } else if (typeof _ratio !== 'undefined') { + _ratio.connect(this.compressor.ratio); + } + + return this.compressor.ratio.value; + } + /** + * Get current threshold or set value w/ time ramp + * @method threshold + * @for p5.Compressor + * @param {Number} threshold The decibel value above which the compression will start taking effect + * default = -24, range -100 - 0 + * @param {Number} [time] Assign time value to schedule the change in value + */ + + }, { + key: "threshold", + value: function threshold(_threshold, time) { + var t = time || 0; + + if (typeof _threshold === 'number') { + this.compressor.threshold.value = _threshold; + this.compressor.threshold.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.compressor.threshold.linearRampToValueAtTime(_threshold, this.ac.currentTime + 0.02 + t); + } else if (typeof _threshold !== 'undefined') { + _threshold.connect(this.compressor.threshold); + } + + return this.compressor.threshold.value; + } + /** + * Get current release or set value w/ time ramp + * @method release + * @for p5.Compressor + * @param {Number} release The amount of time (in seconds) to increase the gain by 10dB + * default = .25, range 0 - 1 + * + * @param {Number} [time] Assign time value to schedule the change in value + */ + + }, { + key: "release", + value: function release(_release, time) { + var t = time || 0; + + if (typeof _release === 'number') { + this.compressor.release.value = _release; + this.compressor.release.cancelScheduledValues(this.ac.currentTime + 0.01 + t); + this.compressor.release.linearRampToValueAtTime(_release, this.ac.currentTime + 0.02 + t); + } else if (typeof number !== 'undefined') { + _release.connect(this.compressor.release); + } + + return this.compressor.release.value; + } + /** + * Return the current reduction value + * + * @method reduction + * @for p5.Compressor + * @return {Number} Value of the amount of gain reduction that is applied to the signal + */ + + }, { + key: "reduction", + value: function reduction() { + return this.compressor.reduction.value; + } + }, { + key: "dispose", + value: function dispose() { + compressor_get(compressor_getPrototypeOf(Compressor.prototype), "dispose", this).call(this); + + if (this.compressor) { + this.compressor.disconnect(); + delete this.compressor; + } + } + }]); + + return Compressor; +}(effect); + + var compressor = (Compressor); +function peakDetect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function peakDetect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function peakDetect_createClass(Constructor, protoProps, staticProps) { if (protoProps) peakDetect_defineProperties(Constructor.prototype, protoProps); if (staticProps) peakDetect_defineProperties(Constructor, staticProps); return Constructor; } + +/** + *

                          PeakDetect works in conjunction with p5.FFT to + * look for onsets in some or all of the frequency spectrum. + *

                          + *

                          + * To use p5.PeakDetect, call update in the draw loop + * and pass in a p5.FFT object. + *

                          + *

                          + * You can listen for a specific part of the frequency spectrum by + * setting the range between freq1 and freq2. + *

                          + * + *

                          threshold is the threshold for detecting a peak, + * scaled between 0 and 1. It is logarithmic, so 0.1 is half as loud + * as 1.0.

                          + * + *

                          + * The update method is meant to be run in the draw loop, and + * frames determines how many loops must pass before + * another peak can be detected. + * For example, if the frameRate() = 60, you could detect the beat of a + * 120 beat-per-minute song with this equation: + * framesPerPeak = 60 / (estimatedBPM / 60 ); + *

                          + * + *

                          + * Based on example contribtued by @b2renger, and a simple beat detection + * explanation by Felix Turner. + *

                          + * + * @class p5.PeakDetect + * @constructor + * @param {Number} [freq1] lowFrequency - defaults to 20Hz + * @param {Number} [freq2] highFrequency - defaults to 20000 Hz + * @param {Number} [threshold] Threshold for detecting a beat between 0 and 1 + * scaled logarithmically where 0.1 is 1/2 the loudness + * of 1.0. Defaults to 0.35. + * @param {Number} [framesPerPeak] Defaults to 20. + * @example + *
                          + * + * var cnv, soundFile, fft, peakDetect; + * var ellipseWidth = 10; + * + * function preload() { + * soundFile = loadSound('assets/beat.mp3'); + * } + * + * function setup() { + * background(0); + * noStroke(); + * fill(255); + * textAlign(CENTER); + * + * // p5.PeakDetect requires a p5.FFT + * fft = new p5.FFT(); + * peakDetect = new p5.PeakDetect(); + * } + * + * function draw() { + * background(0); + * text('click to play/pause', width/2, height/2); + * + * // peakDetect accepts an fft post-analysis + * fft.analyze(); + * peakDetect.update(fft); + * + * if ( peakDetect.isDetected ) { + * ellipseWidth = 50; + * } else { + * ellipseWidth *= 0.95; + * } + * + * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); + * } + * + * // toggle play/stop when canvas is clicked + * function mouseClicked() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * if (soundFile.isPlaying() ) { + * soundFile.stop(); + * } else { + * soundFile.play(); + * } + * } + * } + *
                          + */ +var PeakDetect = +function () { + function PeakDetect(freq1, freq2, threshold, _framesPerPeak) { + peakDetect_classCallCheck(this, PeakDetect); + + this.framesPerPeak = _framesPerPeak || 20; + this.framesSinceLastPeak = 0; + this.decayRate = 0.95; + this.threshold = threshold || 0.35; + this.cutoff = 0; + + this.cutoffMult = 1.5; + this.energy = 0; + this.penergy = 0; + + this.currentValue = 0; + /** + * isDetected is set to true when a peak is detected. + * + * @attribute isDetected {Boolean} + * @default false + */ + + this.isDetected = false; + this.f1 = freq1 || 40; + this.f2 = freq2 || 20000; + + this._onPeak = function () {}; + } + /** + * The update method is run in the draw loop. + * + * Accepts an FFT object. You must call .analyze() + * on the FFT object prior to updating the peakDetect + * because it relies on a completed FFT analysis. + * + * @method update + * @param {p5.FFT} fftObject A p5.FFT object + */ + + + peakDetect_createClass(PeakDetect, [{ + key: "update", + value: function update(fftObject) { + var nrg = this.energy = fftObject.getEnergy(this.f1, this.f2) / 255; + + if (nrg > this.cutoff && nrg > this.threshold && nrg - this.penergy > 0) { + this._onPeak(); + + this.isDetected = true; + + this.cutoff = nrg * this.cutoffMult; + this.framesSinceLastPeak = 0; + } else { + this.isDetected = false; + + if (this.framesSinceLastPeak <= this.framesPerPeak) { + this.framesSinceLastPeak++; + } else { + this.cutoff *= this.decayRate; + this.cutoff = Math.max(this.cutoff, this.threshold); + } + } + + this.currentValue = nrg; + this.penergy = nrg; + } + /** + * onPeak accepts two arguments: a function to call when + * a peak is detected. The value of the peak, + * between 0.0 and 1.0, is passed to the callback. + * + * @method onPeak + * @param {Function} callback Name of a function that will + * be called when a peak is + * detected. + * @param {Object} [val] Optional value to pass + * into the function when + * a peak is detected. + * @example + *
                          + * var cnv, soundFile, fft, peakDetect; + * var ellipseWidth = 0; + * + * function preload() { + * soundFile = loadSound('assets/beat.mp3'); + * } + * + * function setup() { + * cnv = createCanvas(100,100); + * textAlign(CENTER); + * + * fft = new p5.FFT(); + * peakDetect = new p5.PeakDetect(); + * + * setupSound(); + * + * // when a beat is detected, call triggerBeat() + * peakDetect.onPeak(triggerBeat); + * } + * + * function draw() { + * background(0); + * fill(255); + * text('click to play', width/2, height/2); + * + * fft.analyze(); + * peakDetect.update(fft); + * + * ellipseWidth *= 0.95; + * ellipse(width/2, height/2, ellipseWidth, ellipseWidth); + * } + * + * // this function is called by peakDetect.onPeak + * function triggerBeat() { + * ellipseWidth = 50; + * } + * + * // mouseclick starts/stops sound + * function setupSound() { + * cnv.mouseClicked( function() { + * if (soundFile.isPlaying() ) { + * soundFile.stop(); + * } else { + * soundFile.play(); + * } + * }); + * } + *
                          + */ + + }, { + key: "onPeak", + value: function onPeak(callback, val) { + var self = this; + + self._onPeak = function () { + callback(self.energy, val); + }; + } + }]); + + return PeakDetect; +}(); + + var peakDetect = (PeakDetect); +function soundRecorder_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function soundRecorder_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function soundRecorder_createClass(Constructor, protoProps, staticProps) { if (protoProps) soundRecorder_defineProperties(Constructor.prototype, protoProps); if (staticProps) soundRecorder_defineProperties(Constructor, staticProps); return Constructor; } + + + + +var soundRecorder_ac = main.audiocontext; +/** + *

                          Record sounds for playback and/or to save as a .wav file. + * The p5.SoundRecorder records all sound output from your sketch, + * or can be assigned a specific source with setInput().

                          + *

                          The record() method accepts a p5.SoundFile as a parameter. + * When playback is stopped (either after the given amount of time, + * or with the stop() method), the p5.SoundRecorder will send its + * recording to that p5.SoundFile for playback.

                          + * + * @class p5.SoundRecorder + * @constructor + * @example + *
                          + * let mic, recorder, soundFile; + * let state = 0; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(canvasPressed); + * background(220); + * textAlign(CENTER, CENTER); + * + * // create an audio in + * mic = new p5.AudioIn(); + * + * // prompts user to enable their browser mic + * mic.start(); + * + * // create a sound recorder + * recorder = new p5.SoundRecorder(); + * + * // connect the mic to the recorder + * recorder.setInput(mic); + * + * // this sound file will be used to + * // playback & save the recording + * soundFile = new p5.SoundFile(); + * + * text('tap to record', width/2, height/2); + * } + * + * function canvasPressed() { + * // ensure audio is enabled + * userStartAudio(); + * + * // make sure user enabled the mic + * if (state === 0 && mic.enabled) { + * + * // record to our p5.SoundFile + * recorder.record(soundFile); + * + * background(255,0,0); + * text('Recording!', width/2, height/2); + * state++; + * } + * else if (state === 1) { + * background(0,255,0); + * + * // stop recorder and + * // send result to soundFile + * recorder.stop(); + * + * text('Done! Tap to play and download', width/2, height/2, width - 20); + * state++; + * } + * + * else if (state === 2) { + * soundFile.play(); // play the result! + * save(soundFile, 'mySound.wav'); + * state++; + * } + * } + *
                          + */ + +var soundRecorder_SoundRecorder = +function () { + function SoundRecorder() { + soundRecorder_classCallCheck(this, SoundRecorder); + + this.input = soundRecorder_ac.createGain(); + this.output = soundRecorder_ac.createGain(); + this._inputChannels = 2; + this._outputChannels = 2; + + var workletBufferSize = safeBufferSize(1024); + this._workletNode = new AudioWorkletNode(soundRecorder_ac, processorNames_default.a.recorderProcessor, { + outputChannelCount: [this._outputChannels], + processorOptions: { + numInputChannels: this._inputChannels, + bufferSize: workletBufferSize + } + }); + + this._workletNode.port.onmessage = function (event) { + if (event.data.name === 'buffers') { + var buffers = [new Float32Array(event.data.leftBuffer), new Float32Array(event.data.rightBuffer)]; + + this._callback(buffers); + } + }.bind(this); + /** + * callback invoked when the recording is over + * @private + * @type Function(Float32Array) + */ + + + this._callback = function () {}; + + + this._workletNode.connect(p5.soundOut._silentNode); + + this.setInput(); + + main.soundArray.push(this); + } + /** + * Connect a specific device to the p5.SoundRecorder. + * If no parameter is given, p5.SoundRecorer will record + * all audible p5.sound from your sketch. + * + * @method setInput + * @for p5.SoundRecorder + * @param {Object} [unit] p5.sound object or a web audio unit + * that outputs sound + */ + + + soundRecorder_createClass(SoundRecorder, [{ + key: "setInput", + value: function setInput(unit) { + this.input.disconnect(); + this.input = null; + this.input = soundRecorder_ac.createGain(); + this.input.connect(this._workletNode); + this.input.connect(this.output); + + if (unit) { + unit.connect(this.input); + } else { + p5.soundOut.output.connect(this.input); + } + } + /** + * Start recording. To access the recording, provide + * a p5.SoundFile as the first parameter. The p5.SoundRecorder + * will send its recording to that p5.SoundFile for playback once + * recording is complete. Optional parameters include duration + * (in seconds) of the recording, and a callback function that + * will be called once the complete recording has been + * transfered to the p5.SoundFile. + * + * @method record + * @for p5.SoundRecorder + * @param {p5.SoundFile} soundFile p5.SoundFile + * @param {Number} [duration] Time (in seconds) + * @param {Function} [callback] The name of a function that will be + * called once the recording completes + */ + + }, { + key: "record", + value: function record(sFile, duration, callback) { + this._workletNode.port.postMessage({ + name: 'start', + duration: duration + }); + + if (sFile && callback) { + this._callback = function (buffer) { + sFile.setBuffer(buffer); + callback(); + }; + } else if (sFile) { + this._callback = function (buffer) { + sFile.setBuffer(buffer); + }; + } + } + /** + * Stop the recording. Once the recording is stopped, + * the results will be sent to the p5.SoundFile that + * was given on .record(), and if a callback function + * was provided on record, that function will be called. + * + * @method stop + * @for p5.SoundRecorder + */ + + }, { + key: "stop", + value: function stop() { + this._workletNode.port.postMessage({ + name: 'stop' + }); + } + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + this._callback = function () {}; + + if (this.input) { + this.input.disconnect(); + } + + this.input = null; + this._workletNode = null; + } + }]); + + return SoundRecorder; +}(); + + var soundRecorder = (soundRecorder_SoundRecorder); +function distortion_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { distortion_typeof = function _typeof(obj) { return typeof obj; }; } else { distortion_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return distortion_typeof(obj); } + +function distortion_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function distortion_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function distortion_createClass(Constructor, protoProps, staticProps) { if (protoProps) distortion_defineProperties(Constructor.prototype, protoProps); if (staticProps) distortion_defineProperties(Constructor, staticProps); return Constructor; } + +function distortion_possibleConstructorReturn(self, call) { if (call && (distortion_typeof(call) === "object" || typeof call === "function")) { return call; } return distortion_assertThisInitialized(self); } + +function distortion_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function distortion_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { distortion_get = Reflect.get; } else { distortion_get = function _get(target, property, receiver) { var base = distortion_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return distortion_get(target, property, receiver || target); } + +function distortion_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = distortion_getPrototypeOf(object); if (object === null) break; } return object; } + +function distortion_getPrototypeOf(o) { distortion_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return distortion_getPrototypeOf(o); } + +function distortion_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) distortion_setPrototypeOf(subClass, superClass); } + +function distortion_setPrototypeOf(o, p) { distortion_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return distortion_setPrototypeOf(o, p); } + + + +function makeDistortionCurve(amount) { + var k = typeof amount === 'number' ? amount : 50; + var numSamples = 44100; + var curve = new Float32Array(numSamples); + var deg = Math.PI / 180; + var i = 0; + var x; + + for (; i < numSamples; ++i) { + x = i * 2 / numSamples - 1; + curve[i] = (3 + k) * x * 20 * deg / (Math.PI + k * Math.abs(x)); + } + + return curve; +} +/** + * A Distortion effect created with a Waveshaper Node, + * with an approach adapted from + * [Kevin Ennis](http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion) + * + * This class extends p5.Effect. + * Methods amp(), chain(), + * drywet(), connect(), and + * disconnect() are available. + * + * @class p5.Distortion + * @extends p5.Effect + * @constructor + * @param {Number} [amount=0.25] Unbounded distortion amount. + * Normal values range from 0-1. + * @param {String} [oversample='none'] 'none', '2x', or '4x'. + * + */ + + +var Distortion = +function (_Effect) { + distortion_inherits(Distortion, _Effect); + + function Distortion(amount, oversample) { + var _this; + + distortion_classCallCheck(this, Distortion); + + _this = distortion_possibleConstructorReturn(this, distortion_getPrototypeOf(Distortion).call(this)); + + if (typeof amount === 'undefined') { + amount = 0.25; + } + + if (typeof amount !== 'number') { + throw new Error('amount must be a number'); + } + + if (typeof oversample === 'undefined') { + oversample = '2x'; + } + + if (typeof oversample !== 'string') { + throw new Error('oversample must be a String'); + } + + var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); + /** + * The p5.Distortion is built with a + * + * Web Audio WaveShaper Node. + * + * @property {AudioNode} WaveShaperNode + */ + + _this.waveShaperNode = _this.ac.createWaveShaper(); + _this.amount = curveAmount; + _this.waveShaperNode.curve = makeDistortionCurve(curveAmount); + _this.waveShaperNode.oversample = oversample; + + _this.input.connect(_this.waveShaperNode); + + _this.waveShaperNode.connect(_this.wet); + + return _this; + } + /** + * Process a sound source, optionally specify amount and oversample values. + * + * @method process + * @for p5.Distortion + * @param {Number} [amount=0.25] Unbounded distortion amount. + * Normal values range from 0-1. + * @param {String} [oversample='none'] 'none', '2x', or '4x'. + */ + + + distortion_createClass(Distortion, [{ + key: "process", + value: function process(src, amount, oversample) { + src.connect(this.input); + this.set(amount, oversample); + } + /** + * Set the amount and oversample of the waveshaper distortion. + * + * @method set + * @for p5.Distortion + * @param {Number} [amount=0.25] Unbounded distortion amount. + * Normal values range from 0-1. + * @param {String} [oversample='none'] 'none', '2x', or '4x'. + */ + + }, { + key: "set", + value: function set(amount, oversample) { + if (amount) { + var curveAmount = p5.prototype.map(amount, 0.0, 1.0, 0, 2000); + this.amount = curveAmount; + this.waveShaperNode.curve = makeDistortionCurve(curveAmount); + } + + if (oversample) { + this.waveShaperNode.oversample = oversample; + } + } + /** + * Return the distortion amount, typically between 0-1. + * + * @method getAmount + * @for p5.Distortion + * @return {Number} Unbounded distortion amount. + * Normal values range from 0-1. + */ + + }, { + key: "getAmount", + value: function getAmount() { + return this.amount; + } + /** + * Return the oversampling. + * + * @method getOversample + * @for p5.Distortion + * @return {String} Oversample can either be 'none', '2x', or '4x'. + */ + + }, { + key: "getOversample", + value: function getOversample() { + return this.waveShaperNode.oversample; + } + }, { + key: "dispose", + value: function dispose() { + distortion_get(distortion_getPrototypeOf(Distortion.prototype), "dispose", this).call(this); + + if (this.waveShaperNode) { + this.waveShaperNode.disconnect(); + this.waveShaperNode = null; + } + } + }]); + + return Distortion; +}(effect); + + var distortion = (Distortion); +function gain_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function gain_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function gain_createClass(Constructor, protoProps, staticProps) { if (protoProps) gain_defineProperties(Constructor.prototype, protoProps); if (staticProps) gain_defineProperties(Constructor, staticProps); return Constructor; } + + +/** + * A gain node is usefull to set the relative volume of sound. + * It's typically used to build mixers. + * + * @class p5.Gain + * @constructor + * @example + *
                          + * + * // load two soundfile and crossfade beetween them + * let sound1,sound2; + * let sound1Gain, sound2Gain, mixGain; + * function preload(){ + * soundFormats('ogg', 'mp3'); + * sound1 = loadSound('assets/Damscray_-_Dancing_Tiger_01'); + * sound2 = loadSound('assets/beat'); + * } + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(startSound); + * // create a 'mix' gain bus to which we will connect both soundfiles + * mixGain = new p5.Gain(); + * mixGain.connect(); + * sound1.disconnect(); // diconnect from p5 output + * sound1Gain = new p5.Gain(); // setup a gain node + * sound1Gain.setInput(sound1); // connect the first sound to its input + * sound1Gain.connect(mixGain); // connect its output to the final mix bus + * sound2.disconnect(); + * sound2Gain = new p5.Gain(); + * sound2Gain.setInput(sound2); + * sound2Gain.connect(mixGain); + * } + * function startSound() { + * sound1.loop(); + * sound2.loop(); + * loop(); + * } + * function mouseReleased() { + * sound1.stop(); + * sound2.stop(); + * } + * function draw(){ + * background(220); + * textAlign(CENTER); + * textSize(11); + * fill(0); + * if (!sound1.isPlaying()) { + * text('tap and drag to play', width/2, height/2); + * return; + * } + * // map the horizontal position of the mouse to values useable for volume * control of sound1 + * var sound1Volume = constrain(map(mouseX,width,0,0,1), 0, 1); + * var sound2Volume = 1-sound1Volume; + * sound1Gain.amp(sound1Volume); + * sound2Gain.amp(sound2Volume); + * // map the vertical position of the mouse to values useable for 'output * volume control' + * var outputVolume = constrain(map(mouseY,height,0,0,1), 0, 1); + * mixGain.amp(outputVolume); + * text('output', width/2, height - outputVolume * height * 0.9) + * fill(255, 0, 255); + * textAlign(LEFT); + * text('sound1', 5, height - sound1Volume * height * 0.9); + * textAlign(RIGHT); + * text('sound2', width - 5, height - sound2Volume * height * 0.9); + * } + *
                          + */ + +var gain_Gain = +function () { + function Gain() { + gain_classCallCheck(this, Gain); + + this.ac = main.audiocontext; + this.input = this.ac.createGain(); + this.output = this.ac.createGain(); + + this.input.gain.value = 0.5; + this.input.connect(this.output); + + main.soundArray.push(this); + } + /** + * Connect a source to the gain node. + * + * @method setInput + * @for p5.Gain + * @param {Object} src p5.sound / Web Audio object with a sound + * output. + */ + + + gain_createClass(Gain, [{ + key: "setInput", + value: function setInput(src) { + src.connect(this.input); + } + /** + * Send output to a p5.sound or web audio object + * + * @method connect + * @for p5.Gain + * @param {Object} unit + */ + + }, { + key: "connect", + value: function connect(unit) { + var u = unit || p5.soundOut.input; + this.output.connect(u.input ? u.input : u); + } + /** + * Disconnect all output. + * + * @method disconnect + * @for p5.Gain + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + } + /** + * Set the output level of the gain node. + * + * @method amp + * @for p5.Gain + * @param {Number} volume amplitude between 0 and 1.0 + * @param {Number} [rampTime] create a fade that lasts rampTime + * @param {Number} [timeFromNow] schedule this event to happen + * seconds from now + */ + + }, { + key: "amp", + value: function amp(vol) { + var rampTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var tFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var now = main.audiocontext.currentTime; + var currentVol = this.output.gain.value; + this.output.gain.cancelScheduledValues(now); + this.output.gain.linearRampToValueAtTime(currentVol, now + tFromNow); + this.output.gain.linearRampToValueAtTime(vol, now + tFromNow + rampTime); + } + }, { + key: "dispose", + value: function dispose() { + var index = main.soundArray.indexOf(this); + main.soundArray.splice(index, 1); + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + + if (this.input) { + this.input.disconnect(); + delete this.input; + } + } + }]); + + return Gain; +}(); + + var gain = (gain_Gain); +function audioVoice_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function audioVoice_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function audioVoice_createClass(Constructor, protoProps, staticProps) { if (protoProps) audioVoice_defineProperties(Constructor.prototype, protoProps); if (staticProps) audioVoice_defineProperties(Constructor, staticProps); return Constructor; } + + +/** + * Base class for monophonic synthesizers. Any extensions of this class + * should follow the API and implement the methods below in order to + * remain compatible with p5.PolySynth(); + * + * @class p5.AudioVoice + * @constructor + */ + +var audioVoice_AudioVoice = +function () { + function AudioVoice() { + audioVoice_classCallCheck(this, AudioVoice); + + this.ac = main.audiocontext; + this.output = this.ac.createGain(); + this.connect(); + main.soundArray.push(this); + } + + audioVoice_createClass(AudioVoice, [{ + key: "play", + value: function play(note, velocity, secondsFromNow, sustime) {} + }, { + key: "triggerAttack", + value: function triggerAttack(note, velocity, secondsFromNow) {} + }, { + key: "triggerRelease", + value: function triggerRelease(secondsFromNow) {} + }, { + key: "amp", + value: function amp(vol, rampTime) {} + /** + * Connect to p5 objects or Web Audio Nodes + * @method connect + * @for p5.AudioVoice + * @param {Object} unit + */ + + }, { + key: "connect", + value: function connect(unit) { + var u = unit || main.input; + this.output.connect(u.input ? u.input : u); + } + /** + * Disconnect from soundOut + * @method disconnect + * @for p5.AudioVoice + */ + + }, { + key: "disconnect", + value: function disconnect() { + this.output.disconnect(); + } + }, { + key: "dispose", + value: function dispose() { + if (this.output) { + this.output.disconnect(); + delete this.output; + } + } + }]); + + return AudioVoice; +}(); + + var audioVoice_0 = (audioVoice_AudioVoice); +function monosynth_typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { monosynth_typeof = function _typeof(obj) { return typeof obj; }; } else { monosynth_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return monosynth_typeof(obj); } + +function monosynth_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function monosynth_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function monosynth_createClass(Constructor, protoProps, staticProps) { if (protoProps) monosynth_defineProperties(Constructor.prototype, protoProps); if (staticProps) monosynth_defineProperties(Constructor, staticProps); return Constructor; } + +function monosynth_possibleConstructorReturn(self, call) { if (call && (monosynth_typeof(call) === "object" || typeof call === "function")) { return call; } return monosynth_assertThisInitialized(self); } + +function monosynth_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function monosynth_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { monosynth_get = Reflect.get; } else { monosynth_get = function _get(target, property, receiver) { var base = monosynth_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return monosynth_get(target, property, receiver || target); } + +function monosynth_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = monosynth_getPrototypeOf(object); if (object === null) break; } return object; } + +function monosynth_getPrototypeOf(o) { monosynth_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return monosynth_getPrototypeOf(o); } + +function monosynth_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) monosynth_setPrototypeOf(subClass, superClass); } + +function monosynth_setPrototypeOf(o, p) { monosynth_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return monosynth_setPrototypeOf(o, p); } + + + + + + +var DEFAULT_SUSTAIN = 0.15; +/** + * A MonoSynth is used as a single voice for sound synthesis. + * This is a class to be used in conjunction with the PolySynth + * class. Custom synthetisers should be built inheriting from + * this class. + * + * @class p5.MonoSynth + * @constructor + * @example + *
                          + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * textAlign(CENTER); + * text('tap to play', width/2, height/2); + * + * monoSynth = new p5.MonoSynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * let note = random(['Fb4', 'G4']); + * // note velocity (volume, from 0 to 1) + * let velocity = random(); + * // time from now (in seconds) + * let time = 0; + * // note duration (in seconds) + * let dur = 1/6; + * + * monoSynth.play(note, velocity, time, dur); + * } + *
                          + **/ + +var monosynth_MonoSynth = +function (_AudioVoice) { + monosynth_inherits(MonoSynth, _AudioVoice); + + function MonoSynth() { + var _this; + + monosynth_classCallCheck(this, MonoSynth); + + _this = monosynth_possibleConstructorReturn(this, monosynth_getPrototypeOf(MonoSynth).call(this)); + _this.oscillator = new oscillator(); + _this.env = new envelope(); + + _this.env.setRange(1, 0); + + _this.env.setExp(true); + + + _this.setADSR(0.02, 0.25, 0.05, 0.35); + + + _this.oscillator.disconnect(); + + _this.oscillator.connect(_this.output); + + _this.env.disconnect(); + + _this.env.setInput(_this.output.gain); + + + _this.oscillator.output.gain.value = 1.0; + + _this.oscillator.start(); + + _this.connect(); + + main.soundArray.push(monosynth_assertThisInitialized(_this)); + /** + * Getters and Setters + * @property {Number} attack + * @for p5.MonoSynth + */ + + /** + * @property {Number} decay + * @for p5.MonoSynth + */ + + /** + * @property {Number} sustain + * @for p5.MonoSynth + */ + + /** + * @property {Number} release + * @for p5.MonoSynth + */ + + Object.defineProperties(monosynth_assertThisInitialized(_this), { + attack: { + get: function get() { + return this.env.aTime; + }, + set: function set(attack) { + this.env.setADSR(attack, this.env.dTime, this.env.sPercent, this.env.rTime); + } + }, + decay: { + get: function get() { + return this.env.dTime; + }, + set: function set(decay) { + this.env.setADSR(this.env.aTime, decay, this.env.sPercent, this.env.rTime); + } + }, + sustain: { + get: function get() { + return this.env.sPercent; + }, + set: function set(sustain) { + this.env.setADSR(this.env.aTime, this.env.dTime, sustain, this.env.rTime); + } + }, + release: { + get: function get() { + return this.env.rTime; + }, + set: function set(release) { + this.env.setADSR(this.env.aTime, this.env.dTime, this.env.sPercent, release); + } + } + }); + return _this; + } + /** + * Play tells the MonoSynth to start playing a note. This method schedules + * the calling of .triggerAttack and .triggerRelease. + * + * @method play + * @for p5.MonoSynth + * @param {String | Number} note the note you want to play, specified as a + * frequency in Hertz (Number) or as a midi + * value in Note/Octave format ("C4", "Eb3"...etc") + * See + * Tone. Defaults to 440 hz. + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) + * @param {Number} [secondsFromNow] time from now (in seconds) at which to play + * @param {Number} [sustainTime] time to sustain before releasing the envelope. Defaults to 0.15 seconds. + * @example + *
                          + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * textAlign(CENTER); + * text('tap to play', width/2, height/2); + * + * monoSynth = new p5.MonoSynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * let note = random(['Fb4', 'G4']); + * // note velocity (volume, from 0 to 1) + * let velocity = random(); + * // time from now (in seconds) + * let time = 0; + * // note duration (in seconds) + * let dur = 1/6; + * + * monoSynth.play(note, velocity, time, dur); + * } + *
                          + * + */ + + + monosynth_createClass(MonoSynth, [{ + key: "play", + value: function play(note, velocity, secondsFromNow, susTime) { + this.triggerAttack(note, velocity, ~~secondsFromNow); + this.triggerRelease(~~secondsFromNow + (susTime || DEFAULT_SUSTAIN)); + } + /** + * Trigger the Attack, and Decay portion of the Envelope. + * Similar to holding down a key on a piano, but it will + * hold the sustain level until you let go. + * + * @param {String | Number} note the note you want to play, specified as a + * frequency in Hertz (Number) or as a midi + * value in Note/Octave format ("C4", "Eb3"...etc") + * See + * Tone. Defaults to 440 hz + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) + * @param {Number} [secondsFromNow] time from now (in seconds) at which to play + * @method triggerAttack + * @for p5.MonoSynth + * @example + *
                          + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(triggerAttack); + * background(220); + * text('tap here for attack, let go to release', 5, 20, width - 20); + * monoSynth = new p5.MonoSynth(); + * } + * + * function triggerAttack() { + * userStartAudio(); + * + * monoSynth.triggerAttack("E3"); + * } + * + * function mouseReleased() { + * monoSynth.triggerRelease(); + * } + *
                          + */ + + }, { + key: "triggerAttack", + value: function triggerAttack(note, velocity) { + var secondsFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var freq = noteToFreq(note); + var vel = velocity || 0.1; + this.oscillator.freq(freq, 0, secondsFromNow); + this.env.ramp(this.output.gain, secondsFromNow, vel); + } + /** + * Trigger the release of the Envelope. This is similar to releasing + * the key on a piano and letting the sound fade according to the + * release level and release time. + * + * @param {Number} secondsFromNow time to trigger the release + * @method triggerRelease + * @for p5.MonoSynth + * @example + *
                          + * let monoSynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(triggerAttack); + * background(220); + * text('tap here for attack, let go to release', 5, 20, width - 20); + * monoSynth = new p5.MonoSynth(); + * } + * + * function triggerAttack() { + * userStartAudio(); + * + * monoSynth.triggerAttack("E3"); + * } + * + * function mouseReleased() { + * monoSynth.triggerRelease(); + * } + *
                          + */ + + }, { + key: "triggerRelease", + value: function triggerRelease() { + var secondsFromNow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + this.env.ramp(this.output.gain, secondsFromNow, 0); + } + /** + * Set values like a traditional + * + * ADSR envelope + * . + * + * @method setADSR + * @for p5.MonoSynth + * @param {Number} attackTime Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + */ + + }, { + key: "setADSR", + value: function setADSR(attack, decay, sustain, release) { + this.env.setADSR(attack, decay, sustain, release); + } + /** + * MonoSynth amp + * @method amp + * @for p5.MonoSynth + * @param {Number} vol desired volume + * @param {Number} [rampTime] Time to reach new volume + * @return {Number} new volume value + */ + + }, { + key: "amp", + value: function amp(vol, rampTime) { + var t = rampTime || 0; + + if (typeof vol !== 'undefined') { + this.oscillator.amp(vol, t); + } + + return this.oscillator.amp().value; + } + /** + * Connect to a p5.sound / Web Audio object. + * + * @method connect + * @for p5.MonoSynth + * @param {Object} unit A p5.sound or Web Audio object + */ + + }, { + key: "connect", + value: function connect(unit) { + var u = unit || main.input; + this.output.connect(u.input ? u.input : u); + } + /** + * Disconnect all outputs + * + * @method disconnect + * @for p5.MonoSynth + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + } + /** + * Get rid of the MonoSynth and free up its resources / memory. + * + * @method dispose + * @for p5.MonoSynth + */ + + }, { + key: "dispose", + value: function dispose() { + monosynth_get(monosynth_getPrototypeOf(MonoSynth.prototype), "dispose", this).call(this); + + if (this.env) { + this.env.dispose(); + } + + if (this.oscillator) { + this.oscillator.dispose(); + } + } + }]); + + return MonoSynth; +}(audioVoice_0); + + var monosynth = (monosynth_MonoSynth); +function onsetDetect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function onsetDetect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function onsetDetect_createClass(Constructor, protoProps, staticProps) { if (protoProps) onsetDetect_defineProperties(Constructor.prototype, protoProps); if (staticProps) onsetDetect_defineProperties(Constructor, staticProps); return Constructor; } + +/** + * Listen for onsets (a sharp increase in volume) within a given + * frequency range. + * + * @class p5.OnsetDetect + * @constructor + * @param {Number} freqLow Low frequency + * @param {Number} freqHigh High frequency + * @param {Number} threshold Amplitude threshold between 0 (no energy) and 1 (maximum) + * @param {Function} callback Function to call when an onset is detected + */ +var OnsetDetect = +function () { + function OnsetDetect(freqLow, freqHigh, threshold, callback) { + onsetDetect_classCallCheck(this, OnsetDetect); + + this.isDetected = false; + this.freqLow = freqLow; + this.freqHigh = freqHigh; + this.treshold = threshold; + this.energy = 0; + this.penergy = 0; + + this.sensitivity = 500; + this.callback = callback; + } + + + onsetDetect_createClass(OnsetDetect, [{ + key: "update", + value: function update(fftObject, callback) { + this.energy = fftObject.getEnergy(this.freqLow, this.freqHigh) / 255; + + if (this.isDetected === false) { + if (this.energy - this.penergy > this.treshold) { + this.isDetected = true; + + if (this.callback) { + this.callback(this.energy); + } else if (callback) { + callback(this.energy); + } + + var self = this; + setTimeout(function () { + self.isDetected = false; + }, this.sensitivity); + } + } + + this.penergy = this.energy; + } + }]); + + return OnsetDetect; +}(); + + var onsetDetect = (OnsetDetect); +function polysynth_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function polysynth_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function polysynth_createClass(Constructor, protoProps, staticProps) { if (protoProps) polysynth_defineProperties(Constructor.prototype, protoProps); if (staticProps) polysynth_defineProperties(Constructor, staticProps); return Constructor; } + + + + +/** + * An AudioVoice is used as a single voice for sound synthesis. + * The PolySynth class holds an array of AudioVoice, and deals + * with voices allocations, with setting notes to be played, and + * parameters to be set. + * + * @class p5.PolySynth + * @constructor + * + * @param {Number} [synthVoice] A monophonic synth voice inheriting + * the AudioVoice class. Defaults to p5.MonoSynth + * @param {Number} [maxVoices] Number of voices, defaults to 8; + * @example + *
                          + * let polySynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * text('click to play', 20, 20); + * + * polySynth = new p5.PolySynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * // note duration (in seconds) + * let dur = 1.5; + * + * // time from now (in seconds) + * let time = 0; + * + * // velocity (volume, from 0 to 1) + * let vel = 0.1; + * + * // notes can overlap with each other + * polySynth.play('G2', vel, 0, dur); + * polySynth.play('C3', vel, time += 1/3, dur); + * polySynth.play('G3', vel, time += 1/3, dur); + * } + *
                          + **/ + +var polysynth_PolySynth = +function () { + function PolySynth(audioVoice, maxVoices) { + polysynth_classCallCheck(this, PolySynth); + + this.audiovoices = []; + /** + * An object that holds information about which notes have been played and + * which notes are currently being played. New notes are added as keys + * on the fly. While a note has been attacked, but not released, the value of the + * key is the audiovoice which is generating that note. When notes are released, + * the value of the key becomes undefined. + * @property notes + */ + + this.notes = {}; + + this._newest = 0; + this._oldest = 0; + /** + * A PolySynth must have at least 1 voice, defaults to 8 + * @property polyvalue + */ + + this.maxVoices = maxVoices || 8; + /** + * Monosynth that generates the sound for each note that is triggered. The + * p5.PolySynth defaults to using the p5.MonoSynth as its voice. + * @property AudioVoice + */ + + this.AudioVoice = audioVoice === undefined ? p5.MonoSynth : audioVoice; + /** + * This value must only change as a note is attacked or released. Due to delay + * and sustain times, Tone.TimelineSignal is required to schedule the change in value. + * @private + * @property {Tone.TimelineSignal} _voicesInUse + */ + + this._voicesInUse = new TimelineSignal_default.a(0); + this.output = main.audiocontext.createGain(); + this.connect(); + + this._allocateVoices(); + + main.soundArray.push(this); + } + /** + * Construct the appropriate number of audiovoices + * @private + * @for p5.PolySynth + * @method _allocateVoices + */ + + + polysynth_createClass(PolySynth, [{ + key: "_allocateVoices", + value: function _allocateVoices() { + for (var i = 0; i < this.maxVoices; i++) { + this.audiovoices.push(new this.AudioVoice()); + this.audiovoices[i].disconnect(); + this.audiovoices[i].connect(this.output); + } + } + /** + * Play a note by triggering noteAttack and noteRelease with sustain time + * + * @method play + * @for p5.PolySynth + * @param {Number} [note] midi note to play (ranging from 0 to 127 - 60 being a middle C) + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1) + * @param {Number} [secondsFromNow] time from now (in seconds) at which to play + * @param {Number} [sustainTime] time to sustain before releasing the envelope + * @example + *
                          + * let polySynth; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playSynth); + * background(220); + * text('click to play', 20, 20); + * + * polySynth = new p5.PolySynth(); + * } + * + * function playSynth() { + * userStartAudio(); + * + * // note duration (in seconds) + * let dur = 1.5; + * + * // time from now (in seconds) + * let time = 0; + * + * // velocity (volume, from 0 to 1) + * let vel = 0.1; + * + * // notes can overlap with each other + * polySynth.play('G2', vel, 0, dur); + * polySynth.play('C3', vel, time += 1/3, dur); + * polySynth.play('G3', vel, time += 1/3, dur); + * } + *
                          + */ + + }, { + key: "play", + value: function play(note, velocity, secondsFromNow) { + var susTime = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + this.noteAttack(note, velocity, secondsFromNow); + this.noteRelease(note, secondsFromNow + susTime); + } + /** + * noteADSR sets the envelope for a specific note that has just been triggered. + * Using this method modifies the envelope of whichever audiovoice is being used + * to play the desired note. The envelope should be reset before noteRelease is called + * in order to prevent the modified envelope from being used on other notes. + * + * @method noteADSR + * @for p5.PolySynth + * @param {Number} [note] Midi note on which ADSR should be set. + * @param {Number} [attackTime] Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + **/ + + }, { + key: "noteADSR", + value: function noteADSR(note, a, d, s, r) { + var timeFromNow = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + var now = main.audiocontext.currentTime; + var t = now + timeFromNow; + this.audiovoices[this.notes[note].getValueAtTime(t)].setADSR(a, d, s, r); + } + /** + * Set the PolySynths global envelope. This method modifies the envelopes of each + * monosynth so that all notes are played with this envelope. + * + * @method setADSR + * @for p5.PolySynth + * @param {Number} [attackTime] Time (in seconds before envelope + * reaches Attack Level + * @param {Number} [decayTime] Time (in seconds) before envelope + * reaches Decay/Sustain Level + * @param {Number} [susRatio] Ratio between attackLevel and releaseLevel, on a scale from 0 to 1, + * where 1.0 = attackLevel, 0.0 = releaseLevel. + * The susRatio determines the decayLevel and the level at which the + * sustain portion of the envelope will sustain. + * For example, if attackLevel is 0.4, releaseLevel is 0, + * and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is + * increased to 1.0 (using setRange), + * then decayLevel would increase proportionally, to become 0.5. + * @param {Number} [releaseTime] Time in seconds from now (defaults to 0) + **/ + + }, { + key: "setADSR", + value: function setADSR(a, d, s, r) { + this.audiovoices.forEach(function (voice) { + voice.setADSR(a, d, s, r); + }); + } + /** + * Trigger the Attack, and Decay portion of a MonoSynth. + * Similar to holding down a key on a piano, but it will + * hold the sustain level until you let go. + * + * @method noteAttack + * @for p5.PolySynth + * @param {Number} [note] midi note on which attack should be triggered. + * @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1)/ + * @param {Number} [secondsFromNow] time from now (in seconds) + * @example + *
                          + * let polySynth = new p5.PolySynth(); + * let pitches = ['G', 'D', 'G', 'C']; + * let octaves = [2, 3, 4]; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playChord); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function playChord() { + * userStartAudio(); + * + * // play a chord: multiple notes at the same time + * for (let i = 0; i < 4; i++) { + * let note = random(pitches) + random(octaves); + * polySynth.noteAttack(note, 0.1); + * } + * } + * + * function mouseReleased() { + * // release all voices + * polySynth.noteRelease(); + * } + *
                          + */ + + }, { + key: "noteAttack", + value: function noteAttack(_note, _velocity) { + var secondsFromNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var acTime = main.audiocontext.currentTime + secondsFromNow; + + var note = noteToFreq(_note); + var velocity = _velocity || 0.1; + var currentVoice; + + if (this.notes[note] && this.notes[note].getValueAtTime(acTime) !== null) { + this.noteRelease(note, 0); + } + + + if (this._voicesInUse.getValueAtTime(acTime) < this.maxVoices) { + currentVoice = Math.max(~~this._voicesInUse.getValueAtTime(acTime), 0); + } + else { + currentVoice = this._oldest; + oldestNote = freqToMidi(this.audiovoices[this._oldest].oscillator.freq().value); + this.noteRelease(oldestNote); + this._oldest = (this._oldest + 1) % (this.maxVoices - 1); + } + + + this.notes[note] = new TimelineSignal_default.a(); + this.notes[note].setValueAtTime(currentVoice, acTime); + + var previousVal = this._voicesInUse._searchBefore(acTime) === null ? 0 : this._voicesInUse._searchBefore(acTime).value; + + this._voicesInUse.setValueAtTime(previousVal + 1, acTime); + + + this._updateAfter(acTime, 1); + + this._newest = currentVoice; + + if (typeof velocity === 'number') { + var maxRange = 1 / this._voicesInUse.getValueAtTime(acTime) * 2; + velocity = velocity > maxRange ? maxRange : velocity; + } + + + this.audiovoices[currentVoice].triggerAttack(note, velocity, secondsFromNow); + } + /** + * Private method to ensure accurate values of this._voicesInUse + * Any time a new value is scheduled, it is necessary to increment all subsequent + * scheduledValues after attack, and decrement all subsequent + * scheduledValues after release + * + * @private + * @for p5.PolySynth + * @param {[type]} time [description] + * @param {[type]} value [description] + * @return {[type]} [description] + */ + + }, { + key: "_updateAfter", + value: function _updateAfter(time, value) { + if (this._voicesInUse._searchAfter(time) === null) { + return; + } else { + this._voicesInUse._searchAfter(time).value += value; + + var nextTime = this._voicesInUse._searchAfter(time).time; + + this._updateAfter(nextTime, value); + } + } + /** + * Trigger the Release of an AudioVoice note. This is similar to releasing + * the key on a piano and letting the sound fade according to the + * release level and release time. + * + * @method noteRelease + * @for p5.PolySynth + * @param {Number} [note] midi note on which attack should be triggered. + * If no value is provided, all notes will be released. + * @param {Number} [secondsFromNow] time to trigger the release + * @example + *
                          + * let polySynth = new p5.PolySynth(); + * let pitches = ['G', 'D', 'G', 'C']; + * let octaves = [2, 3, 4]; + * + * function setup() { + * let cnv = createCanvas(100, 100); + * cnv.mousePressed(playChord); + * background(220); + * text('tap to play', 20, 20); + * } + * + * function playChord() { + * userStartAudio(); + * + * // play a chord: multiple notes at the same time + * for (let i = 0; i < 4; i++) { + * let note = random(pitches) + random(octaves); + * polySynth.noteAttack(note, 0.1); + * } + * } + * + * function mouseReleased() { + * // release all voices + * polySynth.noteRelease(); + * } + *
                          + * + */ + + }, { + key: "noteRelease", + value: function noteRelease(_note, secondsFromNow) { + var now = main.audiocontext.currentTime; + var tFromNow = secondsFromNow || 0; + var t = now + tFromNow; + + if (!_note) { + this.audiovoices.forEach(function (voice) { + voice.triggerRelease(tFromNow); + }); + + this._voicesInUse.setValueAtTime(0, t); + + for (var n in this.notes) { + this.notes[n].dispose(); + delete this.notes[n]; + } + + return; + } + + + var note = noteToFreq(_note); + + if (!this.notes[note] || this.notes[note].getValueAtTime(t) === null) { + console.warn('Cannot release a note that is not already playing'); + } else { + var previousVal = Math.max(~~this._voicesInUse.getValueAtTime(t).value, 1); + + this._voicesInUse.setValueAtTime(previousVal - 1, t); + + + if (previousVal > 0) { + this._updateAfter(t, -1); + } + + this.audiovoices[this.notes[note].getValueAtTime(t)].triggerRelease(tFromNow); + this.notes[note].dispose(); + delete this.notes[note]; + this._newest = this._newest === 0 ? 0 : (this._newest - 1) % (this.maxVoices - 1); + } + } + /** + * Connect to a p5.sound / Web Audio object. + * + * @method connect + * @for p5.PolySynth + * @param {Object} unit A p5.sound or Web Audio object + */ + + }, { + key: "connect", + value: function connect(unit) { + var u = unit || main.input; + this.output.connect(u.input ? u.input : u); + } + /** + * Disconnect all outputs + * + * @method disconnect + * @for p5.PolySynth + */ + + }, { + key: "disconnect", + value: function disconnect() { + if (this.output) { + this.output.disconnect(); + } + } + /** + * Get rid of the MonoSynth and free up its resources / memory. + * + * @method dispose + * @for p5.PolySynth + */ + + }, { + key: "dispose", + value: function dispose() { + this.audiovoices.forEach(function (voice) { + voice.dispose(); + }); + + if (this.output) { + this.output.disconnect(); + delete this.output; + } + } + }]); + + return PolySynth; +}(); + + var polysynth = (polysynth_PolySynth); +function Signal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Signal_Signal = function Signal() { + Signal_classCallCheck(this, Signal); + + console.warn('p5.Signal is deprecated , Use Tone.js Signal instead '); +}; + + var deprecations_Signal = (Signal_Signal); + + + +p5.prototype.getAudioContext = audiocontext["b" ]; +p5.prototype.userStartAudio = audiocontext["c" ]; + + +p5.prototype.sampleRate = sampleRate; +p5.prototype.freqToMidi = freqToMidi; +p5.prototype.midiToFreq = midiToFreq; +p5.prototype.noteToFreq = noteToFreq; +p5.prototype.soundFormats = soundFormats; +p5.prototype.disposeSound = disposeSound; +p5.prototype._checkFileFormats = _checkFileFormats; +p5.prototype._mathChain = _mathChain; +p5.prototype.convertToWav = convertToWav; +p5.prototype.interleave = interleave; +p5.prototype.writeUTFBytes = writeUTFBytes; +p5.prototype.safeBufferSize = safeBufferSize; +p5.prototype.saveSound = saveSound; + +p5.prototype.registerMethod('remove', p5.prototype.disposeSound); + + + +p5.Panner = panner_0; + +p5.SoundFile = soundfile; +p5.prototype.loadSound = loadSound; + +p5.prototype.registerPreloadMethod('loadSound', p5.prototype); + +p5.Amplitude = amplitude; + +p5.FFT = fft; + +p5.Oscillator = oscillator; +p5.SinOsc = SinOsc; +p5.TriOsc = TriOsc; +p5.SawOsc = SawOsc; +p5.SqrOsc = SqrOsc; + + +p5.Noise = noise; + +p5.Pulse = pulse; - p5.Noise = noise; +p5.AudioIn = audioin; - p5.Pulse = pulse; +p5.Effect = effect; - p5.AudioIn = audioin; +p5.Filter = filter; +p5.LowPass = LowPass; +p5.HighPass = HighPass; +p5.BandPass = BandPass; - p5.Effect = effect; +p5.EQ = eq; - p5.Filter = filter; - p5.LowPass = LowPass; - p5.HighPass = HighPass; - p5.BandPass = BandPass; +p5.listener3D = listener3d; - p5.EQ = eq; +p5.Panner3D = panner3d; - p5.listener3D = listener3d; +p5.Delay = delay; - p5.Panner3D = panner3d; +p5.Reverb = Reverb; +p5.Convolver = reverb_Convolver; +p5.prototype.createConvolver = createConvolver; +p5.prototype.registerPreloadMethod('createConvolver', p5.prototype); - p5.Delay = delay; +p5.Metro = metro; - p5.Reverb = Reverb; - p5.Convolver = reverb_Convolver; - p5.prototype.createConvolver = createConvolver; - p5.prototype.registerPreloadMethod("createConvolver", p5.prototype); +p5.Phrase = Phrase; +p5.Part = looper_Part; +p5.Score = Score; - p5.Metro = metro; +p5.SoundLoop = soundLoop; - p5.Phrase = Phrase; - p5.Part = looper_Part; - p5.Score = Score; +p5.Compressor = compressor; - p5.SoundLoop = soundLoop; +p5.peakDetect = peakDetect; - p5.Compressor = compressor; +p5.SoundRecorder = soundRecorder; - p5.peakDetect = peakDetect; +p5.Distortion = distortion; - p5.SoundRecorder = soundRecorder; +p5.Gain = gain; - p5.Distortion = distortion; +p5.AudioVoice = audioVoice_0; - p5.Gain = gain; +p5.MonoSynth = monosynth; - p5.AudioVoice = audioVoice_0; +p5.OnsetDetect = onsetDetect; - p5.MonoSynth = monosynth; +p5.PolySynth = polysynth; - p5.OnsetDetect = onsetDetect; +p5.PeakDetect = peakDetect; - p5.PolySynth = polysynth; - p5.PeakDetect = peakDetect; +p5.Signal = deprecations_Signal; - p5.Signal = deprecations_Signal; - }, -]); + }) + ]); diff --git a/public/lib/addons/p5.sound.min.js b/public/lib/addons/p5.sound.min.js index c7bb085..44f2523 100644 --- a/public/lib/addons/p5.sound.min.js +++ b/public/lib/addons/p5.sound.min.js @@ -1,9485 +1,3 @@ -/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ -!(function (n) { - var i = {}; - function r(t) { - if (i[t]) return i[t].exports; - var e = (i[t] = { i: t, l: !1, exports: {} }); - return n[t].call(e.exports, e, e.exports, r), (e.l = !0), e.exports; - } - (r.m = n), - (r.c = i), - (r.d = function (t, e, n) { - r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); - }), - (r.r = function (t) { - "undefined" != typeof Symbol && - Symbol.toStringTag && - Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), - Object.defineProperty(t, "__esModule", { value: !0 }); - }), - (r.t = function (e, t) { - if ((1 & t && (e = r(e)), 8 & t)) return e; - if (4 & t && "object" == typeof e && e && e.__esModule) return e; - var n = Object.create(null); - if ( - (r.r(n), - Object.defineProperty(n, "default", { enumerable: !0, value: e }), - 2 & t && "string" != typeof e) - ) - for (var i in e) - r.d( - n, - i, - function (t) { - return e[t]; - }.bind(null, i), - ); - return n; - }), - (r.n = function (t) { - var e = - t && t.__esModule - ? function () { - return t.default; - } - : function () { - return t; - }; - return r.d(e, "a", e), e; - }), - (r.o = function (t, e) { - return Object.prototype.hasOwnProperty.call(t, e); - }), - (r.p = ""), - r((r.s = 40)); -})([ - function (t, e, n) { - var i; - void 0 === - (i = function () { - "use strict"; - function l(t, e) { - this.isUndef(t) || 1 === t - ? (this.input = this.context.createGain()) - : 1 < t && (this.input = new Array(t)), - this.isUndef(e) || 1 === e - ? (this.output = this.context.createGain()) - : 1 < e && (this.output = new Array(t)); - } - var e; - return ( - (l.prototype.set = function (t, e, n) { - if (this.isObject(t)) n = e; - else if (this.isString(t)) { - var i = {}; - (i[t] = e), (t = i); - } - t: for (var r in t) { - e = t[r]; - var o = this; - if (-1 !== r.indexOf(".")) { - for (var s = r.split("."), a = 0; a < s.length - 1; a++) - if ((o = o[s[a]]) instanceof l) { - s.splice(0, a + 1); - var u = s.join("."); - o.set(u, e); - continue t; - } - r = s[s.length - 1]; - } - var c = o[r]; - this.isUndef(c) || - ((l.Signal && c instanceof l.Signal) || - (l.Param && c instanceof l.Param) - ? c.value !== e && - (this.isUndef(n) ? (c.value = e) : c.rampTo(e, n)) - : c instanceof AudioParam - ? c.value !== e && (c.value = e) - : c instanceof l - ? c.set(e) - : c !== e && (o[r] = e)); - } - return this; - }), - (l.prototype.get = function (t) { - this.isUndef(t) - ? (t = this._collectDefaults(this.constructor)) - : this.isString(t) && (t = [t]); - for (var e = {}, n = 0; n < t.length; n++) { - var i = t[n], - r = this, - o = e; - if (-1 !== i.indexOf(".")) { - for (var s = i.split("."), a = 0; a < s.length - 1; a++) { - var u = s[a]; - (o[u] = o[u] || {}), (o = o[u]), (r = r[u]); - } - i = s[s.length - 1]; - } - var c = r[i]; - this.isObject(t[i]) - ? (o[i] = c.get()) - : l.Signal && c instanceof l.Signal - ? (o[i] = c.value) - : l.Param && c instanceof l.Param - ? (o[i] = c.value) - : c instanceof AudioParam - ? (o[i] = c.value) - : c instanceof l - ? (o[i] = c.get()) - : this.isFunction(c) || this.isUndef(c) || (o[i] = c); - } - return e; - }), - (l.prototype._collectDefaults = function (t) { - var e = []; - if ( - (this.isUndef(t.defaults) || (e = Object.keys(t.defaults)), - !this.isUndef(t._super)) - ) - for ( - var n = this._collectDefaults(t._super), i = 0; - i < n.length; - i++ - ) - -1 === e.indexOf(n[i]) && e.push(n[i]); - return e; - }), - (l.prototype.toString = function () { - for (var t in l) { - var e = t[0].match(/^[A-Z]$/), - n = l[t] === this.constructor; - if (this.isFunction(l[t]) && e && n) return t; - } - return "Tone"; - }), - Object.defineProperty(l.prototype, "numberOfInputs", { - get: function () { - return this.input - ? this.isArray(this.input) - ? this.input.length - : 1 - : 0; - }, - }), - Object.defineProperty(l.prototype, "numberOfOutputs", { - get: function () { - return this.output - ? this.isArray(this.output) - ? this.output.length - : 1 - : 0; - }, - }), - (l.prototype.dispose = function () { - return ( - this.isUndef(this.input) || - (this.input instanceof AudioNode && this.input.disconnect(), - (this.input = null)), - this.isUndef(this.output) || - (this.output instanceof AudioNode && this.output.disconnect(), - (this.output = null)), - this - ); - }), - (l.prototype.connect = function (t, e, n) { - return ( - Array.isArray(this.output) - ? ((e = this.defaultArg(e, 0)), this.output[e].connect(t, 0, n)) - : this.output.connect(t, e, n), - this - ); - }), - (l.prototype.disconnect = function (t, e, n) { - this.isArray(this.output) - ? this.isNumber(t) - ? this.output[t].disconnect() - : ((e = this.defaultArg(e, 0)), - this.output[e].disconnect(t, 0, n)) - : this.output.disconnect.apply(this.output, arguments); - }), - (l.prototype.connectSeries = function () { - if (1 < arguments.length) - for (var t = arguments[0], e = 1; e < arguments.length; e++) { - var n = arguments[e]; - t.connect(n), (t = n); - } - return this; - }), - (l.prototype.chain = function () { - if (0 < arguments.length) - for (var t = this, e = 0; e < arguments.length; e++) { - var n = arguments[e]; - t.connect(n), (t = n); - } - return this; - }), - (l.prototype.fan = function () { - if (0 < arguments.length) - for (var t = 0; t < arguments.length; t++) - this.connect(arguments[t]); - return this; - }), - (AudioNode.prototype.chain = l.prototype.chain), - (AudioNode.prototype.fan = l.prototype.fan), - (l.prototype.defaultArg = function (t, e) { - if (this.isObject(t) && this.isObject(e)) { - var n = {}; - for (var i in t) n[i] = this.defaultArg(e[i], t[i]); - for (var r in e) n[r] = this.defaultArg(t[r], e[r]); - return n; - } - return this.isUndef(t) ? e : t; - }), - (l.prototype.optionsObject = function (t, e, n) { - var i = {}; - if (1 === t.length && this.isObject(t[0])) i = t[0]; - else for (var r = 0; r < e.length; r++) i[e[r]] = t[r]; - return this.isUndef(n) ? i : this.defaultArg(i, n); - }), - (l.prototype.isUndef = function (t) { - return void 0 === t; - }), - (l.prototype.isFunction = function (t) { - return "function" == typeof t; - }), - (l.prototype.isNumber = function (t) { - return "number" == typeof t; - }), - (l.prototype.isObject = function (t) { - return ( - "[object Object]" === Object.prototype.toString.call(t) && - t.constructor === Object - ); - }), - (l.prototype.isBoolean = function (t) { - return "boolean" == typeof t; - }), - (l.prototype.isArray = function (t) { - return Array.isArray(t); - }), - (l.prototype.isString = function (t) { - return "string" == typeof t; - }), - (l.noOp = function () {}), - (l.prototype._readOnly = function (t) { - if (Array.isArray(t)) - for (var e = 0; e < t.length; e++) this._readOnly(t[e]); - else - Object.defineProperty(this, t, { writable: !1, enumerable: !0 }); - }), - (l.prototype._writable = function (t) { - if (Array.isArray(t)) - for (var e = 0; e < t.length; e++) this._writable(t[e]); - else Object.defineProperty(this, t, { writable: !0 }); - }), - (l.State = { - Started: "started", - Stopped: "stopped", - Paused: "paused", - }), - (l.prototype.equalPowerScale = function (t) { - var e = 0.5 * Math.PI; - return Math.sin(t * e); - }), - (l.prototype.dbToGain = function (t) { - return Math.pow(2, t / 6); - }), - (l.prototype.gainToDb = function (t) { - return (Math.log(t) / Math.LN10) * 20; - }), - (l.prototype.intervalToFrequencyRatio = function (t) { - return Math.pow(2, t / 12); - }), - (l.prototype.now = function () { - return l.context.now(); - }), - (l.now = function () { - return l.context.now(); - }), - (l.extend = function (t, e) { - function n() {} - l.prototype.isUndef(e) && (e = l), - (n.prototype = e.prototype), - (t.prototype = new n()), - ((t.prototype.constructor = t)._super = e); - }), - Object.defineProperty(l, "context", { - get: function () { - return e; - }, - set: function (t) { - (e = l.Context && t instanceof l.Context ? t : new l.Context(t)), - l.Context && l.Context.emit("init", e); - }, - }), - Object.defineProperty(l.prototype, "context", { - get: function () { - return l.context; - }, - }), - (l.setContext = function (t) { - l.context = t; - }), - Object.defineProperty(l.prototype, "blockTime", { - get: function () { - return 128 / this.context.sampleRate; - }, - }), - Object.defineProperty(l.prototype, "sampleTime", { - get: function () { - return 1 / this.context.sampleRate; - }, - }), - Object.defineProperty(l, "supported", { - get: function () { - var t = - window.hasOwnProperty("AudioContext") || - window.hasOwnProperty("webkitAudioContext"), - e = window.hasOwnProperty("Promise"), - n = window.hasOwnProperty("Worker"); - return t && e && n; - }, - }), - (l.version = "r10"), - window.TONE_SILENCE_VERSION_LOGGING, - l - ); - }.call(e, n, e, t)) || (t.exports = i); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(2), n(10)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Multiply = function (t) { - this.createInsOuts(2, 0), - (this._mult = this.input[0] = this.output = new e.Gain()), - (this._param = this.input[1] = this.output.gain), - (this._param.value = this.defaultArg(t, 0)); - }), - e.extend(e.Multiply, e.Signal), - (e.Multiply.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._mult.dispose(), - (this._mult = null), - (this._param = null), - this - ); - }), - e.Multiply - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(6), n(9), n(18), n(10)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Signal = function () { - var t = this.optionsObject( - arguments, - ["value", "units"], - e.Signal.defaults, - ); - (this.output = this._gain = this.context.createGain()), - (t.param = this._gain.gain), - e.Param.call(this, t), - (this.input = this._param = this._gain.gain), - this.context.getConstant(1).chain(this._gain); - }), - e.extend(e.Signal, e.Param), - (e.Signal.defaults = { - value: 0, - units: e.Type.Default, - convert: !0, - }), - (e.Signal.prototype.connect = e.SignalBase.prototype.connect), - (e.Signal.prototype.dispose = function () { - return ( - e.Param.prototype.dispose.call(this), - (this._param = null), - this._gain.disconnect(), - (this._gain = null), - this - ); - }), - e.Signal - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, u, c) { - "use strict"; - (function (t) { - c.d(u, "b", function () { - return s; - }), - c.d(u, "c", function () { - return a; - }); - var e = c(22), - i = c.n(e), - n = c(0), - r = c.n(n); - c(12); - t.TONE_SILENCE_VERSION_LOGGING = !0; - var o = new window.AudioContext(); - function s() { - return o; - } - function a(t, e) { - var n = t; - return ( - t instanceof p5.Element - ? (n = t.elt) - : t instanceof Array && - t[0] instanceof p5.Element && - (n = t.map(function (t) { - return t.elt; - })), - i()(o, n, e) - ); - } - r.a.setContext(o), (u.a = o); - }).call(this, c(26)); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(2), n(10)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Add = function (t) { - this.createInsOuts(2, 0), - (this._sum = - this.input[0] = - this.input[1] = - this.output = - new e.Gain()), - (this._param = this.input[1] = new e.Signal(t)), - this._param.connect(this._sum); - }), - e.extend(e.Add, e.Signal), - (e.Add.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._sum.dispose(), - (this._sum = null), - this._param.dispose(), - (this._param = null), - this - ); - }), - e.Add - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e) { - t.exports = { - recorderProcessor: "recorder-processor", - soundFileProcessor: "sound-file-processor", - amplitudeProcessor: "amplitude-processor", - }; - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(15)]), - void 0 === - (r = function (t) { - "use strict"; - return ( - (t.WaveShaper = function (t, e) { - (this._shaper = - this.input = - this.output = - this.context.createWaveShaper()), - (this._curve = null), - Array.isArray(t) - ? (this.curve = t) - : isFinite(t) || this.isUndef(t) - ? (this._curve = new Float32Array(this.defaultArg(t, 1024))) - : this.isFunction(t) && - ((this._curve = new Float32Array( - this.defaultArg(e, 1024), - )), - this.setMap(t)); - }), - t.extend(t.WaveShaper, t.SignalBase), - (t.WaveShaper.prototype.setMap = function (t) { - for (var e = 0, n = this._curve.length; e < n; e++) { - var i = (e / (n - 1)) * 2 - 1; - this._curve[e] = t(i, 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 - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(2), n(19)]), - void 0 === - (r = function (u) { - "use strict"; - return ( - (u.TimelineSignal = function () { - var t = this.optionsObject( - arguments, - ["value", "units"], - u.Signal.defaults, - ); - (this._events = new u.Timeline(10)), - u.Signal.apply(this, t), - (t.param = this._param), - u.Param.call(this, t), - (this._initial = this._fromUnits(this._param.value)); - }), - u.extend(u.TimelineSignal, u.Param), - (u.TimelineSignal.Type = { - Linear: "linear", - Exponential: "exponential", - Target: "target", - Curve: "curve", - Set: "set", - }), - Object.defineProperty(u.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); - }, - }), - (u.TimelineSignal.prototype.setValueAtTime = function (t, e) { - return ( - (t = this._fromUnits(t)), - (e = this.toSeconds(e)), - this._events.add({ - type: u.TimelineSignal.Type.Set, - value: t, - time: e, - }), - this._param.setValueAtTime(t, e), - this - ); - }), - (u.TimelineSignal.prototype.linearRampToValueAtTime = function ( - t, - e, - ) { - return ( - (t = this._fromUnits(t)), - (e = this.toSeconds(e)), - this._events.add({ - type: u.TimelineSignal.Type.Linear, - value: t, - time: e, - }), - this._param.linearRampToValueAtTime(t, e), - this - ); - }), - (u.TimelineSignal.prototype.exponentialRampToValueAtTime = - function (t, e) { - e = this.toSeconds(e); - var n = this._searchBefore(e); - n && - 0 === n.value && - this.setValueAtTime(this._minOutput, n.time), - (t = this._fromUnits(t)); - var i = Math.max(t, this._minOutput); - return ( - this._events.add({ - type: u.TimelineSignal.Type.Exponential, - value: i, - time: e, - }), - t < this._minOutput - ? (this._param.exponentialRampToValueAtTime( - this._minOutput, - e - this.sampleTime, - ), - this.setValueAtTime(0, e)) - : this._param.exponentialRampToValueAtTime(t, e), - this - ); - }), - (u.TimelineSignal.prototype.setTargetAtTime = function (t, e, n) { - return ( - (t = this._fromUnits(t)), - (t = Math.max(this._minOutput, t)), - (n = Math.max(this._minOutput, n)), - (e = this.toSeconds(e)), - this._events.add({ - type: u.TimelineSignal.Type.Target, - value: t, - time: e, - constant: n, - }), - this._param.setTargetAtTime(t, e, n), - this - ); - }), - (u.TimelineSignal.prototype.setValueCurveAtTime = function ( - t, - e, - n, - i, - ) { - i = this.defaultArg(i, 1); - for (var r = new Array(t.length), o = 0; o < r.length; o++) - r[o] = this._fromUnits(t[o]) * i; - (e = this.toSeconds(e)), - (n = this.toSeconds(n)), - this._events.add({ - type: u.TimelineSignal.Type.Curve, - value: r, - time: e, - duration: n, - }), - this._param.setValueAtTime(r[0], e); - for (var s = 1; s < r.length; s++) { - var a = e + (s / (r.length - 1)) * n; - this._param.linearRampToValueAtTime(r[s], a); - } - return this; - }), - (u.TimelineSignal.prototype.cancelScheduledValues = function (t) { - return ( - (t = this.toSeconds(t)), - this._events.cancel(t), - this._param.cancelScheduledValues(t), - this - ); - }), - (u.TimelineSignal.prototype.setRampPoint = function (t) { - t = this.toSeconds(t); - var e = this._toUnits(this.getValueAtTime(t)), - n = this._searchBefore(t); - if (n && n.time === t) - this.cancelScheduledValues(t + this.sampleTime); - else if ( - n && - n.type === u.TimelineSignal.Type.Curve && - n.time + n.duration > t - ) - this.cancelScheduledValues(t), - this.linearRampToValueAtTime(e, t); - else { - var i = this._searchAfter(t); - i && - (this.cancelScheduledValues(t), - i.type === u.TimelineSignal.Type.Linear - ? this.linearRampToValueAtTime(e, t) - : i.type === u.TimelineSignal.Type.Exponential && - this.exponentialRampToValueAtTime(e, t)), - this.setValueAtTime(e, t); - } - return this; - }), - (u.TimelineSignal.prototype.linearRampToValueBetween = function ( - t, - e, - n, - ) { - return ( - this.setRampPoint(e), this.linearRampToValueAtTime(t, n), this - ); - }), - (u.TimelineSignal.prototype.exponentialRampToValueBetween = - function (t, e, n) { - return ( - this.setRampPoint(e), - this.exponentialRampToValueAtTime(t, n), - this - ); - }), - (u.TimelineSignal.prototype._searchBefore = function (t) { - return this._events.get(t); - }), - (u.TimelineSignal.prototype._searchAfter = function (t) { - return this._events.getAfter(t); - }), - (u.TimelineSignal.prototype.getValueAtTime = function (t) { - t = this.toSeconds(t); - var e = this._searchAfter(t), - n = this._searchBefore(t), - i = this._initial; - if (null === n) i = this._initial; - else if (n.type === u.TimelineSignal.Type.Target) { - var r, - o = this._events.getBefore(n.time); - (r = null === o ? this._initial : o.value), - (i = this._exponentialApproach( - n.time, - r, - n.value, - n.constant, - t, - )); - } else - i = - n.type === u.TimelineSignal.Type.Curve - ? this._curveInterpolate(n.time, n.value, n.duration, t) - : null === e - ? n.value - : e.type === u.TimelineSignal.Type.Linear - ? this._linearInterpolate( - n.time, - n.value, - e.time, - e.value, - t, - ) - : e.type === u.TimelineSignal.Type.Exponential - ? this._exponentialInterpolate( - n.time, - n.value, - e.time, - e.value, - t, - ) - : n.value; - return i; - }), - (u.TimelineSignal.prototype.connect = - u.SignalBase.prototype.connect), - (u.TimelineSignal.prototype._exponentialApproach = function ( - t, - e, - n, - i, - r, - ) { - return n + (e - n) * Math.exp(-(r - t) / i); - }), - (u.TimelineSignal.prototype._linearInterpolate = function ( - t, - e, - n, - i, - r, - ) { - return e + ((r - t) / (n - t)) * (i - e); - }), - (u.TimelineSignal.prototype._exponentialInterpolate = function ( - t, - e, - n, - i, - r, - ) { - return ( - (e = Math.max(this._minOutput, e)) * - Math.pow(i / e, (r - t) / (n - t)) - ); - }), - (u.TimelineSignal.prototype._curveInterpolate = function ( - t, - e, - n, - i, - ) { - var r = e.length; - if (t + n <= i) return e[r - 1]; - if (i <= t) return e[0]; - var o = (i - t) / n, - s = Math.floor((r - 1) * o), - a = Math.ceil((r - 1) * o), - u = e[s], - c = e[a]; - return a === s - ? u - : this._linearInterpolate(s, u, a, c, o * (r - 1)); - }), - (u.TimelineSignal.prototype.dispose = function () { - u.Signal.prototype.dispose.call(this), - u.Param.prototype.dispose.call(this), - this._events.dispose(), - (this._events = null); - }), - u.TimelineSignal - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(4), n(1), n(2)]), - void 0 === - (r = function (n) { - "use strict"; - return ( - (n.Scale = function (t, e) { - (this._outputMin = this.defaultArg(t, 0)), - (this._outputMax = this.defaultArg(e, 1)), - (this._scale = this.input = new n.Multiply(1)), - (this._add = this.output = new n.Add(0)), - this._scale.connect(this._add), - this._setRange(); - }), - n.extend(n.Scale, n.SignalBase), - Object.defineProperty(n.Scale.prototype, "min", { - get: function () { - return this._outputMin; - }, - set: function (t) { - (this._outputMin = t), this._setRange(); - }, - }), - Object.defineProperty(n.Scale.prototype, "max", { - get: function () { - return this._outputMax; - }, - set: function (t) { - (this._outputMax = t), this._setRange(); - }, - }), - (n.Scale.prototype._setRange = function () { - (this._add.value = this._outputMin), - (this._scale.value = this._outputMax - this._outputMin); - }), - (n.Scale.prototype.dispose = function () { - return ( - n.prototype.dispose.call(this), - this._add.dispose(), - (this._add = null), - this._scale.dispose(), - (this._scale = null), - this - ); - }), - n.Scale - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(16), n(30), n(31), n(12)]), - void 0 === - (r = function (e) { - return ( - (e.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", - }), - (e.prototype.toSeconds = function (t) { - return this.isNumber(t) - ? t - : this.isUndef(t) - ? this.now() - : this.isString(t) - ? new e.Time(t).toSeconds() - : t instanceof e.TimeBase - ? t.toSeconds() - : void 0; - }), - (e.prototype.toFrequency = function (t) { - return this.isNumber(t) - ? t - : this.isString(t) || this.isUndef(t) - ? new e.Frequency(t).valueOf() - : t instanceof e.TimeBase - ? t.toFrequency() - : void 0; - }), - (e.prototype.toTicks = function (t) { - return this.isNumber(t) || this.isString(t) - ? new e.TransportTime(t).toTicks() - : this.isUndef(t) - ? e.Transport.ticks - : t instanceof e.TimeBase - ? t.toTicks() - : void 0; - }), - e - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(18), n(9)]), - void 0 === - (r = function (n) { - "use strict"; - return ( - window.GainNode && - !AudioContext.prototype.createGain && - (AudioContext.prototype.createGain = - AudioContext.prototype.createGainNode), - (n.Gain = function () { - var t = this.optionsObject( - arguments, - ["gain", "units"], - n.Gain.defaults, - ); - (this.input = - this.output = - this._gainNode = - this.context.createGain()), - (this.gain = new n.Param({ - param: this._gainNode.gain, - units: t.units, - value: t.gain, - convert: t.convert, - })), - this._readOnly("gain"); - }), - n.extend(n.Gain), - (n.Gain.defaults = { gain: 1, convert: !0 }), - (n.Gain.prototype.dispose = function () { - n.Param.prototype.dispose.call(this), - this._gainNode.disconnect(), - (this._gainNode = null), - this._writable("gain"), - this.gain.dispose(), - (this.gain = null); - }), - (n.prototype.createInsOuts = function (t, e) { - 1 === t - ? (this.input = new n.Gain()) - : 1 < t && (this.input = new Array(t)), - 1 === e - ? (this.output = new n.Gain()) - : 1 < e && (this.output = new Array(t)); - }), - n.Gain - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(7), n(39), n(14), n(12)]), - void 0 === - (r = function (r) { - "use strict"; - return ( - (r.Clock = function () { - r.Emitter.call(this); - var t = this.optionsObject( - arguments, - ["callback", "frequency"], - r.Clock.defaults, - ); - (this.callback = t.callback), - (this._nextTick = 0), - (this._lastState = r.State.Stopped), - (this.frequency = new r.TimelineSignal( - t.frequency, - r.Type.Frequency, - )), - this._readOnly("frequency"), - (this.ticks = 0), - (this._state = new r.TimelineState(r.State.Stopped)), - (this._boundLoop = this._loop.bind(this)), - this.context.on("tick", this._boundLoop); - }), - r.extend(r.Clock, r.Emitter), - (r.Clock.defaults = { - callback: r.noOp, - frequency: 1, - lookAhead: "auto", - }), - Object.defineProperty(r.Clock.prototype, "state", { - get: function () { - return this._state.getValueAtTime(this.now()); - }, - }), - (r.Clock.prototype.start = function (t, e) { - return ( - (t = this.toSeconds(t)), - this._state.getValueAtTime(t) !== r.State.Started && - this._state.add({ - state: r.State.Started, - time: t, - offset: e, - }), - this - ); - }), - (r.Clock.prototype.stop = function (t) { - return ( - (t = this.toSeconds(t)), - this._state.cancel(t), - this._state.setStateAtTime(r.State.Stopped, t), - this - ); - }), - (r.Clock.prototype.pause = function (t) { - return ( - (t = this.toSeconds(t)), - this._state.getValueAtTime(t) === r.State.Started && - this._state.setStateAtTime(r.State.Paused, t), - this - ); - }), - (r.Clock.prototype._loop = function () { - for ( - var t = - this.now() + - this.context.lookAhead + - this.context.updateInterval + - 2 * this.context.lag; - t > this._nextTick && this._state; - - ) { - var e = this._state.getValueAtTime(this._nextTick); - if (e !== this._lastState) { - this._lastState = e; - var n = this._state.get(this._nextTick); - e === r.State.Started - ? ((this._nextTick = n.time), - this.isUndef(n.offset) || (this.ticks = n.offset), - this.emit("start", n.time, this.ticks)) - : e === r.State.Stopped - ? ((this.ticks = 0), this.emit("stop", n.time)) - : e === r.State.Paused && this.emit("pause", n.time); - } - var i = this._nextTick; - this.frequency && - ((this._nextTick += - 1 / this.frequency.getValueAtTime(this._nextTick)), - e === r.State.Started && (this.callback(i), this.ticks++)); - } - }), - (r.Clock.prototype.getStateAtTime = function (t) { - return (t = this.toSeconds(t)), this._state.getValueAtTime(t); - }), - (r.Clock.prototype.dispose = function () { - r.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); - }), - r.Clock - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(14)]), - void 0 === - (r = function (i) { - function t(t, e, n) { - if (t.input) - Array.isArray(t.input) - ? (i.prototype.isUndef(n) && (n = 0), this.connect(t.input[n])) - : this.connect(t.input, e, n); - else - try { - t instanceof AudioNode - ? r.call(this, t, e, n) - : r.call(this, t, e); - } catch (e) { - throw new Error("error connecting to node: " + t + "\n" + e); - } - } - var r, o; - return ( - !window.hasOwnProperty("AudioContext") && - window.hasOwnProperty("webkitAudioContext") && - (window.AudioContext = window.webkitAudioContext), - (i.Context = function (t) { - for (var e in (i.Emitter.call(this), - (t = t || new window.AudioContext()), - (this._context = t), - this._context)) - this._defineProperty(this._context, e); - (this._latencyHint = "interactive"), - (this._lookAhead = 0.1), - (this._updateInterval = this._lookAhead / 3), - (this._computedUpdateInterval = 0), - (this._worker = this._createWorker()), - (this._constants = {}); - }), - i.extend(i.Context, i.Emitter), - i.Emitter.mixin(i.Context), - (i.Context.prototype._defineProperty = function (e, n) { - this.isUndef(this[n]) && - Object.defineProperty(this, n, { - get: function () { - return "function" == typeof e[n] ? e[n].bind(e) : e[n]; - }, - set: function (t) { - e[n] = t; - }, - }); - }), - (i.Context.prototype.now = function () { - return this._context.currentTime; - }), - (i.Context.prototype._createWorker = function () { - window.URL = window.URL || window.webkitURL; - var t = new Blob([ - "var timeoutTime = " + - (1e3 * this._updateInterval).toFixed(1) + - ";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();", - ]), - e = URL.createObjectURL(t), - n = new Worker(e); - return ( - n.addEventListener( - "message", - function () { - this.emit("tick"); - }.bind(this), - ), - n.addEventListener( - "message", - function () { - var t = this.now(); - if (this.isNumber(this._lastUpdate)) { - var e = t - this._lastUpdate; - this._computedUpdateInterval = Math.max( - e, - 0.97 * this._computedUpdateInterval, - ); - } - this._lastUpdate = t; - }.bind(this), - ), - n - ); - }), - (i.Context.prototype.getConstant = function (t) { - if (this._constants[t]) return this._constants[t]; - for ( - var e = this._context.createBuffer( - 1, - 128, - this._context.sampleRate, - ), - n = e.getChannelData(0), - i = 0; - i < n.length; - i++ - ) - n[i] = t; - var r = this._context.createBufferSource(); - return ( - (r.channelCount = 1), - (r.channelCountMode = "explicit"), - (r.buffer = e), - (r.loop = !0), - r.start(0), - (this._constants[t] = r) - ); - }), - Object.defineProperty(i.Context.prototype, "lag", { - get: function () { - var t = this._computedUpdateInterval - this._updateInterval; - return Math.max(t, 0); - }, - }), - Object.defineProperty(i.Context.prototype, "lookAhead", { - get: function () { - return this._lookAhead; - }, - set: function (t) { - this._lookAhead = t; - }, - }), - Object.defineProperty(i.Context.prototype, "updateInterval", { - get: function () { - return this._updateInterval; - }, - set: function (t) { - (this._updateInterval = Math.max(t, i.prototype.blockTime)), - this._worker.postMessage(Math.max(1e3 * t, 1)); - }, - }), - Object.defineProperty(i.Context.prototype, "latencyHint", { - get: function () { - return this._latencyHint; - }, - set: function (t) { - var e = t; - if (((this._latencyHint = t), this.isString(t))) - switch (t) { - case "interactive": - (e = 0.1), (this._context.latencyHint = t); - break; - case "playback": - (e = 0.8), (this._context.latencyHint = t); - break; - case "balanced": - (e = 0.25), (this._context.latencyHint = t); - break; - case "fastest": - e = 0.01; - } - (this.lookAhead = e), (this.updateInterval = e / 3); - }, - }), - i.supported && - ((r = AudioNode.prototype.connect), - (o = AudioNode.prototype.disconnect), - AudioNode.prototype.connect !== t && - ((AudioNode.prototype.connect = t), - (AudioNode.prototype.disconnect = function (t, e, n) { - if (t && t.input && Array.isArray(t.input)) - i.prototype.isUndef(n) && (n = 0), - this.disconnect(t.input[n], e, n); - else if (t && t.input) this.disconnect(t.input, e, n); - else - try { - o.apply(this, arguments); - } catch (e) { - throw new Error( - "error disconnecting node: " + t + "\n" + e, - ); - } - })), - (i.context = new i.Context())), - i.Context - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(4), n(20), n(2), n(10)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Subtract = function (t) { - this.createInsOuts(2, 0), - (this._sum = this.input[0] = this.output = new e.Gain()), - (this._neg = new e.Negate()), - (this._param = this.input[1] = new e.Signal(t)), - this._param.chain(this._neg, this._sum); - }), - e.extend(e.Subtract, e.Signal), - (e.Subtract.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._neg.dispose(), - (this._neg = null), - this._sum.disconnect(), - (this._sum = null), - this._param.dispose(), - (this._param = null), - this - ); - }), - e.Subtract - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0)]), - void 0 === - (r = function (s) { - "use strict"; - return ( - (s.Emitter = function () { - this._events = {}; - }), - s.extend(s.Emitter), - (s.Emitter.prototype.on = function (t, e) { - for (var n = t.split(/\W+/), i = 0; i < n.length; i++) { - var r = n[i]; - this._events.hasOwnProperty(r) || (this._events[r] = []), - this._events[r].push(e); - } - return this; - }), - (s.Emitter.prototype.off = function (t, e) { - for (var n = t.split(/\W+/), i = 0; i < n.length; i++) - if (((t = n[i]), this._events.hasOwnProperty(t))) - if (s.prototype.isUndef(e)) this._events[t] = []; - else - for (var r = this._events[t], o = 0; o < r.length; o++) - r[o] === e && r.splice(o, 1); - return this; - }), - (s.Emitter.prototype.emit = function (t) { - if (this._events) { - var e = Array.apply(null, arguments).slice(1); - if (this._events.hasOwnProperty(t)) - for (var n = this._events[t], i = 0, r = n.length; i < r; i++) - n[i].apply(this, e); - } - return this; - }), - (s.Emitter.mixin = function (t) { - var e = ["on", "off", "emit"]; - t._events = {}; - for (var n = 0; n < e.length; n++) { - var i = e[n], - r = s.Emitter.prototype[i]; - t[i] = r; - } - }), - (s.Emitter.prototype.dispose = function () { - return ( - s.prototype.dispose.call(this), (this._events = null), this - ); - }), - s.Emitter - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0)]), - void 0 === - (r = function (i) { - "use strict"; - return ( - (i.SignalBase = function () {}), - i.extend(i.SignalBase), - (i.SignalBase.prototype.connect = function (t, e, n) { - return ( - (i.Signal && i.Signal === t.constructor) || - (i.Param && i.Param === t.constructor) || - (i.TimelineSignal && i.TimelineSignal === t.constructor) - ? (t._param.cancelScheduledValues(0), - (t._param.value = 0), - (t.overridden = !0)) - : t instanceof AudioParam && - (t.cancelScheduledValues(0), (t.value = 0)), - i.prototype.connect.call(this, t, e, n), - this - ); - }), - i.SignalBase - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(17)]), - void 0 === - (r = function (n) { - return ( - (n.Time = function (t, e) { - if (!(this instanceof n.Time)) return new n.Time(t, e); - (this._plusNow = !1), n.TimeBase.call(this, t, e); - }), - n.extend(n.Time, n.TimeBase), - (n.Time.prototype._unaryExpressions = Object.create( - n.TimeBase.prototype._unaryExpressions, - )), - (n.Time.prototype._unaryExpressions.quantize = { - regexp: /^@/, - method: function (t) { - return n.Transport.nextSubdivision(t()); - }, - }), - (n.Time.prototype._unaryExpressions.now = { - regexp: /^\+/, - method: function (t) { - return (this._plusNow = !0), t(); - }, - }), - (n.Time.prototype.quantize = function (t, e) { - return ( - (e = this.defaultArg(e, 1)), - (this._expr = function (t, e, n) { - return ( - (t = t()), - (e = e.toSeconds()), - t + (Math.round(t / e) * e - t) * n - ); - }.bind(this, this._expr, new this.constructor(t), e)), - this - ); - }), - (n.Time.prototype.addNow = function () { - return (this._plusNow = !0), this; - }), - (n.Time.prototype._defaultExpr = function () { - return (this._plusNow = !0), this._noOp; - }), - (n.Time.prototype.copy = function (t) { - return ( - n.TimeBase.prototype.copy.call(this, t), - (this._plusNow = t._plusNow), - this - ); - }), - (n.Time.prototype.toNotation = function () { - var t = this.toSeconds(), - e = this._toNotationHelper(t, [ - "1m", - "2n", - "4n", - "8n", - "16n", - "32n", - "64n", - "128n", - ]), - n = this._toNotationHelper(t, [ - "1m", - "2n", - "2t", - "4n", - "4t", - "8n", - "8t", - "16n", - "16t", - "32n", - "32t", - "64n", - "64t", - "128n", - ]); - return n.split("+").length < e.split("+").length ? n : e; - }), - (n.Time.prototype._toNotationHelper = function (t, e) { - for ( - var n = this._notationToUnits(e[e.length - 1]), i = "", r = 0; - r < e.length; - r++ - ) { - var o = this._notationToUnits(e[r]), - s = t / o; - if ( - (1 - (s % 1) < 1e-6 && (s += 1e-6), 0 < (s = Math.floor(s))) - ) { - if ( - ((i += 1 === s ? e[r] : s.toString() + "*" + e[r]), - (t -= s * o) < n) - ) - break; - i += " + "; - } - } - return "" === i && (i = "0"), i; - }), - (n.Time.prototype._notationToUnits = function (t) { - for ( - var e = this._primaryExpressions, n = [e.n, e.t, e.m], i = 0; - i < n.length; - i++ - ) { - var r = n[i], - o = t.match(r.regexp); - if (o) return r.method.call(this, o[1]); - } - }), - (n.Time.prototype.toBarsBeatsSixteenths = function () { - var t = this._beatsToUnits(1), - e = this.toSeconds() / t, - n = Math.floor(e / this._timeSignature()), - i = (e % 1) * 4; - return ( - (e = Math.floor(e) % this._timeSignature()), - 3 < (i = i.toString()).length && (i = parseFloat(i).toFixed(3)), - [n, e, i].join(":") - ); - }), - (n.Time.prototype.toTicks = function () { - var t = this._beatsToUnits(1), - e = this.valueOf() / t; - return Math.floor(e * n.Transport.PPQ); - }), - (n.Time.prototype.toSamples = function () { - return this.toSeconds() * this.context.sampleRate; - }), - (n.Time.prototype.toFrequency = function () { - return 1 / this.toSeconds(); - }), - (n.Time.prototype.toSeconds = function () { - return this.valueOf(); - }), - (n.Time.prototype.toMilliseconds = function () { - return 1e3 * this.toSeconds(); - }), - (n.Time.prototype.valueOf = function () { - return this._expr() + (this._plusNow ? this.now() : 0); - }), - n.Time - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0)]), - void 0 === - (r = function (i) { - return ( - (i.TimeBase = function (t, e) { - if (!(this instanceof i.TimeBase)) return new i.TimeBase(t, e); - if (((this._expr = this._noOp), t instanceof i.TimeBase)) - this.copy(t); - else if (!this.isUndef(e) || this.isNumber(t)) { - e = this.defaultArg(e, this._defaultUnits); - var n = this._primaryExpressions[e].method; - this._expr = n.bind(this, t); - } else - this.isString(t) - ? this.set(t) - : this.isUndef(t) && (this._expr = this._defaultExpr()); - }), - i.extend(i.TimeBase), - (i.TimeBase.prototype.set = function (t) { - return (this._expr = this._parseExprString(t)), this; - }), - (i.TimeBase.prototype.clone = function () { - var t = new this.constructor(); - return t.copy(this), t; - }), - (i.TimeBase.prototype.copy = function (t) { - var e = t._expr(); - return this.set(e); - }), - (i.TimeBase.prototype._primaryExpressions = { - n: { - regexp: /^(\d+)n/i, - method: function (t) { - return 1 === (t = parseInt(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, n) { - var i = 0; - return ( - t && - "0" !== t && - (i += this._beatsToUnits( - this._timeSignature() * parseFloat(t), - )), - e && "0" !== e && (i += this._beatsToUnits(parseFloat(e))), - n && - "0" !== n && - (i += this._beatsToUnits(parseFloat(n) / 4)), - i - ); - }, - }, - 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); - }, - }, - }), - (i.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(); - }, - }, - }), - (i.TimeBase.prototype._unaryExpressions = { - neg: { - regexp: /^\-/, - method: function (t) { - return -t(); - }, - }, - }), - (i.TimeBase.prototype._syntaxGlue = { - "(": { regexp: /^\(/ }, - ")": { regexp: /^\)/ }, - }), - (i.TimeBase.prototype._tokenize = function (t) { - for (var e = -1, n = []; 0 < t.length; ) { - var i = r((t = t.trim()), this); - n.push(i), (t = t.substr(i.value.length)); - } - function r(t, e) { - for ( - var n = [ - "_binaryExpressions", - "_unaryExpressions", - "_primaryExpressions", - "_syntaxGlue", - ], - i = 0; - i < n.length; - i++ - ) { - var r = e[n[i]]; - for (var o in r) { - var s = r[o], - a = s.regexp, - u = t.match(a); - if (null !== u) - return { - method: s.method, - precedence: s.precedence, - regexp: s.regexp, - value: u[0], - }; - } - } - throw new SyntaxError("Tone.TimeBase: Unexpected token " + t); - } - return { - next: function () { - return n[++e]; - }, - peek: function () { - return n[e + 1]; - }, - }; - }), - (i.TimeBase.prototype._matchGroup = function (t, e, n) { - if (!this.isUndef(t)) - for (var i in e) { - var r = e[i]; - if (r.regexp.test(t.value)) { - if (this.isUndef(n)) return r; - if (r.precedence === n) return r; - } - } - return !1; - }), - (i.TimeBase.prototype._parseBinary = function (t, e) { - var n; - this.isUndef(e) && (e = 2), - (n = e < 0 ? this._parseUnary(t) : this._parseBinary(t, e - 1)); - for ( - var i = t.peek(); - i && this._matchGroup(i, this._binaryExpressions, e); - - ) - (n = (i = t.next()).method.bind( - this, - n, - this._parseBinary(t, e - 1), - )), - (i = t.peek()); - return n; - }), - (i.TimeBase.prototype._parseUnary = function (t) { - var e, n; - e = t.peek(); - var i = this._matchGroup(e, this._unaryExpressions); - return i - ? ((e = t.next()), - (n = this._parseUnary(t)), - i.method.bind(this, n)) - : this._parsePrimary(t); - }), - (i.TimeBase.prototype._parsePrimary = function (t) { - var e, n; - if (((e = t.peek()), this.isUndef(e))) - throw new SyntaxError( - "Tone.TimeBase: Unexpected end of expression", - ); - if (this._matchGroup(e, this._primaryExpressions)) { - var i = (e = t.next()).value.match(e.regexp); - return e.method.bind(this, i[1], i[2], i[3]); - } - if (e && "(" === e.value) { - if ( - (t.next(), - (n = this._parseBinary(t)), - !(e = t.next()) || ")" !== e.value) - ) - throw new SyntaxError("Expected )"); - return n; - } - throw new SyntaxError( - "Tone.TimeBase: Cannot process token " + e.value, - ); - }), - (i.TimeBase.prototype._parseExprString = function (t) { - this.isString(t) || (t = t.toString()); - var e = this._tokenize(t); - return this._parseBinary(e); - }), - (i.TimeBase.prototype._noOp = function () { - return 0; - }), - (i.TimeBase.prototype._defaultExpr = function () { - return this._noOp; - }), - (i.TimeBase.prototype._defaultUnits = "s"), - (i.TimeBase.prototype._frequencyToUnits = function (t) { - return 1 / t; - }), - (i.TimeBase.prototype._beatsToUnits = function (t) { - return (60 / i.Transport.bpm.value) * t; - }), - (i.TimeBase.prototype._secondsToUnits = function (t) { - return t; - }), - (i.TimeBase.prototype._ticksToUnits = function (t) { - return t * (this._beatsToUnits(1) / i.Transport.PPQ); - }), - (i.TimeBase.prototype._timeSignature = function () { - return i.Transport.timeSignature; - }), - (i.TimeBase.prototype._pushExpr = function (t, e, n) { - return ( - t instanceof i.TimeBase || (t = new this.constructor(t, n)), - (this._expr = this._binaryExpressions[e].method.bind( - this, - this._expr, - t._expr, - )), - this - ); - }), - (i.TimeBase.prototype.add = function (t, e) { - return this._pushExpr(t, "+", e); - }), - (i.TimeBase.prototype.sub = function (t, e) { - return this._pushExpr(t, "-", e); - }), - (i.TimeBase.prototype.mult = function (t, e) { - return this._pushExpr(t, "*", e); - }), - (i.TimeBase.prototype.div = function (t, e) { - return this._pushExpr(t, "/", e); - }), - (i.TimeBase.prototype.valueOf = function () { - return this._expr(); - }), - (i.TimeBase.prototype.dispose = function () { - this._expr = null; - }), - i.TimeBase - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(9)]), - void 0 === - (r = function (i) { - "use strict"; - return ( - (i.Param = function () { - var t = this.optionsObject( - arguments, - ["param", "units", "convert"], - i.Param.defaults, - ); - (this._param = this.input = t.param), - (this.units = t.units), - (this.convert = t.convert), - (this.overridden = !1), - (this._lfo = null), - this.isObject(t.lfo) - ? (this.value = t.lfo) - : this.isUndef(t.value) || (this.value = t.value); - }), - i.extend(i.Param), - (i.Param.defaults = { - units: i.Type.Default, - convert: !0, - param: void 0, - }), - Object.defineProperty(i.Param.prototype, "value", { - get: function () { - return this._toUnits(this._param.value); - }, - set: function (t) { - if (this.isObject(t)) { - if (this.isUndef(i.LFO)) - throw new Error( - "Include 'Tone.LFO' to use an LFO as a Param value.", - ); - this._lfo && this._lfo.dispose(), - (this._lfo = new i.LFO(t).start()), - this._lfo.connect(this.input); - } else { - var e = this._fromUnits(t); - this._param.cancelScheduledValues(0), (this._param.value = e); - } - }, - }), - (i.Param.prototype._fromUnits = function (t) { - if (!this.convert && !this.isUndef(this.convert)) return t; - switch (this.units) { - case i.Type.Time: - return this.toSeconds(t); - case i.Type.Frequency: - return this.toFrequency(t); - case i.Type.Decibels: - return this.dbToGain(t); - case i.Type.NormalRange: - return Math.min(Math.max(t, 0), 1); - case i.Type.AudioRange: - return Math.min(Math.max(t, -1), 1); - case i.Type.Positive: - return Math.max(t, 0); - default: - return t; - } - }), - (i.Param.prototype._toUnits = function (t) { - if (!this.convert && !this.isUndef(this.convert)) return t; - switch (this.units) { - case i.Type.Decibels: - return this.gainToDb(t); - default: - return t; - } - }), - (i.Param.prototype._minOutput = 1e-5), - (i.Param.prototype.setValueAtTime = function (t, e) { - return ( - (t = this._fromUnits(t)), - (e = this.toSeconds(e)) <= this.now() + this.blockTime - ? (this._param.value = t) - : this._param.setValueAtTime(t, e), - this - ); - }), - (i.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 - ); - }), - (i.Param.prototype.linearRampToValueAtTime = function (t, e) { - return ( - (t = this._fromUnits(t)), - this._param.linearRampToValueAtTime(t, this.toSeconds(e)), - this - ); - }), - (i.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 - ); - }), - (i.Param.prototype.exponentialRampToValue = function (t, e, n) { - return ( - (n = this.toSeconds(n)), - this.setRampPoint(n), - this.exponentialRampToValueAtTime(t, n + this.toSeconds(e)), - this - ); - }), - (i.Param.prototype.linearRampToValue = function (t, e, n) { - return ( - (n = this.toSeconds(n)), - this.setRampPoint(n), - this.linearRampToValueAtTime(t, n + this.toSeconds(e)), - this - ); - }), - (i.Param.prototype.setTargetAtTime = function (t, e, n) { - return ( - (t = this._fromUnits(t)), - (t = Math.max(this._minOutput, t)), - (n = Math.max(this._minOutput, n)), - this._param.setTargetAtTime(t, this.toSeconds(e), n), - this - ); - }), - (i.Param.prototype.setValueCurveAtTime = function (t, e, n) { - for (var i = 0; i < t.length; i++) t[i] = this._fromUnits(t[i]); - return ( - this._param.setValueCurveAtTime( - t, - this.toSeconds(e), - this.toSeconds(n), - ), - this - ); - }), - (i.Param.prototype.cancelScheduledValues = function (t) { - return this._param.cancelScheduledValues(this.toSeconds(t)), this; - }), - (i.Param.prototype.rampTo = function (t, e, n) { - return ( - (e = this.defaultArg(e, 0)), - this.units === i.Type.Frequency || - this.units === i.Type.BPM || - this.units === i.Type.Decibels - ? this.exponentialRampToValue(t, e, n) - : this.linearRampToValue(t, e, n), - this - ); - }), - Object.defineProperty(i.Param.prototype, "lfo", { - get: function () { - return this._lfo; - }, - }), - (i.Param.prototype.dispose = function () { - return ( - i.prototype.dispose.call(this), - (this._param = null), - this._lfo && (this._lfo.dispose(), (this._lfo = null)), - this - ); - }), - i.Param - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(9)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Timeline = function () { - var t = this.optionsObject( - arguments, - ["memory"], - e.Timeline.defaults, - ); - (this._timeline = []), - (this._toRemove = []), - (this._iterating = !1), - (this.memory = t.memory); - }), - e.extend(e.Timeline), - (e.Timeline.defaults = { memory: 1 / 0 }), - Object.defineProperty(e.Timeline.prototype, "length", { - get: function () { - return this._timeline.length; - }, - }), - (e.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 n = this.length - this.memory; - this._timeline.splice(0, n); - } - return this; - }), - (e.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; - }), - (e.Timeline.prototype.get = function (t) { - var e = this._search(t); - return -1 !== e ? this._timeline[e] : null; - }), - (e.Timeline.prototype.peek = function () { - return this._timeline[0]; - }), - (e.Timeline.prototype.shift = function () { - return this._timeline.shift(); - }), - (e.Timeline.prototype.getAfter = function (t) { - var e = this._search(t); - return e + 1 < this._timeline.length - ? this._timeline[e + 1] - : null; - }), - (e.Timeline.prototype.getBefore = function (t) { - var e = this._timeline.length; - if (0 < e && this._timeline[e - 1].time < t) - return this._timeline[e - 1]; - var n = this._search(t); - return 0 <= n - 1 ? this._timeline[n - 1] : null; - }), - (e.Timeline.prototype.cancel = function (t) { - if (1 < this._timeline.length) { - var e = this._search(t); - if (0 <= e) - if (this._timeline[e].time === t) { - for (var n = e; 0 <= n && this._timeline[n].time === t; n--) - e = n; - 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; - }), - (e.Timeline.prototype.cancelBefore = function (t) { - if (this._timeline.length) { - var e = this._search(t); - 0 <= e && (this._timeline = this._timeline.slice(e + 1)); - } - return this; - }), - (e.Timeline.prototype._search = function (t) { - var e = 0, - n = this._timeline.length, - i = n; - if (0 < n && this._timeline[n - 1].time <= t) return n - 1; - for (; e < i; ) { - var r = Math.floor(e + (i - e) / 2), - o = this._timeline[r], - s = this._timeline[r + 1]; - if (o.time === t) { - for (var a = r; a < this._timeline.length; a++) - this._timeline[a].time === t && (r = a); - return r; - } - if (o.time < t && s.time > t) return r; - o.time > t ? (i = r) : o.time < t && (e = r + 1); - } - return -1; - }), - (e.Timeline.prototype._iterate = function (t, e, n) { - (this._iterating = !0), - (e = this.defaultArg(e, 0)), - (n = this.defaultArg(n, this._timeline.length - 1)); - for (var i = e; i <= n; i++) t(this._timeline[i]); - if (((this._iterating = !1), 0 < this._toRemove.length)) { - for (var r = 0; r < this._toRemove.length; r++) { - var o = this._timeline.indexOf(this._toRemove[r]); - -1 !== o && this._timeline.splice(o, 1); - } - this._toRemove = []; - } - }), - (e.Timeline.prototype.forEach = function (t) { - return this._iterate(t), this; - }), - (e.Timeline.prototype.forEachBefore = function (t, e) { - var n = this._search(t); - return -1 !== n && this._iterate(e, 0, n), this; - }), - (e.Timeline.prototype.forEachAfter = function (t, e) { - var n = this._search(t); - return this._iterate(e, n + 1), this; - }), - (e.Timeline.prototype.forEachFrom = function (t, e) { - for ( - var n = this._search(t); - 0 <= n && this._timeline[n].time >= t; - - ) - n--; - return this._iterate(e, n + 1), this; - }), - (e.Timeline.prototype.forEachAtTime = function (e, n) { - var t = this._search(e); - return ( - -1 !== t && - this._iterate( - function (t) { - t.time === e && n(t); - }, - 0, - t, - ), - this - ); - }), - (e.Timeline.prototype.dispose = function () { - e.prototype.dispose.call(this), - (this._timeline = null), - (this._toRemove = null); - }), - e.Timeline - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(1), n(2)]), - void 0 === - (r = function (t) { - "use strict"; - return ( - (t.Negate = function () { - this._multiply = this.input = this.output = new t.Multiply(-1); - }), - t.extend(t.Negate, t.SignalBase), - (t.Negate.prototype.dispose = function () { - return ( - t.prototype.dispose.call(this), - this._multiply.dispose(), - (this._multiply = null), - this - ); - }), - t.Negate - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(2), n(1), n(6)]), - void 0 === - (r = function (t) { - "use strict"; - return ( - (t.GreaterThanZero = function () { - (this._thresh = this.output = - new t.WaveShaper(function (t) { - return t <= 0 ? 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 - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r, o; - (r = []), - void 0 === - (o = - "function" == - typeof (i = function () { - var s = function (t, e) { - (this._dragged = !1), - (this._element = t), - (this._bindedMove = this._moved.bind(this)), - (this._bindedEnd = this._ended.bind(this, e)), - t.addEventListener("touchstart", this._bindedEnd), - t.addEventListener("touchmove", this._bindedMove), - t.addEventListener("touchend", this._bindedEnd), - t.addEventListener("mouseup", this._bindedEnd); - }; - function o(t) { - return "running" === t.state; - } - return ( - (s.prototype._moved = function (t) { - this._dragged = !0; - }), - (s.prototype._ended = function (t) { - this._dragged || - (function (t) { - var e = t.createBuffer(1, 1, t.sampleRate), - n = t.createBufferSource(); - (n.buffer = e), - n.connect(t.destination), - n.start(0), - t.resume && t.resume(); - })(t), - (this._dragged = !1); - }), - (s.prototype.dispose = function () { - this._element.removeEventListener( - "touchstart", - this._bindedEnd, - ), - this._element.removeEventListener( - "touchmove", - this._bindedMove, - ), - this._element.removeEventListener( - "touchend", - this._bindedEnd, - ), - this._element.removeEventListener("mouseup", this._bindedEnd), - (this._bindedMove = null), - (this._bindedEnd = null), - (this._element = null); - }), - function (e, t, n) { - var i = new Promise(function (t) { - !(function (e, n) { - o(e) - ? n() - : (function t() { - o(e) - ? n() - : (requestAnimationFrame(t), - e.resume && e.resume()); - })(); - })(e, t); - }), - r = []; - return ( - (function t(e, n, i) { - if (Array.isArray(e) || (NodeList && e instanceof NodeList)) - for (var r = 0; r < e.length; r++) t(e[r], n, i); - else if ("string" == typeof e) - t(document.querySelectorAll(e), n, i); - else if (e.jquery && "function" == typeof e.toArray) - t(e.toArray(), n, i); - else if (Element && e instanceof Element) { - var o = new s(e, i); - n.push(o); - } - })((t = t || document.body), r, e), - i.then(function () { - for (var t = 0; t < r.length; t++) r[t].dispose(); - (r = null), n && n(); - }), - i - ); - } - ); - }) - ? i.apply(e, r) - : i) || (t.exports = o); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(2), n(32), n(38), n(10)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.CrossFade = function (t) { - this.createInsOuts(2, 1), - (this.a = this.input[0] = new e.Gain()), - (this.b = this.input[1] = new e.Gain()), - (this.fade = new e.Signal( - this.defaultArg(t, 0.5), - e.Type.NormalRange, - )), - (this._equalPowerA = new e.EqualPowerGain()), - (this._equalPowerB = new e.EqualPowerGain()), - (this._invert = new e.Expr("1 - $0")), - this.a.connect(this.output), - this.b.connect(this.output), - this.fade.chain(this._equalPowerB, this.b.gain), - this.fade.chain(this._invert, this._equalPowerA, this.a.gain), - this._readOnly("fade"); - }), - e.extend(e.CrossFade), - (e.CrossFade.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._writable("fade"), - this._equalPowerA.dispose(), - (this._equalPowerA = null), - this._equalPowerB.dispose(), - (this._equalPowerB = null), - this.fade.dispose(), - (this.fade = null), - this._invert.dispose(), - (this._invert = null), - this.a.dispose(), - (this.a = null), - this.b.dispose(), - (this.b = null), - this - ); - }), - e.CrossFade - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e) { - function l(t) { - var i = this, - r = {}, - o = -1; - this.parameters.forEach(function (t, e) { - var n = a[++o] || (a[o] = new Float32Array(i.bufferSize)); - n.fill(t.value), (r[e] = n); - }), - this.processor.realm.exec( - "self.sampleRate=sampleRate=" + - this.context.sampleRate + - ";self.currentTime=currentTime=" + - this.context.currentTime, - ); - var e = s(t.inputBuffer), - n = s(t.outputBuffer); - this.instance.process([e], [n], r); - } - function s(t) { - for (var e = [], n = 0; n < t.numberOfChannels; n++) - e[n] = t.getChannelData(n); - return e; - } - function h(t) { - return t.$$processors || (t.$$processors = {}); - } - function n(t) { - this.$$context = t; - } - var p, a; - (a = []), - "function" != typeof AudioWorkletNode && - ((self.AudioWorkletNode = function (t, e, n) { - var i = h(t)[e], - r = t.createScriptProcessor( - void 0, - 2, - n && n.outputChannelCount ? n.outputChannelCount[0] : 2, - ); - if (((r.parameters = new Map()), i.properties)) - for (var o = 0; o < i.properties.length; o++) { - var s = i.properties[o], - a = t.createGain().gain; - (a.value = s.defaultValue), r.parameters.set(s.name, a); - } - var u = new MessageChannel(); - p = u.port2; - var c = new i.Processor(n || {}); - return ( - (p = null), - (r.port = u.port1), - (r.processor = i), - (r.instance = c), - (r.onaudioprocess = l), - r - ); - }), - Object.defineProperty( - (self.AudioContext || self.webkitAudioContext).prototype, - "audioWorklet", - { - get: function () { - return ( - this.$$audioWorklet || - (this.$$audioWorklet = new self.AudioWorklet(this)) - ); - }, - }, - ), - (self.AudioWorklet = - ((n.prototype.addModule = function (t, e) { - var r = this; - return fetch(t) - .then(function (t) { - if (!t.ok) throw Error(t.status); - return t.text(); - }) - .then(function (t) { - var n = { - sampleRate: 0, - currentTime: 0, - AudioWorkletProcessor: function () { - this.port = p; - }, - registerProcessor: function (t, e) { - h(r.$$context)[t] = { - realm: i, - context: n, - Processor: e, - properties: e.parameterDescriptors || [], - }; - }, - }, - i = new (function (t, e) { - var n = document.createElement("iframe"); - (n.style.cssText = - "position:absolute;left:0;top:-999px;width:1px;height:1px;"), - e.appendChild(n); - var i = n.contentWindow, - r = i.document, - o = "var window,$hook"; - for (var s in i) - s in t || "eval" === s || ((o += ","), (o += s)); - for (var a in t) - (o += ","), (o += a), (o += "=self."), (o += a); - var u = r.createElement("script"); - u.appendChild( - r.createTextNode( - 'function $hook(self,console) {"use strict";\n ' + - o + - ";return function() {return eval(arguments[0])}}", - ), - ), - r.body.appendChild(u), - (this.exec = i.$hook(t, console)); - })((n.self = n), document.documentElement); - return i.exec(((e && e.transpile) || String)(t)), null; - }); - }), - n))); - }, - function (t, e) { - function n(t) { - t && (t.setTargetAtTime || (t.setTargetAtTime = t.setTargetValueAtTime)); - } - window, - 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 t = this.internal_createGain(); - return n(t.gain), t; - }), - (AudioContext.prototype.internal_createDelay = - AudioContext.prototype.createDelay), - (AudioContext.prototype.createDelay = function (t) { - var e = t - ? this.internal_createDelay(t) - : this.internal_createDelay(); - return n(e.delayTime), e; - }), - (AudioContext.prototype.internal_createBufferSource = - AudioContext.prototype.createBufferSource), - (AudioContext.prototype.createBufferSource = function () { - var i = this.internal_createBufferSource(); - return ( - i.start - ? ((i.internal_start = i.start), - (i.start = function (t, e, n) { - void 0 !== n - ? i.internal_start(t || 0, e, n) - : i.internal_start(t || 0, e || 0); - })) - : (i.start = function (t, e, n) { - e || n ? this.noteGrainOn(t || 0, e, n) : this.noteOn(t || 0); - }), - i.stop - ? ((i.internal_stop = i.stop), - (i.stop = function (t) { - i.internal_stop(t || 0); - })) - : (i.stop = function (t) { - this.noteOff(t || 0); - }), - n(i.playbackRate), - i - ); - }), - (AudioContext.prototype.internal_createDynamicsCompressor = - AudioContext.prototype.createDynamicsCompressor), - (AudioContext.prototype.createDynamicsCompressor = function () { - var t = this.internal_createDynamicsCompressor(); - return ( - n(t.threshold), - n(t.knee), - n(t.ratio), - n(t.reduction), - n(t.attack), - n(t.release), - t - ); - }), - (AudioContext.prototype.internal_createBiquadFilter = - AudioContext.prototype.createBiquadFilter), - (AudioContext.prototype.createBiquadFilter = function () { - var t = this.internal_createBiquadFilter(); - return n(t.frequency), n(t.detune), n(t.Q), n(t.gain), t; - }), - "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), - n(e.frequency), - n(e.detune), - e - ); - }))), - window.hasOwnProperty("webkitOfflineAudioContext") && - !window.hasOwnProperty("OfflineAudioContext") && - (window.OfflineAudioContext = window.webkitOfflineAudioContext), - (navigator.getUserMedia = - navigator.getUserMedia || - navigator.webkitGetUserMedia || - navigator.mozGetUserMedia || - navigator.msGetUserMedia); - var i = document.createElement("audio"); - p5.prototype.isSupported = function () { - return !!i.canPlayType; - }; - p5.prototype.isFileSupported = function (t) { - switch (t.toLowerCase()) { - case "mp3": - return !!i.canPlayType && i.canPlayType("audio/mpeg;"); - case "wav": - return !!i.canPlayType && i.canPlayType('audio/wav; codecs="1"'); - case "ogg": - return !!i.canPlayType && i.canPlayType('audio/ogg; codecs="vorbis"'); - case "aac": - case "m4a": - case "mp4": - return ( - !!i.canPlayType && - (i.canPlayType("audio/x-m4a;") || i.canPlayType("audio/aac;")) - ); - case "aif": - case "aiff": - return !!i.canPlayType && i.canPlayType("audio/x-aiff;"); - default: - return !1; - } - }; - }, - function (t, e) { - var n; - n = (function () { - return this; - })(); - try { - n = n || new Function("return this")(); - } catch (t) { - "object" == typeof window && (n = window); - } - t.exports = n; - }, - function (t, e, n) { - "use strict"; - n.r(e), - (e.default = - 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'start\') {\n _this.record(data.duration);\n } else if (data.name === \'stop\') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: "process",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: "record",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: "stop",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: \'buffers\',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: "getBuffers",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: "mergeBuffers",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: "clear",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);'); - }, - function (t, e, n) { - "use strict"; - n.r(e), - (e.default = - 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: "process",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: \'position\',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);'); - }, - function (t, e, n) { - "use strict"; - n.r(e), - (e.default = - 'function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'toggleNormalize\') {\n _this.normalize = data.normalize;\n } else if (data.name === \'smoothing\') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: "process",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: \'amplitude\',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);'); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(17)]), - void 0 === - (r = function (r) { - (r.Frequency = function (t, e) { - if (!(this instanceof r.Frequency)) return new r.Frequency(t, e); - r.TimeBase.call(this, t, e); - }), - r.extend(r.Frequency, r.TimeBase), - (r.Frequency.prototype._primaryExpressions = Object.create( - r.TimeBase.prototype._primaryExpressions, - )), - (r.Frequency.prototype._primaryExpressions.midi = { - regexp: /^(\d+(?:\.\d+)?midi)/, - method: function (t) { - return this.midiToFrequency(t); - }, - }), - (r.Frequency.prototype._primaryExpressions.note = { - regexp: /^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i, - method: function (t, e) { - var n = i[t.toLowerCase()] + 12 * (parseInt(e) + 1); - return this.midiToFrequency(n); - }, - }), - (r.Frequency.prototype._primaryExpressions.tr = { - regexp: /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/, - method: function (t, e, n) { - var i = 1; - return ( - t && - "0" !== t && - (i *= this._beatsToUnits( - this._timeSignature() * parseFloat(t), - )), - e && "0" !== e && (i *= this._beatsToUnits(parseFloat(e))), - n && - "0" !== n && - (i *= this._beatsToUnits(parseFloat(n) / 4)), - i - ); - }, - }), - (r.Frequency.prototype.transpose = function (t) { - return ( - (this._expr = function (t, e) { - return t() * this.intervalToFrequencyRatio(e); - }.bind(this, this._expr, t)), - this - ); - }), - (r.Frequency.prototype.harmonize = function (t) { - return ( - (this._expr = function (t, e) { - for (var n = t(), i = [], r = 0; r < e.length; r++) - i[r] = n * this.intervalToFrequencyRatio(e[r]); - return i; - }.bind(this, this._expr, t)), - this - ); - }), - (r.Frequency.prototype.toMidi = function () { - return this.frequencyToMidi(this.valueOf()); - }), - (r.Frequency.prototype.toNote = function () { - var t = this.valueOf(), - e = Math.log(t / r.Frequency.A4) / Math.LN2, - n = Math.round(12 * e) + 57, - i = Math.floor(n / 12); - return i < 0 && (n += -12 * i), o[n % 12] + i.toString(); - }), - (r.Frequency.prototype.toSeconds = function () { - return 1 / this.valueOf(); - }), - (r.Frequency.prototype.toFrequency = function () { - return this.valueOf(); - }), - (r.Frequency.prototype.toTicks = function () { - var t = this._beatsToUnits(1), - e = this.valueOf() / t; - return Math.floor(e * r.Transport.PPQ); - }), - (r.Frequency.prototype._frequencyToUnits = function (t) { - return t; - }), - (r.Frequency.prototype._ticksToUnits = function (t) { - return 1 / ((60 * t) / (r.Transport.bpm.value * r.Transport.PPQ)); - }), - (r.Frequency.prototype._beatsToUnits = function (t) { - return 1 / r.TimeBase.prototype._beatsToUnits.call(this, t); - }), - (r.Frequency.prototype._secondsToUnits = function (t) { - return 1 / t; - }), - (r.Frequency.prototype._defaultUnits = "hz"); - var i = { - 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, - }, - o = [ - "C", - "C#", - "D", - "D#", - "E", - "F", - "F#", - "G", - "G#", - "A", - "A#", - "B", - ]; - return ( - (r.Frequency.A4 = 440), - (r.Frequency.prototype.midiToFrequency = function (t) { - return r.Frequency.A4 * Math.pow(2, (t - 69) / 12); - }), - (r.Frequency.prototype.frequencyToMidi = function (t) { - return 69 + (12 * Math.log(t / r.Frequency.A4)) / Math.LN2; - }), - r.Frequency - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(16)]), - void 0 === - (r = function (i) { - return ( - (i.TransportTime = function (t, e) { - if (!(this instanceof i.TransportTime)) - return new i.TransportTime(t, e); - i.Time.call(this, t, e); - }), - i.extend(i.TransportTime, i.Time), - (i.TransportTime.prototype._unaryExpressions = Object.create( - i.Time.prototype._unaryExpressions, - )), - (i.TransportTime.prototype._unaryExpressions.quantize = { - regexp: /^@/, - method: function (t) { - var e = this._secondsToTicks(t()), - n = Math.ceil(i.Transport.ticks / e); - return this._ticksToUnits(n * e); - }, - }), - (i.TransportTime.prototype._secondsToTicks = function (t) { - var e = t / this._beatsToUnits(1); - return Math.round(e * i.Transport.PPQ); - }), - (i.TransportTime.prototype.valueOf = function () { - return ( - this._secondsToTicks(this._expr()) + - (this._plusNow ? i.Transport.ticks : 0) - ); - }), - (i.TransportTime.prototype.toTicks = function () { - return this.valueOf(); - }), - (i.TransportTime.prototype.toSeconds = function () { - return this._expr() + (this._plusNow ? i.Transport.seconds : 0); - }), - (i.TransportTime.prototype.toFrequency = function () { - return 1 / this.toSeconds(); - }), - i.TransportTime - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [ - n(0), - n(4), - n(13), - n(1), - n(33), - n(21), - n(34), - n(20), - n(35), - n(36), - n(37), - ]), - void 0 === - (r = function (u) { - "use strict"; - function n(t, e, n) { - var i = new t(); - return ( - n._eval(e[0]).connect(i, 0, 0), n._eval(e[1]).connect(i, 0, 1), i - ); - } - function i(t, e, n) { - var i = new t(); - return n._eval(e[0]).connect(i, 0, 0), i; - } - function r(t) { - return t ? parseFloat(t) : void 0; - } - function o(t) { - return t && t.args ? parseFloat(t.args) : void 0; - } - return ( - (u.Expr = function () { - var t = this._replacements(Array.prototype.slice.call(arguments)), - e = this._parseInputs(t); - (this._nodes = []), (this.input = new Array(e)); - for (var n = 0; n < e; n++) - this.input[n] = this.context.createGain(); - var i, - r = this._parseTree(t); - try { - i = this._eval(r); - } catch (e) { - throw ( - (this._disposeNodes(), - new Error("Tone.Expr: Could evaluate expression: " + t)) - ); - } - this.output = i; - }), - u.extend(u.Expr, u.SignalBase), - (u.Expr._Expressions = { - value: { - signal: { - regexp: /^\d+\.\d+|^\d+/, - method: function (t) { - return new u.Signal(r(t)); - }, - }, - input: { - regexp: /^\$\d/, - method: function (t, e) { - return e.input[r(t.substr(1))]; - }, - }, - }, - glue: { - "(": { regexp: /^\(/ }, - ")": { regexp: /^\)/ }, - ",": { regexp: /^,/ }, - }, - func: { - abs: { regexp: /^abs/, method: i.bind(this, u.Abs) }, - mod: { - regexp: /^mod/, - method: function (t, e) { - var n = o(t[1]), - i = new u.Modulo(n); - return e._eval(t[0]).connect(i), i; - }, - }, - pow: { - regexp: /^pow/, - method: function (t, e) { - var n = o(t[1]), - i = new u.Pow(n); - return e._eval(t[0]).connect(i), i; - }, - }, - a2g: { - regexp: /^a2g/, - method: function (t, e) { - var n = new u.AudioToGain(); - return e._eval(t[0]).connect(n), n; - }, - }, - }, - binary: { - "+": { - regexp: /^\+/, - precedence: 1, - method: n.bind(this, u.Add), - }, - "-": { - regexp: /^\-/, - precedence: 1, - method: function (t, e) { - return 1 === t.length - ? i(u.Negate, t, e) - : n(u.Subtract, t, e); - }, - }, - "*": { - regexp: /^\*/, - precedence: 0, - method: n.bind(this, u.Multiply), - }, - }, - unary: { - "-": { regexp: /^\-/, method: i.bind(this, u.Negate) }, - "!": { regexp: /^\!/, method: i.bind(this, u.NOT) }, - }, - }), - (u.Expr.prototype._parseInputs = function (t) { - var e = t.match(/\$\d/g), - n = 0; - if (null !== e) - for (var i = 0; i < e.length; i++) { - var r = parseInt(e[i].substr(1)) + 1; - n = Math.max(n, r); - } - return n; - }), - (u.Expr.prototype._replacements = function (t) { - for (var e = t.shift(), n = 0; n < t.length; n++) - e = e.replace(/\%/i, t[n]); - return e; - }), - (u.Expr.prototype._tokenize = function (t) { - for (var e = -1, n = []; 0 < t.length; ) { - var i = r((t = t.trim())); - n.push(i), (t = t.substr(i.value.length)); - } - function r(t) { - for (var e in u.Expr._Expressions) { - var n = u.Expr._Expressions[e]; - for (var i in n) { - var r = n[i], - o = r.regexp, - s = t.match(o); - if (null !== s) - return { type: e, value: s[0], method: r.method }; - } - } - throw new SyntaxError("Tone.Expr: Unexpected token " + t); - } - return { - next: function () { - return n[++e]; - }, - peek: function () { - return n[e + 1]; - }, - }; - }), - (u.Expr.prototype._parseTree = function (t) { - var i = this._tokenize(t), - s = this.isUndef.bind(this); - function r(t, e) { - return !s(t) && "glue" === t.type && t.value === e; - } - function o(t, e, n) { - var i = u.Expr._Expressions[e]; - if (!s(t)) - for (var r in i) { - var o = i[r]; - if (o.regexp.test(t.value)) { - if (s(n)) return !0; - if (o.precedence === n) return !0; - } - } - return !1; - } - function a(t) { - var e; - s(t) && (t = 5), - (e = - t < 0 - ? (function t() { - var e, n; - return o((e = i.peek()), "unary") - ? ((e = i.next()), - (n = t()), - { - operator: e.value, - method: e.method, - args: [n], - }) - : (function () { - var t, e; - if (((t = i.peek()), s(t))) - throw new SyntaxError( - "Tone.Expr: Unexpected termination of expression", - ); - if ("func" === t.type) - return (function (t) { - var e = []; - if (!r(i.next(), "(")) - throw new SyntaxError( - 'Tone.Expr: Expected ( in a function call "' + - t.value + - '"', - ); - if ( - (r(i.peek(), ")") || - (e = (function () { - for ( - var t, e = []; - (t = a()), - !s(t) && - (e.push(t), r(i.peek(), ",")); - - ) - i.next(); - return e; - })()), - r(i.next(), ")")) - ) - return { - method: t.method, - args: e, - name: name, - }; - throw new SyntaxError( - 'Tone.Expr: Expected ) in a function call "' + - t.value + - '"', - ); - })((t = i.next())); - if ("value" === t.type) - return { - method: (t = i.next()).method, - args: t.value, - }; - if (r(t, "(")) { - if ( - (i.next(), - (e = a()), - !r((t = i.next()), ")")) - ) - throw new SyntaxError("Expected )"); - return e; - } - throw new SyntaxError( - "Tone.Expr: Parse error, cannot process token " + - t.value, - ); - })(); - })() - : a(t - 1)); - for (var n = i.peek(); o(n, "binary", t); ) - (e = { - operator: (n = i.next()).value, - method: n.method, - args: [e, a(t - 1)], - }), - (n = i.peek()); - return e; - } - return a(); - }), - (u.Expr.prototype._eval = function (t) { - if (!this.isUndef(t)) { - var e = t.method(t.args, this); - return this._nodes.push(e), e; - } - }), - (u.Expr.prototype._disposeNodes = function () { - for (var t = 0; t < this._nodes.length; t++) { - var e = this._nodes[t]; - this.isFunction(e.dispose) - ? e.dispose() - : this.isFunction(e.disconnect) && e.disconnect(), - (e = null), - (this._nodes[t] = null); - } - this._nodes = null; - }), - (u.Expr.prototype.dispose = function () { - u.prototype.dispose.call(this), this._disposeNodes(); - }), - u.Expr - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(21), n(13), n(2)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.GreaterThan = function (t) { - this.createInsOuts(2, 0), - (this._param = this.input[0] = new e.Subtract(t)), - (this.input[1] = this._param.input[1]), - (this._gtz = this.output = new e.GreaterThanZero()), - this._param.connect(this._gtz); - }), - e.extend(e.GreaterThan, e.Signal), - (e.GreaterThan.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._param.dispose(), - (this._param = null), - this._gtz.dispose(), - (this._gtz = null), - this - ); - }), - e.GreaterThan - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(6), n(15)]), - void 0 === - (r = 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 - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(6), n(1), n(13)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Modulo = function (t) { - this.createInsOuts(1, 0), - (this._shaper = new e.WaveShaper(Math.pow(2, 16))), - (this._multiply = new e.Multiply()), - (this._subtract = this.output = new e.Subtract()), - (this._modSignal = new e.Signal(t)), - 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(t); - }), - e.extend(e.Modulo, e.SignalBase), - (e.Modulo.prototype._setWaveShaper = function (e) { - this._shaper.setMap(function (t) { - return Math.floor((t + 1e-4) / e); - }); - }), - Object.defineProperty(e.Modulo.prototype, "value", { - get: function () { - return this._modSignal.value; - }, - set: function (t) { - (this._modSignal.value = t), this._setWaveShaper(t); - }, - }), - (e.Modulo.prototype.dispose = function () { - return ( - e.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 - ); - }), - e.Modulo - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(6)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.Pow = function (t) { - (this._exp = this.defaultArg(t, 1)), - (this._expScaler = - this.input = - this.output = - new e.WaveShaper(this._expFunc(this._exp), 8192)); - }), - e.extend(e.Pow, e.SignalBase), - Object.defineProperty(e.Pow.prototype, "value", { - get: function () { - return this._exp; - }, - set: function (t) { - (this._exp = t), - this._expScaler.setMap(this._expFunc(this._exp)); - }, - }), - (e.Pow.prototype._expFunc = function (e) { - return function (t) { - return Math.pow(Math.abs(t), e); - }; - }), - (e.Pow.prototype.dispose = function () { - return ( - e.prototype.dispose.call(this), - this._expScaler.dispose(), - (this._expScaler = null), - this - ); - }), - e.Pow - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(6), n(2)]), - void 0 === - (r = 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 - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(6)]), - void 0 === - (r = function (t) { - "use strict"; - return ( - (t.EqualPowerGain = function () { - this._eqPower = - this.input = - this.output = - new t.WaveShaper( - function (t) { - return Math.abs(t) < 0.001 ? 0 : this.equalPowerScale(t); - }.bind(this), - 4096, - ); - }), - t.extend(t.EqualPowerGain, t.SignalBase), - (t.EqualPowerGain.prototype.dispose = function () { - return ( - t.prototype.dispose.call(this), - this._eqPower.dispose(), - (this._eqPower = null), - this - ); - }), - t.EqualPowerGain - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - var i, r; - (i = [n(0), n(19), n(9)]), - void 0 === - (r = function (e) { - "use strict"; - return ( - (e.TimelineState = function (t) { - e.Timeline.call(this), (this._initial = t); - }), - e.extend(e.TimelineState, e.Timeline), - (e.TimelineState.prototype.getValueAtTime = function (t) { - var e = this.get(t); - return null !== e ? e.state : this._initial; - }), - (e.TimelineState.prototype.setStateAtTime = function (t, e) { - this.add({ state: t, time: e }); - }), - e.TimelineState - ); - }.apply(e, i)) || (t.exports = r); - }, - function (t, e, n) { - "use strict"; - n.r(e); - n(24), n(25); - var c = n(3); - var o = new (function t() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, t), - (this.input = c.a.createGain()), - (this.output = c.a.createGain()), - (this.limiter = c.a.createDynamicsCompressor()), - (this.limiter.threshold.value = -3), - (this.limiter.ratio.value = 20), - (this.limiter.knee.value = 1), - (this.audiocontext = c.a), - this.output.disconnect(), - this.input.connect(this.limiter), - this.limiter.connect(this.output), - (this.meter = c.a.createGain()), - (this.fftMeter = c.a.createGain()), - this.output.connect(this.meter), - this.output.connect(this.fftMeter), - this.output.connect(this.audiocontext.destination), - (this.soundArray = []), - (this.parts = []), - (this.extensions = []); - })(); - (p5.prototype.getOutputVolume = function () { - return o.output.gain.value; - }), - (p5.prototype.outputVolume = function (t) { - var e = - 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, - n = - 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 0; - if ("number" == typeof t) { - var i = o.audiocontext.currentTime, - r = o.output.gain.value; - o.output.gain.cancelScheduledValues(i + n), - o.output.gain.linearRampToValueAtTime(r, i + n), - o.output.gain.linearRampToValueAtTime(t, i + n + e); - } else { - if (!t) return o.output.gain; - t.connect(o.output.gain); - } - }), - (p5.prototype.soundOut = p5.soundOut = o), - (p5.soundOut._silentNode = o.audiocontext.createGain()), - (p5.soundOut._silentNode.gain.value = 0), - p5.soundOut._silentNode.connect(o.audiocontext.destination); - var p = o, - i = n(5), - s = n.n(i); - function f(t) { - return (f = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function l(t) { - var e = Math.log(t / 440) / Math.log(2); - return Math.round(12 * e) + 69; - } - function r(t) { - return 440 * Math.pow(2, (t - 69) / 12); - } - function h(t) { - if ("string" != typeof t) return t; - var e = { A: 21, B: 23, C: 24, D: 26, E: 28, F: 29, G: 31 }[ - t[0].toUpperCase() - ]; - switch (((e += 12 * (~~t.slice(-1) - 1)), t[1])) { - case "#": - e += 1; - break; - case "b": - e -= 1; - } - return r(e); - } - function a(t) { - var e, - n = u( - (e = t.getChannelData(0)), - 1 < t.numberOfChannels ? t.getChannelData(1) : e, - ), - i = new window.ArrayBuffer(44 + 2 * n.length), - r = new window.DataView(i); - d(r, 0, "RIFF"), - r.setUint32(4, 36 + 2 * n.length, !0), - d(r, 8, "WAVE"), - d(r, 12, "fmt "), - r.setUint32(16, 16, !0), - r.setUint16(20, 1, !0), - r.setUint16(22, 2, !0), - r.setUint32(24, p.audiocontext.sampleRate, !0), - r.setUint32(28, 4 * p.audiocontext.sampleRate, !0), - r.setUint16(32, 4, !0), - r.setUint16(34, 16, !0), - d(r, 36, "data"), - r.setUint32(40, 2 * n.length, !0); - for (var o = n.length, s = 44, a = 0; a < o; a++) - r.setInt16(s, 32767 * n[a], !0), (s += 2); - return r; - } - function u(t, e) { - for ( - var n = t.length + e.length, i = new Float32Array(n), r = 0, o = 0; - o < n; - - ) - (i[o++] = t[r]), (i[o++] = e[r]), r++; - return i; - } - function d(t, e, n) { - for (var i = n.length, r = 0; r < i; r++) - t.setUint8(e + r, n.charCodeAt(r)); - } - function y(t) { - var e = t, - n = new AudioWorkletNode(p.audiocontext, s.a.soundFileProcessor); - return ( - n instanceof ScriptProcessorNode && (e = n.bufferSize), - n.disconnect(), - (n = null), - e - ); - } - var m = function (t, e, n) { - var i, - r, - o = new Error(); - return ( - (o.name = t), - (o.originalStack = o.stack + e), - (i = o.stack + e), - (o.failedPath = n), - (r = i.split("\n").filter(function (t) { - return !t.match(/(p5.|native code|globalInit)/g); - })), - (o.stack = r.join("\n")), - o - ); - }, - v = [n(27).default, n(28).default, n(29).default], - _ = p.audiocontext, - g = !1; - function b(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function T(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function w(t, e, n) { - return e && T(t.prototype, e), n && T(t, n), t; - } - p5.prototype.registerMethod("init", function () { - if (!g) { - this.preload || window.preload || (this.preload = function () {}), - this._incrementPreload(); - var t = function () { - (g = !0), this._decrementPreload(); - }.bind(this); - Promise.all( - v.map(function (t) { - var e = new Blob([t], { type: "application/javascript" }), - n = URL.createObjectURL(e); - return _.audioWorklet.addModule(n); - }), - ).then(t); - } - }); - var x, - S = p.audiocontext; - void 0 !== S.createStereoPanner - ? (x = (function () { - function n(t, e) { - b(this, n), - (this.stereoPanner = this.input = S.createStereoPanner()), - t.connect(this.stereoPanner), - this.stereoPanner.connect(e); - } - return ( - w(n, [ - { - key: "pan", - value: function (t, e) { - var n = e || 0, - i = S.currentTime + n; - this.stereoPanner.pan.linearRampToValueAtTime(t, i); - }, - }, - { key: "inputChannels", value: function () {} }, - { - key: "connect", - value: function (t) { - this.stereoPanner.connect(t); - }, - }, - { - key: "disconnect", - value: function () { - this.stereoPanner && this.stereoPanner.disconnect(); - }, - }, - ]), - n - ); - })()) - : (x = (function () { - function i(t, e, n) { - b(this, i), - (this.input = S.createGain()), - t.connect(this.input), - (this.left = S.createGain()), - (this.right = S.createGain()), - (this.left.channelInterpretation = "discrete"), - (this.right.channelInterpretation = "discrete"), - 1 < n - ? ((this.splitter = S.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 = S.createChannelMerger(2)), - this.left.connect(this.output, 0, 1), - this.right.connect(this.output, 0, 0), - this.output.connect(e); - } - return ( - w(i, [ - { - key: "pan", - value: function (t, e) { - var n = e || 0, - i = S.currentTime + n, - r = (t + 1) / 2, - o = Math.cos((r * Math.PI) / 2), - s = Math.sin((r * Math.PI) / 2); - this.left.gain.linearRampToValueAtTime(s, i), - this.right.gain.linearRampToValueAtTime(o, i); - }, - }, - { - key: "inputChannels", - value: function (t) { - 1 === t - ? (this.input.disconnect(), - this.input.connect(this.left), - this.input.connect(this.right)) - : 2 === t && - (void 0 === this.splitter && - (this.splitter = S.createChannelSplitter(2)), - this.input.disconnect(), - this.input.connect(this.splitter), - this.splitter.connect(this.left, 1), - this.splitter.connect(this.right, 0)); - }, - }, - { - key: "connect", - value: function (t) { - this.output.connect(t); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(); - }, - }, - ]), - i - ); - })()); - var k = x; - function P(t) { - return (P = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function A(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function O(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function C(t, e, n, i) { - O(this, C), - (this.callback = t), - (this.time = e), - (this.id = n), - (this.val = i); - } - var R = p.audiocontext; - var q = (function () { - function o(t, e, n, i) { - if ((O(this, o), void 0 !== t)) { - if ("string" == typeof t || "string" == typeof t[0]) { - var r = p5.prototype._checkFileFormats(t); - this.url = r; - } else if ( - "object" === P(t) && - !( - window.File && - window.FileReader && - window.FileList && - window.Blob - ) - ) - throw "Unable to load file because the File API is not supported"; - t.file && (t = t.file), (this.file = t); - } - (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._workletNode = null), - (this.bufferSourceNodes = []), - (this.bufferSourceNode = null), - (this.buffer = null), - (this.playbackRate = 1), - (this.input = p.audiocontext.createGain()), - (this.output = p.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 k(this.output, p.input, 2)), - (this.url || this.file) && this.load(e, n), - p.soundArray.push(this), - (this._whileLoading = "function" == typeof i ? i : function () {}), - (this._clearOnEnd = function (t) { - var e = t.target, - n = this; - (e._playing = !1), - e.removeEventListener("ended", n._clearOnEnd), - n._onended(n), - n.bufferSourceNodes - .map(function (t, e) { - return e; - }) - .reverse() - .forEach(function (t) { - !1 === n.bufferSourceNodes[t]._playing && - n.bufferSourceNodes.splice(t, 1); - }), - 0 === n.bufferSourceNodes.length && (n._playing = !1); - }.bind(this)), - (this.amp = this.setVolume), - (this.fade = this.setVolume); - } - return ( - (function (t, e, n) { - e && A(t.prototype, e), n && A(t, n); - })(o, [ - { - key: "load", - value: function (n, i) { - var r = this, - o = new Error().stack; - if (void 0 !== this.url && "" !== this.url) { - var s = new XMLHttpRequest(); - s.addEventListener( - "progress", - function (t) { - r._updateProgress(t); - }, - !1, - ), - s.open("GET", this.url, !0), - (s.responseType = "arraybuffer"), - (s.onload = function () { - if (200 === s.status) { - if (!r.panner) return; - R.decodeAudioData( - s.response, - function (t) { - r.panner && - ((r.buffer = t), - r.panner.inputChannels(t.numberOfChannels), - n && n(r)); - }, - function () { - if (r.panner) { - var t = new m("decodeAudioData", o, r.url), - e = - "AudioContext error at decodeAudioData for " + - r.url; - i && ((t.msg = e), i(t)); - } - }, - ); - } else { - if (!r.panner) return; - var t = new m("loadSound", o, r.url), - e = - "Unable to load " + - r.url + - ". The request status was: " + - s.status + - " (" + - s.statusText + - ")"; - i && ((t.message = e), i(t)); - } - }), - (s.onerror = function () { - var t = new m("loadSound", o, r.url), - e = - "There was no response from the server at " + - r.url + - ". Check the url and internet connectivity."; - i && ((t.message = e), i(t)); - }), - s.send(); - } else if (void 0 !== this.file) { - var t = new FileReader(); - (t.onload = function () { - r.panner && - R.decodeAudioData(t.result, function (t) { - r.panner && - ((r.buffer = t), - r.panner.inputChannels(t.numberOfChannels), - n && n(r)); - }); - }), - (t.onerror = function (t) { - r.panner && onerror && onerror(t); - }), - t.readAsArrayBuffer(this.file); - } - }, - }, - { - key: "_updateProgress", - value: function (t) { - if (t.lengthComputable) { - var e = (t.loaded / t.total) * 0.99; - this._whileLoading(e, t); - } else this._whileLoading("size unknown"); - }, - }, - { - key: "isLoaded", - value: function () { - return !!this.buffer; - }, - }, - { - key: "play", - value: function (t, e, n, i, r) { - if (this.output) { - var o, - s, - a = t || 0; - if ( - (a < 0 && (a = 0), - (a += p.audiocontext.currentTime), - void 0 !== e && this.rate(e), - void 0 !== n && this.setVolume(n), - !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(a), this._counterNode.stop(a)), - "untildone" !== this.mode || !this.isPlaying()) - ) { - if ( - ((this.bufferSourceNode = this._initSourceNode()), - delete this._counterNode, - (this._counterNode = this._initCounterNode()), - i) - ) { - if (!(0 <= i && i < this.buffer.duration)) - throw "start time out of range"; - o = i; - } else o = 0; - (r = - r && - (r <= this.buffer.duration - o ? r : this.buffer.duration)), - this._paused - ? (this.bufferSourceNode.start(a, this.pauseTime, r), - this._counterNode.start(a, this.pauseTime, r)) - : (this.bufferSourceNode.start(a, o, r), - this._counterNode.start(a, o, r)), - (this._playing = !0), - (this._paused = !1), - this.bufferSourceNodes.push(this.bufferSourceNode), - (this.bufferSourceNode._arrayIndex = - this.bufferSourceNodes.length - 1), - this.bufferSourceNode.addEventListener( - "ended", - this._clearOnEnd, - ), - (this.bufferSourceNode.loop = this._looping), - (this._counterNode.loop = this._looping), - !0 === this._looping && - ((s = r || o - 1e-15), - (this.bufferSourceNode.loopStart = o), - (this.bufferSourceNode.loopEnd = s), - (this._counterNode.loopStart = o), - (this._counterNode.loopEnd = s)); - } - } - }, - }, - { - key: "playMode", - value: function (t) { - var e = t.toLowerCase(); - if ("restart" === e && this.buffer && this.bufferSourceNode) - for (var n = 0; n < this.bufferSourceNodes.length - 1; n++) { - var i = p.audiocontext.currentTime; - this.bufferSourceNodes[n].stop(i); - } - if ("restart" !== e && "sustain" !== e && "untildone" !== e) - throw 'Invalid play mode. Must be either "restart" or "sustain"'; - this.mode = e; - }, - }, - { - key: "pause", - value: function (t) { - var e = (t || 0) + p.audiocontext.currentTime; - this.isPlaying() && this.buffer && this.bufferSourceNode - ? ((this._paused = !0), - (this._playing = !1), - (this.pauseTime = this.currentTime()), - this.bufferSourceNode.stop(e), - this._counterNode.stop(e), - (this._pauseTime = this.currentTime())) - : (this._pauseTime = 0); - }, - }, - { - key: "loop", - value: function (t, e, n, i, r) { - (this._looping = !0), this.play(t, e, n, i, r); - }, - }, - { - key: "setLoop", - value: function (t) { - if (!0 === t) this._looping = !0; - else { - if (!1 !== t) - throw "Error: setLoop accepts either true or false"; - this._looping = !1; - } - this.bufferSourceNode && - ((this.bufferSourceNode.loop = this._looping), - (this._counterNode.loop = this._looping)); - }, - }, - { - key: "isLooping", - value: function () { - return ( - !!this.bufferSourceNode && - !0 === this._looping && - !0 === this.isPlaying() - ); - }, - }, - { - key: "isPlaying", - value: function () { - return this._playing; - }, - }, - { - key: "isPaused", - value: function () { - return this._paused; - }, - }, - { - key: "stop", - value: function (t) { - var e = t || 0; - if ("sustain" === this.mode || "untildone" === this.mode) - this.stopAll(e), - (this._playing = !1), - (this.pauseTime = 0), - (this._paused = !1); - else if (this.buffer && this.bufferSourceNode) { - var n = p.audiocontext.currentTime, - i = e || 0; - (this.pauseTime = 0), - this.bufferSourceNode.stop(n + i), - this._counterNode.stop(n + i), - (this._playing = !1), - (this._paused = !1); - } - }, - }, - { - key: "stopAll", - value: function (t) { - var e = p.audiocontext.currentTime, - n = t || 0; - if (this.buffer && this.bufferSourceNode) { - for (var i in this.bufferSourceNodes) { - var r = this.bufferSourceNodes[i]; - if (r) - try { - r.stop(e + n); - } catch (t) {} - } - this._counterNode.stop(e + n); - } - }, - }, - { - key: "getVolume", - value: function () { - return this.output.gain.value; - }, - }, - { - key: "pan", - value: function (t, e) { - (this.panPosition = t), this.panner.pan(t, e); - }, - }, - { - key: "getPan", - value: function () { - return this.panPosition; - }, - }, - { - key: "rate", - value: function (t) { - var e = !1; - if (void 0 === t) return this.playbackRate; - if ( - (0 === (this.playbackRate = t) - ? (t = 1e-13) - : t < 0 && !this.reversed - ? ((t = Math.abs(t)), (e = !0)) - : 0 < t && this.reversed && (e = !0), - this.bufferSourceNode) - ) { - var n = p.audiocontext.currentTime; - this.bufferSourceNode.playbackRate.cancelScheduledValues(n), - this.bufferSourceNode.playbackRate.linearRampToValueAtTime( - Math.abs(t), - n, - ), - this._counterNode.playbackRate.cancelScheduledValues(n), - this._counterNode.playbackRate.linearRampToValueAtTime( - Math.abs(t), - n, - ); - } - return e && this.reverseBuffer(), this.playbackRate; - }, - }, - { - key: "setPitch", - value: function (t) { - var e = r(t) / r(60); - this.rate(e); - }, - }, - { - key: "getPlaybackRate", - value: function () { - return this.playbackRate; - }, - }, - { - key: "setVolume", - value: function (t, e, n) { - if ("number" == typeof t) { - var i = e || 0, - r = n || 0, - o = p.audiocontext.currentTime, - s = this.output.gain.value; - this.output.gain.cancelScheduledValues(o + r), - this.output.gain.linearRampToValueAtTime(s, o + r), - this.output.gain.linearRampToValueAtTime(t, o + r + i); - } else { - if (!t) return this.output.gain; - t.connect(this.output.gain); - } - }, - }, - { - key: "duration", - value: function () { - return this.buffer ? this.buffer.duration : 0; - }, - }, - { - key: "currentTime", - value: function () { - return this.reversed - ? Math.abs(this._lastPos - this.buffer.length) / R.sampleRate - : this._lastPos / R.sampleRate; - }, - }, - { - key: "jump", - value: function (t, e) { - if (t < 0 || t > this.buffer.duration) - throw "jump time out of range"; - if (e > this.buffer.duration - t) throw "end time out of range"; - var n = t || 0, - i = e || void 0; - this.isPlaying() && - (this.stop(0), - this.play(0, this.playbackRate, this.output.gain.value, n, i)); - }, - }, - { - key: "channels", - value: function () { - return this.buffer.numberOfChannels; - }, - }, - { - key: "sampleRate", - value: function () { - return this.buffer.sampleRate; - }, - }, - { - key: "frames", - value: function () { - return this.buffer.length; - }, - }, - { - key: "getPeaks", - value: 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, - n = e.length / t, - i = ~~(n / 10) || 1, - r = e.numberOfChannels, - o = new Float32Array(Math.round(t)), - s = 0; - s < r; - s++ - ) - for (var a = e.getChannelData(s), u = 0; u < t; u++) { - for ( - var c = ~~(u * n), l = ~~(c + n), h = 0, p = c; - p < l; - p += i - ) { - var f = a[p]; - h < f ? (h = f) : h < -f && (h = f); - } - (0 === s || Math.abs(h) > o[u]) && (o[u] = h); - } - return o; - } - }, - }, - { - key: "reverseBuffer", - value: function () { - if (!this.buffer) throw "SoundFile is not done loading"; - var t = this._lastPos / R.sampleRate, - e = this.getVolume(); - this.setVolume(0, 0.001); - for (var n = this.buffer.numberOfChannels, i = 0; i < n; i++) - this.buffer.getChannelData(i).reverse(); - (this.reversed = !this.reversed), - this.isPlaying() && t && this.jump(this.duration() - t), - this.setVolume(e, 0.001); - }, - }, - { - key: "onended", - value: function (t) { - return (this._onended = t), this; - }, - }, - { key: "add", value: function () {} }, - { - key: "dispose", - value: function () { - var t = p.audiocontext.currentTime, - e = p.soundArray.indexOf(this); - if ( - (p.soundArray.splice(e, 1), - this.stop(t), - this.buffer && this.bufferSourceNode) - ) { - for (var n = 0; n < this.bufferSourceNodes.length - 1; n++) - if (null !== this.bufferSourceNodes[n]) { - this.bufferSourceNodes[n].disconnect(); - try { - this.bufferSourceNodes[n].stop(t); - } catch (t) {} - this.bufferSourceNodes[n] = null; - } - if (this.isPlaying()) { - try { - this._counterNode.stop(t); - } catch (t) {} - this._counterNode = null; - } - } - this.output && (this.output.disconnect(), (this.output = null)), - this.panner && (this.panner.disconnect(), (this.panner = null)); - }, - }, - { - key: "connect", - value: function (t) { - t - ? t.hasOwnProperty("input") - ? this.panner.connect(t.input) - : this.panner.connect(t) - : this.panner.connect(p.input); - }, - }, - { - key: "disconnect", - value: function () { - this.panner && this.panner.disconnect(); - }, - }, - { key: "getLevel", value: function () {} }, - { - key: "setPath", - value: function (t, e) { - var n = p5.prototype._checkFileFormats(t); - (this.url = n), this.load(e); - }, - }, - { - key: "setBuffer", - value: function (t) { - var e = t.length, - n = t[0].length, - i = R.createBuffer(e, n, R.sampleRate); - t[0] instanceof Float32Array || (t[0] = new Float32Array(t[0])); - for (var r = 0; r < e; r++) { - i.getChannelData(r).set(t[r]); - } - (this.buffer = i), this.panner.inputChannels(e); - }, - }, - { - key: "_initCounterNode", - value: function () { - var e = this, - n = this, - t = R.currentTime, - i = R.createBufferSource(), - r = y(256); - return ( - n._workletNode && - (n._workletNode.disconnect(), delete n._workletNode), - (n._workletNode = new AudioWorkletNode( - R, - s.a.soundFileProcessor, - { processorOptions: { bufferSize: r } }, - )), - (n._workletNode.port.onmessage = function (t) { - if ("position" === t.data.name) { - if (0 === t.data.position) return; - (e._lastPos = t.data.position), e._onTimeUpdate(n._lastPos); - } - }), - (i.buffer = (function (t) { - for ( - var e = t.length, - n = R.createBuffer(1, t.length, R.sampleRate), - i = n.getChannelData(0), - r = 0; - r < e; - r++ - ) - i[r] = r; - return n; - })(n.buffer)), - i.playbackRate.setValueAtTime(n.playbackRate, t), - i.connect(n._workletNode), - n._workletNode.connect(p5.soundOut._silentNode), - i - ); - }, - }, - { - key: "_initSourceNode", - value: function () { - var t = R.createBufferSource(); - return ( - (t.buffer = this.buffer), - (t.playbackRate.value = this.playbackRate), - t.connect(this.output), - t - ); - }, - }, - { key: "processPeaks", value: function (t, e, n, i) {} }, - { - key: "addCue", - value: function (t, e, n) { - var i = this._cueIDCounter++, - r = new C(e, t, i, n); - return this._cues.push(r), i; - }, - }, - { - key: "removeCue", - value: function (t) { - for (var e = this._cues.length, n = 0; n < e; n++) { - if (this._cues[n].id === t) { - this._cues.splice(n, 1); - break; - } - } - this._cues.length; - }, - }, - { - key: "clearCues", - value: function () { - this._cues = []; - }, - }, - { - key: "_onTimeUpdate", - value: function (t) { - for ( - var e = t / this.buffer.sampleRate, - n = this._cues.length, - i = 0; - i < n; - i++ - ) { - var r = this._cues[i], - o = r.time, - s = r.val; - (this._prevUpdateTime || 0) <= o && o <= e && r.callback(s); - } - this._prevUpdateTime = e; - }, - }, - { - key: "save", - value: function (t) { - p5.prototype.saveSound(this, t, "wav"); - }, - }, - { - key: "getBlob", - value: function () { - var t = a(this.buffer); - return new Blob([t], { type: "audio/wav" }); - }, - }, - ]), - o - ); - })(); - var E = q; - function N(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var B = (function () { - function e(t) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - (this.bufferSize = y(2048)), - (this.audiocontext = p.audiocontext), - (this._workletNode = new AudioWorkletNode( - this.audiocontext, - s.a.amplitudeProcessor, - { - outputChannelCount: [1], - parameterData: { smoothing: t || 0 }, - processorOptions: { - normalize: !1, - smoothing: t || 0, - numInputChannels: 2, - bufferSize: this.bufferSize, - }, - }, - )), - (this._workletNode.port.onmessage = function (t) { - "amplitude" === t.data.name && - ((this.volume = t.data.volume), - (this.volNorm = t.data.volNorm), - (this.stereoVol = t.data.stereoVol), - (this.stereoVolNorm = t.data.stereoVolNorm)); - }.bind(this)), - (this.input = this._workletNode), - (this.output = this.audiocontext.createGain()), - (this.volume = 0), - (this.volNorm = 0), - (this.stereoVol = [0, 0]), - (this.stereoVolNorm = [0, 0]), - (this.normalize = !1), - this._workletNode.connect(this.output), - (this.output.gain.value = 0), - this.output.connect(this.audiocontext.destination), - p.meter.connect(this._workletNode), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && N(t.prototype, e), n && N(t, n); - })(e, [ - { - key: "setInput", - value: function (t, e) { - p.meter.disconnect(), - e && (this._workletNode.parameters.get("smoothing").value = e), - null == t - ? p.meter.connect(this._workletNode) - : t - ? (t.connect(this._workletNode), - this._workletNode.disconnect(), - this._workletNode.connect(this.output)) - : p.meter.connect(this._workletNode); - }, - }, - { - key: "connect", - value: function (t) { - t - ? t.hasOwnProperty("input") - ? this.output.connect(t.input) - : this.output.connect(t) - : this.output.connect(this.panner.connect(p.input)); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(); - }, - }, - { - key: "getLevel", - value: function (t) { - return void 0 !== t - ? this.normalize - ? this.stereoVolNorm[t] - : this.stereoVol[t] - : this.normalize - ? this.volNorm - : this.volume; - }, - }, - { - key: "toggleNormalize", - value: function (t) { - (this.normalize = "boolean" == typeof t ? t : !this.normalize), - this._workletNode.port.postMessage({ - name: "toggleNormalize", - normalize: this.normalize, - }); - }, - }, - { - key: "smooth", - value: function (t) { - 0 <= t && - t < 1 && - this._workletNode.port.postMessage({ - name: "smoothing", - smoothing: t, - }); - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - this.input && (this.input.disconnect(), delete this.input), - this.output && (this.output.disconnect(), delete this.output), - this._workletNode.disconnect(), - delete this._workletNode; - }, - }, - ]), - e - ); - })(); - function V(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var j = (function () { - function n(t, e) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, n), - (this.input = this.analyser = p.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 = e || 1024), - p.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]), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && V(t.prototype, e), n && V(t, n); - })(n, [ - { - key: "setInput", - value: function (t) { - t - ? (t.output - ? t.output.connect(this.analyser) - : t.connect && t.connect(this.analyser), - p.fftMeter.disconnect()) - : p.fftMeter.connect(this.analyser); - }, - }, - { - key: "waveform", - value: function () { - for ( - var t, e, n = new Array(), i = 0; - i < arguments.length; - i++ - ) - "number" == typeof arguments[i] && - ((t = arguments[i]), (this.analyser.fftSize = 2 * t)), - "string" == typeof arguments[i] && (e = arguments[i]); - if (e && !p5.prototype._isSafari()) - return ( - (function (t) { - t.timeDomain instanceof Float32Array == !1 && - (t.timeDomain = new Float32Array( - t.analyser.frequencyBinCount, - )); - })(this, this.timeDomain), - this.analyser.getFloatTimeDomainData(this.timeDomain), - this.timeDomain - ); - !(function (t) { - t.timeDomain instanceof Uint8Array == !1 && - (t.timeDomain = new Uint8Array( - t.analyser.frequencyBinCount, - )); - })(this, this.timeDomain), - this.analyser.getByteTimeDomainData(this.timeDomain); - for (var r = 0; r < this.timeDomain.length; r++) { - var o = p5.prototype.map(this.timeDomain[r], 0, 255, -1, 1); - n.push(o); - } - return n; - }, - }, - { - key: "analyze", - value: function () { - for (var t, e = 0; e < arguments.length; e++) - "number" == typeof arguments[e] && - ((this.bins = arguments[e]), - (this.analyser.fftSize = 2 * this.bins)), - "string" == typeof arguments[e] && (t = arguments[e]); - return t && "db" === t.toLowerCase() - ? ((function (t) { - t.freqDomain instanceof Float32Array == !1 && - (t.freqDomain = new Float32Array( - t.analyser.frequencyBinCount, - )); - })(this), - this.analyser.getFloatFrequencyData(this.freqDomain), - this.freqDomain) - : ((function (t) { - t.freqDomain instanceof Uint8Array == !1 && - (t.freqDomain = new Uint8Array( - t.analyser.frequencyBinCount, - )); - })(this, this.freqDomain), - this.analyser.getByteFrequencyData(this.freqDomain), - Array.apply([], this.freqDomain)); - }, - }, - { - key: "getEnergy", - value: function (t, e) { - var n = p.audiocontext.sampleRate / 2; - if ( - ("bass" === t - ? ((t = this.bass[0]), (e = this.bass[1])) - : "lowMid" === t - ? ((t = this.lowMid[0]), (e = this.lowMid[1])) - : "mid" === t - ? ((t = this.mid[0]), (e = this.mid[1])) - : "highMid" === t - ? ((t = this.highMid[0]), (e = this.highMid[1])) - : "treble" === t && - ((t = this.treble[0]), (e = this.treble[1])), - "number" != typeof t) - ) - throw "invalid input for getEnergy()"; - if (e) { - if (t && e) { - if (e < t) { - var i = e; - (e = t), (t = i); - } - for ( - var r = Math.round((t / n) * this.freqDomain.length), - o = Math.round((e / n) * this.freqDomain.length), - s = 0, - a = 0, - u = r; - u <= o; - u++ - ) - (s += this.freqDomain[u]), (a += 1); - return s / a; - } - throw "invalid input for getEnergy()"; - } - var c = Math.round((t / n) * this.freqDomain.length); - return this.freqDomain[c]; - }, - }, - { - key: "getFreq", - value: function (t, e) { - return this.getEnergy(t, e); - }, - }, - { - key: "getCentroid", - value: function () { - for ( - var t = p.audiocontext.sampleRate / 2, e = 0, n = 0, i = 0; - i < this.freqDomain.length; - i++ - ) - (e += i * this.freqDomain[i]), (n += this.freqDomain[i]); - var r = 0; - return 0 !== n && (r = e / n), r * (t / this.freqDomain.length); - }, - }, - { - key: "smooth", - value: function (t) { - return void 0 !== t && (this.smoothing = t), this.smoothing; - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - this.analyser && - (this.analyser.disconnect(), delete this.analyser); - }, - }, - { - key: "linAverages", - value: function (t) { - for ( - var e = t || 16, - n = this.freqDomain, - i = n.length, - r = Math.floor(i / e), - o = new Array(e), - s = 0, - a = 0; - a < i; - a++ - ) - (o[s] = void 0 !== o[s] ? (o[s] + n[a]) / 2 : n[a]), - a % r == r - 1 && s++; - return o; - }, - }, - { - key: "logAverages", - value: function (t) { - for ( - var e = p.audiocontext.sampleRate / 2, - n = this.freqDomain, - i = n.length, - r = new Array(t.length), - o = 0, - s = 0; - s < i; - s++ - ) { - Math.round((s * e) / this.freqDomain.length) > t[o].hi && o++, - (r[o] = void 0 !== r[o] ? (r[o] + n[s]) / 2 : n[s]); - } - return r; - }, - }, - { - key: "getOctaveBands", - value: function (t, e) { - var n = t || 3, - i = e || 15.625, - r = [], - o = { - lo: i / Math.pow(2, 1 / (2 * n)), - ctr: i, - hi: i * Math.pow(2, 1 / (2 * n)), - }; - r.push(o); - for (var s = p.audiocontext.sampleRate / 2; o.hi < s; ) { - var a = {}; - (a.lo = o.hi), - (a.ctr = o.ctr * Math.pow(2, 1 / n)), - (a.hi = a.ctr * Math.pow(2, 1 / (2 * n))), - r.push(a), - (o = a); - } - return r; - }, - }, - ]), - n - ); - })(), - M = n(4), - F = n.n(M), - D = n(1), - I = n.n(D), - U = n(8), - G = n.n(U); - function L(t) { - return (L = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function z(t, e) { - return !e || ("object" !== L(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function W(t) { - return (W = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function Z(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && X(t, e); - } - function X(t, e) { - return (X = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - function Y(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function H(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function $(t, e, n, i, r) { - var o = t.oscillator; - for (var s in t.mathOps) - t.mathOps[s] instanceof r && - (o.disconnect(), - t.mathOps[s].dispose(), - (n = s) < t.mathOps.length - 2 && (i = t.mathOps[s + 1])); - return ( - n === t.mathOps.length - 1 && t.mathOps.push(i), - 0 < s && (o = t.mathOps[s - 1]), - o.disconnect(), - o.connect(e), - e.connect(i), - (t.mathOps[n] = e), - t - ); - } - var Q = (function () { - function r(t, e) { - if ((Y(this, r), "string" == typeof t)) { - var n = e; - (e = t), (t = n); - } - if ("number" == typeof e) { - var i = e; - (e = t), (t = i); - } - (this.started = !1), - (this.phaseAmount = void 0), - (this.oscillator = p.audiocontext.createOscillator()), - (this.f = t || 440), - (this.oscillator.type = e || "sine"), - this.oscillator.frequency.setValueAtTime( - this.f, - p.audiocontext.currentTime, - ), - (this.output = p.audiocontext.createGain()), - (this._freqMods = []), - (this.output.gain.value = 0.5), - this.output.gain.setValueAtTime(0.5, p.audiocontext.currentTime), - this.oscillator.connect(this.output), - (this.panPosition = 0), - (this.connection = p.input), - (this.panner = new k(this.output, this.connection, 1)), - (this.mathOps = [this.output]), - p.soundArray.push(this), - (this.fade = this.amp); - } - return ( - (function (t, e, n) { - e && H(t.prototype, e), n && H(t, n); - })(r, [ - { - key: "start", - value: function (t, e) { - if (this.started) { - var n = p.audiocontext.currentTime; - this.stop(n); - } - if (!this.started) { - var i = e || this.f, - r = this.oscillator.type; - for (var o in (this.oscillator && - (this.oscillator.disconnect(), delete this.oscillator), - (this.oscillator = p.audiocontext.createOscillator()), - (this.oscillator.frequency.value = Math.abs(i)), - (this.oscillator.type = r), - this.oscillator.connect(this.output), - (t = t || 0), - this.oscillator.start(t + p.audiocontext.currentTime), - (this.freqNode = this.oscillator.frequency), - this._freqMods)) - void 0 !== this._freqMods[o].connect && - this._freqMods[o].connect(this.oscillator.frequency); - this.started = !0; - } - }, - }, - { - key: "stop", - value: function (t) { - if (this.started) { - var e = t || 0, - n = p.audiocontext.currentTime; - this.oscillator.stop(e + n), (this.started = !1); - } - }, - }, - { - key: "amp", - value: function (t, e, n) { - var i = 1 < arguments.length && void 0 !== e ? e : 0, - r = 2 < arguments.length && void 0 !== n ? n : 0; - if ("number" == typeof t) { - var o = p.audiocontext.currentTime; - this.output.gain.linearRampToValueAtTime(t, o + r + i); - } else { - if (!t) return this.output.gain; - t.connect(this.output.gain); - } - }, - }, - { - key: "getAmp", - value: function () { - return this.output.gain.value; - }, - }, - { - key: "freq", - value: function (t, e, n) { - var i = 1 < arguments.length && void 0 !== e ? e : 0, - r = 2 < arguments.length && void 0 !== n ? n : 0; - 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 = p.audiocontext.currentTime; - 0 === i - ? this.oscillator.frequency.setValueAtTime(t, r + o) - : 0 < t - ? this.oscillator.frequency.exponentialRampToValueAtTime( - t, - r + i + o, - ) - : this.oscillator.frequency.linearRampToValueAtTime( - t, - r + i + o, - ), - this.phaseAmount && this.phase(this.phaseAmount); - } - }, - }, - { - key: "getFreq", - value: function () { - return this.oscillator.frequency.value; - }, - }, - { - key: "setType", - value: function (t) { - this.oscillator.type = t; - }, - }, - { - key: "getType", - value: function () { - return this.oscillator.type; - }, - }, - { - key: "connect", - value: 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(p.input); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(), - this.panner && - (this.panner.disconnect(), - this.output && this.output.connect(this.panner)), - (this.oscMods = []); - }, - }, - { - key: "pan", - value: function (t, e) { - (this.panPosition = t), this.panner.pan(t, e); - }, - }, - { - key: "getPan", - value: function () { - return this.panPosition; - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - if ((p.soundArray.splice(t, 1), this.oscillator)) { - var e = p.audiocontext.currentTime; - this.stop(e), - this.disconnect(), - (this.panner = null), - (this.oscillator = null); - } - this.osc2 && this.osc2.dispose(); - }, - }, - { - key: "phase", - value: function (t) { - var e = p5.prototype.map(t, 0, 1, 0, 1 / this.f), - n = p.audiocontext.currentTime; - (this.phaseAmount = t), - this.dNode || - ((this.dNode = p.audiocontext.createDelay()), - this.oscillator.disconnect(), - this.oscillator.connect(this.dNode), - this.dNode.connect(this.output)), - this.dNode.delayTime.setValueAtTime(e, n); - }, - }, - { - key: "add", - value: function (t) { - var e = new F.a(t); - return $(this, e, this.mathOps.length - 1, this.output, F.a); - }, - }, - { - key: "mult", - value: function (t) { - var e = new I.a(t); - return $(this, e, this.mathOps.length - 1, this.output, I.a); - }, - }, - { - key: "scale", - value: function (t, e, n, i) { - var r, o; - o = - 4 === arguments.length - ? ((r = p5.prototype.map(n, t, e, 0, 1) - 0.5), - p5.prototype.map(i, t, e, 0, 1) - 0.5) - : ((r = t), e); - var s = new G.a(r, o); - return $(this, s, this.mathOps.length - 1, this.output, G.a); - }, - }, - ]), - r - ); - })(), - J = (function () { - function e(t) { - return Y(this, e), z(this, W(e).call(this, t, "sine")); - } - return Z(e, Q), e; - })(), - K = (function () { - function e(t) { - return Y(this, e), z(this, W(e).call(this, t, "triangle")); - } - return Z(e, Q), e; - })(), - tt = (function () { - function e(t) { - return Y(this, e), z(this, W(e).call(this, t, "sawtooth")); - } - return Z(e, Q), e; - })(), - et = (function () { - function e(t) { - return Y(this, e), z(this, W(e).call(this, t, "square")); - } - return Z(e, Q), e; - })(), - nt = Q, - it = n(7), - rt = n.n(it); - (p5.Envelope = function (t, e, n, i, r, o) { - (this.aTime = t || 0.1), - (this.aLevel = e || 1), - (this.dTime = n || 0.5), - (this.dLevel = i || 0), - (this.rTime = r || 0), - (this.rLevel = o || 0), - (this._rampHighPercentage = 0.98), - (this._rampLowPercentage = 0.02), - (this.output = p.audiocontext.createGain()), - (this.control = new rt.a()), - this._init(), - this.control.connect(this.output), - (this.connection = null), - (this.mathOps = [this.control]), - (this.isExponential = !1), - (this.sourceToClear = null), - (this.wasTriggered = !1), - p.soundArray.push(this); - }), - (p5.Envelope.prototype._init = function () { - var t = p.audiocontext.currentTime; - this.control.setTargetAtTime(1e-5, t, 0.001), - this._setRampAD(this.aTime, this.dTime); - }), - (p5.Envelope.prototype.set = function (t, e, n, i, r, o) { - (this.aTime = t), - (this.aLevel = e), - (this.dTime = n || 0), - (this.dLevel = i || 0), - (this.rTime = r || 0), - (this.rLevel = o || 0), - this._setRampAD(t, n); - }), - (p5.Envelope.prototype.setADSR = function (t, e, n, i) { - (this.aTime = t), - (this.dTime = e || 0), - (this.sPercent = n || 0), - (this.dLevel = - void 0 !== n ? n * (this.aLevel - this.rLevel) + this.rLevel : 0), - (this.rTime = i || 0), - this._setRampAD(t, e); - }), - (p5.Envelope.prototype.setRange = function (t, e) { - (this.aLevel = t || 1), (this.rLevel = e || 0); - }), - (p5.Envelope.prototype._setRampAD = function (t, e) { - (this._rampAttackTime = this.checkExpInput(t)), - (this._rampDecayTime = this.checkExpInput(e)); - var n = 1; - (n = Math.log(1 / this.checkExpInput(1 - this._rampHighPercentage))), - (this._rampAttackTC = t / this.checkExpInput(n)), - (n = Math.log(1 / this._rampLowPercentage)), - (this._rampDecayTC = e / this.checkExpInput(n)); - }), - (p5.Envelope.prototype.setRampPercentages = function (t, e) { - (this._rampHighPercentage = this.checkExpInput(t)), - (this._rampLowPercentage = this.checkExpInput(e)); - var n = 1; - (n = Math.log(1 / this.checkExpInput(1 - this._rampHighPercentage))), - (this._rampAttackTC = this._rampAttackTime / this.checkExpInput(n)), - (n = Math.log(1 / this._rampLowPercentage)), - (this._rampDecayTC = this._rampDecayTime / this.checkExpInput(n)); - }), - (p5.Envelope.prototype.setInput = function () { - for (var t = 0; t < arguments.length; t++) this.connect(arguments[t]); - }), - (p5.Envelope.prototype.setExp = function (t) { - this.isExponential = t; - }), - (p5.Envelope.prototype.checkExpInput = function (t) { - return t <= 0 && (t = 1e-8), t; - }), - (p5.Envelope.prototype.play = function (t, e, n) { - var i = e || 0; - t && this.connection !== t && this.connect(t), - this.triggerAttack(t, i), - this.triggerRelease(t, i + this.aTime + this.dTime + ~~n); - }), - (p5.Envelope.prototype.triggerAttack = function (t, e) { - var n = p.audiocontext.currentTime + (e || 0); - (this.lastAttack = n), - (this.wasTriggered = !0), - t && this.connection !== t && this.connect(t); - var i = this.control.getValueAtTime(n); - !0 === this.isExponential - ? this.control.exponentialRampToValueAtTime(this.checkExpInput(i), n) - : this.control.linearRampToValueAtTime(i, n), - (n += this.aTime), - !0 === this.isExponential - ? (this.control.exponentialRampToValueAtTime( - this.checkExpInput(this.aLevel), - n, - ), - (i = this.checkExpInput(this.control.getValueAtTime(n))), - this.control.cancelScheduledValues(n), - this.control.exponentialRampToValueAtTime(i, n)) - : (this.control.linearRampToValueAtTime(this.aLevel, n), - (i = this.control.getValueAtTime(n)), - this.control.cancelScheduledValues(n), - this.control.linearRampToValueAtTime(i, n)), - (n += this.dTime), - !0 === this.isExponential - ? (this.control.exponentialRampToValueAtTime( - this.checkExpInput(this.dLevel), - n, - ), - (i = this.checkExpInput(this.control.getValueAtTime(n))), - this.control.cancelScheduledValues(n), - this.control.exponentialRampToValueAtTime(i, n)) - : (this.control.linearRampToValueAtTime(this.dLevel, n), - (i = this.control.getValueAtTime(n)), - this.control.cancelScheduledValues(n), - this.control.linearRampToValueAtTime(i, n)); - }), - (p5.Envelope.prototype.triggerRelease = function (t, e) { - if (this.wasTriggered) { - var n = p.audiocontext.currentTime + (e || 0); - t && this.connection !== t && this.connect(t); - var i = this.control.getValueAtTime(n); - !0 === this.isExponential - ? this.control.exponentialRampToValueAtTime( - this.checkExpInput(i), - n, - ) - : this.control.linearRampToValueAtTime(i, n), - (n += this.rTime), - !0 === this.isExponential - ? (this.control.exponentialRampToValueAtTime( - this.checkExpInput(this.rLevel), - n, - ), - (i = this.checkExpInput(this.control.getValueAtTime(n))), - this.control.cancelScheduledValues(n), - this.control.exponentialRampToValueAtTime(i, n)) - : (this.control.linearRampToValueAtTime(this.rLevel, n), - (i = this.control.getValueAtTime(n)), - this.control.cancelScheduledValues(n), - this.control.linearRampToValueAtTime(i, n)), - (this.wasTriggered = !1); - } - }), - (p5.Envelope.prototype.ramp = function (t, e, n, i) { - var r = p.audiocontext.currentTime + (e || 0), - o = this.checkExpInput(n), - s = void 0 !== i ? this.checkExpInput(i) : void 0; - t && this.connection !== t && this.connect(t); - var a = this.checkExpInput(this.control.getValueAtTime(r)); - a < o - ? (this.control.setTargetAtTime(o, r, this._rampAttackTC), - (r += this._rampAttackTime)) - : o < a && - (this.control.setTargetAtTime(o, r, this._rampDecayTC), - (r += this._rampDecayTime)), - void 0 !== s && - (o < s - ? this.control.setTargetAtTime(s, r, this._rampAttackTC) - : s < o && this.control.setTargetAtTime(s, r, this._rampDecayTC)); - }), - (p5.Envelope.prototype.connect = function (t) { - ((this.connection = t) instanceof p5.Oscillator || - t instanceof p5.SoundFile || - t instanceof p5.AudioIn || - t instanceof p5.Reverb || - t instanceof p5.Noise || - t instanceof p5.Filter || - t instanceof p5.Delay) && - (t = t.output.gain), - t instanceof AudioParam && - t.setValueAtTime(0, p.audiocontext.currentTime), - this.output.connect(t); - }), - (p5.Envelope.prototype.disconnect = function () { - this.output && this.output.disconnect(); - }), - (p5.Envelope.prototype.add = function (t) { - var e = new F.a(t), - n = this.mathOps.length, - i = this.output; - return p5.prototype._mathChain(this, e, n, i, F.a); - }), - (p5.Envelope.prototype.mult = function (t) { - var e = new I.a(t), - n = this.mathOps.length, - i = this.output; - return p5.prototype._mathChain(this, e, n, i, I.a); - }), - (p5.Envelope.prototype.scale = function (t, e, n, i) { - var r = new G.a(t, e, n, i), - o = this.mathOps.length, - s = this.output; - return p5.prototype._mathChain(this, r, o, s, G.a); - }), - (p5.Envelope.prototype.dispose = function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - this.disconnect(), - this.control && (this.control.dispose(), (this.control = null)); - for (var e = 1; e < this.mathOps.length; e++) this.mathOps[e].dispose(); - }), - (p5.Env = function (t, e, n, i, r, o) { - p5.Envelope.call(this, t, e, n, i, r, o); - }), - (p5.Env.prototype = Object.create(p5.Envelope.prototype)); - var ot = p5.Envelope; - function st(t) { - return (st = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function at(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function ut(t, e) { - return !e || ("object" !== st(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function ct(t) { - return (ct = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function lt(t, e) { - return (lt = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var ht = (function () { - for ( - var t = 2 * p.audiocontext.sampleRate, - e = p.audiocontext.createBuffer(1, t, p.audiocontext.sampleRate), - n = e.getChannelData(0), - i = 0; - i < t; - i++ - ) - n[i] = 2 * Math.random() - 1; - return (e.type = "white"), e; - })(), - pt = (function () { - var t, - e, - n, - i, - r, - o, - s, - a = 2 * p.audiocontext.sampleRate, - u = p.audiocontext.createBuffer(1, a, p.audiocontext.sampleRate), - c = u.getChannelData(0); - t = e = n = i = r = o = s = 0; - for (var l = 0; l < a; l++) { - var h = 2 * Math.random() - 1; - (t = 0.99886 * t + 0.0555179 * h), - (e = 0.99332 * e + 0.0750759 * h), - (n = 0.969 * n + 0.153852 * h), - (i = 0.8665 * i + 0.3104856 * h), - (r = 0.55 * r + 0.5329522 * h), - (o = -0.7616 * o - 0.016898 * h), - (c[l] = t + e + n + i + r + o + s + 0.5362 * h), - (c[l] *= 0.11), - (s = 0.115926 * h); - } - return (u.type = "pink"), u; - })(), - ft = (function () { - for ( - var t = 2 * p.audiocontext.sampleRate, - e = p.audiocontext.createBuffer(1, t, p.audiocontext.sampleRate), - n = e.getChannelData(0), - i = 0, - r = 0; - r < t; - r++ - ) { - var o = 2 * Math.random() - 1; - (n[r] = (i + 0.02 * o) / 1.02), (i = n[r]), (n[r] *= 3.5); - } - return (e.type = "brown"), e; - })(), - dt = (function () { - function i(t) { - var e, n; - return ( - (function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, i), - delete (e = ut(this, ct(i).call(this))).f, - delete e.freq, - delete e.oscillator, - (n = "brown" === t ? ft : "pink" === t ? pt : ht), - (e.buffer = n), - e - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && lt(t, e); - })(i, nt), - (function (t, e, n) { - e && at(t.prototype, e), n && at(t, n); - })(i, [ - { - key: "setType", - value: function (t) { - switch (t) { - case "white": - this.buffer = ht; - break; - case "pink": - this.buffer = pt; - break; - case "brown": - this.buffer = ft; - break; - default: - this.buffer = ht; - } - if (this.started) { - var e = p.audiocontext.currentTime; - this.stop(e), this.start(e + 0.01); - } - }, - }, - { - key: "getType", - value: function () { - return this.buffer.type; - }, - }, - { - key: "start", - value: function () { - this.started && this.stop(), - (this.noise = p.audiocontext.createBufferSource()), - (this.noise.buffer = this.buffer), - (this.noise.loop = !0), - this.noise.connect(this.output); - var t = p.audiocontext.currentTime; - this.noise.start(t), (this.started = !0); - }, - }, - { - key: "stop", - value: function () { - var t = p.audiocontext.currentTime; - this.noise && (this.noise.stop(t), (this.started = !1)); - }, - }, - { - key: "dispose", - value: function () { - var t = p.audiocontext.currentTime, - e = p.soundArray.indexOf(this); - p.soundArray.splice(e, 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); - }, - }, - ]), - i - ); - })(), - yt = n(2), - mt = n.n(yt); - function vt(t) { - return (vt = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function _t(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function gt(t, e) { - return !e || ("object" !== vt(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function bt(t) { - return (bt = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function Tt(t, e) { - return (Tt = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - function wt() { - for ( - var t = p.audiocontext, - e = t.createBuffer(1, 2048, t.sampleRate), - n = e.getChannelData(0), - i = 0; - i < 2048; - i++ - ) - n[i] = 1; - var r = t.createBufferSource(); - return (r.buffer = e), (r.loop = !0), r; - } - var xt = (function () { - function r(t, e) { - var n; - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, r), - ((n = gt(this, bt(r).call(this, t, "sawtooth"))).w = e || 0), - (n.osc2 = new tt(t)), - (n.dNode = p.audiocontext.createDelay()), - (n.dcOffset = wt()), - (n.dcGain = p.audiocontext.createGain()), - n.dcOffset.connect(n.dcGain), - n.dcGain.connect(n.output), - (n.f = t || 440); - var i = n.w / n.oscillator.frequency.value; - return ( - (n.dNode.delayTime.value = i), - (n.dcGain.gain.value = 1.7 * (0.5 - n.w)), - n.osc2.disconnect(), - n.osc2.panner.disconnect(), - n.osc2.amp(-1), - n.osc2.output.connect(n.dNode), - n.dNode.connect(n.output), - (n.output.gain.value = 1), - n.output.connect(n.panner), - n - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && Tt(t, e); - })(r, nt), - (function (t, e, n) { - e && _t(t.prototype, e), n && _t(t, n); - })(r, [ - { - key: "width", - value: function (t) { - if ("number" == typeof t) { - if (t <= 1 && 0 <= t) { - this.w = t; - var e = this.w / this.oscillator.frequency.value; - this.dNode.delayTime.value = e; - } - this.dcGain.gain.value = 1.7 * (0.5 - this.w); - } else { - t.connect(this.dNode.delayTime); - var n = new mt.a(-0.5); - t.connect(n); - var i = new I.a(-1), - r = new I.a(1.7); - (n = n.connect(i).connect(r)).connect(this.dcGain.gain); - } - }, - }, - { - key: "start", - value: function (t, e) { - var n = p.audiocontext.currentTime, - i = e || 0; - if (!this.started) { - var r = t || this.f, - o = this.oscillator.type; - (this.oscillator = p.audiocontext.createOscillator()), - this.oscillator.frequency.setValueAtTime(r, n), - (this.oscillator.type = o), - this.oscillator.connect(this.output), - this.oscillator.start(i + n), - (this.osc2.oscillator = p.audiocontext.createOscillator()), - this.osc2.oscillator.frequency.setValueAtTime(r, i + n), - (this.osc2.oscillator.type = o), - this.osc2.oscillator.connect(this.osc2.output), - this.osc2.start(i + n), - (this.freqNode = [ - this.oscillator.frequency, - this.osc2.oscillator.frequency, - ]), - (this.dcOffset = wt()), - this.dcOffset.connect(this.dcGain), - this.dcOffset.start(i + n), - 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); - } - }, - }, - { - key: "stop", - value: function (t) { - if (this.started) { - var e = t || 0, - n = p.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); - } - }, - }, - { - key: "freq", - value: function (t, e, n) { - var i = 1 < arguments.length && void 0 !== e ? e : 0, - r = 2 < arguments.length && void 0 !== n ? n : 0; - if ("number" == typeof t) { - this.f = t; - var o = p.audiocontext.currentTime, - s = this.oscillator.frequency.value; - this.oscillator.frequency.cancelScheduledValues(o), - this.oscillator.frequency.setValueAtTime(s, o + r), - this.oscillator.frequency.exponentialRampToValueAtTime( - t, - r + i + o, - ), - this.osc2.oscillator.frequency.cancelScheduledValues(o), - this.osc2.oscillator.frequency.setValueAtTime(s, o + r), - this.osc2.oscillator.frequency.exponentialRampToValueAtTime( - t, - r + i + 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)); - }, - }, - ]), - r - ); - })(); - function St(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - p.inputSources = []; - var kt = (function () { - function e(t) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - (this.input = p.audiocontext.createGain()), - (this.output = p.audiocontext.createGain()), - (this.stream = null), - (this.mediaStream = null), - (this.currentSource = null), - (this.enabled = !1), - (this.amplitude = new B()), - this.output.connect(this.amplitude.input), - (window.MediaStreamTrack && - window.navigator.mediaDevices && - window.navigator.mediaDevices.getUserMedia) || - (t - ? t() - : window.alert( - "This browser does not support MediaStreamTrack and mediaDevices", - )), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && St(t.prototype, e), n && St(t, n); - })(e, [ - { - key: "start", - value: function (e, n) { - var i = this; - this.stream && this.stop(); - var t = p.inputSources[i.currentSource], - r = { - audio: { - sampleRate: p.audiocontext.sampleRate, - echoCancellation: !1, - }, - }; - p.inputSources[this.currentSource] && - (r.audio.deviceId = t.deviceId), - window.navigator.mediaDevices - .getUserMedia(r) - .then(function (t) { - (i.stream = t), - (i.enabled = !0), - (i.mediaStream = - p.audiocontext.createMediaStreamSource(t)), - i.mediaStream.connect(i.output), - i.amplitude.setInput(i.output), - e && e(); - }) - .catch(function (t) { - n && n(t); - }); - }, - }, - { - key: "stop", - value: function () { - this.stream && - (this.stream.getTracks().forEach(function (t) { - t.stop(); - }), - this.mediaStream.disconnect(), - delete this.mediaStream, - delete this.stream); - }, - }, - { - key: "connect", - value: 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(p.input); - }, - }, - { - key: "disconnect", - value: function () { - this.output && - (this.output.disconnect(), - this.output.connect(this.amplitude.input)); - }, - }, - { - key: "getLevel", - value: function (t) { - return ( - t && (this.amplitude.smoothing = t), this.amplitude.getLevel() - ); - }, - }, - { - key: "amp", - value: function (t, e) { - if (e) { - var n = e || 0, - i = this.output.gain.value; - this.output.gain.cancelScheduledValues( - p.audiocontext.currentTime, - ), - this.output.gain.setValueAtTime( - i, - p.audiocontext.currentTime, - ), - this.output.gain.linearRampToValueAtTime( - t, - n + p.audiocontext.currentTime, - ); - } else - this.output.gain.cancelScheduledValues( - p.audiocontext.currentTime, - ), - this.output.gain.setValueAtTime( - t, - p.audiocontext.currentTime, - ); - }, - }, - { - key: "getSources", - value: function (i, r) { - return new Promise(function (e, n) { - window.navigator.mediaDevices - .enumerateDevices() - .then(function (t) { - (p.inputSources = t.filter(function (t) { - return "audioinput" === t.kind; - })), - e(p.inputSources), - i && i(p.inputSources); - }) - .catch(function (t) { - n(t), r && r(t); - }); - }); - }, - }, - { - key: "setSource", - value: function (t) { - 0 < p.inputSources.length && - t < p.inputSources.length && - (this.currentSource = t), - this.stream && this.stream.active && this.start(); - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - this.stop(), - this.output && this.output.disconnect(), - this.amplitude && this.amplitude.disconnect(), - delete this.amplitude, - delete this.output; - }, - }, - ]), - e - ); - })(), - Pt = n(23), - At = n.n(Pt); - function Ot(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var Ct = (function () { - function t() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, t), - (this.ac = p.audiocontext), - (this.input = this.ac.createGain()), - (this.output = this.ac.createGain()), - (this._drywet = new At.a(1)), - (this.wet = this.ac.createGain()), - this.input.connect(this._drywet.a), - this.wet.connect(this._drywet.b), - this._drywet.connect(this.output), - this.connect(), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && Ot(t.prototype, e), n && Ot(t, n); - })(t, [ - { - key: "amp", - value: function (t, e, n) { - var i = 1 < arguments.length && void 0 !== e ? e : 0, - r = 2 < arguments.length && void 0 !== n ? n : 0, - o = p.audiocontext.currentTime, - s = o + r, - a = s + i + 0.001, - u = this.output.gain.value; - this.output.gain.cancelScheduledValues(o), - this.output.gain.linearRampToValueAtTime(u, s + 0.001), - this.output.gain.linearRampToValueAtTime(t, a); - }, - }, - { - key: "chain", - value: function (t) { - if (0 < arguments.length) { - this.connect(t); - for (var e = 1; e < arguments.length; e += 1) - arguments[e - 1].connect(arguments[e]); - } - return this; - }, - }, - { - key: "drywet", - value: function (t) { - return ( - void 0 !== t && (this._drywet.fade.value = t), - this._drywet.fade.value - ); - }, - }, - { - key: "connect", - value: function (t) { - var e = t || p5.soundOut.input; - this.output.connect(e.input ? e.input : e); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(); - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - this.input && (this.input.disconnect(), delete this.input), - this.output && (this.output.disconnect(), delete this.output), - this._drywet && - (this._drywet.disconnect(), delete this._drywet), - this.wet && (this.wet.disconnect(), delete this.wet), - (this.ac = void 0); - }, - }, - ]), - t - ); - })(); - function Rt(t) { - return (Rt = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function qt(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function Et(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function Nt(t, e) { - return !e || ("object" !== Rt(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function Bt(t, e, n) { - return (Bt = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = Vt(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function Vt(t) { - return (Vt = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function jt(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && Mt(t, e); - } - function Mt(t, e) { - return (Mt = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var Ft = (function () { - function n(t) { - var e; - return ( - qt(this, n), - ((e = Nt(this, Vt(n).call(this))).biquad = - e.ac.createBiquadFilter()), - e.input.connect(e.biquad), - e.biquad.connect(e.wet), - t && e.setType(t), - (e._on = !0), - (e._untoggledType = e.biquad.type), - e - ); - } - return ( - jt(n, Ct), - (function (t, e, n) { - e && Et(t.prototype, e), n && Et(t, n); - })(n, [ - { - key: "process", - value: function (t, e, n, i) { - t.connect(this.input), this.set(e, n, i); - }, - }, - { - key: "set", - value: function (t, e, n) { - t && this.freq(t, n), e && this.res(e, n); - }, - }, - { - key: "freq", - value: function (t, e) { - var n = e || 0; - return ( - t <= 0 && (t = 1), - "number" == typeof t - ? (this.biquad.frequency.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.biquad.frequency.exponentialRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.biquad.frequency), - this.biquad.frequency.value - ); - }, - }, - { - key: "res", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.biquad.Q.value = t), - this.biquad.Q.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.biquad.Q.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.biquad.Q), - this.biquad.Q.value - ); - }, - }, - { - key: "gain", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.biquad.gain.value = t), - this.biquad.gain.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.biquad.gain.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.biquad.gain), - this.biquad.gain.value - ); - }, - }, - { - key: "toggle", - value: function () { - return ( - (this._on = !this._on), - !0 === this._on - ? (this.biquad.type = this._untoggledType) - : !1 === this._on && (this.biquad.type = "allpass"), - this._on - ); - }, - }, - { - key: "setType", - value: function (t) { - (this.biquad.type = t), - (this._untoggledType = this.biquad.type); - }, - }, - { - key: "dispose", - value: function () { - Bt(Vt(n.prototype), "dispose", this).call(this), - this.biquad && (this.biquad.disconnect(), delete this.biquad); - }, - }, - ]), - n - ); - })(), - Dt = (function () { - function t() { - return qt(this, t), Nt(this, Vt(t).call(this, "lowpass")); - } - return jt(t, Ft), t; - })(), - It = (function () { - function t() { - return qt(this, t), Nt(this, Vt(t).call(this, "highpass")); - } - return jt(t, Ft), t; - })(), - Ut = (function () { - function t() { - return qt(this, t), Nt(this, Vt(t).call(this, "bandpass")); - } - return jt(t, Ft), t; - })(), - Gt = Ft; - function Lt(t) { - return (Lt = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function zt(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function Wt(t, e) { - return !e || ("object" !== Lt(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function Zt(t) { - return (Zt = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function Xt(t, e) { - return (Xt = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var Yt = (function () { - function i(t, e) { - var n; - return ( - (function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, i), - (n = Wt(this, Zt(i).call(this, "peaking"))).disconnect(), - n.set(t, e), - (n.biquad.gain.value = 0), - delete n.input, - delete n.output, - delete n._drywet, - delete n.wet, - n - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && Xt(t, e); - })(i, Gt), - (function (t, e, n) { - e && zt(t.prototype, e), n && zt(t, n); - })(i, [ - { key: "amp", value: function () {} }, - { key: "drywet", value: function () {} }, - { - key: "connect", - value: function (t) { - var e = t || p5.soundOut.input; - this.biquad - ? this.biquad.connect(e.input ? e.input : e) - : this.output.connect(e.input ? e.input : e); - }, - }, - { - key: "disconnect", - value: function () { - this.biquad && this.biquad.disconnect(); - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), this.disconnect(), delete this.biquad; - }, - }, - ]), - i - ); - })(); - function Ht(t) { - return (Ht = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function $t(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function Qt(t, e) { - return !e || ("object" !== Ht(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function Jt(t, e, n) { - return (Jt = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = Kt(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function Kt(t) { - return (Kt = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function te(t, e) { - return (te = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var ee = (function () { - function s(t) { - var e, n, i, r; - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, s), - (e = Qt(this, Kt(s).call(this))), - (n = 3 === (t = 3 === t || 8 === t ? t : 3) ? Math.pow(2, 3) : 2), - (e.bands = []); - for (var o = 0; o < t; o++) - (r = - o === t - 1 - ? ((i = 21e3), 0.01) - : 0 === o - ? ((i = 100), 0.1) - : ((i = - 1 === o - ? 3 === t - ? 360 * n - : 360 - : e.bands[o - 1].freq() * n), - 1)), - (e.bands[o] = e._newBand(i, r)), - 0 < o - ? e.bands[o - 1].connect(e.bands[o].biquad) - : e.input.connect(e.bands[o].biquad); - return e.bands[t - 1].connect(e.output), e; - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && te(t, e); - })(s, Ct), - (function (t, e, n) { - e && $t(t.prototype, e), n && $t(t, n); - })(s, [ - { - key: "process", - value: function (t) { - t.connect(this.input); - }, - }, - { - key: "set", - value: function () { - if (arguments.length === 2 * this.bands.length) - for (var t = 0; t < arguments.length; t += 2) - this.bands[t / 2].freq(arguments[t]), - this.bands[t / 2].gain(arguments[t + 1]); - }, - }, - { - key: "_newBand", - value: function (t, e) { - return new Yt(t, e); - }, - }, - { - key: "dispose", - value: function () { - if ( - (Jt(Kt(s.prototype), "dispose", this).call(this), this.bands) - ) { - for (; 0 < this.bands.length; ) this.bands.pop().dispose(); - delete this.bands; - } - }, - }, - ]), - s - ); - })(); - function ne(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var ie = (function () { - function e(t) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - (this.ac = p.audiocontext), - (this.listener = this.ac.listener); - } - return ( - (function (t, e, n) { - e && ne(t.prototype, e), n && ne(t, n); - })(e, [ - { - key: "process", - value: function (t) { - t.connect(this.input); - }, - }, - { - key: "position", - value: function (t, e, n, i) { - return ( - this.positionX(t, i), - this.positionY(e, i), - this.positionZ(n, i), - [ - this.listener.positionX.value, - this.listener.positionY.value, - this.listener.positionZ.value, - ] - ); - }, - }, - { - key: "positionX", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.positionX.value = t), - this.listener.positionX.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.positionX.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.positionX), - this.listener.positionX.value - ); - }, - }, - { - key: "positionY", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.positionY.value = t), - this.listener.positionY.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.positionY.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.positionY), - this.listener.positionY.value - ); - }, - }, - { - key: "positionZ", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.positionZ.value = t), - this.listener.positionZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.positionZ.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.positionZ), - this.listener.positionZ.value - ); - }, - }, - { - key: "orient", - value: function (t, e, n, i, r, o, s) { - return ( - 3 === arguments.length || 4 === arguments.length - ? ((s = i), this.orientForward(t, e, n, s)) - : (6 !== arguments.length && 7 !== arguments) || - (this.orientForward(t, e, n), this.orientUp(i, r, o, 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, - ] - ); - }, - }, - { - key: "orientForward", - value: function (t, e, n, i) { - return ( - this.forwardX(t, i), - this.forwardY(e, i), - this.forwardZ(n, i), - [ - this.listener.forwardX, - this.listener.forwardY, - this.listener.forwardZ, - ] - ); - }, - }, - { - key: "orientUp", - value: function (t, e, n, i) { - return ( - this.upX(t, i), - this.upY(e, i), - this.upZ(n, i), - [this.listener.upX, this.listener.upY, this.listener.upZ] - ); - }, - }, - { - key: "forwardX", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.forwardX.value = t), - this.listener.forwardX.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.forwardX.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.forwardX), - this.listener.forwardX.value - ); - }, - }, - { - key: "forwardY", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.forwardY.value = t), - this.listener.forwardY.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.forwardY.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.forwardY), - this.listener.forwardY.value - ); - }, - }, - { - key: "forwardZ", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.forwardZ.value = t), - this.listener.forwardZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.forwardZ.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.forwardZ), - this.listener.forwardZ.value - ); - }, - }, - { - key: "upX", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.upX.value = t), - this.listener.upX.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.upX.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.upX), - this.listener.upX.value - ); - }, - }, - { - key: "upY", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.upY.value = t), - this.listener.upY.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.upY.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.upY), - this.listener.upY.value - ); - }, - }, - { - key: "upZ", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.listener.upZ.value = t), - this.listener.upZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.listener.upZ.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.listener.upZ), - this.listener.upZ.value - ); - }, - }, - ]), - e - ); - })(); - function re(t) { - return (re = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function oe(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function se(t, e) { - return !e || ("object" !== re(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function ae(t, e, n) { - return (ae = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = ue(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function ue(t) { - return (ue = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function ce(t, e) { - return (ce = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var le = (function () { - function e() { - var t; - return ( - (function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - ((t = se(this, ue(e).call(this))).panner = t.ac.createPanner()), - (t.panner.panningModel = "HRTF"), - (t.panner.distanceModel = "linear"), - t.panner.connect(t.output), - t.input.connect(t.panner), - t - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && ce(t, e); - })(e, Ct), - (function (t, e, n) { - e && oe(t.prototype, e), n && oe(t, n); - })(e, [ - { - key: "process", - value: function (t) { - t.connect(this.input); - }, - }, - { - key: "set", - value: function (t, e, n, i) { - return ( - this.positionX(t, i), - this.positionY(e, i), - this.positionZ(n, i), - [ - this.panner.positionX.value, - this.panner.positionY.value, - this.panner.positionZ.value, - ] - ); - }, - }, - { - key: "positionX", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.panner.positionX.value = t), - this.panner.positionX.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.panner.positionX.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.panner.positionX), - this.panner.positionX.value - ); - }, - }, - { - key: "positionY", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.panner.positionY.value = t), - this.panner.positionY.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.panner.positionY.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.panner.positionY), - this.panner.positionY.value - ); - }, - }, - { - key: "positionZ", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.panner.positionZ.value = t), - this.panner.positionZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.panner.positionZ.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.panner.positionZ), - this.panner.positionZ.value - ); - }, - }, - { - key: "orient", - value: function (t, e, n, i) { - return ( - this.orientX(t, i), - this.orientY(e, i), - this.orientZ(n, i), - [ - this.panner.orientationX.value, - this.panner.orientationY.value, - this.panner.orientationZ.value, - ] - ); - }, - }, - { - key: "orientX", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.panner.orientationX.value = t), - this.panner.orientationX.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.panner.orientationX.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.panner.orientationX), - this.panner.orientationX.value - ); - }, - }, - { - key: "orientY", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.panner.orientationY.value = t), - this.panner.orientationY.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.panner.orientationY.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.panner.orientationY), - this.panner.orientationY.value - ); - }, - }, - { - key: "orientZ", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.panner.orientationZ.value = t), - this.panner.orientationZ.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.panner.orientationZ.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : t && t.connect(this.panner.orientationZ), - this.panner.orientationZ.value - ); - }, - }, - { - key: "setFalloff", - value: function (t, e) { - this.maxDist(t), this.rolloff(e); - }, - }, - { - key: "maxDist", - value: function (t) { - return ( - "number" == typeof t && (this.panner.maxDistance = t), - this.panner.maxDistance - ); - }, - }, - { - key: "rolloff", - value: function (t) { - return ( - "number" == typeof t && (this.panner.rolloffFactor = t), - this.panner.rolloffFactor - ); - }, - }, - { - key: "dispose", - value: function () { - ae(ue(e.prototype), "dispose", this).call(this), - this.panner && (this.panner.disconnect(), delete this.panner); - }, - }, - ]), - e - ); - })(); - function he(t) { - return (he = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function pe(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function fe(t, e) { - return !e || ("object" !== he(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function de(t, e, n) { - return (de = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = ye(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function ye(t) { - return (ye = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function me(t, e) { - return (me = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var ve = (function () { - function e() { - var t; - return ( - (function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - ((t = fe(this, ye(e).call(this)))._split = - t.ac.createChannelSplitter(2)), - (t._merge = t.ac.createChannelMerger(2)), - (t._leftGain = t.ac.createGain()), - (t._rightGain = t.ac.createGain()), - (t.leftDelay = t.ac.createDelay()), - (t.rightDelay = t.ac.createDelay()), - (t._leftFilter = new Gt()), - (t._rightFilter = new Gt()), - t._leftFilter.disconnect(), - t._rightFilter.disconnect(), - t._leftFilter.biquad.frequency.setValueAtTime(1200, t.ac.currentTime), - t._rightFilter.biquad.frequency.setValueAtTime( - 1200, - t.ac.currentTime, - ), - t._leftFilter.biquad.Q.setValueAtTime(0.3, t.ac.currentTime), - t._rightFilter.biquad.Q.setValueAtTime(0.3, t.ac.currentTime), - t.input.connect(t._split), - t.leftDelay.connect(t._leftGain), - t.rightDelay.connect(t._rightGain), - t._leftGain.connect(t._leftFilter.input), - t._rightGain.connect(t._rightFilter.input), - t._merge.connect(t.wet), - t._leftFilter.biquad.gain.setValueAtTime(1, t.ac.currentTime), - t._rightFilter.biquad.gain.setValueAtTime(1, t.ac.currentTime), - t.setType(0), - (t._maxDelay = t.leftDelay.delayTime.maxValue), - t.feedback(0.5), - t - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && me(t, e); - })(e, Ct), - (function (t, e, n) { - e && pe(t.prototype, e), n && pe(t, n); - })(e, [ - { - key: "process", - value: function (t, e, n, i) { - var r = n || 0, - o = e || 0; - if (1 <= r) - throw new Error( - "Feedback value will force a positive feedback loop.", - ); - if (o >= this._maxDelay) - throw new Error( - "Delay Time exceeds maximum delay time of " + - this._maxDelay + - " second.", - ); - t.connect(this.input), - this.leftDelay.delayTime.setValueAtTime(o, this.ac.currentTime), - this.rightDelay.delayTime.setValueAtTime( - o, - this.ac.currentTime, - ), - (this._leftGain.gain.value = r), - (this._rightGain.gain.value = r), - i && (this._leftFilter.freq(i), this._rightFilter.freq(i)); - }, - }, - { - key: "delayTime", - value: 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, - )); - }, - }, - { - key: "feedback", - value: function (t) { - if (t && "number" != typeof t) - t.connect(this._leftGain.gain), t.connect(this._rightGain.gain); - else { - if (1 <= t) - 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; - }, - }, - { - key: "filter", - value: function (t, e) { - this._leftFilter.set(t, e), this._rightFilter.set(t, e); - }, - }, - { - key: "setType", - value: 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); - } - }, - }, - { - key: "dispose", - value: function () { - de(ye(e.prototype), "dispose", this).call(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); - }, - }, - ]), - e - ); - })(); - function _e(t) { - return (_e = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function ge(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - function be(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function Te(t, e, n) { - return e && be(t.prototype, e), n && be(t, n), t; - } - function we(t, e) { - return !e || ("object" !== _e(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function xe(t, e, n) { - return (xe = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = Se(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function Se(t) { - return (Se = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function ke(t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && Pe(t, e); - } - function Pe(t, e) { - return (Pe = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var Ae = (function () { - function e() { - var t; - return ( - ge(this, e), - (t = we(this, Se(e).call(this)))._initConvolverNode(), - (t.input.gain.value = 0.5), - (t._seconds = 3), - (t._decay = 2), - (t._reverse = !1), - t._buildImpulse(), - t - ); - } - return ( - ke(e, Ct), - Te(e, [ - { - key: "_initConvolverNode", - value: function () { - (this.convolverNode = this.ac.createConvolver()), - this.input.connect(this.convolverNode), - this.convolverNode.connect(this.wet); - }, - }, - { - key: "_teardownConvolverNode", - value: function () { - this.convolverNode && - (this.convolverNode.disconnect(), delete this.convolverNode); - }, - }, - { - key: "_setBuffer", - value: function (t) { - this._teardownConvolverNode(), - this._initConvolverNode(), - (this.convolverNode.buffer = t); - }, - }, - { - key: "process", - value: function (t, e, n, i) { - t.connect(this.input); - var r = !1; - e && ((this._seconds = e), (r = !0)), - n && (this._decay = n), - i && (this._reverse = i), - r && this._buildImpulse(); - }, - }, - { - key: "set", - value: function (t, e, n) { - var i = !1; - t && ((this._seconds = t), (i = !0)), - e && (this._decay = e), - n && (this._reverse = n), - i && this._buildImpulse(); - }, - }, - { - key: "_buildImpulse", - value: function () { - var t, - e, - n = this.ac.sampleRate, - i = n * this._seconds, - r = this._decay, - o = this.ac.createBuffer(2, i, n), - s = o.getChannelData(0), - a = o.getChannelData(1); - for (e = 0; e < i; e++) - (t = this._reverse ? i - e : e), - (s[e] = (2 * Math.random() - 1) * Math.pow(1 - t / i, r)), - (a[e] = (2 * Math.random() - 1) * Math.pow(1 - t / i, r)); - this._setBuffer(o); - }, - }, - { - key: "dispose", - value: function () { - xe(Se(e.prototype), "dispose", this).call(this), - this._teardownConvolverNode(); - }, - }, - ]), - e - ); - })(), - Oe = (function () { - function r(t, e, n) { - var i; - return ( - ge(this, r), - (i = we(this, Se(r).call(this)))._initConvolverNode(), - (i.input.gain.value = 0.5), - t - ? ((i.impulses = []), i._loadBuffer(t, e, n)) - : ((i._seconds = 3), - (i._decay = 2), - (i._reverse = !1), - i._buildImpulse()), - (i.impulses = []), - (i.set = null), - i - ); - } - return ( - ke(r, Ae), - Te(r, [ - { - key: "_loadBuffer", - value: function (t, i, n) { - var r = p5.prototype._checkFileFormats(t), - o = this, - s = new Error().stack, - a = Object(c.b)(), - u = new XMLHttpRequest(); - u.open("GET", r, !0), - (u.responseType = "arraybuffer"), - (u.onload = function () { - if (200 === u.status) - a.decodeAudioData( - u.response, - function (t) { - var e = {}, - n = r.split("/"); - (e.name = n[n.length - 1]), - (e.audioBuffer = t), - o.impulses.push(e), - o._setBuffer(e.audioBuffer), - i && i(e); - }, - function () { - var t = new m("decodeAudioData", s, o.url), - e = - "AudioContext error at decodeAudioData for " + - o.url; - n && ((t.msg = e), n(t)); - }, - ); - else { - var t = new m("loadConvolver", s, o.url), - e = - "Unable to load " + - o.url + - ". The request status was: " + - u.status + - " (" + - u.statusText + - ")"; - n && ((t.message = e), n(t)); - } - }), - (u.onerror = function () { - var t = new m("loadConvolver", s, o.url), - e = - "There was no response from the server at " + - o.url + - ". Check the url and internet connectivity."; - n && ((t.message = e), n(t)); - }), - u.send(); - }, - }, - { - key: "process", - value: function (t) { - t.connect(this.input); - }, - }, - { - key: "addImpulse", - value: function (t, e, n) { - -1 < window.location.origin.indexOf("file://") && - "undefined" === window.cordova && - alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ), - this._loadBuffer(t, e, n); - }, - }, - { - key: "resetImpulse", - value: function (t, e, n) { - -1 < window.location.origin.indexOf("file://") && - "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, n); - }, - }, - { - key: "toggleImpulse", - value: function (t) { - if ( - ("number" == typeof t && - t < this.impulses.length && - this._setBuffer(this.impulses[t].audioBuffer), - "string" == typeof t) - ) - for (var e = 0; e < this.impulses.length; e++) - if (this.impulses[e].name === t) { - this._setBuffer(this.impulses[e].audioBuffer); - break; - } - }, - }, - { - key: "dispose", - value: function () { - for (var t in (xe(Se(r.prototype), "dispose", this).call(this), - this.impulses)) - this.impulses[t] && (this.impulses[t] = null); - }, - }, - ]), - r - ); - })(); - var Ce = n(11), - Re = n.n(Ce); - function qe(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var Ee = (function () { - function t() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, t), - (this.clock = new Re.a({ callback: this.ontick.bind(this) })), - (this.syncedParts = []), - (this.bpm = 120), - this._init(), - (this.prevTick = 0), - (this.tatumTime = 0), - (this.tickCallback = function () {}); - } - return ( - (function (t, e, n) { - e && qe(t.prototype, e), n && qe(t, n); - })(t, [ - { - key: "ontick", - value: function (t) { - var e = t - this.prevTick, - i = t - p.audiocontext.currentTime; - if (!(e - this.tatumTime <= -0.02)) { - this.prevTick = t; - var r = this; - this.syncedParts.forEach(function (t) { - t.isPlaying && - (t.incrementStep(i), - t.phrases.forEach(function (t) { - var e = t.sequence, - n = r.metroTicks % e.length; - 0 !== e[n] && - (r.metroTicks < e.length || !t.looping) && - t.callback(i, e[n]); - })); - }), - (this.metroTicks += 1), - this.tickCallback(i); - } - }, - }, - { - key: "setBPM", - value: function (t, e) { - var n = 1 < arguments.length && void 0 !== e ? e : 0, - i = 60 / (t * this.tatums), - r = p.audiocontext.currentTime; - (this.tatumTime = i), - this.clock.frequency.setValueAtTime( - this.clock.frequency.value, - r, - ), - this.clock.frequency.linearRampToValueAtTime(t, r + n), - (this.bpm = t); - }, - }, - { - key: "getBPM", - value: function () { - return (this.clock.getRate() / this.tatums) * 60; - }, - }, - { - key: "_init", - value: function () { - this.metroTicks = 0; - }, - }, - { - key: "resetSync", - value: function (t) { - this.syncedParts = [t]; - }, - }, - { - key: "pushSync", - value: function (t) { - this.syncedParts.push(t); - }, - }, - { - key: "start", - value: function (t) { - var e = t || 0, - n = p.audiocontext.currentTime; - this.clock.start(n + e), this.setBPM(this.bpm); - }, - }, - { - key: "stop", - value: function (t) { - var e = t || 0, - n = p.audiocontext.currentTime; - this.clock.stop(n + e); - }, - }, - { - key: "beatLength", - value: function (t) { - this.tatums = 1 / t / 4; - }, - }, - ]), - t - ); - })(); - function Ne(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function Be(t, e, n) { - return e && Ne(t.prototype, e), n && Ne(t, n), t; - } - function Ve(t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - } - var je = 120; - p5.prototype.setBPM = function (t, e) { - for (var n in ((je = t), p.parts)) p.parts[n] && p.parts[n].setBPM(t, e); - }; - function Me(t, e, n) { - Ve(this, Me), - (this.phraseStep = 0), - (this.name = t), - (this.callback = e), - (this.sequence = n); - } - var Fe = (function () { - function n(t, e) { - Ve(this, n), - (this.length = t || 0), - (this.partStep = 0), - (this.phrases = []), - (this.isPlaying = !1), - this.noLoop(), - (this.tatums = e || 0.0625), - (this.metro = new Ee()), - this.metro._init(), - this.metro.beatLength(this.tatums), - this.metro.setBPM(je), - p.parts.push(this), - (this.callback = function () {}); - } - return ( - Be(n, [ - { - key: "setBPM", - value: function (t, e) { - this.metro.setBPM(t, e); - }, - }, - { - key: "getBPM", - value: function () { - return this.metro.getBPM(); - }, - }, - { - key: "start", - value: function (t) { - if (!this.isPlaying) { - (this.isPlaying = !0), this.metro.resetSync(this); - var e = t || 0; - this.metro.start(e); - } - }, - }, - { - key: "loop", - value: function (t) { - (this.looping = !0), - (this.onended = function () { - this.partStep = 0; - }); - var e = t || 0; - this.start(e); - }, - }, - { - key: "noLoop", - value: function () { - (this.looping = !1), - (this.onended = function () { - this.stop(); - }); - }, - }, - { - key: "stop", - value: function (t) { - (this.partStep = 0), this.pause(t); - }, - }, - { - key: "pause", - value: function (t) { - this.isPlaying = !1; - var e = t || 0; - this.metro.stop(e); - }, - }, - { - key: "addPhrase", - value: function (t, e, n) { - var i; - if (3 === arguments.length) i = new Me(t, e, n); - else { - if (!(t instanceof Me)) - throw "invalid input. addPhrase accepts name, callback, array or a p5.Phrase"; - i = t; - } - this.phrases.push(i), - i.sequence.length > this.length && - (this.length = i.sequence.length); - }, - }, - { - key: "removePhrase", - value: function (t) { - for (var e in this.phrases) - this.phrases[e].name === t && this.phrases.splice(e, 1); - }, - }, - { - key: "getPhrase", - value: function (t) { - for (var e in this.phrases) - if (this.phrases[e].name === t) return this.phrases[e]; - }, - }, - { - key: "replaceSequence", - value: function (t, e) { - for (var n in this.phrases) - this.phrases[n].name === t && (this.phrases[n].sequence = e); - }, - }, - { - key: "incrementStep", - value: function (t) { - this.partStep < this.length - 1 - ? (this.callback(t), (this.partStep += 1)) - : this.looping || - this.partStep !== this.length - 1 || - this.onended(); - }, - }, - { - key: "onStep", - value: function (t) { - this.callback = t; - }, - }, - ]), - n - ); - })(), - De = (function () { - function n() { - Ve(this, n), - (this.parts = []), - (this.currentPart = new Array(arguments.length)); - var t = this; - for (var e in arguments) - (this.parts[e] = arguments[e]), - (this.parts[e].nextPart = this.parts[e + 1]), - (this.parts[e].onended = function () { - t.resetPart(e), Ie(t); - }); - this.looping = !1; - } - return ( - Be(n, [ - { - key: "onended", - value: function () { - this.looping - ? this.parts[0].start() - : (this.parts[this.parts.length - 1].onended = function () { - this.stop(), this.resetParts(); - }), - (this.currentPart = 0); - }, - }, - { - key: "start", - value: function () { - this.parts[this.currentPart].start(), (this.scoreStep = 0); - }, - }, - { - key: "stop", - value: function () { - this.parts[this.currentPart].stop(), - (this.currentPart = 0), - (this.scoreStep = 0); - }, - }, - { - key: "pause", - value: function () { - this.parts[this.currentPart].stop(); - }, - }, - { - key: "loop", - value: function () { - (this.looping = !0), this.start(); - }, - }, - { - key: "noLoop", - value: function () { - this.looping = !1; - }, - }, - { - key: "resetParts", - value: function () { - var e = this; - this.parts.forEach(function (t) { - e.resetParts[t]; - }); - }, - }, - { - key: "resetPart", - value: function (t) { - for (var e in (this.parts[t].stop(), - (this.parts[t].partStep = 0), - this.parts[t].phrases)) - this.parts[t] && (this.parts[t].phrases[e].phraseStep = 0); - }, - }, - { - key: "setBPM", - value: function (t, e) { - for (var n in this.parts) - this.parts[n] && this.parts[n].setBPM(t, e); - }, - }, - ]), - n - ); - })(); - function Ie(t) { - t.currentPart++, - t.currentPart >= t.parts.length - ? ((t.scoreStep = 0), t.onended()) - : ((t.scoreStep = 0), - t.parts[t.currentPart - 1].stop(), - t.parts[t.currentPart].start()); - } - function Ue(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var Ge = (function () { - function i(t, e) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, i), - Object.defineProperty(this, "bpm", { - get: function () { - return this._bpm; - }, - set: function (t) { - this.musicalTimeMode, (this._bpm = t), this._update(); - }, - }), - Object.defineProperty(this, "timeSignature", { - get: function () { - return this._timeSignature; - }, - set: function (t) { - this.musicalTimeMode, (this._timeSignature = t), this._update(); - }, - }), - Object.defineProperty(this, "interval", { - get: function () { - return this._interval; - }, - set: function (t) { - (this.musicalTimeMode = "number" != typeof t), - (this._interval = t), - this._update(); - }, - }), - Object.defineProperty(this, "iterations", { - get: function () { - return this.clock.ticks; - }, - }), - (this.callback = t), - (this.musicalTimeMode = "number" != typeof this._interval), - (this._interval = e || 1), - (this._timeSignature = 4), - (this._bpm = 60), - (this.isPlaying = !1), - (this.maxIterations = 1 / 0); - var n = this; - this.clock = new Re.a({ - callback: function (t) { - var e = t - p.audiocontext.currentTime; - 0 < e && n.iterations <= n.maxIterations && n.callback(e); - }, - frequency: this._calcFreq(), - }); - } - return ( - (function (t, e, n) { - e && Ue(t.prototype, e), n && Ue(t, n); - })(i, [ - { - key: "start", - value: function (t) { - var e = t || 0, - n = p.audiocontext.currentTime; - this.isPlaying || - (this.clock.start(n + e), (this.isPlaying = !0)); - }, - }, - { - key: "stop", - value: function (t) { - var e = t || 0, - n = p.audiocontext.currentTime; - this.isPlaying && (this.clock.stop(n + e), (this.isPlaying = !1)); - }, - }, - { - key: "pause", - value: function (t) { - var e = t || 0, - n = p.audiocontext.currentTime; - this.isPlaying && - (this.clock.pause(n + e), (this.isPlaying = !1)); - }, - }, - { - key: "syncedStart", - value: function (t, e) { - var n = e || 0, - i = p.audiocontext.currentTime; - if (t.isPlaying) { - if (t.isPlaying) { - var r = t.clock._nextTick - p.audiocontext.currentTime; - this.clock.start(i + r), (this.isPlaying = !0); - } - } else - t.clock.start(i + n), - (t.isPlaying = !0), - this.clock.start(i + n), - (this.isPlaying = !0); - }, - }, - { - key: "_update", - value: function () { - this.clock.frequency.value = this._calcFreq(); - }, - }, - { - key: "_calcFreq", - value: 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; - }, - }, - { - key: "_convertNotation", - value: 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); - } - }, - }, - { - key: "_measure", - value: function (t) { - return t * this._timeSignature; - }, - }, - { - key: "_note", - value: function (t) { - return this._timeSignature / t; - }, - }, - ]), - i - ); - })(); - function Le(t) { - return (Le = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function ze(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function We(t, e) { - return !e || ("object" !== Le(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function Ze(t, e, n) { - return (Ze = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = Xe(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function Xe(t) { - return (Xe = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function Ye(t, e) { - return (Ye = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var He = (function () { - function e() { - var t; - return ( - (function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - ((t = We(this, Xe(e).call(this))).compressor = - t.ac.createDynamicsCompressor()), - t.input.connect(t.compressor), - t.compressor.connect(t.wet), - t - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && Ye(t, e); - })(e, Ct), - (function (t, e, n) { - e && ze(t.prototype, e), n && ze(t, n); - })(e, [ - { - key: "process", - value: function (t, e, n, i, r, o) { - t.connect(this.input), this.set(e, n, i, r, o); - }, - }, - { - key: "set", - value: function (t, e, n, i, r) { - void 0 !== t && this.attack(t), - void 0 !== e && this.knee(e), - void 0 !== n && this.ratio(n), - void 0 !== i && this.threshold(i), - void 0 !== r && this.release(r); - }, - }, - { - key: "attack", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.compressor.attack.value = t), - this.compressor.attack.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.compressor.attack.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : void 0 !== t && t.connect(this.compressor.attack), - this.compressor.attack.value - ); - }, - }, - { - key: "knee", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.compressor.knee.value = t), - this.compressor.knee.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.compressor.knee.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : void 0 !== t && t.connect(this.compressor.knee), - this.compressor.knee.value - ); - }, - }, - { - key: "ratio", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.compressor.ratio.value = t), - this.compressor.ratio.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.compressor.ratio.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : void 0 !== t && t.connect(this.compressor.ratio), - this.compressor.ratio.value - ); - }, - }, - { - key: "threshold", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.compressor.threshold.value = t), - this.compressor.threshold.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.compressor.threshold.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : void 0 !== t && t.connect(this.compressor.threshold), - this.compressor.threshold.value - ); - }, - }, - { - key: "release", - value: function (t, e) { - var n = e || 0; - return ( - "number" == typeof t - ? ((this.compressor.release.value = t), - this.compressor.release.cancelScheduledValues( - this.ac.currentTime + 0.01 + n, - ), - this.compressor.release.linearRampToValueAtTime( - t, - this.ac.currentTime + 0.02 + n, - )) - : "undefined" != typeof number && - t.connect(this.compressor.release), - this.compressor.release.value - ); - }, - }, - { - key: "reduction", - value: function () { - return this.compressor.reduction.value; - }, - }, - { - key: "dispose", - value: function () { - Ze(Xe(e.prototype), "dispose", this).call(this), - this.compressor && - (this.compressor.disconnect(), delete this.compressor); - }, - }, - ]), - e - ); - })(); - function $e(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var Qe = (function () { - function r(t, e, n, i) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, r), - (this.framesPerPeak = i || 20), - (this.framesSinceLastPeak = 0), - (this.decayRate = 0.95), - (this.threshold = n || 0.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 () {}); - } - return ( - (function (t, e, n) { - e && $e(t.prototype, e), n && $e(t, n); - })(r, [ - { - key: "update", - value: function (t) { - var e = (this.energy = t.getEnergy(this.f1, this.f2) / 255); - e > this.cutoff && e > this.threshold && 0 < e - this.penergy - ? (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); - }, - }, - { - key: "onPeak", - value: function (t, e) { - var n = this; - n._onPeak = function () { - t(n.energy, e); - }; - }, - }, - ]), - r - ); - })(); - function Je(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var Ke = p.audiocontext, - tn = (function () { - function e() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - (this.input = Ke.createGain()), - (this.output = Ke.createGain()), - (this._inputChannels = 2), - (this._outputChannels = 2); - var t = y(1024); - (this._workletNode = new AudioWorkletNode(Ke, s.a.recorderProcessor, { - outputChannelCount: [this._outputChannels], - processorOptions: { - numInputChannels: this._inputChannels, - bufferSize: t, - }, - })), - (this._workletNode.port.onmessage = function (t) { - if ("buffers" === t.data.name) { - var e = [ - new Float32Array(t.data.leftBuffer), - new Float32Array(t.data.rightBuffer), - ]; - this._callback(e); - } - }.bind(this)), - (this._callback = function () {}), - this._workletNode.connect(p5.soundOut._silentNode), - this.setInput(), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && Je(t.prototype, e), n && Je(t, n); - })(e, [ - { - key: "setInput", - value: function (t) { - this.input.disconnect(), - (this.input = null), - (this.input = Ke.createGain()), - this.input.connect(this._workletNode), - this.input.connect(this.output), - t - ? t.connect(this.input) - : p5.soundOut.output.connect(this.input); - }, - }, - { - key: "record", - value: function (e, t, n) { - this._workletNode.port.postMessage({ - name: "start", - duration: t, - }), - e && n - ? (this._callback = function (t) { - e.setBuffer(t), n(); - }) - : e && - (this._callback = function (t) { - e.setBuffer(t); - }); - }, - }, - { - key: "stop", - value: function () { - this._workletNode.port.postMessage({ name: "stop" }); - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - (this._callback = function () {}), - this.input && this.input.disconnect(), - (this.input = null), - (this._workletNode = null); - }, - }, - ]), - e - ); - })(); - function en(t) { - return (en = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function nn(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function rn(t, e) { - return !e || ("object" !== en(e) && "function" != typeof e) - ? (function (t) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - })(t) - : e; - } - function on(t, e, n) { - return (on = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = sn(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function sn(t) { - return (sn = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function an(t, e) { - return (an = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - function un(t) { - for ( - var e, - n = "number" == typeof t ? t : 50, - i = new Float32Array(44100), - r = Math.PI / 180, - o = 0; - o < 44100; - ++o - ) - (e = (2 * o) / 44100 - 1), - (i[o] = ((3 + n) * e * 20 * r) / (Math.PI + n * Math.abs(e))); - return i; - } - var cn = (function () { - function r(t, e) { - var n; - if ( - ((function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, r), - (n = rn(this, sn(r).call(this))), - void 0 === t && (t = 0.25), - "number" != typeof t) - ) - throw new Error("amount must be a number"); - if ((void 0 === e && (e = "2x"), "string" != typeof e)) - throw new Error("oversample must be a String"); - var i = p5.prototype.map(t, 0, 1, 0, 2e3); - return ( - (n.waveShaperNode = n.ac.createWaveShaper()), - (n.amount = i), - (n.waveShaperNode.curve = un(i)), - (n.waveShaperNode.oversample = e), - n.input.connect(n.waveShaperNode), - n.waveShaperNode.connect(n.wet), - n - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && an(t, e); - })(r, Ct), - (function (t, e, n) { - e && nn(t.prototype, e), n && nn(t, n); - })(r, [ - { - key: "process", - value: function (t, e, n) { - t.connect(this.input), this.set(e, n); - }, - }, - { - key: "set", - value: function (t, e) { - if (t) { - var n = p5.prototype.map(t, 0, 1, 0, 2e3); - (this.amount = n), (this.waveShaperNode.curve = un(n)); - } - e && (this.waveShaperNode.oversample = e); - }, - }, - { - key: "getAmount", - value: function () { - return this.amount; - }, - }, - { - key: "getOversample", - value: function () { - return this.waveShaperNode.oversample; - }, - }, - { - key: "dispose", - value: function () { - on(sn(r.prototype), "dispose", this).call(this), - this.waveShaperNode && - (this.waveShaperNode.disconnect(), - (this.waveShaperNode = null)); - }, - }, - ]), - r - ); - })(); - function ln(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var hn = (function () { - function t() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, t), - (this.ac = p.audiocontext), - (this.input = this.ac.createGain()), - (this.output = this.ac.createGain()), - (this.input.gain.value = 0.5), - this.input.connect(this.output), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && ln(t.prototype, e), n && ln(t, n); - })(t, [ - { - key: "setInput", - value: function (t) { - t.connect(this.input); - }, - }, - { - key: "connect", - value: function (t) { - var e = t || p5.soundOut.input; - this.output.connect(e.input ? e.input : e); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(); - }, - }, - { - key: "amp", - value: function (t, e, n) { - var i = 1 < arguments.length && void 0 !== e ? e : 0, - r = 2 < arguments.length && void 0 !== n ? n : 0, - o = p.audiocontext.currentTime, - s = this.output.gain.value; - this.output.gain.cancelScheduledValues(o), - this.output.gain.linearRampToValueAtTime(s, o + r), - this.output.gain.linearRampToValueAtTime(t, o + r + i); - }, - }, - { - key: "dispose", - value: function () { - var t = p.soundArray.indexOf(this); - p.soundArray.splice(t, 1), - this.output && (this.output.disconnect(), delete this.output), - this.input && (this.input.disconnect(), delete this.input); - }, - }, - ]), - t - ); - })(); - function pn(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var fn = (function () { - function t() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, t), - (this.ac = p.audiocontext), - (this.output = this.ac.createGain()), - this.connect(), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && pn(t.prototype, e), n && pn(t, n); - })(t, [ - { key: "play", value: function (t, e, n, i) {} }, - { key: "triggerAttack", value: function (t, e, n) {} }, - { key: "triggerRelease", value: function (t) {} }, - { key: "amp", value: function (t, e) {} }, - { - key: "connect", - value: function (t) { - var e = t || p.input; - this.output.connect(e.input ? e.input : e); - }, - }, - { - key: "disconnect", - value: function () { - this.output.disconnect(); - }, - }, - { - key: "dispose", - value: function () { - this.output && (this.output.disconnect(), delete this.output); - }, - }, - ]), - t - ); - })(); - function dn(t) { - return (dn = - "function" == typeof Symbol && "symbol" == typeof Symbol.iterator - ? function (t) { - return typeof t; - } - : function (t) { - return t && - "function" == typeof Symbol && - t.constructor === Symbol && - t !== Symbol.prototype - ? "symbol" - : typeof t; - })(t); - } - function yn(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - function mn(t) { - if (void 0 === t) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return t; - } - function vn(t, e, n) { - return (vn = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (t, e, n) { - var i = (function (t, e) { - for ( - ; - !Object.prototype.hasOwnProperty.call(t, e) && - null !== (t = _n(t)); - - ); - return t; - })(t, e); - if (i) { - var r = Object.getOwnPropertyDescriptor(i, e); - return r.get ? r.get.call(n) : r.value; - } - })(t, e, n || t); - } - function _n(t) { - return (_n = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - })(t); - } - function gn(t, e) { - return (gn = - Object.setPrototypeOf || - function (t, e) { - return (t.__proto__ = e), t; - })(t, e); - } - var bn = (function () { - function e() { - var t; - return ( - (function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, e), - ((t = (function (t, e) { - return !e || ("object" !== dn(e) && "function" != typeof e) - ? mn(t) - : e; - })(this, _n(e).call(this))).oscillator = new nt()), - (t.env = new ot()), - t.env.setRange(1, 0), - t.env.setExp(!0), - t.setADSR(0.02, 0.25, 0.05, 0.35), - t.oscillator.disconnect(), - t.oscillator.connect(t.output), - t.env.disconnect(), - t.env.setInput(t.output.gain), - (t.oscillator.output.gain.value = 1), - t.oscillator.start(), - t.connect(), - p.soundArray.push(mn(t)), - Object.defineProperties(mn(t), { - 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 - ); - } - return ( - (function (t, e) { - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && gn(t, e); - })(e, fn), - (function (t, e, n) { - e && yn(t.prototype, e), n && yn(t, n); - })(e, [ - { - key: "play", - value: function (t, e, n, i) { - this.triggerAttack(t, e, ~~n), - this.triggerRelease(~~n + (i || 0.15)); - }, - }, - { - key: "triggerAttack", - value: function (t, e, n) { - var i = 2 < arguments.length && void 0 !== n ? n : 0, - r = h(t), - o = e || 0.1; - this.oscillator.freq(r, 0, i), - this.env.ramp(this.output.gain, i, o); - }, - }, - { - key: "triggerRelease", - value: function (t) { - var e = 0 < arguments.length && void 0 !== t ? t : 0; - this.env.ramp(this.output.gain, e, 0); - }, - }, - { - key: "setADSR", - value: function (t, e, n, i) { - this.env.setADSR(t, e, n, i); - }, - }, - { - key: "amp", - value: function (t, e) { - var n = e || 0; - return ( - void 0 !== t && this.oscillator.amp(t, n), - this.oscillator.amp().value - ); - }, - }, - { - key: "connect", - value: function (t) { - var e = t || p.input; - this.output.connect(e.input ? e.input : e); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(); - }, - }, - { - key: "dispose", - value: function () { - vn(_n(e.prototype), "dispose", this).call(this), - this.env && this.env.dispose(), - this.oscillator && this.oscillator.dispose(); - }, - }, - ]), - e - ); - })(); - function Tn(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var wn = (function () { - function r(t, e, n, i) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, r), - (this.isDetected = !1), - (this.freqLow = t), - (this.freqHigh = e), - (this.treshold = n), - (this.energy = 0), - (this.penergy = 0), - (this.sensitivity = 500), - (this.callback = i); - } - return ( - (function (t, e, n) { - e && Tn(t.prototype, e), n && Tn(t, n); - })(r, [ - { - key: "update", - value: function (t, e) { - if ( - ((this.energy = t.getEnergy(this.freqLow, this.freqHigh) / 255), - !1 === this.isDetected && - this.energy - this.penergy > this.treshold) - ) { - (this.isDetected = !0), - this.callback - ? this.callback(this.energy) - : e && e(this.energy); - var n = this; - setTimeout(function () { - n.isDetected = !1; - }, this.sensitivity); - } - this.penergy = this.energy; - }, - }, - ]), - r - ); - })(); - function xn(t, e) { - for (var n = 0; n < e.length; n++) { - var i = e[n]; - (i.enumerable = i.enumerable || !1), - (i.configurable = !0), - "value" in i && (i.writable = !0), - Object.defineProperty(t, i.key, i); - } - } - var Sn = (function () { - function n(t, e) { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, n), - (this.audiovoices = []), - (this.notes = {}), - (this._newest = 0), - (this._oldest = 0), - (this.maxVoices = e || 8), - (this.AudioVoice = void 0 === t ? p5.MonoSynth : t), - (this._voicesInUse = new rt.a(0)), - (this.output = p.audiocontext.createGain()), - this.connect(), - this._allocateVoices(), - p.soundArray.push(this); - } - return ( - (function (t, e, n) { - e && xn(t.prototype, e), n && xn(t, n); - })(n, [ - { - key: "_allocateVoices", - value: function () { - for (var t = 0; t < this.maxVoices; t++) - this.audiovoices.push(new this.AudioVoice()), - this.audiovoices[t].disconnect(), - this.audiovoices[t].connect(this.output); - }, - }, - { - key: "play", - value: function (t, e, n, i) { - var r = 3 < arguments.length && void 0 !== i ? i : 1; - this.noteAttack(t, e, n), this.noteRelease(t, n + r); - }, - }, - { - key: "noteADSR", - value: function (t, e, n, i, r, o) { - var s = 5 < arguments.length && void 0 !== o ? o : 0, - a = p.audiocontext.currentTime + s; - this.audiovoices[this.notes[t].getValueAtTime(a)].setADSR( - e, - n, - i, - r, - ); - }, - }, - { - key: "setADSR", - value: function (e, n, i, r) { - this.audiovoices.forEach(function (t) { - t.setADSR(e, n, i, r); - }); - }, - }, - { - key: "noteAttack", - value: function (t, e, n) { - var i, - r = 2 < arguments.length && void 0 !== n ? n : 0, - o = p.audiocontext.currentTime + r, - s = h(t), - a = e || 0.1; - this.notes[s] && - null !== this.notes[s].getValueAtTime(o) && - this.noteRelease(s, 0), - this._voicesInUse.getValueAtTime(o) < this.maxVoices - ? (i = Math.max(~~this._voicesInUse.getValueAtTime(o), 0)) - : ((i = this._oldest), - (oldestNote = l( - this.audiovoices[this._oldest].oscillator.freq().value, - )), - this.noteRelease(oldestNote), - (this._oldest = (this._oldest + 1) % (this.maxVoices - 1))), - (this.notes[s] = new rt.a()), - this.notes[s].setValueAtTime(i, o); - var u = - null === this._voicesInUse._searchBefore(o) - ? 0 - : this._voicesInUse._searchBefore(o).value; - if ( - (this._voicesInUse.setValueAtTime(u + 1, o), - this._updateAfter(o, 1), - (this._newest = i), - "number" == typeof a) - ) { - var c = (1 / this._voicesInUse.getValueAtTime(o)) * 2; - a = c < a ? c : a; - } - this.audiovoices[i].triggerAttack(s, a, r); - }, - }, - { - key: "_updateAfter", - value: function (t, e) { - if (null !== this._voicesInUse._searchAfter(t)) { - this._voicesInUse._searchAfter(t).value += e; - var n = this._voicesInUse._searchAfter(t).time; - this._updateAfter(n, e); - } - }, - }, - { - key: "noteRelease", - value: function (t, e) { - var n = p.audiocontext.currentTime, - i = e || 0, - r = n + i; - if (t) { - var o = h(t); - if (this.notes[o] && null !== this.notes[o].getValueAtTime(r)) { - var s = Math.max( - ~~this._voicesInUse.getValueAtTime(r).value, - 1, - ); - this._voicesInUse.setValueAtTime(s - 1, r), - 0 < s && this._updateAfter(r, -1), - this.audiovoices[ - this.notes[o].getValueAtTime(r) - ].triggerRelease(i), - this.notes[o].dispose(), - delete this.notes[o], - (this._newest = - 0 === this._newest - ? 0 - : (this._newest - 1) % (this.maxVoices - 1)); - } else; - } else - for (var a in (this.audiovoices.forEach(function (t) { - t.triggerRelease(i); - }), - this._voicesInUse.setValueAtTime(0, r), - this.notes)) - this.notes[a].dispose(), delete this.notes[a]; - }, - }, - { - key: "connect", - value: function (t) { - var e = t || p.input; - this.output.connect(e.input ? e.input : e); - }, - }, - { - key: "disconnect", - value: function () { - this.output && this.output.disconnect(); - }, - }, - { - key: "dispose", - value: function () { - this.audiovoices.forEach(function (t) { - t.dispose(); - }), - this.output && (this.output.disconnect(), delete this.output); - }, - }, - ]), - n - ); - })(); - function kn() { - !(function (t, e) { - if (!(t instanceof e)) - throw new TypeError("Cannot call a class as a function"); - })(this, kn); - } - (p5.prototype.getAudioContext = c.b), - (p5.prototype.userStartAudio = c.c), - (p5.prototype.sampleRate = function () { - return p.audiocontext.sampleRate; - }), - (p5.prototype.freqToMidi = l), - (p5.prototype.midiToFreq = r), - (p5.prototype.noteToFreq = h), - (p5.prototype.soundFormats = function () { - p.extensions = []; - for (var t = 0; t < arguments.length; t++) { - if ( - ((arguments[t] = arguments[t].toLowerCase()), - !(-1 < ["mp3", "wav", "ogg", "m4a", "aac"].indexOf(arguments[t]))) - ) - throw arguments[t] + " is not a valid sound format!"; - p.extensions.push(arguments[t]); - } - }), - (p5.prototype.disposeSound = function () { - for (var t = 0; t < p.soundArray.length; t++) p.soundArray[t].dispose(); - }), - (p5.prototype._checkFileFormats = function (t) { - var e; - if ("string" == typeof t) { - var n = (e = t).split(".").pop(); - if (-1 < ["mp3", "wav", "ogg", "m4a", "aac"].indexOf(n)) { - if (!p5.prototype.isFileSupported(n)) - for ( - var i = e.split("."), r = i[i.length - 1], o = 0; - o < p.extensions.length; - o++ - ) { - var s = p.extensions[o]; - if (p5.prototype.isFileSupported(s)) { - (r = ""), 2 === i.length && (r += i[0]); - for (var a = 1; a <= i.length - 2; a++) { - r += "." + i[a]; - } - (e = r += "."), (e = e += s); - break; - } - } - } else - for (var u = 0; u < p.extensions.length; u++) { - var c = p.extensions[u]; - if (p5.prototype.isFileSupported(c)) { - e = e + "." + c; - break; - } - } - } else if ("object" === f(t)) - for (var l = 0; l < t.length; l++) { - var h = t[l].split(".").pop(); - if (p5.prototype.isFileSupported(h)) { - e = t[l]; - break; - } - } - return e; - }), - (p5.prototype._mathChain = function (t, e, n, i, r) { - for (var o in t.mathOps) - t.mathOps[o] instanceof r && - (t.mathOps[o].dispose(), - (n = o) < t.mathOps.length - 1 && (i = t.mathOps[o + 1])); - return ( - t.mathOps[n - 1].disconnect(), - t.mathOps[n - 1].connect(e), - e.connect(i), - (t.mathOps[n] = e), - t - ); - }), - (p5.prototype.convertToWav = a), - (p5.prototype.interleave = u), - (p5.prototype.writeUTFBytes = d), - (p5.prototype.safeBufferSize = y), - (p5.prototype.saveSound = function (t, e) { - var n = a(t.buffer); - p5.prototype.writeFile([n], e, "wav"); - }), - p5.prototype.registerMethod("remove", p5.prototype.disposeSound), - (p5.Panner = k), - (p5.SoundFile = E), - (p5.prototype.loadSound = function (t, e, n, i) { - -1 < window.location.origin.indexOf("file://") && - "undefined" === window.cordova && - window.alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ); - var r = this; - return new q( - t, - function () { - "function" == typeof e && e.apply(r, arguments), - "function" == typeof r._decrementPreload && r._decrementPreload(); - }, - n, - i, - ); - }), - p5.prototype.registerPreloadMethod("loadSound", p5.prototype), - (p5.Amplitude = B), - (p5.FFT = j), - (p5.Oscillator = nt), - (p5.SinOsc = J), - (p5.TriOsc = K), - (p5.SawOsc = tt), - (p5.SqrOsc = et), - (p5.Noise = dt), - (p5.Pulse = xt), - (p5.AudioIn = kt), - (p5.Effect = Ct), - (p5.Filter = Gt), - (p5.LowPass = Dt), - (p5.HighPass = It), - (p5.BandPass = Ut), - (p5.EQ = ee), - (p5.listener3D = ie), - (p5.Panner3D = le), - (p5.Delay = ve), - (p5.Reverb = Ae), - (p5.Convolver = Oe), - (p5.prototype.createConvolver = function (t, e, n) { - -1 < window.location.origin.indexOf("file://") && - "undefined" === window.cordova && - alert( - "This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS", - ); - var i = this, - r = new Oe( - t, - function (t) { - "function" == typeof e && e(t), - "function" == typeof i._decrementPreload && - i._decrementPreload(); - }, - n, - ); - return (r.impulses = []), r; - }), - p5.prototype.registerPreloadMethod("createConvolver", p5.prototype), - (p5.Metro = Ee), - (p5.Phrase = Me), - (p5.Part = Fe), - (p5.Score = De), - (p5.SoundLoop = Ge), - (p5.Compressor = He), - (p5.peakDetect = Qe), - (p5.SoundRecorder = tn), - (p5.Distortion = cn), - (p5.Gain = hn), - (p5.AudioVoice = fn), - (p5.MonoSynth = bn), - (p5.OnsetDetect = wn), - (p5.PolySynth = Sn), - (p5.PeakDetect = Qe), - (p5.Signal = kn); - }, -]); -//# sourceMappingURL=p5.sound.min.js.map +/** [p5.sound] Version: 1.0.1 - 2021-05-25 */ + !function(n){var i={};function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}r.m=n,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=40)}([function(t,e,n){var i;void 0===(i=function(){"use strict";function l(t,e){this.isUndef(t)||1===t?this.input=this.context.createGain():1t)this.cancelScheduledValues(t),this.linearRampToValueAtTime(e,t);else{var i=this._searchAfter(t);i&&(this.cancelScheduledValues(t),i.type===u.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(e,t):i.type===u.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(e,t)),this.setValueAtTime(e,t)}return this},u.TimelineSignal.prototype.linearRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.linearRampToValueAtTime(t,n),this},u.TimelineSignal.prototype.exponentialRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.exponentialRampToValueAtTime(t,n),this},u.TimelineSignal.prototype._searchBefore=function(t){return this._events.get(t)},u.TimelineSignal.prototype._searchAfter=function(t){return this._events.getAfter(t)},u.TimelineSignal.prototype.getValueAtTime=function(t){t=this.toSeconds(t);var e=this._searchAfter(t),n=this._searchBefore(t),i=this._initial;if(null===n)i=this._initial;else if(n.type===u.TimelineSignal.Type.Target){var r,o=this._events.getBefore(n.time);r=null===o?this._initial:o.value,i=this._exponentialApproach(n.time,r,n.value,n.constant,t)}else i=n.type===u.TimelineSignal.Type.Curve?this._curveInterpolate(n.time,n.value,n.duration,t):null===e?n.value:e.type===u.TimelineSignal.Type.Linear?this._linearInterpolate(n.time,n.value,e.time,e.value,t):e.type===u.TimelineSignal.Type.Exponential?this._exponentialInterpolate(n.time,n.value,e.time,e.value,t):n.value;return i},u.TimelineSignal.prototype.connect=u.SignalBase.prototype.connect,u.TimelineSignal.prototype._exponentialApproach=function(t,e,n,i,r){return n+(e-n)*Math.exp(-(r-t)/i)},u.TimelineSignal.prototype._linearInterpolate=function(t,e,n,i,r){return e+(r-t)/(n-t)*(i-e)},u.TimelineSignal.prototype._exponentialInterpolate=function(t,e,n,i,r){return(e=Math.max(this._minOutput,e))*Math.pow(i/e,(r-t)/(n-t))},u.TimelineSignal.prototype._curveInterpolate=function(t,e,n,i){var r=e.length;if(t+n<=i)return e[r-1];if(i<=t)return e[0];var o=(i-t)/n,s=Math.floor((r-1)*o),a=Math.ceil((r-1)*o),u=e[s],c=e[a];return a===s?u:this._linearInterpolate(s,u,a,c,o*(r-1))},u.TimelineSignal.prototype.dispose=function(){u.Signal.prototype.dispose.call(this),u.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},u.TimelineSignal}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(4),n(1),n(2)],void 0===(r=function(n){"use strict";return n.Scale=function(t,e){this._outputMin=this.defaultArg(t,0),this._outputMax=this.defaultArg(e,1),this._scale=this.input=new n.Multiply(1),this._add=this.output=new n.Add(0),this._scale.connect(this._add),this._setRange()},n.extend(n.Scale,n.SignalBase),Object.defineProperty(n.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(n.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),n.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},n.Scale.prototype.dispose=function(){return n.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},n.Scale}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(16),n(30),n(31),n(12)],void 0===(r=function(e){return e.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"},e.prototype.toSeconds=function(t){return this.isNumber(t)?t:this.isUndef(t)?this.now():this.isString(t)?new e.Time(t).toSeconds():t instanceof e.TimeBase?t.toSeconds():void 0},e.prototype.toFrequency=function(t){return this.isNumber(t)?t:this.isString(t)||this.isUndef(t)?new e.Frequency(t).valueOf():t instanceof e.TimeBase?t.toFrequency():void 0},e.prototype.toTicks=function(t){return this.isNumber(t)||this.isString(t)?new e.TransportTime(t).toTicks():this.isUndef(t)?e.Transport.ticks:t instanceof e.TimeBase?t.toTicks():void 0},e}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(18),n(9)],void 0===(r=function(n){"use strict";return window.GainNode&&!AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),n.Gain=function(){var t=this.optionsObject(arguments,["gain","units"],n.Gain.defaults);this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new n.Param({param:this._gainNode.gain,units:t.units,value:t.gain,convert:t.convert}),this._readOnly("gain")},n.extend(n.Gain),n.Gain.defaults={gain:1,convert:!0},n.Gain.prototype.dispose=function(){n.Param.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},n.prototype.createInsOuts=function(t,e){1===t?this.input=new n.Gain:1this._nextTick&&this._state;){var e=this._state.getValueAtTime(this._nextTick);if(e!==this._lastState){this._lastState=e;var n=this._state.get(this._nextTick);e===r.State.Started?(this._nextTick=n.time,this.isUndef(n.offset)||(this.ticks=n.offset),this.emit("start",n.time,this.ticks)):e===r.State.Stopped?(this.ticks=0,this.emit("stop",n.time)):e===r.State.Paused&&this.emit("pause",n.time)}var i=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),e===r.State.Started&&(this.callback(i),this.ticks++))}},r.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},r.Clock.prototype.dispose=function(){r.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},r.Clock}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(14)],void 0===(r=function(i){function t(t,e,n){if(t.input)Array.isArray(t.input)?(i.prototype.isUndef(n)&&(n=0),this.connect(t.input[n])):this.connect(t.input,e,n);else try{t instanceof AudioNode?r.call(this,t,e,n):r.call(this,t,e)}catch(e){throw new Error("error connecting to node: "+t+"\n"+e)}}var r,o;return!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),i.Context=function(t){for(var e in i.Emitter.call(this),t=t||new window.AudioContext,this._context=t,this._context)this._defineProperty(this._context,e);this._latencyHint="interactive",this._lookAhead=.1,this._updateInterval=this._lookAhead/3,this._computedUpdateInterval=0,this._worker=this._createWorker(),this._constants={}},i.extend(i.Context,i.Emitter),i.Emitter.mixin(i.Context),i.Context.prototype._defineProperty=function(e,n){this.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},i.Context.prototype.now=function(){return this._context.currentTime},i.Context.prototype._createWorker=function(){window.URL=window.URL||window.webkitURL;var t=new Blob(["var timeoutTime = "+(1e3*this._updateInterval).toFixed(1)+";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();"]),e=URL.createObjectURL(t),n=new Worker(e);return n.addEventListener("message",function(){this.emit("tick")}.bind(this)),n.addEventListener("message",function(){var t=this.now();if(this.isNumber(this._lastUpdate)){var e=t-this._lastUpdate;this._computedUpdateInterval=Math.max(e,.97*this._computedUpdateInterval)}this._lastUpdate=t}.bind(this)),n},i.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),i=0;ithis.memory){var n=this.length-this.memory;this._timeline.splice(0,n)}return this},e.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},e.Timeline.prototype.get=function(t){var e=this._search(t);return-1!==e?this._timeline[e]:null},e.Timeline.prototype.peek=function(){return this._timeline[0]},e.Timeline.prototype.shift=function(){return this._timeline.shift()},e.Timeline.prototype.getAfter=function(t){var e=this._search(t);return e+1=t&&(this._timeline=[]);return this},e.Timeline.prototype.cancelBefore=function(t){if(this._timeline.length){var e=this._search(t);0<=e&&(this._timeline=this._timeline.slice(e+1))}return this},e.Timeline.prototype._search=function(t){var e=0,n=this._timeline.length,i=n;if(0t)return r;o.time>t?i=r:o.time=t;)n--;return this._iterate(e,n+1),this},e.Timeline.prototype.forEachAtTime=function(e,n){var t=this._search(e);return-1!==t&&this._iterate(function(t){t.time===e&&n(t)},0,t),this},e.Timeline.prototype.dispose=function(){e.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},e.Timeline}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(1),n(2)],void 0===(r=function(t){"use strict";return t.Negate=function(){this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(1),n(6)],void 0===(r=function(t){"use strict";return t.GreaterThanZero=function(){this._thresh=this.output=new t.WaveShaper(function(t){return t<=0?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}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r,o;r=[],void 0===(o="function"==typeof(i=function(){var s=function(t,e){this._dragged=!1,this._element=t,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this,e),t.addEventListener("touchstart",this._bindedEnd),t.addEventListener("touchmove",this._bindedMove),t.addEventListener("touchend",this._bindedEnd),t.addEventListener("mouseup",this._bindedEnd)};function o(t){return"running"===t.state}return s.prototype._moved=function(t){this._dragged=!0},s.prototype._ended=function(t){this._dragged||function(t){var e=t.createBuffer(1,1,t.sampleRate),n=t.createBufferSource();n.buffer=e,n.connect(t.destination),n.start(0),t.resume&&t.resume()}(t),this._dragged=!1},s.prototype.dispose=function(){this._element.removeEventListener("touchstart",this._bindedEnd),this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},function(e,t,n){var i=new Promise(function(t){!function(e,n){o(e)?n():function t(){o(e)?n():(requestAnimationFrame(t),e.resume&&e.resume())}()}(e,t)}),r=[];return function t(e,n,i){if(Array.isArray(e)||NodeList&&e instanceof NodeList)for(var r=0;r= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar RecorderProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(RecorderProcessor, _AudioWorkletProcesso);\n\n function RecorderProcessor(options) {\n var _this;\n\n _classCallCheck(this, RecorderProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(RecorderProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 2;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.bufferSize = processorOptions.bufferSize || 1024;\n _this.recording = false;\n\n _this.clear();\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'start\') {\n _this.record(data.duration);\n } else if (data.name === \'stop\') {\n _this.stop();\n }\n };\n\n return _this;\n }\n\n _createClass(RecorderProcessor, [{\n key: "process",\n value: function process(inputs) {\n if (!this.recording) {\n return true;\n } else if (this.sampleLimit && this.recordedSamples >= this.sampleLimit) {\n this.stop();\n return true;\n }\n\n var input = inputs[0];\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numOutputChannels; ++channel) {\n var inputChannelCopy = this.inputRingBufferArraySequence[channel].slice();\n\n if (channel === 0) {\n this.leftBuffers.push(inputChannelCopy);\n\n if (this.numInputChannels === 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n } else if (channel === 1 && this.numInputChannels > 1) {\n this.rightBuffers.push(inputChannelCopy);\n }\n }\n\n this.recordedSamples += this.bufferSize;\n }\n\n return true;\n }\n }, {\n key: "record",\n value: function record(duration) {\n if (duration) {\n this.sampleLimit = Math.round(duration * sampleRate);\n }\n\n this.recording = true;\n }\n }, {\n key: "stop",\n value: function stop() {\n this.recording = false;\n var buffers = this.getBuffers();\n var leftBuffer = buffers[0].buffer;\n var rightBuffer = buffers[1].buffer;\n this.port.postMessage({\n name: \'buffers\',\n leftBuffer: leftBuffer,\n rightBuffer: rightBuffer\n }, [leftBuffer, rightBuffer]);\n this.clear();\n }\n }, {\n key: "getBuffers",\n value: function getBuffers() {\n var buffers = [];\n buffers.push(this.mergeBuffers(this.leftBuffers));\n buffers.push(this.mergeBuffers(this.rightBuffers));\n return buffers;\n }\n }, {\n key: "mergeBuffers",\n value: function mergeBuffers(channelBuffer) {\n var result = new Float32Array(this.recordedSamples);\n var offset = 0;\n var lng = channelBuffer.length;\n\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n\n return result;\n }\n }, {\n key: "clear",\n value: function clear() {\n var _this2 = this;\n\n this.leftBuffers = [];\n this.rightBuffers = [];\n this.inputRingBuffer = new RingBuffer(this.bufferSize, this.numInputChannels);\n this.inputRingBufferArraySequence = new Array(this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this2.bufferSize);\n });\n this.recordedSamples = 0;\n this.sampleLimit = null;\n }\n }]);\n\n return RecorderProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.recorderProcessor, RecorderProcessor);'},function(t,e,n){"use strict";n.r(e),e.default='function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar SoundFileProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(SoundFileProcessor, _AudioWorkletProcesso);\n\n function SoundFileProcessor(options) {\n var _this;\n\n _classCallCheck(this, SoundFileProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SoundFileProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.bufferSize = processorOptions.bufferSize || 256;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, 1);\n _this.inputRingBufferArraySequence = [new Float32Array(_this.bufferSize)];\n return _this;\n }\n\n _createClass(SoundFileProcessor, [{\n key: "process",\n value: function process(inputs) {\n var input = inputs[0]; // we only care about the first input channel, because that contains the position data\n\n this.inputRingBuffer.push([input[0]]);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n var inputChannel = this.inputRingBufferArraySequence[0];\n var position = inputChannel[inputChannel.length - 1] || 0;\n this.port.postMessage({\n name: \'position\',\n position: position\n });\n }\n\n return true;\n }\n }]);\n\n return SoundFileProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.soundFileProcessor, SoundFileProcessor);'},function(t,e,n){"use strict";n.r(e),e.default='function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// import dependencies via preval.require so that they\'re available as values at compile time\nvar processorNames = {\n "recorderProcessor": "recorder-processor",\n "soundFileProcessor": "sound-file-processor",\n "amplitudeProcessor": "amplitude-processor"\n};\nvar RingBuffer = {\n "default":\n /*#__PURE__*/\n function () {\n /**\n * @constructor\n * @param {number} length Buffer length in frames.\n * @param {number} channelCount Buffer channel count.\n */\n function RingBuffer(length, channelCount) {\n _classCallCheck(this, RingBuffer);\n\n this._readIndex = 0;\n this._writeIndex = 0;\n this._framesAvailable = 0;\n this._channelCount = channelCount;\n this._length = length;\n this._channelData = [];\n\n for (var i = 0; i < this._channelCount; ++i) {\n this._channelData[i] = new Float32Array(length);\n }\n }\n /**\n * Getter for Available frames in buffer.\n *\n * @return {number} Available frames in buffer.\n */\n\n\n _createClass(RingBuffer, [{\n key: "push",\n\n /**\n * Push a sequence of Float32Arrays to buffer.\n *\n * @param {array} arraySequence A sequence of Float32Arrays.\n */\n value: function push(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // Transfer data from the |arraySequence| storage to the internal buffer.\n var sourceLength = arraySequence[0] ? arraySequence[0].length : 0;\n\n for (var i = 0; i < sourceLength; ++i) {\n var writeIndex = (this._writeIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n this._channelData[channel][writeIndex] = arraySequence[channel][i];\n }\n }\n\n this._writeIndex += sourceLength;\n\n if (this._writeIndex >= this._length) {\n this._writeIndex = 0;\n } // For excessive frames, the buffer will be overwritten.\n\n\n this._framesAvailable += sourceLength;\n\n if (this._framesAvailable > this._length) {\n this._framesAvailable = this._length;\n }\n }\n /**\n * Pull data out of buffer and fill a given sequence of Float32Arrays.\n *\n * @param {array} arraySequence An array of Float32Arrays.\n */\n\n }, {\n key: "pull",\n value: function pull(arraySequence) {\n // The channel count of arraySequence and the length of each channel must\n // match with this buffer obejct.\n // If the FIFO is completely empty, do nothing.\n if (this._framesAvailable === 0) {\n return;\n }\n\n var destinationLength = arraySequence[0].length; // Transfer data from the internal buffer to the |arraySequence| storage.\n\n for (var i = 0; i < destinationLength; ++i) {\n var readIndex = (this._readIndex + i) % this._length;\n\n for (var channel = 0; channel < this._channelCount; ++channel) {\n arraySequence[channel][i] = this._channelData[channel][readIndex];\n }\n }\n\n this._readIndex += destinationLength;\n\n if (this._readIndex >= this._length) {\n this._readIndex = 0;\n }\n\n this._framesAvailable -= destinationLength;\n\n if (this._framesAvailable < 0) {\n this._framesAvailable = 0;\n }\n }\n }, {\n key: "framesAvailable",\n get: function get() {\n return this._framesAvailable;\n }\n }]);\n\n return RingBuffer;\n }()\n}["default"];\n\nvar AmplitudeProcessor =\n/*#__PURE__*/\nfunction (_AudioWorkletProcesso) {\n _inherits(AmplitudeProcessor, _AudioWorkletProcesso);\n\n function AmplitudeProcessor(options) {\n var _this;\n\n _classCallCheck(this, AmplitudeProcessor);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AmplitudeProcessor).call(this));\n var processorOptions = options.processorOptions || {};\n _this.numOutputChannels = options.outputChannelCount || 1;\n _this.numInputChannels = processorOptions.numInputChannels || 2;\n _this.normalize = processorOptions.normalize || false;\n _this.smoothing = processorOptions.smoothing || 0;\n _this.bufferSize = processorOptions.bufferSize || 2048;\n _this.inputRingBuffer = new RingBuffer(_this.bufferSize, _this.numInputChannels);\n _this.outputRingBuffer = new RingBuffer(_this.bufferSize, _this.numOutputChannels);\n _this.inputRingBufferArraySequence = new Array(_this.numInputChannels).fill(null).map(function () {\n return new Float32Array(_this.bufferSize);\n });\n _this.stereoVol = [0, 0];\n _this.stereoVolNorm = [0, 0];\n _this.volMax = 0.001;\n\n _this.port.onmessage = function (event) {\n var data = event.data;\n\n if (data.name === \'toggleNormalize\') {\n _this.normalize = data.normalize;\n } else if (data.name === \'smoothing\') {\n _this.smoothing = Math.max(0, Math.min(1, data.smoothing));\n }\n };\n\n return _this;\n } // TO DO make this stereo / dependent on # of audio channels\n\n\n _createClass(AmplitudeProcessor, [{\n key: "process",\n value: function process(inputs, outputs) {\n var input = inputs[0];\n var output = outputs[0];\n var smoothing = this.smoothing;\n this.inputRingBuffer.push(input);\n\n if (this.inputRingBuffer.framesAvailable >= this.bufferSize) {\n this.inputRingBuffer.pull(this.inputRingBufferArraySequence);\n\n for (var channel = 0; channel < this.numInputChannels; ++channel) {\n var inputBuffer = this.inputRingBufferArraySequence[channel];\n var bufLength = inputBuffer.length;\n var sum = 0;\n\n for (var i = 0; i < bufLength; i++) {\n var x = inputBuffer[i];\n\n if (this.normalize) {\n sum += Math.max(Math.min(x / this.volMax, 1), -1) * Math.max(Math.min(x / this.volMax, 1), -1);\n } else {\n sum += x * x;\n }\n } // ... then take the square root of the sum.\n\n\n var rms = Math.sqrt(sum / bufLength);\n this.stereoVol[channel] = Math.max(rms, this.stereoVol[channel] * smoothing);\n this.volMax = Math.max(this.stereoVol[channel], this.volMax);\n } // calculate stero normalized volume and add volume from all channels together\n\n\n var volSum = 0;\n\n for (var index = 0; index < this.stereoVol.length; index++) {\n this.stereoVolNorm[index] = Math.max(Math.min(this.stereoVol[index] / this.volMax, 1), 0);\n volSum += this.stereoVol[index];\n } // volume is average of channels\n\n\n var volume = volSum / this.stereoVol.length; // normalized value\n\n var volNorm = Math.max(Math.min(volume / this.volMax, 1), 0);\n this.port.postMessage({\n name: \'amplitude\',\n volume: volume,\n volNorm: volNorm,\n stereoVol: this.stereoVol,\n stereoVolNorm: this.stereoVolNorm\n }); // pass input through to output\n\n this.outputRingBuffer.push(this.inputRingBufferArraySequence);\n } // pull 128 frames out of the ring buffer\n // if the ring buffer does not have enough frames, the output will be silent\n\n\n this.outputRingBuffer.pull(output);\n return true;\n }\n }]);\n\n return AmplitudeProcessor;\n}(_wrapNativeSuper(AudioWorkletProcessor));\n\nregisterProcessor(processorNames.amplitudeProcessor, AmplitudeProcessor);'},function(t,e,n){var i,r;i=[n(0),n(17)],void 0===(r=function(r){r.Frequency=function(t,e){if(!(this instanceof r.Frequency))return new r.Frequency(t,e);r.TimeBase.call(this,t,e)},r.extend(r.Frequency,r.TimeBase),r.Frequency.prototype._primaryExpressions=Object.create(r.TimeBase.prototype._primaryExpressions),r.Frequency.prototype._primaryExpressions.midi={regexp:/^(\d+(?:\.\d+)?midi)/,method:function(t){return this.midiToFrequency(t)}},r.Frequency.prototype._primaryExpressions.note={regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(t,e){var n=i[t.toLowerCase()]+12*(parseInt(e)+1);return this.midiToFrequency(n)}},r.Frequency.prototype._primaryExpressions.tr={regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,n){var i=1;return t&&"0"!==t&&(i*=this._beatsToUnits(this._timeSignature()*parseFloat(t))),e&&"0"!==e&&(i*=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(i*=this._beatsToUnits(parseFloat(n)/4)),i}},r.Frequency.prototype.transpose=function(t){return this._expr=function(t,e){return t()*this.intervalToFrequencyRatio(e)}.bind(this,this._expr,t),this},r.Frequency.prototype.harmonize=function(t){return this._expr=function(t,e){for(var n=t(),i=[],r=0;rthis.buffer.duration)throw"jump time out of range";if(e>this.buffer.duration-t)throw"end time out of range";var n=t||0,i=e||void 0;this.isPlaying()&&(this.stop(0),this.play(0,this.playbackRate,this.output.gain.value,n,i))}},{key:"channels",value:function(){return this.buffer.numberOfChannels}},{key:"sampleRate",value:function(){return this.buffer.sampleRate}},{key:"frames",value:function(){return this.buffer.length}},{key:"getPeaks",value: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,n=e.length/t,i=~~(n/10)||1,r=e.numberOfChannels,o=new Float32Array(Math.round(t)),s=0;so[u])&&(o[u]=h)}return o}}},{key:"reverseBuffer",value:function(){if(!this.buffer)throw"SoundFile is not done loading";var t=this._lastPos/R.sampleRate,e=this.getVolume();this.setVolume(0,.001);for(var n=this.buffer.numberOfChannels,i=0;it[o].hi&&o++,r[o]=void 0!==r[o]?(r[o]+n[s])/2:n[s]}return r}},{key:"getOctaveBands",value:function(t,e){var n=t||3,i=e||15.625,r=[],o={lo:i/Math.pow(2,1/(2*n)),ctr:i,hi:i*Math.pow(2,1/(2*n))};r.push(o);for(var s=p.audiocontext.sampleRate/2;o.hi=this._maxDelay)throw new Error("Delay Time exceeds maximum delay time of "+this._maxDelay+" second.");t.connect(this.input),this.leftDelay.delayTime.setValueAtTime(o,this.ac.currentTime),this.rightDelay.delayTime.setValueAtTime(o,this.ac.currentTime),this._leftGain.gain.value=r,this._rightGain.gain.value=r,i&&(this._leftFilter.freq(i),this._rightFilter.freq(i))}},{key:"delayTime",value: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))}},{key:"feedback",value:function(t){if(t&&"number"!=typeof t)t.connect(this._leftGain.gain),t.connect(this._rightGain.gain);else{if(1<=t)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}},{key:"filter",value:function(t,e){this._leftFilter.set(t,e),this._rightFilter.set(t,e)}},{key:"setType",value: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)}}},{key:"dispose",value:function(){de(ye(e.prototype),"dispose",this).call(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}}]),e}();function _e(t){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ge(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function be(t,e){for(var n=0;nthis.length&&(this.length=i.sequence.length)}},{key:"removePhrase",value:function(t){for(var e in this.phrases)this.phrases[e].name===t&&this.phrases.splice(e,1)}},{key:"getPhrase",value:function(t){for(var e in this.phrases)if(this.phrases[e].name===t)return this.phrases[e]}},{key:"replaceSequence",value:function(t,e){for(var n in this.phrases)this.phrases[n].name===t&&(this.phrases[n].sequence=e)}},{key:"incrementStep",value:function(t){this.partStep=t.parts.length?(t.scoreStep=0,t.onended()):(t.scoreStep=0,t.parts[t.currentPart-1].stop(),t.parts[t.currentPart].start())}function Ue(t,e){for(var n=0;nthis.cutoff&&e>this.threshold&&0this.treshold){this.isDetected=!0,this.callback?this.callback(this.energy):e&&e(this.energy);var n=this;setTimeout(function(){n.isDetected=!1},this.sensitivity)}this.penergy=this.energy}}]),r}();function xn(t,e){for(var n=0;ndescription of the canvas.

                          \n", - type: "String", - }, - { - name: "display", - description: "

                          either LABEL or FALLBACK.

                          \n", - type: "Constant", - optional: true, - }, - ], - class: "p5", - module: "Environment", - }, - describeElement: { - name: "describeElement", - params: [ - { - name: "name", - description: "

                          name of the element.

                          \n", - type: "String", - }, - { - name: "text", - description: "

                          description of the element.

                          \n", - type: "String", - }, - { - name: "display", - description: "

                          either LABEL or FALLBACK.

                          \n", - type: "Constant", - optional: true, - }, - ], - class: "p5", - module: "Environment", - }, - textOutput: { - name: "textOutput", - params: [ - { - name: "display", - description: "

                          either FALLBACK or LABEL.

                          \n", - type: "Constant", - optional: true, - }, - ], - class: "p5", - module: "Environment", - }, - gridOutput: { - name: "gridOutput", - params: [ - { - name: "display", - description: "

                          either FALLBACK or LABEL.

                          \n", - type: "Constant", - optional: true, - }, - ], - class: "p5", - module: "Environment", - }, - alpha: { - name: "alpha", - params: [ - { - name: "color", - description: - '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - class: "p5", - module: "Color", - }, - blue: { - name: "blue", - params: [ - { - name: "color", - description: - '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - class: "p5", - module: "Color", - }, - brightness: { - name: "brightness", - params: [ - { - name: "color", - description: - '

                          p5.Color object, array of\n color components, or CSS color string.

                          \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: true, - }, - ], - }, - { - 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: true, - }, - ], - }, - { - 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, array of\n color components, or CSS color string.

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - class: "p5", - module: "Color", - }, - hue: { - name: "hue", - params: [ - { - name: "color", - description: - '

                          p5.Color object, array of\n color components, or CSS color string.

                          \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, array of\n color components, or CSS color string.

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - class: "p5", - module: "Color", - }, - red: { - name: "red", - params: [ - { - name: "color", - description: - '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - class: "p5", - module: "Color", - }, - saturation: { - name: "saturation", - params: [ - { - name: "color", - description: - '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - class: "p5", - module: "Color", - }, - beginClip: { - name: "beginClip", - params: [ - { - name: "options", - description: "

                          An object containing clip settings.

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5", - module: "Color", - }, - endClip: { - name: "endClip", - class: "p5", - module: "Color", - }, - clip: { - name: "clip", - params: [ - { - name: "callback", - description: - "

                          A function that draws the mask shape.

                          \n", - type: "Function", - }, - { - name: "options", - description: "

                          An object containing clip settings.

                          \n", - type: "Object", - optional: true, - }, - ], - 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: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "gray", - description: - "

                          specifies a value between white and black.

                          \n", - type: "Number", - }, - { - name: "a", - description: "", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v1", - description: - "

                          red value if color mode is RGB, or hue value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green value if color mode is RGB, or saturation value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue value if color mode is RGB, or brightness value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "a", - description: "", - type: "Number", - optional: true, - }, - ], - 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()\n 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: true, - }, - ], - chainable: 1, - }, - ], - }, - clear: { - name: "clear", - params: [ - { - name: "r", - description: "

                          normalized red value.

                          \n", - type: "Number", - }, - { - name: "g", - description: "

                          normalized green value.

                          \n", - type: "Number", - }, - { - name: "b", - description: "

                          normalized blue value.

                          \n", - type: "Number", - }, - { - name: "a", - description: "

                          normalized alpha value.

                          \n", - type: "Number", - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - chainable: 1, - }, - ], - }, - fill: { - name: "fill", - class: "p5", - module: "Color", - overloads: [ - { - params: [ - { - name: "v1", - description: - "

                          red value if color mode is RGB or hue value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green value if color mode is RGB or saturation value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue value if color mode is RGB or brightness value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "value", - description: "

                          a color string.

                          \n", - type: "String", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "gray", - description: "

                          a grayscale value.

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - 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 value if color mode is RGB or hue value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green value if color mode is RGB or saturation value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue value if color mode is RGB or brightness value if color mode is HSB.

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "value", - description: "

                          a color string.

                          \n", - type: "String", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "gray", - description: "

                          a grayscale value.

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - 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 under a shape's interior.\n Defaults to 255, which is full strength.

                          \n", - type: "Number", - optional: true, - }, - { - name: "strengthStroke", - description: - "

                          a number (0-255) for the strength of erasing under a shape's edge.\n Defaults to 255, which is full strength.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - 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. Won't\n draw a stroke for a detail of more than 50.

                          \n", - type: "Integer", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - ellipse: { - name: "ellipse", - class: "p5", - module: "Shape", - overloads: [ - { - params: [ - { - name: "x", - description: - "

                          x-coordinate of the center of the ellipse.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          y-coordinate of the center of the 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: true, - }, - ], - 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: - "

                          optional parameter for WebGL mode only. This is to\n specify the number of vertices that makes up the\n perimeter of the ellipse. Default value is 25. Won't\n draw a stroke for a detail of more than 50.

                          \n", - type: "Integer", - optional: true, - }, - ], - }, - ], - }, - circle: { - name: "circle", - params: [ - { - name: "x", - description: - "

                          x-coordinate of the center of the circle.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          y-coordinate of the center 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: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "coordinateVector", - 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", - }, - { - name: "detailX", - description: - "

                          number of segments in the x-direction.

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          number of segments in the y-direction.

                          \n", - type: "Integer", - optional: true, - }, - ], - 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", - }, - { - name: "detailX", - description: "", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: "", - type: "Integer", - optional: true, - }, - ], - 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: true, - }, - { - name: "tl", - description: - "

                          optional radius of top-left corner.

                          \n", - type: "Number", - optional: true, - }, - { - name: "tr", - description: - "

                          optional radius of top-right corner.

                          \n", - type: "Number", - optional: true, - }, - { - name: "br", - description: - "

                          optional radius of bottom-right corner.

                          \n", - type: "Number", - optional: true, - }, - { - name: "bl", - description: - "

                          optional radius of bottom-left corner.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "detailY", - description: - "

                          number of segments in the y-direction (for WebGL mode).

                          \n", - type: "Integer", - optional: true, - }, - ], - 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: true, - }, - { - name: "tr", - description: - "

                          optional radius of top-right corner.

                          \n", - type: "Number", - optional: true, - }, - { - name: "br", - description: - "

                          optional radius of bottom-right corner.

                          \n", - type: "Number", - optional: true, - }, - { - name: "bl", - description: - "

                          optional radius of bottom-left corner.

                          \n", - type: "Number", - optional: true, - }, - ], - 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, or 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - name: "count", - description: - "

                          number of times you want to draw/instance the shape (for WebGL mode).

                          \n", - type: "Integer", - optional: true, - }, - ], - 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 Defaults to 0 if not specified.

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "x", - description: "", - type: "Number", - }, - { - name: "y", - description: "", - type: "Number", - }, - { - name: "z", - description: "", - type: "Number", - optional: true, - }, - { - name: "u", - description: - "

                          the vertex's texture u-coordinate

                          \n", - type: "Number", - optional: true, - }, - { - name: "v", - description: - "

                          the vertex's texture v-coordinate

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - ], - }, - normal: { - name: "normal", - class: "p5", - module: "Shape", - overloads: [ - { - params: [ - { - name: "vector", - description: - "

                          A p5.Vector representing the vertex normal.

                          \n", - type: "Vector", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "x", - description: - "

                          The x component of the vertex normal.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          The y component of the vertex normal.

                          \n", - type: "Number", - }, - { - name: "z", - description: - "

                          The z component of the vertex normal.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - ], - }, - VERSION: { - name: "VERSION", - class: "p5", - module: "Constants", - }, - P2D: { - name: "P2D", - class: "p5", - module: "Constants", - }, - WEBGL: { - name: "WEBGL", - class: "p5", - module: "Constants", - }, - WEBGL2: { - name: "WEBGL2", - 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", - }, - CHAR: { - name: "CHAR", - class: "p5", - module: "Constants", - }, - WORD: { - name: "WORD", - 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", - }, - FLAT: { - name: "FLAT", - class: "p5", - module: "Constants", - }, - SMOOTH: { - name: "SMOOTH", - 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", - }, - LABEL: { - name: "LABEL", - class: "p5", - module: "Constants", - }, - FALLBACK: { - name: "FALLBACK", - class: "p5", - module: "Constants", - }, - CONTAIN: { - name: "CONTAIN", - class: "p5", - module: "Constants", - }, - COVER: { - name: "COVER", - class: "p5", - module: "Constants", - }, - UNSIGNED_BYTE: { - name: "UNSIGNED_BYTE", - class: "p5", - module: "Constants", - }, - UNSIGNED_INT: { - name: "UNSIGNED_INT", - class: "p5", - module: "Constants", - }, - FLOAT: { - name: "FLOAT", - class: "p5", - module: "Constants", - }, - HALF_FLOAT: { - name: "HALF_FLOAT", - class: "p5", - module: "Constants", - }, - RGBA: { - name: "RGBA", - class: "p5", - module: "Constants", - }, - print: { - name: "print", - params: [ - { - name: "contents", - description: "

                          content to print to the console.

                          \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, or WAIT.\n Native CSS properties: 'grab', 'progress', and so on.\n Path to cursor image.

                          \n", - type: "String|Constant", - }, - { - name: "x", - description: - "

                          horizontal active spot of the cursor.

                          \n", - type: "Number", - optional: true, - }, - { - name: "y", - description: "

                          vertical active spot of the cursor.

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "Environment", - }, - frameRate: { - name: "frameRate", - class: "p5", - module: "Environment", - overloads: [ - { - params: [ - { - name: "fps", - description: - "

                          number of frames to draw per second.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [], - }, - ], - }, - getTargetFrameRate: { - name: "getTargetFrameRate", - class: "p5", - module: "Environment", - }, - noCursor: { - name: "noCursor", - class: "p5", - module: "Environment", - }, - webglVersion: { - name: "webglVersion", - 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", - params: [ - { - name: "event", - description: "

                          optional resize Event.

                          \n", - type: "UIEvent", - optional: true, - }, - ], - 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.

                          \n", - type: "Boolean", - optional: true, - }, - ], - class: "p5", - module: "Environment", - }, - pixelDensity: { - name: "pixelDensity", - class: "p5", - module: "Environment", - overloads: [ - { - params: [ - { - name: "val", - description: "

                          desired pixel density.

                          \n", - type: "Number", - optional: true, - }, - ], - 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", - class: "p5", - module: "Rendering", - overloads: [ - { - 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: true, - }, - { - name: "canvas", - description: "

                          existing html canvas element

                          \n", - type: "HTMLCanvasElement", - optional: true, - }, - ], - }, - { - params: [ - { - name: "w", - description: "", - type: "Number", - }, - { - name: "h", - description: "", - type: "Number", - }, - { - name: "canvas", - description: "", - type: "HTMLCanvasElement", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - ], - class: "p5", - module: "Rendering", - }, - noCanvas: { - name: "noCanvas", - class: "p5", - module: "Rendering", - }, - createGraphics: { - name: "createGraphics", - class: "p5", - module: "Rendering", - overloads: [ - { - 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: true, - }, - { - name: "canvas", - description: "

                          existing html canvas element

                          \n", - type: "HTMLCanvasElement", - optional: true, - }, - ], - }, - { - params: [ - { - name: "w", - description: "", - type: "Number", - }, - { - name: "h", - description: "", - type: "Number", - }, - { - name: "canvas", - description: "", - type: "HTMLCanvasElement", - optional: true, - }, - ], - }, - ], - }, - createFramebuffer: { - name: "createFramebuffer", - params: [ - { - name: "options", - description: - "

                          An optional object with configuration

                          \n", - type: "Object", - optional: true, - }, - ], - 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: true, - }, - ], - 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", - class: "p5", - module: "Transform", - overloads: [ - { - params: [ - { - name: "arr", - description: - "

                          an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values)

                          \n", - type: "Array", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "a", - description: - "

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "b", - description: - "

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "c", - description: - "

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "d", - description: - "

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "e", - description: - "

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "f", - description: - "

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "a", - description: "", - type: "Number", - }, - { - name: "b", - description: "", - type: "Number", - }, - { - name: "c", - description: "", - type: "Number", - }, - { - name: "d", - description: "", - type: "Number", - }, - { - name: "e", - description: "", - type: "Number", - }, - { - name: "f", - description: "", - type: "Number", - }, - { - name: "g", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "h", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "i", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "j", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "k", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "l", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "m", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "n", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "o", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - { - name: "p", - description: - "

                          numbers which define the 4×4 matrix to be multiplied

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - ], - }, - 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: true, - }, - ], - 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: true, - }, - { - name: "z", - description: - "

                          percent to scale the object in the z-axis (webgl only)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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 HTMLElement to search within.

                          \n', - type: "String|p5.Element|HTMLElement", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - selectAll: { - name: "selectAll", - 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 HTMLElement to search within.

                          \n', - type: "String|p5.Element|HTMLElement", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - removeElements: { - name: "removeElements", - class: "p5", - module: "DOM", - }, - changed: { - name: "changed", - params: [ - { - name: "fxn", - description: - "

                          function to call when the element changes.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5", - module: "DOM", - }, - input: { - name: "input", - params: [ - { - name: "fxn", - description: - "

                          function to call when input is detected within\n the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5", - module: "DOM", - }, - createDiv: { - name: "createDiv", - params: [ - { - name: "html", - description: - "

                          inner HTML for the new <div></div> element.

                          \n", - type: "String", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createP: { - name: "createP", - params: [ - { - name: "html", - description: - "

                          inner HTML for the new <p></p> element.

                          \n", - type: "String", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createSpan: { - name: "createSpan", - params: [ - { - name: "html", - description: - "

                          inner HTML for the new <span></span> element.

                          \n", - type: "String", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createImg: { - name: "createImg", - class: "p5", - module: "DOM", - overloads: [ - { - params: [ - { - name: "src", - description: - "

                          relative path or URL for the image.

                          \n", - type: "String", - }, - { - name: "alt", - description: "

                          alternate text for the image.

                          \n", - type: "String", - }, - ], - }, - { - params: [ - { - name: "src", - description: "", - type: "String", - }, - { - name: "alt", - description: "", - type: "String", - }, - { - name: "crossOrigin", - description: - "

                          crossOrigin property to use when fetching the image.

                          \n", - type: "String", - optional: true, - }, - { - name: "successCallback", - description: - '

                          function to call once the image loads. The new image will be passed\n to the function as a p5.Element object.

                          \n', - type: "Function", - optional: true, - }, - ], - }, - ], - }, - createA: { - name: "createA", - params: [ - { - name: "href", - description: "

                          URL of linked page.

                          \n", - type: "String", - }, - { - name: "html", - description: - "

                          inner HTML of link element to display.

                          \n", - type: "String", - }, - { - name: "target", - description: - "

                          target where the new link should open,\n either '_blank', '_self', '_parent', or '_top'.

                          \n", - type: "String", - optional: true, - }, - ], - 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: true, - }, - { - name: "step", - description: - "

                          size for each step in the slider's range.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - class: "p5", - module: "DOM", - }, - createCheckbox: { - name: "createCheckbox", - params: [ - { - name: "label", - description: "

                          label displayed after the checkbox.

                          \n", - type: "String", - optional: true, - }, - { - name: "value", - description: - "

                          value of the checkbox. Checked is true and unchecked is false.

                          \n", - type: "Boolean", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createSelect: { - name: "createSelect", - class: "p5", - module: "DOM", - overloads: [ - { - params: [ - { - name: "multiple", - description: "

                          support multiple selections.

                          \n", - type: "Boolean", - optional: true, - }, - ], - }, - { - params: [ - { - name: "existing", - description: - '

                          select element to wrap, either as a p5.Element or\n a HTMLSelectElement.

                          \n', - type: "Object", - }, - ], - }, - ], - }, - createRadio: { - name: "createRadio", - class: "p5", - module: "DOM", - overloads: [ - { - params: [ - { - name: "containerElement", - description: - "

                          container HTML Element, either a <div></div>\nor <span></span>.

                          \n", - type: "Object", - optional: true, - }, - ], - }, - { - params: [ - { - name: "name", - description: - "

                          name parameter assigned to each option's <input></input> element.

                          \n", - type: "String", - optional: true, - }, - ], - }, - { - params: [], - }, - ], - }, - createColorPicker: { - name: "createColorPicker", - params: [ - { - name: "value", - description: - '

                          default color as a CSS color string.

                          \n', - type: "String|p5.Color", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createInput: { - name: "createInput", - class: "p5", - module: "DOM", - overloads: [ - { - params: [ - { - name: "value", - description: - "

                          default value of the input box. Defaults to an empty string ''.

                          \n", - type: "String", - optional: true, - }, - { - name: "type", - description: - "

                          type of input. Defaults to 'text'.

                          \n", - type: "String", - optional: true, - }, - ], - }, - { - params: [ - { - name: "value", - description: "", - type: "String", - optional: true, - }, - ], - }, - ], - }, - createFileInput: { - name: "createFileInput", - params: [ - { - name: "callback", - description: - "

                          function to call once the file loads.

                          \n", - type: "Function", - }, - { - name: "multiple", - description: - "

                          allow multiple files to be selected.

                          \n", - type: "Boolean", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createVideo: { - name: "createVideo", - params: [ - { - name: "src", - description: - "

                          path to a video file, or an array of paths for\n supporting different browsers.

                          \n", - type: "String|String[]", - }, - { - name: "callback", - description: - "

                          function to call once the video is ready to play.

                          \n", - type: "Function", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createAudio: { - name: "createAudio", - params: [ - { - name: "src", - description: - "

                          path to an audio file, or an array of paths\n for supporting different browsers.

                          \n", - type: "String|String[]", - optional: true, - }, - { - name: "callback", - description: - "

                          function to call once the audio is ready to play.

                          \n", - type: "Function", - optional: true, - }, - ], - class: "p5", - module: "DOM", - }, - createCapture: { - name: "createCapture", - params: [ - { - name: "type", - description: - "

                          type of capture, either AUDIO or VIDEO,\n or a constraints object. Both video and audio\n audio streams are captured by default.

                          \n", - type: "String|Constant|Object", - optional: true, - }, - { - name: "callback", - description: - "

                          function to call once the stream\n has loaded.

                          \n", - type: "Function", - optional: true, - }, - ], - 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 insert into the element.

                          \n", - type: "String", - optional: true, - }, - ], - 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", - params: [ - { - name: "event", - description: - "

                          optional KeyboardEvent callback argument.

                          \n", - type: "KeyboardEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - keyReleased: { - name: "keyReleased", - params: [ - { - name: "event", - description: - "

                          optional KeyboardEvent callback argument.

                          \n", - type: "KeyboardEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - keyTyped: { - name: "keyTyped", - params: [ - { - name: "event", - description: - "

                          optional KeyboardEvent callback argument.

                          \n", - type: "KeyboardEvent", - optional: true, - }, - ], - 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: "MouseEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - mouseDragged: { - name: "mouseDragged", - params: [ - { - name: "event", - description: - "

                          optional MouseEvent callback argument.

                          \n", - type: "MouseEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - mousePressed: { - name: "mousePressed", - params: [ - { - name: "event", - description: - "

                          optional MouseEvent callback argument.

                          \n", - type: "MouseEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - mouseReleased: { - name: "mouseReleased", - params: [ - { - name: "event", - description: - "

                          optional MouseEvent callback argument.

                          \n", - type: "MouseEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - mouseClicked: { - name: "mouseClicked", - params: [ - { - name: "event", - description: - "

                          optional MouseEvent callback argument.

                          \n", - type: "MouseEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - doubleClicked: { - name: "doubleClicked", - params: [ - { - name: "event", - description: - "

                          optional MouseEvent callback argument.

                          \n", - type: "MouseEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - mouseWheel: { - name: "mouseWheel", - params: [ - { - name: "event", - description: - "

                          optional WheelEvent callback argument.

                          \n", - type: "WheelEvent", - optional: true, - }, - ], - 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: "TouchEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - touchMoved: { - name: "touchMoved", - params: [ - { - name: "event", - description: - "

                          optional TouchEvent callback argument.

                          \n", - type: "TouchEvent", - optional: true, - }, - ], - class: "p5", - module: "Events", - }, - touchEnded: { - name: "touchEnded", - params: [ - { - name: "event", - description: - "

                          optional TouchEvent callback argument.

                          \n", - type: "TouchEvent", - optional: true, - }, - ], - 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: - "

                          reference to a\n specific HTML5 canvas element.

                          \n", - type: "p5.Framebuffer|p5.Element|HTMLCanvasElement", - }, - { - name: "filename", - description: - "

                          file name. Defaults to 'untitled'.

                          \n", - type: "String", - optional: true, - }, - { - name: "extension", - description: - "

                          file extension, either 'jpg' or 'png'. Defaults to 'png'.

                          \n", - type: "String", - optional: true, - }, - ], - }, - { - params: [ - { - name: "filename", - description: "", - type: "String", - optional: true, - }, - { - name: "extension", - description: "", - type: "String", - optional: true, - }, - ], - }, - ], - }, - saveFrames: { - name: "saveFrames", - params: [ - { - name: "filename", - description: "

                          prefix of file name.

                          \n", - type: "String", - }, - { - name: "extension", - description: - "

                          file extension, either 'jpg' or 'png'.

                          \n", - type: "String", - }, - { - name: "duration", - description: - "

                          duration in seconds to record. This parameter will be constrained to be less or equal to 15.

                          \n", - type: "Number", - }, - { - name: "framerate", - description: - "

                          number of frames to save per second. This parameter will be constrained to be less or equal to 22.

                          \n", - type: "Number", - }, - { - name: "callback", - description: - "

                          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, filename, and extension.

                          \n", - type: "Function(Array)", - optional: true, - }, - ], - class: "p5", - module: "Image", - }, - loadImage: { - name: "loadImage", - params: [ - { - name: "path", - description: - "

                          path of the image to be loaded or base64 encoded image.

                          \n", - type: "String", - }, - { - name: "successCallback", - description: - '

                          function called with\n p5.Image once it\n loads.

                          \n', - type: "function(p5.Image)", - optional: true, - }, - { - name: "failureCallback", - description: - "

                          function called with event\n error if the image fails to load.

                          \n", - type: "Function(Event)", - optional: true, - }, - ], - class: "p5", - module: "Image", - }, - saveGif: { - name: "saveGif", - params: [ - { - name: "filename", - description: "

                          file name of gif.

                          \n", - type: "String", - }, - { - name: "duration", - description: - "

                          duration in seconds to capture from the sketch.

                          \n", - type: "Number", - }, - { - name: "options", - description: - "

                          an object that can contain five more properties:\n delay, a Number specifying how much time to wait before recording;\n units, a String that can be either 'seconds' or 'frames'. By default it's 'seconds’;\n silent, a Boolean that defines presence of progress notifications. By default it’s false;\n notificationDuration, a Number that defines how long in seconds the final notification\n will live. By default it's 0, meaning the notification will never be removed;\n notificationID, a String that specifies the id of the notification's DOM element. By default it’s 'progressBar’.

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5", - module: "Image", - }, - image: { - name: "image", - class: "p5", - module: "Image", - overloads: [ - { - params: [ - { - name: "img", - description: "

                          image to display.

                          \n", - type: "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", - }, - { - name: "x", - description: - "

                          x-coordinate of the top-left corner of the image.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          y-coordinate of the top-left corner of the image.

                          \n", - type: "Number", - }, - { - name: "width", - description: "

                          width to draw the image.

                          \n", - type: "Number", - optional: true, - }, - { - name: "height", - description: "

                          height to draw the image.

                          \n", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "img", - description: "", - type: "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", - }, - { - 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: true, - }, - { - name: "sHeight", - description: - "

                          the height of the subsection of the\n source image to draw into the destination rectangle

                          \n", - type: "Number", - optional: true, - }, - { - name: "fit", - description: "

                          either CONTAIN or COVER

                          \n", - type: "Constant", - optional: true, - }, - { - name: "xAlign", - description: - "

                          either LEFT, RIGHT or CENTER default is CENTER

                          \n", - type: "Constant", - optional: true, - }, - { - name: "yAlign", - description: - "

                          either TOP, BOTTOM or CENTER default is CENTER

                          \n", - type: "Constant", - optional: true, - }, - ], - }, - ], - }, - tint: { - name: "tint", - class: "p5", - module: "Image", - overloads: [ - { - params: [ - { - name: "v1", - description: "

                          red or hue value.

                          \n", - type: "Number", - }, - { - name: "v2", - description: "

                          green or saturation value.

                          \n", - type: "Number", - }, - { - name: "v3", - description: "

                          blue or brightness.

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "value", - description: "

                          CSS color string.

                          \n", - type: "String", - }, - ], - }, - { - params: [ - { - name: "gray", - description: "

                          grayscale value.

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "values", - description: - "

                          array containing the red, green, blue &\n 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", - class: "p5", - module: "Image", - overloads: [ - { - params: [ - { - name: "filterType", - description: - "

                          either THRESHOLD, GRAY, OPAQUE, INVERT,\n POSTERIZE, BLUR, ERODE, DILATE or BLUR.

                          \n", - type: "Constant", - }, - { - name: "filterParam", - description: - "

                          parameter unique to each filter.

                          \n", - type: "Number", - optional: true, - }, - { - name: "useWebGL", - description: - "

                          flag to control whether to use fast\n WebGL filters (GPU) or original image\n filters (CPU); defaults to true.

                          \n", - type: "Boolean", - optional: true, - }, - ], - }, - { - params: [ - { - name: "filterType", - description: "", - type: "Constant", - }, - { - name: "useWebGL", - description: "", - type: "Boolean", - optional: true, - }, - ], - }, - { - params: [ - { - name: "shaderFilter", - description: - "

                          shader that's been loaded, with the\n frag shader using a tex0 uniform.

                          \n", - type: "p5.Shader", - }, - ], - }, - ], - }, - 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 of the subsection to be returned.

                          \n", - type: "Number", - }, - { - name: "h", - description: - "

                          height of the subsection to be returned.

                          \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: - '

                          grayscale value | pixel array |\n p5.Color object | 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: true, - }, - { - name: "y", - description: - "

                          y-coordinate of the upper-left corner of region\n to update.

                          \n", - type: "Number", - optional: true, - }, - { - name: "w", - description: "

                          width of region to update.

                          \n", - type: "Number", - optional: true, - }, - { - name: "h", - description: "

                          height of region to update.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "datatype", - description: '

                          "json" or "jsonp"

                          \n', - type: "String", - optional: true, - }, - { - name: "callback", - description: - '

                          function to be executed after\n loadJSON() completes, data is passed\n in as first argument

                          \n', - type: "Function", - optional: true, - }, - { - 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: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "datatype", - description: "", - type: "String", - }, - { - name: "callback", - description: "", - type: "Function", - optional: true, - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "callback", - description: "", - type: "Function", - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - { - name: "header", - description: - '

                          "header" to indicate table has header row

                          \n', - type: "String", - optional: true, - }, - { - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - { - name: "errorCallback", - description: - "

                          function to be executed if there\n is an error

                          \n", - type: "Function", - optional: true, - }, - ], - 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: true, - }, - { - name: "data", - description: - "

                          param data passed sent with request

                          \n", - type: "Object|Boolean", - optional: true, - }, - { - name: "callback", - description: - '

                          function to be executed after\n httpGet() completes, data is passed in\n as first argument

                          \n', - type: "Function", - optional: true, - }, - { - 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: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "data", - description: "", - type: "Object|Boolean", - }, - { - name: "callback", - description: "", - type: "Function", - optional: true, - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "callback", - description: "", - type: "Function", - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - { - name: "data", - description: - "

                          param data passed sent with request

                          \n", - type: "Object|Boolean", - optional: true, - }, - { - name: "callback", - description: - '

                          function to be executed after\n httpPost() completes, data is passed in\n as first argument

                          \n', - type: "Function", - optional: true, - }, - { - 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: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "data", - description: "", - type: "Object|Boolean", - }, - { - name: "callback", - description: "", - type: "Function", - optional: true, - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "callback", - description: "", - type: "Function", - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - { - name: "datatype", - description: - '

                          "json", "jsonp", "xml", or "text"

                          \n', - type: "String", - optional: true, - }, - { - name: "data", - description: - "

                          param data passed sent with request

                          \n", - type: "Object", - optional: true, - }, - { - name: "callback", - description: - '

                          function to be executed after\n httpGet() completes, data is passed in\n as first argument

                          \n', - type: "Function", - optional: true, - }, - { - 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: true, - }, - ], - }, - { - 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: true, - }, - { - name: "errorCallback", - description: "", - type: "Function", - optional: true, - }, - ], - }, - ], - }, - createWriter: { - name: "createWriter", - params: [ - { - name: "name", - description: "

                          name of the file to be created

                          \n", - type: "String", - }, - { - name: "extension", - description: "", - type: "String", - optional: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - name: "isCRLF", - description: "

                          if true, change line-break to CRLF

                          \n", - type: "Boolean", - optional: true, - }, - ], - 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: true, - }, - ], - 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: "x", - description: "

                          first component.

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          second component.

                          \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: true, - }, - ], - class: "p5", - module: "Math", - }, - max: { - name: "max", - class: "p5", - module: "Math", - overloads: [ - { - params: [ - { - name: "n0", - description: "

                          first number to compare.

                          \n", - type: "Number", - }, - { - name: "n1", - description: "

                          second 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: "

                          first number to compare.

                          \n", - type: "Number", - }, - { - name: "n1", - description: "

                          second 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: true, - }, - ], - 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: "n", - description: - "

                          number whose fractional part will be found.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - createVector: { - name: "createVector", - params: [ - { - name: "x", - description: "

                          x component of the vector.

                          \n", - type: "Number", - optional: true, - }, - { - name: "y", - description: "

                          y component of the vector.

                          \n", - type: "Number", - optional: true, - }, - { - name: "z", - description: "

                          z component of the vector.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "z", - description: "

                          z-coordinate in noise space.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: "

                          seed value.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - randomSeed: { - name: "randomSeed", - params: [ - { - name: "seed", - description: "

                          seed value.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - random: { - name: "random", - class: "p5", - module: "Math", - overloads: [ - { - params: [ - { - name: "min", - description: "

                          lower bound (inclusive).

                          \n", - type: "Number", - optional: true, - }, - { - name: "max", - description: "

                          upper bound (exclusive).

                          \n", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "choices", - description: "

                          array to choose from.

                          \n", - type: "Array", - }, - ], - }, - ], - }, - randomGaussian: { - name: "randomGaussian", - params: [ - { - name: "mean", - description: "

                          mean.

                          \n", - type: "Number", - optional: true, - }, - { - name: "sd", - description: "

                          standard deviation.

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "Math", - }, - acos: { - name: "acos", - params: [ - { - name: "value", - description: - "

                          value whose arc cosine is to be returned.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - asin: { - name: "asin", - params: [ - { - name: "value", - description: - "

                          value whose arc sine is to be returned.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - atan: { - name: "atan", - params: [ - { - name: "value", - description: - "

                          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: - "

                          radians value to convert to degrees.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - radians: { - name: "radians", - params: [ - { - name: "degrees", - description: "

                          degree value to convert to radians.

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "Math", - }, - angleMode: { - name: "angleMode", - class: "p5", - module: "Math", - overloads: [ - { - params: [ - { - name: "mode", - description: "

                          either RADIANS or DEGREES.

                          \n", - type: "Constant", - }, - ], - }, - { - params: [], - }, - ], - }, - 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: true, - }, - ], - chainable: 1, - }, - { - params: [], - }, - ], - }, - textLeading: { - name: "textLeading", - class: "p5", - module: "Typography", - overloads: [ - { - params: [ - { - name: "leading", - description: - "

                          spacing between lines of text in units of pixels.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [], - }, - ], - }, - textSize: { - name: "textSize", - class: "p5", - module: "Typography", - overloads: [ - { - params: [ - { - name: "size", - description: - "

                          size of the letters in units of pixels

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [], - }, - ], - }, - textStyle: { - name: "textStyle", - class: "p5", - module: "Typography", - overloads: [ - { - params: [ - { - name: "style", - description: - "

                          styling for text, either NORMAL,\n ITALIC, BOLD or BOLDITALIC

                          \n", - type: "Constant", - }, - ], - chainable: 1, - }, - { - params: [], - }, - ], - }, - textWidth: { - name: "textWidth", - params: [ - { - name: "str", - description: "

                          string of text to measure.

                          \n", - type: "String", - }, - ], - class: "p5", - module: "Typography", - }, - textAscent: { - name: "textAscent", - class: "p5", - module: "Typography", - }, - textDescent: { - name: "textDescent", - class: "p5", - module: "Typography", - }, - textWrap: { - name: "textWrap", - params: [ - { - name: "style", - description: - "

                          text wrapping style, either WORD or CHAR.

                          \n", - type: "Constant", - }, - ], - class: "p5", - module: "Typography", - }, - loadFont: { - name: "loadFont", - params: [ - { - name: "path", - description: "

                          path of the font to be loaded.

                          \n", - type: "String", - }, - { - name: "successCallback", - description: - '

                          function called with the\n p5.Font object after it\n loads.

                          \n', - type: "Function", - optional: true, - }, - { - name: "failureCallback", - description: - '

                          function called with the error\n Event\n object if the font fails to load.

                          \n', - type: "Function", - optional: true, - }, - ], - class: "p5", - module: "Typography", - }, - text: { - name: "text", - params: [ - { - name: "str", - description: "

                          text to be displayed.

                          \n", - type: "String|Object|Array|Number|Boolean", - }, - { - name: "x", - description: "

                          x-coordinate of the text box.

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y-coordinate of the text box.

                          \n", - type: "Number", - }, - { - name: "maxWidth", - description: - '

                          maximum width of the text box. See\n rectMode() for\n other options.

                          \n', - type: "Number", - optional: true, - }, - { - name: "maxHeight", - description: - '

                          maximum height of the text box. See\n rectMode() for\n other options.

                          \n', - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "Typography", - }, - textFont: { - name: "textFont", - class: "p5", - module: "Typography", - overloads: [ - { - params: [], - }, - { - params: [ - { - name: "font", - description: - '

                          font as a p5.Font object or a string.

                          \n', - type: "Object|String", - }, - { - name: "size", - description: "

                          font size in pixels.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - }, - ], - }, - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - }, - { - params: [ - { - name: "ns", - description: "

                          values to parse

                          \n", - type: "Array", - }, - { - name: "radix", - description: "", - type: "Integer", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - ], - }, - { - params: [ - { - name: "ns", - description: "

                          array of values to parse

                          \n", - type: "Number[]", - }, - { - name: "digits", - description: "", - type: "Number", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - { - name: "right", - description: - "

                          number of digits to the right of the\n decimal point

                          \n", - type: "Integer|String", - optional: true, - }, - ], - }, - { - params: [ - { - name: "nums", - description: "

                          the Numbers to format

                          \n", - type: "Array", - }, - { - name: "left", - description: "", - type: "Integer|String", - optional: true, - }, - { - name: "right", - description: "", - type: "Integer|String", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - ], - }, - { - params: [ - { - name: "nums", - description: "

                          the Numbers to format

                          \n", - type: "Array", - }, - { - name: "right", - description: "", - type: "Integer|String", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - { - name: "right", - description: - "

                          number of digits to the right of the\n decimal point

                          \n", - type: "Integer", - optional: true, - }, - ], - }, - { - params: [ - { - name: "nums", - description: "

                          the Numbers to format

                          \n", - type: "Number[]", - }, - { - name: "left", - description: "", - type: "Integer", - optional: true, - }, - { - name: "right", - description: "", - type: "Integer", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - { - name: "right", - description: - "

                          number of digits to the right of the\n decimal point

                          \n", - type: "Integer", - optional: true, - }, - ], - }, - { - params: [ - { - name: "nums", - description: "

                          the Numbers to format

                          \n", - type: "Array", - }, - { - name: "left", - description: "", - type: "Integer", - optional: true, - }, - { - name: "right", - description: "", - type: "Integer", - optional: true, - }, - ], - }, - ], - }, - 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: true, - }, - ], - 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", - }, - beginGeometry: { - name: "beginGeometry", - class: "p5", - module: "Shape", - }, - endGeometry: { - name: "endGeometry", - class: "p5", - module: "Shape", - }, - buildGeometry: { - name: "buildGeometry", - params: [ - { - name: "callback", - description: "

                          A function that draws shapes.

                          \n", - type: "Function", - }, - ], - class: "p5", - module: "Shape", - }, - freeGeometry: { - name: "freeGeometry", - params: [ - { - name: "geometry", - description: - "

                          The geometry whose resources should be freed

                          \n", - type: "p5.Geometry", - }, - ], - class: "p5", - module: "Shape", - }, - plane: { - name: "plane", - params: [ - { - name: "width", - description: "

                          width of the plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "height", - description: "

                          height of the plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "detailX", - description: - "

                          Optional number of triangle\n subdivisions in x-dimension

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          Optional number of triangle\n subdivisions in y-dimension

                          \n", - type: "Integer", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - box: { - name: "box", - params: [ - { - name: "width", - description: "

                          width of the box

                          \n", - type: "Number", - optional: true, - }, - { - name: "height", - description: "

                          height of the box

                          \n", - type: "Number", - optional: true, - }, - { - name: "depth", - description: "

                          depth of the box

                          \n", - type: "Number", - optional: true, - }, - { - name: "detailX", - description: - "

                          Optional number of triangle\n subdivisions in x-dimension

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          Optional number of triangle\n subdivisions in y-dimension

                          \n", - type: "Integer", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - sphere: { - name: "sphere", - params: [ - { - name: "radius", - description: "

                          radius of circle

                          \n", - type: "Number", - optional: true, - }, - { - name: "detailX", - description: - "

                          optional number of subdivisions in x-dimension

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          optional number of subdivisions in y-dimension

                          \n", - type: "Integer", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - cylinder: { - name: "cylinder", - params: [ - { - name: "radius", - description: "

                          radius of the surface

                          \n", - type: "Number", - optional: true, - }, - { - name: "height", - description: "

                          height of the cylinder

                          \n", - type: "Number", - optional: true, - }, - { - name: "detailX", - description: - "

                          number of subdivisions in x-dimension;\n default is 24

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          number of subdivisions in y-dimension;\n default is 1

                          \n", - type: "Integer", - optional: true, - }, - { - name: "bottomCap", - description: - "

                          whether to draw the bottom of the cylinder

                          \n", - type: "Boolean", - optional: true, - }, - { - name: "topCap", - description: - "

                          whether to draw the top of the cylinder

                          \n", - type: "Boolean", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - cone: { - name: "cone", - params: [ - { - name: "radius", - description: "

                          radius of the bottom surface

                          \n", - type: "Number", - optional: true, - }, - { - name: "height", - description: "

                          height of the cone

                          \n", - type: "Number", - optional: true, - }, - { - name: "detailX", - description: - "

                          number of segments,\n the more segments the smoother geometry\n default is 24

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          number of segments,\n the more segments the smoother geometry\n default is 1

                          \n", - type: "Integer", - optional: true, - }, - { - name: "cap", - description: - "

                          whether to draw the base of the cone

                          \n", - type: "Boolean", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - ellipsoid: { - name: "ellipsoid", - params: [ - { - name: "radiusx", - description: "

                          x-radius of ellipsoid

                          \n", - type: "Number", - optional: true, - }, - { - name: "radiusy", - description: "

                          y-radius of ellipsoid

                          \n", - type: "Number", - optional: true, - }, - { - name: "radiusz", - description: "

                          z-radius of ellipsoid

                          \n", - type: "Number", - optional: true, - }, - { - 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: true, - }, - { - 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: true, - }, - ], - class: "p5", - module: "Shape", - }, - torus: { - name: "torus", - params: [ - { - name: "radius", - description: "

                          radius of the whole ring

                          \n", - type: "Number", - optional: true, - }, - { - name: "tubeRadius", - description: "

                          radius of the tube

                          \n", - type: "Number", - optional: true, - }, - { - name: "detailX", - description: - "

                          number of segments in x-dimension,\n the more segments the smoother geometry\n default is 24

                          \n", - type: "Integer", - optional: true, - }, - { - name: "detailY", - description: - "

                          number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16

                          \n", - type: "Integer", - optional: true, - }, - ], - class: "p5", - module: "Shape", - }, - orbitControl: { - name: "orbitControl", - params: [ - { - name: "sensitivityX", - description: - "

                          sensitivity to mouse movement along X axis

                          \n", - type: "Number", - optional: true, - }, - { - name: "sensitivityY", - description: - "

                          sensitivity to mouse movement along Y axis

                          \n", - type: "Number", - optional: true, - }, - { - name: "sensitivityZ", - description: - "

                          sensitivity to scroll movement along Z axis

                          \n", - type: "Number", - optional: true, - }, - { - name: "options", - description: - "

                          An optional object that can contain additional settings,\ndisableTouchActions - Boolean, default value is true.\nSetting this to true makes mobile interactions smoother by preventing\naccidental interactions with the page while orbiting. But if you're already\ndoing it via css or want the default touch actions, consider setting it to false.\nfreeRotation - Boolean, default value is false.\nBy default, horizontal movement of the mouse or touch pointer rotates the camera\naround the y-axis, and vertical movement rotates the camera around the x-axis.\nBut if setting this option to true, the camera always rotates in the direction\nthe pointer is moving. For zoom and move, the behavior is the same regardless of\ntrue/false.

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5", - module: "3D", - }, - debugMode: { - name: "debugMode", - class: "p5", - module: "3D", - 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: true, - }, - { - name: "gridDivisions", - description: "

                          number of divisions in the grid

                          \n", - type: "Number", - optional: true, - }, - { - name: "xOff", - description: - "

                          X axis offset from origin (0,0,0)

                          \n", - type: "Number", - optional: true, - }, - { - name: "yOff", - description: - "

                          Y axis offset from origin (0,0,0)

                          \n", - type: "Number", - optional: true, - }, - { - name: "zOff", - description: - "

                          Z axis offset from origin (0,0,0)

                          \n", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "mode", - description: "", - type: "Constant", - }, - { - name: "axesSize", - description: "

                          size of axes icon

                          \n", - type: "Number", - optional: true, - }, - { - name: "xOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "yOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "zOff", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "gridSize", - description: "", - type: "Number", - optional: true, - }, - { - name: "gridDivisions", - description: "", - type: "Number", - optional: true, - }, - { - name: "gridXOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "gridYOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "gridZOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "axesSize", - description: "", - type: "Number", - optional: true, - }, - { - name: "axesXOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "axesYOff", - description: "", - type: "Number", - optional: true, - }, - { - name: "axesZOff", - description: "", - type: "Number", - optional: true, - }, - ], - }, - ], - }, - noDebugMode: { - name: "noDebugMode", - class: "p5", - module: "3D", - }, - ambientLight: { - name: "ambientLight", - class: "p5", - module: "3D", - 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: - "

                          alpha value relative to current\n color range (default is 0-255)

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "gray", - description: - "

                          number specifying value between\n white and black

                          \n", - type: "Number", - }, - { - name: "alpha", - description: "", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "value", - description: "

                          a color string

                          \n", - type: "String", - }, - ], - 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: - '

                          color as a p5.Color

                          \n', - type: "p5.Color", - }, - ], - chainable: 1, - }, - ], - }, - specularColor: { - name: "specularColor", - class: "p5", - module: "3D", - 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: "gray", - description: - "

                          number specifying value between\n white and black

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "value", - description: "

                          color as a CSS string

                          \n", - type: "String", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "values", - description: - "

                          color as an array containing the\n red, green, and blue components

                          \n", - type: "Number[]", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color

                          \n', - type: "p5.Color", - }, - ], - chainable: 1, - }, - ], - }, - directionalLight: { - name: "directionalLight", - class: "p5", - module: "3D", - overloads: [ - { - params: [ - { - name: "v1", - description: - "

                          red or hue value relative to the current\n color range

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green or saturation value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue or brightness value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "x", - description: - "

                          x component of direction (inclusive range of -1 to 1)

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          y component of direction (inclusive range of -1 to 1)

                          \n", - type: "Number", - }, - { - name: "z", - description: - "

                          z component of direction (inclusive range of -1 to 1)

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v1", - description: "", - type: "Number", - }, - { - name: "v2", - description: "", - type: "Number", - }, - { - name: "v3", - description: "", - type: "Number", - }, - { - name: "direction", - description: - '

                          direction of light as a\n p5.Vector

                          \n', - type: "p5.Vector", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', - type: "p5.Color|Number[]|String", - }, - { - name: "x", - description: "", - type: "Number", - }, - { - name: "y", - description: "", - type: "Number", - }, - { - name: "z", - description: "", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: "", - type: "p5.Color|Number[]|String", - }, - { - name: "direction", - description: "", - type: "p5.Vector", - }, - ], - chainable: 1, - }, - ], - }, - pointLight: { - name: "pointLight", - class: "p5", - module: "3D", - overloads: [ - { - params: [ - { - name: "v1", - description: - "

                          red or hue value relative to the current\n color range

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green or saturation value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue or brightness value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "x", - description: "

                          x component of position

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y component of position

                          \n", - type: "Number", - }, - { - name: "z", - description: "

                          z component of 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: - '

                          of light as a p5.Vector

                          \n', - type: "p5.Vector", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', - type: "p5.Color|Number[]|String", - }, - { - name: "x", - description: "", - type: "Number", - }, - { - name: "y", - description: "", - type: "Number", - }, - { - name: "z", - description: "", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: "", - type: "p5.Color|Number[]|String", - }, - { - name: "position", - description: "", - type: "p5.Vector", - }, - ], - chainable: 1, - }, - ], - }, - imageLight: { - name: "imageLight", - params: [ - { - name: "img", - description: "

                          image for the background

                          \n", - type: "p5.image", - }, - ], - class: "p5", - module: "3D", - }, - lights: { - name: "lights", - class: "p5", - module: "3D", - }, - 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: "3D", - }, - spotLight: { - name: "spotLight", - class: "p5", - module: "3D", - overloads: [ - { - params: [ - { - name: "v1", - description: - "

                          red or hue value relative to the current color range

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green or saturation value relative to the current color range

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue or brightness value relative to the current color range

                          \n", - type: "Number", - }, - { - name: "x", - description: "

                          x component of position

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y component of position

                          \n", - type: "Number", - }, - { - name: "z", - description: "

                          z component of position

                          \n", - type: "Number", - }, - { - name: "rx", - description: - "

                          x component of light direction (inclusive range of -1 to 1)

                          \n", - type: "Number", - }, - { - name: "ry", - description: - "

                          y component of light direction (inclusive range of -1 to 1)

                          \n", - type: "Number", - }, - { - name: "rz", - description: - "

                          z component of light direction (inclusive range of -1 to 1)

                          \n", - type: "Number", - }, - { - name: "angle", - description: "

                          angle of cone. Defaults to PI/3

                          \n", - type: "Number", - optional: true, - }, - { - name: "concentration", - description: - "

                          concentration of cone. Defaults to 100

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', - type: "p5.Color|Number[]|String", - }, - { - name: "position", - description: - '

                          position of light as a p5.Vector

                          \n', - type: "p5.Vector", - }, - { - name: "direction", - description: - '

                          direction of light as a p5.Vector

                          \n', - type: "p5.Vector", - }, - { - name: "angle", - description: "", - type: "Number", - optional: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - 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: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "color", - description: "", - type: "p5.Color|Number[]|String", - }, - { - 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: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "color", - description: "", - type: "p5.Color|Number[]|String", - }, - { - 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: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - 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: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - 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: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "color", - description: "", - type: "p5.Color|Number[]|String", - }, - { - 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: true, - }, - { - name: "concentration", - description: "", - type: "Number", - optional: true, - }, - ], - }, - ], - }, - noLights: { - name: "noLights", - class: "p5", - module: "3D", - }, - 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: true, - }, - { - name: "failureCallback", - description: - "

                          called with event error if\n the model fails to load.

                          \n", - type: "Function(Event)", - optional: true, - }, - { - name: "fileType", - description: - "

                          The file extension of the model\n (.stl, .obj).

                          \n", - type: "String", - optional: true, - }, - ], - }, - { - params: [ - { - name: "path", - description: "", - type: "String", - }, - { - name: "successCallback", - description: "", - type: "function(p5.Geometry)", - optional: true, - }, - { - name: "failureCallback", - description: "", - type: "Function(Event)", - optional: true, - }, - { - name: "fileType", - description: "", - type: "String", - optional: true, - }, - ], - }, - ], - }, - 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 p5.Shader object is passed as the first argument.

                          \n", - type: "Function", - optional: true, - }, - { - 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: true, - }, - ], - class: "p5", - module: "3D", - }, - 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: "3D", - }, - createFilterShader: { - name: "createFilterShader", - params: [ - { - name: "fragSrc", - description: "

                          source code for the fragment shader

                          \n", - type: "String", - }, - ], - class: "p5", - module: "3D", - }, - shader: { - name: "shader", - params: [ - { - name: "s", - description: - '

                          the p5.Shader object\nto use for rendering shapes.

                          \n', - type: "p5.Shader", - }, - ], - class: "p5", - module: "3D", - }, - resetShader: { - name: "resetShader", - class: "p5", - module: "3D", - }, - texture: { - name: "texture", - params: [ - { - name: "tex", - description: "

                          image to use as texture

                          \n", - type: "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", - }, - ], - class: "p5", - module: "3D", - }, - textureMode: { - name: "textureMode", - params: [ - { - name: "mode", - description: "

                          either IMAGE or NORMAL

                          \n", - type: "Constant", - }, - ], - class: "p5", - module: "3D", - }, - 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: true, - }, - ], - class: "p5", - module: "3D", - }, - normalMaterial: { - name: "normalMaterial", - class: "p5", - module: "3D", - }, - ambientMaterial: { - name: "ambientMaterial", - class: "p5", - module: "3D", - overloads: [ - { - params: [ - { - name: "v1", - description: - "

                          red or hue value relative to the current\n color range

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green or saturation value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue or brightness value relative to the\n current color range

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "gray", - description: - "

                          number specifying value between\n white and black

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - chainable: 1, - }, - ], - }, - emissiveMaterial: { - name: "emissiveMaterial", - class: "p5", - module: "3D", - overloads: [ - { - params: [ - { - name: "v1", - description: - "

                          red or hue value relative to the current\n color range

                          \n", - type: "Number", - }, - { - name: "v2", - description: - "

                          green or saturation value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "v3", - description: - "

                          blue or brightness value relative to the\n current color range

                          \n", - type: "Number", - }, - { - name: "alpha", - description: - "

                          alpha value relative to current color\n range (default is 0-255)

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "gray", - description: - "

                          number specifying value between\n white and black

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - chainable: 1, - }, - ], - }, - specularMaterial: { - name: "specularMaterial", - class: "p5", - module: "3D", - 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: true, - }, - ], - 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: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "color", - description: - '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', - type: "p5.Color|Number[]|String", - }, - ], - chainable: 1, - }, - ], - }, - shininess: { - name: "shininess", - params: [ - { - name: "shine", - description: "

                          degree of shininess

                          \n", - type: "Number", - }, - ], - class: "p5", - module: "3D", - }, - camera: { - name: "camera", - params: [ - { - name: "x", - description: "

                          camera position value on x axis

                          \n", - type: "Number", - optional: true, - }, - { - name: "y", - description: "

                          camera position value on y axis

                          \n", - type: "Number", - optional: true, - }, - { - name: "z", - description: "

                          camera position value on z axis

                          \n", - type: "Number", - optional: true, - }, - { - name: "centerX", - description: - "

                          x coordinate representing center of the sketch

                          \n", - type: "Number", - optional: true, - }, - { - name: "centerY", - description: - "

                          y coordinate representing center of the sketch

                          \n", - type: "Number", - optional: true, - }, - { - name: "centerZ", - description: - "

                          z coordinate representing center of the sketch

                          \n", - type: "Number", - optional: true, - }, - { - name: "upX", - description: - "

                          x component of direction 'up' from camera

                          \n", - type: "Number", - optional: true, - }, - { - name: "upY", - description: - "

                          y component of direction 'up' from camera

                          \n", - type: "Number", - optional: true, - }, - { - name: "upZ", - description: - "

                          z component of direction 'up' from camera

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "3D", - }, - 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: true, - }, - { - name: "aspect", - description: "

                          camera frustum aspect ratio

                          \n", - type: "Number", - optional: true, - }, - { - name: "near", - description: "

                          frustum near plane length

                          \n", - type: "Number", - optional: true, - }, - { - name: "far", - description: "

                          frustum far plane length

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "3D", - }, - ortho: { - name: "ortho", - params: [ - { - name: "left", - description: "

                          camera frustum left plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "right", - description: "

                          camera frustum right plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "bottom", - description: "

                          camera frustum bottom plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "top", - description: "

                          camera frustum top plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "near", - description: "

                          camera frustum near plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "far", - description: "

                          camera frustum far plane

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "3D", - }, - frustum: { - name: "frustum", - params: [ - { - name: "left", - description: "

                          camera frustum left plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "right", - description: "

                          camera frustum right plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "bottom", - description: "

                          camera frustum bottom plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "top", - description: "

                          camera frustum top plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "near", - description: "

                          camera frustum near plane

                          \n", - type: "Number", - optional: true, - }, - { - name: "far", - description: "

                          camera frustum far plane

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "3D", - }, - createCamera: { - name: "createCamera", - class: "p5", - module: "3D", - }, - setCamera: { - name: "setCamera", - params: [ - { - name: "cam", - description: "

                          p5.Camera object

                          \n", - type: "p5.Camera", - }, - ], - class: "p5", - module: "3D", - }, - vertexNormal: { - name: "vertexNormal", - params: [ - { - name: "x", - description: "", - type: "Number", - }, - { - name: "y", - description: "", - type: "Number", - }, - { - name: "z", - description: "", - type: "Number", - }, - { - name: "v", - description: "", - type: "Vector", - }, - ], - class: "p5", - module: "Shape", - }, - 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", - }, - ], - }, - ], - }, - getAudioContext: { - name: "getAudioContext", - class: "p5", - module: "p5.sound", - }, - userStartAudio: { - params: [ - { - name: "elements", - 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: true, - }, - { - name: "callback", - description: - "

                          Callback to invoke when the AudioContext\n has started

                          \n", - type: "Function", - optional: true, - }, - ], - name: "userStartAudio", - class: "p5", - module: "p5.sound", - }, - getOutputVolume: { - name: "getOutputVolume", - class: "p5", - module: "p5.sound", - }, - outputVolume: { - name: "outputVolume", - 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: true, - }, - { - name: "timeFromNow", - description: - "

                          Schedule this event to happen at\n t seconds in the future

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5", - module: "p5.sound", - }, - soundOut: { - name: "soundOut", - class: "p5", - module: "p5.sound", - }, - 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: true, - multiple: true, - }, - ], - 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", - }, - 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: true, - }, - { - name: "errorCallback", - description: - "

                          Name of a function to call if there is\n an error loading the file.

                          \n", - type: "Function", - optional: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - ], - 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", - }, - }, - "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: true, - }, - ], - 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", - }, - width: { - name: "width", - class: "p5.Element", - module: "DOM", - }, - height: { - name: "height", - class: "p5.Element", - module: "DOM", - }, - parent: { - name: "parent", - class: "p5.Element", - module: "DOM", - overloads: [ - { - params: [ - { - name: "parent", - description: - '

                          ID, p5.Element,\n or HTMLElement 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 call when the mouse is\n pressed over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - doubleClicked: { - name: "doubleClicked", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse is\n double clicked over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - mouseWheel: { - name: "mouseWheel", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse wheel is\n scrolled over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - mouseReleased: { - name: "mouseReleased", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse is\n pressed over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - mouseClicked: { - name: "mouseClicked", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse is\n pressed and released over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - mouseMoved: { - name: "mouseMoved", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse\n moves over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - mouseOver: { - name: "mouseOver", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse\n moves onto the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - mouseOut: { - name: "mouseOut", - params: [ - { - name: "fxn", - description: - "

                          function to call when the mouse\n moves off the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - touchStarted: { - name: "touchStarted", - params: [ - { - name: "fxn", - description: - "

                          function to call when the touch\n starts.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - touchMoved: { - name: "touchMoved", - params: [ - { - name: "fxn", - description: - "

                          function to call when the touch\n moves over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - touchEnded: { - name: "touchEnded", - params: [ - { - name: "fxn", - description: - "

                          function to call when the touch\n ends.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - dragOver: { - name: "dragOver", - params: [ - { - name: "fxn", - description: - "

                          function to call when the file is\n dragged over the element.\n false disables the function.

                          \n", - type: "Function|Boolean", - }, - ], - class: "p5.Element", - module: "DOM", - }, - dragLeave: { - name: "dragLeave", - params: [ - { - name: "fxn", - description: - "

                          function to call when the file is\n dragged off the element.\n false disables the function.

                          \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: true, - }, - ], - chainable: 1, - }, - ], - }, - center: { - name: "center", - params: [ - { - name: "align", - description: - "

                          passing 'vertical', 'horizontal' aligns element accordingly

                          \n", - type: "String", - optional: true, - }, - ], - 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: true, - }, - { - name: "append", - description: - "

                          whether to append HTML to existing

                          \n", - type: "Boolean", - optional: true, - }, - ], - 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: true, - }, - { - name: "y", - description: - "

                          y-position relative to upper left of window (optional)

                          \n", - type: "Number", - optional: true, - }, - { - name: "positionType", - description: - "

                          it can be static, fixed, relative, sticky, initial or inherit (optional)

                          \n", - type: "String", - optional: true, - }, - ], - chainable: 1, - }, - ], - }, - style: { - name: "style", - class: "p5.Element", - module: "DOM", - overloads: [ - { - params: [ - { - name: "property", - description: "

                          style property to set.

                          \n", - type: "String", - }, - ], - }, - { - params: [ - { - name: "property", - description: "", - type: "String", - }, - { - name: "value", - description: - "

                          value to assign to the 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 the 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: true, - }, - ], - chainable: 1, - }, - ], - }, - remove: { - name: "remove", - class: "p5.Element", - module: "DOM", - }, - drop: { - name: "drop", - params: [ - { - name: "callback", - description: - "

                          called when a file loads. Called once for each file dropped.

                          \n", - type: "Function", - }, - { - name: "fxn", - description: - "

                          called once when any files are dropped.

                          \n", - type: "Function", - optional: true, - }, - ], - class: "p5.Element", - module: "DOM", - }, - draggable: { - name: "draggable", - params: [ - { - name: "elmnt", - description: "

                          pass another p5.Element

                          \n", - type: "p5.Element", - optional: true, - }, - ], - class: "p5.Element", - module: "DOM", - }, - }, - "p5.Graphics": { - reset: { - name: "reset", - class: "p5.Graphics", - module: "Rendering", - }, - remove: { - name: "remove", - class: "p5.Graphics", - module: "Rendering", - }, - createFramebuffer: { - name: "createFramebuffer", - 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", - optional: true, - }, - ], - 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 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 playback ends.\n The p5.MediaElement is passed as\n the argument.

                          \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: - "

                          cue time to run the callback function.

                          \n", - type: "Number", - }, - { - name: "callback", - description: "

                          function to call at the cue time.

                          \n", - type: "Function", - }, - { - name: "value", - description: - "

                          object to pass as the argument to\n callback.

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5.MediaElement", - module: "DOM", - }, - removeCue: { - name: "removeCue", - params: [ - { - name: "id", - description: - "

                          ID of the cue, created by media.addCue().

                          \n", - type: "Number", - }, - ], - class: "p5.MediaElement", - module: "DOM", - }, - clearCues: { - name: "clearCues", - 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", - }, - pixelDensity: { - name: "pixelDensity", - params: [ - { - name: "density", - description: - "

                          A scaling factor for the number of pixels per\nside

                          \n", - type: "Number", - optional: true, - }, - ], - 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-coordinate of the upper-left corner\n of the subsection to update.

                          \n", - type: "Integer", - }, - { - name: "y", - description: - "

                          y-coordinate of the upper-left corner\n of the subsection to update.

                          \n", - type: "Integer", - }, - { - name: "w", - description: - "

                          width of the subsection to update.

                          \n", - type: "Integer", - }, - { - name: "h", - description: - "

                          height of the subsection to update.

                          \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 of the subsection to be returned.

                          \n", - type: "Number", - }, - { - name: "h", - description: - "

                          height of the subsection to be returned.

                          \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 p5.Color object |\n p5.Image to copy.

                          \n', - type: "Number|Number[]|Object", - }, - ], - class: "p5.Image", - module: "Image", - }, - resize: { - name: "resize", - params: [ - { - name: "width", - description: "

                          resized image width.

                          \n", - type: "Number", - }, - { - name: "height", - description: "

                          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, ERODE, DILATE or BLUR.

                          \n", - type: "Constant", - }, - { - name: "filterParam", - description: "

                          parameter unique to each filter.

                          \n", - type: "Number", - optional: true, - }, - ], - 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.

                          \n

                          Available 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

                          \n

                          http://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: "

                          filename. Defaults to 'untitled'.

                          \n", - type: "String", - }, - { - name: "extension", - description: - "

                          file extension, either 'png' or 'jpg'.\n Defaults to 'png'.

                          \n", - type: "String", - optional: true, - }, - ], - 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: "

                          index of the frame to display.

                          \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: - "

                          delay in milliseconds between switching frames.

                          \n", - type: "Number", - }, - { - name: "index", - description: - "

                          index of the frame that will have its delay modified.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - class: "p5.Table", - module: "IO", - }, - trim: { - name: "trim", - params: [ - { - name: "column", - description: - "

                          Column ID (number)\n or name (string)

                          \n", - type: "String|Integer", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: "

                          x component of the vector.

                          \n", - type: "Number", - optional: true, - }, - { - name: "y", - description: "

                          y component of the vector.

                          \n", - type: "Number", - optional: true, - }, - { - name: "z", - description: "

                          z component of the vector.

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "value", - description: "

                          vector to set.

                          \n", - type: "p5.Vector|Number[]", - }, - ], - chainable: 1, - }, - ], - }, - copy: { - name: "copy", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [], - }, - { - params: [ - { - name: "v", - description: - '

                          the p5.Vector to create a copy of

                          \n', - type: "p5.Vector", - }, - ], - static: 1, - }, - ], - }, - add: { - name: "add", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "x", - description: - "

                          x component of the vector to be added.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          y component of the vector to be added.

                          \n", - type: "Number", - optional: true, - }, - { - name: "z", - description: - "

                          z component of the vector to be added.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: "

                          vector to receive the result.

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - rem: { - name: "rem", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "x", - description: "

                          x component of divisor vector.

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y component of divisor vector.

                          \n", - type: "Number", - }, - { - name: "z", - description: "

                          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: - '

                          The dividend p5.Vector

                          \n', - type: "p5.Vector", - }, - { - name: "v2", - description: - '

                          The 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: - "

                          x component of the vector to subtract.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          y component of the vector to subtract.

                          \n", - type: "Number", - optional: true, - }, - { - name: "z", - description: - "

                          z component of the vector to subtract.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: "

                          vector to receive the result.

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - 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: - "

                          number to multiply with the x component of the vector.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          number to multiply with the y component of the vector.

                          \n", - type: "Number", - }, - { - name: "z", - description: - "

                          number to multiply with the z component of the vector.

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "arr", - description: - "

                          array to multiply with the components of the vector.

                          \n", - type: "Number[]", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v", - description: - "

                          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: true, - }, - ], - static: 1, - }, - { - params: [ - { - name: "v", - description: "", - type: "p5.Vector", - }, - { - name: "n", - description: "", - type: "Number", - }, - { - name: "target", - description: "

                          vector to receive the result.

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - { - params: [ - { - name: "v0", - description: "", - type: "p5.Vector", - }, - { - name: "v1", - description: "", - type: "p5.Vector", - }, - { - name: "target", - description: "", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - { - params: [ - { - name: "v0", - description: "", - type: "p5.Vector", - }, - { - name: "arr", - description: "", - type: "Number[]", - }, - { - name: "target", - description: "", - type: "p5.Vector", - optional: true, - }, - ], - 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: - "

                          number to divide with the x component of the vector.

                          \n", - type: "Number", - }, - { - name: "y", - description: - "

                          number to divide with the y component of the vector.

                          \n", - type: "Number", - }, - { - name: "z", - description: - "

                          number to divide with the z component of the vector.

                          \n", - type: "Number", - optional: true, - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "arr", - description: - "

                          array to divide the components of the vector by.

                          \n", - type: "Number[]", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v", - description: - "

                          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: true, - }, - ], - static: 1, - }, - { - params: [ - { - name: "v", - description: "", - type: "p5.Vector", - }, - { - name: "n", - description: "", - type: "Number", - }, - { - name: "target", - description: - "

                          The vector to receive the result

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - { - params: [ - { - name: "v0", - description: "", - type: "p5.Vector", - }, - { - name: "v1", - description: "", - type: "p5.Vector", - }, - { - name: "target", - description: "", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - { - params: [ - { - name: "v0", - description: "", - type: "p5.Vector", - }, - { - name: "arr", - description: "", - type: "Number[]", - }, - { - name: "target", - description: "", - type: "p5.Vector", - optional: true, - }, - ], - 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", - overloads: [ - { - params: [], - }, - { - params: [ - { - name: "vecT", - description: - "

                          the vector to return the squared magnitude of

                          \n", - type: "p5.Vector", - }, - ], - static: 1, - }, - ], - }, - 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: true, - }, - { - name: "z", - description: "

                          z component of the vector.

                          \n", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "v", - description: - '

                          p5.Vector to be dotted.

                          \n', - type: "p5.Vector", - }, - ], - }, - { - params: [ - { - name: "v1", - description: - '

                          first p5.Vector.

                          \n', - type: "p5.Vector", - }, - { - name: "v2", - description: - '

                          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: - '

                          first p5.Vector.

                          \n', - type: "p5.Vector", - }, - { - name: "v2", - description: - '

                          second p5.Vector.

                          \n', - type: "p5.Vector", - }, - ], - static: 1, - }, - ], - }, - dist: { - name: "dist", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "v", - description: - '

                          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", - overloads: [ - { - params: [], - }, - { - params: [ - { - name: "v", - description: "

                          The vector to normalize

                          \n", - type: "p5.Vector", - }, - { - name: "target", - description: - "

                          The vector to receive the result

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - limit: { - name: "limit", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "max", - description: - "

                          maximum magnitude for the vector.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v", - description: "

                          the vector to limit

                          \n", - type: "p5.Vector", - }, - { - name: "max", - description: "", - type: "Number", - }, - { - name: "target", - description: - "

                          the vector to receive the result (Optional)

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - setMag: { - name: "setMag", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "len", - description: "

                          new length for this vector.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v", - description: - "

                          the vector to set the magnitude of

                          \n", - type: "p5.Vector", - }, - { - name: "len", - description: "", - type: "Number", - }, - { - name: "target", - description: - "

                          the vector to receive the result (Optional)

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - heading: { - name: "heading", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [], - }, - { - params: [ - { - name: "v", - description: "

                          the vector to find the angle of

                          \n", - type: "p5.Vector", - }, - ], - static: 1, - }, - ], - }, - setHeading: { - name: "setHeading", - params: [ - { - name: "angle", - description: "

                          angle of rotation.

                          \n", - type: "Number", - }, - ], - class: "p5.Vector", - module: "Math", - }, - rotate: { - name: "rotate", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "angle", - description: "

                          angle of rotation.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v", - description: "", - type: "p5.Vector", - }, - { - name: "angle", - description: "", - type: "Number", - }, - { - name: "target", - description: - "

                          The vector to receive the result

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - angleBetween: { - name: "angleBetween", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "value", - description: - '

                          x, y, and z components of a p5.Vector.

                          \n', - type: "p5.Vector", - }, - ], - }, - { - params: [ - { - name: "v1", - description: "

                          the first vector.

                          \n", - type: "p5.Vector", - }, - { - name: "v2", - description: "

                          the second vector.

                          \n", - type: "p5.Vector", - }, - ], - static: 1, - }, - ], - }, - lerp: { - name: "lerp", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "x", - description: "

                          x component.

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y component.

                          \n", - type: "Number", - }, - { - name: "z", - description: "

                          z component.

                          \n", - type: "Number", - }, - { - name: "amt", - description: - "

                          amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

                          \n", - type: "Number", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "v", - description: - '

                          p5.Vector to lerp toward.

                          \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

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - slerp: { - name: "slerp", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "v", - description: - '

                          p5.Vector to slerp toward.

                          \n', - type: "p5.Vector", - }, - { - name: "amt", - description: - "

                          amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

                          \n", - type: "Number", - }, - ], - }, - { - params: [ - { - name: "v1", - description: "

                          old vector.

                          \n", - type: "p5.Vector", - }, - { - name: "v2", - description: "

                          new vector.

                          \n", - type: "p5.Vector", - }, - { - name: "amt", - description: "", - type: "Number", - }, - { - name: "target", - description: "

                          vector to receive the result.

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - reflect: { - name: "reflect", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "surfaceNormal", - description: - '

                          p5.Vector\n to reflect about.

                          \n', - type: "p5.Vector", - }, - ], - chainable: 1, - }, - { - params: [ - { - name: "incidentVector", - description: "

                          vector to be reflected.

                          \n", - type: "p5.Vector", - }, - { - name: "surfaceNormal", - description: "", - type: "p5.Vector", - }, - { - name: "target", - description: "

                          vector to receive the result.

                          \n", - type: "p5.Vector", - optional: true, - }, - ], - static: 1, - }, - ], - }, - array: { - name: "array", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [], - }, - { - params: [ - { - name: "v", - description: - "

                          the vector to convert to an array

                          \n", - type: "p5.Vector", - }, - ], - static: 1, - }, - ], - }, - equals: { - name: "equals", - class: "p5.Vector", - module: "Math", - overloads: [ - { - params: [ - { - name: "x", - description: "

                          x component of the vector.

                          \n", - type: "Number", - optional: true, - }, - { - name: "y", - description: "

                          y component of the vector.

                          \n", - type: "Number", - optional: true, - }, - { - name: "z", - description: "

                          z component of the vector.

                          \n", - type: "Number", - optional: true, - }, - ], - }, - { - params: [ - { - name: "value", - description: "

                          vector to compare.

                          \n", - type: "p5.Vector|Array", - }, - ], - }, - { - params: [ - { - name: "v1", - description: "

                          the first vector to compare

                          \n", - type: "p5.Vector|Array", - }, - { - name: "v2", - description: "

                          the second vector to compare

                          \n", - type: "p5.Vector|Array", - }, - ], - static: 1, - }, - ], - }, - fromAngle: { - name: "fromAngle", - params: [ - { - name: "angle", - description: - '

                          desired angle, in radians. Unaffected by angleMode().

                          \n', - type: "Number", - }, - { - name: "length", - description: - "

                          length of the new vector (defaults to 1).

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Vector", - module: "Math", - }, - fromAngles: { - name: "fromAngles", - params: [ - { - name: "theta", - description: - "

                          polar angle in radians (zero is up).

                          \n", - type: "Number", - }, - { - name: "phi", - description: - "

                          azimuthal angle in radians\n (zero is out of the screen).

                          \n", - type: "Number", - }, - { - name: "length", - description: - "

                          length of the new vector (defaults to 1).

                          \n", - type: "Number", - optional: true, - }, - ], - 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: "str", - description: "

                          string of text.

                          \n", - type: "String", - }, - { - name: "x", - description: "

                          x-coordinate of the text.

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y-coordinate of the text.

                          \n", - type: "Number", - }, - { - name: "fontSize", - description: - '

                          font size. Defaults to the current\n textSize().

                          \n', - type: "Number", - optional: true, - }, - ], - class: "p5.Font", - module: "Typography", - }, - textToPoints: { - name: "textToPoints", - params: [ - { - name: "str", - description: "

                          string of text.

                          \n", - type: "String", - }, - { - name: "x", - description: "

                          x-coordinate of the text.

                          \n", - type: "Number", - }, - { - name: "y", - description: "

                          y-coordinate of the text.

                          \n", - type: "Number", - }, - { - name: "fontSize", - description: - '

                          font size. Defaults to the current\n textSize().

                          \n', - type: "Number", - optional: true, - }, - { - name: "options", - description: - "

                          object with sampleFactor and simplifyThreshold\n properties.

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5.Font", - module: "Typography", - }, - }, - "p5.Camera": { - eyeX: { - name: "eyeX", - class: "p5.Camera", - module: "3D", - }, - eyeY: { - name: "eyeY", - class: "p5.Camera", - module: "3D", - }, - eyeZ: { - name: "eyeZ", - class: "p5.Camera", - module: "3D", - }, - centerX: { - name: "centerX", - class: "p5.Camera", - module: "3D", - }, - centerY: { - name: "centerY", - class: "p5.Camera", - module: "3D", - }, - centerZ: { - name: "centerZ", - class: "p5.Camera", - module: "3D", - }, - upX: { - name: "upX", - class: "p5.Camera", - module: "3D", - }, - upY: { - name: "upY", - class: "p5.Camera", - module: "3D", - }, - upZ: { - name: "upZ", - class: "p5.Camera", - module: "3D", - }, - perspective: { - name: "perspective", - class: "p5.Camera", - module: "3D", - }, - ortho: { - name: "ortho", - class: "p5.Camera", - module: "3D", - }, - frustum: { - name: "frustum", - class: "p5.Camera", - module: "3D", - }, - 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: "3D", - }, - 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: "3D", - }, - 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: "3D", - }, - camera: { - name: "camera", - class: "p5.Camera", - module: "3D", - }, - 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: "3D", - }, - 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: "3D", - }, - set: { - name: "set", - params: [ - { - name: "cam", - description: "

                          source camera

                          \n", - type: "p5.Camera", - }, - ], - class: "p5.Camera", - module: "3D", - }, - slerp: { - name: "slerp", - params: [ - { - name: "cam0", - description: "

                          first p5.Camera

                          \n", - type: "p5.Camera", - }, - { - name: "cam1", - description: "

                          second p5.Camera

                          \n", - type: "p5.Camera", - }, - { - name: "amt", - description: - "

                          amount to use for interpolation during slerp

                          \n", - type: "Number", - }, - ], - class: "p5.Camera", - module: "3D", - }, - }, - "p5.Framebuffer": { - pixels: { - name: "pixels", - class: "p5.Framebuffer", - module: "Rendering", - }, - resize: { - name: "resize", - params: [ - { - name: "width", - description: "", - type: "Number", - }, - { - name: "height", - description: "", - type: "Number", - }, - ], - class: "p5.Framebuffer", - module: "Rendering", - }, - pixelDensity: { - name: "pixelDensity", - params: [ - { - name: "density", - description: - "

                          A scaling factor for the number of pixels per\nside of the framebuffer

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Framebuffer", - module: "Rendering", - }, - autoSized: { - name: "autoSized", - params: [ - { - name: "autoSized", - description: - "

                          Whether or not the framebuffer should resize\nalong with the canvas it's attached to

                          \n", - type: "Boolean", - optional: true, - }, - ], - class: "p5.Framebuffer", - module: "Rendering", - }, - createCamera: { - name: "createCamera", - class: "p5.Framebuffer", - module: "Rendering", - }, - remove: { - name: "remove", - class: "p5.Framebuffer", - module: "Rendering", - }, - begin: { - name: "begin", - class: "p5.Framebuffer", - module: "Rendering", - }, - end: { - name: "end", - class: "p5.Framebuffer", - module: "Rendering", - }, - draw: { - name: "draw", - params: [ - { - name: "callback", - description: - "

                          A function to run that draws to the canvas. The\nfunction will immediately be run, but it will draw to the framebuffer\ninstead of the canvas.

                          \n", - type: "Function", - }, - ], - class: "p5.Framebuffer", - module: "Rendering", - }, - get: { - name: "get", - class: "p5.Framebuffer", - module: "Rendering", - 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 of the section to be returned

                          \n", - type: "Number", - }, - { - name: "h", - description: - "

                          height of the section to be returned

                          \n", - type: "Number", - }, - ], - }, - { - params: [], - }, - { - params: [ - { - name: "x", - description: "", - type: "Number", - }, - { - name: "y", - description: "", - type: "Number", - }, - ], - }, - ], - }, - color: { - name: "color", - class: "p5.Framebuffer", - module: "Rendering", - }, - depth: { - name: "depth", - class: "p5.Framebuffer", - module: "Rendering", - }, - }, - "p5.Geometry": { - clearColors: { - name: "clearColors", - class: "p5.Geometry", - module: "Shape", - }, - computeFaces: { - name: "computeFaces", - class: "p5.Geometry", - module: "Shape", - }, - computeNormals: { - name: "computeNormals", - params: [ - { - name: "shadingType", - description: - "

                          shading type (FLAT for flat shading or SMOOTH for smooth shading) for buildGeometry() outputs. Defaults to FLAT.

                          \n", - type: "String", - optional: true, - }, - { - name: "options", - description: - "

                          An optional object with configuration.

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5.Geometry", - module: "Shape", - }, - averageNormals: { - name: "averageNormals", - class: "p5.Geometry", - module: "Shape", - }, - averagePoleNormals: { - name: "averagePoleNormals", - class: "p5.Geometry", - module: "Shape", - }, - normalize: { - name: "normalize", - class: "p5.Geometry", - module: "Shape", - }, - }, - "p5.Shader": { - copyToContext: { - name: "copyToContext", - params: [ - { - name: "context", - description: - "

                          The graphic or instance to copy this shader to.\nPass window if you need to copy to the main canvas.

                          \n", - type: "p5|p5.Graphics", - }, - ], - class: "p5.Shader", - module: "3D", - }, - setUniform: { - name: "setUniform", - params: [ - { - name: "uniformName", - description: - "

                          the name of the uniform.\nMust correspond to the name used in the vertex and fragment shaders

                          \n", - type: "String", - }, - { - name: "data", - description: - "

                          the data to associate with the uniform. The type can be\na boolean (true/false), a number, an array of numbers, or\nan image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture)

                          \n", - type: "Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture", - }, - ], - class: "p5.Shader", - module: "3D", - }, - }, - "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: true, - }, - { - name: "rate", - description: "

                          (optional) playback rate

                          \n", - type: "Number", - optional: true, - }, - { - name: "amp", - description: - "

                          (optional) amplitude (volume)\n of playback

                          \n", - type: "Number", - optional: true, - }, - { - name: "cueStart", - description: - "

                          (optional) cue start time in seconds

                          \n", - type: "Number", - optional: true, - }, - { - name: "duration", - description: - "

                          (optional) duration of playback in seconds

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - name: "rate", - description: "

                          (optional) playback rate

                          \n", - type: "Number", - optional: true, - }, - { - name: "amp", - description: "

                          (optional) playback volume

                          \n", - type: "Number", - optional: true, - }, - { - name: "cueLoopStart", - description: "

                          (optional) startTime in seconds

                          \n", - type: "Number", - optional: true, - }, - { - name: "duration", - description: "

                          (optional) loop duration in seconds

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - class: "p5.SoundFile", - module: "p5.sound", - }, - pan: { - name: "pan", - params: [ - { - name: "panValue", - description: "

                          Set the stereo panner

                          \n", - type: "Number", - optional: true, - }, - { - name: "timeFromNow", - description: - "

                          schedule this event to happen\n seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - name: "timeFromNow", - description: - "

                          Schedule this event to happen at\n t seconds in the future

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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", - }, - 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: true, - }, - ], - 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: true, - }, - ], - 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 main output)

                          \n", - type: "SoundObject|undefined", - optional: true, - }, - { - name: "smoothing", - description: - "

                          a range between 0.0 and 1.0\n to smooth amplitude readings

                          \n", - type: "Number|undefined", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - ], - 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.Oscillator": { - start: { - name: "start", - params: [ - { - name: "time", - description: "

                          startTime in seconds from now.

                          \n", - type: "Number", - optional: true, - }, - { - name: "frequency", - description: "

                          frequency in Hz.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "timeFromNow", - description: - "

                          schedule this event to happen\n seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Oscillator", - module: "p5.sound", - }, - getAmp: { - name: "getAmp", - 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: true, - }, - { - name: "timeFromNow", - description: - "

                          Schedule this event to happen\n at x seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Oscillator", - module: "p5.sound", - }, - getFreq: { - name: "getFreq", - 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", - }, - getType: { - name: "getType", - 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", - }, - getPan: { - name: "getPan", - 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.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: true, - }, - { - 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: true, - }, - { - name: "releaseTime", - description: - "

                          Time in seconds from now (defaults to 0)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - multiple: true, - }, - ], - 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: true, - }, - { - name: "sustainTime", - description: - "

                          time to sustain before releasing the envelope

                          \n", - type: "Number", - optional: true, - }, - ], - 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

                          \n", - type: "Number", - optional: true, - }, - ], - 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.Noise": { - setType: { - name: "setType", - params: [ - { - name: "type", - description: "

                          'white', 'pink' or 'brown'

                          \n", - type: "String", - optional: true, - }, - ], - class: "p5.Noise", - 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: true, - }, - ], - class: "p5.Pulse", - 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: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - name: "errorCallback", - description: - "

                          This optional callback receives the error\n message as its argument.

                          \n", - type: "Function", - optional: true, - }, - ], - 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.Effect": { - amp: { - name: "amp", - params: [ - { - name: "vol", - description: "

                          amplitude between 0 and 1.0

                          \n", - type: "Number", - optional: true, - }, - { - name: "rampTime", - description: - "

                          create a fade that lasts until rampTime

                          \n", - type: "Number", - optional: true, - }, - { - name: "tFromNow", - description: - "

                          schedule this event to happen in tFromNow seconds

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Effect", - module: "p5.sound", - }, - chain: { - name: "chain", - params: [ - { - name: "arguments", - description: - "

                          Chain together multiple sound objects

                          \n", - type: "Object", - optional: true, - }, - ], - class: "p5.Effect", - module: "p5.sound", - }, - drywet: { - name: "drywet", - params: [ - { - name: "fade", - description: "

                          The desired drywet value (0 - 1.0)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "res", - description: - "

                          Resonance/Width of the filter frequency\n from 0.001 to 1000

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Filter", - module: "p5.sound", - }, - set: { - name: "set", - params: [ - { - name: "freq", - description: "

                          Frequency in Hz, from 10 to 22050

                          \n", - type: "Number", - optional: true, - }, - { - name: "res", - description: "

                          Resonance (Q) from 0.001 to 1000

                          \n", - type: "Number", - optional: true, - }, - { - name: "timeFromNow", - description: - "

                          schedule this event to happen\n seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - 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.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: true, - }, - { - name: "rolloffFactor", - description: "", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "feedback", - description: - "

                          sends the delay back through itself\n in a loop that decreases in volume\n each time.

                          \n", - type: "Number", - optional: true, - }, - { - name: "lowPass", - description: - "

                          Cutoff frequency. Only frequencies\n below the lowPass will be part of the\n delay.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "timeFromNow", - description: - "

                          schedule this event to happen\n seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "decayRate", - description: - "

                          Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

                          \n", - type: "Number", - optional: true, - }, - { - name: "reverse", - description: - "

                          Play the reverb backwards or forwards.

                          \n", - type: "Boolean", - optional: true, - }, - ], - 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: true, - }, - { - name: "decayRate", - description: - "

                          Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

                          \n", - type: "Number", - optional: true, - }, - { - name: "reverse", - description: - "

                          Play the reverb backwards or forwards.

                          \n", - type: "Boolean", - optional: true, - }, - ], - 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: true, - }, - { - name: "timeFromNow", - description: - "

                          schedule this event to happen\n seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - 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", - }, - impulses: { - name: "impulses", - 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", - }, - 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: true, - }, - ], - 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: true, - }, - ], - class: "p5.Part", - module: "p5.sound", - }, - loop: { - name: "loop", - params: [ - { - name: "time", - description: "

                          seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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": { - 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", - }, - 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: true, - }, - ], - class: "p5.SoundLoop", - module: "p5.sound", - }, - stop: { - name: "stop", - params: [ - { - name: "timeFromNow", - description: "

                          schedule a stopping time

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.SoundLoop", - module: "p5.sound", - }, - pause: { - name: "pause", - params: [ - { - name: "timeFromNow", - description: "

                          schedule a pausing time

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - { - 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: true, - }, - { - name: "threshold", - description: - "

                          The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0

                          \n", - type: "Number", - optional: true, - }, - { - 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: true, - }, - ], - 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: true, - }, - { - name: "time", - description: - "

                          Assign time value to schedule the change in value

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "time", - description: - "

                          Assign time value to schedule the change in value

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "time", - description: - "

                          Assign time value to schedule the change in value

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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: true, - }, - ], - class: "p5.Compressor", - module: "p5.sound", - }, - reduction: { - name: "reduction", - class: "p5.Compressor", - 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: true, - }, - ], - class: "p5.PeakDetect", - 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: true, - }, - ], - 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: true, - }, - { - name: "callback", - description: - "

                          The name of a function that will be\n called once the recording completes

                          \n", - type: "Function", - optional: true, - }, - ], - class: "p5.SoundRecorder", - module: "p5.sound", - }, - stop: { - name: "stop", - class: "p5.SoundRecorder", - 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: true, - optdefault: "0.25", - }, - { - name: "oversample", - description: "

                          'none', '2x', or '4x'.

                          \n", - type: "String", - optional: true, - 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: true, - optdefault: "0.25", - }, - { - name: "oversample", - description: "

                          'none', '2x', or '4x'.

                          \n", - type: "String", - optional: true, - 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", - }, - }, - "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: true, - }, - { - name: "timeFromNow", - description: - "

                          schedule this event to happen\n seconds from now

                          \n", - type: "Number", - optional: true, - }, - ], - class: "p5.Gain", - 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.MonoSynth": { - 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", - }, - 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: true, - }, - { - name: "secondsFromNow", - description: - "

                          time from now (in seconds) at which to play

                          \n", - type: "Number", - optional: true, - }, - { - name: "sustainTime", - description: - "

                          time to sustain before releasing the envelope. Defaults to 0.15 seconds.

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "secondsFromNow", - description: - "

                          time from now (in seconds) at which to play

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - 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: true, - }, - { - name: "releaseTime", - description: - "

                          Time in seconds from now (defaults to 0)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - ], - 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.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: true, - }, - { - name: "velocity", - description: - "

                          velocity of the note to play (ranging from 0 to 1)

                          \n", - type: "Number", - optional: true, - }, - { - name: "secondsFromNow", - description: - "

                          time from now (in seconds) at which to play

                          \n", - type: "Number", - optional: true, - }, - { - name: "sustainTime", - description: - "

                          time to sustain before releasing the envelope

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "attackTime", - description: - "

                          Time (in seconds before envelope\n reaches Attack Level

                          \n", - type: "Number", - optional: true, - }, - { - name: "decayTime", - description: - "

                          Time (in seconds) before envelope\n reaches Decay/Sustain Level

                          \n", - type: "Number", - optional: true, - }, - { - 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: true, - }, - { - name: "releaseTime", - description: - "

                          Time in seconds from now (defaults to 0)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "decayTime", - description: - "

                          Time (in seconds) before envelope\n reaches Decay/Sustain Level

                          \n", - type: "Number", - optional: true, - }, - { - 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: true, - }, - { - name: "releaseTime", - description: - "

                          Time in seconds from now (defaults to 0)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "velocity", - description: - "

                          velocity of the note to play (ranging from 0 to 1)/

                          \n", - type: "Number", - optional: true, - }, - { - name: "secondsFromNow", - description: "

                          time from now (in seconds)

                          \n", - type: "Number", - optional: true, - }, - ], - 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: true, - }, - { - name: "secondsFromNow", - description: "

                          time to trigger the release

                          \n", - type: "Number", - optional: true, - }, - ], - 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", - }, - }, - }; - }, - {}, - ], - 2: [ - function (_dereq_, module, exports) { - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - module.exports = _arrayWithHoles; - }, - {}, - ], - 3: [ - function (_dereq_, module, exports) { - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } - module.exports = _arrayWithoutHoles; - }, - {}, - ], - 4: [ - function (_dereq_, module, exports) { - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - module.exports = _assertThisInitialized; - }, - {}, - ], - 5: [ - function (_dereq_, module, exports) { - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - module.exports = _classCallCheck; - }, - {}, - ], - 6: [ - function (_dereq_, module, exports) { - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - module.exports = _createClass; - }, - {}, - ], - 7: [ - function (_dereq_, module, exports) { - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true, - }); - } else { - obj[key] = value; - } - return obj; - } - module.exports = _defineProperty; - }, - {}, - ], - 8: [ - function (_dereq_, module, exports) { - function _getPrototypeOf(o) { - module.exports = _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - module.exports = _getPrototypeOf; - }, - {}, - ], - 9: [ - function (_dereq_, module, exports) { - var setPrototypeOf = _dereq_("./setPrototypeOf"); - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) setPrototypeOf(subClass, superClass); - } - module.exports = _inherits; - }, - { - "./setPrototypeOf": 16, - }, - ], - 10: [ - function (_dereq_, module, exports) { - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - module.exports = _iterableToArray; - }, - {}, - ], - 11: [ - function (_dereq_, module, exports) { - function _iterableToArrayLimit(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - try { - for ( - var _i = arr[Symbol.iterator](), _s; - !(_n = (_s = _i.next()).done); - _n = true - ) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - module.exports = _iterableToArrayLimit; - }, - {}, - ], - 12: [ - function (_dereq_, module, exports) { - function _nonIterableRest() { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance", - ); - } - module.exports = _nonIterableRest; - }, - {}, - ], - 13: [ - function (_dereq_, module, exports) { - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - module.exports = _nonIterableSpread; - }, - {}, - ], - 14: [ - function (_dereq_, module, exports) { - var defineProperty = _dereq_("./defineProperty"); - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - if (typeof Object.getOwnPropertySymbols === "function") { - ownKeys = ownKeys.concat( - Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym) - .enumerable; - }), - ); - } - ownKeys.forEach(function (key) { - defineProperty(target, key, source[key]); - }); - } - return target; - } - module.exports = _objectSpread; - }, - { - "./defineProperty": 7, - }, - ], - 15: [ - function (_dereq_, module, exports) { - var _typeof = _dereq_("../helpers/typeof"); - var assertThisInitialized = _dereq_("./assertThisInitialized"); - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return assertThisInitialized(self); - } - module.exports = _possibleConstructorReturn; - }, - { - "../helpers/typeof": 19, - "./assertThisInitialized": 4, - }, - ], - 16: [ - function (_dereq_, module, exports) { - function _setPrototypeOf(o, p) { - module.exports = _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - module.exports = _setPrototypeOf; - }, - {}, - ], - 17: [ - function (_dereq_, module, exports) { - var arrayWithHoles = _dereq_("./arrayWithHoles"); - var iterableToArrayLimit = _dereq_("./iterableToArrayLimit"); - var nonIterableRest = _dereq_("./nonIterableRest"); - function _slicedToArray(arr, i) { - return ( - arrayWithHoles(arr) || - iterableToArrayLimit(arr, i) || - nonIterableRest() - ); - } - module.exports = _slicedToArray; - }, - { - "./arrayWithHoles": 2, - "./iterableToArrayLimit": 11, - "./nonIterableRest": 12, - }, - ], - 18: [ - function (_dereq_, module, exports) { - var arrayWithoutHoles = _dereq_("./arrayWithoutHoles"); - var iterableToArray = _dereq_("./iterableToArray"); - var nonIterableSpread = _dereq_("./nonIterableSpread"); - function _toConsumableArray(arr) { - return ( - arrayWithoutHoles(arr) || - iterableToArray(arr) || - nonIterableSpread() - ); - } - module.exports = _toConsumableArray; - }, - { - "./arrayWithoutHoles": 3, - "./iterableToArray": 10, - "./nonIterableSpread": 13, - }, - ], - 19: [ - function (_dereq_, module, exports) { - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - module.exports = _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - module.exports = _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - module.exports = _typeof; - }, - {}, - ], - 20: [ - function (_dereq_, module, exports) { - "use strict"; - exports.byteLength = byteLength; - exports.toByteArray = toByteArray; - exports.fromByteArray = fromByteArray; - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; - var code = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } // Support decoding URL-safe base64 strings, as Node.js does. - // See: https://en.wikipedia.org/wiki/Base64#URL_applications - - revLookup["-".charCodeAt(0)] = 62; - revLookup["_".charCodeAt(0)] = 63; - function getLens(b64) { - var len = b64.length; - if (len % 4 > 0) { - throw new Error("Invalid string. Length must be a multiple of 4"); - } // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - - var validLen = b64.indexOf("="); - if (validLen === -1) validLen = len; - var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4); - return [validLen, placeHoldersLen]; - } // base64 is 4/3 + up to two characters of the original data - - function byteLength(b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen; - } - function _byteLength(b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen; - } - function toByteArray(b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - var curByte = 0; - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 ? validLen - 4 : validLen; - var i; - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)]; - arr[curByte++] = (tmp >> 16) & 255; - arr[curByte++] = (tmp >> 8) & 255; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[curByte++] = (tmp >> 8) & 255; - arr[curByte++] = tmp & 255; - } - return arr; - } - function tripletToBase64(num) { - return ( - lookup[(num >> 18) & 63] + - lookup[(num >> 12) & 63] + - lookup[(num >> 6) & 63] + - lookup[num & 63] - ); - } - function encodeChunk(uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 16711680) + - ((uint8[i + 1] << 8) & 65280) + - (uint8[i + 2] & 255); - output.push(tripletToBase64(tmp)); - } - return output.join(""); - } - function fromByteArray(uint8) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - // go through the array every three bytes, we'll deal with trailing stuff later - for ( - var i = 0, len2 = len - extraBytes; - i < len2; - i += maxChunkLength - ) { - parts.push( - encodeChunk( - uint8, - i, - i + maxChunkLength > len2 ? len2 : i + maxChunkLength, - ), - ); - } // pad the end with zeros, but make sure to not forget the extra bytes - - if (extraBytes === 1) { - tmp = uint8[len - 1]; - parts.push(lookup[tmp >> 2] + lookup[(tmp << 4) & 63] + "=="); - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1]; - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 63] + - lookup[(tmp << 2) & 63] + - "=", - ); - } - return parts.join(""); - } - }, - {}, - ], - 21: [function (_dereq_, module, exports) {}, {}], - 22: [ - function (_dereq_, module, exports) { - (function (Buffer) { - /*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - /* eslint-disable no-proto */ - "use strict"; - var base64 = _dereq_("base64-js"); - var ieee754 = _dereq_("ieee754"); - var customInspectSymbol = - typeof Symbol === "function" && typeof Symbol.for === "function" - ? Symbol.for("nodejs.util.inspect.custom") - : null; - exports.Buffer = Buffer; - exports.SlowBuffer = SlowBuffer; - exports.INSPECT_MAX_BYTES = 50; - var K_MAX_LENGTH = 2147483647; - exports.kMaxLength = K_MAX_LENGTH; - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ - Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); - if ( - !Buffer.TYPED_ARRAY_SUPPORT && - typeof console !== "undefined" && - typeof console.error === "function" - ) { - console.error( - "This browser lacks typed array (Uint8Array) support which is required by " + - "`buffer` v5.x. Use `buffer` v4.x if you require old browser support.", - ); - } - function typedArraySupport() { - // Can typed array instances can be augmented? - try { - var arr = new Uint8Array(1); - var proto = { - foo: function () { - return 42; - }, - }; - Object.setPrototypeOf(proto, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto); - return arr.foo() === 42; - } catch (e) { - return false; - } - } - Object.defineProperty(Buffer.prototype, "parent", { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined; - return this.buffer; - }, - }); - Object.defineProperty(Buffer.prototype, "offset", { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined; - return this.byteOffset; - }, - }); - function createBuffer(length) { - if (length > K_MAX_LENGTH) { - throw new RangeError( - 'The value "' + length + '" is invalid for option "size"', - ); - } // Return an augmented `Uint8Array` instance - - var buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer.prototype); - return buf; - } /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer(arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === "number") { - if (typeof encodingOrOffset === "string") { - throw new TypeError( - 'The "string" argument must be of type string. Received type number', - ); - } - return allocUnsafe(arg); - } - return from(arg, encodingOrOffset, length); - } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - - if ( - typeof Symbol !== "undefined" && - Symbol.species != null && - Buffer[Symbol.species] === Buffer - ) { - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true, - enumerable: false, - writable: false, - }); - } - Buffer.poolSize = 8192; // not used by this implementation - function from(value, encodingOrOffset, length) { - if (typeof value === "string") { - return fromString(value, encodingOrOffset); - } - if (ArrayBuffer.isView(value)) { - return fromArrayLike(value); - } - if (value == null) { - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, " + - "or Array-like Object. Received type " + - typeof value, - ); - } - if ( - isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer)) - ) { - return fromArrayBuffer(value, encodingOrOffset, length); - } - if (typeof value === "number") { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number', - ); - } - var valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length); - } - var b = fromObject(value); - if (b) return b; - if ( - typeof Symbol !== "undefined" && - Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === "function" - ) { - return Buffer.from( - value[Symbol.toPrimitive]("string"), - encodingOrOffset, - length, - ); - } - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, " + - "or Array-like Object. Received type " + - typeof value, - ); - } /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - - Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length); - }; - // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: - // https://github.com/feross/buffer/pull/148 - Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer, Uint8Array); - function assertSize(size) { - if (typeof size !== "number") { - throw new TypeError('"size" argument must be of type number'); - } else if (size < 0) { - throw new RangeError( - 'The value "' + size + '" is invalid for option "size"', - ); - } - } - function alloc(size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(size); - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === "string" - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill); - } - return createBuffer(size); - } /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - - Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding); - }; - function allocUnsafe(size) { - assertSize(size); - return createBuffer(size < 0 ? 0 : checked(size) | 0); - } /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - - Buffer.allocUnsafe = function (size) { - return allocUnsafe(size); - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size); - }; - function fromString(string, encoding) { - if (typeof encoding !== "string" || encoding === "") { - encoding = "utf8"; - } - if (!Buffer.isEncoding(encoding)) { - throw new TypeError("Unknown encoding: " + encoding); - } - var length = byteLength(string, encoding) | 0; - var buf = createBuffer(length); - var actual = buf.write(string, encoding); - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual); - } - return buf; - } - function fromArrayLike(array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0; - var buf = createBuffer(length); - for (var i = 0; i < length; i += 1) { - buf[i] = array[i] & 255; - } - return buf; - } - function fromArrayBuffer(array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds'); - } - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds'); - } - var buf; - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array); - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset); - } else { - buf = new Uint8Array(array, byteOffset, length); - } // Return an augmented `Uint8Array` instance - - Object.setPrototypeOf(buf, Buffer.prototype); - return buf; - } - function fromObject(obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0; - var buf = createBuffer(len); - if (buf.length === 0) { - return buf; - } - obj.copy(buf, 0, 0, len); - return buf; - } - if (obj.length !== undefined) { - if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { - return createBuffer(0); - } - return fromArrayLike(obj); - } - if (obj.type === "Buffer" && Array.isArray(obj.data)) { - return fromArrayLike(obj.data); - } - } - function checked(length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError( - "Attempt to allocate Buffer larger than maximum " + - "size: 0x" + - K_MAX_LENGTH.toString(16) + - " bytes", - ); - } - return length | 0; - } - function SlowBuffer(length) { - if (+length != length) { - // eslint-disable-line eqeqeq - length = 0; - } - return Buffer.alloc(+length); - } - Buffer.isBuffer = function isBuffer(b) { - return ( - b != null && b._isBuffer === true && b !== Buffer.prototype - ); // so Buffer.isBuffer(Buffer.prototype) will be false - }; - Buffer.compare = function compare(a, b) { - if (isInstance(a, Uint8Array)) - a = Buffer.from(a, a.offset, a.byteLength); - if (isInstance(b, Uint8Array)) - b = Buffer.from(b, b.offset, b.byteLength); - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array', - ); - } - if (a === b) return 0; - var x = a.length; - var y = b.length; - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break; - } - } - if (x < y) return -1; - if (y < x) return 1; - return 0; - }; - Buffer.isEncoding = function isEncoding(encoding) { - switch (String(encoding).toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "latin1": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return true; - default: - return false; - } - }; - Buffer.concat = function concat(list, length) { - if (!Array.isArray(list)) { - throw new TypeError( - '"list" argument must be an Array of Buffers', - ); - } - if (list.length === 0) { - return Buffer.alloc(0); - } - var i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - var buffer = Buffer.allocUnsafe(length); - var pos = 0; - for (i = 0; i < list.length; ++i) { - var buf = list[i]; - if (isInstance(buf, Uint8Array)) { - buf = Buffer.from(buf); - } - if (!Buffer.isBuffer(buf)) { - throw new TypeError( - '"list" argument must be an Array of Buffers', - ); - } - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer; - }; - function byteLength(string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length; - } - if ( - ArrayBuffer.isView(string) || - isInstance(string, ArrayBuffer) - ) { - return string.byteLength; - } - if (typeof string !== "string") { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - "Received type " + - typeof string, - ); - } - var len = string.length; - var mustMatch = arguments.length > 2 && arguments[2] === true; - if (!mustMatch && len === 0) return 0; - // Use a for loop to avoid recursion - var loweredCase = false; - for (;;) { - switch (encoding) { - case "ascii": - case "latin1": - case "binary": - return len; - case "utf8": - case "utf-8": - return utf8ToBytes(string).length; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return len * 2; - case "hex": - return len >>> 1; - case "base64": - return base64ToBytes(string).length; - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 - } - encoding = ("" + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - function slowToString(encoding, start, end) { - var loweredCase = false; - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - - if (start > this.length) { - return ""; - } - if (end === undefined || end > this.length) { - end = this.length; - } - if (end <= 0) { - return ""; - } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - - end >>>= 0; - start >>>= 0; - if (end <= start) { - return ""; - } - if (!encoding) encoding = "utf8"; - while (true) { - switch (encoding) { - case "hex": - return hexSlice(this, start, end); - case "utf8": - case "utf-8": - return utf8Slice(this, start, end); - case "ascii": - return asciiSlice(this, start, end); - case "latin1": - case "binary": - return latin1Slice(this, start, end); - case "base64": - return base64Slice(this, start, end); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return utf16leSlice(this, start, end); - default: - if (loweredCase) - throw new TypeError("Unknown encoding: " + encoding); - encoding = (encoding + "").toLowerCase(); - loweredCase = true; - } - } - } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) - // to detect a Buffer instance. It's not possible to use `instanceof Buffer` - // reliably in a browserify context because there could be multiple different - // copies of the 'buffer' package in use. This method works even for Buffer - // instances that were created from another copy of the `buffer` package. - // See: https://github.com/feross/buffer/issues/154 - - Buffer.prototype._isBuffer = true; - function swap(b, n, m) { - var i = b[n]; - b[n] = b[m]; - b[m] = i; - } - Buffer.prototype.swap16 = function swap16() { - var len = this.length; - if (len % 2 !== 0) { - throw new RangeError( - "Buffer size must be a multiple of 16-bits", - ); - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this; - }; - Buffer.prototype.swap32 = function swap32() { - var len = this.length; - if (len % 4 !== 0) { - throw new RangeError( - "Buffer size must be a multiple of 32-bits", - ); - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this; - }; - Buffer.prototype.swap64 = function swap64() { - var len = this.length; - if (len % 8 !== 0) { - throw new RangeError( - "Buffer size must be a multiple of 64-bits", - ); - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this; - }; - Buffer.prototype.toString = function toString() { - var length = this.length; - if (length === 0) return ""; - if (arguments.length === 0) return utf8Slice(this, 0, length); - return slowToString.apply(this, arguments); - }; - Buffer.prototype.toLocaleString = Buffer.prototype.toString; - Buffer.prototype.equals = function equals(b) { - if (!Buffer.isBuffer(b)) - throw new TypeError("Argument must be a Buffer"); - if (this === b) return true; - return Buffer.compare(this, b) === 0; - }; - Buffer.prototype.inspect = function inspect() { - var str = ""; - var max = exports.INSPECT_MAX_BYTES; - str = this.toString("hex", 0, max) - .replace(/(.{2})/g, "$1 ") - .trim(); - if (this.length > max) str += " ... "; - return ""; - }; - if (customInspectSymbol) { - Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; - } - Buffer.prototype.compare = function compare( - target, - start, - end, - thisStart, - thisEnd, - ) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength); - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - "Received type " + - typeof target, - ); - } - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - if ( - start < 0 || - end > target.length || - thisStart < 0 || - thisEnd > this.length - ) { - throw new RangeError("out of range index"); - } - if (thisStart >= thisEnd && start >= end) { - return 0; - } - if (thisStart >= thisEnd) { - return -1; - } - if (start >= end) { - return 1; - } - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - if (this === target) return 0; - var x = thisEnd - thisStart; - var y = end - start; - var len = Math.min(x, y); - var thisCopy = this.slice(thisStart, thisEnd); - var targetCopy = target.slice(start, end); - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break; - } - } - if (x < y) return -1; - if (y < x) return 1; - return 0; - }; - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf( - buffer, - val, - byteOffset, - encoding, - dir, - ) { - // Empty buffer means no match - if (buffer.length === 0) return -1; - // Normalize byteOffset - if (typeof byteOffset === "string") { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 2147483647) { - byteOffset = 2147483647; - } else if (byteOffset < -2147483648) { - byteOffset = -2147483648; - } - byteOffset = +byteOffset; // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : buffer.length - 1; - } // Normalize byteOffset: negative offsets start from the end of the buffer - - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1; - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1; - } // Normalize val - - if (typeof val === "string") { - val = Buffer.from(val, encoding); - } // Finally, search either indexOf (if dir is true) or lastIndexOf - - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1; - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir); - } else if (typeof val === "number") { - val = val & 255; // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === "function") { - if (dir) { - return Uint8Array.prototype.indexOf.call( - buffer, - val, - byteOffset, - ); - } else { - return Uint8Array.prototype.lastIndexOf.call( - buffer, - val, - byteOffset, - ); - } - } - return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); - } - throw new TypeError("val must be string, number or Buffer"); - } - function arrayIndexOf(arr, val, byteOffset, encoding, dir) { - var indexSize = 1; - var arrLength = arr.length; - var valLength = val.length; - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if ( - encoding === "ucs2" || - encoding === "ucs-2" || - encoding === "utf16le" || - encoding === "utf-16le" - ) { - if (arr.length < 2 || val.length < 2) { - return -1; - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - function read(buf, i) { - if (indexSize === 1) { - return buf[i]; - } else { - return buf.readUInt16BE(i * indexSize); - } - } - var i; - if (dir) { - var foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if ( - read(arr, i) === - read(val, foundIndex === -1 ? 0 : i - foundIndex) - ) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) - return foundIndex * indexSize; - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) - byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - var found = true; - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break; - } - } - if (found) return i; - } - } - return -1; - } - Buffer.prototype.includes = function includes( - val, - byteOffset, - encoding, - ) { - return this.indexOf(val, byteOffset, encoding) !== -1; - }; - Buffer.prototype.indexOf = function indexOf( - val, - byteOffset, - encoding, - ) { - return bidirectionalIndexOf( - this, - val, - byteOffset, - encoding, - true, - ); - }; - Buffer.prototype.lastIndexOf = function lastIndexOf( - val, - byteOffset, - encoding, - ) { - return bidirectionalIndexOf( - this, - val, - byteOffset, - encoding, - false, - ); - }; - function hexWrite(buf, string, offset, length) { - offset = Number(offset) || 0; - var remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - var strLen = string.length; - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16); - if (numberIsNaN(parsed)) return i; - buf[offset + i] = parsed; - } - return i; - } - function utf8Write(buf, string, offset, length) { - return blitBuffer( - utf8ToBytes(string, buf.length - offset), - buf, - offset, - length, - ); - } - function asciiWrite(buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length); - } - function latin1Write(buf, string, offset, length) { - return asciiWrite(buf, string, offset, length); - } - function base64Write(buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length); - } - function ucs2Write(buf, string, offset, length) { - return blitBuffer( - utf16leToBytes(string, buf.length - offset), - buf, - offset, - length, - ); - } - Buffer.prototype.write = function write( - string, - offset, - length, - encoding, - ) { - // Buffer#write(string) - if (offset === undefined) { - encoding = "utf8"; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === "string") { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding === undefined) encoding = "utf8"; - } else { - encoding = length; - length = undefined; - } - } else { - throw new Error( - "Buffer.write(string, encoding, offset[, length]) is no longer supported", - ); - } - var remaining = this.length - offset; - if (length === undefined || length > remaining) - length = remaining; - if ( - (string.length > 0 && (length < 0 || offset < 0)) || - offset > this.length - ) { - throw new RangeError("Attempt to write outside buffer bounds"); - } - if (!encoding) encoding = "utf8"; - var loweredCase = false; - for (;;) { - switch (encoding) { - case "hex": - return hexWrite(this, string, offset, length); - case "utf8": - case "utf-8": - return utf8Write(this, string, offset, length); - case "ascii": - return asciiWrite(this, string, offset, length); - case "latin1": - case "binary": - return latin1Write(this, string, offset, length); - case "base64": - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return ucs2Write(this, string, offset, length); - default: - if (loweredCase) - throw new TypeError("Unknown encoding: " + encoding); - encoding = ("" + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - Buffer.prototype.toJSON = function toJSON() { - return { - type: "Buffer", - data: Array.prototype.slice.call(this._arr || this, 0), - }; - }; - function base64Slice(buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf); - } else { - return base64.fromByteArray(buf.slice(start, end)); - } - } - function utf8Slice(buf, start, end) { - end = Math.min(buf.length, end); - var res = []; - var i = start; - while (i < end) { - var firstByte = buf[i]; - var codePoint = null; - var bytesPerSequence = - firstByte > 239 - ? 4 - : firstByte > 223 - ? 3 - : firstByte > 191 - ? 2 - : 1; - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint; - switch (bytesPerSequence) { - case 1: - if (firstByte < 128) { - codePoint = firstByte; - } - break; - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 192) === 128) { - tempCodePoint = - ((firstByte & 31) << 6) | (secondByte & 63); - if (tempCodePoint > 127) { - codePoint = tempCodePoint; - } - } - break; - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ( - (secondByte & 192) === 128 && - (thirdByte & 192) === 128 - ) { - tempCodePoint = - ((firstByte & 15) << 12) | - ((secondByte & 63) << 6) | - (thirdByte & 63); - if ( - tempCodePoint > 2047 && - (tempCodePoint < 55296 || tempCodePoint > 57343) - ) { - codePoint = tempCodePoint; - } - } - break; - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ( - (secondByte & 192) === 128 && - (thirdByte & 192) === 128 && - (fourthByte & 192) === 128 - ) { - tempCodePoint = - ((firstByte & 15) << 18) | - ((secondByte & 63) << 12) | - ((thirdByte & 63) << 6) | - (fourthByte & 63); - if (tempCodePoint > 65535 && tempCodePoint < 1114112) { - codePoint = tempCodePoint; - } - } - } - } - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 65533; - bytesPerSequence = 1; - } else if (codePoint > 65535) { - // encode to utf16 (surrogate pair dance) - codePoint -= 65536; - res.push(((codePoint >>> 10) & 1023) | 55296); - codePoint = 56320 | (codePoint & 1023); - } - res.push(codePoint); - i += bytesPerSequence; - } - return decodeCodePointsArray(res); - } // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - - var MAX_ARGUMENTS_LENGTH = 4096; - function decodeCodePointsArray(codePoints) { - var len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints); // avoid extra slice() - } // Decode in chunks to avoid "call stack size exceeded". - - var res = ""; - var i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, (i += MAX_ARGUMENTS_LENGTH)), - ); - } - return res; - } - function asciiSlice(buf, start, end) { - var ret = ""; - end = Math.min(buf.length, end); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 127); - } - return ret; - } - function latin1Slice(buf, start, end) { - var ret = ""; - end = Math.min(buf.length, end); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret; - } - function hexSlice(buf, start, end) { - var len = buf.length; - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - var out = ""; - for (var i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]]; - } - return out; - } - function utf16leSlice(buf, start, end) { - var bytes = buf.slice(start, end); - var res = ""; - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res; - } - Buffer.prototype.slice = function slice(start, end) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - if (end < start) end = start; - var newBuf = this.subarray(start, end); - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(newBuf, Buffer.prototype); - return newBuf; - }; - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset(offset, ext, length) { - if (offset % 1 !== 0 || offset < 0) - throw new RangeError("offset is not uint"); - if (offset + ext > length) - throw new RangeError("Trying to access beyond buffer length"); - } - Buffer.prototype.readUIntLE = function readUIntLE( - offset, - byteLength, - noAssert, - ) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 256)) { - val += this[offset + i] * mul; - } - return val; - }; - Buffer.prototype.readUIntBE = function readUIntBE( - offset, - byteLength, - noAssert, - ) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - var val = this[offset + --byteLength]; - var mul = 1; - while (byteLength > 0 && (mul *= 256)) { - val += this[offset + --byteLength] * mul; - } - return val; - }; - Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset]; - }; - Buffer.prototype.readUInt16LE = function readUInt16LE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8); - }; - Buffer.prototype.readUInt16BE = function readUInt16BE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1]; - }; - Buffer.prototype.readUInt32LE = function readUInt32LE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ( - (this[offset] | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - this[offset + 3] * 16777216 - ); - }; - Buffer.prototype.readUInt32BE = function readUInt32BE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ( - this[offset] * 16777216 + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) - ); - }; - Buffer.prototype.readIntLE = function readIntLE( - offset, - byteLength, - noAssert, - ) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 256)) { - val += this[offset + i] * mul; - } - mul *= 128; - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - return val; - }; - Buffer.prototype.readIntBE = function readIntBE( - offset, - byteLength, - noAssert, - ) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - var i = byteLength; - var mul = 1; - var val = this[offset + --i]; - while (i > 0 && (mul *= 256)) { - val += this[offset + --i] * mul; - } - mul *= 128; - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - return val; - }; - Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 128)) return this[offset]; - return (255 - this[offset] + 1) * -1; - }; - Buffer.prototype.readInt16LE = function readInt16LE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset] | (this[offset + 1] << 8); - return val & 32768 ? val | 4294901760 : val; - }; - Buffer.prototype.readInt16BE = function readInt16BE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset + 1] | (this[offset] << 8); - return val & 32768 ? val | 4294901760 : val; - }; - Buffer.prototype.readInt32LE = function readInt32LE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ( - this[offset] | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - ); - }; - Buffer.prototype.readInt32BE = function readInt32BE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ( - (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3] - ); - }; - Buffer.prototype.readFloatLE = function readFloatLE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, true, 23, 4); - }; - Buffer.prototype.readFloatBE = function readFloatBE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, false, 23, 4); - }; - Buffer.prototype.readDoubleLE = function readDoubleLE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, true, 52, 8); - }; - Buffer.prototype.readDoubleBE = function readDoubleBE( - offset, - noAssert, - ) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, false, 52, 8); - }; - function checkInt(buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) - throw new TypeError( - '"buffer" argument must be a Buffer instance', - ); - if (value > max || value < min) - throw new RangeError('"value" argument is out of bounds'); - if (offset + ext > buf.length) - throw new RangeError("Index out of range"); - } - Buffer.prototype.writeUIntLE = function writeUIntLE( - value, - offset, - byteLength, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - var mul = 1; - var i = 0; - this[offset] = value & 255; - while (++i < byteLength && (mul *= 256)) { - this[offset + i] = (value / mul) & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeUIntBE = function writeUIntBE( - value, - offset, - byteLength, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - var i = byteLength - 1; - var mul = 1; - this[offset + i] = value & 255; - while (--i >= 0 && (mul *= 256)) { - this[offset + i] = (value / mul) & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeUInt8 = function writeUInt8( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 255, 0); - this[offset] = value & 255; - return offset + 1; - }; - Buffer.prototype.writeUInt16LE = function writeUInt16LE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - return offset + 2; - }; - Buffer.prototype.writeUInt16BE = function writeUInt16BE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); - this[offset] = value >>> 8; - this[offset + 1] = value & 255; - return offset + 2; - }; - Buffer.prototype.writeUInt32LE = function writeUInt32LE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); - this[offset + 3] = value >>> 24; - this[offset + 2] = value >>> 16; - this[offset + 1] = value >>> 8; - this[offset] = value & 255; - return offset + 4; - }; - Buffer.prototype.writeUInt32BE = function writeUInt32BE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); - this[offset] = value >>> 24; - this[offset + 1] = value >>> 16; - this[offset + 2] = value >>> 8; - this[offset + 3] = value & 255; - return offset + 4; - }; - Buffer.prototype.writeIntLE = function writeIntLE( - value, - offset, - byteLength, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - var i = 0; - var mul = 1; - var sub = 0; - this[offset] = value & 255; - while (++i < byteLength && (mul *= 256)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = (((value / mul) >> 0) - sub) & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeIntBE = function writeIntBE( - value, - offset, - byteLength, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - var i = byteLength - 1; - var mul = 1; - var sub = 0; - this[offset + i] = value & 255; - while (--i >= 0 && (mul *= 256)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = (((value / mul) >> 0) - sub) & 255; - } - return offset + byteLength; - }; - Buffer.prototype.writeInt8 = function writeInt8( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 127, -128); - if (value < 0) value = 255 + value + 1; - this[offset] = value & 255; - return offset + 1; - }; - Buffer.prototype.writeInt16LE = function writeInt16LE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - return offset + 2; - }; - Buffer.prototype.writeInt16BE = function writeInt16BE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); - this[offset] = value >>> 8; - this[offset + 1] = value & 255; - return offset + 2; - }; - Buffer.prototype.writeInt32LE = function writeInt32LE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 4, 2147483647, -2147483648); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - this[offset + 2] = value >>> 16; - this[offset + 3] = value >>> 24; - return offset + 4; - }; - Buffer.prototype.writeInt32BE = function writeInt32BE( - value, - offset, - noAssert, - ) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 4, 2147483647, -2147483648); - if (value < 0) value = 4294967295 + value + 1; - this[offset] = value >>> 24; - this[offset + 1] = value >>> 16; - this[offset + 2] = value >>> 8; - this[offset + 3] = value & 255; - return offset + 4; - }; - function checkIEEE754(buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) - throw new RangeError("Index out of range"); - if (offset < 0) throw new RangeError("Index out of range"); - } - function writeFloat(buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754( - buf, - value, - offset, - 4, - 3.4028234663852886e38, - -3.4028234663852886e38, - ); - } - ieee754.write(buf, value, offset, littleEndian, 23, 4); - return offset + 4; - } - Buffer.prototype.writeFloatLE = function writeFloatLE( - value, - offset, - noAssert, - ) { - return writeFloat(this, value, offset, true, noAssert); - }; - Buffer.prototype.writeFloatBE = function writeFloatBE( - value, - offset, - noAssert, - ) { - return writeFloat(this, value, offset, false, noAssert); - }; - function writeDouble(buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754( - buf, - value, - offset, - 8, - 1.7976931348623157e308, - -1.7976931348623157e308, - ); - } - ieee754.write(buf, value, offset, littleEndian, 52, 8); - return offset + 8; - } - Buffer.prototype.writeDoubleLE = function writeDoubleLE( - value, - offset, - noAssert, - ) { - return writeDouble(this, value, offset, true, noAssert); - }; - Buffer.prototype.writeDoubleBE = function writeDoubleBE( - value, - offset, - noAssert, - ) { - return writeDouble(this, value, offset, false, noAssert); - }; - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy( - target, - targetStart, - start, - end, - ) { - if (!Buffer.isBuffer(target)) - throw new TypeError("argument should be a Buffer"); - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - // Copy 0 bytes; we're done - if (end === start) return 0; - if (target.length === 0 || this.length === 0) return 0; - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError("targetStart out of bounds"); - } - if (start < 0 || start >= this.length) - throw new RangeError("Index out of range"); - if (end < 0) throw new RangeError("sourceEnd out of bounds"); - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - var len = end - start; - if ( - this === target && - typeof Uint8Array.prototype.copyWithin === "function" - ) { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end); - } else if ( - this === target && - start < targetStart && - targetStart < end - ) { - // descending copy from end - for (var i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start]; - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart, - ); - } - return len; - }; - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill(val, start, end, encoding) { - // Handle string cases: - if (typeof val === "string") { - if (typeof start === "string") { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === "string") { - encoding = end; - end = this.length; - } - if (encoding !== undefined && typeof encoding !== "string") { - throw new TypeError("encoding must be a string"); - } - if ( - typeof encoding === "string" && - !Buffer.isEncoding(encoding) - ) { - throw new TypeError("Unknown encoding: " + encoding); - } - if (val.length === 1) { - var code = val.charCodeAt(0); - if ( - (encoding === "utf8" && code < 128) || - encoding === "latin1" - ) { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code; - } - } - } else if (typeof val === "number") { - val = val & 255; - } else if (typeof val === "boolean") { - val = Number(val); - } // Invalid ranges are not set to a default, so can range check early. - - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError("Out of range index"); - } - if (end <= start) { - return this; - } - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - if (!val) val = 0; - var i; - if (typeof val === "number") { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding); - var len = bytes.length; - if (len === 0) { - throw new TypeError( - 'The value "' + val + '" is invalid for argument "value"', - ); - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - return this; - }; - // HELPER FUNCTIONS - // ================ - var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - function base64clean(str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split("=")[0]; - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, ""); - // Node converts strings with length < 2 to '' - if (str.length < 2) return ""; - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + "="; - } - return str; - } - function utf8ToBytes(string, units) { - units = units || Infinity; - var codePoint; - var length = string.length; - var leadSurrogate = null; - var bytes = []; - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - // is surrogate component - if (codePoint > 55295 && codePoint < 57344) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 56319) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(239, 191, 189); - continue; - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(239, 191, 189); - continue; - } // valid lead - - leadSurrogate = codePoint; - continue; - } // 2 leads in a row - - if (codePoint < 56320) { - if ((units -= 3) > -1) bytes.push(239, 191, 189); - leadSurrogate = codePoint; - continue; - } // valid surrogate pair - - codePoint = - (((leadSurrogate - 55296) << 10) | (codePoint - 56320)) + - 65536; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(239, 191, 189); - } - leadSurrogate = null; - // encode utf8 - if (codePoint < 128) { - if ((units -= 1) < 0) break; - bytes.push(codePoint); - } else if (codePoint < 2048) { - if ((units -= 2) < 0) break; - bytes.push((codePoint >> 6) | 192, (codePoint & 63) | 128); - } else if (codePoint < 65536) { - if ((units -= 3) < 0) break; - bytes.push( - (codePoint >> 12) | 224, - ((codePoint >> 6) & 63) | 128, - (codePoint & 63) | 128, - ); - } else if (codePoint < 1114112) { - if ((units -= 4) < 0) break; - bytes.push( - (codePoint >> 18) | 240, - ((codePoint >> 12) & 63) | 128, - ((codePoint >> 6) & 63) | 128, - (codePoint & 63) | 128, - ); - } else { - throw new Error("Invalid code point"); - } - } - return bytes; - } - function asciiToBytes(str) { - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 255); - } - return byteArray; - } - function utf16leToBytes(str, units) { - var c, hi, lo; - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break; - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - return byteArray; - } - function base64ToBytes(str) { - return base64.toByteArray(base64clean(str)); - } - function blitBuffer(src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if (i + offset >= dst.length || i >= src.length) break; - dst[i + offset] = src[i]; - } - return i; - } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass - // the `instanceof` check but they should be treated as of that type. - // See: https://github.com/feross/buffer/issues/166 - - function isInstance(obj, type) { - return ( - obj instanceof type || - (obj != null && - obj.constructor != null && - obj.constructor.name != null && - obj.constructor.name === type.name) - ); - } - function numberIsNaN(obj) { - // For IE11 support - return obj !== obj; // eslint-disable-line no-self-compare - } // Create lookup table for `toString('hex')` - // See: https://github.com/feross/buffer/issues/219 - - var hexSliceLookupTable = (function () { - var alphabet = "0123456789abcdef"; - var table = new Array(256); - for (var i = 0; i < 16; ++i) { - var i16 = i * 16; - for (var j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j]; - } - } - return table; - })(); - }).call(this, _dereq_("buffer").Buffer); - }, - { - "base64-js": 20, - buffer: 22, - ieee754: 268, - }, - ], - 23: [ - function (_dereq_, module, exports) { - module.exports = function (it) { - if (typeof it != "function") { - throw TypeError(String(it) + " is not a function"); - } - return it; - }; - }, - {}, - ], - 24: [ - function (_dereq_, module, exports) { - var isObject = _dereq_("../internals/is-object"); - module.exports = function (it) { - if (!isObject(it) && it !== null) { - throw TypeError("Can't set " + String(it) + " as a prototype"); - } - return it; - }; - }, - { - "../internals/is-object": 92, - }, - ], - 25: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var create = _dereq_("../internals/object-create"); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var UNSCOPABLES = wellKnownSymbol("unscopables"); - var ArrayPrototype = Array.prototype; - // Array.prototype[@@unscopables] - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - if (ArrayPrototype[UNSCOPABLES] == undefined) { - definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { - configurable: true, - value: create(null), - }); - } // add a key to Array.prototype[@@unscopables] - - module.exports = function (key) { - ArrayPrototype[UNSCOPABLES][key] = true; - }; - }, - { - "../internals/object-create": 108, - "../internals/object-define-property": 110, - "../internals/well-known-symbol": 166, - }, - ], - 26: [ - function (_dereq_, module, exports) { - "use strict"; - var charAt = _dereq_("../internals/string-multibyte").charAt; - // `AdvanceStringIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-advancestringindex - module.exports = function (S, index, unicode) { - return index + (unicode ? charAt(S, index).length : 1); - }; - }, - { - "../internals/string-multibyte": 141, - }, - ], - 27: [ - function (_dereq_, module, exports) { - module.exports = function (it, Constructor, name) { - if (!(it instanceof Constructor)) { - throw TypeError( - "Incorrect " + (name ? name + " " : "") + "invocation", - ); - } - return it; - }; - }, - {}, - ], - 28: [ - function (_dereq_, module, exports) { - var isObject = _dereq_("../internals/is-object"); - module.exports = function (it) { - if (!isObject(it)) { - throw TypeError(String(it) + " is not an object"); - } - return it; - }; - }, - { - "../internals/is-object": 92, - }, - ], - 29: [ - function (_dereq_, module, exports) { - module.exports = - typeof ArrayBuffer !== "undefined" && - typeof DataView !== "undefined"; - }, - {}, - ], - 30: [ - function (_dereq_, module, exports) { - "use strict"; - var NATIVE_ARRAY_BUFFER = _dereq_("../internals/array-buffer-native"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var global = _dereq_("../internals/global"); - var isObject = _dereq_("../internals/is-object"); - var has = _dereq_("../internals/has"); - var classof = _dereq_("../internals/classof"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var redefine = _dereq_("../internals/redefine"); - var defineProperty = _dereq_("../internals/object-define-property").f; - var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); - var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var uid = _dereq_("../internals/uid"); - var Int8Array = global.Int8Array; - var Int8ArrayPrototype = Int8Array && Int8Array.prototype; - var Uint8ClampedArray = global.Uint8ClampedArray; - var Uint8ClampedArrayPrototype = - Uint8ClampedArray && Uint8ClampedArray.prototype; - var TypedArray = Int8Array && getPrototypeOf(Int8Array); - var TypedArrayPrototype = - Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); - var ObjectPrototype = Object.prototype; - var isPrototypeOf = ObjectPrototype.isPrototypeOf; - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG"); - // Fixing native typed arrays in Opera Presto crashes the browser, see #595 - var NATIVE_ARRAY_BUFFER_VIEWS = - NATIVE_ARRAY_BUFFER && - !!setPrototypeOf && - classof(global.opera) !== "Opera"; - var TYPED_ARRAY_TAG_REQIRED = false; - var NAME; - var TypedArrayConstructorsList = { - Int8Array: 1, - Uint8Array: 1, - Uint8ClampedArray: 1, - Int16Array: 2, - Uint16Array: 2, - Int32Array: 4, - Uint32Array: 4, - Float32Array: 4, - Float64Array: 8, - }; - var isView = function isView(it) { - var klass = classof(it); - return ( - klass === "DataView" || has(TypedArrayConstructorsList, klass) - ); - }; - var isTypedArray = function (it) { - return isObject(it) && has(TypedArrayConstructorsList, classof(it)); - }; - var aTypedArray = function (it) { - if (isTypedArray(it)) return it; - throw TypeError("Target is not a typed array"); - }; - var aTypedArrayConstructor = function (C) { - if (setPrototypeOf) { - if (isPrototypeOf.call(TypedArray, C)) return C; - } else - for (var ARRAY in TypedArrayConstructorsList) - if (has(TypedArrayConstructorsList, NAME)) { - var TypedArrayConstructor = global[ARRAY]; - if ( - TypedArrayConstructor && - (C === TypedArrayConstructor || - isPrototypeOf.call(TypedArrayConstructor, C)) - ) { - return C; - } - } - throw TypeError("Target is not a typed array constructor"); - }; - var exportTypedArrayMethod = function (KEY, property, forced) { - if (!DESCRIPTORS) return; - if (forced) - for (var ARRAY in TypedArrayConstructorsList) { - var TypedArrayConstructor = global[ARRAY]; - if ( - TypedArrayConstructor && - has(TypedArrayConstructor.prototype, KEY) - ) { - delete TypedArrayConstructor.prototype[KEY]; - } - } - if (!TypedArrayPrototype[KEY] || forced) { - redefine( - TypedArrayPrototype, - KEY, - forced - ? property - : (NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY]) || - property, - ); - } - }; - var exportTypedArrayStaticMethod = function (KEY, property, forced) { - var ARRAY, TypedArrayConstructor; - if (!DESCRIPTORS) return; - if (setPrototypeOf) { - if (forced) - for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; - if ( - TypedArrayConstructor && - has(TypedArrayConstructor, KEY) - ) { - delete TypedArrayConstructor[KEY]; - } - } - if (!TypedArray[KEY] || forced) { - // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable - try { - return redefine( - TypedArray, - KEY, - forced - ? property - : (NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY]) || - property, - ); - } catch (error) { - /* empty */ - } - } else return; - } - for (ARRAY in TypedArrayConstructorsList) { - TypedArrayConstructor = global[ARRAY]; - if ( - TypedArrayConstructor && - (!TypedArrayConstructor[KEY] || forced) - ) { - redefine(TypedArrayConstructor, KEY, property); - } - } - }; - for (NAME in TypedArrayConstructorsList) { - if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; - } // WebKit bug - typed arrays constructors prototype is Object.prototype - - if ( - !NATIVE_ARRAY_BUFFER_VIEWS || - typeof TypedArray != "function" || - TypedArray === Function.prototype - ) { - // eslint-disable-next-line no-shadow - TypedArray = function TypedArray() { - throw TypeError("Incorrect invocation"); - }; - if (NATIVE_ARRAY_BUFFER_VIEWS) - for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); - } - } - if ( - !NATIVE_ARRAY_BUFFER_VIEWS || - !TypedArrayPrototype || - TypedArrayPrototype === ObjectPrototype - ) { - TypedArrayPrototype = TypedArray.prototype; - if (NATIVE_ARRAY_BUFFER_VIEWS) - for (NAME in TypedArrayConstructorsList) { - if (global[NAME]) - setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); - } - } // WebKit bug - one more object in Uint8ClampedArray prototype chain - - if ( - NATIVE_ARRAY_BUFFER_VIEWS && - getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype - ) { - setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); - } - if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { - TYPED_ARRAY_TAG_REQIRED = true; - defineProperty(TypedArrayPrototype, TO_STRING_TAG, { - get: function () { - return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; - }, - }); - for (NAME in TypedArrayConstructorsList) - if (global[NAME]) { - createNonEnumerableProperty( - global[NAME], - TYPED_ARRAY_TAG, - NAME, - ); - } - } - module.exports = { - NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, - TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, - aTypedArray: aTypedArray, - aTypedArrayConstructor: aTypedArrayConstructor, - exportTypedArrayMethod: exportTypedArrayMethod, - exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, - isView: isView, - isTypedArray: isTypedArray, - TypedArray: TypedArray, - TypedArrayPrototype: TypedArrayPrototype, - }; - }, - { - "../internals/array-buffer-native": 29, - "../internals/classof": 47, - "../internals/create-non-enumerable-property": 56, - "../internals/descriptors": 61, - "../internals/global": 77, - "../internals/has": 78, - "../internals/is-object": 92, - "../internals/object-define-property": 110, - "../internals/object-get-prototype-of": 115, - "../internals/object-set-prototype-of": 119, - "../internals/redefine": 126, - "../internals/uid": 163, - "../internals/well-known-symbol": 166, - }, - ], - 31: [ - function (_dereq_, module, exports) { - "use strict"; - var global = _dereq_("../internals/global"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var NATIVE_ARRAY_BUFFER = _dereq_("../internals/array-buffer-native"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var redefineAll = _dereq_("../internals/redefine-all"); - var fails = _dereq_("../internals/fails"); - var anInstance = _dereq_("../internals/an-instance"); - var toInteger = _dereq_("../internals/to-integer"); - var toLength = _dereq_("../internals/to-length"); - var toIndex = _dereq_("../internals/to-index"); - var IEEE754 = _dereq_("../internals/ieee754"); - var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); - var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); - var getOwnPropertyNames = _dereq_( - "../internals/object-get-own-property-names", - ).f; - var defineProperty = _dereq_("../internals/object-define-property").f; - var arrayFill = _dereq_("../internals/array-fill"); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var InternalStateModule = _dereq_("../internals/internal-state"); - var getInternalState = InternalStateModule.get; - var setInternalState = InternalStateModule.set; - var ARRAY_BUFFER = "ArrayBuffer"; - var DATA_VIEW = "DataView"; - var PROTOTYPE = "prototype"; - var WRONG_LENGTH = "Wrong length"; - var WRONG_INDEX = "Wrong index"; - var NativeArrayBuffer = global[ARRAY_BUFFER]; - var $ArrayBuffer = NativeArrayBuffer; - var $DataView = global[DATA_VIEW]; - var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; - var ObjectPrototype = Object.prototype; - var RangeError = global.RangeError; - var packIEEE754 = IEEE754.pack; - var unpackIEEE754 = IEEE754.unpack; - var packInt8 = function (number) { - return [number & 255]; - }; - var packInt16 = function (number) { - return [number & 255, (number >> 8) & 255]; - }; - var packInt32 = function (number) { - return [ - number & 255, - (number >> 8) & 255, - (number >> 16) & 255, - (number >> 24) & 255, - ]; - }; - var unpackInt32 = function (buffer) { - return ( - (buffer[3] << 24) | - (buffer[2] << 16) | - (buffer[1] << 8) | - buffer[0] - ); - }; - var packFloat32 = function (number) { - return packIEEE754(number, 23, 4); - }; - var packFloat64 = function (number) { - return packIEEE754(number, 52, 8); - }; - var addGetter = function (Constructor, key) { - defineProperty(Constructor[PROTOTYPE], key, { - get: function () { - return getInternalState(this)[key]; - }, - }); - }; - var get = function (view, count, index, isLittleEndian) { - var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) - throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; - var start = intIndex + store.byteOffset; - var pack = bytes.slice(start, start + count); - return isLittleEndian ? pack : pack.reverse(); - }; - var set = function ( - view, - count, - index, - conversion, - value, - isLittleEndian, - ) { - var intIndex = toIndex(index); - var store = getInternalState(view); - if (intIndex + count > store.byteLength) - throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; - var start = intIndex + store.byteOffset; - var pack = conversion(+value); - for (var i = 0; i < count; i++) - bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; - }; - if (!NATIVE_ARRAY_BUFFER) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - setInternalState(this, { - bytes: arrayFill.call(new Array(byteLength), 0), - byteLength: byteLength, - }); - if (!DESCRIPTORS) this.byteLength = byteLength; - }; - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = getInternalState(buffer).byteLength; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) - throw RangeError("Wrong offset"); - byteLength = - byteLength === undefined - ? bufferLength - offset - : toLength(byteLength); - if (offset + byteLength > bufferLength) - throw RangeError(WRONG_LENGTH); - setInternalState(this, { - buffer: buffer, - byteLength: byteLength, - byteOffset: offset, - }); - if (!DESCRIPTORS) { - this.buffer = buffer; - this.byteLength = byteLength; - this.byteOffset = offset; - } - }; - if (DESCRIPTORS) { - addGetter($ArrayBuffer, "byteLength"); - addGetter($DataView, "buffer"); - addGetter($DataView, "byteLength"); - addGetter($DataView, "byteOffset"); - } - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return (get(this, 1, byteOffset)[0] << 24) >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get( - this, - 2, - byteOffset, - arguments.length > 1 ? arguments[1] : undefined, - ); - return (((bytes[1] << 8) | bytes[0]) << 16) >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get( - this, - 2, - byteOffset, - arguments.length > 1 ? arguments[1] : undefined, - ); - return (bytes[1] << 8) | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackInt32( - get( - this, - 4, - byteOffset, - arguments.length > 1 ? arguments[1] : undefined, - ), - ); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return ( - unpackInt32( - get( - this, - 4, - byteOffset, - arguments.length > 1 ? arguments[1] : undefined, - ), - ) >>> 0 - ); - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754( - get( - this, - 4, - byteOffset, - arguments.length > 1 ? arguments[1] : undefined, - ), - 23, - ); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754( - get( - this, - 8, - byteOffset, - arguments.length > 1 ? arguments[1] : undefined, - ), - 52, - ); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packInt8, value); - }, - setInt16: function setInt16( - byteOffset, - value /* , littleEndian */, - ) { - set( - this, - 2, - byteOffset, - packInt16, - value, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - setUint16: function setUint16( - byteOffset, - value /* , littleEndian */, - ) { - set( - this, - 2, - byteOffset, - packInt16, - value, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - setInt32: function setInt32( - byteOffset, - value /* , littleEndian */, - ) { - set( - this, - 4, - byteOffset, - packInt32, - value, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - setUint32: function setUint32( - byteOffset, - value /* , littleEndian */, - ) { - set( - this, - 4, - byteOffset, - packInt32, - value, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - setFloat32: function setFloat32( - byteOffset, - value /* , littleEndian */, - ) { - set( - this, - 4, - byteOffset, - packFloat32, - value, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - setFloat64: function setFloat64( - byteOffset, - value /* , littleEndian */, - ) { - set( - this, - 8, - byteOffset, - packFloat64, - value, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - }); - } else { - if ( - !fails(function () { - NativeArrayBuffer(1); - }) || - !fails(function () { - new NativeArrayBuffer(-1); // eslint-disable-line no-new - }) || - fails(function () { - new NativeArrayBuffer(); // eslint-disable-line no-new - new NativeArrayBuffer(1.5); // eslint-disable-line no-new - new NativeArrayBuffer(NaN); // eslint-disable-line no-new - return NativeArrayBuffer.name != ARRAY_BUFFER; - }) - ) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new NativeArrayBuffer(toIndex(length)); - }; - var ArrayBufferPrototype = ($ArrayBuffer[PROTOTYPE] = - NativeArrayBuffer[PROTOTYPE]); - for ( - var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; - keys.length > j; - - ) { - if (!((key = keys[j++]) in $ArrayBuffer)) { - createNonEnumerableProperty( - $ArrayBuffer, - key, - NativeArrayBuffer[key], - ); - } - } - ArrayBufferPrototype.constructor = $ArrayBuffer; - } // WebKit bug - the same parent prototype for typed arrays and data view - - if ( - setPrototypeOf && - getPrototypeOf($DataViewPrototype) !== ObjectPrototype - ) { - setPrototypeOf($DataViewPrototype, ObjectPrototype); - } // iOS Safari 7.x bug - - var testView = new $DataView(new $ArrayBuffer(2)); - var nativeSetInt8 = $DataViewPrototype.setInt8; - testView.setInt8(0, 2147483648); - testView.setInt8(1, 2147483649); - if (testView.getInt8(0) || !testView.getInt8(1)) - redefineAll( - $DataViewPrototype, - { - setInt8: function setInt8(byteOffset, value) { - nativeSetInt8.call(this, byteOffset, (value << 24) >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - nativeSetInt8.call(this, byteOffset, (value << 24) >> 24); - }, - }, - { - unsafe: true, - }, - ); - } - setToStringTag($ArrayBuffer, ARRAY_BUFFER); - setToStringTag($DataView, DATA_VIEW); - module.exports = { - ArrayBuffer: $ArrayBuffer, - DataView: $DataView, - }; - }, - { - "../internals/an-instance": 27, - "../internals/array-buffer-native": 29, - "../internals/array-fill": 33, - "../internals/create-non-enumerable-property": 56, - "../internals/descriptors": 61, - "../internals/fails": 69, - "../internals/global": 77, - "../internals/ieee754": 83, - "../internals/internal-state": 88, - "../internals/object-define-property": 110, - "../internals/object-get-own-property-names": 113, - "../internals/object-get-prototype-of": 115, - "../internals/object-set-prototype-of": 119, - "../internals/redefine-all": 125, - "../internals/set-to-string-tag": 135, - "../internals/to-index": 151, - "../internals/to-integer": 153, - "../internals/to-length": 154, - }, - ], - 32: [ - function (_dereq_, module, exports) { - "use strict"; - var toObject = _dereq_("../internals/to-object"); - var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); - var toLength = _dereq_("../internals/to-length"); - var min = Math.min; - // `Array.prototype.copyWithin` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin - module.exports = - [].copyWithin || - function copyWithin( - target /* = 0 */, - start /* = 0, end = @length */, - ) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = min( - (end === undefined ? len : toAbsoluteIndex(end, len)) - from, - len - to, - ); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } - return O; - }; - }, - { - "../internals/to-absolute-index": 150, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 33: [ - function (_dereq_, module, exports) { - "use strict"; - var toObject = _dereq_("../internals/to-object"); - var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); - var toLength = _dereq_("../internals/to-length"); - // `Array.prototype.fill` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.fill - module.exports = function fill( - value /* , start = 0, end = @length */, - ) { - var O = toObject(this); - var length = toLength(O.length); - var argumentsLength = arguments.length; - var index = toAbsoluteIndex( - argumentsLength > 1 ? arguments[1] : undefined, - length, - ); - var end = argumentsLength > 2 ? arguments[2] : undefined; - var endPos = - end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; - }; - }, - { - "../internals/to-absolute-index": 150, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 34: [ - function (_dereq_, module, exports) { - "use strict"; - var $forEach = _dereq_("../internals/array-iteration").forEach; - var arrayMethodIsStrict = _dereq_( - "../internals/array-method-is-strict", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var STRICT_METHOD = arrayMethodIsStrict("forEach"); - var USES_TO_LENGTH = arrayMethodUsesToLength("forEach"); - // `Array.prototype.forEach` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - module.exports = - !STRICT_METHOD || !USES_TO_LENGTH - ? function forEach(callbackfn /* , thisArg */) { - return $forEach( - this, - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - } - : [].forEach; - }, - { - "../internals/array-iteration": 37, - "../internals/array-method-is-strict": 40, - "../internals/array-method-uses-to-length": 41, - }, - ], - 35: [ - function (_dereq_, module, exports) { - "use strict"; - var bind = _dereq_("../internals/function-bind-context"); - var toObject = _dereq_("../internals/to-object"); - var callWithSafeIterationClosing = _dereq_( - "../internals/call-with-safe-iteration-closing", - ); - var isArrayIteratorMethod = _dereq_( - "../internals/is-array-iterator-method", - ); - var toLength = _dereq_("../internals/to-length"); - var createProperty = _dereq_("../internals/create-property"); - var getIteratorMethod = _dereq_("../internals/get-iterator-method"); - // `Array.from` method implementation - // https://tc39.github.io/ecma262/#sec-array.from - module.exports = function from( - arrayLike /* , mapfn = undefined, thisArg = undefined */, - ) { - var O = toObject(arrayLike); - var C = typeof this == "function" ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var index = 0; - var length, result, step, iterator, next, value; - if (mapping) - mapfn = bind( - mapfn, - argumentsLength > 2 ? arguments[2] : undefined, - 2, - ); - // if the target is not iterable or it's an array with the default iterator - use a simple case - if ( - iteratorMethod != undefined && - !(C == Array && isArrayIteratorMethod(iteratorMethod)) - ) { - iterator = iteratorMethod.call(O); - next = iterator.next; - result = new C(); - for (; !(step = next.call(iterator)).done; index++) { - value = mapping - ? callWithSafeIterationClosing( - iterator, - mapfn, - [step.value, index], - true, - ) - : step.value; - createProperty(result, index, value); - } - } else { - length = toLength(O.length); - result = new C(length); - for (; length > index; index++) { - value = mapping ? mapfn(O[index], index) : O[index]; - createProperty(result, index, value); - } - } - result.length = index; - return result; - }; - }, - { - "../internals/call-with-safe-iteration-closing": 44, - "../internals/create-property": 58, - "../internals/function-bind-context": 72, - "../internals/get-iterator-method": 75, - "../internals/is-array-iterator-method": 89, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 36: [ - function (_dereq_, module, exports) { - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var toLength = _dereq_("../internals/to-length"); - var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); - // `Array.prototype.{ indexOf, includes }` methods implementation - var createMethod = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) - while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } - else - for (; length > index; index++) { - if ((IS_INCLUDES || index in O) && O[index] === el) - return IS_INCLUDES || index || 0; - } - return !IS_INCLUDES && -1; - }; - }; - module.exports = { - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - includes: createMethod(true), - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - indexOf: createMethod(false), - }; - }, - { - "../internals/to-absolute-index": 150, - "../internals/to-indexed-object": 152, - "../internals/to-length": 154, - }, - ], - 37: [ - function (_dereq_, module, exports) { - var bind = _dereq_("../internals/function-bind-context"); - var IndexedObject = _dereq_("../internals/indexed-object"); - var toObject = _dereq_("../internals/to-object"); - var toLength = _dereq_("../internals/to-length"); - var arraySpeciesCreate = _dereq_("../internals/array-species-create"); - var push = [].push; - // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation - var createMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - return function ($this, callbackfn, that, specificCreate) { - var O = toObject($this); - var self = IndexedObject(O); - var boundFunction = bind(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP - ? create($this, length) - : IS_FILTER - ? create($this, 0) - : undefined; - var value, result; - for (; length > index; index++) - if (NO_HOLES || index in self) { - value = self[index]; - result = boundFunction(value, index, O); - if (TYPE) { - if (IS_MAP) target[index] = result; // map - else if (result) - switch (TYPE) { - case 3: - return true; - // some - case 5: - return value; - // find - case 6: - return index; - // findIndex - case 2: - push.call(target, value); - // filter - } - else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX - ? -1 - : IS_SOME || IS_EVERY - ? IS_EVERY - : target; - }; - }; - module.exports = { - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - forEach: createMethod(0), - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - map: createMethod(1), - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - filter: createMethod(2), - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - some: createMethod(3), - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - every: createMethod(4), - // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find - find: createMethod(5), - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - findIndex: createMethod(6), - }; - }, - { - "../internals/array-species-create": 43, - "../internals/function-bind-context": 72, - "../internals/indexed-object": 84, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 38: [ - function (_dereq_, module, exports) { - "use strict"; - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var toInteger = _dereq_("../internals/to-integer"); - var toLength = _dereq_("../internals/to-length"); - var arrayMethodIsStrict = _dereq_( - "../internals/array-method-is-strict", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var min = Math.min; - var nativeLastIndexOf = [].lastIndexOf; - var NEGATIVE_ZERO = - !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; - var STRICT_METHOD = arrayMethodIsStrict("lastIndexOf"); - // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method - var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { - ACCESSORS: true, - 1: 0, - }); - var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH; - // `Array.prototype.lastIndexOf` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof - module.exports = FORCED - ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) - return nativeLastIndexOf.apply(this, arguments) || 0; - var O = toIndexedObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) - index = min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (; index >= 0; index--) - if (index in O && O[index] === searchElement) - return index || 0; - return -1; - } - : nativeLastIndexOf; - }, - { - "../internals/array-method-is-strict": 40, - "../internals/array-method-uses-to-length": 41, - "../internals/to-indexed-object": 152, - "../internals/to-integer": 153, - "../internals/to-length": 154, - }, - ], - 39: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var V8_VERSION = _dereq_("../internals/engine-v8-version"); - var SPECIES = wellKnownSymbol("species"); - module.exports = function (METHOD_NAME) { - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/677 - return ( - V8_VERSION >= 51 || - !fails(function () { - var array = []; - var constructor = (array.constructor = {}); - constructor[SPECIES] = function () { - return { - foo: 1, - }; - }; - return array[METHOD_NAME](Boolean).foo !== 1; - }) - ); - }; - }, - { - "../internals/engine-v8-version": 66, - "../internals/fails": 69, - "../internals/well-known-symbol": 166, - }, - ], - 40: [ - function (_dereq_, module, exports) { - "use strict"; - var fails = _dereq_("../internals/fails"); - module.exports = function (METHOD_NAME, argument) { - var method = [][METHOD_NAME]; - return ( - !!method && - fails(function () { - // eslint-disable-next-line no-useless-call,no-throw-literal - method.call( - null, - argument || - function () { - throw 1; - }, - 1, - ); - }) - ); - }; - }, - { - "../internals/fails": 69, - }, - ], - 41: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var fails = _dereq_("../internals/fails"); - var has = _dereq_("../internals/has"); - var defineProperty = Object.defineProperty; - var cache = {}; - var thrower = function (it) { - throw it; - }; - module.exports = function (METHOD_NAME, options) { - if (has(cache, METHOD_NAME)) return cache[METHOD_NAME]; - if (!options) options = {}; - var method = [][METHOD_NAME]; - var ACCESSORS = has(options, "ACCESSORS") - ? options.ACCESSORS - : false; - var argument0 = has(options, 0) ? options[0] : thrower; - var argument1 = has(options, 1) ? options[1] : undefined; - return (cache[METHOD_NAME] = - !!method && - !fails(function () { - if (ACCESSORS && !DESCRIPTORS) return true; - var O = { - length: -1, - }; - if (ACCESSORS) - defineProperty(O, 1, { - enumerable: true, - get: thrower, - }); - else O[1] = 1; - method.call(O, argument0, argument1); - })); - }; - }, - { - "../internals/descriptors": 61, - "../internals/fails": 69, - "../internals/has": 78, - }, - ], - 42: [ - function (_dereq_, module, exports) { - var aFunction = _dereq_("../internals/a-function"); - var toObject = _dereq_("../internals/to-object"); - var IndexedObject = _dereq_("../internals/indexed-object"); - var toLength = _dereq_("../internals/to-length"); - // `Array.prototype.{ reduce, reduceRight }` methods implementation - var createMethod = function (IS_RIGHT) { - return function (that, callbackfn, argumentsLength, memo) { - aFunction(callbackfn); - var O = toObject(that); - var self = IndexedObject(O); - var length = toLength(O.length); - var index = IS_RIGHT ? length - 1 : 0; - var i = IS_RIGHT ? -1 : 1; - if (argumentsLength < 2) - while (true) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (IS_RIGHT ? index < 0 : length <= index) { - throw TypeError( - "Reduce of empty array with no initial value", - ); - } - } - for (; IS_RIGHT ? index >= 0 : length > index; index += i) - if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; - }; - }; - module.exports = { - // `Array.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - left: createMethod(false), - // `Array.prototype.reduceRight` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright - right: createMethod(true), - }; - }, - { - "../internals/a-function": 23, - "../internals/indexed-object": 84, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 43: [ - function (_dereq_, module, exports) { - var isObject = _dereq_("../internals/is-object"); - var isArray = _dereq_("../internals/is-array"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var SPECIES = wellKnownSymbol("species"); - // `ArraySpeciesCreate` abstract operation - // https://tc39.github.io/ecma262/#sec-arrayspeciescreate - module.exports = function (originalArray, length) { - var C; - if (isArray(originalArray)) { - C = originalArray.constructor; - // cross-realm fallback - if ( - typeof C == "function" && - (C === Array || isArray(C.prototype)) - ) - C = undefined; - else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } - return new (C === undefined ? Array : C)(length === 0 ? 0 : length); - }; - }, - { - "../internals/is-array": 90, - "../internals/is-object": 92, - "../internals/well-known-symbol": 166, - }, - ], - 44: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - // call something on iterator step with safe closing on error - module.exports = function (iterator, fn, value, ENTRIES) { - try { - return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (error) { - var returnMethod = iterator["return"]; - if (returnMethod !== undefined) - anObject(returnMethod.call(iterator)); - throw error; - } - }; - }, - { - "../internals/an-object": 28, - }, - ], - 45: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var ITERATOR = wellKnownSymbol("iterator"); - var SAFE_CLOSING = false; - try { - var called = 0; - var iteratorWithReturn = { - next: function () { - return { - done: !!called++, - }; - }, - return: function () { - SAFE_CLOSING = true; - }, - }; - iteratorWithReturn[ITERATOR] = function () { - return this; - }; - // eslint-disable-next-line no-throw-literal - Array.from(iteratorWithReturn, function () { - throw 2; - }); - } catch (error) { - /* empty */ - } - module.exports = function (exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) return false; - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR] = function () { - return { - next: function () { - return { - done: (ITERATION_SUPPORT = true), - }; - }, - }; - }; - exec(object); - } catch (error) { - /* empty */ - } - return ITERATION_SUPPORT; - }; - }, - { - "../internals/well-known-symbol": 166, - }, - ], - 46: [ - function (_dereq_, module, exports) { - var toString = {}.toString; - module.exports = function (it) { - return toString.call(it).slice(8, -1); - }; - }, - {}, - ], - 47: [ - function (_dereq_, module, exports) { - var TO_STRING_TAG_SUPPORT = _dereq_( - "../internals/to-string-tag-support", - ); - var classofRaw = _dereq_("../internals/classof-raw"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - // ES3 wrong here - var CORRECT_ARGUMENTS = - classofRaw( - (function () { - return arguments; - })(), - ) == "Arguments"; - // fallback for IE11 Script Access Denied error - var tryGet = function (it, key) { - try { - return it[key]; - } catch (error) { - /* empty */ - } - }; - // getting tag from ES6+ `Object.prototype.toString` - module.exports = TO_STRING_TAG_SUPPORT - ? classofRaw - : function (it) { - var O, tag, result; - return it === undefined - ? "Undefined" - : it === null - ? "Null" // @@toStringTag case - : typeof (tag = tryGet((O = Object(it)), TO_STRING_TAG)) == - "string" - ? tag // builtinTag case - : CORRECT_ARGUMENTS - ? classofRaw(O) // ES3 arguments fallback - : (result = classofRaw(O)) == "Object" && - typeof O.callee == "function" - ? "Arguments" - : result; - }; - }, - { - "../internals/classof-raw": 46, - "../internals/to-string-tag-support": 159, - "../internals/well-known-symbol": 166, - }, - ], - 48: [ - function (_dereq_, module, exports) { - "use strict"; - var defineProperty = _dereq_("../internals/object-define-property").f; - var create = _dereq_("../internals/object-create"); - var redefineAll = _dereq_("../internals/redefine-all"); - var bind = _dereq_("../internals/function-bind-context"); - var anInstance = _dereq_("../internals/an-instance"); - var iterate = _dereq_("../internals/iterate"); - var defineIterator = _dereq_("../internals/define-iterator"); - var setSpecies = _dereq_("../internals/set-species"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var fastKey = _dereq_("../internals/internal-metadata").fastKey; - var InternalStateModule = _dereq_("../internals/internal-state"); - var setInternalState = InternalStateModule.set; - var internalStateGetterFor = InternalStateModule.getterFor; - module.exports = { - getConstructor: function ( - wrapper, - CONSTRUCTOR_NAME, - IS_MAP, - ADDER, - ) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, CONSTRUCTOR_NAME); - setInternalState(that, { - type: CONSTRUCTOR_NAME, - index: create(null), - first: undefined, - last: undefined, - size: 0, - }); - if (!DESCRIPTORS) that.size = 0; - if (iterable != undefined) - iterate(iterable, that[ADDER], that, IS_MAP); - }); - var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function (that, key, value) { - var state = getInternalState(that); - var entry = getEntry(that, key); - var previous, index; - // change existing entry - if (entry) { - entry.value = value; - // create new entry - } else { - state.last = entry = { - index: (index = fastKey(key, true)), - key: key, - value: value, - previous: (previous = state.last), - next: undefined, - removed: false, - }; - if (!state.first) state.first = entry; - if (previous) previous.next = entry; - if (DESCRIPTORS) state.size++; - else that.size++; - // add to index - if (index !== "F") state.index[index] = entry; - } - return that; - }; - var getEntry = function (that, key) { - var state = getInternalState(that); - // fast case - var index = fastKey(key); - var entry; - if (index !== "F") return state.index[index]; - // frozen object case - for (entry = state.first; entry; entry = entry.next) { - if (entry.key == key) return entry; - } - }; - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - var that = this; - var state = getInternalState(that); - var data = state.index; - var entry = state.first; - while (entry) { - entry.removed = true; - if (entry.previous) - entry.previous = entry.previous.next = undefined; - delete data[entry.index]; - entry = entry.next; - } - state.first = state.last = undefined; - if (DESCRIPTORS) state.size = 0; - else that.size = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - delete: function (key) { - var that = this; - var state = getInternalState(that); - var entry = getEntry(that, key); - if (entry) { - var next = entry.next; - var prev = entry.previous; - delete state.index[entry.index]; - entry.removed = true; - if (prev) prev.next = next; - if (next) next.previous = prev; - if (state.first == entry) state.first = next; - if (state.last == entry) state.last = prev; - if (DESCRIPTORS) state.size--; - else that.size--; - } - return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */) { - var state = getInternalState(this); - var boundFunction = bind( - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - 3, - ); - var entry; - while ((entry = entry ? entry.next : state.first)) { - boundFunction(entry.value, entry.key, this); - // revert to the last existing entry - while (entry && entry.removed) entry = entry.previous; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(this, key); - }, - }); - redefineAll( - C.prototype, - IS_MAP - ? { - // 23.1.3.6 Map.prototype.get(key) - get: function get(key) { - var entry = getEntry(this, key); - return entry && entry.value; - }, - // 23.1.3.9 Map.prototype.set(key, value) - set: function set(key, value) { - return define(this, key === 0 ? 0 : key, value); - }, - } - : { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return define( - this, - (value = value === 0 ? 0 : value), - value, - ); - }, - }, - ); - if (DESCRIPTORS) - defineProperty(C.prototype, "size", { - get: function () { - return getInternalState(this).size; - }, - }); - return C; - }, - setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { - var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator"; - var getInternalCollectionState = - internalStateGetterFor(CONSTRUCTOR_NAME); - var getInternalIteratorState = - internalStateGetterFor(ITERATOR_NAME); - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - defineIterator( - C, - CONSTRUCTOR_NAME, - function (iterated, kind) { - setInternalState(this, { - type: ITERATOR_NAME, - target: iterated, - state: getInternalCollectionState(iterated), - kind: kind, - last: undefined, - }); - }, - function () { - var state = getInternalIteratorState(this); - var kind = state.kind; - var entry = state.last; - // revert to the last existing entry - while (entry && entry.removed) entry = entry.previous; - // get next entry - if ( - !state.target || - !(state.last = entry = - entry ? entry.next : state.state.first) - ) { - // or finish the iteration - state.target = undefined; - return { - value: undefined, - done: true, - }; - } // return step by kind - - if (kind == "keys") - return { - value: entry.key, - done: false, - }; - if (kind == "values") - return { - value: entry.value, - done: false, - }; - return { - value: [entry.key, entry.value], - done: false, - }; - }, - IS_MAP ? "entries" : "values", - !IS_MAP, - true, - ); - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(CONSTRUCTOR_NAME); - }, - }; - }, - { - "../internals/an-instance": 27, - "../internals/define-iterator": 59, - "../internals/descriptors": 61, - "../internals/function-bind-context": 72, - "../internals/internal-metadata": 87, - "../internals/internal-state": 88, - "../internals/iterate": 95, - "../internals/object-create": 108, - "../internals/object-define-property": 110, - "../internals/redefine-all": 125, - "../internals/set-species": 134, - }, - ], - 49: [ - function (_dereq_, module, exports) { - "use strict"; - var redefineAll = _dereq_("../internals/redefine-all"); - var getWeakData = _dereq_( - "../internals/internal-metadata", - ).getWeakData; - var anObject = _dereq_("../internals/an-object"); - var isObject = _dereq_("../internals/is-object"); - var anInstance = _dereq_("../internals/an-instance"); - var iterate = _dereq_("../internals/iterate"); - var ArrayIterationModule = _dereq_("../internals/array-iteration"); - var $has = _dereq_("../internals/has"); - var InternalStateModule = _dereq_("../internals/internal-state"); - var setInternalState = InternalStateModule.set; - var internalStateGetterFor = InternalStateModule.getterFor; - var find = ArrayIterationModule.find; - var findIndex = ArrayIterationModule.findIndex; - var id = 0; - // fallback for uncaught frozen keys - var uncaughtFrozenStore = function (store) { - return store.frozen || (store.frozen = new UncaughtFrozenStore()); - }; - var UncaughtFrozenStore = function () { - this.entries = []; - }; - var findUncaughtFrozen = function (store, key) { - return find(store.entries, function (it) { - return it[0] === key; - }); - }; - UncaughtFrozenStore.prototype = { - get: function (key) { - var entry = findUncaughtFrozen(this, key); - if (entry) return entry[1]; - }, - has: function (key) { - return !!findUncaughtFrozen(this, key); - }, - set: function (key, value) { - var entry = findUncaughtFrozen(this, key); - if (entry) entry[1] = value; - else this.entries.push([key, value]); - }, - delete: function (key) { - var index = findIndex(this.entries, function (it) { - return it[0] === key; - }); - if (~index) this.entries.splice(index, 1); - return !!~index; - }, - }; - module.exports = { - getConstructor: function ( - wrapper, - CONSTRUCTOR_NAME, - IS_MAP, - ADDER, - ) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, CONSTRUCTOR_NAME); - setInternalState(that, { - type: CONSTRUCTOR_NAME, - id: id++, - frozen: undefined, - }); - if (iterable != undefined) - iterate(iterable, that[ADDER], that, IS_MAP); - }); - var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function (that, key, value) { - var state = getInternalState(that); - var data = getWeakData(anObject(key), true); - if (data === true) uncaughtFrozenStore(state).set(key, value); - else data[state.id] = value; - return that; - }; - redefineAll(C.prototype, { - // 23.3.3.2 WeakMap.prototype.delete(key) - // 23.4.3.3 WeakSet.prototype.delete(value) - delete: function (key) { - var state = getInternalState(this); - if (!isObject(key)) return false; - var data = getWeakData(key); - if (data === true) - return uncaughtFrozenStore(state)["delete"](key); - return data && $has(data, state.id) && delete data[state.id]; - }, - // 23.3.3.4 WeakMap.prototype.has(key) - // 23.4.3.4 WeakSet.prototype.has(value) - has: function has(key) { - var state = getInternalState(this); - if (!isObject(key)) return false; - var data = getWeakData(key); - if (data === true) return uncaughtFrozenStore(state).has(key); - return data && $has(data, state.id); - }, - }); - redefineAll( - C.prototype, - IS_MAP - ? { - // 23.3.3.3 WeakMap.prototype.get(key) - get: function get(key) { - var state = getInternalState(this); - if (isObject(key)) { - var data = getWeakData(key); - if (data === true) - return uncaughtFrozenStore(state).get(key); - return data ? data[state.id] : undefined; - } - }, - // 23.3.3.5 WeakMap.prototype.set(key, value) - set: function set(key, value) { - return define(this, key, value); - }, - } - : { - // 23.4.3.1 WeakSet.prototype.add(value) - add: function add(value) { - return define(this, value, true); - }, - }, - ); - return C; - }, - }; - }, - { - "../internals/an-instance": 27, - "../internals/an-object": 28, - "../internals/array-iteration": 37, - "../internals/has": 78, - "../internals/internal-metadata": 87, - "../internals/internal-state": 88, - "../internals/is-object": 92, - "../internals/iterate": 95, - "../internals/redefine-all": 125, - }, - ], - 50: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var global = _dereq_("../internals/global"); - var isForced = _dereq_("../internals/is-forced"); - var redefine = _dereq_("../internals/redefine"); - var InternalMetadataModule = _dereq_( - "../internals/internal-metadata", - ); - var iterate = _dereq_("../internals/iterate"); - var anInstance = _dereq_("../internals/an-instance"); - var isObject = _dereq_("../internals/is-object"); - var fails = _dereq_("../internals/fails"); - var checkCorrectnessOfIteration = _dereq_( - "../internals/check-correctness-of-iteration", - ); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var inheritIfRequired = _dereq_("../internals/inherit-if-required"); - module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { - var IS_MAP = CONSTRUCTOR_NAME.indexOf("Map") !== -1; - var IS_WEAK = CONSTRUCTOR_NAME.indexOf("Weak") !== -1; - var ADDER = IS_MAP ? "set" : "add"; - var NativeConstructor = global[CONSTRUCTOR_NAME]; - var NativePrototype = - NativeConstructor && NativeConstructor.prototype; - var Constructor = NativeConstructor; - var exported = {}; - var fixMethod = function (KEY) { - var nativeMethod = NativePrototype[KEY]; - redefine( - NativePrototype, - KEY, - KEY == "add" - ? function add(value) { - nativeMethod.call(this, value === 0 ? 0 : value); - return this; - } - : KEY == "delete" - ? function (key) { - return IS_WEAK && !isObject(key) - ? false - : nativeMethod.call(this, key === 0 ? 0 : key); - } - : KEY == "get" - ? function get(key) { - return IS_WEAK && !isObject(key) - ? undefined - : nativeMethod.call(this, key === 0 ? 0 : key); - } - : KEY == "has" - ? function has(key) { - return IS_WEAK && !isObject(key) - ? false - : nativeMethod.call(this, key === 0 ? 0 : key); - } - : function set(key, value) { - nativeMethod.call(this, key === 0 ? 0 : key, value); - return this; - }, - ); - }; - // eslint-disable-next-line max-len - if ( - isForced( - CONSTRUCTOR_NAME, - typeof NativeConstructor != "function" || - !( - IS_WEAK || - (NativePrototype.forEach && - !fails(function () { - new NativeConstructor().entries().next(); - })) - ), - ) - ) { - // create collection constructor - Constructor = common.getConstructor( - wrapper, - CONSTRUCTOR_NAME, - IS_MAP, - ADDER, - ); - InternalMetadataModule.REQUIRED = true; - } else if (isForced(CONSTRUCTOR_NAME, true)) { - var instance = new Constructor(); - // early implementations not supports chaining - var HASNT_CHAINING = - instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { - instance.has(1); - }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - // eslint-disable-next-line no-new - var ACCEPT_ITERABLES = checkCorrectnessOfIteration( - function (iterable) { - new NativeConstructor(iterable); - }, - ); - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = - !IS_WEAK && - fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new NativeConstructor(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - Constructor = wrapper(function (dummy, iterable) { - anInstance(dummy, Constructor, CONSTRUCTOR_NAME); - var that = inheritIfRequired( - new NativeConstructor(), - dummy, - Constructor, - ); - if (iterable != undefined) - iterate(iterable, that[ADDER], that, IS_MAP); - return that; - }); - Constructor.prototype = NativePrototype; - NativePrototype.constructor = Constructor; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod("delete"); - fixMethod("has"); - IS_MAP && fixMethod("get"); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && NativePrototype.clear) - delete NativePrototype.clear; - } - exported[CONSTRUCTOR_NAME] = Constructor; - $( - { - global: true, - forced: Constructor != NativeConstructor, - }, - exported, - ); - setToStringTag(Constructor, CONSTRUCTOR_NAME); - if (!IS_WEAK) - common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); - return Constructor; - }; - }, - { - "../internals/an-instance": 27, - "../internals/check-correctness-of-iteration": 45, - "../internals/export": 68, - "../internals/fails": 69, - "../internals/global": 77, - "../internals/inherit-if-required": 85, - "../internals/internal-metadata": 87, - "../internals/is-forced": 91, - "../internals/is-object": 92, - "../internals/iterate": 95, - "../internals/redefine": 126, - "../internals/set-to-string-tag": 135, - }, - ], - 51: [ - function (_dereq_, module, exports) { - var has = _dereq_("../internals/has"); - var ownKeys = _dereq_("../internals/own-keys"); - var getOwnPropertyDescriptorModule = _dereq_( - "../internals/object-get-own-property-descriptor", - ); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - module.exports = function (target, source) { - var keys = ownKeys(source); - var defineProperty = definePropertyModule.f; - var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!has(target, key)) - defineProperty( - target, - key, - getOwnPropertyDescriptor(source, key), - ); - } - }; - }, - { - "../internals/has": 78, - "../internals/object-define-property": 110, - "../internals/object-get-own-property-descriptor": 111, - "../internals/own-keys": 121, - }, - ], - 52: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var MATCH = wellKnownSymbol("match"); - module.exports = function (METHOD_NAME) { - var regexp = /./; - try { - "/./"[METHOD_NAME](regexp); - } catch (e) { - try { - regexp[MATCH] = false; - return "/./"[METHOD_NAME](regexp); - } catch (f) { - /* empty */ - } - } - return false; - }; - }, - { - "../internals/well-known-symbol": 166, - }, - ], - 53: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - module.exports = !fails(function () { - function F() { - /* empty */ - } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - }, - { - "../internals/fails": 69, - }, - ], - 54: [ - function (_dereq_, module, exports) { - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var quot = /"/g; - // B.2.3.2.1 CreateHTML(string, tag, attribute, value) - // https://tc39.github.io/ecma262/#sec-createhtml - module.exports = function (string, tag, attribute, value) { - var S = String(requireObjectCoercible(string)); - var p1 = "<" + tag; - if (attribute !== "") - p1 += - " " + - attribute + - '="' + - String(value).replace(quot, """) + - '"'; - return p1 + ">" + S + ""; - }; - }, - { - "../internals/require-object-coercible": 131, - }, - ], - 55: [ - function (_dereq_, module, exports) { - "use strict"; - var IteratorPrototype = _dereq_( - "../internals/iterators-core", - ).IteratorPrototype; - var create = _dereq_("../internals/object-create"); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var Iterators = _dereq_("../internals/iterators"); - var returnThis = function () { - return this; - }; - module.exports = function (IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + " Iterator"; - IteratorConstructor.prototype = create(IteratorPrototype, { - next: createPropertyDescriptor(1, next), - }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; - }; - }, - { - "../internals/create-property-descriptor": 57, - "../internals/iterators": 97, - "../internals/iterators-core": 96, - "../internals/object-create": 108, - "../internals/set-to-string-tag": 135, - }, - ], - 56: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - module.exports = DESCRIPTORS - ? function (object, key, value) { - return definePropertyModule.f( - object, - key, - createPropertyDescriptor(1, value), - ); - } - : function (object, key, value) { - object[key] = value; - return object; - }; - }, - { - "../internals/create-property-descriptor": 57, - "../internals/descriptors": 61, - "../internals/object-define-property": 110, - }, - ], - 57: [ - function (_dereq_, module, exports) { - module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value, - }; - }; - }, - {}, - ], - 58: [ - function (_dereq_, module, exports) { - "use strict"; - var toPrimitive = _dereq_("../internals/to-primitive"); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - module.exports = function (object, key, value) { - var propertyKey = toPrimitive(key); - if (propertyKey in object) - definePropertyModule.f( - object, - propertyKey, - createPropertyDescriptor(0, value), - ); - else object[propertyKey] = value; - }; - }, - { - "../internals/create-property-descriptor": 57, - "../internals/object-define-property": 110, - "../internals/to-primitive": 158, - }, - ], - 59: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var createIteratorConstructor = _dereq_( - "../internals/create-iterator-constructor", - ); - var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); - var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var redefine = _dereq_("../internals/redefine"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var IS_PURE = _dereq_("../internals/is-pure"); - var Iterators = _dereq_("../internals/iterators"); - var IteratorsCore = _dereq_("../internals/iterators-core"); - var IteratorPrototype = IteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR = wellKnownSymbol("iterator"); - var KEYS = "keys"; - var VALUES = "values"; - var ENTRIES = "entries"; - var returnThis = function () { - return this; - }; - module.exports = function ( - Iterable, - NAME, - IteratorConstructor, - next, - DEFAULT, - IS_SET, - FORCED, - ) { - createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function (KIND) { - if (KIND === DEFAULT && defaultIterator) return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) - return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: - return function keys() { - return new IteratorConstructor(this, KIND); - }; - case VALUES: - return function values() { - return new IteratorConstructor(this, KIND); - }; - case ENTRIES: - return function entries() { - return new IteratorConstructor(this, KIND); - }; - } - return function () { - return new IteratorConstructor(this); - }; - }; - var TO_STRING_TAG = NAME + " Iterator"; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = - IterablePrototype[ITERATOR] || - IterablePrototype["@@iterator"] || - (DEFAULT && IterablePrototype[DEFAULT]); - var defaultIterator = - (!BUGGY_SAFARI_ITERATORS && nativeIterator) || - getIterationMethod(DEFAULT); - var anyNativeIterator = - NAME == "Array" - ? IterablePrototype.entries || nativeIterator - : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; - // fix native - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf( - anyNativeIterator.call(new Iterable()), - ); - if ( - IteratorPrototype !== Object.prototype && - CurrentIteratorPrototype.next - ) { - if ( - !IS_PURE && - getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype - ) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if ( - typeof CurrentIteratorPrototype[ITERATOR] != "function" - ) { - createNonEnumerableProperty( - CurrentIteratorPrototype, - ITERATOR, - returnThis, - ); - } - } // Set @@toStringTag to native iterators - - setToStringTag( - CurrentIteratorPrototype, - TO_STRING_TAG, - true, - true, - ); - if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; - } - } // fix Array#{values, @@iterator}.name in V8 / FF - - if ( - DEFAULT == VALUES && - nativeIterator && - nativeIterator.name !== VALUES - ) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { - return nativeIterator.call(this); - }; - } // define iterator - - if ( - (!IS_PURE || FORCED) && - IterablePrototype[ITERATOR] !== defaultIterator - ) { - createNonEnumerableProperty( - IterablePrototype, - ITERATOR, - defaultIterator, - ); - } - Iterators[NAME] = defaultIterator; - // export additional methods - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES), - }; - if (FORCED) - for (KEY in methods) { - if ( - BUGGY_SAFARI_ITERATORS || - INCORRECT_VALUES_NAME || - !(KEY in IterablePrototype) - ) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } - else - $( - { - target: NAME, - proto: true, - forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME, - }, - methods, - ); - } - return methods; - }; - }, - { - "../internals/create-iterator-constructor": 55, - "../internals/create-non-enumerable-property": 56, - "../internals/export": 68, - "../internals/is-pure": 93, - "../internals/iterators": 97, - "../internals/iterators-core": 96, - "../internals/object-get-prototype-of": 115, - "../internals/object-set-prototype-of": 119, - "../internals/redefine": 126, - "../internals/set-to-string-tag": 135, - "../internals/well-known-symbol": 166, - }, - ], - 60: [ - function (_dereq_, module, exports) { - var path = _dereq_("../internals/path"); - var has = _dereq_("../internals/has"); - var wrappedWellKnownSymbolModule = _dereq_( - "../internals/well-known-symbol-wrapped", - ); - var defineProperty = _dereq_("../internals/object-define-property").f; - module.exports = function (NAME) { - var Symbol = path.Symbol || (path.Symbol = {}); - if (!has(Symbol, NAME)) - defineProperty(Symbol, NAME, { - value: wrappedWellKnownSymbolModule.f(NAME), - }); - }; - }, - { - "../internals/has": 78, - "../internals/object-define-property": 110, - "../internals/path": 122, - "../internals/well-known-symbol-wrapped": 165, - }, - ], - 61: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - // Thank's IE8 for his funny defineProperty - module.exports = !fails(function () { - return ( - Object.defineProperty({}, 1, { - get: function () { - return 7; - }, - })[1] != 7 - ); - }); - }, - { - "../internals/fails": 69, - }, - ], - 62: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var isObject = _dereq_("../internals/is-object"); - var document = global.document; - // typeof document.createElement is 'object' in old IE - var EXISTS = isObject(document) && isObject(document.createElement); - module.exports = function (it) { - return EXISTS ? document.createElement(it) : {}; - }; - }, - { - "../internals/global": 77, - "../internals/is-object": 92, - }, - ], - 63: [ - function (_dereq_, module, exports) { - // iterable DOM collections - // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods - module.exports = { - CSSRuleList: 0, - CSSStyleDeclaration: 0, - CSSValueList: 0, - ClientRectList: 0, - DOMRectList: 0, - DOMStringList: 0, - DOMTokenList: 1, - DataTransferItemList: 0, - FileList: 0, - HTMLAllCollection: 0, - HTMLCollection: 0, - HTMLFormElement: 0, - HTMLSelectElement: 0, - MediaList: 0, - MimeTypeArray: 0, - NamedNodeMap: 0, - NodeList: 1, - PaintRequestList: 0, - Plugin: 0, - PluginArray: 0, - SVGLengthList: 0, - SVGNumberList: 0, - SVGPathSegList: 0, - SVGPointList: 0, - SVGStringList: 0, - SVGTransformList: 0, - SourceBufferList: 0, - StyleSheetList: 0, - TextTrackCueList: 0, - TextTrackList: 0, - TouchList: 0, - }; - }, - {}, - ], - 64: [ - function (_dereq_, module, exports) { - var userAgent = _dereq_("../internals/engine-user-agent"); - module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent); - }, - { - "../internals/engine-user-agent": 65, - }, - ], - 65: [ - function (_dereq_, module, exports) { - var getBuiltIn = _dereq_("../internals/get-built-in"); - module.exports = getBuiltIn("navigator", "userAgent") || ""; - }, - { - "../internals/get-built-in": 74, - }, - ], - 66: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var userAgent = _dereq_("../internals/engine-user-agent"); - var process = global.process; - var versions = process && process.versions; - var v8 = versions && versions.v8; - var match, version; - if (v8) { - match = v8.split("."); - version = match[0] + match[1]; - } else if (userAgent) { - match = userAgent.match(/Edge\/(\d+)/); - if (!match || match[1] >= 74) { - match = userAgent.match(/Chrome\/(\d+)/); - if (match) version = match[1]; - } - } - module.exports = version && +version; - }, - { - "../internals/engine-user-agent": 65, - "../internals/global": 77, - }, - ], - 67: [ - function (_dereq_, module, exports) { - // IE8- don't enum bug keys - module.exports = [ - "constructor", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "toLocaleString", - "toString", - "valueOf", - ]; - }, - {}, - ], - 68: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var getOwnPropertyDescriptor = _dereq_( - "../internals/object-get-own-property-descriptor", - ).f; - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var redefine = _dereq_("../internals/redefine"); - var setGlobal = _dereq_("../internals/set-global"); - var copyConstructorProperties = _dereq_( - "../internals/copy-constructor-properties", - ); - var isForced = _dereq_("../internals/is-forced"); - /* + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f() + } else if (typeof define === 'function' && define.amd) { + define([], f) + } else { + var g; + if (typeof window !== 'undefined') { + g = window + } else if (typeof global !== 'undefined') { + g = global + } else if (typeof self !== 'undefined') { + g = self + } else { + g = this + } + g.p5 = f() + } +}) (function () { + var define, + module, + exports; + return (function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) return c(i, !0); + if (u) return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', + a + } + var p = n[i] = { + exports: { + } + }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r) + }, p, p.exports, r, e, n, t) + } + return n[i].exports + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) o(t[i]); + return o + } + return r + }) () ({ + 1: [ + function (_dereq_, module, exports) { + module.exports = { + 'p5': { + 'describe': { + 'name': 'describe', + 'params': [ + { + 'name': 'text', + 'description': '

                          description of the canvas.

                          \n', + 'type': 'String' + }, + { + 'name': 'display', + 'description': '

                          either LABEL or FALLBACK.

                          \n', + 'type': 'Constant', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Environment' + }, + 'describeElement': { + 'name': 'describeElement', + 'params': [ + { + 'name': 'name', + 'description': '

                          name of the element.

                          \n', + 'type': 'String' + }, + { + 'name': 'text', + 'description': '

                          description of the element.

                          \n', + 'type': 'String' + }, + { + 'name': 'display', + 'description': '

                          either LABEL or FALLBACK.

                          \n', + 'type': 'Constant', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Environment' + }, + 'textOutput': { + 'name': 'textOutput', + 'params': [ + { + 'name': 'display', + 'description': '

                          either FALLBACK or LABEL.

                          \n', + 'type': 'Constant', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Environment' + }, + 'gridOutput': { + 'name': 'gridOutput', + 'params': [ + { + 'name': 'display', + 'description': '

                          either FALLBACK or LABEL.

                          \n', + 'type': 'Constant', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Environment' + }, + 'alpha': { + 'name': 'alpha', + 'params': [ + { + 'name': 'color', + 'description': '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'blue': { + 'name': 'blue', + 'params': [ + { + 'name': 'color', + 'description': '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'brightness': { + 'name': 'brightness', + 'params': [ + { + 'name': 'color', + 'description': '

                          p5.Color object, array of\n color components, or CSS color string.

                          \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': true + } + ] + }, + { + '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': true + } + ] + }, + { + '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, array of\n color components, or CSS color string.

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'hue': { + 'name': 'hue', + 'params': [ + { + 'name': 'color', + 'description': '

                          p5.Color object, array of\n color components, or CSS color string.

                          \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, array of\n color components, or CSS color string.

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'red': { + 'name': 'red', + 'params': [ + { + 'name': 'color', + 'description': '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'saturation': { + 'name': 'saturation', + 'params': [ + { + 'name': 'color', + 'description': '

                          p5.Color object, array of\n color components, or CSS color string.

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'beginClip': { + 'name': 'beginClip', + 'params': [ + { + 'name': 'options', + 'description': '

                          An object containing clip settings.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Color' + }, + 'endClip': { + 'name': 'endClip', + 'class': 'p5', + 'module': 'Color' + }, + 'clip': { + 'name': 'clip', + 'params': [ + { + 'name': 'callback', + 'description': '

                          A function that draws the mask shape.

                          \n', + 'type': 'Function' + }, + { + 'name': 'options', + 'description': '

                          An object containing clip settings.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + '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': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          specifies a value between white and black.

                          \n', + 'type': 'Number' + }, + { + 'name': 'a', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red value if color mode is RGB, or hue value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green value if color mode is RGB, or saturation value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue value if color mode is RGB, or brightness value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'a', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + '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()\n 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': true + } + ], + 'chainable': 1 + } + ] + }, + 'clear': { + 'name': 'clear', + 'params': [ + { + 'name': 'r', + 'description': '

                          normalized red value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'g', + 'description': '

                          normalized green value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'b', + 'description': '

                          normalized blue value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'a', + 'description': '

                          normalized alpha value.

                          \n', + 'type': 'Number' + } + ], + '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': true + } + ], + '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': true + } + ], + 'chainable': 1 + } + ] + }, + 'fill': { + 'name': 'fill', + 'class': 'p5', + 'module': 'Color', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red value if color mode is RGB or hue value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green value if color mode is RGB or saturation value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue value if color mode is RGB or brightness value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          a color string.

                          \n', + 'type': 'String' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          a grayscale value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + '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 value if color mode is RGB or hue value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green value if color mode is RGB or saturation value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue value if color mode is RGB or brightness value if color mode is HSB.

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          a color string.

                          \n', + 'type': 'String' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          a grayscale value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + '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 under a shape\'s interior.\n Defaults to 255, which is full strength.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'strengthStroke', + 'description': '

                          a number (0-255) for the strength of erasing under a shape\'s edge.\n Defaults to 255, which is full strength.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + '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. Won\'t\n draw a stroke for a detail of more than 50.

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'ellipse': { + 'name': 'ellipse', + 'class': 'p5', + 'module': 'Shape', + 'overloads': [ + { + 'params': [ + { + 'name': 'x', + 'description': '

                          x-coordinate of the center of the ellipse.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the center of the 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': true + } + ], + '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': '

                          optional parameter for WebGL mode only. This is to\n specify the number of vertices that makes up the\n perimeter of the ellipse. Default value is 25. Won\'t\n draw a stroke for a detail of more than 50.

                          \n', + 'type': 'Integer', + 'optional': true + } + ] + } + ] + }, + 'circle': { + 'name': 'circle', + 'params': [ + { + 'name': 'x', + 'description': '

                          x-coordinate of the center of the circle.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the center 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': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'coordinateVector', + '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' + }, + { + 'name': 'detailX', + 'description': '

                          number of segments in the x-direction.

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          number of segments in the y-direction.

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + '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' + }, + { + 'name': 'detailX', + 'description': '', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '', + 'type': 'Integer', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'tl', + 'description': '

                          optional radius of top-left corner.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'tr', + 'description': '

                          optional radius of top-right corner.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'br', + 'description': '

                          optional radius of bottom-right corner.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'bl', + 'description': '

                          optional radius of bottom-left corner.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'detailY', + 'description': '

                          number of segments in the y-direction (for WebGL mode).

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'tr', + 'description': '

                          optional radius of top-right corner.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'br', + 'description': '

                          optional radius of bottom-right corner.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'bl', + 'description': '

                          optional radius of bottom-left corner.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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, or 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': true + } + ], + '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': true + } + ], + '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': true + }, + { + 'name': 'count', + 'description': '

                          number of times you want to draw/instance the shape (for WebGL mode).

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + '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 Defaults to 0 if not specified.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'x', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'u', + 'description': '

                          the vertex\'s texture u-coordinate

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'v', + 'description': '

                          the vertex\'s texture v-coordinate

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + } + ] + }, + 'normal': { + 'name': 'normal', + 'class': 'p5', + 'module': 'Shape', + 'overloads': [ + { + 'params': [ + { + 'name': 'vector', + 'description': '

                          A p5.Vector representing the vertex normal.

                          \n', + 'type': 'Vector' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'x', + 'description': '

                          The x component of the vertex normal.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          The y component of the vertex normal.

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          The z component of the vertex normal.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + } + ] + }, + 'VERSION': { + 'name': 'VERSION', + 'class': 'p5', + 'module': 'Constants' + }, + 'P2D': { + 'name': 'P2D', + 'class': 'p5', + 'module': 'Constants' + }, + 'WEBGL': { + 'name': 'WEBGL', + 'class': 'p5', + 'module': 'Constants' + }, + 'WEBGL2': { + 'name': 'WEBGL2', + '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' + }, + 'CHAR': { + 'name': 'CHAR', + 'class': 'p5', + 'module': 'Constants' + }, + 'WORD': { + 'name': 'WORD', + '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' + }, + 'FLAT': { + 'name': 'FLAT', + 'class': 'p5', + 'module': 'Constants' + }, + 'SMOOTH': { + 'name': 'SMOOTH', + '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' + }, + 'LABEL': { + 'name': 'LABEL', + 'class': 'p5', + 'module': 'Constants' + }, + 'FALLBACK': { + 'name': 'FALLBACK', + 'class': 'p5', + 'module': 'Constants' + }, + 'CONTAIN': { + 'name': 'CONTAIN', + 'class': 'p5', + 'module': 'Constants' + }, + 'COVER': { + 'name': 'COVER', + 'class': 'p5', + 'module': 'Constants' + }, + 'UNSIGNED_BYTE': { + 'name': 'UNSIGNED_BYTE', + 'class': 'p5', + 'module': 'Constants' + }, + 'UNSIGNED_INT': { + 'name': 'UNSIGNED_INT', + 'class': 'p5', + 'module': 'Constants' + }, + 'FLOAT': { + 'name': 'FLOAT', + 'class': 'p5', + 'module': 'Constants' + }, + 'HALF_FLOAT': { + 'name': 'HALF_FLOAT', + 'class': 'p5', + 'module': 'Constants' + }, + 'RGBA': { + 'name': 'RGBA', + 'class': 'p5', + 'module': 'Constants' + }, + 'print': { + 'name': 'print', + 'params': [ + { + 'name': 'contents', + 'description': '

                          content to print to the console.

                          \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, or WAIT.\n Native CSS properties: \'grab\', \'progress\', and so on.\n Path to cursor image.

                          \n', + 'type': 'String|Constant' + }, + { + 'name': 'x', + 'description': '

                          horizontal active spot of the cursor.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'y', + 'description': '

                          vertical active spot of the cursor.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Environment' + }, + 'frameRate': { + 'name': 'frameRate', + 'class': 'p5', + 'module': 'Environment', + 'overloads': [ + { + 'params': [ + { + 'name': 'fps', + 'description': '

                          number of frames to draw per second.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + ] + } + ] + }, + 'getTargetFrameRate': { + 'name': 'getTargetFrameRate', + 'class': 'p5', + 'module': 'Environment' + }, + 'noCursor': { + 'name': 'noCursor', + 'class': 'p5', + 'module': 'Environment' + }, + 'webglVersion': { + 'name': 'webglVersion', + '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', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional resize Event.

                          \n', + 'type': 'UIEvent', + 'optional': true + } + ], + '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.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Environment' + }, + 'pixelDensity': { + 'name': 'pixelDensity', + 'class': 'p5', + 'module': 'Environment', + 'overloads': [ + { + 'params': [ + { + 'name': 'val', + 'description': '

                          desired pixel density.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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', + 'class': 'p5', + 'module': 'Rendering', + 'overloads': [ + { + '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': true + }, + { + 'name': 'canvas', + 'description': '

                          existing html canvas element

                          \n', + 'type': 'HTMLCanvasElement', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'w', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'h', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'canvas', + 'description': '', + 'type': 'HTMLCanvasElement', + 'optional': true + } + ] + } + ] + }, + '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': true + } + ], + 'class': 'p5', + 'module': 'Rendering' + }, + 'noCanvas': { + 'name': 'noCanvas', + 'class': 'p5', + 'module': 'Rendering' + }, + 'createGraphics': { + 'name': 'createGraphics', + 'class': 'p5', + 'module': 'Rendering', + 'overloads': [ + { + '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': true + }, + { + 'name': 'canvas', + 'description': '

                          existing html canvas element

                          \n', + 'type': 'HTMLCanvasElement', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'w', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'h', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'canvas', + 'description': '', + 'type': 'HTMLCanvasElement', + 'optional': true + } + ] + } + ] + }, + 'createFramebuffer': { + 'name': 'createFramebuffer', + 'params': [ + { + 'name': 'options', + 'description': '

                          An optional object with configuration

                          \n', + 'type': 'Object', + 'optional': true + } + ], + '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': true + } + ], + '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', + 'class': 'p5', + 'module': 'Transform', + 'overloads': [ + { + 'params': [ + { + 'name': 'arr', + 'description': '

                          an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values)

                          \n', + 'type': 'Array' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'a', + 'description': '

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'b', + 'description': '

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'c', + 'description': '

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'd', + 'description': '

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'e', + 'description': '

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'f', + 'description': '

                          numbers which define the 2×3 or 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'a', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'b', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'c', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'd', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'e', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'f', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'g', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'h', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'i', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'j', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'k', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'l', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'm', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'n', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'o', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + }, + { + 'name': 'p', + 'description': '

                          numbers which define the 4×4 matrix to be multiplied

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + } + ] + }, + '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': true + } + ], + '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': true + }, + { + 'name': 'z', + 'description': '

                          percent to scale the object in the z-axis (webgl only)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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 HTMLElement to search within.

                          \n', + 'type': 'String|p5.Element|HTMLElement', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'selectAll': { + 'name': 'selectAll', + '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 HTMLElement to search within.

                          \n', + 'type': 'String|p5.Element|HTMLElement', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'removeElements': { + 'name': 'removeElements', + 'class': 'p5', + 'module': 'DOM' + }, + 'changed': { + 'name': 'changed', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the element changes.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'input': { + 'name': 'input', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when input is detected within\n the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createDiv': { + 'name': 'createDiv', + 'params': [ + { + 'name': 'html', + 'description': '

                          inner HTML for the new <div></div> element.

                          \n', + 'type': 'String', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createP': { + 'name': 'createP', + 'params': [ + { + 'name': 'html', + 'description': '

                          inner HTML for the new <p></p> element.

                          \n', + 'type': 'String', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createSpan': { + 'name': 'createSpan', + 'params': [ + { + 'name': 'html', + 'description': '

                          inner HTML for the new <span></span> element.

                          \n', + 'type': 'String', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createImg': { + 'name': 'createImg', + 'class': 'p5', + 'module': 'DOM', + 'overloads': [ + { + 'params': [ + { + 'name': 'src', + 'description': '

                          relative path or URL for the image.

                          \n', + 'type': 'String' + }, + { + 'name': 'alt', + 'description': '

                          alternate text for the image.

                          \n', + 'type': 'String' + } + ] + }, + { + 'params': [ + { + 'name': 'src', + 'description': '', + 'type': 'String' + }, + { + 'name': 'alt', + 'description': '', + 'type': 'String' + }, + { + 'name': 'crossOrigin', + 'description': '

                          crossOrigin property to use when fetching the image.

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'successCallback', + 'description': '

                          function to call once the image loads. The new image will be passed\n to the function as a p5.Element object.

                          \n', + 'type': 'Function', + 'optional': true + } + ] + } + ] + }, + 'createA': { + 'name': 'createA', + 'params': [ + { + 'name': 'href', + 'description': '

                          URL of linked page.

                          \n', + 'type': 'String' + }, + { + 'name': 'html', + 'description': '

                          inner HTML of link element to display.

                          \n', + 'type': 'String' + }, + { + 'name': 'target', + 'description': '

                          target where the new link should open,\n either \'_blank\', \'_self\', \'_parent\', or \'_top\'.

                          \n', + 'type': 'String', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'step', + 'description': '

                          size for each step in the slider\'s range.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createCheckbox': { + 'name': 'createCheckbox', + 'params': [ + { + 'name': 'label', + 'description': '

                          label displayed after the checkbox.

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'value', + 'description': '

                          value of the checkbox. Checked is true and unchecked is false.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createSelect': { + 'name': 'createSelect', + 'class': 'p5', + 'module': 'DOM', + 'overloads': [ + { + 'params': [ + { + 'name': 'multiple', + 'description': '

                          support multiple selections.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'existing', + 'description': '

                          select element to wrap, either as a p5.Element or\n a HTMLSelectElement.

                          \n', + 'type': 'Object' + } + ] + } + ] + }, + 'createRadio': { + 'name': 'createRadio', + 'class': 'p5', + 'module': 'DOM', + 'overloads': [ + { + 'params': [ + { + 'name': 'containerElement', + 'description': '

                          container HTML Element, either a <div></div>\nor <span></span>.

                          \n', + 'type': 'Object', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'name', + 'description': '

                          name parameter assigned to each option\'s <input></input> element.

                          \n', + 'type': 'String', + 'optional': true + } + ] + }, + { + 'params': [ + ] + } + ] + }, + 'createColorPicker': { + 'name': 'createColorPicker', + 'params': [ + { + 'name': 'value', + 'description': '

                          default color as a CSS color string.

                          \n', + 'type': 'String|p5.Color', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createInput': { + 'name': 'createInput', + 'class': 'p5', + 'module': 'DOM', + 'overloads': [ + { + 'params': [ + { + 'name': 'value', + 'description': '

                          default value of the input box. Defaults to an empty string \'\'.

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'type', + 'description': '

                          type of input. Defaults to \'text\'.

                          \n', + 'type': 'String', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'value', + 'description': '', + 'type': 'String', + 'optional': true + } + ] + } + ] + }, + 'createFileInput': { + 'name': 'createFileInput', + 'params': [ + { + 'name': 'callback', + 'description': '

                          function to call once the file loads.

                          \n', + 'type': 'Function' + }, + { + 'name': 'multiple', + 'description': '

                          allow multiple files to be selected.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createVideo': { + 'name': 'createVideo', + 'params': [ + { + 'name': 'src', + 'description': '

                          path to a video file, or an array of paths for\n supporting different browsers.

                          \n', + 'type': 'String|String[]' + }, + { + 'name': 'callback', + 'description': '

                          function to call once the video is ready to play.

                          \n', + 'type': 'Function', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createAudio': { + 'name': 'createAudio', + 'params': [ + { + 'name': 'src', + 'description': '

                          path to an audio file, or an array of paths\n for supporting different browsers.

                          \n', + 'type': 'String|String[]', + 'optional': true + }, + { + 'name': 'callback', + 'description': '

                          function to call once the audio is ready to play.

                          \n', + 'type': 'Function', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'DOM' + }, + 'createCapture': { + 'name': 'createCapture', + 'params': [ + { + 'name': 'type', + 'description': '

                          type of capture, either AUDIO or VIDEO,\n or a constraints object. Both video and audio\n audio streams are captured by default.

                          \n', + 'type': 'String|Constant|Object', + 'optional': true + }, + { + 'name': 'callback', + 'description': '

                          function to call once the stream\n has loaded.

                          \n', + 'type': 'Function', + 'optional': true + } + ], + '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 insert into the element.

                          \n', + 'type': 'String', + 'optional': true + } + ], + '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', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional KeyboardEvent callback argument.

                          \n', + 'type': 'KeyboardEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'keyReleased': { + 'name': 'keyReleased', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional KeyboardEvent callback argument.

                          \n', + 'type': 'KeyboardEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'keyTyped': { + 'name': 'keyTyped', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional KeyboardEvent callback argument.

                          \n', + 'type': 'KeyboardEvent', + 'optional': true + } + ], + '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': 'MouseEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'mouseDragged': { + 'name': 'mouseDragged', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional MouseEvent callback argument.

                          \n', + 'type': 'MouseEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'mousePressed': { + 'name': 'mousePressed', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional MouseEvent callback argument.

                          \n', + 'type': 'MouseEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'mouseReleased': { + 'name': 'mouseReleased', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional MouseEvent callback argument.

                          \n', + 'type': 'MouseEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'mouseClicked': { + 'name': 'mouseClicked', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional MouseEvent callback argument.

                          \n', + 'type': 'MouseEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'doubleClicked': { + 'name': 'doubleClicked', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional MouseEvent callback argument.

                          \n', + 'type': 'MouseEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'mouseWheel': { + 'name': 'mouseWheel', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional WheelEvent callback argument.

                          \n', + 'type': 'WheelEvent', + 'optional': true + } + ], + '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': 'TouchEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'touchMoved': { + 'name': 'touchMoved', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional TouchEvent callback argument.

                          \n', + 'type': 'TouchEvent', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Events' + }, + 'touchEnded': { + 'name': 'touchEnded', + 'params': [ + { + 'name': 'event', + 'description': '

                          optional TouchEvent callback argument.

                          \n', + 'type': 'TouchEvent', + 'optional': true + } + ], + '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': '

                          reference to a\n specific HTML5 canvas element.

                          \n', + 'type': 'p5.Framebuffer|p5.Element|HTMLCanvasElement' + }, + { + 'name': 'filename', + 'description': '

                          file name. Defaults to \'untitled\'.

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'extension', + 'description': '

                          file extension, either \'jpg\' or \'png\'. Defaults to \'png\'.

                          \n', + 'type': 'String', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'filename', + 'description': '', + 'type': 'String', + 'optional': true + }, + { + 'name': 'extension', + 'description': '', + 'type': 'String', + 'optional': true + } + ] + } + ] + }, + 'saveFrames': { + 'name': 'saveFrames', + 'params': [ + { + 'name': 'filename', + 'description': '

                          prefix of file name.

                          \n', + 'type': 'String' + }, + { + 'name': 'extension', + 'description': '

                          file extension, either \'jpg\' or \'png\'.

                          \n', + 'type': 'String' + }, + { + 'name': 'duration', + 'description': '

                          duration in seconds to record. This parameter will be constrained to be less or equal to 15.

                          \n', + 'type': 'Number' + }, + { + 'name': 'framerate', + 'description': '

                          number of frames to save per second. This parameter will be constrained to be less or equal to 22.

                          \n', + 'type': 'Number' + }, + { + 'name': 'callback', + 'description': '

                          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, filename, and extension.

                          \n', + 'type': 'Function(Array)', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Image' + }, + 'loadImage': { + 'name': 'loadImage', + 'params': [ + { + 'name': 'path', + 'description': '

                          path of the image to be loaded or base64 encoded image.

                          \n', + 'type': 'String' + }, + { + 'name': 'successCallback', + 'description': '

                          function called with\n p5.Image once it\n loads.

                          \n', + 'type': 'function(p5.Image)', + 'optional': true + }, + { + 'name': 'failureCallback', + 'description': '

                          function called with event\n error if the image fails to load.

                          \n', + 'type': 'Function(Event)', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Image' + }, + 'saveGif': { + 'name': 'saveGif', + 'params': [ + { + 'name': 'filename', + 'description': '

                          file name of gif.

                          \n', + 'type': 'String' + }, + { + 'name': 'duration', + 'description': '

                          duration in seconds to capture from the sketch.

                          \n', + 'type': 'Number' + }, + { + 'name': 'options', + 'description': '

                          an object that can contain five more properties:\n delay, a Number specifying how much time to wait before recording;\n units, a String that can be either \'seconds\' or \'frames\'. By default it\'s \'seconds’;\n silent, a Boolean that defines presence of progress notifications. By default it’s false;\n notificationDuration, a Number that defines how long in seconds the final notification\n will live. By default it\'s 0, meaning the notification will never be removed;\n notificationID, a String that specifies the id of the notification\'s DOM element. By default it’s \'progressBar’.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Image' + }, + 'image': { + 'name': 'image', + 'class': 'p5', + 'module': 'Image', + 'overloads': [ + { + 'params': [ + { + 'name': 'img', + 'description': '

                          image to display.

                          \n', + 'type': 'p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture' + }, + { + 'name': 'x', + 'description': '

                          x-coordinate of the top-left corner of the image.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the top-left corner of the image.

                          \n', + 'type': 'Number' + }, + { + 'name': 'width', + 'description': '

                          width to draw the image.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'height', + 'description': '

                          height to draw the image.

                          \n', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'img', + 'description': '', + 'type': 'p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture' + }, + { + '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': true + }, + { + 'name': 'sHeight', + 'description': '

                          the height of the subsection of the\n source image to draw into the destination rectangle

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'fit', + 'description': '

                          either CONTAIN or COVER

                          \n', + 'type': 'Constant', + 'optional': true + }, + { + 'name': 'xAlign', + 'description': '

                          either LEFT, RIGHT or CENTER default is CENTER

                          \n', + 'type': 'Constant', + 'optional': true + }, + { + 'name': 'yAlign', + 'description': '

                          either TOP, BOTTOM or CENTER default is CENTER

                          \n', + 'type': 'Constant', + 'optional': true + } + ] + } + ] + }, + 'tint': { + 'name': 'tint', + 'class': 'p5', + 'module': 'Image', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red or hue value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green or saturation value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue or brightness.

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          CSS color string.

                          \n', + 'type': 'String' + } + ] + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          grayscale value.

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'values', + 'description': '

                          array containing the red, green, blue &\n 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', + 'class': 'p5', + 'module': 'Image', + 'overloads': [ + { + 'params': [ + { + 'name': 'filterType', + 'description': '

                          either THRESHOLD, GRAY, OPAQUE, INVERT,\n POSTERIZE, BLUR, ERODE, DILATE or BLUR.

                          \n', + 'type': 'Constant' + }, + { + 'name': 'filterParam', + 'description': '

                          parameter unique to each filter.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'useWebGL', + 'description': '

                          flag to control whether to use fast\n WebGL filters (GPU) or original image\n filters (CPU); defaults to true.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'filterType', + 'description': '', + 'type': 'Constant' + }, + { + 'name': 'useWebGL', + 'description': '', + 'type': 'Boolean', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'shaderFilter', + 'description': '

                          shader that\'s been loaded, with the\n frag shader using a tex0 uniform.

                          \n', + 'type': 'p5.Shader' + } + ] + } + ] + }, + '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 of the subsection to be returned.

                          \n', + 'type': 'Number' + }, + { + 'name': 'h', + 'description': '

                          height of the subsection to be returned.

                          \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': '

                          grayscale value | pixel array |\n p5.Color object | 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': true + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the upper-left corner of region\n to update.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'w', + 'description': '

                          width of region to update.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'h', + 'description': '

                          height of region to update.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'datatype', + 'description': '

                          "json" or "jsonp"

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'callback', + 'description': '

                          function to be executed after\n loadJSON() completes, data is passed\n in as first argument

                          \n', + 'type': 'Function', + 'optional': true + }, + { + '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': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'datatype', + 'description': '', + 'type': 'String' + }, + { + 'name': 'callback', + 'description': '', + 'type': 'Function', + 'optional': true + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'callback', + 'description': '', + 'type': 'Function' + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + } + ] + }, + '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': true + }, + { + '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': true + } + ], + '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': true + }, + { + 'name': 'header', + 'description': '

                          "header" to indicate table has header row

                          \n', + 'type': 'String', + 'optional': true + }, + { + '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': true + }, + { + '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': true + } + ], + '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': true + }, + { + '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': true + } + ], + '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': true + }, + { + 'name': 'errorCallback', + 'description': '

                          function to be executed if there\n is an error

                          \n', + 'type': 'Function', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'data', + 'description': '

                          param data passed sent with request

                          \n', + 'type': 'Object|Boolean', + 'optional': true + }, + { + 'name': 'callback', + 'description': '

                          function to be executed after\n httpGet() completes, data is passed in\n as first argument

                          \n', + 'type': 'Function', + 'optional': true + }, + { + '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': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'data', + 'description': '', + 'type': 'Object|Boolean' + }, + { + 'name': 'callback', + 'description': '', + 'type': 'Function', + 'optional': true + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'callback', + 'description': '', + 'type': 'Function' + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + } + ] + }, + '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': true + }, + { + 'name': 'data', + 'description': '

                          param data passed sent with request

                          \n', + 'type': 'Object|Boolean', + 'optional': true + }, + { + 'name': 'callback', + 'description': '

                          function to be executed after\n httpPost() completes, data is passed in\n as first argument

                          \n', + 'type': 'Function', + 'optional': true + }, + { + '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': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'data', + 'description': '', + 'type': 'Object|Boolean' + }, + { + 'name': 'callback', + 'description': '', + 'type': 'Function', + 'optional': true + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'callback', + 'description': '', + 'type': 'Function' + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + } + ] + }, + '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': true + }, + { + 'name': 'datatype', + 'description': '

                          "json", "jsonp", "xml", or "text"

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'data', + 'description': '

                          param data passed sent with request

                          \n', + 'type': 'Object', + 'optional': true + }, + { + 'name': 'callback', + 'description': '

                          function to be executed after\n httpGet() completes, data is passed in\n as first argument

                          \n', + 'type': 'Function', + 'optional': true + }, + { + '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': true + } + ] + }, + { + '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': true + }, + { + 'name': 'errorCallback', + 'description': '', + 'type': 'Function', + 'optional': true + } + ] + } + ] + }, + 'createWriter': { + 'name': 'createWriter', + 'params': [ + { + 'name': 'name', + 'description': '

                          name of the file to be created

                          \n', + 'type': 'String' + }, + { + 'name': 'extension', + 'description': '', + 'type': 'String', + 'optional': true + } + ], + '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': true + }, + { + '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': true + }, + { + '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': true + } + ], + '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': true + } + ], + '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': true + }, + { + 'name': 'isCRLF', + 'description': '

                          if true, change line-break to CRLF

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + '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': true + } + ], + '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': 'x', + 'description': '

                          first component.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          second component.

                          \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': true + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'max': { + 'name': 'max', + 'class': 'p5', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'n0', + 'description': '

                          first number to compare.

                          \n', + 'type': 'Number' + }, + { + 'name': 'n1', + 'description': '

                          second 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': '

                          first number to compare.

                          \n', + 'type': 'Number' + }, + { + 'name': 'n1', + 'description': '

                          second 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': true + } + ], + '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': 'n', + 'description': '

                          number whose fractional part will be found.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'createVector': { + 'name': 'createVector', + 'params': [ + { + 'name': 'x', + 'description': '

                          x component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'y', + 'description': '

                          y component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'z', + 'description': '

                          z component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'z', + 'description': '

                          z-coordinate in noise space.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': '

                          seed value.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'randomSeed': { + 'name': 'randomSeed', + 'params': [ + { + 'name': 'seed', + 'description': '

                          seed value.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'random': { + 'name': 'random', + 'class': 'p5', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'min', + 'description': '

                          lower bound (inclusive).

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'max', + 'description': '

                          upper bound (exclusive).

                          \n', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'choices', + 'description': '

                          array to choose from.

                          \n', + 'type': 'Array' + } + ] + } + ] + }, + 'randomGaussian': { + 'name': 'randomGaussian', + 'params': [ + { + 'name': 'mean', + 'description': '

                          mean.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'sd', + 'description': '

                          standard deviation.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'acos': { + 'name': 'acos', + 'params': [ + { + 'name': 'value', + 'description': '

                          value whose arc cosine is to be returned.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'asin': { + 'name': 'asin', + 'params': [ + { + 'name': 'value', + 'description': '

                          value whose arc sine is to be returned.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'atan': { + 'name': 'atan', + 'params': [ + { + 'name': 'value', + 'description': '

                          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': '

                          radians value to convert to degrees.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'radians': { + 'name': 'radians', + 'params': [ + { + 'name': 'degrees', + 'description': '

                          degree value to convert to radians.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': 'Math' + }, + 'angleMode': { + 'name': 'angleMode', + 'class': 'p5', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'mode', + 'description': '

                          either RADIANS or DEGREES.

                          \n', + 'type': 'Constant' + } + ] + }, + { + 'params': [ + ] + } + ] + }, + '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': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + ] + } + ] + }, + 'textLeading': { + 'name': 'textLeading', + 'class': 'p5', + 'module': 'Typography', + 'overloads': [ + { + 'params': [ + { + 'name': 'leading', + 'description': '

                          spacing between lines of text in units of pixels.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + ] + } + ] + }, + 'textSize': { + 'name': 'textSize', + 'class': 'p5', + 'module': 'Typography', + 'overloads': [ + { + 'params': [ + { + 'name': 'size', + 'description': '

                          size of the letters in units of pixels

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + ] + } + ] + }, + 'textStyle': { + 'name': 'textStyle', + 'class': 'p5', + 'module': 'Typography', + 'overloads': [ + { + 'params': [ + { + 'name': 'style', + 'description': '

                          styling for text, either NORMAL,\n ITALIC, BOLD or BOLDITALIC

                          \n', + 'type': 'Constant' + } + ], + 'chainable': 1 + }, + { + 'params': [ + ] + } + ] + }, + 'textWidth': { + 'name': 'textWidth', + 'params': [ + { + 'name': 'str', + 'description': '

                          string of text to measure.

                          \n', + 'type': 'String' + } + ], + 'class': 'p5', + 'module': 'Typography' + }, + 'textAscent': { + 'name': 'textAscent', + 'class': 'p5', + 'module': 'Typography' + }, + 'textDescent': { + 'name': 'textDescent', + 'class': 'p5', + 'module': 'Typography' + }, + 'textWrap': { + 'name': 'textWrap', + 'params': [ + { + 'name': 'style', + 'description': '

                          text wrapping style, either WORD or CHAR.

                          \n', + 'type': 'Constant' + } + ], + 'class': 'p5', + 'module': 'Typography' + }, + 'loadFont': { + 'name': 'loadFont', + 'params': [ + { + 'name': 'path', + 'description': '

                          path of the font to be loaded.

                          \n', + 'type': 'String' + }, + { + 'name': 'successCallback', + 'description': '

                          function called with the\n p5.Font object after it\n loads.

                          \n', + 'type': 'Function', + 'optional': true + }, + { + 'name': 'failureCallback', + 'description': '

                          function called with the error\n Event\n object if the font fails to load.

                          \n', + 'type': 'Function', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Typography' + }, + 'text': { + 'name': 'text', + 'params': [ + { + 'name': 'str', + 'description': '

                          text to be displayed.

                          \n', + 'type': 'String|Object|Array|Number|Boolean' + }, + { + 'name': 'x', + 'description': '

                          x-coordinate of the text box.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the text box.

                          \n', + 'type': 'Number' + }, + { + 'name': 'maxWidth', + 'description': '

                          maximum width of the text box. See\n rectMode() for\n other options.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'maxHeight', + 'description': '

                          maximum height of the text box. See\n rectMode() for\n other options.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Typography' + }, + 'textFont': { + 'name': 'textFont', + 'class': 'p5', + 'module': 'Typography', + 'overloads': [ + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'font', + 'description': '

                          font as a p5.Font object or a string.

                          \n', + 'type': 'Object|String' + }, + { + 'name': 'size', + 'description': '

                          font size in pixels.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ] + } + ] + }, + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ] + }, + { + 'params': [ + { + 'name': 'ns', + 'description': '

                          values to parse

                          \n', + 'type': 'Array' + }, + { + 'name': 'radix', + 'description': '', + 'type': 'Integer', + 'optional': true + } + ] + } + ] + }, + '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': true + } + ] + }, + { + 'params': [ + { + 'name': 'ns', + 'description': '

                          array of values to parse

                          \n', + 'type': 'Number[]' + }, + { + 'name': 'digits', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + } + ] + }, + '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': true + }, + { + 'name': 'right', + 'description': '

                          number of digits to the right of the\n decimal point

                          \n', + 'type': 'Integer|String', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'nums', + 'description': '

                          the Numbers to format

                          \n', + 'type': 'Array' + }, + { + 'name': 'left', + 'description': '', + 'type': 'Integer|String', + 'optional': true + }, + { + 'name': 'right', + 'description': '', + 'type': 'Integer|String', + 'optional': true + } + ] + } + ] + }, + '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': true + } + ] + }, + { + 'params': [ + { + 'name': 'nums', + 'description': '

                          the Numbers to format

                          \n', + 'type': 'Array' + }, + { + 'name': 'right', + 'description': '', + 'type': 'Integer|String', + 'optional': true + } + ] + } + ] + }, + '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': true + }, + { + 'name': 'right', + 'description': '

                          number of digits to the right of the\n decimal point

                          \n', + 'type': 'Integer', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'nums', + 'description': '

                          the Numbers to format

                          \n', + 'type': 'Number[]' + }, + { + 'name': 'left', + 'description': '', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'right', + 'description': '', + 'type': 'Integer', + 'optional': true + } + ] + } + ] + }, + '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': true + }, + { + 'name': 'right', + 'description': '

                          number of digits to the right of the\n decimal point

                          \n', + 'type': 'Integer', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'nums', + 'description': '

                          the Numbers to format

                          \n', + 'type': 'Array' + }, + { + 'name': 'left', + 'description': '', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'right', + 'description': '', + 'type': 'Integer', + 'optional': true + } + ] + } + ] + }, + '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': true + } + ], + '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' + }, + 'beginGeometry': { + 'name': 'beginGeometry', + 'class': 'p5', + 'module': 'Shape' + }, + 'endGeometry': { + 'name': 'endGeometry', + 'class': 'p5', + 'module': 'Shape' + }, + 'buildGeometry': { + 'name': 'buildGeometry', + 'params': [ + { + 'name': 'callback', + 'description': '

                          A function that draws shapes.

                          \n', + 'type': 'Function' + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'freeGeometry': { + 'name': 'freeGeometry', + 'params': [ + { + 'name': 'geometry', + 'description': '

                          The geometry whose resources should be freed

                          \n', + 'type': 'p5.Geometry' + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'plane': { + 'name': 'plane', + 'params': [ + { + 'name': 'width', + 'description': '

                          width of the plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'height', + 'description': '

                          height of the plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'detailX', + 'description': '

                          Optional number of triangle\n subdivisions in x-dimension

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          Optional number of triangle\n subdivisions in y-dimension

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'box': { + 'name': 'box', + 'params': [ + { + 'name': 'width', + 'description': '

                          width of the box

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'height', + 'description': '

                          height of the box

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'depth', + 'description': '

                          depth of the box

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'detailX', + 'description': '

                          Optional number of triangle\n subdivisions in x-dimension

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          Optional number of triangle\n subdivisions in y-dimension

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'sphere': { + 'name': 'sphere', + 'params': [ + { + 'name': 'radius', + 'description': '

                          radius of circle

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'detailX', + 'description': '

                          optional number of subdivisions in x-dimension

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          optional number of subdivisions in y-dimension

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'cylinder': { + 'name': 'cylinder', + 'params': [ + { + 'name': 'radius', + 'description': '

                          radius of the surface

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'height', + 'description': '

                          height of the cylinder

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'detailX', + 'description': '

                          number of subdivisions in x-dimension;\n default is 24

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          number of subdivisions in y-dimension;\n default is 1

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'bottomCap', + 'description': '

                          whether to draw the bottom of the cylinder

                          \n', + 'type': 'Boolean', + 'optional': true + }, + { + 'name': 'topCap', + 'description': '

                          whether to draw the top of the cylinder

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'cone': { + 'name': 'cone', + 'params': [ + { + 'name': 'radius', + 'description': '

                          radius of the bottom surface

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'height', + 'description': '

                          height of the cone

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'detailX', + 'description': '

                          number of segments,\n the more segments the smoother geometry\n default is 24

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          number of segments,\n the more segments the smoother geometry\n default is 1

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'cap', + 'description': '

                          whether to draw the base of the cone

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'ellipsoid': { + 'name': 'ellipsoid', + 'params': [ + { + 'name': 'radiusx', + 'description': '

                          x-radius of ellipsoid

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'radiusy', + 'description': '

                          y-radius of ellipsoid

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'radiusz', + 'description': '

                          z-radius of ellipsoid

                          \n', + 'type': 'Number', + 'optional': true + }, + { + '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': true + }, + { + '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': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'torus': { + 'name': 'torus', + 'params': [ + { + 'name': 'radius', + 'description': '

                          radius of the whole ring

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'tubeRadius', + 'description': '

                          radius of the tube

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'detailX', + 'description': '

                          number of segments in x-dimension,\n the more segments the smoother geometry\n default is 24

                          \n', + 'type': 'Integer', + 'optional': true + }, + { + 'name': 'detailY', + 'description': '

                          number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16

                          \n', + 'type': 'Integer', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + 'orbitControl': { + 'name': 'orbitControl', + 'params': [ + { + 'name': 'sensitivityX', + 'description': '

                          sensitivity to mouse movement along X axis

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'sensitivityY', + 'description': '

                          sensitivity to mouse movement along Y axis

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'sensitivityZ', + 'description': '

                          sensitivity to scroll movement along Z axis

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'options', + 'description': '

                          An optional object that can contain additional settings,\ndisableTouchActions - Boolean, default value is true.\nSetting this to true makes mobile interactions smoother by preventing\naccidental interactions with the page while orbiting. But if you\'re already\ndoing it via css or want the default touch actions, consider setting it to false.\nfreeRotation - Boolean, default value is false.\nBy default, horizontal movement of the mouse or touch pointer rotates the camera\naround the y-axis, and vertical movement rotates the camera around the x-axis.\nBut if setting this option to true, the camera always rotates in the direction\nthe pointer is moving. For zoom and move, the behavior is the same regardless of\ntrue/false.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'debugMode': { + 'name': 'debugMode', + 'class': 'p5', + 'module': '3D', + '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': true + }, + { + 'name': 'gridDivisions', + 'description': '

                          number of divisions in the grid

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'xOff', + 'description': '

                          X axis offset from origin (0,0,0)

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'yOff', + 'description': '

                          Y axis offset from origin (0,0,0)

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'zOff', + 'description': '

                          Z axis offset from origin (0,0,0)

                          \n', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'mode', + 'description': '', + 'type': 'Constant' + }, + { + 'name': 'axesSize', + 'description': '

                          size of axes icon

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'xOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'yOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'zOff', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'gridSize', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'gridDivisions', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'gridXOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'gridYOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'gridZOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'axesSize', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'axesXOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'axesYOff', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'axesZOff', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + } + ] + }, + 'noDebugMode': { + 'name': 'noDebugMode', + 'class': 'p5', + 'module': '3D' + }, + 'ambientLight': { + 'name': 'ambientLight', + 'class': 'p5', + 'module': '3D', + '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': '

                          alpha value relative to current\n color range (default is 0-255)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          number specifying value between\n white and black

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          a color string

                          \n', + 'type': 'String' + } + ], + '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': '

                          color as a p5.Color

                          \n', + 'type': 'p5.Color' + } + ], + 'chainable': 1 + } + ] + }, + 'specularColor': { + 'name': 'specularColor', + 'class': 'p5', + 'module': '3D', + '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': 'gray', + 'description': '

                          number specifying value between\n white and black

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          color as a CSS string

                          \n', + 'type': 'String' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'values', + 'description': '

                          color as an array containing the\n red, green, and blue components

                          \n', + 'type': 'Number[]' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color

                          \n', + 'type': 'p5.Color' + } + ], + 'chainable': 1 + } + ] + }, + 'directionalLight': { + 'name': 'directionalLight', + 'class': 'p5', + 'module': '3D', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red or hue value relative to the current\n color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green or saturation value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue or brightness value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'x', + 'description': '

                          x component of direction (inclusive range of -1 to 1)

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component of direction (inclusive range of -1 to 1)

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          z component of direction (inclusive range of -1 to 1)

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v1', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'direction', + 'description': '

                          direction of light as a\n p5.Vector

                          \n', + 'type': 'p5.Vector' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', + 'type': 'p5.Color|Number[]|String' + }, + { + 'name': 'x', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '', + 'type': 'p5.Color|Number[]|String' + }, + { + 'name': 'direction', + 'description': '', + 'type': 'p5.Vector' + } + ], + 'chainable': 1 + } + ] + }, + 'pointLight': { + 'name': 'pointLight', + 'class': 'p5', + 'module': '3D', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red or hue value relative to the current\n color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green or saturation value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue or brightness value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'x', + 'description': '

                          x component of position

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component of position

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          z component of 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': '

                          of light as a p5.Vector

                          \n', + 'type': 'p5.Vector' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', + 'type': 'p5.Color|Number[]|String' + }, + { + 'name': 'x', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '', + 'type': 'p5.Color|Number[]|String' + }, + { + 'name': 'position', + 'description': '', + 'type': 'p5.Vector' + } + ], + 'chainable': 1 + } + ] + }, + 'imageLight': { + 'name': 'imageLight', + 'params': [ + { + 'name': 'img', + 'description': '

                          image for the background

                          \n', + 'type': 'p5.image' + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'lights': { + 'name': 'lights', + 'class': 'p5', + 'module': '3D' + }, + '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': '3D' + }, + 'spotLight': { + 'name': 'spotLight', + 'class': 'p5', + 'module': '3D', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red or hue value relative to the current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green or saturation value relative to the current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue or brightness value relative to the current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'x', + 'description': '

                          x component of position

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component of position

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          z component of position

                          \n', + 'type': 'Number' + }, + { + 'name': 'rx', + 'description': '

                          x component of light direction (inclusive range of -1 to 1)

                          \n', + 'type': 'Number' + }, + { + 'name': 'ry', + 'description': '

                          y component of light direction (inclusive range of -1 to 1)

                          \n', + 'type': 'Number' + }, + { + 'name': 'rz', + 'description': '

                          z component of light direction (inclusive range of -1 to 1)

                          \n', + 'type': 'Number' + }, + { + 'name': 'angle', + 'description': '

                          angle of cone. Defaults to PI/3

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'concentration', + 'description': '

                          concentration of cone. Defaults to 100

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', + 'type': 'p5.Color|Number[]|String' + }, + { + 'name': 'position', + 'description': '

                          position of light as a p5.Vector

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'direction', + 'description': '

                          direction of light as a p5.Vector

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'angle', + 'description': '', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + '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': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'color', + 'description': '', + 'type': 'p5.Color|Number[]|String' + }, + { + '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': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'color', + 'description': '', + 'type': 'p5.Color|Number[]|String' + }, + { + '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': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + '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': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + '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': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'color', + 'description': '', + 'type': 'p5.Color|Number[]|String' + }, + { + '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': true + }, + { + 'name': 'concentration', + 'description': '', + 'type': 'Number', + 'optional': true + } + ] + } + ] + }, + 'noLights': { + 'name': 'noLights', + 'class': 'p5', + 'module': '3D' + }, + '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': true + }, + { + 'name': 'failureCallback', + 'description': '

                          called with event error if\n the model fails to load.

                          \n', + 'type': 'Function(Event)', + 'optional': true + }, + { + 'name': 'fileType', + 'description': '

                          The file extension of the model\n (.stl, .obj).

                          \n', + 'type': 'String', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'path', + 'description': '', + 'type': 'String' + }, + { + 'name': 'successCallback', + 'description': '', + 'type': 'function(p5.Geometry)', + 'optional': true + }, + { + 'name': 'failureCallback', + 'description': '', + 'type': 'Function(Event)', + 'optional': true + }, + { + 'name': 'fileType', + 'description': '', + 'type': 'String', + 'optional': true + } + ] + } + ] + }, + '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 p5.Shader object is passed as the first argument.

                          \n', + 'type': 'Function', + 'optional': true + }, + { + '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': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + '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': '3D' + }, + 'createFilterShader': { + 'name': 'createFilterShader', + 'params': [ + { + 'name': 'fragSrc', + 'description': '

                          source code for the fragment shader

                          \n', + 'type': 'String' + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'shader': { + 'name': 'shader', + 'params': [ + { + 'name': 's', + 'description': '

                          the p5.Shader object\nto use for rendering shapes.

                          \n', + 'type': 'p5.Shader' + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'resetShader': { + 'name': 'resetShader', + 'class': 'p5', + 'module': '3D' + }, + 'texture': { + 'name': 'texture', + 'params': [ + { + 'name': 'tex', + 'description': '

                          image to use as texture

                          \n', + 'type': 'p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture' + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'textureMode': { + 'name': 'textureMode', + 'params': [ + { + 'name': 'mode', + 'description': '

                          either IMAGE or NORMAL

                          \n', + 'type': 'Constant' + } + ], + 'class': 'p5', + 'module': '3D' + }, + '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': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'normalMaterial': { + 'name': 'normalMaterial', + 'class': 'p5', + 'module': '3D' + }, + 'ambientMaterial': { + 'name': 'ambientMaterial', + 'class': 'p5', + 'module': '3D', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red or hue value relative to the current\n color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green or saturation value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue or brightness value relative to the\n current color range

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          number specifying value between\n white and black

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'chainable': 1 + } + ] + }, + 'emissiveMaterial': { + 'name': 'emissiveMaterial', + 'class': 'p5', + 'module': '3D', + 'overloads': [ + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          red or hue value relative to the current\n color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v2', + 'description': '

                          green or saturation value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'v3', + 'description': '

                          blue or brightness value relative to the\n current color range

                          \n', + 'type': 'Number' + }, + { + 'name': 'alpha', + 'description': '

                          alpha value relative to current color\n range (default is 0-255)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'gray', + 'description': '

                          number specifying value between\n white and black

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'chainable': 1 + } + ] + }, + 'specularMaterial': { + 'name': 'specularMaterial', + 'class': 'p5', + 'module': '3D', + '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': true + } + ], + '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': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'color', + 'description': '

                          color as a p5.Color,\n as an array, or as a CSS string

                          \n', + 'type': 'p5.Color|Number[]|String' + } + ], + 'chainable': 1 + } + ] + }, + 'shininess': { + 'name': 'shininess', + 'params': [ + { + 'name': 'shine', + 'description': '

                          degree of shininess

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'camera': { + 'name': 'camera', + 'params': [ + { + 'name': 'x', + 'description': '

                          camera position value on x axis

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'y', + 'description': '

                          camera position value on y axis

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'z', + 'description': '

                          camera position value on z axis

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'centerX', + 'description': '

                          x coordinate representing center of the sketch

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'centerY', + 'description': '

                          y coordinate representing center of the sketch

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'centerZ', + 'description': '

                          z coordinate representing center of the sketch

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'upX', + 'description': '

                          x component of direction \'up\' from camera

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'upY', + 'description': '

                          y component of direction \'up\' from camera

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'upZ', + 'description': '

                          z component of direction \'up\' from camera

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + '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': true + }, + { + 'name': 'aspect', + 'description': '

                          camera frustum aspect ratio

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'near', + 'description': '

                          frustum near plane length

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'far', + 'description': '

                          frustum far plane length

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'ortho': { + 'name': 'ortho', + 'params': [ + { + 'name': 'left', + 'description': '

                          camera frustum left plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'right', + 'description': '

                          camera frustum right plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'bottom', + 'description': '

                          camera frustum bottom plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'top', + 'description': '

                          camera frustum top plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'near', + 'description': '

                          camera frustum near plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'far', + 'description': '

                          camera frustum far plane

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'frustum': { + 'name': 'frustum', + 'params': [ + { + 'name': 'left', + 'description': '

                          camera frustum left plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'right', + 'description': '

                          camera frustum right plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'bottom', + 'description': '

                          camera frustum bottom plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'top', + 'description': '

                          camera frustum top plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'near', + 'description': '

                          camera frustum near plane

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'far', + 'description': '

                          camera frustum far plane

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'createCamera': { + 'name': 'createCamera', + 'class': 'p5', + 'module': '3D' + }, + 'setCamera': { + 'name': 'setCamera', + 'params': [ + { + 'name': 'cam', + 'description': '

                          p5.Camera object

                          \n', + 'type': 'p5.Camera' + } + ], + 'class': 'p5', + 'module': '3D' + }, + 'vertexNormal': { + 'name': 'vertexNormal', + 'params': [ + { + 'name': 'x', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'v', + 'description': '', + 'type': 'Vector' + } + ], + 'class': 'p5', + 'module': 'Shape' + }, + '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' + } + ] + } + ] + }, + 'getAudioContext': { + 'name': 'getAudioContext', + 'class': 'p5', + 'module': 'p5.sound' + }, + 'userStartAudio': { + 'params': [ + { + 'name': 'elements', + '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': true + }, + { + 'name': 'callback', + 'description': '

                          Callback to invoke when the AudioContext\n has started

                          \n', + 'type': 'Function', + 'optional': true + } + ], + 'name': 'userStartAudio', + 'class': 'p5', + 'module': 'p5.sound' + }, + 'getOutputVolume': { + 'name': 'getOutputVolume', + 'class': 'p5', + 'module': 'p5.sound' + }, + 'outputVolume': { + 'name': 'outputVolume', + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          Schedule this event to happen at\n t seconds in the future

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5', + 'module': 'p5.sound' + }, + 'soundOut': { + 'name': 'soundOut', + 'class': 'p5', + 'module': 'p5.sound' + }, + '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': true, + 'multiple': true + } + ], + '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' + }, + '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': true + }, + { + 'name': 'errorCallback', + 'description': '

                          Name of a function to call if there is\n an error loading the file.

                          \n', + 'type': 'Function', + 'optional': true + }, + { + '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': true + } + ], + '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': true + }, + { + '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': true + } + ], + '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' + } + }, + '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': true + } + ], + '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' + }, + 'width': { + 'name': 'width', + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'height': { + 'name': 'height', + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'parent': { + 'name': 'parent', + 'class': 'p5.Element', + 'module': 'DOM', + 'overloads': [ + { + 'params': [ + { + 'name': 'parent', + 'description': '

                          ID, p5.Element,\n or HTMLElement 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 call when the mouse is\n pressed over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'doubleClicked': { + 'name': 'doubleClicked', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse is\n double clicked over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'mouseWheel': { + 'name': 'mouseWheel', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse wheel is\n scrolled over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'mouseReleased': { + 'name': 'mouseReleased', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse is\n pressed over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'mouseClicked': { + 'name': 'mouseClicked', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse is\n pressed and released over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'mouseMoved': { + 'name': 'mouseMoved', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse\n moves over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'mouseOver': { + 'name': 'mouseOver', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse\n moves onto the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'mouseOut': { + 'name': 'mouseOut', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the mouse\n moves off the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'touchStarted': { + 'name': 'touchStarted', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the touch\n starts.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'touchMoved': { + 'name': 'touchMoved', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the touch\n moves over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'touchEnded': { + 'name': 'touchEnded', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the touch\n ends.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'dragOver': { + 'name': 'dragOver', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the file is\n dragged over the element.\n false disables the function.

                          \n', + 'type': 'Function|Boolean' + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'dragLeave': { + 'name': 'dragLeave', + 'params': [ + { + 'name': 'fxn', + 'description': '

                          function to call when the file is\n dragged off the element.\n false disables the function.

                          \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': true + } + ], + 'chainable': 1 + } + ] + }, + 'center': { + 'name': 'center', + 'params': [ + { + 'name': 'align', + 'description': '

                          passing \'vertical\', \'horizontal\' aligns element accordingly

                          \n', + 'type': 'String', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'append', + 'description': '

                          whether to append HTML to existing

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'y', + 'description': '

                          y-position relative to upper left of window (optional)

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'positionType', + 'description': '

                          it can be static, fixed, relative, sticky, initial or inherit (optional)

                          \n', + 'type': 'String', + 'optional': true + } + ], + 'chainable': 1 + } + ] + }, + 'style': { + 'name': 'style', + 'class': 'p5.Element', + 'module': 'DOM', + 'overloads': [ + { + 'params': [ + { + 'name': 'property', + 'description': '

                          style property to set.

                          \n', + 'type': 'String' + } + ] + }, + { + 'params': [ + { + 'name': 'property', + 'description': '', + 'type': 'String' + }, + { + 'name': 'value', + 'description': '

                          value to assign to the 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 the 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': true + } + ], + 'chainable': 1 + } + ] + }, + 'remove': { + 'name': 'remove', + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'drop': { + 'name': 'drop', + 'params': [ + { + 'name': 'callback', + 'description': '

                          called when a file loads. Called once for each file dropped.

                          \n', + 'type': 'Function' + }, + { + 'name': 'fxn', + 'description': '

                          called once when any files are dropped.

                          \n', + 'type': 'Function', + 'optional': true + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + }, + 'draggable': { + 'name': 'draggable', + 'params': [ + { + 'name': 'elmnt', + 'description': '

                          pass another p5.Element

                          \n', + 'type': 'p5.Element', + 'optional': true + } + ], + 'class': 'p5.Element', + 'module': 'DOM' + } + }, + 'p5.Graphics': { + 'reset': { + 'name': 'reset', + 'class': 'p5.Graphics', + 'module': 'Rendering' + }, + 'remove': { + 'name': 'remove', + 'class': 'p5.Graphics', + 'module': 'Rendering' + }, + 'createFramebuffer': { + 'name': 'createFramebuffer', + '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', + 'optional': true + } + ], + '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 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 playback ends.\n The p5.MediaElement is passed as\n the argument.

                          \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': '

                          cue time to run the callback function.

                          \n', + 'type': 'Number' + }, + { + 'name': 'callback', + 'description': '

                          function to call at the cue time.

                          \n', + 'type': 'Function' + }, + { + 'name': 'value', + 'description': '

                          object to pass as the argument to\n callback.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5.MediaElement', + 'module': 'DOM' + }, + 'removeCue': { + 'name': 'removeCue', + 'params': [ + { + 'name': 'id', + 'description': '

                          ID of the cue, created by media.addCue().

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5.MediaElement', + 'module': 'DOM' + }, + 'clearCues': { + 'name': 'clearCues', + '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' + }, + 'pixelDensity': { + 'name': 'pixelDensity', + 'params': [ + { + 'name': 'density', + 'description': '

                          A scaling factor for the number of pixels per\nside

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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-coordinate of the upper-left corner\n of the subsection to update.

                          \n', + 'type': 'Integer' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the upper-left corner\n of the subsection to update.

                          \n', + 'type': 'Integer' + }, + { + 'name': 'w', + 'description': '

                          width of the subsection to update.

                          \n', + 'type': 'Integer' + }, + { + 'name': 'h', + 'description': '

                          height of the subsection to update.

                          \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 of the subsection to be returned.

                          \n', + 'type': 'Number' + }, + { + 'name': 'h', + 'description': '

                          height of the subsection to be returned.

                          \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 p5.Color object |\n p5.Image to copy.

                          \n', + 'type': 'Number|Number[]|Object' + } + ], + 'class': 'p5.Image', + 'module': 'Image' + }, + 'resize': { + 'name': 'resize', + 'params': [ + { + 'name': 'width', + 'description': '

                          resized image width.

                          \n', + 'type': 'Number' + }, + { + 'name': 'height', + 'description': '

                          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, ERODE, DILATE or BLUR.

                          \n', + 'type': 'Constant' + }, + { + 'name': 'filterParam', + 'description': '

                          parameter unique to each filter.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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.

                          \n

                          Available 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

                          \n

                          http://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': '

                          filename. Defaults to \'untitled\'.

                          \n', + 'type': 'String' + }, + { + 'name': 'extension', + 'description': '

                          file extension, either \'png\' or \'jpg\'.\n Defaults to \'png\'.

                          \n', + 'type': 'String', + 'optional': true + } + ], + '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': '

                          index of the frame to display.

                          \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': '

                          delay in milliseconds between switching frames.

                          \n', + 'type': 'Number' + }, + { + 'name': 'index', + 'description': '

                          index of the frame that will have its delay modified.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + 'class': 'p5.Table', + 'module': 'IO' + }, + 'trim': { + 'name': 'trim', + 'params': [ + { + 'name': 'column', + 'description': '

                          Column ID (number)\n or name (string)

                          \n', + 'type': 'String|Integer', + 'optional': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': '

                          x component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'y', + 'description': '

                          y component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'z', + 'description': '

                          z component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          vector to set.

                          \n', + 'type': 'p5.Vector|Number[]' + } + ], + 'chainable': 1 + } + ] + }, + 'copy': { + 'name': 'copy', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          the p5.Vector to create a copy of

                          \n', + 'type': 'p5.Vector' + } + ], + 'static': 1 + } + ] + }, + 'add': { + 'name': 'add', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'x', + 'description': '

                          x component of the vector to be added.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component of the vector to be added.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'z', + 'description': '

                          z component of the vector to be added.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': '

                          vector to receive the result.

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'rem': { + 'name': 'rem', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'x', + 'description': '

                          x component of divisor vector.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component of divisor vector.

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          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': '

                          The dividend p5.Vector

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'v2', + 'description': '

                          The 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': '

                          x component of the vector to subtract.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component of the vector to subtract.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'z', + 'description': '

                          z component of the vector to subtract.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': '

                          vector to receive the result.

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + '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': '

                          number to multiply with the x component of the vector.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          number to multiply with the y component of the vector.

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          number to multiply with the z component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'arr', + 'description': '

                          array to multiply with the components of the vector.

                          \n', + 'type': 'Number[]' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          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': true + } + ], + 'static': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'n', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'target', + 'description': '

                          vector to receive the result.

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + }, + { + 'params': [ + { + 'name': 'v0', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'v1', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'target', + 'description': '', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + }, + { + 'params': [ + { + 'name': 'v0', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'arr', + 'description': '', + 'type': 'Number[]' + }, + { + 'name': 'target', + 'description': '', + 'type': 'p5.Vector', + 'optional': true + } + ], + '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': '

                          number to divide with the x component of the vector.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          number to divide with the y component of the vector.

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          number to divide with the z component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'arr', + 'description': '

                          array to divide the components of the vector by.

                          \n', + 'type': 'Number[]' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          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': true + } + ], + 'static': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'n', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'target', + 'description': '

                          The vector to receive the result

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + }, + { + 'params': [ + { + 'name': 'v0', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'v1', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'target', + 'description': '', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + }, + { + 'params': [ + { + 'name': 'v0', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'arr', + 'description': '', + 'type': 'Number[]' + }, + { + 'name': 'target', + 'description': '', + 'type': 'p5.Vector', + 'optional': true + } + ], + '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', + 'overloads': [ + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'vecT', + 'description': '

                          the vector to return the squared magnitude of

                          \n', + 'type': 'p5.Vector' + } + ], + 'static': 1 + } + ] + }, + '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': true + }, + { + 'name': 'z', + 'description': '

                          z component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          p5.Vector to be dotted.

                          \n', + 'type': 'p5.Vector' + } + ] + }, + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          first p5.Vector.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'v2', + 'description': '

                          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': '

                          first p5.Vector.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'v2', + 'description': '

                          second p5.Vector.

                          \n', + 'type': 'p5.Vector' + } + ], + 'static': 1 + } + ] + }, + 'dist': { + 'name': 'dist', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'v', + 'description': '

                          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', + 'overloads': [ + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          The vector to normalize

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'target', + 'description': '

                          The vector to receive the result

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'limit': { + 'name': 'limit', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'max', + 'description': '

                          maximum magnitude for the vector.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          the vector to limit

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'max', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'target', + 'description': '

                          the vector to receive the result (Optional)

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'setMag': { + 'name': 'setMag', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'len', + 'description': '

                          new length for this vector.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          the vector to set the magnitude of

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'len', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'target', + 'description': '

                          the vector to receive the result (Optional)

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'heading': { + 'name': 'heading', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          the vector to find the angle of

                          \n', + 'type': 'p5.Vector' + } + ], + 'static': 1 + } + ] + }, + 'setHeading': { + 'name': 'setHeading', + 'params': [ + { + 'name': 'angle', + 'description': '

                          angle of rotation.

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5.Vector', + 'module': 'Math' + }, + 'rotate': { + 'name': 'rotate', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'angle', + 'description': '

                          angle of rotation.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'angle', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'target', + 'description': '

                          The vector to receive the result

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'angleBetween': { + 'name': 'angleBetween', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'value', + 'description': '

                          x, y, and z components of a p5.Vector.

                          \n', + 'type': 'p5.Vector' + } + ] + }, + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          the first vector.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'v2', + 'description': '

                          the second vector.

                          \n', + 'type': 'p5.Vector' + } + ], + 'static': 1 + } + ] + }, + 'lerp': { + 'name': 'lerp', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'x', + 'description': '

                          x component.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y component.

                          \n', + 'type': 'Number' + }, + { + 'name': 'z', + 'description': '

                          z component.

                          \n', + 'type': 'Number' + }, + { + 'name': 'amt', + 'description': '

                          amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

                          \n', + 'type': 'Number' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          p5.Vector to lerp toward.

                          \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

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'slerp': { + 'name': 'slerp', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'v', + 'description': '

                          p5.Vector to slerp toward.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'amt', + 'description': '

                          amount of interpolation between 0.0 (old vector)\n and 1.0 (new vector). 0.5 is halfway between.

                          \n', + 'type': 'Number' + } + ] + }, + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          old vector.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'v2', + 'description': '

                          new vector.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'amt', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'target', + 'description': '

                          vector to receive the result.

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'reflect': { + 'name': 'reflect', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'surfaceNormal', + 'description': '

                          p5.Vector\n to reflect about.

                          \n', + 'type': 'p5.Vector' + } + ], + 'chainable': 1 + }, + { + 'params': [ + { + 'name': 'incidentVector', + 'description': '

                          vector to be reflected.

                          \n', + 'type': 'p5.Vector' + }, + { + 'name': 'surfaceNormal', + 'description': '', + 'type': 'p5.Vector' + }, + { + 'name': 'target', + 'description': '

                          vector to receive the result.

                          \n', + 'type': 'p5.Vector', + 'optional': true + } + ], + 'static': 1 + } + ] + }, + 'array': { + 'name': 'array', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'v', + 'description': '

                          the vector to convert to an array

                          \n', + 'type': 'p5.Vector' + } + ], + 'static': 1 + } + ] + }, + 'equals': { + 'name': 'equals', + 'class': 'p5.Vector', + 'module': 'Math', + 'overloads': [ + { + 'params': [ + { + 'name': 'x', + 'description': '

                          x component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'y', + 'description': '

                          y component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'z', + 'description': '

                          z component of the vector.

                          \n', + 'type': 'Number', + 'optional': true + } + ] + }, + { + 'params': [ + { + 'name': 'value', + 'description': '

                          vector to compare.

                          \n', + 'type': 'p5.Vector|Array' + } + ] + }, + { + 'params': [ + { + 'name': 'v1', + 'description': '

                          the first vector to compare

                          \n', + 'type': 'p5.Vector|Array' + }, + { + 'name': 'v2', + 'description': '

                          the second vector to compare

                          \n', + 'type': 'p5.Vector|Array' + } + ], + 'static': 1 + } + ] + }, + 'fromAngle': { + 'name': 'fromAngle', + 'params': [ + { + 'name': 'angle', + 'description': '

                          desired angle, in radians. Unaffected by angleMode().

                          \n', + 'type': 'Number' + }, + { + 'name': 'length', + 'description': '

                          length of the new vector (defaults to 1).

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Vector', + 'module': 'Math' + }, + 'fromAngles': { + 'name': 'fromAngles', + 'params': [ + { + 'name': 'theta', + 'description': '

                          polar angle in radians (zero is up).

                          \n', + 'type': 'Number' + }, + { + 'name': 'phi', + 'description': '

                          azimuthal angle in radians\n (zero is out of the screen).

                          \n', + 'type': 'Number' + }, + { + 'name': 'length', + 'description': '

                          length of the new vector (defaults to 1).

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': 'str', + 'description': '

                          string of text.

                          \n', + 'type': 'String' + }, + { + 'name': 'x', + 'description': '

                          x-coordinate of the text.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the text.

                          \n', + 'type': 'Number' + }, + { + 'name': 'fontSize', + 'description': '

                          font size. Defaults to the current\n textSize().

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Font', + 'module': 'Typography' + }, + 'textToPoints': { + 'name': 'textToPoints', + 'params': [ + { + 'name': 'str', + 'description': '

                          string of text.

                          \n', + 'type': 'String' + }, + { + 'name': 'x', + 'description': '

                          x-coordinate of the text.

                          \n', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '

                          y-coordinate of the text.

                          \n', + 'type': 'Number' + }, + { + 'name': 'fontSize', + 'description': '

                          font size. Defaults to the current\n textSize().

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'options', + 'description': '

                          object with sampleFactor and simplifyThreshold\n properties.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5.Font', + 'module': 'Typography' + } + }, + 'p5.Camera': { + 'eyeX': { + 'name': 'eyeX', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'eyeY': { + 'name': 'eyeY', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'eyeZ': { + 'name': 'eyeZ', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'centerX': { + 'name': 'centerX', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'centerY': { + 'name': 'centerY', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'centerZ': { + 'name': 'centerZ', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'upX': { + 'name': 'upX', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'upY': { + 'name': 'upY', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'upZ': { + 'name': 'upZ', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'perspective': { + 'name': 'perspective', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'ortho': { + 'name': 'ortho', + 'class': 'p5.Camera', + 'module': '3D' + }, + 'frustum': { + 'name': 'frustum', + 'class': 'p5.Camera', + 'module': '3D' + }, + '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': '3D' + }, + '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': '3D' + }, + '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': '3D' + }, + 'camera': { + 'name': 'camera', + 'class': 'p5.Camera', + 'module': '3D' + }, + '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': '3D' + }, + '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': '3D' + }, + 'set': { + 'name': 'set', + 'params': [ + { + 'name': 'cam', + 'description': '

                          source camera

                          \n', + 'type': 'p5.Camera' + } + ], + 'class': 'p5.Camera', + 'module': '3D' + }, + 'slerp': { + 'name': 'slerp', + 'params': [ + { + 'name': 'cam0', + 'description': '

                          first p5.Camera

                          \n', + 'type': 'p5.Camera' + }, + { + 'name': 'cam1', + 'description': '

                          second p5.Camera

                          \n', + 'type': 'p5.Camera' + }, + { + 'name': 'amt', + 'description': '

                          amount to use for interpolation during slerp

                          \n', + 'type': 'Number' + } + ], + 'class': 'p5.Camera', + 'module': '3D' + } + }, + 'p5.Framebuffer': { + 'pixels': { + 'name': 'pixels', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'resize': { + 'name': 'resize', + 'params': [ + { + 'name': 'width', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'height', + 'description': '', + 'type': 'Number' + } + ], + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'pixelDensity': { + 'name': 'pixelDensity', + 'params': [ + { + 'name': 'density', + 'description': '

                          A scaling factor for the number of pixels per\nside of the framebuffer

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'autoSized': { + 'name': 'autoSized', + 'params': [ + { + 'name': 'autoSized', + 'description': '

                          Whether or not the framebuffer should resize\nalong with the canvas it\'s attached to

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'createCamera': { + 'name': 'createCamera', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'remove': { + 'name': 'remove', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'begin': { + 'name': 'begin', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'end': { + 'name': 'end', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'draw': { + 'name': 'draw', + 'params': [ + { + 'name': 'callback', + 'description': '

                          A function to run that draws to the canvas. The\nfunction will immediately be run, but it will draw to the framebuffer\ninstead of the canvas.

                          \n', + 'type': 'Function' + } + ], + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'get': { + 'name': 'get', + 'class': 'p5.Framebuffer', + 'module': 'Rendering', + '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 of the section to be returned

                          \n', + 'type': 'Number' + }, + { + 'name': 'h', + 'description': '

                          height of the section to be returned

                          \n', + 'type': 'Number' + } + ] + }, + { + 'params': [ + ] + }, + { + 'params': [ + { + 'name': 'x', + 'description': '', + 'type': 'Number' + }, + { + 'name': 'y', + 'description': '', + 'type': 'Number' + } + ] + } + ] + }, + 'color': { + 'name': 'color', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + }, + 'depth': { + 'name': 'depth', + 'class': 'p5.Framebuffer', + 'module': 'Rendering' + } + }, + 'p5.Geometry': { + 'clearColors': { + 'name': 'clearColors', + 'class': 'p5.Geometry', + 'module': 'Shape' + }, + 'computeFaces': { + 'name': 'computeFaces', + 'class': 'p5.Geometry', + 'module': 'Shape' + }, + 'computeNormals': { + 'name': 'computeNormals', + 'params': [ + { + 'name': 'shadingType', + 'description': '

                          shading type (FLAT for flat shading or SMOOTH for smooth shading) for buildGeometry() outputs. Defaults to FLAT.

                          \n', + 'type': 'String', + 'optional': true + }, + { + 'name': 'options', + 'description': '

                          An optional object with configuration.

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5.Geometry', + 'module': 'Shape' + }, + 'averageNormals': { + 'name': 'averageNormals', + 'class': 'p5.Geometry', + 'module': 'Shape' + }, + 'averagePoleNormals': { + 'name': 'averagePoleNormals', + 'class': 'p5.Geometry', + 'module': 'Shape' + }, + 'normalize': { + 'name': 'normalize', + 'class': 'p5.Geometry', + 'module': 'Shape' + } + }, + 'p5.Shader': { + 'copyToContext': { + 'name': 'copyToContext', + 'params': [ + { + 'name': 'context', + 'description': '

                          The graphic or instance to copy this shader to.\nPass window if you need to copy to the main canvas.

                          \n', + 'type': 'p5|p5.Graphics' + } + ], + 'class': 'p5.Shader', + 'module': '3D' + }, + 'setUniform': { + 'name': 'setUniform', + 'params': [ + { + 'name': 'uniformName', + 'description': '

                          the name of the uniform.\nMust correspond to the name used in the vertex and fragment shaders

                          \n', + 'type': 'String' + }, + { + 'name': 'data', + 'description': '

                          the data to associate with the uniform. The type can be\na boolean (true/false), a number, an array of numbers, or\nan image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture)

                          \n', + 'type': 'Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture' + } + ], + 'class': 'p5.Shader', + 'module': '3D' + } + }, + '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': true + }, + { + 'name': 'rate', + 'description': '

                          (optional) playback rate

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'amp', + 'description': '

                          (optional) amplitude (volume)\n of playback

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'cueStart', + 'description': '

                          (optional) cue start time in seconds

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'duration', + 'description': '

                          (optional) duration of playback in seconds

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + }, + { + 'name': 'rate', + 'description': '

                          (optional) playback rate

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'amp', + 'description': '

                          (optional) playback volume

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'cueLoopStart', + 'description': '

                          (optional) startTime in seconds

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'duration', + 'description': '

                          (optional) loop duration in seconds

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + 'class': 'p5.SoundFile', + 'module': 'p5.sound' + }, + 'pan': { + 'name': 'pan', + 'params': [ + { + 'name': 'panValue', + 'description': '

                          Set the stereo panner

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          schedule this event to happen\n seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          Schedule this event to happen at\n t seconds in the future

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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' + }, + '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': true + } + ], + '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': true + } + ], + '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 main output)

                          \n', + 'type': 'SoundObject|undefined', + 'optional': true + }, + { + 'name': 'smoothing', + 'description': '

                          a range between 0.0 and 1.0\n to smooth amplitude readings

                          \n', + 'type': 'Number|undefined', + 'optional': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + }, + { + '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': true + } + ], + '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': true + }, + { + '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': true + } + ], + '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': true + } + ], + '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.Oscillator': { + 'start': { + 'name': 'start', + 'params': [ + { + 'name': 'time', + 'description': '

                          startTime in seconds from now.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'frequency', + 'description': '

                          frequency in Hz.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          schedule this event to happen\n seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Oscillator', + 'module': 'p5.sound' + }, + 'getAmp': { + 'name': 'getAmp', + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          Schedule this event to happen\n at x seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Oscillator', + 'module': 'p5.sound' + }, + 'getFreq': { + 'name': 'getFreq', + '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' + }, + 'getType': { + 'name': 'getType', + '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' + }, + 'getPan': { + 'name': 'getPan', + '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.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': true + }, + { + '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': true + }, + { + 'name': 'releaseTime', + 'description': '

                          Time in seconds from now (defaults to 0)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true, + 'multiple': true + } + ], + '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': true + }, + { + 'name': 'sustainTime', + 'description': '

                          time to sustain before releasing the envelope

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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.Noise': { + 'setType': { + 'name': 'setType', + 'params': [ + { + 'name': 'type', + 'description': '

                          \'white\', \'pink\' or \'brown\'

                          \n', + 'type': 'String', + 'optional': true + } + ], + 'class': 'p5.Noise', + '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': true + } + ], + 'class': 'p5.Pulse', + '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': true + }, + { + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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': true + }, + { + 'name': 'errorCallback', + 'description': '

                          This optional callback receives the error\n message as its argument.

                          \n', + 'type': 'Function', + 'optional': true + } + ], + '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.Effect': { + 'amp': { + 'name': 'amp', + 'params': [ + { + 'name': 'vol', + 'description': '

                          amplitude between 0 and 1.0

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'rampTime', + 'description': '

                          create a fade that lasts until rampTime

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'tFromNow', + 'description': '

                          schedule this event to happen in tFromNow seconds

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Effect', + 'module': 'p5.sound' + }, + 'chain': { + 'name': 'chain', + 'params': [ + { + 'name': 'arguments', + 'description': '

                          Chain together multiple sound objects

                          \n', + 'type': 'Object', + 'optional': true + } + ], + 'class': 'p5.Effect', + 'module': 'p5.sound' + }, + 'drywet': { + 'name': 'drywet', + 'params': [ + { + 'name': 'fade', + 'description': '

                          The desired drywet value (0 - 1.0)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'res', + 'description': '

                          Resonance/Width of the filter frequency\n from 0.001 to 1000

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Filter', + 'module': 'p5.sound' + }, + 'set': { + 'name': 'set', + 'params': [ + { + 'name': 'freq', + 'description': '

                          Frequency in Hz, from 10 to 22050

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'res', + 'description': '

                          Resonance (Q) from 0.001 to 1000

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          schedule this event to happen\n seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + } + ], + '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.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': true + }, + { + 'name': 'rolloffFactor', + 'description': '', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'feedback', + 'description': '

                          sends the delay back through itself\n in a loop that decreases in volume\n each time.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'lowPass', + 'description': '

                          Cutoff frequency. Only frequencies\n below the lowPass will be part of the\n delay.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          schedule this event to happen\n seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'decayRate', + 'description': '

                          Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'reverse', + 'description': '

                          Play the reverb backwards or forwards.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'decayRate', + 'description': '

                          Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'reverse', + 'description': '

                          Play the reverb backwards or forwards.

                          \n', + 'type': 'Boolean', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          schedule this event to happen\n seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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' + }, + 'impulses': { + 'name': 'impulses', + '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' + }, + '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': true + } + ], + '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': true + } + ], + 'class': 'p5.Part', + 'module': 'p5.sound' + }, + 'loop': { + 'name': 'loop', + 'params': [ + { + 'name': 'time', + 'description': '

                          seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': { + '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' + }, + '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': true + } + ], + 'class': 'p5.SoundLoop', + 'module': 'p5.sound' + }, + 'stop': { + 'name': 'stop', + 'params': [ + { + 'name': 'timeFromNow', + 'description': '

                          schedule a stopping time

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.SoundLoop', + 'module': 'p5.sound' + }, + 'pause': { + 'name': 'pause', + 'params': [ + { + 'name': 'timeFromNow', + 'description': '

                          schedule a pausing time

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + }, + { + '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': true + }, + { + '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': true + }, + { + 'name': 'threshold', + 'description': '

                          The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0

                          \n', + 'type': 'Number', + 'optional': true + }, + { + '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': true + } + ], + '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': true + }, + { + 'name': 'time', + 'description': '

                          Assign time value to schedule the change in value

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'time', + 'description': '

                          Assign time value to schedule the change in value

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'time', + 'description': '

                          Assign time value to schedule the change in value

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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': true + } + ], + 'class': 'p5.Compressor', + 'module': 'p5.sound' + }, + 'reduction': { + 'name': 'reduction', + 'class': 'p5.Compressor', + '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': true + } + ], + 'class': 'p5.PeakDetect', + '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': true + } + ], + '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': true + }, + { + 'name': 'callback', + 'description': '

                          The name of a function that will be\n called once the recording completes

                          \n', + 'type': 'Function', + 'optional': true + } + ], + 'class': 'p5.SoundRecorder', + 'module': 'p5.sound' + }, + 'stop': { + 'name': 'stop', + 'class': 'p5.SoundRecorder', + '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': true, + 'optdefault': '0.25' + }, + { + 'name': 'oversample', + 'description': '

                          \'none\', \'2x\', or \'4x\'.

                          \n', + 'type': 'String', + 'optional': true, + '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': true, + 'optdefault': '0.25' + }, + { + 'name': 'oversample', + 'description': '

                          \'none\', \'2x\', or \'4x\'.

                          \n', + 'type': 'String', + 'optional': true, + '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' + } + }, + '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': true + }, + { + 'name': 'timeFromNow', + 'description': '

                          schedule this event to happen\n seconds from now

                          \n', + 'type': 'Number', + 'optional': true + } + ], + 'class': 'p5.Gain', + '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.MonoSynth': { + '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' + }, + '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': true + }, + { + 'name': 'secondsFromNow', + 'description': '

                          time from now (in seconds) at which to play

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'sustainTime', + 'description': '

                          time to sustain before releasing the envelope. Defaults to 0.15 seconds.

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'secondsFromNow', + 'description': '

                          time from now (in seconds) at which to play

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + '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': true + }, + { + 'name': 'releaseTime', + 'description': '

                          Time in seconds from now (defaults to 0)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + } + ], + '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.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': true + }, + { + 'name': 'velocity', + 'description': '

                          velocity of the note to play (ranging from 0 to 1)

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'secondsFromNow', + 'description': '

                          time from now (in seconds) at which to play

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'sustainTime', + 'description': '

                          time to sustain before releasing the envelope

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'attackTime', + 'description': '

                          Time (in seconds before envelope\n reaches Attack Level

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'decayTime', + 'description': '

                          Time (in seconds) before envelope\n reaches Decay/Sustain Level

                          \n', + 'type': 'Number', + 'optional': true + }, + { + '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': true + }, + { + 'name': 'releaseTime', + 'description': '

                          Time in seconds from now (defaults to 0)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'decayTime', + 'description': '

                          Time (in seconds) before envelope\n reaches Decay/Sustain Level

                          \n', + 'type': 'Number', + 'optional': true + }, + { + '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': true + }, + { + 'name': 'releaseTime', + 'description': '

                          Time in seconds from now (defaults to 0)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'velocity', + 'description': '

                          velocity of the note to play (ranging from 0 to 1)/

                          \n', + 'type': 'Number', + 'optional': true + }, + { + 'name': 'secondsFromNow', + 'description': '

                          time from now (in seconds)

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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': true + }, + { + 'name': 'secondsFromNow', + 'description': '

                          time to trigger the release

                          \n', + 'type': 'Number', + 'optional': true + } + ], + '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' + } + } + } + }, + { + } + ], + 2: [ + function (_dereq_, module, exports) { + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + module.exports = _arrayWithHoles; + }, + { + } + ], + 3: [ + function (_dereq_, module, exports) { + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } + module.exports = _arrayWithoutHoles; + }, + { + } + ], + 4: [ + function (_dereq_, module, exports) { + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + module.exports = _assertThisInitialized; + }, + { + } + ], + 5: [ + function (_dereq_, module, exports) { + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + module.exports = _classCallCheck; + }, + { + } + ], + 6: [ + function (_dereq_, module, exports) { + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + module.exports = _createClass; + }, + { + } + ], + 7: [ + function (_dereq_, module, exports) { + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + module.exports = _defineProperty; + }, + { + } + ], + 8: [ + function (_dereq_, module, exports) { + function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + module.exports = _getPrototypeOf; + }, + { + } + ], + 9: [ + function (_dereq_, module, exports) { + var setPrototypeOf = _dereq_('./setPrototypeOf'); + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) setPrototypeOf(subClass, superClass); + } + module.exports = _inherits; + }, + { + './setPrototypeOf': 16 + } + ], + 10: [ + function (_dereq_, module, exports) { + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + module.exports = _iterableToArray; + }, + { + } + ], + 11: [ + function (_dereq_, module, exports) { + function _iterableToArrayLimit(arr, i) { + var _arr = [ + ]; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + module.exports = _iterableToArrayLimit; + }, + { + } + ], + 12: [ + function (_dereq_, module, exports) { + function _nonIterableRest() { + throw new TypeError('Invalid attempt to destructure non-iterable instance'); + } + module.exports = _nonIterableRest; + }, + { + } + ], + 13: [ + function (_dereq_, module, exports) { + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + module.exports = _nonIterableSpread; + }, + { + } + ], + 14: [ + function (_dereq_, module, exports) { + var defineProperty = _dereq_('./defineProperty'); + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : { + }; + var ownKeys = Object.keys(source); + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + ownKeys.forEach(function (key) { + defineProperty(target, key, source[key]); + }); + } + return target; + } + module.exports = _objectSpread; + }, + { + './defineProperty': 7 + } + ], + 15: [ + function (_dereq_, module, exports) { + var _typeof = _dereq_('../helpers/typeof'); + var assertThisInitialized = _dereq_('./assertThisInitialized'); + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return assertThisInitialized(self); + } + module.exports = _possibleConstructorReturn; + }, + { + '../helpers/typeof': 19, + './assertThisInitialized': 4 + } + ], + 16: [ + function (_dereq_, module, exports) { + function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + module.exports = _setPrototypeOf; + }, + { + } + ], + 17: [ + function (_dereq_, module, exports) { + var arrayWithHoles = _dereq_('./arrayWithHoles'); + var iterableToArrayLimit = _dereq_('./iterableToArrayLimit'); + var nonIterableRest = _dereq_('./nonIterableRest'); + function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); + } + module.exports = _slicedToArray; + }, + { + './arrayWithHoles': 2, + './iterableToArrayLimit': 11, + './nonIterableRest': 12 + } + ], + 18: [ + function (_dereq_, module, exports) { + var arrayWithoutHoles = _dereq_('./arrayWithoutHoles'); + var iterableToArray = _dereq_('./iterableToArray'); + var nonIterableSpread = _dereq_('./nonIterableSpread'); + function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); + } + module.exports = _toConsumableArray; + }, + { + './arrayWithoutHoles': 3, + './iterableToArray': 10, + './nonIterableSpread': 13 + } + ], + 19: [ + function (_dereq_, module, exports) { + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + module.exports = _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + module.exports = _typeof; + }, + { + } + ], + 20: [ + function (_dereq_, module, exports) { + 'use strict'; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = [ + ]; + var revLookup = [ + ]; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + function getLens(b64) { + var len = b64.length; + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + var validLen = b64.indexOf('='); + if (validLen === - 1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, + placeHoldersLen]; + } // base64 is 4/3 + up to two characters of the original data + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = [ + ]; + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(''); + } + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var parts = [ + ]; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + '='); + } + return parts.join(''); + } + }, + { + } + ], + 21: [ + function (_dereq_, module, exports) { + }, + { + } + ], + 22: [ + function (_dereq_, module, exports) { + (function (Buffer) { + /*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + /* eslint-disable no-proto */ + 'use strict'; + var base64 = _dereq_('base64-js'); + var ieee754 = _dereq_('ieee754'); + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function () { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from(arg, encodingOrOffset, length); + } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + + if (typeof Symbol !== 'undefined' && Symbol.species != null && Buffer[Symbol.species] === Buffer) { + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true, + enumerable: false, + writable: false + }); + } + Buffer.poolSize = 8192; // not used by this implementation + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value); + } + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + var valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + var b = fromObject(value); + if (b) return b; + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value); + } /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + var buf; + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + return length | 0; + } + function SlowBuffer(length) { + if ( + length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + return Buffer.alloc( + length); + } + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) return 0; + var x = a.length; + var y = b.length; + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) return - 1; + if (y < x) return 1; + return 0; + }; + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + default: + return false; + } + }; + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer.alloc(0); + } + var i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + if (isInstance(buf, Uint8Array)) { + buf = Buffer.from(buf); + } + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + buf.copy(buffer, pos); + pos += buf.length; + } + return buffer; + }; + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string); + } + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; + // Use a for loop to avoid recursion + var loweredCase = false; + for (; ; ) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + case 'hex': + return len >>> 1; + case 'base64': + return base64ToBytes(string).length; + default: + if (loweredCase) { + return mustMatch ? - 1 : utf8ToBytes(string).length; // assume utf8 + } + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer.byteLength = byteLength; + function slowToString(encoding, start, end) { + var loweredCase = false; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + if (start > this.length) { + return ''; + } + if (end === undefined || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ''; + } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ''; + } + if (!encoding) encoding = 'utf8'; + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + case 'ascii': + return asciiSlice(this, start, end); + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + case 'base64': + return base64Slice(this, start, end); + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + Buffer.prototype._isBuffer = true; + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + typeof target); + } + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return - 1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) return - 1; + if (y < x) return 1; + return 0; + }; + // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return - 1; + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < - 2147483648) { + byteOffset = - 2147483648; + } + byteOffset = + byteOffset; // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return - 1; + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return - 1; + } // Normalize val + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return - 1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 255; // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [ + val + ], byteOffset, encoding, dir); + } + throw new TypeError('val must be string, number or Buffer'); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return - 1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + var i; + if (dir) { + var foundIndex = - 1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === - 1 ? 0 : i - foundIndex)) { + if (foundIndex === - 1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== - 1) i -= i - foundIndex; + foundIndex = - 1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + var found = true; + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + if (found) return i; + } + } + return - 1; + } + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== - 1; + }; + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + var strLen = string.length; + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + function latin1Write(buf, string, offset, length) { + return asciiWrite(buf, string, offset, length); + } + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + for (; ; ) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + case 'ascii': + return asciiWrite(this, string, offset, length); + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length); + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = [ + ]; + var i = start; + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + var secondByte, + thirdByte, + fourthByte, + tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + // encode to utf16 (surrogate pair dance) + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + var res = ''; + var i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + if (end < start) end = start; + var newBuf = this.subarray(start, end); + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + var val = this[offset + --byteLength]; + var mul = 1; + while (byteLength > 0 && (mul *= 256)) { + val += this[offset + --byteLength] * mul; + } + return val; + }; + Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) return this[offset]; + return (255 - this[offset] + 1) * - 1; + }; + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = + value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + var mul = 1; + var i = 0; + this[offset] = value & 255; + while (++i < byteLength && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = + value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, - limit); + } + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 255; + while (++i < byteLength && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, - limit); + } + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength; + }; + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 127, - 128); + if (value < 0) value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, - 32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, - 32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 2147483647, - 2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 2147483647, - 2147483648); + if (value < 0) value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, - 3.4028234663852886e+38); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = + value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157e+308, - 1.7976931348623157e+308); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + // Copy 0 bytes; we're done + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + var len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (var i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start]; + } + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + if (val.length === 1) { + var code = val.charCodeAt(0); + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + // HELPER FUNCTIONS + // ================ + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=') [0]; + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, ''); + // Node converts strings with length < 2 to '' + if (str.length < 2) return ''; + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '='; + } + return str; + } + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = [ + ]; + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + // is surrogate component + if (codePoint > 55295 && codePoint < 57344) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 56319) { + // unexpected trail + if ((units -= 3) > - 1) bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > - 1) bytes.push(239, 191, 189); + continue; + } // valid lead + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + if (codePoint < 56320) { + if ((units -= 3) > - 1) bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > - 1) bytes.push(239, 191, 189); + } + leadSurrogate = null; + // encode utf8 + if (codePoint < 128) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error('Invalid code point'); + } + } + return bytes; + } + function asciiToBytes(str) { + var byteArray = [ + ]; + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + var c, + hi, + lo; + var byteArray = [ + ]; + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + }).call(this, _dereq_('buffer').Buffer) + }, + { + 'base64-js': 20, + 'buffer': 22, + 'ieee754': 268 + } + ], + 23: [ + function (_dereq_, module, exports) { + module.exports = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } + return it; + }; + }, + { + } + ], + 24: [ + function (_dereq_, module, exports) { + var isObject = _dereq_('../internals/is-object'); + module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError('Can\'t set ' + String(it) + ' as a prototype'); + } + return it; + }; + }, + { + '../internals/is-object': 92 + } + ], + 25: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var create = _dereq_('../internals/object-create'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var UNSCOPABLES = wellKnownSymbol('unscopables'); + var ArrayPrototype = Array.prototype; + // Array.prototype[@@unscopables] + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + if (ArrayPrototype[UNSCOPABLES] == undefined) { + definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null) + }); + } // add a key to Array.prototype[@@unscopables] + + module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; + }; + }, + { + '../internals/object-create': 108, + '../internals/object-define-property': 110, + '../internals/well-known-symbol': 166 + } + ], + 26: [ + function (_dereq_, module, exports) { + 'use strict'; + var charAt = _dereq_('../internals/string-multibyte').charAt; + // `AdvanceStringIndex` abstract operation + // https://tc39.github.io/ecma262/#sec-advancestringindex + module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); + }; + }, + { + '../internals/string-multibyte': 141 + } + ], + 27: [ + function (_dereq_, module, exports) { + module.exports = function (it, Constructor, name) { + if (!(it instanceof Constructor)) { + throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); + } + return it; + }; + }, + { + } + ], + 28: [ + function (_dereq_, module, exports) { + var isObject = _dereq_('../internals/is-object'); + module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } + return it; + }; + }, + { + '../internals/is-object': 92 + } + ], + 29: [ + function (_dereq_, module, exports) { + module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined'; + }, + { + } + ], + 30: [ + function (_dereq_, module, exports) { + 'use strict'; + var NATIVE_ARRAY_BUFFER = _dereq_('../internals/array-buffer-native'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var global = _dereq_('../internals/global'); + var isObject = _dereq_('../internals/is-object'); + var has = _dereq_('../internals/has'); + var classof = _dereq_('../internals/classof'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var redefine = _dereq_('../internals/redefine'); + var defineProperty = _dereq_('../internals/object-define-property').f; + var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); + var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var uid = _dereq_('../internals/uid'); + var Int8Array = global.Int8Array; + var Int8ArrayPrototype = Int8Array && Int8Array.prototype; + var Uint8ClampedArray = global.Uint8ClampedArray; + var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; + var TypedArray = Int8Array && getPrototypeOf(Int8Array); + var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); + var ObjectPrototype = Object.prototype; + var isPrototypeOf = ObjectPrototype.isPrototypeOf; + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); + // Fixing native typed arrays in Opera Presto crashes the browser, see #595 + var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; + var TYPED_ARRAY_TAG_REQIRED = false; + var NAME; + var TypedArrayConstructorsList = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8 + }; + var isView = function isView(it) { + var klass = classof(it); + return klass === 'DataView' || has(TypedArrayConstructorsList, klass); + }; + var isTypedArray = function (it) { + return isObject(it) && has(TypedArrayConstructorsList, classof(it)); + }; + var aTypedArray = function (it) { + if (isTypedArray(it)) return it; + throw TypeError('Target is not a typed array'); + }; + var aTypedArrayConstructor = function (C) { + if (setPrototypeOf) { + if (isPrototypeOf.call(TypedArray, C)) return C; + } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) { + return C; + } + } + throw TypeError('Target is not a typed array constructor'); + }; + var exportTypedArrayMethod = function (KEY, property, forced) { + if (!DESCRIPTORS) return; + if (forced) for (var ARRAY in TypedArrayConstructorsList) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) { + delete TypedArrayConstructor.prototype[KEY]; + } + } + if (!TypedArrayPrototype[KEY] || forced) { + redefine(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property); + } + }; + var exportTypedArrayStaticMethod = function (KEY, property, forced) { + var ARRAY, + TypedArrayConstructor; + if (!DESCRIPTORS) return; + if (setPrototypeOf) { + if (forced) for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) { + delete TypedArrayConstructor[KEY]; + } + } + if (!TypedArray[KEY] || forced) { + // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable + try { + return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property); + } catch (error) { /* empty */ + } + } else return; + } + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { + redefine(TypedArrayConstructor, KEY, property); + } + } + }; + for (NAME in TypedArrayConstructorsList) { + if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false; + } // WebKit bug - typed arrays constructors prototype is Object.prototype + + if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) { + // eslint-disable-next-line no-shadow + TypedArray = function TypedArray() { + throw TypeError('Incorrect invocation'); + }; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); + } + } + if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { + TypedArrayPrototype = TypedArray.prototype; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); + } + } // WebKit bug - one more object in Uint8ClampedArray prototype chain + + if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { + setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); + } + if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) { + TYPED_ARRAY_TAG_REQIRED = true; + defineProperty(TypedArrayPrototype, TO_STRING_TAG, { + get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + } + }); + for (NAME in TypedArrayConstructorsList) if (global[NAME]) { + createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); + } + } + module.exports = { + NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, + aTypedArray: aTypedArray, + aTypedArrayConstructor: aTypedArrayConstructor, + exportTypedArrayMethod: exportTypedArrayMethod, + exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, + isView: isView, + isTypedArray: isTypedArray, + TypedArray: TypedArray, + TypedArrayPrototype: TypedArrayPrototype + }; + }, + { + '../internals/array-buffer-native': 29, + '../internals/classof': 47, + '../internals/create-non-enumerable-property': 56, + '../internals/descriptors': 61, + '../internals/global': 77, + '../internals/has': 78, + '../internals/is-object': 92, + '../internals/object-define-property': 110, + '../internals/object-get-prototype-of': 115, + '../internals/object-set-prototype-of': 119, + '../internals/redefine': 126, + '../internals/uid': 163, + '../internals/well-known-symbol': 166 + } + ], + 31: [ + function (_dereq_, module, exports) { + 'use strict'; + var global = _dereq_('../internals/global'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var NATIVE_ARRAY_BUFFER = _dereq_('../internals/array-buffer-native'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var redefineAll = _dereq_('../internals/redefine-all'); + var fails = _dereq_('../internals/fails'); + var anInstance = _dereq_('../internals/an-instance'); + var toInteger = _dereq_('../internals/to-integer'); + var toLength = _dereq_('../internals/to-length'); + var toIndex = _dereq_('../internals/to-index'); + var IEEE754 = _dereq_('../internals/ieee754'); + var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); + var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); + var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; + var defineProperty = _dereq_('../internals/object-define-property').f; + var arrayFill = _dereq_('../internals/array-fill'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var ARRAY_BUFFER = 'ArrayBuffer'; + var DATA_VIEW = 'DataView'; + var PROTOTYPE = 'prototype'; + var WRONG_LENGTH = 'Wrong length'; + var WRONG_INDEX = 'Wrong index'; + var NativeArrayBuffer = global[ARRAY_BUFFER]; + var $ArrayBuffer = NativeArrayBuffer; + var $DataView = global[DATA_VIEW]; + var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; + var ObjectPrototype = Object.prototype; + var RangeError = global.RangeError; + var packIEEE754 = IEEE754.pack; + var unpackIEEE754 = IEEE754.unpack; + var packInt8 = function (number) { + return [number & 255]; + }; + var packInt16 = function (number) { + return [number & 255, + number >> 8 & 255]; + }; + var packInt32 = function (number) { + return [number & 255, + number >> 8 & 255, + number >> 16 & 255, + number >> 24 & 255]; + }; + var unpackInt32 = function (buffer) { + return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; + }; + var packFloat32 = function (number) { + return packIEEE754(number, 23, 4); + }; + var packFloat64 = function (number) { + return packIEEE754(number, 52, 8); + }; + var addGetter = function (Constructor, key) { + defineProperty(Constructor[PROTOTYPE], key, { + get: function () { + return getInternalState(this) [key]; + } + }); + }; + var get = function (view, count, index, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = bytes.slice(start, start + count); + return isLittleEndian ? pack : pack.reverse(); + }; + var set = function (view, count, index, conversion, value, isLittleEndian) { + var intIndex = toIndex(index); + var store = getInternalState(view); + if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); + var bytes = getInternalState(store.buffer).bytes; + var start = intIndex + store.byteOffset; + var pack = conversion( + value); + for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; + }; + if (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + setInternalState(this, { + bytes: arrayFill.call(new Array(byteLength), 0), + byteLength: byteLength + }); + if (!DESCRIPTORS) this.byteLength = byteLength; + }; + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = getInternalState(buffer).byteLength; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + setInternalState(this, { + buffer: buffer, + byteLength: byteLength, + byteOffset: offset + }); + if (!DESCRIPTORS) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; + if (DESCRIPTORS) { + addGetter($ArrayBuffer, 'byteLength'); + addGetter($DataView, 'buffer'); + addGetter($DataView, 'byteLength'); + addGetter($DataView, 'byteOffset'); + } + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset) [0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset) [0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */ ) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */ ) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */ ) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */ ) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */ ) { + return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */ ) { + return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */ ) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */ ) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */ ) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */ ) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */ ) { + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */ ) { + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); + } + }); + } else { + if (!fails(function () { + NativeArrayBuffer(1); + }) || !fails(function () { + new NativeArrayBuffer( - 1); // eslint-disable-line no-new + }) || fails(function () { + new NativeArrayBuffer(); // eslint-disable-line no-new + new NativeArrayBuffer(1.5); // eslint-disable-line no-new + new NativeArrayBuffer(NaN); // eslint-disable-line no-new + return NativeArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new NativeArrayBuffer(toIndex(length)); + }; + var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE]; + for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j; ) { + if (!((key = keys[j++]) in $ArrayBuffer)) { + createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); + } + } + ArrayBufferPrototype.constructor = $ArrayBuffer; + } // WebKit bug - the same parent prototype for typed arrays and data view + + if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) { + setPrototypeOf($DataViewPrototype, ObjectPrototype); + } // iOS Safari 7.x bug + + var testView = new $DataView(new $ArrayBuffer(2)); + var nativeSetInt8 = $DataViewPrototype.setInt8; + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, { + setInt8: function setInt8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + nativeSetInt8.call(this, byteOffset, value << 24 >> 24); + } + }, { + unsafe: true + }); + } + setToStringTag($ArrayBuffer, ARRAY_BUFFER); + setToStringTag($DataView, DATA_VIEW); + module.exports = { + ArrayBuffer: $ArrayBuffer, + DataView: $DataView + }; + }, + { + '../internals/an-instance': 27, + '../internals/array-buffer-native': 29, + '../internals/array-fill': 33, + '../internals/create-non-enumerable-property': 56, + '../internals/descriptors': 61, + '../internals/fails': 69, + '../internals/global': 77, + '../internals/ieee754': 83, + '../internals/internal-state': 88, + '../internals/object-define-property': 110, + '../internals/object-get-own-property-names': 113, + '../internals/object-get-prototype-of': 115, + '../internals/object-set-prototype-of': 119, + '../internals/redefine-all': 125, + '../internals/set-to-string-tag': 135, + '../internals/to-index': 151, + '../internals/to-integer': 153, + '../internals/to-length': 154 + } + ], + 32: [ + function (_dereq_, module, exports) { + 'use strict'; + var toObject = _dereq_('../internals/to-object'); + var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); + var toLength = _dereq_('../internals/to-length'); + var min = Math.min; + // `Array.prototype.copyWithin` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin + module.exports = [ + ].copyWithin || function copyWithin(target /* = 0 */ , start /* = 0, end = @length */ ) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = - 1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } + return O; + }; + }, + { + '../internals/to-absolute-index': 150, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 33: [ + function (_dereq_, module, exports) { + 'use strict'; + var toObject = _dereq_('../internals/to-object'); + var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); + var toLength = _dereq_('../internals/to-length'); + // `Array.prototype.fill` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.fill + module.exports = function fill(value /* , start = 0, end = @length */ ) { + var O = toObject(this); + var length = toLength(O.length); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; + }; + }, + { + '../internals/to-absolute-index': 150, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 34: [ + function (_dereq_, module, exports) { + 'use strict'; + var $forEach = _dereq_('../internals/array-iteration').forEach; + var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var STRICT_METHOD = arrayMethodIsStrict('forEach'); + var USES_TO_LENGTH = arrayMethodUsesToLength('forEach'); + // `Array.prototype.forEach` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + module.exports = !STRICT_METHOD || !USES_TO_LENGTH ? function forEach(callbackfn /* , thisArg */ ) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + : [ + ].forEach; + }, + { + '../internals/array-iteration': 37, + '../internals/array-method-is-strict': 40, + '../internals/array-method-uses-to-length': 41 + } + ], + 35: [ + function (_dereq_, module, exports) { + 'use strict'; + var bind = _dereq_('../internals/function-bind-context'); + var toObject = _dereq_('../internals/to-object'); + var callWithSafeIterationClosing = _dereq_('../internals/call-with-safe-iteration-closing'); + var isArrayIteratorMethod = _dereq_('../internals/is-array-iterator-method'); + var toLength = _dereq_('../internals/to-length'); + var createProperty = _dereq_('../internals/create-property'); + var getIteratorMethod = _dereq_('../internals/get-iterator-method'); + // `Array.from` method implementation + // https://tc39.github.io/ecma262/#sec-array.from + module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */ ) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var index = 0; + var length, + result, + step, + iterator, + next, + value; + if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = iteratorMethod.call(O); + next = iterator.next; + result = new C(); + for (; !(step = next.call(iterator)).done; index++) { + value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [ + step.value, + index + ], true) : step.value; + createProperty(result, index, value); + } + } else { + length = toLength(O.length); + result = new C(length); + for (; length > index; index++) { + value = mapping ? mapfn(O[index], index) : O[index]; + createProperty(result, index, value); + } + } + result.length = index; + return result; + }; + }, + { + '../internals/call-with-safe-iteration-closing': 44, + '../internals/create-property': 58, + '../internals/function-bind-context': 72, + '../internals/get-iterator-method': 75, + '../internals/is-array-iterator-method': 89, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 36: [ + function (_dereq_, module, exports) { + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var toLength = _dereq_('../internals/to-length'); + var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); + // `Array.prototype.{ indexOf, includes }` methods implementation + var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (; length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } + return !IS_INCLUDES && - 1; + }; + }; + module.exports = { + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) + }; + }, + { + '../internals/to-absolute-index': 150, + '../internals/to-indexed-object': 152, + '../internals/to-length': 154 + } + ], + 37: [ + function (_dereq_, module, exports) { + var bind = _dereq_('../internals/function-bind-context'); + var IndexedObject = _dereq_('../internals/indexed-object'); + var toObject = _dereq_('../internals/to-object'); + var toLength = _dereq_('../internals/to-length'); + var arraySpeciesCreate = _dereq_('../internals/array-species-create'); + var push = [ + ].push; + // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation + var createMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var boundFunction = bind(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var value, + result; + for (; length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: + return true; + // some + case 5: + return value; + // find + case 6: + return index; + // findIndex + case 2: + push.call(target, value); + // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? - 1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; + }; + module.exports = { + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.github.io/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6) + }; + }, + { + '../internals/array-species-create': 43, + '../internals/function-bind-context': 72, + '../internals/indexed-object': 84, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 38: [ + function (_dereq_, module, exports) { + 'use strict'; + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var toInteger = _dereq_('../internals/to-integer'); + var toLength = _dereq_('../internals/to-length'); + var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var min = Math.min; + var nativeLastIndexOf = [ + ].lastIndexOf; + var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [ + 1 + ].lastIndexOf(1, - 0) < 0; + var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); + // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method + var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { + ACCESSORS: true, + 1: 0 + }); + var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH; + // `Array.prototype.lastIndexOf` method implementation + // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof + module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */ ) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0; + var O = toIndexedObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (; index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; + return - 1; + } + : nativeLastIndexOf; + }, + { + '../internals/array-method-is-strict': 40, + '../internals/array-method-uses-to-length': 41, + '../internals/to-indexed-object': 152, + '../internals/to-integer': 153, + '../internals/to-length': 154 + } + ], + 39: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var V8_VERSION = _dereq_('../internals/engine-v8-version'); + var SPECIES = wellKnownSymbol('species'); + module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = [ + ]; + var constructor = array.constructor = { + }; + constructor[SPECIES] = function () { + return { + foo: 1 + }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); + }; + }, + { + '../internals/engine-v8-version': 66, + '../internals/fails': 69, + '../internals/well-known-symbol': 166 + } + ], + 40: [ + function (_dereq_, module, exports) { + 'use strict'; + var fails = _dereq_('../internals/fails'); + module.exports = function (METHOD_NAME, argument) { + var method = [ + ][METHOD_NAME]; + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal + method.call(null, argument || function () { + throw 1; + }, 1); + }); + }; + }, + { + '../internals/fails': 69 + } + ], + 41: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var fails = _dereq_('../internals/fails'); + var has = _dereq_('../internals/has'); + var defineProperty = Object.defineProperty; + var cache = { + }; + var thrower = function (it) { + throw it; + }; + module.exports = function (METHOD_NAME, options) { + if (has(cache, METHOD_NAME)) return cache[METHOD_NAME]; + if (!options) options = { + }; + var method = [ + ][METHOD_NAME]; + var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false; + var argument0 = has(options, 0) ? options[0] : thrower; + var argument1 = has(options, 1) ? options[1] : undefined; + return cache[METHOD_NAME] = !!method && !fails(function () { + if (ACCESSORS && !DESCRIPTORS) return true; + var O = { + length: - 1 + }; + if (ACCESSORS) defineProperty(O, 1, { + enumerable: true, + get: thrower + }); + else O[1] = 1; + method.call(O, argument0, argument1); + }); + }; + }, + { + '../internals/descriptors': 61, + '../internals/fails': 69, + '../internals/has': 78 + } + ], + 42: [ + function (_dereq_, module, exports) { + var aFunction = _dereq_('../internals/a-function'); + var toObject = _dereq_('../internals/to-object'); + var IndexedObject = _dereq_('../internals/indexed-object'); + var toLength = _dereq_('../internals/to-length'); + // `Array.prototype.{ reduce, reduceRight }` methods implementation + var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction(callbackfn); + var O = toObject(that); + var self = IndexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? - 1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; + }; + module.exports = { + // `Array.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright + right: createMethod(true) + }; + }, + { + '../internals/a-function': 23, + '../internals/indexed-object': 84, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 43: [ + function (_dereq_, module, exports) { + var isObject = _dereq_('../internals/is-object'); + var isArray = _dereq_('../internals/is-array'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var SPECIES = wellKnownSymbol('species'); + // `ArraySpeciesCreate` abstract operation + // https://tc39.github.io/ecma262/#sec-arrayspeciescreate + module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } + return new (C === undefined ? Array : C) (length === 0 ? 0 : length); + }; + }, + { + '../internals/is-array': 90, + '../internals/is-object': 92, + '../internals/well-known-symbol': 166 + } + ], + 44: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + // call something on iterator step with safe closing on error + module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value) [0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); + throw error; + } + }; + }, + { + '../internals/an-object': 28 + } + ], + 45: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var ITERATOR = wellKnownSymbol('iterator'); + var SAFE_CLOSING = false; + try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { + done: !!called++ + }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line no-throw-literal + Array.from(iteratorWithReturn, function () { + throw 2; + }); + } catch (error) { /* empty */ + } + module.exports = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + try { + var object = { + }; + object[ITERATOR] = function () { + return { + next: function () { + return { + done: ITERATION_SUPPORT = true + }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ + } + return ITERATION_SUPPORT; + }; + }, + { + '../internals/well-known-symbol': 166 + } + ], + 46: [ + function (_dereq_, module, exports) { + var toString = { + }.toString; + module.exports = function (it) { + return toString.call(it).slice(8, - 1); + }; + }, + { + } + ], + 47: [ + function (_dereq_, module, exports) { + var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support'); + var classofRaw = _dereq_('../internals/classof-raw'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + // ES3 wrong here + var CORRECT_ARGUMENTS = classofRaw(function () { + return arguments; + }()) == 'Arguments'; + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ + } + }; + // getting tag from ES6+ `Object.prototype.toString` + module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { + var O, + tag, + result; + return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case + : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; + }; + }, + { + '../internals/classof-raw': 46, + '../internals/to-string-tag-support': 159, + '../internals/well-known-symbol': 166 + } + ], + 48: [ + function (_dereq_, module, exports) { + 'use strict'; + var defineProperty = _dereq_('../internals/object-define-property').f; + var create = _dereq_('../internals/object-create'); + var redefineAll = _dereq_('../internals/redefine-all'); + var bind = _dereq_('../internals/function-bind-context'); + var anInstance = _dereq_('../internals/an-instance'); + var iterate = _dereq_('../internals/iterate'); + var defineIterator = _dereq_('../internals/define-iterator'); + var setSpecies = _dereq_('../internals/set-species'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var fastKey = _dereq_('../internals/internal-metadata').fastKey; + var InternalStateModule = _dereq_('../internals/internal-state'); + var setInternalState = InternalStateModule.set; + var internalStateGetterFor = InternalStateModule.getterFor; + module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + index: create(null), + first: undefined, + last: undefined, + size: 0 + }); + if (!DESCRIPTORS) that.size = 0; + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + }); + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, + index; + // change existing entry + if (entry) { + entry.value = value; + // create new entry + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: undefined, + removed: false + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (DESCRIPTORS) state.size++; + else that.size++; + // add to index + if (index !== 'F') state.index[index] = entry; + } + return that; + }; + var getEntry = function (that, key) { + var state = getInternalState(that); + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return state.index[index]; + // frozen object case + for (entry = state.first; entry; entry = entry.next) { + if (entry.key == key) return entry; + } + }; + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + var that = this; + var state = getInternalState(that); + var data = state.index; + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) entry.previous = entry.previous.next = undefined; + delete data[entry.index]; + entry = entry.next; + } + state.first = state.last = undefined; + if (DESCRIPTORS) state.size = 0; + else that.size = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first == entry) state.first = next; + if (state.last == entry) state.last = prev; + if (DESCRIPTORS) state.size--; + else that.size--; + } + return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */ ) { + var state = getInternalState(this); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(this, key); + } + }); + redefineAll(C.prototype, IS_MAP ? { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } + : { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (DESCRIPTORS) defineProperty(C.prototype, 'size', { + get: function () { + return getInternalState(this).size; + } + }); + return C; + }, + setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; + var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) { + setInternalState(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined + }); + }, function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + // or finish the iteration + state.target = undefined; + return { + value: undefined, + done: true + }; + } // return step by kind + + if (kind == 'keys') return { + value: entry.key, + done: false + }; + if (kind == 'values') return { + value: entry.value, + done: false + }; + return { + value: [ + entry.key, + entry.value + ], + done: false + }; + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(CONSTRUCTOR_NAME); + } + }; + }, + { + '../internals/an-instance': 27, + '../internals/define-iterator': 59, + '../internals/descriptors': 61, + '../internals/function-bind-context': 72, + '../internals/internal-metadata': 87, + '../internals/internal-state': 88, + '../internals/iterate': 95, + '../internals/object-create': 108, + '../internals/object-define-property': 110, + '../internals/redefine-all': 125, + '../internals/set-species': 134 + } + ], + 49: [ + function (_dereq_, module, exports) { + 'use strict'; + var redefineAll = _dereq_('../internals/redefine-all'); + var getWeakData = _dereq_('../internals/internal-metadata').getWeakData; + var anObject = _dereq_('../internals/an-object'); + var isObject = _dereq_('../internals/is-object'); + var anInstance = _dereq_('../internals/an-instance'); + var iterate = _dereq_('../internals/iterate'); + var ArrayIterationModule = _dereq_('../internals/array-iteration'); + var $has = _dereq_('../internals/has'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var setInternalState = InternalStateModule.set; + var internalStateGetterFor = InternalStateModule.getterFor; + var find = ArrayIterationModule.find; + var findIndex = ArrayIterationModule.findIndex; + var id = 0; + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function (store) { + return store.frozen || (store.frozen = new UncaughtFrozenStore()); + }; + var UncaughtFrozenStore = function () { + this.entries = [ + ]; + }; + var findUncaughtFrozen = function (store, key) { + return find(store.entries, function (it) { + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.entries.push([key, + value]); + }, + 'delete': function (key) { + var index = findIndex(this.entries, function (it) { + return it[0] === key; + }); + if (~index) this.entries.splice(index, 1); + return !!~index; + } + }; + module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + id: id++, + frozen: undefined + }); + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + }); + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + var define = function (that, key, value) { + var state = getInternalState(that); + var data = getWeakData(anObject(key), true); + if (data === true) uncaughtFrozenStore(state).set(key, value); + else data[state.id] = value; + return that; + }; + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state) ['delete'](key); + return data && $has(data, state.id) && delete data[state.id]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).has(key); + return data && $has(data, state.id); + } + }); + redefineAll(C.prototype, IS_MAP ? { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + var state = getInternalState(this); + if (isObject(key)) { + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).get(key); + return data ? data[state.id] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return define(this, key, value); + } + } + : { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return define(this, value, true); + } + }); + return C; + } + }; + }, + { + '../internals/an-instance': 27, + '../internals/an-object': 28, + '../internals/array-iteration': 37, + '../internals/has': 78, + '../internals/internal-metadata': 87, + '../internals/internal-state': 88, + '../internals/is-object': 92, + '../internals/iterate': 95, + '../internals/redefine-all': 125 + } + ], + 50: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var global = _dereq_('../internals/global'); + var isForced = _dereq_('../internals/is-forced'); + var redefine = _dereq_('../internals/redefine'); + var InternalMetadataModule = _dereq_('../internals/internal-metadata'); + var iterate = _dereq_('../internals/iterate'); + var anInstance = _dereq_('../internals/an-instance'); + var isObject = _dereq_('../internals/is-object'); + var fails = _dereq_('../internals/fails'); + var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var inheritIfRequired = _dereq_('../internals/inherit-if-required'); + module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== - 1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== - 1; + var ADDER = IS_MAP ? 'set' : 'add'; + var NativeConstructor = global[CONSTRUCTOR_NAME]; + var NativePrototype = NativeConstructor && NativeConstructor.prototype; + var Constructor = NativeConstructor; + var exported = { + }; + var fixMethod = function (KEY) { + var nativeMethod = NativePrototype[KEY]; + redefine(NativePrototype, KEY, KEY == 'add' ? function add(value) { + nativeMethod.call(this, value === 0 ? 0 : value); + return this; + } + : KEY == 'delete' ? function (key) { + return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); + } + : KEY == 'get' ? function get(key) { + return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); + } + : KEY == 'has' ? function has(key) { + return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); + } + : function set(key, value) { + nativeMethod.call(this, key === 0 ? 0 : key, value); + return this; + }); + }; + // eslint-disable-next-line max-len + if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + })))) { + // create collection constructor + Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); + InternalMetadataModule.REQUIRED = true; + } else if (isForced(CONSTRUCTOR_NAME, true)) { + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? { + } + : - 0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { + instance.has(1); + }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + // eslint-disable-next-line no-new + var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { + new NativeConstructor(iterable); + }); + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new NativeConstructor(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has( - 0); + }); + if (!ACCEPT_ITERABLES) { + Constructor = wrapper(function (dummy, iterable) { + anInstance(dummy, Constructor, CONSTRUCTOR_NAME); + var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + return that; + }); + Constructor.prototype = NativePrototype; + NativePrototype.constructor = Constructor; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; + } + exported[CONSTRUCTOR_NAME] = Constructor; + $({ + global: true, + forced: Constructor != NativeConstructor + }, exported); + setToStringTag(Constructor, CONSTRUCTOR_NAME); + if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + return Constructor; + }; + }, + { + '../internals/an-instance': 27, + '../internals/check-correctness-of-iteration': 45, + '../internals/export': 68, + '../internals/fails': 69, + '../internals/global': 77, + '../internals/inherit-if-required': 85, + '../internals/internal-metadata': 87, + '../internals/is-forced': 91, + '../internals/is-object': 92, + '../internals/iterate': 95, + '../internals/redefine': 126, + '../internals/set-to-string-tag': 135 + } + ], + 51: [ + function (_dereq_, module, exports) { + var has = _dereq_('../internals/has'); + var ownKeys = _dereq_('../internals/own-keys'); + var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + module.exports = function (target, source) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } + }; + }, + { + '../internals/has': 78, + '../internals/object-define-property': 110, + '../internals/object-get-own-property-descriptor': 111, + '../internals/own-keys': 121 + } + ], + 52: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var MATCH = wellKnownSymbol('match'); + module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + '/./'[METHOD_NAME](regexp); + } catch (e) { + try { + regexp[MATCH] = false; + return '/./'[METHOD_NAME](regexp); + } catch (f) { /* empty */ + } + } + return false; + }; + }, + { + '../internals/well-known-symbol': 166 + } + ], + 53: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + module.exports = !fails(function () { + function F() { /* empty */ + } + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; + }); + }, + { + '../internals/fails': 69 + } + ], + 54: [ + function (_dereq_, module, exports) { + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var quot = /"/g; + // B.2.3.2.1 CreateHTML(string, tag, attribute, value) + // https://tc39.github.io/ecma262/#sec-createhtml + module.exports = function (string, tag, attribute, value) { + var S = String(requireObjectCoercible(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; + }; + }, + { + '../internals/require-object-coercible': 131 + } + ], + 55: [ + function (_dereq_, module, exports) { + 'use strict'; + var IteratorPrototype = _dereq_('../internals/iterators-core').IteratorPrototype; + var create = _dereq_('../internals/object-create'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var Iterators = _dereq_('../internals/iterators'); + var returnThis = function () { + return this; + }; + module.exports = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = create(IteratorPrototype, { + next: createPropertyDescriptor(1, next) + }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; + }; + }, + { + '../internals/create-property-descriptor': 57, + '../internals/iterators': 97, + '../internals/iterators-core': 96, + '../internals/object-create': 108, + '../internals/set-to-string-tag': 135 + } + ], + 56: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); + } + : function (object, key, value) { + object[key] = value; + return object; + }; + }, + { + '../internals/create-property-descriptor': 57, + '../internals/descriptors': 61, + '../internals/object-define-property': 110 + } + ], + 57: [ + function (_dereq_, module, exports) { + module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + }, + { + } + ], + 58: [ + function (_dereq_, module, exports) { + 'use strict'; + var toPrimitive = _dereq_('../internals/to-primitive'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; + }; + }, + { + '../internals/create-property-descriptor': 57, + '../internals/object-define-property': 110, + '../internals/to-primitive': 158 + } + ], + 59: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var createIteratorConstructor = _dereq_('../internals/create-iterator-constructor'); + var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); + var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var redefine = _dereq_('../internals/redefine'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var IS_PURE = _dereq_('../internals/is-pure'); + var Iterators = _dereq_('../internals/iterators'); + var IteratorsCore = _dereq_('../internals/iterators-core'); + var IteratorPrototype = IteratorsCore.IteratorPrototype; + var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; + var ITERATOR = wellKnownSymbol('iterator'); + var KEYS = 'keys'; + var VALUES = 'values'; + var ENTRIES = 'entries'; + var returnThis = function () { + return this; + }; + module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; + switch (KIND) { + case KEYS: + return function keys() { + return new IteratorConstructor(this, KIND); + }; + case VALUES: + return function values() { + return new IteratorConstructor(this, KIND); + }; + case ENTRIES: + return function entries() { + return new IteratorConstructor(this, KIND); + }; + } + return function () { + return new IteratorConstructor(this); + }; + }; + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, + methods, + KEY; + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); + if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { + if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { + createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); + } + } // Set @@toStringTag to native iterators + + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } // fix Array#{values, @@iterator}.name in V8 / FF + + if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { + return nativeIterator.call(this); + }; + } // define iterator + + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); + } + Iterators[NAME] = defaultIterator; + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } else $({ + target: NAME, + proto: true, + forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME + }, methods); + } + return methods; + }; + }, + { + '../internals/create-iterator-constructor': 55, + '../internals/create-non-enumerable-property': 56, + '../internals/export': 68, + '../internals/is-pure': 93, + '../internals/iterators': 97, + '../internals/iterators-core': 96, + '../internals/object-get-prototype-of': 115, + '../internals/object-set-prototype-of': 119, + '../internals/redefine': 126, + '../internals/set-to-string-tag': 135, + '../internals/well-known-symbol': 166 + } + ], + 60: [ + function (_dereq_, module, exports) { + var path = _dereq_('../internals/path'); + var has = _dereq_('../internals/has'); + var wrappedWellKnownSymbolModule = _dereq_('../internals/well-known-symbol-wrapped'); + var defineProperty = _dereq_('../internals/object-define-property').f; + module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = { + }); + if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); + }; + }, + { + '../internals/has': 78, + '../internals/object-define-property': 110, + '../internals/path': 122, + '../internals/well-known-symbol-wrapped': 165 + } + ], + 61: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + // Thank's IE8 for his funny defineProperty + module.exports = !fails(function () { + return Object.defineProperty({ + }, 1, { + get: function () { + return 7; + } + }) [1] != 7; + }); + }, + { + '../internals/fails': 69 + } + ], + 62: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var isObject = _dereq_('../internals/is-object'); + var document = global.document; + // typeof document.createElement is 'object' in old IE + var EXISTS = isObject(document) && isObject(document.createElement); + module.exports = function (it) { + return EXISTS ? document.createElement(it) : { + }; + }; + }, + { + '../internals/global': 77, + '../internals/is-object': 92 + } + ], + 63: [ + function (_dereq_, module, exports) { + // iterable DOM collections + // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods + module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 + }; + }, + { + } + ], + 64: [ + function (_dereq_, module, exports) { + var userAgent = _dereq_('../internals/engine-user-agent'); + module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent); + }, + { + '../internals/engine-user-agent': 65 + } + ], + 65: [ + function (_dereq_, module, exports) { + var getBuiltIn = _dereq_('../internals/get-built-in'); + module.exports = getBuiltIn('navigator', 'userAgent') || ''; + }, + { + '../internals/get-built-in': 74 + } + ], + 66: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var userAgent = _dereq_('../internals/engine-user-agent'); + var process = global.process; + var versions = process && process.versions; + var v8 = versions && versions.v8; + var match, + version; + if (v8) { + match = v8.split('.'); + version = match[0] + match[1]; + } else if (userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = match[1]; + } + } + module.exports = version && + version; + }, + { + '../internals/engine-user-agent': 65, + '../internals/global': 77 + } + ], + 67: [ + function (_dereq_, module, exports) { + // IE8- don't enum bug keys + module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' + ]; + }, + { + } + ], + 68: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var redefine = _dereq_('../internals/redefine'); + var setGlobal = _dereq_('../internals/set-global'); + var copyConstructorProperties = _dereq_('../internals/copy-constructor-properties'); + var isForced = _dereq_('../internals/is-forced'); + /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target @@ -21776,112964 +20078,101424 @@ options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ - module.exports = function (options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global; - } else if (STATIC) { - target = global[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global[TARGET] || {}).prototype; - } - if (target) - for (key in source) { - sourceProperty = source[key]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key); - targetProperty = descriptor && descriptor.value; - } else targetProperty = target[key]; - FORCED = isForced( - GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, - options.forced, - ); - // contained in target - if (!FORCED && targetProperty !== undefined) { - if (typeof sourceProperty === typeof targetProperty) continue; - copyConstructorProperties(sourceProperty, targetProperty); - } // add a flag to not completely full polyfills - - if (options.sham || (targetProperty && targetProperty.sham)) { - createNonEnumerableProperty(sourceProperty, "sham", true); - } // extend global - - redefine(target, key, sourceProperty, options); - } - }; - }, - { - "../internals/copy-constructor-properties": 51, - "../internals/create-non-enumerable-property": 56, - "../internals/global": 77, - "../internals/is-forced": 91, - "../internals/object-get-own-property-descriptor": 111, - "../internals/redefine": 126, - "../internals/set-global": 133, - }, - ], - 69: [ - function (_dereq_, module, exports) { - module.exports = function (exec) { - try { - return !!exec(); - } catch (error) { - return true; - } - }; - }, - {}, - ], - 70: [ - function (_dereq_, module, exports) { - "use strict"; - // TODO: Remove from `core-js@4` since it's moved to entry points - _dereq_("../modules/es.regexp.exec"); - var redefine = _dereq_("../internals/redefine"); - var fails = _dereq_("../internals/fails"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var regexpExec = _dereq_("../internals/regexp-exec"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var SPECIES = wellKnownSymbol("species"); - var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = []; - result.groups = { - a: "7", - }; - return result; - }; - return "".replace(re, "$") !== "7"; - }); - // IE <= 11 replaces $0 with the whole match, as if it was $& - // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 - var REPLACE_KEEPS_$0 = (function () { - return "a".replace(/./, "$0") === "$0"; - })(); - var REPLACE = wellKnownSymbol("replace"); - // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string - var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { - if (/./[REPLACE]) { - return /./[REPLACE]("a", "$0") === ""; - } - return false; - })(); - // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec - // Weex JS has frozen built-in prototypes, so use try / catch wrapper - var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { - return originalExec.apply(this, arguments); - }; - var result = "ab".split(re); - return ( - result.length !== 2 || result[0] !== "a" || result[1] !== "b" - ); - }); - module.exports = function (KEY, length, exec, sham) { - var SYMBOL = wellKnownSymbol(KEY); - var DELEGATES_TO_SYMBOL = !fails(function () { - // String methods call symbol-named RegEp methods - var O = {}; - O[SYMBOL] = function () { - return 7; - }; - return ""[KEY](O) != 7; - }); - var DELEGATES_TO_EXEC = - DELEGATES_TO_SYMBOL && - !fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; - if (KEY === "split") { - // We can't use real regex here since it causes deoptimization - // and serious performance degradation in V8 - // https://github.com/zloirock/core-js/issues/306 - re = {}; - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES] = function () { - return re; - }; - re.flags = ""; - re[SYMBOL] = /./[SYMBOL]; - } - re.exec = function () { - execCalled = true; - return null; - }; - re[SYMBOL](""); - return !execCalled; - }); - if ( - !DELEGATES_TO_SYMBOL || - !DELEGATES_TO_EXEC || - (KEY === "replace" && - !( - REPLACE_SUPPORTS_NAMED_GROUPS && - REPLACE_KEEPS_$0 && - !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE - )) || - (KEY === "split" && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) - ) { - var nativeRegExpMethod = /./[SYMBOL]; - var methods = exec( - SYMBOL, - ""[KEY], - function (nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { - done: true, - value: nativeRegExpMethod.call(regexp, str, arg2), - }; - } - return { - done: true, - value: nativeMethod.call(str, regexp, arg2), - }; - } - return { - done: false, - }; - }, - { - REPLACE_KEEPS_$0: REPLACE_KEEPS_$0, - REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: - REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE, - }, - ); - var stringMethod = methods[0]; - var regexMethod = methods[1]; - redefine(String.prototype, KEY, stringMethod); - redefine( - RegExp.prototype, - SYMBOL, - length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - ? // 21.2.5.11 RegExp.prototype[@@split](string, limit) - function (string, arg) { - return regexMethod.call(string, this, arg); - } // 21.2.5.6 RegExp.prototype[@@match](string) - : // 21.2.5.9 RegExp.prototype[@@search](string) - - function (string) { - return regexMethod.call(string, this); - }, - ); - } - if (sham) - createNonEnumerableProperty( - RegExp.prototype[SYMBOL], - "sham", - true, - ); - }; - }, - { - "../internals/create-non-enumerable-property": 56, - "../internals/fails": 69, - "../internals/redefine": 126, - "../internals/regexp-exec": 128, - "../internals/well-known-symbol": 166, - "../modules/es.regexp.exec": 205, - }, - ], - 71: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - module.exports = !fails(function () { - return Object.isExtensible(Object.preventExtensions({})); - }); - }, - { - "../internals/fails": 69, - }, - ], - 72: [ - function (_dereq_, module, exports) { - var aFunction = _dereq_("../internals/a-function"); - // optional / simple context binding - module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 0: - return function () { - return fn.call(that); - }; - case 1: - return function (a) { - return fn.call(that, a); - }; - case 2: - return function (a, b) { - return fn.call(that, a, b); - }; - case 3: - return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function () /* ...args */ - { - return fn.apply(that, arguments); - }; - }; - }, - { - "../internals/a-function": 23, - }, - ], - 73: [ - function (_dereq_, module, exports) { - "use strict"; - var aFunction = _dereq_("../internals/a-function"); - var isObject = _dereq_("../internals/is-object"); - var slice = [].slice; - var factories = {}; - var construct = function (C, argsLength, args) { - if (!(argsLength in factories)) { - for (var list = [], i = 0; i < argsLength; i++) - list[i] = "a[" + i + "]"; - // eslint-disable-next-line no-new-func - factories[argsLength] = Function( - "C,a", - "return new C(" + list.join(",") + ")", - ); - } - return factories[argsLength](C, args); - }; - // `Function.prototype.bind` method implementation - // https://tc39.github.io/ecma262/#sec-function.prototype.bind - module.exports = - Function.bind || - function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = slice.call(arguments, 1); - var boundFunction = function bound /* args... */() { - var args = partArgs.concat(slice.call(arguments)); - return this instanceof boundFunction - ? construct(fn, args.length, args) - : fn.apply(that, args); - }; - if (isObject(fn.prototype)) - boundFunction.prototype = fn.prototype; - return boundFunction; - }; - }, - { - "../internals/a-function": 23, - "../internals/is-object": 92, - }, - ], - 74: [ - function (_dereq_, module, exports) { - var path = _dereq_("../internals/path"); - var global = _dereq_("../internals/global"); - var aFunction = function (variable) { - return typeof variable == "function" ? variable : undefined; - }; - module.exports = function (namespace, method) { - return arguments.length < 2 - ? aFunction(path[namespace]) || aFunction(global[namespace]) - : (path[namespace] && path[namespace][method]) || - (global[namespace] && global[namespace][method]); - }; - }, - { - "../internals/global": 77, - "../internals/path": 122, - }, - ], - 75: [ - function (_dereq_, module, exports) { - var classof = _dereq_("../internals/classof"); - var Iterators = _dereq_("../internals/iterators"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var ITERATOR = wellKnownSymbol("iterator"); - module.exports = function (it) { - if (it != undefined) - return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; - }; - }, - { - "../internals/classof": 47, - "../internals/iterators": 97, - "../internals/well-known-symbol": 166, - }, - ], - 76: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - var getIteratorMethod = _dereq_("../internals/get-iterator-method"); - module.exports = function (it) { - var iteratorMethod = getIteratorMethod(it); - if (typeof iteratorMethod != "function") { - throw TypeError(String(it) + " is not iterable"); - } - return anObject(iteratorMethod.call(it)); - }; - }, - { - "../internals/an-object": 28, - "../internals/get-iterator-method": 75, - }, - ], - 77: [ - function (_dereq_, module, exports) { - (function (global) { - var check = function (it) { - return it && it.Math == Math && it; - }; - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - module.exports = // eslint-disable-next-line no-undef - check(typeof globalThis == "object" && globalThis) || - check(typeof window == "object" && window) || - check(typeof self == "object" && self) || - check(typeof global == "object" && global) || // eslint-disable-next-line no-new-func - Function("return this")(); - }).call( - this, - typeof global !== "undefined" - ? global - : typeof self !== "undefined" - ? self - : typeof window !== "undefined" - ? window - : {}, - ); - }, - {}, - ], - 78: [ - function (_dereq_, module, exports) { - var hasOwnProperty = {}.hasOwnProperty; - module.exports = function (it, key) { - return hasOwnProperty.call(it, key); - }; - }, - {}, - ], - 79: [ - function (_dereq_, module, exports) { - module.exports = {}; - }, - {}, - ], - 80: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - module.exports = function (a, b) { - var console = global.console; - if (console && console.error) { - arguments.length === 1 ? console.error(a) : console.error(a, b); - } - }; - }, - { - "../internals/global": 77, - }, - ], - 81: [ - function (_dereq_, module, exports) { - var getBuiltIn = _dereq_("../internals/get-built-in"); - module.exports = getBuiltIn("document", "documentElement"); - }, - { - "../internals/get-built-in": 74, - }, - ], - 82: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var fails = _dereq_("../internals/fails"); - var createElement = _dereq_("../internals/document-create-element"); - // Thank's IE8 for his funny defineProperty - module.exports = - !DESCRIPTORS && - !fails(function () { - return ( - Object.defineProperty(createElement("div"), "a", { - get: function () { - return 7; - }, - }).a != 7 - ); - }); - }, - { - "../internals/descriptors": 61, - "../internals/document-create-element": 62, - "../internals/fails": 69, - }, - ], - 83: [ - function (_dereq_, module, exports) { - // IEEE754 conversions based on https://github.com/feross/ieee754 - // eslint-disable-next-line no-shadow-restricted-names - var Infinity = 1 / 0; - var abs = Math.abs; - var pow = Math.pow; - var floor = Math.floor; - var log = Math.log; - var LN2 = Math.LN2; - var pack = function (number, mantissaLength, bytes) { - var buffer = new Array(bytes); - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; - var sign = number < 0 || (number === 0 && 1 / number < 0) ? 1 : 0; - var index = 0; - var exponent, mantissa, c; - number = abs(number); - // eslint-disable-next-line no-self-compare - if (number != number || number === Infinity) { - // eslint-disable-next-line no-self-compare - mantissa = number != number ? 1 : 0; - exponent = eMax; - } else { - exponent = floor(log(number) / LN2); - if (number * (c = pow(2, -exponent)) < 1) { - exponent--; - c *= 2; - } - if (exponent + eBias >= 1) { - number += rt / c; - } else { - number += rt * pow(2, 1 - eBias); - } - if (number * c >= 2) { - exponent++; - c /= 2; - } - if (exponent + eBias >= eMax) { - mantissa = 0; - exponent = eMax; - } else if (exponent + eBias >= 1) { - mantissa = (number * c - 1) * pow(2, mantissaLength); - exponent = exponent + eBias; - } else { - mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); - exponent = 0; - } - } - for ( - ; - mantissaLength >= 8; - buffer[index++] = mantissa & 255, - mantissa /= 256, - mantissaLength -= 8 - ); - exponent = (exponent << mantissaLength) | mantissa; - exponentLength += mantissaLength; - for ( - ; - exponentLength > 0; - buffer[index++] = exponent & 255, - exponent /= 256, - exponentLength -= 8 - ); - buffer[--index] |= sign * 128; - return buffer; - }; - var unpack = function (buffer, mantissaLength) { - var bytes = buffer.length; - var exponentLength = bytes * 8 - mantissaLength - 1; - var eMax = (1 << exponentLength) - 1; - var eBias = eMax >> 1; - var nBits = exponentLength - 7; - var index = bytes - 1; - var sign = buffer[index--]; - var exponent = sign & 127; - var mantissa; - sign >>= 7; - for ( - ; - nBits > 0; - exponent = exponent * 256 + buffer[index], index--, nBits -= 8 - ); - mantissa = exponent & ((1 << -nBits) - 1); - exponent >>= -nBits; - nBits += mantissaLength; - for ( - ; - nBits > 0; - mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8 - ); - if (exponent === 0) { - exponent = 1 - eBias; - } else if (exponent === eMax) { - return mantissa ? NaN : sign ? -Infinity : Infinity; - } else { - mantissa = mantissa + pow(2, mantissaLength); - exponent = exponent - eBias; - } - return ( - (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength) - ); - }; - module.exports = { - pack: pack, - unpack: unpack, - }; - }, - {}, - ], - 84: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - var classof = _dereq_("../internals/classof-raw"); - var split = "".split; - // fallback for non-array-like ES3 and non-enumerable old V8 strings - module.exports = fails(function () { - // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 - // eslint-disable-next-line no-prototype-builtins - return !Object("z").propertyIsEnumerable(0); - }) - ? function (it) { - return classof(it) == "String" - ? split.call(it, "") - : Object(it); - } - : Object; - }, - { - "../internals/classof-raw": 46, - "../internals/fails": 69, - }, - ], - 85: [ - function (_dereq_, module, exports) { - var isObject = _dereq_("../internals/is-object"); - var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); - // makes subclassing work correct for wrapped built-ins - module.exports = function ($this, dummy, Wrapper) { - var NewTarget, NewTargetPrototype; - if ( - // it can work only with native `setPrototypeOf` - setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this - typeof (NewTarget = dummy.constructor) == "function" && - NewTarget !== Wrapper && - isObject((NewTargetPrototype = NewTarget.prototype)) && - NewTargetPrototype !== Wrapper.prototype - ) - setPrototypeOf($this, NewTargetPrototype); - return $this; - }; - }, - { - "../internals/is-object": 92, - "../internals/object-set-prototype-of": 119, - }, - ], - 86: [ - function (_dereq_, module, exports) { - var store = _dereq_("../internals/shared-store"); - var functionToString = Function.toString; - // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper - if (typeof store.inspectSource != "function") { - store.inspectSource = function (it) { - return functionToString.call(it); - }; - } - module.exports = store.inspectSource; - }, - { - "../internals/shared-store": 137, - }, - ], - 87: [ - function (_dereq_, module, exports) { - var hiddenKeys = _dereq_("../internals/hidden-keys"); - var isObject = _dereq_("../internals/is-object"); - var has = _dereq_("../internals/has"); - var defineProperty = _dereq_("../internals/object-define-property").f; - var uid = _dereq_("../internals/uid"); - var FREEZING = _dereq_("../internals/freezing"); - var METADATA = uid("meta"); - var id = 0; - var isExtensible = - Object.isExtensible || - function () { - return true; - }; - var setMetadata = function (it) { - defineProperty(it, METADATA, { - value: { - objectID: "O" + ++id, - // object ID - weakData: {}, // weak collections IDs - }, - }); - }; - var fastKey = function (it, create) { - // return a primitive with prefix - if (!isObject(it)) - return typeof it == "symbol" - ? it - : (typeof it == "string" ? "S" : "P") + it; - if (!has(it, METADATA)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return "F"; - // not necessary to add metadata - if (!create) return "E"; - // add missing metadata - setMetadata(it); - // return object ID - } - return it[METADATA].objectID; - }; - var getWeakData = function (it, create) { - if (!has(it, METADATA)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMetadata(it); - // return the store of weak collections IDs - } - return it[METADATA].weakData; - }; - // add metadata on freeze-family methods calling - var onFreeze = function (it) { - if ( - FREEZING && - meta.REQUIRED && - isExtensible(it) && - !has(it, METADATA) - ) - setMetadata(it); - return it; - }; - var meta = (module.exports = { - REQUIRED: false, - fastKey: fastKey, - getWeakData: getWeakData, - onFreeze: onFreeze, - }); - hiddenKeys[METADATA] = true; - }, - { - "../internals/freezing": 71, - "../internals/has": 78, - "../internals/hidden-keys": 79, - "../internals/is-object": 92, - "../internals/object-define-property": 110, - "../internals/uid": 163, - }, - ], - 88: [ - function (_dereq_, module, exports) { - var NATIVE_WEAK_MAP = _dereq_("../internals/native-weak-map"); - var global = _dereq_("../internals/global"); - var isObject = _dereq_("../internals/is-object"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var objectHas = _dereq_("../internals/has"); - var sharedKey = _dereq_("../internals/shared-key"); - var hiddenKeys = _dereq_("../internals/hidden-keys"); - var WeakMap = global.WeakMap; - var set, get, has; - var enforce = function (it) { - return has(it) ? get(it) : set(it, {}); - }; - var getterFor = function (TYPE) { - return function (it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError("Incompatible receiver, " + TYPE + " required"); - } - return state; - }; - }; - if (NATIVE_WEAK_MAP) { - var store = new WeakMap(); - var wmget = store.get; - var wmhas = store.has; - var wmset = store.set; - set = function (it, metadata) { - wmset.call(store, it, metadata); - return metadata; - }; - get = function (it) { - return wmget.call(store, it) || {}; - }; - has = function (it) { - return wmhas.call(store, it); - }; - } else { - var STATE = sharedKey("state"); - hiddenKeys[STATE] = true; - set = function (it, metadata) { - createNonEnumerableProperty(it, STATE, metadata); - return metadata; - }; - get = function (it) { - return objectHas(it, STATE) ? it[STATE] : {}; - }; - has = function (it) { - return objectHas(it, STATE); - }; - } - module.exports = { - set: set, - get: get, - has: has, - enforce: enforce, - getterFor: getterFor, - }; - }, - { - "../internals/create-non-enumerable-property": 56, - "../internals/global": 77, - "../internals/has": 78, - "../internals/hidden-keys": 79, - "../internals/is-object": 92, - "../internals/native-weak-map": 103, - "../internals/shared-key": 136, - }, - ], - 89: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var Iterators = _dereq_("../internals/iterators"); - var ITERATOR = wellKnownSymbol("iterator"); - var ArrayPrototype = Array.prototype; - // check on default Array iterator - module.exports = function (it) { - return ( - it !== undefined && - (Iterators.Array === it || ArrayPrototype[ITERATOR] === it) - ); - }; - }, - { - "../internals/iterators": 97, - "../internals/well-known-symbol": 166, - }, - ], - 90: [ - function (_dereq_, module, exports) { - var classof = _dereq_("../internals/classof-raw"); - // `IsArray` abstract operation - // https://tc39.github.io/ecma262/#sec-isarray - module.exports = - Array.isArray || - function isArray(arg) { - return classof(arg) == "Array"; - }; - }, - { - "../internals/classof-raw": 46, - }, - ], - 91: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - var replacement = /#|\.prototype\./; - var isForced = function (feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL - ? true - : value == NATIVE - ? false - : typeof detection == "function" - ? fails(detection) - : !!detection; - }; - var normalize = (isForced.normalize = function (string) { - return String(string).replace(replacement, ".").toLowerCase(); - }); - var data = (isForced.data = {}); - var NATIVE = (isForced.NATIVE = "N"); - var POLYFILL = (isForced.POLYFILL = "P"); - module.exports = isForced; - }, - { - "../internals/fails": 69, - }, - ], - 92: [ - function (_dereq_, module, exports) { - module.exports = function (it) { - return typeof it === "object" - ? it !== null - : typeof it === "function"; - }; - }, - {}, - ], - 93: [ - function (_dereq_, module, exports) { - module.exports = false; - }, - {}, - ], - 94: [ - function (_dereq_, module, exports) { - var isObject = _dereq_("../internals/is-object"); - var classof = _dereq_("../internals/classof-raw"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var MATCH = wellKnownSymbol("match"); - // `IsRegExp` abstract operation - // https://tc39.github.io/ecma262/#sec-isregexp - module.exports = function (it) { - var isRegExp; - return ( - isObject(it) && - ((isRegExp = it[MATCH]) !== undefined - ? !!isRegExp - : classof(it) == "RegExp") - ); - }; - }, - { - "../internals/classof-raw": 46, - "../internals/is-object": 92, - "../internals/well-known-symbol": 166, - }, - ], - 95: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - var isArrayIteratorMethod = _dereq_( - "../internals/is-array-iterator-method", - ); - var toLength = _dereq_("../internals/to-length"); - var bind = _dereq_("../internals/function-bind-context"); - var getIteratorMethod = _dereq_("../internals/get-iterator-method"); - var callWithSafeIterationClosing = _dereq_( - "../internals/call-with-safe-iteration-closing", - ); - var Result = function (stopped, result) { - this.stopped = stopped; - this.result = result; - }; - var iterate = (module.exports = function ( - iterable, - fn, - that, - AS_ENTRIES, - IS_ITERATOR, - ) { - var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1); - var iterator, iterFn, index, length, result, next, step; - if (IS_ITERATOR) { - iterator = iterable; - } else { - iterFn = getIteratorMethod(iterable); - if (typeof iterFn != "function") - throw TypeError("Target is not iterable"); - // optimisation for array iterators - if (isArrayIteratorMethod(iterFn)) { - for ( - index = 0, length = toLength(iterable.length); - length > index; - index++ - ) { - result = AS_ENTRIES - ? boundFunction( - anObject((step = iterable[index]))[0], - step[1], - ) - : boundFunction(iterable[index]); - if (result && result instanceof Result) return result; - } - return new Result(false); - } - iterator = iterFn.call(iterable); - } - next = iterator.next; - while (!(step = next.call(iterator)).done) { - result = callWithSafeIterationClosing( - iterator, - boundFunction, - step.value, - AS_ENTRIES, - ); - if ( - typeof result == "object" && - result && - result instanceof Result - ) - return result; - } - return new Result(false); - }); - iterate.stop = function (result) { - return new Result(true, result); - }; - }, - { - "../internals/an-object": 28, - "../internals/call-with-safe-iteration-closing": 44, - "../internals/function-bind-context": 72, - "../internals/get-iterator-method": 75, - "../internals/is-array-iterator-method": 89, - "../internals/to-length": 154, - }, - ], - 96: [ - function (_dereq_, module, exports) { - "use strict"; - var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var has = _dereq_("../internals/has"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var IS_PURE = _dereq_("../internals/is-pure"); - var ITERATOR = wellKnownSymbol("iterator"); - var BUGGY_SAFARI_ITERATORS = false; - var returnThis = function () { - return this; - }; - // `%IteratorPrototype%` object - // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object - var IteratorPrototype, - PrototypeOfArrayIteratorPrototype, - arrayIterator; - if ([].keys) { - arrayIterator = [].keys(); - // Safari 8 has buggy iterators w/o `next` - if (!("next" in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf( - getPrototypeOf(arrayIterator), - ); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) - IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } - } - if (IteratorPrototype == undefined) IteratorPrototype = {}; - // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() - if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { - createNonEnumerableProperty( - IteratorPrototype, - ITERATOR, - returnThis, - ); - } - module.exports = { - IteratorPrototype: IteratorPrototype, - BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS, - }; - }, - { - "../internals/create-non-enumerable-property": 56, - "../internals/has": 78, - "../internals/is-pure": 93, - "../internals/object-get-prototype-of": 115, - "../internals/well-known-symbol": 166, - }, - ], - 97: [ - function (_dereq_, module, exports) { - module.exports = {}; - }, - {}, - ], - 98: [ - function (_dereq_, module, exports) { - // `Math.sign` method implementation - // https://tc39.github.io/ecma262/#sec-math.sign - module.exports = - Math.sign || - function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; - }; - }, - {}, - ], - 99: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var getOwnPropertyDescriptor = _dereq_( - "../internals/object-get-own-property-descriptor", - ).f; - var classof = _dereq_("../internals/classof-raw"); - var macrotask = _dereq_("../internals/task").set; - var IS_IOS = _dereq_("../internals/engine-is-ios"); - var MutationObserver = - global.MutationObserver || global.WebKitMutationObserver; - var process = global.process; - var Promise = global.Promise; - var IS_NODE = classof(process) == "process"; - // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` - var queueMicrotaskDescriptor = getOwnPropertyDescriptor( - global, - "queueMicrotask", - ); - var queueMicrotask = - queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; - var flush, head, last, notify, toggle, node, promise, then; - // modern engines have queueMicrotask method - if (!queueMicrotask) { - flush = function () { - var parent, fn; - if (IS_NODE && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (error) { - if (head) notify(); - else last = undefined; - throw error; - } - } - last = undefined; - if (parent) parent.enter(); - }; - // Node.js - if (IS_NODE) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 - } else if (MutationObserver && !IS_IOS) { - toggle = true; - node = document.createTextNode(""); - new MutationObserver(flush).observe(node, { - characterData: true, - }); - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - promise = Promise.resolve(undefined); - then = promise.then; - notify = function () { - then.call(promise, flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - } - module.exports = - queueMicrotask || - function (fn) { - var task = { - fn: fn, - next: undefined, - }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } - last = task; - }; - }, - { - "../internals/classof-raw": 46, - "../internals/engine-is-ios": 64, - "../internals/global": 77, - "../internals/object-get-own-property-descriptor": 111, - "../internals/task": 148, - }, - ], - 100: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - module.exports = global.Promise; - }, - { - "../internals/global": 77, - }, - ], - 101: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - module.exports = - !!Object.getOwnPropertySymbols && - !fails(function () { - // Chrome 38 Symbol has incorrect toString conversion - // eslint-disable-next-line no-undef - return !String(Symbol()); - }); - }, - { - "../internals/fails": 69, - }, - ], - 102: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var IS_PURE = _dereq_("../internals/is-pure"); - var ITERATOR = wellKnownSymbol("iterator"); - module.exports = !fails(function () { - var url = new URL("b?a=1&b=2&c=3", "http://a"); - var searchParams = url.searchParams; - var result = ""; - url.pathname = "c%20d"; - searchParams.forEach(function (value, key) { - searchParams["delete"]("b"); - result += key + value; - }); - return ( - (IS_PURE && !url.toJSON) || - !searchParams.sort || - url.href !== "http://a/c%20d?a=1&c=3" || - searchParams.get("c") !== "3" || - String(new URLSearchParams("?a=1")) !== "a=1" || - !searchParams[ITERATOR] || // throws in Edge - new URL("https://a@b").username !== "a" || - new URLSearchParams(new URLSearchParams("a=b")).get("a") !== - "b" || // not punycoded in Edge - new URL("http://тест").host !== "xn--e1aybc" || // not escaped in Chrome 62- - new URL("http://a#б").hash !== "#%D0%B1" || // fails in Chrome 66- - result !== "a1c3" || // throws in Safari - new URL("http://x", undefined).host !== "x" - ); - }); - }, - { - "../internals/fails": 69, - "../internals/is-pure": 93, - "../internals/well-known-symbol": 166, - }, - ], - 103: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var inspectSource = _dereq_("../internals/inspect-source"); - var WeakMap = global.WeakMap; - module.exports = - typeof WeakMap === "function" && - /native code/.test(inspectSource(WeakMap)); - }, - { - "../internals/global": 77, - "../internals/inspect-source": 86, - }, - ], - 104: [ - function (_dereq_, module, exports) { - "use strict"; - var aFunction = _dereq_("../internals/a-function"); - var PromiseCapability = function (C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) - throw TypeError("Bad Promise constructor"); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); - }; - // 25.4.1.5 NewPromiseCapability(C) - module.exports.f = function (C) { - return new PromiseCapability(C); - }; - }, - { - "../internals/a-function": 23, - }, - ], - 105: [ - function (_dereq_, module, exports) { - var isRegExp = _dereq_("../internals/is-regexp"); - module.exports = function (it) { - if (isRegExp(it)) { - throw TypeError("The method doesn't accept regular expressions"); - } - return it; - }; - }, - { - "../internals/is-regexp": 94, - }, - ], - 106: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var globalIsFinite = global.isFinite; - // `Number.isFinite` method - // https://tc39.github.io/ecma262/#sec-number.isfinite - module.exports = - Number.isFinite || - function isFinite(it) { - return typeof it == "number" && globalIsFinite(it); - }; - }, - { - "../internals/global": 77, - }, - ], - 107: [ - function (_dereq_, module, exports) { - "use strict"; - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var fails = _dereq_("../internals/fails"); - var objectKeys = _dereq_("../internals/object-keys"); - var getOwnPropertySymbolsModule = _dereq_( - "../internals/object-get-own-property-symbols", - ); - var propertyIsEnumerableModule = _dereq_( - "../internals/object-property-is-enumerable", - ); - var toObject = _dereq_("../internals/to-object"); - var IndexedObject = _dereq_("../internals/indexed-object"); - var nativeAssign = Object.assign; - var defineProperty = Object.defineProperty; - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - module.exports = - !nativeAssign || - fails(function () { - // should have correct order of operations (Edge bug) - if ( - DESCRIPTORS && - nativeAssign( - { - b: 1, - }, - nativeAssign( - defineProperty({}, "a", { - enumerable: true, - get: function () { - defineProperty(this, "b", { - value: 3, - enumerable: false, - }); - }, - }), - { - b: 2, - }, - ), - ).b !== 1 - ) - return true; - // should work with symbols and should have deterministic property order (V8 bug) - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var symbol = Symbol(); - var alphabet = "abcdefghijklmnopqrst"; - A[symbol] = 7; - alphabet.split("").forEach(function (chr) { - B[chr] = chr; - }); - return ( - nativeAssign({}, A)[symbol] != 7 || - objectKeys(nativeAssign({}, B)).join("") != alphabet - ); - }) - ? function assign(target, source) { - // eslint-disable-line no-unused-vars - var T = toObject(target); - var argumentsLength = arguments.length; - var index = 1; - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - var propertyIsEnumerable = propertyIsEnumerableModule.f; - while (argumentsLength > index) { - var S = IndexedObject(arguments[index++]); - var keys = getOwnPropertySymbols - ? objectKeys(S).concat(getOwnPropertySymbols(S)) - : objectKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) - T[key] = S[key]; - } - } - return T; - } - : nativeAssign; - }, - { - "../internals/descriptors": 61, - "../internals/fails": 69, - "../internals/indexed-object": 84, - "../internals/object-get-own-property-symbols": 114, - "../internals/object-keys": 117, - "../internals/object-property-is-enumerable": 118, - "../internals/to-object": 155, - }, - ], - 108: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - var defineProperties = _dereq_( - "../internals/object-define-properties", - ); - var enumBugKeys = _dereq_("../internals/enum-bug-keys"); - var hiddenKeys = _dereq_("../internals/hidden-keys"); - var html = _dereq_("../internals/html"); - var documentCreateElement = _dereq_( - "../internals/document-create-element", - ); - var sharedKey = _dereq_("../internals/shared-key"); - var GT = ">"; - var LT = "<"; - var PROTOTYPE = "prototype"; - var SCRIPT = "script"; - var IE_PROTO = sharedKey("IE_PROTO"); - var EmptyConstructor = function () { - /* empty */ - }; - var scriptTag = function (content) { - return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT; - }; - // Create object with fake `null` prototype: use ActiveX Object with cleared prototype - var NullProtoObjectViaActiveX = function (activeXDocument) { - activeXDocument.write(scriptTag("")); - activeXDocument.close(); - var temp = activeXDocument.parentWindow.Object; - activeXDocument = null; // avoid memory leak - return temp; - }; - // Create object with fake `null` prototype: use iframe Object with cleared prototype - var NullProtoObjectViaIFrame = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = documentCreateElement("iframe"); - var JS = "java" + SCRIPT + ":"; - var iframeDocument; - iframe.style.display = "none"; - html.appendChild(iframe); - // https://github.com/zloirock/core-js/issues/475 - iframe.src = String(JS); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(scriptTag("document.F=Object")); - iframeDocument.close(); - return iframeDocument.F; - }; - // Check for document.domain and active x support - // No need to use active x approach when document.domain is not set - // see https://github.com/es-shims/es5-shim/issues/150 - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 - // avoid IE GC bug - var activeXDocument; - var NullProtoObject = function () { - try { - /* global ActiveXObject */ - activeXDocument = - document.domain && new ActiveXObject("htmlfile"); - } catch (error) { - /* ignore */ - } - NullProtoObject = activeXDocument - ? NullProtoObjectViaActiveX(activeXDocument) - : NullProtoObjectViaIFrame(); - var length = enumBugKeys.length; - while (length--) - delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return NullProtoObject(); - }; - hiddenKeys[IE_PROTO] = true; - // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create - module.exports = - Object.create || - function create(O, Properties) { - var result; - if (O !== null) { - EmptyConstructor[PROTOTYPE] = anObject(O); - result = new EmptyConstructor(); - EmptyConstructor[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = NullProtoObject(); - return Properties === undefined - ? result - : defineProperties(result, Properties); - }; - }, - { - "../internals/an-object": 28, - "../internals/document-create-element": 62, - "../internals/enum-bug-keys": 67, - "../internals/hidden-keys": 79, - "../internals/html": 81, - "../internals/object-define-properties": 109, - "../internals/shared-key": 136, - }, - ], - 109: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var anObject = _dereq_("../internals/an-object"); - var objectKeys = _dereq_("../internals/object-keys"); - // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties - module.exports = DESCRIPTORS - ? Object.defineProperties - : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var index = 0; - var key; - while (length > index) - definePropertyModule.f( - O, - (key = keys[index++]), - Properties[key], - ); - return O; - }; - }, - { - "../internals/an-object": 28, - "../internals/descriptors": 61, - "../internals/object-define-property": 110, - "../internals/object-keys": 117, - }, - ], - 110: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var IE8_DOM_DEFINE = _dereq_("../internals/ie8-dom-define"); - var anObject = _dereq_("../internals/an-object"); - var toPrimitive = _dereq_("../internals/to-primitive"); - var nativeDefineProperty = Object.defineProperty; - // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty - exports.f = DESCRIPTORS - ? nativeDefineProperty - : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) - try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { - /* empty */ - } - if ("get" in Attributes || "set" in Attributes) - throw TypeError("Accessors not supported"); - if ("value" in Attributes) O[P] = Attributes.value; - return O; - }; - }, - { - "../internals/an-object": 28, - "../internals/descriptors": 61, - "../internals/ie8-dom-define": 82, - "../internals/to-primitive": 158, - }, - ], - 111: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var propertyIsEnumerableModule = _dereq_( - "../internals/object-property-is-enumerable", - ); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var toPrimitive = _dereq_("../internals/to-primitive"); - var has = _dereq_("../internals/has"); - var IE8_DOM_DEFINE = _dereq_("../internals/ie8-dom-define"); - var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor - exports.f = DESCRIPTORS - ? nativeGetOwnPropertyDescriptor - : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) - try { - return nativeGetOwnPropertyDescriptor(O, P); - } catch (error) { - /* empty */ - } - if (has(O, P)) - return createPropertyDescriptor( - !propertyIsEnumerableModule.f.call(O, P), - O[P], - ); - }; - }, - { - "../internals/create-property-descriptor": 57, - "../internals/descriptors": 61, - "../internals/has": 78, - "../internals/ie8-dom-define": 82, - "../internals/object-property-is-enumerable": 118, - "../internals/to-indexed-object": 152, - "../internals/to-primitive": 158, - }, - ], - 112: [ - function (_dereq_, module, exports) { - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var nativeGetOwnPropertyNames = _dereq_( - "../internals/object-get-own-property-names", - ).f; - var toString = {}.toString; - var windowNames = - typeof window == "object" && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) - : []; - var getWindowNames = function (it) { - try { - return nativeGetOwnPropertyNames(it); - } catch (error) { - return windowNames.slice(); - } - }; - // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window - module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == "[object Window]" - ? getWindowNames(it) - : nativeGetOwnPropertyNames(toIndexedObject(it)); - }; - }, - { - "../internals/object-get-own-property-names": 113, - "../internals/to-indexed-object": 152, - }, - ], - 113: [ - function (_dereq_, module, exports) { - var internalObjectKeys = _dereq_("../internals/object-keys-internal"); - var enumBugKeys = _dereq_("../internals/enum-bug-keys"); - var hiddenKeys = enumBugKeys.concat("length", "prototype"); - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - exports.f = - Object.getOwnPropertyNames || - function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); - }; - }, - { - "../internals/enum-bug-keys": 67, - "../internals/object-keys-internal": 116, - }, - ], - 114: [ - function (_dereq_, module, exports) { - exports.f = Object.getOwnPropertySymbols; - }, - {}, - ], - 115: [ - function (_dereq_, module, exports) { - var has = _dereq_("../internals/has"); - var toObject = _dereq_("../internals/to-object"); - var sharedKey = _dereq_("../internals/shared-key"); - var CORRECT_PROTOTYPE_GETTER = _dereq_( - "../internals/correct-prototype-getter", - ); - var IE_PROTO = sharedKey("IE_PROTO"); - var ObjectPrototype = Object.prototype; - // `Object.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.getprototypeof - module.exports = CORRECT_PROTOTYPE_GETTER - ? Object.getPrototypeOf - : function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if ( - typeof O.constructor == "function" && - O instanceof O.constructor - ) { - return O.constructor.prototype; - } - return O instanceof Object ? ObjectPrototype : null; - }; - }, - { - "../internals/correct-prototype-getter": 53, - "../internals/has": 78, - "../internals/shared-key": 136, - "../internals/to-object": 155, - }, - ], - 116: [ - function (_dereq_, module, exports) { - var has = _dereq_("../internals/has"); - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var indexOf = _dereq_("../internals/array-includes").indexOf; - var hiddenKeys = _dereq_("../internals/hidden-keys"); - module.exports = function (object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - for (key in O) - !has(hiddenKeys, key) && has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) - if (has(O, (key = names[i++]))) { - ~indexOf(result, key) || result.push(key); - } - return result; - }; - }, - { - "../internals/array-includes": 36, - "../internals/has": 78, - "../internals/hidden-keys": 79, - "../internals/to-indexed-object": 152, - }, - ], - 117: [ - function (_dereq_, module, exports) { - var internalObjectKeys = _dereq_("../internals/object-keys-internal"); - var enumBugKeys = _dereq_("../internals/enum-bug-keys"); - // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys - module.exports = - Object.keys || - function keys(O) { - return internalObjectKeys(O, enumBugKeys); - }; - }, - { - "../internals/enum-bug-keys": 67, - "../internals/object-keys-internal": 116, - }, - ], - 118: [ - function (_dereq_, module, exports) { - "use strict"; - var nativePropertyIsEnumerable = {}.propertyIsEnumerable; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - // Nashorn ~ JDK8 bug - var NASHORN_BUG = - getOwnPropertyDescriptor && - !nativePropertyIsEnumerable.call( - { - 1: 2, - }, - 1, - ); - // `Object.prototype.propertyIsEnumerable` method implementation - // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable - exports.f = NASHORN_BUG - ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } - : nativePropertyIsEnumerable; - }, - {}, - ], - 119: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - var aPossiblePrototype = _dereq_("../internals/a-possible-prototype"); - // `Object.setPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.setprototypeof - // Works with __proto__ only. Old v8 can't work with null proto objects. - /* eslint-disable no-proto */ - module.exports = - Object.setPrototypeOf || - ("__proto__" in {} - ? (function () { - var CORRECT_SETTER = false; - var test = {}; - var setter; - try { - setter = Object.getOwnPropertyDescriptor( - Object.prototype, - "__proto__", - ).set; - setter.call(test, []); - CORRECT_SETTER = test instanceof Array; - } catch (error) { - /* empty */ - } - return function setPrototypeOf(O, proto) { - anObject(O); - aPossiblePrototype(proto); - if (CORRECT_SETTER) setter.call(O, proto); - else O.__proto__ = proto; - return O; - }; - })() - : undefined); - }, - { - "../internals/a-possible-prototype": 24, - "../internals/an-object": 28, - }, - ], - 120: [ - function (_dereq_, module, exports) { - "use strict"; - var TO_STRING_TAG_SUPPORT = _dereq_( - "../internals/to-string-tag-support", - ); - var classof = _dereq_("../internals/classof"); - // `Object.prototype.toString` method implementation - // https://tc39.github.io/ecma262/#sec-object.prototype.tostring - module.exports = TO_STRING_TAG_SUPPORT - ? {}.toString - : function toString() { - return "[object " + classof(this) + "]"; - }; - }, - { - "../internals/classof": 47, - "../internals/to-string-tag-support": 159, - }, - ], - 121: [ - function (_dereq_, module, exports) { - var getBuiltIn = _dereq_("../internals/get-built-in"); - var getOwnPropertyNamesModule = _dereq_( - "../internals/object-get-own-property-names", - ); - var getOwnPropertySymbolsModule = _dereq_( - "../internals/object-get-own-property-symbols", - ); - var anObject = _dereq_("../internals/an-object"); - // all object keys, includes non-enumerable and symbols - module.exports = - getBuiltIn("Reflect", "ownKeys") || - function ownKeys(it) { - var keys = getOwnPropertyNamesModule.f(anObject(it)); - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return getOwnPropertySymbols - ? keys.concat(getOwnPropertySymbols(it)) - : keys; - }; - }, - { - "../internals/an-object": 28, - "../internals/get-built-in": 74, - "../internals/object-get-own-property-names": 113, - "../internals/object-get-own-property-symbols": 114, - }, - ], - 122: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - module.exports = global; - }, - { - "../internals/global": 77, - }, - ], - 123: [ - function (_dereq_, module, exports) { - module.exports = function (exec) { - try { - return { - error: false, - value: exec(), - }; - } catch (error) { - return { - error: true, - value: error, - }; - } - }; - }, - {}, - ], - 124: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - var isObject = _dereq_("../internals/is-object"); - var newPromiseCapability = _dereq_( - "../internals/new-promise-capability", - ); - module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; - }; - }, - { - "../internals/an-object": 28, - "../internals/is-object": 92, - "../internals/new-promise-capability": 104, - }, - ], - 125: [ - function (_dereq_, module, exports) { - var redefine = _dereq_("../internals/redefine"); - module.exports = function (target, src, options) { - for (var key in src) redefine(target, key, src[key], options); - return target; - }; - }, - { - "../internals/redefine": 126, - }, - ], - 126: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var has = _dereq_("../internals/has"); - var setGlobal = _dereq_("../internals/set-global"); - var inspectSource = _dereq_("../internals/inspect-source"); - var InternalStateModule = _dereq_("../internals/internal-state"); - var getInternalState = InternalStateModule.get; - var enforceInternalState = InternalStateModule.enforce; - var TEMPLATE = String(String).split("String"); - (module.exports = function (O, key, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - if (typeof value == "function") { - if (typeof key == "string" && !has(value, "name")) - createNonEnumerableProperty(value, "name", key); - enforceInternalState(value).source = TEMPLATE.join( - typeof key == "string" ? key : "", - ); - } - if (O === global) { - if (simple) O[key] = value; - else setGlobal(key, value); - return; - } else if (!unsafe) { - delete O[key]; - } else if (!noTargetGet && O[key]) { - simple = true; - } - if (simple) O[key] = value; - else createNonEnumerableProperty(O, key, value); - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - })(Function.prototype, "toString", function toString() { - return ( - (typeof this == "function" && getInternalState(this).source) || - inspectSource(this) - ); - }); - }, - { - "../internals/create-non-enumerable-property": 56, - "../internals/global": 77, - "../internals/has": 78, - "../internals/inspect-source": 86, - "../internals/internal-state": 88, - "../internals/set-global": 133, - }, - ], - 127: [ - function (_dereq_, module, exports) { - var classof = _dereq_("./classof-raw"); - var regexpExec = _dereq_("./regexp-exec"); - // `RegExpExec` abstract operation - // https://tc39.github.io/ecma262/#sec-regexpexec - module.exports = function (R, S) { - var exec = R.exec; - if (typeof exec === "function") { - var result = exec.call(R, S); - if (typeof result !== "object") { - throw TypeError( - "RegExp exec method returned something other than an Object or null", - ); - } - return result; - } - if (classof(R) !== "RegExp") { - throw TypeError("RegExp#exec called on incompatible receiver"); - } - return regexpExec.call(R, S); - }; - }, - { - "./classof-raw": 46, - "./regexp-exec": 128, - }, - ], - 128: [ - function (_dereq_, module, exports) { - "use strict"; - var regexpFlags = _dereq_("./regexp-flags"); - var stickyHelpers = _dereq_("./regexp-sticky-helpers"); - var nativeExec = RegExp.prototype.exec; - // This always refers to the native implementation, because the - // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, - // which loads this file before patching the method. - var nativeReplace = String.prototype.replace; - var patchedExec = nativeExec; - var UPDATES_LAST_INDEX_WRONG = (function () { - var re1 = /a/; - var re2 = /b*/g; - nativeExec.call(re1, "a"); - nativeExec.call(re2, "a"); - return re1.lastIndex !== 0 || re2.lastIndex !== 0; - })(); - var UNSUPPORTED_Y = - stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET; - // nonparticipating capturing group, copied from es5-shim's String#split patch. - var NPCG_INCLUDED = /()??/.exec("")[1] !== undefined; - var PATCH = - UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y; - if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, reCopy, match, i; - var sticky = UNSUPPORTED_Y && re.sticky; - var flags = regexpFlags.call(re); - var source = re.source; - var charsAdded = 0; - var strCopy = str; - if (sticky) { - flags = flags.replace("y", ""); - if (flags.indexOf("g") === -1) { - flags += "g"; - } - strCopy = String(str).slice(re.lastIndex); - // Support anchored sticky behavior. - if ( - re.lastIndex > 0 && - (!re.multiline || - (re.multiline && str[re.lastIndex - 1] !== "\n")) - ) { - source = "(?: " + source + ")"; - strCopy = " " + strCopy; - charsAdded++; - } // ^(? + rx + ) is needed, in combination with some str slicing, to - // simulate the 'y' flag. - - reCopy = new RegExp("^(?:" + source + ")", flags); - } - if (NPCG_INCLUDED) { - reCopy = new RegExp("^" + source + "$(?!\\s)", flags); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; - match = nativeExec.call(sticky ? reCopy : re, strCopy); - if (sticky) { - if (match) { - match.input = match.input.slice(charsAdded); - match[0] = match[0].slice(charsAdded); - match.index = re.lastIndex; - re.lastIndex += match[0].length; - } else re.lastIndex = 0; - } else if (UPDATES_LAST_INDEX_WRONG && match) { - re.lastIndex = re.global - ? match.index + match[0].length - : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } - return match; - }; - } - module.exports = patchedExec; - }, - { - "./regexp-flags": 129, - "./regexp-sticky-helpers": 130, - }, - ], - 129: [ - function (_dereq_, module, exports) { - "use strict"; - var anObject = _dereq_("../internals/an-object"); - // `RegExp.prototype.flags` getter implementation - // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags - module.exports = function () { - var that = anObject(this); - var result = ""; - if (that.global) result += "g"; - if (that.ignoreCase) result += "i"; - if (that.multiline) result += "m"; - if (that.dotAll) result += "s"; - if (that.unicode) result += "u"; - if (that.sticky) result += "y"; - return result; - }; - }, - { - "../internals/an-object": 28, - }, - ], - 130: [ - function (_dereq_, module, exports) { - "use strict"; - var fails = _dereq_("./fails"); - // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, - // so we use an intermediate function. - function RE(s, f) { - return RegExp(s, f); - } - exports.UNSUPPORTED_Y = fails(function () { - // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError - var re = RE("a", "y"); - re.lastIndex = 2; - return re.exec("abcd") != null; - }); - exports.BROKEN_CARET = fails(function () { - // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 - var re = RE("^r", "gy"); - re.lastIndex = 2; - return re.exec("str") != null; - }); - }, - { - "./fails": 69, - }, - ], - 131: [ - function (_dereq_, module, exports) { - // `RequireObjectCoercible` abstract operation - // https://tc39.github.io/ecma262/#sec-requireobjectcoercible - module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; - }; - }, - {}, - ], - 132: [ - function (_dereq_, module, exports) { - // `SameValue` abstract operation - // https://tc39.github.io/ecma262/#sec-samevalue - module.exports = - Object.is || - function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; - }; - }, - {}, - ], - 133: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - module.exports = function (key, value) { - try { - createNonEnumerableProperty(global, key, value); - } catch (error) { - global[key] = value; - } - return value; - }; - }, - { - "../internals/create-non-enumerable-property": 56, - "../internals/global": 77, - }, - ], - 134: [ - function (_dereq_, module, exports) { - "use strict"; - var getBuiltIn = _dereq_("../internals/get-built-in"); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var SPECIES = wellKnownSymbol("species"); - module.exports = function (CONSTRUCTOR_NAME) { - var Constructor = getBuiltIn(CONSTRUCTOR_NAME); - var defineProperty = definePropertyModule.f; - if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { - defineProperty(Constructor, SPECIES, { - configurable: true, - get: function () { - return this; - }, - }); - } - }; - }, - { - "../internals/descriptors": 61, - "../internals/get-built-in": 74, - "../internals/object-define-property": 110, - "../internals/well-known-symbol": 166, - }, - ], - 135: [ - function (_dereq_, module, exports) { - var defineProperty = _dereq_("../internals/object-define-property").f; - var has = _dereq_("../internals/has"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - module.exports = function (it, TAG, STATIC) { - if (it && !has((it = STATIC ? it : it.prototype), TO_STRING_TAG)) { - defineProperty(it, TO_STRING_TAG, { - configurable: true, - value: TAG, - }); - } - }; - }, - { - "../internals/has": 78, - "../internals/object-define-property": 110, - "../internals/well-known-symbol": 166, - }, - ], - 136: [ - function (_dereq_, module, exports) { - var shared = _dereq_("../internals/shared"); - var uid = _dereq_("../internals/uid"); - var keys = shared("keys"); - module.exports = function (key) { - return keys[key] || (keys[key] = uid(key)); - }; - }, - { - "../internals/shared": 138, - "../internals/uid": 163, - }, - ], - 137: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var setGlobal = _dereq_("../internals/set-global"); - var SHARED = "__core-js_shared__"; - var store = global[SHARED] || setGlobal(SHARED, {}); - module.exports = store; - }, - { - "../internals/global": 77, - "../internals/set-global": 133, - }, - ], - 138: [ - function (_dereq_, module, exports) { - var IS_PURE = _dereq_("../internals/is-pure"); - var store = _dereq_("../internals/shared-store"); - (module.exports = function (key, value) { - return ( - store[key] || (store[key] = value !== undefined ? value : {}) - ); - })("versions", []).push({ - version: "3.6.5", - mode: IS_PURE ? "pure" : "global", - copyright: "© 2020 Denis Pushkarev (zloirock.ru)", - }); - }, - { - "../internals/is-pure": 93, - "../internals/shared-store": 137, - }, - ], - 139: [ - function (_dereq_, module, exports) { - var anObject = _dereq_("../internals/an-object"); - var aFunction = _dereq_("../internals/a-function"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var SPECIES = wellKnownSymbol("species"); - // `SpeciesConstructor` abstract operation - // https://tc39.github.io/ecma262/#sec-speciesconstructor - module.exports = function (O, defaultConstructor) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined - ? defaultConstructor - : aFunction(S); - }; - }, - { - "../internals/a-function": 23, - "../internals/an-object": 28, - "../internals/well-known-symbol": 166, - }, - ], - 140: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - // check the existence of a method, lowercase - // of a tag and escaping quotes in arguments - module.exports = function (METHOD_NAME) { - return fails(function () { - var test = ""[METHOD_NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }); - }; - }, - { - "../internals/fails": 69, - }, - ], - 141: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_("../internals/to-integer"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - // `String.prototype.{ codePointAt, at }` methods implementation - var createMethod = function (CONVERT_TO_STRING) { - return function ($this, pos) { - var S = String(requireObjectCoercible($this)); - var position = toInteger(pos); - var size = S.length; - var first, second; - if (position < 0 || position >= size) - return CONVERT_TO_STRING ? "" : undefined; - first = S.charCodeAt(position); - return first < 55296 || - first > 56319 || - position + 1 === size || - (second = S.charCodeAt(position + 1)) < 56320 || - second > 57343 - ? CONVERT_TO_STRING - ? S.charAt(position) - : first - : CONVERT_TO_STRING - ? S.slice(position, position + 2) - : ((first - 55296) << 10) + (second - 56320) + 65536; - }; - }; - module.exports = { - // `String.prototype.codePointAt` method - // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat - codeAt: createMethod(false), - // `String.prototype.at` method - // https://github.com/mathiasbynens/String.prototype.at - charAt: createMethod(true), - }; - }, - { - "../internals/require-object-coercible": 131, - "../internals/to-integer": 153, - }, - ], - 142: [ - function (_dereq_, module, exports) { - // https://github.com/zloirock/core-js/issues/280 - var userAgent = _dereq_("../internals/engine-user-agent"); - // eslint-disable-next-line unicorn/no-unsafe-regex - module.exports = - /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); - }, - { - "../internals/engine-user-agent": 65, - }, - ], - 143: [ - function (_dereq_, module, exports) { - // https://github.com/tc39/proposal-string-pad-start-end - var toLength = _dereq_("../internals/to-length"); - var repeat = _dereq_("../internals/string-repeat"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var ceil = Math.ceil; - // `String.prototype.{ padStart, padEnd }` methods implementation - var createMethod = function (IS_END) { - return function ($this, maxLength, fillString) { - var S = String(requireObjectCoercible($this)); - var stringLength = S.length; - var fillStr = fillString === undefined ? " " : String(fillString); - var intMaxLength = toLength(maxLength); - var fillLen, stringFiller; - if (intMaxLength <= stringLength || fillStr == "") return S; - fillLen = intMaxLength - stringLength; - stringFiller = repeat.call( - fillStr, - ceil(fillLen / fillStr.length), - ); - if (stringFiller.length > fillLen) - stringFiller = stringFiller.slice(0, fillLen); - return IS_END ? S + stringFiller : stringFiller + S; - }; - }; - module.exports = { - // `String.prototype.padStart` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padstart - start: createMethod(false), - // `String.prototype.padEnd` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padend - end: createMethod(true), - }; - }, - { - "../internals/require-object-coercible": 131, - "../internals/string-repeat": 145, - "../internals/to-length": 154, - }, - ], - 144: [ - function (_dereq_, module, exports) { - "use strict"; - // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js - var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - var base = 36; - var tMin = 1; - var tMax = 26; - var skew = 38; - var damp = 700; - var initialBias = 72; - var initialN = 128; // 0x80 - var delimiter = "-"; // '\x2D' - var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars - var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - var OVERFLOW_ERROR = - "Overflow: input needs wider integers to process"; - var baseMinusTMin = base - tMin; - var floor = Math.floor; - var stringFromCharCode = String.fromCharCode; - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - */ - var ucs2decode = function (string) { - var output = []; - var counter = 0; - var length = string.length; - while (counter < length) { - var value = string.charCodeAt(counter++); - if (value >= 55296 && value <= 56319 && counter < length) { - // It's a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 64512) == 56320) { - // Low surrogate. - output.push(((value & 1023) << 10) + (extra & 1023) + 65536); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - }; - /** - * Converts a digit/integer into a basic code point. - */ - var digitToBasic = function (digit) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26); - }; - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - */ - var adapt = function (delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (; delta > (baseMinusTMin * tMax) >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew)); - }; - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - */ - // eslint-disable-next-line max-statements - var encode = function (input) { - var output = []; - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - // Cache the length. - var inputLength = input.length; - // Initialize the state. - var n = initialN; - var delta = 0; - var bias = initialBias; - var i, currentValue; - // Handle the basic code points. - for (i = 0; i < input.length; i++) { - currentValue = input[i]; - if (currentValue < 128) { - output.push(stringFromCharCode(currentValue)); - } - } - var basicLength = output.length; // number of basic code points. - var handledCPCount = basicLength; // number of code points that have been handled; - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } // Main encoding loop: - - while (handledCPCount < inputLength) { - // All non-basic code points < n have been handled already. Find the next larger one: - var m = maxInt; - for (i = 0; i < input.length; i++) { - currentValue = input[i]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } // Increase `delta` enough to advance the decoder's state to , but guard against overflow. - - var handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - throw RangeError(OVERFLOW_ERROR); - } - delta += (m - n) * handledCPCountPlusOne; - n = m; - for (i = 0; i < input.length; i++) { - currentValue = input[i]; - if (currentValue < n && ++delta > maxInt) { - throw RangeError(OVERFLOW_ERROR); - } - if (currentValue == n) { - // Represent delta as a generalized variable-length integer. - var q = delta; - for (/* no condition */ var k = base; ; k += base) { - var t = - k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (q < t) break; - var qMinusT = q - t; - var baseMinusT = base - t; - output.push( - stringFromCharCode( - digitToBasic(t + (qMinusT % baseMinusT)), - ), - ); - q = floor(qMinusT / baseMinusT); - } - output.push(stringFromCharCode(digitToBasic(q))); - bias = adapt( - delta, - handledCPCountPlusOne, - handledCPCount == basicLength, - ); - delta = 0; - ++handledCPCount; - } - } - ++delta; - ++n; - } - return output.join(""); - }; - module.exports = function (input) { - var encoded = []; - var labels = input - .toLowerCase() - .replace(regexSeparators, ".") - .split("."); - var i, label; - for (i = 0; i < labels.length; i++) { - label = labels[i]; - encoded.push( - regexNonASCII.test(label) ? "xn--" + encode(label) : label, - ); - } - return encoded.join("."); - }; - }, - {}, - ], - 145: [ - function (_dereq_, module, exports) { - "use strict"; - var toInteger = _dereq_("../internals/to-integer"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - // `String.prototype.repeat` method implementation - // https://tc39.github.io/ecma262/#sec-string.prototype.repeat - module.exports = - "".repeat || - function repeat(count) { - var str = String(requireObjectCoercible(this)); - var result = ""; - var n = toInteger(count); - if (n < 0 || n == Infinity) - throw RangeError("Wrong number of repetitions"); - for (; n > 0; (n >>>= 1) && (str += str)) - if (n & 1) result += str; - return result; - }; - }, - { - "../internals/require-object-coercible": 131, - "../internals/to-integer": 153, - }, - ], - 146: [ - function (_dereq_, module, exports) { - var fails = _dereq_("../internals/fails"); - var whitespaces = _dereq_("../internals/whitespaces"); - var non = "​…᠎"; - // check that a method works with the correct list - // of whitespaces and has a correct name - module.exports = function (METHOD_NAME) { - return fails(function () { - return ( - !!whitespaces[METHOD_NAME]() || - non[METHOD_NAME]() != non || - whitespaces[METHOD_NAME].name !== METHOD_NAME - ); - }); - }; - }, - { - "../internals/fails": 69, - "../internals/whitespaces": 167, - }, - ], - 147: [ - function (_dereq_, module, exports) { - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var whitespaces = _dereq_("../internals/whitespaces"); - var whitespace = "[" + whitespaces + "]"; - var ltrim = RegExp("^" + whitespace + whitespace + "*"); - var rtrim = RegExp(whitespace + whitespace + "*$"); - // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation - var createMethod = function (TYPE) { - return function ($this) { - var string = String(requireObjectCoercible($this)); - if (TYPE & 1) string = string.replace(ltrim, ""); - if (TYPE & 2) string = string.replace(rtrim, ""); - return string; - }; - }; - module.exports = { - // `String.prototype.{ trimLeft, trimStart }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart - start: createMethod(1), - // `String.prototype.{ trimRight, trimEnd }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimend - end: createMethod(2), - // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim - trim: createMethod(3), - }; - }, - { - "../internals/require-object-coercible": 131, - "../internals/whitespaces": 167, - }, - ], - 148: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var fails = _dereq_("../internals/fails"); - var classof = _dereq_("../internals/classof-raw"); - var bind = _dereq_("../internals/function-bind-context"); - var html = _dereq_("../internals/html"); - var createElement = _dereq_("../internals/document-create-element"); - var IS_IOS = _dereq_("../internals/engine-is-ios"); - var location = global.location; - var set = global.setImmediate; - var clear = global.clearImmediate; - var process = global.process; - var MessageChannel = global.MessageChannel; - var Dispatch = global.Dispatch; - var counter = 0; - var queue = {}; - var ONREADYSTATECHANGE = "onreadystatechange"; - var defer, channel, port; - var run = function (id) { - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } - }; - var runner = function (id) { - return function () { - run(id); - }; - }; - var listener = function (event) { - run(event.data); - }; - var post = function (id) { - // old engines have not location.origin - global.postMessage( - id + "", - location.protocol + "//" + location.host, - ); - }; - // Node.js 0.9+ & IE10+ has setImmediate, otherwise: - if (!set || !clear) { - set = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - (typeof fn == "function" ? fn : Function(fn)).apply( - undefined, - args, - ); - }; - defer(counter); - return counter; - }; - clear = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (classof(process) == "process") { - defer = function (id) { - process.nextTick(runner(id)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(runner(id)); - }; - // Browsers with MessageChannel, includes WebWorkers - // except iOS - https://github.com/zloirock/core-js/issues/624 - } else if (MessageChannel && !IS_IOS) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = bind(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if ( - global.addEventListener && - typeof postMessage == "function" && - !global.importScripts && - !fails(post) && - location.protocol !== "file:" - ) { - defer = post; - global.addEventListener("message", listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in createElement("script")) { - defer = function (id) { - html.appendChild(createElement("script"))[ONREADYSTATECHANGE] = - function () { - html.removeChild(this); - run(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(runner(id), 0); - }; - } - } - module.exports = { - set: set, - clear: clear, - }; - }, - { - "../internals/classof-raw": 46, - "../internals/document-create-element": 62, - "../internals/engine-is-ios": 64, - "../internals/fails": 69, - "../internals/function-bind-context": 72, - "../internals/global": 77, - "../internals/html": 81, - }, - ], - 149: [ - function (_dereq_, module, exports) { - var classof = _dereq_("../internals/classof-raw"); - // `thisNumberValue` abstract operation - // https://tc39.github.io/ecma262/#sec-thisnumbervalue - module.exports = function (value) { - if (typeof value != "number" && classof(value) != "Number") { - throw TypeError("Incorrect invocation"); - } - return +value; - }; - }, - { - "../internals/classof-raw": 46, - }, - ], - 150: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_("../internals/to-integer"); - var max = Math.max; - var min = Math.min; - // Helper for a popular repeating case of the spec: - // Let integer be ? ToInteger(index). - // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). - module.exports = function (index, length) { - var integer = toInteger(index); - return integer < 0 - ? max(integer + length, 0) - : min(integer, length); - }; - }, - { - "../internals/to-integer": 153, - }, - ], - 151: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_("../internals/to-integer"); - var toLength = _dereq_("../internals/to-length"); - // `ToIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-toindex - module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError("Wrong length or index"); - return length; - }; - }, - { - "../internals/to-integer": 153, - "../internals/to-length": 154, - }, - ], - 152: [ - function (_dereq_, module, exports) { - // toObject with fallback for non-array-like ES3 strings - var IndexedObject = _dereq_("../internals/indexed-object"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - module.exports = function (it) { - return IndexedObject(requireObjectCoercible(it)); - }; - }, - { - "../internals/indexed-object": 84, - "../internals/require-object-coercible": 131, - }, - ], - 153: [ - function (_dereq_, module, exports) { - var ceil = Math.ceil; - var floor = Math.floor; - // `ToInteger` abstract operation - // https://tc39.github.io/ecma262/#sec-tointeger - module.exports = function (argument) { - return isNaN((argument = +argument)) - ? 0 - : (argument > 0 ? floor : ceil)(argument); - }; - }, - {}, - ], - 154: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_("../internals/to-integer"); - var min = Math.min; - // `ToLength` abstract operation - // https://tc39.github.io/ecma262/#sec-tolength - module.exports = function (argument) { - return argument > 0 - ? min(toInteger(argument), 9007199254740991) - : 0; // 2 ** 53 - 1 == 9007199254740991 - }; - }, - { - "../internals/to-integer": 153, - }, - ], - 155: [ - function (_dereq_, module, exports) { - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - // `ToObject` abstract operation - // https://tc39.github.io/ecma262/#sec-toobject - module.exports = function (argument) { - return Object(requireObjectCoercible(argument)); - }; - }, - { - "../internals/require-object-coercible": 131, - }, - ], - 156: [ - function (_dereq_, module, exports) { - var toPositiveInteger = _dereq_("../internals/to-positive-integer"); - module.exports = function (it, BYTES) { - var offset = toPositiveInteger(it); - if (offset % BYTES) throw RangeError("Wrong offset"); - return offset; - }; - }, - { - "../internals/to-positive-integer": 157, - }, - ], - 157: [ - function (_dereq_, module, exports) { - var toInteger = _dereq_("../internals/to-integer"); - module.exports = function (it) { - var result = toInteger(it); - if (result < 0) - throw RangeError("The argument can't be less than 0"); - return result; - }; - }, - { - "../internals/to-integer": 153, - }, - ], - 158: [ - function (_dereq_, module, exports) { - var isObject = _dereq_("../internals/is-object"); - // `ToPrimitive` abstract operation - // https://tc39.github.io/ecma262/#sec-toprimitive - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - module.exports = function (input, PREFERRED_STRING) { - if (!isObject(input)) return input; - var fn, val; - if ( - PREFERRED_STRING && - typeof (fn = input.toString) == "function" && - !isObject((val = fn.call(input))) - ) - return val; - if ( - typeof (fn = input.valueOf) == "function" && - !isObject((val = fn.call(input))) - ) - return val; - if ( - !PREFERRED_STRING && - typeof (fn = input.toString) == "function" && - !isObject((val = fn.call(input))) - ) - return val; - throw TypeError("Can't convert object to primitive value"); - }; - }, - { - "../internals/is-object": 92, - }, - ], - 159: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var test = {}; - test[TO_STRING_TAG] = "z"; - module.exports = String(test) === "[object z]"; - }, - { - "../internals/well-known-symbol": 166, - }, - ], - 160: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var global = _dereq_("../internals/global"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = _dereq_( - "../internals/typed-array-constructors-require-wrappers", - ); - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var ArrayBufferModule = _dereq_("../internals/array-buffer"); - var anInstance = _dereq_("../internals/an-instance"); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var toLength = _dereq_("../internals/to-length"); - var toIndex = _dereq_("../internals/to-index"); - var toOffset = _dereq_("../internals/to-offset"); - var toPrimitive = _dereq_("../internals/to-primitive"); - var has = _dereq_("../internals/has"); - var classof = _dereq_("../internals/classof"); - var isObject = _dereq_("../internals/is-object"); - var create = _dereq_("../internals/object-create"); - var setPrototypeOf = _dereq_("../internals/object-set-prototype-of"); - var getOwnPropertyNames = _dereq_( - "../internals/object-get-own-property-names", - ).f; - var typedArrayFrom = _dereq_("../internals/typed-array-from"); - var forEach = _dereq_("../internals/array-iteration").forEach; - var setSpecies = _dereq_("../internals/set-species"); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var getOwnPropertyDescriptorModule = _dereq_( - "../internals/object-get-own-property-descriptor", - ); - var InternalStateModule = _dereq_("../internals/internal-state"); - var inheritIfRequired = _dereq_("../internals/inherit-if-required"); - var getInternalState = InternalStateModule.get; - var setInternalState = InternalStateModule.set; - var nativeDefineProperty = definePropertyModule.f; - var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - var round = Math.round; - var RangeError = global.RangeError; - var ArrayBuffer = ArrayBufferModule.ArrayBuffer; - var DataView = ArrayBufferModule.DataView; - var NATIVE_ARRAY_BUFFER_VIEWS = - ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; - var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; - var TypedArray = ArrayBufferViewCore.TypedArray; - var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; - var aTypedArrayConstructor = - ArrayBufferViewCore.aTypedArrayConstructor; - var isTypedArray = ArrayBufferViewCore.isTypedArray; - var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT"; - var WRONG_LENGTH = "Wrong length"; - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C))(length); - while (length > index) result[index] = list[index++]; - return result; - }; - var addGetter = function (it, key) { - nativeDefineProperty(it, key, { - get: function () { - return getInternalState(this)[key]; - }, - }); - }; - var isArrayBuffer = function (it) { - var klass; - return ( - it instanceof ArrayBuffer || - (klass = classof(it)) == "ArrayBuffer" || - klass == "SharedArrayBuffer" - ); - }; - var isTypedArrayIndex = function (target, key) { - return ( - isTypedArray(target) && - typeof key != "symbol" && - key in target && - String(+key) == String(key) - ); - }; - var wrappedGetOwnPropertyDescriptor = - function getOwnPropertyDescriptor(target, key) { - return isTypedArrayIndex(target, (key = toPrimitive(key, true))) - ? createPropertyDescriptor(2, target[key]) - : nativeGetOwnPropertyDescriptor(target, key); - }; - var wrappedDefineProperty = function defineProperty( - target, - key, - descriptor, - ) { - if ( - isTypedArrayIndex(target, (key = toPrimitive(key, true))) && - isObject(descriptor) && - has(descriptor, "value") && - !has(descriptor, "get") && - !has(descriptor, "set") && // TODO: add validation descriptor w/o calling accessors - !descriptor.configurable && - (!has(descriptor, "writable") || descriptor.writable) && - (!has(descriptor, "enumerable") || descriptor.enumerable) - ) { - target[key] = descriptor.value; - return target; - } - return nativeDefineProperty(target, key, descriptor); - }; - if (DESCRIPTORS) { - if (!NATIVE_ARRAY_BUFFER_VIEWS) { - getOwnPropertyDescriptorModule.f = - wrappedGetOwnPropertyDescriptor; - definePropertyModule.f = wrappedDefineProperty; - addGetter(TypedArrayPrototype, "buffer"); - addGetter(TypedArrayPrototype, "byteOffset"); - addGetter(TypedArrayPrototype, "byteLength"); - addGetter(TypedArrayPrototype, "length"); - } - $( - { - target: "Object", - stat: true, - forced: !NATIVE_ARRAY_BUFFER_VIEWS, - }, - { - getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, - defineProperty: wrappedDefineProperty, - }, - ); - module.exports = function (TYPE, wrapper, CLAMPED) { - var BYTES = TYPE.match(/\d+$/)[0] / 8; - var CONSTRUCTOR_NAME = - TYPE + (CLAMPED ? "Clamped" : "") + "Array"; - var GETTER = "get" + TYPE; - var SETTER = "set" + TYPE; - var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; - var TypedArrayConstructor = NativeTypedArrayConstructor; - var TypedArrayConstructorPrototype = - TypedArrayConstructor && TypedArrayConstructor.prototype; - var exported = {}; - var getter = function (that, index) { - var data = getInternalState(that); - return data.view[GETTER](index * BYTES + data.byteOffset, true); - }; - var setter = function (that, index, value) { - var data = getInternalState(that); - if (CLAMPED) - value = - (value = round(value)) < 0 - ? 0 - : value > 255 - ? 255 - : value & 255; - data.view[SETTER](index * BYTES + data.byteOffset, value, true); - }; - var addElement = function (that, index) { - nativeDefineProperty(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true, - }); - }; - if (!NATIVE_ARRAY_BUFFER_VIEWS) { - TypedArrayConstructor = wrapper( - function (that, data, offset, $length) { - anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); - var index = 0; - var byteOffset = 0; - var buffer, byteLength, length; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new ArrayBuffer(byteLength); - } else if (isArrayBuffer(data)) { - buffer = data; - byteOffset = toOffset(offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - byteOffset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + byteOffset > $len) - throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (isTypedArray(data)) { - return fromList(TypedArrayConstructor, data); - } else { - return typedArrayFrom.call(TypedArrayConstructor, data); - } - setInternalState(that, { - buffer: buffer, - byteOffset: byteOffset, - byteLength: byteLength, - length: length, - view: new DataView(buffer), - }); - while (index < length) addElement(that, index++); - }, - ); - if (setPrototypeOf) - setPrototypeOf(TypedArrayConstructor, TypedArray); - TypedArrayConstructorPrototype = - TypedArrayConstructor.prototype = create(TypedArrayPrototype); - } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { - TypedArrayConstructor = wrapper( - function (dummy, data, typedArrayOffset, $length) { - anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); - return inheritIfRequired( - (function () { - if (!isObject(data)) - return new NativeTypedArrayConstructor(toIndex(data)); - if (isArrayBuffer(data)) - return $length !== undefined - ? new NativeTypedArrayConstructor( - data, - toOffset(typedArrayOffset, BYTES), - $length, - ) - : typedArrayOffset !== undefined - ? new NativeTypedArrayConstructor( - data, - toOffset(typedArrayOffset, BYTES), - ) - : new NativeTypedArrayConstructor(data); - if (isTypedArray(data)) - return fromList(TypedArrayConstructor, data); - return typedArrayFrom.call(TypedArrayConstructor, data); - })(), - dummy, - TypedArrayConstructor, - ); - }, - ); - if (setPrototypeOf) - setPrototypeOf(TypedArrayConstructor, TypedArray); - forEach( - getOwnPropertyNames(NativeTypedArrayConstructor), - function (key) { - if (!(key in TypedArrayConstructor)) { - createNonEnumerableProperty( - TypedArrayConstructor, - key, - NativeTypedArrayConstructor[key], - ); - } - }, - ); - TypedArrayConstructor.prototype = - TypedArrayConstructorPrototype; - } - if ( - TypedArrayConstructorPrototype.constructor !== - TypedArrayConstructor - ) { - createNonEnumerableProperty( - TypedArrayConstructorPrototype, - "constructor", - TypedArrayConstructor, - ); - } - if (TYPED_ARRAY_TAG) { - createNonEnumerableProperty( - TypedArrayConstructorPrototype, - TYPED_ARRAY_TAG, - CONSTRUCTOR_NAME, - ); - } - exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; - $( - { - global: true, - forced: TypedArrayConstructor != NativeTypedArrayConstructor, - sham: !NATIVE_ARRAY_BUFFER_VIEWS, - }, - exported, - ); - if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { - createNonEnumerableProperty( - TypedArrayConstructor, - BYTES_PER_ELEMENT, - BYTES, - ); - } - if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { - createNonEnumerableProperty( - TypedArrayConstructorPrototype, - BYTES_PER_ELEMENT, - BYTES, - ); - } - setSpecies(CONSTRUCTOR_NAME); - }; - } else - module.exports = function () { - /* empty */ - }; - }, - { - "../internals/an-instance": 27, - "../internals/array-buffer": 31, - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - "../internals/classof": 47, - "../internals/create-non-enumerable-property": 56, - "../internals/create-property-descriptor": 57, - "../internals/descriptors": 61, - "../internals/export": 68, - "../internals/global": 77, - "../internals/has": 78, - "../internals/inherit-if-required": 85, - "../internals/internal-state": 88, - "../internals/is-object": 92, - "../internals/object-create": 108, - "../internals/object-define-property": 110, - "../internals/object-get-own-property-descriptor": 111, - "../internals/object-get-own-property-names": 113, - "../internals/object-set-prototype-of": 119, - "../internals/set-species": 134, - "../internals/to-index": 151, - "../internals/to-length": 154, - "../internals/to-offset": 156, - "../internals/to-primitive": 158, - "../internals/typed-array-constructors-require-wrappers": 161, - "../internals/typed-array-from": 162, - }, - ], - 161: [ - function (_dereq_, module, exports) { - /* eslint-disable no-new */ - var global = _dereq_("../internals/global"); - var fails = _dereq_("../internals/fails"); - var checkCorrectnessOfIteration = _dereq_( - "../internals/check-correctness-of-iteration", - ); - var NATIVE_ARRAY_BUFFER_VIEWS = _dereq_( - "../internals/array-buffer-view-core", - ).NATIVE_ARRAY_BUFFER_VIEWS; - var ArrayBuffer = global.ArrayBuffer; - var Int8Array = global.Int8Array; - module.exports = - !NATIVE_ARRAY_BUFFER_VIEWS || - !fails(function () { - Int8Array(1); - }) || - !fails(function () { - new Int8Array(-1); - }) || - !checkCorrectnessOfIteration(function (iterable) { - new Int8Array(); - new Int8Array(null); - new Int8Array(1.5); - new Int8Array(iterable); - }, true) || - fails(function () { - // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill - return ( - new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1 - ); - }); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/check-correctness-of-iteration": 45, - "../internals/fails": 69, - "../internals/global": 77, - }, - ], - 162: [ - function (_dereq_, module, exports) { - var toObject = _dereq_("../internals/to-object"); - var toLength = _dereq_("../internals/to-length"); - var getIteratorMethod = _dereq_("../internals/get-iterator-method"); - var isArrayIteratorMethod = _dereq_( - "../internals/is-array-iterator-method", - ); - var bind = _dereq_("../internals/function-bind-context"); - var aTypedArrayConstructor = _dereq_( - "../internals/array-buffer-view-core", - ).aTypedArrayConstructor; - module.exports = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var i, length, result, step, iterator, next; - if ( - iteratorMethod != undefined && - !isArrayIteratorMethod(iteratorMethod) - ) { - iterator = iteratorMethod.call(O); - next = iterator.next; - O = []; - while (!(step = next.call(iterator)).done) { - O.push(step.value); - } - } - if (mapping && argumentsLength > 2) { - mapfn = bind(mapfn, arguments[2], 2); - } - length = toLength(O.length); - result = new (aTypedArrayConstructor(this))(length); - for (i = 0; length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/function-bind-context": 72, - "../internals/get-iterator-method": 75, - "../internals/is-array-iterator-method": 89, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 163: [ - function (_dereq_, module, exports) { - var id = 0; - var postfix = Math.random(); - module.exports = function (key) { - return ( - "Symbol(" + - String(key === undefined ? "" : key) + - ")_" + - (++id + postfix).toString(36) - ); - }; - }, - {}, - ], - 164: [ - function (_dereq_, module, exports) { - var NATIVE_SYMBOL = _dereq_("../internals/native-symbol"); - module.exports = - NATIVE_SYMBOL && // eslint-disable-next-line no-undef - !Symbol.sham && // eslint-disable-next-line no-undef - typeof Symbol.iterator == "symbol"; - }, - { - "../internals/native-symbol": 101, - }, - ], - 165: [ - function (_dereq_, module, exports) { - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - exports.f = wellKnownSymbol; - }, - { - "../internals/well-known-symbol": 166, - }, - ], - 166: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var shared = _dereq_("../internals/shared"); - var has = _dereq_("../internals/has"); - var uid = _dereq_("../internals/uid"); - var NATIVE_SYMBOL = _dereq_("../internals/native-symbol"); - var USE_SYMBOL_AS_UID = _dereq_("../internals/use-symbol-as-uid"); - var WellKnownSymbolsStore = shared("wks"); - var Symbol = global.Symbol; - var createWellKnownSymbol = USE_SYMBOL_AS_UID - ? Symbol - : (Symbol && Symbol.withoutSetter) || uid; - module.exports = function (name) { - if (!has(WellKnownSymbolsStore, name)) { - if (NATIVE_SYMBOL && has(Symbol, name)) - WellKnownSymbolsStore[name] = Symbol[name]; - else - WellKnownSymbolsStore[name] = createWellKnownSymbol( - "Symbol." + name, - ); - } - return WellKnownSymbolsStore[name]; - }; - }, - { - "../internals/global": 77, - "../internals/has": 78, - "../internals/native-symbol": 101, - "../internals/shared": 138, - "../internals/uid": 163, - "../internals/use-symbol-as-uid": 164, - }, - ], - 167: [ - function (_dereq_, module, exports) { - // a string of all valid unicode whitespaces - // eslint-disable-next-line max-len - module.exports = "\t\n\v\f\r                 \u2028\u2029"; - }, - {}, - ], - 168: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var global = _dereq_("../internals/global"); - var arrayBufferModule = _dereq_("../internals/array-buffer"); - var setSpecies = _dereq_("../internals/set-species"); - var ARRAY_BUFFER = "ArrayBuffer"; - var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; - var NativeArrayBuffer = global[ARRAY_BUFFER]; - // `ArrayBuffer` constructor - // https://tc39.github.io/ecma262/#sec-arraybuffer-constructor - $( - { - global: true, - forced: NativeArrayBuffer !== ArrayBuffer, - }, - { - ArrayBuffer: ArrayBuffer, - }, - ); - setSpecies(ARRAY_BUFFER); - }, - { - "../internals/array-buffer": 31, - "../internals/export": 68, - "../internals/global": 77, - "../internals/set-species": 134, - }, - ], - 169: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var fails = _dereq_("../internals/fails"); - var isArray = _dereq_("../internals/is-array"); - var isObject = _dereq_("../internals/is-object"); - var toObject = _dereq_("../internals/to-object"); - var toLength = _dereq_("../internals/to-length"); - var createProperty = _dereq_("../internals/create-property"); - var arraySpeciesCreate = _dereq_("../internals/array-species-create"); - var arrayMethodHasSpeciesSupport = _dereq_( - "../internals/array-method-has-species-support", - ); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var V8_VERSION = _dereq_("../internals/engine-v8-version"); - var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable"); - var MAX_SAFE_INTEGER = 9007199254740991; - var MAXIMUM_ALLOWED_INDEX_EXCEEDED = "Maximum allowed index exceeded"; - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/679 - var IS_CONCAT_SPREADABLE_SUPPORT = - V8_VERSION >= 51 || - !fails(function () { - var array = []; - array[IS_CONCAT_SPREADABLE] = false; - return array.concat()[0] !== array; - }); - var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat"); - var isConcatSpreadable = function (O) { - if (!isObject(O)) return false; - var spreadable = O[IS_CONCAT_SPREADABLE]; - return spreadable !== undefined ? !!spreadable : isArray(O); - }; - var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; - // `Array.prototype.concat` method - // https://tc39.github.io/ecma262/#sec-array.prototype.concat - // with adding support of @@isConcatSpreadable and @@species - $( - { - target: "Array", - proto: true, - forced: FORCED, - }, - { - concat: function concat(arg) { - // eslint-disable-line no-unused-vars - var O = toObject(this); - var A = arraySpeciesCreate(O, 0); - var n = 0; - var i, k, length, len, E; - for (i = -1, length = arguments.length; i < length; i++) { - E = i === -1 ? O : arguments[i]; - if (isConcatSpreadable(E)) { - len = toLength(E.length); - if (n + len > MAX_SAFE_INTEGER) - throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); - for (k = 0; k < len; k++, n++) - if (k in E) createProperty(A, n, E[k]); - } else { - if (n >= MAX_SAFE_INTEGER) - throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); - createProperty(A, n++, E); - } - } - A.length = n; - return A; - }, - }, - ); - }, - { - "../internals/array-method-has-species-support": 39, - "../internals/array-species-create": 43, - "../internals/create-property": 58, - "../internals/engine-v8-version": 66, - "../internals/export": 68, - "../internals/fails": 69, - "../internals/is-array": 90, - "../internals/is-object": 92, - "../internals/to-length": 154, - "../internals/to-object": 155, - "../internals/well-known-symbol": 166, - }, - ], - 170: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var copyWithin = _dereq_("../internals/array-copy-within"); - var addToUnscopables = _dereq_("../internals/add-to-unscopables"); - // `Array.prototype.copyWithin` method - // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin - $( - { - target: "Array", - proto: true, - }, - { - copyWithin: copyWithin, - }, - ); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables("copyWithin"); - }, - { - "../internals/add-to-unscopables": 25, - "../internals/array-copy-within": 32, - "../internals/export": 68, - }, - ], - 171: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $every = _dereq_("../internals/array-iteration").every; - var arrayMethodIsStrict = _dereq_( - "../internals/array-method-is-strict", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var STRICT_METHOD = arrayMethodIsStrict("every"); - var USES_TO_LENGTH = arrayMethodUsesToLength("every"); - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - $( - { - target: "Array", - proto: true, - forced: !STRICT_METHOD || !USES_TO_LENGTH, - }, - { - every: function every(callbackfn /* , thisArg */) { - return $every( - this, - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/array-iteration": 37, - "../internals/array-method-is-strict": 40, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 172: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var fill = _dereq_("../internals/array-fill"); - var addToUnscopables = _dereq_("../internals/add-to-unscopables"); - // `Array.prototype.fill` method - // https://tc39.github.io/ecma262/#sec-array.prototype.fill - $( - { - target: "Array", - proto: true, - }, - { - fill: fill, - }, - ); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables("fill"); - }, - { - "../internals/add-to-unscopables": 25, - "../internals/array-fill": 33, - "../internals/export": 68, - }, - ], - 173: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $filter = _dereq_("../internals/array-iteration").filter; - var arrayMethodHasSpeciesSupport = _dereq_( - "../internals/array-method-has-species-support", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter"); - // Edge 14- issue - var USES_TO_LENGTH = arrayMethodUsesToLength("filter"); - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - // with adding support of @@species - $( - { - target: "Array", - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, - }, - { - filter: function filter(callbackfn /* , thisArg */) { - return $filter( - this, - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/array-iteration": 37, - "../internals/array-method-has-species-support": 39, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 174: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $findIndex = _dereq_("../internals/array-iteration").findIndex; - var addToUnscopables = _dereq_("../internals/add-to-unscopables"); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var FIND_INDEX = "findIndex"; - var SKIPS_HOLES = true; - var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX); - // Shouldn't skip holes - if (FIND_INDEX in []) - Array(1)[FIND_INDEX](function () { - SKIPS_HOLES = false; - }); - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findindex - $( - { - target: "Array", - proto: true, - forced: SKIPS_HOLES || !USES_TO_LENGTH, - }, - { - findIndex: function findIndex( - callbackfn /* , that = undefined */, - ) { - return $findIndex( - this, - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables(FIND_INDEX); - }, - { - "../internals/add-to-unscopables": 25, - "../internals/array-iteration": 37, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 175: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var forEach = _dereq_("../internals/array-for-each"); - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - $( - { - target: "Array", - proto: true, - forced: [].forEach != forEach, - }, - { - forEach: forEach, - }, - ); - }, - { - "../internals/array-for-each": 34, - "../internals/export": 68, - }, - ], - 176: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var from = _dereq_("../internals/array-from"); - var checkCorrectnessOfIteration = _dereq_( - "../internals/check-correctness-of-iteration", - ); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration( - function (iterable) { - Array.from(iterable); - }, - ); - // `Array.from` method - // https://tc39.github.io/ecma262/#sec-array.from - $( - { - target: "Array", - stat: true, - forced: INCORRECT_ITERATION, - }, - { - from: from, - }, - ); - }, - { - "../internals/array-from": 35, - "../internals/check-correctness-of-iteration": 45, - "../internals/export": 68, - }, - ], - 177: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $includes = _dereq_("../internals/array-includes").includes; - var addToUnscopables = _dereq_("../internals/add-to-unscopables"); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { - ACCESSORS: true, - 1: 0, - }); - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - $( - { - target: "Array", - proto: true, - forced: !USES_TO_LENGTH, - }, - { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes( - this, - el, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables("includes"); - }, - { - "../internals/add-to-unscopables": 25, - "../internals/array-includes": 36, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 178: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $indexOf = _dereq_("../internals/array-includes").indexOf; - var arrayMethodIsStrict = _dereq_( - "../internals/array-method-is-strict", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var nativeIndexOf = [].indexOf; - var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; - var STRICT_METHOD = arrayMethodIsStrict("indexOf"); - var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { - ACCESSORS: true, - 1: 0, - }); - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - $( - { - target: "Array", - proto: true, - forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH, - }, - { - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO // convert -0 to +0 - ? nativeIndexOf.apply(this, arguments) || 0 - : $indexOf( - this, - searchElement, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/array-includes": 36, - "../internals/array-method-is-strict": 40, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 179: [ - function (_dereq_, module, exports) { - "use strict"; - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var addToUnscopables = _dereq_("../internals/add-to-unscopables"); - var Iterators = _dereq_("../internals/iterators"); - var InternalStateModule = _dereq_("../internals/internal-state"); - var defineIterator = _dereq_("../internals/define-iterator"); - var ARRAY_ITERATOR = "Array Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); - // `Array.prototype.entries` method - // https://tc39.github.io/ecma262/#sec-array.prototype.entries - // `Array.prototype.keys` method - // https://tc39.github.io/ecma262/#sec-array.prototype.keys - // `Array.prototype.values` method - // https://tc39.github.io/ecma262/#sec-array.prototype.values - // `Array.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator - // `CreateArrayIterator` internal method - // https://tc39.github.io/ecma262/#sec-createarrayiterator - module.exports = defineIterator( - Array, - "Array", - function (iterated, kind) { - setInternalState(this, { - type: ARRAY_ITERATOR, - target: toIndexedObject(iterated), - // target - index: 0, - // next index - kind: kind, // kind - }); - // `%ArrayIteratorPrototype%.next` method - // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next - }, - function () { - var state = getInternalState(this); - var target = state.target; - var kind = state.kind; - var index = state.index++; - if (!target || index >= target.length) { - state.target = undefined; - return { - value: undefined, - done: true, - }; - } - if (kind == "keys") - return { - value: index, - done: false, - }; - if (kind == "values") - return { - value: target[index], - done: false, - }; - return { - value: [index, target[index]], - done: false, - }; - }, - "values", - ); - // argumentsList[@@iterator] is %ArrayProto_values% - // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject - // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject - Iterators.Arguments = Iterators.Array; - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables("keys"); - addToUnscopables("values"); - addToUnscopables("entries"); - }, - { - "../internals/add-to-unscopables": 25, - "../internals/define-iterator": 59, - "../internals/internal-state": 88, - "../internals/iterators": 97, - "../internals/to-indexed-object": 152, - }, - ], - 180: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var IndexedObject = _dereq_("../internals/indexed-object"); - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var arrayMethodIsStrict = _dereq_( - "../internals/array-method-is-strict", - ); - var nativeJoin = [].join; - var ES3_STRINGS = IndexedObject != Object; - var STRICT_METHOD = arrayMethodIsStrict("join", ","); - // `Array.prototype.join` method - // https://tc39.github.io/ecma262/#sec-array.prototype.join - $( - { - target: "Array", - proto: true, - forced: ES3_STRINGS || !STRICT_METHOD, - }, - { - join: function join(separator) { - return nativeJoin.call( - toIndexedObject(this), - separator === undefined ? "," : separator, - ); - }, - }, - ); - }, - { - "../internals/array-method-is-strict": 40, - "../internals/export": 68, - "../internals/indexed-object": 84, - "../internals/to-indexed-object": 152, - }, - ], - 181: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var lastIndexOf = _dereq_("../internals/array-last-index-of"); - // `Array.prototype.lastIndexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof - $( - { - target: "Array", - proto: true, - forced: lastIndexOf !== [].lastIndexOf, - }, - { - lastIndexOf: lastIndexOf, - }, - ); - }, - { - "../internals/array-last-index-of": 38, - "../internals/export": 68, - }, - ], - 182: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $map = _dereq_("../internals/array-iteration").map; - var arrayMethodHasSpeciesSupport = _dereq_( - "../internals/array-method-has-species-support", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map"); - // FF49- issue - var USES_TO_LENGTH = arrayMethodUsesToLength("map"); - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - // with adding support of @@species - $( - { - target: "Array", - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, - }, - { - map: function map(callbackfn /* , thisArg */) { - return $map( - this, - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/array-iteration": 37, - "../internals/array-method-has-species-support": 39, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 183: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var isObject = _dereq_("../internals/is-object"); - var isArray = _dereq_("../internals/is-array"); - var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); - var toLength = _dereq_("../internals/to-length"); - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var createProperty = _dereq_("../internals/create-property"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var arrayMethodHasSpeciesSupport = _dereq_( - "../internals/array-method-has-species-support", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice"); - var USES_TO_LENGTH = arrayMethodUsesToLength("slice", { - ACCESSORS: true, - 0: 0, - 1: 2, - }); - var SPECIES = wellKnownSymbol("species"); - var nativeSlice = [].slice; - var max = Math.max; - // `Array.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-array.prototype.slice - // fallback for not array-like ES3 strings and DOM objects - $( - { - target: "Array", - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, - }, - { - slice: function slice(start, end) { - var O = toIndexedObject(this); - var length = toLength(O.length); - var k = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex( - end === undefined ? length : end, - length, - ); - // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible - var Constructor, result, n; - if (isArray(O)) { - Constructor = O.constructor; - // cross-realm fallback - if ( - typeof Constructor == "function" && - (Constructor === Array || isArray(Constructor.prototype)) - ) { - Constructor = undefined; - } else if (isObject(Constructor)) { - Constructor = Constructor[SPECIES]; - if (Constructor === null) Constructor = undefined; - } - if (Constructor === Array || Constructor === undefined) { - return nativeSlice.call(O, k, fin); - } - } - result = new (Constructor === undefined ? Array : Constructor)( - max(fin - k, 0), - ); - for (n = 0; k < fin; k++, n++) - if (k in O) createProperty(result, n, O[k]); - result.length = n; - return result; - }, - }, - ); - }, - { - "../internals/array-method-has-species-support": 39, - "../internals/array-method-uses-to-length": 41, - "../internals/create-property": 58, - "../internals/export": 68, - "../internals/is-array": 90, - "../internals/is-object": 92, - "../internals/to-absolute-index": 150, - "../internals/to-indexed-object": 152, - "../internals/to-length": 154, - "../internals/well-known-symbol": 166, - }, - ], - 184: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $some = _dereq_("../internals/array-iteration").some; - var arrayMethodIsStrict = _dereq_( - "../internals/array-method-is-strict", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var STRICT_METHOD = arrayMethodIsStrict("some"); - var USES_TO_LENGTH = arrayMethodUsesToLength("some"); - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - $( - { - target: "Array", - proto: true, - forced: !STRICT_METHOD || !USES_TO_LENGTH, - }, - { - some: function some(callbackfn /* , thisArg */) { - return $some( - this, - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/array-iteration": 37, - "../internals/array-method-is-strict": 40, - "../internals/array-method-uses-to-length": 41, - "../internals/export": 68, - }, - ], - 185: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); - var toInteger = _dereq_("../internals/to-integer"); - var toLength = _dereq_("../internals/to-length"); - var toObject = _dereq_("../internals/to-object"); - var arraySpeciesCreate = _dereq_("../internals/array-species-create"); - var createProperty = _dereq_("../internals/create-property"); - var arrayMethodHasSpeciesSupport = _dereq_( - "../internals/array-method-has-species-support", - ); - var arrayMethodUsesToLength = _dereq_( - "../internals/array-method-uses-to-length", - ); - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice"); - var USES_TO_LENGTH = arrayMethodUsesToLength("splice", { - ACCESSORS: true, - 0: 0, - 1: 2, - }); - var max = Math.max; - var min = Math.min; - var MAX_SAFE_INTEGER = 9007199254740991; - var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = - "Maximum allowed length exceeded"; - // `Array.prototype.splice` method - // https://tc39.github.io/ecma262/#sec-array.prototype.splice - // with adding support of @@species - $( - { - target: "Array", - proto: true, - forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH, - }, - { - splice: function splice(start, deleteCount /* , ...items */) { - var O = toObject(this); - var len = toLength(O.length); - var actualStart = toAbsoluteIndex(start, len); - var argumentsLength = arguments.length; - var insertCount, actualDeleteCount, A, k, from, to; - if (argumentsLength === 0) { - insertCount = actualDeleteCount = 0; - } else if (argumentsLength === 1) { - insertCount = 0; - actualDeleteCount = len - actualStart; - } else { - insertCount = argumentsLength - 2; - actualDeleteCount = min( - max(toInteger(deleteCount), 0), - len - actualStart, - ); - } - if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { - throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); - } - A = arraySpeciesCreate(O, actualDeleteCount); - for (k = 0; k < actualDeleteCount; k++) { - from = actualStart + k; - if (from in O) createProperty(A, k, O[from]); - } - A.length = actualDeleteCount; - if (insertCount < actualDeleteCount) { - for (k = actualStart; k < len - actualDeleteCount; k++) { - from = k + actualDeleteCount; - to = k + insertCount; - if (from in O) O[to] = O[from]; - else delete O[to]; - } - for (k = len; k > len - actualDeleteCount + insertCount; k--) - delete O[k - 1]; - } else if (insertCount > actualDeleteCount) { - for (k = len - actualDeleteCount; k > actualStart; k--) { - from = k + actualDeleteCount - 1; - to = k + insertCount - 1; - if (from in O) O[to] = O[from]; - else delete O[to]; - } - } - for (k = 0; k < insertCount; k++) { - O[k + actualStart] = arguments[k + 2]; - } - O.length = len - actualDeleteCount + insertCount; - return A; - }, - }, - ); - }, - { - "../internals/array-method-has-species-support": 39, - "../internals/array-method-uses-to-length": 41, - "../internals/array-species-create": 43, - "../internals/create-property": 58, - "../internals/export": 68, - "../internals/to-absolute-index": 150, - "../internals/to-integer": 153, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 186: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var defineProperty = _dereq_("../internals/object-define-property").f; - var FunctionPrototype = Function.prototype; - var FunctionPrototypeToString = FunctionPrototype.toString; - var nameRE = /^\s*function ([^ (]*)/; - var NAME = "name"; - // Function instances `.name` property - // https://tc39.github.io/ecma262/#sec-function-instances-name - if (DESCRIPTORS && !(NAME in FunctionPrototype)) { - defineProperty(FunctionPrototype, NAME, { - configurable: true, - get: function () { - try { - return FunctionPrototypeToString.call(this).match(nameRE)[1]; - } catch (error) { - return ""; - } - }, - }); - } - }, - { - "../internals/descriptors": 61, - "../internals/object-define-property": 110, - }, - ], - 187: [ - function (_dereq_, module, exports) { - "use strict"; - var collection = _dereq_("../internals/collection"); - var collectionStrong = _dereq_("../internals/collection-strong"); - // `Map` constructor - // https://tc39.github.io/ecma262/#sec-map-objects - module.exports = collection( - "Map", - function (init) { - return function Map() { - return init(this, arguments.length ? arguments[0] : undefined); - }; - }, - collectionStrong, - ); - }, - { - "../internals/collection": 50, - "../internals/collection-strong": 48, - }, - ], - 188: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var $hypot = Math.hypot; - var abs = Math.abs; - var sqrt = Math.sqrt; - // Chrome 77 bug - // https://bugs.chromium.org/p/v8/issues/detail?id=9546 - var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; - // `Math.hypot` method - // https://tc39.github.io/ecma262/#sec-math.hypot - $( - { - target: "Math", - stat: true, - forced: BUGGY, - }, - { - hypot: function hypot(value1, value2) { - // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * sqrt(sum); - }, - }, - ); - }, - { - "../internals/export": 68, - }, - ], - 189: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var log = Math.log; - var LN2 = Math.LN2; - // `Math.log2` method - // https://tc39.github.io/ecma262/#sec-math.log2 - $( - { - target: "Math", - stat: true, - }, - { - log2: function log2(x) { - return log(x) / LN2; - }, - }, - ); - }, - { - "../internals/export": 68, - }, - ], - 190: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var sign = _dereq_("../internals/math-sign"); - // `Math.sign` method - // https://tc39.github.io/ecma262/#sec-math.sign - $( - { - target: "Math", - stat: true, - }, - { - sign: sign, - }, - ); - }, - { - "../internals/export": 68, - "../internals/math-sign": 98, - }, - ], - 191: [ - function (_dereq_, module, exports) { - "use strict"; - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var global = _dereq_("../internals/global"); - var isForced = _dereq_("../internals/is-forced"); - var redefine = _dereq_("../internals/redefine"); - var has = _dereq_("../internals/has"); - var classof = _dereq_("../internals/classof-raw"); - var inheritIfRequired = _dereq_("../internals/inherit-if-required"); - var toPrimitive = _dereq_("../internals/to-primitive"); - var fails = _dereq_("../internals/fails"); - var create = _dereq_("../internals/object-create"); - var getOwnPropertyNames = _dereq_( - "../internals/object-get-own-property-names", - ).f; - var getOwnPropertyDescriptor = _dereq_( - "../internals/object-get-own-property-descriptor", - ).f; - var defineProperty = _dereq_("../internals/object-define-property").f; - var trim = _dereq_("../internals/string-trim").trim; - var NUMBER = "Number"; - var NativeNumber = global[NUMBER]; - var NumberPrototype = NativeNumber.prototype; - // Opera ~12 has broken Object#toString - var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; - // `ToNumber` abstract operation - // https://tc39.github.io/ecma262/#sec-tonumber - var toNumber = function (argument) { - var it = toPrimitive(argument, false); - var first, third, radix, maxCode, digits, length, index, code; - if (typeof it == "string" && it.length > 2) { - it = trim(it); - first = it.charCodeAt(0); - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: - case 98: - radix = 2; - maxCode = 49; - break; - // fast equal of /^0b[01]+$/i - case 79: - case 111: - radix = 8; - maxCode = 55; - break; - // fast equal of /^0o[0-7]+$/i - default: - return +it; - } - digits = it.slice(2); - length = digits.length; - for (index = 0; index < length; index++) { - code = digits.charCodeAt(index); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } - return parseInt(digits, radix); - } - } - return +it; - }; - // `Number` constructor - // https://tc39.github.io/ecma262/#sec-number-constructor - if ( - isForced( - NUMBER, - !NativeNumber(" 0o1") || - !NativeNumber("0b1") || - NativeNumber("+0x1"), - ) - ) { - var NumberWrapper = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var dummy = this; - return dummy instanceof NumberWrapper && // check on 1..constructor(foo) case - (BROKEN_CLASSOF - ? fails(function () { - NumberPrototype.valueOf.call(dummy); - }) - : classof(dummy) != NUMBER) - ? inheritIfRequired( - new NativeNumber(toNumber(it)), - dummy, - NumberWrapper, - ) - : toNumber(it); - }; - for ( - var keys = DESCRIPTORS - ? getOwnPropertyNames(NativeNumber) - : // ES3: - ( - "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY," + // ES2015 (in case, if modules with ES2015 Number statics required before): - "EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER," + - "MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger" - ).split(","), - j = 0, - key; - keys.length > j; - j++ - ) { - if ( - has(NativeNumber, (key = keys[j])) && - !has(NumberWrapper, key) - ) { - defineProperty( - NumberWrapper, - key, - getOwnPropertyDescriptor(NativeNumber, key), - ); - } - } - NumberWrapper.prototype = NumberPrototype; - NumberPrototype.constructor = NumberWrapper; - redefine(global, NUMBER, NumberWrapper); - } - }, - { - "../internals/classof-raw": 46, - "../internals/descriptors": 61, - "../internals/fails": 69, - "../internals/global": 77, - "../internals/has": 78, - "../internals/inherit-if-required": 85, - "../internals/is-forced": 91, - "../internals/object-create": 108, - "../internals/object-define-property": 110, - "../internals/object-get-own-property-descriptor": 111, - "../internals/object-get-own-property-names": 113, - "../internals/redefine": 126, - "../internals/string-trim": 147, - "../internals/to-primitive": 158, - }, - ], - 192: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var numberIsFinite = _dereq_("../internals/number-is-finite"); - // `Number.isFinite` method - // https://tc39.github.io/ecma262/#sec-number.isfinite - $( - { - target: "Number", - stat: true, - }, - { - isFinite: numberIsFinite, - }, - ); - }, - { - "../internals/export": 68, - "../internals/number-is-finite": 106, - }, - ], - 193: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var toInteger = _dereq_("../internals/to-integer"); - var thisNumberValue = _dereq_("../internals/this-number-value"); - var repeat = _dereq_("../internals/string-repeat"); - var fails = _dereq_("../internals/fails"); - var nativeToFixed = (1).toFixed; - var floor = Math.floor; - var pow = function (x, n, acc) { - return n === 0 - ? acc - : n % 2 === 1 - ? pow(x, n - 1, acc * x) - : pow(x * x, n / 2, acc); - }; - var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } - return n; - }; - var FORCED = - (nativeToFixed && - ((0.00008).toFixed(3) !== "0.000" || - (0.9).toFixed(0) !== "1" || - (1.255).toFixed(2) !== "1.25" || - (1000000000000000100).toFixed(0) !== "1000000000000000128")) || - !fails(function () { - // V8 ~ Android 4.3- - nativeToFixed.call({}); - }); - // `Number.prototype.toFixed` method - // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed - $( - { - target: "Number", - proto: true, - forced: FORCED, - }, - { - // eslint-disable-next-line max-statements - toFixed: function toFixed(fractionDigits) { - var number = thisNumberValue(this); - var fractDigits = toInteger(fractionDigits); - var data = [0, 0, 0, 0, 0, 0]; - var sign = ""; - var result = "0"; - var e, z, j, k; - var multiply = function (n, c) { - var index = -1; - var c2 = c; - while (++index < 6) { - c2 += n * data[index]; - data[index] = c2 % 10000000; - c2 = floor(c2 / 10000000); - } - }; - var divide = function (n) { - var index = 6; - var c = 0; - while (--index >= 0) { - c += data[index]; - data[index] = floor(c / n); - c = (c % n) * 10000000; - } - }; - var dataToString = function () { - var index = 6; - var s = ""; - while (--index >= 0) { - if (s !== "" || index === 0 || data[index] !== 0) { - var t = String(data[index]); - s = s === "" ? t : s + repeat.call("0", 7 - t.length) + t; - } - } - return s; - }; - if (fractDigits < 0 || fractDigits > 20) - throw RangeError("Incorrect fraction digits"); - // eslint-disable-next-line no-self-compare - if (number != number) return "NaN"; - if (number <= -1e21 || number >= 1e21) return String(number); - if (number < 0) { - sign = "-"; - number = -number; - } - if (number > 1e-21) { - e = log(number * pow(2, 69, 1)) - 69; - z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1); - z *= 4503599627370496; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = fractDigits; - while (j >= 7) { - multiply(10000000, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - result = dataToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - result = dataToString() + repeat.call("0", fractDigits); - } - } - if (fractDigits > 0) { - k = result.length; - result = - sign + - (k <= fractDigits - ? "0." + repeat.call("0", fractDigits - k) + result - : result.slice(0, k - fractDigits) + - "." + - result.slice(k - fractDigits)); - } else { - result = sign + result; - } - return result; - }, - }, - ); - }, - { - "../internals/export": 68, - "../internals/fails": 69, - "../internals/string-repeat": 145, - "../internals/this-number-value": 149, - "../internals/to-integer": 153, - }, - ], - 194: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var assign = _dereq_("../internals/object-assign"); - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - $( - { - target: "Object", - stat: true, - forced: Object.assign !== assign, - }, - { - assign: assign, - }, - ); - }, - { - "../internals/export": 68, - "../internals/object-assign": 107, - }, - ], - 195: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var iterate = _dereq_("../internals/iterate"); - var createProperty = _dereq_("../internals/create-property"); - // `Object.fromEntries` method - // https://github.com/tc39/proposal-object-from-entries - $( - { - target: "Object", - stat: true, - }, - { - fromEntries: function fromEntries(iterable) { - var obj = {}; - iterate( - iterable, - function (k, v) { - createProperty(obj, k, v); - }, - undefined, - true, - ); - return obj; - }, - }, - ); - }, - { - "../internals/create-property": 58, - "../internals/export": 68, - "../internals/iterate": 95, - }, - ], - 196: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var fails = _dereq_("../internals/fails"); - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var nativeGetOwnPropertyDescriptor = _dereq_( - "../internals/object-get-own-property-descriptor", - ).f; - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var FAILS_ON_PRIMITIVES = fails(function () { - nativeGetOwnPropertyDescriptor(1); - }); - var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor - $( - { - target: "Object", - stat: true, - forced: FORCED, - sham: !DESCRIPTORS, - }, - { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor( - it, - key, - ) { - return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); - }, - }, - ); - }, - { - "../internals/descriptors": 61, - "../internals/export": 68, - "../internals/fails": 69, - "../internals/object-get-own-property-descriptor": 111, - "../internals/to-indexed-object": 152, - }, - ], - 197: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var fails = _dereq_("../internals/fails"); - var nativeGetOwnPropertyNames = _dereq_( - "../internals/object-get-own-property-names-external", - ).f; - var FAILS_ON_PRIMITIVES = fails(function () { - return !Object.getOwnPropertyNames(1); - }); - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - $( - { - target: "Object", - stat: true, - forced: FAILS_ON_PRIMITIVES, - }, - { - getOwnPropertyNames: nativeGetOwnPropertyNames, - }, - ); - }, - { - "../internals/export": 68, - "../internals/fails": 69, - "../internals/object-get-own-property-names-external": 112, - }, - ], - 198: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var fails = _dereq_("../internals/fails"); - var toObject = _dereq_("../internals/to-object"); - var nativeGetPrototypeOf = _dereq_( - "../internals/object-get-prototype-of", - ); - var CORRECT_PROTOTYPE_GETTER = _dereq_( - "../internals/correct-prototype-getter", - ); - var FAILS_ON_PRIMITIVES = fails(function () { - nativeGetPrototypeOf(1); - }); - // `Object.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.getprototypeof - $( - { - target: "Object", - stat: true, - forced: FAILS_ON_PRIMITIVES, - sham: !CORRECT_PROTOTYPE_GETTER, - }, - { - getPrototypeOf: function getPrototypeOf(it) { - return nativeGetPrototypeOf(toObject(it)); - }, - }, - ); - }, - { - "../internals/correct-prototype-getter": 53, - "../internals/export": 68, - "../internals/fails": 69, - "../internals/object-get-prototype-of": 115, - "../internals/to-object": 155, - }, - ], - 199: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var toObject = _dereq_("../internals/to-object"); - var nativeKeys = _dereq_("../internals/object-keys"); - var fails = _dereq_("../internals/fails"); - var FAILS_ON_PRIMITIVES = fails(function () { - nativeKeys(1); - }); - // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys - $( - { - target: "Object", - stat: true, - forced: FAILS_ON_PRIMITIVES, - }, - { - keys: function keys(it) { - return nativeKeys(toObject(it)); - }, - }, - ); - }, - { - "../internals/export": 68, - "../internals/fails": 69, - "../internals/object-keys": 117, - "../internals/to-object": 155, - }, - ], - 200: [ - function (_dereq_, module, exports) { - var TO_STRING_TAG_SUPPORT = _dereq_( - "../internals/to-string-tag-support", - ); - var redefine = _dereq_("../internals/redefine"); - var toString = _dereq_("../internals/object-to-string"); - // `Object.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-object.prototype.tostring - if (!TO_STRING_TAG_SUPPORT) { - redefine(Object.prototype, "toString", toString, { - unsafe: true, - }); - } - }, - { - "../internals/object-to-string": 120, - "../internals/redefine": 126, - "../internals/to-string-tag-support": 159, - }, - ], - 201: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var IS_PURE = _dereq_("../internals/is-pure"); - var global = _dereq_("../internals/global"); - var getBuiltIn = _dereq_("../internals/get-built-in"); - var NativePromise = _dereq_( - "../internals/native-promise-constructor", - ); - var redefine = _dereq_("../internals/redefine"); - var redefineAll = _dereq_("../internals/redefine-all"); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var setSpecies = _dereq_("../internals/set-species"); - var isObject = _dereq_("../internals/is-object"); - var aFunction = _dereq_("../internals/a-function"); - var anInstance = _dereq_("../internals/an-instance"); - var classof = _dereq_("../internals/classof-raw"); - var inspectSource = _dereq_("../internals/inspect-source"); - var iterate = _dereq_("../internals/iterate"); - var checkCorrectnessOfIteration = _dereq_( - "../internals/check-correctness-of-iteration", - ); - var speciesConstructor = _dereq_("../internals/species-constructor"); - var task = _dereq_("../internals/task").set; - var microtask = _dereq_("../internals/microtask"); - var promiseResolve = _dereq_("../internals/promise-resolve"); - var hostReportErrors = _dereq_("../internals/host-report-errors"); - var newPromiseCapabilityModule = _dereq_( - "../internals/new-promise-capability", - ); - var perform = _dereq_("../internals/perform"); - var InternalStateModule = _dereq_("../internals/internal-state"); - var isForced = _dereq_("../internals/is-forced"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var V8_VERSION = _dereq_("../internals/engine-v8-version"); - var SPECIES = wellKnownSymbol("species"); - var PROMISE = "Promise"; - var getInternalState = InternalStateModule.get; - var setInternalState = InternalStateModule.set; - var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); - var PromiseConstructor = NativePromise; - var TypeError = global.TypeError; - var document = global.document; - var process = global.process; - var $fetch = getBuiltIn("fetch"); - var newPromiseCapability = newPromiseCapabilityModule.f; - var newGenericPromiseCapability = newPromiseCapability; - var IS_NODE = classof(process) == "process"; - var DISPATCH_EVENT = !!( - document && - document.createEvent && - global.dispatchEvent - ); - var UNHANDLED_REJECTION = "unhandledrejection"; - var REJECTION_HANDLED = "rejectionhandled"; - var PENDING = 0; - var FULFILLED = 1; - var REJECTED = 2; - var HANDLED = 1; - var UNHANDLED = 2; - var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; - var FORCED = isForced(PROMISE, function () { - var GLOBAL_CORE_JS_PROMISE = - inspectSource(PromiseConstructor) !== String(PromiseConstructor); - if (!GLOBAL_CORE_JS_PROMISE) { - // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // We can't detect it synchronously, so just check versions - if (V8_VERSION === 66) return true; - // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test - if (!IS_NODE && typeof PromiseRejectionEvent != "function") - return true; - } // We need Promise#finally in the pure version for preventing prototype pollution - - if (IS_PURE && !PromiseConstructor.prototype["finally"]) - return true; - // We can't use @@species feature detection in V8 since it causes - // deoptimization and performance degradation - // https://github.com/zloirock/core-js/issues/679 - if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) - return false; - // Detect correctness of subclassing with @@species support - var promise = PromiseConstructor.resolve(1); - var FakePromise = function (exec) { - exec( - function () { - /* empty */ - }, - function () { - /* empty */ - }, - ); - }; - var constructor = (promise.constructor = {}); - constructor[SPECIES] = FakePromise; - return !( - promise.then(function () { - /* empty */ - }) instanceof FakePromise - ); - }); - var INCORRECT_ITERATION = - FORCED || - !checkCorrectnessOfIteration(function (iterable) { - PromiseConstructor.all(iterable)["catch"](function () { - /* empty */ - }); - }); - // helpers - var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == "function" - ? then - : false; - }; - var notify = function (promise, state, isReject) { - if (state.notified) return; - state.notified = true; - var chain = state.reactions; - microtask(function () { - var value = state.value; - var ok = state.state == FULFILLED; - var index = 0; - // variable length - can't use forEach - while (chain.length > index) { - var reaction = chain[index++]; - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (state.rejection === UNHANDLED) - onHandleUnhandled(promise, state); - state.rejection = HANDLED; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // can throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError("Promise-chain cycle")); - } else if ((then = isThenable(result))) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (error) { - if (domain && !exited) domain.exit(); - reject(error); - } - } - state.reactions = []; - state.notified = false; - if (isReject && !state.rejection) onUnhandled(promise, state); - }); - }; - var dispatchEvent = function (name, promise, reason) { - var event, handler; - if (DISPATCH_EVENT) { - event = document.createEvent("Event"); - event.promise = promise; - event.reason = reason; - event.initEvent(name, false, true); - global.dispatchEvent(event); - } else - event = { - promise: promise, - reason: reason, - }; - if ((handler = global["on" + name])) handler(event); - else if (name === UNHANDLED_REJECTION) - hostReportErrors("Unhandled promise rejection", reason); - }; - var onUnhandled = function (promise, state) { - task.call(global, function () { - var value = state.value; - var IS_UNHANDLED = isUnhandled(state); - var result; - if (IS_UNHANDLED) { - result = perform(function () { - if (IS_NODE) { - process.emit("unhandledRejection", value, promise); - } else dispatchEvent(UNHANDLED_REJECTION, promise, value); - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - state.rejection = - IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; - if (result.error) throw result.value; - } - }); - }; - var isUnhandled = function (state) { - return state.rejection !== HANDLED && !state.parent; - }; - var onHandleUnhandled = function (promise, state) { - task.call(global, function () { - if (IS_NODE) { - process.emit("rejectionHandled", promise); - } else dispatchEvent(REJECTION_HANDLED, promise, state.value); - }); - }; - var bind = function (fn, promise, state, unwrap) { - return function (value) { - fn(promise, state, value, unwrap); - }; - }; - var internalReject = function (promise, state, value, unwrap) { - if (state.done) return; - state.done = true; - if (unwrap) state = unwrap; - state.value = value; - state.state = REJECTED; - notify(promise, state, true); - }; - var internalResolve = function (promise, state, value, unwrap) { - if (state.done) return; - state.done = true; - if (unwrap) state = unwrap; - try { - if (promise === value) - throw TypeError("Promise can't be resolved itself"); - var then = isThenable(value); - if (then) { - microtask(function () { - var wrapper = { - done: false, - }; - try { - then.call( - value, - bind(internalResolve, promise, wrapper, state), - bind(internalReject, promise, wrapper, state), - ); - } catch (error) { - internalReject(promise, wrapper, error, state); - } - }); - } else { - state.value = value; - state.state = FULFILLED; - notify(promise, state, false); - } - } catch (error) { - internalReject( - promise, - { - done: false, - }, - error, - state, - ); - } - }; - // constructor polyfill - if (FORCED) { - // 25.4.3.1 Promise(executor) - PromiseConstructor = function Promise(executor) { - anInstance(this, PromiseConstructor, PROMISE); - aFunction(executor); - Internal.call(this); - var state = getInternalState(this); - try { - executor( - bind(internalResolve, this, state), - bind(internalReject, this, state), - ); - } catch (error) { - internalReject(this, state, error); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - setInternalState(this, { - type: PROMISE, - done: false, - notified: false, - parent: false, - reactions: [], - rejection: false, - state: PENDING, - value: undefined, - }); - }; - Internal.prototype = redefineAll(PromiseConstructor.prototype, { - // `Promise.prototype.then` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.then - then: function then(onFulfilled, onRejected) { - var state = getInternalPromiseState(this); - var reaction = newPromiseCapability( - speciesConstructor(this, PromiseConstructor), - ); - reaction.ok = - typeof onFulfilled == "function" ? onFulfilled : true; - reaction.fail = typeof onRejected == "function" && onRejected; - reaction.domain = IS_NODE ? process.domain : undefined; - state.parent = true; - state.reactions.push(reaction); - if (state.state != PENDING) notify(this, state, false); - return reaction.promise; - }, - // `Promise.prototype.catch` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.catch - catch: function (onRejected) { - return this.then(undefined, onRejected); - }, - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - var state = getInternalState(promise); - this.promise = promise; - this.resolve = bind(internalResolve, promise, state); - this.reject = bind(internalReject, promise, state); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === PromiseConstructor || C === PromiseWrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; - if (!IS_PURE && typeof NativePromise == "function") { - nativeThen = NativePromise.prototype.then; - // wrap native Promise#then for native async functions - redefine( - NativePromise.prototype, - "then", - function then(onFulfilled, onRejected) { - var that = this; - return new PromiseConstructor(function (resolve, reject) { - nativeThen.call(that, resolve, reject); - }).then(onFulfilled, onRejected); - // https://github.com/zloirock/core-js/issues/640 - }, - { - unsafe: true, - }, - ); - // wrap fetch result - if (typeof $fetch == "function") - $( - { - global: true, - enumerable: true, - forced: true, - }, - { - // eslint-disable-next-line no-unused-vars - fetch: function fetch(input /* , init */) { - return promiseResolve( - PromiseConstructor, - $fetch.apply(global, arguments), - ); - }, - }, - ); - } - } - $( - { - global: true, - wrap: true, - forced: FORCED, - }, - { - Promise: PromiseConstructor, - }, - ); - setToStringTag(PromiseConstructor, PROMISE, false, true); - setSpecies(PROMISE); - PromiseWrapper = getBuiltIn(PROMISE); - // statics - $( - { - target: PROMISE, - stat: true, - forced: FORCED, - }, - { - // `Promise.reject` method - // https://tc39.github.io/ecma262/#sec-promise.reject - reject: function reject(r) { - var capability = newPromiseCapability(this); - capability.reject.call(undefined, r); - return capability.promise; - }, - }, - ); - $( - { - target: PROMISE, - stat: true, - forced: IS_PURE || FORCED, - }, - { - // `Promise.resolve` method - // https://tc39.github.io/ecma262/#sec-promise.resolve - resolve: function resolve(x) { - return promiseResolve( - IS_PURE && this === PromiseWrapper - ? PromiseConstructor - : this, - x, - ); - }, - }, - ); - $( - { - target: PROMISE, - stat: true, - forced: INCORRECT_ITERATION, - }, - { - // `Promise.all` method - // https://tc39.github.io/ecma262/#sec-promise.all - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var $promiseResolve = aFunction(C.resolve); - var values = []; - var counter = 0; - var remaining = 1; - iterate(iterable, function (promise) { - var index = counter++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - $promiseResolve.call(C, promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.error) reject(result.value); - return capability.promise; - }, - // `Promise.race` method - // https://tc39.github.io/ecma262/#sec-promise.race - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - var $promiseResolve = aFunction(C.resolve); - iterate(iterable, function (promise) { - $promiseResolve - .call(C, promise) - .then(capability.resolve, reject); - }); - }); - if (result.error) reject(result.value); - return capability.promise; - }, - }, - ); - }, - { - "../internals/a-function": 23, - "../internals/an-instance": 27, - "../internals/check-correctness-of-iteration": 45, - "../internals/classof-raw": 46, - "../internals/engine-v8-version": 66, - "../internals/export": 68, - "../internals/get-built-in": 74, - "../internals/global": 77, - "../internals/host-report-errors": 80, - "../internals/inspect-source": 86, - "../internals/internal-state": 88, - "../internals/is-forced": 91, - "../internals/is-object": 92, - "../internals/is-pure": 93, - "../internals/iterate": 95, - "../internals/microtask": 99, - "../internals/native-promise-constructor": 100, - "../internals/new-promise-capability": 104, - "../internals/perform": 123, - "../internals/promise-resolve": 124, - "../internals/redefine": 126, - "../internals/redefine-all": 125, - "../internals/set-species": 134, - "../internals/set-to-string-tag": 135, - "../internals/species-constructor": 139, - "../internals/task": 148, - "../internals/well-known-symbol": 166, - }, - ], - 202: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var getBuiltIn = _dereq_("../internals/get-built-in"); - var aFunction = _dereq_("../internals/a-function"); - var anObject = _dereq_("../internals/an-object"); - var isObject = _dereq_("../internals/is-object"); - var create = _dereq_("../internals/object-create"); - var bind = _dereq_("../internals/function-bind"); - var fails = _dereq_("../internals/fails"); - var nativeConstruct = getBuiltIn("Reflect", "construct"); - // `Reflect.construct` method - // https://tc39.github.io/ecma262/#sec-reflect.construct - // MS Edge supports only 2 arguments and argumentsList argument is optional - // FF Nightly sets third argument as `new.target`, but does not create `this` from it - var NEW_TARGET_BUG = fails(function () { - function F() { - /* empty */ - } - return !( - nativeConstruct( - function () { - /* empty */ - }, - [], - F, - ) instanceof F - ); - }); - var ARGS_BUG = !fails(function () { - nativeConstruct(function () { - /* empty */ - }); - }); - var FORCED = NEW_TARGET_BUG || ARGS_BUG; - $( - { - target: "Reflect", - stat: true, - forced: FORCED, - sham: FORCED, - }, - { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = - arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) - return nativeConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: - return new Target(); - case 1: - return new Target(args[0]); - case 2: - return new Target(args[0], args[1]); - case 3: - return new Target(args[0], args[1], args[2]); - case 4: - return new Target(args[0], args[1], args[2], args[3]); - } // w/o altered newTarget, lot of arguments case - - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } // with altered newTarget, not support built-in constructors - - var proto = newTarget.prototype; - var instance = create( - isObject(proto) ? proto : Object.prototype, - ); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - }, - }, - ); - }, - { - "../internals/a-function": 23, - "../internals/an-object": 28, - "../internals/export": 68, - "../internals/fails": 69, - "../internals/function-bind": 73, - "../internals/get-built-in": 74, - "../internals/is-object": 92, - "../internals/object-create": 108, - }, - ], - 203: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var isObject = _dereq_("../internals/is-object"); - var anObject = _dereq_("../internals/an-object"); - var has = _dereq_("../internals/has"); - var getOwnPropertyDescriptorModule = _dereq_( - "../internals/object-get-own-property-descriptor", - ); - var getPrototypeOf = _dereq_("../internals/object-get-prototype-of"); - // `Reflect.get` method - // https://tc39.github.io/ecma262/#sec-reflect.get - function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var descriptor, prototype; - if (anObject(target) === receiver) return target[propertyKey]; - if ( - (descriptor = getOwnPropertyDescriptorModule.f( - target, - propertyKey, - )) - ) - return has(descriptor, "value") - ? descriptor.value - : descriptor.get === undefined - ? undefined - : descriptor.get.call(receiver); - if (isObject((prototype = getPrototypeOf(target)))) - return get(prototype, propertyKey, receiver); - } - $( - { - target: "Reflect", - stat: true, - }, - { - get: get, - }, - ); - }, - { - "../internals/an-object": 28, - "../internals/export": 68, - "../internals/has": 78, - "../internals/is-object": 92, - "../internals/object-get-own-property-descriptor": 111, - "../internals/object-get-prototype-of": 115, - }, - ], - 204: [ - function (_dereq_, module, exports) { - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var global = _dereq_("../internals/global"); - var isForced = _dereq_("../internals/is-forced"); - var inheritIfRequired = _dereq_("../internals/inherit-if-required"); - var defineProperty = _dereq_("../internals/object-define-property").f; - var getOwnPropertyNames = _dereq_( - "../internals/object-get-own-property-names", - ).f; - var isRegExp = _dereq_("../internals/is-regexp"); - var getFlags = _dereq_("../internals/regexp-flags"); - var stickyHelpers = _dereq_("../internals/regexp-sticky-helpers"); - var redefine = _dereq_("../internals/redefine"); - var fails = _dereq_("../internals/fails"); - var setInternalState = _dereq_("../internals/internal-state").set; - var setSpecies = _dereq_("../internals/set-species"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var MATCH = wellKnownSymbol("match"); - var NativeRegExp = global.RegExp; - var RegExpPrototype = NativeRegExp.prototype; - var re1 = /a/g; - var re2 = /a/g; - // "new" should create a new object, old webkit bug - var CORRECT_NEW = new NativeRegExp(re1) !== re1; - var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; - var FORCED = - DESCRIPTORS && - isForced( - "RegExp", - !CORRECT_NEW || - UNSUPPORTED_Y || - fails(function () { - re2[MATCH] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return ( - NativeRegExp(re1) != re1 || - NativeRegExp(re2) == re2 || - NativeRegExp(re1, "i") != "/a/i" - ); - }), - ); - // `RegExp` constructor - // https://tc39.github.io/ecma262/#sec-regexp-constructor - if (FORCED) { - var RegExpWrapper = function RegExp(pattern, flags) { - var thisIsRegExp = this instanceof RegExpWrapper; - var patternIsRegExp = isRegExp(pattern); - var flagsAreUndefined = flags === undefined; - var sticky; - if ( - !thisIsRegExp && - patternIsRegExp && - pattern.constructor === RegExpWrapper && - flagsAreUndefined - ) { - return pattern; - } - if (CORRECT_NEW) { - if (patternIsRegExp && !flagsAreUndefined) - pattern = pattern.source; - } else if (pattern instanceof RegExpWrapper) { - if (flagsAreUndefined) flags = getFlags.call(pattern); - pattern = pattern.source; - } - if (UNSUPPORTED_Y) { - sticky = !!flags && flags.indexOf("y") > -1; - if (sticky) flags = flags.replace(/y/g, ""); - } - var result = inheritIfRequired( - CORRECT_NEW - ? new NativeRegExp(pattern, flags) - : NativeRegExp(pattern, flags), - thisIsRegExp ? this : RegExpPrototype, - RegExpWrapper, - ); - if (UNSUPPORTED_Y && sticky) - setInternalState(result, { - sticky: sticky, - }); - return result; - }; - var proxy = function (key) { - key in RegExpWrapper || - defineProperty(RegExpWrapper, key, { - configurable: true, - get: function () { - return NativeRegExp[key]; - }, - set: function (it) { - NativeRegExp[key] = it; - }, - }); - }; - var keys = getOwnPropertyNames(NativeRegExp); - var index = 0; - while (keys.length > index) proxy(keys[index++]); - RegExpPrototype.constructor = RegExpWrapper; - RegExpWrapper.prototype = RegExpPrototype; - redefine(global, "RegExp", RegExpWrapper); - } // https://tc39.github.io/ecma262/#sec-get-regexp-@@species - - setSpecies("RegExp"); - }, - { - "../internals/descriptors": 61, - "../internals/fails": 69, - "../internals/global": 77, - "../internals/inherit-if-required": 85, - "../internals/internal-state": 88, - "../internals/is-forced": 91, - "../internals/is-regexp": 94, - "../internals/object-define-property": 110, - "../internals/object-get-own-property-names": 113, - "../internals/redefine": 126, - "../internals/regexp-flags": 129, - "../internals/regexp-sticky-helpers": 130, - "../internals/set-species": 134, - "../internals/well-known-symbol": 166, - }, - ], - 205: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var exec = _dereq_("../internals/regexp-exec"); - $( - { - target: "RegExp", - proto: true, - forced: /./.exec !== exec, - }, - { - exec: exec, - }, - ); - }, - { - "../internals/export": 68, - "../internals/regexp-exec": 128, - }, - ], - 206: [ - function (_dereq_, module, exports) { - "use strict"; - var redefine = _dereq_("../internals/redefine"); - var anObject = _dereq_("../internals/an-object"); - var fails = _dereq_("../internals/fails"); - var flags = _dereq_("../internals/regexp-flags"); - var TO_STRING = "toString"; - var RegExpPrototype = RegExp.prototype; - var nativeToString = RegExpPrototype[TO_STRING]; - var NOT_GENERIC = fails(function () { - return ( - nativeToString.call({ - source: "a", - flags: "b", - }) != "/a/b" - ); - }); - // FF44- RegExp#toString has a wrong name - var INCORRECT_NAME = nativeToString.name != TO_STRING; - // `RegExp.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring - if (NOT_GENERIC || INCORRECT_NAME) { - redefine( - RegExp.prototype, - TO_STRING, - function toString() { - var R = anObject(this); - var p = String(R.source); - var rf = R.flags; - var f = String( - rf === undefined && - R instanceof RegExp && - !("flags" in RegExpPrototype) - ? flags.call(R) - : rf, - ); - return "/" + p + "/" + f; - }, - { - unsafe: true, - }, - ); - } - }, - { - "../internals/an-object": 28, - "../internals/fails": 69, - "../internals/redefine": 126, - "../internals/regexp-flags": 129, - }, - ], - 207: [ - function (_dereq_, module, exports) { - "use strict"; - var collection = _dereq_("../internals/collection"); - var collectionStrong = _dereq_("../internals/collection-strong"); - // `Set` constructor - // https://tc39.github.io/ecma262/#sec-set-objects - module.exports = collection( - "Set", - function (init) { - return function Set() { - return init(this, arguments.length ? arguments[0] : undefined); - }; - }, - collectionStrong, - ); - }, - { - "../internals/collection": 50, - "../internals/collection-strong": 48, - }, - ], - 208: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var getOwnPropertyDescriptor = _dereq_( - "../internals/object-get-own-property-descriptor", - ).f; - var toLength = _dereq_("../internals/to-length"); - var notARegExp = _dereq_("../internals/not-a-regexp"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var correctIsRegExpLogic = _dereq_( - "../internals/correct-is-regexp-logic", - ); - var IS_PURE = _dereq_("../internals/is-pure"); - var nativeEndsWith = "".endsWith; - var min = Math.min; - var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("endsWith"); - // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG = - !IS_PURE && - !CORRECT_IS_REGEXP_LOGIC && - !!(function () { - var descriptor = getOwnPropertyDescriptor( - String.prototype, - "endsWith", - ); - return descriptor && !descriptor.writable; - })(); - // `String.prototype.endsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.endswith - $( - { - target: "String", - proto: true, - forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC, - }, - { - endsWith: function endsWith( - searchString /* , endPosition = @length */, - ) { - var that = String(requireObjectCoercible(this)); - notARegExp(searchString); - var endPosition = - arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = - endPosition === undefined - ? len - : min(toLength(endPosition), len); - var search = String(searchString); - return nativeEndsWith - ? nativeEndsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - }, - }, - ); - }, - { - "../internals/correct-is-regexp-logic": 52, - "../internals/export": 68, - "../internals/is-pure": 93, - "../internals/not-a-regexp": 105, - "../internals/object-get-own-property-descriptor": 111, - "../internals/require-object-coercible": 131, - "../internals/to-length": 154, - }, - ], - 209: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var notARegExp = _dereq_("../internals/not-a-regexp"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var correctIsRegExpLogic = _dereq_( - "../internals/correct-is-regexp-logic", - ); - // `String.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-string.prototype.includes - $( - { - target: "String", - proto: true, - forced: !correctIsRegExpLogic("includes"), - }, - { - includes: function includes(searchString /* , position = 0 */) { - return !!~String(requireObjectCoercible(this)).indexOf( - notARegExp(searchString), - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/correct-is-regexp-logic": 52, - "../internals/export": 68, - "../internals/not-a-regexp": 105, - "../internals/require-object-coercible": 131, - }, - ], - 210: [ - function (_dereq_, module, exports) { - "use strict"; - var charAt = _dereq_("../internals/string-multibyte").charAt; - var InternalStateModule = _dereq_("../internals/internal-state"); - var defineIterator = _dereq_("../internals/define-iterator"); - var STRING_ITERATOR = "String Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - // `String.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator - defineIterator( - String, - "String", - function (iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: String(iterated), - index: 0, - }); - // `%StringIteratorPrototype%.next` method - // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next - }, - function next() { - var state = getInternalState(this); - var string = state.string; - var index = state.index; - var point; - if (index >= string.length) - return { - value: undefined, - done: true, - }; - point = charAt(string, index); - state.index += point.length; - return { - value: point, - done: false, - }; - }, - ); - }, - { - "../internals/define-iterator": 59, - "../internals/internal-state": 88, - "../internals/string-multibyte": 141, - }, - ], - 211: [ - function (_dereq_, module, exports) { - "use strict"; - var fixRegExpWellKnownSymbolLogic = _dereq_( - "../internals/fix-regexp-well-known-symbol-logic", - ); - var anObject = _dereq_("../internals/an-object"); - var toLength = _dereq_("../internals/to-length"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var advanceStringIndex = _dereq_("../internals/advance-string-index"); - var regExpExec = _dereq_("../internals/regexp-exec-abstract"); - // @@match logic - fixRegExpWellKnownSymbolLogic( - "match", - 1, - function (MATCH, nativeMatch, maybeCallNative) { - return [ - // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match - function match(regexp) { - var O = requireObjectCoercible(this); - var matcher = regexp == undefined ? undefined : regexp[MATCH]; - return matcher !== undefined - ? matcher.call(regexp, O) - : new RegExp(regexp)[MATCH](String(O)); - }, - // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match - function (regexp) { - var res = maybeCallNative(nativeMatch, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - if (!rx.global) return regExpExec(rx, S); - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - var A = []; - var n = 0; - var result; - while ((result = regExpExec(rx, S)) !== null) { - var matchStr = String(result[0]); - A[n] = matchStr; - if (matchStr === "") - rx.lastIndex = advanceStringIndex( - S, - toLength(rx.lastIndex), - fullUnicode, - ); - n++; - } - return n === 0 ? null : A; - }, - ]; - }, - ); - }, - { - "../internals/advance-string-index": 26, - "../internals/an-object": 28, - "../internals/fix-regexp-well-known-symbol-logic": 70, - "../internals/regexp-exec-abstract": 127, - "../internals/require-object-coercible": 131, - "../internals/to-length": 154, - }, - ], - 212: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $padStart = _dereq_("../internals/string-pad").start; - var WEBKIT_BUG = _dereq_("../internals/string-pad-webkit-bug"); - // `String.prototype.padStart` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padstart - $( - { - target: "String", - proto: true, - forced: WEBKIT_BUG, - }, - { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $padStart( - this, - maxLength, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - }, - ); - }, - { - "../internals/export": 68, - "../internals/string-pad": 143, - "../internals/string-pad-webkit-bug": 142, - }, - ], - 213: [ - function (_dereq_, module, exports) { - var $ = _dereq_("../internals/export"); - var repeat = _dereq_("../internals/string-repeat"); - // `String.prototype.repeat` method - // https://tc39.github.io/ecma262/#sec-string.prototype.repeat - $( - { - target: "String", - proto: true, - }, - { - repeat: repeat, - }, - ); - }, - { - "../internals/export": 68, - "../internals/string-repeat": 145, - }, - ], - 214: [ - function (_dereq_, module, exports) { - "use strict"; - var fixRegExpWellKnownSymbolLogic = _dereq_( - "../internals/fix-regexp-well-known-symbol-logic", - ); - var anObject = _dereq_("../internals/an-object"); - var toObject = _dereq_("../internals/to-object"); - var toLength = _dereq_("../internals/to-length"); - var toInteger = _dereq_("../internals/to-integer"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var advanceStringIndex = _dereq_("../internals/advance-string-index"); - var regExpExec = _dereq_("../internals/regexp-exec-abstract"); - var max = Math.max; - var min = Math.min; - var floor = Math.floor; - var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; - var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; - var maybeToString = function (it) { - return it === undefined ? it : String(it); - }; - // @@replace logic - fixRegExpWellKnownSymbolLogic( - "replace", - 2, - function (REPLACE, nativeReplace, maybeCallNative, reason) { - var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = - reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE; - var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0; - var UNSAFE_SUBSTITUTE = - REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0"; - return [ - // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = requireObjectCoercible(this); - var replacer = - searchValue == undefined ? undefined : searchValue[REPLACE]; - return replacer !== undefined - ? replacer.call(searchValue, O, replaceValue) - : nativeReplace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - if ( - (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && - REPLACE_KEEPS_$0) || - (typeof replaceValue === "string" && - replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1) - ) { - var res = maybeCallNative( - nativeReplace, - regexp, - this, - replaceValue, - ); - if (res.done) return res.value; - } - var rx = anObject(regexp); - var S = String(this); - var functionalReplace = typeof replaceValue === "function"; - if (!functionalReplace) replaceValue = String(replaceValue); - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = []; - while (true) { - var result = regExpExec(rx, S); - if (result === null) break; - results.push(result); - if (!global) break; - var matchStr = String(result[0]); - if (matchStr === "") - rx.lastIndex = advanceStringIndex( - S, - toLength(rx.lastIndex), - fullUnicode, - ); - } - var accumulatedResult = ""; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - var matched = String(result[0]); - var position = max( - min(toInteger(result.index), S.length), - 0, - ); - var captures = []; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) - captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [matched].concat( - captures, - position, - S, - ); - if (namedCaptures !== undefined) - replacerArgs.push(namedCaptures); - var replacement = String( - replaceValue.apply(undefined, replacerArgs), - ); - } else { - replacement = getSubstitution( - matched, - S, - position, - captures, - namedCaptures, - replaceValue, - ); - } - if (position >= nextSourcePosition) { - accumulatedResult += - S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - }, - ]; - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution( - matched, - str, - position, - captures, - namedCaptures, - replacement, - ) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return nativeReplace.call( - replacement, - symbols, - function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case "$": - return "$"; - case "&": - return matched; - case "`": - return str.slice(0, position); - case "'": - return str.slice(tailPos); - case "<": - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: - // \d\d? - var n = +ch; - if (n === 0) return match; - if (n > m) { - var f = floor(n / 10); - if (f === 0) return match; - if (f <= m) - return captures[f - 1] === undefined - ? ch.charAt(1) - : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? "" : capture; - }, - ); - } - }, - ); - }, - { - "../internals/advance-string-index": 26, - "../internals/an-object": 28, - "../internals/fix-regexp-well-known-symbol-logic": 70, - "../internals/regexp-exec-abstract": 127, - "../internals/require-object-coercible": 131, - "../internals/to-integer": 153, - "../internals/to-length": 154, - "../internals/to-object": 155, - }, - ], - 215: [ - function (_dereq_, module, exports) { - "use strict"; - var fixRegExpWellKnownSymbolLogic = _dereq_( - "../internals/fix-regexp-well-known-symbol-logic", - ); - var anObject = _dereq_("../internals/an-object"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var sameValue = _dereq_("../internals/same-value"); - var regExpExec = _dereq_("../internals/regexp-exec-abstract"); - // @@search logic - fixRegExpWellKnownSymbolLogic( - "search", - 1, - function (SEARCH, nativeSearch, maybeCallNative) { - return [ - // `String.prototype.search` method - // https://tc39.github.io/ecma262/#sec-string.prototype.search - function search(regexp) { - var O = requireObjectCoercible(this); - var searcher = - regexp == undefined ? undefined : regexp[SEARCH]; - return searcher !== undefined - ? searcher.call(regexp, O) - : new RegExp(regexp)[SEARCH](String(O)); - }, - // `RegExp.prototype[@@search]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search - function (regexp) { - var res = maybeCallNative(nativeSearch, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - var previousLastIndex = rx.lastIndex; - if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; - var result = regExpExec(rx, S); - if (!sameValue(rx.lastIndex, previousLastIndex)) - rx.lastIndex = previousLastIndex; - return result === null ? -1 : result.index; - }, - ]; - }, - ); - }, - { - "../internals/an-object": 28, - "../internals/fix-regexp-well-known-symbol-logic": 70, - "../internals/regexp-exec-abstract": 127, - "../internals/require-object-coercible": 131, - "../internals/same-value": 132, - }, - ], - 216: [ - function (_dereq_, module, exports) { - "use strict"; - var fixRegExpWellKnownSymbolLogic = _dereq_( - "../internals/fix-regexp-well-known-symbol-logic", - ); - var isRegExp = _dereq_("../internals/is-regexp"); - var anObject = _dereq_("../internals/an-object"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var speciesConstructor = _dereq_("../internals/species-constructor"); - var advanceStringIndex = _dereq_("../internals/advance-string-index"); - var toLength = _dereq_("../internals/to-length"); - var callRegExpExec = _dereq_("../internals/regexp-exec-abstract"); - var regexpExec = _dereq_("../internals/regexp-exec"); - var fails = _dereq_("../internals/fails"); - var arrayPush = [].push; - var min = Math.min; - var MAX_UINT32 = 4294967295; - // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError - var SUPPORTS_Y = !fails(function () { - return !RegExp(MAX_UINT32, "y"); - }); - // @@split logic - fixRegExpWellKnownSymbolLogic( - "split", - 2, - function (SPLIT, nativeSplit, maybeCallNative) { - var internalSplit; - if ( - "abbc".split(/(b)*/)[1] == "c" || - "test".split(/(?:)/, -1).length != 4 || - "ab".split(/(?:ab)*/).length != 2 || - ".".split(/(.?)(.?)/).length != 4 || - ".".split(/()()/).length > 1 || - "".split(/.?/).length - ) { - // based on es5-shim implementation, need to rework it - internalSplit = function (separator, limit) { - var string = String(requireObjectCoercible(this)); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (separator === undefined) return [string]; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) { - return nativeSplit.call(string, separator, lim); - } - var output = []; - var flags = - (separator.ignoreCase ? "i" : "") + - (separator.multiline ? "m" : "") + - (separator.unicode ? "u" : "") + - (separator.sticky ? "y" : ""); - var lastLastIndex = 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + "g"); - var match, lastIndex, lastLength; - while ((match = regexpExec.call(separatorCopy, string))) { - lastIndex = separatorCopy.lastIndex; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - if (match.length > 1 && match.index < string.length) - arrayPush.apply(output, match.slice(1)); - lastLength = match[0].length; - lastLastIndex = lastIndex; - if (output.length >= lim) break; - } - if (separatorCopy.lastIndex === match.index) - separatorCopy.lastIndex++; // Avoid an infinite loop - } - if (lastLastIndex === string.length) { - if (lastLength || !separatorCopy.test("")) output.push(""); - } else output.push(string.slice(lastLastIndex)); - return output.length > lim ? output.slice(0, lim) : output; - }; - // Chakra, V8 - } else if ("0".split(undefined, 0).length) { - internalSplit = function (separator, limit) { - return separator === undefined && limit === 0 - ? [] - : nativeSplit.call(this, separator, limit); - }; - } else internalSplit = nativeSplit; - return [ - // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split - function split(separator, limit) { - var O = requireObjectCoercible(this); - var splitter = - separator == undefined ? undefined : separator[SPLIT]; - return splitter !== undefined - ? splitter.call(separator, O, limit) - : internalSplit.call(String(O), separator, limit); - }, - // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split - // - // NOTE: This cannot be properly polyfilled in engines that don't support - // the 'y' flag. - function (regexp, limit) { - var res = maybeCallNative( - internalSplit, - regexp, - this, - limit, - internalSplit !== nativeSplit, - ); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - var C = speciesConstructor(rx, RegExp); - var unicodeMatching = rx.unicode; - var flags = - (rx.ignoreCase ? "i" : "") + - (rx.multiline ? "m" : "") + - (rx.unicode ? "u" : "") + - (SUPPORTS_Y ? "y" : "g"); - // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. - var splitter = new C( - SUPPORTS_Y ? rx : "^(?:" + rx.source + ")", - flags, - ); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (S.length === 0) - return callRegExpExec(splitter, S) === null ? [S] : []; - var p = 0; - var q = 0; - var A = []; - while (q < S.length) { - splitter.lastIndex = SUPPORTS_Y ? q : 0; - var z = callRegExpExec( - splitter, - SUPPORTS_Y ? S : S.slice(q), - ); - var e; - if ( - z === null || - (e = min( - toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), - S.length, - )) === p - ) { - q = advanceStringIndex(S, q, unicodeMatching); - } else { - A.push(S.slice(p, q)); - if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); - if (A.length === lim) return A; - } - q = p = e; - } - } - A.push(S.slice(p)); - return A; - }, - ]; - }, - !SUPPORTS_Y, - ); - }, - { - "../internals/advance-string-index": 26, - "../internals/an-object": 28, - "../internals/fails": 69, - "../internals/fix-regexp-well-known-symbol-logic": 70, - "../internals/is-regexp": 94, - "../internals/regexp-exec": 128, - "../internals/regexp-exec-abstract": 127, - "../internals/require-object-coercible": 131, - "../internals/species-constructor": 139, - "../internals/to-length": 154, - }, - ], - 217: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var getOwnPropertyDescriptor = _dereq_( - "../internals/object-get-own-property-descriptor", - ).f; - var toLength = _dereq_("../internals/to-length"); - var notARegExp = _dereq_("../internals/not-a-regexp"); - var requireObjectCoercible = _dereq_( - "../internals/require-object-coercible", - ); - var correctIsRegExpLogic = _dereq_( - "../internals/correct-is-regexp-logic", - ); - var IS_PURE = _dereq_("../internals/is-pure"); - var nativeStartsWith = "".startsWith; - var min = Math.min; - var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith"); - // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG = - !IS_PURE && - !CORRECT_IS_REGEXP_LOGIC && - !!(function () { - var descriptor = getOwnPropertyDescriptor( - String.prototype, - "startsWith", - ); - return descriptor && !descriptor.writable; - })(); - // `String.prototype.startsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.startswith - $( - { - target: "String", - proto: true, - forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC, - }, - { - startsWith: function startsWith( - searchString /* , position = 0 */, - ) { - var that = String(requireObjectCoercible(this)); - notARegExp(searchString); - var index = toLength( - min( - arguments.length > 1 ? arguments[1] : undefined, - that.length, - ), - ); - var search = String(searchString); - return nativeStartsWith - ? nativeStartsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - }, - }, - ); - }, - { - "../internals/correct-is-regexp-logic": 52, - "../internals/export": 68, - "../internals/is-pure": 93, - "../internals/not-a-regexp": 105, - "../internals/object-get-own-property-descriptor": 111, - "../internals/require-object-coercible": 131, - "../internals/to-length": 154, - }, - ], - 218: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var createHTML = _dereq_("../internals/create-html"); - var forcedStringHTMLMethod = _dereq_( - "../internals/string-html-forced", - ); - // `String.prototype.sub` method - // https://tc39.github.io/ecma262/#sec-string.prototype.sub - $( - { - target: "String", - proto: true, - forced: forcedStringHTMLMethod("sub"), - }, - { - sub: function sub() { - return createHTML(this, "sub", "", ""); - }, - }, - ); - }, - { - "../internals/create-html": 54, - "../internals/export": 68, - "../internals/string-html-forced": 140, - }, - ], - 219: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var $trim = _dereq_("../internals/string-trim").trim; - var forcedStringTrimMethod = _dereq_( - "../internals/string-trim-forced", - ); - // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim - $( - { - target: "String", - proto: true, - forced: forcedStringTrimMethod("trim"), - }, - { - trim: function trim() { - return $trim(this); - }, - }, - ); - }, - { - "../internals/export": 68, - "../internals/string-trim": 147, - "../internals/string-trim-forced": 146, - }, - ], - 220: [ - function (_dereq_, module, exports) { - // `Symbol.prototype.description` getter - // https://tc39.github.io/ecma262/#sec-symbol.prototype.description - "use strict"; - var $ = _dereq_("../internals/export"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var global = _dereq_("../internals/global"); - var has = _dereq_("../internals/has"); - var isObject = _dereq_("../internals/is-object"); - var defineProperty = _dereq_("../internals/object-define-property").f; - var copyConstructorProperties = _dereq_( - "../internals/copy-constructor-properties", - ); - var NativeSymbol = global.Symbol; - if ( - DESCRIPTORS && - typeof NativeSymbol == "function" && - (!("description" in NativeSymbol.prototype) || // Safari 12 bug - NativeSymbol().description !== undefined) - ) { - var EmptyStringDescriptionStore = {}; - // wrap Symbol constructor for correct work with undefined description - var SymbolWrapper = function Symbol() { - var description = - arguments.length < 1 || arguments[0] === undefined - ? undefined - : String(arguments[0]); - var result = - this instanceof SymbolWrapper - ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' - : description === undefined - ? NativeSymbol() - : NativeSymbol(description); - if (description === "") - EmptyStringDescriptionStore[result] = true; - return result; - }; - copyConstructorProperties(SymbolWrapper, NativeSymbol); - var symbolPrototype = (SymbolWrapper.prototype = - NativeSymbol.prototype); - symbolPrototype.constructor = SymbolWrapper; - var symbolToString = symbolPrototype.toString; - var native = String(NativeSymbol("test")) == "Symbol(test)"; - var regexp = /^Symbol\((.*)\)[^)]+$/; - defineProperty(symbolPrototype, "description", { - configurable: true, - get: function description() { - var symbol = isObject(this) ? this.valueOf() : this; - var string = symbolToString.call(symbol); - if (has(EmptyStringDescriptionStore, symbol)) return ""; - var desc = native - ? string.slice(7, -1) - : string.replace(regexp, "$1"); - return desc === "" ? undefined : desc; - }, - }); - $( - { - global: true, - forced: true, - }, - { - Symbol: SymbolWrapper, - }, - ); - } - }, - { - "../internals/copy-constructor-properties": 51, - "../internals/descriptors": 61, - "../internals/export": 68, - "../internals/global": 77, - "../internals/has": 78, - "../internals/is-object": 92, - "../internals/object-define-property": 110, - }, - ], - 221: [ - function (_dereq_, module, exports) { - var defineWellKnownSymbol = _dereq_( - "../internals/define-well-known-symbol", - ); - // `Symbol.iterator` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.iterator - defineWellKnownSymbol("iterator"); - }, - { - "../internals/define-well-known-symbol": 60, - }, - ], - 222: [ - function (_dereq_, module, exports) { - "use strict"; - var $ = _dereq_("../internals/export"); - var global = _dereq_("../internals/global"); - var getBuiltIn = _dereq_("../internals/get-built-in"); - var IS_PURE = _dereq_("../internals/is-pure"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var NATIVE_SYMBOL = _dereq_("../internals/native-symbol"); - var USE_SYMBOL_AS_UID = _dereq_("../internals/use-symbol-as-uid"); - var fails = _dereq_("../internals/fails"); - var has = _dereq_("../internals/has"); - var isArray = _dereq_("../internals/is-array"); - var isObject = _dereq_("../internals/is-object"); - var anObject = _dereq_("../internals/an-object"); - var toObject = _dereq_("../internals/to-object"); - var toIndexedObject = _dereq_("../internals/to-indexed-object"); - var toPrimitive = _dereq_("../internals/to-primitive"); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - var nativeObjectCreate = _dereq_("../internals/object-create"); - var objectKeys = _dereq_("../internals/object-keys"); - var getOwnPropertyNamesModule = _dereq_( - "../internals/object-get-own-property-names", - ); - var getOwnPropertyNamesExternal = _dereq_( - "../internals/object-get-own-property-names-external", - ); - var getOwnPropertySymbolsModule = _dereq_( - "../internals/object-get-own-property-symbols", - ); - var getOwnPropertyDescriptorModule = _dereq_( - "../internals/object-get-own-property-descriptor", - ); - var definePropertyModule = _dereq_( - "../internals/object-define-property", - ); - var propertyIsEnumerableModule = _dereq_( - "../internals/object-property-is-enumerable", - ); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var redefine = _dereq_("../internals/redefine"); - var shared = _dereq_("../internals/shared"); - var sharedKey = _dereq_("../internals/shared-key"); - var hiddenKeys = _dereq_("../internals/hidden-keys"); - var uid = _dereq_("../internals/uid"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var wrappedWellKnownSymbolModule = _dereq_( - "../internals/well-known-symbol-wrapped", - ); - var defineWellKnownSymbol = _dereq_( - "../internals/define-well-known-symbol", - ); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var InternalStateModule = _dereq_("../internals/internal-state"); - var $forEach = _dereq_("../internals/array-iteration").forEach; - var HIDDEN = sharedKey("hidden"); - var SYMBOL = "Symbol"; - var PROTOTYPE = "prototype"; - var TO_PRIMITIVE = wellKnownSymbol("toPrimitive"); - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(SYMBOL); - var ObjectPrototype = Object[PROTOTYPE]; - var $Symbol = global.Symbol; - var $stringify = getBuiltIn("JSON", "stringify"); - var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - var nativeDefineProperty = definePropertyModule.f; - var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; - var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; - var AllSymbols = shared("symbols"); - var ObjectPrototypeSymbols = shared("op-symbols"); - var StringToSymbolRegistry = shared("string-to-symbol-registry"); - var SymbolToStringRegistry = shared("symbol-to-string-registry"); - var WellKnownSymbolsStore = shared("wks"); - var QObject = global.QObject; - // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 - var USE_SETTER = - !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 - var setSymbolDescriptor = - DESCRIPTORS && - fails(function () { - return ( - nativeObjectCreate( - nativeDefineProperty({}, "a", { - get: function () { - return nativeDefineProperty(this, "a", { - value: 7, - }).a; - }, - }), - ).a != 7 - ); - }) - ? function (O, P, Attributes) { - var ObjectPrototypeDescriptor = - nativeGetOwnPropertyDescriptor(ObjectPrototype, P); - if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; - nativeDefineProperty(O, P, Attributes); - if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { - nativeDefineProperty( - ObjectPrototype, - P, - ObjectPrototypeDescriptor, - ); - } - } - : nativeDefineProperty; - var wrap = function (tag, description) { - var symbol = (AllSymbols[tag] = nativeObjectCreate( - $Symbol[PROTOTYPE], - )); - setInternalState(symbol, { - type: SYMBOL, - tag: tag, - description: description, - }); - if (!DESCRIPTORS) symbol.description = description; - return symbol; - }; - var isSymbol = USE_SYMBOL_AS_UID - ? function (it) { - return typeof it == "symbol"; - } - : function (it) { - return Object(it) instanceof $Symbol; - }; - var $defineProperty = function defineProperty(O, P, Attributes) { - if (O === ObjectPrototype) - $defineProperty(ObjectPrototypeSymbols, P, Attributes); - anObject(O); - var key = toPrimitive(P, true); - anObject(Attributes); - if (has(AllSymbols, key)) { - if (!Attributes.enumerable) { - if (!has(O, HIDDEN)) - nativeDefineProperty( - O, - HIDDEN, - createPropertyDescriptor(1, {}), - ); - O[HIDDEN][key] = true; - } else { - if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; - Attributes = nativeObjectCreate(Attributes, { - enumerable: createPropertyDescriptor(0, false), - }); - } - return setSymbolDescriptor(O, key, Attributes); - } - return nativeDefineProperty(O, key, Attributes); - }; - var $defineProperties = function defineProperties(O, Properties) { - anObject(O); - var properties = toIndexedObject(Properties); - var keys = objectKeys(properties).concat( - $getOwnPropertySymbols(properties), - ); - $forEach(keys, function (key) { - if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) - $defineProperty(O, key, properties[key]); - }); - return O; - }; - var $create = function create(O, Properties) { - return Properties === undefined - ? nativeObjectCreate(O) - : $defineProperties(nativeObjectCreate(O), Properties); - }; - var $propertyIsEnumerable = function propertyIsEnumerable(V) { - var P = toPrimitive(V, true); - var enumerable = nativePropertyIsEnumerable.call(this, P); - if ( - this === ObjectPrototype && - has(AllSymbols, P) && - !has(ObjectPrototypeSymbols, P) - ) - return false; - return enumerable || - !has(this, P) || - !has(AllSymbols, P) || - (has(this, HIDDEN) && this[HIDDEN][P]) - ? enumerable - : true; - }; - var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor( - O, - P, - ) { - var it = toIndexedObject(O); - var key = toPrimitive(P, true); - if ( - it === ObjectPrototype && - has(AllSymbols, key) && - !has(ObjectPrototypeSymbols, key) - ) - return; - var descriptor = nativeGetOwnPropertyDescriptor(it, key); - if ( - descriptor && - has(AllSymbols, key) && - !(has(it, HIDDEN) && it[HIDDEN][key]) - ) { - descriptor.enumerable = true; - } - return descriptor; - }; - var $getOwnPropertyNames = function getOwnPropertyNames(O) { - var names = nativeGetOwnPropertyNames(toIndexedObject(O)); - var result = []; - $forEach(names, function (key) { - if (!has(AllSymbols, key) && !has(hiddenKeys, key)) - result.push(key); - }); - return result; - }; - var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { - var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; - var names = nativeGetOwnPropertyNames( - IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O), - ); - var result = []; - $forEach(names, function (key) { - if ( - has(AllSymbols, key) && - (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key)) - ) { - result.push(AllSymbols[key]); - } - }); - return result; - }; - // `Symbol` constructor - // https://tc39.github.io/ecma262/#sec-symbol-constructor - if (!NATIVE_SYMBOL) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) - throw TypeError("Symbol is not a constructor"); - var description = - !arguments.length || arguments[0] === undefined - ? undefined - : String(arguments[0]); - var tag = uid(description); - var setter = function (value) { - if (this === ObjectPrototype) - setter.call(ObjectPrototypeSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) - this[HIDDEN][tag] = false; - setSymbolDescriptor( - this, - tag, - createPropertyDescriptor(1, value), - ); - }; - if (DESCRIPTORS && USE_SETTER) - setSymbolDescriptor(ObjectPrototype, tag, { - configurable: true, - set: setter, - }); - return wrap(tag, description); - }; - redefine($Symbol[PROTOTYPE], "toString", function toString() { - return getInternalState(this).tag; - }); - redefine($Symbol, "withoutSetter", function (description) { - return wrap(uid(description), description); - }); - propertyIsEnumerableModule.f = $propertyIsEnumerable; - definePropertyModule.f = $defineProperty; - getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; - getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = - $getOwnPropertyNames; - getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; - wrappedWellKnownSymbolModule.f = function (name) { - return wrap(wellKnownSymbol(name), name); - }; - if (DESCRIPTORS) { - // https://github.com/tc39/proposal-Symbol-description - nativeDefineProperty($Symbol[PROTOTYPE], "description", { - configurable: true, - get: function description() { - return getInternalState(this).description; - }, - }); - if (!IS_PURE) { - redefine( - ObjectPrototype, - "propertyIsEnumerable", - $propertyIsEnumerable, - { - unsafe: true, - }, - ); - } - } - } - $( - { - global: true, - wrap: true, - forced: !NATIVE_SYMBOL, - sham: !NATIVE_SYMBOL, - }, - { - Symbol: $Symbol, - }, - ); - $forEach(objectKeys(WellKnownSymbolsStore), function (name) { - defineWellKnownSymbol(name); - }); - $( - { - target: SYMBOL, - stat: true, - forced: !NATIVE_SYMBOL, - }, - { - // `Symbol.for` method - // https://tc39.github.io/ecma262/#sec-symbol.for - for: function (key) { - var string = String(key); - if (has(StringToSymbolRegistry, string)) - return StringToSymbolRegistry[string]; - var symbol = $Symbol(string); - StringToSymbolRegistry[string] = symbol; - SymbolToStringRegistry[symbol] = string; - return symbol; - }, - // `Symbol.keyFor` method - // https://tc39.github.io/ecma262/#sec-symbol.keyfor - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + " is not a symbol"); - if (has(SymbolToStringRegistry, sym)) - return SymbolToStringRegistry[sym]; - }, - useSetter: function () { - USE_SETTER = true; - }, - useSimple: function () { - USE_SETTER = false; - }, - }, - ); - $( - { - target: "Object", - stat: true, - forced: !NATIVE_SYMBOL, - sham: !DESCRIPTORS, - }, - { - // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create - create: $create, - // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty - defineProperty: $defineProperty, - // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties - defineProperties: $defineProperties, - // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - }, - ); - $( - { - target: "Object", - stat: true, - forced: !NATIVE_SYMBOL, - }, - { - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - getOwnPropertyNames: $getOwnPropertyNames, - // `Object.getOwnPropertySymbols` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols - getOwnPropertySymbols: $getOwnPropertySymbols, - }, - ); - // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives - // https://bugs.chromium.org/p/v8/issues/detail?id=3443 - $( - { - target: "Object", - stat: true, - forced: fails(function () { - getOwnPropertySymbolsModule.f(1); - }), - }, - { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - return getOwnPropertySymbolsModule.f(toObject(it)); - }, - }, - ); - // `JSON.stringify` method behavior with symbols - // https://tc39.github.io/ecma262/#sec-json.stringify - if ($stringify) { - var FORCED_JSON_STRINGIFY = - !NATIVE_SYMBOL || - fails(function () { - var symbol = $Symbol(); - // MS Edge converts symbol values to JSON as {} - return ( - $stringify([symbol]) != "[null]" || // WebKit converts symbol values to JSON as null - $stringify({ - a: symbol, - }) != "{}" || // V8 throws on boxed symbols - $stringify(Object(symbol)) != "{}" - ); - }); - $( - { - target: "JSON", - stat: true, - forced: FORCED_JSON_STRINGIFY, - }, - { - // eslint-disable-next-line no-unused-vars - stringify: function stringify(it, replacer, space) { - var args = [it]; - var index = 1; - var $replacer; - while (arguments.length > index) - args.push(arguments[index++]); - $replacer = replacer; - if ((!isObject(replacer) && it === undefined) || isSymbol(it)) - return; // IE8 returns string on undefined - if (!isArray(replacer)) - replacer = function (key, value) { - if (typeof $replacer == "function") - value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return $stringify.apply(null, args); - }, - }, - ); - } // `Symbol.prototype[@@toPrimitive]` method - // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive - - if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { - createNonEnumerableProperty( - $Symbol[PROTOTYPE], - TO_PRIMITIVE, - $Symbol[PROTOTYPE].valueOf, - ); - } // `Symbol.prototype[@@toStringTag]` property - // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag - - setToStringTag($Symbol, SYMBOL); - hiddenKeys[HIDDEN] = true; - }, - { - "../internals/an-object": 28, - "../internals/array-iteration": 37, - "../internals/create-non-enumerable-property": 56, - "../internals/create-property-descriptor": 57, - "../internals/define-well-known-symbol": 60, - "../internals/descriptors": 61, - "../internals/export": 68, - "../internals/fails": 69, - "../internals/get-built-in": 74, - "../internals/global": 77, - "../internals/has": 78, - "../internals/hidden-keys": 79, - "../internals/internal-state": 88, - "../internals/is-array": 90, - "../internals/is-object": 92, - "../internals/is-pure": 93, - "../internals/native-symbol": 101, - "../internals/object-create": 108, - "../internals/object-define-property": 110, - "../internals/object-get-own-property-descriptor": 111, - "../internals/object-get-own-property-names": 113, - "../internals/object-get-own-property-names-external": 112, - "../internals/object-get-own-property-symbols": 114, - "../internals/object-keys": 117, - "../internals/object-property-is-enumerable": 118, - "../internals/redefine": 126, - "../internals/set-to-string-tag": 135, - "../internals/shared": 138, - "../internals/shared-key": 136, - "../internals/to-indexed-object": 152, - "../internals/to-object": 155, - "../internals/to-primitive": 158, - "../internals/uid": 163, - "../internals/use-symbol-as-uid": 164, - "../internals/well-known-symbol": 166, - "../internals/well-known-symbol-wrapped": 165, - }, - ], - 223: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $copyWithin = _dereq_("../internals/array-copy-within"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.copyWithin` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin - exportTypedArrayMethod( - "copyWithin", - function copyWithin(target, start /* , end */) { - return $copyWithin.call( - aTypedArray(this), - target, - start, - arguments.length > 2 ? arguments[2] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-copy-within": 32, - }, - ], - 224: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $every = _dereq_("../internals/array-iteration").every; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.every` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every - exportTypedArrayMethod( - "every", - function every(callbackfn /* , thisArg */) { - return $every( - aTypedArray(this), - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - }, - ], - 225: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $fill = _dereq_("../internals/array-fill"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.fill` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill - // eslint-disable-next-line no-unused-vars - exportTypedArrayMethod( - "fill", - function fill(value /* , start, end */) { - return $fill.apply(aTypedArray(this), arguments); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-fill": 33, - }, - ], - 226: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $filter = _dereq_("../internals/array-iteration").filter; - var speciesConstructor = _dereq_("../internals/species-constructor"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var aTypedArrayConstructor = - ArrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter - exportTypedArrayMethod( - "filter", - function filter(callbackfn /* , thisArg */) { - var list = $filter( - aTypedArray(this), - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - var C = speciesConstructor(this, this.constructor); - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C))(length); - while (length > index) result[index] = list[index++]; - return result; - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - "../internals/species-constructor": 139, - }, - ], - 227: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $findIndex = _dereq_("../internals/array-iteration").findIndex; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex - exportTypedArrayMethod( - "findIndex", - function findIndex(predicate /* , thisArg */) { - return $findIndex( - aTypedArray(this), - predicate, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - }, - ], - 228: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $find = _dereq_("../internals/array-iteration").find; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.find` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find - exportTypedArrayMethod( - "find", - function find(predicate /* , thisArg */) { - return $find( - aTypedArray(this), - predicate, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - }, - ], - 229: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Float32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Float32", function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 230: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Float64Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Float64", function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 231: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $forEach = _dereq_("../internals/array-iteration").forEach; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach - exportTypedArrayMethod( - "forEach", - function forEach(callbackfn /* , thisArg */) { - $forEach( - aTypedArray(this), - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - }, - ], - 232: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $includes = _dereq_("../internals/array-includes").includes; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes - exportTypedArrayMethod( - "includes", - function includes(searchElement /* , fromIndex */) { - return $includes( - aTypedArray(this), - searchElement, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-includes": 36, - }, - ], - 233: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $indexOf = _dereq_("../internals/array-includes").indexOf; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof - exportTypedArrayMethod( - "indexOf", - function indexOf(searchElement /* , fromIndex */) { - return $indexOf( - aTypedArray(this), - searchElement, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-includes": 36, - }, - ], - 234: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Int16Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Int16", function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 235: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Int32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Int32", function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 236: [ - function (_dereq_, module, exports) { - "use strict"; - var global = _dereq_("../internals/global"); - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var ArrayIterators = _dereq_("../modules/es.array.iterator"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var ITERATOR = wellKnownSymbol("iterator"); - var Uint8Array = global.Uint8Array; - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var nativeTypedArrayIterator = - Uint8Array && Uint8Array.prototype[ITERATOR]; - var CORRECT_ITER_NAME = - !!nativeTypedArrayIterator && - (nativeTypedArrayIterator.name == "values" || - nativeTypedArrayIterator.name == undefined); - var typedArrayValues = function values() { - return arrayValues.call(aTypedArray(this)); - }; - // `%TypedArray%.prototype.entries` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries - exportTypedArrayMethod("entries", function entries() { - return arrayEntries.call(aTypedArray(this)); - }); - // `%TypedArray%.prototype.keys` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys - exportTypedArrayMethod("keys", function keys() { - return arrayKeys.call(aTypedArray(this)); - }); - // `%TypedArray%.prototype.values` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values - exportTypedArrayMethod( - "values", - typedArrayValues, - !CORRECT_ITER_NAME, - ); - // `%TypedArray%.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator - exportTypedArrayMethod( - ITERATOR, - typedArrayValues, - !CORRECT_ITER_NAME, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/global": 77, - "../internals/well-known-symbol": 166, - "../modules/es.array.iterator": 179, - }, - ], - 237: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var $join = [].join; - // `%TypedArray%.prototype.join` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join - // eslint-disable-next-line no-unused-vars - exportTypedArrayMethod("join", function join(separator) { - return $join.apply(aTypedArray(this), arguments); - }); - }, - { - "../internals/array-buffer-view-core": 30, - }, - ], - 238: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $lastIndexOf = _dereq_("../internals/array-last-index-of"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.lastIndexOf` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof - // eslint-disable-next-line no-unused-vars - exportTypedArrayMethod( - "lastIndexOf", - function lastIndexOf(searchElement /* , fromIndex */) { - return $lastIndexOf.apply(aTypedArray(this), arguments); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-last-index-of": 38, - }, - ], - 239: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $map = _dereq_("../internals/array-iteration").map; - var speciesConstructor = _dereq_("../internals/species-constructor"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var aTypedArrayConstructor = - ArrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.map` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map - exportTypedArrayMethod("map", function map(mapfn /* , thisArg */) { - return $map( - aTypedArray(this), - mapfn, - arguments.length > 1 ? arguments[1] : undefined, - function (O, length) { - return new (aTypedArrayConstructor( - speciesConstructor(O, O.constructor), - ))(length); - }, - ); - }); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - "../internals/species-constructor": 139, - }, - ], - 240: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $reduceRight = _dereq_("../internals/array-reduce").right; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.reduceRicht` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright - exportTypedArrayMethod( - "reduceRight", - function reduceRight(callbackfn /* , initialValue */) { - return $reduceRight( - aTypedArray(this), - callbackfn, - arguments.length, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-reduce": 42, - }, - ], - 241: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $reduce = _dereq_("../internals/array-reduce").left; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce - exportTypedArrayMethod( - "reduce", - function reduce(callbackfn /* , initialValue */) { - return $reduce( - aTypedArray(this), - callbackfn, - arguments.length, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-reduce": 42, - }, - ], - 242: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var floor = Math.floor; - // `%TypedArray%.prototype.reverse` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse - exportTypedArrayMethod("reverse", function reverse() { - var that = this; - var length = aTypedArray(that).length; - var middle = floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } - return that; - }); - }, - { - "../internals/array-buffer-view-core": 30, - }, - ], - 243: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var toLength = _dereq_("../internals/to-length"); - var toOffset = _dereq_("../internals/to-offset"); - var toObject = _dereq_("../internals/to-object"); - var fails = _dereq_("../internals/fails"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var FORCED = fails(function () { - // eslint-disable-next-line no-undef - new Int8Array(1).set({}); - }); - // `%TypedArray%.prototype.set` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set - exportTypedArrayMethod( - "set", - function set(arrayLike /* , offset */) { - aTypedArray(this); - var offset = toOffset( - arguments.length > 1 ? arguments[1] : undefined, - 1, - ); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError("Wrong length"); - while (index < len) this[offset + index] = src[index++]; - }, - FORCED, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/fails": 69, - "../internals/to-length": 154, - "../internals/to-object": 155, - "../internals/to-offset": 156, - }, - ], - 244: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var speciesConstructor = _dereq_("../internals/species-constructor"); - var fails = _dereq_("../internals/fails"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var aTypedArrayConstructor = - ArrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var $slice = [].slice; - var FORCED = fails(function () { - // eslint-disable-next-line no-undef - new Int8Array(1).slice(); - }); - // `%TypedArray%.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice - exportTypedArrayMethod( - "slice", - function slice(start, end) { - var list = $slice.call(aTypedArray(this), start, end); - var C = speciesConstructor(this, this.constructor); - var index = 0; - var length = list.length; - var result = new (aTypedArrayConstructor(C))(length); - while (length > index) result[index] = list[index++]; - return result; - }, - FORCED, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/fails": 69, - "../internals/species-constructor": 139, - }, - ], - 245: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var $some = _dereq_("../internals/array-iteration").some; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.some` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some - exportTypedArrayMethod( - "some", - function some(callbackfn /* , thisArg */) { - return $some( - aTypedArray(this), - callbackfn, - arguments.length > 1 ? arguments[1] : undefined, - ); - }, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/array-iteration": 37, - }, - ], - 246: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var $sort = [].sort; - // `%TypedArray%.prototype.sort` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort - exportTypedArrayMethod("sort", function sort(comparefn) { - return $sort.call(aTypedArray(this), comparefn); - }); - }, - { - "../internals/array-buffer-view-core": 30, - }, - ], - 247: [ - function (_dereq_, module, exports) { - "use strict"; - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var toLength = _dereq_("../internals/to-length"); - var toAbsoluteIndex = _dereq_("../internals/to-absolute-index"); - var speciesConstructor = _dereq_("../internals/species-constructor"); - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.subarray` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray - exportTypedArrayMethod("subarray", function subarray(begin, end) { - var O = aTypedArray(this); - var length = O.length; - var beginIndex = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O.constructor))( - O.buffer, - O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, - toLength( - (end === undefined ? length : toAbsoluteIndex(end, length)) - - beginIndex, - ), - ); - }); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/species-constructor": 139, - "../internals/to-absolute-index": 150, - "../internals/to-length": 154, - }, - ], - 248: [ - function (_dereq_, module, exports) { - "use strict"; - var global = _dereq_("../internals/global"); - var ArrayBufferViewCore = _dereq_( - "../internals/array-buffer-view-core", - ); - var fails = _dereq_("../internals/fails"); - var Int8Array = global.Int8Array; - var aTypedArray = ArrayBufferViewCore.aTypedArray; - var exportTypedArrayMethod = - ArrayBufferViewCore.exportTypedArrayMethod; - var $toLocaleString = [].toLocaleString; - var $slice = [].slice; - // iOS Safari 6.x fails here - var TO_LOCALE_STRING_BUG = - !!Int8Array && - fails(function () { - $toLocaleString.call(new Int8Array(1)); - }); - var FORCED = - fails(function () { - return ( - [1, 2].toLocaleString() != - new Int8Array([1, 2]).toLocaleString() - ); - }) || - !fails(function () { - Int8Array.prototype.toLocaleString.call([1, 2]); - }); - // `%TypedArray%.prototype.toLocaleString` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring - exportTypedArrayMethod( - "toLocaleString", - function toLocaleString() { - return $toLocaleString.apply( - TO_LOCALE_STRING_BUG - ? $slice.call(aTypedArray(this)) - : aTypedArray(this), - arguments, - ); - }, - FORCED, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/fails": 69, - "../internals/global": 77, - }, - ], - 249: [ - function (_dereq_, module, exports) { - "use strict"; - var exportTypedArrayMethod = _dereq_( - "../internals/array-buffer-view-core", - ).exportTypedArrayMethod; - var fails = _dereq_("../internals/fails"); - var global = _dereq_("../internals/global"); - var Uint8Array = global.Uint8Array; - var Uint8ArrayPrototype = (Uint8Array && Uint8Array.prototype) || {}; - var arrayToString = [].toString; - var arrayJoin = [].join; - if ( - fails(function () { - arrayToString.call({}); - }) - ) { - arrayToString = function toString() { - return arrayJoin.call(this); - }; - } - var IS_NOT_ARRAY_METHOD = - Uint8ArrayPrototype.toString != arrayToString; - // `%TypedArray%.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring - exportTypedArrayMethod( - "toString", - arrayToString, - IS_NOT_ARRAY_METHOD, - ); - }, - { - "../internals/array-buffer-view-core": 30, - "../internals/fails": 69, - "../internals/global": 77, - }, - ], - 250: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Uint16Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Uint16", function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 251: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Uint32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Uint32", function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 252: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Uint8Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor("Uint8", function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 253: [ - function (_dereq_, module, exports) { - var createTypedArrayConstructor = _dereq_( - "../internals/typed-array-constructor", - ); - // `Uint8ClampedArray` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects - createTypedArrayConstructor( - "Uint8", - function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; - }, - true, - ); - }, - { - "../internals/typed-array-constructor": 160, - }, - ], - 254: [ - function (_dereq_, module, exports) { - "use strict"; - var global = _dereq_("../internals/global"); - var redefineAll = _dereq_("../internals/redefine-all"); - var InternalMetadataModule = _dereq_( - "../internals/internal-metadata", - ); - var collection = _dereq_("../internals/collection"); - var collectionWeak = _dereq_("../internals/collection-weak"); - var isObject = _dereq_("../internals/is-object"); - var enforceIternalState = _dereq_( - "../internals/internal-state", - ).enforce; - var NATIVE_WEAK_MAP = _dereq_("../internals/native-weak-map"); - var IS_IE11 = !global.ActiveXObject && "ActiveXObject" in global; - var isExtensible = Object.isExtensible; - var InternalWeakMap; - var wrapper = function (init) { - return function WeakMap() { - return init(this, arguments.length ? arguments[0] : undefined); - }; - }; - // `WeakMap` constructor - // https://tc39.github.io/ecma262/#sec-weakmap-constructor - var $WeakMap = (module.exports = collection( - "WeakMap", - wrapper, - collectionWeak, - )); - // IE11 WeakMap frozen keys fix - // We can't use feature detection because it crash some old IE builds - // https://github.com/zloirock/core-js/issues/485 - if (NATIVE_WEAK_MAP && IS_IE11) { - InternalWeakMap = collectionWeak.getConstructor( - wrapper, - "WeakMap", - true, - ); - InternalMetadataModule.REQUIRED = true; - var WeakMapPrototype = $WeakMap.prototype; - var nativeDelete = WeakMapPrototype["delete"]; - var nativeHas = WeakMapPrototype.has; - var nativeGet = WeakMapPrototype.get; - var nativeSet = WeakMapPrototype.set; - redefineAll(WeakMapPrototype, { - delete: function (key) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - return ( - nativeDelete.call(this, key) || state.frozen["delete"](key) - ); - } - return nativeDelete.call(this, key); - }, - has: function has(key) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - return nativeHas.call(this, key) || state.frozen.has(key); - } - return nativeHas.call(this, key); - }, - get: function get(key) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - return nativeHas.call(this, key) - ? nativeGet.call(this, key) - : state.frozen.get(key); - } - return nativeGet.call(this, key); - }, - set: function set(key, value) { - if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); - if (!state.frozen) state.frozen = new InternalWeakMap(); - nativeHas.call(this, key) - ? nativeSet.call(this, key, value) - : state.frozen.set(key, value); - } else nativeSet.call(this, key, value); - return this; - }, - }); - } - }, - { - "../internals/collection": 50, - "../internals/collection-weak": 49, - "../internals/global": 77, - "../internals/internal-metadata": 87, - "../internals/internal-state": 88, - "../internals/is-object": 92, - "../internals/native-weak-map": 103, - "../internals/redefine-all": 125, - }, - ], - 255: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var DOMIterables = _dereq_("../internals/dom-iterables"); - var forEach = _dereq_("../internals/array-for-each"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - for (var COLLECTION_NAME in DOMIterables) { - var Collection = global[COLLECTION_NAME]; - var CollectionPrototype = Collection && Collection.prototype; - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype && CollectionPrototype.forEach !== forEach) - try { - createNonEnumerableProperty( - CollectionPrototype, - "forEach", - forEach, - ); - } catch (error) { - CollectionPrototype.forEach = forEach; - } - } - }, - { - "../internals/array-for-each": 34, - "../internals/create-non-enumerable-property": 56, - "../internals/dom-iterables": 63, - "../internals/global": 77, - }, - ], - 256: [ - function (_dereq_, module, exports) { - var global = _dereq_("../internals/global"); - var DOMIterables = _dereq_("../internals/dom-iterables"); - var ArrayIteratorMethods = _dereq_("../modules/es.array.iterator"); - var createNonEnumerableProperty = _dereq_( - "../internals/create-non-enumerable-property", - ); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var ITERATOR = wellKnownSymbol("iterator"); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var ArrayValues = ArrayIteratorMethods.values; - for (var COLLECTION_NAME in DOMIterables) { - var Collection = global[COLLECTION_NAME]; - var CollectionPrototype = Collection && Collection.prototype; - if (CollectionPrototype) { - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype[ITERATOR] !== ArrayValues) - try { - createNonEnumerableProperty( - CollectionPrototype, - ITERATOR, - ArrayValues, - ); - } catch (error) { - CollectionPrototype[ITERATOR] = ArrayValues; - } - if (!CollectionPrototype[TO_STRING_TAG]) { - createNonEnumerableProperty( - CollectionPrototype, - TO_STRING_TAG, - COLLECTION_NAME, - ); - } - if (DOMIterables[COLLECTION_NAME]) - for (var METHOD_NAME in ArrayIteratorMethods) { - // some Chrome versions have non-configurable methods on DOMTokenList - if ( - CollectionPrototype[METHOD_NAME] !== - ArrayIteratorMethods[METHOD_NAME] - ) - try { - createNonEnumerableProperty( - CollectionPrototype, - METHOD_NAME, - ArrayIteratorMethods[METHOD_NAME], - ); - } catch (error) { - CollectionPrototype[METHOD_NAME] = - ArrayIteratorMethods[METHOD_NAME]; - } - } - } - } - }, - { - "../internals/create-non-enumerable-property": 56, - "../internals/dom-iterables": 63, - "../internals/global": 77, - "../internals/well-known-symbol": 166, - "../modules/es.array.iterator": 179, - }, - ], - 257: [ - function (_dereq_, module, exports) { - "use strict"; - // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` - _dereq_("../modules/es.array.iterator"); - var $ = _dereq_("../internals/export"); - var getBuiltIn = _dereq_("../internals/get-built-in"); - var USE_NATIVE_URL = _dereq_("../internals/native-url"); - var redefine = _dereq_("../internals/redefine"); - var redefineAll = _dereq_("../internals/redefine-all"); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var createIteratorConstructor = _dereq_( - "../internals/create-iterator-constructor", - ); - var InternalStateModule = _dereq_("../internals/internal-state"); - var anInstance = _dereq_("../internals/an-instance"); - var hasOwn = _dereq_("../internals/has"); - var bind = _dereq_("../internals/function-bind-context"); - var classof = _dereq_("../internals/classof"); - var anObject = _dereq_("../internals/an-object"); - var isObject = _dereq_("../internals/is-object"); - var create = _dereq_("../internals/object-create"); - var createPropertyDescriptor = _dereq_( - "../internals/create-property-descriptor", - ); - var getIterator = _dereq_("../internals/get-iterator"); - var getIteratorMethod = _dereq_("../internals/get-iterator-method"); - var wellKnownSymbol = _dereq_("../internals/well-known-symbol"); - var $fetch = getBuiltIn("fetch"); - var Headers = getBuiltIn("Headers"); - var ITERATOR = wellKnownSymbol("iterator"); - var URL_SEARCH_PARAMS = "URLSearchParams"; - var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + "Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalParamsState = - InternalStateModule.getterFor(URL_SEARCH_PARAMS); - var getInternalIteratorState = InternalStateModule.getterFor( - URL_SEARCH_PARAMS_ITERATOR, - ); - var plus = /\+/g; - var sequences = Array(4); - var percentSequence = function (bytes) { - return ( - sequences[bytes - 1] || - (sequences[bytes - 1] = RegExp( - "((?:%[\\da-f]{2}){" + bytes + "})", - "gi", - )) - ); - }; - var percentDecode = function (sequence) { - try { - return decodeURIComponent(sequence); - } catch (error) { - return sequence; - } - }; - var deserialize = function (it) { - var result = it.replace(plus, " "); - var bytes = 4; - try { - return decodeURIComponent(result); - } catch (error) { - while (bytes) { - result = result.replace( - percentSequence(bytes--), - percentDecode, - ); - } - return result; - } - }; - var find = /[!'()~]|%20/g; - var replace = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - }; - var replacer = function (match) { - return replace[match]; - }; - var serialize = function (it) { - return encodeURIComponent(it).replace(find, replacer); - }; - var parseSearchParams = function (result, query) { - if (query) { - var attributes = query.split("&"); - var index = 0; - var attribute, entry; - while (index < attributes.length) { - attribute = attributes[index++]; - if (attribute.length) { - entry = attribute.split("="); - result.push({ - key: deserialize(entry.shift()), - value: deserialize(entry.join("=")), - }); - } - } - } - }; - var updateSearchParams = function (query) { - this.entries.length = 0; - parseSearchParams(this.entries, query); - }; - var validateArgumentsLength = function (passed, required) { - if (passed < required) throw TypeError("Not enough arguments"); - }; - var URLSearchParamsIterator = createIteratorConstructor( - function Iterator(params, kind) { - setInternalState(this, { - type: URL_SEARCH_PARAMS_ITERATOR, - iterator: getIterator(getInternalParamsState(params).entries), - kind: kind, - }); - }, - "Iterator", - function next() { - var state = getInternalIteratorState(this); - var kind = state.kind; - var step = state.iterator.next(); - var entry = step.value; - if (!step.done) { - step.value = - kind === "keys" - ? entry.key - : kind === "values" - ? entry.value - : [entry.key, entry.value]; - } - return step; - }, - ); - // `URLSearchParams` constructor - // https://url.spec.whatwg.org/#interface-urlsearchparams - var URLSearchParamsConstructor = - function URLSearchParams /* init */() { - anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); - var init = arguments.length > 0 ? arguments[0] : undefined; - var that = this; - var entries = []; - var iteratorMethod, - iterator, - next, - step, - entryIterator, - entryNext, - first, - second, - key; - setInternalState(that, { - type: URL_SEARCH_PARAMS, - entries: entries, - updateURL: function () { - /* empty */ - }, - updateSearchParams: updateSearchParams, - }); - if (init !== undefined) { - if (isObject(init)) { - iteratorMethod = getIteratorMethod(init); - if (typeof iteratorMethod === "function") { - iterator = iteratorMethod.call(init); - next = iterator.next; - while (!(step = next.call(iterator)).done) { - entryIterator = getIterator(anObject(step.value)); - entryNext = entryIterator.next; - if ( - (first = entryNext.call(entryIterator)).done || - (second = entryNext.call(entryIterator)).done || - !entryNext.call(entryIterator).done - ) - throw TypeError("Expected sequence with length 2"); - entries.push({ - key: first.value + "", - value: second.value + "", - }); - } - } else - for (key in init) - if (hasOwn(init, key)) - entries.push({ - key: key, - value: init[key] + "", - }); - } else { - parseSearchParams( - entries, - typeof init === "string" - ? init.charAt(0) === "?" - ? init.slice(1) - : init - : init + "", - ); - } - } - }; - var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; - redefineAll( - URLSearchParamsPrototype, - { - // `URLSearchParams.prototype.appent` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-append - append: function append(name, value) { - validateArgumentsLength(arguments.length, 2); - var state = getInternalParamsState(this); - state.entries.push({ - key: name + "", - value: value + "", - }); - state.updateURL(); - }, - // `URLSearchParams.prototype.delete` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-delete - delete: function (name) { - validateArgumentsLength(arguments.length, 1); - var state = getInternalParamsState(this); - var entries = state.entries; - var key = name + ""; - var index = 0; - while (index < entries.length) { - if (entries[index].key === key) entries.splice(index, 1); - else index++; - } - state.updateURL(); - }, - // `URLSearchParams.prototype.get` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-get - get: function get(name) { - validateArgumentsLength(arguments.length, 1); - var entries = getInternalParamsState(this).entries; - var key = name + ""; - var index = 0; - for (; index < entries.length; index++) { - if (entries[index].key === key) return entries[index].value; - } - return null; - }, - // `URLSearchParams.prototype.getAll` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-getall - getAll: function getAll(name) { - validateArgumentsLength(arguments.length, 1); - var entries = getInternalParamsState(this).entries; - var key = name + ""; - var result = []; - var index = 0; - for (; index < entries.length; index++) { - if (entries[index].key === key) - result.push(entries[index].value); - } - return result; - }, - // `URLSearchParams.prototype.has` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-has - has: function has(name) { - validateArgumentsLength(arguments.length, 1); - var entries = getInternalParamsState(this).entries; - var key = name + ""; - var index = 0; - while (index < entries.length) { - if (entries[index++].key === key) return true; - } - return false; - }, - // `URLSearchParams.prototype.set` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-set - set: function set(name, value) { - validateArgumentsLength(arguments.length, 1); - var state = getInternalParamsState(this); - var entries = state.entries; - var found = false; - var key = name + ""; - var val = value + ""; - var index = 0; - var entry; - for (; index < entries.length; index++) { - entry = entries[index]; - if (entry.key === key) { - if (found) entries.splice(index--, 1); - else { - found = true; - entry.value = val; - } - } - } - if (!found) - entries.push({ - key: key, - value: val, - }); - state.updateURL(); - }, - // `URLSearchParams.prototype.sort` method - // https://url.spec.whatwg.org/#dom-urlsearchparams-sort - sort: function sort() { - var state = getInternalParamsState(this); - var entries = state.entries; - // Array#sort is not stable in some engines - var slice = entries.slice(); - var entry, entriesIndex, sliceIndex; - entries.length = 0; - for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { - entry = slice[sliceIndex]; - for ( - entriesIndex = 0; - entriesIndex < sliceIndex; - entriesIndex++ - ) { - if (entries[entriesIndex].key > entry.key) { - entries.splice(entriesIndex, 0, entry); - break; - } - } - if (entriesIndex === sliceIndex) entries.push(entry); - } - state.updateURL(); - }, - // `URLSearchParams.prototype.forEach` method - forEach: function forEach(callback /* , thisArg */) { - var entries = getInternalParamsState(this).entries; - var boundFunction = bind( - callback, - arguments.length > 1 ? arguments[1] : undefined, - 3, - ); - var index = 0; - var entry; - while (index < entries.length) { - entry = entries[index++]; - boundFunction(entry.value, entry.key, this); - } - }, - // `URLSearchParams.prototype.keys` method - keys: function keys() { - return new URLSearchParamsIterator(this, "keys"); - }, - // `URLSearchParams.prototype.values` method - values: function values() { - return new URLSearchParamsIterator(this, "values"); - }, - // `URLSearchParams.prototype.entries` method - entries: function entries() { - return new URLSearchParamsIterator(this, "entries"); - }, - }, - { - enumerable: true, - }, - ); - // `URLSearchParams.prototype[@@iterator]` method - redefine( - URLSearchParamsPrototype, - ITERATOR, - URLSearchParamsPrototype.entries, - ); - // `URLSearchParams.prototype.toString` method - // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior - redefine( - URLSearchParamsPrototype, - "toString", - function toString() { - var entries = getInternalParamsState(this).entries; - var result = []; - var index = 0; - var entry; - while (index < entries.length) { - entry = entries[index++]; - result.push( - serialize(entry.key) + "=" + serialize(entry.value), - ); - } - return result.join("&"); - }, - { - enumerable: true, - }, - ); - setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); - $( - { - global: true, - forced: !USE_NATIVE_URL, - }, - { - URLSearchParams: URLSearchParamsConstructor, - }, - ); - // Wrap `fetch` for correct work with polyfilled `URLSearchParams` - // https://github.com/zloirock/core-js/issues/674 - if ( - !USE_NATIVE_URL && - typeof $fetch == "function" && - typeof Headers == "function" - ) { - $( - { - global: true, - enumerable: true, - forced: true, - }, - { - fetch: function fetch(input /* , init */) { - var args = [input]; - var init, body, headers; - if (arguments.length > 1) { - init = arguments[1]; - if (isObject(init)) { - body = init.body; - if (classof(body) === URL_SEARCH_PARAMS) { - headers = init.headers - ? new Headers(init.headers) - : new Headers(); - if (!headers.has("content-type")) { - headers.set( - "content-type", - "application/x-www-form-urlencoded;charset=UTF-8", - ); - } - init = create(init, { - body: createPropertyDescriptor(0, String(body)), - headers: createPropertyDescriptor(0, headers), - }); - } - } - args.push(init); - } - return $fetch.apply(this, args); - }, - }, - ); - } - module.exports = { - URLSearchParams: URLSearchParamsConstructor, - getState: getInternalParamsState, - }; - }, - { - "../internals/an-instance": 27, - "../internals/an-object": 28, - "../internals/classof": 47, - "../internals/create-iterator-constructor": 55, - "../internals/create-property-descriptor": 57, - "../internals/export": 68, - "../internals/function-bind-context": 72, - "../internals/get-built-in": 74, - "../internals/get-iterator": 76, - "../internals/get-iterator-method": 75, - "../internals/has": 78, - "../internals/internal-state": 88, - "../internals/is-object": 92, - "../internals/native-url": 102, - "../internals/object-create": 108, - "../internals/redefine": 126, - "../internals/redefine-all": 125, - "../internals/set-to-string-tag": 135, - "../internals/well-known-symbol": 166, - "../modules/es.array.iterator": 179, - }, - ], - 258: [ - function (_dereq_, module, exports) { - "use strict"; - // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` - _dereq_("../modules/es.string.iterator"); - var $ = _dereq_("../internals/export"); - var DESCRIPTORS = _dereq_("../internals/descriptors"); - var USE_NATIVE_URL = _dereq_("../internals/native-url"); - var global = _dereq_("../internals/global"); - var defineProperties = _dereq_( - "../internals/object-define-properties", - ); - var redefine = _dereq_("../internals/redefine"); - var anInstance = _dereq_("../internals/an-instance"); - var has = _dereq_("../internals/has"); - var assign = _dereq_("../internals/object-assign"); - var arrayFrom = _dereq_("../internals/array-from"); - var codeAt = _dereq_("../internals/string-multibyte").codeAt; - var toASCII = _dereq_("../internals/string-punycode-to-ascii"); - var setToStringTag = _dereq_("../internals/set-to-string-tag"); - var URLSearchParamsModule = _dereq_( - "../modules/web.url-search-params", - ); - var InternalStateModule = _dereq_("../internals/internal-state"); - var NativeURL = global.URL; - var URLSearchParams = URLSearchParamsModule.URLSearchParams; - var getInternalSearchParamsState = URLSearchParamsModule.getState; - var setInternalState = InternalStateModule.set; - var getInternalURLState = InternalStateModule.getterFor("URL"); - var floor = Math.floor; - var pow = Math.pow; - var INVALID_AUTHORITY = "Invalid authority"; - var INVALID_SCHEME = "Invalid scheme"; - var INVALID_HOST = "Invalid host"; - var INVALID_PORT = "Invalid port"; - var ALPHA = /[A-Za-z]/; - var ALPHANUMERIC = /[\d+-.A-Za-z]/; - var DIGIT = /\d/; - var HEX_START = /^(0x|0X)/; - var OCT = /^[0-7]+$/; - var DEC = /^\d+$/; - var HEX = /^[\dA-Fa-f]+$/; - // eslint-disable-next-line no-control-regex - var FORBIDDEN_HOST_CODE_POINT = - /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; - // eslint-disable-next-line no-control-regex - var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = - /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; - // eslint-disable-next-line no-control-regex - var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = - /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; - // eslint-disable-next-line no-control-regex - var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; - var EOF; - var parseHost = function (url, input) { - var result, codePoints, index; - if (input.charAt(0) == "[") { - if (input.charAt(input.length - 1) != "]") return INVALID_HOST; - result = parseIPv6(input.slice(1, -1)); - if (!result) return INVALID_HOST; - url.host = result; - // opaque host - } else if (!isSpecial(url)) { - if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) - return INVALID_HOST; - result = ""; - codePoints = arrayFrom(input); - for (index = 0; index < codePoints.length; index++) { - result += percentEncode( - codePoints[index], - C0ControlPercentEncodeSet, - ); - } - url.host = result; - } else { - input = toASCII(input); - if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; - result = parseIPv4(input); - if (result === null) return INVALID_HOST; - url.host = result; - } - }; - var parseIPv4 = function (input) { - var parts = input.split("."); - var partsLength, numbers, index, part, radix, number, ipv4; - if (parts.length && parts[parts.length - 1] == "") { - parts.pop(); - } - partsLength = parts.length; - if (partsLength > 4) return input; - numbers = []; - for (index = 0; index < partsLength; index++) { - part = parts[index]; - if (part == "") return input; - radix = 10; - if (part.length > 1 && part.charAt(0) == "0") { - radix = HEX_START.test(part) ? 16 : 8; - part = part.slice(radix == 8 ? 1 : 2); - } - if (part === "") { - number = 0; - } else { - if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) - return input; - number = parseInt(part, radix); - } - numbers.push(number); - } - for (index = 0; index < partsLength; index++) { - number = numbers[index]; - if (index == partsLength - 1) { - if (number >= pow(256, 5 - partsLength)) return null; - } else if (number > 255) return null; - } - ipv4 = numbers.pop(); - for (index = 0; index < numbers.length; index++) { - ipv4 += numbers[index] * pow(256, 3 - index); - } - return ipv4; - }; - // eslint-disable-next-line max-statements - var parseIPv6 = function (input) { - var address = [0, 0, 0, 0, 0, 0, 0, 0]; - var pieceIndex = 0; - var compress = null; - var pointer = 0; - var value, length, numbersSeen, ipv4Piece, number, swaps, swap; - var char = function () { - return input.charAt(pointer); - }; - if (char() == ":") { - if (input.charAt(1) != ":") return; - pointer += 2; - pieceIndex++; - compress = pieceIndex; - } - while (char()) { - if (pieceIndex == 8) return; - if (char() == ":") { - if (compress !== null) return; - pointer++; - pieceIndex++; - compress = pieceIndex; - continue; - } - value = length = 0; - while (length < 4 && HEX.test(char())) { - value = value * 16 + parseInt(char(), 16); - pointer++; - length++; - } - if (char() == ".") { - if (length == 0) return; - pointer -= length; - if (pieceIndex > 6) return; - numbersSeen = 0; - while (char()) { - ipv4Piece = null; - if (numbersSeen > 0) { - if (char() == "." && numbersSeen < 4) pointer++; - else return; - } - if (!DIGIT.test(char())) return; - while (DIGIT.test(char())) { - number = parseInt(char(), 10); - if (ipv4Piece === null) ipv4Piece = number; - else if (ipv4Piece == 0) return; - else ipv4Piece = ipv4Piece * 10 + number; - if (ipv4Piece > 255) return; - pointer++; - } - address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; - numbersSeen++; - if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; - } - if (numbersSeen != 4) return; - break; - } else if (char() == ":") { - pointer++; - if (!char()) return; - } else if (char()) return; - address[pieceIndex++] = value; - } - if (compress !== null) { - swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex != 0 && swaps > 0) { - swap = address[pieceIndex]; - address[pieceIndex--] = address[compress + swaps - 1]; - address[compress + --swaps] = swap; - } - } else if (pieceIndex != 8) return; - return address; - }; - var findLongestZeroSequence = function (ipv6) { - var maxIndex = null; - var maxLength = 1; - var currStart = null; - var currLength = 0; - var index = 0; - for (; index < 8; index++) { - if (ipv6[index] !== 0) { - if (currLength > maxLength) { - maxIndex = currStart; - maxLength = currLength; - } - currStart = null; - currLength = 0; - } else { - if (currStart === null) currStart = index; - ++currLength; - } - } - if (currLength > maxLength) { - maxIndex = currStart; - maxLength = currLength; - } - return maxIndex; - }; - var serializeHost = function (host) { - var result, index, compress, ignore0; - // ipv4 - if (typeof host == "number") { - result = []; - for (index = 0; index < 4; index++) { - result.unshift(host % 256); - host = floor(host / 256); - } - return result.join("."); - // ipv6 - } else if (typeof host == "object") { - result = ""; - compress = findLongestZeroSequence(host); - for (index = 0; index < 8; index++) { - if (ignore0 && host[index] === 0) continue; - if (ignore0) ignore0 = false; - if (compress === index) { - result += index ? ":" : "::"; - ignore0 = true; - } else { - result += host[index].toString(16); - if (index < 7) result += ":"; - } - } - return "[" + result + "]"; - } - return host; - }; - var C0ControlPercentEncodeSet = {}; - var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { - " ": 1, - '"': 1, - "<": 1, - ">": 1, - "`": 1, - }); - var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { - "#": 1, - "?": 1, - "{": 1, - "}": 1, - }); - var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { - "/": 1, - ":": 1, - ";": 1, - "=": 1, - "@": 1, - "[": 1, - "\\": 1, - "]": 1, - "^": 1, - "|": 1, - }); - var percentEncode = function (char, set) { - var code = codeAt(char, 0); - return code > 32 && code < 127 && !has(set, char) - ? char - : encodeURIComponent(char); - }; - var specialSchemes = { - ftp: 21, - file: null, - http: 80, - https: 443, - ws: 80, - wss: 443, - }; - var isSpecial = function (url) { - return has(specialSchemes, url.scheme); - }; - var includesCredentials = function (url) { - return url.username != "" || url.password != ""; - }; - var cannotHaveUsernamePasswordPort = function (url) { - return !url.host || url.cannotBeABaseURL || url.scheme == "file"; - }; - var isWindowsDriveLetter = function (string, normalized) { - var second; - return ( - string.length == 2 && - ALPHA.test(string.charAt(0)) && - ((second = string.charAt(1)) == ":" || - (!normalized && second == "|")) - ); - }; - var startsWithWindowsDriveLetter = function (string) { - var third; - return ( - string.length > 1 && - isWindowsDriveLetter(string.slice(0, 2)) && - (string.length == 2 || - (third = string.charAt(2)) === "/" || - third === "\\" || - third === "?" || - third === "#") - ); - }; - var shortenURLsPath = function (url) { - var path = url.path; - var pathSize = path.length; - if ( - pathSize && - (url.scheme != "file" || - pathSize != 1 || - !isWindowsDriveLetter(path[0], true)) - ) { - path.pop(); - } - }; - var isSingleDot = function (segment) { - return segment === "." || segment.toLowerCase() === "%2e"; - }; - var isDoubleDot = function (segment) { - segment = segment.toLowerCase(); - return ( - segment === ".." || - segment === "%2e." || - segment === ".%2e" || - segment === "%2e%2e" - ); - }; - // States: - var SCHEME_START = {}; - var SCHEME = {}; - var NO_SCHEME = {}; - var SPECIAL_RELATIVE_OR_AUTHORITY = {}; - var PATH_OR_AUTHORITY = {}; - var RELATIVE = {}; - var RELATIVE_SLASH = {}; - var SPECIAL_AUTHORITY_SLASHES = {}; - var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; - var AUTHORITY = {}; - var HOST = {}; - var HOSTNAME = {}; - var PORT = {}; - var FILE = {}; - var FILE_SLASH = {}; - var FILE_HOST = {}; - var PATH_START = {}; - var PATH = {}; - var CANNOT_BE_A_BASE_URL_PATH = {}; - var QUERY = {}; - var FRAGMENT = {}; - // eslint-disable-next-line max-statements - var parseURL = function (url, input, stateOverride, base) { - var state = stateOverride || SCHEME_START; - var pointer = 0; - var buffer = ""; - var seenAt = false; - var seenBracket = false; - var seenPasswordToken = false; - var codePoints, char, bufferCodePoints, failure; - if (!stateOverride) { - url.scheme = ""; - url.username = ""; - url.password = ""; - url.host = null; - url.port = null; - url.path = []; - url.query = null; - url.fragment = null; - url.cannotBeABaseURL = false; - input = input.replace( - LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, - "", - ); - } - input = input.replace(TAB_AND_NEW_LINE, ""); - codePoints = arrayFrom(input); - while (pointer <= codePoints.length) { - char = codePoints[pointer]; - switch (state) { - case SCHEME_START: - if (char && ALPHA.test(char)) { - buffer += char.toLowerCase(); - state = SCHEME; - } else if (!stateOverride) { - state = NO_SCHEME; - continue; - } else return INVALID_SCHEME; - break; - case SCHEME: - if ( - char && - (ALPHANUMERIC.test(char) || - char == "+" || - char == "-" || - char == ".") - ) { - buffer += char.toLowerCase(); - } else if (char == ":") { - if ( - stateOverride && - (isSpecial(url) != has(specialSchemes, buffer) || - (buffer == "file" && - (includesCredentials(url) || url.port !== null)) || - (url.scheme == "file" && !url.host)) - ) - return; - url.scheme = buffer; - if (stateOverride) { - if ( - isSpecial(url) && - specialSchemes[url.scheme] == url.port - ) - url.port = null; - return; - } - buffer = ""; - if (url.scheme == "file") { - state = FILE; - } else if ( - isSpecial(url) && - base && - base.scheme == url.scheme - ) { - state = SPECIAL_RELATIVE_OR_AUTHORITY; - } else if (isSpecial(url)) { - state = SPECIAL_AUTHORITY_SLASHES; - } else if (codePoints[pointer + 1] == "/") { - state = PATH_OR_AUTHORITY; - pointer++; - } else { - url.cannotBeABaseURL = true; - url.path.push(""); - state = CANNOT_BE_A_BASE_URL_PATH; - } - } else if (!stateOverride) { - buffer = ""; - state = NO_SCHEME; - pointer = 0; - continue; - } else return INVALID_SCHEME; - break; - case NO_SCHEME: - if (!base || (base.cannotBeABaseURL && char != "#")) - return INVALID_SCHEME; - if (base.cannotBeABaseURL && char == "#") { - url.scheme = base.scheme; - url.path = base.path.slice(); - url.query = base.query; - url.fragment = ""; - url.cannotBeABaseURL = true; - state = FRAGMENT; - break; - } - state = base.scheme == "file" ? FILE : RELATIVE; - continue; - case SPECIAL_RELATIVE_OR_AUTHORITY: - if (char == "/" && codePoints[pointer + 1] == "/") { - state = SPECIAL_AUTHORITY_IGNORE_SLASHES; - pointer++; - } else { - state = RELATIVE; - continue; - } - break; - case PATH_OR_AUTHORITY: - if (char == "/") { - state = AUTHORITY; - break; - } else { - state = PATH; - continue; - } - case RELATIVE: - url.scheme = base.scheme; - if (char == EOF) { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.query = base.query; - } else if (char == "/" || (char == "\\" && isSpecial(url))) { - state = RELATIVE_SLASH; - } else if (char == "?") { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.query = ""; - state = QUERY; - } else if (char == "#") { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.query = base.query; - url.fragment = ""; - state = FRAGMENT; - } else { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - url.path = base.path.slice(); - url.path.pop(); - state = PATH; - continue; - } - break; - case RELATIVE_SLASH: - if (isSpecial(url) && (char == "/" || char == "\\")) { - state = SPECIAL_AUTHORITY_IGNORE_SLASHES; - } else if (char == "/") { - state = AUTHORITY; - } else { - url.username = base.username; - url.password = base.password; - url.host = base.host; - url.port = base.port; - state = PATH; - continue; - } - break; - case SPECIAL_AUTHORITY_SLASHES: - state = SPECIAL_AUTHORITY_IGNORE_SLASHES; - if (char != "/" || buffer.charAt(pointer + 1) != "/") - continue; - pointer++; - break; - case SPECIAL_AUTHORITY_IGNORE_SLASHES: - if (char != "/" && char != "\\") { - state = AUTHORITY; - continue; - } - break; - case AUTHORITY: - if (char == "@") { - if (seenAt) buffer = "%40" + buffer; - seenAt = true; - bufferCodePoints = arrayFrom(buffer); - for (var i = 0; i < bufferCodePoints.length; i++) { - var codePoint = bufferCodePoints[i]; - if (codePoint == ":" && !seenPasswordToken) { - seenPasswordToken = true; - continue; - } - var encodedCodePoints = percentEncode( - codePoint, - userinfoPercentEncodeSet, - ); - if (seenPasswordToken) url.password += encodedCodePoints; - else url.username += encodedCodePoints; - } - buffer = ""; - } else if ( - char == EOF || - char == "/" || - char == "?" || - char == "#" || - (char == "\\" && isSpecial(url)) - ) { - if (seenAt && buffer == "") return INVALID_AUTHORITY; - pointer -= arrayFrom(buffer).length + 1; - buffer = ""; - state = HOST; - } else buffer += char; - break; - case HOST: - case HOSTNAME: - if (stateOverride && url.scheme == "file") { - state = FILE_HOST; - continue; - } else if (char == ":" && !seenBracket) { - if (buffer == "") return INVALID_HOST; - failure = parseHost(url, buffer); - if (failure) return failure; - buffer = ""; - state = PORT; - if (stateOverride == HOSTNAME) return; - } else if ( - char == EOF || - char == "/" || - char == "?" || - char == "#" || - (char == "\\" && isSpecial(url)) - ) { - if (isSpecial(url) && buffer == "") return INVALID_HOST; - if ( - stateOverride && - buffer == "" && - (includesCredentials(url) || url.port !== null) - ) - return; - failure = parseHost(url, buffer); - if (failure) return failure; - buffer = ""; - state = PATH_START; - if (stateOverride) return; - continue; - } else { - if (char == "[") seenBracket = true; - else if (char == "]") seenBracket = false; - buffer += char; - } - break; - case PORT: - if (DIGIT.test(char)) { - buffer += char; - } else if ( - char == EOF || - char == "/" || - char == "?" || - char == "#" || - (char == "\\" && isSpecial(url)) || - stateOverride - ) { - if (buffer != "") { - var port = parseInt(buffer, 10); - if (port > 65535) return INVALID_PORT; - url.port = - isSpecial(url) && port === specialSchemes[url.scheme] - ? null - : port; - buffer = ""; - } - if (stateOverride) return; - state = PATH_START; - continue; - } else return INVALID_PORT; - break; - case FILE: - url.scheme = "file"; - if (char == "/" || char == "\\") state = FILE_SLASH; - else if (base && base.scheme == "file") { - if (char == EOF) { - url.host = base.host; - url.path = base.path.slice(); - url.query = base.query; - } else if (char == "?") { - url.host = base.host; - url.path = base.path.slice(); - url.query = ""; - state = QUERY; - } else if (char == "#") { - url.host = base.host; - url.path = base.path.slice(); - url.query = base.query; - url.fragment = ""; - state = FRAGMENT; - } else { - if ( - !startsWithWindowsDriveLetter( - codePoints.slice(pointer).join(""), - ) - ) { - url.host = base.host; - url.path = base.path.slice(); - shortenURLsPath(url); - } - state = PATH; - continue; - } - } else { - state = PATH; - continue; - } - break; - case FILE_SLASH: - if (char == "/" || char == "\\") { - state = FILE_HOST; - break; - } - if ( - base && - base.scheme == "file" && - !startsWithWindowsDriveLetter( - codePoints.slice(pointer).join(""), - ) - ) { - if (isWindowsDriveLetter(base.path[0], true)) - url.path.push(base.path[0]); - else url.host = base.host; - } - state = PATH; - continue; - case FILE_HOST: - if ( - char == EOF || - char == "/" || - char == "\\" || - char == "?" || - char == "#" - ) { - if (!stateOverride && isWindowsDriveLetter(buffer)) { - state = PATH; - } else if (buffer == "") { - url.host = ""; - if (stateOverride) return; - state = PATH_START; - } else { - failure = parseHost(url, buffer); - if (failure) return failure; - if (url.host == "localhost") url.host = ""; - if (stateOverride) return; - buffer = ""; - state = PATH_START; - } - continue; - } else buffer += char; - break; - case PATH_START: - if (isSpecial(url)) { - state = PATH; - if (char != "/" && char != "\\") continue; - } else if (!stateOverride && char == "?") { - url.query = ""; - state = QUERY; - } else if (!stateOverride && char == "#") { - url.fragment = ""; - state = FRAGMENT; - } else if (char != EOF) { - state = PATH; - if (char != "/") continue; - } - break; - case PATH: - if ( - char == EOF || - char == "/" || - (char == "\\" && isSpecial(url)) || - (!stateOverride && (char == "?" || char == "#")) - ) { - if (isDoubleDot(buffer)) { - shortenURLsPath(url); - if (char != "/" && !(char == "\\" && isSpecial(url))) { - url.path.push(""); - } - } else if (isSingleDot(buffer)) { - if (char != "/" && !(char == "\\" && isSpecial(url))) { - url.path.push(""); - } - } else { - if ( - url.scheme == "file" && - !url.path.length && - isWindowsDriveLetter(buffer) - ) { - if (url.host) url.host = ""; - buffer = buffer.charAt(0) + ":"; // normalize windows drive letter - } - url.path.push(buffer); - } - buffer = ""; - if ( - url.scheme == "file" && - (char == EOF || char == "?" || char == "#") - ) { - while (url.path.length > 1 && url.path[0] === "") { - url.path.shift(); - } - } - if (char == "?") { - url.query = ""; - state = QUERY; - } else if (char == "#") { - url.fragment = ""; - state = FRAGMENT; - } - } else { - buffer += percentEncode(char, pathPercentEncodeSet); - } - break; - case CANNOT_BE_A_BASE_URL_PATH: - if (char == "?") { - url.query = ""; - state = QUERY; - } else if (char == "#") { - url.fragment = ""; - state = FRAGMENT; - } else if (char != EOF) { - url.path[0] += percentEncode( - char, - C0ControlPercentEncodeSet, - ); - } - break; - case QUERY: - if (!stateOverride && char == "#") { - url.fragment = ""; - state = FRAGMENT; - } else if (char != EOF) { - if (char == "'" && isSpecial(url)) url.query += "%27"; - else if (char == "#") url.query += "%23"; - else - url.query += percentEncode( - char, - C0ControlPercentEncodeSet, - ); - } - break; - case FRAGMENT: - if (char != EOF) - url.fragment += percentEncode( - char, - fragmentPercentEncodeSet, - ); - break; - } - pointer++; - } - }; - // `URL` constructor - // https://url.spec.whatwg.org/#url-class - var URLConstructor = function URL(url /* , base */) { - var that = anInstance(this, URLConstructor, "URL"); - var base = arguments.length > 1 ? arguments[1] : undefined; - var urlString = String(url); - var state = setInternalState(that, { - type: "URL", - }); - var baseState, failure; - if (base !== undefined) { - if (base instanceof URLConstructor) - baseState = getInternalURLState(base); - else { - failure = parseURL((baseState = {}), String(base)); - if (failure) throw TypeError(failure); - } - } - failure = parseURL(state, urlString, null, baseState); - if (failure) throw TypeError(failure); - var searchParams = (state.searchParams = new URLSearchParams()); - var searchParamsState = getInternalSearchParamsState(searchParams); - searchParamsState.updateSearchParams(state.query); - searchParamsState.updateURL = function () { - state.query = String(searchParams) || null; - }; - if (!DESCRIPTORS) { - that.href = serializeURL.call(that); - that.origin = getOrigin.call(that); - that.protocol = getProtocol.call(that); - that.username = getUsername.call(that); - that.password = getPassword.call(that); - that.host = getHost.call(that); - that.hostname = getHostname.call(that); - that.port = getPort.call(that); - that.pathname = getPathname.call(that); - that.search = getSearch.call(that); - that.searchParams = getSearchParams.call(that); - that.hash = getHash.call(that); - } - }; - var URLPrototype = URLConstructor.prototype; - var serializeURL = function () { - var url = getInternalURLState(this); - var scheme = url.scheme; - var username = url.username; - var password = url.password; - var host = url.host; - var port = url.port; - var path = url.path; - var query = url.query; - var fragment = url.fragment; - var output = scheme + ":"; - if (host !== null) { - output += "//"; - if (includesCredentials(url)) { - output += username + (password ? ":" + password : "") + "@"; - } - output += serializeHost(host); - if (port !== null) output += ":" + port; - } else if (scheme == "file") output += "//"; - output += url.cannotBeABaseURL - ? path[0] - : path.length - ? "/" + path.join("/") - : ""; - if (query !== null) output += "?" + query; - if (fragment !== null) output += "#" + fragment; - return output; - }; - var getOrigin = function () { - var url = getInternalURLState(this); - var scheme = url.scheme; - var port = url.port; - if (scheme == "blob") - try { - return new URL(scheme.path[0]).origin; - } catch (error) { - return "null"; - } - if (scheme == "file" || !isSpecial(url)) return "null"; - return ( - scheme + - "://" + - serializeHost(url.host) + - (port !== null ? ":" + port : "") - ); - }; - var getProtocol = function () { - return getInternalURLState(this).scheme + ":"; - }; - var getUsername = function () { - return getInternalURLState(this).username; - }; - var getPassword = function () { - return getInternalURLState(this).password; - }; - var getHost = function () { - var url = getInternalURLState(this); - var host = url.host; - var port = url.port; - return host === null - ? "" - : port === null - ? serializeHost(host) - : serializeHost(host) + ":" + port; - }; - var getHostname = function () { - var host = getInternalURLState(this).host; - return host === null ? "" : serializeHost(host); - }; - var getPort = function () { - var port = getInternalURLState(this).port; - return port === null ? "" : String(port); - }; - var getPathname = function () { - var url = getInternalURLState(this); - var path = url.path; - return url.cannotBeABaseURL - ? path[0] - : path.length - ? "/" + path.join("/") - : ""; - }; - var getSearch = function () { - var query = getInternalURLState(this).query; - return query ? "?" + query : ""; - }; - var getSearchParams = function () { - return getInternalURLState(this).searchParams; - }; - var getHash = function () { - var fragment = getInternalURLState(this).fragment; - return fragment ? "#" + fragment : ""; - }; - var accessorDescriptor = function (getter, setter) { - return { - get: getter, - set: setter, - configurable: true, - enumerable: true, - }; - }; - if (DESCRIPTORS) { - defineProperties(URLPrototype, { - // `URL.prototype.href` accessors pair - // https://url.spec.whatwg.org/#dom-url-href - href: accessorDescriptor(serializeURL, function (href) { - var url = getInternalURLState(this); - var urlString = String(href); - var failure = parseURL(url, urlString); - if (failure) throw TypeError(failure); - getInternalSearchParamsState( - url.searchParams, - ).updateSearchParams(url.query); - }), - // `URL.prototype.origin` getter - // https://url.spec.whatwg.org/#dom-url-origin - origin: accessorDescriptor(getOrigin), - // `URL.prototype.protocol` accessors pair - // https://url.spec.whatwg.org/#dom-url-protocol - protocol: accessorDescriptor(getProtocol, function (protocol) { - var url = getInternalURLState(this); - parseURL(url, String(protocol) + ":", SCHEME_START); - }), - // `URL.prototype.username` accessors pair - // https://url.spec.whatwg.org/#dom-url-username - username: accessorDescriptor(getUsername, function (username) { - var url = getInternalURLState(this); - var codePoints = arrayFrom(String(username)); - if (cannotHaveUsernamePasswordPort(url)) return; - url.username = ""; - for (var i = 0; i < codePoints.length; i++) { - url.username += percentEncode( - codePoints[i], - userinfoPercentEncodeSet, - ); - } - }), - // `URL.prototype.password` accessors pair - // https://url.spec.whatwg.org/#dom-url-password - password: accessorDescriptor(getPassword, function (password) { - var url = getInternalURLState(this); - var codePoints = arrayFrom(String(password)); - if (cannotHaveUsernamePasswordPort(url)) return; - url.password = ""; - for (var i = 0; i < codePoints.length; i++) { - url.password += percentEncode( - codePoints[i], - userinfoPercentEncodeSet, - ); - } - }), - // `URL.prototype.host` accessors pair - // https://url.spec.whatwg.org/#dom-url-host - host: accessorDescriptor(getHost, function (host) { - var url = getInternalURLState(this); - if (url.cannotBeABaseURL) return; - parseURL(url, String(host), HOST); - }), - // `URL.prototype.hostname` accessors pair - // https://url.spec.whatwg.org/#dom-url-hostname - hostname: accessorDescriptor(getHostname, function (hostname) { - var url = getInternalURLState(this); - if (url.cannotBeABaseURL) return; - parseURL(url, String(hostname), HOSTNAME); - }), - // `URL.prototype.port` accessors pair - // https://url.spec.whatwg.org/#dom-url-port - port: accessorDescriptor(getPort, function (port) { - var url = getInternalURLState(this); - if (cannotHaveUsernamePasswordPort(url)) return; - port = String(port); - if (port == "") url.port = null; - else parseURL(url, port, PORT); - }), - // `URL.prototype.pathname` accessors pair - // https://url.spec.whatwg.org/#dom-url-pathname - pathname: accessorDescriptor(getPathname, function (pathname) { - var url = getInternalURLState(this); - if (url.cannotBeABaseURL) return; - url.path = []; - parseURL(url, pathname + "", PATH_START); - }), - // `URL.prototype.search` accessors pair - // https://url.spec.whatwg.org/#dom-url-search - search: accessorDescriptor(getSearch, function (search) { - var url = getInternalURLState(this); - search = String(search); - if (search == "") { - url.query = null; - } else { - if ("?" == search.charAt(0)) search = search.slice(1); - url.query = ""; - parseURL(url, search, QUERY); - } - getInternalSearchParamsState( - url.searchParams, - ).updateSearchParams(url.query); - }), - // `URL.prototype.searchParams` getter - // https://url.spec.whatwg.org/#dom-url-searchparams - searchParams: accessorDescriptor(getSearchParams), - // `URL.prototype.hash` accessors pair - // https://url.spec.whatwg.org/#dom-url-hash - hash: accessorDescriptor(getHash, function (hash) { - var url = getInternalURLState(this); - hash = String(hash); - if (hash == "") { - url.fragment = null; - return; - } - if ("#" == hash.charAt(0)) hash = hash.slice(1); - url.fragment = ""; - parseURL(url, hash, FRAGMENT); - }), - }); - } // `URL.prototype.toJSON` method - // https://url.spec.whatwg.org/#dom-url-tojson - - redefine( - URLPrototype, - "toJSON", - function toJSON() { - return serializeURL.call(this); - }, - { - enumerable: true, - }, - ); - // `URL.prototype.toString` method - // https://url.spec.whatwg.org/#URL-stringification-behavior - redefine( - URLPrototype, - "toString", - function toString() { - return serializeURL.call(this); - }, - { - enumerable: true, - }, - ); - if (NativeURL) { - var nativeCreateObjectURL = NativeURL.createObjectURL; - var nativeRevokeObjectURL = NativeURL.revokeObjectURL; - // `URL.createObjectURL` method - // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL - // eslint-disable-next-line no-unused-vars - if (nativeCreateObjectURL) - redefine( - URLConstructor, - "createObjectURL", - function createObjectURL(blob) { - return nativeCreateObjectURL.apply(NativeURL, arguments); - }, - ); - // `URL.revokeObjectURL` method - // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL - // eslint-disable-next-line no-unused-vars - if (nativeRevokeObjectURL) - redefine( - URLConstructor, - "revokeObjectURL", - function revokeObjectURL(url) { - return nativeRevokeObjectURL.apply(NativeURL, arguments); - }, - ); - } - setToStringTag(URLConstructor, "URL"); - $( - { - global: true, - forced: !USE_NATIVE_URL, - sham: !DESCRIPTORS, - }, - { - URL: URLConstructor, - }, - ); - }, - { - "../internals/an-instance": 27, - "../internals/array-from": 35, - "../internals/descriptors": 61, - "../internals/export": 68, - "../internals/global": 77, - "../internals/has": 78, - "../internals/internal-state": 88, - "../internals/native-url": 102, - "../internals/object-assign": 107, - "../internals/object-define-properties": 109, - "../internals/redefine": 126, - "../internals/set-to-string-tag": 135, - "../internals/string-multibyte": 141, - "../internals/string-punycode-to-ascii": 144, - "../modules/es.string.iterator": 210, - "../modules/web.url-search-params": 257, - }, - ], - 259: [ - function (_dereq_, module, exports) { - // This file can be required in Browserify and Node.js for automatic polyfill - // To use it: require('es6-promise/auto'); - "use strict"; - module.exports = _dereq_("./").polyfill(); - }, - { - "./": 260, - }, - ], - 260: [ - function (_dereq_, module, exports) { - (function (process, global) { - /*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ - (function (global, factory) { - typeof exports === "object" && typeof module !== "undefined" - ? (module.exports = factory()) - : typeof define === "function" && define.amd - ? define(factory) - : (global.ES6Promise = factory()); - })(this, function () { - "use strict"; - function objectOrFunction(x) { - var type = typeof x; - return x !== null && (type === "object" || type === "function"); - } - function isFunction(x) { - return typeof x === "function"; - } - var _isArray = void 0; - if (Array.isArray) { - _isArray = Array.isArray; - } else { - _isArray = function (x) { - return Object.prototype.toString.call(x) === "[object Array]"; - }; - } - var isArray = _isArray; - var len = 0; - var vertxNext = void 0; - var customSchedulerFn = void 0; - var asap = function asap(callback, arg) { - queue[len] = callback; - queue[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 2, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - if (customSchedulerFn) { - customSchedulerFn(flush); - } else { - scheduleFlush(); - } - } - }; - function setScheduler(scheduleFn) { - customSchedulerFn = scheduleFn; - } - function setAsap(asapFn) { - asap = asapFn; - } - var browserWindow = - typeof window !== "undefined" ? window : undefined; - var browserGlobal = browserWindow || {}; - var BrowserMutationObserver = - browserGlobal.MutationObserver || - browserGlobal.WebKitMutationObserver; - var isNode = - typeof self === "undefined" && - typeof process !== "undefined" && - {}.toString.call(process) === "[object process]"; - // test for web worker but not in IE10 - var isWorker = - typeof Uint8ClampedArray !== "undefined" && - typeof importScripts !== "undefined" && - typeof MessageChannel !== "undefined"; - // node - function useNextTick() { - // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // see https://github.com/cujojs/when/issues/410 for details - return function () { - return process.nextTick(flush); - }; - } // vertx - - function useVertxTimer() { - if (typeof vertxNext !== "undefined") { - return function () { - vertxNext(flush); - }; - } - return useSetTimeout(); - } - function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(""); - observer.observe(node, { - characterData: true, - }); - return function () { - node.data = iterations = ++iterations % 2; - }; - } // web worker - - function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; - } - function useSetTimeout() { - // Store setTimeout reference so es6-promise will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var globalSetTimeout = setTimeout; - return function () { - return globalSetTimeout(flush, 1); - }; - } - var queue = new Array(1000); - function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue[i]; - var arg = queue[i + 1]; - callback(arg); - queue[i] = undefined; - queue[i + 1] = undefined; - } - len = 0; - } - function attemptVertx() { - try { - var vertx = Function("return this")().require("vertx"); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } - } - var scheduleFlush = void 0; - // Decide what async method to use to triggering processing of queued callbacks: - if (isNode) { - scheduleFlush = useNextTick(); - } else if (BrowserMutationObserver) { - scheduleFlush = useMutationObserver(); - } else if (isWorker) { - scheduleFlush = useMessageChannel(); - } else if ( - browserWindow === undefined && - typeof _dereq_ === "function" - ) { - scheduleFlush = attemptVertx(); - } else { - scheduleFlush = useSetTimeout(); - } - function then(onFulfillment, onRejection) { - var parent = this; - var child = new this.constructor(noop); - if (child[PROMISE_ID] === undefined) { - makePromise(child); - } - var _state = parent._state; - if (_state) { - var callback = arguments[_state - 1]; - asap(function () { - return invokeCallback( - _state, - child, - callback, - parent._result, - ); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } - return child; - } /** - `Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: + module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, + target, + key, + targetProperty, + sourceProperty, + descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, { + }); + } else { + target = (global[TARGET] || { + }).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } // add a flag to not completely full polyfills + + if (options.sham || targetProperty && targetProperty.sham) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } // extend global + + redefine(target, key, sourceProperty, options); + } + }; + }, + { + '../internals/copy-constructor-properties': 51, + '../internals/create-non-enumerable-property': 56, + '../internals/global': 77, + '../internals/is-forced': 91, + '../internals/object-get-own-property-descriptor': 111, + '../internals/redefine': 126, + '../internals/set-global': 133 + } + ], + 69: [ + function (_dereq_, module, exports) { + module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } + }; + }, + { + } + ], + 70: [ + function (_dereq_, module, exports) { + 'use strict'; + // TODO: Remove from `core-js@4` since it's moved to entry points + _dereq_('../modules/es.regexp.exec'); + var redefine = _dereq_('../internals/redefine'); + var fails = _dereq_('../internals/fails'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var regexpExec = _dereq_('../internals/regexp-exec'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var SPECIES = wellKnownSymbol('species'); + var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = [ + ]; + result.groups = { + a: '7' + }; + return result; + }; + return ''.replace(re, '$') !== '7'; + }); + // IE <= 11 replaces $0 with the whole match, as if it was $& + // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 + var REPLACE_KEEPS_$0 = function () { + return 'a'.replace(/./, '$0') === '$0'; + }(); + var REPLACE = wellKnownSymbol('replace'); + // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string + var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function () { + if (/./[REPLACE]) { + return /./[REPLACE]('a', '$0') === ''; + } + return false; + }(); + // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec + // Weex JS has frozen built-in prototypes, so use try / catch wrapper + var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { + return originalExec.apply(this, arguments); + }; + var result = 'ab'.split(re); + return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; + }); + module.exports = function (KEY, length, exec, sham) { + var SYMBOL = wellKnownSymbol(KEY); + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = { + }; + O[SYMBOL] = function () { + return 7; + }; + return ''[KEY](O) != 7; + }); + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + if (KEY === 'split') { + // We can't use real regex here since it causes deoptimization + // and serious performance degradation in V8 + // https://github.com/zloirock/core-js/issues/306 + re = { + }; + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = { + }; + re.constructor[SPECIES] = function () { + return re; + }; + re.flags = ''; + re[SYMBOL] = /./[SYMBOL]; + } + re.exec = function () { + execCalled = true; + return null; + }; + re[SYMBOL](''); + return !execCalled; + }); + if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0 && !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE) || KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) { + var nativeRegExpMethod = /./[SYMBOL]; + var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { + done: true, + value: nativeRegExpMethod.call(regexp, str, arg2) + }; + } + return { + done: true, + value: nativeMethod.call(str, regexp, arg2) + }; + } + return { + done: false + }; + }, { + REPLACE_KEEPS_$0: REPLACE_KEEPS_$0, + REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE + }); + var stringMethod = methods[0]; + var regexMethod = methods[1]; + redefine(String.prototype, KEY, stringMethod); + redefine(RegExp.prototype, SYMBOL, length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { + return regexMethod.call(string, this, arg); + } // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + + : function (string) { + return regexMethod.call(string, this); + }); + } + if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true); + }; + }, + { + '../internals/create-non-enumerable-property': 56, + '../internals/fails': 69, + '../internals/redefine': 126, + '../internals/regexp-exec': 128, + '../internals/well-known-symbol': 166, + '../modules/es.regexp.exec': 205 + } + ], + 71: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + module.exports = !fails(function () { + return Object.isExtensible(Object.preventExtensions({ + })); + }); + }, + { + '../internals/fails': 69 + } + ], + 72: [ + function (_dereq_, module, exports) { + var aFunction = _dereq_('../internals/a-function'); + // optional / simple context binding + module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: + return function () { + return fn.call(that); + }; + case 1: + return function (a) { + return fn.call(that, a); + }; + case 2: + return function (a, b) { + return fn.call(that, a, b); + }; + case 3: + return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function /* ...args */ + () { + return fn.apply(that, arguments); + }; + }; + }, + { + '../internals/a-function': 23 + } + ], + 73: [ + function (_dereq_, module, exports) { + 'use strict'; + var aFunction = _dereq_('../internals/a-function'); + var isObject = _dereq_('../internals/is-object'); + var slice = [ + ].slice; + var factories = { + }; + var construct = function (C, argsLength, args) { + if (!(argsLength in factories)) { + for (var list = [ + ], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); + } + return factories[argsLength](C, args); + }; + // `Function.prototype.bind` method implementation + // https://tc39.github.io/ecma262/#sec-function.prototype.bind + module.exports = Function.bind || function bind(that /* , ...args */ ) { + var fn = aFunction(this); + var partArgs = slice.call(arguments, 1); + var boundFunction = function bound( /* args... */ + ) { + var args = partArgs.concat(slice.call(arguments)); + return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); + }; + if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype; + return boundFunction; + }; + }, + { + '../internals/a-function': 23, + '../internals/is-object': 92 + } + ], + 74: [ + function (_dereq_, module, exports) { + var path = _dereq_('../internals/path'); + var global = _dereq_('../internals/global'); + var aFunction = function (variable) { + return typeof variable == 'function' ? variable : undefined; + }; + module.exports = function (namespace, method) { + return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; + }; + }, + { + '../internals/global': 77, + '../internals/path': 122 + } + ], + 75: [ + function (_dereq_, module, exports) { + var classof = _dereq_('../internals/classof'); + var Iterators = _dereq_('../internals/iterators'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var ITERATOR = wellKnownSymbol('iterator'); + module.exports = function (it) { + if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; + }; + }, + { + '../internals/classof': 47, + '../internals/iterators': 97, + '../internals/well-known-symbol': 166 + } + ], + 76: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + var getIteratorMethod = _dereq_('../internals/get-iterator-method'); + module.exports = function (it) { + var iteratorMethod = getIteratorMethod(it); + if (typeof iteratorMethod != 'function') { + throw TypeError(String(it) + ' is not iterable'); + } + return anObject(iteratorMethod.call(it)); + }; + }, + { + '../internals/an-object': 28, + '../internals/get-iterator-method': 75 + } + ], + 77: [ + function (_dereq_, module, exports) { + (function (global) { + var check = function (it) { + return it && it.Math == Math && it; + }; + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + module.exports = // eslint-disable-next-line no-undef + check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || // eslint-disable-next-line no-new-func + Function('return this') (); + }).call(this, typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : { + }) + }, + { + } + ], + 78: [ + function (_dereq_, module, exports) { + var hasOwnProperty = { + }.hasOwnProperty; + module.exports = function (it, key) { + return hasOwnProperty.call(it, key); + }; + }, + { + } + ], + 79: [ + function (_dereq_, module, exports) { + module.exports = { + }; + }, + { + } + ], + 80: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + module.exports = function (a, b) { + var console = global.console; + if (console && console.error) { + arguments.length === 1 ? console.error(a) : console.error(a, b); + } + }; + }, + { + '../internals/global': 77 + } + ], + 81: [ + function (_dereq_, module, exports) { + var getBuiltIn = _dereq_('../internals/get-built-in'); + module.exports = getBuiltIn('document', 'documentElement'); + }, + { + '../internals/get-built-in': 74 + } + ], + 82: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var fails = _dereq_('../internals/fails'); + var createElement = _dereq_('../internals/document-create-element'); + // Thank's IE8 for his funny defineProperty + module.exports = !DESCRIPTORS && !fails(function () { + return Object.defineProperty(createElement('div'), 'a', { + get: function () { + return 7; + } + }).a != 7; + }); + }, + { + '../internals/descriptors': 61, + '../internals/document-create-element': 62, + '../internals/fails': 69 + } + ], + 83: [ + function (_dereq_, module, exports) { + // IEEE754 conversions based on https://github.com/feross/ieee754 + // eslint-disable-next-line no-shadow-restricted-names + var Infinity = 1 / 0; + var abs = Math.abs; + var pow = Math.pow; + var floor = Math.floor; + var log = Math.log; + var LN2 = Math.LN2; + var pack = function (number, mantissaLength, bytes) { + var buffer = new Array(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, - 24) - pow(2, - 77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var index = 0; + var exponent, + mantissa, + c; + number = abs(number); + // eslint-disable-next-line no-self-compare + if (number != number || number === Infinity) { + // eslint-disable-next-line no-self-compare + mantissa = number != number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + if (number * (c = pow(2, - exponent)) < 1) { + exponent--; + c *= 2; + } + if (exponent + eBias >= 1) { + number += rt / c; + } else { + number += rt * pow(2, 1 - eBias); + } + if (number * c >= 2) { + exponent++; + c /= 2; + } + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c - 1) * pow(2, mantissaLength); + exponent = exponent + eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; + } + } + for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); + exponent = exponent << mantissaLength | mantissa; + exponentLength += mantissaLength; + for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); + buffer[--index] |= sign * 128; + return buffer; + }; + var unpack = function (buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); + mantissa = exponent & (1 << - nBits) - 1; + exponent >>= - nBits; + nBits += mantissaLength; + for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? - Infinity : Infinity; + } else { + mantissa = mantissa + pow(2, mantissaLength); + exponent = exponent - eBias; + } + return (sign ? - 1 : 1) * mantissa * pow(2, exponent - mantissaLength); + }; + module.exports = { + pack: pack, + unpack: unpack + }; + }, + { + } + ], + 84: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + var classof = _dereq_('../internals/classof-raw'); + var split = ''.split; + // fallback for non-array-like ES3 and non-enumerable old V8 strings + module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins + return !Object('z').propertyIsEnumerable(0); + }) ? function (it) { + return classof(it) == 'String' ? split.call(it, '') : Object(it); + } + : Object; + }, + { + '../internals/classof-raw': 46, + '../internals/fails': 69 + } + ], + 85: [ + function (_dereq_, module, exports) { + var isObject = _dereq_('../internals/is-object'); + var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); + // makes subclassing work correct for wrapped built-ins + module.exports = function ($this, dummy, Wrapper) { + var NewTarget, + NewTargetPrototype; + if ( // it can work only with native `setPrototypeOf` + setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == 'function' && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype) setPrototypeOf($this, NewTargetPrototype); + return $this; + }; + }, + { + '../internals/is-object': 92, + '../internals/object-set-prototype-of': 119 + } + ], + 86: [ + function (_dereq_, module, exports) { + var store = _dereq_('../internals/shared-store'); + var functionToString = Function.toString; + // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper + if (typeof store.inspectSource != 'function') { + store.inspectSource = function (it) { + return functionToString.call(it); + }; + } + module.exports = store.inspectSource; + }, + { + '../internals/shared-store': 137 + } + ], + 87: [ + function (_dereq_, module, exports) { + var hiddenKeys = _dereq_('../internals/hidden-keys'); + var isObject = _dereq_('../internals/is-object'); + var has = _dereq_('../internals/has'); + var defineProperty = _dereq_('../internals/object-define-property').f; + var uid = _dereq_('../internals/uid'); + var FREEZING = _dereq_('../internals/freezing'); + var METADATA = uid('meta'); + var id = 0; + var isExtensible = Object.isExtensible || function () { + return true; + }; + var setMetadata = function (it) { + defineProperty(it, METADATA, { + value: { + objectID: 'O' + ++id, + // object ID + weakData: { + } // weak collections IDs + + } + }); + }; + var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMetadata(it); + // return object ID + } + return it[METADATA].objectID; + }; + var getWeakData = function (it, create) { + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs + } + return it[METADATA].weakData; + }; + // add metadata on freeze-family methods calling + var onFreeze = function (it) { + if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); + return it; + }; + var meta = module.exports = { + REQUIRED: false, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze + }; + hiddenKeys[METADATA] = true; + }, + { + '../internals/freezing': 71, + '../internals/has': 78, + '../internals/hidden-keys': 79, + '../internals/is-object': 92, + '../internals/object-define-property': 110, + '../internals/uid': 163 + } + ], + 88: [ + function (_dereq_, module, exports) { + var NATIVE_WEAK_MAP = _dereq_('../internals/native-weak-map'); + var global = _dereq_('../internals/global'); + var isObject = _dereq_('../internals/is-object'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var objectHas = _dereq_('../internals/has'); + var sharedKey = _dereq_('../internals/shared-key'); + var hiddenKeys = _dereq_('../internals/hidden-keys'); + var WeakMap = global.WeakMap; + var set, + get, + has; + var enforce = function (it) { + return has(it) ? get(it) : set(it, { + }); + }; + var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } + return state; + }; + }; + if (NATIVE_WEAK_MAP) { + var store = new WeakMap(); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || { + }; + }; + has = function (it) { + return wmhas.call(store, it); + }; + } else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : { + }; + }; + has = function (it) { + return objectHas(it, STATE); + }; + } + module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor + }; + }, + { + '../internals/create-non-enumerable-property': 56, + '../internals/global': 77, + '../internals/has': 78, + '../internals/hidden-keys': 79, + '../internals/is-object': 92, + '../internals/native-weak-map': 103, + '../internals/shared-key': 136 + } + ], + 89: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var Iterators = _dereq_('../internals/iterators'); + var ITERATOR = wellKnownSymbol('iterator'); + var ArrayPrototype = Array.prototype; + // check on default Array iterator + module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); + }; + }, + { + '../internals/iterators': 97, + '../internals/well-known-symbol': 166 + } + ], + 90: [ + function (_dereq_, module, exports) { + var classof = _dereq_('../internals/classof-raw'); + // `IsArray` abstract operation + // https://tc39.github.io/ecma262/#sec-isarray + module.exports = Array.isArray || function isArray(arg) { + return classof(arg) == 'Array'; + }; + }, + { + '../internals/classof-raw': 46 + } + ], + 91: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + var replacement = /#|\.prototype\./; + var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; + }; + var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); + }; + var data = isForced.data = { + }; + var NATIVE = isForced.NATIVE = 'N'; + var POLYFILL = isForced.POLYFILL = 'P'; + module.exports = isForced; + }, + { + '../internals/fails': 69 + } + ], + 92: [ + function (_dereq_, module, exports) { + module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + }, + { + } + ], + 93: [ + function (_dereq_, module, exports) { + module.exports = false; + }, + { + } + ], + 94: [ + function (_dereq_, module, exports) { + var isObject = _dereq_('../internals/is-object'); + var classof = _dereq_('../internals/classof-raw'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var MATCH = wellKnownSymbol('match'); + // `IsRegExp` abstract operation + // https://tc39.github.io/ecma262/#sec-isregexp + module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); + }; + }, + { + '../internals/classof-raw': 46, + '../internals/is-object': 92, + '../internals/well-known-symbol': 166 + } + ], + 95: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + var isArrayIteratorMethod = _dereq_('../internals/is-array-iterator-method'); + var toLength = _dereq_('../internals/to-length'); + var bind = _dereq_('../internals/function-bind-context'); + var getIteratorMethod = _dereq_('../internals/get-iterator-method'); + var callWithSafeIterationClosing = _dereq_('../internals/call-with-safe-iteration-closing'); + var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; + }; + var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { + var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1); + var iterator, + iterFn, + index, + length, + result, + next, + step; + if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = toLength(iterable.length); length > index; index++) { + result = AS_ENTRIES ? boundFunction(anObject(step = iterable[index]) [0], step[1]) : boundFunction(iterable[index]); + if (result && result instanceof Result) return result; + } + return new Result(false); + } + iterator = iterFn.call(iterable); + } + next = iterator.next; + while (!(step = next.call(iterator)).done) { + result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); + if (typeof result == 'object' && result && result instanceof Result) return result; + } + return new Result(false); + }; + iterate.stop = function (result) { + return new Result(true, result); + }; + }, + { + '../internals/an-object': 28, + '../internals/call-with-safe-iteration-closing': 44, + '../internals/function-bind-context': 72, + '../internals/get-iterator-method': 75, + '../internals/is-array-iterator-method': 89, + '../internals/to-length': 154 + } + ], + 96: [ + function (_dereq_, module, exports) { + 'use strict'; + var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var has = _dereq_('../internals/has'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var IS_PURE = _dereq_('../internals/is-pure'); + var ITERATOR = wellKnownSymbol('iterator'); + var BUGGY_SAFARI_ITERATORS = false; + var returnThis = function () { + return this; + }; + // `%IteratorPrototype%` object + // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object + var IteratorPrototype, + PrototypeOfArrayIteratorPrototype, + arrayIterator; + if ([].keys) { + arrayIterator = [ + ].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } + } + if (IteratorPrototype == undefined) IteratorPrototype = { + }; + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { + createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); + } + module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS + }; + }, + { + '../internals/create-non-enumerable-property': 56, + '../internals/has': 78, + '../internals/is-pure': 93, + '../internals/object-get-prototype-of': 115, + '../internals/well-known-symbol': 166 + } + ], + 97: [ + function (_dereq_, module, exports) { + module.exports = { + }; + }, + { + } + ], + 98: [ + function (_dereq_, module, exports) { + // `Math.sign` method implementation + // https://tc39.github.io/ecma262/#sec-math.sign + module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = + x) == 0 || x != x ? x : x < 0 ? - 1 : 1; + }; + }, + { + } + ], + 99: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; + var classof = _dereq_('../internals/classof-raw'); + var macrotask = _dereq_('../internals/task').set; + var IS_IOS = _dereq_('../internals/engine-is-ios'); + var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; + var process = global.process; + var Promise = global.Promise; + var IS_NODE = classof(process) == 'process'; + // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` + var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); + var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; + var flush, + head, + last, + notify, + toggle, + node, + promise, + then; + // modern engines have queueMicrotask method + if (!queueMicrotask) { + flush = function () { + var parent, + fn; + if (IS_NODE && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (error) { + if (head) notify(); + else last = undefined; + throw error; + } + } + last = undefined; + if (parent) parent.enter(); + }; + // Node.js + if (IS_NODE) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + } else if (MutationObserver && !IS_IOS) { + toggle = true; + node = document.createTextNode(''); + new MutationObserver(flush).observe(node, { + characterData: true + }); + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + promise = Promise.resolve(undefined); + then = promise.then; + notify = function () { + then.call(promise, flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + } + module.exports = queueMicrotask || function (fn) { + var task = { + fn: fn, + next: undefined + }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } + last = task; + }; + }, + { + '../internals/classof-raw': 46, + '../internals/engine-is-ios': 64, + '../internals/global': 77, + '../internals/object-get-own-property-descriptor': 111, + '../internals/task': 148 + } + ], + 100: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + module.exports = global.Promise; + }, + { + '../internals/global': 77 + } + ], + 101: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + // Chrome 38 Symbol has incorrect toString conversion + // eslint-disable-next-line no-undef + return !String(Symbol()); + }); + }, + { + '../internals/fails': 69 + } + ], + 102: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var IS_PURE = _dereq_('../internals/is-pure'); + var ITERATOR = wellKnownSymbol('iterator'); + module.exports = !fails(function () { + var url = new URL('b?a=1&b=2&c=3', 'http://a'); + var searchParams = url.searchParams; + var result = ''; + url.pathname = 'c%20d'; + searchParams.forEach(function (value, key) { + searchParams['delete']('b'); + result += key + value; + }); + return IS_PURE && !url.toJSON || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[ITERATOR] // throws in Edge + || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge + || new URL('http://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- + || new URL('http://a#б').hash !== '#%D0%B1' // fails in Chrome 66- + || result !== 'a1c3' // throws in Safari + || new URL('http://x', undefined).host !== 'x'; + }); + }, + { + '../internals/fails': 69, + '../internals/is-pure': 93, + '../internals/well-known-symbol': 166 + } + ], + 103: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var inspectSource = _dereq_('../internals/inspect-source'); + var WeakMap = global.WeakMap; + module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); + }, + { + '../internals/global': 77, + '../internals/inspect-source': 86 + } + ], + 104: [ + function (_dereq_, module, exports) { + 'use strict'; + var aFunction = _dereq_('../internals/a-function'); + var PromiseCapability = function (C) { + var resolve, + reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); + }; + // 25.4.1.5 NewPromiseCapability(C) + module.exports.f = function (C) { + return new PromiseCapability(C); + }; + }, + { + '../internals/a-function': 23 + } + ], + 105: [ + function (_dereq_, module, exports) { + var isRegExp = _dereq_('../internals/is-regexp'); + module.exports = function (it) { + if (isRegExp(it)) { + throw TypeError('The method doesn\'t accept regular expressions'); + } + return it; + }; + }, + { + '../internals/is-regexp': 94 + } + ], + 106: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var globalIsFinite = global.isFinite; + // `Number.isFinite` method + // https://tc39.github.io/ecma262/#sec-number.isfinite + module.exports = Number.isFinite || function isFinite(it) { + return typeof it == 'number' && globalIsFinite(it); + }; + }, + { + '../internals/global': 77 + } + ], + 107: [ + function (_dereq_, module, exports) { + 'use strict'; + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var fails = _dereq_('../internals/fails'); + var objectKeys = _dereq_('../internals/object-keys'); + var getOwnPropertySymbolsModule = _dereq_('../internals/object-get-own-property-symbols'); + var propertyIsEnumerableModule = _dereq_('../internals/object-property-is-enumerable'); + var toObject = _dereq_('../internals/to-object'); + var IndexedObject = _dereq_('../internals/indexed-object'); + var nativeAssign = Object.assign; + var defineProperty = Object.defineProperty; + // `Object.assign` method + // https://tc39.github.io/ecma262/#sec-object.assign + module.exports = !nativeAssign || fails(function () { + // should have correct order of operations (Edge bug) + if (DESCRIPTORS && nativeAssign({ + b: 1 + }, nativeAssign(defineProperty({ + }, 'a', { + enumerable: true, + get: function () { + defineProperty(this, 'b', { + value: 3, + enumerable: false + }); + } + }), { + b: 2 + })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) + var A = { + }; + var B = { + }; + // eslint-disable-next-line no-undef + var symbol = Symbol(); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { + B[chr] = chr; + }); + return nativeAssign({ + }, A) [symbol] != 7 || objectKeys(nativeAssign({ + }, B)).join('') != alphabet; + }) ? function assign(target, source) { + // eslint-disable-line no-unused-vars + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; + } + } + return T; + } + : nativeAssign; + }, + { + '../internals/descriptors': 61, + '../internals/fails': 69, + '../internals/indexed-object': 84, + '../internals/object-get-own-property-symbols': 114, + '../internals/object-keys': 117, + '../internals/object-property-is-enumerable': 118, + '../internals/to-object': 155 + } + ], + 108: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + var defineProperties = _dereq_('../internals/object-define-properties'); + var enumBugKeys = _dereq_('../internals/enum-bug-keys'); + var hiddenKeys = _dereq_('../internals/hidden-keys'); + var html = _dereq_('../internals/html'); + var documentCreateElement = _dereq_('../internals/document-create-element'); + var sharedKey = _dereq_('../internals/shared-key'); + var GT = '>'; + var LT = '<'; + var PROTOTYPE = 'prototype'; + var SCRIPT = 'script'; + var IE_PROTO = sharedKey('IE_PROTO'); + var EmptyConstructor = function () { /* empty */ + }; + var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; + }; + // Create object with fake `null` prototype: use ActiveX Object with cleared prototype + var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag('')); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; + }; + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var JS = 'java' + SCRIPT + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + return iframeDocument.F; + }; + // Check for document.domain and active x support + // No need to use active x approach when document.domain is not set + // see https://github.com/es-shims/es5-shim/issues/150 + // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 + // avoid IE GC bug + var activeXDocument; + var NullProtoObject = function () { + try { + /* global ActiveXObject */ + activeXDocument = document.domain && new ActiveXObject('htmlfile'); + } catch (error) { /* ignore */ + } + NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); + var length = enumBugKeys.length; + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); + }; + hiddenKeys[IE_PROTO] = true; + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined ? result : defineProperties(result, Properties); + }; + }, + { + '../internals/an-object': 28, + '../internals/document-create-element': 62, + '../internals/enum-bug-keys': 67, + '../internals/hidden-keys': 79, + '../internals/html': 81, + '../internals/object-define-properties': 109, + '../internals/shared-key': 136 + } + ], + 109: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var anObject = _dereq_('../internals/an-object'); + var objectKeys = _dereq_('../internals/object-keys'); + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); + return O; + }; + }, + { + '../internals/an-object': 28, + '../internals/descriptors': 61, + '../internals/object-define-property': 110, + '../internals/object-keys': 117 + } + ], + 110: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var IE8_DOM_DEFINE = _dereq_('../internals/ie8-dom-define'); + var anObject = _dereq_('../internals/an-object'); + var toPrimitive = _dereq_('../internals/to-primitive'); + var nativeDefineProperty = Object.defineProperty; + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return nativeDefineProperty(O, P, Attributes); + } catch (error) { /* empty */ + } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; + }; + }, + { + '../internals/an-object': 28, + '../internals/descriptors': 61, + '../internals/ie8-dom-define': 82, + '../internals/to-primitive': 158 + } + ], + 111: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var propertyIsEnumerableModule = _dereq_('../internals/object-property-is-enumerable'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var toPrimitive = _dereq_('../internals/to-primitive'); + var has = _dereq_('../internals/has'); + var IE8_DOM_DEFINE = _dereq_('../internals/ie8-dom-define'); + var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ + } + if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); + }; + }, + { + '../internals/create-property-descriptor': 57, + '../internals/descriptors': 61, + '../internals/has': 78, + '../internals/ie8-dom-define': 82, + '../internals/object-property-is-enumerable': 118, + '../internals/to-indexed-object': 152, + '../internals/to-primitive': 158 + } + ], + 112: [ + function (_dereq_, module, exports) { + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var nativeGetOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; + var toString = { + }.toString; + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [ + ]; + var getWindowNames = function (it) { + try { + return nativeGetOwnPropertyNames(it); + } catch (error) { + return windowNames.slice(); + } + }; + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it)); + }; + }, + { + '../internals/object-get-own-property-names': 113, + '../internals/to-indexed-object': 152 + } + ], + 113: [ + function (_dereq_, module, exports) { + var internalObjectKeys = _dereq_('../internals/object-keys-internal'); + var enumBugKeys = _dereq_('../internals/enum-bug-keys'); + var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); + }; + }, + { + '../internals/enum-bug-keys': 67, + '../internals/object-keys-internal': 116 + } + ], + 114: [ + function (_dereq_, module, exports) { + exports.f = Object.getOwnPropertySymbols; + }, + { + } + ], + 115: [ + function (_dereq_, module, exports) { + var has = _dereq_('../internals/has'); + var toObject = _dereq_('../internals/to-object'); + var sharedKey = _dereq_('../internals/shared-key'); + var CORRECT_PROTOTYPE_GETTER = _dereq_('../internals/correct-prototype-getter'); + var IE_PROTO = sharedKey('IE_PROTO'); + var ObjectPrototype = Object.prototype; + // `Object.getPrototypeOf` method + // https://tc39.github.io/ecma262/#sec-object.getprototypeof + module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } + return O instanceof Object ? ObjectPrototype : null; + }; + }, + { + '../internals/correct-prototype-getter': 53, + '../internals/has': 78, + '../internals/shared-key': 136, + '../internals/to-object': 155 + } + ], + 116: [ + function (_dereq_, module, exports) { + var has = _dereq_('../internals/has'); + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var indexOf = _dereq_('../internals/array-includes').indexOf; + var hiddenKeys = _dereq_('../internals/hidden-keys'); + module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = [ + ]; + var key; + for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~indexOf(result, key) || result.push(key); + } + return result; + }; + }, + { + '../internals/array-includes': 36, + '../internals/has': 78, + '../internals/hidden-keys': 79, + '../internals/to-indexed-object': 152 + } + ], + 117: [ + function (_dereq_, module, exports) { + var internalObjectKeys = _dereq_('../internals/object-keys-internal'); + var enumBugKeys = _dereq_('../internals/enum-bug-keys'); + // `Object.keys` method + // https://tc39.github.io/ecma262/#sec-object.keys + module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); + }; + }, + { + '../internals/enum-bug-keys': 67, + '../internals/object-keys-internal': 116 + } + ], + 118: [ + function (_dereq_, module, exports) { + 'use strict'; + var nativePropertyIsEnumerable = { + }.propertyIsEnumerable; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + // Nashorn ~ JDK8 bug + var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ + 1: 2 + }, 1); + // `Object.prototype.propertyIsEnumerable` method implementation + // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable + exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; + } + : nativePropertyIsEnumerable; + }, + { + } + ], + 119: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + var aPossiblePrototype = _dereq_('../internals/a-possible-prototype'); + // `Object.setPrototypeOf` method + // https://tc39.github.io/ecma262/#sec-object.setprototypeof + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + module.exports = Object.setPrototypeOf || ('__proto__' in { + } + ? function () { + var CORRECT_SETTER = false; + var test = { + }; + var setter; + try { + setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; + setter.call(test, [ + ]); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ + } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter.call(O, proto); + else O.__proto__ = proto; + return O; + }; + }() : undefined); + }, + { + '../internals/a-possible-prototype': 24, + '../internals/an-object': 28 + } + ], + 120: [ + function (_dereq_, module, exports) { + 'use strict'; + var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support'); + var classof = _dereq_('../internals/classof'); + // `Object.prototype.toString` method implementation + // https://tc39.github.io/ecma262/#sec-object.prototype.tostring + module.exports = TO_STRING_TAG_SUPPORT ? { + }.toString : function toString() { + return '[object ' + classof(this) + ']'; + }; + }, + { + '../internals/classof': 47, + '../internals/to-string-tag-support': 159 + } + ], + 121: [ + function (_dereq_, module, exports) { + var getBuiltIn = _dereq_('../internals/get-built-in'); + var getOwnPropertyNamesModule = _dereq_('../internals/object-get-own-property-names'); + var getOwnPropertySymbolsModule = _dereq_('../internals/object-get-own-property-symbols'); + var anObject = _dereq_('../internals/an-object'); + // all object keys, includes non-enumerable and symbols + module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; + }; + }, + { + '../internals/an-object': 28, + '../internals/get-built-in': 74, + '../internals/object-get-own-property-names': 113, + '../internals/object-get-own-property-symbols': 114 + } + ], + 122: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + module.exports = global; + }, + { + '../internals/global': 77 + } + ], + 123: [ + function (_dereq_, module, exports) { + module.exports = function (exec) { + try { + return { + error: false, + value: exec() + }; + } catch (error) { + return { + error: true, + value: error + }; + } + }; + }, + { + } + ], + 124: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + var isObject = _dereq_('../internals/is-object'); + var newPromiseCapability = _dereq_('../internals/new-promise-capability'); + module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; + }; + }, + { + '../internals/an-object': 28, + '../internals/is-object': 92, + '../internals/new-promise-capability': 104 + } + ], + 125: [ + function (_dereq_, module, exports) { + var redefine = _dereq_('../internals/redefine'); + module.exports = function (target, src, options) { + for (var key in src) redefine(target, key, src[key], options); + return target; + }; + }, + { + '../internals/redefine': 126 + } + ], + 126: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var has = _dereq_('../internals/has'); + var setGlobal = _dereq_('../internals/set-global'); + var inspectSource = _dereq_('../internals/inspect-source'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var getInternalState = InternalStateModule.get; + var enforceInternalState = InternalStateModule.enforce; + var TEMPLATE = String(String).split('String'); + (module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + if (typeof value == 'function') { + if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); + enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else createNonEnumerableProperty(O, key, value); + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + }) (Function.prototype, 'toString', function toString() { + return typeof this == 'function' && getInternalState(this).source || inspectSource(this); + }); + }, + { + '../internals/create-non-enumerable-property': 56, + '../internals/global': 77, + '../internals/has': 78, + '../internals/inspect-source': 86, + '../internals/internal-state': 88, + '../internals/set-global': 133 + } + ], + 127: [ + function (_dereq_, module, exports) { + var classof = _dereq_('./classof-raw'); + var regexpExec = _dereq_('./regexp-exec'); + // `RegExpExec` abstract operation + // https://tc39.github.io/ecma262/#sec-regexpexec + module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + if (classof(R) !== 'RegExp') { + throw TypeError('RegExp#exec called on incompatible receiver'); + } + return regexpExec.call(R, S); + }; + }, + { + './classof-raw': 46, + './regexp-exec': 128 + } + ], + 128: [ + function (_dereq_, module, exports) { + 'use strict'; + var regexpFlags = _dereq_('./regexp-flags'); + var stickyHelpers = _dereq_('./regexp-sticky-helpers'); + var nativeExec = RegExp.prototype.exec; + // This always refers to the native implementation, because the + // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, + // which loads this file before patching the method. + var nativeReplace = String.prototype.replace; + var patchedExec = nativeExec; + var UPDATES_LAST_INDEX_WRONG = function () { + var re1 = /a/; + var re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; + }(); + var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET; + // nonparticipating capturing group, copied from es5-shim's String#split patch. + var NPCG_INCLUDED = /()??/.exec('') [1] !== undefined; + var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y; + if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, + reCopy, + match, + i; + var sticky = UNSUPPORTED_Y && re.sticky; + var flags = regexpFlags.call(re); + var source = re.source; + var charsAdded = 0; + var strCopy = str; + if (sticky) { + flags = flags.replace('y', ''); + if (flags.indexOf('g') === - 1) { + flags += 'g'; + } + strCopy = String(str).slice(re.lastIndex); + // Support anchored sticky behavior. + if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) { + source = '(?: ' + source + ')'; + strCopy = ' ' + strCopy; + charsAdded++; + } // ^(? + rx + ) is needed, in combination with some str slicing, to + // simulate the 'y' flag. + + reCopy = new RegExp('^(?:' + source + ')', flags); + } + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + source + '$(?!\\s)', flags); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; + match = nativeExec.call(sticky ? reCopy : re, strCopy); + if (sticky) { + if (match) { + match.input = match.input.slice(charsAdded); + match[0] = match[0].slice(charsAdded); + match.index = re.lastIndex; + re.lastIndex += match[0].length; + } else re.lastIndex = 0; + } else if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + return match; + }; + } + module.exports = patchedExec; + }, + { + './regexp-flags': 129, + './regexp-sticky-helpers': 130 + } + ], + 129: [ + function (_dereq_, module, exports) { + 'use strict'; + var anObject = _dereq_('../internals/an-object'); + // `RegExp.prototype.flags` getter implementation + // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags + module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.dotAll) result += 's'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; + }; + }, + { + '../internals/an-object': 28 + } + ], + 130: [ + function (_dereq_, module, exports) { + 'use strict'; + var fails = _dereq_('./fails'); + // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError, + // so we use an intermediate function. + function RE(s, f) { + return RegExp(s, f); + } + exports.UNSUPPORTED_Y = fails(function () { + // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError + var re = RE('a', 'y'); + re.lastIndex = 2; + return re.exec('abcd') != null; + }); + exports.BROKEN_CARET = fails(function () { + // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 + var re = RE('^r', 'gy'); + re.lastIndex = 2; + return re.exec('str') != null; + }); + }, + { + './fails': 69 + } + ], + 131: [ + function (_dereq_, module, exports) { + // `RequireObjectCoercible` abstract operation + // https://tc39.github.io/ecma262/#sec-requireobjectcoercible + module.exports = function (it) { + if (it == undefined) throw TypeError('Can\'t call method on ' + it); + return it; + }; + }, + { + } + ], + 132: [ + function (_dereq_, module, exports) { + // `SameValue` abstract operation + // https://tc39.github.io/ecma262/#sec-samevalue + module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + }, + { + } + ], + 133: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + module.exports = function (key, value) { + try { + createNonEnumerableProperty(global, key, value); + } catch (error) { + global[key] = value; + } + return value; + }; + }, + { + '../internals/create-non-enumerable-property': 56, + '../internals/global': 77 + } + ], + 134: [ + function (_dereq_, module, exports) { + 'use strict'; + var getBuiltIn = _dereq_('../internals/get-built-in'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var SPECIES = wellKnownSymbol('species'); + module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = definePropertyModule.f; + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineProperty(Constructor, SPECIES, { + configurable: true, + get: function () { + return this; + } + }); + } + }; + }, + { + '../internals/descriptors': 61, + '../internals/get-built-in': 74, + '../internals/object-define-property': 110, + '../internals/well-known-symbol': 166 + } + ], + 135: [ + function (_dereq_, module, exports) { + var defineProperty = _dereq_('../internals/object-define-property').f; + var has = _dereq_('../internals/has'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + module.exports = function (it, TAG, STATIC) { + if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { + defineProperty(it, TO_STRING_TAG, { + configurable: true, + value: TAG + }); + } + }; + }, + { + '../internals/has': 78, + '../internals/object-define-property': 110, + '../internals/well-known-symbol': 166 + } + ], + 136: [ + function (_dereq_, module, exports) { + var shared = _dereq_('../internals/shared'); + var uid = _dereq_('../internals/uid'); + var keys = shared('keys'); + module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); + }; + }, + { + '../internals/shared': 138, + '../internals/uid': 163 + } + ], + 137: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var setGlobal = _dereq_('../internals/set-global'); + var SHARED = '__core-js_shared__'; + var store = global[SHARED] || setGlobal(SHARED, { + }); + module.exports = store; + }, + { + '../internals/global': 77, + '../internals/set-global': 133 + } + ], + 138: [ + function (_dereq_, module, exports) { + var IS_PURE = _dereq_('../internals/is-pure'); + var store = _dereq_('../internals/shared-store'); + (module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : { + }); + }) ('versions', [ + ]).push({ + version: '3.6.5', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2020 Denis Pushkarev (zloirock.ru)' + }); + }, + { + '../internals/is-pure': 93, + '../internals/shared-store': 137 + } + ], + 139: [ + function (_dereq_, module, exports) { + var anObject = _dereq_('../internals/an-object'); + var aFunction = _dereq_('../internals/a-function'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var SPECIES = wellKnownSymbol('species'); + // `SpeciesConstructor` abstract operation + // https://tc39.github.io/ecma262/#sec-speciesconstructor + module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C) [SPECIES]) == undefined ? defaultConstructor : aFunction(S); + }; + }, + { + '../internals/a-function': 23, + '../internals/an-object': 28, + '../internals/well-known-symbol': 166 + } + ], + 140: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + // check the existence of a method, lowercase + // of a tag and escaping quotes in arguments + module.exports = function (METHOD_NAME) { + return fails(function () { + var test = ''[METHOD_NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }); + }; + }, + { + '../internals/fails': 69 + } + ], + 141: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_('../internals/to-integer'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + // `String.prototype.{ codePointAt, at }` methods implementation + var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = String(requireObjectCoercible($this)); + var position = toInteger(pos); + var size = S.length; + var first, + second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = S.charCodeAt(position); + return first < 55296 || first > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536; + }; + }; + module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true) + }; + }, + { + '../internals/require-object-coercible': 131, + '../internals/to-integer': 153 + } + ], + 142: [ + function (_dereq_, module, exports) { + // https://github.com/zloirock/core-js/issues/280 + var userAgent = _dereq_('../internals/engine-user-agent'); + // eslint-disable-next-line unicorn/no-unsafe-regex + module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); + }, + { + '../internals/engine-user-agent': 65 + } + ], + 143: [ + function (_dereq_, module, exports) { + // https://github.com/tc39/proposal-string-pad-start-end + var toLength = _dereq_('../internals/to-length'); + var repeat = _dereq_('../internals/string-repeat'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var ceil = Math.ceil; + // `String.prototype.{ padStart, padEnd }` methods implementation + var createMethod = function (IS_END) { + return function ($this, maxLength, fillString) { + var S = String(requireObjectCoercible($this)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + var fillLen, + stringFiller; + if (intMaxLength <= stringLength || fillStr == '') return S; + fillLen = intMaxLength - stringLength; + stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return IS_END ? S + stringFiller : stringFiller + S; + }; + }; + module.exports = { + // `String.prototype.padStart` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + start: createMethod(false), + // `String.prototype.padEnd` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padend + end: createMethod(true) + }; + }, + { + '../internals/require-object-coercible': 131, + '../internals/string-repeat': 145, + '../internals/to-length': 154 + } + ], + 144: [ + function (_dereq_, module, exports) { + 'use strict'; + // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js + var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; // 0x80 + var delimiter = '-'; // '\x2D' + var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars + var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; + var baseMinusTMin = base - tMin; + var floor = Math.floor; + var stringFromCharCode = String.fromCharCode; + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + */ + var ucs2decode = function (string) { + var output = [ + ]; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 55296 && value <= 56319 && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + // Low surrogate. + output.push(((value & 1023) << 10) + (extra & 1023) + 65536); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + }; + /** + * Converts a digit/integer into a basic code point. + */ + var digitToBasic = function (digit) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26); + }; + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + */ + var adapt = function (delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + }; + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + */ + // eslint-disable-next-line max-statements + var encode = function (input) { + var output = [ + ]; + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + // Cache the length. + var inputLength = input.length; + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + var i, + currentValue; + // Handle the basic code points. + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < 128) { + output.push(stringFromCharCode(currentValue)); + } + } + var basicLength = output.length; // number of basic code points. + var handledCPCount = basicLength; // number of code points that have been handled; + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } // Main encoding loop: + + while (handledCPCount < inputLength) { + // All non-basic code points < n have been handled already. Find the next larger one: + var m = maxInt; + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } // Increase `delta` enough to advance the decoder's state to , but guard against overflow. + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + throw RangeError(OVERFLOW_ERROR); + } + delta += (m - n) * handledCPCountPlusOne; + n = m; + for (i = 0; i < input.length; i++) { + currentValue = input[i]; + if (currentValue < n && ++delta > maxInt) { + throw RangeError(OVERFLOW_ERROR); + } + if (currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for /* no condition */ + (var k = base; ; k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) break; + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); + q = floor(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n; + } + return output.join(''); + }; + module.exports = function (input) { + var encoded = [ + ]; + var labels = input.toLowerCase().replace(regexSeparators, '.').split('.'); + var i, + label; + for (i = 0; i < labels.length; i++) { + label = labels[i]; + encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); + } + return encoded.join('.'); + }; + }, + { + } + ], + 145: [ + function (_dereq_, module, exports) { + 'use strict'; + var toInteger = _dereq_('../internals/to-integer'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + // `String.prototype.repeat` method implementation + // https://tc39.github.io/ecma262/#sec-string.prototype.repeat + module.exports = ''.repeat || function repeat(count) { + var str = String(requireObjectCoercible(this)); + var result = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions'); + for (; n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; + return result; + }; + }, + { + '../internals/require-object-coercible': 131, + '../internals/to-integer': 153 + } + ], + 146: [ + function (_dereq_, module, exports) { + var fails = _dereq_('../internals/fails'); + var whitespaces = _dereq_('../internals/whitespaces'); + var non = '​…᠎'; + // check that a method works with the correct list + // of whitespaces and has a correct name + module.exports = function (METHOD_NAME) { + return fails(function () { + return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; + }); + }; + }, + { + '../internals/fails': 69, + '../internals/whitespaces': 167 + } + ], + 147: [ + function (_dereq_, module, exports) { + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var whitespaces = _dereq_('../internals/whitespaces'); + var whitespace = '[' + whitespaces + ']'; + var ltrim = RegExp('^' + whitespace + whitespace + '*'); + var rtrim = RegExp(whitespace + whitespace + '*$'); + // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation + var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; + }; + module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + trim: createMethod(3) + }; + }, + { + '../internals/require-object-coercible': 131, + '../internals/whitespaces': 167 + } + ], + 148: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var fails = _dereq_('../internals/fails'); + var classof = _dereq_('../internals/classof-raw'); + var bind = _dereq_('../internals/function-bind-context'); + var html = _dereq_('../internals/html'); + var createElement = _dereq_('../internals/document-create-element'); + var IS_IOS = _dereq_('../internals/engine-is-ios'); + var location = global.location; + var set = global.setImmediate; + var clear = global.clearImmediate; + var process = global.process; + var MessageChannel = global.MessageChannel; + var Dispatch = global.Dispatch; + var counter = 0; + var queue = { + }; + var ONREADYSTATECHANGE = 'onreadystatechange'; + var defer, + channel, + port; + var run = function (id) { + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var runner = function (id) { + return function () { + run(id); + }; + }; + var listener = function (event) { + run(event.data); + }; + var post = function (id) { + // old engines have not location.origin + global.postMessage(id + '', location.protocol + '//' + location.host); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if (!set || !clear) { + set = function setImmediate(fn) { + var args = [ + ]; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); + }; + defer(counter); + return counter; + }; + clear = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (classof(process) == 'process') { + defer = function (id) { + process.nextTick(runner(id)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(runner(id)); + }; + // Browsers with MessageChannel, includes WebWorkers + // except iOS - https://github.com/zloirock/core-js/issues/624 + } else if (MessageChannel && !IS_IOS) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = bind(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post) && location.protocol !== 'file:') { + defer = post; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in createElement('script')) { + defer = function (id) { + html.appendChild(createElement('script')) [ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(runner(id), 0); + }; + } + } + module.exports = { + set: set, + clear: clear + }; + }, + { + '../internals/classof-raw': 46, + '../internals/document-create-element': 62, + '../internals/engine-is-ios': 64, + '../internals/fails': 69, + '../internals/function-bind-context': 72, + '../internals/global': 77, + '../internals/html': 81 + } + ], + 149: [ + function (_dereq_, module, exports) { + var classof = _dereq_('../internals/classof-raw'); + // `thisNumberValue` abstract operation + // https://tc39.github.io/ecma262/#sec-thisnumbervalue + module.exports = function (value) { + if (typeof value != 'number' && classof(value) != 'Number') { + throw TypeError('Incorrect invocation'); + } + return + value; + }; + }, + { + '../internals/classof-raw': 46 + } + ], + 150: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_('../internals/to-integer'); + var max = Math.max; + var min = Math.min; + // Helper for a popular repeating case of the spec: + // Let integer be ? ToInteger(index). + // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). + module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); + }; + }, + { + '../internals/to-integer': 153 + } + ], + 151: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_('../internals/to-integer'); + var toLength = _dereq_('../internals/to-length'); + // `ToIndex` abstract operation + // https://tc39.github.io/ecma262/#sec-toindex + module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length or index'); + return length; + }; + }, + { + '../internals/to-integer': 153, + '../internals/to-length': 154 + } + ], + 152: [ + function (_dereq_, module, exports) { + // toObject with fallback for non-array-like ES3 strings + var IndexedObject = _dereq_('../internals/indexed-object'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); + }; + }, + { + '../internals/indexed-object': 84, + '../internals/require-object-coercible': 131 + } + ], + 153: [ + function (_dereq_, module, exports) { + var ceil = Math.ceil; + var floor = Math.floor; + // `ToInteger` abstract operation + // https://tc39.github.io/ecma262/#sec-tointeger + module.exports = function (argument) { + return isNaN(argument = + argument) ? 0 : (argument > 0 ? floor : ceil) (argument); + }; + }, + { + } + ], + 154: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_('../internals/to-integer'); + var min = Math.min; + // `ToLength` abstract operation + // https://tc39.github.io/ecma262/#sec-tolength + module.exports = function (argument) { + return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0; // 2 ** 53 - 1 == 9007199254740991 + }; + }, + { + '../internals/to-integer': 153 + } + ], + 155: [ + function (_dereq_, module, exports) { + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + // `ToObject` abstract operation + // https://tc39.github.io/ecma262/#sec-toobject + module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); + }; + }, + { + '../internals/require-object-coercible': 131 + } + ], + 156: [ + function (_dereq_, module, exports) { + var toPositiveInteger = _dereq_('../internals/to-positive-integer'); + module.exports = function (it, BYTES) { + var offset = toPositiveInteger(it); + if (offset % BYTES) throw RangeError('Wrong offset'); + return offset; + }; + }, + { + '../internals/to-positive-integer': 157 + } + ], + 157: [ + function (_dereq_, module, exports) { + var toInteger = _dereq_('../internals/to-integer'); + module.exports = function (it) { + var result = toInteger(it); + if (result < 0) throw RangeError('The argument can\'t be less than 0'); + return result; + }; + }, + { + '../internals/to-integer': 153 + } + ], + 158: [ + function (_dereq_, module, exports) { + var isObject = _dereq_('../internals/is-object'); + // `ToPrimitive` abstract operation + // https://tc39.github.io/ecma262/#sec-toprimitive + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + module.exports = function (input, PREFERRED_STRING) { + if (!isObject(input)) return input; + var fn, + val; + if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; + if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + throw TypeError('Can\'t convert object to primitive value'); + }; + }, + { + '../internals/is-object': 92 + } + ], + 159: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + var test = { + }; + test[TO_STRING_TAG] = 'z'; + module.exports = String(test) === '[object z]'; + }, + { + '../internals/well-known-symbol': 166 + } + ], + 160: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var global = _dereq_('../internals/global'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = _dereq_('../internals/typed-array-constructors-require-wrappers'); + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var ArrayBufferModule = _dereq_('../internals/array-buffer'); + var anInstance = _dereq_('../internals/an-instance'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var toLength = _dereq_('../internals/to-length'); + var toIndex = _dereq_('../internals/to-index'); + var toOffset = _dereq_('../internals/to-offset'); + var toPrimitive = _dereq_('../internals/to-primitive'); + var has = _dereq_('../internals/has'); + var classof = _dereq_('../internals/classof'); + var isObject = _dereq_('../internals/is-object'); + var create = _dereq_('../internals/object-create'); + var setPrototypeOf = _dereq_('../internals/object-set-prototype-of'); + var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; + var typedArrayFrom = _dereq_('../internals/typed-array-from'); + var forEach = _dereq_('../internals/array-iteration').forEach; + var setSpecies = _dereq_('../internals/set-species'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var inheritIfRequired = _dereq_('../internals/inherit-if-required'); + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var nativeDefineProperty = definePropertyModule.f; + var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var round = Math.round; + var RangeError = global.RangeError; + var ArrayBuffer = ArrayBufferModule.ArrayBuffer; + var DataView = ArrayBufferModule.DataView; + var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; + var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; + var TypedArray = ArrayBufferViewCore.TypedArray; + var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var isTypedArray = ArrayBufferViewCore.isTypedArray; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var WRONG_LENGTH = 'Wrong length'; + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C)) (length); + while (length > index) result[index] = list[index++]; + return result; + }; + var addGetter = function (it, key) { + nativeDefineProperty(it, key, { + get: function () { + return getInternalState(this) [key]; + } + }); + }; + var isArrayBuffer = function (it) { + var klass; + return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; + }; + var isTypedArrayIndex = function (target, key) { + return isTypedArray(target) && typeof key != 'symbol' && key in target && String( + key) == String(key); + }; + var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { + return isTypedArrayIndex(target, key = toPrimitive(key, true)) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key); + }; + var wrappedDefineProperty = function defineProperty(target, key, descriptor) { + if (isTypedArrayIndex(target, key = toPrimitive(key, true)) && isObject(descriptor) && has(descriptor, 'value') && !has(descriptor, 'get') && !has(descriptor, 'set') // TODO: add validation descriptor w/o calling accessors + && !descriptor.configurable && (!has(descriptor, 'writable') || descriptor.writable) && (!has(descriptor, 'enumerable') || descriptor.enumerable)) { + target[key] = descriptor.value; + return target; + } + return nativeDefineProperty(target, key, descriptor); + }; + if (DESCRIPTORS) { + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; + definePropertyModule.f = wrappedDefineProperty; + addGetter(TypedArrayPrototype, 'buffer'); + addGetter(TypedArrayPrototype, 'byteOffset'); + addGetter(TypedArrayPrototype, 'byteLength'); + addGetter(TypedArrayPrototype, 'length'); + } + $({ + target: 'Object', + stat: true, + forced: !NATIVE_ARRAY_BUFFER_VIEWS + }, { + getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, + defineProperty: wrappedDefineProperty + }); + module.exports = function (TYPE, wrapper, CLAMPED) { + var BYTES = TYPE.match(/\d+$/) [0] / 8; + var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + TYPE; + var SETTER = 'set' + TYPE; + var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; + var TypedArrayConstructor = NativeTypedArrayConstructor; + var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; + var exported = { + }; + var getter = function (that, index) { + var data = getInternalState(that); + return data.view[GETTER](index * BYTES + data.byteOffset, true); + }; + var setter = function (that, index, value) { + var data = getInternalState(that); + if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 255 ? 255 : value & 255; + data.view[SETTER](index * BYTES + data.byteOffset, value, true); + }; + var addElement = function (that, index) { + nativeDefineProperty(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + TypedArrayConstructor = wrapper(function (that, data, offset, $length) { + anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME); + var index = 0; + var byteOffset = 0; + var buffer, + byteLength, + length; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new ArrayBuffer(byteLength); + } else if (isArrayBuffer(data)) { + buffer = data; + byteOffset = toOffset(offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - byteOffset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (isTypedArray(data)) { + return fromList(TypedArrayConstructor, data); + } else { + return typedArrayFrom.call(TypedArrayConstructor, data); + } + setInternalState(that, { + buffer: buffer, + byteOffset: byteOffset, + byteLength: byteLength, + length: length, + view: new DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); + } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { + TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { + anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); + return inheritIfRequired(function () { + if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); + if (isArrayBuffer(data)) return $length !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data); + if (isTypedArray(data)) return fromList(TypedArrayConstructor, data); + return typedArrayFrom.call(TypedArrayConstructor, data); + }(), dummy, TypedArrayConstructor); + }); + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { + if (!(key in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); + } + }); + TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; + } + if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); + } + if (TYPED_ARRAY_TAG) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); + } + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; + $({ + global: true, + forced: TypedArrayConstructor != NativeTypedArrayConstructor, + sham: !NATIVE_ARRAY_BUFFER_VIEWS + }, exported); + if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); + } + if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); + } + setSpecies(CONSTRUCTOR_NAME); + }; + } else module.exports = function () { /* empty */ + }; + }, + { + '../internals/an-instance': 27, + '../internals/array-buffer': 31, + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37, + '../internals/classof': 47, + '../internals/create-non-enumerable-property': 56, + '../internals/create-property-descriptor': 57, + '../internals/descriptors': 61, + '../internals/export': 68, + '../internals/global': 77, + '../internals/has': 78, + '../internals/inherit-if-required': 85, + '../internals/internal-state': 88, + '../internals/is-object': 92, + '../internals/object-create': 108, + '../internals/object-define-property': 110, + '../internals/object-get-own-property-descriptor': 111, + '../internals/object-get-own-property-names': 113, + '../internals/object-set-prototype-of': 119, + '../internals/set-species': 134, + '../internals/to-index': 151, + '../internals/to-length': 154, + '../internals/to-offset': 156, + '../internals/to-primitive': 158, + '../internals/typed-array-constructors-require-wrappers': 161, + '../internals/typed-array-from': 162 + } + ], + 161: [ + function (_dereq_, module, exports) { + /* eslint-disable no-new */ + var global = _dereq_('../internals/global'); + var fails = _dereq_('../internals/fails'); + var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); + var NATIVE_ARRAY_BUFFER_VIEWS = _dereq_('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS; + var ArrayBuffer = global.ArrayBuffer; + var Int8Array = global.Int8Array; + module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { + Int8Array(1); + }) || !fails(function () { + new Int8Array( - 1); + }) || !checkCorrectnessOfIteration(function (iterable) { + new Int8Array(); + new Int8Array(null); + new Int8Array(1.5); + new Int8Array(iterable); + }, true) || fails(function () { + // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill + return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/check-correctness-of-iteration': 45, + '../internals/fails': 69, + '../internals/global': 77 + } + ], + 162: [ + function (_dereq_, module, exports) { + var toObject = _dereq_('../internals/to-object'); + var toLength = _dereq_('../internals/to-length'); + var getIteratorMethod = _dereq_('../internals/get-iterator-method'); + var isArrayIteratorMethod = _dereq_('../internals/is-array-iterator-method'); + var bind = _dereq_('../internals/function-bind-context'); + var aTypedArrayConstructor = _dereq_('../internals/array-buffer-view-core').aTypedArrayConstructor; + module.exports = function from(source /* , mapfn, thisArg */ ) { + var O = toObject(source); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var i, + length, + result, + step, + iterator, + next; + if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) { + iterator = iteratorMethod.call(O); + next = iterator.next; + O = [ + ]; + while (!(step = next.call(iterator)).done) { + O.push(step.value); + } + } + if (mapping && argumentsLength > 2) { + mapfn = bind(mapfn, arguments[2], 2); + } + length = toLength(O.length); + result = new (aTypedArrayConstructor(this)) (length); + for (i = 0; length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/function-bind-context': 72, + '../internals/get-iterator-method': 75, + '../internals/is-array-iterator-method': 89, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 163: [ + function (_dereq_, module, exports) { + var id = 0; + var postfix = Math.random(); + module.exports = function (key) { + return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); + }; + }, + { + } + ], + 164: [ + function (_dereq_, module, exports) { + var NATIVE_SYMBOL = _dereq_('../internals/native-symbol'); + module.exports = NATIVE_SYMBOL // eslint-disable-next-line no-undef + && !Symbol.sham // eslint-disable-next-line no-undef + && typeof Symbol.iterator == 'symbol'; + }, + { + '../internals/native-symbol': 101 + } + ], + 165: [ + function (_dereq_, module, exports) { + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + exports.f = wellKnownSymbol; + }, + { + '../internals/well-known-symbol': 166 + } + ], + 166: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var shared = _dereq_('../internals/shared'); + var has = _dereq_('../internals/has'); + var uid = _dereq_('../internals/uid'); + var NATIVE_SYMBOL = _dereq_('../internals/native-symbol'); + var USE_SYMBOL_AS_UID = _dereq_('../internals/use-symbol-as-uid'); + var WellKnownSymbolsStore = shared('wks'); + var Symbol = global.Symbol; + var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; + module.exports = function (name) { + if (!has(WellKnownSymbolsStore, name)) { + if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; + else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); + } + return WellKnownSymbolsStore[name]; + }; + }, + { + '../internals/global': 77, + '../internals/has': 78, + '../internals/native-symbol': 101, + '../internals/shared': 138, + '../internals/uid': 163, + '../internals/use-symbol-as-uid': 164 + } + ], + 167: [ + function (_dereq_, module, exports) { + // a string of all valid unicode whitespaces + // eslint-disable-next-line max-len + module.exports = '\t\n\v\f\r                 \u2028\u2029'; + }, + { + } + ], + 168: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var global = _dereq_('../internals/global'); + var arrayBufferModule = _dereq_('../internals/array-buffer'); + var setSpecies = _dereq_('../internals/set-species'); + var ARRAY_BUFFER = 'ArrayBuffer'; + var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; + var NativeArrayBuffer = global[ARRAY_BUFFER]; + // `ArrayBuffer` constructor + // https://tc39.github.io/ecma262/#sec-arraybuffer-constructor + $({ + global: true, + forced: NativeArrayBuffer !== ArrayBuffer + }, { + ArrayBuffer: ArrayBuffer + }); + setSpecies(ARRAY_BUFFER); + }, + { + '../internals/array-buffer': 31, + '../internals/export': 68, + '../internals/global': 77, + '../internals/set-species': 134 + } + ], + 169: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var fails = _dereq_('../internals/fails'); + var isArray = _dereq_('../internals/is-array'); + var isObject = _dereq_('../internals/is-object'); + var toObject = _dereq_('../internals/to-object'); + var toLength = _dereq_('../internals/to-length'); + var createProperty = _dereq_('../internals/create-property'); + var arraySpeciesCreate = _dereq_('../internals/array-species-create'); + var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var V8_VERSION = _dereq_('../internals/engine-v8-version'); + var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); + var MAX_SAFE_INTEGER = 9007199254740991; + var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/679 + var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { + var array = [ + ]; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat() [0] !== array; + }); + var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); + var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); + }; + var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; + // `Array.prototype.concat` method + // https://tc39.github.io/ecma262/#sec-array.prototype.concat + // with adding support of @@isConcatSpreadable and @@species + $({ + target: 'Array', + proto: true, + forced: FORCED + }, { + concat: function concat(arg) { + // eslint-disable-line no-unused-vars + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, + k, + length, + len, + E; + for (i = - 1, length = arguments.length; i < length; i++) { + E = i === - 1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + createProperty(A, n++, E); + } + } + A.length = n; + return A; + } + }); + }, + { + '../internals/array-method-has-species-support': 39, + '../internals/array-species-create': 43, + '../internals/create-property': 58, + '../internals/engine-v8-version': 66, + '../internals/export': 68, + '../internals/fails': 69, + '../internals/is-array': 90, + '../internals/is-object': 92, + '../internals/to-length': 154, + '../internals/to-object': 155, + '../internals/well-known-symbol': 166 + } + ], + 170: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var copyWithin = _dereq_('../internals/array-copy-within'); + var addToUnscopables = _dereq_('../internals/add-to-unscopables'); + // `Array.prototype.copyWithin` method + // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin + $({ + target: 'Array', + proto: true + }, { + copyWithin: copyWithin + }); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('copyWithin'); + }, + { + '../internals/add-to-unscopables': 25, + '../internals/array-copy-within': 32, + '../internals/export': 68 + } + ], + 171: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $every = _dereq_('../internals/array-iteration').every; + var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var STRICT_METHOD = arrayMethodIsStrict('every'); + var USES_TO_LENGTH = arrayMethodUsesToLength('every'); + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + $({ + target: 'Array', + proto: true, + forced: !STRICT_METHOD || !USES_TO_LENGTH + }, { + every: function every(callbackfn /* , thisArg */ ) { + return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/array-iteration': 37, + '../internals/array-method-is-strict': 40, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 172: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var fill = _dereq_('../internals/array-fill'); + var addToUnscopables = _dereq_('../internals/add-to-unscopables'); + // `Array.prototype.fill` method + // https://tc39.github.io/ecma262/#sec-array.prototype.fill + $({ + target: 'Array', + proto: true + }, { + fill: fill + }); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('fill'); + }, + { + '../internals/add-to-unscopables': 25, + '../internals/array-fill': 33, + '../internals/export': 68 + } + ], + 173: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $filter = _dereq_('../internals/array-iteration').filter; + var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + // Edge 14- issue + var USES_TO_LENGTH = arrayMethodUsesToLength('filter'); + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + // with adding support of @@species + $({ + target: 'Array', + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH + }, { + filter: function filter(callbackfn /* , thisArg */ ) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/array-iteration': 37, + '../internals/array-method-has-species-support': 39, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 174: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $findIndex = _dereq_('../internals/array-iteration').findIndex; + var addToUnscopables = _dereq_('../internals/add-to-unscopables'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var FIND_INDEX = 'findIndex'; + var SKIPS_HOLES = true; + var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX); + // Shouldn't skip holes + if (FIND_INDEX in [ + ]) Array(1) [FIND_INDEX](function () { + SKIPS_HOLES = false; + }); + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findindex + $({ + target: 'Array', + proto: true, + forced: SKIPS_HOLES || !USES_TO_LENGTH + }, { + findIndex: function findIndex(callbackfn /* , that = undefined */ ) { + return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables(FIND_INDEX); + }, + { + '../internals/add-to-unscopables': 25, + '../internals/array-iteration': 37, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 175: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var forEach = _dereq_('../internals/array-for-each'); + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + $({ + target: 'Array', + proto: true, + forced: [ + ].forEach != forEach + }, { + forEach: forEach + }); + }, + { + '../internals/array-for-each': 34, + '../internals/export': 68 + } + ], + 176: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var from = _dereq_('../internals/array-from'); + var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); + var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + Array.from(iterable); + }); + // `Array.from` method + // https://tc39.github.io/ecma262/#sec-array.from + $({ + target: 'Array', + stat: true, + forced: INCORRECT_ITERATION + }, { + from: from + }); + }, + { + '../internals/array-from': 35, + '../internals/check-correctness-of-iteration': 45, + '../internals/export': 68 + } + ], + 177: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $includes = _dereq_('../internals/array-includes').includes; + var addToUnscopables = _dereq_('../internals/add-to-unscopables'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { + ACCESSORS: true, + 1: 0 + }); + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + $({ + target: 'Array', + proto: true, + forced: !USES_TO_LENGTH + }, { + includes: function includes(el /* , fromIndex = 0 */ ) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } + }); + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('includes'); + }, + { + '../internals/add-to-unscopables': 25, + '../internals/array-includes': 36, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 178: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $indexOf = _dereq_('../internals/array-includes').indexOf; + var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var nativeIndexOf = [ + ].indexOf; + var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [ + 1 + ].indexOf(1, - 0) < 0; + var STRICT_METHOD = arrayMethodIsStrict('indexOf'); + var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { + ACCESSORS: true, + 1: 0 + }); + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + $({ + target: 'Array', + proto: true, + forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH + }, { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */ ) { + return NEGATIVE_ZERO // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/array-includes': 36, + '../internals/array-method-is-strict': 40, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 179: [ + function (_dereq_, module, exports) { + 'use strict'; + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var addToUnscopables = _dereq_('../internals/add-to-unscopables'); + var Iterators = _dereq_('../internals/iterators'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var defineIterator = _dereq_('../internals/define-iterator'); + var ARRAY_ITERATOR = 'Array Iterator'; + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + // `Array.prototype.entries` method + // https://tc39.github.io/ecma262/#sec-array.prototype.entries + // `Array.prototype.keys` method + // https://tc39.github.io/ecma262/#sec-array.prototype.keys + // `Array.prototype.values` method + // https://tc39.github.io/ecma262/#sec-array.prototype.values + // `Array.prototype[@@iterator]` method + // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator + // `CreateArrayIterator` internal method + // https://tc39.github.io/ecma262/#sec-createarrayiterator + module.exports = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), + // target + index: 0, + // next index + kind: kind // kind + }); + // `%ArrayIteratorPrototype%.next` method + // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next + }, function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return { + value: undefined, + done: true + }; + } + if (kind == 'keys') return { + value: index, + done: false + }; + if (kind == 'values') return { + value: target[index], + done: false + }; + return { + value: [ + index, + target[index] + ], + done: false + }; + }, 'values'); + // argumentsList[@@iterator] is %ArrayProto_values% + // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject + // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject + Iterators.Arguments = Iterators.Array; + // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + }, + { + '../internals/add-to-unscopables': 25, + '../internals/define-iterator': 59, + '../internals/internal-state': 88, + '../internals/iterators': 97, + '../internals/to-indexed-object': 152 + } + ], + 180: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var IndexedObject = _dereq_('../internals/indexed-object'); + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); + var nativeJoin = [ + ].join; + var ES3_STRINGS = IndexedObject != Object; + var STRICT_METHOD = arrayMethodIsStrict('join', ','); + // `Array.prototype.join` method + // https://tc39.github.io/ecma262/#sec-array.prototype.join + $({ + target: 'Array', + proto: true, + forced: ES3_STRINGS || !STRICT_METHOD + }, { + join: function join(separator) { + return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); + } + }); + }, + { + '../internals/array-method-is-strict': 40, + '../internals/export': 68, + '../internals/indexed-object': 84, + '../internals/to-indexed-object': 152 + } + ], + 181: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var lastIndexOf = _dereq_('../internals/array-last-index-of'); + // `Array.prototype.lastIndexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof + $({ + target: 'Array', + proto: true, + forced: lastIndexOf !== [].lastIndexOf + }, { + lastIndexOf: lastIndexOf + }); + }, + { + '../internals/array-last-index-of': 38, + '../internals/export': 68 + } + ], + 182: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $map = _dereq_('../internals/array-iteration').map; + var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); + // FF49- issue + var USES_TO_LENGTH = arrayMethodUsesToLength('map'); + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + // with adding support of @@species + $({ + target: 'Array', + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH + }, { + map: function map(callbackfn /* , thisArg */ ) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/array-iteration': 37, + '../internals/array-method-has-species-support': 39, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 183: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var isObject = _dereq_('../internals/is-object'); + var isArray = _dereq_('../internals/is-array'); + var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); + var toLength = _dereq_('../internals/to-length'); + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var createProperty = _dereq_('../internals/create-property'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); + var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { + ACCESSORS: true, + 0: 0, + 1: 2 + }); + var SPECIES = wellKnownSymbol('species'); + var nativeSlice = [ + ].slice; + var max = Math.max; + // `Array.prototype.slice` method + // https://tc39.github.io/ecma262/#sec-array.prototype.slice + // fallback for not array-like ES3 strings and DOM objects + $({ + target: 'Array', + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH + }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, + result, + n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + result = new (Constructor === undefined ? Array : Constructor) (max(fin - k, 0)); + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; + } + }); + }, + { + '../internals/array-method-has-species-support': 39, + '../internals/array-method-uses-to-length': 41, + '../internals/create-property': 58, + '../internals/export': 68, + '../internals/is-array': 90, + '../internals/is-object': 92, + '../internals/to-absolute-index': 150, + '../internals/to-indexed-object': 152, + '../internals/to-length': 154, + '../internals/well-known-symbol': 166 + } + ], + 184: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $some = _dereq_('../internals/array-iteration').some; + var arrayMethodIsStrict = _dereq_('../internals/array-method-is-strict'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var STRICT_METHOD = arrayMethodIsStrict('some'); + var USES_TO_LENGTH = arrayMethodUsesToLength('some'); + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + $({ + target: 'Array', + proto: true, + forced: !STRICT_METHOD || !USES_TO_LENGTH + }, { + some: function some(callbackfn /* , thisArg */ ) { + return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/array-iteration': 37, + '../internals/array-method-is-strict': 40, + '../internals/array-method-uses-to-length': 41, + '../internals/export': 68 + } + ], + 185: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); + var toInteger = _dereq_('../internals/to-integer'); + var toLength = _dereq_('../internals/to-length'); + var toObject = _dereq_('../internals/to-object'); + var arraySpeciesCreate = _dereq_('../internals/array-species-create'); + var createProperty = _dereq_('../internals/create-property'); + var arrayMethodHasSpeciesSupport = _dereq_('../internals/array-method-has-species-support'); + var arrayMethodUsesToLength = _dereq_('../internals/array-method-uses-to-length'); + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); + var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { + ACCESSORS: true, + 0: 0, + 1: 2 + }); + var max = Math.max; + var min = Math.min; + var MAX_SAFE_INTEGER = 9007199254740991; + var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; + // `Array.prototype.splice` method + // https://tc39.github.io/ecma262/#sec-array.prototype.splice + // with adding support of @@species + $({ + target: 'Array', + proto: true, + forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH + }, { + splice: function splice(start, deleteCount /* , ...items */ ) { + var O = toObject(this); + var len = toLength(O.length); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, + actualDeleteCount, + A, + k, + from, + to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); + } + if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { + throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); + } + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from]; + else delete O[to]; + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; + } + O.length = len - actualDeleteCount + insertCount; + return A; + } + }); + }, + { + '../internals/array-method-has-species-support': 39, + '../internals/array-method-uses-to-length': 41, + '../internals/array-species-create': 43, + '../internals/create-property': 58, + '../internals/export': 68, + '../internals/to-absolute-index': 150, + '../internals/to-integer': 153, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 186: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var defineProperty = _dereq_('../internals/object-define-property').f; + var FunctionPrototype = Function.prototype; + var FunctionPrototypeToString = FunctionPrototype.toString; + var nameRE = /^\s*function ([^ (]*)/; + var NAME = 'name'; + // Function instances `.name` property + // https://tc39.github.io/ecma262/#sec-function-instances-name + if (DESCRIPTORS && !(NAME in FunctionPrototype)) { + defineProperty(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return FunctionPrototypeToString.call(this).match(nameRE) [1]; + } catch (error) { + return ''; + } + } + }); + } + }, + { + '../internals/descriptors': 61, + '../internals/object-define-property': 110 + } + ], + 187: [ + function (_dereq_, module, exports) { + 'use strict'; + var collection = _dereq_('../internals/collection'); + var collectionStrong = _dereq_('../internals/collection-strong'); + // `Map` constructor + // https://tc39.github.io/ecma262/#sec-map-objects + module.exports = collection('Map', function (init) { + return function Map() { + return init(this, arguments.length ? arguments[0] : undefined); + }; + }, collectionStrong); + }, + { + '../internals/collection': 50, + '../internals/collection-strong': 48 + } + ], + 188: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var $hypot = Math.hypot; + var abs = Math.abs; + var sqrt = Math.sqrt; + // Chrome 77 bug + // https://bugs.chromium.org/p/v8/issues/detail?id=9546 + var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; + // `Math.hypot` method + // https://tc39.github.io/ecma262/#sec-math.hypot + $({ + target: 'Math', + stat: true, + forced: BUGGY + }, { + hypot: function hypot(value1, value2) { + // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, + div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * sqrt(sum); + } + }); + }, + { + '../internals/export': 68 + } + ], + 189: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var log = Math.log; + var LN2 = Math.LN2; + // `Math.log2` method + // https://tc39.github.io/ecma262/#sec-math.log2 + $({ + target: 'Math', + stat: true + }, { + log2: function log2(x) { + return log(x) / LN2; + } + }); + }, + { + '../internals/export': 68 + } + ], + 190: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var sign = _dereq_('../internals/math-sign'); + // `Math.sign` method + // https://tc39.github.io/ecma262/#sec-math.sign + $({ + target: 'Math', + stat: true + }, { + sign: sign + }); + }, + { + '../internals/export': 68, + '../internals/math-sign': 98 + } + ], + 191: [ + function (_dereq_, module, exports) { + 'use strict'; + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var global = _dereq_('../internals/global'); + var isForced = _dereq_('../internals/is-forced'); + var redefine = _dereq_('../internals/redefine'); + var has = _dereq_('../internals/has'); + var classof = _dereq_('../internals/classof-raw'); + var inheritIfRequired = _dereq_('../internals/inherit-if-required'); + var toPrimitive = _dereq_('../internals/to-primitive'); + var fails = _dereq_('../internals/fails'); + var create = _dereq_('../internals/object-create'); + var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; + var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; + var defineProperty = _dereq_('../internals/object-define-property').f; + var trim = _dereq_('../internals/string-trim').trim; + var NUMBER = 'Number'; + var NativeNumber = global[NUMBER]; + var NumberPrototype = NativeNumber.prototype; + // Opera ~12 has broken Object#toString + var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; + // `ToNumber` abstract operation + // https://tc39.github.io/ecma262/#sec-tonumber + var toNumber = function (argument) { + var it = toPrimitive(argument, false); + var first, + third, + radix, + maxCode, + digits, + length, + index, + code; + if (typeof it == 'string' && it.length > 2) { + it = trim(it); + first = it.charCodeAt(0); + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: + case 98: + radix = 2; + maxCode = 49; + break; + // fast equal of /^0b[01]+$/i + case 79: + case 111: + radix = 8; + maxCode = 55; + break; + // fast equal of /^0o[0-7]+$/i + default: + return + it; + } + digits = it.slice(2); + length = digits.length; + for (index = 0; index < length; index++) { + code = digits.charCodeAt(index); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } + return parseInt(digits, radix); + } + } + return + it; + }; + // `Number` constructor + // https://tc39.github.io/ecma262/#sec-number-constructor + if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { + var NumberWrapper = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var dummy = this; + return dummy instanceof NumberWrapper // check on 1..constructor(foo) case + && (BROKEN_CLASSOF ? fails(function () { + NumberPrototype.valueOf.call(dummy); + }) : classof(dummy) != NUMBER) ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it); + }; + for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger').split(','), j = 0, key; keys.length > j; j++) { + if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) { + defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); + } + } + NumberWrapper.prototype = NumberPrototype; + NumberPrototype.constructor = NumberWrapper; + redefine(global, NUMBER, NumberWrapper); + } + }, + { + '../internals/classof-raw': 46, + '../internals/descriptors': 61, + '../internals/fails': 69, + '../internals/global': 77, + '../internals/has': 78, + '../internals/inherit-if-required': 85, + '../internals/is-forced': 91, + '../internals/object-create': 108, + '../internals/object-define-property': 110, + '../internals/object-get-own-property-descriptor': 111, + '../internals/object-get-own-property-names': 113, + '../internals/redefine': 126, + '../internals/string-trim': 147, + '../internals/to-primitive': 158 + } + ], + 192: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var numberIsFinite = _dereq_('../internals/number-is-finite'); + // `Number.isFinite` method + // https://tc39.github.io/ecma262/#sec-number.isfinite + $({ + target: 'Number', + stat: true + }, { + isFinite: numberIsFinite + }); + }, + { + '../internals/export': 68, + '../internals/number-is-finite': 106 + } + ], + 193: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var toInteger = _dereq_('../internals/to-integer'); + var thisNumberValue = _dereq_('../internals/this-number-value'); + var repeat = _dereq_('../internals/string-repeat'); + var fails = _dereq_('../internals/fails'); + var nativeToFixed = 1 .toFixed; + var floor = Math.floor; + var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); + }; + var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } + return n; + }; + var FORCED = nativeToFixed && (0.00008 .toFixed(3) !== '0.000' || 0.9 .toFixed(0) !== '1' || 1.255 .toFixed(2) !== '1.25' || 1000000000000000100 .toFixed(0) !== '1000000000000000128') || !fails(function () { + // V8 ~ Android 4.3- + nativeToFixed.call({ + }); + }); + // `Number.prototype.toFixed` method + // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed + $({ + target: 'Number', + proto: true, + forced: FORCED + }, { + // eslint-disable-next-line max-statements + toFixed: function toFixed(fractionDigits) { + var number = thisNumberValue(this); + var fractDigits = toInteger(fractionDigits); + var data = [ + 0, + 0, + 0, + 0, + 0, + 0 + ]; + var sign = ''; + var result = '0'; + var e, + z, + j, + k; + var multiply = function (n, c) { + var index = - 1; + var c2 = c; + while (++index < 6) { + c2 += n * data[index]; + data[index] = c2 % 10000000; + c2 = floor(c2 / 10000000); + } + }; + var divide = function (n) { + var index = 6; + var c = 0; + while (--index >= 0) { + c += data[index]; + data[index] = floor(c / n); + c = c % n * 10000000; + } + }; + var dataToString = function () { + var index = 6; + var s = ''; + while (--index >= 0) { + if (s !== '' || index === 0 || data[index] !== 0) { + var t = String(data[index]); + s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t; + } + } + return s; + }; + if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits'); + // eslint-disable-next-line no-self-compare + if (number != number) return 'NaN'; + if (number <= - 1e+21 || number >= 1e+21) return String(number); + if (number < 0) { + sign = '-'; + number = - number; + } + if (number > 1e-21) { + e = log(number * pow(2, 69, 1)) - 69; + z = e < 0 ? number * pow(2, - e, 1) : number / pow(2, e, 1); + z *= 4503599627370496; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = fractDigits; + while (j >= 7) { + multiply(10000000, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + result = dataToString(); + } else { + multiply(0, z); + multiply(1 << - e, 0); + result = dataToString() + repeat.call('0', fractDigits); + } + } + if (fractDigits > 0) { + k = result.length; + result = sign + (k <= fractDigits ? '0.' + repeat.call('0', fractDigits - k) + result : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits)); + } else { + result = sign + result; + } + return result; + } + }); + }, + { + '../internals/export': 68, + '../internals/fails': 69, + '../internals/string-repeat': 145, + '../internals/this-number-value': 149, + '../internals/to-integer': 153 + } + ], + 194: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var assign = _dereq_('../internals/object-assign'); + // `Object.assign` method + // https://tc39.github.io/ecma262/#sec-object.assign + $({ + target: 'Object', + stat: true, + forced: Object.assign !== assign + }, { + assign: assign + }); + }, + { + '../internals/export': 68, + '../internals/object-assign': 107 + } + ], + 195: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var iterate = _dereq_('../internals/iterate'); + var createProperty = _dereq_('../internals/create-property'); + // `Object.fromEntries` method + // https://github.com/tc39/proposal-object-from-entries + $({ + target: 'Object', + stat: true + }, { + fromEntries: function fromEntries(iterable) { + var obj = { + }; + iterate(iterable, function (k, v) { + createProperty(obj, k, v); + }, undefined, true); + return obj; + } + }); + }, + { + '../internals/create-property': 58, + '../internals/export': 68, + '../internals/iterate': 95 + } + ], + 196: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var fails = _dereq_('../internals/fails'); + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var nativeGetOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var FAILS_ON_PRIMITIVES = fails(function () { + nativeGetOwnPropertyDescriptor(1); + }); + var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + $({ + target: 'Object', + stat: true, + forced: FORCED, + sham: !DESCRIPTORS + }, { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { + return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); + } + }); + }, + { + '../internals/descriptors': 61, + '../internals/export': 68, + '../internals/fails': 69, + '../internals/object-get-own-property-descriptor': 111, + '../internals/to-indexed-object': 152 + } + ], + 197: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var fails = _dereq_('../internals/fails'); + var nativeGetOwnPropertyNames = _dereq_('../internals/object-get-own-property-names-external').f; + var FAILS_ON_PRIMITIVES = fails(function () { + return !Object.getOwnPropertyNames(1); + }); + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + $({ + target: 'Object', + stat: true, + forced: FAILS_ON_PRIMITIVES + }, { + getOwnPropertyNames: nativeGetOwnPropertyNames + }); + }, + { + '../internals/export': 68, + '../internals/fails': 69, + '../internals/object-get-own-property-names-external': 112 + } + ], + 198: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var fails = _dereq_('../internals/fails'); + var toObject = _dereq_('../internals/to-object'); + var nativeGetPrototypeOf = _dereq_('../internals/object-get-prototype-of'); + var CORRECT_PROTOTYPE_GETTER = _dereq_('../internals/correct-prototype-getter'); + var FAILS_ON_PRIMITIVES = fails(function () { + nativeGetPrototypeOf(1); + }); + // `Object.getPrototypeOf` method + // https://tc39.github.io/ecma262/#sec-object.getprototypeof + $({ + target: 'Object', + stat: true, + forced: FAILS_ON_PRIMITIVES, + sham: !CORRECT_PROTOTYPE_GETTER + }, { + getPrototypeOf: function getPrototypeOf(it) { + return nativeGetPrototypeOf(toObject(it)); + } + }); + }, + { + '../internals/correct-prototype-getter': 53, + '../internals/export': 68, + '../internals/fails': 69, + '../internals/object-get-prototype-of': 115, + '../internals/to-object': 155 + } + ], + 199: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var toObject = _dereq_('../internals/to-object'); + var nativeKeys = _dereq_('../internals/object-keys'); + var fails = _dereq_('../internals/fails'); + var FAILS_ON_PRIMITIVES = fails(function () { + nativeKeys(1); + }); + // `Object.keys` method + // https://tc39.github.io/ecma262/#sec-object.keys + $({ + target: 'Object', + stat: true, + forced: FAILS_ON_PRIMITIVES + }, { + keys: function keys(it) { + return nativeKeys(toObject(it)); + } + }); + }, + { + '../internals/export': 68, + '../internals/fails': 69, + '../internals/object-keys': 117, + '../internals/to-object': 155 + } + ], + 200: [ + function (_dereq_, module, exports) { + var TO_STRING_TAG_SUPPORT = _dereq_('../internals/to-string-tag-support'); + var redefine = _dereq_('../internals/redefine'); + var toString = _dereq_('../internals/object-to-string'); + // `Object.prototype.toString` method + // https://tc39.github.io/ecma262/#sec-object.prototype.tostring + if (!TO_STRING_TAG_SUPPORT) { + redefine(Object.prototype, 'toString', toString, { + unsafe: true + }); + } + }, + { + '../internals/object-to-string': 120, + '../internals/redefine': 126, + '../internals/to-string-tag-support': 159 + } + ], + 201: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var IS_PURE = _dereq_('../internals/is-pure'); + var global = _dereq_('../internals/global'); + var getBuiltIn = _dereq_('../internals/get-built-in'); + var NativePromise = _dereq_('../internals/native-promise-constructor'); + var redefine = _dereq_('../internals/redefine'); + var redefineAll = _dereq_('../internals/redefine-all'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var setSpecies = _dereq_('../internals/set-species'); + var isObject = _dereq_('../internals/is-object'); + var aFunction = _dereq_('../internals/a-function'); + var anInstance = _dereq_('../internals/an-instance'); + var classof = _dereq_('../internals/classof-raw'); + var inspectSource = _dereq_('../internals/inspect-source'); + var iterate = _dereq_('../internals/iterate'); + var checkCorrectnessOfIteration = _dereq_('../internals/check-correctness-of-iteration'); + var speciesConstructor = _dereq_('../internals/species-constructor'); + var task = _dereq_('../internals/task').set; + var microtask = _dereq_('../internals/microtask'); + var promiseResolve = _dereq_('../internals/promise-resolve'); + var hostReportErrors = _dereq_('../internals/host-report-errors'); + var newPromiseCapabilityModule = _dereq_('../internals/new-promise-capability'); + var perform = _dereq_('../internals/perform'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var isForced = _dereq_('../internals/is-forced'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var V8_VERSION = _dereq_('../internals/engine-v8-version'); + var SPECIES = wellKnownSymbol('species'); + var PROMISE = 'Promise'; + var getInternalState = InternalStateModule.get; + var setInternalState = InternalStateModule.set; + var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); + var PromiseConstructor = NativePromise; + var TypeError = global.TypeError; + var document = global.document; + var process = global.process; + var $fetch = getBuiltIn('fetch'); + var newPromiseCapability = newPromiseCapabilityModule.f; + var newGenericPromiseCapability = newPromiseCapability; + var IS_NODE = classof(process) == 'process'; + var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); + var UNHANDLED_REJECTION = 'unhandledrejection'; + var REJECTION_HANDLED = 'rejectionhandled'; + var PENDING = 0; + var FULFILLED = 1; + var REJECTED = 2; + var HANDLED = 1; + var UNHANDLED = 2; + var Internal, + OwnPromiseCapability, + PromiseWrapper, + nativeThen; + var FORCED = isForced(PROMISE, function () { + var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor); + if (!GLOBAL_CORE_JS_PROMISE) { + // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // We can't detect it synchronously, so just check versions + if (V8_VERSION === 66) return true; + // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test + if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true; + } // We need Promise#finally in the pure version for preventing prototype pollution + + if (IS_PURE && !PromiseConstructor.prototype['finally']) return true; + // We can't use @@species feature detection in V8 since it causes + // deoptimization and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false; + // Detect correctness of subclassing with @@species support + var promise = PromiseConstructor.resolve(1); + var FakePromise = function (exec) { + exec(function () { /* empty */ + }, function () { /* empty */ + }); + }; + var constructor = promise.constructor = { + }; + constructor[SPECIES] = FakePromise; + return !(promise.then(function () { /* empty */ + }) instanceof FakePromise); + }); + var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { + PromiseConstructor.all(iterable) ['catch'](function () { /* empty */ + }); + }); + // helpers + var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var notify = function (promise, state, isReject) { + if (state.notified) return; + state.notified = true; + var chain = state.reactions; + microtask(function () { + var value = state.value; + var ok = state.state == FULFILLED; + var index = 0; + // variable length - can't use forEach + while (chain.length > index) { + var reaction = chain[index++]; + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, + then, + exited; + try { + if (handler) { + if (!ok) { + if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state); + state.rejection = HANDLED; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // can throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (error) { + if (domain && !exited) domain.exit(); + reject(error); + } + } + state.reactions = [ + ]; + state.notified = false; + if (isReject && !state.rejection) onUnhandled(promise, state); + }); + }; + var dispatchEvent = function (name, promise, reason) { + var event, + handler; + if (DISPATCH_EVENT) { + event = document.createEvent('Event'); + event.promise = promise; + event.reason = reason; + event.initEvent(name, false, true); + global.dispatchEvent(event); + } else event = { + promise: promise, + reason: reason + }; + if (handler = global['on' + name]) handler(event); + else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); + }; + var onUnhandled = function (promise, state) { + task.call(global, function () { + var value = state.value; + var IS_UNHANDLED = isUnhandled(state); + var result; + if (IS_UNHANDLED) { + result = perform(function () { + if (IS_NODE) { + process.emit('unhandledRejection', value, promise); + } else dispatchEvent(UNHANDLED_REJECTION, promise, value); + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; + if (result.error) throw result.value; + } + }); + }; + var isUnhandled = function (state) { + return state.rejection !== HANDLED && !state.parent; + }; + var onHandleUnhandled = function (promise, state) { + task.call(global, function () { + if (IS_NODE) { + process.emit('rejectionHandled', promise); + } else dispatchEvent(REJECTION_HANDLED, promise, state.value); + }); + }; + var bind = function (fn, promise, state, unwrap) { + return function (value) { + fn(promise, state, value, unwrap); + }; + }; + var internalReject = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + state.value = value; + state.state = REJECTED; + notify(promise, state, true); + }; + var internalResolve = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + try { + if (promise === value) throw TypeError('Promise can\'t be resolved itself'); + var then = isThenable(value); + if (then) { + microtask(function () { + var wrapper = { + done: false + }; + try { + then.call(value, bind(internalResolve, promise, wrapper, state), bind(internalReject, promise, wrapper, state)); + } catch (error) { + internalReject(promise, wrapper, error, state); + } + }); + } else { + state.value = value; + state.state = FULFILLED; + notify(promise, state, false); + } + } catch (error) { + internalReject(promise, { + done: false + }, error, state); + } + }; + // constructor polyfill + if (FORCED) { + // 25.4.3.1 Promise(executor) + PromiseConstructor = function Promise(executor) { + anInstance(this, PromiseConstructor, PROMISE); + aFunction(executor); + Internal.call(this); + var state = getInternalState(this); + try { + executor(bind(internalResolve, this, state), bind(internalReject, this, state)); + } catch (error) { + internalReject(this, state, error); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + setInternalState(this, { + type: PROMISE, + done: false, + notified: false, + parent: false, + reactions: [ + ], + rejection: false, + state: PENDING, + value: undefined + }); + }; + Internal.prototype = redefineAll(PromiseConstructor.prototype, { + // `Promise.prototype.then` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.then + then: function then(onFulfilled, onRejected) { + var state = getInternalPromiseState(this); + var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = IS_NODE ? process.domain : undefined; + state.parent = true; + state.reactions.push(reaction); + if (state.state != PENDING) notify(this, state, false); + return reaction.promise; + }, + // `Promise.prototype.catch` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.catch + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + var state = getInternalState(promise); + this.promise = promise; + this.resolve = bind(internalResolve, promise, state); + this.reject = bind(internalReject, promise, state); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); + }; + if (!IS_PURE && typeof NativePromise == 'function') { + nativeThen = NativePromise.prototype.then; + // wrap native Promise#then for native async functions + redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) { + var that = this; + return new PromiseConstructor(function (resolve, reject) { + nativeThen.call(that, resolve, reject); + }).then(onFulfilled, onRejected); + // https://github.com/zloirock/core-js/issues/640 + }, { + unsafe: true + }); + // wrap fetch result + if (typeof $fetch == 'function') $({ + global: true, + enumerable: true, + forced: true + }, { + // eslint-disable-next-line no-unused-vars + fetch: function fetch(input /* , init */ ) { + return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments)); + } + }); + } + } + $({ + global: true, + wrap: true, + forced: FORCED + }, { + Promise: PromiseConstructor + }); + setToStringTag(PromiseConstructor, PROMISE, false, true); + setSpecies(PROMISE); + PromiseWrapper = getBuiltIn(PROMISE); + // statics + $({ + target: PROMISE, + stat: true, + forced: FORCED + }, { + // `Promise.reject` method + // https://tc39.github.io/ecma262/#sec-promise.reject + reject: function reject(r) { + var capability = newPromiseCapability(this); + capability.reject.call(undefined, r); + return capability.promise; + } + }); + $({ + target: PROMISE, + stat: true, + forced: IS_PURE || FORCED + }, { + // `Promise.resolve` method + // https://tc39.github.io/ecma262/#sec-promise.resolve + resolve: function resolve(x) { + return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x); + } + }); + $({ + target: PROMISE, + stat: true, + forced: INCORRECT_ITERATION + }, { + // `Promise.all` method + // https://tc39.github.io/ecma262/#sec-promise.all + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + var values = [ + ]; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + $promiseResolve.call(C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; + }, + // `Promise.race` method + // https://tc39.github.io/ecma262/#sec-promise.race + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + iterate(iterable, function (promise) { + $promiseResolve.call(C, promise).then(capability.resolve, reject); + }); + }); + if (result.error) reject(result.value); + return capability.promise; + } + }); + }, + { + '../internals/a-function': 23, + '../internals/an-instance': 27, + '../internals/check-correctness-of-iteration': 45, + '../internals/classof-raw': 46, + '../internals/engine-v8-version': 66, + '../internals/export': 68, + '../internals/get-built-in': 74, + '../internals/global': 77, + '../internals/host-report-errors': 80, + '../internals/inspect-source': 86, + '../internals/internal-state': 88, + '../internals/is-forced': 91, + '../internals/is-object': 92, + '../internals/is-pure': 93, + '../internals/iterate': 95, + '../internals/microtask': 99, + '../internals/native-promise-constructor': 100, + '../internals/new-promise-capability': 104, + '../internals/perform': 123, + '../internals/promise-resolve': 124, + '../internals/redefine': 126, + '../internals/redefine-all': 125, + '../internals/set-species': 134, + '../internals/set-to-string-tag': 135, + '../internals/species-constructor': 139, + '../internals/task': 148, + '../internals/well-known-symbol': 166 + } + ], + 202: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var getBuiltIn = _dereq_('../internals/get-built-in'); + var aFunction = _dereq_('../internals/a-function'); + var anObject = _dereq_('../internals/an-object'); + var isObject = _dereq_('../internals/is-object'); + var create = _dereq_('../internals/object-create'); + var bind = _dereq_('../internals/function-bind'); + var fails = _dereq_('../internals/fails'); + var nativeConstruct = getBuiltIn('Reflect', 'construct'); + // `Reflect.construct` method + // https://tc39.github.io/ecma262/#sec-reflect.construct + // MS Edge supports only 2 arguments and argumentsList argument is optional + // FF Nightly sets third argument as `new.target`, but does not create `this` from it + var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ + } + return !(nativeConstruct(function () { /* empty */ + }, [ + ], F) instanceof F); + }); + var ARGS_BUG = !fails(function () { + nativeConstruct(function () { /* empty */ + }); + }); + var FORCED = NEW_TARGET_BUG || ARGS_BUG; + $({ + target: 'Reflect', + stat: true, + forced: FORCED, + sham: FORCED + }, { + construct: function construct(Target, args /* , newTarget */ ) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: + return new Target(); + case 1: + return new Target(args[0]); + case 2: + return new Target(args[0], args[1]); + case 3: + return new Target(args[0], args[1], args[2]); + case 4: + return new Target(args[0], args[1], args[2], args[3]); + } // w/o altered newTarget, lot of arguments case + + var $args = [ + null + ]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)) (); + } // with altered newTarget, not support built-in constructors + + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } + }); + }, + { + '../internals/a-function': 23, + '../internals/an-object': 28, + '../internals/export': 68, + '../internals/fails': 69, + '../internals/function-bind': 73, + '../internals/get-built-in': 74, + '../internals/is-object': 92, + '../internals/object-create': 108 + } + ], + 203: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var isObject = _dereq_('../internals/is-object'); + var anObject = _dereq_('../internals/an-object'); + var has = _dereq_('../internals/has'); + var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); + var getPrototypeOf = _dereq_('../internals/object-get-prototype-of'); + // `Reflect.get` method + // https://tc39.github.io/ecma262/#sec-reflect.get + function get(target, propertyKey /* , receiver */ ) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var descriptor, + prototype; + if (anObject(target) === receiver) return target[propertyKey]; + if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value') ? descriptor.value : descriptor.get === undefined ? undefined : descriptor.get.call(receiver); + if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver); + } + $({ + target: 'Reflect', + stat: true + }, { + get: get + }); + }, + { + '../internals/an-object': 28, + '../internals/export': 68, + '../internals/has': 78, + '../internals/is-object': 92, + '../internals/object-get-own-property-descriptor': 111, + '../internals/object-get-prototype-of': 115 + } + ], + 204: [ + function (_dereq_, module, exports) { + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var global = _dereq_('../internals/global'); + var isForced = _dereq_('../internals/is-forced'); + var inheritIfRequired = _dereq_('../internals/inherit-if-required'); + var defineProperty = _dereq_('../internals/object-define-property').f; + var getOwnPropertyNames = _dereq_('../internals/object-get-own-property-names').f; + var isRegExp = _dereq_('../internals/is-regexp'); + var getFlags = _dereq_('../internals/regexp-flags'); + var stickyHelpers = _dereq_('../internals/regexp-sticky-helpers'); + var redefine = _dereq_('../internals/redefine'); + var fails = _dereq_('../internals/fails'); + var setInternalState = _dereq_('../internals/internal-state').set; + var setSpecies = _dereq_('../internals/set-species'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var MATCH = wellKnownSymbol('match'); + var NativeRegExp = global.RegExp; + var RegExpPrototype = NativeRegExp.prototype; + var re1 = /a/g; + var re2 = /a/g; + // "new" should create a new object, old webkit bug + var CORRECT_NEW = new NativeRegExp(re1) !== re1; + var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; + var FORCED = DESCRIPTORS && isForced('RegExp', !CORRECT_NEW || UNSUPPORTED_Y || fails(function () { + re2[MATCH] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; + })); + // `RegExp` constructor + // https://tc39.github.io/ecma262/#sec-regexp-constructor + if (FORCED) { + var RegExpWrapper = function RegExp(pattern, flags) { + var thisIsRegExp = this instanceof RegExpWrapper; + var patternIsRegExp = isRegExp(pattern); + var flagsAreUndefined = flags === undefined; + var sticky; + if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) { + return pattern; + } + if (CORRECT_NEW) { + if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source; + } else if (pattern instanceof RegExpWrapper) { + if (flagsAreUndefined) flags = getFlags.call(pattern); + pattern = pattern.source; + } + if (UNSUPPORTED_Y) { + sticky = !!flags && flags.indexOf('y') > - 1; + if (sticky) flags = flags.replace(/y/g, ''); + } + var result = inheritIfRequired(CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); + if (UNSUPPORTED_Y && sticky) setInternalState(result, { + sticky: sticky + }); + return result; + }; + var proxy = function (key) { + key in RegExpWrapper || defineProperty(RegExpWrapper, key, { + configurable: true, + get: function () { + return NativeRegExp[key]; + }, + set: function (it) { + NativeRegExp[key] = it; + } + }); + }; + var keys = getOwnPropertyNames(NativeRegExp); + var index = 0; + while (keys.length > index) proxy(keys[index++]); + RegExpPrototype.constructor = RegExpWrapper; + RegExpWrapper.prototype = RegExpPrototype; + redefine(global, 'RegExp', RegExpWrapper); + } // https://tc39.github.io/ecma262/#sec-get-regexp-@@species + + setSpecies('RegExp'); + }, + { + '../internals/descriptors': 61, + '../internals/fails': 69, + '../internals/global': 77, + '../internals/inherit-if-required': 85, + '../internals/internal-state': 88, + '../internals/is-forced': 91, + '../internals/is-regexp': 94, + '../internals/object-define-property': 110, + '../internals/object-get-own-property-names': 113, + '../internals/redefine': 126, + '../internals/regexp-flags': 129, + '../internals/regexp-sticky-helpers': 130, + '../internals/set-species': 134, + '../internals/well-known-symbol': 166 + } + ], + 205: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var exec = _dereq_('../internals/regexp-exec'); + $({ + target: 'RegExp', + proto: true, + forced: /./.exec !== exec + }, { + exec: exec + }); + }, + { + '../internals/export': 68, + '../internals/regexp-exec': 128 + } + ], + 206: [ + function (_dereq_, module, exports) { + 'use strict'; + var redefine = _dereq_('../internals/redefine'); + var anObject = _dereq_('../internals/an-object'); + var fails = _dereq_('../internals/fails'); + var flags = _dereq_('../internals/regexp-flags'); + var TO_STRING = 'toString'; + var RegExpPrototype = RegExp.prototype; + var nativeToString = RegExpPrototype[TO_STRING]; + var NOT_GENERIC = fails(function () { + return nativeToString.call({ + source: 'a', + flags: 'b' + }) != '/a/b'; + }); + // FF44- RegExp#toString has a wrong name + var INCORRECT_NAME = nativeToString.name != TO_STRING; + // `RegExp.prototype.toString` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring + if (NOT_GENERIC || INCORRECT_NAME) { + redefine(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + return '/' + p + '/' + f; + }, { + unsafe: true + }); + } + }, + { + '../internals/an-object': 28, + '../internals/fails': 69, + '../internals/redefine': 126, + '../internals/regexp-flags': 129 + } + ], + 207: [ + function (_dereq_, module, exports) { + 'use strict'; + var collection = _dereq_('../internals/collection'); + var collectionStrong = _dereq_('../internals/collection-strong'); + // `Set` constructor + // https://tc39.github.io/ecma262/#sec-set-objects + module.exports = collection('Set', function (init) { + return function Set() { + return init(this, arguments.length ? arguments[0] : undefined); + }; + }, collectionStrong); + }, + { + '../internals/collection': 50, + '../internals/collection-strong': 48 + } + ], + 208: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; + var toLength = _dereq_('../internals/to-length'); + var notARegExp = _dereq_('../internals/not-a-regexp'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var correctIsRegExpLogic = _dereq_('../internals/correct-is-regexp-logic'); + var IS_PURE = _dereq_('../internals/is-pure'); + var nativeEndsWith = ''.endsWith; + var min = Math.min; + var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); + // https://github.com/zloirock/core-js/pull/702 + var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { + var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); + return descriptor && !descriptor.writable; + }(); + // `String.prototype.endsWith` method + // https://tc39.github.io/ecma262/#sec-string.prototype.endswith + $({ + target: 'String', + proto: true, + forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC + }, { + endsWith: function endsWith(searchString /* , endPosition = @length */ ) { + var that = String(requireObjectCoercible(this)); + notARegExp(searchString); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : min(toLength(endPosition), len); + var search = String(searchString); + return nativeEndsWith ? nativeEndsWith.call(that, search, end) : that.slice(end - search.length, end) === search; + } + }); + }, + { + '../internals/correct-is-regexp-logic': 52, + '../internals/export': 68, + '../internals/is-pure': 93, + '../internals/not-a-regexp': 105, + '../internals/object-get-own-property-descriptor': 111, + '../internals/require-object-coercible': 131, + '../internals/to-length': 154 + } + ], + 209: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var notARegExp = _dereq_('../internals/not-a-regexp'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var correctIsRegExpLogic = _dereq_('../internals/correct-is-regexp-logic'); + // `String.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-string.prototype.includes + $({ + target: 'String', + proto: true, + forced: !correctIsRegExpLogic('includes') + }, { + includes: function includes(searchString /* , position = 0 */ ) { + return !!~String(requireObjectCoercible(this)).indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/correct-is-regexp-logic': 52, + '../internals/export': 68, + '../internals/not-a-regexp': 105, + '../internals/require-object-coercible': 131 + } + ], + 210: [ + function (_dereq_, module, exports) { + 'use strict'; + var charAt = _dereq_('../internals/string-multibyte').charAt; + var InternalStateModule = _dereq_('../internals/internal-state'); + var defineIterator = _dereq_('../internals/define-iterator'); + var STRING_ITERATOR = 'String Iterator'; + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + // `String.prototype[@@iterator]` method + // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator + defineIterator(String, 'String', function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: String(iterated), + index: 0 + }); + // `%StringIteratorPrototype%.next` method + // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next + }, function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return { + value: undefined, + done: true + }; + point = charAt(string, index); + state.index += point.length; + return { + value: point, + done: false + }; + }); + }, + { + '../internals/define-iterator': 59, + '../internals/internal-state': 88, + '../internals/string-multibyte': 141 + } + ], + 211: [ + function (_dereq_, module, exports) { + 'use strict'; + var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); + var anObject = _dereq_('../internals/an-object'); + var toLength = _dereq_('../internals/to-length'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var advanceStringIndex = _dereq_('../internals/advance-string-index'); + var regExpExec = _dereq_('../internals/regexp-exec-abstract'); + // @@match logic + fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { + return [ // `String.prototype.match` method + // https://tc39.github.io/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = regexp == undefined ? undefined : regexp[MATCH]; + return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp) [MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative(nativeMatch, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + if (!rx.global) return regExpExec(rx, S); + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = [ + ]; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; + }); + }, + { + '../internals/advance-string-index': 26, + '../internals/an-object': 28, + '../internals/fix-regexp-well-known-symbol-logic': 70, + '../internals/regexp-exec-abstract': 127, + '../internals/require-object-coercible': 131, + '../internals/to-length': 154 + } + ], + 212: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $padStart = _dereq_('../internals/string-pad').start; + var WEBKIT_BUG = _dereq_('../internals/string-pad-webkit-bug'); + // `String.prototype.padStart` method + // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + $({ + target: 'String', + proto: true, + forced: WEBKIT_BUG + }, { + padStart: function padStart(maxLength /* , fillString = ' ' */ ) { + return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); + } + }); + }, + { + '../internals/export': 68, + '../internals/string-pad': 143, + '../internals/string-pad-webkit-bug': 142 + } + ], + 213: [ + function (_dereq_, module, exports) { + var $ = _dereq_('../internals/export'); + var repeat = _dereq_('../internals/string-repeat'); + // `String.prototype.repeat` method + // https://tc39.github.io/ecma262/#sec-string.prototype.repeat + $({ + target: 'String', + proto: true + }, { + repeat: repeat + }); + }, + { + '../internals/export': 68, + '../internals/string-repeat': 145 + } + ], + 214: [ + function (_dereq_, module, exports) { + 'use strict'; + var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); + var anObject = _dereq_('../internals/an-object'); + var toObject = _dereq_('../internals/to-object'); + var toLength = _dereq_('../internals/to-length'); + var toInteger = _dereq_('../internals/to-integer'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var advanceStringIndex = _dereq_('../internals/advance-string-index'); + var regExpExec = _dereq_('../internals/regexp-exec-abstract'); + var max = Math.max; + var min = Math.min; + var floor = Math.floor; + var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; + var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; + var maybeToString = function (it) { + return it === undefined ? it : String(it); + }; + // @@replace logic + fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) { + var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE; + var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0; + var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; + return [ // `String.prototype.replace` method + // https://tc39.github.io/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; + return replacer !== undefined ? replacer.call(searchValue, O, replaceValue) : nativeReplace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + if (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0 || typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === - 1) { + var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); + if (res.done) return res.value; + } + var rx = anObject(regexp); + var S = String(this); + var functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) replaceValue = String(replaceValue); + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = [ + ]; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + results.push(result); + if (!global) break; + var matchStr = String(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + var matched = String(result[0]); + var position = max(min(toInteger(result.index), S.length), 0); + var captures = [ + ]; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [ + matched + ].concat(captures, position, S); + if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); + var replacement = String(replaceValue.apply(undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + S.slice(nextSourcePosition); + } + ]; + // https://tc39.github.io/ecma262/#sec-getsubstitution + function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return nativeReplace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': + return '$'; + case '&': + return matched; + case '`': + return str.slice(0, position); + case '\'': + return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, - 1)]; + break; + default: + // \d\d? + var n = + ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); + } + }); + }, + { + '../internals/advance-string-index': 26, + '../internals/an-object': 28, + '../internals/fix-regexp-well-known-symbol-logic': 70, + '../internals/regexp-exec-abstract': 127, + '../internals/require-object-coercible': 131, + '../internals/to-integer': 153, + '../internals/to-length': 154, + '../internals/to-object': 155 + } + ], + 215: [ + function (_dereq_, module, exports) { + 'use strict'; + var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); + var anObject = _dereq_('../internals/an-object'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var sameValue = _dereq_('../internals/same-value'); + var regExpExec = _dereq_('../internals/regexp-exec-abstract'); + // @@search logic + fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { + return [ // `String.prototype.search` method + // https://tc39.github.io/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = regexp == undefined ? undefined : regexp[SEARCH]; + return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp) [SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative(nativeSearch, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? - 1 : result.index; + } + ]; + }); + }, + { + '../internals/an-object': 28, + '../internals/fix-regexp-well-known-symbol-logic': 70, + '../internals/regexp-exec-abstract': 127, + '../internals/require-object-coercible': 131, + '../internals/same-value': 132 + } + ], + 216: [ + function (_dereq_, module, exports) { + 'use strict'; + var fixRegExpWellKnownSymbolLogic = _dereq_('../internals/fix-regexp-well-known-symbol-logic'); + var isRegExp = _dereq_('../internals/is-regexp'); + var anObject = _dereq_('../internals/an-object'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var speciesConstructor = _dereq_('../internals/species-constructor'); + var advanceStringIndex = _dereq_('../internals/advance-string-index'); + var toLength = _dereq_('../internals/to-length'); + var callRegExpExec = _dereq_('../internals/regexp-exec-abstract'); + var regexpExec = _dereq_('../internals/regexp-exec'); + var fails = _dereq_('../internals/fails'); + var arrayPush = [ + ].push; + var min = Math.min; + var MAX_UINT32 = 4294967295; + // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError + var SUPPORTS_Y = !fails(function () { + return !RegExp(MAX_UINT32, 'y'); + }); + // @@split logic + fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) { + var internalSplit; + if ('abbc'.split(/(b)*/) [1] == 'c' || 'test'.split(/(?:)/, - 1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || '.'.split(/()()/).length > 1 || ''.split(/.?/).length) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(requireObjectCoercible(this)); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) { + return nativeSplit.call(string, separator, lim); + } + var output = [ + ]; + var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, + lastIndex, + lastLength; + while (match = regexpExec.call(separatorCopy, string)) { + lastIndex = separatorCopy.lastIndex; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1)); + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= lim) break; + } + if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop + } + if (lastLastIndex === string.length) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output.length > lim ? output.slice(0, lim) : output; + }; + // Chakra, V8 + } else if ('0'.split(undefined, 0).length) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [ + ] : nativeSplit.call(this, separator, limit); + }; + } else internalSplit = nativeSplit; + return [ // `String.prototype.split` method + // https://tc39.github.io/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = requireObjectCoercible(this); + var splitter = separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined ? splitter.call(separator, O, limit) : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var C = speciesConstructor(rx, RegExp); + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (SUPPORTS_Y ? 'y' : 'g'); + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [ + S + ] : [ + ]; + var p = 0; + var q = 0; + var A = [ + ]; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); + var e; + if (z === null || (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + } + ]; + }, !SUPPORTS_Y); + }, + { + '../internals/advance-string-index': 26, + '../internals/an-object': 28, + '../internals/fails': 69, + '../internals/fix-regexp-well-known-symbol-logic': 70, + '../internals/is-regexp': 94, + '../internals/regexp-exec': 128, + '../internals/regexp-exec-abstract': 127, + '../internals/require-object-coercible': 131, + '../internals/species-constructor': 139, + '../internals/to-length': 154 + } + ], + 217: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var getOwnPropertyDescriptor = _dereq_('../internals/object-get-own-property-descriptor').f; + var toLength = _dereq_('../internals/to-length'); + var notARegExp = _dereq_('../internals/not-a-regexp'); + var requireObjectCoercible = _dereq_('../internals/require-object-coercible'); + var correctIsRegExpLogic = _dereq_('../internals/correct-is-regexp-logic'); + var IS_PURE = _dereq_('../internals/is-pure'); + var nativeStartsWith = ''.startsWith; + var min = Math.min; + var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); + // https://github.com/zloirock/core-js/pull/702 + var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { + var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); + return descriptor && !descriptor.writable; + }(); + // `String.prototype.startsWith` method + // https://tc39.github.io/ecma262/#sec-string.prototype.startswith + $({ + target: 'String', + proto: true, + forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC + }, { + startsWith: function startsWith(searchString /* , position = 0 */ ) { + var that = String(requireObjectCoercible(this)); + notARegExp(searchString); + var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return nativeStartsWith ? nativeStartsWith.call(that, search, index) : that.slice(index, index + search.length) === search; + } + }); + }, + { + '../internals/correct-is-regexp-logic': 52, + '../internals/export': 68, + '../internals/is-pure': 93, + '../internals/not-a-regexp': 105, + '../internals/object-get-own-property-descriptor': 111, + '../internals/require-object-coercible': 131, + '../internals/to-length': 154 + } + ], + 218: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var createHTML = _dereq_('../internals/create-html'); + var forcedStringHTMLMethod = _dereq_('../internals/string-html-forced'); + // `String.prototype.sub` method + // https://tc39.github.io/ecma262/#sec-string.prototype.sub + $({ + target: 'String', + proto: true, + forced: forcedStringHTMLMethod('sub') + }, { + sub: function sub() { + return createHTML(this, 'sub', '', ''); + } + }); + }, + { + '../internals/create-html': 54, + '../internals/export': 68, + '../internals/string-html-forced': 140 + } + ], + 219: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var $trim = _dereq_('../internals/string-trim').trim; + var forcedStringTrimMethod = _dereq_('../internals/string-trim-forced'); + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + $({ + target: 'String', + proto: true, + forced: forcedStringTrimMethod('trim') + }, { + trim: function trim() { + return $trim(this); + } + }); + }, + { + '../internals/export': 68, + '../internals/string-trim': 147, + '../internals/string-trim-forced': 146 + } + ], + 220: [ + function (_dereq_, module, exports) { + // `Symbol.prototype.description` getter + // https://tc39.github.io/ecma262/#sec-symbol.prototype.description + 'use strict'; + var $ = _dereq_('../internals/export'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var global = _dereq_('../internals/global'); + var has = _dereq_('../internals/has'); + var isObject = _dereq_('../internals/is-object'); + var defineProperty = _dereq_('../internals/object-define-property').f; + var copyConstructorProperties = _dereq_('../internals/copy-constructor-properties'); + var NativeSymbol = global.Symbol; + if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) || // Safari 12 bug + NativeSymbol().description !== undefined)) { + var EmptyStringDescriptionStore = { + }; + // wrap Symbol constructor for correct work with undefined description + var SymbolWrapper = function Symbol() { + var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]); + var result = this instanceof SymbolWrapper ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + : description === undefined ? NativeSymbol() : NativeSymbol(description); + if (description === '') EmptyStringDescriptionStore[result] = true; + return result; + }; + copyConstructorProperties(SymbolWrapper, NativeSymbol); + var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; + symbolPrototype.constructor = SymbolWrapper; + var symbolToString = symbolPrototype.toString; + var native = String(NativeSymbol('test')) == 'Symbol(test)'; + var regexp = /^Symbol\((.*)\)[^)]+$/; + defineProperty(symbolPrototype, 'description', { + configurable: true, + get: function description() { + var symbol = isObject(this) ? this.valueOf() : this; + var string = symbolToString.call(symbol); + if (has(EmptyStringDescriptionStore, symbol)) return ''; + var desc = native ? string.slice(7, - 1) : string.replace(regexp, '$1'); + return desc === '' ? undefined : desc; + } + }); + $({ + global: true, + forced: true + }, { + Symbol: SymbolWrapper + }); + } + }, + { + '../internals/copy-constructor-properties': 51, + '../internals/descriptors': 61, + '../internals/export': 68, + '../internals/global': 77, + '../internals/has': 78, + '../internals/is-object': 92, + '../internals/object-define-property': 110 + } + ], + 221: [ + function (_dereq_, module, exports) { + var defineWellKnownSymbol = _dereq_('../internals/define-well-known-symbol'); + // `Symbol.iterator` well-known symbol + // https://tc39.github.io/ecma262/#sec-symbol.iterator + defineWellKnownSymbol('iterator'); + }, + { + '../internals/define-well-known-symbol': 60 + } + ], + 222: [ + function (_dereq_, module, exports) { + 'use strict'; + var $ = _dereq_('../internals/export'); + var global = _dereq_('../internals/global'); + var getBuiltIn = _dereq_('../internals/get-built-in'); + var IS_PURE = _dereq_('../internals/is-pure'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var NATIVE_SYMBOL = _dereq_('../internals/native-symbol'); + var USE_SYMBOL_AS_UID = _dereq_('../internals/use-symbol-as-uid'); + var fails = _dereq_('../internals/fails'); + var has = _dereq_('../internals/has'); + var isArray = _dereq_('../internals/is-array'); + var isObject = _dereq_('../internals/is-object'); + var anObject = _dereq_('../internals/an-object'); + var toObject = _dereq_('../internals/to-object'); + var toIndexedObject = _dereq_('../internals/to-indexed-object'); + var toPrimitive = _dereq_('../internals/to-primitive'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + var nativeObjectCreate = _dereq_('../internals/object-create'); + var objectKeys = _dereq_('../internals/object-keys'); + var getOwnPropertyNamesModule = _dereq_('../internals/object-get-own-property-names'); + var getOwnPropertyNamesExternal = _dereq_('../internals/object-get-own-property-names-external'); + var getOwnPropertySymbolsModule = _dereq_('../internals/object-get-own-property-symbols'); + var getOwnPropertyDescriptorModule = _dereq_('../internals/object-get-own-property-descriptor'); + var definePropertyModule = _dereq_('../internals/object-define-property'); + var propertyIsEnumerableModule = _dereq_('../internals/object-property-is-enumerable'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var redefine = _dereq_('../internals/redefine'); + var shared = _dereq_('../internals/shared'); + var sharedKey = _dereq_('../internals/shared-key'); + var hiddenKeys = _dereq_('../internals/hidden-keys'); + var uid = _dereq_('../internals/uid'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var wrappedWellKnownSymbolModule = _dereq_('../internals/well-known-symbol-wrapped'); + var defineWellKnownSymbol = _dereq_('../internals/define-well-known-symbol'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var $forEach = _dereq_('../internals/array-iteration').forEach; + var HIDDEN = sharedKey('hidden'); + var SYMBOL = 'Symbol'; + var PROTOTYPE = 'prototype'; + var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); + var setInternalState = InternalStateModule.set; + var getInternalState = InternalStateModule.getterFor(SYMBOL); + var ObjectPrototype = Object[PROTOTYPE]; + var $Symbol = global.Symbol; + var $stringify = getBuiltIn('JSON', 'stringify'); + var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + var nativeDefineProperty = definePropertyModule.f; + var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; + var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; + var AllSymbols = shared('symbols'); + var ObjectPrototypeSymbols = shared('op-symbols'); + var StringToSymbolRegistry = shared('string-to-symbol-registry'); + var SymbolToStringRegistry = shared('symbol-to-string-registry'); + var WellKnownSymbolsStore = shared('wks'); + var QObject = global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDescriptor = DESCRIPTORS && fails(function () { + return nativeObjectCreate(nativeDefineProperty({ + }, 'a', { + get: function () { + return nativeDefineProperty(this, 'a', { + value: 7 + }).a; + } + })).a != 7; + }) ? function (O, P, Attributes) { + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; + nativeDefineProperty(O, P, Attributes); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { + nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); + } + } + : nativeDefineProperty; + var wrap = function (tag, description) { + var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]); + setInternalState(symbol, { + type: SYMBOL, + tag: tag, + description: description + }); + if (!DESCRIPTORS) symbol.description = description; + return symbol; + }; + var isSymbol = USE_SYMBOL_AS_UID ? function (it) { + return typeof it == 'symbol'; + } + : function (it) { + return Object(it) instanceof $Symbol; + }; + var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPrimitive(P, true); + anObject(Attributes); + if (has(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, { + })); + O[HIDDEN][key] = true; + } else { + if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = nativeObjectCreate(Attributes, { + enumerable: createPropertyDescriptor(0, false) + }); + } + return setSymbolDescriptor(O, key, Attributes); + } + return nativeDefineProperty(O, key, Attributes); + }; + var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); + $forEach(keys, function (key) { + if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); + }); + return O; + }; + var $create = function create(O, Properties) { + return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPrimitive(V, true); + var enumerable = nativePropertyIsEnumerable.call(this, P); + if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; + return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { + var it = toIndexedObject(O); + var key = toPrimitive(P, true); + if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; + var descriptor = nativeGetOwnPropertyDescriptor(it, key); + if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { + descriptor.enumerable = true; + } + return descriptor; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames(toIndexedObject(O)); + var result = [ + ]; + $forEach(names, function (key) { + if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); + }); + return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; + var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); + var result = [ + ]; + $forEach(names, function (key) { + if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) { + result.push(AllSymbols[key]); + } + }); + return result; + }; + // `Symbol` constructor + // https://tc39.github.io/ecma262/#sec-symbol-constructor + if (!NATIVE_SYMBOL) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); + var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); + var tag = uid(description); + var setter = function (value) { + if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); + }; + if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { + configurable: true, + set: setter + }); + return wrap(tag, description); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return getInternalState(this).tag; + }); + redefine($Symbol, 'withoutSetter', function (description) { + return wrap(uid(description), description); + }); + propertyIsEnumerableModule.f = $propertyIsEnumerable; + definePropertyModule.f = $defineProperty; + getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; + getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; + getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; + wrappedWellKnownSymbolModule.f = function (name) { + return wrap(wellKnownSymbol(name), name); + }; + if (DESCRIPTORS) { + // https://github.com/tc39/proposal-Symbol-description + nativeDefineProperty($Symbol[PROTOTYPE], 'description', { + configurable: true, + get: function description() { + return getInternalState(this).description; + } + }); + if (!IS_PURE) { + redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { + unsafe: true + }); + } + } + } + $({ + global: true, + wrap: true, + forced: !NATIVE_SYMBOL, + sham: !NATIVE_SYMBOL + }, { + Symbol: $Symbol + }); + $forEach(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); + }); + $({ + target: SYMBOL, + stat: true, + forced: !NATIVE_SYMBOL + }, { + // `Symbol.for` method + // https://tc39.github.io/ecma262/#sec-symbol.for + 'for': function (key) { + var string = String(key); + if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; + var symbol = $Symbol(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; + }, + // `Symbol.keyFor` method + // https://tc39.github.io/ecma262/#sec-symbol.keyfor + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); + if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; + }, + useSetter: function () { + USE_SETTER = true; + }, + useSimple: function () { + USE_SETTER = false; + } + }); + $({ + target: 'Object', + stat: true, + forced: !NATIVE_SYMBOL, + sham: !DESCRIPTORS + }, { + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor + }); + $({ + target: 'Object', + stat: true, + forced: !NATIVE_SYMBOL + }, { + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames, + // `Object.getOwnPropertySymbols` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols + getOwnPropertySymbols: $getOwnPropertySymbols + }); + // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives + // https://bugs.chromium.org/p/v8/issues/detail?id=3443 + $({ + target: 'Object', + stat: true, + forced: fails(function () { + getOwnPropertySymbolsModule.f(1); + }) + }, { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return getOwnPropertySymbolsModule.f(toObject(it)); + } + }); + // `JSON.stringify` method behavior with symbols + // https://tc39.github.io/ecma262/#sec-json.stringify + if ($stringify) { + var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () { + var symbol = $Symbol(); + // MS Edge converts symbol values to JSON as {} + return $stringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null + || $stringify({ + a: symbol + }) != '{}' // V8 throws on boxed symbols + || $stringify(Object(symbol)) != '{}'; + }); + $({ + target: 'JSON', + stat: true, + forced: FORCED_JSON_STRINGIFY + }, { + // eslint-disable-next-line no-unused-vars + stringify: function stringify(it, replacer, space) { + var args = [ + it + ]; + var index = 1; + var $replacer; + while (arguments.length > index) args.push(arguments[index++]); + $replacer = replacer; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return $stringify.apply(null, args); + } + }); + } // `Symbol.prototype[@@toPrimitive]` method + // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive + + if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { + createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); + } // `Symbol.prototype[@@toStringTag]` property + // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag + + setToStringTag($Symbol, SYMBOL); + hiddenKeys[HIDDEN] = true; + }, + { + '../internals/an-object': 28, + '../internals/array-iteration': 37, + '../internals/create-non-enumerable-property': 56, + '../internals/create-property-descriptor': 57, + '../internals/define-well-known-symbol': 60, + '../internals/descriptors': 61, + '../internals/export': 68, + '../internals/fails': 69, + '../internals/get-built-in': 74, + '../internals/global': 77, + '../internals/has': 78, + '../internals/hidden-keys': 79, + '../internals/internal-state': 88, + '../internals/is-array': 90, + '../internals/is-object': 92, + '../internals/is-pure': 93, + '../internals/native-symbol': 101, + '../internals/object-create': 108, + '../internals/object-define-property': 110, + '../internals/object-get-own-property-descriptor': 111, + '../internals/object-get-own-property-names': 113, + '../internals/object-get-own-property-names-external': 112, + '../internals/object-get-own-property-symbols': 114, + '../internals/object-keys': 117, + '../internals/object-property-is-enumerable': 118, + '../internals/redefine': 126, + '../internals/set-to-string-tag': 135, + '../internals/shared': 138, + '../internals/shared-key': 136, + '../internals/to-indexed-object': 152, + '../internals/to-object': 155, + '../internals/to-primitive': 158, + '../internals/uid': 163, + '../internals/use-symbol-as-uid': 164, + '../internals/well-known-symbol': 166, + '../internals/well-known-symbol-wrapped': 165 + } + ], + 223: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $copyWithin = _dereq_('../internals/array-copy-within'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.copyWithin` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin + exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */ ) { + return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-copy-within': 32 + } + ], + 224: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $every = _dereq_('../internals/array-iteration').every; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.every` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every + exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */ ) { + return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37 + } + ], + 225: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $fill = _dereq_('../internals/array-fill'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.fill` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill + // eslint-disable-next-line no-unused-vars + exportTypedArrayMethod('fill', function fill(value /* , start, end */ ) { + return $fill.apply(aTypedArray(this), arguments); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-fill': 33 + } + ], + 226: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $filter = _dereq_('../internals/array-iteration').filter; + var speciesConstructor = _dereq_('../internals/species-constructor'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter + exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */ ) { + var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C)) (length); + while (length > index) result[index] = list[index++]; + return result; + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37, + '../internals/species-constructor': 139 + } + ], + 227: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $findIndex = _dereq_('../internals/array-iteration').findIndex; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex + exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */ ) { + return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37 + } + ], + 228: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $find = _dereq_('../internals/array-iteration').find; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.find` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find + exportTypedArrayMethod('find', function find(predicate /* , thisArg */ ) { + return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37 + } + ], + 229: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Float32Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Float32', function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 230: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Float64Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Float64', function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 231: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $forEach = _dereq_('../internals/array-iteration').forEach; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach + exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */ ) { + $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37 + } + ], + 232: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $includes = _dereq_('../internals/array-includes').includes; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes + exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */ ) { + return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-includes': 36 + } + ], + 233: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $indexOf = _dereq_('../internals/array-includes').indexOf; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof + exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */ ) { + return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-includes': 36 + } + ], + 234: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Int16Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Int16', function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 235: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Int32Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Int32', function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 236: [ + function (_dereq_, module, exports) { + 'use strict'; + var global = _dereq_('../internals/global'); + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var ArrayIterators = _dereq_('../modules/es.array.iterator'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var ITERATOR = wellKnownSymbol('iterator'); + var Uint8Array = global.Uint8Array; + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR]; + var CORRECT_ITER_NAME = !!nativeTypedArrayIterator && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined); + var typedArrayValues = function values() { + return arrayValues.call(aTypedArray(this)); + }; + // `%TypedArray%.prototype.entries` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries + exportTypedArrayMethod('entries', function entries() { + return arrayEntries.call(aTypedArray(this)); + }); + // `%TypedArray%.prototype.keys` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys + exportTypedArrayMethod('keys', function keys() { + return arrayKeys.call(aTypedArray(this)); + }); + // `%TypedArray%.prototype.values` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values + exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME); + // `%TypedArray%.prototype[@@iterator]` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator + exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/global': 77, + '../internals/well-known-symbol': 166, + '../modules/es.array.iterator': 179 + } + ], + 237: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $join = [ + ].join; + // `%TypedArray%.prototype.join` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join + // eslint-disable-next-line no-unused-vars + exportTypedArrayMethod('join', function join(separator) { + return $join.apply(aTypedArray(this), arguments); + }); + }, + { + '../internals/array-buffer-view-core': 30 + } + ], + 238: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $lastIndexOf = _dereq_('../internals/array-last-index-of'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.lastIndexOf` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof + // eslint-disable-next-line no-unused-vars + exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */ ) { + return $lastIndexOf.apply(aTypedArray(this), arguments); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-last-index-of': 38 + } + ], + 239: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $map = _dereq_('../internals/array-iteration').map; + var speciesConstructor = _dereq_('../internals/species-constructor'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.map` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map + exportTypedArrayMethod('map', function map(mapfn /* , thisArg */ ) { + return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { + return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor))) (length); + }); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37, + '../internals/species-constructor': 139 + } + ], + 240: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $reduceRight = _dereq_('../internals/array-reduce').right; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.reduceRicht` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright + exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */ ) { + return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-reduce': 42 + } + ], + 241: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $reduce = _dereq_('../internals/array-reduce').left; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce + exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */ ) { + return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-reduce': 42 + } + ], + 242: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var floor = Math.floor; + // `%TypedArray%.prototype.reverse` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse + exportTypedArrayMethod('reverse', function reverse() { + var that = this; + var length = aTypedArray(that).length; + var middle = floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } + return that; + }); + }, + { + '../internals/array-buffer-view-core': 30 + } + ], + 243: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var toLength = _dereq_('../internals/to-length'); + var toOffset = _dereq_('../internals/to-offset'); + var toObject = _dereq_('../internals/to-object'); + var fails = _dereq_('../internals/fails'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var FORCED = fails(function () { + // eslint-disable-next-line no-undef + new Int8Array(1).set({ + }); + }); + // `%TypedArray%.prototype.set` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set + exportTypedArrayMethod('set', function set(arrayLike /* , offset */ ) { + aTypedArray(this); + var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError('Wrong length'); + while (index < len) this[offset + index] = src[index++]; + }, FORCED); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/fails': 69, + '../internals/to-length': 154, + '../internals/to-object': 155, + '../internals/to-offset': 156 + } + ], + 244: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var speciesConstructor = _dereq_('../internals/species-constructor'); + var fails = _dereq_('../internals/fails'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $slice = [ + ].slice; + var FORCED = fails(function () { + // eslint-disable-next-line no-undef + new Int8Array(1).slice(); + }); + // `%TypedArray%.prototype.slice` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice + exportTypedArrayMethod('slice', function slice(start, end) { + var list = $slice.call(aTypedArray(this), start, end); + var C = speciesConstructor(this, this.constructor); + var index = 0; + var length = list.length; + var result = new (aTypedArrayConstructor(C)) (length); + while (length > index) result[index] = list[index++]; + return result; + }, FORCED); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/fails': 69, + '../internals/species-constructor': 139 + } + ], + 245: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var $some = _dereq_('../internals/array-iteration').some; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.some` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some + exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */ ) { + return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/array-iteration': 37 + } + ], + 246: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $sort = [ + ].sort; + // `%TypedArray%.prototype.sort` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort + exportTypedArrayMethod('sort', function sort(comparefn) { + return $sort.call(aTypedArray(this), comparefn); + }); + }, + { + '../internals/array-buffer-view-core': 30 + } + ], + 247: [ + function (_dereq_, module, exports) { + 'use strict'; + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var toLength = _dereq_('../internals/to-length'); + var toAbsoluteIndex = _dereq_('../internals/to-absolute-index'); + var speciesConstructor = _dereq_('../internals/species-constructor'); + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + // `%TypedArray%.prototype.subarray` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray + exportTypedArrayMethod('subarray', function subarray(begin, end) { + var O = aTypedArray(this); + var length = O.length; + var beginIndex = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O.constructor)) (O.buffer, O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)); + }); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/species-constructor': 139, + '../internals/to-absolute-index': 150, + '../internals/to-length': 154 + } + ], + 248: [ + function (_dereq_, module, exports) { + 'use strict'; + var global = _dereq_('../internals/global'); + var ArrayBufferViewCore = _dereq_('../internals/array-buffer-view-core'); + var fails = _dereq_('../internals/fails'); + var Int8Array = global.Int8Array; + var aTypedArray = ArrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + var $toLocaleString = [ + ].toLocaleString; + var $slice = [ + ].slice; + // iOS Safari 6.x fails here + var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { + $toLocaleString.call(new Int8Array(1)); + }); + var FORCED = fails(function () { + return [1, + 2].toLocaleString() != new Int8Array([1, + 2]).toLocaleString(); + }) || !fails(function () { + Int8Array.prototype.toLocaleString.call([1, + 2]); + }); + // `%TypedArray%.prototype.toLocaleString` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring + exportTypedArrayMethod('toLocaleString', function toLocaleString() { + return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments); + }, FORCED); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/fails': 69, + '../internals/global': 77 + } + ], + 249: [ + function (_dereq_, module, exports) { + 'use strict'; + var exportTypedArrayMethod = _dereq_('../internals/array-buffer-view-core').exportTypedArrayMethod; + var fails = _dereq_('../internals/fails'); + var global = _dereq_('../internals/global'); + var Uint8Array = global.Uint8Array; + var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || { + }; + var arrayToString = [ + ].toString; + var arrayJoin = [ + ].join; + if (fails(function () { + arrayToString.call({ + }); + })) { + arrayToString = function toString() { + return arrayJoin.call(this); + }; + } + var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; + // `%TypedArray%.prototype.toString` method + // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring + exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); + }, + { + '../internals/array-buffer-view-core': 30, + '../internals/fails': 69, + '../internals/global': 77 + } + ], + 250: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Uint16Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Uint16', function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 251: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Uint32Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Uint32', function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 252: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Uint8Array` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Uint8', function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 253: [ + function (_dereq_, module, exports) { + var createTypedArrayConstructor = _dereq_('../internals/typed-array-constructor'); + // `Uint8ClampedArray` constructor + // https://tc39.github.io/ecma262/#sec-typedarray-objects + createTypedArrayConstructor('Uint8', function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; + }, true); + }, + { + '../internals/typed-array-constructor': 160 + } + ], + 254: [ + function (_dereq_, module, exports) { + 'use strict'; + var global = _dereq_('../internals/global'); + var redefineAll = _dereq_('../internals/redefine-all'); + var InternalMetadataModule = _dereq_('../internals/internal-metadata'); + var collection = _dereq_('../internals/collection'); + var collectionWeak = _dereq_('../internals/collection-weak'); + var isObject = _dereq_('../internals/is-object'); + var enforceIternalState = _dereq_('../internals/internal-state').enforce; + var NATIVE_WEAK_MAP = _dereq_('../internals/native-weak-map'); + var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; + var isExtensible = Object.isExtensible; + var InternalWeakMap; + var wrapper = function (init) { + return function WeakMap() { + return init(this, arguments.length ? arguments[0] : undefined); + }; + }; + // `WeakMap` constructor + // https://tc39.github.io/ecma262/#sec-weakmap-constructor + var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); + // IE11 WeakMap frozen keys fix + // We can't use feature detection because it crash some old IE builds + // https://github.com/zloirock/core-js/issues/485 + if (NATIVE_WEAK_MAP && IS_IE11) { + InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); + InternalMetadataModule.REQUIRED = true; + var WeakMapPrototype = $WeakMap.prototype; + var nativeDelete = WeakMapPrototype['delete']; + var nativeHas = WeakMapPrototype.has; + var nativeGet = WeakMapPrototype.get; + var nativeSet = WeakMapPrototype.set; + redefineAll(WeakMapPrototype, { + 'delete': function (key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeDelete.call(this, key) || state.frozen['delete'](key); + } + return nativeDelete.call(this, key); + }, + has: function has(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) || state.frozen.has(key); + } + return nativeHas.call(this, key); + }, + get: function get(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); + } + return nativeGet.call(this, key); + }, + set: function set(key, value) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); + } else nativeSet.call(this, key, value); + return this; + } + }); + } + }, + { + '../internals/collection': 50, + '../internals/collection-weak': 49, + '../internals/global': 77, + '../internals/internal-metadata': 87, + '../internals/internal-state': 88, + '../internals/is-object': 92, + '../internals/native-weak-map': 103, + '../internals/redefine-all': 125 + } + ], + 255: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var DOMIterables = _dereq_('../internals/dom-iterables'); + var forEach = _dereq_('../internals/array-for-each'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { + createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); + } catch (error) { + CollectionPrototype.forEach = forEach; + } + } + }, + { + '../internals/array-for-each': 34, + '../internals/create-non-enumerable-property': 56, + '../internals/dom-iterables': 63, + '../internals/global': 77 + } + ], + 256: [ + function (_dereq_, module, exports) { + var global = _dereq_('../internals/global'); + var DOMIterables = _dereq_('../internals/dom-iterables'); + var ArrayIteratorMethods = _dereq_('../modules/es.array.iterator'); + var createNonEnumerableProperty = _dereq_('../internals/create-non-enumerable-property'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var ITERATOR = wellKnownSymbol('iterator'); + var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + var ArrayValues = ArrayIteratorMethods.values; + for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) try { + createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + if (!CollectionPrototype[TO_STRING_TAG]) { + createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); + } + if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { + createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); + } catch (error) { + CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; + } + } + } + } + }, + { + '../internals/create-non-enumerable-property': 56, + '../internals/dom-iterables': 63, + '../internals/global': 77, + '../internals/well-known-symbol': 166, + '../modules/es.array.iterator': 179 + } + ], + 257: [ + function (_dereq_, module, exports) { + 'use strict'; + // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` + _dereq_('../modules/es.array.iterator'); + var $ = _dereq_('../internals/export'); + var getBuiltIn = _dereq_('../internals/get-built-in'); + var USE_NATIVE_URL = _dereq_('../internals/native-url'); + var redefine = _dereq_('../internals/redefine'); + var redefineAll = _dereq_('../internals/redefine-all'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var createIteratorConstructor = _dereq_('../internals/create-iterator-constructor'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var anInstance = _dereq_('../internals/an-instance'); + var hasOwn = _dereq_('../internals/has'); + var bind = _dereq_('../internals/function-bind-context'); + var classof = _dereq_('../internals/classof'); + var anObject = _dereq_('../internals/an-object'); + var isObject = _dereq_('../internals/is-object'); + var create = _dereq_('../internals/object-create'); + var createPropertyDescriptor = _dereq_('../internals/create-property-descriptor'); + var getIterator = _dereq_('../internals/get-iterator'); + var getIteratorMethod = _dereq_('../internals/get-iterator-method'); + var wellKnownSymbol = _dereq_('../internals/well-known-symbol'); + var $fetch = getBuiltIn('fetch'); + var Headers = getBuiltIn('Headers'); + var ITERATOR = wellKnownSymbol('iterator'); + var URL_SEARCH_PARAMS = 'URLSearchParams'; + var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; + var setInternalState = InternalStateModule.set; + var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); + var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); + var plus = /\+/g; + var sequences = Array(4); + var percentSequence = function (bytes) { + return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); + }; + var percentDecode = function (sequence) { + try { + return decodeURIComponent(sequence); + } catch (error) { + return sequence; + } + }; + var deserialize = function (it) { + var result = it.replace(plus, ' '); + var bytes = 4; + try { + return decodeURIComponent(result); + } catch (error) { + while (bytes) { + result = result.replace(percentSequence(bytes--), percentDecode); + } + return result; + } + }; + var find = /[!'()~]|%20/g; + var replace = { + '!': '%21', + '\'': '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+' + }; + var replacer = function (match) { + return replace[match]; + }; + var serialize = function (it) { + return encodeURIComponent(it).replace(find, replacer); + }; + var parseSearchParams = function (result, query) { + if (query) { + var attributes = query.split('&'); + var index = 0; + var attribute, + entry; + while (index < attributes.length) { + attribute = attributes[index++]; + if (attribute.length) { + entry = attribute.split('='); + result.push({ + key: deserialize(entry.shift()), + value: deserialize(entry.join('=')) + }); + } + } + } + }; + var updateSearchParams = function (query) { + this.entries.length = 0; + parseSearchParams(this.entries, query); + }; + var validateArgumentsLength = function (passed, required) { + if (passed < required) throw TypeError('Not enough arguments'); + }; + var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { + setInternalState(this, { + type: URL_SEARCH_PARAMS_ITERATOR, + iterator: getIterator(getInternalParamsState(params).entries), + kind: kind + }); + }, 'Iterator', function next() { + var state = getInternalIteratorState(this); + var kind = state.kind; + var step = state.iterator.next(); + var entry = step.value; + if (!step.done) { + step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [ + entry.key, + entry.value + ]; + } + return step; + }); + // `URLSearchParams` constructor + // https://url.spec.whatwg.org/#interface-urlsearchparams + var URLSearchParamsConstructor = function URLSearchParams( /* init */ + ) { + anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); + var init = arguments.length > 0 ? arguments[0] : undefined; + var that = this; + var entries = [ + ]; + var iteratorMethod, + iterator, + next, + step, + entryIterator, + entryNext, + first, + second, + key; + setInternalState(that, { + type: URL_SEARCH_PARAMS, + entries: entries, + updateURL: function () { /* empty */ + }, + updateSearchParams: updateSearchParams + }); + if (init !== undefined) { + if (isObject(init)) { + iteratorMethod = getIteratorMethod(init); + if (typeof iteratorMethod === 'function') { + iterator = iteratorMethod.call(init); + next = iterator.next; + while (!(step = next.call(iterator)).done) { + entryIterator = getIterator(anObject(step.value)); + entryNext = entryIterator.next; + if ((first = entryNext.call(entryIterator)).done || (second = entryNext.call(entryIterator)).done || !entryNext.call(entryIterator).done) throw TypeError('Expected sequence with length 2'); + entries.push({ + key: first.value + '', + value: second.value + '' + }); + } + } else for (key in init) if (hasOwn(init, key)) entries.push({ + key: key, + value: init[key] + '' + }); + } else { + parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + ''); + } + } + }; + var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; + redefineAll(URLSearchParamsPrototype, { + // `URLSearchParams.prototype.appent` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-append + append: function append(name, value) { + validateArgumentsLength(arguments.length, 2); + var state = getInternalParamsState(this); + state.entries.push({ + key: name + '', + value: value + '' + }); + state.updateURL(); + }, + // `URLSearchParams.prototype.delete` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-delete + 'delete': function (name) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var key = name + ''; + var index = 0; + while (index < entries.length) { + if (entries[index].key === key) entries.splice(index, 1); + else index++; + } + state.updateURL(); + }, + // `URLSearchParams.prototype.get` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-get + get: function get(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) return entries[index].value; + } + return null; + }, + // `URLSearchParams.prototype.getAll` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-getall + getAll: function getAll(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var result = [ + ]; + var index = 0; + for (; index < entries.length; index++) { + if (entries[index].key === key) result.push(entries[index].value); + } + return result; + }, + // `URLSearchParams.prototype.has` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-has + has: function has(name) { + validateArgumentsLength(arguments.length, 1); + var entries = getInternalParamsState(this).entries; + var key = name + ''; + var index = 0; + while (index < entries.length) { + if (entries[index++].key === key) return true; + } + return false; + }, + // `URLSearchParams.prototype.set` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-set + set: function set(name, value) { + validateArgumentsLength(arguments.length, 1); + var state = getInternalParamsState(this); + var entries = state.entries; + var found = false; + var key = name + ''; + var val = value + ''; + var index = 0; + var entry; + for (; index < entries.length; index++) { + entry = entries[index]; + if (entry.key === key) { + if (found) entries.splice(index--, 1); + else { + found = true; + entry.value = val; + } + } + } + if (!found) entries.push({ + key: key, + value: val + }); + state.updateURL(); + }, + // `URLSearchParams.prototype.sort` method + // https://url.spec.whatwg.org/#dom-urlsearchparams-sort + sort: function sort() { + var state = getInternalParamsState(this); + var entries = state.entries; + // Array#sort is not stable in some engines + var slice = entries.slice(); + var entry, + entriesIndex, + sliceIndex; + entries.length = 0; + for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { + entry = slice[sliceIndex]; + for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { + if (entries[entriesIndex].key > entry.key) { + entries.splice(entriesIndex, 0, entry); + break; + } + } + if (entriesIndex === sliceIndex) entries.push(entry); + } + state.updateURL(); + }, + // `URLSearchParams.prototype.forEach` method + forEach: function forEach(callback /* , thisArg */ ) { + var entries = getInternalParamsState(this).entries; + var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + boundFunction(entry.value, entry.key, this); + } + }, + // `URLSearchParams.prototype.keys` method + keys: function keys() { + return new URLSearchParamsIterator(this, 'keys'); + }, + // `URLSearchParams.prototype.values` method + values: function values() { + return new URLSearchParamsIterator(this, 'values'); + }, + // `URLSearchParams.prototype.entries` method + entries: function entries() { + return new URLSearchParamsIterator(this, 'entries'); + } + }, { + enumerable: true + }); + // `URLSearchParams.prototype[@@iterator]` method + redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); + // `URLSearchParams.prototype.toString` method + // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior + redefine(URLSearchParamsPrototype, 'toString', function toString() { + var entries = getInternalParamsState(this).entries; + var result = [ + ]; + var index = 0; + var entry; + while (index < entries.length) { + entry = entries[index++]; + result.push(serialize(entry.key) + '=' + serialize(entry.value)); + } + return result.join('&'); + }, { + enumerable: true + }); + setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); + $({ + global: true, + forced: !USE_NATIVE_URL + }, { + URLSearchParams: URLSearchParamsConstructor + }); + // Wrap `fetch` for correct work with polyfilled `URLSearchParams` + // https://github.com/zloirock/core-js/issues/674 + if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') { + $({ + global: true, + enumerable: true, + forced: true + }, { + fetch: function fetch(input /* , init */ ) { + var args = [ + input + ]; + var init, + body, + headers; + if (arguments.length > 1) { + init = arguments[1]; + if (isObject(init)) { + body = init.body; + if (classof(body) === URL_SEARCH_PARAMS) { + headers = init.headers ? new Headers(init.headers) : new Headers(); + if (!headers.has('content-type')) { + headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + init = create(init, { + body: createPropertyDescriptor(0, String(body)), + headers: createPropertyDescriptor(0, headers) + }); + } + } + args.push(init); + } + return $fetch.apply(this, args); + } + }); + } + module.exports = { + URLSearchParams: URLSearchParamsConstructor, + getState: getInternalParamsState + }; + }, + { + '../internals/an-instance': 27, + '../internals/an-object': 28, + '../internals/classof': 47, + '../internals/create-iterator-constructor': 55, + '../internals/create-property-descriptor': 57, + '../internals/export': 68, + '../internals/function-bind-context': 72, + '../internals/get-built-in': 74, + '../internals/get-iterator': 76, + '../internals/get-iterator-method': 75, + '../internals/has': 78, + '../internals/internal-state': 88, + '../internals/is-object': 92, + '../internals/native-url': 102, + '../internals/object-create': 108, + '../internals/redefine': 126, + '../internals/redefine-all': 125, + '../internals/set-to-string-tag': 135, + '../internals/well-known-symbol': 166, + '../modules/es.array.iterator': 179 + } + ], + 258: [ + function (_dereq_, module, exports) { + 'use strict'; + // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` + _dereq_('../modules/es.string.iterator'); + var $ = _dereq_('../internals/export'); + var DESCRIPTORS = _dereq_('../internals/descriptors'); + var USE_NATIVE_URL = _dereq_('../internals/native-url'); + var global = _dereq_('../internals/global'); + var defineProperties = _dereq_('../internals/object-define-properties'); + var redefine = _dereq_('../internals/redefine'); + var anInstance = _dereq_('../internals/an-instance'); + var has = _dereq_('../internals/has'); + var assign = _dereq_('../internals/object-assign'); + var arrayFrom = _dereq_('../internals/array-from'); + var codeAt = _dereq_('../internals/string-multibyte').codeAt; + var toASCII = _dereq_('../internals/string-punycode-to-ascii'); + var setToStringTag = _dereq_('../internals/set-to-string-tag'); + var URLSearchParamsModule = _dereq_('../modules/web.url-search-params'); + var InternalStateModule = _dereq_('../internals/internal-state'); + var NativeURL = global.URL; + var URLSearchParams = URLSearchParamsModule.URLSearchParams; + var getInternalSearchParamsState = URLSearchParamsModule.getState; + var setInternalState = InternalStateModule.set; + var getInternalURLState = InternalStateModule.getterFor('URL'); + var floor = Math.floor; + var pow = Math.pow; + var INVALID_AUTHORITY = 'Invalid authority'; + var INVALID_SCHEME = 'Invalid scheme'; + var INVALID_HOST = 'Invalid host'; + var INVALID_PORT = 'Invalid port'; + var ALPHA = /[A-Za-z]/; + var ALPHANUMERIC = /[\d+-.A-Za-z]/; + var DIGIT = /\d/; + var HEX_START = /^(0x|0X)/; + var OCT = /^[0-7]+$/; + var DEC = /^\d+$/; + var HEX = /^[\dA-Fa-f]+$/; + // eslint-disable-next-line no-control-regex + var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; + // eslint-disable-next-line no-control-regex + var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; + // eslint-disable-next-line no-control-regex + var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; + // eslint-disable-next-line no-control-regex + var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; + var EOF; + var parseHost = function (url, input) { + var result, + codePoints, + index; + if (input.charAt(0) == '[') { + if (input.charAt(input.length - 1) != ']') return INVALID_HOST; + result = parseIPv6(input.slice(1, - 1)); + if (!result) return INVALID_HOST; + url.host = result; + // opaque host + } else if (!isSpecial(url)) { + if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; + result = ''; + codePoints = arrayFrom(input); + for (index = 0; index < codePoints.length; index++) { + result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); + } + url.host = result; + } else { + input = toASCII(input); + if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; + result = parseIPv4(input); + if (result === null) return INVALID_HOST; + url.host = result; + } + }; + var parseIPv4 = function (input) { + var parts = input.split('.'); + var partsLength, + numbers, + index, + part, + radix, + number, + ipv4; + if (parts.length && parts[parts.length - 1] == '') { + parts.pop(); + } + partsLength = parts.length; + if (partsLength > 4) return input; + numbers = [ + ]; + for (index = 0; index < partsLength; index++) { + part = parts[index]; + if (part == '') return input; + radix = 10; + if (part.length > 1 && part.charAt(0) == '0') { + radix = HEX_START.test(part) ? 16 : 8; + part = part.slice(radix == 8 ? 1 : 2); + } + if (part === '') { + number = 0; + } else { + if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; + number = parseInt(part, radix); + } + numbers.push(number); + } + for (index = 0; index < partsLength; index++) { + number = numbers[index]; + if (index == partsLength - 1) { + if (number >= pow(256, 5 - partsLength)) return null; + } else if (number > 255) return null; + } + ipv4 = numbers.pop(); + for (index = 0; index < numbers.length; index++) { + ipv4 += numbers[index] * pow(256, 3 - index); + } + return ipv4; + }; + // eslint-disable-next-line max-statements + var parseIPv6 = function (input) { + var address = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + var pieceIndex = 0; + var compress = null; + var pointer = 0; + var value, + length, + numbersSeen, + ipv4Piece, + number, + swaps, + swap; + var char = function () { + return input.charAt(pointer); + }; + if (char() == ':') { + if (input.charAt(1) != ':') return; + pointer += 2; + pieceIndex++; + compress = pieceIndex; + } + while (char()) { + if (pieceIndex == 8) return; + if (char() == ':') { + if (compress !== null) return; + pointer++; + pieceIndex++; + compress = pieceIndex; + continue; + } + value = length = 0; + while (length < 4 && HEX.test(char())) { + value = value * 16 + parseInt(char(), 16); + pointer++; + length++; + } + if (char() == '.') { + if (length == 0) return; + pointer -= length; + if (pieceIndex > 6) return; + numbersSeen = 0; + while (char()) { + ipv4Piece = null; + if (numbersSeen > 0) { + if (char() == '.' && numbersSeen < 4) pointer++; + else return; + } + if (!DIGIT.test(char())) return; + while (DIGIT.test(char())) { + number = parseInt(char(), 10); + if (ipv4Piece === null) ipv4Piece = number; + else if (ipv4Piece == 0) return; + else ipv4Piece = ipv4Piece * 10 + number; + if (ipv4Piece > 255) return; + pointer++; + } + address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; + numbersSeen++; + if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; + } + if (numbersSeen != 4) return; + break; + } else if (char() == ':') { + pointer++; + if (!char()) return; + } else if (char()) return; + address[pieceIndex++] = value; + } + if (compress !== null) { + swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex != 0 && swaps > 0) { + swap = address[pieceIndex]; + address[pieceIndex--] = address[compress + swaps - 1]; + address[compress + --swaps] = swap; + } + } else if (pieceIndex != 8) return; + return address; + }; + var findLongestZeroSequence = function (ipv6) { + var maxIndex = null; + var maxLength = 1; + var currStart = null; + var currLength = 0; + var index = 0; + for (; index < 8; index++) { + if (ipv6[index] !== 0) { + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + currStart = null; + currLength = 0; + } else { + if (currStart === null) currStart = index; + ++currLength; + } + } + if (currLength > maxLength) { + maxIndex = currStart; + maxLength = currLength; + } + return maxIndex; + }; + var serializeHost = function (host) { + var result, + index, + compress, + ignore0; + // ipv4 + if (typeof host == 'number') { + result = [ + ]; + for (index = 0; index < 4; index++) { + result.unshift(host % 256); + host = floor(host / 256); + } + return result.join('.'); + // ipv6 + } else if (typeof host == 'object') { + result = ''; + compress = findLongestZeroSequence(host); + for (index = 0; index < 8; index++) { + if (ignore0 && host[index] === 0) continue; + if (ignore0) ignore0 = false; + if (compress === index) { + result += index ? ':' : '::'; + ignore0 = true; + } else { + result += host[index].toString(16); + if (index < 7) result += ':'; + } + } + return '[' + result + ']'; + } + return host; + }; + var C0ControlPercentEncodeSet = { + }; + var fragmentPercentEncodeSet = assign({ + }, C0ControlPercentEncodeSet, { + ' ': 1, + '"': 1, + '<': 1, + '>': 1, + '`': 1 + }); + var pathPercentEncodeSet = assign({ + }, fragmentPercentEncodeSet, { + '#': 1, + '?': 1, + '{': 1, + '}': 1 + }); + var userinfoPercentEncodeSet = assign({ + }, pathPercentEncodeSet, { + '/': 1, + ':': 1, + ';': 1, + '=': 1, + '@': 1, + '[': 1, + '\\': 1, + ']': 1, + '^': 1, + '|': 1 + }); + var percentEncode = function (char, set) { + var code = codeAt(char, 0); + return code > 32 && code < 127 && !has(set, char) ? char : encodeURIComponent(char); + }; + var specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + var isSpecial = function (url) { + return has(specialSchemes, url.scheme); + }; + var includesCredentials = function (url) { + return url.username != '' || url.password != ''; + }; + var cannotHaveUsernamePasswordPort = function (url) { + return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; + }; + var isWindowsDriveLetter = function (string, normalized) { + var second; + return string.length == 2 && ALPHA.test(string.charAt(0)) && ((second = string.charAt(1)) == ':' || !normalized && second == '|'); + }; + var startsWithWindowsDriveLetter = function (string) { + var third; + return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (string.length == 2 || (third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#'); + }; + var shortenURLsPath = function (url) { + var path = url.path; + var pathSize = path.length; + if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { + path.pop(); + } + }; + var isSingleDot = function (segment) { + return segment === '.' || segment.toLowerCase() === '%2e'; + }; + var isDoubleDot = function (segment) { + segment = segment.toLowerCase(); + return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; + }; + // States: + var SCHEME_START = { + }; + var SCHEME = { + }; + var NO_SCHEME = { + }; + var SPECIAL_RELATIVE_OR_AUTHORITY = { + }; + var PATH_OR_AUTHORITY = { + }; + var RELATIVE = { + }; + var RELATIVE_SLASH = { + }; + var SPECIAL_AUTHORITY_SLASHES = { + }; + var SPECIAL_AUTHORITY_IGNORE_SLASHES = { + }; + var AUTHORITY = { + }; + var HOST = { + }; + var HOSTNAME = { + }; + var PORT = { + }; + var FILE = { + }; + var FILE_SLASH = { + }; + var FILE_HOST = { + }; + var PATH_START = { + }; + var PATH = { + }; + var CANNOT_BE_A_BASE_URL_PATH = { + }; + var QUERY = { + }; + var FRAGMENT = { + }; + // eslint-disable-next-line max-statements + var parseURL = function (url, input, stateOverride, base) { + var state = stateOverride || SCHEME_START; + var pointer = 0; + var buffer = ''; + var seenAt = false; + var seenBracket = false; + var seenPasswordToken = false; + var codePoints, + char, + bufferCodePoints, + failure; + if (!stateOverride) { + url.scheme = ''; + url.username = ''; + url.password = ''; + url.host = null; + url.port = null; + url.path = [ + ]; + url.query = null; + url.fragment = null; + url.cannotBeABaseURL = false; + input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); + } + input = input.replace(TAB_AND_NEW_LINE, ''); + codePoints = arrayFrom(input); + while (pointer <= codePoints.length) { + char = codePoints[pointer]; + switch (state) { + case SCHEME_START: + if (char && ALPHA.test(char)) { + buffer += char.toLowerCase(); + state = SCHEME; + } else if (!stateOverride) { + state = NO_SCHEME; + continue; + } else return INVALID_SCHEME; + break; + case SCHEME: + if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { + buffer += char.toLowerCase(); + } else if (char == ':') { + if (stateOverride && (isSpecial(url) != has(specialSchemes, buffer) || buffer == 'file' && (includesCredentials(url) || url.port !== null) || url.scheme == 'file' && !url.host)) return; + url.scheme = buffer; + if (stateOverride) { + if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; + return; + } + buffer = ''; + if (url.scheme == 'file') { + state = FILE; + } else if (isSpecial(url) && base && base.scheme == url.scheme) { + state = SPECIAL_RELATIVE_OR_AUTHORITY; + } else if (isSpecial(url)) { + state = SPECIAL_AUTHORITY_SLASHES; + } else if (codePoints[pointer + 1] == '/') { + state = PATH_OR_AUTHORITY; + pointer++; + } else { + url.cannotBeABaseURL = true; + url.path.push(''); + state = CANNOT_BE_A_BASE_URL_PATH; + } + } else if (!stateOverride) { + buffer = ''; + state = NO_SCHEME; + pointer = 0; + continue; + } else return INVALID_SCHEME; + break; + case NO_SCHEME: + if (!base || base.cannotBeABaseURL && char != '#') return INVALID_SCHEME; + if (base.cannotBeABaseURL && char == '#') { + url.scheme = base.scheme; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + url.cannotBeABaseURL = true; + state = FRAGMENT; + break; + } + state = base.scheme == 'file' ? FILE : RELATIVE; + continue; + case SPECIAL_RELATIVE_OR_AUTHORITY: + if (char == '/' && codePoints[pointer + 1] == '/') { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + pointer++; + } else { + state = RELATIVE; + continue; + } + break; + case PATH_OR_AUTHORITY: + if (char == '/') { + state = AUTHORITY; + break; + } else { + state = PATH; + continue; + } + case RELATIVE: + url.scheme = base.scheme; + if (char == EOF) { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == '/' || char == '\\' && isSpecial(url)) { + state = RELATIVE_SLASH; + } else if (char == '?') { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + state = FRAGMENT; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + url.path = base.path.slice(); + url.path.pop(); + state = PATH; + continue; + } + break; + case RELATIVE_SLASH: + if (isSpecial(url) && (char == '/' || char == '\\')) { + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + } else if (char == '/') { + state = AUTHORITY; + } else { + url.username = base.username; + url.password = base.password; + url.host = base.host; + url.port = base.port; + state = PATH; + continue; + } + break; + case SPECIAL_AUTHORITY_SLASHES: + state = SPECIAL_AUTHORITY_IGNORE_SLASHES; + if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; + pointer++; + break; + case SPECIAL_AUTHORITY_IGNORE_SLASHES: + if (char != '/' && char != '\\') { + state = AUTHORITY; + continue; + } + break; + case AUTHORITY: + if (char == '@') { + if (seenAt) buffer = '%40' + buffer; + seenAt = true; + bufferCodePoints = arrayFrom(buffer); + for (var i = 0; i < bufferCodePoints.length; i++) { + var codePoint = bufferCodePoints[i]; + if (codePoint == ':' && !seenPasswordToken) { + seenPasswordToken = true; + continue; + } + var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); + if (seenPasswordToken) url.password += encodedCodePoints; + else url.username += encodedCodePoints; + } + buffer = ''; + } else if (char == EOF || char == '/' || char == '?' || char == '#' || char == '\\' && isSpecial(url)) { + if (seenAt && buffer == '') return INVALID_AUTHORITY; + pointer -= arrayFrom(buffer).length + 1; + buffer = ''; + state = HOST; + } else buffer += char; + break; + case HOST: + case HOSTNAME: + if (stateOverride && url.scheme == 'file') { + state = FILE_HOST; + continue; + } else if (char == ':' && !seenBracket) { + if (buffer == '') return INVALID_HOST; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ''; + state = PORT; + if (stateOverride == HOSTNAME) return; + } else if (char == EOF || char == '/' || char == '?' || char == '#' || char == '\\' && isSpecial(url)) { + if (isSpecial(url) && buffer == '') return INVALID_HOST; + if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; + failure = parseHost(url, buffer); + if (failure) return failure; + buffer = ''; + state = PATH_START; + if (stateOverride) return; + continue; + } else { + if (char == '[') seenBracket = true; + else if (char == ']') seenBracket = false; + buffer += char; + } + break; + case PORT: + if (DIGIT.test(char)) { + buffer += char; + } else if (char == EOF || char == '/' || char == '?' || char == '#' || char == '\\' && isSpecial(url) || stateOverride) { + if (buffer != '') { + var port = parseInt(buffer, 10); + if (port > 65535) return INVALID_PORT; + url.port = isSpecial(url) && port === specialSchemes[url.scheme] ? null : port; + buffer = ''; + } + if (stateOverride) return; + state = PATH_START; + continue; + } else return INVALID_PORT; + break; + case FILE: + url.scheme = 'file'; + if (char == '/' || char == '\\') state = FILE_SLASH; + else if (base && base.scheme == 'file') { + if (char == EOF) { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + } else if (char == '?') { + url.host = base.host; + url.path = base.path.slice(); + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.host = base.host; + url.path = base.path.slice(); + url.query = base.query; + url.fragment = ''; + state = FRAGMENT; + } else { + if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { + url.host = base.host; + url.path = base.path.slice(); + shortenURLsPath(url); + } + state = PATH; + continue; + } + } else { + state = PATH; + continue; + } + break; + case FILE_SLASH: + if (char == '/' || char == '\\') { + state = FILE_HOST; + break; + } + if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { + if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); + else url.host = base.host; + } + state = PATH; + continue; + case FILE_HOST: + if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { + if (!stateOverride && isWindowsDriveLetter(buffer)) { + state = PATH; + } else if (buffer == '') { + url.host = ''; + if (stateOverride) return; + state = PATH_START; + } else { + failure = parseHost(url, buffer); + if (failure) return failure; + if (url.host == 'localhost') url.host = ''; + if (stateOverride) return; + buffer = ''; + state = PATH_START; + } + continue; + } else buffer += char; + break; + case PATH_START: + if (isSpecial(url)) { + state = PATH; + if (char != '/' && char != '\\') continue; + } else if (!stateOverride && char == '?') { + url.query = ''; + state = QUERY; + } else if (!stateOverride && char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + state = PATH; + if (char != '/') continue; + } + break; + case PATH: + if (char == EOF || char == '/' || char == '\\' && isSpecial(url) || !stateOverride && (char == '?' || char == '#')) { + if (isDoubleDot(buffer)) { + shortenURLsPath(url); + if (char != '/' && !(char == '\\' && isSpecial(url))) { + url.path.push(''); + } + } else if (isSingleDot(buffer)) { + if (char != '/' && !(char == '\\' && isSpecial(url))) { + url.path.push(''); + } + } else { + if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { + if (url.host) url.host = ''; + buffer = buffer.charAt(0) + ':'; // normalize windows drive letter + } + url.path.push(buffer); + } + buffer = ''; + if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { + while (url.path.length > 1 && url.path[0] === '') { + url.path.shift(); + } + } + if (char == '?') { + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.fragment = ''; + state = FRAGMENT; + } + } else { + buffer += percentEncode(char, pathPercentEncodeSet); + } + break; + case CANNOT_BE_A_BASE_URL_PATH: + if (char == '?') { + url.query = ''; + state = QUERY; + } else if (char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); + } + break; + case QUERY: + if (!stateOverride && char == '#') { + url.fragment = ''; + state = FRAGMENT; + } else if (char != EOF) { + if (char == '\'' && isSpecial(url)) url.query += '%27'; + else if (char == '#') url.query += '%23'; + else url.query += percentEncode(char, C0ControlPercentEncodeSet); + } + break; + case FRAGMENT: + if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); + break; + } + pointer++; + } + }; + // `URL` constructor + // https://url.spec.whatwg.org/#url-class + var URLConstructor = function URL(url /* , base */ ) { + var that = anInstance(this, URLConstructor, 'URL'); + var base = arguments.length > 1 ? arguments[1] : undefined; + var urlString = String(url); + var state = setInternalState(that, { + type: 'URL' + }); + var baseState, + failure; + if (base !== undefined) { + if (base instanceof URLConstructor) baseState = getInternalURLState(base); + else { + failure = parseURL(baseState = { + }, String(base)); + if (failure) throw TypeError(failure); + } + } + failure = parseURL(state, urlString, null, baseState); + if (failure) throw TypeError(failure); + var searchParams = state.searchParams = new URLSearchParams(); + var searchParamsState = getInternalSearchParamsState(searchParams); + searchParamsState.updateSearchParams(state.query); + searchParamsState.updateURL = function () { + state.query = String(searchParams) || null; + }; + if (!DESCRIPTORS) { + that.href = serializeURL.call(that); + that.origin = getOrigin.call(that); + that.protocol = getProtocol.call(that); + that.username = getUsername.call(that); + that.password = getPassword.call(that); + that.host = getHost.call(that); + that.hostname = getHostname.call(that); + that.port = getPort.call(that); + that.pathname = getPathname.call(that); + that.search = getSearch.call(that); + that.searchParams = getSearchParams.call(that); + that.hash = getHash.call(that); + } + }; + var URLPrototype = URLConstructor.prototype; + var serializeURL = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var username = url.username; + var password = url.password; + var host = url.host; + var port = url.port; + var path = url.path; + var query = url.query; + var fragment = url.fragment; + var output = scheme + ':'; + if (host !== null) { + output += '//'; + if (includesCredentials(url)) { + output += username + (password ? ':' + password : '') + '@'; + } + output += serializeHost(host); + if (port !== null) output += ':' + port; + } else if (scheme == 'file') output += '//'; + output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; + if (query !== null) output += '?' + query; + if (fragment !== null) output += '#' + fragment; + return output; + }; + var getOrigin = function () { + var url = getInternalURLState(this); + var scheme = url.scheme; + var port = url.port; + if (scheme == 'blob') try { + return new URL(scheme.path[0]).origin; + } catch (error) { + return 'null'; + } + if (scheme == 'file' || !isSpecial(url)) return 'null'; + return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); + }; + var getProtocol = function () { + return getInternalURLState(this).scheme + ':'; + }; + var getUsername = function () { + return getInternalURLState(this).username; + }; + var getPassword = function () { + return getInternalURLState(this).password; + }; + var getHost = function () { + var url = getInternalURLState(this); + var host = url.host; + var port = url.port; + return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; + }; + var getHostname = function () { + var host = getInternalURLState(this).host; + return host === null ? '' : serializeHost(host); + }; + var getPort = function () { + var port = getInternalURLState(this).port; + return port === null ? '' : String(port); + }; + var getPathname = function () { + var url = getInternalURLState(this); + var path = url.path; + return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; + }; + var getSearch = function () { + var query = getInternalURLState(this).query; + return query ? '?' + query : ''; + }; + var getSearchParams = function () { + return getInternalURLState(this).searchParams; + }; + var getHash = function () { + var fragment = getInternalURLState(this).fragment; + return fragment ? '#' + fragment : ''; + }; + var accessorDescriptor = function (getter, setter) { + return { + get: getter, + set: setter, + configurable: true, + enumerable: true + }; + }; + if (DESCRIPTORS) { + defineProperties(URLPrototype, { + // `URL.prototype.href` accessors pair + // https://url.spec.whatwg.org/#dom-url-href + href: accessorDescriptor(serializeURL, function (href) { + var url = getInternalURLState(this); + var urlString = String(href); + var failure = parseURL(url, urlString); + if (failure) throw TypeError(failure); + getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); + }), + // `URL.prototype.origin` getter + // https://url.spec.whatwg.org/#dom-url-origin + origin: accessorDescriptor(getOrigin), + // `URL.prototype.protocol` accessors pair + // https://url.spec.whatwg.org/#dom-url-protocol + protocol: accessorDescriptor(getProtocol, function (protocol) { + var url = getInternalURLState(this); + parseURL(url, String(protocol) + ':', SCHEME_START); + }), + // `URL.prototype.username` accessors pair + // https://url.spec.whatwg.org/#dom-url-username + username: accessorDescriptor(getUsername, function (username) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(username)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.username = ''; + for (var i = 0; i < codePoints.length; i++) { + url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); + } + }), + // `URL.prototype.password` accessors pair + // https://url.spec.whatwg.org/#dom-url-password + password: accessorDescriptor(getPassword, function (password) { + var url = getInternalURLState(this); + var codePoints = arrayFrom(String(password)); + if (cannotHaveUsernamePasswordPort(url)) return; + url.password = ''; + for (var i = 0; i < codePoints.length; i++) { + url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); + } + }), + // `URL.prototype.host` accessors pair + // https://url.spec.whatwg.org/#dom-url-host + host: accessorDescriptor(getHost, function (host) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(host), HOST); + }), + // `URL.prototype.hostname` accessors pair + // https://url.spec.whatwg.org/#dom-url-hostname + hostname: accessorDescriptor(getHostname, function (hostname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + parseURL(url, String(hostname), HOSTNAME); + }), + // `URL.prototype.port` accessors pair + // https://url.spec.whatwg.org/#dom-url-port + port: accessorDescriptor(getPort, function (port) { + var url = getInternalURLState(this); + if (cannotHaveUsernamePasswordPort(url)) return; + port = String(port); + if (port == '') url.port = null; + else parseURL(url, port, PORT); + }), + // `URL.prototype.pathname` accessors pair + // https://url.spec.whatwg.org/#dom-url-pathname + pathname: accessorDescriptor(getPathname, function (pathname) { + var url = getInternalURLState(this); + if (url.cannotBeABaseURL) return; + url.path = [ + ]; + parseURL(url, pathname + '', PATH_START); + }), + // `URL.prototype.search` accessors pair + // https://url.spec.whatwg.org/#dom-url-search + search: accessorDescriptor(getSearch, function (search) { + var url = getInternalURLState(this); + search = String(search); + if (search == '') { + url.query = null; + } else { + if ('?' == search.charAt(0)) search = search.slice(1); + url.query = ''; + parseURL(url, search, QUERY); + } + getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); + }), + // `URL.prototype.searchParams` getter + // https://url.spec.whatwg.org/#dom-url-searchparams + searchParams: accessorDescriptor(getSearchParams), + // `URL.prototype.hash` accessors pair + // https://url.spec.whatwg.org/#dom-url-hash + hash: accessorDescriptor(getHash, function (hash) { + var url = getInternalURLState(this); + hash = String(hash); + if (hash == '') { + url.fragment = null; + return; + } + if ('#' == hash.charAt(0)) hash = hash.slice(1); + url.fragment = ''; + parseURL(url, hash, FRAGMENT); + }) + }); + } // `URL.prototype.toJSON` method + // https://url.spec.whatwg.org/#dom-url-tojson + + redefine(URLPrototype, 'toJSON', function toJSON() { + return serializeURL.call(this); + }, { + enumerable: true + }); + // `URL.prototype.toString` method + // https://url.spec.whatwg.org/#URL-stringification-behavior + redefine(URLPrototype, 'toString', function toString() { + return serializeURL.call(this); + }, { + enumerable: true + }); + if (NativeURL) { + var nativeCreateObjectURL = NativeURL.createObjectURL; + var nativeRevokeObjectURL = NativeURL.revokeObjectURL; + // `URL.createObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL + // eslint-disable-next-line no-unused-vars + if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { + return nativeCreateObjectURL.apply(NativeURL, arguments); + }); + // `URL.revokeObjectURL` method + // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL + // eslint-disable-next-line no-unused-vars + if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { + return nativeRevokeObjectURL.apply(NativeURL, arguments); + }); + } + setToStringTag(URLConstructor, 'URL'); + $({ + global: true, + forced: !USE_NATIVE_URL, + sham: !DESCRIPTORS + }, { + URL: URLConstructor + }); + }, + { + '../internals/an-instance': 27, + '../internals/array-from': 35, + '../internals/descriptors': 61, + '../internals/export': 68, + '../internals/global': 77, + '../internals/has': 78, + '../internals/internal-state': 88, + '../internals/native-url': 102, + '../internals/object-assign': 107, + '../internals/object-define-properties': 109, + '../internals/redefine': 126, + '../internals/set-to-string-tag': 135, + '../internals/string-multibyte': 141, + '../internals/string-punycode-to-ascii': 144, + '../modules/es.string.iterator': 210, + '../modules/web.url-search-params': 257 + } + ], + 259: [ + function (_dereq_, module, exports) { + // This file can be required in Browserify and Node.js for automatic polyfill + // To use it: require('es6-promise/auto'); + 'use strict'; + module.exports = _dereq_('./').polyfill(); + }, + { + './': 260 + } + ], + 260: [ + function (_dereq_, module, exports) { + (function (process, global) { + /*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */ + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.ES6Promise = factory(); + }) (this, function () { + 'use strict'; + function objectOrFunction(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); + } + function isFunction(x) { + return typeof x === 'function'; + } + var _isArray = void 0; + if (Array.isArray) { + _isArray = Array.isArray; + } else { + _isArray = function (x) { + return Object.prototype.toString.call(x) === '[object Array]'; + }; + } + var isArray = _isArray; + var len = 0; + var vertxNext = void 0; + var customSchedulerFn = void 0; + var asap = function asap(callback, arg) { + queue[len] = callback; + queue[len + 1] = arg; + len += 2; + if (len === 2) { + // If len is 2, that means that we need to schedule an async flush. + // If additional callbacks are queued before the queue is flushed, they + // will be processed by this flush that we are scheduling. + if (customSchedulerFn) { + customSchedulerFn(flush); + } else { + scheduleFlush(); + } + } + }; + function setScheduler(scheduleFn) { + customSchedulerFn = scheduleFn; + } + function setAsap(asapFn) { + asap = asapFn; + } + var browserWindow = typeof window !== 'undefined' ? window : undefined; + var browserGlobal = browserWindow || { + }; + var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; + var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && { + }.toString.call(process) === '[object process]'; + // test for web worker but not in IE10 + var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; + // node + function useNextTick() { + // node version 0.10.x displays a deprecation warning when nextTick is used recursively + // see https://github.com/cujojs/when/issues/410 for details + return function () { + return process.nextTick(flush); + }; + } // vertx + + function useVertxTimer() { + if (typeof vertxNext !== 'undefined') { + return function () { + vertxNext(flush); + }; + } + return useSetTimeout(); + } + function useMutationObserver() { + var iterations = 0; + var observer = new BrowserMutationObserver(flush); + var node = document.createTextNode(''); + observer.observe(node, { + characterData: true + }); + return function () { + node.data = iterations = ++iterations % 2; + }; + } // web worker + + function useMessageChannel() { + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + return function () { + return channel.port2.postMessage(0); + }; + } + function useSetTimeout() { + // Store setTimeout reference so es6-promise will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var globalSetTimeout = setTimeout; + return function () { + return globalSetTimeout(flush, 1); + }; + } + var queue = new Array(1000); + function flush() { + for (var i = 0; i < len; i += 2) { + var callback = queue[i]; + var arg = queue[i + 1]; + callback(arg); + queue[i] = undefined; + queue[i + 1] = undefined; + } + len = 0; + } + function attemptVertx() { + try { + var vertx = Function('return this') ().require('vertx'); + vertxNext = vertx.runOnLoop || vertx.runOnContext; + return useVertxTimer(); + } catch (e) { + return useSetTimeout(); + } + } + var scheduleFlush = void 0; + // Decide what async method to use to triggering processing of queued callbacks: + if (isNode) { + scheduleFlush = useNextTick(); + } else if (BrowserMutationObserver) { + scheduleFlush = useMutationObserver(); + } else if (isWorker) { + scheduleFlush = useMessageChannel(); + } else if (browserWindow === undefined && typeof _dereq_ === 'function') { + scheduleFlush = attemptVertx(); + } else { + scheduleFlush = useSetTimeout(); + } + function then(onFulfillment, onRejection) { + var parent = this; + var child = new this.constructor(noop); + if (child[PROMISE_ID] === undefined) { + makePromise(child); + } + var _state = parent._state; + if (_state) { + var callback = arguments[_state - 1]; + asap(function () { + return invokeCallback(_state, child, callback, parent._result); + }); + } else { + subscribe(parent, child, onFulfillment, onRejection); + } + return child; + } /** + `Promise.resolve` returns a promise that will become resolved with the + passed `value`. It is shorthand for the following: + + ```javascript + let promise = new Promise(function(resolve, reject){ + resolve(1); + }); + + promise.then(function(value){ + // value === 1 + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = Promise.resolve(1); + + promise.then(function(value){ + // value === 1 + }); + ``` + + @method resolve + @static + @param {Any} value value that the returned promise will be resolved with + Useful for tooling. + @return {Promise} a promise that will become fulfilled with the given + `value` + */ + + function resolve$1(object) { + /*jshint validthis:true */ + var Constructor = this; + if (object && typeof object === 'object' && object.constructor === Constructor) { + return object; + } + var promise = new Constructor(noop); + resolve(promise, object); + return promise; + } + var PROMISE_ID = Math.random().toString(36).substring(2); + function noop() { + } + var PENDING = void 0; + var FULFILLED = 1; + var REJECTED = 2; + function selfFulfillment() { + return new TypeError('You cannot resolve a promise with itself'); + } + function cannotReturnOwn() { + return new TypeError('A promises callback cannot return that same promise.'); + } + function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { + try { + then$$1.call(value, fulfillmentHandler, rejectionHandler); + } catch (e) { + return e; + } + } + function handleForeignThenable(promise, thenable, then$$1) { + asap(function (promise) { + var sealed = false; + var error = tryThen(then$$1, thenable, function (value) { + if (sealed) { + return; + } + sealed = true; + if (thenable !== value) { + resolve(promise, value); + } else { + fulfill(promise, value); + } + }, function (reason) { + if (sealed) { + return; + } + sealed = true; + reject(promise, reason); + }, 'Settle: ' + (promise._label || ' unknown promise')); + if (!sealed && error) { + sealed = true; + reject(promise, error); + } + }, promise); + } + function handleOwnThenable(promise, thenable) { + if (thenable._state === FULFILLED) { + fulfill(promise, thenable._result); + } else if (thenable._state === REJECTED) { + reject(promise, thenable._result); + } else { + subscribe(thenable, undefined, function (value) { + return resolve(promise, value); + }, function (reason) { + return reject(promise, reason); + }); + } + } + function handleMaybeThenable(promise, maybeThenable, then$$1) { + if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { + handleOwnThenable(promise, maybeThenable); + } else { + if (then$$1 === undefined) { + fulfill(promise, maybeThenable); + } else if (isFunction(then$$1)) { + handleForeignThenable(promise, maybeThenable, then$$1); + } else { + fulfill(promise, maybeThenable); + } + } + } + function resolve(promise, value) { + if (promise === value) { + reject(promise, selfFulfillment()); + } else if (objectOrFunction(value)) { + var then$$1 = void 0; + try { + then$$1 = value.then; + } catch (error) { + reject(promise, error); + return; + } + handleMaybeThenable(promise, value, then$$1); + } else { + fulfill(promise, value); + } + } + function publishRejection(promise) { + if (promise._onerror) { + promise._onerror(promise._result); + } + publish(promise); + } + function fulfill(promise, value) { + if (promise._state !== PENDING) { + return; + } + promise._result = value; + promise._state = FULFILLED; + if (promise._subscribers.length !== 0) { + asap(publish, promise); + } + } + function reject(promise, reason) { + if (promise._state !== PENDING) { + return; + } + promise._state = REJECTED; + promise._result = reason; + asap(publishRejection, promise); + } + function subscribe(parent, child, onFulfillment, onRejection) { + var _subscribers = parent._subscribers; + var length = _subscribers.length; + parent._onerror = null; + _subscribers[length] = child; + _subscribers[length + FULFILLED] = onFulfillment; + _subscribers[length + REJECTED] = onRejection; + if (length === 0 && parent._state) { + asap(publish, parent); + } + } + function publish(promise) { + var subscribers = promise._subscribers; + var settled = promise._state; + if (subscribers.length === 0) { + return; + } + var child = void 0, + callback = void 0, + detail = promise._result; + for (var i = 0; i < subscribers.length; i += 3) { + child = subscribers[i]; + callback = subscribers[i + settled]; + if (child) { + invokeCallback(settled, child, callback, detail); + } else { + callback(detail); + } + } + promise._subscribers.length = 0; + } + function invokeCallback(settled, promise, callback, detail) { + var hasCallback = isFunction(callback), + value = void 0, + error = void 0, + succeeded = true; + if (hasCallback) { + try { + value = callback(detail); + } catch (e) { + succeeded = false; + error = e; + } + if (promise === value) { + reject(promise, cannotReturnOwn()); + return; + } + } else { + value = detail; + } + if (promise._state !== PENDING) { + // noop + } else if (hasCallback && succeeded) { + resolve(promise, value); + } else if (succeeded === false) { + reject(promise, error); + } else if (settled === FULFILLED) { + fulfill(promise, value); + } else if (settled === REJECTED) { + reject(promise, value); + } + } + function initializePromise(promise, resolver) { + try { + resolver(function resolvePromise(value) { + resolve(promise, value); + }, function rejectPromise(reason) { + reject(promise, reason); + }); + } catch (e) { + reject(promise, e); + } + } + var id = 0; + function nextId() { + return id++; + } + function makePromise(promise) { + promise[PROMISE_ID] = id++; + promise._state = undefined; + promise._result = undefined; + promise._subscribers = [ + ]; + } + function validationError() { + return new Error('Array Methods must be provided an Array'); + } + var Enumerator = function () { + function Enumerator(Constructor, input) { + this._instanceConstructor = Constructor; + this.promise = new Constructor(noop); + if (!this.promise[PROMISE_ID]) { + makePromise(this.promise); + } + if (isArray(input)) { + this.length = input.length; + this._remaining = input.length; + this._result = new Array(this.length); + if (this.length === 0) { + fulfill(this.promise, this._result); + } else { + this.length = this.length || 0; + this._enumerate(input); + if (this._remaining === 0) { + fulfill(this.promise, this._result); + } + } + } else { + reject(this.promise, validationError()); + } + } + Enumerator.prototype._enumerate = function _enumerate(input) { + for (var i = 0; this._state === PENDING && i < input.length; i++) { + this._eachEntry(input[i], i); + } + }; + Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { + var c = this._instanceConstructor; + var resolve$$1 = c.resolve; + if (resolve$$1 === resolve$1) { + var _then = void 0; + var error = void 0; + var didError = false; + try { + _then = entry.then; + } catch (e) { + didError = true; + error = e; + } + if (_then === then && entry._state !== PENDING) { + this._settledAt(entry._state, i, entry._result); + } else if (typeof _then !== 'function') { + this._remaining--; + this._result[i] = entry; + } else if (c === Promise$1) { + var promise = new c(noop); + if (didError) { + reject(promise, error); + } else { + handleMaybeThenable(promise, entry, _then); + } + this._willSettleAt(promise, i); + } else { + this._willSettleAt(new c(function (resolve$$1) { + return resolve$$1(entry); + }), i); + } + } else { + this._willSettleAt(resolve$$1(entry), i); + } + }; + Enumerator.prototype._settledAt = function _settledAt(state, i, value) { + var promise = this.promise; + if (promise._state === PENDING) { + this._remaining--; + if (state === REJECTED) { + reject(promise, value); + } else { + this._result[i] = value; + } + } + if (this._remaining === 0) { + fulfill(promise, this._result); + } + }; + Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { + var enumerator = this; + subscribe(promise, undefined, function (value) { + return enumerator._settledAt(FULFILLED, i, value); + }, function (reason) { + return enumerator._settledAt(REJECTED, i, reason); + }); + }; + return Enumerator; + }(); + /** + `Promise.all` accepts an array of promises, and returns a new promise which + is fulfilled with an array of fulfillment values for the passed promises, or + rejected with the reason of the first passed promise to be rejected. It casts all + elements of the passed iterable to promises as it runs this algorithm. + + Example: + + ```javascript + let promise1 = resolve(1); + let promise2 = resolve(2); + let promise3 = resolve(3); + let promises = [ promise1, promise2, promise3 ]; + + Promise.all(promises).then(function(array){ + // The array here would be [ 1, 2, 3 ]; + }); + ``` + + If any of the `promises` given to `all` are rejected, the first promise + that is rejected will be given as an argument to the returned promises's + rejection handler. For example: + + Example: + + ```javascript + let promise1 = resolve(1); + let promise2 = reject(new Error("2")); + let promise3 = reject(new Error("3")); + let promises = [ promise1, promise2, promise3 ]; + + Promise.all(promises).then(function(array){ + // Code here never runs because there are rejected promises! + }, function(error) { + // error.message === "2" + }); + ``` + + @method all + @static + @param {Array} entries array of promises + @param {String} label optional string for labeling the promise. + Useful for tooling. + @return {Promise} promise that is fulfilled when all `promises` have been + fulfilled, or rejected if any of them become rejected. + @static + */ + function all(entries) { + return new Enumerator(this, entries).promise; + } /** + `Promise.race` returns a new promise which is settled in the same way as the + first passed promise to settle. + + Example: + + ```javascript + let promise1 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 2'); + }, 100); + }); + + Promise.race([promise1, promise2]).then(function(result){ + // result === 'promise 2' because it was resolved before promise1 + // was resolved. + }); + ``` + + `Promise.race` is deterministic in that only the state of the first + settled promise matters. For example, even if other promises given to the + `promises` array argument are resolved, but the first settled promise has + become rejected before the other promises became fulfilled, the returned + promise will become rejected: + + ```javascript + let promise1 = new Promise(function(resolve, reject){ + setTimeout(function(){ + resolve('promise 1'); + }, 200); + }); + + let promise2 = new Promise(function(resolve, reject){ + setTimeout(function(){ + reject(new Error('promise 2')); + }, 100); + }); + + Promise.race([promise1, promise2]).then(function(result){ + // Code here never runs + }, function(reason){ + // reason.message === 'promise 2' because promise 2 became rejected before + // promise 1 became fulfilled + }); + ``` + + An example real-world use case is implementing timeouts: + + ```javascript + Promise.race([ajax('foo.json'), timeout(5000)]) + ``` + + @method race + @static + @param {Array} promises array of promises to observe + Useful for tooling. + @return {Promise} a promise which settles in the same way as the first passed + promise to settle. + */ + + function race(entries) { + /*jshint validthis:true */ + var Constructor = this; + if (!isArray(entries)) { + return new Constructor(function (_, reject) { + return reject(new TypeError('You must pass an array to race.')); + }); + } else { + return new Constructor(function (resolve, reject) { + var length = entries.length; + for (var i = 0; i < length; i++) { + Constructor.resolve(entries[i]).then(resolve, reject); + } + }); + } + } /** + `Promise.reject` returns a promise rejected with the passed `reason`. + It is shorthand for the following: + + ```javascript + let promise = new Promise(function(resolve, reject){ + reject(new Error('WHOOPS')); + }); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + Instead of writing the above, your code now simply becomes the following: + + ```javascript + let promise = Promise.reject(new Error('WHOOPS')); + + promise.then(function(value){ + // Code here doesn't run because the promise is rejected! + }, function(reason){ + // reason.message === 'WHOOPS' + }); + ``` + + @method reject + @static + @param {Any} reason value that the returned promise will be rejected with. + Useful for tooling. + @return {Promise} a promise rejected with the given `reason`. + */ + + function reject$1(reason) { + /*jshint validthis:true */ + var Constructor = this; + var promise = new Constructor(noop); + reject(promise, reason); + return promise; + } + function needsResolver() { + throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); + } + function needsNew() { + throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); + } /** + Promise objects represent the eventual result of an asynchronous operation. The + primary way of interacting with a promise is through its `then` method, which + registers callbacks to receive either a promise's eventual value or the reason + why the promise cannot be fulfilled. + + Terminology + ----------- + + - `promise` is an object or function with a `then` method whose behavior conforms to this specification. + - `thenable` is an object or function that defines a `then` method. + - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). + - `exception` is a value that is thrown using the throw statement. + - `reason` is a value that indicates why a promise was rejected. + - `settled` the final resting state of a promise, fulfilled or rejected. + + A promise can be in one of three states: pending, fulfilled, or rejected. + + Promises that are fulfilled have a fulfillment value and are in the fulfilled + state. Promises that are rejected have a rejection reason and are in the + rejected state. A fulfillment value is never a thenable. + + Promises can also be said to *resolve* a value. If this value is also a + promise, then the original promise's settled state will match the value's + settled state. So a promise that *resolves* a promise that rejects will + itself reject, and a promise that *resolves* a promise that fulfills will + itself fulfill. + + + Basic Usage: + ------------ + + ```js + let promise = new Promise(function(resolve, reject) { + // on success + resolve(value); + + // on failure + reject(reason); + }); + + promise.then(function(value) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Advanced Usage: + --------------- + + Promises shine when abstracting away asynchronous interactions such as + `XMLHttpRequest`s. + + ```js + function getJSON(url) { + return new Promise(function(resolve, reject){ + let xhr = new XMLHttpRequest(); + + xhr.open('GET', url); + xhr.onreadystatechange = handler; + xhr.responseType = 'json'; + xhr.setRequestHeader('Accept', 'application/json'); + xhr.send(); + + function handler() { + if (this.readyState === this.DONE) { + if (this.status === 200) { + resolve(this.response); + } else { + reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + } + } + }; + }); + } + + getJSON('/posts.json').then(function(json) { + // on fulfillment + }, function(reason) { + // on rejection + }); + ``` + + Unlike callbacks, promises are great composable primitives. + + ```js + Promise.all([ + getJSON('/posts'), + getJSON('/comments') + ]).then(function(values){ + values[0] // => postsJSON + values[1] // => commentsJSON + + return values; + }); + ``` + + @class Promise + @param {Function} resolver + Useful for tooling. + @constructor + */ + + var Promise$1 = function () { + function Promise(resolver) { + this[PROMISE_ID] = nextId(); + this._result = this._state = undefined; + this._subscribers = [ + ]; + if (noop !== resolver) { + typeof resolver !== 'function' && needsResolver(); + this instanceof Promise ? initializePromise(this, resolver) : needsNew(); + } + } /** + The primary way of interacting with a promise is through its `then` method, + which registers callbacks to receive either a promise's eventual value or the + reason why the promise cannot be fulfilled. + ```js + findUser().then(function(user){ + // user is available + }, function(reason){ + // user is unavailable, and you are given the reason why + }); + ``` + Chaining + -------- + The return value of `then` is itself a promise. This second, 'downstream' + promise is resolved with the return value of the first promise's fulfillment + or rejection handler, or rejected if the handler throws an exception. + ```js + findUser().then(function (user) { + return user.name; + }, function (reason) { + return 'default name'; + }).then(function (userName) { + // If `findUser` fulfilled, `userName` will be the user's name, otherwise it + // will be `'default name'` + }); + findUser().then(function (user) { + throw new Error('Found user, but still unhappy'); + }, function (reason) { + throw new Error('`findUser` rejected and we're unhappy'); + }).then(function (value) { + // never reached + }, function (reason) { + // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. + // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. + }); + ``` + If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. + ```js + findUser().then(function (user) { + throw new PedagogicalException('Upstream error'); + }).then(function (value) { + // never reached + }).then(function (value) { + // never reached + }, function (reason) { + // The `PedgagocialException` is propagated all the way down to here + }); + ``` + Assimilation + ------------ + Sometimes the value you want to propagate to a downstream promise can only be + retrieved asynchronously. This can be achieved by returning a promise in the + fulfillment or rejection handler. The downstream promise will then be pending + until the returned promise is settled. This is called *assimilation*. + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // The user's comments are now available + }); + ``` + If the assimliated promise rejects, then the downstream promise will also reject. + ```js + findUser().then(function (user) { + return findCommentsByAuthor(user); + }).then(function (comments) { + // If `findCommentsByAuthor` fulfills, we'll have the value here + }, function (reason) { + // If `findCommentsByAuthor` rejects, we'll have the reason here + }); + ``` + Simple Example + -------------- + Synchronous Example + ```javascript + let result; + try { + result = findResult(); + // success + } catch(reason) { + // failure + } + ``` + Errback Example + ```js + findResult(function(result, err){ + if (err) { + // failure + } else { + // success + } + }); + ``` + Promise Example; + ```javascript + findResult().then(function(result){ + // success + }, function(reason){ + // failure + }); + ``` + Advanced Example + -------------- + Synchronous Example + ```javascript + let author, books; + try { + author = findAuthor(); + books = findBooksByAuthor(author); + // success + } catch(reason) { + // failure + } + ``` + Errback Example + ```js + function foundBooks(books) { + } + function failure(reason) { + } + findAuthor(function(author, err){ + if (err) { + failure(err); + // failure + } else { + try { + findBoooksByAuthor(author, function(books, err) { + if (err) { + failure(err); + } else { + try { + foundBooks(books); + } catch(reason) { + failure(reason); + } + } + }); + } catch(error) { + failure(err); + } + // success + } + }); + ``` + Promise Example; + ```javascript + findAuthor(). + then(findBooksByAuthor). + then(function(books){ + // found books + }).catch(function(reason){ + // something went wrong + }); + ``` + @method then + @param {Function} onFulfilled + @param {Function} onRejected + Useful for tooling. + @return {Promise} + */ + /** + `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same + as the catch block of a try/catch statement. + ```js + function findAuthor(){ + throw new Error('couldn't find that author'); + } + // synchronous + try { + findAuthor(); + } catch(reason) { + // something went wrong + } + // async with promises + findAuthor().catch(function(reason){ + // something went wrong + }); + ``` + @method catch + @param {Function} onRejection + Useful for tooling. + @return {Promise} + */ + + Promise.prototype.catch = function _catch(onRejection) { + return this.then(null, onRejection); + }; + /** + `finally` will be invoked regardless of the promise's fate just as native + try/catch/finally behaves + + Synchronous example: + + ```js + findAuthor() { + if (Math.random() > 0.5) { + throw new Error(); + } + return new Author(); + } + + try { + return findAuthor(); // succeed or fail + } catch(error) { + return findOtherAuther(); + } finally { + // always runs + // doesn't affect the return value + } + ``` + + Asynchronous example: + + ```js + findAuthor().catch(function(reason){ + return findOtherAuther(); + }).finally(function(){ + // author was either found, or not + }); + ``` + + @method finally + @param {Function} callback + @return {Promise} + */ + Promise.prototype.finally = function _finally(callback) { + var promise = this; + var constructor = promise.constructor; + if (isFunction(callback)) { + return promise.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + throw reason; + }); + }); + } + return promise.then(callback, callback); + }; + return Promise; + }(); + Promise$1.prototype.then = then; + Promise$1.all = all; + Promise$1.race = race; + Promise$1.resolve = resolve$1; + Promise$1.reject = reject$1; + Promise$1._setScheduler = setScheduler; + Promise$1._setAsap = setAsap; + Promise$1._asap = asap; + /*global self*/ + function polyfill() { + var local = void 0; + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this') (); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + var P = local.Promise; + if (P) { + var promiseToString = null; + try { + promiseToString = Object.prototype.toString.call(P.resolve()); + } catch (e) { + // silently ignored + } + if (promiseToString === '[object Promise]' && !P.cast) { + return; + } + } + local.Promise = Promise$1; + } // Strange compat.. + + Promise$1.polyfill = polyfill; + Promise$1.Promise = Promise$1; + return Promise$1; + }); + }).call(this, _dereq_('_process'), typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : { + }) + }, + { + '_process': 273 + } + ], + 261: [ + function (_dereq_, module, exports) { + (function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', + 'module'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module); + } else { + var mod = { + exports: { + } + }; + factory(mod.exports, mod); + global.fetchJsonp = mod.exports; + } + }) (this, function (exports, module) { + 'use strict'; + var defaultOptions = { + timeout: 5000, + jsonpCallback: 'callback', + jsonpCallbackFunction: null + }; + function generateCallbackFunction() { + return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); + } + function clearFunction(functionName) { + // IE8 throws an exception when you try to delete a property on window + // http://stackoverflow.com/a/1824228/751089 + try { + delete window[functionName]; + } catch (e) { + window[functionName] = undefined; + } + } + function removeScript(scriptId) { + var script = document.getElementById(scriptId); + if (script) { + document.getElementsByTagName('head') [0].removeChild(script); + } + } + function fetchJsonp(_url) { + var options = arguments.length <= 1 || arguments[1] === undefined ? { + } + : arguments[1]; + // to avoid param reassign + var url = _url; + var timeout = options.timeout || defaultOptions.timeout; + var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback; + var timeoutId = undefined; + return new Promise(function (resolve, reject) { + var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction(); + var scriptId = jsonpCallback + '_' + callbackFunction; + window[callbackFunction] = function (response) { + resolve({ + ok: true, + // keep consistent with fetch API + json: function json() { + return Promise.resolve(response); + } + }); + if (timeoutId) clearTimeout(timeoutId); + removeScript(scriptId); + clearFunction(callbackFunction); + }; + // Check if the user set their own params, and if not add a ? to start a list of params + url += url.indexOf('?') === - 1 ? '?' : '&'; + var jsonpScript = document.createElement('script'); + jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction); + if (options.charset) { + jsonpScript.setAttribute('charset', options.charset); + } + jsonpScript.id = scriptId; + document.getElementsByTagName('head') [0].appendChild(jsonpScript); + timeoutId = setTimeout(function () { + reject(new Error('JSONP request to ' + _url + ' timed out')); + clearFunction(callbackFunction); + removeScript(scriptId); + window[callbackFunction] = function () { + clearFunction(callbackFunction); + }; + }, timeout); + // Caught if got 404/500 + jsonpScript.onerror = function () { + reject(new Error('JSONP request to ' + _url + ' failed')); + clearFunction(callbackFunction); + removeScript(scriptId); + if (timeoutId) clearTimeout(timeoutId); + }; + }); + } // export as global function + /* + let local; + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + local.fetchJsonp = fetchJsonp; + */ + + module.exports = fetchJsonp; + }); + }, + { + } + ], + 262: [ + function (_dereq_, module, exports) { + /* FileSaver.js + * A saveAs() FileSaver implementation. + * 1.3.2 + * 2016-06-16 18:25:19 + * + * By Eli Grey, http://eligrey.com + * License: MIT + * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md + */ + /*global self */ + /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ + /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ + var saveAs = saveAs || function (view) { + 'use strict'; + // IE <10 is explicitly unsupported + if (typeof view === 'undefined' || typeof navigator !== 'undefined' && /MSIE [1-9]\./.test(navigator.userAgent)) { + return; + } + var doc = view.document // only get URL when necessary in case Blob.js hasn't overridden it yet + , + get_URL = function () { + return view.URL || view.webkitURL || view; + }, + save_link = doc.createElementNS('http://www.w3.org/1999/xhtml', 'a'), + can_use_save_link = ('download' in save_link), + click = function (node) { + var event = new MouseEvent('click'); + node.dispatchEvent(event); + }, + is_safari = /constructor/i.test(view.HTMLElement) || view.safari, + is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent), + throw_outside = function (ex) { + (view.setImmediate || view.setTimeout) (function () { + throw ex; + }, 0); + }, + force_saveable_type = 'application/octet-stream' // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to + , + arbitrary_revoke_timeout = 1000 * 40 // in ms + , + revoke = function (file) { + var revoker = function () { + if (typeof file === 'string') { + // file is an object URL + get_URL().revokeObjectURL(file); + } else { + // file is a File + file.remove(); + } + }; + setTimeout(revoker, arbitrary_revoke_timeout); + }, + dispatch = function (filesaver, event_types, event) { + event_types = [ + ].concat(event_types); + var i = event_types.length; + while (i--) { + var listener = filesaver['on' + event_types[i]]; + if (typeof listener === 'function') { + try { + listener.call(filesaver, event || filesaver); + } catch (ex) { + throw_outside(ex); + } + } + } + }, + auto_bom = function (blob) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(65279), + blob], { + type: blob.type + }); + } + return blob; + }, + FileSaver = function (blob, name, no_auto_bom) { + if (!no_auto_bom) { + blob = auto_bom(blob); + } // First try a.download, then web filesystem, then object URLs + + var filesaver = this, + type = blob.type, + force = type === force_saveable_type, + object_url, + dispatch_all = function () { + dispatch(filesaver, 'writestart progress write writeend'.split(' ')); + } // on any filesys errors revert to saving with object URLs + , + fs_error = function () { + if ((is_chrome_ios || force && is_safari) && view.FileReader) { + // Safari doesn't allow downloading of blob urls + var reader = new FileReader(); + reader.onloadend = function () { + var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;'); + var popup = view.open(url, '_blank'); + if (!popup) view.location.href = url; + url = undefined; // release reference before dispatching + filesaver.readyState = filesaver.DONE; + dispatch_all(); + }; + reader.readAsDataURL(blob); + filesaver.readyState = filesaver.INIT; + return; + } // don't create more object URLs than needed + + if (!object_url) { + object_url = get_URL().createObjectURL(blob); + } + if (force) { + view.location.href = object_url; + } else { + var opened = view.open(object_url, '_blank'); + if (!opened) { + // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html + view.location.href = object_url; + } + } + filesaver.readyState = filesaver.DONE; + dispatch_all(); + revoke(object_url); + }; + filesaver.readyState = filesaver.INIT; + if (can_use_save_link) { + object_url = get_URL().createObjectURL(blob); + setTimeout(function () { + save_link.href = object_url; + save_link.download = name; + click(save_link); + dispatch_all(); + revoke(object_url); + filesaver.readyState = filesaver.DONE; + }); + return; + } + fs_error(); + }, + FS_proto = FileSaver.prototype, + saveAs = function (blob, name, no_auto_bom) { + return new FileSaver(blob, name || blob.name || 'download', no_auto_bom); + }; + // IE 10+ (native saveAs) + if (typeof navigator !== 'undefined' && navigator.msSaveOrOpenBlob) { + return function (blob, name, no_auto_bom) { + name = name || blob.name || 'download'; + if (!no_auto_bom) { + blob = auto_bom(blob); + } + return navigator.msSaveOrOpenBlob(blob, name); + }; + } + FS_proto.abort = function () { + }; + FS_proto.readyState = FS_proto.INIT = 0; + FS_proto.WRITING = 1; + FS_proto.DONE = 2; + FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null; + return saveAs; + }(typeof self !== 'undefined' && self || typeof window !== 'undefined' && window || this.content); + // `self` is undefined in Firefox for Android content script context + // while `this` is nsIContentFrameMessageManager + // with an attribute `content` that corresponds to the window + if (typeof module !== 'undefined' && module.exports) { + module.exports.saveAs = saveAs; + } else if (typeof define !== 'undefined' && define !== null && define.amd !== null) { + define('FileSaver.js', function () { + return saveAs; + }); + } + }, + { + } + ], + 263: [ + function (_dereq_, module, exports) { + var __defProp = Object.defineProperty; + var __markAsModule = target=>__defProp(target, '__esModule', { + value: true + }); + var __export = (target, all) =>{ + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + }; + // src/index.js + __markAsModule(exports); + __export(exports, { + GIFEncoder: () =>GIFEncoder, + applyPalette: () =>applyPalette, + default: + () =>src_default, + nearestColor: () =>nearestColor, + nearestColorIndex: () =>nearestColorIndex, + nearestColorIndexWithDistance: () =>nearestColorIndexWithDistance, + prequantize: () =>prequantize, + quantize: () =>quantize, + snapColorsToPalette: () =>snapColorsToPalette + }); + // src/constants.js + var constants_default = { + signature: 'GIF', + version: '89a', + trailer: 59, + extensionIntroducer: 33, + applicationExtensionLabel: 255, + graphicControlExtensionLabel: 249, + imageSeparator: 44, + signatureSize: 3, + versionSize: 3, + globalColorTableFlagMask: 128, + colorResolutionMask: 112, + sortFlagMask: 8, + globalColorTableSizeMask: 7, + applicationIdentifierSize: 8, + applicationAuthCodeSize: 3, + disposalMethodMask: 28, + userInputFlagMask: 2, + transparentColorFlagMask: 1, + localColorTableFlagMask: 128, + interlaceFlagMask: 64, + idSortFlagMask: 32, + localColorTableSizeMask: 7 + }; + // src/stream.js + function createStream(initialCapacity = 256) { + let cursor = 0; + let contents = new Uint8Array(initialCapacity); + return { + get buffer() { + return contents.buffer; + }, + reset() { + cursor = 0; + }, + bytesView() { + return contents.subarray(0, cursor); + }, + bytes() { + return contents.slice(0, cursor); + }, + writeByte(byte) { + expand(cursor + 1); + contents[cursor] = byte; + cursor++; + }, + writeBytes(data, offset = 0, byteLength = data.length) { + expand(cursor + byteLength); + for (let i = 0; i < byteLength; i++) { + contents[cursor++] = data[i + offset]; + } + }, + writeBytesView(data, offset = 0, byteLength = data.byteLength) { + expand(cursor + byteLength); + contents.set(data.subarray(offset, offset + byteLength), cursor); + cursor += byteLength; + } + }; + function expand(newCapacity) { + var prevCapacity = contents.length; + if (prevCapacity >= newCapacity) return; + var CAPACITY_DOUBLING_MAX = 1024 * 1024; + newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0); + if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); + const oldContents = contents; + contents = new Uint8Array(newCapacity); + if (cursor > 0) contents.set(oldContents.subarray(0, cursor), 0); + } + } // src/lzwEncode.js + + var BITS = 12; + var DEFAULT_HSIZE = 5003; + var MASKS = [ + 0, + 1, + 3, + 7, + 15, + 31, + 63, + 127, + 255, + 511, + 1023, + 2047, + 4095, + 8191, + 16383, + 32767, + 65535 + ]; + function lzwEncode(width, height, pixels, colorDepth, outStream = createStream(512), accum = new Uint8Array(256), htab = new Int32Array(DEFAULT_HSIZE), codetab = new Int32Array(DEFAULT_HSIZE)) { + const hsize = htab.length; + const initCodeSize = Math.max(2, colorDepth); + accum.fill(0); + codetab.fill(0); + htab.fill( - 1); + let cur_accum = 0; + let cur_bits = 0; + const init_bits = initCodeSize + 1; + const g_init_bits = init_bits; + let clear_flg = false; + let n_bits = g_init_bits; + let maxcode = (1 << n_bits) - 1; + const ClearCode = 1 << init_bits - 1; + const EOFCode = ClearCode + 1; + let free_ent = ClearCode + 2; + let a_count = 0; + let ent = pixels[0]; + let hshift = 0; + for (let fcode = hsize; fcode < 65536; fcode *= 2) { + ++hshift; + } + hshift = 8 - hshift; + outStream.writeByte(initCodeSize); + output(ClearCode); + const length = pixels.length; + for (let idx = 1; idx < length; idx++) { + next_block: { + const c = pixels[idx]; + const fcode = (c << BITS) + ent; + let i = c << hshift ^ ent; + if (htab[i] === fcode) { + ent = codetab[i]; + break next_block; + } + const disp = i === 0 ? 1 : hsize - i; + while (htab[i] >= 0) { + i -= disp; + if (i < 0) i += hsize; + if (htab[i] === fcode) { + ent = codetab[i]; + break next_block; + } + } + output(ent); + ent = c; + if (free_ent < 1 << BITS) { + codetab[i] = free_ent++; + htab[i] = fcode; + } else { + htab.fill( - 1); + free_ent = ClearCode + 2; + clear_flg = true; + output(ClearCode); + } + } + } + output(ent); + output(EOFCode); + outStream.writeByte(0); + return outStream.bytesView(); + function output(code) { + cur_accum &= MASKS[cur_bits]; + if (cur_bits > 0) cur_accum |= code << cur_bits; + else cur_accum = code; + cur_bits += n_bits; + while (cur_bits >= 8) { + accum[a_count++] = cur_accum & 255; + if (a_count >= 254) { + outStream.writeByte(a_count); + outStream.writeBytesView(accum, 0, a_count); + a_count = 0; + } + cur_accum >>= 8; + cur_bits -= 8; + } + if (free_ent > maxcode || clear_flg) { + if (clear_flg) { + n_bits = g_init_bits; + maxcode = (1 << n_bits) - 1; + clear_flg = false; + } else { + ++n_bits; + maxcode = n_bits === BITS ? 1 << n_bits : (1 << n_bits) - 1; + } + } + if (code == EOFCode) { + while (cur_bits > 0) { + accum[a_count++] = cur_accum & 255; + if (a_count >= 254) { + outStream.writeByte(a_count); + outStream.writeBytesView(accum, 0, a_count); + a_count = 0; + } + cur_accum >>= 8; + cur_bits -= 8; + } + if (a_count > 0) { + outStream.writeByte(a_count); + outStream.writeBytesView(accum, 0, a_count); + a_count = 0; + } + } + } + } + var lzwEncode_default = lzwEncode; + // src/rgb-packing.js + function rgb888_to_rgb565(r, g, b) { + return r << 8 & 63488 | g << 2 & 992 | b >> 3; + } + function rgba8888_to_rgba4444(r, g, b, a) { + return r >> 4 | g & 240 | (b & 240) << 4 | (a & 240) << 8; + } + function rgb888_to_rgb444(r, g, b) { + return r >> 4 << 8 | g & 240 | b >> 4; + } // src/pnnquant2.js + + function clamp(value, min, max) { + return value < min ? min : value > max ? max : value; + } + function sqr(value) { + return value * value; + } + function find_nn(bins, idx, hasAlpha) { + var nn = 0; + var err = 1e+100; + const bin1 = bins[idx]; + const n1 = bin1.cnt; + const wa = bin1.ac; + const wr = bin1.rc; + const wg = bin1.gc; + const wb = bin1.bc; + for (var i = bin1.fw; i != 0; i = bins[i].fw) { + const bin = bins[i]; + const n2 = bin.cnt; + const nerr2 = n1 * n2 / (n1 + n2); + if (nerr2 >= err) continue; + var nerr = 0; + if (hasAlpha) { + nerr += nerr2 * sqr(bin.ac - wa); + if (nerr >= err) continue; + } + nerr += nerr2 * sqr(bin.rc - wr); + if (nerr >= err) continue; + nerr += nerr2 * sqr(bin.gc - wg); + if (nerr >= err) continue; + nerr += nerr2 * sqr(bin.bc - wb); + if (nerr >= err) continue; + err = nerr; + nn = i; + } + bin1.err = err; + bin1.nn = nn; + } + function create_bin() { + return { + ac: 0, + rc: 0, + gc: 0, + bc: 0, + cnt: 0, + nn: 0, + fw: 0, + bk: 0, + tm: 0, + mtm: 0, + err: 0 + }; + } + function create_bin_list(data, format) { + const bincount = format === 'rgb444' ? 4096 : 65536; + const bins = new Array(bincount); + const size = data.length; + if (format === 'rgba4444') { + for (let i = 0; i < size; ++i) { + const color = data[i]; + const a = color >> 24 & 255; + const b = color >> 16 & 255; + const g = color >> 8 & 255; + const r = color & 255; + const index = rgba8888_to_rgba4444(r, g, b, a); + let bin = index in bins ? bins[index] : bins[index] = create_bin(); + bin.rc += r; + bin.gc += g; + bin.bc += b; + bin.ac += a; + bin.cnt++; + } + } else if (format === 'rgb444') { + for (let i = 0; i < size; ++i) { + const color = data[i]; + const b = color >> 16 & 255; + const g = color >> 8 & 255; + const r = color & 255; + const index = rgb888_to_rgb444(r, g, b); + let bin = index in bins ? bins[index] : bins[index] = create_bin(); + bin.rc += r; + bin.gc += g; + bin.bc += b; + bin.cnt++; + } + } else { + for (let i = 0; i < size; ++i) { + const color = data[i]; + const b = color >> 16 & 255; + const g = color >> 8 & 255; + const r = color & 255; + const index = rgb888_to_rgb565(r, g, b); + let bin = index in bins ? bins[index] : bins[index] = create_bin(); + bin.rc += r; + bin.gc += g; + bin.bc += b; + bin.cnt++; + } + } + return bins; + } + function quantize(rgba, maxColors, opts = { + }) { + const { + format = 'rgb565', + clearAlpha = true, + clearAlphaColor = 0, + clearAlphaThreshold = 0, + oneBitAlpha = false + } + = opts; + if (!rgba || !rgba.buffer) { + throw new Error('quantize() expected RGBA Uint8Array data'); + } + if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) { + throw new Error('quantize() expected RGBA Uint8Array data'); + } + const data = new Uint32Array(rgba.buffer); + let useSqrt = opts.useSqrt !== false; + const hasAlpha = format === 'rgba4444'; + const bins = create_bin_list(data, format); + const bincount = bins.length; + const bincountMinusOne = bincount - 1; + const heap = new Uint32Array(bincount + 1); + var maxbins = 0; + for (var i = 0; i < bincount; ++i) { + const bin = bins[i]; + if (bin != null) { + var d = 1 / bin.cnt; + if (hasAlpha) bin.ac *= d; + bin.rc *= d; + bin.gc *= d; + bin.bc *= d; + bins[maxbins++] = bin; + } + } + if (sqr(maxColors) / maxbins < 0.022) { + useSqrt = false; + } + var i = 0; + for (; i < maxbins - 1; ++i) { + bins[i].fw = i + 1; + bins[i + 1].bk = i; + if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); + } + if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); + var h, + l, + l2; + for (i = 0; i < maxbins; ++i) { + find_nn(bins, i, false); + var err = bins[i].err; + for (l = ++heap[0]; l > 1; l = l2) { + l2 = l >> 1; + if (bins[h = heap[l2]].err <= err) break; + heap[l] = h; + } + heap[l] = i; + } + var extbins = maxbins - maxColors; + for (i = 0; i < extbins; ) { + var tb; + for (; ; ) { + var b1 = heap[1]; + tb = bins[b1]; + if (tb.tm >= tb.mtm && bins[tb.nn].mtm <= tb.tm) break; + if (tb.mtm == bincountMinusOne) b1 = heap[1] = heap[heap[0]--]; + else { + find_nn(bins, b1, false); + tb.tm = i; + } + var err = bins[b1].err; + for (l = 1; (l2 = l + l) <= heap[0]; l = l2) { + if (l2 < heap[0] && bins[heap[l2]].err > bins[heap[l2 + 1]].err) l2++; + if (err <= bins[h = heap[l2]].err) break; + heap[l] = h; + } + heap[l] = b1; + } + var nb = bins[tb.nn]; + var n1 = tb.cnt; + var n2 = nb.cnt; + var d = 1 / (n1 + n2); + if (hasAlpha) tb.ac = d * (n1 * tb.ac + n2 * nb.ac); + tb.rc = d * (n1 * tb.rc + n2 * nb.rc); + tb.gc = d * (n1 * tb.gc + n2 * nb.gc); + tb.bc = d * (n1 * tb.bc + n2 * nb.bc); + tb.cnt += nb.cnt; + tb.mtm = ++i; + bins[nb.bk].fw = nb.fw; + bins[nb.fw].bk = nb.bk; + nb.mtm = bincountMinusOne; + } + let palette = [ + ]; + var k = 0; + for (i = 0; ; ++k) { + let r = clamp(Math.round(bins[i].rc), 0, 255); + let g = clamp(Math.round(bins[i].gc), 0, 255); + let b = clamp(Math.round(bins[i].bc), 0, 255); + let a = 255; + if (hasAlpha) { + a = clamp(Math.round(bins[i].ac), 0, 255); + if (oneBitAlpha) { + const threshold = typeof oneBitAlpha === 'number' ? oneBitAlpha : 127; + a = a <= threshold ? 0 : 255; + } + if (clearAlpha && a <= clearAlphaThreshold) { + r = g = b = clearAlphaColor; + a = 0; + } + } + const color = hasAlpha ? [ + r, + g, + b, + a + ] : [ + r, + g, + b + ]; + const exists = existsInPalette(palette, color); + if (!exists) palette.push(color); + if ((i = bins[i].fw) == 0) break; + } + return palette; + } + function existsInPalette(palette, color) { + for (let i = 0; i < palette.length; i++) { + const p = palette[i]; + let matchesRGB = p[0] === color[0] && p[1] === color[1] && p[2] === color[2]; + let matchesAlpha = p.length >= 4 && color.length >= 4 ? p[3] === color[3] : true; + if (matchesRGB && matchesAlpha) return true; + } + return false; + } // src/color.js + + function euclideanDistanceSquared(a, b) { + var sum = 0; + var n; + for (n = 0; n < a.length; n++) { + const dx = a[n] - b[n]; + sum += dx * dx; + } + return sum; + } // src/palettize.js + + function roundStep(byte, step) { + return step > 1 ? Math.round(byte / step) * step : byte; + } + function prequantize(rgba, { + roundRGB = 5, + roundAlpha = 10, + oneBitAlpha = null + } + = { + }) { + const data = new Uint32Array(rgba.buffer); + for (let i = 0; i < data.length; i++) { + const color = data[i]; + let a = color >> 24 & 255; + let b = color >> 16 & 255; + let g = color >> 8 & 255; + let r = color & 255; + a = roundStep(a, roundAlpha); + if (oneBitAlpha) { + const threshold = typeof oneBitAlpha === 'number' ? oneBitAlpha : 127; + a = a <= threshold ? 0 : 255; + } + r = roundStep(r, roundRGB); + g = roundStep(g, roundRGB); + b = roundStep(b, roundRGB); + data[i] = a << 24 | b << 16 | g << 8 | r << 0; + } + } + function applyPalette(rgba, palette, format = 'rgb565') { + if (!rgba || !rgba.buffer) { + throw new Error('quantize() expected RGBA Uint8Array data'); + } + if (!(rgba instanceof Uint8Array) && !(rgba instanceof Uint8ClampedArray)) { + throw new Error('quantize() expected RGBA Uint8Array data'); + } + if (palette.length > 256) { + throw new Error('applyPalette() only works with 256 colors or less'); + } + const data = new Uint32Array(rgba.buffer); + const length = data.length; + const bincount = format === 'rgb444' ? 4096 : 65536; + const index = new Uint8Array(length); + const cache = new Array(bincount); + const hasAlpha = format === 'rgba4444'; + if (format === 'rgba4444') { + for (let i = 0; i < length; i++) { + const color = data[i]; + const a = color >> 24 & 255; + const b = color >> 16 & 255; + const g = color >> 8 & 255; + const r = color & 255; + const key = rgba8888_to_rgba4444(r, g, b, a); + const idx = key in cache ? cache[key] : cache[key] = nearestColorIndexRGBA(r, g, b, a, palette); + index[i] = idx; + } + } else { + const rgb888_to_key = format === 'rgb444' ? rgb888_to_rgb444 : rgb888_to_rgb565; + for (let i = 0; i < length; i++) { + const color = data[i]; + const b = color >> 16 & 255; + const g = color >> 8 & 255; + const r = color & 255; + const key = rgb888_to_key(r, g, b); + const idx = key in cache ? cache[key] : cache[key] = nearestColorIndexRGB(r, g, b, palette); + index[i] = idx; + } + } + return index; + } + function nearestColorIndexRGBA(r, g, b, a, palette) { + let k = 0; + let mindist = 1e+100; + for (let i = 0; i < palette.length; i++) { + const px2 = palette[i]; + const a2 = px2[3]; + let curdist = sqr2(a2 - a); + if (curdist > mindist) continue; + const r2 = px2[0]; + curdist += sqr2(r2 - r); + if (curdist > mindist) continue; + const g2 = px2[1]; + curdist += sqr2(g2 - g); + if (curdist > mindist) continue; + const b2 = px2[2]; + curdist += sqr2(b2 - b); + if (curdist > mindist) continue; + mindist = curdist; + k = i; + } + return k; + } + function nearestColorIndexRGB(r, g, b, palette) { + let k = 0; + let mindist = 1e+100; + for (let i = 0; i < palette.length; i++) { + const px2 = palette[i]; + const r2 = px2[0]; + let curdist = sqr2(r2 - r); + if (curdist > mindist) continue; + const g2 = px2[1]; + curdist += sqr2(g2 - g); + if (curdist > mindist) continue; + const b2 = px2[2]; + curdist += sqr2(b2 - b); + if (curdist > mindist) continue; + mindist = curdist; + k = i; + } + return k; + } + function snapColorsToPalette(palette, knownColors, threshold = 5) { + if (!palette.length || !knownColors.length) return; + const paletteRGB = palette.map(p=>p.slice(0, 3)); + const thresholdSq = threshold * threshold; + const dim = palette[0].length; + for (let i = 0; i < knownColors.length; i++) { + let color = knownColors[i]; + if (color.length < dim) { + color = [ + color[0], + color[1], + color[2], + 255 + ]; + } else if (color.length > dim) { + color = color.slice(0, 3); + } else { + color = color.slice(); + } + const r = nearestColorIndexWithDistance(paletteRGB, color.slice(0, 3), euclideanDistanceSquared); + const idx = r[0]; + const distanceSq = r[1]; + if (distanceSq > 0 && distanceSq <= thresholdSq) { + palette[idx] = color; + } + } + } + function sqr2(a) { + return a * a; + } + function nearestColorIndex(colors, pixel, distanceFn = euclideanDistanceSquared) { + let minDist = Infinity; + let minDistIndex = - 1; + for (let j = 0; j < colors.length; j++) { + const paletteColor = colors[j]; + const dist = distanceFn(pixel, paletteColor); + if (dist < minDist) { + minDist = dist; + minDistIndex = j; + } + } + return minDistIndex; + } + function nearestColorIndexWithDistance(colors, pixel, distanceFn = euclideanDistanceSquared) { + let minDist = Infinity; + let minDistIndex = - 1; + for (let j = 0; j < colors.length; j++) { + const paletteColor = colors[j]; + const dist = distanceFn(pixel, paletteColor); + if (dist < minDist) { + minDist = dist; + minDistIndex = j; + } + } + return [minDistIndex, + minDist]; + } + function nearestColor(colors, pixel, distanceFn = euclideanDistanceSquared) { + return colors[nearestColorIndex(colors, pixel, distanceFn)]; + } // src/index.js + + function GIFEncoder(opt = { + }) { + const { + initialCapacity = 4096, + auto = true + } + = opt; + const stream = createStream(initialCapacity); + const HSIZE = 5003; + const accum = new Uint8Array(256); + const htab = new Int32Array(HSIZE); + const codetab = new Int32Array(HSIZE); + let hasInit = false; + return { + reset() { + stream.reset(); + hasInit = false; + }, + finish() { + stream.writeByte(constants_default.trailer); + }, + bytes() { + return stream.bytes(); + }, + bytesView() { + return stream.bytesView(); + }, + get buffer() { + return stream.buffer; + }, + get stream() { + return stream; + }, + writeHeader, + writeFrame(index, width, height, opts = { + }) { + const { + transparent = false, + transparentIndex = 0, + delay = 0, + palette = null, + repeat = 0, + colorDepth = 8, + dispose = - 1 + } + = opts; + let first = false; + if (auto) { + if (!hasInit) { + first = true; + writeHeader(); + hasInit = true; + } + } else { + first = Boolean(opts.first); + } + width = Math.max(0, Math.floor(width)); + height = Math.max(0, Math.floor(height)); + if (first) { + if (!palette) { + throw new Error('First frame must include a { palette } option'); + } + encodeLogicalScreenDescriptor(stream, width, height, palette, colorDepth); + encodeColorTable(stream, palette); + if (repeat >= 0) { + encodeNetscapeExt(stream, repeat); + } + } + const delayTime = Math.round(delay / 10); + encodeGraphicControlExt(stream, dispose, delayTime, transparent, transparentIndex); + const useLocalColorTable = Boolean(palette) && !first; + encodeImageDescriptor(stream, width, height, useLocalColorTable ? palette : null); + if (useLocalColorTable) encodeColorTable(stream, palette); + encodePixels(stream, index, width, height, colorDepth, accum, htab, codetab); + } + }; + function writeHeader() { + writeUTFBytes(stream, 'GIF89a'); + } + } + function encodeGraphicControlExt(stream, dispose, delay, transparent, transparentIndex) { + stream.writeByte(33); + stream.writeByte(249); + stream.writeByte(4); + if (transparentIndex < 0) { + transparentIndex = 0; + transparent = false; + } + var transp, + disp; + if (!transparent) { + transp = 0; + disp = 0; + } else { + transp = 1; + disp = 2; + } + if (dispose >= 0) { + disp = dispose & 7; + } + disp <<= 2; + const userInput = 0; + stream.writeByte(0 | disp | userInput | transp); + writeUInt16(stream, delay); + stream.writeByte(transparentIndex || 0); + stream.writeByte(0); + } + function encodeLogicalScreenDescriptor(stream, width, height, palette, colorDepth = 8) { + const globalColorTableFlag = 1; + const sortFlag = 0; + const globalColorTableSize = colorTableSize(palette.length) - 1; + const fields = globalColorTableFlag << 7 | colorDepth - 1 << 4 | sortFlag << 3 | globalColorTableSize; + const backgroundColorIndex = 0; + const pixelAspectRatio = 0; + writeUInt16(stream, width); + writeUInt16(stream, height); + stream.writeBytes([fields, + backgroundColorIndex, + pixelAspectRatio]); + } + function encodeNetscapeExt(stream, repeat) { + stream.writeByte(33); + stream.writeByte(255); + stream.writeByte(11); + writeUTFBytes(stream, 'NETSCAPE2.0'); + stream.writeByte(3); + stream.writeByte(1); + writeUInt16(stream, repeat); + stream.writeByte(0); + } + function encodeColorTable(stream, palette) { + const colorTableLength = 1 << colorTableSize(palette.length); + for (let i = 0; i < colorTableLength; i++) { + let color = [ + 0, + 0, + 0 + ]; + if (i < palette.length) { + color = palette[i]; + } + stream.writeByte(color[0]); + stream.writeByte(color[1]); + stream.writeByte(color[2]); + } + } + function encodeImageDescriptor(stream, width, height, localPalette) { + stream.writeByte(44); + writeUInt16(stream, 0); + writeUInt16(stream, 0); + writeUInt16(stream, width); + writeUInt16(stream, height); + if (localPalette) { + const interlace = 0; + const sorted = 0; + const palSize = colorTableSize(localPalette.length) - 1; + stream.writeByte(128 | interlace | sorted | 0 | palSize); + } else { + stream.writeByte(0); + } + } + function encodePixels(stream, index, width, height, colorDepth = 8, accum, htab, codetab) { + lzwEncode_default(width, height, index, colorDepth, stream, accum, htab, codetab); + } + function writeUInt16(stream, short) { + stream.writeByte(short & 255); + stream.writeByte(short >> 8 & 255); + } + function writeUTFBytes(stream, text) { + for (var i = 0; i < text.length; i++) { + stream.writeByte(text.charCodeAt(i)); + } + } + function colorTableSize(length) { + return Math.max(Math.ceil(Math.log2(length)), 1); + } + var src_default = GIFEncoder; + }, + { + } + ], + 264: [ + function (_dereq_, module, exports) { + 'use strict'; + function _interopDefault(ex) { + return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; + } + var _classCallCheck = _interopDefault(_dereq_('@babel/runtime/helpers/classCallCheck')); + var _createClass = _interopDefault(_dereq_('@babel/runtime/helpers/createClass')); + var arr = [ + ]; + var each = arr.forEach; + var slice = arr.slice; + function defaults(obj) { + each.call(slice.call(arguments, 1), function (source) { + if (source) { + for (var prop in source) { + if (obj[prop] === undefined) obj[prop] = source[prop]; + } + } + }); + return obj; + } + var cookie = { + create: function create(name, value, minutes, domain) { + var expires; + if (minutes) { + var date = new Date(); + date.setTime(date.getTime() + minutes * 60 * 1000); + expires = '; expires=' + date.toGMTString(); + } else expires = ''; + domain = domain ? 'domain=' + domain + ';' : ''; + document.cookie = name + '=' + value + expires + ';' + domain + 'path=/'; + }, + read: function read(name) { + var nameEQ = name + '='; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) === ' ') { + c = c.substring(1, c.length); + } + if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); + } + return null; + }, + remove: function remove(name) { + this.create(name, '', - 1); + } + }; + var cookie$1 = { + name: 'cookie', + lookup: function lookup(options) { + var found; + if (options.lookupCookie && typeof document !== 'undefined') { + var c = cookie.read(options.lookupCookie); + if (c) found = c; + } + return found; + }, + cacheUserLanguage: function cacheUserLanguage(lng, options) { + if (options.lookupCookie && typeof document !== 'undefined') { + cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain); + } + } + }; + var querystring = { + name: 'querystring', + lookup: function lookup(options) { + var found; + if (typeof window !== 'undefined') { + var query = window.location.search.substring(1); + var params = query.split('&'); + for (var i = 0; i < params.length; i++) { + var pos = params[i].indexOf('='); + if (pos > 0) { + var key = params[i].substring(0, pos); + if (key === options.lookupQuerystring) { + found = params[i].substring(pos + 1); + } + } + } + } + return found; + } + }; + var hasLocalStorageSupport; + try { + hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null; + var testKey = 'i18next.translate.boo'; + window.localStorage.setItem(testKey, 'foo'); + window.localStorage.removeItem(testKey); + } catch (e) { + hasLocalStorageSupport = false; + } + var localStorage = { + name: 'localStorage', + lookup: function lookup(options) { + var found; + if (options.lookupLocalStorage && hasLocalStorageSupport) { + var lng = window.localStorage.getItem(options.lookupLocalStorage); + if (lng) found = lng; + } + return found; + }, + cacheUserLanguage: function cacheUserLanguage(lng, options) { + if (options.lookupLocalStorage && hasLocalStorageSupport) { + window.localStorage.setItem(options.lookupLocalStorage, lng); + } + } + }; + var navigator$1 = { + name: 'navigator', + lookup: function lookup(options) { + var found = [ + ]; + if (typeof navigator !== 'undefined') { + if (navigator.languages) { + // chrome only; not an array, so can't use .push.apply instead of iterating + for (var i = 0; i < navigator.languages.length; i++) { + found.push(navigator.languages[i]); + } + } + if (navigator.userLanguage) { + found.push(navigator.userLanguage); + } + if (navigator.language) { + found.push(navigator.language); + } + } + return found.length > 0 ? found : undefined; + } + }; + var htmlTag = { + name: 'htmlTag', + lookup: function lookup(options) { + var found; + var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null); + if (htmlTag && typeof htmlTag.getAttribute === 'function') { + found = htmlTag.getAttribute('lang'); + } + return found; + } + }; + var path = { + name: 'path', + lookup: function lookup(options) { + var found; + if (typeof window !== 'undefined') { + var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g); + if (language instanceof Array) { + if (typeof options.lookupFromPathIndex === 'number') { + if (typeof language[options.lookupFromPathIndex] !== 'string') { + return undefined; + } + found = language[options.lookupFromPathIndex].replace('/', ''); + } else { + found = language[0].replace('/', ''); + } + } + } + return found; + } + }; + var subdomain = { + name: 'subdomain', + lookup: function lookup(options) { + var found; + if (typeof window !== 'undefined') { + var language = window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi); + if (language instanceof Array) { + if (typeof options.lookupFromSubdomainIndex === 'number') { + found = language[options.lookupFromSubdomainIndex].replace('http://', '').replace('https://', '').replace('.', ''); + } else { + found = language[0].replace('http://', '').replace('https://', '').replace('.', ''); + } + } + } + return found; + } + }; + function getDefaults() { + return { + order: [ + 'querystring', + 'cookie', + 'localStorage', + 'navigator', + 'htmlTag' + ], + lookupQuerystring: 'lng', + lookupCookie: 'i18next', + lookupLocalStorage: 'i18nextLng', + // cache user language + caches: [ + 'localStorage' + ], + excludeCacheFor: [ + 'cimode' + ], + //cookieMinutes: 10, + //cookieDomain: 'myDomain' + checkWhitelist: true + }; + } + var Browser = /*#__PURE__*/ + function () { + function Browser(services) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + _classCallCheck(this, Browser); + this.type = 'languageDetector'; + this.detectors = { + }; + this.init(services, options); + } + _createClass(Browser, [ + { + key: 'init', + value: function init(services) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { + }; + this.services = services; + this.options = defaults(options, this.options || { + }, getDefaults()); // backwards compatibility + if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex; + this.i18nOptions = i18nOptions; + this.addDetector(cookie$1); + this.addDetector(querystring); + this.addDetector(localStorage); + this.addDetector(navigator$1); + this.addDetector(htmlTag); + this.addDetector(path); + this.addDetector(subdomain); + } + }, + { + key: 'addDetector', + value: function addDetector(detector) { + this.detectors[detector.name] = detector; + } + }, + { + key: 'detect', + value: function detect(detectionOrder) { + var _this = this; + if (!detectionOrder) detectionOrder = this.options.order; + var detected = [ + ]; + detectionOrder.forEach(function (detectorName) { + if (_this.detectors[detectorName]) { + var lookup = _this.detectors[detectorName].lookup(_this.options); + if (lookup && typeof lookup === 'string') lookup = [ + lookup + ]; + if (lookup) detected = detected.concat(lookup); + } + }); + var found; + detected.forEach(function (lng) { + if (found) return; + var cleanedLng = _this.services.languageUtils.formatLanguageCode(lng); + if (!_this.options.checkWhitelist || _this.services.languageUtils.isWhitelisted(cleanedLng)) found = cleanedLng; + }); + if (!found) { + var fallbacks = this.i18nOptions.fallbackLng; + if (typeof fallbacks === 'string') fallbacks = [ + fallbacks + ]; + if (!fallbacks) fallbacks = [ + ]; + if (Object.prototype.toString.apply(fallbacks) === '[object Array]') { + found = fallbacks[0]; + } else { + found = fallbacks[0] || fallbacks['default'] && fallbacks['default'][0]; + } + } + return found; + } + }, + { + key: 'cacheUserLanguage', + value: function cacheUserLanguage(lng, caches) { + var _this2 = this; + if (!caches) caches = this.options.caches; + if (!caches) return; + if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > - 1) return; + caches.forEach(function (cacheName) { + if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options); + }); + } + } + ]); + return Browser; + }(); + Browser.type = 'languageDetector'; + module.exports = Browser; + }, + { + '@babel/runtime/helpers/classCallCheck': 265, + '@babel/runtime/helpers/createClass': 266 + } + ], + 265: [ + function (_dereq_, module, exports) { + arguments[4][5][0].apply(exports, arguments) + }, + { + 'dup': 5 + } + ], + 266: [ + function (_dereq_, module, exports) { + arguments[4][6][0].apply(exports, arguments) + }, + { + 'dup': 6 + } + ], + 267: [ + function (_dereq_, module, exports) { + 'use strict'; + function _interopDefault(ex) { + return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; + } + var _typeof = _interopDefault(_dereq_('@babel/runtime/helpers/typeof')); + var _objectSpread = _interopDefault(_dereq_('@babel/runtime/helpers/objectSpread')); + var _classCallCheck = _interopDefault(_dereq_('@babel/runtime/helpers/classCallCheck')); + var _createClass = _interopDefault(_dereq_('@babel/runtime/helpers/createClass')); + var _possibleConstructorReturn = _interopDefault(_dereq_('@babel/runtime/helpers/possibleConstructorReturn')); + var _getPrototypeOf = _interopDefault(_dereq_('@babel/runtime/helpers/getPrototypeOf')); + var _assertThisInitialized = _interopDefault(_dereq_('@babel/runtime/helpers/assertThisInitialized')); + var _inherits = _interopDefault(_dereq_('@babel/runtime/helpers/inherits')); + var _toConsumableArray = _interopDefault(_dereq_('@babel/runtime/helpers/toConsumableArray')); + var _slicedToArray = _interopDefault(_dereq_('@babel/runtime/helpers/slicedToArray')); + var consoleLogger = { + type: 'logger', + log: function log(args) { + this.output('log', args); + }, + warn: function warn(args) { + this.output('warn', args); + }, + error: function error(args) { + this.output('error', args); + }, + output: function output(type, args) { + var _console; + /* eslint no-console: 0 */ + if (console && console[type]) (_console = console) [type].apply(_console, _toConsumableArray(args)); + } + }; + var Logger = /*#__PURE__*/ + function () { + function Logger(concreteLogger) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + _classCallCheck(this, Logger); + this.init(concreteLogger, options); + } + _createClass(Logger, [ + { + key: 'init', + value: function init(concreteLogger) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + this.prefix = options.prefix || 'i18next:'; + this.logger = concreteLogger || consoleLogger; + this.options = options; + this.debug = options.debug; + } + }, + { + key: 'setDebug', + value: function setDebug(bool) { + this.debug = bool; + } + }, + { + key: 'log', + value: function log() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return this.forward(args, 'log', '', true); + } + }, + { + key: 'warn', + value: function warn() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return this.forward(args, 'warn', '', true); + } + }, + { + key: 'error', + value: function error() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + return this.forward(args, 'error', ''); + } + }, + { + key: 'deprecate', + value: function deprecate() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true); + } + }, + { + key: 'forward', + value: function forward(args, lvl, prefix, debugOnly) { + if (debugOnly && !this.debug) return null; + if (typeof args[0] === 'string') args[0] = ''.concat(prefix).concat(this.prefix, ' ').concat(args[0]); + return this.logger[lvl](args); + } + }, + { + key: 'create', + value: function create(moduleName) { + return new Logger(this.logger, _objectSpread({ + }, { + prefix: ''.concat(this.prefix, ':').concat(moduleName, ':') + }, this.options)); + } + } + ]); + return Logger; + }(); + var baseLogger = new Logger(); + var EventEmitter = /*#__PURE__*/ + function () { + function EventEmitter() { + _classCallCheck(this, EventEmitter); + this.observers = { + }; + } + _createClass(EventEmitter, [ + { + key: 'on', + value: function on(events, listener) { + var _this = this; + events.split(' ').forEach(function (event) { + _this.observers[event] = _this.observers[event] || [ + ]; + _this.observers[event].push(listener); + }); + return this; + } + }, + { + key: 'off', + value: function off(event, listener) { + if (!this.observers[event]) return; + if (!listener) { + delete this.observers[event]; + return; + } + this.observers[event] = this.observers[event].filter(function (l) { + return l !== listener; + }); + } + }, + { + key: 'emit', + value: function emit(event) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + if (this.observers[event]) { + var cloned = [ + ].concat(this.observers[event]); + cloned.forEach(function (observer) { + observer.apply(void 0, args); + }); + } + if (this.observers['*']) { + var _cloned = [ + ].concat(this.observers['*']); + _cloned.forEach(function (observer) { + observer.apply(observer, [ + event + ].concat(args)); + }); + } + } + } + ]); + return EventEmitter; + }(); + // http://lea.verou.me/2016/12/resolve-promises-externally-with-this-one-weird-trick/ + function defer() { + var res; + var rej; + var promise = new Promise(function (resolve, reject) { + res = resolve; + rej = reject; + }); + promise.resolve = res; + promise.reject = rej; + return promise; + } + function makeString(object) { + if (object == null) return ''; + /* eslint prefer-template: 0 */ + return '' + object; + } + function copy(a, s, t) { + a.forEach(function (m) { + if (s[m]) t[m] = s[m]; + }); + } + function getLastOfPath(object, path, Empty) { + function cleanKey(key) { + return key && key.indexOf('###') > - 1 ? key.replace(/###/g, '.') : key; + } + function canNotTraverseDeeper() { + return !object || typeof object === 'string'; + } + var stack = typeof path !== 'string' ? [ + ].concat(path) : path.split('.'); + while (stack.length > 1) { + if (canNotTraverseDeeper()) return { + }; + var key = cleanKey(stack.shift()); + if (!object[key] && Empty) object[key] = new Empty(); + object = object[key]; + } + if (canNotTraverseDeeper()) return { + }; + return { + obj: object, + k: cleanKey(stack.shift()) + }; + } + function setPath(object, path, newValue) { + var _getLastOfPath = getLastOfPath(object, path, Object), + obj = _getLastOfPath.obj, + k = _getLastOfPath.k; + obj[k] = newValue; + } + function pushPath(object, path, newValue, concat) { + var _getLastOfPath2 = getLastOfPath(object, path, Object), + obj = _getLastOfPath2.obj, + k = _getLastOfPath2.k; + obj[k] = obj[k] || [ + ]; + if (concat) obj[k] = obj[k].concat(newValue); + if (!concat) obj[k].push(newValue); + } + function getPath(object, path) { + var _getLastOfPath3 = getLastOfPath(object, path), + obj = _getLastOfPath3.obj, + k = _getLastOfPath3.k; + if (!obj) return undefined; + return obj[k]; + } + function getPathWithDefaults(data, defaultData, key) { + var value = getPath(data, key); + if (value !== undefined) { + return value; + } // Fallback to default values + + return getPath(defaultData, key); + } + function deepExtend(target, source, overwrite) { + /* eslint no-restricted-syntax: 0 */ + for (var prop in source) { + if (prop in target) { + // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch + if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) { + if (overwrite) target[prop] = source[prop]; + } else { + deepExtend(target[prop], source[prop], overwrite); + } + } else { + target[prop] = source[prop]; + } + } + return target; + } + function regexEscape(str) { + /* eslint no-useless-escape: 0 */ + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); + } /* eslint-disable */ + + var _entityMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '/': '/' + }; + /* eslint-enable */ + function escape(data) { + if (typeof data === 'string') { + return data.replace(/[&<>"'\/]/g, function (s) { + return _entityMap[s]; + }); + } + return data; + } + var ResourceStore = /*#__PURE__*/ + function (_EventEmitter) { + _inherits(ResourceStore, _EventEmitter); + function ResourceStore(data) { + var _this; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + ns: [ + 'translation' + ], + defaultNS: 'translation' + }; + _classCallCheck(this, ResourceStore); + _this = _possibleConstructorReturn(this, _getPrototypeOf(ResourceStore).call(this)); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + _this.data = data || { + }; + _this.options = options; + if (_this.options.keySeparator === undefined) { + _this.options.keySeparator = '.'; + } + return _this; + } + _createClass(ResourceStore, [ + { + key: 'addNamespaces', + value: function addNamespaces(ns) { + if (this.options.ns.indexOf(ns) < 0) { + this.options.ns.push(ns); + } + } + }, + { + key: 'removeNamespaces', + value: function removeNamespaces(ns) { + var index = this.options.ns.indexOf(ns); + if (index > - 1) { + this.options.ns.splice(index, 1); + } + } + }, + { + key: 'getResource', + value: function getResource(lng, ns, key) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { + }; + var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; + var path = [ + lng, + ns + ]; + if (key && typeof key !== 'string') path = path.concat(key); + if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key); + if (lng.indexOf('.') > - 1) { + path = lng.split('.'); + } + return getPath(this.data, path); + } + }, + { + key: 'addResource', + value: function addResource(lng, ns, key, value) { + var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { + silent: false + }; + var keySeparator = this.options.keySeparator; + if (keySeparator === undefined) keySeparator = '.'; + var path = [ + lng, + ns + ]; + if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); + if (lng.indexOf('.') > - 1) { + path = lng.split('.'); + value = ns; + ns = path[1]; + } + this.addNamespaces(ns); + setPath(this.data, path, value); + if (!options.silent) this.emit('added', lng, ns, key, value); + } + }, + { + key: 'addResources', + value: function addResources(lng, ns, resources) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { + silent: false + }; + /* eslint no-restricted-syntax: 0 */ + for (var m in resources) { + if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], { + silent: true + }); + } + if (!options.silent) this.emit('added', lng, ns, resources); + } + }, + { + key: 'addResourceBundle', + value: function addResourceBundle(lng, ns, resources, deep, overwrite) { + var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { + silent: false + }; + var path = [ + lng, + ns + ]; + if (lng.indexOf('.') > - 1) { + path = lng.split('.'); + deep = resources; + resources = ns; + ns = path[1]; + } + this.addNamespaces(ns); + var pack = getPath(this.data, path) || { + }; + if (deep) { + deepExtend(pack, resources, overwrite); + } else { + pack = _objectSpread({ + }, pack, resources); + } + setPath(this.data, path, pack); + if (!options.silent) this.emit('added', lng, ns, resources); + } + }, + { + key: 'removeResourceBundle', + value: function removeResourceBundle(lng, ns) { + if (this.hasResourceBundle(lng, ns)) { + delete this.data[lng][ns]; + } + this.removeNamespaces(ns); + this.emit('removed', lng, ns); + } + }, + { + key: 'hasResourceBundle', + value: function hasResourceBundle(lng, ns) { + return this.getResource(lng, ns) !== undefined; + } + }, + { + key: 'getResourceBundle', + value: function getResourceBundle(lng, ns) { + if (!ns) ns = this.options.defaultNS; // COMPATIBILITY: remove extend in v2.1.0 + if (this.options.compatibilityAPI === 'v1') return _objectSpread({ + }, { + }, this.getResource(lng, ns)); + return this.getResource(lng, ns); + } + }, + { + key: 'getDataByLanguage', + value: function getDataByLanguage(lng) { + return this.data[lng]; + } + }, + { + key: 'toJSON', + value: function toJSON() { + return this.data; + } + } + ]); + return ResourceStore; + }(EventEmitter); + var postProcessor = { + processors: { + }, + addPostProcessor: function addPostProcessor(module) { + this.processors[module.name] = module; + }, + handle: function handle(processors, value, key, options, translator) { + var _this = this; + processors.forEach(function (processor) { + if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator); + }); + return value; + } + }; + var checkedLoadedFor = { + }; + var Translator = /*#__PURE__*/ + function (_EventEmitter) { + _inherits(Translator, _EventEmitter); + function Translator(services) { + var _this; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + _classCallCheck(this, Translator); + _this = _possibleConstructorReturn(this, _getPrototypeOf(Translator).call(this)); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + copy(['resourceStore', + 'languageUtils', + 'pluralResolver', + 'interpolator', + 'backendConnector', + 'i18nFormat', + 'utils'], services, _assertThisInitialized(_this)); + _this.options = options; + if (_this.options.keySeparator === undefined) { + _this.options.keySeparator = '.'; + } + _this.logger = baseLogger.create('translator'); + return _this; + } + _createClass(Translator, [ + { + key: 'changeLanguage', + value: function changeLanguage(lng) { + if (lng) this.language = lng; + } + }, + { + key: 'exists', + value: function exists(key) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + interpolation: { + } + }; + var resolved = this.resolve(key, options); + return resolved && resolved.res !== undefined; + } + }, + { + key: 'extractFromKey', + value: function extractFromKey(key, options) { + var nsSeparator = options.nsSeparator || this.options.nsSeparator; + if (nsSeparator === undefined) nsSeparator = ':'; + var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; + var namespaces = options.ns || this.options.defaultNS; + if (nsSeparator && key.indexOf(nsSeparator) > - 1) { + var parts = key.split(nsSeparator); + if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > - 1) namespaces = parts.shift(); + key = parts.join(keySeparator); + } + if (typeof namespaces === 'string') namespaces = [ + namespaces + ]; + return { + key: key, + namespaces: namespaces + }; + } + }, + { + key: 'translate', + value: function translate(keys, options) { + var _this2 = this; + if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) { + /* eslint prefer-rest-params: 0 */ + options = this.options.overloadTranslationOptionHandler(arguments); + } + if (!options) options = { + }; // non valid keys handling + if (keys === undefined || keys === null /* || keys === ''*/ + ) return ''; + if (!Array.isArray(keys)) keys = [ + String(keys) + ]; // separators + var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; // get namespace(s) + var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options), + key = _this$extractFromKey.key, + namespaces = _this$extractFromKey.namespaces; + var namespace = namespaces[namespaces.length - 1]; // return key on CIMode + var lng = options.lng || this.language; + var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; + if (lng && lng.toLowerCase() === 'cimode') { + if (appendNamespaceToCIMode) { + var nsSeparator = options.nsSeparator || this.options.nsSeparator; + return namespace + nsSeparator + key; + } + return key; + } // resolve from store + + var resolved = this.resolve(keys, options); + var res = resolved && resolved.res; + var resUsedKey = resolved && resolved.usedKey || key; + var resExactUsedKey = resolved && resolved.exactUsedKey || key; + var resType = Object.prototype.toString.apply(res); + var noObject = [ + '[object Number]', + '[object Function]', + '[object RegExp]' + ]; + var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; // object + var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject; + var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number'; + if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) { + if (!options.returnObjects && !this.options.returnObjects) { + this.logger.warn('accessing an object - but returnObjects options is not enabled!'); + return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, options) : 'key \''.concat(key, ' (').concat(this.language, ')\' returned an object instead of string.'); + } // if we got a separator we loop over children - else we just return object as is + // as having it set to false means no hierarchy so no lookup for nested values + + if (keySeparator) { + var resTypeIsArray = resType === '[object Array]'; + var copy$$1 = resTypeIsArray ? [ + ] : { + }; // apply child translation on a copy + /* eslint no-restricted-syntax: 0 */ + var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey; + for (var m in res) { + if (Object.prototype.hasOwnProperty.call(res, m)) { + var deepKey = ''.concat(newKeyToUse).concat(keySeparator).concat(m); + copy$$1[m] = this.translate(deepKey, _objectSpread({ + }, options, { + joinArrays: false, + ns: namespaces + })); + if (copy$$1[m] === deepKey) copy$$1[m] = res[m]; // if nothing found use orginal value as fallback + } + } + res = copy$$1; + } + } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') { + // array special treatment + res = res.join(joinArrays); + if (res) res = this.extendTranslation(res, keys, options); + } else { + // string, empty or null + var usedDefault = false; + var usedKey = false; // fallback value + if (!this.isValidLookup(res) && options.defaultValue !== undefined) { + usedDefault = true; + if (options.count !== undefined) { + var suffix = this.pluralResolver.getSuffix(lng, options.count); + res = options['defaultValue'.concat(suffix)]; + } + if (!res) res = options.defaultValue; + } + if (!this.isValidLookup(res)) { + usedKey = true; + res = key; + } // save missing + + var updateMissing = options.defaultValue && options.defaultValue !== res && this.options.updateMissing; + if (usedKey || usedDefault || updateMissing) { + this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? options.defaultValue : res); + var lngs = [ + ]; + var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); + if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) { + for (var i = 0; i < fallbackLngs.length; i++) { + lngs.push(fallbackLngs[i]); + } + } else if (this.options.saveMissingTo === 'all') { + lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); + } else { + lngs.push(options.lng || this.language); + } + var send = function send(l, k) { + if (_this2.options.missingKeyHandler) { + _this2.options.missingKeyHandler(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options); + } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) { + _this2.backendConnector.saveMissing(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options); + } + _this2.emit('missingKey', l, namespace, k, res); + }; + if (this.options.saveMissing) { + var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; + if (this.options.saveMissingPlurals && needsPluralHandling) { + lngs.forEach(function (l) { + var plurals = _this2.pluralResolver.getPluralFormsOfKey(l, key); + plurals.forEach(function (p) { + return send([l], p); + }); + }); + } else { + send(lngs, key); + } + } + } // extend + + res = this.extendTranslation(res, keys, options, resolved); // append namespace if still key + if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = ''.concat(namespace, ':').concat(key); // parseMissingKeyHandler + if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res); + } // return + + return res; + } + }, + { + key: 'extendTranslation', + value: function extendTranslation(res, key, options, resolved) { + var _this3 = this; + if (this.i18nFormat && this.i18nFormat.parse) { + res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, { + resolved: resolved + }); + } else if (!options.skipInterpolation) { + // i18next.parsing + if (options.interpolation) this.interpolator.init(_objectSpread({ + }, options, { + interpolation: _objectSpread({ + }, this.options.interpolation, options.interpolation) + })); // interpolate + var data = options.replace && typeof options.replace !== 'string' ? options.replace : options; + if (this.options.interpolation.defaultVariables) data = _objectSpread({ + }, this.options.interpolation.defaultVariables, data); + res = this.interpolator.interpolate(res, data, options.lng || this.language, options); // nesting + if (options.nest !== false) res = this.interpolator.nest(res, function () { + return _this3.translate.apply(_this3, arguments); + }, options); + if (options.interpolation) this.interpolator.reset(); + } // post process + + var postProcess = options.postProcess || this.options.postProcess; + var postProcessorNames = typeof postProcess === 'string' ? [ + postProcess + ] : postProcess; + if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { + res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread({ + i18nResolved: resolved + }, options) : options, this); + } + return res; + } + }, + { + key: 'resolve', + value: function resolve(keys) { + var _this4 = this; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + var found; + var usedKey; // plain key + var exactUsedKey; // key with context / plural + var usedLng; + var usedNS; + if (typeof keys === 'string') keys = [ + keys + ]; // forEach possible key + keys.forEach(function (k) { + if (_this4.isValidLookup(found)) return; + var extracted = _this4.extractFromKey(k, options); + var key = extracted.key; + usedKey = key; + var namespaces = extracted.namespaces; + if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS); + var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string'; + var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== ''; + var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng); + namespaces.forEach(function (ns) { + if (_this4.isValidLookup(found)) return; + usedNS = ns; + if (!checkedLoadedFor[''.concat(codes[0], '-').concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) { + checkedLoadedFor[''.concat(codes[0], '-').concat(ns)] = true; + _this4.logger.warn('key "'.concat(usedKey, '" for namespace "').concat(usedNS, '" for languages "').concat(codes.join(', '), '" won\'t get resolved as namespace was not yet loaded'), 'This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!'); + } + codes.forEach(function (code) { + if (_this4.isValidLookup(found)) return; + usedLng = code; + var finalKey = key; + var finalKeys = [ + finalKey + ]; + if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) { + _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options); + } else { + var pluralSuffix; + if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count); // fallback for plural if context not found + if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); // get key for context if needed + if (needsContextHandling) finalKeys.push(finalKey += ''.concat(_this4.options.contextSeparator).concat(options.context)); // get key for plural if needed + if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix); + } // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only + + var possibleKey; + /* eslint no-cond-assign: 0 */ + while (possibleKey = finalKeys.pop()) { + if (!_this4.isValidLookup(found)) { + exactUsedKey = possibleKey; + found = _this4.getResource(code, ns, possibleKey, options); + } + } + }); + }); + }); + return { + res: found, + usedKey: usedKey, + exactUsedKey: exactUsedKey, + usedLng: usedLng, + usedNS: usedNS + }; + } + }, + { + key: 'isValidLookup', + value: function isValidLookup(res) { + return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ''); + } + }, + { + key: 'getResource', + value: function getResource(code, ns, key) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { + }; + if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options); + return this.resourceStore.getResource(code, ns, key, options); + } + } + ]); + return Translator; + }(EventEmitter); + function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + } + var LanguageUtil = /*#__PURE__*/ + function () { + function LanguageUtil(options) { + _classCallCheck(this, LanguageUtil); + this.options = options; + this.whitelist = this.options.whitelist || false; + this.logger = baseLogger.create('languageUtils'); + } + _createClass(LanguageUtil, [ + { + key: 'getScriptPartFromCode', + value: function getScriptPartFromCode(code) { + if (!code || code.indexOf('-') < 0) return null; + var p = code.split('-'); + if (p.length === 2) return null; + p.pop(); + return this.formatLanguageCode(p.join('-')); + } + }, + { + key: 'getLanguagePartFromCode', + value: function getLanguagePartFromCode(code) { + if (!code || code.indexOf('-') < 0) return code; + var p = code.split('-'); + return this.formatLanguageCode(p[0]); + } + }, + { + key: 'formatLanguageCode', + value: function formatLanguageCode(code) { + // http://www.iana.org/assignments/language-tags/language-tags.xhtml + if (typeof code === 'string' && code.indexOf('-') > - 1) { + var specialCases = [ + 'hans', + 'hant', + 'latn', + 'cyrl', + 'cans', + 'mong', + 'arab' + ]; + var p = code.split('-'); + if (this.options.lowerCaseLng) { + p = p.map(function (part) { + return part.toLowerCase(); + }); + } else if (p.length === 2) { + p[0] = p[0].toLowerCase(); + p[1] = p[1].toUpperCase(); + if (specialCases.indexOf(p[1].toLowerCase()) > - 1) p[1] = capitalize(p[1].toLowerCase()); + } else if (p.length === 3) { + p[0] = p[0].toLowerCase(); // if lenght 2 guess it's a country + if (p[1].length === 2) p[1] = p[1].toUpperCase(); + if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase(); + if (specialCases.indexOf(p[1].toLowerCase()) > - 1) p[1] = capitalize(p[1].toLowerCase()); + if (specialCases.indexOf(p[2].toLowerCase()) > - 1) p[2] = capitalize(p[2].toLowerCase()); + } + return p.join('-'); + } + return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; + } + }, + { + key: 'isWhitelisted', + value: function isWhitelisted(code) { + if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) { + code = this.getLanguagePartFromCode(code); + } + return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > - 1; + } + }, + { + key: 'getFallbackCodes', + value: function getFallbackCodes(fallbacks, code) { + if (!fallbacks) return []; + if (typeof fallbacks === 'string') fallbacks = [ + fallbacks + ]; + if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks; + if (!code) return fallbacks['default'] || [ + ]; // asume we have an object defining fallbacks + var found = fallbacks[code]; + if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; + if (!found) found = fallbacks[this.formatLanguageCode(code)]; + if (!found) found = fallbacks['default']; + return found || [ + ]; + } + }, + { + key: 'toResolveHierarchy', + value: function toResolveHierarchy(code, fallbackCode) { + var _this = this; + var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [ + ], code); + var codes = [ + ]; + var addCode = function addCode(c) { + if (!c) return; + if (_this.isWhitelisted(c)) { + codes.push(c); + } else { + _this.logger.warn('rejecting non-whitelisted language code: '.concat(c)); + } + }; + if (typeof code === 'string' && code.indexOf('-') > - 1) { + if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code)); + if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code)); + if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code)); + } else if (typeof code === 'string') { + addCode(this.formatLanguageCode(code)); + } + fallbackCodes.forEach(function (fc) { + if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc)); + }); + return codes; + } + } + ]); + return LanguageUtil; + }(); + /* eslint-disable */ + var sets = [ + { + lngs: [ + 'ach', + 'ak', + 'am', + 'arn', + 'br', + 'fil', + 'gun', + 'ln', + 'mfe', + 'mg', + 'mi', + 'oc', + 'pt', + 'pt-BR', + 'tg', + 'ti', + 'tr', + 'uz', + 'wa' + ], + nr: [ + 1, + 2 + ], + fc: 1 + }, + { + lngs: [ + 'af', + 'an', + 'ast', + 'az', + 'bg', + 'bn', + 'ca', + 'da', + 'de', + 'dev', + 'el', + 'en', + 'eo', + 'es', + 'et', + 'eu', + 'fi', + 'fo', + 'fur', + 'fy', + 'gl', + 'gu', + 'ha', + 'hi', + 'hu', + 'hy', + 'ia', + 'it', + 'kn', + 'ku', + 'lb', + 'mai', + 'ml', + 'mn', + 'mr', + 'nah', + 'nap', + 'nb', + 'ne', + 'nl', + 'nn', + 'no', + 'nso', + 'pa', + 'pap', + 'pms', + 'ps', + 'pt-PT', + 'rm', + 'sco', + 'se', + 'si', + 'so', + 'son', + 'sq', + 'sv', + 'sw', + 'ta', + 'te', + 'tk', + 'ur', + 'yo' + ], + nr: [ + 1, + 2 + ], + fc: 2 + }, + { + lngs: [ + 'ay', + 'bo', + 'cgg', + 'fa', + 'id', + 'ja', + 'jbo', + 'ka', + 'kk', + 'km', + 'ko', + 'ky', + 'lo', + 'ms', + 'sah', + 'su', + 'th', + 'tt', + 'ug', + 'vi', + 'wo', + 'zh' + ], + nr: [ + 1 + ], + fc: 3 + }, + { + lngs: [ + 'be', + 'bs', + 'cnr', + 'dz', + 'hr', + 'ru', + 'sr', + 'uk' + ], + nr: [ + 1, + 2, + 5 + ], + fc: 4 + }, + { + lngs: [ + 'ar' + ], + nr: [ + 0, + 1, + 2, + 3, + 11, + 100 + ], + fc: 5 + }, + { + lngs: [ + 'cs', + 'sk' + ], + nr: [ + 1, + 2, + 5 + ], + fc: 6 + }, + { + lngs: [ + 'csb', + 'pl' + ], + nr: [ + 1, + 2, + 5 + ], + fc: 7 + }, + { + lngs: [ + 'cy' + ], + nr: [ + 1, + 2, + 3, + 8 + ], + fc: 8 + }, + { + lngs: [ + 'fr' + ], + nr: [ + 1, + 2 + ], + fc: 9 + }, + { + lngs: [ + 'ga' + ], + nr: [ + 1, + 2, + 3, + 7, + 11 + ], + fc: 10 + }, + { + lngs: [ + 'gd' + ], + nr: [ + 1, + 2, + 3, + 20 + ], + fc: 11 + }, + { + lngs: [ + 'is' + ], + nr: [ + 1, + 2 + ], + fc: 12 + }, + { + lngs: [ + 'jv' + ], + nr: [ + 0, + 1 + ], + fc: 13 + }, + { + lngs: [ + 'kw' + ], + nr: [ + 1, + 2, + 3, + 4 + ], + fc: 14 + }, + { + lngs: [ + 'lt' + ], + nr: [ + 1, + 2, + 10 + ], + fc: 15 + }, + { + lngs: [ + 'lv' + ], + nr: [ + 1, + 2, + 0 + ], + fc: 16 + }, + { + lngs: [ + 'mk' + ], + nr: [ + 1, + 2 + ], + fc: 17 + }, + { + lngs: [ + 'mnk' + ], + nr: [ + 0, + 1, + 2 + ], + fc: 18 + }, + { + lngs: [ + 'mt' + ], + nr: [ + 1, + 2, + 11, + 20 + ], + fc: 19 + }, + { + lngs: [ + 'or' + ], + nr: [ + 2, + 1 + ], + fc: 2 + }, + { + lngs: [ + 'ro' + ], + nr: [ + 1, + 2, + 20 + ], + fc: 20 + }, + { + lngs: [ + 'sl' + ], + nr: [ + 5, + 1, + 2, + 3 + ], + fc: 21 + }, + { + lngs: [ + 'he' + ], + nr: [ + 1, + 2, + 20, + 21 + ], + fc: 22 + } + ]; + var _rulesPluralsTypes = { + 1: function _(n) { + return Number(n > 1); + }, + 2: function _(n) { + return Number(n != 1); + }, + 3: function _(n) { + return 0; + }, + 4: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 5: function _(n) { + return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); + }, + 6: function _(n) { + return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); + }, + 7: function _(n) { + return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 8: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); + }, + 9: function _(n) { + return Number(n >= 2); + }, + 10: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); + }, + 11: function _(n) { + return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); + }, + 12: function _(n) { + return Number(n % 10 != 1 || n % 100 == 11); + }, + 13: function _(n) { + return Number(n !== 0); + }, + 14: function _(n) { + return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); + }, + 15: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); + }, + 16: function _(n) { + return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); + }, + 17: function _(n) { + return Number(n == 1 || n % 10 == 1 ? 0 : 1); + }, + 18: function _(n) { + return Number(n == 0 ? 0 : n == 1 ? 1 : 2); + }, + 19: function _(n) { + return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); + }, + 20: function _(n) { + return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); + }, + 21: function _(n) { + return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); + }, + 22: function _(n) { + return Number(n === 1 ? 0 : n === 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3); + } + }; + /* eslint-enable */ + function createRules() { + var rules = { + }; + sets.forEach(function (set) { + set.lngs.forEach(function (l) { + rules[l] = { + numbers: set.nr, + plurals: _rulesPluralsTypes[set.fc] + }; + }); + }); + return rules; + } + var PluralResolver = /*#__PURE__*/ + function () { + function PluralResolver(languageUtils) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + _classCallCheck(this, PluralResolver); + this.languageUtils = languageUtils; + this.options = options; + this.logger = baseLogger.create('pluralResolver'); + this.rules = createRules(); + } + _createClass(PluralResolver, [ + { + key: 'addRule', + value: function addRule(lng, obj) { + this.rules[lng] = obj; + } + }, + { + key: 'getRule', + value: function getRule(code) { + return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)]; + } + }, + { + key: 'needsPlural', + value: function needsPlural(code) { + var rule = this.getRule(code); + return rule && rule.numbers.length > 1; + } + }, + { + key: 'getPluralFormsOfKey', + value: function getPluralFormsOfKey(code, key) { + var _this = this; + var ret = [ + ]; + var rule = this.getRule(code); + if (!rule) return ret; + rule.numbers.forEach(function (n) { + var suffix = _this.getSuffix(code, n); + ret.push(''.concat(key).concat(suffix)); + }); + return ret; + } + }, + { + key: 'getSuffix', + value: function getSuffix(code, count) { + var _this2 = this; + var rule = this.getRule(code); + if (rule) { + // if (rule.numbers.length === 1) return ''; // only singular + var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); + var suffix = rule.numbers[idx]; // special treatment for lngs only having singular and plural + if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { + if (suffix === 2) { + suffix = 'plural'; + } else if (suffix === 1) { + suffix = ''; + } + } + var returnSuffix = function returnSuffix() { + return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString(); + }; // COMPATIBILITY JSON + // v1 + if (this.options.compatibilityJSON === 'v1') { + if (suffix === 1) return ''; + if (typeof suffix === 'number') return '_plural_'.concat(suffix.toString()); + return returnSuffix(); + } else if ( /* v2 */ + this.options.compatibilityJSON === 'v2') { + return returnSuffix(); + } else if ( /* v3 - gettext index */ + this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { + return returnSuffix(); + } + return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); + } + this.logger.warn('no plural rule found for: '.concat(code)); + return ''; + } + } + ]); + return PluralResolver; + }(); + var Interpolator = /*#__PURE__*/ + function () { + function Interpolator() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + _classCallCheck(this, Interpolator); + this.logger = baseLogger.create('interpolator'); + this.options = options; + this.format = options.interpolation && options.interpolation.format || function (value) { + return value; + }; + this.init(options); + } /* eslint no-param-reassign: 0 */ + + _createClass(Interpolator, [ + { + key: 'init', + value: function init() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + if (!options.interpolation) options.interpolation = { + escapeValue: true + }; + var iOpts = options.interpolation; + this.escape = iOpts.escape !== undefined ? iOpts.escape : escape; + this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true; + this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false; + this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{'; + this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}'; + this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ','; + this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-'; + this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || ''; + this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t('); + this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')'); + this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000; // the regexp + this.resetRegExp(); + } + }, + { + key: 'reset', + value: function reset() { + if (this.options) this.init(this.options); + } + }, + { + key: 'resetRegExp', + value: function resetRegExp() { + // the regexp + var regexpStr = ''.concat(this.prefix, '(.+?)').concat(this.suffix); + this.regexp = new RegExp(regexpStr, 'g'); + var regexpUnescapeStr = ''.concat(this.prefix).concat(this.unescapePrefix, '(.+?)').concat(this.unescapeSuffix).concat(this.suffix); + this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g'); + var nestingRegexpStr = ''.concat(this.nestingPrefix, '(.+?)').concat(this.nestingSuffix); + this.nestingRegexp = new RegExp(nestingRegexpStr, 'g'); + } + }, + { + key: 'interpolate', + value: function interpolate(str, data, lng, options) { + var _this = this; + var match; + var value; + var replaces; + var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || { + }; + function regexSafe(val) { + return val.replace(/\$/g, '$$$$'); + } + var handleFormat = function handleFormat(key) { + if (key.indexOf(_this.formatSeparator) < 0) { + return getPathWithDefaults(data, defaultData, key); + } + var p = key.split(_this.formatSeparator); + var k = p.shift().trim(); + var f = p.join(_this.formatSeparator).trim(); + return _this.format(getPathWithDefaults(data, defaultData, k), f, lng); + }; + this.resetRegExp(); + var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler; + replaces = 0; // unescape if has unescapePrefix/Suffix + /* eslint no-cond-assign: 0 */ + while (match = this.regexpUnescape.exec(str)) { + value = handleFormat(match[1].trim()); + if (value === undefined) { + if (typeof missingInterpolationHandler === 'function') { + var temp = missingInterpolationHandler(str, match, options); + value = typeof temp === 'string' ? temp : ''; + } else { + this.logger.warn('missed to pass in variable '.concat(match[1], ' for interpolating ').concat(str)); + value = ''; + } + } else if (typeof value !== 'string' && !this.useRawValueToEscape) { + value = makeString(value); + } + str = str.replace(match[0], regexSafe(value)); + this.regexpUnescape.lastIndex = 0; + replaces++; + if (replaces >= this.maxReplaces) { + break; + } + } + replaces = 0; // regular escape on demand + while (match = this.regexp.exec(str)) { + value = handleFormat(match[1].trim()); + if (value === undefined) { + if (typeof missingInterpolationHandler === 'function') { + var _temp = missingInterpolationHandler(str, match, options); + value = typeof _temp === 'string' ? _temp : ''; + } else { + this.logger.warn('missed to pass in variable '.concat(match[1], ' for interpolating ').concat(str)); + value = ''; + } + } else if (typeof value !== 'string' && !this.useRawValueToEscape) { + value = makeString(value); + } + value = this.escapeValue ? regexSafe(this.escape(value)) : regexSafe(value); + str = str.replace(match[0], value); + this.regexp.lastIndex = 0; + replaces++; + if (replaces >= this.maxReplaces) { + break; + } + } + return str; + } + }, + { + key: 'nest', + value: function nest(str, fc) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { + }; + var match; + var value; + var clonedOptions = _objectSpread({ + }, options); + clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup + delete clonedOptions.defaultValue; // assert we do not get a endless loop on interpolating defaultValue again and again + // if value is something like "myKey": "lorem $(anotherKey, { "count": {{aValueInOptions}} })" + function handleHasOptions(key, inheritedOptions) { + if (key.indexOf(',') < 0) return key; + var p = key.split(','); + key = p.shift(); + var optionsString = p.join(','); + optionsString = this.interpolate(optionsString, clonedOptions); + optionsString = optionsString.replace(/'/g, '"'); + try { + clonedOptions = JSON.parse(optionsString); + if (inheritedOptions) clonedOptions = _objectSpread({ + }, inheritedOptions, clonedOptions); + } catch (e) { + this.logger.error('failed parsing options string in nesting for key '.concat(key), e); + } // assert we do not get a endless loop on interpolating defaultValue again and again + + delete clonedOptions.defaultValue; + return key; + } // regular escape on demand + + while (match = this.nestingRegexp.exec(str)) { + value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions); // is only the nesting key (key1 = '$(key2)') return the value without stringify + if (value && match[0] === str && typeof value !== 'string') return value; // no string to include or empty + if (typeof value !== 'string') value = makeString(value); + if (!value) { + this.logger.warn('missed to resolve '.concat(match[1], ' for nesting ').concat(str)); + value = ''; + } // Nested keys should not be escaped by default #854 + // value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value); + + str = str.replace(match[0], value); + this.regexp.lastIndex = 0; + } + return str; + } + } + ]); + return Interpolator; + }(); + function remove(arr, what) { + var found = arr.indexOf(what); + while (found !== - 1) { + arr.splice(found, 1); + found = arr.indexOf(what); + } + } + var Connector = /*#__PURE__*/ + function (_EventEmitter) { + _inherits(Connector, _EventEmitter); + function Connector(backend, store, services) { + var _this; + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { + }; + _classCallCheck(this, Connector); + _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this)); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + _this.backend = backend; + _this.store = store; + _this.services = services; + _this.languageUtils = services.languageUtils; + _this.options = options; + _this.logger = baseLogger.create('backendConnector'); + _this.state = { + }; + _this.queue = [ + ]; + if (_this.backend && _this.backend.init) { + _this.backend.init(services, options.backend, options); + } + return _this; + } + _createClass(Connector, [ + { + key: 'queueLoad', + value: function queueLoad(languages, namespaces, options, callback) { + var _this2 = this; + // find what needs to be loaded + var toLoad = [ + ]; + var pending = [ + ]; + var toLoadLanguages = [ + ]; + var toLoadNamespaces = [ + ]; + languages.forEach(function (lng) { + var hasAllNamespaces = true; + namespaces.forEach(function (ns) { + var name = ''.concat(lng, '|').concat(ns); + if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) { + _this2.state[name] = 2; // loaded + } else if (_this2.state[name] < 0); + else if (_this2.state[name] === 1) { + if (pending.indexOf(name) < 0) pending.push(name); + } else { + _this2.state[name] = 1; // pending + hasAllNamespaces = false; + if (pending.indexOf(name) < 0) pending.push(name); + if (toLoad.indexOf(name) < 0) toLoad.push(name); + if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns); + } + }); + if (!hasAllNamespaces) toLoadLanguages.push(lng); + }); + if (toLoad.length || pending.length) { + this.queue.push({ + pending: pending, + loaded: { + }, + errors: [ + ], + callback: callback + }); + } + return { + toLoad: toLoad, + pending: pending, + toLoadLanguages: toLoadLanguages, + toLoadNamespaces: toLoadNamespaces + }; + } + }, + { + key: 'loaded', + value: function loaded(name, err, data) { + var _name$split = name.split('|'), + _name$split2 = _slicedToArray(_name$split, 2), + lng = _name$split2[0], + ns = _name$split2[1]; + if (err) this.emit('failedLoading', lng, ns, err); + if (data) { + this.store.addResourceBundle(lng, ns, data); + } // set loaded + + this.state[name] = err ? - 1 : 2; // consolidated loading done in this run - only emit once for a loaded namespace + var loaded = { + }; // callback if ready + this.queue.forEach(function (q) { + pushPath(q.loaded, [ + lng + ], ns); + remove(q.pending, name); + if (err) q.errors.push(err); + if (q.pending.length === 0 && !q.done) { + // only do once per loaded -> this.emit('loaded', q.loaded); + Object.keys(q.loaded).forEach(function (l) { + if (!loaded[l]) loaded[l] = [ + ]; + if (q.loaded[l].length) { + q.loaded[l].forEach(function (ns) { + if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns); + }); + } + }); + /* eslint no-param-reassign: 0 */ + q.done = true; + if (q.errors.length) { + q.callback(q.errors); + } else { + q.callback(); + } + } + }); // emit consolidated loaded event + this.emit('loaded', loaded); // remove done load requests + this.queue = this.queue.filter(function (q) { + return !q.done; + }); + } + }, + { + key: 'read', + value: function read(lng, ns, fcName) { + var _this3 = this; + var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 250; + var callback = arguments.length > 5 ? arguments[5] : undefined; + if (!lng.length) return callback(null, { + }); // noting to load + return this.backend[fcName](lng, ns, function (err, data) { + if (err && data /* = retryFlag */ && tried < 5) { + setTimeout(function () { + _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback); + }, wait); + return; + } + callback(err, data); + }); + } /* eslint consistent-return: 0 */ + + }, + { + key: 'prepareLoading', + value: function prepareLoading(languages, namespaces) { + var _this4 = this; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { + }; + var callback = arguments.length > 3 ? arguments[3] : undefined; + if (!this.backend) { + this.logger.warn('No backend was added via i18next.use. Will not load resources.'); + return callback && callback(); + } + if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages); + if (typeof namespaces === 'string') namespaces = [ + namespaces + ]; + var toLoad = this.queueLoad(languages, namespaces, options, callback); + if (!toLoad.toLoad.length) { + if (!toLoad.pending.length) callback(); // nothing to load and no pendings...callback now + return null; // pendings will trigger callback + } + toLoad.toLoad.forEach(function (name) { + _this4.loadOne(name); + }); + } + }, + { + key: 'load', + value: function load(languages, namespaces, callback) { + this.prepareLoading(languages, namespaces, { + }, callback); + } + }, + { + key: 'reload', + value: function reload(languages, namespaces, callback) { + this.prepareLoading(languages, namespaces, { + reload: true + }, callback); + } + }, + { + key: 'loadOne', + value: function loadOne(name) { + var _this5 = this; + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var _name$split3 = name.split('|'), + _name$split4 = _slicedToArray(_name$split3, 2), + lng = _name$split4[0], + ns = _name$split4[1]; + this.read(lng, ns, 'read', null, null, function (err, data) { + if (err) _this5.logger.warn(''.concat(prefix, 'loading namespace ').concat(ns, ' for language ').concat(lng, ' failed'), err); + if (!err && data) _this5.logger.log(''.concat(prefix, 'loaded namespace ').concat(ns, ' for language ').concat(lng), data); + _this5.loaded(name, err, data); + }); + } + }, + { + key: 'saveMissing', + value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) { + var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { + }; + if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) { + this.logger.warn('did not save key "'.concat(key, '" for namespace "').concat(namespace, '" as the namespace was not yet loaded'), 'This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!'); + return; + } // ignore non valid keys + + if (key === undefined || key === null || key === '') return; + if (this.backend && this.backend.create) { + this.backend.create(languages, namespace, key, fallbackValue, null /* unused callback */ , _objectSpread({ + }, options, { + isUpdate: isUpdate + })); + } // write to store to avoid resending + + if (!languages || !languages[0]) return; + this.store.addResource(languages[0], namespace, key, fallbackValue); + } + } + ]); + return Connector; + }(EventEmitter); + function get() { + return { + debug: false, + initImmediate: true, + ns: [ + 'translation' + ], + defaultNS: [ + 'translation' + ], + fallbackLng: [ + 'dev' + ], + fallbackNS: false, + // string or array of namespaces + whitelist: false, + // array with whitelisted languages + nonExplicitWhitelist: false, + load: 'all', + // | currentOnly | languageOnly + preload: false, + // array with preload languages + simplifyPluralSuffix: true, + keySeparator: '.', + nsSeparator: ':', + pluralSeparator: '_', + contextSeparator: '_', + partialBundledLanguages: false, + // allow bundling certain languages that are not remotely fetched + saveMissing: false, + // enable to send missing values + updateMissing: false, + // enable to update default values if different from translated value (only useful on initial development, or when keeping code as source of truth) + saveMissingTo: 'fallback', + // 'current' || 'all' + saveMissingPlurals: true, + // will save all forms not only singular key + missingKeyHandler: false, + // function(lng, ns, key, fallbackValue) -> override if prefer on handling + missingInterpolationHandler: false, + // function(str, match) + postProcess: false, + // string or array of postProcessor names + postProcessPassResolved: false, + // pass resolved object into 'options.i18nResolved' for postprocessor + returnNull: true, + // allows null value as valid translation + returnEmptyString: true, + // allows empty string value as valid translation + returnObjects: false, + joinArrays: false, + // or string to join array + returnedObjectHandler: false, + // function(key, value, options) triggered if key returns object but returnObjects is set to false + parseMissingKeyHandler: false, + // function(key) parsed a key that was not found in t() before returning + appendNamespaceToMissingKey: false, + appendNamespaceToCIMode: false, + overloadTranslationOptionHandler: function handle(args) { + var ret = { + }; + if (_typeof(args[1]) === 'object') ret = args[1]; + if (typeof args[1] === 'string') ret.defaultValue = args[1]; + if (typeof args[2] === 'string') ret.tDescription = args[2]; + if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') { + var options = args[3] || args[2]; + Object.keys(options).forEach(function (key) { + ret[key] = options[key]; + }); + } + return ret; + }, + interpolation: { + escapeValue: true, + format: function format(value, _format, lng) { + return value; + }, + prefix: '{{', + suffix: '}}', + formatSeparator: ',', + // prefixEscaped: '{{', + // suffixEscaped: '}}', + // unescapeSuffix: '', + unescapePrefix: '-', + nestingPrefix: '$t(', + nestingSuffix: ')', + // nestingPrefixEscaped: '$t(', + // nestingSuffixEscaped: ')', + // defaultVariables: undefined // object that can have values to interpolate on - extends passed in interpolation data + maxReplaces: 1000 // max replaces to prevent endless loop + } + }; + } /* eslint no-param-reassign: 0 */ + + function transformOptions(options) { + // create namespace object if namespace is passed in as string + if (typeof options.ns === 'string') options.ns = [ + options.ns + ]; + if (typeof options.fallbackLng === 'string') options.fallbackLng = [ + options.fallbackLng + ]; + if (typeof options.fallbackNS === 'string') options.fallbackNS = [ + options.fallbackNS + ]; // extend whitelist with cimode + if (options.whitelist && options.whitelist.indexOf('cimode') < 0) { + options.whitelist = options.whitelist.concat(['cimode']); + } + return options; + } + function noop() { + } + var I18n = /*#__PURE__*/ + function (_EventEmitter) { + _inherits(I18n, _EventEmitter); + function I18n() { + var _this; + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + var callback = arguments.length > 1 ? arguments[1] : undefined; + _classCallCheck(this, I18n); + _this = _possibleConstructorReturn(this, _getPrototypeOf(I18n).call(this)); + EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) + _this.options = transformOptions(options); + _this.services = { + }; + _this.logger = baseLogger; + _this.modules = { + external: [ + ] + }; + if (callback && !_this.isInitialized && !options.isClone) { + // https://github.com/i18next/i18next/issues/879 + if (!_this.options.initImmediate) { + _this.init(options, callback); + return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); + } + setTimeout(function () { + _this.init(options, callback); + }, 0); + } + return _this; + } + _createClass(I18n, [ + { + key: 'init', + value: function init() { + var _this2 = this; + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + var callback = arguments.length > 1 ? arguments[1] : undefined; + if (typeof options === 'function') { + callback = options; + options = { + }; + } + this.options = _objectSpread({ + }, get(), this.options, transformOptions(options)); + this.format = this.options.interpolation.format; + if (!callback) callback = noop; + function createClassOnDemand(ClassOrObject) { + if (!ClassOrObject) return null; + if (typeof ClassOrObject === 'function') return new ClassOrObject(); + return ClassOrObject; + } // init services + + if (!this.options.isClone) { + if (this.modules.logger) { + baseLogger.init(createClassOnDemand(this.modules.logger), this.options); + } else { + baseLogger.init(null, this.options); + } + var lu = new LanguageUtil(this.options); + this.store = new ResourceStore(this.options.resources, this.options); + var s = this.services; + s.logger = baseLogger; + s.resourceStore = this.store; + s.languageUtils = lu; + s.pluralResolver = new PluralResolver(lu, { + prepend: this.options.pluralSeparator, + compatibilityJSON: this.options.compatibilityJSON, + simplifyPluralSuffix: this.options.simplifyPluralSuffix + }); + s.interpolator = new Interpolator(this.options); + s.utils = { + hasLoadedNamespace: this.hasLoadedNamespace.bind(this) + }; + s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options); // pipe events from backendConnector + s.backendConnector.on('*', function (event) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + _this2.emit.apply(_this2, [ + event + ].concat(args)); + }); + if (this.modules.languageDetector) { + s.languageDetector = createClassOnDemand(this.modules.languageDetector); + s.languageDetector.init(s, this.options.detection, this.options); + } + if (this.modules.i18nFormat) { + s.i18nFormat = createClassOnDemand(this.modules.i18nFormat); + if (s.i18nFormat.init) s.i18nFormat.init(this); + } + this.translator = new Translator(this.services, this.options); // pipe events from translator + this.translator.on('*', function (event) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + _this2.emit.apply(_this2, [ + event + ].concat(args)); + }); + this.modules.external.forEach(function (m) { + if (m.init) m.init(_this2); + }); + } // append api + + var storeApi = [ + 'getResource', + 'addResource', + 'addResources', + 'addResourceBundle', + 'removeResourceBundle', + 'hasResourceBundle', + 'getResourceBundle', + 'getDataByLanguage' + ]; + storeApi.forEach(function (fcName) { + _this2[fcName] = function () { + var _this2$store; + return (_this2$store = _this2.store) [fcName].apply(_this2$store, arguments); + }; + }); + var deferred = defer(); + var load = function load() { + _this2.changeLanguage(_this2.options.lng, function (err, t) { + _this2.isInitialized = true; + _this2.logger.log('initialized', _this2.options); + _this2.emit('initialized', _this2.options); + deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning) + callback(err, t); + }); + }; + if (this.options.resources || !this.options.initImmediate) { + load(); + } else { + setTimeout(load, 0); + } + return deferred; + } /* eslint consistent-return: 0 */ + + }, + { + key: 'loadResources', + value: function loadResources(language) { + var _this3 = this; + var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop; + var usedCallback = callback; + var usedLng = typeof language === 'string' ? language : this.language; + if (typeof language === 'function') usedCallback = language; + if (!this.options.resources || this.options.partialBundledLanguages) { + if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback(); // avoid loading resources for cimode + var toLoad = [ + ]; + var append = function append(lng) { + if (!lng) return; + var lngs = _this3.services.languageUtils.toResolveHierarchy(lng); + lngs.forEach(function (l) { + if (toLoad.indexOf(l) < 0) toLoad.push(l); + }); + }; + if (!usedLng) { + // at least load fallbacks in this case + var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); + fallbacks.forEach(function (l) { + return append(l); + }); + } else { + append(usedLng); + } + if (this.options.preload) { + this.options.preload.forEach(function (l) { + return append(l); + }); + } + this.services.backendConnector.load(toLoad, this.options.ns, usedCallback); + } else { + usedCallback(null); + } + } + }, + { + key: 'reloadResources', + value: function reloadResources(lngs, ns, callback) { + var deferred = defer(); + if (!lngs) lngs = this.languages; + if (!ns) ns = this.options.ns; + if (!callback) callback = noop; + this.services.backendConnector.reload(lngs, ns, function (err) { + deferred.resolve(); // not rejecting on err (as err is only a loading translation failed warning) + callback(err); + }); + return deferred; + } + }, + { + key: 'use', + value: function use(module) { + if (module.type === 'backend') { + this.modules.backend = module; + } + if (module.type === 'logger' || module.log && module.warn && module.error) { + this.modules.logger = module; + } + if (module.type === 'languageDetector') { + this.modules.languageDetector = module; + } + if (module.type === 'i18nFormat') { + this.modules.i18nFormat = module; + } + if (module.type === 'postProcessor') { + postProcessor.addPostProcessor(module); + } + if (module.type === '3rdParty') { + this.modules.external.push(module); + } + return this; + } + }, + { + key: 'changeLanguage', + value: function changeLanguage(lng, callback) { + var _this4 = this; + this.isLanguageChangingTo = lng; + var deferred = defer(); + this.emit('languageChanging', lng); + var done = function done(err, l) { + if (l) { + _this4.language = l; + _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l); + _this4.translator.changeLanguage(l); + _this4.isLanguageChangingTo = undefined; + _this4.emit('languageChanged', l); + _this4.logger.log('languageChanged', l); + } else { + _this4.isLanguageChangingTo = undefined; + } + deferred.resolve(function () { + return _this4.t.apply(_this4, arguments); + }); + if (callback) callback(err, function () { + return _this4.t.apply(_this4, arguments); + }); + }; + var setLng = function setLng(l) { + if (l) { + if (!_this4.language) { + _this4.language = l; + _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l); + } + if (!_this4.translator.language) _this4.translator.changeLanguage(l); + if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l); + } + _this4.loadResources(l, function (err) { + done(err, l); + }); + }; + if (!lng && this.services.languageDetector && !this.services.languageDetector.async) { + setLng(this.services.languageDetector.detect()); + } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) { + this.services.languageDetector.detect(setLng); + } else { + setLng(lng); + } + return deferred; + } + }, + { + key: 'getFixedT', + value: function getFixedT(lng, ns) { + var _this5 = this; + var fixedT = function fixedT(key, opts) { + var options; + if (_typeof(opts) !== 'object') { + for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { + rest[_key3 - 2] = arguments[_key3]; + } + options = _this5.options.overloadTranslationOptionHandler([key, + opts].concat(rest)); + } else { + options = _objectSpread({ + }, opts); + } + options.lng = options.lng || fixedT.lng; + options.lngs = options.lngs || fixedT.lngs; + options.ns = options.ns || fixedT.ns; + return _this5.t(key, options); + }; + if (typeof lng === 'string') { + fixedT.lng = lng; + } else { + fixedT.lngs = lng; + } + fixedT.ns = ns; + return fixedT; + } + }, + { + key: 't', + value: function t() { + var _this$translator; + return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments); + } + }, + { + key: 'exists', + value: function exists() { + var _this$translator2; + return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments); + } + }, + { + key: 'setDefaultNamespace', + value: function setDefaultNamespace(ns) { + this.options.defaultNS = ns; + } + }, + { + key: 'hasLoadedNamespace', + value: function hasLoadedNamespace(ns) { + var _this6 = this; + if (!this.isInitialized) { + this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages); + return false; + } + if (!this.languages || !this.languages.length) { + this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages); + return false; + } + var lng = this.languages[0]; + var fallbackLng = this.options ? this.options.fallbackLng : false; + var lastLng = this.languages[this.languages.length - 1]; // we're in cimode so this shall pass + if (lng.toLowerCase() === 'cimode') return true; + var loadNotPending = function loadNotPending(l, n) { + var loadState = _this6.services.backendConnector.state[''.concat(l, '|').concat(n)]; + return loadState === - 1 || loadState === 2; + }; // loaded -> SUCCESS + if (this.hasResourceBundle(lng, ns)) return true; // were not loading at all -> SEMI SUCCESS + if (!this.services.backendConnector.backend) return true; // failed loading ns - but at least fallback is not pending -> SEMI SUCCESS + if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; + return false; + } + }, + { + key: 'loadNamespaces', + value: function loadNamespaces(ns, callback) { + var _this7 = this; + var deferred = defer(); + if (!this.options.ns) { + callback && callback(); + return Promise.resolve(); + } + if (typeof ns === 'string') ns = [ + ns + ]; + ns.forEach(function (n) { + if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n); + }); + this.loadResources(function (err) { + deferred.resolve(); + if (callback) callback(err); + }); + return deferred; + } + }, + { + key: 'loadLanguages', + value: function loadLanguages(lngs, callback) { + var deferred = defer(); + if (typeof lngs === 'string') lngs = [ + lngs + ]; + var preloaded = this.options.preload || [ + ]; + var newLngs = lngs.filter(function (lng) { + return preloaded.indexOf(lng) < 0; + }); // Exit early if all given languages are already preloaded + if (!newLngs.length) { + if (callback) callback(); + return Promise.resolve(); + } + this.options.preload = preloaded.concat(newLngs); + this.loadResources(function (err) { + deferred.resolve(); + if (callback) callback(err); + }); + return deferred; + } + }, + { + key: 'dir', + value: function dir(lng) { + if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language; + if (!lng) return 'rtl'; + var rtlLngs = [ + 'ar', + 'shu', + 'sqr', + 'ssh', + 'xaa', + 'yhd', + 'yud', + 'aao', + 'abh', + 'abv', + 'acm', + 'acq', + 'acw', + 'acx', + 'acy', + 'adf', + 'ads', + 'aeb', + 'aec', + 'afb', + 'ajp', + 'apc', + 'apd', + 'arb', + 'arq', + 'ars', + 'ary', + 'arz', + 'auz', + 'avl', + 'ayh', + 'ayl', + 'ayn', + 'ayp', + 'bbz', + 'pga', + 'he', + 'iw', + 'ps', + 'pbt', + 'pbu', + 'pst', + 'prp', + 'prd', + 'ur', + 'ydd', + 'yds', + 'yih', + 'ji', + 'yi', + 'hbo', + 'men', + 'xmn', + 'fa', + 'jpr', + 'peo', + 'pes', + 'prs', + 'dv', + 'sam' + ]; + return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) >= 0 ? 'rtl' : 'ltr'; + } /* eslint class-methods-use-this: 0 */ + + }, + { + key: 'createInstance', + value: function createInstance() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + var callback = arguments.length > 1 ? arguments[1] : undefined; + return new I18n(options, callback); + } + }, + { + key: 'cloneInstance', + value: function cloneInstance() { + var _this8 = this; + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop; + var mergedOptions = _objectSpread({ + }, this.options, options, { + isClone: true + }); + var clone = new I18n(mergedOptions); + var membersToCopy = [ + 'store', + 'services', + 'language' + ]; + membersToCopy.forEach(function (m) { + clone[m] = _this8[m]; + }); + clone.translator = new Translator(clone.services, clone.options); + clone.translator.on('*', function (event) { + for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + args[_key4 - 1] = arguments[_key4]; + } + clone.emit.apply(clone, [ + event + ].concat(args)); + }); + clone.init(mergedOptions, callback); + clone.translator.options = clone.options; // sync options + return clone; + } + } + ]); + return I18n; + }(EventEmitter); + var i18next = new I18n(); + module.exports = i18next; + }, + { + '@babel/runtime/helpers/assertThisInitialized': 4, + '@babel/runtime/helpers/classCallCheck': 5, + '@babel/runtime/helpers/createClass': 6, + '@babel/runtime/helpers/getPrototypeOf': 8, + '@babel/runtime/helpers/inherits': 9, + '@babel/runtime/helpers/objectSpread': 14, + '@babel/runtime/helpers/possibleConstructorReturn': 15, + '@babel/runtime/helpers/slicedToArray': 17, + '@babel/runtime/helpers/toConsumableArray': 18, + '@babel/runtime/helpers/typeof': 19 + } + ], + 268: [ + function (_dereq_, module, exports) { + exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, + m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = - 7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? - 1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << - nBits) - 1; + s >>= - nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << - nBits) - 1; + e >>= - nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? - 1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? - 1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, + m, + c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, - 24) - Math.pow(2, - 77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : - 1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, - e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + }, + { + } + ], + 269: [ + function (_dereq_, module, exports) { + /* + + Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. + Copyright 2015, Google Inc. All Rights Reserved. + + 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 including the dates of first publication and + either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ + 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 + SILICON GRAPHICS, INC. 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. + + Original Code. The Original Code is: OpenGL Sample Implementation, + Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, + Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. + Copyright in any portions created by third parties is as indicated + elsewhere herein. All Rights Reserved. +*/ + 'use strict'; + var n; + function t(a, b) { + return a.b === b.b && a.a === b.a; + } + function u(a, b) { + return a.b < b.b || a.b === b.b && a.a <= b.a; + } + function v(a, b, c) { + var d = b.b - a.b, + e = c.b - b.b; + return 0 < d + e ? d < e ? b.a - a.a + d / (d + e) * (a.a - c.a) : b.a - c.a + e / (d + e) * (c.a - a.a) : 0; + } + function x(a, b, c) { + var d = b.b - a.b, + e = c.b - b.b; + return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0; + } + function z(a, b) { + return a.a < b.a || a.a === b.a && a.b <= b.b; + } + function aa(a, b, c) { + var d = b.a - a.a, + e = c.a - b.a; + return 0 < d + e ? d < e ? b.b - a.b + d / (d + e) * (a.b - c.b) : b.b - c.b + e / (d + e) * (c.b - a.b) : 0; + } + function ba(a, b, c) { + var d = b.a - a.a, + e = c.a - b.a; + return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0; + } + function ca(a) { + return u(a.b.a, a.a); + } + function da(a) { + return u(a.a, a.b.a); + } + function A(a, b, c, d) { + a = 0 > a ? 0 : a; + c = 0 > c ? 0 : c; + return a <= c ? 0 === c ? (b + d) / 2 : b + a / (a + c) * (d - b) : d + c / (a + c) * (b - d); + } + ; + function ea(a) { + var b = B(a.b); + C(b, a.c); + C(b.b, a.c); + D(b, a.a); + return b; + } + function E(a, b) { + var c = !1, + d = !1; + a !== b && (b.a !== a.a && (d = !0, F(b.a, a.a)), b.d !== a.d && (c = !0, G(b.d, a.d)), H(b, a), d || (C(b, a.a), a.a.c = a), c || (D(b, a.d), a.d.a = a)); + } + function I(a) { + var b = a.b, + c = !1; + a.d !== a.b.d && (c = !0, G(a.d, a.b.d)); + a.c === a ? F(a.a, null) : (a.b.d.a = J(a), a.a.c = a.c, H(a, J(a)), c || D(a, a.d)); + b.c === b ? (F(b.a, null), G(b.d, null)) : (a.d.a = J(b), b.a.c = b.c, H(b, J(b))); + fa(a); + } + function K(a) { + var b = B(a), + c = b.b; + H(b, a.e); + b.a = a.b.a; + C(c, b.a); + b.d = c.d = a.d; + b = b.b; + H(a.b, J(a.b)); + H(a.b, b); + a.b.a = b.a; + b.b.a.c = b.b; + b.b.d = a.b.d; + b.f = a.f; + b.b.f = a.b.f; + return b; + } + function L(a, b) { + var c = !1, + d = B(a), + e = d.b; + b.d !== a.d && (c = !0, G(b.d, a.d)); + H(d, a.e); + H(e, b); + d.a = a.b.a; + e.a = b.a; + d.d = e.d = a.d; + a.d.a = e; + c || D(d, a.d); + return d; + } + function B(a) { + var b = new M(), + c = new M(), + d = a.b.h; + c.h = d; + d.b.h = b; + b.h = a; + a.b.h = c; + b.b = c; + b.c = b; + b.e = c; + c.b = b; + c.c = c; + return c.e = b; + } + function H(a, b) { + var c = a.c, + d = b.c; + c.b.e = b; + d.b.e = a; + a.c = d; + b.c = c; + } + function C(a, b) { + var c = b.f, + d = new N(b, c); + c.e = d; + b.f = d; + c = d.c = a; + do c.a = d, + c = c.c; + while (c !== a); + } + function D(a, b) { + var c = b.d, + d = new ga(b, c); + c.b = d; + b.d = d; + d.a = a; + d.c = b.c; + c = a; + do c.d = d, + c = c.e; + while (c !== a); + } + function fa(a) { + var b = a.h; + a = a.b.h; + b.b.h = a; + a.b.h = b; + } + function F(a, b) { + var c = a.c, + d = c; + do d.a = b, + d = d.c; + while (d !== c); + c = a.f; + d = a.e; + d.f = c; + c.e = d; + } + function G(a, b) { + var c = a.a, + d = c; + do d.d = b, + d = d.e; + while (d !== c); + c = a.d; + d = a.b; + d.d = c; + c.b = d; + } + ; + function ha(a) { + var b = 0; + Math.abs(a[1]) > Math.abs(a[0]) && (b = 1); + Math.abs(a[2]) > Math.abs(a[b]) && (b = 2); + return b; + } + ; + var O = 4 * 1e+150; + function P(a, b) { + a.f += b.f; + a.b.f += b.b.f; + } + function ia(a, b, c) { + a = a.a; + b = b.a; + c = c.a; + if (b.b.a === a) return c.b.a === a ? u(b.a, c.a) ? 0 >= x(c.b.a, b.a, c.a) : 0 <= x(b.b.a, c.a, b.a) : 0 >= x(c.b.a, a, c.a); + if (c.b.a === a) return 0 <= x(b.b.a, a, b.a); + b = v(b.b.a, a, b.a); + a = v(c.b.a, a, c.a); + return b >= a; + } + function Q(a) { + a.a.i = null; + var b = a.e; + b.a.c = b.c; + b.c.a = b.a; + a.e = null; + } + function ja(a, b) { + I(a.a); + a.c = !1; + a.a = b; + b.i = a; + } + function ka(a) { + var b = a.a.a; + do a = R(a); + while (a.a.a === b); + a.c && (b = L(S(a).a.b, a.a.e), ja(a, b), a = R(a)); + return a; + } + function la(a, b, c) { + var d = new ma(); + d.a = c; + d.e = na(a.f, b.e, d); + return c.i = d; + } + function oa(a, b) { + switch (a.s) { + case 100130: + return 0 !== (b & 1); + case 100131: + return 0 !== b; + case 100132: + return 0 < b; + case 100133: + return 0 > b; + case 100134: + return 2 <= b || - 2 >= b; + } + return !1; + } + function pa(a) { + var b = a.a, + c = b.d; + c.c = a.d; + c.a = b; + Q(a); + } + function T(a, b, c) { + a = b; + for (b = b.a; a !== c; ) { + a.c = !1; + var d = S(a), + e = d.a; + if (e.a !== b.a) { + if (!d.c) { + pa(a); + break; + } + e = L(b.c.b, e.b); + ja(d, e); + } + b.c !== e && (E(J(e), e), E(b, e)); + pa(a); + b = d.a; + a = d; + } + return b; + } + function U(a, b, c, d, e, f) { + var g = !0; + do la(a, b, c.b), + c = c.c; + while (c !== d); + for (null === e && (e = S(b).a.b.c); ; ) { + d = S(b); + c = d.a.b; + if (c.a !== e.a) break; + c.c !== e && (E(J(c), c), E(J(e), c)); + d.f = b.f - c.f; + d.d = oa(a, d.f); + b.b = !0; + !g && qa(a, b) && (P(c, e), Q(b), I(e)); + g = !1; + b = d; + e = c; + } + b.b = !0; + f && ra(a, b); + } + function sa(a, b, c, d, e) { + var f = [ + b.g[0], + b.g[1], + b.g[2] + ]; + b.d = null; + b.d = a.o ? a.o(f, c, d, a.c) || null : null; + null === b.d && (e ? a.n || (V(a, 100156), a.n = !0) : b.d = c[0]); + } + function ta(a, b, c) { + var d = [ + null, + null, + null, + null + ]; + d[0] = b.a.d; + d[1] = c.a.d; + sa(a, b.a, d, [ + 0.5, + 0.5, + 0, + 0 + ], !1); + E(b, c); + } + function ua(a, b, c, d, e) { + var f = Math.abs(b.b - a.b) + Math.abs(b.a - a.a), + g = Math.abs(c.b - a.b) + Math.abs(c.a - a.a), + h = e + 1; + d[e] = 0.5 * g / (f + g); + d[h] = 0.5 * f / (f + g); + a.g[0] += d[e] * b.g[0] + d[h] * c.g[0]; + a.g[1] += d[e] * b.g[1] + d[h] * c.g[1]; + a.g[2] += d[e] * b.g[2] + d[h] * c.g[2]; + } + function qa(a, b) { + var c = S(b), + d = b.a, + e = c.a; + if (u(d.a, e.a)) { + if (0 < x(e.b.a, d.a, e.a)) return !1; + if (!t(d.a, e.a)) K(e.b), + E(d, J(e)), + b.b = c.b = !0; + else if (d.a !== e.a) { + var c = a.e, + f = d.a.h; + if (0 <= f) { + var c = c.b, + g = c.d, + h = c.e, + k = c.c, + l = k[f]; + g[l] = g[c.a]; + k[g[l]] = l; + l <= --c.a && (1 >= l ? W(c, l) : u(h[g[l >> 1]], h[g[l]]) ? W(c, l) : va(c, l)); + h[f] = null; + k[f] = c.b; + c.b = f; + } else for (c.c[ - (f + 1)] = null; 0 < c.a && null === c.c[c.d[c.a - 1]]; ) --c.a; + ta(a, J(e), d); + } + } else { + if (0 > x(d.b.a, e.a, d.a)) return !1; + R(b).b = b.b = !0; + K(d.b); + E(J(e), d); + } + return !0; + } + function wa(a, b) { + var c = S(b), + d = b.a, + e = c.a, + f = d.a, + g = e.a, + h = d.b.a, + k = e.b.a, + l = new N(); + x(h, a.a, f); + x(k, a.a, g); + if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1; + if (u(f, g)) { + if (0 < x(k, f, g)) return !1; + } else if (0 > x(h, g, f)) return !1; + var r = h, + p = f, + q = k, + y = g, + m, + w; + u(r, p) || (m = r, r = p, p = m); + u(q, y) || (m = q, q = y, y = m); + u(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m); + u(q, p) ? u(p, y) ? (m = v(r, q, p), w = v(q, p, y), 0 > m + w && (m = - m, w = - w), l.b = A(m, q.b, w, p.b)) : (m = x(r, q, p), w = - x(r, y, p), 0 > m + w && (m = - m, w = - w), l.b = A(m, q.b, w, y.b)) : l.b = (q.b + p.b) / 2; + z(r, p) || (m = r, r = p, p = m); + z(q, y) || (m = q, q = y, y = m); + z(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m); + z(q, p) ? z(p, y) ? (m = aa(r, q, p), w = aa(q, p, y), 0 > m + w && (m = - m, w = - w), l.a = A(m, q.a, w, p.a)) : (m = ba(r, q, p), w = - ba(r, y, p), 0 > m + w && (m = - m, w = - w), l.a = A(m, q.a, w, y.a)) : l.a = (q.a + p.a) / 2; + u(l, a.a) && (l.b = a.a.b, l.a = a.a.a); + r = u(f, g) ? f : g; + u(r, l) && (l.b = r.b, l.a = r.a); + if (t(l, f) || t(l, g)) return qa(a, b), + !1; + if (!t(h, a.a) && 0 <= x(h, a.a, l) || !t(k, a.a) && 0 >= x(k, a.a, l)) { + if (k === a.a) return K(d.b), + E(e.b, d), + b = ka(b), + d = S(b).a, + T(a, S(b), c), + U(a, b, J(d), d, d, !0), + !0; + if (h === a.a) { + K(e.b); + E(d.e, J(e)); + f = c = b; + g = f.a.b.a; + do f = R(f); + while (f.a.b.a === g); + b = f; + f = S(b).a.b.c; + c.a = J(e); + e = T(a, c, null); + U(a, b, e.c, d.b.c, f, !0); + return !0; + } + 0 <= x(h, a.a, l) && (R(b).b = b.b = !0, K(d.b), d.a.b = a.a.b, d.a.a = a.a.a); + 0 >= x(k, a.a, l) && (b.b = c.b = !0, K(e.b), e.a.b = a.a.b, e.a.a = a.a.a); + return !1; + } + K(d.b); + K(e.b); + E(J(e), d); + d.a.b = l.b; + d.a.a = l.a; + d.a.h = xa(a.e, d.a); + d = d.a; + e = [ + 0, + 0, + 0, + 0 + ]; + l = [ + f.d, + h.d, + g.d, + k.d + ]; + d.g[0] = d.g[1] = d.g[2] = 0; + ua(d, f, h, e, 0); + ua(d, g, k, e, 2); + sa(a, d, l, e, !0); + R(b).b = b.b = c.b = !0; + return !1; + } + function ra(a, b) { + for (var c = S(b); ; ) { + for (; c.b; ) b = c, + c = S(c); + if (!b.b && (c = b, b = R(b), null === b || !b.b)) break; + b.b = !1; + var d = b.a, + e = c.a, + f; + if (f = d.b.a !== e.b.a) a: { + f = b; + var g = S(f), + h = f.a, + k = g.a, + l = void 0; + if (u(h.b.a, k.b.a)) { + if (0 > x(h.b.a, k.b.a, h.a)) { + f = !1; + break a; + } + R(f).b = f.b = !0; + l = K(h); + E(k.b, l); + l.d.c = f.d; + } else { + if (0 < x(k.b.a, h.b.a, k.a)) { + f = !1; + break a; + } + f.b = g.b = !0; + l = K(k); + E(h.e, k.b); + l.b.d.c = f.d; + } + f = !0; + } + f && (c.c ? (Q(c), I(e), c = S(b), e = c.a) : b.c && (Q(b), I(d), b = R(c), d = b.a)); + if (d.a !== e.a) if (d.b.a === e.b.a || b.c || c.c || d.b.a !== a.a && e.b.a !== a.a) qa(a, b); + else if (wa(a, b)) break; + d.a === e.a && d.b.a === e.b.a && (P(e, d), Q(b), I(d), b = R(c)); + } + } + function ya(a, b) { + a.a = b; + for (var c = b.c; null === c.i; ) if (c = c.c, c === b.c) { + var c = a, + d = b, + e = new ma(); + e.a = d.c.b; + var f = c.f, + g = f.a; + do g = g.a; + while (null !== g.b && !f.c(f.b, e, g.b)); + var f = g.b, + h = S(f), + e = f.a, + g = h.a; + if (0 === x(e.b.a, d, e.a)) e = f.a, + t(e.a, d) || t(e.b.a, d) || (K(e.b), f.c && (I(e.c), f.c = !1), E(d.c, e), ya(c, d)); + else { + var k = u(g.b.a, e.b.a) ? f : h, + h = void 0; + f.d || k.c ? (k === f ? h = L(d.c.b, e.e) : h = L(g.b.c.b, d.c).b, k.c ? ja(k, h) : (e = c, f = la(c, f, h), f.f = R(f).f + f.a.f, f.d = oa(e, f.f)), ya(c, d)) : U(c, f, d.c, d.c, null, !0); + } + return; + } + c = ka(c.i); + e = S(c); + f = e.a; + e = T(a, e, null); + if (e.c === f) { + var f = e, + e = f.c, + g = S(c), + h = c.a, + k = g.a, + l = !1; + h.b.a !== k.b.a && wa(a, c); + t(h.a, a.a) && (E(J(e), h), c = ka(c), e = S(c).a, T(a, S(c), g), l = !0); + t(k.a, a.a) && (E(f, J(k)), f = T(a, g, null), l = !0); + l ? U(a, c, f.c, e, e, !0) : (u(k.a, h.a) ? d = J(k) : d = h, d = L(f.c.b, d), U(a, c, d, d.c, d.c, !1), d.b.i.c = !0, ra(a, c)); + } else U(a, c, e.c, f, f, !0); + } + function za(a, b) { + var c = new ma(), + d = ea(a.b); + d.a.b = O; + d.a.a = b; + d.b.a.b = - O; + d.b.a.a = b; + a.a = d.b.a; + c.a = d; + c.f = 0; + c.d = !1; + c.c = !1; + c.h = !0; + c.b = !1; + d = a.f; + d = na(d, d.a, c); + c.e = d; + } + ; + function Aa(a) { + this.a = new Ba(); + this.b = a; + this.c = ia; + } + function na(a, b, c) { + do b = b.c; + while (null !== b.b && !a.c(a.b, b.b, c)); + a = new Ba(c, b.a, b); + b.a.c = a; + return b.a = a; + } + ; + function Ba(a, b, c) { + this.b = a || null; + this.a = b || this; + this.c = c || this; + } + ; + function X() { + this.d = Y; + this.p = this.b = this.q = null; + this.j = [ + 0, + 0, + 0 + ]; + this.s = 100130; + this.n = !1; + this.o = this.a = this.e = this.f = null; + this.m = !1; + this.c = this.r = this.i = this.k = this.l = this.h = null; + } + var Y = 0; + n = X.prototype; + n.x = function () { + Z(this, Y); + }; + n.B = function (a, b) { + switch (a) { + case 100142: + return; + case 100140: + switch (b) { + case 100130: + case 100131: + case 100132: + case 100133: + case 100134: + this.s = b; + return; + } + break; + case 100141: + this.m = !!b; + return; + default: + V(this, 100900); + return; + } + V(this, 100901); + }; + n.y = function (a) { + switch (a) { + case 100142: + return 0; + case 100140: + return this.s; + case 100141: + return this.m; + default: + V(this, 100900); + } + return !1; + }; + n.A = function (a, b, c) { + this.j[0] = a; + this.j[1] = b; + this.j[2] = c; + }; + n.z = function (a, b) { + var c = b ? b : null; + switch (a) { + case 100100: + case 100106: + this.h = c; + break; + case 100104: + case 100110: + this.l = c; + break; + case 100101: + case 100107: + this.k = c; + break; + case 100102: + case 100108: + this.i = c; + break; + case 100103: + case 100109: + this.p = c; + break; + case 100105: + case 100111: + this.o = c; + break; + case 100112: + this.r = c; + break; + default: + V(this, 100900); + } + }; + n.C = function (a, b) { + var c = !1, + d = [ + 0, + 0, + 0 + ]; + Z(this, 2); + for (var e = 0; 3 > e; ++e) { + var f = a[e]; + - 1e+150 > f && (f = - 1e+150, c = !0); + 1e+150 < f && (f = 1e+150, c = !0); + d[e] = f; + } + c && V(this, 100155); + c = this.q; + null === c ? (c = ea(this.b), E(c, c.b)) : (K(c), c = c.e); + c.a.d = b; + c.a.g[0] = d[0]; + c.a.g[1] = d[1]; + c.a.g[2] = d[2]; + c.f = 1; + c.b.f = - 1; + this.q = c; + }; + n.u = function (a) { + Z(this, Y); + this.d = 1; + this.b = new Ca(); + this.c = a; + }; + n.t = function () { + Z(this, 1); + this.d = 2; + this.q = null; + }; + n.v = function () { + Z(this, 2); + this.d = 1; + }; + n.w = function () { + Z(this, 1); + this.d = Y; + var a = this.j[0], + b = this.j[1], + c = this.j[2], + d = !1, + e = [ + a, + b, + c + ]; + if (0 === a && 0 === b && 0 === c) { + for (var b = [ + - 2 * 1e+150, + - 2 * 1e+150, + - 2 * 1e+150 + ], f = [ + 2 * 1e+150, + 2 * 1e+150, + 2 * 1e+150 + ], c = [ + ], g = [ + ], d = this.b.c, a = d.e; a !== d; a = a.e) for (var h = 0; 3 > h; ++h) { + var k = a.g[h]; + k < f[h] && (f[h] = k, g[h] = a); + k > b[h] && (b[h] = k, c[h] = a); + } + a = 0; + b[1] - f[1] > b[0] - f[0] && (a = 1); + b[2] - f[2] > b[a] - f[a] && (a = 2); + if (f[a] >= b[a]) e[0] = 0, + e[1] = 0, + e[2] = 1; + else { + b = 0; + f = g[a]; + c = c[a]; + g = [ + 0, + 0, + 0 + ]; + f = [ + f.g[0] - c.g[0], + f.g[1] - c.g[1], + f.g[2] - c.g[2] + ]; + h = [ + 0, + 0, + 0 + ]; + for (a = d.e; a !== d; a = a.e) h[0] = a.g[0] - c.g[0], + h[1] = a.g[1] - c.g[1], + h[2] = a.g[2] - c.g[2], + g[0] = f[1] * h[2] - f[2] * h[1], + g[1] = f[2] * h[0] - f[0] * h[2], + g[2] = f[0] * h[1] - f[1] * h[0], + k = g[0] * g[0] + g[1] * g[1] + g[2] * g[2], + k > b && (b = k, e[0] = g[0], e[1] = g[1], e[2] = g[2]); + 0 >= b && (e[0] = e[1] = e[2] = 0, e[ha(f)] = 1); + } + d = !0; + } + g = ha(e); + a = this.b.c; + b = (g + 1) % 3; + c = (g + 2) % 3; + g = 0 < e[g] ? 1 : - 1; + for (e = a.e; e !== a; e = e.e) e.b = e.g[b], + e.a = g * e.g[c]; + if (d) { + e = 0; + d = this.b.a; + for (a = d.b; a !== d; a = a.b) if (b = a.a, !(0 >= b.f)) { + do e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a), + b = b.e; + while (b !== a.a); + } + if (0 > e) for (e = this.b.c, d = e.e; d !== e; d = d.e) d.a = - d.a; + } + this.n = !1; + e = this.b.b; + for (a = e.h; a !== e; a = d) if (d = a.h, b = a.e, t(a.a, a.b.a) && a.e.e !== a && (ta(this, b, a), I(a), a = b, b = a.e), b.e === a) { + if (b !== a) { + if (b === d || b === d.b) d = d.h; + I(b); + } + if (a === d || a === d.b) d = d.h; + I(a); + } + this.e = e = new Da(); + d = this.b.c; + for (a = d.e; a !== d; a = a.e) a.h = xa(e, a); + Ea(e); + this.f = new Aa(this); + za(this, - O); + for (za(this, O); null !== (e = Fa(this.e)); ) { + for (; ; ) { + a: if (a = this.e, 0 === a.a) d = Ga(a.b); + else if (d = a.c[a.d[a.a - 1]], 0 !== a.b.a && (a = Ga(a.b), u(a, d))) { + d = a; + break a; + } + if (null === d || !t(d, e)) break; + d = Fa(this.e); + ta(this, e.c, d.c); + } + ya(this, e); + } + this.a = this.f.a.a.b.a.a; + for (e = 0; null !== (d = this.f.a.a.b); ) d.h || ++e, + Q(d); + this.f = null; + e = this.e; + e.b = null; + e.d = null; + this.e = e.c = null; + e = this.b; + for (a = e.a.b; a !== e.a; a = d) d = a.b, + a = a.a, + a.e.e === a && (P(a.c, a), I(a)); + if (!this.n) { + e = this.b; + if (this.m) for (a = e.b.h; a !== e.b; a = d) d = a.h, + a.b.d.c !== a.d.c ? a.f = a.d.c ? 1 : - 1 : I(a); + else for (a = e.a.b; a !== e.a; a = d) if (d = a.b, a.c) { + for (a = a.a; u(a.b.a, a.a); a = a.c.b); + for (; u(a.a, a.b.a); a = a.e); + b = a.c.b; + for (c = void 0; a.e !== b; ) if (u(a.b.a, b.a)) { + for (; b.e !== a && (ca(b.e) || 0 >= x(b.a, b.b.a, b.e.b.a)); ) c = L(b.e, b), + b = c.b; + b = b.c.b; + } else { + for (; b.e !== a && (da(a.c.b) || 0 <= x(a.b.a, a.a, a.c.b.a)); ) c = L(a, a.c.b), + a = c.b; + a = a.e; + } + for (; b.e.e !== a; ) c = L(b.e, b), + b = c.b; + } + if (this.h || this.i || this.k || this.l) if (this.m) for (e = this.b, d = e.a.b; d !== e.a; d = d.b) { + if (d.c) { + this.h && this.h(2, this.c); + a = d.a; + do this.k && this.k(a.a.d, this.c), + a = a.e; + while (a !== d.a); + this.i && this.i(this.c); + } + } else { + e = this.b; + d = !!this.l; + a = !1; + b = - 1; + for (c = e.a.d; c !== e.a; c = c.d) if (c.c) { + a || (this.h && this.h(4, this.c), a = !0); + g = c.a; + do d && (f = g.b.d.c ? 0 : 1, b !== f && (b = f, this.l && this.l(!!b, this.c))), + this.k && this.k(g.a.d, this.c), + g = g.e; + while (g !== c.a); + } + a && this.i && this.i(this.c); + } + if (this.r) { + e = this.b; + for (a = e.a.b; a !== e.a; a = d) if (d = a.b, !a.c) { + b = a.a; + c = b.e; + g = void 0; + do g = c, + c = g.e, + g.d = null, + null === g.b.d && (g.c === g ? F(g.a, null) : (g.a.c = g.c, H(g, J(g))), f = g.b, f.c === f ? F(f.a, null) : (f.a.c = f.c, H(f, J(f))), fa(g)); + while (g !== b); + b = a.d; + a = a.b; + a.d = b; + b.b = a; + } + this.r(this.b); + this.c = this.b = null; + return; + } + } + this.b = this.c = null; + }; + function Z(a, b) { + if (a.d !== b) for (; a.d !== b; ) if (a.d < b) switch (a.d) { + case Y: + V(a, 100151); + a.u(null); + break; + case 1: + V(a, 100152), + a.t(); + } else switch (a.d) { + case 2: + V(a, 100154); + a.v(); + break; + case 1: + V(a, 100153), + a.w(); + } + } + function V(a, b) { + a.p && a.p(b, a.c); + } + ; + function ga(a, b) { + this.b = a || this; + this.d = b || this; + this.a = null; + this.c = !1; + } + ; + function M() { + this.h = this; + this.i = this.d = this.a = this.e = this.c = this.b = null; + this.f = 0; + } + function J(a) { + return a.b.e; + } + ; + function Ca() { + this.c = new N(); + this.a = new ga(); + this.b = new M(); + this.d = new M(); + this.b.b = this.d; + this.d.b = this.b; + } + ; + function N(a, b) { + this.e = a || this; + this.f = b || this; + this.d = this.c = null; + this.g = [ + 0, + 0, + 0 + ]; + this.h = this.a = this.b = 0; + } + ; + function Da() { + this.c = [ + ]; + this.d = null; + this.a = 0; + this.e = !1; + this.b = new Ha(); + } + function Ea(a) { + a.d = [ + ]; + for (var b = 0; b < a.a; b++) a.d[b] = b; + a.d.sort(function (a) { + return function (b, e) { + return u(a[b], a[e]) ? 1 : - 1; + }; + }(a.c)); + a.e = !0; + Ia(a.b); + } + function xa(a, b) { + if (a.e) { + var c = a.b, + d = ++c.a; + 2 * d > c.f && (c.f *= 2, c.c = Ja(c.c, c.f + 1)); + var e; + 0 === c.b ? e = d : (e = c.b, c.b = c.c[c.b]); + c.e[e] = b; + c.c[e] = d; + c.d[d] = e; + c.h && va(c, d); + return e; + } + c = a.a++; + a.c[c] = b; + return - (c + 1); + } + function Fa(a) { + if (0 === a.a) return Ka(a.b); + var b = a.c[a.d[a.a - 1]]; + if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b); + do --a.a; + while (0 < a.a && null === a.c[a.d[a.a - 1]]); + return b; + } + ; + function Ha() { + this.d = Ja([0], 33); + this.e = [ + null, + null + ]; + this.c = [ + 0, + 0 + ]; + this.a = 0; + this.f = 32; + this.b = 0; + this.h = !1; + this.d[1] = 1; + } + function Ja(a, b) { + for (var c = Array(b), d = 0; d < a.length; d++) c[d] = a[d]; + for (; d < b; d++) c[d] = 0; + return c; + } + function Ia(a) { + for (var b = a.a; 1 <= b; --b) W(a, b); + a.h = !0; + } + function Ga(a) { + return a.e[a.d[1]]; + } + function Ka(a) { + var b = a.d, + c = a.e, + d = a.c, + e = b[1], + f = c[e]; + 0 < a.a && (b[1] = b[a.a], d[b[1]] = 1, c[e] = null, d[e] = a.b, a.b = e, 0 < --a.a && W(a, 1)); + return f; + } + function W(a, b) { + for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { + var h = f << 1; + h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1); + var k = c[h]; + if (h > a.a || u(d[g], d[k])) { + c[f] = g; + e[g] = f; + break; + } + c[f] = k; + e[k] = f; + f = h; + } + } + function va(a, b) { + for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { + var h = f >> 1, + k = c[h]; + if (0 === h || u(d[k], d[g])) { + c[f] = g; + e[g] = f; + break; + } + c[f] = k; + e[k] = f; + f = h; + } + } + ; + function ma() { + this.e = this.a = null; + this.f = 0; + this.c = this.b = this.h = this.d = !1; + } + function S(a) { + return a.e.c.b; + } + function R(a) { + return a.e.a.b; + } + ; + this.libtess = { + GluTesselator: X, + windingRule: { + GLU_TESS_WINDING_ODD: 100130, + GLU_TESS_WINDING_NONZERO: 100131, + GLU_TESS_WINDING_POSITIVE: 100132, + GLU_TESS_WINDING_NEGATIVE: 100133, + GLU_TESS_WINDING_ABS_GEQ_TWO: 100134 + }, + primitiveType: { + GL_LINE_LOOP: 2, + GL_TRIANGLES: 4, + GL_TRIANGLE_STRIP: 5, + GL_TRIANGLE_FAN: 6 + }, + errorType: { + GLU_TESS_MISSING_BEGIN_POLYGON: 100151, + GLU_TESS_MISSING_END_POLYGON: 100153, + GLU_TESS_MISSING_BEGIN_CONTOUR: 100152, + GLU_TESS_MISSING_END_CONTOUR: 100154, + GLU_TESS_COORD_TOO_LARGE: 100155, + GLU_TESS_NEED_COMBINE_CALLBACK: 100156 + }, + gluEnum: { + GLU_TESS_MESH: 100112, + GLU_TESS_TOLERANCE: 100142, + GLU_TESS_WINDING_RULE: 100140, + GLU_TESS_BOUNDARY_ONLY: 100141, + GLU_INVALID_ENUM: 100900, + GLU_INVALID_VALUE: 100901, + GLU_TESS_BEGIN: 100100, + GLU_TESS_VERTEX: 100101, + GLU_TESS_END: 100102, + GLU_TESS_ERROR: 100103, + GLU_TESS_EDGE_FLAG: 100104, + GLU_TESS_COMBINE: 100105, + GLU_TESS_BEGIN_DATA: 100106, + GLU_TESS_VERTEX_DATA: 100107, + GLU_TESS_END_DATA: 100108, + GLU_TESS_ERROR_DATA: 100109, + GLU_TESS_EDGE_FLAG_DATA: 100110, + GLU_TESS_COMBINE_DATA: 100111 + } + }; + X.prototype.gluDeleteTess = X.prototype.x; + X.prototype.gluTessProperty = X.prototype.B; + X.prototype.gluGetTessProperty = X.prototype.y; + X.prototype.gluTessNormal = X.prototype.A; + X.prototype.gluTessCallback = X.prototype.z; + X.prototype.gluTessVertex = X.prototype.C; + X.prototype.gluTessBeginPolygon = X.prototype.u; + X.prototype.gluTessBeginContour = X.prototype.t; + X.prototype.gluTessEndContour = X.prototype.v; + X.prototype.gluTessEndPolygon = X.prototype.w; + if (typeof module !== 'undefined') { + module.exports = this.libtess; + } + }, + { + } + ], + 270: [ + function (_dereq_, module, exports) { + // (c) Dean McNamee , 2013. + // + // https://github.com/deanm/omggif + // + // 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. + // + // omggif is a JavaScript implementation of a GIF 89a encoder and decoder, + // including animation and compression. It does not rely on any specific + // underlying system, so should run in the browser, Node, or Plask. + 'use strict'; + function GifWriter(buf, width, height, gopts) { + var p = 0; + var gopts = gopts === undefined ? { + } + : gopts; + var loop_count = gopts.loop === undefined ? null : gopts.loop; + var global_palette = gopts.palette === undefined ? null : gopts.palette; + if (width <= 0 || height <= 0 || width > 65535 || height > 65535) throw new Error('Width/Height invalid.'); + function check_palette_and_num_colors(palette) { + var num_colors = palette.length; + if (num_colors < 2 || num_colors > 256 || num_colors & num_colors - 1) { + throw new Error('Invalid code/color length, must be power of 2 and 2 .. 256.'); + } + return num_colors; + } // - Header. + + buf[p++] = 71; + buf[p++] = 73; + buf[p++] = 70; // GIF + buf[p++] = 56; + buf[p++] = 57; + buf[p++] = 97; // 89a + // Handling of Global Color Table (palette) and background index. + var gp_num_colors_pow2 = 0; + var background = 0; + if (global_palette !== null) { + var gp_num_colors = check_palette_and_num_colors(global_palette); + while (gp_num_colors >>= 1) ++gp_num_colors_pow2; + gp_num_colors = 1 << gp_num_colors_pow2; + --gp_num_colors_pow2; + if (gopts.background !== undefined) { + background = gopts.background; + if (background >= gp_num_colors) throw new Error('Background index out of range.'); + // The GIF spec states that a background index of 0 should be ignored, so + // this is probably a mistake and you really want to set it to another + // slot in the palette. But actually in the end most browsers, etc end + // up ignoring this almost completely (including for dispose background). + if (background === 0) throw new Error('Background index explicitly passed as 0.'); + } + } // - Logical Screen Descriptor. + // NOTE(deanm): w/h apparently ignored by implementations, but set anyway. + + buf[p++] = width & 255; + buf[p++] = width >> 8 & 255; + buf[p++] = height & 255; + buf[p++] = height >> 8 & 255; + // NOTE: Indicates 0-bpp original color resolution (unused?). + buf[p++] = (global_palette !== null ? 128 : 0) | // Global Color Table Flag. + gp_num_colors_pow2; // NOTE: No sort flag (unused?). + buf[p++] = background; // Background Color Index. + buf[p++] = 0; // Pixel aspect ratio (unused?). + // - Global Color Table + if (global_palette !== null) { + for (var i = 0, il = global_palette.length; i < il; ++i) { + var rgb = global_palette[i]; + buf[p++] = rgb >> 16 & 255; + buf[p++] = rgb >> 8 & 255; + buf[p++] = rgb & 255; + } + } + if (loop_count !== null) { + // Netscape block for looping. + if (loop_count < 0 || loop_count > 65535) throw new Error('Loop count invalid.'); + // Extension code, label, and length. + buf[p++] = 33; + buf[p++] = 255; + buf[p++] = 11; + // NETSCAPE2.0 + buf[p++] = 78; + buf[p++] = 69; + buf[p++] = 84; + buf[p++] = 83; + buf[p++] = 67; + buf[p++] = 65; + buf[p++] = 80; + buf[p++] = 69; + buf[p++] = 50; + buf[p++] = 46; + buf[p++] = 48; + // Sub-block + buf[p++] = 3; + buf[p++] = 1; + buf[p++] = loop_count & 255; + buf[p++] = loop_count >> 8 & 255; + buf[p++] = 0; // Terminator. + } + var ended = false; + this.addFrame = function (x, y, w, h, indexed_pixels, opts) { + if (ended === true) { + --p; + ended = false; + } // Un-end. + + opts = opts === undefined ? { + } + : opts; + // TODO(deanm): Bounds check x, y. Do they need to be within the virtual + // canvas width/height, I imagine? + if (x < 0 || y < 0 || x > 65535 || y > 65535) throw new Error('x/y invalid.'); + if (w <= 0 || h <= 0 || w > 65535 || h > 65535) throw new Error('Width/Height invalid.'); + if (indexed_pixels.length < w * h) throw new Error('Not enough pixels for the frame size.'); + var using_local_palette = true; + var palette = opts.palette; + if (palette === undefined || palette === null) { + using_local_palette = false; + palette = global_palette; + } + if (palette === undefined || palette === null) throw new Error('Must supply either a local or global palette.'); + var num_colors = check_palette_and_num_colors(palette); + // Compute the min_code_size (power of 2), destroying num_colors. + var min_code_size = 0; + while (num_colors >>= 1) ++min_code_size; + num_colors = 1 << min_code_size; // Now we can easily get it back. + var delay = opts.delay === undefined ? 0 : opts.delay; + // From the spec: + // 0 - No disposal specified. The decoder is + // not required to take any action. + // 1 - Do not dispose. The graphic is to be left + // in place. + // 2 - Restore to background color. The area used by the + // graphic must be restored to the background color. + // 3 - Restore to previous. The decoder is required to + // restore the area overwritten by the graphic with + // what was there prior to rendering the graphic. + // 4-7 - To be defined. + // NOTE(deanm): Dispose background doesn't really work, apparently most + // browsers ignore the background palette index and clear to transparency. + var disposal = opts.disposal === undefined ? 0 : opts.disposal; + if (disposal < 0 || disposal > 3) // 4-7 is reserved. + throw new Error('Disposal out of range.'); + var use_transparency = false; + var transparent_index = 0; + if (opts.transparent !== undefined && opts.transparent !== null) { + use_transparency = true; + transparent_index = opts.transparent; + if (transparent_index < 0 || transparent_index >= num_colors) throw new Error('Transparent color index.'); + } + if (disposal !== 0 || use_transparency || delay !== 0) { + // - Graphics Control Extension + buf[p++] = 33; + buf[p++] = 249; // Extension / Label. + buf[p++] = 4; // Byte size. + buf[p++] = disposal << 2 | (use_transparency === true ? 1 : 0); + buf[p++] = delay & 255; + buf[p++] = delay >> 8 & 255; + buf[p++] = transparent_index; // Transparent color index. + buf[p++] = 0; // Block Terminator. + } // - Image Descriptor + + buf[p++] = 44; // Image Seperator. + buf[p++] = x & 255; + buf[p++] = x >> 8 & 255; // Left. + buf[p++] = y & 255; + buf[p++] = y >> 8 & 255; // Top. + buf[p++] = w & 255; + buf[p++] = w >> 8 & 255; + buf[p++] = h & 255; + buf[p++] = h >> 8 & 255; + // NOTE: No sort flag (unused?). + // TODO(deanm): Support interlace. + buf[p++] = using_local_palette === true ? 128 | min_code_size - 1 : 0; + // - Local Color Table + if (using_local_palette === true) { + for (var i = 0, il = palette.length; i < il; ++i) { + var rgb = palette[i]; + buf[p++] = rgb >> 16 & 255; + buf[p++] = rgb >> 8 & 255; + buf[p++] = rgb & 255; + } + } + p = GifWriterOutputLZWCodeStream(buf, p, min_code_size < 2 ? 2 : min_code_size, indexed_pixels); + return p; + }; + this.end = function () { + if (ended === false) { + buf[p++] = 59; // Trailer. + ended = true; + } + return p; + }; + this.getOutputBuffer = function () { + return buf; + }; + this.setOutputBuffer = function (v) { + buf = v; + }; + this.getOutputBufferPosition = function () { + return p; + }; + this.setOutputBufferPosition = function (v) { + p = v; + }; + } // Main compression routine, palette indexes -> LZW code stream. + // |index_stream| must have at least one entry. + + function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) { + buf[p++] = min_code_size; + var cur_subblock = p++; // Pointing at the length field. + var clear_code = 1 << min_code_size; + var code_mask = clear_code - 1; + var eoi_code = clear_code + 1; + var next_code = eoi_code + 1; + var cur_code_size = min_code_size + 1; // Number of bits per code. + var cur_shift = 0; + // We have at most 12-bit codes, so we should have to hold a max of 19 + // bits here (and then we would write out). + var cur = 0; + function emit_bytes_to_buffer(bit_block_size) { + while (cur_shift >= bit_block_size) { + buf[p++] = cur & 255; + cur >>= 8; + cur_shift -= 8; + if (p === cur_subblock + 256) { + // Finished a subblock. + buf[cur_subblock] = 255; + cur_subblock = p++; + } + } + } + function emit_code(c) { + cur |= c << cur_shift; + cur_shift += cur_code_size; + emit_bytes_to_buffer(8); + } // I am not an expert on the topic, and I don't want to write a thesis. + // However, it is good to outline here the basic algorithm and the few data + // structures and optimizations here that make this implementation fast. + // The basic idea behind LZW is to build a table of previously seen runs + // addressed by a short id (herein called output code). All data is + // referenced by a code, which represents one or more values from the + // original input stream. All input bytes can be referenced as the same + // value as an output code. So if you didn't want any compression, you + // could more or less just output the original bytes as codes (there are + // some details to this, but it is the idea). In order to achieve + // compression, values greater then the input range (codes can be up to + // 12-bit while input only 8-bit) represent a sequence of previously seen + // inputs. The decompressor is able to build the same mapping while + // decoding, so there is always a shared common knowledge between the + // encoding and decoder, which is also important for "timing" aspects like + // how to handle variable bit width code encoding. + // + // One obvious but very important consequence of the table system is there + // is always a unique id (at most 12-bits) to map the runs. 'A' might be + // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc. This relationship + // can be used for an effecient lookup strategy for the code mapping. We + // need to know if a run has been seen before, and be able to map that run + // to the output code. Since we start with known unique ids (input bytes), + // and then from those build more unique ids (table entries), we can + // continue this chain (almost like a linked list) to always have small + // integer values that represent the current byte chains in the encoder. + // This means instead of tracking the input bytes (AAAABCD) to know our + // current state, we can track the table entry for AAAABC (it is guaranteed + // to exist by the nature of the algorithm) and the next character D. + // Therefor the tuple of (table_entry, byte) is guaranteed to also be + // unique. This allows us to create a simple lookup key for mapping input + // sequences to codes (table indices) without having to store or search + // any of the code sequences. So if 'AAAA' has a table entry of 12, the + // tuple of ('AAAA', K) for any input byte K will be unique, and can be our + // key. This leads to a integer value at most 20-bits, which can always + // fit in an SMI value and be used as a fast sparse array / object key. + // Output code for the current contents of the index buffer. + + var ib_code = index_stream[0] & code_mask; // Load first input index. + var code_table = { + }; // Key'd on our 20-bit "tuple". + emit_code(clear_code); // Spec says first code should be a clear code. + // First index already loaded, process the rest of the stream. + for (var i = 1, il = index_stream.length; i < il; ++i) { + var k = index_stream[i] & code_mask; + var cur_key = ib_code << 8 | k; // (prev, k) unique tuple. + var cur_code = code_table[cur_key]; // buffer + k. + // Check if we have to create a new code table entry. + if (cur_code === undefined) { + // We don't have buffer + k. + // Emit index buffer (without k). + // This is an inline version of emit_code, because this is the core + // writing routine of the compressor (and V8 cannot inline emit_code + // because it is a closure here in a different context). Additionally + // we can call emit_byte_to_buffer less often, because we can have + // 30-bits (from our 31-bit signed SMI), and we know our codes will only + // be 12-bits, so can safely have 18-bits there without overflow. + // emit_code(ib_code); + cur |= ib_code << cur_shift; + cur_shift += cur_code_size; + while (cur_shift >= 8) { + buf[p++] = cur & 255; + cur >>= 8; + cur_shift -= 8; + if (p === cur_subblock + 256) { + // Finished a subblock. + buf[cur_subblock] = 255; + cur_subblock = p++; + } + } + if (next_code === 4096) { + // Table full, need a clear. + emit_code(clear_code); + next_code = eoi_code + 1; + cur_code_size = min_code_size + 1; + code_table = { + }; + } else { + // Table not full, insert a new entry. + // Increase our variable bit code sizes if necessary. This is a bit + // tricky as it is based on "timing" between the encoding and + // decoder. From the encoders perspective this should happen after + // we've already emitted the index buffer and are about to create the + // first table entry that would overflow our current code bit size. + if (next_code >= 1 << cur_code_size) ++cur_code_size; + code_table[cur_key] = next_code++; // Insert into code table. + } + ib_code = k; // Index buffer to single input k. + } else { + ib_code = cur_code; // Index buffer to sequence in code table. + } + } + emit_code(ib_code); // There will still be something in the index buffer. + emit_code(eoi_code); // End Of Information. + // Flush / finalize the sub-blocks stream to the buffer. + emit_bytes_to_buffer(1); + // Finish the sub-blocks, writing out any unfinished lengths and + // terminating with a sub-block of length 0. If we have already started + // but not yet used a sub-block it can just become the terminator. + if (cur_subblock + 1 === p) { + // Started but unused. + buf[cur_subblock] = 0; + } else { + // Started and used, write length and additional terminator block. + buf[cur_subblock] = p - cur_subblock - 1; + buf[p++] = 0; + } + return p; + } + function GifReader(buf) { + var p = 0; + // - Header (GIF87a or GIF89a). + if (buf[p++] !== 71 || buf[p++] !== 73 || buf[p++] !== 70 || buf[p++] !== 56 || (buf[p++] + 1 & 253) !== 56 || buf[p++] !== 97) { + throw new Error('Invalid GIF 87a/89a header.'); + } // - Logical Screen Descriptor. + + var width = buf[p++] | buf[p++] << 8; + var height = buf[p++] | buf[p++] << 8; + var pf0 = buf[p++]; // . + var global_palette_flag = pf0 >> 7; + var num_global_colors_pow2 = pf0 & 7; + var num_global_colors = 1 << num_global_colors_pow2 + 1; + var background = buf[p++]; + buf[p++]; // Pixel aspect ratio (unused?). + var global_palette_offset = null; + var global_palette_size = null; + if (global_palette_flag) { + global_palette_offset = p; + global_palette_size = num_global_colors; + p += num_global_colors * 3; // Seek past palette. + } + var no_eof = true; + var frames = [ + ]; + var delay = 0; + var transparent_index = null; + var disposal = 0; // 0 - No disposal specified. + var loop_count = null; + this.width = width; + this.height = height; + while (no_eof && p < buf.length) { + switch (buf[p++]) { + case 33: + // Graphics Control Extension Block + switch (buf[p++]) { + case 255: + // Application specific block + // Try if it's a Netscape block (with animation loop counter). + if (buf[p] !== 11 || // 21 FF already read, check block size. + // NETSCAPE2.0 + buf[p + 1] == 78 && buf[p + 2] == 69 && buf[p + 3] == 84 && buf[p + 4] == 83 && buf[p + 5] == 67 && buf[p + 6] == 65 && buf[p + 7] == 80 && buf[p + 8] == 69 && buf[p + 9] == 50 && buf[p + 10] == 46 && buf[p + 11] == 48 && // Sub-block + buf[p + 12] == 3 && buf[p + 13] == 1 && buf[p + 16] == 0) { + p += 14; + loop_count = buf[p++] | buf[p++] << 8; + p++; // Skip terminator. + } else { + // We don't know what it is, just try to get past it. + p += 12; + while (true) { + // Seek through subblocks. + var block_size = buf[p++]; + // Bad block size (ex: undefined from an out of bounds read). + if (!(block_size >= 0)) throw Error('Invalid block size'); + if (block_size === 0) break; // 0 size is terminator + p += block_size; + } + } + break; + case 249: + // Graphics Control Extension + if (buf[p++] !== 4 || buf[p + 4] !== 0) throw new Error('Invalid graphics extension block.'); + var pf1 = buf[p++]; + delay = buf[p++] | buf[p++] << 8; + transparent_index = buf[p++]; + if ((pf1 & 1) === 0) transparent_index = null; + disposal = pf1 >> 2 & 7; + p++; // Skip terminator. + break; + case 254: + // Comment Extension. + while (true) { + // Seek through subblocks. + var block_size = buf[p++]; + // Bad block size (ex: undefined from an out of bounds read). + if (!(block_size >= 0)) throw Error('Invalid block size'); + if (block_size === 0) break; // 0 size is terminator + // console.log(buf.slice(p, p+block_size).toString('ascii')); + p += block_size; + } + break; + default: + throw new Error('Unknown graphic control label: 0x' + buf[p - 1].toString(16)); + } + break; + case 44: + // Image Descriptor. + var x = buf[p++] | buf[p++] << 8; + var y = buf[p++] | buf[p++] << 8; + var w = buf[p++] | buf[p++] << 8; + var h = buf[p++] | buf[p++] << 8; + var pf2 = buf[p++]; + var local_palette_flag = pf2 >> 7; + var interlace_flag = pf2 >> 6 & 1; + var num_local_colors_pow2 = pf2 & 7; + var num_local_colors = 1 << num_local_colors_pow2 + 1; + var palette_offset = global_palette_offset; + var palette_size = global_palette_size; + var has_local_palette = false; + if (local_palette_flag) { + var has_local_palette = true; + palette_offset = p; // Override with local palette. + palette_size = num_local_colors; + p += num_local_colors * 3; // Seek past palette. + } + var data_offset = p; + p++; // codesize + while (true) { + var block_size = buf[p++]; + // Bad block size (ex: undefined from an out of bounds read). + if (!(block_size >= 0)) throw Error('Invalid block size'); + if (block_size === 0) break; // 0 size is terminator + p += block_size; + } + frames.push({ + x: x, + y: y, + width: w, + height: h, + has_local_palette: has_local_palette, + palette_offset: palette_offset, + palette_size: palette_size, + data_offset: data_offset, + data_length: p - data_offset, + transparent_index: transparent_index, + interlaced: !!interlace_flag, + delay: delay, + disposal: disposal + }); + break; + case 59: + // Trailer Marker (end of file). + no_eof = false; + break; + default: + throw new Error('Unknown gif block: 0x' + buf[p - 1].toString(16)); + break; + } + } + this.numFrames = function () { + return frames.length; + }; + this.loopCount = function () { + return loop_count; + }; + this.frameInfo = function (frame_num) { + if (frame_num < 0 || frame_num >= frames.length) throw new Error('Frame index out of range.'); + return frames[frame_num]; + }; + this.decodeAndBlitFrameBGRA = function (frame_num, pixels) { + var frame = this.frameInfo(frame_num); + var num_pixels = frame.width * frame.height; + var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. + GifReaderLZWOutputIndexStream(buf, frame.data_offset, index_stream, num_pixels); + var palette_offset = frame.palette_offset; + // NOTE(deanm): It seems to be much faster to compare index to 256 than + // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in + // the profile, not sure if it's related to using a Uint8Array. + var trans = frame.transparent_index; + if (trans === null) trans = 256; + // We are possibly just blitting to a portion of the entire frame. + // That is a subrect within the framerect, so the additional pixels + // must be skipped over after we finished a scanline. + var framewidth = frame.width; + var framestride = width - framewidth; + var xleft = framewidth; // Number of subrect pixels left in scanline. + // Output indicies of the top left and bottom right corners of the subrect. + var opbeg = (frame.y * width + frame.x) * 4; + var opend = ((frame.y + frame.height) * width + frame.x) * 4; + var op = opbeg; + var scanstride = framestride * 4; + // Use scanstride to skip past the rows when interlacing. This is skipping + // 7 rows for the first two passes, then 3 then 1. + if (frame.interlaced === true) { + scanstride += width * 4 * 7; // Pass 1. + } + var interlaceskip = 8; // Tracking the row interval in the current pass. + for (var i = 0, il = index_stream.length; i < il; ++i) { + var index = index_stream[i]; + if (xleft === 0) { + // Beginning of new scan line + op += scanstride; + xleft = framewidth; + if (op >= opend) { + // Catch the wrap to switch passes when interlacing. + scanstride = framestride * 4 + width * 4 * (interlaceskip - 1); + // interlaceskip / 2 * 4 is interlaceskip << 1. + op = opbeg + (framewidth + framestride) * (interlaceskip << 1); + interlaceskip >>= 1; + } + } + if (index === trans) { + op += 4; + } else { + var r = buf[palette_offset + index * 3]; + var g = buf[palette_offset + index * 3 + 1]; + var b = buf[palette_offset + index * 3 + 2]; + pixels[op++] = b; + pixels[op++] = g; + pixels[op++] = r; + pixels[op++] = 255; + } + --xleft; + } + }; + // I will go to copy and paste hell one day... + this.decodeAndBlitFrameRGBA = function (frame_num, pixels) { + var frame = this.frameInfo(frame_num); + var num_pixels = frame.width * frame.height; + var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. + GifReaderLZWOutputIndexStream(buf, frame.data_offset, index_stream, num_pixels); + var palette_offset = frame.palette_offset; + // NOTE(deanm): It seems to be much faster to compare index to 256 than + // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in + // the profile, not sure if it's related to using a Uint8Array. + var trans = frame.transparent_index; + if (trans === null) trans = 256; + // We are possibly just blitting to a portion of the entire frame. + // That is a subrect within the framerect, so the additional pixels + // must be skipped over after we finished a scanline. + var framewidth = frame.width; + var framestride = width - framewidth; + var xleft = framewidth; // Number of subrect pixels left in scanline. + // Output indicies of the top left and bottom right corners of the subrect. + var opbeg = (frame.y * width + frame.x) * 4; + var opend = ((frame.y + frame.height) * width + frame.x) * 4; + var op = opbeg; + var scanstride = framestride * 4; + // Use scanstride to skip past the rows when interlacing. This is skipping + // 7 rows for the first two passes, then 3 then 1. + if (frame.interlaced === true) { + scanstride += width * 4 * 7; // Pass 1. + } + var interlaceskip = 8; // Tracking the row interval in the current pass. + for (var i = 0, il = index_stream.length; i < il; ++i) { + var index = index_stream[i]; + if (xleft === 0) { + // Beginning of new scan line + op += scanstride; + xleft = framewidth; + if (op >= opend) { + // Catch the wrap to switch passes when interlacing. + scanstride = framestride * 4 + width * 4 * (interlaceskip - 1); + // interlaceskip / 2 * 4 is interlaceskip << 1. + op = opbeg + (framewidth + framestride) * (interlaceskip << 1); + interlaceskip >>= 1; + } + } + if (index === trans) { + op += 4; + } else { + var r = buf[palette_offset + index * 3]; + var g = buf[palette_offset + index * 3 + 1]; + var b = buf[palette_offset + index * 3 + 2]; + pixels[op++] = r; + pixels[op++] = g; + pixels[op++] = b; + pixels[op++] = 255; + } + --xleft; + } + }; + } + function GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) { + var min_code_size = code_stream[p++]; + var clear_code = 1 << min_code_size; + var eoi_code = clear_code + 1; + var next_code = eoi_code + 1; + var cur_code_size = min_code_size + 1; // Number of bits per code. + // NOTE: This shares the same name as the encoder, but has a different + // meaning here. Here this masks each code coming from the code stream. + var code_mask = (1 << cur_code_size) - 1; + var cur_shift = 0; + var cur = 0; + var op = 0; // Output pointer. + var subblock_size = code_stream[p++]; + // TODO(deanm): Would using a TypedArray be any faster? At least it would + // solve the fast mode / backing store uncertainty. + // var code_table = Array(4096); + var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits. + var prev_code = null; // Track code-1. + while (true) { + // Read up to two bytes, making sure we always 12-bits for max sized code. + while (cur_shift < 16) { + if (subblock_size === 0) break; // No more data to be read. + cur |= code_stream[p++] << cur_shift; + cur_shift += 8; + if (subblock_size === 1) { + // Never let it get to 0 to hold logic above. + subblock_size = code_stream[p++]; // Next subblock. + } else { + --subblock_size; + } + } // TODO(deanm): We should never really get here, we should have received + // and EOI. + + if (cur_shift < cur_code_size) break; + var code = cur & code_mask; + cur >>= cur_code_size; + cur_shift -= cur_code_size; + // TODO(deanm): Maybe should check that the first code was a clear code, + // at least this is what you're supposed to do. But actually our encoder + // now doesn't emit a clear code first anyway. + if (code === clear_code) { + // We don't actually have to clear the table. This could be a good idea + // for greater error checking, but we don't really do any anyway. We + // will just track it with next_code and overwrite old entries. + next_code = eoi_code + 1; + cur_code_size = min_code_size + 1; + code_mask = (1 << cur_code_size) - 1; + // Don't update prev_code ? + prev_code = null; + continue; + } else if (code === eoi_code) { + break; + } // We have a similar situation as the decoder, where we want to store + // variable length entries (code table entries), but we want to do in a + // faster manner than an array of arrays. The code below stores sort of a + // linked list within the code table, and then "chases" through it to + // construct the dictionary entries. When a new entry is created, just the + // last byte is stored, and the rest (prefix) of the entry is only + // referenced by its table entry. Then the code chases through the + // prefixes until it reaches a single byte code. We have to chase twice, + // first to compute the length, and then to actually copy the data to the + // output (backwards, since we know the length). The alternative would be + // storing something in an intermediate stack, but that doesn't make any + // more sense. I implemented an approach where it also stored the length + // in the code table, although it's a bit tricky because you run out of + // bits (12 + 12 + 8), but I didn't measure much improvements (the table + // entries are generally not the long). Even when I created benchmarks for + // very long table entries the complexity did not seem worth it. + // The code table stores the prefix entry in 12 bits and then the suffix + // byte in 8 bits, so each entry is 20 bits. + + var chase_code = code < next_code ? code : prev_code; + // Chase what we will output, either {CODE} or {CODE-1}. + var chase_length = 0; + var chase = chase_code; + while (chase > clear_code) { + chase = code_table[chase] >> 8; + ++chase_length; + } + var k = chase; + var op_end = op + chase_length + (chase_code !== code ? 1 : 0); + if (op_end > output_length) { + console.log('Warning, gif stream longer than expected.'); + return; + } // Already have the first byte from the chase, might as well write it fast. + + output[op++] = k; + op += chase_length; + var b = op; // Track pointer, writing backwards. + if (chase_code !== code) // The case of emitting {CODE-1} + k. + output[op++] = k; + chase = chase_code; + while (chase_length--) { + chase = code_table[chase]; + output[--b] = chase & 255; // Write backwards. + chase >>= 8; // Pull down to the prefix code. + } + if (prev_code !== null && next_code < 4096) { + code_table[next_code++] = prev_code << 8 | k; + // TODO(deanm): Figure out this clearing vs code growth logic better. I + // have an feeling that it should just happen somewhere else, for now it + // is awkward between when we grow past the max and then hit a clear code. + // For now just check if we hit the max 12-bits (then a clear code should + // follow, also of course encoded in 12-bits). + if (next_code >= code_mask + 1 && cur_code_size < 12) { + ++cur_code_size; + code_mask = code_mask << 1 | 1; + } + } + prev_code = code; + } + if (op !== output_length) { + console.log('Warning, gif stream shorter than expected.'); + } + return output; + } // CommonJS. + + try { + exports.GifWriter = GifWriter; + exports.GifReader = GifReader; + } catch (e) { + } + }, + { + } + ], + 271: [ + function (_dereq_, module, exports) { + (function (Buffer) { + /** + * https://opentype.js.org v0.9.0 | (c) Frederik De Bleser and other contributors | MIT License | Uses tiny-inflate by Devon Govett and string.prototype.codepointat polyfill by Mathias Bynens + */ + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : factory(global.opentype = { + }); + }) (this, function (exports) { + 'use strict'; + /*! https://mths.be/codepointat v0.2.0 by @mathias */ + if (!String.prototype.codePointAt) { + (function () { + var defineProperty = function () { + // IE 8 only supports `Object.defineProperty` on DOM elements + try { + var object = { + }; + var $defineProperty = Object.defineProperty; + var result = $defineProperty(object, object, object) && $defineProperty; + } catch (error) { + } + return result; + }(); + var codePointAt = function (position) { + if (this == null) { + throw TypeError(); + } + var string = String(this); + var size = string.length; + // `ToInteger` + var index = position ? Number(position) : 0; + if (index != index) { + // better `isNaN` + index = 0; + } // Account for out-of-bounds indices: + + if (index < 0 || index >= size) { + return undefined; + } // Get the first code unit + + var first = string.charCodeAt(index); + var second; + if ( // check if it’s the start of a surrogate pair + first >= 55296 && first <= 56319 && // high surrogate + size > index + 1 // there is a next code unit + ) { + second = string.charCodeAt(index + 1); + if (second >= 56320 && second <= 57343) { + // low surrogate + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 55296) * 1024 + second - 56320 + 65536; + } + } + return first; + }; + if (defineProperty) { + defineProperty(String.prototype, 'codePointAt', { + 'value': codePointAt, + 'configurable': true, + 'writable': true + }); + } else { + String.prototype.codePointAt = codePointAt; + } + }) (); + } + var TINF_OK = 0; + var TINF_DATA_ERROR = - 3; + function Tree() { + this.table = new Uint16Array(16); /* table of code length counts */ + this.trans = new Uint16Array(288); /* code -> symbol translation table */ + } + function Data(source, dest) { + this.source = source; + this.sourceIndex = 0; + this.tag = 0; + this.bitcount = 0; + this.dest = dest; + this.destLen = 0; + this.ltree = new Tree(); /* dynamic length/symbol tree */ + this.dtree = new Tree(); /* dynamic distance tree */ + } /* --------------------------------------------------- * + * -- uninitialized global data (static structures) -- * + * --------------------------------------------------- */ + + var sltree = new Tree(); + var sdtree = new Tree(); + /* extra bits and base tables for length codes */ + var length_bits = new Uint8Array(30); + var length_base = new Uint16Array(30); + /* extra bits and base tables for distance codes */ + var dist_bits = new Uint8Array(30); + var dist_base = new Uint16Array(30); + /* special ordering of code length codes */ + var clcidx = new Uint8Array([16, + 17, + 18, + 0, + 8, + 7, + 9, + 6, + 10, + 5, + 11, + 4, + 12, + 3, + 13, + 2, + 14, + 1, + 15]); + /* used by tinf_decode_trees, avoids allocations every call */ + var code_tree = new Tree(); + var lengths = new Uint8Array(288 + 32); + /* ----------------------- * + * -- utility functions -- * + * ----------------------- */ + /* build extra bits and base tables */ + function tinf_build_bits_base(bits, base, delta, first) { + var i, + sum; + /* build bits table */ + for (i = 0; i < delta; ++i) { + bits[i] = 0; + } + for (i = 0; i < 30 - delta; ++i) { + bits[i + delta] = i / delta | 0; + } /* build base table */ + + for (sum = first, i = 0; i < 30; ++i) { + base[i] = sum; + sum += 1 << bits[i]; + } + } /* build the fixed huffman trees */ + + function tinf_build_fixed_trees(lt, dt) { + var i; + /* build fixed length tree */ + for (i = 0; i < 7; ++i) { + lt.table[i] = 0; + } + lt.table[7] = 24; + lt.table[8] = 152; + lt.table[9] = 112; + for (i = 0; i < 24; ++i) { + lt.trans[i] = 256 + i; + } + for (i = 0; i < 144; ++i) { + lt.trans[24 + i] = i; + } + for (i = 0; i < 8; ++i) { + lt.trans[24 + 144 + i] = 280 + i; + } + for (i = 0; i < 112; ++i) { + lt.trans[24 + 144 + 8 + i] = 144 + i; + } /* build fixed distance tree */ + + for (i = 0; i < 5; ++i) { + dt.table[i] = 0; + } + dt.table[5] = 32; + for (i = 0; i < 32; ++i) { + dt.trans[i] = i; + } + } /* given an array of code lengths, build a tree */ + + var offs = new Uint16Array(16); + function tinf_build_tree(t, lengths, off, num) { + var i, + sum; + /* clear code length count table */ + for (i = 0; i < 16; ++i) { + t.table[i] = 0; + } /* scan symbol lengths, and sum code length counts */ + + for (i = 0; i < num; ++i) { + t.table[lengths[off + i]]++; + } + t.table[0] = 0; + /* compute offset table for distribution sort */ + for (sum = 0, i = 0; i < 16; ++i) { + offs[i] = sum; + sum += t.table[i]; + } /* create code->symbol translation table (symbols sorted by code) */ + + for (i = 0; i < num; ++i) { + if (lengths[off + i]) { + t.trans[offs[lengths[off + i]]++] = i; + } + } + } /* ---------------------- * + * -- decode functions -- * + * ---------------------- */ + /* get one bit from source stream */ + + function tinf_getbit(d) { + /* check if tag is empty */ + if (!d.bitcount--) { + /* load next tag */ + d.tag = d.source[d.sourceIndex++]; + d.bitcount = 7; + } /* shift bit out of tag */ + + var bit = d.tag & 1; + d.tag >>>= 1; + return bit; + } /* read a num bit value from a stream and add base */ + + function tinf_read_bits(d, num, base) { + if (!num) { + return base; + } + while (d.bitcount < 24) { + d.tag |= d.source[d.sourceIndex++] << d.bitcount; + d.bitcount += 8; + } + var val = d.tag & 65535 >>> 16 - num; + d.tag >>>= num; + d.bitcount -= num; + return val + base; + } /* given a data stream and a tree, decode a symbol */ + + function tinf_decode_symbol(d, t) { + while (d.bitcount < 24) { + d.tag |= d.source[d.sourceIndex++] << d.bitcount; + d.bitcount += 8; + } + var sum = 0, + cur = 0, + len = 0; + var tag = d.tag; + /* get more bits while code value is above sum */ + do { + cur = 2 * cur + (tag & 1); + tag >>>= 1; + ++len; + sum += t.table[len]; + cur -= t.table[len]; + } while (cur >= 0); + d.tag = tag; + d.bitcount -= len; + return t.trans[sum + cur]; + } /* given a data stream, decode dynamic trees from it */ + + function tinf_decode_trees(d, lt, dt) { + var hlit, + hdist, + hclen; + var i, + num, + length; + /* get 5 bits HLIT (257-286) */ + hlit = tinf_read_bits(d, 5, 257); + /* get 5 bits HDIST (1-32) */ + hdist = tinf_read_bits(d, 5, 1); + /* get 4 bits HCLEN (4-19) */ + hclen = tinf_read_bits(d, 4, 4); + for (i = 0; i < 19; ++i) { + lengths[i] = 0; + } /* read code lengths for code length alphabet */ + + for (i = 0; i < hclen; ++i) { + /* get 3 bits code length (0-7) */ + var clen = tinf_read_bits(d, 3, 0); + lengths[clcidx[i]] = clen; + } /* build code length tree */ + + tinf_build_tree(code_tree, lengths, 0, 19); + /* decode code lengths for the dynamic trees */ + for (num = 0; num < hlit + hdist; ) { + var sym = tinf_decode_symbol(d, code_tree); + switch (sym) { + case 16: + /* copy previous code length 3-6 times (read 2 bits) */ + var prev = lengths[num - 1]; + for (length = tinf_read_bits(d, 2, 3); length; --length) { + lengths[num++] = prev; + } + break; + case 17: + /* repeat code length 0 for 3-10 times (read 3 bits) */ + for (length = tinf_read_bits(d, 3, 3); length; --length) { + lengths[num++] = 0; + } + break; + case 18: + /* repeat code length 0 for 11-138 times (read 7 bits) */ + for (length = tinf_read_bits(d, 7, 11); length; --length) { + lengths[num++] = 0; + } + break; + default: + /* values 0-15 represent the actual code lengths */ + lengths[num++] = sym; + break; + } + } /* build dynamic trees */ + + tinf_build_tree(lt, lengths, 0, hlit); + tinf_build_tree(dt, lengths, hlit, hdist); + } /* ----------------------------- * + * -- block inflate functions -- * + * ----------------------------- */ + /* given a stream and two trees, inflate a block of data */ + + function tinf_inflate_block_data(d, lt, dt) { + while (1) { + var sym = tinf_decode_symbol(d, lt); + /* check for end of block */ + if (sym === 256) { + return TINF_OK; + } + if (sym < 256) { + d.dest[d.destLen++] = sym; + } else { + var length, + dist, + offs; + var i; + sym -= 257; + /* possibly get more bits from length code */ + length = tinf_read_bits(d, length_bits[sym], length_base[sym]); + dist = tinf_decode_symbol(d, dt); + /* possibly get more bits from distance code */ + offs = d.destLen - tinf_read_bits(d, dist_bits[dist], dist_base[dist]); + /* copy match */ + for (i = offs; i < offs + length; ++i) { + d.dest[d.destLen++] = d.dest[i]; + } + } + } + } /* inflate an uncompressed block of data */ + + function tinf_inflate_uncompressed_block(d) { + var length, + invlength; + var i; + /* unread from bitbuffer */ + while (d.bitcount > 8) { + d.sourceIndex--; + d.bitcount -= 8; + } /* get length */ + + length = d.source[d.sourceIndex + 1]; + length = 256 * length + d.source[d.sourceIndex]; + /* get one's complement of length */ + invlength = d.source[d.sourceIndex + 3]; + invlength = 256 * invlength + d.source[d.sourceIndex + 2]; + /* check length */ + if (length !== (~invlength & 65535)) { + return TINF_DATA_ERROR; + } + d.sourceIndex += 4; + /* copy block */ + for (i = length; i; --i) { + d.dest[d.destLen++] = d.source[d.sourceIndex++]; + } /* make sure we start next block on a byte boundary */ + + d.bitcount = 0; + return TINF_OK; + } /* inflate stream from source to dest */ + + function tinf_uncompress(source, dest) { + var d = new Data(source, dest); + var bfinal, + btype, + res; + do { + /* read final block flag */ + bfinal = tinf_getbit(d); + /* read block type (2 bits) */ + btype = tinf_read_bits(d, 2, 0); + /* decompress block */ + switch (btype) { + case 0: + /* decompress uncompressed block */ + res = tinf_inflate_uncompressed_block(d); + break; + case 1: + /* decompress block with fixed huffman trees */ + res = tinf_inflate_block_data(d, sltree, sdtree); + break; + case 2: + /* decompress block with dynamic huffman trees */ + tinf_decode_trees(d, d.ltree, d.dtree); + res = tinf_inflate_block_data(d, d.ltree, d.dtree); + break; + default: + res = TINF_DATA_ERROR; + } + if (res !== TINF_OK) { + throw new Error('Data error'); + } + } while (!bfinal); + if (d.destLen < d.dest.length) { + if (typeof d.dest.slice === 'function') { + return d.dest.slice(0, d.destLen); + } else { + return d.dest.subarray(0, d.destLen); + } + } + return d.dest; + } /* -------------------- * + * -- initialization -- * + * -------------------- */ + /* build fixed huffman trees */ + + tinf_build_fixed_trees(sltree, sdtree); + /* build extra bits and base tables */ + tinf_build_bits_base(length_bits, length_base, 4, 3); + tinf_build_bits_base(dist_bits, dist_base, 2, 1); + /* fix a special case */ + length_bits[28] = 0; + length_base[28] = 258; + var tinyInflate = tinf_uncompress; + // The Bounding Box object + function derive(v0, v1, v2, v3, t) { + return Math.pow(1 - t, 3) * v0 + 3 * Math.pow(1 - t, 2) * t * v1 + 3 * (1 - t) * Math.pow(t, 2) * v2 + Math.pow(t, 3) * v3; + } /** + * A bounding box is an enclosing box that describes the smallest measure within which all the points lie. + * It is used to calculate the bounding box of a glyph or text path. + * + * On initialization, x1/y1/x2/y2 will be NaN. Check if the bounding box is empty using `isEmpty()`. + * + * @exports opentype.BoundingBox + * @class + * @constructor + */ + + function BoundingBox() { + this.x1 = Number.NaN; + this.y1 = Number.NaN; + this.x2 = Number.NaN; + this.y2 = Number.NaN; + } /** + * Returns true if the bounding box is empty, that is, no points have been added to the box yet. + */ + + BoundingBox.prototype.isEmpty = function () { + return isNaN(this.x1) || isNaN(this.y1) || isNaN(this.x2) || isNaN(this.y2); + }; + /** + * Add the point to the bounding box. + * The x1/y1/x2/y2 coordinates of the bounding box will now encompass the given point. + * @param {number} x - The X coordinate of the point. + * @param {number} y - The Y coordinate of the point. + */ + BoundingBox.prototype.addPoint = function (x, y) { + if (typeof x === 'number') { + if (isNaN(this.x1) || isNaN(this.x2)) { + this.x1 = x; + this.x2 = x; + } + if (x < this.x1) { + this.x1 = x; + } + if (x > this.x2) { + this.x2 = x; + } + } + if (typeof y === 'number') { + if (isNaN(this.y1) || isNaN(this.y2)) { + this.y1 = y; + this.y2 = y; + } + if (y < this.y1) { + this.y1 = y; + } + if (y > this.y2) { + this.y2 = y; + } + } + }; + /** + * Add a X coordinate to the bounding box. + * This extends the bounding box to include the X coordinate. + * This function is used internally inside of addBezier. + * @param {number} x - The X coordinate of the point. + */ + BoundingBox.prototype.addX = function (x) { + this.addPoint(x, null); + }; + /** + * Add a Y coordinate to the bounding box. + * This extends the bounding box to include the Y coordinate. + * This function is used internally inside of addBezier. + * @param {number} y - The Y coordinate of the point. + */ + BoundingBox.prototype.addY = function (y) { + this.addPoint(null, y); + }; + /** + * Add a Bézier curve to the bounding box. + * This extends the bounding box to include the entire Bézier. + * @param {number} x0 - The starting X coordinate. + * @param {number} y0 - The starting Y coordinate. + * @param {number} x1 - The X coordinate of the first control point. + * @param {number} y1 - The Y coordinate of the first control point. + * @param {number} x2 - The X coordinate of the second control point. + * @param {number} y2 - The Y coordinate of the second control point. + * @param {number} x - The ending X coordinate. + * @param {number} y - The ending Y coordinate. + */ + BoundingBox.prototype.addBezier = function (x0, y0, x1, y1, x2, y2, x, y) { + var this$1 = this; + // This code is based on http://nishiohirokazu.blogspot.com/2009/06/how-to-calculate-bezier-curves-bounding.html + // and https://github.com/icons8/svg-path-bounding-box + var p0 = [ + x0, + y0 + ]; + var p1 = [ + x1, + y1 + ]; + var p2 = [ + x2, + y2 + ]; + var p3 = [ + x, + y + ]; + this.addPoint(x0, y0); + this.addPoint(x, y); + for (var i = 0; i <= 1; i++) { + var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; + var a = - 3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; + var c = 3 * p1[i] - 3 * p0[i]; + if (a === 0) { + if (b === 0) { + continue; + } + var t = - c / b; + if (0 < t && t < 1) { + if (i === 0) { + this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t)); + } + if (i === 1) { + this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t)); + } + } + continue; + } + var b2ac = Math.pow(b, 2) - 4 * c * a; + if (b2ac < 0) { + continue; + } + var t1 = ( - b + Math.sqrt(b2ac)) / (2 * a); + if (0 < t1 && t1 < 1) { + if (i === 0) { + this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t1)); + } + if (i === 1) { + this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t1)); + } + } + var t2 = ( - b - Math.sqrt(b2ac)) / (2 * a); + if (0 < t2 && t2 < 1) { + if (i === 0) { + this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t2)); + } + if (i === 1) { + this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t2)); + } + } + } + }; + /** + * Add a quadratic curve to the bounding box. + * This extends the bounding box to include the entire quadratic curve. + * @param {number} x0 - The starting X coordinate. + * @param {number} y0 - The starting Y coordinate. + * @param {number} x1 - The X coordinate of the control point. + * @param {number} y1 - The Y coordinate of the control point. + * @param {number} x - The ending X coordinate. + * @param {number} y - The ending Y coordinate. + */ + BoundingBox.prototype.addQuad = function (x0, y0, x1, y1, x, y) { + var cp1x = x0 + 2 / 3 * (x1 - x0); + var cp1y = y0 + 2 / 3 * (y1 - y0); + var cp2x = cp1x + 1 / 3 * (x - x0); + var cp2y = cp1y + 1 / 3 * (y - y0); + this.addBezier(x0, y0, cp1x, cp1y, cp2x, cp2y, x, y); + }; + // Geometric objects + /** + * A bézier path containing a set of path commands similar to a SVG path. + * Paths can be drawn on a context using `draw`. + * @exports opentype.Path + * @class + * @constructor + */ + function Path() { + this.commands = [ + ]; + this.fill = 'black'; + this.stroke = null; + this.strokeWidth = 1; + } /** + * @param {number} x + * @param {number} y + */ + + Path.prototype.moveTo = function (x, y) { + this.commands.push({ + type: 'M', + x: x, + y: y + }); + }; + /** + * @param {number} x + * @param {number} y + */ + Path.prototype.lineTo = function (x, y) { + this.commands.push({ + type: 'L', + x: x, + y: y + }); + }; + /** + * Draws cubic curve + * @function + * curveTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control 1 + * @param {number} y1 - y of control 1 + * @param {number} x2 - x of control 2 + * @param {number} y2 - y of control 2 + * @param {number} x - x of path point + * @param {number} y - y of path point + */ + /** + * Draws cubic curve + * @function + * bezierCurveTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control 1 + * @param {number} y1 - y of control 1 + * @param {number} x2 - x of control 2 + * @param {number} y2 - y of control 2 + * @param {number} x - x of path point + * @param {number} y - y of path point + * @see curveTo + */ + Path.prototype.curveTo = Path.prototype.bezierCurveTo = function (x1, y1, x2, y2, x, y) { + this.commands.push({ + type: 'C', + x1: x1, + y1: y1, + x2: x2, + y2: y2, + x: x, + y: y + }); + }; + /** + * Draws quadratic curve + * @function + * quadraticCurveTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control + * @param {number} y1 - y of control + * @param {number} x - x of path point + * @param {number} y - y of path point + */ + /** + * Draws quadratic curve + * @function + * quadTo + * @memberof opentype.Path.prototype + * @param {number} x1 - x of control + * @param {number} y1 - y of control + * @param {number} x - x of path point + * @param {number} y - y of path point + */ + Path.prototype.quadTo = Path.prototype.quadraticCurveTo = function (x1, y1, x, y) { + this.commands.push({ + type: 'Q', + x1: x1, + y1: y1, + x: x, + y: y + }); + }; + /** + * Closes the path + * @function closePath + * @memberof opentype.Path.prototype + */ + /** + * Close the path + * @function close + * @memberof opentype.Path.prototype + */ + Path.prototype.close = Path.prototype.closePath = function () { + this.commands.push({ + type: 'Z' + }); + }; + /** + * Add the given path or list of commands to the commands of this path. + * @param {Array} pathOrCommands - another opentype.Path, an opentype.BoundingBox, or an array of commands. + */ + Path.prototype.extend = function (pathOrCommands) { + if (pathOrCommands.commands) { + pathOrCommands = pathOrCommands.commands; + } else if (pathOrCommands instanceof BoundingBox) { + var box = pathOrCommands; + this.moveTo(box.x1, box.y1); + this.lineTo(box.x2, box.y1); + this.lineTo(box.x2, box.y2); + this.lineTo(box.x1, box.y2); + this.close(); + return; + } + Array.prototype.push.apply(this.commands, pathOrCommands); + }; + /** + * Calculate the bounding box of the path. + * @returns {opentype.BoundingBox} + */ + Path.prototype.getBoundingBox = function () { + var this$1 = this; + var box = new BoundingBox(); + var startX = 0; + var startY = 0; + var prevX = 0; + var prevY = 0; + for (var i = 0; i < this.commands.length; i++) { + var cmd = this$1.commands[i]; + switch (cmd.type) { + case 'M': + box.addPoint(cmd.x, cmd.y); + startX = prevX = cmd.x; + startY = prevY = cmd.y; + break; + case 'L': + box.addPoint(cmd.x, cmd.y); + prevX = cmd.x; + prevY = cmd.y; + break; + case 'Q': + box.addQuad(prevX, prevY, cmd.x1, cmd.y1, cmd.x, cmd.y); + prevX = cmd.x; + prevY = cmd.y; + break; + case 'C': + box.addBezier(prevX, prevY, cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + prevX = cmd.x; + prevY = cmd.y; + break; + case 'Z': + prevX = startX; + prevY = startY; + break; + default: + throw new Error('Unexpected path command ' + cmd.type); + } + } + if (box.isEmpty()) { + box.addPoint(0, 0); + } + return box; + }; + /** + * Draw the path to a 2D context. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context. + */ + Path.prototype.draw = function (ctx) { + var this$1 = this; + ctx.beginPath(); + for (var i = 0; i < this.commands.length; i += 1) { + var cmd = this$1.commands[i]; + if (cmd.type === 'M') { + ctx.moveTo(cmd.x, cmd.y); + } else if (cmd.type === 'L') { + ctx.lineTo(cmd.x, cmd.y); + } else if (cmd.type === 'C') { + ctx.bezierCurveTo(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + } else if (cmd.type === 'Q') { + ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); + } else if (cmd.type === 'Z') { + ctx.closePath(); + } + } + if (this.fill) { + ctx.fillStyle = this.fill; + ctx.fill(); + } + if (this.stroke) { + ctx.strokeStyle = this.stroke; + ctx.lineWidth = this.strokeWidth; + ctx.stroke(); + } + }; + /** + * Convert the Path to a string of path data instructions + * See http://www.w3.org/TR/SVG/paths.html#PathData + * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values + * @return {string} + */ + Path.prototype.toPathData = function (decimalPlaces) { + var this$1 = this; + decimalPlaces = decimalPlaces !== undefined ? decimalPlaces : 2; + function floatToString(v) { + if (Math.round(v) === v) { + return '' + Math.round(v); + } else { + return v.toFixed(decimalPlaces); + } + } + function packValues() { + var arguments$1 = arguments; + var s = ''; + for (var i = 0; i < arguments.length; i += 1) { + var v = arguments$1[i]; + if (v >= 0 && i > 0) { + s += ' '; + } + s += floatToString(v); + } + return s; + } + var d = ''; + for (var i = 0; i < this.commands.length; i += 1) { + var cmd = this$1.commands[i]; + if (cmd.type === 'M') { + d += 'M' + packValues(cmd.x, cmd.y); + } else if (cmd.type === 'L') { + d += 'L' + packValues(cmd.x, cmd.y); + } else if (cmd.type === 'C') { + d += 'C' + packValues(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + } else if (cmd.type === 'Q') { + d += 'Q' + packValues(cmd.x1, cmd.y1, cmd.x, cmd.y); + } else if (cmd.type === 'Z') { + d += 'Z'; + } + } + return d; + }; + /** + * Convert the path to an SVG element, as a string. + * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values + * @return {string} + */ + Path.prototype.toSVG = function (decimalPlaces) { + var svg = '= 0 && v <= 255, 'Byte value should be between 0 and 255.'); + return [v]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.BYTE = constant(1); + /** + * Convert a 8-bit signed integer to a list of 1 byte. + * @param {string} + * @returns {Array} + */ + encode.CHAR = function (v) { + return [v.charCodeAt(0)]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.CHAR = constant(1); + /** + * Convert an ASCII string to a list of bytes. + * @param {string} + * @returns {Array} + */ + encode.CHARARRAY = function (v) { + var b = [ + ]; + for (var i = 0; i < v.length; i += 1) { + b[i] = v.charCodeAt(i); + } + return b; + }; + /** + * @param {Array} + * @returns {number} + */ + sizeOf.CHARARRAY = function (v) { + return v.length; + }; + /** + * Convert a 16-bit unsigned integer to a list of 2 bytes. + * @param {number} + * @returns {Array} + */ + encode.USHORT = function (v) { + return [v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.USHORT = constant(2); + /** + * Convert a 16-bit signed integer to a list of 2 bytes. + * @param {number} + * @returns {Array} + */ + encode.SHORT = function (v) { + // Two's complement + if (v >= LIMIT16) { + v = - (2 * LIMIT16 - v); + } + return [v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.SHORT = constant(2); + /** + * Convert a 24-bit unsigned integer to a list of 3 bytes. + * @param {number} + * @returns {Array} + */ + encode.UINT24 = function (v) { + return [v >> 16 & 255, + v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.UINT24 = constant(3); + /** + * Convert a 32-bit unsigned integer to a list of 4 bytes. + * @param {number} + * @returns {Array} + */ + encode.ULONG = function (v) { + return [v >> 24 & 255, + v >> 16 & 255, + v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.ULONG = constant(4); + /** + * Convert a 32-bit unsigned integer to a list of 4 bytes. + * @param {number} + * @returns {Array} + */ + encode.LONG = function (v) { + // Two's complement + if (v >= LIMIT32) { + v = - (2 * LIMIT32 - v); + } + return [v >> 24 & 255, + v >> 16 & 255, + v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.LONG = constant(4); + encode.FIXED = encode.ULONG; + sizeOf.FIXED = sizeOf.ULONG; + encode.FWORD = encode.SHORT; + sizeOf.FWORD = sizeOf.SHORT; + encode.UFWORD = encode.USHORT; + sizeOf.UFWORD = sizeOf.USHORT; + /** + * Convert a 32-bit Apple Mac timestamp integer to a list of 8 bytes, 64-bit timestamp. + * @param {number} + * @returns {Array} + */ + encode.LONGDATETIME = function (v) { + return [0, + 0, + 0, + 0, + v >> 24 & 255, + v >> 16 & 255, + v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.LONGDATETIME = constant(8); + /** + * Convert a 4-char tag to a list of 4 bytes. + * @param {string} + * @returns {Array} + */ + encode.TAG = function (v) { + check.argument(v.length === 4, 'Tag should be exactly 4 ASCII characters.'); + return [v.charCodeAt(0), + v.charCodeAt(1), + v.charCodeAt(2), + v.charCodeAt(3)]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.TAG = constant(4); + // CFF data types /////////////////////////////////////////////////////////// + encode.Card8 = encode.BYTE; + sizeOf.Card8 = sizeOf.BYTE; + encode.Card16 = encode.USHORT; + sizeOf.Card16 = sizeOf.USHORT; + encode.OffSize = encode.BYTE; + sizeOf.OffSize = sizeOf.BYTE; + encode.SID = encode.USHORT; + sizeOf.SID = sizeOf.USHORT; + // Convert a numeric operand or charstring number to a variable-size list of bytes. + /** + * Convert a numeric operand or charstring number to a variable-size list of bytes. + * @param {number} + * @returns {Array} + */ + encode.NUMBER = function (v) { + if (v >= - 107 && v <= 107) { + return [v + 139]; + } else if (v >= 108 && v <= 1131) { + v = v - 108; + return [(v >> 8) + 247, + v & 255]; + } else if (v >= - 1131 && v <= - 108) { + v = - v - 108; + return [(v >> 8) + 251, + v & 255]; + } else if (v >= - 32768 && v <= 32767) { + return encode.NUMBER16(v); + } else { + return encode.NUMBER32(v); + } + }; + /** + * @param {number} + * @returns {number} + */ + sizeOf.NUMBER = function (v) { + return encode.NUMBER(v).length; + }; + /** + * Convert a signed number between -32768 and +32767 to a three-byte value. + * This ensures we always use three bytes, but is not the most compact format. + * @param {number} + * @returns {Array} + */ + encode.NUMBER16 = function (v) { + return [28, + v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.NUMBER16 = constant(3); + /** + * Convert a signed number between -(2^31) and +(2^31-1) to a five-byte value. + * This is useful if you want to be sure you always use four bytes, + * at the expense of wasting a few bytes for smaller numbers. + * @param {number} + * @returns {Array} + */ + encode.NUMBER32 = function (v) { + return [29, + v >> 24 & 255, + v >> 16 & 255, + v >> 8 & 255, + v & 255]; + }; + /** + * @constant + * @type {number} + */ + sizeOf.NUMBER32 = constant(5); + /** + * @param {number} + * @returns {Array} + */ + encode.REAL = function (v) { + var value = v.toString(); + // Some numbers use an epsilon to encode the value. (e.g. JavaScript will store 0.0000001 as 1e-7) + // This code converts it back to a number without the epsilon. + var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); + if (m) { + var epsilon = parseFloat('1e' + ((m[2] ? + m[2] : 0) + m[1].length)); + value = (Math.round(v * epsilon) / epsilon).toString(); + } + var nibbles = ''; + for (var i = 0, ii = value.length; i < ii; i += 1) { + var c = value[i]; + if (c === 'e') { + nibbles += value[++i] === '-' ? 'c' : 'b'; + } else if (c === '.') { + nibbles += 'a'; + } else if (c === '-') { + nibbles += 'e'; + } else { + nibbles += c; + } + } + nibbles += nibbles.length & 1 ? 'f' : 'ff'; + var out = [ + 30 + ]; + for (var i$1 = 0, ii$1 = nibbles.length; i$1 < ii$1; i$1 += 2) { + out.push(parseInt(nibbles.substr(i$1, 2), 16)); + } + return out; + }; + /** + * @param {number} + * @returns {number} + */ + sizeOf.REAL = function (v) { + return encode.REAL(v).length; + }; + encode.NAME = encode.CHARARRAY; + sizeOf.NAME = sizeOf.CHARARRAY; + encode.STRING = encode.CHARARRAY; + sizeOf.STRING = sizeOf.CHARARRAY; + /** + * @param {DataView} data + * @param {number} offset + * @param {number} numBytes + * @returns {string} + */ + decode.UTF8 = function (data, offset, numBytes) { + var codePoints = [ + ]; + var numChars = numBytes; + for (var j = 0; j < numChars; j++, offset += 1) { + codePoints[j] = data.getUint8(offset); + } + return String.fromCharCode.apply(null, codePoints); + }; + /** + * @param {DataView} data + * @param {number} offset + * @param {number} numBytes + * @returns {string} + */ + decode.UTF16 = function (data, offset, numBytes) { + var codePoints = [ + ]; + var numChars = numBytes / 2; + for (var j = 0; j < numChars; j++, offset += 2) { + codePoints[j] = data.getUint16(offset); + } + return String.fromCharCode.apply(null, codePoints); + }; + /** + * Convert a JavaScript string to UTF16-BE. + * @param {string} + * @returns {Array} + */ + encode.UTF16 = function (v) { + var b = [ + ]; + for (var i = 0; i < v.length; i += 1) { + var codepoint = v.charCodeAt(i); + b[b.length] = codepoint >> 8 & 255; + b[b.length] = codepoint & 255; + } + return b; + }; + /** + * @param {string} + * @returns {number} + */ + sizeOf.UTF16 = function (v) { + return v.length * 2; + }; + // Data for converting old eight-bit Macintosh encodings to Unicode. + // This representation is optimized for decoding; encoding is slower + // and needs more memory. The assumption is that all opentype.js users + // want to open fonts, but saving a font will be comparatively rare + // so it can be more expensive. Keyed by IANA character set name. + // + // Python script for generating these strings: + // + // s = u''.join([chr(c).decode('mac_greek') for c in range(128, 256)]) + // print(s.encode('utf-8')) + /** + * @private + */ + var eightBitMacEncodings = { + 'x-mac-croatian': // Python: 'mac_croatian' + 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø' + '¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ', + 'x-mac-cyrillic': // Python: 'mac_cyrillic' + 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњ' + 'јЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю', + 'x-mac-gaelic': // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/GAELIC.TXT + 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæø' + 'ṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ', + 'x-mac-greek': // Python: 'mac_greek' + 'Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩ' + 'άΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­', + 'x-mac-icelandic': // Python: 'mac_iceland' + 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ', + 'x-mac-inuit': // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/INUIT.TXT + 'ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗ' + 'ᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł', + 'x-mac-ce': // Python: 'mac_latin2' + 'ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅ' + 'ņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ', + macintosh: // Python: 'mac_roman' + 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ', + 'x-mac-romanian': // Python: 'mac_romanian' + 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ', + 'x-mac-turkish': // Python: 'mac_turkish' + 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø' + '¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ' + }; + /** + * Decodes an old-style Macintosh string. Returns either a Unicode JavaScript + * string, or 'undefined' if the encoding is unsupported. For example, we do + * not support Chinese, Japanese or Korean because these would need large + * mapping tables. + * @param {DataView} dataView + * @param {number} offset + * @param {number} dataLength + * @param {string} encoding + * @returns {string} + */ + decode.MACSTRING = function (dataView, offset, dataLength, encoding) { + var table = eightBitMacEncodings[encoding]; + if (table === undefined) { + return undefined; + } + var result = ''; + for (var i = 0; i < dataLength; i++) { + var c = dataView.getUint8(offset + i); + // In all eight-bit Mac encodings, the characters 0x00..0x7F are + // mapped to U+0000..U+007F; we only need to look up the others. + if (c <= 127) { + result += String.fromCharCode(c); + } else { + result += table[c & 127]; + } + } + return result; + }; + // Helper function for encode.MACSTRING. Returns a dictionary for mapping + // Unicode character codes to their 8-bit MacOS equivalent. This table + // is not exactly a super cheap data structure, but we do not care because + // encoding Macintosh strings is only rarely needed in typical applications. + var macEncodingTableCache = typeof WeakMap === 'function' && new WeakMap(); + var macEncodingCacheKeys; + var getMacEncodingTable = function (encoding) { + // Since we use encoding as a cache key for WeakMap, it has to be + // a String object and not a literal. And at least on NodeJS 2.10.1, + // WeakMap requires that the same String instance is passed for cache hits. + if (!macEncodingCacheKeys) { + macEncodingCacheKeys = { + }; + for (var e in eightBitMacEncodings) { + /*jshint -W053 */ // Suppress "Do not use String as a constructor." + macEncodingCacheKeys[e] = new String(e); + } + } + var cacheKey = macEncodingCacheKeys[encoding]; + if (cacheKey === undefined) { + return undefined; + } // We can't do "if (cache.has(key)) {return cache.get(key)}" here: + // since garbage collection may run at any time, it could also kick in + // between the calls to cache.has() and cache.get(). In that case, + // we would return 'undefined' even though we do support the encoding. + + if (macEncodingTableCache) { + var cachedTable = macEncodingTableCache.get(cacheKey); + if (cachedTable !== undefined) { + return cachedTable; + } + } + var decodingTable = eightBitMacEncodings[encoding]; + if (decodingTable === undefined) { + return undefined; + } + var encodingTable = { + }; + for (var i = 0; i < decodingTable.length; i++) { + encodingTable[decodingTable.charCodeAt(i)] = i + 128; + } + if (macEncodingTableCache) { + macEncodingTableCache.set(cacheKey, encodingTable); + } + return encodingTable; + }; + /** + * Encodes an old-style Macintosh string. Returns a byte array upon success. + * If the requested encoding is unsupported, or if the input string contains + * a character that cannot be expressed in the encoding, the function returns + * 'undefined'. + * @param {string} str + * @param {string} encoding + * @returns {Array} + */ + encode.MACSTRING = function (str, encoding) { + var table = getMacEncodingTable(encoding); + if (table === undefined) { + return undefined; + } + var result = [ + ]; + for (var i = 0; i < str.length; i++) { + var c = str.charCodeAt(i); + // In all eight-bit Mac encodings, the characters 0x00..0x7F are + // mapped to U+0000..U+007F; we only need to look up the others. + if (c >= 128) { + c = table[c]; + if (c === undefined) { + // str contains a Unicode character that cannot be encoded + // in the requested encoding. + return undefined; + } + } + result[i] = c; + // result.push(c); + } + return result; + }; + /** + * @param {string} str + * @param {string} encoding + * @returns {number} + */ + sizeOf.MACSTRING = function (str, encoding) { + var b = encode.MACSTRING(str, encoding); + if (b !== undefined) { + return b.length; + } else { + return 0; + } + }; + // Helper for encode.VARDELTAS + function isByteEncodable(value) { + return value >= - 128 && value <= 127; + } // Helper for encode.VARDELTAS + + function encodeVarDeltaRunAsZeroes(deltas, pos, result) { + var runLength = 0; + var numDeltas = deltas.length; + while (pos < numDeltas && runLength < 64 && deltas[pos] === 0) { + ++pos; + ++runLength; + } + result.push(128 | runLength - 1); + return pos; + } // Helper for encode.VARDELTAS + + function encodeVarDeltaRunAsBytes(deltas, offset, result) { + var runLength = 0; + var numDeltas = deltas.length; + var pos = offset; + while (pos < numDeltas && runLength < 64) { + var value = deltas[pos]; + if (!isByteEncodable(value)) { + break; + } // Within a byte-encoded run of deltas, a single zero is best + // stored literally as 0x00 value. However, if we have two or + // more zeroes in a sequence, it is better to start a new run. + // Fore example, the sequence of deltas [15, 15, 0, 15, 15] + // becomes 6 bytes (04 0F 0F 00 0F 0F) when storing the zero + // within the current run, but 7 bytes (01 0F 0F 80 01 0F 0F) + // when starting a new run. + + if (value === 0 && pos + 1 < numDeltas && deltas[pos + 1] === 0) { + break; + } + ++pos; + ++runLength; + } + result.push(runLength - 1); + for (var i = offset; i < pos; ++i) { + result.push(deltas[i] + 256 & 255); + } + return pos; + } // Helper for encode.VARDELTAS + + function encodeVarDeltaRunAsWords(deltas, offset, result) { + var runLength = 0; + var numDeltas = deltas.length; + var pos = offset; + while (pos < numDeltas && runLength < 64) { + var value = deltas[pos]; + // Within a word-encoded run of deltas, it is easiest to start + // a new run (with a different encoding) whenever we encounter + // a zero value. For example, the sequence [0x6666, 0, 0x7777] + // needs 7 bytes when storing the zero inside the current run + // (42 66 66 00 00 77 77), and equally 7 bytes when starting a + // new run (40 66 66 80 40 77 77). + if (value === 0) { + break; + } // Within a word-encoded run of deltas, a single value in the + // range (-128..127) should be encoded within the current run + // because it is more compact. For example, the sequence + // [0x6666, 2, 0x7777] becomes 7 bytes when storing the value + // literally (42 66 66 00 02 77 77), but 8 bytes when starting + // a new run (40 66 66 00 02 40 77 77). + + if (isByteEncodable(value) && pos + 1 < numDeltas && isByteEncodable(deltas[pos + 1])) { + break; + } + ++pos; + ++runLength; + } + result.push(64 | runLength - 1); + for (var i = offset; i < pos; ++i) { + var val = deltas[i]; + result.push(val + 65536 >> 8 & 255, val + 256 & 255); + } + return pos; + } /** + * Encode a list of variation adjustment deltas. + * + * Variation adjustment deltas are used in ‘gvar’ and ‘cvar’ tables. + * They indicate how points (in ‘gvar’) or values (in ‘cvar’) get adjusted + * when generating instances of variation fonts. + * + * @see https://www.microsoft.com/typography/otspec/gvar.htm + * @see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gvar.html + * @param {Array} + * @return {Array} + */ + + encode.VARDELTAS = function (deltas) { + var pos = 0; + var result = [ + ]; + while (pos < deltas.length) { + var value = deltas[pos]; + if (value === 0) { + pos = encodeVarDeltaRunAsZeroes(deltas, pos, result); + } else if (value >= - 128 && value <= 127) { + pos = encodeVarDeltaRunAsBytes(deltas, pos, result); + } else { + pos = encodeVarDeltaRunAsWords(deltas, pos, result); + } + } + return result; + }; + // Convert a list of values to a CFF INDEX structure. + // The values should be objects containing name / type / value. + /** + * @param {Array} l + * @returns {Array} + */ + encode.INDEX = function (l) { + //var offset, offsets, offsetEncoder, encodedOffsets, encodedOffset, data, + // i, v; + // Because we have to know which data type to use to encode the offsets, + // we have to go through the values twice: once to encode the data and + // calculate the offsets, then again to encode the offsets using the fitting data type. + var offset = 1; // First offset is always 1. + var offsets = [ + offset + ]; + var data = [ + ]; + for (var i = 0; i < l.length; i += 1) { + var v = encode.OBJECT(l[i]); + Array.prototype.push.apply(data, v); + offset += v.length; + offsets.push(offset); + } + if (data.length === 0) { + return [0, + 0]; + } + var encodedOffsets = [ + ]; + var offSize = 1 + Math.floor(Math.log(offset) / Math.log(2)) / 8 | 0; + var offsetEncoder = [ + undefined, + encode.BYTE, + encode.USHORT, + encode.UINT24, + encode.ULONG + ][offSize]; + for (var i$1 = 0; i$1 < offsets.length; i$1 += 1) { + var encodedOffset = offsetEncoder(offsets[i$1]); + Array.prototype.push.apply(encodedOffsets, encodedOffset); + } + return Array.prototype.concat(encode.Card16(l.length), encode.OffSize(offSize), encodedOffsets, data); + }; + /** + * @param {Array} + * @returns {number} + */ + sizeOf.INDEX = function (v) { + return encode.INDEX(v).length; + }; + /** + * Convert an object to a CFF DICT structure. + * The keys should be numeric. + * The values should be objects containing name / type / value. + * @param {Object} m + * @returns {Array} + */ + encode.DICT = function (m) { + var d = [ + ]; + var keys = Object.keys(m); + var length = keys.length; + for (var i = 0; i < length; i += 1) { + // Object.keys() return string keys, but our keys are always numeric. + var k = parseInt(keys[i], 0); + var v = m[k]; + // Value comes before the key. + d = d.concat(encode.OPERAND(v.value, v.type)); + d = d.concat(encode.OPERATOR(k)); + } + return d; + }; + /** + * @param {Object} + * @returns {number} + */ + sizeOf.DICT = function (m) { + return encode.DICT(m).length; + }; + /** + * @param {number} + * @returns {Array} + */ + encode.OPERATOR = function (v) { + if (v < 1200) { + return [v]; + } else { + return [12, + v - 1200]; + } + }; + /** + * @param {Array} v + * @param {string} + * @returns {Array} + */ + encode.OPERAND = function (v, type) { + var d = [ + ]; + if (Array.isArray(type)) { + for (var i = 0; i < type.length; i += 1) { + check.argument(v.length === type.length, 'Not enough arguments given for type' + type); + d = d.concat(encode.OPERAND(v[i], type[i])); + } + } else { + if (type === 'SID') { + d = d.concat(encode.NUMBER(v)); + } else if (type === 'offset') { + // We make it easy for ourselves and always encode offsets as + // 4 bytes. This makes offset calculation for the top dict easier. + d = d.concat(encode.NUMBER32(v)); + } else if (type === 'number') { + d = d.concat(encode.NUMBER(v)); + } else if (type === 'real') { + d = d.concat(encode.REAL(v)); + } else { + throw new Error('Unknown operand type ' + type); + // FIXME Add support for booleans + } + } + return d; + }; + encode.OP = encode.BYTE; + sizeOf.OP = sizeOf.BYTE; + // memoize charstring encoding using WeakMap if available + var wmm = typeof WeakMap === 'function' && new WeakMap(); + /** + * Convert a list of CharString operations to bytes. + * @param {Array} + * @returns {Array} + */ + encode.CHARSTRING = function (ops) { + // See encode.MACSTRING for why we don't do "if (wmm && wmm.has(ops))". + if (wmm) { + var cachedValue = wmm.get(ops); + if (cachedValue !== undefined) { + return cachedValue; + } + } + var d = [ + ]; + var length = ops.length; + for (var i = 0; i < length; i += 1) { + var op = ops[i]; + d = d.concat(encode[op.type](op.value)); + } + if (wmm) { + wmm.set(ops, d); + } + return d; + }; + /** + * @param {Array} + * @returns {number} + */ + sizeOf.CHARSTRING = function (ops) { + return encode.CHARSTRING(ops).length; + }; + // Utility functions //////////////////////////////////////////////////////// + /** + * Convert an object containing name / type / value to bytes. + * @param {Object} + * @returns {Array} + */ + encode.OBJECT = function (v) { + var encodingFunction = encode[v.type]; + check.argument(encodingFunction !== undefined, 'No encoding function for type ' + v.type); + return encodingFunction(v.value); + }; + /** + * @param {Object} + * @returns {number} + */ + sizeOf.OBJECT = function (v) { + var sizeOfFunction = sizeOf[v.type]; + check.argument(sizeOfFunction !== undefined, 'No sizeOf function for type ' + v.type); + return sizeOfFunction(v.value); + }; + /** + * Convert a table object to bytes. + * A table contains a list of fields containing the metadata (name, type and default value). + * The table itself has the field values set as attributes. + * @param {opentype.Table} + * @returns {Array} + */ + encode.TABLE = function (table) { + var d = [ + ]; + var length = table.fields.length; + var subtables = [ + ]; + var subtableOffsets = [ + ]; + for (var i = 0; i < length; i += 1) { + var field = table.fields[i]; + var encodingFunction = encode[field.type]; + check.argument(encodingFunction !== undefined, 'No encoding function for field type ' + field.type + ' (' + field.name + ')'); + var value = table[field.name]; + if (value === undefined) { + value = field.value; + } + var bytes = encodingFunction(value); + if (field.type === 'TABLE') { + subtableOffsets.push(d.length); + d = d.concat([0, + 0]); + subtables.push(bytes); + } else { + d = d.concat(bytes); + } + } + for (var i$1 = 0; i$1 < subtables.length; i$1 += 1) { + var o = subtableOffsets[i$1]; + var offset = d.length; + check.argument(offset < 65536, 'Table ' + table.tableName + ' too big.'); + d[o] = offset >> 8; + d[o + 1] = offset & 255; + d = d.concat(subtables[i$1]); + } + return d; + }; + /** + * @param {opentype.Table} + * @returns {number} + */ + sizeOf.TABLE = function (table) { + var numBytes = 0; + var length = table.fields.length; + for (var i = 0; i < length; i += 1) { + var field = table.fields[i]; + var sizeOfFunction = sizeOf[field.type]; + check.argument(sizeOfFunction !== undefined, 'No sizeOf function for field type ' + field.type + ' (' + field.name + ')'); + var value = table[field.name]; + if (value === undefined) { + value = field.value; + } + numBytes += sizeOfFunction(value); + // Subtables take 2 more bytes for offsets. + if (field.type === 'TABLE') { + numBytes += 2; + } + } + return numBytes; + }; + encode.RECORD = encode.TABLE; + sizeOf.RECORD = sizeOf.TABLE; + // Merge in a list of bytes. + encode.LITERAL = function (v) { + return v; + }; + sizeOf.LITERAL = function (v) { + return v.length; + }; + // Table metadata + /** + * @exports opentype.Table + * @class + * @param {string} tableName + * @param {Array} fields + * @param {Object} options + * @constructor + */ + function Table(tableName, fields, options) { + var this$1 = this; + for (var i = 0; i < fields.length; i += 1) { + var field = fields[i]; + this$1[field.name] = field.value; + } + this.tableName = tableName; + this.fields = fields; + if (options) { + var optionKeys = Object.keys(options); + for (var i$1 = 0; i$1 < optionKeys.length; i$1 += 1) { + var k = optionKeys[i$1]; + var v = options[k]; + if (this$1[k] !== undefined) { + this$1[k] = v; + } + } + } + } /** + * Encodes the table and returns an array of bytes + * @return {Array} + */ + + Table.prototype.encode = function () { + return encode.TABLE(this); + }; + /** + * Get the size of the table. + * @return {number} + */ + Table.prototype.sizeOf = function () { + return sizeOf.TABLE(this); + }; + /** + * @private + */ + function ushortList(itemName, list, count) { + if (count === undefined) { + count = list.length; + } + var fields = new Array(list.length + 1); + fields[0] = { + name: itemName + 'Count', + type: 'USHORT', + value: count + }; + for (var i = 0; i < list.length; i++) { + fields[i + 1] = { + name: itemName + i, + type: 'USHORT', + value: list[i] + }; + } + return fields; + } /** + * @private + */ + + function tableList(itemName, records, itemCallback) { + var count = records.length; + var fields = new Array(count + 1); + fields[0] = { + name: itemName + 'Count', + type: 'USHORT', + value: count + }; + for (var i = 0; i < count; i++) { + fields[i + 1] = { + name: itemName + i, + type: 'TABLE', + value: itemCallback(records[i], i) + }; + } + return fields; + } /** + * @private + */ + + function recordList(itemName, records, itemCallback) { + var count = records.length; + var fields = [ + ]; + fields[0] = { + name: itemName + 'Count', + type: 'USHORT', + value: count + }; + for (var i = 0; i < count; i++) { + fields = fields.concat(itemCallback(records[i], i)); + } + return fields; + } // Common Layout Tables + /** + * @exports opentype.Coverage + * @class + * @param {opentype.Table} + * @constructor + * @extends opentype.Table + */ + + function Coverage(coverageTable) { + if (coverageTable.format === 1) { + Table.call(this, 'coverageTable', [ + { + name: 'coverageFormat', + type: 'USHORT', + value: 1 + } + ].concat(ushortList('glyph', coverageTable.glyphs))); + } else { + check.assert(false, 'Can\'t create coverage table format 2 yet.'); + } + } + Coverage.prototype = Object.create(Table.prototype); + Coverage.prototype.constructor = Coverage; + function ScriptList(scriptListTable) { + Table.call(this, 'scriptListTable', recordList('scriptRecord', scriptListTable, function (scriptRecord, i) { + var script = scriptRecord.script; + var defaultLangSys = script.defaultLangSys; + check.assert(!!defaultLangSys, 'Unable to write GSUB: script ' + scriptRecord.tag + ' has no default language system.'); + return [{ + name: 'scriptTag' + i, + type: 'TAG', + value: scriptRecord.tag + }, + { + name: 'script' + i, + type: 'TABLE', + value: new Table('scriptTable', [ + { + name: 'defaultLangSys', + type: 'TABLE', + value: new Table('defaultLangSys', [ + { + name: 'lookupOrder', + type: 'USHORT', + value: 0 + }, + { + name: 'reqFeatureIndex', + type: 'USHORT', + value: defaultLangSys.reqFeatureIndex + } + ].concat(ushortList('featureIndex', defaultLangSys.featureIndexes))) + } + ].concat(recordList('langSys', script.langSysRecords, function (langSysRecord, i) { + var langSys = langSysRecord.langSys; + return [{ + name: 'langSysTag' + i, + type: 'TAG', + value: langSysRecord.tag + }, + { + name: 'langSys' + i, + type: 'TABLE', + value: new Table('langSys', [ + { + name: 'lookupOrder', + type: 'USHORT', + value: 0 + }, + { + name: 'reqFeatureIndex', + type: 'USHORT', + value: langSys.reqFeatureIndex + } + ].concat(ushortList('featureIndex', langSys.featureIndexes))) + } + ]; + }))) + } + ]; + })); + } + ScriptList.prototype = Object.create(Table.prototype); + ScriptList.prototype.constructor = ScriptList; + /** + * @exports opentype.FeatureList + * @class + * @param {opentype.Table} + * @constructor + * @extends opentype.Table + */ + function FeatureList(featureListTable) { + Table.call(this, 'featureListTable', recordList('featureRecord', featureListTable, function (featureRecord, i) { + var feature = featureRecord.feature; + return [{ + name: 'featureTag' + i, + type: 'TAG', + value: featureRecord.tag + }, + { + name: 'feature' + i, + type: 'TABLE', + value: new Table('featureTable', [ + { + name: 'featureParams', + type: 'USHORT', + value: feature.featureParams + } + ].concat(ushortList('lookupListIndex', feature.lookupListIndexes))) + } + ]; + })); + } + FeatureList.prototype = Object.create(Table.prototype); + FeatureList.prototype.constructor = FeatureList; + /** + * @exports opentype.LookupList + * @class + * @param {opentype.Table} + * @param {Object} + * @constructor + * @extends opentype.Table + */ + function LookupList(lookupListTable, subtableMakers) { + Table.call(this, 'lookupListTable', tableList('lookup', lookupListTable, function (lookupTable) { + var subtableCallback = subtableMakers[lookupTable.lookupType]; + check.assert(!!subtableCallback, 'Unable to write GSUB lookup type ' + lookupTable.lookupType + ' tables.'); + return new Table('lookupTable', [ + { + name: 'lookupType', + type: 'USHORT', + value: lookupTable.lookupType + }, + { + name: 'lookupFlag', + type: 'USHORT', + value: lookupTable.lookupFlag + } + ].concat(tableList('subtable', lookupTable.subtables, subtableCallback))); + })); + } + LookupList.prototype = Object.create(Table.prototype); + LookupList.prototype.constructor = LookupList; + // Record = same as Table, but inlined (a Table has an offset and its data is further in the stream) + // Don't use offsets inside Records (probable bug), only in Tables. + var table = { + Table: Table, + Record: Table, + Coverage: Coverage, + ScriptList: ScriptList, + FeatureList: FeatureList, + LookupList: LookupList, + ushortList: ushortList, + tableList: tableList, + recordList: recordList + }; + // Parsing utility functions + // Retrieve an unsigned byte from the DataView. + function getByte(dataView, offset) { + return dataView.getUint8(offset); + } // Retrieve an unsigned 16-bit short from the DataView. + // The value is stored in big endian. + + function getUShort(dataView, offset) { + return dataView.getUint16(offset, false); + } // Retrieve a signed 16-bit short from the DataView. + // The value is stored in big endian. + + function getShort(dataView, offset) { + return dataView.getInt16(offset, false); + } // Retrieve an unsigned 32-bit long from the DataView. + // The value is stored in big endian. + + function getULong(dataView, offset) { + return dataView.getUint32(offset, false); + } // Retrieve a 32-bit signed fixed-point number (16.16) from the DataView. + // The value is stored in big endian. + + function getFixed(dataView, offset) { + var decimal = dataView.getInt16(offset, false); + var fraction = dataView.getUint16(offset + 2, false); + return decimal + fraction / 65535; + } // Retrieve a 4-character tag from the DataView. + // Tags are used to identify tables. + + function getTag(dataView, offset) { + var tag = ''; + for (var i = offset; i < offset + 4; i += 1) { + tag += String.fromCharCode(dataView.getInt8(i)); + } + return tag; + } // Retrieve an offset from the DataView. + // Offsets are 1 to 4 bytes in length, depending on the offSize argument. + + function getOffset(dataView, offset, offSize) { + var v = 0; + for (var i = 0; i < offSize; i += 1) { + v <<= 8; + v += dataView.getUint8(offset + i); + } + return v; + } // Retrieve a number of bytes from start offset to the end offset from the DataView. + + function getBytes(dataView, startOffset, endOffset) { + var bytes = [ + ]; + for (var i = startOffset; i < endOffset; i += 1) { + bytes.push(dataView.getUint8(i)); + } + return bytes; + } // Convert the list of bytes to a string. + + function bytesToString(bytes) { + var s = ''; + for (var i = 0; i < bytes.length; i += 1) { + s += String.fromCharCode(bytes[i]); + } + return s; + } + var typeOffsets = { + byte: 1, + uShort: 2, + short: 2, + uLong: 4, + fixed: 4, + longDateTime: 8, + tag: 4 + }; + // A stateful parser that changes the offset whenever a value is retrieved. + // The data is a DataView. + function Parser(data, offset) { + this.data = data; + this.offset = offset; + this.relativeOffset = 0; + } + Parser.prototype.parseByte = function () { + var v = this.data.getUint8(this.offset + this.relativeOffset); + this.relativeOffset += 1; + return v; + }; + Parser.prototype.parseChar = function () { + var v = this.data.getInt8(this.offset + this.relativeOffset); + this.relativeOffset += 1; + return v; + }; + Parser.prototype.parseCard8 = Parser.prototype.parseByte; + Parser.prototype.parseUShort = function () { + var v = this.data.getUint16(this.offset + this.relativeOffset); + this.relativeOffset += 2; + return v; + }; + Parser.prototype.parseCard16 = Parser.prototype.parseUShort; + Parser.prototype.parseSID = Parser.prototype.parseUShort; + Parser.prototype.parseOffset16 = Parser.prototype.parseUShort; + Parser.prototype.parseShort = function () { + var v = this.data.getInt16(this.offset + this.relativeOffset); + this.relativeOffset += 2; + return v; + }; + Parser.prototype.parseF2Dot14 = function () { + var v = this.data.getInt16(this.offset + this.relativeOffset) / 16384; + this.relativeOffset += 2; + return v; + }; + Parser.prototype.parseULong = function () { + var v = getULong(this.data, this.offset + this.relativeOffset); + this.relativeOffset += 4; + return v; + }; + Parser.prototype.parseOffset32 = Parser.prototype.parseULong; + Parser.prototype.parseFixed = function () { + var v = getFixed(this.data, this.offset + this.relativeOffset); + this.relativeOffset += 4; + return v; + }; + Parser.prototype.parseString = function (length) { + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + var string = ''; + this.relativeOffset += length; + for (var i = 0; i < length; i++) { + string += String.fromCharCode(dataView.getUint8(offset + i)); + } + return string; + }; + Parser.prototype.parseTag = function () { + return this.parseString(4); + }; + // LONGDATETIME is a 64-bit integer. + // JavaScript and unix timestamps traditionally use 32 bits, so we + // only take the last 32 bits. + // + Since until 2038 those bits will be filled by zeros we can ignore them. + Parser.prototype.parseLongDateTime = function () { + var v = getULong(this.data, this.offset + this.relativeOffset + 4); + // Subtract seconds between 01/01/1904 and 01/01/1970 + // to convert Apple Mac timestamp to Standard Unix timestamp + v -= 2082844800; + this.relativeOffset += 8; + return v; + }; + Parser.prototype.parseVersion = function (minorBase) { + var major = getUShort(this.data, this.offset + this.relativeOffset); + // How to interpret the minor version is very vague in the spec. 0x5000 is 5, 0x1000 is 1 + // Default returns the correct number if minor = 0xN000 where N is 0-9 + // Set minorBase to 1 for tables that use minor = N where N is 0-9 + var minor = getUShort(this.data, this.offset + this.relativeOffset + 2); + this.relativeOffset += 4; + if (minorBase === undefined) { + minorBase = 4096; + } + return major + minor / minorBase / 10; + }; + Parser.prototype.skip = function (type, amount) { + if (amount === undefined) { + amount = 1; + } + this.relativeOffset += typeOffsets[type] * amount; + }; + ///// Parsing lists and records /////////////////////////////// + // Parse a list of 32 bit unsigned integers. + Parser.prototype.parseULongList = function (count) { + if (count === undefined) { + count = this.parseULong(); + } + var offsets = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + offsets[i] = dataView.getUint32(offset); + offset += 4; + } + this.relativeOffset += count * 4; + return offsets; + }; + // Parse a list of 16 bit unsigned integers. The length of the list can be read on the stream + // or provided as an argument. + Parser.prototype.parseOffset16List = Parser.prototype.parseUShortList = function (count) { + if (count === undefined) { + count = this.parseUShort(); + } + var offsets = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + offsets[i] = dataView.getUint16(offset); + offset += 2; + } + this.relativeOffset += count * 2; + return offsets; + }; + // Parses a list of 16 bit signed integers. + Parser.prototype.parseShortList = function (count) { + var list = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + list[i] = dataView.getInt16(offset); + offset += 2; + } + this.relativeOffset += count * 2; + return list; + }; + // Parses a list of bytes. + Parser.prototype.parseByteList = function (count) { + var list = new Array(count); + var dataView = this.data; + var offset = this.offset + this.relativeOffset; + for (var i = 0; i < count; i++) { + list[i] = dataView.getUint8(offset++); + } + this.relativeOffset += count; + return list; + }; + /** + * Parse a list of items. + * Record count is optional, if omitted it is read from the stream. + * itemCallback is one of the Parser methods. + */ + Parser.prototype.parseList = function (count, itemCallback) { + var this$1 = this; + if (!itemCallback) { + itemCallback = count; + count = this.parseUShort(); + } + var list = new Array(count); + for (var i = 0; i < count; i++) { + list[i] = itemCallback.call(this$1); + } + return list; + }; + Parser.prototype.parseList32 = function (count, itemCallback) { + var this$1 = this; + if (!itemCallback) { + itemCallback = count; + count = this.parseULong(); + } + var list = new Array(count); + for (var i = 0; i < count; i++) { + list[i] = itemCallback.call(this$1); + } + return list; + }; + /** + * Parse a list of records. + * Record count is optional, if omitted it is read from the stream. + * Example of recordDescription: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } + */ + Parser.prototype.parseRecordList = function (count, recordDescription) { + var this$1 = this; + // If the count argument is absent, read it in the stream. + if (!recordDescription) { + recordDescription = count; + count = this.parseUShort(); + } + var records = new Array(count); + var fields = Object.keys(recordDescription); + for (var i = 0; i < count; i++) { + var rec = { + }; + for (var j = 0; j < fields.length; j++) { + var fieldName = fields[j]; + var fieldType = recordDescription[fieldName]; + rec[fieldName] = fieldType.call(this$1); + } + records[i] = rec; + } + return records; + }; + Parser.prototype.parseRecordList32 = function (count, recordDescription) { + var this$1 = this; + // If the count argument is absent, read it in the stream. + if (!recordDescription) { + recordDescription = count; + count = this.parseULong(); + } + var records = new Array(count); + var fields = Object.keys(recordDescription); + for (var i = 0; i < count; i++) { + var rec = { + }; + for (var j = 0; j < fields.length; j++) { + var fieldName = fields[j]; + var fieldType = recordDescription[fieldName]; + rec[fieldName] = fieldType.call(this$1); + } + records[i] = rec; + } + return records; + }; + // Parse a data structure into an object + // Example of description: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } + Parser.prototype.parseStruct = function (description) { + var this$1 = this; + if (typeof description === 'function') { + return description.call(this); + } else { + var fields = Object.keys(description); + var struct = { + }; + for (var j = 0; j < fields.length; j++) { + var fieldName = fields[j]; + var fieldType = description[fieldName]; + struct[fieldName] = fieldType.call(this$1); + } + return struct; + } + }; + /** + * Parse a GPOS valueRecord + * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record + * valueFormat is optional, if omitted it is read from the stream. + */ + Parser.prototype.parseValueRecord = function (valueFormat) { + if (valueFormat === undefined) { + valueFormat = this.parseUShort(); + } + if (valueFormat === 0) { + // valueFormat2 in kerning pairs is most often 0 + // in this case return undefined instead of an empty object, to save space + return; + } + var valueRecord = { + }; + if (valueFormat & 1) { + valueRecord.xPlacement = this.parseShort(); + } + if (valueFormat & 2) { + valueRecord.yPlacement = this.parseShort(); + } + if (valueFormat & 4) { + valueRecord.xAdvance = this.parseShort(); + } + if (valueFormat & 8) { + valueRecord.yAdvance = this.parseShort(); + } // Device table (non-variable font) / VariationIndex table (variable font) not supported + // https://docs.microsoft.com/fr-fr/typography/opentype/spec/chapter2#devVarIdxTbls + + if (valueFormat & 16) { + valueRecord.xPlaDevice = undefined; + this.parseShort(); + } + if (valueFormat & 32) { + valueRecord.yPlaDevice = undefined; + this.parseShort(); + } + if (valueFormat & 64) { + valueRecord.xAdvDevice = undefined; + this.parseShort(); + } + if (valueFormat & 128) { + valueRecord.yAdvDevice = undefined; + this.parseShort(); + } + return valueRecord; + }; + /** + * Parse a list of GPOS valueRecords + * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record + * valueFormat and valueCount are read from the stream. + */ + Parser.prototype.parseValueRecordList = function () { + var this$1 = this; + var valueFormat = this.parseUShort(); + var valueCount = this.parseUShort(); + var values = new Array(valueCount); + for (var i = 0; i < valueCount; i++) { + values[i] = this$1.parseValueRecord(valueFormat); + } + return values; + }; + Parser.prototype.parsePointer = function (description) { + var structOffset = this.parseOffset16(); + if (structOffset > 0) { + // NULL offset => return undefined + return new Parser(this.data, this.offset + structOffset).parseStruct(description); + } + return undefined; + }; + Parser.prototype.parsePointer32 = function (description) { + var structOffset = this.parseOffset32(); + if (structOffset > 0) { + // NULL offset => return undefined + return new Parser(this.data, this.offset + structOffset).parseStruct(description); + } + return undefined; + }; + /** + * Parse a list of offsets to lists of 16-bit integers, + * or a list of offsets to lists of offsets to any kind of items. + * If itemCallback is not provided, a list of list of UShort is assumed. + * If provided, itemCallback is called on each item and must parse the item. + * See examples in tables/gsub.js + */ + Parser.prototype.parseListOfLists = function (itemCallback) { + var this$1 = this; + var offsets = this.parseOffset16List(); + var count = offsets.length; + var relativeOffset = this.relativeOffset; + var list = new Array(count); + for (var i = 0; i < count; i++) { + var start = offsets[i]; + if (start === 0) { + // NULL offset + // Add i as owned property to list. Convenient with assert. + list[i] = undefined; + continue; + } + this$1.relativeOffset = start; + if (itemCallback) { + var subOffsets = this$1.parseOffset16List(); + var subList = new Array(subOffsets.length); + for (var j = 0; j < subOffsets.length; j++) { + this$1.relativeOffset = start + subOffsets[j]; + subList[j] = itemCallback.call(this$1); + } + list[i] = subList; + } else { + list[i] = this$1.parseUShortList(); + } + } + this.relativeOffset = relativeOffset; + return list; + }; + ///// Complex tables parsing ////////////////////////////////// + // Parse a coverage table in a GSUB, GPOS or GDEF table. + // https://www.microsoft.com/typography/OTSPEC/chapter2.htm + // parser.offset must point to the start of the table containing the coverage. + Parser.prototype.parseCoverage = function () { + var this$1 = this; + var startOffset = this.offset + this.relativeOffset; + var format = this.parseUShort(); + var count = this.parseUShort(); + if (format === 1) { + return { + format: 1, + glyphs: this.parseUShortList(count) + }; + } else if (format === 2) { + var ranges = new Array(count); + for (var i = 0; i < count; i++) { + ranges[i] = { + start: this$1.parseUShort(), + end: this$1.parseUShort(), + index: this$1.parseUShort() + }; + } + return { + format: 2, + ranges: ranges + }; + } + throw new Error('0x' + startOffset.toString(16) + ': Coverage format must be 1 or 2.'); + }; + // Parse a Class Definition Table in a GSUB, GPOS or GDEF table. + // https://www.microsoft.com/typography/OTSPEC/chapter2.htm + Parser.prototype.parseClassDef = function () { + var startOffset = this.offset + this.relativeOffset; + var format = this.parseUShort(); + if (format === 1) { + return { + format: 1, + startGlyph: this.parseUShort(), + classes: this.parseUShortList() + }; + } else if (format === 2) { + return { + format: 2, + ranges: this.parseRecordList({ + start: Parser.uShort, + end: Parser.uShort, + classId: Parser.uShort + }) + }; + } + throw new Error('0x' + startOffset.toString(16) + ': ClassDef format must be 1 or 2.'); + }; + ///// Static methods /////////////////////////////////// + // These convenience methods can be used as callbacks and should be called with "this" context set to a Parser instance. + Parser.list = function (count, itemCallback) { + return function () { + return this.parseList(count, itemCallback); + }; + }; + Parser.list32 = function (count, itemCallback) { + return function () { + return this.parseList32(count, itemCallback); + }; + }; + Parser.recordList = function (count, recordDescription) { + return function () { + return this.parseRecordList(count, recordDescription); + }; + }; + Parser.recordList32 = function (count, recordDescription) { + return function () { + return this.parseRecordList32(count, recordDescription); + }; + }; + Parser.pointer = function (description) { + return function () { + return this.parsePointer(description); + }; + }; + Parser.pointer32 = function (description) { + return function () { + return this.parsePointer32(description); + }; + }; + Parser.tag = Parser.prototype.parseTag; + Parser.byte = Parser.prototype.parseByte; + Parser.uShort = Parser.offset16 = Parser.prototype.parseUShort; + Parser.uShortList = Parser.prototype.parseUShortList; + Parser.uLong = Parser.offset32 = Parser.prototype.parseULong; + Parser.uLongList = Parser.prototype.parseULongList; + Parser.struct = Parser.prototype.parseStruct; + Parser.coverage = Parser.prototype.parseCoverage; + Parser.classDef = Parser.prototype.parseClassDef; + ///// Script, Feature, Lookup lists /////////////////////////////////////////////// + // https://www.microsoft.com/typography/OTSPEC/chapter2.htm + var langSysTable = { + reserved: Parser.uShort, + reqFeatureIndex: Parser.uShort, + featureIndexes: Parser.uShortList + }; + Parser.prototype.parseScriptList = function () { + return this.parsePointer(Parser.recordList({ + tag: Parser.tag, + script: Parser.pointer({ + defaultLangSys: Parser.pointer(langSysTable), + langSysRecords: Parser.recordList({ + tag: Parser.tag, + langSys: Parser.pointer(langSysTable) + }) + }) + })) || [ + ]; + }; + Parser.prototype.parseFeatureList = function () { + return this.parsePointer(Parser.recordList({ + tag: Parser.tag, + feature: Parser.pointer({ + featureParams: Parser.offset16, + lookupListIndexes: Parser.uShortList + }) + })) || [ + ]; + }; + Parser.prototype.parseLookupList = function (lookupTableParsers) { + return this.parsePointer(Parser.list(Parser.pointer(function () { + var lookupType = this.parseUShort(); + check.argument(1 <= lookupType && lookupType <= 9, 'GPOS/GSUB lookup type ' + lookupType + ' unknown.'); + var lookupFlag = this.parseUShort(); + var useMarkFilteringSet = lookupFlag & 16; + return { + lookupType: lookupType, + lookupFlag: lookupFlag, + subtables: this.parseList(Parser.pointer(lookupTableParsers[lookupType])), + markFilteringSet: useMarkFilteringSet ? this.parseUShort() : undefined + }; + }))) || [ + ]; + }; + Parser.prototype.parseFeatureVariationsList = function () { + return this.parsePointer32(function () { + var majorVersion = this.parseUShort(); + var minorVersion = this.parseUShort(); + check.argument(majorVersion === 1 && minorVersion < 1, 'GPOS/GSUB feature variations table unknown.'); + var featureVariations = this.parseRecordList32({ + conditionSetOffset: Parser.offset32, + featureTableSubstitutionOffset: Parser.offset32 + }); + return featureVariations; + }) || [ + ]; + }; + var parse = { + getByte: getByte, + getCard8: getByte, + getUShort: getUShort, + getCard16: getUShort, + getShort: getShort, + getULong: getULong, + getFixed: getFixed, + getTag: getTag, + getOffset: getOffset, + getBytes: getBytes, + bytesToString: bytesToString, + Parser: Parser + }; + // The `cmap` table stores the mappings from characters to glyphs. + function parseCmapTableFormat12(cmap, p) { + //Skip reserved. + p.parseUShort(); + // Length in bytes of the sub-tables. + cmap.length = p.parseULong(); + cmap.language = p.parseULong(); + var groupCount; + cmap.groupCount = groupCount = p.parseULong(); + cmap.glyphIndexMap = { + }; + for (var i = 0; i < groupCount; i += 1) { + var startCharCode = p.parseULong(); + var endCharCode = p.parseULong(); + var startGlyphId = p.parseULong(); + for (var c = startCharCode; c <= endCharCode; c += 1) { + cmap.glyphIndexMap[c] = startGlyphId; + startGlyphId++; + } + } + } + function parseCmapTableFormat4(cmap, p, data, start, offset) { + // Length in bytes of the sub-tables. + cmap.length = p.parseUShort(); + cmap.language = p.parseUShort(); + // segCount is stored x 2. + var segCount; + cmap.segCount = segCount = p.parseUShort() >> 1; + // Skip searchRange, entrySelector, rangeShift. + p.skip('uShort', 3); + // The "unrolled" mapping from character codes to glyph indices. + cmap.glyphIndexMap = { + }; + var endCountParser = new parse.Parser(data, start + offset + 14); + var startCountParser = new parse.Parser(data, start + offset + 16 + segCount * 2); + var idDeltaParser = new parse.Parser(data, start + offset + 16 + segCount * 4); + var idRangeOffsetParser = new parse.Parser(data, start + offset + 16 + segCount * 6); + var glyphIndexOffset = start + offset + 16 + segCount * 8; + for (var i = 0; i < segCount - 1; i += 1) { + var glyphIndex = void 0; + var endCount = endCountParser.parseUShort(); + var startCount = startCountParser.parseUShort(); + var idDelta = idDeltaParser.parseShort(); + var idRangeOffset = idRangeOffsetParser.parseUShort(); + for (var c = startCount; c <= endCount; c += 1) { + if (idRangeOffset !== 0) { + // The idRangeOffset is relative to the current position in the idRangeOffset array. + // Take the current offset in the idRangeOffset array. + glyphIndexOffset = idRangeOffsetParser.offset + idRangeOffsetParser.relativeOffset - 2; + // Add the value of the idRangeOffset, which will move us into the glyphIndex array. + glyphIndexOffset += idRangeOffset; + // Then add the character index of the current segment, multiplied by 2 for USHORTs. + glyphIndexOffset += (c - startCount) * 2; + glyphIndex = parse.getUShort(data, glyphIndexOffset); + if (glyphIndex !== 0) { + glyphIndex = glyphIndex + idDelta & 65535; + } + } else { + glyphIndex = c + idDelta & 65535; + } + cmap.glyphIndexMap[c] = glyphIndex; + } + } + } // Parse the `cmap` table. This table stores the mappings from characters to glyphs. + // There are many available formats, but we only support the Windows format 4 and 12. + // This function returns a `CmapEncoding` object or null if no supported format could be found. + + function parseCmapTable(data, start) { + var cmap = { + }; + cmap.version = parse.getUShort(data, start); + check.argument(cmap.version === 0, 'cmap table version should be 0.'); + // The cmap table can contain many sub-tables, each with their own format. + // We're only interested in a "platform 0" (Unicode format) and "platform 3" (Windows format) table. + cmap.numTables = parse.getUShort(data, start + 2); + var offset = - 1; + for (var i = cmap.numTables - 1; i >= 0; i -= 1) { + var platformId = parse.getUShort(data, start + 4 + i * 8); + var encodingId = parse.getUShort(data, start + 4 + i * 8 + 2); + if (platformId === 3 && (encodingId === 0 || encodingId === 1 || encodingId === 10) || platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 2 || encodingId === 3 || encodingId === 4)) { + offset = parse.getULong(data, start + 4 + i * 8 + 4); + break; + } + } + if (offset === - 1) { + // There is no cmap table in the font that we support. + throw new Error('No valid cmap sub-tables found.'); + } + var p = new parse.Parser(data, start + offset); + cmap.format = p.parseUShort(); + if (cmap.format === 12) { + parseCmapTableFormat12(cmap, p); + } else if (cmap.format === 4) { + parseCmapTableFormat4(cmap, p, data, start, offset); + } else { + throw new Error('Only format 4 and 12 cmap tables are supported (found format ' + cmap.format + ').'); + } + return cmap; + } + function addSegment(t, code, glyphIndex) { + t.segments.push({ + end: code, + start: code, + delta: - (code - glyphIndex), + offset: 0, + glyphIndex: glyphIndex + }); + } + function addTerminatorSegment(t) { + t.segments.push({ + end: 65535, + start: 65535, + delta: 1, + offset: 0 + }); + } // Make cmap table, format 4 by default, 12 if needed only + + function makeCmapTable(glyphs) { + // Plan 0 is the base Unicode Plan but emojis, for example are on another plan, and needs cmap 12 format (with 32bit) + var isPlan0Only = true; + var i; + // Check if we need to add cmap format 12 or if format 4 only is fine + for (i = glyphs.length - 1; i > 0; i -= 1) { + var g = glyphs.get(i); + if (g.unicode > 65535) { + console.log('Adding CMAP format 12 (needed!)'); + isPlan0Only = false; + break; + } + } + var cmapTable = [ + { + name: 'version', + type: 'USHORT', + value: 0 + }, + { + name: 'numTables', + type: 'USHORT', + value: isPlan0Only ? 1 : 2 + }, + // CMAP 4 header + { + name: 'platformID', + type: 'USHORT', + value: 3 + }, + { + name: 'encodingID', + type: 'USHORT', + value: 1 + }, + { + name: 'offset', + type: 'ULONG', + value: isPlan0Only ? 12 : 12 + 8 + } + ]; + if (!isPlan0Only) { + cmapTable = cmapTable.concat([ // CMAP 12 header + { + name: 'cmap12PlatformID', + type: 'USHORT', + value: 3 + }, + // We encode only for PlatformID = 3 (Windows) because it is supported everywhere + { + name: 'cmap12EncodingID', + type: 'USHORT', + value: 10 + }, + { + name: 'cmap12Offset', + type: 'ULONG', + value: 0 + } + ]); + } + cmapTable = cmapTable.concat([ // CMAP 4 Subtable + { + name: 'format', + type: 'USHORT', + value: 4 + }, + { + name: 'cmap4Length', + type: 'USHORT', + value: 0 + }, + { + name: 'language', + type: 'USHORT', + value: 0 + }, + { + name: 'segCountX2', + type: 'USHORT', + value: 0 + }, + { + name: 'searchRange', + type: 'USHORT', + value: 0 + }, + { + name: 'entrySelector', + type: 'USHORT', + value: 0 + }, + { + name: 'rangeShift', + type: 'USHORT', + value: 0 + } + ]); + var t = new table.Table('cmap', cmapTable); + t.segments = [ + ]; + for (i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + for (var j = 0; j < glyph.unicodes.length; j += 1) { + addSegment(t, glyph.unicodes[j], i); + } + t.segments = t.segments.sort(function (a, b) { + return a.start - b.start; + }); + } + addTerminatorSegment(t); + var segCount = t.segments.length; + var segCountToRemove = 0; + // CMAP 4 + // Set up parallel segment arrays. + var endCounts = [ + ]; + var startCounts = [ + ]; + var idDeltas = [ + ]; + var idRangeOffsets = [ + ]; + var glyphIds = [ + ]; + // CMAP 12 + var cmap12Groups = [ + ]; + // Reminder this loop is not following the specification at 100% + // The specification -> find suites of characters and make a group + // Here we're doing one group for each letter + // Doing as the spec can save 8 times (or more) space + for (i = 0; i < segCount; i += 1) { + var segment = t.segments[i]; + // CMAP 4 + if (segment.end <= 65535 && segment.start <= 65535) { + endCounts = endCounts.concat({ + name: 'end_' + i, + type: 'USHORT', + value: segment.end + }); + startCounts = startCounts.concat({ + name: 'start_' + i, + type: 'USHORT', + value: segment.start + }); + idDeltas = idDeltas.concat({ + name: 'idDelta_' + i, + type: 'SHORT', + value: segment.delta + }); + idRangeOffsets = idRangeOffsets.concat({ + name: 'idRangeOffset_' + i, + type: 'USHORT', + value: segment.offset + }); + if (segment.glyphId !== undefined) { + glyphIds = glyphIds.concat({ + name: 'glyph_' + i, + type: 'USHORT', + value: segment.glyphId + }); + } + } else { + // Skip Unicode > 65535 (16bit unsigned max) for CMAP 4, will be added in CMAP 12 + segCountToRemove += 1; + } // CMAP 12 + // Skip Terminator Segment + + if (!isPlan0Only && segment.glyphIndex !== undefined) { + cmap12Groups = cmap12Groups.concat({ + name: 'cmap12Start_' + i, + type: 'ULONG', + value: segment.start + }); + cmap12Groups = cmap12Groups.concat({ + name: 'cmap12End_' + i, + type: 'ULONG', + value: segment.end + }); + cmap12Groups = cmap12Groups.concat({ + name: 'cmap12Glyph_' + i, + type: 'ULONG', + value: segment.glyphIndex + }); + } + } // CMAP 4 Subtable + + t.segCountX2 = (segCount - segCountToRemove) * 2; + t.searchRange = Math.pow(2, Math.floor(Math.log(segCount - segCountToRemove) / Math.log(2))) * 2; + t.entrySelector = Math.log(t.searchRange / 2) / Math.log(2); + t.rangeShift = t.segCountX2 - t.searchRange; + t.fields = t.fields.concat(endCounts); + t.fields.push({ + name: 'reservedPad', + type: 'USHORT', + value: 0 + }); + t.fields = t.fields.concat(startCounts); + t.fields = t.fields.concat(idDeltas); + t.fields = t.fields.concat(idRangeOffsets); + t.fields = t.fields.concat(glyphIds); + t.cmap4Length = 14 + // Subtable header + endCounts.length * 2 + 2 + // reservedPad + startCounts.length * 2 + idDeltas.length * 2 + idRangeOffsets.length * 2 + glyphIds.length * 2; + if (!isPlan0Only) { + // CMAP 12 Subtable + var cmap12Length = 16 + // Subtable header + cmap12Groups.length * 4; + t.cmap12Offset = 12 + 2 * 2 + 4 + t.cmap4Length; + t.fields = t.fields.concat([{ + name: 'cmap12Format', + type: 'USHORT', + value: 12 + }, + { + name: 'cmap12Reserved', + type: 'USHORT', + value: 0 + }, + { + name: 'cmap12Length', + type: 'ULONG', + value: cmap12Length + }, + { + name: 'cmap12Language', + type: 'ULONG', + value: 0 + }, + { + name: 'cmap12nGroups', + type: 'ULONG', + value: cmap12Groups.length / 3 + } + ]); + t.fields = t.fields.concat(cmap12Groups); + } + return t; + } + var cmap = { + parse: parseCmapTable, + make: makeCmapTable + }; + // Glyph encoding + var cffStandardStrings = [ + '.notdef', + 'space', + 'exclam', + 'quotedbl', + 'numbersign', + 'dollar', + 'percent', + 'ampersand', + 'quoteright', + 'parenleft', + 'parenright', + 'asterisk', + 'plus', + 'comma', + 'hyphen', + 'period', + 'slash', + 'zero', + 'one', + 'two', + 'three', + 'four', + 'five', + 'six', + 'seven', + 'eight', + 'nine', + 'colon', + 'semicolon', + 'less', + 'equal', + 'greater', + 'question', + 'at', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + 'bracketleft', + 'backslash', + 'bracketright', + 'asciicircum', + 'underscore', + 'quoteleft', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'braceleft', + 'bar', + 'braceright', + 'asciitilde', + 'exclamdown', + 'cent', + 'sterling', + 'fraction', + 'yen', + 'florin', + 'section', + 'currency', + 'quotesingle', + 'quotedblleft', + 'guillemotleft', + 'guilsinglleft', + 'guilsinglright', + 'fi', + 'fl', + 'endash', + 'dagger', + 'daggerdbl', + 'periodcentered', + 'paragraph', + 'bullet', + 'quotesinglbase', + 'quotedblbase', + 'quotedblright', + 'guillemotright', + 'ellipsis', + 'perthousand', + 'questiondown', + 'grave', + 'acute', + 'circumflex', + 'tilde', + 'macron', + 'breve', + 'dotaccent', + 'dieresis', + 'ring', + 'cedilla', + 'hungarumlaut', + 'ogonek', + 'caron', + 'emdash', + 'AE', + 'ordfeminine', + 'Lslash', + 'Oslash', + 'OE', + 'ordmasculine', + 'ae', + 'dotlessi', + 'lslash', + 'oslash', + 'oe', + 'germandbls', + 'onesuperior', + 'logicalnot', + 'mu', + 'trademark', + 'Eth', + 'onehalf', + 'plusminus', + 'Thorn', + 'onequarter', + 'divide', + 'brokenbar', + 'degree', + 'thorn', + 'threequarters', + 'twosuperior', + 'registered', + 'minus', + 'eth', + 'multiply', + 'threesuperior', + 'copyright', + 'Aacute', + 'Acircumflex', + 'Adieresis', + 'Agrave', + 'Aring', + 'Atilde', + 'Ccedilla', + 'Eacute', + 'Ecircumflex', + 'Edieresis', + 'Egrave', + 'Iacute', + 'Icircumflex', + 'Idieresis', + 'Igrave', + 'Ntilde', + 'Oacute', + 'Ocircumflex', + 'Odieresis', + 'Ograve', + 'Otilde', + 'Scaron', + 'Uacute', + 'Ucircumflex', + 'Udieresis', + 'Ugrave', + 'Yacute', + 'Ydieresis', + 'Zcaron', + 'aacute', + 'acircumflex', + 'adieresis', + 'agrave', + 'aring', + 'atilde', + 'ccedilla', + 'eacute', + 'ecircumflex', + 'edieresis', + 'egrave', + 'iacute', + 'icircumflex', + 'idieresis', + 'igrave', + 'ntilde', + 'oacute', + 'ocircumflex', + 'odieresis', + 'ograve', + 'otilde', + 'scaron', + 'uacute', + 'ucircumflex', + 'udieresis', + 'ugrave', + 'yacute', + 'ydieresis', + 'zcaron', + 'exclamsmall', + 'Hungarumlautsmall', + 'dollaroldstyle', + 'dollarsuperior', + 'ampersandsmall', + 'Acutesmall', + 'parenleftsuperior', + 'parenrightsuperior', + '266 ff', + 'onedotenleader', + 'zerooldstyle', + 'oneoldstyle', + 'twooldstyle', + 'threeoldstyle', + 'fouroldstyle', + 'fiveoldstyle', + 'sixoldstyle', + 'sevenoldstyle', + 'eightoldstyle', + 'nineoldstyle', + 'commasuperior', + 'threequartersemdash', + 'periodsuperior', + 'questionsmall', + 'asuperior', + 'bsuperior', + 'centsuperior', + 'dsuperior', + 'esuperior', + 'isuperior', + 'lsuperior', + 'msuperior', + 'nsuperior', + 'osuperior', + 'rsuperior', + 'ssuperior', + 'tsuperior', + 'ff', + 'ffi', + 'ffl', + 'parenleftinferior', + 'parenrightinferior', + 'Circumflexsmall', + 'hyphensuperior', + 'Gravesmall', + 'Asmall', + 'Bsmall', + 'Csmall', + 'Dsmall', + 'Esmall', + 'Fsmall', + 'Gsmall', + 'Hsmall', + 'Ismall', + 'Jsmall', + 'Ksmall', + 'Lsmall', + 'Msmall', + 'Nsmall', + 'Osmall', + 'Psmall', + 'Qsmall', + 'Rsmall', + 'Ssmall', + 'Tsmall', + 'Usmall', + 'Vsmall', + 'Wsmall', + 'Xsmall', + 'Ysmall', + 'Zsmall', + 'colonmonetary', + 'onefitted', + 'rupiah', + 'Tildesmall', + 'exclamdownsmall', + 'centoldstyle', + 'Lslashsmall', + 'Scaronsmall', + 'Zcaronsmall', + 'Dieresissmall', + 'Brevesmall', + 'Caronsmall', + 'Dotaccentsmall', + 'Macronsmall', + 'figuredash', + 'hypheninferior', + 'Ogoneksmall', + 'Ringsmall', + 'Cedillasmall', + 'questiondownsmall', + 'oneeighth', + 'threeeighths', + 'fiveeighths', + 'seveneighths', + 'onethird', + 'twothirds', + 'zerosuperior', + 'foursuperior', + 'fivesuperior', + 'sixsuperior', + 'sevensuperior', + 'eightsuperior', + 'ninesuperior', + 'zeroinferior', + 'oneinferior', + 'twoinferior', + 'threeinferior', + 'fourinferior', + 'fiveinferior', + 'sixinferior', + 'seveninferior', + 'eightinferior', + 'nineinferior', + 'centinferior', + 'dollarinferior', + 'periodinferior', + 'commainferior', + 'Agravesmall', + 'Aacutesmall', + 'Acircumflexsmall', + 'Atildesmall', + 'Adieresissmall', + 'Aringsmall', + 'AEsmall', + 'Ccedillasmall', + 'Egravesmall', + 'Eacutesmall', + 'Ecircumflexsmall', + 'Edieresissmall', + 'Igravesmall', + 'Iacutesmall', + 'Icircumflexsmall', + 'Idieresissmall', + 'Ethsmall', + 'Ntildesmall', + 'Ogravesmall', + 'Oacutesmall', + 'Ocircumflexsmall', + 'Otildesmall', + 'Odieresissmall', + 'OEsmall', + 'Oslashsmall', + 'Ugravesmall', + 'Uacutesmall', + 'Ucircumflexsmall', + 'Udieresissmall', + 'Yacutesmall', + 'Thornsmall', + 'Ydieresissmall', + '001.000', + '001.001', + '001.002', + '001.003', + 'Black', + 'Bold', + 'Book', + 'Light', + 'Medium', + 'Regular', + 'Roman', + 'Semibold' + ]; + var cffStandardEncoding = [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + 'space', + 'exclam', + 'quotedbl', + 'numbersign', + 'dollar', + 'percent', + 'ampersand', + 'quoteright', + 'parenleft', + 'parenright', + 'asterisk', + 'plus', + 'comma', + 'hyphen', + 'period', + 'slash', + 'zero', + 'one', + 'two', + 'three', + 'four', + 'five', + 'six', + 'seven', + 'eight', + 'nine', + 'colon', + 'semicolon', + 'less', + 'equal', + 'greater', + 'question', + 'at', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + 'bracketleft', + 'backslash', + 'bracketright', + 'asciicircum', + 'underscore', + 'quoteleft', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'braceleft', + 'bar', + 'braceright', + 'asciitilde', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + 'exclamdown', + 'cent', + 'sterling', + 'fraction', + 'yen', + 'florin', + 'section', + 'currency', + 'quotesingle', + 'quotedblleft', + 'guillemotleft', + 'guilsinglleft', + 'guilsinglright', + 'fi', + 'fl', + '', + 'endash', + 'dagger', + 'daggerdbl', + 'periodcentered', + '', + 'paragraph', + 'bullet', + 'quotesinglbase', + 'quotedblbase', + 'quotedblright', + 'guillemotright', + 'ellipsis', + 'perthousand', + '', + 'questiondown', + '', + 'grave', + 'acute', + 'circumflex', + 'tilde', + 'macron', + 'breve', + 'dotaccent', + 'dieresis', + '', + 'ring', + 'cedilla', + '', + 'hungarumlaut', + 'ogonek', + 'caron', + 'emdash', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + 'AE', + '', + 'ordfeminine', + '', + '', + '', + '', + 'Lslash', + 'Oslash', + 'OE', + 'ordmasculine', + '', + '', + '', + '', + '', + 'ae', + '', + '', + '', + 'dotlessi', + '', + '', + 'lslash', + 'oslash', + 'oe', + 'germandbls' + ]; + var cffExpertEncoding = [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + 'space', + 'exclamsmall', + 'Hungarumlautsmall', + '', + 'dollaroldstyle', + 'dollarsuperior', + 'ampersandsmall', + 'Acutesmall', + 'parenleftsuperior', + 'parenrightsuperior', + 'twodotenleader', + 'onedotenleader', + 'comma', + 'hyphen', + 'period', + 'fraction', + 'zerooldstyle', + 'oneoldstyle', + 'twooldstyle', + 'threeoldstyle', + 'fouroldstyle', + 'fiveoldstyle', + 'sixoldstyle', + 'sevenoldstyle', + 'eightoldstyle', + 'nineoldstyle', + 'colon', + 'semicolon', + 'commasuperior', + 'threequartersemdash', + 'periodsuperior', + 'questionsmall', + '', + 'asuperior', + 'bsuperior', + 'centsuperior', + 'dsuperior', + 'esuperior', + '', + '', + 'isuperior', + '', + '', + 'lsuperior', + 'msuperior', + 'nsuperior', + 'osuperior', + '', + '', + 'rsuperior', + 'ssuperior', + 'tsuperior', + '', + 'ff', + 'fi', + 'fl', + 'ffi', + 'ffl', + 'parenleftinferior', + '', + 'parenrightinferior', + 'Circumflexsmall', + 'hyphensuperior', + 'Gravesmall', + 'Asmall', + 'Bsmall', + 'Csmall', + 'Dsmall', + 'Esmall', + 'Fsmall', + 'Gsmall', + 'Hsmall', + 'Ismall', + 'Jsmall', + 'Ksmall', + 'Lsmall', + 'Msmall', + 'Nsmall', + 'Osmall', + 'Psmall', + 'Qsmall', + 'Rsmall', + 'Ssmall', + 'Tsmall', + 'Usmall', + 'Vsmall', + 'Wsmall', + 'Xsmall', + 'Ysmall', + 'Zsmall', + 'colonmonetary', + 'onefitted', + 'rupiah', + 'Tildesmall', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + 'exclamdownsmall', + 'centoldstyle', + 'Lslashsmall', + '', + '', + 'Scaronsmall', + 'Zcaronsmall', + 'Dieresissmall', + 'Brevesmall', + 'Caronsmall', + '', + 'Dotaccentsmall', + '', + '', + 'Macronsmall', + '', + '', + 'figuredash', + 'hypheninferior', + '', + '', + 'Ogoneksmall', + 'Ringsmall', + 'Cedillasmall', + '', + '', + '', + 'onequarter', + 'onehalf', + 'threequarters', + 'questiondownsmall', + 'oneeighth', + 'threeeighths', + 'fiveeighths', + 'seveneighths', + 'onethird', + 'twothirds', + '', + '', + 'zerosuperior', + 'onesuperior', + 'twosuperior', + 'threesuperior', + 'foursuperior', + 'fivesuperior', + 'sixsuperior', + 'sevensuperior', + 'eightsuperior', + 'ninesuperior', + 'zeroinferior', + 'oneinferior', + 'twoinferior', + 'threeinferior', + 'fourinferior', + 'fiveinferior', + 'sixinferior', + 'seveninferior', + 'eightinferior', + 'nineinferior', + 'centinferior', + 'dollarinferior', + 'periodinferior', + 'commainferior', + 'Agravesmall', + 'Aacutesmall', + 'Acircumflexsmall', + 'Atildesmall', + 'Adieresissmall', + 'Aringsmall', + 'AEsmall', + 'Ccedillasmall', + 'Egravesmall', + 'Eacutesmall', + 'Ecircumflexsmall', + 'Edieresissmall', + 'Igravesmall', + 'Iacutesmall', + 'Icircumflexsmall', + 'Idieresissmall', + 'Ethsmall', + 'Ntildesmall', + 'Ogravesmall', + 'Oacutesmall', + 'Ocircumflexsmall', + 'Otildesmall', + 'Odieresissmall', + 'OEsmall', + 'Oslashsmall', + 'Ugravesmall', + 'Uacutesmall', + 'Ucircumflexsmall', + 'Udieresissmall', + 'Yacutesmall', + 'Thornsmall', + 'Ydieresissmall' + ]; + var standardNames = [ + '.notdef', + '.null', + 'nonmarkingreturn', + 'space', + 'exclam', + 'quotedbl', + 'numbersign', + 'dollar', + 'percent', + 'ampersand', + 'quotesingle', + 'parenleft', + 'parenright', + 'asterisk', + 'plus', + 'comma', + 'hyphen', + 'period', + 'slash', + 'zero', + 'one', + 'two', + 'three', + 'four', + 'five', + 'six', + 'seven', + 'eight', + 'nine', + 'colon', + 'semicolon', + 'less', + 'equal', + 'greater', + 'question', + 'at', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + 'bracketleft', + 'backslash', + 'bracketright', + 'asciicircum', + 'underscore', + 'grave', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'braceleft', + 'bar', + 'braceright', + 'asciitilde', + 'Adieresis', + 'Aring', + 'Ccedilla', + 'Eacute', + 'Ntilde', + 'Odieresis', + 'Udieresis', + 'aacute', + 'agrave', + 'acircumflex', + 'adieresis', + 'atilde', + 'aring', + 'ccedilla', + 'eacute', + 'egrave', + 'ecircumflex', + 'edieresis', + 'iacute', + 'igrave', + 'icircumflex', + 'idieresis', + 'ntilde', + 'oacute', + 'ograve', + 'ocircumflex', + 'odieresis', + 'otilde', + 'uacute', + 'ugrave', + 'ucircumflex', + 'udieresis', + 'dagger', + 'degree', + 'cent', + 'sterling', + 'section', + 'bullet', + 'paragraph', + 'germandbls', + 'registered', + 'copyright', + 'trademark', + 'acute', + 'dieresis', + 'notequal', + 'AE', + 'Oslash', + 'infinity', + 'plusminus', + 'lessequal', + 'greaterequal', + 'yen', + 'mu', + 'partialdiff', + 'summation', + 'product', + 'pi', + 'integral', + 'ordfeminine', + 'ordmasculine', + 'Omega', + 'ae', + 'oslash', + 'questiondown', + 'exclamdown', + 'logicalnot', + 'radical', + 'florin', + 'approxequal', + 'Delta', + 'guillemotleft', + 'guillemotright', + 'ellipsis', + 'nonbreakingspace', + 'Agrave', + 'Atilde', + 'Otilde', + 'OE', + 'oe', + 'endash', + 'emdash', + 'quotedblleft', + 'quotedblright', + 'quoteleft', + 'quoteright', + 'divide', + 'lozenge', + 'ydieresis', + 'Ydieresis', + 'fraction', + 'currency', + 'guilsinglleft', + 'guilsinglright', + 'fi', + 'fl', + 'daggerdbl', + 'periodcentered', + 'quotesinglbase', + 'quotedblbase', + 'perthousand', + 'Acircumflex', + 'Ecircumflex', + 'Aacute', + 'Edieresis', + 'Egrave', + 'Iacute', + 'Icircumflex', + 'Idieresis', + 'Igrave', + 'Oacute', + 'Ocircumflex', + 'apple', + 'Ograve', + 'Uacute', + 'Ucircumflex', + 'Ugrave', + 'dotlessi', + 'circumflex', + 'tilde', + 'macron', + 'breve', + 'dotaccent', + 'ring', + 'cedilla', + 'hungarumlaut', + 'ogonek', + 'caron', + 'Lslash', + 'lslash', + 'Scaron', + 'scaron', + 'Zcaron', + 'zcaron', + 'brokenbar', + 'Eth', + 'eth', + 'Yacute', + 'yacute', + 'Thorn', + 'thorn', + 'minus', + 'multiply', + 'onesuperior', + 'twosuperior', + 'threesuperior', + 'onehalf', + 'onequarter', + 'threequarters', + 'franc', + 'Gbreve', + 'gbreve', + 'Idotaccent', + 'Scedilla', + 'scedilla', + 'Cacute', + 'cacute', + 'Ccaron', + 'ccaron', + 'dcroat' + ]; + /** + * This is the encoding used for fonts created from scratch. + * It loops through all glyphs and finds the appropriate unicode value. + * Since it's linear time, other encodings will be faster. + * @exports opentype.DefaultEncoding + * @class + * @constructor + * @param {opentype.Font} + */ + function DefaultEncoding(font) { + this.font = font; + } + DefaultEncoding.prototype.charToGlyphIndex = function (c) { + var code = c.codePointAt(0); + var glyphs = this.font.glyphs; + if (glyphs) { + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + for (var j = 0; j < glyph.unicodes.length; j += 1) { + if (glyph.unicodes[j] === code) { + return i; + } + } + } + } + return null; + }; + /** + * @exports opentype.CmapEncoding + * @class + * @constructor + * @param {Object} cmap - a object with the cmap encoded data + */ + function CmapEncoding(cmap) { + this.cmap = cmap; + } /** + * @param {string} c - the character + * @return {number} The glyph index. + */ + + CmapEncoding.prototype.charToGlyphIndex = function (c) { + return this.cmap.glyphIndexMap[c.codePointAt(0)] || 0; + }; + /** + * @exports opentype.CffEncoding + * @class + * @constructor + * @param {string} encoding - The encoding + * @param {Array} charset - The character set. + */ + function CffEncoding(encoding, charset) { + this.encoding = encoding; + this.charset = charset; + } /** + * @param {string} s - The character + * @return {number} The index. + */ + + CffEncoding.prototype.charToGlyphIndex = function (s) { + var code = s.codePointAt(0); + var charName = this.encoding[code]; + return this.charset.indexOf(charName); + }; + /** + * @exports opentype.GlyphNames + * @class + * @constructor + * @param {Object} post + */ + function GlyphNames(post) { + var this$1 = this; + switch (post.version) { + case 1: + this.names = standardNames.slice(); + break; + case 2: + this.names = new Array(post.numberOfGlyphs); + for (var i = 0; i < post.numberOfGlyphs; i++) { + if (post.glyphNameIndex[i] < standardNames.length) { + this$1.names[i] = standardNames[post.glyphNameIndex[i]]; + } else { + this$1.names[i] = post.names[post.glyphNameIndex[i] - standardNames.length]; + } + } + break; + case 2.5: + this.names = new Array(post.numberOfGlyphs); + for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { + this$1.names[i$1] = standardNames[i$1 + post.glyphNameIndex[i$1]]; + } + break; + case 3: + this.names = [ + ]; + break; + default: + this.names = [ + ]; + break; + } + } /** + * Gets the index of a glyph by name. + * @param {string} name - The glyph name + * @return {number} The index + */ + + GlyphNames.prototype.nameToGlyphIndex = function (name) { + return this.names.indexOf(name); + }; + /** + * @param {number} gid + * @return {string} + */ + GlyphNames.prototype.glyphIndexToName = function (gid) { + return this.names[gid]; + }; + /** + * @alias opentype.addGlyphNames + * @param {opentype.Font} + */ + function addGlyphNames(font) { + var glyph; + var glyphIndexMap = font.tables.cmap.glyphIndexMap; + var charCodes = Object.keys(glyphIndexMap); + for (var i = 0; i < charCodes.length; i += 1) { + var c = charCodes[i]; + var glyphIndex = glyphIndexMap[c]; + glyph = font.glyphs.get(glyphIndex); + glyph.addUnicode(parseInt(c)); + } + for (var i$1 = 0; i$1 < font.glyphs.length; i$1 += 1) { + glyph = font.glyphs.get(i$1); + if (font.cffEncoding) { + if (font.isCIDFont) { + glyph.name = 'gid' + i$1; + } else { + glyph.name = font.cffEncoding.charset[i$1]; + } + } else if (font.glyphNames.names) { + glyph.name = font.glyphNames.glyphIndexToName(i$1); + } + } + } // Drawing utility functions. + // Draw a line on the given context from point `x1,y1` to point `x2,y2`. + + function line(ctx, x1, y1, x2, y2) { + ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + } + var draw = { + line: line + }; + // The Glyph object + // import glyf from './tables/glyf' Can't be imported here, because it's a circular dependency + function getPathDefinition(glyph, path) { + var _path = path || new Path(); + return { + configurable: true, + get: function () { + if (typeof _path === 'function') { + _path = _path(); + } + return _path; + }, + set: function (p) { + _path = p; + } + }; + } /** + * @typedef GlyphOptions + * @type Object + * @property {string} [name] - The glyph name + * @property {number} [unicode] + * @property {Array} [unicodes] + * @property {number} [xMin] + * @property {number} [yMin] + * @property {number} [xMax] + * @property {number} [yMax] + * @property {number} [advanceWidth] + */ + // A Glyph is an individual mark that often corresponds to a character. + // Some glyphs, such as ligatures, are a combination of many characters. + // Glyphs are the basic building blocks of a font. + // + // The `Glyph` class contains utility methods for drawing the path and its points. + /** + * @exports opentype.Glyph + * @class + * @param {GlyphOptions} + * @constructor + */ + + function Glyph(options) { + // By putting all the code on a prototype function (which is only declared once) + // we reduce the memory requirements for larger fonts by some 2% + this.bindConstructorValues(options); + } /** + * @param {GlyphOptions} + */ + + Glyph.prototype.bindConstructorValues = function (options) { + this.index = options.index || 0; + // These three values cannot be deferred for memory optimization: + this.name = options.name || null; + this.unicode = options.unicode || undefined; + this.unicodes = options.unicodes || options.unicode !== undefined ? [ + options.unicode + ] : [ + ]; + // But by binding these values only when necessary, we reduce can + // the memory requirements by almost 3% for larger fonts. + if (options.xMin) { + this.xMin = options.xMin; + } + if (options.yMin) { + this.yMin = options.yMin; + } + if (options.xMax) { + this.xMax = options.xMax; + } + if (options.yMax) { + this.yMax = options.yMax; + } + if (options.advanceWidth) { + this.advanceWidth = options.advanceWidth; + } // The path for a glyph is the most memory intensive, and is bound as a value + // with a getter/setter to ensure we actually do path parsing only once the + // path is actually needed by anything. + + Object.defineProperty(this, 'path', getPathDefinition(this, options.path)); + }; + /** + * @param {number} + */ + Glyph.prototype.addUnicode = function (unicode) { + if (this.unicodes.length === 0) { + this.unicode = unicode; + } + this.unicodes.push(unicode); + }; + /** + * Calculate the minimum bounding box for this glyph. + * @return {opentype.BoundingBox} + */ + Glyph.prototype.getBoundingBox = function () { + return this.path.getBoundingBox(); + }; + /** + * Convert the glyph to a Path we can draw on a drawing context. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {Object=} options - xScale, yScale to stretch the glyph. + * @param {opentype.Font} if hinting is to be used, the font + * @return {opentype.Path} + */ + Glyph.prototype.getPath = function (x, y, fontSize, options, font) { + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 72; + var commands; + var hPoints; + if (!options) { + options = { + }; + } + var xScale = options.xScale; + var yScale = options.yScale; + if (options.hinting && font && font.hinting) { + // in case of hinting, the hinting engine takes care + // of scaling the points (not the path) before hinting. + hPoints = this.path && font.hinting.exec(this, fontSize); + // in case the hinting engine failed hPoints is undefined + // and thus reverts to plain rending + } + if (hPoints) { + // Call font.hinting.getCommands instead of `glyf.getPath(hPoints).commands` to avoid a circular dependency + commands = font.hinting.getCommands(hPoints); + x = Math.round(x); + y = Math.round(y); + // TODO in case of hinting xyScaling is not yet supported + xScale = yScale = 1; + } else { + commands = this.path.commands; + var scale = 1 / this.path.unitsPerEm * fontSize; + if (xScale === undefined) { + xScale = scale; + } + if (yScale === undefined) { + yScale = scale; + } + } + var p = new Path(); + for (var i = 0; i < commands.length; i += 1) { + var cmd = commands[i]; + if (cmd.type === 'M') { + p.moveTo(x + cmd.x * xScale, y + - cmd.y * yScale); + } else if (cmd.type === 'L') { + p.lineTo(x + cmd.x * xScale, y + - cmd.y * yScale); + } else if (cmd.type === 'Q') { + p.quadraticCurveTo(x + cmd.x1 * xScale, y + - cmd.y1 * yScale, x + cmd.x * xScale, y + - cmd.y * yScale); + } else if (cmd.type === 'C') { + p.curveTo(x + cmd.x1 * xScale, y + - cmd.y1 * yScale, x + cmd.x2 * xScale, y + - cmd.y2 * yScale, x + cmd.x * xScale, y + - cmd.y * yScale); + } else if (cmd.type === 'Z') { + p.closePath(); + } + } + return p; + }; + /** + * Split the glyph into contours. + * This function is here for backwards compatibility, and to + * provide raw access to the TrueType glyph outlines. + * @return {Array} + */ + Glyph.prototype.getContours = function () { + var this$1 = this; + if (this.points === undefined) { + return []; + } + var contours = [ + ]; + var currentContour = [ + ]; + for (var i = 0; i < this.points.length; i += 1) { + var pt = this$1.points[i]; + currentContour.push(pt); + if (pt.lastPointOfContour) { + contours.push(currentContour); + currentContour = [ + ]; + } + } + check.argument(currentContour.length === 0, 'There are still points left in the current contour.'); + return contours; + }; + /** + * Calculate the xMin/yMin/xMax/yMax/lsb/rsb for a Glyph. + * @return {Object} + */ + Glyph.prototype.getMetrics = function () { + var commands = this.path.commands; + var xCoords = [ + ]; + var yCoords = [ + ]; + for (var i = 0; i < commands.length; i += 1) { + var cmd = commands[i]; + if (cmd.type !== 'Z') { + xCoords.push(cmd.x); + yCoords.push(cmd.y); + } + if (cmd.type === 'Q' || cmd.type === 'C') { + xCoords.push(cmd.x1); + yCoords.push(cmd.y1); + } + if (cmd.type === 'C') { + xCoords.push(cmd.x2); + yCoords.push(cmd.y2); + } + } + var metrics = { + xMin: Math.min.apply(null, xCoords), + yMin: Math.min.apply(null, yCoords), + xMax: Math.max.apply(null, xCoords), + yMax: Math.max.apply(null, yCoords), + leftSideBearing: this.leftSideBearing + }; + if (!isFinite(metrics.xMin)) { + metrics.xMin = 0; + } + if (!isFinite(metrics.xMax)) { + metrics.xMax = this.advanceWidth; + } + if (!isFinite(metrics.yMin)) { + metrics.yMin = 0; + } + if (!isFinite(metrics.yMax)) { + metrics.yMax = 0; + } + metrics.rightSideBearing = this.advanceWidth - metrics.leftSideBearing - (metrics.xMax - metrics.xMin); + return metrics; + }; + /** + * Draw the glyph on the given context. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {Object=} options - xScale, yScale to stretch the glyph. + */ + Glyph.prototype.draw = function (ctx, x, y, fontSize, options) { + this.getPath(x, y, fontSize, options).draw(ctx); + }; + /** + * Draw the points of the glyph. + * On-curve points will be drawn in blue, off-curve points will be drawn in red. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + */ + Glyph.prototype.drawPoints = function (ctx, x, y, fontSize) { + function drawCircles(l, x, y, scale) { + var PI_SQ = Math.PI * 2; + ctx.beginPath(); + for (var j = 0; j < l.length; j += 1) { + ctx.moveTo(x + l[j].x * scale, y + l[j].y * scale); + ctx.arc(x + l[j].x * scale, y + l[j].y * scale, 2, 0, PI_SQ, false); + } + ctx.closePath(); + ctx.fill(); + } + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 24; + var scale = 1 / this.path.unitsPerEm * fontSize; + var blueCircles = [ + ]; + var redCircles = [ + ]; + var path = this.path; + for (var i = 0; i < path.commands.length; i += 1) { + var cmd = path.commands[i]; + if (cmd.x !== undefined) { + blueCircles.push({ + x: cmd.x, + y: - cmd.y + }); + } + if (cmd.x1 !== undefined) { + redCircles.push({ + x: cmd.x1, + y: - cmd.y1 + }); + } + if (cmd.x2 !== undefined) { + redCircles.push({ + x: cmd.x2, + y: - cmd.y2 + }); + } + } + ctx.fillStyle = 'blue'; + drawCircles(blueCircles, x, y, scale); + ctx.fillStyle = 'red'; + drawCircles(redCircles, x, y, scale); + }; + /** + * Draw lines indicating important font measurements. + * Black lines indicate the origin of the coordinate system (point 0,0). + * Blue lines indicate the glyph bounding box. + * Green line indicates the advance width of the glyph. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + */ + Glyph.prototype.drawMetrics = function (ctx, x, y, fontSize) { + var scale; + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 24; + scale = 1 / this.path.unitsPerEm * fontSize; + ctx.lineWidth = 1; + // Draw the origin + ctx.strokeStyle = 'black'; + draw.line(ctx, x, - 10000, x, 10000); + draw.line(ctx, - 10000, y, 10000, y); + // This code is here due to memory optimization: by not using + // defaults in the constructor, we save a notable amount of memory. + var xMin = this.xMin || 0; + var yMin = this.yMin || 0; + var xMax = this.xMax || 0; + var yMax = this.yMax || 0; + var advanceWidth = this.advanceWidth || 0; + // Draw the glyph box + ctx.strokeStyle = 'blue'; + draw.line(ctx, x + xMin * scale, - 10000, x + xMin * scale, 10000); + draw.line(ctx, x + xMax * scale, - 10000, x + xMax * scale, 10000); + draw.line(ctx, - 10000, y + - yMin * scale, 10000, y + - yMin * scale); + draw.line(ctx, - 10000, y + - yMax * scale, 10000, y + - yMax * scale); + // Draw the advance width + ctx.strokeStyle = 'green'; + draw.line(ctx, x + advanceWidth * scale, - 10000, x + advanceWidth * scale, 10000); + }; + // The GlyphSet object + // Define a property on the glyph that depends on the path being loaded. + function defineDependentProperty(glyph, externalName, internalName) { + Object.defineProperty(glyph, externalName, { + get: function () { + // Request the path property to make sure the path is loaded. + glyph.path; // jshint ignore:line + return glyph[internalName]; + }, + set: function (newValue) { + glyph[internalName] = newValue; + }, + enumerable: true, + configurable: true + }); + } /** + * A GlyphSet represents all glyphs available in the font, but modelled using + * a deferred glyph loader, for retrieving glyphs only once they are absolutely + * necessary, to keep the memory footprint down. + * @exports opentype.GlyphSet + * @class + * @param {opentype.Font} + * @param {Array} + */ + + function GlyphSet(font, glyphs) { + var this$1 = this; + this.font = font; + this.glyphs = { + }; + if (Array.isArray(glyphs)) { + for (var i = 0; i < glyphs.length; i++) { + this$1.glyphs[i] = glyphs[i]; + } + } + this.length = glyphs && glyphs.length || 0; + } /** + * @param {number} index + * @return {opentype.Glyph} + */ + + GlyphSet.prototype.get = function (index) { + if (typeof this.glyphs[index] === 'function') { + this.glyphs[index] = this.glyphs[index](); + } + return this.glyphs[index]; + }; + /** + * @param {number} index + * @param {Object} + */ + GlyphSet.prototype.push = function (index, loader) { + this.glyphs[index] = loader; + this.length++; + }; + /** + * @alias opentype.glyphLoader + * @param {opentype.Font} font + * @param {number} index + * @return {opentype.Glyph} + */ + function glyphLoader(font, index) { + return new Glyph({ + index: index, + font: font + }); + } /** + * Generate a stub glyph that can be filled with all metadata *except* + * the "points" and "path" properties, which must be loaded only once + * the glyph's path is actually requested for text shaping. + * @alias opentype.ttfGlyphLoader + * @param {opentype.Font} font + * @param {number} index + * @param {Function} parseGlyph + * @param {Object} data + * @param {number} position + * @param {Function} buildPath + * @return {opentype.Glyph} + */ + + function ttfGlyphLoader(font, index, parseGlyph, data, position, buildPath) { + return function () { + var glyph = new Glyph({ + index: index, + font: font + }); + glyph.path = function () { + parseGlyph(glyph, data, position); + var path = buildPath(font.glyphs, glyph); + path.unitsPerEm = font.unitsPerEm; + return path; + }; + defineDependentProperty(glyph, 'xMin', '_xMin'); + defineDependentProperty(glyph, 'xMax', '_xMax'); + defineDependentProperty(glyph, 'yMin', '_yMin'); + defineDependentProperty(glyph, 'yMax', '_yMax'); + return glyph; + }; + } /** + * @alias opentype.cffGlyphLoader + * @param {opentype.Font} font + * @param {number} index + * @param {Function} parseCFFCharstring + * @param {string} charstring + * @return {opentype.Glyph} + */ + + function cffGlyphLoader(font, index, parseCFFCharstring, charstring) { + return function () { + var glyph = new Glyph({ + index: index, + font: font + }); + glyph.path = function () { + var path = parseCFFCharstring(font, glyph, charstring); + path.unitsPerEm = font.unitsPerEm; + return path; + }; + return glyph; + }; + } + var glyphset = { + GlyphSet: GlyphSet, + glyphLoader: glyphLoader, + ttfGlyphLoader: ttfGlyphLoader, + cffGlyphLoader: cffGlyphLoader + }; + // The `CFF` table contains the glyph outlines in PostScript format. + // Custom equals function that can also check lists. + function equals(a, b) { + if (a === b) { + return true; + } else if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0; i < a.length; i += 1) { + if (!equals(a[i], b[i])) { + return false; + } + } + return true; + } else { + return false; + } + } // Subroutines are encoded using the negative half of the number space. + // See type 2 chapter 4.7 "Subroutine operators". + + function calcCFFSubroutineBias(subrs) { + var bias; + if (subrs.length < 1240) { + bias = 107; + } else if (subrs.length < 33900) { + bias = 1131; + } else { + bias = 32768; + } + return bias; + } // Parse a `CFF` INDEX array. + // An index array consists of a list of offsets, then a list of objects at those offsets. + + function parseCFFIndex(data, start, conversionFn) { + var offsets = [ + ]; + var objects = [ + ]; + var count = parse.getCard16(data, start); + var objectOffset; + var endOffset; + if (count !== 0) { + var offsetSize = parse.getByte(data, start + 2); + objectOffset = start + (count + 1) * offsetSize + 2; + var pos = start + 3; + for (var i = 0; i < count + 1; i += 1) { + offsets.push(parse.getOffset(data, pos, offsetSize)); + pos += offsetSize; + } // The total size of the index array is 4 header bytes + the value of the last offset. + + endOffset = objectOffset + offsets[count]; + } else { + endOffset = start + 2; + } + for (var i$1 = 0; i$1 < offsets.length - 1; i$1 += 1) { + var value = parse.getBytes(data, objectOffset + offsets[i$1], objectOffset + offsets[i$1 + 1]); + if (conversionFn) { + value = conversionFn(value); + } + objects.push(value); + } + return { + objects: objects, + startOffset: start, + endOffset: endOffset + }; + } // Parse a `CFF` DICT real value. + + function parseFloatOperand(parser) { + var s = ''; + var eof = 15; + var lookup = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '.', + 'E', + 'E-', + null, + '-' + ]; + while (true) { + var b = parser.parseByte(); + var n1 = b >> 4; + var n2 = b & 15; + if (n1 === eof) { + break; + } + s += lookup[n1]; + if (n2 === eof) { + break; + } + s += lookup[n2]; + } + return parseFloat(s); + } // Parse a `CFF` DICT operand. + + function parseOperand(parser, b0) { + var b1; + var b2; + var b3; + var b4; + if (b0 === 28) { + b1 = parser.parseByte(); + b2 = parser.parseByte(); + return b1 << 8 | b2; + } + if (b0 === 29) { + b1 = parser.parseByte(); + b2 = parser.parseByte(); + b3 = parser.parseByte(); + b4 = parser.parseByte(); + return b1 << 24 | b2 << 16 | b3 << 8 | b4; + } + if (b0 === 30) { + return parseFloatOperand(parser); + } + if (b0 >= 32 && b0 <= 246) { + return b0 - 139; + } + if (b0 >= 247 && b0 <= 250) { + b1 = parser.parseByte(); + return (b0 - 247) * 256 + b1 + 108; + } + if (b0 >= 251 && b0 <= 254) { + b1 = parser.parseByte(); + return - (b0 - 251) * 256 - b1 - 108; + } + throw new Error('Invalid b0 ' + b0); + } // Convert the entries returned by `parseDict` to a proper dictionary. + // If a value is a list of one, it is unpacked. + + function entriesToObject(entries) { + var o = { + }; + for (var i = 0; i < entries.length; i += 1) { + var key = entries[i][0]; + var values = entries[i][1]; + var value = void 0; + if (values.length === 1) { + value = values[0]; + } else { + value = values; + } + if (o.hasOwnProperty(key) && !isNaN(o[key])) { + throw new Error('Object ' + o + ' already has key ' + key); + } + o[key] = value; + } + return o; + } // Parse a `CFF` DICT object. + // A dictionary contains key-value pairs in a compact tokenized format. + + function parseCFFDict(data, start, size) { + start = start !== undefined ? start : 0; + var parser = new parse.Parser(data, start); + var entries = [ + ]; + var operands = [ + ]; + size = size !== undefined ? size : data.length; + while (parser.relativeOffset < size) { + var op = parser.parseByte(); + // The first byte for each dict item distinguishes between operator (key) and operand (value). + // Values <= 21 are operators. + if (op <= 21) { + // Two-byte operators have an initial escape byte of 12. + if (op === 12) { + op = 1200 + parser.parseByte(); + } + entries.push([op, + operands]); + operands = [ + ]; + } else { + // Since the operands (values) come before the operators (keys), we store all operands in a list + // until we encounter an operator. + operands.push(parseOperand(parser, op)); + } + } + return entriesToObject(entries); + } // Given a String Index (SID), return the value of the string. + // Strings below index 392 are standard CFF strings and are not encoded in the font. + + function getCFFString(strings, index) { + if (index <= 390) { + index = cffStandardStrings[index]; + } else { + index = strings[index - 391]; + } + return index; + } // Interpret a dictionary and return a new dictionary with readable keys and values for missing entries. + // This function takes `meta` which is a list of objects containing `operand`, `name` and `default`. + + function interpretDict(dict, meta, strings) { + var newDict = { + }; + var value; + // Because we also want to include missing values, we start out from the meta list + // and lookup values in the dict. + for (var i = 0; i < meta.length; i += 1) { + var m = meta[i]; + if (Array.isArray(m.type)) { + var values = [ + ]; + values.length = m.type.length; + for (var j = 0; j < m.type.length; j++) { + value = dict[m.op] !== undefined ? dict[m.op][j] : undefined; + if (value === undefined) { + value = m.value !== undefined && m.value[j] !== undefined ? m.value[j] : null; + } + if (m.type[j] === 'SID') { + value = getCFFString(strings, value); + } + values[j] = value; + } + newDict[m.name] = values; + } else { + value = dict[m.op]; + if (value === undefined) { + value = m.value !== undefined ? m.value : null; + } + if (m.type === 'SID') { + value = getCFFString(strings, value); + } + newDict[m.name] = value; + } + } + return newDict; + } // Parse the CFF header. + + function parseCFFHeader(data, start) { + var header = { + }; + header.formatMajor = parse.getCard8(data, start); + header.formatMinor = parse.getCard8(data, start + 1); + header.size = parse.getCard8(data, start + 2); + header.offsetSize = parse.getCard8(data, start + 3); + header.startOffset = start; + header.endOffset = start + 4; + return header; + } + var TOP_DICT_META = [ + { + name: 'version', + op: 0, + type: 'SID' + }, + { + name: 'notice', + op: 1, + type: 'SID' + }, + { + name: 'copyright', + op: 1200, + type: 'SID' + }, + { + name: 'fullName', + op: 2, + type: 'SID' + }, + { + name: 'familyName', + op: 3, + type: 'SID' + }, + { + name: 'weight', + op: 4, + type: 'SID' + }, + { + name: 'isFixedPitch', + op: 1201, + type: 'number', + value: 0 + }, + { + name: 'italicAngle', + op: 1202, + type: 'number', + value: 0 + }, + { + name: 'underlinePosition', + op: 1203, + type: 'number', + value: - 100 + }, + { + name: 'underlineThickness', + op: 1204, + type: 'number', + value: 50 + }, + { + name: 'paintType', + op: 1205, + type: 'number', + value: 0 + }, + { + name: 'charstringType', + op: 1206, + type: 'number', + value: 2 + }, + { + name: 'fontMatrix', + op: 1207, + type: [ + 'real', + 'real', + 'real', + 'real', + 'real', + 'real' + ], + value: [ + 0.001, + 0, + 0, + 0.001, + 0, + 0 + ] + }, + { + name: 'uniqueId', + op: 13, + type: 'number' + }, + { + name: 'fontBBox', + op: 5, + type: [ + 'number', + 'number', + 'number', + 'number' + ], + value: [ + 0, + 0, + 0, + 0 + ] + }, + { + name: 'strokeWidth', + op: 1208, + type: 'number', + value: 0 + }, + { + name: 'xuid', + op: 14, + type: [ + ], + value: null + }, + { + name: 'charset', + op: 15, + type: 'offset', + value: 0 + }, + { + name: 'encoding', + op: 16, + type: 'offset', + value: 0 + }, + { + name: 'charStrings', + op: 17, + type: 'offset', + value: 0 + }, + { + name: 'private', + op: 18, + type: [ + 'number', + 'offset' + ], + value: [ + 0, + 0 + ] + }, + { + name: 'ros', + op: 1230, + type: [ + 'SID', + 'SID', + 'number' + ] + }, + { + name: 'cidFontVersion', + op: 1231, + type: 'number', + value: 0 + }, + { + name: 'cidFontRevision', + op: 1232, + type: 'number', + value: 0 + }, + { + name: 'cidFontType', + op: 1233, + type: 'number', + value: 0 + }, + { + name: 'cidCount', + op: 1234, + type: 'number', + value: 8720 + }, + { + name: 'uidBase', + op: 1235, + type: 'number' + }, + { + name: 'fdArray', + op: 1236, + type: 'offset' + }, + { + name: 'fdSelect', + op: 1237, + type: 'offset' + }, + { + name: 'fontName', + op: 1238, + type: 'SID' + } + ]; + var PRIVATE_DICT_META = [ + { + name: 'subrs', + op: 19, + type: 'offset', + value: 0 + }, + { + name: 'defaultWidthX', + op: 20, + type: 'number', + value: 0 + }, + { + name: 'nominalWidthX', + op: 21, + type: 'number', + value: 0 + } + ]; + // Parse the CFF top dictionary. A CFF table can contain multiple fonts, each with their own top dictionary. + // The top dictionary contains the essential metadata for the font, together with the private dictionary. + function parseCFFTopDict(data, strings) { + var dict = parseCFFDict(data, 0, data.byteLength); + return interpretDict(dict, TOP_DICT_META, strings); + } // Parse the CFF private dictionary. We don't fully parse out all the values, only the ones we need. + + function parseCFFPrivateDict(data, start, size, strings) { + var dict = parseCFFDict(data, start, size); + return interpretDict(dict, PRIVATE_DICT_META, strings); + } // Returns a list of "Top DICT"s found using an INDEX list. + // Used to read both the usual high-level Top DICTs and also the FDArray + // discovered inside CID-keyed fonts. When a Top DICT has a reference to + // a Private DICT that is read and saved into the Top DICT. + // + // In addition to the expected/optional values as outlined in TOP_DICT_META + // the following values might be saved into the Top DICT. + // + // _subrs [] array of local CFF subroutines from Private DICT + // _subrsBias bias value computed from number of subroutines + // (see calcCFFSubroutineBias() and parseCFFCharstring()) + // _defaultWidthX default widths for CFF characters + // _nominalWidthX bias added to width embedded within glyph description + // + // _privateDict saved copy of parsed Private DICT from Top DICT + + function gatherCFFTopDicts(data, start, cffIndex, strings) { + var topDictArray = [ + ]; + for (var iTopDict = 0; iTopDict < cffIndex.length; iTopDict += 1) { + var topDictData = new DataView(new Uint8Array(cffIndex[iTopDict]).buffer); + var topDict = parseCFFTopDict(topDictData, strings); + topDict._subrs = [ + ]; + topDict._subrsBias = 0; + var privateSize = topDict.private[0]; + var privateOffset = topDict.private[1]; + if (privateSize !== 0 && privateOffset !== 0) { + var privateDict = parseCFFPrivateDict(data, privateOffset + start, privateSize, strings); + topDict._defaultWidthX = privateDict.defaultWidthX; + topDict._nominalWidthX = privateDict.nominalWidthX; + if (privateDict.subrs !== 0) { + var subrOffset = privateOffset + privateDict.subrs; + var subrIndex = parseCFFIndex(data, subrOffset + start); + topDict._subrs = subrIndex.objects; + topDict._subrsBias = calcCFFSubroutineBias(topDict._subrs); + } + topDict._privateDict = privateDict; + } + topDictArray.push(topDict); + } + return topDictArray; + } // Parse the CFF charset table, which contains internal names for all the glyphs. + // This function will return a list of glyph names. + // See Adobe TN #5176 chapter 13, "Charsets". + + function parseCFFCharset(data, start, nGlyphs, strings) { + var sid; + var count; + var parser = new parse.Parser(data, start); + // The .notdef glyph is not included, so subtract 1. + nGlyphs -= 1; + var charset = [ + '.notdef' + ]; + var format = parser.parseCard8(); + if (format === 0) { + for (var i = 0; i < nGlyphs; i += 1) { + sid = parser.parseSID(); + charset.push(getCFFString(strings, sid)); + } + } else if (format === 1) { + while (charset.length <= nGlyphs) { + sid = parser.parseSID(); + count = parser.parseCard8(); + for (var i$1 = 0; i$1 <= count; i$1 += 1) { + charset.push(getCFFString(strings, sid)); + sid += 1; + } + } + } else if (format === 2) { + while (charset.length <= nGlyphs) { + sid = parser.parseSID(); + count = parser.parseCard16(); + for (var i$2 = 0; i$2 <= count; i$2 += 1) { + charset.push(getCFFString(strings, sid)); + sid += 1; + } + } + } else { + throw new Error('Unknown charset format ' + format); + } + return charset; + } // Parse the CFF encoding data. Only one encoding can be specified per font. + // See Adobe TN #5176 chapter 12, "Encodings". + + function parseCFFEncoding(data, start, charset) { + var code; + var enc = { + }; + var parser = new parse.Parser(data, start); + var format = parser.parseCard8(); + if (format === 0) { + var nCodes = parser.parseCard8(); + for (var i = 0; i < nCodes; i += 1) { + code = parser.parseCard8(); + enc[code] = i; + } + } else if (format === 1) { + var nRanges = parser.parseCard8(); + code = 1; + for (var i$1 = 0; i$1 < nRanges; i$1 += 1) { + var first = parser.parseCard8(); + var nLeft = parser.parseCard8(); + for (var j = first; j <= first + nLeft; j += 1) { + enc[j] = code; + code += 1; + } + } + } else { + throw new Error('Unknown encoding format ' + format); + } + return new CffEncoding(enc, charset); + } // Take in charstring code and return a Glyph object. + // The encoding is described in the Type 2 Charstring Format + // https://www.microsoft.com/typography/OTSPEC/charstr2.htm + + function parseCFFCharstring(font, glyph, code) { + var c1x; + var c1y; + var c2x; + var c2y; + var p = new Path(); + var stack = [ + ]; + var nStems = 0; + var haveWidth = false; + var open = false; + var x = 0; + var y = 0; + var subrs; + var subrsBias; + var defaultWidthX; + var nominalWidthX; + if (font.isCIDFont) { + var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index]; + var fdDict = font.tables.cff.topDict._fdArray[fdIndex]; + subrs = fdDict._subrs; + subrsBias = fdDict._subrsBias; + defaultWidthX = fdDict._defaultWidthX; + nominalWidthX = fdDict._nominalWidthX; + } else { + subrs = font.tables.cff.topDict._subrs; + subrsBias = font.tables.cff.topDict._subrsBias; + defaultWidthX = font.tables.cff.topDict._defaultWidthX; + nominalWidthX = font.tables.cff.topDict._nominalWidthX; + } + var width = defaultWidthX; + function newContour(x, y) { + if (open) { + p.closePath(); + } + p.moveTo(x, y); + open = true; + } + function parseStems() { + var hasWidthArg; + // The number of stem operators on the stack is always even. + // If the value is uneven, that means a width is specified. + hasWidthArg = stack.length % 2 !== 0; + if (hasWidthArg && !haveWidth) { + width = stack.shift() + nominalWidthX; + } + nStems += stack.length >> 1; + stack.length = 0; + haveWidth = true; + } + function parse$$1(code) { + var b1; + var b2; + var b3; + var b4; + var codeIndex; + var subrCode; + var jpx; + var jpy; + var c3x; + var c3y; + var c4x; + var c4y; + var i = 0; + while (i < code.length) { + var v = code[i]; + i += 1; + switch (v) { + case 1: + // hstem + parseStems(); + break; + case 3: + // vstem + parseStems(); + break; + case 4: + // vmoveto + if (stack.length > 1 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + y += stack.pop(); + newContour(x, y); + break; + case 5: + // rlineto + while (stack.length > 0) { + x += stack.shift(); + y += stack.shift(); + p.lineTo(x, y); + } + break; + case 6: + // hlineto + while (stack.length > 0) { + x += stack.shift(); + p.lineTo(x, y); + if (stack.length === 0) { + break; + } + y += stack.shift(); + p.lineTo(x, y); + } + break; + case 7: + // vlineto + while (stack.length > 0) { + y += stack.shift(); + p.lineTo(x, y); + if (stack.length === 0) { + break; + } + x += stack.shift(); + p.lineTo(x, y); + } + break; + case 8: + // rrcurveto + while (stack.length > 0) { + c1x = x + stack.shift(); + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 10: + // callsubr + codeIndex = stack.pop() + subrsBias; + subrCode = subrs[codeIndex]; + if (subrCode) { + parse$$1(subrCode); + } + break; + case 11: + // return + return; + case 12: + // flex operators + v = code[i]; + i += 1; + switch (v) { + case 35: + // flex + // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |- + c1x = x + stack.shift(); // dx1 + c1y = y + stack.shift(); // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y + stack.shift(); // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = jpy + stack.shift(); // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = c3y + stack.shift(); // dy5 + x = c4x + stack.shift(); // dx6 + y = c4y + stack.shift(); // dy6 + stack.shift(); // flex depth + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + case 34: + // hflex + // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |- + c1x = x + stack.shift(); // dx1 + c1y = y; // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y; // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = c2y; // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = y; // dy5 + x = c4x + stack.shift(); // dx6 + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + case 36: + // hflex1 + // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |- + c1x = x + stack.shift(); // dx1 + c1y = y + stack.shift(); // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y; // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = c2y; // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = c3y + stack.shift(); // dy5 + x = c4x + stack.shift(); // dx6 + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + case 37: + // flex1 + // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |- + c1x = x + stack.shift(); // dx1 + c1y = y + stack.shift(); // dy1 + c2x = c1x + stack.shift(); // dx2 + c2y = c1y + stack.shift(); // dy2 + jpx = c2x + stack.shift(); // dx3 + jpy = c2y + stack.shift(); // dy3 + c3x = jpx + stack.shift(); // dx4 + c3y = jpy + stack.shift(); // dy4 + c4x = c3x + stack.shift(); // dx5 + c4y = c3y + stack.shift(); // dy5 + if (Math.abs(c4x - x) > Math.abs(c4y - y)) { + x = c4x + stack.shift(); + } else { + y = c4y + stack.shift(); + } + p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); + p.curveTo(c3x, c3y, c4x, c4y, x, y); + break; + default: + console.log('Glyph ' + glyph.index + ': unknown operator ' + 1200 + v); + stack.length = 0; + } + break; + case 14: + // endchar + if (stack.length > 0 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + if (open) { + p.closePath(); + open = false; + } + break; + case 18: + // hstemhm + parseStems(); + break; + case 19: // hintmask + case 20: + // cntrmask + parseStems(); + i += nStems + 7 >> 3; + break; + case 21: + // rmoveto + if (stack.length > 2 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + y += stack.pop(); + x += stack.pop(); + newContour(x, y); + break; + case 22: + // hmoveto + if (stack.length > 1 && !haveWidth) { + width = stack.shift() + nominalWidthX; + haveWidth = true; + } + x += stack.pop(); + newContour(x, y); + break; + case 23: + // vstemhm + parseStems(); + break; + case 24: + // rcurveline + while (stack.length > 2) { + c1x = x + stack.shift(); + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + x += stack.shift(); + y += stack.shift(); + p.lineTo(x, y); + break; + case 25: + // rlinecurve + while (stack.length > 6) { + x += stack.shift(); + y += stack.shift(); + p.lineTo(x, y); + } + c1x = x + stack.shift(); + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + break; + case 26: + // vvcurveto + if (stack.length % 2) { + x += stack.shift(); + } + while (stack.length > 0) { + c1x = x; + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x; + y = c2y + stack.shift(); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 27: + // hhcurveto + if (stack.length % 2) { + y += stack.shift(); + } + while (stack.length > 0) { + c1x = x + stack.shift(); + c1y = y; + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y; + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 28: + // shortint + b1 = code[i]; + b2 = code[i + 1]; + stack.push((b1 << 24 | b2 << 16) >> 16); + i += 2; + break; + case 29: + // callgsubr + codeIndex = stack.pop() + font.gsubrsBias; + subrCode = font.gsubrs[codeIndex]; + if (subrCode) { + parse$$1(subrCode); + } + break; + case 30: + // vhcurveto + while (stack.length > 0) { + c1x = x; + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + if (stack.length === 0) { + break; + } + c1x = x + stack.shift(); + c1y = y; + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + y = c2y + stack.shift(); + x = c2x + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + case 31: + // hvcurveto + while (stack.length > 0) { + c1x = x + stack.shift(); + c1y = y; + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + y = c2y + stack.shift(); + x = c2x + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + if (stack.length === 0) { + break; + } + c1x = x; + c1y = y + stack.shift(); + c2x = c1x + stack.shift(); + c2y = c1y + stack.shift(); + x = c2x + stack.shift(); + y = c2y + (stack.length === 1 ? stack.shift() : 0); + p.curveTo(c1x, c1y, c2x, c2y, x, y); + } + break; + default: + if (v < 32) { + console.log('Glyph ' + glyph.index + ': unknown operator ' + v); + } else if (v < 247) { + stack.push(v - 139); + } else if (v < 251) { + b1 = code[i]; + i += 1; + stack.push((v - 247) * 256 + b1 + 108); + } else if (v < 255) { + b1 = code[i]; + i += 1; + stack.push( - (v - 251) * 256 - b1 - 108); + } else { + b1 = code[i]; + b2 = code[i + 1]; + b3 = code[i + 2]; + b4 = code[i + 3]; + i += 4; + stack.push((b1 << 24 | b2 << 16 | b3 << 8 | b4) / 65536); + } + } + } + } + parse$$1(code); + glyph.advanceWidth = width; + return p; + } + function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) { + var fdSelect = [ + ]; + var fdIndex; + var parser = new parse.Parser(data, start); + var format = parser.parseCard8(); + if (format === 0) { + // Simple list of nGlyphs elements + for (var iGid = 0; iGid < nGlyphs; iGid++) { + fdIndex = parser.parseCard8(); + if (fdIndex >= fdArrayCount) { + throw new Error('CFF table CID Font FDSelect has bad FD index value ' + fdIndex + ' (FD count ' + fdArrayCount + ')'); + } + fdSelect.push(fdIndex); + } + } else if (format === 3) { + // Ranges + var nRanges = parser.parseCard16(); + var first = parser.parseCard16(); + if (first !== 0) { + throw new Error('CFF Table CID Font FDSelect format 3 range has bad initial GID ' + first); + } + var next; + for (var iRange = 0; iRange < nRanges; iRange++) { + fdIndex = parser.parseCard8(); + next = parser.parseCard16(); + if (fdIndex >= fdArrayCount) { + throw new Error('CFF table CID Font FDSelect has bad FD index value ' + fdIndex + ' (FD count ' + fdArrayCount + ')'); + } + if (next > nGlyphs) { + throw new Error('CFF Table CID Font FDSelect format 3 range has bad GID ' + next); + } + for (; first < next; first++) { + fdSelect.push(fdIndex); + } + first = next; + } + if (next !== nGlyphs) { + throw new Error('CFF Table CID Font FDSelect format 3 range has bad final GID ' + next); + } + } else { + throw new Error('CFF Table CID Font FDSelect table has unsupported format ' + format); + } + return fdSelect; + } // Parse the `CFF` table, which contains the glyph outlines in PostScript format. + + function parseCFFTable(data, start, font) { + font.tables.cff = { + }; + var header = parseCFFHeader(data, start); + var nameIndex = parseCFFIndex(data, header.endOffset, parse.bytesToString); + var topDictIndex = parseCFFIndex(data, nameIndex.endOffset); + var stringIndex = parseCFFIndex(data, topDictIndex.endOffset, parse.bytesToString); + var globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset); + font.gsubrs = globalSubrIndex.objects; + font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs); + var topDictArray = gatherCFFTopDicts(data, start, topDictIndex.objects, stringIndex.objects); + if (topDictArray.length !== 1) { + throw new Error('CFF table has too many fonts in \'FontSet\' - count of fonts NameIndex.length = ' + topDictArray.length); + } + var topDict = topDictArray[0]; + font.tables.cff.topDict = topDict; + if (topDict._privateDict) { + font.defaultWidthX = topDict._privateDict.defaultWidthX; + font.nominalWidthX = topDict._privateDict.nominalWidthX; + } + if (topDict.ros[0] !== undefined && topDict.ros[1] !== undefined) { + font.isCIDFont = true; + } + if (font.isCIDFont) { + var fdArrayOffset = topDict.fdArray; + var fdSelectOffset = topDict.fdSelect; + if (fdArrayOffset === 0 || fdSelectOffset === 0) { + throw new Error('Font is marked as a CID font, but FDArray and/or FDSelect information is missing'); + } + fdArrayOffset += start; + var fdArrayIndex = parseCFFIndex(data, fdArrayOffset); + var fdArray = gatherCFFTopDicts(data, start, fdArrayIndex.objects, stringIndex.objects); + topDict._fdArray = fdArray; + fdSelectOffset += start; + topDict._fdSelect = parseCFFFDSelect(data, fdSelectOffset, font.numGlyphs, fdArray.length); + } + var privateDictOffset = start + topDict.private[1]; + var privateDict = parseCFFPrivateDict(data, privateDictOffset, topDict.private[0], stringIndex.objects); + font.defaultWidthX = privateDict.defaultWidthX; + font.nominalWidthX = privateDict.nominalWidthX; + if (privateDict.subrs !== 0) { + var subrOffset = privateDictOffset + privateDict.subrs; + var subrIndex = parseCFFIndex(data, subrOffset); + font.subrs = subrIndex.objects; + font.subrsBias = calcCFFSubroutineBias(font.subrs); + } else { + font.subrs = [ + ]; + font.subrsBias = 0; + } // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset. + + var charStringsIndex = parseCFFIndex(data, start + topDict.charStrings); + font.nGlyphs = charStringsIndex.objects.length; + var charset = parseCFFCharset(data, start + topDict.charset, font.nGlyphs, stringIndex.objects); + if (topDict.encoding === 0) { + // Standard encoding + font.cffEncoding = new CffEncoding(cffStandardEncoding, charset); + } else if (topDict.encoding === 1) { + // Expert encoding + font.cffEncoding = new CffEncoding(cffExpertEncoding, charset); + } else { + font.cffEncoding = parseCFFEncoding(data, start + topDict.encoding, charset); + } // Prefer the CMAP encoding to the CFF encoding. + + font.encoding = font.encoding || font.cffEncoding; + font.glyphs = new glyphset.GlyphSet(font); + for (var i = 0; i < font.nGlyphs; i += 1) { + var charString = charStringsIndex.objects[i]; + font.glyphs.push(i, glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)); + } + } // Convert a string to a String ID (SID). + // The list of strings is modified in place. + + function encodeString(s, strings) { + var sid; + // Is the string in the CFF standard strings? + var i = cffStandardStrings.indexOf(s); + if (i >= 0) { + sid = i; + } // Is the string already in the string index? + + i = strings.indexOf(s); + if (i >= 0) { + sid = i + cffStandardStrings.length; + } else { + sid = cffStandardStrings.length + strings.length; + strings.push(s); + } + return sid; + } + function makeHeader() { + return new table.Record('Header', [ + { + name: 'major', + type: 'Card8', + value: 1 + }, + { + name: 'minor', + type: 'Card8', + value: 0 + }, + { + name: 'hdrSize', + type: 'Card8', + value: 4 + }, + { + name: 'major', + type: 'Card8', + value: 1 + } + ]); + } + function makeNameIndex(fontNames) { + var t = new table.Record('Name INDEX', [ + { + name: 'names', + type: 'INDEX', + value: [ + ] + } + ]); + t.names = [ + ]; + for (var i = 0; i < fontNames.length; i += 1) { + t.names.push({ + name: 'name_' + i, + type: 'NAME', + value: fontNames[i] + }); + } + return t; + } // Given a dictionary's metadata, create a DICT structure. + + function makeDict(meta, attrs, strings) { + var m = { + }; + for (var i = 0; i < meta.length; i += 1) { + var entry = meta[i]; + var value = attrs[entry.name]; + if (value !== undefined && !equals(value, entry.value)) { + if (entry.type === 'SID') { + value = encodeString(value, strings); + } + m[entry.op] = { + name: entry.name, + type: entry.type, + value: value + }; + } + } + return m; + } // The Top DICT houses the global font attributes. + + function makeTopDict(attrs, strings) { + var t = new table.Record('Top DICT', [ + { + name: 'dict', + type: 'DICT', + value: { + } + } + ]); + t.dict = makeDict(TOP_DICT_META, attrs, strings); + return t; + } + function makeTopDictIndex(topDict) { + var t = new table.Record('Top DICT INDEX', [ + { + name: 'topDicts', + type: 'INDEX', + value: [ + ] + } + ]); + t.topDicts = [ + { + name: 'topDict_0', + type: 'TABLE', + value: topDict + } + ]; + return t; + } + function makeStringIndex(strings) { + var t = new table.Record('String INDEX', [ + { + name: 'strings', + type: 'INDEX', + value: [ + ] + } + ]); + t.strings = [ + ]; + for (var i = 0; i < strings.length; i += 1) { + t.strings.push({ + name: 'string_' + i, + type: 'STRING', + value: strings[i] + }); + } + return t; + } + function makeGlobalSubrIndex() { + // Currently we don't use subroutines. + return new table.Record('Global Subr INDEX', [ + { + name: 'subrs', + type: 'INDEX', + value: [ + ] + } + ]); + } + function makeCharsets(glyphNames, strings) { + var t = new table.Record('Charsets', [ + { + name: 'format', + type: 'Card8', + value: 0 + } + ]); + for (var i = 0; i < glyphNames.length; i += 1) { + var glyphName = glyphNames[i]; + var glyphSID = encodeString(glyphName, strings); + t.fields.push({ + name: 'glyph_' + i, + type: 'SID', + value: glyphSID + }); + } + return t; + } + function glyphToOps(glyph) { + var ops = [ + ]; + var path = glyph.path; + ops.push({ + name: 'width', + type: 'NUMBER', + value: glyph.advanceWidth + }); + var x = 0; + var y = 0; + for (var i = 0; i < path.commands.length; i += 1) { + var dx = void 0; + var dy = void 0; + var cmd = path.commands[i]; + if (cmd.type === 'Q') { + // CFF only supports bézier curves, so convert the quad to a bézier. + var _13 = 1 / 3; + var _23 = 2 / 3; + // We're going to create a new command so we don't change the original path. + cmd = { + type: 'C', + x: cmd.x, + y: cmd.y, + x1: _13 * x + _23 * cmd.x1, + y1: _13 * y + _23 * cmd.y1, + x2: _13 * cmd.x + _23 * cmd.x1, + y2: _13 * cmd.y + _23 * cmd.y1 + }; + } + if (cmd.type === 'M') { + dx = Math.round(cmd.x - x); + dy = Math.round(cmd.y - y); + ops.push({ + name: 'dx', + type: 'NUMBER', + value: dx + }); + ops.push({ + name: 'dy', + type: 'NUMBER', + value: dy + }); + ops.push({ + name: 'rmoveto', + type: 'OP', + value: 21 + }); + x = Math.round(cmd.x); + y = Math.round(cmd.y); + } else if (cmd.type === 'L') { + dx = Math.round(cmd.x - x); + dy = Math.round(cmd.y - y); + ops.push({ + name: 'dx', + type: 'NUMBER', + value: dx + }); + ops.push({ + name: 'dy', + type: 'NUMBER', + value: dy + }); + ops.push({ + name: 'rlineto', + type: 'OP', + value: 5 + }); + x = Math.round(cmd.x); + y = Math.round(cmd.y); + } else if (cmd.type === 'C') { + var dx1 = Math.round(cmd.x1 - x); + var dy1 = Math.round(cmd.y1 - y); + var dx2 = Math.round(cmd.x2 - cmd.x1); + var dy2 = Math.round(cmd.y2 - cmd.y1); + dx = Math.round(cmd.x - cmd.x2); + dy = Math.round(cmd.y - cmd.y2); + ops.push({ + name: 'dx1', + type: 'NUMBER', + value: dx1 + }); + ops.push({ + name: 'dy1', + type: 'NUMBER', + value: dy1 + }); + ops.push({ + name: 'dx2', + type: 'NUMBER', + value: dx2 + }); + ops.push({ + name: 'dy2', + type: 'NUMBER', + value: dy2 + }); + ops.push({ + name: 'dx', + type: 'NUMBER', + value: dx + }); + ops.push({ + name: 'dy', + type: 'NUMBER', + value: dy + }); + ops.push({ + name: 'rrcurveto', + type: 'OP', + value: 8 + }); + x = Math.round(cmd.x); + y = Math.round(cmd.y); + } // Contours are closed automatically. + + } + ops.push({ + name: 'endchar', + type: 'OP', + value: 14 + }); + return ops; + } + function makeCharStringsIndex(glyphs) { + var t = new table.Record('CharStrings INDEX', [ + { + name: 'charStrings', + type: 'INDEX', + value: [ + ] + } + ]); + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + var ops = glyphToOps(glyph); + t.charStrings.push({ + name: glyph.name, + type: 'CHARSTRING', + value: ops + }); + } + return t; + } + function makePrivateDict(attrs, strings) { + var t = new table.Record('Private DICT', [ + { + name: 'dict', + type: 'DICT', + value: { + } + } + ]); + t.dict = makeDict(PRIVATE_DICT_META, attrs, strings); + return t; + } + function makeCFFTable(glyphs, options) { + var t = new table.Table('CFF ', [ + { + name: 'header', + type: 'RECORD' + }, + { + name: 'nameIndex', + type: 'RECORD' + }, + { + name: 'topDictIndex', + type: 'RECORD' + }, + { + name: 'stringIndex', + type: 'RECORD' + }, + { + name: 'globalSubrIndex', + type: 'RECORD' + }, + { + name: 'charsets', + type: 'RECORD' + }, + { + name: 'charStringsIndex', + type: 'RECORD' + }, + { + name: 'privateDict', + type: 'RECORD' + } + ]); + var fontScale = 1 / options.unitsPerEm; + // We use non-zero values for the offsets so that the DICT encodes them. + // This is important because the size of the Top DICT plays a role in offset calculation, + // and the size shouldn't change after we've written correct offsets. + var attrs = { + version: options.version, + fullName: options.fullName, + familyName: options.familyName, + weight: options.weightName, + fontBBox: options.fontBBox || [ + 0, + 0, + 0, + 0 + ], + fontMatrix: [ + fontScale, + 0, + 0, + fontScale, + 0, + 0 + ], + charset: 999, + encoding: 0, + charStrings: 999, + private: [ + 0, + 999 + ] + }; + var privateAttrs = { + }; + var glyphNames = [ + ]; + var glyph; + // Skip first glyph (.notdef) + for (var i = 1; i < glyphs.length; i += 1) { + glyph = glyphs.get(i); + glyphNames.push(glyph.name); + } + var strings = [ + ]; + t.header = makeHeader(); + t.nameIndex = makeNameIndex([options.postScriptName]); + var topDict = makeTopDict(attrs, strings); + t.topDictIndex = makeTopDictIndex(topDict); + t.globalSubrIndex = makeGlobalSubrIndex(); + t.charsets = makeCharsets(glyphNames, strings); + t.charStringsIndex = makeCharStringsIndex(glyphs); + t.privateDict = makePrivateDict(privateAttrs, strings); + // Needs to come at the end, to encode all custom strings used in the font. + t.stringIndex = makeStringIndex(strings); + var startOffset = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf(); + attrs.charset = startOffset; + // We use the CFF standard encoding; proper encoding will be handled in cmap. + attrs.encoding = 0; + attrs.charStrings = attrs.charset + t.charsets.sizeOf(); + attrs.private[1] = attrs.charStrings + t.charStringsIndex.sizeOf(); + // Recreate the Top DICT INDEX with the correct offsets. + topDict = makeTopDict(attrs, strings); + t.topDictIndex = makeTopDictIndex(topDict); + return t; + } + var cff = { + parse: parseCFFTable, + make: makeCFFTable + }; + // The `head` table contains global information about the font. + // Parse the header `head` table + function parseHeadTable(data, start) { + var head = { + }; + var p = new parse.Parser(data, start); + head.version = p.parseVersion(); + head.fontRevision = Math.round(p.parseFixed() * 1000) / 1000; + head.checkSumAdjustment = p.parseULong(); + head.magicNumber = p.parseULong(); + check.argument(head.magicNumber === 1594834165, 'Font header has wrong magic number.'); + head.flags = p.parseUShort(); + head.unitsPerEm = p.parseUShort(); + head.created = p.parseLongDateTime(); + head.modified = p.parseLongDateTime(); + head.xMin = p.parseShort(); + head.yMin = p.parseShort(); + head.xMax = p.parseShort(); + head.yMax = p.parseShort(); + head.macStyle = p.parseUShort(); + head.lowestRecPPEM = p.parseUShort(); + head.fontDirectionHint = p.parseShort(); + head.indexToLocFormat = p.parseShort(); + head.glyphDataFormat = p.parseShort(); + return head; + } + function makeHeadTable(options) { + // Apple Mac timestamp epoch is 01/01/1904 not 01/01/1970 + var timestamp = Math.round(new Date().getTime() / 1000) + 2082844800; + var createdTimestamp = timestamp; + if (options.createdTimestamp) { + createdTimestamp = options.createdTimestamp + 2082844800; + } + return new table.Table('head', [ + { + name: 'version', + type: 'FIXED', + value: 65536 + }, + { + name: 'fontRevision', + type: 'FIXED', + value: 65536 + }, + { + name: 'checkSumAdjustment', + type: 'ULONG', + value: 0 + }, + { + name: 'magicNumber', + type: 'ULONG', + value: 1594834165 + }, + { + name: 'flags', + type: 'USHORT', + value: 0 + }, + { + name: 'unitsPerEm', + type: 'USHORT', + value: 1000 + }, + { + name: 'created', + type: 'LONGDATETIME', + value: createdTimestamp + }, + { + name: 'modified', + type: 'LONGDATETIME', + value: timestamp + }, + { + name: 'xMin', + type: 'SHORT', + value: 0 + }, + { + name: 'yMin', + type: 'SHORT', + value: 0 + }, + { + name: 'xMax', + type: 'SHORT', + value: 0 + }, + { + name: 'yMax', + type: 'SHORT', + value: 0 + }, + { + name: 'macStyle', + type: 'USHORT', + value: 0 + }, + { + name: 'lowestRecPPEM', + type: 'USHORT', + value: 0 + }, + { + name: 'fontDirectionHint', + type: 'SHORT', + value: 2 + }, + { + name: 'indexToLocFormat', + type: 'SHORT', + value: 0 + }, + { + name: 'glyphDataFormat', + type: 'SHORT', + value: 0 + } + ], options); + } + var head = { + parse: parseHeadTable, + make: makeHeadTable + }; + // The `hhea` table contains information for horizontal layout. + // Parse the horizontal header `hhea` table + function parseHheaTable(data, start) { + var hhea = { + }; + var p = new parse.Parser(data, start); + hhea.version = p.parseVersion(); + hhea.ascender = p.parseShort(); + hhea.descender = p.parseShort(); + hhea.lineGap = p.parseShort(); + hhea.advanceWidthMax = p.parseUShort(); + hhea.minLeftSideBearing = p.parseShort(); + hhea.minRightSideBearing = p.parseShort(); + hhea.xMaxExtent = p.parseShort(); + hhea.caretSlopeRise = p.parseShort(); + hhea.caretSlopeRun = p.parseShort(); + hhea.caretOffset = p.parseShort(); + p.relativeOffset += 8; + hhea.metricDataFormat = p.parseShort(); + hhea.numberOfHMetrics = p.parseUShort(); + return hhea; + } + function makeHheaTable(options) { + return new table.Table('hhea', [ + { + name: 'version', + type: 'FIXED', + value: 65536 + }, + { + name: 'ascender', + type: 'FWORD', + value: 0 + }, + { + name: 'descender', + type: 'FWORD', + value: 0 + }, + { + name: 'lineGap', + type: 'FWORD', + value: 0 + }, + { + name: 'advanceWidthMax', + type: 'UFWORD', + value: 0 + }, + { + name: 'minLeftSideBearing', + type: 'FWORD', + value: 0 + }, + { + name: 'minRightSideBearing', + type: 'FWORD', + value: 0 + }, + { + name: 'xMaxExtent', + type: 'FWORD', + value: 0 + }, + { + name: 'caretSlopeRise', + type: 'SHORT', + value: 1 + }, + { + name: 'caretSlopeRun', + type: 'SHORT', + value: 0 + }, + { + name: 'caretOffset', + type: 'SHORT', + value: 0 + }, + { + name: 'reserved1', + type: 'SHORT', + value: 0 + }, + { + name: 'reserved2', + type: 'SHORT', + value: 0 + }, + { + name: 'reserved3', + type: 'SHORT', + value: 0 + }, + { + name: 'reserved4', + type: 'SHORT', + value: 0 + }, + { + name: 'metricDataFormat', + type: 'SHORT', + value: 0 + }, + { + name: 'numberOfHMetrics', + type: 'USHORT', + value: 0 + } + ], options); + } + var hhea = { + parse: parseHheaTable, + make: makeHheaTable + }; + // The `hmtx` table contains the horizontal metrics for all glyphs. + // Parse the `hmtx` table, which contains the horizontal metrics for all glyphs. + // This function augments the glyph array, adding the advanceWidth and leftSideBearing to each glyph. + function parseHmtxTable(data, start, numMetrics, numGlyphs, glyphs) { + var advanceWidth; + var leftSideBearing; + var p = new parse.Parser(data, start); + for (var i = 0; i < numGlyphs; i += 1) { + // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs. + if (i < numMetrics) { + advanceWidth = p.parseUShort(); + leftSideBearing = p.parseShort(); + } + var glyph = glyphs.get(i); + glyph.advanceWidth = advanceWidth; + glyph.leftSideBearing = leftSideBearing; + } + } + function makeHmtxTable(glyphs) { + var t = new table.Table('hmtx', [ + ]); + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs.get(i); + var advanceWidth = glyph.advanceWidth || 0; + var leftSideBearing = glyph.leftSideBearing || 0; + t.fields.push({ + name: 'advanceWidth_' + i, + type: 'USHORT', + value: advanceWidth + }); + t.fields.push({ + name: 'leftSideBearing_' + i, + type: 'SHORT', + value: leftSideBearing + }); + } + return t; + } + var hmtx = { + parse: parseHmtxTable, + make: makeHmtxTable + }; + // The `ltag` table stores IETF BCP-47 language tags. It allows supporting + function makeLtagTable(tags) { + var result = new table.Table('ltag', [ + { + name: 'version', + type: 'ULONG', + value: 1 + }, + { + name: 'flags', + type: 'ULONG', + value: 0 + }, + { + name: 'numTags', + type: 'ULONG', + value: tags.length + } + ]); + var stringPool = ''; + var stringPoolOffset = 12 + tags.length * 4; + for (var i = 0; i < tags.length; ++i) { + var pos = stringPool.indexOf(tags[i]); + if (pos < 0) { + pos = stringPool.length; + stringPool += tags[i]; + } + result.fields.push({ + name: 'offset ' + i, + type: 'USHORT', + value: stringPoolOffset + pos + }); + result.fields.push({ + name: 'length ' + i, + type: 'USHORT', + value: tags[i].length + }); + } + result.fields.push({ + name: 'stringPool', + type: 'CHARARRAY', + value: stringPool + }); + return result; + } + function parseLtagTable(data, start) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseULong(); + check.argument(tableVersion === 1, 'Unsupported ltag table version.'); + // The 'ltag' specification does not define any flags; skip the field. + p.skip('uLong', 1); + var numTags = p.parseULong(); + var tags = [ + ]; + for (var i = 0; i < numTags; i++) { + var tag = ''; + var offset = start + p.parseUShort(); + var length = p.parseUShort(); + for (var j = offset; j < offset + length; ++j) { + tag += String.fromCharCode(data.getInt8(j)); + } + tags.push(tag); + } + return tags; + } + var ltag = { + make: makeLtagTable, + parse: parseLtagTable + }; + // The `maxp` table establishes the memory requirements for the font. + // Parse the maximum profile `maxp` table. + function parseMaxpTable(data, start) { + var maxp = { + }; + var p = new parse.Parser(data, start); + maxp.version = p.parseVersion(); + maxp.numGlyphs = p.parseUShort(); + if (maxp.version === 1) { + maxp.maxPoints = p.parseUShort(); + maxp.maxContours = p.parseUShort(); + maxp.maxCompositePoints = p.parseUShort(); + maxp.maxCompositeContours = p.parseUShort(); + maxp.maxZones = p.parseUShort(); + maxp.maxTwilightPoints = p.parseUShort(); + maxp.maxStorage = p.parseUShort(); + maxp.maxFunctionDefs = p.parseUShort(); + maxp.maxInstructionDefs = p.parseUShort(); + maxp.maxStackElements = p.parseUShort(); + maxp.maxSizeOfInstructions = p.parseUShort(); + maxp.maxComponentElements = p.parseUShort(); + maxp.maxComponentDepth = p.parseUShort(); + } + return maxp; + } + function makeMaxpTable(numGlyphs) { + return new table.Table('maxp', [ + { + name: 'version', + type: 'FIXED', + value: 20480 + }, + { + name: 'numGlyphs', + type: 'USHORT', + value: numGlyphs + } + ]); + } + var maxp = { + parse: parseMaxpTable, + make: makeMaxpTable + }; + // The `name` naming table. + // NameIDs for the name table. + var nameTableNames = [ + 'copyright', + // 0 + 'fontFamily', + // 1 + 'fontSubfamily', + // 2 + 'uniqueID', + // 3 + 'fullName', + // 4 + 'version', + // 5 + 'postScriptName', + // 6 + 'trademark', + // 7 + 'manufacturer', + // 8 + 'designer', + // 9 + 'description', + // 10 + 'manufacturerURL', + // 11 + 'designerURL', + // 12 + 'license', + // 13 + 'licenseURL', + // 14 + 'reserved', + // 15 + 'preferredFamily', + // 16 + 'preferredSubfamily', + // 17 + 'compatibleFullName', + // 18 + 'sampleText', + // 19 + 'postScriptFindFontName', + // 20 + 'wwsFamily', + // 21 + 'wwsSubfamily' // 22 + ]; + var macLanguages = { + 0: 'en', + 1: 'fr', + 2: 'de', + 3: 'it', + 4: 'nl', + 5: 'sv', + 6: 'es', + 7: 'da', + 8: 'pt', + 9: 'no', + 10: 'he', + 11: 'ja', + 12: 'ar', + 13: 'fi', + 14: 'el', + 15: 'is', + 16: 'mt', + 17: 'tr', + 18: 'hr', + 19: 'zh-Hant', + 20: 'ur', + 21: 'hi', + 22: 'th', + 23: 'ko', + 24: 'lt', + 25: 'pl', + 26: 'hu', + 27: 'es', + 28: 'lv', + 29: 'se', + 30: 'fo', + 31: 'fa', + 32: 'ru', + 33: 'zh', + 34: 'nl-BE', + 35: 'ga', + 36: 'sq', + 37: 'ro', + 38: 'cz', + 39: 'sk', + 40: 'si', + 41: 'yi', + 42: 'sr', + 43: 'mk', + 44: 'bg', + 45: 'uk', + 46: 'be', + 47: 'uz', + 48: 'kk', + 49: 'az-Cyrl', + 50: 'az-Arab', + 51: 'hy', + 52: 'ka', + 53: 'mo', + 54: 'ky', + 55: 'tg', + 56: 'tk', + 57: 'mn-CN', + 58: 'mn', + 59: 'ps', + 60: 'ks', + 61: 'ku', + 62: 'sd', + 63: 'bo', + 64: 'ne', + 65: 'sa', + 66: 'mr', + 67: 'bn', + 68: 'as', + 69: 'gu', + 70: 'pa', + 71: 'or', + 72: 'ml', + 73: 'kn', + 74: 'ta', + 75: 'te', + 76: 'si', + 77: 'my', + 78: 'km', + 79: 'lo', + 80: 'vi', + 81: 'id', + 82: 'tl', + 83: 'ms', + 84: 'ms-Arab', + 85: 'am', + 86: 'ti', + 87: 'om', + 88: 'so', + 89: 'sw', + 90: 'rw', + 91: 'rn', + 92: 'ny', + 93: 'mg', + 94: 'eo', + 128: 'cy', + 129: 'eu', + 130: 'ca', + 131: 'la', + 132: 'qu', + 133: 'gn', + 134: 'ay', + 135: 'tt', + 136: 'ug', + 137: 'dz', + 138: 'jv', + 139: 'su', + 140: 'gl', + 141: 'af', + 142: 'br', + 143: 'iu', + 144: 'gd', + 145: 'gv', + 146: 'ga', + 147: 'to', + 148: 'el-polyton', + 149: 'kl', + 150: 'az', + 151: 'nn' + }; + // MacOS language ID → MacOS script ID + // + // Note that the script ID is not sufficient to determine what encoding + // to use in TrueType files. For some languages, MacOS used a modification + // of a mainstream script. For example, an Icelandic name would be stored + // with smRoman in the TrueType naming table, but the actual encoding + // is a special Icelandic version of the normal Macintosh Roman encoding. + // As another example, Inuktitut uses an 8-bit encoding for Canadian Aboriginal + // Syllables but MacOS had run out of available script codes, so this was + // done as a (pretty radical) "modification" of Ethiopic. + // + // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt + var macLanguageToScript = { + 0: 0, + // langEnglish → smRoman + 1: 0, + // langFrench → smRoman + 2: 0, + // langGerman → smRoman + 3: 0, + // langItalian → smRoman + 4: 0, + // langDutch → smRoman + 5: 0, + // langSwedish → smRoman + 6: 0, + // langSpanish → smRoman + 7: 0, + // langDanish → smRoman + 8: 0, + // langPortuguese → smRoman + 9: 0, + // langNorwegian → smRoman + 10: 5, + // langHebrew → smHebrew + 11: 1, + // langJapanese → smJapanese + 12: 4, + // langArabic → smArabic + 13: 0, + // langFinnish → smRoman + 14: 6, + // langGreek → smGreek + 15: 0, + // langIcelandic → smRoman (modified) + 16: 0, + // langMaltese → smRoman + 17: 0, + // langTurkish → smRoman (modified) + 18: 0, + // langCroatian → smRoman (modified) + 19: 2, + // langTradChinese → smTradChinese + 20: 4, + // langUrdu → smArabic + 21: 9, + // langHindi → smDevanagari + 22: 21, + // langThai → smThai + 23: 3, + // langKorean → smKorean + 24: 29, + // langLithuanian → smCentralEuroRoman + 25: 29, + // langPolish → smCentralEuroRoman + 26: 29, + // langHungarian → smCentralEuroRoman + 27: 29, + // langEstonian → smCentralEuroRoman + 28: 29, + // langLatvian → smCentralEuroRoman + 29: 0, + // langSami → smRoman + 30: 0, + // langFaroese → smRoman (modified) + 31: 4, + // langFarsi → smArabic (modified) + 32: 7, + // langRussian → smCyrillic + 33: 25, + // langSimpChinese → smSimpChinese + 34: 0, + // langFlemish → smRoman + 35: 0, + // langIrishGaelic → smRoman (modified) + 36: 0, + // langAlbanian → smRoman + 37: 0, + // langRomanian → smRoman (modified) + 38: 29, + // langCzech → smCentralEuroRoman + 39: 29, + // langSlovak → smCentralEuroRoman + 40: 0, + // langSlovenian → smRoman (modified) + 41: 5, + // langYiddish → smHebrew + 42: 7, + // langSerbian → smCyrillic + 43: 7, + // langMacedonian → smCyrillic + 44: 7, + // langBulgarian → smCyrillic + 45: 7, + // langUkrainian → smCyrillic (modified) + 46: 7, + // langByelorussian → smCyrillic + 47: 7, + // langUzbek → smCyrillic + 48: 7, + // langKazakh → smCyrillic + 49: 7, + // langAzerbaijani → smCyrillic + 50: 4, + // langAzerbaijanAr → smArabic + 51: 24, + // langArmenian → smArmenian + 52: 23, + // langGeorgian → smGeorgian + 53: 7, + // langMoldavian → smCyrillic + 54: 7, + // langKirghiz → smCyrillic + 55: 7, + // langTajiki → smCyrillic + 56: 7, + // langTurkmen → smCyrillic + 57: 27, + // langMongolian → smMongolian + 58: 7, + // langMongolianCyr → smCyrillic + 59: 4, + // langPashto → smArabic + 60: 4, + // langKurdish → smArabic + 61: 4, + // langKashmiri → smArabic + 62: 4, + // langSindhi → smArabic + 63: 26, + // langTibetan → smTibetan + 64: 9, + // langNepali → smDevanagari + 65: 9, + // langSanskrit → smDevanagari + 66: 9, + // langMarathi → smDevanagari + 67: 13, + // langBengali → smBengali + 68: 13, + // langAssamese → smBengali + 69: 11, + // langGujarati → smGujarati + 70: 10, + // langPunjabi → smGurmukhi + 71: 12, + // langOriya → smOriya + 72: 17, + // langMalayalam → smMalayalam + 73: 16, + // langKannada → smKannada + 74: 14, + // langTamil → smTamil + 75: 15, + // langTelugu → smTelugu + 76: 18, + // langSinhalese → smSinhalese + 77: 19, + // langBurmese → smBurmese + 78: 20, + // langKhmer → smKhmer + 79: 22, + // langLao → smLao + 80: 30, + // langVietnamese → smVietnamese + 81: 0, + // langIndonesian → smRoman + 82: 0, + // langTagalog → smRoman + 83: 0, + // langMalayRoman → smRoman + 84: 4, + // langMalayArabic → smArabic + 85: 28, + // langAmharic → smEthiopic + 86: 28, + // langTigrinya → smEthiopic + 87: 28, + // langOromo → smEthiopic + 88: 0, + // langSomali → smRoman + 89: 0, + // langSwahili → smRoman + 90: 0, + // langKinyarwanda → smRoman + 91: 0, + // langRundi → smRoman + 92: 0, + // langNyanja → smRoman + 93: 0, + // langMalagasy → smRoman + 94: 0, + // langEsperanto → smRoman + 128: 0, + // langWelsh → smRoman (modified) + 129: 0, + // langBasque → smRoman + 130: 0, + // langCatalan → smRoman + 131: 0, + // langLatin → smRoman + 132: 0, + // langQuechua → smRoman + 133: 0, + // langGuarani → smRoman + 134: 0, + // langAymara → smRoman + 135: 7, + // langTatar → smCyrillic + 136: 4, + // langUighur → smArabic + 137: 26, + // langDzongkha → smTibetan + 138: 0, + // langJavaneseRom → smRoman + 139: 0, + // langSundaneseRom → smRoman + 140: 0, + // langGalician → smRoman + 141: 0, + // langAfrikaans → smRoman + 142: 0, + // langBreton → smRoman (modified) + 143: 28, + // langInuktitut → smEthiopic (modified) + 144: 0, + // langScottishGaelic → smRoman (modified) + 145: 0, + // langManxGaelic → smRoman (modified) + 146: 0, + // langIrishGaelicScript → smRoman (modified) + 147: 0, + // langTongan → smRoman + 148: 6, + // langGreekAncient → smRoman + 149: 0, + // langGreenlandic → smRoman + 150: 0, + // langAzerbaijanRoman → smRoman + 151: 0 // langNynorsk → smRoman + }; + // While Microsoft indicates a region/country for all its language + // IDs, we omit the region code if it's equal to the "most likely + // region subtag" according to Unicode CLDR. For scripts, we omit + // the subtag if it is equal to the Suppress-Script entry in the + // IANA language subtag registry for IETF BCP 47. + // + // For example, Microsoft states that its language code 0x041A is + // Croatian in Croatia. We transform this to the BCP 47 language code 'hr' + // and not 'hr-HR' because Croatia is the default country for Croatian, + // according to Unicode CLDR. As another example, Microsoft states + // that 0x101A is Croatian (Latin) in Bosnia-Herzegovina. We transform + // this to 'hr-BA' and not 'hr-Latn-BA' because Latin is the default script + // for the Croatian language, according to IANA. + // + // http://www.unicode.org/cldr/charts/latest/supplemental/likely_subtags.html + // http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry + var windowsLanguages = { + 1078: 'af', + 1052: 'sq', + 1156: 'gsw', + 1118: 'am', + 5121: 'ar-DZ', + 15361: 'ar-BH', + 3073: 'ar', + 2049: 'ar-IQ', + 11265: 'ar-JO', + 13313: 'ar-KW', + 12289: 'ar-LB', + 4097: 'ar-LY', + 6145: 'ary', + 8193: 'ar-OM', + 16385: 'ar-QA', + 1025: 'ar-SA', + 10241: 'ar-SY', + 7169: 'aeb', + 14337: 'ar-AE', + 9217: 'ar-YE', + 1067: 'hy', + 1101: 'as', + 2092: 'az-Cyrl', + 1068: 'az', + 1133: 'ba', + 1069: 'eu', + 1059: 'be', + 2117: 'bn', + 1093: 'bn-IN', + 8218: 'bs-Cyrl', + 5146: 'bs', + 1150: 'br', + 1026: 'bg', + 1027: 'ca', + 3076: 'zh-HK', + 5124: 'zh-MO', + 2052: 'zh', + 4100: 'zh-SG', + 1028: 'zh-TW', + 1155: 'co', + 1050: 'hr', + 4122: 'hr-BA', + 1029: 'cs', + 1030: 'da', + 1164: 'prs', + 1125: 'dv', + 2067: 'nl-BE', + 1043: 'nl', + 3081: 'en-AU', + 10249: 'en-BZ', + 4105: 'en-CA', + 9225: 'en-029', + 16393: 'en-IN', + 6153: 'en-IE', + 8201: 'en-JM', + 17417: 'en-MY', + 5129: 'en-NZ', + 13321: 'en-PH', + 18441: 'en-SG', + 7177: 'en-ZA', + 11273: 'en-TT', + 2057: 'en-GB', + 1033: 'en', + 12297: 'en-ZW', + 1061: 'et', + 1080: 'fo', + 1124: 'fil', + 1035: 'fi', + 2060: 'fr-BE', + 3084: 'fr-CA', + 1036: 'fr', + 5132: 'fr-LU', + 6156: 'fr-MC', + 4108: 'fr-CH', + 1122: 'fy', + 1110: 'gl', + 1079: 'ka', + 3079: 'de-AT', + 1031: 'de', + 5127: 'de-LI', + 4103: 'de-LU', + 2055: 'de-CH', + 1032: 'el', + 1135: 'kl', + 1095: 'gu', + 1128: 'ha', + 1037: 'he', + 1081: 'hi', + 1038: 'hu', + 1039: 'is', + 1136: 'ig', + 1057: 'id', + 1117: 'iu', + 2141: 'iu-Latn', + 2108: 'ga', + 1076: 'xh', + 1077: 'zu', + 1040: 'it', + 2064: 'it-CH', + 1041: 'ja', + 1099: 'kn', + 1087: 'kk', + 1107: 'km', + 1158: 'quc', + 1159: 'rw', + 1089: 'sw', + 1111: 'kok', + 1042: 'ko', + 1088: 'ky', + 1108: 'lo', + 1062: 'lv', + 1063: 'lt', + 2094: 'dsb', + 1134: 'lb', + 1071: 'mk', + 2110: 'ms-BN', + 1086: 'ms', + 1100: 'ml', + 1082: 'mt', + 1153: 'mi', + 1146: 'arn', + 1102: 'mr', + 1148: 'moh', + 1104: 'mn', + 2128: 'mn-CN', + 1121: 'ne', + 1044: 'nb', + 2068: 'nn', + 1154: 'oc', + 1096: 'or', + 1123: 'ps', + 1045: 'pl', + 1046: 'pt', + 2070: 'pt-PT', + 1094: 'pa', + 1131: 'qu-BO', + 2155: 'qu-EC', + 3179: 'qu', + 1048: 'ro', + 1047: 'rm', + 1049: 'ru', + 9275: 'smn', + 4155: 'smj-NO', + 5179: 'smj', + 3131: 'se-FI', + 1083: 'se', + 2107: 'se-SE', + 8251: 'sms', + 6203: 'sma-NO', + 7227: 'sms', + 1103: 'sa', + 7194: 'sr-Cyrl-BA', + 3098: 'sr', + 6170: 'sr-Latn-BA', + 2074: 'sr-Latn', + 1132: 'nso', + 1074: 'tn', + 1115: 'si', + 1051: 'sk', + 1060: 'sl', + 11274: 'es-AR', + 16394: 'es-BO', + 13322: 'es-CL', + 9226: 'es-CO', + 5130: 'es-CR', + 7178: 'es-DO', + 12298: 'es-EC', + 17418: 'es-SV', + 4106: 'es-GT', + 18442: 'es-HN', + 2058: 'es-MX', + 19466: 'es-NI', + 6154: 'es-PA', + 15370: 'es-PY', + 10250: 'es-PE', + 20490: 'es-PR', + // Microsoft has defined two different language codes for + // “Spanish with modern sorting” and “Spanish with traditional + // sorting”. This makes sense for collation APIs, and it would be + // possible to express this in BCP 47 language tags via Unicode + // extensions (eg., es-u-co-trad is Spanish with traditional + // sorting). However, for storing names in fonts, the distinction + // does not make sense, so we give “es” in both cases. + 3082: 'es', + 1034: 'es', + 21514: 'es-US', + 14346: 'es-UY', + 8202: 'es-VE', + 2077: 'sv-FI', + 1053: 'sv', + 1114: 'syr', + 1064: 'tg', + 2143: 'tzm', + 1097: 'ta', + 1092: 'tt', + 1098: 'te', + 1054: 'th', + 1105: 'bo', + 1055: 'tr', + 1090: 'tk', + 1152: 'ug', + 1058: 'uk', + 1070: 'hsb', + 1056: 'ur', + 2115: 'uz-Cyrl', + 1091: 'uz', + 1066: 'vi', + 1106: 'cy', + 1160: 'wo', + 1157: 'sah', + 1144: 'ii', + 1130: 'yo' + }; + // Returns a IETF BCP 47 language code, for example 'zh-Hant' + // for 'Chinese in the traditional script'. + function getLanguageCode(platformID, languageID, ltag) { + switch (platformID) { + case 0: + // Unicode + if (languageID === 65535) { + return 'und'; + } else if (ltag) { + return ltag[languageID]; + } + break; + case 1: + // Macintosh + return macLanguages[languageID]; + case 3: + // Windows + return windowsLanguages[languageID]; + } + return undefined; + } + var utf16 = 'utf-16'; + // MacOS script ID → encoding. This table stores the default case, + // which can be overridden by macLanguageEncodings. + var macScriptEncodings = { + 0: 'macintosh', + // smRoman + 1: 'x-mac-japanese', + // smJapanese + 2: 'x-mac-chinesetrad', + // smTradChinese + 3: 'x-mac-korean', + // smKorean + 6: 'x-mac-greek', + // smGreek + 7: 'x-mac-cyrillic', + // smCyrillic + 9: 'x-mac-devanagai', + // smDevanagari + 10: 'x-mac-gurmukhi', + // smGurmukhi + 11: 'x-mac-gujarati', + // smGujarati + 12: 'x-mac-oriya', + // smOriya + 13: 'x-mac-bengali', + // smBengali + 14: 'x-mac-tamil', + // smTamil + 15: 'x-mac-telugu', + // smTelugu + 16: 'x-mac-kannada', + // smKannada + 17: 'x-mac-malayalam', + // smMalayalam + 18: 'x-mac-sinhalese', + // smSinhalese + 19: 'x-mac-burmese', + // smBurmese + 20: 'x-mac-khmer', + // smKhmer + 21: 'x-mac-thai', + // smThai + 22: 'x-mac-lao', + // smLao + 23: 'x-mac-georgian', + // smGeorgian + 24: 'x-mac-armenian', + // smArmenian + 25: 'x-mac-chinesesimp', + // smSimpChinese + 26: 'x-mac-tibetan', + // smTibetan + 27: 'x-mac-mongolian', + // smMongolian + 28: 'x-mac-ethiopic', + // smEthiopic + 29: 'x-mac-ce', + // smCentralEuroRoman + 30: 'x-mac-vietnamese', + // smVietnamese + 31: 'x-mac-extarabic' // smExtArabic + }; + // MacOS language ID → encoding. This table stores the exceptional + // cases, which override macScriptEncodings. For writing MacOS naming + // tables, we need to emit a MacOS script ID. Therefore, we cannot + // merge macScriptEncodings into macLanguageEncodings. + // + // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt + var macLanguageEncodings = { + 15: 'x-mac-icelandic', + // langIcelandic + 17: 'x-mac-turkish', + // langTurkish + 18: 'x-mac-croatian', + // langCroatian + 24: 'x-mac-ce', + // langLithuanian + 25: 'x-mac-ce', + // langPolish + 26: 'x-mac-ce', + // langHungarian + 27: 'x-mac-ce', + // langEstonian + 28: 'x-mac-ce', + // langLatvian + 30: 'x-mac-icelandic', + // langFaroese + 37: 'x-mac-romanian', + // langRomanian + 38: 'x-mac-ce', + // langCzech + 39: 'x-mac-ce', + // langSlovak + 40: 'x-mac-ce', + // langSlovenian + 143: 'x-mac-inuit', + // langInuktitut + 146: 'x-mac-gaelic' // langIrishGaelicScript + }; + function getEncoding(platformID, encodingID, languageID) { + switch (platformID) { + case 0: + // Unicode + return utf16; + case 1: + // Apple Macintosh + return macLanguageEncodings[languageID] || macScriptEncodings[encodingID]; + case 3: + // Microsoft Windows + if (encodingID === 1 || encodingID === 10) { + return utf16; + } + break; + } + return undefined; + } // Parse the naming `name` table. + // FIXME: Format 1 additional fields are not supported yet. + // ltag is the content of the `ltag' table, such as ['en', 'zh-Hans', 'de-CH-1904']. + + function parseNameTable(data, start, ltag) { + var name = { + }; + var p = new parse.Parser(data, start); + var format = p.parseUShort(); + var count = p.parseUShort(); + var stringOffset = p.offset + p.parseUShort(); + for (var i = 0; i < count; i++) { + var platformID = p.parseUShort(); + var encodingID = p.parseUShort(); + var languageID = p.parseUShort(); + var nameID = p.parseUShort(); + var property = nameTableNames[nameID] || nameID; + var byteLength = p.parseUShort(); + var offset = p.parseUShort(); + var language = getLanguageCode(platformID, languageID, ltag); + var encoding = getEncoding(platformID, encodingID, languageID); + if (encoding !== undefined && language !== undefined) { + var text = void 0; + if (encoding === utf16) { + text = decode.UTF16(data, stringOffset + offset, byteLength); + } else { + text = decode.MACSTRING(data, stringOffset + offset, byteLength, encoding); + } + if (text) { + var translations = name[property]; + if (translations === undefined) { + translations = name[property] = { + }; + } + translations[language] = text; + } + } + } + var langTagCount = 0; + if (format === 1) { + // FIXME: Also handle Microsoft's 'name' table 1. + langTagCount = p.parseUShort(); + } + return name; + } // {23: 'foo'} → {'foo': 23} + // ['bar', 'baz'] → {'bar': 0, 'baz': 1} + + function reverseDict(dict) { + var result = { + }; + for (var key in dict) { + result[dict[key]] = parseInt(key); + } + return result; + } + function makeNameRecord(platformID, encodingID, languageID, nameID, length, offset) { + return new table.Record('NameRecord', [ + { + name: 'platformID', + type: 'USHORT', + value: platformID + }, + { + name: 'encodingID', + type: 'USHORT', + value: encodingID + }, + { + name: 'languageID', + type: 'USHORT', + value: languageID + }, + { + name: 'nameID', + type: 'USHORT', + value: nameID + }, + { + name: 'length', + type: 'USHORT', + value: length + }, + { + name: 'offset', + type: 'USHORT', + value: offset + } + ]); + } // Finds the position of needle in haystack, or -1 if not there. + // Like String.indexOf(), but for arrays. + + function findSubArray(needle, haystack) { + var needleLength = needle.length; + var limit = haystack.length - needleLength + 1; + loop: for (var pos = 0; pos < limit; pos++) { + for (; pos < limit; pos++) { + for (var k = 0; k < needleLength; k++) { + if (haystack[pos + k] !== needle[k]) { + continue loop; + } + } + return pos; + } + } + return - 1; + } + function addStringToPool(s, pool) { + var offset = findSubArray(s, pool); + if (offset < 0) { + offset = pool.length; + var i = 0; + var len = s.length; + for (; i < len; ++i) { + pool.push(s[i]); + } + } + return offset; + } + function makeNameTable(names, ltag) { + var nameID; + var nameIDs = [ + ]; + var namesWithNumericKeys = { + }; + var nameTableIds = reverseDict(nameTableNames); + for (var key in names) { + var id = nameTableIds[key]; + if (id === undefined) { + id = key; + } + nameID = parseInt(id); + if (isNaN(nameID)) { + throw new Error('Name table entry "' + key + '" does not exist, see nameTableNames for complete list.'); + } + namesWithNumericKeys[nameID] = names[key]; + nameIDs.push(nameID); + } + var macLanguageIds = reverseDict(macLanguages); + var windowsLanguageIds = reverseDict(windowsLanguages); + var nameRecords = [ + ]; + var stringPool = [ + ]; + for (var i = 0; i < nameIDs.length; i++) { + nameID = nameIDs[i]; + var translations = namesWithNumericKeys[nameID]; + for (var lang in translations) { + var text = translations[lang]; + // For MacOS, we try to emit the name in the form that was introduced + // in the initial version of the TrueType spec (in the late 1980s). + // However, this can fail for various reasons: the requested BCP 47 + // language code might not have an old-style Mac equivalent; + // we might not have a codec for the needed character encoding; + // or the name might contain characters that cannot be expressed + // in the old-style Macintosh encoding. In case of failure, we emit + // the name in a more modern fashion (Unicode encoding with BCP 47 + // language tags) that is recognized by MacOS 10.5, released in 2009. + // If fonts were only read by operating systems, we could simply + // emit all names in the modern form; this would be much easier. + // However, there are many applications and libraries that read + // 'name' tables directly, and these will usually only recognize + // the ancient form (silently skipping the unrecognized names). + var macPlatform = 1; // Macintosh + var macLanguage = macLanguageIds[lang]; + var macScript = macLanguageToScript[macLanguage]; + var macEncoding = getEncoding(macPlatform, macScript, macLanguage); + var macName = encode.MACSTRING(text, macEncoding); + if (macName === undefined) { + macPlatform = 0; // Unicode + macLanguage = ltag.indexOf(lang); + if (macLanguage < 0) { + macLanguage = ltag.length; + ltag.push(lang); + } + macScript = 4; // Unicode 2.0 and later + macName = encode.UTF16(text); + } + var macNameOffset = addStringToPool(macName, stringPool); + nameRecords.push(makeNameRecord(macPlatform, macScript, macLanguage, nameID, macName.length, macNameOffset)); + var winLanguage = windowsLanguageIds[lang]; + if (winLanguage !== undefined) { + var winName = encode.UTF16(text); + var winNameOffset = addStringToPool(winName, stringPool); + nameRecords.push(makeNameRecord(3, 1, winLanguage, nameID, winName.length, winNameOffset)); + } + } + } + nameRecords.sort(function (a, b) { + return a.platformID - b.platformID || a.encodingID - b.encodingID || a.languageID - b.languageID || a.nameID - b.nameID; + }); + var t = new table.Table('name', [ + { + name: 'format', + type: 'USHORT', + value: 0 + }, + { + name: 'count', + type: 'USHORT', + value: nameRecords.length + }, + { + name: 'stringOffset', + type: 'USHORT', + value: 6 + nameRecords.length * 12 + } + ]); + for (var r = 0; r < nameRecords.length; r++) { + t.fields.push({ + name: 'record_' + r, + type: 'RECORD', + value: nameRecords[r] + }); + } + t.fields.push({ + name: 'strings', + type: 'LITERAL', + value: stringPool + }); + return t; + } + var _name = { + parse: parseNameTable, + make: makeNameTable + }; + // The `OS/2` table contains metrics required in OpenType fonts. + var unicodeRanges = [ + { + begin: 0, + end: 127 + }, + // Basic Latin + { + begin: 128, + end: 255 + }, + // Latin-1 Supplement + { + begin: 256, + end: 383 + }, + // Latin Extended-A + { + begin: 384, + end: 591 + }, + // Latin Extended-B + { + begin: 592, + end: 687 + }, + // IPA Extensions + { + begin: 688, + end: 767 + }, + // Spacing Modifier Letters + { + begin: 768, + end: 879 + }, + // Combining Diacritical Marks + { + begin: 880, + end: 1023 + }, + // Greek and Coptic + { + begin: 11392, + end: 11519 + }, + // Coptic + { + begin: 1024, + end: 1279 + }, + // Cyrillic + { + begin: 1328, + end: 1423 + }, + // Armenian + { + begin: 1424, + end: 1535 + }, + // Hebrew + { + begin: 42240, + end: 42559 + }, + // Vai + { + begin: 1536, + end: 1791 + }, + // Arabic + { + begin: 1984, + end: 2047 + }, + // NKo + { + begin: 2304, + end: 2431 + }, + // Devanagari + { + begin: 2432, + end: 2559 + }, + // Bengali + { + begin: 2560, + end: 2687 + }, + // Gurmukhi + { + begin: 2688, + end: 2815 + }, + // Gujarati + { + begin: 2816, + end: 2943 + }, + // Oriya + { + begin: 2944, + end: 3071 + }, + // Tamil + { + begin: 3072, + end: 3199 + }, + // Telugu + { + begin: 3200, + end: 3327 + }, + // Kannada + { + begin: 3328, + end: 3455 + }, + // Malayalam + { + begin: 3584, + end: 3711 + }, + // Thai + { + begin: 3712, + end: 3839 + }, + // Lao + { + begin: 4256, + end: 4351 + }, + // Georgian + { + begin: 6912, + end: 7039 + }, + // Balinese + { + begin: 4352, + end: 4607 + }, + // Hangul Jamo + { + begin: 7680, + end: 7935 + }, + // Latin Extended Additional + { + begin: 7936, + end: 8191 + }, + // Greek Extended + { + begin: 8192, + end: 8303 + }, + // General Punctuation + { + begin: 8304, + end: 8351 + }, + // Superscripts And Subscripts + { + begin: 8352, + end: 8399 + }, + // Currency Symbol + { + begin: 8400, + end: 8447 + }, + // Combining Diacritical Marks For Symbols + { + begin: 8448, + end: 8527 + }, + // Letterlike Symbols + { + begin: 8528, + end: 8591 + }, + // Number Forms + { + begin: 8592, + end: 8703 + }, + // Arrows + { + begin: 8704, + end: 8959 + }, + // Mathematical Operators + { + begin: 8960, + end: 9215 + }, + // Miscellaneous Technical + { + begin: 9216, + end: 9279 + }, + // Control Pictures + { + begin: 9280, + end: 9311 + }, + // Optical Character Recognition + { + begin: 9312, + end: 9471 + }, + // Enclosed Alphanumerics + { + begin: 9472, + end: 9599 + }, + // Box Drawing + { + begin: 9600, + end: 9631 + }, + // Block Elements + { + begin: 9632, + end: 9727 + }, + // Geometric Shapes + { + begin: 9728, + end: 9983 + }, + // Miscellaneous Symbols + { + begin: 9984, + end: 10175 + }, + // Dingbats + { + begin: 12288, + end: 12351 + }, + // CJK Symbols And Punctuation + { + begin: 12352, + end: 12447 + }, + // Hiragana + { + begin: 12448, + end: 12543 + }, + // Katakana + { + begin: 12544, + end: 12591 + }, + // Bopomofo + { + begin: 12592, + end: 12687 + }, + // Hangul Compatibility Jamo + { + begin: 43072, + end: 43135 + }, + // Phags-pa + { + begin: 12800, + end: 13055 + }, + // Enclosed CJK Letters And Months + { + begin: 13056, + end: 13311 + }, + // CJK Compatibility + { + begin: 44032, + end: 55215 + }, + // Hangul Syllables + { + begin: 55296, + end: 57343 + }, + // Non-Plane 0 * + { + begin: 67840, + end: 67871 + }, + // Phoenicia + { + begin: 19968, + end: 40959 + }, + // CJK Unified Ideographs + { + begin: 57344, + end: 63743 + }, + // Private Use Area (plane 0) + { + begin: 12736, + end: 12783 + }, + // CJK Strokes + { + begin: 64256, + end: 64335 + }, + // Alphabetic Presentation Forms + { + begin: 64336, + end: 65023 + }, + // Arabic Presentation Forms-A + { + begin: 65056, + end: 65071 + }, + // Combining Half Marks + { + begin: 65040, + end: 65055 + }, + // Vertical Forms + { + begin: 65104, + end: 65135 + }, + // Small Form Variants + { + begin: 65136, + end: 65279 + }, + // Arabic Presentation Forms-B + { + begin: 65280, + end: 65519 + }, + // Halfwidth And Fullwidth Forms + { + begin: 65520, + end: 65535 + }, + // Specials + { + begin: 3840, + end: 4095 + }, + // Tibetan + { + begin: 1792, + end: 1871 + }, + // Syriac + { + begin: 1920, + end: 1983 + }, + // Thaana + { + begin: 3456, + end: 3583 + }, + // Sinhala + { + begin: 4096, + end: 4255 + }, + // Myanmar + { + begin: 4608, + end: 4991 + }, + // Ethiopic + { + begin: 5024, + end: 5119 + }, + // Cherokee + { + begin: 5120, + end: 5759 + }, + // Unified Canadian Aboriginal Syllabics + { + begin: 5760, + end: 5791 + }, + // Ogham + { + begin: 5792, + end: 5887 + }, + // Runic + { + begin: 6016, + end: 6143 + }, + // Khmer + { + begin: 6144, + end: 6319 + }, + // Mongolian + { + begin: 10240, + end: 10495 + }, + // Braille Patterns + { + begin: 40960, + end: 42127 + }, + // Yi Syllables + { + begin: 5888, + end: 5919 + }, + // Tagalog + { + begin: 66304, + end: 66351 + }, + // Old Italic + { + begin: 66352, + end: 66383 + }, + // Gothic + { + begin: 66560, + end: 66639 + }, + // Deseret + { + begin: 118784, + end: 119039 + }, + // Byzantine Musical Symbols + { + begin: 119808, + end: 120831 + }, + // Mathematical Alphanumeric Symbols + { + begin: 1044480, + end: 1048573 + }, + // Private Use (plane 15) + { + begin: 65024, + end: 65039 + }, + // Variation Selectors + { + begin: 917504, + end: 917631 + }, + // Tags + { + begin: 6400, + end: 6479 + }, + // Limbu + { + begin: 6480, + end: 6527 + }, + // Tai Le + { + begin: 6528, + end: 6623 + }, + // New Tai Lue + { + begin: 6656, + end: 6687 + }, + // Buginese + { + begin: 11264, + end: 11359 + }, + // Glagolitic + { + begin: 11568, + end: 11647 + }, + // Tifinagh + { + begin: 19904, + end: 19967 + }, + // Yijing Hexagram Symbols + { + begin: 43008, + end: 43055 + }, + // Syloti Nagri + { + begin: 65536, + end: 65663 + }, + // Linear B Syllabary + { + begin: 65856, + end: 65935 + }, + // Ancient Greek Numbers + { + begin: 66432, + end: 66463 + }, + // Ugaritic + { + begin: 66464, + end: 66527 + }, + // Old Persian + { + begin: 66640, + end: 66687 + }, + // Shavian + { + begin: 66688, + end: 66735 + }, + // Osmanya + { + begin: 67584, + end: 67647 + }, + // Cypriot Syllabary + { + begin: 68096, + end: 68191 + }, + // Kharoshthi + { + begin: 119552, + end: 119647 + }, + // Tai Xuan Jing Symbols + { + begin: 73728, + end: 74751 + }, + // Cuneiform + { + begin: 119648, + end: 119679 + }, + // Counting Rod Numerals + { + begin: 7040, + end: 7103 + }, + // Sundanese + { + begin: 7168, + end: 7247 + }, + // Lepcha + { + begin: 7248, + end: 7295 + }, + // Ol Chiki + { + begin: 43136, + end: 43231 + }, + // Saurashtra + { + begin: 43264, + end: 43311 + }, + // Kayah Li + { + begin: 43312, + end: 43359 + }, + // Rejang + { + begin: 43520, + end: 43615 + }, + // Cham + { + begin: 65936, + end: 65999 + }, + // Ancient Symbols + { + begin: 66000, + end: 66047 + }, + // Phaistos Disc + { + begin: 66208, + end: 66271 + }, + // Carian + { + begin: 127024, + end: 127135 + } // Domino Tiles + + ]; + function getUnicodeRange(unicode) { + for (var i = 0; i < unicodeRanges.length; i += 1) { + var range = unicodeRanges[i]; + if (unicode >= range.begin && unicode < range.end) { + return i; + } + } + return - 1; + } // Parse the OS/2 and Windows metrics `OS/2` table + + function parseOS2Table(data, start) { + var os2 = { + }; + var p = new parse.Parser(data, start); + os2.version = p.parseUShort(); + os2.xAvgCharWidth = p.parseShort(); + os2.usWeightClass = p.parseUShort(); + os2.usWidthClass = p.parseUShort(); + os2.fsType = p.parseUShort(); + os2.ySubscriptXSize = p.parseShort(); + os2.ySubscriptYSize = p.parseShort(); + os2.ySubscriptXOffset = p.parseShort(); + os2.ySubscriptYOffset = p.parseShort(); + os2.ySuperscriptXSize = p.parseShort(); + os2.ySuperscriptYSize = p.parseShort(); + os2.ySuperscriptXOffset = p.parseShort(); + os2.ySuperscriptYOffset = p.parseShort(); + os2.yStrikeoutSize = p.parseShort(); + os2.yStrikeoutPosition = p.parseShort(); + os2.sFamilyClass = p.parseShort(); + os2.panose = [ + ]; + for (var i = 0; i < 10; i++) { + os2.panose[i] = p.parseByte(); + } + os2.ulUnicodeRange1 = p.parseULong(); + os2.ulUnicodeRange2 = p.parseULong(); + os2.ulUnicodeRange3 = p.parseULong(); + os2.ulUnicodeRange4 = p.parseULong(); + os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte()); + os2.fsSelection = p.parseUShort(); + os2.usFirstCharIndex = p.parseUShort(); + os2.usLastCharIndex = p.parseUShort(); + os2.sTypoAscender = p.parseShort(); + os2.sTypoDescender = p.parseShort(); + os2.sTypoLineGap = p.parseShort(); + os2.usWinAscent = p.parseUShort(); + os2.usWinDescent = p.parseUShort(); + if (os2.version >= 1) { + os2.ulCodePageRange1 = p.parseULong(); + os2.ulCodePageRange2 = p.parseULong(); + } + if (os2.version >= 2) { + os2.sxHeight = p.parseShort(); + os2.sCapHeight = p.parseShort(); + os2.usDefaultChar = p.parseUShort(); + os2.usBreakChar = p.parseUShort(); + os2.usMaxContent = p.parseUShort(); + } + return os2; + } + function makeOS2Table(options) { + return new table.Table('OS/2', [ + { + name: 'version', + type: 'USHORT', + value: 3 + }, + { + name: 'xAvgCharWidth', + type: 'SHORT', + value: 0 + }, + { + name: 'usWeightClass', + type: 'USHORT', + value: 0 + }, + { + name: 'usWidthClass', + type: 'USHORT', + value: 0 + }, + { + name: 'fsType', + type: 'USHORT', + value: 0 + }, + { + name: 'ySubscriptXSize', + type: 'SHORT', + value: 650 + }, + { + name: 'ySubscriptYSize', + type: 'SHORT', + value: 699 + }, + { + name: 'ySubscriptXOffset', + type: 'SHORT', + value: 0 + }, + { + name: 'ySubscriptYOffset', + type: 'SHORT', + value: 140 + }, + { + name: 'ySuperscriptXSize', + type: 'SHORT', + value: 650 + }, + { + name: 'ySuperscriptYSize', + type: 'SHORT', + value: 699 + }, + { + name: 'ySuperscriptXOffset', + type: 'SHORT', + value: 0 + }, + { + name: 'ySuperscriptYOffset', + type: 'SHORT', + value: 479 + }, + { + name: 'yStrikeoutSize', + type: 'SHORT', + value: 49 + }, + { + name: 'yStrikeoutPosition', + type: 'SHORT', + value: 258 + }, + { + name: 'sFamilyClass', + type: 'SHORT', + value: 0 + }, + { + name: 'bFamilyType', + type: 'BYTE', + value: 0 + }, + { + name: 'bSerifStyle', + type: 'BYTE', + value: 0 + }, + { + name: 'bWeight', + type: 'BYTE', + value: 0 + }, + { + name: 'bProportion', + type: 'BYTE', + value: 0 + }, + { + name: 'bContrast', + type: 'BYTE', + value: 0 + }, + { + name: 'bStrokeVariation', + type: 'BYTE', + value: 0 + }, + { + name: 'bArmStyle', + type: 'BYTE', + value: 0 + }, + { + name: 'bLetterform', + type: 'BYTE', + value: 0 + }, + { + name: 'bMidline', + type: 'BYTE', + value: 0 + }, + { + name: 'bXHeight', + type: 'BYTE', + value: 0 + }, + { + name: 'ulUnicodeRange1', + type: 'ULONG', + value: 0 + }, + { + name: 'ulUnicodeRange2', + type: 'ULONG', + value: 0 + }, + { + name: 'ulUnicodeRange3', + type: 'ULONG', + value: 0 + }, + { + name: 'ulUnicodeRange4', + type: 'ULONG', + value: 0 + }, + { + name: 'achVendID', + type: 'CHARARRAY', + value: 'XXXX' + }, + { + name: 'fsSelection', + type: 'USHORT', + value: 0 + }, + { + name: 'usFirstCharIndex', + type: 'USHORT', + value: 0 + }, + { + name: 'usLastCharIndex', + type: 'USHORT', + value: 0 + }, + { + name: 'sTypoAscender', + type: 'SHORT', + value: 0 + }, + { + name: 'sTypoDescender', + type: 'SHORT', + value: 0 + }, + { + name: 'sTypoLineGap', + type: 'SHORT', + value: 0 + }, + { + name: 'usWinAscent', + type: 'USHORT', + value: 0 + }, + { + name: 'usWinDescent', + type: 'USHORT', + value: 0 + }, + { + name: 'ulCodePageRange1', + type: 'ULONG', + value: 0 + }, + { + name: 'ulCodePageRange2', + type: 'ULONG', + value: 0 + }, + { + name: 'sxHeight', + type: 'SHORT', + value: 0 + }, + { + name: 'sCapHeight', + type: 'SHORT', + value: 0 + }, + { + name: 'usDefaultChar', + type: 'USHORT', + value: 0 + }, + { + name: 'usBreakChar', + type: 'USHORT', + value: 0 + }, + { + name: 'usMaxContext', + type: 'USHORT', + value: 0 + } + ], options); + } + var os2 = { + parse: parseOS2Table, + make: makeOS2Table, + unicodeRanges: unicodeRanges, + getUnicodeRange: getUnicodeRange + }; + // The `post` table stores additional PostScript information, such as glyph names. + // Parse the PostScript `post` table + function parsePostTable(data, start) { + var post = { + }; + var p = new parse.Parser(data, start); + post.version = p.parseVersion(); + post.italicAngle = p.parseFixed(); + post.underlinePosition = p.parseShort(); + post.underlineThickness = p.parseShort(); + post.isFixedPitch = p.parseULong(); + post.minMemType42 = p.parseULong(); + post.maxMemType42 = p.parseULong(); + post.minMemType1 = p.parseULong(); + post.maxMemType1 = p.parseULong(); + switch (post.version) { + case 1: + post.names = standardNames.slice(); + break; + case 2: + post.numberOfGlyphs = p.parseUShort(); + post.glyphNameIndex = new Array(post.numberOfGlyphs); + for (var i = 0; i < post.numberOfGlyphs; i++) { + post.glyphNameIndex[i] = p.parseUShort(); + } + post.names = [ + ]; + for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { + if (post.glyphNameIndex[i$1] >= standardNames.length) { + var nameLength = p.parseChar(); + post.names.push(p.parseString(nameLength)); + } + } + break; + case 2.5: + post.numberOfGlyphs = p.parseUShort(); + post.offset = new Array(post.numberOfGlyphs); + for (var i$2 = 0; i$2 < post.numberOfGlyphs; i$2++) { + post.offset[i$2] = p.parseChar(); + } + break; + } + return post; + } + function makePostTable() { + return new table.Table('post', [ + { + name: 'version', + type: 'FIXED', + value: 196608 + }, + { + name: 'italicAngle', + type: 'FIXED', + value: 0 + }, + { + name: 'underlinePosition', + type: 'FWORD', + value: 0 + }, + { + name: 'underlineThickness', + type: 'FWORD', + value: 0 + }, + { + name: 'isFixedPitch', + type: 'ULONG', + value: 0 + }, + { + name: 'minMemType42', + type: 'ULONG', + value: 0 + }, + { + name: 'maxMemType42', + type: 'ULONG', + value: 0 + }, + { + name: 'minMemType1', + type: 'ULONG', + value: 0 + }, + { + name: 'maxMemType1', + type: 'ULONG', + value: 0 + } + ]); + } + var post = { + parse: parsePostTable, + make: makePostTable + }; + // The `GSUB` table contains ligatures, among other things. + var subtableParsers = new Array(9); // subtableParsers[0] is unused + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#SS + subtableParsers[1] = function parseLookup1() { + var start = this.offset + this.relativeOffset; + var substFormat = this.parseUShort(); + if (substFormat === 1) { + return { + substFormat: 1, + coverage: this.parsePointer(Parser.coverage), + deltaGlyphId: this.parseUShort() + }; + } else if (substFormat === 2) { + return { + substFormat: 2, + coverage: this.parsePointer(Parser.coverage), + substitute: this.parseOffset16List() + }; + } + check.assert(false, '0x' + start.toString(16) + ': lookup type 1 format must be 1 or 2.'); + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#MS + subtableParsers[2] = function parseLookup2() { + var substFormat = this.parseUShort(); + check.argument(substFormat === 1, 'GSUB Multiple Substitution Subtable identifier-format must be 1'); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + sequences: this.parseListOfLists() + }; + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#AS + subtableParsers[3] = function parseLookup3() { + var substFormat = this.parseUShort(); + check.argument(substFormat === 1, 'GSUB Alternate Substitution Subtable identifier-format must be 1'); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + alternateSets: this.parseListOfLists() + }; + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#LS + subtableParsers[4] = function parseLookup4() { + var substFormat = this.parseUShort(); + check.argument(substFormat === 1, 'GSUB ligature table identifier-format must be 1'); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + ligatureSets: this.parseListOfLists(function () { + return { + ligGlyph: this.parseUShort(), + components: this.parseUShortList(this.parseUShort() - 1) + }; + }) + }; + }; + var lookupRecordDesc = { + sequenceIndex: Parser.uShort, + lookupListIndex: Parser.uShort + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CSF + subtableParsers[5] = function parseLookup5() { + var start = this.offset + this.relativeOffset; + var substFormat = this.parseUShort(); + if (substFormat === 1) { + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + ruleSets: this.parseListOfLists(function () { + var glyphCount = this.parseUShort(); + var substCount = this.parseUShort(); + return { + input: this.parseUShortList(glyphCount - 1), + lookupRecords: this.parseRecordList(substCount, lookupRecordDesc) + }; + }) + }; + } else if (substFormat === 2) { + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + classDef: this.parsePointer(Parser.classDef), + classSets: this.parseListOfLists(function () { + var glyphCount = this.parseUShort(); + var substCount = this.parseUShort(); + return { + classes: this.parseUShortList(glyphCount - 1), + lookupRecords: this.parseRecordList(substCount, lookupRecordDesc) + }; + }) + }; + } else if (substFormat === 3) { + var glyphCount = this.parseUShort(); + var substCount = this.parseUShort(); + return { + substFormat: substFormat, + coverages: this.parseList(glyphCount, Parser.pointer(Parser.coverage)), + lookupRecords: this.parseRecordList(substCount, lookupRecordDesc) + }; + } + check.assert(false, '0x' + start.toString(16) + ': lookup type 5 format must be 1, 2 or 3.'); + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CC + subtableParsers[6] = function parseLookup6() { + var start = this.offset + this.relativeOffset; + var substFormat = this.parseUShort(); + if (substFormat === 1) { + return { + substFormat: 1, + coverage: this.parsePointer(Parser.coverage), + chainRuleSets: this.parseListOfLists(function () { + return { + backtrack: this.parseUShortList(), + input: this.parseUShortList(this.parseShort() - 1), + lookahead: this.parseUShortList(), + lookupRecords: this.parseRecordList(lookupRecordDesc) + }; + }) + }; + } else if (substFormat === 2) { + return { + substFormat: 2, + coverage: this.parsePointer(Parser.coverage), + backtrackClassDef: this.parsePointer(Parser.classDef), + inputClassDef: this.parsePointer(Parser.classDef), + lookaheadClassDef: this.parsePointer(Parser.classDef), + chainClassSet: this.parseListOfLists(function () { + return { + backtrack: this.parseUShortList(), + input: this.parseUShortList(this.parseShort() - 1), + lookahead: this.parseUShortList(), + lookupRecords: this.parseRecordList(lookupRecordDesc) + }; + }) + }; + } else if (substFormat === 3) { + return { + substFormat: 3, + backtrackCoverage: this.parseList(Parser.pointer(Parser.coverage)), + inputCoverage: this.parseList(Parser.pointer(Parser.coverage)), + lookaheadCoverage: this.parseList(Parser.pointer(Parser.coverage)), + lookupRecords: this.parseRecordList(lookupRecordDesc) + }; + } + check.assert(false, '0x' + start.toString(16) + ': lookup type 6 format must be 1, 2 or 3.'); + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#ES + subtableParsers[7] = function parseLookup7() { + // Extension Substitution subtable + var substFormat = this.parseUShort(); + check.argument(substFormat === 1, 'GSUB Extension Substitution subtable identifier-format must be 1'); + var extensionLookupType = this.parseUShort(); + var extensionParser = new Parser(this.data, this.offset + this.parseULong()); + return { + substFormat: 1, + lookupType: extensionLookupType, + extension: subtableParsers[extensionLookupType].call(extensionParser) + }; + }; + // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#RCCS + subtableParsers[8] = function parseLookup8() { + var substFormat = this.parseUShort(); + check.argument(substFormat === 1, 'GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1'); + return { + substFormat: substFormat, + coverage: this.parsePointer(Parser.coverage), + backtrackCoverage: this.parseList(Parser.pointer(Parser.coverage)), + lookaheadCoverage: this.parseList(Parser.pointer(Parser.coverage)), + substitutes: this.parseUShortList() + }; + }; + // https://www.microsoft.com/typography/OTSPEC/gsub.htm + function parseGsubTable(data, start) { + start = start || 0; + var p = new Parser(data, start); + var tableVersion = p.parseVersion(1); + check.argument(tableVersion === 1 || tableVersion === 1.1, 'Unsupported GSUB table version.'); + if (tableVersion === 1) { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers) + }; + } else { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers), + variations: p.parseFeatureVariationsList() + }; + } + } // GSUB Writing ////////////////////////////////////////////// + + var subtableMakers = new Array(9); + subtableMakers[1] = function makeLookup1(subtable) { + if (subtable.substFormat === 1) { + return new table.Table('substitutionTable', [ + { + name: 'substFormat', + type: 'USHORT', + value: 1 + }, + { + name: 'coverage', + type: 'TABLE', + value: new table.Coverage(subtable.coverage) + }, + { + name: 'deltaGlyphID', + type: 'USHORT', + value: subtable.deltaGlyphId + } + ]); + } else { + return new table.Table('substitutionTable', [ + { + name: 'substFormat', + type: 'USHORT', + value: 2 + }, + { + name: 'coverage', + type: 'TABLE', + value: new table.Coverage(subtable.coverage) + } + ].concat(table.ushortList('substitute', subtable.substitute))); + } + check.fail('Lookup type 1 substFormat must be 1 or 2.'); + }; + subtableMakers[3] = function makeLookup3(subtable) { + check.assert(subtable.substFormat === 1, 'Lookup type 3 substFormat must be 1.'); + return new table.Table('substitutionTable', [ + { + name: 'substFormat', + type: 'USHORT', + value: 1 + }, + { + name: 'coverage', + type: 'TABLE', + value: new table.Coverage(subtable.coverage) + } + ].concat(table.tableList('altSet', subtable.alternateSets, function (alternateSet) { + return new table.Table('alternateSetTable', table.ushortList('alternate', alternateSet)); + }))); + }; + subtableMakers[4] = function makeLookup4(subtable) { + check.assert(subtable.substFormat === 1, 'Lookup type 4 substFormat must be 1.'); + return new table.Table('substitutionTable', [ + { + name: 'substFormat', + type: 'USHORT', + value: 1 + }, + { + name: 'coverage', + type: 'TABLE', + value: new table.Coverage(subtable.coverage) + } + ].concat(table.tableList('ligSet', subtable.ligatureSets, function (ligatureSet) { + return new table.Table('ligatureSetTable', table.tableList('ligature', ligatureSet, function (ligature) { + return new table.Table('ligatureTable', [ + { + name: 'ligGlyph', + type: 'USHORT', + value: ligature.ligGlyph + } + ].concat(table.ushortList('component', ligature.components, ligature.components.length + 1))); + })); + }))); + }; + function makeGsubTable(gsub) { + return new table.Table('GSUB', [ + { + name: 'version', + type: 'ULONG', + value: 65536 + }, + { + name: 'scripts', + type: 'TABLE', + value: new table.ScriptList(gsub.scripts) + }, + { + name: 'features', + type: 'TABLE', + value: new table.FeatureList(gsub.features) + }, + { + name: 'lookups', + type: 'TABLE', + value: new table.LookupList(gsub.lookups, subtableMakers) + } + ]); + } + var gsub = { + parse: parseGsubTable, + make: makeGsubTable + }; + // The `GPOS` table contains kerning pairs, among other things. + // Parse the metadata `meta` table. + // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html + function parseMetaTable(data, start) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseULong(); + check.argument(tableVersion === 1, 'Unsupported META table version.'); + p.parseULong(); // flags - currently unused and set to 0 + p.parseULong(); // tableOffset + var numDataMaps = p.parseULong(); + var tags = { + }; + for (var i = 0; i < numDataMaps; i++) { + var tag = p.parseTag(); + var dataOffset = p.parseULong(); + var dataLength = p.parseULong(); + var text = decode.UTF8(data, start + dataOffset, dataLength); + tags[tag] = text; + } + return tags; + } + function makeMetaTable(tags) { + var numTags = Object.keys(tags).length; + var stringPool = ''; + var stringPoolOffset = 16 + numTags * 12; + var result = new table.Table('meta', [ + { + name: 'version', + type: 'ULONG', + value: 1 + }, + { + name: 'flags', + type: 'ULONG', + value: 0 + }, + { + name: 'offset', + type: 'ULONG', + value: stringPoolOffset + }, + { + name: 'numTags', + type: 'ULONG', + value: numTags + } + ]); + for (var tag in tags) { + var pos = stringPool.length; + stringPool += tags[tag]; + result.fields.push({ + name: 'tag ' + tag, + type: 'TAG', + value: tag + }); + result.fields.push({ + name: 'offset ' + tag, + type: 'ULONG', + value: stringPoolOffset + pos + }); + result.fields.push({ + name: 'length ' + tag, + type: 'ULONG', + value: tags[tag].length + }); + } + result.fields.push({ + name: 'stringPool', + type: 'CHARARRAY', + value: stringPool + }); + return result; + } + var meta = { + parse: parseMetaTable, + make: makeMetaTable + }; + // The `sfnt` wrapper provides organization for the tables in the font. + function log2(v) { + return Math.log(v) / Math.log(2) | 0; + } + function computeCheckSum(bytes) { + while (bytes.length % 4 !== 0) { + bytes.push(0); + } + var sum = 0; + for (var i = 0; i < bytes.length; i += 4) { + sum += (bytes[i] << 24) + (bytes[i + 1] << 16) + (bytes[i + 2] << 8) + bytes[i + 3]; + } + sum %= Math.pow(2, 32); + return sum; + } + function makeTableRecord(tag, checkSum, offset, length) { + return new table.Record('Table Record', [ + { + name: 'tag', + type: 'TAG', + value: tag !== undefined ? tag : '' + }, + { + name: 'checkSum', + type: 'ULONG', + value: checkSum !== undefined ? checkSum : 0 + }, + { + name: 'offset', + type: 'ULONG', + value: offset !== undefined ? offset : 0 + }, + { + name: 'length', + type: 'ULONG', + value: length !== undefined ? length : 0 + } + ]); + } + function makeSfntTable(tables) { + var sfnt = new table.Table('sfnt', [ + { + name: 'version', + type: 'TAG', + value: 'OTTO' + }, + { + name: 'numTables', + type: 'USHORT', + value: 0 + }, + { + name: 'searchRange', + type: 'USHORT', + value: 0 + }, + { + name: 'entrySelector', + type: 'USHORT', + value: 0 + }, + { + name: 'rangeShift', + type: 'USHORT', + value: 0 + } + ]); + sfnt.tables = tables; + sfnt.numTables = tables.length; + var highestPowerOf2 = Math.pow(2, log2(sfnt.numTables)); + sfnt.searchRange = 16 * highestPowerOf2; + sfnt.entrySelector = log2(highestPowerOf2); + sfnt.rangeShift = sfnt.numTables * 16 - sfnt.searchRange; + var recordFields = [ + ]; + var tableFields = [ + ]; + var offset = sfnt.sizeOf() + makeTableRecord().sizeOf() * sfnt.numTables; + while (offset % 4 !== 0) { + offset += 1; + tableFields.push({ + name: 'padding', + type: 'BYTE', + value: 0 + }); + } + for (var i = 0; i < tables.length; i += 1) { + var t = tables[i]; + check.argument(t.tableName.length === 4, 'Table name' + t.tableName + ' is invalid.'); + var tableLength = t.sizeOf(); + var tableRecord = makeTableRecord(t.tableName, computeCheckSum(t.encode()), offset, tableLength); + recordFields.push({ + name: tableRecord.tag + ' Table Record', + type: 'RECORD', + value: tableRecord + }); + tableFields.push({ + name: t.tableName + ' table', + type: 'RECORD', + value: t + }); + offset += tableLength; + check.argument(!isNaN(offset), 'Something went wrong calculating the offset.'); + while (offset % 4 !== 0) { + offset += 1; + tableFields.push({ + name: 'padding', + type: 'BYTE', + value: 0 + }); + } + } // Table records need to be sorted alphabetically. + + recordFields.sort(function (r1, r2) { + if (r1.value.tag > r2.value.tag) { + return 1; + } else { + return - 1; + } + }); + sfnt.fields = sfnt.fields.concat(recordFields); + sfnt.fields = sfnt.fields.concat(tableFields); + return sfnt; + } // Get the metrics for a character. If the string has more than one character + // this function returns metrics for the first available character. + // You can provide optional fallback metrics if no characters are available. + + function metricsForChar(font, chars, notFoundMetrics) { + for (var i = 0; i < chars.length; i += 1) { + var glyphIndex = font.charToGlyphIndex(chars[i]); + if (glyphIndex > 0) { + var glyph = font.glyphs.get(glyphIndex); + return glyph.getMetrics(); + } + } + return notFoundMetrics; + } + function average(vs) { + var sum = 0; + for (var i = 0; i < vs.length; i += 1) { + sum += vs[i]; + } + return sum / vs.length; + } // Convert the font object to a SFNT data structure. + // This structure contains all the necessary tables and metadata to create a binary OTF file. + + function fontToSfntTable(font) { + var xMins = [ + ]; + var yMins = [ + ]; + var xMaxs = [ + ]; + var yMaxs = [ + ]; + var advanceWidths = [ + ]; + var leftSideBearings = [ + ]; + var rightSideBearings = [ + ]; + var firstCharIndex; + var lastCharIndex = 0; + var ulUnicodeRange1 = 0; + var ulUnicodeRange2 = 0; + var ulUnicodeRange3 = 0; + var ulUnicodeRange4 = 0; + for (var i = 0; i < font.glyphs.length; i += 1) { + var glyph = font.glyphs.get(i); + var unicode = glyph.unicode | 0; + if (isNaN(glyph.advanceWidth)) { + throw new Error('Glyph ' + glyph.name + ' (' + i + '): advanceWidth is not a number.'); + } + if (firstCharIndex > unicode || firstCharIndex === undefined) { + // ignore .notdef char + if (unicode > 0) { + firstCharIndex = unicode; + } + } + if (lastCharIndex < unicode) { + lastCharIndex = unicode; + } + var position = os2.getUnicodeRange(unicode); + if (position < 32) { + ulUnicodeRange1 |= 1 << position; + } else if (position < 64) { + ulUnicodeRange2 |= 1 << position - 32; + } else if (position < 96) { + ulUnicodeRange3 |= 1 << position - 64; + } else if (position < 123) { + ulUnicodeRange4 |= 1 << position - 96; + } else { + throw new Error('Unicode ranges bits > 123 are reserved for internal usage'); + } // Skip non-important characters. + + if (glyph.name === '.notdef') { + continue; + } + var metrics = glyph.getMetrics(); + xMins.push(metrics.xMin); + yMins.push(metrics.yMin); + xMaxs.push(metrics.xMax); + yMaxs.push(metrics.yMax); + leftSideBearings.push(metrics.leftSideBearing); + rightSideBearings.push(metrics.rightSideBearing); + advanceWidths.push(glyph.advanceWidth); + } + var globals = { + xMin: Math.min.apply(null, xMins), + yMin: Math.min.apply(null, yMins), + xMax: Math.max.apply(null, xMaxs), + yMax: Math.max.apply(null, yMaxs), + advanceWidthMax: Math.max.apply(null, advanceWidths), + advanceWidthAvg: average(advanceWidths), + minLeftSideBearing: Math.min.apply(null, leftSideBearings), + maxLeftSideBearing: Math.max.apply(null, leftSideBearings), + minRightSideBearing: Math.min.apply(null, rightSideBearings) + }; + globals.ascender = font.ascender; + globals.descender = font.descender; + var headTable = head.make({ + flags: 3, + // 00000011 (baseline for font at y=0; left sidebearing point at x=0) + unitsPerEm: font.unitsPerEm, + xMin: globals.xMin, + yMin: globals.yMin, + xMax: globals.xMax, + yMax: globals.yMax, + lowestRecPPEM: 3, + createdTimestamp: font.createdTimestamp + }); + var hheaTable = hhea.make({ + ascender: globals.ascender, + descender: globals.descender, + advanceWidthMax: globals.advanceWidthMax, + minLeftSideBearing: globals.minLeftSideBearing, + minRightSideBearing: globals.minRightSideBearing, + xMaxExtent: globals.maxLeftSideBearing + (globals.xMax - globals.xMin), + numberOfHMetrics: font.glyphs.length + }); + var maxpTable = maxp.make(font.glyphs.length); + var os2Table = os2.make({ + xAvgCharWidth: Math.round(globals.advanceWidthAvg), + usWeightClass: font.tables.os2.usWeightClass, + usWidthClass: font.tables.os2.usWidthClass, + usFirstCharIndex: firstCharIndex, + usLastCharIndex: lastCharIndex, + ulUnicodeRange1: ulUnicodeRange1, + ulUnicodeRange2: ulUnicodeRange2, + ulUnicodeRange3: ulUnicodeRange3, + ulUnicodeRange4: ulUnicodeRange4, + fsSelection: font.tables.os2.fsSelection, + // REGULAR + // See http://typophile.com/node/13081 for more info on vertical metrics. + // We get metrics for typical characters (such as "x" for xHeight). + // We provide some fallback characters if characters are unavailable: their + // ordering was chosen experimentally. + sTypoAscender: globals.ascender, + sTypoDescender: globals.descender, + sTypoLineGap: 0, + usWinAscent: globals.yMax, + usWinDescent: Math.abs(globals.yMin), + ulCodePageRange1: 1, + // FIXME: hard-code Latin 1 support for now + sxHeight: metricsForChar(font, 'xyvw', { + yMax: Math.round(globals.ascender / 2) + }).yMax, + sCapHeight: metricsForChar(font, 'HIKLEFJMNTZBDPRAGOQSUVWXY', globals).yMax, + usDefaultChar: font.hasChar(' ') ? 32 : 0, + // Use space as the default character, if available. + usBreakChar: font.hasChar(' ') ? 32 : 0 // Use space as the break character, if available. + }); + var hmtxTable = hmtx.make(font.glyphs); + var cmapTable = cmap.make(font.glyphs); + var englishFamilyName = font.getEnglishName('fontFamily'); + var englishStyleName = font.getEnglishName('fontSubfamily'); + var englishFullName = englishFamilyName + ' ' + englishStyleName; + var postScriptName = font.getEnglishName('postScriptName'); + if (!postScriptName) { + postScriptName = englishFamilyName.replace(/\s/g, '') + '-' + englishStyleName; + } + var names = { + }; + for (var n in font.names) { + names[n] = font.names[n]; + } + if (!names.uniqueID) { + names.uniqueID = { + en: font.getEnglishName('manufacturer') + ':' + englishFullName + }; + } + if (!names.postScriptName) { + names.postScriptName = { + en: postScriptName + }; + } + if (!names.preferredFamily) { + names.preferredFamily = font.names.fontFamily; + } + if (!names.preferredSubfamily) { + names.preferredSubfamily = font.names.fontSubfamily; + } + var languageTags = [ + ]; + var nameTable = _name.make(names, languageTags); + var ltagTable = languageTags.length > 0 ? ltag.make(languageTags) : undefined; + var postTable = post.make(); + var cffTable = cff.make(font.glyphs, { + version: font.getEnglishName('version'), + fullName: englishFullName, + familyName: englishFamilyName, + weightName: englishStyleName, + postScriptName: postScriptName, + unitsPerEm: font.unitsPerEm, + fontBBox: [ + 0, + globals.yMin, + globals.ascender, + globals.advanceWidthMax + ] + }); + var metaTable = font.metas && Object.keys(font.metas).length > 0 ? meta.make(font.metas) : undefined; + // The order does not matter because makeSfntTable() will sort them. + var tables = [ + headTable, + hheaTable, + maxpTable, + os2Table, + nameTable, + cmapTable, + postTable, + cffTable, + hmtxTable + ]; + if (ltagTable) { + tables.push(ltagTable); + } // Optional tables + + if (font.tables.gsub) { + tables.push(gsub.make(font.tables.gsub)); + } + if (metaTable) { + tables.push(metaTable); + } + var sfntTable = makeSfntTable(tables); + // Compute the font's checkSum and store it in head.checkSumAdjustment. + var bytes = sfntTable.encode(); + var checkSum = computeCheckSum(bytes); + var tableFields = sfntTable.fields; + var checkSumAdjusted = false; + for (var i$1 = 0; i$1 < tableFields.length; i$1 += 1) { + if (tableFields[i$1].name === 'head table') { + tableFields[i$1].value.checkSumAdjustment = 2981146554 - checkSum; + checkSumAdjusted = true; + break; + } + } + if (!checkSumAdjusted) { + throw new Error('Could not find head table with checkSum to adjust.'); + } + return sfntTable; + } + var sfnt = { + make: makeSfntTable, + fontToTable: fontToSfntTable, + computeCheckSum: computeCheckSum + }; + // The Layout object is the prototype of Substitution objects, and provides + function searchTag(arr, tag) { + /* jshint bitwise: false */ + var imin = 0; + var imax = arr.length - 1; + while (imin <= imax) { + var imid = imin + imax >>> 1; + var val = arr[imid].tag; + if (val === tag) { + return imid; + } else if (val < tag) { + imin = imid + 1; + } else { + imax = imid - 1; + } + } // Not found: return -1-insertion point + + return - imin - 1; + } + function binSearch(arr, value) { + /* jshint bitwise: false */ + var imin = 0; + var imax = arr.length - 1; + while (imin <= imax) { + var imid = imin + imax >>> 1; + var val = arr[imid]; + if (val === value) { + return imid; + } else if (val < value) { + imin = imid + 1; + } else { + imax = imid - 1; + } + } // Not found: return -1-insertion point + + return - imin - 1; + } // binary search in a list of ranges (coverage, class definition) + + function searchRange(ranges, value) { + // jshint bitwise: false + var range; + var imin = 0; + var imax = ranges.length - 1; + while (imin <= imax) { + var imid = imin + imax >>> 1; + range = ranges[imid]; + var start = range.start; + if (start === value) { + return range; + } else if (start < value) { + imin = imid + 1; + } else { + imax = imid - 1; + } + } + if (imin > 0) { + range = ranges[imin - 1]; + if (value > range.end) { + return 0; + } + return range; + } + } /** + * @exports opentype.Layout + * @class + */ + + function Layout(font, tableName) { + this.font = font; + this.tableName = tableName; + } + Layout.prototype = { + /** + * Binary search an object by "tag" property + * @instance + * @function searchTag + * @memberof opentype.Layout + * @param {Array} arr + * @param {string} tag + * @return {number} + */ + searchTag: searchTag, + /** + * Binary search in a list of numbers + * @instance + * @function binSearch + * @memberof opentype.Layout + * @param {Array} arr + * @param {number} value + * @return {number} + */ + binSearch: binSearch, + /** + * Get or create the Layout table (GSUB, GPOS etc). + * @param {boolean} create - Whether to create a new one. + * @return {Object} The GSUB or GPOS table. + */ + getTable: function (create) { + var layout = this.font.tables[this.tableName]; + if (!layout && create) { + layout = this.font.tables[this.tableName] = this.createDefaultTable(); + } + return layout; + }, + /** + * Returns all scripts in the substitution table. + * @instance + * @return {Array} + */ + getScriptNames: function () { + var layout = this.getTable(); + if (!layout) { + return []; + } + return layout.scripts.map(function (script) { + return script.tag; + }); + }, + /** + * Returns the best bet for a script name. + * Returns 'DFLT' if it exists. + * If not, returns 'latn' if it exists. + * If neither exist, returns undefined. + */ + getDefaultScriptName: function () { + var layout = this.getTable(); + if (!layout) { + return; + } + var hasLatn = false; + for (var i = 0; i < layout.scripts.length; i++) { + var name = layout.scripts[i].tag; + if (name === 'DFLT') { + return name; + } + if (name === 'latn') { + hasLatn = true; + } + } + if (hasLatn) { + return 'latn'; + } + }, + /** + * Returns all LangSysRecords in the given script. + * @instance + * @param {string} [script='DFLT'] + * @param {boolean} create - forces the creation of this script table if it doesn't exist. + * @return {Object} An object with tag and script properties. + */ + getScriptTable: function (script, create) { + var layout = this.getTable(create); + if (layout) { + script = script || 'DFLT'; + var scripts = layout.scripts; + var pos = searchTag(layout.scripts, script); + if (pos >= 0) { + return scripts[pos].script; + } else if (create) { + var scr = { + tag: script, + script: { + defaultLangSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [ + ] + }, + langSysRecords: [ + ] + } + }; + scripts.splice( - 1 - pos, 0, scr); + return scr.script; + } + } + }, + /** + * Returns a language system table + * @instance + * @param {string} [script='DFLT'] + * @param {string} [language='dlft'] + * @param {boolean} create - forces the creation of this langSysTable if it doesn't exist. + * @return {Object} + */ + getLangSysTable: function (script, language, create) { + var scriptTable = this.getScriptTable(script, create); + if (scriptTable) { + if (!language || language === 'dflt' || language === 'DFLT') { + return scriptTable.defaultLangSys; + } + var pos = searchTag(scriptTable.langSysRecords, language); + if (pos >= 0) { + return scriptTable.langSysRecords[pos].langSys; + } else if (create) { + var langSysRecord = { + tag: language, + langSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [ + ] + } + }; + scriptTable.langSysRecords.splice( - 1 - pos, 0, langSysRecord); + return langSysRecord.langSys; + } + } + }, + /** + * Get a specific feature table. + * @instance + * @param {string} [script='DFLT'] + * @param {string} [language='dlft'] + * @param {string} feature - One of the codes listed at https://www.microsoft.com/typography/OTSPEC/featurelist.htm + * @param {boolean} create - forces the creation of the feature table if it doesn't exist. + * @return {Object} + */ + getFeatureTable: function (script, language, feature, create) { + var langSysTable = this.getLangSysTable(script, language, create); + if (langSysTable) { + var featureRecord; + var featIndexes = langSysTable.featureIndexes; + var allFeatures = this.font.tables[this.tableName].features; + // The FeatureIndex array of indices is in arbitrary order, + // even if allFeatures is sorted alphabetically by feature tag. + for (var i = 0; i < featIndexes.length; i++) { + featureRecord = allFeatures[featIndexes[i]]; + if (featureRecord.tag === feature) { + return featureRecord.feature; + } + } + if (create) { + var index = allFeatures.length; + // Automatic ordering of features would require to shift feature indexes in the script list. + check.assert(index === 0 || feature >= allFeatures[index - 1].tag, 'Features must be added in alphabetical order.'); + featureRecord = { + tag: feature, + feature: { + params: 0, + lookupListIndexes: [ + ] + } + }; + allFeatures.push(featureRecord); + featIndexes.push(index); + return featureRecord.feature; + } + } + }, + /** + * Get the lookup tables of a given type for a script/language/feature. + * @instance + * @param {string} [script='DFLT'] + * @param {string} [language='dlft'] + * @param {string} feature - 4-letter feature code + * @param {number} lookupType - 1 to 9 + * @param {boolean} create - forces the creation of the lookup table if it doesn't exist, with no subtables. + * @return {Object[]} + */ + getLookupTables: function (script, language, feature, lookupType, create) { + var featureTable = this.getFeatureTable(script, language, feature, create); + var tables = [ + ]; + if (featureTable) { + var lookupTable; + var lookupListIndexes = featureTable.lookupListIndexes; + var allLookups = this.font.tables[this.tableName].lookups; + // lookupListIndexes are in no particular order, so use naive search. + for (var i = 0; i < lookupListIndexes.length; i++) { + lookupTable = allLookups[lookupListIndexes[i]]; + if (lookupTable.lookupType === lookupType) { + tables.push(lookupTable); + } + } + if (tables.length === 0 && create) { + lookupTable = { + lookupType: lookupType, + lookupFlag: 0, + subtables: [ + ], + markFilteringSet: undefined + }; + var index = allLookups.length; + allLookups.push(lookupTable); + lookupListIndexes.push(index); + return [lookupTable]; + } + } + return tables; + }, + /** + * Find a glyph in a class definition table + * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#class-definition-table + * @param {object} classDefTable - an OpenType Layout class definition table + * @param {number} glyphIndex - the index of the glyph to find + * @returns {number} -1 if not found + */ + getGlyphClass: function (classDefTable, glyphIndex) { + switch (classDefTable.format) { + case 1: + if (classDefTable.startGlyph <= glyphIndex && glyphIndex < classDefTable.startGlyph + classDefTable.classes.length) { + return classDefTable.classes[glyphIndex - classDefTable.startGlyph]; + } + return 0; + case 2: + var range = searchRange(classDefTable.ranges, glyphIndex); + return range ? range.classId : 0; + } + }, + /** + * Find a glyph in a coverage table + * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#coverage-table + * @param {object} coverageTable - an OpenType Layout coverage table + * @param {number} glyphIndex - the index of the glyph to find + * @returns {number} -1 if not found + */ + getCoverageIndex: function (coverageTable, glyphIndex) { + switch (coverageTable.format) { + case 1: + var index = binSearch(coverageTable.glyphs, glyphIndex); + return index >= 0 ? index : - 1; + case 2: + var range = searchRange(coverageTable.ranges, glyphIndex); + return range ? range.index + glyphIndex - range.start : - 1; + } + }, + /** + * Returns the list of glyph indexes of a coverage table. + * Format 1: the list is stored raw + * Format 2: compact list as range records. + * @instance + * @param {Object} coverageTable + * @return {Array} + */ + expandCoverage: function (coverageTable) { + if (coverageTable.format === 1) { + return coverageTable.glyphs; + } else { + var glyphs = [ + ]; + var ranges = coverageTable.ranges; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var start = range.start; + var end = range.end; + for (var j = start; j <= end; j++) { + glyphs.push(j); + } + } + return glyphs; + } + } + }; + // The Position object provides utility methods to manipulate + /** + * @exports opentype.Position + * @class + * @extends opentype.Layout + * @param {opentype.Font} + * @constructor + */ + function Position(font) { + Layout.call(this, font, 'gpos'); + } + Position.prototype = Layout.prototype; + /** + * Init some data for faster and easier access later. + */ + Position.prototype.init = function () { + var script = this.getDefaultScriptName(); + this.defaultKerningTables = this.getKerningTables(script); + }; + /** + * Find a glyph pair in a list of lookup tables of type 2 and retrieve the xAdvance kerning value. + * + * @param {integer} leftIndex - left glyph index + * @param {integer} rightIndex - right glyph index + * @returns {integer} + */ + Position.prototype.getKerningValue = function (kerningLookups, leftIndex, rightIndex) { + var this$1 = this; + for (var i = 0; i < kerningLookups.length; i++) { + var subtables = kerningLookups[i].subtables; + for (var j = 0; j < subtables.length; j++) { + var subtable = subtables[j]; + var covIndex = this$1.getCoverageIndex(subtable.coverage, leftIndex); + if (covIndex < 0) { + continue; + } + switch (subtable.posFormat) { + case 1: + // Search Pair Adjustment Positioning Format 1 + var pairSet = subtable.pairSets[covIndex]; + for (var k = 0; k < pairSet.length; k++) { + var pair = pairSet[k]; + if (pair.secondGlyph === rightIndex) { + return pair.value1 && pair.value1.xAdvance || 0; + } + } + break; + // left glyph found, not right glyph - try next subtable + case 2: + // Search Pair Adjustment Positioning Format 2 + var class1 = this$1.getGlyphClass(subtable.classDef1, leftIndex); + var class2 = this$1.getGlyphClass(subtable.classDef2, rightIndex); + var pair$1 = subtable.classRecords[class1][class2]; + return pair$1.value1 && pair$1.value1.xAdvance || 0; + } + } + } + return 0; + }; + /** + * List all kerning lookup tables. + * + * @param {string} [script='DFLT'] - use font.position.getDefaultScriptName() for a better default value + * @param {string} [language='dflt'] + * @return {object[]} The list of kerning lookup tables (may be empty), or undefined if there is no GPOS table (and we should use the kern table) + */ + Position.prototype.getKerningTables = function (script, language) { + if (this.font.tables.gpos) { + return this.getLookupTables(script, language, 'kern', 2); + } + }; + // The Substitution object provides utility methods to manipulate + /** + * @exports opentype.Substitution + * @class + * @extends opentype.Layout + * @param {opentype.Font} + * @constructor + */ + function Substitution(font) { + Layout.call(this, font, 'gsub'); + } // Check if 2 arrays of primitives are equal. + + function arraysEqual(ar1, ar2) { + var n = ar1.length; + if (n !== ar2.length) { + return false; + } + for (var i = 0; i < n; i++) { + if (ar1[i] !== ar2[i]) { + return false; + } + } + return true; + } // Find the first subtable of a lookup table in a particular format. + + function getSubstFormat(lookupTable, format, defaultSubtable) { + var subtables = lookupTable.subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + if (subtable.substFormat === format) { + return subtable; + } + } + if (defaultSubtable) { + subtables.push(defaultSubtable); + return defaultSubtable; + } + return undefined; + } + Substitution.prototype = Layout.prototype; + /** + * Create a default GSUB table. + * @return {Object} gsub - The GSUB table. + */ + Substitution.prototype.createDefaultTable = function () { + // Generate a default empty GSUB table with just a DFLT script and dflt lang sys. + return { + version: 1, + scripts: [ + { + tag: 'DFLT', + script: { + defaultLangSys: { + reserved: 0, + reqFeatureIndex: 65535, + featureIndexes: [ + ] + }, + langSysRecords: [ + ] + } + } + ], + features: [ + ], + lookups: [ + ] + }; + }; + /** + * List all single substitutions (lookup type 1) for a given script, language, and feature. + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @param {string} feature - 4-character feature name ('aalt', 'salt', 'ss01'...) + * @return {Array} substitutions - The list of substitutions. + */ + Substitution.prototype.getSingle = function (feature, script, language) { + var this$1 = this; + var substitutions = [ + ]; + var lookupTables = this.getLookupTables(script, language, feature, 1); + for (var idx = 0; idx < lookupTables.length; idx++) { + var subtables = lookupTables[idx].subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + var glyphs = this$1.expandCoverage(subtable.coverage); + var j = void 0; + if (subtable.substFormat === 1) { + var delta = subtable.deltaGlyphId; + for (j = 0; j < glyphs.length; j++) { + var glyph = glyphs[j]; + substitutions.push({ + sub: glyph, + by: glyph + delta + }); + } + } else { + var substitute = subtable.substitute; + for (j = 0; j < glyphs.length; j++) { + substitutions.push({ + sub: glyphs[j], + by: substitute[j] + }); + } + } + } + } + return substitutions; + }; + /** + * List all alternates (lookup type 3) for a given script, language, and feature. + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @param {string} feature - 4-character feature name ('aalt', 'salt'...) + * @return {Array} alternates - The list of alternates + */ + Substitution.prototype.getAlternates = function (feature, script, language) { + var this$1 = this; + var alternates = [ + ]; + var lookupTables = this.getLookupTables(script, language, feature, 3); + for (var idx = 0; idx < lookupTables.length; idx++) { + var subtables = lookupTables[idx].subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + var glyphs = this$1.expandCoverage(subtable.coverage); + var alternateSets = subtable.alternateSets; + for (var j = 0; j < glyphs.length; j++) { + alternates.push({ + sub: glyphs[j], + by: alternateSets[j] + }); + } + } + } + return alternates; + }; + /** + * List all ligatures (lookup type 4) for a given script, language, and feature. + * The result is an array of ligature objects like { sub: [ids], by: id } + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @return {Array} ligatures - The list of ligatures. + */ + Substitution.prototype.getLigatures = function (feature, script, language) { + var this$1 = this; + var ligatures = [ + ]; + var lookupTables = this.getLookupTables(script, language, feature, 4); + for (var idx = 0; idx < lookupTables.length; idx++) { + var subtables = lookupTables[idx].subtables; + for (var i = 0; i < subtables.length; i++) { + var subtable = subtables[i]; + var glyphs = this$1.expandCoverage(subtable.coverage); + var ligatureSets = subtable.ligatureSets; + for (var j = 0; j < glyphs.length; j++) { + var startGlyph = glyphs[j]; + var ligSet = ligatureSets[j]; + for (var k = 0; k < ligSet.length; k++) { + var lig = ligSet[k]; + ligatures.push({ + sub: [ + startGlyph + ].concat(lig.components), + by: lig.ligGlyph + }); + } + } + } + } + return ligatures; + }; + /** + * Add or modify a single substitution (lookup type 1) + * Format 2, more flexible, is always used. + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {Object} substitution - { sub: id, delta: number } for format 1 or { sub: id, by: id } for format 2. + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.addSingle = function (feature, substitution, script, language) { + var lookupTable = this.getLookupTables(script, language, feature, 1, true) [0]; + var subtable = getSubstFormat(lookupTable, 2, { + // lookup type 1 subtable, format 2, coverage format 1 + substFormat: 2, + coverage: { + format: 1, + glyphs: [ + ] + }, + substitute: [ + ] + }); + check.assert(subtable.coverage.format === 1, 'Ligature: unable to modify coverage table format ' + subtable.coverage.format); + var coverageGlyph = substitution.sub; + var pos = this.binSearch(subtable.coverage.glyphs, coverageGlyph); + if (pos < 0) { + pos = - 1 - pos; + subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); + subtable.substitute.splice(pos, 0, 0); + } + subtable.substitute[pos] = substitution.by; + }; + /** + * Add or modify an alternate substitution (lookup type 1) + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {Object} substitution - { sub: id, by: [ids] } + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.addAlternate = function (feature, substitution, script, language) { + var lookupTable = this.getLookupTables(script, language, feature, 3, true) [0]; + var subtable = getSubstFormat(lookupTable, 1, { + // lookup type 3 subtable, format 1, coverage format 1 + substFormat: 1, + coverage: { + format: 1, + glyphs: [ + ] + }, + alternateSets: [ + ] + }); + check.assert(subtable.coverage.format === 1, 'Ligature: unable to modify coverage table format ' + subtable.coverage.format); + var coverageGlyph = substitution.sub; + var pos = this.binSearch(subtable.coverage.glyphs, coverageGlyph); + if (pos < 0) { + pos = - 1 - pos; + subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); + subtable.alternateSets.splice(pos, 0, 0); + } + subtable.alternateSets[pos] = substitution.by; + }; + /** + * Add a ligature (lookup type 4) + * Ligatures with more components must be stored ahead of those with fewer components in order to be found + * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) + * @param {Object} ligature - { sub: [ids], by: id } + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.addLigature = function (feature, ligature, script, language) { + var lookupTable = this.getLookupTables(script, language, feature, 4, true) [0]; + var subtable = lookupTable.subtables[0]; + if (!subtable) { + subtable = { + // lookup type 4 subtable, format 1, coverage format 1 + substFormat: 1, + coverage: { + format: 1, + glyphs: [ + ] + }, + ligatureSets: [ + ] + }; + lookupTable.subtables[0] = subtable; + } + check.assert(subtable.coverage.format === 1, 'Ligature: unable to modify coverage table format ' + subtable.coverage.format); + var coverageGlyph = ligature.sub[0]; + var ligComponents = ligature.sub.slice(1); + var ligatureTable = { + ligGlyph: ligature.by, + components: ligComponents + }; + var pos = this.binSearch(subtable.coverage.glyphs, coverageGlyph); + if (pos >= 0) { + // ligatureSet already exists + var ligatureSet = subtable.ligatureSets[pos]; + for (var i = 0; i < ligatureSet.length; i++) { + // If ligature already exists, return. + if (arraysEqual(ligatureSet[i].components, ligComponents)) { + return; + } + } // ligature does not exist: add it. + + ligatureSet.push(ligatureTable); + } else { + // Create a new ligatureSet and add coverage for the first glyph. + pos = - 1 - pos; + subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); + subtable.ligatureSets.splice(pos, 0, [ + ligatureTable + ]); + } + }; + /** + * List all feature data for a given script and language. + * @param {string} feature - 4-letter feature name + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + * @return {Array} substitutions - The list of substitutions. + */ + Substitution.prototype.getFeature = function (feature, script, language) { + if (/ss\d\d/.test(feature)) { + // ss01 - ss20 + return this.getSingle(feature, script, language); + } + switch (feature) { + case 'aalt': + case 'salt': + return this.getSingle(feature, script, language).concat(this.getAlternates(feature, script, language)); + case 'dlig': + case 'liga': + case 'rlig': + return this.getLigatures(feature, script, language); + } + return undefined; + }; + /** + * Add a substitution to a feature for a given script and language. + * @param {string} feature - 4-letter feature name + * @param {Object} sub - the substitution to add (an object like { sub: id or [ids], by: id or [ids] }) + * @param {string} [script='DFLT'] + * @param {string} [language='dflt'] + */ + Substitution.prototype.add = function (feature, sub, script, language) { + if (/ss\d\d/.test(feature)) { + // ss01 - ss20 + return this.addSingle(feature, sub, script, language); + } + switch (feature) { + case 'aalt': + case 'salt': + if (typeof sub.by === 'number') { + return this.addSingle(feature, sub, script, language); + } + return this.addAlternate(feature, sub, script, language); + case 'dlig': + case 'liga': + case 'rlig': + return this.addLigature(feature, sub, script, language); + } + return undefined; + }; + function isBrowser() { + return typeof window !== 'undefined'; + } + function nodeBufferToArrayBuffer(buffer) { + var ab = new ArrayBuffer(buffer.length); + var view = new Uint8Array(ab); + for (var i = 0; i < buffer.length; ++i) { + view[i] = buffer[i]; + } + return ab; + } + function arrayBufferToNodeBuffer(ab) { + var buffer = new Buffer(ab.byteLength); + var view = new Uint8Array(ab); + for (var i = 0; i < buffer.length; ++i) { + buffer[i] = view[i]; + } + return buffer; + } + function checkArgument(expression, message) { + if (!expression) { + throw message; + } + } // The `glyf` table describes the glyphs in TrueType outline format. + // Parse the coordinate data for a glyph. + + function parseGlyphCoordinate(p, flag, previousValue, shortVectorBitMask, sameBitMask) { + var v; + if ((flag & shortVectorBitMask) > 0) { + // The coordinate is 1 byte long. + v = p.parseByte(); + // The `same` bit is re-used for short values to signify the sign of the value. + if ((flag & sameBitMask) === 0) { + v = - v; + } + v = previousValue + v; + } else { + // The coordinate is 2 bytes long. + // If the `same` bit is set, the coordinate is the same as the previous coordinate. + if ((flag & sameBitMask) > 0) { + v = previousValue; + } else { + // Parse the coordinate as a signed 16-bit delta value. + v = previousValue + p.parseShort(); + } + } + return v; + } // Parse a TrueType glyph. + + function parseGlyph(glyph, data, start) { + var p = new parse.Parser(data, start); + glyph.numberOfContours = p.parseShort(); + glyph._xMin = p.parseShort(); + glyph._yMin = p.parseShort(); + glyph._xMax = p.parseShort(); + glyph._yMax = p.parseShort(); + var flags; + var flag; + if (glyph.numberOfContours > 0) { + // This glyph is not a composite. + var endPointIndices = glyph.endPointIndices = [ + ]; + for (var i = 0; i < glyph.numberOfContours; i += 1) { + endPointIndices.push(p.parseUShort()); + } + glyph.instructionLength = p.parseUShort(); + glyph.instructions = [ + ]; + for (var i$1 = 0; i$1 < glyph.instructionLength; i$1 += 1) { + glyph.instructions.push(p.parseByte()); + } + var numberOfCoordinates = endPointIndices[endPointIndices.length - 1] + 1; + flags = [ + ]; + for (var i$2 = 0; i$2 < numberOfCoordinates; i$2 += 1) { + flag = p.parseByte(); + flags.push(flag); + // If bit 3 is set, we repeat this flag n times, where n is the next byte. + if ((flag & 8) > 0) { + var repeatCount = p.parseByte(); + for (var j = 0; j < repeatCount; j += 1) { + flags.push(flag); + i$2 += 1; + } + } + } + check.argument(flags.length === numberOfCoordinates, 'Bad flags.'); + if (endPointIndices.length > 0) { + var points = [ + ]; + var point; + // X/Y coordinates are relative to the previous point, except for the first point which is relative to 0,0. + if (numberOfCoordinates > 0) { + for (var i$3 = 0; i$3 < numberOfCoordinates; i$3 += 1) { + flag = flags[i$3]; + point = { + }; + point.onCurve = !!(flag & 1); + point.lastPointOfContour = endPointIndices.indexOf(i$3) >= 0; + points.push(point); + } + var px = 0; + for (var i$4 = 0; i$4 < numberOfCoordinates; i$4 += 1) { + flag = flags[i$4]; + point = points[i$4]; + point.x = parseGlyphCoordinate(p, flag, px, 2, 16); + px = point.x; + } + var py = 0; + for (var i$5 = 0; i$5 < numberOfCoordinates; i$5 += 1) { + flag = flags[i$5]; + point = points[i$5]; + point.y = parseGlyphCoordinate(p, flag, py, 4, 32); + py = point.y; + } + } + glyph.points = points; + } else { + glyph.points = [ + ]; + } + } else if (glyph.numberOfContours === 0) { + glyph.points = [ + ]; + } else { + glyph.isComposite = true; + glyph.points = [ + ]; + glyph.components = [ + ]; + var moreComponents = true; + while (moreComponents) { + flags = p.parseUShort(); + var component = { + glyphIndex: p.parseUShort(), + xScale: 1, + scale01: 0, + scale10: 0, + yScale: 1, + dx: 0, + dy: 0 + }; + if ((flags & 1) > 0) { + // The arguments are words + if ((flags & 2) > 0) { + // values are offset + component.dx = p.parseShort(); + component.dy = p.parseShort(); + } else { + // values are matched points + component.matchedPoints = [ + p.parseUShort(), + p.parseUShort() + ]; + } + } else { + // The arguments are bytes + if ((flags & 2) > 0) { + // values are offset + component.dx = p.parseChar(); + component.dy = p.parseChar(); + } else { + // values are matched points + component.matchedPoints = [ + p.parseByte(), + p.parseByte() + ]; + } + } + if ((flags & 8) > 0) { + // We have a scale + component.xScale = component.yScale = p.parseF2Dot14(); + } else if ((flags & 64) > 0) { + // We have an X / Y scale + component.xScale = p.parseF2Dot14(); + component.yScale = p.parseF2Dot14(); + } else if ((flags & 128) > 0) { + // We have a 2x2 transformation + component.xScale = p.parseF2Dot14(); + component.scale01 = p.parseF2Dot14(); + component.scale10 = p.parseF2Dot14(); + component.yScale = p.parseF2Dot14(); + } + glyph.components.push(component); + moreComponents = !!(flags & 32); + } + if (flags & 256) { + // We have instructions + glyph.instructionLength = p.parseUShort(); + glyph.instructions = [ + ]; + for (var i$6 = 0; i$6 < glyph.instructionLength; i$6 += 1) { + glyph.instructions.push(p.parseByte()); + } + } + } + } // Transform an array of points and return a new array. + + function transformPoints(points, transform) { + var newPoints = [ + ]; + for (var i = 0; i < points.length; i += 1) { + var pt = points[i]; + var newPt = { + x: transform.xScale * pt.x + transform.scale01 * pt.y + transform.dx, + y: transform.scale10 * pt.x + transform.yScale * pt.y + transform.dy, + onCurve: pt.onCurve, + lastPointOfContour: pt.lastPointOfContour + }; + newPoints.push(newPt); + } + return newPoints; + } + function getContours(points) { + var contours = [ + ]; + var currentContour = [ + ]; + for (var i = 0; i < points.length; i += 1) { + var pt = points[i]; + currentContour.push(pt); + if (pt.lastPointOfContour) { + contours.push(currentContour); + currentContour = [ + ]; + } + } + check.argument(currentContour.length === 0, 'There are still points left in the current contour.'); + return contours; + } // Convert the TrueType glyph outline to a Path. + + function getPath(points) { + var p = new Path(); + if (!points) { + return p; + } + var contours = getContours(points); + for (var contourIndex = 0; contourIndex < contours.length; ++contourIndex) { + var contour = contours[contourIndex]; + var prev = null; + var curr = contour[contour.length - 1]; + var next = contour[0]; + if (curr.onCurve) { + p.moveTo(curr.x, curr.y); + } else { + if (next.onCurve) { + p.moveTo(next.x, next.y); + } else { + // If both first and last points are off-curve, start at their middle. + var start = { + x: (curr.x + next.x) * 0.5, + y: (curr.y + next.y) * 0.5 + }; + p.moveTo(start.x, start.y); + } + } + for (var i = 0; i < contour.length; ++i) { + prev = curr; + curr = next; + next = contour[(i + 1) % contour.length]; + if (curr.onCurve) { + // This is a straight line. + p.lineTo(curr.x, curr.y); + } else { + var prev2 = prev; + var next2 = next; + if (!prev.onCurve) { + prev2 = { + x: (curr.x + prev.x) * 0.5, + y: (curr.y + prev.y) * 0.5 + }; + } + if (!next.onCurve) { + next2 = { + x: (curr.x + next.x) * 0.5, + y: (curr.y + next.y) * 0.5 + }; + } + p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y); + } + } + p.closePath(); + } + return p; + } + function buildPath(glyphs, glyph) { + if (glyph.isComposite) { + for (var j = 0; j < glyph.components.length; j += 1) { + var component = glyph.components[j]; + var componentGlyph = glyphs.get(component.glyphIndex); + // Force the ttfGlyphLoader to parse the glyph. + componentGlyph.getPath(); + if (componentGlyph.points) { + var transformedPoints = void 0; + if (component.matchedPoints === undefined) { + // component positioned by offset + transformedPoints = transformPoints(componentGlyph.points, component); + } else { + // component positioned by matched points + if (component.matchedPoints[0] > glyph.points.length - 1 || component.matchedPoints[1] > componentGlyph.points.length - 1) { + throw Error('Matched points out of range in ' + glyph.name); + } + var firstPt = glyph.points[component.matchedPoints[0]]; + var secondPt = componentGlyph.points[component.matchedPoints[1]]; + var transform = { + xScale: component.xScale, + scale01: component.scale01, + scale10: component.scale10, + yScale: component.yScale, + dx: 0, + dy: 0 + }; + secondPt = transformPoints([secondPt], transform) [0]; + transform.dx = firstPt.x - secondPt.x; + transform.dy = firstPt.y - secondPt.y; + transformedPoints = transformPoints(componentGlyph.points, transform); + } + glyph.points = glyph.points.concat(transformedPoints); + } + } + } + return getPath(glyph.points); + } // Parse all the glyphs according to the offsets from the `loca` table. + + function parseGlyfTable(data, start, loca, font) { + var glyphs = new glyphset.GlyphSet(font); + // The last element of the loca table is invalid. + for (var i = 0; i < loca.length - 1; i += 1) { + var offset = loca[i]; + var nextOffset = loca[i + 1]; + if (offset !== nextOffset) { + glyphs.push(i, glyphset.ttfGlyphLoader(font, i, parseGlyph, data, start + offset, buildPath)); + } else { + glyphs.push(i, glyphset.glyphLoader(font, i)); + } + } + return glyphs; + } + var glyf = { + getPath: getPath, + parse: parseGlyfTable + }; + /* A TrueType font hinting interpreter. + * + * (c) 2017 Axel Kittenberger + * + * This interpreter has been implemented according to this documentation: + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html + * + * According to the documentation F24DOT6 values are used for pixels. + * That means calculation is 1/64 pixel accurate and uses integer operations. + * However, Javascript has floating point operations by default and only + * those are available. One could make a case to simulate the 1/64 accuracy + * exactly by truncating after every division operation + * (for example with << 0) to get pixel exactly results as other TrueType + * implementations. It may make sense since some fonts are pixel optimized + * by hand using DELTAP instructions. The current implementation doesn't + * and rather uses full floating point precision. + * + * xScale, yScale and rotation is currently ignored. + * + * A few non-trivial instructions are missing as I didn't encounter yet + * a font that used them to test a possible implementation. + * + * Some fonts seem to use undocumented features regarding the twilight zone. + * Only some of them are implemented as they were encountered. + * + * The exports.DEBUG statements are removed on the minified distribution file. + */ + var instructionTable; + var exec; + var execGlyph; + var execComponent; + /* + * Creates a hinting object. + * + * There ought to be exactly one + * for each truetype font that is used for hinting. + */ + function Hinting(font) { + // the font this hinting object is for + this.font = font; + this.getCommands = function (hPoints) { + return glyf.getPath(hPoints).commands; + }; + // cached states + this._fpgmState = this._prepState = undefined; + // errorState + // 0 ... all okay + // 1 ... had an error in a glyf, + // continue working but stop spamming + // the console + // 2 ... error at prep, stop hinting at this ppem + // 3 ... error at fpeg, stop hinting for this font at all + this._errorState = 0; + } /* + * Not rounding. + */ + + function roundOff(v) { + return v; + } /* + * Rounding to grid. + */ + + function roundToGrid(v) { + //Rounding in TT is supposed to "symmetrical around zero" + return Math.sign(v) * Math.round(Math.abs(v)); + } /* + * Rounding to double grid. + */ + + function roundToDoubleGrid(v) { + return Math.sign(v) * Math.round(Math.abs(v * 2)) / 2; + } /* + * Rounding to half grid. + */ + + function roundToHalfGrid(v) { + return Math.sign(v) * (Math.round(Math.abs(v) + 0.5) - 0.5); + } /* + * Rounding to up to grid. + */ + + function roundUpToGrid(v) { + return Math.sign(v) * Math.ceil(Math.abs(v)); + } /* + * Rounding to down to grid. + */ + + function roundDownToGrid(v) { + return Math.sign(v) * Math.floor(Math.abs(v)); + } /* + * Super rounding. + */ + + var roundSuper = function (v) { + var period = this.srPeriod; + var phase = this.srPhase; + var threshold = this.srThreshold; + var sign = 1; + if (v < 0) { + v = - v; + sign = - 1; + } + v += threshold - phase; + v = Math.trunc(v / period) * period; + v += phase; + // according to http://xgridfit.sourceforge.net/round.html + if (v < 0) { + return phase * sign; + } + return v * sign; + }; + /* + * Unit vector of x-axis. + */ + var xUnitVector = { + x: 1, + y: 0, + axis: 'x', + // Gets the projected distance between two points. + // o1/o2 ... if true, respective original position is used. + distance: function (p1, p2, o1, o2) { + return (o1 ? p1.xo : p1.x) - (o2 ? p2.xo : p2.x); + }, + // Moves point p so the moved position has the same relative + // position to the moved positions of rp1 and rp2 than the + // original positions had. + // + // See APPENDIX on INTERPOLATE at the bottom of this file. + interpolate: function (p, rp1, rp2, pv) { + var do1; + var do2; + var doa1; + var doa2; + var dm1; + var dm2; + var dt; + if (!pv || pv === this) { + do1 = p.xo - rp1.xo; + do2 = p.xo - rp2.xo; + dm1 = rp1.x - rp1.xo; + dm2 = rp2.x - rp2.xo; + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + p.x = p.xo + (dm1 + dm2) / 2; + return; + } + p.x = p.xo + (dm1 * doa2 + dm2 * doa1) / dt; + return; + } + do1 = pv.distance(p, rp1, true, true); + do2 = pv.distance(p, rp2, true, true); + dm1 = pv.distance(rp1, rp1, false, true); + dm2 = pv.distance(rp2, rp2, false, true); + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + xUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); + return; + } + xUnitVector.setRelative(p, p, (dm1 * doa2 + dm2 * doa1) / dt, pv, true); + }, + // Slope of line normal to this + normalSlope: Number.NEGATIVE_INFINITY, + // Sets the point 'p' relative to point 'rp' + // by the distance 'd'. + // + // See APPENDIX on SETRELATIVE at the bottom of this file. + // + // p ... point to set + // rp ... reference point + // d ... distance on projection vector + // pv ... projection vector (undefined = this) + // org ... if true, uses the original position of rp as reference. + setRelative: function (p, rp, d, pv, org) { + if (!pv || pv === this) { + p.x = (org ? rp.xo : rp.x) + d; + return; + } + var rpx = org ? rp.xo : rp.x; + var rpy = org ? rp.yo : rp.y; + var rpdx = rpx + d * pv.x; + var rpdy = rpy + d * pv.y; + p.x = rpdx + (p.y - rpdy) / pv.normalSlope; + }, + // Slope of vector line. + slope: 0, + // Touches the point p. + touch: function (p) { + p.xTouched = true; + }, + // Tests if a point p is touched. + touched: function (p) { + return p.xTouched; + }, + // Untouches the point p. + untouch: function (p) { + p.xTouched = false; + } + }; + /* + * Unit vector of y-axis. + */ + var yUnitVector = { + x: 0, + y: 1, + axis: 'y', + // Gets the projected distance between two points. + // o1/o2 ... if true, respective original position is used. + distance: function (p1, p2, o1, o2) { + return (o1 ? p1.yo : p1.y) - (o2 ? p2.yo : p2.y); + }, + // Moves point p so the moved position has the same relative + // position to the moved positions of rp1 and rp2 than the + // original positions had. + // + // See APPENDIX on INTERPOLATE at the bottom of this file. + interpolate: function (p, rp1, rp2, pv) { + var do1; + var do2; + var doa1; + var doa2; + var dm1; + var dm2; + var dt; + if (!pv || pv === this) { + do1 = p.yo - rp1.yo; + do2 = p.yo - rp2.yo; + dm1 = rp1.y - rp1.yo; + dm2 = rp2.y - rp2.yo; + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + p.y = p.yo + (dm1 + dm2) / 2; + return; + } + p.y = p.yo + (dm1 * doa2 + dm2 * doa1) / dt; + return; + } + do1 = pv.distance(p, rp1, true, true); + do2 = pv.distance(p, rp2, true, true); + dm1 = pv.distance(rp1, rp1, false, true); + dm2 = pv.distance(rp2, rp2, false, true); + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + yUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); + return; + } + yUnitVector.setRelative(p, p, (dm1 * doa2 + dm2 * doa1) / dt, pv, true); + }, + // Slope of line normal to this. + normalSlope: 0, + // Sets the point 'p' relative to point 'rp' + // by the distance 'd' + // + // See APPENDIX on SETRELATIVE at the bottom of this file. + // + // p ... point to set + // rp ... reference point + // d ... distance on projection vector + // pv ... projection vector (undefined = this) + // org ... if true, uses the original position of rp as reference. + setRelative: function (p, rp, d, pv, org) { + if (!pv || pv === this) { + p.y = (org ? rp.yo : rp.y) + d; + return; + } + var rpx = org ? rp.xo : rp.x; + var rpy = org ? rp.yo : rp.y; + var rpdx = rpx + d * pv.x; + var rpdy = rpy + d * pv.y; + p.y = rpdy + pv.normalSlope * (p.x - rpdx); + }, + // Slope of vector line. + slope: Number.POSITIVE_INFINITY, + // Touches the point p. + touch: function (p) { + p.yTouched = true; + }, + // Tests if a point p is touched. + touched: function (p) { + return p.yTouched; + }, + // Untouches the point p. + untouch: function (p) { + p.yTouched = false; + } + }; + Object.freeze(xUnitVector); + Object.freeze(yUnitVector); + /* + * Creates a unit vector that is not x- or y-axis. + */ + function UnitVector(x, y) { + this.x = x; + this.y = y; + this.axis = undefined; + this.slope = y / x; + this.normalSlope = - x / y; + Object.freeze(this); + } /* + * Gets the projected distance between two points. + * o1/o2 ... if true, respective original position is used. + */ + + UnitVector.prototype.distance = function (p1, p2, o1, o2) { + return this.x * xUnitVector.distance(p1, p2, o1, o2) + this.y * yUnitVector.distance(p1, p2, o1, o2); + }; + /* + * Moves point p so the moved position has the same relative + * position to the moved positions of rp1 and rp2 than the + * original positions had. + * + * See APPENDIX on INTERPOLATE at the bottom of this file. + */ + UnitVector.prototype.interpolate = function (p, rp1, rp2, pv) { + var dm1; + var dm2; + var do1; + var do2; + var doa1; + var doa2; + var dt; + do1 = pv.distance(p, rp1, true, true); + do2 = pv.distance(p, rp2, true, true); + dm1 = pv.distance(rp1, rp1, false, true); + dm2 = pv.distance(rp2, rp2, false, true); + doa1 = Math.abs(do1); + doa2 = Math.abs(do2); + dt = doa1 + doa2; + if (dt === 0) { + this.setRelative(p, p, (dm1 + dm2) / 2, pv, true); + return; + } + this.setRelative(p, p, (dm1 * doa2 + dm2 * doa1) / dt, pv, true); + }; + /* + * Sets the point 'p' relative to point 'rp' + * by the distance 'd' + * + * See APPENDIX on SETRELATIVE at the bottom of this file. + * + * p ... point to set + * rp ... reference point + * d ... distance on projection vector + * pv ... projection vector (undefined = this) + * org ... if true, uses the original position of rp as reference. + */ + UnitVector.prototype.setRelative = function (p, rp, d, pv, org) { + pv = pv || this; + var rpx = org ? rp.xo : rp.x; + var rpy = org ? rp.yo : rp.y; + var rpdx = rpx + d * pv.x; + var rpdy = rpy + d * pv.y; + var pvns = pv.normalSlope; + var fvs = this.slope; + var px = p.x; + var py = p.y; + p.x = (fvs * px - pvns * rpdx + rpdy - py) / (fvs - pvns); + p.y = fvs * (p.x - px) + py; + }; + /* + * Touches the point p. + */ + UnitVector.prototype.touch = function (p) { + p.xTouched = true; + p.yTouched = true; + }; + /* + * Returns a unit vector with x/y coordinates. + */ + function getUnitVector(x, y) { + var d = Math.sqrt(x * x + y * y); + x /= d; + y /= d; + if (x === 1 && y === 0) { + return xUnitVector; + } else if (x === 0 && y === 1) { + return yUnitVector; + } else { + return new UnitVector(x, y); + } + } /* + * Creates a point in the hinting engine. + */ + + function HPoint(x, y, lastPointOfContour, onCurve) { + this.x = this.xo = Math.round(x * 64) / 64; // hinted x value and original x-value + this.y = this.yo = Math.round(y * 64) / 64; // hinted y value and original y-value + this.lastPointOfContour = lastPointOfContour; + this.onCurve = onCurve; + this.prevPointOnContour = undefined; + this.nextPointOnContour = undefined; + this.xTouched = false; + this.yTouched = false; + Object.preventExtensions(this); + } /* + * Returns the next touched point on the contour. + * + * v ... unit vector to test touch axis. + */ + + HPoint.prototype.nextTouched = function (v) { + var p = this.nextPointOnContour; + while (!v.touched(p) && p !== this) { + p = p.nextPointOnContour; + } + return p; + }; + /* + * Returns the previous touched point on the contour + * + * v ... unit vector to test touch axis. + */ + HPoint.prototype.prevTouched = function (v) { + var p = this.prevPointOnContour; + while (!v.touched(p) && p !== this) { + p = p.prevPointOnContour; + } + return p; + }; + /* + * The zero point. + */ + var HPZero = Object.freeze(new HPoint(0, 0)); + /* + * The default state of the interpreter. + * + * Note: Freezing the defaultState and then deriving from it + * makes the V8 Javascript engine going awkward, + * so this is avoided, albeit the defaultState shouldn't + * ever change. + */ + var defaultState = { + cvCutIn: 17 / 16, + // control value cut in + deltaBase: 9, + deltaShift: 0.125, + loop: 1, + // loops some instructions + minDis: 1, + // minimum distance + autoFlip: true + }; + /* + * The current state of the interpreter. + * + * env ... 'fpgm' or 'prep' or 'glyf' + * prog ... the program + */ + function State(env, prog) { + this.env = env; + this.stack = [ + ]; + this.prog = prog; + switch (env) { + case 'glyf': + this.zp0 = this.zp1 = this.zp2 = 1; + this.rp0 = this.rp1 = this.rp2 = 0; + /* fall through */ + case 'prep': + this.fv = this.pv = this.dpv = xUnitVector; + this.round = roundToGrid; + } + } /* + * Executes a glyph program. + * + * This does the hinting for each glyph. + * + * Returns an array of moved points. + * + * glyph: the glyph to hint + * ppem: the size the glyph is rendered for + */ + + Hinting.prototype.exec = function (glyph, ppem) { + if (typeof ppem !== 'number') { + throw new Error('Point size is not a number!'); + } // Received a fatal error, don't do any hinting anymore. + + if (this._errorState > 2) { + return; + } + var font = this.font; + var prepState = this._prepState; + if (!prepState || prepState.ppem !== ppem) { + var fpgmState = this._fpgmState; + if (!fpgmState) { + // Executes the fpgm state. + // This is used by fonts to define functions. + State.prototype = defaultState; + fpgmState = this._fpgmState = new State('fpgm', font.tables.fpgm); + fpgmState.funcs = [ + ]; + fpgmState.font = font; + if (exports.DEBUG) { + console.log('---EXEC FPGM---'); + fpgmState.step = - 1; + } + try { + exec(fpgmState); + } catch (e) { + console.log('Hinting error in FPGM:' + e); + this._errorState = 3; + return; + } + } // Executes the prep program for this ppem setting. + // This is used by fonts to set cvt values + // depending on to be rendered font size. + + State.prototype = fpgmState; + prepState = this._prepState = new State('prep', font.tables.prep); + prepState.ppem = ppem; + // Creates a copy of the cvt table + // and scales it to the current ppem setting. + var oCvt = font.tables.cvt; + if (oCvt) { + var cvt = prepState.cvt = new Array(oCvt.length); + var scale = ppem / font.unitsPerEm; + for (var c = 0; c < oCvt.length; c++) { + cvt[c] = oCvt[c] * scale; + } + } else { + prepState.cvt = [ + ]; + } + if (exports.DEBUG) { + console.log('---EXEC PREP---'); + prepState.step = - 1; + } + try { + exec(prepState); + } catch (e) { + if (this._errorState < 2) { + console.log('Hinting error in PREP:' + e); + } + this._errorState = 2; + } + } + if (this._errorState > 1) { + return; + } + try { + return execGlyph(glyph, prepState); + } catch (e) { + if (this._errorState < 1) { + console.log('Hinting error:' + e); + console.log('Note: further hinting errors are silenced'); + } + this._errorState = 1; + return undefined; + } + }; + /* + * Executes the hinting program for a glyph. + */ + execGlyph = function (glyph, prepState) { + // original point positions + var xScale = prepState.ppem / prepState.font.unitsPerEm; + var yScale = xScale; + var components = glyph.components; + var contours; + var gZone; + var state; + State.prototype = prepState; + if (!components) { + state = new State('glyf', glyph.instructions); + if (exports.DEBUG) { + console.log('---EXEC GLYPH---'); + state.step = - 1; + } + execComponent(glyph, state, xScale, yScale); + gZone = state.gZone; + } else { + var font = prepState.font; + gZone = [ + ]; + contours = [ + ]; + for (var i = 0; i < components.length; i++) { + var c = components[i]; + var cg = font.glyphs.get(c.glyphIndex); + state = new State('glyf', cg.instructions); + if (exports.DEBUG) { + console.log('---EXEC COMP ' + i + '---'); + state.step = - 1; + } + execComponent(cg, state, xScale, yScale); + // appends the computed points to the result array + // post processes the component points + var dx = Math.round(c.dx * xScale); + var dy = Math.round(c.dy * yScale); + var gz = state.gZone; + var cc = state.contours; + for (var pi = 0; pi < gz.length; pi++) { + var p = gz[pi]; + p.xTouched = p.yTouched = false; + p.xo = p.x = p.x + dx; + p.yo = p.y = p.y + dy; + } + var gLen = gZone.length; + gZone.push.apply(gZone, gz); + for (var j = 0; j < cc.length; j++) { + contours.push(cc[j] + gLen); + } + } + if (glyph.instructions && !state.inhibitGridFit) { + // the composite has instructions on its own + state = new State('glyf', glyph.instructions); + state.gZone = state.z0 = state.z1 = state.z2 = gZone; + state.contours = contours; + // note: HPZero cannot be used here, since + // the point might be modified + gZone.push(new HPoint(0, 0), new HPoint(Math.round(glyph.advanceWidth * xScale), 0)); + if (exports.DEBUG) { + console.log('---EXEC COMPOSITE---'); + state.step = - 1; + } + exec(state); + gZone.length -= 2; + } + } + return gZone; + }; + /* + * Executes the hinting program for a component of a multi-component glyph + * or of the glyph itself for a non-component glyph. + */ + execComponent = function (glyph, state, xScale, yScale) { + var points = glyph.points || [ + ]; + var pLen = points.length; + var gZone = state.gZone = state.z0 = state.z1 = state.z2 = [ + ]; + var contours = state.contours = [ + ]; + // Scales the original points and + // makes copies for the hinted points. + var cp; // current point + for (var i = 0; i < pLen; i++) { + cp = points[i]; + gZone[i] = new HPoint(cp.x * xScale, cp.y * yScale, cp.lastPointOfContour, cp.onCurve); + } // Chain links the contours. + + var sp; // start point + var np; // next point + for (var i$1 = 0; i$1 < pLen; i$1++) { + cp = gZone[i$1]; + if (!sp) { + sp = cp; + contours.push(i$1); + } + if (cp.lastPointOfContour) { + cp.nextPointOnContour = sp; + sp.prevPointOnContour = cp; + sp = undefined; + } else { + np = gZone[i$1 + 1]; + cp.nextPointOnContour = np; + np.prevPointOnContour = cp; + } + } + if (state.inhibitGridFit) { + return; + } + if (exports.DEBUG) { + console.log('PROCESSING GLYPH', state.stack); + for (var i$2 = 0; i$2 < pLen; i$2++) { + console.log(i$2, gZone[i$2].x, gZone[i$2].y); + } + } + gZone.push(new HPoint(0, 0), new HPoint(Math.round(glyph.advanceWidth * xScale), 0)); + exec(state); + // Removes the extra points. + gZone.length -= 2; + if (exports.DEBUG) { + console.log('FINISHED GLYPH', state.stack); + for (var i$3 = 0; i$3 < pLen; i$3++) { + console.log(i$3, gZone[i$3].x, gZone[i$3].y); + } + } + }; + /* + * Executes the program loaded in state. + */ + exec = function (state) { + var prog = state.prog; + if (!prog) { + return; + } + var pLen = prog.length; + var ins; + for (state.ip = 0; state.ip < pLen; state.ip++) { + if (exports.DEBUG) { + state.step++; + } + ins = instructionTable[prog[state.ip]]; + if (!ins) { + throw new Error('unknown instruction: 0x' + Number(prog[state.ip]).toString(16)); + } + ins(state); + // very extensive debugging for each step + /* + if (exports.DEBUG) { + var da; + if (state.gZone) { + da = []; + for (let i = 0; i < state.gZone.length; i++) + { + da.push(i + ' ' + + state.gZone[i].x * 64 + ' ' + + state.gZone[i].y * 64 + ' ' + + (state.gZone[i].xTouched ? 'x' : '') + + (state.gZone[i].yTouched ? 'y' : '') + ); + } + console.log('GZ', da); + } + if (state.tZone) { + da = []; + for (let i = 0; i < state.tZone.length; i++) { + da.push(i + ' ' + + state.tZone[i].x * 64 + ' ' + + state.tZone[i].y * 64 + ' ' + + (state.tZone[i].xTouched ? 'x' : '') + + (state.tZone[i].yTouched ? 'y' : '') + ); + } + console.log('TZ', da); + } + if (state.stack.length > 10) { + console.log( + state.stack.length, + '...', state.stack.slice(state.stack.length - 10) + ); + } else { + console.log(state.stack.length, state.stack); + } + } + */ + } + }; + /* + * Initializes the twilight zone. + * + * This is only done if a SZPx instruction + * refers to the twilight zone. + */ + function initTZone(state) { + var tZone = state.tZone = new Array(state.gZone.length); + // no idea if this is actually correct... + for (var i = 0; i < tZone.length; i++) { + tZone[i] = new HPoint(0, 0); + } + } /* + * Skips the instruction pointer ahead over an IF/ELSE block. + * handleElse .. if true breaks on matching ELSE + */ + + function skip(state, handleElse) { + var prog = state.prog; + var ip = state.ip; + var nesting = 1; + var ins; + do { + ins = prog[++ip]; + if (ins === 88) // IF + { + nesting++; + } else if (ins === 89) // EIF + { + nesting--; + } else if (ins === 64) // NPUSHB + { + ip += prog[ip + 1] + 1; + } else if (ins === 65) // NPUSHW + { + ip += 2 * prog[ip + 1] + 1; + } else if (ins >= 176 && ins <= 183) // PUSHB + { + ip += ins - 176 + 1; + } else if (ins >= 184 && ins <= 191) // PUSHW + { + ip += (ins - 184 + 1) * 2; + } else if (handleElse && nesting === 1 && ins === 27) // ELSE + { + break; + } + } while (nesting > 0); + state.ip = ip; + } /*----------------------------------------------------------* + * And then a lot of instructions... * + *----------------------------------------------------------*/ + // SVTCA[a] Set freedom and projection Vectors To Coordinate Axis + // 0x00-0x01 + + function SVTCA(v, state) { + if (exports.DEBUG) { + console.log(state.step, 'SVTCA[' + v.axis + ']'); + } + state.fv = state.pv = state.dpv = v; + } // SPVTCA[a] Set Projection Vector to Coordinate Axis + // 0x02-0x03 + + function SPVTCA(v, state) { + if (exports.DEBUG) { + console.log(state.step, 'SPVTCA[' + v.axis + ']'); + } + state.pv = state.dpv = v; + } // SFVTCA[a] Set Freedom Vector to Coordinate Axis + // 0x04-0x05 + + function SFVTCA(v, state) { + if (exports.DEBUG) { + console.log(state.step, 'SFVTCA[' + v.axis + ']'); + } + state.fv = v; + } // SPVTL[a] Set Projection Vector To Line + // 0x06-0x07 + + function SPVTL(a, state) { + var stack = state.stack; + var p2i = stack.pop(); + var p1i = stack.pop(); + var p2 = state.z2[p2i]; + var p1 = state.z1[p1i]; + if (exports.DEBUG) { + console.log('SPVTL[' + a + ']', p2i, p1i); + } + var dx; + var dy; + if (!a) { + dx = p1.x - p2.x; + dy = p1.y - p2.y; + } else { + dx = p2.y - p1.y; + dy = p1.x - p2.x; + } + state.pv = state.dpv = getUnitVector(dx, dy); + } // SFVTL[a] Set Freedom Vector To Line + // 0x08-0x09 + + function SFVTL(a, state) { + var stack = state.stack; + var p2i = stack.pop(); + var p1i = stack.pop(); + var p2 = state.z2[p2i]; + var p1 = state.z1[p1i]; + if (exports.DEBUG) { + console.log('SFVTL[' + a + ']', p2i, p1i); + } + var dx; + var dy; + if (!a) { + dx = p1.x - p2.x; + dy = p1.y - p2.y; + } else { + dx = p2.y - p1.y; + dy = p1.x - p2.x; + } + state.fv = getUnitVector(dx, dy); + } // SPVFS[] Set Projection Vector From Stack + // 0x0A + + function SPVFS(state) { + var stack = state.stack; + var y = stack.pop(); + var x = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SPVFS[]', y, x); + } + state.pv = state.dpv = getUnitVector(x, y); + } // SFVFS[] Set Freedom Vector From Stack + // 0x0B + + function SFVFS(state) { + var stack = state.stack; + var y = stack.pop(); + var x = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SPVFS[]', y, x); + } + state.fv = getUnitVector(x, y); + } // GPV[] Get Projection Vector + // 0x0C + + function GPV(state) { + var stack = state.stack; + var pv = state.pv; + if (exports.DEBUG) { + console.log(state.step, 'GPV[]'); + } + stack.push(pv.x * 16384); + stack.push(pv.y * 16384); + } // GFV[] Get Freedom Vector + // 0x0C + + function GFV(state) { + var stack = state.stack; + var fv = state.fv; + if (exports.DEBUG) { + console.log(state.step, 'GFV[]'); + } + stack.push(fv.x * 16384); + stack.push(fv.y * 16384); + } // SFVTPV[] Set Freedom Vector To Projection Vector + // 0x0E + + function SFVTPV(state) { + state.fv = state.pv; + if (exports.DEBUG) { + console.log(state.step, 'SFVTPV[]'); + } + } // ISECT[] moves point p to the InterSECTion of two lines + // 0x0F + + function ISECT(state) { + var stack = state.stack; + var pa0i = stack.pop(); + var pa1i = stack.pop(); + var pb0i = stack.pop(); + var pb1i = stack.pop(); + var pi = stack.pop(); + var z0 = state.z0; + var z1 = state.z1; + var pa0 = z0[pa0i]; + var pa1 = z0[pa1i]; + var pb0 = z1[pb0i]; + var pb1 = z1[pb1i]; + var p = state.z2[pi]; + if (exports.DEBUG) { + console.log('ISECT[], ', pa0i, pa1i, pb0i, pb1i, pi); + } // math from + // en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line + + var x1 = pa0.x; + var y1 = pa0.y; + var x2 = pa1.x; + var y2 = pa1.y; + var x3 = pb0.x; + var y3 = pb0.y; + var x4 = pb1.x; + var y4 = pb1.y; + var div = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); + var f1 = x1 * y2 - y1 * x2; + var f2 = x3 * y4 - y3 * x4; + p.x = (f1 * (x3 - x4) - f2 * (x1 - x2)) / div; + p.y = (f1 * (y3 - y4) - f2 * (y1 - y2)) / div; + } // SRP0[] Set Reference Point 0 + // 0x10 + + function SRP0(state) { + state.rp0 = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SRP0[]', state.rp0); + } + } // SRP1[] Set Reference Point 1 + // 0x11 + + function SRP1(state) { + state.rp1 = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SRP1[]', state.rp1); + } + } // SRP1[] Set Reference Point 2 + // 0x12 + + function SRP2(state) { + state.rp2 = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SRP2[]', state.rp2); + } + } // SZP0[] Set Zone Pointer 0 + // 0x13 + + function SZP0(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SZP0[]', n); + } + state.zp0 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z0 = state.tZone; + break; + case 1: + state.z0 = state.gZone; + break; + default: + throw new Error('Invalid zone pointer'); + } + } // SZP1[] Set Zone Pointer 1 + // 0x14 + + function SZP1(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SZP1[]', n); + } + state.zp1 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z1 = state.tZone; + break; + case 1: + state.z1 = state.gZone; + break; + default: + throw new Error('Invalid zone pointer'); + } + } // SZP2[] Set Zone Pointer 2 + // 0x15 + + function SZP2(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SZP2[]', n); + } + state.zp2 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z2 = state.tZone; + break; + case 1: + state.z2 = state.gZone; + break; + default: + throw new Error('Invalid zone pointer'); + } + } // SZPS[] Set Zone PointerS + // 0x16 + + function SZPS(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SZPS[]', n); + } + state.zp0 = state.zp1 = state.zp2 = n; + switch (n) { + case 0: + if (!state.tZone) { + initTZone(state); + } + state.z0 = state.z1 = state.z2 = state.tZone; + break; + case 1: + state.z0 = state.z1 = state.z2 = state.gZone; + break; + default: + throw new Error('Invalid zone pointer'); + } + } // SLOOP[] Set LOOP variable + // 0x17 + + function SLOOP(state) { + state.loop = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SLOOP[]', state.loop); + } + } // RTG[] Round To Grid + // 0x18 + + function RTG(state) { + if (exports.DEBUG) { + console.log(state.step, 'RTG[]'); + } + state.round = roundToGrid; + } // RTHG[] Round To Half Grid + // 0x19 + + function RTHG(state) { + if (exports.DEBUG) { + console.log(state.step, 'RTHG[]'); + } + state.round = roundToHalfGrid; + } // SMD[] Set Minimum Distance + // 0x1A + + function SMD(state) { + var d = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SMD[]', d); + } + state.minDis = d / 64; + } // ELSE[] ELSE clause + // 0x1B + + function ELSE(state) { + // This instruction has been reached by executing a then branch + // so it just skips ahead until matching EIF. + // + // In case the IF was negative the IF[] instruction already + // skipped forward over the ELSE[] + if (exports.DEBUG) { + console.log(state.step, 'ELSE[]'); + } + skip(state, false); + } // JMPR[] JuMP Relative + // 0x1C + + function JMPR(state) { + var o = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'JMPR[]', o); + } // A jump by 1 would do nothing. + + state.ip += o - 1; + } // SCVTCI[] Set Control Value Table Cut-In + // 0x1D + + function SCVTCI(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SCVTCI[]', n); + } + state.cvCutIn = n / 64; + } // DUP[] DUPlicate top stack element + // 0x20 + + function DUP(state) { + var stack = state.stack; + if (exports.DEBUG) { + console.log(state.step, 'DUP[]'); + } + stack.push(stack[stack.length - 1]); + } // POP[] POP top stack element + // 0x21 + + function POP(state) { + if (exports.DEBUG) { + console.log(state.step, 'POP[]'); + } + state.stack.pop(); + } // CLEAR[] CLEAR the stack + // 0x22 + + function CLEAR(state) { + if (exports.DEBUG) { + console.log(state.step, 'CLEAR[]'); + } + state.stack.length = 0; + } // SWAP[] SWAP the top two elements on the stack + // 0x23 + + function SWAP(state) { + var stack = state.stack; + var a = stack.pop(); + var b = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SWAP[]'); + } + stack.push(a); + stack.push(b); + } // DEPTH[] DEPTH of the stack + // 0x24 + + function DEPTH(state) { + var stack = state.stack; + if (exports.DEBUG) { + console.log(state.step, 'DEPTH[]'); + } + stack.push(stack.length); + } // LOOPCALL[] LOOPCALL function + // 0x2A + + function LOOPCALL(state) { + var stack = state.stack; + var fn = stack.pop(); + var c = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'LOOPCALL[]', fn, c); + } // saves callers program + + var cip = state.ip; + var cprog = state.prog; + state.prog = state.funcs[fn]; + // executes the function + for (var i = 0; i < c; i++) { + exec(state); + if (exports.DEBUG) { + console.log(++state.step, i + 1 < c ? 'next loopcall' : 'done loopcall', i); + } + } // restores the callers program + + state.ip = cip; + state.prog = cprog; + } // CALL[] CALL function + // 0x2B + + function CALL(state) { + var fn = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'CALL[]', fn); + } // saves callers program + + var cip = state.ip; + var cprog = state.prog; + state.prog = state.funcs[fn]; + // executes the function + exec(state); + // restores the callers program + state.ip = cip; + state.prog = cprog; + if (exports.DEBUG) { + console.log(++state.step, 'returning from', fn); + } + } // CINDEX[] Copy the INDEXed element to the top of the stack + // 0x25 + + function CINDEX(state) { + var stack = state.stack; + var k = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'CINDEX[]', k); + } // In case of k == 1, it copies the last element after popping + // thus stack.length - k. + + stack.push(stack[stack.length - k]); + } // MINDEX[] Move the INDEXed element to the top of the stack + // 0x26 + + function MINDEX(state) { + var stack = state.stack; + var k = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'MINDEX[]', k); + } + stack.push(stack.splice(stack.length - k, 1) [0]); + } // FDEF[] Function DEFinition + // 0x2C + + function FDEF(state) { + if (state.env !== 'fpgm') { + throw new Error('FDEF not allowed here'); + } + var stack = state.stack; + var prog = state.prog; + var ip = state.ip; + var fn = stack.pop(); + var ipBegin = ip; + if (exports.DEBUG) { + console.log(state.step, 'FDEF[]', fn); + } + while (prog[++ip] !== 45) { + } + state.ip = ip; + state.funcs[fn] = prog.slice(ipBegin + 1, ip); + } // MDAP[a] Move Direct Absolute Point + // 0x2E-0x2F + + function MDAP(round, state) { + var pi = state.stack.pop(); + var p = state.z0[pi]; + var fv = state.fv; + var pv = state.pv; + if (exports.DEBUG) { + console.log(state.step, 'MDAP[' + round + ']', pi); + } + var d = pv.distance(p, HPZero); + if (round) { + d = state.round(d); + } + fv.setRelative(p, HPZero, d, pv); + fv.touch(p); + state.rp0 = state.rp1 = pi; + } // IUP[a] Interpolate Untouched Points through the outline + // 0x30 + + function IUP(v, state) { + var z2 = state.z2; + var pLen = z2.length - 2; + var cp; + var pp; + var np; + if (exports.DEBUG) { + console.log(state.step, 'IUP[' + v.axis + ']'); + } + for (var i = 0; i < pLen; i++) { + cp = z2[i]; // current point + // if this point has been touched go on + if (v.touched(cp)) { + continue; + } + pp = cp.prevTouched(v); + // no point on the contour has been touched? + if (pp === cp) { + continue; + } + np = cp.nextTouched(v); + if (pp === np) { + // only one point on the contour has been touched + // so simply moves the point like that + v.setRelative(cp, cp, v.distance(pp, pp, false, true), v, true); + } + v.interpolate(cp, pp, np, v); + } + } // SHP[] SHift Point using reference point + // 0x32-0x33 + + function SHP(a, state) { + var stack = state.stack; + var rpi = a ? state.rp1 : state.rp2; + var rp = (a ? state.z0 : state.z1) [rpi]; + var fv = state.fv; + var pv = state.pv; + var loop = state.loop; + var z2 = state.z2; + while (loop--) { + var pi = stack.pop(); + var p = z2[pi]; + var d = pv.distance(rp, rp, false, true); + fv.setRelative(p, p, d, pv); + fv.touch(p); + if (exports.DEBUG) { + console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'SHP[' + (a ? 'rp1' : 'rp2') + ']', pi); + } + } + state.loop = 1; + } // SHC[] SHift Contour using reference point + // 0x36-0x37 + + function SHC(a, state) { + var stack = state.stack; + var rpi = a ? state.rp1 : state.rp2; + var rp = (a ? state.z0 : state.z1) [rpi]; + var fv = state.fv; + var pv = state.pv; + var ci = stack.pop(); + var sp = state.z2[state.contours[ci]]; + var p = sp; + if (exports.DEBUG) { + console.log(state.step, 'SHC[' + a + ']', ci); + } + var d = pv.distance(rp, rp, false, true); + do { + if (p !== rp) { + fv.setRelative(p, p, d, pv); + } + p = p.nextPointOnContour; + } while (p !== sp); + } // SHZ[] SHift Zone using reference point + // 0x36-0x37 + + function SHZ(a, state) { + var stack = state.stack; + var rpi = a ? state.rp1 : state.rp2; + var rp = (a ? state.z0 : state.z1) [rpi]; + var fv = state.fv; + var pv = state.pv; + var e = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SHZ[' + a + ']', e); + } + var z; + switch (e) { + case 0: + z = state.tZone; + break; + case 1: + z = state.gZone; + break; + default: + throw new Error('Invalid zone'); + } + var p; + var d = pv.distance(rp, rp, false, true); + var pLen = z.length - 2; + for (var i = 0; i < pLen; i++) { + p = z[i]; + fv.setRelative(p, p, d, pv); + //if (p !== rp) fv.setRelative(p, p, d, pv); + } + } // SHPIX[] SHift point by a PIXel amount + // 0x38 + + function SHPIX(state) { + var stack = state.stack; + var loop = state.loop; + var fv = state.fv; + var d = stack.pop() / 64; + var z2 = state.z2; + while (loop--) { + var pi = stack.pop(); + var p = z2[pi]; + if (exports.DEBUG) { + console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'SHPIX[]', pi, d); + } + fv.setRelative(p, p, d); + fv.touch(p); + } + state.loop = 1; + } // IP[] Interpolate Point + // 0x39 + + function IP(state) { + var stack = state.stack; + var rp1i = state.rp1; + var rp2i = state.rp2; + var loop = state.loop; + var rp1 = state.z0[rp1i]; + var rp2 = state.z1[rp2i]; + var fv = state.fv; + var pv = state.dpv; + var z2 = state.z2; + while (loop--) { + var pi = stack.pop(); + var p = z2[pi]; + if (exports.DEBUG) { + console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'IP[]', pi, rp1i, '<->', rp2i); + } + fv.interpolate(p, rp1, rp2, pv); + fv.touch(p); + } + state.loop = 1; + } // MSIRP[a] Move Stack Indirect Relative Point + // 0x3A-0x3B + + function MSIRP(a, state) { + var stack = state.stack; + var d = stack.pop() / 64; + var pi = stack.pop(); + var p = state.z1[pi]; + var rp0 = state.z0[state.rp0]; + var fv = state.fv; + var pv = state.pv; + fv.setRelative(p, rp0, d, pv); + fv.touch(p); + if (exports.DEBUG) { + console.log(state.step, 'MSIRP[' + a + ']', d, pi); + } + state.rp1 = state.rp0; + state.rp2 = pi; + if (a) { + state.rp0 = pi; + } + } // ALIGNRP[] Align to reference point. + // 0x3C + + function ALIGNRP(state) { + var stack = state.stack; + var rp0i = state.rp0; + var rp0 = state.z0[rp0i]; + var loop = state.loop; + var fv = state.fv; + var pv = state.pv; + var z1 = state.z1; + while (loop--) { + var pi = stack.pop(); + var p = z1[pi]; + if (exports.DEBUG) { + console.log(state.step, (state.loop > 1 ? 'loop ' + (state.loop - loop) + ': ' : '') + 'ALIGNRP[]', pi); + } + fv.setRelative(p, rp0, 0, pv); + fv.touch(p); + } + state.loop = 1; + } // RTG[] Round To Double Grid + // 0x3D + + function RTDG(state) { + if (exports.DEBUG) { + console.log(state.step, 'RTDG[]'); + } + state.round = roundToDoubleGrid; + } // MIAP[a] Move Indirect Absolute Point + // 0x3E-0x3F + + function MIAP(round, state) { + var stack = state.stack; + var n = stack.pop(); + var pi = stack.pop(); + var p = state.z0[pi]; + var fv = state.fv; + var pv = state.pv; + var cv = state.cvt[n]; + if (exports.DEBUG) { + console.log(state.step, 'MIAP[' + round + ']', n, '(', cv, ')', pi); + } + var d = pv.distance(p, HPZero); + if (round) { + if (Math.abs(d - cv) < state.cvCutIn) { + d = cv; + } + d = state.round(d); + } + fv.setRelative(p, HPZero, d, pv); + if (state.zp0 === 0) { + p.xo = p.x; + p.yo = p.y; + } + fv.touch(p); + state.rp0 = state.rp1 = pi; + } // NPUSB[] PUSH N Bytes + // 0x40 + + function NPUSHB(state) { + var prog = state.prog; + var ip = state.ip; + var stack = state.stack; + var n = prog[++ip]; + if (exports.DEBUG) { + console.log(state.step, 'NPUSHB[]', n); + } + for (var i = 0; i < n; i++) { + stack.push(prog[++ip]); + } + state.ip = ip; + } // NPUSHW[] PUSH N Words + // 0x41 + + function NPUSHW(state) { + var ip = state.ip; + var prog = state.prog; + var stack = state.stack; + var n = prog[++ip]; + if (exports.DEBUG) { + console.log(state.step, 'NPUSHW[]', n); + } + for (var i = 0; i < n; i++) { + var w = prog[++ip] << 8 | prog[++ip]; + if (w & 32768) { + w = - ((w ^ 65535) + 1); + } + stack.push(w); + } + state.ip = ip; + } // WS[] Write Store + // 0x42 + + function WS(state) { + var stack = state.stack; + var store = state.store; + if (!store) { + store = state.store = [ + ]; + } + var v = stack.pop(); + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'WS', v, l); + } + store[l] = v; + } // RS[] Read Store + // 0x43 + + function RS(state) { + var stack = state.stack; + var store = state.store; + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'RS', l); + } + var v = store && store[l] || 0; + stack.push(v); + } // WCVTP[] Write Control Value Table in Pixel units + // 0x44 + + function WCVTP(state) { + var stack = state.stack; + var v = stack.pop(); + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'WCVTP', v, l); + } + state.cvt[l] = v / 64; + } // RCVT[] Read Control Value Table entry + // 0x45 + + function RCVT(state) { + var stack = state.stack; + var cvte = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'RCVT', cvte); + } + stack.push(state.cvt[cvte] * 64); + } // GC[] Get Coordinate projected onto the projection vector + // 0x46-0x47 + + function GC(a, state) { + var stack = state.stack; + var pi = stack.pop(); + var p = state.z2[pi]; + if (exports.DEBUG) { + console.log(state.step, 'GC[' + a + ']', pi); + } + stack.push(state.dpv.distance(p, HPZero, a, false) * 64); + } // MD[a] Measure Distance + // 0x49-0x4A + + function MD(a, state) { + var stack = state.stack; + var pi2 = stack.pop(); + var pi1 = stack.pop(); + var p2 = state.z1[pi2]; + var p1 = state.z0[pi1]; + var d = state.dpv.distance(p1, p2, a, a); + if (exports.DEBUG) { + console.log(state.step, 'MD[' + a + ']', pi2, pi1, '->', d); + } + state.stack.push(Math.round(d * 64)); + } // MPPEM[] Measure Pixels Per EM + // 0x4B + + function MPPEM(state) { + if (exports.DEBUG) { + console.log(state.step, 'MPPEM[]'); + } + state.stack.push(state.ppem); + } // FLIPON[] set the auto FLIP Boolean to ON + // 0x4D + + function FLIPON(state) { + if (exports.DEBUG) { + console.log(state.step, 'FLIPON[]'); + } + state.autoFlip = true; + } // LT[] Less Than + // 0x50 + + function LT(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'LT[]', e2, e1); + } + stack.push(e1 < e2 ? 1 : 0); + } // LTEQ[] Less Than or EQual + // 0x53 + + function LTEQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'LTEQ[]', e2, e1); + } + stack.push(e1 <= e2 ? 1 : 0); + } // GTEQ[] Greater Than + // 0x52 + + function GT(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'GT[]', e2, e1); + } + stack.push(e1 > e2 ? 1 : 0); + } // GTEQ[] Greater Than or EQual + // 0x53 + + function GTEQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'GTEQ[]', e2, e1); + } + stack.push(e1 >= e2 ? 1 : 0); + } // EQ[] EQual + // 0x54 + + function EQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'EQ[]', e2, e1); + } + stack.push(e2 === e1 ? 1 : 0); + } // NEQ[] Not EQual + // 0x55 + + function NEQ(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'NEQ[]', e2, e1); + } + stack.push(e2 !== e1 ? 1 : 0); + } // ODD[] ODD + // 0x56 + + function ODD(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'ODD[]', n); + } + stack.push(Math.trunc(n) % 2 ? 1 : 0); + } // EVEN[] EVEN + // 0x57 + + function EVEN(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'EVEN[]', n); + } + stack.push(Math.trunc(n) % 2 ? 0 : 1); + } // IF[] IF test + // 0x58 + + function IF(state) { + var test = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'IF[]', test); + } // if test is true it just continues + // if not the ip is skipped until matching ELSE or EIF + + if (!test) { + skip(state, true); + if (exports.DEBUG) { + console.log(state.step, 'EIF[]'); + } + } + } // EIF[] End IF + // 0x59 + + function EIF(state) { + // this can be reached normally when + // executing an else branch. + // -> just ignore it + if (exports.DEBUG) { + console.log(state.step, 'EIF[]'); + } + } // AND[] logical AND + // 0x5A + + function AND(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'AND[]', e2, e1); + } + stack.push(e2 && e1 ? 1 : 0); + } // OR[] logical OR + // 0x5B + + function OR(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'OR[]', e2, e1); + } + stack.push(e2 || e1 ? 1 : 0); + } // NOT[] logical NOT + // 0x5C + + function NOT(state) { + var stack = state.stack; + var e = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'NOT[]', e); + } + stack.push(e ? 0 : 1); + } // DELTAP1[] DELTA exception P1 + // DELTAP2[] DELTA exception P2 + // DELTAP3[] DELTA exception P3 + // 0x5D, 0x71, 0x72 + + function DELTAP123(b, state) { + var stack = state.stack; + var n = stack.pop(); + var fv = state.fv; + var pv = state.pv; + var ppem = state.ppem; + var base = state.deltaBase + (b - 1) * 16; + var ds = state.deltaShift; + var z0 = state.z0; + if (exports.DEBUG) { + console.log(state.step, 'DELTAP[' + b + ']', n, stack); + } + for (var i = 0; i < n; i++) { + var pi = stack.pop(); + var arg = stack.pop(); + var appem = base + ((arg & 240) >> 4); + if (appem !== ppem) { + continue; + } + var mag = (arg & 15) - 8; + if (mag >= 0) { + mag++; + } + if (exports.DEBUG) { + console.log(state.step, 'DELTAPFIX', pi, 'by', mag * ds); + } + var p = z0[pi]; + fv.setRelative(p, p, mag * ds, pv); + } + } // SDB[] Set Delta Base in the graphics state + // 0x5E + + function SDB(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SDB[]', n); + } + state.deltaBase = n; + } // SDS[] Set Delta Shift in the graphics state + // 0x5F + + function SDS(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SDS[]', n); + } + state.deltaShift = Math.pow(0.5, n); + } // ADD[] ADD + // 0x60 + + function ADD(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'ADD[]', n2, n1); + } + stack.push(n1 + n2); + } // SUB[] SUB + // 0x61 + + function SUB(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SUB[]', n2, n1); + } + stack.push(n1 - n2); + } // DIV[] DIV + // 0x62 + + function DIV(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'DIV[]', n2, n1); + } + stack.push(n1 * 64 / n2); + } // MUL[] MUL + // 0x63 + + function MUL(state) { + var stack = state.stack; + var n2 = stack.pop(); + var n1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'MUL[]', n2, n1); + } + stack.push(n1 * n2 / 64); + } // ABS[] ABSolute value + // 0x64 + + function ABS(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'ABS[]', n); + } + stack.push(Math.abs(n)); + } // NEG[] NEGate + // 0x65 + + function NEG(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'NEG[]', n); + } + stack.push( - n); + } // FLOOR[] FLOOR + // 0x66 + + function FLOOR(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'FLOOR[]', n); + } + stack.push(Math.floor(n / 64) * 64); + } // CEILING[] CEILING + // 0x67 + + function CEILING(state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'CEILING[]', n); + } + stack.push(Math.ceil(n / 64) * 64); + } // ROUND[ab] ROUND value + // 0x68-0x6B + + function ROUND(dt, state) { + var stack = state.stack; + var n = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'ROUND[]'); + } + stack.push(state.round(n / 64) * 64); + } // WCVTF[] Write Control Value Table in Funits + // 0x70 + + function WCVTF(state) { + var stack = state.stack; + var v = stack.pop(); + var l = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'WCVTF[]', v, l); + } + state.cvt[l] = v * state.ppem / state.font.unitsPerEm; + } // DELTAC1[] DELTA exception C1 + // DELTAC2[] DELTA exception C2 + // DELTAC3[] DELTA exception C3 + // 0x73, 0x74, 0x75 + + function DELTAC123(b, state) { + var stack = state.stack; + var n = stack.pop(); + var ppem = state.ppem; + var base = state.deltaBase + (b - 1) * 16; + var ds = state.deltaShift; + if (exports.DEBUG) { + console.log(state.step, 'DELTAC[' + b + ']', n, stack); + } + for (var i = 0; i < n; i++) { + var c = stack.pop(); + var arg = stack.pop(); + var appem = base + ((arg & 240) >> 4); + if (appem !== ppem) { + continue; + } + var mag = (arg & 15) - 8; + if (mag >= 0) { + mag++; + } + var delta = mag * ds; + if (exports.DEBUG) { + console.log(state.step, 'DELTACFIX', c, 'by', delta); + } + state.cvt[c] += delta; + } + } // SROUND[] Super ROUND + // 0x76 + + function SROUND(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'SROUND[]', n); + } + state.round = roundSuper; + var period; + switch (n & 192) { + case 0: + period = 0.5; + break; + case 64: + period = 1; + break; + case 128: + period = 2; + break; + default: + throw new Error('invalid SROUND value'); + } + state.srPeriod = period; + switch (n & 48) { + case 0: + state.srPhase = 0; + break; + case 16: + state.srPhase = 0.25 * period; + break; + case 32: + state.srPhase = 0.5 * period; + break; + case 48: + state.srPhase = 0.75 * period; + break; + default: + throw new Error('invalid SROUND value'); + } + n &= 15; + if (n === 0) { + state.srThreshold = 0; + } else { + state.srThreshold = (n / 8 - 0.5) * period; + } + } // S45ROUND[] Super ROUND 45 degrees + // 0x77 + + function S45ROUND(state) { + var n = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'S45ROUND[]', n); + } + state.round = roundSuper; + var period; + switch (n & 192) { + case 0: + period = Math.sqrt(2) / 2; + break; + case 64: + period = Math.sqrt(2); + break; + case 128: + period = 2 * Math.sqrt(2); + break; + default: + throw new Error('invalid S45ROUND value'); + } + state.srPeriod = period; + switch (n & 48) { + case 0: + state.srPhase = 0; + break; + case 16: + state.srPhase = 0.25 * period; + break; + case 32: + state.srPhase = 0.5 * period; + break; + case 48: + state.srPhase = 0.75 * period; + break; + default: + throw new Error('invalid S45ROUND value'); + } + n &= 15; + if (n === 0) { + state.srThreshold = 0; + } else { + state.srThreshold = (n / 8 - 0.5) * period; + } + } // ROFF[] Round Off + // 0x7A + + function ROFF(state) { + if (exports.DEBUG) { + console.log(state.step, 'ROFF[]'); + } + state.round = roundOff; + } // RUTG[] Round Up To Grid + // 0x7C + + function RUTG(state) { + if (exports.DEBUG) { + console.log(state.step, 'RUTG[]'); + } + state.round = roundUpToGrid; + } // RDTG[] Round Down To Grid + // 0x7D + + function RDTG(state) { + if (exports.DEBUG) { + console.log(state.step, 'RDTG[]'); + } + state.round = roundDownToGrid; + } // SCANCTRL[] SCAN conversion ConTRoL + // 0x85 + + function SCANCTRL(state) { + var n = state.stack.pop(); + // ignored by opentype.js + if (exports.DEBUG) { + console.log(state.step, 'SCANCTRL[]', n); + } + } // SDPVTL[a] Set Dual Projection Vector To Line + // 0x86-0x87 + + function SDPVTL(a, state) { + var stack = state.stack; + var p2i = stack.pop(); + var p1i = stack.pop(); + var p2 = state.z2[p2i]; + var p1 = state.z1[p1i]; + if (exports.DEBUG) { + console.log(state.step, 'SDPVTL[' + a + ']', p2i, p1i); + } + var dx; + var dy; + if (!a) { + dx = p1.x - p2.x; + dy = p1.y - p2.y; + } else { + dx = p2.y - p1.y; + dy = p1.x - p2.x; + } + state.dpv = getUnitVector(dx, dy); + } // GETINFO[] GET INFOrmation + // 0x88 + + function GETINFO(state) { + var stack = state.stack; + var sel = stack.pop(); + var r = 0; + if (exports.DEBUG) { + console.log(state.step, 'GETINFO[]', sel); + } // v35 as in no subpixel hinting + + if (sel & 1) { + r = 35; + } // TODO rotation and stretch currently not supported + // and thus those GETINFO are always 0. + // opentype.js is always gray scaling + + if (sel & 32) { + r |= 4096; + } + stack.push(r); + } // ROLL[] ROLL the top three stack elements + // 0x8A + + function ROLL(state) { + var stack = state.stack; + var a = stack.pop(); + var b = stack.pop(); + var c = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'ROLL[]'); + } + stack.push(b); + stack.push(a); + stack.push(c); + } // MAX[] MAXimum of top two stack elements + // 0x8B + + function MAX(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'MAX[]', e2, e1); + } + stack.push(Math.max(e1, e2)); + } // MIN[] MINimum of top two stack elements + // 0x8C + + function MIN(state) { + var stack = state.stack; + var e2 = stack.pop(); + var e1 = stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'MIN[]', e2, e1); + } + stack.push(Math.min(e1, e2)); + } // SCANTYPE[] SCANTYPE + // 0x8D + + function SCANTYPE(state) { + var n = state.stack.pop(); + // ignored by opentype.js + if (exports.DEBUG) { + console.log(state.step, 'SCANTYPE[]', n); + } + } // INSTCTRL[] INSTCTRL + // 0x8D + + function INSTCTRL(state) { + var s = state.stack.pop(); + var v = state.stack.pop(); + if (exports.DEBUG) { + console.log(state.step, 'INSTCTRL[]', s, v); + } + switch (s) { + case 1: + state.inhibitGridFit = !!v; + return; + case 2: + state.ignoreCvt = !!v; + return; + default: + throw new Error('invalid INSTCTRL[] selector'); + } + } // PUSHB[abc] PUSH Bytes + // 0xB0-0xB7 + + function PUSHB(n, state) { + var stack = state.stack; + var prog = state.prog; + var ip = state.ip; + if (exports.DEBUG) { + console.log(state.step, 'PUSHB[' + n + ']'); + } + for (var i = 0; i < n; i++) { + stack.push(prog[++ip]); + } + state.ip = ip; + } // PUSHW[abc] PUSH Words + // 0xB8-0xBF + + function PUSHW(n, state) { + var ip = state.ip; + var prog = state.prog; + var stack = state.stack; + if (exports.DEBUG) { + console.log(state.ip, 'PUSHW[' + n + ']'); + } + for (var i = 0; i < n; i++) { + var w = prog[++ip] << 8 | prog[++ip]; + if (w & 32768) { + w = - ((w ^ 65535) + 1); + } + stack.push(w); + } + state.ip = ip; + } // MDRP[abcde] Move Direct Relative Point + // 0xD0-0xEF + // (if indirect is 0) + // + // and + // + // MIRP[abcde] Move Indirect Relative Point + // 0xE0-0xFF + // (if indirect is 1) + + function MDRP_MIRP(indirect, setRp0, keepD, ro, dt, state) { + var stack = state.stack; + var cvte = indirect && stack.pop(); + var pi = stack.pop(); + var rp0i = state.rp0; + var rp = state.z0[rp0i]; + var p = state.z1[pi]; + var md = state.minDis; + var fv = state.fv; + var pv = state.dpv; + var od; // original distance + var d; // moving distance + var sign; // sign of distance + var cv; + d = od = pv.distance(p, rp, true, true); + sign = d >= 0 ? 1 : - 1; // Math.sign would be 0 in case of 0 + // TODO consider autoFlip + d = Math.abs(d); + if (indirect) { + cv = state.cvt[cvte]; + if (ro && Math.abs(d - cv) < state.cvCutIn) { + d = cv; + } + } + if (keepD && d < md) { + d = md; + } + if (ro) { + d = state.round(d); + } + fv.setRelative(p, rp, sign * d, pv); + fv.touch(p); + if (exports.DEBUG) { + console.log(state.step, (indirect ? 'MIRP[' : 'MDRP[') + (setRp0 ? 'M' : 'm') + (keepD ? '>' : '_') + (ro ? 'R' : '_') + (dt === 0 ? 'Gr' : dt === 1 ? 'Bl' : dt === 2 ? 'Wh' : '') + ']', indirect ? cvte + '(' + state.cvt[cvte] + ',' + cv + ')' : '', pi, '(d =', od, '->', sign * d, ')'); + } + state.rp1 = state.rp0; + state.rp2 = pi; + if (setRp0) { + state.rp0 = pi; + } + } /* + * The instruction table. + */ + + instructionTable = [ /* 0x00 */ SVTCA.bind(undefined, yUnitVector), /* 0x01 */ SVTCA.bind(undefined, xUnitVector), /* 0x02 */ SPVTCA.bind(undefined, yUnitVector), /* 0x03 */ SPVTCA.bind(undefined, xUnitVector), /* 0x04 */ SFVTCA.bind(undefined, yUnitVector), /* 0x05 */ SFVTCA.bind(undefined, xUnitVector), /* 0x06 */ SPVTL.bind(undefined, 0), /* 0x07 */ SPVTL.bind(undefined, 1), /* 0x08 */ SFVTL.bind(undefined, 0), /* 0x09 */ SFVTL.bind(undefined, 1), /* 0x0A */ SPVFS, /* 0x0B */ SFVFS, /* 0x0C */ GPV, /* 0x0D */ GFV, /* 0x0E */ SFVTPV, /* 0x0F */ ISECT, /* 0x10 */ SRP0, /* 0x11 */ SRP1, /* 0x12 */ SRP2, /* 0x13 */ SZP0, /* 0x14 */ SZP1, /* 0x15 */ SZP2, /* 0x16 */ SZPS, /* 0x17 */ SLOOP, /* 0x18 */ RTG, /* 0x19 */ RTHG, /* 0x1A */ SMD, /* 0x1B */ ELSE, /* 0x1C */ JMPR, /* 0x1D */ SCVTCI, /* 0x1E */ undefined, + // TODO SSWCI + /* 0x1F */ + undefined, + // TODO SSW + /* 0x20 */ + DUP, /* 0x21 */ POP, /* 0x22 */ CLEAR, /* 0x23 */ SWAP, /* 0x24 */ DEPTH, /* 0x25 */ CINDEX, /* 0x26 */ MINDEX, /* 0x27 */ undefined, + // TODO ALIGNPTS + /* 0x28 */ + undefined, /* 0x29 */ undefined, + // TODO UTP + /* 0x2A */ + LOOPCALL, /* 0x2B */ CALL, /* 0x2C */ FDEF, /* 0x2D */ undefined, + // ENDF (eaten by FDEF) + /* 0x2E */ + MDAP.bind(undefined, 0), /* 0x2F */ MDAP.bind(undefined, 1), /* 0x30 */ IUP.bind(undefined, yUnitVector), /* 0x31 */ IUP.bind(undefined, xUnitVector), /* 0x32 */ SHP.bind(undefined, 0), /* 0x33 */ SHP.bind(undefined, 1), /* 0x34 */ SHC.bind(undefined, 0), /* 0x35 */ SHC.bind(undefined, 1), /* 0x36 */ SHZ.bind(undefined, 0), /* 0x37 */ SHZ.bind(undefined, 1), /* 0x38 */ SHPIX, /* 0x39 */ IP, /* 0x3A */ MSIRP.bind(undefined, 0), /* 0x3B */ MSIRP.bind(undefined, 1), /* 0x3C */ ALIGNRP, /* 0x3D */ RTDG, /* 0x3E */ MIAP.bind(undefined, 0), /* 0x3F */ MIAP.bind(undefined, 1), /* 0x40 */ NPUSHB, /* 0x41 */ NPUSHW, /* 0x42 */ WS, /* 0x43 */ RS, /* 0x44 */ WCVTP, /* 0x45 */ RCVT, /* 0x46 */ GC.bind(undefined, 0), /* 0x47 */ GC.bind(undefined, 1), /* 0x48 */ undefined, + // TODO SCFS + /* 0x49 */ + MD.bind(undefined, 0), /* 0x4A */ MD.bind(undefined, 1), /* 0x4B */ MPPEM, /* 0x4C */ undefined, + // TODO MPS + /* 0x4D */ + FLIPON, /* 0x4E */ undefined, + // TODO FLIPOFF + /* 0x4F */ + undefined, + // TODO DEBUG + /* 0x50 */ + LT, /* 0x51 */ LTEQ, /* 0x52 */ GT, /* 0x53 */ GTEQ, /* 0x54 */ EQ, /* 0x55 */ NEQ, /* 0x56 */ ODD, /* 0x57 */ EVEN, /* 0x58 */ IF, /* 0x59 */ EIF, /* 0x5A */ AND, /* 0x5B */ OR, /* 0x5C */ NOT, /* 0x5D */ DELTAP123.bind(undefined, 1), /* 0x5E */ SDB, /* 0x5F */ SDS, /* 0x60 */ ADD, /* 0x61 */ SUB, /* 0x62 */ DIV, /* 0x63 */ MUL, /* 0x64 */ ABS, /* 0x65 */ NEG, /* 0x66 */ FLOOR, /* 0x67 */ CEILING, /* 0x68 */ ROUND.bind(undefined, 0), /* 0x69 */ ROUND.bind(undefined, 1), /* 0x6A */ ROUND.bind(undefined, 2), /* 0x6B */ ROUND.bind(undefined, 3), /* 0x6C */ undefined, + // TODO NROUND[ab] + /* 0x6D */ + undefined, + // TODO NROUND[ab] + /* 0x6E */ + undefined, + // TODO NROUND[ab] + /* 0x6F */ + undefined, + // TODO NROUND[ab] + /* 0x70 */ + WCVTF, /* 0x71 */ DELTAP123.bind(undefined, 2), /* 0x72 */ DELTAP123.bind(undefined, 3), /* 0x73 */ DELTAC123.bind(undefined, 1), /* 0x74 */ DELTAC123.bind(undefined, 2), /* 0x75 */ DELTAC123.bind(undefined, 3), /* 0x76 */ SROUND, /* 0x77 */ S45ROUND, /* 0x78 */ undefined, + // TODO JROT[] + /* 0x79 */ + undefined, + // TODO JROF[] + /* 0x7A */ + ROFF, /* 0x7B */ undefined, /* 0x7C */ RUTG, /* 0x7D */ RDTG, /* 0x7E */ POP, + // actually SANGW, supposed to do only a pop though + /* 0x7F */ + POP, + // actually AA, supposed to do only a pop though + /* 0x80 */ + undefined, + // TODO FLIPPT + /* 0x81 */ + undefined, + // TODO FLIPRGON + /* 0x82 */ + undefined, + // TODO FLIPRGOFF + /* 0x83 */ + undefined, /* 0x84 */ undefined, /* 0x85 */ SCANCTRL, /* 0x86 */ SDPVTL.bind(undefined, 0), /* 0x87 */ SDPVTL.bind(undefined, 1), /* 0x88 */ GETINFO, /* 0x89 */ undefined, + // TODO IDEF + /* 0x8A */ + ROLL, /* 0x8B */ MAX, /* 0x8C */ MIN, /* 0x8D */ SCANTYPE, /* 0x8E */ INSTCTRL, /* 0x8F */ undefined, /* 0x90 */ undefined, /* 0x91 */ undefined, /* 0x92 */ undefined, /* 0x93 */ undefined, /* 0x94 */ undefined, /* 0x95 */ undefined, /* 0x96 */ undefined, /* 0x97 */ undefined, /* 0x98 */ undefined, /* 0x99 */ undefined, /* 0x9A */ undefined, /* 0x9B */ undefined, /* 0x9C */ undefined, /* 0x9D */ undefined, /* 0x9E */ undefined, /* 0x9F */ undefined, /* 0xA0 */ undefined, /* 0xA1 */ undefined, /* 0xA2 */ undefined, /* 0xA3 */ undefined, /* 0xA4 */ undefined, /* 0xA5 */ undefined, /* 0xA6 */ undefined, /* 0xA7 */ undefined, /* 0xA8 */ undefined, /* 0xA9 */ undefined, /* 0xAA */ undefined, /* 0xAB */ undefined, /* 0xAC */ undefined, /* 0xAD */ undefined, /* 0xAE */ undefined, /* 0xAF */ undefined, /* 0xB0 */ PUSHB.bind(undefined, 1), /* 0xB1 */ PUSHB.bind(undefined, 2), /* 0xB2 */ PUSHB.bind(undefined, 3), /* 0xB3 */ PUSHB.bind(undefined, 4), /* 0xB4 */ PUSHB.bind(undefined, 5), /* 0xB5 */ PUSHB.bind(undefined, 6), /* 0xB6 */ PUSHB.bind(undefined, 7), /* 0xB7 */ PUSHB.bind(undefined, 8), /* 0xB8 */ PUSHW.bind(undefined, 1), /* 0xB9 */ PUSHW.bind(undefined, 2), /* 0xBA */ PUSHW.bind(undefined, 3), /* 0xBB */ PUSHW.bind(undefined, 4), /* 0xBC */ PUSHW.bind(undefined, 5), /* 0xBD */ PUSHW.bind(undefined, 6), /* 0xBE */ PUSHW.bind(undefined, 7), /* 0xBF */ PUSHW.bind(undefined, 8), /* 0xC0 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 0), /* 0xC1 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 1), /* 0xC2 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 2), /* 0xC3 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 3), /* 0xC4 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 0), /* 0xC5 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 1), /* 0xC6 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 2), /* 0xC7 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 3), /* 0xC8 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 0), /* 0xC9 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 1), /* 0xCA */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 2), /* 0xCB */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 3), /* 0xCC */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 0), /* 0xCD */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 1), /* 0xCE */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 2), /* 0xCF */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 3), /* 0xD0 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 0), /* 0xD1 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 1), /* 0xD2 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 2), /* 0xD3 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 3), /* 0xD4 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 0), /* 0xD5 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 1), /* 0xD6 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 2), /* 0xD7 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 3), /* 0xD8 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 0), /* 0xD9 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 1), /* 0xDA */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 2), /* 0xDB */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 3), /* 0xDC */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 0), /* 0xDD */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 1), /* 0xDE */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 2), /* 0xDF */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 3), /* 0xE0 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 0), /* 0xE1 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 1), /* 0xE2 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 2), /* 0xE3 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 3), /* 0xE4 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 0), /* 0xE5 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 1), /* 0xE6 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 2), /* 0xE7 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 3), /* 0xE8 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 0), /* 0xE9 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 1), /* 0xEA */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 2), /* 0xEB */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 3), /* 0xEC */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 0), /* 0xED */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 1), /* 0xEE */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 2), /* 0xEF */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 3), /* 0xF0 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 0), /* 0xF1 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 1), /* 0xF2 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 2), /* 0xF3 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 3), /* 0xF4 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 0), /* 0xF5 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 1), /* 0xF6 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 2), /* 0xF7 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 3), /* 0xF8 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 0), /* 0xF9 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 1), /* 0xFA */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 2), /* 0xFB */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 3), /* 0xFC */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 0), /* 0xFD */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 1), /* 0xFE */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 2), /* 0xFF */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 3) + ]; + /***************************** + Mathematical Considerations + ****************************** + fv ... refers to freedom vector + pv ... refers to projection vector + rp ... refers to reference point + p ... refers to to point being operated on + d ... refers to distance + SETRELATIVE: + ============ + case freedom vector == x-axis: + ------------------------------ + (pv) + .-' + rpd .-' + .-* + d .-'90°' + .-' ' + .-' ' + *-' ' b + rp ' + ' + ' + p *----------*-------------- (fv) + pm + rpdx = rpx + d * pv.x + rpdy = rpy + d * pv.y + equation of line b + y - rpdy = pvns * (x- rpdx) + y = p.y + x = rpdx + ( p.y - rpdy ) / pvns + + case freedom vector == y-axis: + ------------------------------ + * pm + |\ + | \ + | \ + | \ + | \ + | \ + | \ + | \ + | \ + | \ b + | \ + | \ + | \ .-' (pv) + | 90° \.-' + | .-'* rpd + | .-' + * *-' d + p rp + rpdx = rpx + d * pv.x + rpdy = rpy + d * pv.y + equation of line b: + pvns ... normal slope to pv + y - rpdy = pvns * (x - rpdx) + x = p.x + y = rpdy + pvns * (p.x - rpdx) + + generic case: + ------------- + + .'(fv) + .' + .* pm + .' ! + .' . + .' ! + .' . b + .' ! + * . + p ! + 90° . ... (pv) + ...-*-''' + ...---''' rpd + ...---''' d + *--''' + rp + rpdx = rpx + d * pv.x + rpdy = rpy + d * pv.y + equation of line b: + pvns... normal slope to pv + y - rpdy = pvns * (x - rpdx) + equation of freedom vector line: + fvs ... slope of freedom vector (=fy/fx) + y - py = fvs * (x - px) + + on pm both equations are true for same x/y + y - rpdy = pvns * (x - rpdx) + y - py = fvs * (x - px) + form to y and set equal: + pvns * (x - rpdx) + rpdy = fvs * (x - px) + py + expand: + pvns * x - pvns * rpdx + rpdy = fvs * x - fvs * px + py + switch: + fvs * x - fvs * px + py = pvns * x - pvns * rpdx + rpdy + solve for x: + fvs * x - pvns * x = fvs * px - pvns * rpdx - py + rpdy + + fvs * px - pvns * rpdx + rpdy - py + x = ----------------------------------- + fvs - pvns + and: + y = fvs * (x - px) + py + + INTERPOLATE: + ============ + Examples of point interpolation. + The weight of the movement of the reference point gets bigger + the further the other reference point is away, thus the safest + option (that is avoiding 0/0 divisions) is to weight the + original distance of the other point by the sum of both distances. + If the sum of both distances is 0, then move the point by the + arithmetic average of the movement of both reference points. - ```javascript - let promise = new Promise(function(resolve, reject){ - resolve(1); - }); - promise.then(function(value){ - // value === 1 - }); - ``` + (+6) + rp1o *---->*rp1 + . . (+12) + . . rp2o *---------->* rp2 + . . . . + . . . . + . 10 20 . . + |.........|...................| . + . . . + . . (+8) . + po *------>*p . + . . . + . 12 . 24 . + |...........|.......................| + 36 - Instead of writing the above, your code now simply becomes the following: + ------- - ```javascript - let promise = Promise.resolve(1); + (+10) + rp1o *-------->*rp1 + . . (-10) + . . rp2 *<---------* rpo2 + . . . . + . . . . + . 10 . 30 . . + |.........|.............................| + . . + . (+5) . + po *--->* p . + . . . + . . 20 . + |....|..............| + 5 15 - promise.then(function(value){ - // value === 1 - }); - ``` + ------- - @method resolve - @static - @param {Any} value value that the returned promise will be resolved with - Useful for tooling. - @return {Promise} a promise that will become fulfilled with the given - `value` + (+10) + rp1o *-------->*rp1 + . . + . . + rp2o *-------->*rp2 + + (+10) + po *-------->* p + ------- + + (+10) + rp1o *-------->*rp1 + . . + . .(+30) + rp2o *---------------------------->*rp2 + + (+25) + po *----------------------->* p + + vim: set ts=4 sw=4 expandtab: + *****/ + // The Font object + // This code is based on Array.from implementation for strings in https://github.com/mathiasbynens/Array.from + var arrayFromString = Array.from || function (s) { + return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g) || [ + ]; + }; + /** + * @typedef FontOptions + * @type Object + * @property {Boolean} empty - whether to create a new empty font + * @property {string} familyName + * @property {string} styleName + * @property {string=} fullName + * @property {string=} postScriptName + * @property {string=} designer + * @property {string=} designerURL + * @property {string=} manufacturer + * @property {string=} manufacturerURL + * @property {string=} license + * @property {string=} licenseURL + * @property {string=} version + * @property {string=} description + * @property {string=} copyright + * @property {string=} trademark + * @property {Number} unitsPerEm + * @property {Number} ascender + * @property {Number} descender + * @property {Number} createdTimestamp + * @property {string=} weightClass + * @property {string=} widthClass + * @property {string=} fsSelection + */ + /** + * A Font represents a loaded OpenType font file. + * It contains a set of glyphs and methods to draw text on a drawing context, + * or to get a path representing the text. + * @exports opentype.Font + * @class + * @param {FontOptions} + * @constructor + */ + function Font(options) { + options = options || { + }; + if (!options.empty) { + // Check that we've provided the minimum set of names. + checkArgument(options.familyName, 'When creating a new Font object, familyName is required.'); + checkArgument(options.styleName, 'When creating a new Font object, styleName is required.'); + checkArgument(options.unitsPerEm, 'When creating a new Font object, unitsPerEm is required.'); + checkArgument(options.ascender, 'When creating a new Font object, ascender is required.'); + checkArgument(options.descender, 'When creating a new Font object, descender is required.'); + checkArgument(options.descender < 0, 'Descender should be negative (e.g. -512).'); + // OS X will complain if the names are empty, so we put a single space everywhere by default. + this.names = { + fontFamily: { + en: options.familyName || ' ' + }, + fontSubfamily: { + en: options.styleName || ' ' + }, + fullName: { + en: options.fullName || options.familyName + ' ' + options.styleName + }, + // postScriptName may not contain any whitespace + postScriptName: { + en: options.postScriptName || (options.familyName + options.styleName).replace(/\s/g, '') + }, + designer: { + en: options.designer || ' ' + }, + designerURL: { + en: options.designerURL || ' ' + }, + manufacturer: { + en: options.manufacturer || ' ' + }, + manufacturerURL: { + en: options.manufacturerURL || ' ' + }, + license: { + en: options.license || ' ' + }, + licenseURL: { + en: options.licenseURL || ' ' + }, + version: { + en: options.version || 'Version 0.1' + }, + description: { + en: options.description || ' ' + }, + copyright: { + en: options.copyright || ' ' + }, + trademark: { + en: options.trademark || ' ' + } + }; + this.unitsPerEm = options.unitsPerEm || 1000; + this.ascender = options.ascender; + this.descender = options.descender; + this.createdTimestamp = options.createdTimestamp; + this.tables = { + os2: { + usWeightClass: options.weightClass || this.usWeightClasses.MEDIUM, + usWidthClass: options.widthClass || this.usWidthClasses.MEDIUM, + fsSelection: options.fsSelection || this.fsSelectionValues.REGULAR + } + }; + } + this.supported = true; // Deprecated: parseBuffer will throw an error if font is not supported. + this.glyphs = new glyphset.GlyphSet(this, options.glyphs || [ + ]); + this.encoding = new DefaultEncoding(this); + this.position = new Position(this); + this.substitution = new Substitution(this); + this.tables = this.tables || { + }; + Object.defineProperty(this, 'hinting', { + get: function () { + if (this._hinting) { + return this._hinting; + } + if (this.outlinesFormat === 'truetype') { + return this._hinting = new Hinting(this); + } + } + }); + } /** + * Check if the font has a glyph for the given character. + * @param {string} + * @return {Boolean} + */ + + Font.prototype.hasChar = function (c) { + return this.encoding.charToGlyphIndex(c) !== null; + }; + /** + * Convert the given character to a single glyph index. + * Note that this function assumes that there is a one-to-one mapping between + * the given character and a glyph; for complex scripts this might not be the case. + * @param {string} + * @return {Number} + */ + Font.prototype.charToGlyphIndex = function (s) { + return this.encoding.charToGlyphIndex(s); + }; + /** + * Convert the given character to a single Glyph object. + * Note that this function assumes that there is a one-to-one mapping between + * the given character and a glyph; for complex scripts this might not be the case. + * @param {string} + * @return {opentype.Glyph} + */ + Font.prototype.charToGlyph = function (c) { + var glyphIndex = this.charToGlyphIndex(c); + var glyph = this.glyphs.get(glyphIndex); + if (!glyph) { + // .notdef + glyph = this.glyphs.get(0); + } + return glyph; + }; + /** + * Convert the given text to a list of Glyph objects. + * Note that there is no strict one-to-one mapping between characters and + * glyphs, so the list of returned glyphs can be larger or smaller than the + * length of the given string. + * @param {string} + * @param {GlyphRenderOptions} [options] + * @return {opentype.Glyph[]} + */ + Font.prototype.stringToGlyphs = function (s, options) { + var this$1 = this; + options = options || this.defaultRenderOptions; + // Get glyph indexes + var chars = arrayFromString(s); + var indexes = [ + ]; + for (var i = 0; i < chars.length; i += 1) { + var c = chars[i]; + indexes.push(this$1.charToGlyphIndex(c)); + } + var length = indexes.length; + // Apply substitutions on glyph indexes + if (options.features) { + var script = options.script || this.substitution.getDefaultScriptName(); + var manyToOne = [ + ]; + if (options.features.liga) { + manyToOne = manyToOne.concat(this.substitution.getFeature('liga', script, options.language)); + } + if (options.features.rlig) { + manyToOne = manyToOne.concat(this.substitution.getFeature('rlig', script, options.language)); + } + for (var i$1 = 0; i$1 < length; i$1 += 1) { + for (var j = 0; j < manyToOne.length; j++) { + var ligature = manyToOne[j]; + var components = ligature.sub; + var compCount = components.length; + var k = 0; + while (k < compCount && components[k] === indexes[i$1 + k]) { + k++; + } + if (k === compCount) { + indexes.splice(i$1, compCount, ligature.by); + length = length - compCount + 1; + } + } + } + } // convert glyph indexes to glyph objects + + var glyphs = new Array(length); + var notdef = this.glyphs.get(0); + for (var i$2 = 0; i$2 < length; i$2 += 1) { + glyphs[i$2] = this$1.glyphs.get(indexes[i$2]) || notdef; + } + return glyphs; + }; + /** + * @param {string} + * @return {Number} + */ + Font.prototype.nameToGlyphIndex = function (name) { + return this.glyphNames.nameToGlyphIndex(name); + }; + /** + * @param {string} + * @return {opentype.Glyph} + */ + Font.prototype.nameToGlyph = function (name) { + var glyphIndex = this.nameToGlyphIndex(name); + var glyph = this.glyphs.get(glyphIndex); + if (!glyph) { + // .notdef + glyph = this.glyphs.get(0); + } + return glyph; + }; + /** + * @param {Number} + * @return {String} + */ + Font.prototype.glyphIndexToName = function (gid) { + if (!this.glyphNames.glyphIndexToName) { + return ''; + } + return this.glyphNames.glyphIndexToName(gid); + }; + /** + * Retrieve the value of the kerning pair between the left glyph (or its index) + * and the right glyph (or its index). If no kerning pair is found, return 0. + * The kerning value gets added to the advance width when calculating the spacing + * between glyphs. + * For GPOS kerning, this method uses the default script and language, which covers + * most use cases. To have greater control, use font.position.getKerningValue . + * @param {opentype.Glyph} leftGlyph + * @param {opentype.Glyph} rightGlyph + * @return {Number} + */ + Font.prototype.getKerningValue = function (leftGlyph, rightGlyph) { + leftGlyph = leftGlyph.index || leftGlyph; + rightGlyph = rightGlyph.index || rightGlyph; + var gposKerning = this.position.defaultKerningTables; + if (gposKerning) { + return this.position.getKerningValue(gposKerning, leftGlyph, rightGlyph); + } // "kern" table + + return this.kerningPairs[leftGlyph + ',' + rightGlyph] || 0; + }; + /** + * @typedef GlyphRenderOptions + * @type Object + * @property {string} [script] - script used to determine which features to apply. By default, 'DFLT' or 'latn' is used. + * See https://www.microsoft.com/typography/otspec/scripttags.htm + * @property {string} [language='dflt'] - language system used to determine which features to apply. + * See https://www.microsoft.com/typography/developers/opentype/languagetags.aspx + * @property {boolean} [kerning=true] - whether to include kerning values + * @property {object} [features] - OpenType Layout feature tags. Used to enable or disable the features of the given script/language system. + * See https://www.microsoft.com/typography/otspec/featuretags.htm + */ + Font.prototype.defaultRenderOptions = { + kerning: true, + features: { + liga: true, + rlig: true + } + }; + /** + * Helper function that invokes the given callback for each glyph in the given text. + * The callback gets `(glyph, x, y, fontSize, options)`.* @param {string} text + * @param {string} text - The text to apply. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @param {Function} callback + */ + Font.prototype.forEachGlyph = function (text, x, y, fontSize, options, callback) { + var this$1 = this; + x = x !== undefined ? x : 0; + y = y !== undefined ? y : 0; + fontSize = fontSize !== undefined ? fontSize : 72; + options = options || this.defaultRenderOptions; + var fontScale = 1 / this.unitsPerEm * fontSize; + var glyphs = this.stringToGlyphs(text, options); + var kerningLookups; + if (options.kerning) { + var script = options.script || this.position.getDefaultScriptName(); + kerningLookups = this.position.getKerningTables(script, options.language); + } + for (var i = 0; i < glyphs.length; i += 1) { + var glyph = glyphs[i]; + callback.call(this$1, glyph, x, y, fontSize, options); + if (glyph.advanceWidth) { + x += glyph.advanceWidth * fontScale; + } + if (options.kerning && i < glyphs.length - 1) { + // We should apply position adjustment lookups in a more generic way. + // Here we only use the xAdvance value. + var kerningValue = kerningLookups ? this$1.position.getKerningValue(kerningLookups, glyph.index, glyphs[i + 1].index) : this$1.getKerningValue(glyph, glyphs[i + 1]); + x += kerningValue * fontScale; + } + if (options.letterSpacing) { + x += options.letterSpacing * fontSize; + } else if (options.tracking) { + x += options.tracking / 1000 * fontSize; + } + } + return x; + }; + /** + * Create a Path object that represents the given text. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @return {opentype.Path} + */ + Font.prototype.getPath = function (text, x, y, fontSize, options) { + var fullPath = new Path(); + this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { + var glyphPath = glyph.getPath(gX, gY, gFontSize, options, this); + fullPath.extend(glyphPath); + }); + return fullPath; + }; + /** + * Create an array of Path objects that represent the glyphs of a given text. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @return {opentype.Path[]} + */ + Font.prototype.getPaths = function (text, x, y, fontSize, options) { + var glyphPaths = [ + ]; + this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { + var glyphPath = glyph.getPath(gX, gY, gFontSize, options, this); + glyphPaths.push(glyphPath); + }); + return glyphPaths; + }; + /** + * Returns the advance width of a text. + * + * This is something different than Path.getBoundingBox() as for example a + * suffixed whitespace increases the advanceWidth but not the bounding box + * or an overhanging letter like a calligraphic 'f' might have a quite larger + * bounding box than its advance width. + * + * This corresponds to canvas2dContext.measureText(text).width + * + * @param {string} text - The text to create. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + * @return advance width + */ + Font.prototype.getAdvanceWidth = function (text, fontSize, options) { + return this.forEachGlyph(text, 0, 0, fontSize, options, function () { + }); + }; + /** + * Draw the text on the given drawing context. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + */ + Font.prototype.draw = function (ctx, text, x, y, fontSize, options) { + this.getPath(text, x, y, fontSize, options).draw(ctx); + }; + /** + * Draw the points of all glyphs in the text. + * On-curve points will be drawn in blue, off-curve points will be drawn in red. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + */ + Font.prototype.drawPoints = function (ctx, text, x, y, fontSize, options) { + this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { + glyph.drawPoints(ctx, gX, gY, gFontSize); + }); + }; + /** + * Draw lines indicating important font measurements for all glyphs in the text. + * Black lines indicate the origin of the coordinate system (point 0,0). + * Blue lines indicate the glyph bounding box. + * Green line indicates the advance width of the glyph. + * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. + * @param {string} text - The text to create. + * @param {number} [x=0] - Horizontal position of the beginning of the text. + * @param {number} [y=0] - Vertical position of the *baseline* of the text. + * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. + * @param {GlyphRenderOptions=} options + */ + Font.prototype.drawMetrics = function (ctx, text, x, y, fontSize, options) { + this.forEachGlyph(text, x, y, fontSize, options, function (glyph, gX, gY, gFontSize) { + glyph.drawMetrics(ctx, gX, gY, gFontSize); + }); + }; + /** + * @param {string} + * @return {string} + */ + Font.prototype.getEnglishName = function (name) { + var translations = this.names[name]; + if (translations) { + return translations.en; + } + }; + /** + * Validate + */ + Font.prototype.validate = function () { + var _this = this; + function assert(predicate, message) { + } + function assertNamePresent(name) { + var englishName = _this.getEnglishName(name); + assert(englishName && englishName.trim().length > 0, 'No English ' + name + ' specified.'); + } // Identification information + + assertNamePresent('fontFamily'); + assertNamePresent('weightName'); + assertNamePresent('manufacturer'); + assertNamePresent('copyright'); + assertNamePresent('version'); + // Dimension information + assert(this.unitsPerEm > 0, 'No unitsPerEm specified.'); + }; + /** + * Convert the font object to a SFNT data structure. + * This structure contains all the necessary tables and metadata to create a binary OTF file. + * @return {opentype.Table} + */ + Font.prototype.toTables = function () { + return sfnt.fontToTable(this); + }; + /** + * @deprecated Font.toBuffer is deprecated. Use Font.toArrayBuffer instead. + */ + Font.prototype.toBuffer = function () { + console.warn('Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.'); + return this.toArrayBuffer(); + }; + /** + * Converts a `opentype.Font` into an `ArrayBuffer` + * @return {ArrayBuffer} + */ + Font.prototype.toArrayBuffer = function () { + var sfntTable = this.toTables(); + var bytes = sfntTable.encode(); + var buffer = new ArrayBuffer(bytes.length); + var intArray = new Uint8Array(buffer); + for (var i = 0; i < bytes.length; i++) { + intArray[i] = bytes[i]; + } + return buffer; + }; + /** + * Initiate a download of the OpenType font. + */ + Font.prototype.download = function (fileName) { + var familyName = this.getEnglishName('fontFamily'); + var styleName = this.getEnglishName('fontSubfamily'); + fileName = fileName || familyName.replace(/\s/g, '') + '-' + styleName + '.otf'; + var arrayBuffer = this.toArrayBuffer(); + if (isBrowser()) { + window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; + window.requestFileSystem(window.TEMPORARY, arrayBuffer.byteLength, function (fs) { + fs.root.getFile(fileName, { + create: true + }, function (fileEntry) { + fileEntry.createWriter(function (writer) { + var dataView = new DataView(arrayBuffer); + var blob = new Blob([dataView], { + type: 'font/opentype' + }); + writer.write(blob); + writer.addEventListener('writeend', function () { + // Navigating to the file will download it. + location.href = fileEntry.toURL(); + }, false); + }); + }); + }, function (err) { + throw new Error(err.name + ': ' + err.message); + }); + } else { + var fs = _dereq_('fs'); + var buffer = arrayBufferToNodeBuffer(arrayBuffer); + fs.writeFileSync(fileName, buffer); + } + }; + /** + * @private + */ + Font.prototype.fsSelectionValues = { + ITALIC: 1, + //1 + UNDERSCORE: 2, + //2 + NEGATIVE: 4, + //4 + OUTLINED: 8, + //8 + STRIKEOUT: 16, + //16 + BOLD: 32, + //32 + REGULAR: 64, + //64 + USER_TYPO_METRICS: 128, + //128 + WWS: 256, + //256 + OBLIQUE: 512 //512 + }; + /** + * @private + */ + Font.prototype.usWidthClasses = { + ULTRA_CONDENSED: 1, + EXTRA_CONDENSED: 2, + CONDENSED: 3, + SEMI_CONDENSED: 4, + MEDIUM: 5, + SEMI_EXPANDED: 6, + EXPANDED: 7, + EXTRA_EXPANDED: 8, + ULTRA_EXPANDED: 9 + }; + /** + * @private + */ + Font.prototype.usWeightClasses = { + THIN: 100, + EXTRA_LIGHT: 200, + LIGHT: 300, + NORMAL: 400, + MEDIUM: 500, + SEMI_BOLD: 600, + BOLD: 700, + EXTRA_BOLD: 800, + BLACK: 900 + }; + // The `fvar` table stores font variation axes and instances. + function addName(name, names) { + var nameString = JSON.stringify(name); + var nameID = 256; + for (var nameKey in names) { + var n = parseInt(nameKey); + if (!n || n < 256) { + continue; + } + if (JSON.stringify(names[nameKey]) === nameString) { + return n; + } + if (nameID <= n) { + nameID = n + 1; + } + } + names[nameID] = name; + return nameID; + } + function makeFvarAxis(n, axis, names) { + var nameID = addName(axis.name, names); + return [{ + name: 'tag_' + n, + type: 'TAG', + value: axis.tag + }, + { + name: 'minValue_' + n, + type: 'FIXED', + value: axis.minValue << 16 + }, + { + name: 'defaultValue_' + n, + type: 'FIXED', + value: axis.defaultValue << 16 + }, + { + name: 'maxValue_' + n, + type: 'FIXED', + value: axis.maxValue << 16 + }, + { + name: 'flags_' + n, + type: 'USHORT', + value: 0 + }, + { + name: 'nameID_' + n, + type: 'USHORT', + value: nameID + } + ]; + } + function parseFvarAxis(data, start, names) { + var axis = { + }; + var p = new parse.Parser(data, start); + axis.tag = p.parseTag(); + axis.minValue = p.parseFixed(); + axis.defaultValue = p.parseFixed(); + axis.maxValue = p.parseFixed(); + p.skip('uShort', 1); // reserved for flags; no values defined + axis.name = names[p.parseUShort()] || { + }; + return axis; + } + function makeFvarInstance(n, inst, axes, names) { + var nameID = addName(inst.name, names); + var fields = [ + { + name: 'nameID_' + n, + type: 'USHORT', + value: nameID + }, + { + name: 'flags_' + n, + type: 'USHORT', + value: 0 + } + ]; + for (var i = 0; i < axes.length; ++i) { + var axisTag = axes[i].tag; + fields.push({ + name: 'axis_' + n + ' ' + axisTag, + type: 'FIXED', + value: inst.coordinates[axisTag] << 16 + }); + } + return fields; + } + function parseFvarInstance(data, start, axes, names) { + var inst = { + }; + var p = new parse.Parser(data, start); + inst.name = names[p.parseUShort()] || { + }; + p.skip('uShort', 1); // reserved for flags; no values defined + inst.coordinates = { + }; + for (var i = 0; i < axes.length; ++i) { + inst.coordinates[axes[i].tag] = p.parseFixed(); + } + return inst; + } + function makeFvarTable(fvar, names) { + var result = new table.Table('fvar', [ + { + name: 'version', + type: 'ULONG', + value: 65536 + }, + { + name: 'offsetToData', + type: 'USHORT', + value: 0 + }, + { + name: 'countSizePairs', + type: 'USHORT', + value: 2 + }, + { + name: 'axisCount', + type: 'USHORT', + value: fvar.axes.length + }, + { + name: 'axisSize', + type: 'USHORT', + value: 20 + }, + { + name: 'instanceCount', + type: 'USHORT', + value: fvar.instances.length + }, + { + name: 'instanceSize', + type: 'USHORT', + value: 4 + fvar.axes.length * 4 + } + ]); + result.offsetToData = result.sizeOf(); + for (var i = 0; i < fvar.axes.length; i++) { + result.fields = result.fields.concat(makeFvarAxis(i, fvar.axes[i], names)); + } + for (var j = 0; j < fvar.instances.length; j++) { + result.fields = result.fields.concat(makeFvarInstance(j, fvar.instances[j], fvar.axes, names)); + } + return result; + } + function parseFvarTable(data, start, names) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseULong(); + check.argument(tableVersion === 65536, 'Unsupported fvar table version.'); + var offsetToData = p.parseOffset16(); + // Skip countSizePairs. + p.skip('uShort', 1); + var axisCount = p.parseUShort(); + var axisSize = p.parseUShort(); + var instanceCount = p.parseUShort(); + var instanceSize = p.parseUShort(); + var axes = [ + ]; + for (var i = 0; i < axisCount; i++) { + axes.push(parseFvarAxis(data, start + offsetToData + i * axisSize, names)); + } + var instances = [ + ]; + var instanceStart = start + offsetToData + axisCount * axisSize; + for (var j = 0; j < instanceCount; j++) { + instances.push(parseFvarInstance(data, instanceStart + j * instanceSize, axes, names)); + } + return { + axes: axes, + instances: instances + }; + } + var fvar = { + make: makeFvarTable, + parse: parseFvarTable + }; + // The `GPOS` table contains kerning pairs, among other things. + var subtableParsers$1 = new Array(10); // subtableParsers[0] is unused + // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-1-single-adjustment-positioning-subtable + // this = Parser instance + subtableParsers$1[1] = function parseLookup1() { + var start = this.offset + this.relativeOffset; + var posformat = this.parseUShort(); + if (posformat === 1) { + return { + posFormat: 1, + coverage: this.parsePointer(Parser.coverage), + value: this.parseValueRecord() + }; + } else if (posformat === 2) { + return { + posFormat: 2, + coverage: this.parsePointer(Parser.coverage), + values: this.parseValueRecordList() + }; + } + check.assert(false, '0x' + start.toString(16) + ': GPOS lookup type 1 format must be 1 or 2.'); + }; + // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-2-pair-adjustment-positioning-subtable + subtableParsers$1[2] = function parseLookup2() { + var start = this.offset + this.relativeOffset; + var posFormat = this.parseUShort(); + check.assert(posFormat === 1 || posFormat === 2, '0x' + start.toString(16) + ': GPOS lookup type 2 format must be 1 or 2.'); + var coverage = this.parsePointer(Parser.coverage); + var valueFormat1 = this.parseUShort(); + var valueFormat2 = this.parseUShort(); + if (posFormat === 1) { + // Adjustments for Glyph Pairs + return { + posFormat: posFormat, + coverage: coverage, + valueFormat1: valueFormat1, + valueFormat2: valueFormat2, + pairSets: this.parseList(Parser.pointer(Parser.list(function () { + return { + // pairValueRecord + secondGlyph: this.parseUShort(), + value1: this.parseValueRecord(valueFormat1), + value2: this.parseValueRecord(valueFormat2) + }; + }))) + }; + } else if (posFormat === 2) { + var classDef1 = this.parsePointer(Parser.classDef); + var classDef2 = this.parsePointer(Parser.classDef); + var class1Count = this.parseUShort(); + var class2Count = this.parseUShort(); + return { + // Class Pair Adjustment + posFormat: posFormat, + coverage: coverage, + valueFormat1: valueFormat1, + valueFormat2: valueFormat2, + classDef1: classDef1, + classDef2: classDef2, + class1Count: class1Count, + class2Count: class2Count, + classRecords: this.parseList(class1Count, Parser.list(class2Count, function () { + return { + value1: this.parseValueRecord(valueFormat1), + value2: this.parseValueRecord(valueFormat2) + }; + })) + }; + } + }; + subtableParsers$1[3] = function parseLookup3() { + return { + error: 'GPOS Lookup 3 not supported' + }; + }; + subtableParsers$1[4] = function parseLookup4() { + return { + error: 'GPOS Lookup 4 not supported' + }; + }; + subtableParsers$1[5] = function parseLookup5() { + return { + error: 'GPOS Lookup 5 not supported' + }; + }; + subtableParsers$1[6] = function parseLookup6() { + return { + error: 'GPOS Lookup 6 not supported' + }; + }; + subtableParsers$1[7] = function parseLookup7() { + return { + error: 'GPOS Lookup 7 not supported' + }; + }; + subtableParsers$1[8] = function parseLookup8() { + return { + error: 'GPOS Lookup 8 not supported' + }; + }; + subtableParsers$1[9] = function parseLookup9() { + return { + error: 'GPOS Lookup 9 not supported' + }; + }; + // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos + function parseGposTable(data, start) { + start = start || 0; + var p = new Parser(data, start); + var tableVersion = p.parseVersion(1); + check.argument(tableVersion === 1 || tableVersion === 1.1, 'Unsupported GPOS table version ' + tableVersion); + if (tableVersion === 1) { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers$1) + }; + } else { + return { + version: tableVersion, + scripts: p.parseScriptList(), + features: p.parseFeatureList(), + lookups: p.parseLookupList(subtableParsers$1), + variations: p.parseFeatureVariationsList() + }; + } + } // GPOS Writing ////////////////////////////////////////////// + // NOT SUPPORTED + + var subtableMakers$1 = new Array(10); + function makeGposTable(gpos) { + return new table.Table('GPOS', [ + { + name: 'version', + type: 'ULONG', + value: 65536 + }, + { + name: 'scripts', + type: 'TABLE', + value: new table.ScriptList(gpos.scripts) + }, + { + name: 'features', + type: 'TABLE', + value: new table.FeatureList(gpos.features) + }, + { + name: 'lookups', + type: 'TABLE', + value: new table.LookupList(gpos.lookups, subtableMakers$1) + } + ]); + } + var gpos = { + parse: parseGposTable, + make: makeGposTable + }; + // The `kern` table contains kerning pairs. + function parseWindowsKernTable(p) { + var pairs = { + }; + // Skip nTables. + p.skip('uShort'); + var subtableVersion = p.parseUShort(); + check.argument(subtableVersion === 0, 'Unsupported kern sub-table version.'); + // Skip subtableLength, subtableCoverage + p.skip('uShort', 2); + var nPairs = p.parseUShort(); + // Skip searchRange, entrySelector, rangeShift. + p.skip('uShort', 3); + for (var i = 0; i < nPairs; i += 1) { + var leftIndex = p.parseUShort(); + var rightIndex = p.parseUShort(); + var value = p.parseShort(); + pairs[leftIndex + ',' + rightIndex] = value; + } + return pairs; + } + function parseMacKernTable(p) { + var pairs = { + }; + // The Mac kern table stores the version as a fixed (32 bits) but we only loaded the first 16 bits. + // Skip the rest. + p.skip('uShort'); + var nTables = p.parseULong(); + //check.argument(nTables === 1, 'Only 1 subtable is supported (got ' + nTables + ').'); + if (nTables > 1) { + console.warn('Only the first kern subtable is supported.'); + } + p.skip('uLong'); + var coverage = p.parseUShort(); + var subtableVersion = coverage & 255; + p.skip('uShort'); + if (subtableVersion === 0) { + var nPairs = p.parseUShort(); + // Skip searchRange, entrySelector, rangeShift. + p.skip('uShort', 3); + for (var i = 0; i < nPairs; i += 1) { + var leftIndex = p.parseUShort(); + var rightIndex = p.parseUShort(); + var value = p.parseShort(); + pairs[leftIndex + ',' + rightIndex] = value; + } + } + return pairs; + } // Parse the `kern` table which contains kerning pairs. + + function parseKernTable(data, start) { + var p = new parse.Parser(data, start); + var tableVersion = p.parseUShort(); + if (tableVersion === 0) { + return parseWindowsKernTable(p); + } else if (tableVersion === 1) { + return parseMacKernTable(p); + } else { + throw new Error('Unsupported kern table version (' + tableVersion + ').'); + } + } + var kern = { + parse: parseKernTable + }; + // The `loca` table stores the offsets to the locations of the glyphs in the font. + // Parse the `loca` table. This table stores the offsets to the locations of the glyphs in the font, + // relative to the beginning of the glyphData table. + // The number of glyphs stored in the `loca` table is specified in the `maxp` table (under numGlyphs) + // The loca table has two versions: a short version where offsets are stored as uShorts, and a long + // version where offsets are stored as uLongs. The `head` table specifies which version to use + // (under indexToLocFormat). + function parseLocaTable(data, start, numGlyphs, shortVersion) { + var p = new parse.Parser(data, start); + var parseFn = shortVersion ? p.parseUShort : p.parseULong; + // There is an extra entry after the last index element to compute the length of the last glyph. + // That's why we use numGlyphs + 1. + var glyphOffsets = [ + ]; + for (var i = 0; i < numGlyphs + 1; i += 1) { + var glyphOffset = parseFn.call(p); + if (shortVersion) { + // The short table version stores the actual offset divided by 2. + glyphOffset *= 2; + } + glyphOffsets.push(glyphOffset); + } + return glyphOffsets; + } + var loca = { + parse: parseLocaTable + }; + // opentype.js + /** + * The opentype library. + * @namespace opentype + */ + // File loaders ///////////////////////////////////////////////////////// + /** + * Loads a font from a file. The callback throws an error message as the first parameter if it fails + * and the font as an ArrayBuffer in the second parameter if it succeeds. + * @param {string} path - The path of the file + * @param {Function} callback - The function to call when the font load completes + */ + function loadFromFile(path, callback) { + var fs = _dereq_('fs'); + fs.readFile(path, function (err, buffer) { + if (err) { + return callback(err.message); + } + callback(null, nodeBufferToArrayBuffer(buffer)); + }); + } /** + * Loads a font from a URL. The callback throws an error message as the first parameter if it fails + * and the font as an ArrayBuffer in the second parameter if it succeeds. + * @param {string} url - The URL of the font file. + * @param {Function} callback - The function to call when the font load completes + */ + + function loadFromUrl(url, callback) { + var request = new XMLHttpRequest(); + request.open('get', url, true); + request.responseType = 'arraybuffer'; + request.onload = function () { + if (request.response) { + return callback(null, request.response); + } else { + return callback('Font could not be loaded: ' + request.statusText); + } + }; + request.onerror = function () { + callback('Font could not be loaded'); + }; + request.send(); + } // Table Directory Entries ////////////////////////////////////////////// + /** + * Parses OpenType table entries. + * @param {DataView} + * @param {Number} + * @return {Object[]} + */ + + function parseOpenTypeTableEntries(data, numTables) { + var tableEntries = [ + ]; + var p = 12; + for (var i = 0; i < numTables; i += 1) { + var tag = parse.getTag(data, p); + var checksum = parse.getULong(data, p + 4); + var offset = parse.getULong(data, p + 8); + var length = parse.getULong(data, p + 12); + tableEntries.push({ + tag: tag, + checksum: checksum, + offset: offset, + length: length, + compression: false + }); + p += 16; + } + return tableEntries; + } /** + * Parses WOFF table entries. + * @param {DataView} + * @param {Number} + * @return {Object[]} + */ + + function parseWOFFTableEntries(data, numTables) { + var tableEntries = [ + ]; + var p = 44; // offset to the first table directory entry. + for (var i = 0; i < numTables; i += 1) { + var tag = parse.getTag(data, p); + var offset = parse.getULong(data, p + 4); + var compLength = parse.getULong(data, p + 8); + var origLength = parse.getULong(data, p + 12); + var compression = void 0; + if (compLength < origLength) { + compression = 'WOFF'; + } else { + compression = false; + } + tableEntries.push({ + tag: tag, + offset: offset, + compression: compression, + compressedLength: compLength, + length: origLength + }); + p += 20; + } + return tableEntries; + } /** + * @typedef TableData + * @type Object + * @property {DataView} data - The DataView + * @property {number} offset - The data offset. + */ + /** + * @param {DataView} + * @param {Object} + * @return {TableData} + */ + + function uncompressTable(data, tableEntry) { + if (tableEntry.compression === 'WOFF') { + var inBuffer = new Uint8Array(data.buffer, tableEntry.offset + 2, tableEntry.compressedLength - 2); + var outBuffer = new Uint8Array(tableEntry.length); + tinyInflate(inBuffer, outBuffer); + if (outBuffer.byteLength !== tableEntry.length) { + throw new Error('Decompression error: ' + tableEntry.tag + ' decompressed length doesn\'t match recorded length'); + } + var view = new DataView(outBuffer.buffer, 0); + return { + data: view, + offset: 0 + }; + } else { + return { + data: data, + offset: tableEntry.offset + }; + } + } // Public API /////////////////////////////////////////////////////////// + /** + * Parse the OpenType file data (as an ArrayBuffer) and return a Font object. + * Throws an error if the font could not be parsed. + * @param {ArrayBuffer} + * @return {opentype.Font} + */ + + function parseBuffer(buffer) { + var indexToLocFormat; + var ltagTable; + // Since the constructor can also be called to create new fonts from scratch, we indicate this + // should be an empty font that we'll fill with our own data. + var font = new Font({ + empty: true + }); + // OpenType fonts use big endian byte ordering. + // We can't rely on typed array view types, because they operate with the endianness of the host computer. + // Instead we use DataViews where we can specify endianness. + var data = new DataView(buffer, 0); + var numTables; + var tableEntries = [ + ]; + var signature = parse.getTag(data, 0); + if (signature === String.fromCharCode(0, 1, 0, 0) || signature === 'true' || signature === 'typ1') { + font.outlinesFormat = 'truetype'; + numTables = parse.getUShort(data, 4); + tableEntries = parseOpenTypeTableEntries(data, numTables); + } else if (signature === 'OTTO') { + font.outlinesFormat = 'cff'; + numTables = parse.getUShort(data, 4); + tableEntries = parseOpenTypeTableEntries(data, numTables); + } else if (signature === 'wOFF') { + var flavor = parse.getTag(data, 4); + if (flavor === String.fromCharCode(0, 1, 0, 0)) { + font.outlinesFormat = 'truetype'; + } else if (flavor === 'OTTO') { + font.outlinesFormat = 'cff'; + } else { + throw new Error('Unsupported OpenType flavor ' + signature); + } + numTables = parse.getUShort(data, 12); + tableEntries = parseWOFFTableEntries(data, numTables); + } else { + throw new Error('Unsupported OpenType signature ' + signature); + } + var cffTableEntry; + var fvarTableEntry; + var glyfTableEntry; + var gposTableEntry; + var gsubTableEntry; + var hmtxTableEntry; + var kernTableEntry; + var locaTableEntry; + var nameTableEntry; + var metaTableEntry; + var p; + for (var i = 0; i < numTables; i += 1) { + var tableEntry = tableEntries[i]; + var table = void 0; + switch (tableEntry.tag) { + case 'cmap': + table = uncompressTable(data, tableEntry); + font.tables.cmap = cmap.parse(table.data, table.offset); + font.encoding = new CmapEncoding(font.tables.cmap); + break; + case 'cvt ': + table = uncompressTable(data, tableEntry); + p = new parse.Parser(table.data, table.offset); + font.tables.cvt = p.parseShortList(tableEntry.length / 2); + break; + case 'fvar': + fvarTableEntry = tableEntry; + break; + case 'fpgm': + table = uncompressTable(data, tableEntry); + p = new parse.Parser(table.data, table.offset); + font.tables.fpgm = p.parseByteList(tableEntry.length); + break; + case 'head': + table = uncompressTable(data, tableEntry); + font.tables.head = head.parse(table.data, table.offset); + font.unitsPerEm = font.tables.head.unitsPerEm; + indexToLocFormat = font.tables.head.indexToLocFormat; + break; + case 'hhea': + table = uncompressTable(data, tableEntry); + font.tables.hhea = hhea.parse(table.data, table.offset); + font.ascender = font.tables.hhea.ascender; + font.descender = font.tables.hhea.descender; + font.numberOfHMetrics = font.tables.hhea.numberOfHMetrics; + break; + case 'hmtx': + hmtxTableEntry = tableEntry; + break; + case 'ltag': + table = uncompressTable(data, tableEntry); + ltagTable = ltag.parse(table.data, table.offset); + break; + case 'maxp': + table = uncompressTable(data, tableEntry); + font.tables.maxp = maxp.parse(table.data, table.offset); + font.numGlyphs = font.tables.maxp.numGlyphs; + break; + case 'name': + nameTableEntry = tableEntry; + break; + case 'OS/2': + table = uncompressTable(data, tableEntry); + font.tables.os2 = os2.parse(table.data, table.offset); + break; + case 'post': + table = uncompressTable(data, tableEntry); + font.tables.post = post.parse(table.data, table.offset); + font.glyphNames = new GlyphNames(font.tables.post); + break; + case 'prep': + table = uncompressTable(data, tableEntry); + p = new parse.Parser(table.data, table.offset); + font.tables.prep = p.parseByteList(tableEntry.length); + break; + case 'glyf': + glyfTableEntry = tableEntry; + break; + case 'loca': + locaTableEntry = tableEntry; + break; + case 'CFF ': + cffTableEntry = tableEntry; + break; + case 'kern': + kernTableEntry = tableEntry; + break; + case 'GPOS': + gposTableEntry = tableEntry; + break; + case 'GSUB': + gsubTableEntry = tableEntry; + break; + case 'meta': + metaTableEntry = tableEntry; + break; + } + } + var nameTable = uncompressTable(data, nameTableEntry); + font.tables.name = _name.parse(nameTable.data, nameTable.offset, ltagTable); + font.names = font.tables.name; + if (glyfTableEntry && locaTableEntry) { + var shortVersion = indexToLocFormat === 0; + var locaTable = uncompressTable(data, locaTableEntry); + var locaOffsets = loca.parse(locaTable.data, locaTable.offset, font.numGlyphs, shortVersion); + var glyfTable = uncompressTable(data, glyfTableEntry); + font.glyphs = glyf.parse(glyfTable.data, glyfTable.offset, locaOffsets, font); + } else if (cffTableEntry) { + var cffTable = uncompressTable(data, cffTableEntry); + cff.parse(cffTable.data, cffTable.offset, font); + } else { + throw new Error('Font doesn\'t contain TrueType or CFF outlines.'); + } + var hmtxTable = uncompressTable(data, hmtxTableEntry); + hmtx.parse(hmtxTable.data, hmtxTable.offset, font.numberOfHMetrics, font.numGlyphs, font.glyphs); + addGlyphNames(font); + if (kernTableEntry) { + var kernTable = uncompressTable(data, kernTableEntry); + font.kerningPairs = kern.parse(kernTable.data, kernTable.offset); + } else { + font.kerningPairs = { + }; + } + if (gposTableEntry) { + var gposTable = uncompressTable(data, gposTableEntry); + font.tables.gpos = gpos.parse(gposTable.data, gposTable.offset); + font.position.init(); + } + if (gsubTableEntry) { + var gsubTable = uncompressTable(data, gsubTableEntry); + font.tables.gsub = gsub.parse(gsubTable.data, gsubTable.offset); + } + if (fvarTableEntry) { + var fvarTable = uncompressTable(data, fvarTableEntry); + font.tables.fvar = fvar.parse(fvarTable.data, fvarTable.offset, font.names); + } + if (metaTableEntry) { + var metaTable = uncompressTable(data, metaTableEntry); + font.tables.meta = meta.parse(metaTable.data, metaTable.offset); + font.metas = font.tables.meta; + } + return font; + } /** + * Asynchronously load the font from a URL or a filesystem. When done, call the callback + * with two arguments `(err, font)`. The `err` will be null on success, + * the `font` is a Font object. + * We use the node.js callback convention so that + * opentype.js can integrate with frameworks like async.js. + * @alias opentype.load + * @param {string} url - The URL of the font to load. + * @param {Function} callback - The callback. + */ + + function load(url, callback) { + var isNode$$1 = typeof window === 'undefined'; + var loadFn = isNode$$1 ? loadFromFile : loadFromUrl; + loadFn(url, function (err, arrayBuffer) { + if (err) { + return callback(err); + } + var font; + try { + font = parseBuffer(arrayBuffer); + } catch (e) { + return callback(e, null); + } + return callback(null, font); + }); + } /** + * Synchronously load the font from a URL or file. + * When done, returns the font object or throws an error. + * @alias opentype.loadSync + * @param {string} url - The URL of the font to load. + * @return {opentype.Font} + */ + + function loadSync(url) { + var fs = _dereq_('fs'); + var buffer = fs.readFileSync(url); + return parseBuffer(nodeBufferToArrayBuffer(buffer)); + } + exports.Font = Font; + exports.Glyph = Glyph; + exports.Path = Path; + exports.BoundingBox = BoundingBox; + exports._parse = parse; + exports.parse = parseBuffer; + exports.load = load; + exports.loadSync = loadSync; + Object.defineProperty(exports, '__esModule', { + value: true + }); + }); + }).call(this, _dereq_('buffer').Buffer) + }, + { + 'buffer': 22, + 'fs': 21 + } + ], + 272: [ + function (_dereq_, module, exports) { + (function (process) { + // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, + // backported and transplited with Babel, with backwards-compat fixes + // Copyright Joyent, Inc. and other Node contributors. + // + // 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. + // resolves . and .. elements in a path array with directory names there + // must be no slashes, empty elements, or device names (c:\) in the array + // (so also no leading and trailing slashes - it does not distinguish + // relative and absolute paths) + function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } // if the path is allowed to go above the root, restore leading ..s + + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + return parts; + } // path.resolve([from ...], to) + // posix version + + exports.resolve = function () { + var resolvedPath = '', + resolvedAbsolute = false; + for (var i = arguments.length - 1; i >= - 1 && !resolvedAbsolute; i--) { + var path = i >= 0 ? arguments[i] : process.cwd(); + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + // Normalize the path + + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) { + return !!p; + }), !resolvedAbsolute).join('/'); + return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; + }; + // path.normalize(path) + // posix version + exports.normalize = function (path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, - 1) === '/'; + // Normalize the path + path = normalizeArray(filter(path.split('/'), function (p) { + return !!p; + }), !isAbsolute).join('/'); + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + return (isAbsolute ? '/' : '') + path; + }; + // posix version + exports.isAbsolute = function (path) { + return path.charAt(0) === '/'; + }; + // posix version + exports.join = function () { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function (p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); + }; + // path.relative(from, to) + // posix version + exports.relative = function (from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = [ + ]; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join('/'); + }; + exports.sep = '/'; + exports.delimiter = ':'; + exports.dirname = function (path) { + if (typeof path !== 'string') path = path + ''; + if (path.length === 0) return '.'; + var code = path.charCodeAt(0); + var hasRoot = code === 47 /*/*/ ; + var end = - 1; + var matchedSlash = true; + for (var i = path.length - 1; i >= 1; --i) { + code = path.charCodeAt(i); + if (code === 47 /*/*/ ) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } + if (end === - 1) return hasRoot ? '/' : '.'; + if (hasRoot && end === 1) { + // return '//'; + // Backwards-compat fix: + return '/'; + } + return path.slice(0, end); + }; + function basename(path) { + if (typeof path !== 'string') path = path + ''; + var start = 0; + var end = - 1; + var matchedSlash = true; + var i; + for (i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === 47 /*/*/ ) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === - 1) { + // We saw the first non-path separator, mark this as the end of our + // path component + matchedSlash = false; + end = i + 1; + } + } + if (end === - 1) return ''; + return path.slice(start, end); + } // Uses a mixed approach for backwards-compatibility, as ext behavior changed + // in new Node.js versions, so only basename() above is backported here + + exports.basename = function (path, ext) { + var f = basename(path); + if (ext && f.substr( - 1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; + }; + exports.extname = function (path) { + if (typeof path !== 'string') path = path + ''; + var startDot = - 1; + var startPart = 0; + var end = - 1; + var matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + for (var i = path.length - 1; i >= 0; --i) { + var code = path.charCodeAt(i); + if (code === 47 /*/*/ ) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === - 1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46 /*.*/ ) { + // If this is our first dot, mark it as the start of our extension + if (startDot === - 1) startDot = i; + else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== - 1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = - 1; + } + } + if (startDot === - 1 || end === - 1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ''; + } + return path.slice(startDot, end); + }; + function filter(xs, f) { + if (xs.filter) return xs.filter(f); + var res = [ + ]; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; + } // String.prototype.substr - negative index don't work in IE8 + + var substr = 'ab'.substr( - 1) === 'b' ? function (str, start, len) { + return str.substr(start, len); + } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + }; + }).call(this, _dereq_('_process')) + }, + { + '_process': 273 + } + ], + 273: [ + function (_dereq_, module, exports) { + // shim for using process in browser + var process = module.exports = { + }; + // cached from whatever global is present so that test runners that stub it + // don't break things. But we need to wrap it in a try catch in case it is + // wrapped in strict mode code which doesn't define any globals. It's inside a + // function because try/catches deoptimize in certain engines. + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + }(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }) (); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } // if setTimeout wasn't available but was latter defined + + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } // if clearTimeout wasn't available but was latter defined + + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = [ + ]; + var draining = false; + var currentQueue; + var queueIndex = - 1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = - 1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = [ + ]; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = - 1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = { + }; + process.argv = [ + ]; + process.version = ''; // empty string to avoid regexp issues + process.versions = { + }; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + { + } + ], + 274: [ + function (_dereq_, module, exports) { + /** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + var runtime = function (exports) { + 'use strict'; + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === 'function' ? Symbol : { + }; + var iteratorSymbol = $Symbol.iterator || '@@iterator'; + var asyncIteratorSymbol = $Symbol.asyncIterator || '@@asyncIterator'; + var toStringTagSymbol = $Symbol.toStringTag || '@@toStringTag'; + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || [ + ]); + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + return generator; + } + exports.wrap = wrap; + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { + type: 'normal', + arg: fn.call(obj, arg) + }; + } catch (err) { + return { + type: 'throw', + arg: err + }; + } + } + var GenStateSuspendedStart = 'suspendedStart'; + var GenStateSuspendedYield = 'suspendedYield'; + var GenStateExecuting = 'executing'; + var GenStateCompleted = 'completed'; + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = { + }; + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() { + } + function GeneratorFunction() { + } + function GeneratorFunctionPrototype() { + } // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + + var IteratorPrototype = { + }; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = 'GeneratorFunction'; + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + [ + 'next', + 'throw', + 'return' + ].forEach(function (method) { + prototype[method] = function (arg) { + return this._invoke(method, arg); + }; + }); + } + exports.isGeneratorFunction = function (genFun) { + var ctor = typeof genFun === 'function' && genFun.constructor; + return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === 'GeneratorFunction' : false; + }; + exports.mark = function (genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = 'GeneratorFunction'; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function (arg) { + return { + __await: arg + }; + }; + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === 'throw') { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && typeof value === 'object' && hasOwn.call(value, '__await')) { + return Promise.resolve(value.__await).then(function (value) { + invoke('next', value, resolve, reject); + }, function (err) { + invoke('throw', err, resolve, reject); + }); + } + return Promise.resolve(value).then(function (unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function (error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke('throw', error, resolve, reject); + }); + } + } + var previousPromise; + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + return previousPromise = // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + + this._invoke = enqueue; + } + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function (innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList)); + return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }; + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error('Generator is already running'); + } + if (state === GenStateCompleted) { + if (method === 'throw') { + throw arg; + } // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + + return doneResult(); + } + context.method = method; + context.arg = arg; + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + if (context.method === 'next') { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + } else if (context.method === 'throw') { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + context.dispatchException(context.arg); + } else if (context.method === 'return') { + context.abrupt('return', context.arg); + } + state = GenStateExecuting; + var record = tryCatch(innerFn, self, context); + if (record.type === 'normal') { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done ? GenStateCompleted : GenStateSuspendedYield; + if (record.arg === ContinueSentinel) { + continue; + } + return { + value: record.arg, + done: context.done + }; + } else if (record.type === 'throw') { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = 'throw'; + context.arg = record.arg; + } + } + }; + } // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + if (context.method === 'throw') { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator['return']) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = 'return'; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + if (context.method === 'throw') { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + context.method = 'throw'; + context.arg = new TypeError('The iterator does not provide a \'throw\' method'); + } + return ContinueSentinel; + } + var record = tryCatch(method, delegate.iterator, context.arg); + if (record.type === 'throw') { + context.method = 'throw'; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + var info = record.arg; + if (!info) { + context.method = 'throw'; + context.arg = new TypeError('iterator result is not an object'); + context.delegate = null; + return ContinueSentinel; + } + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== 'return') { + context.method = 'next'; + context.arg = undefined; + } + } else { + // Re-yield the result returned by the delegate method. + return info; + } // The delegate iterator is finished, so forget it and continue with + // the outer generator. + + context.delegate = null; + return ContinueSentinel; + } // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + + defineIteratorMethods(Gp); + Gp[toStringTagSymbol] = 'Generator'; + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function () { + return this; + }; + Gp.toString = function () { + return '[object Generator]'; + }; + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0] + }; + if (1 in locs) { + entry.catchLoc = locs[1]; + } + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + this.tryEntries.push(entry); + } + function resetTryEntry(entry) { + var record = entry.completion || { + }; + record.type = 'normal'; + delete record.arg; + entry.completion = record; + } + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [ + { + tryLoc: 'root' + } + ]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + exports.keys = function (object) { + var keys = [ + ]; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + + next.done = true; + return next; + }; + }; + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + if (typeof iterable.next === 'function') { + return iterable; + } + if (!isNaN(iterable.length)) { + var i = - 1, + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + next.value = undefined; + next.done = true; + return next; + }; + return next.next = next; + } + } // Return an iterator with no values. + + return { + next: doneResult + }; + } + exports.values = values; + function doneResult() { + return { + value: undefined, + done: true + }; + } + Context.prototype = { + constructor: Context, + reset: function (skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + this.method = 'next'; + this.arg = undefined; + this.tryEntries.forEach(resetTryEntry); + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === 't' && hasOwn.call(this, name) && !isNaN( + name.slice(1))) { + this[name] = undefined; + } + } + } + }, + stop: function () { + this.done = true; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === 'throw') { + throw rootRecord.arg; + } + return this.rval; + }, + dispatchException: function (exception) { + if (this.done) { + throw exception; + } + var context = this; + function handle(loc, caught) { + record.type = 'throw'; + record.arg = exception; + context.next = loc; + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = 'next'; + context.arg = undefined; + } + return !!caught; + } + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + if (entry.tryLoc === 'root') { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle('end'); + } + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, 'catchLoc'); + var hasFinally = hasOwn.call(entry, 'finallyLoc'); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error('try statement without catch or finally'); + } + } + } + }, + abrupt: function (type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && hasOwn.call(entry, 'finallyLoc') && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + if (finallyEntry && (type === 'break' || type === 'continue') && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + var record = finallyEntry ? finallyEntry.completion : { + }; + record.type = type; + record.arg = arg; + if (finallyEntry) { + this.method = 'next'; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + return this.complete(record); + }, + complete: function (record, afterLoc) { + if (record.type === 'throw') { + throw record.arg; + } + if (record.type === 'break' || record.type === 'continue') { + this.next = record.arg; + } else if (record.type === 'return') { + this.rval = this.arg = record.arg; + this.method = 'return'; + this.next = 'end'; + } else if (record.type === 'normal' && afterLoc) { + this.next = afterLoc; + } + return ContinueSentinel; + }, + finish: function (finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + 'catch': function (tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === 'throw') { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + + throw new Error('illegal catch attempt'); + }, + delegateYield: function (iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + if (this.method === 'next') { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + return ContinueSentinel; + } + }; + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + }( // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === 'object' ? module.exports : { + }); + try { + regeneratorRuntime = runtime; + } catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function('r', 'regeneratorRuntime = r') (runtime); + } + }, + { + } + ], + 275: [ + function (_dereq_, module, exports) { + (function (self) { + 'use strict'; + if (self.fetch) { + return; + } + var support = { + searchParams: 'URLSearchParams' in self, + iterable: 'Symbol' in self && 'iterator' in Symbol, + blob: 'FileReader' in self && 'Blob' in self && function () { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + }(), + formData: 'FormData' in self, + arrayBuffer: 'ArrayBuffer' in self + }; + if (support.arrayBuffer) { + var viewClasses = [ + '[object Int8Array]', + '[object Uint8Array]', + '[object Uint8ClampedArray]', + '[object Int16Array]', + '[object Uint16Array]', + '[object Int32Array]', + '[object Uint32Array]', + '[object Float32Array]', + '[object Float64Array]' + ]; + var isDataView = function (obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + }; + var isArrayBufferView = ArrayBuffer.isView || function (obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > - 1; + }; + } + function normalizeName(name) { + if (typeof name !== 'string') { + name = String(name); + } + if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { + throw new TypeError('Invalid character in header field name'); + } + return name.toLowerCase(); + } + function normalizeValue(value) { + if (typeof value !== 'string') { + value = String(value); + } + return value; + } // Build a destructive iterator for the value list + + function iteratorFor(items) { + var iterator = { + next: function () { + var value = items.shift(); + return { + done: value === undefined, + value: value + }; + } + }; + if (support.iterable) { + iterator[Symbol.iterator] = function () { + return iterator; + }; + } + return iterator; + } + function Headers(headers) { + this.map = { + }; + if (headers instanceof Headers) { + headers.forEach(function (value, name) { + this.append(name, value); + }, this); + } else if (Array.isArray(headers)) { + headers.forEach(function (header) { + this.append(header[0], header[1]); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function (name) { + this.append(name, headers[name]); + }, this); + } + } + Headers.prototype.append = function (name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var oldValue = this.map[name]; + this.map[name] = oldValue ? oldValue + ',' + value : value; + }; + Headers.prototype['delete'] = function (name) { + delete this.map[normalizeName(name)]; + }; + Headers.prototype.get = function (name) { + name = normalizeName(name); + return this.has(name) ? this.map[name] : null; + }; + Headers.prototype.has = function (name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + Headers.prototype.set = function (name, value) { + this.map[normalizeName(name)] = normalizeValue(value); + }; + Headers.prototype.forEach = function (callback, thisArg) { + for (var name in this.map) { + if (this.map.hasOwnProperty(name)) { + callback.call(thisArg, this.map[name], name, this); + } + } + }; + Headers.prototype.keys = function () { + var items = [ + ]; + this.forEach(function (value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + Headers.prototype.values = function () { + var items = [ + ]; + this.forEach(function (value) { + items.push(value); + }); + return iteratorFor(items); + }; + Headers.prototype.entries = function () { + var items = [ + ]; + this.forEach(function (value, name) { + items.push([name, + value]); + }); + return iteratorFor(items); + }; + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + } + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError('Already read')); + } + body.bodyUsed = true; + } + function fileReaderReady(reader) { + return new Promise(function (resolve, reject) { + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error); + }; + }); + } + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsArrayBuffer(blob); + return promise; + } + function readBlobAsText(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsText(blob); + return promise; + } + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf); + var chars = new Array(view.length); + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]); + } + return chars.join(''); + } + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0); + } else { + var view = new Uint8Array(buf.byteLength); + view.set(new Uint8Array(buf)); + return view.buffer; + } + } + function Body() { + this.bodyUsed = false; + this._initBody = function (body) { + this._bodyInit = body; + if (!body) { + this._bodyText = ''; + } else if (typeof body === 'string') { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body; + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString(); + } else if (support.arrayBuffer && support.blob && isDataView(body)) { + this._bodyArrayBuffer = bufferClone(body.buffer); + // IE 10-11 can't handle a DataView body. + this._bodyInit = new Blob([this._bodyArrayBuffer]); + } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { + this._bodyArrayBuffer = bufferClone(body); + } else { + throw new Error('unsupported BodyInit type'); + } + if (!this.headers.get('content-type')) { + if (typeof body === 'string') { + this.headers.set('content-type', 'text/plain;charset=UTF-8'); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set('content-type', this._bodyBlob.type); + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + } + }; + if (support.blob) { + this.blob = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as blob'); + } else { + return Promise.resolve(new Blob([this._bodyText])); + } + }; + this.arrayBuffer = function () { + if (this._bodyArrayBuffer) { + return consumed(this) || Promise.resolve(this._bodyArrayBuffer); + } else { + return this.blob().then(readBlobAsArrayBuffer); + } + }; + } + this.text = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as text'); + } else { + return Promise.resolve(this._bodyText); + } + }; + if (support.formData) { + this.formData = function () { + return this.text().then(decode); + }; + } + this.json = function () { + return this.text().then(JSON.parse); + }; + return this; + } // HTTP methods whose capitalization should be normalized + + var methods = [ + 'DELETE', + 'GET', + 'HEAD', + 'OPTIONS', + 'POST', + 'PUT' + ]; + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > - 1 ? upcased : method; + } + function Request(input, options) { + options = options || { + }; + var body = options.body; + if (input instanceof Request) { + if (input.bodyUsed) { + throw new TypeError('Already read'); + } + this.url = input.url; + this.credentials = input.credentials; + if (!options.headers) { + this.headers = new Headers(input.headers); + } + this.method = input.method; + this.mode = input.mode; + if (!body && input._bodyInit != null) { + body = input._bodyInit; + input.bodyUsed = true; + } + } else { + this.url = String(input); + } + this.credentials = options.credentials || this.credentials || 'omit'; + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); + } + this.method = normalizeMethod(options.method || this.method || 'GET'); + this.mode = options.mode || this.mode || null; + this.referrer = null; + if ((this.method === 'GET' || this.method === 'HEAD') && body) { + throw new TypeError('Body not allowed for GET or HEAD requests'); + } + this._initBody(body); + } + Request.prototype.clone = function () { + return new Request(this, { + body: this._bodyInit + }); + }; + function decode(body) { + var form = new FormData(); + body.trim().split('&').forEach(function (bytes) { + if (bytes) { + var split = bytes.split('='); + var name = split.shift().replace(/\+/g, ' '); + var value = split.join('=').replace(/\+/g, ' '); + form.append(decodeURIComponent(name), decodeURIComponent(value)); + } + }); + return form; + } + function parseHeaders(rawHeaders) { + var headers = new Headers(); + // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space + // https://tools.ietf.org/html/rfc7230#section-3.2 + var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); + preProcessedHeaders.split(/\r?\n/).forEach(function (line) { + var parts = line.split(':'); + var key = parts.shift().trim(); + if (key) { + var value = parts.join(':').trim(); + headers.append(key, value); + } + }); + return headers; + } + Body.call(Request.prototype); + function Response(bodyInit, options) { + if (!options) { + options = { + }; + } + this.type = 'default'; + this.status = options.status === undefined ? 200 : options.status; + this.ok = this.status >= 200 && this.status < 300; + this.statusText = 'statusText' in options ? options.statusText : 'OK'; + this.headers = new Headers(options.headers); + this.url = options.url || ''; + this._initBody(bodyInit); + } + Body.call(Response.prototype); + Response.prototype.clone = function () { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }); + }; + Response.error = function () { + var response = new Response(null, { + status: 0, + statusText: '' + }); + response.type = 'error'; + return response; + }; + var redirectStatuses = [ + 301, + 302, + 303, + 307, + 308 + ]; + Response.redirect = function (url, status) { + if (redirectStatuses.indexOf(status) === - 1) { + throw new RangeError('Invalid status code'); + } + return new Response(null, { + status: status, + headers: { + location: url + } + }); + }; + self.Headers = Headers; + self.Request = Request; + self.Response = Response; + self.fetch = function (input, init) { + return new Promise(function (resolve, reject) { + var request = new Request(input, init); + var xhr = new XMLHttpRequest(); + xhr.onload = function () { + var options = { + status: xhr.status, + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || '') + }; + options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); + var body = 'response' in xhr ? xhr.response : xhr.responseText; + resolve(new Response(body, options)); + }; + xhr.onerror = function () { + reject(new TypeError('Network request failed')); + }; + xhr.ontimeout = function () { + reject(new TypeError('Network request failed')); + }; + xhr.open(request.method, request.url, true); + if (request.credentials === 'include') { + xhr.withCredentials = true; + } else if (request.credentials === 'omit') { + xhr.withCredentials = false; + } + if ('responseType' in xhr && support.blob) { + xhr.responseType = 'blob'; + } + request.headers.forEach(function (value, name) { + xhr.setRequestHeader(name, value); + }); + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); + }); + }; + self.fetch.polyfill = true; + }) (typeof self !== 'undefined' ? self : this); + }, + { + } + ], + 276: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.split'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var _color_conversion = _interopRequireDefault(_dereq_('../color/color_conversion')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + //stores the original hsb values + + var originalHSB; + //stores values for color name exceptions + var colorExceptions = [ + { + h: 0, + s: 0, + b: 0.8275, + name: 'gray' + }, + { + h: 0, + s: 0, + b: 0.8627, + name: 'gray' + }, + { + h: 0, + s: 0, + b: 0.7529, + name: 'gray' + }, + { + h: 0.0167, + s: 0.1176, + b: 1, + name: 'light pink' + } + ]; + //stores values for color names + var colorLookUp = [ + { + h: 0, + s: 0, + b: 0, + name: 'black' + }, + { + h: 0, + s: 0, + b: 0.5, + name: 'gray' + }, + { + h: 0, + s: 0, + b: 1, + name: 'white' + }, + { + h: 0, + s: 0.5, + b: 0.5, + name: 'dark maroon' + }, + { + h: 0, + s: 0.5, + b: 1, + name: 'salmon pink' + }, + { + h: 0, + s: 1, + b: 0, + name: 'black' + }, + { + h: 0, + s: 1, + b: 0.5, + name: 'dark red' + }, + { + h: 0, + s: 1, + b: 1, + name: 'red' + }, + { + h: 5, + s: 0, + b: 1, + name: 'very light peach' + }, + { + h: 5, + s: 0.5, + b: 0.5, + name: 'brown' + }, + { + h: 5, + s: 0.5, + b: 1, + name: 'peach' + }, + { + h: 5, + s: 1, + b: 0.5, + name: 'brick red' + }, + { + h: 5, + s: 1, + b: 1, + name: 'crimson' + }, + { + h: 10, + s: 0, + b: 1, + name: 'light peach' + }, + { + h: 10, + s: 0.5, + b: 0.5, + name: 'brown' + }, + { + h: 10, + s: 0.5, + b: 1, + name: 'light orange' + }, + { + h: 10, + s: 1, + b: 0.5, + name: 'brown' + }, + { + h: 10, + s: 1, + b: 1, + name: 'orange' + }, + { + h: 15, + s: 0, + b: 1, + name: 'very light yellow' + }, + { + h: 15, + s: 0.5, + b: 0.5, + name: 'olive green' + }, + { + h: 15, + s: 0.5, + b: 1, + name: 'light yellow' + }, + { + h: 15, + s: 1, + b: 0, + name: 'dark olive green' + }, + { + h: 15, + s: 1, + b: 0.5, + name: 'olive green' + }, + { + h: 15, + s: 1, + b: 1, + name: 'yellow' + }, + { + h: 20, + s: 0, + b: 1, + name: 'very light yellow' + }, + { + h: 20, + s: 0.5, + b: 0.5, + name: 'olive green' + }, + { + h: 20, + s: 0.5, + b: 1, + name: 'light yellow green' + }, + { + h: 20, + s: 1, + b: 0, + name: 'dark olive green' + }, + { + h: 20, + s: 1, + b: 0.5, + name: 'dark yellow green' + }, + { + h: 20, + s: 1, + b: 1, + name: 'yellow green' + }, + { + h: 25, + s: 0.5, + b: 0.5, + name: 'dark yellow green' + }, + { + h: 25, + s: 0.5, + b: 1, + name: 'light green' + }, + { + h: 25, + s: 1, + b: 0.5, + name: 'dark green' + }, + { + h: 25, + s: 1, + b: 1, + name: 'green' + }, + { + h: 30, + s: 0.5, + b: 1, + name: 'light green' + }, + { + h: 30, + s: 1, + b: 0.5, + name: 'dark green' + }, + { + h: 30, + s: 1, + b: 1, + name: 'green' + }, + { + h: 35, + s: 0, + b: 0.5, + name: 'light green' + }, + { + h: 35, + s: 0, + b: 1, + name: 'very light green' + }, + { + h: 35, + s: 0.5, + b: 0.5, + name: 'dark green' + }, + { + h: 35, + s: 0.5, + b: 1, + name: 'light green' + }, + { + h: 35, + s: 1, + b: 0, + name: 'very dark green' + }, + { + h: 35, + s: 1, + b: 0.5, + name: 'dark green' + }, + { + h: 35, + s: 1, + b: 1, + name: 'green' + }, + { + h: 40, + s: 0, + b: 1, + name: 'very light green' + }, + { + h: 40, + s: 0.5, + b: 0.5, + name: 'dark green' + }, + { + h: 40, + s: 0.5, + b: 1, + name: 'light green' + }, + { + h: 40, + s: 1, + b: 0.5, + name: 'dark green' + }, + { + h: 40, + s: 1, + b: 1, + name: 'green' + }, + { + h: 45, + s: 0.5, + b: 1, + name: 'light turquoise' + }, + { + h: 45, + s: 1, + b: 0.5, + name: 'dark turquoise' + }, + { + h: 45, + s: 1, + b: 1, + name: 'turquoise' + }, + { + h: 50, + s: 0, + b: 1, + name: 'light sky blue' + }, + { + h: 50, + s: 0.5, + b: 0.5, + name: 'dark cyan' + }, + { + h: 50, + s: 0.5, + b: 1, + name: 'light cyan' + }, + { + h: 50, + s: 1, + b: 0.5, + name: 'dark cyan' + }, + { + h: 50, + s: 1, + b: 1, + name: 'cyan' + }, + { + h: 55, + s: 0, + b: 1, + name: 'light sky blue' + }, + { + h: 55, + s: 0.5, + b: 1, + name: 'light sky blue' + }, + { + h: 55, + s: 1, + b: 0.5, + name: 'dark blue' + }, + { + h: 55, + s: 1, + b: 1, + name: 'sky blue' + }, + { + h: 60, + s: 0, + b: 0.5, + name: 'gray' + }, + { + h: 60, + s: 0, + b: 1, + name: 'very light blue' + }, + { + h: 60, + s: 0.5, + b: 0.5, + name: 'blue' + }, + { + h: 60, + s: 0.5, + b: 1, + name: 'light blue' + }, + { + h: 60, + s: 1, + b: 0.5, + name: 'navy blue' + }, + { + h: 60, + s: 1, + b: 1, + name: 'blue' + }, + { + h: 65, + s: 0, + b: 1, + name: 'lavender' + }, + { + h: 65, + s: 0.5, + b: 0.5, + name: 'navy blue' + }, + { + h: 65, + s: 0.5, + b: 1, + name: 'light purple' + }, + { + h: 65, + s: 1, + b: 0.5, + name: 'dark navy blue' + }, + { + h: 65, + s: 1, + b: 1, + name: 'blue' + }, + { + h: 70, + s: 0, + b: 1, + name: 'lavender' + }, + { + h: 70, + s: 0.5, + b: 0.5, + name: 'navy blue' + }, + { + h: 70, + s: 0.5, + b: 1, + name: 'lavender blue' + }, + { + h: 70, + s: 1, + b: 0.5, + name: 'dark navy blue' + }, + { + h: 70, + s: 1, + b: 1, + name: 'blue' + }, + { + h: 75, + s: 0.5, + b: 1, + name: 'lavender' + }, + { + h: 75, + s: 1, + b: 0.5, + name: 'dark purple' + }, + { + h: 75, + s: 1, + b: 1, + name: 'purple' + }, + { + h: 80, + s: 0.5, + b: 1, + name: 'pinkish purple' + }, + { + h: 80, + s: 1, + b: 0.5, + name: 'dark purple' + }, + { + h: 80, + s: 1, + b: 1, + name: 'purple' + }, + { + h: 85, + s: 0, + b: 1, + name: 'light pink' + }, + { + h: 85, + s: 0.5, + b: 0.5, + name: 'purple' + }, + { + h: 85, + s: 0.5, + b: 1, + name: 'light fuchsia' + }, + { + h: 85, + s: 1, + b: 0.5, + name: 'dark fuchsia' + }, + { + h: 85, + s: 1, + b: 1, + name: 'fuchsia' + }, + { + h: 90, + s: 0.5, + b: 0.5, + name: 'dark fuchsia' + }, + { + h: 90, + s: 0.5, + b: 1, + name: 'hot pink' + }, + { + h: 90, + s: 1, + b: 0.5, + name: 'dark fuchsia' + }, + { + h: 90, + s: 1, + b: 1, + name: 'fuchsia' + }, + { + h: 95, + s: 0, + b: 1, + name: 'pink' + }, + { + h: 95, + s: 0.5, + b: 1, + name: 'light pink' + }, + { + h: 95, + s: 1, + b: 0.5, + name: 'dark magenta' + }, + { + h: 95, + s: 1, + b: 1, + name: 'magenta' + } + ]; + //returns text with color name + function _calculateColor(hsb) { + var colortext; + //round hue + if (hsb[0] !== 0) { + hsb[0] = Math.round(hsb[0] * 100); + var hue = hsb[0].toString().split(''); + var last = hue.length - 1; + hue[last] = parseInt(hue[last]); + //if last digit of hue is < 2.5 make it 0 + if (hue[last] < 2.5) { + hue[last] = 0; + //if last digit of hue is >= 2.5 and less than 7.5 make it 5 + } else if (hue[last] >= 2.5 && hue[last] < 7.5) { + hue[last] = 5; + } //if hue only has two digits + + if (hue.length === 2) { + hue[0] = parseInt(hue[0]); + //if last is greater than 7.5 + if (hue[last] >= 7.5) { + //add one to the tens + hue[last] = 0; + hue[0] = hue[0] + 1; + } + hsb[0] = hue[0] * 10 + hue[1]; + } else { + if (hue[last] >= 7.5) { + hsb[0] = 10; + } else { + hsb[0] = hue[last]; + } + } + } //map brightness from 0 to 1 + + hsb[2] = hsb[2] / 255; + //round saturation and brightness + for (var i = hsb.length - 1; i >= 1; i--) { + if (hsb[i] <= 0.25) { + hsb[i] = 0; + } else if (hsb[i] > 0.25 && hsb[i] < 0.75) { + hsb[i] = 0.5; + } else { + hsb[i] = 1; + } + } //after rounding, if the values are hue 0, saturation 0 and brightness 1 + //look at color exceptions which includes several tones from white to gray + + if (hsb[0] === 0 && hsb[1] === 0 && hsb[2] === 1) { + //round original hsb values + for (var _i = 2; _i >= 0; _i--) { + originalHSB[_i] = Math.round(originalHSB[_i] * 10000) / 10000; + } //compare with the values in the colorExceptions array + + for (var e = 0; e < colorExceptions.length; e++) { + if (colorExceptions[e].h === originalHSB[0] && colorExceptions[e].s === originalHSB[1] && colorExceptions[e].b === originalHSB[2]) { + colortext = colorExceptions[e].name; + break; + } else { + //if there is no match return white + colortext = 'white'; + } + } + } else { + //otherwise, compare with values in colorLookUp + for (var _i2 = 0; _i2 < colorLookUp.length; _i2++) { + if (colorLookUp[_i2].h === hsb[0] && colorLookUp[_i2].s === hsb[1] && colorLookUp[_i2].b === hsb[2]) { + colortext = colorLookUp[_i2].name; + break; + } + } + } + return colortext; + } //gets rgba and returs a color name + + _main.default.prototype._rgbColorName = function (arg) { + //conversts rgba to hsb + var hsb = _color_conversion.default._rgbaToHSBA(arg); + //stores hsb in global variable + originalHSB = hsb; + //calculate color name + return _calculateColor([hsb[0], + hsb[1], + hsb[2]]); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../color/color_conversion': 282, + '../core/main': 298, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.split': 216 + } + ], + 277: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.ends-with'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.ends-with'); + _dereq_('core-js/modules/es.string.replace'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + + var descContainer = '_Description'; //Fallback container + var fallbackDescId = '_fallbackDesc'; //Fallback description + var fallbackTableId = '_fallbackTable'; //Fallback Table + var fallbackTableElId = '_fte_'; //Fallback Table Element + var labelContainer = '_Label'; //Label container + var labelDescId = '_labelDesc'; //Label description + var labelTableId = '_labelTable'; //Label Table + var labelTableElId = '_lte_'; //Label Table Element + /** + * Creates a screen reader-accessible description for the canvas. + * + * The first parameter, `text`, is the description of the canvas. + * + * The second parameter, `display`, is optional. It determines how the + * description is displayed. If `LABEL` is passed, as in + * `describe('A description.', LABEL)`, the description will be visible in + * a div element next to the canvas. If `FALLBACK` is passed, as in + * `describe('A description.', FALLBACK)`, the description will only be + * visible to screen readers. This is the default mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method describe + * @param {String} text description of the canvas. + * @param {Constant} [display] either LABEL or FALLBACK. + * + * @example + *
                          + * + * function setup() { + * background('pink'); + * + * // Draw a heart. + * fill('red'); + * noStroke(); + * circle(67, 67, 20); + * circle(83, 67, 20); + * triangle(91, 73, 75, 95, 59, 73); + * + * // Add a general description of the canvas. + * describe('A pink square with a red heart in the bottom-right corner.'); + * } + * + *
                          + * + *
                          + * + * function setup() { + * background('pink'); + * + * // Draw a heart. + * fill('red'); + * noStroke(); + * circle(67, 67, 20); + * circle(83, 67, 20); + * triangle(91, 73, 75, 95, 59, 73); + * + * // Add a general description of the canvas + * // and display it for debugging. + * describe('A pink square with a red heart in the bottom-right corner.', LABEL); + * } + * + *
                          + * + *
                          + * + * function draw() { + * background(200); + * + * // The expression + * // frameCount % 100 + * // causes x to increase from 0 + * // to 99, then restart from 0. + * let x = frameCount % 100; + * + * // Draw the circle. + * fill(0, 255, 0); + * circle(x, 50, 40); + * + * // Add a general description of the canvas. + * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`); + * } + * + *
                          + * + *
                          + * + * function draw() { + * background(200); + * + * // The expression + * // frameCount % 100 + * // causes x to increase from 0 + * // to 99, then restart from 0. + * let x = frameCount % 100; + * + * // Draw the circle. + * fill(0, 255, 0); + * circle(x, 50, 40); + * + * // Add a general description of the canvas + * // and display it for debugging. + * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); + * } + * + *
                          + */ + _main.default.prototype.describe = function (text, display) { + _main.default._validateParameters('describe', arguments); + if (typeof text !== 'string') { + return; + } + var cnvId = this.canvas.id; + //calls function that adds punctuation for better screen reading + text = _descriptionText(text); + //if there is no dummyDOM + if (!this.dummyDOM) { + this.dummyDOM = document.getElementById(cnvId).parentNode; + } + if (!this.descriptions) { + this.descriptions = { + }; + } //check if html structure for description is ready + + if (this.descriptions.fallback) { + //check if text is different from current description + if (this.descriptions.fallback.innerHTML !== text) { + //update description + this.descriptions.fallback.innerHTML = text; + } + } else { + //create fallback html structure + this._describeHTML('fallback', text); + } //if display is LABEL + + if (display === this.LABEL) { + //check if html structure for label is ready + if (this.descriptions.label) { + //check if text is different from current label + if (this.descriptions.label.innerHTML !== text) { + //update label description + this.descriptions.label.innerHTML = text; + } + } else { + //create label html structure + this._describeHTML('label', text); + } + } + }; + /** + * Creates a screen reader-accessible description for elements in the canvas. + * Elements are shapes or groups of shapes that create meaning together. + * + * The first parameter, `name`, is the name of the element. + * + * The second parameter, `text`, is the description of the element. + * + * The third parameter, `display`, is optional. It determines how the + * description is displayed. If `LABEL` is passed, as in + * `describe('A description.', LABEL)`, the description will be visible in + * a div element next to the canvas. Using `LABEL` creates unhelpful + * duplicates for screen readers. Only use `LABEL` during development. If + * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method describeElement + * @param {String} name name of the element. + * @param {String} text description of the element. + * @param {Constant} [display] either LABEL or FALLBACK. + * + * @example + *
                          + * + * function setup() { + * background('pink'); + * + * // Describe the first element + * // and draw it. + * describeElement('Circle', 'A yellow circle in the top-left corner.'); + * noStroke(); + * fill('yellow'); + * circle(25, 25, 40); + * + * // Describe the second element + * // and draw it. + * describeElement('Heart', 'A red heart in the bottom-right corner.'); + * fill('red'); + * circle(66.6, 66.6, 20); + * circle(83.2, 66.6, 20); + * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * + * // Add a general description of the canvas. + * describe('A red heart and yellow circle over a pink background.'); + * } + * + *
                          + * + *
                          + * + * function setup() { + * background('pink'); + * + * // Describe the first element + * // and draw it. Display the + * // description for debugging. + * describeElement('Circle', 'A yellow circle in the top-left corner.', LABEL); + * noStroke(); + * fill('yellow'); + * circle(25, 25, 40); + * + * // Describe the second element + * // and draw it. Display the + * // description for debugging. + * describeElement('Heart', 'A red heart in the bottom-right corner.', LABEL); + * fill('red'); + * circle(66.6, 66.6, 20); + * circle(83.2, 66.6, 20); + * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); + * + * // Add a general description of the canvas. + * describe('A red heart and yellow circle over a pink background.'); + * } + * + *
                          + */ + _main.default.prototype.describeElement = function (name, text, display) { + _main.default._validateParameters('describeElement', arguments); + if (typeof text !== 'string' || typeof name !== 'string') { + return; + } + var cnvId = this.canvas.id; + //calls function that adds punctuation for better screen reading + text = _descriptionText(text); + //calls function that adds punctuation for better screen reading + var elementName = _elementName(name); + //remove any special characters from name to use it as html id + name = name.replace(/[^a-zA-Z0-9]/g, ''); + //store element description + var inner = ''.concat(elementName, '').concat(text, ''); + //if there is no dummyDOM + if (!this.dummyDOM) { + this.dummyDOM = document.getElementById(cnvId).parentNode; + } + if (!this.descriptions) { + this.descriptions = { + fallbackElements: { + } + }; + } else if (!this.descriptions.fallbackElements) { + this.descriptions.fallbackElements = { + }; + } //check if html structure for element description is ready + + if (this.descriptions.fallbackElements[name]) { + //if current element description is not the same as inner + if (this.descriptions.fallbackElements[name].innerHTML !== inner) { + //update element description + this.descriptions.fallbackElements[name].innerHTML = inner; + } + } else { + //create fallback html structure + this._describeElementHTML('fallback', name, inner); + } //if display is LABEL + + if (display === this.LABEL) { + if (!this.descriptions.labelElements) { + this.descriptions.labelElements = { + }; + } //if html structure for label element description is ready + + if (this.descriptions.labelElements[name]) { + //if label element description is different + if (this.descriptions.labelElements[name].innerHTML !== inner) { + //update label element description + this.descriptions.labelElements[name].innerHTML = inner; + } + } else { + //create label element html structure + this._describeElementHTML('label', name, inner); + } + } + }; + /* + * + * Helper functions for describe() and describeElement(). + * + */ + // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark + function _descriptionText(text) { + if (text === 'label' || text === 'fallback') { + throw new Error('description should not be LABEL or FALLBACK'); + } //if string does not end with '.' + + if (!text.endsWith('.') && !text.endsWith(';') && !text.endsWith(',') && !text.endsWith('?') && !text.endsWith('!')) { + //add '.' to the end of string + text = text + '.'; + } + return text; + } /* + * Helper functions for describe() + */ + //creates HTML structure for canvas descriptions + + _main.default.prototype._describeHTML = function (type, text) { + var cnvId = this.canvas.id; + if (type === 'fallback') { + //if there is no description container + if (!this.dummyDOM.querySelector('#'.concat(cnvId + descContainer))) { + //if there are no accessible outputs (see textOutput() and gridOutput()) + var html = '

                          '); + if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput'))) { + //create description container +

                          for fallback description + this.dummyDOM.querySelector('#'.concat(cnvId)).innerHTML = html; + } else { + //create description container +

                          for fallback description before outputs + this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput')).insertAdjacentHTML('beforebegin', html); + } + } else { + //if describeElement() has already created the container and added a table of elements + //create fallback description

                          before the table + this.dummyDOM.querySelector('#' + cnvId + fallbackTableId).insertAdjacentHTML('beforebegin', '

                          ')); + } //if the container for the description exists + + this.descriptions.fallback = this.dummyDOM.querySelector('#'.concat(cnvId).concat(fallbackDescId)); + this.descriptions.fallback.innerHTML = text; + return; + } else if (type === 'label') { + //if there is no label container + if (!this.dummyDOM.querySelector('#'.concat(cnvId + labelContainer))) { + var _html = '

                          '); + //if there are no accessible outputs (see textOutput() and gridOutput()) + if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel'))) { + //create label container +

                          for label description + this.dummyDOM.querySelector('#' + cnvId).insertAdjacentHTML('afterend', _html); + } else { + //create label container +

                          for label description before outputs + this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel')).insertAdjacentHTML('beforebegin', _html); + } + } else if (this.dummyDOM.querySelector('#'.concat(cnvId + labelTableId))) { + //if describeElement() has already created the container and added a table of elements + //create label description

                          before the table + this.dummyDOM.querySelector('#'.concat(cnvId + labelTableId)).insertAdjacentHTML('beforebegin', '

                          ')); + } + this.descriptions.label = this.dummyDOM.querySelector('#' + cnvId + labelDescId); + this.descriptions.label.innerHTML = text; + return; + } + }; + /* + * Helper functions for describeElement(). + */ + //check that name is not LABEL or FALLBACK and ensure text ends with colon + function _elementName(name) { + if (name === 'label' || name === 'fallback') { + throw new Error('element name should not be LABEL or FALLBACK'); + } //check if last character of string n is '.', ';', or ',' + + if (name.endsWith('.') || name.endsWith(';') || name.endsWith(',')) { + //replace last character with ':' + name = name.replace(/.$/, ':'); + } else if (!name.endsWith(':')) { + //if string n does not end with ':' + //add ':'' at the end of string + name = name + ':'; + } + return name; + } //creates HTML structure for element descriptions + + _main.default.prototype._describeElementHTML = function (type, name, text) { + var cnvId = this.canvas.id; + if (type === 'fallback') { + //if there is no description container + if (!this.dummyDOM.querySelector('#'.concat(cnvId + descContainer))) { + //if there are no accessible outputs (see textOutput() and gridOutput()) + var html = '
                          Canvas elements and their descriptions
                          '); + if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput'))) { + //create container + table for element descriptions + this.dummyDOM.querySelector('#' + cnvId).innerHTML = html; + } else { + //create container + table for element descriptions before outputs + this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutput')).insertAdjacentHTML('beforebegin', html); + } + } else if (!this.dummyDOM.querySelector('#' + cnvId + fallbackTableId)) { + //if describe() has already created the container and added a description + //and there is no table create fallback table for element description after + //fallback description + this.dummyDOM.querySelector('#' + cnvId + fallbackDescId).insertAdjacentHTML('afterend', '
                          Canvas elements and their descriptions
                          ')); + } //create a table row for the element + + var tableRow = document.createElement('tr'); + tableRow.id = cnvId + fallbackTableElId + name; + this.dummyDOM.querySelector('#' + cnvId + fallbackTableId).appendChild(tableRow); + //update element description + this.descriptions.fallbackElements[name] = this.dummyDOM.querySelector('#'.concat(cnvId).concat(fallbackTableElId).concat(name)); + this.descriptions.fallbackElements[name].innerHTML = text; + return; + } else if (type === 'label') { + //If display is LABEL creates a div adjacent to the canvas element with + //a table, a row header cell with the name of the elements, + //and adds the description of the element in adjecent cell. + //if there is no label description container + if (!this.dummyDOM.querySelector('#'.concat(cnvId + labelContainer))) { + //if there are no accessible outputs (see textOutput() and gridOutput()) + var _html2 = '
                          '); + if (!this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel'))) { + //create container + table for element descriptions + this.dummyDOM.querySelector('#' + cnvId).insertAdjacentHTML('afterend', _html2); + } else { + //create container + table for element descriptions before outputs + this.dummyDOM.querySelector('#'.concat(cnvId, 'accessibleOutputLabel')).insertAdjacentHTML('beforebegin', _html2); + } + } else if (!this.dummyDOM.querySelector('#'.concat(cnvId + labelTableId))) { + //if describe() has already created the label container and added a description + //and there is no table create label table for element description after + //label description + this.dummyDOM.querySelector('#' + cnvId + labelDescId).insertAdjacentHTML('afterend', '
                          ')); + } //create a table row for the element label description + + var _tableRow = document.createElement('tr'); + _tableRow.id = cnvId + labelTableElId + name; + this.dummyDOM.querySelector('#' + cnvId + labelTableId).appendChild(_tableRow); + //update element label description + this.descriptions.labelElements[name] = this.dummyDOM.querySelector('#'.concat(cnvId).concat(labelTableElId).concat(name)); + this.descriptions.labelElements[name].innerHTML = text; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.ends-with': 208, + 'core-js/modules/es.string.replace': 214 + } + ], + 278: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.string.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + //the functions in this file support updating the grid output + //updates gridOutput + + _main.default.prototype._updateGridOutput = function (idT) { + //if html structure is not there yet + if (!this.dummyDOM.querySelector('#'.concat(idT, '_summary'))) { + return; + } + var current = this._accessibleOutputs[idT]; + //create shape details list + var innerShapeDetails = _gridShapeDetails(idT, this.ingredients.shapes); + //create summary + var innerSummary = _gridSummary(innerShapeDetails.numShapes, this.ingredients.colors.background, this.width, this.height); + //create grid map + var innerMap = _gridMap(idT, this.ingredients.shapes); + //if it is different from current summary + if (innerSummary !== current.summary.innerHTML) { + //update + current.summary.innerHTML = innerSummary; + } //if it is different from current map + + if (innerMap !== current.map.innerHTML) { + //update + current.map.innerHTML = innerMap; + } //if it is different from current shape details + + if (innerShapeDetails.details !== current.shapeDetails.innerHTML) { + //update + current.shapeDetails.innerHTML = innerShapeDetails.details; + } + this._accessibleOutputs[idT] = current; + }; + //creates spatial grid that maps the location of shapes + function _gridMap(idT, ingredients) { + var shapeNumber = 0; + var table = ''; + //create an array of arrays 10*10 of empty cells + var cells = Array.from(Array(10), function () { + return Array(10); + }); + for (var x in ingredients) { + for (var y in ingredients[x]) { + var fill = void 0; + if (x !== 'line') { + fill = '').concat(ingredients[x][y].color, ' ').concat(x, ''); + } else { + fill = '').concat(ingredients[x][y].color, ' ').concat(x, ' midpoint'); + } //if empty cell of location of shape is undefined + + if (!cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX]) { + //fill it with shape info + cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] = fill; + //if a shape is already in that location + } else { + //add it + cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] = cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] + ' ' + fill; + } + shapeNumber++; + } + } //make table based on array + + for (var _r in cells) { + var row = ''; + for (var c in cells[_r]) { + row = row + ''; + if (cells[_r][c] !== undefined) { + row = row + cells[_r][c]; + } + row = row + ''; + } + table = table + row + ''; + } + return table; + } //creates grid summary + + function _gridSummary(numShapes, background, width, height) { + var text = ''.concat(background, ' canvas, ').concat(width, ' by ').concat(height, ' pixels, contains ').concat(numShapes[0]); + if (numShapes[0] === 1) { + text = ''.concat(text, ' shape: ').concat(numShapes[1]); + } else { + text = ''.concat(text, ' shapes: ').concat(numShapes[1]); + } + return text; + } //creates list of shapes + + function _gridShapeDetails(idT, ingredients) { + var shapeDetails = ''; + var shapes = ''; + var totalShapes = 0; + //goes trhough every shape type in ingredients + for (var x in ingredients) { + var shapeNum = 0; + for (var y in ingredients[x]) { + //it creates a line in a list + var line = '
                        • ').concat(ingredients[x][y].color, ' ').concat(x, ','); + if (x === 'line') { + line = line + ' location = '.concat(ingredients[x][y].pos, ', length = ').concat(ingredients[x][y].length, ' pixels'); + } else { + line = line + ' location = '.concat(ingredients[x][y].pos); + if (x !== 'point') { + line = line + ', area = '.concat(ingredients[x][y].area, ' %'); + } + line = line + '
                        • '; + } + shapeDetails = shapeDetails + line; + shapeNum++; + totalShapes++; + } + if (shapeNum > 1) { + shapes = ''.concat(shapes, ' ').concat(shapeNum, ' ').concat(x, 's'); + } else { + shapes = ''.concat(shapes, ' ').concat(shapeNum, ' ').concat(x); + } + } + return { + numShapes: [ + totalShapes, + shapes + ], + details: shapeDetails + }; + } + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.string.iterator': 210 + } + ], + 279: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.number.to-fixed'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + /** + * Creates a screen reader-accessible description for shapes on the canvas. + * `textOutput()` adds a general description, list of shapes, and + * table of shapes to the web page. + * + * The general description includes the canvas size, canvas color, and number + * of shapes. For example, + * `Your output is a, 100 by 100 pixels, gray canvas containing the following 2 shapes:`. + * + * A list of shapes follows the general description. The list describes the + * color, location, and area of each shape. For example, + * `a red circle at middle covering 3% of the canvas`. Each shape can be + * selected to get more details. + * + * `textOutput()` uses its table of shapes as a list. The table describes the + * shape, color, location, coordinates and area. For example, + * `red circle location = middle area = 3%`. This is different from + * gridOutput(), which uses its table as a grid. + * + * The `display` parameter is optional. It determines how the description is + * displayed. If `LABEL` is passed, as in `textOutput(LABEL)`, the description + * will be visible in a div element next to the canvas. Using `LABEL` creates + * unhelpful duplicates for screen readers. Only use `LABEL` during + * development. If `FALLBACK` is passed, as in `textOutput(FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method textOutput + * @param {Constant} [display] either FALLBACK or LABEL. + * + * @example + *
                          + * + * function setup() { + * // Add the text description. + * textOutput(); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                          + * + *
                          + * + * function setup() { + * // Add the text description and + * // display it for debugging. + * textOutput(LABEL); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                          + * + *
                          + * + * function draw() { + * // Add the text description. + * textOutput(); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                          + * + *
                          + * + * function draw() { + * // Add the text description and + * // display it for debugging. + * textOutput(LABEL); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                          + */ + + _main.default.prototype.textOutput = function (display) { + _main.default._validateParameters('textOutput', arguments); + //if textOutput is already true + if (this._accessibleOutputs.text) { + return; + } else { + //make textOutput true + this._accessibleOutputs.text = true; + //create output for fallback + this._createOutput('textOutput', 'Fallback'); + if (display === this.LABEL) { + //make textOutput label true + this._accessibleOutputs.textLabel = true; + //create output for label + this._createOutput('textOutput', 'Label'); + } + } + }; + /** + * Creates a screen reader-accessible description for shapes on the canvas. + * `gridOutput()` adds a general description, table of shapes, and list of + * shapes to the web page. + * + * The general description includes the canvas size, canvas color, and number of + * shapes. For example, + * `gray canvas, 100 by 100 pixels, contains 2 shapes: 1 circle 1 square`. + * + * `gridOutput()` uses its table of shapes as a grid. Each shape in the grid + * is placed in a cell whose row and column correspond to the shape's location + * on the canvas. The grid cells describe the color and type of shape at that + * location. For example, `red circle`. These descriptions can be selected + * individually to get more details. This is different from + * textOutput(), which uses its table as a list. + * + * A list of shapes follows the table. The list describes the color, type, + * location, and area of each shape. For example, + * `red circle, location = middle, area = 3 %`. + * + * The `display` parameter is optional. It determines how the description is + * displayed. If `LABEL` is passed, as in `gridOutput(LABEL)`, the description + * will be visible in a div element next to the canvas. Using `LABEL` creates + * unhelpful duplicates for screen readers. Only use `LABEL` during + * development. If `FALLBACK` is passed, as in `gridOutput(FALLBACK)`, the + * description will only be visible to screen readers. This is the default + * mode. + * + * Read + * How to label your p5.js code to + * learn more about making sketches accessible. + * + * @method gridOutput + * @param {Constant} [display] either FALLBACK or LABEL. + * + * @example + *
                          + * + * function setup() { + * // Add the grid description. + * gridOutput(); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                          + * + *
                          + * + * function setup() { + * // Add the grid description and + * // display it for debugging. + * gridOutput(LABEL); + * + * // Draw a couple of shapes. + * background(200); + * fill(255, 0, 0); + * circle(20, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle and a blue square on a gray background.'); + * } + * + *
                          + * + *
                          + * + * function draw() { + * // Add the grid description. + * gridOutput(); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                          + * + *
                          + * + * function draw() { + * // Add the grid description and + * // display it for debugging. + * gridOutput(LABEL); + * + * // Draw a moving circle. + * background(200); + * let x = frameCount * 0.1; + * fill(255, 0, 0); + * circle(x, 20, 20); + * fill(0, 0, 255); + * square(50, 50, 50); + * + * // Add a general description of the canvas. + * describe('A red circle moves from left to right above a blue square.'); + * } + * + *
                          + */ + _main.default.prototype.gridOutput = function (display) { + _main.default._validateParameters('gridOutput', arguments); + //if gridOutput is already true + if (this._accessibleOutputs.grid) { + return; + } else { + //make gridOutput true + this._accessibleOutputs.grid = true; + //create output for fallback + this._createOutput('gridOutput', 'Fallback'); + if (display === this.LABEL) { + //make gridOutput label true + this._accessibleOutputs.gridLabel = true; + //create output for label + this._createOutput('gridOutput', 'Label'); + } + } + }; + //helper function returns true when accessible outputs are true + _main.default.prototype._addAccsOutput = function () { + //if there are no accessible outputs create object with all false + if (!this._accessibleOutputs) { + this._accessibleOutputs = { + text: false, + grid: false, + textLabel: false, + gridLabel: false + }; + } + return this._accessibleOutputs.grid || this._accessibleOutputs.text; + }; + //helper function that creates html structure for accessible outputs + _main.default.prototype._createOutput = function (type, display) { + var cnvId = this.canvas.id; + //if there are no ingredients create object. this object stores data for the outputs + if (!this.ingredients) { + this.ingredients = { + shapes: { + }, + colors: { + background: 'white', + fill: 'white', + stroke: 'black' + }, + pShapes: '' + }; + } //if there is no dummyDOM create it + + if (!this.dummyDOM) { + this.dummyDOM = document.getElementById(cnvId).parentNode; + } + var cIdT, + container, + inner; + var query = ''; + if (display === 'Fallback') { + cIdT = cnvId + type; + container = cnvId + 'accessibleOutput'; + if (!this.dummyDOM.querySelector('#'.concat(container))) { + //if there is no canvas description (see describe() and describeElement()) + if (!this.dummyDOM.querySelector('#'.concat(cnvId, '_Description'))) { + //create html structure inside of canvas + this.dummyDOM.querySelector('#'.concat(cnvId)).innerHTML = '
                          '); + } else { + //create html structure after canvas description container + this.dummyDOM.querySelector('#'.concat(cnvId, '_Description')).insertAdjacentHTML('afterend', '
                          ')); + } + } + } else if (display === 'Label') { + query = display; + cIdT = cnvId + type + display; + container = cnvId + 'accessibleOutput' + display; + if (!this.dummyDOM.querySelector('#'.concat(container))) { + //if there is no canvas description label (see describe() and describeElement()) + if (!this.dummyDOM.querySelector('#'.concat(cnvId, '_Label'))) { + //create html structure adjacent to canvas + this.dummyDOM.querySelector('#'.concat(cnvId)).insertAdjacentHTML('afterend', '
                          ')); + } else { + //create html structure after canvas label + this.dummyDOM.querySelector('#'.concat(cnvId, '_Label')).insertAdjacentHTML('afterend', '
                          ')); + } + } + } //create an object to store the latest output. this object is used in _updateTextOutput() and _updateGridOutput() + + this._accessibleOutputs[cIdT] = { + }; + if (type === 'textOutput') { + query = '#'.concat(cnvId, 'gridOutput').concat(query); //query is used to check if gridOutput already exists + inner = '
                          Text Output

                            '); + //if gridOutput already exists + if (this.dummyDOM.querySelector(query)) { + //create textOutput before gridOutput + this.dummyDOM.querySelector(query).insertAdjacentHTML('beforebegin', inner); + } else { + //create output inside of container + this.dummyDOM.querySelector('#'.concat(container)).innerHTML = inner; + } //store output html elements + + this._accessibleOutputs[cIdT].list = this.dummyDOM.querySelector('#'.concat(cIdT, '_list')); + } else if (type === 'gridOutput') { + query = '#'.concat(cnvId, 'textOutput').concat(query); //query is used to check if textOutput already exists + inner = '
                            Grid Output

                              '); + //if textOutput already exists + if (this.dummyDOM.querySelector(query)) { + //create gridOutput after textOutput + this.dummyDOM.querySelector(query).insertAdjacentHTML('afterend', inner); + } else { + //create output inside of container + this.dummyDOM.querySelector('#'.concat(container)).innerHTML = inner; + } //store output html elements + + this._accessibleOutputs[cIdT].map = this.dummyDOM.querySelector('#'.concat(cIdT, '_map')); + } + this._accessibleOutputs[cIdT].shapeDetails = this.dummyDOM.querySelector('#'.concat(cIdT, '_shapeDetails')); + this._accessibleOutputs[cIdT].summary = this.dummyDOM.querySelector('#'.concat(cIdT, '_summary')); + }; + //this function is called at the end of setup and draw if using + //accessibleOutputs and calls update functions of outputs + _main.default.prototype._updateAccsOutput = function () { + var cnvId = this.canvas.id; + //if the shapes are not the same as before + if (JSON.stringify(this.ingredients.shapes) !== this.ingredients.pShapes) { + //save current shapes as string in pShapes + this.ingredients.pShapes = JSON.stringify(this.ingredients.shapes); + if (this._accessibleOutputs.text) { + this._updateTextOutput(cnvId + 'textOutput'); + } + if (this._accessibleOutputs.grid) { + this._updateGridOutput(cnvId + 'gridOutput'); + } + if (this._accessibleOutputs.textLabel) { + this._updateTextOutput(cnvId + 'textOutputLabel'); + } + if (this._accessibleOutputs.gridLabel) { + this._updateGridOutput(cnvId + 'gridOutputLabel'); + } + } + }; + //helper function that resets all ingredients when background is called + //and saves background color name + _main.default.prototype._accsBackground = function (args) { + //save current shapes as string in pShapes + this.ingredients.pShapes = JSON.stringify(this.ingredients.shapes); + //empty shapes JSON + this.ingredients.shapes = { + }; + //update background different + if (this.ingredients.colors.backgroundRGBA !== args) { + this.ingredients.colors.backgroundRGBA = args; + this.ingredients.colors.background = this._rgbColorName(args); + } + }; + //helper function that gets fill and stroke of shapes + _main.default.prototype._accsCanvasColors = function (f, args) { + if (f === 'fill') { + //update fill different + if (this.ingredients.colors.fillRGBA !== args) { + this.ingredients.colors.fillRGBA = args; + this.ingredients.colors.fill = this._rgbColorName(args); + } + } else if (f === 'stroke') { + //update stroke if different + if (this.ingredients.colors.strokeRGBA !== args) { + this.ingredients.colors.strokeRGBA = args; + this.ingredients.colors.stroke = this._rgbColorName(args); + } + } + }; + //builds ingredients.shapes used for building outputs + _main.default.prototype._accsOutput = function (f, args) { + if (f === 'ellipse' && args[2] === args[3]) { + f = 'circle'; + } else if (f === 'rectangle' && args[2] === args[3]) { + f = 'square'; + } + var include = { + }; + var add = true; + var middle = _getMiddle(f, args); + if (f === 'line') { + //make color stroke + include.color = this.ingredients.colors.stroke; + //get lenght + include.length = Math.round(this.dist(args[0], args[1], args[2], args[3])); + //get position of end points + var p1 = this._getPos(args[0], [ + 1 + ]); + var p2 = this._getPos(args[2], [ + 3 + ]); + include.loc = _canvasLocator(middle, this.width, this.height); + if (p1 === p2) { + include.pos = 'at '.concat(p1); + } else { + include.pos = 'from '.concat(p1, ' to ').concat(p2); + } + } else { + if (f === 'point') { + //make color stroke + include.color = this.ingredients.colors.stroke; + } else { + //make color fill + include.color = this.ingredients.colors.fill; + //get area of shape + include.area = this._getArea(f, args); + } //get middle of shapes + //calculate position using middle of shape + + include.pos = this._getPos.apply(this, _toConsumableArray(middle)); + //calculate location using middle of shape + include.loc = _canvasLocator(middle, this.width, this.height); + } //if it is the first time this shape is created + + if (!this.ingredients.shapes[f]) { + this.ingredients.shapes[f] = [ + include + ]; + //if other shapes of this type have been created + } else if (this.ingredients.shapes[f] !== [include]) { + //for every shape of this type + for (var y in this.ingredients.shapes[f]) { + //compare it with current shape and if it already exists make add false + if (JSON.stringify(this.ingredients.shapes[f][y]) === JSON.stringify(include)) { + add = false; + } + } //add shape by pushing it to the end + + if (add === true) { + this.ingredients.shapes[f].push(include); + } + } + }; + //gets middle point / centroid of shape + function _getMiddle(f, args) { + var x, + y; + if (f === 'rectangle' || f === 'ellipse' || f === 'arc' || f === 'circle' || f === 'square') { + x = Math.round(args[0] + args[2] / 2); + y = Math.round(args[1] + args[3] / 2); + } else if (f === 'triangle') { + x = (args[0] + args[2] + args[4]) / 3; + y = (args[1] + args[3] + args[5]) / 3; + } else if (f === 'quadrilateral') { + x = (args[0] + args[2] + args[4] + args[6]) / 4; + y = (args[1] + args[3] + args[5] + args[7]) / 4; + } else if (f === 'line') { + x = (args[0] + args[2]) / 2; + y = (args[1] + args[3]) / 2; + } else { + x = args[0]; + y = args[1]; + } + return [x, + y]; + } //gets position of shape in the canvas + + _main.default.prototype._getPos = function (x, y) { + var untransformedPosition = new DOMPointReadOnly(x, y); + var currentTransform = this._renderer.isP3D ? new DOMMatrix(this._renderer.uMVMatrix.mat4) : this.drawingContext.getTransform(); + var _untransformedPositio = untransformedPosition.matrixTransform(currentTransform), + transformedX = _untransformedPositio.x, + transformedY = _untransformedPositio.y; + var canvasWidth = this.width, + canvasHeight = this.height; + if (transformedX < 0.4 * canvasWidth) { + if (transformedY < 0.4 * canvasHeight) { + return 'top left'; + } else if (transformedY > 0.6 * canvasHeight) { + return 'bottom left'; + } else { + return 'mid left'; + } + } else if (transformedX > 0.6 * canvasWidth) { + if (transformedY < 0.4 * canvasHeight) { + return 'top right'; + } else if (transformedY > 0.6 * canvasHeight) { + return 'bottom right'; + } else { + return 'mid right'; + } + } else { + if (transformedY < 0.4 * canvasHeight) { + return 'top middle'; + } else if (transformedY > 0.6 * canvasHeight) { + return 'bottom middle'; + } else { + return 'middle'; + } + } + }; + //locates shape in a 10*10 grid + function _canvasLocator(args, canvasWidth, canvasHeight) { + var noRows = 10; + var noCols = 10; + var locX = Math.floor(args[0] / canvasWidth * noRows); + var locY = Math.floor(args[1] / canvasHeight * noCols); + if (locX === noRows) { + locX = locX - 1; + } + if (locY === noCols) { + locY = locY - 1; + } + return { + locX: locX, + locY: locY + }; + } //calculates area of shape + + _main.default.prototype._getArea = function (objectType, shapeArgs) { + var objectArea = 0; + if (objectType === 'arc') { + // area of full ellipse = PI * horizontal radius * vertical radius. + // therefore, area of arc = difference bet. arc's start and end radians * horizontal radius * vertical radius. + // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 + var arcSizeInRadians = ((shapeArgs[5] - shapeArgs[4]) % (Math.PI * 2) + Math.PI * 2) % (Math.PI * 2); + objectArea = arcSizeInRadians * shapeArgs[2] * shapeArgs[3] / 8; + if (shapeArgs[6] === 'open' || shapeArgs[6] === 'chord') { + // when the arc's mode is OPEN or CHORD, we need to account for the area of the triangle that is formed to close the arc + // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ) )/2 + var Ax = shapeArgs[0]; + var Ay = shapeArgs[1]; + var Bx = shapeArgs[0] + shapeArgs[2] / 2 * Math.cos(shapeArgs[4]).toFixed(2); + var By = shapeArgs[1] + shapeArgs[3] / 2 * Math.sin(shapeArgs[4]).toFixed(2); + var Cx = shapeArgs[0] + shapeArgs[2] / 2 * Math.cos(shapeArgs[5]).toFixed(2); + var Cy = shapeArgs[1] + shapeArgs[3] / 2 * Math.sin(shapeArgs[5]).toFixed(2); + var areaOfExtraTriangle = Math.abs(Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) / 2; + if (arcSizeInRadians > Math.PI) { + objectArea = objectArea + areaOfExtraTriangle; + } else { + objectArea = objectArea - areaOfExtraTriangle; + } + } + } else if (objectType === 'ellipse' || objectType === 'circle') { + objectArea = 3.14 * shapeArgs[2] / 2 * shapeArgs[3] / 2; + } else if (objectType === 'line') { + objectArea = 0; + } else if (objectType === 'point') { + objectArea = 0; + } else if (objectType === 'quadrilateral') { + // ((x4+x1)*(y4-y1)+(x1+x2)*(y1-y2)+(x2+x3)*(y2-y3)+(x3+x4)*(y3-y4))/2 + objectArea = Math.abs((shapeArgs[6] + shapeArgs[0]) * (shapeArgs[7] - shapeArgs[1]) + (shapeArgs[0] + shapeArgs[2]) * (shapeArgs[1] - shapeArgs[3]) + (shapeArgs[2] + shapeArgs[4]) * (shapeArgs[3] - shapeArgs[5]) + (shapeArgs[4] + shapeArgs[6]) * (shapeArgs[5] - shapeArgs[7])) / 2; + } else if (objectType === 'rectangle' || objectType === 'square') { + objectArea = shapeArgs[2] * shapeArgs[3]; + } else if (objectType === 'triangle') { + objectArea = Math.abs(shapeArgs[0] * (shapeArgs[3] - shapeArgs[5]) + shapeArgs[2] * (shapeArgs[5] - shapeArgs[1]) + shapeArgs[4] * (shapeArgs[1] - shapeArgs[3])) / 2; + // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ))/2 + } // Store the positions of the canvas corners + + var canvasWidth = this.width * this._pixelDensity; + var canvasHeight = this.height * this._pixelDensity; + var canvasCorners = [ + new DOMPoint(0, 0), + new DOMPoint(canvasWidth, 0), + new DOMPoint(canvasWidth, canvasHeight), + new DOMPoint(0, canvasHeight) + ]; + // Apply the inverse of the current transformations to the canvas corners + var currentTransform = this._renderer.isP3D ? new DOMMatrix(this._renderer.uMVMatrix.mat4) : this.drawingContext.getTransform(); + var invertedTransform = currentTransform.inverse(); + var tc = canvasCorners.map(function (corner) { + return corner.matrixTransform(invertedTransform); + }); + /* Use same shoelace formula used for quad area (above) to calculate + the area of the canvas with inverted transformation applied */ + var transformedCanvasArea = Math.abs((tc[3].x + tc[0].x) * (tc[3].y - tc[0].y) + (tc[0].x + tc[1].x) * (tc[0].y - tc[1].y) + (tc[1].x + tc[2].x) * (tc[1].y - tc[2].y) + (tc[2].x + tc[3].x) * (tc[2].y - tc[3].y)) / 2; + /* Compare area of shape (minus transformations) to area of canvas + with inverted transformation applied. + Return percentage */ + var untransformedArea = Math.round(objectArea * 100 / transformedCanvasArea); + return untransformedArea; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.number.to-fixed': 193, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 280: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.concat'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + */ + //the functions in this file support updating the text output + //updates textOutput + + _main.default.prototype._updateTextOutput = function (idT) { + //if html structure is not there yet + if (!this.dummyDOM.querySelector('#'.concat(idT, '_summary'))) { + return; + } + var current = this._accessibleOutputs[idT]; + //create shape list + var innerList = _shapeList(idT, this.ingredients.shapes); + //create output summary + var innerSummary = _textSummary(innerList.numShapes, this.ingredients.colors.background, this.width, this.height); + //create shape details + var innerShapeDetails = _shapeDetails(idT, this.ingredients.shapes); + //if it is different from current summary + if (innerSummary !== current.summary.innerHTML) { + //update + current.summary.innerHTML = innerSummary; + } //if it is different from current shape list + + if (innerList.listShapes !== current.list.innerHTML) { + //update + current.list.innerHTML = innerList.listShapes; + } //if it is different from current shape details + + if (innerShapeDetails !== current.shapeDetails.innerHTML) { + //update + current.shapeDetails.innerHTML = innerShapeDetails; + } + this._accessibleOutputs[idT] = current; + }; + //Builds textOutput summary + function _textSummary(numShapes, background, width, height) { + var text = 'Your output is a, '.concat(width, ' by ').concat(height, ' pixels, ').concat(background, ' canvas containing the following'); + if (numShapes === 1) { + text = ''.concat(text, ' shape:'); + } else { + text = ''.concat(text, ' ').concat(numShapes, ' shapes:'); + } + return text; + } //Builds textOutput table with shape details + + function _shapeDetails(idT, ingredients) { + var shapeDetails = ''; + var shapeNumber = 0; + //goes trhough every shape type in ingredients + for (var x in ingredients) { + //and for every shape + for (var y in ingredients[x]) { + //it creates a table row + var row = '').concat(ingredients[x][y].color, ' ').concat(x, ''); + if (x === 'line') { + row = row + 'location = '.concat(ingredients[x][y].pos, 'length = ').concat(ingredients[x][y].length, ' pixels'); + } else { + row = row + 'location = '.concat(ingredients[x][y].pos, ''); + if (x !== 'point') { + row = row + ' area = '.concat(ingredients[x][y].area, '%'); + } + row = row + ''; + } + shapeDetails = shapeDetails + row; + shapeNumber++; + } + } + return shapeDetails; + } //Builds textOutput shape list + + function _shapeList(idT, ingredients) { + var shapeList = ''; + var shapeNumber = 0; + //goes trhough every shape type in ingredients + for (var x in ingredients) { + for (var y in ingredients[x]) { + //it creates a line in a list + var _line = '
                            • ').concat(ingredients[x][y].color, ' ').concat(x, ''); + if (x === 'line') { + _line = _line + ', '.concat(ingredients[x][y].pos, ', ').concat(ingredients[x][y].length, ' pixels long.
                            • '); + } else { + _line = _line + ', at '.concat(ingredients[x][y].pos); + if (x !== 'point') { + _line = _line + ', covering '.concat(ingredients[x][y].area, '% of the canvas'); + } + _line = _line + '.'; + } + shapeList = shapeList + _line; + shapeNumber++; + } + } + return { + numShapes: shapeNumber, + listShapes: shapeList + }; + } + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169 + } + ], + 281: [ + function (_dereq_, module, exports) { + 'use strict'; + var _main = _interopRequireDefault(_dereq_('./core/main')); + _dereq_('./core/constants'); + _dereq_('./core/environment'); + _dereq_('./core/friendly_errors/stacktrace'); + _dereq_('./core/friendly_errors/validate_params'); + _dereq_('./core/friendly_errors/file_errors'); + _dereq_('./core/friendly_errors/fes_core'); + _dereq_('./core/friendly_errors/sketch_reader'); + _dereq_('./core/helpers'); + _dereq_('./core/legacy'); + _dereq_('./core/preload'); + _dereq_('./core/p5.Element'); + _dereq_('./core/p5.Graphics'); + _dereq_('./core/p5.Renderer'); + _dereq_('./core/p5.Renderer2D'); + _dereq_('./core/rendering'); + _dereq_('./core/shim'); + _dereq_('./core/structure'); + _dereq_('./core/transform'); + _dereq_('./core/shape/2d_primitives'); + _dereq_('./core/shape/attributes'); + _dereq_('./core/shape/curves'); + _dereq_('./core/shape/vertex'); + _dereq_('./accessibility/outputs'); + _dereq_('./accessibility/textOutput'); + _dereq_('./accessibility/gridOutput'); + _dereq_('./accessibility/color_namer'); + _dereq_('./color/color_conversion'); + _dereq_('./color/creating_reading'); + _dereq_('./color/p5.Color'); + _dereq_('./color/setting'); + _dereq_('./data/p5.TypedDict'); + _dereq_('./data/local_storage.js'); + _dereq_('./dom/dom'); + _dereq_('./accessibility/describe'); + _dereq_('./events/acceleration'); + _dereq_('./events/keyboard'); + _dereq_('./events/mouse'); + _dereq_('./events/touch'); + _dereq_('./image/filters'); + _dereq_('./image/image'); + _dereq_('./image/loading_displaying'); + _dereq_('./image/p5.Image'); + _dereq_('./image/pixels'); + _dereq_('./io/files'); + _dereq_('./io/p5.Table'); + _dereq_('./io/p5.TableRow'); + _dereq_('./io/p5.XML'); + _dereq_('./math/calculation'); + _dereq_('./math/math'); + _dereq_('./math/noise'); + _dereq_('./math/p5.Vector'); + _dereq_('./math/random'); + _dereq_('./math/trigonometry'); + _dereq_('./typography/attributes'); + _dereq_('./typography/loading_displaying'); + _dereq_('./typography/p5.Font'); + _dereq_('./utilities/array_functions'); + _dereq_('./utilities/conversion'); + _dereq_('./utilities/string_functions'); + _dereq_('./utilities/time_date'); + _dereq_('./webgl/3d_primitives'); + _dereq_('./webgl/interaction'); + _dereq_('./webgl/light'); + _dereq_('./webgl/loading'); + _dereq_('./webgl/material'); + _dereq_('./webgl/p5.Camera'); + _dereq_('./webgl/p5.DataArray'); + _dereq_('./webgl/p5.Geometry'); + _dereq_('./webgl/p5.Matrix'); + _dereq_('./webgl/p5.RendererGL.Immediate'); + _dereq_('./webgl/p5.RendererGL'); + _dereq_('./webgl/p5.RendererGL.Retained'); + _dereq_('./webgl/p5.Framebuffer'); + _dereq_('./webgl/p5.Shader'); + _dereq_('./webgl/p5.RenderBuffer'); + _dereq_('./webgl/p5.Texture'); + _dereq_('./webgl/text'); + _dereq_('./core/init'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } // core + //accessibility + // color + // data + // DOM + // accessibility + // events + // image + // io + // math + // typography + // utilities + // webgl + + module.exports = _main.default; + }, + { + './accessibility/color_namer': 276, + './accessibility/describe': 277, + './accessibility/gridOutput': 278, + './accessibility/outputs': 279, + './accessibility/textOutput': 280, + './color/color_conversion': 282, + './color/creating_reading': 283, + './color/p5.Color': 284, + './color/setting': 285, + './core/constants': 286, + './core/environment': 287, + './core/friendly_errors/fes_core': 289, + './core/friendly_errors/file_errors': 290, + './core/friendly_errors/sketch_reader': 291, + './core/friendly_errors/stacktrace': 292, + './core/friendly_errors/validate_params': 293, + './core/helpers': 294, + './core/init': 295, + './core/legacy': 297, + './core/main': 298, + './core/p5.Element': 299, + './core/p5.Graphics': 300, + './core/p5.Renderer': 301, + './core/p5.Renderer2D': 302, + './core/preload': 303, + './core/rendering': 304, + './core/shape/2d_primitives': 305, + './core/shape/attributes': 306, + './core/shape/curves': 307, + './core/shape/vertex': 308, + './core/shim': 309, + './core/structure': 310, + './core/transform': 311, + './data/local_storage.js': 312, + './data/p5.TypedDict': 313, + './dom/dom': 314, + './events/acceleration': 315, + './events/keyboard': 316, + './events/mouse': 317, + './events/touch': 318, + './image/filters': 319, + './image/image': 320, + './image/loading_displaying': 321, + './image/p5.Image': 322, + './image/pixels': 323, + './io/files': 324, + './io/p5.Table': 325, + './io/p5.TableRow': 326, + './io/p5.XML': 327, + './math/calculation': 328, + './math/math': 329, + './math/noise': 330, + './math/p5.Vector': 331, + './math/random': 332, + './math/trigonometry': 333, + './typography/attributes': 334, + './typography/loading_displaying': 335, + './typography/p5.Font': 336, + './utilities/array_functions': 337, + './utilities/conversion': 338, + './utilities/string_functions': 339, + './utilities/time_date': 340, + './webgl/3d_primitives': 341, + './webgl/interaction': 343, + './webgl/light': 344, + './webgl/loading': 345, + './webgl/material': 346, + './webgl/p5.Camera': 347, + './webgl/p5.DataArray': 348, + './webgl/p5.Framebuffer': 349, + './webgl/p5.Geometry': 350, + './webgl/p5.Matrix': 351, + './webgl/p5.RenderBuffer': 352, + './webgl/p5.RendererGL': 355, + './webgl/p5.RendererGL.Immediate': 353, + './webgl/p5.RendererGL.Retained': 354, + './webgl/p5.Shader': 356, + './webgl/p5.Texture': 357, + './webgl/text': 358 + } + ], + 282: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Color + * @submodule Color Conversion + * @for p5 + * @requires core + */ + /** + * Conversions adapted from . + * + * In these functions, hue is always in the range [0, 1], just like all other + * components are in the range [0, 1]. 'Brightness' and 'value' are used + * interchangeably. + */ + + _main.default.ColorConversion = { + /** + * Convert an HSBA array to HSLA. + */ + _hsbaToHSLA: function _hsbaToHSLA(hsba) { + var hue = hsba[0]; + var sat = hsba[1]; + var val = hsba[2]; + // Calculate lightness. + var li = (2 - sat) * val / 2; + // Convert saturation. + if (li !== 0) { + if (li === 1) { + sat = 0; + } else if (li < 0.5) { + sat = sat / (2 - sat); + } else { + sat = sat * val / (2 - li * 2); + } + } // Hue and alpha stay the same. + + return [hue, + sat, + li, + hsba[3]]; + }, + /** + * Convert an HSBA array to RGBA. + */ + _hsbaToRGBA: function _hsbaToRGBA(hsba) { + var hue = hsba[0] * 6; // We will split hue into 6 sectors. + var sat = hsba[1]; + var val = hsba[2]; + var RGBA = [ + ]; + if (sat === 0) { + RGBA = [ + val, + val, + val, + hsba[3] + ]; // Return early if grayscale. + } else { + var sector = Math.floor(hue); + var tint1 = val * (1 - sat); + var tint2 = val * (1 - sat * (hue - sector)); + var tint3 = val * (1 - sat * (1 + sector - hue)); + var red, + green, + blue; + if (sector === 1) { + // Yellow to green. + red = tint2; + green = val; + blue = tint1; + } else if (sector === 2) { + // Green to cyan. + red = tint1; + green = val; + blue = tint3; + } else if (sector === 3) { + // Cyan to blue. + red = tint1; + green = tint2; + blue = val; + } else if (sector === 4) { + // Blue to magenta. + red = tint3; + green = tint1; + blue = val; + } else if (sector === 5) { + // Magenta to red. + red = val; + green = tint1; + blue = tint2; + } else { + // Red to yellow (sector could be 0 or 6). + red = val; + green = tint3; + blue = tint1; + } + RGBA = [ + red, + green, + blue, + hsba[3] + ]; + } + return RGBA; + }, + /** + * Convert an HSLA array to HSBA. + */ + _hslaToHSBA: function _hslaToHSBA(hsla) { + var hue = hsla[0]; + var sat = hsla[1]; + var li = hsla[2]; + // Calculate brightness. + var val; + if (li < 0.5) { + val = (1 + sat) * li; + } else { + val = li + sat - li * sat; + } // Convert saturation. + + sat = 2 * (val - li) / val; + // Hue and alpha stay the same. + return [hue, + sat, + val, + hsla[3]]; + }, + /** + * Convert an HSLA array to RGBA. + * + * We need to change basis from HSLA to something that can be more easily be + * projected onto RGBA. We will choose hue and brightness as our first two + * components, and pick a convenient third one ('zest') so that we don't need + * to calculate formal HSBA saturation. + */ + _hslaToRGBA: function _hslaToRGBA(hsla) { + var hue = hsla[0] * 6; // We will split hue into 6 sectors. + var sat = hsla[1]; + var li = hsla[2]; + var RGBA = [ + ]; + if (sat === 0) { + RGBA = [ + li, + li, + li, + hsla[3] + ]; // Return early if grayscale. + } else { + // Calculate brightness. + var val; + if (li < 0.5) { + val = (1 + sat) * li; + } else { + val = li + sat - li * sat; + } // Define zest. + + var zest = 2 * li - val; + // Implement projection (project onto green by default). + var hzvToRGB = function hzvToRGB(hue, zest, val) { + if (hue < 0) { + // Hue must wrap to allow projection onto red and blue. + hue += 6; + } else if (hue >= 6) { + hue -= 6; + } + if (hue < 1) { + // Red to yellow (increasing green). + return zest + (val - zest) * hue; + } else if (hue < 3) { + // Yellow to cyan (greatest green). + return val; + } else if (hue < 4) { + // Cyan to blue (decreasing green). + return zest + (val - zest) * (4 - hue); + } else { + // Blue to red (least green). + return zest; + } + }; + // Perform projections, offsetting hue as necessary. + RGBA = [ + hzvToRGB(hue + 2, zest, val), + hzvToRGB(hue, zest, val), + hzvToRGB(hue - 2, zest, val), + hsla[3] + ]; + } + return RGBA; + }, + /** + * Convert an RGBA array to HSBA. + */ + _rgbaToHSBA: function _rgbaToHSBA(rgba) { + var red = rgba[0]; + var green = rgba[1]; + var blue = rgba[2]; + var val = Math.max(red, green, blue); + var chroma = val - Math.min(red, green, blue); + var hue, + sat; + if (chroma === 0) { + // Return early if grayscale. + hue = 0; + sat = 0; + } else { + sat = chroma / val; + if (red === val) { + // Magenta to yellow. + hue = (green - blue) / chroma; + } else if (green === val) { + // Yellow to cyan. + hue = 2 + (blue - red) / chroma; + } else if (blue === val) { + // Cyan to magenta. + hue = 4 + (red - green) / chroma; + } + if (hue < 0) { + // Confine hue to the interval [0, 1). + hue += 6; + } else if (hue >= 6) { + hue -= 6; + } + } + return [hue / 6, + sat, + val, + rgba[3]]; + }, + /** + * Convert an RGBA array to HSLA. + */ + _rgbaToHSLA: function _rgbaToHSLA(rgba) { + var red = rgba[0]; + var green = rgba[1]; + var blue = rgba[2]; + var val = Math.max(red, green, blue); + var min = Math.min(red, green, blue); + var li = val + min; // We will halve this later. + var chroma = val - min; + var hue, + sat; + if (chroma === 0) { + // Return early if grayscale. + hue = 0; + sat = 0; + } else { + if (li < 1) { + sat = chroma / li; + } else { + sat = chroma / (2 - li); + } + if (red === val) { + // Magenta to yellow. + hue = (green - blue) / chroma; + } else if (green === val) { + // Yellow to cyan. + hue = 2 + (blue - red) / chroma; + } else if (blue === val) { + // Cyan to magenta. + hue = 4 + (red - green) / chroma; + } + if (hue < 0) { + // Confine hue to the interval [0, 1). + hue += 6; + } else if (hue >= 6) { + hue -= 6; + } + } + return [hue / 6, + sat, + li / 2, + rgba[3]]; + } + }; + var _default = _main.default.ColorConversion; + exports.default = _default; + }, + { + '../core/main': 298 + } + ], + 283: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.map'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + _dereq_('./p5.Color'); + _dereq_('../core/friendly_errors/validate_params'); + _dereq_('../core/friendly_errors/file_errors'); + _dereq_('../core/friendly_errors/fes_core'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Color + * @submodule Creating & Reading + * @for p5 + * @requires core + * @requires constants + */ + /** + * Extracts the alpha (transparency) value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method alpha + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the alpha value. + * + * @example + *
                              + * + * noStroke(); + * const c = color(0, 126, 255, 102); + * fill(c); + * rect(15, 15, 35, 70); + * // Sets 'alphaValue' to 102. + * const alphaValue = alpha(c); + * fill(alphaValue); + * rect(50, 15, 35, 70); + * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.'); + * + *
                              + */ + + _main.default.prototype.alpha = function (c) { + _main.default._validateParameters('alpha', arguments); + return this.color(c)._getAlpha(); + }; + /** + * Extracts the blue value from a p5.Color object, + * array of color components, or CSS color string. + * + * @method blue + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the blue value. + * @example + *
                              + * + * const c = color(175, 100, 220); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'blueValue' to 220. + * const blueValue = blue(c); + * fill(0, 0, blueValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The left one is light purple and the right one is royal blue.'); + * + *
                              + * + */ + _main.default.prototype.blue = function (c) { + _main.default._validateParameters('blue', arguments); + return this.color(c)._getBlue(); + }; + /** + * Extracts the HSB brightness value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method brightness + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the brightness value. + * + * @example + *
                              + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color(0, 126, 255); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'brightValue' to 255. + * const brightValue = brightness(c); + * fill(brightValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The left one is salmon pink and the right one is white.'); + * + *
                              + * + *
                              + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color('hsb(60, 100%, 50%)'); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'brightValue' to 127.5 (50% of 255) + * const brightValue = brightness(c); + * fill(brightValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The left one is olive and the right one is gray.'); + * + *
                              + */ + _main.default.prototype.brightness = function (c) { + _main.default._validateParameters('brightness', arguments); + return this.color(c)._getBrightness(); + }; + /** + * Creates a p5.Color object. By default, the + * parameters are interpreted as RGB values. Calling `color(255, 204, 0)` will + * return a bright yellow color. The way these parameters are interpreted may + * be changed with the colorMode() function. + * + * The version of `color()` with one parameter interprets the value one of two + * ways. If the parameter is a number, it's interpreted as a grayscale value. + * If the parameter is a string, it's interpreted as a CSS color string. + * + * The version of `color()` with two parameters interprets the first one as a + * grayscale value. The second parameter sets the alpha (transparency) value. + * + * The version of `color()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current `colorMode()`. + * + * The version of `color()` with four parameters interprets them as RGBA, HSBA, + * or HSLA colors, depending on the current `colorMode()`. The last parameter + * sets the alpha (transparency) value. + * + * @method color + * @param {Number} gray number specifying value between white and black. + * @param {Number} [alpha] alpha value relative to current color range + * (default is 0-255). + * @return {p5.Color} resulting color. + * + * @example + *
                              + * + * const c = color(255, 204, 0); + * fill(c); + * noStroke(); + * rect(30, 20, 55, 55); + * describe('A yellow rectangle on a gray canvas.'); + * + *
                              + * + *
                              + * + * // RGB values. + * let c = color(255, 204, 0); + * fill(c); + * noStroke(); + * circle(25, 25, 80); + * // A grayscale value. + * c = color(65); + * fill(c); + * circle(75, 75, 80); + * describe( + * 'Two ellipses. The circle in the top-left corner is yellow and the one at the bottom-right is gray.' + * ); + * + *
                              + * + *
                              + * + * // A CSS named color. + * const c = color('magenta'); + * fill(c); + * noStroke(); + * square(20, 20, 60); + * describe('A magenta square on a gray canvas.'); + * + *
                              + * + *
                              + * + * // CSS hex color codes. + * noStroke(); + * let c = color('#0f0'); + * fill(c); + * rect(0, 10, 45, 80); + * c = color('#00ff00'); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two bright green rectangles on a gray canvas.'); + * + *
                              + * + *
                              + * + * // RGB and RGBA color strings. + * noStroke(); + * let c = color('rgb(0,0,255)'); + * fill(c); + * square(10, 10, 35); + * c = color('rgb(0%, 0%, 100%)'); + * fill(c); + * square(55, 10, 35); + * c = color('rgba(0, 0, 255, 1)'); + * fill(c); + * square(10, 55, 35); + * c = color('rgba(0%, 0%, 100%, 1)'); + * fill(c); + * square(55, 55, 35); + * describe('Four blue squares in corners of a gray canvas.'); + * + *
                              + * + *
                              + * + * // HSL and HSLA color strings. + * let c = color('hsl(160, 100%, 50%)'); + * noStroke(); + * fill(c); + * rect(0, 10, 45, 80); + * c = color('hsla(160, 100%, 50%, 0.5)'); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two sea green rectangles. A darker rectangle on the left and a brighter one on the right.'); + * + *
                              + * + *
                              + * + * // HSB and HSBA color strings. + * let c = color('hsb(160, 100%, 50%)'); + * noStroke(); + * fill(c); + * rect(0, 10, 45, 80); + * c = color('hsba(160, 100%, 50%, 0.5)'); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two green rectangles. A darker rectangle on the left and a brighter one on the right.'); + * + *
                              + * + *
                              + * + * // Changing color modes. + * noStroke(); + * let c = color(50, 55, 100); + * fill(c); + * rect(0, 10, 45, 80); + * colorMode(HSB, 100); + * c = color(50, 55, 100); + * fill(c); + * rect(55, 10, 45, 80); + * describe('Two blue rectangles. A darker rectangle on the left and a brighter one on the right.'); + * + *
                              + */ + /** + * @method color + * @param {Number} v1 red or hue value relative to + * the current color range. + * @param {Number} v2 green or saturation value + * relative to the current color range. + * @param {Number} v3 blue or brightness value + * relative to the current color range. + * @param {Number} [alpha] + * @return {p5.Color} + */ + /** + * @method color + * @param {String} value a color string. + * @return {p5.Color} + */ + /** + * @method color + * @param {Number[]} values an array containing the red, green, blue, + * and alpha components of the color. + * @return {p5.Color} + */ + /** + * @method color + * @param {p5.Color} color + * @return {p5.Color} + */ + _main.default.prototype.color = function () { + _main.default._validateParameters('color', arguments); + if (arguments[0] instanceof _main.default.Color) { + return arguments[0]; // Do nothing if argument is already a color object. + } + var args = arguments[0] instanceof Array ? arguments[0] : arguments; + return new _main.default.Color(this, args); + }; + /** + * Extracts the green value from a p5.Color object, + * array of color components, or CSS color string. + * + * @method green + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the green value. + * @example + *
                              + * + * const c = color(20, 75, 200); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'greenValue' to 75. + * const greenValue = green(c); + * fill(0, greenValue, 0); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The rectangle on the left is blue and the one on the right is green.'); + * + *
                              + */ + _main.default.prototype.green = function (c) { + _main.default._validateParameters('green', arguments); + return this.color(c)._getGreen(); + }; + /** + * Extracts the hue value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * Hue exists in both HSB and HSL. It describes a color's position on the + * color wheel. By default, this function returns the HSL-normalized hue. If + * the colorMode() is set to HSB, it returns the + * HSB-normalized hue. + * + * @method hue + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the hue + * @example + *
                              + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color(0, 126, 255); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'hueValue' to 0. + * const hueValue = hue(c); + * fill(hueValue); + * rect(50, 20, 35, 60); + * describe( + * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.' + * ); + * + *
                              + * + */ + _main.default.prototype.hue = function (c) { + _main.default._validateParameters('hue', arguments); + return this.color(c)._getHue(); + }; + /** + * Blends two colors to find a third color between them. The `amt` parameter + * specifies the amount to interpolate between the two values. 0 is equal to + * the first color, 0.1 is very near the first color, 0.5 is halfway between + * the two colors, and so on. Negative numbers are set to 0. Numbers greater + * than 1 are set to 1. This differs from the behavior of + * lerp. It's necessary because numbers outside of the + * interval [0, 1] will produce strange and unexpected colors. + * + * The way that colors are interpolated depends on the current + * colorMode(). + * + * @method lerpColor + * @param {p5.Color} c1 interpolate from this color. + * @param {p5.Color} c2 interpolate to this color. + * @param {Number} amt number between 0 and 1. + * @return {p5.Color} interpolated color. + * + * @example + *
                              + * + * colorMode(RGB); + * stroke(255); + * background(51); + * const from = color(218, 165, 32); + * const to = color(72, 61, 139); + * colorMode(RGB); + * const interA = lerpColor(from, to, 0.33); + * const interB = lerpColor(from, to, 0.66); + * fill(from); + * rect(10, 20, 20, 60); + * fill(interA); + * rect(30, 20, 20, 60); + * fill(interB); + * rect(50, 20, 20, 60); + * fill(to); + * rect(70, 20, 20, 60); + * describe( + * 'Four rectangles with white edges. From left to right, the rectangles are tan, brown, brownish purple, and purple.' + * ); + * + *
                              + */ + _main.default.prototype.lerpColor = function (c1, c2, amt) { + _main.default._validateParameters('lerpColor', arguments); + var mode = this._colorMode; + var maxes = this._colorMaxes; + var l0, + l1, + l2, + l3; + var fromArray, + toArray; + if (mode === constants.RGB) { + fromArray = c1.levels.map(function (level) { + return level / 255; + }); + toArray = c2.levels.map(function (level) { + return level / 255; + }); + } else if (mode === constants.HSB) { + c1._getBrightness(); // Cache hsba so it definitely exists. + c2._getBrightness(); + fromArray = c1.hsba; + toArray = c2.hsba; + } else if (mode === constants.HSL) { + c1._getLightness(); // Cache hsla so it definitely exists. + c2._getLightness(); + fromArray = c1.hsla; + toArray = c2.hsla; + } else { + throw new Error(''.concat(mode, 'cannot be used for interpolation.')); + } // Prevent extrapolation. + + amt = Math.max(Math.min(amt, 1), 0); + // Define lerp here itself if user isn't using math module. + // Maintains the definition as found in math/calculation.js + if (typeof this.lerp === 'undefined') { + this.lerp = function (start, stop, amt) { + return amt * (stop - start) + start; + }; + } // Perform interpolation. + + l0 = this.lerp(fromArray[0], toArray[0], amt); + l1 = this.lerp(fromArray[1], toArray[1], amt); + l2 = this.lerp(fromArray[2], toArray[2], amt); + l3 = this.lerp(fromArray[3], toArray[3], amt); + // Scale components. + l0 *= maxes[mode][0]; + l1 *= maxes[mode][1]; + l2 *= maxes[mode][2]; + l3 *= maxes[mode][3]; + return this.color(l0, l1, l2, l3); + }; + /** + * Extracts the HSL lightness value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method lightness + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the lightness + * + * @example + *
                              + * + * noStroke(); + * colorMode(HSL); + * const c = color(156, 100, 50, 1); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'lightValue' to 50. + * const lightValue = lightness(c); + * fill(lightValue); + * rect(50, 20, 35, 60); + * describe('Two rectangles. The rectangle on the left is light green and the one on the right is gray.'); + * + *
                              + */ + _main.default.prototype.lightness = function (c) { + _main.default._validateParameters('lightness', arguments); + return this.color(c)._getLightness(); + }; + /** + * Extracts the red value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * @method red + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the red value. + * @example + *
                              + * + * const c = color(255, 204, 0); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'redValue' to 255. + * const redValue = red(c); + * fill(redValue, 0, 0); + * rect(50, 20, 35, 60); + * describe( + * 'Two rectangles with black edges. The rectangle on the left is yellow and the one on the right is red.' + * ); + * + *
                              + */ + _main.default.prototype.red = function (c) { + _main.default._validateParameters('red', arguments); + return this.color(c)._getRed(); + }; + /** + * Extracts the saturation value from a + * p5.Color object, array of color components, or + * CSS color string. + * + * Saturation is scaled differently in HSB and HSL. By default, this function + * returns the HSL saturation. If the colorMode() + * is set to HSB, it returns the HSB saturation. + * + * @method saturation + * @param {p5.Color|Number[]|String} color p5.Color object, array of + * color components, or CSS color string. + * @return {Number} the saturation value + * @example + *
                              + * + * noStroke(); + * colorMode(HSB, 255); + * const c = color(0, 126, 255); + * fill(c); + * rect(15, 20, 35, 60); + * // Sets 'satValue' to 126. + * const satValue = saturation(c); + * fill(satValue); + * rect(50, 20, 35, 60); + * describe( + * 'Two rectangles. The rectangle on the left is deep pink and the one on the right is gray.' + * ); + * + *
                              + */ + _main.default.prototype.saturation = function (c) { + _main.default._validateParameters('saturation', arguments); + return this.color(c)._getSaturation(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/friendly_errors/fes_core': 289, + '../core/friendly_errors/file_errors': 290, + '../core/friendly_errors/validate_params': 293, + '../core/main': 298, + './p5.Color': 284, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 284: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.trim'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + var _color_conversion = _interopRequireDefault(_dereq_('./color_conversion')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Color + * @submodule Creating & Reading + * @for p5 + * @requires core + * @requires constants + * @requires color_conversion + */ + /** + * CSS named colors. + */ + + var namedColors = { + aliceblue: '#f0f8ff', + antiquewhite: '#faebd7', + aqua: '#00ffff', + aquamarine: '#7fffd4', + azure: '#f0ffff', + beige: '#f5f5dc', + bisque: '#ffe4c4', + black: '#000000', + blanchedalmond: '#ffebcd', + blue: '#0000ff', + blueviolet: '#8a2be2', + brown: '#a52a2a', + burlywood: '#deb887', + cadetblue: '#5f9ea0', + chartreuse: '#7fff00', + chocolate: '#d2691e', + coral: '#ff7f50', + cornflowerblue: '#6495ed', + cornsilk: '#fff8dc', + crimson: '#dc143c', + cyan: '#00ffff', + darkblue: '#00008b', + darkcyan: '#008b8b', + darkgoldenrod: '#b8860b', + darkgray: '#a9a9a9', + darkgreen: '#006400', + darkgrey: '#a9a9a9', + darkkhaki: '#bdb76b', + darkmagenta: '#8b008b', + darkolivegreen: '#556b2f', + darkorange: '#ff8c00', + darkorchid: '#9932cc', + darkred: '#8b0000', + darksalmon: '#e9967a', + darkseagreen: '#8fbc8f', + darkslateblue: '#483d8b', + darkslategray: '#2f4f4f', + darkslategrey: '#2f4f4f', + darkturquoise: '#00ced1', + darkviolet: '#9400d3', + deeppink: '#ff1493', + deepskyblue: '#00bfff', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1e90ff', + firebrick: '#b22222', + floralwhite: '#fffaf0', + forestgreen: '#228b22', + fuchsia: '#ff00ff', + gainsboro: '#dcdcdc', + ghostwhite: '#f8f8ff', + gold: '#ffd700', + goldenrod: '#daa520', + gray: '#808080', + green: '#008000', + greenyellow: '#adff2f', + grey: '#808080', + honeydew: '#f0fff0', + hotpink: '#ff69b4', + indianred: '#cd5c5c', + indigo: '#4b0082', + ivory: '#fffff0', + khaki: '#f0e68c', + lavender: '#e6e6fa', + lavenderblush: '#fff0f5', + lawngreen: '#7cfc00', + lemonchiffon: '#fffacd', + lightblue: '#add8e6', + lightcoral: '#f08080', + lightcyan: '#e0ffff', + lightgoldenrodyellow: '#fafad2', + lightgray: '#d3d3d3', + lightgreen: '#90ee90', + lightgrey: '#d3d3d3', + lightpink: '#ffb6c1', + lightsalmon: '#ffa07a', + lightseagreen: '#20b2aa', + lightskyblue: '#87cefa', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#b0c4de', + lightyellow: '#ffffe0', + lime: '#00ff00', + limegreen: '#32cd32', + linen: '#faf0e6', + magenta: '#ff00ff', + maroon: '#800000', + mediumaquamarine: '#66cdaa', + mediumblue: '#0000cd', + mediumorchid: '#ba55d3', + mediumpurple: '#9370db', + mediumseagreen: '#3cb371', + mediumslateblue: '#7b68ee', + mediumspringgreen: '#00fa9a', + mediumturquoise: '#48d1cc', + mediumvioletred: '#c71585', + midnightblue: '#191970', + mintcream: '#f5fffa', + mistyrose: '#ffe4e1', + moccasin: '#ffe4b5', + navajowhite: '#ffdead', + navy: '#000080', + oldlace: '#fdf5e6', + olive: '#808000', + olivedrab: '#6b8e23', + orange: '#ffa500', + orangered: '#ff4500', + orchid: '#da70d6', + palegoldenrod: '#eee8aa', + palegreen: '#98fb98', + paleturquoise: '#afeeee', + palevioletred: '#db7093', + papayawhip: '#ffefd5', + peachpuff: '#ffdab9', + peru: '#cd853f', + pink: '#ffc0cb', + plum: '#dda0dd', + powderblue: '#b0e0e6', + purple: '#800080', + rebeccapurple: '#663399', + red: '#ff0000', + rosybrown: '#bc8f8f', + royalblue: '#4169e1', + saddlebrown: '#8b4513', + salmon: '#fa8072', + sandybrown: '#f4a460', + seagreen: '#2e8b57', + seashell: '#fff5ee', + sienna: '#a0522d', + silver: '#c0c0c0', + skyblue: '#87ceeb', + slateblue: '#6a5acd', + slategray: '#708090', + slategrey: '#708090', + snow: '#fffafa', + springgreen: '#00ff7f', + steelblue: '#4682b4', + tan: '#d2b48c', + teal: '#008080', + thistle: '#d8bfd8', + tomato: '#ff6347', + turquoise: '#40e0d0', + violet: '#ee82ee', + wheat: '#f5deb3', + white: '#ffffff', + whitesmoke: '#f5f5f5', + yellow: '#ffff00', + yellowgreen: '#9acd32' + }; + /** + * These regular expressions are used to build up the patterns for matching + * viable CSS color strings: fragmenting the regexes in this way increases the + * legibility and comprehensibility of the code. + * + * Note that RGB values of .9 are not parsed by IE, but are supported here for + * color string consistency. + */ + var WHITESPACE = /\s*/; // Match zero or more whitespace characters. + var INTEGER = /(\d{1,3})/; // Match integers: 79, 255, etc. + var DECIMAL = /((?:\d+(?:\.\d+)?)|(?:\.\d+))/; // Match 129.6, 79, .9, etc. + var PERCENT = new RegExp(''.concat(DECIMAL.source, '%')); // Match 12.9%, 79%, .9%, etc. + /** + * Full color string patterns. The capture groups are necessary. + */ + var colorPatterns = { + // Match colors in format #XXX, e.g. #416. + HEX3: /^#([a-f0-9])([a-f0-9])([a-f0-9])$/i, + // Match colors in format #XXXX, e.g. #5123. + HEX4: /^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i, + // Match colors in format #XXXXXX, e.g. #b4d455. + HEX6: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, + // Match colors in format #XXXXXXXX, e.g. #b4d45535. + HEX8: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, + // Match colors in format rgb(R, G, B), e.g. rgb(255, 0, 128). + RGB: new RegExp(['^rgb\\(', + INTEGER.source, + ',', + INTEGER.source, + ',', + INTEGER.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format rgb(R%, G%, B%), e.g. rgb(100%, 0%, 28.9%). + RGB_PERCENT: new RegExp(['^rgb\\(', + PERCENT.source, + ',', + PERCENT.source, + ',', + PERCENT.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format rgb(R, G, B, A), e.g. rgb(255, 0, 128, 0.25). + RGBA: new RegExp(['^rgba\\(', + INTEGER.source, + ',', + INTEGER.source, + ',', + INTEGER.source, + ',', + DECIMAL.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format rgb(R%, G%, B%, A), e.g. rgb(100%, 0%, 28.9%, 0.5). + RGBA_PERCENT: new RegExp(['^rgba\\(', + PERCENT.source, + ',', + PERCENT.source, + ',', + PERCENT.source, + ',', + DECIMAL.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format hsla(H, S%, L%), e.g. hsl(100, 40%, 28.9%). + HSL: new RegExp(['^hsl\\(', + INTEGER.source, + ',', + PERCENT.source, + ',', + PERCENT.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format hsla(H, S%, L%, A), e.g. hsla(100, 40%, 28.9%, 0.5). + HSLA: new RegExp(['^hsla\\(', + INTEGER.source, + ',', + PERCENT.source, + ',', + PERCENT.source, + ',', + DECIMAL.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format hsb(H, S%, B%), e.g. hsb(100, 40%, 28.9%). + HSB: new RegExp(['^hsb\\(', + INTEGER.source, + ',', + PERCENT.source, + ',', + PERCENT.source, + '\\)$'].join(WHITESPACE.source), 'i'), + // Match colors in format hsba(H, S%, B%, A), e.g. hsba(100, 40%, 28.9%, 0.5). + HSBA: new RegExp(['^hsba\\(', + INTEGER.source, + ',', + PERCENT.source, + ',', + PERCENT.source, + ',', + DECIMAL.source, + '\\)$'].join(WHITESPACE.source), 'i') + }; + /** + * A class to describe a color. Each `p5.Color` object stores the color mode + * and level maxes that were active during its construction. These values are + * used to interpret the arguments passed to the object's constructor. They + * also determine output formatting such as when + * saturation() is called. + * + * Color is stored internally as an array of ideal RGBA values in floating + * point form, normalized from 0 to 1. These values are used to calculate the + * closest screen colors, which are RGBA levels from 0 to 255. Screen colors + * are sent to the renderer. + * + * When different color representations are calculated, the results are cached + * for performance. These values are normalized, floating-point numbers. + * + * color() is the recommended way to create an instance + * of this class. + * + * @class p5.Color + * @constructor + * @param {p5} [pInst] pointer to p5 instance. + * + * @param {Number[]|String} vals an array containing the color values + * for red, green, blue and alpha channel + * or CSS color. + */ + _main.default.Color = /*#__PURE__*/ function () { + function Color(pInst, vals) { + _classCallCheck(this, Color); + // Record color mode and maxes at time of construction. + this._storeModeAndMaxes(pInst._colorMode, pInst._colorMaxes); + // Calculate normalized RGBA values. + if (![constants.RGB, + constants.HSL, + constants.HSB].includes(this.mode)) { + throw new Error(''.concat(this.mode, ' is an invalid colorMode.')); + } else { + this._array = Color._parseInputs.apply(this, vals); + } // Expose closest screen color. + + this._calculateLevels(); + } /** + * Returns the color formatted as a string. Doing so can be useful for + * debugging, or for using p5.js with other libraries. + * + * @method toString + * @param {String} [format] how the color string will be formatted. + * Leaving this empty formats the string as rgba(r, g, b, a). + * '#rgb' '#rgba' '#rrggbb' and '#rrggbbaa' format as hexadecimal color codes. + * 'rgb' 'hsb' and 'hsl' return the color formatted in the specified color mode. + * 'rgba' 'hsba' and 'hsla' are the same as above but with alpha channels. + * 'rgb%' 'hsb%' 'hsl%' 'rgba%' 'hsba%' and 'hsla%' format as percentages. + * @return {String} the formatted string. + * + * @example + *
                              + * + * createCanvas(200, 100); + * stroke(255); + * const myColor = color(100, 100, 250); + * fill(myColor); + * rotate(HALF_PI); + * text(myColor.toString(), 0, -5); + * text(myColor.toString('#rrggbb'), 0, -30); + * text(myColor.toString('rgba%'), 0, -55); + * describe('Three text representation of a color written sideways.'); + * + *
                              + * + *
                              + * + * const myColor = color(100, 130, 250); + * text(myColor.toString('#rrggbb'), 25, 25); + * describe('A hexadecimal representation of a color.'); + * + *
                              + */ + + _createClass(Color, [ + { + key: 'toString', + value: function toString(format) { + var a = this.levels; + var f = this._array; + var alpha = f[3]; // String representation uses normalized alpha + switch (format) { + case '#rrggbb': + return '#'.concat(a[0] < 16 ? '0'.concat(a[0].toString(16)) : a[0].toString(16), a[1] < 16 ? '0'.concat(a[1].toString(16)) : a[1].toString(16), a[2] < 16 ? '0'.concat(a[2].toString(16)) : a[2].toString(16)); + case '#rrggbbaa': + return '#'.concat(a[0] < 16 ? '0'.concat(a[0].toString(16)) : a[0].toString(16), a[1] < 16 ? '0'.concat(a[1].toString(16)) : a[1].toString(16), a[2] < 16 ? '0'.concat(a[2].toString(16)) : a[2].toString(16), a[3] < 16 ? '0'.concat(a[3].toString(16)) : a[3].toString(16)); + case '#rgb': + return '#'.concat(Math.round(f[0] * 15).toString(16), Math.round(f[1] * 15).toString(16), Math.round(f[2] * 15).toString(16)); + case '#rgba': + return '#'.concat(Math.round(f[0] * 15).toString(16), Math.round(f[1] * 15).toString(16), Math.round(f[2] * 15).toString(16), Math.round(f[3] * 15).toString(16)); + case 'rgb': + return 'rgb('.concat(a[0], ', ', a[1], ', ', a[2], ')'); + case 'rgb%': + return 'rgb('.concat((100 * f[0]).toPrecision(3), '%, ', (100 * f[1]).toPrecision(3), '%, ', (100 * f[2]).toPrecision(3), '%)'); + case 'rgba%': + return 'rgba('.concat((100 * f[0]).toPrecision(3), '%, ', (100 * f[1]).toPrecision(3), '%, ', (100 * f[2]).toPrecision(3), '%, ', (100 * f[3]).toPrecision(3), '%)'); + case 'hsb': + case 'hsv': + if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + return 'hsb('.concat(this.hsba[0] * this.maxes[constants.HSB][0], ', ', this.hsba[1] * this.maxes[constants.HSB][1], ', ', this.hsba[2] * this.maxes[constants.HSB][2], ')'); + case 'hsb%': + case 'hsv%': + if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + return 'hsb('.concat((100 * this.hsba[0]).toPrecision(3), '%, ', (100 * this.hsba[1]).toPrecision(3), '%, ', (100 * this.hsba[2]).toPrecision(3), '%)'); + case 'hsba': + case 'hsva': + if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + return 'hsba('.concat(this.hsba[0] * this.maxes[constants.HSB][0], ', ', this.hsba[1] * this.maxes[constants.HSB][1], ', ', this.hsba[2] * this.maxes[constants.HSB][2], ', ', alpha, ')'); + case 'hsba%': + case 'hsva%': + if (!this.hsba) this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + return 'hsba('.concat((100 * this.hsba[0]).toPrecision(3), '%, ', (100 * this.hsba[1]).toPrecision(3), '%, ', (100 * this.hsba[2]).toPrecision(3), '%, ', (100 * alpha).toPrecision(3), '%)'); + case 'hsl': + if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + return 'hsl('.concat(this.hsla[0] * this.maxes[constants.HSL][0], ', ', this.hsla[1] * this.maxes[constants.HSL][1], ', ', this.hsla[2] * this.maxes[constants.HSL][2], ')'); + case 'hsl%': + if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + return 'hsl('.concat((100 * this.hsla[0]).toPrecision(3), '%, ', (100 * this.hsla[1]).toPrecision(3), '%, ', (100 * this.hsla[2]).toPrecision(3), '%)'); + case 'hsla': + if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + return 'hsla('.concat(this.hsla[0] * this.maxes[constants.HSL][0], ', ', this.hsla[1] * this.maxes[constants.HSL][1], ', ', this.hsla[2] * this.maxes[constants.HSL][2], ', ', alpha, ')'); + case 'hsla%': + if (!this.hsla) this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + return 'hsl('.concat((100 * this.hsla[0]).toPrecision(3), '%, ', (100 * this.hsla[1]).toPrecision(3), '%, ', (100 * this.hsla[2]).toPrecision(3), '%, ', (100 * alpha).toPrecision(3), '%)'); + case 'rgba': + default: + return 'rgba('.concat(a[0], ',', a[1], ',', a[2], ',', alpha, ')'); + } + } /** + * Sets the red component of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setRed + * @param {Number} red the new red value. + * + * @example + *
                              + * + * let backgroundColor; + * + * function setup() { + * backgroundColor = color(100, 50, 150); + * } + * + * function draw() { + * backgroundColor.setRed(128 + 128 * sin(millis() / 1000)); + * background(backgroundColor); + * describe('A canvas with a gradually changing background color.'); + * } + * + *
                              + */ + + }, + { + key: 'setRed', + value: function setRed(new_red) { + this._array[0] = new_red / this.maxes[constants.RGB][0]; + this._calculateLevels(); + } /** + * Sets the green component of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setGreen + * @param {Number} green the new green value. + * + * @example + *
                              + * + * let backgroundColor; + * + * function setup() { + * backgroundColor = color(100, 50, 150); + * } + * + * function draw() { + * backgroundColor.setGreen(128 + 128 * sin(millis() / 1000)); + * background(backgroundColor); + * describe('A canvas with a gradually changing background color.'); + * } + * + *
                              + **/ + + }, + { + key: 'setGreen', + value: function setGreen(new_green) { + this._array[1] = new_green / this.maxes[constants.RGB][1]; + this._calculateLevels(); + } /** + * Sets the blue component of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setBlue + * @param {Number} blue the new blue value. + * + * @example + *
                              + * + * let backgroundColor; + * + * function setup() { + * backgroundColor = color(100, 50, 150); + * } + * + * function draw() { + * backgroundColor.setBlue(128 + 128 * sin(millis() / 1000)); + * background(backgroundColor); + * describe('A canvas with a gradually changing background color.'); + * } + * + *
                              + **/ + + }, + { + key: 'setBlue', + value: function setBlue(new_blue) { + this._array[2] = new_blue / this.maxes[constants.RGB][2]; + this._calculateLevels(); + } /** + * Sets the alpha (transparency) value of a color. The range depends on the + * colorMode(). In the default RGB mode it's + * between 0 and 255. + * + * @method setAlpha + * @param {Number} alpha the new alpha value. + * + * @example + *
                              + * + * function draw() { + * clear(); + * background(200); + * const squareColor = color(100, 50, 100); + * squareColor.setAlpha(128 + 128 * sin(millis() / 1000)); + * fill(squareColor); + * rect(13, 13, width - 26, height - 26); + * describe( + * 'A purple square with gradually changing opacity drawn on a gray background.' + * ); + * } + * + *
                              + **/ + + }, + { + key: 'setAlpha', + value: function setAlpha(new_alpha) { + this._array[3] = new_alpha / this.maxes[this.mode][3]; + this._calculateLevels(); + } // calculates and stores the closest screen levels + + }, + { + key: '_calculateLevels', + value: function _calculateLevels() { + var array = this._array; + // (loop backwards for performance) + var levels = this.levels = new Array(array.length); + for (var i = array.length - 1; i >= 0; --i) { + levels[i] = Math.round(array[i] * 255); + } // Clear cached HSL/HSB values + + this.hsla = null; + this.hsba = null; + } + }, + { + key: '_getAlpha', + value: function _getAlpha() { + return this._array[3] * this.maxes[this.mode][3]; + } // stores the color mode and maxes in this instance of Color + // for later use (by _parseInputs()) + + }, + { + key: '_storeModeAndMaxes', + value: function _storeModeAndMaxes(new_mode, new_maxes) { + this.mode = new_mode; + this.maxes = new_maxes; + } + }, + { + key: '_getMode', + value: function _getMode() { + return this.mode; + } + }, + { + key: '_getMaxes', + value: function _getMaxes() { + return this.maxes; + } + }, + { + key: '_getBlue', + value: function _getBlue() { + return this._array[2] * this.maxes[constants.RGB][2]; + } + }, + { + key: '_getBrightness', + value: function _getBrightness() { + if (!this.hsba) { + this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + } + return this.hsba[2] * this.maxes[constants.HSB][2]; + } + }, + { + key: '_getGreen', + value: function _getGreen() { + return this._array[1] * this.maxes[constants.RGB][1]; + } /** + * Hue is the same in HSB and HSL, but the maximum value may be different. + * This function will return the HSB-normalized saturation when supplied with + * an HSB color object, but will default to the HSL-normalized saturation + * otherwise. + */ + + }, + { + key: '_getHue', + value: function _getHue() { + if (this.mode === constants.HSB) { + if (!this.hsba) { + this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + } + return this.hsba[0] * this.maxes[constants.HSB][0]; + } else { + if (!this.hsla) { + this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + } + return this.hsla[0] * this.maxes[constants.HSL][0]; + } + } + }, + { + key: '_getLightness', + value: function _getLightness() { + if (!this.hsla) { + this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + } + return this.hsla[2] * this.maxes[constants.HSL][2]; + } + }, + { + key: '_getRed', + value: function _getRed() { + return this._array[0] * this.maxes[constants.RGB][0]; + } /** + * Saturation is scaled differently in HSB and HSL. This function will return + * the HSB saturation when supplied with an HSB color object, but will default + * to the HSL saturation otherwise. + */ + + }, + { + key: '_getSaturation', + value: function _getSaturation() { + if (this.mode === constants.HSB) { + if (!this.hsba) { + this.hsba = _color_conversion.default._rgbaToHSBA(this._array); + } + return this.hsba[1] * this.maxes[constants.HSB][1]; + } else { + if (!this.hsla) { + this.hsla = _color_conversion.default._rgbaToHSLA(this._array); + } + return this.hsla[1] * this.maxes[constants.HSL][1]; + } + } /** + * For a number of different inputs, returns a color formatted as [r, g, b, a] + * arrays, with each component normalized between 0 and 1. + * + * @private + * @param {Array} [...args] An 'array-like' object that represents a list of + * arguments + * @return {Number[]} a color formatted as [r, g, b, a] + * Example: + * input ==> output + * g ==> [g, g, g, 255] + * g,a ==> [g, g, g, a] + * r, g, b ==> [r, g, b, 255] + * r, g, b, a ==> [r, g, b, a] + * [g] ==> [g, g, g, 255] + * [g, a] ==> [g, g, g, a] + * [r, g, b] ==> [r, g, b, 255] + * [r, g, b, a] ==> [r, g, b, a] + * @example + *
                              + * + * // todo + * // + * // describe(''); + * + *
                              + */ + + } + ], [ + { + key: '_parseInputs', + value: function _parseInputs(r, g, b, a) { + var numArgs = arguments.length; + var mode = this.mode; + var maxes = this.maxes[mode]; + var results = [ + ]; + var i; + if (numArgs >= 3) { + // Argument is a list of component values. + results[0] = r / maxes[0]; + results[1] = g / maxes[1]; + results[2] = b / maxes[2]; + // Alpha may be undefined, so default it to 100%. + if (typeof a === 'number') { + results[3] = a / maxes[3]; + } else { + results[3] = 1; + } // Constrain components to the range [0,1]. + // (loop backwards for performance) + + for (i = results.length - 1; i >= 0; --i) { + var result = results[i]; + if (result < 0) { + results[i] = 0; + } else if (result > 1) { + results[i] = 1; + } + } // Convert to RGBA and return. + + if (mode === constants.HSL) { + return _color_conversion.default._hslaToRGBA(results); + } else if (mode === constants.HSB) { + return _color_conversion.default._hsbaToRGBA(results); + } else { + return results; + } + } else if (numArgs === 1 && typeof r === 'string') { + var str = r.trim().toLowerCase(); + // Return if string is a named colour. + if (namedColors[str]) { + return Color._parseInputs.call(this, namedColors[str]); + } // Try RGBA pattern matching. + + if (colorPatterns.HEX3.test(str)) { + // #rgb + results = colorPatterns.HEX3.exec(str).slice(1).map(function (color) { + return parseInt(color + color, 16) / 255; + }); + results[3] = 1; + return results; + } else if (colorPatterns.HEX6.test(str)) { + // #rrggbb + results = colorPatterns.HEX6.exec(str).slice(1).map(function (color) { + return parseInt(color, 16) / 255; + }); + results[3] = 1; + return results; + } else if (colorPatterns.HEX4.test(str)) { + // #rgba + results = colorPatterns.HEX4.exec(str).slice(1).map(function (color) { + return parseInt(color + color, 16) / 255; + }); + return results; + } else if (colorPatterns.HEX8.test(str)) { + // #rrggbbaa + results = colorPatterns.HEX8.exec(str).slice(1).map(function (color) { + return parseInt(color, 16) / 255; + }); + return results; + } else if (colorPatterns.RGB.test(str)) { + // rgb(R,G,B) + results = colorPatterns.RGB.exec(str).slice(1).map(function (color) { + return color / 255; + }); + results[3] = 1; + return results; + } else if (colorPatterns.RGB_PERCENT.test(str)) { + // rgb(R%,G%,B%) + results = colorPatterns.RGB_PERCENT.exec(str).slice(1).map(function (color) { + return parseFloat(color) / 100; + }); + results[3] = 1; + return results; + } else if (colorPatterns.RGBA.test(str)) { + // rgba(R,G,B,A) + results = colorPatterns.RGBA.exec(str).slice(1).map(function (color, idx) { + if (idx === 3) { + return parseFloat(color); + } + return color / 255; + }); + return results; + } else if (colorPatterns.RGBA_PERCENT.test(str)) { + // rgba(R%,G%,B%,A%) + results = colorPatterns.RGBA_PERCENT.exec(str).slice(1).map(function (color, idx) { + if (idx === 3) { + return parseFloat(color); + } + return parseFloat(color) / 100; + }); + return results; + } // Try HSLA pattern matching. + + if (colorPatterns.HSL.test(str)) { + // hsl(H,S,L) + results = colorPatterns.HSL.exec(str).slice(1).map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } + return parseInt(color, 10) / 100; + }); + results[3] = 1; + } else if (colorPatterns.HSLA.test(str)) { + // hsla(H,S,L,A) + results = colorPatterns.HSLA.exec(str).slice(1).map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } else if (idx === 3) { + return parseFloat(color); + } + return parseInt(color, 10) / 100; + }); + } + results = results.map(function (value) { + return Math.max(Math.min(value, 1), 0); + }); + if (results.length) { + return _color_conversion.default._hslaToRGBA(results); + } // Try HSBA pattern matching. + + if (colorPatterns.HSB.test(str)) { + // hsb(H,S,B) + results = colorPatterns.HSB.exec(str).slice(1).map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } + return parseInt(color, 10) / 100; + }); + results[3] = 1; + } else if (colorPatterns.HSBA.test(str)) { + // hsba(H,S,B,A) + results = colorPatterns.HSBA.exec(str).slice(1).map(function (color, idx) { + if (idx === 0) { + return parseInt(color, 10) / 360; + } else if (idx === 3) { + return parseFloat(color); + } + return parseInt(color, 10) / 100; + }); + } + if (results.length) { + // (loop backwards for performance) + for (i = results.length - 1; i >= 0; --i) { + results[i] = Math.max(Math.min(results[i], 1), 0); + } + return _color_conversion.default._hsbaToRGBA(results); + } // Input did not match any CSS color pattern: default to white. + + results = [ + 1, + 1, + 1, + 1 + ]; + } else if ((numArgs === 1 || numArgs === 2) && typeof r === 'number') { + // 'Grayscale' mode. + /** + * For HSB and HSL, interpret the gray level as a brightness/lightness + * value (they are equivalent when chroma is zero). For RGB, normalize the + * gray level according to the blue maximum. + */ + results[0] = r / maxes[2]; + results[1] = r / maxes[2]; + results[2] = r / maxes[2]; + // Alpha may be undefined, so default it to 100%. + if (typeof g === 'number') { + results[3] = g / maxes[3]; + } else { + results[3] = 1; + } // Constrain components to the range [0,1]. + + results = results.map(function (value) { + return Math.max(Math.min(value, 1), 0); + }); + } else { + throw new Error(''.concat(arguments, 'is not a valid color representation.')); + } + return results; + } + } + ]); + return Color; + }(); + var _default = _main.default.Color; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './color_conversion': 282, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.constructor': 204, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.trim': 219, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 285: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.fill'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + _dereq_('./p5.Color'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Color + * @submodule Setting + * @for p5 + * @requires core + * @requires constants + */ + /** + * Start defining a shape that will mask subsequent things drawn to the canvas. + * Only opaque regions of the mask shape will allow content to be drawn. + * Any shapes drawn between this and endClip() will + * contribute to the mask shape. + * + * The mask will apply to anything drawn after this call. To draw without a mask, contain + * the code to apply the mask and to draw the masked content between + * push() and pop(). + * + * Alternatively, rather than drawing the mask between this and + * endClip(), draw the mask in a callback function + * passed to clip(). + * + * Options can include: + * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. + * + * @method beginClip + * @param {Object} [options] An object containing clip settings. + * + * @example + *
                              + * + * noStroke(); + * + * // Mask in some shapes + * push(); + * beginClip(); + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * endClip(); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + * translate(50, 50); + * + * // Mask out the same shapes + * push(); + * beginClip({ invert: true }); + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * endClip(); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + *
                              + * + * @alt + * In the top left, a red triangle and circle. In the bottom right, a red + * square with a triangle and circle cut out of it. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(255); + * noStroke(); + * + * beginClip(); + * push(); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * scale(0.5); + * torus(30, 15); + * pop(); + * endClip(); + * + * beginShape(QUAD_STRIP); + * fill(0, 255, 255); + * vertex(-width/2, -height/2); + * vertex(width/2, -height/2); + * fill(100, 0, 100); + * vertex(-width/2, height/2); + * vertex(width/2, height/2); + * endShape(); + * } + * + *
                              + * + * @alt + * A silhouette of a rotating torus colored with a gradient from + * cyan to purple + */ + + _main.default.prototype.beginClip = function () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + this._renderer.beginClip(options); + }; + /** + * Finishes defining a shape that will mask subsequent things drawn to the canvas. + * Only opaque regions of the mask shape will allow content to be drawn. + * Any shapes drawn between beginClip() and this + * will contribute to the mask shape. + * + * @method endClip + */ + _main.default.prototype.endClip = function () { + this._renderer.endClip(); + }; + /** + * Use the shape drawn by a callback function to mask subsequent things drawn to the canvas. + * Only opaque regions of the mask shape will allow content to be drawn. + * + * The mask will apply to anything drawn after this call. To draw without a mask, contain + * the code to apply the mask and to draw the masked content between + * push() and pop(). + * + * Alternatively, rather than drawing the mask shape in a function, draw the + * shape between beginClip() and endClip(). + * + * Options can include: + * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. + * + * @method clip + * @param {Function} callback A function that draws the mask shape. + * @param {Object} [options] An object containing clip settings. + * + * @example + *
                              + * + * noStroke(); + * + * // Mask in some shapes + * push(); + * clip(() => { + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * }); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + * translate(50, 50); + * + * // Mask out the same shapes + * push(); + * clip(() => { + * triangle(15, 37, 30, 13, 43, 37); + * circle(45, 45, 7); + * }, { invert: true }); + * + * fill('red'); + * rect(5, 5, 45, 45); + * pop(); + * + *
                              + * + * @alt + * In the top left, a red triangle and circle. In the bottom right, a red + * square with a triangle and circle cut out of it. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(255); + * noStroke(); + * + * clip(() => { + * push(); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * scale(0.5); + * torus(30, 15); + * pop(); + * }); + * + * beginShape(QUAD_STRIP); + * fill(0, 255, 255); + * vertex(-width/2, -height/2); + * vertex(width/2, -height/2); + * fill(100, 0, 100); + * vertex(-width/2, height/2); + * vertex(width/2, height/2); + * endShape(); + * } + * + *
                              + * + * @alt + * A silhouette of a rotating torus colored with a gradient from + * cyan to purple + */ + _main.default.prototype.clip = function (callback, options) { + this._renderer.beginClip(options); + callback(); + this._renderer.endClip(options); + }; + /** + * Sets the color used for the background of the canvas. By default, the + * background is transparent. This function is typically used within + * draw() to clear the display window at the beginning + * of each frame. It can also be used inside setup() to + * set the background on the first frame of animation. + * + * The version of `background()` with one parameter interprets the value one of four + * ways. If the parameter is a number, it's interpreted as a grayscale value. + * If the parameter is a string, it's interpreted as a CSS color string. RGB, RGBA, + * HSL, HSLA, hex, and named color strings are supported. If the parameter is a + * p5.Color object, it will be used as the background color. + * If the parameter is a p5.Image object, it will be used as + * the background image. + * + * The version of `background()` with two parameters interprets the first one as a + * grayscale value. The second parameter sets the alpha (transparency) value. + * + * The version of `background()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current colorMode(). + * By default, colors are specified in RGB values. Calling background(255, 204, 0) + * sets the background a bright yellow color. + * + * @method background + * @param {p5.Color} color any value created by the color() function + * @chainable + * + * @example + *
                              + * + * // A grayscale integer value. + * background(51); + * describe('A canvas with a dark charcoal gray background.'); + * + *
                              + * + *
                              + * + * // A grayscale integer value and an alpha value. + * background(51, 0.4); + * describe('A canvas with a transparent gray background.'); + * + *
                              + * + *
                              + * + * // R, G & B integer values. + * background(255, 204, 0); + * describe('A canvas with a yellow background.'); + * + *
                              + * + *
                              + * + * // H, S & B integer values. + * colorMode(HSB); + * background(255, 204, 100); + * describe('A canvas with a royal blue background.'); + * + *
                              + * + *
                              + * + * // A CSS named color. + * background('red'); + * describe('A canvas with a red background.'); + * + *
                              + * + *
                              + * + * // Three-digit hex RGB notation. + * background('#fae'); + * describe('A canvas with a pink background.'); + * + *
                              + * + *
                              + * + * // Six-digit hex RGB notation. + * background('#222222'); + * describe('A canvas with a black background.'); + * + *
                              + * + *
                              + * + * // Integer RGB notation. + * background('rgb(0,255,0)'); + * describe('A canvas with a bright green background.'); + * + *
                              + * + *
                              + * + * // Integer RGBA notation. + * background('rgba(0,255,0, 0.25)'); + * describe('A canvas with a transparent green background.'); + * + *
                              + * + *
                              + * + * // Percentage RGB notation. + * background('rgb(100%,0%,10%)'); + * describe('A canvas with a red background.'); + * + *
                              + * + *
                              + * + * // Percentage RGBA notation. + * background('rgba(100%,0%,100%,0.5)'); + * describe('A canvas with a transparent purple background.'); + * + *
                              + * + *
                              + * + * // A p5.Color object. + * let c = color(0, 0, 255); + * background(c); + * describe('A canvas with a blue background.'); + * + *
                              + * + */ + /** + * @method background + * @param {String} colorstring color string, possible formats include: integer + * rgb() or rgba(), percentage rgb() or rgba(), + * 3-digit hex, 6-digit hex. + * @param {Number} [a] opacity of the background relative to current + * color range (default is 0-255). + * @chainable + */ + /** + * @method background + * @param {Number} gray specifies a value between white and black. + * @param {Number} [a] + * @chainable + */ + /** + * @method background + * @param {Number} v1 red value if color mode is RGB, or hue value if color mode is HSB. + * @param {Number} v2 green value if color mode is RGB, or saturation value if color mode is HSB. + * @param {Number} v3 blue value if color mode is RGB, or brightness value if color mode is HSB. + * @param {Number} [a] + * @chainable + */ + /** + * @method background + * @param {Number[]} values an array containing the red, green, blue + * and alpha components of the color. + * @chainable + */ + /** + * @method background + * @param {p5.Image} image image created with loadImage() + * or createImage(), + * to set as background. + * (must be same size as the sketch window). + * @param {Number} [a] + * @chainable + */ + _main.default.prototype.background = function () { + var _this$_renderer; + (_this$_renderer = this._renderer).background.apply(_this$_renderer, arguments); + return this; + }; + /** + * Clears the pixels on the canvas. This function makes every pixel 100% + * transparent. Calling `clear()` doesn't clear objects created by `createX()` + * functions such as createGraphics(), + * createVideo(), and + * createImg(). These objects will remain + * unchanged after calling clear() and can be redrawn. + * + * In WebGL mode, this function can clear the screen to a specific color. It + * interprets four numeric parameters as normalized RGBA color values. It also + * clears the depth buffer. If you are not using the WebGL renderer, these + * parameters will have no effect. + * + * @method clear + * @chainable + * @example + *
                              + * + * function draw() { + * circle(mouseX, mouseY, 20); + * describe('A white circle is drawn at the mouse x- and y-coordinates.'); + * } + * + * function mousePressed() { + * clear(); + * background(128); + * describe('The canvas is cleared when the mouse is clicked.'); + * } + * + *
                              + * + *
                              + * + * let pg; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * pg = createGraphics(60, 60); + * pg.background(200); + * pg.noStroke(); + * pg.circle(pg.width / 2, pg.height / 2, 15); + * image(pg, 20, 20); + * describe('A white circle drawn on a gray square. The square gets smaller when the mouse is pressed.'); + * } + * + * function mousePressed() { + * clear(); + * image(pg, 20, 20); + * } + * + *
                              + * + * @param {Number} r normalized red value. + * @param {Number} g normalized green value. + * @param {Number} b normalized blue value. + * @param {Number} a normalized alpha value. + */ + _main.default.prototype.clear = function () { + var _r = (arguments.length <= 0 ? undefined : arguments[0]) || 0; + var _g = (arguments.length <= 1 ? undefined : arguments[1]) || 0; + var _b = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + var _a = (arguments.length <= 3 ? undefined : arguments[3]) || 0; + this._renderer.clear(_r, _g, _b, _a); + return this; + }; + /** + * Changes the way p5.js interprets color data. By default, the numeric + * parameters for fill(), + * stroke(), + * background(), and + * color() are defined by values between 0 and 255 + * using the RGB color model. This is equivalent to calling + * `colorMode(RGB, 255)`. Pure red is `color(255, 0, 0)` in this model. + * + * Calling `colorMode(RGB, 100)` sets colors to be interpreted as RGB color + * values between 0 and 100. Pure red is `color(100, 0, 0)` in this model. + * + * Calling `colorMode(HSB)` or `colorMode(HSL)` changes to HSB or HSL system + * instead of RGB. + * + * p5.Color objects remember the mode that they were + * created in. Changing modes doesn't affect their appearance. + * + * @method colorMode + * @param {Constant} mode either RGB, HSB or HSL, corresponding to + * Red/Green/Blue and Hue/Saturation/Brightness + * (or Lightness). + * @param {Number} [max] range for all values. + * @chainable + * + * @example + *
                              + * + * noStroke(); + * colorMode(RGB, 100); + * for (let i = 0; i < 100; i += 1) { + * for (let j = 0; j < 100; j += 1) { + * stroke(i, j, 0); + * point(i, j); + * } + * } + * describe( + * 'A diagonal green to red gradient from bottom-left to top-right with shading transitioning to black at top-left corner.' + * ); + * + *
                              + * + *
                              + * + * noStroke(); + * colorMode(HSB, 100); + * for (let i = 0; i < 100; i++) { + * for (let j = 0; j < 100; j++) { + * stroke(i, j, 100); + * point(i, j); + * } + * } + * describe('A rainbow gradient from left-to-right. Brightness transitions to white at the top.'); + * + *
                              + * + *
                              + * + * colorMode(RGB, 255); + * let myColor = color(180, 175, 230); + * background(myColor); + * colorMode(RGB, 1); + * let redValue = red(myColor); + * let greenValue = green(myColor); + * let blueValue = blue(myColor); + * text(`Red: ${redValue}`, 10, 10, 80, 80); + * text(`Green: ${greenValue}`, 10, 40, 80, 80); + * text(`Blue: ${blueValue}`, 10, 70, 80, 80); + * describe('A purple canvas with the red, green, and blue decimal values of the color written on it.'); + * + *
                              + * + *
                              + * + * noFill(); + * colorMode(RGB, 255, 255, 255, 1); + * background(255); + * strokeWeight(4); + * stroke(255, 0, 10, 0.3); + * circle(40, 40, 50); + * circle(50, 60, 50); + * describe('Two overlapping translucent pink circle outlines.'); + * + *
                              + * + */ + /** + * @method colorMode + * @param {Constant} mode + * @param {Number} max1 range for the red or hue depending on the + * current color mode. + * @param {Number} max2 range for the green or saturation depending + * on the current color mode. + * @param {Number} max3 range for the blue or brightness/lightness + * depending on the current color mode. + * @param {Number} [maxA] range for the alpha. + * @chainable + */ + _main.default.prototype.colorMode = function (mode, max1, max2, max3, maxA) { + _main.default._validateParameters('colorMode', arguments); + if (mode === constants.RGB || mode === constants.HSB || mode === constants.HSL) { + // Set color mode. + this._colorMode = mode; + // Set color maxes. + var maxes = this._colorMaxes[mode]; + if (arguments.length === 2) { + maxes[0] = max1; // Red + maxes[1] = max1; // Green + maxes[2] = max1; // Blue + maxes[3] = max1; // Alpha + } else if (arguments.length === 4) { + maxes[0] = max1; // Red + maxes[1] = max2; // Green + maxes[2] = max3; // Blue + } else if (arguments.length === 5) { + maxes[0] = max1; // Red + maxes[1] = max2; // Green + maxes[2] = max3; // Blue + maxes[3] = maxA; // Alpha + } + } + return this; + }; + /** + * Sets the color used to fill shapes. Calling `fill(255, 165, 0)` or + * `fill('orange')` means all shapes drawn after the fill command will be + * filled with the color orange. + * + * The version of `fill()` with one parameter interprets the value one of + * three ways. If the parameter is a number, it's interpreted as a grayscale + * value. If the parameter is a string, it's interpreted as a CSS color + * string. A p5.Color object can also be provided to + * set the fill color. + * + * The version of `fill()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current + * colorMode(). The default color space is RGB, + * with each value in the range from 0 to 255. + * + * @method fill + * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. + * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. + * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. + * @param {Number} [alpha] + * @chainable + * @example + *
                              + * + * // Grayscale integer value. + * fill(51); + * square(20, 20, 60); + * describe('A dark charcoal gray square with a black outline.'); + * + *
                              + * + *
                              + * + * // R, G & B integer values. + * fill(255, 204, 0); + * square(20, 20, 60); + * describe('A yellow square with a black outline.'); + * + *
                              + * + *
                              + * + * // H, S & B integer values. + * colorMode(HSB); + * fill(255, 204, 100); + * square(20, 20, 60); + * describe('A royal blue square with a black outline.'); + * + *
                              + * + *
                              + * + * // A CSS named color. + * fill('red'); + * square(20, 20, 60); + * describe('A red square with a black outline.'); + * + *
                              + * + *
                              + * + * // Three-digit hex RGB notation. + * fill('#fae'); + * square(20, 20, 60); + * describe('A pink square with a black outline.'); + * + *
                              + * + *
                              + * + * // Six-digit hex RGB notation. + * fill('#A251FA'); + * square(20, 20, 60); + * describe('A purple square with a black outline.'); + * + *
                              + * + *
                              + * + * // Integer RGB notation. + * fill('rgb(0,255,0)'); + * square(20, 20, 60); + * describe('A bright green square with a black outline.'); + * + *
                              + * + *
                              + * + * // Integer RGBA notation. + * fill('rgba(0,255,0, 0.25)'); + * square(20, 20, 60); + * describe('A soft green rectange with a black outline.'); + * + *
                              + * + *
                              + * + * // Percentage RGB notation. + * fill('rgb(100%,0%,10%)'); + * square(20, 20, 60); + * describe('A red square with a black outline.'); + * + *
                              + * + *
                              + * + * // Percentage RGBA notation. + * fill('rgba(100%,0%,100%,0.5)'); + * square(20, 20, 60); + * describe('A dark fuchsia square with a black outline.'); + * + *
                              + * + *
                              + * + * // p5.Color object. + * let c = color(0, 0, 255); + * fill(c); + * square(20, 20, 60); + * describe('A blue square with a black outline.'); + * + *
                              + */ + /** + * @method fill + * @param {String} value a color string. + * @chainable + */ + /** + * @method fill + * @param {Number} gray a grayscale value. + * @param {Number} [alpha] + * @chainable + */ + /** + * @method fill + * @param {Number[]} values an array containing the red, green, blue & + * and alpha components of the color. + * @chainable + */ + /** + * @method fill + * @param {p5.Color} color the fill color. + * @chainable + */ + _main.default.prototype.fill = function () { + var _this$_renderer2; + this._renderer._setProperty('_fillSet', true); + this._renderer._setProperty('_doFill', true); + (_this$_renderer2 = this._renderer).fill.apply(_this$_renderer2, arguments); + return this; + }; + /** + * Disables setting the interior color of shapes. This is the same as making + * the fill completely transparent. If both + * noStroke() and + * noFill() are called, nothing will be drawn to the + * screen. + * + * @method noFill + * @chainable + * @example + *
                              + * + * square(32, 10, 35); + * noFill(); + * square(32, 55, 35); + * describe('A white square on top of an empty square. Both squares have black outlines.'); + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(0); + * noFill(); + * stroke(100, 100, 240); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(45, 45, 45); + * describe('A purple cube wireframe spinning on a black canvas.'); + * } + * + *
                              + */ + _main.default.prototype.noFill = function () { + this._renderer._setProperty('_doFill', false); + return this; + }; + /** + * Disables drawing the stroke (outline). If both + * noStroke() and + * noFill() are called, nothing will be drawn to the + * screen. + * + * @method noStroke + * @chainable + * @example + *
                              + * + * noStroke(); + * square(20, 20, 60); + * describe('A white square with no outline.'); + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(0); + * noStroke(); + * fill(240, 150, 150); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(45, 45, 45); + * describe('A pink cube with no edge outlines spinning on a black canvas.'); + * } + * + *
                              + */ + _main.default.prototype.noStroke = function () { + this._renderer._setProperty('_doStroke', false); + return this; + }; + /** + * Sets the color used to draw lines and borders around shapes. Calling + * `stroke(255, 165, 0)` or `stroke('orange')` means all shapes drawn after + * the `stroke()` command will be filled with the color orange. The way these + * parameters are interpreted may be changed with the + * colorMode() function. + * + * The version of `stroke()` with one parameter interprets the value one of + * three ways. If the parameter is a number, it's interpreted as a grayscale + * value. If the parameter is a string, it's interpreted as a CSS color + * string. A p5.Color object can also be provided to + * set the stroke color. + * + * The version of `stroke()` with two parameters interprets the first one as a + * grayscale value. The second parameter sets the alpha (transparency) value. + * + * The version of `stroke()` with three parameters interprets them as RGB, HSB, + * or HSL colors, depending on the current `colorMode()`. + * + * The version of `stroke()` with four parameters interprets them as RGBA, HSBA, + * or HSLA colors, depending on the current `colorMode()`. The last parameter + * sets the alpha (transparency) value. + * + * @method stroke + * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. + * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. + * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. + * @param {Number} [alpha] + * @chainable + * + * @example + *
                              + * + * // Grayscale integer value. + * strokeWeight(4); + * stroke(51); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a dark charcoal gray outline.'); + * + *
                              + * + *
                              + * + * // R, G & B integer values. + * stroke(255, 204, 0); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a yellow outline.'); + * + *
                              + * + *
                              + * + * // H, S & B integer values. + * colorMode(HSB); + * strokeWeight(4); + * stroke(255, 204, 100); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a royal blue outline.'); + * + *
                              + * + *
                              + * + * // A CSS named color. + * stroke('red'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a red outline.'); + * + *
                              + * + *
                              + * + * // Three-digit hex RGB notation. + * stroke('#fae'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a pink outline.'); + * + *
                              + * + *
                              + * + * // Six-digit hex RGB notation. + * stroke('#222222'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a black outline.'); + * + *
                              + * + *
                              + * + * // Integer RGB notation. + * stroke('rgb(0,255,0)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A whiite rectangle with a bright green outline.'); + * + *
                              + * + *
                              + * + * // Integer RGBA notation. + * stroke('rgba(0,255,0,0.25)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a soft green outline.'); + * + *
                              + * + *
                              + * + * // Percentage RGB notation. + * stroke('rgb(100%,0%,10%)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a red outline.'); + * + *
                              + * + *
                              + * + * // Percentage RGBA notation. + * stroke('rgba(100%,0%,100%,0.5)'); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a dark fuchsia outline.'); + * + *
                              + * + *
                              + * + * // p5.Color object. + * stroke(color(0, 0, 255)); + * strokeWeight(4); + * rect(20, 20, 60, 60); + * describe('A white rectangle with a blue outline.'); + * + *
                              + */ + /** + * @method stroke + * @param {String} value a color string. + * @chainable + */ + /** + * @method stroke + * @param {Number} gray a grayscale value. + * @param {Number} [alpha] + * @chainable + */ + /** + * @method stroke + * @param {Number[]} values an array containing the red, green, blue, + * and alpha components of the color. + * @chainable + */ + /** + * @method stroke + * @param {p5.Color} color the stroke color. + * @chainable + */ + _main.default.prototype.stroke = function () { + var _this$_renderer3; + this._renderer._setProperty('_strokeSet', true); + this._renderer._setProperty('_doStroke', true); + (_this$_renderer3 = this._renderer).stroke.apply(_this$_renderer3, arguments); + return this; + }; + /** + * All drawing that follows erase() will subtract + * from the canvas, revealing the web page underneath. The erased areas will + * become transparent, allowing the content behind the canvas to show through. + * The fill(), stroke(), and + * blendMode() have no effect once `erase()` is + * called. + * + * The `erase()` function has two optional parameters. The first parameter + * sets the strength of erasing by the shape's interior. A value of 0 means + * that no erasing will occur. A value of 255 means that the shape's interior + * will fully erase the content underneath. The default value is 255 + * (full strength). + * + * The second parameter sets the strength of erasing by the shape's edge. A + * value of 0 means that no erasing will occur. A value of 255 means that the + * shape's edge will fully erase the content underneath. The default value is + * 255 (full strength). + * + * To cancel the erasing effect, use the noErase() + * function. + * + * `erase()` has no effect on drawing done with the + * image() and + * background() functions. + * + * @method erase + * @param {Number} [strengthFill] a number (0-255) for the strength of erasing under a shape's interior. + * Defaults to 255, which is full strength. + * @param {Number} [strengthStroke] a number (0-255) for the strength of erasing under a shape's edge. + * Defaults to 255, which is full strength. + * + * @chainable + * @example + *
                              + * + * background(100, 100, 250); + * fill(250, 100, 100); + * square(20, 20, 60); + * erase(); + * circle(25, 30, 30); + * noErase(); + * describe('A purple canvas with a pink square in the middle. A circle is erased from the top-left, leaving a white hole.'); + * + *
                              + * + *
                              + * + * let p = createP('I am a DOM element'); + * p.style('font-size', '12px'); + * p.style('width', '65px'); + * p.style('text-align', 'center'); + * p.position(18, 26); + * + * background(100, 170, 210); + * erase(200, 100); + * circle(50, 50, 77); + * noErase(); + * describe('A blue canvas with a circular hole in the center that reveals the message "I am a DOM element".'); + * + *
                              + * + *
                              + * + * background(150, 250, 150); + * fill(100, 100, 250); + * square(20, 20, 60); + * strokeWeight(5); + * erase(150, 255); + * triangle(50, 10, 70, 50, 90, 10); + * noErase(); + * describe('A mint green canvas with a purple square in the center. A triangle in the top-right corner partially erases its interior and a fully erases its outline.'); + * + *
                              + */ + _main.default.prototype.erase = function () { + var opacityFill = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 255; + var opacityStroke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 255; + this._renderer.erase(opacityFill, opacityStroke); + return this; + }; + /** + * Ends erasing that was started with erase(). + * The fill(), stroke(), and + * blendMode() settings will return to what they + * were prior to calling erase(). + * + * @method noErase + * @chainable + * @example + *
                              + * + * background(235, 145, 15); + * noStroke(); + * fill(30, 45, 220); + * rect(30, 10, 10, 80); + * erase(); + * circle(50, 50, 60); + * noErase(); + * rect(70, 10, 10, 80); + * describe('An orange canvas with two tall blue rectangles. A circular hole in the center erases the rectangle on the left but not the one on the right.'); + * + *
                              + */ + _main.default.prototype.noErase = function () { + this._renderer.noErase(); + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.Color': 284, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 286: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.QUADRATIC = exports.LINEAR = exports._CTX_MIDDLE = exports._DEFAULT_LEADMULT = exports._DEFAULT_TEXT_FILL = exports.WORD = exports.CHAR = exports.BOLDITALIC = exports.BOLD = exports.ITALIC = exports.NORMAL = exports.BLUR = exports.ERODE = exports.DILATE = exports.POSTERIZE = exports.INVERT = exports.OPAQUE = exports.GRAY = exports.THRESHOLD = exports.BURN = exports.DODGE = exports.SOFT_LIGHT = exports.HARD_LIGHT = exports.OVERLAY = exports.REPLACE = exports.SCREEN = exports.MULTIPLY = exports.EXCLUSION = exports.SUBTRACT = exports.DIFFERENCE = exports.LIGHTEST = exports.DARKEST = exports.ADD = exports.REMOVE = exports.BLEND = exports.UP_ARROW = exports.TAB = exports.SHIFT = exports.RIGHT_ARROW = exports.RETURN = exports.OPTION = exports.LEFT_ARROW = exports.ESCAPE = exports.ENTER = exports.DOWN_ARROW = exports.DELETE = exports.CONTROL = exports.BACKSPACE = exports.ALT = exports.AUTO = exports.HSL = exports.HSB = exports.RGB = exports.MITER = exports.BEVEL = exports.ROUND = exports.SQUARE = exports.PROJECT = exports.PIE = exports.CHORD = exports.OPEN = exports.CLOSE = exports.TESS = exports.QUAD_STRIP = exports.QUADS = exports.TRIANGLE_STRIP = exports.TRIANGLE_FAN = exports.TRIANGLES = exports.LINE_LOOP = exports.LINE_STRIP = exports.LINES = exports.POINTS = exports.BASELINE = exports.BOTTOM = exports.TOP = exports.CENTER = exports.LEFT = exports.RIGHT = exports.RADIUS = exports.CORNERS = exports.CORNER = exports.RAD_TO_DEG = exports.DEG_TO_RAD = exports.RADIANS = exports.DEGREES = exports.TWO_PI = exports.TAU = exports.QUARTER_PI = exports.PI = exports.HALF_PI = exports.WAIT = exports.TEXT = exports.MOVE = exports.HAND = exports.CROSS = exports.ARROW = exports.WEBGL2 = exports.WEBGL = exports.P2D = exports.VERSION = void 0; + exports.RGBA = exports.HALF_FLOAT = exports.FLOAT = exports.UNSIGNED_INT = exports.UNSIGNED_BYTE = exports.COVER = exports.CONTAIN = exports.FALLBACK = exports.LABEL = exports.AXES = exports.GRID = exports._DEFAULT_FILL = exports._DEFAULT_STROKE = exports.PORTRAIT = exports.LANDSCAPE = exports.SMOOTH = exports.FLAT = exports.MIRROR = exports.CLAMP = exports.REPEAT = exports.NEAREST = exports.IMAGE = exports.IMMEDIATE = exports.TEXTURE = exports.FILL = exports.STROKE = exports.CURVE = exports.BEZIER = void 0; + /** + * @module Constants + * @submodule Constants + * @for p5 + */ + var _PI = Math.PI; + /** + * Version of this p5.js. + * @property {String} VERSION + * @final + */ + var VERSION = '1.9.0'; + // GRAPHICS RENDERER + /** + * The default, two-dimensional renderer. + * @property {String} P2D + * @final + */ + exports.VERSION = VERSION; + var P2D = 'p2d'; + /** + * One of the two render modes in p5.js, used for computationally intensive tasks like 3D rendering and shaders. + * + * `WEBGL` differs from the default `P2D` renderer in the following ways: + * + * - **Coordinate System** - When drawing in `WEBGL` mode, the origin point (0,0,0) is located at the center of the screen, not the top-left corner. See the learn page about coordinates and transformations. + * - **3D Shapes** - `WEBGL` mode can be used to draw 3-dimensional shapes like box(), sphere(), cone(), and more. See the learn page about custom geometry to make more complex objects. + * - **Shape Detail** - When drawing in `WEBGL` mode, you can specify how smooth curves should be drawn by using a `detail` parameter. See the wiki section about shapes for a more information and an example. + * - **Textures** - A texture is like a skin that wraps onto a shape. See the wiki section about textures for examples of mapping images onto surfaces with textures. + * - **Materials and Lighting** - `WEBGL` offers different types of lights like ambientLight() to place around a scene. Materials like specularMaterial() reflect the lighting to convey shape and depth. See the learn page for styling and appearance to experiment with different combinations. + * - **Camera** - The viewport of a `WEBGL` sketch can be adjusted by changing camera attributes. See the learn page section about cameras for an explanation of camera controls. + * - **Text** - `WEBGL` requires opentype/truetype font files to be preloaded using loadFont(). See the wiki section about text for details, along with a workaround. + * - **Shaders** - Shaders are hardware accelerated programs that can be used for a variety of effects and graphics. See the introduction to shaders to get started with shaders in p5.js. + * - **Graphics Acceleration** - `WEBGL` mode uses the graphics card instead of the CPU, so it may help boost the performance of your sketch (example: drawing more shapes on the screen at once). + * + * To learn more about WEBGL mode, check out all the interactive WEBGL tutorials in the "Learn" section of this website, or read the wiki article "Getting started with WebGL in p5". + * + * @property {String} WEBGL + * @final + */ + exports.P2D = P2D; + var WEBGL = 'webgl'; + /** + * One of the two possible values of a WebGL canvas (either WEBGL or WEBGL2), + * which can be used to determine what capabilities the rendering environment + * has. + * @property {String} WEBGL2 + * @final + */ + exports.WEBGL = WEBGL; + var WEBGL2 = 'webgl2'; + // ENVIRONMENT + /** + * @property {String} ARROW + * @final + */ + exports.WEBGL2 = WEBGL2; + var ARROW = 'default'; + /** + * @property {String} CROSS + * @final + */ + exports.ARROW = ARROW; + var CROSS = 'crosshair'; + /** + * @property {String} HAND + * @final + */ + exports.CROSS = CROSS; + var HAND = 'pointer'; + /** + * @property {String} MOVE + * @final + */ + exports.HAND = HAND; + var MOVE = 'move'; + /** + * @property {String} TEXT + * @final + */ + exports.MOVE = MOVE; + var TEXT = 'text'; + /** + * @property {String} WAIT + * @final + */ + exports.TEXT = TEXT; + var WAIT = 'wait'; + // TRIGONOMETRY + /** + * HALF_PI is a mathematical constant with the value + * 1.57079632679489661923. It is half the ratio of the + * circumference of a circle to its diameter. It is useful in + * combination with the trigonometric functions sin() and cos(). + * + * @property {Number} HALF_PI + * @final + * + * @example + *
                              + * arc(50, 50, 80, 80, 0, HALF_PI); + *
                              + * + * @alt + * 80×80 white quarter-circle with curve toward bottom right of canvas. + */ + exports.WAIT = WAIT; + var HALF_PI = _PI / 2; + /** + * PI is a mathematical constant with the value + * 3.14159265358979323846. It is the ratio of the circumference + * of a circle to its diameter. It is useful in combination with + * the trigonometric functions sin() and cos(). + * + * @property {Number} PI + * @final + * + * @example + *
                              + * arc(50, 50, 80, 80, 0, PI); + *
                              + * + * @alt + * white half-circle with curve toward bottom of canvas. + */ + exports.HALF_PI = HALF_PI; + var PI = _PI; + /** + * QUARTER_PI is a mathematical constant with the value 0.7853982. + * It is one quarter the ratio of the circumference of a circle to + * its diameter. It is useful in combination with the trigonometric + * functions sin() and cos(). + * + * @property {Number} QUARTER_PI + * @final + * + * @example + *
                              + * arc(50, 50, 80, 80, 0, QUARTER_PI); + *
                              + * + * @alt + * white eighth-circle rotated about 40 degrees with curve bottom right canvas. + */ + exports.PI = PI; + var QUARTER_PI = _PI / 4; + /** + * TAU is an alias for TWO_PI, a mathematical constant with the + * value 6.28318530717958647693. It is twice the ratio of the + * circumference of a circle to its diameter. It is useful in + * combination with the trigonometric functions sin() and cos(). + * + * @property {Number} TAU + * @final + * + * @example + *
                              + * arc(50, 50, 80, 80, 0, TAU); + *
                              + * + * @alt + * 80×80 white ellipse shape in center of canvas. + */ + exports.QUARTER_PI = QUARTER_PI; + var TAU = _PI * 2; + /** + * TWO_PI is a mathematical constant with the value + * 6.28318530717958647693. It is twice the ratio of the + * circumference of a circle to its diameter. It is useful in + * combination with the trigonometric functions sin() and cos(). + * + * @property {Number} TWO_PI + * @final + * + * @example + *
                              + * arc(50, 50, 80, 80, 0, TWO_PI); + *
                              + * + * @alt + * 80×80 white ellipse shape in center of canvas. + */ + exports.TAU = TAU; + var TWO_PI = _PI * 2; + /** + * Constant to be used with the angleMode() function, to set the mode in + * which p5.js interprets and calculates angles (either DEGREES or RADIANS). + * @property {String} DEGREES + * @final + * + * @example + *
                              + * function setup() { + * angleMode(DEGREES); + * } + *
                              + */ + exports.TWO_PI = TWO_PI; + var DEGREES = 'degrees'; + /** + * Constant to be used with the angleMode() function, to set the mode + * in which p5.js interprets and calculates angles (either RADIANS or DEGREES). + * @property {String} RADIANS + * @final + * + * @example + *
                              + * function setup() { + * angleMode(RADIANS); + * } + *
                              + */ + exports.DEGREES = DEGREES; + var RADIANS = 'radians'; + exports.RADIANS = RADIANS; + var DEG_TO_RAD = _PI / 180; + exports.DEG_TO_RAD = DEG_TO_RAD; + var RAD_TO_DEG = 180 / _PI; + // SHAPE + /** + * @property {String} CORNER + * @final + */ + exports.RAD_TO_DEG = RAD_TO_DEG; + var CORNER = 'corner'; + /** + * @property {String} CORNERS + * @final + */ + exports.CORNER = CORNER; + var CORNERS = 'corners'; + /** + * @property {String} RADIUS + * @final + */ + exports.CORNERS = CORNERS; + var RADIUS = 'radius'; + /** + * @property {String} RIGHT + * @final + */ + exports.RADIUS = RADIUS; + var RIGHT = 'right'; + /** + * @property {String} LEFT + * @final + */ + exports.RIGHT = RIGHT; + var LEFT = 'left'; + /** + * @property {String} CENTER + * @final + */ + exports.LEFT = LEFT; + var CENTER = 'center'; + /** + * @property {String} TOP + * @final + */ + exports.CENTER = CENTER; + var TOP = 'top'; + /** + * @property {String} BOTTOM + * @final + */ + exports.TOP = TOP; + var BOTTOM = 'bottom'; + /** + * @property {String} BASELINE + * @final + * @default alphabetic + */ + exports.BOTTOM = BOTTOM; + var BASELINE = 'alphabetic'; + /** + * @property {Number} POINTS + * @final + * @default 0x0000 + */ + exports.BASELINE = BASELINE; + var POINTS = 0; + /** + * @property {Number} LINES + * @final + * @default 0x0001 + */ + exports.POINTS = POINTS; + var LINES = 1; + /** + * @property {Number} LINE_STRIP + * @final + * @default 0x0003 + */ + exports.LINES = LINES; + var LINE_STRIP = 3; + /** + * @property {Number} LINE_LOOP + * @final + * @default 0x0002 + */ + exports.LINE_STRIP = LINE_STRIP; + var LINE_LOOP = 2; + /** + * @property {Number} TRIANGLES + * @final + * @default 0x0004 + */ + exports.LINE_LOOP = LINE_LOOP; + var TRIANGLES = 4; + /** + * @property {Number} TRIANGLE_FAN + * @final + * @default 0x0006 + */ + exports.TRIANGLES = TRIANGLES; + var TRIANGLE_FAN = 6; + /** + * @property {Number} TRIANGLE_STRIP + * @final + * @default 0x0005 + */ + exports.TRIANGLE_FAN = TRIANGLE_FAN; + var TRIANGLE_STRIP = 5; + /** + * @property {String} QUADS + * @final + */ + exports.TRIANGLE_STRIP = TRIANGLE_STRIP; + var QUADS = 'quads'; + /** + * @property {String} QUAD_STRIP + * @final + * @default quad_strip + */ + exports.QUADS = QUADS; + var QUAD_STRIP = 'quad_strip'; + /** + * @property {String} TESS + * @final + * @default tess + */ + exports.QUAD_STRIP = QUAD_STRIP; + var TESS = 'tess'; + /** + * @property {String} CLOSE + * @final + */ + exports.TESS = TESS; + var CLOSE = 'close'; + /** + * @property {String} OPEN + * @final + */ + exports.CLOSE = CLOSE; + var OPEN = 'open'; + /** + * @property {String} CHORD + * @final + */ + exports.OPEN = OPEN; + var CHORD = 'chord'; + /** + * @property {String} PIE + * @final + */ + exports.CHORD = CHORD; + var PIE = 'pie'; + /** + * @property {String} PROJECT + * @final + * @default square + */ + exports.PIE = PIE; + var PROJECT = 'square'; // PEND: careful this is counterintuitive + /** + * @property {String} SQUARE + * @final + * @default butt + */ + exports.PROJECT = PROJECT; + var SQUARE = 'butt'; + /** + * @property {String} ROUND + * @final + */ + exports.SQUARE = SQUARE; + var ROUND = 'round'; + /** + * @property {String} BEVEL + * @final + */ + exports.ROUND = ROUND; + var BEVEL = 'bevel'; + /** + * @property {String} MITER + * @final + */ + exports.BEVEL = BEVEL; + var MITER = 'miter'; + // COLOR + /** + * @property {String} RGB + * @final + */ + exports.MITER = MITER; + var RGB = 'rgb'; + /** + * HSB (hue, saturation, brightness) is a type of color model. + * You can learn more about it at + * HSB. + * + * @property {String} HSB + * @final + */ + exports.RGB = RGB; + var HSB = 'hsb'; + /** + * @property {String} HSL + * @final + */ + exports.HSB = HSB; + var HSL = 'hsl'; + // DOM EXTENSION + /** + * AUTO allows us to automatically set the width or height of an element (but not both), + * based on the current height and width of the element. Only one parameter can + * be passed to the size function as AUTO, at a time. + * + * @property {String} AUTO + * @final + */ + exports.HSL = HSL; + var AUTO = 'auto'; + /** + * @property {Number} ALT + * @final + */ + // INPUT + exports.AUTO = AUTO; + var ALT = 18; + /** + * @property {Number} BACKSPACE + * @final + */ + exports.ALT = ALT; + var BACKSPACE = 8; + /** + * @property {Number} CONTROL + * @final + */ + exports.BACKSPACE = BACKSPACE; + var CONTROL = 17; + /** + * @property {Number} DELETE + * @final + */ + exports.CONTROL = CONTROL; + var DELETE = 46; + /** + * @property {Number} DOWN_ARROW + * @final + */ + exports.DELETE = DELETE; + var DOWN_ARROW = 40; + /** + * @property {Number} ENTER + * @final + */ + exports.DOWN_ARROW = DOWN_ARROW; + var ENTER = 13; + /** + * @property {Number} ESCAPE + * @final + */ + exports.ENTER = ENTER; + var ESCAPE = 27; + /** + * @property {Number} LEFT_ARROW + * @final + */ + exports.ESCAPE = ESCAPE; + var LEFT_ARROW = 37; + /** + * @property {Number} OPTION + * @final + */ + exports.LEFT_ARROW = LEFT_ARROW; + var OPTION = 18; + /** + * @property {Number} RETURN + * @final + */ + exports.OPTION = OPTION; + var RETURN = 13; + /** + * @property {Number} RIGHT_ARROW + * @final + */ + exports.RETURN = RETURN; + var RIGHT_ARROW = 39; + /** + * @property {Number} SHIFT + * @final + */ + exports.RIGHT_ARROW = RIGHT_ARROW; + var SHIFT = 16; + /** + * @property {Number} TAB + * @final + */ + exports.SHIFT = SHIFT; + var TAB = 9; + /** + * @property {Number} UP_ARROW + * @final + */ + exports.TAB = TAB; + var UP_ARROW = 38; + // RENDERING + /** + * @property {String} BLEND + * @final + * @default source-over + */ + exports.UP_ARROW = UP_ARROW; + var BLEND = 'source-over'; + /** + * @property {String} REMOVE + * @final + * @default destination-out + */ + exports.BLEND = BLEND; + var REMOVE = 'destination-out'; + /** + * @property {String} ADD + * @final + * @default lighter + */ + exports.REMOVE = REMOVE; + var ADD = 'lighter'; + //ADD: 'add', // + //SUBTRACT: 'subtract', // + /** + * @property {String} DARKEST + * @final + */ + exports.ADD = ADD; + var DARKEST = 'darken'; + /** + * @property {String} LIGHTEST + * @final + * @default lighten + */ + exports.DARKEST = DARKEST; + var LIGHTEST = 'lighten'; + /** + * @property {String} DIFFERENCE + * @final + */ + exports.LIGHTEST = LIGHTEST; + var DIFFERENCE = 'difference'; + /** + * @property {String} SUBTRACT + * @final + */ + exports.DIFFERENCE = DIFFERENCE; + var SUBTRACT = 'subtract'; + /** + * @property {String} EXCLUSION + * @final + */ + exports.SUBTRACT = SUBTRACT; + var EXCLUSION = 'exclusion'; + /** + * @property {String} MULTIPLY + * @final + */ + exports.EXCLUSION = EXCLUSION; + var MULTIPLY = 'multiply'; + /** + * @property {String} SCREEN + * @final + */ + exports.MULTIPLY = MULTIPLY; + var SCREEN = 'screen'; + /** + * @property {String} REPLACE + * @final + * @default copy + */ + exports.SCREEN = SCREEN; + var REPLACE = 'copy'; + /** + * @property {String} OVERLAY + * @final + */ + exports.REPLACE = REPLACE; + var OVERLAY = 'overlay'; + /** + * @property {String} HARD_LIGHT + * @final + */ + exports.OVERLAY = OVERLAY; + var HARD_LIGHT = 'hard-light'; + /** + * @property {String} SOFT_LIGHT + * @final + */ + exports.HARD_LIGHT = HARD_LIGHT; + var SOFT_LIGHT = 'soft-light'; + /** + * @property {String} DODGE + * @final + * @default color-dodge + */ + exports.SOFT_LIGHT = SOFT_LIGHT; + var DODGE = 'color-dodge'; + /** + * @property {String} BURN + * @final + * @default color-burn + */ + exports.DODGE = DODGE; + var BURN = 'color-burn'; + // FILTERS + /** + * @property {String} THRESHOLD + * @final + */ + exports.BURN = BURN; + var THRESHOLD = 'threshold'; + /** + * @property {String} GRAY + * @final + */ + exports.THRESHOLD = THRESHOLD; + var GRAY = 'gray'; + /** + * @property {String} OPAQUE + * @final + */ + exports.GRAY = GRAY; + var OPAQUE = 'opaque'; + /** + * @property {String} INVERT + * @final + */ + exports.OPAQUE = OPAQUE; + var INVERT = 'invert'; + /** + * @property {String} POSTERIZE + * @final + */ + exports.INVERT = INVERT; + var POSTERIZE = 'posterize'; + /** + * @property {String} DILATE + * @final + */ + exports.POSTERIZE = POSTERIZE; + var DILATE = 'dilate'; + /** + * @property {String} ERODE + * @final + */ + exports.DILATE = DILATE; + var ERODE = 'erode'; + /** + * @property {String} BLUR + * @final + */ + exports.ERODE = ERODE; + var BLUR = 'blur'; + // TYPOGRAPHY + /** + * @property {String} NORMAL + * @final + */ + exports.BLUR = BLUR; + var NORMAL = 'normal'; + /** + * @property {String} ITALIC + * @final + */ + exports.NORMAL = NORMAL; + var ITALIC = 'italic'; + /** + * @property {String} BOLD + * @final + */ + exports.ITALIC = ITALIC; + var BOLD = 'bold'; + /** + * @property {String} BOLDITALIC + * @final + */ + exports.BOLD = BOLD; + var BOLDITALIC = 'bold italic'; + /** + * @property {String} CHAR + * @final + */ + exports.BOLDITALIC = BOLDITALIC; + var CHAR = 'CHAR'; + /** + * @property {String} WORD + * @final + */ + exports.CHAR = CHAR; + var WORD = 'WORD'; + // TYPOGRAPHY-INTERNAL + exports.WORD = WORD; + var _DEFAULT_TEXT_FILL = '#000000'; + exports._DEFAULT_TEXT_FILL = _DEFAULT_TEXT_FILL; + var _DEFAULT_LEADMULT = 1.25; + exports._DEFAULT_LEADMULT = _DEFAULT_LEADMULT; + var _CTX_MIDDLE = 'middle'; + // VERTICES + /** + * @property {String} LINEAR + * @final + */ + exports._CTX_MIDDLE = _CTX_MIDDLE; + var LINEAR = 'linear'; + /** + * @property {String} QUADRATIC + * @final + */ + exports.LINEAR = LINEAR; + var QUADRATIC = 'quadratic'; + /** + * @property {String} BEZIER + * @final + */ + exports.QUADRATIC = QUADRATIC; + var BEZIER = 'bezier'; + /** + * @property {String} CURVE + * @final + */ + exports.BEZIER = BEZIER; + var CURVE = 'curve'; + // WEBGL DRAWMODES + /** + * @property {String} STROKE + * @final + */ + exports.CURVE = CURVE; + var STROKE = 'stroke'; + /** + * @property {String} FILL + * @final + */ + exports.STROKE = STROKE; + var FILL = 'fill'; + /** + * @property {String} TEXTURE + * @final + */ + exports.FILL = FILL; + var TEXTURE = 'texture'; + /** + * @property {String} IMMEDIATE + * @final + */ + exports.TEXTURE = TEXTURE; + var IMMEDIATE = 'immediate'; + // WEBGL TEXTURE MODE + // NORMAL already exists for typography + /** + * @property {String} IMAGE + * @final + */ + exports.IMMEDIATE = IMMEDIATE; + var IMAGE = 'image'; + // WEBGL TEXTURE WRAP AND FILTERING + // LINEAR already exists above + /** + * @property {String} NEAREST + * @final + */ + exports.IMAGE = IMAGE; + var NEAREST = 'nearest'; + /** + * @property {String} REPEAT + * @final + */ + exports.NEAREST = NEAREST; + var REPEAT = 'repeat'; + /** + * @property {String} CLAMP + * @final + */ + exports.REPEAT = REPEAT; + var CLAMP = 'clamp'; + /** + * @property {String} MIRROR + * @final + */ + exports.CLAMP = CLAMP; + var MIRROR = 'mirror'; + // WEBGL GEOMETRY SHADING + /** + * @property {String} FLAT + * @final + */ + exports.MIRROR = MIRROR; + var FLAT = 'flat'; + /** + * @property {String} SMOOTH + * @final + */ + exports.FLAT = FLAT; + var SMOOTH = 'smooth'; + // DEVICE-ORIENTATION + /** + * @property {String} LANDSCAPE + * @final + */ + exports.SMOOTH = SMOOTH; + var LANDSCAPE = 'landscape'; + /** + * @property {String} PORTRAIT + * @final + */ + exports.LANDSCAPE = LANDSCAPE; + var PORTRAIT = 'portrait'; + // DEFAULTS + exports.PORTRAIT = PORTRAIT; + var _DEFAULT_STROKE = '#000000'; + exports._DEFAULT_STROKE = _DEFAULT_STROKE; + var _DEFAULT_FILL = '#FFFFFF'; + /** + * @property {String} GRID + * @final + */ + exports._DEFAULT_FILL = _DEFAULT_FILL; + var GRID = 'grid'; + /** + * @property {String} AXES + * @final + */ + exports.GRID = GRID; + var AXES = 'axes'; + /** + * @property {String} LABEL + * @final + */ + exports.AXES = AXES; + var LABEL = 'label'; + /** + * @property {String} FALLBACK + * @final + */ + exports.LABEL = LABEL; + var FALLBACK = 'fallback'; + /** + * @property {String} CONTAIN + * @final + */ + exports.FALLBACK = FALLBACK; + var CONTAIN = 'contain'; + /** + * @property {String} COVER + * @final + */ + exports.CONTAIN = CONTAIN; + var COVER = 'cover'; + /** + * @property {String} UNSIGNED_BYTE + * @final + */ + exports.COVER = COVER; + var UNSIGNED_BYTE = 'unsigned-byte'; + /** + * @property {String} UNSIGNED_INT + * @final + */ + exports.UNSIGNED_BYTE = UNSIGNED_BYTE; + var UNSIGNED_INT = 'unsigned-int'; + /** + * @property {String} FLOAT + * @final + */ + exports.UNSIGNED_INT = UNSIGNED_INT; + var FLOAT = 'float'; + /** + * @property {String} HALF_FLOAT + * @final + */ + exports.FLOAT = FLOAT; + var HALF_FLOAT = 'half-float'; + /** + * @property {String} RGBA + * @final + */ + exports.HALF_FLOAT = HALF_FLOAT; + var RGBA = 'rgba'; + exports.RGBA = RGBA; + }, + { + } + ], + 287: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.search'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.search'); + _dereq_('core-js/modules/es.string.split'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + var C = _interopRequireWildcard(_dereq_('./constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Environment + * @submodule Environment + * @for p5 + * @requires core + * @requires constants + */ + + var standardCursors = [ + C.ARROW, + C.CROSS, + C.HAND, + C.MOVE, + C.TEXT, + C.WAIT + ]; + _main.default.prototype._frameRate = 0; + _main.default.prototype._lastFrameTime = window.performance.now(); + _main.default.prototype._targetFrameRate = 60; + var _windowPrint = window.print; + var windowPrintDisabled = false; + /** + * Displays text in the web browser's console. + * + * `print()` is helpful for printing values while debugging. Each call to + * `print()` creates a new line of text. + * + * Note: Call `print('\n')` to print a blank line. Calling `print()` without + * an argument opens the browser's dialog for printing documents. + * + * @method print + * @param {Any} contents content to print to the console. + * @example + *
                              + * + * function setup() { + * // Prints "hello, world" to the console. + * print('hello, world'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * let name = 'ada'; + * // Prints "hello, ada" to the console. + * print(`hello, ${name}`); + * } + * + *
                              + */ + _main.default.prototype.print = function () { + if (!arguments.length) { + if (!windowPrintDisabled) { + _windowPrint(); + if (window.confirm('You just tried to print the webpage. Do you want to prevent this from running again?')) { + windowPrintDisabled = true; + } + } + } else { + var _console; + (_console = console).log.apply(_console, arguments); + } + }; + /** + * Tracks the number of frames drawn since the sketch started. + * + * `frameCount`'s value is 0 inside setup(). It + * increments by 1 each time the code in draw() + * finishes executing. + * + * @property {Integer} frameCount + * @readOnly + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Display the value of + * // frameCount. + * textSize(30); + * textAlign(CENTER, CENTER); + * text(frameCount, 50, 50); + * + * describe('The number 0 written in black in the middle of a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Set the frameRate to 30. + * frameRate(30); + * + * textSize(30); + * textAlign(CENTER, CENTER); + * } + * + * function draw() { + * background(200); + * + * // Display the value of + * // frameCount. + * text(frameCount, 50, 50); + * + * describe('A number written in black in the middle of a gray square. Its value increases rapidly.'); + * } + * + *
                              + */ + _main.default.prototype.frameCount = 0; + /** + * Tracks the amount of time, in milliseconds, it took for + * draw to draw the previous frame. `deltaTime` is + * useful for simulating physics. + * + * @property {Integer} deltaTime + * @readOnly + * @example + *
                              + * + * let x = 0; + * let speed = 0.05; + * + * function setup() { + * // Set the frameRate to 30. + * frameRate(30); + * } + * + * function draw() { + * background(200); + * + * // Use deltaTime to calculate + * // a change in position. + * let deltaX = speed * deltaTime; + * + * // Update the x variable. + * x += deltaX; + * + * // Reset x to 0 if it's + * // greater than 100. + * if (x > 100) { + * x = 0; + * } + * + * // Use x to set the circle's + * // position. + * circle(x, 50, 20); + * + * describe('A white circle moves from left to right on a gray background. It reappears on the left side when it reaches the right side.'); + * } + * + *
                              + */ + _main.default.prototype.deltaTime = 0; + /** + * Tracks whether the browser window is focused and can receive user input. + * `focused` is `true` if the window if focused and `false` if not. + * + * @property {Boolean} focused + * @readOnly + * @example + *
                              + * + * // Open this example in two separate browser + * // windows placed side-by-side to demonstrate. + * + * function draw() { + * // Change the background color + * // when the browser window + * // goes in/out of focus. + * if (focused === true) { + * background(0, 255, 0); + * } else { + * background(255, 0, 0); + * } + * + * describe('A square changes color from green to red when the browser window is out of focus.'); + * } + * + *
                              + */ + _main.default.prototype.focused = document.hasFocus(); + /** + * Changes the cursor's appearance. + * + * The first parameter, `type`, sets the type of cursor to display. The + * built-in options are `ARROW`, `CROSS`, `HAND`, `MOVE`, `TEXT`, and `WAIT`. + * `cursor()` also recognizes standard CSS cursor properties passed as + * strings: `'help'`, `'wait'`, `'crosshair'`, `'not-allowed'`, `'zoom-in'`, + * and `'grab'`. If the path to an image is passed, as in + * `cursor('assets/target.png')`, then the image will be used as the cursor. + * Images must be in .cur, .gif, .jpg, .jpeg, or .png format. + * + * The parameters `x` and `y` are optional. If an image is used for the + * cursor, `x` and `y` set the location pointed to within the image. They are + * both 0 by default, so the cursor points to the image's top-left corner. `x` + * and `y` must be less than the image's width and height, respectively. + * + * @method cursor + * @param {String|Constant} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT. + * Native CSS properties: 'grab', 'progress', and so on. + * Path to cursor image. + * @param {Number} [x] horizontal active spot of the cursor. + * @param {Number} [y] vertical active spot of the cursor. + * @example + *
                              + * + * function draw() { + * background(200); + * + * // Set the cursor to crosshairs: + + * cursor(CROSS); + * + * describe('A gray square. The cursor appears as crosshairs.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * // Divide the canvas into quadrants. + * line(50, 0, 50, 100); + * line(0, 50, 100, 50); + * + * // Change cursor based on mouse position. + * if (mouseX < 50 && mouseY < 50) { + * cursor(CROSS); + * } else if (mouseX > 50 && mouseY < 50) { + * cursor('progress'); + * } else if (mouseX > 50 && mouseY > 50) { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); + * } else { + * cursor('grab'); + * } + * + * describe('A gray square divided into quadrants. The cursor image changes when the mouse moves to each quadrant.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * // Change the cursor's active spot + * // when the mouse is pressed. + * if (mouseIsPressed === true) { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16', 8, 8); + * } else { + * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); + * } + * + * describe('An image of three purple curves follows the mouse. The image shifts when the mouse is pressed.'); + * } + * + *
                              + */ + _main.default.prototype.cursor = function (type, x, y) { + var cursor = 'auto'; + var canvas = this._curElement.elt; + if (standardCursors.includes(type)) { + // Standard css cursor + cursor = type; + } else if (typeof type === 'string') { + var coords = ''; + if (x && y && typeof x === 'number' && typeof y === 'number') { + // Note that x and y values must be unit-less positive integers < 32 + // https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + coords = ''.concat(x, ' ').concat(y); + } + if (type.substring(0, 7) === 'http://' || type.substring(0, 8) === 'https://') { + // Image (absolute url) + cursor = 'url('.concat(type, ') ').concat(coords, ', auto'); + } else if (/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(type)) { + // Image file (relative path) - Separated for performance reasons + cursor = 'url('.concat(type, ') ').concat(coords, ', auto'); + } else { + // Any valid string for the css cursor property + cursor = type; + } + } + canvas.style.cursor = cursor; + }; + /** + * Sets the number of frames to draw per second. + * + * Calling `frameRate()` with one numeric argument, as in `frameRate(30)`, + * attempts to draw 30 frames per second (FPS). The target frame rate may not + * be achieved depending on the sketch's processing needs. Most computers + * default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are + * fast enough for smooth animations. + * + * Calling `frameRate()` without an argument returns the current frame rate. + * The value returned is an approximation. + * + * @method frameRate + * @param {Number} fps number of frames to draw per second. + * @chainable + * + * @example + *
                              + * + * function draw() { + * background(200); + * + * // Set the x variable based + * // on the current frameCount. + * let x = frameCount % 100; + * + * // If the mouse is pressed, + * // decrease the frame rate. + * if (mouseIsPressed === true) { + * frameRate(10); + * } else { + * frameRate(60); + * } + * + * // Use x to set the circle's + * // position. + * circle(x, 50, 20); + * + * describe('A white circle on a gray background. The circle moves from left to right in a loop. It slows down when the mouse is pressed.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * // If the mouse is pressed, do lots + * // of math to slow down drawing. + * if (mouseIsPressed === true) { + * for (let i = 0; i < 1000000; i += 1) { + * random(); + * } + * } + * + * // Get the current frame rate + * // and display it. + * let fps = frameRate(); + * text(fps, 50, 50); + * + * describe('A number written in black written on a gray background. The number decreases when the mouse is pressed.'); + * } + * + *
                              + */ + /** + * @method frameRate + * @return {Number} current frame rate. + */ + _main.default.prototype.frameRate = function (fps) { + _main.default._validateParameters('frameRate', arguments); + if (typeof fps !== 'number' || fps < 0) { + return this._frameRate; + } else { + this._setProperty('_targetFrameRate', fps); + if (fps === 0) { + this._setProperty('_frameRate', fps); + } + return this; + } + }; + /** + * Returns the current framerate. + * + * @private + * @return {Number} current frameRate + */ + _main.default.prototype.getFrameRate = function () { + return this.frameRate(); + }; + /** + * Specifies the number of frames to be displayed every second. For example, + * the function call frameRate(30) will attempt to refresh 30 times a second. + * If the processor is not fast enough to maintain the specified rate, the + * frame rate will not be achieved. Setting the frame rate within setup() is + * recommended. The default rate is 60 frames per second. + * + * Calling `frameRate()` with no arguments returns the current frame rate. + * + * @private + * @param {Number} [fps] number of frames to be displayed every second + */ + _main.default.prototype.setFrameRate = function (fps) { + return this.frameRate(fps); + }; + /** + * Returns the target frame rate. The value is either the system frame rate or + * the last value passed to frameRate(). + * + * @method getTargetFrameRate + * @return {Number} _targetFrameRate + * @example + *
                              + * + * function draw() { + * background(200); + * + * // Set the frame rate to 20. + * frameRate(20); + * + * // Get the target frame rate and + * // display it. + * let fps = getTargetFrameRate(); + * text(fps, 43, 54); + * + * describe('The number 20 written in black on a gray background.'); + * } + * + *
                              + */ + _main.default.prototype.getTargetFrameRate = function () { + return this._targetFrameRate; + }; + /** + * Hides the cursor from view. + * + * @method noCursor + * @example + *
                              + * + * function setup() { + * // Hide the cursor. + * noCursor(); + * } + * + * function draw() { + * background(200); + * + * circle(mouseX, mouseY, 10); + * + * describe('A white circle on a gray background. The circle follows the mouse as it moves. The cursor is hidden.'); + * } + * + *
                              + */ + _main.default.prototype.noCursor = function () { + this._curElement.elt.style.cursor = 'none'; + }; + /** + * A string variable with the WebGL version in use. Its value equals one of + * the followin string constants: + * + * - `WEBGL2` whose value is `'webgl2'`, + * - `WEBGL` whose value is `'webgl'`, or + * - `P2D` whose value is `'p2d'`. This is the default for 2D sketches. + * + * See setAttributes() for ways to set the + * WebGL version. + * + * @property {String} webglVersion + * @readOnly + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Display the current WebGL version. + * text(webglVersion, 42, 54); + * + * describe('The text "p2d" written in black on a gray background.'); + * } + * + *
                              + * + *
                              + * + * let font; + * + * function preload() { + * // Load a font to use. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * // Create a canvas using WEBGL mode. + * createCanvas(100, 50, WEBGL); + * background(200); + * + * // Display the current WebGL version. + * fill(0); + * textFont(font); + * text(webglVersion, -15, 5); + * + * describe('The text "webgl2" written in black on a gray background.'); + * } + * + *
                              + * + *
                              + * + * let font; + * + * function preload() { + * // Load a font to use. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * // Create a canvas using WEBGL mode. + * createCanvas(100, 50, WEBGL); + * + * // Set WebGL to version 1. + * setAttributes({ version: 1 }); + * + * background(200); + * + * // Display the current WebGL version. + * fill(0); + * textFont(font); + * text(webglVersion, -14, 5); + * + * describe('The text "webgl" written in black on a gray background.'); + * } + * + *
                              + */ + _main.default.prototype.webglVersion = C.P2D; + /** + * A numeric variable that stores the width of the screen display. Its value + * depends on the current pixelDensity(). + * `displayWidth` is useful for running full-screen programs. + * + * Note: The actual screen width can be computed as + * `displayWidth * pixelDensity()`. + * + * @property {Number} displayWidth + * @readOnly + * @example + *
                              + * + * function setup() { + * // Set the canvas' width and height + * // using the display's dimensions. + * createCanvas(displayWidth, displayHeight); + * + * background(200); + * + * describe('A gray canvas that is the same size as the display.'); + * } + * + *
                              + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.displayWidth = screen.width; + /** + * A numeric variable that stores the height of the screen display. Its value + * depends on the current pixelDensity(). + * `displayHeight` is useful for running full-screen programs. + * + * Note: The actual screen height can be computed as + * `displayHeight * pixelDensity()`. + * + * @property {Number} displayHeight + * @readOnly + * @example + *
                              + * + * function setup() { + * // Set the canvas' width and height + * // using the display's dimensions. + * createCanvas(displayWidth, displayHeight); + * + * background(200); + * + * describe('A gray canvas that is the same size as the display.'); + * } + * + *
                              + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.displayHeight = screen.height; + /** + * A numeric variable that stores the width of the browser's + * layout viewport. + * This viewport is the area within the browser that's available for drawing. + * + * @property {Number} windowWidth + * @readOnly + * @example + *
                              + * + * function setup() { + * // Set the canvas' width and height + * // using the browser's dimensions. + * createCanvas(windowWidth, windowHeight); + * + * background(200); + * + * describe('A gray canvas that takes up the entire browser window.'); + * } + * + *
                              + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.windowWidth = getWindowWidth(); + /** + * A numeric variable that stores the height of the browser's + * layout viewport. + * This viewport is the area within the browser that's available for drawing. + * + * @property {Number} windowHeight + * @readOnly + * @example + *
                              + * + * function setup() { + * // Set the canvas' width and height + * // using the browser's dimensions. + * createCanvas(windowWidth, windowHeight); + * + * background(200); + * + * describe('A gray canvas that takes up the entire browser window.'); + * } + * + *
                              + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.windowHeight = getWindowHeight(); + /** + * The code in `windowResized()` is called once each time the browser window + * is resized. It's a good place to resize the canvas or make other + * adjustments to accommodate the new window size. + * + * The `event` parameter is optional. If added to the function definition, it + * can be used for debugging or other purposes. + * + * @method windowResized + * @param {UIEvent} [event] optional resize Event. + * @example + *
                              + * + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(200); + * + * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); + * } + * + * // Resize the canvas when the + * // browser's size changes. + * function windowResized() { + * resizeCanvas(windowWidth, windowHeight); + * } + * + *
                              + * @alt + * This example does not render anything. + * + *
                              + * + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(200); + * + * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); + * } + * + * function windowResized(event) { + * // Resize the canvas when the + * // browser's size changes. + * resizeCanvas(windowWidth, windowHeight); + * + * // Print the resize event to the console for debugging. + * print(event); + * } + * + *
                              + * @alt + * This example does not render anything. + */ + _main.default.prototype._onresize = function (e) { + this._setProperty('windowWidth', getWindowWidth()); + this._setProperty('windowHeight', getWindowHeight()); + var context = this._isGlobal ? window : this; + var executeDefault; + if (typeof context.windowResized === 'function') { + executeDefault = context.windowResized(e); + if (executeDefault !== undefined && !executeDefault) { + e.preventDefault(); + } + } + }; + function getWindowWidth() { + return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth || 0; + } + function getWindowHeight() { + return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight || 0; + } /** + * A numeric variable that stores the width of the drawing canvas. Its + * default value is 100. + * + * Calling createCanvas() or + * resizeCanvas() changes the value of + * `width`. Calling noCanvas() sets its value to + * 0. + * + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Display the canvas' width. + * text(width, 42, 54); + * + * describe('The number 100 written in black on a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(50, 100); + * + * background(200); + * + * // Display the canvas' width. + * text(width, 21, 54); + * + * describe('The number 50 written in black on a gray rectangle.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Display the canvas' width. + * text(width, 42, 54); + * + * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); + * } + * + * // If the mouse is pressed, reisze + * // the canvas and display its new + * // width. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * resizeCanvas(50, 100); + * background(200); + * text(width, 42, 27); + * } + * } + * + *
                              + * + * @property {Number} width + * @readOnly + */ + + _main.default.prototype.width = 0; + /** + * A numeric variable that stores the height of the drawing canvas. Its + * default value is 100. + * + * Calling createCanvas() or + * resizeCanvas() changes the value of + * `height`. Calling noCanvas() sets its value to + * 0. + * + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Display the canvas' height. + * text(height, 42, 54); + * + * describe('The number 100 written in black on a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 50); + * + * background(200); + * + * // Display the canvas' height. + * text(height, 21, 54); + * + * describe('The number 50 written in black on a gray rectangle.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Display the canvas' height. + * text(height, 42, 54); + * + * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); + * } + * + * // If the mouse is pressed, reisze + * // the canvas and display its new + * // height. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * resizeCanvas(100, 50); + * background(200); + * text(height, 42, 27); + * } + * } + * + *
                              + * + * @property {Number} height + * @readOnly + */ + _main.default.prototype.height = 0; + /** + * Toggles full-screen mode or returns the current mode. + * + * Calling `fullscreen(true)` makes the sketch full-screen. Calling + * `fullscreen(false)` makes the sketch its original size. + * + * Calling `fullscreen()` without an argument returns `true` if the sketch + * is in full-screen mode and `false` if not. + * + * Note: Due to browser restrictions, `fullscreen()` can only be called with + * user input such as a mouse press. + * + * @method fullscreen + * @param {Boolean} [val] whether the sketch should be in fullscreen mode. + * @return {Boolean} current fullscreen state. + * @example + *
                              + * + * function setup() { + * background(200); + * + * describe('A gray canvas that switches between default and full-screen display when clicked.'); + * } + * + * // If the mouse is pressed, + * // toggle full-screen mode. + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * let fs = fullscreen(); + * fullscreen(!fs); + * } + * } + * + *
                              + */ + _main.default.prototype.fullscreen = function (val) { + _main.default._validateParameters('fullscreen', arguments); + // no arguments, return fullscreen or not + if (typeof val === 'undefined') { + return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement; + } else { + // otherwise set to fullscreen or not + if (val) { + launchFullscreen(document.documentElement); + } else { + exitFullscreen(); + } + } + }; + /** + * Sets the pixel scaling for high pixel density displays. + * + * By default, the pixel density is set to match display density. Calling + * `pixelDensity(1)` turn this off. + * + * Calling `pixelDensity()` without an argument returns the current pixel + * density. + * + * @method pixelDensity + * @param {Number} [val] desired pixel density. + * @chainable + * @example + *
                              + * + * function setup() { + * // Set the pixel density to 1. + * pixelDensity(1); + * + * // Create a canvas and draw + * // a circle. + * createCanvas(100, 100); + * background(200); + * circle(50, 50, 70); + * + * describe('A fuzzy white circle on a gray canvas.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Set the pixel density to 3. + * pixelDensity(3); + * + * // Create a canvas, paint the + * // background, and draw a + * // circle. + * createCanvas(100, 100); + * background(200); + * circle(50, 50, 70); + * + * describe('A sharp white circle on a gray canvas.'); + * } + * + *
                              + */ + /** + * @method pixelDensity + * @returns {Number} current pixel density of the sketch. + */ + _main.default.prototype.pixelDensity = function (val) { + _main.default._validateParameters('pixelDensity', arguments); + var returnValue; + if (typeof val === 'number') { + if (val !== this._pixelDensity) { + this._pixelDensity = val; + } + returnValue = this; + this.resizeCanvas(this.width, this.height, true); // as a side effect, it will clear the canvas + } else { + returnValue = this._pixelDensity; + } + return returnValue; + }; + /** + * Returns the display's current pixel density. + * + * @method displayDensity + * @returns {Number} current pixel density of the display. + * @example + *
                              + * + * function setup() { + * // Set the pixel density to 1. + * pixelDensity(1); + * + * // Create a canvas and draw + * // a circle. + * createCanvas(100, 100); + * background(200); + * circle(50, 50, 70); + * + * describe('A fuzzy white circle drawn on a gray background. The circle becomes sharper when the mouse is pressed.'); + * } + * + * function mousePressed() { + * // Get the current display density. + * let d = displayDensity(); + * + * // Use the display density to set + * // the sketch's pixel density. + * pixelDensity(d); + * + * // Paint the background and + * // draw a circle. + * background(200); + * circle(50, 50, 70); + * } + * + *
                              + */ + _main.default.prototype.displayDensity = function () { + return window.devicePixelRatio; + }; + function launchFullscreen(element) { + var enabled = document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled; + if (!enabled) { + throw new Error('Fullscreen not enabled in this browser.'); + } + if (element.requestFullscreen) { + element.requestFullscreen(); + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen(); + } else if (element.webkitRequestFullscreen) { + element.webkitRequestFullscreen(); + } else if (element.msRequestFullscreen) { + element.msRequestFullscreen(); + } + } + function exitFullscreen() { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + } /** + * Returns the sketch's current + * URL + * as a string. + * + * @method getURL + * @return {String} url + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Get the sketch's URL + * // and display it. + * let url = getURL(); + * textWrap(CHAR); + * text(url, 0, 40, 100); + * + * describe('The URL "https://p5js.org/reference/#/p5/getURL" written in black on a gray background.'); + * } + * + *
                              + */ + + _main.default.prototype.getURL = function () { + return location.href; + }; + /** + * Returns the current + * URL + * path as an array of strings. + * + * For example, consider a sketch hosted at the URL + * `https://example.com/sketchbook`. Calling `getURLPath()` returns + * `['sketchbook']`. For a sketch hosted at the URL + * `https://example.com/sketchbook/monday`, `getURLPath()` returns + * `['sketchbook', 'monday']`. + * + * @method getURLPath + * @return {String[]} path components. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Get the sketch's URL path + * // and display the first + * // part. + * let path = getURLPath(); + * text(path[0], 25, 54); + * + * describe('The word "reference" written in black on a gray background.'); + * } + * + *
                              + */ + _main.default.prototype.getURLPath = function () { + return location.pathname.split('/').filter(function (v) { + return v !== ''; + }); + }; + /** + * Returns the current + * URL parameters + * in an Object. + * + * For example, calling `getURLParams()` in a sketch hosted at the URL + * `http://p5js.org?year=2014&month=May&day=15` returns + * `{ year: 2014, month: 'May', day: 15 }`. + * + * @method getURLParams + * @return {Object} URL params + * @example + *
                              + * + * // Imagine this sketch is hosted at the following URL: + * // https://p5js.org?year=2014&month=May&day=15 + * + * function setup() { + * background(200); + * + * // Get the sketch's URL + * // parameters and display + * // them. + * let params = getURLParams(); + * text(params.day, 10, 20); + * text(params.month, 10, 40); + * text(params.year, 10, 60); + * + * describe('The text "15", "May", and "2014" written in black on separate lines.'); + * } + * + *
                              + * + * @alt + * This example does not render anything. + */ + _main.default.prototype.getURLParams = function () { + var re = /[?&]([^&=]+)(?:[&=])([^&=]+)/gim; + var m; + var v = { + }; + while ((m = re.exec(location.search)) != null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + v[m[1]] = m[2]; + } + return v; + }; + var _default = _main.default; + exports.default = _default; + }, + { + './constants': 286, + './main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.search': 215, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 288: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + // This contains a data table used by ./fes_core.js/fesErrorMonitor(). + // + // Note: Different browsers use different error strings for the same error. + // Extracting info from the browser error messages is easier and cleaner + // if we have a predefined lookup. This file serves as that lookup. + // Using this lookup we match the errors obtained from the browser, classify + // them into types and extract the required information. + // The FES can use the extracted info to generate a friendly error message + // for the matching error. + var strings = { + ReferenceError: [ + { + msg: '{{}} is not defined', + type: 'NOTDEFINED', + browser: 'all' + }, + { + msg: 'Can\'t find variable: {{}}', + type: 'NOTDEFINED', + browser: 'Safari' + }, + { + msg: 'Cannot access \'{{.}}\' before initialization', + type: 'CANNOTACCESS', + browser: 'Chrome' + }, + { + msg: 'can\'t access lexical declaration \'{{.}}\' before initialization', + type: 'CANNOTACCESS', + browser: 'Firefox' + } + ], + SyntaxError: [ + { + msg: 'illegal character', + type: 'INVALIDTOKEN', + browser: 'Firefox' + }, + { + msg: 'Invalid character', + type: 'INVALIDTOKEN', + browser: 'Safari' + }, + { + msg: 'Invalid or unexpected token', + type: 'INVALIDTOKEN', + browser: 'Chrome' + }, + { + msg: 'Unexpected token \'{{.}}\'', + type: 'UNEXPECTEDTOKEN', + browser: 'Chrome' + }, + { + msg: 'expected {{.}}, got \'{{.}}\'', + type: 'UNEXPECTEDTOKEN', + browser: 'Chrome' + }, + { + msg: 'Identifier \'{{.}}\' has already been declared', + type: 'REDECLAREDVARIABLE', + browser: 'Chrome' + }, + { + msg: 'redeclaration of {} {{.}}', + type: 'REDECLAREDVARIABLE', + browser: 'Firefox' + }, + { + msg: 'Missing initializer in const declaration', + type: 'MISSINGINITIALIZER', + browser: 'Chrome' + }, + { + msg: 'missing = in const declaration', + type: 'MISSINGINITIALIZER', + browser: 'Firefox' + }, + { + msg: 'Illegal return statement', + type: 'BADRETURNORYIELD', + browser: 'Chrome' + }, + { + msg: 'return not in function', + type: 'BADRETURNORYIELD', + browser: 'Firefox' + } + ], + TypeError: [ + { + msg: '{{.}} is not a function', + type: 'NOTFUNC', + browser: 'all' + }, + { + msg: 'Cannot read {{.}} null', + type: 'READNULL', + browser: 'Chrome' + }, + { + msg: '{{.}} is null', + type: 'READNULL', + browser: 'Firefox' + }, + { + msg: 'Cannot read {{.}} undefined', + type: 'READUDEFINED', + browser: 'Chrome' + }, + { + msg: '{{.}} is undefined', + type: 'READUDEFINED', + browser: 'Firefox' + }, + { + msg: 'Assignment to constant variable', + type: 'CONSTASSIGN', + browser: 'Chrome' + }, + { + msg: 'invalid assignment to const \'{{.}}\'', + type: 'CONSTASSIGN', + browser: 'Firefox' + } + ] + }; + var _default = strings; + exports.default = _default; + }, + { + } + ], + 289: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.get-own-property-names'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.starts-with'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.get-own-property-names'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.starts-with'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var _internationalization = _dereq_('../internationalization'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError('Invalid attempt to destructure non-iterable instance'); + } + function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === '[object Arguments]')) { + return; + } + var _arr = [ + ]; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @for p5 + * @requires core + * + * This is the main file for the Friendly Error System (FES), containing + * the core as well as miscellaneous functionality of the FES. Here is a + * brief outline of the functions called in this system. + * + * The FES may be invoked by a call to either + * (1) _validateParameters, (2) _friendlyFileLoadError, (3) _friendlyError, + * (4) helpForMisusedAtTopLevelCode, or (5) _fesErrorMonitor. + * + * _validateParameters is located in validate_params.js along with other code + * used for parameter validation. + * _friendlyFileLoadError is located in file_errors.js along with other code + * used for dealing with file load errors. + * Apart from this, there's also a file stacktrace.js, which contains the code + * to parse the error stack, borrowed from: + * https://github.com/stacktracejs/stacktrace.js + * + * For more detailed information on the FES functions, including the call + * sequence of each function, please look at the FES Reference + Dev Notes: + * https://github.com/processing/p5.js/blob/main/contributor_docs/fes_reference_dev_notes.md + */ + // p5.js blue, p5.js orange, auto dark green; fallback p5.js darkened magenta + // See testColors below for all the color codes and names + + var typeColors = [ + '#2D7BB6', + '#EE9900', + '#4DB200', + '#C83C00' + ]; + var misusedAtTopLevelCode = null; + var defineMisusedAtTopLevelCode = null; + // the threshold for the maximum allowed levenshtein distance + // used in misspelling detection + var EDIT_DIST_THRESHOLD = 2; + // to enable or disable styling (color, font-size, etc. ) for fes messages + var ENABLE_FES_STYLING = false; + if (typeof IS_MINIFIED !== 'undefined') { + _main.default._friendlyError = _main.default._checkForUserDefinedFunctions = _main.default._fesErrorMonitor = function () { + }; + } else { + var doFriendlyWelcome = false; // TEMP until we get it all working LM + var errorTable = _dereq_('./browser_errors').default; + // -- Borrowed from jQuery 1.11.3 -- + var class2type = { + }; + var _toString = class2type.toString; + var names = [ + 'Boolean', + 'Number', + 'String', + 'Function', + 'Array', + 'Date', + 'RegExp', + 'Object', + 'Error' + ]; + for (var n = 0; n < names.length; n++) { + class2type['[object '.concat(names[n], ']')] = names[n].toLowerCase(); + } + var getType = function getType(obj) { + if (obj == null) { + return ''.concat(obj); + } + return _typeof(obj) === 'object' || typeof obj === 'function' ? class2type[_toString.call(obj)] || 'object' : _typeof(obj); + }; + // -- End borrow -- + // entry points into user-defined code + var entryPoints = [ + 'setup', + 'draw', + 'preload', + 'deviceMoved', + 'deviceTurned', + 'deviceShaken', + 'doubleClicked', + 'mousePressed', + 'mouseReleased', + 'mouseMoved', + 'mouseDragged', + 'mouseClicked', + 'mouseWheel', + 'touchStarted', + 'touchMoved', + 'touchEnded', + 'keyPressed', + 'keyReleased', + 'keyTyped', + 'windowResized' + ]; + var friendlyWelcome = function friendlyWelcome() { + // p5.js brand - magenta: #ED225D + //const astrixBgColor = 'transparent'; + //const astrixTxtColor = '#ED225D'; + //const welcomeBgColor = '#ED225D'; + //const welcomeTextColor = 'white'; + var welcomeMessage = (0, _internationalization.translator) ('fes.pre', { + message: (0, _internationalization.translator) ('fes.welcome') + }); + console.log(' _ \n' + ' /\\| |/\\ \n' + ' \\ ` \' / \n' + ' / , . \\ \n' + ' \\/|_|\\/ ' + '\n\n' + welcomeMessage); + }; + /** + * Takes a message and a p5 function func, and adds a link pointing to + * the reference documentation of func at the end of the message + * + * @method mapToReference + * @private + * @param {String} message the words to be said + * @param {String} [func] the name of function + * + * @returns {String} + */ + var mapToReference = function mapToReference(message, func) { + var msgWithReference = ''; + if (func == null || func.substring(0, 4) === 'load') { + msgWithReference = message; + } else { + var methodParts = func.split('.'); + var referenceSection = methodParts.length > 1 ? ''.concat(methodParts[0], '.').concat(methodParts[1]) : 'p5'; + var funcName = methodParts.length === 1 ? func : methodParts.slice(2).join('/'); + //Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link + funcName.startsWith('p5.') ? msgWithReference = ''.concat(message, ' (http://p5js.org/reference/#/').concat(referenceSection, '.').concat(funcName, ')') : msgWithReference = ''.concat(message, ' (http://p5js.org/reference/#/').concat(referenceSection, '/').concat(funcName, ')'); + } + return msgWithReference; + }; + /** + * Prints out a fancy, colorful message to the console log + * Attaches Friendly Errors prefix [fes.pre] to the message. + * + * @method _report + * @private + * @param {String} message Message to be printed + * @param {String} [func] Name of function + * @param {Number|String} [color] CSS color code + * + * @return console logs + */ + _main.default._report = function (message, func, color) { + // if p5._fesLogger is set ( i.e we are running tests ), use that + // instead of console.log + var log = _main.default._fesLogger == null ? console.log.bind(console) : _main.default._fesLogger; + if (doFriendlyWelcome) { + friendlyWelcome(); + doFriendlyWelcome = false; + } + if ('undefined' === getType(color)) { + color = '#B40033'; // dark magenta + } else if (getType(color) === 'number') { + // Type to color + color = typeColors[color]; + } // Add a link to the reference docs of func at the end of the message + + message = mapToReference(message, func); + var style = [ + 'color: '.concat(color), + 'font-family: Arial', + 'font-size: larger' + ]; + var prefixedMsg = (0, _internationalization.translator) ('fes.pre', { + message: message + }); + if (ENABLE_FES_STYLING) { + log('%c' + prefixedMsg, style.join(';')); + } else { + log(prefixedMsg); + } + }; + /** + * This is a generic method that can be called from anywhere in the p5 + * library to alert users to a common error. + * + * @method _friendlyError + * @private + * @param {String} message Message to be printed + * @param {String} [func] Name of the function linked to error + * @param {Number|String} [color] CSS color code + */ + _main.default._friendlyError = function (message, func, color) { + _main.default._report(message, func, color); + }; + /** + * This is called internally if there is an error with autoplay. Generates + * and prints a friendly error message [fes.autoplay]. + * + * @method _friendlyAutoplayError + * @private + */ + _main.default._friendlyAutoplayError = function (src) { + var message = (0, _internationalization.translator) ('fes.autoplay', { + src: src, + url: 'https://developer.mozilla.org/docs/Web/Media/Autoplay_guide' + }); + console.log((0, _internationalization.translator) ('fes.pre', { + message: message + })); + }; + /** + * Measures dissimilarity between two strings by calculating + * the Levenshtein distance. + * + * If the "distance" between them is small enough, it is + * reasonable to think that one is the misspelled version of the other. + * + * Specifically, this uses the Wagner–Fischer algorithm. + * @method computeEditDistance + * @private + * @param {String} w1 the first word + * @param {String} w2 the second word + * + * @returns {Number} the "distance" between the two words, a smaller value + * indicates that the words are similar + */ + var computeEditDistance = function computeEditDistance(w1, w2) { + var l1 = w1.length, + l2 = w2.length; + if (l1 === 0) return w2; + if (l2 === 0) return w1; + var prev = [ + ]; + var cur = [ + ]; + for (var j = 0; j < l2 + 1; j++) { + cur[j] = j; + } + prev = cur; + for (var i = 1; i < l1 + 1; i++) { + cur = [ + ]; + for (var _j = 0; _j < l2 + 1; _j++) { + if (_j === 0) { + cur[_j] = i; + } else { + var a1 = w1[i - 1], + a2 = w2[_j - 1]; + var temp = 999999; + var cost = a1.toLowerCase() === a2.toLowerCase() ? 0 : 1; + temp = temp > cost + prev[_j - 1] ? cost + prev[_j - 1] : temp; + temp = temp > 1 + cur[_j - 1] ? 1 + cur[_j - 1] : temp; + temp = temp > 1 + prev[_j] ? 1 + prev[_j] : temp; + cur[_j] = temp; + } + } + prev = cur; + } + return cur[l2]; + }; + /** + * Checks capitalization for user defined functions. + * + * Generates and prints a friendly error message using key: + * "fes.checkUserDefinedFns". + * + * @method checkForUserDefinedFunctions + * @private + * @param {*} context Current default context. Set to window in + * "global mode" and to a p5 instance in "instance mode" + */ + var checkForUserDefinedFunctions = function checkForUserDefinedFunctions(context) { + if (_main.default.disableFriendlyErrors) return; + // if using instance mode, this function would be called with the current + // instance as context + var instanceMode = context instanceof _main.default; + context = instanceMode ? context : window; + var fnNames = entryPoints; + var fxns = { + }; + // lowercasename -> actualName mapping + fnNames.forEach(function (symbol) { + fxns[symbol.toLowerCase()] = symbol; + }); + for (var _i = 0, _Object$keys = Object.keys(context); _i < _Object$keys.length; _i++) { + var prop = _Object$keys[_i]; + var lowercase = prop.toLowerCase(); + // check if the lowercase property name has an entry in fxns, if the + // actual name with correct capitalization doesnt exist in context, + // and if the user-defined symbol is of the type function + if (fxns[lowercase] && !context[fxns[lowercase]] && typeof context[prop] === 'function') { + var msg = (0, _internationalization.translator) ('fes.checkUserDefinedFns', { + name: prop, + actualName: fxns[lowercase] + }); + _main.default._friendlyError(msg, fxns[lowercase]); + } + } + }; + /** + * Compares the symbol caught in the ReferenceError to everything in + * misusedAtTopLevel ( all public p5 properties ). + * + * Generates and prints a friendly error message using key: "fes.misspelling". + * + * @method handleMisspelling + * @private + * @param {String} errSym Symbol to whose spelling to check + * @param {Error} error ReferenceError object + * + * @returns {Boolean} tell whether error was likely due to typo + */ + var handleMisspelling = function handleMisspelling(errSym, error) { + if (!misusedAtTopLevelCode) { + defineMisusedAtTopLevelCode(); + } + var distanceMap = { + }; + var min = 999999; + // compute the levenshtein distance for the symbol against all known + // public p5 properties. Find the property with the minimum distance + misusedAtTopLevelCode.forEach(function (symbol) { + var dist = computeEditDistance(errSym, symbol.name); + if (distanceMap[dist]) distanceMap[dist].push(symbol); + else distanceMap[dist] = [ + symbol + ]; + if (dist < min) min = dist; + }); + // if the closest match has more "distance" than the max allowed threshold + if (min > Math.min(EDIT_DIST_THRESHOLD, errSym.length)) return false; + // Show a message only if the caught symbol and the matched property name + // differ in their name ( either letter difference or difference of case ) + var matchedSymbols = distanceMap[min].filter(function (symbol) { + return symbol.name !== errSym; + }); + if (matchedSymbols.length !== 0) { + var parsed = _main.default._getErrorStackParser().parse(error); + var locationObj; + if (parsed && parsed[0] && parsed[0].fileName && parsed[0].lineNumber && parsed[0].columnNumber) { + locationObj = { + location: ''.concat(parsed[0].fileName, ':').concat(parsed[0].lineNumber, ':').concat(parsed[0].columnNumber), + file: parsed[0].fileName.split('/').slice( - 1), + line: parsed[0].lineNumber + }; + } + var msg; + if (matchedSymbols.length === 1) { + // To be used when there is only one closest match. The count parameter + // allows i18n to pick between the keys "fes.misspelling" and + // "fes.misspelling_plural" + msg = (0, _internationalization.translator) ('fes.misspelling', { + name: errSym, + actualName: matchedSymbols[0].name, + type: matchedSymbols[0].type, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', + count: matchedSymbols.length + }); + } else { + // To be used when there are multiple closest matches. Gives each + // suggestion on its own line, the function name followed by a link to + // reference documentation + var suggestions = matchedSymbols.map(function (symbol) { + var message = '▶️ ' + symbol.name + (symbol.type === 'function' ? '()' : ''); + return mapToReference(message, symbol.name); + }).join('\n'); + msg = (0, _internationalization.translator) ('fes.misspelling', { + name: errSym, + suggestions: suggestions, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', + count: matchedSymbols.length + }); + } // If there is only one closest match, tell _friendlyError to also add + // a link to the reference documentation. In case of multiple matches, + // this is already done in the suggestions variable, one link for each + // suggestion. + + _main.default._friendlyError(msg, matchedSymbols.length === 1 ? matchedSymbols[0].name : undefined); + return true; + } + return false; + }; + /** + * Prints a friendly stacktrace for user-written functions for "global" errors + * + * Generates and prints a friendly error message using key: + * "fes.globalErrors.stackTop", "fes.globalErrors.stackSubseq". + * + * @method printFriendlyStack + * @private + * @param {Array} friendlyStack + */ + var printFriendlyStack = function printFriendlyStack(friendlyStack) { + var log = _main.default._fesLogger && typeof _main.default._fesLogger === 'function' ? _main.default._fesLogger : console.log.bind(console); + if (friendlyStack.length > 1) { + var stacktraceMsg = ''; + friendlyStack.forEach(function (frame, idx) { + var location = ''.concat(frame.fileName, ':').concat(frame.lineNumber, ':').concat(frame.columnNumber); + var frameMsg, + translationObj = { + func: frame.functionName, + line: frame.lineNumber, + location: location, + file: frame.fileName.split('/').slice( - 1) + }; + if (idx === 0) { + frameMsg = (0, _internationalization.translator) ('fes.globalErrors.stackTop', translationObj); + } else { + frameMsg = (0, _internationalization.translator) ('fes.globalErrors.stackSubseq', translationObj); + } + stacktraceMsg += frameMsg; + }); + log(stacktraceMsg); + } + }; + /** + * Takes a stacktrace array and filters out all frames that show internal p5 + * details. + * + * Generates and prints a friendly error message using key: + * "fes.wrongPreload", "fes.libraryError". + * + * The processed stack is used to find whether the error happened internally + * within the library, and if the error was due to a non-loadX() method + * being used in preload. + * + * "Internally" here means that the exact location of the error (the top of + * the stack) is a piece of code written in the p5.js library (which may or + * may not have been called from the user's sketch). + * + * @method processStack + * @private + * @param {Error} error + * @param {Array} stacktrace + * + * @returns {Array} An array with two elements, [isInternal, friendlyStack] + * isInternal: a boolean value indicating whether the error + * happened internally + * friendlyStack: the filtered (simplified) stacktrace + */ + var processStack = function processStack(error, stacktrace) { + // cannot process a stacktrace that doesn't exist + if (!stacktrace) return [false, + null]; + stacktrace.forEach(function (frame) { + frame.functionName = frame.functionName || ''; + }); + // isInternal - Did this error happen inside the library + var isInternal = false; + var p5FileName, + friendlyStack, + currentEntryPoint; + // Intentionally throw an error that we catch so that we can check the name + // of the current file. Any errors we see from this file, we treat as + // internal errors. + try { + throw new Error(); + } catch (testError) { + var testStacktrace = _main.default._getErrorStackParser().parse(testError); + p5FileName = testStacktrace[0].fileName; + } + for (var i = stacktrace.length - 1; i >= 0; i--) { + var splitted = stacktrace[i].functionName.split('.'); + if (entryPoints.includes(splitted[splitted.length - 1])) { + // remove everything below an entry point function (setup, draw, etc). + // (it's usually the internal initialization calls) + friendlyStack = stacktrace.slice(0, i + 1); + currentEntryPoint = splitted[splitted.length - 1]; + // We call the error "internal" if the source of the error was a + // function from within the p5.js library file, but called from the + // user's code directly. We only need to check the topmost frame in + // the stack trace since any function internal to p5 should pass this + // check, not just public p5 functions. + if (stacktrace[0].fileName === p5FileName) { + isInternal = true; + break; + } + break; + } + } // in some cases ( errors in promises, callbacks, etc), no entry-point + // function may be found in the stacktrace. In that case just use the + // entire stacktrace for friendlyStack + + if (!friendlyStack) friendlyStack = stacktrace; + if (isInternal) { + // the frameIndex property is added before the filter, so frameIndex + // corresponds to the index of a frame in the original stacktrace. + // Then we filter out all frames which belong to the file that contains + // the p5 library + friendlyStack = friendlyStack.map(function (frame, index) { + frame.frameIndex = index; + return frame; + }).filter(function (frame) { + return frame.fileName !== p5FileName; + }); + // a weird case, if for some reason we can't identify the function called + // from user's code + if (friendlyStack.length === 0) return [true, + null]; + // get the function just above the topmost frame in the friendlyStack. + // i.e the name of the library function called from user's code + var func = stacktrace[friendlyStack[0].frameIndex - 1].functionName.split('.').slice( - 1) [0]; + // Try and get the location (line no.) from the top element of the stack + var locationObj; + if (friendlyStack[0].fileName && friendlyStack[0].lineNumber && friendlyStack[0].columnNumber) { + locationObj = { + location: ''.concat(friendlyStack[0].fileName, ':').concat(friendlyStack[0].lineNumber, ':').concat(friendlyStack[0].columnNumber), + file: friendlyStack[0].fileName.split('/').slice( - 1), + line: friendlyStack[0].lineNumber + }; + // if already handled by another part of the FES, don't handle again + if (_main.default._fesLogCache[locationObj.location]) return [true, + null]; + } // Check if the error is due to a non loadX method being used incorrectly + // in preload + + if (currentEntryPoint === 'preload' && _main.default.prototype._preloadMethods[func] == null) { + _main.default._friendlyError((0, _internationalization.translator) ('fes.wrongPreload', { + func: func, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', + error: error.message + }), 'preload'); + } else { + // Library error + _main.default._friendlyError((0, _internationalization.translator) ('fes.libraryError', { + func: func, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '', + error: error.message + }), func); + } // Finally, if it's an internal error, print the friendlyStack + // ( fesErrorMonitor won't handle this error ) + + if (friendlyStack && friendlyStack.length) { + printFriendlyStack(friendlyStack); + } + } + return [isInternal, + friendlyStack]; + }; + /** + * Handles "global" errors that the browser catches. + * + * Called when an error event happens and detects the type of error. + * + * Generates and prints a friendly error message using key: + * "fes.globalErrors.syntax.[*]", "fes.globalErrors.reference.[*]", + * "fes.globalErrors.type.[*]". + * + * @method fesErrorMonitor + * @private + * @param {*} e Event object to extract error details from + */ + var fesErrorMonitor = function fesErrorMonitor(e) { + if (_main.default.disableFriendlyErrors) return; + // Try to get the error object from e + var error; + if (e instanceof Error) { + error = e; + } else if (e instanceof ErrorEvent) { + error = e.error; + } else if (e instanceof PromiseRejectionEvent) { + error = e.reason; + if (!(error instanceof Error)) return; + } + if (!error) return; + var stacktrace = _main.default._getErrorStackParser().parse(error); + // process the stacktrace from the browser and simplify it to give + // friendlyStack. + var _processStack = processStack(error, stacktrace), + _processStack2 = _slicedToArray(_processStack, 2), + isInternal = _processStack2[0], + friendlyStack = _processStack2[1]; // if this is an internal library error, the type of the error is not relevant, + // only the user code that lead to it is. + if (isInternal) { + return; + } + var errList = errorTable[error.name]; + if (!errList) return; // this type of error can't be handled yet + var matchedError; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = errList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var obj = _step.value; + var string = obj.msg; + // capture the primary symbol mentioned in the error + string = string.replace(new RegExp('{{}}', 'g'), '([a-zA-Z0-9_]+)'); + string = string.replace(new RegExp('{{.}}', 'g'), '(.+)'); + string = string.replace(new RegExp('{}', 'g'), '(?:[a-zA-Z0-9_]+)'); + var matched = error.message.match(string); + if (matched) { + matchedError = Object.assign({ + }, obj); + matchedError.match = matched; + break; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (!matchedError) return; + // Try and get the location from the top element of the stack + var locationObj; + if (stacktrace && stacktrace[0].fileName && stacktrace[0].lineNumber && stacktrace[0].columnNumber) { + locationObj = { + location: ''.concat(stacktrace[0].fileName, ':').concat(stacktrace[0].lineNumber, ':').concat(stacktrace[0].columnNumber), + file: stacktrace[0].fileName.split('/').slice( - 1), + line: friendlyStack[0].lineNumber + }; + } + switch (error.name) { + case 'SyntaxError': + { + // We can't really do much with syntax errors other than try to use + // a simpler framing of the error message. The stack isn't available + // for syntax errors + switch (matchedError.type) { + case 'INVALIDTOKEN': + { + //Error if there is an invalid or unexpected token that doesn't belong at this position in the code + //let x = “not a string”; -> string not in proper quotes + var url = 'https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character#What_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.invalidToken', { + url: url + })); + break; + } + case 'UNEXPECTEDTOKEN': + { + //Error if a specific language construct(, { ; etc) was expected, but something else was provided + //for (let i = 0; i < 5,; ++i) -> a comma after i<5 instead of a semicolon + var _url = 'https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Unexpected_token#What_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.unexpectedToken', { + url: _url + })); + break; + } + case 'REDECLAREDVARIABLE': + { + //Error if a variable is redeclared by the user. Example=> + //let a = 10; + //let a = 100; + var errSym = matchedError.match[1]; + var _url2 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter#what_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.redeclaredVariable', { + symbol: errSym, + url: _url2 + })); + break; + } + case 'MISSINGINITIALIZER': + { + //Error if a const variable is not initialized during declaration + //Example => const a; + var _url3 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const#what_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.missingInitializer', { + url: _url3 + })); + break; + } + case 'BADRETURNORYIELD': + { + //Error when a return statement is misplaced(usually outside of a function) + // const a = function(){ + // ..... + // } + // return; -> misplaced return statement + var _url4 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return_or_yield#what_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.syntax.badReturnOrYield', { + url: _url4 + })); + break; + } + } + break; + } + case 'ReferenceError': + { + switch (matchedError.type) { + case 'NOTDEFINED': + { + //Error if there is a non-existent variable referenced somewhere + //let a = 10; + //console.log(x); + var _errSym = matchedError.match[1]; + if (_errSym && handleMisspelling(_errSym, error)) { + break; + } // if the flow gets this far, this is likely not a misspelling + // of a p5 property/function + + var _url5 = 'https://p5js.org/examples/data-variable-scope.html'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.reference.notDefined', { + url: _url5, + symbol: _errSym, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' + })); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case 'CANNOTACCESS': + { + //Error if a lexical variable was accessed before it was initialized + //console.log(a); -> variable accessed before it was initialized + //let a=100; + var _errSym2 = matchedError.match[1]; + var _url6 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init#what_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.reference.cannotAccess', { + url: _url6, + symbol: _errSym2, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' + })); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + } + break; + } + case 'TypeError': + { + switch (matchedError.type) { + case 'NOTFUNC': + { + //Error when some code expects you to provide a function, but that didn't happen + //let a = document.getElementByID('foo'); -> getElementById instead of getElementByID + var _errSym3 = matchedError.match[1]; + var splitSym = _errSym3.split('.'); + var _url7 = 'https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_a_function#What_went_wrong'; + // if errSym is aa.bb.cc , symbol would be cc and obj would aa.bb + var translationObj = { + url: _url7, + symbol: splitSym[splitSym.length - 1], + obj: splitSym.slice(0, splitSym.length - 1).join('.'), + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' + }; + // There are two cases to handle here. When the function is called + // as a property of an object and when it's called independently. + // Both have different explanations. + if (splitSym.length > 1) { + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.notfuncObj', translationObj)); + } else { + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.notfunc', translationObj)); + } + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case 'READNULL': + { + //Error if a property of null is accessed + //let a = null; + //console.log(a.property); -> a is null + var _errSym4 = matchedError.match[1]; + var _url8 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong'; + /*let url2 = + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null';*/ + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.readFromNull', { + url: _url8, + symbol: _errSym4, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' + })); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case 'READUDEFINED': + { + //Error if a property of undefined is accessed + //let a; -> default value of a is undefined + //console.log(a.property); -> a is undefined + var _errSym5 = matchedError.match[1]; + var _url9 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong'; + /*let url2 = + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined#description';*/ + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.readFromUndefined', { + url: _url9, + symbol: _errSym5, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' + })); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + case 'CONSTASSIGN': + { + //Error when a const variable is reassigned a value + //const a = 100; + //a=10; + var _url10 = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment#what_went_wrong'; + _main.default._friendlyError((0, _internationalization.translator) ('fes.globalErrors.type.constAssign', { + url: _url10, + location: locationObj ? (0, _internationalization.translator) ('fes.location', locationObj) : '' + })); + if (friendlyStack) printFriendlyStack(friendlyStack); + break; + } + } + } + } + }; + _main.default._fesErrorMonitor = fesErrorMonitor; + _main.default._checkForUserDefinedFunctions = checkForUserDefinedFunctions; + // logger for testing purposes. + _main.default._fesLogger = null; + _main.default._fesLogCache = { + }; + window.addEventListener('load', checkForUserDefinedFunctions, false); + window.addEventListener('error', _main.default._fesErrorMonitor, false); + window.addEventListener('unhandledrejection', _main.default._fesErrorMonitor, false); + /** + * Prints out all the colors in the color pallete with white text. + * For color blindness testing. + */ + /* function testColors() { + const str = 'A box of biscuits, a box of mixed biscuits and a biscuit mixer'; + p5._friendlyError(str, 'print', '#ED225D'); // p5.js magenta + p5._friendlyError(str, 'print', '#2D7BB6'); // p5.js blue + p5._friendlyError(str, 'print', '#EE9900'); // p5.js orange + p5._friendlyError(str, 'print', '#A67F59'); // p5.js light brown + p5._friendlyError(str, 'print', '#704F21'); // p5.js gold + p5._friendlyError(str, 'print', '#1CC581'); // auto cyan + p5._friendlyError(str, 'print', '#FF6625'); // auto orange + p5._friendlyError(str, 'print', '#79EB22'); // auto green + p5._friendlyError(str, 'print', '#B40033'); // p5.js darkened magenta + p5._friendlyError(str, 'print', '#084B7F'); // p5.js darkened blue + p5._friendlyError(str, 'print', '#945F00'); // p5.js darkened orange + p5._friendlyError(str, 'print', '#6B441D'); // p5.js darkened brown + p5._friendlyError(str, 'print', '#2E1B00'); // p5.js darkened gold + p5._friendlyError(str, 'print', '#008851'); // auto dark cyan + p5._friendlyError(str, 'print', '#C83C00'); // auto dark orange + p5._friendlyError(str, 'print', '#4DB200'); // auto dark green + } */ + } // This is a lazily-defined list of p5 symbols that may be + // misused by beginners at top-level code, outside of setup/draw. We'd like + // to detect these errors and help the user by suggesting they move them + // into setup/draw. + // + // For more details, see https://github.com/processing/p5.js/issues/1121. + + misusedAtTopLevelCode = null; + var FAQ_URL = 'https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup'; + /** + * A helper function for populating misusedAtTopLevel list. + * + * @method defineMisusedAtTopLevelCode + * @private + */ + defineMisusedAtTopLevelCode = function defineMisusedAtTopLevelCode() { + var uniqueNamesFound = { + }; + var getSymbols = function getSymbols(obj) { + return Object.getOwnPropertyNames(obj).filter(function (name) { + if (name[0] === '_') { + return false; + } + if (name in uniqueNamesFound) { + return false; + } + uniqueNamesFound[name] = true; + return true; + }).map(function (name) { + var type; + if (typeof obj[name] === 'function') { + type = 'function'; + } else if (name === name.toUpperCase()) { + type = 'constant'; + } else { + type = 'variable'; + } + return { + name: name, + type: type + }; + }); + }; + misusedAtTopLevelCode = [ + ].concat(getSymbols(_main.default.prototype), // At present, p5 only adds its constants to p5.prototype during + // construction, which may not have happened at the time a + // ReferenceError is thrown, so we'll manually add them to our list. + getSymbols(_dereq_('../constants'))); + // This will ultimately ensure that we report the most specific error + // possible to the user, e.g. advising them about HALF_PI instead of PI + // when their code misuses the former. + misusedAtTopLevelCode.sort(function (a, b) { + return b.name.length - a.name.length; + }); + }; + /** + * Detects browser level error event for p5 constants/functions used outside + * of setup() and draw(). + * + * Generates and prints a friendly error message using key: + * "fes.misusedTopLevel". + * + * @method helpForMisusedAtTopLevelCode + * @private + * @param {Event} e Error event + * @param {Boolean} log false + * + * @returns {Boolean} true + */ + var helpForMisusedAtTopLevelCode = function helpForMisusedAtTopLevelCode(e, log) { + if (!log) { + log = console.log.bind(console); + } + if (!misusedAtTopLevelCode) { + defineMisusedAtTopLevelCode(); + } // If we find that we're logging lots of false positives, we can + // uncomment the following code to avoid displaying anything if the + // user's code isn't likely to be using p5's global mode. (Note that + // setup/draw are more likely to be defined due to JS function hoisting.) + // + //if (!('setup' in window || 'draw' in window)) { + // return; + //} + + misusedAtTopLevelCode.some(function (symbol) { + // Note that while just checking for the occurrence of the + // symbol name in the error message could result in false positives, + // a more rigorous test is difficult because different browsers + // log different messages, and the format of those messages may + // change over time. + // + // For example, if the user uses 'PI' in their code, it may result + // in any one of the following messages: + // + // * 'PI' is undefined (Microsoft Edge) + // * ReferenceError: PI is undefined (Firefox) + // * Uncaught ReferenceError: PI is not defined (Chrome) + if (e.message && e.message.match('\\W?'.concat(symbol.name, '\\W')) !== null) { + var symbolName = symbol.type === 'function' ? ''.concat(symbol.name, '()') : symbol.name; + if (typeof IS_MINIFIED !== 'undefined') { + log('Did you just try to use p5.js\'s '.concat(symbolName, ' ').concat(symbol.type, '? If so, you may want to move it into your sketch\'s setup() function.\n\nFor more details, see: ').concat(FAQ_URL)); + } else { + log((0, _internationalization.translator) ('fes.misusedTopLevel', { + symbolName: symbolName, + symbolType: symbol.type, + url: FAQ_URL + })); + } + return true; + } + }); + }; + // Exposing this primarily for unit testing. + _main.default.prototype._helpForMisusedAtTopLevelCode = helpForMisusedAtTopLevelCode; + if (document.readyState !== 'complete') { + window.addEventListener('error', helpForMisusedAtTopLevelCode, false); + // Our job is only to catch ReferenceErrors that are thrown when + // global (non-instance mode) p5 APIs are used at the top-level + // scope of a file, so we'll unbind our error listener now to make + // sure we don't log false positives later. + window.addEventListener('load', function () { + window.removeEventListener('error', helpForMisusedAtTopLevelCode, false); + }); + } + var _default = _main.default; + exports.default = _default; + }, + { + '../constants': 286, + '../internationalization': 296, + '../main': 298, + './browser_errors': 288, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.some': 184, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.object.assign': 194, + 'core-js/modules/es.object.get-own-property-names': 197, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.constructor': 204, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.match': 211, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.starts-with': 217, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 290: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var _internationalization = _dereq_('../internationalization'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @for p5 + * @requires core + */ + + if (typeof IS_MINIFIED !== 'undefined') { + _main.default._friendlyFileLoadError = function () { + }; + } else { + // mapping used by `_friendlyFileLoadError` + var fileLoadErrorCases = function fileLoadErrorCases(num, filePath) { + var suggestion = (0, _internationalization.translator) ('fes.fileLoadError.suggestion', { + filePath: filePath, + url: 'https://github.com/processing/p5.js/wiki/Local-server' + }); + switch (num) { + case 0: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.image', { + suggestion: suggestion + }), + method: 'loadImage' + }; + case 1: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.xml', { + suggestion: suggestion + }), + method: 'loadXML' + }; + case 2: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.table', { + suggestion: suggestion + }), + method: 'loadTable' + }; + case 3: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.strings', { + suggestion: suggestion + }), + method: 'loadStrings' + }; + case 4: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.font', { + suggestion: suggestion + }), + method: 'loadFont' + }; + case 5: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.json', { + suggestion: suggestion + }), + method: 'loadJSON' + }; + case 6: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.bytes', { + suggestion: suggestion + }), + method: 'loadBytes' + }; + case 7: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.large'), + method: 'loadX' + }; + case 8: + return { + message: (0, _internationalization.translator) ('fes.fileLoadError.gif'), + method: 'loadImage' + }; + } + }; + /** + * Called internally if there is an error during file loading. + * + * Generates and prints a friendly error message using key: + * "fes.fileLoadError.[*]". + * + * @method _friendlyFileLoadError + * @private + * @param {Number} errorType Number of file load error type + * @param {String} filePath Path to file caused the error + */ + _main.default._friendlyFileLoadError = function (errorType, filePath) { + var _fileLoadErrorCases = fileLoadErrorCases(errorType, filePath), + message = _fileLoadErrorCases.message, + method = _fileLoadErrorCases.method; + _main.default._friendlyError(message, method, 3); + }; + } + var _default = _main.default; + exports.default = _default; + }, + { + '../internationalization': 296, + '../main': 298 + } + ], + 291: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var _internationalization = _dereq_('../internationalization'); + var constants = _interopRequireWildcard(_dereq_('../constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @for p5 + * @requires core + */ + /** + * Checks if any p5.js constant/function is declared outside of setup() + * and draw() function. Also checks any reserved constant/function is + * redeclared. + * + * Generates and prints a friendly error message using key: + * "fes.sketchReaderErrors.reservedConst", + * "fes.sketchReaderErrors.reservedFunc". + * + * @method _fesCodeReader + * @private + */ + + if (typeof IS_MINIFIED !== 'undefined') { + _main.default._fesCodeReader = function () { + }; + } else { + //list of functions to ignore as they either + //are ment to be defined or generate false positive + //outputs + var ignoreFunction = [ + 'setup', + 'draw', + 'preload', + 'deviceMoved', + 'deviceTurned', + 'deviceShaken', + 'doubleClicked', + 'mousePressed', + 'mouseReleased', + 'mouseMoved', + 'mouseDragged', + 'mouseClicked', + 'mouseWheel', + 'touchStarted', + 'touchMoved', + 'touchEnded', + 'keyPressed', + 'keyReleased', + 'keyTyped', + 'windowResized', + 'name', + 'parent', + 'toString', + 'print', + 'stop', + 'onended' + ]; + /** + * Takes a list of variables defined by the user in the code + * as an array and checks if the list contains p5.js constants and functions. + * + * @method checkForConstsAndFuncs + * @private + * @param {Array} variableArray + */ + var checkForConstsAndFuncs = function checkForConstsAndFuncs(variableArray) { + for (var i = 0; i < variableArray.length; i++) { + //if the element in variableArray is a p5.js constant then the below condidion + //will be true, hence a match is found + if (constants[variableArray[i]] !== undefined) { + var url = 'https://p5js.org/reference/#/p5/'.concat(variableArray[i]); + //display the FES message if a match is found + _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedConst', { + url: url, + symbol: variableArray[i] + })); + return; + //if match found then end search + } + } + var p5Constructors = { + }; + for (var _i = 0, _Object$keys = Object.keys(_main.default); _i < _Object$keys.length; _i++) { + var key = _Object$keys[_i]; + // Get a list of all constructors in p5. They are functions whose names + // start with a capital letter + if (typeof _main.default[key] === 'function' && key[0] !== key[0].toLowerCase()) { + p5Constructors[key] = _main.default[key]; + } + } + for (var _i2 = 0; _i2 < variableArray.length; _i2++) { + //ignoreFunction contains the list of functions to be ignored + if (!ignoreFunction.includes(variableArray[_i2])) { + var keyArray = Object.keys(p5Constructors); + var j = 0; + //for every function name obtained check if it matches any p5.js function name + for (; j < keyArray.length; j++) { + if (p5Constructors[keyArray[j]].prototype[variableArray[_i2]] !== undefined) { + //if a p5.js function is used ie it is in the funcs array + var _url = 'https://p5js.org/reference/#/p5/'.concat(variableArray[_i2]); + _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedFunc', { + url: _url, + symbol: variableArray[_i2] + })); + return; + } + } + } + } + }; + //these regex are used to perform variable extraction + //visit https://regexr.com/ for the detailed view + var optionalVarKeyword = /(?:(?:let|const|var)\s+)?/; + // Bracketed expressions start with an opening bracket, some amount of non + // bracket characters, then a closing bracket. Note that this won't properly + // parse nested brackets: `constrain(millis(), 0, 1000)` will match + // `constrain(millis()` only, but will still fail gracefully and not try to + // mistakenly read any subsequent code as assignment expressions. + var roundBracketedExpr = /(?:\([^)]*\))/; + var squareBracketedExpr = /(?:\[[^\]]*\])/; + var curlyBracketedExpr = /(?:\{[^}]*\})/; + var bracketedExpr = new RegExp([roundBracketedExpr, + squareBracketedExpr, + curlyBracketedExpr].map(function (regex) { + return regex.source; + }).join('|')); + // In an a = b expression, `b` can be any character up to a newline or comma, + // unless the comma is inside of a bracketed expression of some kind (to make + // sure we parse function calls with multiple arguments properly.) + var rightHandSide = new RegExp('(?:' + bracketedExpr.source + '|[^\\n,])+'); + var leftHandSide = /([\w$]+)/; + var assignmentOperator = /\s*=\s*/; + var singleAssignment = new RegExp(leftHandSide.source + assignmentOperator.source + rightHandSide.source); + var listSeparator = /,\s*/; + var oneOrMoreAssignments = new RegExp('(?:' + singleAssignment.source + listSeparator.source + ')*' + singleAssignment.source); + var assignmentStatement = new RegExp('^' + optionalVarKeyword.source + oneOrMoreAssignments.source); + var letConstName = /(?:(?:let|const)\s+)([\w$]+)/; + /** + * Takes an array in which each element is a line of code + * containing a variable definition(Eg: arr=['let x = 100', 'const y = 200']) + * and extracts the variables defined. + * + * @method extractVariables + * @private + * @param {Array} linesArray array of lines of code + */ + var extractVariables = function extractVariables(linesArray) { + //extract variable names from the user's code + var matches = [ + ]; + linesArray.forEach(function (ele) { + // Match 0 is the part of the line of code that the regex looked at. + // Matches 1 and onward will be only the variable names on the left hand + // side of assignment expressions. + var match = ele.match(assignmentStatement); + if (!match) return; + matches.push.apply(matches, _toConsumableArray(match.slice(1).filter(function (group) { + return group !== undefined; + }))); + }); + //check if the obtained variables are a part of p5.js or not + checkForConstsAndFuncs(matches); + }; + /** + * Takes an array in which each element is a line of code + * containing a function definition(array=['let x = () => {...}']) + * and extracts the functions defined. + * + * @method extractFuncVariables + * @private + * @param {Array} linesArray array of lines of code + */ + var extractFuncVariables = function extractFuncVariables(linesArray) { + var matches = [ + ]; + //RegExp to extract function names from let/const x = function()... + //visit https://regexr.com/ for the detailed view. + linesArray.forEach(function (ele) { + var m = ele.match(letConstName); + if (m !== null) matches.push(ele.match(letConstName) [1]); + }); + //matches array contains the names of the functions + checkForConstsAndFuncs(matches); + }; + /** + * Converts code written by the user to an array + * every element of which is a seperate line of code. + * + * @method codeToLines + * @private + * @param {String} code code written by the user + */ + var codeToLines = function codeToLines(code) { + //convert code to array of code and filter out + //unnecessary lines + var arrayVariables = code.split('\n').map(function (line) { + return line.trim(); + }).filter(function (line) { + return line !== '' && !line.includes('//') && (line.includes('let') || line.includes('const')) && !line.includes('=>') && !line.includes('function'); + } //filter out lines containing variable names + ); + //filter out lines containing function names + var arrayFunctions = code.split('\n').map(function (line) { + return line.trim(); + }).filter(function (line) { + return line !== '' && !line.includes('//') && (line.includes('let') || line.includes('const')) && (line.includes('=>') || line.includes('function')); + }); + //pass the relevant array to a function which will extract all the variables/functions names + extractVariables(arrayVariables); + extractFuncVariables(arrayFunctions); + }; + /** + * Remove multiline comments and the content inside it. + * + * @method removeMultilineComments + * @private + * @param {String} code code written by the user + * @returns {String} + */ + var removeMultilineComments = function removeMultilineComments(code) { + var start = code.indexOf('/*'); + var end = code.indexOf('*/'); + //create a new string which don't have multiline comments + while (start !== - 1 && end !== - 1) { + if (start === 0) { + code = code.slice(end + 2); + } else code = code.slice(0, start) + code.slice(end + 2); + start = code.indexOf('/*'); + end = code.indexOf('*/'); + } + return code; + }; + /** + * Checks if any p5.js constant or function is declared outside a function + * and reports it if found. + * + * @method globalConstFuncCheck + * @private + * @returns {Boolean} + */ + var globalConstFuncCheck = function globalConstFuncCheck() { + // generate all the const key data as an array + var tempArray = Object.keys(constants); + var element; + for (var i = 0; i < tempArray.length; i++) { + try { + //if the user has not declared p5.js constant anywhere outside the + //setup or draw function then this will throw an + //error. + element = eval(tempArray[i]); + } catch (e) { + //We are catching the error due to the above mentioned + //reason. Since there is no declaration of constant everything + //is OK so we will skip the current iteration and check for the + //next element. + continue; + } //if we are not getting an error this means + //user have changed the value. We will check + //if the value is changed and if it is changed + //then report. + + if (constants[tempArray[i]] !== element) { + var url = 'https://p5js.org/reference/#/p5/'.concat(tempArray[i]); + _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedConst', { + url: url, + symbol: tempArray[i] + })); + //if a p5.js constant is already reported then no need to check + //for p5.js functions. + return true; + } + } //the below code gets a list of p5.js functions + + var p5Constructors = { + }; + for (var _i3 = 0, _Object$keys2 = Object.keys(_main.default); _i3 < _Object$keys2.length; _i3++) { + var key = _Object$keys2[_i3]; + // Get a list of all constructors in p5. They are functions whose names + // start with a capital letter + if (typeof _main.default[key] === 'function' && key[0] !== key[0].toLowerCase()) { + p5Constructors[key] = _main.default[key]; + } + } + var keyArray = Object.keys(p5Constructors); + var classesWithGlobalFns = [ + 'Renderer', + 'Renderer2D', + 'RendererGL' + ]; + var functionArray = [ + ]; + //get the names of all p5.js functions which are available globally + for (var _i4 = 0; _i4 < classesWithGlobalFns.length; _i4++) { + functionArray.push.apply(functionArray, _toConsumableArray(Object.keys(p5Constructors[classesWithGlobalFns[_i4]].prototype))); + } //we have p5.js function names with us so we will check + //if they have been declared or not. + + for (var _i5 = 0; _i5 < functionArray.length; _i5++) { + //ignoreFunction contains the list of functions to be ignored + if (!ignoreFunction.includes(functionArray[_i5])) { + try { + //if we get an error that means the function is not declared + element = eval(functionArray[_i5]); + } catch (e) { + //we will skip the iteration + continue; + } //if we are not getting an error this means + //user have used p5.js function. Check if it is + //changed and if so then report it. + + for (var k = 0; k < keyArray.length; k++) { + if (p5Constructors[keyArray[k]].prototype[functionArray[_i5]] === undefined); + else { + if (p5Constructors[keyArray[k]].prototype[functionArray[_i5]] !== element) { + var _url2 = 'https://p5js.org/reference/#/p5/'.concat(functionArray[_i5]); + _main.default._friendlyError((0, _internationalization.translator) ('fes.sketchReaderErrors.reservedFunc', { + url: _url2, + symbol: functionArray[_i5] + })); + return true; + } + } + } + } + } + }; + /** + * Initiates the sketch_reader's processes. + * Obtains the code in setup and draw function + * and forwards it for further processing and evaluation. + * + * @method fesCodeReader + * @private + */ + var fesCodeReader = function fesCodeReader() { + //moveAhead will determine if a match is found outside + //the setup and draw function. If a match is found then + //to prevent further potential reporting we will exit immidiately + var moveAhead = globalConstFuncCheck(); + if (moveAhead) return; + var code = ''; + try { + //get code from setup + code += '' + setup; + } catch (e) { + code += ''; + } + try { + //get code from draw + code += '\n' + draw; + } catch (e) { + code += ''; + } + if (code === '') return; + code = removeMultilineComments(code); + codeToLines(code); + }; + _main.default._fesCodeReader = fesCodeReader; + window.addEventListener('load', _main.default._fesCodeReader); + } + var _default = _main.default; + exports.default = _default; + }, + { + '../constants': 286, + '../internationalization': 296, + '../main': 298, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.constructor': 204, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.match': 211, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.trim': 219, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 292: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @for p5 + * @requires core + */ + // Borrow from stacktracejs https://github.com/stacktracejs/stacktrace.js with + // minor modifications. The license for the same and the code is included below + // Copyright (c) 2017 Eric Wendelin and other contributors + // 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. + + function ErrorStackParser() { + var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; + var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; + var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; + return { + /** + * Given an Error object, extract the most information from it. + * @private + * @param {Error} error object + * @return {Array} of stack frames + */ + parse: function ErrorStackParser$$parse(error) { + if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') { + return this.parseOpera(error); + } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) { + return this.parseV8OrIE(error); + } else if (error.stack) { + return this.parseFFOrSafari(error); + } else { + // throw new Error('Cannot parse given Error object'); + } + }, + // Separate line and column numbers from a string of the form: (URI:Line:Column) + extractLocation: function ErrorStackParser$$extractLocation(urlLike) { + // Fail-fast but return locations like "(native)" + if (urlLike.indexOf(':') === - 1) { + return [urlLike]; + } + var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; + var parts = regExp.exec(urlLike.replace(/[()]/g, '')); + return [parts[1], + parts[2] || undefined, + parts[3] || undefined]; + }, + parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { + var filtered = error.stack.split('\n').filter(function (line) { + return !!line.match(CHROME_IE_STACK_REGEXP); + }, this); + return filtered.map(function (line) { + if (line.indexOf('(eval ') > - 1) { + // Throw away eval information until we implement stacktrace.js/stackframe#8 + line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, ''); + } + var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '('); + // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in + // case it has spaces in it, as the string is split on \s+ later on + var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/); + // remove the parenthesized location from the line, if it was matched + sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine; + var tokens = sanitizedLine.split(/\s+/).slice(1); + // if a location was matched, pass it to extractLocation() otherwise pop the last token + var locationParts = this.extractLocation(location ? location[1] : tokens.pop()); + var functionName = tokens.join(' ') || undefined; + var fileName = [ + 'eval', + '' + ].indexOf(locationParts[0]) > - 1 ? undefined : locationParts[0]; + return { + functionName: functionName, + fileName: fileName, + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line + }; + }, this); + }, + parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) { + var filtered = error.stack.split('\n').filter(function (line) { + return !line.match(SAFARI_NATIVE_CODE_REGEXP); + }, this); + return filtered.map(function (line) { + // Throw away eval information until we implement stacktrace.js/stackframe#8 + if (line.indexOf(' > eval') > - 1) { + line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1'); + } + if (line.indexOf('@') === - 1 && line.indexOf(':') === - 1) { + // Safari eval frames only have function names and nothing else + return { + functionName: line + }; + } else { + var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; + var matches = line.match(functionNameRegex); + var functionName = matches && matches[1] ? matches[1] : undefined; + var locationParts = this.extractLocation(line.replace(functionNameRegex, '')); + return { + functionName: functionName, + fileName: locationParts[0], + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line + }; + } + }, this); + }, + parseOpera: function ErrorStackParser$$parseOpera(e) { + if (!e.stacktrace || e.message.indexOf('\n') > - 1 && e.message.split('\n').length > e.stacktrace.split('\n').length) { + return this.parseOpera9(e); + } else if (!e.stack) { + return this.parseOpera10(e); + } else { + return this.parseOpera11(e); + } + }, + parseOpera9: function ErrorStackParser$$parseOpera9(e) { + var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; + var lines = e.message.split('\n'); + var result = [ + ]; + for (var i = 2, len = lines.length; i < len; i += 2) { + var match = lineRE.exec(lines[i]); + if (match) { + result.push({ + fileName: match[2], + lineNumber: match[1], + source: lines[i] + }); + } + } + return result; + }, + parseOpera10: function ErrorStackParser$$parseOpera10(e) { + var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; + var lines = e.stacktrace.split('\n'); + var result = [ + ]; + for (var i = 0, len = lines.length; i < len; i += 2) { + var match = lineRE.exec(lines[i]); + if (match) { + result.push({ + functionName: match[3] || undefined, + fileName: match[2], + lineNumber: match[1], + source: lines[i] + }); + } + } + return result; + }, + // Opera 10.65+ Error.stack very similar to FF/Safari + parseOpera11: function ErrorStackParser$$parseOpera11(error) { + var filtered = error.stack.split('\n').filter(function (line) { + return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/); + }, this); + return filtered.map(function (line) { + var tokens = line.split('@'); + var locationParts = this.extractLocation(tokens.pop()); + var functionCall = tokens.shift() || ''; + var functionName = functionCall.replace(//, '$2').replace(/\([^)]*\)/g, '') || undefined; + var argsRaw; + if (functionCall.match(/\(([^)]*)\)/)) { + argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1'); + } + var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(','); + return { + functionName: functionName, + args: args, + fileName: locationParts[0], + lineNumber: locationParts[1], + columnNumber: locationParts[2], + source: line + }; + }, this); + } + }; + } // End borrow + // wrapper exposing ErrorStackParser + + _main.default._getErrorStackParser = function getErrorStackParser() { + return new ErrorStackParser(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../main': 298, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.match': 211, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216 + } + ], + 293: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.last-index-of'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.last-index-of'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var constants = _interopRequireWildcard(_dereq_('../constants')); + var _internationalization = _dereq_('../internationalization'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === 'function' ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== 'function') { + throw new TypeError('Super expression must either be null or a function'); + } + if (typeof _cache !== 'undefined') { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); + } + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [ + null + ]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf('[native code]') !== - 1; + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @for p5 + * @requires core + */ + + if (typeof IS_MINIFIED !== 'undefined') { + _main.default._validateParameters = _main.default._clearValidateParamsCache = function () { + }; + } else { + // for parameter validation + var dataDoc = _dereq_('../../../docs/parameterData.json'); + var arrDoc = JSON.parse(JSON.stringify(dataDoc)); + var docCache = { + }; + var builtinTypes = new Set(['null', + 'number', + 'string', + 'boolean', + 'constant', + 'function', + 'any', + 'integer']); + var basicTypes = { + number: true, + boolean: true, + string: true, + function : true, + undefined: true + }; + // reverse map of all constants + var constantsReverseMap = { + }; + for (var key in constants) { + constantsReverseMap[constants[key]] = key; + } // mapping names of p5 types to their constructor function + // p5Constructors: + // - Color: f() + // - Graphics: f() + // - Vector: f() + // and so on + + var p5Constructors = { + }; + // For speedup over many runs. funcSpecificConstructors[func] only has the + // constructors for types which were seen earlier as args of "func" + var funcSpecificConstructors = { + }; + window.addEventListener('load', function () { + // Make a list of all p5 classes to be used for argument validation + // This must be done only when everything has loaded otherwise we get + // an empty array + for (var _i = 0, _Object$keys = Object.keys(_main.default); _i < _Object$keys.length; _i++) { + var _key = _Object$keys[_i]; + // Get a list of all constructors in p5. They are functions whose names + // start with a capital letter + if (typeof _main.default[_key] === 'function' && _key[0] !== _key[0].toLowerCase()) { + p5Constructors[_key] = _main.default[_key]; + } + } + }); + var argumentTree = { + }; + // The following two functions are responsible for querying and inserting + // into the argument tree. It stores the types of arguments that each + // function has seen so far. It is used to query if a sequence of + // arguments seen in validate parameters was seen before. + // Lets consider that the following segment of code runs repeatedly, perhaps + // in a loop or in draw() + // color(10, 10, 10); + // color(10, 10); + // color('r', 'g', 'b'); + // After the first of run the code segment, the argument tree looks like + // - color + // - number + // - number + // - number + // - seen: true + // - seen: true + // - string + // - string + // - string + // - seen: true + // seen: true signifies that this argument was also seen as the last + // argument in a call. Now in the second run of the sketch, it would traverse + // the existing tree and see seen: true, i.e this sequence was seen + // before and so scoring can be skipped. This also prevents logging multiple + // validation messages for the same thing. + /** + * Query type and return the result as an object + * + * This would be called repeatedly over and over again, + * so it needs to be as optimized for performance as possible + * @method addType + * @private + */ + var addType = function addType(value, obj, func) { + var type = _typeof(value); + if (basicTypes[type]) { + if (constantsReverseMap[value]) { + // check if the value is a p5 constant and if it is, we would want the + // value itself to be stored in the tree instead of the type + obj = obj[value] || (obj[value] = { + }); + } else { + obj = obj[type] || (obj[type] = { + }); + } + } else if (value === null) { + // typeof null -> "object". don't want that + obj = obj['null'] || (obj['null'] = { + }); + } else { + // objects which are instances of p5 classes have nameless constructors. + // native objects have a constructor named "Object". This check + // differentiates between the two so that we dont waste time finding the + // p5 class if we just have a native object + if (value.constructor && value.constructor.name) { + obj = obj[value.constructor.name] || (obj[value.constructor.name] = { + }); + return obj; + } // constructors for types defined in p5 do not have a name property. + // e.constructor.name gives "". Code in this segment is a workaround for it + // p5C will only have the name: constructor mapping for types + // which were already seen as args of "func" + + var p5C = funcSpecificConstructors[func]; + // p5C would contain much fewer items than p5Constructors. if we find our + // answer in p5C, we don't have to scan through p5Constructors + if (p5C === undefined) { + // if there isn't an entry yet for func + // make an entry of empty object + p5C = funcSpecificConstructors[func] = { + }; + } + for (var _key2 in p5C) { + // search on the constructors we have already seen (smaller search space) + if (value instanceof p5C[_key2]) { + obj = obj[_key2] || (obj[_key2] = { + }); + return obj; + } + } + for (var _key3 in p5Constructors) { + // if the above search didn't work, search on all p5 constructors + if (value instanceof p5Constructors[_key3]) { + obj = obj[_key3] || (obj[_key3] = { + }); + // if found, add to known constructors for this function + p5C[_key3] = p5Constructors[_key3]; + return obj; + } + } // nothing worked, put the type as it is + + obj = obj[type] || (obj[type] = { + }); + } + return obj; + }; + /** + * Build the argument type tree, argumentTree + * + * This would be called repeatedly over and over again, + * so it needs to be as optimized for performance as possible + * @method buildArgTypeCache + * @private + */ + var buildArgTypeCache = function buildArgTypeCache(func, arr) { + // get the if an argument tree for current function already exists + var obj = argumentTree[func]; + if (obj === undefined) { + // if it doesn't, create an empty tree + obj = argumentTree[func] = { + }; + } + for (var i = 0, len = arr.length; i < len; ++i) { + var value = arr[i]; + if (value instanceof Array) { + // an array is passed as an argument, expand it and get the type of + // each of its element. We distinguish the start of an array with 'as' + // or arraystart. This would help distinguish between the arguments + // (number, number, number) and (number, [number, number]) + obj = obj['as'] || (obj['as'] = { + }); + for (var j = 0, lenA = value.length; j < lenA; ++j) { + obj = addType(value[j], obj, func); + } + } else { + obj = addType(value, obj, func); + } + } + return obj; + }; + /** + * Query data.json + * This is a helper function for validateParameters() + * @method lookupParamDoc + * @private + */ + var lookupParamDoc = function lookupParamDoc(func) { + // look for the docs in the `data.json` datastructure + var ichDot = func.lastIndexOf('.'); + var funcName = func.slice(ichDot + 1); + var funcClass = func.slice(0, ichDot !== - 1 ? ichDot : 0) || 'p5'; + var classitems = arrDoc; + var queryResult = classitems[funcClass][funcName]; + // different JSON structure for funct with multi-format + var overloads = [ + ]; + if (queryResult.hasOwnProperty('overloads')) { + // add all the overloads + for (var i = 0; i < queryResult.overloads.length; i++) { + overloads.push({ + formats: queryResult.overloads[i].params + }); + } + } else { + // no overloads, just add the main method definition + overloads.push({ + formats: queryResult.params || [ + ] + }); + } // parse the parameter types for each overload + + var mapConstants = { + }; + var maxParams = 0; + overloads.forEach(function (overload) { + var formats = overload.formats; + // keep a record of the maximum number of arguments + // this method requires. + if (maxParams < formats.length) { + maxParams = formats.length; + } // calculate the minimum number of arguments + // this overload requires. + + var minParams = formats.length; + while (minParams > 0 && formats[minParams - 1].optional) { + minParams--; + } + overload.minParams = minParams; + // loop through each parameter position, and parse its types + formats.forEach(function (format) { + // split this parameter's types + format.types = format.type.split('|').map(function ct(type) { + // array + if (type.slice( - 2) === '[]') { + return { + name: type, + array: ct(type.slice(0, - 2)) + }; + } + var lowerType = type.toLowerCase(); + // constant + if (lowerType === 'constant') { + var constant; + if (mapConstants.hasOwnProperty(format.name)) { + constant = mapConstants[format.name]; + } else { + // parse possible constant values from description + var myRe = /either\s+(?:[A-Z0-9_]+\s*,?\s*(?:or)?\s*)+/g; + var values = { + }; + var names = [ + ]; + constant = mapConstants[format.name] = { + values: values, + names: names + }; + var myArray = myRe.exec(format.description); + if (func === 'endShape' && format.name === 'mode') { + values[constants.CLOSE] = true; + names.push('CLOSE'); + } else { + var match = myArray[0]; + var reConst = /[A-Z0-9_]+/g; + var matchConst; + while ((matchConst = reConst.exec(match)) !== null) { + var name = matchConst[0]; + if (constants.hasOwnProperty(name)) { + values[constants[name]] = true; + names.push(name); + } + } + } + } + return { + name: type, + builtin: lowerType, + names: constant.names, + values: constant.values + }; + } // function + + if (lowerType.slice(0, 'function'.length) === 'function') { + lowerType = 'function'; + } // builtin + + if (builtinTypes.has(lowerType)) { + return { + name: type, + builtin: lowerType + }; + } // find type's prototype + + var t = window; + var typeParts = type.split('.'); + // special-case 'p5' since it may be non-global + if (typeParts[0] === 'p5') { + t = _main.default; + typeParts.shift(); + } + typeParts.forEach(function (p) { + t = t && t[p]; + }); + if (t) { + return { + name: type, + prototype: t + }; + } + return { + name: type, + type: lowerType + }; + }); + }); + }); + return { + overloads: overloads, + maxParams: maxParams + }; + }; + /** + * Checks whether input type is Number + * This is a helper function for validateParameters() + * @method isNumber + * @private + * + * @returns {Boolean} a boolean indicating whether input type is Number + */ + var isNumber = function isNumber(param) { + if (isNaN(parseFloat(param))) return false; + switch (_typeof(param)) { + case 'number': + return true; + case 'string': + return !isNaN(param); + default: + return false; + } + }; + /** + * Test type for non-object type parameter validation + * @method testParamType + * @private + */ + var testParamType = function testParamType(param, type) { + var isArray = param instanceof Array; + var matches = true; + if (type.array && isArray) { + for (var i = 0; i < param.length; i++) { + var error = testParamType(param[i], type.array); + if (error) return error / 2; // half error for elements + } + } else if (type.prototype) { + matches = param instanceof type.prototype; + } else if (type.builtin) { + switch (type.builtin) { + case 'number': + matches = isNumber(param); + break; + case 'integer': + matches = isNumber(param) && Number(param) === Math.floor(param); + break; + case 'boolean': + case 'any': + matches = true; + break; + case 'array': + matches = isArray; + break; + case 'string': + matches = /*typeof param === 'number' ||*/ typeof param === 'string'; + break; + case 'constant': + matches = type.values.hasOwnProperty(param); + break; + case 'function': + matches = param instanceof Function; + break; + case 'null': + matches = param === null; + break; + } + } else { + matches = _typeof(param) === type.t; + } + return matches ? 0 : 1; + }; + /** + * Test type for multiple parameters + * @method testParamTypes + * @private + */ + var testParamTypes = function testParamTypes(param, types) { + var minScore = 9999; + for (var i = 0; minScore > 0 && i < types.length; i++) { + var score = testParamType(param, types[i]); + if (minScore > score) minScore = score; + } + return minScore; + }; + /** + * generate a score (higher is worse) for applying these args to + * this overload. + * @method scoreOverload + * @private + */ + var scoreOverload = function scoreOverload(args, argCount, overload, minScore) { + var score = 0; + var formats = overload.formats; + var minParams = overload.minParams; + // check for too few/many args + // the score is double number of extra/missing args + if (argCount < minParams) { + score = (minParams - argCount) * 2; + } else if (argCount > formats.length) { + score = (argCount - formats.length) * 2; + } // loop through the formats, adding up the error score for each arg. + // quit early if the score gets higher than the previous best overload. + + for (var p = 0; score <= minScore && p < formats.length; p++) { + var arg = args[p]; + var format = formats[p]; + // '== null' checks for 'null' and typeof 'undefined' + if (arg == null) { + // handle undefined args + if (!format.optional || p < minParams || p < argCount) { + score += 1; + } + } else { + score += testParamTypes(arg, format.types); + } + } + return score; + }; + /** + * Gets a list of errors for this overload + * @method getOverloadErrors + * @private + */ + var getOverloadErrors = function getOverloadErrors(args, argCount, overload) { + var formats = overload.formats; + var minParams = overload.minParams; + // check for too few/many args + if (argCount < minParams) { + return [{ + type: 'TOO_FEW_ARGUMENTS', + argCount: argCount, + minParams: minParams + } + ]; + } else if (argCount > formats.length) { + return [{ + type: 'TOO_MANY_ARGUMENTS', + argCount: argCount, + maxParams: formats.length + } + ]; + } + var errorArray = [ + ]; + for (var p = 0; p < formats.length; p++) { + var arg = args[p]; + var format = formats[p]; + // '== null' checks for 'null' and typeof 'undefined' + if (arg == null) { + // handle undefined args + if (!format.optional || p < minParams || p < argCount) { + errorArray.push({ + type: 'EMPTY_VAR', + position: p, + format: format + }); + } + } else if (testParamTypes(arg, format.types) > 0) { + errorArray.push({ + type: 'WRONG_TYPE', + position: p, + format: format, + arg: arg + }); + } + } + return errorArray; + }; + /** + * a custom error type, used by the mocha + * tests when expecting validation errors + * @method ValidationError + * @private + */ + _main.default.ValidationError = function (name) { + var err = /*#__PURE__*/ function (_Error) { + _inherits(err, _Error); + var _super = _createSuper(err); + function err(message, func, type) { + var _this; + _classCallCheck(this, err); + _this = _super.call(this); + _this.message = message; + _this.func = func; + _this.type = type; + if ('captureStackTrace' in Error) Error.captureStackTrace(_assertThisInitialized(_this), err); + else _this.stack = new Error().stack; + return _this; + } + return err; + }( /*#__PURE__*/ _wrapNativeSuper(Error)); + err.prototype.name = name; + return err; + }('ValidationError'); + /** + * Prints a friendly msg after parameter validation + * @method _friendlyParamError + * @private + */ + _main.default._friendlyParamError = function (errorObj, func) { + var message; + var translationObj; + function formatType() { + var format = errorObj.format; + return format.types.map(function (type) { + return type.names ? type.names.join('|') : type.name; + }).join('|'); + } + switch (errorObj.type) { + case 'EMPTY_VAR': + { + translationObj = { + func: func, + formatType: formatType(), + // It needs to be this way for i18next-extract to work. The comment + // specifies the values that the context can take so that it can + // statically prepare the translation files with them. + /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ + position: (0, _internationalization.translator) ('fes.positions.p', { + context: (errorObj.position + 1).toString(), + defaultValue: (errorObj.position + 1).toString() + }), + url: 'https://p5js.org/examples/data-variable-scope.html' + }; + break; + } + case 'WRONG_TYPE': + { + var arg = errorObj.arg; + var argType = arg instanceof Array ? 'array' : arg === null ? 'null' : arg === undefined ? 'undefined' : typeof arg === 'number' && isNaN(arg) ? 'NaN' : arg.name || _typeof(arg); + translationObj = { + func: func, + formatType: formatType(), + argType: argType, + /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ + position: (0, _internationalization.translator) ('fes.positions.p', { + context: (errorObj.position + 1).toString(), + defaultValue: (errorObj.position + 1).toString() + }) + }; + break; + } + case 'TOO_FEW_ARGUMENTS': + { + translationObj = { + func: func, + minParams: errorObj.minParams, + argCount: errorObj.argCount + }; + break; + } + case 'TOO_MANY_ARGUMENTS': + { + translationObj = { + func: func, + maxParams: errorObj.maxParams, + argCount: errorObj.argCount + }; + break; + } + } + if (translationObj) { + try { + // const re = /Function\.validateParameters.*[\r\n].*[\r\n].*\(([^)]*)/; + var myError = new Error(); + var parsed = _main.default._getErrorStackParser().parse(myError); + if (parsed[3] && parsed[3].functionName && parsed[3].functionName.includes('.') && _main.default.prototype[parsed[3].functionName.split('.').slice( - 1) [0]]) { + return; + } + if (_main.default._throwValidationErrors) { + throw new _main.default.ValidationError(message, func, errorObj.type); + } // try to extract the location from where the function was called + + if (parsed[3] && parsed[3].fileName && parsed[3].lineNumber && parsed[3].columnNumber) { + var location = ''.concat(parsed[3].fileName, ':').concat(parsed[3].lineNumber, ':').concat(parsed[3].columnNumber); + translationObj.location = (0, _internationalization.translator) ('fes.location', { + location: location, + // for e.g. get "sketch.js" from "https://example.com/abc/sketch.js" + file: parsed[3].fileName.split('/').slice( - 1), + line: parsed[3].lineNumber + }); + // tell fesErrorMonitor that we have already given a friendly message + // for this line, so it need not to do the same in case of an error + _main.default._fesLogCache[location] = true; + } + } catch (err) { + if (err instanceof _main.default.ValidationError) { + throw err; + } + } + translationObj.context = errorObj.type; + // i18next-extract-mark-context-next-line ["EMPTY_VAR", "TOO_MANY_ARGUMENTS", "TOO_FEW_ARGUMENTS", "WRONG_TYPE"] + message = (0, _internationalization.translator) ('fes.friendlyParamError.type', translationObj); + _main.default._friendlyError(''.concat(message), func, 3); + } + }; + /** + * Clears cache to avoid having multiple FES messages for the same set of + * parameters. + * + * If a function is called with some set of wrong arguments, and then called + * again with the same set of arguments, the messages due to the second call + * will be supressed. If two tests test on the same wrong arguments, the + * second test won't see the validationError. clearing argumentTree solves it + * + * @method _clearValidateParamsCache + * @private + */ + _main.default._clearValidateParamsCache = function clearValidateParamsCache() { + for (var _i2 = 0, _Object$keys2 = Object.keys(argumentTree); _i2 < _Object$keys2.length; _i2++) { + var _key4 = _Object$keys2[_i2]; + delete argumentTree[_key4]; + } + }; + // allowing access to argumentTree for testing + _main.default._getValidateParamsArgTree = function getValidateParamsArgTree() { + return argumentTree; + }; + /** + * Runs parameter validation by matching the input parameters with information + * from `docs/reference/data.json`. + * Generates and prints a friendly error message using key: + * "fes.friendlyParamError.[*]". + * + * @method _validateParameters + * @private + * @param {String} func Name of the function + * @param {Array} args User input arguments + * + * @example: + * const a; + * ellipse(10,10,a,5); + * console output: + * "It looks like ellipse received an empty variable in spot #2." + * + * @example: + * ellipse(10,"foo",5,5); + * console output: + * "ellipse was expecting a number for parameter #1, + * received "foo" instead." + */ + _main.default._validateParameters = function validateParameters(func, args) { + if (_main.default.disableFriendlyErrors) { + return; // skip FES + } // query / build the argument type tree and check if this sequence + // has already been seen before. + + var obj = buildArgTypeCache(func, args); + if (obj.seen) { + return; + } // mark this sequence as seen + + obj.seen = true; + // lookup the docs in the 'data.json' file + var docs = docCache[func] || (docCache[func] = lookupParamDoc(func)); + var overloads = docs.overloads; + var argCount = args.length; + // the following line ignores trailing undefined arguments, commenting + // it to resolve https://github.com/processing/p5.js/issues/4571 + // '== null' checks for 'null' and typeof 'undefined' + // while (argCount > 0 && args[argCount - 1] == null) argCount--; + // find the overload with the best score + var minScore = 99999; + var minOverload; + for (var i = 0; i < overloads.length; i++) { + var score = scoreOverload(args, argCount, overloads[i], minScore); + if (score === 0) { + return; // done! + } else if (minScore > score) { + // this score is better that what we have so far... + minScore = score; + minOverload = i; + } + } // this should _always_ be true here... + + if (minScore > 0) { + // get the errors for the best overload + var errorArray = getOverloadErrors(args, argCount, overloads[minOverload]); + // generate err msg + for (var n = 0; n < errorArray.length; n++) { + _main.default._friendlyParamError(errorArray[n], func); + } + } + }; + _main.default.prototype._validateParameters = _main.default.validateParameters; + } + var _default = _main.default; + exports.default = _default; + }, + { + '../../../docs/parameterData.json': 1, + '../constants': 286, + '../internationalization': 296, + '../main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.last-index-of': 181, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.map': 187, + 'core-js/modules/es.number.constructor': 191, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.set': 207, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 294: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var constants = _interopRequireWildcard(_dereq_('./constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } /** + * @requires constants + */ + + function modeAdjust(a, b, c, d, mode) { + if (mode === constants.CORNER) { + return { + x: a, + y: b, + w: c, + h: d + }; + } else if (mode === constants.CORNERS) { + return { + x: a, + y: b, + w: c - a, + h: d - b + }; + } else if (mode === constants.RADIUS) { + return { + x: a - c, + y: b - d, + w: 2 * c, + h: 2 * d + }; + } else if (mode === constants.CENTER) { + return { + x: a - c * 0.5, + y: b - d * 0.5, + w: c, + h: d + }; + } + } + var _default = { + modeAdjust: modeAdjust + }; + exports.default = _default; + }, + { + './constants': 286, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 295: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + var _main = _interopRequireDefault(_dereq_('../core/main')); + var _internationalization = _dereq_('./internationalization'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * _globalInit + * + * TODO: ??? + * if sketch is on window + * assume "global" mode + * and instantiate p5 automatically + * otherwise do nothing + * + * @private + * @return {Undefined} + */ + + var _globalInit = function _globalInit() { + // Could have been any property defined within the p5 constructor. + // If that property is already a part of the global object, + // this code has already run before, likely due to a duplicate import + if (typeof window._setupDone !== 'undefined') { + console.warn('p5.js seems to have been imported multiple times. Please remove the duplicate import'); + return; + } + if (!window.mocha) { + // If there is a setup or draw function on the window + // then instantiate p5 in "global" mode + if ((window.setup && typeof window.setup === 'function' || window.draw && typeof window.draw === 'function') && !_main.default.instance) { + new _main.default(); + } + } + }; + // make a promise that resolves when the document is ready + var waitForDocumentReady = function waitForDocumentReady() { + return new Promise(function (resolve, reject) { + // if the page is ready, initialize p5 immediately + if (document.readyState === 'complete') { + resolve(); + // if the page is still loading, add an event listener + // and initialize p5 as soon as it finishes loading + } else { + window.addEventListener('load', resolve, false); + } + }); + }; + // only load translations if we're using the full, un-minified library + var waitingForTranslator = typeof IS_MINIFIED === 'undefined' ? (0, _internationalization.initialize) () : Promise.resolve(); + Promise.all([waitForDocumentReady(), + waitingForTranslator]).then(_globalInit); + }, + { + '../core/main': 298, + './internationalization': 296, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.promise': 201, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 296: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.setTranslatorLanguage = exports.currentTranslatorLanguage = exports.availableTranslatorLanguages = exports.initialize = exports.translator = void 0; + var _i18next = _interopRequireDefault(_dereq_('i18next')); + var _i18nextBrowserLanguagedetector = _interopRequireDefault(_dereq_('i18next-browser-languagedetector')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + var fallbackResources, + languages; + if (typeof IS_MINIFIED === 'undefined') { + // internationalization is only for the unminified build + var translationsModule = _dereq_('../../translations'); + fallbackResources = translationsModule.default; + languages = translationsModule.languages; + if (typeof P5_DEV_BUILD !== 'undefined') { + // When the library is built in development mode ( using npm run dev ) + // we want to use the current translation files on the disk, which may have + // been updated but not yet pushed to the CDN. + var completeResources = _dereq_('../../translations/dev'); + for (var _i = 0, _Object$keys = Object.keys(completeResources); _i < _Object$keys.length; _i++) { + var language = _Object$keys[_i]; + // In es_translation, language is es and namespace is translation + // In es_MX_translation, language is es-MX and namespace is translation + var parts = language.split('_'); + var lng = parts.slice(0, parts.length - 1).join('-'); + var ns = parts[parts.length - 1]; + fallbackResources[lng] = fallbackResources[lng] || { + }; + fallbackResources[lng][ns] = completeResources[language]; + } + } + } /** + * This is our i18next "backend" plugin. It tries to fetch languages + * from a CDN. + */ + + var FetchResources = /*#__PURE__*/ function () { + function FetchResources(services, options) { + _classCallCheck(this, FetchResources); + this.init(services, options); + } // run fetch with a timeout. Automatically rejects on timeout + // default timeout = 2000 ms + + _createClass(FetchResources, [ + { + key: 'fetchWithTimeout', + value: function fetchWithTimeout(url, options) { + var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2000; + return Promise.race([fetch(url, options), + new Promise(function (_, reject) { + return setTimeout(function () { + return reject(new Error('timeout')); + }, timeout); + })]); + } + }, + { + key: 'init', + value: function init(services) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + this.services = services; + this.options = options; + } + }, + { + key: 'read', + value: function read(language, namespace, callback) { + var loadPath = this.options.loadPath; + if (language === this.options.fallback) { + // if the default language of the user is the same as our inbuilt fallback, + // there's no need to fetch resources from the cdn. This won't actually + // need to run when we use "partialBundledLanguages" in the init + // function. + callback(null, fallbackResources[language][namespace]); + } else if (languages.includes(language)) { + // The user's language is included in the list of languages + // that we so far added translations for. + var url = this.services.interpolator.interpolate(loadPath, { + lng: language, + ns: namespace + }); + this.loadUrl(url, callback); + } else { + // We don't have translations for this language. i18next will use + // the default language instead. + callback('Not found', false); + } + } + }, + { + key: 'loadUrl', + value: function loadUrl(url, callback) { + this.fetchWithTimeout(url).then(function (response) { + var ok = response.ok; + if (!ok) { + // caught in the catch() below + throw new Error('failed loading '.concat(url)); + } + return response.json(); + }, function () { + // caught in the catch() below + throw new Error('failed loading '.concat(url)); + }).then(function (data) { + return callback(null, data); + }).catch(callback); + } + } + ]); + return FetchResources; + }(); + FetchResources.type = 'backend'; + /** + * This is our translation function. Give it a key and + * it will retrieve the appropriate string + * (within supported languages) according to the + * user's browser's language settings. + * @function translator + * @param {String} key a key that corresponds to a message in our translation files + * @param {Object} values values for use in the message under the given `key` + * @returns {String} message (with values inserted) in the user's browser language + * @private + */ + var translator = function translator(key, values) { + console.debug('p5.js translator called before translations were loaded'); + // Certain FES functionality may trigger before translations are downloaded. + // Using "partialBundledLanguages" option during initialization, we can + // still use our fallback language to display messages + _i18next.default.t(key, values); /* i18next-extract-disable-line */ + }; + // (We'll set this to a real value in the init function below!) + /** + * Set up our translation function, with loaded languages + */ + exports.translator = translator; + var initialize = function initialize() { + var i18init = _i18next.default.use(_i18nextBrowserLanguagedetector.default).use(FetchResources).init({ + fallbackLng: 'en', + nestingPrefix: '$tr(', + nestingSuffix: ')', + defaultNS: 'translation', + returnEmptyString: false, + interpolation: { + escapeValue: false + }, + detection: { + checkWhitelist: false, + // prevent storing or locating language from cookie or localStorage + // more info on https://github.com/processing/p5.js/issues/4862 + order: [ + 'querystring', + 'navigator', + 'htmlTag', + 'path', + 'subdomain' + ], + caches: [ + ] + }, + backend: { + fallback: 'en', + loadPath: 'https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json' + }, + partialBundledLanguages: true, + resources: fallbackResources + }).then(function (translateFn) { + exports.translator = translator = translateFn; + }, function (e) { + return console.debug('Translations failed to load ('.concat(e, ')')); + }); + // i18next.init() returns a promise that resolves when the translations + // are loaded. We use this in core/init.js to hold p5 initialization until + // we have the translation files. + return i18init; + }; + /** + * Returns a list of languages we have translations loaded for + */ + exports.initialize = initialize; + var availableTranslatorLanguages = function availableTranslatorLanguages() { + return _i18next.default.languages; + }; + /** + * Returns the current language selected for translation + */ + exports.availableTranslatorLanguages = availableTranslatorLanguages; + var currentTranslatorLanguage = function currentTranslatorLanguage(language) { + return _i18next.default.language; + }; + /** + * Sets the current language for translation + * Returns a promise that resolved when loading is finished, + * or rejects if it fails. + */ + exports.currentTranslatorLanguage = currentTranslatorLanguage; + var setTranslatorLanguage = function setTranslatorLanguage(language) { + return _i18next.default.changeLanguage(language || undefined, function (e) { + return console.debug('Translations failed to load ('.concat(e, ')')); + }); + }; + exports.setTranslatorLanguage = setTranslatorLanguage; + }, + { + '../../translations': 360, + '../../translations/dev': undefined, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.promise': 201, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/web.dom-collections.iterator': 256, + 'i18next': 267, + 'i18next-browser-languagedetector': 264 + } + ], + 297: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @for p5 + * @requires core + * These are functions that are part of the Processing API but are not part of + * the p5.js API. In some cases they have a new name, in others, they are + * removed completely. Not all unsupported Processing functions are listed here + * but we try to include ones that a user coming from Processing might likely + * call. + */ + + _main.default.prototype.pushStyle = function () { + throw new Error('pushStyle() not used, see push()'); + }; + _main.default.prototype.popStyle = function () { + throw new Error('popStyle() not used, see pop()'); + }; + _main.default.prototype.popMatrix = function () { + throw new Error('popMatrix() not used, see pop()'); + }; + _main.default.prototype.pushMatrix = function () { + throw new Error('pushMatrix() not used, see push()'); + }; + var _default = _main.default; + exports.default = _default; + }, + { + './main': 298 + } + ], + 298: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-own-property-names'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.object.get-own-property-names'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + _dereq_('./shim'); + var constants = _interopRequireWildcard(_dereq_('./constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Structure + * @submodule Structure + * @for p5 + * @requires constants + */ + // Core needs the PVariables object + /** + * This is the p5 instance constructor. + * + * A p5 instance holds all the properties and methods related to + * a p5 sketch. It expects an incoming sketch closure and it can also + * take an optional node parameter for attaching the generated p5 canvas + * to a node. The sketch closure takes the newly created p5 instance as + * its sole argument and may optionally set preload(), + * setup(), and/or + * draw() properties on it for running a sketch. + * + * A p5 sketch can run in "global" or "instance" mode: + * "global" - all properties and methods are attached to the window + * "instance" - all properties and methods are bound to this p5 object + * + * @class p5 + * @constructor + * @param {function(p5)} sketch a closure that can set optional preload(), + * setup(), and/or draw() properties on the + * given p5 instance + * @param {HTMLElement} [node] element to attach canvas to + * @return {p5} a p5 instance + */ + + var p5 = /*#__PURE__*/ function () { + function p5(sketch, node) { + var _this = this; + _classCallCheck(this, p5); + ////////////////////////////////////////////// + // PUBLIC p5 PROPERTIES AND METHODS + ////////////////////////////////////////////// + /** + * Called directly before setup(), the preload() function is used to handle + * asynchronous loading of external files in a blocking way. If a preload + * function is defined, setup() will wait until any load calls within have + * finished. Nothing besides load calls (loadImage, loadJSON, loadFont, + * loadStrings, etc.) should be inside the preload function. If asynchronous + * loading is preferred, the load methods can instead be called in setup() + * or anywhere else with the use of a callback parameter. + * + * By default the text "loading..." will be displayed. To make your own + * loading page, include an HTML element with id "p5_loading" in your + * page. More information here. + * + * @method preload + * @example + *
                              + * let img; + * let c; + * function preload() { + * // preload() runs once + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * // setup() waits until preload() is done + * img.loadPixels(); + * // get color of middle pixel + * c = img.get(img.width / 2, img.height / 2); + * } + * + * function draw() { + * background(c); + * image(img, 25, 25, 50, 50); + * } + *
                              + * + * @alt + * nothing displayed + * + */ + /** + * The setup() function is called once when the program starts. It's used to + * define initial environment properties such as screen size and background + * color and to load media such as images and fonts as the program starts. + * There can only be one setup() function for each program and it shouldn't + * be called again after its initial execution. + * + * Note: Variables declared within setup() are not accessible within other + * functions, including draw(). + * + * @method setup + * @example + *
                              + * let a = 0; + * + * function setup() { + * background(0); + * noStroke(); + * fill(102); + * } + * + * function draw() { + * rect(a++ % width, 10, 2, 80); + * } + *
                              + * + * @alt + * nothing displayed + * + */ + /** + * Called directly after setup(), the draw() function continuously executes + * the lines of code contained inside its block until the program is stopped + * or noLoop() is called. Note if noLoop() is called in setup(), draw() will + * still be executed once before stopping. draw() is called automatically and + * should never be called explicitly. + * + * It should always be controlled with noLoop(), redraw() and loop(). After + * noLoop() stops the code in draw() from executing, redraw() causes the + * code inside draw() to execute once, and loop() will cause the code + * inside draw() to resume executing continuously. + * + * The number of times draw() executes in each second may be controlled with + * the frameRate() function. + * + * There can only be one draw() function for each sketch, and draw() must + * exist if you want the code to run continuously, or to process events such + * as mousePressed(). Sometimes, you might have an empty call to draw() in + * your program, as shown in the above example. + * + * It is important to note that the drawing coordinate system will be reset + * at the beginning of each draw() call. If any transformations are performed + * within draw() (ex: scale, rotate, translate), their effects will be + * undone at the beginning of draw(), so transformations will not accumulate + * over time. On the other hand, styling applied (ex: fill, stroke, etc) will + * remain in effect. + * + * @method draw + * @example + *
                              + * let yPos = 0; + * function setup() { + * // setup() runs once + * frameRate(30); + * } + * function draw() { + * // draw() loops forever, until stopped + * background(204); + * yPos = yPos - 1; + * if (yPos < 0) { + * yPos = height; + * } + * line(0, yPos, width, yPos); + * } + *
                              + * + * @alt + * nothing displayed + * + */ + ////////////////////////////////////////////// + // PRIVATE p5 PROPERTIES AND METHODS + ////////////////////////////////////////////// + this._setupDone = false; + this._preloadDone = false; + // for handling hidpi + this._pixelDensity = Math.ceil(window.devicePixelRatio) || 1; + this._userNode = node; + this._curElement = null; + this._elements = [ + ]; + this._glAttributes = null; + this._requestAnimId = 0; + this._preloadCount = 0; + this._isGlobal = false; + this._loop = true; + this._startListener = null; + this._initializeInstanceVariables(); + this._defaultCanvasSize = { + width: 100, + height: 100 + }; + this._events = { + // keep track of user-events for unregistering later + mousemove: null, + mousedown: null, + mouseup: null, + dragend: null, + dragover: null, + click: null, + dblclick: null, + mouseover: null, + mouseout: null, + keydown: null, + keyup: null, + keypress: null, + touchstart: null, + touchmove: null, + touchend: null, + resize: null, + blur: null + }; + this._millisStart = - 1; + this._recording = false; + // States used in the custom random generators + this._lcg_random_state = null; + this._gaussian_previous = false; + this._events.wheel = null; + this._loadingScreenId = 'p5_loading'; + // Allows methods to be registered on an instance that + // are instance-specific. + this._registeredMethods = { + }; + var methods = Object.getOwnPropertyNames(p5.prototype._registeredMethods); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = methods[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var prop = _step.value; + this._registeredMethods[prop] = p5.prototype._registeredMethods[prop].slice(); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (window.DeviceOrientationEvent) { + this._events.deviceorientation = null; + } + if (window.DeviceMotionEvent && !window._isNodeWebkit) { + this._events.devicemotion = null; + } // Function to invoke registered hooks before or after events such as preload, setup, and pre/post draw. + + p5.prototype.callRegisteredHooksFor = function (hookName) { + var target = this || p5.prototype; + var context = this._isGlobal ? window : this; + if (target._registeredMethods.hasOwnProperty(hookName)) { + var _methods = target._registeredMethods[hookName]; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = _methods[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var method = _step2.value; + if (typeof method === 'function') { + method.call(context); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + }; + this._start = function () { + // Find node if id given + if (_this._userNode) { + if (typeof _this._userNode === 'string') { + _this._userNode = document.getElementById(_this._userNode); + } + } + var context = _this._isGlobal ? window : _this; + if (context.preload) { + _this.callRegisteredHooksFor('beforePreload'); + // Setup loading screen + // Set loading screen into dom if not present + // Otherwise displays and removes user provided loading screen + var loadingScreen = document.getElementById(_this._loadingScreenId); + if (!loadingScreen) { + loadingScreen = document.createElement('div'); + loadingScreen.innerHTML = 'Loading...'; + loadingScreen.style.position = 'absolute'; + loadingScreen.id = _this._loadingScreenId; + var _node = _this._userNode || document.body; + _node.appendChild(loadingScreen); + } + var _methods2 = _this._preloadMethods; + for (var method in _methods2) { + // default to p5 if no object defined + _methods2[method] = _methods2[method] || p5; + var obj = _methods2[method]; + //it's p5, check if it's global or instance + if (obj === p5.prototype || obj === p5) { + if (_this._isGlobal) { + window[method] = _this._wrapPreload(_this, method); + } + obj = _this; + } + _this._registeredPreloadMethods[method] = obj[method]; + obj[method] = _this._wrapPreload(obj, method); + } + context.preload(); + _this._runIfPreloadsAreDone(); + } else { + _this._setup(); + if (!_this._recording) { + _this._draw(); + } + } + }; + this._runIfPreloadsAreDone = function () { + var context = this._isGlobal ? window : this; + if (context._preloadCount === 0) { + var loadingScreen = document.getElementById(context._loadingScreenId); + if (loadingScreen) { + loadingScreen.parentNode.removeChild(loadingScreen); + } + this.callRegisteredHooksFor('afterPreload'); + if (!this._setupDone) { + this._lastTargetFrameTime = window.performance.now(); + this._lastRealFrameTime = window.performance.now(); + context._setup(); + if (!this._recording) { + context._draw(); + } + } + } + }; + this._decrementPreload = function () { + var context = this._isGlobal ? window : this; + if (!context._preloadDone && typeof context.preload === 'function') { + context._setProperty('_preloadCount', context._preloadCount - 1); + context._runIfPreloadsAreDone(); + } + }; + this._wrapPreload = function (obj, fnName) { + var _this2 = this; + return function () { + //increment counter + _this2._incrementPreload(); + //call original function + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return _this2._registeredPreloadMethods[fnName].apply(obj, args); + }; + }; + this._incrementPreload = function () { + var context = this._isGlobal ? window : this; + // Do nothing if we tried to increment preloads outside of `preload` + if (context._preloadDone) return; + context._setProperty('_preloadCount', context._preloadCount + 1); + }; + this._setup = function () { + _this.callRegisteredHooksFor('beforeSetup'); + // Always create a default canvas. + // Later on if the user calls createCanvas, this default one + // will be replaced + _this.createCanvas(_this._defaultCanvasSize.width, _this._defaultCanvasSize.height, 'p2d'); + // return preload functions to their normal vals if switched by preload + var context = _this._isGlobal ? window : _this; + if (typeof context.preload === 'function') { + for (var f in _this._preloadMethods) { + context[f] = _this._preloadMethods[f][f]; + if (context[f] && _this) { + context[f] = context[f].bind(_this); + } + } + } // Record the time when sketch starts + + _this._millisStart = window.performance.now(); + context._preloadDone = true; + // Short-circuit on this, in case someone used the library in "global" + // mode earlier + if (typeof context.setup === 'function') { + context.setup(); + } // unhide any hidden canvases that were created + + var canvases = document.getElementsByTagName('canvas'); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = canvases[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var k = _step3.value; + if (k.dataset.hidden === 'true') { + k.style.visibility = ''; + delete k.dataset.hidden; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + _this._lastTargetFrameTime = window.performance.now(); + _this._lastRealFrameTime = window.performance.now(); + _this._setupDone = true; + if (_this._accessibleOutputs.grid || _this._accessibleOutputs.text) { + _this._updateAccsOutput(); + } + _this.callRegisteredHooksFor('afterSetup'); + }; + this._draw = function () { + var now = window.performance.now(); + var time_since_last = now - _this._lastTargetFrameTime; + var target_time_between_frames = 1000 / _this._targetFrameRate; + // only draw if we really need to; don't overextend the browser. + // draw if we're within 5ms of when our next frame should paint + // (this will prevent us from giving up opportunities to draw + // again when it's really about time for us to do so). fixes an + // issue where the frameRate is too low if our refresh loop isn't + // in sync with the browser. note that we have to draw once even + // if looping is off, so we bypass the time delay if that + // is the case. + var epsilon = 5; + if (!_this._loop || time_since_last >= target_time_between_frames - epsilon) { + //mandatory update values(matrixes and stack) + _this.deltaTime = now - _this._lastRealFrameTime; + _this._setProperty('deltaTime', _this.deltaTime); + _this._frameRate = 1000 / _this.deltaTime; + _this.redraw(); + _this._lastTargetFrameTime = Math.max(_this._lastTargetFrameTime + target_time_between_frames, now); + _this._lastRealFrameTime = now; + // If the user is actually using mouse module, then update + // coordinates, otherwise skip. We can test this by simply + // checking if any of the mouse functions are available or not. + // NOTE : This reflects only in complete build or modular build. + if (typeof _this._updateMouseCoords !== 'undefined') { + _this._updateMouseCoords(); + //reset delta values so they reset even if there is no mouse event to set them + // for example if the mouse is outside the screen + _this._setProperty('movedX', 0); + _this._setProperty('movedY', 0); + } + } // get notified the next time the browser gives us + // an opportunity to draw. + + if (_this._loop) { + _this._requestAnimId = window.requestAnimationFrame(_this._draw); + } + }; + this._setProperty = function (prop, value) { + _this[prop] = value; + if (_this._isGlobal) { + window[prop] = value; + } + }; + /** + * Removes the entire p5 sketch. This will remove the canvas and any + * elements created by p5.js. It will also stop the draw loop and unbind + * any properties or methods from the window global scope. It will + * leave a variable p5 in case you wanted to create a new p5 sketch. + * If you like, you can set p5 = null to erase it. While all functions and + * variables and objects created by the p5 library will be removed, any + * other global variables created by your code will remain. + * + * @method remove + * @example + *
                              + * function draw() { + * ellipse(50, 50, 10, 10); + * } + * + * function mousePressed() { + * remove(); // remove whole sketch on mouse press + * } + *
                              + * + * @alt + * nothing displayed + * + */ + this.remove = function () { + // Remove start listener to prevent orphan canvas being created + if (_this._startListener) { + window.removeEventListener('load', _this._startListener, false); + } + var loadingScreen = document.getElementById(_this._loadingScreenId); + if (loadingScreen) { + loadingScreen.parentNode.removeChild(loadingScreen); + // Add 1 to preload counter to prevent the sketch ever executing setup() + _this._incrementPreload(); + } + if (_this._curElement) { + // stop draw + _this._loop = false; + if (_this._requestAnimId) { + window.cancelAnimationFrame(_this._requestAnimId); + } // unregister events sketch-wide + + for (var ev in _this._events) { + window.removeEventListener(ev, _this._events[ev]); + } // remove DOM elements created by p5, and listeners + + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for (var _iterator4 = _this._elements[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var e = _step4.value; + if (e.elt && e.elt.parentNode) { + e.elt.parentNode.removeChild(e.elt); + } + for (var elt_ev in e._events) { + e.elt.removeEventListener(elt_ev, e._events[elt_ev]); + } + } // call any registered remove functions + + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + var self = _this; + _this._registeredMethods.remove.forEach(function (f) { + if (typeof f !== 'undefined') { + f.call(self); + } + }); + } // remove window bound properties and methods + + if (_this._isGlobal) { + for (var p in p5.prototype) { + try { + delete window[p]; + } catch (x) { + window[p] = undefined; + } + } + for (var p2 in _this) { + if (_this.hasOwnProperty(p2)) { + try { + delete window[p2]; + } catch (x) { + window[p2] = undefined; + } + } + } + p5.instance = null; + } + }; + // call any registered init functions + this._registeredMethods.init.forEach(function (f) { + if (typeof f !== 'undefined') { + f.call(this); + } + }, this); + // Set up promise preloads + this._setupPromisePreloads(); + var friendlyBindGlobal = this._createFriendlyGlobalFunctionBinder(); + // If the user has created a global setup or draw function, + // assume "global" mode and make everything global (i.e. on the window) + if (!sketch) { + this._isGlobal = true; + p5.instance = this; + // Loop through methods on the prototype and attach them to the window + for (var p in p5.prototype) { + if (typeof p5.prototype[p] === 'function') { + var ev = p.substring(2); + if (!this._events.hasOwnProperty(ev)) { + if (Math.hasOwnProperty(p) && Math[p] === p5.prototype[p]) { + // Multiple p5 methods are just native Math functions. These can be + // called without any binding. + friendlyBindGlobal(p, p5.prototype[p]); + } else { + friendlyBindGlobal(p, p5.prototype[p].bind(this)); + } + } + } else { + friendlyBindGlobal(p, p5.prototype[p]); + } + } // Attach its properties to the window + + for (var p2 in this) { + if (this.hasOwnProperty(p2)) { + friendlyBindGlobal(p2, this[p2]); + } + } + } else { + // Else, the user has passed in a sketch closure that may set + // user-provided 'setup', 'draw', etc. properties on this instance of p5 + sketch(this); + // Run a check to see if the user has misspelled 'setup', 'draw', etc + // detects capitalization mistakes only ( Setup, SETUP, MouseClicked, etc) + p5._checkForUserDefinedFunctions(this); + } // Bind events to window (not using container div bc key events don't work) + + for (var e in this._events) { + var f = this['_on'.concat(e)]; + if (f) { + var m = f.bind(this); + window.addEventListener(e, m, { + passive: false + }); + this._events[e] = m; + } + } + var focusHandler = function focusHandler() { + _this._setProperty('focused', true); + }; + var blurHandler = function blurHandler() { + _this._setProperty('focused', false); + }; + window.addEventListener('focus', focusHandler); + window.addEventListener('blur', blurHandler); + this.registerMethod('remove', function () { + window.removeEventListener('focus', focusHandler); + window.removeEventListener('blur', blurHandler); + }); + if (document.readyState === 'complete') { + this._start(); + } else { + this._startListener = this._start.bind(this); + window.addEventListener('load', this._startListener, false); + } + } + _createClass(p5, [ + { + key: '_initializeInstanceVariables', + value: function _initializeInstanceVariables() { + this._accessibleOutputs = { + text: false, + grid: false, + textLabel: false, + gridLabel: false + }; + this._styles = [ + ]; + this._bezierDetail = 20; + this._curveDetail = 20; + this._colorMode = constants.RGB; + this._colorMaxes = { + rgb: [ + 255, + 255, + 255, + 255 + ], + hsb: [ + 360, + 100, + 100, + 1 + ], + hsl: [ + 360, + 100, + 100, + 1 + ] + }; + this._downKeys = { + }; //Holds the key codes of currently pressed keys + } + }, + { + key: 'registerPreloadMethod', + value: function registerPreloadMethod(fnString, obj) { + // obj = obj || p5.prototype; + if (!p5.prototype._preloadMethods.hasOwnProperty(fnString)) { + p5.prototype._preloadMethods[fnString] = obj; + } + } + }, + { + key: 'registerMethod', + value: function registerMethod(name, m) { + var target = this || p5.prototype; + if (!target._registeredMethods.hasOwnProperty(name)) { + target._registeredMethods[name] = [ + ]; + } + target._registeredMethods[name].push(m); + } + }, + { + key: 'unregisterMethod', + value: function unregisterMethod(name, m) { + var target = this || p5.prototype; + if (target._registeredMethods.hasOwnProperty(name)) { + var methods = target._registeredMethods[name]; + var indexesToRemove = [ + ]; + // Find all indexes of the method `m` in the array of registered methods + for (var i = 0; i < methods.length; i++) { + if (methods[i] === m) { + indexesToRemove.push(i); + } + } // Remove all instances of the method `m` from the array + + for (var _i = indexesToRemove.length - 1; _i >= 0; _i--) { + methods.splice(indexesToRemove[_i], 1); + } + } + } // create a function which provides a standardized process for binding + // globals; this is implemented as a factory primarily so that there's a + // way to redefine what "global" means for the binding function so it + // can be used in scenarios like unit testing where the window object + // might not exist + + }, + { + key: '_createFriendlyGlobalFunctionBinder', + value: function _createFriendlyGlobalFunctionBinder() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + var globalObject = options.globalObject || window; + var log = options.log || console.log.bind(console); + var propsToForciblyOverwrite = { + // p5.print actually always overwrites an existing global function, + // albeit one that is very unlikely to be used: + // + // https://developer.mozilla.org/en-US/docs/Web/API/Window/print + print: true + }; + return function (prop, value) { + if (!p5.disableFriendlyErrors && typeof IS_MINIFIED === 'undefined' && typeof value === 'function' && !(prop in p5.prototype._preloadMethods)) { + try { + // Because p5 has so many common function names, it's likely + // that users may accidentally overwrite global p5 functions with + // their own variables. Let's allow this but log a warning to + // help users who may be doing this unintentionally. + // + // For more information, see: + // + // https://github.com/processing/p5.js/issues/1317 + if (prop in globalObject && !(prop in propsToForciblyOverwrite)) { + throw new Error('global "'.concat(prop, '" already exists')); + } // It's possible that this might throw an error because there + // are a lot of edge-cases in which `Object.defineProperty` might + // not succeed; since this functionality is only intended to + // help beginners anyways, we'll just catch such an exception + // if it occurs, and fall back to legacy behavior. + + Object.defineProperty(globalObject, prop, { + configurable: true, + enumerable: true, + get: function get() { + return value; + }, + set: function set(newValue) { + Object.defineProperty(globalObject, prop, { + configurable: true, + enumerable: true, + value: newValue, + writable: true + }); + log('You just changed the value of "'.concat(prop, '", which was a p5 function. This could cause problems later if you\'re not careful.')); + } + }); + } catch (e) { + var message = 'p5 had problems creating the global function "'.concat(prop, '", possibly because your code is already using that name as a variable. You may want to rename your variable to something else.'); + p5._friendlyError(message, prop); + globalObject[prop] = value; + } + } else { + globalObject[prop] = value; + } + }; + } + } + ]); + return p5; + }(); // This is a pointer to our global mode p5 instance, if we're in + // global mode. + p5.instance = null; + /** + * Turn off some features of the friendly error system (FES), which can give + * a significant boost to performance when needed. + * + * Note that this will disable the parts of the FES that cause performance + * slowdown (like argument checking). Friendly errors that have no performance + * cost (like giving a descriptive error if a file load fails, or warning you + * if you try to override p5.js functions in the global space), + * will remain in place. + * + * See + * disabling the friendly error system. + * + * @property {Boolean} disableFriendlyErrors + * @example + *
                              + * p5.disableFriendlyErrors = true; + * + * function setup() { + * createCanvas(100, 50); + * } + *
                              + */ + p5.disableFriendlyErrors = false; + // attach constants to p5 prototype + for (var k in constants) { + p5.prototype[k] = constants[k]; + } // makes the `VERSION` constant available on the p5 object + // in instance mode, even if it hasn't been instantiated yet + + p5.VERSION = constants.VERSION; + // functions that cause preload to wait + // more can be added by using registerPreloadMethod(func) + p5.prototype._preloadMethods = { + loadJSON: p5.prototype, + loadImage: p5.prototype, + loadStrings: p5.prototype, + loadXML: p5.prototype, + loadBytes: p5.prototype, + loadTable: p5.prototype, + loadFont: p5.prototype, + loadModel: p5.prototype, + loadShader: p5.prototype + }; + p5.prototype._registeredMethods = { + init: [ + ], + pre: [ + ], + post: [ + ], + remove: [ + ] + }; + p5.prototype._registeredPreloadMethods = { + }; + var _default = p5; + exports.default = _default; + }, + { + './constants': 286, + './shim': 309, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-own-property-names': 197, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 299: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module DOM + * @submodule DOM + * @for p5.Element + */ + /** + * A class to describe an + * HTML element. + * Sketches can use many elements. Common elements include the drawing canvas, + * buttons, sliders, webcam feeds, and so on. + * + * All elements share the methods of the `p5.Element` class. They're created + * with functions such as createCanvas() and + * createButton(). + * + * @class p5.Element + * @constructor + * @param {HTMLElement} elt wrapped DOM element. + * @param {p5} [pInst] pointer to p5 instance. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * + * background(200); + * + * // Create a button element and + * // place it beneath the canvas. + * let btn = createButton('change'); + * btn.position(0, 100); + * + * // Call randomColor() when + * // the button is pressed. + * btn.mousePressed(randomColor); + * + * describe('A gray square with a button that says "change" beneath it. The square changes color when the user presses the button.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + */ + + _main.default.Element = /*#__PURE__*/ function () { + function _class(elt, pInst) { + _classCallCheck(this, _class); + /** + * Underlying + * HTMLElement + * object. Its properties and methods can be used directly. + * + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Set the border style for the + * // canvas. + * cnv.elt.style.border = '5px dashed deeppink'; + * + * describe('A gray square with a pink border drawn with dashed lines.'); + * } + * + *
                              + * + * @property elt + * @name elt + * @readOnly + */ + this.elt = elt; + /** + * @private + * @type {p5.Element} + * @name _pInst + */ + this._pInst = this._pixelsState = pInst; + this._events = { + }; + /** + * @type {Number} + * @property width + * @name width + */ + this.width = this.elt.offsetWidth; + /** + * @type {Number} + * @property height + * @name height + */ + this.height = this.elt.offsetHeight; + } /** + * Attaches this element to a parent element. + * + * For example, a `<div></div>` element may be used as a box to + * hold two pieces of text, a header and a paragraph. The + * `<div></div>` is the parent element of both the header and + * paragraph. + * + * The parameter `parent` can have one of three types. `parent` can be a + * string with the parent element's ID, as in + * `myElement.parent('container')`. It can also be another + * p5.Element object, as in + * `myElement.parent(myDiv)`. Finally, `parent` can be an `HTMLElement` + * object, as in `myElement.parent(anotherElement)`. + * + * Calling `myElement.parent()` without an argument returns this element's + * parent. + * + * @method parent + * @param {String|p5.Element|Object} parent ID, p5.Element, + * or HTMLElement of desired parent element. + * @chainable + * + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color to white + * div.style('background-color', 'white'); + * // Align any text to the center. + * div.style('text-align', 'center'); + * // Set its ID to "container". + * div.id('container'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent + * // using its ID "container". + * p.parent('container'); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create rectangular div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color and align + * // any text to the center. + * div.style('background-color', 'white'); + * div.style('text-align', 'center'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent. + * p.parent(div); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create rectangular div element. + * let div = createDiv(); + * // Place the div in the top-left corner. + * div.position(10, 20); + * // Set its width and height. + * div.size(80, 60); + * // Set its background color and align + * // any text to the center. + * div.style('background-color', 'white'); + * div.style('text-align', 'center'); + * + * // Create a paragraph element. + * let p = createP('p5*js'); + * // Make the div its parent + * // using the underlying + * // HTMLElement. + * p.parent(div.elt); + * + * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); + * } + * + *
                              + */ + /** + * @method parent + * @return {p5.Element} + */ + + _createClass(_class, [ + { + key: 'parent', + value: function parent(p) { + if (typeof p === 'undefined') { + return this.elt.parentNode; + } + if (typeof p === 'string') { + if (p[0] === '#') { + p = p.substring(1); + } + p = document.getElementById(p); + } else if (p instanceof _main.default.Element) { + p = p.elt; + } + p.appendChild(this.elt); + return this; + } /** + * Sets this element's ID using a given string. + * + * Calling `myElement.id()` without an argument returns its ID as a string. + * + * @method id + * @param {String} id ID of the element. + * @chainable + * + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Set the canvas' ID + * // to "mycanvas". + * cnv.id('mycanvas'); + * + * // Get the canvas' ID. + * let id = cnv.id(); + * text(id, 24, 54); + * + * describe('The text "mycanvas" written in black on a gray background.'); + * } + * + *
                              + */ + /** + * @method id + * @return {String} ID of the element. + */ + + }, + { + key: 'id', + value: function id(_id) { + if (typeof _id === 'undefined') { + return this.elt.id; + } + this.elt.id = _id; + this.width = this.elt.offsetWidth; + this.height = this.elt.offsetHeight; + return this; + } /** + * Adds a + * class attribute + * to the element. + * + * Calling `myElement.class()` without an argument returns a string with its current classes. + * + * @method class + * @param {String} class class to add. + * @chainable + * + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Add the class "small" to the + * // canvas element. + * cnv.class('small'); + * + * // Get the canvas element's class + * // and display it. + * let c = cnv.class(); + * text(c, 35, 54); + * + * describe('The word "small" written in black on a gray canvas.'); + * + * } + * + *
                              + */ + /** + * @method class + * @return {String} element's classes, if any. + */ + + }, + { + key: 'class', + value: function _class(c) { + if (typeof c === 'undefined') { + return this.elt.className; + } + this.elt.className = c; + return this; + } /** + * Calls a function when the mouse is pressed over the element. + * Calling `myElement.mousePressed(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. + * + * @method mousePressed + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the canvas + * // is pressed. + * cnv.mousePressed(randomColor); + * + * describe('A gray square changes color when the mouse is pressed.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the canvas is pressed. + * cnv.mousePressed(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse is pressed.'); + * } + * + *
                              + */ + + }, + { + key: 'mousePressed', + value: function mousePressed(fxn) { + // Prepend the mouse property setters to the event-listener. + // This is required so that mouseButton is set correctly prior to calling the callback (fxn). + // For details, see https://github.com/processing/p5.js/issues/3087. + var eventPrependedFxn = function eventPrependedFxn(event) { + this._pInst._setProperty('mouseIsPressed', true); + this._pInst._setMouseButton(event); + // Pass along the return-value of the callback: + return fxn.call(this, event); + }; + // Pass along the event-prepended form of the callback. + _main.default.Element._adjustListener('mousedown', eventPrependedFxn, this); + return this; + } /** + * Calls a function when the mouse is pressed twice over the element. + * Calling `myElement.doubleClicked(false)` disables the function. + * + * @method doubleClicked + * @param {Function|Boolean} fxn function to call when the mouse is + * double clicked over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // canvas is double-clicked. + * cnv.doubleClicked(randomColor); + * + * describe('A gray square changes color when the user double-clicks the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the canvas is double-clicked. + * cnv.doubleClicked(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user double-clicks the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'doubleClicked', + value: function doubleClicked(fxn) { + _main.default.Element._adjustListener('dblclick', fxn, this); + return this; + } /** + * Calls a function when the mouse wheel scrolls over th element. + * + * The callback function, `fxn`, is passed an `event` object. `event` has + * two numeric properties, `deltaY` and `deltaX`. `event.deltaY` is + * negative if the mouse wheel rotates away from the user. It's positive if + * the mouse wheel rotates toward the user. `event.deltaX` is positive if + * the mouse wheel moves to the right. It's negative if the mouse wheel moves + * to the left. + * + * Calling `myElement.mouseWheel(false)` disables the function. + * + * @method mouseWheel + * @param {Function|Boolean} fxn function to call when the mouse wheel is + * scrolled over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse wheel moves. + * cnv.mouseWheel(randomColor); + * + * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse wheel moves. + * cnv.mouseWheel(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call changeBackground() when the + * // mouse wheel moves. + * cnv.mouseWheel(changeBackground); + * + * describe('A gray square. When the mouse wheel scrolls over the square, it changes color and displays shapes.'); + * } + * + * function changeBackground(event) { + * // Change the background color + * // based on deltaY. + * if (event.deltaY > 0) { + * background('deeppink'); + * } else if (event.deltaY < 0) { + * background('cornflowerblue'); + * } else { + * background(200); + * } + * + * // Draw a shape based on deltaX. + * if (event.deltaX > 0) { + * circle(50, 50, 20); + * } else if (event.deltaX < 0) { + * square(40, 40, 20); + * } + * } + * + *
                              + */ + + }, + { + key: 'mouseWheel', + value: function mouseWheel(fxn) { + _main.default.Element._adjustListener('wheel', fxn, this); + return this; + } /** + * Calls a function when the mouse is released over the element. Calling + * `myElement.mouseReleased(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. + * + * @method mouseReleased + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when a + * // mouse press ends. + * cnv.mouseReleased(randomColor); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when a mouse press ends. + * cnv.mouseReleased(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + *
                              + */ + + }, + { + key: 'mouseReleased', + value: function mouseReleased(fxn) { + _main.default.Element._adjustListener('mouseup', fxn, this); + return this; + } /** + * Calls a function when the mouse is pressed and released over the element. + * Calling `myElement.mouseReleased(false)` disables the function. + * + * Note: Some mobile browsers may also trigger this event when the element + * receives a quick tap. + * + * @method mouseClicked + * @param {Function|Boolean} fxn function to call when the mouse is + * pressed and released over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when a + * // mouse press ends. + * cnv.mouseClicked(randomColor); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when a mouse press ends. + * cnv.mouseClicked(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user releases a mouse press.'); + * } + * + *
                              + */ + + }, + { + key: 'mouseClicked', + value: function mouseClicked(fxn) { + _main.default.Element._adjustListener('click', fxn, this); + return this; + } /** + * Calls a function when the mouse moves over the element. Calling + * `myElement.mouseMoved(false)` disables the function. + * + * @method mouseMoved + * @param {Function|Boolean} fxn function to call when the mouse + * moves over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse moves. + * cnv.mouseMoved(randomColor); + * + * describe('A gray square changes color when the mouse moves over the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves. + * cnv.mouseMoved(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves over the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'mouseMoved', + value: function mouseMoved(fxn) { + _main.default.Element._adjustListener('mousemove', fxn, this); + return this; + } /** + * Calls a function when the mouse moves onto the element. Calling + * `myElement.mouseOver(false)` disables the function. + * + * @method mouseOver + * @param {Function|Boolean} fxn function to call when the mouse + * moves onto the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse moves onto the canvas. + * cnv.mouseOver(randomColor); + * + * describe('A gray square changes color when the mouse moves onto the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves onto + * // the canvas. + * cnv.mouseOver(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves onto the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'mouseOver', + value: function mouseOver(fxn) { + _main.default.Element._adjustListener('mouseover', fxn, this); + return this; + } /** + * Calls a function when the mouse moves off the element. Calling + * `myElement.mouseOut(false)` disables the function. + * + * @method mouseOut + * @param {Function|Boolean} fxn function to call when the mouse + * moves off the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // mouse moves off the canvas. + * cnv.mouseOut(randomColor); + * + * describe('A gray square changes color when the mouse moves off the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the mouse moves off + * // the canvas. + * cnv.mouseOut(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the mouse moves off the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'mouseOut', + value: function mouseOut(fxn) { + _main.default.Element._adjustListener('mouseout', fxn, this); + return this; + } /** + * Calls a function when the element is touched. Calling + * `myElement.touchStarted(false)` disables the function. + * + * Note: Touch functions only work on mobile devices. + * + * @method touchStarted + * @param {Function|Boolean} fxn function to call when the touch + * starts. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas. + * cnv.touchStarted(randomColor); + * + * describe('A gray square changes color when the user touches the canvas.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas. + * cnv.touchStarted(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'touchStarted', + value: function touchStarted(fxn) { + _main.default.Element._adjustListener('touchstart', fxn, this); + return this; + } /** + * Calls a function when the user touches the element and moves their + * finger. Calling `myElement.touchMoved(false)` disables the + * function. + * + * Note: Touch functions only work on mobile devices. + * + * @method touchMoved + * @param {Function|Boolean} fxn function to call when the touch + * moves over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas + * // and moves. + * cnv.touchMoved(randomColor); + * + * describe('A gray square changes color when the user touches the canvas and moves.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas and moves. + * cnv.touchMoved(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas and moves.'); + * } + * + *
                              + */ + + }, + { + key: 'touchMoved', + value: function touchMoved(fxn) { + _main.default.Element._adjustListener('touchmove', fxn, this); + return this; + } /** + * Calls a function when the user stops touching the element. Calling + * `myElement.touchMoved(false)` disables the function. + * + * Note: Touch functions only work on mobile devices. + * + * @method touchEnded + * @param {Function|Boolean} fxn function to call when the touch + * ends. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call randomColor() when the + * // user touches the canvas, + * // then lifts their finger. + * cnv.touchEnded(randomColor); + * + * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); + * } + * + * // Paint the background either + * // red, yellow, blue, or green. + * function randomColor() { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Paint the background either + * // red, yellow, blue, or green + * // when the user touches the + * // canvas, then lifts their + * // finger. + * cnv.touchEnded(() => { + * let c = random(['red', 'yellow', 'blue', 'green']); + * background(c); + * }); + * + * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); + * } + * + *
                              + */ + + }, + { + key: 'touchEnded', + value: function touchEnded(fxn) { + _main.default.Element._adjustListener('touchend', fxn, this); + return this; + } /** + * Calls a function when a file is dragged over the element. Calling + * `myElement.dragOver(false)` disables the function. + * + * @method dragOver + * @param {Function|Boolean} fxn function to call when the file is + * dragged over the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * // Drag a file over the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call helloFile() when a + * // file is dragged over + * // the canvas. + * cnv.dragOver(helloFile); + * + * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); + * } + * + * function helloFile() { + * text('hello, file', 50, 50); + * } + * + *
                              + * + *
                              + * + * // Drag a file over the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Say "hello, file" when a + * // file is dragged over + * // the canvas. + * cnv.dragOver(() => { + * text('hello, file', 50, 50); + * }); + * + * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); + * } + * + *
                              + */ + + }, + { + key: 'dragOver', + value: function dragOver(fxn) { + _main.default.Element._adjustListener('dragover', fxn, this); + return this; + } /** + * Calls a function when a file is dragged off the element. Calling + * Calling `myElement.dragLeave(false)` disables the function. + * + * @method dragLeave + * @param {Function|Boolean} fxn function to call when the file is + * dragged off the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * // Drag a file over, then off + * // the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Call byeFile() when a + * // file is dragged over, + * // then off the canvas. + * cnv.dragLeave(byeFile); + * + * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); + * } + * + * function byeFile() { + * text('bye, file', 50, 50); + * } + * + *
                              + * + *
                              + * + * // Drag a file over, then off + * // the canvas to test. + * + * function setup() { + * // Create a canvas element and + * // assign it to cnv. + * let cnv = createCanvas(100, 100); + * + * background(200); + * + * // Say "bye, file" when a + * // file is dragged over, + * // then off the canvas. + * cnv.dragLeave(() => { + * text('bye, file', 50, 50); + * }); + * + * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); + * } + * + *
                              + */ + + }, + { + key: 'dragLeave', + value: function dragLeave(fxn) { + _main.default.Element._adjustListener('dragleave', fxn, this); + return this; + } /** + * + * @private + * @static + * @param {String} ev + * @param {Boolean|Function} fxn + * @param {Element} ctx + * @chainable + * @alt + * General handler for event attaching and detaching + */ + + }, + { + key: '_setProperty', + /** + * Helper fxn for sharing pixel methods + */ + value: function _setProperty(prop, value) { + this[prop] = value; + } + } + ], [ + { + key: '_adjustListener', + value: function _adjustListener(ev, fxn, ctx) { + if (fxn === false) { + _main.default.Element._detachListener(ev, ctx); + } else { + _main.default.Element._attachListener(ev, fxn, ctx); + } + return this; + } /** + * + * @private + * @static + * @param {String} ev + * @param {Function} fxn + * @param {Element} ctx + */ + + }, + { + key: '_attachListener', + value: function _attachListener(ev, fxn, ctx) { + // detach the old listener if there was one + if (ctx._events[ev]) { + _main.default.Element._detachListener(ev, ctx); + } + var f = fxn.bind(ctx); + ctx.elt.addEventListener(ev, f, false); + ctx._events[ev] = f; + } /** + * + * @private + * @static + * @param {String} ev + * @param {Element} ctx + */ + + }, + { + key: '_detachListener', + value: function _detachListener(ev, ctx) { + var f = ctx._events[ev]; + ctx.elt.removeEventListener(ev, f, false); + ctx._events[ev] = null; + } + } + ]); + return _class; + }(); + var _default = _main.default.Element; + exports.default = _default; + }, + { + './main': 298 + } + ], + 300: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + var constants = _interopRequireWildcard(_dereq_('./constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + /** + * Thin wrapper around a renderer, to be used for creating a + * graphics buffer object. Use this class if you need + * to draw into an off-screen graphics buffer. The two parameters define the + * width and height in pixels. The fields and methods for this class are + * extensive, but mirror the normal drawing API for p5. + * + * @class p5.Graphics + * @constructor + * @extends p5.Element + * @param {Number} w width + * @param {Number} h height + * @param {Constant} renderer the renderer to use, either P2D or WEBGL + * @param {p5} [pInst] pointer to p5 instance + * @param {HTMLCanvasElement} [canvas] existing html canvas element + */ + + _main.default.Graphics = /*#__PURE__*/ function (_p5$Element) { + _inherits(_class, _p5$Element); + var _super = _createSuper(_class); + function _class(w, h, renderer, pInst, canvas) { + var _this; + _classCallCheck(this, _class); + var canvasTemp; + if (canvas) { + canvasTemp = canvas; + } else { + canvasTemp = document.createElement('canvas'); + } + _this = _super.call(this, canvasTemp, pInst); + _this.canvas = canvasTemp; + var r = renderer || constants.P2D; + var node = pInst._userNode || document.body; + if (!canvas) { + node.appendChild(_this.canvas); + } // bind methods and props of p5 to the new object + + for (var p in _main.default.prototype) { + if (!_this[p]) { + if (typeof _main.default.prototype[p] === 'function') { + _this[p] = _main.default.prototype[p].bind(_assertThisInitialized(_this)); + } else { + _this[p] = _main.default.prototype[p]; + } + } + } + _main.default.prototype._initializeInstanceVariables.apply(_assertThisInitialized(_this)); + _this.width = w; + _this.height = h; + _this._pixelDensity = pInst._pixelDensity; + if (r === constants.WEBGL) { + _this._renderer = new _main.default.RendererGL(_this.canvas, _assertThisInitialized(_this), false); + } else { + _this._renderer = new _main.default.Renderer2D(_this.canvas, _assertThisInitialized(_this), false); + } + pInst._elements.push(_assertThisInitialized(_this)); + Object.defineProperty(_assertThisInitialized(_this), 'deltaTime', { + get: function get() { + return this._pInst.deltaTime; + } + }); + _this._renderer.resize(w, h); + _this._renderer._applyDefaults(); + return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); + } /** + * Resets certain values such as those modified by functions in the Transform category + * and in the Lights category that are not automatically reset + * with graphics buffer objects. Calling this in draw() will copy the behavior + * of the standard canvas. + * + * @method reset + * @example + * + *
                              + * let pg; + * function setup() { + * createCanvas(100, 100); + * background(0); + * pg = createGraphics(50, 100); + * pg.fill(0); + * frameRate(5); + * } + * + * function draw() { + * image(pg, width / 2, 0); + * pg.background(255); + * // p5.Graphics object behave a bit differently in some cases + * // The normal canvas on the left resets the translate + * // with every loop through draw() + * // the graphics object on the right doesn't automatically reset + * // so translate() is additive and it moves down the screen + * rect(0, 0, width / 2, 5); + * pg.rect(0, 0, width / 2, 5); + * translate(0, 5, 0); + * pg.translate(0, 5, 0); + * } + * function mouseClicked() { + * // if you click you will see that + * // reset() resets the translate back to the initial state + * // of the Graphics object + * pg.reset(); + * } + *
                              + * + * @alt + * A white line on a black background stays still on the top-left half. + * A black line animates from top to bottom on a white background on the right half. + * When clicked, the black line starts back over at the top. + */ + + _createClass(_class, [ + { + key: 'reset', + value: function reset() { + this._renderer.resetMatrix(); + if (this._renderer.isP3D) { + this._renderer._update(); + } + } /** + * Removes a Graphics object from the page and frees any resources + * associated with it. + * + * @method remove + * + * @example + *
                              + * let bg; + * function setup() { + * bg = createCanvas(100, 100); + * bg.background(0); + * image(bg, 0, 0); + * bg.remove(); + * } + *
                              + * + *
                              + * let bg; + * function setup() { + * pixelDensity(1); + * createCanvas(100, 100); + * stroke(255); + * fill(0); + * + * // create and draw the background image + * bg = createGraphics(100, 100); + * bg.background(200); + * bg.ellipse(50, 50, 80, 80); + * } + * function draw() { + * let t = millis() / 1000; + * // draw the background + * if (bg) { + * image(bg, frameCount % 100, 0); + * image(bg, frameCount % 100 - 100, 0); + * } + * // draw the foreground + * let p = p5.Vector.fromAngle(t, 35).add(50, 50); + * ellipse(p.x, p.y, 30); + * } + * function mouseClicked() { + * // remove the background + * if (bg) { + * bg.remove(); + * bg = null; + * } + * } + *
                              + * + * @alt + * no image + * a multi-colored circle moving back and forth over a scrolling background. + */ + + }, + { + key: 'remove', + value: function remove() { + if (this.elt.parentNode) { + this.elt.parentNode.removeChild(this.elt); + } + var idx = this._pInst._elements.indexOf(this); + if (idx !== - 1) { + this._pInst._elements.splice(idx, 1); + } + for (var elt_ev in this._events) { + this.elt.removeEventListener(elt_ev, this._events[elt_ev]); + } + } /** + * Creates and returns a new p5.Framebuffer + * inside a p5.Graphics WebGL context. + * + * This takes the same parameters as the global + * createFramebuffer function. + * + * @method createFramebuffer + */ + + }, + { + key: 'createFramebuffer', + value: function createFramebuffer(options) { + return new _main.default.Framebuffer(this, options); + } + } + ]); + return _class; + }(_main.default.Element); + var _default = _main.default.Graphics; + exports.default = _default; + }, + { + './constants': 286, + './main': 298, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 301: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + /** + * Main graphics and rendering context, as well as the base API + * implementation for p5.js "core". To be used as the superclass for + * Renderer2D and Renderer3D classes, respectively. + * + * @class p5.Renderer + * @constructor + * @extends p5.Element + * @param {HTMLElement} elt DOM node that is wrapped + * @param {p5} [pInst] pointer to p5 instance + * @param {Boolean} [isMainCanvas] whether we're using it as main canvas + */ + + var Renderer = /*#__PURE__*/ function (_p5$Element) { + _inherits(Renderer, _p5$Element); + var _super = _createSuper(Renderer); + function Renderer(elt, pInst, isMainCanvas) { + var _this; + _classCallCheck(this, Renderer); + _this = _super.call(this, elt, pInst); + _this.canvas = elt; + _this._pixelsState = pInst; + if (isMainCanvas) { + _this._isMainCanvas = true; + // for pixel method sharing with pimage + _this._pInst._setProperty('_curElement', _assertThisInitialized(_this)); + _this._pInst._setProperty('canvas', _this.canvas); + _this._pInst._setProperty('width', _this.width); + _this._pInst._setProperty('height', _this.height); + } else { + // hide if offscreen buffer by default + _this.canvas.style.display = 'none'; + _this._styles = [ + ]; // non-main elt styles stored in p5.Renderer + } + _this._clipping = false; + _this._clipInvert = false; + _this._textSize = 12; + _this._textLeading = 15; + _this._textFont = 'sans-serif'; + _this._textStyle = constants.NORMAL; + _this._textAscent = null; + _this._textDescent = null; + _this._textAlign = constants.LEFT; + _this._textBaseline = constants.BASELINE; + _this._textWrap = constants.WORD; + _this._rectMode = constants.CORNER; + _this._ellipseMode = constants.CENTER; + _this._curveTightness = 0; + _this._imageMode = constants.CORNER; + _this._tint = null; + _this._doStroke = true; + _this._doFill = true; + _this._strokeSet = false; + _this._fillSet = false; + _this._leadingSet = false; + _this._pushPopDepth = 0; + return _this; + } // the renderer should return a 'style' object that it wishes to + // store on the push stack. + + _createClass(Renderer, [ + { + key: 'push', + value: function push() { + this._pushPopDepth++; + return { + properties: { + _doStroke: this._doStroke, + _strokeSet: this._strokeSet, + _doFill: this._doFill, + _fillSet: this._fillSet, + _tint: this._tint, + _imageMode: this._imageMode, + _rectMode: this._rectMode, + _ellipseMode: this._ellipseMode, + _textFont: this._textFont, + _textLeading: this._textLeading, + _leadingSet: this._leadingSet, + _textSize: this._textSize, + _textAlign: this._textAlign, + _textBaseline: this._textBaseline, + _textStyle: this._textStyle, + _textWrap: this._textWrap + } + }; + } // a pop() operation is in progress + // the renderer is passed the 'style' object that it returned + // from its push() method. + + }, + { + key: 'pop', + value: function pop(style) { + this._pushPopDepth--; + if (style.properties) { + // copy the style properties back into the renderer + Object.assign(this, style.properties); + } + } + }, + { + key: 'beginClip', + value: function beginClip() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + if (this._clipping) { + throw new Error('It looks like you\'re trying to clip while already in the middle of clipping. Did you forget to endClip()?'); + } + this._clipping = true; + this._clipInvert = options.invert; + } + }, + { + key: 'endClip', + value: function endClip() { + if (!this._clipping) { + throw new Error('It looks like you\'ve called endClip() without beginClip(). Did you forget to call beginClip() first?'); + } + this._clipping = false; + } /** + * Resize our canvas element. + */ + + }, + { + key: 'resize', + value: function resize(w, h) { + this.width = w; + this.height = h; + this.elt.width = w * this._pInst._pixelDensity; + this.elt.height = h * this._pInst._pixelDensity; + this.elt.style.width = ''.concat(w, 'px'); + this.elt.style.height = ''.concat(h, 'px'); + if (this._isMainCanvas) { + this._pInst._setProperty('width', this.width); + this._pInst._setProperty('height', this.height); + } + } + }, + { + key: 'get', + value: function get(x, y, w, h) { + var pixelsState = this._pixelsState; + var pd = pixelsState._pixelDensity; + var canvas = this.canvas; + if (typeof x === 'undefined' && typeof y === 'undefined') { + // get() + x = y = 0; + w = pixelsState.width; + h = pixelsState.height; + } else { + x *= pd; + y *= pd; + if (typeof w === 'undefined' && typeof h === 'undefined') { + // get(x,y) + if (x < 0 || y < 0 || x >= canvas.width || y >= canvas.height) { + return [0, + 0, + 0, + 0]; + } + return this._getPixel(x, y); + } // get(x,y,w,h) + + } + var region = new _main.default.Image(w * pd, h * pd); + region.pixelDensity(pd); + region.canvas.getContext('2d').drawImage(canvas, x, y, w * pd, h * pd, 0, 0, w * pd, h * pd); + return region; + } + }, + { + key: 'textLeading', + value: function textLeading(l) { + if (typeof l === 'number') { + this._setProperty('_leadingSet', true); + this._setProperty('_textLeading', l); + return this._pInst; + } + return this._textLeading; + } + }, + { + key: 'textStyle', + value: function textStyle(s) { + if (s) { + if (s === constants.NORMAL || s === constants.ITALIC || s === constants.BOLD || s === constants.BOLDITALIC) { + this._setProperty('_textStyle', s); + } + return this._applyTextProperties(); + } + return this._textStyle; + } + }, + { + key: 'textAscent', + value: function textAscent() { + if (this._textAscent === null) { + this._updateTextMetrics(); + } + return this._textAscent; + } + }, + { + key: 'textDescent', + value: function textDescent() { + if (this._textDescent === null) { + this._updateTextMetrics(); + } + return this._textDescent; + } + }, + { + key: 'textAlign', + value: function textAlign(h, v) { + if (typeof h !== 'undefined') { + this._setProperty('_textAlign', h); + if (typeof v !== 'undefined') { + this._setProperty('_textBaseline', v); + } + return this._applyTextProperties(); + } else { + return { + horizontal: this._textAlign, + vertical: this._textBaseline + }; + } + } + }, + { + key: 'textWrap', + value: function textWrap(wrapStyle) { + this._setProperty('_textWrap', wrapStyle); + return this._textWrap; + } + }, + { + key: 'text', + value: function text(str, x, y, maxWidth, maxHeight) { + var p = this._pInst; + var textWrapStyle = this._textWrap; + var lines; + var line; + var testLine; + var testWidth; + var words; + var chars; + var shiftedY; + var finalMaxHeight = Number.MAX_VALUE; + // fix for #5785 (top of bounding box) + var finalMinHeight = y; + if (!(this._doFill || this._doStroke)) { + return; + } + if (typeof str === 'undefined') { + return; + } else if (typeof str !== 'string') { + str = str.toString(); + } // Replaces tabs with double-spaces and splits string on any line + // breaks present in the original string + + str = str.replace(/(\t)/g, ' '); + lines = str.split('\n'); + if (typeof maxWidth !== 'undefined') { + if (this._rectMode === constants.CENTER) { + x -= maxWidth / 2; + } + switch (this._textAlign) { + case constants.CENTER: + x += maxWidth / 2; + break; + case constants.RIGHT: + x += maxWidth; + break; + } + if (typeof maxHeight !== 'undefined') { + if (this._rectMode === constants.CENTER) { + y -= maxHeight / 2; + finalMinHeight -= maxHeight / 2; + } + var originalY = y; + var ascent = p.textAscent(); + switch (this._textBaseline) { + case constants.BOTTOM: + shiftedY = y + maxHeight; + y = Math.max(shiftedY, y); + // fix for #5785 (top of bounding box) + finalMinHeight += ascent; + break; + case constants.CENTER: + shiftedY = y + maxHeight / 2; + y = Math.max(shiftedY, y); + // fix for #5785 (top of bounding box) + finalMinHeight += ascent / 2; + break; + } // remember the max-allowed y-position for any line (fix to #928) + + finalMaxHeight = y + maxHeight - ascent; + // fix for #5785 (bottom of bounding box) + if (this._textBaseline === constants.CENTER) { + finalMaxHeight = originalY + maxHeight - ascent / 2; + } + } else { + // no text-height specified, show warning for BOTTOM / CENTER + if (this._textBaseline === constants.BOTTOM || this._textBaseline === constants.CENTER) { + // use rectHeight as an approximation for text height + var rectHeight = p.textSize() * this._textLeading; + finalMinHeight = y - rectHeight / 2; + finalMaxHeight = y + rectHeight / 2; + } + } // Render lines of text according to settings of textWrap + // Splits lines at spaces, for loop adds one word + space + // at a time and tests length with next word added + + if (textWrapStyle === constants.WORD) { + var nlines = [ + ]; + for (var lineIndex = 0; lineIndex < lines.length; lineIndex++) { + line = ''; + words = lines[lineIndex].split(' '); + for (var wordIndex = 0; wordIndex < words.length; wordIndex++) { + testLine = ''.concat(line + words[wordIndex]) + ' '; + testWidth = this.textWidth(testLine); + if (testWidth > maxWidth && line.length > 0) { + nlines.push(line); + line = ''.concat(words[wordIndex]) + ' '; + } else { + line = testLine; + } + } + nlines.push(line); + } + var offset = 0; + if (this._textBaseline === constants.CENTER) { + offset = (nlines.length - 1) * p.textLeading() / 2; + } else if (this._textBaseline === constants.BOTTOM) { + offset = (nlines.length - 1) * p.textLeading(); + } + for (var _lineIndex = 0; _lineIndex < lines.length; _lineIndex++) { + line = ''; + words = lines[_lineIndex].split(' '); + for (var _wordIndex = 0; _wordIndex < words.length; _wordIndex++) { + testLine = ''.concat(line + words[_wordIndex]) + ' '; + testWidth = this.textWidth(testLine); + if (testWidth > maxWidth && line.length > 0) { + this._renderText(p, line.trim(), x, y - offset, finalMaxHeight, finalMinHeight); + line = ''.concat(words[_wordIndex]) + ' '; + y += p.textLeading(); + } else { + line = testLine; + } + } + this._renderText(p, line.trim(), x, y - offset, finalMaxHeight, finalMinHeight); + y += p.textLeading(); + } + } else { + var _nlines = [ + ]; + for (var _lineIndex2 = 0; _lineIndex2 < lines.length; _lineIndex2++) { + line = ''; + chars = lines[_lineIndex2].split(''); + for (var charIndex = 0; charIndex < chars.length; charIndex++) { + testLine = ''.concat(line + chars[charIndex]); + testWidth = this.textWidth(testLine); + if (testWidth <= maxWidth) { + line += chars[charIndex]; + } else if (testWidth > maxWidth && line.length > 0) { + _nlines.push(line); + line = ''.concat(chars[charIndex]); + } + } + } + _nlines.push(line); + var _offset = 0; + if (this._textBaseline === constants.CENTER) { + _offset = (_nlines.length - 1) * p.textLeading() / 2; + } else if (this._textBaseline === constants.BOTTOM) { + _offset = (_nlines.length - 1) * p.textLeading(); + } // Splits lines at characters, for loop adds one char at a time + // and tests length with next char added + + for (var _lineIndex3 = 0; _lineIndex3 < lines.length; _lineIndex3++) { + line = ''; + chars = lines[_lineIndex3].split(''); + for (var _charIndex = 0; _charIndex < chars.length; _charIndex++) { + testLine = ''.concat(line + chars[_charIndex]); + testWidth = this.textWidth(testLine); + if (testWidth <= maxWidth) { + line += chars[_charIndex]; + } else if (testWidth > maxWidth && line.length > 0) { + this._renderText(p, line.trim(), x, y - _offset, finalMaxHeight, finalMinHeight); + y += p.textLeading(); + line = ''.concat(chars[_charIndex]); + } + } + } + this._renderText(p, line.trim(), x, y - _offset, finalMaxHeight, finalMinHeight); + y += p.textLeading(); + } + } else { + // Offset to account for vertically centering multiple lines of text - no + // need to adjust anything for vertical align top or baseline + var _offset2 = 0; + if (this._textBaseline === constants.CENTER) { + _offset2 = (lines.length - 1) * p.textLeading() / 2; + } else if (this._textBaseline === constants.BOTTOM) { + _offset2 = (lines.length - 1) * p.textLeading(); + } // Renders lines of text at any line breaks present in the original string + + for (var i = 0; i < lines.length; i++) { + this._renderText(p, lines[i], x, y - _offset2, finalMaxHeight, finalMinHeight - _offset2); + y += p.textLeading(); + } + } + return p; + } + }, + { + key: '_applyDefaults', + value: function _applyDefaults() { + return this; + } /** + * Helper function to check font type (system or otf) + */ + + }, + { + key: '_isOpenType', + value: function _isOpenType() { + var f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._textFont; + return _typeof(f) === 'object' && f.font && f.font.supported; + } + }, + { + key: '_updateTextMetrics', + value: function _updateTextMetrics() { + if (this._isOpenType()) { + this._setProperty('_textAscent', this._textFont._textAscent()); + this._setProperty('_textDescent', this._textFont._textDescent()); + return this; + } // Adapted from http://stackoverflow.com/a/25355178 + + var text = document.createElement('span'); + text.style.fontFamily = this._textFont; + text.style.fontSize = ''.concat(this._textSize, 'px'); + text.innerHTML = 'ABCjgq|'; + var block = document.createElement('div'); + block.style.display = 'inline-block'; + block.style.width = '1px'; + block.style.height = '0px'; + var container = document.createElement('div'); + container.appendChild(text); + container.appendChild(block); + container.style.height = '0px'; + container.style.overflow = 'hidden'; + document.body.appendChild(container); + block.style.verticalAlign = 'baseline'; + var blockOffset = calculateOffset(block); + var textOffset = calculateOffset(text); + var ascent = blockOffset[1] - textOffset[1]; + block.style.verticalAlign = 'bottom'; + blockOffset = calculateOffset(block); + textOffset = calculateOffset(text); + var height = blockOffset[1] - textOffset[1]; + var descent = height - ascent; + document.body.removeChild(container); + this._setProperty('_textAscent', ascent); + this._setProperty('_textDescent', descent); + return this; + } + } + ]); + return Renderer; + }(_main.default.Element); + /** + * Helper fxn to measure ascent and descent. + * Adapted from http://stackoverflow.com/a/25355178 + */ + function calculateOffset(object) { + var currentLeft = 0, + currentTop = 0; + if (object.offsetParent) { + do { + currentLeft += object.offsetLeft; + currentTop += object.offsetTop; + } while (object = object.offsetParent); + } else { + currentLeft += object.offsetLeft; + currentTop += object.offsetTop; + } + return [currentLeft, + currentTop]; + } // This caused the test to failed. + + Renderer.prototype.textSize = function (s) { + if (typeof s === 'number') { + this._setProperty('_textSize', s); + if (!this._leadingSet) { + // only use a default value if not previously set (#5181) + this._setProperty('_textLeading', s * constants._DEFAULT_LEADMULT); + } + return this._applyTextProperties(); + } + return this._textSize; + }; + _main.default.Renderer = Renderer; + var _default = _main.default.Renderer; + exports.default = _default; + }, + { + '../core/constants': 286, + './main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.number.constructor': 191, + 'core-js/modules/es.object.assign': 194, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.trim': 219, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 302: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.reflect.get'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + var constants = _interopRequireWildcard(_dereq_('./constants')); + _dereq_('./p5.Renderer'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _get(target, property, receiver) { + if (typeof Reflect !== 'undefined' && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return _get(target, property, receiver || target); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + return object; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * p5.Renderer2D + * The 2D graphics canvas renderer class. + * extends p5.Renderer + */ + + var styleEmpty = 'rgba(0,0,0,0)'; + // const alphaThreshold = 0.00125; // minimum visible + var Renderer2D = /*#__PURE__*/ function (_p5$Renderer) { + _inherits(Renderer2D, _p5$Renderer); + var _super = _createSuper(Renderer2D); + function Renderer2D(elt, pInst, isMainCanvas) { + var _this; + _classCallCheck(this, Renderer2D); + _this = _super.call(this, elt, pInst, isMainCanvas); + _this.drawingContext = _this.canvas.getContext('2d'); + _this._pInst._setProperty('drawingContext', _this.drawingContext); + return _this; + } + _createClass(Renderer2D, [ + { + key: 'getFilterGraphicsLayer', + value: function getFilterGraphicsLayer() { + // create hidden webgl renderer if it doesn't exist + if (!this.filterGraphicsLayer) { + // the real _pInst is buried when this is a secondary p5.Graphics + var pInst = this._pInst instanceof _main.default.Graphics ? this._pInst._pInst : this._pInst; + // create secondary layer + this.filterGraphicsLayer = new _main.default.Graphics(this.width, this.height, constants.WEBGL, pInst); + } + if (this.filterGraphicsLayer.width !== this.width || this.filterGraphicsLayer.height !== this.height) { + // Resize the graphics layer + this.filterGraphicsLayer.resizeCanvas(this.width, this.height); + } + if (this.filterGraphicsLayer.pixelDensity() !== this._pInst.pixelDensity()) { + this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()); + } + return this.filterGraphicsLayer; + } + }, + { + key: '_applyDefaults', + value: function _applyDefaults() { + this._cachedFillStyle = this._cachedStrokeStyle = undefined; + this._cachedBlendMode = constants.BLEND; + this._setFill(constants._DEFAULT_FILL); + this._setStroke(constants._DEFAULT_STROKE); + this.drawingContext.lineCap = constants.ROUND; + this.drawingContext.font = 'normal 12px sans-serif'; + } + }, + { + key: 'resize', + value: function resize(w, h) { + _get(_getPrototypeOf(Renderer2D.prototype), 'resize', this).call(this, w, h); + this.drawingContext.scale(this._pInst._pixelDensity, this._pInst._pixelDensity); + } ////////////////////////////////////////////// + // COLOR | Setting + ////////////////////////////////////////////// + + }, + { + key: 'background', + value: function background() { + this.drawingContext.save(); + this.resetMatrix(); + if ((arguments.length <= 0 ? undefined : arguments[0]) instanceof _main.default.Image) { + if ((arguments.length <= 1 ? undefined : arguments[1]) >= 0) { + // set transparency of background + var img = arguments.length <= 0 ? undefined : arguments[0]; + this.drawingContext.globalAlpha = (arguments.length <= 1 ? undefined : arguments[1]) / 255; + this._pInst.image(img, 0, 0, this.width, this.height); + } else { + this._pInst.image(arguments.length <= 0 ? undefined : arguments[0], 0, 0, this.width, this.height); + } + } else { + var _this$_pInst; + var curFill = this._getFill(); + // create background rect + var color = (_this$_pInst = this._pInst).color.apply(_this$_pInst, arguments); + //accessible Outputs + if (this._pInst._addAccsOutput()) { + this._pInst._accsBackground(color.levels); + } + var newFill = color.toString(); + this._setFill(newFill); + if (this._isErasing) { + this.blendMode(this._cachedBlendMode); + } + this.drawingContext.fillRect(0, 0, this.width, this.height); + // reset fill + this._setFill(curFill); + if (this._isErasing) { + this._pInst.erase(); + } + } + this.drawingContext.restore(); + } + }, + { + key: 'clear', + value: function clear() { + this.drawingContext.save(); + this.resetMatrix(); + this.drawingContext.clearRect(0, 0, this.width, this.height); + this.drawingContext.restore(); + } + }, + { + key: 'fill', + value: function fill() { + var _this$_pInst2; + var color = (_this$_pInst2 = this._pInst).color.apply(_this$_pInst2, arguments); + this._setFill(color.toString()); + //accessible Outputs + if (this._pInst._addAccsOutput()) { + this._pInst._accsCanvasColors('fill', color.levels); + } + } + }, + { + key: 'stroke', + value: function stroke() { + var _this$_pInst3; + var color = (_this$_pInst3 = this._pInst).color.apply(_this$_pInst3, arguments); + this._setStroke(color.toString()); + //accessible Outputs + if (this._pInst._addAccsOutput()) { + this._pInst._accsCanvasColors('stroke', color.levels); + } + } + }, + { + key: 'erase', + value: function erase(opacityFill, opacityStroke) { + if (!this._isErasing) { + // cache the fill style + this._cachedFillStyle = this.drawingContext.fillStyle; + var newFill = this._pInst.color(255, opacityFill).toString(); + this.drawingContext.fillStyle = newFill; + // cache the stroke style + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + var newStroke = this._pInst.color(255, opacityStroke).toString(); + this.drawingContext.strokeStyle = newStroke; + // cache blendMode + var tempBlendMode = this._cachedBlendMode; + this.blendMode(constants.REMOVE); + this._cachedBlendMode = tempBlendMode; + this._isErasing = true; + } + } + }, + { + key: 'noErase', + value: function noErase() { + if (this._isErasing) { + this.drawingContext.fillStyle = this._cachedFillStyle; + this.drawingContext.strokeStyle = this._cachedStrokeStyle; + this.blendMode(this._cachedBlendMode); + this._isErasing = false; + } + } + }, + { + key: 'beginClip', + value: function beginClip() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + _get(_getPrototypeOf(Renderer2D.prototype), 'beginClip', this).call(this, options); + // cache the fill style + this._cachedFillStyle = this.drawingContext.fillStyle; + var newFill = this._pInst.color(255, 0).toString(); + this.drawingContext.fillStyle = newFill; + // cache the stroke style + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + var newStroke = this._pInst.color(255, 0).toString(); + this.drawingContext.strokeStyle = newStroke; + // cache blendMode + var tempBlendMode = this._cachedBlendMode; + this.blendMode(constants.BLEND); + this._cachedBlendMode = tempBlendMode; + // Start a new path. Everything from here on out should become part of this + // one path so that we can clip to the whole thing. + this.drawingContext.beginPath(); + if (this._clipInvert) { + // Slight hack: draw a big rectangle over everything with reverse winding + // order. This is hopefully large enough to cover most things. + this.drawingContext.moveTo( - 2 * this.width, - 2 * this.height); + this.drawingContext.lineTo( - 2 * this.width, 2 * this.height); + this.drawingContext.lineTo(2 * this.width, 2 * this.height); + this.drawingContext.lineTo(2 * this.width, - 2 * this.height); + this.drawingContext.closePath(); + } + } + }, + { + key: 'endClip', + value: function endClip() { + this._doFillStrokeClose(); + this.drawingContext.clip(); + _get(_getPrototypeOf(Renderer2D.prototype), 'endClip', this).call(this); + this.drawingContext.fillStyle = this._cachedFillStyle; + this.drawingContext.strokeStyle = this._cachedStrokeStyle; + this.blendMode(this._cachedBlendMode); + } ////////////////////////////////////////////// + // IMAGE | Loading & Displaying + ////////////////////////////////////////////// + + }, + { + key: 'image', + value: function image(img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) { + var cnv; + if (img.gifProperties) { + img._animateGif(this._pInst); + } + try { + if (_main.default.MediaElement && img instanceof _main.default.MediaElement) { + img._ensureCanvas(); + } + if (this._tint && img.canvas) { + cnv = this._getTintedImageCanvas(img); + } + if (!cnv) { + cnv = img.canvas || img.elt; + } + var s = 1; + if (img.width && img.width > 0) { + s = cnv.width / img.width; + } + if (this._isErasing) { + this.blendMode(this._cachedBlendMode); + } + this.drawingContext.drawImage(cnv, s * sx, s * sy, s * sWidth, s * sHeight, dx, dy, dWidth, dHeight); + if (this._isErasing) { + this._pInst.erase(); + } + } catch (e) { + if (e.name !== 'NS_ERROR_NOT_AVAILABLE') { + throw e; + } + } + } + }, + { + key: '_getTintedImageCanvas', + value: function _getTintedImageCanvas(img) { + if (!img.canvas) { + return img; + } + if (!img.tintCanvas) { + // Once an image has been tinted, keep its tint canvas + // around so we don't need to re-incur the cost of + // creating a new one for each tint + img.tintCanvas = document.createElement('canvas'); + } // Keep the size of the tint canvas up-to-date + + if (img.tintCanvas.width !== img.canvas.width) { + img.tintCanvas.width = img.canvas.width; + } + if (img.tintCanvas.height !== img.canvas.height) { + img.tintCanvas.height = img.canvas.height; + } // Goal: multiply the r,g,b,a values of the source by + // the r,g,b,a values of the tint color + + var ctx = img.tintCanvas.getContext('2d'); + ctx.save(); + ctx.clearRect(0, 0, img.canvas.width, img.canvas.height); + if (this._tint[0] < 255 || this._tint[1] < 255 || this._tint[2] < 255) { + // Color tint: we need to use the multiply blend mode to change the colors. + // However, the canvas implementation of this destroys the alpha channel of + // the image. To accommodate, we first get a version of the image with full + // opacity everywhere, tint using multiply, and then use the destination-in + // blend mode to restore the alpha channel again. + // Start with the original image + ctx.drawImage(img.canvas, 0, 0); + // This blend mode makes everything opaque but forces the luma to match + // the original image again + ctx.globalCompositeOperation = 'luminosity'; + ctx.drawImage(img.canvas, 0, 0); + // This blend mode forces the hue and chroma to match the original image. + // After this we should have the original again, but with full opacity. + ctx.globalCompositeOperation = 'color'; + ctx.drawImage(img.canvas, 0, 0); + // Apply color tint + ctx.globalCompositeOperation = 'multiply'; + ctx.fillStyle = 'rgb('.concat(this._tint.slice(0, 3).join(', '), ')'); + ctx.fillRect(0, 0, img.canvas.width, img.canvas.height); + // Replace the alpha channel with the original alpha * the alpha tint + ctx.globalCompositeOperation = 'destination-in'; + ctx.globalAlpha = this._tint[3] / 255; + ctx.drawImage(img.canvas, 0, 0); + } else { + // If we only need to change the alpha, we can skip all the extra work! + ctx.globalAlpha = this._tint[3] / 255; + ctx.drawImage(img.canvas, 0, 0); + } + ctx.restore(); + return img.tintCanvas; + } ////////////////////////////////////////////// + // IMAGE | Pixels + ////////////////////////////////////////////// + + }, + { + key: 'blendMode', + value: function blendMode(mode) { + if (mode === constants.SUBTRACT) { + console.warn('blendMode(SUBTRACT) only works in WEBGL mode.'); + } else if (mode === constants.BLEND || mode === constants.REMOVE || mode === constants.DARKEST || mode === constants.LIGHTEST || mode === constants.DIFFERENCE || mode === constants.MULTIPLY || mode === constants.EXCLUSION || mode === constants.SCREEN || mode === constants.REPLACE || mode === constants.OVERLAY || mode === constants.HARD_LIGHT || mode === constants.SOFT_LIGHT || mode === constants.DODGE || mode === constants.BURN || mode === constants.ADD) { + this._cachedBlendMode = mode; + this.drawingContext.globalCompositeOperation = mode; + } else { + throw new Error('Mode '.concat(mode, ' not recognized.')); + } + } + }, + { + key: 'blend', + value: function blend() { + var currBlend = this.drawingContext.globalCompositeOperation; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var blendMode = args[args.length - 1]; + var copyArgs = Array.prototype.slice.call(args, 0, args.length - 1); + this.drawingContext.globalCompositeOperation = blendMode; + _main.default.prototype.copy.apply(this, copyArgs); + this.drawingContext.globalCompositeOperation = currBlend; + } // p5.Renderer2D.prototype.get = p5.Renderer.prototype.get; + // .get() is not overridden + // x,y are canvas-relative (pre-scaled by _pixelDensity) + + }, + { + key: '_getPixel', + value: function _getPixel(x, y) { + var imageData, + index; + imageData = this.drawingContext.getImageData(x, y, 1, 1).data; + index = 0; + return [imageData[index + 0], + imageData[index + 1], + imageData[index + 2], + imageData[index + 3]]; + } + }, + { + key: 'loadPixels', + value: function loadPixels() { + var pixelsState = this._pixelsState; // if called by p5.Image + var pd = pixelsState._pixelDensity; + var w = this.width * pd; + var h = this.height * pd; + var imageData = this.drawingContext.getImageData(0, 0, w, h); + // @todo this should actually set pixels per object, so diff buffers can + // have diff pixel arrays. + pixelsState._setProperty('imageData', imageData); + pixelsState._setProperty('pixels', imageData.data); + } + }, + { + key: 'set', + value: function set(x, y, imgOrCol) { + // round down to get integer numbers + x = Math.floor(x); + y = Math.floor(y); + var pixelsState = this._pixelsState; + if (imgOrCol instanceof _main.default.Image) { + this.drawingContext.save(); + this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); + this.drawingContext.scale(pixelsState._pixelDensity, pixelsState._pixelDensity); + this.drawingContext.clearRect(x, y, imgOrCol.width, imgOrCol.height); + this.drawingContext.drawImage(imgOrCol.canvas, x, y); + this.drawingContext.restore(); + } else { + var r = 0, + g = 0, + b = 0, + a = 0; + var idx = 4 * (y * pixelsState._pixelDensity * (this.width * pixelsState._pixelDensity) + x * pixelsState._pixelDensity); + if (!pixelsState.imageData) { + pixelsState.loadPixels.call(pixelsState); + } + if (typeof imgOrCol === 'number') { + if (idx < pixelsState.pixels.length) { + r = imgOrCol; + g = imgOrCol; + b = imgOrCol; + a = 255; + //this.updatePixels.call(this); + } + } else if (imgOrCol instanceof Array) { + if (imgOrCol.length < 4) { + throw new Error('pixel array must be of the form [R, G, B, A]'); + } + if (idx < pixelsState.pixels.length) { + r = imgOrCol[0]; + g = imgOrCol[1]; + b = imgOrCol[2]; + a = imgOrCol[3]; + //this.updatePixels.call(this); + } + } else if (imgOrCol instanceof _main.default.Color) { + if (idx < pixelsState.pixels.length) { + r = imgOrCol.levels[0]; + g = imgOrCol.levels[1]; + b = imgOrCol.levels[2]; + a = imgOrCol.levels[3]; + //this.updatePixels.call(this); + } + } // loop over pixelDensity * pixelDensity + + for (var i = 0; i < pixelsState._pixelDensity; i++) { + for (var j = 0; j < pixelsState._pixelDensity; j++) { + // loop over + idx = 4 * ((y * pixelsState._pixelDensity + j) * this.width * pixelsState._pixelDensity + (x * pixelsState._pixelDensity + i)); + pixelsState.pixels[idx] = r; + pixelsState.pixels[idx + 1] = g; + pixelsState.pixels[idx + 2] = b; + pixelsState.pixels[idx + 3] = a; + } + } + } + } + }, + { + key: 'updatePixels', + value: function updatePixels(x, y, w, h) { + var pixelsState = this._pixelsState; + var pd = pixelsState._pixelDensity; + if (x === undefined && y === undefined && w === undefined && h === undefined) { + x = 0; + y = 0; + w = this.width; + h = this.height; + } + x *= pd; + y *= pd; + w *= pd; + h *= pd; + if (this.gifProperties) { + this.gifProperties.frames[this.gifProperties.displayIndex].image = pixelsState.imageData; + } + this.drawingContext.putImageData(pixelsState.imageData, x, y, 0, 0, w, h); + } ////////////////////////////////////////////// + // SHAPE | 2D Primitives + ////////////////////////////////////////////// + /** + * Generate a cubic Bezier representing an arc on the unit circle of total + * angle `size` radians, beginning `start` radians above the x-axis. Up to + * four of these curves are combined to make a full arc. + * + * See ecridge.com/bezier.pdf for an explanation of the method. + */ + + }, + { + key: '_acuteArcToBezier', + value: function _acuteArcToBezier(start, size) { + // Evaluate constants. + var alpha = size / 2, + cos_alpha = Math.cos(alpha), + sin_alpha = Math.sin(alpha), + cot_alpha = 1 / Math.tan(alpha), + // This is how far the arc needs to be rotated. + phi = start + alpha, + cos_phi = Math.cos(phi), + sin_phi = Math.sin(phi), + lambda = (4 - cos_alpha) / 3, + mu = sin_alpha + (cos_alpha - lambda) * cot_alpha; + // Return rotated waypoints. + return { + ax: Math.cos(start).toFixed(7), + ay: Math.sin(start).toFixed(7), + bx: (lambda * cos_phi + mu * sin_phi).toFixed(7), + by: (lambda * sin_phi - mu * cos_phi).toFixed(7), + cx: (lambda * cos_phi - mu * sin_phi).toFixed(7), + cy: (lambda * sin_phi + mu * cos_phi).toFixed(7), + dx: Math.cos(start + size).toFixed(7), + dy: Math.sin(start + size).toFixed(7) + }; + } /* + * This function requires that: + * + * 0 <= start < TWO_PI + * + * start <= stop < start + TWO_PI + */ + + }, + { + key: 'arc', + value: function arc(x, y, w, h, start, stop, mode) { + var ctx = this.drawingContext; + var rx = w / 2; + var ry = h / 2; + var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. + var arcToDraw = 0; + var curves = [ + ]; + x += rx; + y += ry; + // Create curves + while (stop - start >= epsilon) { + arcToDraw = Math.min(stop - start, constants.HALF_PI); + curves.push(this._acuteArcToBezier(start, arcToDraw)); + start += arcToDraw; + } // Fill curves + + if (this._doFill) { + if (!this._clipping) ctx.beginPath(); + curves.forEach(function (curve, index) { + if (index === 0) { + ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); + } /* eslint-disable indent */ + + ctx.bezierCurveTo(x + curve.bx * rx, y + curve.by * ry, x + curve.cx * rx, y + curve.cy * ry, x + curve.dx * rx, y + curve.dy * ry); + /* eslint-enable indent */ + }); + if (mode === constants.PIE || mode == null) { + ctx.lineTo(x, y); + } + ctx.closePath(); + if (!this._clipping) ctx.fill(); + } // Stroke curves + + if (this._doStroke) { + if (!this._clipping) ctx.beginPath(); + curves.forEach(function (curve, index) { + if (index === 0) { + ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); + } /* eslint-disable indent */ + + ctx.bezierCurveTo(x + curve.bx * rx, y + curve.by * ry, x + curve.cx * rx, y + curve.cy * ry, x + curve.dx * rx, y + curve.dy * ry); + /* eslint-enable indent */ + }); + if (mode === constants.PIE) { + ctx.lineTo(x, y); + ctx.closePath(); + } else if (mode === constants.CHORD) { + ctx.closePath(); + } + if (!this._clipping) ctx.stroke(); + } + return this; + } + }, + { + key: 'ellipse', + value: function ellipse(args) { + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + var x = parseFloat(args[0]), + y = parseFloat(args[1]), + w = parseFloat(args[2]), + h = parseFloat(args[3]); + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + var kappa = 0.5522847498, + // control point offset horizontal + ox = w / 2 * kappa, + // control point offset vertical + oy = h / 2 * kappa, + // x-end + xe = x + w, + // y-end + ye = y + h, + // x-middle + xm = x + w / 2, + ym = y + h / 2; // y-middle + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x, ym); + ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); + ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); + ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); + ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); + if (!this._clipping && doFill) { + ctx.fill(); + } + if (!this._clipping && doStroke) { + ctx.stroke(); + } + } + }, + { + key: 'line', + value: function line(x1, y1, x2, y2) { + var ctx = this.drawingContext; + if (!this._doStroke) { + return this; + } else if (this._getStroke() === styleEmpty) { + return this; + } + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + return this; + } + }, + { + key: 'point', + value: function point(x, y) { + var ctx = this.drawingContext; + if (!this._doStroke) { + return this; + } else if (this._getStroke() === styleEmpty) { + return this; + } + var s = this._getStroke(); + var f = this._getFill(); + if (!this._clipping) { + // swapping fill color to stroke and back after for correct point rendering + this._setFill(s); + } + if (!this._clipping) ctx.beginPath(); + ctx.arc(x, y, ctx.lineWidth / 2, 0, constants.TWO_PI, false); + if (!this._clipping) { + ctx.fill(); + this._setFill(f); + } + } + }, + { + key: 'quad', + value: function quad(x1, y1, x2, y2, x3, y3, x4, y4) { + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x3, y3); + ctx.lineTo(x4, y4); + ctx.closePath(); + if (!this._clipping && doFill) { + ctx.fill(); + } + if (!this._clipping && doStroke) { + ctx.stroke(); + } + return this; + } + }, + { + key: 'rect', + value: function rect(args) { + var x = args[0]; + var y = args[1]; + var w = args[2]; + var h = args[3]; + var tl = args[4]; + var tr = args[5]; + var br = args[6]; + var bl = args[7]; + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + if (!this._clipping) ctx.beginPath(); + if (typeof tl === 'undefined') { + // No rounded corners + ctx.rect(x, y, w, h); + } else { + // At least one rounded corner + // Set defaults when not specified + if (typeof tr === 'undefined') { + tr = tl; + } + if (typeof br === 'undefined') { + br = tr; + } + if (typeof bl === 'undefined') { + bl = br; + } // corner rounding must always be positive + + var absW = Math.abs(w); + var absH = Math.abs(h); + var hw = absW / 2; + var hh = absH / 2; + // Clip radii + if (absW < 2 * tl) { + tl = hw; + } + if (absH < 2 * tl) { + tl = hh; + } + if (absW < 2 * tr) { + tr = hw; + } + if (absH < 2 * tr) { + tr = hh; + } + if (absW < 2 * br) { + br = hw; + } + if (absH < 2 * br) { + br = hh; + } + if (absW < 2 * bl) { + bl = hw; + } + if (absH < 2 * bl) { + bl = hh; + } // Draw shape + + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x + tl, y); + ctx.arcTo(x + w, y, x + w, y + h, tr); + ctx.arcTo(x + w, y + h, x, y + h, br); + ctx.arcTo(x, y + h, x, y, bl); + ctx.arcTo(x, y, x + w, y, tl); + ctx.closePath(); + } + if (!this._clipping && this._doFill) { + ctx.fill(); + } + if (!this._clipping && this._doStroke) { + ctx.stroke(); + } + return this; + } + }, + { + key: 'triangle', + value: function triangle(args) { + var ctx = this.drawingContext; + var doFill = this._doFill, + doStroke = this._doStroke; + var x1 = args[0], + y1 = args[1]; + var x2 = args[2], + y2 = args[3]; + var x3 = args[4], + y3 = args[5]; + if (doFill && !doStroke) { + if (this._getFill() === styleEmpty) { + return this; + } + } else if (!doFill && doStroke) { + if (this._getStroke() === styleEmpty) { + return this; + } + } + if (!this._clipping) ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x3, y3); + ctx.closePath(); + if (!this._clipping && doFill) { + ctx.fill(); + } + if (!this._clipping && doStroke) { + ctx.stroke(); + } + } + }, + { + key: 'endShape', + value: function endShape(mode, vertices, isCurve, isBezier, isQuadratic, isContour, shapeKind) { + if (vertices.length === 0) { + return this; + } + if (!this._doStroke && !this._doFill) { + return this; + } + var closeShape = mode === constants.CLOSE; + var v; + if (closeShape && !isContour) { + vertices.push(vertices[0]); + } + var i, + j; + var numVerts = vertices.length; + if (isCurve && shapeKind === null) { + if (numVerts > 3) { + var b = [ + ], + s = 1 - this._curveTightness; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(vertices[1][0], vertices[1][1]); + for (i = 1; i + 2 < numVerts; i++) { + v = vertices[i]; + b[0] = [ + v[0], + v[1] + ]; + b[1] = [ + v[0] + (s * vertices[i + 1][0] - s * vertices[i - 1][0]) / 6, + v[1] + (s * vertices[i + 1][1] - s * vertices[i - 1][1]) / 6 + ]; + b[2] = [ + vertices[i + 1][0] + (s * vertices[i][0] - s * vertices[i + 2][0]) / 6, + vertices[i + 1][1] + (s * vertices[i][1] - s * vertices[i + 2][1]) / 6 + ]; + b[3] = [ + vertices[i + 1][0], + vertices[i + 1][1] + ]; + this.drawingContext.bezierCurveTo(b[1][0], b[1][1], b[2][0], b[2][1], b[3][0], b[3][1]); + } + if (closeShape) { + this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); + } + this._doFillStrokeClose(closeShape); + } + } else if (isBezier && shapeKind === null) { + if (!this._clipping) this.drawingContext.beginPath(); + for (i = 0; i < numVerts; i++) { + if (vertices[i].isVert) { + if (vertices[i].moveTo) { + this.drawingContext.moveTo(vertices[i][0], vertices[i][1]); + } else { + this.drawingContext.lineTo(vertices[i][0], vertices[i][1]); + } + } else { + this.drawingContext.bezierCurveTo(vertices[i][0], vertices[i][1], vertices[i][2], vertices[i][3], vertices[i][4], vertices[i][5]); + } + } + this._doFillStrokeClose(closeShape); + } else if (isQuadratic && shapeKind === null) { + if (!this._clipping) this.drawingContext.beginPath(); + for (i = 0; i < numVerts; i++) { + if (vertices[i].isVert) { + if (vertices[i].moveTo) { + this.drawingContext.moveTo(vertices[i][0], vertices[i][1]); + } else { + this.drawingContext.lineTo(vertices[i][0], vertices[i][1]); + } + } else { + this.drawingContext.quadraticCurveTo(vertices[i][0], vertices[i][1], vertices[i][2], vertices[i][3]); + } + } + this._doFillStrokeClose(closeShape); + } else { + if (shapeKind === constants.POINTS) { + for (i = 0; i < numVerts; i++) { + v = vertices[i]; + if (this._doStroke) { + this._pInst.stroke(v[6]); + } + this._pInst.point(v[0], v[1]); + } + } else if (shapeKind === constants.LINES) { + for (i = 0; i + 1 < numVerts; i += 2) { + v = vertices[i]; + if (this._doStroke) { + this._pInst.stroke(vertices[i + 1][6]); + } + this._pInst.line(v[0], v[1], vertices[i + 1][0], vertices[i + 1][1]); + } + } else if (shapeKind === constants.TRIANGLES) { + for (i = 0; i + 2 < numVerts; i += 3) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(v[0], v[1]); + this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); + this.drawingContext.lineTo(vertices[i + 2][0], vertices[i + 2][1]); + this.drawingContext.closePath(); + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 2][5]); + this.drawingContext.fill(); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 2][6]); + this.drawingContext.stroke(); + } + } + } else if (shapeKind === constants.TRIANGLE_STRIP) { + for (i = 0; i + 1 < numVerts; i++) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(vertices[i + 1][0], vertices[i + 1][1]); + this.drawingContext.lineTo(v[0], v[1]); + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 1][6]); + } + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 1][5]); + } + if (i + 2 < numVerts) { + this.drawingContext.lineTo(vertices[i + 2][0], vertices[i + 2][1]); + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 2][6]); + } + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 2][5]); + } + } + this._doFillStrokeClose(closeShape); + } + } else if (shapeKind === constants.TRIANGLE_FAN) { + if (numVerts > 2) { + // For performance reasons, try to batch as many of the + // fill and stroke calls as possible. + if (!this._clipping) this.drawingContext.beginPath(); + for (i = 2; i < numVerts; i++) { + v = vertices[i]; + this.drawingContext.moveTo(vertices[0][0], vertices[0][1]); + this.drawingContext.lineTo(vertices[i - 1][0], vertices[i - 1][1]); + this.drawingContext.lineTo(v[0], v[1]); + this.drawingContext.lineTo(vertices[0][0], vertices[0][1]); + // If the next colour is going to be different, stroke / fill now + if (i < numVerts - 1) { + if (this._doFill && v[5] !== vertices[i + 1][5] || this._doStroke && v[6] !== vertices[i + 1][6]) { + if (!this._clipping && this._doFill) { + this._pInst.fill(v[5]); + this.drawingContext.fill(); + this._pInst.fill(vertices[i + 1][5]); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(v[6]); + this.drawingContext.stroke(); + this._pInst.stroke(vertices[i + 1][6]); + } + this.drawingContext.closePath(); + if (!this._clipping) this.drawingContext.beginPath(); // Begin the next one + } + } + } + this._doFillStrokeClose(closeShape); + } + } else if (shapeKind === constants.QUADS) { + for (i = 0; i + 3 < numVerts; i += 4) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(v[0], v[1]); + for (j = 1; j < 4; j++) { + this.drawingContext.lineTo(vertices[i + j][0], vertices[i + j][1]); + } + this.drawingContext.lineTo(v[0], v[1]); + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 3][5]); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 3][6]); + } + this._doFillStrokeClose(closeShape); + } + } else if (shapeKind === constants.QUAD_STRIP) { + if (numVerts > 3) { + for (i = 0; i + 1 < numVerts; i += 2) { + v = vertices[i]; + if (!this._clipping) this.drawingContext.beginPath(); + if (i + 3 < numVerts) { + this.drawingContext.moveTo(vertices[i + 2][0], vertices[i + 2][1]); + this.drawingContext.lineTo(v[0], v[1]); + this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); + this.drawingContext.lineTo(vertices[i + 3][0], vertices[i + 3][1]); + if (!this._clipping && this._doFill) { + this._pInst.fill(vertices[i + 3][5]); + } + if (!this._clipping && this._doStroke) { + this._pInst.stroke(vertices[i + 3][6]); + } + } else { + this.drawingContext.moveTo(v[0], v[1]); + this.drawingContext.lineTo(vertices[i + 1][0], vertices[i + 1][1]); + } + this._doFillStrokeClose(closeShape); + } + } + } else { + if (!this._clipping) this.drawingContext.beginPath(); + this.drawingContext.moveTo(vertices[0][0], vertices[0][1]); + for (i = 1; i < numVerts; i++) { + v = vertices[i]; + if (v.isVert) { + if (v.moveTo) { + if (closeShape) this.drawingContext.closePath(); + this.drawingContext.moveTo(v[0], v[1]); + } else { + this.drawingContext.lineTo(v[0], v[1]); + } + } + } + this._doFillStrokeClose(closeShape); + } + } + isCurve = false; + isBezier = false; + isQuadratic = false; + isContour = false; + if (closeShape) { + vertices.pop(); + } + return this; + } ////////////////////////////////////////////// + // SHAPE | Attributes + ////////////////////////////////////////////// + + }, + { + key: 'strokeCap', + value: function strokeCap(cap) { + if (cap === constants.ROUND || cap === constants.SQUARE || cap === constants.PROJECT) { + this.drawingContext.lineCap = cap; + } + return this; + } + }, + { + key: 'strokeJoin', + value: function strokeJoin(join) { + if (join === constants.ROUND || join === constants.BEVEL || join === constants.MITER) { + this.drawingContext.lineJoin = join; + } + return this; + } + }, + { + key: 'strokeWeight', + value: function strokeWeight(w) { + if (typeof w === 'undefined' || w === 0) { + // hack because lineWidth 0 doesn't work + this.drawingContext.lineWidth = 0.0001; + } else { + this.drawingContext.lineWidth = w; + } + return this; + } + }, + { + key: '_getFill', + value: function _getFill() { + if (!this._cachedFillStyle) { + this._cachedFillStyle = this.drawingContext.fillStyle; + } + return this._cachedFillStyle; + } + }, + { + key: '_setFill', + value: function _setFill(fillStyle) { + if (fillStyle !== this._cachedFillStyle) { + this.drawingContext.fillStyle = fillStyle; + this._cachedFillStyle = fillStyle; + } + } + }, + { + key: '_getStroke', + value: function _getStroke() { + if (!this._cachedStrokeStyle) { + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + } + return this._cachedStrokeStyle; + } + }, + { + key: '_setStroke', + value: function _setStroke(strokeStyle) { + if (strokeStyle !== this._cachedStrokeStyle) { + this.drawingContext.strokeStyle = strokeStyle; + this._cachedStrokeStyle = strokeStyle; + } + } ////////////////////////////////////////////// + // SHAPE | Curves + ////////////////////////////////////////////// + + }, + { + key: 'bezier', + value: function bezier(x1, y1, x2, y2, x3, y3, x4, y4) { + this._pInst.beginShape(); + this._pInst.vertex(x1, y1); + this._pInst.bezierVertex(x2, y2, x3, y3, x4, y4); + this._pInst.endShape(); + return this; + } + }, + { + key: 'curve', + value: function curve(x1, y1, x2, y2, x3, y3, x4, y4) { + this._pInst.beginShape(); + this._pInst.curveVertex(x1, y1); + this._pInst.curveVertex(x2, y2); + this._pInst.curveVertex(x3, y3); + this._pInst.curveVertex(x4, y4); + this._pInst.endShape(); + return this; + } ////////////////////////////////////////////// + // SHAPE | Vertex + ////////////////////////////////////////////// + + }, + { + key: '_doFillStrokeClose', + value: function _doFillStrokeClose(closeShape) { + if (closeShape) { + this.drawingContext.closePath(); + } + if (!this._clipping && this._doFill) { + this.drawingContext.fill(); + } + if (!this._clipping && this._doStroke) { + this.drawingContext.stroke(); + } + } ////////////////////////////////////////////// + // TRANSFORM + ////////////////////////////////////////////// + + }, + { + key: 'applyMatrix', + value: function applyMatrix(a, b, c, d, e, f) { + this.drawingContext.transform(a, b, c, d, e, f); + } + }, + { + key: 'resetMatrix', + value: function resetMatrix() { + this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); + this.drawingContext.scale(this._pInst._pixelDensity, this._pInst._pixelDensity); + return this; + } + }, + { + key: 'rotate', + value: function rotate(rad) { + this.drawingContext.rotate(rad); + } + }, + { + key: 'scale', + value: function scale(x, y) { + this.drawingContext.scale(x, y); + return this; + } + }, + { + key: 'translate', + value: function translate(x, y) { + // support passing a vector as the 1st parameter + if (x instanceof _main.default.Vector) { + y = x.y; + x = x.x; + } + this.drawingContext.translate(x, y); + return this; + } ////////////////////////////////////////////// + // TYPOGRAPHY + // + ////////////////////////////////////////////// + + }, + { + key: '_renderText', + value: function _renderText(p, line, x, y, maxY, minY) { + if (y < minY || y >= maxY) { + return; // don't render lines beyond our minY/maxY bounds (see #5785) + } + p.push(); // fix to #803 + if (!this._isOpenType()) { + // a system/browser font + // no stroke unless specified by user + if (this._doStroke && this._strokeSet) { + this.drawingContext.strokeText(line, x, y); + } + if (!this._clipping && this._doFill) { + // if fill hasn't been set by user, use default text fill + if (!this._fillSet) { + this._setFill(constants._DEFAULT_TEXT_FILL); + } + this.drawingContext.fillText(line, x, y); + } + } else { + // an opentype font, let it handle the rendering + this._textFont._renderPath(line, x, y, { + renderer: this + }); + } + p.pop(); + return p; + } + }, + { + key: 'textWidth', + value: function textWidth(s) { + if (this._isOpenType()) { + return this._textFont._textWidth(s, this._textSize); + } + return this.drawingContext.measureText(s).width; + } + }, + { + key: '_applyTextProperties', + value: function _applyTextProperties() { + var font; + var p = this._pInst; + this._setProperty('_textAscent', null); + this._setProperty('_textDescent', null); + font = this._textFont; + if (this._isOpenType()) { + font = this._textFont.font.familyName; + this._setProperty('_textStyle', this._textFont.font.styleName); + } + this.drawingContext.font = ''.concat(this._textStyle || 'normal', ' ').concat(this._textSize || 12, 'px ').concat(font || 'sans-serif'); + this.drawingContext.textAlign = this._textAlign; + if (this._textBaseline === constants.CENTER) { + this.drawingContext.textBaseline = constants._CTX_MIDDLE; + } else { + this.drawingContext.textBaseline = this._textBaseline; + } + return p; + } ////////////////////////////////////////////// + // STRUCTURE + ////////////////////////////////////////////// + // a push() operation is in progress. + // the renderer should return a 'style' object that it wishes to + // store on the push stack. + // derived renderers should call the base class' push() method + // to fetch the base style object. + + }, + { + key: 'push', + value: function push() { + this.drawingContext.save(); + // get the base renderer style + return _get(_getPrototypeOf(Renderer2D.prototype), 'push', this).call(this); + } // a pop() operation is in progress + // the renderer is passed the 'style' object that it returned + // from its push() method. + // derived renderers should pass this object to their base + // class' pop method + + }, + { + key: 'pop', + value: function pop(style) { + this.drawingContext.restore(); + // Re-cache the fill / stroke state + this._cachedFillStyle = this.drawingContext.fillStyle; + this._cachedStrokeStyle = this.drawingContext.strokeStyle; + _get(_getPrototypeOf(Renderer2D.prototype), 'pop', this).call(this, style); + } + } + ]); + return Renderer2D; + }(_main.default.Renderer); // Fix test + Renderer2D.prototype.text = function (str, x, y, maxWidth, maxHeight) { + var baselineHacked; + // baselineHacked: (HACK) + // A temporary fix to conform to Processing's implementation + // of BASELINE vertical alignment in a bounding box + if (typeof maxWidth !== 'undefined') { + if (this.drawingContext.textBaseline === constants.BASELINE) { + baselineHacked = true; + this.drawingContext.textBaseline = constants.TOP; + } + } + var p = _main.default.Renderer.prototype.text.apply(this, arguments); + if (baselineHacked) { + this.drawingContext.textBaseline = constants.BASELINE; + } + return p; + }; + _main.default.Renderer2D = Renderer2D; + var _default = _main.default.Renderer2D; + exports.default = _default; + }, + { + './constants': 286, + './main': 298, + './p5.Renderer': 301, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.number.to-fixed': 193, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.reflect.get': 203, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 303: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + var _main = _interopRequireDefault(_dereq_('./main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + _main.default.prototype._promisePreloads = [ + /* Example object + { + target: p5.prototype, // The target object to have the method modified + method: 'loadXAsync', // The name of the preload function to wrap + addCallbacks: true, // Whether to automatically handle the p5 callbacks + legacyPreloadSetup: { // Optional object to generate a legacy-style preload + method: 'loadX', // The name of the legacy preload function to generate + createBaseObject: function() { + return {}; + } // An optional function to create the base object for the legacy preload. + } + } + */ + ]; + _main.default.prototype.registerPromisePreload = function (setup) { + _main.default.prototype._promisePreloads.push(setup); + }; + var initialSetupRan = false; + _main.default.prototype._setupPromisePreloads = function () { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this._promisePreloads[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var preloadSetup = _step.value; + var thisValue = this; + var method = preloadSetup.method, + addCallbacks = preloadSetup.addCallbacks, + legacyPreloadSetup = preloadSetup.legacyPreloadSetup; // Get the target object that the preload gets assigned to by default, + // that is the current object. + var target = preloadSetup.target || this; + var sourceFunction = target[method].bind(target); + // If the target is the p5 prototype, then only set it up on the first run per page + if (target === _main.default.prototype) { + if (initialSetupRan) { + continue; + } + thisValue = null; + sourceFunction = target[method]; + } // Replace the original method with a wrapped version + + target[method] = this._wrapPromisePreload(thisValue, sourceFunction, addCallbacks); + // If a legacy preload is required + if (legacyPreloadSetup) { + // What is the name for this legacy preload + var legacyMethod = legacyPreloadSetup.method; + // Wrap the already wrapped Promise-returning method with the legacy setup + target[legacyMethod] = this._legacyPreloadGenerator(thisValue, legacyPreloadSetup, target[method]); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + initialSetupRan = true; + }; + _main.default.prototype._wrapPromisePreload = function (thisValue, fn, addCallbacks) { + var replacementFunction = function replacementFunction() { + var _this = this; + // Uses the current preload counting mechanism for now. + this._incrementPreload(); + // A variable for the callback function if specified + var callback = null; + // A variable for the errorCallback function if specified + var errorCallback = null; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (addCallbacks) { + // Loop from the end of the args array, pulling up to two functions off of + // the end and putting them in fns + for (var i = args.length - 1; i >= 0 && !errorCallback; i--) { + if (typeof args[i] !== 'function') { + break; + } + errorCallback = callback; + callback = args.pop(); + } + } // Call the underlying function and pass it to Promise.resolve, + // so that even if it didn't return a promise we can still + // act on the result as if it did. + + var promise = Promise.resolve(fn.apply(this, args)); + // Add the optional callbacks + if (callback) { + promise.then(callback); + } + if (errorCallback) { + promise.catch(errorCallback); + } // Decrement the preload counter only if the promise resolved + + promise.then(function () { + return _this._decrementPreload(); + }); + // Return the original promise so that neither callback changes the result. + return promise; + }; + if (thisValue) { + replacementFunction = replacementFunction.bind(thisValue); + } + return replacementFunction; + }; + var objectCreator = function objectCreator() { + return { + }; + }; + _main.default.prototype._legacyPreloadGenerator = function (thisValue, legacyPreloadSetup, fn) { + // Create a function that will generate an object before the preload is + // launched. For example, if the object should be an array or be an instance + // of a specific class. + var baseValueGenerator = legacyPreloadSetup.createBaseObject || objectCreator; + var returnedFunction = function returnedFunction() { + var _this2 = this; + // Our then clause needs to run before setup, so we also increment the preload counter + this._incrementPreload(); + // Generate the return value based on the generator. + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + var returnValue = baseValueGenerator.apply(this, args); + // Run the original wrapper + fn.apply(this, args).then(function (data) { + // Copy each key from the resolved value into returnValue + Object.assign(returnValue, data); + // Decrement the preload counter, to allow setup to continue. + _this2._decrementPreload(); + }); + return returnValue; + }; + if (thisValue) { + returnedFunction = returnedFunction.bind(thisValue); + } + return returnedFunction; + }; + }, + { + './main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.assign': 194, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.promise': 201, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 304: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + var constants = _interopRequireWildcard(_dereq_('./constants')); + _dereq_('./p5.Graphics'); + _dereq_('./p5.Renderer2D'); + _dereq_('../webgl/p5.RendererGL'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + + var defaultId = 'defaultCanvas0'; // this gets set again in createCanvas + var defaultClass = 'p5Canvas'; + /** + * Creates a canvas element in the document and sets its dimensions + * in pixels. This method should be called only once at the start of setup(). + * Calling createCanvas more than once in a + * sketch will result in very unpredictable behavior. If you want more than + * one drawing canvas you could use createGraphics() + * (hidden by default but it can be shown). + * + * Important note: in 2D mode (i.e. when `p5.Renderer` is not set) the origin (0,0) + * is positioned at the top left of the screen. In 3D mode (i.e. when `p5.Renderer` + * is set to `WEBGL`), the origin is positioned at the center of the canvas. + * See [this issue](https://github.com/processing/p5.js/issues/1545) for more information. + * + * A WebGL canvas will use a WebGL2 context if it is supported by the browser. + * Check the webglVersion property to check what + * version is being used, or call setAttributes({ version: 1 }) + * to create a WebGL1 context. + * + * The system variables width and height are set by the parameters passed to this + * function. If createCanvas() is not used, the + * window will be given a default size of 100×100 pixels. + * + * Optionally, an existing canvas can be passed using a selector, ie. `document.getElementById('')`. + * If specified, avoid using `setAttributes()` afterwards, as this will remove and recreate the existing canvas. + * + * For more ways to position the canvas, see the + * + * positioning the canvas wiki page. + * + * @method createCanvas + * @param {Number} w width of the canvas + * @param {Number} h height of the canvas + * @param {Constant} [renderer] either P2D or WEBGL + * @param {HTMLCanvasElement} [canvas] existing html canvas element + * @return {p5.Renderer} pointer to p5.Renderer holding canvas + * @example + *
                              + * + * function setup() { + * createCanvas(100, 50); + * background(153); + * line(0, 0, width, height); + * } + * + *
                              + * + * @alt + * Black line extending from top-left of canvas to bottom right. + */ + /** + * @method createCanvas + * @param {Number} w + * @param {Number} h + * @param {HTMLCanvasElement} [canvas] + * @return {p5.Renderer} pointer to p5.Renderer holding canvas + */ + _main.default.prototype.createCanvas = function (w, h, renderer, canvas) { + _main.default._validateParameters('createCanvas', arguments); + //optional: renderer, otherwise defaults to p2d + var r; + if (arguments[2] instanceof HTMLCanvasElement) { + renderer = constants.P2D; + canvas = arguments[2]; + } else { + r = renderer || constants.P2D; + } + var c; + if (canvas) { + c = document.getElementById(defaultId); + if (c) { + c.parentNode.removeChild(c); //replace the existing defaultCanvas + } + c = canvas; + this._defaultGraphicsCreated = false; + } else { + if (r === constants.WEBGL) { + c = document.getElementById(defaultId); + if (c) { + //if defaultCanvas already exists + c.parentNode.removeChild(c); //replace the existing defaultCanvas + var thisRenderer = this._renderer; + this._elements = this._elements.filter(function (e) { + return e !== thisRenderer; + }); + } + c = document.createElement('canvas'); + c.id = defaultId; + c.classList.add(defaultClass); + } else { + if (!this._defaultGraphicsCreated) { + if (canvas) { + c = canvas; + } else { + c = document.createElement('canvas'); + } + var i = 0; + while (document.getElementById('defaultCanvas'.concat(i))) { + i++; + } + defaultId = 'defaultCanvas'.concat(i); + c.id = defaultId; + c.classList.add(defaultClass); + } else { + // resize the default canvas if new one is created + c = this.canvas; + } + } // set to invisible if still in setup (to prevent flashing with manipulate) + + if (!this._setupDone) { + c.dataset.hidden = true; // tag to show later + c.style.visibility = 'hidden'; + } + if (this._userNode) { + // user input node case + this._userNode.appendChild(c); + } else { + //create main element + if (document.getElementsByTagName('main').length === 0) { + var m = document.createElement('main'); + document.body.appendChild(m); + } //append canvas to main + + document.getElementsByTagName('main') [0].appendChild(c); + } + } // Init our graphics renderer + //webgl mode + + if (r === constants.WEBGL) { + this._setProperty('_renderer', new _main.default.RendererGL(c, this, true)); + this._elements.push(this._renderer); + } else { + //P2D mode + if (!this._defaultGraphicsCreated) { + this._setProperty('_renderer', new _main.default.Renderer2D(c, this, true)); + this._defaultGraphicsCreated = true; + this._elements.push(this._renderer); + } + } + this._renderer.resize(w, h); + this._renderer._applyDefaults(); + return this._renderer; + }; + /** + * Resizes the canvas to given width and height. The canvas will be cleared + * and draw will be called immediately, allowing the sketch to re-render itself + * in the resized canvas. + * @method resizeCanvas + * @param {Number} w width of the canvas + * @param {Number} h height of the canvas + * @param {Boolean} [noRedraw] don't redraw the canvas immediately + * @example + *
                              + * function setup() { + * createCanvas(windowWidth, windowHeight); + * } + * + * function draw() { + * background(0, 100, 200); + * } + * + * function windowResized() { + * resizeCanvas(windowWidth, windowHeight); + * } + *
                              + * + * @alt + * No image displayed. + */ + _main.default.prototype.resizeCanvas = function (w, h, noRedraw) { + _main.default._validateParameters('resizeCanvas', arguments); + if (this._renderer) { + // save canvas properties + var props = { + }; + for (var key in this.drawingContext) { + var val = this.drawingContext[key]; + if (_typeof(val) !== 'object' && typeof val !== 'function') { + props[key] = val; + } + } + this.width = w; + this.height = h; + // Make sure width and height are updated before the renderer resizes so + // that framebuffers updated from the resize read the correct size + this._renderer.resize(w, h); + // reset canvas properties + for (var savedKey in props) { + try { + this.drawingContext[savedKey] = props[savedKey]; + } catch (err) { + // ignore read-only property errors + } + } + if (!noRedraw) { + this.redraw(); + } + } //accessible Outputs + + if (this._addAccsOutput()) { + this._updateAccsOutput(); + } + }; + /** + * Removes the default canvas for a p5 sketch that doesn't require a canvas + * @method noCanvas + * @example + *
                              + * + * function setup() { + * noCanvas(); + * } + * + *
                              + * + * @alt + * no image displayed + */ + _main.default.prototype.noCanvas = function () { + if (this.canvas) { + this.canvas.parentNode.removeChild(this.canvas); + } + }; + /** + * Creates and returns a new p5.Graphics object. Use this class if you need + * to draw into an off-screen graphics buffer. The two parameters define the + * width and height in pixels. + * + * A WebGL p5.Graphics will use a WebGL2 context if it is supported by the browser. + * Check the pg.webglVersion property of the renderer + * to check what version is being used, or call pg.setAttributes({ version: 1 }) + * to create a WebGL1 context. + * + * Optionally, an existing canvas can be passed using a selector, ie. document.getElementById(''). + * By default this canvas will be hidden (offscreen buffer), to make visible, set element's style to display:block; + * + * @method createGraphics + * @param {Number} w width of the offscreen graphics buffer + * @param {Number} h height of the offscreen graphics buffer + * @param {Constant} [renderer] either P2D or WEBGL + * undefined defaults to p2d + * @param {HTMLCanvasElement} [canvas] existing html canvas element + * @return {p5.Graphics} offscreen graphics buffer + * @example + *
                              + * + * let pg; + * function setup() { + * createCanvas(100, 100); + * pg = createGraphics(100, 100); + * } + * + * function draw() { + * background(200); + * pg.background(100); + * pg.noStroke(); + * pg.ellipse(pg.width / 2, pg.height / 2, 50, 50); + * image(pg, 50, 50); + * image(pg, 0, 0, 50, 50); + * } + * + *
                              + * + * @alt + * 4 grey squares alternating light and dark grey. White quarter circle mid-left. + */ + /** + * @method createGraphics + * @param {Number} w + * @param {Number} h + * @param {HTMLCanvasElement} [canvas] + * @return {p5.Graphics} offscreen graphics buffer + */ + _main.default.prototype.createGraphics = function (w, h) { + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } /** + * args[0] is expected to be renderer + * args[1] is expected to be canvas + */ + + if (args[0] instanceof HTMLCanvasElement) { + args[1] = args[0]; + args[0] = constants.P2D; + } + _main.default._validateParameters('createGraphics', arguments); + return new _main.default.Graphics(w, h, args[0], this, args[1]); + }; + /** + * Creates and returns a new p5.Framebuffer, a + * high-performance WebGL object that you can draw to and then use as a texture. + * + * Options can include: + * - `format`: The data format of the texture, either `UNSIGNED_BYTE`, `FLOAT`, or `HALF_FLOAT`. The default is `UNSIGNED_BYTE`. + * - `channels`: What color channels to store, either `RGB` or `RGBA`. The default is to match the channels in the main canvas (with alpha unless disabled with `setAttributes`.) + * - `depth`: A boolean, whether or not to include a depth buffer. Defaults to true. + * - `depthFormat`: The data format for depth information, either `UNSIGNED_INT` or `FLOAT`. The default is `FLOAT` if available, or `UNSIGNED_INT` otherwise. + * - `stencil`: A boolean, whether or not to include a stencil buffer, which can be used for masking. This may only be used if also using a depth buffer. Defaults to the value of `depth`, which is true if not provided. + * - `antialias`: Boolean or Number, whether or not to render with antialiased edges, and if so, optionally the number of samples to use. Defaults to whether or not the main canvas is antialiased, using a default of 2 samples if so. Antialiasing is only supported when WebGL 2 is available. + * - `width`: The width of the texture. Defaults to matching the main canvas. + * - `height`: The height of the texture. Defaults to matching the main canvas. + * - `density`: The pixel density of the texture. Defaults to the pixel density of the main canvas. + * - `textureFiltering`: Either `LINEAR` (nearby pixels will be interpolated when reading values from the color texture) or `NEAREST` (no interpolation.) Generally, use `LINEAR` when using the texture as an image, and use `NEAREST` if reading the texture as data. Defaults to `LINEAR`. + * + * If `width`, `height`, or `density` are specified, then the framebuffer will + * keep that size until manually changed. Otherwise, it will be autosized, and + * it will update to match the main canvas's size and density when the main + * canvas changes. + * + * @method createFramebuffer + * @param {Object} [options] An optional object with configuration + * + * @example + *
                              + * + * let prev, next, cam; + * function setup() { + * createCanvas(100, 100, WEBGL); + * prev = createFramebuffer({ format: FLOAT }); + * next = createFramebuffer({ format: FLOAT }); + * cam = createCamera(); + * noStroke(); + * } + * + * function draw() { + * // Swap prev and next so that we can use the previous + * // frame as a texture when drawing the current frame + * [prev, next] = [next, prev]; + * + * // Draw to the framebuffer + * next.begin(); + * background(255); + * + * push(); + * // Draw the previous texture farther away, but scaled + * // up to fill the screen, plus a bit extra scale so it grows + * translate(0, 0, -200); + * scale(1.001 * (200 + cam.eyeZ) / cam.eyeZ); + * tint(255, 253); + * image(prev, -width/2, -height/2); + * pop(); + * + * push(); + * normalMaterial(); + * translate(25*sin(frameCount * 0.014), 25*sin(frameCount * 0.02), 0); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(12); + * pop(); + * next.end(); + * + * image(next, -width/2, -height/2); + * } + * + *
                              + * + * @alt + * A red, green, and blue box (using normalMaterial) moves and rotates around + * the canvas, leaving a trail behind it that slowly grows and fades away. + */ + _main.default.prototype.createFramebuffer = function (options) { + return new _main.default.Framebuffer(this, options); + }; + /** + * Blends the pixels in the display window according to the defined mode. + * There is a choice of the following modes to blend the source pixels (A) + * with the ones of pixels already in the display window (B): + *
                                + *
                              • BLEND - linear interpolation of colours: C = + * A*factor + B. This is the default blending mode.
                              • + *
                              • ADD - sum of A and B
                              • + *
                              • DARKEST - only the darkest colour succeeds: C = + * min(A*factor, B).
                              • + *
                              • LIGHTEST - only the lightest colour succeeds: C = + * max(A*factor, B).
                              • + *
                              • DIFFERENCE - subtract colors from underlying image. + * (2D)
                              • + *
                              • EXCLUSION - similar to DIFFERENCE, but less + * extreme.
                              • + *
                              • MULTIPLY - multiply the colors, result will always be + * darker.
                              • + *
                              • SCREEN - opposite multiply, uses inverse values of the + * colors.
                              • + *
                              • REPLACE - the pixels entirely replace the others and + * don't utilize alpha (transparency) values.
                              • + *
                              • REMOVE - removes pixels from B with the alpha strength of A.
                              • + *
                              • OVERLAY - mix of MULTIPLY and SCREEN + * . Multiplies dark values, and screens light values. (2D)
                              • + *
                              • HARD_LIGHT - SCREEN when greater than 50% + * gray, MULTIPLY when lower. (2D)
                              • + *
                              • SOFT_LIGHT - mix of DARKEST and + * LIGHTEST. Works like OVERLAY, but not as harsh. (2D) + *
                              • + *
                              • DODGE - lightens light tones and increases contrast, + * ignores darks. (2D)
                              • + *
                              • BURN - darker areas are applied, increasing contrast, + * ignores lights. (2D)
                              • + *
                              • SUBTRACT - remainder of A and B (3D)
                              • + *
                              + * + * (2D) indicates that this blend mode only works in the 2D renderer.
                              + * (3D) indicates that this blend mode only works in the WEBGL renderer. + * + * @method blendMode + * @param {Constant} mode blend mode to set for canvas. + * either BLEND, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY, + * EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, + * SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT + * @example + *
                              + * + * blendMode(LIGHTEST); + * strokeWeight(30); + * stroke(80, 150, 255); + * line(25, 25, 75, 75); + * stroke(255, 50, 50); + * line(75, 25, 25, 75); + * + *
                              + * + *
                              + * + * blendMode(MULTIPLY); + * strokeWeight(30); + * stroke(80, 150, 255); + * line(25, 25, 75, 75); + * stroke(255, 50, 50); + * line(75, 25, 25, 75); + * + *
                              + * + * @alt + * translucent image thick red & blue diagonal rounded lines intersecting center + * Thick red & blue diagonal rounded lines intersecting center. dark at overlap + */ + _main.default.prototype.blendMode = function (mode) { + _main.default._validateParameters('blendMode', arguments); + if (mode === constants.NORMAL) { + // Warning added 3/26/19, can be deleted in future (1.0 release?) + console.warn('NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead.'); + mode = constants.BLEND; + } + this._renderer.blendMode(mode); + }; + /** + * The p5.js API provides a lot of functionality for creating graphics, but there is + * some native HTML5 Canvas functionality that is not exposed by p5. You can still call + * it directly using the variable `drawingContext`, as in the example shown. This is + * the equivalent of calling `canvas.getContext('2d');` or `canvas.getContext('webgl');`. + * See this + * + * reference for the native canvas API for possible drawing functions you can call. + * + * @property drawingContext + * @example + *
                              + * + * function setup() { + * drawingContext.shadowOffsetX = 5; + * drawingContext.shadowOffsetY = -5; + * drawingContext.shadowBlur = 10; + * drawingContext.shadowColor = 'black'; + * background(200); + * ellipse(width / 2, height / 2, 50, 50); + * } + * + *
                              + * + * @alt + * white ellipse with shadow blur effect around edges + */ + var _default = _main.default; + exports.default = _default; + }, + { + '../webgl/p5.RendererGL': 355, + './constants': 286, + './main': 298, + './p5.Graphics': 300, + './p5.Renderer2D': 302, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 305: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.slice'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var constants = _interopRequireWildcard(_dereq_('../constants')); + var _helpers = _interopRequireDefault(_dereq_('../helpers')); + _dereq_('../friendly_errors/fes_core'); + _dereq_('../friendly_errors/file_errors'); + _dereq_('../friendly_errors/validate_params'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Shape + * @submodule 2D Primitives + * @for p5 + * @requires core + * @requires constants + */ + /** + * This function does 3 things: + * + * 1. Bounds the desired start/stop angles for an arc (in radians) so that: + * + * 0 <= start < TWO_PI ; start <= stop < start + TWO_PI + * + * This means that the arc rendering functions don't have to be concerned + * with what happens if stop is smaller than start, or if the arc 'goes + * round more than once', etc.: they can just start at start and increase + * until stop and the correct arc will be drawn. + * + * 2. Optionally adjusts the angles within each quadrant to counter the naive + * scaling of the underlying ellipse up from the unit circle. Without + * this, the angles become arbitrary when width != height: 45 degrees + * might be drawn at 5 degrees on a 'wide' ellipse, or at 85 degrees on + * a 'tall' ellipse. + * + * 3. Flags up when start and stop correspond to the same place on the + * underlying ellipse. This is useful if you want to do something special + * there (like rendering a whole ellipse instead). + */ + + _main.default.prototype._normalizeArcAngles = function (start, stop, width, height, correctForScaling) { + var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. + var separation; + // The order of the steps is important here: each one builds upon the + // adjustments made in the steps that precede it. + // Constrain both start and stop to [0,TWO_PI). + start = start - constants.TWO_PI * Math.floor(start / constants.TWO_PI); + stop = stop - constants.TWO_PI * Math.floor(stop / constants.TWO_PI); + // Get the angular separation between the requested start and stop points. + // + // Technically this separation only matches what gets drawn if + // correctForScaling is enabled. We could add a more complicated calculation + // for when the scaling is uncorrected (in which case the drawn points could + // end up pushed together or pulled apart quite dramatically relative to what + // was requested), but it would make things more opaque for little practical + // benefit. + // + // (If you do disable correctForScaling and find that correspondToSamePoint + // is set too aggressively, the easiest thing to do is probably to just make + // epsilon smaller...) + separation = Math.min(Math.abs(start - stop), constants.TWO_PI - Math.abs(start - stop)); + // Optionally adjust the angles to counter linear scaling. + if (correctForScaling) { + if (start <= constants.HALF_PI) { + start = Math.atan(width / height * Math.tan(start)); + } else if (start > constants.HALF_PI && start <= 3 * constants.HALF_PI) { + start = Math.atan(width / height * Math.tan(start)) + constants.PI; + } else { + start = Math.atan(width / height * Math.tan(start)) + constants.TWO_PI; + } + if (stop <= constants.HALF_PI) { + stop = Math.atan(width / height * Math.tan(stop)); + } else if (stop > constants.HALF_PI && stop <= 3 * constants.HALF_PI) { + stop = Math.atan(width / height * Math.tan(stop)) + constants.PI; + } else { + stop = Math.atan(width / height * Math.tan(stop)) + constants.TWO_PI; + } + } // Ensure that start <= stop < start + TWO_PI. + + if (start > stop) { + stop += constants.TWO_PI; + } + return { + start: start, + stop: stop, + correspondToSamePoint: separation < epsilon + }; + }; + /** + * Draws an arc to the canvas. Arcs are drawn along the outer edge of an ellipse + * (oval) defined by the `x`, `y`, `w`, and `h` parameters. Use the `start` and `stop` + * parameters to specify the angles (in radians) at which to draw the arc. Arcs are + * always drawn clockwise from `start` to `stop`. The origin of the arc's ellipse may + * be changed with the ellipseMode() function. + * + * The optional `mode` parameter determines the arc's fill style. The fill modes are + * a semi-circle (`OPEN`), a closed semi-circle (`CHORD`), or a closed pie segment (`PIE`). + * + * @method arc + * @param {Number} x x-coordinate of the arc's ellipse. + * @param {Number} y y-coordinate of the arc's ellipse. + * @param {Number} w width of the arc's ellipse by default. + * @param {Number} h height of the arc's ellipse by default. + * @param {Number} start angle to start the arc, specified in radians. + * @param {Number} stop angle to stop the arc, specified in radians. + * @param {Constant} [mode] optional parameter to determine the way of drawing + * the arc. either CHORD, PIE, or OPEN. + * @param {Integer} [detail] optional parameter for WebGL mode only. This is to + * specify the number of vertices that makes up the + * perimeter of the arc. Default value is 25. Won't + * draw a stroke for a detail of more than 50. + * @chainable + * + * @example + *
                              + * + * arc(50, 55, 50, 50, 0, HALF_PI); + * noFill(); + * arc(50, 55, 60, 60, HALF_PI, PI); + * arc(50, 55, 70, 70, PI, PI + QUARTER_PI); + * arc(50, 55, 80, 80, PI + QUARTER_PI, TWO_PI); + * describe( + * 'A shattered outline of an ellipse with a quarter of a white circle at the bottom-right.' + * ); + * + *
                              + * + *
                              + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI); + * describe('A white ellipse with the top-right third missing. The bottom is outlined in black.'); + * + *
                              + * + *
                              + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN); + * describe( + * 'A white ellipse missing a section from the top-right. The bottom is outlined in black.' + * ); + * + *
                              + * + *
                              + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD); + * describe('A white ellipse with a black outline missing a section from the top-right.'); + * + *
                              + * + *
                              + * + * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE); + * describe('A white ellipse with a black outline. The top-right third is missing.'); + * + *
                              + * + */ + _main.default.prototype.arc = function (x, y, w, h, start, stop, mode, detail) { + _main.default._validateParameters('arc', arguments); + // if the current stroke and fill settings wouldn't result in something + // visible, exit immediately + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } + if (start === stop) { + return this; + } + start = this._toRadians(start); + stop = this._toRadians(stop); + // p5 supports negative width and heights for ellipses + w = Math.abs(w); + h = Math.abs(h); + var vals = _helpers.default.modeAdjust(x, y, w, h, this._renderer._ellipseMode); + var angles = this._normalizeArcAngles(start, stop, vals.w, vals.h, true); + if (angles.correspondToSamePoint) { + // If the arc starts and ends at (near enough) the same place, we choose to + // draw an ellipse instead. This is preferable to faking an ellipse (by + // making stop ever-so-slightly less than start + TWO_PI) because the ends + // join up to each other rather than at a vertex at the centre (leaving + // an unwanted spike in the stroke/fill). + this._renderer.ellipse([vals.x, + vals.y, + vals.w, + vals.h, + detail]); + } else { + this._renderer.arc(vals.x, vals.y, vals.w, vals.h, angles.start, // [0, TWO_PI) + angles.stop, // [start, start + TWO_PI) + mode, detail); + //accessible Outputs + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('arc', [ + vals.x, + vals.y, + vals.w, + vals.h, + angles.start, + angles.stop, + mode + ]); + } + } + return this; + }; + /** + * Draws an ellipse (oval) to the canvas. An ellipse with equal width and height + * is a circle. By default, the first two parameters set the location of the + * center of the ellipse. The third and fourth parameters set the shape's width + * and height, respectively. The origin may be changed with the + * ellipseMode() function. + * + * If no height is specified, the value of width is used for both the width and + * height. If a negative height or width is specified, the absolute value is + * taken. + * + * @method ellipse + * @param {Number} x x-coordinate of the center of the ellipse. + * @param {Number} y y-coordinate of the center of the ellipse. + * @param {Number} w width of the ellipse. + * @param {Number} [h] height of the ellipse. + * @chainable + * @example + *
                              + * + * ellipse(56, 46, 55, 55); + * describe('A white ellipse with black outline in middle of a gray canvas.'); + * + *
                              + * + */ + /** + * @method ellipse + * @param {Number} x + * @param {Number} y + * @param {Number} w + * @param {Number} h + * @param {Integer} [detail] optional parameter for WebGL mode only. This is to + * specify the number of vertices that makes up the + * perimeter of the ellipse. Default value is 25. Won't + * draw a stroke for a detail of more than 50. + */ + _main.default.prototype.ellipse = function (x, y, w, h, detailX) { + _main.default._validateParameters('ellipse', arguments); + return this._renderEllipse.apply(this, arguments); + }; + /** + * Draws a circle to the canvas. A circle is a round shape. Every point on the + * edge of a circle is the same distance from its center. By default, the first + * two parameters set the location of the center of the circle. The third + * parameter sets the shape's width and height (diameter). The origin may be + * changed with the ellipseMode() function. + * + * @method circle + * @param {Number} x x-coordinate of the center of the circle. + * @param {Number} y y-coordinate of the center of the circle. + * @param {Number} d diameter of the circle. + * @chainable + * @example + *
                              + * + * circle(30, 30, 20); + * describe('A white circle with black outline in the middle of a gray canvas.'); + * + *
                              + * + */ + _main.default.prototype.circle = function () { + _main.default._validateParameters('circle', arguments); + var args = Array.prototype.slice.call(arguments, 0, 2); + args.push(arguments[2]); + args.push(arguments[2]); + return this._renderEllipse.apply(this, _toConsumableArray(args)); + }; + // internal method for drawing ellipses (without parameter validation) + _main.default.prototype._renderEllipse = function (x, y, w, h, detailX) { + // if the current stroke and fill settings wouldn't result in something + // visible, exit immediately + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } // p5 supports negative width and heights for rects + + if (w < 0) { + w = Math.abs(w); + } + if (typeof h === 'undefined') { + // Duplicate 3rd argument if only 3 given. + h = w; + } else if (h < 0) { + h = Math.abs(h); + } + var vals = _helpers.default.modeAdjust(x, y, w, h, this._renderer._ellipseMode); + this._renderer.ellipse([vals.x, + vals.y, + vals.w, + vals.h, + detailX]); + //accessible Outputs + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('ellipse', [ + vals.x, + vals.y, + vals.w, + vals.h + ]); + } + return this; + }; + /** + * Draws a line, a straight path between two points. Its default width is one pixel. + * The version of `line()` with four parameters draws the line in 2D. To color a line, + * use the stroke() function. To change its width, use the + * strokeWeight() function. A line + * can't be filled, so the fill() function won't affect + * the color of a line. + * + * The version of `line()` with six parameters allows the line to be drawn in 3D + * space. Doing so requires adding the `WEBGL` argument to + * createCanvas(). + * + * @method line + * @param {Number} x1 the x-coordinate of the first point. + * @param {Number} y1 the y-coordinate of the first point. + * @param {Number} x2 the x-coordinate of the second point. + * @param {Number} y2 the y-coordinate of the second point. + * @chainable + * @example + *
                              + * + * line(30, 20, 85, 75); + * describe( + * 'A black line on a gray canvas running from top-center to bottom-right.' + * ); + * + *
                              + * + *
                              + * + * line(30, 20, 85, 20); + * stroke(126); + * line(85, 20, 85, 75); + * stroke(255); + * line(85, 75, 30, 75); + * describe( + * 'Three lines drawn in grayscale on a gray canvas. They form the top, right, and bottom sides of a square.' + * ); + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('A black line drawn on a gray canvas.'); + * } + * + * function draw() { + * background(220); + * line(0, 0, 0, 10, 10, 0); + * } + * + *
                              + * + */ + /** + * @method line + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 the z-coordinate of the first point. + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 the z-coordinate of the second point. + * @chainable + */ + _main.default.prototype.line = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('line', args); + if (this._renderer._doStroke) { + var _this$_renderer; + (_this$_renderer = this._renderer).line.apply(_this$_renderer, args); + } //accessible Outputs + + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('line', args); + } + return this; + }; + /** + * Draws a point, a single coordinate in space. Its default size is one pixel. The first two + * parameters are the point's x- and y-coordinates, respectively. To color a point, use + * the stroke() function. To change its size, use the + * strokeWeight() function. + * + * The version of `point()` with three parameters allows the point to be drawn in 3D + * space. Doing so requires adding the `WEBGL` argument to + * createCanvas(). + * + * The version of point() with one parameter allows the point's location to be set with + * a p5.Vector object. + * + * @method point + * @param {Number} x the x-coordinate. + * @param {Number} y the y-coordinate. + * @param {Number} [z] the z-coordinate (for WebGL mode). + * @chainable + * @example + *
                              + * + * point(30, 20); + * point(85, 20); + * point(85, 75); + * point(30, 75); + * describe( + * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' + * ); + * + *
                              + * + *
                              + * + * point(30, 20); + * point(85, 20); + * stroke('purple'); + * strokeWeight(10); + * point(85, 75); + * point(30, 75); + * describe( + * 'Four points drawn on a gray canvas. Two are black and two are purple. The points form the corners of a square.' + * ); + * + *
                              + * + *
                              + * + * let a = createVector(10, 10); + * point(a); + * let b = createVector(10, 20); + * point(b); + * let c = createVector(20, 10); + * point(c); + * let d = createVector(20, 20); + * point(d); + * describe( + * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' + * ); + * + *
                              + * + */ + /** + * @method point + * @param {p5.Vector} coordinateVector the coordinate vector. + * @chainable + */ + _main.default.prototype.point = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('point', args); + if (this._renderer._doStroke) { + if (args.length === 1 && args[0] instanceof _main.default.Vector) { + this._renderer.point.call(this._renderer, args[0].x, args[0].y, args[0].z); + } else { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).point.apply(_this$_renderer2, args); + //accessible Outputs + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('point', args); + } + } + } + return this; + }; + /** + * Draws a quad to the canvas. A quad is a quadrilateral, a four-sided + * polygon. Some examples of quads include rectangles, squares, rhombuses, + * and trapezoids. The first pair of parameters (`x1`,`y1`) sets the quad's + * first point. The following pairs of parameters set the coordinates for + * its next three points. Parameters should proceed clockwise or + * counter-clockwise around the shape. + * + * The version of `quad()` with twelve parameters allows the quad to be drawn + * in 3D space. Doing so requires adding the `WEBGL` argument to + * createCanvas(). + * + * @method quad + * @param {Number} x1 the x-coordinate of the first point. + * @param {Number} y1 the y-coordinate of the first point. + * @param {Number} x2 the x-coordinate of the second point. + * @param {Number} y2 the y-coordinate of the second point. + * @param {Number} x3 the x-coordinate of the third point. + * @param {Number} y3 the y-coordinate of the third point. + * @param {Number} x4 the x-coordinate of the fourth point. + * @param {Number} y4 the y-coordinate of the fourth point. + * @param {Integer} [detailX] number of segments in the x-direction. + * @param {Integer} [detailY] number of segments in the y-direction. + * @chainable + * @example + *
                              + * + * quad(20, 20, 80, 20, 80, 80, 20, 80); + * describe('A white square with a black outline drawn on a gray canvas.'); + * + *
                              + * + *
                              + * + * quad(20, 30, 80, 30, 80, 70, 20, 70); + * describe('A white rectangle with a black outline drawn on a gray canvas.'); + * + *
                              + * + *
                              + * + * quad(50, 62, 86, 50, 50, 38, 14, 50); + * describe('A white rhombus with a black outline drawn on a gray canvas.'); + * + *
                              + * + *
                              + * + * quad(20, 50, 80, 30, 80, 70, 20, 70); + * describe('A white trapezoid with a black outline drawn on a gray canvas.'); + * + *
                              + */ + /** + * @method quad + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 the z-coordinate of the first point. + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 the z-coordinate of the second point. + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 the z-coordinate of the third point. + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 the z-coordinate of the fourth point. + * @param {Integer} [detailX] + * @param {Integer} [detailY] + * @chainable + */ + _main.default.prototype.quad = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('quad', args); + if (this._renderer._doStroke || this._renderer._doFill) { + if (this._renderer.isP3D && args.length < 12) { + // if 3D and we weren't passed 12 args, assume Z is 0 + this._renderer.quad.call(this._renderer, args[0], args[1], 0, args[2], args[3], 0, args[4], args[5], 0, args[6], args[7], 0, args[8], args[9]); + } else { + var _this$_renderer3; + (_this$_renderer3 = this._renderer).quad.apply(_this$_renderer3, args); + //accessibile outputs + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('quadrilateral', args); + } + } + } + return this; + }; + /** + * Draws a rectangle to the canvas. A rectangle is a four-sided polygon with + * every angle at ninety degrees. By default, the first two parameters set the + * location of the rectangle's upper-left corner. The third and fourth set the + * shape's the width and height, respectively. The way these parameters are + * interpreted may be changed with the rectMode() + * function. + * + * The version of `rect()` with five parameters creates a rounded rectangle. The + * fifth parameter is used as the radius value for all four corners. + * + * The version of `rect()` with eight parameters also creates a rounded rectangle. + * When using eight parameters, the latter four set the radius of the arc at + * each corner separately. The radii start with the top-left corner and move + * clockwise around the rectangle. If any of these parameters are omitted, they + * are set to the value of the last specified corner radius. + * + * @method rect + * @param {Number} x x-coordinate of the rectangle. + * @param {Number} y y-coordinate of the rectangle. + * @param {Number} w width of the rectangle. + * @param {Number} [h] height of the rectangle. + * @param {Number} [tl] optional radius of top-left corner. + * @param {Number} [tr] optional radius of top-right corner. + * @param {Number} [br] optional radius of bottom-right corner. + * @param {Number} [bl] optional radius of bottom-left corner. + * @chainable + * @example + *
                              + * + * rect(30, 20, 55, 55); + * describe('A white rectangle with a black outline on a gray canvas.'); + * + *
                              + * + *
                              + * + * rect(30, 20, 55, 55, 20); + * describe( + * 'A white rectangle with a black outline and round edges on a gray canvas.' + * ); + * + *
                              + * + *
                              + * + * rect(30, 20, 55, 55, 20, 15, 10, 5); + * describe('A white rectangle with a black outline and round edges of different radii.'); + * + *
                              + * + */ + /** + * @method rect + * @param {Number} x + * @param {Number} y + * @param {Number} w + * @param {Number} h + * @param {Integer} [detailX] number of segments in the x-direction (for WebGL mode). + * @param {Integer} [detailY] number of segments in the y-direction (for WebGL mode). + * @chainable + */ + _main.default.prototype.rect = function () { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + _main.default._validateParameters('rect', args); + return this._renderRect.apply(this, args); + }; + /** + * Draws a square to the canvas. A square is a four-sided polygon with every + * angle at ninety degrees and equal side lengths. By default, the first two + * parameters set the location of the square's upper-left corner. The third + * parameter sets its side size. The way these parameters are interpreted may + * be changed with the rectMode() function. + * + * The version of `square()` with four parameters creates a rounded square. The + * fourth parameter is used as the radius value for all four corners. + * + * The version of `square()` with seven parameters also creates a rounded square. + * When using seven parameters, the latter four set the radius of the arc at + * each corner separately. The radii start with the top-left corner and move + * clockwise around the square. If any of these parameters are omitted, they + * are set to the value of the last specified corner radius. + * + * @method square + * @param {Number} x x-coordinate of the square. + * @param {Number} y y-coordinate of the square. + * @param {Number} s side size of the square. + * @param {Number} [tl] optional radius of top-left corner. + * @param {Number} [tr] optional radius of top-right corner. + * @param {Number} [br] optional radius of bottom-right corner. + * @param {Number} [bl] optional radius of bottom-left corner. + * @chainable + * @example + *
                              + * + * square(30, 20, 55); + * describe('A white square with a black outline in on a gray canvas.'); + * + *
                              + * + *
                              + * + * square(30, 20, 55, 20); + * describe( + * 'A white square with a black outline and round edges on a gray canvas.' + * ); + * + *
                              + * + *
                              + * + * square(30, 20, 55, 20, 15, 10, 5); + * describe('A white square with a black outline and round edges of different radii.'); + * + *
                              + * + */ + _main.default.prototype.square = function (x, y, s, tl, tr, br, bl) { + _main.default._validateParameters('square', arguments); + // duplicate width for height in case of square + return this._renderRect.call(this, x, y, s, s, tl, tr, br, bl); + }; + // internal method to have renderer draw a rectangle + _main.default.prototype._renderRect = function () { + if (this._renderer._doStroke || this._renderer._doFill) { + // duplicate width for height in case only 3 arguments is provided + if (arguments.length === 3) { + arguments[3] = arguments[2]; + } + var vals = _helpers.default.modeAdjust(arguments[0], arguments[1], arguments[2], arguments[3], this._renderer._rectMode); + var args = [ + vals.x, + vals.y, + vals.w, + vals.h + ]; + // append the additional arguments (either cornder radii, or + // segment details) to the argument list + for (var i = 4; i < arguments.length; i++) { + args[i] = arguments[i]; + } + this._renderer.rect(args); + //accessible outputs + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('rectangle', [ + vals.x, + vals.y, + vals.w, + vals.h + ]); + } + } + return this; + }; + /** + * Draws a triangle to the canvas. A triangle is a three-sided polygon. The + * first two parameters specify the triangle's first point `(x1,y1)`. The middle + * two parameters specify its second point `(x2,y2)`. And the last two parameters + * specify its third point `(x3, y3)`. + * + * @method triangle + * @param {Number} x1 x-coordinate of the first point. + * @param {Number} y1 y-coordinate of the first point. + * @param {Number} x2 x-coordinate of the second point. + * @param {Number} y2 y-coordinate of the second point. + * @param {Number} x3 x-coordinate of the third point. + * @param {Number} y3 y-coordinate of the third point. + * @chainable + * @example + *
                              + * + * triangle(30, 75, 58, 20, 86, 75); + * describe('A white triangle with a black outline on a gray canvas.'); + * + *
                              + * + */ + _main.default.prototype.triangle = function () { + for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; + } + _main.default._validateParameters('triangle', args); + if (this._renderer._doStroke || this._renderer._doFill) { + this._renderer.triangle(args); + } //accessible outputs + + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._accsOutput('triangle', args); + } + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../constants': 286, + '../friendly_errors/fes_core': 289, + '../friendly_errors/file_errors': 290, + '../friendly_errors/validate_params': 293, + '../helpers': 294, + '../main': 298, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 306: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var constants = _interopRequireWildcard(_dereq_('../constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Shape + * @submodule Attributes + * @for p5 + * @requires core + * @requires constants + */ + /** + * Modifies the location from which ellipses, circles, and arcs are drawn. By default, the + * first two parameters are the x- and y-coordinates of the shape's center. The next + * parameters are its width and height. This is equivalent to calling `ellipseMode(CENTER)`. + * + * `ellipseMode(RADIUS)` also uses the first two parameters to set the x- and y-coordinates + * of the shape's center. The next parameters are half of the shapes's width and height. + * Calling `ellipse(0, 0, 10, 15)` draws a shape with a width of 20 and height of 30. + * + * `ellipseMode(CORNER)` uses the first two parameters as the upper-left corner of the + * shape. The next parameters are its width and height. + * + * `ellipseMode(CORNERS)` uses the first two parameters as the location of one corner + * of the ellipse's bounding box. The third and fourth parameters are the location of the + * opposite corner. + * + * The argument passed to `ellipseMode()` must be written in ALL CAPS because the constants + * `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. JavaScript is a + * case-sensitive language. + * + * @method ellipseMode + * @param {Constant} mode either CENTER, RADIUS, CORNER, or CORNERS + * @chainable + * @example + *
                              + * + * ellipseMode(RADIUS); + * fill(255); + * ellipse(50, 50, 30, 30); + * ellipseMode(CENTER); + * fill(100); + * ellipse(50, 50, 30, 30); + * describe('A white circle with a gray circle at its center. Both circles have black outlines.'); + * + *
                              + * + *
                              + * + * ellipseMode(CORNER); + * fill(255); + * ellipse(25, 25, 50, 50); + * ellipseMode(CORNERS); + * fill(100); + * ellipse(25, 25, 50, 50); + * describe('A white circle with a gray circle at its top-left corner. Both circles have black outlines.'); + * + *
                              + */ + + _main.default.prototype.ellipseMode = function (m) { + _main.default._validateParameters('ellipseMode', arguments); + if (m === constants.CORNER || m === constants.CORNERS || m === constants.RADIUS || m === constants.CENTER) { + this._renderer._ellipseMode = m; + } + return this; + }; + /** + * Draws all geometry with jagged (aliased) edges. + * + * smooth() is active by default in 2D mode. It's necessary to call + * noSmooth() to disable smoothing of geometry, images, and fonts. + * + * In WebGL mode, noSmooth() is active by default. It's necessary + * to call smooth() to draw smooth (antialiased) edges. + * + * @method noSmooth + * @chainable + * @example + *
                              + * + * background(0); + * noStroke(); + * smooth(); + * ellipse(30, 48, 36, 36); + * noSmooth(); + * ellipse(70, 48, 36, 36); + * describe('Two pixelated white circles on a black background.'); + * + *
                              + */ + _main.default.prototype.noSmooth = function () { + if (!this._renderer.isP3D) { + if ('imageSmoothingEnabled' in this.drawingContext) { + this.drawingContext.imageSmoothingEnabled = false; + } + } else { + this.setAttributes('antialias', false); + } + return this; + }; + /** + * Modifies the location from which rectangles and squares are drawn. By default, + * the first two parameters are the x- and y-coordinates of the shape's upper-left + * corner. The next parameters are its width and height. This is equivalent to + * calling `rectMode(CORNER)`. + * + * `rectMode(CORNERS)` also uses the first two parameters as the location of one of + * the corners. The third and fourth parameters are the location of the opposite + * corner. + * + * `rectMode(CENTER)` uses the first two parameters as the x- and y-coordinates of + * the shape's center. The next parameters are its width and height. + * + * `rectMode(RADIUS)` also uses the first two parameters as the x- and y-coordinates + * of the shape's center. The next parameters are half of the shape's width and + * height. + * + * The argument passed to `rectMode()` must be written in ALL CAPS because the + * constants `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. + * JavaScript is a case-sensitive language. + * + * @method rectMode + * @param {Constant} mode either CORNER, CORNERS, CENTER, or RADIUS + * @chainable + * @example + *
                              + * + * rectMode(CORNER); + * fill(255); + * rect(25, 25, 50, 50); + * + * rectMode(CORNERS); + * fill(100); + * rect(25, 25, 50, 50); + * + * describe('A small gray square drawn at the top-left corner of a white square.'); + * + *
                              + * + *
                              + * + * rectMode(RADIUS); + * fill(255); + * rect(50, 50, 30, 30); + * + * rectMode(CENTER); + * fill(100); + * rect(50, 50, 30, 30); + * + * describe('A small gray square drawn at the center of a white square.'); + * + *
                              + */ + _main.default.prototype.rectMode = function (m) { + _main.default._validateParameters('rectMode', arguments); + if (m === constants.CORNER || m === constants.CORNERS || m === constants.RADIUS || m === constants.CENTER) { + this._renderer._rectMode = m; + } + return this; + }; + /** + * Draws all geometry with smooth (anti-aliased) edges. smooth() will also + * improve image quality of resized images. + * + * smooth() is active by default in 2D mode. It's necessary to call + * noSmooth() to disable smoothing of geometry, images, and fonts. + * + * In WebGL mode, noSmooth() is active by default. It's necessary + * to call smooth() to draw smooth (antialiased) edges. + * + * @method smooth + * @chainable + * @example + *
                              + * + * background(0); + * noStroke(); + * smooth(); + * ellipse(30, 48, 36, 36); + * noSmooth(); + * ellipse(70, 48, 36, 36); + * describe('Two pixelated white circles on a black background.'); + * + *
                              + */ + _main.default.prototype.smooth = function () { + this.setAttributes('antialias', true); + if (!this._renderer.isP3D) { + if ('imageSmoothingEnabled' in this.drawingContext) { + this.drawingContext.imageSmoothingEnabled = true; + } + } + return this; + }; + /** + * Sets the style for rendering line endings. These ends are either rounded + * (`ROUND`), squared (`SQUARE`), or extended (`PROJECT`). The default cap is + * `ROUND`. + * + * The argument passed to `strokeCap()` must be written in ALL CAPS because + * the constants `ROUND`, `SQUARE`, and `PROJECT` are defined this way. + * JavaScript is a case-sensitive language. + * + * @method strokeCap + * @param {Constant} cap either ROUND, SQUARE, or PROJECT + * @chainable + * @example + *
                              + * + * strokeWeight(12.0); + * strokeCap(ROUND); + * line(20, 30, 80, 30); + * strokeCap(SQUARE); + * line(20, 50, 80, 50); + * strokeCap(PROJECT); + * line(20, 70, 80, 70); + * describe('Three horizontal lines. The top line has rounded ends, the middle line has squared ends, and the bottom line has longer, squared ends.'); + * + *
                              + */ + _main.default.prototype.strokeCap = function (cap) { + _main.default._validateParameters('strokeCap', arguments); + if (cap === constants.ROUND || cap === constants.SQUARE || cap === constants.PROJECT) { + this._renderer.strokeCap(cap); + } + return this; + }; + /** + * Sets the style of the joints which connect line segments. These joints are + * either mitered (`MITER`), beveled (`BEVEL`), or rounded (`ROUND`). The default + * joint is `MITER` in 2D mode and `ROUND` in WebGL mode. + * + * The argument passed to `strokeJoin()` must be written in ALL CAPS because + * the constants `MITER`, `BEVEL`, and `ROUND` are defined this way. + * JavaScript is a case-sensitive language. + * + * @method strokeJoin + * @param {Constant} join either MITER, BEVEL, or ROUND + * @chainable + * @example + *
                              + * + * noFill(); + * strokeWeight(10.0); + * strokeJoin(MITER); + * beginShape(); + * vertex(35, 20); + * vertex(65, 50); + * vertex(35, 80); + * endShape(); + * describe('A right-facing arrowhead shape with a pointed tip in center of canvas.'); + * + *
                              + * + *
                              + * + * noFill(); + * strokeWeight(10.0); + * strokeJoin(BEVEL); + * beginShape(); + * vertex(35, 20); + * vertex(65, 50); + * vertex(35, 80); + * endShape(); + * describe('A right-facing arrowhead shape with a flat tip in center of canvas.'); + * + *
                              + * + *
                              + * + * noFill(); + * strokeWeight(10.0); + * strokeJoin(ROUND); + * beginShape(); + * vertex(35, 20); + * vertex(65, 50); + * vertex(35, 80); + * endShape(); + * describe('A right-facing arrowhead shape with a rounded tip in center of canvas.'); + * + *
                              + */ + _main.default.prototype.strokeJoin = function (join) { + _main.default._validateParameters('strokeJoin', arguments); + if (join === constants.ROUND || join === constants.BEVEL || join === constants.MITER) { + this._renderer.strokeJoin(join); + } + return this; + }; + /** + * Sets the width of the stroke used for lines, points, and the border around + * shapes. All widths are set in units of pixels. + * + * Note that `strokeWeight()` is affected by any transformation or scaling that + * has been applied previously. + * + * @method strokeWeight + * @param {Number} weight the weight of the stroke (in pixels). + * @chainable + * @example + *
                              + * + * // Default. + * line(20, 20, 80, 20); + * // Thicker. + * strokeWeight(4); + * line(20, 40, 80, 40); + * // Beastly. + * strokeWeight(10); + * line(20, 70, 80, 70); + * describe('Three horizontal black lines. The top line is thin, the middle is medium, and the bottom is thick.'); + * + *
                              + * + *
                              + * + * // Default. + * line(20, 20, 80, 20); + * // Adding scale transformation. + * scale(5); + * // Coordinates adjusted for scaling. + * line(4, 8, 16, 8); + * describe('Two horizontal black lines. The top line is thin and the bottom is five times thicker than the top.'); + * + *
                              + */ + _main.default.prototype.strokeWeight = function (w) { + _main.default._validateParameters('strokeWeight', arguments); + this._renderer.strokeWeight(w); + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../constants': 286, + '../main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 307: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + _dereq_('../friendly_errors/fes_core'); + _dereq_('../friendly_errors/file_errors'); + _dereq_('../friendly_errors/validate_params'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Shape + * @submodule Curves + * @for p5 + * @requires core + */ + /** + * Draws a cubic Bezier curve on the screen. These curves are defined by a + * series of anchor and control points. The first two parameters specify + * the first anchor point and the last two parameters specify the other + * anchor point, which become the first and last points on the curve. The + * middle parameters specify the two control points which define the shape + * of the curve. Approximately speaking, control points "pull" the curve + * towards them. + * + * Bezier curves were developed by French automotive engineer Pierre Bezier, + * and are commonly used in computer graphics to define gently sloping curves. + * See also curve(). + * + * @method bezier + * @param {Number} x1 x-coordinate for the first anchor point + * @param {Number} y1 y-coordinate for the first anchor point + * @param {Number} x2 x-coordinate for the first control point + * @param {Number} y2 y-coordinate for the first control point + * @param {Number} x3 x-coordinate for the second control point + * @param {Number} y3 y-coordinate for the second control point + * @param {Number} x4 x-coordinate for the second anchor point + * @param {Number} y4 y-coordinate for the second anchor point + * @chainable + * @example + *
                              + * + * noFill(); + * stroke(255, 102, 0); + * line(85, 20, 10, 10); + * line(90, 90, 15, 80); + * stroke(0, 0, 0); + * bezier(85, 20, 10, 10, 90, 90, 15, 80); + * + *
                              + * + *
                              + * + * background(0, 0, 0); + * noFill(); + * stroke(255); + * bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0); + * + *
                              + * + * @alt + * stretched black s-shape in center with orange lines extending from end points. + * a white colored curve on black background from the upper-right corner to the lower right corner. + */ + /** + * @method bezier + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 z-coordinate for the first anchor point + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate for the first control point + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the second control point + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 z-coordinate for the second anchor point + * @chainable + */ + + _main.default.prototype.bezier = function () { + var _this$_renderer; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('bezier', args); + // if the current stroke and fill settings wouldn't result in something + // visible, exit immediately + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + }(_this$_renderer = this._renderer).bezier.apply(_this$_renderer, args); + return this; + }; + /** + * Sets the resolution at which Bezier's curve is displayed. The default value is 20. + * + * Note, This function is only useful when using the WEBGL renderer + * as the default canvas renderer does not use this information. + * + * @method bezierDetail + * @param {Number} detail resolution of the curves + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noFill(); + * bezierDetail(5); + * } + * + * function draw() { + * background(200); + * bezier( + * -40, -40, 0, + * 90, -40, 0, + * -90, 40, 0, + * 40, 40, 0 + * ); + * } + * + *
                              + * + * @alt + * stretched black s-shape with a low level of bezier detail + */ + _main.default.prototype.bezierDetail = function (d) { + _main.default._validateParameters('bezierDetail', arguments); + this._bezierDetail = d; + return this; + }; + /** + * Given the x or y co-ordinate values of control and anchor points of a bezier + * curve, it evaluates the x or y coordinate of the bezier at position t. The + * parameters a and d are the x or y coordinates of first and last points on the + * curve while b and c are of the control points.The final parameter t is the + * position of the resultant point which is given between 0 and 1. + * This can be done once with the x coordinates and a second time + * with the y coordinates to get the location of a bezier curve at t. + * + * @method bezierPoint + * @param {Number} a coordinate of first point on the curve + * @param {Number} b coordinate of first control point + * @param {Number} c coordinate of second control point + * @param {Number} d coordinate of second point on the curve + * @param {Number} t value between 0 and 1 + * @return {Number} the value of the Bezier at position t + * @example + *
                              + * + * noFill(); + * let x1 = 85, + x2 = 10, + x3 = 90, + x4 = 15; + * let y1 = 20, + y2 = 10, + y3 = 90, + y4 = 80; + * bezier(x1, y1, x2, y2, x3, y3, x4, y4); + * fill(255); + * let steps = 10; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = bezierPoint(x1, x2, x3, x4, t); + * let y = bezierPoint(y1, y2, y3, y4, t); + * circle(x, y, 5); + * } + * + *
                              + * + * @alt + * 10 points plotted on a given bezier at equal distances. + */ + _main.default.prototype.bezierPoint = function (a, b, c, d, t) { + _main.default._validateParameters('bezierPoint', arguments); + var adjustedT = 1 - t; + return Math.pow(adjustedT, 3) * a + 3 * Math.pow(adjustedT, 2) * t * b + 3 * adjustedT * Math.pow(t, 2) * c + Math.pow(t, 3) * d; + }; + /** + * Evaluates the tangent to the Bezier at position t for points a, b, c, d. + * The parameters a and d are the first and last points + * on the curve, and b and c are the control points. + * The final parameter t varies between 0 and 1. + * + * @method bezierTangent + * @param {Number} a coordinate of first point on the curve + * @param {Number} b coordinate of first control point + * @param {Number} c coordinate of second control point + * @param {Number} d coordinate of second point on the curve + * @param {Number} t value between 0 and 1 + * @return {Number} the tangent at position t + * @example + *
                              + * + * noFill(); + * bezier(85, 20, 10, 10, 90, 90, 15, 80); + * let steps = 6; + * fill(255); + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * // Get the location of the point + * let x = bezierPoint(85, 10, 90, 15, t); + * let y = bezierPoint(20, 10, 90, 80, t); + * // Get the tangent points + * let tx = bezierTangent(85, 10, 90, 15, t); + * let ty = bezierTangent(20, 10, 90, 80, t); + * // Calculate an angle from the tangent points + * let a = atan2(ty, tx); + * a += PI; + * stroke(255, 102, 0); + * line(x, y, cos(a) * 30 + x, sin(a) * 30 + y); + * // The following line of code makes a line + * // inverse of the above line + * //line(x, y, cos(a)*-30 + x, sin(a)*-30 + y); + * stroke(0); + * ellipse(x, y, 5, 5); + * } + * + *
                              + * + *
                              + * + * noFill(); + * bezier(85, 20, 10, 10, 90, 90, 15, 80); + * stroke(255, 102, 0); + * let steps = 16; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = bezierPoint(85, 10, 90, 15, t); + * let y = bezierPoint(20, 10, 90, 80, t); + * let tx = bezierTangent(85, 10, 90, 15, t); + * let ty = bezierTangent(20, 10, 90, 80, t); + * let a = atan2(ty, tx); + * a -= HALF_PI; + * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); + * } + * + *
                              + * + * @alt + * s-shaped line with 6 short orange lines showing the tangents at those points. + * s-shaped line with 6 short orange lines showing lines coming out the underside of the bezier. + */ + _main.default.prototype.bezierTangent = function (a, b, c, d, t) { + _main.default._validateParameters('bezierTangent', arguments); + var adjustedT = 1 - t; + return 3 * d * Math.pow(t, 2) - 3 * c * Math.pow(t, 2) + 6 * c * adjustedT * t - 6 * b * adjustedT * t + 3 * b * Math.pow(adjustedT, 2) - 3 * a * Math.pow(adjustedT, 2); + }; + /** + * Draws a curved line on the screen between two points, given as the + * middle four parameters. The first two parameters are a control point, as + * if the curve came from this point even though it's not drawn. The last + * two parameters similarly describe the other control point.

                              + * Longer curves can be created by putting a series of curve() functions + * together or using curveVertex(). An additional function called + * curveTightness() provides control for the visual quality of the curve. + * The curve() function is an implementation of Catmull-Rom splines. + * + * @method curve + * @param {Number} x1 x-coordinate for the beginning control point + * @param {Number} y1 y-coordinate for the beginning control point + * @param {Number} x2 x-coordinate for the first point + * @param {Number} y2 y-coordinate for the first point + * @param {Number} x3 x-coordinate for the second point + * @param {Number} y3 y-coordinate for the second point + * @param {Number} x4 x-coordinate for the ending control point + * @param {Number} y4 y-coordinate for the ending control point + * @chainable + * @example + *
                              + * + * noFill(); + * stroke(255, 102, 0); + * curve(5, 26, 5, 26, 73, 24, 73, 61); + * stroke(0); + * curve(5, 26, 73, 24, 73, 61, 15, 65); + * stroke(255, 102, 0); + * curve(73, 24, 73, 61, 15, 65, 15, 65); + * + *
                              + * + *
                              + * + * // Define the curve points as JavaScript objects + * let p1 = { x: 5, y: 26 }; + * let p2 = { x: 73, y: 24 }; + * let p3 = { x: 73, y: 61 }; + * let p4 = { x: 15, y: 65 }; + * noFill(); + * stroke(255, 102, 0); + * curve(p1.x, p1.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); + * stroke(0); + * curve(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y); + * stroke(255, 102, 0); + * curve(p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, p4.x, p4.y); + * + *
                              + * + *
                              + * + * noFill(); + * stroke(255, 102, 0); + * curve(5, 26, 0, 5, 26, 0, 73, 24, 0, 73, 61, 0); + * stroke(0); + * curve(5, 26, 0, 73, 24, 0, 73, 61, 0, 15, 65, 0); + * stroke(255, 102, 0); + * curve(73, 24, 0, 73, 61, 0, 15, 65, 0, 15, 65, 0); + * + *
                              + * + * @alt + * horseshoe shape with orange ends facing left and black curved center. + * horseshoe shape with orange ends facing left and black curved center. + * curving black and orange lines. + */ + /** + * @method curve + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 z-coordinate for the beginning control point + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate for the first point + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the second point + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 z-coordinate for the ending control point + * @chainable + */ + _main.default.prototype.curve = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('curve', args); + if (this._renderer._doStroke) { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).curve.apply(_this$_renderer2, args); + } + return this; + }; + /** + * Sets the resolution at which curves display. The default value is 20 while + * the minimum value is 3. + * + * This function is only useful when using the WEBGL renderer + * as the default canvas renderer does not use this + * information. + * + * @method curveDetail + * @param {Number} resolution resolution of the curves + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * curveDetail(5); + * } + * function draw() { + * background(200); + * + * curve(250, 600, 0, -30, 40, 0, 30, 30, 0, -250, 600, 0); + * } + * + *
                              + * + * @alt + * white arch shape with a low level of curve detail. + */ + _main.default.prototype.curveDetail = function (d) { + _main.default._validateParameters('curveDetail', arguments); + if (d < 3) { + this._curveDetail = 3; + } else { + this._curveDetail = d; + } + return this; + }; + /** + * Modifies the quality of forms created with curve() + * and curveVertex().The parameter tightness + * determines how the curve fits to the vertex points. The value 0.0 is the + * default value for tightness (this value defines the curves to be Catmull-Rom + * splines) and the value 1.0 connects all the points with straight lines. + * Values within the range -5.0 and 5.0 will deform the curves but will leave + * them recognizable and as values increase in magnitude, they will continue to deform. + * + * @method curveTightness + * @param {Number} amount amount of deformation from the original vertices + * @chainable + * @example + *
                              + * + * // Move the mouse left and right to see the curve change + * function setup() { + * createCanvas(100, 100); + * noFill(); + * } + * + * function draw() { + * background(204); + * let t = map(mouseX, 0, width, -5, 5); + * curveTightness(t); + * beginShape(); + * curveVertex(10, 26); + * curveVertex(10, 26); + * curveVertex(83, 24); + * curveVertex(83, 61); + * curveVertex(25, 65); + * curveVertex(25, 65); + * endShape(); + * } + * + *
                              + * + * @alt + * Line shaped like right-facing arrow,points move with mouse-x and warp shape. + */ + _main.default.prototype.curveTightness = function (t) { + _main.default._validateParameters('curveTightness', arguments); + this._renderer._curveTightness = t; + return this; + }; + /** + * Evaluates the curve at position t for points a, b, c, d. + * The parameter t varies between 0 and 1, a and d are control points + * of the curve, and b and c are the start and end points of the curve. + * This can be done once with the x coordinates and a second time + * with the y coordinates to get the location of a curve at t. + * + * @method curvePoint + * @param {Number} a coordinate of first control point of the curve + * @param {Number} b coordinate of first point + * @param {Number} c coordinate of second point + * @param {Number} d coordinate of second control point + * @param {Number} t value between 0 and 1 + * @return {Number} Curve value at position t + * @example + *
                              + * + * noFill(); + * curve(5, 26, 5, 26, 73, 24, 73, 61); + * curve(5, 26, 73, 24, 73, 61, 15, 65); + * fill(255); + * ellipseMode(CENTER); + * let steps = 6; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = curvePoint(5, 5, 73, 73, t); + * let y = curvePoint(26, 26, 24, 61, t); + * ellipse(x, y, 5, 5); + * x = curvePoint(5, 73, 73, 15, t); + * y = curvePoint(26, 24, 61, 65, t); + * ellipse(x, y, 5, 5); + * } + * + *
                              + * + *line hooking down to right-bottom with 13 5×5 white ellipse points + */ + _main.default.prototype.curvePoint = function (a, b, c, d, t) { + _main.default._validateParameters('curvePoint', arguments); + var s = this._renderer._curveTightness, + t3 = t * t * t, + t2 = t * t, + f1 = (s - 1) / 2 * t3 + (1 - s) * t2 + (s - 1) / 2 * t, + f2 = (s + 3) / 2 * t3 + ( - 5 - s) / 2 * t2 + 1, + f3 = ( - 3 - s) / 2 * t3 + (s + 2) * t2 + (1 - s) / 2 * t, + f4 = (1 - s) / 2 * t3 + (s - 1) / 2 * t2; + return a * f1 + b * f2 + c * f3 + d * f4; + }; + /** + * Evaluates the tangent to the curve at position t for points a, b, c, d. + * The parameter t varies between 0 and 1, a and d are points on the curve, + * and b and c are the control points. + * + * @method curveTangent + * @param {Number} a coordinate of first control point + * @param {Number} b coordinate of first point on the curve + * @param {Number} c coordinate of second point on the curve + * @param {Number} d coordinate of second conrol point + * @param {Number} t value between 0 and 1 + * @return {Number} the tangent at position t + * @example + *
                              + * + * noFill(); + * curve(5, 26, 73, 24, 73, 61, 15, 65); + * let steps = 6; + * for (let i = 0; i <= steps; i++) { + * let t = i / steps; + * let x = curvePoint(5, 73, 73, 15, t); + * let y = curvePoint(26, 24, 61, 65, t); + * //ellipse(x, y, 5, 5); + * let tx = curveTangent(5, 73, 73, 15, t); + * let ty = curveTangent(26, 24, 61, 65, t); + * let a = atan2(ty, tx); + * a -= PI / 2.0; + * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); + * } + * + *
                              + * + * @alt + * right curving line mid-right of canvas with 7 short lines radiating from it. + */ + _main.default.prototype.curveTangent = function (a, b, c, d, t) { + _main.default._validateParameters('curveTangent', arguments); + var s = this._renderer._curveTightness, + tt3 = t * t * 3, + t2 = t * 2, + f1 = (s - 1) / 2 * tt3 + (1 - s) * t2 + (s - 1) / 2, + f2 = (s + 3) / 2 * tt3 + ( - 5 - s) / 2 * t2, + f3 = ( - 3 - s) / 2 * tt3 + (s + 2) * t2 + (1 - s) / 2, + f4 = (1 - s) / 2 * tt3 + (s - 1) / 2 * t2; + return a * f1 + b * f2 + c * f3 + d * f4; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../friendly_errors/fes_core': 289, + '../friendly_errors/file_errors': 290, + '../friendly_errors/validate_params': 293, + '../main': 298 + } + ], + 308: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.slice'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../main')); + var constants = _interopRequireWildcard(_dereq_('../constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Shape + * @submodule Vertex + * @for p5 + * @requires core + * @requires constants + */ + + var shapeKind = null; + var vertices = [ + ]; + var contourVertices = [ + ]; + var isBezier = false; + var isCurve = false; + var isQuadratic = false; + var isContour = false; + var isFirstContour = true; + /** + * Use the beginContour() and + * endContour() functions to create negative shapes + * within shapes such as the center of the letter 'O'. beginContour() + * begins recording vertices for the shape and endContour() stops recording. + * The vertices that define a negative shape must "wind" in the opposite direction + * from the exterior shape. First draw vertices for the exterior clockwise order, then for internal shapes, draw vertices + * shape in counter-clockwise. + * + * These functions can only be used within a beginShape()/endShape() pair and + * transformations such as translate(), rotate(), and scale() do not work + * within a beginContour()/endContour() pair. It is also not possible to use + * other shapes, such as ellipse() or rect() within. + * + * @method beginContour + * @chainable + * @example + *
                              + * + * translate(50, 50); + * stroke(255, 0, 0); + * beginShape(); + * // Exterior part of shape, clockwise winding + * vertex(-40, -40); + * vertex(40, -40); + * vertex(40, 40); + * vertex(-40, 40); + * // Interior part of shape, counter-clockwise winding + * beginContour(); + * vertex(-20, -20); + * vertex(-20, 20); + * vertex(20, 20); + * vertex(20, -20); + * endContour(); + * endShape(CLOSE); + * + *
                              + * + * @alt + * white rect and smaller grey rect with red outlines in center of canvas. + */ + _main.default.prototype.beginContour = function () { + if (this._renderer.isP3D) { + this._renderer.beginContour(); + } else { + contourVertices = [ + ]; + isContour = true; + } + return this; + }; + /** + * Using the beginShape() and endShape() functions allow creating more + * complex forms. beginShape() begins recording vertices for a shape and + * endShape() stops recording. The value of the kind parameter tells it which + * types of shapes to create from the provided vertices. With no mode + * specified, the shape can be any irregular polygon. + * + * The parameters available for beginShape() are: + * + * POINTS + * Draw a series of points + * + * LINES + * Draw a series of unconnected line segments (individual lines) + * + * TRIANGLES + * Draw a series of separate triangles + * + * TRIANGLE_FAN + * Draw a series of connected triangles sharing the first vertex in a fan-like fashion + * + * TRIANGLE_STRIP + * Draw a series of connected triangles in strip fashion + * + * QUADS + * Draw a series of separate quads + * + * QUAD_STRIP + * Draw quad strip using adjacent edges to form the next quad + * + * TESS (WEBGL only) + * Handle irregular polygon for filling curve by explicit tessellation + * + * After calling the beginShape() function, a series of vertex() commands must follow. To stop + * drawing the shape, call endShape(). Each shape will be outlined with the + * current stroke color and filled with the fill color. + * + * Transformations such as translate(), rotate(), and scale() do not work + * within beginShape(). It is also not possible to use other shapes, such as + * ellipse() or rect() within beginShape(). + * + * @method beginShape + * @param {Constant} [kind] either POINTS, LINES, TRIANGLES, TRIANGLE_FAN + * TRIANGLE_STRIP, QUADS, QUAD_STRIP or TESS + * @chainable + * @example + *
                              + * + * beginShape(); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(CLOSE); + * + *
                              + * + *
                              + * + * beginShape(POINTS); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(LINES); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                              + * + *
                              + * + * noFill(); + * beginShape(); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                              + * + *
                              + * + * noFill(); + * beginShape(); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(CLOSE); + * + *
                              + * + *
                              + * + * beginShape(TRIANGLES); + * vertex(30, 75); + * vertex(40, 20); + * vertex(50, 75); + * vertex(60, 20); + * vertex(70, 75); + * vertex(80, 20); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(TRIANGLE_STRIP); + * vertex(30, 75); + * vertex(40, 20); + * vertex(50, 75); + * vertex(60, 20); + * vertex(70, 75); + * vertex(80, 20); + * vertex(90, 75); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(TRIANGLE_FAN); + * vertex(57.5, 50); + * vertex(57.5, 15); + * vertex(92, 50); + * vertex(57.5, 85); + * vertex(22, 50); + * vertex(57.5, 15); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(QUADS); + * vertex(30, 20); + * vertex(30, 75); + * vertex(50, 75); + * vertex(50, 20); + * vertex(65, 20); + * vertex(65, 75); + * vertex(85, 75); + * vertex(85, 20); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(QUAD_STRIP); + * vertex(30, 20); + * vertex(30, 75); + * vertex(50, 20); + * vertex(50, 75); + * vertex(65, 20); + * vertex(65, 75); + * vertex(85, 20); + * vertex(85, 75); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(TESS); + * vertex(20, 20); + * vertex(80, 20); + * vertex(80, 40); + * vertex(40, 40); + * vertex(40, 60); + * vertex(80, 60); + * vertex(80, 80); + * vertex(20, 80); + * endShape(CLOSE); + * + *
                              + * + * @alt + * white square-shape with black outline in middle-right of canvas. + * 4 black points in a square shape in middle-right of canvas. + * 2 horizontal black lines. In the top-right and bottom-right of canvas. + * 3 line shape with horizontal on top, vertical in middle and horizontal bottom. + * square line shape in middle-right of canvas. + * 2 white triangle shapes mid-right canvas. left one pointing up and right down. + * 5 horizontal interlocking and alternating white triangles in mid-right canvas. + * 4 interlocking white triangles in 45 degree rotated square-shape. + * 2 white rectangle shapes in mid-right canvas. Both 20×55. + * 3 side-by-side white rectangles center rect is smaller in mid-right canvas. + * Thick white l-shape with black outline mid-top-left of canvas. + */ + _main.default.prototype.beginShape = function (kind) { + _main.default._validateParameters('beginShape', arguments); + if (this._renderer.isP3D) { + var _this$_renderer; + (_this$_renderer = this._renderer).beginShape.apply(_this$_renderer, arguments); + } else { + if (kind === constants.POINTS || kind === constants.LINES || kind === constants.TRIANGLES || kind === constants.TRIANGLE_FAN || kind === constants.TRIANGLE_STRIP || kind === constants.QUADS || kind === constants.QUAD_STRIP) { + shapeKind = kind; + } else { + shapeKind = null; + } + vertices = [ + ]; + contourVertices = [ + ]; + } + return this; + }; + /** + * Specifies vertex coordinates for Bezier curves. Each call to + * bezierVertex() defines the position of two control points and + * one anchor point of a Bezier curve, adding a new segment to a + * line or shape. For WebGL mode bezierVertex() can be used in 2D + * as well as 3D mode. 2D mode expects 6 parameters, while 3D mode + * expects 9 parameters (including z coordinates). + * + * The first time bezierVertex() is used within a beginShape() + * call, it must be prefaced with a call to vertex() to set the first anchor + * point. This function must be used between beginShape() and endShape() + * and only when there is no MODE or POINTS parameter specified to + * beginShape(). + * + * @method bezierVertex + * @param {Number} x2 x-coordinate for the first control point + * @param {Number} y2 y-coordinate for the first control point + * @param {Number} x3 x-coordinate for the second control point + * @param {Number} y3 y-coordinate for the second control point + * @param {Number} x4 x-coordinate for the anchor point + * @param {Number} y4 y-coordinate for the anchor point + * @chainable + * + * @example + *
                              + * + * noFill(); + * beginShape(); + * vertex(30, 20); + * bezierVertex(80, 0, 80, 75, 30, 75); + * endShape(); + * + *
                              + * + *
                              + * + * beginShape(); + * vertex(30, 20); + * bezierVertex(80, 0, 80, 75, 30, 75); + * bezierVertex(50, 80, 60, 25, 30, 20); + * endShape(); + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * } + * function draw() { + * orbitControl(); + * background(50); + * strokeWeight(4); + * stroke(255); + * point(-25, 30); + * point(25, 30); + * point(25, -30); + * point(-25, -30); + * + * strokeWeight(1); + * noFill(); + * + * beginShape(); + * vertex(-25, 30); + * bezierVertex(25, 30, 25, -30, -25, -30); + * endShape(); + * + * beginShape(); + * vertex(-25, 30, 20); + * bezierVertex(25, 30, 20, 25, -30, 20, -25, -30, 20); + * endShape(); + * } + * + *
                              + * + * @alt + * crescent-shaped line in middle of canvas. Points facing left. + * white crescent shape in middle of canvas. Points facing left. + * crescent shape in middle of canvas with another crescent shape on positive z-axis. + */ + /** + * @method bezierVertex + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate for the first control point (for WebGL mode) + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the second control point (for WebGL mode) + * @param {Number} x4 + * @param {Number} y4 + * @param {Number} z4 z-coordinate for the anchor point (for WebGL mode) + * @chainable + */ + _main.default.prototype.bezierVertex = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('bezierVertex', args); + if (this._renderer.isP3D) { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).bezierVertex.apply(_this$_renderer2, args); + } else { + if (vertices.length === 0) { + _main.default._friendlyError('vertex() must be used once before calling bezierVertex()', 'bezierVertex'); + } else { + isBezier = true; + var vert = [ + ]; + for (var i = 0; i < args.length; i++) { + vert[i] = args[i]; + } + vert.isVert = false; + if (isContour) { + contourVertices.push(vert); + } else { + vertices.push(vert); + } + } + } + return this; + }; + /** + * Specifies vertex coordinates for curves. This function may only + * be used between beginShape() and endShape() and only when there + * is no MODE parameter specified to beginShape(). + * For WebGL mode curveVertex() can be used in 2D as well as 3D mode. + * 2D mode expects 2 parameters, while 3D mode expects 3 parameters. + * + * The first and last points in a series of curveVertex() lines will be used to + * guide the beginning and end of the curve. A minimum of four + * points is required to draw a tiny curve between the second and + * third points. Adding a fifth point with curveVertex() will draw + * the curve between the second, third, and fourth points. The + * curveVertex() function is an implementation of Catmull-Rom + * splines. + * + * @method curveVertex + * @param {Number} x x-coordinate of the vertex + * @param {Number} y y-coordinate of the vertex + * @chainable + * @example + *
                              + * + * strokeWeight(5); + * point(84, 91); + * point(68, 19); + * point(21, 17); + * point(32, 91); + * strokeWeight(1); + * + * noFill(); + * beginShape(); + * curveVertex(84, 91); + * curveVertex(84, 91); + * curveVertex(68, 19); + * curveVertex(21, 17); + * curveVertex(32, 91); + * curveVertex(32, 91); + * endShape(); + * + *
                              + * + * @alt + * Upside-down u-shape line, mid canvas. left point extends beyond canvas view. + */ + /** + * @method curveVertex + * @param {Number} x + * @param {Number} y + * @param {Number} [z] z-coordinate of the vertex (for WebGL mode) + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * } + * function draw() { + * orbitControl(); + * background(50); + * strokeWeight(4); + * stroke(255); + * + * point(-25, 25); + * point(-25, 25); + * point(-25, -25); + * point(25, -25); + * point(25, 25); + * point(25, 25); + * + * strokeWeight(1); + * noFill(); + * + * beginShape(); + * curveVertex(-25, 25); + * curveVertex(-25, 25); + * curveVertex(-25, -25); + * curveVertex(25, -25); + * curveVertex(25, 25); + * curveVertex(25, 25); + * endShape(); + * + * beginShape(); + * curveVertex(-25, 25, 20); + * curveVertex(-25, 25, 20); + * curveVertex(-25, -25, 20); + * curveVertex(25, -25, 20); + * curveVertex(25, 25, 20); + * curveVertex(25, 25, 20); + * endShape(); + * } + * + *
                              + * + * @alt + * Upside-down u-shape line, mid canvas with the same shape in positive z-axis. + */ + _main.default.prototype.curveVertex = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('curveVertex', args); + if (this._renderer.isP3D) { + var _this$_renderer3; + (_this$_renderer3 = this._renderer).curveVertex.apply(_this$_renderer3, args); + } else { + isCurve = true; + this.vertex(args[0], args[1]); + } + return this; + }; + /** + * Use the beginContour() and endContour() functions to create negative + * shapes within shapes such as the center of the letter 'O'. beginContour() + * begins recording vertices for the shape and endContour() stops recording. + * The vertices that define a negative shape must "wind" in the opposite + * direction from the exterior shape. First draw vertices for the exterior + * clockwise order, then for internal shapes, draw vertices + * shape in counter-clockwise. + * + * These functions can only be used within a beginShape()/endShape() pair and + * transformations such as translate(), rotate(), and scale() do not work + * within a beginContour()/endContour() pair. It is also not possible to use + * other shapes, such as ellipse() or rect() within. + * + * @method endContour + * @chainable + * @example + *
                              + * + * translate(50, 50); + * stroke(255, 0, 0); + * beginShape(); + * // Exterior part of shape, clockwise winding + * vertex(-40, -40); + * vertex(40, -40); + * vertex(40, 40); + * vertex(-40, 40); + * // Interior part of shape, counter-clockwise winding + * beginContour(); + * vertex(-20, -20); + * vertex(-20, 20); + * vertex(20, 20); + * vertex(20, -20); + * endContour(); + * endShape(CLOSE); + * + *
                              + * + * @alt + * white rect and smaller grey rect with red outlines in center of canvas. + */ + _main.default.prototype.endContour = function () { + if (this._renderer.isP3D) { + return this; + } + var vert = contourVertices[0].slice(); // copy all data + vert.isVert = contourVertices[0].isVert; + vert.moveTo = false; + contourVertices.push(vert); + // prevent stray lines with multiple contours + if (isFirstContour) { + vertices.push(vertices[0]); + isFirstContour = false; + } + for (var i = 0; i < contourVertices.length; i++) { + vertices.push(contourVertices[i]); + } + return this; + }; + /** + * The endShape() function is the companion to beginShape() and may only be + * called after beginShape(). When endShape() is called, all of the image + * data defined since the previous call to beginShape() is written into the image + * buffer. The constant CLOSE is the value for the `mode` parameter to close + * the shape (to connect the beginning and the end). + * When using instancing with endShape() the instancing will not apply to the strokes. + * When the count parameter is used with a value greater than 1, it enables instancing for shapes built when in WEBGL mode. Instancing + * is a feature that allows the GPU to efficiently draw multiples of the same shape. It's often used for particle effects or other + * times when you need a lot of repetition. In order to take advantage of instancing, you will also need to write your own custom + * shader using the gl_InstanceID keyword. You can read more about instancing + * here or by working from the example on this + * page. + * + * @method endShape + * @param {Constant} [mode] use CLOSE to close the shape + * @param {Integer} [count] number of times you want to draw/instance the shape (for WebGL mode). + * @chainable + * @example + *
                              + * + * noFill(); + * + * beginShape(); + * vertex(20, 20); + * vertex(45, 20); + * vertex(45, 80); + * endShape(CLOSE); + * + * beginShape(); + * vertex(50, 20); + * vertex(75, 20); + * vertex(75, 80); + * endShape(); + * + *
                              + * + * @example + *
                              + * + * let fx; + * let vs = `#version 300 es + * + * precision mediump float; + * + * in vec3 aPosition; + * flat out int instanceID; + * + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * + * void main() { + * + * // copy the instance ID to the fragment shader + * instanceID = gl_InstanceID; + * vec4 positionVec4 = vec4(aPosition, 1.0); + * + * // gl_InstanceID represents a numeric value for each instance + * // using gl_InstanceID allows us to move each instance separately + * // here we move each instance horizontally by id * 40 + * float xOffset = float(gl_InstanceID) * 40.0; + * + * // apply the offset to the final position + * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4 - + * vec4(xOffset, 0.0, 0.0, 0.0); + * } + * `; + * let fs = `#version 300 es + * + * precision mediump float; + * + * out vec4 outColor; + * flat in int instanceID; + * uniform float numInstances; + * + * void main() { + * vec4 red = vec4(1.0, 0.0, 0.0, 1.0); + * vec4 blue = vec4(0.0, 0.0, 1.0, 1.0); + * + * // Normalize the instance id + * float normId = float(instanceID) / numInstances; + * + * // Mix between two colors using the normalized instance id + * outColor = mix(red, blue, normId); + * } + * `; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * fx = createShader(vs, fs); + * } + * + * function draw() { + * background(220); + * + * // strokes aren't instanced, and are rather used for debug purposes + * shader(fx); + * fx.setUniform('numInstances', 4); + * + * // this doesn't have to do with instancing, this is just for centering the squares + * translate(25, -10); + * + * // here we draw the squares we want to instance + * beginShape(); + * vertex(0, 0); + * vertex(0, 20); + * vertex(20, 20); + * vertex(20, 0); + * vertex(0, 0); + * endShape(CLOSE, 4); + * + * resetShader(); + * } + * + *
                              + * + * @alt + * Triangle line shape with smallest interior angle on bottom and upside-down L. + */ + _main.default.prototype.endShape = function (mode) { + var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + _main.default._validateParameters('endShape', arguments); + if (count < 1) { + console.log('🌸 p5.js says: You can not have less than one instance'); + count = 1; + } + if (this._renderer.isP3D) { + this._renderer.endShape(mode, isCurve, isBezier, isQuadratic, isContour, shapeKind, count); + } else { + if (count !== 1) { + console.log('🌸 p5.js says: Instancing is only supported in WebGL2 mode'); + } + if (vertices.length === 0) { + return this; + } + if (!this._renderer._doStroke && !this._renderer._doFill) { + return this; + } + var closeShape = mode === constants.CLOSE; + // if the shape is closed, the first element is also the last element + if (closeShape && !isContour) { + vertices.push(vertices[0]); + } + this._renderer.endShape(mode, vertices, isCurve, isBezier, isQuadratic, isContour, shapeKind); + // Reset some settings + isCurve = false; + isBezier = false; + isQuadratic = false; + isContour = false; + isFirstContour = true; + // If the shape is closed, the first element was added as last element. + // We must remove it again to prevent the list of vertices from growing + // over successive calls to endShape(CLOSE) + if (closeShape) { + vertices.pop(); + } + } + return this; + }; + /** + * Specifies vertex coordinates for quadratic Bezier curves. Each call to + * quadraticVertex() defines the position of one control points and one + * anchor point of a Bezier curve, adding a new segment to a line or shape. + * The first time quadraticVertex() is used within a beginShape() call, it + * must be prefaced with a call to vertex() to set the first anchor point. + * For WebGL mode quadraticVertex() can be used in 2D as well as 3D mode. + * 2D mode expects 4 parameters, while 3D mode expects 6 parameters + * (including z coordinates). + * + * This function must be used between beginShape() and endShape() + * and only when there is no MODE or POINTS parameter specified to + * beginShape(). + * + * @method quadraticVertex + * @param {Number} cx x-coordinate for the control point + * @param {Number} cy y-coordinate for the control point + * @param {Number} x3 x-coordinate for the anchor point + * @param {Number} y3 y-coordinate for the anchor point + * @chainable + * + * @example + *
                              + * + * strokeWeight(5); + * point(20, 20); + * point(80, 20); + * point(50, 50); + * + * noFill(); + * strokeWeight(1); + * beginShape(); + * vertex(20, 20); + * quadraticVertex(80, 20, 50, 50); + * endShape(); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * point(20, 20); + * point(80, 20); + * point(50, 50); + * + * point(20, 80); + * point(80, 80); + * point(80, 60); + * + * noFill(); + * strokeWeight(1); + * beginShape(); + * vertex(20, 20); + * quadraticVertex(80, 20, 50, 50); + * quadraticVertex(20, 80, 80, 80); + * vertex(80, 60); + * endShape(); + * + *
                              + * + * @alt + * arched-shaped black line with 4 pixel thick stroke weight. + * backwards s-shaped black line with 4 pixel thick stroke weight. + */ + /** + * @method quadraticVertex + * @param {Number} cx + * @param {Number} cy + * @param {Number} cz z-coordinate for the control point (for WebGL mode) + * @param {Number} x3 + * @param {Number} y3 + * @param {Number} z3 z-coordinate for the anchor point (for WebGL mode) + * @chainable + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * } + * function draw() { + * orbitControl(); + * background(50); + * strokeWeight(4); + * stroke(255); + * + * point(-35, -35); + * point(35, -35); + * point(0, 0); + * point(-35, 35); + * point(35, 35); + * point(35, 10); + * + * strokeWeight(1); + * noFill(); + * + * beginShape(); + * vertex(-35, -35); + * quadraticVertex(35, -35, 0, 0); + * quadraticVertex(-35, 35, 35, 35); + * vertex(35, 10); + * endShape(); + * + * beginShape(); + * vertex(-35, -35, 20); + * quadraticVertex(35, -35, 20, 0, 0, 20); + * quadraticVertex(-35, 35, 20, 35, 35, 20); + * vertex(35, 10, 20); + * endShape(); + * } + * + *
                              + * + * @alt + * backwards s-shaped black line with the same s-shaped line in positive z-axis. + */ + _main.default.prototype.quadraticVertex = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('quadraticVertex', args); + if (this._renderer.isP3D) { + var _this$_renderer4; + (_this$_renderer4 = this._renderer).quadraticVertex.apply(_this$_renderer4, args); + } else { + //if we're drawing a contour, put the points into an + // array for inside drawing + if (this._contourInited) { + var pt = { + }; + pt.x = args[0]; + pt.y = args[1]; + pt.x3 = args[2]; + pt.y3 = args[3]; + pt.type = constants.QUADRATIC; + this._contourVertices.push(pt); + return this; + } + if (vertices.length > 0) { + isQuadratic = true; + var vert = [ + ]; + for (var i = 0; i < args.length; i++) { + vert[i] = args[i]; + } + vert.isVert = false; + if (isContour) { + contourVertices.push(vert); + } else { + vertices.push(vert); + } + } else { + _main.default._friendlyError('vertex() must be used once before calling quadraticVertex()', 'quadraticVertex'); + } + } + return this; + }; + /** + * All shapes are constructed by connecting a series of vertices. vertex() + * is used to specify the vertex coordinates for points, lines, triangles, + * quads, and polygons. It is used exclusively within the beginShape() and + * endShape() functions. + * + * @method vertex + * @param {Number} x x-coordinate of the vertex + * @param {Number} y y-coordinate of the vertex + * @chainable + * @example + *
                              + * + * strokeWeight(3); + * beginShape(POINTS); + * vertex(30, 20); + * vertex(85, 20); + * vertex(85, 75); + * vertex(30, 75); + * endShape(); + * + *
                              + * + *
                              + * + * createCanvas(100, 100, WEBGL); + * background(240, 240, 240); + * fill(237, 34, 93); + * noStroke(); + * beginShape(); + * vertex(0, 35); + * vertex(35, 0); + * vertex(0, -35); + * vertex(-35, 0); + * endShape(); + * + *
                              + * + *
                              + * + * createCanvas(100, 100, WEBGL); + * background(240, 240, 240); + * fill(237, 34, 93); + * noStroke(); + * beginShape(); + * vertex(-10, 10); + * vertex(0, 35); + * vertex(10, 10); + * vertex(35, 0); + * vertex(10, -8); + * vertex(0, -35); + * vertex(-10, -8); + * vertex(-35, 0); + * endShape(); + * + *
                              + * + *
                              + * + * strokeWeight(3); + * stroke(237, 34, 93); + * beginShape(LINES); + * vertex(10, 35); + * vertex(90, 35); + * vertex(10, 65); + * vertex(90, 65); + * vertex(35, 10); + * vertex(35, 90); + * vertex(65, 10); + * vertex(65, 90); + * endShape(); + * + *
                              + * + *
                              + * + * // Click to change the number of sides. + * // In WebGL mode, custom shapes will only + * // display hollow fill sections when + * // all calls to vertex() use the same z-value. + * + * let sides = 3; + * let angle, px, py; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * fill(237, 34, 93); + * strokeWeight(3); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateZ(frameCount * 0.01); + * ngon(sides, 0, 0, 80); + * } + * + * function mouseClicked() { + * if (sides > 6) { + * sides = 3; + * } else { + * sides++; + * } + * } + * + * function ngon(n, x, y, d) { + * beginShape(TESS); + * for (let i = 0; i < n + 1; i++) { + * angle = TWO_PI / n * i; + * px = x + sin(angle) * d / 2; + * py = y - cos(angle) * d / 2; + * vertex(px, py, 0); + * } + * for (let i = 0; i < n + 1; i++) { + * angle = TWO_PI / n * i; + * px = x + sin(angle) * d / 4; + * py = y - cos(angle) * d / 4; + * vertex(px, py, 0); + * } + * endShape(); + * } + * + *
                              + * @alt + * 4 black points in a square shape in middle-right of canvas. + * 4 points making a diamond shape. + * 8 points making a star. + * 8 points making 4 lines. + * A rotating 3D shape with a hollow section in the middle. + */ + /** + * @method vertex + * @param {Number} x + * @param {Number} y + * @param {Number} [z] z-coordinate of the vertex. + * Defaults to 0 if not specified. + * @chainable + */ + /** + * @method vertex + * @param {Number} x + * @param {Number} y + * @param {Number} [z] + * @param {Number} [u] the vertex's texture u-coordinate + * @param {Number} [v] the vertex's texture v-coordinate + * @chainable + */ + _main.default.prototype.vertex = function (x, y, moveTo, u, v) { + if (this._renderer.isP3D) { + var _this$_renderer5; + (_this$_renderer5 = this._renderer).vertex.apply(_this$_renderer5, arguments); + } else { + var vert = [ + ]; + vert.isVert = true; + vert[0] = x; + vert[1] = y; + vert[2] = 0; + vert[3] = 0; + vert[4] = 0; + vert[5] = this._renderer._getFill(); + vert[6] = this._renderer._getStroke(); + if (moveTo) { + vert.moveTo = moveTo; + } + if (isContour) { + if (contourVertices.length === 0) { + vert.moveTo = true; + } + contourVertices.push(vert); + } else { + vertices.push(vert); + } + } + return this; + }; + /** + * Sets the 3d vertex normal to use for subsequent vertices drawn with + * vertex(). A normal is a vector that is generally + * nearly perpendicular to a shape's surface which controls how much light will + * be reflected from that part of the surface. + * + * @method normal + * @param {Vector} vector A p5.Vector representing the vertex normal. + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * } + * + * function draw() { + * background(255); + * rotateY(frameCount / 100); + * normalMaterial(); + * beginShape(TRIANGLE_STRIP); + * normal(-0.4, 0.4, 0.8); + * vertex(-30, 30, 0); + * + * normal(0, 0, 1); + * vertex(-30, -30, 30); + * vertex(30, 30, 30); + * + * normal(0.4, -0.4, 0.8); + * vertex(30, -30, 0); + * endShape(); + * } + * + *
                              + */ + /** + * @method normal + * @param {Number} x The x component of the vertex normal. + * @param {Number} y The y component of the vertex normal. + * @param {Number} z The z component of the vertex normal. + * @chainable + */ + _main.default.prototype.normal = function (x, y, z) { + var _this$_renderer6; + this._assert3d('normal'); + _main.default._validateParameters('normal', arguments); + (_this$_renderer6 = this._renderer).normal.apply(_this$_renderer6, arguments); + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../constants': 286, + '../main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 309: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } // requestAnim shim layer by Paul Irish + // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + // http://my.opera.com/emoller/blog/2011/12/20/ + // requestanimationframe-for-smart-er-animating + // requestAnimationFrame polyfill by Erik Möller + // fixes from Paul Irish and Tino Zijdel + + window.requestAnimationFrame = function () { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) { + // should '60' here be framerate? + window.setTimeout(callback, 1000 / 60); + }; + }(); + /** + * shim for Uint8ClampedArray.slice + * (allows arrayCopy to work with pixels[]) + * with thanks to http://halfpapstudios.com/blog/tag/html5-canvas/ + * Enumerable set to false to protect for...in from + * Uint8ClampedArray.prototype pollution. + */ + (function () { + if (typeof Uint8ClampedArray !== 'undefined' && !Uint8ClampedArray.prototype.slice) { + Object.defineProperty(Uint8ClampedArray.prototype, 'slice', { + value: Array.prototype.slice, + writable: true, + configurable: true, + enumerable: false + }); + } + }) (); + /** + * this is implementation of Object.assign() which is unavailable in + * IE11 and (non-Chrome) Android browsers. + * The assign() method is used to copy the values of all enumerable + * own properties from one or more source objects to a target object. + * It will return the target object. + * Modified from https://github.com/ljharb/object.assign + */ + (function () { + if (!Object.assign) { + var keys = Object.keys; + var defineProperty = Object.defineProperty; + var canBeObject = function canBeObject(obj) { + return typeof obj !== 'undefined' && obj !== null; + }; + var hasSymbols = typeof Symbol === 'function' && _typeof(Symbol()) === 'symbol'; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + var isEnumerableOn = function isEnumerableOn(obj) { + return function isEnumerable(prop) { + return propIsEnumerable.call(obj, prop); + }; + }; + // per ES6 spec, this function has to have a length of 2 + var assignShim = function assign(target, source1) { + if (!canBeObject(target)) { + throw new TypeError('target must be an object'); + } + var objTarget = Object(target); + var s, + source, + i, + props; + for (s = 1; s < arguments.length; ++s) { + source = Object(arguments[s]); + props = keys(source); + if (hasSymbols && Object.getOwnPropertySymbols) { + var _props; + (_props = props).push.apply(_props, _toConsumableArray(Object.getOwnPropertySymbols(source).filter(isEnumerableOn(source)))); + } + for (i = 0; i < props.length; ++i) { + objTarget[props[i]] = source[props[i]]; + } + } + return objTarget; + }; + defineProperty(Object, 'assign', { + value: assignShim, + configurable: true, + enumerable: false, + writable: true + }); + } + }) (); + }, + { + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.assign': 194, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-clamped-array': 253, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 310: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.assign'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Structure + * @submodule Structure + * @for p5 + * @requires core + */ + /** + * Stops p5.js from continuously executing the code within draw(). + * If loop() is called, the code in draw() + * begins to run continuously again. If using noLoop() + * in setup(), it should be the last line inside the block. + * + * When noLoop() is used, it's not possible to manipulate + * or access the screen inside event handling functions such as + * mousePressed() or + * keyPressed(). Instead, use those functions to + * call redraw() or loop(), + * which will run draw(), which can update the screen + * properly. This means that when noLoop() has been + * called, no drawing can happen, and functions like saveFrames() + * or loadPixels() may not be used. + * + * Note that if the sketch is resized, redraw() will + * be called to update the sketch, even after noLoop() + * has been specified. Otherwise, the sketch would enter an odd state until + * loop() was called. + * + * Use isLooping() to check the current state of loop(). + * + * @method noLoop + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * noLoop(); + * } + + * function draw() { + * line(10, 10, 90, 90); + * } + * + *
                              + * + *
                              + * + * let x = 0; + * function setup() { + * createCanvas(100, 100); + * } + * + * function draw() { + * background(204); + * x = x + 0.1; + * if (x > width) { + * x = 0; + * } + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * noLoop(); + * } + * + * function mouseReleased() { + * loop(); + * } + * + *
                              + * + * @alt + * 113 pixel long line extending from top-left to bottom right of canvas. + * horizontal line moves slowly from left. Loops but stops on mouse press. + */ + + _main.default.prototype.noLoop = function () { + this._loop = false; + }; + /** + * By default, p5.js loops through draw() continuously, executing the code within + * it. However, the draw() loop may be stopped by calling + * noLoop(). In that case, the draw() + * loop can be resumed with loop(). + * + * Avoid calling loop() from inside setup(). + * + * Use isLooping() to check the current state of loop(). + * + * @method loop + * @example + *
                              + * + * let x = 0; + * function setup() { + * createCanvas(100, 100); + * noLoop(); + * } + * + * function draw() { + * background(204); + * x = x + 0.1; + * if (x > width) { + * x = 0; + * } + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * loop(); + * } + * + * function mouseReleased() { + * noLoop(); + * } + * + *
                              + * + * @alt + * horizontal line moves slowly from left. Loops but stops on mouse press. + */ + _main.default.prototype.loop = function () { + if (!this._loop) { + this._loop = true; + if (this._setupDone) { + this._draw(); + } + } + }; + /** + * By default, p5.js loops through draw() continuously, + * executing the code within it. If the sketch is stopped with + * noLoop() or resumed with loop(), + * isLooping() returns the current state for use within custom event handlers. + * + * @method isLooping + * @returns {boolean} + * @example + *
                              + * + * let checkbox, button, colBG, colFill; + * + * function setup() { + * createCanvas(100, 100); + * + * button = createButton('Colorize if loop()'); + * button.position(0, 120); + * button.mousePressed(changeBG); + * + * checkbox = createCheckbox('loop()', true); + * checkbox.changed(checkLoop); + * + * colBG = color(0); + * colFill = color(255); + * } + * + * function changeBG() { + * if (isLooping()) { + * colBG = color(random(255), random(255), random(255)); + * colFill = color(random(255), random(255), random(255)); + * } + * } + * + * function checkLoop() { + * if (this.checked()) { + * loop(); + * } else { + * noLoop(); + * } + * } + * + * function draw() { + * background(colBG); + * fill(colFill); + * ellipse(frameCount % width, height / 2, 50); + * } + * + *
                              + * + * @alt + * Ellipse moves slowly from left. Checkbox toggles loop()/noLoop(). + * Button colorizes sketch if isLooping(). + * + */ + _main.default.prototype.isLooping = function () { + return this._loop; + }; + /** + * The push() function saves the current drawing style + * settings and transformations, while pop() restores these + * settings. Note that these functions are always used together. They allow you to + * change the style and transformation settings and later return to what you had. + * When a new state is started with push(), it builds on + * the current style and transform information. The push() + * and pop() functions can be embedded to provide more + * control. (See the second example for a demonstration.) + * + * push() stores information related to the current transformation state + * and style settings controlled by the following functions: + * fill(), + * noFill(), + * noStroke(), + * stroke(), + * tint(), + * noTint(), + * strokeWeight(), + * strokeCap(), + * strokeJoin(), + * imageMode(), + * rectMode(), + * ellipseMode(), + * colorMode(), + * textAlign(), + * textFont(), + * textSize(), + * textLeading(), + * applyMatrix(), + * resetMatrix(), + * rotate(), + * scale(), + * shearX(), + * shearY(), + * translate(), + * noiseSeed(). + * + * In WEBGL mode additional style settings are stored. These are controlled by the + * following functions: setCamera(), + * ambientLight(), + * directionalLight(), + * pointLight(), texture(), + * specularMaterial(), + * shininess(), + * normalMaterial() + * and shader(). + * + * @method push + * @example + *
                              + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * strokeWeight(10); + * fill(204, 153, 0); + * translate(50, 0); + * ellipse(0, 50, 33, 33); // Middle circle + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                              + * + *
                              + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * strokeWeight(10); + * fill(204, 153, 0); + * ellipse(33, 50, 33, 33); // Left-middle circle + * + * push(); // Start another new drawing state + * stroke(0, 102, 153); + * ellipse(66, 50, 33, 33); // Right-middle circle + * pop(); // Restore previous state + * + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                              + * + * @alt + * Gold ellipse + thick black outline @center 2 white ellipses on left and right. + * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. + */ + _main.default.prototype.push = function () { + this._styles.push({ + props: { + _colorMode: this._colorMode + }, + renderer: this._renderer.push() + }); + }; + /** + * The push() function saves the current drawing style + * settings and transformations, while pop() restores + * these settings. Note that these functions are always used together. They allow + * you to change the style and transformation settings and later return to what + * you had. When a new state is started with push(), it + * builds on the current style and transform information. The push() + * and pop() functions can be embedded to provide more + * control. (See the second example for a demonstration.) + * + * push() stores information related to the current transformation state + * and style settings controlled by the following functions: + * fill(), + * noFill(), + * noStroke(), + * stroke(), + * tint(), + * noTint(), + * strokeWeight(), + * strokeCap(), + * strokeJoin(), + * imageMode(), + * rectMode(), + * ellipseMode(), + * colorMode(), + * textAlign(), + * textFont(), + * textSize(), + * textLeading(), + * applyMatrix(), + * resetMatrix(), + * rotate(), + * scale(), + * shearX(), + * shearY(), + * translate(), + * noiseSeed(). + * + * In WEBGL mode additional style settings are stored. These are controlled by + * the following functions: + * setCamera(), + * ambientLight(), + * directionalLight(), + * pointLight(), + * texture(), + * specularMaterial(), + * shininess(), + * normalMaterial() and + * shader(). + * + * @method pop + * @example + *
                              + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * translate(50, 0); + * strokeWeight(10); + * fill(204, 153, 0); + * ellipse(0, 50, 33, 33); // Middle circle + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                              + * + *
                              + * + * ellipse(0, 50, 33, 33); // Left circle + * + * push(); // Start a new drawing state + * strokeWeight(10); + * fill(204, 153, 0); + * ellipse(33, 50, 33, 33); // Left-middle circle + * + * push(); // Start another new drawing state + * stroke(0, 102, 153); + * ellipse(66, 50, 33, 33); // Right-middle circle + * pop(); // Restore previous state + * + * pop(); // Restore original state + * + * ellipse(100, 50, 33, 33); // Right circle + * + *
                              + * + * @alt + * Gold ellipse + thick black outline @center 2 white ellipses on left and right. + * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. + */ + _main.default.prototype.pop = function () { + var style = this._styles.pop(); + if (style) { + this._renderer.pop(style.renderer); + Object.assign(this, style.props); + } else { + console.warn('pop() was called without matching push()'); + } + }; + /** + * Executes the code within draw() one time. This + * function allows the program to update the display window only when necessary, + * for example when an event registered by mousePressed() + * or keyPressed() occurs. + * + * In structuring a program, it only makes sense to call redraw() + * within events such as mousePressed(). This + * is because redraw() does not run + * draw() immediately (it only sets a flag that indicates + * an update is needed). + * + * The redraw() function does not work properly when + * called inside draw().To enable/disable animations, + * use loop() and noLoop(). + * + * In addition you can set the number of redraws per method call. Just + * add an integer as single parameter for the number of redraws. + * + * @method redraw + * @param {Integer} [n] Redraw for n-times. The default value is 1. + * @example + *
                              + * let x = 0; + * + * function setup() { + * createCanvas(100, 100); + * noLoop(); + * } + * + * function draw() { + * background(204); + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * x += 1; + * redraw(); + * } + * + *
                              + * + *
                              + * + * let x = 0; + * + * function setup() { + * createCanvas(100, 100); + * noLoop(); + * } + * + * function draw() { + * background(204); + * x += 1; + * line(x, 0, x, height); + * } + * + * function mousePressed() { + * redraw(5); + * } + * + *
                              + * + * @alt + * black line on far left of canvas + * black line on far left of canvas + */ + _main.default.prototype.redraw = function (n) { + if (this._inUserDraw || !this._setupDone) { + return; + } + var numberOfRedraws = parseInt(n); + if (isNaN(numberOfRedraws) || numberOfRedraws < 1) { + numberOfRedraws = 1; + } + var context = this._isGlobal ? window : this; + if (typeof context.draw === 'function') { + if (typeof context.setup === 'undefined') { + context.scale(context._pixelDensity, context._pixelDensity); + } + for (var idxRedraw = 0; idxRedraw < numberOfRedraws; idxRedraw++) { + context.resetMatrix(); + if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { + this._updateAccsOutput(); + } + if (context._renderer.isP3D) { + context._renderer._update(); + } + context._setProperty('frameCount', context.frameCount + 1); + this.callRegisteredHooksFor('pre'); + this._inUserDraw = true; + try { + context.draw(); + } finally { + this._inUserDraw = false; + } + this.callRegisteredHooksFor('post'); + } + } + }; + /** + * The `p5()` constructor enables you to activate "instance mode" instead of normal + * "global mode". This is an advanced topic. A short description and example is + * included below. Please see + * + * Dan Shiffman's Coding Train video tutorial or this + * tutorial page + * for more info. + * + * By default, all p5.js functions are in the global namespace (i.e. bound to the window + * object), meaning you can call them simply `ellipse()`, `fill()`, etc. However, this + * might be inconvenient if you are mixing with other JS libraries (synchronously or + * asynchronously) or writing long programs of your own. p5.js currently supports a + * way around this problem called "instance mode". In instance mode, all p5 functions + * are bound up in a single variable instead of polluting your global namespace. + * + * Optionally, you can specify a default container for the canvas and any other elements + * to append to with a second argument. You can give the ID of an element in your html, + * or an html node itself. + * + * Note that creating instances like this also allows you to have more than one p5 sketch on + * a single web page, as they will each be wrapped up with their own set up variables. Of + * course, you could also use iframes to have multiple sketches in global mode. + * + * @method p5 + * @param {Object} sketch a function containing a p5.js sketch + * @param {String|Object} node ID or pointer to HTML DOM node to contain sketch in + * @example + *
                              + * const s = p => { + * let x = 100; + * let y = 100; + * + * p.setup = function() { + * p.createCanvas(700, 410); + * }; + * + * p.draw = function() { + * p.background(0); + * p.fill(255); + * p.rect(x, y, 50, 50); + * }; + * }; + * + * new p5(s); // invoke p5 + *
                              + * + * @alt + * white rectangle on black background + */ + var _default = _main.default; + exports.default = _default; + }, + { + './main': 298, + 'core-js/modules/es.object.assign': 194 + } + ], + 311: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('./main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Transform + * @submodule Transform + * @for p5 + * @requires core + * @requires constants + */ + /** + * Multiplies the current matrix by the one specified through the parameters. + * This is a powerful operation that can perform the equivalent of translate, + * scale, shear and rotate all at once. You can learn more about transformation + * matrices on + * Wikipedia. + * + * The naming of the arguments here follows the naming of the + * WHATWG specification and corresponds to a + * transformation matrix of the + * form: + * + * > The transformation matrix used when applyMatrix is called + * + * The transformation matrix used when applyMatrix is called with 4x4 matrix + * + * @method applyMatrix + * @param {Array} arr an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values) + * @chainable + * @example + *
                              + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * background(200); + * // Equivalent to translate(x, y); + * applyMatrix(1, 0, 0, 1, 40 + step, 50); + * rect(0, 0, 50, 50); + * } + * + *
                              + * + *
                              + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * background(200); + * translate(50, 50); + * // Equivalent to scale(x, y); + * applyMatrix(1 / step, 0, 0, 1 / step, 0, 0); + * rect(0, 0, 50, 50); + * } + * + *
                              + * + *
                              + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * let angle = map(step, 0, 20, 0, TWO_PI); + * let cos_a = cos(angle); + * let sin_a = sin(angle); + * background(200); + * translate(50, 50); + * // Equivalent to rotate(angle); + * applyMatrix(cos_a, sin_a, -sin_a, cos_a, 0, 0); + * rect(0, 0, 50, 50); + * } + * + *
                              + * + *
                              + * + * function setup() { + * frameRate(10); + * rectMode(CENTER); + * } + * + * function draw() { + * let step = frameCount % 20; + * let angle = map(step, 0, 20, -PI / 4, PI / 4); + * background(200); + * translate(50, 50); + * // equivalent to shearX(angle); + * let shear_factor = 1 / tan(PI / 2 - angle); + * applyMatrix(1, 0, shear_factor, 1, 0, 0); + * rect(0, 0, 50, 50); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noFill(); + * } + * + * function draw() { + * background(200); + * rotateY(PI / 6); + * stroke(153); + * box(35); + * let rad = millis() / 1000; + * // Set rotation angles + * let ct = cos(rad); + * let st = sin(rad); + * // Matrix for rotation around the Y axis + * applyMatrix( + * ct, 0.0, st, 0.0, + * 0.0, 1.0, 0.0, 0.0, + * -st, 0.0, ct, 0.0, + * 0.0, 0.0, 0.0, 1.0 + * ); + * stroke(255); + * box(50); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * let testMatrix = [1, 0, 0, 1, 0, 0]; + * applyMatrix(testMatrix); + * rect(0, 0, 50, 50); + * } + * + *
                              + * + * @alt + * A rectangle translating to the right + * A rectangle shrinking to the center + * A rectangle rotating clockwise about the center + * A rectangle shearing + * A rectangle in the upper left corner + */ + /** + * @method applyMatrix + * @param {Number} a numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} b numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} c numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} d numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} e numbers which define the 2×3 or 4×4 matrix to be multiplied + * @param {Number} f numbers which define the 2×3 or 4×4 matrix to be multiplied + * @chainable + */ + /** + * @method applyMatrix + * @param {Number} a + * @param {Number} b + * @param {Number} c + * @param {Number} d + * @param {Number} e + * @param {Number} f + * @param {Number} g numbers which define the 4×4 matrix to be multiplied + * @param {Number} h numbers which define the 4×4 matrix to be multiplied + * @param {Number} i numbers which define the 4×4 matrix to be multiplied + * @param {Number} j numbers which define the 4×4 matrix to be multiplied + * @param {Number} k numbers which define the 4×4 matrix to be multiplied + * @param {Number} l numbers which define the 4×4 matrix to be multiplied + * @param {Number} m numbers which define the 4×4 matrix to be multiplied + * @param {Number} n numbers which define the 4×4 matrix to be multiplied + * @param {Number} o numbers which define the 4×4 matrix to be multiplied + * @param {Number} p numbers which define the 4×4 matrix to be multiplied + * @chainable + */ + + _main.default.prototype.applyMatrix = function () { + var isTypedArray = (arguments.length <= 0 ? undefined : arguments[0]) instanceof Object.getPrototypeOf(Uint8Array); + if (Array.isArray(arguments.length <= 0 ? undefined : arguments[0]) || isTypedArray) { + var _this$_renderer; + (_this$_renderer = this._renderer).applyMatrix.apply(_this$_renderer, _toConsumableArray(arguments.length <= 0 ? undefined : arguments[0])); + } else { + var _this$_renderer2; + (_this$_renderer2 = this._renderer).applyMatrix.apply(_this$_renderer2, arguments); + } + return this; + }; + /** + * Replaces the current matrix with the identity matrix. + * + * @method resetMatrix + * @chainable + * @example + *
                              + * + * translate(50, 50); + * applyMatrix(0.5, 0.5, -0.5, 0.5, 0, 0); + * rect(0, 0, 20, 20); + * // Note that the translate is also reset. + * resetMatrix(); + * rect(0, 0, 20, 20); + * + *
                              + * + * @alt + * A rotated rectangle in the center with another at the top left corner + */ + _main.default.prototype.resetMatrix = function () { + this._renderer.resetMatrix(); + return this; + }; + /** + * Rotates a shape by the amount specified by the angle parameter. This + * function accounts for angleMode, so angles + * can be entered in either RADIANS or DEGREES. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * Transformations apply to everything that happens after and subsequent + * calls to the function accumulate the effect. For example, calling + * rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). + * All transformations are reset when draw() begins again. + * + * Technically, rotate() multiplies the current transformation matrix + * by a rotation matrix. This function can be further controlled by + * push() and pop(). + * + * @method rotate + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @param {p5.Vector|Number[]} [axis] (in 3d) the axis to rotate around + * @chainable + * @example + *
                              + * + * translate(width / 2, height / 2); + * rotate(PI / 3.0); + * rect(-26, -26, 52, 52); + * + *
                              + * + * @alt + * white 52×52 rect with black outline at center rotated counter 45 degrees + */ + _main.default.prototype.rotate = function (angle, axis) { + _main.default._validateParameters('rotate', arguments); + this._renderer.rotate(this._toRadians(angle), axis); + return this; + }; + /** + * Rotates a shape around X axis by the amount specified in angle parameter. + * The angles can be entered in either RADIANS or DEGREES. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * All transformations are reset when draw() begins again. + * + * @method rotateX + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(255); + * rotateX(millis() / 1000); + * box(); + * } + * + *
                              + * + * @alt + * 3d box rotating around the x axis. + */ + _main.default.prototype.rotateX = function (angle) { + this._assert3d('rotateX'); + _main.default._validateParameters('rotateX', arguments); + this._renderer.rotateX(this._toRadians(angle)); + return this; + }; + /** + * Rotates a shape around Y axis by the amount specified in angle parameter. + * The angles can be entered in either RADIANS or DEGREES. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * All transformations are reset when draw() begins again. + * + * @method rotateY + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(255); + * rotateY(millis() / 1000); + * box(); + * } + * + *
                              + * + * @alt + * 3d box rotating around the y axis. + */ + _main.default.prototype.rotateY = function (angle) { + this._assert3d('rotateY'); + _main.default._validateParameters('rotateY', arguments); + this._renderer.rotateY(this._toRadians(angle)); + return this; + }; + /** + * Rotates a shape around Z axis by the amount specified in angle parameter. + * The angles can be entered in either RADIANS or DEGREES. + * + * This method works in WEBGL mode only. + * + * Objects are always rotated around their relative position to the + * origin and positive numbers rotate objects in a clockwise direction. + * All transformations are reset when draw() begins again. + * + * @method rotateZ + * @param {Number} angle the angle of rotation, specified in radians + * or degrees, depending on current angleMode + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(255); + * rotateZ(millis() / 1000); + * box(); + * } + * + *
                              + * + * @alt + * 3d box rotating around the z axis. + */ + _main.default.prototype.rotateZ = function (angle) { + this._assert3d('rotateZ'); + _main.default._validateParameters('rotateZ', arguments); + this._renderer.rotateZ(this._toRadians(angle)); + return this; + }; + /** + * Increases or decreases the size of a shape by expanding or contracting + * vertices. Objects always scale from their relative origin to the + * coordinate system. Scale values are specified as decimal percentages. + * For example, the function call scale(2.0) increases the dimension of a + * shape by 200%. + * + * Transformations apply to everything that happens after and subsequent + * calls to the function multiply the effect. For example, calling scale(2.0) + * and then scale(1.5) is the same as scale(3.0). If scale() is called + * within draw(), the transformation is reset when the loop begins again. + * + * Using this function with the z parameter is only available in WEBGL mode. + * This function can be further controlled with push() and pop(). + * + * @method scale + * @param {Number|p5.Vector|Number[]} s + * percent to scale the object, or percentage to + * scale the object in the x-axis if multiple arguments + * are given + * @param {Number} [y] percent to scale the object in the y-axis + * @param {Number} [z] percent to scale the object in the z-axis (webgl only) + * @chainable + * @example + *
                              + * + * rect(30, 20, 50, 50); + * scale(0.5); + * rect(30, 20, 50, 50); + * + *
                              + * + *
                              + * + * rect(30, 20, 50, 50); + * scale(0.5, 1.3); + * rect(30, 20, 50, 50); + * + *
                              + * + * @alt + * white 52×52 rect with black outline at center rotated counter 45 degrees + * 2 white rects with black outline- 1 50×50 at center. other 25×65 bottom left + */ + /** + * @method scale + * @param {p5.Vector|Number[]} scales per-axis percents to scale the object + * @chainable + */ + _main.default.prototype.scale = function (x, y, z) { + _main.default._validateParameters('scale', arguments); + // Only check for Vector argument type if Vector is available + if (x instanceof _main.default.Vector) { + var v = x; + x = v.x; + y = v.y; + z = v.z; + } else if (x instanceof Array) { + var rg = x; + x = rg[0]; + y = rg[1]; + z = rg[2] || 1; + } + if (isNaN(y)) { + y = z = x; + } else if (isNaN(z)) { + z = 1; + } + this._renderer.scale.call(this._renderer, x, y, z); + return this; + }; + /** + * Shears a shape around the x-axis by the amount specified by the angle + * parameter. Angles should be specified in the current angleMode. + * Objects are always sheared around their relative position to the origin + * and positive numbers shear objects in a clockwise direction. + * + * Transformations apply to everything that happens after and subsequent + * calls to the function accumulates the effect. For example, calling + * shearX(PI/2) and then shearX(PI/2) is the same as shearX(PI). + * If shearX() is called within the draw(), + * the transformation is reset when the loop begins again. + * + * Technically, shearX() multiplies the current + * transformation matrix by a rotation matrix. This function can be further + * controlled by the push() and pop() functions. + * + * @method shearX + * @param {Number} angle angle of shear specified in radians or degrees, + * depending on current angleMode + * @chainable + * @example + *
                              + * + * translate(width / 4, height / 4); + * shearX(PI / 4.0); + * rect(0, 0, 30, 30); + * + *
                              + * + * @alt + * white irregular quadrilateral with black outline at top middle. + */ + _main.default.prototype.shearX = function (angle) { + _main.default._validateParameters('shearX', arguments); + var rad = this._toRadians(angle); + this._renderer.applyMatrix(1, 0, Math.tan(rad), 1, 0, 0); + return this; + }; + /** + * Shears a shape around the y-axis the amount specified by the angle + * parameter. Angles should be specified in the current angleMode. Objects + * are always sheared around their relative position to the origin and + * positive numbers shear objects in a clockwise direction. + * + * Transformations apply to everything that happens after and subsequent + * calls to the function accumulates the effect. For example, calling + * shearY(PI/2) and then shearY(PI/2) is the same as shearY(PI). If + * shearY() is called within the draw(), the transformation is reset when + * the loop begins again. + * + * Technically, shearY() multiplies the current transformation matrix by a + * rotation matrix. This function can be further controlled by the + * push() and pop() functions. + * + * @method shearY + * @param {Number} angle angle of shear specified in radians or degrees, + * depending on current angleMode + * @chainable + * @example + *
                              + * + * translate(width / 4, height / 4); + * shearY(PI / 4.0); + * rect(0, 0, 30, 30); + * + *
                              + * + * @alt + * white irregular quadrilateral with black outline at middle bottom. + */ + _main.default.prototype.shearY = function (angle) { + _main.default._validateParameters('shearY', arguments); + var rad = this._toRadians(angle); + this._renderer.applyMatrix(1, Math.tan(rad), 0, 1, 0, 0); + return this; + }; + /** + * Specifies an amount to displace objects within the display window. + * The x parameter specifies left/right translation, the y parameter + * specifies up/down translation. + * + * Transformations are cumulative and apply to everything that happens after + * and subsequent calls to the function accumulates the effect. For example, + * calling translate(50, 0) and then translate(20, 0) is the same as + * translate(70, 0). If translate() is called within draw(), the + * transformation is reset when the loop begins again. This function can be + * further controlled by using push() and pop(). + * + * @method translate + * @param {Number} x left/right translation + * @param {Number} y up/down translation + * @param {Number} [z] forward/backward translation (WEBGL only) + * @chainable + * @example + *
                              + * + * translate(30, 20); + * rect(0, 0, 55, 55); + * + *
                              + * + *
                              + * + * rect(0, 0, 55, 55); // Draw rect at original 0,0 + * translate(30, 20); + * rect(0, 0, 55, 55); // Draw rect at new 0,0 + * translate(14, 14); + * rect(0, 0, 55, 55); // Draw rect at new 0,0 + * + *
                              + * + + *
                              + * + * function draw() { + * background(200); + * rectMode(CENTER); + * translate(width / 2, height / 2); + * translate(p5.Vector.fromAngle(millis() / 1000, 40)); + * rect(0, 0, 20, 20); + * } + * + *
                              + * + * @alt + * white 55×55 rect with black outline at center right. + * 3 white 55×55 rects with black outlines at top-l, center-r and bottom-r. + * a 20×20 white rect moving in a circle around the canvas + */ + /** + * @method translate + * @param {p5.Vector} vector the vector to translate by + * @chainable + */ + _main.default.prototype.translate = function (x, y, z) { + _main.default._validateParameters('translate', arguments); + if (this._renderer.isP3D) { + this._renderer.translate(x, y, z); + } else { + this._renderer.translate(x, y); + } + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + './main': 298, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 312: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.ends-with'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.ends-with'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module Data + * @submodule LocalStorage + * @requires core + * + * This module defines the p5 methods for working with local storage + */ + /** + * + * Stores a value in local storage under the key name. + * Local storage is saved in the browser and persists + * between browsing sessions and page reloads. + * The key can be the name of the variable but doesn't + * have to be. To retrieve stored items + * see getItem. + * + * Sensitive data such as passwords or personal information + * should not be stored in local storage. + * + * @method storeItem + * @for p5 + * @param {String} key + * @param {String|Number|Object|Boolean|p5.Color|p5.Vector} value + * + * @example + *
                              + * // Type to change the letter in the + * // center of the canvas. + * // If you reload the page, it will + * // still display the last key you entered + * + * let myText; + * + * function setup() { + * createCanvas(100, 100); + * myText = getItem('myText'); + * if (myText === null) { + * myText = ''; + * } + * describe(`When you type the key name is displayed as black text on white background. + * If you reload the page, the last letter typed is still displaying.`); + * } + * + * function draw() { + * textSize(40); + * background(255); + * text(myText, width / 2, height / 2); + * } + * + * function keyPressed() { + * myText = key; + * storeItem('myText', myText); + * } + *
                              + */ + + _main.default.prototype.storeItem = function (key, value) { + if (typeof key !== 'string') { + console.log('The argument that you passed to storeItem() - '.concat(key, ' is not a string.')); + } + if (key.endsWith('p5TypeID')) { + console.log('The argument that you passed to storeItem() - '.concat(key, ' must not end with \'p5TypeID\'.')); + } + if (typeof value === 'undefined') { + console.log('You cannot store undefined variables using storeItem().'); + } + var type = _typeof(value); + switch (type) { + case 'number': + case 'boolean': + value = value.toString(); + break; + case 'object': + if (value instanceof _main.default.Color) { + type = 'p5.Color'; + } else if (value instanceof _main.default.Vector) { + type = 'p5.Vector'; + var coord = [ + value.x, + value.y, + value.z + ]; + value = coord; + } + value = JSON.stringify(value); + break; + case 'string': + default: + break; + } + localStorage.setItem(key, value); + var typeKey = ''.concat(key, 'p5TypeID'); + localStorage.setItem(typeKey, type); + }; + /** + * + * Returns the value of an item that was stored in local storage + * using storeItem() + * + * @method getItem + * @for p5 + * @param {String} key name that you wish to use to store in local storage + * @return {Number|Object|String|Boolean|p5.Color|p5.Vector} Value of stored item + * + * @example + *
                              + * // Click the mouse to change + * // the color of the background + * // Once you have changed the color + * // it will stay changed even when you + * // reload the page. + * + * let myColor; + * + * function setup() { + * createCanvas(100, 100); + * myColor = getItem('myColor'); + * } + * + * function draw() { + * if (myColor !== null) { + * background(myColor); + * } + * describe(`If you click, the canvas changes to a random color.· + * If you reload the page, the canvas is still the color it was when the + * page was previously loaded.`); + * } + * + * function mousePressed() { + * myColor = color(random(255), random(255), random(255)); + * storeItem('myColor', myColor); + * } + *
                              + */ + _main.default.prototype.getItem = function (key) { + var value = localStorage.getItem(key); + var type = localStorage.getItem(''.concat(key, 'p5TypeID')); + if (typeof type === 'undefined') { + console.log('Unable to determine type of item stored under '.concat(key, 'in local storage. Did you save the item with something other than setItem()?')); + } else if (value !== null) { + switch (type) { + case 'number': + value = parseFloat(value); + break; + case 'boolean': + value = value === 'true'; + break; + case 'object': + value = JSON.parse(value); + break; + case 'p5.Color': + value = JSON.parse(value); + value = this.color.apply(this, _toConsumableArray(value.levels)); + break; + case 'p5.Vector': + value = JSON.parse(value); + value = this.createVector.apply(this, _toConsumableArray(value)); + break; + case 'string': + default: + break; + } + } + return value; + }; + /** + * + * Clears all local storage items set with storeItem() + * for the current domain. + * + * @method clearStorage + * @for p5 + * + * @example + *
                              + * + * function setup() { + * let myNum = 10; + * let myBool = false; + * storeItem('myNum', myNum); + * storeItem('myBool', myBool); + * print(getItem('myNum')); // logs 10 to the console + * print(getItem('myBool')); // logs false to the console + * clearStorage(); + * print(getItem('myNum')); // logs null to the console + * print(getItem('myBool')); // logs null to the console + * } + *
                              + */ + _main.default.prototype.clearStorage = function () { + localStorage.clear(); + }; + /** + * + * Removes an item that was stored with storeItem() + * + * @method removeItem + * @param {String} key + * @for p5 + * + * @example + *
                              + * + * function setup() { + * let myVar = 10; + * storeItem('myVar', myVar); + * print(getItem('myVar')); // logs 10 to the console + * removeItem('myVar'); + * print(getItem('myVar')); // logs null to the console + * } + *
                              + */ + _main.default.prototype.removeItem = function (key) { + if (typeof key !== 'string') { + console.log('The argument that you passed to removeItem() - '.concat(key, ' is not a string.')); + } + localStorage.removeItem(key); + localStorage.removeItem(''.concat(key, 'p5TypeID')); + }; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.ends-with': 208, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 313: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.object.keys'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Data + * @submodule Dictionary + * @for p5.TypedDict + * @requires core + * + * This module defines the p5 methods for the p5 Dictionary classes. + * The classes StringDict and NumberDict are for storing and working + * with key-value pairs. + */ + /** + * + * Creates a new instance of p5.StringDict using the key-value pair + * or the object you provide. + * + * @method createStringDict + * @for p5 + * @param {String} key + * @param {String} value + * @return {p5.StringDict} + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * print(myDictionary.hasKey('p5')); // logs true to console + * + * let anotherDictionary = createStringDict({ happy: 'coding' }); + * print(anotherDictionary.hasKey('happy')); // logs true to console + * } + *
                              + */ + /** + * @method createStringDict + * @param {Object} object object + * @return {p5.StringDict} + */ + + _main.default.prototype.createStringDict = function (key, value) { + _main.default._validateParameters('createStringDict', arguments); + return new _main.default.StringDict(key, value); + }; + /** + * + * Creates a new instance of p5.NumberDict using the key-value pair + * or object you provide. + * + * @method createNumberDict + * @for p5 + * @param {Number} key + * @param {Number} value + * @return {p5.NumberDict} + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict(100, 42); + * print(myDictionary.hasKey(100)); // logs true to console + * + * let anotherDictionary = createNumberDict({ 200: 84 }); + * print(anotherDictionary.hasKey(200)); // logs true to console + * } + *
                              + */ + /** + * @method createNumberDict + * @param {Object} object object + * @return {p5.NumberDict} + */ + _main.default.prototype.createNumberDict = function (key, value) { + _main.default._validateParameters('createNumberDict', arguments); + return new _main.default.NumberDict(key, value); + }; + /** + * + * Base class for all p5.Dictionary types. Specifically + * typed Dictionary classes inherit from this class. + * + * @class p5.TypedDict + * @constructor + */ + _main.default.TypedDict = /*#__PURE__*/ function () { + function TypedDict(key, value) { + _classCallCheck(this, TypedDict); + if (key instanceof Object) { + this.data = key; + } else { + this.data = { + }; + this.data[key] = value; + } + return this; + } /** + * Returns the number of key-value pairs currently stored in the Dictionary. + * + * @method size + * @return {Integer} the number of key-value pairs in the Dictionary + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict(1, 10); + * myDictionary.create(2, 20); + * myDictionary.create(3, 30); + * print(myDictionary.size()); // logs 3 to the console + * } + *
                              + */ + + _createClass(TypedDict, [ + { + key: 'size', + value: function size() { + return Object.keys(this.data).length; + } /** + * Returns true if the given key exists in the Dictionary, + * otherwise returns false. + * + * @method hasKey + * @param {Number|String} key that you want to look up + * @return {Boolean} whether that key exists in Dictionary + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * print(myDictionary.hasKey('p5')); // logs true to console + * } + *
                              + */ + + }, + { + key: 'hasKey', + value: function hasKey(key) { + return this.data.hasOwnProperty(key); + } /** + * Returns the value stored at the given key. + * + * @method get + * @param {Number|String} the key you want to access + * @return {Number|String} the value stored at that key + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * let myValue = myDictionary.get('p5'); + * print(myValue === 'js'); // logs true to console + * } + *
                              + */ + + }, + { + key: 'get', + value: function get(key) { + if (this.data.hasOwnProperty(key)) { + return this.data[key]; + } else { + console.log(''.concat(key, ' does not exist in this Dictionary')); + } + } /** + * Updates the value associated with the given key in case it already exists + * in the Dictionary. Otherwise a new key-value pair is added. + * + * @method set + * @param {Number|String} key + * @param {Number|String} value + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.set('p5', 'JS'); + * myDictionary.print(); // logs "key: p5 - value: JS" to console + * } + *
                              + */ + + }, + { + key: 'set', + value: function set(key, value) { + if (this._validate(value)) { + this.data[key] = value; + } else { + console.log('Those values dont work for this dictionary type.'); + } + } /** + * private helper function to handle the user passing in objects + * during construction or calls to create() + */ + + }, + { + key: '_addObj', + value: function _addObj(obj) { + for (var key in obj) { + this.set(key, obj[key]); + } + } /** + * Creates a new key-value pair in the Dictionary. + * + * @method create + * @param {Number|String} key + * @param {Number|String} value + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.create('happy', 'coding'); + * myDictionary.print(); + * // above logs "key: p5 - value: js, key: happy - value: coding" to console + * } + *
                              + */ + /** + * @method create + * @param {Object} obj key/value pair + */ + + }, + { + key: 'create', + value: function create(key, value) { + if (key instanceof Object && typeof value === 'undefined') { + this._addObj(key); + } else if (typeof key !== 'undefined') { + this.set(key, value); + } else { + console.log('In order to create a new Dictionary entry you must pass ' + 'an object or a key, value pair'); + } + } /** + * Removes all previously stored key-value pairs from the Dictionary. + * + * @method clear + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * print(myDictionary.hasKey('p5')); // prints 'true' + * myDictionary.clear(); + * print(myDictionary.hasKey('p5')); // prints 'false' + * } + * + *
                              + */ + + }, + { + key: 'clear', + value: function clear() { + this.data = { + }; + } /** + * Removes the key-value pair stored at the given key from the Dictionary. + * + * @method remove + * @param {Number|String} key for the pair to remove + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.create('happy', 'coding'); + * myDictionary.print(); + * // above logs "key: p5 - value: js, key: happy - value: coding" to console + * myDictionary.remove('p5'); + * myDictionary.print(); + * // above logs "key: happy value: coding" to console + * } + *
                              + */ + + }, + { + key: 'remove', + value: function remove(key) { + if (this.data.hasOwnProperty(key)) { + delete this.data[key]; + } else { + throw new Error(''.concat(key, ' does not exist in this Dictionary')); + } + } /** + * Logs the set of items currently stored in the Dictionary to the console. + * + * @method print + * + * @example + *
                              + * + * function setup() { + * let myDictionary = createStringDict('p5', 'js'); + * myDictionary.create('happy', 'coding'); + * myDictionary.print(); + * // above logs "key: p5 - value: js, key: happy - value: coding" to console + * } + * + *
                              + */ + + }, + { + key: 'print', + value: function print() { + for (var item in this.data) { + console.log('key:'.concat(item, ' value:').concat(this.data[item])); + } + } /** + * Converts the Dictionary into a CSV file for local download. + * + * @method saveTable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * createStringDict({ + * john: 1940, + * paul: 1942, + * george: 1943, + * ringo: 1940 + * }).saveTable('beatles'); + * } + * } + * + *
                              + */ + + }, + { + key: 'saveTable', + value: function saveTable(filename) { + var output = ''; + for (var key in this.data) { + output += ''.concat(key, ',').concat(this.data[key], '\n'); + } + var blob = new Blob([output], { + type: 'text/csv' + }); + _main.default.prototype.downloadFile(blob, filename || 'mycsv', 'csv'); + } /** + * Converts the Dictionary into a JSON file for local download. + * + * @method saveJSON + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * createStringDict({ + * john: 1940, + * paul: 1942, + * george: 1943, + * ringo: 1940 + * }).saveJSON('beatles'); + * } + * } + * + *
                              + */ + + }, + { + key: 'saveJSON', + value: function saveJSON(filename, opt) { + _main.default.prototype.saveJSON(this.data, filename, opt); + } /** + * private helper function to ensure that the user passed in valid + * values for the Dictionary type + */ + + }, + { + key: '_validate', + value: function _validate(value) { + return true; + } + } + ]); + return TypedDict; + }(); + /** + * + * A simple Dictionary class for Strings. + * + * @class p5.StringDict + * @extends p5.TypedDict + */ + _main.default.StringDict = /*#__PURE__*/ function (_p5$TypedDict) { + _inherits(StringDict, _p5$TypedDict); + var _super = _createSuper(StringDict); + function StringDict() { + _classCallCheck(this, StringDict); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return _super.call.apply(_super, [ + this + ].concat(args)); + } + _createClass(StringDict, [ + { + key: '_validate', + value: function _validate(value) { + return typeof value === 'string'; + } + } + ]); + return StringDict; + }(_main.default.TypedDict); + /** + * + * A simple Dictionary class for Numbers. + * + * @class p5.NumberDict + * @constructor + * @extends p5.TypedDict + */ + _main.default.NumberDict = /*#__PURE__*/ function (_p5$TypedDict2) { + _inherits(NumberDict, _p5$TypedDict2); + var _super2 = _createSuper(NumberDict); + function NumberDict() { + _classCallCheck(this, NumberDict); + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return _super2.call.apply(_super2, [ + this + ].concat(args)); + } /** + * private helper function to ensure that the user passed in valid + * values for the Dictionary type + */ + + _createClass(NumberDict, [ + { + key: '_validate', + value: function _validate(value) { + return typeof value === 'number'; + } /** + * Add the given number to the value currently stored at the given key. + * The sum then replaces the value previously stored in the Dictionary. + * + * @method add + * @param {Number} Key for the value you wish to add to + * @param {Number} Number to add to the value + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict(2, 5); + * myDictionary.add(2, 2); + * print(myDictionary.get(2)); // logs 7 to console. + * } + *
                              + * + */ + + }, + { + key: 'add', + value: function add(key, amount) { + if (this.data.hasOwnProperty(key)) { + this.data[key] += amount; + } else { + console.log('The key - '.concat(key, ' does not exist in this dictionary.')); + } + } /** + * Subtract the given number from the value currently stored at the given key. + * The difference then replaces the value previously stored in the Dictionary. + * + * @method sub + * @param {Number} Key for the value you wish to subtract from + * @param {Number} Number to subtract from the value + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict(2, 5); + * myDictionary.sub(2, 2); + * print(myDictionary.get(2)); // logs 3 to console. + * } + *
                              + * + */ + + }, + { + key: 'sub', + value: function sub(key, amount) { + this.add(key, - amount); + } /** + * Multiply the given number with the value currently stored at the given key. + * The product then replaces the value previously stored in the Dictionary. + * + * @method mult + * @param {Number} Key for value you wish to multiply + * @param {Number} Amount to multiply the value by + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict(2, 4); + * myDictionary.mult(2, 2); + * print(myDictionary.get(2)); // logs 8 to console. + * } + *
                              + * + */ + + }, + { + key: 'mult', + value: function mult(key, amount) { + if (this.data.hasOwnProperty(key)) { + this.data[key] *= amount; + } else { + console.log('The key - '.concat(key, ' does not exist in this dictionary.')); + } + } /** + * Divide the given number with the value currently stored at the given key. + * The quotient then replaces the value previously stored in the Dictionary. + * + * @method div + * @param {Number} Key for value you wish to divide + * @param {Number} Amount to divide the value by + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict(2, 8); + * myDictionary.div(2, 2); + * print(myDictionary.get(2)); // logs 4 to console. + * } + *
                              + * + */ + + }, + { + key: 'div', + value: function div(key, amount) { + if (this.data.hasOwnProperty(key)) { + this.data[key] /= amount; + } else { + console.log('The key - '.concat(key, ' does not exist in this dictionary.')); + } + } /** + * private helper function for finding lowest or highest value + * the argument 'flip' is used to flip the comparison arrow + * from 'less than' to 'greater than' + */ + + }, + { + key: '_valueTest', + value: function _valueTest(flip) { + if (Object.keys(this.data).length === 0) { + throw new Error('Unable to search for a minimum or maximum value on an empty NumberDict'); + } else if (Object.keys(this.data).length === 1) { + return this.data[Object.keys(this.data) [0]]; + } else { + var result = this.data[Object.keys(this.data) [0]]; + for (var key in this.data) { + if (this.data[key] * flip < result * flip) { + result = this.data[key]; + } + } + return result; + } + } /** + * Return the lowest number currently stored in the Dictionary. + * + * @method minValue + * @return {Number} + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); + * let lowestValue = myDictionary.minValue(); // value is -10 + * print(lowestValue); + * } + *
                              + */ + + }, + { + key: 'minValue', + value: function minValue() { + return this._valueTest(1); + } /** + * Return the highest number currently stored in the Dictionary. + * + * @method maxValue + * @return {Number} + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); + * let highestValue = myDictionary.maxValue(); // value is 3 + * print(highestValue); + * } + *
                              + */ + + }, + { + key: 'maxValue', + value: function maxValue() { + return this._valueTest( - 1); + } /** + * private helper function for finding lowest or highest key + * the argument 'flip' is used to flip the comparison arrow + * from 'less than' to 'greater than' + */ + + }, + { + key: '_keyTest', + value: function _keyTest(flip) { + if (Object.keys(this.data).length === 0) { + throw new Error('Unable to use minValue on an empty NumberDict'); + } else if (Object.keys(this.data).length === 1) { + return Object.keys(this.data) [0]; + } else { + var result = Object.keys(this.data) [0]; + for (var i = 1; i < Object.keys(this.data).length; i++) { + if (Object.keys(this.data) [i] * flip < result * flip) { + result = Object.keys(this.data) [i]; + } + } + return result; + } + } /** + * Return the lowest key currently used in the Dictionary. + * + * @method minKey + * @return {Number} + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); + * let lowestKey = myDictionary.minKey(); // value is 1.2 + * print(lowestKey); + * } + *
                              + */ + + }, + { + key: 'minKey', + value: function minKey() { + return this._keyTest(1); + } /** + * Return the highest key currently used in the Dictionary. + * + * @method maxKey + * @return {Number} + * @example + *
                              + * + * function setup() { + * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); + * let highestKey = myDictionary.maxKey(); // value is 4 + * print(highestKey); + * } + *
                              + */ + + }, + { + key: 'maxKey', + value: function maxKey() { + return this._keyTest( - 1); + } + } + ]); + return NumberDict; + }(_main.default.TypedDict); + var _default = _main.default.TypedDict; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 314: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/web.url'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/web.url'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * The web is much more than just canvas and the DOM functionality makes it easy to interact + * with other HTML5 objects, including text, hyperlink, image, input, video, + * audio, and webcam. + * There is a set of creation methods, DOM manipulation methods, and + * an extended p5.Element that supports a range of HTML elements. See the + * + * beyond the canvas tutorial for a full overview of how this addon works. + * + * See tutorial: beyond the canvas + * for more info on how to use this library. + * + * @module DOM + * @submodule DOM + * @for p5 + * @requires p5 + */ + /** + * Searches the page for the first element that matches the given + * CSS selector string. + * The string can be an ID, class, tag name, or a combination. `select()` + * returns a p5.Element object if it finds a match + * and `null` otherwise. + * + * The second parameter, `container`, is optional. It specifies a container to + * search within. container can be CSS selector string, a + * p5.Element object, or an + * HTMLElement object. + * + * @method select + * @param {String} selectors CSS selector string of element to search for. + * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or + * HTMLElement to search within. + * @return {p5.Element|null} p5.Element containing the element. + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * // Select the canvas by its tag. + * let cnv = select('canvas'); + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * let cnv = createCanvas(100, 100); + * // Add a class attribute to the canvas. + * cnv.class('pinkborder'); + * + * background(200); + * + * // Select the canvas by its class. + * cnv = select('.pinkborder'); + * // Style its border. + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * let cnv = createCanvas(100, 100); + * // Set the canvas ID. + * cnv.id('mycanvas'); + * + * background(200); + * + * // Select the canvas by its ID. + * cnv = select('#mycanvas'); + * // Style its border. + * cnv.style('border', '5px deeppink dashed'); + * + * describe('A gray square with a dashed pink border.'); + * } + * + *
                              + */ + + _main.default.prototype.select = function (e, p) { + _main.default._validateParameters('select', arguments); + var container = this._getContainer(p); + var res = container.querySelector(e); + if (res) { + return this._wrapElement(res); + } else { + return null; + } + }; + /** + * Searches the page for all elements that matches the given + * CSS selector string. + * The string can be an ID, class, tag name, or a combination. `selectAll()` + * returns an array of p5.Element objects if it + * finds any matches and an empty array otherwise. + * + * The second parameter, `container`, is optional. It specifies a container to + * search within. container can be CSS selector string, a + * p5.Element object, or an + * HTMLElement object. + * + * @method selectAll + * @param {String} selectors CSS selector string of element to search for. + * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or + * HTMLElement to search within. + * @return {p5.Element[]} array of p5.Elements containing any elements found. + * @example + *
                              + * + * function setup() { + * // Create three buttons. + * createButton('1'); + * createButton('2'); + * createButton('3'); + * + * // Select the buttons by their tag. + * let buttons = selectAll('button'); + * + * // Position the buttons. + * for (let i = 0; i < 3; i += 1) { + * buttons[i].position(0, i * 30); + * } + * + * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3".'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * // Create three buttons and position them. + * let b1 = createButton('1'); + * b1.position(0, 0); + * let b2 = createButton('2'); + * b2.position(0, 30); + * let b3 = createButton('3'); + * b3.position(0, 60); + * + * // Add a class attribute to each button. + * b1.class('btn'); + * b2.class('btn btn-pink'); + * b3.class('btn'); + * + * // Select the buttons by their class. + * let buttons = selectAll('.btn'); + * let pinkButtons = selectAll('.btn-pink'); + * + * // Style the selected buttons. + * buttons.forEach(btn => { + * btn.style('font-family', 'Comic Sans MS'); + * }); + * + * pinkButtons.forEach(btn => { + * btn.style('background', 'deeppink'); + * btn.style('color', 'white'); + * }); + * + * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3". Buttons "1" and "3" are gray. Button "2" is pink.'); + * } + * + *
                              + */ + _main.default.prototype.selectAll = function (e, p) { + _main.default._validateParameters('selectAll', arguments); + var arr = [ + ]; + var container = this._getContainer(p); + var res = container.querySelectorAll(e); + if (res) { + for (var j = 0; j < res.length; j++) { + var obj = this._wrapElement(res[j]); + arr.push(obj); + } + } + return arr; + }; + /** + * Helper function for select and selectAll + */ + _main.default.prototype._getContainer = function (p) { + var container = document; + if (typeof p === 'string') { + container = document.querySelector(p) || document; + } else if (p instanceof _main.default.Element) { + container = p.elt; + } else if (p instanceof HTMLElement) { + container = p; + } + return container; + }; + /** + * Helper function for getElement and getElements. + */ + _main.default.prototype._wrapElement = function (elt) { + var children = Array.prototype.slice.call(elt.children); + if (elt.tagName === 'INPUT' && elt.type === 'checkbox') { + var converted = new _main.default.Element(elt, this); + converted.checked = function () { + if (arguments.length === 0) { + return this.elt.checked; + } else if (arguments.length <= 0 ? undefined : arguments[0]) { + this.elt.checked = true; + } else { + this.elt.checked = false; + } + return this; + }; + return converted; + } else if (elt.tagName === 'VIDEO' || elt.tagName === 'AUDIO') { + return new _main.default.MediaElement(elt, this); + } else if (elt.tagName === 'SELECT') { + return this.createSelect(new _main.default.Element(elt, this)); + } else if (children.length > 0 && children.every(function (c) { + return c.tagName === 'INPUT' || c.tagName === 'LABEL'; + })) { + return this.createRadio(new _main.default.Element(elt, this)); + } else { + return new _main.default.Element(elt, this); + } + }; + /** + * Removes all elements created by p5.js, including any event handlers. + * There are two exceptions: + * canvas elements created by createCanvas + * and p5.Render objects created by + * createGraphics. + * + * @method removeElements + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * // Create a paragraph element and place + * // it in the middle of the canvas. + * let p = createP('p5*js'); + * p.position(25, 25); + * + * describe('A gray square with the text "p5*js" written in its center. The text disappears when the mouse is pressed.'); + * } + * + * function mousePressed() { + * removeElements(); + * } + * + *
                              + * + *
                              + * + * let slider; + * + * function setup() { + * createCanvas(100, 100); + * + * // Create a paragraph element and place + * // it at the top of the canvas. + * let p = createP('p5*js'); + * p.position(25, 25); + * + * // Create a slider element and place it + * // beneath the canvas. + * slider = createSlider(0, 255, 200); + * slider.position(0, 100); + * + * describe('A gray square with the text "p5*js" written in its center and a range slider beneath it. The square changes color when the slider is moved. The text and slider disappear when the square is double-clicked.'); + * } + * + * function draw() { + * // Use the slider value to change the background color. + * let g = slider.value(); + * background(g); + * } + * + * function doubleClicked() { + * removeElements(); + * } + * + *
                              + */ + _main.default.prototype.removeElements = function (e) { + _main.default._validateParameters('removeElements', arguments); + // el.remove splices from this._elements, so don't mix iteration with it + var isNotCanvasElement = function isNotCanvasElement(el) { + return !(el.elt instanceof HTMLCanvasElement); + }; + var removeableElements = this._elements.filter(isNotCanvasElement); + removeableElements.map(function (el) { + return el.remove(); + }); + }; + /** + * `myElement.changed()` sets a function to call when the value of the + * p5.Element object changes. Calling + * `myElement.changed(false)` disables the function. + * + * @method changed + * @param {Function|Boolean} fxn function to call when the element changes. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a dropdown menu and add a few color options. + * let drop = createSelect(); + * drop.position(0, 0); + * drop.option('red'); + * drop.option('green'); + * drop.option('blue'); + * + * // When the color option changes, paint the background with + * // that color. + * drop.changed(() => { + * let c = drop.value(); + * background(c); + * }); + * + * describe('A gray square with a dropdown menu at the top. The square changes color when an option is selected.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create a checkbox and place it beneath the canvas. + * let checkbox = createCheckbox(' circle'); + * checkbox.position(0, 100); + * + * // When the checkbox changes, paint the background gray + * // and determine whether to draw a circle. + * checkbox.changed(() => { + * background(200); + * if (checkbox.checked() === true) { + * circle(50, 50, 30); + * } + * }); + * + * describe('A gray square with a checkbox underneath it that says "circle". A white circle appears when the box is checked and disappears otherwise.'); + * } + * + *
                              + */ + _main.default.Element.prototype.changed = function (fxn) { + _main.default.Element._adjustListener('change', fxn, this); + return this; + }; + /** + * `myElement.input()` sets a function to call when input is detected within + * the p5.Element object. It's often used to with + * text inputs and sliders. Calling `myElement.input(false)` disables the + * function. + * + * @method input + * @param {Function|Boolean} fxn function to call when input is detected within + * the element. + * `false` disables the function. + * @chainable + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a slider and place it beneath the canvas. + * let slider = createSlider(0, 255, 200); + * slider.position(0, 100); + * + * // When the slider changes, use its value to paint + * // the background. + * slider.input(() => { + * let g = slider.value(); + * background(g); + * }); + * + * describe('A gray square with a range slider underneath it. The background changes shades of gray when the slider is moved.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create an input and place it beneath the canvas. + * let inp = createInput(''); + * inp.position(0, 100); + * + * // When input is detected, paint the background gray + * // and display the text. + * inp.input(() => { + * background(200); + * let msg = inp.value(); + * text(msg, 5, 50); + * }); + * + * describe('A gray square with a text input bar beneath it. Any text written in the input appears in the middle of the square.'); + * } + * + *
                              + */ + _main.default.Element.prototype.input = function (fxn) { + _main.default.Element._adjustListener('input', fxn, this); + return this; + }; + /** + * Helpers for create methods. + */ + function addElement(elt, pInst, media) { + var node = pInst._userNode ? pInst._userNode : document.body; + node.appendChild(elt); + var c = media ? new _main.default.MediaElement(elt, pInst) : new _main.default.Element(elt, pInst); + pInst._elements.push(c); + return c; + } /** + * Creates a `<div></div>` element. It's commonly used as a + * container for other elements. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<div></div>`. + * + * @method createDiv + * @param {String} [html] inner HTML for the new `<div></div>` element. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * let div = createDiv('p5*js'); + * div.position(25, 35); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create an h3 element within the div. + * let div = createDiv('

                              p5*js

                              '); + * div.position(20, 5); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + *
                              + *
                              + */ + + _main.default.prototype.createDiv = function () { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var elt = document.createElement('div'); + elt.innerHTML = html; + return addElement(elt, this); + }; + /** + * Creates a `<p></p>` element. It's commonly used for + * paragraph-length text. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<p></p>`. + * + * @method createP + * @param {String} [html] inner HTML for the new `<p></p>` element. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * let p = createP('Tell me a story.'); + * p.position(5, 0); + * + * describe('A gray square displaying the text "Tell me a story." written in black.'); + * } + * + *
                              + */ + _main.default.prototype.createP = function () { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var elt = document.createElement('p'); + elt.innerHTML = html; + return addElement(elt, this); + }; + /** + * Creates a `<span></span>` element. It's commonly used as a + * container for inline elements. For example, a `<span></span>` + * can hold part of a sentence that's a + * different style. + * + * The parameter `html` is optional. It accepts a string that sets the + * inner HTML of the new `<span></span>`. + * + * @method createSpan + * @param {String} [html] inner HTML for the new `<span></span>` element. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a span element. + * let span = createSpan('p5*js'); + * span.position(25, 35); + * + * describe('A gray square with the text "p5*js" written in its center.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create a div element as + * // a container. + * let div = createDiv(); + * // Place the div at the + * // center. + * div.position(25, 35); + * + * // Create a span element. + * let s1 = createSpan('p5'); + * // Create a second span element. + * let s2 = createSpan('*'); + * // Set the span's font color. + * s2.style('color', 'deeppink'); + * // Create a third span element. + * let s3 = createSpan('js'); + * + * // Add all the spans to the + * // container div. + * s1.parent(div); + * s2.parent(div); + * s3.parent(div); + * + * describe('A gray square with the text "p5*js" written in black at its center. The asterisk is pink.'); + * } + * + *
                              + */ + _main.default.prototype.createSpan = function () { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var elt = document.createElement('span'); + elt.innerHTML = html; + return addElement(elt, this); + }; + /** + * Creates an `<img>` element that can appear outside of the canvas. + * + * The first parameter, `src`, is a string with the path to the image file. + * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as + * in `'https://example.com/image.png'`. + * + * The second parameter, `alt`, is a string with the + * alternate text + * for the image. An empty string `''` can be used for images that aren't displayed. + * + * The third parameter, `crossOrigin`, is optional. It's a string that sets the + * crossOrigin property + * of the image. Use `'anonymous'` or `'use-credentials'` to fetch the image + * with cross-origin access. + * + * The fourth parameter, `callback`, is also optional. It sets a function to + * call after the image loads. The new image is passed to the callback + * function as a p5.Element object. + * + * @method createImg + * @param {String} src relative path or URL for the image. + * @param {String} alt alternate text for the image. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * let img = createImg( + * 'https://p5js.org/assets/img/asterisk-01.png', + * 'The p5.js magenta asterisk.' + * ); + * img.position(0, -10); + * + * describe('A gray square with a magenta asterisk in its center.'); + * } + * + *
                              + */ + /** + * @method createImg + * @param {String} src + * @param {String} alt + * @param {String} [crossOrigin] crossOrigin property to use when fetching the image. + * @param {Function} [successCallback] function to call once the image loads. The new image will be passed + * to the function as a p5.Element object. + * @return {p5.Element} new p5.Element object. + */ + _main.default.prototype.createImg = function () { + _main.default._validateParameters('createImg', arguments); + var elt = document.createElement('img'); + var args = arguments; + var self; + if (args.length > 1 && typeof args[1] === 'string') { + elt.alt = args[1]; + } + if (args.length > 2 && typeof args[2] === 'string') { + elt.crossOrigin = args[2]; + } + elt.src = args[0]; + self = addElement(elt, this); + elt.addEventListener('load', function () { + self.width = elt.offsetWidth || elt.width; + self.height = elt.offsetHeight || elt.height; + var last = args[args.length - 1]; + if (typeof last === 'function') last(self); + }); + return self; + }; + /** + * Creates an `<a></a>` element that links to another web page. + * + * The first parmeter, `href`, is a string that sets the URL of the linked + * page. + * + * The second parameter, `html`, is a string that sets the inner HTML of the + * link. It's common to use text, images, or buttons as links. + * + * The third parameter, `target`, is optional. It's a string that tells the + * web browser where to open the link. By default, links open in the current + * browser tab. Passing `'_blank'` will cause the link to open in a new + * browser tab. MDN describes a few + * other options. + * + * @method createA + * @param {String} href URL of linked page. + * @param {String} html inner HTML of link element to display. + * @param {String} [target] target where the new link should open, + * either `'_blank'`, `'_self'`, `'_parent'`, or `'_top'`. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create an anchor element that links to p5js.org. + * let a = createA('http://p5js.org/', 'p5*js'); + * a.position(25, 35); + * + * describe('The text "p5*js" written at the center of a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create an anchor element that links to p5js.org. + * // Open the link in a new tab. + * let a = createA('http://p5js.org/', 'p5*js', '_blank'); + * a.position(25, 35); + * + * describe('The text "p5*js" written at the center of a gray square.'); + * } + * + *
                              + */ + _main.default.prototype.createA = function (href, html, target) { + _main.default._validateParameters('createA', arguments); + var elt = document.createElement('a'); + elt.href = href; + elt.innerHTML = html; + if (target) elt.target = target; + return addElement(elt, this); + }; + /** INPUT **/ + /** + * Creates a slider `<input></input>` element. Range sliders are + * useful for quickly selecting numbers from a given range. + * + * The first two parameters, `min` and `max`, are numbers that set the + * slider's minimum and maximum. + * + * The third parameter, `value`, is optional. It's a number that sets the + * slider's default value. + * + * The fourth parameter, `step`, is also optional. It's a number that sets the + * spacing between each value in the slider's range. Setting `step` to 0 + * allows the slider to move smoothly from `min` to `max`. + * + * @method createSlider + * @param {Number} min minimum value of the slider. + * @param {Number} max maximum value of the slider. + * @param {Number} [value] default value of the slider. + * @param {Number} [step] size for each step in the slider's range. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * slider = createSlider(0, 255); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A dark gray square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                              + * + *
                              + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * slider = createSlider(0, 255, 0); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                              + * + *
                              + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * // Set its step size to 50. + * slider = createSlider(0, 255, 0, 50); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                              + * + *
                              + * + * let slider; + * + * function setup() { + * // Create a slider and place it at the top of the canvas. + * // Set its default value to 0. + * // Set its step size to 0 so that it moves smoothly. + * slider = createSlider(0, 255, 0, 0); + * slider.position(10, 10); + * slider.size(80); + * + * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); + * } + * + * function draw() { + * // Use the slider as a grayscale value. + * let g = slider.value(); + * background(g); + * } + * + *
                              + */ + _main.default.prototype.createSlider = function (min, max, value, step) { + _main.default._validateParameters('createSlider', arguments); + var elt = document.createElement('input'); + elt.type = 'range'; + elt.min = min; + elt.max = max; + if (step === 0) { + elt.step = 1e-18; // smallest valid step + } else if (step) { + elt.step = step; + } + if (typeof value === 'number') elt.value = value; + return addElement(elt, this); + }; + /** + * Creates a `<button></button>` element. + * + * The first parameter, `label`, is a string that sets the label displayed on + * the button. + * + * The second parameter, `value`, is optional. It's a string that sets the + * button's value. See + * MDN + * for more details. + * + * @method createButton + * @param {String} label label displayed on the button. + * @param {String} [value] value of the button. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a button and place it beneath the canvas. + * let button = createButton('click me'); + * button.position(0, 100); + * + * // Use the button to change the background color. + * button.mousePressed(() => { + * let g = random(255); + * background(g); + * }); + * + * describe('A gray square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); + * } + * + *
                              + * + *
                              + * + * let button; + * + * function setup() { + * // Create a button and set its value to 0. + * // Place the button beneath the canvas. + * button = createButton('click me', 'red'); + * button.position(0, 100); + * + * // Change the button's value when the mouse + * // is pressed. + * button.mousePressed(() => { + * let c = random(['red', 'green', 'blue', 'yellow']); + * button.value(c); + * }); + * + * describe('A red square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); + * } + * + * function draw() { + * // Use the button's value to set the background color. + * let c = button.value(); + * background(c); + * } + * + *
                              + */ + _main.default.prototype.createButton = function (label, value) { + _main.default._validateParameters('createButton', arguments); + var elt = document.createElement('button'); + elt.innerHTML = label; + if (value) elt.value = value; + return addElement(elt, this); + }; + /** + * Creates a checkbox `<input></input>` element. Checkboxes extend + * the p5.Element class with a `checked()` method. + * Calling `myBox.checked()` returns `true` if it the box is checked and + * `false` otherwise. + * + * The first parameter, `label`, is optional. It's a string that sets the label + * to display next to the checkbox. + * + * The second parameter, `value`, is also optional. It's a boolean that sets the + * checkbox's value. + * + * @method createCheckbox + * @param {String} [label] label displayed after the checkbox. + * @param {boolean} [value] value of the checkbox. Checked is `true` and unchecked is `false`. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * checkbox = createCheckbox(); + * checkbox.position(0, 100); + * + * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
                              + * + *
                              + * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * // Label the checkbox "white". + * checkbox = createCheckbox(' white'); + * checkbox.position(0, 100); + * + * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
                              + * + *
                              + * + * let checkbox; + * + * function setup() { + * // Create a checkbox and place it beneath the canvas. + * // Label the checkbox "white" and set its value to true. + * checkbox = createCheckbox(' white', true); + * checkbox.position(0, 100); + * + * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.'); + * } + * + * function draw() { + * // Use the checkbox to set the background color. + * if (checkbox.checked()) { + * background(255); + * } else { + * background(0); + * } + * } + * + *
                              + */ + _main.default.prototype.createCheckbox = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('createCheckbox', args); + // Create a container element + var elt = document.createElement('div'); + // Create checkbox type input element + var checkbox = document.createElement('input'); + checkbox.type = 'checkbox'; + // Create label element and wrap it around checkbox + var label = document.createElement('label'); + label.appendChild(checkbox); + // Append label element inside the container + elt.appendChild(label); + //checkbox must be wrapped in p5.Element before label so that label appears after + var self = addElement(elt, this); + self.checked = function () { + var cb = self.elt.firstElementChild.getElementsByTagName('input') [0]; + if (cb) { + if (arguments.length === 0) { + return cb.checked; + } else if (arguments.length <= 0 ? undefined : arguments[0]) { + cb.checked = true; + } else { + cb.checked = false; + } + } + return self; + }; + this.value = function (val) { + self.value = val; + return this; + }; + // Set the span element innerHTML as the label value if passed + if (args[0]) { + self.value(args[0]); + var span = document.createElement('span'); + span.innerHTML = args[0]; + label.appendChild(span); + } // Set the checked value of checkbox if passed + + if (args[1]) { + checkbox.checked = true; + } + return self; + }; + /** + * Creates a dropdown menu `<select></select>` element. + * + * The parameter is optional. If `true` is passed, as in + * `let mySelect = createSelect(true)`, then the dropdown will support + * multiple selections. If an existing `<select></select>` element + * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing + * element will be wrapped in a new p5.Element + * object. + * + * Dropdowns extend the p5.Element class with a few + * helpful methods for managing options: + * - `mySelect.option(name, [value])` adds an option to the menu. The first paremeter, `name`, is a string that sets the option's name and value. The second parameter, `value`, is optional. If provided, it sets the value that corresponds to the key `name`. If an option with `name` already exists, its value is changed to `value`. + * - `mySelect.value()` returns the currently-selected option's value. + * - `mySelect.selected()` returns the currently-selected option. + * - `mySelect.selected(option)` selects the given option by default. + * - `mySelect.disable()` marks the whole dropdown element as disabled. + * - `mySelect.disable(option)` marks a given option as disabled. + * - `mySelect.enable()` marks the whole dropdown element as enabled. + * - `mySelect.enable(option)` marks a given option as enabled. + * + * @method createSelect + * @param {boolean} [multiple] support multiple selections. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * let mySelect; + * + * function setup() { + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * // Set the selected option to "red". + * mySelect.selected('red'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
                              + * + *
                              + * + * let mySelect; + * + * function setup() { + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * // Set the selected option to "red". + * mySelect.selected('red'); + * + * // Disable the "yellow" option. + * mySelect.disable('yellow'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
                              + * + *
                              + * + * let mySelect; + * + * function setup() { + * // Create a dropdown and place it beneath the canvas. + * mySelect = createSelect(); + * mySelect.position(0, 100); + * + * // Add color options with names and values. + * mySelect.option('one', 'red'); + * mySelect.option('two', 'green'); + * mySelect.option('three', 'blue'); + * mySelect.option('four', 'yellow'); + * + * // Set the selected option to "one". + * mySelect.selected('one'); + * + * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); + * } + * + * function draw() { + * // Use the selected value to paint the background. + * let c = mySelect.selected(); + * background(c); + * } + * + *
                              + * + *
                              + * + * // Hold CTRL to select multiple options on Windows and Linux. + * // Hold CMD to select multiple options on macOS. + * let mySelect; + * + * function setup() { + * // Create a dropdown and allow multiple selections. + * // Place it beneath the canvas. + * mySelect = createSelect(true); + * mySelect.position(0, 100); + * + * // Add color options. + * mySelect.option('red'); + * mySelect.option('green'); + * mySelect.option('blue'); + * mySelect.option('yellow'); + * + * describe('A gray square with a dropdown menu beneath it. Colorful circles appear when their color is selected.'); + * } + * + * function draw() { + * background(200); + * + * // Use the selected value(s) to draw circles. + * let colors = mySelect.selected(); + * colors.forEach((c, index) => { + * let x = 10 + index * 20; + * fill(c); + * circle(x, 50, 20); + * }); + * } + * + *
                              + */ + /** + * @method createSelect + * @param {Object} existing select element to wrap, either as a p5.Element or + * a HTMLSelectElement. + * @return {p5.Element} + */ + _main.default.prototype.createSelect = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('createSelect', args); + var self; + var arg = args[0]; + if (arg instanceof _main.default.Element && arg.elt instanceof HTMLSelectElement) { + // If given argument is p5.Element of select type + self = arg; + this.elt = arg.elt; + } else if (arg instanceof HTMLSelectElement) { + self = addElement(arg, this); + this.elt = arg; + } else { + var elt = document.createElement('select'); + if (arg && typeof arg === 'boolean') { + elt.setAttribute('multiple', 'true'); + } + self = addElement(elt, this); + this.elt = elt; + } + self.option = function (name, value) { + var index; + // if no name is passed, return + if (name === undefined) { + return; + } //see if there is already an option with this name + + for (var i = 0; i < this.elt.length; i += 1) { + if (this.elt[i].textContent === name) { + index = i; + break; + } + } //if there is an option with this name we will modify it + + if (index !== undefined) { + //if the user passed in false then delete that option + if (value === false) { + this.elt.remove(index); + } else { + // Update the option at index with the value + this.elt[index].value = value; + } + } else { + //if it doesn't exist create it + var opt = document.createElement('option'); + opt.textContent = name; + opt.value = value === undefined ? name : value; + this.elt.appendChild(opt); + this._pInst._elements.push(opt); + } + }; + self.selected = function (value) { + // Update selected status of option + if (value !== undefined) { + for (var i = 0; i < this.elt.length; i += 1) { + if (this.elt[i].value.toString() === value.toString()) { + this.elt.selectedIndex = i; + } + } + return this; + } else { + if (this.elt.getAttribute('multiple')) { + var arr = [ + ]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this.elt.selectedOptions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var selectedOption = _step.value; + arr.push(selectedOption.value); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return arr; + } else { + return this.elt.value; + } + } + }; + self.disable = function (value) { + if (typeof value === 'string') { + for (var i = 0; i < this.elt.length; i++) { + if (this.elt[i].value.toString() === value) { + this.elt[i].disabled = true; + this.elt[i].selected = false; + } + } + } else { + this.elt.disabled = true; + } + return this; + }; + self.enable = function (value) { + if (typeof value === 'string') { + for (var i = 0; i < this.elt.length; i++) { + if (this.elt[i].value.toString() === value) { + this.elt[i].disabled = false; + this.elt[i].selected = false; + } + } + } else { + this.elt.disabled = false; + for (var _i = 0; _i < this.elt.length; _i++) { + this.elt[_i].disabled = false; + this.elt[_i].selected = false; + } + } + return this; + }; + return self; + }; + /** + * Creates a radio button element. + * + * The parameter is optional. If a string is passed, as in + * `let myRadio = createSelect('food')`, then each radio option will + * have `"food"` as its `name` parameter: `<input name="food"></input>`. + * If an existing `<div></div>` or `<span></span>` + * element is passed, as in `let myRadio = createSelect(container)`, it will + * become the radio button's parent element. + * + * Radio buttons extend the p5.Element class with a few + * helpful methods for managing options: + * - `myRadio.option(value, [label])` adds an option to the menu. The first paremeter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned. + * - `myRadio.value()` returns the currently-selected option's value. + * - `myRadio.selected()` returns the currently-selected option. + * - `myRadio.selected(value)` selects the given option and returns it as an `HTMLInputElement`. + * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed. + * + * @method createRadio + * @param {Object} [containerElement] container HTML Element, either a `<div></div>` + * or `<span></span>`. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(60); + * + * // Add a few color options. + * myRadio.option('red'); + * myRadio.option('yellow'); + * myRadio.option('blue'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * describe('A yellow square with three color options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let g = myRadio.value(); + * background(g); + * } + * + *
                              + * + *
                              + * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(50); + * + * // Add a few color options. + * // Color values are labeled with + * // emotions they evoke. + * myRadio.option('red', 'love'); + * myRadio.option('yellow', 'joy'); + * myRadio.option('blue', 'trust'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * describe('A yellow square with three options listed, "love", "joy", and "trust". The square changes color when the user selects a new option.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let c = myRadio.value(); + * background(c); + * } + * + *
                              + * + *
                              + * + * let myRadio; + * + * function setup() { + * // Create a radio button element and place it + * // in the top-left corner. + * myRadio = createRadio(); + * myRadio.position(0, 0); + * myRadio.size(50); + * + * // Add a few color options. + * myRadio.option('red'); + * myRadio.option('yellow'); + * myRadio.option('blue'); + * + * // Choose a default option. + * myRadio.selected('yellow'); + * + * // Create a button and place it beneath the canvas. + * let btn = createButton('disable'); + * btn.position(0, 100); + * + * // Use the button to disable the radio button. + * btn.mousePressed(() => { + * myRadio.disable(true); + * }); + * + * describe('A yellow square with three options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option. A "disable" button beneath the canvas disables the color options when pressed.'); + * } + * + * function draw() { + * // Set the background color using the radio button. + * let c = myRadio.value(); + * background(c); + * } + * + *
                              + */ + /** + * @method createRadio + * @param {String} [name] name parameter assigned to each option's `<input></input>` element. + * @return {p5.Element} new p5.Element object. + */ + /** + * @method createRadio + * @return {p5.Element} new p5.Element object. + */ + _main.default.prototype.createRadio = function () { + // Creates a div, adds each option as an individual input inside it. + // If already given with a containerEl, will search for all input[radio] + // it, create a p5.Element out of it, add options to it and return the p5.Element. + var self; + var radioElement; + var name; + var arg0 = arguments.length <= 0 ? undefined : arguments[0]; + if (arg0 instanceof _main.default.Element && (arg0.elt instanceof HTMLDivElement || arg0.elt instanceof HTMLSpanElement)) { + // If given argument is p5.Element of div/span type + self = arg0; + this.elt = arg0.elt; + } else if ( // If existing radio Element is provided as argument 0 + arg0 instanceof HTMLDivElement || arg0 instanceof HTMLSpanElement) { + self = addElement(arg0, this); + this.elt = arg0; + radioElement = arg0; + if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'string') name = arguments.length <= 1 ? undefined : arguments[1]; + } else { + if (typeof arg0 === 'string') name = arg0; + radioElement = document.createElement('div'); + self = addElement(radioElement, this); + this.elt = radioElement; + } + self._name = name || 'radioOption'; + // setup member functions + var isRadioInput = function isRadioInput(el) { + return el instanceof HTMLInputElement && el.type === 'radio'; + }; + var isLabelElement = function isLabelElement(el) { + return el instanceof HTMLLabelElement; + }; + var isSpanElement = function isSpanElement(el) { + return el instanceof HTMLSpanElement; + }; + self._getOptionsArray = function () { + return Array.from(this.elt.children).filter(function (el) { + return isRadioInput(el) || isLabelElement(el) && isRadioInput(el.firstElementChild); + }).map(function (el) { + return isRadioInput(el) ? el : el.firstElementChild; + }); + }; + self.option = function (value, label) { + // return an option with this value, create if not exists. + var optionEl; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = self._getOptionsArray() [Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var option = _step2.value; + if (option.value === value) { + optionEl = option; + break; + } + } // Create a new option, add it to radioElement and return it. + + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + if (optionEl === undefined) { + optionEl = document.createElement('input'); + optionEl.setAttribute('type', 'radio'); + optionEl.setAttribute('value', value); + } + optionEl.setAttribute('name', self._name); + // Check if label element exists, else create it + var labelElement; + if (!isLabelElement(optionEl.parentElement)) { + labelElement = document.createElement('label'); + labelElement.insertAdjacentElement('afterbegin', optionEl); + } else { + labelElement = optionEl.parentElement; + } // Check if span element exists, else create it + + var spanElement; + if (!isSpanElement(labelElement.lastElementChild)) { + spanElement = document.createElement('span'); + optionEl.insertAdjacentElement('afterend', spanElement); + } else { + spanElement = labelElement.lastElementChild; + } // Set the innerHTML of span element as the label text + + spanElement.innerHTML = label === undefined ? value : label; + // Append the label element, which includes option element and + // span element to the radio container element + this.elt.appendChild(labelElement); + return optionEl; + }; + self.remove = function (value) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = self._getOptionsArray() [Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var optionEl = _step3.value; + if (optionEl.value === value) { + if (isLabelElement(optionEl.parentElement)) { + // Remove parent label which also removes children elements + optionEl.parentElement.remove(); + } else { + // Remove the option input if parent label does not exist + optionEl.remove(); + } + return; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + }; + self.value = function () { + var result = ''; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for (var _iterator4 = self._getOptionsArray() [Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var option = _step4.value; + if (option.checked) { + result = option.value; + break; + } + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + return result; + }; + self.selected = function (value) { + var result = null; + if (value === undefined) { + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + try { + for (var _iterator5 = self._getOptionsArray() [Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var option = _step5.value; + if (option.checked) { + result = option; + break; + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + } else { + // forEach loop to uncheck all radio buttons before + // setting any one as checked. + self._getOptionsArray().forEach(function (option) { + option.checked = false; + option.removeAttribute('checked'); + }); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + try { + for (var _iterator6 = self._getOptionsArray() [Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var _option = _step6.value; + if (_option.value === value) { + _option.setAttribute('checked', true); + _option.checked = true; + result = _option; + } + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return != null) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + } + return result; + }; + self.disable = function () { + var shouldDisable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + try { + for (var _iterator7 = self._getOptionsArray() [Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var radioInput = _step7.value; + radioInput.setAttribute('disabled', shouldDisable); + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return != null) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + }; + return self; + }; + /** + * Creates a color picker element. + * + * The parameter, `value`, is optional. If a color string or + * p5.Color object is passed, it will set the default + * color. + * + * Color pickers extend the p5.Element class with a + * couple of helpful methods for managing colors: + * - `myPicker.value()` returns the current color as a hex string in the format `'#rrggbb'`. + * - `myPicker.color()` returns the current color as a p5.Color object. + * + * + * @method createColorPicker + * @param {String|p5.Color} [value] default color as a CSS color string. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * let myPicker; + * + * function setup() { + * myPicker = createColorPicker('deeppink'); + * myPicker.position(0, 100); + * + * describe('A pink square with a color picker beneath it. The square changes color when the user picks a new color.'); + * } + * + * function draw() { + * // Use the color picker to paint the background. + * let c = myPicker.color(); + * background(c); + * } + * + *
                              + * + *
                              + * + * let myPicker; + * + * function setup() { + * myPicker = createColorPicker('deeppink'); + * myPicker.position(0, 100); + * + * describe('A number with the format "#rrggbb" is displayed on a pink canvas. The background color and number change when the user picks a new color.'); + * } + * + * function draw() { + * // Use the color picker to paint the background. + * let c = myPicker.value(); + * background(c); + * + * // Display the current color as a hex string. + * text(c, 25, 55); + * } + * + *
                              + */ + _main.default.prototype.createColorPicker = function (value) { + _main.default._validateParameters('createColorPicker', arguments); + var elt = document.createElement('input'); + var self; + elt.type = 'color'; + if (value) { + if (value instanceof _main.default.Color) { + elt.value = value.toString('#rrggbb'); + } else { + _main.default.prototype._colorMode = 'rgb'; + _main.default.prototype._colorMaxes = { + rgb: [ + 255, + 255, + 255, + 255 + ], + hsb: [ + 360, + 100, + 100, + 1 + ], + hsl: [ + 360, + 100, + 100, + 1 + ] + }; + elt.value = _main.default.prototype.color(value).toString('#rrggbb'); + } + } else { + elt.value = '#000000'; + } + self = addElement(elt, this); + // Method to return a p5.Color object for the given color. + self.color = function () { + if (value) { + if (value.mode) { + _main.default.prototype._colorMode = value.mode; + } + if (value.maxes) { + _main.default.prototype._colorMaxes = value.maxes; + } + } + return _main.default.prototype.color(this.elt.value); + }; + return self; + }; + /** + * Creates a text `<input></input>` element. Call `myInput.size()` + * to set the length of the text box. + * + * The first parameter, `value`, is optional. It's a string that sets the + * input's default value. The input is blank by default. + * + * The second parameter, `type`, is also optional. It's a string that + * specifies the type of text being input. See MDN for a full + * list of options. + * The default is `'text'`. + * + * @method createInput + * @param {String} [value] default value of the input box. Defaults to an empty string `''`. + * @param {String} [type] type of input. Defaults to `'text'`. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * let myInput; + * + * function setup() { + * // Create an input element and place it + * // beneath the canvas. + * myInput = createInput(); + * myInput.position(0, 100); + * + * describe('A gray square with a text box beneath it. The text in the square changes when the user types something new in the input bar.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input to display a message. + * let msg = myInput.value(); + * text(msg, 25, 55); + * } + * + *
                              + * + *
                              + * + * let myInput; + * + * function setup() { + * // Create an input element and place it + * // beneath the canvas. Set its default + * // text to "hello!". + * myInput = createInput('hello!'); + * myInput.position(0, 100); + * + * describe('The text "hello!" written at the center of a gray square. A text box beneath the square also says "hello!". The text in the square changes when the user types something new in the input bar.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input to display a message. + * let msg = myInput.value(); + * text(msg, 25, 55); + * } + * + *
                              + */ + /** + * @method createInput + * @param {String} [value] + * @return {p5.Element} + */ + _main.default.prototype.createInput = function () { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text'; + _main.default._validateParameters('createInput', arguments); + var elt = document.createElement('input'); + elt.setAttribute('value', value); + elt.setAttribute('type', type); + return addElement(elt, this); + }; + /** + * Creates an `<input></input>` element of type `'file'`. + * This allows users to select local files for use in a sketch. + * + * The first parameter, `callback`, is a function that's called when the file + * loads. The callback function should have one parameter, `file`, that's a + * p5.File object. + * + * The second parameter, `multiple`, is optional. It's a boolean value that + * allows loading multiple files if set to `true`. If `true`, `callback` + * will be called once per file. + * + * @method createFileInput + * @param {Function} callback function to call once the file loads. + * @param {Boolean} [multiple] allow multiple files to be selected. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * // Use the file input to select an image to + * // load and display. + * let input; + * let img; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. + * input = createFileInput(handleImage); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); + * } + * + * function draw() { + * background(200); + * + * // Draw the image if loaded. + * if (img) { + * image(img, 0, 0, width, height); + * } + * } + * + * // Create an image if the file is an image. + * function handleImage(file) { + * if (file.type === 'image') { + * img = createImg(file.data, ''); + * img.hide(); + * } else { + * img = null; + * } + * } + * + *
                              + * + *
                              + * + * // Use the file input to select multiple images + * // to load and display. + * let input; + * let images = []; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. Allow it to load multiple files. + * input = createFileInput(handleImage, true); + * input.position(0, 100); + * } + * + * function draw() { + * background(200); + * + * // Draw the images if loaded. Each image + * // is drawn 20 pixels lower than the + * // previous image. + * images.forEach((img, index) => { + * let y = index * 20; + * image(img, 0, y, width, height); + * }); + * + * describe('A gray square with a file input beneath it. If the user selects multiple image files to load, they are displayed on the square.'); + * } + * + * // Create an image if the file is an image, + * // then add it to the images array. + * function handleImage(file) { + * if (file.type === 'image') { + * let img = createImg(file.data, ''); + * img.hide(); + * images.push(img); + * } + * } + * + *
                              + */ + _main.default.prototype.createFileInput = function (callback) { + var multiple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + _main.default._validateParameters('createFileInput', arguments); + var handleFileSelect = function handleFileSelect(event) { + var _iteratorNormalCompletion8 = true; + var _didIteratorError8 = false; + var _iteratorError8 = undefined; + try { + for (var _iterator8 = event.target.files[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { + var file = _step8.value; + _main.default.File._load(file, callback); + } + } catch (err) { + _didIteratorError8 = true; + _iteratorError8 = err; + } finally { + try { + if (!_iteratorNormalCompletion8 && _iterator8.return != null) { + _iterator8.return(); + } + } finally { + if (_didIteratorError8) { + throw _iteratorError8; + } + } + } + }; + // If File API's are not supported, throw Error + if (!(window.File && window.FileReader && window.FileList && window.Blob)) { + console.log('The File APIs are not fully supported in this browser. Cannot create element.'); + return; + } + var fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + if (multiple) fileInput.setAttribute('multiple', true); + fileInput.addEventListener('change', handleFileSelect, false); + return addElement(fileInput, this); + }; + /** VIDEO STUFF **/ + // Helps perform similar tasks for media element methods. + function createMedia(pInst, type, src, callback) { + var elt = document.createElement(type); + // Create source elements from given sources + src = src || ''; + if (typeof src === 'string') { + src = [ + src + ]; + } + var _iteratorNormalCompletion9 = true; + var _didIteratorError9 = false; + var _iteratorError9 = undefined; + try { + for (var _iterator9 = src[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { + var mediaSource = _step9.value; + var sourceEl = document.createElement('source'); + sourceEl.setAttribute('src', mediaSource); + elt.appendChild(sourceEl); + } // If callback is provided, attach to element + + } catch (err) { + _didIteratorError9 = true; + _iteratorError9 = err; + } finally { + try { + if (!_iteratorNormalCompletion9 && _iterator9.return != null) { + _iterator9.return(); + } + } finally { + if (_didIteratorError9) { + throw _iteratorError9; + } + } + } + if (typeof callback === 'function') { + var callbackHandler = function callbackHandler() { + callback(); + elt.removeEventListener('canplaythrough', callbackHandler); + }; + elt.addEventListener('canplaythrough', callbackHandler); + } + var mediaEl = addElement(elt, pInst, true); + mediaEl.loadedmetadata = false; + // set width and height onload metadata + elt.addEventListener('loadedmetadata', function () { + mediaEl.width = elt.videoWidth; + mediaEl.height = elt.videoHeight; + // set elt width and height if not set + if (mediaEl.elt.width === 0) mediaEl.elt.width = elt.videoWidth; + if (mediaEl.elt.height === 0) mediaEl.elt.height = elt.videoHeight; + if (mediaEl.presetPlaybackRate) { + mediaEl.elt.playbackRate = mediaEl.presetPlaybackRate; + delete mediaEl.presetPlaybackRate; + } + mediaEl.loadedmetadata = true; + }); + return mediaEl; + } /** + * Creates a `<video>` element for simple audio/video playback. + * Returns a new p5.MediaElement object. + * + * Videos are shown by default. They can be hidden by calling `video.hide()` + * and drawn to the canvas using image(). + * + * The first parameter, `src`, is the path the video. If a single string is + * passed, as in `'assets/topsecret.mp4'`, a single video is loaded. An array + * of strings can be used to load the same video in different formats. For + * example, `['assets/topsecret.mp4', 'assets/topsecret.ogv', 'assets/topsecret.webm']`. + * This is useful for ensuring that the video can play across different browsers with + * different capabilities. See + * MDN + * for more information about supported formats. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the video is ready to play. + * + * @method createVideo + * @param {String|String[]} src path to a video file, or an array of paths for + * supporting different browsers. + * @param {Function} [callback] function to call once the video is ready to play. + * @return {p5.MediaElement} new p5.MediaElement object. + * @example + *
                              + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Note: this may not work in some browsers. + * let video = createVideo('assets/small.mp4'); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Provide an array options for different file formats. + * let video = createVideo( + * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'] + * ); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + *
                              + * + *
                              + * + * let video; + * + * function setup() { + * noCanvas(); + * + * // Load a video and add it to the page. + * // Provide an array options for different file formats. + * // Call mute() once the video loads. + * video = createVideo( + * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'], + * muteVideo + * ); + * // Show the default video controls. + * video.showControls(); + * + * describe('A video of a toy robot with playback controls beneath it.'); + * } + * + * // Mute the video once it loads. + * function muteVideo() { + * video.volume(0); + * } + * + *
                              + */ + + _main.default.prototype.createVideo = function (src, callback) { + _main.default._validateParameters('createVideo', arguments); + return createMedia(this, 'video', src, callback); + }; + /** AUDIO STUFF **/ + /** + * Creates a hidden `<audio>` element for simple audio playback. + * Returns a new p5.MediaElement object. + * + * The first parameter, `src`, is the path the video. If a single string is + * passed, as in `'assets/video.mp4'`, a single video is loaded. An array + * of strings can be used to load the same video in different formats. For + * example, `['assets/video.mp4', 'assets/video.ogv', 'assets/video.webm']`. + * This is useful for ensuring that the video can play across different + * browsers with different capabilities. See + * MDN + * for more information about supported formats. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the audio is ready to play. + * + * @method createAudio + * @param {String|String[]} [src] path to an audio file, or an array of paths + * for supporting different browsers. + * @param {Function} [callback] function to call once the audio is ready to play. + * @return {p5.MediaElement} new p5.MediaElement object. + * @example + *
                              + * + * function setup() { + * noCanvas(); + * + * // Load the audio. + * let beat = createAudio('assets/beat.mp3'); + * // Show the default audio controls. + * beat.showControls(); + * + * describe('An audio beat plays when the user double-clicks the square.'); + * } + * + *
                              + */ + _main.default.prototype.createAudio = function (src, callback) { + _main.default._validateParameters('createAudio', arguments); + return createMedia(this, 'audio', src, callback); + }; + /** CAMERA STUFF **/ + _main.default.prototype.VIDEO = 'video'; + _main.default.prototype.AUDIO = 'audio'; + // from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia + // Older browsers might not implement mediaDevices at all, so we set an empty object first + if (navigator.mediaDevices === undefined) { + navigator.mediaDevices = { + }; + } // Some browsers partially implement mediaDevices. We can't just assign an object + // with getUserMedia as it would overwrite existing properties. + // Here, we will just add the getUserMedia property if it's missing. + + if (navigator.mediaDevices.getUserMedia === undefined) { + navigator.mediaDevices.getUserMedia = function (constraints) { + // First get ahold of the legacy getUserMedia, if present + var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia; + // Some browsers just don't implement it - return a rejected promise with an error + // to keep a consistent interface + if (!getUserMedia) { + return Promise.reject(new Error('getUserMedia is not implemented in this browser')); + } // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise + + return new Promise(function (resolve, reject) { + getUserMedia.call(navigator, constraints, resolve, reject); + }); + }; + } /** + * Creates a `<video>` element that "captures" the audio/video stream from + * the webcam and microphone. Returns a new + * p5.Element object. + * + * Videos are shown by default. They can be hidden by calling `capture.hide()` + * and drawn to the canvas using image(). + * + * The first parameter, `type`, is optional. It sets the type of capture to + * use. By default, `createCapture()` captures both audio and video. If `VIDEO` + * is passed, as in `createCapture(VIDEO)`, only video will be captured. + * If `AUDIO` is passed, as in `createCapture(AUDIO)`, only audio will be + * captured. A constraints object can also be passed to customize the stream. + * See the + * W3C documentation for possible properties. Different browsers support different + * properties. + * + * The second parameter, `callback`, is optional. It's a function to call once + * the capture is ready for use. The callback function should have one + * parameter, `stream`, that's a + * MediaStream object. + * + * Note: `createCapture()` only works when running a sketch locally or using HTTPS. Learn more + * here + * and here. + * + * @method createCapture + * @param {String|Constant|Object} [type] type of capture, either AUDIO or VIDEO, + * or a constraints object. Both video and audio + * audio streams are captured by default. + * @param {Function} [callback] function to call once the stream + * has loaded. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * noCanvas(); + * createCapture(VIDEO); + * + * describe('A video stream from the webcam.'); + * } + * + *
                              + * + *
                              + * + * let capture; + * + * function setup() { + * // Create the video capture and hide the element. + * capture = createCapture(VIDEO); + * capture.hide(); + * + * describe('A video stream from the webcam with inverted colors.'); + * } + * + * function draw() { + * // Draw the video capture within the canvas. + * image(capture, 0, 0, width, width * capture.height / capture.width); + * // Invert the colors in the stream. + * filter(INVERT); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(480, 120); + * + * // Create a constraints object. + * let constraints = { + * video: { + * mandatory: { + * minWidth: 1280, + * minHeight: 720 + * }, + * optional: [{ maxFrameRate: 10 }] + * }, + * audio: false + * }; + * + * // Create the video capture. + * createCapture(constraints); + * + * describe('A video stream from the webcam.'); + * } + * + *
                              + */ + + _main.default.prototype.createCapture = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('createCapture', args); + // return if getUserMedia is not supported by browser + if (!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia)) { + throw new DOMException('getUserMedia not supported in this browser'); + } + var useVideo = true; + var useAudio = true; + var constraints; + var callback; + for (var _i2 = 0, _args = args; _i2 < _args.length; _i2++) { + var arg = _args[_i2]; + if (arg === _main.default.prototype.VIDEO) useAudio = false; + else if (arg === _main.default.prototype.AUDIO) useVideo = false; + else if (_typeof(arg) === 'object') constraints = arg; + else if (typeof arg === 'function') callback = arg; + } + if (!constraints) constraints = { + video: useVideo, + audio: useAudio + }; + var domElement = document.createElement('video'); + // required to work in iOS 11 & up: + domElement.setAttribute('playsinline', ''); + navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + try { + if ('srcObject' in domElement) { + domElement.srcObject = stream; + } else { + domElement.src = window.URL.createObjectURL(stream); + } + } catch (err) { + domElement.src = stream; + } + }, console.log); + var videoEl = addElement(domElement, this, true); + videoEl.loadedmetadata = false; + // set width and height onload metadata + domElement.addEventListener('loadedmetadata', function () { + domElement.play(); + if (domElement.width) { + videoEl.width = domElement.width; + videoEl.height = domElement.height; + } else { + videoEl.width = videoEl.elt.width = domElement.videoWidth; + videoEl.height = videoEl.elt.height = domElement.videoHeight; + } + videoEl.loadedmetadata = true; + if (callback) callback(domElement.srcObject); + }); + return videoEl; + }; + /** + * Creates a new p5.Element object. + * + * The first parameter, `tag`, is a string an HTML tag such as `'h5'`. + * + * The second parameter, `content`, is optional. It's a string that sets the + * HTML content to insert into the new element. New elements have no content + * by default. + * + * @method createElement + * @param {String} tag tag for the new element. + * @param {String} [content] HTML content to insert into the element. + * @return {p5.Element} new p5.Element object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create an h5 element with nothing in it. + * createElement('h5'); + * + * describe('A gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create an h5 element with the content + * // "p5*js". + * let h5 = createElement('h5', 'p5*js'); + * // Set the element's style and position. + * h5.style('color', 'deeppink'); + * h5.position(30, 15); + * + * describe('The text "p5*js" written in pink in the middle of a gray square.'); + * } + * + *
                              + */ + _main.default.prototype.createElement = function (tag, content) { + _main.default._validateParameters('createElement', arguments); + var elt = document.createElement(tag); + if (typeof content !== 'undefined') { + elt.innerHTML = content; + } + return addElement(elt, this); + }; + // ============================================================================= + // p5.Element additions + // ============================================================================= + /** + * + * Adds specified class to the element. + * + * @for p5.Element + * @method addClass + * @param {String} class name of class to add + * @chainable + * @example + *
                              + * let div = createDiv('div'); + * div.addClass('myClass'); + *
                              + */ + _main.default.Element.prototype.addClass = function (c) { + if (this.elt.className) { + if (!this.hasClass(c)) { + this.elt.className = this.elt.className + ' ' + c; + } + } else { + this.elt.className = c; + } + return this; + }; + /** + * + * Removes specified class from the element. + * + * @method removeClass + * @param {String} class name of class to remove + * @chainable + * @example + *
                              + * // In this example, a class is set when the div is created + * // and removed when mouse is pressed. This could link up + * // with a CSS style rule to toggle style properties. + * + * let div; + * + * function setup() { + * div = createDiv('div'); + * div.addClass('myClass'); + * } + * + * function mousePressed() { + * div.removeClass('myClass'); + * } + *
                              + */ + _main.default.Element.prototype.removeClass = function (c) { + // Note: Removing a class that does not exist does NOT throw an error in classList.remove method + this.elt.classList.remove(c); + return this; + }; + /** + * + * Checks if specified class is already applied to element. + * + * @method hasClass + * @returns {boolean} a boolean value if element has specified class + * @param c {String} class name of class to check + * @example + *
                              + * let div; + * + * function setup() { + * div = createDiv('div'); + * div.addClass('show'); + * } + * + * function mousePressed() { + * if (div.hasClass('show')) { + * div.addClass('show'); + * } else { + * div.removeClass('show'); + * } + * } + *
                              + */ + _main.default.Element.prototype.hasClass = function (c) { + return this.elt.classList.contains(c); + }; + /** + * + * Toggles element class. + * + * @method toggleClass + * @param c {String} class name to toggle + * @chainable + * @example + *
                              + * let div; + * + * function setup() { + * div = createDiv('div'); + * div.addClass('show'); + * } + * + * function mousePressed() { + * div.toggleClass('show'); + * } + *
                              + */ + _main.default.Element.prototype.toggleClass = function (c) { + // classList also has a toggle() method, but we cannot use that yet as support is unclear. + // See https://github.com/processing/p5.js/issues/3631 + // this.elt.classList.toggle(c); + if (this.elt.classList.contains(c)) { + this.elt.classList.remove(c); + } else { + this.elt.classList.add(c); + } + return this; + }; + /** + * + * Attaches the element as a child to the parent specified. + * Accepts either a string ID, DOM node, or p5.Element. + * If no argument is specified, an array of children DOM nodes is returned. + * + * @method child + * @returns {Node[]} an array of child nodes + * @example + *
                              + * let div0 = createDiv('this is the parent'); + * let div1 = createDiv('this is the child'); + * div0.child(div1); // use p5.Element + *
                              + *
                              + * let div0 = createDiv('this is the parent'); + * let div1 = createDiv('this is the child'); + * div1.id('apples'); + * div0.child('apples'); // use id + *
                              + *
                              + * // this example assumes there is a div already on the page + * // with id "myChildDiv" + * let div0 = createDiv('this is the parent'); + * let elt = document.getElementById('myChildDiv'); + * div0.child(elt); // use element from page + *
                              + */ + /** + * @method child + * @param {String|p5.Element} [child] the ID, DOM node, or p5.Element + * to add to the current element + * @chainable + */ + _main.default.Element.prototype.child = function (childNode) { + if (typeof childNode === 'undefined') { + return this.elt.childNodes; + } + if (typeof childNode === 'string') { + if (childNode[0] === '#') { + childNode = childNode.substring(1); + } + childNode = document.getElementById(childNode); + } else if (childNode instanceof _main.default.Element) { + childNode = childNode.elt; + } + if (childNode instanceof HTMLElement) { + this.elt.appendChild(childNode); + } + return this; + }; + /** + * Centers a p5.Element either vertically, horizontally, + * or both, relative to its parent or according to + * the body if the p5.Element has no parent. If no argument is passed + * the p5.Element is aligned both vertically and horizontally. + * + * @method center + * @param {String} [align] passing 'vertical', 'horizontal' aligns element accordingly + * @chainable + * + * @example + *
                              + * function setup() { + * let div = createDiv('').size(10, 10); + * div.style('background-color', 'orange'); + * div.center(); + * } + *
                              + */ + _main.default.Element.prototype.center = function (align) { + var style = this.elt.style.display; + var hidden = this.elt.style.display === 'none'; + var parentHidden = this.parent().style.display === 'none'; + var pos = { + x: this.elt.offsetLeft, + y: this.elt.offsetTop + }; + if (hidden) this.show(); + if (parentHidden) this.parent().show(); + this.elt.style.display = 'block'; + this.position(0, 0); + var wOffset = Math.abs(this.parent().offsetWidth - this.elt.offsetWidth); + var hOffset = Math.abs(this.parent().offsetHeight - this.elt.offsetHeight); + if (align === 'both' || align === undefined) { + this.position(wOffset / 2 + this.parent().offsetLeft, hOffset / 2 + this.parent().offsetTop); + } else if (align === 'horizontal') { + this.position(wOffset / 2 + this.parent().offsetLeft, pos.y); + } else if (align === 'vertical') { + this.position(pos.x, hOffset / 2 + this.parent().offsetTop); + } + this.style('display', style); + if (hidden) this.hide(); + if (parentHidden) this.parent().hide(); + return this; + }; + /** + * + * If an argument is given, sets the inner HTML of the element, + * replacing any existing HTML. If true is included as a second + * argument, HTML is appended instead of replacing existing HTML. + * If no arguments are given, returns + * the inner HTML of the element. + * + * @for p5.Element + * @method html + * @returns {String} the inner HTML of the element + * @example + *
                              + * let div = createDiv('').size(100, 100); + * div.html('hi'); + *
                              + *
                              + * let div = createDiv('Hello ').size(100, 100); + * div.html('World', true); + *
                              + */ + /** + * @method html + * @param {String} [html] the HTML to be placed inside the element + * @param {boolean} [append] whether to append HTML to existing + * @chainable + */ + _main.default.Element.prototype.html = function () { + if (arguments.length === 0) { + return this.elt.innerHTML; + } else if (arguments.length <= 1 ? undefined : arguments[1]) { + this.elt.insertAdjacentHTML('beforeend', arguments.length <= 0 ? undefined : arguments[0]); + return this; + } else { + this.elt.innerHTML = arguments.length <= 0 ? undefined : arguments[0]; + return this; + } + }; + /** + * + * Sets the position of the element. If no position type argument is given, the + * position will be relative to (0, 0) of the window. + * Essentially, this sets position:absolute and left and top + * properties of style. If an optional third argument specifying position type is given, + * the x and y-coordinates will be interpreted based on the positioning scheme. + * If no arguments given, the function returns the x and y position of the element. + * + * found documentation on how to be more specific with object type + * https://stackoverflow.com/questions/14714314/how-do-i-comment-object-literals-in-yuidoc + * + * @method position + * @returns {Object} object of form { x: 0, y: 0 } containing the position of the element in an object + * @example + *
                              + * function setup() { + * let cnv = createCanvas(100, 100); + * // positions canvas 50px to the right and 100px + * // below upper left corner of the window + * cnv.position(50, 100); + * } + *
                              + *
                              + * function setup() { + * let cnv = createCanvas(100, 100); + * // positions canvas at upper left corner of the window + * // with a 'fixed' position type + * cnv.position(0, 0, 'fixed'); + * } + *
                              + */ + /** + * @method position + * @param {Number} [x] x-position relative to upper left of window (optional) + * @param {Number} [y] y-position relative to upper left of window (optional) + * @param {String} [positionType] it can be static, fixed, relative, sticky, initial or inherit (optional) + * @chainable + */ + _main.default.Element.prototype.position = function () { + if (arguments.length === 0) { + return { + x: this.elt.offsetLeft, + y: this.elt.offsetTop + }; + } else { + var positionType = 'absolute'; + if ((arguments.length <= 2 ? undefined : arguments[2]) === 'static' || (arguments.length <= 2 ? undefined : arguments[2]) === 'fixed' || (arguments.length <= 2 ? undefined : arguments[2]) === 'relative' || (arguments.length <= 2 ? undefined : arguments[2]) === 'sticky' || (arguments.length <= 2 ? undefined : arguments[2]) === 'initial' || (arguments.length <= 2 ? undefined : arguments[2]) === 'inherit') { + positionType = arguments.length <= 2 ? undefined : arguments[2]; + } + this.elt.style.position = positionType; + this.elt.style.left = (arguments.length <= 0 ? undefined : arguments[0]) + 'px'; + this.elt.style.top = (arguments.length <= 1 ? undefined : arguments[1]) + 'px'; + this.x = arguments.length <= 0 ? undefined : arguments[0]; + this.y = arguments.length <= 1 ? undefined : arguments[1]; + return this; + } + }; + /* Helper method called by p5.Element.style() */ + _main.default.Element.prototype._translate = function () { + this.elt.style.position = 'absolute'; + // save out initial non-translate transform styling + var transform = ''; + if (this.elt.style.transform) { + transform = this.elt.style.transform.replace(/translate3d\(.*\)/g, ''); + transform = transform.replace(/translate[X-Z]?\(.*\)/g, ''); + } + if (arguments.length === 2) { + this.elt.style.transform = 'translate(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'px, ' + (arguments.length <= 1 ? undefined : arguments[1]) + 'px)'; + } else if (arguments.length > 2) { + this.elt.style.transform = 'translate3d(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'px,' + (arguments.length <= 1 ? undefined : arguments[1]) + 'px,' + (arguments.length <= 2 ? undefined : arguments[2]) + 'px)'; + if (arguments.length === 3) { + this.elt.parentElement.style.perspective = '1000px'; + } else { + this.elt.parentElement.style.perspective = (arguments.length <= 3 ? undefined : arguments[3]) + 'px'; + } + } // add any extra transform styling back on end + + this.elt.style.transform += transform; + return this; + }; + /* Helper method called by p5.Element.style() */ + _main.default.Element.prototype._rotate = function () { + // save out initial non-rotate transform styling + var transform = ''; + if (this.elt.style.transform) { + transform = this.elt.style.transform.replace(/rotate3d\(.*\)/g, ''); + transform = transform.replace(/rotate[X-Z]?\(.*\)/g, ''); + } + if (arguments.length === 1) { + this.elt.style.transform = 'rotate(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'deg)'; + } else if (arguments.length === 2) { + this.elt.style.transform = 'rotate(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'deg, ' + (arguments.length <= 1 ? undefined : arguments[1]) + 'deg)'; + } else if (arguments.length === 3) { + this.elt.style.transform = 'rotateX(' + (arguments.length <= 0 ? undefined : arguments[0]) + 'deg)'; + this.elt.style.transform += 'rotateY(' + (arguments.length <= 1 ? undefined : arguments[1]) + 'deg)'; + this.elt.style.transform += 'rotateZ(' + (arguments.length <= 2 ? undefined : arguments[2]) + 'deg)'; + } // add remaining transform back on + + this.elt.style.transform += transform; + return this; + }; + /** + * Applies a style to an element by adding a + * CSS declaration. + * + * The first parameter, `property`, is a string. If the name of a style + * property is passed, as in `myElement.style('color')`, the method returns + * the current value as a string or `null` if it hasn't been set. If a + * `property:style` string is passed, as in + * `myElement.style('color:deeppink')`, the method sets `property` to + * `value`. + * + * The second parameter, `value`, is optional. It sets the property's value. + * `value` can be a string, as in + * `myElement.style('color', 'deeppink')`, or a + * p5.Color object, as in + * `myElement.style('color', myColor)`. + * + * @method style + * @param {String} property style property to set. + * @returns {String} value of the property. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a paragraph element and + * // set its font color to "deeppink". + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color', 'deeppink'); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create a p5.Color object. + * let c = color('deeppink'); + * + * // Create a paragraph element and + * // set its font color using a + * // p5.Color object. + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color', c); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create a paragraph element and + * // set its font color to "deeppink" + * // using property:value syntax. + * let p = createP('p5*js'); + * p.position(25, 20); + * p.style('color:deeppink'); + * + * describe('The text p5*js written in pink on a gray background.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create an empty paragraph element + * // and set its font color to "deeppink". + * let p = createP(); + * p.position(5, 5); + * p.style('color', 'deeppink'); + * + * // Get the element's color as an + * // RGB color string. + * let c = p.style('color'); + * + * // Set the element's inner HTML + * // using the RGB color string. + * p.html(c); + * + * describe('The text "rgb(255, 20, 147)" written in pink on a gray background.'); + * } + * + *
                              + */ + /** + * @method style + * @param {String} property + * @param {String|p5.Color} value value to assign to the property. + * @return {String} value of the property. + * @chainable + */ + _main.default.Element.prototype.style = function (prop, val) { + var self = this; + if (val instanceof _main.default.Color) { + val = 'rgba(' + val.levels[0] + ',' + val.levels[1] + ',' + val.levels[2] + ',' + val.levels[3] / 255 + ')'; + } + if (typeof val === 'undefined') { + if (prop.indexOf(':') === - 1) { + // no value set, so assume requesting a value + var styles = window.getComputedStyle(self.elt); + var style = styles.getPropertyValue(prop); + return style; + } else { + // value set using `:` in a single line string + var attrs = prop.split(';'); + for (var i = 0; i < attrs.length; i++) { + var parts = attrs[i].split(':'); + if (parts[0] && parts[1]) { + this.elt.style[parts[0].trim()] = parts[1].trim(); + } + } + } + } else { + // input provided as key,val pair + this.elt.style[prop] = val; + if (prop === 'width' || prop === 'height' || prop === 'left' || prop === 'top') { + var _styles = window.getComputedStyle(self.elt); + var styleVal = _styles.getPropertyValue(prop); + var numVal = styleVal.replace(/[^\d.]/g, ''); + this[prop] = Math.round(parseFloat(numVal, 10)); + } + } + return this; + }; + /** + * Adds an + * attribute + * to the element. This method is useful for advanced tasks. + * + * Most commonly-used attributes, such as `id`, can be set with their + * dedicated methods. For example, `nextButton.id('next')` sets an element's + * `id` attribute. + * + * The first parameter, `attr`, is the attribute's name as a string. Calling + * `myElement.attribute('align')` returns the attribute's current value as a + * string or `null` if it hasn't been set. + * + * The second parameter, `value`, is optional. It's a string used to set the + * attribute's value. For example, calling + * `myElement.attribute('align', 'center')` sets the element's horizontal + * alignment to `center`. + * + * @method attribute + * @return {String} value of the attribute. + * + * @example + *
                              + * + * function setup() { + * // Create a container div and + * // place it at the top-left + * // corner. + * let container = createDiv(); + * container.position(0, 0); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "left". + * let p1 = createP('hi'); + * p1.parent(container); + * p1.attribute('align', 'left'); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "center". + * let p2 = createP('hi'); + * p2.parent(container); + * p2.attribute('align', 'center'); + * + * // Create a paragraph element + * // and place it within the container. + * // Set its horizontal alignment to + * // "right". + * let p3 = createP('hi'); + * p3.parent(container); + * p3.attribute('align', 'right'); + * + * describe('A gray square with the text "hi" written on three separate lines, each placed further to the right.'); + * } + * + *
                              + */ + /** + * @method attribute + * @param {String} attr attribute to set. + * @param {String} value value to assign to the attribute. + * @chainable + */ + _main.default.Element.prototype.attribute = function (attr, value) { + //handling for checkboxes and radios to ensure options get + //attributes not divs + if (this.elt.firstChild != null && (this.elt.firstChild.type === 'checkbox' || this.elt.firstChild.type === 'radio')) { + if (typeof value === 'undefined') { + return this.elt.firstChild.getAttribute(attr); + } else { + for (var i = 0; i < this.elt.childNodes.length; i++) { + this.elt.childNodes[i].setAttribute(attr, value); + } + } + } else if (typeof value === 'undefined') { + return this.elt.getAttribute(attr); + } else { + this.elt.setAttribute(attr, value); + return this; + } + }; + /** + * Removes an attribute from the element. + * + * The parameter `attr` is the attribute's name as a string. For example, + * calling `myElement.removeAttribute('align')` removes its `align` + * attribute if it's been set. + * + * @method removeAttribute + * @param {String} attr attribute to remove. + * @chainable + * + * @example + *
                              + * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element and place it + * // in the center of the canvas. + * // Set its "align" attribute to "center". + * p = createP('hi'); + * p.position(0, 20); + * p.attribute('align', 'center'); + * + * describe('The text "hi" written in black at the center of a gray square. The text moves to the left edge when double-clicked.'); + * } + * + * function doubleClicked() { + * p.removeAttribute('align'); + * } + * + *
                              + */ + _main.default.Element.prototype.removeAttribute = function (attr) { + if (this.elt.firstChild != null && (this.elt.firstChild.type === 'checkbox' || this.elt.firstChild.type === 'radio')) { + for (var i = 0; i < this.elt.childNodes.length; i++) { + this.elt.childNodes[i].removeAttribute(attr); + } + } + this.elt.removeAttribute(attr); + return this; + }; + /** + * Returns or sets the element's value. + * + * Calling `myElement.value()` returns the element's current value. + * + * The parameter, `value`, is an optional number or string. If provided, + * as in `myElement.value(123)`, it's used to set the element's value. + * + * @method value + * @return {String|Number} value of the element. + * @example + *
                              + * + * let inp; + * + * function setup() { + * // Create a text input and place it + * // beneath the canvas. Set its default + * // value to "hello". + * inp = createInput('hello'); + * inp.position(0, 100); + * + * describe('The text from an input box is displayed on a gray square.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input's value to display a message. + * let msg = inp.value(); + * text(msg, 0, 55); + * } + * + *
                              + * + *
                              + * + * let inp; + * + * function setup() { + * // Create a text input and place it + * // beneath the canvas. Set its default + * // value to "hello". + * inp = createInput('hello'); + * inp.position(0, 100); + * + * describe('The text from an input box is displayed on a gray square. The text resets to "hello" when the user double-clicks the square.'); + * } + * + * function draw() { + * background(200); + * + * // Use the input's value to display a message. + * let msg = inp.value(); + * text(msg, 0, 55); + * } + * + * // Reset the input's value. + * function doubleClicked() { + * inp.value('hello'); + * } + * + *
                              + */ + /** + * @method value + * @param {String|Number} value + * @chainable + */ + _main.default.Element.prototype.value = function () { + if (arguments.length > 0) { + this.elt.value = arguments.length <= 0 ? undefined : arguments[0]; + return this; + } else { + if (this.elt.type === 'range') { + return parseFloat(this.elt.value); + } else return this.elt.value; + } + }; + /** + * Shows the current element. + * + * @method show + * @chainable + * @example + *
                              + * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element and hide it. + * p = createP('p5*js'); + * p.position(10, 10); + * p.hide(); + * + * describe('A gray square. The text "p5*js" appears when the user double-clicks the square.'); + * } + * + * // Show the paragraph when double-clicked. + * function doubleClicked() { + * p.show(); + * } + * + *
                              + */ + _main.default.Element.prototype.show = function () { + this.elt.style.display = 'block'; + return this; + }; + /** + * Hides the current element. + * + * @method hide + * @chainable + * @example + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element. + * p = createP('p5*js'); + * p.position(10, 10); + * + * describe('The text "p5*js" at the center of a gray square. The text disappears when the user double-clicks the square.'); + * } + * + * // Hide the paragraph when double-clicked. + * function doubleClicked() { + * p.hide(); + * } + * + *
                              + */ + _main.default.Element.prototype.hide = function () { + this.elt.style.display = 'none'; + return this; + }; + /** + * Sets the element's width and height. + * + * Calling `myElement.size()` without an argument returns the element's size + * as an object with the properties `width` and `height`. For example, + * `{ width: 20, height: 10 }`. + * + * The first parameter, `width`, is optional. It's a number used to set the + * element's width. Calling `myElement.size(10)` + * + * The second parameter, 'height`, is also optional. It's a + * number used to set the element's height. For example, calling + * `myElement.size(20, 10)` sets the element's width to 20 pixels and height + * to 10 pixels. + * + * The constant `AUTO` can be used to adjust one dimension at a time while + * maintaining the aspect ratio, which is `width / height`. For example, + * consider an element that's 200 pixels wide and 100 pixels tall. Calling + * `myElement.size(20, AUTO)` sets the width to 20 pixels and height to 10 + * pixels. + * + * Note: In the case of elements that need to load data, such as images, wait + * to call `myElement.size()` until after the data loads. + * + * @method size + * @return {Object} width and height of the element in an object. + * @example + *
                              + * + * function setup() { + * background(200); + * + * // Create a pink div element and place it at + * // the top-left corner. + * let div = createDiv(); + * div.position(10, 10); + * div.style('background-color', 'deeppink'); + * + * // Set the div's width to 80 pixels and + * // height to 20 pixels. + * div.size(80, 20); + * + * describe('A gray square with a pink rectangle near its top.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Create a pink div element and place it at + * // the top-left corner. + * let div = createDiv(); + * div.position(10, 10); + * div.style('background-color', 'deeppink'); + * + * // Set the div's width to 80 pixels and + * // height to 40 pixels. + * div.size(80, 40); + * + * // Get the div's size as an object. + * let s = div.size(); + * // Write the div's dimensions. + * div.html(`${s.width} x ${s.height}`); + * + * describe('A gray square with a pink rectangle near its top. The text "80 x 40" is written within the rectangle.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * // Load an image of an astronaut on the moon + * // and place it at the top-left of the canvas. + * let img1 = createImg( + * 'assets/moonwalk.jpg', + * 'An astronaut walking on the moon', + * '' + * ); + * img1.position(0, 0); + * + * // Load an image of an astronaut on the moon + * // and place it at the top-left of the canvas. + * // Resize the image once it's loaded. + * let img2 = createImg( + * 'assets/moonwalk.jpg', + * 'An astronaut walking on the moon', + * '', + * () => { + * img2.size(50, AUTO); + * } + * ); + * img2.position(0, 0); + * + * describe('A gray square two copies of a space image at the top-left. The copy in front is smaller.'); + * } + * + *
                              + */ + /** + * @method size + * @param {Number|Constant} w width of the element, either AUTO, or a number. + * @param {Number|Constant} [h] height of the element, either AUTO, or a number. + * @chainable + */ + _main.default.Element.prototype.size = function (w, h) { + if (arguments.length === 0) { + return { + width: this.elt.offsetWidth, + height: this.elt.offsetHeight + }; + } else { + var aW = w; + var aH = h; + var AUTO = _main.default.prototype.AUTO; + if (aW !== AUTO || aH !== AUTO) { + if (aW === AUTO) { + aW = h * this.width / this.height; + } else if (aH === AUTO) { + aH = w * this.height / this.width; + } // set diff for cnv vs normal div + + if (this.elt instanceof HTMLCanvasElement) { + var j = { + }; + var k = this.elt.getContext('2d'); + var prop; + for (prop in k) { + j[prop] = k[prop]; + } + this.elt.setAttribute('width', aW * this._pInst._pixelDensity); + this.elt.setAttribute('height', aH * this._pInst._pixelDensity); + this.elt.style.width = aW + 'px'; + this.elt.style.height = aH + 'px'; + this._pInst.scale(this._pInst._pixelDensity, this._pInst._pixelDensity); + for (prop in j) { + this.elt.getContext('2d') [prop] = j[prop]; + } + } else { + this.elt.style.width = aW + 'px'; + this.elt.style.height = aH + 'px'; + this.elt.width = aW; + this.elt.height = aH; + } + this.width = this.elt.offsetWidth; + this.height = this.elt.offsetHeight; + if (this._pInst && this._pInst._curElement) { + // main canvas associated with p5 instance + if (this._pInst._curElement.elt === this.elt) { + this._pInst._setProperty('width', this.elt.offsetWidth); + this._pInst._setProperty('height', this.elt.offsetHeight); + } + } + } + return this; + } + }; + /** + * Removes the element, stops all audio/video streams, and removes all + * callback functions. + * + * @method remove + * @example + *
                              + * + * let p; + * + * function setup() { + * background(200); + * + * // Create a paragraph element. + * p = createP('p5*js'); + * p.position(10, 10); + * + * describe('The text "p5*js" written at the center of a gray square. '); + * } + * + * // Remove the paragraph when double-clicked. + * function doubleClicked() { + * p.remove(); + * } + * + *
                              + */ + _main.default.Element.prototype.remove = function () { + // stop all audios/videos and detach all devices like microphone/camera etc + // used as input/output for audios/videos. + if (this instanceof _main.default.MediaElement) { + this.stop(); + var sources = this.elt.srcObject; + if (sources !== null) { + var tracks = sources.getTracks(); + tracks.forEach(function (track) { + track.stop(); + }); + } + } // delete the reference in this._pInst._elements + + var index = this._pInst._elements.indexOf(this); + if (index !== - 1) { + this._pInst._elements.splice(index, 1); + } // deregister events + + for (var ev in this._events) { + this.elt.removeEventListener(ev, this._events[ev]); + } + if (this.elt && this.elt.parentNode) { + this.elt.parentNode.removeChild(this.elt); + } + }; + /** + * Sets a function to call when the user drops a file on the element. + * + * The first parameter, `callback`, is a function to call once the file loads. + * The callback function should have one parameter, `file`, that's a + * p5.File object. If the user drops multiple files on + * the element, `callback`, is called once for each file. + * + * The second parameter, `fxn`, is a function to call when the browser detects + * one or more dropped files. The callback function should have one + * parameter, `event`, that's a + * DragEvent. + * + * @method drop + * @param {Function} callback called when a file loads. Called once for each file dropped. + * @param {Function} [fxn] called once when any files are dropped. + * @chainable + * @example + *
                              + * + * // Drop an image on the canvas to view + * // this example. + * let img; + * + * function setup() { + * let c = createCanvas(100, 100); + * + * background(200); + * + * // Call a function when a file + * // dropped on the canvas has + * // loaded. + * c.drop(file => { + * // Remove the current image, if any. + * if (img) { + * img.remove(); + * } + * + * // Create an element with the + * // dropped file. + * img = createImg(file.data, ''); + * img.hide(); + * + * // Draw the image. + * image(img, 0, 0, width, height); + * }); + * + * describe('A gray square. When the user drops an image on the square, it is displayed.'); + * } + * + *
                              + * + *
                              + * + * // Drop an image on the canvas to view + * // this example. + * let img; + * let msg; + * + * function setup() { + * let c = createCanvas(100, 100); + * + * background(200); + * + * // Call functions when the user + * // drops a file on the canvas + * // and when the file loads. + * c.drop(handleFile, handleDrop); + * + * describe('A gray square. When the user drops an image on the square, it is displayed. The id attribute of canvas element is also displayed.'); + * } + * + * function handleFile(file) { + * // Remove the current image, if any. + * if (img) { + * img.remove(); + * } + * + * // Create an element with the + * // dropped file. + * img = createImg(file.data, ''); + * img.hide(); + * + * // Draw the image. + * image(img, 0, 0, width, height); + * } + * + * function handleDrop(event) { + * // Remove current paragraph, if any. + * if (msg) { + * msg.remove(); + * } + * + * // Use event to get the drop + * // target's id. + * let id = event.target.id; + * + * // Write the canvas' id + * // beneath it. + * msg = createP(id); + * msg.position(0, 100); + * + * // Set the font color + * // randomly for each drop. + * let c = random(['red', 'green', 'blue']); + * msg.style('color', c); + * msg.style('font-size', '12px'); + * } + * + *
                              + */ + _main.default.Element.prototype.drop = function (callback, fxn) { + // Is the file stuff supported? + if (window.File && window.FileReader && window.FileList && window.Blob) { + if (!this._dragDisabled) { + this._dragDisabled = true; + var preventDefault = function preventDefault(evt) { + evt.preventDefault(); + }; + // If you want to be able to drop you've got to turn off + // a lot of default behavior. + // avoid `attachListener` here, since it overrides other handlers. + this.elt.addEventListener('dragover', preventDefault); + // If this is a drag area we need to turn off the default behavior + this.elt.addEventListener('dragleave', preventDefault); + } // Deal with the files + + _main.default.Element._attachListener('drop', function (evt) { + evt.preventDefault(); + // Call the second argument as a callback that receives the raw drop event + if (typeof fxn === 'function') { + fxn.call(this, evt); + } // A FileList + + var files = evt.dataTransfer.files; + // Load each one and trigger the callback + var _iteratorNormalCompletion10 = true; + var _didIteratorError10 = false; + var _iteratorError10 = undefined; + try { + for (var _iterator10 = files[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { + var f = _step10.value; + _main.default.File._load(f, callback); + } + } catch (err) { + _didIteratorError10 = true; + _iteratorError10 = err; + } finally { + try { + if (!_iteratorNormalCompletion10 && _iterator10.return != null) { + _iterator10.return(); + } + } finally { + if (_didIteratorError10) { + throw _iteratorError10; + } + } + } + }, this); + } else { + console.log('The File APIs are not fully supported in this browser.'); + } + return this; + }; + /** + * Turns p5.Element into a draggable item. If an argument is given, it will drag that p5.Element instead, ie. drag a entire GUI panel (parent container) with the panel's title bar. + * + * @method draggable + * @param {p5.Element} [elmnt] pass another p5.Element + * @chainable + * + * @example + *
                              + * function setup() { + * createCanvas(100, 100); + * background(200); + * + * createDiv('Post-It') + * .position(5, 5) + * .size(75, 20) + * .style('font-size', '16px') + * .style('background', 'yellow') + * .style('color', '#000') + * .style('border', '1px solid #aaaa00') + * .style('padding', '5px') + * .draggable(); + * // .style('cursor', 'help') // override cursor + * + * let gui = createDiv('') + * .position(5, 40) + * .size(85, 50) + * .style('font-size', '16px') + * .style('background', 'yellow') + * .style('z-index', '100') + * .style('border', '1px solid #00aaaa'); + * + * createDiv('= PANEL =') + * .parent(gui) + * .style('background', 'cyan') + * .style('padding', '2px') + * .style('text-align', 'center') + * .draggable(gui); + * + * createSlider(0, 100, random(100)) + * .style('cursor', 'pointer') + * .size(80, 5) + * .parent(gui); + * } + *
                              + */ + _main.default.Element.prototype.draggable = function (elmMove) { + var isTouch = ('ontouchstart' in window); + var x = 0, + y = 0, + px = 0, + py = 0, + elmDrag, + dragMouseDownEvt = isTouch ? 'touchstart' : 'mousedown', + closeDragElementEvt = isTouch ? 'touchend' : 'mouseup', + elementDragEvt = isTouch ? 'touchmove' : 'mousemove'; + if (elmMove === undefined) { + elmMove = this.elt; + elmDrag = elmMove; + } else if (elmMove !== this.elt && elmMove.elt !== this.elt) { + elmMove = elmMove.elt; + elmDrag = this.elt; + } + elmDrag.addEventListener(dragMouseDownEvt, dragMouseDown, false); + elmDrag.style.cursor = 'move'; + function dragMouseDown(e) { + e = e || window.event; + if (isTouch) { + var touches = e.changedTouches; + px = parseInt(touches[0].clientX); + py = parseInt(touches[0].clientY); + } else { + px = parseInt(e.clientX); + py = parseInt(e.clientY); + } + document.addEventListener(closeDragElementEvt, closeDragElement, false); + document.addEventListener(elementDragEvt, elementDrag, false); + return false; + } + function elementDrag(e) { + e = e || window.event; + if (isTouch) { + var touches = e.changedTouches; + x = px - parseInt(touches[0].clientX); + y = py - parseInt(touches[0].clientY); + px = parseInt(touches[0].clientX); + py = parseInt(touches[0].clientY); + } else { + x = px - parseInt(e.clientX); + y = py - parseInt(e.clientY); + px = parseInt(e.clientX); + py = parseInt(e.clientY); + } + elmMove.style.left = elmMove.offsetLeft - x + 'px'; + elmMove.style.top = elmMove.offsetTop - y + 'px'; + } + function closeDragElement() { + document.removeEventListener(closeDragElementEvt, closeDragElement, false); + document.removeEventListener(elementDragEvt, elementDrag, false); + } + return this; + }; + /*** SCHEDULE EVENTS ***/ + // Cue inspired by JavaScript setTimeout, and the + // Tone.js Transport Timeline Event, MIT License Yotam Mann 2015 tonejs.org + // eslint-disable-next-line no-unused-vars + var Cue = function Cue(callback, time, id, val) { + _classCallCheck(this, Cue); + this.callback = callback; + this.time = time; + this.id = id; + this.val = val; + }; // ============================================================================= + // p5.MediaElement additions + // ============================================================================= + /** + * A class to handle audio and video. + * + * `p5.MediaElement` extends p5.Element with + * methods to handle audio and video. `p5.MediaElement` objects are created by + * calling createVideo, + * createAudio, and + * createCapture. + * + * @class p5.MediaElement + * @constructor + * @param {String} elt DOM node that is wrapped + * @extends p5.Element + * @example + *
                              + * + * let capture; + * + * function setup() { + * createCanvas(100, 100); + * + * // Create a p5.MediaElement using createCapture(). + * capture = createCapture(VIDEO); + * capture.hide(); + * } + * + * function draw() { + * // Display the video stream and invert the colors. + * image(capture, 0, 0, width, width * capture.height / capture.width); + * filter(INVERT); + * } + * + *
                              + */ + var MediaElement = /*#__PURE__*/ function (_p5$Element) { + _inherits(MediaElement, _p5$Element); + var _super = _createSuper(MediaElement); + function MediaElement(elt, pInst) { + var _this; + _classCallCheck(this, MediaElement); + _this = _super.call(this, elt, pInst); + var self = _assertThisInitialized(_this); + _this.elt.crossOrigin = 'anonymous'; + _this._prevTime = 0; + _this._cueIDCounter = 0; + _this._cues = [ + ]; + _this.pixels = [ + ]; + _this._pixelsState = _assertThisInitialized(_this); + _this._pixelDensity = 1; + _this._modified = false; + // Media has an internal canvas that is used when drawing it to the main + // canvas. It will need to be updated each frame as the video itself plays. + // We don't want to update it every time we draw, however, in case the user + // has used load/updatePixels. To handle this, we record the frame drawn to + // the internal canvas so we only update it if the frame has changed. + _this._frameOnCanvas = - 1; + /** + * Path to the media element's source as a string. + * + * @property src + * @return {String} src + * @example + *
                              + * + * let beat; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "https://p5js.org/reference/assets/beat.mp3" written in black on a gray background.'); + * } + * + * function draw() { + * background(200); + * + * textWrap(CHAR); + * text(beat.src, 10, 10, 80, 80); + * } + * + *
                              + */ + Object.defineProperty(self, 'src', { + get: function get() { + var firstChildSrc = self.elt.children[0].src; + var srcVal = self.elt.src === window.location.href ? '' : self.elt.src; + var ret = firstChildSrc === window.location.href ? srcVal : firstChildSrc; + return ret; + }, + set: function set(newValue) { + for (var i = 0; i < self.elt.children.length; i++) { + self.elt.removeChild(self.elt.children[i]); + } + var source = document.createElement('source'); + source.src = newValue; + elt.appendChild(source); + self.elt.src = newValue; + self.modified = true; + } + }); + // private _onended callback, set by the method: onended(callback) + self._onended = function () { + }; + self.elt.onended = function () { + self._onended(self); + }; + return _this; + } /** + * Play audio or video from a media element. + * + * @method play + * @chainable + * @example + *
                              + * + * let beat; + * + * function setup() { + * background(200); + * + * textAlign(CENTER); + * text('Click to play', 50, 50); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks the square.'); + * } + * + * // Play the beat when the user + * // presses the mouse. + * function mousePressed() { + * beat.play(); + * } + * + *
                              + */ + + _createClass(MediaElement, [ + { + key: 'play', + value: function play() { + var _this2 = this; + if (this.elt.currentTime === this.elt.duration) { + this.elt.currentTime = 0; + } + var promise; + if (this.elt.readyState > 1) { + promise = this.elt.play(); + } else { + // in Chrome, playback cannot resume after being stopped and must reload + this.elt.load(); + promise = this.elt.play(); + } + if (promise && promise.catch) { + promise.catch(function (e) { + // if it's an autoplay failure error + if (e.name === 'NotAllowedError') { + if (typeof IS_MINIFIED === 'undefined') { + _main.default._friendlyAutoplayError(_this2.src); + } else { + console.error(e); + } + } else { + // any other kind of error + console.error('Media play method encountered an unexpected error', e); + } + }); + } + return this; + } /** + * Stops a media element and sets its current time to zero. Calling + * `media.play()` will restart playing audio/video from the beginning. + * + * @method stop + * @chainable + * @example + *
                              + * + * let beat; + * let isStopped = true; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to start" written in black on a gray background. The beat starts or stops when the user presses the mouse.'); + * } + * + * function draw() { + * background(200); + * + * textAlign(CENTER); + * if (isStopped === true) { + * text('Click to start', 50, 50); + * } else { + * text('Click to stop', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isStopped === true) { + * // If the beat is stopped, + * // play it. + * beat.play(); + * isStopped = false; + * } else { + * // If the beat is playing, + * // stop it. + * beat.stop(); + * isStopped = true; + * } + * } + * + *
                              + */ + + }, + { + key: 'stop', + value: function stop() { + this.elt.pause(); + this.elt.currentTime = 0; + return this; + } /** + * Pauses a media element. Calling `media.play()` will resume playing + * audio/video from the moment it paused. + * + * @method pause + * @chainable + * @example + *
                              + * + * let beat; + * let isPaused = true; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. The beat plays or pauses when the user clicks the square.'); + * } + * + * function draw() { + * background(200); + * + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isPaused === true) { + * text('Click to play', 50, 50); + * } else { + * text('Click to pause', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isPaused === true) { + * // If the beat is paused, + * // play it. + * beat.play(); + * isPaused = false; + * } else { + * // If the beat is playing, + * // pause it. + * beat.pause(); + * isPaused = true; + * } + * } + * + *
                              + */ + + }, + { + key: 'pause', + value: function pause() { + this.elt.pause(); + return this; + } /** + * Play the audio/video repeatedly in a loop. + * + * @method loop + * @chainable + * @example + *
                              + * + * let beat; + * let isLooping = false; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to loop" written in black on a gray background. A beat plays repeatedly in a loop when the user clicks. The beat stops when the user clicks again.'); + * } + * + * function draw() { + * background(200); + * + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isLooping === true) { + * text('Click to stop', 50, 50); + * } else { + * text('Click to loop', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isLooping === true) { + * // If the beat is looping, + * // stop it. + * beat.stop(); + * isLooping = false; + * } else { + * // If the beat is stopped, + * // loop it. + * beat.loop(); + * isLooping = true; + * } + * } + * + *
                              + */ + + }, + { + key: 'loop', + value: function loop() { + this.elt.setAttribute('loop', true); + this.play(); + return this; + } /** + * Stops the audio/video from playing in a loop. It will stop when it + * reaches the end. + * + * @method noLoop + * @chainable + * @example + *
                              + * + * let beat; + * let isPlaying = false; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks. The beat stops when the user clicks again.'); + * } + * + * function draw() { + * background(200); + * + * // Display different instructions + * // based on playback. + * textAlign(CENTER); + * if (isPlaying === true) { + * text('Click to stop', 50, 50); + * } else { + * text('Click to play', 50, 50); + * } + * } + * + * // Adjust playback when the user + * // presses the mouse. + * function mousePressed() { + * if (isPlaying === true) { + * // If the beat is playing, + * // stop it. + * beat.stop(); + * isPlaying = false; + * } else { + * // If the beat is stopped, + * // play it. + * beat.play(); + * isPlaying = true; + * } + * } + * + *
                              + */ + + }, + { + key: 'noLoop', + value: function noLoop() { + this.elt.removeAttribute('loop'); + return this; + } /** + * Sets up logic to check that autoplay succeeded. + * + * @method setupAutoplayFailDetection + * @private + */ + + }, + { + key: '_setupAutoplayFailDetection', + value: function _setupAutoplayFailDetection() { + var _this3 = this; + var timeout = setTimeout(function () { + if (typeof IS_MINIFIED === 'undefined') { + _main.default._friendlyAutoplayError(_this3.src); + } else { + console.error(e); + } + }, 500); + this.elt.addEventListener('play', function () { + return clearTimeout(timeout); + }, { + passive: true, + once: true + }); + } /** + * Sets the audio/video to play once it's loaded. + * + * The parameter, `shouldAutoplay`, is optional. Calling + * `media.autoplay()` without an argument causes the media to play + * automatically. If `true` is passed, as in `media.autoplay(true)`, the + * media will automatically play. If `false` is passed, as in + * `media.autoPlay(false)`, it won't play automatically. + * + * @method autoplay + * @param {Boolean} [shouldAutoplay] whether the element should autoplay. + * @chainable + * @example + *
                              + * + * function setup() { + * noCanvas(); + * + * // Load a video and play it automatically. + * let video = createVideo('assets/fingers.mov', () => { + * video.autoplay(); + * video.size(100, 100); + * }); + * + * describe('A video of fingers walking on a treadmill.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * noCanvas(); + * + * // Load a video, but don't play it automatically. + * let video = createVideo('assets/fingers.mov', () => { + * video.autoplay(false); + * video.size(100, 100); + * }); + * + * // Play the video when the user clicks on it. + * video.mousePressed(() => { + * video.play(); + * }); + * + * describe('An image of fingers on a treadmill. They start walking when the user double-clicks on them.'); + * } + * + *
                              + */ + + }, + { + key: 'autoplay', + value: function autoplay(val) { + var _this4 = this; + var oldVal = this.elt.getAttribute('autoplay'); + this.elt.setAttribute('autoplay', val); + // if we turned on autoplay + if (val && !oldVal) { + // bind method to this scope + var setupAutoplayFailDetection = function setupAutoplayFailDetection() { + return _this4._setupAutoplayFailDetection(); + }; + // if media is ready to play, schedule check now + if (this.elt.readyState === 4) { + setupAutoplayFailDetection(); + } else { + // otherwise, schedule check whenever it is ready + this.elt.addEventListener('canplay', setupAutoplayFailDetection, { + passive: true, + once: true + }); + } + } + return this; + } /** + * Manages the audio/video volume. + * + * Calling `media.volume()` without an argument returns the current volume + * as a number in the range 0 (off) to 1 (maximum). + * + * The parameter, `val`, is optional. It's a number that sets the volume + * from 0 (off) to 1 (maximum). For example, calling `media.volume(0.5)` + * sets the volume to half of its maximum. + * + * @method volume + * @return {Number} current volume. + * + * @example + *
                              + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Volume: V" on a gray square with media controls beneath it. The number "V" oscillates between 0 and 1 as the music plays.'); + * } + * + * function draw() { + * background(200); + * + * // Produce a number between 0 and 1. + * let n = 0.5 * sin(frameCount * 0.01) + 0.5; + * // Use n to set the volume. + * dragon.volume(n); + * + * // Get the current volume + * // and display it. + * let v = dragon.volume(); + * // Round v to 1 decimal place + * // for display. + * v = round(v, 1); + * textAlign(CENTER); + * text(`Volume: ${v}`, 50, 50); + * } + * + *
                              + */ + /** + * @method volume + * @param {Number} val volume between 0.0 and 1.0. + * @chainable + */ + + }, + { + key: 'volume', + value: function volume(val) { + if (typeof val === 'undefined') { + return this.elt.volume; + } else { + this.elt.volume = val; + } + } /** + * Manages the audio/video playback speed. Calling `media.speed()` returns + * the current speed as a number. + * + * The parameter, `val`, is optional. It's a number that sets the playback + * speed. 1 plays the media at normal speed, 0.5 plays it at half speed, 2 + * plays it at double speed, and so on. -1 plays the media at normal speed + * in reverse. + * + * Note: Not all browsers support backward playback. Even if they do, + * playback might not be smooth. + * + * @method speed + * @return {Number} current playback speed. + * + * @example + *
                              + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Speed: S" on a gray square with media controls beneath it. The number "S" oscillates between 0 and 1 as the music plays.'); + * } + * + * function draw() { + * background(200); + * + * // Produce a number between 0 and 2. + * let n = sin(frameCount * 0.01) + 1; + * // Use n to set the playback speed. + * dragon.speed(n); + * + * // Get the current speed + * // and display it. + * let s = dragon.speed(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`Speed: ${s}`, 50, 50); + * } + * + */ + /** + * @method speed + * @param {Number} speed speed multiplier for playback. + * @chainable + */ + + }, + { + key: 'speed', + value: function speed(val) { + if (typeof val === 'undefined') { + return this.presetPlaybackRate || this.elt.playbackRate; + } else { + if (this.loadedmetadata) { + this.elt.playbackRate = val; + } else { + this.presetPlaybackRate = val; + } + } + } /** + * Manages the media element's playback time. Calling `media.time()` + * returns the number of seconds the audio/video has played. Time resets to + * 0 when the looping media restarts. + * + * The parameter, `time`, is optional. It's a number that specifies the + * time, in seconds, to jump to when playback begins. + * + * @method time + * @return {Number} current time (in seconds). + * + * @example + *
                              + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Display the current time. + * let s = dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`${s} seconds`, 50, 50); + * } + * + *
                              + * + *
                              + * + * let dragon; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * // Jump to 2 seconds + * // to start. + * dragon.time(2); + * + * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Display the current time. + * let s = dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * textAlign(CENTER); + * text(`${s} seconds`, 50, 50); + * } + * + *
                              + */ + /** + * @method time + * @param {Number} time time to jump to (in seconds). + * @chainable + */ + + }, + { + key: 'time', + value: function time(val) { + if (typeof val === 'undefined') { + return this.elt.currentTime; + } else { + this.elt.currentTime = val; + return this; + } + } /** + * Returns the audio/video's duration in seconds. + * + * @method duration + * @return {Number} duration (in seconds). + * + * @example + *
                              + * + * let dragon; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "S seconds left" on a gray square with media controls beneath it. The number "S" decreases as the song plays.'); + * } + * + * function draw() { + * background(200); + * + * // Calculate the time remaining. + * let s = dragon.duration() - dragon.time(); + * // Round s to 1 decimal place + * // for display. + * s = round(s, 1); + * + * // Display the time remaining. + * textAlign(CENTER); + * text(`${s} seconds left`, 50, 50); + * } + * + *
                              + */ + + }, + { + key: 'duration', + value: function duration() { + return this.elt.duration; + } + }, + { + key: '_ensureCanvas', + value: function _ensureCanvas() { + if (!this.canvas) { + this.canvas = document.createElement('canvas'); + this.drawingContext = this.canvas.getContext('2d'); + this.setModified(true); + } // Don't update the canvas again if we have already updated the canvas with + // the current frame + + var needsRedraw = this._frameOnCanvas !== this._pInst.frameCount; + if (this.loadedmetadata && needsRedraw) { + // wait for metadata for w/h + if (this.canvas.width !== this.elt.width) { + this.canvas.width = this.elt.width; + this.canvas.height = this.elt.height; + this.width = this.canvas.width; + this.height = this.canvas.height; + } + this.drawingContext.clearRect(0, 0, this.canvas.width, this.canvas.height); + this.drawingContext.drawImage(this.elt, 0, 0, this.canvas.width, this.canvas.height); + this.setModified(true); + this._frameOnCanvas = this._pInst.frameCount; + } + } + }, + { + key: 'loadPixels', + value: function loadPixels() { + this._ensureCanvas(); + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + return _main.default.Renderer2D.prototype.loadPixels.apply(this, args); + } + }, + { + key: 'updatePixels', + value: function updatePixels(x, y, w, h) { + if (this.loadedmetadata) { + // wait for metadata + this._ensureCanvas(); + _main.default.Renderer2D.prototype.updatePixels.call(this, x, y, w, h); + } + this.setModified(true); + return this; + } + }, + { + key: 'get', + value: function get() { + this._ensureCanvas(); + for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; + } + return _main.default.Renderer2D.prototype.get.apply(this, args); + } + }, + { + key: '_getPixel', + value: function _getPixel() { + this.loadPixels(); + for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + args[_key6] = arguments[_key6]; + } + return _main.default.Renderer2D.prototype._getPixel.apply(this, args); + } + }, + { + key: 'set', + value: function set(x, y, imgOrCol) { + if (this.loadedmetadata) { + // wait for metadata + this._ensureCanvas(); + _main.default.Renderer2D.prototype.set.call(this, x, y, imgOrCol); + this.setModified(true); + } + } + }, + { + key: 'copy', + value: function copy() { + this._ensureCanvas(); + for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + args[_key7] = arguments[_key7]; + } + _main.default.prototype.copy.apply(this, args); + } + }, + { + key: 'mask', + value: function mask() { + this.loadPixels(); + this.setModified(true); + for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + args[_key8] = arguments[_key8]; + } + _main.default.Image.prototype.mask.apply(this, args); + } /** + * helper method for web GL mode to figure out if the element + * has been modified and might need to be re-uploaded to texture + * memory between frames. + * @method isModified + * @private + * @return {boolean} a boolean indicating whether or not the + * image has been updated or modified since last texture upload. + */ + + }, + { + key: 'isModified', + value: function isModified() { + return this._modified; + } /** + * helper method for web GL mode to indicate that an element has been + * changed or unchanged since last upload. gl texture upload will + * set this value to false after uploading the texture; or might set + * it to true if metadata has become available but there is no actual + * texture data available yet.. + * @method setModified + * @param {boolean} val sets whether or not the element has been + * modified. + * @private + */ + + }, + { + key: 'setModified', + value: function setModified(value) { + this._modified = value; + } /** + * Calls a function when the audio/video reaches the end of its playback + * The function won't be called if the media is looping. + * + * The `p5.MediaElement` is passed as an argument to the callback function. + * + * @method onended + * @param {Function} callback function to call when playback ends. + * The `p5.MediaElement` is passed as + * the argument. + * @chainable + * @example + *
                              + * + * let beat; + * let isPlaying = false; + * let isDone = false; + * + * function setup() { + * + * // Create a p5.MediaElement using createAudio(). + * beat = createAudio('assets/beat.mp3'); + * + * // Set isDone to false when + * // the beat finishes. + * beat.onended(() => { + * isDone = true; + * }); + * + * describe('The text "Click to play" written in black on a gray square. A beat plays when the user clicks. The text "Done!" appears when the beat finishes playing.'); + * } + * + * function draw() { + * background(200); + * + * // Display different messages + * // based on playback. + * textAlign(CENTER); + * if (isDone === true) { + * text('Done!', 50, 50); + * } else if (isPlaying === false) { + * text('Click to play', 50, 50); + * } else { + * text('Playing...', 50, 50); + * } + * } + * + * // Play the beat when the + * // user presses the mouse. + * function mousePressed() { + * if (isPlaying === false) { + * isPlaying = true; + * beat.play(); + * } + * } + * + *
                              + */ + + }, + { + key: 'onended', + value: function onended(callback) { + this._onended = callback; + return this; + } /*** CONNECT TO WEB AUDIO API / p5.sound.js ***/ + /** + * Send the audio output of this element to a specified audioNode or + * p5.sound object. If no element is provided, connects to p5's main + * output. That connection is established when this method is first called. + * All connections are removed by the .disconnect() method. + * + * This method is meant to be used with the p5.sound.js addon library. + * + * @method connect + * @param {AudioNode|Object} audioNode AudioNode from the Web Audio API, + * or an object from the p5.sound library + */ + + }, + { + key: 'connect', + value: function connect(obj) { + var audioContext, + mainOutput; + // if p5.sound exists, same audio context + if (typeof _main.default.prototype.getAudioContext === 'function') { + audioContext = _main.default.prototype.getAudioContext(); + mainOutput = _main.default.soundOut.input; + } else { + try { + audioContext = obj.context; + mainOutput = audioContext.destination; + } catch (e) { + throw 'connect() is meant to be used with Web Audio API or p5.sound.js'; + } + } // create a Web Audio MediaElementAudioSourceNode if none already exists + + if (!this.audioSourceNode) { + this.audioSourceNode = audioContext.createMediaElementSource(this.elt); + // connect to main output when this method is first called + this.audioSourceNode.connect(mainOutput); + } // connect to object if provided + + if (obj) { + if (obj.input) { + this.audioSourceNode.connect(obj.input); + } else { + this.audioSourceNode.connect(obj); + } + } else { + // otherwise connect to main output of p5.sound / AudioContext + this.audioSourceNode.connect(mainOutput); + } + } /** + * Disconnect all Web Audio routing, including to main output. + * This is useful if you want to re-route the output through + * audio effects, for example. + * + * @method disconnect + */ + + }, + { + key: 'disconnect', + value: function disconnect() { + if (this.audioSourceNode) { + this.audioSourceNode.disconnect(); + } else { + throw 'nothing to disconnect'; + } + } /*** SHOW / HIDE CONTROLS ***/ + /** + * Show the default + * HTMLMediaElement + * controls. These vary between web browser. + * + * @method showControls + * @example + *
                              + * + * function setup() { + * background('cornflowerblue'); + * + * textAlign(CENTER); + * textSize(50); + * text('🐉', 50, 50); + * + * // Create a p5.MediaElement using createAudio(). + * let dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('A dragon emoji, 🐉, drawn in the center of a blue square. A song plays in the background. Audio controls are displayed beneath the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'showControls', + value: function showControls() { + // must set style for the element to show on the page + this.elt.style['text-align'] = 'inherit'; + this.elt.controls = true; + } /** + * Hide the default + * HTMLMediaElement + * controls. + * + * @method hideControls + * @example + *
                              + * + * let dragon; + * let isHidden = false; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * dragon = createAudio('assets/lucky_dragons.mp3'); + * // Show the default media controls. + * dragon.showControls(); + * + * describe('The text "Double-click to hide controls" written in the middle of a gray square. A song plays in the background. Audio controls are displayed beneath the canvas. The controls appear/disappear when the user double-clicks the square.'); + * } + * + * function draw() { + * background(200); + * + * // Display a different message when + * // controls are hidden or shown. + * textAlign(CENTER); + * if (isHidden === true) { + * text('Double-click to show controls', 10, 20, 80, 80); + * } else { + * text('Double-click to hide controls', 10, 20, 80, 80); + * } + * } + * + * // Show/hide controls based on a double-click. + * function doubleClicked() { + * if (isHidden === true) { + * dragon.showControls(); + * isHidden = false; + * } else { + * dragon.hideControls(); + * isHidden = true; + * } + * } + * + *
                              + */ + + }, + { + key: 'hideControls', + value: function hideControls() { + this.elt.controls = false; + } /** + * Schedules a function to call when the audio/video reaches a specific time + * during its playback. + * + * The first parameter, `time`, is the time, in seconds, when the function + * should run. This value is passed to `callback` as its first argument. + * + * The second parameter, `callback`, is the function to call at the specified + * cue time. + * + * The third parameter, `value`, is optional and can be any type of value. + * `value` is passed to `callback`. + * + * Calling `media.addCue()` returns an ID as a string. This is useful for + * removing the cue later. + * + * @method addCue + * @param {Number} time cue time to run the callback function. + * @param {Function} callback function to call at the cue time. + * @param {Object} [value] object to pass as the argument to + * `callback`. + * @return {Number} id ID of this cue, + * useful for `media.removeCue(id)`. + * @example + *
                              + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * beat.addCue(6, changeBackground, 'lavender'); + * + * describe('A red square with a beat playing in the background. Its color changes every 2 seconds while the audio plays.'); + * } + * + * function changeBackground(c) { + * background(c); + * } + * + *
                              + */ + + }, + { + key: 'addCue', + value: function addCue(time, callback, val) { + var id = this._cueIDCounter++; + var cue = new Cue(callback, time, id, val); + this._cues.push(cue); + if (!this.elt.ontimeupdate) { + this.elt.ontimeupdate = this._onTimeUpdate.bind(this); + } + return id; + } /** + * Remove a callback based on its ID. + * + * @method removeCue + * @param {Number} id ID of the cue, created by `media.addCue()`. + * @example + *
                              + * + * let lavenderID; + * let isRemoved = false; + * + * function setup() { + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * + * // Record the ID of the "lavender" callback. + * lavenderID = beat.addCue(6, changeBackground, 'lavender'); + * + * describe('The text "Double-click to remove lavender." written on a red square. The color changes every 2 seconds while the audio plays. The lavender option is removed when the user double-clicks the square.'); + * } + * + * function draw() { + * if (isRemoved === false) { + * text('Double-click to remove lavender.', 10, 10, 80, 80); + * } else { + * text('No more lavender.', 10, 10, 80, 80); + * } + * } + * + * function changeBackground(c) { + * background(c); + * } + * + * // Remove the lavender color-change cue + * // when the user double-clicks. + * function doubleClicked() { + * if (isRemoved === false) { + * beat.removeCue(lavenderID); + * isRemoved = true; + * } + * } + * + *
                              + */ + + }, + { + key: 'removeCue', + value: function removeCue(id) { + for (var i = 0; i < this._cues.length; i++) { + if (this._cues[i].id === id) { + console.log(id); + this._cues.splice(i, 1); + } + } + if (this._cues.length === 0) { + this.elt.ontimeupdate = null; + } + } /** + * Removes all functions scheduled with `media.addCue()`. + * + * @method clearCues + * @example + *
                              + * + * let isChanging = true; + * + * function setup() { + * background(200); + * + * // Create a p5.MediaElement using createAudio(). + * let beat = createAudio('assets/beat.mp3'); + * // Play the beat in a loop. + * beat.loop(); + * + * // Schedule a few events. + * beat.addCue(0, changeBackground, 'red'); + * beat.addCue(2, changeBackground, 'deeppink'); + * beat.addCue(4, changeBackground, 'orchid'); + * beat.addCue(6, changeBackground, 'lavender'); + * + * describe('The text "Double-click to stop changing." written on a square. The color changes every 2 seconds while the audio plays. The color stops changing when the user double-clicks the square.'); + * } + * + * function draw() { + * if (isChanging === true) { + * text('Double-click to stop changing.', 10, 10, 80, 80); + * } else { + * text('No more changes.', 10, 10, 80, 80); + * } + * } + * + * function changeBackground(c) { + * background(c); + * } + * + * // Remove cued functions and stop + * // changing colors when the user + * // double-clicks. + * function doubleClicked() { + * if (isChanging === true) { + * beat.clearCues(); + * isChanging = false; + * } + * } + * + *
                              + */ + + }, + { + key: 'clearCues', + value: function clearCues() { + this._cues = [ + ]; + this.elt.ontimeupdate = null; + } // private method that checks for cues to be fired if events + // have been scheduled using addCue(callback, time). + + }, + { + key: '_onTimeUpdate', + value: function _onTimeUpdate() { + var playbackTime = this.time(); + for (var i = 0; i < this._cues.length; i++) { + var callbackTime = this._cues[i].time; + var val = this._cues[i].val; + if (this._prevTime < callbackTime && callbackTime <= playbackTime) { + // pass the scheduled callbackTime as parameter to the callback + this._cues[i].callback(val); + } + } + this._prevTime = playbackTime; + } + } + ]); + return MediaElement; + }(_main.default.Element); + _main.default.MediaElement = MediaElement; + /** + * A class to describe a file. + * + * `p5.File` objects are used by + * myElement.drop() and + * created by + * createFileInput. + * + * @class p5.File + * @constructor + * @param {File} file wrapped file. + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayInfo() when + * // the file loads. + * let input = createFileInput(displayInfo); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); + * } + * + * // Display the p5.File's info + * // once it loads. + * function displayInfo(file) { + * background(200); + * + * // Display the p5.File's name. + * text(file.name, 10, 10, 80, 40); + * // Display the p5.File's type and subtype. + * text(`${file.type}/${file.subtype}`, 10, 70); + * // Display the p5.File's size in bytes. + * text(file.size, 10, 90); + * } + * + *
                              + * + *
                              + * + * // Use the file input to select an image to + * // load and display. + * let img; + * + * function setup() { + * // Create a file input and place it beneath + * // the canvas. Call handleImage() when + * // the file image loads. + * let input = createFileInput(handleImage); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); + * } + * + * function draw() { + * background(200); + * + * // Draw the image if it's ready. + * if (img) { + * image(img, 0, 0, width, height); + * } + * } + * + * // Use the p5.File's data once + * // it loads. + * function handleImage(file) { + * // Check the p5.File's type. + * if (file.type === 'image') { + * // Create an image using using + * // the p5.File's data. + * img = createImg(file.data, ''); + * + * // Hide the image element so it + * // doesn't appear twice. + * img.hide(); + * } else { + * img = null; + * } + * } + * + *
                              + */ + var File = /*#__PURE__*/ function () { + function File(file, pInst) { + _classCallCheck(this, File); + /** + * Underlying + * File + * object. All `File` properties and methods are accessible. + * + * @property file + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayInfo() when + * // the file loads. + * let input = createFileInput(displayInfo); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); + * } + * + * // Use the p5.File once + * // it loads. + * function displayInfo(file) { + * background(200); + * + * // Display the p5.File's name. + * text(file.name, 10, 10, 80, 40); + * // Display the p5.File's type and subtype. + * text(`${file.type}/${file.subtype}`, 10, 70); + * // Display the p5.File's size in bytes. + * text(file.size, 10, 90); + * } + * + *
                              + */ + this.file = file; + this._pInst = pInst; + // Splitting out the file type into two components + // This makes determining if image or text etc simpler + var typeList = file.type.split('/'); + /** + * The file + * MIME type + * as a string. For example, `'image'`, `'text'`, and so on. + * + * @property type + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayType() when + * // the file loads. + * let input = createFileInput(displayType); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its type is written in black.'); + * } + * + * // Display the p5.File's type + * // once it loads. + * function displayType(file) { + * background(200); + * + * // Display the p5.File's type. + * text(`This is file's type is: ${file.type}`, 10, 10, 80, 80); + * } + * + *
                              + */ + this.type = typeList[0]; + /** + * The file subtype as a string. For example, a file with an `'image'` + * MIME type + * may have a subtype such as ``png`` or ``jpeg``. + * + * @property subtype + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displaySubtype() when + * // the file loads. + * let input = createFileInput(displaySubtype); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its subtype is written in black.'); + * } + * + * // Display the p5.File's type + * // once it loads. + * function displaySubtype(file) { + * background(200); + * + * // Display the p5.File's subtype. + * text(`This is file's subtype is: ${file.subtype}`, 10, 10, 80, 80); + * } + * + *
                              + */ + this.subtype = typeList[1]; + /** + * The file name as a string. + * + * @property name + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayName() when + * // the file loads. + * let input = createFileInput(displayName); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its name is written in black.'); + * } + * + * // Display the p5.File's name + * // once it loads. + * function displayName(file) { + * background(200); + * + * // Display the p5.File's name. + * text(`This is file's name is: ${file.name}`, 10, 10, 80, 80); + * } + * + *
                              + */ + this.name = file.name; + /** + * The number of bytes in the file. + * + * @property size + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displaySize() when + * // the file loads. + * let input = createFileInput(displaySize); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its size in bytes is written in black.'); + * } + * + * // Display the p5.File's size + * // in bytes once it loads. + * function displaySize(file) { + * background(200); + * + * // Display the p5.File's size. + * text(`This is file has ${file.size} bytes.`, 10, 10, 80, 80); + * } + * + *
                              + */ + this.size = file.size; + /** + * A string containing either the file's image data, text contents, or + * a parsed object in the case of JSON and + * p5.XML objects. + * + * @property data + * @example + *
                              + * + * // Use the file input to load a + * // file and display its info. + * + * function setup() { + * background(200); + * + * // Create a file input and place it beneath + * // the canvas. Call displayData() when + * // the file loads. + * let input = createFileInput(displayData); + * input.position(0, 100); + * + * describe('A gray square with a file input beneath it. If the user loads a file, its data is written in black.'); + * } + * + * // Display the p5.File's data + * // once it loads. + * function displayData(file) { + * background(200); + * + * // Display the p5.File's data, + * // which looks like a random + * // string of characters. + * text(file.data, 10, 10, 80, 80); + * } + * + *
                              + */ + this.data = undefined; + } + _createClass(File, null, [ + { + key: '_createLoader', + value: function _createLoader(theFile, callback) { + var reader = new FileReader(); + reader.onload = function (e) { + var p5file = new _main.default.File(theFile); + if (p5file.file.type === 'application/json') { + // Parse JSON and store the result in data + p5file.data = JSON.parse(e.target.result); + } else if (p5file.file.type === 'text/xml') { + // Parse XML, wrap it in p5.XML and store the result in data + var parser = new DOMParser(); + var xml = parser.parseFromString(e.target.result, 'text/xml'); + p5file.data = new _main.default.XML(xml.documentElement); + } else { + p5file.data = e.target.result; + } + callback(p5file); + }; + return reader; + } + }, + { + key: '_load', + value: function _load(f, callback) { + // Text or data? + // This should likely be improved + if (/^text\//.test(f.type) || f.type === 'application/json') { + _main.default.File._createLoader(f, callback).readAsText(f); + } else if (!/^(video|audio)\//.test(f.type)) { + _main.default.File._createLoader(f, callback).readAsDataURL(f); + } else { + var file = new _main.default.File(f); + file.data = URL.createObjectURL(f); + callback(file); + } + } + } + ]); + return File; + }(); + _main.default.File = File; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.every': 171, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.promise': 201, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.trim': 219, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256, + 'core-js/modules/web.url': 258 + } + ], + 315: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Events + * @submodule Acceleration + * @for p5 + * @requires core + * @main Events + */ + /** + * The system variable deviceOrientation always contains the orientation of + * the device. The value of this variable will either be set 'landscape' + * or 'portrait'. If no data is available it will be set to 'undefined'. + * either LANDSCAPE or PORTRAIT. + * + * @property {Constant} deviceOrientation + * @readOnly + */ + + _main.default.prototype.deviceOrientation = window.innerWidth / window.innerHeight > 1 ? 'landscape' : 'portrait'; + /** + * The system variable accelerationX always contains the acceleration of the + * device along the x axis. Value is represented as meters per second squared. + * + * @property {Number} accelerationX + * @readOnly + * @example + *
                              + * + * // Move a touchscreen device to register + * // acceleration changes. + * function draw() { + * background(220, 50); + * fill('magenta'); + * ellipse(width / 2, height / 2, accelerationX); + * describe('Magnitude of device acceleration is displayed as ellipse size.'); + * } + * + *
                              + */ + _main.default.prototype.accelerationX = 0; + /** + * The system variable accelerationY always contains the acceleration of the + * device along the y axis. Value is represented as meters per second squared. + * + * @property {Number} accelerationY + * @readOnly + * @example + *
                              + * + * // Move a touchscreen device to register + * // acceleration changes. + * function draw() { + * background(220, 50); + * fill('magenta'); + * ellipse(width / 2, height / 2, accelerationY); + * describe('Magnitude of device acceleration is displayed as ellipse size'); + * } + * + *
                              + */ + _main.default.prototype.accelerationY = 0; + /** + * The system variable accelerationZ always contains the acceleration of the + * device along the z axis. Value is represented as meters per second squared. + * + * @property {Number} accelerationZ + * @readOnly + * + * @example + *
                              + * + * // Move a touchscreen device to register + * // acceleration changes. + * function draw() { + * background(220, 50); + * fill('magenta'); + * ellipse(width / 2, height / 2, accelerationZ); + * describe('Magnitude of device acceleration is displayed as ellipse size'); + * } + * + *
                              + */ + _main.default.prototype.accelerationZ = 0; + /** + * The system variable pAccelerationX always contains the acceleration of the + * device along the x axis in the frame previous to the current frame. Value + * is represented as meters per second squared. + * + * @property {Number} pAccelerationX + * @readOnly + */ + _main.default.prototype.pAccelerationX = 0; + /** + * The system variable pAccelerationY always contains the acceleration of the + * device along the y axis in the frame previous to the current frame. Value + * is represented as meters per second squared. + * + * @property {Number} pAccelerationY + * @readOnly + */ + _main.default.prototype.pAccelerationY = 0; + /** + * The system variable pAccelerationZ always contains the acceleration of the + * device along the z axis in the frame previous to the current frame. Value + * is represented as meters per second squared. + * + * @property {Number} pAccelerationZ + * @readOnly + */ + _main.default.prototype.pAccelerationZ = 0; + /** + * _updatePAccelerations updates the pAcceleration values + * + * @private + */ + _main.default.prototype._updatePAccelerations = function () { + this._setProperty('pAccelerationX', this.accelerationX); + this._setProperty('pAccelerationY', this.accelerationY); + this._setProperty('pAccelerationZ', this.accelerationZ); + }; + /** + * The system variable rotationX always contains the rotation of the + * device along the x axis. If the sketch + * angleMode() is set to DEGREES, the value will be -180 to 180. If + * it is set to RADIANS, the value will be -PI to PI. + * + * Note: The order the rotations are called is important, ie. if used + * together, it must be called in the order Z-X-Y or there might be + * unexpected behaviour. + * + * @property {Number} rotationX + * @readOnly + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * //rotateZ(radians(rotationZ)); + * rotateX(radians(rotationX)); + * //rotateY(radians(rotationY)); + * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); + * } + * + *
                              + */ + _main.default.prototype.rotationX = 0; + /** + * The system variable rotationY always contains the rotation of the + * device along the y axis. If the sketch + * angleMode() is set to DEGREES, the value will be -90 to 90. If + * it is set to RADIANS, the value will be -PI/2 to PI/2. + * + * Note: The order the rotations are called is important, ie. if used + * together, it must be called in the order Z-X-Y or there might be + * unexpected behaviour. + * + * @property {Number} rotationY + * @readOnly + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * //rotateZ(radians(rotationZ)); + * //rotateX(radians(rotationX)); + * rotateY(radians(rotationY)); + * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); + * } + * + *
                              + */ + _main.default.prototype.rotationY = 0; + /** + * The system variable rotationZ always contains the rotation of the + * device along the z axis. If the sketch + * angleMode() is set to DEGREES, the value will be 0 to 360. If + * it is set to RADIANS, the value will be 0 to 2*PI. + * + * Unlike rotationX and rotationY, this variable is available for devices + * with a built-in compass only. + * + * Note: The order the rotations are called is important, ie. if used + * together, it must be called in the order Z-X-Y or there might be + * unexpected behaviour. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * rotateZ(radians(rotationZ)); + * //rotateX(radians(rotationX)); + * //rotateY(radians(rotationY)); + * box(200, 200, 200); + * describe(`red horizontal line right, green vertical line bottom. + * black background.`); + * } + * + *
                              + * + * @property {Number} rotationZ + * @readOnly + */ + _main.default.prototype.rotationZ = 0; + /** + * The system variable pRotationX always contains the rotation of the + * device along the x axis in the frame previous to the current frame. + * If the sketch angleMode() is set to DEGREES, + * the value will be -180 to 180. If it is set to RADIANS, the value will + * be -PI to PI. + * + * pRotationX can also be used with rotationX to determine the rotate + * direction of the device along the X-axis. + * @example + *
                              + * + * // A simple if statement looking at whether + * // rotationX - pRotationX < 0 is true or not will be + * // sufficient for determining the rotate direction + * // in most cases. + * + * // Some extra logic is needed to account for cases where + * // the angles wrap around. + * let rotateDirection = 'clockwise'; + * + * // Simple range conversion to make things simpler. + * // This is not absolutely necessary but the logic + * // will be different in that case. + * + * let rX = rotationX + 180; + * let pRX = pRotationX + 180; + * + * if ((rX - pRX > 0 && rX - pRX < 270) || rX - pRX < -270) { + * rotateDirection = 'clockwise'; + * } else if (rX - pRX < 0 || rX - pRX > 270) { + * rotateDirection = 'counter-clockwise'; + * } + * + * print(rotateDirection); + * describe('no image to display.'); + * + *
                              + * + * @property {Number} pRotationX + * @readOnly + */ + _main.default.prototype.pRotationX = 0; + /** + * The system variable pRotationY always contains the rotation of the + * device along the y axis in the frame previous to the current frame. + * If the sketch angleMode() is set to DEGREES, + * the value will be -90 to 90. If it is set to RADIANS, the value will + * be -PI/2 to PI/2. + * + * pRotationY can also be used with rotationY to determine the rotate + * direction of the device along the Y-axis. + * @example + *
                              + * + * // A simple if statement looking at whether + * // rotationY - pRotationY < 0 is true or not will be + * // sufficient for determining the rotate direction + * // in most cases. + * + * // Some extra logic is needed to account for cases where + * // the angles wrap around. + * let rotateDirection = 'clockwise'; + * + * // Simple range conversion to make things simpler. + * // This is not absolutely necessary but the logic + * // will be different in that case. + * + * let rY = rotationY + 180; + * let pRY = pRotationY + 180; + * + * if ((rY - pRY > 0 && rY - pRY < 270) || rY - pRY < -270) { + * rotateDirection = 'clockwise'; + * } else if (rY - pRY < 0 || rY - pRY > 270) { + * rotateDirection = 'counter-clockwise'; + * } + * print(rotateDirection); + * describe('no image to display.'); + * + *
                              + * + * @property {Number} pRotationY + * @readOnly + */ + _main.default.prototype.pRotationY = 0; + /** + * The system variable pRotationZ always contains the rotation of the + * device along the z axis in the frame previous to the current frame. + * If the sketch angleMode() is set to DEGREES, + * the value will be 0 to 360. If it is set to RADIANS, the value will + * be 0 to 2*PI. + * + * pRotationZ can also be used with rotationZ to determine the rotate + * direction of the device along the Z-axis. + * @example + *
                              + * + * // A simple if statement looking at whether + * // rotationZ - pRotationZ < 0 is true or not will be + * // sufficient for determining the rotate direction + * // in most cases. + * + * // Some extra logic is needed to account for cases where + * // the angles wrap around. + * let rotateDirection = 'clockwise'; + * + * if ( + * (rotationZ - pRotationZ > 0 && rotationZ - pRotationZ < 270) || + * rotationZ - pRotationZ < -270 + * ) { + * rotateDirection = 'clockwise'; + * } else if (rotationZ - pRotationZ < 0 || rotationZ - pRotationZ > 270) { + * rotateDirection = 'counter-clockwise'; + * } + * print(rotateDirection); + * describe('no image to display.'); + * + *
                              + * + * @property {Number} pRotationZ + * @readOnly + */ + _main.default.prototype.pRotationZ = 0; + var startAngleX = 0; + var startAngleY = 0; + var startAngleZ = 0; + var rotateDirectionX = 'clockwise'; + var rotateDirectionY = 'clockwise'; + var rotateDirectionZ = 'clockwise'; + _main.default.prototype.pRotateDirectionX = undefined; + _main.default.prototype.pRotateDirectionY = undefined; + _main.default.prototype.pRotateDirectionZ = undefined; + _main.default.prototype._updatePRotations = function () { + this._setProperty('pRotationX', this.rotationX); + this._setProperty('pRotationY', this.rotationY); + this._setProperty('pRotationZ', this.rotationZ); + }; + /** + * When a device is rotated, the axis that triggers the deviceTurned() + * method is stored in the turnAxis variable. The turnAxis variable is only defined within + * the scope of deviceTurned(). + * @property {String} turnAxis + * @readOnly + * @example + *
                              + * + * // Run this example on a mobile device + * // Rotate the device by 90 degrees in the + * // X-axis to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device turns`); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when x-axis turns`); + * } + * function deviceTurned() { + * if (turnAxis === 'X') { + * if (value === 0) { + * value = 255; + * } else if (value === 255) { + * value = 0; + * } + * } + * } + * + *
                              + */ + _main.default.prototype.turnAxis = undefined; + var move_threshold = 0.5; + var shake_threshold = 30; + /** + * The setMoveThreshold() function is used to set the movement threshold for + * the deviceMoved() function. The default threshold is set to 0.5. + * + * @method setMoveThreshold + * @param {number} value The threshold value + * @example + *
                              + * + * // Run this example on a mobile device + * // You will need to move the device incrementally further + * // the closer the square's color gets to white in order to change the value. + * + * let value = 0; + * let threshold = 0.5; + * function setup() { + * setMoveThreshold(threshold); + * } + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device moves`); + * } + * function deviceMoved() { + * value = value + 5; + * threshold = threshold + 0.1; + * if (value > 255) { + * value = 0; + * threshold = 30; + * } + * setMoveThreshold(threshold); + * } + * + *
                              + */ + _main.default.prototype.setMoveThreshold = function (val) { + _main.default._validateParameters('setMoveThreshold', arguments); + move_threshold = val; + }; + /** + * The setShakeThreshold() function is used to set the movement threshold for + * the deviceShaken() function. The default threshold is set to 30. + * + * @method setShakeThreshold + * @param {number} value The threshold value + * @example + *
                              + * + * // Run this example on a mobile device + * // You will need to shake the device more firmly + * // the closer the box's fill gets to white in order to change the value. + * + * let value = 0; + * let threshold = 30; + * function setup() { + * setShakeThreshold(threshold); + * } + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device is being shaked`); + * } + * function deviceMoved() { + * value = value + 5; + * threshold = threshold + 5; + * if (value > 255) { + * value = 0; + * threshold = 30; + * } + * setShakeThreshold(threshold); + * } + * + *
                              + */ + _main.default.prototype.setShakeThreshold = function (val) { + _main.default._validateParameters('setShakeThreshold', arguments); + shake_threshold = val; + }; + /** + * The deviceMoved() function is called when the device is moved by more than + * the threshold value along X, Y or Z axis. The default threshold is set to 0.5. + * The threshold value can be changed using setMoveThreshold(). + * + * @method deviceMoved + * @example + *
                              + * + * // Run this example on a mobile device + * // Move the device around + * // to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device moves`); + * } + * function deviceMoved() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                              + */ + /** + * The deviceTurned() function is called when the device rotates by + * more than 90 degrees continuously. + * + * The axis that triggers the deviceTurned() method is stored in the turnAxis + * variable. The deviceTurned() method can be locked to trigger on any axis: + * X, Y or Z by comparing the turnAxis variable to 'X', 'Y' or 'Z'. + * + * @method deviceTurned + * @example + *
                              + * + * // Run this example on a mobile device + * // Rotate the device by 90 degrees + * // to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device turns`); + * } + * function deviceTurned() { + * if (value === 0) { + * value = 255; + * } else if (value === 255) { + * value = 0; + * } + * } + * + *
                              + *
                              + * + * // Run this example on a mobile device + * // Rotate the device by 90 degrees in the + * // X-axis to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when x-axis turns`); + * } + * function deviceTurned() { + * if (turnAxis === 'X') { + * if (value === 0) { + * value = 255; + * } else if (value === 255) { + * value = 0; + * } + * } + * } + * + *
                              + */ + /** + * The deviceShaken() function is called when the device total acceleration + * changes of accelerationX and accelerationY values is more than + * the threshold value. The default threshold is set to 30. + * The threshold value can be changed using setShakeThreshold(). + * + * @method deviceShaken + * @example + *
                              + * + * // Run this example on a mobile device + * // Shake the device to change the value. + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`50-by-50 black rect in center of canvas. + * turns white on mobile when device shakes`); + * } + * function deviceShaken() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                              + */ + _main.default.prototype._ondeviceorientation = function (e) { + this._updatePRotations(); + if (this._angleMode === constants.radians) { + e.beta = e.beta * (_PI / 180); + e.gamma = e.gamma * (_PI / 180); + e.alpha = e.alpha * (_PI / 180); + } + this._setProperty('rotationX', e.beta); + this._setProperty('rotationY', e.gamma); + this._setProperty('rotationZ', e.alpha); + this._handleMotion(); + }; + _main.default.prototype._ondevicemotion = function (e) { + this._updatePAccelerations(); + this._setProperty('accelerationX', e.acceleration.x * 2); + this._setProperty('accelerationY', e.acceleration.y * 2); + this._setProperty('accelerationZ', e.acceleration.z * 2); + this._handleMotion(); + }; + _main.default.prototype._handleMotion = function () { + if (window.orientation === 90 || window.orientation === - 90) { + this._setProperty('deviceOrientation', 'landscape'); + } else if (window.orientation === 0) { + this._setProperty('deviceOrientation', 'portrait'); + } else if (window.orientation === undefined) { + this._setProperty('deviceOrientation', 'undefined'); + } + var context = this._isGlobal ? window : this; + if (typeof context.deviceMoved === 'function') { + if (Math.abs(this.accelerationX - this.pAccelerationX) > move_threshold || Math.abs(this.accelerationY - this.pAccelerationY) > move_threshold || Math.abs(this.accelerationZ - this.pAccelerationZ) > move_threshold) { + context.deviceMoved(); + } + } + if (typeof context.deviceTurned === 'function') { + // The angles given by rotationX etc is from range -180 to 180. + // The following will convert them to 0 to 360 for ease of calculation + // of cases when the angles wrapped around. + // _startAngleX will be converted back at the end and updated. + var wRX = this.rotationX + 180; + var wPRX = this.pRotationX + 180; + var wSAX = startAngleX + 180; + if (wRX - wPRX > 0 && wRX - wPRX < 270 || wRX - wPRX < - 270) { + rotateDirectionX = 'clockwise'; + } else if (wRX - wPRX < 0 || wRX - wPRX > 270) { + rotateDirectionX = 'counter-clockwise'; + } + if (rotateDirectionX !== this.pRotateDirectionX) { + wSAX = wRX; + } + if (Math.abs(wRX - wSAX) > 90 && Math.abs(wRX - wSAX) < 270) { + wSAX = wRX; + this._setProperty('turnAxis', 'X'); + context.deviceTurned(); + } + this.pRotateDirectionX = rotateDirectionX; + startAngleX = wSAX - 180; + // Y-axis is identical to X-axis except for changing some names. + var wRY = this.rotationY + 180; + var wPRY = this.pRotationY + 180; + var wSAY = startAngleY + 180; + if (wRY - wPRY > 0 && wRY - wPRY < 270 || wRY - wPRY < - 270) { + rotateDirectionY = 'clockwise'; + } else if (wRY - wPRY < 0 || wRY - this.pRotationY > 270) { + rotateDirectionY = 'counter-clockwise'; + } + if (rotateDirectionY !== this.pRotateDirectionY) { + wSAY = wRY; + } + if (Math.abs(wRY - wSAY) > 90 && Math.abs(wRY - wSAY) < 270) { + wSAY = wRY; + this._setProperty('turnAxis', 'Y'); + context.deviceTurned(); + } + this.pRotateDirectionY = rotateDirectionY; + startAngleY = wSAY - 180; + // Z-axis is already in the range 0 to 360 + // so no conversion is needed. + if (this.rotationZ - this.pRotationZ > 0 && this.rotationZ - this.pRotationZ < 270 || this.rotationZ - this.pRotationZ < - 270) { + rotateDirectionZ = 'clockwise'; + } else if (this.rotationZ - this.pRotationZ < 0 || this.rotationZ - this.pRotationZ > 270) { + rotateDirectionZ = 'counter-clockwise'; + } + if (rotateDirectionZ !== this.pRotateDirectionZ) { + startAngleZ = this.rotationZ; + } + if (Math.abs(this.rotationZ - startAngleZ) > 90 && Math.abs(this.rotationZ - startAngleZ) < 270) { + startAngleZ = this.rotationZ; + this._setProperty('turnAxis', 'Z'); + context.deviceTurned(); + } + this.pRotateDirectionZ = rotateDirectionZ; + this._setProperty('turnAxis', undefined); + } + if (typeof context.deviceShaken === 'function') { + var accelerationChangeX; + var accelerationChangeY; + // Add accelerationChangeZ if acceleration change on Z is needed + if (this.pAccelerationX !== null) { + accelerationChangeX = Math.abs(this.accelerationX - this.pAccelerationX); + accelerationChangeY = Math.abs(this.accelerationY - this.pAccelerationY); + } + if (accelerationChangeX + accelerationChangeY > shake_threshold) { + context.deviceShaken(); + } + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 316: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Events + * @submodule Keyboard + * @for p5 + * @requires core + */ + /** + * The boolean system variable keyIsPressed is true if any key is pressed + * and false if no keys are pressed. + * + * @property {Boolean} keyIsPressed + * @readOnly + * @example + *
                              + * + * function draw() { + * if (keyIsPressed === true) { + * fill(0); + * } else { + * fill(255); + * } + * rect(25, 25, 50, 50); + * describe('50-by-50 white rect that turns black on keypress.'); + * } + * + *
                              + */ + + _main.default.prototype.isKeyPressed = false; + _main.default.prototype.keyIsPressed = false; // khan + /** + * The system variable key always contains the value of the most recent + * key on the keyboard that was typed. To get the proper capitalization, it + * is best to use it within keyTyped(). For non-ASCII keys, use the keyCode + * variable. + * + * @property {String} key + * @readOnly + * @example + *
                              + * // Click any key to display it! + * // (Not Guaranteed to be Case Sensitive) + * function setup() { + * fill(245, 123, 158); + * textSize(50); + * } + * + * function draw() { + * background(200); + * text(key, 33, 65); // Display last key pressed. + * describe('canvas displays any key value that is pressed in pink font.'); + * } + *
                              + */ + _main.default.prototype.key = ''; + /** + * The variable keyCode is used to detect special keys such as BACKSPACE, + * DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, OPTION, ALT, UP_ARROW, + * DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. + * You can also check for custom keys by looking up the keyCode of any key + * on a site like this: keycode.info. + * + * @property {Integer} keyCode + * @readOnly + * @example + *
                              + * let fillVal = 126; + * function draw() { + * fill(fillVal); + * rect(25, 25, 50, 50); + * describe(`Grey rect center. turns white when up arrow pressed and black when down. + * Display key pressed and its keyCode in a yellow box.`); + * } + * + * function keyPressed() { + * if (keyCode === UP_ARROW) { + * fillVal = 255; + * } else if (keyCode === DOWN_ARROW) { + * fillVal = 0; + * } + * } + *
                              + *
                              + * function draw() {} + * function keyPressed() { + * background('yellow'); + * text(`${key} ${keyCode}`, 10, 40); + * print(key, ' ', keyCode); + * } + *
                              + */ + _main.default.prototype.keyCode = 0; + /** + * The keyPressed() function is called once every time a key is pressed. The + * keyCode for the key that was pressed is stored in the keyCode variable. + * + * For non-ASCII keys, use the keyCode variable. You can check if the keyCode + * equals BACKSPACE, DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, + * OPTION, ALT, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. + * + * For ASCII keys, the key that was pressed is stored in the key variable. However, it + * does not distinguish between uppercase and lowercase. For this reason, it + * is recommended to use keyTyped() to read the key variable, in which the + * case of the variable will be distinguished. + * + * Because of how operating systems handle key repeats, holding down a key + * may cause multiple calls to keyTyped() (and keyReleased() as well). The + * rate of repeat is set by the operating system and how each computer is + * configured.

                              + * Browsers may have different default + * behaviors attached to various key events. To prevent any default + * behavior for this event, add "return false" to the end of the method. + * + * @method keyPressed + * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. + * @example + *
                              + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when key pressed and black + * when released.`); + * } + * function keyPressed() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                              + *
                              + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when left arrow pressed and + * black when right.`); + * } + * function keyPressed() { + * if (keyCode === LEFT_ARROW) { + * value = 255; + * } else if (keyCode === RIGHT_ARROW) { + * value = 0; + * } + * } + * + *
                              + *
                              + * + * function keyPressed() { + * // Do something + * return false; // prevent any default behaviour + * } + * + *
                              + */ + _main.default.prototype._onkeydown = function (e) { + if (this._downKeys[e.which]) { + // prevent multiple firings + return; + } + this._setProperty('isKeyPressed', true); + this._setProperty('keyIsPressed', true); + this._setProperty('keyCode', e.which); + this._downKeys[e.which] = true; + this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); + var context = this._isGlobal ? window : this; + if (typeof context.keyPressed === 'function' && !e.charCode) { + var executeDefault = context.keyPressed(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The keyReleased() function is called once every time a key is released. + * See key and keyCode for more information.

                              + * Browsers may have different default + * behaviors attached to various key events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method keyReleased + * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. + * @example + *
                              + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when key pressed and black + * when pressed again`); + * } + * function keyReleased() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * return false; // prevent any default behavior + * } + * + *
                              + */ + _main.default.prototype._onkeyup = function (e) { + this._downKeys[e.which] = false; + if (!this._areDownKeys()) { + this._setProperty('isKeyPressed', false); + this._setProperty('keyIsPressed', false); + } + this._setProperty('_lastKeyCodeTyped', null); + this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); + this._setProperty('keyCode', e.which); + var context = this._isGlobal ? window : this; + if (typeof context.keyReleased === 'function') { + var executeDefault = context.keyReleased(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The keyTyped() function is called once every time a key is pressed, but + * action keys such as Backspace, Delete, Ctrl, Shift, and Alt are ignored. If you are trying to detect + * a keyCode for one of these keys, use the keyPressed() function instead. + * The most recent key typed will be stored in the key variable. + * + * Because of how operating systems handle key repeats, holding down a key + * will cause multiple calls to keyTyped() (and keyReleased() as well). The + * rate of repeat is set by the operating system and how each computer is + * configured.

                              + * Browsers may have different default behaviors attached to various key + * events. To prevent any default behavior for this event, add "return false" + * to the end of the function. + * + * @method keyTyped + * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. + * @example + *
                              + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black rect center. turns white when 'a' key typed and + * black when 'b' pressed`); + * } + * function keyTyped() { + * if (key === 'a') { + * value = 255; + * } else if (key === 'b') { + * value = 0; + * } + * // uncomment to prevent any default behavior + * // return false; + * } + * + *
                              + */ + _main.default.prototype._onkeypress = function (e) { + if (e.which === this._lastKeyCodeTyped) { + // prevent multiple firings + return; + } + this._setProperty('_lastKeyCodeTyped', e.which); // track last keyCode + this._setProperty('key', e.key || String.fromCharCode(e.which) || e.which); + var context = this._isGlobal ? window : this; + if (typeof context.keyTyped === 'function') { + var executeDefault = context.keyTyped(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The onblur function is called when the user is no longer focused + * on the p5 element. Because the keyup events will not fire if the user is + * not focused on the element we must assume all keys currently down have + * been released. + */ + _main.default.prototype._onblur = function (e) { + this._downKeys = { + }; + }; + /** + * The keyIsDown() function checks if the key is currently down, i.e. pressed. + * It can be used if you have an object that moves, and you want several keys + * to be able to affect its behaviour simultaneously, such as moving a + * sprite diagonally. You can put in any number representing the keyCode of + * the key, or use any of the variable keyCode names listed + * here. + * + * @method keyIsDown + * @param {Number} code The key to check for. + * @return {Boolean} whether key is down or not + * @example + *
                              + * let x = 100; + * let y = 100; + * + * function setup() { + * createCanvas(512, 512); + * fill(255, 0, 0); + * } + * + * function draw() { + * if (keyIsDown(LEFT_ARROW)) { + * x -= 5; + * } + * + * if (keyIsDown(RIGHT_ARROW)) { + * x += 5; + * } + * + * if (keyIsDown(UP_ARROW)) { + * y -= 5; + * } + * + * if (keyIsDown(DOWN_ARROW)) { + * y += 5; + * } + * + * clear(); + * ellipse(x, y, 50, 50); + * describe(`50-by-50 red ellipse moves left, right, up, and + * down with arrow presses.`); + * } + *
                              + * + *
                              + * let diameter = 50; + * + * function setup() { + * createCanvas(512, 512); + * } + * + * function draw() { + * // 107 and 187 are keyCodes for "+" + * if (keyIsDown(107) || keyIsDown(187)) { + * diameter += 1; + * } + * + * // 109 and 189 are keyCodes for "-" + * if (keyIsDown(109) || keyIsDown(189)) { + * diameter -= 1; + * } + * + * clear(); + * fill(255, 0, 0); + * ellipse(50, 50, diameter, diameter); + * describe(`50-by-50 red ellipse gets bigger or smaller when + * + or - are pressed.`); + * } + *
                              + */ + _main.default.prototype.keyIsDown = function (code) { + _main.default._validateParameters('keyIsDown', arguments); + return this._downKeys[code] || false; + }; + /** + * The _areDownKeys function returns a boolean true if any keys pressed + * and a false if no keys are currently pressed. + + * Helps avoid instances where multiple keys are pressed simultaneously and + * releasing a single key will then switch the + * keyIsPressed property to true. + * @private +**/ + _main.default.prototype._areDownKeys = function () { + for (var key in this._downKeys) { + if (this._downKeys.hasOwnProperty(key) && this._downKeys[key] === true) { + return true; + } + } + return false; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298 + } + ], + 317: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.string.includes'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Events + * @submodule Mouse + * @for p5 + * @requires core + * @requires constants + */ + /** + * + * The variable movedX contains the horizontal movement of the mouse since the last frame + * @property {Number} movedX + * @readOnly + * @example + *
                              + * + * let x = 50; + * function setup() { + * rectMode(CENTER); + * } + * + * function draw() { + * if (x > 48) { + * x -= 2; + * } else if (x < 48) { + * x += 2; + * } + * x += floor(movedX / 5); + * background(237, 34, 93); + * fill(0); + * rect(x, 50, 50, 50); + * describe(`box moves left and right according to mouse movement + * then slowly back towards the center`); + * } + * + *
                              + */ + + _main.default.prototype.movedX = 0; + /** + * The variable movedY contains the vertical movement of the mouse since the last frame + * @property {Number} movedY + * @readOnly + * @example + *
                              + * + * let y = 50; + * function setup() { + * rectMode(CENTER); + * } + * + * function draw() { + * if (y > 48) { + * y -= 2; + * } else if (y < 48) { + * y += 2; + * } + * y += floor(movedY / 5); + * background(237, 34, 93); + * fill(0); + * rect(50, y, 50, 50); + * describe(`box moves up and down according to mouse movement then + * slowly back towards the center`); + * } + * + *
                              + */ + _main.default.prototype.movedY = 0; + /* + * This is a flag which is false until the first time + * we receive a mouse event. The pmouseX and pmouseY + * values will match the mouseX and mouseY values until + * this interaction takes place. + */ + _main.default.prototype._hasMouseInteracted = false; + /** + * The system variable mouseX always contains the current horizontal + * position of the mouse, relative to (0, 0) of the canvas. The value at + * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. + * If touch is used instead of mouse input, mouseX will hold the x value + * of the most recent touch point. + * + * @property {Number} mouseX + * @readOnly + * + * @example + *
                              + * + * // Move the mouse across the canvas + * function draw() { + * background(244, 248, 252); + * line(mouseX, 0, mouseX, 100); + * describe('horizontal black line moves left and right with mouse x-position'); + * } + * + *
                              + */ + _main.default.prototype.mouseX = 0; + /** + * The system variable mouseY always contains the current vertical + * position of the mouse, relative to (0, 0) of the canvas. The value at + * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. + * If touch is used instead of mouse input, mouseY will hold the y value + * of the most recent touch point. + * + * @property {Number} mouseY + * @readOnly + * + * @example + *
                              + * + * // Move the mouse across the canvas + * function draw() { + * background(244, 248, 252); + * line(0, mouseY, 100, mouseY); + * describe('vertical black line moves up and down with mouse y-position'); + * } + * + *
                              + */ + _main.default.prototype.mouseY = 0; + /** + * The system variable pmouseX always contains the horizontal position of + * the mouse or finger in the frame previous to the current frame, relative to + * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and + * (-width/2, -height/2) for WebGL. Note: pmouseX will be reset to the current mouseX + * value at the start of each touch event. + * + * @property {Number} pmouseX + * @readOnly + * + * @example + *
                              + * + * // Move the mouse across the canvas to leave a trail + * function setup() { + * //slow down the frameRate to make it more visible + * frameRate(10); + * } + * + * function draw() { + * background(244, 248, 252); + * line(mouseX, mouseY, pmouseX, pmouseY); + * print(pmouseX + ' -> ' + mouseX); + * describe(`line trail is created from cursor movements. + * faster movement make longer line.`); + * } + * + *
                              + */ + _main.default.prototype.pmouseX = 0; + /** + * The system variable pmouseY always contains the vertical position of + * the mouse or finger in the frame previous to the current frame, relative to + * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and + * (-width/2, -height/2) for WebGL. Note: pmouseY will be reset to the current mouseY + * value at the start of each touch event. + * + * @property {Number} pmouseY + * @readOnly + * + * @example + *
                              + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * //draw a square only if the mouse is not moving + * if (mouseY === pmouseY && mouseX === pmouseX) { + * rect(20, 20, 60, 60); + * } + * + * print(pmouseY + ' -> ' + mouseY); + * describe(`60-by-60 black rect center, fuchsia background. + * rect flickers on mouse movement`); + * } + * + *
                              + */ + _main.default.prototype.pmouseY = 0; + /** + * The system variable winMouseX always contains the current horizontal + * position of the mouse, relative to (0, 0) of the window. + * + * @property {Number} winMouseX + * @readOnly + * + * @example + *
                              + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * let body = document.getElementsByTagName('body')[0]; + * myCanvas.parent(body); + * } + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * //move the canvas to the horizontal mouse position + * //relative to the window + * myCanvas.position(winMouseX + 1, windowHeight / 2); + * + * //the y of the square is relative to the canvas + * rect(20, mouseY, 60, 60); + * describe(`60-by-60 black rect y moves with mouse y and fuchsia + * canvas moves with mouse x`); + * } + * + *
                              + */ + _main.default.prototype.winMouseX = 0; + /** + * The system variable winMouseY always contains the current vertical + * position of the mouse, relative to (0, 0) of the window. + * + * @property {Number} winMouseY + * @readOnly + * + * @example + *
                              + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * let body = document.getElementsByTagName('body')[0]; + * myCanvas.parent(body); + * } + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * //move the canvas to the vertical mouse position + * //relative to the window + * myCanvas.position(windowWidth / 2, winMouseY + 1); + * + * //the x of the square is relative to the canvas + * rect(mouseX, 20, 60, 60); + * describe(`60-by-60 black rect x moves with mouse x and + * fuchsia canvas y moves with mouse y`); + * } + * + *
                              + */ + _main.default.prototype.winMouseY = 0; + /** + * The system variable pwinMouseX always contains the horizontal position + * of the mouse in the frame previous to the current frame, relative to + * (0, 0) of the window. Note: pwinMouseX will be reset to the current winMouseX + * value at the start of each touch event. + * + * @property {Number} pwinMouseX + * @readOnly + * + * @example + *
                              + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * noStroke(); + * fill(237, 34, 93); + * } + * + * function draw() { + * clear(); + * //the difference between previous and + * //current x position is the horizontal mouse speed + * let speed = abs(winMouseX - pwinMouseX); + * //change the size of the circle + * //according to the horizontal speed + * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); + * //move the canvas to the mouse position + * myCanvas.position(winMouseX + 1, winMouseY + 1); + * describe(`fuchsia ellipse moves with mouse x and y. + * Grows and shrinks with mouse speed`); + * } + * + *
                              + */ + _main.default.prototype.pwinMouseX = 0; + /** + * The system variable pwinMouseY always contains the vertical position of + * the mouse in the frame previous to the current frame, relative to (0, 0) + * of the window. Note: pwinMouseY will be reset to the current winMouseY + * value at the start of each touch event. + * + * @property {Number} pwinMouseY + * @readOnly + * + * @example + *
                              + * + * let myCanvas; + * + * function setup() { + * //use a variable to store a pointer to the canvas + * myCanvas = createCanvas(100, 100); + * noStroke(); + * fill(237, 34, 93); + * } + * + * function draw() { + * clear(); + * //the difference between previous and + * //current y position is the vertical mouse speed + * let speed = abs(winMouseY - pwinMouseY); + * //change the size of the circle + * //according to the vertical speed + * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); + * //move the canvas to the mouse position + * myCanvas.position(winMouseX + 1, winMouseY + 1); + * describe(`fuchsia ellipse moves with mouse x and y. + * Grows and shrinks with mouse speed`); + * } + * + *
                              + */ + _main.default.prototype.pwinMouseY = 0; + /** + * p5 automatically tracks if the mouse button is pressed and which + * button is pressed. The value of the system variable mouseButton is either + * LEFT, RIGHT, or CENTER depending on which button was pressed last. + * Warning: different browsers may track mouseButton differently. + * + * @property {Constant} mouseButton + * @readOnly + * + * @example + *
                              + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * if (mouseIsPressed === true) { + * if (mouseButton === LEFT) { + * ellipse(50, 50, 50, 50); + * } + * if (mouseButton === RIGHT) { + * rect(25, 25, 50, 50); + * } + * if (mouseButton === CENTER) { + * triangle(23, 75, 50, 20, 78, 75); + * } + * } + * + * print(mouseButton); + * describe(`50-by-50 black ellipse appears on center of fuchsia + * canvas on mouse click/press.`); + * } + * + *
                              + */ + _main.default.prototype.mouseButton = 0; + /** + * The boolean system variable mouseIsPressed is true if the mouse is pressed + * and false if not. + * + * @property {Boolean} mouseIsPressed + * @readOnly + * + * @example + *
                              + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * + * if (mouseIsPressed === true) { + * ellipse(50, 50, 50, 50); + * } else { + * rect(25, 25, 50, 50); + * } + * + * print(mouseIsPressed); + * describe(`black 50-by-50 rect becomes ellipse with mouse click/press. + * fuchsia background.`); + * } + * + *
                              + */ + _main.default.prototype.mouseIsPressed = false; + _main.default.prototype._updateNextMouseCoords = function (e) { + if (this._curElement !== null && (!e.touches || e.touches.length > 0)) { + var mousePos = getMousePos(this._curElement.elt, this.width, this.height, e); + this._setProperty('movedX', e.movementX); + this._setProperty('movedY', e.movementY); + this._setProperty('mouseX', mousePos.x); + this._setProperty('mouseY', mousePos.y); + this._setProperty('winMouseX', mousePos.winX); + this._setProperty('winMouseY', mousePos.winY); + } + if (!this._hasMouseInteracted) { + // For first draw, make previous and next equal + this._updateMouseCoords(); + this._setProperty('_hasMouseInteracted', true); + } + }; + _main.default.prototype._updateMouseCoords = function () { + this._setProperty('pmouseX', this.mouseX); + this._setProperty('pmouseY', this.mouseY); + this._setProperty('pwinMouseX', this.winMouseX); + this._setProperty('pwinMouseY', this.winMouseY); + this._setProperty('_pmouseWheelDeltaY', this._mouseWheelDeltaY); + }; + function getMousePos(canvas, w, h, evt) { + if (evt && !evt.clientX) { + // use touches if touch and not mouse + if (evt.touches) { + evt = evt.touches[0]; + } else if (evt.changedTouches) { + evt = evt.changedTouches[0]; + } + } + var rect = canvas.getBoundingClientRect(); + var sx = canvas.scrollWidth / w || 1; + var sy = canvas.scrollHeight / h || 1; + return { + x: (evt.clientX - rect.left) / sx, + y: (evt.clientY - rect.top) / sy, + winX: evt.clientX, + winY: evt.clientY, + id: evt.identifier + }; + } + _main.default.prototype._setMouseButton = function (e) { + if (e.button === 1) { + this._setProperty('mouseButton', constants.CENTER); + } else if (e.button === 2) { + this._setProperty('mouseButton', constants.RIGHT); + } else { + this._setProperty('mouseButton', constants.LEFT); + } + }; + /** + * The mouseMoved() function is called every time the mouse moves and a mouse + * button is not pressed.

                              + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the method. + * + * @method mouseMoved + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                              + * + * // Move the mouse across the page + * // to change its value + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black 50-by-50 rect becomes lighter with mouse movements until + * white then resets no image displayed`); + * } + * function mouseMoved() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function mouseMoved() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                              + * + *
                              + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseMoved(event) { + * console.log(event); + * } + * + *
                              + */ + /** + * The mouseDragged() function is called once every time the mouse moves and + * a mouse button is pressed. If no mouseDragged() function is defined, the + * touchMoved() function will be called instead if it is defined.

                              + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mouseDragged + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                              + * + * // Drag the mouse across the page + * // to change its value + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe(`black 50-by-50 rect turns lighter with mouse click and + * drag until white, resets`); + * } + * function mouseDragged() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function mouseDragged() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                              + * + *
                              + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseDragged(event) { + * console.log(event); + * } + * + *
                              + */ + _main.default.prototype._onmousemove = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._updateNextMouseCoords(e); + if (!this.mouseIsPressed) { + if (typeof context.mouseMoved === 'function') { + executeDefault = context.mouseMoved(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + } else { + if (typeof context.mouseDragged === 'function') { + executeDefault = context.mouseDragged(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.touchMoved === 'function') { + executeDefault = context.touchMoved(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + } + }; + /** + * The mousePressed() function is called once after every time a mouse button + * is pressed. The mouseButton variable (see the related reference entry) + * can be used to determine which button has been pressed. If no + * mousePressed() function is defined, the touchStarted() function will be + * called instead if it is defined.

                              + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mousePressed + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                              + * + * // Click anywhere in the webpage to change + * // the color value of the rectangle + * + * let colorValue = 0; + * function draw() { + * fill(colorValue); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse click/press.'); + * } + * function mousePressed() { + * if (colorValue === 0) { + * colorValue = 255; + * } else { + * colorValue = 0; + * } + * } + * + *
                              + * + *
                              + * + * function mousePressed() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                              + * + *
                              + * + * // returns a MouseEvent object + * // as a callback argument + * function mousePressed(event) { + * console.log(event); + * } + * + *
                              + */ + _main.default.prototype._onmousedown = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._setProperty('mouseIsPressed', true); + this._setMouseButton(e); + this._updateNextMouseCoords(e); + if (typeof context.mousePressed === 'function') { + executeDefault = context.mousePressed(e); + if (executeDefault === false) { + e.preventDefault(); + } // only safari needs this manual fallback for consistency + + } else if (navigator.userAgent.toLowerCase().includes('safari') && typeof context.touchStarted === 'function') { + executeDefault = context.touchStarted(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The mouseReleased() function is called every time a mouse button is + * released. If no mouseReleased() function is defined, the touchEnded() + * function will be called instead if it is defined.

                              + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mouseReleased + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                              + * + * // Click within the image to change + * // the value of the rectangle + * // after the mouse has been clicked + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse click/press.'); + * } + * function mouseReleased() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function mouseReleased() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                              + * + *
                              + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseReleased(event) { + * console.log(event); + * } + * + *
                              + */ + _main.default.prototype._onmouseup = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._setProperty('mouseIsPressed', false); + if (typeof context.mouseReleased === 'function') { + executeDefault = context.mouseReleased(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.touchEnded === 'function') { + executeDefault = context.touchEnded(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + _main.default.prototype._ondragend = _main.default.prototype._onmouseup; + _main.default.prototype._ondragover = _main.default.prototype._onmousemove; + /** + * The mouseClicked() function is called once after a mouse button has been + * pressed and then released.

                              + * Browsers handle clicks differently, so this function is only guaranteed to be + * run when the left mouse button is clicked. To handle other mouse buttons + * being pressed or released, see mousePressed() or mouseReleased().

                              + * Browsers may have different default + * behaviors attached to various mouse events. To prevent any default + * behavior for this event, add "return false" to the end of the function. + * + * @method mouseClicked + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                              + * + * // Click within the image to change + * // the value of the rectangle + * // after the mouse has been clicked + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse click/press.'); + * } + * + * function mouseClicked() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function mouseClicked() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                              + * + *
                              + * + * // returns a MouseEvent object + * // as a callback argument + * function mouseClicked(event) { + * console.log(event); + * } + * + *
                              + */ + _main.default.prototype._onclick = function (e) { + var context = this._isGlobal ? window : this; + if (typeof context.mouseClicked === 'function') { + var executeDefault = context.mouseClicked(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The doubleClicked() function is executed every time a event + * listener has detected a dblclick event which is a part of the + * DOM L3 specification. The doubleClicked event is fired when a + * pointing device button (usually a mouse's primary button) + * is clicked twice on a single element. For more info on the + * dblclick event refer to mozilla's documentation here: + * https://developer.mozilla.org/en-US/docs/Web/Events/dblclick + * + * @method doubleClicked + * @param {MouseEvent} [event] optional MouseEvent callback argument. + * @example + *
                              + * + * // Click within the image to change + * // the value of the rectangle + * // after the mouse has been double clicked + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('black 50-by-50 rect turns white with mouse doubleClick/press.'); + * } + * + * function doubleClicked() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function doubleClicked() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * + *
                              + * + *
                              + * + * // returns a MouseEvent object + * // as a callback argument + * function doubleClicked(event) { + * console.log(event); + * } + * + *
                              + */ + _main.default.prototype._ondblclick = function (e) { + var context = this._isGlobal ? window : this; + if (typeof context.doubleClicked === 'function') { + var executeDefault = context.doubleClicked(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * For use with WebGL orbitControl. + * @property {Number} _mouseWheelDeltaY + * @readOnly + * @private + */ + _main.default.prototype._mouseWheelDeltaY = 0; + /** + * For use with WebGL orbitControl. + * @property {Number} _pmouseWheelDeltaY + * @readOnly + * @private + */ + _main.default.prototype._pmouseWheelDeltaY = 0; + /** + * The function mouseWheel() is executed every time a vertical mouse wheel + * event is detected either triggered by an actual mouse wheel or by a + * touchpad.

                              + * The event.delta property returns the amount the mouse wheel + * have scrolled. The values can be positive or negative depending on the + * scroll direction (on macOS with "natural" scrolling enabled, the signs + * are inverted).

                              + * Browsers may have different default behaviors attached to various + * mouse events. To prevent any default behavior for this event, add + * "return false" to the end of the method.

                              + * Due to the current support of the "wheel" event on Safari, the function + * may only work as expected if "return false" is included while using Safari. + * + * @method mouseWheel + * @param {WheelEvent} [event] optional WheelEvent callback argument. + * + * @example + *
                              + * + * let pos = 25; + * + * function draw() { + * background(237, 34, 93); + * fill(0); + * rect(25, pos, 50, 50); + * describe(`black 50-by-50 rect moves up and down with vertical scroll. + * fuchsia background`); + * } + * + * function mouseWheel(event) { + * print(event.delta); + * //move the square according to the vertical scroll amount + * pos += event.delta; + * //uncomment to block page scrolling + * //return false; + * } + * + *
                              + */ + _main.default.prototype._onwheel = function (e) { + var context = this._isGlobal ? window : this; + this._setProperty('_mouseWheelDeltaY', e.deltaY); + if (typeof context.mouseWheel === 'function') { + e.delta = e.deltaY; + var executeDefault = context.mouseWheel(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The function requestPointerLock() + * locks the pointer to its current position and makes it invisible. + * Use movedX and movedY to get the difference the mouse was moved since + * the last call of draw. + * Note that not all browsers support this feature. + * This enables you to create experiences that aren't limited by the mouse moving out of the screen + * even if it is repeatedly moved into one direction. + * For example, a first person perspective experience. + * + * @method requestPointerLock + * @example + *
                              + * + * let cam; + * function setup() { + * createCanvas(100, 100, WEBGL); + * requestPointerLock(); + * cam = createCamera(); + * } + * + * function draw() { + * background(255); + * cam.pan(-movedX * 0.001); + * cam.tilt(movedY * 0.001); + * sphere(25); + * describe(`3D scene moves according to mouse mouse movement in a + * first person perspective`); + * } + * + *
                              + */ + _main.default.prototype.requestPointerLock = function () { + // pointer lock object forking for cross browser + var canvas = this._curElement.elt; + canvas.requestPointerLock = canvas.requestPointerLock || canvas.mozRequestPointerLock; + if (!canvas.requestPointerLock) { + console.log('requestPointerLock is not implemented in this browser'); + return false; + } + canvas.requestPointerLock(); + return true; + }; + /** + * The function exitPointerLock() + * exits a previously triggered pointer Lock + * for example to make ui elements usable etc + * + * @method exitPointerLock + * @example + *
                              + * + * //click the canvas to lock the pointer + * //click again to exit (otherwise escape) + * let locked = false; + * function draw() { + * background(237, 34, 93); + * describe('cursor gets locked / unlocked on mouse-click'); + * } + * function mouseClicked() { + * if (!locked) { + * locked = true; + * requestPointerLock(); + * } else { + * exitPointerLock(); + * locked = false; + * } + * } + * + *
                              + */ + _main.default.prototype.exitPointerLock = function () { + document.exitPointerLock(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 318: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.string.includes'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Events + * @submodule Touch + * @for p5 + * @requires core + */ + /** + * The system variable touches[] contains an array of the positions of all + * current touch points, relative to (0, 0) of the canvas, and IDs identifying a + * unique touch as it moves. Each element in the array is an object with x, y, + * and id properties. + * + * The touches[] array is not supported on Safari and IE on touch-based + * desktops (laptops). + * + * @property {Object[]} touches + * @readOnly + * + * @example + *
                              + * + * // On a touchscreen device, touch + * // the canvas using one or more fingers + * // at the same time + * function draw() { + * clear(); + * let display = touches.length + ' touches'; + * text(display, 5, 10); + * describe(`Number of touches currently registered are displayed + * on the canvas`); + * } + * + *
                              + */ + + _main.default.prototype.touches = [ + ]; + _main.default.prototype._updateTouchCoords = function (e) { + if (this._curElement !== null) { + var touches = [ + ]; + for (var i = 0; i < e.touches.length; i++) { + touches[i] = getTouchInfo(this._curElement.elt, this.width, this.height, e, i); + } + this._setProperty('touches', touches); + } + }; + function getTouchInfo(canvas, w, h, e) { + var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + var rect = canvas.getBoundingClientRect(); + var sx = canvas.scrollWidth / w || 1; + var sy = canvas.scrollHeight / h || 1; + var touch = e.touches[i] || e.changedTouches[i]; + return { + x: (touch.clientX - rect.left) / sx, + y: (touch.clientY - rect.top) / sy, + winX: touch.clientX, + winY: touch.clientY, + id: touch.identifier + }; + } /** + * The touchStarted() function is called once after every time a touch is + * registered. If no touchStarted() function is defined, the mousePressed() + * function will be called instead if it is defined.

                              + * Browsers may have different default behaviors attached to various touch + * events. To prevent any default behavior for this event, add "return false" + * to the end of the method. + * + * @method touchStarted + * @param {TouchEvent} [event] optional TouchEvent callback argument. + * @example + *
                              + * + * // Touch within the image to change + * // the value of the rectangle + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('50-by-50 black rect turns white with touch event.'); + * } + * function touchStarted() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function touchStarted() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * describe('no image displayed'); + * + *
                              + * + *
                              + * + * // returns a TouchEvent object + * // as a callback argument + * function touchStarted(event) { + * console.log(event); + * } + * describe('no image displayed'); + * + *
                              + */ + + _main.default.prototype._ontouchstart = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._setProperty('mouseIsPressed', true); + this._updateTouchCoords(e); + this._updateNextMouseCoords(e); + this._updateMouseCoords(); // reset pmouseXY at the start of each touch event + if (typeof context.touchStarted === 'function') { + executeDefault = context.touchStarted(e); + if (executeDefault === false) { + e.preventDefault(); + } // only safari needs this manual fallback for consistency + + } else if (navigator.userAgent.toLowerCase().includes('safari') && typeof context.mousePressed === 'function') { + executeDefault = context.mousePressed(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The touchMoved() function is called every time a touch move is registered. + * If no touchMoved() function is defined, the mouseDragged() function will + * be called instead if it is defined.

                              + * Browsers may have different default behaviors attached to various touch + * events. To prevent any default behavior for this event, add "return false" + * to the end of the method. + * + * @method touchMoved + * @param {TouchEvent} [event] optional TouchEvent callback argument. + * @example + *
                              + * + * // Move your finger across the page + * // to change its value + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('50-by-50 black rect turns lighter with touch until white. resets'); + * } + * function touchMoved() { + * value = value + 5; + * if (value > 255) { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function touchMoved() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * describe('no image displayed'); + * + *
                              + * + *
                              + * + * // returns a TouchEvent object + * // as a callback argument + * function touchMoved(event) { + * console.log(event); + * } + * describe('no image displayed'); + * + *
                              + */ + _main.default.prototype._ontouchmove = function (e) { + var context = this._isGlobal ? window : this; + var executeDefault; + this._updateTouchCoords(e); + this._updateNextMouseCoords(e); + if (typeof context.touchMoved === 'function') { + executeDefault = context.touchMoved(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.mouseDragged === 'function') { + executeDefault = context.mouseDragged(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + /** + * The touchEnded() function is called every time a touch ends. If no + * touchEnded() function is defined, the mouseReleased() function will be + * called instead if it is defined.

                              + * Browsers may have different default behaviors attached to various touch + * events. To prevent any default behavior for this event, add "return false" + * to the end of the method. + * + * @method touchEnded + * @param {TouchEvent} [event] optional TouchEvent callback argument. + * @example + *
                              + * + * // Release touch within the image to + * // change the value of the rectangle + * + * let value = 0; + * function draw() { + * fill(value); + * rect(25, 25, 50, 50); + * describe('50-by-50 black rect turns white with touch.'); + * } + * function touchEnded() { + * if (value === 0) { + * value = 255; + * } else { + * value = 0; + * } + * } + * + *
                              + * + *
                              + * + * function touchEnded() { + * ellipse(mouseX, mouseY, 5, 5); + * // prevent default + * return false; + * } + * describe('no image displayed'); + * + *
                              + * + *
                              + * + * // returns a TouchEvent object + * // as a callback argument + * function touchEnded(event) { + * console.log(event); + * } + * describe('no image displayed'); + * + *
                              + */ + _main.default.prototype._ontouchend = function (e) { + this._setProperty('mouseIsPressed', false); + this._updateTouchCoords(e); + this._updateNextMouseCoords(e); + var context = this._isGlobal ? window : this; + var executeDefault; + if (typeof context.touchEnded === 'function') { + executeDefault = context.touchEnded(e); + if (executeDefault === false) { + e.preventDefault(); + } + } else if (typeof context.mouseReleased === 'function') { + executeDefault = context.mouseReleased(e); + if (executeDefault === false) { + e.preventDefault(); + } + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.string.includes': 209 + } + ], + 319: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.int32-array'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.int32-array'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + /** + * This module defines the filters for use with image buffers. + * + * This module is basically a collection of functions stored in an object + * as opposed to modules. The functions are destructive, modifying + * the passed in canvas rather than creating a copy. + * + * Generally speaking users of this module will use the Filters.apply method + * on a canvas to create an effect. + * + * A number of functions are borrowed/adapted from + * http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ + * or the java processing implementation. + */ + var Filters = { + /* + * Helper functions + */ + /** + * Returns the pixel buffer for a canvas. + * + * @private + * + * @param {Canvas|ImageData} canvas the canvas to get pixels from + * @return {Uint8ClampedArray} a one-dimensional array containing + * the data in the RGBA order, with integer + * values between 0 and 255. + */ + _toPixels: function _toPixels(canvas) { + // Return pixel data if 'canvas' is an ImageData object. + if (canvas instanceof ImageData) { + return canvas.data; + } else { + // Check 2D context support. + if (canvas.getContext('2d')) { + // Retrieve pixel data. + return canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height).data; + } else if (canvas.getContext('webgl')) { + //Check WebGL context support + var gl = canvas.getContext('webgl'); + // Calculate the size of pixel data + // (4 bytes per pixel - one byte for each RGBA channel). + var len = gl.drawingBufferWidth * gl.drawingBufferHeight * 4; + var data = new Uint8Array(len); + // Use gl.readPixels to fetch pixel data from the WebGL + // canvas, storing it in the data array as UNSIGNED_BYTE integers. + gl.readPixels(0, 0, canvas.width, canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, data); + return data; + } + } + }, + /** + * Returns a 32-bit number containing ARGB data at the ith pixel in the + * 1D array containing pixels data. + * + * @private + * + * @param {Uint8ClampedArray} data array returned by _toPixels() + * @param {Integer} i index of a 1D Image Array + * @return {Integer} 32-bit integer value representing + * ARGB value. + */ + _getARGB: function _getARGB(data, i) { + // Determine the starting position in the 'data' array for the 'i'-th pixel. + var offset = i * 4; + return ( // Combining the extracted components using bitwise OR operations to form the final ARGB value. + data[offset + 3] << 24 & 4278190080 | //Extract alpha component + data[offset] << 16 & 16711680 | //Extract Red component + data[offset + 1] << 8 & 65280 | //Extract green component + data[offset + 2] & 255 //Extract blue component + ); + }, + /** + * Modifies pixels RGBA values to values contained in the data object. + * + * @private + * + * @param {Uint8ClampedArray} pixels array returned by _toPixels() + * @param {Int32Array} data source 1D array where each value + * represents ARGB values + */ + _setPixels: function _setPixels(pixels, data) { + var offset = 0; + for (var i = 0, al = pixels.length; i < al; i++) { + offset = i * 4; + pixels[offset + 0] = (data[i] & 16711680) >>> 16; + pixels[offset + 1] = (data[i] & 65280) >>> 8; + pixels[offset + 2] = data[i] & 255; + pixels[offset + 3] = (data[i] & 4278190080) >>> 24; + } + }, + /** + * Returns the ImageData object for a canvas. + * https://developer.mozilla.org/en-US/docs/Web/API/ImageData + * + * @private + * + * @param {Canvas|ImageData} canvas canvas to get image data from + * @return {ImageData} Holder of pixel data (and width and + * height) for a canvas + */ + _toImageData: function _toImageData(canvas) { + if (canvas instanceof ImageData) { + return canvas; + } else { + return canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height); + } + }, + /** + * Returns a blank ImageData object. + * + * @private + * + * @param {Integer} width + * @param {Integer} height + * @return {ImageData} + */ + _createImageData: function _createImageData(width, height) { + Filters._tmpCanvas = document.createElement('canvas'); + Filters._tmpCtx = Filters._tmpCanvas.getContext('2d'); + return this._tmpCtx.createImageData(width, height); + }, + /** + * Applys a filter function to a canvas. + * + * The difference between this and the actual filter functions defined below + * is that the filter functions generally modify the pixel buffer but do + * not actually put that data back to the canvas (where it would actually + * update what is visible). By contrast this method does make the changes + * actually visible in the canvas. + * + * The apply method is the method that callers of this module would generally + * use. It has been separated from the actual filters to support an advanced + * use case of creating a filter chain that executes without actually updating + * the canvas in between everystep. + * + * @private + * @param {HTMLCanvasElement} canvas The input canvas to apply the filter on. + * @param {function(ImageData,Object)} func The filter function to apply to the canvas's pixel data. + * @param {Object} filterParam An optional parameter to pass to the filter function. + */ + apply: function apply(canvas, func, filterParam) { + var pixelsState = canvas.getContext('2d'); + var imageData = pixelsState.getImageData(0, 0, canvas.width, canvas.height); + //Filters can either return a new ImageData object, or just modify + //the one they received. + var newImageData = func(imageData, filterParam); + //If new ImageData is returned, replace the canvas's pixel data with it. + if (newImageData instanceof ImageData) { + pixelsState.putImageData(newImageData, 0, 0, 0, 0, canvas.width, canvas.height); + } else { + //Restore the original pixel. + pixelsState.putImageData(imageData, 0, 0, 0, 0, canvas.width, canvas.height); + } + }, + /* + * Filters + */ + /** + * Converts the image to black and white pixels depending if they are above or + * below the threshold defined by the level parameter. The parameter must be + * between 0.0 (black) and 1.0 (white). If no level is specified, 0.5 is used. + * + * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ + * + * @private + * @param {Canvas} canvas Canvas to apply thershold filter on. + * @param {Float} level Threshold level (0-1). + */ + threshold: function threshold(canvas, level) { + var pixels = Filters._toPixels(canvas); + if (level === undefined) { + level = 0.5; + } // Calculate threshold value on a (0-255) scale. + + var thresh = Math.floor(level * 255); + for (var i = 0; i < pixels.length; i += 4) { + var r = pixels[i]; + var g = pixels[i + 1]; + var b = pixels[i + 2]; + // CIE luminance for RGB + var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; + var val = void 0; + if (gray >= thresh) { + val = 255; + } else { + val = 0; + } + pixels[i] = pixels[i + 1] = pixels[i + 2] = val; //set pixel to val. + } + }, + /** + * Converts any colors in the image to grayscale equivalents. + * No parameter is used. + * + * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ + * + * @private + * @param {Canvas} canvas Canvas to apply gray filter on. + */ + gray: function gray(canvas) { + var pixels = Filters._toPixels(canvas); + for (var i = 0; i < pixels.length; i += 4) { + var r = pixels[i]; + var g = pixels[i + 1]; + var b = pixels[i + 2]; + // CIE luminance for RGB + var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; + pixels[i] = pixels[i + 1] = pixels[i + 2] = gray; // set pixel to gray. + } + }, + /** + * Sets the alpha channel to entirely opaque. No parameter is used. + * + * @private + * @param {Canvas} canvas + */ + opaque: function opaque(canvas) { + var pixels = Filters._toPixels(canvas); + for (var i = 0; i < pixels.length; i += 4) { + pixels[i + 3] = 255; + } + return pixels; + }, + /** + * Sets each pixel to its inverse value. No parameter is used. + * @private + * @param {Canvas} canvas + */ + invert: function invert(canvas) { + var pixels = Filters._toPixels(canvas); + for (var i = 0; i < pixels.length; i += 4) { + pixels[i] = 255 - pixels[i]; + pixels[i + 1] = 255 - pixels[i + 1]; + pixels[i + 2] = 255 - pixels[i + 2]; + } + }, + /** + * Limits each channel of the image to the number of colors specified as + * the parameter. The parameter can be set to values between 2 and 255, but + * results are most noticeable in the lower ranges. + * + * Adapted from java based processing implementation + * + * @private + * @param {Canvas} canvas + * @param {Integer} level + */ + posterize: function posterize(canvas, level) { + var pixels = Filters._toPixels(canvas); + if (level === undefined) { + level = 4; + } + if (level < 2 || level > 255) { + throw new Error('Level must be greater than 2 and less than 255 for posterize'); + } + var levels1 = level - 1; + for (var i = 0; i < pixels.length; i += 4) { + var rlevel = pixels[i]; + var glevel = pixels[i + 1]; + var blevel = pixels[i + 2]; + // New pixel value by posterizing each color. + pixels[i] = (rlevel * level >> 8) * 255 / levels1; + pixels[i + 1] = (glevel * level >> 8) * 255 / levels1; + pixels[i + 2] = (blevel * level >> 8) * 255 / levels1; + } + }, + /** + * Increases the bright areas in an image. + * @private + * @param {Canvas} canvas + */ + dilate: function dilate(canvas) { + var pixels = Filters._toPixels(canvas); + var currIdx = 0; + var maxIdx = pixels.length ? pixels.length / 4 : 0; + var out = new Int32Array(maxIdx); + var currRowIdx, + maxRowIdx, + colOrig, + colOut, + currLum; + var idxRight, + idxLeft, + idxUp, + idxDown; + var colRight, + colLeft, + colUp, + colDown; + var lumRight, + lumLeft, + lumUp, + lumDown; + // Iterates through rows of pixels. + while (currIdx < maxIdx) { + currRowIdx = currIdx; + maxRowIdx = currIdx + canvas.width; + // Iterates through pixels within the current row. + while (currIdx < maxRowIdx) { + // Get original color of current pixel. + colOrig = colOut = Filters._getARGB(pixels, currIdx); + idxLeft = currIdx - 1; + idxRight = currIdx + 1; + idxUp = currIdx - canvas.width; + idxDown = currIdx + canvas.width; + // Adjust the indices to avoid going out of bounds. + if (idxLeft < currRowIdx) { + idxLeft = currIdx; + } + if (idxRight >= maxRowIdx) { + idxRight = currIdx; + } + if (idxUp < 0) { + idxUp = 0; + } + if (idxDown >= maxIdx) { + idxDown = currIdx; + } + colUp = Filters._getARGB(pixels, idxUp); + colLeft = Filters._getARGB(pixels, idxLeft); + colDown = Filters._getARGB(pixels, idxDown); + colRight = Filters._getARGB(pixels, idxRight); + // Compute luminance + currLum = 77 * (colOrig >> 16 & 255) + 151 * (colOrig >> 8 & 255) + 28 * (colOrig & 255); + lumLeft = 77 * (colLeft >> 16 & 255) + 151 * (colLeft >> 8 & 255) + 28 * (colLeft & 255); + lumRight = 77 * (colRight >> 16 & 255) + 151 * (colRight >> 8 & 255) + 28 * (colRight & 255); + lumUp = 77 * (colUp >> 16 & 255) + 151 * (colUp >> 8 & 255) + 28 * (colUp & 255); + lumDown = 77 * (colDown >> 16 & 255) + 151 * (colDown >> 8 & 255) + 28 * (colDown & 255); + // Update the output color based on the highest luminance value + if (lumLeft > currLum) { + colOut = colLeft; + currLum = lumLeft; + } + if (lumRight > currLum) { + colOut = colRight; + currLum = lumRight; + } + if (lumUp > currLum) { + colOut = colUp; + currLum = lumUp; + } + if (lumDown > currLum) { + colOut = colDown; + currLum = lumDown; + } // Store the updated color. + + out[currIdx++] = colOut; + } + } + Filters._setPixels(pixels, out); + }, + /** + * Reduces the bright areas in an image. + * Similar to `dilate()`, but updates the output color based on the lowest luminance value. + * @private + * @param {Canvas} canvas + */ + erode: function erode(canvas) { + var pixels = Filters._toPixels(canvas); + var currIdx = 0; + var maxIdx = pixels.length ? pixels.length / 4 : 0; + var out = new Int32Array(maxIdx); + var currRowIdx, + maxRowIdx, + colOrig, + colOut, + currLum; + var idxRight, + idxLeft, + idxUp, + idxDown; + var colRight, + colLeft, + colUp, + colDown; + var lumRight, + lumLeft, + lumUp, + lumDown; + while (currIdx < maxIdx) { + currRowIdx = currIdx; + maxRowIdx = currIdx + canvas.width; + while (currIdx < maxRowIdx) { + colOrig = colOut = Filters._getARGB(pixels, currIdx); + idxLeft = currIdx - 1; + idxRight = currIdx + 1; + idxUp = currIdx - canvas.width; + idxDown = currIdx + canvas.width; + if (idxLeft < currRowIdx) { + idxLeft = currIdx; + } + if (idxRight >= maxRowIdx) { + idxRight = currIdx; + } + if (idxUp < 0) { + idxUp = 0; + } + if (idxDown >= maxIdx) { + idxDown = currIdx; + } + colUp = Filters._getARGB(pixels, idxUp); + colLeft = Filters._getARGB(pixels, idxLeft); + colDown = Filters._getARGB(pixels, idxDown); + colRight = Filters._getARGB(pixels, idxRight); + //compute luminance + currLum = 77 * (colOrig >> 16 & 255) + 151 * (colOrig >> 8 & 255) + 28 * (colOrig & 255); + lumLeft = 77 * (colLeft >> 16 & 255) + 151 * (colLeft >> 8 & 255) + 28 * (colLeft & 255); + lumRight = 77 * (colRight >> 16 & 255) + 151 * (colRight >> 8 & 255) + 28 * (colRight & 255); + lumUp = 77 * (colUp >> 16 & 255) + 151 * (colUp >> 8 & 255) + 28 * (colUp & 255); + lumDown = 77 * (colDown >> 16 & 255) + 151 * (colDown >> 8 & 255) + 28 * (colDown & 255); + if (lumLeft < currLum) { + colOut = colLeft; + currLum = lumLeft; + } + if (lumRight < currLum) { + colOut = colRight; + currLum = lumRight; + } + if (lumUp < currLum) { + colOut = colUp; + currLum = lumUp; + } + if (lumDown < currLum) { + colOut = colDown; + currLum = lumDown; + } // Store the updated color. + + out[currIdx++] = colOut; + } + } + Filters._setPixels(pixels, out); + }, + blur: function blur(canvas, radius) { + blurARGB(canvas, radius); + } + }; + // BLUR + // Internal kernel stuff for the gaussian blur filter. + var blurRadius; + var blurKernelSize; + var blurKernel; + var blurMult; + /* + * Port of https://github.com/processing/processing/blob/ + * main/core/src/processing/core/PImage.java#L1250 + * + * Optimized code for building the blur kernel. + * further optimized blur code (approx. 15% for radius=20) + * bigger speed gains for larger radii (~30%) + * added support for various image types (ALPHA, RGB, ARGB) + * [toxi 050728] + */ + function buildBlurKernel(r) { + var radius = r * 3.5 | 0; + radius = radius < 1 ? 1 : radius < 248 ? radius : 248; + if (blurRadius !== radius) { + blurRadius = radius; + // Calculating the size of the blur kernel + blurKernelSize = 1 + blurRadius << 1; + blurKernel = new Int32Array(blurKernelSize); + blurMult = new Array(blurKernelSize); + for (var l = 0; l < blurKernelSize; l++) { + blurMult[l] = new Int32Array(256); + } + var bk, + bki; + var bm, + bmi; + // Generating blur kernel values. + for (var i = 1, radiusi = radius - 1; i < radius; i++) { + blurKernel[radius + i] = blurKernel[radiusi] = bki = radiusi * radiusi; + bm = blurMult[radius + i]; + bmi = blurMult[radiusi--]; + for (var j = 0; j < 256; j++) { + bm[j] = bmi[j] = bki * j; + } + } + bk = blurKernel[radius] = radius * radius; + bm = blurMult[radius]; + for (var k = 0; k < 256; k++) { + bm[k] = bk * k; + } + } + } // Port of https://github.com/processing/processing/blob/ + // main/core/src/processing/core/PImage.java#L1433 + + function blurARGB(canvas, radius) { + // Get pixel data. + var pixels = Filters._toPixels(canvas); + var width = canvas.width; + var height = canvas.height; + var numPackedPixels = width * height; + var argb = new Int32Array(numPackedPixels); + for (var j = 0; j < numPackedPixels; j++) { + argb[j] = Filters._getARGB(pixels, j); + } + var sum, + cr, + cg, + cb, + ca; + var read, + ri, + ym, + ymi, + bk0; + var a2 = new Int32Array(numPackedPixels); + var r2 = new Int32Array(numPackedPixels); + var g2 = new Int32Array(numPackedPixels); + var b2 = new Int32Array(numPackedPixels); + var yi = 0; + buildBlurKernel(radius); + var x, + y, + i; + var bm; + // Horizontal pass. + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + cb = cg = cr = ca = sum = 0; + read = x - blurRadius; + // Handle edge cases. + if (read < 0) { + bk0 = - read; + read = 0; + } else { + if (read >= width) { + break; + } + bk0 = 0; + } + for (i = bk0; i < blurKernelSize; i++) { + if (read >= width) { + break; + } + var c = argb[read + yi]; + bm = blurMult[i]; + ca += bm[(c & - 16777216) >>> 24]; + cr += bm[(c & 16711680) >> 16]; + cg += bm[(c & 65280) >> 8]; + cb += bm[c & 255]; + sum += blurKernel[i]; + read++; + } + ri = yi + x; + a2[ri] = ca / sum; + r2[ri] = cr / sum; + g2[ri] = cg / sum; + b2[ri] = cb / sum; + } + yi += width; + } + yi = 0; + ym = - blurRadius; + ymi = ym * width; + // Vertical pass. + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + cb = cg = cr = ca = sum = 0; + // Handle edge cases. + if (ym < 0) { + bk0 = ri = - ym; + read = x; + } else { + if (ym >= height) { + break; + } + bk0 = 0; + ri = ym; + read = x + ymi; + } + for (i = bk0; i < blurKernelSize; i++) { + if (ri >= height) { + break; + } + bm = blurMult[i]; + ca += bm[a2[read]]; + cr += bm[r2[read]]; + cg += bm[g2[read]]; + cb += bm[b2[read]]; + sum += blurKernel[i]; + ri++; + read += width; + } // Set final ARGB value + + argb[x + yi] = ca / sum << 24 | cr / sum << 16 | cg / sum << 8 | cb / sum; + } + yi += width; + ymi += width; + ym++; + } + Filters._setPixels(pixels, argb); + } + var _default = Filters; + exports.default = _default; + }, + { + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.int32-array': 235, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-array': 252 + } + ], + 320: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var _omggif = _interopRequireDefault(_dereq_('omggif')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * @module Image + * @submodule Image + * @for p5 + * @requires core + */ + /** + * This module defines the p5 methods for the p5.Image class + * for drawing images to the main display canvas. + */ + /** + * Creates a new p5.Image object. The new image is + * transparent by default. + * + * `createImage()` uses the `width` and `height` paremeters to set the new + * p5.Image object's dimensions in pixels. The new + * p5.Image can be modified by updating its + * pixels array or by calling its + * get() and + * set() methods. The + * loadPixels() method must be called + * before reading or modifying pixel values. The + * updatePixels() method must be called + * for updates to take effect. + * + * @method createImage + * @param {Integer} width width in pixels. + * @param {Integer} height height in pixels. + * @return {p5.Image} new p5.Image object. + * @example + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * let a = map(x, 0, img.width, 0, 255); + * let c = color(0, a); + * img.set(x, y, c); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A square with a horizontal color gradient that transitions from gray to black.'); + * + *
                              + * + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let d = pixelDensity(); + * let halfImage = 4 * (d * img.width) * (d * img.height / 2); + * for (let i = 0; i < halfImage; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + */ + + _main.default.prototype.createImage = function (width, height) { + _main.default._validateParameters('createImage', arguments); + return new _main.default.Image(width, height); + }; + /** + * Saves the current canvas as an image. The browser will either save the + * file immediately or prompt the user with a dialogue window. + * + * @method saveCanvas + * @param {p5.Framebuffer|p5.Element|HTMLCanvasElement} selectedCanvas reference to a + * specific HTML5 canvas element. + * @param {String} [filename] file name. Defaults to 'untitled'. + * @param {String} [extension] file extension, either 'jpg' or 'png'. Defaults to 'png'. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(255); + * saveCanvas(); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(255); + * saveCanvas('myCanvas.jpg'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(255); + * saveCanvas('myCanvas', 'jpg'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(255); + * saveCanvas(cnv); + * } + * + *
                              + * + *
                              + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(255); + * saveCanvas(cnv, 'myCanvas.jpg'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * let cnv = createCanvas(100, 100); + * background(255); + * saveCanvas(cnv, 'myCanvas', 'jpg'); + * } + * + *
                              + */ + /** + * @method saveCanvas + * @param {String} [filename] + * @param {String} [extension] + */ + _main.default.prototype.saveCanvas = function () { + _main.default._validateParameters('saveCanvas', arguments); + // copy arguments to array + var args = [ + ].slice.call(arguments); + var htmlCanvas, + filename, + extension, + temporaryGraphics; + if (arguments[0] instanceof HTMLCanvasElement) { + htmlCanvas = arguments[0]; + args.shift(); + } else if (arguments[0] instanceof _main.default.Element) { + htmlCanvas = arguments[0].elt; + args.shift(); + } else if (arguments[0] instanceof _main.default.Framebuffer) { + var framebuffer = arguments[0]; + temporaryGraphics = this.createGraphics(framebuffer.width, framebuffer.height); + temporaryGraphics.pixelDensity(pixelDensity()); + framebuffer.loadPixels(); + temporaryGraphics.loadPixels(); + temporaryGraphics.pixels.set(framebuffer.pixels); + temporaryGraphics.updatePixels(); + htmlCanvas = temporaryGraphics.elt; + args.shift(); + } else { + htmlCanvas = this._curElement && this._curElement.elt; + } + if (args.length >= 1) { + filename = args[0]; + } + if (args.length >= 2) { + extension = args[1]; + } + extension = extension || _main.default.prototype._checkFileExtension(filename, extension) [1] || 'png'; + var mimeType; + switch (extension) { + default: + //case 'png': + mimeType = 'image/png'; + break; + case 'jpeg': + case 'jpg': + mimeType = 'image/jpeg'; + break; + } + htmlCanvas.toBlob(function (blob) { + _main.default.prototype.downloadFile(blob, filename, extension); + if (temporaryGraphics) temporaryGraphics.remove(); + }, mimeType); + }; + // this is the old saveGif, left here for compatibility purposes + // the only place I found it being used was on image/p5.Image.js, on the + // save function. that has been changed to use this function. + _main.default.prototype.encodeAndDownloadGif = function (pImg, filename) { + var props = pImg.gifProperties; + //convert loopLimit back into Netscape Block formatting + var loopLimit = props.loopLimit; + if (loopLimit === 1) { + loopLimit = null; + } else if (loopLimit === null) { + loopLimit = 0; + } + var buffer = new Uint8Array(pImg.width * pImg.height * props.numFrames); + var allFramesPixelColors = [ + ]; + // Used to determine the occurrence of unique palettes and the frames + // which use them + var paletteFreqsAndFrames = { + }; + // Pass 1: + //loop over frames and get the frequency of each palette + for (var i = 0; i < props.numFrames; i++) { + var paletteSet = new Set(); + var data = props.frames[i].image.data; + var dataLength = data.length; + // The color for each pixel in this frame ( for easier lookup later ) + var pixelColors = new Uint32Array(pImg.width * pImg.height); + for (var j = 0, k = 0; j < dataLength; j += 4, k++) { + var r = data[j + 0]; + var g = data[j + 1]; + var b = data[j + 2]; + var color = r << 16 | g << 8 | b << 0; + paletteSet.add(color); + // What color does this pixel have in this frame ? + pixelColors[k] = color; + } // A way to put use the entire palette as an object key + + var paletteStr = _toConsumableArray(paletteSet).sort().toString(); + if (paletteFreqsAndFrames[paletteStr] === undefined) { + paletteFreqsAndFrames[paletteStr] = { + freq: 1, + frames: [ + i + ] + }; + } else { + paletteFreqsAndFrames[paletteStr].freq += 1; + paletteFreqsAndFrames[paletteStr].frames.push(i); + } + allFramesPixelColors.push(pixelColors); + } + var framesUsingGlobalPalette = [ + ]; + // Now to build the global palette + // Sort all the unique palettes in descending order of their occurrence + var palettesSortedByFreq = Object.keys(paletteFreqsAndFrames).sort(function (a, b) { + return paletteFreqsAndFrames[b].freq - paletteFreqsAndFrames[a].freq; + }); + // The initial global palette is the one with the most occurrence + var globalPalette = palettesSortedByFreq[0].split(',').map(function (a) { + return parseInt(a); + }); + framesUsingGlobalPalette = framesUsingGlobalPalette.concat(paletteFreqsAndFrames[globalPalette].frames); + var globalPaletteSet = new Set(globalPalette); + // Build a more complete global palette + // Iterate over the remaining palettes in the order of + // their occurrence and see if the colors in this palette which are + // not in the global palette can be added there, while keeping the length + // of the global palette <= 256 + for (var _i = 1; _i < palettesSortedByFreq.length; _i++) { + var palette = palettesSortedByFreq[_i].split(',').map(function (a) { + return parseInt(a); + }); + var difference = palette.filter(function (x) { + return !globalPaletteSet.has(x); + }); + if (globalPalette.length + difference.length <= 256) { + for (var _j = 0; _j < difference.length; _j++) { + globalPalette.push(difference[_j]); + globalPaletteSet.add(difference[_j]); + } // All frames using this palette now use the global palette + + framesUsingGlobalPalette = framesUsingGlobalPalette.concat(paletteFreqsAndFrames[palettesSortedByFreq[_i]].frames); + } + } + framesUsingGlobalPalette = new Set(framesUsingGlobalPalette); + // Build a lookup table of the index of each color in the global palette + // Maps a color to its index + var globalIndicesLookup = { + }; + for (var _i2 = 0; _i2 < globalPalette.length; _i2++) { + if (!globalIndicesLookup[globalPalette[_i2]]) { + globalIndicesLookup[globalPalette[_i2]] = _i2; + } + } // force palette to be power of 2 + + var powof2 = 1; + while (powof2 < globalPalette.length) { + powof2 <<= 1; + } + globalPalette.length = powof2; + // global opts + var opts = { + loop: loopLimit, + palette: new Uint32Array(globalPalette) + }; + var gifWriter = new _omggif.default.GifWriter(buffer, pImg.width, pImg.height, opts); + var previousFrame = { + }; + // Pass 2 + // Determine if the frame needs a local palette + // Also apply transparency optimization. This function will often blow up + // the size of a GIF if not for transparency. If a pixel in one frame has + // the same color in the previous frame, that pixel can be marked as + // transparent. We decide one particular color as transparent and make all + // transparent pixels take this color. This helps in later in compression. + var _loop = function _loop(_i3) { + var localPaletteRequired = !framesUsingGlobalPalette.has(_i3); + var palette = localPaletteRequired ? [ + ] : globalPalette; + var pixelPaletteIndex = new Uint8Array(pImg.width * pImg.height); + // Lookup table mapping color to its indices + var colorIndicesLookup = { + }; + // All the colors that cannot be marked transparent in this frame + var cannotBeTransparent = new Set(); + allFramesPixelColors[_i3].forEach(function (color, k) { + if (localPaletteRequired) { + if (colorIndicesLookup[color] === undefined) { + colorIndicesLookup[color] = palette.length; + palette.push(color); + } + pixelPaletteIndex[k] = colorIndicesLookup[color]; + } else { + pixelPaletteIndex[k] = globalIndicesLookup[color]; + } + if (_i3 > 0) { + // If even one pixel of this color has changed in this frame + // from the previous frame, we cannot mark it as transparent + if (allFramesPixelColors[_i3 - 1][k] !== color) { + cannotBeTransparent.add(color); + } + } + }); + var frameOpts = { + }; + // Transparency optimization + var canBeTransparent = palette.filter(function (a) { + return !cannotBeTransparent.has(a); + }); + if (canBeTransparent.length > 0) { + // Select a color to mark as transparent + var transparent = canBeTransparent[0]; + var transparentIndex = localPaletteRequired ? colorIndicesLookup[transparent] : globalIndicesLookup[transparent]; + if (_i3 > 0) { + for (var _k = 0; _k < allFramesPixelColors[_i3].length; _k++) { + // If this pixel in this frame has the same color in previous frame + if (allFramesPixelColors[_i3 - 1][_k] === allFramesPixelColors[_i3][_k]) { + pixelPaletteIndex[_k] = transparentIndex; + } + } + frameOpts.transparent = transparentIndex; + // If this frame has any transparency, do not dispose the previous frame + previousFrame.frameOpts.disposal = 1; + } + } + frameOpts.delay = props.frames[_i3].delay / 10; // Move timing back into GIF formatting + if (localPaletteRequired) { + // force palette to be power of 2 + var _powof = 1; + while (_powof < palette.length) { + _powof <<= 1; + } + palette.length = _powof; + frameOpts.palette = new Uint32Array(palette); + } + if (_i3 > 0) { + // add the frame that came before the current one + gifWriter.addFrame(0, 0, pImg.width, pImg.height, previousFrame.pixelPaletteIndex, previousFrame.frameOpts); + } // previous frame object should now have details of this frame + + previousFrame = { + pixelPaletteIndex: pixelPaletteIndex, + frameOpts: frameOpts + }; + }; + for (var _i3 = 0; _i3 < props.numFrames; _i3++) { + _loop(_i3); + } + previousFrame.frameOpts.disposal = 1; + // add the last frame + gifWriter.addFrame(0, 0, pImg.width, pImg.height, previousFrame.pixelPaletteIndex, previousFrame.frameOpts); + var extension = 'gif'; + var blob = new Blob([buffer.slice(0, gifWriter.end())], { + type: 'image/gif' + }); + _main.default.prototype.downloadFile(blob, filename, extension); + }; + /** + * Captures a sequence of frames from the canvas that can be used to create a + * movie. Frames are downloaded as individual image files by default. + * + * The first parameter, `filename`, sets the prefix for the file names. For + * example, setting the prefix to `'frame'` would generate the image files + * `frame0.png`, `frame1.png`, and so on. The second parameter, `extension`, + * sets the file type to either `'png'` or `'jpg'`. + * + * The third parameter, `duration`, sets the duration to record in seconds. + * The maximum duration is 15 seconds. The fourth parameter, `framerate`, sets + * the number of frames to record per second. The maximum frame rate value is + * 22. Limits are placed on `duration` and `framerate` to avoid using too much + * memory. Recording large canvases can easily crash sketches or even web + * browsers. + * + * The fifth parameter, `callback`, is optional. If a function is passed, + * image files won't be saved by default. The callback function can be used + * to process an array containing the data for each captured frame. The array + * of image data contains a sequence of objects with three properties for each + * frame: `imageData`, `filename`, and `extension`. + * + * @method saveFrames + * @param {String} filename prefix of file name. + * @param {String} extension file extension, either 'jpg' or 'png'. + * @param {Number} duration duration in seconds to record. This parameter will be constrained to be less or equal to 15. + * @param {Number} framerate number of frames to save per second. This parameter will be constrained to be less or equal to 22. + * @param {function(Array)} [callback] callback function that will be executed + to handle the image data. This function + should accept an array as argument. The + array will contain the specified number of + frames of objects. Each object has three + properties: `imageData`, `filename`, and `extension`. + * @example + *
                              + * + * function draw() { + * let r = frameCount % 255; + * let g = 50; + * let b = 100; + * background(r, g, b); + * + * describe('A square repeatedly changes color from blue to pink.'); + * } + * + * function keyPressed() { + * if (key === 's') { + * saveFrames('frame', 'png', 1, 5); + * } + * } + * + *
                              + * + *
                              + * + * function draw() { + * let r = frameCount % 255; + * let g = 50; + * let b = 100; + * background(r, g, b); + * + * describe('A square repeatedly changes color from blue to pink.'); + * } + * + * function mousePressed() { + * saveFrames('frame', 'png', 1, 5, data => { + * // Prints an array of objects containing raw image data, + * // filenames, and extensions. + * print(data); + * }); + * } + * + *
                              + */ + _main.default.prototype.saveFrames = function (fName, ext, _duration, _fps, callback) { + _main.default._validateParameters('saveFrames', arguments); + var duration = _duration || 3; + duration = _main.default.prototype.constrain(duration, 0, 15); + duration = duration * 1000; + var fps = _fps || 15; + fps = _main.default.prototype.constrain(fps, 0, 22); + var count = 0; + var makeFrame = _main.default.prototype._makeFrame; + var cnv = this._curElement.elt; + var frames = [ + ]; + var frameFactory = setInterval(function () { + frames.push(makeFrame(fName + count, ext, cnv)); + count++; + }, 1000 / fps); + setTimeout(function () { + clearInterval(frameFactory); + if (callback) { + callback(frames); + } else { + for (var _i4 = 0, _frames = frames; _i4 < _frames.length; _i4++) { + var f = _frames[_i4]; + _main.default.prototype.downloadFile(f.imageData, f.filename, f.ext); + } + } + frames = [ + ]; // clear frames + }, duration + 0.01); + }; + _main.default.prototype._makeFrame = function (filename, extension, _cnv) { + var cnv; + if (this) { + cnv = this._curElement.elt; + } else { + cnv = _cnv; + } + var mimeType; + if (!extension) { + extension = 'png'; + mimeType = 'image/png'; + } else { + switch (extension.toLowerCase()) { + case 'png': + mimeType = 'image/png'; + break; + case 'jpeg': + mimeType = 'image/jpeg'; + break; + case 'jpg': + mimeType = 'image/jpeg'; + break; + default: + mimeType = 'image/png'; + break; + } + } + var downloadMime = 'image/octet-stream'; + var imageData = cnv.toDataURL(mimeType); + imageData = imageData.replace(mimeType, downloadMime); + var thisFrame = { + }; + thisFrame.imageData = imageData; + thisFrame.filename = filename; + thisFrame.ext = extension; + return thisFrame; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.set': 207, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint32-array': 251, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256, + 'omggif': 270 + } + ], + 321: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.copy-within'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.copy-within'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + _dereq_('regenerator-runtime/runtime'); + var _main = _interopRequireDefault(_dereq_('../core/main')); + var _helpers = _interopRequireDefault(_dereq_('../core/helpers')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + var _omggif = _interopRequireDefault(_dereq_('omggif')); + var _gifenc = _dereq_('gifenc'); + _dereq_('../core/friendly_errors/validate_params'); + _dereq_('../core/friendly_errors/file_errors'); + _dereq_('../core/friendly_errors/fes_core'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err); + } + _next(undefined); + }); + }; + } /** + * @module Image + * @submodule Loading & Displaying + * @for p5 + * @requires core + */ + /** + * Loads an image to create a p5.Image object. + * + * `loadImage()` interprets the first parameter one of three ways. If the path + * to an image file is provided, `loadImage()` will load it. Paths to local + * files should be relative, such as `'assets/thundercat.jpg'`. URLs such as + * `'https://example.com/thundercat.jpg'` may be blocked due to browser + * security. Raw image data can also be passed as a base64 encoded image in + * the form `'data:image/png;base64,arandomsequenceofcharacters'`. + * + * The second parameter is optional. If a function is passed, it will be + * called once the image has loaded. The callback function can optionally use + * the new p5.Image object. + * + * The third parameter is also optional. If a function is passed, it will be + * called if the image fails to load. The callback function can optionally use + * the event error. + * + * Images can take time to load. Calling `loadImage()` in + * preload() ensures images load before they're + * used in setup() or draw(). + * + * @method loadImage + * @param {String} path path of the image to be loaded or base64 encoded image. + * @param {function(p5.Image)} [successCallback] function called with + * p5.Image once it + * loads. + * @param {function(Event)} [failureCallback] function called with event + * error if the image fails to load. + * @return {p5.Image} the p5.Image object. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * describe('Image of the underside of a white umbrella and a gridded ceiling.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * loadImage('assets/laDefense.jpg', img => { + * image(img, 0, 0); + * }); + * describe('Image of the underside of a white umbrella and a gridded ceiling.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * loadImage('assets/laDefense.jpg', success, failure); + * } + * + * function success(img) { + * image(img, 0, 0); + * describe('Image of the underside of a white umbrella and a gridded ceiling.'); + * } + * + * function failure(event) { + * console.error('Oops!', event); + * } + * + *
                              + */ + + _main.default.prototype.loadImage = function (path, successCallback, failureCallback) { + _main.default._validateParameters('loadImage', arguments); + var pImg = new _main.default.Image(1, 1, this); + var self = this; + var req = new Request(path, { + method: 'GET', + mode: 'cors' + }); + fetch(path, req).then(function (response) { + // GIF section + var contentType = response.headers.get('content-type'); + if (contentType === null) { + console.warn('The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset.'); + } + if (contentType && contentType.includes('image/gif')) { + response.arrayBuffer().then(function (arrayBuffer) { + if (arrayBuffer) { + var byteArray = new Uint8Array(arrayBuffer); + _createGif(byteArray, pImg, successCallback, failureCallback, function (pImg) { + self._decrementPreload(); + }.bind(self)); + } + }, function (e) { + if (typeof failureCallback === 'function') { + failureCallback(e); + self._decrementPreload(); + } else { + console.error(e); + } + }); + } else { + // Non-GIF Section + var img = new Image(); + img.onload = function () { + pImg.width = pImg.canvas.width = img.width; + pImg.height = pImg.canvas.height = img.height; + // Draw the image into the backing canvas of the p5.Image + pImg.drawingContext.drawImage(img, 0, 0); + pImg.modified = true; + if (typeof successCallback === 'function') { + successCallback(pImg); + } + self._decrementPreload(); + }; + img.onerror = function (e) { + _main.default._friendlyFileLoadError(0, img.src); + if (typeof failureCallback === 'function') { + failureCallback(e); + self._decrementPreload(); + } else { + console.error(e); + } + }; + // Set crossOrigin in case image is served with CORS headers. + // This will let us draw to the canvas without tainting it. + // See https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image + // When using data-uris the file will be loaded locally + // so we don't need to worry about crossOrigin with base64 file types. + if (path.indexOf('data:image/') !== 0) { + img.crossOrigin = 'Anonymous'; + } // start loading the image + + img.src = path; + } + pImg.modified = true; + }).catch(function (e) { + _main.default._friendlyFileLoadError(0, path); + if (typeof failureCallback === 'function') { + failureCallback(e); + self._decrementPreload(); + } else { + console.error(e); + } + }); + return pImg; + }; + /** + * Generates a gif from a sketch and saves it to a file. `saveGif()` may be + * called in setup() or at any point while a sketch + * is running. + * + * The first parameter, `fileName`, sets the gif's file name. The second + * parameter, `duration`, sets the gif's duration in seconds. + * + * The third parameter, `options`, is optional. If an object is passed, + * `saveGif()` will use its properties to customize the gif. `saveGif()` + * recognizes the properties `delay`, `units`, `silent`, + * `notificationDuration`, and `notificationID`. + * + * @method saveGif + * @param {String} filename file name of gif. + * @param {Number} duration duration in seconds to capture from the sketch. + * @param {Object} [options] an object that can contain five more properties: + * `delay`, a Number specifying how much time to wait before recording; + * `units`, a String that can be either 'seconds' or 'frames'. By default it's 'seconds’; + * `silent`, a Boolean that defines presence of progress notifications. By default it’s `false`; + * `notificationDuration`, a Number that defines how long in seconds the final notification + * will live. By default it's `0`, meaning the notification will never be removed; + * `notificationID`, a String that specifies the id of the notification's DOM element. By default it’s `'progressBar’`. + * + * @example + *
                              + * + * function draw() { + * background(200); + * let c = frameCount % 255; + * fill(c); + * circle(50, 50, 25); + * + * describe('A circle drawn in the middle of a gray square. The circle changes color from black to white, then repeats.'); + * } + * + * function keyPressed() { + * if (key === 's') { + * saveGif('mySketch', 5); + * } + * } + * + *
                              + */ + _main.default.prototype.saveGif = /*#__PURE__*/ function () { + var _ref = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee(fileName, duration) { + var options, + delay, + units, + silent, + notificationDuration, + notificationID, + _frameRate, + gifFrameDelay, + nFrames, + nFramesDelay, + totalNumberOfFrames, + frameIterator, + lastPixelDensity, + frames, + p, + pixels, + gl, + data, + gif, + globalPalette, + paletteCache, + getIndexedFrame, + transparentIndex, + prevIndexedFrame, + i, + indexedFrame, + originalIndexedFrame, + _i, + buffer, + extension, + blob, + _args = arguments; + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : { + delay: 0, + units: 'seconds', + silent: false, + notificationDuration: 0, + notificationID: 'progressBar' + }; + if (!(typeof fileName !== 'string')) { + _context.next = 3; + break; + } + throw TypeError('fileName parameter must be a string'); + case 3: + if (!(typeof duration !== 'number')) { + _context.next = 5; + break; + } + throw TypeError('Duration parameter must be a number'); + case 5: + // extract variables for more comfortable use + delay = options && options.delay || 0; // in seconds + units = options && options.units || 'seconds'; // either 'seconds' or 'frames' + silent = options && options.silent || false; + notificationDuration = options && options.notificationDuration || 0; + notificationID = options && options.notificationID || 'progressBar'; // if arguments in the options object are not correct, cancel operation + if (!(typeof delay !== 'number')) { + _context.next = 12; + break; + } + throw TypeError('Delay parameter must be a number'); + case 12: + if (!(units !== 'seconds' && units !== 'frames')) { + _context.next = 14; + break; + } + throw TypeError('Units parameter must be either "frames" or "seconds"'); + case 14: + if (!(typeof silent !== 'boolean')) { + _context.next = 16; + break; + } + throw TypeError('Silent parameter must be a boolean'); + case 16: + if (!(typeof notificationDuration !== 'number')) { + _context.next = 18; + break; + } + throw TypeError('Notification duration parameter must be a number'); + case 18: + if (!(typeof notificationID !== 'string')) { + _context.next = 20; + break; + } + throw TypeError('Notification ID parameter must be a string'); + case 20: + this._recording = true; + // get the project's framerate + _frameRate = this._targetFrameRate; // if it is undefined or some non useful value, assume it's 60 + if (_frameRate === Infinity || _frameRate === undefined || _frameRate === 0) { + _frameRate = 60; + } // calculate frame delay based on frameRate + // this delay has nothing to do with the + // delay in options, but rather is the delay + // we have to specify to the gif encoder between frames. + + gifFrameDelay = 1 / _frameRate * 1000; // constrain it to be always greater than 20, + // otherwise it won't work in some browsers and systems + // reference: https://stackoverflow.com/questions/64473278/gif-frame-duration-seems-slower-than-expected + gifFrameDelay = gifFrameDelay < 20 ? 20 : gifFrameDelay; + // check the mode we are in and how many frames + // that duration translates to + nFrames = units === 'seconds' ? duration * _frameRate : duration; + nFramesDelay = units === 'seconds' ? delay * _frameRate : delay; + totalNumberOfFrames = nFrames + nFramesDelay; // initialize variables for the frames processing + frameIterator = nFramesDelay; + this.frameCount = frameIterator; + lastPixelDensity = this._pixelDensity; + this.pixelDensity(1); + // We first take every frame that we are going to use for the animation + frames = [ + ]; + if (document.getElementById(notificationID) !== null) document.getElementById(notificationID).remove(); + if (!silent) { + p = this.createP(''); + p.id(notificationID); + p.style('font-size', '16px'); + p.style('font-family', 'Montserrat'); + p.style('background-color', '#ffffffa0'); + p.style('padding', '8px'); + p.style('border-radius', '10px'); + p.position(0, 0); + } + if (this._renderer instanceof _main.default.RendererGL) { + // if we have a WEBGL context, initialize the pixels array + // and the gl context to use them inside the loop + gl = this.drawingContext; + pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4); + } // stop the loop since we are going to manually redraw + + this.noLoop(); + // Defer execution until the rest of the call stack finishes, allowing the + // rest of `setup` to be called (and, importantly, canvases hidden in setup + // to be unhidden.) + // + // Waiting on this empty promise means we'll continue as soon as setup + // finishes without waiting for another frame. + _context.next = 39; + return Promise.resolve(); + case 39: + if (!(frameIterator < totalNumberOfFrames)) { + _context.next = 50; + break; + } /* + we draw the next frame. this is important, since + busy sketches or low end devices might take longer + to render some frames. So we just wait for the frame + to be drawn and immediately save it to a buffer and continue + */ + + this.redraw(); + // depending on the context we'll extract the pixels one way + // or another + data = undefined; + if (this._renderer instanceof _main.default.RendererGL) { + pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4); + gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + data = _flipPixels(pixels); + } else { + data = this.drawingContext.getImageData(0, 0, this.width, this.height).data; + } + frames.push(data); + frameIterator++; + if (!silent) { + p.html('Saved frame ' + frames.length.toString() + ' out of ' + nFrames.toString()); + } + _context.next = 48; + return new Promise(function (resolve) { + return setTimeout(resolve, 0); + }); + case 48: + _context.next = 39; + break; + case 50: + if (!silent) p.html('Frames processed, generating color palette...'); + this.loop(); + this.pixelDensity(lastPixelDensity); + // create the gif encoder and the colorspace format + gif = (0, _gifenc.GIFEncoder) (); // calculate the global palette for this set of frames + globalPalette = _generateGlobalPalette(frames); // Rather than using applyPalette() from the gifenc library, we use our + // own function to map frame pixels to a palette color. This way, we can + // cache palette color mappings between frames for extra performance, and + // use our own caching mechanism to avoid flickering colors from cache + // key collisions. + paletteCache = { + }; + getIndexedFrame = function getIndexedFrame(frame) { + var length = frame.length / 4; + var index = new Uint8Array(length); + for (var i = 0; i < length; i++) { + var key = frame[i * 4] << 24 | frame[i * 4 + 1] << 16 | frame[i * 4 + 2] << 8 | frame[i * 4 + 3]; + if (paletteCache[key] === undefined) { + paletteCache[key] = (0, _gifenc.nearestColorIndex) (globalPalette, frame.slice(i * 4, (i + 1) * 4)); + } + index[i] = paletteCache[key]; + } + return index; + }; // the way we designed the palette means we always take the last index for transparency + transparentIndex = globalPalette.length - 1; // we are going to iterate the frames in pairs, n-1 and n + prevIndexedFrame = [ + ]; + i = 0; + case 60: + if (!(i < frames.length)) { + _context.next = 71; + break; + } //const indexedFrame = applyPalette(frames[i], globalPaletteWithoutAlpha, 'rgba565'); + + indexedFrame = getIndexedFrame(frames[i]); // Make a copy of the palette-applied frame before editing the original + // to use transparent pixels + originalIndexedFrame = indexedFrame.slice(); + if (i === 0) { + gif.writeFrame(indexedFrame, this.width, this.height, { + palette: globalPalette, + delay: gifFrameDelay, + dispose: 1 + }); + } else { + // Matching pixels between frames can be set to full transparency, + // allowing the previous frame's pixels to show through. We only do + // this for pixels that get mapped to the same quantized color so that + // the resulting image would be the same. + for (_i = 0; _i < indexedFrame.length; _i++) { + if (indexedFrame[_i] === prevIndexedFrame[_i]) { + indexedFrame[_i] = transparentIndex; + } + } // Write frame into the encoder + + gif.writeFrame(indexedFrame, this.width, this.height, { + delay: gifFrameDelay, + transparent: true, + transparentIndex: transparentIndex, + dispose: 1 + }); + } + prevIndexedFrame = originalIndexedFrame; + if (!silent) { + p.html('Rendered frame ' + i.toString() + ' out of ' + nFrames.toString()); + } // this just makes the process asynchronous, preventing + // that the encoding locks up the browser + + _context.next = 68; + return new Promise(function (resolve) { + return setTimeout(resolve, 0); + }); + case 68: + i++; + _context.next = 60; + break; + case 71: + gif.finish(); + // Get a direct typed array view into the buffer to avoid copying it + buffer = gif.bytesView(); + extension = 'gif'; + blob = new Blob([buffer], { + type: 'image/gif' + }); + frames = [ + ]; + this._recording = false; + this.loop(); + if (!silent) { + p.html('Done. Downloading your gif!🌸'); + if (notificationDuration > 0) setTimeout(function () { + return p.remove(); + }, notificationDuration * 1000); + } + _main.default.prototype.downloadFile(blob, fileName, extension); + case 80: + case 'end': + return _context.stop(); + } + } + }, _callee, this); + })); + return function (_x, _x2) { + return _ref.apply(this, arguments); + }; + }(); + function _flipPixels(pixels) { + // extracting the pixels using readPixels returns + // an upside down image. we have to flip it back + // first. this solution is proposed by gman on + // this stack overflow answer: + // https://stackoverflow.com/questions/41969562/how-can-i-flip-the-result-of-webglrenderingcontext-readpixels + var halfHeight = parseInt(height / 2); + var bytesPerRow = width * 4; + // make a temp buffer to hold one row + var temp = new Uint8Array(width * 4); + for (var y = 0; y < halfHeight; ++y) { + var topOffset = y * bytesPerRow; + var bottomOffset = (height - y - 1) * bytesPerRow; + // make copy of a row on the top half + temp.set(pixels.subarray(topOffset, topOffset + bytesPerRow)); + // copy a row from the bottom half to the top + pixels.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow); + // copy the copy of the top half row to the bottom half + pixels.set(temp, bottomOffset); + } + return pixels; + } + function _generateGlobalPalette(frames) { + // make an array the size of every possible color in every possible frame + // that is: width * height * frames. + var allColors = new Uint8Array(frames.length * frames[0].length); + // put every frame one after the other in sequence. + // this array will hold absolutely every pixel from the animation. + // the set function on the Uint8Array works super fast tho! + for (var f = 0; f < frames.length; f++) { + allColors.set(frames[f], f * frames[0].length); + } // quantize this massive array into 256 colors and return it! + + var colorPalette = (0, _gifenc.quantize) (allColors, 256, { + format: 'rgba4444', + oneBitAlpha: true + }); + // when generating the palette, we have to leave space for 1 of the + // indices to be a random color that does not appear anywhere in our + // animation to use for transparency purposes. So, if the palette is full + // (has 256 colors), we overwrite the last one with a random, fully transparent + // color. Otherwise, we just push a new color into the palette the same way. + // this guarantees that when using the transparency index, there are no matches + // between some colors of the animation and the "holes" we want to dig on them, + // which would cause pieces of some frames to be transparent and thus look glitchy. + if (colorPalette.length === 256) { + colorPalette[colorPalette.length - 1] = [ + Math.random() * 255, + Math.random() * 255, + Math.random() * 255, + 0 + ]; + } else { + colorPalette.push([Math.random() * 255, + Math.random() * 255, + Math.random() * 255, + 0]); + } + return colorPalette; + } /** + * Helper function for loading GIF-based images + */ + + function _createGif(arrayBuffer, pImg, successCallback, failureCallback, finishCallback) { + var gifReader = new _omggif.default.GifReader(arrayBuffer); + pImg.width = pImg.canvas.width = gifReader.width; + pImg.height = pImg.canvas.height = gifReader.height; + var frames = [ + ]; + var numFrames = gifReader.numFrames(); + var framePixels = new Uint8ClampedArray(pImg.width * pImg.height * 4); + var loadGIFFrameIntoImage = function loadGIFFrameIntoImage(frameNum, gifReader) { + try { + gifReader.decodeAndBlitFrameRGBA(frameNum, framePixels); + } catch (e) { + _main.default._friendlyFileLoadError(8, pImg.src); + if (typeof failureCallback === 'function') { + failureCallback(e); + } else { + console.error(e); + } + } + }; + for (var j = 0; j < numFrames; j++) { + var frameInfo = gifReader.frameInfo(j); + var prevFrameData = pImg.drawingContext.getImageData(0, 0, pImg.width, pImg.height); + framePixels = prevFrameData.data.slice(); + loadGIFFrameIntoImage(j, gifReader); + var imageData = new ImageData(framePixels, pImg.width, pImg.height); + pImg.drawingContext.putImageData(imageData, 0, 0); + var frameDelay = frameInfo.delay; + // To maintain the default of 10FPS when frameInfo.delay equals to 0 + if (frameDelay === 0) { + frameDelay = 10; + } + frames.push({ + image: pImg.drawingContext.getImageData(0, 0, pImg.width, pImg.height), + delay: frameDelay * 10 //GIF stores delay in one-hundredth of a second, shift to ms + }); + // Some GIFs are encoded so that they expect the previous frame + // to be under the current frame. This can occur at a sub-frame level + // + // Values : 0 - No disposal specified. The decoder is + // not required to take any action. + // 1 - Do not dispose. The graphic is to be left + // in place. + // 2 - Restore to background color. The area used by the + // graphic must be restored to the background color. + // 3 - Restore to previous. The decoder is required to + // restore the area overwritten by the graphic with + // what was there prior to rendering the graphic. + // 4-7 - To be defined. + if (frameInfo.disposal === 2) { + // Restore background color + pImg.drawingContext.clearRect(frameInfo.x, frameInfo.y, frameInfo.width, frameInfo.height); + } else if (frameInfo.disposal === 3) { + // Restore previous + pImg.drawingContext.putImageData(prevFrameData, 0, 0, frameInfo.x, frameInfo.y, frameInfo.width, frameInfo.height); + } + } //Uses Netscape block encoding + //to repeat forever, this will be 0 + //to repeat just once, this will be null + //to repeat N times (1 1) { + pImg.gifProperties = { + displayIndex: 0, + loopLimit: loopLimit, + loopCount: 0, + frames: frames, + numFrames: numFrames, + playing: true, + timeDisplayed: 0, + lastChangeTime: 0 + }; + } + if (typeof successCallback === 'function') { + successCallback(pImg); + } + finishCallback(); + } /** + * @private + * @param {Constant} xAlign either LEFT, RIGHT or CENTER + * @param {Constant} yAlign either TOP, BOTTOM or CENTER + * @param {Number} dx + * @param {Number} dy + * @param {Number} dw + * @param {Number} dh + * @param {Number} sw + * @param {Number} sh + * @returns {Object} + */ + + function _imageContain(xAlign, yAlign, dx, dy, dw, dh, sw, sh) { + var r = Math.max(sw / dw, sh / dh); + var adjusted_dw = sw / r, + adjusted_dh = sh / r; + var x = dx; + var y = dy; + if (xAlign === constants.CENTER) { + x += (dw - adjusted_dw) / 2; + } else if (xAlign === constants.RIGHT) { + x += dw - adjusted_dw; + } + if (yAlign === constants.CENTER) { + y += (dh - adjusted_dh) / 2; + } else if (yAlign === constants.BOTTOM) { + y += dh - adjusted_dh; + } + return { + x: x, + y: y, + w: adjusted_dw, + h: adjusted_dh + }; + } /** + * @private + * @param {Constant} xAlign either LEFT, RIGHT or CENTER + * @param {Constant} yAlign either TOP, BOTTOM or CENTER + * @param {Number} dw + * @param {Number} dh + * @param {Number} sx + * @param {Number} sy + * @param {Number} sw + * @param {Number} sh + * @returns {Object} + */ + + function _imageCover(xAlign, yAlign, dw, dh, sx, sy, sw, sh) { + var r = Math.max(dw / sw, dh / sh); + var adjusted_sw = dw / r, + adjusted_sh = dh / r; + var x = sx; + var y = sy; + if (xAlign === constants.CENTER) { + x += (sw - adjusted_sw) / 2; + } else if (xAlign === constants.RIGHT) { + x += sw - adjusted_sw; + } + if (yAlign === constants.CENTER) { + y += (sh - adjusted_sh) / 2; + } else if (yAlign === constants.BOTTOM) { + y += sh - adjusted_sh; + } + return { + x: x, + y: y, + w: adjusted_sw, + h: adjusted_sh + }; + } /** + * @private + * @param {Constant} [fit] either CONTAIN or COVER + * @param {Constant} xAlign either LEFT, RIGHT or CENTER + * @param {Constant} yAlign either TOP, BOTTOM or CENTER + * @param {Number} dx + * @param {Number} dy + * @param {Number} dw + * @param {Number} dh + * @param {Number} sx + * @param {Number} sy + * @param {Number} sw + * @param {Number} sh + * @returns {Object} + */ + + function _imageFit(fit, xAlign, yAlign, dx, dy, dw, dh, sx, sy, sw, sh) { + if (fit === constants.COVER) { + var _imageCover2 = _imageCover(xAlign, yAlign, dw, dh, sx, sy, sw, sh), + x = _imageCover2.x, + y = _imageCover2.y, + w = _imageCover2.w, + h = _imageCover2.h; + sx = x; + sy = y; + sw = w; + sh = h; + } + if (fit === constants.CONTAIN) { + var _imageContain2 = _imageContain(xAlign, yAlign, dx, dy, dw, dh, sw, sh), + _x3 = _imageContain2.x, + _y = _imageContain2.y, + _w = _imageContain2.w, + _h = _imageContain2.h; + dx = _x3; + dy = _y; + dw = _w; + dh = _h; + } + return { + sx: sx, + sy: sy, + sw: sw, + sh: sh, + dx: dx, + dy: dy, + dw: dw, + dh: dh + }; + } /** + * Validates clipping params. Per drawImage spec sWidth and sHight cannot be + * negative or greater than image intrinsic width and height + * @private + * @param {Number} sVal + * @param {Number} iVal + * @returns {Number} + * @private + */ + + function _sAssign(sVal, iVal) { + if (sVal > 0 && sVal < iVal) { + return sVal; + } else { + return iVal; + } + } /** + * Draws a source image to the canvas. + * + * The first parameter, `img`, is the source image to be drawn. The second and + * third parameters, `dx` and `dy`, set the coordinates of the destination + * image's top left corner. See imageMode() for + * other ways to position images. + * + * Here's a diagram that explains how optional parameters work in `image()`: + * + * + * + * The fourth and fifth parameters, `dw` and `dh`, are optional. They set the + * the width and height to draw the destination image. By default, `image()` + * draws the full source image at its original size. + * + * The sixth and seventh parameters, `sx` and `sy`, are also optional. + * These coordinates define the top left corner of a subsection to draw from + * the source image. + * + * The eighth and ninth parameters, `sw` and `sh`, are also optional. + * They define the width and height of a subsection to draw from the source + * image. By default, `image()` draws the full subsection that begins at + * (`sx`, `sy`) and extends to the edges of the source image. + * + * The ninth parameter, `fit`, is also optional. It enables a subsection of + * the source image to be drawn without affecting its aspect ratio. If + * `CONTAIN` is passed, the full subsection will appear within the destination + * rectangle. If `COVER` is passed, the subsection will completely cover the + * destination rectangle. This may have the effect of zooming into the + * subsection. + * + * The tenth and eleventh paremeters, `xAlign` and `yAlign`, are also + * optional. They determine how to align the fitted subsection. `xAlign` can + * be set to either `LEFT`, `RIGHT`, or `CENTER`. `yAlign` can be set to + * either `TOP`, `BOTTOM`, or `CENTER`. By default, both `xAlign` and `yAlign` + * are set to `CENTER`. + * + * @method image + * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img image to display. + * @param {Number} x x-coordinate of the top-left corner of the image. + * @param {Number} y y-coordinate of the top-left corner of the image. + * @param {Number} [width] width to draw the image. + * @param {Number} [height] height to draw the image. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0); + * + * describe('An image of the underside of a white umbrella with a gridded ceiling above.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 10, 10); + * + * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image has dark gray borders on its left and top.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0, 50, 50); + * + * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image is drawn in the top left corner of a dark gray square.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 25, 25, 50, 50, 25, 25, 50, 50); + * + * describe('An image of a gridded ceiling drawn in the center of a dark gray square.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/moonwalk.jpg'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0, width, height, 0, 0, img.width, img.height, CONTAIN); + * + * describe('An image of an astronaut on the moon. The top and bottom borders of the image are dark gray.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * // Image is 50 x 50 pixels. + * img = loadImage('assets/laDefense50.png'); + * } + * + * function setup() { + * background(50); + * image(img, 0, 0, width, height, 0, 0, img.width, img.height, COVER); + * + * describe('A pixelated image of the underside of a white umbrella with a gridded ceiling above.'); + * } + * + *
                              + */ + /** + * @method image + * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img + * @param {Number} dx the x-coordinate of the destination + * rectangle in which to draw the source image + * @param {Number} dy the y-coordinate of the destination + * rectangle in which to draw the source image + * @param {Number} dWidth the width of the destination rectangle + * @param {Number} dHeight the height of the destination rectangle + * @param {Number} sx the x-coordinate of the subsection of the source + * image to draw into the destination rectangle + * @param {Number} sy the y-coordinate of the subsection of the source + * image to draw into the destination rectangle + * @param {Number} [sWidth] the width of the subsection of the + * source image to draw into the destination + * rectangle + * @param {Number} [sHeight] the height of the subsection of the + * source image to draw into the destination rectangle + * @param {Constant} [fit] either CONTAIN or COVER + * @param {Constant} [xAlign] either LEFT, RIGHT or CENTER default is CENTER + * @param {Constant} [yAlign] either TOP, BOTTOM or CENTER default is CENTER + */ + + _main.default.prototype.image = function (img, dx, dy, dWidth, dHeight, sx, sy, sWidth, sHeight, fit, xAlign, yAlign) { + // set defaults per spec: https://goo.gl/3ykfOq + _main.default._validateParameters('image', arguments); + var defW = img.width; + var defH = img.height; + yAlign = yAlign || constants.CENTER; + xAlign = xAlign || constants.CENTER; + if (img.elt) { + defW = defW !== undefined ? defW : img.elt.width; + defH = defH !== undefined ? defH : img.elt.height; + } + if (img.elt && img.elt.videoWidth && !img.canvas) { + // video no canvas + defW = defW !== undefined ? defW : img.elt.videoWidth; + defH = defH !== undefined ? defH : img.elt.videoHeight; + } + var _dx = dx; + var _dy = dy; + var _dw = dWidth || defW; + var _dh = dHeight || defH; + var _sx = sx || 0; + var _sy = sy || 0; + var _sw = sWidth !== undefined ? sWidth : defW; + var _sh = sHeight !== undefined ? sHeight : defH; + _sw = _sAssign(_sw, defW); + _sh = _sAssign(_sh, defH); + // This part needs cleanup and unit tests + // see issues https://github.com/processing/p5.js/issues/1741 + // and https://github.com/processing/p5.js/issues/1673 + var pd = 1; + if (img.elt && !img.canvas && img.elt.style.width) { + //if img is video and img.elt.size() has been used and + //no width passed to image() + if (img.elt.videoWidth && !dWidth) { + pd = img.elt.videoWidth; + } else { + //all other cases + pd = img.elt.width; + } + pd /= parseInt(img.elt.style.width, 10); + } + _sx *= pd; + _sy *= pd; + _sh *= pd; + _sw *= pd; + var vals = _helpers.default.modeAdjust(_dx, _dy, _dw, _dh, this._renderer._imageMode); + vals = _imageFit(fit, xAlign, yAlign, vals.x, vals.y, vals.w, vals.h, _sx, _sy, _sw, _sh); + // tint the image if there is a tint + this._renderer.image(img, vals.sx, vals.sy, vals.sw, vals.sh, vals.dx, vals.dy, vals.dw, vals.dh); + }; + /** + * Tints images using a specified color. + * + * The version of `tint()` with one parameter interprets it one of four ways. + * If the parameter is a number, it's interpreted as a grayscale value. If the + * parameter is a string, it's interpreted as a CSS color string. An array of + * `[R, G, B, A]` values or a p5.Color object can + * also be used to set the tint color. + * + * The version of `tint()` with two parameters uses the first one as a + * grayscale value and the second as an alpha value. For example, calling + * `tint(255, 128)` will make an image 50% transparent. + * + * The version of `tint()` with three parameters interprets them as RGB or + * HSB values, depending on the current + * colorMode(). The optional fourth parameter + * sets the alpha value. For example, `tint(255, 0, 0, 100)` will give images + * a red tint and make them transparent. + * + * @method tint + * @param {Number} v1 red or hue value. + * @param {Number} v2 green or saturation value. + * @param {Number} v3 blue or brightness. + * @param {Number} [alpha] + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint('red'); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint(255, 0, 0); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint(255, 0, 0, 100); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a transparent red tint.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * tint(255, 180); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right is transparent.'); + * } + * + *
                              + */ + /** + * @method tint + * @param {String} value CSS color string. + */ + /** + * @method tint + * @param {Number} gray grayscale value. + * @param {Number} [alpha] + */ + /** + * @method tint + * @param {Number[]} values array containing the red, green, blue & + * alpha components of the color. + */ + /** + * @method tint + * @param {p5.Color} color the tint color + */ + _main.default.prototype.tint = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('tint', args); + var c = this.color.apply(this, args); + this._renderer._tint = c.levels; + }; + /** + * Removes the current tint set by tint() and restores + * images to their original colors. + * + * @method noTint + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * function setup() { + * tint('red'); + * image(img, 0, 0); + * noTint(); + * image(img, 50, 0); + * + * describe('Two images of an umbrella and a ceiling side-by-side. The image on the left has a red tint.'); + * } + * + *
                              + */ + _main.default.prototype.noTint = function () { + this._renderer._tint = null; + }; + /** + * Apply the current tint color to the input image, return the resulting + * canvas. + * + * @private + * @param {p5.Image} The image to be tinted + * @return {canvas} The resulting tinted canvas + */ + _main.default.prototype._getTintedImageCanvas = _main.default.Renderer2D.prototype._getTintedImageCanvas; + /** + * Changes the location from which images are drawn when + * image() is called. + * + * By default, the first + * two parameters of image() are the x- and + * y-coordinates of the image's upper-left corner. The next parameters are + * its width and height. This is the same as calling `imageMode(CORNER)`. + * + * `imageMode(CORNERS)` also uses the first two parameters of + * image() as the x- and y-coordinates of the image's + * top-left corner. The third and fourth parameters are the coordinates of its + * bottom-right corner. + * + * `imageMode(CENTER)` uses the first two parameters of + * image() as the x- and y-coordinates of the image's + * center. The next parameters are its width and height. + * + * @method imageMode + * @param {Constant} mode either CORNER, CORNERS, or CENTER. + * @example + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * background(200); + * imageMode(CORNER); + * image(img, 10, 10, 50, 50); + * + * describe('A square image of a brick wall is drawn at the top left of a gray square.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * background(200); + * imageMode(CORNERS); + * image(img, 10, 10, 90, 40); + * + * describe('An image of a brick wall is drawn on a gray square. The image is squeezed into a small rectangular area.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * background(200); + * imageMode(CENTER); + * image(img, 50, 50, 80, 80); + * + * describe('A square image of a brick wall is drawn on a gray square.'); + * } + * + *
                              + */ + _main.default.prototype.imageMode = function (m) { + _main.default._validateParameters('imageMode', arguments); + if (m === constants.CORNER || m === constants.CORNERS || m === constants.CENTER) { + this._renderer._imageMode = m; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/friendly_errors/fes_core': 289, + '../core/friendly_errors/file_errors': 290, + '../core/friendly_errors/validate_params': 293, + '../core/helpers': 294, + '../core/main': 298, + 'core-js/modules/es.array.copy-within': 170, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.promise': 201, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/es.typed-array.uint8-clamped-array': 253, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256, + 'gifenc': 263, + 'omggif': 270, + 'regenerator-runtime/runtime': 274 + } + ], + 322: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var _filters = _interopRequireDefault(_dereq_('./filters')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Image + * @submodule Image + * @requires core + * @requires constants + * @requires filters + */ + /** + * This module defines the p5.Image class and P5 methods for + * drawing images to the main display canvas. + */ + /* + * Class methods + */ + /** + * A class to describe an image. Images are rectangular grids of pixels that + * can be displayed and modified. + * + * Existing images can be loaded by calling + * loadImage(). Blank images can be created by + * calling createImage(). `p5.Image` objects + * have methods for common tasks such as applying filters and modifying + * pixel values. + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * + * describe('An image of a brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(GRAY); + * image(img, 0, 0); + * + * describe('A grayscale image of a brick wall.'); + * } + * + *
                              + * + *
                              + * + * background(200); + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + * + * @class p5.Image + * @constructor + * @param {Number} width + * @param {Number} height + */ + + _main.default.Image = /*#__PURE__*/ function () { + function _class(width, height) { + _classCallCheck(this, _class); + /** + * Image width. + * @type {Number} + * @property {Number} width + * @name width + * @readOnly + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let x = img.width / 2; + * let y = img.height / 2; + * let d = 20; + * circle(x, y, d); + * + * describe('An image of a mountain landscape with a white circle drawn in the middle.'); + * } + * + *
                              + */ + this.width = width; + /** + * Image height. + * @type {Number} + * @property height + * @name height + * @readOnly + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let x = img.width / 2; + * let y = img.height / 2; + * let d = 20; + * circle(x, y, d); + * + * describe('An image of a mountain landscape with a white circle drawn in the middle.'); + * } + * + *
                              + */ + this.height = height; + this.canvas = document.createElement('canvas'); + this.canvas.width = this.width; + this.canvas.height = this.height; + this.drawingContext = this.canvas.getContext('2d'); + this._pixelsState = this; + this._pixelDensity = 1; + //Object for working with GIFs, defaults to null + this.gifProperties = null; + //For WebGL Texturing only: used to determine whether to reupload texture to GPU + this._modified = false; + /** + * An array containing the color of each pixel in the + * p5.Image object. Colors are stored as numbers + * representing red, green, blue, and alpha (RGBA) values. `img.pixels` is a + * one-dimensional array for performance reasons. + * + * Each pixel occupies four elements in the pixels array, one for each + * RGBA value. For example, the pixel at coordinates (0, 0) stores its + * RGBA values at `img.pixels[0]`, `img.pixels[1]`, `img.pixels[2]`, + * and `img.pixels[3]`, respectively. The next pixel at coordinates (1, 0) + * stores its RGBA values at `img.pixels[4]`, `img.pixels[5]`, + * `img.pixels[6]`, and `img.pixels[7]`. And so on. The `img.pixels` array + * for a 100×100 p5.Image object has + * 100 × 100 × 4 = 40,000 elements. + * + * Accessing the RGBA values for a pixel in the + * p5.Image object requires a little math as + * shown below. The img.loadPixels() + * method must be called before accessing the `img.pixels` array. The + * img.updatePixels() method must be + * called after any changes are made. + * + * @property {Number[]} pixels + * @name pixels + * @example + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 255; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A red square drawn in the middle of a gray square.'); + * + *
                              + */ + this.pixels = [ + ]; + } /** + * Gets or sets the pixel density for high pixel density displays. By default, + * the density will be set to 1. + * + * Call this method with no arguments to get the default density, or pass + * in a number to set the density. If a non-positive number is provided, + * it defaults to 1. + * + * @method pixelDensity + * @param {Number} [density] A scaling factor for the number of pixels per + * side + * @returns {Number} The current density if called without arguments, or the instance for chaining if setting density. + */ + + _createClass(_class, [ + { + key: 'pixelDensity', + value: function pixelDensity(density) { + if (typeof density !== 'undefined') { + // Setter: set the density and handle resize + if (density <= 0) { + var errorObj = { + type: 'INVALID_VALUE', + format: { + types: [ + 'Number' + ] + }, + position: 1 + }; + _main.default._friendlyParamError(errorObj, 'pixelDensity'); + // Default to 1 in case of an invalid value + density = 1; + } + this._pixelDensity = density; + // Adjust canvas dimensions based on pixel density + this.width /= density; + this.height /= density; + return this; // Return the image instance for chaining if needed + } else { + // Getter: return the default density + return this._pixelDensity; + } + } /** + * Helper function for animating GIF-based images with time + */ + + }, + { + key: '_animateGif', + value: function _animateGif(pInst) { + var props = this.gifProperties; + var curTime = pInst._lastRealFrameTime; + if (props.lastChangeTime === 0) { + props.lastChangeTime = curTime; + } + if (props.playing) { + props.timeDisplayed = curTime - props.lastChangeTime; + var curDelay = props.frames[props.displayIndex].delay; + if (props.timeDisplayed >= curDelay) { + //GIF is bound to 'realtime' so can skip frames + var skips = Math.floor(props.timeDisplayed / curDelay); + props.timeDisplayed = 0; + props.lastChangeTime = curTime; + props.displayIndex += skips; + props.loopCount = Math.floor(props.displayIndex / props.numFrames); + if (props.loopLimit !== null && props.loopCount >= props.loopLimit) { + props.playing = false; + } else { + var ind = props.displayIndex % props.numFrames; + this.drawingContext.putImageData(props.frames[ind].image, 0, 0); + props.displayIndex = ind; + this.setModified(true); + } + } + } + } /** + * Helper fxn for sharing pixel methods + */ + + }, + { + key: '_setProperty', + value: function _setProperty(prop, value) { + this[prop] = value; + this.setModified(true); + } /** + * Loads the current value of each pixel in the + * p5.Image object into the `img.pixels` array. + * This method must be called before reading or modifying pixel values. + * + * @method loadPixels + * @example + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + */ + + }, + { + key: 'loadPixels', + value: function loadPixels() { + _main.default.Renderer2D.prototype.loadPixels.call(this); + this.setModified(true); + } /** + * Updates the canvas with the RGBA values in the + * img.pixels array. + * + * `img.updatePixels()` only needs to be called after changing values in + * the img.pixels array. Such changes can be + * made directly after calling + * img.loadPixels() or by calling + * img.set(). + * + * The optional parameters `x`, `y`, `width`, and `height` define a + * subsection of the p5.Image object to update. + * Doing so can improve performance in some cases. + * + * If the p5.Image object was loaded from a GIF, + * then calling `img.updatePixels()` will update the pixels in current + * frame. + * + * @method updatePixels + * @param {Integer} x x-coordinate of the upper-left corner + * of the subsection to update. + * @param {Integer} y y-coordinate of the upper-left corner + * of the subsection to update. + * @param {Integer} w width of the subsection to update. + * @param {Integer} h height of the subsection to update. + * @example + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * img.set(x, y, 0); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let img = createImage(66, 66); + * img.loadPixels(); + * let numPixels = 4 * img.width * img.height; + * for (let i = 0; i < numPixels; i += 4) { + * // Red. + * img.pixels[i] = 0; + * // Green. + * img.pixels[i + 1] = 0; + * // Blue. + * img.pixels[i + 2] = 0; + * // Alpha. + * img.pixels[i + 3] = 255; + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A black square drawn in the middle of a gray square.'); + * + *
                              + */ + /** + * @method updatePixels + */ + + }, + { + key: 'updatePixels', + value: function updatePixels(x, y, w, h) { + _main.default.Renderer2D.prototype.updatePixels.call(this, x, y, w, h); + this.setModified(true); + } /** + * Gets a pixel or a region of pixels from a + * p5.Image object. + * + * `img.get()` is easy to use but it's not as fast as + * img.pixels. Use + * img.pixels to read many pixel values. + * + * The version of `img.get()` with no parameters returns the entire image. + * + * The version of `img.get()` with two parameters interprets them as + * coordinates. It returns an array with the `[R, G, B, A]` values of the + * pixel at the given point. + * + * The version of `img.get()` with four parameters interprets them as + * coordinates and dimensions. It returns a subsection of the canvas as a + * p5.Image object. The first two parameters are + * the coordinates for the upper-left corner of the subsection. The last two + * parameters are the width and height of the subsection. + * + * Use img.get() to work directly with + * p5.Image objects. + * + * @method get + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number} w width of the subsection to be returned. + * @param {Number} h height of the subsection to be returned. + * @return {p5.Image} subsection as a p5.Image object. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let img2 = get(); + * image(img2, width / 2, 0); + * + * describe('Two identical mountain landscapes shown side-by-side.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = img.get(50, 90); + * fill(c); + * noStroke(); + * square(25, 25, 50); + * + * describe('A mountain landscape with an olive green square in its center.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let img2 = img.get(0, 0, img.width / 2, img.height / 2); + * image(img2, width / 2, height / 2); + * + * describe('A mountain landscape drawn on top of another mountain landscape.'); + * } + * + *
                              + */ + /** + * @method get + * @return {p5.Image} whole p5.Image + */ + /** + * @method get + * @param {Number} x + * @param {Number} y + * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. + */ + + }, + { + key: 'get', + value: function get(x, y, w, h) { + _main.default._validateParameters('p5.Image.get', arguments); + return _main.default.Renderer2D.prototype.get.apply(this, arguments); + } + }, + { + key: '_getPixel', + value: function _getPixel() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return _main.default.Renderer2D.prototype._getPixel.apply(this, args); + } /** + * Sets the color of one or more pixels within a + * p5.Image object. + * + * `img.set()` is easy to use but it's not as fast as + * img.pixels. Use + * img.pixels to set many pixel values. + * + * `img.set()` interprets the first two parameters as x- and y-coordinates. It + * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel + * array, a p5.Color object, or another + * p5.Image object. + * + * img.updatePixels() must be called + * after using `img.set()` for changes to appear. + * + * @method set + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number|Number[]|Object} a grayscale value | pixel array | + * p5.Color object | + * p5.Image to copy. + * @example + *
                              + * + * let img = createImage(100, 100); + * img.set(30, 20, 0); + * img.set(85, 20, 0); + * img.set(85, 75, 0); + * img.set(30, 75, 0); + * img.updatePixels(); + * image(img, 0, 0); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                              + * + *
                              + * + * let img = createImage(100, 100); + * let black = color(0); + * img.set(30, 20, black); + * img.set(85, 20, black); + * img.set(85, 75, black); + * img.set(30, 75, black); + * img.updatePixels(); + * image(img, 0, 0); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                              + * + *
                              + * + * let img = createImage(66, 66); + * for (let x = 0; x < img.width; x += 1) { + * for (let y = 0; y < img.height; y += 1) { + * let c = map(x, 0, img.width, 0, 255); + * img.set(x, y, c); + * } + * } + * img.updatePixels(); + * image(img, 17, 17); + * + * describe('A square with a horiztonal color gradient from black to white drawn on a gray background.'); + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * let img2 = createImage(100, 100); + * img2.set(0, 0, img); + * image(img2, 0, 0); + * + * describe('An image of a mountain landscape.'); + * } + * + *
                              + */ + + }, + { + key: 'set', + value: function set(x, y, imgOrCol) { + _main.default.Renderer2D.prototype.set.call(this, x, y, imgOrCol); + this.setModified(true); + } /** + * Resizes the p5.Image object to a given `width` + * and `height`. The image's original aspect ratio can be kept by passing 0 + * for either `width` or `height`. For example, calling `img.resize(50, 0)` + * on an image that was 500 × 300 pixels will resize it to + * 50 × 30 pixels. + * + * @method resize + * @param {Number} width resized image width. + * @param {Number} height resized image height. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * function setup() { + * image(img, 0, 0); + * img.resize(50, 100); + * image(img, 0, 0); + * + * describe('Two images of a mountain landscape. One copy of the image is squeezed horizontally.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * function setup() { + * image(img, 0, 0); + * img.resize(0, 30); + * image(img, 0, 0); + * + * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * function setup() { + * image(img, 0, 0); + * img.resize(60, 0); + * image(img, 0, 0); + * + * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); + * } + * + *
                              + */ + + }, + { + key: 'resize', + value: function resize(width, height) { + // Copy contents to a temporary canvas, resize the original + // and then copy back. + // + // There is a faster approach that involves just one copy and swapping the + // this.canvas reference. We could switch to that approach if (as i think + // is the case) there an expectation that the user would not hold a + // reference to the backing canvas of a p5.Image. But since we do not + // enforce that at the moment, I am leaving in the slower, but safer + // implementation. + // auto-resize + if (width === 0 && height === 0) { + width = this.canvas.width; + height = this.canvas.height; + } else if (width === 0) { + width = this.canvas.width * height / this.canvas.height; + } else if (height === 0) { + height = this.canvas.height * width / this.canvas.width; + } + width = Math.floor(width); + height = Math.floor(height); + var tempCanvas = document.createElement('canvas'); + tempCanvas.width = width; + tempCanvas.height = height; + if (this.gifProperties) { + var props = this.gifProperties; + //adapted from github.com/LinusU/resize-image-data + var nearestNeighbor = function nearestNeighbor(src, dst) { + var pos = 0; + for (var y = 0; y < dst.height; y++) { + for (var x = 0; x < dst.width; x++) { + var srcX = Math.floor(x * src.width / dst.width); + var srcY = Math.floor(y * src.height / dst.height); + var srcPos = (srcY * src.width + srcX) * 4; + dst.data[pos++] = src.data[srcPos++]; // R + dst.data[pos++] = src.data[srcPos++]; // G + dst.data[pos++] = src.data[srcPos++]; // B + dst.data[pos++] = src.data[srcPos++]; // A + } + } + }; + for (var i = 0; i < props.numFrames; i++) { + var resizedImageData = this.drawingContext.createImageData(width, height); + nearestNeighbor(props.frames[i].image, resizedImageData); + props.frames[i].image = resizedImageData; + } + } + tempCanvas.getContext('2d').drawImage(this.canvas, 0, 0, this.canvas.width, this.canvas.height, 0, 0, tempCanvas.width, tempCanvas.height); + // Resize the original canvas, which will clear its contents + this.canvas.width = this.width = width; + this.canvas.height = this.height = height; + //Copy the image back + this.drawingContext.drawImage(tempCanvas, 0, 0, width, height, 0, 0, width, height); + if (this.pixels.length > 0) { + this.loadPixels(); + } + this.setModified(true); + } /** + * + * Copies pixels from a source p5.Image + * to this one. Calling `img.copy()` will scale pixels from the source + * region if it isn't the same size as the destination region. + * + * @method copy + * @param {p5.Image|p5.Element} srcImage source image. + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * img.copy(7, 22, 10, 10, 35, 25, 50, 50); + * image(img, 0, 0); + * // Outline copied region. + * stroke(255); + * noFill(); + * square(7, 22, 10); + * + * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); + * } + * + *
                              + * + *
                              + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * let x = bricks.width / 2; + * let y = bricks.height / 2; + * mountains.copy(bricks, 0, 0, x, y, 0, 0, x, y); + * image(mountains, 0, 0); + * + * describe('An image of a brick wall drawn at the top-left of an image of a mountain landscape.'); + * } + * + *
                              + */ + /** + * @method copy + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + */ + + }, + { + key: 'copy', + value: function copy() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default.prototype.copy.apply(this, args); + } /** + * Masks part of an image from displaying by loading another + * image and using its alpha channel as an alpha channel for + * this image. Masks are cumulative, once applied to an image + * object, they cannot be removed. + * + * @method mask + * @param {p5.Image} srcImage source image. + * + * @example + *
                              + * + * let photo; + * let maskImage; + * + * function preload() { + * photo = loadImage('assets/rockies.jpg'); + * maskImage = loadImage('assets/mask2.png'); + * } + * + * function setup() { + * photo.mask(maskImage); + * image(photo, 0, 0); + * + * describe('An image of a mountain landscape. The right side of the image has a faded patch of white.'); + * } + * + *
                              + */ + // TODO: - Accept an array of alpha values. + + }, + { + key: 'mask', + value: function mask(p5Image) { + if (p5Image === undefined) { + p5Image = this; + } + var currBlend = this.drawingContext.globalCompositeOperation; + var scaleFactor = 1; + if (p5Image instanceof _main.default.Renderer) { + scaleFactor = p5Image._pInst._pixelDensity; + } + var copyArgs = [ + p5Image, + 0, + 0, + scaleFactor * p5Image.width, + scaleFactor * p5Image.height, + 0, + 0, + this.width, + this.height + ]; + this.drawingContext.globalCompositeOperation = 'destination-in'; + if (this.gifProperties) { + for (var i = 0; i < this.gifProperties.frames.length; i++) { + this.drawingContext.putImageData(this.gifProperties.frames[i].image, 0, 0); + this.copy.apply(this, copyArgs); + this.gifProperties.frames[i].image = this.drawingContext.getImageData(0, 0, this.width, this.height); + } + this.drawingContext.putImageData(this.gifProperties.frames[this.gifProperties.displayIndex].image, 0, 0); + } else { + this.copy.apply(this, copyArgs); + } + this.drawingContext.globalCompositeOperation = currBlend; + this.setModified(true); + } /** + * Applies an image filter to the p5.Image object. + * The preset options are: + * + * `INVERT` + * Inverts the colors in the image. No parameter is used. + * + * `GRAY` + * Converts the image to grayscale. No parameter is used. + * + * `THRESHOLD` + * Converts the image to black and white. Pixels with a grayscale value + * above a given threshold are converted to white. The rest are converted to + * black. The threshold must be between 0.0 (black) and 1.0 (white). If no + * value is specified, 0.5 is used. + * + * `OPAQUE` + * Sets the alpha channel to be entirely opaque. No parameter is used. + * + * `POSTERIZE` + * Limits the number of colors in the image. Each color channel is limited to + * the number of colors specified. Values between 2 and 255 are valid, but + * results are most noticeable with lower values. The default value is 4. + * + * `BLUR` + * Blurs the image. The level of blurring is specified by a blur radius. Larger + * values increase the blur. The default value is 4. A gaussian blur is used + * in `P2D` mode. A box blur is used in `WEBGL` mode. + * + * `ERODE` + * Reduces the light areas. No parameter is used. + * + * `DILATE` + * Increases the light areas. No parameter is used. + * + * @method filter + * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, + * POSTERIZE, ERODE, DILATE or BLUR. + * @param {Number} [filterParam] parameter unique to each filter. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(INVERT); + * image(img, 0, 0); + * + * describe('A blue brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(GRAY); + * image(img, 0, 0); + * + * describe('A brick wall drawn in grayscale.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(THRESHOLD); + * image(img, 0, 0); + * + * describe('A brick wall drawn in black and white.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(OPAQUE); + * image(img, 0, 0); + * + * describe('A red brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(POSTERIZE, 3); + * image(img, 0, 0); + * + * describe('An image of a red brick wall drawn with a limited color palette.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(BLUR, 3); + * image(img, 0, 0); + * + * describe('A blurry image of a red brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(DILATE); + * image(img, 0, 0); + * + * describe('A red brick wall with bright lines between each brick.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * img.filter(ERODE); + * image(img, 0, 0); + * + * describe('A red brick wall with faint lines between each brick.'); + * } + * + *
                              + */ + + }, + { + key: 'filter', + value: function filter(operation, value) { + _filters.default.apply(this.canvas, _filters.default[operation], value); + this.setModified(true); + } /** + * Copies a region of pixels from another + * p5.Image object into this one. The `blendMode` + * parameter blends the images' colors to create different effects. + * + * @method blend + * @param {p5.Image} srcImage source image + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * @param {Constant} blendMode the blend mode. either + * BLEND, DARKEST, LIGHTEST, DIFFERENCE, + * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, + * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. + * + * Available blend modes are: normal | multiply | screen | overlay | + * darken | lighten | color-dodge | color-burn | hard-light | + * soft-light | difference | exclusion | hue | saturation | + * color | luminosity + * + * http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ + * @example + *
                              + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, ADD); + * image(mountains, 0, 0); + * image(bricks, 0, 0); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); + * } + * + *
                              + * + *
                              + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); + * image(mountains, 0, 0); + * image(bricks, 0, 0); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); + * } + * + *
                              + * + *
                              + * + * let mountains; + * let bricks; + * + * function preload() { + * mountains = loadImage('assets/rockies.jpg'); + * bricks = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); + * image(mountains, 0, 0); + * image(bricks, 0, 0); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); + * } + * + *
                              + */ + /** + * @method blend + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + * @param {Constant} blendMode + */ + + }, + { + key: 'blend', + value: function blend() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('p5.Image.blend', arguments); + _main.default.prototype.blend.apply(this, args); + this.setModified(true); + } /** + * helper method for web GL mode to indicate that an image has been + * changed or unchanged since last upload. gl texture upload will + * set this value to false after uploading the texture. + * @method setModified + * @param {boolean} val sets whether or not the image has been + * modified. + * @private + */ + + }, + { + key: 'setModified', + value: function setModified(val) { + this._modified = val; //enforce boolean? + } /** + * helper method for web GL mode to figure out if the image + * has been modified and might need to be re-uploaded to texture + * memory between frames. + * @method isModified + * @private + * @return {boolean} a boolean indicating whether or not the + * image has been updated or modified since last texture upload. + */ + + }, + { + key: 'isModified', + value: function isModified() { + return this._modified; + } /** + * Saves the p5.Image object to a file. + * The browser will either save the file immediately or prompt the user + * with a dialogue window. + * + * By default, calling `img.save()` will save the image as `untitled.png`. + * + * Calling `img.save()` with one argument, as in `img.save('photo.png')`, + * will set the image's filename and type together. + * + * Calling `img.save()` with two arguments, as in + * `image.save('photo', 'png')`, will set the image's filename and type + * separately. + * + * The image will only be downloaded as an animated GIF if the + * p5.Image object was loaded from a GIF file. + * See saveGif() to create new GIFs. + * @method save + * @param {String} filename filename. Defaults to 'untitled'. + * @param {String} [extension] file extension, either 'png' or 'jpg'. + * Defaults to 'png'. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function draw() { + * image(img, 0, 0); + * + * describe('An image of a mountain landscape.'); + * } + * + * function keyPressed() { + * if (key === 's') { + * img.save(); + * } else if (key === 'j') { + * img.save('rockies.jpg'); + * } else if (key === 'p') { + * img.save('rockies', 'png'); + * } + * } + * + *
                              + */ + + }, + { + key: 'save', + value: function save(filename, extension) { + if (this.gifProperties) { + _main.default.prototype.encodeAndDownloadGif(this, filename); + } else { + _main.default.prototype.saveCanvas(this.canvas, filename, extension); + } + } // GIF Section + /** + * Restarts an animated GIF at its first frame. + * + * @method reset + * @example + *
                              + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-wink-loop-once.gif'); + * } + * + * function draw() { + * background(255); + * image(gif, 0, 0); + * + * describe('A cartoon face winks once and then freezes. Clicking resets the face and makes it wink again.'); + * } + * + * function mousePressed() { + * gif.reset(); + * } + * + *
                              + */ + + }, + { + key: 'reset', + value: function reset() { + if (this.gifProperties) { + var props = this.gifProperties; + props.playing = true; + props.timeSinceStart = 0; + props.timeDisplayed = 0; + props.lastChangeTime = 0; + props.loopCount = 0; + props.displayIndex = 0; + this.drawingContext.putImageData(props.frames[0].image, 0, 0); + } + } /** + * Gets the index of the current frame in an animated GIF. + * + * @method getCurrentFrame + * @return {Number} index of the GIF's current frame. + * @example + *
                              + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function draw() { + * let index = gif.getCurrentFrame(); + * image(gif, 0, 0); + * text(index, 10, 90); + * + * describe('A cartoon eye repeatedly looks around, then outwards. A number displayed in the bottom-left corner increases from 0 to 124, then repeats.'); + * } + * + *
                              + */ + + }, + { + key: 'getCurrentFrame', + value: function getCurrentFrame() { + if (this.gifProperties) { + var props = this.gifProperties; + return props.displayIndex % props.numFrames; + } + } /** + * Sets the current frame in an animated GIF. + * + * @method setFrame + * @param {Number} index index of the frame to display. + * @example + *
                              + * + * let gif; + * let frameSlider; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function setup() { + * let maxFrame = gif.numFrames() - 1; + * frameSlider = createSlider(0, maxFrame); + * frameSlider.position(10, 80); + * frameSlider.size(80); + * } + * + * function draw() { + * let index = frameSlider.value(); + * gif.setFrame(index); + * image(gif, 0, 0); + * + * describe('A cartoon eye looks around when a slider is moved.'); + * } + * + *
                              + */ + + }, + { + key: 'setFrame', + value: function setFrame(index) { + if (this.gifProperties) { + var props = this.gifProperties; + if (index < props.numFrames && index >= 0) { + props.timeDisplayed = 0; + props.lastChangeTime = 0; + props.displayIndex = index; + this.drawingContext.putImageData(props.frames[index].image, 0, 0); + } else { + console.log('Cannot set GIF to a frame number that is higher than total number of frames or below zero.'); + } + } + } /** + * Returns the number of frames in an animated GIF. + * + * @method numFrames + * @return {Number} number of frames in the GIF. + * + * @example + *
                              + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function draw() { + * image(gif, 0, 0); + * let total = gif.numFrames(); + * let index = gif.getCurrentFrame(); + * text(`${index} / ${total}`, 30, 90); + * + * describe('A cartoon eye looks around. The text "n / 125" is shown at the bottom of the canvas.'); + * } + * + *
                              + */ + + }, + { + key: 'numFrames', + value: function numFrames() { + if (this.gifProperties) { + return this.gifProperties.numFrames; + } + } /** + * Plays an animated GIF that was paused with + * img.pause(). + * + * @method play + * + * @example + *
                              + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); + * } + * + * function draw() { + * background(255); + * image(gif, 0, 0); + * + * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); + * } + * + * function mousePressed() { + * gif.pause(); + * } + * + * function mouseReleased() { + * gif.play(); + * } + * + *
                              + */ + + }, + { + key: 'play', + value: function play() { + if (this.gifProperties) { + this.gifProperties.playing = true; + } + } /** + * Pauses an animated GIF. The GIF can be resumed by calling + * img.play(). + * + * @method pause + * + * @example + *
                              + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); + * } + * + * function draw() { + * background(255); + * image(gif, 0, 0); + * + * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); + * } + * + * function mousePressed() { + * gif.pause(); + * } + * + * function mouseReleased() { + * gif.play(); + * } + * + *
                              + */ + + }, + { + key: 'pause', + value: function pause() { + if (this.gifProperties) { + this.gifProperties.playing = false; + } + } /** + * Changes the delay between frames in an animated GIF. + * + * The second parameter, `index`, is optional. If provided, only the frame + * at `index` will have its delay modified. All other frames will keep + * their default delay. + * + * @method delay + * @param {Number} d delay in milliseconds between switching frames. + * @param {Number} [index] index of the frame that will have its delay modified. + * + * @example + *
                              + * + * let gifFast; + * let gifSlow; + * + * function preload() { + * gifFast = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * gifSlow = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function setup() { + * gifFast.resize(50, 50); + * gifSlow.resize(50, 50); + * gifFast.delay(10); + * gifSlow.delay(100); + * } + * + * function draw() { + * image(gifFast, 0, 0); + * image(gifSlow, 50, 0); + * + * describe('Two animated eyes looking around. The eye on the left moves faster than the eye on the right.'); + * } + * + *
                              + * + *
                              + * + * let gif; + * + * function preload() { + * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); + * } + * + * function setup() { + * gif.delay(3000, 67); + * } + * + * function draw() { + * image(gif, 0, 0); + * + * describe('An animated eye looking around. It pauses for three seconds while it looks down.'); + * } + * + *
                              + */ + + }, + { + key: 'delay', + value: function delay(d, index) { + if (this.gifProperties) { + var props = this.gifProperties; + if (index < props.numFrames && index >= 0) { + props.frames[index].delay = d; + } else { + // change all frames + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = props.frames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var frame = _step.value; + frame.delay = d; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + } + } + ]); + return _class; + }(); + var _default = _main.default.Image; + exports.default = _default; + }, + { + '../core/main': 298, + './filters': 319, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 323: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.filter'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var _filters = _interopRequireDefault(_dereq_('./filters')); + _dereq_('../color/p5.Color'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Image + * @submodule Pixels + * @for p5 + * @requires core + */ + /** + * An array containing the color of each pixel on the canvas. Colors are + * stored as numbers representing red, green, blue, and alpha (RGBA) values. + * `pixels` is a one-dimensional array for performance reasons. + * + * Each pixel occupies four elements in the `pixels` array, one for each RGBA + * value. For example, the pixel at coordinates (0, 0) stores its RGBA values + * at `pixels[0]`, `pixels[1]`, `pixels[2]`, and `pixels[3]`, respectively. + * The next pixel at coordinates (1, 0) stores its RGBA values at `pixels[4]`, + * `pixels[5]`, `pixels[6]`, and `pixels[7]`. And so on. The `pixels` array + * for a 100×100 canvas has 100 × 100 × 4 = 40,000 elements. + * + * Some displays use several smaller pixels to set the color at a single + * point. The pixelDensity() function returns + * the pixel density of the canvas. High density displays often have a + * pixelDensity() of 2. On such a display, the + * `pixels` array for a 100×100 canvas has 200 × 200 × 4 = + * 160,000 elements. + * + * Accessing the RGBA values for a point on the canvas requires a little math + * as shown below. The loadPixels() function + * must be called before accessing the `pixels` array. The + * updatePixels() function must be called + * after any changes are made. + * + * @property {Number[]} pixels + * + * @example + *
                              + * + * loadPixels(); + * let x = 50; + * let y = 50; + * let d = pixelDensity(); + * for (let i = 0; i < d; i += 1) { + * for (let j = 0; j < d; j += 1) { + * let index = 4 * ((y * d + j) * width * d + (x * d + i)); + * // Red. + * pixels[index] = 0; + * // Green. + * pixels[index + 1] = 0; + * // Blue. + * pixels[index + 2] = 0; + * // Alpha. + * pixels[index + 3] = 255; + * } + * } + * updatePixels(); + * + * describe('A black dot in the middle of a gray rectangle.'); + * + *
                              + * + *
                              + * + * loadPixels(); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * for (let i = 0; i < halfImage; i += 4) { + * // Red. + * pixels[i] = 255; + * // Green. + * pixels[i + 1] = 0; + * // Blue. + * pixels[i + 2] = 0; + * // Alpha. + * pixels[i + 3] = 255; + * } + * updatePixels(); + * + * describe('A red rectangle drawn above a gray rectangle.'); + * + *
                              + * + *
                              + * + * let pink = color(255, 102, 204); + * loadPixels(); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * for (let i = 0; i < halfImage; i += 4) { + * pixels[i] = red(pink); + * pixels[i + 1] = green(pink); + * pixels[i + 2] = blue(pink); + * pixels[i + 3] = alpha(pink); + * } + * updatePixels(); + * + * describe('A pink rectangle drawn above a gray rectangle.'); + * + *
                              + */ + + _main.default.prototype.pixels = [ + ]; + /** + * Copies a region of pixels from one image to another. The `blendMode` + * parameter blends the images' colors to create different effects. + * + * @method blend + * @param {p5.Image} srcImage source image. + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * @param {Constant} blendMode the blend mode. either + * BLEND, DARKEST, LIGHTEST, DIFFERENCE, + * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, + * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. + * + * @example + *
                              + * + * let img0; + * let img1; + * + * function preload() { + * img0 = loadImage('assets/rockies.jpg'); + * img1 = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * background(img0); + * image(img1, 0, 0); + * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); + * } + * + *
                              + * + *
                              + * + * let img0; + * let img1; + * + * function preload() { + * img0 = loadImage('assets/rockies.jpg'); + * img1 = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * background(img0); + * image(img1, 0, 0); + * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); + * } + * + *
                              + * + *
                              + * + * let img0; + * let img1; + * + * function preload() { + * img0 = loadImage('assets/rockies.jpg'); + * img1 = loadImage('assets/bricks_third.jpg'); + * } + * + * function setup() { + * background(img0); + * image(img1, 0, 0); + * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, ADD); + * + * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); + * } + * + *
                              + */ + /** + * @method blend + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + * @param {Constant} blendMode + */ + _main.default.prototype.blend = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('blend', args); + if (this._renderer) { + var _this$_renderer; + (_this$_renderer = this._renderer).blend.apply(_this$_renderer, args); + } else { + _main.default.Renderer2D.prototype.blend.apply(this, args); + } + }; + /** + * Copies pixels from a source image to a region of the canvas. The source + * image can be the canvas itself or a p5.Image + * object. `copy()` will scale pixels from the source region if it isn't the + * same size as the destination region. + * + * @method copy + * @param {p5.Image|p5.Element} srcImage source image. + * @param {Integer} sx x-coordinate of the source's upper-left corner. + * @param {Integer} sy y-coordinate of the source's upper-left corner. + * @param {Integer} sw source image width. + * @param {Integer} sh source image height. + * @param {Integer} dx x-coordinate of the destination's upper-left corner. + * @param {Integer} dy y-coordinate of the destination's upper-left corner. + * @param {Integer} dw destination image width. + * @param {Integer} dh destination image height. + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * background(img); + * copy(img, 7, 22, 10, 10, 35, 25, 50, 50); + * // Show copied region. + * stroke(255); + * noFill(); + * square(7, 22, 10); + * + * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); + * } + * + *
                              + */ + /** + * @method copy + * @param {Integer} sx + * @param {Integer} sy + * @param {Integer} sw + * @param {Integer} sh + * @param {Integer} dx + * @param {Integer} dy + * @param {Integer} dw + * @param {Integer} dh + */ + _main.default.prototype.copy = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('copy', args); + var srcImage, + sx, + sy, + sw, + sh, + dx, + dy, + dw, + dh; + if (args.length === 9) { + srcImage = args[0]; + sx = args[1]; + sy = args[2]; + sw = args[3]; + sh = args[4]; + dx = args[5]; + dy = args[6]; + dw = args[7]; + dh = args[8]; + } else if (args.length === 8) { + srcImage = this; + sx = args[0]; + sy = args[1]; + sw = args[2]; + sh = args[3]; + dx = args[4]; + dy = args[5]; + dw = args[6]; + dh = args[7]; + } else { + throw new Error('Signature not supported'); + } + _main.default.prototype._copyHelper(this, srcImage, sx, sy, sw, sh, dx, dy, dw, dh); + }; + _main.default.prototype._copyHelper = function (dstImage, srcImage, sx, sy, sw, sh, dx, dy, dw, dh) { + var s = srcImage.canvas.width / srcImage.width; + // adjust coord system for 3D when renderer + // ie top-left = -width/2, -height/2 + var sxMod = 0; + var syMod = 0; + if (srcImage._renderer && srcImage._renderer.isP3D) { + sxMod = srcImage.width / 2; + syMod = srcImage.height / 2; + } + if (dstImage._renderer && dstImage._renderer.isP3D) { + _main.default.RendererGL.prototype.image.call(dstImage._renderer, srcImage, sx + sxMod, sy + syMod, sw, sh, dx, dy, dw, dh); + } else { + dstImage.drawingContext.drawImage(srcImage.canvas, s * (sx + sxMod), s * (sy + syMod), s * sw, s * sh, dx, dy, dw, dh); + } + }; + /** + * Applies an image filter to the canvas. The preset options are: + * + * `INVERT` + * Inverts the colors in the image. No parameter is used. + * + * `GRAY` + * Converts the image to grayscale. No parameter is used. + * + * `THRESHOLD` + * Converts the image to black and white. Pixels with a grayscale value + * above a given threshold are converted to white. The rest are converted to + * black. The threshold must be between 0.0 (black) and 1.0 (white). If no + * value is specified, 0.5 is used. + * + * `OPAQUE` + * Sets the alpha channel to entirely opaque. No parameter is used. + * + * `POSTERIZE` + * Limits the number of colors in the image. Each color channel is limited to + * the number of colors specified. Values between 2 and 255 are valid, but + * results are most noticeable with lower values. The default value is 4. + * + * `BLUR` + * Blurs the image. The level of blurring is specified by a blur radius. Larger + * values increase the blur. The default value is 4. A gaussian blur is used + * in `P2D` mode. A box blur is used in `WEBGL` mode. + * + * `ERODE` + * Reduces the light areas. No parameter is used. + * + * `DILATE` + * Increases the light areas. No parameter is used. + * + * `filter()` uses WebGL in the background by default because it's faster. + * This can be disabled in `P2D` mode by adding a `false` argument, as in + * `filter(BLUR, false)`. This may be useful to keep computation off the GPU + * or to work around a lack of WebGL support. + * + * In `WEBGL` mode, `filter()` can also use custom shaders. See + * createFilterShader() for more + * information. + * + * + * @method filter + * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, + * POSTERIZE, BLUR, ERODE, DILATE or BLUR. + * @param {Number} [filterParam] parameter unique to each filter. + * @param {Boolean} [useWebGL] flag to control whether to use fast + * WebGL filters (GPU) or original image + * filters (CPU); defaults to `true`. + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(INVERT); + * + * describe('A blue brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(GRAY); + * + * describe('A brick wall drawn in grayscale.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(THRESHOLD); + * + * describe('A brick wall drawn in black and white.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(OPAQUE); + * + * describe('A red brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(POSTERIZE, 3); + * + * describe('An image of a red brick wall drawn with limited color palette.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(BLUR, 3); + * + * describe('A blurry image of a red brick wall.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(DILATE); + * + * describe('A red brick wall with bright lines between each brick.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * filter(ERODE); + * + * describe('A red brick wall with faint lines between each brick.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * // Don't use WebGL. + * filter(BLUR, 3, false); + * + * describe('A blurry image of a red brick wall.'); + * } + * + *
                              + */ + /** + * @method getFilterGraphicsLayer + * @private + * @returns {p5.Graphics} + */ + _main.default.prototype.getFilterGraphicsLayer = function () { + return this._renderer.getFilterGraphicsLayer(); + }; + /** + * @method filter + * @param {Constant} filterType + * @param {Boolean} [useWebGL] + */ + /** + * @method filter + * @param {p5.Shader} shaderFilter shader that's been loaded, with the + * frag shader using a `tex0` uniform. + */ + _main.default.prototype.filter = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('filter', arguments); + var _parseFilterArgs = parseFilterArgs.apply(void 0, args), + shader = _parseFilterArgs.shader, + operation = _parseFilterArgs.operation, + value = _parseFilterArgs.value, + useWebGL = _parseFilterArgs.useWebGL; // when passed a shader, use it directly + if (this._renderer.isP3D && shader) { + _main.default.RendererGL.prototype.filter.call(this._renderer, shader); + return; + } // when opting out of webgl, use old pixels method + + if (!useWebGL && !this._renderer.isP3D) { + if (this.canvas !== undefined) { + _filters.default.apply(this.canvas, _filters.default[operation], value); + } else { + _filters.default.apply(this.elt, _filters.default[operation], value); + } + return; + } + if (!useWebGL && this._renderer.isP3D) { + console.warn('filter() with useWebGL=false is not supported in WEBGL'); + } // when this is a webgl renderer, apply constant shader filter + + if (this._renderer.isP3D) { + _main.default.RendererGL.prototype.filter.call(this._renderer, operation, value); + } // when this is P2D renderer, create/use hidden webgl renderer + else { + var filterGraphicsLayer = this.getFilterGraphicsLayer(); + // copy p2d canvas contents to secondary webgl renderer + // dest + filterGraphicsLayer.copy( // src + this._renderer, // src coods + 0, 0, this.width, this.height, // dest coords + - this.width / 2, - this.height / 2, this.width, this.height); + //clearing the main canvas + this._renderer.clear(); + this._renderer.resetMatrix(); + // filter it with shaders + filterGraphicsLayer.filter.apply(filterGraphicsLayer, args); + // copy secondary webgl renderer back to original p2d canvas + this._renderer._pInst.image(filterGraphicsLayer, 0, 0); + filterGraphicsLayer.clear(); // prevent feedback effects on p2d canvas + } + }; + function parseFilterArgs() { + var _ref; + // args could be: + // - operation, value, [useWebGL] + // - operation, [useWebGL] + // - shader + var result = { + shader: undefined, + operation: undefined, + value: undefined, + useWebGL: true + }; + if ((arguments.length <= 0 ? undefined : arguments[0]) instanceof _main.default.Shader) { + result.shader = arguments.length <= 0 ? undefined : arguments[0]; + return result; + } else { + result.operation = arguments.length <= 0 ? undefined : arguments[0]; + } + if (arguments.length > 1 && typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'number') { + result.value = arguments.length <= 1 ? undefined : arguments[1]; + } + if ((_ref = arguments.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]) === false) { + result.useWebGL = false; + } + return result; + } /** + * Gets a pixel or a region of pixels from the canvas. + * + * `get()` is easy to use but it's not as fast as + * pixels. Use pixels + * to read many pixel values. + * + * The version of `get()` with no parameters returns the entire canvas. + * + * The version of `get()` with two parameters interprets them as + * coordinates. It returns an array with the `[R, G, B, A]` values of the + * pixel at the given point. + * + * The version of `get()` with four parameters interprets them as coordinates + * and dimensions. It returns a subsection of the canvas as a + * p5.Image object. The first two parameters are the + * coordinates for the upper-left corner of the subsection. The last two + * parameters are the width and height of the subsection. + * + * Use p5.Image.get() to work directly with + * p5.Image objects. + * + * @method get + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number} w width of the subsection to be returned. + * @param {Number} h height of the subsection to be returned. + * @return {p5.Image} subsection as a p5.Image object. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = get(); + * image(c, width / 2, 0); + * + * describe('Two identical mountain landscapes shown side-by-side.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = get(50, 90); + * fill(c); + * noStroke(); + * square(25, 25, 50); + * + * describe('A mountain landscape with an olive green square in its center.'); + * } + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0); + * let c = get(0, 0, width / 2, height / 2); + * image(c, width / 2, height / 2); + * + * describe('A mountain landscape drawn on top of another mountain landscape.'); + * } + * + *
                              + */ + /** + * @method get + * @return {p5.Image} whole canvas as a p5.Image. + */ + /** + * @method get + * @param {Number} x + * @param {Number} y + * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. + */ + + _main.default.prototype.get = function (x, y, w, h) { + var _this$_renderer2; + _main.default._validateParameters('get', arguments); + return (_this$_renderer2 = this._renderer).get.apply(_this$_renderer2, arguments); + }; + /** + * Loads the current value of each pixel on the canvas into the + * pixels array. This + * function must be called before reading from or writing to + * pixels. + * + * @method loadPixels + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0, width, height); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * loadPixels(); + * for (let i = 0; i < halfImage; i += 1) { + * pixels[i + halfImage] = pixels[i]; + * } + * updatePixels(); + * + * describe('Two identical images of mountain landscapes, one on top of the other.'); + * } + * + *
                              + */ + _main.default.prototype.loadPixels = function () { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + _main.default._validateParameters('loadPixels', args); + this._renderer.loadPixels(); + }; + /** + * Sets the color of a pixel or draws an image to the canvas. + * + * `set()` is easy to use but it's not as fast as + * pixels. Use pixels + * to set many pixel values. + * + * `set()` interprets the first two parameters as x- and y-coordinates. It + * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel + * array, a p5.Color object, or a + * p5.Image object. If an image is passed, the first + * two parameters set the coordinates for the image's upper-left corner, + * regardless of the current imageMode(). + * + * updatePixels() must be called after using + * `set()` for changes to appear. + * + * @method set + * @param {Number} x x-coordinate of the pixel. + * @param {Number} y y-coordinate of the pixel. + * @param {Number|Number[]|Object} c grayscale value | pixel array | + * p5.Color object | p5.Image to copy. + * @example + *
                              + * + * set(30, 20, 0); + * set(85, 20, 0); + * set(85, 75, 0); + * set(30, 75, 0); + * updatePixels(); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                              + * + *
                              + * + * let black = color(0); + * set(30, 20, black); + * set(85, 20, black); + * set(85, 75, black); + * set(30, 75, black); + * updatePixels(); + * + * describe('Four black dots arranged in a square drawn on a gray background.'); + * + *
                              + * + *
                              + * + * for (let x = 0; x < width; x += 1) { + * for (let y = 0; y < height; y += 1) { + * let c = map(x, 0, width, 0, 255); + * set(x, y, c); + * } + * } + * updatePixels(); + * + * describe('A horiztonal color gradient from black to white.'); + * + *
                              + * + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * set(0, 0, img); + * updatePixels(); + * + * describe('An image of a mountain landscape.'); + * } + * + *
                              + */ + _main.default.prototype.set = function (x, y, imgOrCol) { + this._renderer.set(x, y, imgOrCol); + }; + /** + * Updates the canvas with the RGBA values in the + * pixels array. + * + * `updatePixels()` only needs to be called after changing values in the + * pixels array. Such changes can be made directly + * after calling loadPixels() or by calling + * set(). + * + * @method updatePixels + * @param {Number} [x] x-coordinate of the upper-left corner of region + * to update. + * @param {Number} [y] y-coordinate of the upper-left corner of region + * to update. + * @param {Number} [w] width of region to update. + * @param {Number} [h] height of region to update. + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/rockies.jpg'); + * } + * + * function setup() { + * image(img, 0, 0, width, height); + * let d = pixelDensity(); + * let halfImage = 4 * (d * width) * (d * height / 2); + * loadPixels(); + * for (let i = 0; i < halfImage; i += 1) { + * pixels[i + halfImage] = pixels[i]; + * } + * updatePixels(); + * + * describe('Two identical images of mountain landscapes, one on top of the other.'); + * } + * + *
                              + */ + _main.default.prototype.updatePixels = function (x, y, w, h) { + _main.default._validateParameters('updatePixels', arguments); + // graceful fail - if loadPixels() or set() has not been called, pixel + // array will be empty, ignore call to updatePixels() + if (this.pixels.length === 0) { + return; + } + this._renderer.updatePixels(x, y, w, h); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../color/p5.Color': 284, + '../core/main': 298, + './filters': 319, + 'core-js/modules/es.array.filter': 173 + } + ], + 324: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.last-index-of'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.from-entries'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/web.url'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.last-index-of'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.from-entries'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.promise'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/web.url'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + _dereq_('whatwg-fetch'); + _dereq_('es6-promise/auto'); + var _fetchJsonp = _interopRequireDefault(_dereq_('fetch-jsonp')); + var _fileSaver = _interopRequireDefault(_dereq_('file-saver')); + _dereq_('../core/friendly_errors/validate_params'); + _dereq_('../core/friendly_errors/file_errors'); + _dereq_('../core/friendly_errors/fes_core'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module IO + * @submodule Input + * @for p5 + * @requires core + */ + /** + * Loads a JSON file from a file or a URL, and returns an Object. + * Note that even if the JSON file contains an Array, an Object will be + * returned with index numbers as keys. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. JSONP is supported via a polyfill and you + * can pass in as the second argument an object with definitions of the json + * callback following the syntax specified here. + * + * This method is suitable for fetching files up to size of 64MB. + * @method loadJSON + * @param {String} path name of the file or url to load + * @param {Object} [jsonpOptions] options object for jsonp related settings + * @param {String} [datatype] "json" or "jsonp" + * @param {function} [callback] function to be executed after + * loadJSON() completes, data is passed + * in as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Object|Array} JSON data + * @example + * + * Calling loadJSON() inside preload() guarantees to complete the + * operation before setup() and draw() are called. + * + *
                              + * // Examples use USGS Earthquake API: + * // https://earthquake.usgs.gov/fdsnws/event/1/#methods + * let earthquakes; + * function preload() { + * // Get the most recent earthquake in the database + * let url = + 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + + * 'summary/all_day.geojson'; + * earthquakes = loadJSON(url); + * } + * + * function setup() { + * noLoop(); + * } + * + * function draw() { + * background(200); + * // Get the magnitude and name of the earthquake out of the loaded JSON + * let earthquakeMag = earthquakes.features[0].properties.mag; + * let earthquakeName = earthquakes.features[0].properties.place; + * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); + * textAlign(CENTER); + * text(earthquakeName, 0, height - 30, width, 30); + * describe(`50×50 ellipse that changes from black to white + * depending on the current humidity`); + * } + *
                              + * + * Outside of preload(), you may supply a callback function to handle the + * object: + *
                              + * function setup() { + * noLoop(); + * let url = + 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + + * 'summary/all_day.geojson'; + * loadJSON(url, drawEarthquake); + * } + * + * function draw() { + * background(200); + * describe(`50×50 ellipse that changes from black to white + * depending on the current humidity`); + * } + * + * function drawEarthquake(earthquakes) { + * // Get the magnitude and name of the earthquake out of the loaded JSON + * let earthquakeMag = earthquakes.features[0].properties.mag; + * let earthquakeName = earthquakes.features[0].properties.place; + * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); + * textAlign(CENTER); + * text(earthquakeName, 0, height - 30, width, 30); + * } + *
                              + */ + /** + * @method loadJSON + * @param {String} path + * @param {String} datatype + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Object|Array} + */ + /** + * @method loadJSON + * @param {String} path + * @param {function} callback + * @param {function} [errorCallback] + * @return {Object|Array} + */ + + _main.default.prototype.loadJSON = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('loadJSON', args); + var path = args[0]; + var callback; + var errorCallback; + var options; + var ret = { + }; // object needed for preload + var t = 'json'; + // check for explicit data type argument + for (var i = 1; i < args.length; i++) { + var arg = args[i]; + if (typeof arg === 'string') { + if (arg === 'jsonp' || arg === 'json') { + t = arg; + } + } else if (typeof arg === 'function') { + if (!callback) { + callback = arg; + } else { + errorCallback = arg; + } + } else if (_typeof(arg) === 'object' && (arg.hasOwnProperty('jsonpCallback') || arg.hasOwnProperty('jsonpCallbackFunction'))) { + t = 'jsonp'; + options = arg; + } + } + var self = this; + this.httpDo(path, 'GET', options, t, function (resp) { + for (var k in resp) { + ret[k] = resp[k]; + } + if (typeof callback !== 'undefined') { + callback(resp); + } + self._decrementPreload(); + }, function (err) { + // Error handling + _main.default._friendlyFileLoadError(5, path); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }); + return ret; + }; + /** + * Reads the contents of a file and creates a String array of its individual + * lines. If the name of the file is used as the parameter, as in the above + * example, the file must be located in the sketch directory/folder. + * + * Alternatively, the file may be loaded from anywhere on the local + * computer using an absolute path (something that starts with / on Unix and + * Linux, or a drive letter on Windows), or the filename parameter can be a + * URL for a file found on a network. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. + * + * This method is suitable for fetching files up to size of 64MB. + * @method loadStrings + * @param {String} filename name of the file or url to load + * @param {function} [callback] function to be executed after loadStrings() + * completes, Array is passed in as first + * argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {String[]} Array of Strings + * @example + * + * Calling loadStrings() inside preload() guarantees to complete the + * operation before setup() and draw() are called. + * + *
                              + * let result; + * function preload() { + * result = loadStrings('assets/test.txt'); + * } + + * function setup() { + * background(200); + * text(random(result), 10, 10, 80, 80); + * describe(`randomly generated text from a file, + * for example "i smell like butter"`); + * } + *
                              + * + * Outside of preload(), you may supply a callback function to handle the + * object: + * + *
                              + * function setup() { + * loadStrings('assets/test.txt', pickString); + * describe(`randomly generated text from a file, + * for example "i have three feet"`); + * } + * + * function pickString(result) { + * background(200); + * text(random(result), 10, 10, 80, 80); + * } + *
                              + */ + _main.default.prototype.loadStrings = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('loadStrings', args); + var ret = [ + ]; + var callback, + errorCallback; + for (var i = 1; i < args.length; i++) { + var arg = args[i]; + if (typeof arg === 'function') { + if (typeof callback === 'undefined') { + callback = arg; + } else if (typeof errorCallback === 'undefined') { + errorCallback = arg; + } + } + } + var self = this; + _main.default.prototype.httpDo.call(this, args[0], 'GET', 'text', function (data) { + // split lines handling mac/windows/linux endings + var lines = data.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/); + // safe insert approach which will not blow up stack when inserting + // >100k lines, but still be faster than iterating line-by-line. based on + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#Examples + var QUANTUM = 32768; + for (var _i = 0, len = lines.length; _i < len; _i += QUANTUM) { + Array.prototype.push.apply(ret, lines.slice(_i, Math.min(_i + QUANTUM, len))); + } + if (typeof callback !== 'undefined') { + callback(ret); + } + self._decrementPreload(); + }, function (err) { + // Error handling + _main.default._friendlyFileLoadError(3, arguments[0]); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }); + return ret; + }; + /** + * Reads the contents of a file or URL and creates a p5.Table object with + * its values. If a file is specified, it must be located in the sketch's + * "data" folder. The filename parameter can also be a URL to a file found + * online. By default, the file is assumed to be comma-separated (in CSV + * format). Table only looks for a header row if the 'header' option is + * included. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. Calling loadTable() inside preload() + * guarantees to complete the operation before setup() and draw() are called. + * Outside of preload(), you may supply a callback function to handle the + * object: + * + * All files loaded and saved use UTF-8 encoding. This method is suitable for fetching files up to size of 64MB. + * @method loadTable + * @param {String} filename name of the file or URL to load + * @param {String} [extension] parse the table by comma-separated values "csv", semicolon-separated + * values "ssv", or tab-separated values "tsv" + * @param {String} [header] "header" to indicate table has header row + * @param {function} [callback] function to be executed after + * loadTable() completes. On success, the + * Table object is passed in as the + * first argument. + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Object} Table object containing data + * + * @example + *
                              + * + * // Given the following CSV file called "mammals.csv" + * // located in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * //the file can be remote + * //table = loadTable("http://p5js.org/reference/assets/mammals.csv", + * // "csv", "header"); + * } + * + * function setup() { + * //count the columns + * print(table.getRowCount() + ' total rows in table'); + * print(table.getColumnCount() + ' total columns in table'); + * + * print(table.getColumn('name')); + * //["Goat", "Leopard", "Zebra"] + * + * //cycle through the table + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) { + * print(table.getString(r, c)); + * } + * describe(`randomly generated text from a file, + * for example "i smell like butter"`); + * } + * + *
                              + */ + _main.default.prototype.loadTable = function (path) { + // p5._validateParameters('loadTable', arguments); + var callback; + var errorCallback; + var options = [ + ]; + var header = false; + var ext = path.substring(path.lastIndexOf('.') + 1, path.length); + var sep; + if (ext === 'csv') { + sep = ','; + } else if (ext === 'ssv') { + sep = ';'; + } else if (ext === 'tsv') { + sep = '\t'; + } + for (var i = 1; i < arguments.length; i++) { + if (typeof arguments[i] === 'function') { + if (typeof callback === 'undefined') { + callback = arguments[i]; + } else if (typeof errorCallback === 'undefined') { + errorCallback = arguments[i]; + } + } else if (typeof arguments[i] === 'string') { + options.push(arguments[i]); + if (arguments[i] === 'header') { + header = true; + } + if (arguments[i] === 'csv') { + sep = ','; + } else if (arguments[i] === 'ssv') { + sep = ';'; + } else if (arguments[i] === 'tsv') { + sep = '\t'; + } + } + } + var t = new _main.default.Table(); + var self = this; + this.httpDo(path, 'GET', 'table', function (resp) { + var state = { + }; + // define constants + var PRE_TOKEN = 0, + MID_TOKEN = 1, + POST_TOKEN = 2, + POST_RECORD = 4; + var QUOTE = '"', + CR = '\r', + LF = '\n'; + var records = [ + ]; + var offset = 0; + var currentRecord = null; + var currentChar; + var tokenBegin = function tokenBegin() { + state.currentState = PRE_TOKEN; + state.token = ''; + }; + var tokenEnd = function tokenEnd() { + currentRecord.push(state.token); + tokenBegin(); + }; + var recordBegin = function recordBegin() { + state.escaped = false; + currentRecord = [ + ]; + tokenBegin(); + }; + var recordEnd = function recordEnd() { + state.currentState = POST_RECORD; + records.push(currentRecord); + currentRecord = null; + }; + for (; ; ) { + currentChar = resp[offset++]; + // EOF + if (currentChar == null) { + if (state.escaped) { + throw new Error('Unclosed quote in file.'); + } + if (currentRecord) { + tokenEnd(); + recordEnd(); + break; + } + } + if (currentRecord === null) { + recordBegin(); + } // Handle opening quote + + if (state.currentState === PRE_TOKEN) { + if (currentChar === QUOTE) { + state.escaped = true; + state.currentState = MID_TOKEN; + continue; + } + state.currentState = MID_TOKEN; + } // mid-token and escaped, look for sequences and end quote + + if (state.currentState === MID_TOKEN && state.escaped) { + if (currentChar === QUOTE) { + if (resp[offset] === QUOTE) { + state.token += QUOTE; + offset++; + } else { + state.escaped = false; + state.currentState = POST_TOKEN; + } + } else if (currentChar === CR) { + continue; + } else { + state.token += currentChar; + } + continue; + } // fall-through: mid-token or post-token, not escaped + + if (currentChar === CR) { + if (resp[offset] === LF) { + offset++; + } + tokenEnd(); + recordEnd(); + } else if (currentChar === LF) { + tokenEnd(); + recordEnd(); + } else if (currentChar === sep) { + tokenEnd(); + } else if (state.currentState === MID_TOKEN) { + state.token += currentChar; + } + } // set up column names + + if (header) { + t.columns = records.shift(); + } else { + for (var _i2 = 0; _i2 < records[0].length; _i2++) { + t.columns[_i2] = 'null'; + } + } + var row; + for (var _i3 = 0; _i3 < records.length; _i3++) { + //Handles row of 'undefined' at end of some CSVs + if (records[_i3].length === 1) { + if (records[_i3][0] === 'undefined' || records[_i3][0] === '') { + continue; + } + } + row = new _main.default.TableRow(); + row.arr = records[_i3]; + row.obj = makeObject(records[_i3], t.columns); + t.addRow(row); + } + if (typeof callback === 'function') { + callback(t); + } + self._decrementPreload(); + }, function (err) { + // Error handling + _main.default._friendlyFileLoadError(2, path); + if (errorCallback) { + errorCallback(err); + } else { + console.error(err); + } + }); + return t; + }; + // helper function to turn a row into a JSON object + function makeObject(row, headers) { + headers = headers || [ + ]; + if (typeof headers === 'undefined') { + for (var j = 0; j < row.length; j++) { + headers[j.toString()] = j; + } + } + return Object.fromEntries(headers.map(function (key, i) { + return [key, + row[i]]; + })); + } /** + * Reads the contents of a file and creates an XML object with its values. + * If the name of the file is used as the parameter, as in the above example, + * the file must be located in the sketch directory/folder. + * + * Alternatively, the file maybe be loaded from anywhere on the local + * computer using an absolute path (something that starts with / on Unix and + * Linux, or a drive letter on Windows), or the filename parameter can be a + * URL for a file found on a network. + * + * This method is asynchronous, meaning it may not finish before the next + * line in your sketch is executed. Calling loadXML() inside preload() + * guarantees to complete the operation before setup() and draw() are called. + * + * Outside of preload(), you may supply a callback function to handle the + * object. + * + * This method is suitable for fetching files up to size of 64MB. + * @method loadXML + * @param {String} filename name of the file or URL to load + * @param {function} [callback] function to be executed after loadXML() + * completes, XML object is passed in as + * first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Object} XML object containing data + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let children = xml.getChildren('animal'); + * + * for (let i = 0; i < children.length; i++) { + * let id = children[i].getNum('id'); + * let coloring = children[i].getString('species'); + * let name = children[i].getContent(); + * print(id + ', ' + coloring + ', ' + name); + * } + * describe('no image displayed'); + * } + * + * // Sketch prints: + * // 0, Capra hircus, Goat + * // 1, Panthera pardus, Leopard + * // 2, Equus zebra, Zebra + *
                              + */ + + _main.default.prototype.loadXML = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + var ret = new _main.default.XML(); + var callback, + errorCallback; + for (var i = 1; i < args.length; i++) { + var arg = args[i]; + if (typeof arg === 'function') { + if (typeof callback === 'undefined') { + callback = arg; + } else if (typeof errorCallback === 'undefined') { + errorCallback = arg; + } + } + } + var self = this; + this.httpDo(args[0], 'GET', 'xml', function (xml) { + for (var key in xml) { + ret[key] = xml[key]; + } + if (typeof callback !== 'undefined') { + callback(ret); + } + self._decrementPreload(); + }, function (err) { + // Error handling + _main.default._friendlyFileLoadError(1, arguments[0]); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }); + return ret; + }; + /** + * This method is suitable for fetching files up to size of 64MB. + * @method loadBytes + * @param {string} file name of the file or URL to load + * @param {function} [callback] function to be executed after loadBytes() + * completes + * @param {function} [errorCallback] function to be executed if there + * is an error + * @returns {Object} an object whose 'bytes' property will be the loaded buffer + * + * @example + *
                              + * let data; + * + * function preload() { + * data = loadBytes('assets/mammals.xml'); + * } + * + * function setup() { + * for (let i = 0; i < 5; i++) { + * console.log(data.bytes[i].toString(16)); + * } + * describe('no image displayed'); + * } + *
                              + */ + _main.default.prototype.loadBytes = function (file, callback, errorCallback) { + var ret = { + }; + var self = this; + this.httpDo(file, 'GET', 'arrayBuffer', function (arrayBuffer) { + ret.bytes = new Uint8Array(arrayBuffer); + if (typeof callback === 'function') { + callback(ret); + } + self._decrementPreload(); + }, function (err) { + // Error handling + _main.default._friendlyFileLoadError(6, file); + if (errorCallback) { + errorCallback(err); + } else { + throw err; + } + }); + return ret; + }; + /** + * Method for executing an HTTP GET request. If data type is not specified, + * p5 will try to guess based on the URL, defaulting to text. This is equivalent to + * calling httpDo(path, 'GET'). The 'binary' datatype will return + * a Blob object, and the 'arrayBuffer' datatype will return an ArrayBuffer + * which can be used to initialize typed arrays (such as Uint8Array). + * + * @method httpGet + * @param {String} path name of the file or url to load + * @param {String} [datatype] "json", "jsonp", "binary", "arrayBuffer", + * "xml", or "text" + * @param {Object|Boolean} [data] param data passed sent with request + * @param {function} [callback] function to be executed after + * httpGet() completes, data is passed in + * as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Promise} A promise that resolves with the data when the operation + * completes successfully or rejects with the error after + * one occurs. + * @example + *
                              + * // Examples use USGS Earthquake API: + * // https://earthquake.usgs.gov/fdsnws/event/1/#methods + * let earthquakes; + * function preload() { + * // Get the most recent earthquake in the database + * let url = + 'https://earthquake.usgs.gov/fdsnws/event/1/query?' + + * 'format=geojson&limit=1&orderby=time'; + * httpGet(url, 'jsonp', false, function(response) { + * // when the HTTP request completes, populate the variable that holds the + * // earthquake data used in the visualization. + * earthquakes = response; + * }); + * } + * + * function draw() { + * if (!earthquakes) { + * // Wait until the earthquake data has loaded before drawing. + * return; + * } + * background(200); + * // Get the magnitude and name of the earthquake out of the loaded JSON + * let earthquakeMag = earthquakes.features[0].properties.mag; + * let earthquakeName = earthquakes.features[0].properties.place; + * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); + * textAlign(CENTER); + * text(earthquakeName, 0, height - 30, width, 30); + * noLoop(); + * } + *
                              + */ + /** + * @method httpGet + * @param {String} path + * @param {Object|Boolean} data + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Promise} + */ + /** + * @method httpGet + * @param {String} path + * @param {function} callback + * @param {function} [errorCallback] + * @return {Promise} + */ + _main.default.prototype.httpGet = function () { + _main.default._validateParameters('httpGet', arguments); + var args = Array.prototype.slice.call(arguments); + args.splice(1, 0, 'GET'); + return _main.default.prototype.httpDo.apply(this, args); + }; + /** + * Method for executing an HTTP POST request. If data type is not specified, + * p5 will try to guess based on the URL, defaulting to text. This is equivalent to + * calling httpDo(path, 'POST'). + * + * @method httpPost + * @param {String} path name of the file or url to load + * @param {String} [datatype] "json", "jsonp", "xml", or "text". + * If omitted, httpPost() will guess. + * @param {Object|Boolean} [data] param data passed sent with request + * @param {function} [callback] function to be executed after + * httpPost() completes, data is passed in + * as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Promise} A promise that resolves with the data when the operation + * completes successfully or rejects with the error after + * one occurs. + * + * @example + *
                              + * + * // Examples use jsonplaceholder.typicode.com for a Mock Data API + * + * let url = 'https://jsonplaceholder.typicode.com/posts'; + * let postData = { userId: 1, title: 'p5 Clicked!', body: 'p5.js is very cool.' }; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * } + * + * function mousePressed() { + * httpPost(url, 'json', postData, function(result) { + * strokeWeight(2); + * text(result.body, mouseX, mouseY); + * }); + * } + * + *
                              + * + *
                              + * let url = 'ttps://invalidURL'; // A bad URL that will cause errors + * let postData = { title: 'p5 Clicked!', body: 'p5.js is very cool.' }; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * } + * + * function mousePressed() { + * httpPost( + * url, + * 'json', + * postData, + * function(result) { + * // ... won't be called + * }, + * function(error) { + * strokeWeight(2); + * text(error.toString(), mouseX, mouseY); + * } + * ); + * } + *
                              + */ + /** + * @method httpPost + * @param {String} path + * @param {Object|Boolean} data + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Promise} + */ + /** + * @method httpPost + * @param {String} path + * @param {function} callback + * @param {function} [errorCallback] + * @return {Promise} + */ + _main.default.prototype.httpPost = function () { + _main.default._validateParameters('httpPost', arguments); + var args = Array.prototype.slice.call(arguments); + args.splice(1, 0, 'POST'); + return _main.default.prototype.httpDo.apply(this, args); + }; + /** + * Method for executing an HTTP request. If data type is not specified, + * p5 will try to guess based on the URL, defaulting to text.

                              + * For more advanced use, you may also pass in the path as the first argument + * and a object as the second argument, the signature follows the one specified + * in the Fetch API specification. + * This method is suitable for fetching files up to size of 64MB when "GET" is used. + * + * @method httpDo + * @param {String} path name of the file or url to load + * @param {String} [method] either "GET", "POST", or "PUT", + * defaults to "GET" + * @param {String} [datatype] "json", "jsonp", "xml", or "text" + * @param {Object} [data] param data passed sent with request + * @param {function} [callback] function to be executed after + * httpGet() completes, data is passed in + * as first argument + * @param {function} [errorCallback] function to be executed if + * there is an error, response is passed + * in as first argument + * @return {Promise} A promise that resolves with the data when the operation + * completes successfully or rejects with the error after + * one occurs. + * + * @example + *
                              + * + * // Examples use USGS Earthquake API: + * // https://earthquake.usgs.gov/fdsnws/event/1/#methods + * + * // displays an animation of all USGS earthquakes + * let earthquakes; + * let eqFeatureIndex = 0; + * + * function preload() { + * let url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson'; + * httpDo( + * url, + * { + * method: 'GET', + * // Other Request options, like special headers for apis + * headers: { authorization: 'Bearer secretKey' } + * }, + * function(res) { + * earthquakes = res; + * } + * ); + * } + * + * function draw() { + * // wait until the data is loaded + * if (!earthquakes || !earthquakes.features[eqFeatureIndex]) { + * return; + * } + * clear(); + * + * let feature = earthquakes.features[eqFeatureIndex]; + * let mag = feature.properties.mag; + * let rad = mag / 11 * ((width + height) / 2); + * fill(255, 0, 0, 100); + * ellipse(width / 2 + random(-2, 2), height / 2 + random(-2, 2), rad, rad); + * + * if (eqFeatureIndex >= earthquakes.features.length) { + * eqFeatureIndex = 0; + * } else { + * eqFeatureIndex += 1; + * } + * } + * + *
                              + */ + /** + * @method httpDo + * @param {String} path + * @param {Object} options Request object options as documented in the + * "fetch" API + * reference + * @param {function} [callback] + * @param {function} [errorCallback] + * @return {Promise} + */ + _main.default.prototype.httpDo = function () { + var type; + var callback; + var errorCallback; + var request; + var promise; + var jsonpOptions = { + }; + var cbCount = 0; + var contentType = 'text/plain'; + // Trim the callbacks off the end to get an idea of how many arguments are passed + for (var i = arguments.length - 1; i > 0; i--) { + if (typeof (i < 0 || arguments.length <= i ? undefined : arguments[i]) === 'function') { + cbCount++; + } else { + break; + } + } // The number of arguments minus callbacks + + var argsCount = arguments.length - cbCount; + var path = arguments.length <= 0 ? undefined : arguments[0]; + if (argsCount === 2 && typeof path === 'string' && _typeof(arguments.length <= 1 ? undefined : arguments[1]) === 'object') { + // Intended for more advanced use, pass in Request parameters directly + request = new Request(path, arguments.length <= 1 ? undefined : arguments[1]); + callback = arguments.length <= 2 ? undefined : arguments[2]; + errorCallback = arguments.length <= 3 ? undefined : arguments[3]; + } else { + // Provided with arguments + var method = 'GET'; + var data; + for (var j = 1; j < arguments.length; j++) { + var a = j < 0 || arguments.length <= j ? undefined : arguments[j]; + if (typeof a === 'string') { + if (a === 'GET' || a === 'POST' || a === 'PUT' || a === 'DELETE') { + method = a; + } else if (a === 'json' || a === 'jsonp' || a === 'binary' || a === 'arrayBuffer' || a === 'xml' || a === 'text' || a === 'table') { + type = a; + } else { + data = a; + } + } else if (typeof a === 'number') { + data = a.toString(); + } else if (_typeof(a) === 'object') { + if (a.hasOwnProperty('jsonpCallback') || a.hasOwnProperty('jsonpCallbackFunction')) { + for (var attr in a) { + jsonpOptions[attr] = a[attr]; + } + } else if (a instanceof _main.default.XML) { + data = a.serialize(); + contentType = 'application/xml'; + } else { + data = JSON.stringify(a); + contentType = 'application/json'; + } + } else if (typeof a === 'function') { + if (!callback) { + callback = a; + } else { + errorCallback = a; + } + } + } + var headers = method === 'GET' ? new Headers() : new Headers({ + 'Content-Type': contentType + }); + request = new Request(path, { + method: method, + mode: 'cors', + body: data, + headers: headers + }); + } // do some sort of smart type checking + + if (!type) { + if (path.includes('json')) { + type = 'json'; + } else if (path.includes('xml')) { + type = 'xml'; + } else { + type = 'text'; + } + } + if (type === 'jsonp') { + promise = (0, _fetchJsonp.default) (path, jsonpOptions); + } else { + promise = fetch(request); + } + promise = promise.then(function (res) { + if (!res.ok) { + var err = new Error(res.body); + err.status = res.status; + err.ok = false; + throw err; + } else { + var fileSize = 0; + if (type !== 'jsonp') { + fileSize = res.headers.get('content-length'); + } + if (fileSize && fileSize > 64000000) { + _main.default._friendlyFileLoadError(7, path); + } + switch (type) { + case 'json': + case 'jsonp': + return res.json(); + case 'binary': + return res.blob(); + case 'arrayBuffer': + return res.arrayBuffer(); + case 'xml': + return res.text().then(function (text) { + var parser = new DOMParser(); + var xml = parser.parseFromString(text, 'text/xml'); + return new _main.default.XML(xml.documentElement); + }); + default: + return res.text(); + } + } + }); + promise.then(callback || function () { + }); + promise.catch(errorCallback || console.error); + return promise; + }; + /** + * @module IO + * @submodule Output + * @for p5 + */ + window.URL = window.URL || window.webkitURL; + // private array of p5.PrintWriter objects + _main.default.prototype._pWriters = [ + ]; + /** + * @method createWriter + * @param {String} name name of the file to be created + * @param {String} [extension] + * @return {p5.PrintWriter} + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * const writer = createWriter('squares.txt'); + * for (let i = 0; i < 10; i++) { + * writer.print(i * i); + * } + * writer.close(); + * writer.clear(); + * } + * } + * + *
                              + */ + _main.default.prototype.createWriter = function (name, extension) { + var newPW; + // check that it doesn't already exist + for (var i in _main.default.prototype._pWriters) { + if (_main.default.prototype._pWriters[i].name === name) { + // if a p5.PrintWriter w/ this name already exists... + // return p5.prototype._pWriters[i]; // return it w/ contents intact. + // or, could return a new, empty one with a unique name: + newPW = new _main.default.PrintWriter(name + this.millis(), extension); + _main.default.prototype._pWriters.push(newPW); + return newPW; + } + } + newPW = new _main.default.PrintWriter(name, extension); + _main.default.prototype._pWriters.push(newPW); + return newPW; + }; + /** + * @class p5.PrintWriter + * @param {String} filename + * @param {String} [extension] + */ + _main.default.PrintWriter = function (filename, extension) { + var self = this; + this.name = filename; + this.content = ''; + //Changed to write because it was being overloaded by function below. + /** + * Writes data to the PrintWriter stream + * @method write + * @param {Array} data all data to be written by the PrintWriter + * @example + *
                              + * + * // creates a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // write 'Hello world!'' to the file + * writer.write(['Hello world!']); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                              + *
                              + * + * // creates a file called 'newFile2.txt' + * let writer = createWriter('newFile2.txt'); + * // write 'apples,bananas,123' to the file + * writer.write(['apples', 'bananas', 123]); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                              + *
                              + * + * // creates a file called 'newFile3.txt' + * let writer = createWriter('newFile3.txt'); + * // write 'My name is: Teddy' to the file + * writer.write('My name is:'); + * writer.write(' Teddy'); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                              + *
                              + * + * function setup() { + * createCanvas(100, 100); + * button = createButton('SAVE FILE'); + * button.position(21, 40); + * button.mousePressed(createFile); + * } + * + * function createFile() { + * // creates a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // write 'Hello world!'' to the file + * writer.write(['Hello world!']); + * // close the PrintWriter and save the file + * writer.close(); + * } + * + *
                              + */ + this.write = function (data) { + this.content += data; + }; + /** + * Writes data to the PrintWriter stream, and adds a new line at the end + * @method print + * @param {Array} data all data to be printed by the PrintWriter + * @example + *
                              + * + * // creates a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // creates a file containing + * // My name is: + * // Teddy + * writer.print('My name is:'); + * writer.print('Teddy'); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                              + *
                              + * + * let writer; + * + * function setup() { + * createCanvas(400, 400); + * // create a PrintWriter + * writer = createWriter('newFile.txt'); + * } + * + * function draw() { + * writer.print([mouseX, mouseY]); + * } + * + * function mouseClicked() { + * writer.close(); + * } + * + *
                              + */ + this.print = function (data) { + this.content += ''.concat(data, '\n'); + }; + /** + * Clears the data already written to the PrintWriter object + * @method clear + * @example + *
                              + * // create writer object + * let writer = createWriter('newFile.txt'); + * writer.write(['clear me']); + * // clear writer object here + * writer.clear(); + * // close writer + * writer.close(); + *
                              + *
                              + * + * function setup() { + * button = createButton('CLEAR ME'); + * button.position(21, 40); + * button.mousePressed(createFile); + * } + * + * function createFile() { + * let writer = createWriter('newFile.txt'); + * writer.write(['clear me']); + * writer.clear(); + * writer.close(); + * } + * + *
                              + * + */ + this.clear = function () { + this.content = ''; + }; + /** + * Closes the PrintWriter + * @method close + * @example + *
                              + * + * // create a file called 'newFile.txt' + * let writer = createWriter('newFile.txt'); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                              + *
                              + * + * // create a file called 'newFile2.txt' + * let writer = createWriter('newFile2.txt'); + * // write some data to the file + * writer.write([100, 101, 102]); + * // close the PrintWriter and save the file + * writer.close(); + * + *
                              + */ + this.close = function () { + // convert String to Array for the writeFile Blob + var arr = [ + ]; + arr.push(this.content); + _main.default.prototype.writeFile(arr, filename, extension); + // remove from _pWriters array and delete self + for (var i in _main.default.prototype._pWriters) { + if (_main.default.prototype._pWriters[i].name === this.name) { + // remove from _pWriters array + _main.default.prototype._pWriters.splice(i, 1); + } + } + self.clear(); + self = { + }; + }; + }; + /** + * @module IO + * @submodule Output + * @for p5 + */ + // object, filename, options --> saveJSON, saveStrings, + // filename, [extension] [canvas] --> saveImage + /** + * Saves a given element(image, text, json, csv, wav, or html) to the client's + * computer. The first parameter can be a pointer to element we want to save. + * The element can be one of p5.Element,an Array of + * Strings, an Array of JSON, a JSON object, a p5.Table + * , a p5.Image, or a p5.SoundFile (requires + * p5.sound). The second parameter is a filename (including extension).The + * third parameter is for options specific to this type of object. This method + * will save a file that fits the given parameters. + * If it is called without specifying an element, by default it will save the + * whole canvas as an image file. You can optionally specify a filename as + * the first parameter in such a case. + * **Note that it is not recommended to + * call this method within draw, as it will open a new save dialog on every + * render.** + * + * @method save + * @param {Object|String} [objectOrFilename] If filename is provided, will + * save canvas as an image with + * either png or jpg extension + * depending on the filename. + * If object is provided, will + * save depending on the object + * and filename (see examples + * above). + * @param {String} [filename] If an object is provided as the first + * parameter, then the second parameter + * indicates the filename, + * and should include an appropriate + * file extension (see examples above). + * @param {Boolean|String} [options] Additional options depend on + * filetype. For example, when saving JSON, + * true indicates that the + * output will be optimized for filesize, + * rather than readability. + * + * @example + *
                              + * // Saves the canvas as an image + * cnv = createCanvas(300, 300); + * save(cnv, 'myCanvas.jpg'); + * + * // Saves the canvas as an image by default + * save('myCanvas.jpg'); + * describe('An example for saving a canvas as an image.'); + *
                              + * + *
                              + * // Saves p5.Image as an image + * img = createImage(10, 10); + * save(img, 'myImage.png'); + * describe('An example for saving a p5.Image element as an image.'); + *
                              + * + *
                              + * // Saves p5.Renderer object as an image + * obj = createGraphics(100, 100); + * save(obj, 'myObject.png'); + * describe('An example for saving a p5.Renderer element.'); + *
                              + * + *
                              + * let myTable = new p5.Table(); + * // Saves table as html file + * save(myTable, 'myTable.html'); + * + * // Comma Separated Values + * save(myTable, 'myTable.csv'); + * + * // Tab Separated Values + * save(myTable, 'myTable.tsv'); + * + * describe(`An example showing how to save a table in formats of + * HTML, CSV and TSV.`); + *
                              + * + *
                              + * let myJSON = { a: 1, b: true }; + * + * // Saves pretty JSON + * save(myJSON, 'my.json'); + * + * // Optimizes JSON filesize + * save(myJSON, 'my.json', true); + * + * describe('An example for saving JSON to a txt file with some extra arguments.'); + *
                              + * + *
                              + * // Saves array of strings to text file with line breaks after each item + * let arrayOfStrings = ['a', 'b']; + * save(arrayOfStrings, 'my.txt'); + * describe(`An example for saving an array of strings to text file + * with line breaks.`); + *
                              + */ + _main.default.prototype.save = function (object, _filename, _options) { + // parse the arguments and figure out which things we are saving + var args = arguments; + // ================================================= + // OPTION 1: saveCanvas... + // if no arguments are provided, save canvas + var cnv = this._curElement ? this._curElement.elt : this.elt; + if (args.length === 0) { + _main.default.prototype.saveCanvas(cnv); + return; + } else if (args[0] instanceof _main.default.Renderer || args[0] instanceof _main.default.Graphics) { + // otherwise, parse the arguments + // if first param is a p5Graphics, then saveCanvas + _main.default.prototype.saveCanvas(args[0].elt, args[1], args[2]); + return; + } else if (args.length === 1 && typeof args[0] === 'string') { + // if 1st param is String and only one arg, assume it is canvas filename + _main.default.prototype.saveCanvas(cnv, args[0]); + } else { + // ================================================= + // OPTION 2: extension clarifies saveStrings vs. saveJSON + var extension = _checkFileExtension(args[1], args[2]) [1]; + switch (extension) { + case 'json': + _main.default.prototype.saveJSON(args[0], args[1], args[2]); + return; + case 'txt': + _main.default.prototype.saveStrings(args[0], args[1], args[2]); + return; + // ================================================= + // OPTION 3: decide based on object... + default: + if (args[0] instanceof Array) { + _main.default.prototype.saveStrings(args[0], args[1], args[2]); + } else if (args[0] instanceof _main.default.Table) { + _main.default.prototype.saveTable(args[0], args[1], args[2]); + } else if (args[0] instanceof _main.default.Image) { + _main.default.prototype.saveCanvas(args[0].canvas, args[1]); + } else if (args[0] instanceof _main.default.SoundFile) { + _main.default.prototype.saveSound(args[0], args[1], args[2], args[3]); + } + } + } + }; + /** + * Writes the contents of an Array or a JSON object to a .json file. + * The file saving process and location of the saved file will + * vary between web browsers. + * + * @method saveJSON + * @param {Array|Object} json + * @param {String} filename + * @param {Boolean} [optimize] If true, removes line breaks + * and spaces from the output + * file to optimize filesize + * (but not readability). + * @example + *
                              + * let json = {}; // new JSON Object + * + * json.id = 0; + * json.species = 'Panthera leo'; + * json.name = 'Lion'; + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * describe('no image displayed'); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * saveJSON(json, 'lion.json'); + * } + * } + * + * // saves the following to a file called "lion.json": + * // { + * // "id": 0, + * // "species": "Panthera leo", + * // "name": "Lion" + * // } + *
                              + */ + _main.default.prototype.saveJSON = function (json, filename, opt) { + _main.default._validateParameters('saveJSON', arguments); + var stringify; + if (opt) { + stringify = JSON.stringify(json); + } else { + stringify = JSON.stringify(json, undefined, 2); + } + this.saveStrings(stringify.split('\n'), filename, 'json'); + }; + _main.default.prototype.saveJSONObject = _main.default.prototype.saveJSON; + _main.default.prototype.saveJSONArray = _main.default.prototype.saveJSON; + /** + * Writes an array of Strings to a text file, one line per String. + * The file saving process and location of the saved file will + * vary between web browsers. + * + * @method saveStrings + * @param {String[]} list string array to be written + * @param {String} filename filename for output + * @param {String} [extension] the filename's extension + * @param {Boolean} [isCRLF] if true, change line-break to CRLF + * @example + *
                              + * let words = 'apple bear cat dog'; + * + * // .split() outputs an Array + * let list = split(words, ' '); + * + * function setup() { + * createCanvas(100, 100); + * background(200); + * text('click here to save', 10, 10, 70, 80); + * describe('no image displayed'); + * } + * + * function mousePressed() { + * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { + * saveStrings(list, 'nouns.txt'); + * } + * } + * + * // Saves the following to a file called 'nouns.txt': + * // + * // apple + * // bear + * // cat + * // dog + *
                              + */ + _main.default.prototype.saveStrings = function (list, filename, extension, isCRLF) { + _main.default._validateParameters('saveStrings', arguments); + var ext = extension || 'txt'; + var pWriter = this.createWriter(filename, ext); + for (var i = 0; i < list.length; i++) { + isCRLF ? pWriter.write(list[i] + '\r\n') : pWriter.write(list[i] + '\n'); + } + pWriter.close(); + pWriter.clear(); + }; + // ======= + // HELPERS + // ======= + function escapeHelper(content) { + return content.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); + } /** + * Writes the contents of a Table object to a file. Defaults to a + * text file with comma-separated-values ('csv') but can also + * use tab separation ('tsv'), or generate an HTML table ('html'). + * The file saving process and location of the saved file will + * vary between web browsers. + * + * @method saveTable + * @param {p5.Table} Table the Table object to save to a file + * @param {String} filename the filename to which the Table should be saved + * @param {String} [options] can be one of "tsv", "csv", or "html" + * @example + *
                              + * let table; + * + * function setup() { + * table = new p5.Table(); + * + * table.addColumn('id'); + * table.addColumn('species'); + * table.addColumn('name'); + * + * let newRow = table.addRow(); + * newRow.setNum('id', table.getRowCount() - 1); + * newRow.setString('species', 'Panthera leo'); + * newRow.setString('name', 'Lion'); + * + * // To save, un-comment next line then click 'run' + * // saveTable(table, 'new.csv'); + * + * describe('no image displayed'); + * } + * + * // Saves the following to a file called 'new.csv': + * // id,species,name + * // 0,Panthera leo,Lion + *
                              + */ + + _main.default.prototype.saveTable = function (table, filename, options) { + _main.default._validateParameters('saveTable', arguments); + var ext; + if (options === undefined) { + ext = filename.substring(filename.lastIndexOf('.') + 1, filename.length); + } else { + ext = options; + } + var pWriter = this.createWriter(filename, ext); + var header = table.columns; + var sep = ','; // default to CSV + if (ext === 'tsv') { + sep = '\t'; + } + if (ext !== 'html') { + // make header if it has values + if (header[0] !== '0') { + for (var h = 0; h < header.length; h++) { + if (h < header.length - 1) { + pWriter.write(header[h] + sep); + } else { + pWriter.write(header[h]); + } + } + pWriter.write('\n'); + } // make rows + + for (var i = 0; i < table.rows.length; i++) { + var j = void 0; + for (j = 0; j < table.rows[i].arr.length; j++) { + if (j < table.rows[i].arr.length - 1) { + //double quotes should be inserted in csv only if contains comma separated single value + if (ext === 'csv' && String(table.rows[i].arr[j]).includes(',')) { + pWriter.write('"' + table.rows[i].arr[j] + '"' + sep); + } else { + pWriter.write(table.rows[i].arr[j] + sep); + } + } else { + //double quotes should be inserted in csv only if contains comma separated single value + if (ext === 'csv' && String(table.rows[i].arr[j]).includes(',')) { + pWriter.write('"' + table.rows[i].arr[j] + '"'); + } else { + pWriter.write(table.rows[i].arr[j]); + } + } + } + pWriter.write('\n'); + } + } else { + // otherwise, make HTML + pWriter.print(''); + pWriter.print(''); + var str = ' '); + pWriter.print(''); + pWriter.print(' '); + // make header if it has values + if (header[0] !== '0') { + pWriter.print(' '); + for (var k = 0; k < header.length; k++) { + var e = escapeHelper(header[k]); + pWriter.print(' '); + } + pWriter.print(' '); + } // make rows + + for (var row = 0; row < table.rows.length; row++) { + pWriter.print(' '); + for (var col = 0; col < table.columns.length; col++) { + var entry = table.rows[row].getString(col); + var htmlEntry = escapeHelper(entry); + pWriter.print(' '); + } + pWriter.print(' '); + } + pWriter.print('
                              '.concat(e)); + pWriter.print('
                              '.concat(htmlEntry)); + pWriter.print('
                              '); + pWriter.print(''); + pWriter.print(''); + } // close and clear the pWriter + + pWriter.close(); + pWriter.clear(); + }; // end saveTable() + /** + * Generate a blob of file data as a url to prepare for download. + * Accepts an array of data, a filename, and an extension (optional). + * This is a private function because it does not do any formatting, + * but it is used by saveStrings, saveJSON, saveTable etc. + * + * @param {Array} dataToDownload + * @param {String} filename + * @param {String} [extension] + * @private + */ + _main.default.prototype.writeFile = function (dataToDownload, filename, extension) { + var type = 'application/octet-stream'; + if (_main.default.prototype._isSafari()) { + type = 'text/plain'; + } + var blob = new Blob(dataToDownload, { + type: type + }); + _main.default.prototype.downloadFile(blob, filename, extension); + }; + /** + * Forces download. Accepts a url to filedata/blob, a filename, + * and an extension (optional). + * This is a private function because it does not do any formatting, + * but it is used by saveStrings, saveJSON, saveTable etc. + * + * @method downloadFile + * @private + * @param {String|Blob} data either an href generated by createObjectURL, + * or a Blob object containing the data + * @param {String} [filename] + * @param {String} [extension] + */ + _main.default.prototype.downloadFile = function (data, fName, extension) { + var fx = _checkFileExtension(fName, extension); + var filename = fx[0]; + if (data instanceof Blob) { + _fileSaver.default.saveAs(data, filename); + return; + } + var a = document.createElement('a'); + a.href = data; + a.download = filename; + // Firefox requires the link to be added to the DOM before click() + a.onclick = function (e) { + destroyClickedElement(e); + e.stopPropagation(); + }; + a.style.display = 'none'; + document.body.appendChild(a); + // Safari will open this file in the same page as a confusing Blob. + if (_main.default.prototype._isSafari()) { + var aText = 'Hello, Safari user! To download this file...\n'; + aText += '1. Go to File --> Save As.\n'; + aText += '2. Choose "Page Source" as the Format.\n'; + aText += '3. Name it with this extension: ."'.concat(fx[1], '"'); + alert(aText); + } + a.click(); + }; + /** + * Returns a file extension, or another string + * if the provided parameter has no extension. + * + * @param {String} filename + * @param {String} [extension] + * @return {String[]} [fileName, fileExtension] + * + * @private + */ + function _checkFileExtension(filename, extension) { + if (!extension || extension === true || extension === 'true') { + extension = ''; + } + if (!filename) { + filename = 'untitled'; + } + var ext = ''; + // make sure the file will have a name, see if filename needs extension + if (filename && filename.includes('.')) { + ext = filename.split('.').pop(); + } // append extension if it doesn't exist + + if (extension) { + if (ext !== extension) { + ext = extension; + filename = ''.concat(filename, '.').concat(ext); + } + } + return [filename, + ext]; + } + _main.default.prototype._checkFileExtension = _checkFileExtension; + /** + * Returns true if the browser is Safari, false if not. + * Safari makes trouble for downloading files. + * + * @return {Boolean} [description] + * @private + */ + _main.default.prototype._isSafari = function () { + var x = Object.prototype.toString.call(window.HTMLElement); + return x.indexOf('Constructor') > 0; + }; + /** + * Helper function, a callback for download that deletes + * an invisible anchor element from the DOM once the file + * has been automatically downloaded. + * + * @private + */ + function destroyClickedElement(event) { + document.body.removeChild(event.target); + } + var _default = _main.default; + exports.default = _default; + }, + { + '../core/friendly_errors/fes_core': 289, + '../core/friendly_errors/file_errors': 290, + '../core/friendly_errors/validate_params': 293, + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.last-index-of': 181, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.object.from-entries': 195, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.promise': 201, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/web.dom-collections.iterator': 256, + 'core-js/modules/web.url': 258, + 'es6-promise/auto': 259, + 'fetch-jsonp': 261, + 'file-saver': 262, + 'whatwg-fetch': 275 + } + ], + 325: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.replace'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module IO + * @submodule Table + * @requires core + */ + /** + * Table Options + * Generic class for handling tabular data, typically from a + * CSV, TSV, or other sort of spreadsheet file. + * CSV files are + * + * comma separated values, often with the data in quotes. TSV + * files use tabs as separators, and usually don't bother with the + * quotes. + * File names should end with .csv if they're comma separated. + * A rough "spec" for CSV can be found + * here. + * To load files, use the loadTable method. + * To save tables to your computer, use the save method + * or the saveTable method. + * + * Possible options include: + *
                                + *
                              • csv - parse the table as comma-separated values + *
                              • tsv - parse the table as tab-separated values + *
                              • header - this table has a header (title) row + *
                              + */ + /** + * Table objects store data with multiple rows and columns, much + * like in a traditional spreadsheet. Tables can be generated from + * scratch, dynamically, or using data from an existing file. + * + * @class p5.Table + * @constructor + * @param {p5.TableRow[]} [rows] An array of p5.TableRow objects + */ + + _main.default.Table = /*#__PURE__*/ function () { + /** + * An array containing the names of the columns in the table, if the "header" the table is + * loaded with the "header" parameter. + * @type {String[]} + * @property columns + * @name columns + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //print the column names + * for (let c = 0; c < table.getColumnCount(); c++) { + * print('column ' + c + ' is named ' + table.columns[c]); + * } + * } + * + *
                              + */ + function _class(rows) { + _classCallCheck(this, _class); + this.columns = [ + ]; + /** + * An array containing the p5.TableRow objects that make up the + * rows of the table. The same result as calling getRows() + * @type {p5.TableRow[]} + * @property rows + * @name rows + */ + this.rows = [ + ]; + } /** + * Use addRow() to add a new row of data to a p5.Table object. By default, + * an empty row is created. Typically, you would store a reference to + * the new row in a TableRow object (see newRow in the example above), + * and then set individual values using set(). + * + * If a p5.TableRow object is included as a parameter, then that row is + * duplicated and added to the table. + * + * @method addRow + * @param {p5.TableRow} [row] row to be added to the table + * @return {p5.TableRow} the row that was added + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //add a row + * let newRow = table.addRow(); + * newRow.setString('id', table.getRowCount() - 1); + * newRow.setString('species', 'Canis Lupus'); + * newRow.setString('name', 'Wolf'); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                              + */ + + _createClass(_class, [ + { + key: 'addRow', + value: function addRow(row) { + // make sure it is a valid TableRow + var r = row || new _main.default.TableRow(); + if (typeof r.arr === 'undefined' || typeof r.obj === 'undefined') { + //r = new p5.prototype.TableRow(r); + throw new Error('invalid TableRow: '.concat(r)); + } + r.table = this; + this.rows.push(r); + return r; + } /** + * Removes a row from the table object. + * + * @method removeRow + * @param {Integer} id ID number of the row to remove + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //remove the first row + * table.removeRow(0); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'removeRow', + value: function removeRow(id) { + this.rows[id].table = null; // remove reference to table + var chunk = this.rows.splice(id + 1, this.rows.length); + this.rows.pop(); + this.rows = this.rows.concat(chunk); + } /** + * Returns a reference to the specified p5.TableRow. The reference + * can then be used to get and set values of the selected row. + * + * @method getRow + * @param {Integer} rowID ID number of the row to get + * @return {p5.TableRow} p5.TableRow object + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let row = table.getRow(1); + * //print it column by column + * //note: a row is an object, not an array + * for (let c = 0; c < table.getColumnCount(); c++) { + * print(row.getString(c)); + * } + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getRow', + value: function getRow(r) { + return this.rows[r]; + } /** + * Gets all rows from the table. Returns an array of p5.TableRows. + * + * @method getRows + * @return {p5.TableRow[]} Array of p5.TableRows + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * + * //warning: rows is an array of objects + * for (let r = 0; r < rows.length; r++) { + * rows[r].set('name', 'Unicorn'); + * } + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getRows', + value: function getRows() { + return this.rows; + } /** + * Finds the first row in the Table that contains the value + * provided, and returns a reference to that row. Even if + * multiple rows are possible matches, only the first matching + * row is returned. The column to search may be specified by + * either its ID or title. + * + * @method findRow + * @param {String} value The value to match + * @param {Integer|String} column ID number or title of the + * column to search + * @return {p5.TableRow} + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //find the animal named zebra + * let row = table.findRow('Zebra', 'name'); + * //find the corresponding species + * print(row.getString('species')); + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'findRow', + value: function findRow(value, column) { + // try the Object + if (typeof column === 'string') { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column] === value) { + return this.rows[i]; + } + } + } else { + // try the Array + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column] === value) { + return this.rows[j]; + } + } + } // otherwise... + + return null; + } /** + * Finds the rows in the Table that contain the value + * provided, and returns references to those rows. Returns an + * Array, so for must be used to iterate through all the rows, + * as shown in the example above. The column to search may be + * specified by either its ID or title. + * + * @method findRows + * @param {String} value The value to match + * @param {Integer|String} column ID number or title of the + * column to search + * @return {p5.TableRow[]} An Array of TableRow objects + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //add another goat + * let newRow = table.addRow(); + * newRow.setString('id', table.getRowCount() - 1); + * newRow.setString('species', 'Scape Goat'); + * newRow.setString('name', 'Goat'); + * + * //find the rows containing animals named Goat + * let rows = table.findRows('Goat', 'name'); + * print(rows.length + ' Goats found'); + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'findRows', + value: function findRows(value, column) { + var ret = [ + ]; + if (typeof column === 'string') { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column] === value) { + ret.push(this.rows[i]); + } + } + } else { + // try the Array + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column] === value) { + ret.push(this.rows[j]); + } + } + } + return ret; + } /** + * Finds the first row in the Table that matches the regular + * expression provided, and returns a reference to that row. + * Even if multiple rows are possible matches, only the first + * matching row is returned. The column to search may be + * specified by either its ID or title. + * + * @method matchRow + * @param {String|RegExp} regexp The regular expression to match + * @param {String|Integer} column The column ID (number) or + * title (string) + * @return {p5.TableRow} TableRow object + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //Search using specified regex on a given column, return TableRow object + * let mammal = table.matchRow(new RegExp('ant'), 1); + * print(mammal.getString(1)); + * //Output "Panthera pardus" + * } + * + *
                              + */ + + }, + { + key: 'matchRow', + value: function matchRow(regexp, column) { + if (typeof column === 'number') { + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column].match(regexp)) { + return this.rows[j]; + } + } + } else { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column].match(regexp)) { + return this.rows[i]; + } + } + } + return null; + } /** + * Finds the rows in the Table that match the regular expression provided, + * and returns references to those rows. Returns an array, so for must be + * used to iterate through all the rows, as shown in the example. The + * column to search may be specified by either its ID or title. + * + * @method matchRows + * @param {String} regexp The regular expression to match + * @param {String|Integer} [column] The column ID (number) or + * title (string) + * @return {p5.TableRow[]} An Array of TableRow objects + * @example + *
                              + * + * let table; + * + * function setup() { + * table = new p5.Table(); + * + * table.addColumn('name'); + * table.addColumn('type'); + * + * let newRow = table.addRow(); + * newRow.setString('name', 'Lion'); + * newRow.setString('type', 'Mammal'); + * + * newRow = table.addRow(); + * newRow.setString('name', 'Snake'); + * newRow.setString('type', 'Reptile'); + * + * newRow = table.addRow(); + * newRow.setString('name', 'Mosquito'); + * newRow.setString('type', 'Insect'); + * + * newRow = table.addRow(); + * newRow.setString('name', 'Lizard'); + * newRow.setString('type', 'Reptile'); + * + * let rows = table.matchRows('R.*', 'type'); + * for (let i = 0; i < rows.length; i++) { + * print(rows[i].getString('name') + ': ' + rows[i].getString('type')); + * } + * } + * // Sketch prints: + * // Snake: Reptile + * // Lizard: Reptile + * + *
                              + */ + + }, + { + key: 'matchRows', + value: function matchRows(regexp, column) { + var ret = [ + ]; + if (typeof column === 'number') { + for (var j = 0; j < this.rows.length; j++) { + if (this.rows[j].arr[column].match(regexp)) { + ret.push(this.rows[j]); + } + } + } else { + for (var i = 0; i < this.rows.length; i++) { + if (this.rows[i].obj[column].match(regexp)) { + ret.push(this.rows[i]); + } + } + } + return ret; + } /** + * Retrieves all values in the specified column, and returns them + * as an array. The column may be specified by either its ID or title. + * + * @method getColumn + * @param {String|Number} column String or Number of the column to return + * @return {Array} Array of column values + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //getColumn returns an array that can be printed directly + * print(table.getColumn('species')); + * //outputs ["Capra hircus", "Panthera pardus", "Equus zebra"] + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getColumn', + value: function getColumn(value) { + var ret = [ + ]; + if (typeof value === 'string') { + for (var i = 0; i < this.rows.length; i++) { + ret.push(this.rows[i].obj[value]); + } + } else { + for (var j = 0; j < this.rows.length; j++) { + ret.push(this.rows[j].arr[value]); + } + } + return ret; + } /** + * Removes all rows from a Table. While all rows are removed, + * columns and column titles are maintained. + * + * @method clearRows + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.clearRows(); + * print(table.getRowCount() + ' total rows in table'); + * print(table.getColumnCount() + ' total columns in table'); + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'clearRows', + value: function clearRows() { + delete this.rows; + this.rows = [ + ]; + } /** + * Use addColumn() to add a new column to a Table object. + * Typically, you will want to specify a title, so the column + * may be easily referenced later by name. (If no title is + * specified, the new column's title will be null.) + * + * @method addColumn + * @param {String} [title] title of the given column + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.addColumn('carnivore'); + * table.set(0, 'carnivore', 'no'); + * table.set(1, 'carnivore', 'yes'); + * table.set(2, 'carnivore', 'no'); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'addColumn', + value: function addColumn(title) { + var t = title || null; + this.columns.push(t); + } /** + * Returns the total number of columns in a Table. + * + * @method getColumnCount + * @return {Integer} Number of columns in this table + * @example + *
                              + * + * // given the cvs file "blobs.csv" in /assets directory + * // ID, Name, Flavor, Shape, Color + * // Blob1, Blobby, Sweet, Blob, Pink + * // Blob2, Saddy, Savory, Blob, Blue + * + * let table; + * + * function preload() { + * table = loadTable('assets/blobs.csv'); + * } + * + * function setup() { + * createCanvas(200, 100); + * textAlign(CENTER); + * background(255); + * } + * + * function draw() { + * let numOfColumn = table.getColumnCount(); + * text('There are ' + numOfColumn + ' columns in the table.', 100, 50); + * } + * + *
                              + */ + + }, + { + key: 'getColumnCount', + value: function getColumnCount() { + return this.columns.length; + } /** + * Returns the total number of rows in a Table. + * + * @method getRowCount + * @return {Integer} Number of rows in this table + * @example + *
                              + * + * // given the cvs file "blobs.csv" in /assets directory + * // + * // ID, Name, Flavor, Shape, Color + * // Blob1, Blobby, Sweet, Blob, Pink + * // Blob2, Saddy, Savory, Blob, Blue + * + * let table; + * + * function preload() { + * table = loadTable('assets/blobs.csv'); + * } + * + * function setup() { + * createCanvas(200, 100); + * textAlign(CENTER); + * background(255); + * } + * + * function draw() { + * text('There are ' + table.getRowCount() + ' rows in the table.', 100, 50); + * } + * + *
                              + */ + + }, + { + key: 'getRowCount', + value: function getRowCount() { + return this.rows.length; + } /** + * Removes any of the specified characters (or "tokens"). + * + * If no column is specified, then the values in all columns and + * rows are processed. A specific column may be referenced by + * either its ID or title. + * + * @method removeTokens + * @param {String} chars String listing characters to be removed + * @param {String|Integer} [column] Column ID (number) + * or name (string) + * + * @example + *
                              + * function setup() { + * let table = new p5.Table(); + * + * table.addColumn('name'); + * table.addColumn('type'); + * + * let newRow = table.addRow(); + * newRow.setString('name', ' $Lion ,'); + * newRow.setString('type', ',,,Mammal'); + * + * newRow = table.addRow(); + * newRow.setString('name', '$Snake '); + * newRow.setString('type', ',,,Reptile'); + * + * table.removeTokens(',$ '); + * print(table.getArray()); + * } + * + * // prints: + * // 0 "Lion" "Mamal" + * // 1 "Snake" "Reptile" + *
                              + */ + + }, + { + key: 'removeTokens', + value: function removeTokens(chars, column) { + var escape = function escape(s) { + return s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); + }; + var charArray = [ + ]; + for (var i = 0; i < chars.length; i++) { + charArray.push(escape(chars.charAt(i))); + } + var regex = new RegExp(charArray.join('|'), 'g'); + if (typeof column === 'undefined') { + for (var c = 0; c < this.columns.length; c++) { + for (var d = 0; d < this.rows.length; d++) { + var s = this.rows[d].arr[c]; + s = s.replace(regex, ''); + this.rows[d].arr[c] = s; + this.rows[d].obj[this.columns[c]] = s; + } + } + } else if (typeof column === 'string') { + for (var j = 0; j < this.rows.length; j++) { + var val = this.rows[j].obj[column]; + val = val.replace(regex, ''); + this.rows[j].obj[column] = val; + var pos = this.columns.indexOf(column); + this.rows[j].arr[pos] = val; + } + } else { + for (var k = 0; k < this.rows.length; k++) { + var str = this.rows[k].arr[column]; + str = str.replace(regex, ''); + this.rows[k].arr[column] = str; + this.rows[k].obj[this.columns[column]] = str; + } + } + } /** + * Trims leading and trailing whitespace, such as spaces and tabs, + * from String table values. If no column is specified, then the + * values in all columns and rows are trimmed. A specific column + * may be referenced by either its ID or title. + * + * @method trim + * @param {String|Integer} [column] Column ID (number) + * or name (string) + * @example + *
                              + * function setup() { + * let table = new p5.Table(); + * + * table.addColumn('name'); + * table.addColumn('type'); + * + * let newRow = table.addRow(); + * newRow.setString('name', ' Lion ,'); + * newRow.setString('type', ' Mammal '); + * + * newRow = table.addRow(); + * newRow.setString('name', ' Snake '); + * newRow.setString('type', ' Reptile '); + * + * table.trim(); + * print(table.getArray()); + * } + * + * // prints: + * // 0 "Lion" "Mamal" + * // 1 "Snake" "Reptile" + *
                              + */ + + }, + { + key: 'trim', + value: function trim(column) { + var regex = new RegExp(' ', 'g'); + if (typeof column === 'undefined') { + for (var c = 0; c < this.columns.length; c++) { + for (var d = 0; d < this.rows.length; d++) { + var s = this.rows[d].arr[c]; + s = s.replace(regex, ''); + this.rows[d].arr[c] = s; + this.rows[d].obj[this.columns[c]] = s; + } + } + } else if (typeof column === 'string') { + for (var j = 0; j < this.rows.length; j++) { + var val = this.rows[j].obj[column]; + val = val.replace(regex, ''); + this.rows[j].obj[column] = val; + var pos = this.columns.indexOf(column); + this.rows[j].arr[pos] = val; + } + } else { + for (var k = 0; k < this.rows.length; k++) { + var str = this.rows[k].arr[column]; + str = str.replace(regex, ''); + this.rows[k].arr[column] = str; + this.rows[k].obj[this.columns[column]] = str; + } + } + } /** + * Use removeColumn() to remove an existing column from a Table + * object. The column to be removed may be identified by either + * its title (a String) or its index value (an int). + * removeColumn(0) would remove the first column, removeColumn(1) + * would remove the second column, and so on. + * + * @method removeColumn + * @param {String|Integer} column columnName (string) or ID (number) + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.removeColumn('id'); + * print(table.getColumnCount()); + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'removeColumn', + value: function removeColumn(c) { + var cString; + var cNumber; + if (typeof c === 'string') { + // find the position of c in the columns + cString = c; + cNumber = this.columns.indexOf(c); + } else { + cNumber = c; + cString = this.columns[c]; + } + var chunk = this.columns.splice(cNumber + 1, this.columns.length); + this.columns.pop(); + this.columns = this.columns.concat(chunk); + for (var i = 0; i < this.rows.length; i++) { + var tempR = this.rows[i].arr; + var chip = tempR.splice(cNumber + 1, tempR.length); + tempR.pop(); + this.rows[i].arr = tempR.concat(chip); + delete this.rows[i].obj[cString]; + } + } /** + * Stores a value in the Table's specified row and column. + * The row is specified by its ID, while the column may be specified + * by either its ID or title. + * + * @method set + * @param {Integer} row row ID + * @param {String|Integer} column column ID (Number) + * or title (String) + * @param {String|Number} value value to assign + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.set(0, 'species', 'Canis Lupus'); + * table.set(0, 'name', 'Wolf'); + * + * //print the results + * for (let r = 0; r < table.getRowCount(); r++) + * for (let c = 0; c < table.getColumnCount(); c++) + * print(table.getString(r, c)); + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'set', + value: function set(row, column, value) { + this.rows[row].set(column, value); + } /** + * Stores a Float value in the Table's specified row and column. + * The row is specified by its ID, while the column may be specified + * by either its ID or title. + * + * @method setNum + * @param {Integer} row row ID + * @param {String|Integer} column column ID (Number) + * or title (String) + * @param {Number} value value to assign + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * table.setNum(1, 'id', 1); + * + * print(table.getColumn(0)); + * //["0", 1, "2"] + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'setNum', + value: function setNum(row, column, value) { + this.rows[row].setNum(column, value); + } /** + * Stores a String value in the Table's specified row and column. + * The row is specified by its ID, while the column may be specified + * by either its ID or title. + * + * @method setString + * @param {Integer} row row ID + * @param {String|Integer} column column ID (Number) + * or title (String) + * @param {String} value value to assign + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * //add a row + * let newRow = table.addRow(); + * newRow.setString('id', table.getRowCount() - 1); + * newRow.setString('species', 'Canis Lupus'); + * newRow.setString('name', 'Wolf'); + * + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                              + */ + + }, + { + key: 'setString', + value: function setString(row, column, value) { + this.rows[row].setString(column, value); + } /** + * Retrieves a value from the Table's specified row and column. + * The row is specified by its ID, while the column may be specified by + * either its ID or title. + * + * @method get + * @param {Integer} row row ID + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String|Number} + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * print(table.get(0, 1)); + * //Capra hircus + * print(table.get(0, 'species')); + * //Capra hircus + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'get', + value: function get(row, column) { + return this.rows[row].get(column); + } /** + * Retrieves a Float value from the Table's specified row and column. + * The row is specified by its ID, while the column may be specified by + * either its ID or title. + * + * @method getNum + * @param {Integer} row row ID + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {Number} + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * print(table.getNum(1, 0) + 100); + * //id 1 + 100 = 101 + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getNum', + value: function getNum(row, column) { + return this.rows[row].getNum(column); + } /** + * Retrieves a String value from the Table's specified row and column. + * The row is specified by its ID, while the column may be specified by + * either its ID or title. + * + * @method getString + * @param {Integer} row row ID + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String} + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * // table is comma separated value "CSV" + * // and has specifiying header for column labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * print(table.getString(0, 0)); // 0 + * print(table.getString(0, 1)); // Capra hircus + * print(table.getString(0, 2)); // Goat + * print(table.getString(1, 0)); // 1 + * print(table.getString(1, 1)); // Panthera pardus + * print(table.getString(1, 2)); // Leopard + * print(table.getString(2, 0)); // 2 + * print(table.getString(2, 1)); // Equus zebra + * print(table.getString(2, 2)); // Zebra + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getString', + value: function getString(row, column) { + return this.rows[row].getString(column); + } /** + * Retrieves all table data and returns as an object. If a column name is + * passed in, each row object will be stored with that attribute as its + * title. + * + * @method getObject + * @param {String} [headerColumn] Name of the column which should be used to + * title each row object (optional) + * @return {Object} + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let tableObject = table.getObject(); + * + * print(tableObject); + * //outputs an object + * + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getObject', + value: function getObject(headerColumn) { + var tableObject = { + }; + var obj, + cPos, + index; + for (var i = 0; i < this.rows.length; i++) { + obj = this.rows[i].obj; + if (typeof headerColumn === 'string') { + cPos = this.columns.indexOf(headerColumn); // index of columnID + if (cPos >= 0) { + index = obj[headerColumn]; + tableObject[index] = obj; + } else { + throw new Error('This table has no column named "'.concat(headerColumn, '"')); + } + } else { + tableObject[i] = this.rows[i].obj; + } + } + return tableObject; + } /** + * Retrieves all table data and returns it as a multidimensional array. + * + * @method getArray + * @return {Array} + * + * @example + *
                              + * + * // Given the CSV file "mammals.csv" + * // in the project's "assets" folder + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leoperd + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * // table is comma separated value "CSV" + * // and has specifiying header for column labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let tableArray = table.getArray(); + * for (let i = 0; i < tableArray.length; i++) { + * print(tableArray[i]); + * } + * describe('no image displayed'); + * } + * + *
                              + */ + + }, + { + key: 'getArray', + value: function getArray() { + var tableArray = [ + ]; + for (var i = 0; i < this.rows.length; i++) { + tableArray.push(this.rows[i].arr); + } + return tableArray; + } + } + ]); + return _class; + }(); + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.regexp.constructor': 204, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.match': 211, + 'core-js/modules/es.string.replace': 214 + } + ], + 326: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.from-entries'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.from-entries'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module IO + * @submodule Table + * @requires core + */ + /** + * A TableRow object represents a single row of data values, + * stored in columns, from a table. + * + * A Table Row contains both an ordered array, and an unordered + * JSON object. + * + * @class p5.TableRow + * @constructor + * @param {String} [str] optional: populate the row with a + * string of values, separated by the + * separator + * @param {String} [separator] comma separated values (csv) by default + */ + + _main.default.TableRow = /*#__PURE__*/ function () { + function _class(str, separator) { + _classCallCheck(this, _class); + var arr = [ + ]; + if (str) { + separator = separator || ','; + arr = str.split(separator); + } + this.arr = arr; + this.obj = Object.fromEntries(arr.entries()); + this.table = null; + } /** + * Stores a value in the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method set + * @param {String|Integer} column Column ID (Number) + * or Title (String) + * @param {String|Number} value The value to be stored + * + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * rows[r].set('name', 'Unicorn'); + * } + * + * //print the results + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                              + */ + + _createClass(_class, [ + { + key: 'set', + value: function set(column, value) { + // if typeof column is string, use .obj + if (typeof column === 'string') { + var cPos = this.table.columns.indexOf(column); // index of columnID + if (cPos >= 0) { + this.obj[column] = value; + this.arr[cPos] = value; + } else { + throw new Error('This table has no column named "'.concat(column, '"')); + } + } else { + // if typeof column is number, use .arr + if (column < this.table.columns.length) { + this.arr[column] = value; + var cTitle = this.table.columns[column]; + this.obj[cTitle] = value; + } else { + throw new Error('Column #'.concat(column, ' is out of the range of this table')); + } + } + } /** + * Stores a Float value in the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method setNum + * @param {String|Integer} column Column ID (Number) + * or Title (String) + * @param {Number|String} value The value to be stored + * as a Float + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * rows[r].setNum('id', r + 10); + * } + * + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                              + */ + + }, + { + key: 'setNum', + value: function setNum(column, value) { + var floatVal = parseFloat(value); + this.set(column, floatVal); + } /** + * Stores a String value in the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method setString + * @param {String|Integer} column Column ID (Number) + * or Title (String) + * @param {String|Number|Boolean|Object} value The value to be stored + * as a String + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * let name = rows[r].getString('name'); + * rows[r].setString('name', 'A ' + name + ' named George'); + * } + * + * print(table.getArray()); + * + * describe('no image displayed'); + * } + *
                              + */ + + }, + { + key: 'setString', + value: function setString(column, value) { + var stringVal = value.toString(); + this.set(column, stringVal); + } /** + * Retrieves a value from the TableRow's specified column. + * The column may be specified by either its ID or title. + * + * @method get + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String|Number} + * + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let names = []; + * let rows = table.getRows(); + * for (let r = 0; r < rows.length; r++) { + * names.push(rows[r].get('name')); + * } + * + * print(names); + * + * describe('no image displayed'); + * } + *
                              + */ + + }, + { + key: 'get', + value: function get(column) { + if (typeof column === 'string') { + return this.obj[column]; + } else { + return this.arr[column]; + } + } /** + * Retrieves a Float value from the TableRow's specified + * column. The column may be specified by either its ID or + * title. + * + * @method getNum + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {Number} Float Floating point number + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * let minId = Infinity; + * let maxId = -Infinity; + * for (let r = 0; r < rows.length; r++) { + * let id = rows[r].getNum('id'); + * minId = min(minId, id); + * maxId = min(maxId, id); + * } + * print('minimum id = ' + minId + ', maximum id = ' + maxId); + * describe('no image displayed'); + * } + *
                              + */ + + }, + { + key: 'getNum', + value: function getNum(column) { + var ret; + if (typeof column === 'string') { + ret = parseFloat(this.obj[column]); + } else { + ret = parseFloat(this.arr[column]); + } + if (ret.toString() === 'NaN') { + throw 'Error: '.concat(this.obj[column], ' is NaN (Not a Number)'); + } + return ret; + } /** + * Retrieves an String value from the TableRow's specified + * column. The column may be specified by either its ID or + * title. + * + * @method getString + * @param {String|Integer} column columnName (string) or + * ID (number) + * @return {String} String + * @example + *
                              + * // Given the CSV file "mammals.csv" in the project's "assets" folder: + * // + * // id,species,name + * // 0,Capra hircus,Goat + * // 1,Panthera pardus,Leopard + * // 2,Equus zebra,Zebra + * + * let table; + * + * function preload() { + * //my table is comma separated value "csv" + * //and has a header specifying the columns labels + * table = loadTable('assets/mammals.csv', 'csv', 'header'); + * } + * + * function setup() { + * let rows = table.getRows(); + * let longest = ''; + * for (let r = 0; r < rows.length; r++) { + * let species = rows[r].getString('species'); + * if (longest.length < species.length) { + * longest = species; + * } + * } + * + * print('longest: ' + longest); + * + * describe('no image displayed'); + * } + *
                              + */ + + }, + { + key: 'getString', + value: function getString(column) { + if (typeof column === 'string') { + return this.obj[column].toString(); + } else { + return this.arr[column].toString(); + } + } + } + ]); + return _class; + }(); + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.from-entries': 195, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 327: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module IO + * @submodule Input + * @requires core + */ + /** + * XML is a representation of an XML object, able to parse XML code. Use + * loadXML() to load external XML files and create XML objects. + * + * @class p5.XML + * @constructor + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let children = xml.getChildren('animal'); + * + * for (let i = 0; i < children.length; i++) { + * let id = children[i].getNum('id'); + * let coloring = children[i].getString('species'); + * let name = children[i].getContent(); + * print(id + ', ' + coloring + ', ' + name); + * } + * + * describe('no image displayed'); + * } + * + * // Sketch prints: + * // 0, Capra hircus, Goat + * // 1, Panthera pardus, Leopard + * // 2, Equus zebra, Zebra + *
                              + */ + + _main.default.XML = /*#__PURE__*/ function () { + function _class(DOM) { + _classCallCheck(this, _class); + if (!DOM) { + var xmlDoc = document.implementation.createDocument(null, 'doc'); + this.DOM = xmlDoc.createElement('root'); + } else { + this.DOM = DOM; + } + } /** + * Gets a copy of the element's parent. Returns the parent as another + * p5.XML object. + * + * @method getParent + * @return {p5.XML} element parent + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let children = xml.getChildren('animal'); + * let parent = children[1].getParent(); + * print(parent.getName()); + * } + * + * // Sketch prints: + * // mammals + *
                              + */ + + _createClass(_class, [ + { + key: 'getParent', + value: function getParent() { + return new _main.default.XML(this.DOM.parentElement); + } /** + * Gets the element's full name, which is returned as a String. + * + * @method getName + * @return {String} the name of the node + * @example<animal + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.getName()); + * } + * + * // Sketch prints: + * // mammals + *
                              + */ + + }, + { + key: 'getName', + value: function getName() { + return this.DOM.tagName; + } /** + * Sets the element's name, which is specified as a String. + * + * @method setName + * @param {String} the new name of the node + * @example<animal + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.getName()); + * xml.setName('fish'); + * print(xml.getName()); + * } + * + * // Sketch prints: + * // mammals + * // fish + *
                              + */ + + }, + { + key: 'setName', + value: function setName(name) { + var content = this.DOM.innerHTML; + var attributes = this.DOM.attributes; + var xmlDoc = document.implementation.createDocument(null, 'default'); + var newDOM = xmlDoc.createElement(name); + newDOM.innerHTML = content; + for (var i = 0; i < attributes.length; i++) { + newDOM.setAttribute(attributes[i].nodeName, attributes.nodeValue); + } + this.DOM = newDOM; + } /** + * Checks whether or not the element has any children, and returns the result + * as a boolean. + * + * @method hasChildren + * @return {boolean} + * @example<animal + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.hasChildren()); + * } + * + * // Sketch prints: + * // true + *
                              + */ + + }, + { + key: 'hasChildren', + value: function hasChildren() { + return this.DOM.children.length > 0; + } /** + * Get the names of all of the element's children, and returns the names as an + * array of Strings. This is the same as looping through and calling getName() + * on each child element individually. + * + * @method listChildren + * @return {String[]} names of the children of the element + * @example<animal + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.listChildren()); + * } + * + * // Sketch prints: + * // ["animal", "animal", "animal"] + *
                              + */ + + }, + { + key: 'listChildren', + value: function listChildren() { + var arr = [ + ]; + for (var i = 0; i < this.DOM.childNodes.length; i++) { + arr.push(this.DOM.childNodes[i].nodeName); + } + return arr; + } /** + * Returns all of the element's children as an array of p5.XML objects. When + * the name parameter is specified, then it will return all children that match + * that name. + * + * @method getChildren + * @param {String} [name] element name + * @return {p5.XML[]} children of the element + * @example<animal + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let animals = xml.getChildren('animal'); + * + * for (let i = 0; i < animals.length; i++) { + * print(animals[i].getContent()); + * } + * } + * + * // Sketch prints: + * // "Goat" + * // "Leopard" + * // "Zebra" + *
                              + */ + + }, + { + key: 'getChildren', + value: function getChildren(param) { + if (param) { + return elementsToP5XML(this.DOM.getElementsByTagName(param)); + } else { + return elementsToP5XML(this.DOM.children); + } + } /** + * Returns the first of the element's children that matches the name parameter + * or the child of the given index.It returns undefined if no matching + * child is found. + * + * @method getChild + * @param {String|Integer} name element name or index + * @return {p5.XML} + * @example<animal + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getContent()); + * } + * + * // Sketch prints: + * // "Goat" + *
                              + *
                              + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let secondChild = xml.getChild(1); + * print(secondChild.getContent()); + * } + * + * // Sketch prints: + * // "Leopard" + *
                              + */ + + }, + { + key: 'getChild', + value: function getChild(param) { + if (typeof param === 'string') { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this.DOM.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var child = _step.value; + if (child.tagName === param) return new _main.default.XML(child); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } else { + return new _main.default.XML(this.DOM.children[param]); + } + } /** + * Appends a new child to the element. The child can be specified with + * either a String, which will be used as the new tag's name, or as a + * reference to an existing p5.XML object. + * A reference to the newly created child is returned as an p5.XML object. + * + * @method addChild + * @param {p5.XML} node a p5.XML Object which will be the child to be added + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let child = new p5.XML(); + * child.setName('animal'); + * child.setAttribute('id', '3'); + * child.setAttribute('species', 'Ornithorhynchus anatinus'); + * child.setContent('Platypus'); + * xml.addChild(child); + * + * let animals = xml.getChildren('animal'); + * print(animals[animals.length - 1].getContent()); + * } + * + * // Sketch prints: + * // "Goat" + * // "Leopard" + * // "Zebra" + *
                              + */ + + }, + { + key: 'addChild', + value: function addChild(node) { + if (node instanceof _main.default.XML) { + this.DOM.appendChild(node.DOM); + } else { + // PEND + } + } /** + * Removes the element specified by name or index. + * + * @method removeChild + * @param {String|Integer} name element name or index + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * xml.removeChild('animal'); + * let children = xml.getChildren(); + * for (let i = 0; i < children.length; i++) { + * print(children[i].getContent()); + * } + * } + * + * // Sketch prints: + * // "Leopard" + * // "Zebra" + *
                              + *
                              + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * xml.removeChild(1); + * let children = xml.getChildren(); + * for (let i = 0; i < children.length; i++) { + * print(children[i].getContent()); + * } + * } + * + * // Sketch prints: + * // "Goat" + * // "Zebra" + *
                              + */ + + }, + { + key: 'removeChild', + value: function removeChild(param) { + var ind = - 1; + if (typeof param === 'string') { + for (var i = 0; i < this.DOM.children.length; i++) { + if (this.DOM.children[i].tagName === param) { + ind = i; + break; + } + } + } else { + ind = param; + } + if (ind !== - 1) { + this.DOM.removeChild(this.DOM.children[ind]); + } + } /** + * Counts the specified element's number of attributes, returned as an Number. + * + * @method getAttributeCount + * @return {Integer} + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getAttributeCount()); + * } + * + * // Sketch prints: + * // 2 + *
                              + */ + + }, + { + key: 'getAttributeCount', + value: function getAttributeCount() { + return this.DOM.attributes.length; + } /** + * Gets all of the specified element's attributes, and returns them as an + * array of Strings. + * + * @method listAttributes + * @return {String[]} an array of strings containing the names of attributes + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.listAttributes()); + * } + * + * // Sketch prints: + * // ["id", "species"] + *
                              + */ + + }, + { + key: 'listAttributes', + value: function listAttributes() { + var arr = [ + ]; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = this.DOM.attributes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var attribute = _step2.value; + arr.push(attribute.nodeName); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + return arr; + } /** + * Checks whether or not an element has the specified attribute. + * + * @method hasAttribute + * @param {String} the attribute to be checked + * @return {boolean} true if attribute found else false + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.hasAttribute('species')); + * print(firstChild.hasAttribute('color')); + * } + * + * // Sketch prints: + * // true + * // false + *
                              + */ + + }, + { + key: 'hasAttribute', + value: function hasAttribute(name) { + var obj = { + }; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = this.DOM.attributes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var attribute = _step3.value; + obj[attribute.nodeName] = attribute.nodeValue; + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + return obj[name] ? true : false; + } /** + * Returns an attribute value of the element as an Number. If the defaultValue + * parameter is specified and the attribute doesn't exist, then defaultValue + * is returned. If no defaultValue is specified and the attribute doesn't + * exist, the value 0 is returned. + * + * @method getNum + * @param {String} name the non-null full name of the attribute + * @param {Number} [defaultValue] the default value of the attribute + * @return {Number} + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getNum('id')); + * } + * + * // Sketch prints: + * // 0 + *
                              + */ + + }, + { + key: 'getNum', + value: function getNum(name, defaultValue) { + var obj = { + }; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for (var _iterator4 = this.DOM.attributes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var attribute = _step4.value; + obj[attribute.nodeName] = attribute.nodeValue; + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + return Number(obj[name]) || defaultValue || 0; + } /** + * Returns an attribute value of the element as an String. If the defaultValue + * parameter is specified and the attribute doesn't exist, then defaultValue + * is returned. If no defaultValue is specified and the attribute doesn't + * exist, null is returned. + * + * @method getString + * @param {String} name the non-null full name of the attribute + * @param {Number} [defaultValue] the default value of the attribute + * @return {String} + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getString('species')); + * } + * + * // Sketch prints: + * // "Capra hircus" + *
                              + */ + + }, + { + key: 'getString', + value: function getString(name, defaultValue) { + var obj = { + }; + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + try { + for (var _iterator5 = this.DOM.attributes[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var attribute = _step5.value; + obj[attribute.nodeName] = attribute.nodeValue; + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + return obj[name] ? String(obj[name]) : defaultValue || null; + } /** + * Sets the content of an element's attribute. The first parameter specifies + * the attribute name, while the second specifies the new content. + * + * @method setAttribute + * @param {String} name the full name of the attribute + * @param {Number|String|Boolean} value the value of the attribute + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getString('species')); + * firstChild.setAttribute('species', 'Jamides zebra'); + * print(firstChild.getString('species')); + * } + * + * // Sketch prints: + * // "Capra hircus" + * // "Jamides zebra" + *
                              + */ + + }, + { + key: 'setAttribute', + value: function setAttribute(name, value) { + this.DOM.setAttribute(name, value); + } /** + * Returns the content of an element. If there is no such content, + * defaultValue is returned if specified, otherwise null is returned. + * + * @method getContent + * @param {String} [defaultValue] value returned if no content is found + * @return {String} + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getContent()); + * } + * + * // Sketch prints: + * // "Goat" + *
                              + */ + + }, + { + key: 'getContent', + value: function getContent(defaultValue) { + var str; + str = this.DOM.textContent; + str = str.replace(/\s\s+/g, ','); + return str || defaultValue || null; + } /** + * Sets the element's content. + * + * @method setContent + * @param {String} text the new content + * @example + *
                              + * // The following short XML file called "mammals.xml" is parsed + * // in the code below. + * // + * // + * // <mammals> + * // <animal id="0" species="Capra hircus">Goat</animal> + * // <animal id="1" species="Panthera pardus">Leopard</animal> + * // <animal id="2" species="Equus zebra">Zebra</animal> + * // </mammals> + * + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * let firstChild = xml.getChild('animal'); + * print(firstChild.getContent()); + * firstChild.setContent('Mountain Goat'); + * print(firstChild.getContent()); + * } + * + * // Sketch prints: + * // "Goat" + * // "Mountain Goat" + *
                              + */ + + }, + { + key: 'setContent', + value: function setContent(content) { + if (!this.DOM.children.length) { + this.DOM.textContent = content; + } + } /** + * Serializes the element into a string. This function is useful for preparing + * the content to be sent over a http request or saved to file. + * + * @method serialize + * @return {String} Serialized string of the element + * @example + *
                              + * let xml; + * + * function preload() { + * xml = loadXML('assets/mammals.xml'); + * } + * + * function setup() { + * print(xml.serialize()); + * } + * + * // Sketch prints: + * // + * // Goat + * // Leopard + * // Zebra + * // + *
                              + */ + + }, + { + key: 'serialize', + value: function serialize() { + var xmlSerializer = new XMLSerializer(); + return xmlSerializer.serializeToString(this.DOM); + } + } + ]); + return _class; + }(); + function elementsToP5XML(elements) { + var arr = [ + ]; + for (var i = 0; i < elements.length; i++) { + arr.push(new _main.default.XML(elements[i])); + } + return arr; + } + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.number.constructor': 191, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 328: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Math + * @submodule Calculation + * @for p5 + * @requires core + */ + /** + * Calculates the absolute value of a number. A number's absolute value is its + * distance from zero on the number line. -5 and 5 are both five units away + * from zero, so calling `abs(-5)` and `abs(5)` both return 5. The absolute + * value of a number is always positive. + * + * @method abs + * @param {Number} n number to compute. + * @return {Number} absolute value of given number. + * @example + *
                              + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let centerX = width / 2; + * let x = frameCount; + * let y = abs(x - centerX); + * point(x, y); + * + * describe('A series of black dots that form a "V" shape.'); + * } + * + *
                              + */ + + _main.default.prototype.abs = Math.abs; + /** + * Calculates the closest integer value that is greater than or equal to the + * parameter's value. For example, calling `ceil(9.03)` returns the value + * 10. + * + * @method ceil + * @param {Number} n number to round up. + * @return {Integer} rounded up number. + * @example + *
                              + * + * // Set the range for RGB values from 0 to 1. + * colorMode(RGB, 1); + * noStroke(); + * + * let r = 0.3; + * fill(r, 0, 0); + * rect(0, 0, width / 2, height); + * + * // Round r up to 1. + * r = ceil(r); + * fill(r, 0, 0); + * rect(width / 2, 0, width / 2, height); + * + * describe('Two rectangles. The one on the left is dark red and the one on the right is bright red.'); + * + *
                              + */ + _main.default.prototype.ceil = Math.ceil; + /** + * Constrains a number between a minimum and maximum value. + * + * @method constrain + * @param {Number} n number to constrain. + * @param {Number} low minimum limit. + * @param {Number} high maximum limit. + * @return {Number} constrained number. + * @example + *
                              + * + * function draw() { + * background(200); + * + * let x = constrain(mouseX, 33, 67); + * let y = 50; + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot drawn on a gray square follows the mouse from left to right. Its movement is constrained to the middle third of the square.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * // Set boundaries and draw them. + * let leftWall = width * 0.25; + * let rightWall = width * 0.75; + * line(leftWall, 0, leftWall, height); + * line(rightWall, 0, rightWall, height); + * + * // Draw a circle that follows the mouse freely. + * fill(255); + * circle(mouseX, height / 3, 9); + * + * // Draw a circle that's constrained. + * let xc = constrain(mouseX, leftWall, rightWall); + * fill(0); + * circle(xc, 2 * height / 3, 9); + * + * describe('Two vertical lines. Two circles move horizontally with the mouse. One circle stops at the vertical lines.'); + * } + * + *
                              + */ + _main.default.prototype.constrain = function (n, low, high) { + _main.default._validateParameters('constrain', arguments); + return Math.max(Math.min(n, high), low); + }; + /** + * Calculates the distance between two points. + * + * The version of `dist()` with four parameters calculates distance in two + * dimensions. + * + * The version of `dist()` with six parameters calculates distance in three + * dimensions. + * + * Use p5.Vector.dist() to calculate the + * distance between two p5.Vector objects. + * + * @method dist + * @param {Number} x1 x-coordinate of the first point. + * @param {Number} y1 y-coordinate of the first point. + * @param {Number} x2 x-coordinate of the second point. + * @param {Number} y2 y-coordinate of the second point. + * @return {Number} distance between the two points. + * + * @example + *
                              + * + * let x1 = 10; + * let y1 = 50; + * let x2 = 90; + * let y2 = 50; + * + * line(x1, y1, x2, y2); + * strokeWeight(5); + * point(x1, y1); + * point(x2, y2); + * + * let d = dist(x1, y1, x2, y2); + * text(d, 43, 40); + * + * describe('Two dots connected by a horizontal line. The number 80 is written above the center of the line.'); + * + *
                              + */ + /** + * @method dist + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} z1 z-coordinate of the first point. + * @param {Number} x2 + * @param {Number} y2 + * @param {Number} z2 z-coordinate of the second point. + * @return {Number} distance between the two points. + */ + _main.default.prototype.dist = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('dist', args); + if (args.length === 4) { + //2D + return Math.hypot(args[2] - args[0], args[3] - args[1]); + } else if (args.length === 6) { + //3D + return Math.hypot(args[3] - args[0], args[4] - args[1], args[5] - args[2]); + } + }; + /** + * Returns Euler's number e (2.71828...) raised to the power of the `n` + * parameter. + * + * @method exp + * @param {Number} n exponent to raise. + * @return {Number} e^n + * @example + *
                              + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 0.005 * exp(x * 0.1); + * point(x, y); + * + * describe('A series of black dots that grow exponentially from left to right.'); + * } + * + *
                              + */ + _main.default.prototype.exp = Math.exp; + /** + * Calculates the closest integer value that is less than or equal to the + * value of the `n` parameter. + * + * @method floor + * @param {Number} n number to round down. + * @return {Integer} rounded down number. + * @example + *
                              + * + * // Set the range for RGB values from 0 to 1. + * colorMode(RGB, 1); + * noStroke(); + * + * let r = 0.8; + * fill(r, 0, 0); + * rect(0, 0, width / 2, height); + * + * // Round r down to 0. + * r = floor(r); + * fill(r, 0, 0); + * rect(width / 2, 0, width / 2, height); + * + * describe('Two rectangles. The one on the left is bright red and the one on the right is black.'); + * + *
                              + */ + _main.default.prototype.floor = Math.floor; + /** + * Calculates a number between two numbers at a specific increment. The `amt` + * parameter is the amount to interpolate between the two numbers. 0.0 is + * equal to the first number, 0.1 is very near the first number, 0.5 is + * half-way in between, and 1.0 is equal to the second number. The `lerp()` + * function is convenient for creating motion along a straight path and for + * drawing dotted lines. + * + * If the value of `amt` is less than 0 or more than 1, `lerp()` will return a + * number outside of the original interval. For example, calling + * `lerp(0, 10, 1.5)` will return 15. + * + * @method lerp + * @param {Number} start first value. + * @param {Number} stop second value. + * @param {Number} amt number. + * @return {Number} lerped value. + * @example + *
                              + * + * let a = 20; + * let b = 80; + * let c = lerp(a, b, 0.2); + * let d = lerp(a, b, 0.5); + * let e = lerp(a, b, 0.8); + * + * let y = 50; + * + * strokeWeight(5); + * + * // Draw the original points in black. + * stroke(0); + * point(a, y); + * point(b, y); + * + * // Draw the lerped points in gray. + * stroke(100); + * point(c, y); + * point(d, y); + * point(e, y); + * + * describe('Five points in a horizontal line. The outer points are black and the inner points are gray.'); + * + *
                              + */ + _main.default.prototype.lerp = function (start, stop, amt) { + _main.default._validateParameters('lerp', arguments); + return amt * (stop - start) + start; + }; + /** + * Calculates the natural logarithm (the base-e logarithm) of a number. This + * function expects the `n` parameter to be a value greater than 0.0. + * + * @method log + * @param {Number} n number greater than 0. + * @return {Number} natural logarithm of n. + * @example + *
                              + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 15 * log(x); + * point(x, y); + * + * describe('A series of black dots that get higher slowly from left to right.'); + * } + * + *
                              + */ + _main.default.prototype.log = Math.log; + /** + * Calculates the magnitude, or length, of a vector. A vector is like an arrow + * pointing in space. Vectors are commonly used for programming motion. + * + * Vectors don't have a "start" position because the same arrow can be drawn + * anywhere. A vector's magnitude can be thought of as the distance from the + * origin (0, 0) to its tip at (x, y). `mag(x, y)` is a shortcut for calling + * `dist(0, 0, x, y)`. + * + * @method mag + * @param {Number} x first component. + * @param {Number} y second component. + * @return {Number} magnitude of vector from (0,0) to (x,y). + * @example + *
                              + * + * let x = 30; + * let y = 40; + * let m = mag(x, y); + * + * line(0, 0, x, y); + * text(m, x, y); + * + * describe('A diagonal line is drawn from the top left of the canvas. The number 50 is written at the end of the line.'); + * + *
                              + */ + _main.default.prototype.mag = function (x, y) { + _main.default._validateParameters('mag', arguments); + return Math.hypot(x, y); + }; + /** + * Re-maps a number from one range to another. + * + * For example, calling `map(2, 0, 10, 0, 100)` returns 20. The first three + * arguments set the original value to 2 and the original range from 0 to 10. + * The last two arguments set the target range from 0 to 100. 20's position + * in the target range [0, 100] is proportional to 2's position in the + * original range [0, 10]. + * + * @method map + * @param {Number} value the incoming value to be converted. + * @param {Number} start1 lower bound of the value's current range. + * @param {Number} stop1 upper bound of the value's current range. + * @param {Number} start2 lower bound of the value's target range. + * @param {Number} stop2 upper bound of the value's target range. + * @param {Boolean} [withinBounds] constrain the value to the newly mapped range. + * @return {Number} remapped number. + * @example + *
                              + * + * let n = map(7, 0, 10, 0, 100); + * text(n, 50, 50); + * + * describe('The number 70 written in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let x = map(2, 0, 10, 0, width); + * circle(x, 50, 10); + * + * describe('A white circle drawn on the left side of a gray square.'); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let c = map(mouseX, 0, width, 0, 255); + * fill(c); + * circle(50, 50, 20); + * + * describe('A circle changes color from black to white as the mouse moves from left to right.'); + * } + * + *
                              + */ + _main.default.prototype.map = function (n, start1, stop1, start2, stop2, withinBounds) { + _main.default._validateParameters('map', arguments); + var newval = (n - start1) / (stop1 - start1) * (stop2 - start2) + start2; + if (!withinBounds) { + return newval; + } + if (start2 < stop2) { + return this.constrain(newval, start2, stop2); + } else { + return this.constrain(newval, stop2, start2); + } + }; + /** + * Returns the largest value in a sequence of numbers. + * + * The version of `max()` with one parameter interprets it as an array of + * numbers and returns the largest number. + * + * The version of `max()` with two or more parameters interprets them as + * individual numbers and returns the largest number. + * + * @method max + * @param {Number} n0 first number to compare. + * @param {Number} n1 second number to compare. + * @return {Number} maximum number. + * @example + *
                              + * + * let m = max(10, 20); + * text(m, 50, 50); + * + * describe('The number 20 written in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let m = max([10, 20]); + * text(m, 50, 50); + * + * describe('The number 20 written in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let numbers = [2, 1, 5, 4, 8, 9]; + * + * // Draw all of the numbers in the array. + * noStroke(); + * let spacing = 15; + * numbers.forEach((n, index) => { + * let x = index * spacing; + * let y = 25; + * text(n, x, y); + * }); + * + * // Draw the maximum value in the array. + * let m = max(numbers); + * let maxX = 33; + * let maxY = 80; + * + * textSize(32); + * text(m, maxX, maxY); + * + * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 9 is written in large text at the center of the square.'); + * + *
                              + */ + /** + * @method max + * @param {Number[]} nums numbers to compare. + * @return {Number} + */ + _main.default.prototype.max = function () { + var findMax = function findMax(arr) { + var max = - Infinity; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var x = _step.value; + max = x > max ? x : max; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return max; + }; + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + if (args[0] instanceof Array) { + return findMax(args[0]); + } else { + return findMax(args); + } + }; + /** + * Returns the smallest value in a sequence of numbers. + * + * The version of `min()` with one parameter interprets it as an array of + * numbers and returns the smallest number. + * + * The version of `min()` with two or more parameters interprets them as + * individual numbers and returns the smallest number. + * + * @method min + * @param {Number} n0 first number to compare. + * @param {Number} n1 second number to compare. + * @return {Number} minimum number. + * @example + *
                              + * + * let m = min(10, 20); + * text(m, 50, 50); + * + * describe('The number 10 written in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let m = min([10, 20]); + * text(m, 50, 50); + * + * describe('The number 10 written in the middle of a gray square.'); + * + *
                              + * + *
                              + * + * let numbers = [2, 1, 5, 4, 8, 9]; + * + * // Draw all of the numbers in the array. + * noStroke(); + * let spacing = 15; + * numbers.forEach((n, index) => { + * let x = index * spacing; + * let y = 25; + * text(n, x, y); + * }); + * + * // Draw the minimum value in the array. + * let m = min(numbers); + * let minX = 33; + * let minY = 80; + * + * textSize(32); + * text(m, minX, minY); + * + * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 1 is written in large text at the center of the square.'); + * + *
                              + */ + /** + * @method min + * @param {Number[]} nums numbers to compare. + * @return {Number} + */ + _main.default.prototype.min = function () { + var findMin = function findMin(arr) { + var min = Infinity; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = arr[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var x = _step2.value; + min = x < min ? x : min; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + return min; + }; + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + if (args[0] instanceof Array) { + return findMin(args[0]); + } else { + return findMin(args); + } + }; + /** + * Maps a number from one range to a value between 0 and 1. + * + * For example, `norm(2, 0, 10)` returns 0.2. 2's position in the original + * range [0, 10] is proportional to 0.2's position in the range [0, 1]. This + * is equivalent to calling `map(2, 0, 10, 0, 1)`. + * + * Numbers outside of the original range are not constrained between 0 and 1. + * Out-of-range values are often intentional and useful. + * + * @method norm + * @param {Number} value incoming value to be normalized. + * @param {Number} start lower bound of the value's current range. + * @param {Number} stop upper bound of the value's current range. + * @return {Number} normalized number. + * @example + *
                              + * + * function draw() { + * // Set the range for RGB values from 0 to 1. + * colorMode(RGB, 1); + * + * let r = norm(mouseX, 0, width); + * background(r, 0, 0); + * + * describe('A square changes color from black to red as the mouse moves from left to right.'); + * } + * + *
                              + */ + _main.default.prototype.norm = function (n, start, stop) { + _main.default._validateParameters('norm', arguments); + return this.map(n, start, stop, 0, 1); + }; + /** + * Calculates exponential expressions such as 2^3. + * + * For example, `pow(2, 3)` is equivalent to the expression + * 2 × 2 × 2. `pow(2, -3)` is equivalent to 1 ÷ + * (2 × 2 × 2). + * + * @method pow + * @param {Number} n base of the exponential expression. + * @param {Number} e power by which to raise the base. + * @return {Number} n^e. + * @example + *
                              + * + * let base = 3; + * + * let d = pow(base, 1); + * circle(10, 10, d); + * + * d = pow(base, 2); + * circle(20, 20, d); + * + * d = pow(base, 3); + * circle(40, 40, d); + * + * d = pow(base, 4); + * circle(80, 80, d); + * + * describe('A series of circles that grow exponentially from top left to bottom right.'); + * + *
                              + */ + _main.default.prototype.pow = Math.pow; + /** + * Calculates the integer closest to the `n` parameter. For example, + * `round(133.8)` returns the value 134. + * + * @method round + * @param {Number} n number to round. + * @param {Number} [decimals] number of decimal places to round to, default is 0. + * @return {Integer} rounded number. + * @example + *
                              + * + * let x = round(3.7); + * text(x, width / 2, height / 2); + * + * describe('The number 4 written in middle of canvas.'); + * + *
                              + * + *
                              + * + * let x = round(12.782383, 2); + * text(x, width / 2, height / 2); + * + * describe('The number 12.78 written in middle of canvas.'); + * + *
                              + */ + _main.default.prototype.round = function (n, decimals) { + if (!decimals) { + return Math.round(n); + } + var multiplier = Math.pow(10, decimals); + return Math.round(n * multiplier) / multiplier; + }; + /** + * Squares a number, which means multiplying the number by itself. The value + * returned is always a positive number. + * + * For example, `sq(3)` evaluates 3 × 3 which is 9. `sq(-3)` evaluates + * -3 × -3 which is also 9. Multiplying two negative numbers produces + * a positive number. + * + * @method sq + * @param {Number} n number to square. + * @return {Number} squared number. + * @example + *
                              + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 0.01 * sq(x); + * point(x, y); + * + * describe('A series of black dots that get higher quickly from left to right.'); + * } + * + *
                              + */ + _main.default.prototype.sq = function (n) { + return n * n; + }; + /** + * Calculates the square root of a number. A number's square root can be + * multiplied by itself to produce the original number. + * + * For example, `sqrt(9)` returns 3 because 3 × 3 = 9. `sqrt()` always + * returns a positive value. `sqrt()` doesn't work with negative arguments + * such as `sqrt(-9)`. + * + * @method sqrt + * @param {Number} n non-negative number to square root. + * @return {Number} square root of number. + * @example + *
                              + * + * function draw() { + * // Invert the y-axis. + * scale(1, -1); + * translate(0, -height); + * + * let x = frameCount; + * let y = 5 * sqrt(x); + * point(x, y); + * + * describe('A series of black dots that get higher slowly from left to right.'); + * } + * + *
                              + */ + _main.default.prototype.sqrt = Math.sqrt; + /** + * Calculates the fractional part of a number. For example, + * `fract(12.34)` returns 0.34. + * + * @method fract + * @param {Number} n number whose fractional part will be found. + * @returns {Number} fractional part of n. + * @example + *
                              + * + * let n = 56.78; + * text(n, 20, 33); + * let f = fract(n); + * text(f, 20, 66); + * + * describe('The number 56.78 written above the number 0.78.'); + * + *
                              + */ + _main.default.prototype.fract = function (toConvert) { + _main.default._validateParameters('fract', arguments); + var sign = 0; + var num = Number(toConvert); + if (isNaN(num) || Math.abs(num) === Infinity) { + return num; + } else if (num < 0) { + num = - num; + sign = 1; + } + if (String(num).includes('.') && !String(num).includes('e')) { + var toFract = String(num); + toFract = Number('0' + toFract.slice(toFract.indexOf('.'))); + return Math.abs(sign - toFract); + } else if (num < 1) { + return Math.abs(sign - num); + } else { + return 0; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.math.hypot': 188, + 'core-js/modules/es.number.constructor': 191, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 329: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.slice'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [ + null + ]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } /** + * @module Math + * @submodule Vector + * @for p5 + * @requires core + */ + /** + * Creates a new p5.Vector object. A vector is like + * an arrow pointing in space. Vectors have both magnitude (length) + * and direction. Calling `createVector()` without arguments sets the new + * vector's components to 0. + * + * p5.Vector objects are often used to program + * motion because they simplify the math. For example, a moving ball has a + * position and a velocity. Position describes where the ball is in space. The + * ball's position vector extends from the origin to the ball's center. + * Velocity describes the ball's speed and the direction it's moving. If the + * ball is moving straight up, its velocity vector points straight up. Adding + * the ball's velocity vector to its position vector moves it, as in + * `pos.add(vel)`. Vector math relies on methods inside the + * p5.Vector class. + * + * @method createVector + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @return {p5.Vector} new p5.Vector object. + * @example + *
                              + * + * let p1 = createVector(25, 25); + * let p2 = createVector(50, 50); + * let p3 = createVector(75, 75); + * + * strokeWeight(5); + * point(p1); + * point(p2); + * point(p3); + * + * describe('Three black dots form a diagonal line from top left to bottom right.'); + * + *
                              + * + *
                              + * + * let pos; + * let vel; + * + * function setup() { + * createCanvas(100, 100); + * pos = createVector(width / 2, height); + * vel = createVector(0, -1); + * } + * + * function draw() { + * background(200); + * + * pos.add(vel); + * + * if (pos.y < 0) { + * pos.y = height; + * } + * + * strokeWeight(5); + * point(pos); + * + * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); + * } + * + *
                              + */ + + _main.default.prototype.createVector = function (x, y, z) { + if (this instanceof _main.default) { + return _construct(_main.default.Vector, [ + this._fromRadians.bind(this), + this._toRadians.bind(this) + ].concat(Array.prototype.slice.call(arguments))); + } else { + return new _main.default.Vector(x, y, z); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.to-string': 206 + } + ], + 330: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } ////////////////////////////////////////////////////////////// + // http://mrl.nyu.edu/~perlin/noise/ + // Adapting from PApplet.java + // which was adapted from toxi + // which was adapted from the german demo group farbrausch + // as used in their demo "art": http://www.farb-rausch.de/fr010src.zip + // someday we might consider using "improved noise" + // http://mrl.nyu.edu/~perlin/paper445.pdf + // See: https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/ + // blob/main/introduction/Noise1D/noise.js + /** + * @module Math + * @submodule Noise + * @for p5 + * @requires core + */ + + var PERLIN_YWRAPB = 4; + var PERLIN_YWRAP = 1 << PERLIN_YWRAPB; + var PERLIN_ZWRAPB = 8; + var PERLIN_ZWRAP = 1 << PERLIN_ZWRAPB; + var PERLIN_SIZE = 4095; + var perlin_octaves = 4; // default to medium smooth + var perlin_amp_falloff = 0.5; // 50% reduction/octave + var scaled_cosine = function scaled_cosine(i) { + return 0.5 * (1 - Math.cos(i * Math.PI)); + }; + var perlin; // will be initialized lazily by noise() or noiseSeed() + /** + * Returns random numbers that can be tuned to feel more organic. The values + * returned will always be between 0 and 1. + * + * Values returned by random() and + * randomGaussian() can change by large + * amounts between function calls. By contrast, values returned by `noise()` + * can be made "smooth". Calls to `noise()` with similar inputs will produce + * similar outputs. `noise()` is used to create textures, motion, shapes, + * terrains, and so on. Ken Perlin invented `noise()` while animating the + * original Tron film in the 1980s. + * + * `noise()` returns the same value for a given input while a sketch is + * running. It produces different results each time a sketch runs. The + * noiseSeed() function can be used to generate + * the same sequence of Perlin noise values each time a sketch runs. + * + * The character of the noise can be adjusted in two ways. The first way is to + * scale the inputs. `noise()` interprets inputs as coordinates. The sequence + * of noise values will be smoother when the input coordinates are closer. The + * second way is to use the noiseDetail() + * function. + * + * The version of `noise()` with one parameter computes noise values in one + * dimension. This dimension can be thought of as space, as in `noise(x)`, or + * time, as in `noise(t)`. + * + * The version of `noise()` with two parameters computes noise values in two + * dimensions. These dimensions can be thought of as space, as in + * `noise(x, y)`, or space and time, as in `noise(x, t)`. + * + * The version of `noise()` with three parameters computes noise values in + * three dimensions. These dimensions can be thought of as space, as in + * `noise(x, y, z)`, or space and time, as in `noise(x, y, t)`. + * + * @method noise + * @param {Number} x x-coordinate in noise space. + * @param {Number} [y] y-coordinate in noise space. + * @param {Number} [z] z-coordinate in noise space. + * @return {Number} Perlin noise value at specified coordinates. + * @example + *
                              + * + * function draw() { + * background(200); + * + * let x = 100 * noise(0.005 * frameCount); + * let y = 100 * noise(0.005 * frameCount + 10000); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves randomly on a gray square.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let noiseLevel = 100; + * let noiseScale = 0.005; + * // Scale input coordinate. + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let x = noiseLevel * noise(nt); + * let y = noiseLevel * noise(nt + 10000); + * // Render. + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves randomly on a gray square.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * let noiseLevel = 100; + * let noiseScale = 0.02; + * // Scale input coordinate. + * let x = frameCount; + * let nx = noiseScale * x; + * // Compute noise value. + * let y = noiseLevel * noise(nx); + * // Render. + * line(x, 0, x, y); + * + * describe('A hilly terrain drawn in gray against a black sky.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let noiseLevel = 100; + * let noiseScale = 0.002; + * for (let x = 0; x < width; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let y = noiseLevel * noise(nx, nt); + * // Render. + * line(x, 0, x, y); + * } + * + * describe('A calm sea drawn in gray against a black sky.'); + * } + * + *
                              + * + *
                              + * + * let noiseLevel = 255; + * let noiseScale = 0.01; + * for (let y = 0; y < height; y += 1) { + * for (let x = 0; x < width; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let ny = noiseScale * y; + * // Compute noise value. + * let c = noiseLevel * noise(nx, ny); + * // Render. + * stroke(c); + * point(x, y); + * } + * } + * + * describe('A gray cloudy pattern.'); + * + *
                              + * + *
                              + * + * function draw() { + * let noiseLevel = 255; + * let noiseScale = 0.009; + * for (let y = 0; y < height; y += 1) { + * for (let x = 0; x < width; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let ny = noiseScale * y; + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let c = noiseLevel * noise(nx, ny, nt); + * // Render. + * stroke(c); + * point(x, y); + * } + * } + * + * describe('A gray cloudy pattern that changes.'); + * } + * + *
                              + */ + _main.default.prototype.noise = function (x) { + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + if (perlin == null) { + perlin = new Array(PERLIN_SIZE + 1); + for (var i = 0; i < PERLIN_SIZE + 1; i++) { + perlin[i] = Math.random(); + } + } + if (x < 0) { + x = - x; + } + if (y < 0) { + y = - y; + } + if (z < 0) { + z = - z; + } + var xi = Math.floor(x), + yi = Math.floor(y), + zi = Math.floor(z); + var xf = x - xi; + var yf = y - yi; + var zf = z - zi; + var rxf, + ryf; + var r = 0; + var ampl = 0.5; + var n1, + n2, + n3; + for (var o = 0; o < perlin_octaves; o++) { + var of = xi + (yi << PERLIN_YWRAPB) + (zi << PERLIN_ZWRAPB); + rxf = scaled_cosine(xf); + ryf = scaled_cosine(yf); + n1 = perlin[of & PERLIN_SIZE]; + n1 += rxf * (perlin[of + 1 & PERLIN_SIZE] - n1); + n2 = perlin[of + PERLIN_YWRAP & PERLIN_SIZE]; + n2 += rxf * (perlin[of + PERLIN_YWRAP + 1 & PERLIN_SIZE] - n2); + n1 += ryf * (n2 - n1); + of += PERLIN_ZWRAP; + n2 = perlin[of & PERLIN_SIZE]; + n2 += rxf * (perlin[of + 1 & PERLIN_SIZE] - n2); + n3 = perlin[of + PERLIN_YWRAP & PERLIN_SIZE]; + n3 += rxf * (perlin[of + PERLIN_YWRAP + 1 & PERLIN_SIZE] - n3); + n2 += ryf * (n3 - n2); + n1 += scaled_cosine(zf) * (n2 - n1); + r += n1 * ampl; + ampl *= perlin_amp_falloff; + xi <<= 1; + xf *= 2; + yi <<= 1; + yf *= 2; + zi <<= 1; + zf *= 2; + if (xf >= 1) { + xi++; + xf--; + } + if (yf >= 1) { + yi++; + yf--; + } + if (zf >= 1) { + zi++; + zf--; + } + } + return r; + }; + /** + * Adjusts the character of the noise produced by the + * noise() function. + * + * Perlin noise values are created by adding layers of noise together. The + * noise layers, called octaves, are similar to harmonics in music. Lower + * octaves contribute more to the output signal. They define the overall + * intensity of the noise. Higher octaves create finer-grained details. + * + * By default, noise values are created by combining four octaves. Each higher + * octave contributes half as much (50% less) compared to its predecessor. + * `noiseDetail()` changes the number of octaves and the falloff amount. For + * example, calling `noiseDetail(6, 0.25)` ensures that + * noise() will use six octaves. Each higher octave + * will contribute 25% as much (75% less) compared to its predecessor. Falloff + * values between 0 and 1 are valid. However, falloff values greater than 0.5 + * might result in noise values greater than 1. + * + * @method noiseDetail + * @param {Number} lod number of octaves to be used by the noise. + * @param {Number} falloff falloff factor for each octave. + * @example + *
                              + * + * let noiseLevel = 255; + * let noiseScale = 0.02; + * for (let y = 0; y < height; y += 1) { + * for (let x = 0; x < width / 2; x += 1) { + * // Scale input coordinates. + * let nx = noiseScale * x; + * let ny = noiseScale * y; + * + * // Compute noise value. + * noiseDetail(6, 0.25); + * let c = noiseLevel * noise(nx, ny); + * // Render left side. + * stroke(c); + * point(x, y); + * + * // Compute noise value. + * noiseDetail(4, 0.5); + * c = noiseLevel * noise(nx, ny); + * // Render right side. + * stroke(c); + * point(x + width / 2, y); + * } + * } + * + * describe('Two gray cloudy patterns. The pattern on the right is cloudier than the pattern on the left.'); + * + *
                              + */ + _main.default.prototype.noiseDetail = function (lod, falloff) { + if (lod > 0) { + perlin_octaves = lod; + } + if (falloff > 0) { + perlin_amp_falloff = falloff; + } + }; + /** + * Sets the seed value for noise(). By default, + * noise() produces different results each time + * a sketch is run. Calling `noiseSeed()` with a constant + * argument, such as `noiseSeed(99)`, makes noise() + * produce the same results each time a sketch is run. + * + * @method noiseSeed + * @param {Number} seed seed value. + * @example + *
                              + * + * function setup() { + * noiseSeed(99); + * background(255); + * } + * + * function draw() { + * let noiseLevel = 100; + * let noiseScale = 0.005; + * // Scale input coordinate. + * let nt = noiseScale * frameCount; + * // Compute noise value. + * let x = noiseLevel * noise(nt); + * // Render. + * line(x, 0, x, height); + * + * describe('A black rectangle that grows randomly, first to the right and then to the left.'); + * } + * + *
                              + */ + _main.default.prototype.noiseSeed = function (seed) { + // Linear Congruential Generator + // Variant of a Lehman Generator + var lcg = function () { + // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes + // m is basically chosen to be large (as it is the max period) + // and for its relationships to a and c + var m = 4294967296; + // a - 1 should be divisible by m's prime factors + var a = 1664525; + // c and m should be co-prime + var c = 1013904223; + var seed, + z; + return { + setSeed: function setSeed(val) { + // pick a random seed if val is undefined or null + // the >>> 0 casts the seed to an unsigned 32-bit integer + z = seed = (val == null ? Math.random() * m : val) >>> 0; + }, + getSeed: function getSeed() { + return seed; + }, + rand: function rand() { + // define the recurrence relationship + z = (a * z + c) % m; + // return a float in [0, 1) + // if z = m then z / m = 0 therefore (z % m) / m < 1 always + return z / m; + } + }; + }(); + lcg.setSeed(seed); + perlin = new Array(PERLIN_SIZE + 1); + for (var i = 0; i < PERLIN_SIZE + 1; i++) { + perlin[i] = lcg.rand(); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298 + } + ], + 331: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.math.sign'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.number.is-finite'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.math.sign'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.number.is-finite'); + _dereq_('core-js/modules/es.string.sub'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Math + * @submodule Vector + * @requires constants + */ + /// HELPERS FOR REMAINDER METHOD + + var calculateRemainder2D = function calculateRemainder2D(xComponent, yComponent) { + if (xComponent !== 0) { + this.x = this.x % xComponent; + } + if (yComponent !== 0) { + this.y = this.y % yComponent; + } + return this; + }; + var calculateRemainder3D = function calculateRemainder3D(xComponent, yComponent, zComponent) { + if (xComponent !== 0) { + this.x = this.x % xComponent; + } + if (yComponent !== 0) { + this.y = this.y % yComponent; + } + if (zComponent !== 0) { + this.z = this.z % zComponent; + } + return this; + }; + /** + * A class to describe a two or three-dimensional vector. A vector is like an + * arrow pointing in space. Vectors have both magnitude (length) and + * direction. + * + * `p5.Vector` objects are often used to program motion because they simplify + * the math. For example, a moving ball has a position and a velocity. + * Position describes where the ball is in space. The ball's position vector + * extends from the origin to the ball's center. Velocity describes the ball's + * speed and the direction it's moving. If the ball is moving straight up, its + * velocity vector points straight up. Adding the ball's velocity vector to + * its position vector moves it, as in `pos.add(vel)`. Vector math relies on + * methods inside the `p5.Vector` class. + * + * @class p5.Vector + * @constructor + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @example + *
                              + * + * let p1 = createVector(25, 25); + * let p2 = createVector(75, 75); + * + * strokeWeight(5); + * point(p1); + * point(p2.x, p2.y); + * + * describe('Two black dots on a gray square, one at the top left and the other at the bottom right.'); + * + *
                              + * + *
                              + * + * let pos; + * let vel; + * + * function setup() { + * createCanvas(100, 100); + * pos = createVector(width / 2, height); + * vel = createVector(0, -1); + * } + * + * function draw() { + * background(200); + * + * pos.add(vel); + * + * if (pos.y < 0) { + * pos.y = height; + * } + * + * strokeWeight(5); + * point(pos); + * + * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); + * } + * + *
                              + */ + _main.default.Vector = /*#__PURE__*/ function () { + // This is how it comes in with createVector() + // This check if the first argument is a function + function _class() { + _classCallCheck(this, _class); + var x, + y, + z; + if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'function') { + this.isPInst = true; + this._fromRadians = arguments.length <= 0 ? undefined : arguments[0]; + this._toRadians = arguments.length <= 1 ? undefined : arguments[1]; + x = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + y = (arguments.length <= 3 ? undefined : arguments[3]) || 0; + z = (arguments.length <= 4 ? undefined : arguments[4]) || 0; + // This is what we'll get with new p5.Vector() + } else { + x = (arguments.length <= 0 ? undefined : arguments[0]) || 0; + y = (arguments.length <= 1 ? undefined : arguments[1]) || 0; + z = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + } /** + * The x component of the vector + * @type {Number} + * @property x + * @name x + */ + + this.x = x; + /** + * The y component of the vector + * @type {Number} + * @property y + * @name y + */ + this.y = y; + /** + * The z component of the vector + * @type {Number} + * @property z + * @name z + */ + this.z = z; + } /** + * Returns a string representation of a vector. This method is useful for + * printing vectors to the console while debugging. + * @method toString + * @return {String} string representation of the vector. + * @example + *
                              + * + * function setup() { + * let v = createVector(20, 30); + * // Prints 'p5.Vector Object : [20, 30, 0]'. + * print(v.toString()); + * } + * + *
                              + */ + + _createClass(_class, [ + { + key: 'toString', + value: function toString() { + return 'p5.Vector Object : ['.concat(this.x, ', ').concat(this.y, ', ').concat(this.z, ']'); + } /** + * Sets the `x`, `y`, and `z` components of the vector using separate numbers, + * a p5.Vector object, or an array of numbers. + * Calling `set()` with no arguments sets the vector's components to 0. + * + * @method set + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @chainable + * @example + *
                              + * + * strokeWeight(5); + * + * // Top left. + * let pos = createVector(25, 25); + * point(pos); + * + * // Top right. + * pos.set(75, 25); + * point(pos); + * + * // Bottom right. + * let p2 = createVector(75, 75); + * pos.set(p2); + * point(pos); + * + * // Bottom left. + * let arr = [25, 75]; + * pos.set(arr); + * point(pos); + * + * describe('Four black dots arranged in a square on a gray background.'); + * + *
                              + */ + /** + * @method set + * @param {p5.Vector|Number[]} value vector to set. + * @chainable + */ + + }, + { + key: 'set', + value: function set(x, y, z) { + if (x instanceof _main.default.Vector) { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + return this; + } + if (Array.isArray(x)) { + this.x = x[0] || 0; + this.y = x[1] || 0; + this.z = x[2] || 0; + return this; + } + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + return this; + } /** + * Returns a copy of the p5.Vector object. + * + * @method copy + * @return {p5.Vector} copy of the p5.Vector object. + * @example + *
                              + * + * let pos = createVector(50, 50); + * let pc = pos.copy(); + * + * strokeWeight(5); + * point(pc); + * + * describe('A black point drawn in the middle of a gray square.'); + * + *
                              + */ + + }, + { + key: 'copy', + value: function copy() { + if (this.isPInst) { + return new _main.default.Vector(this._fromRadians, this._toRadians, this.x, this.y, this.z); + } else { + return new _main.default.Vector(this.x, this.y, this.z); + } + } /** + * Adds to a vector's `x`, `y`, and `z` components using separate numbers, + * another p5.Vector object, or an array of numbers. + * Calling `add()` with no arguments has no effect. + * + * The static version of `add()`, as in `p5.Vector.add(v2, v1)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method add + * @param {Number} x x component of the vector to be added. + * @param {Number} [y] y component of the vector to be added. + * @param {Number} [z] z component of the vector to be added. + * @chainable + * @example + *
                              + * + * strokeWeight(5); + * + * // Top left. + * let pos = createVector(25, 25); + * point(pos); + * + * // Top right. + * pos.add(50, 0); + * point(pos); + * + * // Bottom right. + * let p2 = createVector(0, 50); + * pos.add(p2); + * point(pos); + * + * // Bottom left. + * let arr = [-50, 0]; + * pos.add(arr); + * point(pos); + * + * describe('Four black dots arranged in a square on a gray background.'); + * + *
                              + * + *
                              + * + * // Top left. + * let p1 = createVector(25, 25); + * + * // Center. + * let p2 = createVector(50, 50); + * + * // Bottom right. + * let p3 = p5.Vector.add(p1, p2); + * + * strokeWeight(5); + * point(p1); + * point(p2); + * point(p3); + * + * describe('Three black dots in a diagonal line from top left to bottom right.'); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = createVector(-30, 20); + * drawArrow(v1, v2, 'blue'); + * + * let v3 = p5.Vector.add(v1, v2); + * drawArrow(origin, v3, 'purple'); + * + * describe('Three arrows drawn on a gray square. A red arrow extends from the top left corner to the center. A blue arrow extends from the tip of the red arrow. A purple arrow extends from the origin to the tip of the blue arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + /** + * @method add + * @param {p5.Vector|Number[]} value The vector to add + * @chainable + */ + + }, + { + key: 'add', + value: function add(x, y, z) { + if (x instanceof _main.default.Vector) { + this.x += x.x || 0; + this.y += x.y || 0; + this.z += x.z || 0; + return this; + } + if (Array.isArray(x)) { + this.x += x[0] || 0; + this.y += x[1] || 0; + this.z += x[2] || 0; + return this; + } + this.x += x || 0; + this.y += y || 0; + this.z += z || 0; + return this; + } /** + * Performs modulo (remainder) division with a vector's `x`, `y`, and `z` + * components using separate numbers, another + * p5.Vector object, or an array of numbers. + * + * The static version of `rem()` as in `p5.Vector.rem(v2, v1)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method rem + * @param {Number} x x component of divisor vector. + * @param {Number} y y component of divisor vector. + * @param {Number} z z component of divisor vector. + * @chainable + * @example + *
                              + * + * let v = createVector(3, 4, 5); + * v.rem(2, 3, 4); + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v1 = createVector(3, 4, 5); + * let v2 = createVector(2, 3, 4); + * v1.rem(v2); + * + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * let v = createVector(3, 4, 5); + * let arr = [2, 3, 4]; + * v.rem(arr); + * + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v1 = createVector(3, 4, 5); + * let v2 = createVector(2, 3, 4); + * let v3 = p5.Vector.rem(v1, v2); + * + * // Prints 'p5.Vector Object : [1, 1, 1]'. + * print(v3.toString()); + * + *
                              + */ + /** + * @method rem + * @param {p5.Vector | Number[]} value divisor vector. + * @chainable + */ + + }, + { + key: 'rem', + value: function rem(x, y, z) { + if (x instanceof _main.default.Vector) { + if ([x.x, + x.y, + x.z].every(Number.isFinite)) { + var xComponent = parseFloat(x.x); + var yComponent = parseFloat(x.y); + var zComponent = parseFloat(x.z); + return calculateRemainder3D.call(this, xComponent, yComponent, zComponent); + } + } else if (Array.isArray(x)) { + if (x.every(function (element) { + return Number.isFinite(element); + })) { + if (x.length === 2) { + return calculateRemainder2D.call(this, x[0], x[1]); + } + if (x.length === 3) { + return calculateRemainder3D.call(this, x[0], x[1], x[2]); + } + } + } else if (arguments.length === 1) { + if (Number.isFinite(arguments[0]) && arguments[0] !== 0) { + this.x = this.x % arguments[0]; + this.y = this.y % arguments[0]; + this.z = this.z % arguments[0]; + return this; + } + } else if (arguments.length === 2) { + var vectorComponents = Array.prototype.slice.call(arguments); + if (vectorComponents.every(function (element) { + return Number.isFinite(element); + })) { + if (vectorComponents.length === 2) { + return calculateRemainder2D.call(this, vectorComponents[0], vectorComponents[1]); + } + } + } else if (arguments.length === 3) { + var _vectorComponents = Array.prototype.slice.call(arguments); + if (_vectorComponents.every(function (element) { + return Number.isFinite(element); + })) { + if (_vectorComponents.length === 3) { + return calculateRemainder3D.call(this, _vectorComponents[0], _vectorComponents[1], _vectorComponents[2]); + } + } + } + } /** + * Subtracts from a vector's `x`, `y`, and `z` components using separate + * numbers, another p5.Vector object, or an array of + * numbers. Calling `sub()` with no arguments has no effect. + * + * The static version of `sub()`, as in `p5.Vector.sub(v2, v1)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method sub + * @param {Number} x x component of the vector to subtract. + * @param {Number} [y] y component of the vector to subtract. + * @param {Number} [z] z component of the vector to subtract. + * @chainable + * @example + *
                              + * + * strokeWeight(5); + * + * // Bottom right. + * let pos = createVector(75, 75); + * point(pos); + * + * // Top right. + * pos.sub(0, 50); + * point(pos); + * + * // Top left. + * let p2 = createVector(50, 0); + * pos.sub(p2); + * point(pos); + * + * // Bottom left. + * let arr = [0, -50]; + * pos.sub(arr); + * point(pos); + * + * describe('Four black dots arranged in a square on a gray background.'); + * + *
                              + * + *
                              + * + * // Bottom right. + * let p1 = createVector(75, 75); + * + * // Center. + * let p2 = createVector(50, 50); + * + * // Top left. + * let p3 = p5.Vector.sub(p1, p2); + * + * strokeWeight(5); + * point(p1); + * point(p2); + * point(p3); + * + * describe('Three black dots in a diagonal line from top left to bottom right.'); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = createVector(20, 70); + * drawArrow(origin, v2, 'blue'); + * + * let v3 = p5.Vector.sub(v2, v1); + * drawArrow(v1, v3, 'purple'); + * + * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + /** + * @method sub + * @param {p5.Vector|Number[]} value the vector to subtract + * @chainable + */ + + }, + { + key: 'sub', + value: function sub(x, y, z) { + if (x instanceof _main.default.Vector) { + this.x -= x.x || 0; + this.y -= x.y || 0; + this.z -= x.z || 0; + return this; + } + if (Array.isArray(x)) { + this.x -= x[0] || 0; + this.y -= x[1] || 0; + this.z -= x[2] || 0; + return this; + } + this.x -= x || 0; + this.y -= y || 0; + this.z -= z || 0; + return this; + } /** + * Multiplies a vector's `x`, `y`, and `z` components by the same number, + * separate numbers, the components of another + * p5.Vector object, or an array of numbers. Calling + * `mult()` with no arguments has no effect. + * + * The static version of `mult()`, as in `p5.Vector.mult(v, 2)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method mult + * @param {Number} n The number to multiply with the vector + * @chainable + * @example + *
                              + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * p.mult(2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * p.mult(2, 3); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * let arr = [2, 3]; + * p.mult(arr); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * let p2 = createVector(2, 3); + * p.mult(p2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(25, 25); + * point(p); + * + * let p2 = createVector(2, 3); + * let p3 = p5.Vector.mult(p, p2); + * point(p3); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(25, 25); + * drawArrow(origin, v1, 'red'); + * + * let v2 = p5.Vector.mult(v1, 2); + * drawArrow(origin, v2, 'blue'); + * + * describe('Two arrows extending from the top left corner. The blue arrow is twice the length of the red arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + /** + * @method mult + * @param {Number} x number to multiply with the x component of the vector. + * @param {Number} y number to multiply with the y component of the vector. + * @param {Number} [z] number to multiply with the z component of the vector. + * @chainable + */ + /** + * @method mult + * @param {Number[]} arr array to multiply with the components of the vector. + * @chainable + */ + /** + * @method mult + * @param {p5.Vector} v vector to multiply with the components of the original vector. + * @chainable + */ + + }, + { + key: 'mult', + value: function mult(x, y, z) { + if (x instanceof _main.default.Vector) { + // new p5.Vector will check that values are valid upon construction but it's possible + // that someone could change the value of a component after creation, which is why we still + // perform this check + if (Number.isFinite(x.x) && Number.isFinite(x.y) && Number.isFinite(x.z) && typeof x.x === 'number' && typeof x.y === 'number' && typeof x.z === 'number') { + this.x *= x.x; + this.y *= x.y; + this.z *= x.z; + } else { + console.warn('p5.Vector.prototype.mult:', 'x contains components that are either undefined or not finite numbers'); + } + return this; + } + if (Array.isArray(x)) { + if (x.every(function (element) { + return Number.isFinite(element); + }) && x.every(function (element) { + return typeof element === 'number'; + })) { + if (x.length === 1) { + this.x *= x[0]; + this.y *= x[0]; + this.z *= x[0]; + } else if (x.length === 2) { + this.x *= x[0]; + this.y *= x[1]; + } else if (x.length === 3) { + this.x *= x[0]; + this.y *= x[1]; + this.z *= x[2]; + } + } else { + console.warn('p5.Vector.prototype.mult:', 'x contains elements that are either undefined or not finite numbers'); + } + return this; + } + var vectorComponents = Array.prototype.slice.call(arguments); + if (vectorComponents.every(function (element) { + return Number.isFinite(element); + }) && vectorComponents.every(function (element) { + return typeof element === 'number'; + })) { + if (arguments.length === 1) { + this.x *= x; + this.y *= x; + this.z *= x; + } + if (arguments.length === 2) { + this.x *= x; + this.y *= y; + } + if (arguments.length === 3) { + this.x *= x; + this.y *= y; + this.z *= z; + } + } else { + console.warn('p5.Vector.prototype.mult:', 'x, y, or z arguments are either undefined or not a finite number'); + } + return this; + } /** + * Divides a vector's `x`, `y`, and `z` components by the same number, + * separate numbers, the components of another + * p5.Vector object, or an array of numbers. Calling + * `div()` with no arguments has no effect. + * + * The static version of `div()`, as in `p5.Vector.div(v, 2)`, returns a new + * p5.Vector object and doesn't change the + * originals. + * + * @method div + * @param {number} n The number to divide the vector by + * @chainable + * @example + *
                              + * + * strokeWeight(5); + * + * let p = createVector(50, 50); + * point(p); + * + * p.div(2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * p.div(2, 3); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * let arr = [2, 3]; + * p.div(arr); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * let p2 = createVector(2, 3); + * p.div(p2); + * point(p); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * strokeWeight(5); + * + * let p = createVector(50, 75); + * point(p); + * + * let p2 = createVector(2, 3); + * let p3 = p5.Vector.div(p, p2); + * point(p3); + * + * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = p5.Vector.div(v1, 2); + * drawArrow(origin, v2, 'blue'); + * + * describe('Two arrows extending from the top left corner. The blue arrow is half the length of the red arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + /** + * @method div + * @param {Number} x number to divide with the x component of the vector. + * @param {Number} y number to divide with the y component of the vector. + * @param {Number} [z] number to divide with the z component of the vector. + * @chainable + */ + /** + * @method div + * @param {Number[]} arr array to divide the components of the vector by. + * @chainable + */ + /** + * @method div + * @param {p5.Vector} v vector to divide the components of the original vector by. + * @chainable + */ + + }, + { + key: 'div', + value: function div(x, y, z) { + if (x instanceof _main.default.Vector) { + // new p5.Vector will check that values are valid upon construction but it's possible + // that someone could change the value of a component after creation, which is why we still + // perform this check + if (Number.isFinite(x.x) && Number.isFinite(x.y) && Number.isFinite(x.z) && typeof x.x === 'number' && typeof x.y === 'number' && typeof x.z === 'number') { + var isLikely2D = x.z === 0 && this.z === 0; + if (x.x === 0 || x.y === 0 || !isLikely2D && x.z === 0) { + console.warn('p5.Vector.prototype.div:', 'divide by 0'); + return this; + } + this.x /= x.x; + this.y /= x.y; + if (!isLikely2D) { + this.z /= x.z; + } + } else { + console.warn('p5.Vector.prototype.div:', 'x contains components that are either undefined or not finite numbers'); + } + return this; + } + if (Array.isArray(x)) { + if (x.every(function (element) { + return Number.isFinite(element); + }) && x.every(function (element) { + return typeof element === 'number'; + })) { + if (x.some(function (element) { + return element === 0; + })) { + console.warn('p5.Vector.prototype.div:', 'divide by 0'); + return this; + } + if (x.length === 1) { + this.x /= x[0]; + this.y /= x[0]; + this.z /= x[0]; + } else if (x.length === 2) { + this.x /= x[0]; + this.y /= x[1]; + } else if (x.length === 3) { + this.x /= x[0]; + this.y /= x[1]; + this.z /= x[2]; + } + } else { + console.warn('p5.Vector.prototype.div:', 'x contains components that are either undefined or not finite numbers'); + } + return this; + } + var vectorComponents = Array.prototype.slice.call(arguments); + if (vectorComponents.every(function (element) { + return Number.isFinite(element); + }) && vectorComponents.every(function (element) { + return typeof element === 'number'; + })) { + if (vectorComponents.some(function (element) { + return element === 0; + })) { + console.warn('p5.Vector.prototype.div:', 'divide by 0'); + return this; + } + if (arguments.length === 1) { + this.x /= x; + this.y /= x; + this.z /= x; + } + if (arguments.length === 2) { + this.x /= x; + this.y /= y; + } + if (arguments.length === 3) { + this.x /= x; + this.y /= y; + this.z /= z; + } + } else { + console.warn('p5.Vector.prototype.div:', 'x, y, or z arguments are either undefined or not a finite number'); + } + return this; + } /** + * Returns the magnitude (length) of the vector. + * + * @method mag + * @return {Number} magnitude of the vector. + * @example + *
                              + * + * let p = createVector(30, 40); + * line(0, 0, p.x, p.y); + * + * let m = p.mag(); + * text(m, p.x, p.y); + * + * describe('A diagonal black line extends from the top left corner of a gray square. The number 50 is written at the end of the line.'); + * + *
                              + */ + + }, + { + key: 'mag', + value: function mag() { + return Math.sqrt(this.magSq()); + } /** + * Returns the magnitude (length) of the vector squared. + * + * @method magSq + * @return {number} squared magnitude of the vector. + * @example + *
                              + * + * let p = createVector(30, 40); + * line(0, 0, p.x, p.y); + * + * let m = p.magSq(); + * text(m, p.x, p.y); + * + * describe('A diagonal black line extends from the top left corner of a gray square. The number 2500 is written at the end of the line.'); + * + *
                              + */ + + }, + { + key: 'magSq', + value: function magSq() { + var x = this.x; + var y = this.y; + var z = this.z; + return x * x + y * y + z * z; + } /** + * Returns the dot product of two vectors. The dot product is a number that + * describes the overlap between two vectors. Visually, the dot product can be + * thought of as the "shadow" one vector casts on another. The dot product's + * magnitude is largest when two vectors point in the same or opposite + * directions. Its magnitude is 0 when two vectors form a right angle. + * + * The version of `dot()` with one parameter interprets it as another + * p5.Vector object. + * + * The version of `dot()` with multiple parameters interprets them as the + * `x`, `y`, and `z` components of another vector. + * + * The static version of `dot()`, as in `p5.Vector.dot(v1, v2)`, is the same + * as calling `v1.dot(v2)`. + * + * @method dot + * @param {Number} x x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @return {Number} dot product. + * + * @example + *
                              + * + * let v1 = createVector(3, 4); + * let v2 = createVector(3, 0); + * let dp = v1.dot(v2); + * // Prints "9" to the console. + * print(dp); + * + *
                              + * + *
                              + * + * let v1 = createVector(1, 0); + * let v2 = createVector(0, 1); + * let dp = p5.Vector.dot(v1, v2); + * // Prints "0" to the console. + * print(dp); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let v0 = createVector(width / 2, height / 2); + * let v1 = createVector(30, 0); + * drawArrow(v0, v1, 'black'); + * + * let v2 = createVector(mouseX - width / 2, mouseY - height / 2); + * drawArrow(v0, v2, 'red'); + * + * let dp = v2.dot(v1); + * text(`v2 • v1 = ${dp}`, 15, 20); + * + * describe('Two arrows drawn on a gray square. A black arrow points to the right and a red arrow follows the mouse. The text "v1 • v2 = something" changes as the mouse moves.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + /** + * @method dot + * @param {p5.Vector} v p5.Vector to be dotted. + * @return {Number} + */ + + }, + { + key: 'dot', + value: function dot(x, y, z) { + if (x instanceof _main.default.Vector) { + return this.dot(x.x, x.y, x.z); + } + return this.x * (x || 0) + this.y * (y || 0) + this.z * (z || 0); + } /** + * Returns the cross product of two vectors. The cross product is a vector + * that points straight out of the plane created by two vectors. The cross + * product's magnitude is the area of the parallelogram formed by the original + * two vectors. + * + * The static version of `cross()`, as in `p5.Vector.cross(v1, v2)`, is the same + * as calling `v1.cross(v2)`. + * + * @method cross + * @param {p5.Vector} v p5.Vector to be crossed. + * @return {p5.Vector} cross product as a p5.Vector. + * @example + *
                              + * + * let v1 = createVector(1, 0); + * let v2 = createVector(3, 4); + * let cp = v1.cross(v2); + * // Prints "p5.Vector Object : [0, 0, 4]" to the console. + * print(cp.toString()); + * + *
                              + * + *
                              + * + * let v1 = createVector(1, 0); + * let v2 = createVector(3, 4); + * let cp = p5.Vector.cross(v1, v2); + * // Prints "p5.Vector Object : [0, 0, 4]" to the console. + * print(cp.toString()); + * + *
                              + */ + + }, + { + key: 'cross', + value: function cross(v) { + var x = this.y * v.z - this.z * v.y; + var y = this.z * v.x - this.x * v.z; + var z = this.x * v.y - this.y * v.x; + if (this.isPInst) { + return new _main.default.Vector(this._fromRadians, this._toRadians, x, y, z); + } else { + return new _main.default.Vector(x, y, z); + } + } /** + * Returns the distance between two points represented by vectors. A point's + * coordinates can be thought of as a vector's components. + * + * The static version of `dist()`, as in `p5.Vector.dist(v1, v2)`, is the same + * as calling `v1.dist(v2)`. + * + * Use dist() to calculate the distance between points + * using coordinates as in `dist(x1, y1, x2, y2)`. + * + * @method dist + * @param {p5.Vector} v x, y, and z coordinates of a p5.Vector. + * @return {Number} distance. + * @example + *
                              + * + * let v1 = createVector(1, 0); + * let v2 = createVector(0, 1); + * let d = v1.dist(v2); + * // Prints "1.414..." to the console. + * print(d); + * + *
                              + * + *
                              + * + * let v1 = createVector(1, 0); + * let v2 = createVector(0, 1); + * let d = p5.Vector.dist(v1, v2); + * // Prints "1.414..." to the console. + * print(d); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v1 = createVector(50, 50); + * drawArrow(origin, v1, 'red'); + * + * let v2 = createVector(20, 70); + * drawArrow(origin, v2, 'blue'); + * + * let v3 = p5.Vector.sub(v2, v1); + * drawArrow(v1, v3, 'purple'); + * + * let m = floor(v3.mag()); + * text(m, 50, 75); + * + * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow. The number 36 is written in black near the purple arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'dist', + value: function dist(v) { + return v.copy().sub(this).mag(); + } /** + * Scales the components of a p5.Vector object so + * that its magnitude is 1. + * + * The static version of `normalize()`, as in `p5.Vector.normalize(v)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method normalize + * @return {p5.Vector} normalized p5.Vector. + * @example + *
                              + * + * let v = createVector(10, 20, 2); + * v.normalize(); + * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v0 = createVector(10, 20, 2); + * let v1 = p5.Vector.normalize(v0); + * // Prints "p5.Vector Object : [10, 20, 2]" to the console. + * print(v0.toString()); + * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(240); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(mouseX - 50, mouseY - 50); + * + * let r = 25; + * drawArrow(v0, v1, 'red'); + * v1.normalize(); + * drawArrow(v0, v1.mult(r), 'blue'); + * + * noFill(); + * circle(50, 50, r * 2); + * + * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow's length is fixed to the circle's radius."); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'normalize', + value: function normalize() { + var len = this.mag(); + // here we multiply by the reciprocal instead of calling 'div()' + // since div duplicates this zero check. + if (len !== 0) this.mult(1 / len); + return this; + } /** + * Limits a vector's magnitude to a maximum value. + * + * The static version of `limit()`, as in `p5.Vector.limit(v, 5)`, returns a + * new p5.Vector object and doesn't change the + * original. + * + * @method limit + * @param {Number} max maximum magnitude for the vector. + * @chainable + * @example + *
                              + * + * let v = createVector(10, 20, 2); + * v.limit(5); + * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v0 = createVector(10, 20, 2); + * let v1 = p5.Vector.limit(v0, 5); + * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(240); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(mouseX - 50, mouseY - 50); + * + * let r = 25; + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v1.limit(r), 'blue'); + * + * noFill(); + * circle(50, 50, r * 2); + * + * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow never crosses the circle's edge."); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'limit', + value: function limit(max) { + var mSq = this.magSq(); + if (mSq > max * max) { + this.div(Math.sqrt(mSq)) //normalize it + .mult(max); + } + return this; + } /** + * Sets a vector's magnitude to a given value. + * + * The static version of `setMag()`, as in `p5.Vector.setMag(v, 10)`, returns + * a new p5.Vector object and doesn't change the + * original. + * + * @method setMag + * @param {number} len new length for this vector. + * @chainable + * @example + *
                              + * + * let v = createVector(3, 4, 0); + * // Prints "5" to the console. + * print(v.mag()); + * + * v.setMag(10); + * // Prints "p5.Vector Object : [6, 8, 0]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v0 = createVector(3, 4, 0); + * let v1 = p5.Vector.setMag(v0, 10); + * // Prints "5" to the console. + * print(v0.mag()); + * // Prints "p5.Vector Object : [6, 8, 0]" to the console. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(240); + * + * let origin = createVector(0, 0); + * let v = createVector(50, 50); + * + * drawArrow(origin, v, 'red'); + * + * v.setMag(30); + * drawArrow(origin, v, 'blue'); + * + * describe('Two arrows extend from the top left corner of a square toward its center. The red arrow reaches the center and the blue arrow only extends part of the way.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'setMag', + value: function setMag(n) { + return this.normalize().mult(n); + } /** + * Calculates the angle a 2D vector makes with the positive x-axis. Angles + * increase in the clockwise direction. + * + * If the vector was created with + * createVector(), `heading()` returns angles + * in the units of the current angleMode(). + * + * The static version of `heading()`, as in `p5.Vector.heading(v)`, works the + * same way. + * + * @method heading + * @return {Number} angle of rotation. + * @example + *
                              + * + * let v = createVector(1, 1); + * // Prints "0.785..." to the console. + * print(v.heading()); + * + * angleMode(DEGREES); + * // Prints "45" to the console. + * print(v.heading()); + * + *
                              + * + *
                              + * + * let v = createVector(1, 1); + * // Prints "0.785..." to the console. + * print(p5.Vector.heading(v)); + * + * angleMode(DEGREES); + * // Prints "45" to the console. + * print(p5.Vector.heading(v)); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let origin = createVector(0, 0); + * let v = createVector(50, 50); + * + * drawArrow(origin, v, 'black'); + * + * angleMode(RADIANS); + * let h = round(v.heading(), 2); + * text(`Radians: ${h}`, 20, 70); + * angleMode(DEGREES); + * h = v.heading(); + * text(`Degrees: ${h}`, 20, 85); + * + * describe('A black arrow extends from the top left of a square to its center. The text "Radians: 0.79" and "Degrees: 45" is written near the tip of the arrow.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'heading', + value: function heading() { + var h = Math.atan2(this.y, this.x); + if (this.isPInst) return this._fromRadians(h); + return h; + } /** + * Rotates a 2D vector to a specific angle without changing its magnitude. + * By convention, the positive x-axis has an angle of 0. Angles increase in + * the clockwise direction. + * + * If the vector was created with + * createVector(), `setHeading()` uses + * the units of the current angleMode(). + * + * @method setHeading + * @param {number} angle angle of rotation. + * @chainable + * @example + *
                              + * + * let v = createVector(0, 1); + * // Prints "1.570..." to the console. + * print(v.heading()); + * + * v.setHeading(PI); + * // Prints "3.141..." to the console. + * print(v.heading()); + * + *
                              + * + *
                              + * + * angleMode(DEGREES); + * let v = createVector(0, 1); + * // Prints "90" to the console. + * print(v.heading()); + * + * v.setHeading(180); + * // Prints "180" to the console. + * print(v.heading()); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 0); + * + * drawArrow(v0, v1, 'red'); + * + * v1.setHeading(HALF_PI); + * drawArrow(v0, v1, 'blue'); + * + * describe('Two arrows extend from the center of a gray square. The red arrow points to the right and the blue arrow points down.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'setHeading', + value: function setHeading(a) { + if (this.isPInst) a = this._toRadians(a); + var m = this.mag(); + this.x = m * Math.cos(a); + this.y = m * Math.sin(a); + return this; + } /** + * Rotates a 2D vector by an angle without changing its magnitude. + * By convention, the positive x-axis has an angle of 0. Angles increase in + * the clockwise direction. + * + * If the vector was created with + * createVector(), `rotate()` uses + * the units of the current angleMode(). + * + * The static version of `rotate()`, as in `p5.Vector.rotate(v, PI)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method rotate + * @param {number} angle angle of rotation. + * @chainable + * @example + *
                              + * + * let v = createVector(1, 0); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v.toString()); + * v.rotate(HALF_PI); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * angleMode(DEGREES); + * let v = createVector(1, 0); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v.toString()); + * v.rotate(90); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v0 = createVector(1, 0); + * let v1 = p5.Vector.rotate(v0, HALF_PI); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v0.toString()); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * angleMode(DEGREES); + * let v0 = createVector(1, 0); + * let v1 = p5.Vector.rotate(v0, 90); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v0.toString()); + * // Prints "p5.Vector Object : [0, 1, 0]" to the console. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * let v0; + * let v1; + * + * function setup() { + * v0 = createVector(50, 50); + * v1 = createVector(30, 0); + * } + * + * function draw() { + * background(240); + * + * v1.rotate(0.01); + * + * drawArrow(v0, v1, 'black'); + * + * describe('A black arrow extends from the center of a gray square. The arrow rotates counterclockwise.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'rotate', + value: function rotate(a) { + var newHeading = this.heading() + a; + if (this.isPInst) newHeading = this._toRadians(newHeading); + var mag = this.mag(); + this.x = Math.cos(newHeading) * mag; + this.y = Math.sin(newHeading) * mag; + return this; + } /** + * Returns the angle between two vectors. The angles returned are signed, + * which means that `v1.angleBetween(v2) === -v2.angleBetween(v1)`. + * + * If the vector was created with + * createVector(), `angleBetween()` returns + * angles in the units of the current + * angleMode(). + * + * @method angleBetween + * @param {p5.Vector} value x, y, and z components of a p5.Vector. + * @return {Number} angle between the vectors. + * @example + *
                              + * + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "1.570..." to the console. + * print(v0.angleBetween(v1)); + * // Prints "-1.570..." to the console. + * print(v1.angleBetween(v0)); + * + *
                              + * + *
                              + * + * angleMode(DEGREES); + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "90" to the console. + * print(v0.angleBetween(v1)); + * // Prints "-90" to the console. + * print(v1.angleBetween(v0)); + * + *
                              + * + *
                              + * + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "1.570..." to the console. + * print(p5.Vector.angleBetween(v0, v1)); + * // Prints "-1.570..." to the console. + * print(p5.Vector.angleBetween(v1, v0)); + * + *
                              + * + *
                              + * + * angleMode(DEGREES); + * let v0 = createVector(1, 0); + * let v1 = createVector(0, 1); + * // Prints "90" to the console. + * print(p5.Vector.angleBetween(v0, v1)); + * // Prints "-90" to the console. + * print(p5.Vector.angleBetween(v1, v0)); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 0); + * let v2 = createVector(0, 30); + * + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * + * angleMode(RADIANS); + * let angle = round(v1.angleBetween(v2), 2); + * text(`Radians: ${angle}`, 20, 20); + * angleMode(DEGREES); + * angle = round(v1.angleBetween(v2), 2); + * text(`Degrees: ${angle}`, 20, 35); + * + * describe('Two arrows extend from the center of a gray square. A red arrow points to the right and a blue arrow points down. The text "Radians: 1.57" and "Degrees: 90" is written above the arrows.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'angleBetween', + value: function angleBetween(v) { + var magSqMult = this.magSq() * v.magSq(); + // Returns NaN if either vector is the zero vector. + if (magSqMult === 0) { + return NaN; + } + var u = this.cross(v); + // The dot product computes the cos value, and the cross product computes + // the sin value. Find the angle based on them. In addition, in the case of + // 2D vectors, a sign is added according to the direction of the vector. + var angle = Math.atan2(u.mag(), this.dot(v)) * Math.sign(u.z || 1); + if (this.isPInst) { + angle = this._fromRadians(angle); + } + return angle; + } /** + * Calculates new `x`, `y`, and `z` components that are proportionally the + * same distance between two vectors. The `amt` parameter is the amount to + * interpolate between the old vector and the new vector. 0.0 keeps all + * components equal to the old vector's, 0.5 is halfway between, and 1.0 sets + * all components equal to the new vector's. + * + * The static version of `lerp()`, as in `p5.Vector.lerp(v0, v1, 0.5)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method lerp + * @param {Number} x x component. + * @param {Number} y y component. + * @param {Number} z z component. + * @param {Number} amt amount of interpolation between 0.0 (old vector) + * and 1.0 (new vector). 0.5 is halfway between. + * @chainable + * + * @example + *
                              + * + * let v0 = createVector(1, 1, 1); + * let v1 = createVector(3, 3, 3); + * v0.lerp(v1, 0.5); + * // Prints "p5.Vector Object : [2, 2, 2]" to the console. + * print(v0.toString()); + * + *
                              + * + *
                              + * + * let v = createVector(1, 1, 1); + * v.lerp(3, 3, 3, 0.5); + * // Prints "p5.Vector Object : [2, 2, 2]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let v0 = createVector(1, 1, 1); + * let v1 = createVector(3, 3, 3); + * let v2 = p5.Vector.lerp(v0, v1, 0.5); + * // Prints "p5.Vector Object : [2, 2, 2]" to the console. + * print(v2.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 0); + * let v2 = createVector(0, 30); + * let v3 = p5.Vector.lerp(v1, v2, 0.5); + * + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * drawArrow(v0, v3, 'purple'); + * + * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points down, and a purple arrow points to the bottom right.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + /** + * @method lerp + * @param {p5.Vector} v p5.Vector to lerp toward. + * @param {Number} amt + * @chainable + */ + + }, + { + key: 'lerp', + value: function lerp(x, y, z, amt) { + if (x instanceof _main.default.Vector) { + return this.lerp(x.x, x.y, x.z, y); + } + this.x += (x - this.x) * amt || 0; + this.y += (y - this.y) * amt || 0; + this.z += (z - this.z) * amt || 0; + return this; + } /** + * Calculates a new heading and magnitude that are between two vectors. The + * `amt` parameter is the amount to interpolate between the old vector and + * the new vector. 0.0 keeps the heading and magnitude equal to the old + * vector's, 0.5 sets them halfway between, and 1.0 sets the heading and + * magnitude equal to the new vector's. + * + * `slerp()` differs from lerp() because + * it interpolates magnitude. Calling `v0.slerp(v1, 0.5)` sets `v0`'s + * magnitude to a value halfway between its original magnitude and `v1`'s. + * Calling `v0.lerp(v1, 0.5)` makes no such guarantee. + * + * The static version of `slerp()`, as in `p5.Vector.slerp(v0, v1, 0.5)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method slerp + * @param {p5.Vector} v p5.Vector to slerp toward. + * @param {Number} amt amount of interpolation between 0.0 (old vector) + * and 1.0 (new vector). 0.5 is halfway between. + * @return {p5.Vector} + * + * @example + *
                              + * + * let v0 = createVector(3, 0); + * // Prints "3" to the console. + * print(v0.mag()); + * // Prints "0" to the console. + * print(v0.heading()); + * + * let v1 = createVector(0, 1); + * // Prints "1" to the console. + * print(v1.mag()); + * // Prints "1.570..." to the console. + * print(v1.heading()); + * + * v0.slerp(v1, 0.5); + * // Prints "2" to the console. + * print(v0.mag()); + * // Prints "0.785..." to the console. + * print(v0.heading()); + * + *
                              + * + *
                              + * + * let v0 = createVector(3, 0); + * // Prints "3" to the console. + * print(v0.mag()); + * // Prints "0" to the console. + * print(v0.heading()); + * + * let v1 = createVector(0, 1); + * // Prints "1" to the console. + * print(v1.mag()); + * // Prints "1.570..." to the console. + * print(v1.heading()); + * + * let v3 = p5.Vector.slerp(v0, v1, 0.5); + * // Prints "2" to the console. + * print(v3.mag()); + * // Prints "0.785..." to the console. + * print(v3.heading()); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(20, 0); + * let v2 = createVector(-40, 0); + * let v3 = p5.Vector.slerp(v1, v2, 0.5); + * + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * drawArrow(v0, v3, 'purple'); + * + * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points to the left, and a purple arrow points down.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'slerp', + value: function slerp(v, amt) { + // edge cases. + if (amt === 0) { + return this; + } + if (amt === 1) { + return this.set(v); + } // calculate magnitudes + + var selfMag = this.mag(); + var vMag = v.mag(); + var magmag = selfMag * vMag; + // if either is a zero vector, linearly interpolate by these vectors + if (magmag === 0) { + this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); + return this; + } // the cross product of 'this' and 'v' is the axis of rotation + + var axis = this.cross(v); + var axisMag = axis.mag(); + // Calculates the angle between 'this' and 'v' + var theta = Math.atan2(axisMag, this.dot(v)); + // However, if the norm of axis is 0, normalization cannot be performed, + // so we will divide the cases + if (axisMag > 0) { + axis.x /= axisMag; + axis.y /= axisMag; + axis.z /= axisMag; + } else if (theta < Math.PI * 0.5) { + // if the norm is 0 and the angle is less than PI/2, + // the angle is very close to 0, so do linear interpolation. + this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); + return this; + } else { + // If the norm is 0 and the angle is more than PI/2, the angle is + // very close to PI. + // In this case v can be regarded as '-this', so take any vector + // that is orthogonal to 'this' and use that as the axis. + if (this.z === 0 && v.z === 0) { + // if both this and v are 2D vectors, use (0,0,1) + // this makes the result also a 2D vector. + axis.set(0, 0, 1); + } else if (this.x !== 0) { + // if the x components is not 0, use (y, -x, 0) + axis.set(this.y, - this.x, 0).normalize(); + } else { + // if the x components is 0, use (1,0,0) + axis.set(1, 0, 0); + } + } // Since 'axis' is a unit vector, ey is a vector of the same length as 'this'. + + var ey = axis.cross(this); + // interpolate the length with 'this' and 'v'. + var lerpedMagFactor = 1 - amt + amt * vMag / selfMag; + // imagine a situation where 'axis', 'this', and 'ey' are pointing + // along the z, x, and y axes, respectively. + // rotates 'this' around 'axis' by amt * theta towards 'ey'. + var cosMultiplier = lerpedMagFactor * Math.cos(amt * theta); + var sinMultiplier = lerpedMagFactor * Math.sin(amt * theta); + // then, calculate 'result'. + this.x = this.x * cosMultiplier + ey.x * sinMultiplier; + this.y = this.y * cosMultiplier + ey.y * sinMultiplier; + this.z = this.z * cosMultiplier + ey.z * sinMultiplier; + return this; + } /** + * Reflects a vector about a line in 2D or a plane in 3D. The orientation of + * the line or plane is described by a normal vector that points away from the + * shape. + * + * The static version of `reflect()`, as in `p5.Vector.reflect(v, n)`, + * returns a new p5.Vector object and doesn't change + * the original. + * + * @method reflect + * @param {p5.Vector} surfaceNormal p5.Vector + * to reflect about. + * @chainable + * @example + *
                              + * + * let n = createVector(0, 1); + * let v = createVector(4, 6); + * v.reflect(n); + * // Prints "p5.Vector Object : [4, -6, 0]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * let n = createVector(0, 1); + * let v0 = createVector(4, 6); + * let v1 = p5.Vector.reflect(v0, n); + * // Prints "p5.Vector Object : [4, -6, 0]" to the console. + * print(v1.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * line(50, 0, 50, 100); + * let n = createVector(1, 0); + * + * let v0 = createVector(50, 50); + * let v1 = createVector(30, 40); + * let v2 = p5.Vector.reflect(v1, n); + * + * n.setMag(30); + * drawArrow(v0, n, 'black'); + * drawArrow(v0, v1, 'red'); + * drawArrow(v0, v2, 'blue'); + * + * describe('Three arrows extend from the center of a gray square with a vertical line down its middle. A black arrow points to the right, a blue arrow points to the bottom left, and a red arrow points to the bottom right.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'reflect', + value: function reflect(surfaceNormal) { + surfaceNormal.normalize(); + return this.sub(surfaceNormal.mult(2 * this.dot(surfaceNormal))); + } /** + * Returns the vector's components as an array of numbers. + * + * @method array + * @return {Number[]} array with the vector's components. + * @example + *
                              + * + * let v = createVector(20, 30); + * // Prints "[20, 30, 0]" to the console. + * print(v.array()); + * + *
                              + */ + + }, + { + key: 'array', + value: function array() { + return [this.x || 0, + this.y || 0, + this.z || 0]; + } /** + * Returns `true` if the vector's components are all the same as another + * vector's and `false` if not. + * + * The version of `equals()` with one parameter interprets it as another + * p5.Vector object. + * + * The version of `equals()` with multiple parameters interprets them as the + * components of another vector. Any missing parameters are assigned the value + * 0. + * + * The static version of `equals()`, as in `p5.Vector.equals(v0, v1)`, + * interprets both parameters as p5.Vector objects. + * + * @method equals + * @param {Number} [x] x component of the vector. + * @param {Number} [y] y component of the vector. + * @param {Number} [z] z component of the vector. + * @return {Boolean} whether the vectors are equal. + * @example + *
                              + * + * let v0 = createVector(10, 20, 30); + * let v1 = createVector(10, 20, 30); + * let v2 = createVector(0, 0, 0); + * + * // Prints "true" to the console. + * print(v0.equals(v1)); + * // Prints "false" to the console. + * print(v0.equals(v2)); + * + *
                              + * + *
                              + * + * let v0 = createVector(5, 10, 20); + * let v1 = createVector(5, 10, 20); + * let v2 = createVector(13, 10, 19); + * + * // Prints "true" to the console. + * print(v0.equals(v1.x, v1.y, v1.z)); + * // Prints "false" to the console. + * print(v0.equals(v2.x, v2.y, v2.z)); + * + *
                              + * + *
                              + * + * let v0 = createVector(10, 20, 30); + * let v1 = createVector(10, 20, 30); + * let v2 = createVector(0, 0, 0); + * + * // Prints "true" to the console. + * print(p5.Vector.equals(v0, v1)); + * // Prints "false" to the console. + * print(p5.Vector.equals(v0, v2)); + * + *
                              + */ + /** + * @method equals + * @param {p5.Vector|Array} value vector to compare. + * @return {Boolean} + */ + + }, + { + key: 'equals', + value: function equals(x, y, z) { + var a, + b, + c; + if (x instanceof _main.default.Vector) { + a = x.x || 0; + b = x.y || 0; + c = x.z || 0; + } else if (Array.isArray(x)) { + a = x[0] || 0; + b = x[1] || 0; + c = x[2] || 0; + } else { + a = x || 0; + b = y || 0; + c = z || 0; + } + return this.x === a && this.y === b && this.z === c; + } // Static Methods + /** + * Make a new 2D vector from an angle. + * + * @method fromAngle + * @static + * @param {Number} angle desired angle, in radians. Unaffected by angleMode(). + * @param {Number} [length] length of the new vector (defaults to 1). + * @return {p5.Vector} new p5.Vector object. + * @example + *
                              + * + * let v = p5.Vector.fromAngle(0); + * // Prints "p5.Vector Object : [1, 0, 0]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * let v0 = createVector(50, 50); + * let v1 = p5.Vector.fromAngle(0, 30); + * + * drawArrow(v0, v1, 'black'); + * + * describe('A black arrow extends from the center of a gray square. It points to the right.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + } + ], [ + { + key: 'fromAngle', + value: function fromAngle(angle, length) { + if (typeof length === 'undefined') { + length = 1; + } + return new _main.default.Vector(length * Math.cos(angle), length * Math.sin(angle), 0); + } /** + * Make a new 3D vector from a pair of ISO spherical angles. + * + * @method fromAngles + * @static + * @param {Number} theta polar angle in radians (zero is up). + * @param {Number} phi azimuthal angle in radians + * (zero is out of the screen). + * @param {Number} [length] length of the new vector (defaults to 1). + * @return {p5.Vector} new p5.Vector object. + * @example + *
                              + * + * let v = p5.Vector.fromAngles(0, 0); + * // Prints "p5.Vector Object : [0, -1, 0]" to the console. + * print(v.toString()); + * + *
                              + * + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(0); + * + * fill(255); + * noStroke(); + * + * let theta = frameCount * 0.05; + * let phi = 0; + * let v = p5.Vector.fromAngles(theta, phi, 100); + * let c = color('deeppink'); + * pointLight(c, v); + * + * sphere(35); + * + * describe('A light shines on a pink sphere as it orbits.'); + * } + * + *
                              + */ + + }, + { + key: 'fromAngles', + value: function fromAngles(theta, phi, length) { + if (typeof length === 'undefined') { + length = 1; + } + var cosPhi = Math.cos(phi); + var sinPhi = Math.sin(phi); + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + return new _main.default.Vector(length * sinTheta * sinPhi, - length * cosTheta, length * sinTheta * cosPhi); + } /** + * Make a new 2D unit vector with a random heading. + * + * @method random2D + * @static + * @return {p5.Vector} new p5.Vector object. + * @example + *
                              + * + * let v = p5.Vector.random2D(); + * // Prints "p5.Vector Object : [x, y, 0]" to the console + * // where x and y are small random numbers. + * print(v.toString()); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * frameRate(1); + * + * let v0 = createVector(50, 50); + * let v1 = p5.Vector.random2D(); + * v1.mult(30); + * drawArrow(v0, v1, 'black'); + * + * describe('A black arrow in extends from the center of a gray square. It changes direction once per second.'); + * } + * + * function drawArrow(base, vec, myColor) { + * push(); + * stroke(myColor); + * strokeWeight(3); + * fill(myColor); + * translate(base.x, base.y); + * line(0, 0, vec.x, vec.y); + * rotate(vec.heading()); + * let arrowSize = 7; + * translate(vec.mag() - arrowSize, 0); + * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); + * pop(); + * } + * + *
                              + */ + + }, + { + key: 'random2D', + value: function random2D() { + return this.fromAngle(Math.random() * constants.TWO_PI); + } /** + * Make a new 3D unit vector with a random heading. + * + * @method random3D + * @static + * @return {p5.Vector} new p5.Vector object. + * @example + *
                              + * + * let v = p5.Vector.random3D(); + * // Prints "p5.Vector Object : [x, y, z]" to the console + * // where x, y, and z are small random numbers. + * print(v.toString()); + * + *
                              + */ + + }, + { + key: 'random3D', + value: function random3D() { + var angle = Math.random() * constants.TWO_PI; + var vz = Math.random() * 2 - 1; + var vzBase = Math.sqrt(1 - vz * vz); + var vx = vzBase * Math.cos(angle); + var vy = vzBase * Math.sin(angle); + return new _main.default.Vector(vx, vy, vz); + } // Returns a copy of a vector. + /** + * @method copy + * @static + * @param {p5.Vector} v the p5.Vector to create a copy of + * @return {p5.Vector} the copy of the p5.Vector object + */ + + }, + { + key: 'copy', + value: function copy(v) { + return v.copy(v); + } // Adds two vectors together and returns a new one. + /** + * @method add + * @static + * @param {p5.Vector} v1 A p5.Vector to add + * @param {p5.Vector} v2 A p5.Vector to add + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} resulting p5.Vector. + */ + + }, + { + key: 'add', + value: function add(v1, v2, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 3) { + _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.add'); + } + } else { + target.set(v1); + } + target.add(v2); + return target; + } // Returns a vector remainder when it is divided by another vector + /** + * @method rem + * @static + * @param {p5.Vector} v1 The dividend p5.Vector + * @param {p5.Vector} v2 The divisor p5.Vector + */ + /** + * @method rem + * @static + * @param {p5.Vector} v1 + * @param {p5.Vector} v2 + * @return {p5.Vector} The resulting p5.Vector + */ + + }, + { + key: 'rem', + value: function rem(v1, v2) { + if (v1 instanceof _main.default.Vector && v2 instanceof _main.default.Vector) { + var target = v1.copy(); + target.rem(v2); + return target; + } + } /* + * Subtracts one p5.Vector from another and returns a new one. The second + * vector (`v2`) is subtracted from the first (`v1`), resulting in `v1-v2`. + */ + /** + * @method sub + * @static + * @param {p5.Vector} v1 A p5.Vector to subtract from + * @param {p5.Vector} v2 A p5.Vector to subtract + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} The resulting p5.Vector + */ + + }, + { + key: 'sub', + value: function sub(v1, v2, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 3) { + _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.sub'); + } + } else { + target.set(v1); + } + target.sub(v2); + return target; + } /** + * Multiplies a vector by a scalar and returns a new vector. + */ + /** + * @method mult + * @static + * @param {Number} x + * @param {Number} y + * @param {Number} [z] + * @return {p5.Vector} resulting new p5.Vector. + */ + /** + * @method mult + * @static + * @param {p5.Vector} v + * @param {Number} n + * @param {p5.Vector} [target] vector to receive the result. + */ + /** + * @method mult + * @static + * @param {p5.Vector} v0 + * @param {p5.Vector} v1 + * @param {p5.Vector} [target] + */ + /** + * @method mult + * @static + * @param {p5.Vector} v0 + * @param {Number[]} arr + * @param {p5.Vector} [target] + */ + + }, + { + key: 'mult', + value: function mult(v, n, target) { + if (!target) { + target = v.copy(); + if (arguments.length === 3) { + _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.mult'); + } + } else { + target.set(v); + } + target.mult(n); + return target; + } /** + * Rotates the vector (only 2D vectors) by the given angle; magnitude remains the same. Returns a new vector. + */ + /** + * @method rotate + * @static + * @param {p5.Vector} v + * @param {Number} angle + * @param {p5.Vector} [target] The vector to receive the result + */ + + }, + { + key: 'rotate', + value: function rotate(v, a, target) { + if (arguments.length === 2) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.rotate'); + } + target.set(v); + } + target.rotate(a); + return target; + } /** + * Divides a vector by a scalar and returns a new vector. + */ + /** + * @method div + * @static + * @param {Number} x + * @param {Number} y + * @param {Number} [z] + * @return {p5.Vector} The resulting new p5.Vector + */ + /** + * @method div + * @static + * @param {p5.Vector} v + * @param {Number} n + * @param {p5.Vector} [target] The vector to receive the result + */ + /** + * @method div + * @static + * @param {p5.Vector} v0 + * @param {p5.Vector} v1 + * @param {p5.Vector} [target] + */ + /** + * @method div + * @static + * @param {p5.Vector} v0 + * @param {Number[]} arr + * @param {p5.Vector} [target] + */ + + }, + { + key: 'div', + value: function div(v, n, target) { + if (!target) { + target = v.copy(); + if (arguments.length === 3) { + _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.div'); + } + } else { + target.set(v); + } + target.div(n); + return target; + } /** + * Calculates the dot product of two vectors. + */ + /** + * @method dot + * @static + * @param {p5.Vector} v1 first p5.Vector. + * @param {p5.Vector} v2 second p5.Vector. + * @return {Number} dot product. + */ + + }, + { + key: 'dot', + value: function dot(v1, v2) { + return v1.dot(v2); + } /** + * Calculates the cross product of two vectors. + */ + /** + * @method cross + * @static + * @param {p5.Vector} v1 first p5.Vector. + * @param {p5.Vector} v2 second p5.Vector. + * @return {Number} cross product. + */ + + }, + { + key: 'cross', + value: function cross(v1, v2) { + return v1.cross(v2); + } /** + * Calculates the Euclidean distance between two points (considering a + * point as a vector object). + */ + /** + * @method dist + * @static + * @param {p5.Vector} v1 The first p5.Vector + * @param {p5.Vector} v2 The second p5.Vector + * @return {Number} The distance + */ + + }, + { + key: 'dist', + value: function dist(v1, v2) { + return v1.dist(v2); + } /** + * Linear interpolate a vector to another vector and return the result as a + * new vector. + */ + /** + * @method lerp + * @static + * @param {p5.Vector} v1 + * @param {p5.Vector} v2 + * @param {Number} amt + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The lerped value + */ + + }, + { + key: 'lerp', + value: function lerp(v1, v2, amt, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 4) { + _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.lerp'); + } + } else { + target.set(v1); + } + target.lerp(v2, amt); + return target; + } /** + * Performs spherical linear interpolation with the other vector + * and returns the resulting vector. + * This works in both 3D and 2D. As for 2D, the result of slerping + * between 2D vectors is always a 2D vector. + */ + /** + * @method slerp + * @static + * @param {p5.Vector} v1 old vector. + * @param {p5.Vector} v2 new vector. + * @param {Number} amt + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} slerped vector between v1 and v2 + */ + + }, + { + key: 'slerp', + value: function slerp(v1, v2, amt, target) { + if (!target) { + target = v1.copy(); + if (arguments.length === 4) { + _main.default._friendlyError('The target parameter is undefined, it should be of type p5.Vector', 'p5.Vector.slerp'); + } + } else { + target.set(v1); + } + target.slerp(v2, amt); + return target; + } /** + * Calculates the magnitude (length) of the vector and returns the result as + * a float (this is simply the equation `sqrt(x*x + y*y + z*z)`.) + */ + /** + * @method mag + * @static + * @param {p5.Vector} vecT The vector to return the magnitude of + * @return {Number} The magnitude of vecT + */ + + }, + { + key: 'mag', + value: function mag(vecT) { + return vecT.mag(); + } /** + * Calculates the squared magnitude of the vector and returns the result + * as a float (this is simply the equation (x\*x + y\*y + z\*z).) + * Faster if the real length is not required in the + * case of comparing vectors, etc. + */ + /** + * @method magSq + * @static + * @param {p5.Vector} vecT the vector to return the squared magnitude of + * @return {Number} the squared magnitude of vecT + */ + + }, + { + key: 'magSq', + value: function magSq(vecT) { + return vecT.magSq(); + } /** + * Normalize the vector to length 1 (make it a unit vector). + */ + /** + * @method normalize + * @static + * @param {p5.Vector} v The vector to normalize + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} The vector v, normalized to a length of 1 + */ + + }, + { + key: 'normalize', + value: function normalize(v, target) { + if (arguments.length < 2) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.normalize'); + } + target.set(v); + } + return target.normalize(); + } /** + * Limit the magnitude of the vector to the value used for the max + * parameter. + */ + /** + * @method limit + * @static + * @param {p5.Vector} v the vector to limit + * @param {Number} max + * @param {p5.Vector} [target] the vector to receive the result (Optional) + * @return {p5.Vector} v with a magnitude limited to max + */ + + }, + { + key: 'limit', + value: function limit(v, max, target) { + if (arguments.length < 3) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.limit'); + } + target.set(v); + } + return target.limit(max); + } /** + * Set the magnitude of the vector to the value used for the len + * parameter. + */ + /** + * @method setMag + * @static + * @param {p5.Vector} v the vector to set the magnitude of + * @param {number} len + * @param {p5.Vector} [target] the vector to receive the result (Optional) + * @return {p5.Vector} v with a magnitude set to len + */ + + }, + { + key: 'setMag', + value: function setMag(v, len, target) { + if (arguments.length < 3) { + target = v.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.setMag'); + } + target.set(v); + } + return target.setMag(len); + } /** + * Calculate the angle of rotation for this vector (only 2D vectors). + * p5.Vectors created using createVector() + * will take the current angleMode into + * consideration, and give the angle in radians or degrees accordingly. + */ + /** + * @method heading + * @static + * @param {p5.Vector} v the vector to find the angle of + * @return {Number} the angle of rotation + */ + + }, + { + key: 'heading', + value: function heading(v) { + return v.heading(); + } /** + * Calculates and returns the angle between two vectors. This function will take + * the angleMode on v1 into consideration, and + * give the angle in radians or degrees accordingly. + */ + /** + * @method angleBetween + * @static + * @param {p5.Vector} v1 the first vector. + * @param {p5.Vector} v2 the second vector. + * @return {Number} angle between the two vectors. + */ + + }, + { + key: 'angleBetween', + value: function angleBetween(v1, v2) { + return v1.angleBetween(v2); + } /** + * Reflect a vector about a normal to a line in 2D, or about a normal to a + * plane in 3D. + */ + /** + * @method reflect + * @static + * @param {p5.Vector} incidentVector vector to be reflected. + * @param {p5.Vector} surfaceNormal + * @param {p5.Vector} [target] vector to receive the result. + * @return {p5.Vector} the reflected vector + */ + + }, + { + key: 'reflect', + value: function reflect(incidentVector, surfaceNormal, target) { + if (arguments.length < 3) { + target = incidentVector.copy(); + } else { + if (!(target instanceof _main.default.Vector)) { + _main.default._friendlyError('The target parameter should be of type p5.Vector', 'p5.Vector.reflect'); + } + target.set(incidentVector); + } + return target.reflect(surfaceNormal); + } /** + * Return a representation of this vector as a float array. This is only + * for temporary use. If used in any other fashion, the contents should be + * copied by using the p5.Vector.copy() + * method to copy into your own vector. + */ + /** + * @method array + * @static + * @param {p5.Vector} v the vector to convert to an array + * @return {Number[]} an Array with the 3 values + */ + + }, + { + key: 'array', + value: function array(v) { + return v.array(); + } /** + * Equality check against a p5.Vector + */ + /** + * @method equals + * @static + * @param {p5.Vector|Array} v1 the first vector to compare + * @param {p5.Vector|Array} v2 the second vector to compare + * @return {Boolean} + */ + + }, + { + key: 'equals', + value: function equals(v1, v2) { + var v; + if (v1 instanceof _main.default.Vector) { + v = v1; + } else if (v1 instanceof Array) { + v = new _main.default.Vector().set(v1); + } else { + _main.default._friendlyError('The v1 parameter should be of type Array or p5.Vector', 'p5.Vector.equals'); + } + return v.equals(v2); + } + } + ]); + return _class; + }(); + var _default = _main.default.Vector; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.every': 171, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.some': 184, + 'core-js/modules/es.math.sign': 190, + 'core-js/modules/es.number.constructor': 191, + 'core-js/modules/es.number.is-finite': 192, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.sub': 218, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 332: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Math + * @submodule Random + * @for p5 + * @requires core + */ + // variables used for random number generators + + var randomStateProp = '_lcg_random_state'; + // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes + // m is basically chosen to be large (as it is the max period) + // and for its relationships to a and c + var m = 4294967296; + // a - 1 should be divisible by m's prime factors + var a = 1664525; + // c and m should be co-prime + var c = 1013904223; + var y2 = 0; + // Linear Congruential Generator that stores its state at instance[stateProperty] + _main.default.prototype._lcg = function (stateProperty) { + // define the recurrence relationship + this[stateProperty] = (a * this[stateProperty] + c) % m; + // return a float in [0, 1) + // we've just used % m, so / m is always < 1 + return this[stateProperty] / m; + }; + _main.default.prototype._lcgSetSeed = function (stateProperty, val) { + // pick a random seed if val is undefined or null + // the >>> 0 casts the seed to an unsigned 32-bit integer + this[stateProperty] = (val == null ? Math.random() * m : val) >>> 0; + }; + /** + * Sets the seed value for random() and + * randomGaussian(). By default, + * random() and + * randomGaussian() produce different + * results each time a sketch is run. Calling `randomSeed()` with a constant + * argument, such as `randomSeed(99)`, makes these functions produce the same + * results each time a sketch is run. + * + * @method randomSeed + * @param {Number} seed seed value. + * @example + *
                              + * + * let x = random(width); + * let y = random(height); + * circle(x, y, 10); + * + * randomSeed(99); + * x = random(width); + * y = random(height); + * fill(0); + * circle(x, y, 10); + * + * describe('A white circle appears at a random position. A black circle appears at (27.4, 25.8).'); + * + *
                              + */ + _main.default.prototype.randomSeed = function (seed) { + this._lcgSetSeed(randomStateProp, seed); + this._gaussian_previous = false; + }; + /** + * Returns a random number or a random element from an array. + * + * `random()` follows uniform distribution, which means that all outcomes are + * equally likely. When `random()` is used to generate numbers, all + * numbers in the output range are equally likely to be returned. When + * `random()` is used to select elements from an array, all elements are + * equally likely to be chosen. + * + * By default, `random()` produces different results each time a sketch runs. + * The randomSeed() function can be used to + * generate the same sequence of numbers or choices each time a sketch runs. + * + * The version of `random()` with no parameters returns a random number from 0 + * up to but not including 1. + * + * The version of `random()` with one parameter works one of two ways. If the + * argument passed is a number, `random()` returns a random number from 0 up + * to but not including the number. For example, calling `random(5)` returns + * values between 0 and 5. If the argument passed is an array, `random()` + * returns a random element from that array. For example, calling + * `random(['🦁', '🐯', '🐻'])` returns either a lion, tiger, or bear emoji. + * + * The version of `random()` with two parameters returns a random number from + * a given range. The arguments passed set the range's lower and upper bounds. + * For example, calling `random(-5, 10.2)` returns values from -5 up to but + * not including 10.2. + * + * @method random + * @param {Number} [min] lower bound (inclusive). + * @param {Number} [max] upper bound (exclusive). + * @return {Number} random number. + * @example + *
                              + * + * let x = random(width); + * let y = random(height); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot appears in a random posiiton on a gray square.'); + * + *
                              + * + *
                              + * + * let animals = ['🦁', '🐯', '🐻']; + * let animal = random(animals); + * text(animal, 50, 50); + * + * describe('An animal face is displayed at random. Either a lion, tiger, or bear.'); + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * frameRate(5); + * let x = random(width); + * let y = random(height); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves around randomly on a gray square.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * background(200); + * + * frameRate(5); + * let x = random(45, 55); + * let y = random(45, 55); + * + * strokeWeight(5); + * point(x, y); + * + * describe('A black dot moves around randomly in the middle of a gray square.'); + * } + * + *
                              + */ + /** + * @method random + * @param {Array} choices array to choose from. + * @return {*} random element from the array. + * @example + */ + _main.default.prototype.random = function (min, max) { + _main.default._validateParameters('random', arguments); + var rand; + if (this[randomStateProp] != null) { + rand = this._lcg(randomStateProp); + } else { + rand = Math.random(); + } + if (typeof min === 'undefined') { + return rand; + } else if (typeof max === 'undefined') { + if (min instanceof Array) { + return min[Math.floor(rand * min.length)]; + } else { + return rand * min; + } + } else { + if (min > max) { + var tmp = min; + min = max; + max = tmp; + } + return rand * (max - min) + min; + } + }; + /** + * Returns a random number fitting a Gaussian, or normal, distribution. Normal + * distributions look like bell curves when plotted. Values from a normal + * distribution cluster around a central value called the mean. The cluster's + * standard deviation describes its spread. + * + * By default, `randomGaussian()` produces different results each time a + * sketch runs. The randomSeed() function can be + * used to generate the same sequence of numbers each time a sketch runs. + * + * There's no minimum or maximum value that `randomGaussian()` might return. + * Values far from the mean are very unlikely and values near the mean are + * very likely. + * + * The version of `randomGaussian()` with no parameters returns values with a + * mean of 0 and standard deviation of 1. + * + * The version of `randomGaussian()` with one parameter interprets the + * argument passed as the mean. The standard deviation is 1. + * + * The version of `randomGaussian()` with two parameters interprets the first + * argument passed as the mean and the second as the standard deviation. + * + * @method randomGaussian + * @param {Number} [mean] mean. + * @param {Number} [sd] standard deviation. + * @return {Number} random number. + * @example + *
                              + * + * function draw() { + * noStroke(); + * fill(0, 10); + * + * // Uniform distribution. + * let x = random(width); + * let y = 25; + * circle(x, y, 5); + * + * // Gaussian distribution with sd = 1. + * x = randomGaussian(50); + * y = 50; + * circle(x, y, 5); + * + * // Gaussian distribution with sd = 10. + * x = randomGaussian(50, 10); + * y = 75; + * circle(x, y, 5); + * + * describe('Three horizontal black lines are filled in randomly. The top line spans entire canvas. The middle line is very short. The bottom line spans two-thirds of the canvas.'); + * } + * + *
                              + */ + _main.default.prototype.randomGaussian = function (mean) { + var sd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + var y1, + x1, + x2, + w; + if (this._gaussian_previous) { + y1 = y2; + this._gaussian_previous = false; + } else { + do { + x1 = this.random(2) - 1; + x2 = this.random(2) - 1; + w = x1 * x1 + x2 * x2; + } while (w >= 1); + w = Math.sqrt( - 2 * Math.log(w) / w); + y1 = x1 * w; + y2 = x2 * w; + this._gaussian_previous = true; + } + var m = mean || 0; + return y1 * sd + m; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298 + } + ], + 333: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Math + * @submodule Trigonometry + * @for p5 + * @requires core + * @requires constants + */ + /* + * all DEGREES/RADIANS conversion should be done in the p5 instance + * if possible, using the p5._toRadians(), p5._fromRadians() methods. + */ + + _main.default.prototype._angleMode = constants.RADIANS; + /** + * The inverse of cos(), returns the arc cosine of a + * value. This function expects arguments in the range -1 to 1. By default, + * `acos()` returns values in the range 0 to π (about 3.14). If the + * angleMode() is `DEGREES`, then values are + * returned in the range 0 to 180. + * + * @method acos + * @param {Number} value value whose arc cosine is to be returned. + * @return {Number} arc cosine of the given value. + * + * @example + *
                              + * + * let a = PI; + * let c = cos(a); + * let ac = acos(c); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(c, 3)}`, 35, 50); + * text(`${round(ac, 3)}`, 35, 75); + * + * describe('The numbers 3.142, -1, and 3.142 written on separate rows.'); + * + *
                              + * + *
                              + * + * let a = PI; + * let c = cos(a); + * let ac = acos(c); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(c, 3)}`, 35, 50); + * text(`${round(ac, 3)}`, 35, 75); + * + * describe('The numbers 3.927, -0.707, and 2.356 written on separate rows.'); + * + *
                              + */ + _main.default.prototype.acos = function (ratio) { + return this._fromRadians(Math.acos(ratio)); + }; + /** + * The inverse of sin(), returns the arc sine of a + * value. This function expects input values in the range of -1 to 1. By + * default, `asin()` returns values in the range -π ÷ 2 + * (about -1.57) to π ÷ 2 (about 1.57). If the + * angleMode() is `DEGREES` then values are + * returned in the range -90 to 90. + * + * @method asin + * @param {Number} value value whose arc sine is to be returned. + * @return {Number} arc sine of the given value. + * + * @example + *
                              + * + * let a = PI / 3; + * let s = sin(a); + * let as = asin(s); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(s, 3)}`, 35, 50); + * text(`${round(as, 3)}`, 35, 75); + * + * describe('The numbers 1.047, 0.866, and 1.047 written on separate rows.'); + * + *
                              + * + *
                              + * + * let a = PI + PI / 3; + * let s = sin(a); + * let as = asin(s); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(s, 3)}`, 35, 50); + * text(`${round(as, 3)}`, 35, 75); + * + * describe('The numbers 4.189, -0.866, and -1.047 written on separate rows.'); + * + *
                              + */ + _main.default.prototype.asin = function (ratio) { + return this._fromRadians(Math.asin(ratio)); + }; + /** + * The inverse of tan(), returns the arc tangent of a + * value. This function expects input values in the range of -Infinity to + * Infinity. By default, `atan()` returns values in the range -π ÷ 2 + * (about -1.57) to π ÷ 2 (about 1.57). If the + * angleMode() is `DEGREES` then values are + * returned in the range -90 to 90. + * + * @method atan + * @param {Number} value value whose arc tangent is to be returned. + * @return {Number} arc tangent of the given value. + * + * @example + *
                              + * + * let a = PI / 3; + * let t = tan(a); + * let at = atan(t); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(t, 3)}`, 35, 50); + * text(`${round(at, 3)}`, 35, 75); + * + * describe('The numbers 1.047, 1.732, and 1.047 written on separate rows.'); + * + *
                              + * + *
                              + * + * let a = PI + PI / 3; + * let t = tan(a); + * let at = atan(t); + * text(`${round(a, 3)}`, 35, 25); + * text(`${round(t, 3)}`, 35, 50); + * text(`${round(at, 3)}`, 35, 75); + * + * describe('The numbers 4.189, 1.732, and 1.047 written on separate rows.'); + * + *
                              + */ + _main.default.prototype.atan = function (ratio) { + return this._fromRadians(Math.atan(ratio)); + }; + /** + * Calculates the angle formed by a specified point, the origin, and the + * positive x-axis. By default, `atan2()` returns values in the range + * -π (about -3.14) to π (3.14). If the + * angleMode() is `DEGREES`, then values are + * returned in the range -180 to 180. The `atan2()` function is most often + * used for orienting geometry to the mouse's position. + * + * Note: The y-coordinate of the point is the first parameter and the + * x-coordinate is the second parameter. + * + * @method atan2 + * @param {Number} y y-coordinate of the point. + * @param {Number} x x-coordinate of the point. + * @return {Number} arc tangent of the given point. + * + * @example + *
                              + * + * function draw() { + * background(200); + * translate(width / 2, height / 2); + * let x = mouseX - width / 2; + * let y = mouseY - height / 2; + * let a = atan2(y, x); + * rotate(a); + * rect(-30, -5, 60, 10); + * + * describe('A rectangle at the center of the canvas rotates with mouse movements.'); + * } + * + *
                              + */ + _main.default.prototype.atan2 = function (y, x) { + return this._fromRadians(Math.atan2(y, x)); + }; + /** + * Calculates the cosine of an angle. `cos()` is useful for many geometric + * tasks in creative coding. The values returned oscillate between -1 and 1 + * as the input angle increases. `cos()` takes into account the current + * angleMode. + * + * @method cos + * @param {Number} angle the angle. + * @return {Number} cosine of the angle. + * + * @example + *
                              + * + * function draw() { + * background(200); + * + * let t = frameCount; + * let x = 30 * cos(t * 0.05) + 50; + * let y = 50; + * line(50, y, x, y); + * circle(x, y, 20); + * + * describe('A white ball on a string oscillates left and right.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * let x = frameCount; + * let y = 30 * cos(x * 0.1) + 50; + * point(x, y); + * + * describe('A series of black dots form a wave pattern.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * let t = frameCount; + * let x = 30 * cos(t * 0.1) + 50; + * let y = 10 * sin(t * 0.2) + 50; + * point(x, y); + * + * describe('A series of black dots form an infinity symbol.'); + * } + * + *
                              + */ + _main.default.prototype.cos = function (angle) { + return Math.cos(this._toRadians(angle)); + }; + /** + * Calculates the sine of an angle. `sin()` is useful for many geometric tasks + * in creative coding. The values returned oscillate between -1 and 1 as the + * input angle increases. `sin()` takes into account the current + * angleMode. + * + * @method sin + * @param {Number} angle the angle. + * @return {Number} sine of the angle. + * + * @example + *
                              + * + * function draw() { + * background(200); + * + * let t = frameCount; + * let x = 50; + * let y = 30 * sin(t * 0.05) + 50; + * line(x, 50, x, y); + * circle(x, y, 20); + * + * describe('A white ball on a string oscillates up and down.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * let x = frameCount; + * let y = 30 * sin(x * 0.1) + 50; + * point(x, y); + * + * describe('A series of black dots form a wave pattern.'); + * } + * + *
                              + * + *
                              + * + * function draw() { + * let t = frameCount; + * let x = 30 * cos(t * 0.1) + 50; + * let y = 10 * sin(t * 0.2) + 50; + * point(x, y); + * + * describe('A series of black dots form an infinity symbol.'); + * } + * + *
                              + */ + _main.default.prototype.sin = function (angle) { + return Math.sin(this._toRadians(angle)); + }; + /** + * Calculates the tangent of an angle. `tan()` is useful for many geometric + * tasks in creative coding. The values returned range from -Infinity + * to Infinity and repeat periodically as the input angle increases. `tan()` + * takes into account the current angleMode. + * + * @method tan + * @param {Number} angle the angle. + * @return {Number} tangent of the angle. + * + * @example + *
                              + * + * function draw() { + * let x = frameCount; + * let y = 5 * tan(x * 0.1) + 50; + * point(x, y); + * + * describe('A series of identical curves drawn with black dots. Each curve starts from the top of the canvas, continues down at a slight angle, flattens out at the middle of the canvas, then continues to the bottom.'); + * } + * + *
                              + */ + _main.default.prototype.tan = function (angle) { + return Math.tan(this._toRadians(angle)); + }; + /** + * Converts an angle measurement in radians to its corresponding value in + * degrees. Degrees and radians are two ways of measuring the same thing. + * There are 360 degrees in a circle and 2 × π (about 6.28) + * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) + * radians. This function doesn't take into account the current + * angleMode(). + * + * @method degrees + * @param {Number} radians radians value to convert to degrees. + * @return {Number} converted angle. + * + * @example + *
                              + * + * let rad = QUARTER_PI; + * let deg = degrees(rad); + * text(`${round(rad, 2)} rad = ${deg}˚`, 10, 50); + * + * describe('The text "0.79 rad = 45˚".'); + * + *
                              + */ + _main.default.prototype.degrees = function (angle) { + return angle * constants.RAD_TO_DEG; + }; + /** + * Converts an angle measurement in degrees to its corresponding value in + * radians. Degrees and radians are two ways of measuring the same thing. + * There are 360 degrees in a circle and 2 × π (about 6.28) + * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) + * radians. This function doesn't take into account the current + * angleMode(). + * + * @method radians + * @param {Number} degrees degree value to convert to radians. + * @return {Number} converted angle. + * + * @example + *
                              + * + * let deg = 45; + * let rad = radians(deg); + * text(`${deg}˚ = ${round(rad, 3)} rad`, 10, 50); + * + * describe('The text "45˚ = 0.785 rad".'); + * + *
                              + */ + _main.default.prototype.radians = function (angle) { + return angle * constants.DEG_TO_RAD; + }; + /** + * Changes the way trigonometric functions interpret angle values. By default, + * the mode is `RADIANS`. + * + * Calling `angleMode()` with no arguments returns current angle mode. + * @method angleMode + * @param {Constant} mode either RADIANS or DEGREES. + * @example + *
                              + * + * let r = 40; + * push(); + * rotate(PI / 6); + * line(0, 0, r, 0); + * text('0.524 rad', r, 0); + * pop(); + * + * angleMode(DEGREES); + * push(); + * rotate(60); + * line(0, 0, r, 0); + * text('60˚', r, 0); + * pop(); + * + * describe('Two diagonal lines radiating from the top left corner of a square. The lines are oriented 30 degrees from the edges of the square and 30 degrees apart from each other.'); + * + *
                              + * + */ + /** + * @method angleMode + * @return {Constant} mode either RADIANS or DEGREES + */ + _main.default.prototype.angleMode = function (mode) { + _main.default._validateParameters('angleMode', arguments); + if (typeof mode === 'undefined') { + return this._angleMode; + } else if (mode === constants.DEGREES || mode === constants.RADIANS) { + this._angleMode = mode; + } + }; + /** + * converts angles from the current angleMode to RADIANS + * + * @method _toRadians + * @private + * @param {Number} angle + * @returns {Number} + */ + _main.default.prototype._toRadians = function (angle) { + if (this._angleMode === constants.DEGREES) { + return angle * constants.DEG_TO_RAD; + } + return angle; + }; + /** + * converts angles from the current angleMode to DEGREES + * + * @method _toDegrees + * @private + * @param {Number} angle + * @returns {Number} + */ + _main.default.prototype._toDegrees = function (angle) { + if (this._angleMode === constants.RADIANS) { + return angle * constants.RAD_TO_DEG; + } + return angle; + }; + /** + * converts angles from RADIANS into the current angleMode + * + * @method _fromRadians + * @private + * @param {Number} angle + * @returns {Number} + */ + _main.default.prototype._fromRadians = function (angle) { + if (this._angleMode === constants.DEGREES) { + return angle * constants.RAD_TO_DEG; + } + return angle; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 334: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Typography + * @submodule Attributes + * @for p5 + * @requires core + * @requires constants + */ + /** + * Sets the way text is aligned when text() is called. + * + * By default, calling `text('hi', 10, 20)` places the bottom-left corner of + * the text's bounding box at (10, 20). + * + * The first parameter, `horizAlign`, changes the way + * text() interprets x-coordinates. By default, the + * x-coordinate sets the left edge of the bounding box. `textAlign()` accepts + * the following values for `horizAlign`: `LEFT`, `CENTER`, or `RIGHT`. + * + * The second parameter, `vertAlign`, is optional. It changes the way + * text() interprets y-coordinates. By default, the + * y-coordinate sets the bottom edge of the bounding box. `textAlign()` + * accepts the following values for `vertAlign`: `TOP`, `BOTTOM`, `CENTER`, + * or `BASELINE`. + * + * @method textAlign + * @param {Constant} horizAlign horizontal alignment, either LEFT, + * CENTER, or RIGHT. + * @param {Constant} [vertAlign] vertical alignment, either TOP, + * BOTTOM, CENTER, or BASELINE. + * @chainable + * @example + *
                              + * + * strokeWeight(0.5); + * line(50, 0, 50, 100); + * + * textSize(16); + * textAlign(RIGHT); + * text('ABCD', 50, 30); + * textAlign(CENTER); + * text('EFGH', 50, 50); + * textAlign(LEFT); + * text('IJKL', 50, 70); + * + * describe('The letters ABCD displayed at top-left, EFGH at center, and IJKL at bottom-right. A vertical line divides the canvas in half.'); + * + *
                              + * + *
                              + * + * strokeWeight(0.5); + * + * line(0, 12, width, 12); + * textAlign(CENTER, TOP); + * text('TOP', 50, 12); + * + * line(0, 37, width, 37); + * textAlign(CENTER, CENTER); + * text('CENTER', 50, 37); + * + * line(0, 62, width, 62); + * textAlign(CENTER, BASELINE); + * text('BASELINE', 50, 62); + * + * line(0, 97, width, 97); + * textAlign(CENTER, BOTTOM); + * text('BOTTOM', 50, 97); + * + * describe('The words "TOP", "CENTER", "BASELINE", and "BOTTOM" each drawn relative to a horizontal line. Their positions demonstrate different vertical alignments.'); + * + *
                              + */ + /** + * @method textAlign + * @return {Object} + */ + + _main.default.prototype.textAlign = function (horizAlign, vertAlign) { + var _this$_renderer; + _main.default._validateParameters('textAlign', arguments); + return (_this$_renderer = this._renderer).textAlign.apply(_this$_renderer, arguments); + }; + /** + * Sets the spacing between lines of text when + * text() is called. Spacing is measured in pixels. + * + * Calling `textLeading()` without an argument returns the current spacing. + * + * @method textLeading + * @param {Number} leading spacing between lines of text in units of pixels. + * @chainable + * + * @example + *
                              + * + * // "\n" starts a new line of text. + * let lines = 'one\ntwo'; + * + * text(lines, 10, 25); + * + * textLeading(30); + * text(lines, 70, 25); + * + * describe('The words "one" and "two" written on separate lines twice. The words on the left have less vertical spacing than the words on the right.'); + * + *
                              + */ + /** + * @method textLeading + * @return {Number} + */ + _main.default.prototype.textLeading = function (theLeading) { + var _this$_renderer2; + _main.default._validateParameters('textLeading', arguments); + return (_this$_renderer2 = this._renderer).textLeading.apply(_this$_renderer2, arguments); + }; + /** + * Sets the font size when + * text() is called. Font size is measured in pixels. + * + * Calling `textSize()` without an arugment returns the current size. + * + * @method textSize + * @param {Number} size size of the letters in units of pixels + * @chainable + * + * @example + *
                              + * + * textSize(12); + * text('Font Size 12', 10, 30); + * textSize(14); + * text('Font Size 14', 10, 60); + * textSize(16); + * text('Font Size 16', 10, 90); + * + * describe('The text "Font Size 12" drawn small, "Font Size 14" drawn medium, and "Font Size 16" drawn large.'); + * + *
                              + */ + /** + * @method textSize + * @return {Number} + */ + _main.default.prototype.textSize = function (theSize) { + var _this$_renderer3; + _main.default._validateParameters('textSize', arguments); + return (_this$_renderer3 = this._renderer).textSize.apply(_this$_renderer3, arguments); + }; + /** + * Sets the style for system fonts when + * text() is called. `textStyle()` accepts the + * following values: `NORMAL`, `ITALIC`, `BOLD` or `BOLDITALIC`. + * + * `textStyle()` may be overridden by CSS styling. This function doesn't + * affect fonts loaded with loadFont(). + * + * @method textStyle + * @param {Constant} style styling for text, either NORMAL, + * ITALIC, BOLD or BOLDITALIC + * @chainable + * @example + *
                              + * + * textSize(12); + * textAlign(CENTER); + * + * textStyle(NORMAL); + * text('Normal', 50, 15); + * textStyle(ITALIC); + * text('Italic', 50, 40); + * textStyle(BOLD); + * text('Bold', 50, 65); + * textStyle(BOLDITALIC); + * text('Bold Italic', 50, 90); + * + * describe('The words "Normal" displayed normally, "Italic" in italic, "Bold" in bold, and "Bold Italic" in bold italics.'); + * + *
                              + */ + /** + * @method textStyle + * @return {String} + */ + _main.default.prototype.textStyle = function (theStyle) { + var _this$_renderer4; + _main.default._validateParameters('textStyle', arguments); + return (_this$_renderer4 = this._renderer).textStyle.apply(_this$_renderer4, arguments); + }; + /** + * Returns the maximum width of a string of text drawn when + * text() is called. + * + * @method textWidth + * @param {String} str string of text to measure. + * @return {Number} width measured in units of pixels. + * @example + *
                              + * + * function setup() { + * background(200); + * + * textSize(28); + * strokeWeight(0.5); + * let s = 'yoyo'; + * let w = textWidth(s); + * text(s, 22, 55); + * line(22, 55, 22 + w, 55); + * + * describe('The word "yoyo" underlined.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * + * textSize(28); + * strokeWeight(0.5); + * // "\n" starts a new line. + * let s = 'yo\nyo'; + * let w = textWidth(s); + * text(s, 22, 55); + * line(22, 55, 22 + w, 55); + * + * describe('The word "yo" written twice, one copy beneath the other. The words are divided by a horizontal line.'); + * } + * + *
                              + */ + _main.default.prototype.textWidth = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + args[0] += ''; + _main.default._validateParameters('textWidth', args); + if (args[0].length === 0) { + return 0; + } // Only use the line with the longest width, and replace tabs with double-space + + var textLines = args[0].replace(/\t/g, ' ').split(/\r?\n|\r|\n/g); + var newArr = [ + ]; + // Return the textWidth for every line + for (var i = 0; i < textLines.length; i++) { + newArr.push(this._renderer.textWidth(textLines[i])); + } // Return the largest textWidth + + var largestWidth = Math.max.apply(Math, newArr); + return largestWidth; + }; + /** + * Returns the ascent of the current font at its current size. The ascent + * represents the distance, in pixels, of the tallest character above + * the baseline. + * + * @method textAscent + * @return {Number} ascent measured in units of pixels. + * @example + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * textFont(font); + * + * // Different for each font. + * let fontScale = 0.8; + * + * let baseY = 75; + * strokeWeight(0.5); + * + * // Draw small text. + * textSize(24); + * text('dp', 0, baseY); + * // Draw baseline and ascent. + * let a = textAscent() * fontScale; + * line(0, baseY, 23, baseY); + * line(23, baseY - a, 23, baseY); + * + * // Draw large text. + * textSize(48); + * text('dp', 45, baseY); + * // Draw baseline and ascent. + * a = textAscent() * fontScale; + * line(45, baseY, 91, baseY); + * line(91, baseY - a, 91, baseY); + * + * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends upward from each baseline to the top of the "d".'); + * } + * + *
                              + */ + _main.default.prototype.textAscent = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('textAscent', args); + return this._renderer.textAscent(); + }; + /** + * Returns the descent of the current font at its current size. The descent + * represents the distance, in pixels, of the character with the longest + * descender below the baseline. + * + * @method textDescent + * @return {Number} descent measured in units of pixels. + * @example + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * textFont(font); + * + * // Different for each font. + * let fontScale = 0.9; + * + * let baseY = 75; + * strokeWeight(0.5); + * + * // Draw small text. + * textSize(24); + * text('dp', 0, baseY); + * // Draw baseline and descent. + * let d = textDescent() * fontScale; + * line(0, baseY, 23, baseY); + * line(23, baseY, 23, baseY + d); + * + * // Draw large text. + * textSize(48); + * text('dp', 45, baseY); + * // Draw baseline and descent. + * d = textDescent() * fontScale; + * line(45, baseY, 91, baseY); + * line(91, baseY, 91, baseY + d); + * + * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends downward from each baseline to the bottom of the "p".'); + * } + * + *
                              + */ + _main.default.prototype.textDescent = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('textDescent', args); + return this._renderer.textDescent(); + }; + /** + * Helper function to measure ascent and descent. + */ + _main.default.prototype._updateTextMetrics = function () { + return this._renderer._updateTextMetrics(); + }; + /** + * Sets the style for wrapping text when + * text() is called. `textWrap()` accepts the + * following values: + * + * `WORD` starts new lines of text at spaces. If a string of text doesn't + * have spaces, it may overflow the text box and the canvas. This is the + * default style. + * + * `CHAR` starts new lines as needed to stay within the text box. + * + * `textWrap()` only works when the maximum width is set for a text box. For + * example, calling `text('Have a wonderful day', 0, 10, 100)` sets the + * maximum width to 100 pixels. + * + * Calling `textWrap()` without an argument returns the current style. + * + * @method textWrap + * @param {Constant} style text wrapping style, either WORD or CHAR. + * @return {String} style + * @example + *
                              + * + * textSize(20); + * textWrap(WORD); + * text('Have a wonderful day', 0, 10, 100); + * + *
                              + * + *
                              + * + * textSize(20); + * textWrap(CHAR); + * text('Have a wonderful day', 0, 10, 100); + * + *
                              + * + *
                              + * + * textSize(20); + * textWrap(CHAR); + * text('祝你有美好的一天', 0, 10, 100); + * + *
                              + */ + _main.default.prototype.textWrap = function (wrapStyle) { + if (wrapStyle !== 'WORD' && wrapStyle !== 'CHAR') { + throw 'Error: textWrap accepts only WORD or CHAR'; + } + return this._renderer.textWrap(wrapStyle); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216 + } + ], + 335: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.last-index-of'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.last-index-of'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.split'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + var opentype = _interopRequireWildcard(_dereq_('opentype.js')); + _dereq_('../core/friendly_errors/validate_params'); + _dereq_('../core/friendly_errors/file_errors'); + _dereq_('../core/friendly_errors/fes_core'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Typography + * @submodule Loading & Displaying + * @for p5 + * @requires core + */ + /** + * Loads a font and creates a p5.Font object. + * `loadFont()` can load fonts in either .otf or .ttf format. Loaded fonts can + * be used to style text on the canvas and in HTML elements. + * + * The first parameter, `path`, is the path to a font file. + * Paths to local files should be relative. For example, + * `'assets/inconsolata.otf'`. The Inconsolata font used in the following + * examples can be downloaded for free + * here. + * Paths to remote files should be URLs. For example, + * `'https://example.com/inconsolata.otf'`. URLs may be blocked due to browser + * security. + * + * The second parameter, `successCallback`, is optional. If a function is + * passed, it will be called once the font has loaded. The callback function + * may use the new p5.Font object if needed. + * + * The third parameter, `failureCallback`, is also optional. If a function is + * passed, it will be called if the font fails to load. The callback function + * may use the error + * Event + * object if needed. + * + * Fonts can take time to load. Calling `loadFont()` in + * preload() ensures fonts load before they're + * used in setup() or + * draw(). + * + * @method loadFont + * @param {String} path path of the font to be loaded. + * @param {Function} [successCallback] function called with the + * p5.Font object after it + * loads. + * @param {Function} [failureCallback] function called with the error + * Event + * object if the font fails to load. + * @return {p5.Font} p5.Font object. + * @example + * + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * loadFont('assets/inconsolata.otf', font => { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * }); + * } + * + *
                              + * + *
                              + * + * function setup() { + * loadFont('assets/inconsolata.otf', success, failure); + * } + * + * function success(font) { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + * function failure(event) { + * console.error('Oops!', event); + * } + * + *
                              + * + *
                              + * + * function preload() { + * loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * let p = createP('p5*js'); + * p.style('color', 'deeppink'); + * p.style('font-family', 'Inconsolata'); + * p.style('font-size', '36px'); + * p.position(10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
                              + */ + + _main.default.prototype.loadFont = function (path, onSuccess, onError) { + _main.default._validateParameters('loadFont', arguments); + var p5Font = new _main.default.Font(this); + var self = this; + opentype.load(path, function (err, font) { + if (err) { + _main.default._friendlyFileLoadError(4, path); + if (typeof onError !== 'undefined') { + return onError(err); + } + console.error(err, path); + return; + } + p5Font.font = font; + if (typeof onSuccess !== 'undefined') { + onSuccess(p5Font); + } + self._decrementPreload(); + // check that we have an acceptable font type + var validFontTypes = [ + 'ttf', + 'otf', + 'woff', + 'woff2' + ]; + var fileNoPath = path.split('\\').pop().split('/').pop(); + var lastDotIdx = fileNoPath.lastIndexOf('.'); + var fontFamily; + var newStyle; + var fileExt = lastDotIdx < 1 ? null : fileNoPath.slice(lastDotIdx + 1); + // if so, add it to the DOM (name-only) for use with DOM module + if (validFontTypes.includes(fileExt)) { + fontFamily = fileNoPath.slice(0, lastDotIdx !== - 1 ? lastDotIdx : 0); + newStyle = document.createElement('style'); + newStyle.appendChild(document.createTextNode('\n@font-face {\nfont-family: '.concat(fontFamily, ';\nsrc: url(').concat(path, ');\n}\n'))); + document.head.appendChild(newStyle); + } + }); + return p5Font; + }; + /** + * Draws text to the canvas. + * + * The first parameter, `str`, is the text to be drawn. The second and third + * parameters, `x` and `y`, set the coordinates of the text's bottom-left + * corner. See textAlign() for other ways to + * align text. + * + * The fourth and fifth parameters, `maxWidth` and `maxHeight`, are optional. + * They set the dimensions of the invisible rectangle containing the text. By + * default, they set its maximum width and height. See + * rectMode() for other ways to define the + * rectangular text box. Text will wrap to fit within the text box. Text + * outside of the box won't be drawn. + * + * Text can be styled a few ways. Call the fill() + * function to set the text's fill color. Call + * stroke() and + * strokeWeight() to set the text's outline. + * Call textSize() and + * textFont() to set the text's size and font, + * respectively. + * + * Note: `WEBGL` mode only supports fonts loaded with + * loadFont(). Calling + * stroke() has no effect in `WEBGL` mode. + * + * @method text + * @param {String|Object|Array|Number|Boolean} str text to be displayed. + * @param {Number} x x-coordinate of the text box. + * @param {Number} y y-coordinate of the text box. + * @param {Number} [maxWidth] maximum width of the text box. See + * rectMode() for + * other options. + * @param {Number} [maxHeight] maximum height of the text box. See + * rectMode() for + * other options. + * + * @chainable + * @example + *
                              + * + * function setup() { + * background(200); + * text('hi', 50, 50); + * + * describe('The text "hi" written in black in the middle of a gray square.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background('skyblue'); + * textSize(100); + * text('🌈', 0, 100); + * + * describe('A rainbow in a blue sky.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * textSize(32); + * fill(255); + * stroke(0); + * strokeWeight(4); + * text('hi', 50, 50); + * + * describe('The text "hi" written in white with a black outline.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background('black'); + * textSize(22); + * fill('yellow'); + * text('rainbows', 6, 20); + * fill('cornflowerblue'); + * text('rainbows', 6, 45); + * fill('tomato'); + * text('rainbows', 6, 70); + * fill('limegreen'); + * text('rainbows', 6, 95); + * + * describe('The text "rainbows" written on several lines, each in a different color.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * let s = 'The quick brown fox jumps over the lazy dog.'; + * text(s, 10, 10, 70, 80); + * + * describe('The sample text "The quick brown fox..." written in black across several lines.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * rectMode(CENTER); + * let s = 'The quick brown fox jumps over the lazy dog.'; + * text(s, 50, 50, 70, 80); + * + * describe('The sample text "The quick brown fox..." written in black across several lines.'); + * } + * + *
                              + * + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * textFont(font); + * textSize(32); + * textAlign(CENTER, CENTER); + * } + * + * function draw() { + * background(0); + * rotateY(frameCount / 30); + * text('p5*js', 0, 0); + * + * describe('The text "p5*js" written in white and spinning in 3D.'); + * } + * + *
                              + */ + _main.default.prototype.text = function (str, x, y, maxWidth, maxHeight) { + var _this$_renderer; + _main.default._validateParameters('text', arguments); + return !(this._renderer._doFill || this._renderer._doStroke) ? this : (_this$_renderer = this._renderer).text.apply(_this$_renderer, arguments); + }; + /** + * Sets the font used by the text() function. + * + * The first parameter, `font`, sets the font. `textFont()` recognizes either + * a p5.Font object or a string with the name of a + * system font. For example, `'Courier New'`. + * + * The second parameter, `size`, is optional. It sets the font size in pixels. + * This has the same effect as calling textSize(). + * + * Note: `WEBGL` mode only supports fonts loaded with + * loadFont(). + * + * @method textFont + * @return {Object} current font or p5 Object. + * + * @example + *
                              + * + * function setup() { + * background(200); + * textFont('Courier New'); + * textSize(24); + * text('hi', 35, 55); + * + * describe('The text "hi" written in a black, monospace font on a gray background.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background('black'); + * fill('palegreen'); + * textFont('Courier New', 10); + * text('You turn to the left and see a door. Do you enter?', 5, 5, 90, 90); + * text('>', 5, 70); + * + * describe('A text prompt from a game is written in a green, monospace font on a black background.'); + * } + * + *
                              + * + *
                              + * + * function setup() { + * background(200); + * textFont('Verdana'); + * let currentFont = textFont(); + * text(currentFont, 25, 50); + * + * describe('The text "Verdana" written in a black, sans-serif font on a gray background.'); + * } + * + *
                              + * + *
                              + * + * let fontRegular; + * let fontItalic; + * let fontBold; + * + * function preload() { + * fontRegular = loadFont('assets/Regular.otf'); + * fontItalic = loadFont('assets/Italic.ttf'); + * fontBold = loadFont('assets/Bold.ttf'); + * } + * + * function setup() { + * background(200); + * textFont(fontRegular); + * text('I am Normal', 10, 30); + * textFont(fontItalic); + * text('I am Italic', 10, 50); + * textFont(fontBold); + * text('I am Bold', 10, 70); + * + * describe('The statements "I am Normal", "I am Italic", and "I am Bold" written in black on separate lines. The statements have normal, italic, and bold fonts, respectively.'); + * } + * + *
                              + */ + /** + * @method textFont + * @param {Object|String} font font as a p5.Font object or a string. + * @param {Number} [size] font size in pixels. + * @chainable + */ + _main.default.prototype.textFont = function (theFont, theSize) { + _main.default._validateParameters('textFont', arguments); + if (arguments.length) { + if (!theFont) { + throw new Error('null font passed to textFont'); + } + this._renderer._setProperty('_textFont', theFont); + if (theSize) { + this._renderer._setProperty('_textSize', theSize); + if (!this._renderer._leadingSet) { + // only use a default value if not previously set (#5181) + this._renderer._setProperty('_textLeading', theSize * constants._DEFAULT_LEADMULT); + } + } + return this._renderer._applyTextProperties(); + } + return this._renderer._textFont; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/friendly_errors/fes_core': 289, + '../core/friendly_errors/file_errors': 290, + '../core/friendly_errors/validate_params': 293, + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.last-index-of': 181, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256, + 'opentype.js': 271 + } + ], + 336: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * This module defines the p5.Font class and functions for + * drawing text to the display canvas. + * @module Typography + * @submodule Loading & Displaying + * @requires core + * @requires constants + */ + /** + * A class to describe fonts. + * @class p5.Font + * @constructor + * @param {p5} [pInst] pointer to p5 instance. + * @example + *
                              + * + * let font; + * + * function preload() { + * // Creates a p5.Font object. + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * fill('deeppink'); + * textFont(font); + * textSize(36); + * text('p5*js', 10, 50); + * + * describe('The text "p5*js" written in pink on a white background.'); + * } + * + *
                              + */ + + _main.default.Font = /*#__PURE__*/ function () { + function _class(p) { + _classCallCheck(this, _class); + this.parent = p; + this.cache = { + }; + /** + * Underlying + * opentype.js + * font object. + * @property font + * @name font + */ + this.font = undefined; + } /** + * Returns the bounding box for a string of text written using this + * p5.Font. + * + * The first parameter, `str`, is a string of text. The second and third + * parameters, `x` and `y`, are the text's position. By default, they set the + * coordinates of the bounding box's bottom-left corner. See + * textAlign() for more ways to align text. + * + * The fourth parameter, `fontSize`, is optional. It sets the font size used to + * determine the bounding box. By default, `font.textBounds()` will use the + * current textSize(). + * + * @method textBounds + * @param {String} str string of text. + * @param {Number} x x-coordinate of the text. + * @param {Number} y y-coordinate of the text. + * @param {Number} [fontSize] font size. Defaults to the current + * textSize(). + * @return {Object} object describing the bounding box with + * properties x, y, w, and h. + * + * @example + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * + * let bbox = font.textBounds('p5*js', 35, 53); + * rect(bbox.x, bbox.y, bbox.w, bbox.h); + * + * textFont(font); + * text('p5*js', 35, 53); + * + * describe('The text "p5*js" written in black inside a white rectangle.'); + * } + * + *
                              + * + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * + * textFont(font); + * textSize(15); + * textAlign(CENTER, CENTER); + * + * let bbox = font.textBounds('p5*js', 50, 50); + * rect(bbox.x, bbox.y, bbox.w, bbox.h); + * + * text('p5*js', 50, 50); + * + * describe('The text "p5*js" written in black inside a white rectangle.'); + * } + * + *
                              + * + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * + * let bbox = font.textBounds('p5*js', 31, 53, 15); + * rect(bbox.x, bbox.y, bbox.w, bbox.h); + * + * textFont(font); + * textSize(15); + * text('p5*js', 31, 53); + * + * describe('The text "p5*js" written in black inside a white rectangle.'); + * } + * + *
                              */ - function resolve$1(object) { - /*jshint validthis:true */ - var Constructor = this; - if ( - object && - typeof object === "object" && - object.constructor === Constructor - ) { - return object; - } - var promise = new Constructor(noop); - resolve(promise, object); - return promise; - } - var PROMISE_ID = Math.random().toString(36).substring(2); - function noop() {} - var PENDING = void 0; - var FULFILLED = 1; - var REJECTED = 2; - function selfFulfillment() { - return new TypeError( - "You cannot resolve a promise with itself", - ); - } - function cannotReturnOwn() { - return new TypeError( - "A promises callback cannot return that same promise.", - ); - } - function tryThen( - then$$1, - value, - fulfillmentHandler, - rejectionHandler, - ) { - try { - then$$1.call(value, fulfillmentHandler, rejectionHandler); - } catch (e) { - return e; - } - } - function handleForeignThenable(promise, thenable, then$$1) { - asap(function (promise) { - var sealed = false; - var error = tryThen( - then$$1, - thenable, - function (value) { - if (sealed) { - return; - } - sealed = true; - if (thenable !== value) { - resolve(promise, value); - } else { - fulfill(promise, value); - } - }, - function (reason) { - if (sealed) { - return; - } - sealed = true; - reject(promise, reason); - }, - "Settle: " + (promise._label || " unknown promise"), - ); - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); - } - function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - reject(promise, thenable._result); - } else { - subscribe( - thenable, - undefined, - function (value) { - return resolve(promise, value); - }, - function (reason) { - return reject(promise, reason); - }, - ); - } - } - function handleMaybeThenable(promise, maybeThenable, then$$1) { - if ( - maybeThenable.constructor === promise.constructor && - then$$1 === then && - maybeThenable.constructor.resolve === resolve$1 - ) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$1 === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$1)) { - handleForeignThenable(promise, maybeThenable, then$$1); - } else { - fulfill(promise, maybeThenable); - } - } - } - function resolve(promise, value) { - if (promise === value) { - reject(promise, selfFulfillment()); - } else if (objectOrFunction(value)) { - var then$$1 = void 0; - try { - then$$1 = value.then; - } catch (error) { - reject(promise, error); - return; - } - handleMaybeThenable(promise, value, then$$1); - } else { - fulfill(promise, value); - } - } - function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); - } - publish(promise); - } - function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } - promise._result = value; - promise._state = FULFILLED; - if (promise._subscribers.length !== 0) { - asap(publish, promise); - } - } - function reject(promise, reason) { - if (promise._state !== PENDING) { - return; - } - promise._state = REJECTED; - promise._result = reason; - asap(publishRejection, promise); - } - function subscribe(parent, child, onFulfillment, onRejection) { - var _subscribers = parent._subscribers; - var length = _subscribers.length; - parent._onerror = null; - _subscribers[length] = child; - _subscribers[length + FULFILLED] = onFulfillment; - _subscribers[length + REJECTED] = onRejection; - if (length === 0 && parent._state) { - asap(publish, parent); - } - } - function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - if (subscribers.length === 0) { - return; - } - var child = void 0, - callback = void 0, - detail = promise._result; - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } - promise._subscribers.length = 0; - } - function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = void 0, - error = void 0, - succeeded = true; - if (hasCallback) { - try { - value = callback(detail); - } catch (e) { - succeeded = false; - error = e; - } - if (promise === value) { - reject(promise, cannotReturnOwn()); - return; - } - } else { - value = detail; - } - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (succeeded === false) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } - } - function initializePromise(promise, resolver) { - try { - resolver( - function resolvePromise(value) { - resolve(promise, value); - }, - function rejectPromise(reason) { - reject(promise, reason); - }, - ); - } catch (e) { - reject(promise, e); - } - } - var id = 0; - function nextId() { - return id++; - } - function makePromise(promise) { - promise[PROMISE_ID] = id++; - promise._state = undefined; - promise._result = undefined; - promise._subscribers = []; - } - function validationError() { - return new Error("Array Methods must be provided an Array"); - } - var Enumerator = (function () { - function Enumerator(Constructor, input) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop); - if (!this.promise[PROMISE_ID]) { - makePromise(this.promise); - } - if (isArray(input)) { - this.length = input.length; - this._remaining = input.length; - this._result = new Array(this.length); - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(input); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, validationError()); - } - } - Enumerator.prototype._enumerate = function _enumerate(input) { - for ( - var i = 0; - this._state === PENDING && i < input.length; - i++ - ) { - this._eachEntry(input[i], i); - } - }; - Enumerator.prototype._eachEntry = function _eachEntry( - entry, - i, - ) { - var c = this._instanceConstructor; - var resolve$$1 = c.resolve; - if (resolve$$1 === resolve$1) { - var _then = void 0; - var error = void 0; - var didError = false; - try { - _then = entry.then; - } catch (e) { - didError = true; - error = e; - } - if (_then === then && entry._state !== PENDING) { - this._settledAt(entry._state, i, entry._result); - } else if (typeof _then !== "function") { - this._remaining--; - this._result[i] = entry; - } else if (c === Promise$1) { - var promise = new c(noop); - if (didError) { - reject(promise, error); - } else { - handleMaybeThenable(promise, entry, _then); - } - this._willSettleAt(promise, i); - } else { - this._willSettleAt( - new c(function (resolve$$1) { - return resolve$$1(entry); - }), - i, - ); - } - } else { - this._willSettleAt(resolve$$1(entry), i); - } - }; - Enumerator.prototype._settledAt = function _settledAt( - state, - i, - value, - ) { - var promise = this.promise; - if (promise._state === PENDING) { - this._remaining--; - if (state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = value; - } - } - if (this._remaining === 0) { - fulfill(promise, this._result); - } - }; - Enumerator.prototype._willSettleAt = function _willSettleAt( - promise, - i, - ) { - var enumerator = this; - subscribe( - promise, - undefined, - function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, - function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }, - ); - }; - return Enumerator; - })(); - /** - `Promise.all` accepts an array of promises, and returns a new promise which - is fulfilled with an array of fulfillment values for the passed promises, or - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = resolve(2); - let promise3 = resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = reject(new Error("2")); - let promise3 = reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static - */ - function all(entries) { - return new Enumerator(this, entries).promise; - } /** - `Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @param {Array} promises array of promises to observe - Useful for tooling. - @return {Promise} a promise which settles in the same way as the first passed - promise to settle. - */ + _createClass(_class, [ + { + key: 'textBounds', + value: function textBounds(str) { + var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var fontSize = arguments.length > 3 ? arguments[3] : undefined; + var opts = arguments.length > 4 ? arguments[4] : undefined; + // Check cache for existing bounds. Take into consideration the text alignment + // settings. Default alignment should match opentype's origin: left-aligned & + // alphabetic baseline. + var p = opts && opts.renderer && opts.renderer._pInst || this.parent; + var ctx = p._renderer.drawingContext; + var alignment = ctx.textAlign || constants.LEFT; + var baseline = ctx.textBaseline || constants.BASELINE; + var cacheResults = false; + var result; + var key; + fontSize = fontSize || p._renderer._textSize; + // NOTE: cache disabled for now pending further discussion of #3436 + if (cacheResults) { + key = cacheKey('textBounds', str, x, y, fontSize, alignment, baseline); + result = this.cache[key]; + } + if (!result) { + var minX = [ + ]; + var minY; + var maxX = [ + ]; + var maxY; + var pos; + var xCoords = [ + ]; + xCoords[0] = [ + ]; + var yCoords = [ + ]; + var scale = this._scale(fontSize); + var lineHeight = p._renderer.textLeading(); + var lineCount = 0; + this.font.forEachGlyph(str, x, y, fontSize, opts, function (glyph, gX, gY, gFontSize) { + var gm = glyph.getMetrics(); + if (glyph.index === 0 || glyph.index === 10) { + lineCount += 1; + xCoords[lineCount] = [ + ]; + } else { + xCoords[lineCount].push(gX + gm.xMin * scale); + xCoords[lineCount].push(gX + gm.xMax * scale); + yCoords.push(gY + lineCount * lineHeight + - gm.yMin * scale); + yCoords.push(gY + lineCount * lineHeight + - gm.yMax * scale); + } + }); + if (xCoords[lineCount].length > 0) { + minX[lineCount] = Math.min.apply(null, xCoords[lineCount]); + maxX[lineCount] = Math.max.apply(null, xCoords[lineCount]); + } + var finalMaxX = 0; + for (var i = 0; i <= lineCount; i++) { + minX[i] = Math.min.apply(null, xCoords[i]); + maxX[i] = Math.max.apply(null, xCoords[i]); + var lineLength = maxX[i] - minX[i]; + if (lineLength > finalMaxX) { + finalMaxX = lineLength; + } + } + var finalMinX = Math.min.apply(null, minX); + minY = Math.min.apply(null, yCoords); + maxY = Math.max.apply(null, yCoords); + result = { + x: finalMinX, + y: minY, + h: maxY - minY, + w: finalMaxX, + advance: finalMinX - x + }; + // Bounds are now calculated, so shift the x & y to match alignment settings + pos = this._handleAlignment(p._renderer, str, result.x, result.y, result.w + result.advance); + result.x = pos.x; + result.y = pos.y; + if (cacheResults) { + this.cache[key] = result; + } + } + return result; + } /** + * Returns an array of points outlining a string of text written using this + * p5.Font. + * + * The first parameter, `str`, is a string of text. The second and third + * parameters, `x` and `y`, are the text's position. By default, they set the + * coordinates of the bounding box's bottom-left corner. See + * textAlign() for more ways to align text. + * + * The fourth parameter, `fontSize`, is optional. It sets the text's font + * size. By default, `font.textToPoints()` will use the current + * textSize(). + * + * The fifth parameter, `options`, is also optional. `font.textToPoints()` + * expects an object with the following properties: + * + * `sampleFactor` is the ratio of the text's path length to the number of + * samples. It defaults to 0.1. Higher values produce more points along the + * path and are more precise. + * + * `simplifyThreshold` removes collinear points if it's set to a number other + * than 0. The value represents the threshold angle to use when determining + * whether two edges are collinear. + * + * @method textToPoints + * @param {String} str string of text. + * @param {Number} x x-coordinate of the text. + * @param {Number} y y-coordinate of the text. + * @param {Number} [fontSize] font size. Defaults to the current + * textSize(). + * @param {Object} [options] object with sampleFactor and simplifyThreshold + * properties. + * @return {Array} array of point objects, each with x, y, and alpha (path angle) properties. + * @example + *
                              + * + * let font; + * + * function preload() { + * font = loadFont('assets/inconsolata.otf'); + * } + * + * function setup() { + * background(200); + * let points = font.textToPoints('p5*js', 6, 60, 35, { sampleFactor: 0.5 }); + * points.forEach(p => { + * point(p.x, p.y); + * }); + * + * describe('A set of black dots outlining the text "p5*js" on a gray background.'); + * } + * + *
                              + */ + + }, + { + key: 'textToPoints', + value: function textToPoints(txt, x, y, fontSize, options) { + var xOriginal = x; + var result = [ + ]; + var lines = txt.split(/\r?\n|\r|\n/g); + fontSize = fontSize || this.parent._renderer._textSize; + function isSpace(i, text, glyphsLine) { + return glyphsLine[i].name && glyphsLine[i].name === 'space' || text.length === glyphsLine.length && text[i] === ' ' //|| + //(glyphs[i].index && glyphs[i].index === 3) + ; + } + for (var i = 0; i < lines.length; i++) { + var xoff = 0; + x = xOriginal; + var line = lines[i]; + line = line.replace('\t', ' '); + var glyphs = this._getGlyphs(line); + for (var j = 0; j < glyphs.length; j++) { + if (!isSpace(j, line, glyphs)) { + // fix to #1817, #2069 + var gpath = glyphs[j].getPath(x, y, fontSize), + paths = splitPaths(gpath.commands); + for (var k = 0; k < paths.length; k++) { + var pts = pathToPoints(paths[k], options); + for (var l = 0; l < pts.length; l++) { + pts[l].x += xoff; + result.push(pts[l]); + } + } + } + xoff += glyphs[j].advanceWidth * this._scale(fontSize); + } + y = y + this.parent._renderer._textLeading; + } + return result; + } // ----------------------------- End API ------------------------------ + /** + * Returns the set of opentype glyphs for the supplied string. + * + * Note that there is not a strict one-to-one mapping between characters + * and glyphs, so the list of returned glyphs can be larger or smaller + * than the length of the given string. + * + * @private + * @param {String} str the string to be converted + * @return {Array} the opentype glyphs + */ + + }, + { + key: '_getGlyphs', + value: function _getGlyphs(str) { + return this.font.stringToGlyphs(str); + } /** + * Returns an opentype path for the supplied string and position. + * + * @private + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional) + * @return {Object} the opentype path + */ + + }, + { + key: '_getPath', + value: function _getPath(line, x, y, options) { + var p = options && options.renderer && options.renderer._pInst || this.parent, + renderer = p._renderer, + pos = this._handleAlignment(renderer, line, x, y); + return this.font.getPath(line, pos.x, pos.y, renderer._textSize, options); + } /* + * Creates an SVG-formatted path-data string + * (See http://www.w3.org/TR/SVG/paths.html#PathData) + * from the given opentype path or string/position + * + * @param {Object} path an opentype path, OR the following: + * + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional), set options.decimals + * to set the decimal precision of the path-data + * + * @return {Object} this p5.Font object + */ + + }, + { + key: '_getPathData', + value: function _getPathData(line, x, y, options) { + var decimals = 3; + // create path from string/position + if (typeof line === 'string' && arguments.length > 2) { + line = this._getPath(line, x, y, options); + } else if (_typeof(x) === 'object') { + // handle options specified in 2nd arg + options = x; + } // handle svg arguments + + if (options && typeof options.decimals === 'number') { + decimals = options.decimals; + } + return line.toPathData(decimals); + } /* + * Creates an SVG element, as a string, + * from the given opentype path or string/position + * + * @param {Object} path an opentype path, OR the following: + * + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional), set options.decimals + * to set the decimal precision of the path-data in the element, + * options.fill to set the fill color for the element, + * options.stroke to set the stroke color for the element, + * options.strokeWidth to set the strokeWidth for the element. + * + * @return {Object} this p5.Font object + */ + + }, + { + key: '_getSVG', + value: function _getSVG(line, x, y, options) { + var decimals = 3; + // create path from string/position + if (typeof line === 'string' && arguments.length > 2) { + line = this._getPath(line, x, y, options); + } else if (_typeof(x) === 'object') { + // handle options specified in 2nd arg + options = x; + } // handle svg arguments + + if (options) { + if (typeof options.decimals === 'number') { + decimals = options.decimals; + } + if (typeof options.strokeWidth === 'number') { + line.strokeWidth = options.strokeWidth; + } + if (typeof options.fill !== 'undefined') { + line.fill = options.fill; + } + if (typeof options.stroke !== 'undefined') { + line.stroke = options.stroke; + } + } + return line.toSVG(decimals); + } /* + * Renders an opentype path or string/position + * to the current graphics context + * + * @param {Object} path an opentype path, OR the following: + * + * @param {String} line a line of text + * @param {Number} x x-position + * @param {Number} y y-position + * @param {Object} options opentype options (optional) + * + * @return {p5.Font} this p5.Font object + */ + + }, + { + key: '_renderPath', + value: function _renderPath(line, x, y, options) { + var pdata; + var pg = options && options.renderer || this.parent._renderer; + var ctx = pg.drawingContext; + if (_typeof(line) === 'object' && line.commands) { + pdata = line.commands; + } else { + //pos = handleAlignment(p, ctx, line, x, y); + pdata = this._getPath(line, x, y, options).commands; + } + ctx.beginPath(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = pdata[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var cmd = _step.value; + if (cmd.type === 'M') { + ctx.moveTo(cmd.x, cmd.y); + } else if (cmd.type === 'L') { + ctx.lineTo(cmd.x, cmd.y); + } else if (cmd.type === 'C') { + ctx.bezierCurveTo(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + } else if (cmd.type === 'Q') { + ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); + } else if (cmd.type === 'Z') { + ctx.closePath(); + } + } // only draw stroke if manually set by user + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (pg._doStroke && pg._strokeSet && !pg._clipping) { + ctx.stroke(); + } + if (pg._doFill && !pg._clipping) { + // if fill hasn't been set by user, use default-text-fill + if (!pg._fillSet) { + pg._setFill(constants._DEFAULT_TEXT_FILL); + } + ctx.fill(); + } + return this; + } + }, + { + key: '_textWidth', + value: function _textWidth(str, fontSize) { + return this.font.getAdvanceWidth(str, fontSize); + } + }, + { + key: '_textAscent', + value: function _textAscent(fontSize) { + return this.font.ascender * this._scale(fontSize); + } + }, + { + key: '_textDescent', + value: function _textDescent(fontSize) { + return - this.font.descender * this._scale(fontSize); + } + }, + { + key: '_scale', + value: function _scale(fontSize) { + return 1 / this.font.unitsPerEm * (fontSize || this.parent._renderer._textSize); + } + }, + { + key: '_handleAlignment', + value: function _handleAlignment(renderer, line, x, y, textWidth) { + var fontSize = renderer._textSize; + if (typeof textWidth === 'undefined') { + textWidth = this._textWidth(line, fontSize); + } + switch (renderer._textAlign) { + case constants.CENTER: + x -= textWidth / 2; + break; + case constants.RIGHT: + x -= textWidth; + break; + } + switch (renderer._textBaseline) { + case constants.TOP: + y += this._textAscent(fontSize); + break; + case constants.CENTER: + y += this._textAscent(fontSize) / 2; + break; + case constants.BOTTOM: + y -= this._textDescent(fontSize); + break; + } + return { + x: x, + y: y + }; + } + } + ]); + return _class; + }(); + // path-utils + function pathToPoints(cmds, options) { + var opts = parseOpts(options, { + sampleFactor: 0.1, + simplifyThreshold: 0 + }); + var // total-length + len = pointAtLength(cmds, 0, 1), + t = len / (len * opts.sampleFactor), + pts = [ + ]; + for (var i = 0; i < len; i += t) { + pts.push(pointAtLength(cmds, i)); + } + if (opts.simplifyThreshold) { + simplify(pts, opts.simplifyThreshold); + } + return pts; + } + function simplify(pts) { + var angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var num = 0; + for (var i = pts.length - 1; pts.length > 3 && i >= 0; --i) { + if (collinear(at(pts, i - 1), at(pts, i), at(pts, i + 1), angle)) { + // Remove the middle point + pts.splice(i % pts.length, 1); + num++; + } + } + return num; + } + function splitPaths(cmds) { + var paths = [ + ]; + var current; + for (var i = 0; i < cmds.length; i++) { + if (cmds[i].type === 'M') { + if (current) { + paths.push(current); + } + current = [ + ]; + } + current.push(cmdToArr(cmds[i])); + } + paths.push(current); + return paths; + } + function cmdToArr(cmd) { + var arr = [ + cmd.type + ]; + if (cmd.type === 'M' || cmd.type === 'L') { + // moveto or lineto + arr.push(cmd.x, cmd.y); + } else if (cmd.type === 'C') { + arr.push(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); + } else if (cmd.type === 'Q') { + arr.push(cmd.x1, cmd.y1, cmd.x, cmd.y); + } // else if (cmd.type === 'Z') { /* no-op */ } + + return arr; + } + function parseOpts(options, defaults) { + if (_typeof(options) !== 'object') { + options = defaults; + } else { + for (var key in defaults) { + if (typeof options[key] === 'undefined') { + options[key] = defaults[key]; + } + } + } + return options; + } //////////////////////// Helpers //////////////////////////// + + function at(v, i) { + var s = v.length; + return v[i < 0 ? i % s + s : i % s]; + } + function collinear(a, b, c, thresholdAngle) { + if (!thresholdAngle) { + return areaTriangle(a, b, c) === 0; + } + if (typeof collinear.tmpPoint1 === 'undefined') { + collinear.tmpPoint1 = [ + ]; + collinear.tmpPoint2 = [ + ]; + } + var ab = collinear.tmpPoint1, + bc = collinear.tmpPoint2; + ab.x = b.x - a.x; + ab.y = b.y - a.y; + bc.x = c.x - b.x; + bc.y = c.y - b.y; + var dot = ab.x * bc.x + ab.y * bc.y, + magA = Math.sqrt(ab.x * ab.x + ab.y * ab.y), + magB = Math.sqrt(bc.x * bc.x + bc.y * bc.y), + angle = Math.acos(dot / (magA * magB)); + return angle < thresholdAngle; + } + function areaTriangle(a, b, c) { + return (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]); + } // Portions of below code copyright 2008 Dmitry Baranovskiy (via MIT license) + + function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) { + var t1 = 1 - t; + var t13 = Math.pow(t1, 3); + var t12 = Math.pow(t1, 2); + var t2 = t * t; + var t3 = t2 * t; + var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x; + var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y; + var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x); + var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y); + var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x); + var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y); + var ax = t1 * p1x + t * c1x; + var ay = t1 * p1y + t * c1y; + var cx = t1 * c2x + t * p2x; + var cy = t1 * c2y + t * p2y; + var alpha = 90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI; + if (mx > nx || my < ny) { + alpha += 180; + } + return { + x: x, + y: y, + m: { + x: mx, + y: my + }, + n: { + x: nx, + y: ny + }, + start: { + x: ax, + y: ay + }, + end: { + x: cx, + y: cy + }, + alpha: alpha + }; + } + function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) { + return length == null ? bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) : findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length)); + } + function pointAtLength(path, length, istotal) { + path = path2curve(path); + var x; + var y; + var p; + var l; + var sp = ''; + var subpaths = { + }; + var point; + var len = 0; + for (var i = 0, ii = path.length; i < ii; i++) { + p = path[i]; + if (p[0] === 'M') { + x = + p[1]; + y = + p[2]; + } else { + l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]); + if (len + l > length) { + if (!istotal) { + point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len); + return { + x: point.x, + y: point.y, + alpha: point.alpha + }; + } + } + len += l; + x = + p[5]; + y = + p[6]; + } + sp += p.shift() + p; + } + subpaths.end = sp; + point = istotal ? len : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); + if (point.alpha) { + point = { + x: point.x, + y: point.y, + alpha: point.alpha + }; + } + return point; + } + function pathToAbsolute(pathArray) { + var res = [ + ], + x = 0, + y = 0, + mx = 0, + my = 0, + start = 0; + if (!pathArray) { + // console.warn("Unexpected state: undefined pathArray"); // shouldn't happen + return res; + } + if (pathArray[0][0] === 'M') { + x = + pathArray[0][1]; + y = + pathArray[0][2]; + mx = x; + my = y; + start++; + res[0] = [ + 'M', + x, + y + ]; + } + var dots; + var crz = pathArray.length === 3 && pathArray[0][0] === 'M' && pathArray[1][0].toUpperCase() === 'R' && pathArray[2][0].toUpperCase() === 'Z'; + for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) { + res.push(r = [ + ]); + pa = pathArray[i]; + if (pa[0] !== String.prototype.toUpperCase.call(pa[0])) { + r[0] = String.prototype.toUpperCase.call(pa[0]); + switch (r[0]) { + case 'A': + r[1] = pa[1]; + r[2] = pa[2]; + r[3] = pa[3]; + r[4] = pa[4]; + r[5] = pa[5]; + r[6] = + (pa[6] + x); + r[7] = + (pa[7] + y); + break; + case 'V': + r[1] = + pa[1] + y; + break; + case 'H': + r[1] = + pa[1] + x; + break; + case 'R': + dots = [ + x, + y + ].concat(pa.slice(1)); + for (var j = 2, jj = dots.length; j < jj; j++) { + dots[j] = + dots[j] + x; + dots[++j] = + dots[j] + y; + } + res.pop(); + res = res.concat(catmullRom2bezier(dots, crz)); + break; + case 'M': + mx = + pa[1] + x; + my = + pa[2] + y; + break; + default: + for (var _j = 1, _jj = pa.length; _j < _jj; _j++) { + r[_j] = + pa[_j] + (_j % 2 ? x : y); + } + } + } else if (pa[0] === 'R') { + dots = [ + x, + y + ].concat(pa.slice(1)); + res.pop(); + res = res.concat(catmullRom2bezier(dots, crz)); + r = [ + 'R' + ].concat(pa.slice( - 2)); + } else { + for (var k = 0, kk = pa.length; k < kk; k++) { + r[k] = pa[k]; + } + } + switch (r[0]) { + case 'Z': + x = mx; + y = my; + break; + case 'H': + x = r[1]; + break; + case 'V': + y = r[1]; + break; + case 'M': + mx = r[r.length - 2]; + my = r[r.length - 1]; + break; + default: + x = r[r.length - 2]; + y = r[r.length - 1]; + } + } + return res; + } + function path2curve(path, path2) { + var p = pathToAbsolute(path), + p2 = path2 && pathToAbsolute(path2); + var attrs = { + x: 0, + y: 0, + bx: 0, + by: 0, + X: 0, + Y: 0, + qx: null, + qy: null + }; + var attrs2 = { + x: 0, + y: 0, + bx: 0, + by: 0, + X: 0, + Y: 0, + qx: null, + qy: null + }; + var pcoms1 = [ + ]; // path commands of original path p + var pcoms2 = [ + ]; // path commands of original path p2 + var ii; + var processPath = function processPath(path, d, pcom) { + var nx; + var ny; + var tq = { + T: 1, + Q: 1 + }; + if (!path) { + return ['C', + d.x, + d.y, + d.x, + d.y, + d.x, + d.y]; + } + if (!(path[0] in tq)) { + d.qx = d.qy = null; + } + switch (path[0]) { + case 'M': + d.X = path[1]; + d.Y = path[2]; + break; + case 'A': + path = [ + 'C' + ].concat(a2c.apply(0, [ + d.x, + d.y + ].concat(path.slice(1)))); + break; + case 'S': + if (pcom === 'C' || pcom === 'S') { + nx = d.x * 2 - d.bx; + ny = d.y * 2 - d.by; + } else { + nx = d.x; + ny = d.y; + } + path = [ + 'C', + nx, + ny + ].concat(path.slice(1)); + break; + case 'T': + if (pcom === 'Q' || pcom === 'T') { + d.qx = d.x * 2 - d.qx; + d.qy = d.y * 2 - d.qy; + } else { + d.qx = d.x; + d.qy = d.y; + } + path = [ + 'C' + ].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2])); + break; + case 'Q': + d.qx = path[1]; + d.qy = path[2]; + path = [ + 'C' + ].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4])); + break; + case 'L': + path = [ + 'C' + ].concat(l2c(d.x, d.y, path[1], path[2])); + break; + case 'H': + path = [ + 'C' + ].concat(l2c(d.x, d.y, path[1], d.y)); + break; + case 'V': + path = [ + 'C' + ].concat(l2c(d.x, d.y, d.x, path[1])); + break; + case 'Z': + path = [ + 'C' + ].concat(l2c(d.x, d.y, d.X, d.Y)); + break; + } + return path; + }, + fixArc = function fixArc(pp, i) { + if (pp[i].length > 7) { + pp[i].shift(); + var pi = pp[i]; + while (pi.length) { + pcoms1[i] = 'A'; + if (p2) { + pcoms2[i] = 'A'; + } + pp.splice(i++, 0, [ + 'C' + ].concat(pi.splice(0, 6))); + } + pp.splice(i, 1); + ii = Math.max(p.length, p2 && p2.length || 0); + } + }, + fixM = function fixM(path1, path2, a1, a2, i) { + if (path1 && path2 && path1[i][0] === 'M' && path2[i][0] !== 'M') { + path2.splice(i, 0, [ + 'M', + a2.x, + a2.y + ]); + a1.bx = 0; + a1.by = 0; + a1.x = path1[i][1]; + a1.y = path1[i][2]; + ii = Math.max(p.length, p2 && p2.length || 0); + } + }; + var pfirst = ''; // temporary holder for original path command + var pcom = ''; // holder for previous path command of original path + ii = Math.max(p.length, p2 && p2.length || 0); + for (var i = 0; i < ii; i++) { + if (p[i]) { + pfirst = p[i][0]; + } // save current path command + + if (pfirst !== 'C') { + pcoms1[i] = pfirst; // Save current path command + if (i) { + pcom = pcoms1[i - 1]; + } // Get previous path command pcom + + } + p[i] = processPath(p[i], attrs, pcom); + if (pcoms1[i] !== 'A' && pfirst === 'C') { + pcoms1[i] = 'C'; + } + fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1 + if (p2) { + // the same procedures is done to p2 + if (p2[i]) { + pfirst = p2[i][0]; + } + if (pfirst !== 'C') { + pcoms2[i] = pfirst; + if (i) { + pcom = pcoms2[i - 1]; + } + } + p2[i] = processPath(p2[i], attrs2, pcom); + if (pcoms2[i] !== 'A' && pfirst === 'C') { + pcoms2[i] = 'C'; + } + fixArc(p2, i); + } + fixM(p, p2, attrs, attrs2, i); + fixM(p2, p, attrs2, attrs, i); + var seg = p[i], + seg2 = p2 && p2[i], + seglen = seg.length, + seg2len = p2 && seg2.length; + attrs.x = seg[seglen - 2]; + attrs.y = seg[seglen - 1]; + attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x; + attrs.by = parseFloat(seg[seglen - 3]) || attrs.y; + attrs2.bx = p2 && (parseFloat(seg2[seg2len - 4]) || attrs2.x); + attrs2.by = p2 && (parseFloat(seg2[seg2len - 3]) || attrs2.y); + attrs2.x = p2 && seg2[seg2len - 2]; + attrs2.y = p2 && seg2[seg2len - 1]; + } + return p2 ? [ + p, + p2 + ] : p; + } + function a2c(x1, y1, rx, ry, angle, lac, sweep_flag, x2, y2, recursive) { + // for more information of where this Math came from visit: + // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes + var PI = Math.PI; + var _120 = PI * 120 / 180; + var f1; + var f2; + var cx; + var cy; + var rad = PI / 180 * ( + angle || 0); + var res = [ + ]; + var xy; + var rotate = function rotate(x, y, rad) { + var X = x * Math.cos(rad) - y * Math.sin(rad), + Y = x * Math.sin(rad) + y * Math.cos(rad); + return { + x: X, + y: Y + }; + }; + if (!recursive) { + xy = rotate(x1, y1, - rad); + x1 = xy.x; + y1 = xy.y; + xy = rotate(x2, y2, - rad); + x2 = xy.x; + y2 = xy.y; + var x = (x1 - x2) / 2; + var y = (y1 - y2) / 2; + var h = x * x / (rx * rx) + y * y / (ry * ry); + if (h > 1) { + h = Math.sqrt(h); + rx = h * rx; + ry = h * ry; + } + var rx2 = rx * rx, + ry2 = ry * ry; + var k = (lac === sweep_flag ? - 1 : 1) * Math.sqrt(Math.abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))); + cx = k * rx * y / ry + (x1 + x2) / 2; + cy = k * - ry * x / rx + (y1 + y2) / 2; + f1 = Math.asin(((y1 - cy) / ry).toFixed(9)); + f2 = Math.asin(((y2 - cy) / ry).toFixed(9)); + f1 = x1 < cx ? PI - f1 : f1; + f2 = x2 < cx ? PI - f2 : f2; + if (f1 < 0) { + f1 = PI * 2 + f1; + } + if (f2 < 0) { + f2 = PI * 2 + f2; + } + if (sweep_flag && f1 > f2) { + f1 = f1 - PI * 2; + } + if (!sweep_flag && f2 > f1) { + f2 = f2 - PI * 2; + } + } else { + f1 = recursive[0]; + f2 = recursive[1]; + cx = recursive[2]; + cy = recursive[3]; + } + var df = f2 - f1; + if (Math.abs(df) > _120) { + var f2old = f2, + x2old = x2, + y2old = y2; + f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : - 1); + x2 = cx + rx * Math.cos(f2); + y2 = cy + ry * Math.sin(f2); + res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [ + f2, + f2old, + cx, + cy + ]); + } + df = f2 - f1; + var c1 = Math.cos(f1), + s1 = Math.sin(f1), + c2 = Math.cos(f2), + s2 = Math.sin(f2), + t = Math.tan(df / 4), + hx = 4 / 3 * rx * t, + hy = 4 / 3 * ry * t, + m1 = [ + x1, + y1 + ], + m2 = [ + x1 + hx * s1, + y1 - hy * c1 + ], + m3 = [ + x2 + hx * s2, + y2 - hy * c2 + ], + m4 = [ + x2, + y2 + ]; + m2[0] = 2 * m1[0] - m2[0]; + m2[1] = 2 * m1[1] - m2[1]; + if (recursive) { + return [m2, + m3, + m4].concat(res); + } else { + res = [ + m2, + m3, + m4 + ].concat(res).join().split(','); + var newres = [ + ]; + for (var i = 0, ii = res.length; i < ii; i++) { + newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x; + } + return newres; + } + } // http://schepers.cc/getting-to-the-point + + function catmullRom2bezier(crp, z) { + var d = [ + ]; + for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) { + var p = [ + { + x: + crp[i - 2], + y: + crp[i - 1] + }, + { + x: + crp[i], + y: + crp[i + 1] + }, + { + x: + crp[i + 2], + y: + crp[i + 3] + }, + { + x: + crp[i + 4], + y: + crp[i + 5] + } + ]; + if (z) { + if (!i) { + p[0] = { + x: + crp[iLen - 2], + y: + crp[iLen - 1] + }; + } else if (iLen - 4 === i) { + p[3] = { + x: + crp[0], + y: + crp[1] + }; + } else if (iLen - 2 === i) { + p[2] = { + x: + crp[0], + y: + crp[1] + }; + p[3] = { + x: + crp[2], + y: + crp[3] + }; + } + } else { + if (iLen - 4 === i) { + p[3] = p[2]; + } else if (!i) { + p[0] = { + x: + crp[i], + y: + crp[i + 1] + }; + } + } + d.push(['C', + ( - p[0].x + 6 * p[1].x + p[2].x) / 6, + ( - p[0].y + 6 * p[1].y + p[2].y) / 6, + (p[1].x + 6 * p[2].x - p[3].x) / 6, + (p[1].y + 6 * p[2].y - p[3].y) / 6, + p[2].x, + p[2].y]); + } + return d; + } + function l2c(x1, y1, x2, y2) { + return [x1, + y1, + x2, + y2, + x2, + y2]; + } + function q2c(x1, y1, ax, ay, x2, y2) { + var _13 = 1 / 3, + _23 = 2 / 3; + return [_13 * x1 + _23 * ax, + _13 * y1 + _23 * ay, + _13 * x2 + _23 * ax, + _13 * y2 + _23 * ay, + x2, + y2]; + } + function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) { + if (z == null) { + z = 1; + } + z = z > 1 ? 1 : z < 0 ? 0 : z; + var z2 = z / 2; + var n = 12; + var Tvalues = [ + - 0.1252, + 0.1252, + - 0.3678, + 0.3678, + - 0.5873, + 0.5873, + - 0.7699, + 0.7699, + - 0.9041, + 0.9041, + - 0.9816, + 0.9816 + ]; + var sum = 0; + var Cvalues = [ + 0.2491, + 0.2491, + 0.2335, + 0.2335, + 0.2032, + 0.2032, + 0.1601, + 0.1601, + 0.1069, + 0.1069, + 0.0472, + 0.0472 + ]; + for (var i = 0; i < n; i++) { + var ct = z2 * Tvalues[i] + z2, + xbase = base3(ct, x1, x2, x3, x4), + ybase = base3(ct, y1, y2, y3, y4), + comb = xbase * xbase + ybase * ybase; + sum += Cvalues[i] * Math.sqrt(comb); + } + return z2 * sum; + } + function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) { + if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) { + return; + } + var t = 1; + var step = t / 2; + var t2 = t - step; + var l; + var e = 0.01; + l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); + while (Math.abs(l - ll) > e) { + step /= 2; + t2 += (l < ll ? 1 : - 1) * step; + l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); + } + return t2; + } + function base3(t, p1, p2, p3, p4) { + var t1 = - 3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, + t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3; + return t * t2 - 3 * p1 + 3 * p2; + } + function cacheKey() { + var hash = ''; + for (var i = arguments.length - 1; i >= 0; --i) { + hash += '?'.concat(i < 0 || arguments.length <= i ? undefined : arguments[i]); + } + return hash; + } + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.number.to-fixed': 193, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 337: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.array-buffer.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.array-buffer.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Data + * @submodule Array Functions + * @for p5 + * @requires core + */ + /** + * Adds a value to the end of an array. Extends the length of + * the array by one. Maps to Array.push(). + * + * @method append + * @deprecated Use array.push(value) instead. + * @param {Array} array Array to append + * @param {any} value to be added to the Array + * @return {Array} the array that was appended to + * @example + *
                              + * function setup() { + * let myArray = ['Mango', 'Apple', 'Papaya']; + * print(myArray); // ['Mango', 'Apple', 'Papaya'] + * + * append(myArray, 'Peach'); + * print(myArray); // ['Mango', 'Apple', 'Papaya', 'Peach'] + * } + *
                              + */ + + _main.default.prototype.append = function (array, value) { + array.push(value); + return array; + }; + /** + * Copies an array (or part of an array) to another array. The src array is + * copied to the dst array, beginning at the position specified by + * srcPosition and into the position specified by dstPosition. The number of + * elements to copy is determined by length. Note that copying values + * overwrites existing values in the destination array. To append values + * instead of overwriting them, use concat(). + * + * The simplified version with only two arguments, arrayCopy(src, dst), + * copies an entire array to another of the same size. It is equivalent to + * arrayCopy(src, 0, dst, 0, src.length). + * + * Using this function is far more efficient for copying array data than + * iterating through a for() loop and copying each element individually. + * + * @method arrayCopy + * @deprecated Use arr1.copyWithin(arr2) instead. + * @param {Array} src the source Array + * @param {Integer} srcPosition starting position in the source Array + * @param {Array} dst the destination Array + * @param {Integer} dstPosition starting position in the destination Array + * @param {Integer} length number of Array elements to be copied + * + * @example + *
                              + * let src = ['A', 'B', 'C']; + * let dst = [1, 2, 3]; + * let srcPosition = 1; + * let dstPosition = 0; + * let length = 2; + * + * print(src); // ['A', 'B', 'C'] + * print(dst); // [ 1 , 2 , 3 ] + * + * arrayCopy(src, srcPosition, dst, dstPosition, length); + * print(dst); // ['B', 'C', 3] + *
                              + */ + /** + * @method arrayCopy + * @deprecated Use arr1.copyWithin(arr2) instead. + * @param {Array} src + * @param {Array} dst + * @param {Integer} [length] + */ + _main.default.prototype.arrayCopy = function (src, srcPosition, dst, dstPosition, length) { + // the index to begin splicing from dst array + var start; + var end; + if (typeof length !== 'undefined') { + end = Math.min(length, src.length); + start = dstPosition; + src = src.slice(srcPosition, end + srcPosition); + } else { + if (typeof dst !== 'undefined') { + // src, dst, length + // rename so we don't get confused + end = dst; + end = Math.min(end, src.length); + } else { + // src, dst + end = src.length; + } + start = 0; + // rename so we don't get confused + dst = srcPosition; + src = src.slice(0, end); + } // Since we are not returning the array and JavaScript is pass by reference + // we must modify the actual values of the array + // instead of reassigning arrays + + Array.prototype.splice.apply(dst, [ + start, + end + ].concat(src)); + }; + /** + * Concatenates two arrays, maps to Array.concat(). Does not modify the + * input arrays. + * + * @method concat + * @deprecated Use arr1.concat(arr2) instead. + * @param {Array} a first Array to concatenate + * @param {Array} b second Array to concatenate + * @return {Array} concatenated array + * + * @example + *
                              + * function setup() { + * let arr1 = ['A', 'B', 'C']; + * let arr2 = [1, 2, 3]; + * + * print(arr1); // ['A','B','C'] + * print(arr2); // [1,2,3] + * + * let arr3 = concat(arr1, arr2); + * + * print(arr1); // ['A','B','C'] + * print(arr2); // [1, 2, 3] + * print(arr3); // ['A','B','C', 1, 2, 3] + * } + *
                              + */ + _main.default.prototype.concat = function (list0, list1) { + return list0.concat(list1); + }; + /** + * Reverses the order of an array, maps to Array.reverse() + * + * @method reverse + * @deprecated Use array.reverse() instead. + * @param {Array} list Array to reverse + * @return {Array} the reversed list + * @example + *
                              + * function setup() { + * let myArray = ['A', 'B', 'C']; + * print(myArray); // ['A','B','C'] + * + * reverse(myArray); + * print(myArray); // ['C','B','A'] + * } + *
                              + */ + _main.default.prototype.reverse = function (list) { + return list.reverse(); + }; + /** + * Decreases an array by one element and returns the shortened array, + * maps to Array.pop(). + * + * @method shorten + * @deprecated Use array.pop() instead. + * @param {Array} list Array to shorten + * @return {Array} shortened Array + * @example + *
                              + * function setup() { + * let myArray = ['A', 'B', 'C']; + * print(myArray); // ['A', 'B', 'C'] + * let newArray = shorten(myArray); + * print(myArray); // ['A','B','C'] + * print(newArray); // ['A','B'] + * } + *
                              + */ + _main.default.prototype.shorten = function (list) { + list.pop(); + return list; + }; + /** + * Randomizes the order of the elements of an array. Implements + * + * Fisher-Yates Shuffle Algorithm. + * + * @method shuffle + * @param {Array} array Array to shuffle + * @param {Boolean} [bool] modify passed array + * @return {Array} shuffled Array + * @example + *
                              + * function setup() { + * let regularArr = ['ABC', 'def', createVector(), TAU, Math.E]; + * print(regularArr); + * shuffle(regularArr, true); // force modifications to passed array + * print(regularArr); + * + * // By default shuffle() returns a shuffled cloned array: + * let newArr = shuffle(regularArr); + * print(regularArr); + * print(newArr); + * } + *
                              + */ + _main.default.prototype.shuffle = function (arr, bool) { + var isView = ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(arr); + arr = bool || isView ? arr : arr.slice(); + var rnd, + tmp, + idx = arr.length; + while (idx > 1) { + rnd = this.random(0, 1) * idx | 0; + tmp = arr[--idx]; + arr[idx] = arr[rnd]; + arr[rnd] = tmp; + } + return arr; + }; + /** + * Sorts an array of numbers from smallest to largest, or puts an array of + * words in alphabetical order. The original array is not modified; a + * re-ordered array is returned. The count parameter states the number of + * elements to sort. For example, if there are 12 elements in an array and + * count is set to 5, only the first 5 elements in the array will be sorted. + * + * @method sort + * @deprecated Use array.sort() instead. + * @param {Array} list Array to sort + * @param {Integer} [count] number of elements to sort, starting from 0 + * @return {Array} the sorted list + * + * @example + *
                              + * function setup() { + * let words = ['banana', 'apple', 'pear', 'lime']; + * print(words); // ['banana', 'apple', 'pear', 'lime'] + * let count = 4; // length of array + * + * words = sort(words, count); + * print(words); // ['apple', 'banana', 'lime', 'pear'] + * } + *
                              + *
                              + * function setup() { + * let numbers = [2, 6, 1, 5, 14, 9, 8, 12]; + * print(numbers); // [2, 6, 1, 5, 14, 9, 8, 12] + * let count = 5; // Less than the length of the array + * + * numbers = sort(numbers, count); + * print(numbers); // [1,2,5,6,14,9,8,12] + * } + *
                              + */ + _main.default.prototype.sort = function (list, count) { + var arr = count ? list.slice(0, Math.min(count, list.length)) : list; + var rest = count ? list.slice(Math.min(count, list.length)) : [ + ]; + if (typeof arr[0] === 'string') { + arr = arr.sort(); + } else { + arr = arr.sort(function (a, b) { + return a - b; + }); + } + return arr.concat(rest); + }; + /** + * Inserts a value or an array of values into an existing array. The first + * parameter specifies the initial array to be modified, and the second + * parameter defines the data to be inserted. The third parameter is an index + * value which specifies the array position from which to insert data. + * (Remember that array index numbering starts at zero, so the first position + * is 0, the second position is 1, and so on.) + * + * @method splice + * @deprecated Use array.splice() instead. + * @param {Array} list Array to splice into + * @param {any} value value to be spliced in + * @param {Integer} position in the array from which to insert data + * @return {Array} the list + * + * @example + *
                              + * function setup() { + * let myArray = [0, 1, 2, 3, 4]; + * let insArray = ['A', 'B', 'C']; + * print(myArray); // [0, 1, 2, 3, 4] + * print(insArray); // ['A','B','C'] + * + * splice(myArray, insArray, 3); + * print(myArray); // [0,1,2,'A','B','C',3,4] + * } + *
                              + */ + _main.default.prototype.splice = function (list, value, index) { + // note that splice returns spliced elements and not an array + Array.prototype.splice.apply(list, [ + index, + 0 + ].concat(value)); + return list; + }; + /** + * Extracts an array of elements from an existing array. The list parameter + * defines the array from which the elements will be copied, and the start + * and count parameters specify which elements to extract. If no count is + * given, elements will be extracted from the start to the end of the array. + * When specifying the start, remember that the first array element is 0. + * This function does not change the source array. + * + * @method subset + * @deprecated Use array.slice() instead. + * @param {Array} list Array to extract from + * @param {Integer} start position to begin + * @param {Integer} [count] number of values to extract + * @return {Array} Array of extracted elements + * + * @example + *
                              + * function setup() { + * let myArray = [1, 2, 3, 4, 5]; + * print(myArray); // [1, 2, 3, 4, 5] + * + * let sub1 = subset(myArray, 0, 3); + * let sub2 = subset(myArray, 2, 2); + * print(sub1); // [1,2,3] + * print(sub2); // [3,4] + * } + *
                              + */ + _main.default.prototype.subset = function (list, start, count) { + if (typeof count !== 'undefined') { + return list.slice(start, start + count); + } else { + return list.slice(start, list.length); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array-buffer.constructor': 168, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.object.to-string': 200 + } + ], + 338: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.repeat'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.number.constructor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.repeat'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Data + * @submodule Conversion + * @for p5 + * @requires core + */ + /** + * Converts a string to its floating point representation. The contents of a + * string must resemble a number, or NaN (not a number) will be returned. + * For example, float("1234.56") evaluates to 1234.56, but float("giraffe") + * will return NaN. + * + * When an array of values is passed in, then an array of floats of the same + * length is returned. + * + * @method float + * @param {String} str float string to parse + * @return {Number} floating point representation of string + * @example + *
                              + * let str = '20'; + * let diameter = float(str); + * ellipse(width / 2, height / 2, diameter, diameter); + * describe('20-by-20 white ellipse in the center of the canvas'); + *
                              + *
                              + * print(float('10.31')); // 10.31 + * print(float('Infinity')); // Infinity + * print(float('-Infinity')); // -Infinity + *
                              + */ + + _main.default.prototype.float = function (str) { + if (str instanceof Array) { + return str.map(parseFloat); + } + return parseFloat(str); + }; + /** + * Converts a boolean, string, or float to its integer representation. + * When an array of values is passed in, then an int array of the same length + * is returned. + * + * @method int + * @param {String|Boolean|Number} n value to parse + * @param {Integer} [radix] the radix to convert to (default: 10) + * @return {Number} integer representation of value + * + * @example + *
                              + * print(int('10')); // 10 + * print(int(10.31)); // 10 + * print(int(-10)); // -10 + * print(int(true)); // 1 + * print(int(false)); // 0 + * print(int([false, true, '10.3', 9.8])); // [0, 1, 10, 9] + * print(int(Infinity)); // Infinity + * print(int('-Infinity')); // -Infinity + *
                              + */ + /** + * @method int + * @param {Array} ns values to parse + * @param {Integer} [radix] + * @return {Number[]} integer representation of values + */ + _main.default.prototype.int = function (n) { + var radix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10; + if (n === Infinity || n === 'Infinity') { + return Infinity; + } else if (n === - Infinity || n === '-Infinity') { + return - Infinity; + } else if (typeof n === 'string') { + return parseInt(n, radix); + } else if (typeof n === 'number') { + return n | 0; + } else if (typeof n === 'boolean') { + return n ? 1 : 0; + } else if (n instanceof Array) { + return n.map(function (n) { + return _main.default.prototype.int(n, radix); + }); + } + }; + /** + * Converts a boolean, string or number to its string representation. + * When an array of values is passed in, then an array of strings of the same + * length is returned. + * + * @method str + * @param {String|Boolean|Number|Array} n value to parse + * @return {String} string representation of value + * @example + *
                              + * print(str('10')); // "10" + * print(str(10.31)); // "10.31" + * print(str(-10)); // "-10" + * print(str(true)); // "true" + * print(str(false)); // "false" + * print(str([true, '10.3', 9.8])); // [ "true", "10.3", "9.8" ] + *
                              + */ + _main.default.prototype.str = function (n) { + if (n instanceof Array) { + return n.map(_main.default.prototype.str); + } else { + return String(n); + } + }; + /** + * Converts a number or string to its boolean representation. + * For a number, any non-zero value (positive or negative) evaluates to true, + * while zero evaluates to false. For a string, the value "true" evaluates to + * true, while any other value evaluates to false. When an array of number or + * string values is passed in, then a array of booleans of the same length is + * returned. + * + * @method boolean + * @param {String|Boolean|Number|Array} n value to parse + * @return {Boolean} boolean representation of value + * @example + *
                              + * print(boolean(0)); // false + * print(boolean(1)); // true + * print(boolean('true')); // true + * print(boolean('abcd')); // false + * print(boolean([0, 12, 'true'])); // [false, true, true] + *
                              + */ + _main.default.prototype.boolean = function (n) { + if (typeof n === 'number') { + return n !== 0; + } else if (typeof n === 'string') { + return n.toLowerCase() === 'true'; + } else if (typeof n === 'boolean') { + return n; + } else if (n instanceof Array) { + return n.map(_main.default.prototype.boolean); + } + }; + /** + * Converts a number, string representation of a number, or boolean to its byte + * representation. A byte can be only a whole number between -128 and 127, so + * when a value outside of this range is converted, it wraps around to the + * corresponding byte representation. When an array of number, string or boolean + * values is passed in, then an array of bytes the same length is returned. + * + * @method byte + * @param {String|Boolean|Number} n value to parse + * @return {Number} byte representation of value + * + * @example + *
                              + * print(byte(127)); // 127 + * print(byte(128)); // -128 + * print(byte(23.4)); // 23 + * print(byte('23.4')); // 23 + * print(byte('hello')); // NaN + * print(byte(true)); // 1 + * print(byte([0, 255, '100'])); // [0, -1, 100] + *
                              + */ + /** + * @method byte + * @param {Array} ns values to parse + * @return {Number[]} array of byte representation of values + */ + _main.default.prototype.byte = function (n) { + var nn = _main.default.prototype.int(n, 10); + if (typeof nn === 'number') { + return (nn + 128) % 256 - 128; + } else if (nn instanceof Array) { + return nn.map(_main.default.prototype.byte); + } + }; + /** + * Converts a number or string to its corresponding single-character + * string representation. If a string parameter is provided, it is first + * parsed as an integer and then translated into a single-character string. + * When an array of number or string values is passed in, then an array of + * single-character strings of the same length is returned. + * + * @method char + * @param {String|Number} n value to parse + * @return {String} string representation of value + * + * @example + *
                              + * print(char(65)); // "A" + * print(char('65')); // "A" + * print(char([65, 66, 67])); // [ "A", "B", "C" ] + * print(join(char([65, 66, 67]), '')); // "ABC" + *
                              + */ + /** + * @method char + * @param {Array} ns values to parse + * @return {String[]} array of string representation of values + */ + _main.default.prototype.char = function (n) { + if (typeof n === 'number' && !isNaN(n)) { + return String.fromCharCode(n); + } else if (n instanceof Array) { + return n.map(_main.default.prototype.char); + } else if (typeof n === 'string') { + return _main.default.prototype.char(parseInt(n, 10)); + } + }; + /** + * Converts a single-character string to its corresponding integer + * representation. When an array of single-character string values is passed + * in, then an array of integers of the same length is returned. + * + * @method unchar + * @param {String} n value to parse + * @return {Number} integer representation of value + * + * @example + *
                              + * print(unchar('A')); // 65 + * print(unchar(['A', 'B', 'C'])); // [ 65, 66, 67 ] + * print(unchar(split('ABC', ''))); // [ 65, 66, 67 ] + *
                              + */ + /** + * @method unchar + * @param {Array} ns values to parse + * @return {Number[]} integer representation of values + */ + _main.default.prototype.unchar = function (n) { + if (typeof n === 'string' && n.length === 1) { + return n.charCodeAt(0); + } else if (n instanceof Array) { + return n.map(_main.default.prototype.unchar); + } + }; + /** + * Converts a number to a string in its equivalent hexadecimal notation. If a + * second parameter is passed, it is used to set the number of characters to + * generate in the hexadecimal notation. When an array is passed in, an + * array of strings in hexadecimal notation of the same length is returned. + * + * @method hex + * @param {Number} n value to parse + * @param {Number} [digits] + * @return {String} hexadecimal string representation of value + * + * @example + *
                              + * print(hex(255)); // "000000FF" + * print(hex(255, 6)); // "0000FF" + * print(hex([0, 127, 255], 6)); // [ "000000", "00007F", "0000FF" ] + * print(Infinity); // "FFFFFFFF" + * print(-Infinity); // "00000000" + *
                              + */ + /** + * @method hex + * @param {Number[]} ns array of values to parse + * @param {Number} [digits] + * @return {String[]} hexadecimal string representation of values + */ + _main.default.prototype.hex = function (n, digits) { + digits = digits === undefined || digits === null ? digits = 8 : digits; + if (n instanceof Array) { + return n.map(function (n) { + return _main.default.prototype.hex(n, digits); + }); + } else if (n === Infinity || n === - Infinity) { + var c = n === Infinity ? 'F' : '0'; + return c.repeat(digits); + } else if (typeof n === 'number') { + if (n < 0) { + n = 4294967295 + n + 1; + } + var hex = Number(n).toString(16).toUpperCase(); + while (hex.length < digits) { + hex = '0'.concat(hex); + } + if (hex.length >= digits) { + hex = hex.substring(hex.length - digits, hex.length); + } + return hex; + } + }; + /** + * Converts a string representation of a hexadecimal number to its equivalent + * integer value. When an array of strings in hexadecimal notation is passed + * in, an array of integers of the same length is returned. + * + * @method unhex + * @param {String} n value to parse + * @return {Number} integer representation of hexadecimal value + * + * @example + *
                              + * print(unhex('A')); // 10 + * print(unhex('FF')); // 255 + * print(unhex(['FF', 'AA', '00'])); // [ 255, 170, 0 ] + *
                              + */ + /** + * @method unhex + * @param {Array} ns values to parse + * @return {Number[]} integer representations of hexadecimal value + */ + _main.default.prototype.unhex = function (n) { + if (n instanceof Array) { + return n.map(_main.default.prototype.unhex); + } else { + return parseInt('0x'.concat(n), 16); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.number.constructor': 191, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.repeat': 213 + } + ], + 339: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.pad-start'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.array.filter'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.constructor'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.pad-start'); + _dereq_('core-js/modules/es.string.replace'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + _dereq_('../core/friendly_errors/validate_params'); + _dereq_('../core/friendly_errors/file_errors'); + _dereq_('../core/friendly_errors/fes_core'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError('Invalid attempt to destructure non-iterable instance'); + } + function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === '[object Arguments]')) { + return; + } + var _arr = [ + ]; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } /** + * @module Data + * @submodule String Functions + * @for p5 + * @requires core + */ + //return p5; //LM is this a mistake? + /** + * Combines an array of Strings into one String, each separated by the + * character(s) used for the separator parameter. To join arrays of ints or + * floats, it's necessary to first convert them to Strings using nf() or + * nfs(). + * + * @method join + * @param {Array} list array of Strings to be joined + * @param {String} separator String to be placed between each item + * @return {String} joined String + * @example + *
                              + * + * let array = ['Hello', 'world!']; + * let separator = ' '; + * let message = join(array, separator); + * text(message, 5, 50); + * describe('“Hello world!” displayed middle left of canvas.'); + * + *
                              + */ + + _main.default.prototype.join = function (list, separator) { + _main.default._validateParameters('join', arguments); + return list.join(separator); + }; + /** + * This function is used to apply a regular expression to a piece of text, + * and return matching groups (elements found inside parentheses) as a + * String array. If there are no matches, a null value will be returned. + * If no groups are specified in the regular expression, but the sequence + * matches, an array of length 1 (with the matched text as the first element + * of the array) will be returned. + * + * To use the function, first check to see if the result is null. If the + * result is null, then the sequence did not match at all. If the sequence + * did match, an array is returned. + * + * If there are groups (specified by sets of parentheses) in the regular + * expression, then the contents of each will be returned in the array. + * Element [0] of a regular expression match returns the entire matching + * string, and the match groups start at element [1] (the first group is [1], + * the second [2], and so on). + * + * @method match + * @param {String} str the String to be searched + * @param {String} regexp the regexp to be used for matching + * @return {String[]} Array of Strings found + * @example + *
                              + * + * let string = 'Hello p5js*!'; + * let regexp = 'p5js\\*'; + * let m = match(string, regexp); + * text(m, 5, 50); + * describe('“p5js*” displayed middle left of canvas.'); + * + *
                              + */ + _main.default.prototype.match = function (str, reg) { + _main.default._validateParameters('match', arguments); + return str.match(reg); + }; + /** + * This function is used to apply a regular expression to a piece of text, + * and return a list of matching groups (elements found inside parentheses) + * as a two-dimensional String array. If there are no matches, a null value + * will be returned. If no groups are specified in the regular expression, + * but the sequence matches, a two dimensional array is still returned, but + * the second dimension is only of length one. + * + * To use the function, first check to see if the result is null. If the + * result is null, then the sequence did not match at all. If the sequence + * did match, a 2D array is returned. + * + * If there are groups (specified by sets of parentheses) in the regular + * expression, then the contents of each will be returned in the array. + * Assuming a loop with counter variable i, element [i][0] of a regular + * expression match returns the entire matching string, and the match groups + * start at element [i][1] (the first group is [i][1], the second [i][2], + * and so on). + * + * @method matchAll + * @param {String} str the String to be searched + * @param {String} regexp the regexp to be used for matching + * @return {String[]} 2d Array of Strings found + * @example + *
                              + * + * let string = 'Hello p5js*! Hello world!'; + * let regexp = 'Hello'; + * matchAll(string, regexp); + * + *
                              + */ + _main.default.prototype.matchAll = function (str, reg) { + _main.default._validateParameters('matchAll', arguments); + var re = new RegExp(reg, 'g'); + var match = re.exec(str); + var matches = [ + ]; + while (match !== null) { + matches.push(match); + // matched text: match[0] + // match start: match.index + // capturing group n: match[n] + match = re.exec(str); + } + return matches; + }; + /** + * Utility function for formatting numbers into strings. There are two + * versions: one for formatting floats, and one for formatting ints. + * + * The values for the digits, left, and right parameters should always + * be positive integers. + * + * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter + * if greater than the current length of the number. + * + * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 + * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than + * the result will be 123.200. + * + * @method nf + * @param {Number|String} num the Number to format + * @param {Integer|String} [left] number of digits to the left of the + * decimal point + * @param {Integer|String} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                              + * + * function setup() { + * background(200); + * let num1 = 321; + * let num2 = -1321; + * + * noStroke(); + * fill(0); + * textSize(16); + * + * text(nf(num1, 4, 2), 10, 30); + * text(nf(num2, 4, 2), 10, 80); + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“0321.00” middle top, “-1321.00” middle bottom canvas'); + * } + * + *
                              + */ + /** + * @method nf + * @param {Array} nums the Numbers to format + * @param {Integer|String} [left] + * @param {Integer|String} [right] + * @return {String[]} formatted Strings + */ + _main.default.prototype.nf = function (nums, left, right) { + _main.default._validateParameters('nf', arguments); + if (nums instanceof Array) { + return nums.map(function (x) { + return doNf(x, left, right); + }); + } else { + var typeOfFirst = Object.prototype.toString.call(nums); + if (typeOfFirst === '[object Arguments]') { + if (nums.length === 3) { + return this.nf(nums[0], nums[1], nums[2]); + } else if (nums.length === 2) { + return this.nf(nums[0], nums[1]); + } else { + return this.nf(nums[0]); + } + } else { + return doNf(nums, left, right); + } + } + }; + function doNf(num, left, right) { + var _num$toString$split = num.toString().split('.'), + _num$toString$split2 = _slicedToArray(_num$toString$split, 2), + leftPart = _num$toString$split2[0], + rightPart = _num$toString$split2[1]; + if (typeof right === 'undefined') { + leftPart = leftPart.padStart(left, '0'); + return rightPart ? leftPart + '.' + rightPart : leftPart; + } else { + var roundedOff = num.toFixed(right); + var _roundedOff$toString$ = roundedOff.toString().split('.'); + var _roundedOff$toString$2 = _slicedToArray(_roundedOff$toString$, 2); + leftPart = _roundedOff$toString$2[0]; + rightPart = _roundedOff$toString$2[1]; + leftPart = leftPart.padStart(left, '0'); + if (typeof rightPart === 'undefined') { + return leftPart; + } else { + return leftPart + '.' + rightPart; + } + } + } /** + * Utility function for formatting numbers into strings and placing + * appropriate commas to mark units of 1000. There are two versions: one + * for formatting ints, and one for formatting an array of ints. The value + * for the right parameter should always be a positive integer. + * + * @method nfc + * @param {Number|String} num the Number to format + * @param {Integer|String} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                              + * + * function setup() { + * background(200); + * let num = 11253106.115; + * let numArr = [1, 1, 2]; + * + * noStroke(); + * fill(0); + * textSize(12); + * + * // Draw formatted numbers + * text(nfc(num, 4), 10, 30); + * text(nfc(numArr, 2), 10, 80); + * + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“11,253,106.115” top middle and “1.00,1.00,2.00” displayed bottom mid'); + * } + * + *
                              + */ + /** + * @method nfc + * @param {Array} nums the Numbers to format + * @param {Integer|String} [right] + * @return {String[]} formatted Strings + */ + + _main.default.prototype.nfc = function (num, right) { + _main.default._validateParameters('nfc', arguments); + if (num instanceof Array) { + return num.map(function (x) { + return doNfc(x, right); + }); + } else { + return doNfc(num, right); + } + }; + function doNfc(num, right) { + num = num.toString(); + var dec = num.indexOf('.'); + var rem = dec !== - 1 ? num.substring(dec) : ''; + var n = dec !== - 1 ? num.substring(0, dec) : num; + n = n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); + if (right === 0) { + rem = ''; + } else if (typeof right !== 'undefined') { + if (right > rem.length) { + rem += dec === - 1 ? '.' : ''; + var len = right - rem.length + 1; + for (var i = 0; i < len; i++) { + rem += '0'; + } + } else { + rem = rem.substring(0, right + 1); + } + } + return n + rem; + } /** + * Utility function for formatting numbers into strings. Similar to nf() but + * puts a "+" in front of positive numbers and a "-" in front of negative + * numbers. There are two versions: one for formatting floats, and one for + * formatting ints. The values for left, and right parameters + * should always be positive integers. + * + * @method nfp + * @param {Number} num the Number to format + * @param {Integer} [left] number of digits to the left of the decimal + * point + * @param {Integer} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                              + * + * function setup() { + * background(200); + * let num1 = 11253106.115; + * let num2 = -11253106.115; + * + * noStroke(); + * fill(0); + * textSize(12); + * + * // Draw formatted numbers + * text(nfp(num1, 4, 2), 10, 30); + * text(nfp(num2, 4, 2), 10, 80); + * + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“+11253106.11” top middle and “-11253106.11” displayed bottom middle'); + * } + * + *
                              + */ + /** + * @method nfp + * @param {Number[]} nums the Numbers to format + * @param {Integer} [left] + * @param {Integer} [right] + * @return {String[]} formatted Strings + */ + + _main.default.prototype.nfp = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('nfp', args); + var nfRes = _main.default.prototype.nf.apply(this, args); + if (nfRes instanceof Array) { + return nfRes.map(addNfp); + } else { + return addNfp(nfRes); + } + }; + function addNfp(num) { + return parseFloat(num) > 0 ? '+'.concat(num.toString()) : num.toString(); + } /** + * Utility function for formatting numbers into strings. Similar to nf() but + * puts an additional "_" (space) in front of positive numbers just in case to align it with negative + * numbers which includes "-" (minus) sign. + * + * The main usecase of nfs() can be seen when one wants to align the digits (place values) of a non-negative + * number with some negative number (See the example to get a clear picture). + * There are two versions: one for formatting float, and one for formatting int. + * + * The values for the digits, left, and right parameters should always be positive integers. + * + * (IMP): The result on the canvas basically the expected alignment can vary based on the typeface you are using. + * + * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter + * if greater than the current length of the number. + * + * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 + * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than + * the result will be 123.200. + * + * @method nfs + * @param {Number} num the Number to format + * @param {Integer} [left] number of digits to the left of the decimal + * point + * @param {Integer} [right] number of digits to the right of the + * decimal point + * @return {String} formatted String + * + * @example + *
                              + * + * function setup() { + * background(200); + * let num1 = 321; + * let num2 = -1321; + * + * noStroke(); + * fill(0); + * textSize(16); + * + * // nfs() aligns num1 (positive number) with num2 (negative number) by + * // adding a blank space in front of the num1 (positive number) + * // [left = 4] in num1 add one 0 in front, to align the digits with num2 + * // [right = 2] in num1 and num2 adds two 0's after both numbers + * // To see the differences check the example of nf() too. + * text(nfs(num1, 4, 2), 10, 30); + * text(nfs(num2, 4, 2), 10, 80); + * // Draw dividing line + * stroke(120); + * line(0, 50, width, 50); + * + * describe('“0321.00” top middle and “-1321.00” displayed bottom middle'); + * } + * + *
                              + */ + /** + * @method nfs + * @param {Array} nums the Numbers to format + * @param {Integer} [left] + * @param {Integer} [right] + * @return {String[]} formatted Strings + */ + + _main.default.prototype.nfs = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('nfs', args); + var nfRes = _main.default.prototype.nf.apply(this, args); + if (nfRes instanceof Array) { + return nfRes.map(addNfs); + } else { + return addNfs(nfRes); + } + }; + function addNfs(num) { + return parseFloat(num) >= 0 ? ' '.concat(num.toString()) : num.toString(); + } /** + * The split() function maps to String.split(), it breaks a String into + * pieces using a character or string as the delimiter. The delim parameter + * specifies the character or characters that mark the boundaries between + * each piece. A String[] array is returned that contains each of the pieces. + * + * The splitTokens() function works in a similar fashion, except that it + * splits using a range of characters instead of a specific character or + * sequence. + * + * @method split + * @param {String} value the String to be split + * @param {String} delim the String used to separate the data + * @return {String[]} Array of Strings + * @example + *
                              + * + * let names = 'Pat,Xio,Alex'; + * let splitString = split(names, ','); + * text(splitString[0], 5, 30); + * text(splitString[1], 5, 50); + * text(splitString[2], 5, 70); + * describe('“Pat” top left, “Xio” mid left, and “Alex” displayed bottom left'); + * + *
                              + */ + + _main.default.prototype.split = function (str, delim) { + _main.default._validateParameters('split', arguments); + return str.split(delim); + }; + /** + * The splitTokens() function splits a String at one or many character + * delimiters or "tokens." The delim parameter specifies the character or + * characters to be used as a boundary. + * + * If no delim characters are specified, any whitespace character is used to + * split. Whitespace characters include tab (\t), line feed (\n), carriage + * return (\r), form feed (\f), and space. + * + * @method splitTokens + * @param {String} value the String to be split + * @param {String} [delim] list of individual Strings that will be used as + * separators + * @return {String[]} Array of Strings + * @example + *
                              + * + * function setup() { + * let myStr = 'Mango, Banana, Lime'; + * let myStrArr = splitTokens(myStr, ','); + * + * print(myStrArr); // prints : ["Mango"," Banana"," Lime"] + * } + * + *
                              + */ + _main.default.prototype.splitTokens = function (value, delims) { + _main.default._validateParameters('splitTokens', arguments); + var d; + if (typeof delims !== 'undefined') { + var str = delims; + var sqc = /\]/g.exec(str); + var sqo = /\[/g.exec(str); + if (sqo && sqc) { + str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); + sqo = /\[/g.exec(str); + str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); + d = new RegExp('[\\['.concat(str, '\\]]'), 'g'); + } else if (sqc) { + str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); + d = new RegExp('['.concat(str, '\\]]'), 'g'); + } else if (sqo) { + str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); + d = new RegExp('['.concat(str, '\\[]'), 'g'); + } else { + d = new RegExp('['.concat(str, ']'), 'g'); + } + } else { + d = /\s/g; + } + return value.split(d).filter(function (n) { + return n; + }); + }; + /** + * Removes whitespace characters from the beginning and end of a String. In + * addition to standard whitespace characters such as space, carriage return, + * and tab, this function also removes the Unicode "nbsp" character. + * + * @method trim + * @param {String} str a String to be trimmed + * @return {String} a trimmed String + * + * @example + *
                              + * + * let string = trim(' No new lines\n '); + * text(string + ' here', 2, 50); + * describe('“No new lines here” displayed center canvas'); + * + *
                              + */ + /** + * @method trim + * @param {Array} strs an Array of Strings to be trimmed + * @return {String[]} an Array of trimmed Strings + */ + _main.default.prototype.trim = function (str) { + _main.default._validateParameters('trim', arguments); + if (str instanceof Array) { + return str.map(this.trim); + } else { + return str.trim(); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/friendly_errors/fes_core': 289, + '../core/friendly_errors/file_errors': 290, + '../core/friendly_errors/validate_params': 293, + '../core/main': 298, + 'core-js/modules/es.array.filter': 173, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.number.to-fixed': 193, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.constructor': 204, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.match': 211, + 'core-js/modules/es.string.pad-start': 212, + 'core-js/modules/es.string.replace': 214, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.trim': 219, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 340: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module IO + * @submodule Time & Date + * @for p5 + * @requires core + */ + /** + * p5.js communicates with the clock on your computer. The day() function + * returns the current day as a value from 1 - 31. + * + * @method day + * @return {Integer} the current day + * @example + *
                              + * + * let d = day(); + * text('Current day: \n' + d, 5, 50); + * describe('Current day is displayed'); + * + *
                              + */ + + _main.default.prototype.day = function () { + return new Date().getDate(); + }; + /** + * p5.js communicates with the clock on your computer. The hour() function + * returns the current hour as a value from 0 - 23. + * + * @method hour + * @return {Integer} the current hour + * @example + *
                              + * + * let h = hour(); + * text('Current hour:\n' + h, 5, 50); + * describe('Current hour is displayed'); + * + *
                              + */ + _main.default.prototype.hour = function () { + return new Date().getHours(); + }; + /** + * p5.js communicates with the clock on your computer. The minute() function + * returns the current minute as a value from 0 - 59. + * + * @method minute + * @return {Integer} the current minute + * @example + *
                              + * + * let m = minute(); + * text('Current minute: \n' + m, 5, 50); + * describe('Current minute is displayed'); + * + *
                              + */ + _main.default.prototype.minute = function () { + return new Date().getMinutes(); + }; + /** + * Returns the number of milliseconds (thousandths of a second) since + * starting the sketch (when `setup()` is called). This information is often + * used for timing events and animation sequences. + * + * @method millis + * @return {Number} the number of milliseconds since starting the sketch + * @example + *
                              + * + * let millisecond = millis(); + * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); + * describe('number of milliseconds since sketch has started displayed'); + * + *
                              + */ + _main.default.prototype.millis = function () { + if (this._millisStart === - 1) { + // Sketch has not started + return 0; + } else { + return window.performance.now() - this._millisStart; + } + }; + /** + * p5.js communicates with the clock on your computer. The month() function + * returns the current month as a value from 1 - 12. + * + * @method month + * @return {Integer} the current month + * @example + *
                              + * + * let m = month(); + * text('Current month: \n' + m, 5, 50); + * describe('Current month is displayed'); + * + *
                              + */ + _main.default.prototype.month = function () { + //January is 0! + return new Date().getMonth() + 1; + }; + /** + * p5.js communicates with the clock on your computer. The second() function + * returns the current second as a value from 0 - 59. + * + * @method second + * @return {Integer} the current second + * @example + *
                              + * + * let s = second(); + * text('Current second: \n' + s, 5, 50); + * describe('Current second is displayed'); + * + *
                              + */ + _main.default.prototype.second = function () { + return new Date().getSeconds(); + }; + /** + * p5.js communicates with the clock on your computer. The year() function + * returns the current year as an integer (2014, 2015, 2016, etc). + * + * @method year + * @return {Integer} the current year + * @example + *
                              + * + * let y = year(); + * text('Current year: \n' + y, 5, 50); + * describe('Current year is displayed'); + * + *
                              + */ + _main.default.prototype.year = function () { + return new Date().getFullYear(); + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298 + } + ], + 341: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.math.sign'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.math.sign'); + _dereq_('core-js/modules/es.number.to-fixed'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + _dereq_('./p5.Geometry'); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Shape + * @submodule 3D Primitives + * @for p5 + * @requires core + * @requires p5.Geometry + */ + /** + * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added + * to the geometry and then returned when + * endGeometry() is called. One can also use + * buildGeometry() to pass a function that + * draws shapes. + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them upfront with `beginGeometry()` and `endGeometry()` and then + * drawing that will run faster than repeatedly drawing the individual pieces. + * + * @method beginGeometry + * + * @example + *
                              + * + * let shapes; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * makeShapes(); + * } + * + * function makeShapes() { + * beginGeometry(); + * scale(0.18); + * + * push(); + * translate(100, -50); + * scale(0.5); + * rotateX(PI/4); + * cone(); + * pop(); + * cone(); + * + * beginShape(); + * vertex(-20, -50); + * quadraticVertex( + * -40, -70, + * 0, -60 + * ); + * endShape(); + * + * beginShape(TRIANGLE_STRIP); + * for (let y = 20; y <= 60; y += 10) { + * for (let x of [20, 60]) { + * vertex(x, y); + * } + * } + * endShape(); + * + * beginShape(); + * vertex(-100, -120); + * vertex(-120, -110); + * vertex(-105, -100); + * endShape(); + * + * shapes = endGeometry(); + * } + * + * function draw() { + * background(255); + * lights(); + * orbitControl(); + * model(shapes); + * } + * + *
                              + * + * @alt + * A series of different flat, curved, and 3D shapes floating in space. + */ + + _main.default.prototype.beginGeometry = function () { + return this._renderer.beginGeometry(); + }; + /** + * Finishes creating a new p5.Geometry that was + * started using beginGeometry(). One can also + * use buildGeometry() to pass a function that + * draws shapes. + * + * @method endGeometry + * @returns {p5.Geometry} The model that was built. + */ + _main.default.prototype.endGeometry = function () { + return this._renderer.endGeometry(); + }; + /** + * Creates a new p5.Geometry that contains all + * the shapes drawn in a provided callback function. The returned combined shape + * can then be drawn all at once using model(). + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them with `buildGeometry()` once and then drawing that will run + * faster than repeatedly drawing the individual pieces. + * + * One can also draw shapes directly between + * beginGeometry() and + * endGeometry() instead of using a callback + * function. + * + * @method buildGeometry + * @param {Function} callback A function that draws shapes. + * @returns {p5.Geometry} The model that was built from the callback function. + * + * @example + *
                              + * + * let particles; + * let button; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * button = createButton('New'); + * button.mousePressed(makeParticles); + * makeParticles(); + * } + * + * function makeParticles() { + * if (particles) freeGeometry(particles); + * + * particles = buildGeometry(() => { + * for (let i = 0; i < 60; i++) { + * push(); + * translate( + * randomGaussian(0, 20), + * randomGaussian(0, 20), + * randomGaussian(0, 20) + * ); + * sphere(5); + * pop(); + * } + * }); + * } + * + * function draw() { + * background(255); + * noStroke(); + * lights(); + * orbitControl(); + * model(particles); + * } + * + *
                              + * + * @alt + * A cluster of spheres. + */ + _main.default.prototype.buildGeometry = function (callback) { + return this._renderer.buildGeometry(callback); + }; + /** + * Clears the resources of a model to free up browser memory. A model whose + * resources have been cleared can still be drawn, but the first time it is + * drawn again, it might take longer. + * + * This method works on models generated with + * buildGeometry() as well as those loaded + * from loadModel(). + * + * @method freeGeometry + * @param {p5.Geometry} geometry The geometry whose resources should be freed + */ + _main.default.prototype.freeGeometry = function (geometry) { + this._renderer._freeBuffers(geometry.gid); + }; + /** + * Draw a plane with given a width and height + * @method plane + * @param {Number} [width] width of the plane + * @param {Number} [height] height of the plane + * @param {Integer} [detailX] Optional number of triangle + * subdivisions in x-dimension + * @param {Integer} [detailY] Optional number of triangle + * subdivisions in y-dimension + * @chainable + * @example + *
                              + * + * // draw a plane + * // with width 50 and height 50 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white plane with black wireframe lines'); + * } + * + * function draw() { + * background(200); + * plane(50, 50); + * } + * + *
                              + * + * @alt + * Nothing displayed on canvas + * Rotating interior view of a box with sides that change color. + * 3d red and green gradient. + * Rotating interior view of a cylinder with sides that change color. + * Rotating view of a cylinder with sides that change color. + * 3d red and green gradient. + * rotating view of a multi-colored cylinder with concave sides. + */ + _main.default.prototype.plane = function (width, height, detailX, detailY) { + this._assert3d('plane'); + _main.default._validateParameters('plane', arguments); + if (typeof width === 'undefined') { + width = 50; + } + if (typeof height === 'undefined') { + height = width; + } + if (typeof detailX === 'undefined') { + detailX = 1; + } + if (typeof detailY === 'undefined') { + detailY = 1; + } + var gId = 'plane|'.concat(detailX, '|').concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _plane = function _plane() { + var u, + v, + p; + for (var i = 0; i <= this.detailY; i++) { + v = i / this.detailY; + for (var j = 0; j <= this.detailX; j++) { + u = j / this.detailX; + p = new _main.default.Vector(u - 0.5, v - 0.5, 0); + this.vertices.push(p); + this.uvs.push(u, v); + } + } + }; + var planeGeom = new _main.default.Geometry(detailX, detailY, _plane); + planeGeom.computeFaces().computeNormals(); + if (detailX <= 1 && detailY <= 1) { + planeGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log('Cannot draw stroke on plane objects with more' + ' than 1 detailX or 1 detailY'); + } + this._renderer.createBuffers(gId, planeGeom); + } + this._renderer.drawBuffersScaled(gId, width, height, 1); + return this; + }; + /** + * Draw a box with given width, height and depth + * @method box + * @param {Number} [width] width of the box + * @param {Number} [height] height of the box + * @param {Number} [depth] depth of the box + * @param {Integer} [detailX] Optional number of triangle + * subdivisions in x-dimension + * @param {Integer} [detailY] Optional number of triangle + * subdivisions in y-dimension + * @chainable + * @example + *
                              + * + * // draw a spinning box + * // with width, height and depth of 50 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white box rotating in 3D space'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(50); + * } + * + *
                              + */ + _main.default.prototype.box = function (width, height, depth, detailX, detailY) { + this._assert3d('box'); + _main.default._validateParameters('box', arguments); + if (typeof width === 'undefined') { + width = 50; + } + if (typeof height === 'undefined') { + height = width; + } + if (typeof depth === 'undefined') { + depth = height; + } + var perPixelLighting = this._renderer.attributes && this._renderer.attributes.perPixelLighting; + if (typeof detailX === 'undefined') { + detailX = perPixelLighting ? 1 : 4; + } + if (typeof detailY === 'undefined') { + detailY = perPixelLighting ? 1 : 4; + } + var gId = 'box|'.concat(detailX, '|').concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _box = function _box() { + var _this = this; + var cubeIndices = [ + [0, + 4, + 2, + 6], + // -1, 0, 0],// -x + [ + 1, + 3, + 5, + 7 + ], + // +1, 0, 0],// +x + [ + 0, + 1, + 4, + 5 + ], + // 0, -1, 0],// -y + [ + 2, + 6, + 3, + 7 + ], + // 0, +1, 0],// +y + [ + 0, + 2, + 1, + 3 + ], + // 0, 0, -1],// -z + [ + 4, + 5, + 6, + 7 + ] // 0, 0, +1] // +z + ]; + //using custom edges + //to avoid diagonal stroke lines across face of box + this.edges = [ + [0, + 1], + [ + 1, + 3 + ], + [ + 3, + 2 + ], + [ + 6, + 7 + ], + [ + 8, + 9 + ], + [ + 9, + 11 + ], + [ + 14, + 15 + ], + [ + 16, + 17 + ], + [ + 17, + 19 + ], + [ + 18, + 19 + ], + [ + 20, + 21 + ], + [ + 22, + 23 + ] + ]; + cubeIndices.forEach(function (cubeIndex, i) { + var v = i * 4; + for (var j = 0; j < 4; j++) { + var d = cubeIndex[j]; + //inspired by lightgl: + //https://github.com/evanw/lightgl.js + //octants:https://en.wikipedia.org/wiki/Octant_(solid_geometry) + var octant = new _main.default.Vector(((d & 1) * 2 - 1) / 2, ((d & 2) - 1) / 2, ((d & 4) / 2 - 1) / 2); + _this.vertices.push(octant); + _this.uvs.push(j & 1, (j & 2) / 2); + } + _this.faces.push([v, + v + 1, + v + 2]); + _this.faces.push([v + 2, + v + 1, + v + 3]); + }); + }; + var boxGeom = new _main.default.Geometry(detailX, detailY, _box); + boxGeom.computeNormals(); + if (detailX <= 4 && detailY <= 4) { + boxGeom._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log('Cannot draw stroke on box objects with more' + ' than 4 detailX or 4 detailY'); + } //initialize our geometry buffer with + //the key val pair: + //geometry Id, Geom object + + this._renderer.createBuffers(gId, boxGeom); + } + this._renderer.drawBuffersScaled(gId, width, height, depth); + return this; + }; + /** + * Draw a sphere with given radius. + * + * DetailX and detailY determines the number of subdivisions in the x-dimension + * and the y-dimension of a sphere. More subdivisions make the sphere seem + * smoother. The recommended maximum values are both 24. Using a value greater + * than 24 may cause a warning or slow down the browser. + * @method sphere + * @param {Number} [radius] radius of circle + * @param {Integer} [detailX] optional number of subdivisions in x-dimension + * @param {Integer} [detailY] optional number of subdivisions in y-dimension + * + * @chainable + * @example + *
                              + * + * // draw a sphere with radius 40 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white sphere with black wireframe lines'); + * } + * + * function draw() { + * background(205, 102, 94); + * sphere(40); + * } + * + *
                              + * + * @example + *
                              + * + * let detailX; + * // slide to see how detailX works + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 24, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * sphere(40, detailX.value(), 16); + * } + * + *
                              + * + * @example + *
                              + * + * let detailY; + * // slide to see how detailY works + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(3, 16, 3); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * sphere(40, 16, detailY.value()); + * } + * + *
                              + */ + _main.default.prototype.sphere = function (radius, detailX, detailY) { + this._assert3d('sphere'); + _main.default._validateParameters('sphere', arguments); + if (typeof radius === 'undefined') { + radius = 50; + } + if (typeof detailX === 'undefined') { + detailX = 24; + } + if (typeof detailY === 'undefined') { + detailY = 16; + } + this.ellipsoid(radius, radius, radius, detailX, detailY); + return this; + }; + /** + * @private + * Helper function for creating both cones and cylinders + * Will only generate well-defined geometry when bottomRadius, height > 0 + * and topRadius >= 0 + * If topRadius == 0, topCap should be false + */ + var _truncatedCone = function _truncatedCone(bottomRadius, topRadius, height, detailX, detailY, bottomCap, topCap) { + bottomRadius = bottomRadius <= 0 ? 1 : bottomRadius; + topRadius = topRadius < 0 ? 0 : topRadius; + height = height <= 0 ? bottomRadius : height; + detailX = detailX < 3 ? 3 : detailX; + detailY = detailY < 1 ? 1 : detailY; + bottomCap = bottomCap === undefined ? true : bottomCap; + topCap = topCap === undefined ? topRadius !== 0 : topCap; + var start = bottomCap ? - 2 : 0; + var end = detailY + (topCap ? 2 : 0); + //ensure constant slant for interior vertex normals + var slant = Math.atan2(bottomRadius - topRadius, height); + var sinSlant = Math.sin(slant); + var cosSlant = Math.cos(slant); + var yy, + ii, + jj; + for (yy = start; yy <= end; ++yy) { + var v = yy / detailY; + var y = height * v; + var ringRadius = void 0; + if (yy < 0) { + //for the bottomCap edge + y = 0; + v = 0; + ringRadius = bottomRadius; + } else if (yy > detailY) { + //for the topCap edge + y = height; + v = 1; + ringRadius = topRadius; + } else { + //for the middle + ringRadius = bottomRadius + (topRadius - bottomRadius) * v; + } + if (yy === - 2 || yy === detailY + 2) { + //center of bottom or top caps + ringRadius = 0; + } + y -= height / 2; //shift coordiate origin to the center of object + for (ii = 0; ii < detailX; ++ii) { + var u = ii / (detailX - 1); + var ur = 2 * Math.PI * u; + var sur = Math.sin(ur); + var cur = Math.cos(ur); + //VERTICES + this.vertices.push(new _main.default.Vector(sur * ringRadius, y, cur * ringRadius)); + //VERTEX NORMALS + var vertexNormal = void 0; + if (yy < 0) { + vertexNormal = new _main.default.Vector(0, - 1, 0); + } else if (yy > detailY && topRadius) { + vertexNormal = new _main.default.Vector(0, 1, 0); + } else { + vertexNormal = new _main.default.Vector(sur * cosSlant, sinSlant, cur * cosSlant); + } + this.vertexNormals.push(vertexNormal); + //UVs + this.uvs.push(u, v); + } + } + var startIndex = 0; + if (bottomCap) { + for (jj = 0; jj < detailX; ++jj) { + var nextjj = (jj + 1) % detailX; + this.faces.push([startIndex + jj, + startIndex + detailX + nextjj, + startIndex + detailX + jj]); + } + startIndex += detailX * 2; + } + for (yy = 0; yy < detailY; ++yy) { + for (ii = 0; ii < detailX; ++ii) { + var nextii = (ii + 1) % detailX; + this.faces.push([startIndex + ii, + startIndex + nextii, + startIndex + detailX + nextii]); + this.faces.push([startIndex + ii, + startIndex + detailX + nextii, + startIndex + detailX + ii]); + } + startIndex += detailX; + } + if (topCap) { + startIndex += detailX; + for (ii = 0; ii < detailX; ++ii) { + this.faces.push([startIndex + ii, + startIndex + (ii + 1) % detailX, + startIndex + detailX]); + } + } + }; + /** + * Draw a cylinder with given radius and height + * + * DetailX and detailY determines the number of subdivisions in the x-dimension + * and the y-dimension of a cylinder. More subdivisions make the cylinder seem smoother. + * The recommended maximum value for detailX is 24. Using a value greater than 24 + * may cause a warning or slow down the browser. + * + * @method cylinder + * @param {Number} [radius] radius of the surface + * @param {Number} [height] height of the cylinder + * @param {Integer} [detailX] number of subdivisions in x-dimension; + * default is 24 + * @param {Integer} [detailY] number of subdivisions in y-dimension; + * default is 1 + * @param {Boolean} [bottomCap] whether to draw the bottom of the cylinder + * @param {Boolean} [topCap] whether to draw the top of the cylinder + * @chainable + * @example + *
                              + * + * // draw a spinning cylinder + * // with radius 20 and height 50 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a rotating white cylinder'); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateX(frameCount * 0.01); + * rotateZ(frameCount * 0.01); + * cylinder(20, 50); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailX works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 24, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * cylinder(20, 75, detailX.value(), 1); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(1, 16, 1); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * cylinder(20, 75, 16, detailY.value()); + * } + * + *
                              + */ + _main.default.prototype.cylinder = function (radius, height, detailX, detailY, bottomCap, topCap) { + this._assert3d('cylinder'); + _main.default._validateParameters('cylinder', arguments); + if (typeof radius === 'undefined') { + radius = 50; + } + if (typeof height === 'undefined') { + height = radius; + } + if (typeof detailX === 'undefined') { + detailX = 24; + } + if (typeof detailY === 'undefined') { + detailY = 1; + } + if (typeof topCap === 'undefined') { + topCap = true; + } + if (typeof bottomCap === 'undefined') { + bottomCap = true; + } + var gId = 'cylinder|'.concat(detailX, '|').concat(detailY, '|').concat(bottomCap, '|').concat(topCap); + if (!this._renderer.geometryInHash(gId)) { + var cylinderGeom = new _main.default.Geometry(detailX, detailY); + _truncatedCone.call(cylinderGeom, 1, 1, 1, detailX, detailY, bottomCap, topCap); + // normals are computed in call to _truncatedCone + if (detailX <= 24 && detailY <= 16) { + cylinderGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log('Cannot draw stroke on cylinder objects with more' + ' than 24 detailX or 16 detailY'); + } + this._renderer.createBuffers(gId, cylinderGeom); + } + this._renderer.drawBuffersScaled(gId, radius, height, radius); + return this; + }; + /** + * Draw a cone with given radius and height + * + * DetailX and detailY determine the number of subdivisions in the x-dimension and + * the y-dimension of a cone. More subdivisions make the cone seem smoother. The + * recommended maximum value for detailX is 24. Using a value greater than 24 + * may cause a warning or slow down the browser. + * @method cone + * @param {Number} [radius] radius of the bottom surface + * @param {Number} [height] height of the cone + * @param {Integer} [detailX] number of segments, + * the more segments the smoother geometry + * default is 24 + * @param {Integer} [detailY] number of segments, + * the more segments the smoother geometry + * default is 1 + * @param {Boolean} [cap] whether to draw the base of the cone + * @chainable + * @example + *
                              + * + * // draw a spinning cone + * // with radius 40 and height 70 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a rotating white cone'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateZ(frameCount * 0.01); + * cone(40, 70); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailx works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 16, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * cone(30, 65, detailX.value(), 16); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(3, 16, 3); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * cone(30, 65, 16, detailY.value()); + * } + * + *
                              + */ + _main.default.prototype.cone = function (radius, height, detailX, detailY, cap) { + this._assert3d('cone'); + _main.default._validateParameters('cone', arguments); + if (typeof radius === 'undefined') { + radius = 50; + } + if (typeof height === 'undefined') { + height = radius; + } + if (typeof detailX === 'undefined') { + detailX = 24; + } + if (typeof detailY === 'undefined') { + detailY = 1; + } + if (typeof cap === 'undefined') { + cap = true; + } + var gId = 'cone|'.concat(detailX, '|').concat(detailY, '|').concat(cap); + if (!this._renderer.geometryInHash(gId)) { + var coneGeom = new _main.default.Geometry(detailX, detailY); + _truncatedCone.call(coneGeom, 1, 0, 1, detailX, detailY, cap, false); + if (detailX <= 24 && detailY <= 16) { + coneGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log('Cannot draw stroke on cone objects with more' + ' than 24 detailX or 16 detailY'); + } + this._renderer.createBuffers(gId, coneGeom); + } + this._renderer.drawBuffersScaled(gId, radius, height, radius); + return this; + }; + /** + * Draw an ellipsoid with given radius + * + * DetailX and detailY determine the number of subdivisions in the x-dimension and + * the y-dimension of a cone. More subdivisions make the ellipsoid appear to be smoother. + * Avoid detail number above 150, it may crash the browser. + * @method ellipsoid + * @param {Number} [radiusx] x-radius of ellipsoid + * @param {Number} [radiusy] y-radius of ellipsoid + * @param {Number} [radiusz] z-radius of ellipsoid + * @param {Integer} [detailX] number of segments, + * the more segments the smoother geometry + * default is 24. Avoid detail number above + * 150, it may crash the browser. + * @param {Integer} [detailY] number of segments, + * the more segments the smoother geometry + * default is 16. Avoid detail number above + * 150, it may crash the browser. + * @chainable + * @example + *
                              + * + * // draw an ellipsoid + * // with radius 30, 40 and 40. + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a white 3d ellipsoid'); + * } + * + * function draw() { + * background(205, 105, 94); + * ellipsoid(30, 40, 40); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailX works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(2, 24, 12); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 105, 94); + * rotateY(millis() / 1000); + * ellipsoid(30, 40, 40, detailX.value(), 8); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(2, 24, 6); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 105, 9); + * rotateY(millis() / 1000); + * ellipsoid(30, 40, 40, 12, detailY.value()); + * } + * + *
                              + */ + _main.default.prototype.ellipsoid = function (radiusX, radiusY, radiusZ, detailX, detailY) { + this._assert3d('ellipsoid'); + _main.default._validateParameters('ellipsoid', arguments); + if (typeof radiusX === 'undefined') { + radiusX = 50; + } + if (typeof radiusY === 'undefined') { + radiusY = radiusX; + } + if (typeof radiusZ === 'undefined') { + radiusZ = radiusX; + } + if (typeof detailX === 'undefined') { + detailX = 24; + } + if (typeof detailY === 'undefined') { + detailY = 16; + } + var gId = 'ellipsoid|'.concat(detailX, '|').concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _ellipsoid = function _ellipsoid() { + for (var i = 0; i <= this.detailY; i++) { + var v = i / this.detailY; + var phi = Math.PI * v - Math.PI / 2; + var cosPhi = Math.cos(phi); + var sinPhi = Math.sin(phi); + for (var j = 0; j <= this.detailX; j++) { + var u = j / this.detailX; + var theta = 2 * Math.PI * u; + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + var p = new _main.default.Vector(cosPhi * sinTheta, sinPhi, cosPhi * cosTheta); + this.vertices.push(p); + this.vertexNormals.push(p); + this.uvs.push(u, v); + } + } + }; + var ellipsoidGeom = new _main.default.Geometry(detailX, detailY, _ellipsoid); + ellipsoidGeom.computeFaces(); + if (detailX <= 24 && detailY <= 24) { + ellipsoidGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log('Cannot draw stroke on ellipsoids with more' + ' than 24 detailX or 24 detailY'); + } + this._renderer.createBuffers(gId, ellipsoidGeom); + } + this._renderer.drawBuffersScaled(gId, radiusX, radiusY, radiusZ); + return this; + }; + /** + * Draw a torus with given radius and tube radius + * + * DetailX and detailY determine the number of subdivisions in the x-dimension and + * the y-dimension of a torus. More subdivisions make the torus appear to be smoother. + * The default and maximum values for detailX and detailY are 24 and 16, respectively. + * Setting them to relatively small values like 4 and 6 allows you to create new + * shapes other than a torus. + * @method torus + * @param {Number} [radius] radius of the whole ring + * @param {Number} [tubeRadius] radius of the tube + * @param {Integer} [detailX] number of segments in x-dimension, + * the more segments the smoother geometry + * default is 24 + * @param {Integer} [detailY] number of segments in y-dimension, + * the more segments the smoother geometry + * default is 16 + * @chainable + * @example + *
                              + * + * // draw a spinning torus + * // with ring radius 30 and tube radius 15 + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a rotating white torus'); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * torus(30, 15); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailX works + * let detailX; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailX = createSlider(3, 24, 3); + * detailX.position(10, height + 5); + * detailX.style('width', '80px'); + * describe( + * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * torus(30, 15, detailX.value(), 12); + * } + * + *
                              + * + * @example + *
                              + * + * // slide to see how detailY works + * let detailY; + * function setup() { + * createCanvas(100, 100, WEBGL); + * detailY = createSlider(3, 16, 3); + * detailY.position(10, height + 5); + * detailY.style('width', '80px'); + * describe( + * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' + * ); + * } + * + * function draw() { + * background(205, 102, 94); + * rotateY(millis() / 1000); + * torus(30, 15, 16, detailY.value()); + * } + * + *
                              + */ + _main.default.prototype.torus = function (radius, tubeRadius, detailX, detailY) { + this._assert3d('torus'); + _main.default._validateParameters('torus', arguments); + if (typeof radius === 'undefined') { + radius = 50; + } else if (!radius) { + return; // nothing to draw + } + if (typeof tubeRadius === 'undefined') { + tubeRadius = 10; + } else if (!tubeRadius) { + return; // nothing to draw + } + if (typeof detailX === 'undefined') { + detailX = 24; + } + if (typeof detailY === 'undefined') { + detailY = 16; + } + var tubeRatio = (tubeRadius / radius).toPrecision(4); + var gId = 'torus|'.concat(tubeRatio, '|').concat(detailX, '|').concat(detailY); + if (!this._renderer.geometryInHash(gId)) { + var _torus = function _torus() { + for (var i = 0; i <= this.detailY; i++) { + var v = i / this.detailY; + var phi = 2 * Math.PI * v; + var cosPhi = Math.cos(phi); + var sinPhi = Math.sin(phi); + var r = 1 + tubeRatio * cosPhi; + for (var j = 0; j <= this.detailX; j++) { + var u = j / this.detailX; + var theta = 2 * Math.PI * u; + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + var p = new _main.default.Vector(r * cosTheta, r * sinTheta, tubeRatio * sinPhi); + var n = new _main.default.Vector(cosPhi * cosTheta, cosPhi * sinTheta, sinPhi); + this.vertices.push(p); + this.vertexNormals.push(n); + this.uvs.push(u, v); + } + } + }; + var torusGeom = new _main.default.Geometry(detailX, detailY, _torus); + torusGeom.computeFaces(); + if (detailX <= 24 && detailY <= 16) { + torusGeom._makeTriangleEdges()._edgesToVertices(); + } else if (this._renderer._doStroke) { + console.log('Cannot draw strokes on torus object with more' + ' than 24 detailX or 16 detailY'); + } + this._renderer.createBuffers(gId, torusGeom); + } + this._renderer.drawBuffersScaled(gId, radius, radius, radius); + return this; + }; + /////////////////////// + /// 2D primitives + ///////////////////////// + // + // Note: Documentation is not generated on the p5.js website for functions on + // the p5.RendererGL prototype. + /** + * Draws a point, a coordinate in space at the dimension of one pixel, + * given x, y and z coordinates. The color of the point is determined + * by the current stroke, while the point size is determined by current + * stroke weight. + * @private + * @param {Number} x x-coordinate of point + * @param {Number} y y-coordinate of point + * @param {Number} z z-coordinate of point + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(50); + * stroke(255); + * strokeWeight(4); + * point(25, 0); + * strokeWeight(3); + * point(-25, 0); + * strokeWeight(2); + * point(0, 25); + * strokeWeight(1); + * point(0, -25); + * } + * + *
                              + */ + _main.default.RendererGL.prototype.point = function (x, y, z) { + if (typeof z === 'undefined') { + z = 0; + } + var _vertex = [ + ]; + _vertex.push(new _main.default.Vector(x, y, z)); + this._drawPoints(_vertex, this.immediateMode.buffers.point); + return this; + }; + _main.default.RendererGL.prototype.triangle = function (args) { + var x1 = args[0], + y1 = args[1]; + var x2 = args[2], + y2 = args[3]; + var x3 = args[4], + y3 = args[5]; + var gId = 'tri'; + if (!this.geometryInHash(gId)) { + var _triangle = function _triangle() { + var vertices = [ + ]; + vertices.push(new _main.default.Vector(0, 0, 0)); + vertices.push(new _main.default.Vector(1, 0, 0)); + vertices.push(new _main.default.Vector(0, 1, 0)); + this.edges = [ + [0, + 1], + [ + 1, + 2 + ], + [ + 2, + 0 + ] + ]; + this.vertices = vertices; + this.faces = [ + [0, + 1, + 2] + ]; + this.uvs = [ + 0, + 0, + 1, + 0, + 1, + 1 + ]; + }; + var triGeom = new _main.default.Geometry(1, 1, _triangle); + triGeom._edgesToVertices(); + triGeom.computeNormals(); + this.createBuffers(gId, triGeom); + } // only one triangle is cached, one point is at the origin, and the + // two adjacent sides are tne unit vectors along the X & Y axes. + // + // this matrix multiplication transforms those two unit vectors + // onto the required vector prior to rendering, and moves the + // origin appropriately. + + var uMVMatrix = this.uMVMatrix.copy(); + try { + // triangle orientation. + var orientation = Math.sign(x1 * y2 - x2 * y1 + x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3); + var mult = new _main.default.Matrix([x2 - x1, + y2 - y1, + 0, + 0, + // the resulting unit X-axis + x3 - x1, + y3 - y1, + 0, + 0, + // the resulting unit Y-axis + 0, + 0, + orientation, + 0, + // the resulting unit Z-axis (Reflect the specified order of vertices) + x1, + y1, + 0, + 1 // the resulting origin + ]).mult(this.uMVMatrix); + this.uMVMatrix = mult; + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + return this; + }; + _main.default.RendererGL.prototype.ellipse = function (args) { + this.arc(args[0], args[1], args[2], args[3], 0, constants.TWO_PI, constants.OPEN, args[4]); + }; + _main.default.RendererGL.prototype.arc = function (args) { + var x = arguments[0]; + var y = arguments[1]; + var width = arguments[2]; + var height = arguments[3]; + var start = arguments[4]; + var stop = arguments[5]; + var mode = arguments[6]; + var detail = arguments[7] || 25; + var shape; + var gId; + // check if it is an ellipse or an arc + if (Math.abs(stop - start) >= constants.TWO_PI) { + shape = 'ellipse'; + gId = ''.concat(shape, '|').concat(detail, '|'); + } else { + shape = 'arc'; + gId = ''.concat(shape, '|').concat(start, '|').concat(stop, '|').concat(mode, '|').concat(detail, '|'); + } + if (!this.geometryInHash(gId)) { + var _arc = function _arc() { + // if the start and stop angles are not the same, push vertices to the array + if (start.toFixed(10) !== stop.toFixed(10)) { + // if the mode specified is PIE or null, push the mid point of the arc in vertices + if (mode === constants.PIE || typeof mode === 'undefined') { + this.vertices.push(new _main.default.Vector(0.5, 0.5, 0)); + this.uvs.push([0.5, + 0.5]); + } // vertices for the perimeter of the circle + + for (var i = 0; i <= detail; i++) { + var u = i / detail; + var theta = (stop - start) * u + start; + var _x = 0.5 + Math.cos(theta) / 2; + var _y = 0.5 + Math.sin(theta) / 2; + this.vertices.push(new _main.default.Vector(_x, _y, 0)); + this.uvs.push([_x, + _y]); + if (i < detail - 1) { + this.faces.push([0, + i + 1, + i + 2]); + this.edges.push([i + 1, + i + 2]); + } + } // check the mode specified in order to push vertices and faces, different for each mode + + switch (mode) { + case constants.PIE: + this.faces.push([0, + this.vertices.length - 2, + this.vertices.length - 1]); + this.edges.push([0, + 1]); + this.edges.push([this.vertices.length - 2, + this.vertices.length - 1]); + this.edges.push([0, + this.vertices.length - 1]); + break; + case constants.CHORD: + this.edges.push([0, + 1]); + this.edges.push([0, + this.vertices.length - 1]); + break; + case constants.OPEN: + this.edges.push([0, + 1]); + break; + default: + this.faces.push([0, + this.vertices.length - 2, + this.vertices.length - 1]); + this.edges.push([this.vertices.length - 2, + this.vertices.length - 1]); + } + } + }; + var arcGeom = new _main.default.Geometry(detail, 1, _arc); + arcGeom.computeNormals(); + if (detail <= 50) { + arcGeom._edgesToVertices(arcGeom); + } else if (this._doStroke) { + console.log('Cannot apply a stroke to an '.concat(shape, ' with more than 50 detail')); + } + this.createBuffers(gId, arcGeom); + } + var uMVMatrix = this.uMVMatrix.copy(); + try { + this.uMVMatrix.translate([x, + y, + 0]); + this.uMVMatrix.scale(width, height, 1); + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + return this; + }; + _main.default.RendererGL.prototype.rect = function (args) { + var x = args[0]; + var y = args[1]; + var width = args[2]; + var height = args[3]; + if (typeof args[4] === 'undefined') { + // Use the retained mode for drawing rectangle, + // if args for rounding rectangle is not provided by user. + var perPixelLighting = this._pInst._glAttributes.perPixelLighting; + var detailX = args[4] || (perPixelLighting ? 1 : 24); + var detailY = args[5] || (perPixelLighting ? 1 : 16); + var gId = 'rect|'.concat(detailX, '|').concat(detailY); + if (!this.geometryInHash(gId)) { + var _rect = function _rect() { + for (var i = 0; i <= this.detailY; i++) { + var v = i / this.detailY; + for (var j = 0; j <= this.detailX; j++) { + var u = j / this.detailX; + var p = new _main.default.Vector(u, v, 0); + this.vertices.push(p); + this.uvs.push(u, v); + } + } // using stroke indices to avoid stroke over face(s) of rectangle + + if (detailX > 0 && detailY > 0) { + this.edges = [ + [0, + detailX], + [ + detailX, + (detailX + 1) * (detailY + 1) - 1 + ], + [ + (detailX + 1) * (detailY + 1) - 1, + (detailX + 1) * detailY + ], + [ + (detailX + 1) * detailY, + 0 + ] + ]; + } + }; + var rectGeom = new _main.default.Geometry(detailX, detailY, _rect); + rectGeom.computeFaces().computeNormals()._edgesToVertices(); + this.createBuffers(gId, rectGeom); + } // only a single rectangle (of a given detail) is cached: a square with + // opposite corners at (0,0) & (1,1). + // + // before rendering, this square is scaled & moved to the required location. + + var uMVMatrix = this.uMVMatrix.copy(); + try { + this.uMVMatrix.translate([x, + y, + 0]); + this.uMVMatrix.scale(width, height, 1); + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + } else { + // Use Immediate mode to round the rectangle corner, + // if args for rounding corners is provided by user + var tl = args[4]; + var tr = typeof args[5] === 'undefined' ? tl : args[5]; + var br = typeof args[6] === 'undefined' ? tr : args[6]; + var bl = typeof args[7] === 'undefined' ? br : args[7]; + var a = x; + var b = y; + var c = width; + var d = height; + c += a; + d += b; + if (a > c) { + var temp = a; + a = c; + c = temp; + } + if (b > d) { + var _temp = b; + b = d; + d = _temp; + } + var maxRounding = Math.min((c - a) / 2, (d - b) / 2); + if (tl > maxRounding) tl = maxRounding; + if (tr > maxRounding) tr = maxRounding; + if (br > maxRounding) br = maxRounding; + if (bl > maxRounding) bl = maxRounding; + var x1 = a; + var y1 = b; + var x2 = c; + var y2 = d; + this.beginShape(); + if (tr !== 0) { + this.vertex(x2 - tr, y1); + this.quadraticVertex(x2, y1, x2, y1 + tr); + } else { + this.vertex(x2, y1); + } + if (br !== 0) { + this.vertex(x2, y2 - br); + this.quadraticVertex(x2, y2, x2 - br, y2); + } else { + this.vertex(x2, y2); + } + if (bl !== 0) { + this.vertex(x1 + bl, y2); + this.quadraticVertex(x1, y2, x1, y2 - bl); + } else { + this.vertex(x1, y2); + } + if (tl !== 0) { + this.vertex(x1, y1 + tl); + this.quadraticVertex(x1, y1, x1 + tl, y1); + } else { + this.vertex(x1, y1); + } + this.immediateMode.geometry.uvs.length = 0; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this.immediateMode.geometry.vertices[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var vert = _step.value; + var u = (vert.x - x1) / width; + var v = (vert.y - y1) / height; + this.immediateMode.geometry.uvs.push(u, v); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + this.endShape(constants.CLOSE); + } + return this; + }; + /* eslint-disable max-len */ + _main.default.RendererGL.prototype.quad = function (x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, detailX, detailY) { + /* eslint-enable max-len */ + if (typeof detailX === 'undefined') { + detailX = 2; + } + if (typeof detailY === 'undefined') { + detailY = 2; + } + var gId = 'quad|'.concat(x1, '|').concat(y1, '|').concat(z1, '|').concat(x2, '|').concat(y2, '|').concat(z2, '|').concat(x3, '|').concat(y3, '|').concat(z3, '|').concat(x4, '|').concat(y4, '|').concat(z4, '|').concat(detailX, '|').concat(detailY); + if (!this.geometryInHash(gId)) { + var quadGeom = new _main.default.Geometry(detailX, detailY, function () { + //algorithm adapted from c++ to js + //https://stackoverflow.com/questions/16989181/whats-the-correct-way-to-draw-a-distorted-plane-in-opengl/16993202#16993202 + var xRes = 1 / (this.detailX - 1); + var yRes = 1 / (this.detailY - 1); + for (var y = 0; y < this.detailY; y++) { + for (var x = 0; x < this.detailX; x++) { + var pctx = x * xRes; + var pcty = y * yRes; + var linePt0x = (1 - pcty) * x1 + pcty * x4; + var linePt0y = (1 - pcty) * y1 + pcty * y4; + var linePt0z = (1 - pcty) * z1 + pcty * z4; + var linePt1x = (1 - pcty) * x2 + pcty * x3; + var linePt1y = (1 - pcty) * y2 + pcty * y3; + var linePt1z = (1 - pcty) * z2 + pcty * z3; + var ptx = (1 - pctx) * linePt0x + pctx * linePt1x; + var pty = (1 - pctx) * linePt0y + pctx * linePt1y; + var ptz = (1 - pctx) * linePt0z + pctx * linePt1z; + this.vertices.push(new _main.default.Vector(ptx, pty, ptz)); + this.uvs.push([pctx, + pcty]); + } + } + }); + quadGeom.faces = [ + ]; + for (var y = 0; y < detailY - 1; y++) { + for (var x = 0; x < detailX - 1; x++) { + var pt0 = x + y * detailX; + var pt1 = x + 1 + y * detailX; + var pt2 = x + 1 + (y + 1) * detailX; + var pt3 = x + (y + 1) * detailX; + quadGeom.faces.push([pt0, + pt1, + pt2]); + quadGeom.faces.push([pt0, + pt2, + pt3]); + } + } + quadGeom.computeNormals(); + quadGeom.edges.length = 0; + var vertexOrder = [ + 0, + 2, + 3, + 1 + ]; + for (var i = 0; i < vertexOrder.length; i++) { + var startVertex = vertexOrder[i]; + var endVertex = vertexOrder[(i + 1) % vertexOrder.length]; + quadGeom.edges.push([startVertex, + endVertex]); + } + quadGeom._edgesToVertices(); + this.createBuffers(gId, quadGeom); + } + this.drawBuffers(gId); + return this; + }; + //this implementation of bezier curve + //is based on Bernstein polynomial + // pretier-ignore + _main.default.RendererGL.prototype.bezier = function (x1, y1, z1, // x2 + x2, // y2 + y2, // x3 + z2, // y3 + x3, // x4 + y3, // y4 + z3, x4, y4, z4) { + if (arguments.length === 8) { + y4 = y3; + x4 = x3; + y3 = z2; + x3 = y2; + y2 = x2; + x2 = z1; + z1 = z2 = z3 = z4 = 0; + } + var bezierDetail = this._pInst._bezierDetail || 20; //value of Bezier detail + this.beginShape(); + for (var i = 0; i <= bezierDetail; i++) { + var c1 = Math.pow(1 - i / bezierDetail, 3); + var c2 = 3 * (i / bezierDetail) * Math.pow(1 - i / bezierDetail, 2); + var c3 = 3 * Math.pow(i / bezierDetail, 2) * (1 - i / bezierDetail); + var c4 = Math.pow(i / bezierDetail, 3); + this.vertex(x1 * c1 + x2 * c2 + x3 * c3 + x4 * c4, y1 * c1 + y2 * c2 + y3 * c3 + y4 * c4, z1 * c1 + z2 * c2 + z3 * c3 + z4 * c4); + } + this.endShape(); + return this; + }; + // pretier-ignore + _main.default.RendererGL.prototype.curve = function (x1, y1, z1, // x2 + x2, // y2 + y2, // x3 + z2, // y3 + x3, // x4 + y3, // y4 + z3, x4, y4, z4) { + if (arguments.length === 8) { + x4 = x3; + y4 = y3; + x3 = y2; + y3 = x2; + x2 = z1; + y2 = x2; + z1 = z2 = z3 = z4 = 0; + } + var curveDetail = this._pInst._curveDetail; + this.beginShape(); + for (var i = 0; i <= curveDetail; i++) { + var c1 = Math.pow(i / curveDetail, 3) * 0.5; + var c2 = Math.pow(i / curveDetail, 2) * 0.5; + var c3 = i / curveDetail * 0.5; + var c4 = 0.5; + var vx = c1 * ( - x1 + 3 * x2 - 3 * x3 + x4) + c2 * (2 * x1 - 5 * x2 + 4 * x3 - x4) + c3 * ( - x1 + x3) + c4 * (2 * x2); + var vy = c1 * ( - y1 + 3 * y2 - 3 * y3 + y4) + c2 * (2 * y1 - 5 * y2 + 4 * y3 - y4) + c3 * ( - y1 + y3) + c4 * (2 * y2); + var vz = c1 * ( - z1 + 3 * z2 - 3 * z3 + z4) + c2 * (2 * z1 - 5 * z2 + 4 * z3 - z4) + c3 * ( - z1 + z3) + c4 * (2 * z2); + this.vertex(vx, vy, vz); + } + this.endShape(); + return this; + }; + /** + * Draw a line given two points + * @private + * @param {Number} x0 x-coordinate of first vertex + * @param {Number} y0 y-coordinate of first vertex + * @param {Number} z0 z-coordinate of first vertex + * @param {Number} x1 x-coordinate of second vertex + * @param {Number} y1 y-coordinate of second vertex + * @param {Number} z1 z-coordinate of second vertex + * @chainable + * @example + *
                              + * + * //draw a line + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * // Use fill instead of stroke to change the color of shape. + * fill(255, 0, 0); + * line(10, 10, 0, 60, 60, 20); + * } + * + *
                              + */ + _main.default.RendererGL.prototype.line = function () { + if (arguments.length === 6) { + this.beginShape(constants.LINES); + this.vertex(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], arguments.length <= 2 ? undefined : arguments[2]); + this.vertex(arguments.length <= 3 ? undefined : arguments[3], arguments.length <= 4 ? undefined : arguments[4], arguments.length <= 5 ? undefined : arguments[5]); + this.endShape(); + } else if (arguments.length === 4) { + this.beginShape(constants.LINES); + this.vertex(arguments.length <= 0 ? undefined : arguments[0], arguments.length <= 1 ? undefined : arguments[1], 0); + this.vertex(arguments.length <= 2 ? undefined : arguments[2], arguments.length <= 3 ? undefined : arguments[3], 0); + this.endShape(); + } + return this; + }; + _main.default.RendererGL.prototype.bezierVertex = function () { + if (this.immediateMode._bezierVertex.length === 0) { + throw Error('vertex() must be used once before calling bezierVertex()'); + } else { + var w_x = [ + ]; + var w_y = [ + ]; + var w_z = [ + ]; + var t, + _x, + _y, + _z, + i, + k, + m; + // variable i for bezierPoints, k for components, and m for anchor points. + var argLength = arguments.length; + t = 0; + if (this._lookUpTableBezier.length === 0 || this._lutBezierDetail !== this._pInst._curveDetail) { + this._lookUpTableBezier = [ + ]; + this._lutBezierDetail = this._pInst._curveDetail; + var step = 1 / this._lutBezierDetail; + var start = 0; + var end = 1; + var j = 0; + while (start < 1) { + t = parseFloat(start.toFixed(6)); + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + if (end.toFixed(6) === step.toFixed(6)) { + t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); + ++j; + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + break; + } + start += step; + end -= step; + ++j; + } + } + var LUTLength = this._lookUpTableBezier.length; + // fillColors[0]: start point color + // fillColors[1],[2]: control point color + // fillColors[3]: end point color + var fillColors = [ + ]; + for (m = 0; m < 4; m++) { + fillColors.push([]); + } + fillColors[0] = this.immediateMode.geometry.vertexColors.slice( - 4); + fillColors[3] = this.curFillColor.slice(); + // Do the same for strokeColor. + var strokeColors = [ + ]; + for (m = 0; m < 4; m++) { + strokeColors.push([]); + } + strokeColors[0] = this.immediateMode.geometry.vertexStrokeColors.slice( - 4); + strokeColors[3] = this.curStrokeColor.slice(); + if (argLength === 6) { + this.isBezier = true; + w_x = [ + this.immediateMode._bezierVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 4 ? undefined : arguments[4] + ]; + w_y = [ + this.immediateMode._bezierVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 3 ? undefined : arguments[3], + arguments.length <= 5 ? undefined : arguments[5] + ]; + // The ratio of the distance between the start point, the two control- + // points, and the end point determines the intermediate color. + var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); + var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); + var d2 = Math.hypot(w_x[2] - w_x[3], w_y[2] - w_y[3]); + var totalLength = d0 + d1 + d2; + d0 /= totalLength; + d2 /= totalLength; + for (k = 0; k < 4; k++) { + fillColors[1].push(fillColors[0][k] * (1 - d0) + fillColors[3][k] * d0); + fillColors[2].push(fillColors[0][k] * d2 + fillColors[3][k] * (1 - d2)); + strokeColors[1].push(strokeColors[0][k] * (1 - d0) + strokeColors[3][k] * d0); + strokeColors[2].push(strokeColors[0][k] * d2 + strokeColors[3][k] * (1 - d2)); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [ + 0, + 0, + 0, + 0 + ]; + this.curStrokeColor = [ + 0, + 0, + 0, + 0 + ]; + _x = _y = 0; + for (m = 0; m < 4; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += this._lookUpTableBezier[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += this._lookUpTableBezier[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableBezier[i][m]; + _y += w_y[m] * this._lookUpTableBezier[i][m]; + } + this.vertex(_x, _y); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[3]; + this.curStrokeColor = strokeColors[3]; + this.immediateMode._bezierVertex[0] = arguments.length <= 4 ? undefined : arguments[4]; + this.immediateMode._bezierVertex[1] = arguments.length <= 5 ? undefined : arguments[5]; + } else if (argLength === 9) { + this.isBezier = true; + w_x = [ + this.immediateMode._bezierVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 3 ? undefined : arguments[3], + arguments.length <= 6 ? undefined : arguments[6] + ]; + w_y = [ + this.immediateMode._bezierVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 4 ? undefined : arguments[4], + arguments.length <= 7 ? undefined : arguments[7] + ]; + w_z = [ + this.immediateMode._bezierVertex[2], + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 5 ? undefined : arguments[5], + arguments.length <= 8 ? undefined : arguments[8] + ]; + // The ratio of the distance between the start point, the two control- + // points, and the end point determines the intermediate color. + var _d = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1], w_z[0] - w_z[1]); + var _d2 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2], w_z[1] - w_z[2]); + var _d3 = Math.hypot(w_x[2] - w_x[3], w_y[2] - w_y[3], w_z[2] - w_z[3]); + var _totalLength = _d + _d2 + _d3; + _d /= _totalLength; + _d3 /= _totalLength; + for (k = 0; k < 4; k++) { + fillColors[1].push(fillColors[0][k] * (1 - _d) + fillColors[3][k] * _d); + fillColors[2].push(fillColors[0][k] * _d3 + fillColors[3][k] * (1 - _d3)); + strokeColors[1].push(strokeColors[0][k] * (1 - _d) + strokeColors[3][k] * _d); + strokeColors[2].push(strokeColors[0][k] * _d3 + strokeColors[3][k] * (1 - _d3)); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [ + 0, + 0, + 0, + 0 + ]; + this.curStrokeColor = [ + 0, + 0, + 0, + 0 + ]; + _x = _y = _z = 0; + for (m = 0; m < 4; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += this._lookUpTableBezier[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += this._lookUpTableBezier[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableBezier[i][m]; + _y += w_y[m] * this._lookUpTableBezier[i][m]; + _z += w_z[m] * this._lookUpTableBezier[i][m]; + } + this.vertex(_x, _y, _z); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[3]; + this.curStrokeColor = strokeColors[3]; + this.immediateMode._bezierVertex[0] = arguments.length <= 6 ? undefined : arguments[6]; + this.immediateMode._bezierVertex[1] = arguments.length <= 7 ? undefined : arguments[7]; + this.immediateMode._bezierVertex[2] = arguments.length <= 8 ? undefined : arguments[8]; + } + } + }; + _main.default.RendererGL.prototype.quadraticVertex = function () { + if (this.immediateMode._quadraticVertex.length === 0) { + throw Error('vertex() must be used once before calling quadraticVertex()'); + } else { + var w_x = [ + ]; + var w_y = [ + ]; + var w_z = [ + ]; + var t, + _x, + _y, + _z, + i, + k, + m; + // variable i for bezierPoints, k for components, and m for anchor points. + var argLength = arguments.length; + t = 0; + if (this._lookUpTableQuadratic.length === 0 || this._lutQuadraticDetail !== this._pInst._curveDetail) { + this._lookUpTableQuadratic = [ + ]; + this._lutQuadraticDetail = this._pInst._curveDetail; + var step = 1 / this._lutQuadraticDetail; + var start = 0; + var end = 1; + var j = 0; + while (start < 1) { + t = parseFloat(start.toFixed(6)); + this._lookUpTableQuadratic[j] = this._quadraticCoefficients(t); + if (end.toFixed(6) === step.toFixed(6)) { + t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); + ++j; + this._lookUpTableQuadratic[j] = this._quadraticCoefficients(t); + break; + } + start += step; + end -= step; + ++j; + } + } + var LUTLength = this._lookUpTableQuadratic.length; + // fillColors[0]: start point color + // fillColors[1]: control point color + // fillColors[2]: end point color + var fillColors = [ + ]; + for (m = 0; m < 3; m++) { + fillColors.push([]); + } + fillColors[0] = this.immediateMode.geometry.vertexColors.slice( - 4); + fillColors[2] = this.curFillColor.slice(); + // Do the same for strokeColor. + var strokeColors = [ + ]; + for (m = 0; m < 3; m++) { + strokeColors.push([]); + } + strokeColors[0] = this.immediateMode.geometry.vertexStrokeColors.slice( - 4); + strokeColors[2] = this.curStrokeColor.slice(); + if (argLength === 4) { + this.isQuadratic = true; + w_x = [ + this.immediateMode._quadraticVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 2 ? undefined : arguments[2] + ]; + w_y = [ + this.immediateMode._quadraticVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 3 ? undefined : arguments[3] + ]; + // The ratio of the distance between the start point, the control- + // point, and the end point determines the intermediate color. + var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); + var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); + var totalLength = d0 + d1; + d0 /= totalLength; + for (k = 0; k < 4; k++) { + fillColors[1].push(fillColors[0][k] * (1 - d0) + fillColors[2][k] * d0); + strokeColors[1].push(strokeColors[0][k] * (1 - d0) + strokeColors[2][k] * d0); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [ + 0, + 0, + 0, + 0 + ]; + this.curStrokeColor = [ + 0, + 0, + 0, + 0 + ]; + _x = _y = 0; + for (m = 0; m < 3; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += this._lookUpTableQuadratic[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableQuadratic[i][m]; + _y += w_y[m] * this._lookUpTableQuadratic[i][m]; + } + this.vertex(_x, _y); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[2]; + this.curStrokeColor = strokeColors[2]; + this.immediateMode._quadraticVertex[0] = arguments.length <= 2 ? undefined : arguments[2]; + this.immediateMode._quadraticVertex[1] = arguments.length <= 3 ? undefined : arguments[3]; + } else if (argLength === 6) { + this.isQuadratic = true; + w_x = [ + this.immediateMode._quadraticVertex[0], + arguments.length <= 0 ? undefined : arguments[0], + arguments.length <= 3 ? undefined : arguments[3] + ]; + w_y = [ + this.immediateMode._quadraticVertex[1], + arguments.length <= 1 ? undefined : arguments[1], + arguments.length <= 4 ? undefined : arguments[4] + ]; + w_z = [ + this.immediateMode._quadraticVertex[2], + arguments.length <= 2 ? undefined : arguments[2], + arguments.length <= 5 ? undefined : arguments[5] + ]; + // The ratio of the distance between the start point, the control- + // point, and the end point determines the intermediate color. + var _d4 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1], w_z[0] - w_z[1]); + var _d5 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2], w_z[1] - w_z[2]); + var _totalLength2 = _d4 + _d5; + _d4 /= _totalLength2; + for (k = 0; k < 4; k++) { + fillColors[1].push(fillColors[0][k] * (1 - _d4) + fillColors[2][k] * _d4); + strokeColors[1].push(strokeColors[0][k] * (1 - _d4) + strokeColors[2][k] * _d4); + } + for (i = 0; i < LUTLength; i++) { + // Interpolate colors using control points + this.curFillColor = [ + 0, + 0, + 0, + 0 + ]; + this.curStrokeColor = [ + 0, + 0, + 0, + 0 + ]; + _x = _y = _z = 0; + for (m = 0; m < 3; m++) { + for (k = 0; k < 4; k++) { + this.curFillColor[k] += this._lookUpTableQuadratic[i][m] * fillColors[m][k]; + this.curStrokeColor[k] += this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; + } + _x += w_x[m] * this._lookUpTableQuadratic[i][m]; + _y += w_y[m] * this._lookUpTableQuadratic[i][m]; + _z += w_z[m] * this._lookUpTableQuadratic[i][m]; + } + this.vertex(_x, _y, _z); + } // so that we leave currentColor with the last value the user set it to + + this.curFillColor = fillColors[2]; + this.curStrokeColor = strokeColors[2]; + this.immediateMode._quadraticVertex[0] = arguments.length <= 3 ? undefined : arguments[3]; + this.immediateMode._quadraticVertex[1] = arguments.length <= 4 ? undefined : arguments[4]; + this.immediateMode._quadraticVertex[2] = arguments.length <= 5 ? undefined : arguments[5]; + } + } + }; + _main.default.RendererGL.prototype.curveVertex = function () { + var w_x = [ + ]; + var w_y = [ + ]; + var w_z = [ + ]; + var t, + _x, + _y, + _z, + i; + t = 0; + var argLength = arguments.length; + if (this._lookUpTableBezier.length === 0 || this._lutBezierDetail !== this._pInst._curveDetail) { + this._lookUpTableBezier = [ + ]; + this._lutBezierDetail = this._pInst._curveDetail; + var step = 1 / this._lutBezierDetail; + var start = 0; + var end = 1; + var j = 0; + while (start < 1) { + t = parseFloat(start.toFixed(6)); + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + if (end.toFixed(6) === step.toFixed(6)) { + t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); + ++j; + this._lookUpTableBezier[j] = this._bezierCoefficients(t); + break; + } + start += step; + end -= step; + ++j; + } + } + var LUTLength = this._lookUpTableBezier.length; + if (argLength === 2) { + this.immediateMode._curveVertex.push(arguments.length <= 0 ? undefined : arguments[0]); + this.immediateMode._curveVertex.push(arguments.length <= 1 ? undefined : arguments[1]); + if (this.immediateMode._curveVertex.length === 8) { + this.isCurve = true; + w_x = this._bezierToCatmull([this.immediateMode._curveVertex[0], + this.immediateMode._curveVertex[2], + this.immediateMode._curveVertex[4], + this.immediateMode._curveVertex[6]]); + w_y = this._bezierToCatmull([this.immediateMode._curveVertex[1], + this.immediateMode._curveVertex[3], + this.immediateMode._curveVertex[5], + this.immediateMode._curveVertex[7]]); + for (i = 0; i < LUTLength; i++) { + _x = w_x[0] * this._lookUpTableBezier[i][0] + w_x[1] * this._lookUpTableBezier[i][1] + w_x[2] * this._lookUpTableBezier[i][2] + w_x[3] * this._lookUpTableBezier[i][3]; + _y = w_y[0] * this._lookUpTableBezier[i][0] + w_y[1] * this._lookUpTableBezier[i][1] + w_y[2] * this._lookUpTableBezier[i][2] + w_y[3] * this._lookUpTableBezier[i][3]; + this.vertex(_x, _y); + } + for (i = 0; i < argLength; i++) { + this.immediateMode._curveVertex.shift(); + } + } + } else if (argLength === 3) { + this.immediateMode._curveVertex.push(arguments.length <= 0 ? undefined : arguments[0]); + this.immediateMode._curveVertex.push(arguments.length <= 1 ? undefined : arguments[1]); + this.immediateMode._curveVertex.push(arguments.length <= 2 ? undefined : arguments[2]); + if (this.immediateMode._curveVertex.length === 12) { + this.isCurve = true; + w_x = this._bezierToCatmull([this.immediateMode._curveVertex[0], + this.immediateMode._curveVertex[3], + this.immediateMode._curveVertex[6], + this.immediateMode._curveVertex[9]]); + w_y = this._bezierToCatmull([this.immediateMode._curveVertex[1], + this.immediateMode._curveVertex[4], + this.immediateMode._curveVertex[7], + this.immediateMode._curveVertex[10]]); + w_z = this._bezierToCatmull([this.immediateMode._curveVertex[2], + this.immediateMode._curveVertex[5], + this.immediateMode._curveVertex[8], + this.immediateMode._curveVertex[11]]); + for (i = 0; i < LUTLength; i++) { + _x = w_x[0] * this._lookUpTableBezier[i][0] + w_x[1] * this._lookUpTableBezier[i][1] + w_x[2] * this._lookUpTableBezier[i][2] + w_x[3] * this._lookUpTableBezier[i][3]; + _y = w_y[0] * this._lookUpTableBezier[i][0] + w_y[1] * this._lookUpTableBezier[i][1] + w_y[2] * this._lookUpTableBezier[i][2] + w_y[3] * this._lookUpTableBezier[i][3]; + _z = w_z[0] * this._lookUpTableBezier[i][0] + w_z[1] * this._lookUpTableBezier[i][1] + w_z[2] * this._lookUpTableBezier[i][2] + w_z[3] * this._lookUpTableBezier[i][3]; + this.vertex(_x, _y, _z); + } + for (i = 0; i < argLength; i++) { + this.immediateMode._curveVertex.shift(); + } + } + } + }; + _main.default.RendererGL.prototype.image = function (img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) { + if (this._isErasing) { + this.blendMode(this._cachedBlendMode); + } + this._pInst.push(); + this._pInst.noLights(); + this._pInst.noStroke(); + this._pInst.texture(img); + this._pInst.textureMode(constants.NORMAL); + var u0 = 0; + if (sx <= img.width) { + u0 = sx / img.width; + } + var u1 = 1; + if (sx + sWidth <= img.width) { + u1 = (sx + sWidth) / img.width; + } + var v0 = 0; + if (sy <= img.height) { + v0 = sy / img.height; + } + var v1 = 1; + if (sy + sHeight <= img.height) { + v1 = (sy + sHeight) / img.height; + } + this.beginShape(); + this.vertex(dx, dy, 0, u0, v0); + this.vertex(dx + dWidth, dy, 0, u1, v0); + this.vertex(dx + dWidth, dy + dHeight, 0, u1, v1); + this.vertex(dx, dy + dHeight, 0, u0, v1); + this.endShape(constants.CLOSE); + this._pInst.pop(); + if (this._isErasing) { + this.blendMode(constants.REMOVE); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.Geometry': 350, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.math.hypot': 188, + 'core-js/modules/es.math.sign': 190, + 'core-js/modules/es.number.to-fixed': 193, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 342: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.object.assign'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @private + * A class responsible for converting successive WebGL draw calls into a single + * `p5.Geometry` that can be reused and drawn with `model()`. + */ + + var GeometryBuilder = /*#__PURE__*/ function () { + function GeometryBuilder(renderer) { + _classCallCheck(this, GeometryBuilder); + this.renderer = renderer; + renderer._pInst.push(); + this.identityMatrix = new _main.default.Matrix(); + renderer.uMVMatrix = new _main.default.Matrix(); + this.geometry = new _main.default.Geometry(); + this.geometry.gid = '_p5_GeometryBuilder_'.concat(GeometryBuilder.nextGeometryId); + GeometryBuilder.nextGeometryId++; + this.hasTransform = false; + } /** + * @private + * Applies the current transformation matrix to each vertex. + */ + + _createClass(GeometryBuilder, [ + { + key: 'transformVertices', + value: function transformVertices(vertices) { + var _this = this; + if (!this.hasTransform) return vertices; + return vertices.map(function (v) { + return _this.renderer.uMVMatrix.multiplyPoint(v); + }); + } /** + * @private + * Applies the current normal matrix to each normal. + */ + + }, + { + key: 'transformNormals', + value: function transformNormals(normals) { + var _this2 = this; + if (!this.hasTransform) return normals; + return normals.map(function (v) { + return _this2.renderer.uNMatrix.multiplyVec3(v); + }); + } /** + * @private + * Adds a p5.Geometry to the builder's combined geometry, flattening + * transformations. + */ + + }, + { + key: 'addGeometry', + value: function addGeometry(input) { + var _this3 = this, + _this$geometry$vertic, + _this$geometry$vertex, + _this$geometry$uvs, + _this$geometry$vertex2; + this.hasTransform = !this.renderer.uMVMatrix.mat4.every(function (v, i) { + return v === _this3.identityMatrix.mat4[i]; + }); + if (this.hasTransform) { + this.renderer.uNMatrix.inverseTranspose(this.renderer.uMVMatrix); + } + var startIdx = this.geometry.vertices.length; + (_this$geometry$vertic = this.geometry.vertices).push.apply(_this$geometry$vertic, _toConsumableArray(this.transformVertices(input.vertices))); + (_this$geometry$vertex = this.geometry.vertexNormals).push.apply(_this$geometry$vertex, _toConsumableArray(this.transformNormals(input.vertexNormals))); + (_this$geometry$uvs = this.geometry.uvs).push.apply(_this$geometry$uvs, _toConsumableArray(input.uvs)); + if (this.renderer._doFill) { + var _this$geometry$faces; + (_this$geometry$faces = this.geometry.faces).push.apply(_this$geometry$faces, _toConsumableArray(input.faces.map(function (f) { + return f.map(function (idx) { + return idx + startIdx; + }); + }))); + } + if (this.renderer._doStroke) { + var _this$geometry$edges; + (_this$geometry$edges = this.geometry.edges).push.apply(_this$geometry$edges, _toConsumableArray(input.edges.map(function (edge) { + return edge.map(function (idx) { + return idx + startIdx; + }); + }))); + } + var vertexColors = _toConsumableArray(input.vertexColors); + while (vertexColors.length < input.vertices.length * 4) { + vertexColors.push.apply(vertexColors, _toConsumableArray(this.renderer.curFillColor)); + }(_this$geometry$vertex2 = this.geometry.vertexColors).push.apply(_this$geometry$vertex2, _toConsumableArray(vertexColors)); + } /** + * Adds geometry from the renderer's immediate mode into the builder's + * combined geometry. + */ + + }, + { + key: 'addImmediate', + value: function addImmediate() { + var geometry = this.renderer.immediateMode.geometry; + var shapeMode = this.renderer.immediateMode.shapeMode; + var faces = [ + ]; + if (this.renderer._doFill) { + if (shapeMode === constants.TRIANGLE_STRIP || shapeMode === constants.QUAD_STRIP) { + for (var i = 2; i < geometry.vertices.length; i++) { + if (i % 2 === 0) { + faces.push([i, + i - 1, + i - 2]); + } else { + faces.push([i, + i - 2, + i - 1]); + } + } + } else if (shapeMode === constants.TRIANGLE_FAN) { + for (var _i = 2; _i < geometry.vertices.length; _i++) { + faces.push([0, + _i - 1, + _i]); + } + } else { + for (var _i2 = 0; _i2 < geometry.vertices.length; _i2 += 3) { + faces.push([_i2, + _i2 + 1, + _i2 + 2]); + } + } + } + this.addGeometry(Object.assign({ + }, geometry, { + faces: faces + })); + } /** + * Adds geometry from the renderer's retained mode into the builder's + * combined geometry. + */ + + }, + { + key: 'addRetained', + value: function addRetained(geometry) { + this.addGeometry(geometry.model); + } /** + * Cleans up the state of the renderer and returns the combined geometry that + * was built. + * @returns p5.Geometry The flattened, combined geometry + */ + + }, + { + key: 'finish', + value: function finish() { + this.renderer._pInst.pop(); + return this.geometry; + } + } + ]); + return GeometryBuilder; + }(); + /** + * Keeps track of how many custom geometry objects have been made so that each + * can be assigned a unique ID. + */ + GeometryBuilder.nextGeometryId = 0; + var _default = GeometryBuilder; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.every': 171, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.object.assign': 194, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 343: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.math.sign'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.math.sign'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } /** + * @module 3D + * @submodule Interaction + * @for p5 + * @requires core + */ + /** + * Allows movement around a 3D sketch using a mouse or trackpad or touch. + * Left-clicking and dragging or swipe motion will rotate the camera position + * about the center of the sketch, right-clicking and dragging or multi-swipe + * will pan the camera position without rotation, and using the mouse wheel + * (scrolling) or pinch in/out will move the camera further or closer + * from the center of the sketch. This function can be called with parameters + * dictating sensitivity to mouse/touch movement along the X and Y axes. + * Calling this function without parameters is equivalent to calling + * orbitControl(1,1). To reverse direction of movement in either axis, + * enter a negative number for sensitivity. + * @method orbitControl + * @for p5 + * @param {Number} [sensitivityX] sensitivity to mouse movement along X axis + * @param {Number} [sensitivityY] sensitivity to mouse movement along Y axis + * @param {Number} [sensitivityZ] sensitivity to scroll movement along Z axis + * @param {Object} [options] An optional object that can contain additional settings, + * disableTouchActions - Boolean, default value is true. + * Setting this to true makes mobile interactions smoother by preventing + * accidental interactions with the page while orbiting. But if you're already + * doing it via css or want the default touch actions, consider setting it to false. + * freeRotation - Boolean, default value is false. + * By default, horizontal movement of the mouse or touch pointer rotates the camera + * around the y-axis, and vertical movement rotates the camera around the x-axis. + * But if setting this option to true, the camera always rotates in the direction + * the pointer is moving. For zoom and move, the behavior is the same regardless of + * true/false. + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * describe( + * 'Camera orbits around a box when mouse is hold-clicked & then moved.' + * ); + * } + * function draw() { + * background(200); + * + * // If you execute the line commented out instead of next line, the direction of rotation + * // will be the direction the mouse or touch pointer moves, not around the X or Y axis. + * orbitControl(); + * // orbitControl(1, 1, 1, {freeRotation: true}); + * + * rotateY(0.5); + * box(30, 50); + * } + * + *
                              + * + * @alt + * Camera orbits around a box when mouse is hold-clicked & then moved. + */ + // implementation based on three.js 'orbitControls': + // https://github.com/mrdoob/three.js/blob/6afb8595c0bf8b2e72818e42b64e6fe22707d896/examples/jsm/controls/OrbitControls.js#L22 + + _main.default.prototype.orbitControl = function (sensitivityX, sensitivityY, sensitivityZ, options) { + var _this = this; + this._assert3d('orbitControl'); + _main.default._validateParameters('orbitControl', arguments); + var cam = this._renderer._curCamera; + if (typeof sensitivityX === 'undefined') { + sensitivityX = 1; + } + if (typeof sensitivityY === 'undefined') { + sensitivityY = sensitivityX; + } + if (typeof sensitivityZ === 'undefined') { + sensitivityZ = 1; + } + if (_typeof(options) !== 'object') { + options = { + }; + } // default right-mouse and mouse-wheel behaviors (context menu and scrolling, + // respectively) are disabled here to allow use of those events for panning and + // zooming. However, whether or not to disable touch actions is an option. + // disable context menu for canvas element and add 'contextMenuDisabled' + // flag to p5 instance + + if (this.contextMenuDisabled !== true) { + this.canvas.oncontextmenu = function () { + return false; + }; + this._setProperty('contextMenuDisabled', true); + } // disable default scrolling behavior on the canvas element and add + // 'wheelDefaultDisabled' flag to p5 instance + + if (this.wheelDefaultDisabled !== true) { + this.canvas.onwheel = function () { + return false; + }; + this._setProperty('wheelDefaultDisabled', true); + } // disable default touch behavior on the canvas element and add + // 'touchActionsDisabled' flag to p5 instance + + var _options = options, + _options$disableTouch = _options.disableTouchActions, + disableTouchActions = _options$disableTouch === void 0 ? true : _options$disableTouch; + if (this.touchActionsDisabled !== true && disableTouchActions) { + this.canvas.style['touch-action'] = 'none'; + this._setProperty('touchActionsDisabled', true); + } // If option.freeRotation is true, the camera always rotates freely in the direction + // the pointer moves. default value is false (normal behavior) + + var _options2 = options, + _options2$freeRotatio = _options2.freeRotation, + freeRotation = _options2$freeRotatio === void 0 ? false : _options2$freeRotatio; // get moved touches. + var movedTouches = [ + ]; + this.touches.forEach(function (curTouch) { + _this._renderer.prevTouches.forEach(function (prevTouch) { + if (curTouch.id === prevTouch.id) { + var movedTouch = { + x: curTouch.x, + y: curTouch.y, + px: prevTouch.x, + py: prevTouch.y + }; + movedTouches.push(movedTouch); + } + }); + }); + this._renderer.prevTouches = this.touches; + // The idea of using damping is based on the following website. thank you. + // https://github.com/freshfork/p5.EasyCam/blob/9782964680f6a5c4c9bee825c475d9f2021d5134/p5.easycam.js#L1124 + // variables for interaction + var deltaRadius = 0; + var deltaTheta = 0; + var deltaPhi = 0; + var moveDeltaX = 0; + var moveDeltaY = 0; + // constants for dampingProcess + var damping = 0.85; + var rotateAccelerationFactor = 0.6; + var moveAccelerationFactor = 0.15; + // For touches, the appropriate scale is different + // because the distance difference is multiplied. + var mouseZoomScaleFactor = 0.01; + var touchZoomScaleFactor = 0.0004; + var scaleFactor = this.height < this.width ? this.height : this.width; + // Flag whether the mouse or touch pointer is inside the canvas + var pointersInCanvas = false; + // calculate and determine flags and variables. + if (movedTouches.length > 0) { + /* for touch */ + // if length === 1, rotate + // if length > 1, zoom and move + // for touch, it is calculated based on one moved touch pointer position. + pointersInCanvas = movedTouches[0].x > 0 && movedTouches[0].x < this.width && movedTouches[0].y > 0 && movedTouches[0].y < this.height; + if (movedTouches.length === 1) { + var t = movedTouches[0]; + deltaTheta = - sensitivityX * (t.x - t.px) / scaleFactor; + deltaPhi = sensitivityY * (t.y - t.py) / scaleFactor; + } else { + var t0 = movedTouches[0]; + var t1 = movedTouches[1]; + var distWithTouches = Math.hypot(t0.x - t1.x, t0.y - t1.y); + var prevDistWithTouches = Math.hypot(t0.px - t1.px, t0.py - t1.py); + var changeDist = distWithTouches - prevDistWithTouches; + // move the camera farther when the distance between the two touch points + // decreases, move the camera closer when it increases. + deltaRadius = - changeDist * sensitivityZ * touchZoomScaleFactor; + // Move the center of the camera along with the movement of + // the center of gravity of the two touch points. + moveDeltaX = 0.5 * (t0.x + t1.x) - 0.5 * (t0.px + t1.px); + moveDeltaY = 0.5 * (t0.y + t1.y) - 0.5 * (t0.py + t1.py); + } + if (this.touches.length > 0) { + if (pointersInCanvas) { + // Initiate an interaction if touched in the canvas + this._renderer.executeRotateAndMove = true; + this._renderer.executeZoom = true; + } + } else { + // End an interaction when the touch is released + this._renderer.executeRotateAndMove = false; + this._renderer.executeZoom = false; + } + } else { + /* for mouse */ + // if wheelDeltaY !== 0, zoom + // if mouseLeftButton is down, rotate + // if mouseRightButton is down, move + // For mouse, it is calculated based on the mouse position. + pointersInCanvas = this.mouseX > 0 && this.mouseX < this.width && this.mouseY > 0 && this.mouseY < this.height; + if (this._mouseWheelDeltaY !== 0) { + // zoom the camera depending on the value of _mouseWheelDeltaY. + // move away if positive, move closer if negative + deltaRadius = Math.sign(this._mouseWheelDeltaY) * sensitivityZ; + deltaRadius *= mouseZoomScaleFactor; + this._mouseWheelDeltaY = 0; + // start zoom when the mouse is wheeled within the canvas. + if (pointersInCanvas) this._renderer.executeZoom = true; + } else { + // quit zoom when you stop wheeling. + this._renderer.zoomFlag = false; + } + if (this.mouseIsPressed) { + if (this.mouseButton === this.LEFT) { + deltaTheta = - sensitivityX * this.movedX / scaleFactor; + deltaPhi = sensitivityY * this.movedY / scaleFactor; + } else if (this.mouseButton === this.RIGHT) { + moveDeltaX = this.movedX; + moveDeltaY = this.movedY * cam.yScale; + } // start rotate and move when mouse is pressed within the canvas. + + if (pointersInCanvas) this._renderer.executeRotateAndMove = true; + } else { + // quit rotate and move if mouse is released. + this._renderer.executeRotateAndMove = false; + } + } // interactions + // zoom process + + if (deltaRadius !== 0 && this._renderer.executeZoom) { + // accelerate zoom velocity + this._renderer.zoomVelocity += deltaRadius; + } + if (Math.abs(this._renderer.zoomVelocity) > 0.001) { + // if freeRotation is true, we use _orbitFree() instead of _orbit() + if (freeRotation) { + cam._orbitFree(0, 0, this._renderer.zoomVelocity); + } else { + cam._orbit(0, 0, this._renderer.zoomVelocity); + } // In orthogonal projection, the scale does not change even if + // the distance to the gaze point is changed, so the projection matrix + // needs to be modified. + + if (cam.projMatrix.mat4[15] !== 0) { + cam.projMatrix.mat4[0] *= Math.pow(10, - this._renderer.zoomVelocity); + cam.projMatrix.mat4[5] *= Math.pow(10, - this._renderer.zoomVelocity); + // modify uPMatrix + this._renderer.uPMatrix.mat4[0] = cam.projMatrix.mat4[0]; + this._renderer.uPMatrix.mat4[5] = cam.projMatrix.mat4[5]; + } // damping + + this._renderer.zoomVelocity *= damping; + } else { + this._renderer.zoomVelocity = 0; + } // rotate process + + if ((deltaTheta !== 0 || deltaPhi !== 0) && this._renderer.executeRotateAndMove) { + // accelerate rotate velocity + this._renderer.rotateVelocity.add(deltaTheta * rotateAccelerationFactor, deltaPhi * rotateAccelerationFactor); + } + if (this._renderer.rotateVelocity.magSq() > 0.000001) { + // if freeRotation is true, the camera always rotates freely in the direction the pointer moves + if (freeRotation) { + cam._orbitFree( - this._renderer.rotateVelocity.x, this._renderer.rotateVelocity.y, 0); + } else { + cam._orbit(this._renderer.rotateVelocity.x, this._renderer.rotateVelocity.y, 0); + } // damping + + this._renderer.rotateVelocity.mult(damping); + } else { + this._renderer.rotateVelocity.set(0, 0); + } // move process + + if ((moveDeltaX !== 0 || moveDeltaY !== 0) && this._renderer.executeRotateAndMove) { + // Normalize movement distance + var ndcX = moveDeltaX * 2 / this.width; + var ndcY = - moveDeltaY * 2 / this.height; + // accelerate move velocity + this._renderer.moveVelocity.add(ndcX * moveAccelerationFactor, ndcY * moveAccelerationFactor); + } + if (this._renderer.moveVelocity.magSq() > 0.000001) { + // Translate the camera so that the entire object moves + // perpendicular to the line of sight when the mouse is moved + // or when the centers of gravity of the two touch pointers move. + var local = cam._getLocalAxes(); + // Calculate the z coordinate in the view coordinates of + // the center, that is, the distance to the view point + var diffX = cam.eyeX - cam.centerX; + var diffY = cam.eyeY - cam.centerY; + var diffZ = cam.eyeZ - cam.centerZ; + var viewZ = Math.sqrt(diffX * diffX + diffY * diffY + diffZ * diffZ); + // position vector of the center. + var cv = new _main.default.Vector(cam.centerX, cam.centerY, cam.centerZ); + // Calculate the normalized device coordinates of the center. + cv = cam.cameraMatrix.multiplyPoint(cv); + cv = this._renderer.uPMatrix.multiplyAndNormalizePoint(cv); + // Move the center by this distance + // in the normalized device coordinate system. + cv.x -= this._renderer.moveVelocity.x; + cv.y -= this._renderer.moveVelocity.y; + // Calculate the translation vector + // in the direction perpendicular to the line of sight of center. + var dx, + dy; + var uP = this._renderer.uPMatrix.mat4; + if (uP[15] === 0) { + dx = (uP[8] + cv.x) / uP[0] * viewZ; + dy = (uP[9] + cv.y) / uP[5] * viewZ; + } else { + dx = (cv.x - uP[12]) / uP[0]; + dy = (cv.y - uP[13]) / uP[5]; + } // translate the camera. + + cam.setPosition(cam.eyeX + dx * local.x[0] + dy * local.y[0], cam.eyeY + dx * local.x[1] + dy * local.y[1], cam.eyeZ + dx * local.x[2] + dy * local.y[2]); + // damping + this._renderer.moveVelocity.mult(damping); + } else { + this._renderer.moveVelocity.set(0, 0); + } + return this; + }; + /** + * debugMode() helps visualize 3D space by adding a grid to indicate where the + * ‘ground’ is in a sketch and an axes icon which indicates the +X, +Y, and +Z + * directions. This function can be called without parameters to create a + * default grid and axes icon, or it can be called according to the examples + * above to customize the size and position of the grid and/or axes icon. The + * grid is drawn using the most recently set stroke color and weight. To + * specify these parameters, add a call to stroke() and strokeWeight() + * just before the end of the draw() loop. + * + * By default, the grid will run through the origin (0,0,0) of the sketch + * along the XZ plane + * and the axes icon will be offset from the origin. Both the grid and axes + * icon will be sized according to the current canvas size. Note that because the + * grid runs parallel to the default camera view, it is often helpful to use + * debugMode along with orbitControl to allow full view of the grid. + * @method debugMode + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * // Press the spacebar to turn debugMode off! + * if (keyIsDown(32)) { + * noDebugMode(); + * } + * } + * + *
                              + * @alt + * a 3D box is centered on a grid in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. the grid and icon disappear when the + * spacebar is pressed. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(GRID); + * describe('a 3D box is centered on a grid in a 3D sketch.'); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * } + * + *
                              + * @alt + * a 3D box is centered on a grid in a 3D sketch. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(AXES); + * describe( + * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * } + * + *
                              + * @alt + * a 3D box is centered in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(GRID, 100, 10, 0, 0, 0); + * describe('a 3D box is centered on a grid in a 3D sketch'); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * } + * + *
                              + * @alt + * a 3D box is centered on a grid in a 3D sketch + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(100, 10, 0, 0, 0, 20, 0, -40, 0); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' + * ); + * } + * + * function draw() { + * noStroke(); + * background(200); + * orbitControl(); + * box(15, 30); + * // set the stroke color and weight for the grid! + * stroke(255, 0, 150); + * strokeWeight(0.8); + * } + * + *
                              + * @alt + * a 3D box is centered on a grid in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. + */ + /** + * @method debugMode + * @param {Constant} mode either GRID or AXES + */ + /** + * @method debugMode + * @param {Constant} mode + * @param {Number} [gridSize] size of one side of the grid + * @param {Number} [gridDivisions] number of divisions in the grid + * @param {Number} [xOff] X axis offset from origin (0,0,0) + * @param {Number} [yOff] Y axis offset from origin (0,0,0) + * @param {Number} [zOff] Z axis offset from origin (0,0,0) + */ + /** + * @method debugMode + * @param {Constant} mode + * @param {Number} [axesSize] size of axes icon + * @param {Number} [xOff] + * @param {Number} [yOff] + * @param {Number} [zOff] + */ + /** + * @method debugMode + * @param {Number} [gridSize] + * @param {Number} [gridDivisions] + * @param {Number} [gridXOff] + * @param {Number} [gridYOff] + * @param {Number} [gridZOff] + * @param {Number} [axesSize] + * @param {Number} [axesXOff] + * @param {Number} [axesYOff] + * @param {Number} [axesZOff] + */ + _main.default.prototype.debugMode = function () { + this._assert3d('debugMode'); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('debugMode', args); + // start by removing existing 'post' registered debug methods + for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { + // test for equality... + if (this._registeredMethods.post[i].toString() === this._grid().toString() || this._registeredMethods.post[i].toString() === this._axesIcon().toString()) { + this._registeredMethods.post.splice(i, 1); + } + } // then add new debugMode functions according to the argument list + + if (args[0] === constants.GRID) { + this.registerMethod('post', this._grid.call(this, args[1], args[2], args[3], args[4], args[5])); + } else if (args[0] === constants.AXES) { + this.registerMethod('post', this._axesIcon.call(this, args[1], args[2], args[3], args[4])); + } else { + this.registerMethod('post', this._grid.call(this, args[0], args[1], args[2], args[3], args[4])); + this.registerMethod('post', this._axesIcon.call(this, args[5], args[6], args[7], args[8])); + } + }; + /** + * Turns off debugMode() in a 3D sketch. + * @method noDebugMode + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); + * normalMaterial(); + * debugMode(); + * describe( + * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' + * ); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * box(15, 30); + * // Press the spacebar to turn debugMode off! + * if (keyIsDown(32)) { + * noDebugMode(); + * } + * } + * + *
                              + * @alt + * a 3D box is centered on a grid in a 3D sketch. an icon + * indicates the direction of each axis: a red line points +X, + * a green line +Y, and a blue line +Z. the grid and icon disappear when the + * spacebar is pressed. + */ + _main.default.prototype.noDebugMode = function () { + this._assert3d('noDebugMode'); + // start by removing existing 'post' registered debug methods + for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { + // test for equality... + if (this._registeredMethods.post[i].toString() === this._grid().toString() || this._registeredMethods.post[i].toString() === this._axesIcon().toString()) { + this._registeredMethods.post.splice(i, 1); + } + } + }; + /** + * For use with debugMode + * @private + * @method _grid + * @param {Number} [size] size of grid sides + * @param {Number} [div] number of grid divisions + * @param {Number} [xOff] offset of grid center from origin in X axis + * @param {Number} [yOff] offset of grid center from origin in Y axis + * @param {Number} [zOff] offset of grid center from origin in Z axis + */ + _main.default.prototype._grid = function (size, numDivs, xOff, yOff, zOff) { + if (typeof size === 'undefined') { + size = this.width / 2; + } + if (typeof numDivs === 'undefined') { + // ensure at least 2 divisions + numDivs = Math.round(size / 30) < 4 ? 4 : Math.round(size / 30); + } + if (typeof xOff === 'undefined') { + xOff = 0; + } + if (typeof yOff === 'undefined') { + yOff = 0; + } + if (typeof zOff === 'undefined') { + zOff = 0; + } + var spacing = size / numDivs; + var halfSize = size / 2; + return function () { + this.push(); + this.stroke(this._renderer.curStrokeColor[0] * 255, this._renderer.curStrokeColor[1] * 255, this._renderer.curStrokeColor[2] * 255); + this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0], this._renderer._curCamera.cameraMatrix.mat4[1], this._renderer._curCamera.cameraMatrix.mat4[2], this._renderer._curCamera.cameraMatrix.mat4[3], this._renderer._curCamera.cameraMatrix.mat4[4], this._renderer._curCamera.cameraMatrix.mat4[5], this._renderer._curCamera.cameraMatrix.mat4[6], this._renderer._curCamera.cameraMatrix.mat4[7], this._renderer._curCamera.cameraMatrix.mat4[8], this._renderer._curCamera.cameraMatrix.mat4[9], this._renderer._curCamera.cameraMatrix.mat4[10], this._renderer._curCamera.cameraMatrix.mat4[11], this._renderer._curCamera.cameraMatrix.mat4[12], this._renderer._curCamera.cameraMatrix.mat4[13], this._renderer._curCamera.cameraMatrix.mat4[14], this._renderer._curCamera.cameraMatrix.mat4[15]); + // Lines along X axis + for (var q = 0; q <= numDivs; q++) { + this.beginShape(this.LINES); + this.vertex( - halfSize + xOff, yOff, q * spacing - halfSize + zOff); + this.vertex( + halfSize + xOff, yOff, q * spacing - halfSize + zOff); + this.endShape(); + } // Lines along Z axis + + for (var i = 0; i <= numDivs; i++) { + this.beginShape(this.LINES); + this.vertex(i * spacing - halfSize + xOff, yOff, - halfSize + zOff); + this.vertex(i * spacing - halfSize + xOff, yOff, + halfSize + zOff); + this.endShape(); + } + this.pop(); + }; + }; + /** + * For use with debugMode + * @private + * @method _axesIcon + * @param {Number} [size] size of axes icon lines + * @param {Number} [xOff] offset of icon from origin in X axis + * @param {Number} [yOff] offset of icon from origin in Y axis + * @param {Number} [zOff] offset of icon from origin in Z axis + */ + _main.default.prototype._axesIcon = function (size, xOff, yOff, zOff) { + if (typeof size === 'undefined') { + size = this.width / 20 > 40 ? this.width / 20 : 40; + } + if (typeof xOff === 'undefined') { + xOff = - this.width / 4; + } + if (typeof yOff === 'undefined') { + yOff = xOff; + } + if (typeof zOff === 'undefined') { + zOff = xOff; + } + return function () { + this.push(); + this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0], this._renderer._curCamera.cameraMatrix.mat4[1], this._renderer._curCamera.cameraMatrix.mat4[2], this._renderer._curCamera.cameraMatrix.mat4[3], this._renderer._curCamera.cameraMatrix.mat4[4], this._renderer._curCamera.cameraMatrix.mat4[5], this._renderer._curCamera.cameraMatrix.mat4[6], this._renderer._curCamera.cameraMatrix.mat4[7], this._renderer._curCamera.cameraMatrix.mat4[8], this._renderer._curCamera.cameraMatrix.mat4[9], this._renderer._curCamera.cameraMatrix.mat4[10], this._renderer._curCamera.cameraMatrix.mat4[11], this._renderer._curCamera.cameraMatrix.mat4[12], this._renderer._curCamera.cameraMatrix.mat4[13], this._renderer._curCamera.cameraMatrix.mat4[14], this._renderer._curCamera.cameraMatrix.mat4[15]); + // X axis + this.strokeWeight(2); + this.stroke(255, 0, 0); + this.beginShape(this.LINES); + this.vertex(xOff, yOff, zOff); + this.vertex(xOff + size, yOff, zOff); + this.endShape(); + // Y axis + this.stroke(0, 255, 0); + this.beginShape(this.LINES); + this.vertex(xOff, yOff, zOff); + this.vertex(xOff, yOff + size, zOff); + this.endShape(); + // Z axis + this.stroke(0, 0, 255); + this.beginShape(this.LINES); + this.vertex(xOff, yOff, zOff); + this.vertex(xOff, yOff, zOff + size); + this.endShape(); + this.pop(); + }; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.math.hypot': 188, + 'core-js/modules/es.math.sign': 190, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 344: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module 3D + * @submodule Lights + * @for p5 + * @requires core + */ + /** + * Creates an ambient light with the given color. + * + * Ambient light does not come from a specific direction. + * Objects are evenly lit from all sides. Ambient lights are + * almost always used in combination with other types of lights. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method ambientLight + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @param {Number} [alpha] alpha value relative to current + * color range (default is 0-255) + * @chainable + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe('sphere with coral color under black light'); + * } + * function draw() { + * background(100); + * ambientLight(0); // black light (no light) + * ambientMaterial(255, 127, 80); // coral material + * sphere(40); + * } + * + *
                              + * @alt + * sphere with coral color under black light + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe('sphere with coral color under white light'); + * } + * function draw() { + * background(100); + * ambientLight(255); // white light + * ambientMaterial(255, 127, 80); // coral material + * sphere(40); + * } + * + *
                              + * @alt + * sphere with coral color under white light + * + * @example + *
                              + * + * function setup() { + * createCanvas(100,100,WEBGL); + * camera(0,-100,300); + * } + * function draw() { + * background(230); + * ambientMaterial(237,34,93); //Pink Material + * ambientLight(mouseY); + * //As you move the mouse up to down it changes from no ambient light to full ambient light. + * rotateY(millis()/2000); + * box(100); + * } + * + *
                              + * @alt + * pink ambient material cube under the ambient light + */ + /** + * @method ambientLight + * @param {Number} gray number specifying value between + * white and black + * @param {Number} [alpha] + * @chainable + */ + /** + * @method ambientLight + * @param {String} value a color string + * @chainable + */ + /** + * @method ambientLight + * @param {Number[]} values an array containing the red,green,blue & + * and alpha components of the color + * @chainable + */ + /** + * @method ambientLight + * @param {p5.Color} color color as a p5.Color + * @chainable + */ + + _main.default.prototype.ambientLight = function (v1, v2, v3, a) { + this._assert3d('ambientLight'); + _main.default._validateParameters('ambientLight', arguments); + var color = this.color.apply(this, arguments); + this._renderer.ambientLightColors.push(color._array[0], color._array[1], color._array[2]); + this._renderer._enableLighting = true; + return this; + }; + /** + * Sets the color of the specular highlight of a non-ambient light + * (i.e. all lights except ambientLight()). + * + * specularColor() affects only the lights which are created after + * it in the code. + * + * This function is used in combination with + * specularMaterial(). + * If a geometry does not use specularMaterial(), this function + * will have no effect. + * + * The default color is white (255, 255, 255), which is used if + * specularColor() is not explicitly called. + * + * Note: specularColor is equivalent to the Processing function + * lightSpecular. + * + * @method specularColor + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @chainable + * @example + *
                              + * + * let setRedSpecularColor = true; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe( + * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' + * ); + * } + * + * function draw() { + * background(0); + * + * ambientLight(60); + * + * // add a point light to showcase specular color + * // -- use mouse location to position the light + * let lightPosX = mouseX - width / 2; + * let lightPosY = mouseY - height / 2; + * // -- set the light's specular color + * if (setRedSpecularColor) { + * specularColor(255, 0, 0); // red specular highlight + * } + * // -- create the light + * pointLight(200, 200, 200, lightPosX, lightPosY, 50); // white light + * + * // use specular material with high shininess + * specularMaterial(150); + * shininess(50); + * + * sphere(30, 64, 64); + * } + * + * function mouseClicked() { + * setRedSpecularColor = !setRedSpecularColor; + * } + * + *
                              + * + * @alt + * Sphere with specular highlight. Clicking the mouse toggles the + * specular highlight color between red and the default white. + */ + /** + * @method specularColor + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + /** + * @method specularColor + * @param {String} value color as a CSS string + * @chainable + */ + /** + * @method specularColor + * @param {Number[]} values color as an array containing the + * red, green, and blue components + * @chainable + */ + /** + * @method specularColor + * @param {p5.Color} color color as a p5.Color + * @chainable + */ + _main.default.prototype.specularColor = function (v1, v2, v3) { + this._assert3d('specularColor'); + _main.default._validateParameters('specularColor', arguments); + var color = this.color.apply(this, arguments); + this._renderer.specularColors = [ + color._array[0], + color._array[1], + color._array[2] + ]; + return this; + }; + /** + * Creates a directional light with the given color and direction. + * + * Directional light comes from one direction. + * The direction is specified as numbers inclusively between -1 and 1. + * For example, setting the direction as (0, -1, 0) will cause the + * geometry to be lit from below (since the light will be facing + * directly upwards). Similarly, setting the direction as (1, 0, 0) + * will cause the geometry to be lit from the left (since the light + * will be facing directly rightwards). + * + * Directional lights do not have a specific point of origin, and + * therefore cannot be positioned closer or farther away from a geometry. + * + * A maximum of **5** directional lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method directionalLight + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} x x component of direction (inclusive range of -1 to 1) + * @param {Number} y y component of direction (inclusive range of -1 to 1) + * @param {Number} z z component of direction (inclusive range of -1 to 1) + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' + * ); + * } + * function draw() { + * background(0); + * //move your mouse to change light direction + * let dirX = (mouseX / width - 0.5) * 2; + * let dirY = (mouseY / height - 0.5) * 2; + * directionalLight(250, 250, 250, -dirX, -dirY, -1); + * noStroke(); + * sphere(40); + * } + * + *
                              + * + * @alt + * scene with sphere and directional light. The direction of + * the light is controlled with the mouse position. + */ + /** + * @method directionalLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} direction direction of light as a + * p5.Vector + * @chainable + */ + /** + * @method directionalLight + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @chainable + */ + /** + * @method directionalLight + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} direction + * @chainable + */ + _main.default.prototype.directionalLight = function (v1, v2, v3, x, y, z) { + this._assert3d('directionalLight'); + _main.default._validateParameters('directionalLight', arguments); + //@TODO: check parameters number + var color; + if (v1 instanceof _main.default.Color) { + color = v1; + } else { + color = this.color(v1, v2, v3); + } + var _x, + _y, + _z; + var v = arguments[arguments.length - 1]; + if (typeof v === 'number') { + _x = arguments[arguments.length - 3]; + _y = arguments[arguments.length - 2]; + _z = arguments[arguments.length - 1]; + } else { + _x = v.x; + _y = v.y; + _z = v.z; + } // normalize direction + + var l = Math.sqrt(_x * _x + _y * _y + _z * _z); + this._renderer.directionalLightDirections.push(_x / l, _y / l, _z / l); + this._renderer.directionalLightDiffuseColors.push(color._array[0], color._array[1], color._array[2]); + Array.prototype.push.apply(this._renderer.directionalLightSpecularColors, this._renderer.specularColors); + this._renderer._enableLighting = true; + return this; + }; + /** + * Creates a point light with the given color and position. + * + * A point light emits light from a single point in all directions. + * Because the light is emitted from a specific point (position), + * it has a different effect when it is positioned farther vs. nearer + * an object. + * + * A maximum of **5** point lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method pointLight + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} x x component of position + * @param {Number} y y component of position + * @param {Number} z z component of position + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' + * ); + * } + * function draw() { + * background(0); + * // move your mouse to change light position + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * // to set the light position, + * // think of the world's coordinate as: + * // -width/2,-height/2 ----------- width/2,-height/2 + * // | | + * // | 0,0 | + * // | | + * // -width/2,height/2 ----------- width/2,height/2 + * pointLight(250, 250, 250, locX, locY, 50); + * noStroke(); + * sphere(40); + * } + * + *
                              + * + * @alt + * scene with sphere and point light. The position of + * the light is controlled with the mouse position. + */ + /** + * @method pointLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position of light as a p5.Vector + * @chainable + */ + /** + * @method pointLight + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @chainable + */ + /** + * @method pointLight + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} position + * @chainable + */ + _main.default.prototype.pointLight = function (v1, v2, v3, x, y, z) { + this._assert3d('pointLight'); + _main.default._validateParameters('pointLight', arguments); + //@TODO: check parameters number + var color; + if (v1 instanceof _main.default.Color) { + color = v1; + } else { + color = this.color(v1, v2, v3); + } + var _x, + _y, + _z; + var v = arguments[arguments.length - 1]; + if (typeof v === 'number') { + _x = arguments[arguments.length - 3]; + _y = arguments[arguments.length - 2]; + _z = arguments[arguments.length - 1]; + } else { + _x = v.x; + _y = v.y; + _z = v.z; + } + this._renderer.pointLightPositions.push(_x, _y, _z); + this._renderer.pointLightDiffuseColors.push(color._array[0], color._array[1], color._array[2]); + Array.prototype.push.apply(this._renderer.pointLightSpecularColors, this._renderer.specularColors); + this._renderer._enableLighting = true; + return this; + }; + /** + * Creates an image light with the given image. + * + * The image light simulates light from all the directions. + * This is done by using the image as a texture for an infinitely + * large sphere light. This sphere contains + * or encapsulates the whole scene/drawing. + * It will have different effect for varying shininess of the + * object in the drawing. + * Under the hood it is mainly doing 2 types of calculations, + * the first one is creating an irradiance map the + * environment map of the input image. + * The second one is managing reflections based on the shininess + * or roughness of the material used in the scene. + * + * Note: The image's diffuse light will be affected by fill() + * and the specular reflections will be affected by specularMaterial() + * and shininess(). + * + * @method imageLight + * @param {p5.image} img image for the background + * @example + *
                              + * + * let img; + * function preload() { + * img = loadImage('assets/outdoor_image.jpg'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * function draw() { + * background(220); + * imageMode(CENTER); + * push(); + * translate(0, 0, -200); + * scale(2); + * image(img, 0, 0, width, height); + * pop(); + * ambientLight(50); + * imageLight(img); + * specularMaterial(20); + * noStroke(); + * scale(2); + * rotateX(frameCount * 0.005); + * rotateY(frameCount * 0.005); + * box(25); + * } + * + *
                              + * @alt + * image light example + * @example + *
                              + * + * let img; + * let slider; + * function preload() { + * img = loadImage('assets/outdoor_spheremap.jpg'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * slider = createSlider(0, 400, 100, 1); + * slider.position(0, height); + * } + * function draw() { + * background(220); + * imageMode(CENTER); + * push(); + * translate(0, 0, -200); + * scale(2); + * image(img, 0, 0, width, height); + * pop(); + * ambientLight(50); + * imageLight(img); + * specularMaterial(20); + * shininess(slider.value()); + * noStroke(); + * scale(2); + * sphere(15); + * } + * + *
                              + * @alt + * light with slider having a slider for varying roughness + */ + _main.default.prototype.imageLight = function (img) { + // activeImageLight property is checked by _setFillUniforms + // for sending uniforms to the fillshader + this._renderer.activeImageLight = img; + this._renderer._enableLighting = true; + }; + /** + * Places an ambient and directional light in the scene. + * The lights are set to ambientLight(128, 128, 128) and + * directionalLight(128, 128, 128, 0, 0, -1). + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method lights + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('the light is partially ambient and partially directional'); + * } + * function draw() { + * background(0); + * lights(); + * rotateX(millis() / 1000); + * rotateY(millis() / 1000); + * rotateZ(millis() / 1000); + * box(); + * } + * + *
                              + * + * @alt + * the light is partially ambient and partially directional + */ + _main.default.prototype.lights = function () { + this._assert3d('lights'); + // Both specify gray by default. + var grayColor = this.color('rgb(128,128,128)'); + this.ambientLight(grayColor); + this.directionalLight(grayColor, 0, 0, - 1); + return this; + }; + /** + * Sets the falloff rate for pointLight() + * and spotLight(). + * + * lightFalloff() affects only the lights which are created after it + * in the code. + * + * The `constant`, `linear`, an `quadratic` parameters are used to calculate falloff as follows: + * + * d = distance from light position to vertex position + * + * falloff = 1 / (CONSTANT + d \* LINEAR + (d \* d) \* QUADRATIC) + * + * @method lightFalloff + * @param {Number} constant CONSTANT value for determining falloff + * @param {Number} linear LINEAR value for determining falloff + * @param {Number} quadratic QUADRATIC value for determining falloff + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe( + * 'Two spheres with different falloff values show different intensity of light' + * ); + * } + * function draw() { + * ortho(); + * background(0); + * + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * locX /= 2; // half scale + * + * lightFalloff(1, 0, 0); + * push(); + * translate(-25, 0, 0); + * pointLight(250, 250, 250, locX - 25, locY, 50); + * sphere(20); + * pop(); + * + * lightFalloff(0.97, 0.03, 0); + * push(); + * translate(25, 0, 0); + * pointLight(250, 250, 250, locX + 25, locY, 50); + * sphere(20); + * pop(); + * } + * + *
                              + * + * @alt + * Two spheres with different falloff values show different intensity of light + */ + _main.default.prototype.lightFalloff = function (constantAttenuation, linearAttenuation, quadraticAttenuation) { + this._assert3d('lightFalloff'); + _main.default._validateParameters('lightFalloff', arguments); + if (constantAttenuation < 0) { + constantAttenuation = 0; + console.warn('Value of constant argument in lightFalloff() should be never be negative. Set to 0.'); + } + if (linearAttenuation < 0) { + linearAttenuation = 0; + console.warn('Value of linear argument in lightFalloff() should be never be negative. Set to 0.'); + } + if (quadraticAttenuation < 0) { + quadraticAttenuation = 0; + console.warn('Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.'); + } + if (constantAttenuation === 0 && linearAttenuation === 0 && quadraticAttenuation === 0) { + constantAttenuation = 1; + console.warn('Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.'); + } + this._renderer.constantAttenuation = constantAttenuation; + this._renderer.linearAttenuation = linearAttenuation; + this._renderer.quadraticAttenuation = quadraticAttenuation; + return this; + }; + /** + * Creates a spot light with the given color, position, + * light direction, angle, and concentration. + * + * Like a pointLight(), a spotLight() + * emits light from a specific point (position). It has a different effect + * when it is positioned farther vs. nearer an object. + * + * However, unlike a pointLight(), the light is emitted in **one direction** + * along a conical shape. The shape of the cone can be controlled using + * the `angle` and `concentration` parameters. + * + * The `angle` parameter is used to + * determine the radius of the cone. And the `concentration` + * parameter is used to focus the light towards the center of + * the cone. Both parameters are optional, however if you want + * to specify `concentration`, you must also specify `angle`. + * The minimum concentration value is 1. + * + * A maximum of **5** spot lights can be active at once. + * + * Note: lights need to be called (whether directly or indirectly) + * within draw() to remain persistent in a looping program. + * Placing them in setup() will cause them to only have an effect + * the first time through the loop. + * + * @method spotLight + * @param {Number} v1 red or hue value relative to the current color range + * @param {Number} v2 green or saturation value relative to the current color range + * @param {Number} v3 blue or brightness value relative to the current color range + * @param {Number} x x component of position + * @param {Number} y y component of position + * @param {Number} z z component of position + * @param {Number} rx x component of light direction (inclusive range of -1 to 1) + * @param {Number} ry y component of light direction (inclusive range of -1 to 1) + * @param {Number} rz z component of light direction (inclusive range of -1 to 1) + * @param {Number} [angle] angle of cone. Defaults to PI/3 + * @param {Number} [concentration] concentration of cone. Defaults to 100 + * @chainable + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' + * ); + * } + * function draw() { + * background(0); + * // move your mouse to change light position + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * // to set the light position, + * // think of the world's coordinate as: + * // -width/2,-height/2 ----------- width/2,-height/2 + * // | | + * // | 0,0 | + * // | | + * // -width/2,height/2 ----------- width/2,height/2 + * ambientLight(50); + * spotLight(0, 250, 0, locX, locY, 100, 0, 0, -1, Math.PI / 16); + * noStroke(); + * sphere(40); + * } + * + *
                              + * + * @alt + * scene with sphere and spot light. The position of + * the light is controlled with the mouse position. + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color color as a p5.Color, + * as an array, or as a CSS string + * @param {p5.Vector} position position of light as a p5.Vector + * @param {p5.Vector} direction direction of light as a p5.Vector + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position + * @param {p5.Vector} direction + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {p5.Vector} direction + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color + * @param {p5.Vector} position + * @param {Number} rx + * @param {Number} ry + * @param {Number} rz + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {p5.Vector} direction + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {Number} v1 + * @param {Number} v2 + * @param {Number} v3 + * @param {p5.Vector} position + * @param {Number} rx + * @param {Number} ry + * @param {Number} rz + * @param {Number} [angle] + * @param {Number} [concentration] + */ + /** + * @method spotLight + * @param {p5.Color|Number[]|String} color + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {Number} rx + * @param {Number} ry + * @param {Number} rz + * @param {Number} [angle] + * @param {Number} [concentration] + */ + _main.default.prototype.spotLight = function (v1, v2, v3, x, y, z, nx, ny, nz, angle, concentration) { + this._assert3d('spotLight'); + _main.default._validateParameters('spotLight', arguments); + var color, + position, + direction; + var length = arguments.length; + switch (length) { + case 11: + case 10: + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = new _main.default.Vector(nx, ny, nz); + break; + case 9: + if (v1 instanceof _main.default.Color) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = new _main.default.Vector(y, z, nx); + angle = ny; + concentration = nz; + } else if (x instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = new _main.default.Vector(y, z, nx); + angle = ny; + concentration = nz; + } else if (nx instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = nx; + angle = ny; + concentration = nz; + } else { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = new _main.default.Vector(nx, ny, nz); + } + break; + case 8: + if (v1 instanceof _main.default.Color) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = new _main.default.Vector(y, z, nx); + angle = ny; + } else if (x instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = new _main.default.Vector(y, z, nx); + angle = ny; + } else { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = nx; + angle = ny; + } + break; + case 7: + if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector) { + color = v1; + position = v2; + direction = new _main.default.Vector(v3, x, y); + angle = z; + concentration = nx; + } else if (v1 instanceof _main.default.Color && y instanceof _main.default.Vector) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = y; + angle = z; + concentration = nx; + } else if (x instanceof _main.default.Vector && y instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = y; + angle = z; + concentration = nx; + } else if (v1 instanceof _main.default.Color) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = new _main.default.Vector(y, z, nx); + } else if (x instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = new _main.default.Vector(y, z, nx); + } else { + color = this.color(v1, v2, v3); + position = new _main.default.Vector(x, y, z); + direction = nx; + } + break; + case 6: + if (x instanceof _main.default.Vector && y instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = y; + angle = z; + } else if (v1 instanceof _main.default.Color && y instanceof _main.default.Vector) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = y; + angle = z; + } else if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector) { + color = v1; + position = v2; + direction = new _main.default.Vector(v3, x, y); + angle = z; + } + break; + case 5: + if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector && v3 instanceof _main.default.Vector) { + color = v1; + position = v2; + direction = v3; + angle = x; + concentration = y; + } else if (x instanceof _main.default.Vector && y instanceof _main.default.Vector) { + color = this.color(v1, v2, v3); + position = x; + direction = y; + } else if (v1 instanceof _main.default.Color && y instanceof _main.default.Vector) { + color = v1; + position = new _main.default.Vector(v2, v3, x); + direction = y; + } else if (v1 instanceof _main.default.Color && v2 instanceof _main.default.Vector) { + color = v1; + position = v2; + direction = new _main.default.Vector(v3, x, y); + } + break; + case 4: + color = v1; + position = v2; + direction = v3; + angle = x; + break; + case 3: + color = v1; + position = v2; + direction = v3; + break; + default: + console.warn('Sorry, input for spotlight() is not in prescribed format. Too '.concat(length < 3 ? 'few' : 'many', ' arguments were provided')); + return this; + } + this._renderer.spotLightDiffuseColors.push(color._array[0], color._array[1], color._array[2]); + Array.prototype.push.apply(this._renderer.spotLightSpecularColors, this._renderer.specularColors); + this._renderer.spotLightPositions.push(position.x, position.y, position.z); + direction.normalize(); + this._renderer.spotLightDirections.push(direction.x, direction.y, direction.z); + if (angle === undefined) { + angle = Math.PI / 3; + } + if (concentration !== undefined && concentration < 1) { + concentration = 1; + console.warn('Value of concentration needs to be greater than 1. Setting it to 1'); + } else if (concentration === undefined) { + concentration = 100; + } + angle = this._renderer._pInst._toRadians(angle); + this._renderer.spotLightAngle.push(Math.cos(angle)); + this._renderer.spotLightConc.push(concentration); + this._renderer._enableLighting = true; + return this; + }; + /** + * Removes all lights present in a sketch. + * + * All subsequent geometry is rendered without lighting (until a new + * light is created with a call to one of the lighting functions + * (lights(), + * ambientLight(), + * directionalLight(), + * pointLight(), + * spotLight()). + * + * @method noLights + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe( + * 'Three white spheres. Each appears as a different color due to lighting.' + * ); + * } + * function draw() { + * background(200); + * noStroke(); + * + * ambientLight(255, 0, 0); + * translate(-30, 0, 0); + * ambientMaterial(255); + * sphere(13); + * + * noLights(); + * translate(30, 0, 0); + * ambientMaterial(255); + * sphere(13); + * + * ambientLight(0, 255, 0); + * translate(30, 0, 0); + * ambientMaterial(255); + * sphere(13); + * } + * + *
                              + * + * @alt + * Three white spheres. Each appears as a different + * color due to lighting. + */ + _main.default.prototype.noLights = function () { + this._assert3d('noLights'); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('noLights', args); + this._renderer._enableLighting = false; + this._renderer.ambientLightColors.length = 0; + this._renderer.specularColors = [ + 1, + 1, + 1 + ]; + this._renderer.directionalLightDirections.length = 0; + this._renderer.directionalLightDiffuseColors.length = 0; + this._renderer.directionalLightSpecularColors.length = 0; + this._renderer.pointLightPositions.length = 0; + this._renderer.pointLightDiffuseColors.length = 0; + this._renderer.pointLightSpecularColors.length = 0; + this._renderer.spotLightPositions.length = 0; + this._renderer.spotLightDirections.length = 0; + this._renderer.spotLightDiffuseColors.length = 0; + this._renderer.spotLightSpecularColors.length = 0; + this._renderer.spotLightAngle.length = 0; + this._renderer.spotLightConc.length = 0; + this._renderer.constantAttenuation = 1; + this._renderer.linearAttenuation = 0; + this._renderer.quadraticAttenuation = 0; + this._renderer._useShininess = 1; + return this; + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298 + } + ], + 345: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.splice'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.match'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.trim'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + _dereq_('./p5.Geometry'); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module Shape + * @submodule 3D Models + * @for p5 + * @requires core + * @requires p5.Geometry + */ + /** + * Load a 3d model from an OBJ or STL file. + * + * loadModel() should be placed inside of preload(). + * This allows the model to load fully before the rest of your code is run. + * + * One of the limitations of the OBJ and STL format is that it doesn't have a built-in + * sense of scale. This means that models exported from different programs might + * be very different sizes. If your model isn't displaying, try calling + * loadModel() with the normalized parameter set to true. This will resize the + * model to a scale appropriate for p5. You can also make additional changes to + * the final size of your model with the scale() function. + * + * Also, the support for colored STL files is not present. STL files with color will be + * rendered without color properties. + * + * @method loadModel + * @param {String} path Path of the model to be loaded + * @param {Boolean} normalize If true, scale the model to a + * standardized size when loading + * @param {function(p5.Geometry)} [successCallback] Function to be called + * once the model is loaded. Will be passed + * the 3D model object. + * @param {function(Event)} [failureCallback] called with event error if + * the model fails to load. + * @param {String} [fileType] The file extension of the model + * (.stl, .obj). + * @return {p5.Geometry} the p5.Geometry object + * + * @example + *
                              + * + * //draw a spinning octahedron + * let octahedron; + * + * function preload() { + * octahedron = loadModel('assets/octahedron.obj'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d octahedron.'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * model(octahedron); + * } + * + *
                              + * + * @alt + * Vertically rotating 3-d octahedron. + * + * @example + *
                              + * + * //draw a spinning teapot + * let teapot; + * + * function preload() { + * // Load model with normalise parameter set to true + * teapot = loadModel('assets/teapot.obj', true); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); + * } + * + * function draw() { + * background(200); + * scale(0.4); // Scaled to make model fit into canvas + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * normalMaterial(); // For effect + * model(teapot); + * } + * + *
                              + * + * @alt + * Vertically rotating 3-d teapot with red, green and blue gradient. + */ + /** + * @method loadModel + * @param {String} path + * @param {function(p5.Geometry)} [successCallback] + * @param {function(Event)} [failureCallback] + * @param {String} [fileType] + * @return {p5.Geometry} the p5.Geometry object + */ + + _main.default.prototype.loadModel = function (path) { + _main.default._validateParameters('loadModel', arguments); + var normalize; + var successCallback; + var failureCallback; + var fileType = path.slice( - 4); + if (typeof arguments[1] === 'boolean') { + normalize = arguments[1]; + successCallback = arguments[2]; + failureCallback = arguments[3]; + if (typeof arguments[4] !== 'undefined') { + fileType = arguments[4]; + } + } else { + normalize = false; + successCallback = arguments[1]; + failureCallback = arguments[2]; + if (typeof arguments[3] !== 'undefined') { + fileType = arguments[3]; + } + } + var model = new _main.default.Geometry(); + model.gid = ''.concat(path, '|').concat(normalize); + var self = this; + if (fileType.match(/\.stl$/i)) { + this.httpDo(path, 'GET', 'arrayBuffer', function (arrayBuffer) { + parseSTL(model, arrayBuffer); + if (normalize) { + model.normalize(); + } + self._decrementPreload(); + if (typeof successCallback === 'function') { + successCallback(model); + } + }, failureCallback); + } else if (fileType.match(/\.obj$/i)) { + this.loadStrings(path, function (strings) { + parseObj(model, strings); + if (normalize) { + model.normalize(); + } + self._decrementPreload(); + if (typeof successCallback === 'function') { + successCallback(model); + } + }, failureCallback); + } else { + _main.default._friendlyFileLoadError(3, path); + if (failureCallback) { + failureCallback(); + } else { + _main.default._friendlyError('Sorry, the file type is invalid. Only OBJ and STL files are supported.'); + } + } + return model; + }; + /** + * Parse OBJ lines into model. For reference, this is what a simple model of a + * square might look like: + * + * v -0.5 -0.5 0.5 + * v -0.5 -0.5 -0.5 + * v -0.5 0.5 -0.5 + * v -0.5 0.5 0.5 + * + * f 4 3 2 1 + */ + function parseObj(model, lines) { + // OBJ allows a face to specify an index for a vertex (in the above example), + // but it also allows you to specify a custom combination of vertex, UV + // coordinate, and vertex normal. So, "3/4/3" would mean, "use vertex 3 with + // UV coordinate 4 and vertex normal 3". In WebGL, every vertex with different + // parameters must be a different vertex, so loadedVerts is used to + // temporarily store the parsed vertices, normals, etc., and indexedVerts is + // used to map a specific combination (keyed on, for example, the string + // "3/4/3"), to the actual index of the newly created vertex in the final + // object. + var loadedVerts = { + v: [ + ], + vt: [ + ], + vn: [ + ] + }; + var indexedVerts = { + }; + for (var line = 0; line < lines.length; ++line) { + // Each line is a separate object (vertex, face, vertex normal, etc) + // For each line, split it into tokens on whitespace. The first token + // describes the type. + var tokens = lines[line].trim().split(/\b\s+/); + if (tokens.length > 0) { + if (tokens[0] === 'v' || tokens[0] === 'vn') { + // Check if this line describes a vertex or vertex normal. + // It will have three numeric parameters. + var vertex = new _main.default.Vector(parseFloat(tokens[1]), parseFloat(tokens[2]), parseFloat(tokens[3])); + loadedVerts[tokens[0]].push(vertex); + } else if (tokens[0] === 'vt') { + // Check if this line describes a texture coordinate. + // It will have two numeric parameters U and V (W is omitted). + // Because of WebGL texture coordinates rendering behaviour, the V + // coordinate is inversed. + var texVertex = [ + parseFloat(tokens[1]), + 1 - parseFloat(tokens[2]) + ]; + loadedVerts[tokens[0]].push(texVertex); + } else if (tokens[0] === 'f') { + // Check if this line describes a face. + // OBJ faces can have more than three points. Triangulate points. + for (var tri = 3; tri < tokens.length; ++tri) { + var face = [ + ]; + var vertexTokens = [ + 1, + tri - 1, + tri + ]; + for (var tokenInd = 0; tokenInd < vertexTokens.length; ++tokenInd) { + // Now, convert the given token into an index + var vertString = tokens[vertexTokens[tokenInd]]; + var vertIndex = 0; + // TODO: Faces can technically use negative numbers to refer to the + // previous nth vertex. I haven't seen this used in practice, but + // it might be good to implement this in the future. + if (indexedVerts[vertString] !== undefined) { + vertIndex = indexedVerts[vertString]; + } else { + var vertParts = vertString.split('/'); + for (var i = 0; i < vertParts.length; i++) { + vertParts[i] = parseInt(vertParts[i]) - 1; + } + vertIndex = indexedVerts[vertString] = model.vertices.length; + model.vertices.push(loadedVerts.v[vertParts[0]].copy()); + if (loadedVerts.vt[vertParts[1]]) { + model.uvs.push(loadedVerts.vt[vertParts[1]].slice()); + } else { + model.uvs.push([0, + 0]); + } + if (loadedVerts.vn[vertParts[2]]) { + model.vertexNormals.push(loadedVerts.vn[vertParts[2]].copy()); + } + } + face.push(vertIndex); + } + if (face[0] !== face[1] && face[0] !== face[2] && face[1] !== face[2]) { + model.faces.push(face); + } + } + } + } + } // If the model doesn't have normals, compute the normals - function race(entries) { - /*jshint validthis:true */ - var Constructor = this; - if (!isArray(entries)) { - return new Constructor(function (_, reject) { - return reject( - new TypeError("You must pass an array to race."), - ); - }); - } else { - return new Constructor(function (resolve, reject) { - var length = entries.length; - for (var i = 0; i < length; i++) { - Constructor.resolve(entries[i]).then(resolve, reject); - } - }); - } - } /** - `Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @param {Any} reason value that the returned promise will be rejected with. - Useful for tooling. - @return {Promise} a promise rejected with the given `reason`. - */ + if (model.vertexNormals.length === 0) { + model.computeNormals(); + } + return model; + } /** + * STL files can be of two types, ASCII and Binary, + * + * We need to convert the arrayBuffer to an array of strings, + * to parse it as an ASCII file. + */ + + function parseSTL(model, buffer) { + if (isBinary(buffer)) { + parseBinarySTL(model, buffer); + } else { + var reader = new DataView(buffer); + if (!('TextDecoder' in window)) { + console.warn('Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)'); + return model; + } + var decoder = new TextDecoder('utf-8'); + var lines = decoder.decode(reader); + var lineArray = lines.split('\n'); + parseASCIISTL(model, lineArray); + } + return model; + } /** + * This function checks if the file is in ASCII format or in Binary format + * + * It is done by searching keyword `solid` at the start of the file. + * + * An ASCII STL data must begin with `solid` as the first six bytes. + * However, ASCII STLs lacking the SPACE after the `d` are known to be + * plentiful. So, check the first 5 bytes for `solid`. + * + * Several encodings, such as UTF-8, precede the text with up to 5 bytes: + * https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding + * Search for `solid` to start anywhere after those prefixes. + */ + + function isBinary(data) { + var reader = new DataView(data); + // US-ASCII ordinal values for `s`, `o`, `l`, `i`, `d` + var solid = [ + 115, + 111, + 108, + 105, + 100 + ]; + for (var off = 0; off < 5; off++) { + // If "solid" text is matched to the current offset, declare it to be an ASCII STL. + if (matchDataViewAt(solid, reader, off)) return false; + } // Couldn't find "solid" text at the beginning; it is binary STL. + + return true; + } /** + * This function matches the `query` at the provided `offset` + */ + + function matchDataViewAt(query, reader, offset) { + // Check if each byte in query matches the corresponding byte from the current offset + for (var i = 0, il = query.length; i < il; i++) { + if (query[i] !== reader.getUint8(offset + i, false)) return false; + } + return true; + } /** + * This function parses the Binary STL files. + * https://en.wikipedia.org/wiki/STL_%28file_format%29#Binary_STL + * + * Currently there is no support for the colors provided in STL files. + */ + + function parseBinarySTL(model, buffer) { + var reader = new DataView(buffer); + // Number of faces is present following the header + var faces = reader.getUint32(80, true); + var r, + g, + b, + hasColors = false, + colors; + var defaultR, + defaultG, + defaultB; + // Binary files contain 80-byte header, which is generally ignored. + for (var index = 0; index < 80 - 10; index++) { + // Check for `COLOR=` + if (reader.getUint32(index, false) === 1129270351 /*COLO*/ && reader.getUint8(index + 4) === 82 /*'R'*/ && reader.getUint8(index + 5) === 61 /*'='*/ ) { + hasColors = true; + colors = [ + ]; + defaultR = reader.getUint8(index + 6) / 255; + defaultG = reader.getUint8(index + 7) / 255; + defaultB = reader.getUint8(index + 8) / 255; + // To be used when color support is added + // alpha = reader.getUint8(index + 9) / 255; + } + } + var dataOffset = 84; + var faceLength = 12 * 4 + 2; + // Iterate the faces + for (var face = 0; face < faces; face++) { + var start = dataOffset + face * faceLength; + var normalX = reader.getFloat32(start, true); + var normalY = reader.getFloat32(start + 4, true); + var normalZ = reader.getFloat32(start + 8, true); + if (hasColors) { + var packedColor = reader.getUint16(start + 48, true); + if ((packedColor & 32768) === 0) { + // facet has its own unique color + r = (packedColor & 31) / 31; + g = (packedColor >> 5 & 31) / 31; + b = (packedColor >> 10 & 31) / 31; + } else { + r = defaultR; + g = defaultG; + b = defaultB; + } + } + var newNormal = new _main.default.Vector(normalX, normalY, normalZ); + for (var i = 1; i <= 3; i++) { + var vertexstart = start + i * 12; + var newVertex = new _main.default.Vector(reader.getFloat32(vertexstart, true), reader.getFloat32(vertexstart + 4, true), reader.getFloat32(vertexstart + 8, true)); + model.vertices.push(newVertex); + model.vertexNormals.push(newNormal); + if (hasColors) { + colors.push(r, g, b); + } + } + model.faces.push([3 * face, + 3 * face + 1, + 3 * face + 2]); + model.uvs.push([0, + 0], [ + 0, + 0 + ], [ + 0, + 0 + ]); + } + if (hasColors) { + // add support for colors here. + } + return model; + } /** + * ASCII STL file starts with `solid 'nameOfFile'` + * Then contain the normal of the face, starting with `facet normal` + * Next contain a keyword indicating the start of face vertex, `outer loop` + * Next comes the three vertex, starting with `vertex x y z` + * Vertices ends with `endloop` + * Face ends with `endfacet` + * Next face starts with `facet normal` + * The end of the file is indicated by `endsolid` + */ + + function parseASCIISTL(model, lines) { + var state = ''; + var curVertexIndex = [ + ]; + var newNormal, + newVertex; + for (var iterator = 0; iterator < lines.length; ++iterator) { + var line = lines[iterator].trim(); + var parts = line.split(' '); + for (var partsiterator = 0; partsiterator < parts.length; ++partsiterator) { + if (parts[partsiterator] === '') { + // Ignoring multiple whitespaces + parts.splice(partsiterator, 1); + } + } + if (parts.length === 0) { + // Remove newline + continue; + } + switch (state) { + case '': + // First run + if (parts[0] !== 'solid') { + // Invalid state + console.error(line); + console.error('Invalid state "'.concat(parts[0], '", should be "solid"')); + return; + } else { + state = 'solid'; + } + break; + case 'solid': + // First face + if (parts[0] !== 'facet' || parts[1] !== 'normal') { + // Invalid state + console.error(line); + console.error('Invalid state "'.concat(parts[0], '", should be "facet normal"')); + return; + } else { + // Push normal for first face + newNormal = new _main.default.Vector(parseFloat(parts[2]), parseFloat(parts[3]), parseFloat(parts[4])); + model.vertexNormals.push(newNormal, newNormal, newNormal); + state = 'facet normal'; + } + break; + case 'facet normal': + // After normal is defined + if (parts[0] !== 'outer' || parts[1] !== 'loop') { + // Invalid State + console.error(line); + console.error('Invalid state "'.concat(parts[0], '", should be "outer loop"')); + return; + } else { + // Next should be vertices + state = 'vertex'; + } + break; + case 'vertex': + if (parts[0] === 'vertex') { + //Vertex of triangle + newVertex = new _main.default.Vector(parseFloat(parts[1]), parseFloat(parts[2]), parseFloat(parts[3])); + model.vertices.push(newVertex); + model.uvs.push([0, + 0]); + curVertexIndex.push(model.vertices.indexOf(newVertex)); + } else if (parts[0] === 'endloop') { + // End of vertices + model.faces.push(curVertexIndex); + curVertexIndex = [ + ]; + state = 'endloop'; + } else { + // Invalid State + console.error(line); + console.error('Invalid state "'.concat(parts[0], '", should be "vertex" or "endloop"')); + return; + } + break; + case 'endloop': + if (parts[0] !== 'endfacet') { + // End of face + console.error(line); + console.error('Invalid state "'.concat(parts[0], '", should be "endfacet"')); + return; + } else { + state = 'endfacet'; + } + break; + case 'endfacet': + if (parts[0] === 'endsolid') { + // End of solid + } else if (parts[0] === 'facet' && parts[1] === 'normal') { + // Next face + newNormal = new _main.default.Vector(parseFloat(parts[2]), parseFloat(parts[3]), parseFloat(parts[4])); + model.vertexNormals.push(newNormal, newNormal, newNormal); + state = 'facet normal'; + } else { + // Invalid State + console.error(line); + console.error('Invalid state "'.concat(parts[0], '", should be "endsolid" or "facet normal"')); + return; + } + break; + default: + console.error('Invalid state "'.concat(state, '"')); + break; + } + } + return model; + } /** + * Render a 3d model to the screen. + * + * @method model + * @param {p5.Geometry} model Loaded 3d model to be rendered + * @example + *
                              + * + * //draw a spinning octahedron + * let octahedron; + * + * function preload() { + * octahedron = loadModel('assets/octahedron.obj'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Vertically rotating 3-d octahedron.'); + * } + * + * function draw() { + * background(200); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * model(octahedron); + * } + * + *
                              + * + * @alt + * Vertically rotating 3-d octahedron. + */ + + _main.default.prototype.model = function (model) { + this._assert3d('model'); + _main.default._validateParameters('model', arguments); + if (model.vertices.length > 0) { + if (!this._renderer.geometryInHash(model.gid)) { + if (model.edges.length === 0) { + model._makeTriangleEdges(); + } + model._edgesToVertices(); + this._renderer.createBuffers(model.gid, model); + } + this._renderer.drawBuffers(model.gid); + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/main': 298, + './p5.Geometry': 350, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.splice': 185, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.match': 211, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.trim': 219 + } + ], + 346: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.join'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + _dereq_('./p5.Texture'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } /** + * @module 3D + * @submodule Material + * @for p5 + * @requires core + */ + /** + * Creates a new p5.Shader object + * from the provided vertex and fragment shader files. + * + * The shader files are loaded asynchronously in the + * background, so this method should be used in preload(). + * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. + * + * Note, shaders can only be used in WEBGL mode. + * + * @method loadShader + * @param {String} vertFilename path to file containing vertex shader + * source code + * @param {String} fragFilename path to file containing fragment shader + * source code + * @param {function} [callback] callback to be executed after loadShader + * completes. On success, the p5.Shader object is passed as the first argument. + * @param {function} [errorCallback] callback to be executed when an error + * occurs inside loadShader. On error, the error is passed as the first + * argument. + * @return {p5.Shader} a shader object created from the provided + * vertex and fragment shader files. + * + * @example + *
                              + * + * let mandel; + * function preload() { + * // load the shader definitions from files + * mandel = loadShader('assets/shader.vert', 'assets/shader.frag'); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * // use the shader + * shader(mandel); + * noStroke(); + * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); + * } + * + * function draw() { + * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); + * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * } + * + *
                              + * + * @alt + * zooming Mandelbrot set. a colorful, infinitely detailed fractal. + */ - function reject$1(reason) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop); - reject(promise, reason); - return promise; - } - function needsResolver() { - throw new TypeError( - "You must pass a resolver function as the first argument to the promise constructor", - ); - } - function needsNew() { - throw new TypeError( - "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.", - ); - } /** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); + _main.default.prototype.loadShader = function (vertFilename, fragFilename, callback, errorCallback) { + _main.default._validateParameters('loadShader', arguments); + if (!errorCallback) { + errorCallback = console.error; + } + var loadedShader = new _main.default.Shader(); + var self = this; + var loadedFrag = false; + var loadedVert = false; + var onLoad = function onLoad() { + self._decrementPreload(); + if (callback) { + callback(loadedShader); + } + }; + this.loadStrings(vertFilename, function (result) { + loadedShader._vertSrc = result.join('\n'); + loadedVert = true; + if (loadedFrag) { + onLoad(); + } + }, errorCallback); + this.loadStrings(fragFilename, function (result) { + loadedShader._fragSrc = result.join('\n'); + loadedFrag = true; + if (loadedVert) { + onLoad(); + } + }, errorCallback); + return loadedShader; + }; + /** + * Creates a new p5.Shader object + * from the provided vertex and fragment shader code. + * + * Note, shaders can only be used in WEBGL mode. + * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader shown in the example below. + * + * @method createShader + * @param {String} vertSrc source code for the vertex shader + * @param {String} fragSrc source code for the fragment shader + * @returns {p5.Shader} a shader object created from the provided + * vertex and fragment shaders. + * + * @example + *
                              + * + * + * // the vertex shader is called for each vertex + * let vs = ` + * precision highp float; + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * varying vec2 vTexCoord; + * + * void main() { + * vTexCoord = aTexCoord; + * vec4 positionVec4 = vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; + * } + * `; + * + * + * // the fragment shader is called for each pixel + * let fs = ` + * precision highp float; + * uniform vec2 p; + * uniform float r; + * const int I = 500; + * varying vec2 vTexCoord; + * void main() { + * vec2 c = p + gl_FragCoord.xy * r, z = c; + * float n = 0.0; + * for (int i = I; i > 0; i --) { + * if(z.x*z.x+z.y*z.y > 4.0) { + * n = float(i)/float(I); + * break; + * } + * z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c; + * } + * gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0); + * }`; + * + * let mandel; + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * // create and initialize the shader + * mandel = createShader(vs, fs); + * shader(mandel); + * noStroke(); + * + * // 'p' is the center point of the Mandelbrot image + * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); + * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); + * } + * + * function draw() { + * // 'r' is the size of the image in Mandelbrot-space + * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); + * plane(width, height); + * } + * + *
                              + * + * @alt + * zooming Mandelbrot set. a colorful, infinitely detailed fractal. + */ + _main.default.prototype.createShader = function (vertSrc, fragSrc) { + _main.default._validateParameters('createShader', arguments); + return new _main.default.Shader(this._renderer, vertSrc, fragSrc); + }; + /** + * Creates a new p5.Shader using only a fragment shader, as a convenience method for creating image effects. + * It's like createShader() but with a default vertex shader included. + * + * createFilterShader() is intended to be used along with filter() for filtering the contents of a canvas. + * A filter shader will not be applied to any geometries. + * + * The fragment shader receives some uniforms: + * - `sampler2D tex0`, which contains the canvas contents as a texture +* - `vec2 canvasSize`, which is the p5 width and height of the canvas (not including pixel density) + * - `vec2 texelSize`, which is the size of a physical pixel including pixel density (`1.0/(width*density)`, `1.0/(height*density)`) + * + * For more info about filters and shaders, see Adam Ferriss' repo of shader examples + * or the introduction to shaders page. + * + * @method createFilterShader + * @param {String} fragSrc source code for the fragment shader + * @returns {p5.Shader} a shader object created from the provided + * fragment shader. + * @example + *
                              + * + * function setup() { + * let fragSrc = `precision highp float; + * void main() { + * gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + * }`; + * + * createCanvas(100, 100, WEBGL); + * let s = createFilterShader(fragSrc); + * filter(s); + * describe('a yellow canvas'); + * } + * + *
                              + * + *
                              + * + * let img, s; + * function preload() { + * img = loadImage('assets/bricks.jpg'); + * } + * function setup() { + * let fragSrc = `precision highp float; + * + * // x,y coordinates, given from the vertex shader + * varying vec2 vTexCoord; + * + * // the canvas contents, given from filter() + * uniform sampler2D tex0; + * // other useful information from the canvas + * uniform vec2 texelSize; + * uniform vec2 canvasSize; + * // a custom variable from this sketch + * uniform float darkness; + * + * void main() { + * // get the color at current pixel + * vec4 color = texture2D(tex0, vTexCoord); + * // set the output color + * color.b = 1.0; + * color *= darkness; + * gl_FragColor = vec4(color.rgb, 1.0); + * }`; + * + * createCanvas(100, 100, WEBGL); + * s = createFilterShader(fragSrc); + * } + * function draw() { + * image(img, -50, -50); + * s.setUniform('darkness', 0.5); + * filter(s); + * describe('a image of bricks tinted dark blue'); + * } + * + *
                              + */ + _main.default.prototype.createFilterShader = function (fragSrc) { + _main.default._validateParameters('createFilterShader', arguments); + var defaultVertV1 = '\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n '; + var defaultVertV2 = '#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n '; + var vertSrc = fragSrc.includes('#version 300 es') ? defaultVertV2 : defaultVertV1; + var shader = new _main.default.Shader(this._renderer, vertSrc, fragSrc); + if (this._renderer.GL) { + shader.ensureCompiledOnContext(this); + } else { + shader.ensureCompiledOnContext(this._renderer.getFilterGraphicsLayer()); + } + return shader; + }; + /** + * Sets the p5.Shader object to + * be used to render subsequent shapes. + * + * Shaders can alter the positioning of shapes drawn with them. + * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. + * + * Custom shaders can be created using the + * createShader() and + * loadShader() functions. + * + * Use resetShader() to + * restore the default shaders. + * + * Note, shaders can only be used in WEBGL mode. + * + * @method shader + * @chainable + * @param {p5.Shader} s the p5.Shader object + * to use for rendering shapes. + * + * @example + *
                              + * + * // Click within the image to toggle + * // the shader used by the quad shape + * // Note: for an alternative approach to the same example, + * // involving changing uniforms please refer to: + * // https://p5js.org/reference/#/p5.Shader/setUniform + * + * let redGreen; + * let orangeBlue; + * let showRedGreen = false; + * + * function preload() { + * // note that we are using two instances + * // of the same vertex and fragment shaders + * redGreen = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); + * orangeBlue = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * // initialize the colors for redGreen shader + * shader(redGreen); + * redGreen.setUniform('colorCenter', [1.0, 0.0, 0.0]); + * redGreen.setUniform('colorBackground', [0.0, 1.0, 0.0]); + * + * // initialize the colors for orangeBlue shader + * shader(orangeBlue); + * orangeBlue.setUniform('colorCenter', [1.0, 0.5, 0.0]); + * orangeBlue.setUniform('colorBackground', [0.226, 0.0, 0.615]); + * + * noStroke(); + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); + * } + * + * function draw() { + * // update the offset values for each shader, + * // moving orangeBlue in vertical and redGreen + * // in horizontal direction + * orangeBlue.setUniform('offset', [0, sin(millis() / 2000) + 1]); + * redGreen.setUniform('offset', [sin(millis() / 2000), 1]); + * + * if (showRedGreen === true) { + * shader(redGreen); + * } else { + * shader(orangeBlue); + * } + * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * } + * + * function mouseClicked() { + * showRedGreen = !showRedGreen; + * } + * + *
                              + * + * @alt + * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. + */ + _main.default.prototype.shader = function (s) { + this._assert3d('shader'); + _main.default._validateParameters('shader', arguments); + s.ensureCompiledOnContext(this); + if (s.isStrokeShader()) { + this._renderer.userStrokeShader = s; + } else { + this._renderer.userFillShader = s; + this._renderer._useNormalMaterial = false; + } + return this; + }; + /** + * Restores the default shaders. Code that runs after resetShader() + * will not be affected by the shader previously set by + * shader() + * + * @method resetShader + * @chainable + * @example + *
                              + * + * // This variable will hold our shader object + * let shaderProgram; + * + * // This variable will hold our vertex shader source code + * let vertSrc = ` + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * uniform mat4 uProjectionMatrix; + * uniform mat4 uModelViewMatrix; + * varying vec2 vTexCoord; + * + * void main() { + * vTexCoord = aTexCoord; + * vec4 position = vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * uModelViewMatrix * position; + * } + * `; + * + * // This variable will hold our fragment shader source code + * let fragSrc = ` + * precision mediump float; + * + * varying vec2 vTexCoord; + * + * void main() { + * vec2 uv = vTexCoord; + * vec3 color = vec3(uv.x, uv.y, min(uv.x + uv.y, 1.0)); + * gl_FragColor = vec4(color, 1.0); + * } + * `; + * + * function setup() { + * // Shaders require WEBGL mode to work + * createCanvas(100, 100, WEBGL); + * + * // Create our shader + * shaderProgram = createShader(vertSrc, fragSrc); + * + * describe( + * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' + * ); + * } + * + * function draw() { + * // Clear the scene + * background(200); + * + * // Draw a box using our shader + * // shader() sets the active shader with our shader + * shader(shaderProgram); + * push(); + * translate(-width / 4, 0, 0); + * rotateX(millis() * 0.00025); + * rotateY(millis() * 0.0005); + * box(width / 4); + * pop(); + * + * // Draw a box using the default fill shader + * // resetShader() restores the default fill shader + * resetShader(); + * fill(255, 0, 0); + * push(); + * translate(width / 4, 0, 0); + * rotateX(millis() * 0.00025); + * rotateY(millis() * 0.0005); + * box(width / 4); + * pop(); + * } + * + *
                              + * @alt + * Two rotating cubes. The left one is painted using a custom (user-defined) shader, + * while the right one is painted using the default fill shader. + */ + _main.default.prototype.resetShader = function () { + this._renderer.userFillShader = this._renderer.userStrokeShader = null; + return this; + }; + /** + * Sets the texture that will be used to render subsequent shapes. + * + * A texture is like a "skin" that wraps around a 3D geometry. Currently + * supported textures are images, video, and offscreen renders. + * + * To texture a geometry created with beginShape(), + * you will need to specify uv coordinates in vertex(). + * + * Note, texture() can only be used in WEBGL mode. + * + * You can view more materials in this + * example. + * + * @method texture + * @param {p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} tex image to use as texture + * @chainable + * @example + *
                              + * + * let img; + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('spinning cube with a texture from an image'); + * } + * + * function draw() { + * background(0); + * rotateZ(frameCount * 0.01); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * //pass image as texture + * texture(img); + * box(width / 2); + * } + * + *
                              + * @alt + * spinning cube with a texture from an image + * + * @example + *
                              + * + * let pg; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * pg = createGraphics(200, 200); + * pg.textSize(75); + * describe('plane with a texture from an image created by createGraphics()'); + * } + * + * function draw() { + * background(0); + * pg.background(255); + * pg.text('hello!', 0, 100); + * //pass image as texture + * texture(pg); + * rotateX(0.5); + * noStroke(); + * plane(50); + * } + * + *
                              + * @alt + * plane with a texture from an image created by createGraphics() + * + * @example + *
                              + * + * let vid; + * function preload() { + * vid = createVideo('assets/fingers.mov'); + * vid.hide(); + * } + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('rectangle with video as texture'); + * } + * + * function draw() { + * background(0); + * //pass video frame as texture + * texture(vid); + * rect(-40, -40, 80, 80); + * } + * + * function mousePressed() { + * vid.loop(); + * } + * + *
                              + * + * @alt + * rectangle with video as texture + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using normalized coordinates'); + * } + * + * function draw() { + * background(0); + * texture(img); + * textureMode(NORMAL); + * beginShape(); + * vertex(-40, -40, 0, 0); + * vertex(40, -40, 1, 0); + * vertex(40, 40, 1, 1); + * vertex(-40, 40, 0, 1); + * endShape(); + * } + * + *
                              + * @alt + * quad with a texture, mapped using normalized coordinates + */ + _main.default.prototype.texture = function (tex) { + this._assert3d('texture'); + _main.default._validateParameters('texture', arguments); + if (tex.gifProperties) { + tex._animateGif(this); + } + this._renderer.drawMode = constants.TEXTURE; + this._renderer._useNormalMaterial = false; + this._renderer._tex = tex; + this._renderer._setProperty('_doFill', true); + return this; + }; + /** + * Sets the coordinate space for texture mapping. The default mode is IMAGE + * which refers to the actual coordinates of the image. + * NORMAL refers to a normalized space of values ranging from 0 to 1. + * + * With IMAGE, if an image is 100×200 pixels, mapping the image onto the entire + * size of a quad would require the points (0,0) (100, 0) (100,200) (0,200). + * The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1). + * @method textureMode + * @param {Constant} mode either IMAGE or NORMAL + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using normalized coordinates'); + * } + * + * function draw() { + * texture(img); + * textureMode(NORMAL); + * beginShape(); + * vertex(-50, -50, 0, 0); + * vertex(50, -50, 1, 0); + * vertex(50, 50, 1, 1); + * vertex(-50, 50, 0, 1); + * endShape(); + * } + * + *
                              + * @alt + * quad with a texture, mapped using normalized coordinates + * + * @example + *
                              + * + * let img; + * + * function preload() { + * img = loadImage('assets/laDefense.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('quad with a texture, mapped using image coordinates'); + * } + * + * function draw() { + * texture(img); + * textureMode(IMAGE); + * beginShape(); + * vertex(-50, -50, 0, 0); + * vertex(50, -50, img.width, 0); + * vertex(50, 50, img.width, img.height); + * vertex(-50, 50, 0, img.height); + * endShape(); + * } + * + *
                              + * @alt + * quad with a texture, mapped using image coordinates + */ + _main.default.prototype.textureMode = function (mode) { + if (mode !== constants.IMAGE && mode !== constants.NORMAL) { + console.warn('You tried to set '.concat(mode, ' textureMode only supports IMAGE & NORMAL ')); + } else { + this._renderer.textureMode = mode; + } + }; + /** + * Sets the global texture wrapping mode. This controls how textures behave + * when their uv's go outside of the 0 to 1 range. There are three options: + * CLAMP, REPEAT, and MIRROR. + * + * CLAMP causes the pixels at the edge of the texture to extend to the bounds. + * REPEAT causes the texture to tile repeatedly until reaching the bounds. + * MIRROR works similarly to REPEAT but it flips the texture with every new tile. + * + * REPEAT & MIRROR are only available if the texture + * is a power of two size (128, 256, 512, 1024, etc.). + * + * This method will affect all textures in your sketch until a subsequent + * textureWrap() call is made. + * + * If only one argument is provided, it will be applied to both the + * horizontal and vertical axes. + * @method textureWrap + * @param {Constant} wrapX either CLAMP, REPEAT, or MIRROR + * @param {Constant} [wrapY] either CLAMP, REPEAT, or MIRROR + * @example + *
                              + * + * let img; + * function preload() { + * img = loadImage('assets/rockies128.jpg'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * textureWrap(MIRROR); + * describe('an image of the rocky mountains repeated in mirrored tiles'); + * } + * + * function draw() { + * background(0); + * + * let dX = mouseX; + * let dY = mouseY; + * + * let u = lerp(1.0, 2.0, dX); + * let v = lerp(1.0, 2.0, dY); + * + * scale(width / 2); + * + * texture(img); + * + * beginShape(TRIANGLES); + * vertex(-1, -1, 0, 0, 0); + * vertex(1, -1, 0, u, 0); + * vertex(1, 1, 0, u, v); + * + * vertex(1, 1, 0, u, v); + * vertex(-1, 1, 0, 0, v); + * vertex(-1, -1, 0, 0, 0); + * endShape(); + * } + * + *
                              + * + * @alt + * an image of the rocky mountains repeated in mirrored tiles + */ + _main.default.prototype.textureWrap = function (wrapX) { + var wrapY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : wrapX; + this._renderer.textureWrapX = wrapX; + this._renderer.textureWrapY = wrapY; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this._renderer.textures.values() [Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var texture = _step.value; + texture.setWrapMode(wrapX, wrapY); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } } } }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class Promise - @param {Function} resolver - Useful for tooling. - @constructor - */ - - var Promise$1 = (function () { - function Promise(resolver) { - this[PROMISE_ID] = nextId(); - this._result = this._state = undefined; - this._subscribers = []; - if (noop !== resolver) { - typeof resolver !== "function" && needsResolver(); - this instanceof Promise - ? initializePromise(this, resolver) - : needsNew(); - } - } /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - Assimilation - ------------ - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - If the assimliated promise rejects, then the downstream promise will also reject. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - Simple Example - -------------- - Synchronous Example - ```javascript - let result; - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - Promise Example; - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - Advanced Example - -------------- - Synchronous Example - ```javascript - let author, books; - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - function foundBooks(books) { - } - function failure(reason) { - } - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); + /** + * Sets the current material as a normal material. + * + * A normal material is not affected by light. It is often used as + * a placeholder material when debugging. + * + * Surfaces facing the X-axis become red, those facing the Y-axis + * become green, and those facing the Z-axis become blue. + * + * You can view more materials in this + * example. + * + * @method normalMaterial + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('Sphere with normal material'); + * } + * + * function draw() { + * background(200); + * normalMaterial(); + * sphere(40); + * } + * + *
                              + * @alt + * Sphere with normal material + */ + _main.default.prototype.normalMaterial = function () { + this._assert3d('normalMaterial'); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('normalMaterial', args); + this._renderer.drawMode = constants.FILL; + this._renderer._useSpecularMaterial = false; + this._renderer._useEmissiveMaterial = false; + this._renderer._useNormalMaterial = true; + this._renderer.curFillColor = [ + 1, + 1, + 1, + 1 + ]; + this._renderer._setProperty('_doFill', true); + this.noStroke(); + return this; + }; + /** + * Sets the ambient color of the material. + * + * The ambientMaterial() color represents the components + * of the **ambientLight()** color that the object reflects. + * + * Consider an ambientMaterial() with the color yellow (255, 255, 0). + * If the ambientLight() emits the color white (255, 255, 255), then the object + * will appear yellow as it will reflect the red and green components + * of the light. If the ambientLight() emits the color red (255, 0, 0), then + * the object will appear red as it will reflect the red component + * of the light. If the ambientLight() emits the color blue (0, 0, 255), + * then the object will appear black, as there is no component of + * the light that it can reflect. + * + * You can view more materials in this + * example. + * + * @method ambientMaterial + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('sphere reflecting red, blue, and green light'); + * } + * function draw() { + * background(0); + * noStroke(); + * ambientLight(255); + * ambientMaterial(70, 130, 230); + * sphere(40); + * } + * + *
                              + * @alt + * sphere reflecting red, blue, and green light + * + * @example + *
                              + * + * // ambientLight is both red and blue (magenta), + * // so object only reflects it's red and blue components + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('box reflecting only red and blue light'); + * } + * function draw() { + * background(70); + * ambientLight(255, 0, 255); // magenta light + * ambientMaterial(255); // white material + * box(30); + * } + * + *
                              + * @alt + * box reflecting only red and blue light + * + * @example + *
                              + * + * // ambientLight is green. Since object does not contain + * // green, it does not reflect any light + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('box reflecting no light'); + * } + * function draw() { + * background(70); + * ambientLight(0, 255, 0); // green light + * ambientMaterial(255, 0, 255); // magenta material + * box(30); + * } + * + *
                              + * @alt + * box reflecting no light + */ + /** + * @method ambientMaterial + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + /** + * @method ambientMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string + * @chainable + */ + _main.default.prototype.ambientMaterial = function (v1, v2, v3) { + this._assert3d('ambientMaterial'); + _main.default._validateParameters('ambientMaterial', arguments); + var color = _main.default.prototype.color.apply(this, arguments); + this._renderer._hasSetAmbient = true; + this._renderer.curAmbientColor = color._array; + this._renderer._useNormalMaterial = false; + this._renderer._enableLighting = true; + this._renderer._setProperty('_doFill', true); + return this; + }; + /** + * Sets the emissive color of the material. + * + * An emissive material will display the emissive color at + * full strength regardless of lighting. This can give the + * appearance that the object is glowing. + * + * Note, "emissive" is a misnomer in the sense that the material + * does not actually emit light that will affect surrounding objects. + * + * You can view more materials in this + * example. + * + * @method emissiveMaterial + * @param {Number} v1 red or hue value relative to the current + * color range + * @param {Number} v2 green or saturation value relative to the + * current color range + * @param {Number} v3 blue or brightness value relative to the + * current color range + * @param {Number} [alpha] alpha value relative to current color + * range (default is 0-255) + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('sphere with green emissive material'); + * } + * function draw() { + * background(0); + * noStroke(); + * ambientLight(0); + * emissiveMaterial(130, 230, 0); + * sphere(40); + * } + * + *
                              + * + * @alt + * sphere with green emissive material + */ + /** + * @method emissiveMaterial + * @param {Number} gray number specifying value between + * white and black + * @chainable + */ + /** + * @method emissiveMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string + * @chainable + */ + _main.default.prototype.emissiveMaterial = function (v1, v2, v3, a) { + this._assert3d('emissiveMaterial'); + _main.default._validateParameters('emissiveMaterial', arguments); + var color = _main.default.prototype.color.apply(this, arguments); + this._renderer.curEmissiveColor = color._array; + this._renderer._useEmissiveMaterial = true; + this._renderer._useNormalMaterial = false; + this._renderer._enableLighting = true; + return this; + }; + /** + * Sets the specular color of the material. + * + * A specular material is reflective (shiny). The shininess can be + * controlled by the shininess() function. + * + * Like ambientMaterial(), + * the specularMaterial() color is the color the object will reflect + * under ambientLight(). + * However unlike ambientMaterial(), for all other types of lights + * (directionalLight(), + * pointLight(), + * spotLight()), + * a specular material will reflect the **color of the light source**. + * This is what gives it its "shiny" appearance. + * + * You can view more materials in this + * example. + * + * @method specularMaterial + * @param {Number} gray number specifying value between white and black. + * @param {Number} [alpha] alpha value relative to current color range + * (default is 0-255) + * @chainable + * + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * describe('torus with specular material'); + * } + * + * function draw() { + * background(0); + * + * ambientLight(60); + * + * // add point light to showcase specular material + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * pointLight(255, 255, 255, locX, locY, 50); + * + * specularMaterial(250); + * shininess(50); + * torus(30, 10, 64, 64); + * } + * + *
                              + * @alt + * torus with specular material + */ + /** + * @method specularMaterial + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @param {Number} [alpha] + * @chainable + */ + /** + * @method specularMaterial + * @param {p5.Color|Number[]|String} color + * color as a p5.Color, + * as an array, or as a CSS string + * @chainable + */ + _main.default.prototype.specularMaterial = function (v1, v2, v3, alpha) { + this._assert3d('specularMaterial'); + _main.default._validateParameters('specularMaterial', arguments); + var color = _main.default.prototype.color.apply(this, arguments); + this._renderer.curSpecularColor = color._array; + this._renderer._useSpecularMaterial = true; + this._renderer._useNormalMaterial = false; + this._renderer._enableLighting = true; + return this; + }; + /** + * Sets the amount of gloss ("shininess") of a + * specularMaterial(). + * + * The default and minimum value is 1. + * + * @method shininess + * @param {Number} shine degree of shininess + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('two spheres, one more shiny than the other'); + * } + * function draw() { + * background(0); + * noStroke(); + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * ambientLight(60, 60, 60); + * pointLight(255, 255, 255, locX, locY, 50); + * specularMaterial(250); + * translate(-25, 0, 0); + * shininess(1); + * sphere(20); + * translate(50, 0, 0); + * shininess(20); + * sphere(20); + * } + * + *
                              + * @alt + * two spheres, one more shiny than the other + */ + _main.default.prototype.shininess = function (shine) { + this._assert3d('shininess'); + _main.default._validateParameters('shininess', arguments); + if (shine < 1) { + shine = 1; + } + this._renderer._useShininess = shine; + return this; + }; + /** + * @private blends colors according to color components. + * If alpha value is less than 1, or non-standard blendMode + * we need to enable blending on our gl context. + * @param {Number[]} color [description] + * @return {Number[]]} Normalized numbers array + */ + _main.default.RendererGL.prototype._applyColorBlend = function (colors) { + var gl = this.GL; + var isTexture = this.drawMode === constants.TEXTURE; + var doBlend = this.userFillShader || this.userStrokeShader || this.userPointShader || isTexture || this.curBlendMode !== constants.BLEND || colors[colors.length - 1] < 1 || this._isErasing; + if (doBlend !== this._isBlending) { + if (doBlend || this.curBlendMode !== constants.BLEND && this.curBlendMode !== constants.ADD) { + gl.enable(gl.BLEND); } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } + gl.disable(gl.BLEND); } - }); - } catch(error) { - failure(err); - } - // success + gl.depthMask(true); + this._isBlending = doBlend; + } + this._applyBlendMode(); + return colors; + }; + /** + * @private sets blending in gl context to curBlendMode + * @param {Number[]} color [description] + * @return {Number[]]} Normalized numbers array + */ + _main.default.RendererGL.prototype._applyBlendMode = function () { + if (this._cachedBlendMode === this.curBlendMode) { + return; + } + var gl = this.GL; + switch (this.curBlendMode) { + case constants.BLEND: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.ADD: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE); + break; + case constants.REMOVE: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ZERO, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.MULTIPLY: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.SCREEN: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR); + break; + case constants.EXCLUSION: + gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); + gl.blendFuncSeparate(gl.ONE_MINUS_DST_COLOR, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE); + break; + case constants.REPLACE: + gl.blendEquation(gl.FUNC_ADD); + gl.blendFunc(gl.ONE, gl.ZERO); + break; + case constants.SUBTRACT: + gl.blendEquationSeparate(gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); + break; + case constants.DARKEST: + if (this.blendExt) { + gl.blendEquationSeparate(this.blendExt.MIN || this.blendExt.MIN_EXT, gl.FUNC_ADD); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); + } else { + console.warn('blendMode(DARKEST) does not work in your browser in WEBGL mode.'); + } + break; + case constants.LIGHTEST: + if (this.blendExt) { + gl.blendEquationSeparate(this.blendExt.MAX || this.blendExt.MAX_EXT, gl.FUNC_ADD); + gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); + } else { + console.warn('blendMode(LIGHTEST) does not work in your browser in WEBGL mode.'); + } + break; + default: + console.error('Oops! Somehow RendererGL set curBlendMode to an unsupported mode.'); + break; + } + if (!this._isErasing) { + this._cachedBlendMode = this.curBlendMode; + } + }; + var _default = _main.default; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.Texture': 357, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.join': 180, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 } - }); - ``` - Promise Example; - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - @method then - @param {Function} onFulfilled - @param {Function} onRejected - Useful for tooling. - @return {Promise} + ], + 347: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.hypot'); + _dereq_('core-js/modules/es.string.sub'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module 3D + * @submodule Camera + * @requires core + */ + //////////////////////////////////////////////////////////////////////////////// + // p5.Prototype Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Sets the position of the current camera in a 3D sketch. + * Parameters for this function define the camera's position, + * the center of the sketch (where the camera is pointing), + * and an up direction (the orientation of the camera). + * + * This function simulates the movements of the camera, allowing objects to be + * viewed from various angles. Remember, it does not move the objects themselves + * but the camera instead. For example when the centerX value is positive, + * and the camera is rotating to the right side of the sketch, + * the object will seem like it's moving to the left. + * + * See this example + * to view the position of your camera. + * + * If no parameters are given, the following default is used: + * camera(0, 0, (height/2) / tan(PI/6), 0, 0, 0, 0, 1, 0) + * @method camera + * @constructor + * @for p5 + * @param {Number} [x] camera position value on x axis + * @param {Number} [y] camera position value on y axis + * @param {Number} [z] camera position value on z axis + * @param {Number} [centerX] x coordinate representing center of the sketch + * @param {Number} [centerY] y coordinate representing center of the sketch + * @param {Number} [centerZ] z coordinate representing center of the sketch + * @param {Number} [upX] x component of direction 'up' from camera + * @param {Number} [upY] y component of direction 'up' from camera + * @param {Number} [upZ] z component of direction 'up' from camera + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * describe('a square moving closer and then away from the camera.'); + * } + * function draw() { + * background(204); + * //move the camera away from the plane by a sin wave + * camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); + * plane(10, 10); + * } + * + *
                              + * + * @example + *
                              + * + * //move slider to see changes! + * //sliders control the first 6 parameters of camera() + * let sliderGroup = []; + * let X; + * let Y; + * let Z; + * let centerX; + * let centerY; + * let centerZ; + * let h = 20; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * //create sliders + * for (var i = 0; i < 6; i++) { + * if (i === 2) { + * sliderGroup[i] = createSlider(10, 400, 200); + * } else { + * sliderGroup[i] = createSlider(-400, 400, 0); + * } + * h = map(i, 0, 6, 5, 85); + * sliderGroup[i].position(10, height + h); + * sliderGroup[i].style('width', '80px'); + * } + * describe( + * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' + * ); + * } + * + * function draw() { + * background(60); + * // assigning sliders' value to each parameters + * X = sliderGroup[0].value(); + * Y = sliderGroup[1].value(); + * Z = sliderGroup[2].value(); + * centerX = sliderGroup[3].value(); + * centerY = sliderGroup[4].value(); + * centerZ = sliderGroup[5].value(); + * camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); + * stroke(255); + * fill(255, 102, 94); + * box(85); + * } + * + *
                              + * @alt + * White square repeatedly grows to fill canvas and then shrinks. + * An interactive example of a red cube with 3 sliders for moving it across x, y, + * z axis and 3 sliders for shifting its center. + */ + + _main.default.prototype.camera = function () { + var _this$_renderer$_curC; + this._assert3d('camera'); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _main.default._validateParameters('camera', args); + (_this$_renderer$_curC = this._renderer._curCamera).camera.apply(_this$_renderer$_curC, args); + return this; + }; + /** + * Sets a perspective projection for the current camera in a 3D sketch. + * This projection represents depth through foreshortening: objects + * that are close to the camera appear their actual size while those + * that are further away from the camera appear smaller. + * + * The parameters to this function define the viewing frustum + * (the truncated pyramid within which objects are seen by the camera) through + * vertical field of view, aspect ratio (usually width/height), and near and far + * clipping planes. + * + * If no parameters are given, the default values are used as: + * + * - `fov` : The default field of view for the camera is such that the full height of renderer is visible when it is positioned at a default distance of 800 units from the camera. + * - `aspect` : The default aspect ratio is the ratio of renderer's width to renderer's height. + * - `near` : The default value for the near clipping plane is 80, which is 0.1 times the default distance from the camera to its subject. + * - `far` : The default value for the far clipping plane is 8000, which is 10 times the default distance from the camera to its subject. + * + * If you prefer a fixed field of view, follow these steps: + * 1. Choose your desired field of view angle (`fovy`). This is how wide the camera can see. + * 2. To ensure that you can see the entire width across horizontally and height across vertically, place the camera a distance of `(height / 2) / tan(fovy / 2)` back from its subject. + * 3. Call perspective with the chosen field of view, canvas aspect ratio, and near/far values: + * `perspective(fovy, width / height, cameraDistance / 10, cameraDistance * 10);` + * + * @method perspective + * @for p5 + * @param {Number} [fovy] camera frustum vertical field of view, + * from bottom to top of view, in angleMode units + * @param {Number} [aspect] camera frustum aspect ratio + * @param {Number} [near] frustum near plane length + * @param {Number} [far] frustum far plane length + * @chainable + * @example + *
                              + * + * //drag the mouse to look around! + * function setup() { + * createCanvas(100, 100, WEBGL); + * perspective(PI / 3.0, width / height, 0.1, 500); + * describe( + * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' + * ); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * + * translate(0, 0, 550); + * rotateX(-0.3); + * rotateY(-0.2); + * + * push(); + * translate(-15, 0, sin(frameCount / 30) * 95); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 95); + * box(30); + * pop(); + * } + * + *
                              + * + * @alt + * two colored 3D boxes move back and forth, rotating as mouse is dragged. + */ + _main.default.prototype.perspective = function () { + var _this$_renderer$_curC2; + this._assert3d('perspective'); + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + _main.default._validateParameters('perspective', args); + (_this$_renderer$_curC2 = this._renderer._curCamera).perspective.apply(_this$_renderer$_curC2, args); + return this; + }; + /** + * Sets an orthographic projection for the current camera in a 3D sketch + * and defines a box-shaped viewing frustum within which objects are seen. + * In this projection, all objects with the same dimension appear the same + * size, regardless of whether they are near or far from the camera. + * + * The parameters to this function specify the viewing frustum where + * left and right are the minimum and maximum x values, top and bottom are + * the minimum and maximum y values, and near and far are the minimum and + * maximum z values. + * + * If no parameters are given, the following default is used: + * ortho(-width/2, width/2, -height/2, height/2). + * @method ortho + * @for p5 + * @param {Number} [left] camera frustum left plane + * @param {Number} [right] camera frustum right plane + * @param {Number} [bottom] camera frustum bottom plane + * @param {Number} [top] camera frustum top plane + * @param {Number} [near] camera frustum near plane + * @param {Number} [far] camera frustum far plane + * @chainable + * @example + *
                              + * + * //drag the mouse to look around! + * //there's no vanishing point + * function setup() { + * createCanvas(100, 100, WEBGL); + * ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * + * translate(0,0,500); + * rotateX(0.2); + * rotateY(-0.2); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 65); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 65); + * box(30); + * pop(); + * } + * + *
                              + * + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. + */ + _main.default.prototype.ortho = function () { + var _this$_renderer$_curC3; + this._assert3d('ortho'); + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + _main.default._validateParameters('ortho', args); + (_this$_renderer$_curC3 = this._renderer._curCamera).ortho.apply(_this$_renderer$_curC3, args); + return this; + }; + /** + * Sets the frustum of the current camera as defined by + * the parameters. + * + * A frustum is a geometric form: a pyramid with its top + * cut off. With the viewer's eye at the imaginary top of + * the pyramid, the six planes of the frustum act as clipping + * planes when rendering a 3D view. Thus, any form inside the + * clipping planes is visible; anything outside + * those planes is not visible. + * + * Setting the frustum changes the perspective of the scene being rendered. + * This can be achieved more simply in many cases by using + * perspective(). + * + * If no parameters are given, the following default is used: + * frustum(-width/20, width/20, height/20, -height/20, eyeZ/10, eyeZ*10), + * where eyeZ is equal to ((height/2) / tan(PI/6)). + * @method frustum + * @for p5 + * @param {Number} [left] camera frustum left plane + * @param {Number} [right] camera frustum right plane + * @param {Number} [bottom] camera frustum bottom plane + * @param {Number} [top] camera frustum top plane + * @param {Number} [near] camera frustum near plane + * @param {Number} [far] camera frustum far plane + * @chainable + * @example + *
                              + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); + * describe( + * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' + * ); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * translate(0,0,700); + * rotateY(-0.2); + * rotateX(-0.3); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 25); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 25); + * box(30); + * pop(); + * } + * + *
                              + * + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. + */ + _main.default.prototype.frustum = function () { + var _this$_renderer$_curC4; + this._assert3d('frustum'); + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + _main.default._validateParameters('frustum', args); + (_this$_renderer$_curC4 = this._renderer._curCamera).frustum.apply(_this$_renderer$_curC4, args); + return this; + }; + //////////////////////////////////////////////////////////////////////////////// + // p5.Camera + //////////////////////////////////////////////////////////////////////////////// + /** + * Creates a new p5.Camera object and sets it + * as the current (active) camera. + * + * The new camera is initialized with a default position + * (see camera()) + * and a default perspective projection + * (see perspective()). + * Its properties can be controlled with the p5.Camera + * methods. + * + * Note: Every 3D sketch starts with a default camera initialized. + * This camera can be controlled with the global methods + * camera(), + * perspective(), ortho(), + * and frustum() if it is the only camera + * in the scene. + * @method createCamera + * @return {p5.Camera} The newly created camera object. + * @for p5 + * @example + *
                              + * // Creates a camera object and animates it around a box. + * let camera; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * camera = createCamera(); + * describe('An example that creates a camera and moves it around the box.'); + * } + * + * function draw() { + * background(0); + * // The camera will automatically + * // rotate to look at [0, 0, 0]. + * camera.lookAt(0, 0, 0); + * + * // The camera will move on the + * // x axis. + * camera.setPosition(sin(frameCount / 60) * 200, 0, 100); + * box(20); + * + * // A 'ground' box to give the viewer + * // a better idea of where the camera + * // is looking. + * translate(0, 50, 0); + * rotateX(HALF_PI); + * box(150, 150, 20); + * } + *
                              + * + * @alt + * An example that creates a camera and moves it around the box. + */ + _main.default.prototype.createCamera = function () { + this._assert3d('createCamera'); + var _cam = new _main.default.Camera(this._renderer); + // compute default camera settings, then set a default camera + _cam._computeCameraDefaultSettings(); + _cam._setDefaultCamera(); + // set renderer current camera to the new camera + this._renderer._curCamera = _cam; + return _cam; + }; + /** + * This class describes a camera for use in p5's + * + * WebGL mode. It contains camera position, orientation, and projection + * information necessary for rendering a 3D scene. + * + * New p5.Camera objects can be made through the + * createCamera() function and controlled through + * the methods described below. A camera created in this way will use a default + * position in the scene and a default perspective projection until these + * properties are changed through the various methods available. It is possible + * to create multiple cameras, in which case the current camera + * can be set through the setCamera() method. + * + * Note: + * The methods below operate in two coordinate systems: the 'world' coordinate + * system describe positions in terms of their relationship to the origin along + * the X, Y and Z axes whereas the camera's 'local' coordinate system + * describes positions from the camera's point of view: left-right, up-down, + * and forward-backward. The move() method, + * for instance, moves the camera along its own axes, whereas the + * setPosition() + * method sets the camera's position in world-space. + * + * The camera object propreties + * eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ + * which describes camera position, orientation, and projection + * are also accessible via the camera object generated using + * createCamera() + * + * @class p5.Camera + * @param {rendererGL} rendererGL instance of WebGL renderer + * @example + *
                              + * + * let cam; + * let delta = 0.01; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * // set initial pan angle + * cam.pan(-0.8); + * describe( + * 'camera view pans left and right across a series of rotating 3D boxes.' + * ); + * } + * + * function draw() { + * background(200); + * + * // pan camera according to angle 'delta' + * cam.pan(delta); + * + * // every 160 frames, switch direction + * if (frameCount % 160 === 0) { + * delta *= -1; + * } + * + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                              + * + * @alt + * camera view pans left and right across a series of rotating 3D boxes. + */ + _main.default.Camera = /*#__PURE__*/ function () { + function Camera(renderer) { + _classCallCheck(this, Camera); + this._renderer = renderer; + this.cameraType = 'default'; + this.cameraMatrix = new _main.default.Matrix(); + this.projMatrix = new _main.default.Matrix(); + this.yScale = 1; + } /** + * camera position value on x axis + * @property {Number} eyeX + * @readonly + * @example + * + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * cam = createCamera(); + * div = createDiv(); + * div.position(0, 0); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * div.html('eyeX = ' + cam.eyeX); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * camera position value on y axis + * @property {Number} eyeY + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * cam = createCamera(); + * div = createDiv(); + * div.position(0, 0); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * div.html('eyeY = ' + cam.eyeY); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * camera position value on z axis + * @property {Number} eyeZ + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(0); + * cam = createCamera(); + * div = createDiv(); + * div.position(0, 0); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * div.html('eyeZ = ' + cam.eyeZ); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * x coordinate representing center of the sketch + * @property {Number} centerX + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * cam.lookAt(1, 0, 0); + * div = createDiv('centerX = ' + cam.centerX); + * div.position(0, 0); + * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * y coordinate representing center of the sketch + * @property {Number} centerY + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * cam.lookAt(0, 1, 0); + * div = createDiv('centerY = ' + cam.centerY); + * div.position(0, 0); + * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * z coordinate representing center of the sketch + * @property {Number} centerZ + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * cam.lookAt(0, 0, 1); + * div = createDiv('centerZ = ' + cam.centerZ); + * div.position(0, 0); + * div.style('color', 'white'); + * describe('An example showing the use of camera object properties'); + * } + * + * function draw() { + * orbitControl(); + * box(10); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * x component of direction 'up' from camera + * @property {Number} upX + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * div = createDiv('upX = ' + cam.upX); + * div.position(0, 0); + * div.style('color', 'blue'); + * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * y component of direction 'up' from camera + * @property {Number} upY + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * div = createDiv('upY = ' + cam.upY); + * div.position(0, 0); + * div.style('color', 'blue'); + * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + /** + * z component of direction 'up' from camera + * @property {Number} upZ + * @readonly + * @example + *
                              + * let cam, div; + * function setup() { + * createCanvas(100, 100, WEBGL); + * background(255); + * cam = createCamera(); + * div = createDiv('upZ = ' + cam.upZ); + * div.position(0, 0); + * div.style('color', 'blue'); + * div.style('font-size', '18px'); + * describe('An example showing the use of camera object properties'); + * } + *
                              + * + * @alt + * An example showing the use of camera object properties + * + */ + //////////////////////////////////////////////////////////////////////////////// + // Camera Projection Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Sets a perspective projection. + * Accepts the same parameters as the global + * perspective(). + * More information on this function can be found there. + * @method perspective + * @for p5.Camera + * @example + *
                              + * + * // drag the mouse to look around! + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // create a camera + * cam = createCamera(); + * // give it a perspective projection + * cam.perspective(PI / 3.0, width / height, 0.1, 500); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * + * translate(0, 0, 550); + * rotateX(-0.3); + * rotateY(-0.2); + * + * push(); + * translate(-15, 0, sin(frameCount / 30) * 95); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 95); + * box(30); + * pop(); + * } + * + *
                              + * @alt + * two colored 3D boxes move back and forth, rotating as mouse is dragged. + */ + + _createClass(Camera, [ + { + key: 'perspective', + value: function perspective(fovy, aspect, near, far) { + this.cameraType = arguments.length > 0 ? 'custom' : 'default'; + if (typeof fovy === 'undefined') { + fovy = this.defaultCameraFOV; + // this avoids issue where setting angleMode(DEGREES) before calling + // perspective leads to a smaller than expected FOV (because + // _computeCameraDefaultSettings computes in radians) + this.cameraFOV = fovy; + } else { + this.cameraFOV = this._renderer._pInst._toRadians(fovy); + } + if (typeof aspect === 'undefined') { + aspect = this.defaultAspectRatio; + } + if (typeof near === 'undefined') { + near = this.defaultCameraNear; + } + if (typeof far === 'undefined') { + far = this.defaultCameraFar; + } + if (near <= 0.0001) { + near = 0.01; + console.log('Avoid perspective near plane values close to or below 0. ' + 'Setting value to 0.01.'); + } + if (far < near) { + console.log('Perspective far plane value is less than near plane value. ' + 'Nothing will be shown.'); + } + this.aspectRatio = aspect; + this.cameraNear = near; + this.cameraFar = far; + this.projMatrix = _main.default.Matrix.identity(); + var f = 1 / Math.tan(this.cameraFOV / 2); + var nf = 1 / (this.cameraNear - this.cameraFar); + /* eslint-disable indent */ + this.projMatrix.set(f / aspect, 0, 0, 0, 0, - f * this.yScale, 0, 0, 0, 0, (far + near) * nf, - 1, 0, 0, 2 * far * near * nf, 0); + /* eslint-enable indent */ + if (this._isActive()) { + this._renderer.uPMatrix.set(this.projMatrix.mat4[0], this.projMatrix.mat4[1], this.projMatrix.mat4[2], this.projMatrix.mat4[3], this.projMatrix.mat4[4], this.projMatrix.mat4[5], this.projMatrix.mat4[6], this.projMatrix.mat4[7], this.projMatrix.mat4[8], this.projMatrix.mat4[9], this.projMatrix.mat4[10], this.projMatrix.mat4[11], this.projMatrix.mat4[12], this.projMatrix.mat4[13], this.projMatrix.mat4[14], this.projMatrix.mat4[15]); + } + } /** + * Sets an orthographic projection. + * Accepts the same parameters as the global + * ortho(). + * More information on this function can be found there. + * @method ortho + * @for p5.Camera + * @example + *
                              + * + * // drag the mouse to look around! + * // there's no vanishing point + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // create a camera + * cam = createCamera(); + * // give it an orthographic projection + * cam.ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); + * } + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * translate(0,0,500); + * rotateX(0.2); + * rotateY(-0.2); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 65); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 65); + * box(30); + * pop(); + * } + * + *
                              + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. */ - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - @method catch - @param {Function} onRejection - Useful for tooling. - @return {Promise} + + }, + { + key: 'ortho', + value: function ortho(left, right, bottom, top, near, far) { + if (left === undefined) left = - this._renderer.width / 2; + if (right === undefined) right = + this._renderer.width / 2; + if (bottom === undefined) bottom = - this._renderer.height / 2; + if (top === undefined) top = + this._renderer.height / 2; + if (near === undefined) near = 0; + if (far === undefined) far = Math.max(this._renderer.width, this._renderer.height); + this.cameraNear = near; + this.cameraFar = far; + var w = right - left; + var h = top - bottom; + var d = far - near; + var x = + 2 / w; + var y = + 2 / h * this.yScale; + var z = - 2 / d; + var tx = - (right + left) / w; + var ty = - (top + bottom) / h; + var tz = - (far + near) / d; + this.projMatrix = _main.default.Matrix.identity(); + /* eslint-disable indent */ + this.projMatrix.set(x, 0, 0, 0, 0, - y, 0, 0, 0, 0, z, 0, tx, ty, tz, 1); + /* eslint-enable indent */ + if (this._isActive()) { + this._renderer.uPMatrix.set(this.projMatrix.mat4[0], this.projMatrix.mat4[1], this.projMatrix.mat4[2], this.projMatrix.mat4[3], this.projMatrix.mat4[4], this.projMatrix.mat4[5], this.projMatrix.mat4[6], this.projMatrix.mat4[7], this.projMatrix.mat4[8], this.projMatrix.mat4[9], this.projMatrix.mat4[10], this.projMatrix.mat4[11], this.projMatrix.mat4[12], this.projMatrix.mat4[13], this.projMatrix.mat4[14], this.projMatrix.mat4[15]); + } + this.cameraType = 'custom'; + } /** + * Sets the camera's frustum. + * Accepts the same parameters as the global + * frustum(). + * More information on this function can be found there. + * @method frustum + * @for p5.Camera + * @example + *
                              + * + * let cam; + * + * function setup() { + * x = createCanvas(100, 100, WEBGL); + * setAttributes('antialias', true); + * // create a camera + * cam = createCamera(); + * // set its frustum + * cam.frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); + * } + * + * function draw() { + * background(200); + * orbitControl(); + * normalMaterial(); + * translate(0,0,700); + * rotateY(-0.2); + * rotateX(-0.3); + * push(); + * translate(-15, 0, sin(frameCount / 30) * 25); + * box(30); + * pop(); + * push(); + * translate(15, 0, sin(frameCount / 30 + PI) * 25); + * box(30); + * pop(); + * } + * + *
                              + * @alt + * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. */ - Promise.prototype.catch = function _catch(onRejection) { - return this.then(null, onRejection); - }; - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @return {Promise} + }, + { + key: 'frustum', + value: function frustum(left, right, bottom, top, near, far) { + if (left === undefined) left = - this._renderer.width * 0.05; + if (right === undefined) right = + this._renderer.width * 0.05; + if (bottom === undefined) bottom = + this._renderer.height * 0.05; + if (top === undefined) top = - this._renderer.height * 0.05; + if (near === undefined) near = this.defaultCameraNear; + if (far === undefined) far = this.defaultCameraFar; + this.cameraNear = near; + this.cameraFar = far; + var w = right - left; + var h = top - bottom; + var d = far - near; + var x = + (2 * near) / w; + var y = + (2 * near) / h * this.yScale; + var z = - (2 * far * near) / d; + var tx = (right + left) / w; + var ty = (top + bottom) / h; + var tz = - (far + near) / d; + this.projMatrix = _main.default.Matrix.identity(); + /* eslint-disable indent */ + this.projMatrix.set(x, 0, 0, 0, 0, - y, 0, 0, tx, ty, tz, - 1, 0, 0, z, 0); + /* eslint-enable indent */ + if (this._isActive()) { + this._renderer.uPMatrix.set(this.projMatrix.mat4[0], this.projMatrix.mat4[1], this.projMatrix.mat4[2], this.projMatrix.mat4[3], this.projMatrix.mat4[4], this.projMatrix.mat4[5], this.projMatrix.mat4[6], this.projMatrix.mat4[7], this.projMatrix.mat4[8], this.projMatrix.mat4[9], this.projMatrix.mat4[10], this.projMatrix.mat4[11], this.projMatrix.mat4[12], this.projMatrix.mat4[13], this.projMatrix.mat4[14], this.projMatrix.mat4[15]); + } + this.cameraType = 'custom'; + } //////////////////////////////////////////////////////////////////////////////// + // Camera Orientation Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Rotate camera view about arbitrary axis defined by x,y,z + * based on http://learnwebgl.brown37.net/07_cameras/camera_rotating_motion.html + * @method _rotateView + * @private */ - Promise.prototype.finally = function _finally(callback) { - var promise = this; - var constructor = promise.constructor; - if (isFunction(callback)) { - return promise.then( - function (value) { - return constructor - .resolve(callback()) - .then(function () { - return value; - }); - }, - function (reason) { - return constructor - .resolve(callback()) - .then(function () { - throw reason; - }); - }, - ); - } - return promise.then(callback, callback); - }; - return Promise; - })(); - Promise$1.prototype.then = then; - Promise$1.all = all; - Promise$1.race = race; - Promise$1.resolve = resolve$1; - Promise$1.reject = reject$1; - Promise$1._setScheduler = setScheduler; - Promise$1._setAsap = setAsap; - Promise$1._asap = asap; - /*global self*/ - function polyfill() { - var local = void 0; - if (typeof global !== "undefined") { - local = global; - } else if (typeof self !== "undefined") { - local = self; - } else { - try { - local = Function("return this")(); - } catch (e) { - throw new Error( - "polyfill failed because global object is unavailable in this environment", - ); - } - } - var P = local.Promise; - if (P) { - var promiseToString = null; - try { - promiseToString = Object.prototype.toString.call( - P.resolve(), - ); - } catch (e) { - // silently ignored - } - if (promiseToString === "[object Promise]" && !P.cast) { - return; - } - } - local.Promise = Promise$1; - } // Strange compat.. - - Promise$1.polyfill = polyfill; - Promise$1.Promise = Promise$1; - return Promise$1; - }); - }).call( - this, - _dereq_("_process"), - typeof global !== "undefined" - ? global - : typeof self !== "undefined" - ? self - : typeof window !== "undefined" - ? window - : {}, - ); - }, - { - _process: 273, - }, - ], - 261: [ - function (_dereq_, module, exports) { - (function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports", "module"], factory); - } else if ( - typeof exports !== "undefined" && - typeof module !== "undefined" - ) { - factory(exports, module); - } else { - var mod = { - exports: {}, - }; - factory(mod.exports, mod); - global.fetchJsonp = mod.exports; - } - })(this, function (exports, module) { - "use strict"; - var defaultOptions = { - timeout: 5000, - jsonpCallback: "callback", - jsonpCallbackFunction: null, - }; - function generateCallbackFunction() { - return ( - "jsonp_" + Date.now() + "_" + Math.ceil(Math.random() * 100000) - ); - } - function clearFunction(functionName) { - // IE8 throws an exception when you try to delete a property on window - // http://stackoverflow.com/a/1824228/751089 - try { - delete window[functionName]; - } catch (e) { - window[functionName] = undefined; - } - } - function removeScript(scriptId) { - var script = document.getElementById(scriptId); - if (script) { - document.getElementsByTagName("head")[0].removeChild(script); - } - } - function fetchJsonp(_url) { - var options = - arguments.length <= 1 || arguments[1] === undefined - ? {} - : arguments[1]; - // to avoid param reassign - var url = _url; - var timeout = options.timeout || defaultOptions.timeout; - var jsonpCallback = - options.jsonpCallback || defaultOptions.jsonpCallback; - var timeoutId = undefined; - return new Promise(function (resolve, reject) { - var callbackFunction = - options.jsonpCallbackFunction || generateCallbackFunction(); - var scriptId = jsonpCallback + "_" + callbackFunction; - window[callbackFunction] = function (response) { - resolve({ - ok: true, - // keep consistent with fetch API - json: function json() { - return Promise.resolve(response); - }, - }); - if (timeoutId) clearTimeout(timeoutId); - removeScript(scriptId); - clearFunction(callbackFunction); - }; - // Check if the user set their own params, and if not add a ? to start a list of params - url += url.indexOf("?") === -1 ? "?" : "&"; - var jsonpScript = document.createElement("script"); - jsonpScript.setAttribute( - "src", - "" + url + jsonpCallback + "=" + callbackFunction, - ); - if (options.charset) { - jsonpScript.setAttribute("charset", options.charset); - } - jsonpScript.id = scriptId; - document - .getElementsByTagName("head")[0] - .appendChild(jsonpScript); - timeoutId = setTimeout(function () { - reject(new Error("JSONP request to " + _url + " timed out")); - clearFunction(callbackFunction); - removeScript(scriptId); - window[callbackFunction] = function () { - clearFunction(callbackFunction); - }; - }, timeout); - // Caught if got 404/500 - jsonpScript.onerror = function () { - reject(new Error("JSONP request to " + _url + " failed")); - clearFunction(callbackFunction); - removeScript(scriptId); - if (timeoutId) clearTimeout(timeoutId); - }; - }); - } // export as global function - /* - let local; - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - local.fetchJsonp = fetchJsonp; - */ - module.exports = fetchJsonp; - }); - }, - {}, - ], - 262: [ - function (_dereq_, module, exports) { - /* FileSaver.js - * A saveAs() FileSaver implementation. - * 1.3.2 - * 2016-06-16 18:25:19 - * - * By Eli Grey, http://eligrey.com - * License: MIT - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md - */ - /*global self */ - /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ - /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ - var saveAs = - saveAs || - (function (view) { - "use strict"; - // IE <10 is explicitly unsupported - if ( - typeof view === "undefined" || - (typeof navigator !== "undefined" && - /MSIE [1-9]\./.test(navigator.userAgent)) - ) { - return; - } - var doc = view.document, // only get URL when necessary in case Blob.js hasn't overridden it yet - get_URL = function () { - return view.URL || view.webkitURL || view; - }, - save_link = doc.createElementNS( - "http://www.w3.org/1999/xhtml", - "a", - ), - can_use_save_link = "download" in save_link, - click = function (node) { - var event = new MouseEvent("click"); - node.dispatchEvent(event); - }, - is_safari = - /constructor/i.test(view.HTMLElement) || view.safari, - is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent), - throw_outside = function (ex) { - (view.setImmediate || view.setTimeout)(function () { - throw ex; - }, 0); - }, - force_saveable_type = "application/octet-stream", // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to - arbitrary_revoke_timeout = 1000 * 40, // in ms - revoke = function (file) { - var revoker = function () { - if (typeof file === "string") { - // file is an object URL - get_URL().revokeObjectURL(file); - } else { - // file is a File - file.remove(); - } - }; - setTimeout(revoker, arbitrary_revoke_timeout); - }, - dispatch = function (filesaver, event_types, event) { - event_types = [].concat(event_types); - var i = event_types.length; - while (i--) { - var listener = filesaver["on" + event_types[i]]; - if (typeof listener === "function") { - try { - listener.call(filesaver, event || filesaver); - } catch (ex) { - throw_outside(ex); - } - } - } - }, - auto_bom = function (blob) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if ( - /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test( - blob.type, - ) - ) { - return new Blob([String.fromCharCode(65279), blob], { - type: blob.type, - }); - } - return blob; - }, - FileSaver = function (blob, name, no_auto_bom) { - if (!no_auto_bom) { - blob = auto_bom(blob); - } // First try a.download, then web filesystem, then object URLs - - var filesaver = this, - type = blob.type, - force = type === force_saveable_type, - object_url, - dispatch_all = function () { - dispatch( - filesaver, - "writestart progress write writeend".split(" "), - ); - }, // on any filesys errors revert to saving with object URLs - fs_error = function () { - if ( - (is_chrome_ios || (force && is_safari)) && - view.FileReader - ) { - // Safari doesn't allow downloading of blob urls - var reader = new FileReader(); - reader.onloadend = function () { - var url = is_chrome_ios - ? reader.result - : reader.result.replace( - /^data:[^;]*;/, - "data:attachment/file;", - ); - var popup = view.open(url, "_blank"); - if (!popup) view.location.href = url; - url = undefined; // release reference before dispatching - filesaver.readyState = filesaver.DONE; - dispatch_all(); - }; - reader.readAsDataURL(blob); - filesaver.readyState = filesaver.INIT; - return; - } // don't create more object URLs than needed - - if (!object_url) { - object_url = get_URL().createObjectURL(blob); - } - if (force) { - view.location.href = object_url; - } else { - var opened = view.open(object_url, "_blank"); - if (!opened) { - // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html - view.location.href = object_url; - } - } - filesaver.readyState = filesaver.DONE; - dispatch_all(); - revoke(object_url); - }; - filesaver.readyState = filesaver.INIT; - if (can_use_save_link) { - object_url = get_URL().createObjectURL(blob); - setTimeout(function () { - save_link.href = object_url; - save_link.download = name; - click(save_link); - dispatch_all(); - revoke(object_url); - filesaver.readyState = filesaver.DONE; - }); - return; - } - fs_error(); - }, - FS_proto = FileSaver.prototype, - saveAs = function (blob, name, no_auto_bom) { - return new FileSaver( - blob, - name || blob.name || "download", - no_auto_bom, - ); - }; - // IE 10+ (native saveAs) - if ( - typeof navigator !== "undefined" && - navigator.msSaveOrOpenBlob - ) { - return function (blob, name, no_auto_bom) { - name = name || blob.name || "download"; - if (!no_auto_bom) { - blob = auto_bom(blob); - } - return navigator.msSaveOrOpenBlob(blob, name); - }; - } - FS_proto.abort = function () {}; - FS_proto.readyState = FS_proto.INIT = 0; - FS_proto.WRITING = 1; - FS_proto.DONE = 2; - FS_proto.error = - FS_proto.onwritestart = - FS_proto.onprogress = - FS_proto.onwrite = - FS_proto.onabort = - FS_proto.onerror = - FS_proto.onwriteend = - null; - return saveAs; - })( - (typeof self !== "undefined" && self) || - (typeof window !== "undefined" && window) || - this.content, - ); - // `self` is undefined in Firefox for Android content script context - // while `this` is nsIContentFrameMessageManager - // with an attribute `content` that corresponds to the window - if (typeof module !== "undefined" && module.exports) { - module.exports.saveAs = saveAs; - } else if ( - typeof define !== "undefined" && - define !== null && - define.amd !== null - ) { - define("FileSaver.js", function () { - return saveAs; - }); - } - }, - {}, - ], - 263: [ - function (_dereq_, module, exports) { - var __defProp = Object.defineProperty; - var __markAsModule = (target) => - __defProp(target, "__esModule", { - value: true, - }); - var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { - get: all[name], - enumerable: true, - }); - }; - // src/index.js - __markAsModule(exports); - __export(exports, { - GIFEncoder: () => GIFEncoder, - applyPalette: () => applyPalette, - default: () => src_default, - nearestColor: () => nearestColor, - nearestColorIndex: () => nearestColorIndex, - nearestColorIndexWithDistance: () => nearestColorIndexWithDistance, - prequantize: () => prequantize, - quantize: () => quantize, - snapColorsToPalette: () => snapColorsToPalette, - }); - // src/constants.js - var constants_default = { - signature: "GIF", - version: "89a", - trailer: 59, - extensionIntroducer: 33, - applicationExtensionLabel: 255, - graphicControlExtensionLabel: 249, - imageSeparator: 44, - signatureSize: 3, - versionSize: 3, - globalColorTableFlagMask: 128, - colorResolutionMask: 112, - sortFlagMask: 8, - globalColorTableSizeMask: 7, - applicationIdentifierSize: 8, - applicationAuthCodeSize: 3, - disposalMethodMask: 28, - userInputFlagMask: 2, - transparentColorFlagMask: 1, - localColorTableFlagMask: 128, - interlaceFlagMask: 64, - idSortFlagMask: 32, - localColorTableSizeMask: 7, - }; - // src/stream.js - function createStream(initialCapacity = 256) { - let cursor = 0; - let contents = new Uint8Array(initialCapacity); - return { - get buffer() { - return contents.buffer; - }, - reset() { - cursor = 0; - }, - bytesView() { - return contents.subarray(0, cursor); - }, - bytes() { - return contents.slice(0, cursor); - }, - writeByte(byte) { - expand(cursor + 1); - contents[cursor] = byte; - cursor++; - }, - writeBytes(data, offset = 0, byteLength = data.length) { - expand(cursor + byteLength); - for (let i = 0; i < byteLength; i++) { - contents[cursor++] = data[i + offset]; - } - }, - writeBytesView(data, offset = 0, byteLength = data.byteLength) { - expand(cursor + byteLength); - contents.set( - data.subarray(offset, offset + byteLength), - cursor, - ); - cursor += byteLength; - }, - }; - function expand(newCapacity) { - var prevCapacity = contents.length; - if (prevCapacity >= newCapacity) return; - var CAPACITY_DOUBLING_MAX = 1024 * 1024; - newCapacity = Math.max( - newCapacity, - (prevCapacity * - (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125)) >>> - 0, - ); - if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); - const oldContents = contents; - contents = new Uint8Array(newCapacity); - if (cursor > 0) contents.set(oldContents.subarray(0, cursor), 0); - } - } // src/lzwEncode.js - - var BITS = 12; - var DEFAULT_HSIZE = 5003; - var MASKS = [ - 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, - 16383, 32767, 65535, - ]; - function lzwEncode( - width, - height, - pixels, - colorDepth, - outStream = createStream(512), - accum = new Uint8Array(256), - htab = new Int32Array(DEFAULT_HSIZE), - codetab = new Int32Array(DEFAULT_HSIZE), - ) { - const hsize = htab.length; - const initCodeSize = Math.max(2, colorDepth); - accum.fill(0); - codetab.fill(0); - htab.fill(-1); - let cur_accum = 0; - let cur_bits = 0; - const init_bits = initCodeSize + 1; - const g_init_bits = init_bits; - let clear_flg = false; - let n_bits = g_init_bits; - let maxcode = (1 << n_bits) - 1; - const ClearCode = 1 << (init_bits - 1); - const EOFCode = ClearCode + 1; - let free_ent = ClearCode + 2; - let a_count = 0; - let ent = pixels[0]; - let hshift = 0; - for (let fcode = hsize; fcode < 65536; fcode *= 2) { - ++hshift; - } - hshift = 8 - hshift; - outStream.writeByte(initCodeSize); - output(ClearCode); - const length = pixels.length; - for (let idx = 1; idx < length; idx++) { - next_block: { - const c = pixels[idx]; - const fcode = (c << BITS) + ent; - let i = (c << hshift) ^ ent; - if (htab[i] === fcode) { - ent = codetab[i]; - break next_block; - } - const disp = i === 0 ? 1 : hsize - i; - while (htab[i] >= 0) { - i -= disp; - if (i < 0) i += hsize; - if (htab[i] === fcode) { - ent = codetab[i]; - break next_block; - } - } - output(ent); - ent = c; - if (free_ent < 1 << BITS) { - codetab[i] = free_ent++; - htab[i] = fcode; - } else { - htab.fill(-1); - free_ent = ClearCode + 2; - clear_flg = true; - output(ClearCode); - } - } - } - output(ent); - output(EOFCode); - outStream.writeByte(0); - return outStream.bytesView(); - function output(code) { - cur_accum &= MASKS[cur_bits]; - if (cur_bits > 0) cur_accum |= code << cur_bits; - else cur_accum = code; - cur_bits += n_bits; - while (cur_bits >= 8) { - accum[a_count++] = cur_accum & 255; - if (a_count >= 254) { - outStream.writeByte(a_count); - outStream.writeBytesView(accum, 0, a_count); - a_count = 0; - } - cur_accum >>= 8; - cur_bits -= 8; - } - if (free_ent > maxcode || clear_flg) { - if (clear_flg) { - n_bits = g_init_bits; - maxcode = (1 << n_bits) - 1; - clear_flg = false; - } else { - ++n_bits; - maxcode = n_bits === BITS ? 1 << n_bits : (1 << n_bits) - 1; - } - } - if (code == EOFCode) { - while (cur_bits > 0) { - accum[a_count++] = cur_accum & 255; - if (a_count >= 254) { - outStream.writeByte(a_count); - outStream.writeBytesView(accum, 0, a_count); - a_count = 0; - } - cur_accum >>= 8; - cur_bits -= 8; - } - if (a_count > 0) { - outStream.writeByte(a_count); - outStream.writeBytesView(accum, 0, a_count); - a_count = 0; - } - } - } - } - var lzwEncode_default = lzwEncode; - // src/rgb-packing.js - function rgb888_to_rgb565(r, g, b) { - return ((r << 8) & 63488) | ((g << 2) & 992) | (b >> 3); - } - function rgba8888_to_rgba4444(r, g, b, a) { - return (r >> 4) | (g & 240) | ((b & 240) << 4) | ((a & 240) << 8); - } - function rgb888_to_rgb444(r, g, b) { - return ((r >> 4) << 8) | (g & 240) | (b >> 4); - } // src/pnnquant2.js - - function clamp(value, min, max) { - return value < min ? min : value > max ? max : value; - } - function sqr(value) { - return value * value; - } - function find_nn(bins, idx, hasAlpha) { - var nn = 0; - var err = 1e100; - const bin1 = bins[idx]; - const n1 = bin1.cnt; - const wa = bin1.ac; - const wr = bin1.rc; - const wg = bin1.gc; - const wb = bin1.bc; - for (var i = bin1.fw; i != 0; i = bins[i].fw) { - const bin = bins[i]; - const n2 = bin.cnt; - const nerr2 = (n1 * n2) / (n1 + n2); - if (nerr2 >= err) continue; - var nerr = 0; - if (hasAlpha) { - nerr += nerr2 * sqr(bin.ac - wa); - if (nerr >= err) continue; - } - nerr += nerr2 * sqr(bin.rc - wr); - if (nerr >= err) continue; - nerr += nerr2 * sqr(bin.gc - wg); - if (nerr >= err) continue; - nerr += nerr2 * sqr(bin.bc - wb); - if (nerr >= err) continue; - err = nerr; - nn = i; - } - bin1.err = err; - bin1.nn = nn; - } - function create_bin() { - return { - ac: 0, - rc: 0, - gc: 0, - bc: 0, - cnt: 0, - nn: 0, - fw: 0, - bk: 0, - tm: 0, - mtm: 0, - err: 0, - }; - } - function create_bin_list(data, format) { - const bincount = format === "rgb444" ? 4096 : 65536; - const bins = new Array(bincount); - const size = data.length; - if (format === "rgba4444") { - for (let i = 0; i < size; ++i) { - const color = data[i]; - const a = (color >> 24) & 255; - const b = (color >> 16) & 255; - const g = (color >> 8) & 255; - const r = color & 255; - const index = rgba8888_to_rgba4444(r, g, b, a); - let bin = - index in bins ? bins[index] : (bins[index] = create_bin()); - bin.rc += r; - bin.gc += g; - bin.bc += b; - bin.ac += a; - bin.cnt++; - } - } else if (format === "rgb444") { - for (let i = 0; i < size; ++i) { - const color = data[i]; - const b = (color >> 16) & 255; - const g = (color >> 8) & 255; - const r = color & 255; - const index = rgb888_to_rgb444(r, g, b); - let bin = - index in bins ? bins[index] : (bins[index] = create_bin()); - bin.rc += r; - bin.gc += g; - bin.bc += b; - bin.cnt++; - } - } else { - for (let i = 0; i < size; ++i) { - const color = data[i]; - const b = (color >> 16) & 255; - const g = (color >> 8) & 255; - const r = color & 255; - const index = rgb888_to_rgb565(r, g, b); - let bin = - index in bins ? bins[index] : (bins[index] = create_bin()); - bin.rc += r; - bin.gc += g; - bin.bc += b; - bin.cnt++; - } - } - return bins; - } - function quantize(rgba, maxColors, opts = {}) { - const { - format = "rgb565", - clearAlpha = true, - clearAlphaColor = 0, - clearAlphaThreshold = 0, - oneBitAlpha = false, - } = opts; - if (!rgba || !rgba.buffer) { - throw new Error("quantize() expected RGBA Uint8Array data"); - } - if ( - !(rgba instanceof Uint8Array) && - !(rgba instanceof Uint8ClampedArray) - ) { - throw new Error("quantize() expected RGBA Uint8Array data"); - } - const data = new Uint32Array(rgba.buffer); - let useSqrt = opts.useSqrt !== false; - const hasAlpha = format === "rgba4444"; - const bins = create_bin_list(data, format); - const bincount = bins.length; - const bincountMinusOne = bincount - 1; - const heap = new Uint32Array(bincount + 1); - var maxbins = 0; - for (var i = 0; i < bincount; ++i) { - const bin = bins[i]; - if (bin != null) { - var d = 1 / bin.cnt; - if (hasAlpha) bin.ac *= d; - bin.rc *= d; - bin.gc *= d; - bin.bc *= d; - bins[maxbins++] = bin; - } - } - if (sqr(maxColors) / maxbins < 0.022) { - useSqrt = false; - } - var i = 0; - for (; i < maxbins - 1; ++i) { - bins[i].fw = i + 1; - bins[i + 1].bk = i; - if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); - } - if (useSqrt) bins[i].cnt = Math.sqrt(bins[i].cnt); - var h, l, l2; - for (i = 0; i < maxbins; ++i) { - find_nn(bins, i, false); - var err = bins[i].err; - for (l = ++heap[0]; l > 1; l = l2) { - l2 = l >> 1; - if (bins[(h = heap[l2])].err <= err) break; - heap[l] = h; - } - heap[l] = i; - } - var extbins = maxbins - maxColors; - for (i = 0; i < extbins; ) { - var tb; - for (;;) { - var b1 = heap[1]; - tb = bins[b1]; - if (tb.tm >= tb.mtm && bins[tb.nn].mtm <= tb.tm) break; - if (tb.mtm == bincountMinusOne) b1 = heap[1] = heap[heap[0]--]; - else { - find_nn(bins, b1, false); - tb.tm = i; - } - var err = bins[b1].err; - for (l = 1; (l2 = l + l) <= heap[0]; l = l2) { - if ( - l2 < heap[0] && - bins[heap[l2]].err > bins[heap[l2 + 1]].err - ) - l2++; - if (err <= bins[(h = heap[l2])].err) break; - heap[l] = h; - } - heap[l] = b1; - } - var nb = bins[tb.nn]; - var n1 = tb.cnt; - var n2 = nb.cnt; - var d = 1 / (n1 + n2); - if (hasAlpha) tb.ac = d * (n1 * tb.ac + n2 * nb.ac); - tb.rc = d * (n1 * tb.rc + n2 * nb.rc); - tb.gc = d * (n1 * tb.gc + n2 * nb.gc); - tb.bc = d * (n1 * tb.bc + n2 * nb.bc); - tb.cnt += nb.cnt; - tb.mtm = ++i; - bins[nb.bk].fw = nb.fw; - bins[nb.fw].bk = nb.bk; - nb.mtm = bincountMinusOne; - } - let palette = []; - var k = 0; - for (i = 0; ; ++k) { - let r = clamp(Math.round(bins[i].rc), 0, 255); - let g = clamp(Math.round(bins[i].gc), 0, 255); - let b = clamp(Math.round(bins[i].bc), 0, 255); - let a = 255; - if (hasAlpha) { - a = clamp(Math.round(bins[i].ac), 0, 255); - if (oneBitAlpha) { - const threshold = - typeof oneBitAlpha === "number" ? oneBitAlpha : 127; - a = a <= threshold ? 0 : 255; - } - if (clearAlpha && a <= clearAlphaThreshold) { - r = g = b = clearAlphaColor; - a = 0; - } - } - const color = hasAlpha ? [r, g, b, a] : [r, g, b]; - const exists = existsInPalette(palette, color); - if (!exists) palette.push(color); - if ((i = bins[i].fw) == 0) break; - } - return palette; - } - function existsInPalette(palette, color) { - for (let i = 0; i < palette.length; i++) { - const p = palette[i]; - let matchesRGB = - p[0] === color[0] && p[1] === color[1] && p[2] === color[2]; - let matchesAlpha = - p.length >= 4 && color.length >= 4 ? p[3] === color[3] : true; - if (matchesRGB && matchesAlpha) return true; - } - return false; - } // src/color.js - - function euclideanDistanceSquared(a, b) { - var sum = 0; - var n; - for (n = 0; n < a.length; n++) { - const dx = a[n] - b[n]; - sum += dx * dx; - } - return sum; - } // src/palettize.js - - function roundStep(byte, step) { - return step > 1 ? Math.round(byte / step) * step : byte; - } - function prequantize( - rgba, - { roundRGB = 5, roundAlpha = 10, oneBitAlpha = null } = {}, - ) { - const data = new Uint32Array(rgba.buffer); - for (let i = 0; i < data.length; i++) { - const color = data[i]; - let a = (color >> 24) & 255; - let b = (color >> 16) & 255; - let g = (color >> 8) & 255; - let r = color & 255; - a = roundStep(a, roundAlpha); - if (oneBitAlpha) { - const threshold = - typeof oneBitAlpha === "number" ? oneBitAlpha : 127; - a = a <= threshold ? 0 : 255; - } - r = roundStep(r, roundRGB); - g = roundStep(g, roundRGB); - b = roundStep(b, roundRGB); - data[i] = (a << 24) | (b << 16) | (g << 8) | (r << 0); - } - } - function applyPalette(rgba, palette, format = "rgb565") { - if (!rgba || !rgba.buffer) { - throw new Error("quantize() expected RGBA Uint8Array data"); - } - if ( - !(rgba instanceof Uint8Array) && - !(rgba instanceof Uint8ClampedArray) - ) { - throw new Error("quantize() expected RGBA Uint8Array data"); - } - if (palette.length > 256) { - throw new Error( - "applyPalette() only works with 256 colors or less", - ); - } - const data = new Uint32Array(rgba.buffer); - const length = data.length; - const bincount = format === "rgb444" ? 4096 : 65536; - const index = new Uint8Array(length); - const cache = new Array(bincount); - const hasAlpha = format === "rgba4444"; - if (format === "rgba4444") { - for (let i = 0; i < length; i++) { - const color = data[i]; - const a = (color >> 24) & 255; - const b = (color >> 16) & 255; - const g = (color >> 8) & 255; - const r = color & 255; - const key = rgba8888_to_rgba4444(r, g, b, a); - const idx = - key in cache - ? cache[key] - : (cache[key] = nearestColorIndexRGBA(r, g, b, a, palette)); - index[i] = idx; - } - } else { - const rgb888_to_key = - format === "rgb444" ? rgb888_to_rgb444 : rgb888_to_rgb565; - for (let i = 0; i < length; i++) { - const color = data[i]; - const b = (color >> 16) & 255; - const g = (color >> 8) & 255; - const r = color & 255; - const key = rgb888_to_key(r, g, b); - const idx = - key in cache - ? cache[key] - : (cache[key] = nearestColorIndexRGB(r, g, b, palette)); - index[i] = idx; - } - } - return index; - } - function nearestColorIndexRGBA(r, g, b, a, palette) { - let k = 0; - let mindist = 1e100; - for (let i = 0; i < palette.length; i++) { - const px2 = palette[i]; - const a2 = px2[3]; - let curdist = sqr2(a2 - a); - if (curdist > mindist) continue; - const r2 = px2[0]; - curdist += sqr2(r2 - r); - if (curdist > mindist) continue; - const g2 = px2[1]; - curdist += sqr2(g2 - g); - if (curdist > mindist) continue; - const b2 = px2[2]; - curdist += sqr2(b2 - b); - if (curdist > mindist) continue; - mindist = curdist; - k = i; - } - return k; - } - function nearestColorIndexRGB(r, g, b, palette) { - let k = 0; - let mindist = 1e100; - for (let i = 0; i < palette.length; i++) { - const px2 = palette[i]; - const r2 = px2[0]; - let curdist = sqr2(r2 - r); - if (curdist > mindist) continue; - const g2 = px2[1]; - curdist += sqr2(g2 - g); - if (curdist > mindist) continue; - const b2 = px2[2]; - curdist += sqr2(b2 - b); - if (curdist > mindist) continue; - mindist = curdist; - k = i; - } - return k; - } - function snapColorsToPalette(palette, knownColors, threshold = 5) { - if (!palette.length || !knownColors.length) return; - const paletteRGB = palette.map((p) => p.slice(0, 3)); - const thresholdSq = threshold * threshold; - const dim = palette[0].length; - for (let i = 0; i < knownColors.length; i++) { - let color = knownColors[i]; - if (color.length < dim) { - color = [color[0], color[1], color[2], 255]; - } else if (color.length > dim) { - color = color.slice(0, 3); - } else { - color = color.slice(); - } - const r = nearestColorIndexWithDistance( - paletteRGB, - color.slice(0, 3), - euclideanDistanceSquared, - ); - const idx = r[0]; - const distanceSq = r[1]; - if (distanceSq > 0 && distanceSq <= thresholdSq) { - palette[idx] = color; - } - } - } - function sqr2(a) { - return a * a; - } - function nearestColorIndex( - colors, - pixel, - distanceFn = euclideanDistanceSquared, - ) { - let minDist = Infinity; - let minDistIndex = -1; - for (let j = 0; j < colors.length; j++) { - const paletteColor = colors[j]; - const dist = distanceFn(pixel, paletteColor); - if (dist < minDist) { - minDist = dist; - minDistIndex = j; - } - } - return minDistIndex; - } - function nearestColorIndexWithDistance( - colors, - pixel, - distanceFn = euclideanDistanceSquared, - ) { - let minDist = Infinity; - let minDistIndex = -1; - for (let j = 0; j < colors.length; j++) { - const paletteColor = colors[j]; - const dist = distanceFn(pixel, paletteColor); - if (dist < minDist) { - minDist = dist; - minDistIndex = j; - } - } - return [minDistIndex, minDist]; - } - function nearestColor( - colors, - pixel, - distanceFn = euclideanDistanceSquared, - ) { - return colors[nearestColorIndex(colors, pixel, distanceFn)]; - } // src/index.js - - function GIFEncoder(opt = {}) { - const { initialCapacity = 4096, auto = true } = opt; - const stream = createStream(initialCapacity); - const HSIZE = 5003; - const accum = new Uint8Array(256); - const htab = new Int32Array(HSIZE); - const codetab = new Int32Array(HSIZE); - let hasInit = false; - return { - reset() { - stream.reset(); - hasInit = false; - }, - finish() { - stream.writeByte(constants_default.trailer); - }, - bytes() { - return stream.bytes(); - }, - bytesView() { - return stream.bytesView(); - }, - get buffer() { - return stream.buffer; - }, - get stream() { - return stream; - }, - writeHeader, - writeFrame(index, width, height, opts = {}) { - const { - transparent = false, - transparentIndex = 0, - delay = 0, - palette = null, - repeat = 0, - colorDepth = 8, - dispose = -1, - } = opts; - let first = false; - if (auto) { - if (!hasInit) { - first = true; - writeHeader(); - hasInit = true; - } - } else { - first = Boolean(opts.first); - } - width = Math.max(0, Math.floor(width)); - height = Math.max(0, Math.floor(height)); - if (first) { - if (!palette) { - throw new Error( - "First frame must include a { palette } option", - ); - } - encodeLogicalScreenDescriptor( - stream, - width, - height, - palette, - colorDepth, - ); - encodeColorTable(stream, palette); - if (repeat >= 0) { - encodeNetscapeExt(stream, repeat); - } - } - const delayTime = Math.round(delay / 10); - encodeGraphicControlExt( - stream, - dispose, - delayTime, - transparent, - transparentIndex, - ); - const useLocalColorTable = Boolean(palette) && !first; - encodeImageDescriptor( - stream, - width, - height, - useLocalColorTable ? palette : null, - ); - if (useLocalColorTable) encodeColorTable(stream, palette); - encodePixels( - stream, - index, - width, - height, - colorDepth, - accum, - htab, - codetab, - ); - }, - }; - function writeHeader() { - writeUTFBytes(stream, "GIF89a"); - } - } - function encodeGraphicControlExt( - stream, - dispose, - delay, - transparent, - transparentIndex, - ) { - stream.writeByte(33); - stream.writeByte(249); - stream.writeByte(4); - if (transparentIndex < 0) { - transparentIndex = 0; - transparent = false; - } - var transp, disp; - if (!transparent) { - transp = 0; - disp = 0; - } else { - transp = 1; - disp = 2; - } - if (dispose >= 0) { - disp = dispose & 7; - } - disp <<= 2; - const userInput = 0; - stream.writeByte(0 | disp | userInput | transp); - writeUInt16(stream, delay); - stream.writeByte(transparentIndex || 0); - stream.writeByte(0); - } - function encodeLogicalScreenDescriptor( - stream, - width, - height, - palette, - colorDepth = 8, - ) { - const globalColorTableFlag = 1; - const sortFlag = 0; - const globalColorTableSize = colorTableSize(palette.length) - 1; - const fields = - (globalColorTableFlag << 7) | - ((colorDepth - 1) << 4) | - (sortFlag << 3) | - globalColorTableSize; - const backgroundColorIndex = 0; - const pixelAspectRatio = 0; - writeUInt16(stream, width); - writeUInt16(stream, height); - stream.writeBytes([fields, backgroundColorIndex, pixelAspectRatio]); - } - function encodeNetscapeExt(stream, repeat) { - stream.writeByte(33); - stream.writeByte(255); - stream.writeByte(11); - writeUTFBytes(stream, "NETSCAPE2.0"); - stream.writeByte(3); - stream.writeByte(1); - writeUInt16(stream, repeat); - stream.writeByte(0); - } - function encodeColorTable(stream, palette) { - const colorTableLength = 1 << colorTableSize(palette.length); - for (let i = 0; i < colorTableLength; i++) { - let color = [0, 0, 0]; - if (i < palette.length) { - color = palette[i]; - } - stream.writeByte(color[0]); - stream.writeByte(color[1]); - stream.writeByte(color[2]); - } - } - function encodeImageDescriptor(stream, width, height, localPalette) { - stream.writeByte(44); - writeUInt16(stream, 0); - writeUInt16(stream, 0); - writeUInt16(stream, width); - writeUInt16(stream, height); - if (localPalette) { - const interlace = 0; - const sorted = 0; - const palSize = colorTableSize(localPalette.length) - 1; - stream.writeByte(128 | interlace | sorted | 0 | palSize); - } else { - stream.writeByte(0); - } - } - function encodePixels( - stream, - index, - width, - height, - colorDepth = 8, - accum, - htab, - codetab, - ) { - lzwEncode_default( - width, - height, - index, - colorDepth, - stream, - accum, - htab, - codetab, - ); - } - function writeUInt16(stream, short) { - stream.writeByte(short & 255); - stream.writeByte((short >> 8) & 255); - } - function writeUTFBytes(stream, text) { - for (var i = 0; i < text.length; i++) { - stream.writeByte(text.charCodeAt(i)); - } - } - function colorTableSize(length) { - return Math.max(Math.ceil(Math.log2(length)), 1); - } - var src_default = GIFEncoder; - }, - {}, - ], - 264: [ - function (_dereq_, module, exports) { - "use strict"; - function _interopDefault(ex) { - return ex && typeof ex === "object" && "default" in ex - ? ex["default"] - : ex; - } - var _classCallCheck = _interopDefault( - _dereq_("@babel/runtime/helpers/classCallCheck"), - ); - var _createClass = _interopDefault( - _dereq_("@babel/runtime/helpers/createClass"), - ); - var arr = []; - var each = arr.forEach; - var slice = arr.slice; - function defaults(obj) { - each.call(slice.call(arguments, 1), function (source) { - if (source) { - for (var prop in source) { - if (obj[prop] === undefined) obj[prop] = source[prop]; - } - } - }); - return obj; - } - var cookie = { - create: function create(name, value, minutes, domain) { - var expires; - if (minutes) { - var date = new Date(); - date.setTime(date.getTime() + minutes * 60 * 1000); - expires = "; expires=" + date.toGMTString(); - } else expires = ""; - domain = domain ? "domain=" + domain + ";" : ""; - document.cookie = - name + "=" + value + expires + ";" + domain + "path=/"; - }, - read: function read(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(";"); - for (var i = 0; i < ca.length; i++) { - var c = ca[i]; - while (c.charAt(0) === " ") { - c = c.substring(1, c.length); - } - if (c.indexOf(nameEQ) === 0) - return c.substring(nameEQ.length, c.length); - } - return null; - }, - remove: function remove(name) { - this.create(name, "", -1); - }, - }; - var cookie$1 = { - name: "cookie", - lookup: function lookup(options) { - var found; - if (options.lookupCookie && typeof document !== "undefined") { - var c = cookie.read(options.lookupCookie); - if (c) found = c; - } - return found; - }, - cacheUserLanguage: function cacheUserLanguage(lng, options) { - if (options.lookupCookie && typeof document !== "undefined") { - cookie.create( - options.lookupCookie, - lng, - options.cookieMinutes, - options.cookieDomain, - ); - } - }, - }; - var querystring = { - name: "querystring", - lookup: function lookup(options) { - var found; - if (typeof window !== "undefined") { - var query = window.location.search.substring(1); - var params = query.split("&"); - for (var i = 0; i < params.length; i++) { - var pos = params[i].indexOf("="); - if (pos > 0) { - var key = params[i].substring(0, pos); - if (key === options.lookupQuerystring) { - found = params[i].substring(pos + 1); - } - } - } - } - return found; - }, - }; - var hasLocalStorageSupport; - try { - hasLocalStorageSupport = - window !== "undefined" && window.localStorage !== null; - var testKey = "i18next.translate.boo"; - window.localStorage.setItem(testKey, "foo"); - window.localStorage.removeItem(testKey); - } catch (e) { - hasLocalStorageSupport = false; - } - var localStorage = { - name: "localStorage", - lookup: function lookup(options) { - var found; - if (options.lookupLocalStorage && hasLocalStorageSupport) { - var lng = window.localStorage.getItem( - options.lookupLocalStorage, - ); - if (lng) found = lng; - } - return found; - }, - cacheUserLanguage: function cacheUserLanguage(lng, options) { - if (options.lookupLocalStorage && hasLocalStorageSupport) { - window.localStorage.setItem(options.lookupLocalStorage, lng); - } - }, - }; - var navigator$1 = { - name: "navigator", - lookup: function lookup(options) { - var found = []; - if (typeof navigator !== "undefined") { - if (navigator.languages) { - // chrome only; not an array, so can't use .push.apply instead of iterating - for (var i = 0; i < navigator.languages.length; i++) { - found.push(navigator.languages[i]); - } - } - if (navigator.userLanguage) { - found.push(navigator.userLanguage); - } - if (navigator.language) { - found.push(navigator.language); - } - } - return found.length > 0 ? found : undefined; - }, - }; - var htmlTag = { - name: "htmlTag", - lookup: function lookup(options) { - var found; - var htmlTag = - options.htmlTag || - (typeof document !== "undefined" - ? document.documentElement - : null); - if (htmlTag && typeof htmlTag.getAttribute === "function") { - found = htmlTag.getAttribute("lang"); - } - return found; - }, - }; - var path = { - name: "path", - lookup: function lookup(options) { - var found; - if (typeof window !== "undefined") { - var language = - window.location.pathname.match(/\/([a-zA-Z-]*)/g); - if (language instanceof Array) { - if (typeof options.lookupFromPathIndex === "number") { - if ( - typeof language[options.lookupFromPathIndex] !== "string" - ) { - return undefined; - } - found = language[options.lookupFromPathIndex].replace( - "/", - "", - ); - } else { - found = language[0].replace("/", ""); - } - } - } - return found; - }, - }; - var subdomain = { - name: "subdomain", - lookup: function lookup(options) { - var found; - if (typeof window !== "undefined") { - var language = window.location.href.match( - /(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi, - ); - if (language instanceof Array) { - if (typeof options.lookupFromSubdomainIndex === "number") { - found = language[options.lookupFromSubdomainIndex] - .replace("http://", "") - .replace("https://", "") - .replace(".", ""); - } else { - found = language[0] - .replace("http://", "") - .replace("https://", "") - .replace(".", ""); - } - } - } - return found; - }, - }; - function getDefaults() { - return { - order: [ - "querystring", - "cookie", - "localStorage", - "navigator", - "htmlTag", - ], - lookupQuerystring: "lng", - lookupCookie: "i18next", - lookupLocalStorage: "i18nextLng", - // cache user language - caches: ["localStorage"], - excludeCacheFor: ["cimode"], - //cookieMinutes: 10, - //cookieDomain: 'myDomain' - checkWhitelist: true, - }; - } - var Browser = - /*#__PURE__*/ - (function () { - function Browser(services) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - _classCallCheck(this, Browser); - this.type = "languageDetector"; - this.detectors = {}; - this.init(services, options); - } - _createClass(Browser, [ - { - key: "init", - value: function init(services) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - var i18nOptions = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : {}; - this.services = services; - this.options = defaults( - options, - this.options || {}, - getDefaults(), - ); // backwards compatibility - if (this.options.lookupFromUrlIndex) - this.options.lookupFromPathIndex = - this.options.lookupFromUrlIndex; - this.i18nOptions = i18nOptions; - this.addDetector(cookie$1); - this.addDetector(querystring); - this.addDetector(localStorage); - this.addDetector(navigator$1); - this.addDetector(htmlTag); - this.addDetector(path); - this.addDetector(subdomain); - }, - }, - { - key: "addDetector", - value: function addDetector(detector) { - this.detectors[detector.name] = detector; - }, - }, - { - key: "detect", - value: function detect(detectionOrder) { - var _this = this; - if (!detectionOrder) detectionOrder = this.options.order; - var detected = []; - detectionOrder.forEach(function (detectorName) { - if (_this.detectors[detectorName]) { - var lookup = _this.detectors[detectorName].lookup( - _this.options, - ); - if (lookup && typeof lookup === "string") - lookup = [lookup]; - if (lookup) detected = detected.concat(lookup); - } - }); - var found; - detected.forEach(function (lng) { - if (found) return; - var cleanedLng = - _this.services.languageUtils.formatLanguageCode(lng); - if ( - !_this.options.checkWhitelist || - _this.services.languageUtils.isWhitelisted(cleanedLng) - ) - found = cleanedLng; - }); - if (!found) { - var fallbacks = this.i18nOptions.fallbackLng; - if (typeof fallbacks === "string") - fallbacks = [fallbacks]; - if (!fallbacks) fallbacks = []; - if ( - Object.prototype.toString.apply(fallbacks) === - "[object Array]" - ) { - found = fallbacks[0]; - } else { - found = - fallbacks[0] || - (fallbacks["default"] && fallbacks["default"][0]); - } - } - return found; - }, - }, - { - key: "cacheUserLanguage", - value: function cacheUserLanguage(lng, caches) { - var _this2 = this; - if (!caches) caches = this.options.caches; - if (!caches) return; - if ( - this.options.excludeCacheFor && - this.options.excludeCacheFor.indexOf(lng) > -1 - ) - return; - caches.forEach(function (cacheName) { - if (_this2.detectors[cacheName]) - _this2.detectors[cacheName].cacheUserLanguage( - lng, - _this2.options, - ); - }); - }, - }, - ]); - return Browser; - })(); - Browser.type = "languageDetector"; - module.exports = Browser; - }, - { - "@babel/runtime/helpers/classCallCheck": 265, - "@babel/runtime/helpers/createClass": 266, - }, - ], - 265: [ - function (_dereq_, module, exports) { - arguments[4][5][0].apply(exports, arguments); - }, - { - dup: 5, - }, - ], - 266: [ - function (_dereq_, module, exports) { - arguments[4][6][0].apply(exports, arguments); - }, - { - dup: 6, - }, - ], - 267: [ - function (_dereq_, module, exports) { - "use strict"; - function _interopDefault(ex) { - return ex && typeof ex === "object" && "default" in ex - ? ex["default"] - : ex; - } - var _typeof = _interopDefault( - _dereq_("@babel/runtime/helpers/typeof"), - ); - var _objectSpread = _interopDefault( - _dereq_("@babel/runtime/helpers/objectSpread"), - ); - var _classCallCheck = _interopDefault( - _dereq_("@babel/runtime/helpers/classCallCheck"), - ); - var _createClass = _interopDefault( - _dereq_("@babel/runtime/helpers/createClass"), - ); - var _possibleConstructorReturn = _interopDefault( - _dereq_("@babel/runtime/helpers/possibleConstructorReturn"), - ); - var _getPrototypeOf = _interopDefault( - _dereq_("@babel/runtime/helpers/getPrototypeOf"), - ); - var _assertThisInitialized = _interopDefault( - _dereq_("@babel/runtime/helpers/assertThisInitialized"), - ); - var _inherits = _interopDefault( - _dereq_("@babel/runtime/helpers/inherits"), - ); - var _toConsumableArray = _interopDefault( - _dereq_("@babel/runtime/helpers/toConsumableArray"), - ); - var _slicedToArray = _interopDefault( - _dereq_("@babel/runtime/helpers/slicedToArray"), - ); - var consoleLogger = { - type: "logger", - log: function log(args) { - this.output("log", args); - }, - warn: function warn(args) { - this.output("warn", args); - }, - error: function error(args) { - this.output("error", args); - }, - output: function output(type, args) { - var _console; - /* eslint no-console: 0 */ - if (console && console[type]) - (_console = console)[type].apply( - _console, - _toConsumableArray(args), - ); - }, - }; - var Logger = - /*#__PURE__*/ - (function () { - function Logger(concreteLogger) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - _classCallCheck(this, Logger); - this.init(concreteLogger, options); - } - _createClass(Logger, [ - { - key: "init", - value: function init(concreteLogger) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - this.prefix = options.prefix || "i18next:"; - this.logger = concreteLogger || consoleLogger; - this.options = options; - this.debug = options.debug; - }, - }, - { - key: "setDebug", - value: function setDebug(bool) { - this.debug = bool; - }, - }, - { - key: "log", - value: function log() { - for ( - var _len = arguments.length, - args = new Array(_len), - _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - return this.forward(args, "log", "", true); - }, - }, - { - key: "warn", - value: function warn() { - for ( - var _len2 = arguments.length, - args = new Array(_len2), - _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - return this.forward(args, "warn", "", true); - }, - }, - { - key: "error", - value: function error() { - for ( - var _len3 = arguments.length, - args = new Array(_len3), - _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - return this.forward(args, "error", ""); - }, - }, - { - key: "deprecate", - value: function deprecate() { - for ( - var _len4 = arguments.length, - args = new Array(_len4), - _key4 = 0; - _key4 < _len4; - _key4++ - ) { - args[_key4] = arguments[_key4]; - } - return this.forward( - args, - "warn", - "WARNING DEPRECATED: ", - true, - ); - }, - }, - { - key: "forward", - value: function forward(args, lvl, prefix, debugOnly) { - if (debugOnly && !this.debug) return null; - if (typeof args[0] === "string") - args[0] = "" - .concat(prefix) - .concat(this.prefix, " ") - .concat(args[0]); - return this.logger[lvl](args); - }, - }, - { - key: "create", - value: function create(moduleName) { - return new Logger( - this.logger, - _objectSpread( - {}, - { - prefix: "" - .concat(this.prefix, ":") - .concat(moduleName, ":"), - }, - this.options, - ), - ); - }, - }, - ]); - return Logger; - })(); - var baseLogger = new Logger(); - var EventEmitter = - /*#__PURE__*/ - (function () { - function EventEmitter() { - _classCallCheck(this, EventEmitter); - this.observers = {}; - } - _createClass(EventEmitter, [ - { - key: "on", - value: function on(events, listener) { - var _this = this; - events.split(" ").forEach(function (event) { - _this.observers[event] = _this.observers[event] || []; - _this.observers[event].push(listener); - }); - return this; - }, - }, - { - key: "off", - value: function off(event, listener) { - if (!this.observers[event]) return; - if (!listener) { - delete this.observers[event]; - return; - } - this.observers[event] = this.observers[event].filter( - function (l) { - return l !== listener; - }, - ); - }, - }, - { - key: "emit", - value: function emit(event) { - for ( - var _len = arguments.length, - args = new Array(_len > 1 ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) { - args[_key - 1] = arguments[_key]; - } - if (this.observers[event]) { - var cloned = [].concat(this.observers[event]); - cloned.forEach(function (observer) { - observer.apply(void 0, args); - }); - } - if (this.observers["*"]) { - var _cloned = [].concat(this.observers["*"]); - _cloned.forEach(function (observer) { - observer.apply(observer, [event].concat(args)); - }); - } - }, - }, - ]); - return EventEmitter; - })(); - // http://lea.verou.me/2016/12/resolve-promises-externally-with-this-one-weird-trick/ - function defer() { - var res; - var rej; - var promise = new Promise(function (resolve, reject) { - res = resolve; - rej = reject; - }); - promise.resolve = res; - promise.reject = rej; - return promise; - } - function makeString(object) { - if (object == null) return ""; - /* eslint prefer-template: 0 */ - return "" + object; - } - function copy(a, s, t) { - a.forEach(function (m) { - if (s[m]) t[m] = s[m]; - }); - } - function getLastOfPath(object, path, Empty) { - function cleanKey(key) { - return key && key.indexOf("###") > -1 - ? key.replace(/###/g, ".") - : key; - } - function canNotTraverseDeeper() { - return !object || typeof object === "string"; - } - var stack = - typeof path !== "string" ? [].concat(path) : path.split("."); - while (stack.length > 1) { - if (canNotTraverseDeeper()) return {}; - var key = cleanKey(stack.shift()); - if (!object[key] && Empty) object[key] = new Empty(); - object = object[key]; - } - if (canNotTraverseDeeper()) return {}; - return { - obj: object, - k: cleanKey(stack.shift()), - }; - } - function setPath(object, path, newValue) { - var _getLastOfPath = getLastOfPath(object, path, Object), - obj = _getLastOfPath.obj, - k = _getLastOfPath.k; - obj[k] = newValue; - } - function pushPath(object, path, newValue, concat) { - var _getLastOfPath2 = getLastOfPath(object, path, Object), - obj = _getLastOfPath2.obj, - k = _getLastOfPath2.k; - obj[k] = obj[k] || []; - if (concat) obj[k] = obj[k].concat(newValue); - if (!concat) obj[k].push(newValue); - } - function getPath(object, path) { - var _getLastOfPath3 = getLastOfPath(object, path), - obj = _getLastOfPath3.obj, - k = _getLastOfPath3.k; - if (!obj) return undefined; - return obj[k]; - } - function getPathWithDefaults(data, defaultData, key) { - var value = getPath(data, key); - if (value !== undefined) { - return value; - } // Fallback to default values - - return getPath(defaultData, key); - } - function deepExtend(target, source, overwrite) { - /* eslint no-restricted-syntax: 0 */ - for (var prop in source) { - if (prop in target) { - // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch - if ( - typeof target[prop] === "string" || - target[prop] instanceof String || - typeof source[prop] === "string" || - source[prop] instanceof String - ) { - if (overwrite) target[prop] = source[prop]; - } else { - deepExtend(target[prop], source[prop], overwrite); - } - } else { - target[prop] = source[prop]; - } - } - return target; - } - function regexEscape(str) { - /* eslint no-useless-escape: 0 */ - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } /* eslint-disable */ - - var _entityMap = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - "/": "/", - }; - /* eslint-enable */ - function escape(data) { - if (typeof data === "string") { - return data.replace(/[&<>"'\/]/g, function (s) { - return _entityMap[s]; - }); - } - return data; - } - var ResourceStore = - /*#__PURE__*/ - (function (_EventEmitter) { - _inherits(ResourceStore, _EventEmitter); - function ResourceStore(data) { - var _this; - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : { - ns: ["translation"], - defaultNS: "translation", - }; - _classCallCheck(this, ResourceStore); - _this = _possibleConstructorReturn( - this, - _getPrototypeOf(ResourceStore).call(this), - ); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - _this.data = data || {}; - _this.options = options; - if (_this.options.keySeparator === undefined) { - _this.options.keySeparator = "."; - } - return _this; - } - _createClass(ResourceStore, [ - { - key: "addNamespaces", - value: function addNamespaces(ns) { - if (this.options.ns.indexOf(ns) < 0) { - this.options.ns.push(ns); - } - }, - }, - { - key: "removeNamespaces", - value: function removeNamespaces(ns) { - var index = this.options.ns.indexOf(ns); - if (index > -1) { - this.options.ns.splice(index, 1); - } - }, - }, - { - key: "getResource", - value: function getResource(lng, ns, key) { - var options = - arguments.length > 3 && arguments[3] !== undefined - ? arguments[3] - : {}; - var keySeparator = - options.keySeparator !== undefined - ? options.keySeparator - : this.options.keySeparator; - var path = [lng, ns]; - if (key && typeof key !== "string") path = path.concat(key); - if (key && typeof key === "string") - path = path.concat( - keySeparator ? key.split(keySeparator) : key, - ); - if (lng.indexOf(".") > -1) { - path = lng.split("."); - } - return getPath(this.data, path); - }, - }, - { - key: "addResource", - value: function addResource(lng, ns, key, value) { - var options = - arguments.length > 4 && arguments[4] !== undefined - ? arguments[4] - : { - silent: false, - }; - var keySeparator = this.options.keySeparator; - if (keySeparator === undefined) keySeparator = "."; - var path = [lng, ns]; - if (key) - path = path.concat( - keySeparator ? key.split(keySeparator) : key, - ); - if (lng.indexOf(".") > -1) { - path = lng.split("."); - value = ns; - ns = path[1]; - } - this.addNamespaces(ns); - setPath(this.data, path, value); - if (!options.silent) - this.emit("added", lng, ns, key, value); - }, - }, - { - key: "addResources", - value: function addResources(lng, ns, resources) { - var options = - arguments.length > 3 && arguments[3] !== undefined - ? arguments[3] - : { - silent: false, - }; - /* eslint no-restricted-syntax: 0 */ - for (var m in resources) { - if ( - typeof resources[m] === "string" || - Object.prototype.toString.apply(resources[m]) === - "[object Array]" - ) - this.addResource(lng, ns, m, resources[m], { - silent: true, - }); - } - if (!options.silent) this.emit("added", lng, ns, resources); - }, - }, - { - key: "addResourceBundle", - value: function addResourceBundle( - lng, - ns, - resources, - deep, - overwrite, - ) { - var options = - arguments.length > 5 && arguments[5] !== undefined - ? arguments[5] - : { - silent: false, - }; - var path = [lng, ns]; - if (lng.indexOf(".") > -1) { - path = lng.split("."); - deep = resources; - resources = ns; - ns = path[1]; - } - this.addNamespaces(ns); - var pack = getPath(this.data, path) || {}; - if (deep) { - deepExtend(pack, resources, overwrite); - } else { - pack = _objectSpread({}, pack, resources); - } - setPath(this.data, path, pack); - if (!options.silent) this.emit("added", lng, ns, resources); - }, - }, - { - key: "removeResourceBundle", - value: function removeResourceBundle(lng, ns) { - if (this.hasResourceBundle(lng, ns)) { - delete this.data[lng][ns]; - } - this.removeNamespaces(ns); - this.emit("removed", lng, ns); - }, - }, - { - key: "hasResourceBundle", - value: function hasResourceBundle(lng, ns) { - return this.getResource(lng, ns) !== undefined; - }, - }, - { - key: "getResourceBundle", - value: function getResourceBundle(lng, ns) { - if (!ns) ns = this.options.defaultNS; // COMPATIBILITY: remove extend in v2.1.0 - if (this.options.compatibilityAPI === "v1") - return _objectSpread({}, {}, this.getResource(lng, ns)); - return this.getResource(lng, ns); - }, - }, - { - key: "getDataByLanguage", - value: function getDataByLanguage(lng) { - return this.data[lng]; - }, - }, - { - key: "toJSON", - value: function toJSON() { - return this.data; - }, - }, - ]); - return ResourceStore; - })(EventEmitter); - var postProcessor = { - processors: {}, - addPostProcessor: function addPostProcessor(module) { - this.processors[module.name] = module; - }, - handle: function handle( - processors, - value, - key, - options, - translator, - ) { - var _this = this; - processors.forEach(function (processor) { - if (_this.processors[processor]) - value = _this.processors[processor].process( - value, - key, - options, - translator, - ); - }); - return value; - }, - }; - var checkedLoadedFor = {}; - var Translator = - /*#__PURE__*/ - (function (_EventEmitter) { - _inherits(Translator, _EventEmitter); - function Translator(services) { - var _this; - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - _classCallCheck(this, Translator); - _this = _possibleConstructorReturn( - this, - _getPrototypeOf(Translator).call(this), - ); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - copy( - [ - "resourceStore", - "languageUtils", - "pluralResolver", - "interpolator", - "backendConnector", - "i18nFormat", - "utils", - ], - services, - _assertThisInitialized(_this), - ); - _this.options = options; - if (_this.options.keySeparator === undefined) { - _this.options.keySeparator = "."; - } - _this.logger = baseLogger.create("translator"); - return _this; - } - _createClass(Translator, [ - { - key: "changeLanguage", - value: function changeLanguage(lng) { - if (lng) this.language = lng; - }, - }, - { - key: "exists", - value: function exists(key) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : { - interpolation: {}, - }; - var resolved = this.resolve(key, options); - return resolved && resolved.res !== undefined; - }, - }, - { - key: "extractFromKey", - value: function extractFromKey(key, options) { - var nsSeparator = - options.nsSeparator || this.options.nsSeparator; - if (nsSeparator === undefined) nsSeparator = ":"; - var keySeparator = - options.keySeparator !== undefined - ? options.keySeparator - : this.options.keySeparator; - var namespaces = options.ns || this.options.defaultNS; - if (nsSeparator && key.indexOf(nsSeparator) > -1) { - var parts = key.split(nsSeparator); - if ( - nsSeparator !== keySeparator || - (nsSeparator === keySeparator && - this.options.ns.indexOf(parts[0]) > -1) - ) - namespaces = parts.shift(); - key = parts.join(keySeparator); - } - if (typeof namespaces === "string") - namespaces = [namespaces]; - return { - key: key, - namespaces: namespaces, - }; - }, - }, - { - key: "translate", - value: function translate(keys, options) { - var _this2 = this; - if ( - _typeof(options) !== "object" && - this.options.overloadTranslationOptionHandler - ) { - /* eslint prefer-rest-params: 0 */ - options = - this.options.overloadTranslationOptionHandler( - arguments, - ); - } - if (!options) options = {}; // non valid keys handling - if (keys === undefined || keys === null /* || keys === ''*/) - return ""; - if (!Array.isArray(keys)) keys = [String(keys)]; // separators - var keySeparator = - options.keySeparator !== undefined - ? options.keySeparator - : this.options.keySeparator; // get namespace(s) - var _this$extractFromKey = this.extractFromKey( - keys[keys.length - 1], - options, - ), - key = _this$extractFromKey.key, - namespaces = _this$extractFromKey.namespaces; - var namespace = namespaces[namespaces.length - 1]; // return key on CIMode - var lng = options.lng || this.language; - var appendNamespaceToCIMode = - options.appendNamespaceToCIMode || - this.options.appendNamespaceToCIMode; - if (lng && lng.toLowerCase() === "cimode") { - if (appendNamespaceToCIMode) { - var nsSeparator = - options.nsSeparator || this.options.nsSeparator; - return namespace + nsSeparator + key; - } - return key; - } // resolve from store - - var resolved = this.resolve(keys, options); - var res = resolved && resolved.res; - var resUsedKey = (resolved && resolved.usedKey) || key; - var resExactUsedKey = - (resolved && resolved.exactUsedKey) || key; - var resType = Object.prototype.toString.apply(res); - var noObject = [ - "[object Number]", - "[object Function]", - "[object RegExp]", - ]; - var joinArrays = - options.joinArrays !== undefined - ? options.joinArrays - : this.options.joinArrays; // object - var handleAsObjectInI18nFormat = - !this.i18nFormat || this.i18nFormat.handleAsObject; - var handleAsObject = - typeof res !== "string" && - typeof res !== "boolean" && - typeof res !== "number"; - if ( - handleAsObjectInI18nFormat && - res && - handleAsObject && - noObject.indexOf(resType) < 0 && - !( - typeof joinArrays === "string" && - resType === "[object Array]" - ) - ) { - if ( - !options.returnObjects && - !this.options.returnObjects - ) { - this.logger.warn( - "accessing an object - but returnObjects options is not enabled!", - ); - return this.options.returnedObjectHandler - ? this.options.returnedObjectHandler( - resUsedKey, - res, - options, - ) - : "key '" - .concat(key, " (") - .concat( - this.language, - ")' returned an object instead of string.", - ); - } // if we got a separator we loop over children - else we just return object as is - // as having it set to false means no hierarchy so no lookup for nested values - - if (keySeparator) { - var resTypeIsArray = resType === "[object Array]"; - var copy$$1 = resTypeIsArray ? [] : {}; // apply child translation on a copy - /* eslint no-restricted-syntax: 0 */ - var newKeyToUse = resTypeIsArray - ? resExactUsedKey - : resUsedKey; - for (var m in res) { - if (Object.prototype.hasOwnProperty.call(res, m)) { - var deepKey = "" - .concat(newKeyToUse) - .concat(keySeparator) - .concat(m); - copy$$1[m] = this.translate( - deepKey, - _objectSpread({}, options, { - joinArrays: false, - ns: namespaces, - }), - ); - if (copy$$1[m] === deepKey) copy$$1[m] = res[m]; // if nothing found use orginal value as fallback - } - } - res = copy$$1; - } - } else if ( - handleAsObjectInI18nFormat && - typeof joinArrays === "string" && - resType === "[object Array]" - ) { - // array special treatment - res = res.join(joinArrays); - if (res) res = this.extendTranslation(res, keys, options); - } else { - // string, empty or null - var usedDefault = false; - var usedKey = false; // fallback value - if ( - !this.isValidLookup(res) && - options.defaultValue !== undefined - ) { - usedDefault = true; - if (options.count !== undefined) { - var suffix = this.pluralResolver.getSuffix( - lng, - options.count, - ); - res = options["defaultValue".concat(suffix)]; - } - if (!res) res = options.defaultValue; - } - if (!this.isValidLookup(res)) { - usedKey = true; - res = key; - } // save missing - - var updateMissing = - options.defaultValue && - options.defaultValue !== res && - this.options.updateMissing; - if (usedKey || usedDefault || updateMissing) { - this.logger.log( - updateMissing ? "updateKey" : "missingKey", - lng, - namespace, - key, - updateMissing ? options.defaultValue : res, - ); - var lngs = []; - var fallbackLngs = this.languageUtils.getFallbackCodes( - this.options.fallbackLng, - options.lng || this.language, - ); - if ( - this.options.saveMissingTo === "fallback" && - fallbackLngs && - fallbackLngs[0] - ) { - for (var i = 0; i < fallbackLngs.length; i++) { - lngs.push(fallbackLngs[i]); - } - } else if (this.options.saveMissingTo === "all") { - lngs = this.languageUtils.toResolveHierarchy( - options.lng || this.language, - ); - } else { - lngs.push(options.lng || this.language); - } - var send = function send(l, k) { - if (_this2.options.missingKeyHandler) { - _this2.options.missingKeyHandler( - l, - namespace, - k, - updateMissing ? options.defaultValue : res, - updateMissing, - options, - ); - } else if ( - _this2.backendConnector && - _this2.backendConnector.saveMissing - ) { - _this2.backendConnector.saveMissing( - l, - namespace, - k, - updateMissing ? options.defaultValue : res, - updateMissing, - options, - ); - } - _this2.emit("missingKey", l, namespace, k, res); - }; - if (this.options.saveMissing) { - var needsPluralHandling = - options.count !== undefined && - typeof options.count !== "string"; - if ( - this.options.saveMissingPlurals && - needsPluralHandling - ) { - lngs.forEach(function (l) { - var plurals = - _this2.pluralResolver.getPluralFormsOfKey( - l, - key, - ); - plurals.forEach(function (p) { - return send([l], p); - }); - }); - } else { - send(lngs, key); - } - } - } // extend - - res = this.extendTranslation( - res, - keys, - options, - resolved, - ); // append namespace if still key - if ( - usedKey && - res === key && - this.options.appendNamespaceToMissingKey - ) - res = "".concat(namespace, ":").concat(key); // parseMissingKeyHandler - if (usedKey && this.options.parseMissingKeyHandler) - res = this.options.parseMissingKeyHandler(res); - } // return - - return res; - }, - }, - { - key: "extendTranslation", - value: function extendTranslation( - res, - key, - options, - resolved, - ) { - var _this3 = this; - if (this.i18nFormat && this.i18nFormat.parse) { - res = this.i18nFormat.parse( - res, - options, - resolved.usedLng, - resolved.usedNS, - resolved.usedKey, - { - resolved: resolved, - }, - ); - } else if (!options.skipInterpolation) { - // i18next.parsing - if (options.interpolation) - this.interpolator.init( - _objectSpread({}, options, { - interpolation: _objectSpread( - {}, - this.options.interpolation, - options.interpolation, - ), - }), - ); // interpolate - var data = - options.replace && typeof options.replace !== "string" - ? options.replace - : options; - if (this.options.interpolation.defaultVariables) - data = _objectSpread( - {}, - this.options.interpolation.defaultVariables, - data, - ); - res = this.interpolator.interpolate( - res, - data, - options.lng || this.language, - options, - ); // nesting - if (options.nest !== false) - res = this.interpolator.nest( - res, - function () { - return _this3.translate.apply(_this3, arguments); - }, - options, - ); - if (options.interpolation) this.interpolator.reset(); - } // post process - - var postProcess = - options.postProcess || this.options.postProcess; - var postProcessorNames = - typeof postProcess === "string" - ? [postProcess] - : postProcess; - if ( - res !== undefined && - res !== null && - postProcessorNames && - postProcessorNames.length && - options.applyPostProcessor !== false - ) { - res = postProcessor.handle( - postProcessorNames, - res, - key, - this.options && this.options.postProcessPassResolved - ? _objectSpread( - { - i18nResolved: resolved, - }, - options, - ) - : options, - this, - ); - } - return res; - }, - }, - { - key: "resolve", - value: function resolve(keys) { - var _this4 = this; - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - var found; - var usedKey; // plain key - var exactUsedKey; // key with context / plural - var usedLng; - var usedNS; - if (typeof keys === "string") keys = [keys]; // forEach possible key - keys.forEach(function (k) { - if (_this4.isValidLookup(found)) return; - var extracted = _this4.extractFromKey(k, options); - var key = extracted.key; - usedKey = key; - var namespaces = extracted.namespaces; - if (_this4.options.fallbackNS) - namespaces = namespaces.concat( - _this4.options.fallbackNS, - ); - var needsPluralHandling = - options.count !== undefined && - typeof options.count !== "string"; - var needsContextHandling = - options.context !== undefined && - typeof options.context === "string" && - options.context !== ""; - var codes = options.lngs - ? options.lngs - : _this4.languageUtils.toResolveHierarchy( - options.lng || _this4.language, - options.fallbackLng, - ); - namespaces.forEach(function (ns) { - if (_this4.isValidLookup(found)) return; - usedNS = ns; - if ( - !checkedLoadedFor[ - "".concat(codes[0], "-").concat(ns) - ] && - _this4.utils && - _this4.utils.hasLoadedNamespace && - !_this4.utils.hasLoadedNamespace(usedNS) - ) { - checkedLoadedFor[ - "".concat(codes[0], "-").concat(ns) - ] = true; - _this4.logger.warn( - 'key "' - .concat(usedKey, '" for namespace "') - .concat(usedNS, '" for languages "') - .concat( - codes.join(", "), - "\" won't get resolved as namespace was not yet loaded", - ), - "This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!", - ); - } - codes.forEach(function (code) { - if (_this4.isValidLookup(found)) return; - usedLng = code; - var finalKey = key; - var finalKeys = [finalKey]; - if ( - _this4.i18nFormat && - _this4.i18nFormat.addLookupKeys - ) { - _this4.i18nFormat.addLookupKeys( - finalKeys, - key, - code, - ns, - options, - ); - } else { - var pluralSuffix; - if (needsPluralHandling) - pluralSuffix = _this4.pluralResolver.getSuffix( - code, - options.count, - ); // fallback for plural if context not found - if (needsPluralHandling && needsContextHandling) - finalKeys.push(finalKey + pluralSuffix); // get key for context if needed - if (needsContextHandling) - finalKeys.push( - (finalKey += "" - .concat(_this4.options.contextSeparator) - .concat(options.context)), - ); // get key for plural if needed - if (needsPluralHandling) - finalKeys.push((finalKey += pluralSuffix)); - } // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only - - var possibleKey; - /* eslint no-cond-assign: 0 */ - while ((possibleKey = finalKeys.pop())) { - if (!_this4.isValidLookup(found)) { - exactUsedKey = possibleKey; - found = _this4.getResource( - code, - ns, - possibleKey, - options, - ); - } - } - }); - }); - }); - return { - res: found, - usedKey: usedKey, - exactUsedKey: exactUsedKey, - usedLng: usedLng, - usedNS: usedNS, - }; - }, - }, - { - key: "isValidLookup", - value: function isValidLookup(res) { - return ( - res !== undefined && - !(!this.options.returnNull && res === null) && - !(!this.options.returnEmptyString && res === "") - ); - }, - }, - { - key: "getResource", - value: function getResource(code, ns, key) { - var options = - arguments.length > 3 && arguments[3] !== undefined - ? arguments[3] - : {}; - if (this.i18nFormat && this.i18nFormat.getResource) - return this.i18nFormat.getResource( - code, - ns, - key, - options, - ); - return this.resourceStore.getResource( - code, - ns, - key, - options, - ); - }, - }, - ]); - return Translator; - })(EventEmitter); - function capitalize(string) { - return string.charAt(0).toUpperCase() + string.slice(1); - } - var LanguageUtil = - /*#__PURE__*/ - (function () { - function LanguageUtil(options) { - _classCallCheck(this, LanguageUtil); - this.options = options; - this.whitelist = this.options.whitelist || false; - this.logger = baseLogger.create("languageUtils"); - } - _createClass(LanguageUtil, [ - { - key: "getScriptPartFromCode", - value: function getScriptPartFromCode(code) { - if (!code || code.indexOf("-") < 0) return null; - var p = code.split("-"); - if (p.length === 2) return null; - p.pop(); - return this.formatLanguageCode(p.join("-")); - }, - }, - { - key: "getLanguagePartFromCode", - value: function getLanguagePartFromCode(code) { - if (!code || code.indexOf("-") < 0) return code; - var p = code.split("-"); - return this.formatLanguageCode(p[0]); - }, - }, - { - key: "formatLanguageCode", - value: function formatLanguageCode(code) { - // http://www.iana.org/assignments/language-tags/language-tags.xhtml - if (typeof code === "string" && code.indexOf("-") > -1) { - var specialCases = [ - "hans", - "hant", - "latn", - "cyrl", - "cans", - "mong", - "arab", - ]; - var p = code.split("-"); - if (this.options.lowerCaseLng) { - p = p.map(function (part) { - return part.toLowerCase(); - }); - } else if (p.length === 2) { - p[0] = p[0].toLowerCase(); - p[1] = p[1].toUpperCase(); - if (specialCases.indexOf(p[1].toLowerCase()) > -1) - p[1] = capitalize(p[1].toLowerCase()); - } else if (p.length === 3) { - p[0] = p[0].toLowerCase(); // if lenght 2 guess it's a country - if (p[1].length === 2) p[1] = p[1].toUpperCase(); - if (p[0] !== "sgn" && p[2].length === 2) - p[2] = p[2].toUpperCase(); - if (specialCases.indexOf(p[1].toLowerCase()) > -1) - p[1] = capitalize(p[1].toLowerCase()); - if (specialCases.indexOf(p[2].toLowerCase()) > -1) - p[2] = capitalize(p[2].toLowerCase()); - } - return p.join("-"); - } - return this.options.cleanCode || this.options.lowerCaseLng - ? code.toLowerCase() - : code; - }, - }, - { - key: "isWhitelisted", - value: function isWhitelisted(code) { - if ( - this.options.load === "languageOnly" || - this.options.nonExplicitWhitelist - ) { - code = this.getLanguagePartFromCode(code); - } - return ( - !this.whitelist || - !this.whitelist.length || - this.whitelist.indexOf(code) > -1 - ); - }, - }, - { - key: "getFallbackCodes", - value: function getFallbackCodes(fallbacks, code) { - if (!fallbacks) return []; - if (typeof fallbacks === "string") fallbacks = [fallbacks]; - if ( - Object.prototype.toString.apply(fallbacks) === - "[object Array]" - ) - return fallbacks; - if (!code) return fallbacks["default"] || []; // asume we have an object defining fallbacks - var found = fallbacks[code]; - if (!found) - found = fallbacks[this.getScriptPartFromCode(code)]; - if (!found) - found = fallbacks[this.formatLanguageCode(code)]; - if (!found) found = fallbacks["default"]; - return found || []; - }, - }, - { - key: "toResolveHierarchy", - value: function toResolveHierarchy(code, fallbackCode) { - var _this = this; - var fallbackCodes = this.getFallbackCodes( - fallbackCode || this.options.fallbackLng || [], - code, - ); - var codes = []; - var addCode = function addCode(c) { - if (!c) return; - if (_this.isWhitelisted(c)) { - codes.push(c); - } else { - _this.logger.warn( - "rejecting non-whitelisted language code: ".concat(c), - ); - } - }; - if (typeof code === "string" && code.indexOf("-") > -1) { - if (this.options.load !== "languageOnly") - addCode(this.formatLanguageCode(code)); - if ( - this.options.load !== "languageOnly" && - this.options.load !== "currentOnly" - ) - addCode(this.getScriptPartFromCode(code)); - if (this.options.load !== "currentOnly") - addCode(this.getLanguagePartFromCode(code)); - } else if (typeof code === "string") { - addCode(this.formatLanguageCode(code)); - } - fallbackCodes.forEach(function (fc) { - if (codes.indexOf(fc) < 0) - addCode(_this.formatLanguageCode(fc)); - }); - return codes; - }, - }, - ]); - return LanguageUtil; - })(); - /* eslint-disable */ - var sets = [ - { - lngs: [ - "ach", - "ak", - "am", - "arn", - "br", - "fil", - "gun", - "ln", - "mfe", - "mg", - "mi", - "oc", - "pt", - "pt-BR", - "tg", - "ti", - "tr", - "uz", - "wa", - ], - nr: [1, 2], - fc: 1, - }, - { - lngs: [ - "af", - "an", - "ast", - "az", - "bg", - "bn", - "ca", - "da", - "de", - "dev", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fi", - "fo", - "fur", - "fy", - "gl", - "gu", - "ha", - "hi", - "hu", - "hy", - "ia", - "it", - "kn", - "ku", - "lb", - "mai", - "ml", - "mn", - "mr", - "nah", - "nap", - "nb", - "ne", - "nl", - "nn", - "no", - "nso", - "pa", - "pap", - "pms", - "ps", - "pt-PT", - "rm", - "sco", - "se", - "si", - "so", - "son", - "sq", - "sv", - "sw", - "ta", - "te", - "tk", - "ur", - "yo", - ], - nr: [1, 2], - fc: 2, - }, - { - lngs: [ - "ay", - "bo", - "cgg", - "fa", - "id", - "ja", - "jbo", - "ka", - "kk", - "km", - "ko", - "ky", - "lo", - "ms", - "sah", - "su", - "th", - "tt", - "ug", - "vi", - "wo", - "zh", - ], - nr: [1], - fc: 3, - }, - { - lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], - nr: [1, 2, 5], - fc: 4, - }, - { - lngs: ["ar"], - nr: [0, 1, 2, 3, 11, 100], - fc: 5, - }, - { - lngs: ["cs", "sk"], - nr: [1, 2, 5], - fc: 6, - }, - { - lngs: ["csb", "pl"], - nr: [1, 2, 5], - fc: 7, - }, - { - lngs: ["cy"], - nr: [1, 2, 3, 8], - fc: 8, - }, - { - lngs: ["fr"], - nr: [1, 2], - fc: 9, - }, - { - lngs: ["ga"], - nr: [1, 2, 3, 7, 11], - fc: 10, - }, - { - lngs: ["gd"], - nr: [1, 2, 3, 20], - fc: 11, - }, - { - lngs: ["is"], - nr: [1, 2], - fc: 12, - }, - { - lngs: ["jv"], - nr: [0, 1], - fc: 13, - }, - { - lngs: ["kw"], - nr: [1, 2, 3, 4], - fc: 14, - }, - { - lngs: ["lt"], - nr: [1, 2, 10], - fc: 15, - }, - { - lngs: ["lv"], - nr: [1, 2, 0], - fc: 16, - }, - { - lngs: ["mk"], - nr: [1, 2], - fc: 17, - }, - { - lngs: ["mnk"], - nr: [0, 1, 2], - fc: 18, - }, - { - lngs: ["mt"], - nr: [1, 2, 11, 20], - fc: 19, - }, - { - lngs: ["or"], - nr: [2, 1], - fc: 2, - }, - { - lngs: ["ro"], - nr: [1, 2, 20], - fc: 20, - }, - { - lngs: ["sl"], - nr: [5, 1, 2, 3], - fc: 21, - }, - { - lngs: ["he"], - nr: [1, 2, 20, 21], - fc: 22, - }, - ]; - var _rulesPluralsTypes = { - 1: function _(n) { - return Number(n > 1); - }, - 2: function _(n) { - return Number(n != 1); - }, - 3: function _(n) { - return 0; - }, - 4: function _(n) { - return Number( - n % 10 == 1 && n % 100 != 11 - ? 0 - : n % 10 >= 2 && - n % 10 <= 4 && - (n % 100 < 10 || n % 100 >= 20) - ? 1 - : 2, - ); - }, - 5: function _(n) { - return Number( - n === 0 - ? 0 - : n == 1 - ? 1 - : n == 2 - ? 2 - : n % 100 >= 3 && n % 100 <= 10 - ? 3 - : n % 100 >= 11 - ? 4 - : 5, - ); - }, - 6: function _(n) { - return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); - }, - 7: function _(n) { - return Number( - n == 1 - ? 0 - : n % 10 >= 2 && - n % 10 <= 4 && - (n % 100 < 10 || n % 100 >= 20) - ? 1 - : 2, - ); - }, - 8: function _(n) { - return Number( - n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3, - ); - }, - 9: function _(n) { - return Number(n >= 2); - }, - 10: function _(n) { - return Number( - n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4, - ); - }, - 11: function _(n) { - return Number( - n == 1 || n == 11 - ? 0 - : n == 2 || n == 12 - ? 1 - : n > 2 && n < 20 - ? 2 - : 3, - ); - }, - 12: function _(n) { - return Number(n % 10 != 1 || n % 100 == 11); - }, - 13: function _(n) { - return Number(n !== 0); - }, - 14: function _(n) { - return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); - }, - 15: function _(n) { - return Number( - n % 10 == 1 && n % 100 != 11 - ? 0 - : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) - ? 1 - : 2, - ); - }, - 16: function _(n) { - return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); - }, - 17: function _(n) { - return Number(n == 1 || n % 10 == 1 ? 0 : 1); - }, - 18: function _(n) { - return Number(n == 0 ? 0 : n == 1 ? 1 : 2); - }, - 19: function _(n) { - return Number( - n == 1 - ? 0 - : n === 0 || (n % 100 > 1 && n % 100 < 11) - ? 1 - : n % 100 > 10 && n % 100 < 20 - ? 2 - : 3, - ); - }, - 20: function _(n) { - return Number( - n == 1 ? 0 : n === 0 || (n % 100 > 0 && n % 100 < 20) ? 1 : 2, - ); - }, - 21: function _(n) { - return Number( - n % 100 == 1 - ? 1 - : n % 100 == 2 - ? 2 - : n % 100 == 3 || n % 100 == 4 - ? 3 - : 0, - ); - }, - 22: function _(n) { - return Number( - n === 1 - ? 0 - : n === 2 - ? 1 - : (n < 0 || n > 10) && n % 10 == 0 - ? 2 - : 3, - ); - }, - }; - /* eslint-enable */ - function createRules() { - var rules = {}; - sets.forEach(function (set) { - set.lngs.forEach(function (l) { - rules[l] = { - numbers: set.nr, - plurals: _rulesPluralsTypes[set.fc], - }; - }); - }); - return rules; - } - var PluralResolver = - /*#__PURE__*/ - (function () { - function PluralResolver(languageUtils) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - _classCallCheck(this, PluralResolver); - this.languageUtils = languageUtils; - this.options = options; - this.logger = baseLogger.create("pluralResolver"); - this.rules = createRules(); - } - _createClass(PluralResolver, [ - { - key: "addRule", - value: function addRule(lng, obj) { - this.rules[lng] = obj; - }, - }, - { - key: "getRule", - value: function getRule(code) { - return ( - this.rules[code] || - this.rules[ - this.languageUtils.getLanguagePartFromCode(code) - ] - ); - }, - }, - { - key: "needsPlural", - value: function needsPlural(code) { - var rule = this.getRule(code); - return rule && rule.numbers.length > 1; - }, - }, - { - key: "getPluralFormsOfKey", - value: function getPluralFormsOfKey(code, key) { - var _this = this; - var ret = []; - var rule = this.getRule(code); - if (!rule) return ret; - rule.numbers.forEach(function (n) { - var suffix = _this.getSuffix(code, n); - ret.push("".concat(key).concat(suffix)); - }); - return ret; - }, - }, - { - key: "getSuffix", - value: function getSuffix(code, count) { - var _this2 = this; - var rule = this.getRule(code); - if (rule) { - // if (rule.numbers.length === 1) return ''; // only singular - var idx = rule.noAbs - ? rule.plurals(count) - : rule.plurals(Math.abs(count)); - var suffix = rule.numbers[idx]; // special treatment for lngs only having singular and plural - if ( - this.options.simplifyPluralSuffix && - rule.numbers.length === 2 && - rule.numbers[0] === 1 - ) { - if (suffix === 2) { - suffix = "plural"; - } else if (suffix === 1) { - suffix = ""; - } - } - var returnSuffix = function returnSuffix() { - return _this2.options.prepend && suffix.toString() - ? _this2.options.prepend + suffix.toString() - : suffix.toString(); - }; // COMPATIBILITY JSON - // v1 - if (this.options.compatibilityJSON === "v1") { - if (suffix === 1) return ""; - if (typeof suffix === "number") - return "_plural_".concat(suffix.toString()); - return returnSuffix(); - } else if ( - /* v2 */ - this.options.compatibilityJSON === "v2" - ) { - return returnSuffix(); - } else if ( - /* v3 - gettext index */ - this.options.simplifyPluralSuffix && - rule.numbers.length === 2 && - rule.numbers[0] === 1 - ) { - return returnSuffix(); - } - return this.options.prepend && idx.toString() - ? this.options.prepend + idx.toString() - : idx.toString(); - } - this.logger.warn("no plural rule found for: ".concat(code)); - return ""; - }, - }, - ]); - return PluralResolver; - })(); - var Interpolator = - /*#__PURE__*/ - (function () { - function Interpolator() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - _classCallCheck(this, Interpolator); - this.logger = baseLogger.create("interpolator"); - this.options = options; - this.format = - (options.interpolation && options.interpolation.format) || - function (value) { - return value; - }; - this.init(options); - } /* eslint no-param-reassign: 0 */ - - _createClass(Interpolator, [ - { - key: "init", - value: function init() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - if (!options.interpolation) - options.interpolation = { - escapeValue: true, - }; - var iOpts = options.interpolation; - this.escape = - iOpts.escape !== undefined ? iOpts.escape : escape; - this.escapeValue = - iOpts.escapeValue !== undefined - ? iOpts.escapeValue - : true; - this.useRawValueToEscape = - iOpts.useRawValueToEscape !== undefined - ? iOpts.useRawValueToEscape - : false; - this.prefix = iOpts.prefix - ? regexEscape(iOpts.prefix) - : iOpts.prefixEscaped || "{{"; - this.suffix = iOpts.suffix - ? regexEscape(iOpts.suffix) - : iOpts.suffixEscaped || "}}"; - this.formatSeparator = iOpts.formatSeparator - ? iOpts.formatSeparator - : iOpts.formatSeparator || ","; - this.unescapePrefix = iOpts.unescapeSuffix - ? "" - : iOpts.unescapePrefix || "-"; - this.unescapeSuffix = this.unescapePrefix - ? "" - : iOpts.unescapeSuffix || ""; - this.nestingPrefix = iOpts.nestingPrefix - ? regexEscape(iOpts.nestingPrefix) - : iOpts.nestingPrefixEscaped || regexEscape("$t("); - this.nestingSuffix = iOpts.nestingSuffix - ? regexEscape(iOpts.nestingSuffix) - : iOpts.nestingSuffixEscaped || regexEscape(")"); - this.maxReplaces = iOpts.maxReplaces - ? iOpts.maxReplaces - : 1000; // the regexp - this.resetRegExp(); - }, - }, - { - key: "reset", - value: function reset() { - if (this.options) this.init(this.options); - }, - }, - { - key: "resetRegExp", - value: function resetRegExp() { - // the regexp - var regexpStr = "" - .concat(this.prefix, "(.+?)") - .concat(this.suffix); - this.regexp = new RegExp(regexpStr, "g"); - var regexpUnescapeStr = "" - .concat(this.prefix) - .concat(this.unescapePrefix, "(.+?)") - .concat(this.unescapeSuffix) - .concat(this.suffix); - this.regexpUnescape = new RegExp(regexpUnescapeStr, "g"); - var nestingRegexpStr = "" - .concat(this.nestingPrefix, "(.+?)") - .concat(this.nestingSuffix); - this.nestingRegexp = new RegExp(nestingRegexpStr, "g"); - }, - }, - { - key: "interpolate", - value: function interpolate(str, data, lng, options) { - var _this = this; - var match; - var value; - var replaces; - var defaultData = - (this.options && - this.options.interpolation && - this.options.interpolation.defaultVariables) || - {}; - function regexSafe(val) { - return val.replace(/\$/g, "$$$$"); - } - var handleFormat = function handleFormat(key) { - if (key.indexOf(_this.formatSeparator) < 0) { - return getPathWithDefaults(data, defaultData, key); - } - var p = key.split(_this.formatSeparator); - var k = p.shift().trim(); - var f = p.join(_this.formatSeparator).trim(); - return _this.format( - getPathWithDefaults(data, defaultData, k), - f, - lng, - ); - }; - this.resetRegExp(); - var missingInterpolationHandler = - (options && options.missingInterpolationHandler) || - this.options.missingInterpolationHandler; - replaces = 0; // unescape if has unescapePrefix/Suffix - /* eslint no-cond-assign: 0 */ - while ((match = this.regexpUnescape.exec(str))) { - value = handleFormat(match[1].trim()); - if (value === undefined) { - if (typeof missingInterpolationHandler === "function") { - var temp = missingInterpolationHandler( - str, - match, - options, - ); - value = typeof temp === "string" ? temp : ""; - } else { - this.logger.warn( - "missed to pass in variable " - .concat(match[1], " for interpolating ") - .concat(str), - ); - value = ""; - } - } else if ( - typeof value !== "string" && - !this.useRawValueToEscape - ) { - value = makeString(value); - } - str = str.replace(match[0], regexSafe(value)); - this.regexpUnescape.lastIndex = 0; - replaces++; - if (replaces >= this.maxReplaces) { - break; - } - } - replaces = 0; // regular escape on demand - while ((match = this.regexp.exec(str))) { - value = handleFormat(match[1].trim()); - if (value === undefined) { - if (typeof missingInterpolationHandler === "function") { - var _temp = missingInterpolationHandler( - str, - match, - options, - ); - value = typeof _temp === "string" ? _temp : ""; - } else { - this.logger.warn( - "missed to pass in variable " - .concat(match[1], " for interpolating ") - .concat(str), - ); - value = ""; - } - } else if ( - typeof value !== "string" && - !this.useRawValueToEscape - ) { - value = makeString(value); - } - value = this.escapeValue - ? regexSafe(this.escape(value)) - : regexSafe(value); - str = str.replace(match[0], value); - this.regexp.lastIndex = 0; - replaces++; - if (replaces >= this.maxReplaces) { - break; - } - } - return str; - }, - }, - { - key: "nest", - value: function nest(str, fc) { - var options = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : {}; - var match; - var value; - var clonedOptions = _objectSpread({}, options); - clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup - delete clonedOptions.defaultValue; // assert we do not get a endless loop on interpolating defaultValue again and again - // if value is something like "myKey": "lorem $(anotherKey, { "count": {{aValueInOptions}} })" - function handleHasOptions(key, inheritedOptions) { - if (key.indexOf(",") < 0) return key; - var p = key.split(","); - key = p.shift(); - var optionsString = p.join(","); - optionsString = this.interpolate( - optionsString, - clonedOptions, - ); - optionsString = optionsString.replace(/'/g, '"'); - try { - clonedOptions = JSON.parse(optionsString); - if (inheritedOptions) - clonedOptions = _objectSpread( - {}, - inheritedOptions, - clonedOptions, - ); - } catch (e) { - this.logger.error( - "failed parsing options string in nesting for key ".concat( - key, - ), - e, - ); - } // assert we do not get a endless loop on interpolating defaultValue again and again - - delete clonedOptions.defaultValue; - return key; - } // regular escape on demand - - while ((match = this.nestingRegexp.exec(str))) { - value = fc( - handleHasOptions.call( - this, - match[1].trim(), - clonedOptions, - ), - clonedOptions, - ); // is only the nesting key (key1 = '$(key2)') return the value without stringify - if ( - value && - match[0] === str && - typeof value !== "string" - ) - return value; // no string to include or empty - if (typeof value !== "string") value = makeString(value); - if (!value) { - this.logger.warn( - "missed to resolve " - .concat(match[1], " for nesting ") - .concat(str), - ); - value = ""; - } // Nested keys should not be escaped by default #854 - // value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value); - - str = str.replace(match[0], value); - this.regexp.lastIndex = 0; - } - return str; - }, - }, - ]); - return Interpolator; - })(); - function remove(arr, what) { - var found = arr.indexOf(what); - while (found !== -1) { - arr.splice(found, 1); - found = arr.indexOf(what); - } - } - var Connector = - /*#__PURE__*/ - (function (_EventEmitter) { - _inherits(Connector, _EventEmitter); - function Connector(backend, store, services) { - var _this; - var options = - arguments.length > 3 && arguments[3] !== undefined - ? arguments[3] - : {}; - _classCallCheck(this, Connector); - _this = _possibleConstructorReturn( - this, - _getPrototypeOf(Connector).call(this), - ); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - _this.backend = backend; - _this.store = store; - _this.services = services; - _this.languageUtils = services.languageUtils; - _this.options = options; - _this.logger = baseLogger.create("backendConnector"); - _this.state = {}; - _this.queue = []; - if (_this.backend && _this.backend.init) { - _this.backend.init(services, options.backend, options); - } - return _this; - } - _createClass(Connector, [ - { - key: "queueLoad", - value: function queueLoad( - languages, - namespaces, - options, - callback, - ) { - var _this2 = this; - // find what needs to be loaded - var toLoad = []; - var pending = []; - var toLoadLanguages = []; - var toLoadNamespaces = []; - languages.forEach(function (lng) { - var hasAllNamespaces = true; - namespaces.forEach(function (ns) { - var name = "".concat(lng, "|").concat(ns); - if ( - !options.reload && - _this2.store.hasResourceBundle(lng, ns) - ) { - _this2.state[name] = 2; // loaded - } else if (_this2.state[name] < 0); - else if (_this2.state[name] === 1) { - if (pending.indexOf(name) < 0) pending.push(name); - } else { - _this2.state[name] = 1; // pending - hasAllNamespaces = false; - if (pending.indexOf(name) < 0) pending.push(name); - if (toLoad.indexOf(name) < 0) toLoad.push(name); - if (toLoadNamespaces.indexOf(ns) < 0) - toLoadNamespaces.push(ns); - } - }); - if (!hasAllNamespaces) toLoadLanguages.push(lng); - }); - if (toLoad.length || pending.length) { - this.queue.push({ - pending: pending, - loaded: {}, - errors: [], - callback: callback, - }); - } - return { - toLoad: toLoad, - pending: pending, - toLoadLanguages: toLoadLanguages, - toLoadNamespaces: toLoadNamespaces, - }; - }, - }, - { - key: "loaded", - value: function loaded(name, err, data) { - var _name$split = name.split("|"), - _name$split2 = _slicedToArray(_name$split, 2), - lng = _name$split2[0], - ns = _name$split2[1]; - if (err) this.emit("failedLoading", lng, ns, err); - if (data) { - this.store.addResourceBundle(lng, ns, data); - } // set loaded - - this.state[name] = err ? -1 : 2; // consolidated loading done in this run - only emit once for a loaded namespace - var loaded = {}; // callback if ready - this.queue.forEach(function (q) { - pushPath(q.loaded, [lng], ns); - remove(q.pending, name); - if (err) q.errors.push(err); - if (q.pending.length === 0 && !q.done) { - // only do once per loaded -> this.emit('loaded', q.loaded); - Object.keys(q.loaded).forEach(function (l) { - if (!loaded[l]) loaded[l] = []; - if (q.loaded[l].length) { - q.loaded[l].forEach(function (ns) { - if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns); - }); - } - }); - /* eslint no-param-reassign: 0 */ - q.done = true; - if (q.errors.length) { - q.callback(q.errors); - } else { - q.callback(); - } - } - }); // emit consolidated loaded event - this.emit("loaded", loaded); // remove done load requests - this.queue = this.queue.filter(function (q) { - return !q.done; - }); - }, - }, - { - key: "read", - value: function read(lng, ns, fcName) { - var _this3 = this; - var tried = - arguments.length > 3 && arguments[3] !== undefined - ? arguments[3] - : 0; - var wait = - arguments.length > 4 && arguments[4] !== undefined - ? arguments[4] - : 250; - var callback = - arguments.length > 5 ? arguments[5] : undefined; - if (!lng.length) return callback(null, {}); // noting to load - return this.backend[fcName](lng, ns, function (err, data) { - if (err && data /* = retryFlag */ && tried < 5) { - setTimeout(function () { - _this3.read.call( - _this3, - lng, - ns, - fcName, - tried + 1, - wait * 2, - callback, - ); - }, wait); - return; - } - callback(err, data); - }); - } /* eslint consistent-return: 0 */, - }, - { - key: "prepareLoading", - value: function prepareLoading(languages, namespaces) { - var _this4 = this; - var options = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : {}; - var callback = - arguments.length > 3 ? arguments[3] : undefined; - if (!this.backend) { - this.logger.warn( - "No backend was added via i18next.use. Will not load resources.", - ); - return callback && callback(); - } - if (typeof languages === "string") - languages = - this.languageUtils.toResolveHierarchy(languages); - if (typeof namespaces === "string") - namespaces = [namespaces]; - var toLoad = this.queueLoad( - languages, - namespaces, - options, - callback, - ); - if (!toLoad.toLoad.length) { - if (!toLoad.pending.length) callback(); // nothing to load and no pendings...callback now - return null; // pendings will trigger callback - } - toLoad.toLoad.forEach(function (name) { - _this4.loadOne(name); - }); - }, - }, - { - key: "load", - value: function load(languages, namespaces, callback) { - this.prepareLoading(languages, namespaces, {}, callback); - }, - }, - { - key: "reload", - value: function reload(languages, namespaces, callback) { - this.prepareLoading( - languages, - namespaces, - { - reload: true, - }, - callback, - ); - }, - }, - { - key: "loadOne", - value: function loadOne(name) { - var _this5 = this; - var prefix = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : ""; - var _name$split3 = name.split("|"), - _name$split4 = _slicedToArray(_name$split3, 2), - lng = _name$split4[0], - ns = _name$split4[1]; - this.read( - lng, - ns, - "read", - null, - null, - function (err, data) { - if (err) - _this5.logger.warn( - "" - .concat(prefix, "loading namespace ") - .concat(ns, " for language ") - .concat(lng, " failed"), - err, - ); - if (!err && data) - _this5.logger.log( - "" - .concat(prefix, "loaded namespace ") - .concat(ns, " for language ") - .concat(lng), - data, - ); - _this5.loaded(name, err, data); - }, - ); - }, - }, - { - key: "saveMissing", - value: function saveMissing( - languages, - namespace, - key, - fallbackValue, - isUpdate, - ) { - var options = - arguments.length > 5 && arguments[5] !== undefined - ? arguments[5] - : {}; - if ( - this.services.utils && - this.services.utils.hasLoadedNamespace && - !this.services.utils.hasLoadedNamespace(namespace) - ) { - this.logger.warn( - 'did not save key "' - .concat(key, '" for namespace "') - .concat( - namespace, - '" as the namespace was not yet loaded', - ), - "This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!", - ); - return; - } // ignore non valid keys - - if (key === undefined || key === null || key === "") return; - if (this.backend && this.backend.create) { - this.backend.create( - languages, - namespace, - key, - fallbackValue, - null /* unused callback */, - _objectSpread({}, options, { - isUpdate: isUpdate, - }), - ); - } // write to store to avoid resending - - if (!languages || !languages[0]) return; - this.store.addResource( - languages[0], - namespace, - key, - fallbackValue, - ); - }, - }, - ]); - return Connector; - })(EventEmitter); - function get() { - return { - debug: false, - initImmediate: true, - ns: ["translation"], - defaultNS: ["translation"], - fallbackLng: ["dev"], - fallbackNS: false, - // string or array of namespaces - whitelist: false, - // array with whitelisted languages - nonExplicitWhitelist: false, - load: "all", - // | currentOnly | languageOnly - preload: false, - // array with preload languages - simplifyPluralSuffix: true, - keySeparator: ".", - nsSeparator: ":", - pluralSeparator: "_", - contextSeparator: "_", - partialBundledLanguages: false, - // allow bundling certain languages that are not remotely fetched - saveMissing: false, - // enable to send missing values - updateMissing: false, - // enable to update default values if different from translated value (only useful on initial development, or when keeping code as source of truth) - saveMissingTo: "fallback", - // 'current' || 'all' - saveMissingPlurals: true, - // will save all forms not only singular key - missingKeyHandler: false, - // function(lng, ns, key, fallbackValue) -> override if prefer on handling - missingInterpolationHandler: false, - // function(str, match) - postProcess: false, - // string or array of postProcessor names - postProcessPassResolved: false, - // pass resolved object into 'options.i18nResolved' for postprocessor - returnNull: true, - // allows null value as valid translation - returnEmptyString: true, - // allows empty string value as valid translation - returnObjects: false, - joinArrays: false, - // or string to join array - returnedObjectHandler: false, - // function(key, value, options) triggered if key returns object but returnObjects is set to false - parseMissingKeyHandler: false, - // function(key) parsed a key that was not found in t() before returning - appendNamespaceToMissingKey: false, - appendNamespaceToCIMode: false, - overloadTranslationOptionHandler: function handle(args) { - var ret = {}; - if (_typeof(args[1]) === "object") ret = args[1]; - if (typeof args[1] === "string") ret.defaultValue = args[1]; - if (typeof args[2] === "string") ret.tDescription = args[2]; - if ( - _typeof(args[2]) === "object" || - _typeof(args[3]) === "object" - ) { - var options = args[3] || args[2]; - Object.keys(options).forEach(function (key) { - ret[key] = options[key]; - }); - } - return ret; - }, - interpolation: { - escapeValue: true, - format: function format(value, _format, lng) { - return value; - }, - prefix: "{{", - suffix: "}}", - formatSeparator: ",", - // prefixEscaped: '{{', - // suffixEscaped: '}}', - // unescapeSuffix: '', - unescapePrefix: "-", - nestingPrefix: "$t(", - nestingSuffix: ")", - // nestingPrefixEscaped: '$t(', - // nestingSuffixEscaped: ')', - // defaultVariables: undefined // object that can have values to interpolate on - extends passed in interpolation data - maxReplaces: 1000, // max replaces to prevent endless loop - }, - }; - } /* eslint no-param-reassign: 0 */ - - function transformOptions(options) { - // create namespace object if namespace is passed in as string - if (typeof options.ns === "string") options.ns = [options.ns]; - if (typeof options.fallbackLng === "string") - options.fallbackLng = [options.fallbackLng]; - if (typeof options.fallbackNS === "string") - options.fallbackNS = [options.fallbackNS]; // extend whitelist with cimode - if (options.whitelist && options.whitelist.indexOf("cimode") < 0) { - options.whitelist = options.whitelist.concat(["cimode"]); - } - return options; - } - function noop() {} - var I18n = - /*#__PURE__*/ - (function (_EventEmitter) { - _inherits(I18n, _EventEmitter); - function I18n() { - var _this; - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - var callback = arguments.length > 1 ? arguments[1] : undefined; - _classCallCheck(this, I18n); - _this = _possibleConstructorReturn( - this, - _getPrototypeOf(I18n).call(this), - ); - EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor) - _this.options = transformOptions(options); - _this.services = {}; - _this.logger = baseLogger; - _this.modules = { - external: [], - }; - if (callback && !_this.isInitialized && !options.isClone) { - // https://github.com/i18next/i18next/issues/879 - if (!_this.options.initImmediate) { - _this.init(options, callback); - return _possibleConstructorReturn( - _this, - _assertThisInitialized(_this), - ); - } - setTimeout(function () { - _this.init(options, callback); - }, 0); - } - return _this; - } - _createClass(I18n, [ - { - key: "init", - value: function init() { - var _this2 = this; - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - var callback = - arguments.length > 1 ? arguments[1] : undefined; - if (typeof options === "function") { - callback = options; - options = {}; - } - this.options = _objectSpread( - {}, - get(), - this.options, - transformOptions(options), - ); - this.format = this.options.interpolation.format; - if (!callback) callback = noop; - function createClassOnDemand(ClassOrObject) { - if (!ClassOrObject) return null; - if (typeof ClassOrObject === "function") - return new ClassOrObject(); - return ClassOrObject; - } // init services - - if (!this.options.isClone) { - if (this.modules.logger) { - baseLogger.init( - createClassOnDemand(this.modules.logger), - this.options, - ); - } else { - baseLogger.init(null, this.options); - } - var lu = new LanguageUtil(this.options); - this.store = new ResourceStore( - this.options.resources, - this.options, - ); - var s = this.services; - s.logger = baseLogger; - s.resourceStore = this.store; - s.languageUtils = lu; - s.pluralResolver = new PluralResolver(lu, { - prepend: this.options.pluralSeparator, - compatibilityJSON: this.options.compatibilityJSON, - simplifyPluralSuffix: this.options.simplifyPluralSuffix, - }); - s.interpolator = new Interpolator(this.options); - s.utils = { - hasLoadedNamespace: this.hasLoadedNamespace.bind(this), - }; - s.backendConnector = new Connector( - createClassOnDemand(this.modules.backend), - s.resourceStore, - s, - this.options, - ); // pipe events from backendConnector - s.backendConnector.on("*", function (event) { - for ( - var _len = arguments.length, - args = new Array(_len > 1 ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) { - args[_key - 1] = arguments[_key]; - } - _this2.emit.apply(_this2, [event].concat(args)); - }); - if (this.modules.languageDetector) { - s.languageDetector = createClassOnDemand( - this.modules.languageDetector, - ); - s.languageDetector.init( - s, - this.options.detection, - this.options, - ); - } - if (this.modules.i18nFormat) { - s.i18nFormat = createClassOnDemand( - this.modules.i18nFormat, - ); - if (s.i18nFormat.init) s.i18nFormat.init(this); - } - this.translator = new Translator( - this.services, - this.options, - ); // pipe events from translator - this.translator.on("*", function (event) { - for ( - var _len2 = arguments.length, - args = new Array(_len2 > 1 ? _len2 - 1 : 0), - _key2 = 1; - _key2 < _len2; - _key2++ - ) { - args[_key2 - 1] = arguments[_key2]; - } - _this2.emit.apply(_this2, [event].concat(args)); - }); - this.modules.external.forEach(function (m) { - if (m.init) m.init(_this2); - }); - } // append api - - var storeApi = [ - "getResource", - "addResource", - "addResources", - "addResourceBundle", - "removeResourceBundle", - "hasResourceBundle", - "getResourceBundle", - "getDataByLanguage", - ]; - storeApi.forEach(function (fcName) { - _this2[fcName] = function () { - var _this2$store; - return (_this2$store = _this2.store)[fcName].apply( - _this2$store, - arguments, - ); - }; - }); - var deferred = defer(); - var load = function load() { - _this2.changeLanguage( - _this2.options.lng, - function (err, t) { - _this2.isInitialized = true; - _this2.logger.log("initialized", _this2.options); - _this2.emit("initialized", _this2.options); - deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning) - callback(err, t); - }, - ); - }; - if (this.options.resources || !this.options.initImmediate) { - load(); - } else { - setTimeout(load, 0); - } - return deferred; - } /* eslint consistent-return: 0 */, - }, - { - key: "loadResources", - value: function loadResources(language) { - var _this3 = this; - var callback = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : noop; - var usedCallback = callback; - var usedLng = - typeof language === "string" ? language : this.language; - if (typeof language === "function") usedCallback = language; - if ( - !this.options.resources || - this.options.partialBundledLanguages - ) { - if (usedLng && usedLng.toLowerCase() === "cimode") - return usedCallback(); // avoid loading resources for cimode - var toLoad = []; - var append = function append(lng) { - if (!lng) return; - var lngs = - _this3.services.languageUtils.toResolveHierarchy(lng); - lngs.forEach(function (l) { - if (toLoad.indexOf(l) < 0) toLoad.push(l); - }); - }; - if (!usedLng) { - // at least load fallbacks in this case - var fallbacks = - this.services.languageUtils.getFallbackCodes( - this.options.fallbackLng, - ); - fallbacks.forEach(function (l) { - return append(l); - }); - } else { - append(usedLng); - } - if (this.options.preload) { - this.options.preload.forEach(function (l) { - return append(l); - }); - } - this.services.backendConnector.load( - toLoad, - this.options.ns, - usedCallback, - ); - } else { - usedCallback(null); - } - }, - }, - { - key: "reloadResources", - value: function reloadResources(lngs, ns, callback) { - var deferred = defer(); - if (!lngs) lngs = this.languages; - if (!ns) ns = this.options.ns; - if (!callback) callback = noop; - this.services.backendConnector.reload( - lngs, - ns, - function (err) { - deferred.resolve(); // not rejecting on err (as err is only a loading translation failed warning) - callback(err); - }, - ); - return deferred; - }, - }, - { - key: "use", - value: function use(module) { - if (module.type === "backend") { - this.modules.backend = module; - } - if ( - module.type === "logger" || - (module.log && module.warn && module.error) - ) { - this.modules.logger = module; - } - if (module.type === "languageDetector") { - this.modules.languageDetector = module; - } - if (module.type === "i18nFormat") { - this.modules.i18nFormat = module; - } - if (module.type === "postProcessor") { - postProcessor.addPostProcessor(module); - } - if (module.type === "3rdParty") { - this.modules.external.push(module); - } - return this; - }, - }, - { - key: "changeLanguage", - value: function changeLanguage(lng, callback) { - var _this4 = this; - this.isLanguageChangingTo = lng; - var deferred = defer(); - this.emit("languageChanging", lng); - var done = function done(err, l) { - if (l) { - _this4.language = l; - _this4.languages = - _this4.services.languageUtils.toResolveHierarchy(l); - _this4.translator.changeLanguage(l); - _this4.isLanguageChangingTo = undefined; - _this4.emit("languageChanged", l); - _this4.logger.log("languageChanged", l); - } else { - _this4.isLanguageChangingTo = undefined; - } - deferred.resolve(function () { - return _this4.t.apply(_this4, arguments); - }); - if (callback) - callback(err, function () { - return _this4.t.apply(_this4, arguments); - }); - }; - var setLng = function setLng(l) { - if (l) { - if (!_this4.language) { - _this4.language = l; - _this4.languages = - _this4.services.languageUtils.toResolveHierarchy(l); - } - if (!_this4.translator.language) - _this4.translator.changeLanguage(l); - if (_this4.services.languageDetector) - _this4.services.languageDetector.cacheUserLanguage(l); - } - _this4.loadResources(l, function (err) { - done(err, l); - }); - }; - if ( - !lng && - this.services.languageDetector && - !this.services.languageDetector.async - ) { - setLng(this.services.languageDetector.detect()); - } else if ( - !lng && - this.services.languageDetector && - this.services.languageDetector.async - ) { - this.services.languageDetector.detect(setLng); - } else { - setLng(lng); - } - return deferred; - }, - }, - { - key: "getFixedT", - value: function getFixedT(lng, ns) { - var _this5 = this; - var fixedT = function fixedT(key, opts) { - var options; - if (_typeof(opts) !== "object") { - for ( - var _len3 = arguments.length, - rest = new Array(_len3 > 2 ? _len3 - 2 : 0), - _key3 = 2; - _key3 < _len3; - _key3++ - ) { - rest[_key3 - 2] = arguments[_key3]; - } - options = - _this5.options.overloadTranslationOptionHandler( - [key, opts].concat(rest), - ); - } else { - options = _objectSpread({}, opts); - } - options.lng = options.lng || fixedT.lng; - options.lngs = options.lngs || fixedT.lngs; - options.ns = options.ns || fixedT.ns; - return _this5.t(key, options); - }; - if (typeof lng === "string") { - fixedT.lng = lng; - } else { - fixedT.lngs = lng; - } - fixedT.ns = ns; - return fixedT; - }, - }, - { - key: "t", - value: function t() { - var _this$translator; - return ( - this.translator && - (_this$translator = this.translator).translate.apply( - _this$translator, - arguments, - ) - ); - }, - }, - { - key: "exists", - value: function exists() { - var _this$translator2; - return ( - this.translator && - (_this$translator2 = this.translator).exists.apply( - _this$translator2, - arguments, - ) - ); - }, - }, - { - key: "setDefaultNamespace", - value: function setDefaultNamespace(ns) { - this.options.defaultNS = ns; - }, - }, - { - key: "hasLoadedNamespace", - value: function hasLoadedNamespace(ns) { - var _this6 = this; - if (!this.isInitialized) { - this.logger.warn( - "hasLoadedNamespace: i18next was not initialized", - this.languages, - ); - return false; - } - if (!this.languages || !this.languages.length) { - this.logger.warn( - "hasLoadedNamespace: i18n.languages were undefined or empty", - this.languages, - ); - return false; - } - var lng = this.languages[0]; - var fallbackLng = this.options - ? this.options.fallbackLng - : false; - var lastLng = this.languages[this.languages.length - 1]; // we're in cimode so this shall pass - if (lng.toLowerCase() === "cimode") return true; - var loadNotPending = function loadNotPending(l, n) { - var loadState = - _this6.services.backendConnector.state[ - "".concat(l, "|").concat(n) - ]; - return loadState === -1 || loadState === 2; - }; // loaded -> SUCCESS - if (this.hasResourceBundle(lng, ns)) return true; // were not loading at all -> SEMI SUCCESS - if (!this.services.backendConnector.backend) return true; // failed loading ns - but at least fallback is not pending -> SEMI SUCCESS - if ( - loadNotPending(lng, ns) && - (!fallbackLng || loadNotPending(lastLng, ns)) - ) - return true; - return false; - }, - }, - { - key: "loadNamespaces", - value: function loadNamespaces(ns, callback) { - var _this7 = this; - var deferred = defer(); - if (!this.options.ns) { - callback && callback(); - return Promise.resolve(); - } - if (typeof ns === "string") ns = [ns]; - ns.forEach(function (n) { - if (_this7.options.ns.indexOf(n) < 0) - _this7.options.ns.push(n); - }); - this.loadResources(function (err) { - deferred.resolve(); - if (callback) callback(err); - }); - return deferred; - }, - }, - { - key: "loadLanguages", - value: function loadLanguages(lngs, callback) { - var deferred = defer(); - if (typeof lngs === "string") lngs = [lngs]; - var preloaded = this.options.preload || []; - var newLngs = lngs.filter(function (lng) { - return preloaded.indexOf(lng) < 0; - }); // Exit early if all given languages are already preloaded - if (!newLngs.length) { - if (callback) callback(); - return Promise.resolve(); - } - this.options.preload = preloaded.concat(newLngs); - this.loadResources(function (err) { - deferred.resolve(); - if (callback) callback(err); - }); - return deferred; - }, - }, - { - key: "dir", - value: function dir(lng) { - if (!lng) - lng = - this.languages && this.languages.length > 0 - ? this.languages[0] - : this.language; - if (!lng) return "rtl"; - var rtlLngs = [ - "ar", - "shu", - "sqr", - "ssh", - "xaa", - "yhd", - "yud", - "aao", - "abh", - "abv", - "acm", - "acq", - "acw", - "acx", - "acy", - "adf", - "ads", - "aeb", - "aec", - "afb", - "ajp", - "apc", - "apd", - "arb", - "arq", - "ars", - "ary", - "arz", - "auz", - "avl", - "ayh", - "ayl", - "ayn", - "ayp", - "bbz", - "pga", - "he", - "iw", - "ps", - "pbt", - "pbu", - "pst", - "prp", - "prd", - "ur", - "ydd", - "yds", - "yih", - "ji", - "yi", - "hbo", - "men", - "xmn", - "fa", - "jpr", - "peo", - "pes", - "prs", - "dv", - "sam", - ]; - return rtlLngs.indexOf( - this.services.languageUtils.getLanguagePartFromCode(lng), - ) >= 0 - ? "rtl" - : "ltr"; - } /* eslint class-methods-use-this: 0 */, - }, - { - key: "createInstance", - value: function createInstance() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - var callback = - arguments.length > 1 ? arguments[1] : undefined; - return new I18n(options, callback); - }, - }, - { - key: "cloneInstance", - value: function cloneInstance() { - var _this8 = this; - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - var callback = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : noop; - var mergedOptions = _objectSpread( - {}, - this.options, - options, - { - isClone: true, - }, - ); - var clone = new I18n(mergedOptions); - var membersToCopy = ["store", "services", "language"]; - membersToCopy.forEach(function (m) { - clone[m] = _this8[m]; - }); - clone.translator = new Translator( - clone.services, - clone.options, - ); - clone.translator.on("*", function (event) { - for ( - var _len4 = arguments.length, - args = new Array(_len4 > 1 ? _len4 - 1 : 0), - _key4 = 1; - _key4 < _len4; - _key4++ - ) { - args[_key4 - 1] = arguments[_key4]; - } - clone.emit.apply(clone, [event].concat(args)); - }); - clone.init(mergedOptions, callback); - clone.translator.options = clone.options; // sync options - return clone; - }, - }, - ]); - return I18n; - })(EventEmitter); - var i18next = new I18n(); - module.exports = i18next; - }, - { - "@babel/runtime/helpers/assertThisInitialized": 4, - "@babel/runtime/helpers/classCallCheck": 5, - "@babel/runtime/helpers/createClass": 6, - "@babel/runtime/helpers/getPrototypeOf": 8, - "@babel/runtime/helpers/inherits": 9, - "@babel/runtime/helpers/objectSpread": 14, - "@babel/runtime/helpers/possibleConstructorReturn": 15, - "@babel/runtime/helpers/slicedToArray": 17, - "@babel/runtime/helpers/toConsumableArray": 18, - "@babel/runtime/helpers/typeof": 19, - }, - ], - 268: [ - function (_dereq_, module, exports) { - exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? nBytes - 1 : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - i += d; - e = s & ((1 << -nBits) - 1); - s >>= -nBits; - nBits += eLen; - for ( - ; - nBits > 0; - e = e * 256 + buffer[offset + i], i += d, nBits -= 8 - ) {} - m = e & ((1 << -nBits) - 1); - e >>= -nBits; - nBits += mLen; - for ( - ; - nBits > 0; - m = m * 256 + buffer[offset + i], i += d, nBits -= 8 - ) {} - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : (s ? -1 : 1) * Infinity; - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); - }; - exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; - var i = isLE ? 0 : nBytes - 1; - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - value = Math.abs(value); - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - for ( - ; - mLen >= 8; - buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8 - ) {} - e = (e << mLen) | m; - eLen += mLen; - for ( - ; - eLen > 0; - buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8 - ) {} - buffer[offset + i - d] |= s * 128; - }; - }, - {}, - ], - 269: [ - function (_dereq_, module, exports) { - /* + }, + { + key: '_rotateView', + value: function _rotateView(a, x, y, z) { + var centerX = this.centerX; + var centerY = this.centerY; + var centerZ = this.centerZ; + // move center by eye position such that rotation happens around eye position + centerX -= this.eyeX; + centerY -= this.eyeY; + centerZ -= this.eyeZ; + var rotation = _main.default.Matrix.identity(this._renderer._pInst); + rotation.rotate(this._renderer._pInst._toRadians(a), x, y, z); + /* eslint-disable max-len */ + var rotatedCenter = [ + centerX * rotation.mat4[0] + centerY * rotation.mat4[4] + centerZ * rotation.mat4[8], + centerX * rotation.mat4[1] + centerY * rotation.mat4[5] + centerZ * rotation.mat4[9], + centerX * rotation.mat4[2] + centerY * rotation.mat4[6] + centerZ * rotation.mat4[10] + ]; + /* eslint-enable max-len */ + // add eye position back into center + rotatedCenter[0] += this.eyeX; + rotatedCenter[1] += this.eyeY; + rotatedCenter[2] += this.eyeZ; + this.camera(this.eyeX, this.eyeY, this.eyeZ, rotatedCenter[0], rotatedCenter[1], rotatedCenter[2], this.upX, this.upY, this.upZ); + } /** + * Panning rotates the camera view to the left and right. + * @method pan + * @param {Number} angle amount to rotate camera in current + * angleMode units. + * Greater than 0 values rotate counterclockwise (to the left). + * @example + *
                              + * + * let cam; + * let delta = 0.01; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * // set initial pan angle + * cam.pan(-0.8); + * } + * + * function draw() { + * background(200); + * + * // pan camera according to angle 'delta' + * cam.pan(delta); + * + * // every 160 frames, switch direction + * if (frameCount % 160 === 0) { + * delta *= -1; + * } + * + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                              + * + * @alt + * camera view pans left and right across a series of rotating 3D boxes. + */ - Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. - Copyright 2015, Google Inc. All Rights Reserved. + }, + { + key: 'pan', + value: function pan(amount) { + var local = this._getLocalAxes(); + this._rotateView(amount, local.y[0], local.y[1], local.y[2]); + } /** + * Tilting rotates the camera view up and down. + * @method tilt + * @param {Number} angle amount to rotate camera in current + * angleMode units. + * Greater than 0 values rotate counterclockwise (to the left). + * @example + *
                              + * + * let cam; + * let delta = 0.01; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * // set initial tilt + * cam.tilt(-0.8); + * } + * + * function draw() { + * background(200); + * + * // pan camera according to angle 'delta' + * cam.tilt(delta); + * + * // every 160 frames, switch direction + * if (frameCount % 160 === 0) { + * delta *= -1; + * } + * + * rotateY(frameCount * 0.01); + * translate(0, -100, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * translate(0, 35, 0); + * box(20); + * } + * + *
                              + * + * @alt + * camera view tilts up and down across a series of rotating 3D boxes. + */ - 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: + }, + { + key: 'tilt', + value: function tilt(amount) { + var local = this._getLocalAxes(); + this._rotateView(amount, local.x[0], local.x[1], local.x[2]); + } /** + * Reorients the camera to look at a position in world space. + * @method lookAt + * @for p5.Camera + * @param {Number} x x position of a point in world space + * @param {Number} y y position of a point in world space + * @param {Number} z z position of a point in world space + * @example + *
                              + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * } + * + * function draw() { + * background(200); + * + * // look at a new random point every 60 frames + * if (frameCount % 60 === 0) { + * cam.lookAt(random(-100, 100), random(-50, 50), 0); + * } + * + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                              + * + * @alt + * camera view of rotating 3D cubes changes to look at a new random + * point every second . + */ - The above copyright notice including the dates of first publication and - either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ - shall be included in all copies or substantial portions of the Software. + }, + { + key: 'lookAt', + value: function lookAt(x, y, z) { + this.camera(this.eyeX, this.eyeY, this.eyeZ, x, y, z, this.upX, this.upY, this.upZ); + } //////////////////////////////////////////////////////////////////////////////// + // Camera Position Methods + //////////////////////////////////////////////////////////////////////////////// + /** + * Sets the camera's position and orientation. + * Accepts the same parameters as the global + * camera(). + * More information on this function can be found there. + * @method camera + * @for p5.Camera + * @example + *
                              + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // Create a camera. + * // createCamera() sets the newly created camera as + * // the current (active) camera. + * cam = createCamera(); + * } + * + * function draw() { + * background(204); + * // Move the camera away from the plane by a sin wave + * cam.camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); + * plane(10, 10); + * } + * + *
                              + * @alt + * White square repeatedly grows to fill canvas and then shrinks. + * + * @example + *
                              + * + * // move slider to see changes! + * // sliders control the first 6 parameters of camera() + * + * let sliderGroup = []; + * let X; + * let Y; + * let Z; + * let centerX; + * let centerY; + * let centerZ; + * let h = 20; + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * // create a camera + * cam = createCamera(); + * // create sliders + * for (var i = 0; i < 6; i++) { + * if (i === 2) { + * sliderGroup[i] = createSlider(10, 400, 200); + * } else { + * sliderGroup[i] = createSlider(-400, 400, 0); + * } + * h = map(i, 0, 6, 5, 85); + * sliderGroup[i].position(10, height + h); + * sliderGroup[i].style('width', '80px'); + * } + * } + * + * function draw() { + * background(60); + * // assigning sliders' value to each parameters + * X = sliderGroup[0].value(); + * Y = sliderGroup[1].value(); + * Z = sliderGroup[2].value(); + * centerX = sliderGroup[3].value(); + * centerY = sliderGroup[4].value(); + * centerZ = sliderGroup[5].value(); + * cam.camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); + * stroke(255); + * fill(255, 102, 94); + * box(85); + * } + * + *
                              + * @alt + * An interactive example of a red cube with 3 sliders for moving it across x, y, + * z axis and 3 sliders for shifting its center. + */ - 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 - SILICON GRAPHICS, INC. 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. + }, + { + key: 'camera', + value: function camera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ) { + if (typeof eyeX === 'undefined') { + eyeX = this.defaultEyeX; + eyeY = this.defaultEyeY; + eyeZ = this.defaultEyeZ; + centerX = eyeX; + centerY = eyeY; + centerZ = 0; + upX = 0; + upY = 1; + upZ = 0; + } + this.eyeX = eyeX; + this.eyeY = eyeY; + this.eyeZ = eyeZ; + if (typeof centerX !== 'undefined') { + this.centerX = centerX; + this.centerY = centerY; + this.centerZ = centerZ; + } + if (typeof upX !== 'undefined') { + this.upX = upX; + this.upY = upY; + this.upZ = upZ; + } + var local = this._getLocalAxes(); + // the camera affects the model view matrix, insofar as it + // inverse translates the world to the eye position of the camera + // and rotates it. + /* eslint-disable indent */ + this.cameraMatrix.set(local.x[0], local.y[0], local.z[0], 0, local.x[1], local.y[1], local.z[1], 0, local.x[2], local.y[2], local.z[2], 0, 0, 0, 0, 1); + /* eslint-enable indent */ + var tx = - eyeX; + var ty = - eyeY; + var tz = - eyeZ; + this.cameraMatrix.translate([tx, + ty, + tz]); + if (this._isActive()) { + this._renderer.uMVMatrix.set(this.cameraMatrix.mat4[0], this.cameraMatrix.mat4[1], this.cameraMatrix.mat4[2], this.cameraMatrix.mat4[3], this.cameraMatrix.mat4[4], this.cameraMatrix.mat4[5], this.cameraMatrix.mat4[6], this.cameraMatrix.mat4[7], this.cameraMatrix.mat4[8], this.cameraMatrix.mat4[9], this.cameraMatrix.mat4[10], this.cameraMatrix.mat4[11], this.cameraMatrix.mat4[12], this.cameraMatrix.mat4[13], this.cameraMatrix.mat4[14], this.cameraMatrix.mat4[15]); + } + return this; + } /** + * Move camera along its local axes while maintaining current camera orientation. + * @method move + * @param {Number} x amount to move along camera's left-right axis + * @param {Number} y amount to move along camera's up-down axis + * @param {Number} z amount to move along camera's forward-backward axis + * @example + *
                              + * + * // see the camera move along its own axes while maintaining its orientation + * let cam; + * let delta = 0.5; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * } + * + * function draw() { + * background(200); + * + * // move the camera along its local axes + * cam.move(delta, delta, 0); + * + * // every 100 frames, switch direction + * if (frameCount % 150 === 0) { + * delta *= -1; + * } + * + * translate(-10, -10, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * translate(15, 15, 0); + * box(50, 8, 50); + * } + * + *
                              + * + * @alt + * camera view moves along a series of 3D boxes, maintaining the same + * orientation throughout the move + */ - Original Code. The Original Code is: OpenGL Sample Implementation, - Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, - Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. - Copyright in any portions created by third parties is as indicated - elsewhere herein. All Rights Reserved. -*/ - "use strict"; - var n; - function t(a, b) { - return a.b === b.b && a.a === b.a; - } - function u(a, b) { - return a.b < b.b || (a.b === b.b && a.a <= b.a); - } - function v(a, b, c) { - var d = b.b - a.b, - e = c.b - b.b; - return 0 < d + e - ? d < e - ? b.a - a.a + (d / (d + e)) * (a.a - c.a) - : b.a - c.a + (e / (d + e)) * (c.a - a.a) - : 0; - } - function x(a, b, c) { - var d = b.b - a.b, - e = c.b - b.b; - return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0; - } - function z(a, b) { - return a.a < b.a || (a.a === b.a && a.b <= b.b); - } - function aa(a, b, c) { - var d = b.a - a.a, - e = c.a - b.a; - return 0 < d + e - ? d < e - ? b.b - a.b + (d / (d + e)) * (a.b - c.b) - : b.b - c.b + (e / (d + e)) * (c.b - a.b) - : 0; - } - function ba(a, b, c) { - var d = b.a - a.a, - e = c.a - b.a; - return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0; - } - function ca(a) { - return u(a.b.a, a.a); - } - function da(a) { - return u(a.a, a.b.a); - } - function A(a, b, c, d) { - a = 0 > a ? 0 : a; - c = 0 > c ? 0 : c; - return a <= c - ? 0 === c - ? (b + d) / 2 - : b + (a / (a + c)) * (d - b) - : d + (c / (a + c)) * (b - d); - } - function ea(a) { - var b = B(a.b); - C(b, a.c); - C(b.b, a.c); - D(b, a.a); - return b; - } - function E(a, b) { - var c = !1, - d = !1; - a !== b && - (b.a !== a.a && ((d = !0), F(b.a, a.a)), - b.d !== a.d && ((c = !0), G(b.d, a.d)), - H(b, a), - d || (C(b, a.a), (a.a.c = a)), - c || (D(b, a.d), (a.d.a = a))); - } - function I(a) { - var b = a.b, - c = !1; - a.d !== a.b.d && ((c = !0), G(a.d, a.b.d)); - a.c === a - ? F(a.a, null) - : ((a.b.d.a = J(a)), (a.a.c = a.c), H(a, J(a)), c || D(a, a.d)); - b.c === b - ? (F(b.a, null), G(b.d, null)) - : ((a.d.a = J(b)), (b.a.c = b.c), H(b, J(b))); - fa(a); - } - function K(a) { - var b = B(a), - c = b.b; - H(b, a.e); - b.a = a.b.a; - C(c, b.a); - b.d = c.d = a.d; - b = b.b; - H(a.b, J(a.b)); - H(a.b, b); - a.b.a = b.a; - b.b.a.c = b.b; - b.b.d = a.b.d; - b.f = a.f; - b.b.f = a.b.f; - return b; - } - function L(a, b) { - var c = !1, - d = B(a), - e = d.b; - b.d !== a.d && ((c = !0), G(b.d, a.d)); - H(d, a.e); - H(e, b); - d.a = a.b.a; - e.a = b.a; - d.d = e.d = a.d; - a.d.a = e; - c || D(d, a.d); - return d; - } - function B(a) { - var b = new M(), - c = new M(), - d = a.b.h; - c.h = d; - d.b.h = b; - b.h = a; - a.b.h = c; - b.b = c; - b.c = b; - b.e = c; - c.b = b; - c.c = c; - return (c.e = b); - } - function H(a, b) { - var c = a.c, - d = b.c; - c.b.e = b; - d.b.e = a; - a.c = d; - b.c = c; - } - function C(a, b) { - var c = b.f, - d = new N(b, c); - c.e = d; - b.f = d; - c = d.c = a; - do (c.a = d), (c = c.c); - while (c !== a); - } - function D(a, b) { - var c = b.d, - d = new ga(b, c); - c.b = d; - b.d = d; - d.a = a; - d.c = b.c; - c = a; - do (c.d = d), (c = c.e); - while (c !== a); - } - function fa(a) { - var b = a.h; - a = a.b.h; - b.b.h = a; - a.b.h = b; - } - function F(a, b) { - var c = a.c, - d = c; - do (d.a = b), (d = d.c); - while (d !== c); - c = a.f; - d = a.e; - d.f = c; - c.e = d; - } - function G(a, b) { - var c = a.a, - d = c; - do (d.d = b), (d = d.e); - while (d !== c); - c = a.d; - d = a.b; - d.d = c; - c.b = d; - } - function ha(a) { - var b = 0; - Math.abs(a[1]) > Math.abs(a[0]) && (b = 1); - Math.abs(a[2]) > Math.abs(a[b]) && (b = 2); - return b; - } - var O = 4 * 1e150; - function P(a, b) { - a.f += b.f; - a.b.f += b.b.f; - } - function ia(a, b, c) { - a = a.a; - b = b.a; - c = c.a; - if (b.b.a === a) - return c.b.a === a - ? u(b.a, c.a) - ? 0 >= x(c.b.a, b.a, c.a) - : 0 <= x(b.b.a, c.a, b.a) - : 0 >= x(c.b.a, a, c.a); - if (c.b.a === a) return 0 <= x(b.b.a, a, b.a); - b = v(b.b.a, a, b.a); - a = v(c.b.a, a, c.a); - return b >= a; - } - function Q(a) { - a.a.i = null; - var b = a.e; - b.a.c = b.c; - b.c.a = b.a; - a.e = null; - } - function ja(a, b) { - I(a.a); - a.c = !1; - a.a = b; - b.i = a; - } - function ka(a) { - var b = a.a.a; - do a = R(a); - while (a.a.a === b); - a.c && ((b = L(S(a).a.b, a.a.e)), ja(a, b), (a = R(a))); - return a; - } - function la(a, b, c) { - var d = new ma(); - d.a = c; - d.e = na(a.f, b.e, d); - return (c.i = d); - } - function oa(a, b) { - switch (a.s) { - case 100130: - return 0 !== (b & 1); - case 100131: - return 0 !== b; - case 100132: - return 0 < b; - case 100133: - return 0 > b; - case 100134: - return 2 <= b || -2 >= b; - } - return !1; - } - function pa(a) { - var b = a.a, - c = b.d; - c.c = a.d; - c.a = b; - Q(a); - } - function T(a, b, c) { - a = b; - for (b = b.a; a !== c; ) { - a.c = !1; - var d = S(a), - e = d.a; - if (e.a !== b.a) { - if (!d.c) { - pa(a); - break; - } - e = L(b.c.b, e.b); - ja(d, e); - } - b.c !== e && (E(J(e), e), E(b, e)); - pa(a); - b = d.a; - a = d; - } - return b; - } - function U(a, b, c, d, e, f) { - var g = !0; - do la(a, b, c.b), (c = c.c); - while (c !== d); - for (null === e && (e = S(b).a.b.c); ; ) { - d = S(b); - c = d.a.b; - if (c.a !== e.a) break; - c.c !== e && (E(J(c), c), E(J(e), c)); - d.f = b.f - c.f; - d.d = oa(a, d.f); - b.b = !0; - !g && qa(a, b) && (P(c, e), Q(b), I(e)); - g = !1; - b = d; - e = c; - } - b.b = !0; - f && ra(a, b); - } - function sa(a, b, c, d, e) { - var f = [b.g[0], b.g[1], b.g[2]]; - b.d = null; - b.d = a.o ? a.o(f, c, d, a.c) || null : null; - null === b.d && - (e ? a.n || (V(a, 100156), (a.n = !0)) : (b.d = c[0])); - } - function ta(a, b, c) { - var d = [null, null, null, null]; - d[0] = b.a.d; - d[1] = c.a.d; - sa(a, b.a, d, [0.5, 0.5, 0, 0], !1); - E(b, c); - } - function ua(a, b, c, d, e) { - var f = Math.abs(b.b - a.b) + Math.abs(b.a - a.a), - g = Math.abs(c.b - a.b) + Math.abs(c.a - a.a), - h = e + 1; - d[e] = (0.5 * g) / (f + g); - d[h] = (0.5 * f) / (f + g); - a.g[0] += d[e] * b.g[0] + d[h] * c.g[0]; - a.g[1] += d[e] * b.g[1] + d[h] * c.g[1]; - a.g[2] += d[e] * b.g[2] + d[h] * c.g[2]; - } - function qa(a, b) { - var c = S(b), - d = b.a, - e = c.a; - if (u(d.a, e.a)) { - if (0 < x(e.b.a, d.a, e.a)) return !1; - if (!t(d.a, e.a)) K(e.b), E(d, J(e)), (b.b = c.b = !0); - else if (d.a !== e.a) { - var c = a.e, - f = d.a.h; - if (0 <= f) { - var c = c.b, - g = c.d, - h = c.e, - k = c.c, - l = k[f]; - g[l] = g[c.a]; - k[g[l]] = l; - l <= --c.a && - (1 >= l - ? W(c, l) - : u(h[g[l >> 1]], h[g[l]]) - ? W(c, l) - : va(c, l)); - h[f] = null; - k[f] = c.b; - c.b = f; - } else - for ( - c.c[-(f + 1)] = null; - 0 < c.a && null === c.c[c.d[c.a - 1]]; - - ) - --c.a; - ta(a, J(e), d); - } - } else { - if (0 > x(d.b.a, e.a, d.a)) return !1; - R(b).b = b.b = !0; - K(d.b); - E(J(e), d); - } - return !0; - } - function wa(a, b) { - var c = S(b), - d = b.a, - e = c.a, - f = d.a, - g = e.a, - h = d.b.a, - k = e.b.a, - l = new N(); - x(h, a.a, f); - x(k, a.a, g); - if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1; - if (u(f, g)) { - if (0 < x(k, f, g)) return !1; - } else if (0 > x(h, g, f)) return !1; - var r = h, - p = f, - q = k, - y = g, - m, - w; - u(r, p) || ((m = r), (r = p), (p = m)); - u(q, y) || ((m = q), (q = y), (y = m)); - u(r, q) || ((m = r), (r = q), (q = m), (m = p), (p = y), (y = m)); - u(q, p) - ? u(p, y) - ? ((m = v(r, q, p)), - (w = v(q, p, y)), - 0 > m + w && ((m = -m), (w = -w)), - (l.b = A(m, q.b, w, p.b))) - : ((m = x(r, q, p)), - (w = -x(r, y, p)), - 0 > m + w && ((m = -m), (w = -w)), - (l.b = A(m, q.b, w, y.b))) - : (l.b = (q.b + p.b) / 2); - z(r, p) || ((m = r), (r = p), (p = m)); - z(q, y) || ((m = q), (q = y), (y = m)); - z(r, q) || ((m = r), (r = q), (q = m), (m = p), (p = y), (y = m)); - z(q, p) - ? z(p, y) - ? ((m = aa(r, q, p)), - (w = aa(q, p, y)), - 0 > m + w && ((m = -m), (w = -w)), - (l.a = A(m, q.a, w, p.a))) - : ((m = ba(r, q, p)), - (w = -ba(r, y, p)), - 0 > m + w && ((m = -m), (w = -w)), - (l.a = A(m, q.a, w, y.a))) - : (l.a = (q.a + p.a) / 2); - u(l, a.a) && ((l.b = a.a.b), (l.a = a.a.a)); - r = u(f, g) ? f : g; - u(r, l) && ((l.b = r.b), (l.a = r.a)); - if (t(l, f) || t(l, g)) return qa(a, b), !1; - if ( - (!t(h, a.a) && 0 <= x(h, a.a, l)) || - (!t(k, a.a) && 0 >= x(k, a.a, l)) - ) { - if (k === a.a) - return ( - K(d.b), - E(e.b, d), - (b = ka(b)), - (d = S(b).a), - T(a, S(b), c), - U(a, b, J(d), d, d, !0), - !0 - ); - if (h === a.a) { - K(e.b); - E(d.e, J(e)); - f = c = b; - g = f.a.b.a; - do f = R(f); - while (f.a.b.a === g); - b = f; - f = S(b).a.b.c; - c.a = J(e); - e = T(a, c, null); - U(a, b, e.c, d.b.c, f, !0); - return !0; - } - 0 <= x(h, a.a, l) && - ((R(b).b = b.b = !0), K(d.b), (d.a.b = a.a.b), (d.a.a = a.a.a)); - 0 >= x(k, a.a, l) && - ((b.b = c.b = !0), K(e.b), (e.a.b = a.a.b), (e.a.a = a.a.a)); - return !1; - } - K(d.b); - K(e.b); - E(J(e), d); - d.a.b = l.b; - d.a.a = l.a; - d.a.h = xa(a.e, d.a); - d = d.a; - e = [0, 0, 0, 0]; - l = [f.d, h.d, g.d, k.d]; - d.g[0] = d.g[1] = d.g[2] = 0; - ua(d, f, h, e, 0); - ua(d, g, k, e, 2); - sa(a, d, l, e, !0); - R(b).b = b.b = c.b = !0; - return !1; - } - function ra(a, b) { - for (var c = S(b); ; ) { - for (; c.b; ) (b = c), (c = S(c)); - if (!b.b && ((c = b), (b = R(b)), null === b || !b.b)) break; - b.b = !1; - var d = b.a, - e = c.a, - f; - if ((f = d.b.a !== e.b.a)) - a: { - f = b; - var g = S(f), - h = f.a, - k = g.a, - l = void 0; - if (u(h.b.a, k.b.a)) { - if (0 > x(h.b.a, k.b.a, h.a)) { - f = !1; - break a; - } - R(f).b = f.b = !0; - l = K(h); - E(k.b, l); - l.d.c = f.d; - } else { - if (0 < x(k.b.a, h.b.a, k.a)) { - f = !1; - break a; - } - f.b = g.b = !0; - l = K(k); - E(h.e, k.b); - l.b.d.c = f.d; - } - f = !0; - } - f && - (c.c - ? (Q(c), I(e), (c = S(b)), (e = c.a)) - : b.c && (Q(b), I(d), (b = R(c)), (d = b.a))); - if (d.a !== e.a) - if ( - d.b.a === e.b.a || - b.c || - c.c || - (d.b.a !== a.a && e.b.a !== a.a) - ) - qa(a, b); - else if (wa(a, b)) break; - d.a === e.a && - d.b.a === e.b.a && - (P(e, d), Q(b), I(d), (b = R(c))); - } - } - function ya(a, b) { - a.a = b; - for (var c = b.c; null === c.i; ) - if (((c = c.c), c === b.c)) { - var c = a, - d = b, - e = new ma(); - e.a = d.c.b; - var f = c.f, - g = f.a; - do g = g.a; - while (null !== g.b && !f.c(f.b, e, g.b)); - var f = g.b, - h = S(f), - e = f.a, - g = h.a; - if (0 === x(e.b.a, d, e.a)) - (e = f.a), - t(e.a, d) || - t(e.b.a, d) || - (K(e.b), - f.c && (I(e.c), (f.c = !1)), - E(d.c, e), - ya(c, d)); - else { - var k = u(g.b.a, e.b.a) ? f : h, - h = void 0; - f.d || k.c - ? (k === f ? (h = L(d.c.b, e.e)) : (h = L(g.b.c.b, d.c).b), - k.c - ? ja(k, h) - : ((e = c), - (f = la(c, f, h)), - (f.f = R(f).f + f.a.f), - (f.d = oa(e, f.f))), - ya(c, d)) - : U(c, f, d.c, d.c, null, !0); - } - return; - } - c = ka(c.i); - e = S(c); - f = e.a; - e = T(a, e, null); - if (e.c === f) { - var f = e, - e = f.c, - g = S(c), - h = c.a, - k = g.a, - l = !1; - h.b.a !== k.b.a && wa(a, c); - t(h.a, a.a) && - (E(J(e), h), - (c = ka(c)), - (e = S(c).a), - T(a, S(c), g), - (l = !0)); - t(k.a, a.a) && (E(f, J(k)), (f = T(a, g, null)), (l = !0)); - l - ? U(a, c, f.c, e, e, !0) - : (u(k.a, h.a) ? (d = J(k)) : (d = h), - (d = L(f.c.b, d)), - U(a, c, d, d.c, d.c, !1), - (d.b.i.c = !0), - ra(a, c)); - } else U(a, c, e.c, f, f, !0); - } - function za(a, b) { - var c = new ma(), - d = ea(a.b); - d.a.b = O; - d.a.a = b; - d.b.a.b = -O; - d.b.a.a = b; - a.a = d.b.a; - c.a = d; - c.f = 0; - c.d = !1; - c.c = !1; - c.h = !0; - c.b = !1; - d = a.f; - d = na(d, d.a, c); - c.e = d; - } - function Aa(a) { - this.a = new Ba(); - this.b = a; - this.c = ia; - } - function na(a, b, c) { - do b = b.c; - while (null !== b.b && !a.c(a.b, b.b, c)); - a = new Ba(c, b.a, b); - b.a.c = a; - return (b.a = a); - } - function Ba(a, b, c) { - this.b = a || null; - this.a = b || this; - this.c = c || this; - } - function X() { - this.d = Y; - this.p = this.b = this.q = null; - this.j = [0, 0, 0]; - this.s = 100130; - this.n = !1; - this.o = this.a = this.e = this.f = null; - this.m = !1; - this.c = this.r = this.i = this.k = this.l = this.h = null; - } - var Y = 0; - n = X.prototype; - n.x = function () { - Z(this, Y); - }; - n.B = function (a, b) { - switch (a) { - case 100142: - return; - case 100140: - switch (b) { - case 100130: - case 100131: - case 100132: - case 100133: - case 100134: - this.s = b; - return; - } - break; - case 100141: - this.m = !!b; - return; - default: - V(this, 100900); - return; - } - V(this, 100901); - }; - n.y = function (a) { - switch (a) { - case 100142: - return 0; - case 100140: - return this.s; - case 100141: - return this.m; - default: - V(this, 100900); - } - return !1; - }; - n.A = function (a, b, c) { - this.j[0] = a; - this.j[1] = b; - this.j[2] = c; - }; - n.z = function (a, b) { - var c = b ? b : null; - switch (a) { - case 100100: - case 100106: - this.h = c; - break; - case 100104: - case 100110: - this.l = c; - break; - case 100101: - case 100107: - this.k = c; - break; - case 100102: - case 100108: - this.i = c; - break; - case 100103: - case 100109: - this.p = c; - break; - case 100105: - case 100111: - this.o = c; - break; - case 100112: - this.r = c; - break; - default: - V(this, 100900); - } - }; - n.C = function (a, b) { - var c = !1, - d = [0, 0, 0]; - Z(this, 2); - for (var e = 0; 3 > e; ++e) { - var f = a[e]; - -1e150 > f && ((f = -1e150), (c = !0)); - 1e150 < f && ((f = 1e150), (c = !0)); - d[e] = f; - } - c && V(this, 100155); - c = this.q; - null === c ? ((c = ea(this.b)), E(c, c.b)) : (K(c), (c = c.e)); - c.a.d = b; - c.a.g[0] = d[0]; - c.a.g[1] = d[1]; - c.a.g[2] = d[2]; - c.f = 1; - c.b.f = -1; - this.q = c; - }; - n.u = function (a) { - Z(this, Y); - this.d = 1; - this.b = new Ca(); - this.c = a; - }; - n.t = function () { - Z(this, 1); - this.d = 2; - this.q = null; - }; - n.v = function () { - Z(this, 2); - this.d = 1; - }; - n.w = function () { - Z(this, 1); - this.d = Y; - var a = this.j[0], - b = this.j[1], - c = this.j[2], - d = !1, - e = [a, b, c]; - if (0 === a && 0 === b && 0 === c) { - for ( - var b = [-2 * 1e150, -2 * 1e150, -2 * 1e150], - f = [2 * 1e150, 2 * 1e150, 2 * 1e150], - c = [], - g = [], - d = this.b.c, - a = d.e; - a !== d; - a = a.e - ) - for (var h = 0; 3 > h; ++h) { - var k = a.g[h]; - k < f[h] && ((f[h] = k), (g[h] = a)); - k > b[h] && ((b[h] = k), (c[h] = a)); - } - a = 0; - b[1] - f[1] > b[0] - f[0] && (a = 1); - b[2] - f[2] > b[a] - f[a] && (a = 2); - if (f[a] >= b[a]) (e[0] = 0), (e[1] = 0), (e[2] = 1); - else { - b = 0; - f = g[a]; - c = c[a]; - g = [0, 0, 0]; - f = [f.g[0] - c.g[0], f.g[1] - c.g[1], f.g[2] - c.g[2]]; - h = [0, 0, 0]; - for (a = d.e; a !== d; a = a.e) - (h[0] = a.g[0] - c.g[0]), - (h[1] = a.g[1] - c.g[1]), - (h[2] = a.g[2] - c.g[2]), - (g[0] = f[1] * h[2] - f[2] * h[1]), - (g[1] = f[2] * h[0] - f[0] * h[2]), - (g[2] = f[0] * h[1] - f[1] * h[0]), - (k = g[0] * g[0] + g[1] * g[1] + g[2] * g[2]), - k > b && - ((b = k), (e[0] = g[0]), (e[1] = g[1]), (e[2] = g[2])); - 0 >= b && ((e[0] = e[1] = e[2] = 0), (e[ha(f)] = 1)); - } - d = !0; - } - g = ha(e); - a = this.b.c; - b = (g + 1) % 3; - c = (g + 2) % 3; - g = 0 < e[g] ? 1 : -1; - for (e = a.e; e !== a; e = e.e) (e.b = e.g[b]), (e.a = g * e.g[c]); - if (d) { - e = 0; - d = this.b.a; - for (a = d.b; a !== d; a = a.b) - if (((b = a.a), !(0 >= b.f))) { - do (e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a)), (b = b.e); - while (b !== a.a); - } - if (0 > e) - for (e = this.b.c, d = e.e; d !== e; d = d.e) d.a = -d.a; - } - this.n = !1; - e = this.b.b; - for (a = e.h; a !== e; a = d) - if ( - ((d = a.h), - (b = a.e), - t(a.a, a.b.a) && - a.e.e !== a && - (ta(this, b, a), I(a), (a = b), (b = a.e)), - b.e === a) - ) { - if (b !== a) { - if (b === d || b === d.b) d = d.h; - I(b); - } - if (a === d || a === d.b) d = d.h; - I(a); - } - this.e = e = new Da(); - d = this.b.c; - for (a = d.e; a !== d; a = a.e) a.h = xa(e, a); - Ea(e); - this.f = new Aa(this); - za(this, -O); - for (za(this, O); null !== (e = Fa(this.e)); ) { - for (;;) { - a: if (((a = this.e), 0 === a.a)) d = Ga(a.b); - else if ( - ((d = a.c[a.d[a.a - 1]]), - 0 !== a.b.a && ((a = Ga(a.b)), u(a, d))) - ) { - d = a; - break a; - } - if (null === d || !t(d, e)) break; - d = Fa(this.e); - ta(this, e.c, d.c); - } - ya(this, e); - } - this.a = this.f.a.a.b.a.a; - for (e = 0; null !== (d = this.f.a.a.b); ) d.h || ++e, Q(d); - this.f = null; - e = this.e; - e.b = null; - e.d = null; - this.e = e.c = null; - e = this.b; - for (a = e.a.b; a !== e.a; a = d) - (d = a.b), (a = a.a), a.e.e === a && (P(a.c, a), I(a)); - if (!this.n) { - e = this.b; - if (this.m) - for (a = e.b.h; a !== e.b; a = d) - (d = a.h), a.b.d.c !== a.d.c ? (a.f = a.d.c ? 1 : -1) : I(a); - else - for (a = e.a.b; a !== e.a; a = d) - if (((d = a.b), a.c)) { - for (a = a.a; u(a.b.a, a.a); a = a.c.b); - for (; u(a.a, a.b.a); a = a.e); - b = a.c.b; - for (c = void 0; a.e !== b; ) - if (u(a.b.a, b.a)) { - for ( - ; - b.e !== a && (ca(b.e) || 0 >= x(b.a, b.b.a, b.e.b.a)); - - ) - (c = L(b.e, b)), (b = c.b); - b = b.c.b; - } else { - for ( - ; - b.e !== a && - (da(a.c.b) || 0 <= x(a.b.a, a.a, a.c.b.a)); - - ) - (c = L(a, a.c.b)), (a = c.b); - a = a.e; - } - for (; b.e.e !== a; ) (c = L(b.e, b)), (b = c.b); - } - if (this.h || this.i || this.k || this.l) - if (this.m) - for (e = this.b, d = e.a.b; d !== e.a; d = d.b) { - if (d.c) { - this.h && this.h(2, this.c); - a = d.a; - do this.k && this.k(a.a.d, this.c), (a = a.e); - while (a !== d.a); - this.i && this.i(this.c); - } - } - else { - e = this.b; - d = !!this.l; - a = !1; - b = -1; - for (c = e.a.d; c !== e.a; c = c.d) - if (c.c) { - a || (this.h && this.h(4, this.c), (a = !0)); - g = c.a; - do - d && - ((f = g.b.d.c ? 0 : 1), - b !== f && ((b = f), this.l && this.l(!!b, this.c))), - this.k && this.k(g.a.d, this.c), - (g = g.e); - while (g !== c.a); - } - a && this.i && this.i(this.c); - } - if (this.r) { - e = this.b; - for (a = e.a.b; a !== e.a; a = d) - if (((d = a.b), !a.c)) { - b = a.a; - c = b.e; - g = void 0; - do - (g = c), - (c = g.e), - (g.d = null), - null === g.b.d && - (g.c === g - ? F(g.a, null) - : ((g.a.c = g.c), H(g, J(g))), - (f = g.b), - f.c === f - ? F(f.a, null) - : ((f.a.c = f.c), H(f, J(f))), - fa(g)); - while (g !== b); - b = a.d; - a = a.b; - a.d = b; - b.b = a; - } - this.r(this.b); - this.c = this.b = null; - return; - } - } - this.b = this.c = null; - }; - function Z(a, b) { - if (a.d !== b) - for (; a.d !== b; ) - if (a.d < b) - switch (a.d) { - case Y: - V(a, 100151); - a.u(null); - break; - case 1: - V(a, 100152), a.t(); - } - else - switch (a.d) { - case 2: - V(a, 100154); - a.v(); - break; - case 1: - V(a, 100153), a.w(); - } - } - function V(a, b) { - a.p && a.p(b, a.c); - } - function ga(a, b) { - this.b = a || this; - this.d = b || this; - this.a = null; - this.c = !1; - } - function M() { - this.h = this; - this.i = this.d = this.a = this.e = this.c = this.b = null; - this.f = 0; - } - function J(a) { - return a.b.e; - } - function Ca() { - this.c = new N(); - this.a = new ga(); - this.b = new M(); - this.d = new M(); - this.b.b = this.d; - this.d.b = this.b; - } - function N(a, b) { - this.e = a || this; - this.f = b || this; - this.d = this.c = null; - this.g = [0, 0, 0]; - this.h = this.a = this.b = 0; - } - function Da() { - this.c = []; - this.d = null; - this.a = 0; - this.e = !1; - this.b = new Ha(); - } - function Ea(a) { - a.d = []; - for (var b = 0; b < a.a; b++) a.d[b] = b; - a.d.sort( - (function (a) { - return function (b, e) { - return u(a[b], a[e]) ? 1 : -1; - }; - })(a.c), - ); - a.e = !0; - Ia(a.b); - } - function xa(a, b) { - if (a.e) { - var c = a.b, - d = ++c.a; - 2 * d > c.f && ((c.f *= 2), (c.c = Ja(c.c, c.f + 1))); - var e; - 0 === c.b ? (e = d) : ((e = c.b), (c.b = c.c[c.b])); - c.e[e] = b; - c.c[e] = d; - c.d[d] = e; - c.h && va(c, d); - return e; - } - c = a.a++; - a.c[c] = b; - return -(c + 1); - } - function Fa(a) { - if (0 === a.a) return Ka(a.b); - var b = a.c[a.d[a.a - 1]]; - if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b); - do --a.a; - while (0 < a.a && null === a.c[a.d[a.a - 1]]); - return b; - } - function Ha() { - this.d = Ja([0], 33); - this.e = [null, null]; - this.c = [0, 0]; - this.a = 0; - this.f = 32; - this.b = 0; - this.h = !1; - this.d[1] = 1; - } - function Ja(a, b) { - for (var c = Array(b), d = 0; d < a.length; d++) c[d] = a[d]; - for (; d < b; d++) c[d] = 0; - return c; - } - function Ia(a) { - for (var b = a.a; 1 <= b; --b) W(a, b); - a.h = !0; - } - function Ga(a) { - return a.e[a.d[1]]; - } - function Ka(a) { - var b = a.d, - c = a.e, - d = a.c, - e = b[1], - f = c[e]; - 0 < a.a && - ((b[1] = b[a.a]), - (d[b[1]] = 1), - (c[e] = null), - (d[e] = a.b), - (a.b = e), - 0 < --a.a && W(a, 1)); - return f; - } - function W(a, b) { - for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { - var h = f << 1; - h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1); - var k = c[h]; - if (h > a.a || u(d[g], d[k])) { - c[f] = g; - e[g] = f; - break; - } - c[f] = k; - e[k] = f; - f = h; - } - } - function va(a, b) { - for (var c = a.d, d = a.e, e = a.c, f = b, g = c[f]; ; ) { - var h = f >> 1, - k = c[h]; - if (0 === h || u(d[k], d[g])) { - c[f] = g; - e[g] = f; - break; - } - c[f] = k; - e[k] = f; - f = h; - } - } - function ma() { - this.e = this.a = null; - this.f = 0; - this.c = this.b = this.h = this.d = !1; - } - function S(a) { - return a.e.c.b; - } - function R(a) { - return a.e.a.b; - } - this.libtess = { - GluTesselator: X, - windingRule: { - GLU_TESS_WINDING_ODD: 100130, - GLU_TESS_WINDING_NONZERO: 100131, - GLU_TESS_WINDING_POSITIVE: 100132, - GLU_TESS_WINDING_NEGATIVE: 100133, - GLU_TESS_WINDING_ABS_GEQ_TWO: 100134, - }, - primitiveType: { - GL_LINE_LOOP: 2, - GL_TRIANGLES: 4, - GL_TRIANGLE_STRIP: 5, - GL_TRIANGLE_FAN: 6, - }, - errorType: { - GLU_TESS_MISSING_BEGIN_POLYGON: 100151, - GLU_TESS_MISSING_END_POLYGON: 100153, - GLU_TESS_MISSING_BEGIN_CONTOUR: 100152, - GLU_TESS_MISSING_END_CONTOUR: 100154, - GLU_TESS_COORD_TOO_LARGE: 100155, - GLU_TESS_NEED_COMBINE_CALLBACK: 100156, - }, - gluEnum: { - GLU_TESS_MESH: 100112, - GLU_TESS_TOLERANCE: 100142, - GLU_TESS_WINDING_RULE: 100140, - GLU_TESS_BOUNDARY_ONLY: 100141, - GLU_INVALID_ENUM: 100900, - GLU_INVALID_VALUE: 100901, - GLU_TESS_BEGIN: 100100, - GLU_TESS_VERTEX: 100101, - GLU_TESS_END: 100102, - GLU_TESS_ERROR: 100103, - GLU_TESS_EDGE_FLAG: 100104, - GLU_TESS_COMBINE: 100105, - GLU_TESS_BEGIN_DATA: 100106, - GLU_TESS_VERTEX_DATA: 100107, - GLU_TESS_END_DATA: 100108, - GLU_TESS_ERROR_DATA: 100109, - GLU_TESS_EDGE_FLAG_DATA: 100110, - GLU_TESS_COMBINE_DATA: 100111, - }, - }; - X.prototype.gluDeleteTess = X.prototype.x; - X.prototype.gluTessProperty = X.prototype.B; - X.prototype.gluGetTessProperty = X.prototype.y; - X.prototype.gluTessNormal = X.prototype.A; - X.prototype.gluTessCallback = X.prototype.z; - X.prototype.gluTessVertex = X.prototype.C; - X.prototype.gluTessBeginPolygon = X.prototype.u; - X.prototype.gluTessBeginContour = X.prototype.t; - X.prototype.gluTessEndContour = X.prototype.v; - X.prototype.gluTessEndPolygon = X.prototype.w; - if (typeof module !== "undefined") { - module.exports = this.libtess; - } - }, - {}, - ], - 270: [ - function (_dereq_, module, exports) { - // (c) Dean McNamee , 2013. - // - // https://github.com/deanm/omggif - // - // 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. - // - // omggif is a JavaScript implementation of a GIF 89a encoder and decoder, - // including animation and compression. It does not rely on any specific - // underlying system, so should run in the browser, Node, or Plask. - "use strict"; - function GifWriter(buf, width, height, gopts) { - var p = 0; - var gopts = gopts === undefined ? {} : gopts; - var loop_count = gopts.loop === undefined ? null : gopts.loop; - var global_palette = - gopts.palette === undefined ? null : gopts.palette; - if (width <= 0 || height <= 0 || width > 65535 || height > 65535) - throw new Error("Width/Height invalid."); - function check_palette_and_num_colors(palette) { - var num_colors = palette.length; - if ( - num_colors < 2 || - num_colors > 256 || - num_colors & (num_colors - 1) - ) { - throw new Error( - "Invalid code/color length, must be power of 2 and 2 .. 256.", - ); - } - return num_colors; - } // - Header. - - buf[p++] = 71; - buf[p++] = 73; - buf[p++] = 70; // GIF - buf[p++] = 56; - buf[p++] = 57; - buf[p++] = 97; // 89a - // Handling of Global Color Table (palette) and background index. - var gp_num_colors_pow2 = 0; - var background = 0; - if (global_palette !== null) { - var gp_num_colors = check_palette_and_num_colors(global_palette); - while ((gp_num_colors >>= 1)) ++gp_num_colors_pow2; - gp_num_colors = 1 << gp_num_colors_pow2; - --gp_num_colors_pow2; - if (gopts.background !== undefined) { - background = gopts.background; - if (background >= gp_num_colors) - throw new Error("Background index out of range."); - // The GIF spec states that a background index of 0 should be ignored, so - // this is probably a mistake and you really want to set it to another - // slot in the palette. But actually in the end most browsers, etc end - // up ignoring this almost completely (including for dispose background). - if (background === 0) - throw new Error("Background index explicitly passed as 0."); - } - } // - Logical Screen Descriptor. - // NOTE(deanm): w/h apparently ignored by implementations, but set anyway. - - buf[p++] = width & 255; - buf[p++] = (width >> 8) & 255; - buf[p++] = height & 255; - buf[p++] = (height >> 8) & 255; - // NOTE: Indicates 0-bpp original color resolution (unused?). - buf[p++] = - (global_palette !== null ? 128 : 0) | // Global Color Table Flag. - gp_num_colors_pow2; // NOTE: No sort flag (unused?). - buf[p++] = background; // Background Color Index. - buf[p++] = 0; // Pixel aspect ratio (unused?). - // - Global Color Table - if (global_palette !== null) { - for (var i = 0, il = global_palette.length; i < il; ++i) { - var rgb = global_palette[i]; - buf[p++] = (rgb >> 16) & 255; - buf[p++] = (rgb >> 8) & 255; - buf[p++] = rgb & 255; - } - } - if (loop_count !== null) { - // Netscape block for looping. - if (loop_count < 0 || loop_count > 65535) - throw new Error("Loop count invalid."); - // Extension code, label, and length. - buf[p++] = 33; - buf[p++] = 255; - buf[p++] = 11; - // NETSCAPE2.0 - buf[p++] = 78; - buf[p++] = 69; - buf[p++] = 84; - buf[p++] = 83; - buf[p++] = 67; - buf[p++] = 65; - buf[p++] = 80; - buf[p++] = 69; - buf[p++] = 50; - buf[p++] = 46; - buf[p++] = 48; - // Sub-block - buf[p++] = 3; - buf[p++] = 1; - buf[p++] = loop_count & 255; - buf[p++] = (loop_count >> 8) & 255; - buf[p++] = 0; // Terminator. - } - var ended = false; - this.addFrame = function (x, y, w, h, indexed_pixels, opts) { - if (ended === true) { - --p; - ended = false; - } // Un-end. - - opts = opts === undefined ? {} : opts; - // TODO(deanm): Bounds check x, y. Do they need to be within the virtual - // canvas width/height, I imagine? - if (x < 0 || y < 0 || x > 65535 || y > 65535) - throw new Error("x/y invalid."); - if (w <= 0 || h <= 0 || w > 65535 || h > 65535) - throw new Error("Width/Height invalid."); - if (indexed_pixels.length < w * h) - throw new Error("Not enough pixels for the frame size."); - var using_local_palette = true; - var palette = opts.palette; - if (palette === undefined || palette === null) { - using_local_palette = false; - palette = global_palette; - } - if (palette === undefined || palette === null) - throw new Error( - "Must supply either a local or global palette.", - ); - var num_colors = check_palette_and_num_colors(palette); - // Compute the min_code_size (power of 2), destroying num_colors. - var min_code_size = 0; - while ((num_colors >>= 1)) ++min_code_size; - num_colors = 1 << min_code_size; // Now we can easily get it back. - var delay = opts.delay === undefined ? 0 : opts.delay; - // From the spec: - // 0 - No disposal specified. The decoder is - // not required to take any action. - // 1 - Do not dispose. The graphic is to be left - // in place. - // 2 - Restore to background color. The area used by the - // graphic must be restored to the background color. - // 3 - Restore to previous. The decoder is required to - // restore the area overwritten by the graphic with - // what was there prior to rendering the graphic. - // 4-7 - To be defined. - // NOTE(deanm): Dispose background doesn't really work, apparently most - // browsers ignore the background palette index and clear to transparency. - var disposal = opts.disposal === undefined ? 0 : opts.disposal; - if (disposal < 0 || disposal > 3) - // 4-7 is reserved. - throw new Error("Disposal out of range."); - var use_transparency = false; - var transparent_index = 0; - if (opts.transparent !== undefined && opts.transparent !== null) { - use_transparency = true; - transparent_index = opts.transparent; - if (transparent_index < 0 || transparent_index >= num_colors) - throw new Error("Transparent color index."); - } - if (disposal !== 0 || use_transparency || delay !== 0) { - // - Graphics Control Extension - buf[p++] = 33; - buf[p++] = 249; // Extension / Label. - buf[p++] = 4; // Byte size. - buf[p++] = - (disposal << 2) | (use_transparency === true ? 1 : 0); - buf[p++] = delay & 255; - buf[p++] = (delay >> 8) & 255; - buf[p++] = transparent_index; // Transparent color index. - buf[p++] = 0; // Block Terminator. - } // - Image Descriptor - - buf[p++] = 44; // Image Seperator. - buf[p++] = x & 255; - buf[p++] = (x >> 8) & 255; // Left. - buf[p++] = y & 255; - buf[p++] = (y >> 8) & 255; // Top. - buf[p++] = w & 255; - buf[p++] = (w >> 8) & 255; - buf[p++] = h & 255; - buf[p++] = (h >> 8) & 255; - // NOTE: No sort flag (unused?). - // TODO(deanm): Support interlace. - buf[p++] = - using_local_palette === true ? 128 | (min_code_size - 1) : 0; - // - Local Color Table - if (using_local_palette === true) { - for (var i = 0, il = palette.length; i < il; ++i) { - var rgb = palette[i]; - buf[p++] = (rgb >> 16) & 255; - buf[p++] = (rgb >> 8) & 255; - buf[p++] = rgb & 255; - } - } - p = GifWriterOutputLZWCodeStream( - buf, - p, - min_code_size < 2 ? 2 : min_code_size, - indexed_pixels, - ); - return p; - }; - this.end = function () { - if (ended === false) { - buf[p++] = 59; // Trailer. - ended = true; - } - return p; - }; - this.getOutputBuffer = function () { - return buf; - }; - this.setOutputBuffer = function (v) { - buf = v; - }; - this.getOutputBufferPosition = function () { - return p; - }; - this.setOutputBufferPosition = function (v) { - p = v; - }; - } // Main compression routine, palette indexes -> LZW code stream. - // |index_stream| must have at least one entry. - - function GifWriterOutputLZWCodeStream( - buf, - p, - min_code_size, - index_stream, - ) { - buf[p++] = min_code_size; - var cur_subblock = p++; // Pointing at the length field. - var clear_code = 1 << min_code_size; - var code_mask = clear_code - 1; - var eoi_code = clear_code + 1; - var next_code = eoi_code + 1; - var cur_code_size = min_code_size + 1; // Number of bits per code. - var cur_shift = 0; - // We have at most 12-bit codes, so we should have to hold a max of 19 - // bits here (and then we would write out). - var cur = 0; - function emit_bytes_to_buffer(bit_block_size) { - while (cur_shift >= bit_block_size) { - buf[p++] = cur & 255; - cur >>= 8; - cur_shift -= 8; - if (p === cur_subblock + 256) { - // Finished a subblock. - buf[cur_subblock] = 255; - cur_subblock = p++; - } - } - } - function emit_code(c) { - cur |= c << cur_shift; - cur_shift += cur_code_size; - emit_bytes_to_buffer(8); - } // I am not an expert on the topic, and I don't want to write a thesis. - // However, it is good to outline here the basic algorithm and the few data - // structures and optimizations here that make this implementation fast. - // The basic idea behind LZW is to build a table of previously seen runs - // addressed by a short id (herein called output code). All data is - // referenced by a code, which represents one or more values from the - // original input stream. All input bytes can be referenced as the same - // value as an output code. So if you didn't want any compression, you - // could more or less just output the original bytes as codes (there are - // some details to this, but it is the idea). In order to achieve - // compression, values greater then the input range (codes can be up to - // 12-bit while input only 8-bit) represent a sequence of previously seen - // inputs. The decompressor is able to build the same mapping while - // decoding, so there is always a shared common knowledge between the - // encoding and decoder, which is also important for "timing" aspects like - // how to handle variable bit width code encoding. - // - // One obvious but very important consequence of the table system is there - // is always a unique id (at most 12-bits) to map the runs. 'A' might be - // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc. This relationship - // can be used for an effecient lookup strategy for the code mapping. We - // need to know if a run has been seen before, and be able to map that run - // to the output code. Since we start with known unique ids (input bytes), - // and then from those build more unique ids (table entries), we can - // continue this chain (almost like a linked list) to always have small - // integer values that represent the current byte chains in the encoder. - // This means instead of tracking the input bytes (AAAABCD) to know our - // current state, we can track the table entry for AAAABC (it is guaranteed - // to exist by the nature of the algorithm) and the next character D. - // Therefor the tuple of (table_entry, byte) is guaranteed to also be - // unique. This allows us to create a simple lookup key for mapping input - // sequences to codes (table indices) without having to store or search - // any of the code sequences. So if 'AAAA' has a table entry of 12, the - // tuple of ('AAAA', K) for any input byte K will be unique, and can be our - // key. This leads to a integer value at most 20-bits, which can always - // fit in an SMI value and be used as a fast sparse array / object key. - // Output code for the current contents of the index buffer. - - var ib_code = index_stream[0] & code_mask; // Load first input index. - var code_table = {}; // Key'd on our 20-bit "tuple". - emit_code(clear_code); // Spec says first code should be a clear code. - // First index already loaded, process the rest of the stream. - for (var i = 1, il = index_stream.length; i < il; ++i) { - var k = index_stream[i] & code_mask; - var cur_key = (ib_code << 8) | k; // (prev, k) unique tuple. - var cur_code = code_table[cur_key]; // buffer + k. - // Check if we have to create a new code table entry. - if (cur_code === undefined) { - // We don't have buffer + k. - // Emit index buffer (without k). - // This is an inline version of emit_code, because this is the core - // writing routine of the compressor (and V8 cannot inline emit_code - // because it is a closure here in a different context). Additionally - // we can call emit_byte_to_buffer less often, because we can have - // 30-bits (from our 31-bit signed SMI), and we know our codes will only - // be 12-bits, so can safely have 18-bits there without overflow. - // emit_code(ib_code); - cur |= ib_code << cur_shift; - cur_shift += cur_code_size; - while (cur_shift >= 8) { - buf[p++] = cur & 255; - cur >>= 8; - cur_shift -= 8; - if (p === cur_subblock + 256) { - // Finished a subblock. - buf[cur_subblock] = 255; - cur_subblock = p++; - } - } - if (next_code === 4096) { - // Table full, need a clear. - emit_code(clear_code); - next_code = eoi_code + 1; - cur_code_size = min_code_size + 1; - code_table = {}; - } else { - // Table not full, insert a new entry. - // Increase our variable bit code sizes if necessary. This is a bit - // tricky as it is based on "timing" between the encoding and - // decoder. From the encoders perspective this should happen after - // we've already emitted the index buffer and are about to create the - // first table entry that would overflow our current code bit size. - if (next_code >= 1 << cur_code_size) ++cur_code_size; - code_table[cur_key] = next_code++; // Insert into code table. - } - ib_code = k; // Index buffer to single input k. - } else { - ib_code = cur_code; // Index buffer to sequence in code table. - } - } - emit_code(ib_code); // There will still be something in the index buffer. - emit_code(eoi_code); // End Of Information. - // Flush / finalize the sub-blocks stream to the buffer. - emit_bytes_to_buffer(1); - // Finish the sub-blocks, writing out any unfinished lengths and - // terminating with a sub-block of length 0. If we have already started - // but not yet used a sub-block it can just become the terminator. - if (cur_subblock + 1 === p) { - // Started but unused. - buf[cur_subblock] = 0; - } else { - // Started and used, write length and additional terminator block. - buf[cur_subblock] = p - cur_subblock - 1; - buf[p++] = 0; - } - return p; - } - function GifReader(buf) { - var p = 0; - // - Header (GIF87a or GIF89a). - if ( - buf[p++] !== 71 || - buf[p++] !== 73 || - buf[p++] !== 70 || - buf[p++] !== 56 || - ((buf[p++] + 1) & 253) !== 56 || - buf[p++] !== 97 - ) { - throw new Error("Invalid GIF 87a/89a header."); - } // - Logical Screen Descriptor. - - var width = buf[p++] | (buf[p++] << 8); - var height = buf[p++] | (buf[p++] << 8); - var pf0 = buf[p++]; // . - var global_palette_flag = pf0 >> 7; - var num_global_colors_pow2 = pf0 & 7; - var num_global_colors = 1 << (num_global_colors_pow2 + 1); - var background = buf[p++]; - buf[p++]; // Pixel aspect ratio (unused?). - var global_palette_offset = null; - var global_palette_size = null; - if (global_palette_flag) { - global_palette_offset = p; - global_palette_size = num_global_colors; - p += num_global_colors * 3; // Seek past palette. - } - var no_eof = true; - var frames = []; - var delay = 0; - var transparent_index = null; - var disposal = 0; // 0 - No disposal specified. - var loop_count = null; - this.width = width; - this.height = height; - while (no_eof && p < buf.length) { - switch (buf[p++]) { - case 33: - // Graphics Control Extension Block - switch (buf[p++]) { - case 255: - // Application specific block - // Try if it's a Netscape block (with animation loop counter). - if ( - buf[p] !== 11 || // 21 FF already read, check block size. - // NETSCAPE2.0 - (buf[p + 1] == 78 && - buf[p + 2] == 69 && - buf[p + 3] == 84 && - buf[p + 4] == 83 && - buf[p + 5] == 67 && - buf[p + 6] == 65 && - buf[p + 7] == 80 && - buf[p + 8] == 69 && - buf[p + 9] == 50 && - buf[p + 10] == 46 && - buf[p + 11] == 48 && // Sub-block - buf[p + 12] == 3 && - buf[p + 13] == 1 && - buf[p + 16] == 0) - ) { - p += 14; - loop_count = buf[p++] | (buf[p++] << 8); - p++; // Skip terminator. - } else { - // We don't know what it is, just try to get past it. - p += 12; - while (true) { - // Seek through subblocks. - var block_size = buf[p++]; - // Bad block size (ex: undefined from an out of bounds read). - if (!(block_size >= 0)) - throw Error("Invalid block size"); - if (block_size === 0) break; // 0 size is terminator - p += block_size; - } - } - break; - case 249: - // Graphics Control Extension - if (buf[p++] !== 4 || buf[p + 4] !== 0) - throw new Error("Invalid graphics extension block."); - var pf1 = buf[p++]; - delay = buf[p++] | (buf[p++] << 8); - transparent_index = buf[p++]; - if ((pf1 & 1) === 0) transparent_index = null; - disposal = (pf1 >> 2) & 7; - p++; // Skip terminator. - break; - case 254: - // Comment Extension. - while (true) { - // Seek through subblocks. - var block_size = buf[p++]; - // Bad block size (ex: undefined from an out of bounds read). - if (!(block_size >= 0)) - throw Error("Invalid block size"); - if (block_size === 0) break; // 0 size is terminator - // console.log(buf.slice(p, p+block_size).toString('ascii')); - p += block_size; - } - break; - default: - throw new Error( - "Unknown graphic control label: 0x" + - buf[p - 1].toString(16), - ); - } - break; - case 44: - // Image Descriptor. - var x = buf[p++] | (buf[p++] << 8); - var y = buf[p++] | (buf[p++] << 8); - var w = buf[p++] | (buf[p++] << 8); - var h = buf[p++] | (buf[p++] << 8); - var pf2 = buf[p++]; - var local_palette_flag = pf2 >> 7; - var interlace_flag = (pf2 >> 6) & 1; - var num_local_colors_pow2 = pf2 & 7; - var num_local_colors = 1 << (num_local_colors_pow2 + 1); - var palette_offset = global_palette_offset; - var palette_size = global_palette_size; - var has_local_palette = false; - if (local_palette_flag) { - var has_local_palette = true; - palette_offset = p; // Override with local palette. - palette_size = num_local_colors; - p += num_local_colors * 3; // Seek past palette. - } - var data_offset = p; - p++; // codesize - while (true) { - var block_size = buf[p++]; - // Bad block size (ex: undefined from an out of bounds read). - if (!(block_size >= 0)) throw Error("Invalid block size"); - if (block_size === 0) break; // 0 size is terminator - p += block_size; - } - frames.push({ - x: x, - y: y, - width: w, - height: h, - has_local_palette: has_local_palette, - palette_offset: palette_offset, - palette_size: palette_size, - data_offset: data_offset, - data_length: p - data_offset, - transparent_index: transparent_index, - interlaced: !!interlace_flag, - delay: delay, - disposal: disposal, - }); - break; - case 59: - // Trailer Marker (end of file). - no_eof = false; - break; - default: - throw new Error( - "Unknown gif block: 0x" + buf[p - 1].toString(16), - ); - break; - } - } - this.numFrames = function () { - return frames.length; - }; - this.loopCount = function () { - return loop_count; - }; - this.frameInfo = function (frame_num) { - if (frame_num < 0 || frame_num >= frames.length) - throw new Error("Frame index out of range."); - return frames[frame_num]; - }; - this.decodeAndBlitFrameBGRA = function (frame_num, pixels) { - var frame = this.frameInfo(frame_num); - var num_pixels = frame.width * frame.height; - var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. - GifReaderLZWOutputIndexStream( - buf, - frame.data_offset, - index_stream, - num_pixels, - ); - var palette_offset = frame.palette_offset; - // NOTE(deanm): It seems to be much faster to compare index to 256 than - // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in - // the profile, not sure if it's related to using a Uint8Array. - var trans = frame.transparent_index; - if (trans === null) trans = 256; - // We are possibly just blitting to a portion of the entire frame. - // That is a subrect within the framerect, so the additional pixels - // must be skipped over after we finished a scanline. - var framewidth = frame.width; - var framestride = width - framewidth; - var xleft = framewidth; // Number of subrect pixels left in scanline. - // Output indicies of the top left and bottom right corners of the subrect. - var opbeg = (frame.y * width + frame.x) * 4; - var opend = ((frame.y + frame.height) * width + frame.x) * 4; - var op = opbeg; - var scanstride = framestride * 4; - // Use scanstride to skip past the rows when interlacing. This is skipping - // 7 rows for the first two passes, then 3 then 1. - if (frame.interlaced === true) { - scanstride += width * 4 * 7; // Pass 1. - } - var interlaceskip = 8; // Tracking the row interval in the current pass. - for (var i = 0, il = index_stream.length; i < il; ++i) { - var index = index_stream[i]; - if (xleft === 0) { - // Beginning of new scan line - op += scanstride; - xleft = framewidth; - if (op >= opend) { - // Catch the wrap to switch passes when interlacing. - scanstride = - framestride * 4 + width * 4 * (interlaceskip - 1); - // interlaceskip / 2 * 4 is interlaceskip << 1. - op = - opbeg + (framewidth + framestride) * (interlaceskip << 1); - interlaceskip >>= 1; - } - } - if (index === trans) { - op += 4; - } else { - var r = buf[palette_offset + index * 3]; - var g = buf[palette_offset + index * 3 + 1]; - var b = buf[palette_offset + index * 3 + 2]; - pixels[op++] = b; - pixels[op++] = g; - pixels[op++] = r; - pixels[op++] = 255; - } - --xleft; - } - }; - // I will go to copy and paste hell one day... - this.decodeAndBlitFrameRGBA = function (frame_num, pixels) { - var frame = this.frameInfo(frame_num); - var num_pixels = frame.width * frame.height; - var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices. - GifReaderLZWOutputIndexStream( - buf, - frame.data_offset, - index_stream, - num_pixels, - ); - var palette_offset = frame.palette_offset; - // NOTE(deanm): It seems to be much faster to compare index to 256 than - // to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in - // the profile, not sure if it's related to using a Uint8Array. - var trans = frame.transparent_index; - if (trans === null) trans = 256; - // We are possibly just blitting to a portion of the entire frame. - // That is a subrect within the framerect, so the additional pixels - // must be skipped over after we finished a scanline. - var framewidth = frame.width; - var framestride = width - framewidth; - var xleft = framewidth; // Number of subrect pixels left in scanline. - // Output indicies of the top left and bottom right corners of the subrect. - var opbeg = (frame.y * width + frame.x) * 4; - var opend = ((frame.y + frame.height) * width + frame.x) * 4; - var op = opbeg; - var scanstride = framestride * 4; - // Use scanstride to skip past the rows when interlacing. This is skipping - // 7 rows for the first two passes, then 3 then 1. - if (frame.interlaced === true) { - scanstride += width * 4 * 7; // Pass 1. - } - var interlaceskip = 8; // Tracking the row interval in the current pass. - for (var i = 0, il = index_stream.length; i < il; ++i) { - var index = index_stream[i]; - if (xleft === 0) { - // Beginning of new scan line - op += scanstride; - xleft = framewidth; - if (op >= opend) { - // Catch the wrap to switch passes when interlacing. - scanstride = - framestride * 4 + width * 4 * (interlaceskip - 1); - // interlaceskip / 2 * 4 is interlaceskip << 1. - op = - opbeg + (framewidth + framestride) * (interlaceskip << 1); - interlaceskip >>= 1; - } - } - if (index === trans) { - op += 4; - } else { - var r = buf[palette_offset + index * 3]; - var g = buf[palette_offset + index * 3 + 1]; - var b = buf[palette_offset + index * 3 + 2]; - pixels[op++] = r; - pixels[op++] = g; - pixels[op++] = b; - pixels[op++] = 255; - } - --xleft; - } - }; - } - function GifReaderLZWOutputIndexStream( - code_stream, - p, - output, - output_length, - ) { - var min_code_size = code_stream[p++]; - var clear_code = 1 << min_code_size; - var eoi_code = clear_code + 1; - var next_code = eoi_code + 1; - var cur_code_size = min_code_size + 1; // Number of bits per code. - // NOTE: This shares the same name as the encoder, but has a different - // meaning here. Here this masks each code coming from the code stream. - var code_mask = (1 << cur_code_size) - 1; - var cur_shift = 0; - var cur = 0; - var op = 0; // Output pointer. - var subblock_size = code_stream[p++]; - // TODO(deanm): Would using a TypedArray be any faster? At least it would - // solve the fast mode / backing store uncertainty. - // var code_table = Array(4096); - var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits. - var prev_code = null; // Track code-1. - while (true) { - // Read up to two bytes, making sure we always 12-bits for max sized code. - while (cur_shift < 16) { - if (subblock_size === 0) break; // No more data to be read. - cur |= code_stream[p++] << cur_shift; - cur_shift += 8; - if (subblock_size === 1) { - // Never let it get to 0 to hold logic above. - subblock_size = code_stream[p++]; // Next subblock. - } else { - --subblock_size; - } - } // TODO(deanm): We should never really get here, we should have received - // and EOI. - - if (cur_shift < cur_code_size) break; - var code = cur & code_mask; - cur >>= cur_code_size; - cur_shift -= cur_code_size; - // TODO(deanm): Maybe should check that the first code was a clear code, - // at least this is what you're supposed to do. But actually our encoder - // now doesn't emit a clear code first anyway. - if (code === clear_code) { - // We don't actually have to clear the table. This could be a good idea - // for greater error checking, but we don't really do any anyway. We - // will just track it with next_code and overwrite old entries. - next_code = eoi_code + 1; - cur_code_size = min_code_size + 1; - code_mask = (1 << cur_code_size) - 1; - // Don't update prev_code ? - prev_code = null; - continue; - } else if (code === eoi_code) { - break; - } // We have a similar situation as the decoder, where we want to store - // variable length entries (code table entries), but we want to do in a - // faster manner than an array of arrays. The code below stores sort of a - // linked list within the code table, and then "chases" through it to - // construct the dictionary entries. When a new entry is created, just the - // last byte is stored, and the rest (prefix) of the entry is only - // referenced by its table entry. Then the code chases through the - // prefixes until it reaches a single byte code. We have to chase twice, - // first to compute the length, and then to actually copy the data to the - // output (backwards, since we know the length). The alternative would be - // storing something in an intermediate stack, but that doesn't make any - // more sense. I implemented an approach where it also stored the length - // in the code table, although it's a bit tricky because you run out of - // bits (12 + 12 + 8), but I didn't measure much improvements (the table - // entries are generally not the long). Even when I created benchmarks for - // very long table entries the complexity did not seem worth it. - // The code table stores the prefix entry in 12 bits and then the suffix - // byte in 8 bits, so each entry is 20 bits. - - var chase_code = code < next_code ? code : prev_code; - // Chase what we will output, either {CODE} or {CODE-1}. - var chase_length = 0; - var chase = chase_code; - while (chase > clear_code) { - chase = code_table[chase] >> 8; - ++chase_length; - } - var k = chase; - var op_end = op + chase_length + (chase_code !== code ? 1 : 0); - if (op_end > output_length) { - console.log("Warning, gif stream longer than expected."); - return; - } // Already have the first byte from the chase, might as well write it fast. - - output[op++] = k; - op += chase_length; - var b = op; // Track pointer, writing backwards. - if (chase_code !== code) - // The case of emitting {CODE-1} + k. - output[op++] = k; - chase = chase_code; - while (chase_length--) { - chase = code_table[chase]; - output[--b] = chase & 255; // Write backwards. - chase >>= 8; // Pull down to the prefix code. - } - if (prev_code !== null && next_code < 4096) { - code_table[next_code++] = (prev_code << 8) | k; - // TODO(deanm): Figure out this clearing vs code growth logic better. I - // have an feeling that it should just happen somewhere else, for now it - // is awkward between when we grow past the max and then hit a clear code. - // For now just check if we hit the max 12-bits (then a clear code should - // follow, also of course encoded in 12-bits). - if (next_code >= code_mask + 1 && cur_code_size < 12) { - ++cur_code_size; - code_mask = (code_mask << 1) | 1; - } - } - prev_code = code; - } - if (op !== output_length) { - console.log("Warning, gif stream shorter than expected."); - } - return output; - } // CommonJS. - - try { - exports.GifWriter = GifWriter; - exports.GifReader = GifReader; - } catch (e) {} - }, - {}, - ], - 271: [ - function (_dereq_, module, exports) { - (function (Buffer) { - /** - * https://opentype.js.org v0.9.0 | (c) Frederik De Bleser and other contributors | MIT License | Uses tiny-inflate by Devon Govett and string.prototype.codepointat polyfill by Mathias Bynens - */ - (function (global, factory) { - typeof exports === "object" && typeof module !== "undefined" - ? factory(exports) - : typeof define === "function" && define.amd - ? define(["exports"], factory) - : factory((global.opentype = {})); - })(this, function (exports) { - "use strict"; - /*! https://mths.be/codepointat v0.2.0 by @mathias */ - if (!String.prototype.codePointAt) { - (function () { - var defineProperty = (function () { - // IE 8 only supports `Object.defineProperty` on DOM elements - try { - var object = {}; - var $defineProperty = Object.defineProperty; - var result = - $defineProperty(object, object, object) && - $defineProperty; - } catch (error) {} - return result; - })(); - var codePointAt = function (position) { - if (this == null) { - throw TypeError(); - } - var string = String(this); - var size = string.length; - // `ToInteger` - var index = position ? Number(position) : 0; - if (index != index) { - // better `isNaN` - index = 0; - } // Account for out-of-bounds indices: - - if (index < 0 || index >= size) { - return undefined; - } // Get the first code unit - - var first = string.charCodeAt(index); - var second; - if ( - // check if it’s the start of a surrogate pair - first >= 55296 && - first <= 56319 && // high surrogate - size > index + 1 // there is a next code unit - ) { - second = string.charCodeAt(index + 1); - if (second >= 56320 && second <= 57343) { - // low surrogate - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - return (first - 55296) * 1024 + second - 56320 + 65536; - } - } - return first; - }; - if (defineProperty) { - defineProperty(String.prototype, "codePointAt", { - value: codePointAt, - configurable: true, - writable: true, - }); - } else { - String.prototype.codePointAt = codePointAt; - } - })(); - } - var TINF_OK = 0; - var TINF_DATA_ERROR = -3; - function Tree() { - this.table = new Uint16Array( - 16, - ); /* table of code length counts */ - this.trans = new Uint16Array( - 288, - ); /* code -> symbol translation table */ - } - function Data(source, dest) { - this.source = source; - this.sourceIndex = 0; - this.tag = 0; - this.bitcount = 0; - this.dest = dest; - this.destLen = 0; - this.ltree = new Tree(); /* dynamic length/symbol tree */ - this.dtree = new Tree(); /* dynamic distance tree */ - } /* --------------------------------------------------- * - * -- uninitialized global data (static structures) -- * - * --------------------------------------------------- */ - - var sltree = new Tree(); - var sdtree = new Tree(); - /* extra bits and base tables for length codes */ - var length_bits = new Uint8Array(30); - var length_base = new Uint16Array(30); - /* extra bits and base tables for distance codes */ - var dist_bits = new Uint8Array(30); - var dist_base = new Uint16Array(30); - /* special ordering of code length codes */ - var clcidx = new Uint8Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, - 15, - ]); - /* used by tinf_decode_trees, avoids allocations every call */ - var code_tree = new Tree(); - var lengths = new Uint8Array(288 + 32); - /* ----------------------- * - * -- utility functions -- * - * ----------------------- */ - /* build extra bits and base tables */ - function tinf_build_bits_base(bits, base, delta, first) { - var i, sum; - /* build bits table */ - for (i = 0; i < delta; ++i) { - bits[i] = 0; - } - for (i = 0; i < 30 - delta; ++i) { - bits[i + delta] = (i / delta) | 0; - } /* build base table */ - - for (sum = first, i = 0; i < 30; ++i) { - base[i] = sum; - sum += 1 << bits[i]; - } - } /* build the fixed huffman trees */ - - function tinf_build_fixed_trees(lt, dt) { - var i; - /* build fixed length tree */ - for (i = 0; i < 7; ++i) { - lt.table[i] = 0; - } - lt.table[7] = 24; - lt.table[8] = 152; - lt.table[9] = 112; - for (i = 0; i < 24; ++i) { - lt.trans[i] = 256 + i; - } - for (i = 0; i < 144; ++i) { - lt.trans[24 + i] = i; - } - for (i = 0; i < 8; ++i) { - lt.trans[24 + 144 + i] = 280 + i; - } - for (i = 0; i < 112; ++i) { - lt.trans[24 + 144 + 8 + i] = 144 + i; - } /* build fixed distance tree */ - - for (i = 0; i < 5; ++i) { - dt.table[i] = 0; - } - dt.table[5] = 32; - for (i = 0; i < 32; ++i) { - dt.trans[i] = i; - } - } /* given an array of code lengths, build a tree */ - - var offs = new Uint16Array(16); - function tinf_build_tree(t, lengths, off, num) { - var i, sum; - /* clear code length count table */ - for (i = 0; i < 16; ++i) { - t.table[i] = 0; - } /* scan symbol lengths, and sum code length counts */ - - for (i = 0; i < num; ++i) { - t.table[lengths[off + i]]++; - } - t.table[0] = 0; - /* compute offset table for distribution sort */ - for (sum = 0, i = 0; i < 16; ++i) { - offs[i] = sum; - sum += t.table[i]; - } /* create code->symbol translation table (symbols sorted by code) */ - - for (i = 0; i < num; ++i) { - if (lengths[off + i]) { - t.trans[offs[lengths[off + i]]++] = i; - } - } - } /* ---------------------- * - * -- decode functions -- * - * ---------------------- */ - /* get one bit from source stream */ - - function tinf_getbit(d) { - /* check if tag is empty */ - if (!d.bitcount--) { - /* load next tag */ - d.tag = d.source[d.sourceIndex++]; - d.bitcount = 7; - } /* shift bit out of tag */ - - var bit = d.tag & 1; - d.tag >>>= 1; - return bit; - } /* read a num bit value from a stream and add base */ - - function tinf_read_bits(d, num, base) { - if (!num) { - return base; - } - while (d.bitcount < 24) { - d.tag |= d.source[d.sourceIndex++] << d.bitcount; - d.bitcount += 8; - } - var val = d.tag & (65535 >>> (16 - num)); - d.tag >>>= num; - d.bitcount -= num; - return val + base; - } /* given a data stream and a tree, decode a symbol */ - - function tinf_decode_symbol(d, t) { - while (d.bitcount < 24) { - d.tag |= d.source[d.sourceIndex++] << d.bitcount; - d.bitcount += 8; - } - var sum = 0, - cur = 0, - len = 0; - var tag = d.tag; - /* get more bits while code value is above sum */ - do { - cur = 2 * cur + (tag & 1); - tag >>>= 1; - ++len; - sum += t.table[len]; - cur -= t.table[len]; - } while (cur >= 0); - d.tag = tag; - d.bitcount -= len; - return t.trans[sum + cur]; - } /* given a data stream, decode dynamic trees from it */ - - function tinf_decode_trees(d, lt, dt) { - var hlit, hdist, hclen; - var i, num, length; - /* get 5 bits HLIT (257-286) */ - hlit = tinf_read_bits(d, 5, 257); - /* get 5 bits HDIST (1-32) */ - hdist = tinf_read_bits(d, 5, 1); - /* get 4 bits HCLEN (4-19) */ - hclen = tinf_read_bits(d, 4, 4); - for (i = 0; i < 19; ++i) { - lengths[i] = 0; - } /* read code lengths for code length alphabet */ - - for (i = 0; i < hclen; ++i) { - /* get 3 bits code length (0-7) */ - var clen = tinf_read_bits(d, 3, 0); - lengths[clcidx[i]] = clen; - } /* build code length tree */ - - tinf_build_tree(code_tree, lengths, 0, 19); - /* decode code lengths for the dynamic trees */ - for (num = 0; num < hlit + hdist; ) { - var sym = tinf_decode_symbol(d, code_tree); - switch (sym) { - case 16: - /* copy previous code length 3-6 times (read 2 bits) */ - var prev = lengths[num - 1]; - for (length = tinf_read_bits(d, 2, 3); length; --length) { - lengths[num++] = prev; - } - break; - case 17: - /* repeat code length 0 for 3-10 times (read 3 bits) */ - for (length = tinf_read_bits(d, 3, 3); length; --length) { - lengths[num++] = 0; - } - break; - case 18: - /* repeat code length 0 for 11-138 times (read 7 bits) */ - for ( - length = tinf_read_bits(d, 7, 11); - length; - --length - ) { - lengths[num++] = 0; - } - break; - default: - /* values 0-15 represent the actual code lengths */ - lengths[num++] = sym; - break; - } - } /* build dynamic trees */ - - tinf_build_tree(lt, lengths, 0, hlit); - tinf_build_tree(dt, lengths, hlit, hdist); - } /* ----------------------------- * - * -- block inflate functions -- * - * ----------------------------- */ - /* given a stream and two trees, inflate a block of data */ - - function tinf_inflate_block_data(d, lt, dt) { - while (1) { - var sym = tinf_decode_symbol(d, lt); - /* check for end of block */ - if (sym === 256) { - return TINF_OK; - } - if (sym < 256) { - d.dest[d.destLen++] = sym; - } else { - var length, dist, offs; - var i; - sym -= 257; - /* possibly get more bits from length code */ - length = tinf_read_bits( - d, - length_bits[sym], - length_base[sym], - ); - dist = tinf_decode_symbol(d, dt); - /* possibly get more bits from distance code */ - offs = - d.destLen - - tinf_read_bits(d, dist_bits[dist], dist_base[dist]); - /* copy match */ - for (i = offs; i < offs + length; ++i) { - d.dest[d.destLen++] = d.dest[i]; - } - } - } - } /* inflate an uncompressed block of data */ - - function tinf_inflate_uncompressed_block(d) { - var length, invlength; - var i; - /* unread from bitbuffer */ - while (d.bitcount > 8) { - d.sourceIndex--; - d.bitcount -= 8; - } /* get length */ - - length = d.source[d.sourceIndex + 1]; - length = 256 * length + d.source[d.sourceIndex]; - /* get one's complement of length */ - invlength = d.source[d.sourceIndex + 3]; - invlength = 256 * invlength + d.source[d.sourceIndex + 2]; - /* check length */ - if (length !== (~invlength & 65535)) { - return TINF_DATA_ERROR; - } - d.sourceIndex += 4; - /* copy block */ - for (i = length; i; --i) { - d.dest[d.destLen++] = d.source[d.sourceIndex++]; - } /* make sure we start next block on a byte boundary */ - - d.bitcount = 0; - return TINF_OK; - } /* inflate stream from source to dest */ - - function tinf_uncompress(source, dest) { - var d = new Data(source, dest); - var bfinal, btype, res; - do { - /* read final block flag */ - bfinal = tinf_getbit(d); - /* read block type (2 bits) */ - btype = tinf_read_bits(d, 2, 0); - /* decompress block */ - switch (btype) { - case 0: - /* decompress uncompressed block */ - res = tinf_inflate_uncompressed_block(d); - break; - case 1: - /* decompress block with fixed huffman trees */ - res = tinf_inflate_block_data(d, sltree, sdtree); - break; - case 2: - /* decompress block with dynamic huffman trees */ - tinf_decode_trees(d, d.ltree, d.dtree); - res = tinf_inflate_block_data(d, d.ltree, d.dtree); - break; - default: - res = TINF_DATA_ERROR; - } - if (res !== TINF_OK) { - throw new Error("Data error"); - } - } while (!bfinal); - if (d.destLen < d.dest.length) { - if (typeof d.dest.slice === "function") { - return d.dest.slice(0, d.destLen); - } else { - return d.dest.subarray(0, d.destLen); - } - } - return d.dest; - } /* -------------------- * - * -- initialization -- * - * -------------------- */ - /* build fixed huffman trees */ - - tinf_build_fixed_trees(sltree, sdtree); - /* build extra bits and base tables */ - tinf_build_bits_base(length_bits, length_base, 4, 3); - tinf_build_bits_base(dist_bits, dist_base, 2, 1); - /* fix a special case */ - length_bits[28] = 0; - length_base[28] = 258; - var tinyInflate = tinf_uncompress; - // The Bounding Box object - function derive(v0, v1, v2, v3, t) { - return ( - Math.pow(1 - t, 3) * v0 + - 3 * Math.pow(1 - t, 2) * t * v1 + - 3 * (1 - t) * Math.pow(t, 2) * v2 + - Math.pow(t, 3) * v3 - ); - } /** - * A bounding box is an enclosing box that describes the smallest measure within which all the points lie. - * It is used to calculate the bounding box of a glyph or text path. - * - * On initialization, x1/y1/x2/y2 will be NaN. Check if the bounding box is empty using `isEmpty()`. - * - * @exports opentype.BoundingBox - * @class - * @constructor - */ - - function BoundingBox() { - this.x1 = Number.NaN; - this.y1 = Number.NaN; - this.x2 = Number.NaN; - this.y2 = Number.NaN; - } /** - * Returns true if the bounding box is empty, that is, no points have been added to the box yet. - */ - - BoundingBox.prototype.isEmpty = function () { - return ( - isNaN(this.x1) || - isNaN(this.y1) || - isNaN(this.x2) || - isNaN(this.y2) - ); - }; - /** - * Add the point to the bounding box. - * The x1/y1/x2/y2 coordinates of the bounding box will now encompass the given point. - * @param {number} x - The X coordinate of the point. - * @param {number} y - The Y coordinate of the point. - */ - BoundingBox.prototype.addPoint = function (x, y) { - if (typeof x === "number") { - if (isNaN(this.x1) || isNaN(this.x2)) { - this.x1 = x; - this.x2 = x; - } - if (x < this.x1) { - this.x1 = x; - } - if (x > this.x2) { - this.x2 = x; - } - } - if (typeof y === "number") { - if (isNaN(this.y1) || isNaN(this.y2)) { - this.y1 = y; - this.y2 = y; - } - if (y < this.y1) { - this.y1 = y; - } - if (y > this.y2) { - this.y2 = y; - } - } - }; - /** - * Add a X coordinate to the bounding box. - * This extends the bounding box to include the X coordinate. - * This function is used internally inside of addBezier. - * @param {number} x - The X coordinate of the point. - */ - BoundingBox.prototype.addX = function (x) { - this.addPoint(x, null); - }; - /** - * Add a Y coordinate to the bounding box. - * This extends the bounding box to include the Y coordinate. - * This function is used internally inside of addBezier. - * @param {number} y - The Y coordinate of the point. - */ - BoundingBox.prototype.addY = function (y) { - this.addPoint(null, y); - }; - /** - * Add a Bézier curve to the bounding box. - * This extends the bounding box to include the entire Bézier. - * @param {number} x0 - The starting X coordinate. - * @param {number} y0 - The starting Y coordinate. - * @param {number} x1 - The X coordinate of the first control point. - * @param {number} y1 - The Y coordinate of the first control point. - * @param {number} x2 - The X coordinate of the second control point. - * @param {number} y2 - The Y coordinate of the second control point. - * @param {number} x - The ending X coordinate. - * @param {number} y - The ending Y coordinate. - */ - BoundingBox.prototype.addBezier = function ( - x0, - y0, - x1, - y1, - x2, - y2, - x, - y, - ) { - var this$1 = this; - // This code is based on http://nishiohirokazu.blogspot.com/2009/06/how-to-calculate-bezier-curves-bounding.html - // and https://github.com/icons8/svg-path-bounding-box - var p0 = [x0, y0]; - var p1 = [x1, y1]; - var p2 = [x2, y2]; - var p3 = [x, y]; - this.addPoint(x0, y0); - this.addPoint(x, y); - for (var i = 0; i <= 1; i++) { - var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; - var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; - var c = 3 * p1[i] - 3 * p0[i]; - if (a === 0) { - if (b === 0) { - continue; - } - var t = -c / b; - if (0 < t && t < 1) { - if (i === 0) { - this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t)); - } - if (i === 1) { - this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t)); - } - } - continue; - } - var b2ac = Math.pow(b, 2) - 4 * c * a; - if (b2ac < 0) { - continue; - } - var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); - if (0 < t1 && t1 < 1) { - if (i === 0) { - this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t1)); - } - if (i === 1) { - this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t1)); - } - } - var t2 = (-b - Math.sqrt(b2ac)) / (2 * a); - if (0 < t2 && t2 < 1) { - if (i === 0) { - this$1.addX(derive(p0[i], p1[i], p2[i], p3[i], t2)); - } - if (i === 1) { - this$1.addY(derive(p0[i], p1[i], p2[i], p3[i], t2)); - } - } - } - }; - /** - * Add a quadratic curve to the bounding box. - * This extends the bounding box to include the entire quadratic curve. - * @param {number} x0 - The starting X coordinate. - * @param {number} y0 - The starting Y coordinate. - * @param {number} x1 - The X coordinate of the control point. - * @param {number} y1 - The Y coordinate of the control point. - * @param {number} x - The ending X coordinate. - * @param {number} y - The ending Y coordinate. - */ - BoundingBox.prototype.addQuad = function (x0, y0, x1, y1, x, y) { - var cp1x = x0 + (2 / 3) * (x1 - x0); - var cp1y = y0 + (2 / 3) * (y1 - y0); - var cp2x = cp1x + (1 / 3) * (x - x0); - var cp2y = cp1y + (1 / 3) * (y - y0); - this.addBezier(x0, y0, cp1x, cp1y, cp2x, cp2y, x, y); - }; - // Geometric objects - /** - * A bézier path containing a set of path commands similar to a SVG path. - * Paths can be drawn on a context using `draw`. - * @exports opentype.Path - * @class - * @constructor - */ - function Path() { - this.commands = []; - this.fill = "black"; - this.stroke = null; - this.strokeWidth = 1; - } /** - * @param {number} x - * @param {number} y - */ - - Path.prototype.moveTo = function (x, y) { - this.commands.push({ - type: "M", - x: x, - y: y, - }); - }; - /** - * @param {number} x - * @param {number} y - */ - Path.prototype.lineTo = function (x, y) { - this.commands.push({ - type: "L", - x: x, - y: y, - }); - }; - /** - * Draws cubic curve - * @function - * curveTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control 1 - * @param {number} y1 - y of control 1 - * @param {number} x2 - x of control 2 - * @param {number} y2 - y of control 2 - * @param {number} x - x of path point - * @param {number} y - y of path point - */ - /** - * Draws cubic curve - * @function - * bezierCurveTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control 1 - * @param {number} y1 - y of control 1 - * @param {number} x2 - x of control 2 - * @param {number} y2 - y of control 2 - * @param {number} x - x of path point - * @param {number} y - y of path point - * @see curveTo - */ - Path.prototype.curveTo = Path.prototype.bezierCurveTo = function ( - x1, - y1, - x2, - y2, - x, - y, - ) { - this.commands.push({ - type: "C", - x1: x1, - y1: y1, - x2: x2, - y2: y2, - x: x, - y: y, - }); - }; - /** - * Draws quadratic curve - * @function - * quadraticCurveTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control - * @param {number} y1 - y of control - * @param {number} x - x of path point - * @param {number} y - y of path point - */ - /** - * Draws quadratic curve - * @function - * quadTo - * @memberof opentype.Path.prototype - * @param {number} x1 - x of control - * @param {number} y1 - y of control - * @param {number} x - x of path point - * @param {number} y - y of path point - */ - Path.prototype.quadTo = Path.prototype.quadraticCurveTo = - function (x1, y1, x, y) { - this.commands.push({ - type: "Q", - x1: x1, - y1: y1, - x: x, - y: y, - }); - }; - /** - * Closes the path - * @function closePath - * @memberof opentype.Path.prototype - */ - /** - * Close the path - * @function close - * @memberof opentype.Path.prototype - */ - Path.prototype.close = Path.prototype.closePath = function () { - this.commands.push({ - type: "Z", - }); - }; - /** - * Add the given path or list of commands to the commands of this path. - * @param {Array} pathOrCommands - another opentype.Path, an opentype.BoundingBox, or an array of commands. - */ - Path.prototype.extend = function (pathOrCommands) { - if (pathOrCommands.commands) { - pathOrCommands = pathOrCommands.commands; - } else if (pathOrCommands instanceof BoundingBox) { - var box = pathOrCommands; - this.moveTo(box.x1, box.y1); - this.lineTo(box.x2, box.y1); - this.lineTo(box.x2, box.y2); - this.lineTo(box.x1, box.y2); - this.close(); - return; - } - Array.prototype.push.apply(this.commands, pathOrCommands); - }; - /** - * Calculate the bounding box of the path. - * @returns {opentype.BoundingBox} - */ - Path.prototype.getBoundingBox = function () { - var this$1 = this; - var box = new BoundingBox(); - var startX = 0; - var startY = 0; - var prevX = 0; - var prevY = 0; - for (var i = 0; i < this.commands.length; i++) { - var cmd = this$1.commands[i]; - switch (cmd.type) { - case "M": - box.addPoint(cmd.x, cmd.y); - startX = prevX = cmd.x; - startY = prevY = cmd.y; - break; - case "L": - box.addPoint(cmd.x, cmd.y); - prevX = cmd.x; - prevY = cmd.y; - break; - case "Q": - box.addQuad(prevX, prevY, cmd.x1, cmd.y1, cmd.x, cmd.y); - prevX = cmd.x; - prevY = cmd.y; - break; - case "C": - box.addBezier( - prevX, - prevY, - cmd.x1, - cmd.y1, - cmd.x2, - cmd.y2, - cmd.x, - cmd.y, - ); - prevX = cmd.x; - prevY = cmd.y; - break; - case "Z": - prevX = startX; - prevY = startY; - break; - default: - throw new Error("Unexpected path command " + cmd.type); - } - } - if (box.isEmpty()) { - box.addPoint(0, 0); - } - return box; - }; - /** - * Draw the path to a 2D context. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context. - */ - Path.prototype.draw = function (ctx) { - var this$1 = this; - ctx.beginPath(); - for (var i = 0; i < this.commands.length; i += 1) { - var cmd = this$1.commands[i]; - if (cmd.type === "M") { - ctx.moveTo(cmd.x, cmd.y); - } else if (cmd.type === "L") { - ctx.lineTo(cmd.x, cmd.y); - } else if (cmd.type === "C") { - ctx.bezierCurveTo( - cmd.x1, - cmd.y1, - cmd.x2, - cmd.y2, - cmd.x, - cmd.y, - ); - } else if (cmd.type === "Q") { - ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); - } else if (cmd.type === "Z") { - ctx.closePath(); - } - } - if (this.fill) { - ctx.fillStyle = this.fill; - ctx.fill(); - } - if (this.stroke) { - ctx.strokeStyle = this.stroke; - ctx.lineWidth = this.strokeWidth; - ctx.stroke(); - } - }; - /** - * Convert the Path to a string of path data instructions - * See http://www.w3.org/TR/SVG/paths.html#PathData - * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values - * @return {string} - */ - Path.prototype.toPathData = function (decimalPlaces) { - var this$1 = this; - decimalPlaces = decimalPlaces !== undefined ? decimalPlaces : 2; - function floatToString(v) { - if (Math.round(v) === v) { - return "" + Math.round(v); - } else { - return v.toFixed(decimalPlaces); - } - } - function packValues() { - var arguments$1 = arguments; - var s = ""; - for (var i = 0; i < arguments.length; i += 1) { - var v = arguments$1[i]; - if (v >= 0 && i > 0) { - s += " "; - } - s += floatToString(v); - } - return s; - } - var d = ""; - for (var i = 0; i < this.commands.length; i += 1) { - var cmd = this$1.commands[i]; - if (cmd.type === "M") { - d += "M" + packValues(cmd.x, cmd.y); - } else if (cmd.type === "L") { - d += "L" + packValues(cmd.x, cmd.y); - } else if (cmd.type === "C") { - d += - "C" + - packValues(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - } else if (cmd.type === "Q") { - d += "Q" + packValues(cmd.x1, cmd.y1, cmd.x, cmd.y); - } else if (cmd.type === "Z") { - d += "Z"; - } - } - return d; - }; - /** - * Convert the path to an SVG element, as a string. - * @param {number} [decimalPlaces=2] - The amount of decimal places for floating-point values - * @return {string} - */ - Path.prototype.toSVG = function (decimalPlaces) { - var svg = '= 0 && v <= 255, - "Byte value should be between 0 and 255.", - ); - return [v]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.BYTE = constant(1); - /** - * Convert a 8-bit signed integer to a list of 1 byte. - * @param {string} - * @returns {Array} - */ - encode.CHAR = function (v) { - return [v.charCodeAt(0)]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.CHAR = constant(1); - /** - * Convert an ASCII string to a list of bytes. - * @param {string} - * @returns {Array} - */ - encode.CHARARRAY = function (v) { - var b = []; - for (var i = 0; i < v.length; i += 1) { - b[i] = v.charCodeAt(i); - } - return b; - }; - /** - * @param {Array} - * @returns {number} - */ - sizeOf.CHARARRAY = function (v) { - return v.length; - }; - /** - * Convert a 16-bit unsigned integer to a list of 2 bytes. - * @param {number} - * @returns {Array} - */ - encode.USHORT = function (v) { - return [(v >> 8) & 255, v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.USHORT = constant(2); - /** - * Convert a 16-bit signed integer to a list of 2 bytes. - * @param {number} - * @returns {Array} - */ - encode.SHORT = function (v) { - // Two's complement - if (v >= LIMIT16) { - v = -(2 * LIMIT16 - v); - } - return [(v >> 8) & 255, v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.SHORT = constant(2); - /** - * Convert a 24-bit unsigned integer to a list of 3 bytes. - * @param {number} - * @returns {Array} - */ - encode.UINT24 = function (v) { - return [(v >> 16) & 255, (v >> 8) & 255, v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.UINT24 = constant(3); - /** - * Convert a 32-bit unsigned integer to a list of 4 bytes. - * @param {number} - * @returns {Array} - */ - encode.ULONG = function (v) { - return [ - (v >> 24) & 255, - (v >> 16) & 255, - (v >> 8) & 255, - v & 255, - ]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.ULONG = constant(4); - /** - * Convert a 32-bit unsigned integer to a list of 4 bytes. - * @param {number} - * @returns {Array} - */ - encode.LONG = function (v) { - // Two's complement - if (v >= LIMIT32) { - v = -(2 * LIMIT32 - v); - } - return [ - (v >> 24) & 255, - (v >> 16) & 255, - (v >> 8) & 255, - v & 255, - ]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.LONG = constant(4); - encode.FIXED = encode.ULONG; - sizeOf.FIXED = sizeOf.ULONG; - encode.FWORD = encode.SHORT; - sizeOf.FWORD = sizeOf.SHORT; - encode.UFWORD = encode.USHORT; - sizeOf.UFWORD = sizeOf.USHORT; - /** - * Convert a 32-bit Apple Mac timestamp integer to a list of 8 bytes, 64-bit timestamp. - * @param {number} - * @returns {Array} - */ - encode.LONGDATETIME = function (v) { - return [ - 0, - 0, - 0, - 0, - (v >> 24) & 255, - (v >> 16) & 255, - (v >> 8) & 255, - v & 255, - ]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.LONGDATETIME = constant(8); - /** - * Convert a 4-char tag to a list of 4 bytes. - * @param {string} - * @returns {Array} - */ - encode.TAG = function (v) { - check.argument( - v.length === 4, - "Tag should be exactly 4 ASCII characters.", - ); - return [ - v.charCodeAt(0), - v.charCodeAt(1), - v.charCodeAt(2), - v.charCodeAt(3), - ]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.TAG = constant(4); - // CFF data types /////////////////////////////////////////////////////////// - encode.Card8 = encode.BYTE; - sizeOf.Card8 = sizeOf.BYTE; - encode.Card16 = encode.USHORT; - sizeOf.Card16 = sizeOf.USHORT; - encode.OffSize = encode.BYTE; - sizeOf.OffSize = sizeOf.BYTE; - encode.SID = encode.USHORT; - sizeOf.SID = sizeOf.USHORT; - // Convert a numeric operand or charstring number to a variable-size list of bytes. - /** - * Convert a numeric operand or charstring number to a variable-size list of bytes. - * @param {number} - * @returns {Array} - */ - encode.NUMBER = function (v) { - if (v >= -107 && v <= 107) { - return [v + 139]; - } else if (v >= 108 && v <= 1131) { - v = v - 108; - return [(v >> 8) + 247, v & 255]; - } else if (v >= -1131 && v <= -108) { - v = -v - 108; - return [(v >> 8) + 251, v & 255]; - } else if (v >= -32768 && v <= 32767) { - return encode.NUMBER16(v); - } else { - return encode.NUMBER32(v); - } - }; - /** - * @param {number} - * @returns {number} - */ - sizeOf.NUMBER = function (v) { - return encode.NUMBER(v).length; - }; - /** - * Convert a signed number between -32768 and +32767 to a three-byte value. - * This ensures we always use three bytes, but is not the most compact format. - * @param {number} - * @returns {Array} - */ - encode.NUMBER16 = function (v) { - return [28, (v >> 8) & 255, v & 255]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.NUMBER16 = constant(3); - /** - * Convert a signed number between -(2^31) and +(2^31-1) to a five-byte value. - * This is useful if you want to be sure you always use four bytes, - * at the expense of wasting a few bytes for smaller numbers. - * @param {number} - * @returns {Array} - */ - encode.NUMBER32 = function (v) { - return [ - 29, - (v >> 24) & 255, - (v >> 16) & 255, - (v >> 8) & 255, - v & 255, - ]; - }; - /** - * @constant - * @type {number} - */ - sizeOf.NUMBER32 = constant(5); - /** - * @param {number} - * @returns {Array} - */ - encode.REAL = function (v) { - var value = v.toString(); - // Some numbers use an epsilon to encode the value. (e.g. JavaScript will store 0.0000001 as 1e-7) - // This code converts it back to a number without the epsilon. - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec( - value, - ); - if (m) { - var epsilon = parseFloat( - "1e" + ((m[2] ? +m[2] : 0) + m[1].length), - ); - value = (Math.round(v * epsilon) / epsilon).toString(); - } - var nibbles = ""; - for (var i = 0, ii = value.length; i < ii; i += 1) { - var c = value[i]; - if (c === "e") { - nibbles += value[++i] === "-" ? "c" : "b"; - } else if (c === ".") { - nibbles += "a"; - } else if (c === "-") { - nibbles += "e"; - } else { - nibbles += c; - } - } - nibbles += nibbles.length & 1 ? "f" : "ff"; - var out = [30]; - for (var i$1 = 0, ii$1 = nibbles.length; i$1 < ii$1; i$1 += 2) { - out.push(parseInt(nibbles.substr(i$1, 2), 16)); - } - return out; - }; - /** - * @param {number} - * @returns {number} - */ - sizeOf.REAL = function (v) { - return encode.REAL(v).length; - }; - encode.NAME = encode.CHARARRAY; - sizeOf.NAME = sizeOf.CHARARRAY; - encode.STRING = encode.CHARARRAY; - sizeOf.STRING = sizeOf.CHARARRAY; - /** - * @param {DataView} data - * @param {number} offset - * @param {number} numBytes - * @returns {string} - */ - decode.UTF8 = function (data, offset, numBytes) { - var codePoints = []; - var numChars = numBytes; - for (var j = 0; j < numChars; j++, offset += 1) { - codePoints[j] = data.getUint8(offset); - } - return String.fromCharCode.apply(null, codePoints); - }; - /** - * @param {DataView} data - * @param {number} offset - * @param {number} numBytes - * @returns {string} - */ - decode.UTF16 = function (data, offset, numBytes) { - var codePoints = []; - var numChars = numBytes / 2; - for (var j = 0; j < numChars; j++, offset += 2) { - codePoints[j] = data.getUint16(offset); - } - return String.fromCharCode.apply(null, codePoints); - }; - /** - * Convert a JavaScript string to UTF16-BE. - * @param {string} - * @returns {Array} - */ - encode.UTF16 = function (v) { - var b = []; - for (var i = 0; i < v.length; i += 1) { - var codepoint = v.charCodeAt(i); - b[b.length] = (codepoint >> 8) & 255; - b[b.length] = codepoint & 255; - } - return b; - }; - /** - * @param {string} - * @returns {number} - */ - sizeOf.UTF16 = function (v) { - return v.length * 2; - }; - // Data for converting old eight-bit Macintosh encodings to Unicode. - // This representation is optimized for decoding; encoding is slower - // and needs more memory. The assumption is that all opentype.js users - // want to open fonts, but saving a font will be comparatively rare - // so it can be more expensive. Keyed by IANA character set name. - // - // Python script for generating these strings: - // - // s = u''.join([chr(c).decode('mac_greek') for c in range(128, 256)]) - // print(s.encode('utf-8')) - /** - * @private - */ - var eightBitMacEncodings = { - // Python: 'mac_croatian' - "x-mac-croatian": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø" + - "¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ", - // Python: 'mac_cyrillic' - "x-mac-cyrillic": - "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњ" + - "јЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю", - // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/GAELIC.TXT - "x-mac-gaelic": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæø" + - "ṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ", - // Python: 'mac_greek' - "x-mac-greek": - "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩ" + - "άΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­", - // Python: 'mac_iceland' - "x-mac-icelandic": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø" + - "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", - // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/INUIT.TXT - "x-mac-inuit": - "ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗ" + - "ᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł", - // Python: 'mac_latin2' - "x-mac-ce": - "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅ" + - "ņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", - // Python: 'mac_roman' - macintosh: - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø" + - "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", - // Python: 'mac_romanian' - "x-mac-romanian": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș" + - "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", - // Python: 'mac_turkish' - "x-mac-turkish": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø" + - "¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ", - }; - /** - * Decodes an old-style Macintosh string. Returns either a Unicode JavaScript - * string, or 'undefined' if the encoding is unsupported. For example, we do - * not support Chinese, Japanese or Korean because these would need large - * mapping tables. - * @param {DataView} dataView - * @param {number} offset - * @param {number} dataLength - * @param {string} encoding - * @returns {string} - */ - decode.MACSTRING = function ( - dataView, - offset, - dataLength, - encoding, - ) { - var table = eightBitMacEncodings[encoding]; - if (table === undefined) { - return undefined; - } - var result = ""; - for (var i = 0; i < dataLength; i++) { - var c = dataView.getUint8(offset + i); - // In all eight-bit Mac encodings, the characters 0x00..0x7F are - // mapped to U+0000..U+007F; we only need to look up the others. - if (c <= 127) { - result += String.fromCharCode(c); - } else { - result += table[c & 127]; - } - } - return result; - }; - // Helper function for encode.MACSTRING. Returns a dictionary for mapping - // Unicode character codes to their 8-bit MacOS equivalent. This table - // is not exactly a super cheap data structure, but we do not care because - // encoding Macintosh strings is only rarely needed in typical applications. - var macEncodingTableCache = - typeof WeakMap === "function" && new WeakMap(); - var macEncodingCacheKeys; - var getMacEncodingTable = function (encoding) { - // Since we use encoding as a cache key for WeakMap, it has to be - // a String object and not a literal. And at least on NodeJS 2.10.1, - // WeakMap requires that the same String instance is passed for cache hits. - if (!macEncodingCacheKeys) { - macEncodingCacheKeys = {}; - for (var e in eightBitMacEncodings) { - /*jshint -W053 */ // Suppress "Do not use String as a constructor." - macEncodingCacheKeys[e] = new String(e); - } - } - var cacheKey = macEncodingCacheKeys[encoding]; - if (cacheKey === undefined) { - return undefined; - } // We can't do "if (cache.has(key)) {return cache.get(key)}" here: - // since garbage collection may run at any time, it could also kick in - // between the calls to cache.has() and cache.get(). In that case, - // we would return 'undefined' even though we do support the encoding. - - if (macEncodingTableCache) { - var cachedTable = macEncodingTableCache.get(cacheKey); - if (cachedTable !== undefined) { - return cachedTable; - } - } - var decodingTable = eightBitMacEncodings[encoding]; - if (decodingTable === undefined) { - return undefined; - } - var encodingTable = {}; - for (var i = 0; i < decodingTable.length; i++) { - encodingTable[decodingTable.charCodeAt(i)] = i + 128; - } - if (macEncodingTableCache) { - macEncodingTableCache.set(cacheKey, encodingTable); - } - return encodingTable; - }; - /** - * Encodes an old-style Macintosh string. Returns a byte array upon success. - * If the requested encoding is unsupported, or if the input string contains - * a character that cannot be expressed in the encoding, the function returns - * 'undefined'. - * @param {string} str - * @param {string} encoding - * @returns {Array} - */ - encode.MACSTRING = function (str, encoding) { - var table = getMacEncodingTable(encoding); - if (table === undefined) { - return undefined; - } - var result = []; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - // In all eight-bit Mac encodings, the characters 0x00..0x7F are - // mapped to U+0000..U+007F; we only need to look up the others. - if (c >= 128) { - c = table[c]; - if (c === undefined) { - // str contains a Unicode character that cannot be encoded - // in the requested encoding. - return undefined; - } - } - result[i] = c; - // result.push(c); - } - return result; - }; - /** - * @param {string} str - * @param {string} encoding - * @returns {number} - */ - sizeOf.MACSTRING = function (str, encoding) { - var b = encode.MACSTRING(str, encoding); - if (b !== undefined) { - return b.length; - } else { - return 0; - } - }; - // Helper for encode.VARDELTAS - function isByteEncodable(value) { - return value >= -128 && value <= 127; - } // Helper for encode.VARDELTAS - - function encodeVarDeltaRunAsZeroes(deltas, pos, result) { - var runLength = 0; - var numDeltas = deltas.length; - while (pos < numDeltas && runLength < 64 && deltas[pos] === 0) { - ++pos; - ++runLength; - } - result.push(128 | (runLength - 1)); - return pos; - } // Helper for encode.VARDELTAS - - function encodeVarDeltaRunAsBytes(deltas, offset, result) { - var runLength = 0; - var numDeltas = deltas.length; - var pos = offset; - while (pos < numDeltas && runLength < 64) { - var value = deltas[pos]; - if (!isByteEncodable(value)) { - break; - } // Within a byte-encoded run of deltas, a single zero is best - // stored literally as 0x00 value. However, if we have two or - // more zeroes in a sequence, it is better to start a new run. - // Fore example, the sequence of deltas [15, 15, 0, 15, 15] - // becomes 6 bytes (04 0F 0F 00 0F 0F) when storing the zero - // within the current run, but 7 bytes (01 0F 0F 80 01 0F 0F) - // when starting a new run. - - if ( - value === 0 && - pos + 1 < numDeltas && - deltas[pos + 1] === 0 - ) { - break; - } - ++pos; - ++runLength; - } - result.push(runLength - 1); - for (var i = offset; i < pos; ++i) { - result.push((deltas[i] + 256) & 255); - } - return pos; - } // Helper for encode.VARDELTAS - - function encodeVarDeltaRunAsWords(deltas, offset, result) { - var runLength = 0; - var numDeltas = deltas.length; - var pos = offset; - while (pos < numDeltas && runLength < 64) { - var value = deltas[pos]; - // Within a word-encoded run of deltas, it is easiest to start - // a new run (with a different encoding) whenever we encounter - // a zero value. For example, the sequence [0x6666, 0, 0x7777] - // needs 7 bytes when storing the zero inside the current run - // (42 66 66 00 00 77 77), and equally 7 bytes when starting a - // new run (40 66 66 80 40 77 77). - if (value === 0) { - break; - } // Within a word-encoded run of deltas, a single value in the - // range (-128..127) should be encoded within the current run - // because it is more compact. For example, the sequence - // [0x6666, 2, 0x7777] becomes 7 bytes when storing the value - // literally (42 66 66 00 02 77 77), but 8 bytes when starting - // a new run (40 66 66 00 02 40 77 77). - - if ( - isByteEncodable(value) && - pos + 1 < numDeltas && - isByteEncodable(deltas[pos + 1]) - ) { - break; - } - ++pos; - ++runLength; - } - result.push(64 | (runLength - 1)); - for (var i = offset; i < pos; ++i) { - var val = deltas[i]; - result.push(((val + 65536) >> 8) & 255, (val + 256) & 255); - } - return pos; - } /** - * Encode a list of variation adjustment deltas. - * - * Variation adjustment deltas are used in ‘gvar’ and ‘cvar’ tables. - * They indicate how points (in ‘gvar’) or values (in ‘cvar’) get adjusted - * when generating instances of variation fonts. - * - * @see https://www.microsoft.com/typography/otspec/gvar.htm - * @see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gvar.html - * @param {Array} - * @return {Array} - */ - - encode.VARDELTAS = function (deltas) { - var pos = 0; - var result = []; - while (pos < deltas.length) { - var value = deltas[pos]; - if (value === 0) { - pos = encodeVarDeltaRunAsZeroes(deltas, pos, result); - } else if (value >= -128 && value <= 127) { - pos = encodeVarDeltaRunAsBytes(deltas, pos, result); - } else { - pos = encodeVarDeltaRunAsWords(deltas, pos, result); - } - } - return result; - }; - // Convert a list of values to a CFF INDEX structure. - // The values should be objects containing name / type / value. - /** - * @param {Array} l - * @returns {Array} - */ - encode.INDEX = function (l) { - //var offset, offsets, offsetEncoder, encodedOffsets, encodedOffset, data, - // i, v; - // Because we have to know which data type to use to encode the offsets, - // we have to go through the values twice: once to encode the data and - // calculate the offsets, then again to encode the offsets using the fitting data type. - var offset = 1; // First offset is always 1. - var offsets = [offset]; - var data = []; - for (var i = 0; i < l.length; i += 1) { - var v = encode.OBJECT(l[i]); - Array.prototype.push.apply(data, v); - offset += v.length; - offsets.push(offset); - } - if (data.length === 0) { - return [0, 0]; - } - var encodedOffsets = []; - var offSize = - (1 + Math.floor(Math.log(offset) / Math.log(2)) / 8) | 0; - var offsetEncoder = [ - undefined, - encode.BYTE, - encode.USHORT, - encode.UINT24, - encode.ULONG, - ][offSize]; - for (var i$1 = 0; i$1 < offsets.length; i$1 += 1) { - var encodedOffset = offsetEncoder(offsets[i$1]); - Array.prototype.push.apply(encodedOffsets, encodedOffset); - } - return Array.prototype.concat( - encode.Card16(l.length), - encode.OffSize(offSize), - encodedOffsets, - data, - ); - }; - /** - * @param {Array} - * @returns {number} - */ - sizeOf.INDEX = function (v) { - return encode.INDEX(v).length; - }; - /** - * Convert an object to a CFF DICT structure. - * The keys should be numeric. - * The values should be objects containing name / type / value. - * @param {Object} m - * @returns {Array} - */ - encode.DICT = function (m) { - var d = []; - var keys = Object.keys(m); - var length = keys.length; - for (var i = 0; i < length; i += 1) { - // Object.keys() return string keys, but our keys are always numeric. - var k = parseInt(keys[i], 0); - var v = m[k]; - // Value comes before the key. - d = d.concat(encode.OPERAND(v.value, v.type)); - d = d.concat(encode.OPERATOR(k)); - } - return d; - }; - /** - * @param {Object} - * @returns {number} - */ - sizeOf.DICT = function (m) { - return encode.DICT(m).length; - }; - /** - * @param {number} - * @returns {Array} - */ - encode.OPERATOR = function (v) { - if (v < 1200) { - return [v]; - } else { - return [12, v - 1200]; - } - }; - /** - * @param {Array} v - * @param {string} - * @returns {Array} - */ - encode.OPERAND = function (v, type) { - var d = []; - if (Array.isArray(type)) { - for (var i = 0; i < type.length; i += 1) { - check.argument( - v.length === type.length, - "Not enough arguments given for type" + type, - ); - d = d.concat(encode.OPERAND(v[i], type[i])); - } - } else { - if (type === "SID") { - d = d.concat(encode.NUMBER(v)); - } else if (type === "offset") { - // We make it easy for ourselves and always encode offsets as - // 4 bytes. This makes offset calculation for the top dict easier. - d = d.concat(encode.NUMBER32(v)); - } else if (type === "number") { - d = d.concat(encode.NUMBER(v)); - } else if (type === "real") { - d = d.concat(encode.REAL(v)); - } else { - throw new Error("Unknown operand type " + type); - // FIXME Add support for booleans - } - } - return d; - }; - encode.OP = encode.BYTE; - sizeOf.OP = sizeOf.BYTE; - // memoize charstring encoding using WeakMap if available - var wmm = typeof WeakMap === "function" && new WeakMap(); - /** - * Convert a list of CharString operations to bytes. - * @param {Array} - * @returns {Array} - */ - encode.CHARSTRING = function (ops) { - // See encode.MACSTRING for why we don't do "if (wmm && wmm.has(ops))". - if (wmm) { - var cachedValue = wmm.get(ops); - if (cachedValue !== undefined) { - return cachedValue; - } - } - var d = []; - var length = ops.length; - for (var i = 0; i < length; i += 1) { - var op = ops[i]; - d = d.concat(encode[op.type](op.value)); - } - if (wmm) { - wmm.set(ops, d); - } - return d; - }; - /** - * @param {Array} - * @returns {number} - */ - sizeOf.CHARSTRING = function (ops) { - return encode.CHARSTRING(ops).length; - }; - // Utility functions //////////////////////////////////////////////////////// - /** - * Convert an object containing name / type / value to bytes. - * @param {Object} - * @returns {Array} - */ - encode.OBJECT = function (v) { - var encodingFunction = encode[v.type]; - check.argument( - encodingFunction !== undefined, - "No encoding function for type " + v.type, - ); - return encodingFunction(v.value); - }; - /** - * @param {Object} - * @returns {number} - */ - sizeOf.OBJECT = function (v) { - var sizeOfFunction = sizeOf[v.type]; - check.argument( - sizeOfFunction !== undefined, - "No sizeOf function for type " + v.type, - ); - return sizeOfFunction(v.value); - }; - /** - * Convert a table object to bytes. - * A table contains a list of fields containing the metadata (name, type and default value). - * The table itself has the field values set as attributes. - * @param {opentype.Table} - * @returns {Array} - */ - encode.TABLE = function (table) { - var d = []; - var length = table.fields.length; - var subtables = []; - var subtableOffsets = []; - for (var i = 0; i < length; i += 1) { - var field = table.fields[i]; - var encodingFunction = encode[field.type]; - check.argument( - encodingFunction !== undefined, - "No encoding function for field type " + - field.type + - " (" + - field.name + - ")", - ); - var value = table[field.name]; - if (value === undefined) { - value = field.value; - } - var bytes = encodingFunction(value); - if (field.type === "TABLE") { - subtableOffsets.push(d.length); - d = d.concat([0, 0]); - subtables.push(bytes); - } else { - d = d.concat(bytes); - } - } - for (var i$1 = 0; i$1 < subtables.length; i$1 += 1) { - var o = subtableOffsets[i$1]; - var offset = d.length; - check.argument( - offset < 65536, - "Table " + table.tableName + " too big.", - ); - d[o] = offset >> 8; - d[o + 1] = offset & 255; - d = d.concat(subtables[i$1]); - } - return d; - }; - /** - * @param {opentype.Table} - * @returns {number} - */ - sizeOf.TABLE = function (table) { - var numBytes = 0; - var length = table.fields.length; - for (var i = 0; i < length; i += 1) { - var field = table.fields[i]; - var sizeOfFunction = sizeOf[field.type]; - check.argument( - sizeOfFunction !== undefined, - "No sizeOf function for field type " + - field.type + - " (" + - field.name + - ")", - ); - var value = table[field.name]; - if (value === undefined) { - value = field.value; - } - numBytes += sizeOfFunction(value); - // Subtables take 2 more bytes for offsets. - if (field.type === "TABLE") { - numBytes += 2; - } - } - return numBytes; - }; - encode.RECORD = encode.TABLE; - sizeOf.RECORD = sizeOf.TABLE; - // Merge in a list of bytes. - encode.LITERAL = function (v) { - return v; - }; - sizeOf.LITERAL = function (v) { - return v.length; - }; - // Table metadata - /** - * @exports opentype.Table - * @class - * @param {string} tableName - * @param {Array} fields - * @param {Object} options - * @constructor - */ - function Table(tableName, fields, options) { - var this$1 = this; - for (var i = 0; i < fields.length; i += 1) { - var field = fields[i]; - this$1[field.name] = field.value; - } - this.tableName = tableName; - this.fields = fields; - if (options) { - var optionKeys = Object.keys(options); - for (var i$1 = 0; i$1 < optionKeys.length; i$1 += 1) { - var k = optionKeys[i$1]; - var v = options[k]; - if (this$1[k] !== undefined) { - this$1[k] = v; - } - } - } - } /** - * Encodes the table and returns an array of bytes - * @return {Array} - */ - - Table.prototype.encode = function () { - return encode.TABLE(this); - }; - /** - * Get the size of the table. - * @return {number} - */ - Table.prototype.sizeOf = function () { - return sizeOf.TABLE(this); - }; - /** - * @private - */ - function ushortList(itemName, list, count) { - if (count === undefined) { - count = list.length; - } - var fields = new Array(list.length + 1); - fields[0] = { - name: itemName + "Count", - type: "USHORT", - value: count, - }; - for (var i = 0; i < list.length; i++) { - fields[i + 1] = { - name: itemName + i, - type: "USHORT", - value: list[i], - }; - } - return fields; - } /** - * @private - */ - - function tableList(itemName, records, itemCallback) { - var count = records.length; - var fields = new Array(count + 1); - fields[0] = { - name: itemName + "Count", - type: "USHORT", - value: count, - }; - for (var i = 0; i < count; i++) { - fields[i + 1] = { - name: itemName + i, - type: "TABLE", - value: itemCallback(records[i], i), - }; - } - return fields; - } /** - * @private - */ - - function recordList(itemName, records, itemCallback) { - var count = records.length; - var fields = []; - fields[0] = { - name: itemName + "Count", - type: "USHORT", - value: count, - }; - for (var i = 0; i < count; i++) { - fields = fields.concat(itemCallback(records[i], i)); - } - return fields; - } // Common Layout Tables - /** - * @exports opentype.Coverage - * @class - * @param {opentype.Table} - * @constructor - * @extends opentype.Table - */ - - function Coverage(coverageTable) { - if (coverageTable.format === 1) { - Table.call( - this, - "coverageTable", - [ - { - name: "coverageFormat", - type: "USHORT", - value: 1, - }, - ].concat(ushortList("glyph", coverageTable.glyphs)), - ); - } else { - check.assert( - false, - "Can't create coverage table format 2 yet.", - ); - } - } - Coverage.prototype = Object.create(Table.prototype); - Coverage.prototype.constructor = Coverage; - function ScriptList(scriptListTable) { - Table.call( - this, - "scriptListTable", - recordList( - "scriptRecord", - scriptListTable, - function (scriptRecord, i) { - var script = scriptRecord.script; - var defaultLangSys = script.defaultLangSys; - check.assert( - !!defaultLangSys, - "Unable to write GSUB: script " + - scriptRecord.tag + - " has no default language system.", - ); - return [ - { - name: "scriptTag" + i, - type: "TAG", - value: scriptRecord.tag, - }, - { - name: "script" + i, - type: "TABLE", - value: new Table( - "scriptTable", - [ - { - name: "defaultLangSys", - type: "TABLE", - value: new Table( - "defaultLangSys", - [ - { - name: "lookupOrder", - type: "USHORT", - value: 0, - }, - { - name: "reqFeatureIndex", - type: "USHORT", - value: defaultLangSys.reqFeatureIndex, - }, - ].concat( - ushortList( - "featureIndex", - defaultLangSys.featureIndexes, - ), - ), - ), - }, - ].concat( - recordList( - "langSys", - script.langSysRecords, - function (langSysRecord, i) { - var langSys = langSysRecord.langSys; - return [ - { - name: "langSysTag" + i, - type: "TAG", - value: langSysRecord.tag, - }, - { - name: "langSys" + i, - type: "TABLE", - value: new Table( - "langSys", - [ - { - name: "lookupOrder", - type: "USHORT", - value: 0, - }, - { - name: "reqFeatureIndex", - type: "USHORT", - value: langSys.reqFeatureIndex, - }, - ].concat( - ushortList( - "featureIndex", - langSys.featureIndexes, - ), - ), - ), - }, - ]; - }, - ), - ), - ), - }, - ]; - }, - ), - ); - } - ScriptList.prototype = Object.create(Table.prototype); - ScriptList.prototype.constructor = ScriptList; - /** - * @exports opentype.FeatureList - * @class - * @param {opentype.Table} - * @constructor - * @extends opentype.Table - */ - function FeatureList(featureListTable) { - Table.call( - this, - "featureListTable", - recordList( - "featureRecord", - featureListTable, - function (featureRecord, i) { - var feature = featureRecord.feature; - return [ - { - name: "featureTag" + i, - type: "TAG", - value: featureRecord.tag, - }, - { - name: "feature" + i, - type: "TABLE", - value: new Table( - "featureTable", - [ - { - name: "featureParams", - type: "USHORT", - value: feature.featureParams, - }, - ].concat( - ushortList( - "lookupListIndex", - feature.lookupListIndexes, - ), - ), - ), - }, - ]; - }, - ), - ); - } - FeatureList.prototype = Object.create(Table.prototype); - FeatureList.prototype.constructor = FeatureList; - /** - * @exports opentype.LookupList - * @class - * @param {opentype.Table} - * @param {Object} - * @constructor - * @extends opentype.Table - */ - function LookupList(lookupListTable, subtableMakers) { - Table.call( - this, - "lookupListTable", - tableList("lookup", lookupListTable, function (lookupTable) { - var subtableCallback = - subtableMakers[lookupTable.lookupType]; - check.assert( - !!subtableCallback, - "Unable to write GSUB lookup type " + - lookupTable.lookupType + - " tables.", - ); - return new Table( - "lookupTable", - [ - { - name: "lookupType", - type: "USHORT", - value: lookupTable.lookupType, - }, - { - name: "lookupFlag", - type: "USHORT", - value: lookupTable.lookupFlag, - }, - ].concat( - tableList( - "subtable", - lookupTable.subtables, - subtableCallback, - ), - ), - ); - }), - ); - } - LookupList.prototype = Object.create(Table.prototype); - LookupList.prototype.constructor = LookupList; - // Record = same as Table, but inlined (a Table has an offset and its data is further in the stream) - // Don't use offsets inside Records (probable bug), only in Tables. - var table = { - Table: Table, - Record: Table, - Coverage: Coverage, - ScriptList: ScriptList, - FeatureList: FeatureList, - LookupList: LookupList, - ushortList: ushortList, - tableList: tableList, - recordList: recordList, - }; - // Parsing utility functions - // Retrieve an unsigned byte from the DataView. - function getByte(dataView, offset) { - return dataView.getUint8(offset); - } // Retrieve an unsigned 16-bit short from the DataView. - // The value is stored in big endian. - - function getUShort(dataView, offset) { - return dataView.getUint16(offset, false); - } // Retrieve a signed 16-bit short from the DataView. - // The value is stored in big endian. - - function getShort(dataView, offset) { - return dataView.getInt16(offset, false); - } // Retrieve an unsigned 32-bit long from the DataView. - // The value is stored in big endian. - - function getULong(dataView, offset) { - return dataView.getUint32(offset, false); - } // Retrieve a 32-bit signed fixed-point number (16.16) from the DataView. - // The value is stored in big endian. - - function getFixed(dataView, offset) { - var decimal = dataView.getInt16(offset, false); - var fraction = dataView.getUint16(offset + 2, false); - return decimal + fraction / 65535; - } // Retrieve a 4-character tag from the DataView. - // Tags are used to identify tables. - - function getTag(dataView, offset) { - var tag = ""; - for (var i = offset; i < offset + 4; i += 1) { - tag += String.fromCharCode(dataView.getInt8(i)); - } - return tag; - } // Retrieve an offset from the DataView. - // Offsets are 1 to 4 bytes in length, depending on the offSize argument. - - function getOffset(dataView, offset, offSize) { - var v = 0; - for (var i = 0; i < offSize; i += 1) { - v <<= 8; - v += dataView.getUint8(offset + i); - } - return v; - } // Retrieve a number of bytes from start offset to the end offset from the DataView. - - function getBytes(dataView, startOffset, endOffset) { - var bytes = []; - for (var i = startOffset; i < endOffset; i += 1) { - bytes.push(dataView.getUint8(i)); - } - return bytes; - } // Convert the list of bytes to a string. - - function bytesToString(bytes) { - var s = ""; - for (var i = 0; i < bytes.length; i += 1) { - s += String.fromCharCode(bytes[i]); - } - return s; - } - var typeOffsets = { - byte: 1, - uShort: 2, - short: 2, - uLong: 4, - fixed: 4, - longDateTime: 8, - tag: 4, - }; - // A stateful parser that changes the offset whenever a value is retrieved. - // The data is a DataView. - function Parser(data, offset) { - this.data = data; - this.offset = offset; - this.relativeOffset = 0; - } - Parser.prototype.parseByte = function () { - var v = this.data.getUint8(this.offset + this.relativeOffset); - this.relativeOffset += 1; - return v; - }; - Parser.prototype.parseChar = function () { - var v = this.data.getInt8(this.offset + this.relativeOffset); - this.relativeOffset += 1; - return v; - }; - Parser.prototype.parseCard8 = Parser.prototype.parseByte; - Parser.prototype.parseUShort = function () { - var v = this.data.getUint16(this.offset + this.relativeOffset); - this.relativeOffset += 2; - return v; - }; - Parser.prototype.parseCard16 = Parser.prototype.parseUShort; - Parser.prototype.parseSID = Parser.prototype.parseUShort; - Parser.prototype.parseOffset16 = Parser.prototype.parseUShort; - Parser.prototype.parseShort = function () { - var v = this.data.getInt16(this.offset + this.relativeOffset); - this.relativeOffset += 2; - return v; - }; - Parser.prototype.parseF2Dot14 = function () { - var v = - this.data.getInt16(this.offset + this.relativeOffset) / 16384; - this.relativeOffset += 2; - return v; - }; - Parser.prototype.parseULong = function () { - var v = getULong(this.data, this.offset + this.relativeOffset); - this.relativeOffset += 4; - return v; - }; - Parser.prototype.parseOffset32 = Parser.prototype.parseULong; - Parser.prototype.parseFixed = function () { - var v = getFixed(this.data, this.offset + this.relativeOffset); - this.relativeOffset += 4; - return v; - }; - Parser.prototype.parseString = function (length) { - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - var string = ""; - this.relativeOffset += length; - for (var i = 0; i < length; i++) { - string += String.fromCharCode(dataView.getUint8(offset + i)); - } - return string; - }; - Parser.prototype.parseTag = function () { - return this.parseString(4); - }; - // LONGDATETIME is a 64-bit integer. - // JavaScript and unix timestamps traditionally use 32 bits, so we - // only take the last 32 bits. - // + Since until 2038 those bits will be filled by zeros we can ignore them. - Parser.prototype.parseLongDateTime = function () { - var v = getULong( - this.data, - this.offset + this.relativeOffset + 4, - ); - // Subtract seconds between 01/01/1904 and 01/01/1970 - // to convert Apple Mac timestamp to Standard Unix timestamp - v -= 2082844800; - this.relativeOffset += 8; - return v; - }; - Parser.prototype.parseVersion = function (minorBase) { - var major = getUShort( - this.data, - this.offset + this.relativeOffset, - ); - // How to interpret the minor version is very vague in the spec. 0x5000 is 5, 0x1000 is 1 - // Default returns the correct number if minor = 0xN000 where N is 0-9 - // Set minorBase to 1 for tables that use minor = N where N is 0-9 - var minor = getUShort( - this.data, - this.offset + this.relativeOffset + 2, - ); - this.relativeOffset += 4; - if (minorBase === undefined) { - minorBase = 4096; - } - return major + minor / minorBase / 10; - }; - Parser.prototype.skip = function (type, amount) { - if (amount === undefined) { - amount = 1; - } - this.relativeOffset += typeOffsets[type] * amount; - }; - ///// Parsing lists and records /////////////////////////////// - // Parse a list of 32 bit unsigned integers. - Parser.prototype.parseULongList = function (count) { - if (count === undefined) { - count = this.parseULong(); - } - var offsets = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - offsets[i] = dataView.getUint32(offset); - offset += 4; - } - this.relativeOffset += count * 4; - return offsets; - }; - // Parse a list of 16 bit unsigned integers. The length of the list can be read on the stream - // or provided as an argument. - Parser.prototype.parseOffset16List = - Parser.prototype.parseUShortList = function (count) { - if (count === undefined) { - count = this.parseUShort(); - } - var offsets = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - offsets[i] = dataView.getUint16(offset); - offset += 2; - } - this.relativeOffset += count * 2; - return offsets; - }; - // Parses a list of 16 bit signed integers. - Parser.prototype.parseShortList = function (count) { - var list = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - list[i] = dataView.getInt16(offset); - offset += 2; - } - this.relativeOffset += count * 2; - return list; - }; - // Parses a list of bytes. - Parser.prototype.parseByteList = function (count) { - var list = new Array(count); - var dataView = this.data; - var offset = this.offset + this.relativeOffset; - for (var i = 0; i < count; i++) { - list[i] = dataView.getUint8(offset++); - } - this.relativeOffset += count; - return list; - }; - /** - * Parse a list of items. - * Record count is optional, if omitted it is read from the stream. - * itemCallback is one of the Parser methods. - */ - Parser.prototype.parseList = function (count, itemCallback) { - var this$1 = this; - if (!itemCallback) { - itemCallback = count; - count = this.parseUShort(); - } - var list = new Array(count); - for (var i = 0; i < count; i++) { - list[i] = itemCallback.call(this$1); - } - return list; - }; - Parser.prototype.parseList32 = function (count, itemCallback) { - var this$1 = this; - if (!itemCallback) { - itemCallback = count; - count = this.parseULong(); - } - var list = new Array(count); - for (var i = 0; i < count; i++) { - list[i] = itemCallback.call(this$1); - } - return list; - }; - /** - * Parse a list of records. - * Record count is optional, if omitted it is read from the stream. - * Example of recordDescription: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } - */ - Parser.prototype.parseRecordList = function ( - count, - recordDescription, - ) { - var this$1 = this; - // If the count argument is absent, read it in the stream. - if (!recordDescription) { - recordDescription = count; - count = this.parseUShort(); - } - var records = new Array(count); - var fields = Object.keys(recordDescription); - for (var i = 0; i < count; i++) { - var rec = {}; - for (var j = 0; j < fields.length; j++) { - var fieldName = fields[j]; - var fieldType = recordDescription[fieldName]; - rec[fieldName] = fieldType.call(this$1); - } - records[i] = rec; - } - return records; - }; - Parser.prototype.parseRecordList32 = function ( - count, - recordDescription, - ) { - var this$1 = this; - // If the count argument is absent, read it in the stream. - if (!recordDescription) { - recordDescription = count; - count = this.parseULong(); - } - var records = new Array(count); - var fields = Object.keys(recordDescription); - for (var i = 0; i < count; i++) { - var rec = {}; - for (var j = 0; j < fields.length; j++) { - var fieldName = fields[j]; - var fieldType = recordDescription[fieldName]; - rec[fieldName] = fieldType.call(this$1); - } - records[i] = rec; - } - return records; - }; - // Parse a data structure into an object - // Example of description: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort } - Parser.prototype.parseStruct = function (description) { - var this$1 = this; - if (typeof description === "function") { - return description.call(this); - } else { - var fields = Object.keys(description); - var struct = {}; - for (var j = 0; j < fields.length; j++) { - var fieldName = fields[j]; - var fieldType = description[fieldName]; - struct[fieldName] = fieldType.call(this$1); - } - return struct; - } - }; - /** - * Parse a GPOS valueRecord - * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record - * valueFormat is optional, if omitted it is read from the stream. - */ - Parser.prototype.parseValueRecord = function (valueFormat) { - if (valueFormat === undefined) { - valueFormat = this.parseUShort(); - } - if (valueFormat === 0) { - // valueFormat2 in kerning pairs is most often 0 - // in this case return undefined instead of an empty object, to save space - return; - } - var valueRecord = {}; - if (valueFormat & 1) { - valueRecord.xPlacement = this.parseShort(); - } - if (valueFormat & 2) { - valueRecord.yPlacement = this.parseShort(); - } - if (valueFormat & 4) { - valueRecord.xAdvance = this.parseShort(); - } - if (valueFormat & 8) { - valueRecord.yAdvance = this.parseShort(); - } // Device table (non-variable font) / VariationIndex table (variable font) not supported - // https://docs.microsoft.com/fr-fr/typography/opentype/spec/chapter2#devVarIdxTbls - - if (valueFormat & 16) { - valueRecord.xPlaDevice = undefined; - this.parseShort(); - } - if (valueFormat & 32) { - valueRecord.yPlaDevice = undefined; - this.parseShort(); - } - if (valueFormat & 64) { - valueRecord.xAdvDevice = undefined; - this.parseShort(); - } - if (valueFormat & 128) { - valueRecord.yAdvDevice = undefined; - this.parseShort(); - } - return valueRecord; - }; - /** - * Parse a list of GPOS valueRecords - * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record - * valueFormat and valueCount are read from the stream. - */ - Parser.prototype.parseValueRecordList = function () { - var this$1 = this; - var valueFormat = this.parseUShort(); - var valueCount = this.parseUShort(); - var values = new Array(valueCount); - for (var i = 0; i < valueCount; i++) { - values[i] = this$1.parseValueRecord(valueFormat); - } - return values; - }; - Parser.prototype.parsePointer = function (description) { - var structOffset = this.parseOffset16(); - if (structOffset > 0) { - // NULL offset => return undefined - return new Parser( - this.data, - this.offset + structOffset, - ).parseStruct(description); - } - return undefined; - }; - Parser.prototype.parsePointer32 = function (description) { - var structOffset = this.parseOffset32(); - if (structOffset > 0) { - // NULL offset => return undefined - return new Parser( - this.data, - this.offset + structOffset, - ).parseStruct(description); - } - return undefined; - }; - /** - * Parse a list of offsets to lists of 16-bit integers, - * or a list of offsets to lists of offsets to any kind of items. - * If itemCallback is not provided, a list of list of UShort is assumed. - * If provided, itemCallback is called on each item and must parse the item. - * See examples in tables/gsub.js - */ - Parser.prototype.parseListOfLists = function (itemCallback) { - var this$1 = this; - var offsets = this.parseOffset16List(); - var count = offsets.length; - var relativeOffset = this.relativeOffset; - var list = new Array(count); - for (var i = 0; i < count; i++) { - var start = offsets[i]; - if (start === 0) { - // NULL offset - // Add i as owned property to list. Convenient with assert. - list[i] = undefined; - continue; - } - this$1.relativeOffset = start; - if (itemCallback) { - var subOffsets = this$1.parseOffset16List(); - var subList = new Array(subOffsets.length); - for (var j = 0; j < subOffsets.length; j++) { - this$1.relativeOffset = start + subOffsets[j]; - subList[j] = itemCallback.call(this$1); - } - list[i] = subList; - } else { - list[i] = this$1.parseUShortList(); - } - } - this.relativeOffset = relativeOffset; - return list; - }; - ///// Complex tables parsing ////////////////////////////////// - // Parse a coverage table in a GSUB, GPOS or GDEF table. - // https://www.microsoft.com/typography/OTSPEC/chapter2.htm - // parser.offset must point to the start of the table containing the coverage. - Parser.prototype.parseCoverage = function () { - var this$1 = this; - var startOffset = this.offset + this.relativeOffset; - var format = this.parseUShort(); - var count = this.parseUShort(); - if (format === 1) { - return { - format: 1, - glyphs: this.parseUShortList(count), - }; - } else if (format === 2) { - var ranges = new Array(count); - for (var i = 0; i < count; i++) { - ranges[i] = { - start: this$1.parseUShort(), - end: this$1.parseUShort(), - index: this$1.parseUShort(), - }; - } - return { - format: 2, - ranges: ranges, - }; - } - throw new Error( - "0x" + - startOffset.toString(16) + - ": Coverage format must be 1 or 2.", - ); - }; - // Parse a Class Definition Table in a GSUB, GPOS or GDEF table. - // https://www.microsoft.com/typography/OTSPEC/chapter2.htm - Parser.prototype.parseClassDef = function () { - var startOffset = this.offset + this.relativeOffset; - var format = this.parseUShort(); - if (format === 1) { - return { - format: 1, - startGlyph: this.parseUShort(), - classes: this.parseUShortList(), - }; - } else if (format === 2) { - return { - format: 2, - ranges: this.parseRecordList({ - start: Parser.uShort, - end: Parser.uShort, - classId: Parser.uShort, - }), - }; - } - throw new Error( - "0x" + - startOffset.toString(16) + - ": ClassDef format must be 1 or 2.", - ); - }; - ///// Static methods /////////////////////////////////// - // These convenience methods can be used as callbacks and should be called with "this" context set to a Parser instance. - Parser.list = function (count, itemCallback) { - return function () { - return this.parseList(count, itemCallback); - }; - }; - Parser.list32 = function (count, itemCallback) { - return function () { - return this.parseList32(count, itemCallback); - }; - }; - Parser.recordList = function (count, recordDescription) { - return function () { - return this.parseRecordList(count, recordDescription); - }; - }; - Parser.recordList32 = function (count, recordDescription) { - return function () { - return this.parseRecordList32(count, recordDescription); - }; - }; - Parser.pointer = function (description) { - return function () { - return this.parsePointer(description); - }; - }; - Parser.pointer32 = function (description) { - return function () { - return this.parsePointer32(description); - }; - }; - Parser.tag = Parser.prototype.parseTag; - Parser.byte = Parser.prototype.parseByte; - Parser.uShort = Parser.offset16 = Parser.prototype.parseUShort; - Parser.uShortList = Parser.prototype.parseUShortList; - Parser.uLong = Parser.offset32 = Parser.prototype.parseULong; - Parser.uLongList = Parser.prototype.parseULongList; - Parser.struct = Parser.prototype.parseStruct; - Parser.coverage = Parser.prototype.parseCoverage; - Parser.classDef = Parser.prototype.parseClassDef; - ///// Script, Feature, Lookup lists /////////////////////////////////////////////// - // https://www.microsoft.com/typography/OTSPEC/chapter2.htm - var langSysTable = { - reserved: Parser.uShort, - reqFeatureIndex: Parser.uShort, - featureIndexes: Parser.uShortList, - }; - Parser.prototype.parseScriptList = function () { - return ( - this.parsePointer( - Parser.recordList({ - tag: Parser.tag, - script: Parser.pointer({ - defaultLangSys: Parser.pointer(langSysTable), - langSysRecords: Parser.recordList({ - tag: Parser.tag, - langSys: Parser.pointer(langSysTable), - }), - }), - }), - ) || [] - ); - }; - Parser.prototype.parseFeatureList = function () { - return ( - this.parsePointer( - Parser.recordList({ - tag: Parser.tag, - feature: Parser.pointer({ - featureParams: Parser.offset16, - lookupListIndexes: Parser.uShortList, - }), - }), - ) || [] - ); - }; - Parser.prototype.parseLookupList = function (lookupTableParsers) { - return ( - this.parsePointer( - Parser.list( - Parser.pointer(function () { - var lookupType = this.parseUShort(); - check.argument( - 1 <= lookupType && lookupType <= 9, - "GPOS/GSUB lookup type " + lookupType + " unknown.", - ); - var lookupFlag = this.parseUShort(); - var useMarkFilteringSet = lookupFlag & 16; - return { - lookupType: lookupType, - lookupFlag: lookupFlag, - subtables: this.parseList( - Parser.pointer(lookupTableParsers[lookupType]), - ), - markFilteringSet: useMarkFilteringSet - ? this.parseUShort() - : undefined, - }; - }), - ), - ) || [] - ); - }; - Parser.prototype.parseFeatureVariationsList = function () { - return ( - this.parsePointer32(function () { - var majorVersion = this.parseUShort(); - var minorVersion = this.parseUShort(); - check.argument( - majorVersion === 1 && minorVersion < 1, - "GPOS/GSUB feature variations table unknown.", - ); - var featureVariations = this.parseRecordList32({ - conditionSetOffset: Parser.offset32, - featureTableSubstitutionOffset: Parser.offset32, - }); - return featureVariations; - }) || [] - ); - }; - var parse = { - getByte: getByte, - getCard8: getByte, - getUShort: getUShort, - getCard16: getUShort, - getShort: getShort, - getULong: getULong, - getFixed: getFixed, - getTag: getTag, - getOffset: getOffset, - getBytes: getBytes, - bytesToString: bytesToString, - Parser: Parser, - }; - // The `cmap` table stores the mappings from characters to glyphs. - function parseCmapTableFormat12(cmap, p) { - //Skip reserved. - p.parseUShort(); - // Length in bytes of the sub-tables. - cmap.length = p.parseULong(); - cmap.language = p.parseULong(); - var groupCount; - cmap.groupCount = groupCount = p.parseULong(); - cmap.glyphIndexMap = {}; - for (var i = 0; i < groupCount; i += 1) { - var startCharCode = p.parseULong(); - var endCharCode = p.parseULong(); - var startGlyphId = p.parseULong(); - for (var c = startCharCode; c <= endCharCode; c += 1) { - cmap.glyphIndexMap[c] = startGlyphId; - startGlyphId++; - } - } - } - function parseCmapTableFormat4(cmap, p, data, start, offset) { - // Length in bytes of the sub-tables. - cmap.length = p.parseUShort(); - cmap.language = p.parseUShort(); - // segCount is stored x 2. - var segCount; - cmap.segCount = segCount = p.parseUShort() >> 1; - // Skip searchRange, entrySelector, rangeShift. - p.skip("uShort", 3); - // The "unrolled" mapping from character codes to glyph indices. - cmap.glyphIndexMap = {}; - var endCountParser = new parse.Parser( - data, - start + offset + 14, - ); - var startCountParser = new parse.Parser( - data, - start + offset + 16 + segCount * 2, - ); - var idDeltaParser = new parse.Parser( - data, - start + offset + 16 + segCount * 4, - ); - var idRangeOffsetParser = new parse.Parser( - data, - start + offset + 16 + segCount * 6, - ); - var glyphIndexOffset = start + offset + 16 + segCount * 8; - for (var i = 0; i < segCount - 1; i += 1) { - var glyphIndex = void 0; - var endCount = endCountParser.parseUShort(); - var startCount = startCountParser.parseUShort(); - var idDelta = idDeltaParser.parseShort(); - var idRangeOffset = idRangeOffsetParser.parseUShort(); - for (var c = startCount; c <= endCount; c += 1) { - if (idRangeOffset !== 0) { - // The idRangeOffset is relative to the current position in the idRangeOffset array. - // Take the current offset in the idRangeOffset array. - glyphIndexOffset = - idRangeOffsetParser.offset + - idRangeOffsetParser.relativeOffset - - 2; - // Add the value of the idRangeOffset, which will move us into the glyphIndex array. - glyphIndexOffset += idRangeOffset; - // Then add the character index of the current segment, multiplied by 2 for USHORTs. - glyphIndexOffset += (c - startCount) * 2; - glyphIndex = parse.getUShort(data, glyphIndexOffset); - if (glyphIndex !== 0) { - glyphIndex = (glyphIndex + idDelta) & 65535; - } - } else { - glyphIndex = (c + idDelta) & 65535; - } - cmap.glyphIndexMap[c] = glyphIndex; - } - } - } // Parse the `cmap` table. This table stores the mappings from characters to glyphs. - // There are many available formats, but we only support the Windows format 4 and 12. - // This function returns a `CmapEncoding` object or null if no supported format could be found. - - function parseCmapTable(data, start) { - var cmap = {}; - cmap.version = parse.getUShort(data, start); - check.argument( - cmap.version === 0, - "cmap table version should be 0.", - ); - // The cmap table can contain many sub-tables, each with their own format. - // We're only interested in a "platform 0" (Unicode format) and "platform 3" (Windows format) table. - cmap.numTables = parse.getUShort(data, start + 2); - var offset = -1; - for (var i = cmap.numTables - 1; i >= 0; i -= 1) { - var platformId = parse.getUShort(data, start + 4 + i * 8); - var encodingId = parse.getUShort(data, start + 4 + i * 8 + 2); - if ( - (platformId === 3 && - (encodingId === 0 || - encodingId === 1 || - encodingId === 10)) || - (platformId === 0 && - (encodingId === 0 || - encodingId === 1 || - encodingId === 2 || - encodingId === 3 || - encodingId === 4)) - ) { - offset = parse.getULong(data, start + 4 + i * 8 + 4); - break; - } - } - if (offset === -1) { - // There is no cmap table in the font that we support. - throw new Error("No valid cmap sub-tables found."); - } - var p = new parse.Parser(data, start + offset); - cmap.format = p.parseUShort(); - if (cmap.format === 12) { - parseCmapTableFormat12(cmap, p); - } else if (cmap.format === 4) { - parseCmapTableFormat4(cmap, p, data, start, offset); - } else { - throw new Error( - "Only format 4 and 12 cmap tables are supported (found format " + - cmap.format + - ").", - ); - } - return cmap; - } - function addSegment(t, code, glyphIndex) { - t.segments.push({ - end: code, - start: code, - delta: -(code - glyphIndex), - offset: 0, - glyphIndex: glyphIndex, - }); - } - function addTerminatorSegment(t) { - t.segments.push({ - end: 65535, - start: 65535, - delta: 1, - offset: 0, - }); - } // Make cmap table, format 4 by default, 12 if needed only - - function makeCmapTable(glyphs) { - // Plan 0 is the base Unicode Plan but emojis, for example are on another plan, and needs cmap 12 format (with 32bit) - var isPlan0Only = true; - var i; - // Check if we need to add cmap format 12 or if format 4 only is fine - for (i = glyphs.length - 1; i > 0; i -= 1) { - var g = glyphs.get(i); - if (g.unicode > 65535) { - console.log("Adding CMAP format 12 (needed!)"); - isPlan0Only = false; - break; - } - } - var cmapTable = [ - { - name: "version", - type: "USHORT", - value: 0, - }, - { - name: "numTables", - type: "USHORT", - value: isPlan0Only ? 1 : 2, - }, - // CMAP 4 header - { - name: "platformID", - type: "USHORT", - value: 3, - }, - { - name: "encodingID", - type: "USHORT", - value: 1, - }, - { - name: "offset", - type: "ULONG", - value: isPlan0Only ? 12 : 12 + 8, - }, - ]; - if (!isPlan0Only) { - cmapTable = cmapTable.concat([ - // CMAP 12 header - { - name: "cmap12PlatformID", - type: "USHORT", - value: 3, - }, - // We encode only for PlatformID = 3 (Windows) because it is supported everywhere - { - name: "cmap12EncodingID", - type: "USHORT", - value: 10, - }, - { - name: "cmap12Offset", - type: "ULONG", - value: 0, - }, - ]); - } - cmapTable = cmapTable.concat([ - // CMAP 4 Subtable - { - name: "format", - type: "USHORT", - value: 4, - }, - { - name: "cmap4Length", - type: "USHORT", - value: 0, - }, - { - name: "language", - type: "USHORT", - value: 0, - }, - { - name: "segCountX2", - type: "USHORT", - value: 0, - }, - { - name: "searchRange", - type: "USHORT", - value: 0, - }, - { - name: "entrySelector", - type: "USHORT", - value: 0, - }, - { - name: "rangeShift", - type: "USHORT", - value: 0, - }, - ]); - var t = new table.Table("cmap", cmapTable); - t.segments = []; - for (i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - for (var j = 0; j < glyph.unicodes.length; j += 1) { - addSegment(t, glyph.unicodes[j], i); - } - t.segments = t.segments.sort(function (a, b) { - return a.start - b.start; - }); - } - addTerminatorSegment(t); - var segCount = t.segments.length; - var segCountToRemove = 0; - // CMAP 4 - // Set up parallel segment arrays. - var endCounts = []; - var startCounts = []; - var idDeltas = []; - var idRangeOffsets = []; - var glyphIds = []; - // CMAP 12 - var cmap12Groups = []; - // Reminder this loop is not following the specification at 100% - // The specification -> find suites of characters and make a group - // Here we're doing one group for each letter - // Doing as the spec can save 8 times (or more) space - for (i = 0; i < segCount; i += 1) { - var segment = t.segments[i]; - // CMAP 4 - if (segment.end <= 65535 && segment.start <= 65535) { - endCounts = endCounts.concat({ - name: "end_" + i, - type: "USHORT", - value: segment.end, - }); - startCounts = startCounts.concat({ - name: "start_" + i, - type: "USHORT", - value: segment.start, - }); - idDeltas = idDeltas.concat({ - name: "idDelta_" + i, - type: "SHORT", - value: segment.delta, - }); - idRangeOffsets = idRangeOffsets.concat({ - name: "idRangeOffset_" + i, - type: "USHORT", - value: segment.offset, - }); - if (segment.glyphId !== undefined) { - glyphIds = glyphIds.concat({ - name: "glyph_" + i, - type: "USHORT", - value: segment.glyphId, - }); - } - } else { - // Skip Unicode > 65535 (16bit unsigned max) for CMAP 4, will be added in CMAP 12 - segCountToRemove += 1; - } // CMAP 12 - // Skip Terminator Segment - - if (!isPlan0Only && segment.glyphIndex !== undefined) { - cmap12Groups = cmap12Groups.concat({ - name: "cmap12Start_" + i, - type: "ULONG", - value: segment.start, - }); - cmap12Groups = cmap12Groups.concat({ - name: "cmap12End_" + i, - type: "ULONG", - value: segment.end, - }); - cmap12Groups = cmap12Groups.concat({ - name: "cmap12Glyph_" + i, - type: "ULONG", - value: segment.glyphIndex, - }); - } - } // CMAP 4 Subtable - - t.segCountX2 = (segCount - segCountToRemove) * 2; - t.searchRange = - Math.pow( - 2, - Math.floor( - Math.log(segCount - segCountToRemove) / Math.log(2), - ), - ) * 2; - t.entrySelector = Math.log(t.searchRange / 2) / Math.log(2); - t.rangeShift = t.segCountX2 - t.searchRange; - t.fields = t.fields.concat(endCounts); - t.fields.push({ - name: "reservedPad", - type: "USHORT", - value: 0, - }); - t.fields = t.fields.concat(startCounts); - t.fields = t.fields.concat(idDeltas); - t.fields = t.fields.concat(idRangeOffsets); - t.fields = t.fields.concat(glyphIds); - t.cmap4Length = - 14 + // Subtable header - endCounts.length * 2 + - 2 + // reservedPad - startCounts.length * 2 + - idDeltas.length * 2 + - idRangeOffsets.length * 2 + - glyphIds.length * 2; - if (!isPlan0Only) { - // CMAP 12 Subtable - var cmap12Length = - 16 + // Subtable header - cmap12Groups.length * 4; - t.cmap12Offset = 12 + 2 * 2 + 4 + t.cmap4Length; - t.fields = t.fields.concat([ - { - name: "cmap12Format", - type: "USHORT", - value: 12, - }, - { - name: "cmap12Reserved", - type: "USHORT", - value: 0, - }, - { - name: "cmap12Length", - type: "ULONG", - value: cmap12Length, - }, - { - name: "cmap12Language", - type: "ULONG", - value: 0, - }, - { - name: "cmap12nGroups", - type: "ULONG", - value: cmap12Groups.length / 3, - }, - ]); - t.fields = t.fields.concat(cmap12Groups); - } - return t; - } - var cmap = { - parse: parseCmapTable, - make: makeCmapTable, - }; - // Glyph encoding - var cffStandardStrings = [ - ".notdef", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "questiondown", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "AE", - "ordfeminine", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "ae", - "dotlessi", - "lslash", - "oslash", - "oe", - "germandbls", - "onesuperior", - "logicalnot", - "mu", - "trademark", - "Eth", - "onehalf", - "plusminus", - "Thorn", - "onequarter", - "divide", - "brokenbar", - "degree", - "thorn", - "threequarters", - "twosuperior", - "registered", - "minus", - "eth", - "multiply", - "threesuperior", - "copyright", - "Aacute", - "Acircumflex", - "Adieresis", - "Agrave", - "Aring", - "Atilde", - "Ccedilla", - "Eacute", - "Ecircumflex", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Ntilde", - "Oacute", - "Ocircumflex", - "Odieresis", - "Ograve", - "Otilde", - "Scaron", - "Uacute", - "Ucircumflex", - "Udieresis", - "Ugrave", - "Yacute", - "Ydieresis", - "Zcaron", - "aacute", - "acircumflex", - "adieresis", - "agrave", - "aring", - "atilde", - "ccedilla", - "eacute", - "ecircumflex", - "edieresis", - "egrave", - "iacute", - "icircumflex", - "idieresis", - "igrave", - "ntilde", - "oacute", - "ocircumflex", - "odieresis", - "ograve", - "otilde", - "scaron", - "uacute", - "ucircumflex", - "udieresis", - "ugrave", - "yacute", - "ydieresis", - "zcaron", - "exclamsmall", - "Hungarumlautsmall", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "266 ff", - "onedotenleader", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "isuperior", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "rsuperior", - "ssuperior", - "tsuperior", - "ff", - "ffi", - "ffl", - "parenleftinferior", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "Dotaccentsmall", - "Macronsmall", - "figuredash", - "hypheninferior", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "zerosuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - "001.000", - "001.001", - "001.002", - "001.003", - "Black", - "Bold", - "Book", - "Light", - "Medium", - "Regular", - "Roman", - "Semibold", - ]; - var cffStandardEncoding = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "", - "questiondown", - "", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "", - "ring", - "cedilla", - "", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "AE", - "", - "ordfeminine", - "", - "", - "", - "", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "", - "", - "", - "", - "", - "ae", - "", - "", - "", - "dotlessi", - "", - "", - "lslash", - "oslash", - "oe", - "germandbls", - ]; - var cffExpertEncoding = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclamsmall", - "Hungarumlautsmall", - "", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "comma", - "hyphen", - "period", - "fraction", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "colon", - "semicolon", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "", - "", - "isuperior", - "", - "", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "", - "", - "rsuperior", - "ssuperior", - "tsuperior", - "", - "ff", - "fi", - "fl", - "ffi", - "ffl", - "parenleftinferior", - "", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "", - "", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "", - "Dotaccentsmall", - "", - "", - "Macronsmall", - "", - "", - "figuredash", - "hypheninferior", - "", - "", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "", - "", - "", - "onequarter", - "onehalf", - "threequarters", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "", - "", - "zerosuperior", - "onesuperior", - "twosuperior", - "threesuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - ]; - var standardNames = [ - ".notdef", - ".null", - "nonmarkingreturn", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quotesingle", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "grave", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "Adieresis", - "Aring", - "Ccedilla", - "Eacute", - "Ntilde", - "Odieresis", - "Udieresis", - "aacute", - "agrave", - "acircumflex", - "adieresis", - "atilde", - "aring", - "ccedilla", - "eacute", - "egrave", - "ecircumflex", - "edieresis", - "iacute", - "igrave", - "icircumflex", - "idieresis", - "ntilde", - "oacute", - "ograve", - "ocircumflex", - "odieresis", - "otilde", - "uacute", - "ugrave", - "ucircumflex", - "udieresis", - "dagger", - "degree", - "cent", - "sterling", - "section", - "bullet", - "paragraph", - "germandbls", - "registered", - "copyright", - "trademark", - "acute", - "dieresis", - "notequal", - "AE", - "Oslash", - "infinity", - "plusminus", - "lessequal", - "greaterequal", - "yen", - "mu", - "partialdiff", - "summation", - "product", - "pi", - "integral", - "ordfeminine", - "ordmasculine", - "Omega", - "ae", - "oslash", - "questiondown", - "exclamdown", - "logicalnot", - "radical", - "florin", - "approxequal", - "Delta", - "guillemotleft", - "guillemotright", - "ellipsis", - "nonbreakingspace", - "Agrave", - "Atilde", - "Otilde", - "OE", - "oe", - "endash", - "emdash", - "quotedblleft", - "quotedblright", - "quoteleft", - "quoteright", - "divide", - "lozenge", - "ydieresis", - "Ydieresis", - "fraction", - "currency", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "daggerdbl", - "periodcentered", - "quotesinglbase", - "quotedblbase", - "perthousand", - "Acircumflex", - "Ecircumflex", - "Aacute", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Oacute", - "Ocircumflex", - "apple", - "Ograve", - "Uacute", - "Ucircumflex", - "Ugrave", - "dotlessi", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "Lslash", - "lslash", - "Scaron", - "scaron", - "Zcaron", - "zcaron", - "brokenbar", - "Eth", - "eth", - "Yacute", - "yacute", - "Thorn", - "thorn", - "minus", - "multiply", - "onesuperior", - "twosuperior", - "threesuperior", - "onehalf", - "onequarter", - "threequarters", - "franc", - "Gbreve", - "gbreve", - "Idotaccent", - "Scedilla", - "scedilla", - "Cacute", - "cacute", - "Ccaron", - "ccaron", - "dcroat", - ]; - /** - * This is the encoding used for fonts created from scratch. - * It loops through all glyphs and finds the appropriate unicode value. - * Since it's linear time, other encodings will be faster. - * @exports opentype.DefaultEncoding - * @class - * @constructor - * @param {opentype.Font} - */ - function DefaultEncoding(font) { - this.font = font; - } - DefaultEncoding.prototype.charToGlyphIndex = function (c) { - var code = c.codePointAt(0); - var glyphs = this.font.glyphs; - if (glyphs) { - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - for (var j = 0; j < glyph.unicodes.length; j += 1) { - if (glyph.unicodes[j] === code) { - return i; - } - } - } - } - return null; - }; - /** - * @exports opentype.CmapEncoding - * @class - * @constructor - * @param {Object} cmap - a object with the cmap encoded data - */ - function CmapEncoding(cmap) { - this.cmap = cmap; - } /** - * @param {string} c - the character - * @return {number} The glyph index. - */ - - CmapEncoding.prototype.charToGlyphIndex = function (c) { - return this.cmap.glyphIndexMap[c.codePointAt(0)] || 0; - }; - /** - * @exports opentype.CffEncoding - * @class - * @constructor - * @param {string} encoding - The encoding - * @param {Array} charset - The character set. - */ - function CffEncoding(encoding, charset) { - this.encoding = encoding; - this.charset = charset; - } /** - * @param {string} s - The character - * @return {number} The index. - */ - - CffEncoding.prototype.charToGlyphIndex = function (s) { - var code = s.codePointAt(0); - var charName = this.encoding[code]; - return this.charset.indexOf(charName); - }; - /** - * @exports opentype.GlyphNames - * @class - * @constructor - * @param {Object} post - */ - function GlyphNames(post) { - var this$1 = this; - switch (post.version) { - case 1: - this.names = standardNames.slice(); - break; - case 2: - this.names = new Array(post.numberOfGlyphs); - for (var i = 0; i < post.numberOfGlyphs; i++) { - if (post.glyphNameIndex[i] < standardNames.length) { - this$1.names[i] = standardNames[post.glyphNameIndex[i]]; - } else { - this$1.names[i] = - post.names[ - post.glyphNameIndex[i] - standardNames.length - ]; - } - } - break; - case 2.5: - this.names = new Array(post.numberOfGlyphs); - for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { - this$1.names[i$1] = - standardNames[i$1 + post.glyphNameIndex[i$1]]; - } - break; - case 3: - this.names = []; - break; - default: - this.names = []; - break; - } - } /** - * Gets the index of a glyph by name. - * @param {string} name - The glyph name - * @return {number} The index - */ - - GlyphNames.prototype.nameToGlyphIndex = function (name) { - return this.names.indexOf(name); - }; - /** - * @param {number} gid - * @return {string} - */ - GlyphNames.prototype.glyphIndexToName = function (gid) { - return this.names[gid]; - }; - /** - * @alias opentype.addGlyphNames - * @param {opentype.Font} - */ - function addGlyphNames(font) { - var glyph; - var glyphIndexMap = font.tables.cmap.glyphIndexMap; - var charCodes = Object.keys(glyphIndexMap); - for (var i = 0; i < charCodes.length; i += 1) { - var c = charCodes[i]; - var glyphIndex = glyphIndexMap[c]; - glyph = font.glyphs.get(glyphIndex); - glyph.addUnicode(parseInt(c)); - } - for (var i$1 = 0; i$1 < font.glyphs.length; i$1 += 1) { - glyph = font.glyphs.get(i$1); - if (font.cffEncoding) { - if (font.isCIDFont) { - glyph.name = "gid" + i$1; - } else { - glyph.name = font.cffEncoding.charset[i$1]; - } - } else if (font.glyphNames.names) { - glyph.name = font.glyphNames.glyphIndexToName(i$1); - } - } - } // Drawing utility functions. - // Draw a line on the given context from point `x1,y1` to point `x2,y2`. - - function line(ctx, x1, y1, x2, y2) { - ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.stroke(); - } - var draw = { - line: line, - }; - // The Glyph object - // import glyf from './tables/glyf' Can't be imported here, because it's a circular dependency - function getPathDefinition(glyph, path) { - var _path = path || new Path(); - return { - configurable: true, - get: function () { - if (typeof _path === "function") { - _path = _path(); - } - return _path; - }, - set: function (p) { - _path = p; - }, - }; - } - /** - * @typedef GlyphOptions - * @type Object - * @property {string} [name] - The glyph name - * @property {number} [unicode] - * @property {Array} [unicodes] - * @property {number} [xMin] - * @property {number} [yMin] - * @property {number} [xMax] - * @property {number} [yMax] - * @property {number} [advanceWidth] - */ - // A Glyph is an individual mark that often corresponds to a character. - // Some glyphs, such as ligatures, are a combination of many characters. - // Glyphs are the basic building blocks of a font. - // - // The `Glyph` class contains utility methods for drawing the path and its points. - /** - * @exports opentype.Glyph - * @class - * @param {GlyphOptions} - * @constructor - */ - - function Glyph(options) { - // By putting all the code on a prototype function (which is only declared once) - // we reduce the memory requirements for larger fonts by some 2% - this.bindConstructorValues(options); - } /** - * @param {GlyphOptions} - */ - - Glyph.prototype.bindConstructorValues = function (options) { - this.index = options.index || 0; - // These three values cannot be deferred for memory optimization: - this.name = options.name || null; - this.unicode = options.unicode || undefined; - this.unicodes = - options.unicodes || options.unicode !== undefined - ? [options.unicode] - : []; - // But by binding these values only when necessary, we reduce can - // the memory requirements by almost 3% for larger fonts. - if (options.xMin) { - this.xMin = options.xMin; - } - if (options.yMin) { - this.yMin = options.yMin; - } - if (options.xMax) { - this.xMax = options.xMax; - } - if (options.yMax) { - this.yMax = options.yMax; - } - if (options.advanceWidth) { - this.advanceWidth = options.advanceWidth; - } // The path for a glyph is the most memory intensive, and is bound as a value - // with a getter/setter to ensure we actually do path parsing only once the - // path is actually needed by anything. - - Object.defineProperty( - this, - "path", - getPathDefinition(this, options.path), - ); - }; - /** - * @param {number} - */ - Glyph.prototype.addUnicode = function (unicode) { - if (this.unicodes.length === 0) { - this.unicode = unicode; - } - this.unicodes.push(unicode); - }; - /** - * Calculate the minimum bounding box for this glyph. - * @return {opentype.BoundingBox} - */ - Glyph.prototype.getBoundingBox = function () { - return this.path.getBoundingBox(); - }; - /** - * Convert the glyph to a Path we can draw on a drawing context. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {Object=} options - xScale, yScale to stretch the glyph. - * @param {opentype.Font} if hinting is to be used, the font - * @return {opentype.Path} - */ - Glyph.prototype.getPath = function ( - x, - y, - fontSize, - options, - font, - ) { - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 72; - var commands; - var hPoints; - if (!options) { - options = {}; - } - var xScale = options.xScale; - var yScale = options.yScale; - if (options.hinting && font && font.hinting) { - // in case of hinting, the hinting engine takes care - // of scaling the points (not the path) before hinting. - hPoints = this.path && font.hinting.exec(this, fontSize); - // in case the hinting engine failed hPoints is undefined - // and thus reverts to plain rending - } - if (hPoints) { - // Call font.hinting.getCommands instead of `glyf.getPath(hPoints).commands` to avoid a circular dependency - commands = font.hinting.getCommands(hPoints); - x = Math.round(x); - y = Math.round(y); - // TODO in case of hinting xyScaling is not yet supported - xScale = yScale = 1; - } else { - commands = this.path.commands; - var scale = (1 / this.path.unitsPerEm) * fontSize; - if (xScale === undefined) { - xScale = scale; - } - if (yScale === undefined) { - yScale = scale; - } - } - var p = new Path(); - for (var i = 0; i < commands.length; i += 1) { - var cmd = commands[i]; - if (cmd.type === "M") { - p.moveTo(x + cmd.x * xScale, y + -cmd.y * yScale); - } else if (cmd.type === "L") { - p.lineTo(x + cmd.x * xScale, y + -cmd.y * yScale); - } else if (cmd.type === "Q") { - p.quadraticCurveTo( - x + cmd.x1 * xScale, - y + -cmd.y1 * yScale, - x + cmd.x * xScale, - y + -cmd.y * yScale, - ); - } else if (cmd.type === "C") { - p.curveTo( - x + cmd.x1 * xScale, - y + -cmd.y1 * yScale, - x + cmd.x2 * xScale, - y + -cmd.y2 * yScale, - x + cmd.x * xScale, - y + -cmd.y * yScale, - ); - } else if (cmd.type === "Z") { - p.closePath(); - } - } - return p; - }; - /** - * Split the glyph into contours. - * This function is here for backwards compatibility, and to - * provide raw access to the TrueType glyph outlines. - * @return {Array} - */ - Glyph.prototype.getContours = function () { - var this$1 = this; - if (this.points === undefined) { - return []; - } - var contours = []; - var currentContour = []; - for (var i = 0; i < this.points.length; i += 1) { - var pt = this$1.points[i]; - currentContour.push(pt); - if (pt.lastPointOfContour) { - contours.push(currentContour); - currentContour = []; - } - } - check.argument( - currentContour.length === 0, - "There are still points left in the current contour.", - ); - return contours; - }; - /** - * Calculate the xMin/yMin/xMax/yMax/lsb/rsb for a Glyph. - * @return {Object} - */ - Glyph.prototype.getMetrics = function () { - var commands = this.path.commands; - var xCoords = []; - var yCoords = []; - for (var i = 0; i < commands.length; i += 1) { - var cmd = commands[i]; - if (cmd.type !== "Z") { - xCoords.push(cmd.x); - yCoords.push(cmd.y); - } - if (cmd.type === "Q" || cmd.type === "C") { - xCoords.push(cmd.x1); - yCoords.push(cmd.y1); - } - if (cmd.type === "C") { - xCoords.push(cmd.x2); - yCoords.push(cmd.y2); - } - } - var metrics = { - xMin: Math.min.apply(null, xCoords), - yMin: Math.min.apply(null, yCoords), - xMax: Math.max.apply(null, xCoords), - yMax: Math.max.apply(null, yCoords), - leftSideBearing: this.leftSideBearing, - }; - if (!isFinite(metrics.xMin)) { - metrics.xMin = 0; - } - if (!isFinite(metrics.xMax)) { - metrics.xMax = this.advanceWidth; - } - if (!isFinite(metrics.yMin)) { - metrics.yMin = 0; - } - if (!isFinite(metrics.yMax)) { - metrics.yMax = 0; - } - metrics.rightSideBearing = - this.advanceWidth - - metrics.leftSideBearing - - (metrics.xMax - metrics.xMin); - return metrics; - }; - /** - * Draw the glyph on the given context. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {Object=} options - xScale, yScale to stretch the glyph. - */ - Glyph.prototype.draw = function (ctx, x, y, fontSize, options) { - this.getPath(x, y, fontSize, options).draw(ctx); - }; - /** - * Draw the points of the glyph. - * On-curve points will be drawn in blue, off-curve points will be drawn in red. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - */ - Glyph.prototype.drawPoints = function (ctx, x, y, fontSize) { - function drawCircles(l, x, y, scale) { - var PI_SQ = Math.PI * 2; - ctx.beginPath(); - for (var j = 0; j < l.length; j += 1) { - ctx.moveTo(x + l[j].x * scale, y + l[j].y * scale); - ctx.arc( - x + l[j].x * scale, - y + l[j].y * scale, - 2, - 0, - PI_SQ, - false, - ); - } - ctx.closePath(); - ctx.fill(); - } - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 24; - var scale = (1 / this.path.unitsPerEm) * fontSize; - var blueCircles = []; - var redCircles = []; - var path = this.path; - for (var i = 0; i < path.commands.length; i += 1) { - var cmd = path.commands[i]; - if (cmd.x !== undefined) { - blueCircles.push({ - x: cmd.x, - y: -cmd.y, - }); - } - if (cmd.x1 !== undefined) { - redCircles.push({ - x: cmd.x1, - y: -cmd.y1, - }); - } - if (cmd.x2 !== undefined) { - redCircles.push({ - x: cmd.x2, - y: -cmd.y2, - }); - } - } - ctx.fillStyle = "blue"; - drawCircles(blueCircles, x, y, scale); - ctx.fillStyle = "red"; - drawCircles(redCircles, x, y, scale); - }; - /** - * Draw lines indicating important font measurements. - * Black lines indicate the origin of the coordinate system (point 0,0). - * Blue lines indicate the glyph bounding box. - * Green line indicates the advance width of the glyph. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - */ - Glyph.prototype.drawMetrics = function (ctx, x, y, fontSize) { - var scale; - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 24; - scale = (1 / this.path.unitsPerEm) * fontSize; - ctx.lineWidth = 1; - // Draw the origin - ctx.strokeStyle = "black"; - draw.line(ctx, x, -10000, x, 10000); - draw.line(ctx, -10000, y, 10000, y); - // This code is here due to memory optimization: by not using - // defaults in the constructor, we save a notable amount of memory. - var xMin = this.xMin || 0; - var yMin = this.yMin || 0; - var xMax = this.xMax || 0; - var yMax = this.yMax || 0; - var advanceWidth = this.advanceWidth || 0; - // Draw the glyph box - ctx.strokeStyle = "blue"; - draw.line( - ctx, - x + xMin * scale, - -10000, - x + xMin * scale, - 10000, - ); - draw.line( - ctx, - x + xMax * scale, - -10000, - x + xMax * scale, - 10000, - ); - draw.line( - ctx, - -10000, - y + -yMin * scale, - 10000, - y + -yMin * scale, - ); - draw.line( - ctx, - -10000, - y + -yMax * scale, - 10000, - y + -yMax * scale, - ); - // Draw the advance width - ctx.strokeStyle = "green"; - draw.line( - ctx, - x + advanceWidth * scale, - -10000, - x + advanceWidth * scale, - 10000, - ); - }; - // The GlyphSet object - // Define a property on the glyph that depends on the path being loaded. - function defineDependentProperty( - glyph, - externalName, - internalName, - ) { - Object.defineProperty(glyph, externalName, { - get: function () { - // Request the path property to make sure the path is loaded. - glyph.path; // jshint ignore:line - return glyph[internalName]; - }, - set: function (newValue) { - glyph[internalName] = newValue; - }, - enumerable: true, - configurable: true, - }); - } /** - * A GlyphSet represents all glyphs available in the font, but modelled using - * a deferred glyph loader, for retrieving glyphs only once they are absolutely - * necessary, to keep the memory footprint down. - * @exports opentype.GlyphSet - * @class - * @param {opentype.Font} - * @param {Array} - */ - - function GlyphSet(font, glyphs) { - var this$1 = this; - this.font = font; - this.glyphs = {}; - if (Array.isArray(glyphs)) { - for (var i = 0; i < glyphs.length; i++) { - this$1.glyphs[i] = glyphs[i]; - } - } - this.length = (glyphs && glyphs.length) || 0; - } /** - * @param {number} index - * @return {opentype.Glyph} - */ - - GlyphSet.prototype.get = function (index) { - if (typeof this.glyphs[index] === "function") { - this.glyphs[index] = this.glyphs[index](); - } - return this.glyphs[index]; - }; - /** - * @param {number} index - * @param {Object} - */ - GlyphSet.prototype.push = function (index, loader) { - this.glyphs[index] = loader; - this.length++; - }; - /** - * @alias opentype.glyphLoader - * @param {opentype.Font} font - * @param {number} index - * @return {opentype.Glyph} - */ - function glyphLoader(font, index) { - return new Glyph({ - index: index, - font: font, - }); - } /** - * Generate a stub glyph that can be filled with all metadata *except* - * the "points" and "path" properties, which must be loaded only once - * the glyph's path is actually requested for text shaping. - * @alias opentype.ttfGlyphLoader - * @param {opentype.Font} font - * @param {number} index - * @param {Function} parseGlyph - * @param {Object} data - * @param {number} position - * @param {Function} buildPath - * @return {opentype.Glyph} - */ - - function ttfGlyphLoader( - font, - index, - parseGlyph, - data, - position, - buildPath, - ) { - return function () { - var glyph = new Glyph({ - index: index, - font: font, - }); - glyph.path = function () { - parseGlyph(glyph, data, position); - var path = buildPath(font.glyphs, glyph); - path.unitsPerEm = font.unitsPerEm; - return path; - }; - defineDependentProperty(glyph, "xMin", "_xMin"); - defineDependentProperty(glyph, "xMax", "_xMax"); - defineDependentProperty(glyph, "yMin", "_yMin"); - defineDependentProperty(glyph, "yMax", "_yMax"); - return glyph; - }; - } /** - * @alias opentype.cffGlyphLoader - * @param {opentype.Font} font - * @param {number} index - * @param {Function} parseCFFCharstring - * @param {string} charstring - * @return {opentype.Glyph} - */ - - function cffGlyphLoader( - font, - index, - parseCFFCharstring, - charstring, - ) { - return function () { - var glyph = new Glyph({ - index: index, - font: font, - }); - glyph.path = function () { - var path = parseCFFCharstring(font, glyph, charstring); - path.unitsPerEm = font.unitsPerEm; - return path; - }; - return glyph; - }; - } - var glyphset = { - GlyphSet: GlyphSet, - glyphLoader: glyphLoader, - ttfGlyphLoader: ttfGlyphLoader, - cffGlyphLoader: cffGlyphLoader, - }; - // The `CFF` table contains the glyph outlines in PostScript format. - // Custom equals function that can also check lists. - function equals(a, b) { - if (a === b) { - return true; - } else if (Array.isArray(a) && Array.isArray(b)) { - if (a.length !== b.length) { - return false; - } - for (var i = 0; i < a.length; i += 1) { - if (!equals(a[i], b[i])) { - return false; - } - } - return true; - } else { - return false; - } - } // Subroutines are encoded using the negative half of the number space. - // See type 2 chapter 4.7 "Subroutine operators". - - function calcCFFSubroutineBias(subrs) { - var bias; - if (subrs.length < 1240) { - bias = 107; - } else if (subrs.length < 33900) { - bias = 1131; - } else { - bias = 32768; - } - return bias; - } // Parse a `CFF` INDEX array. - // An index array consists of a list of offsets, then a list of objects at those offsets. - - function parseCFFIndex(data, start, conversionFn) { - var offsets = []; - var objects = []; - var count = parse.getCard16(data, start); - var objectOffset; - var endOffset; - if (count !== 0) { - var offsetSize = parse.getByte(data, start + 2); - objectOffset = start + (count + 1) * offsetSize + 2; - var pos = start + 3; - for (var i = 0; i < count + 1; i += 1) { - offsets.push(parse.getOffset(data, pos, offsetSize)); - pos += offsetSize; - } // The total size of the index array is 4 header bytes + the value of the last offset. - - endOffset = objectOffset + offsets[count]; - } else { - endOffset = start + 2; - } - for (var i$1 = 0; i$1 < offsets.length - 1; i$1 += 1) { - var value = parse.getBytes( - data, - objectOffset + offsets[i$1], - objectOffset + offsets[i$1 + 1], - ); - if (conversionFn) { - value = conversionFn(value); - } - objects.push(value); - } - return { - objects: objects, - startOffset: start, - endOffset: endOffset, - }; - } // Parse a `CFF` DICT real value. - - function parseFloatOperand(parser) { - var s = ""; - var eof = 15; - var lookup = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - ".", - "E", - "E-", - null, - "-", - ]; - while (true) { - var b = parser.parseByte(); - var n1 = b >> 4; - var n2 = b & 15; - if (n1 === eof) { - break; - } - s += lookup[n1]; - if (n2 === eof) { - break; - } - s += lookup[n2]; - } - return parseFloat(s); - } // Parse a `CFF` DICT operand. - - function parseOperand(parser, b0) { - var b1; - var b2; - var b3; - var b4; - if (b0 === 28) { - b1 = parser.parseByte(); - b2 = parser.parseByte(); - return (b1 << 8) | b2; - } - if (b0 === 29) { - b1 = parser.parseByte(); - b2 = parser.parseByte(); - b3 = parser.parseByte(); - b4 = parser.parseByte(); - return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4; - } - if (b0 === 30) { - return parseFloatOperand(parser); - } - if (b0 >= 32 && b0 <= 246) { - return b0 - 139; - } - if (b0 >= 247 && b0 <= 250) { - b1 = parser.parseByte(); - return (b0 - 247) * 256 + b1 + 108; - } - if (b0 >= 251 && b0 <= 254) { - b1 = parser.parseByte(); - return -(b0 - 251) * 256 - b1 - 108; - } - throw new Error("Invalid b0 " + b0); - } // Convert the entries returned by `parseDict` to a proper dictionary. - // If a value is a list of one, it is unpacked. - - function entriesToObject(entries) { - var o = {}; - for (var i = 0; i < entries.length; i += 1) { - var key = entries[i][0]; - var values = entries[i][1]; - var value = void 0; - if (values.length === 1) { - value = values[0]; - } else { - value = values; - } - if (o.hasOwnProperty(key) && !isNaN(o[key])) { - throw new Error("Object " + o + " already has key " + key); - } - o[key] = value; - } - return o; - } // Parse a `CFF` DICT object. - // A dictionary contains key-value pairs in a compact tokenized format. - - function parseCFFDict(data, start, size) { - start = start !== undefined ? start : 0; - var parser = new parse.Parser(data, start); - var entries = []; - var operands = []; - size = size !== undefined ? size : data.length; - while (parser.relativeOffset < size) { - var op = parser.parseByte(); - // The first byte for each dict item distinguishes between operator (key) and operand (value). - // Values <= 21 are operators. - if (op <= 21) { - // Two-byte operators have an initial escape byte of 12. - if (op === 12) { - op = 1200 + parser.parseByte(); - } - entries.push([op, operands]); - operands = []; - } else { - // Since the operands (values) come before the operators (keys), we store all operands in a list - // until we encounter an operator. - operands.push(parseOperand(parser, op)); - } - } - return entriesToObject(entries); - } // Given a String Index (SID), return the value of the string. - // Strings below index 392 are standard CFF strings and are not encoded in the font. - - function getCFFString(strings, index) { - if (index <= 390) { - index = cffStandardStrings[index]; - } else { - index = strings[index - 391]; - } - return index; - } // Interpret a dictionary and return a new dictionary with readable keys and values for missing entries. - // This function takes `meta` which is a list of objects containing `operand`, `name` and `default`. - - function interpretDict(dict, meta, strings) { - var newDict = {}; - var value; - // Because we also want to include missing values, we start out from the meta list - // and lookup values in the dict. - for (var i = 0; i < meta.length; i += 1) { - var m = meta[i]; - if (Array.isArray(m.type)) { - var values = []; - values.length = m.type.length; - for (var j = 0; j < m.type.length; j++) { - value = - dict[m.op] !== undefined ? dict[m.op][j] : undefined; - if (value === undefined) { - value = - m.value !== undefined && m.value[j] !== undefined - ? m.value[j] - : null; - } - if (m.type[j] === "SID") { - value = getCFFString(strings, value); - } - values[j] = value; - } - newDict[m.name] = values; - } else { - value = dict[m.op]; - if (value === undefined) { - value = m.value !== undefined ? m.value : null; - } - if (m.type === "SID") { - value = getCFFString(strings, value); - } - newDict[m.name] = value; - } - } - return newDict; - } // Parse the CFF header. - - function parseCFFHeader(data, start) { - var header = {}; - header.formatMajor = parse.getCard8(data, start); - header.formatMinor = parse.getCard8(data, start + 1); - header.size = parse.getCard8(data, start + 2); - header.offsetSize = parse.getCard8(data, start + 3); - header.startOffset = start; - header.endOffset = start + 4; - return header; - } - var TOP_DICT_META = [ - { - name: "version", - op: 0, - type: "SID", - }, - { - name: "notice", - op: 1, - type: "SID", - }, - { - name: "copyright", - op: 1200, - type: "SID", - }, - { - name: "fullName", - op: 2, - type: "SID", - }, - { - name: "familyName", - op: 3, - type: "SID", - }, - { - name: "weight", - op: 4, - type: "SID", - }, - { - name: "isFixedPitch", - op: 1201, - type: "number", - value: 0, - }, - { - name: "italicAngle", - op: 1202, - type: "number", - value: 0, - }, - { - name: "underlinePosition", - op: 1203, - type: "number", - value: -100, - }, - { - name: "underlineThickness", - op: 1204, - type: "number", - value: 50, - }, - { - name: "paintType", - op: 1205, - type: "number", - value: 0, - }, - { - name: "charstringType", - op: 1206, - type: "number", - value: 2, - }, - { - name: "fontMatrix", - op: 1207, - type: ["real", "real", "real", "real", "real", "real"], - value: [0.001, 0, 0, 0.001, 0, 0], - }, - { - name: "uniqueId", - op: 13, - type: "number", - }, - { - name: "fontBBox", - op: 5, - type: ["number", "number", "number", "number"], - value: [0, 0, 0, 0], - }, - { - name: "strokeWidth", - op: 1208, - type: "number", - value: 0, - }, - { - name: "xuid", - op: 14, - type: [], - value: null, - }, - { - name: "charset", - op: 15, - type: "offset", - value: 0, - }, - { - name: "encoding", - op: 16, - type: "offset", - value: 0, - }, - { - name: "charStrings", - op: 17, - type: "offset", - value: 0, - }, - { - name: "private", - op: 18, - type: ["number", "offset"], - value: [0, 0], - }, - { - name: "ros", - op: 1230, - type: ["SID", "SID", "number"], - }, - { - name: "cidFontVersion", - op: 1231, - type: "number", - value: 0, - }, - { - name: "cidFontRevision", - op: 1232, - type: "number", - value: 0, - }, - { - name: "cidFontType", - op: 1233, - type: "number", - value: 0, - }, - { - name: "cidCount", - op: 1234, - type: "number", - value: 8720, - }, - { - name: "uidBase", - op: 1235, - type: "number", - }, - { - name: "fdArray", - op: 1236, - type: "offset", - }, - { - name: "fdSelect", - op: 1237, - type: "offset", - }, - { - name: "fontName", - op: 1238, - type: "SID", - }, - ]; - var PRIVATE_DICT_META = [ - { - name: "subrs", - op: 19, - type: "offset", - value: 0, - }, - { - name: "defaultWidthX", - op: 20, - type: "number", - value: 0, - }, - { - name: "nominalWidthX", - op: 21, - type: "number", - value: 0, - }, - ]; - // Parse the CFF top dictionary. A CFF table can contain multiple fonts, each with their own top dictionary. - // The top dictionary contains the essential metadata for the font, together with the private dictionary. - function parseCFFTopDict(data, strings) { - var dict = parseCFFDict(data, 0, data.byteLength); - return interpretDict(dict, TOP_DICT_META, strings); - } // Parse the CFF private dictionary. We don't fully parse out all the values, only the ones we need. - - function parseCFFPrivateDict(data, start, size, strings) { - var dict = parseCFFDict(data, start, size); - return interpretDict(dict, PRIVATE_DICT_META, strings); - } // Returns a list of "Top DICT"s found using an INDEX list. - // Used to read both the usual high-level Top DICTs and also the FDArray - // discovered inside CID-keyed fonts. When a Top DICT has a reference to - // a Private DICT that is read and saved into the Top DICT. - // - // In addition to the expected/optional values as outlined in TOP_DICT_META - // the following values might be saved into the Top DICT. - // - // _subrs [] array of local CFF subroutines from Private DICT - // _subrsBias bias value computed from number of subroutines - // (see calcCFFSubroutineBias() and parseCFFCharstring()) - // _defaultWidthX default widths for CFF characters - // _nominalWidthX bias added to width embedded within glyph description - // - // _privateDict saved copy of parsed Private DICT from Top DICT - - function gatherCFFTopDicts(data, start, cffIndex, strings) { - var topDictArray = []; - for ( - var iTopDict = 0; - iTopDict < cffIndex.length; - iTopDict += 1 - ) { - var topDictData = new DataView( - new Uint8Array(cffIndex[iTopDict]).buffer, - ); - var topDict = parseCFFTopDict(topDictData, strings); - topDict._subrs = []; - topDict._subrsBias = 0; - var privateSize = topDict.private[0]; - var privateOffset = topDict.private[1]; - if (privateSize !== 0 && privateOffset !== 0) { - var privateDict = parseCFFPrivateDict( - data, - privateOffset + start, - privateSize, - strings, - ); - topDict._defaultWidthX = privateDict.defaultWidthX; - topDict._nominalWidthX = privateDict.nominalWidthX; - if (privateDict.subrs !== 0) { - var subrOffset = privateOffset + privateDict.subrs; - var subrIndex = parseCFFIndex(data, subrOffset + start); - topDict._subrs = subrIndex.objects; - topDict._subrsBias = calcCFFSubroutineBias( - topDict._subrs, - ); - } - topDict._privateDict = privateDict; - } - topDictArray.push(topDict); - } - return topDictArray; - } // Parse the CFF charset table, which contains internal names for all the glyphs. - // This function will return a list of glyph names. - // See Adobe TN #5176 chapter 13, "Charsets". - - function parseCFFCharset(data, start, nGlyphs, strings) { - var sid; - var count; - var parser = new parse.Parser(data, start); - // The .notdef glyph is not included, so subtract 1. - nGlyphs -= 1; - var charset = [".notdef"]; - var format = parser.parseCard8(); - if (format === 0) { - for (var i = 0; i < nGlyphs; i += 1) { - sid = parser.parseSID(); - charset.push(getCFFString(strings, sid)); - } - } else if (format === 1) { - while (charset.length <= nGlyphs) { - sid = parser.parseSID(); - count = parser.parseCard8(); - for (var i$1 = 0; i$1 <= count; i$1 += 1) { - charset.push(getCFFString(strings, sid)); - sid += 1; - } - } - } else if (format === 2) { - while (charset.length <= nGlyphs) { - sid = parser.parseSID(); - count = parser.parseCard16(); - for (var i$2 = 0; i$2 <= count; i$2 += 1) { - charset.push(getCFFString(strings, sid)); - sid += 1; - } - } - } else { - throw new Error("Unknown charset format " + format); - } - return charset; - } // Parse the CFF encoding data. Only one encoding can be specified per font. - // See Adobe TN #5176 chapter 12, "Encodings". - - function parseCFFEncoding(data, start, charset) { - var code; - var enc = {}; - var parser = new parse.Parser(data, start); - var format = parser.parseCard8(); - if (format === 0) { - var nCodes = parser.parseCard8(); - for (var i = 0; i < nCodes; i += 1) { - code = parser.parseCard8(); - enc[code] = i; - } - } else if (format === 1) { - var nRanges = parser.parseCard8(); - code = 1; - for (var i$1 = 0; i$1 < nRanges; i$1 += 1) { - var first = parser.parseCard8(); - var nLeft = parser.parseCard8(); - for (var j = first; j <= first + nLeft; j += 1) { - enc[j] = code; - code += 1; - } - } - } else { - throw new Error("Unknown encoding format " + format); - } - return new CffEncoding(enc, charset); - } // Take in charstring code and return a Glyph object. - // The encoding is described in the Type 2 Charstring Format - // https://www.microsoft.com/typography/OTSPEC/charstr2.htm - - function parseCFFCharstring(font, glyph, code) { - var c1x; - var c1y; - var c2x; - var c2y; - var p = new Path(); - var stack = []; - var nStems = 0; - var haveWidth = false; - var open = false; - var x = 0; - var y = 0; - var subrs; - var subrsBias; - var defaultWidthX; - var nominalWidthX; - if (font.isCIDFont) { - var fdIndex = font.tables.cff.topDict._fdSelect[glyph.index]; - var fdDict = font.tables.cff.topDict._fdArray[fdIndex]; - subrs = fdDict._subrs; - subrsBias = fdDict._subrsBias; - defaultWidthX = fdDict._defaultWidthX; - nominalWidthX = fdDict._nominalWidthX; - } else { - subrs = font.tables.cff.topDict._subrs; - subrsBias = font.tables.cff.topDict._subrsBias; - defaultWidthX = font.tables.cff.topDict._defaultWidthX; - nominalWidthX = font.tables.cff.topDict._nominalWidthX; - } - var width = defaultWidthX; - function newContour(x, y) { - if (open) { - p.closePath(); - } - p.moveTo(x, y); - open = true; - } - function parseStems() { - var hasWidthArg; - // The number of stem operators on the stack is always even. - // If the value is uneven, that means a width is specified. - hasWidthArg = stack.length % 2 !== 0; - if (hasWidthArg && !haveWidth) { - width = stack.shift() + nominalWidthX; - } - nStems += stack.length >> 1; - stack.length = 0; - haveWidth = true; - } - function parse$$1(code) { - var b1; - var b2; - var b3; - var b4; - var codeIndex; - var subrCode; - var jpx; - var jpy; - var c3x; - var c3y; - var c4x; - var c4y; - var i = 0; - while (i < code.length) { - var v = code[i]; - i += 1; - switch (v) { - case 1: - // hstem - parseStems(); - break; - case 3: - // vstem - parseStems(); - break; - case 4: - // vmoveto - if (stack.length > 1 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - y += stack.pop(); - newContour(x, y); - break; - case 5: - // rlineto - while (stack.length > 0) { - x += stack.shift(); - y += stack.shift(); - p.lineTo(x, y); - } - break; - case 6: - // hlineto - while (stack.length > 0) { - x += stack.shift(); - p.lineTo(x, y); - if (stack.length === 0) { - break; - } - y += stack.shift(); - p.lineTo(x, y); - } - break; - case 7: - // vlineto - while (stack.length > 0) { - y += stack.shift(); - p.lineTo(x, y); - if (stack.length === 0) { - break; - } - x += stack.shift(); - p.lineTo(x, y); - } - break; - case 8: - // rrcurveto - while (stack.length > 0) { - c1x = x + stack.shift(); - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 10: - // callsubr - codeIndex = stack.pop() + subrsBias; - subrCode = subrs[codeIndex]; - if (subrCode) { - parse$$1(subrCode); - } - break; - case 11: - // return - return; - case 12: - // flex operators - v = code[i]; - i += 1; - switch (v) { - case 35: - // flex - // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |- - c1x = x + stack.shift(); // dx1 - c1y = y + stack.shift(); // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y + stack.shift(); // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = jpy + stack.shift(); // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = c3y + stack.shift(); // dy5 - x = c4x + stack.shift(); // dx6 - y = c4y + stack.shift(); // dy6 - stack.shift(); // flex depth - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - case 34: - // hflex - // |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |- - c1x = x + stack.shift(); // dx1 - c1y = y; // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y; // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = c2y; // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = y; // dy5 - x = c4x + stack.shift(); // dx6 - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - case 36: - // hflex1 - // |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |- - c1x = x + stack.shift(); // dx1 - c1y = y + stack.shift(); // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y; // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = c2y; // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = c3y + stack.shift(); // dy5 - x = c4x + stack.shift(); // dx6 - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - case 37: - // flex1 - // |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |- - c1x = x + stack.shift(); // dx1 - c1y = y + stack.shift(); // dy1 - c2x = c1x + stack.shift(); // dx2 - c2y = c1y + stack.shift(); // dy2 - jpx = c2x + stack.shift(); // dx3 - jpy = c2y + stack.shift(); // dy3 - c3x = jpx + stack.shift(); // dx4 - c3y = jpy + stack.shift(); // dy4 - c4x = c3x + stack.shift(); // dx5 - c4y = c3y + stack.shift(); // dy5 - if (Math.abs(c4x - x) > Math.abs(c4y - y)) { - x = c4x + stack.shift(); - } else { - y = c4y + stack.shift(); - } - p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy); - p.curveTo(c3x, c3y, c4x, c4y, x, y); - break; - default: - console.log( - "Glyph " + - glyph.index + - ": unknown operator " + - 1200 + - v, - ); - stack.length = 0; - } - break; - case 14: - // endchar - if (stack.length > 0 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - if (open) { - p.closePath(); - open = false; - } - break; - case 18: - // hstemhm - parseStems(); - break; - case 19: // hintmask - case 20: - // cntrmask - parseStems(); - i += (nStems + 7) >> 3; - break; - case 21: - // rmoveto - if (stack.length > 2 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - y += stack.pop(); - x += stack.pop(); - newContour(x, y); - break; - case 22: - // hmoveto - if (stack.length > 1 && !haveWidth) { - width = stack.shift() + nominalWidthX; - haveWidth = true; - } - x += stack.pop(); - newContour(x, y); - break; - case 23: - // vstemhm - parseStems(); - break; - case 24: - // rcurveline - while (stack.length > 2) { - c1x = x + stack.shift(); - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - x += stack.shift(); - y += stack.shift(); - p.lineTo(x, y); - break; - case 25: - // rlinecurve - while (stack.length > 6) { - x += stack.shift(); - y += stack.shift(); - p.lineTo(x, y); - } - c1x = x + stack.shift(); - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - break; - case 26: - // vvcurveto - if (stack.length % 2) { - x += stack.shift(); - } - while (stack.length > 0) { - c1x = x; - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x; - y = c2y + stack.shift(); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 27: - // hhcurveto - if (stack.length % 2) { - y += stack.shift(); - } - while (stack.length > 0) { - c1x = x + stack.shift(); - c1y = y; - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y; - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 28: - // shortint - b1 = code[i]; - b2 = code[i + 1]; - stack.push(((b1 << 24) | (b2 << 16)) >> 16); - i += 2; - break; - case 29: - // callgsubr - codeIndex = stack.pop() + font.gsubrsBias; - subrCode = font.gsubrs[codeIndex]; - if (subrCode) { - parse$$1(subrCode); - } - break; - case 30: - // vhcurveto - while (stack.length > 0) { - c1x = x; - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - if (stack.length === 0) { - break; - } - c1x = x + stack.shift(); - c1y = y; - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - y = c2y + stack.shift(); - x = c2x + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - case 31: - // hvcurveto - while (stack.length > 0) { - c1x = x + stack.shift(); - c1y = y; - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - y = c2y + stack.shift(); - x = c2x + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - if (stack.length === 0) { - break; - } - c1x = x; - c1y = y + stack.shift(); - c2x = c1x + stack.shift(); - c2y = c1y + stack.shift(); - x = c2x + stack.shift(); - y = c2y + (stack.length === 1 ? stack.shift() : 0); - p.curveTo(c1x, c1y, c2x, c2y, x, y); - } - break; - default: - if (v < 32) { - console.log( - "Glyph " + glyph.index + ": unknown operator " + v, - ); - } else if (v < 247) { - stack.push(v - 139); - } else if (v < 251) { - b1 = code[i]; - i += 1; - stack.push((v - 247) * 256 + b1 + 108); - } else if (v < 255) { - b1 = code[i]; - i += 1; - stack.push(-(v - 251) * 256 - b1 - 108); - } else { - b1 = code[i]; - b2 = code[i + 1]; - b3 = code[i + 2]; - b4 = code[i + 3]; - i += 4; - stack.push( - ((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536, - ); - } - } - } - } - parse$$1(code); - glyph.advanceWidth = width; - return p; - } - function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) { - var fdSelect = []; - var fdIndex; - var parser = new parse.Parser(data, start); - var format = parser.parseCard8(); - if (format === 0) { - // Simple list of nGlyphs elements - for (var iGid = 0; iGid < nGlyphs; iGid++) { - fdIndex = parser.parseCard8(); - if (fdIndex >= fdArrayCount) { - throw new Error( - "CFF table CID Font FDSelect has bad FD index value " + - fdIndex + - " (FD count " + - fdArrayCount + - ")", - ); - } - fdSelect.push(fdIndex); - } - } else if (format === 3) { - // Ranges - var nRanges = parser.parseCard16(); - var first = parser.parseCard16(); - if (first !== 0) { - throw new Error( - "CFF Table CID Font FDSelect format 3 range has bad initial GID " + - first, - ); - } - var next; - for (var iRange = 0; iRange < nRanges; iRange++) { - fdIndex = parser.parseCard8(); - next = parser.parseCard16(); - if (fdIndex >= fdArrayCount) { - throw new Error( - "CFF table CID Font FDSelect has bad FD index value " + - fdIndex + - " (FD count " + - fdArrayCount + - ")", - ); - } - if (next > nGlyphs) { - throw new Error( - "CFF Table CID Font FDSelect format 3 range has bad GID " + - next, - ); - } - for (; first < next; first++) { - fdSelect.push(fdIndex); - } - first = next; - } - if (next !== nGlyphs) { - throw new Error( - "CFF Table CID Font FDSelect format 3 range has bad final GID " + - next, - ); - } - } else { - throw new Error( - "CFF Table CID Font FDSelect table has unsupported format " + - format, - ); - } - return fdSelect; - } // Parse the `CFF` table, which contains the glyph outlines in PostScript format. - - function parseCFFTable(data, start, font) { - font.tables.cff = {}; - var header = parseCFFHeader(data, start); - var nameIndex = parseCFFIndex( - data, - header.endOffset, - parse.bytesToString, - ); - var topDictIndex = parseCFFIndex(data, nameIndex.endOffset); - var stringIndex = parseCFFIndex( - data, - topDictIndex.endOffset, - parse.bytesToString, - ); - var globalSubrIndex = parseCFFIndex( - data, - stringIndex.endOffset, - ); - font.gsubrs = globalSubrIndex.objects; - font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs); - var topDictArray = gatherCFFTopDicts( - data, - start, - topDictIndex.objects, - stringIndex.objects, - ); - if (topDictArray.length !== 1) { - throw new Error( - "CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + - topDictArray.length, - ); - } - var topDict = topDictArray[0]; - font.tables.cff.topDict = topDict; - if (topDict._privateDict) { - font.defaultWidthX = topDict._privateDict.defaultWidthX; - font.nominalWidthX = topDict._privateDict.nominalWidthX; - } - if ( - topDict.ros[0] !== undefined && - topDict.ros[1] !== undefined - ) { - font.isCIDFont = true; - } - if (font.isCIDFont) { - var fdArrayOffset = topDict.fdArray; - var fdSelectOffset = topDict.fdSelect; - if (fdArrayOffset === 0 || fdSelectOffset === 0) { - throw new Error( - "Font is marked as a CID font, but FDArray and/or FDSelect information is missing", - ); - } - fdArrayOffset += start; - var fdArrayIndex = parseCFFIndex(data, fdArrayOffset); - var fdArray = gatherCFFTopDicts( - data, - start, - fdArrayIndex.objects, - stringIndex.objects, - ); - topDict._fdArray = fdArray; - fdSelectOffset += start; - topDict._fdSelect = parseCFFFDSelect( - data, - fdSelectOffset, - font.numGlyphs, - fdArray.length, - ); - } - var privateDictOffset = start + topDict.private[1]; - var privateDict = parseCFFPrivateDict( - data, - privateDictOffset, - topDict.private[0], - stringIndex.objects, - ); - font.defaultWidthX = privateDict.defaultWidthX; - font.nominalWidthX = privateDict.nominalWidthX; - if (privateDict.subrs !== 0) { - var subrOffset = privateDictOffset + privateDict.subrs; - var subrIndex = parseCFFIndex(data, subrOffset); - font.subrs = subrIndex.objects; - font.subrsBias = calcCFFSubroutineBias(font.subrs); - } else { - font.subrs = []; - font.subrsBias = 0; - } // Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset. - - var charStringsIndex = parseCFFIndex( - data, - start + topDict.charStrings, - ); - font.nGlyphs = charStringsIndex.objects.length; - var charset = parseCFFCharset( - data, - start + topDict.charset, - font.nGlyphs, - stringIndex.objects, - ); - if (topDict.encoding === 0) { - // Standard encoding - font.cffEncoding = new CffEncoding( - cffStandardEncoding, - charset, - ); - } else if (topDict.encoding === 1) { - // Expert encoding - font.cffEncoding = new CffEncoding( - cffExpertEncoding, - charset, - ); - } else { - font.cffEncoding = parseCFFEncoding( - data, - start + topDict.encoding, - charset, - ); - } // Prefer the CMAP encoding to the CFF encoding. - - font.encoding = font.encoding || font.cffEncoding; - font.glyphs = new glyphset.GlyphSet(font); - for (var i = 0; i < font.nGlyphs; i += 1) { - var charString = charStringsIndex.objects[i]; - font.glyphs.push( - i, - glyphset.cffGlyphLoader( - font, - i, - parseCFFCharstring, - charString, - ), - ); - } - } // Convert a string to a String ID (SID). - // The list of strings is modified in place. - - function encodeString(s, strings) { - var sid; - // Is the string in the CFF standard strings? - var i = cffStandardStrings.indexOf(s); - if (i >= 0) { - sid = i; - } // Is the string already in the string index? - - i = strings.indexOf(s); - if (i >= 0) { - sid = i + cffStandardStrings.length; - } else { - sid = cffStandardStrings.length + strings.length; - strings.push(s); - } - return sid; - } - function makeHeader() { - return new table.Record("Header", [ - { - name: "major", - type: "Card8", - value: 1, - }, - { - name: "minor", - type: "Card8", - value: 0, - }, - { - name: "hdrSize", - type: "Card8", - value: 4, - }, - { - name: "major", - type: "Card8", - value: 1, - }, - ]); - } - function makeNameIndex(fontNames) { - var t = new table.Record("Name INDEX", [ - { - name: "names", - type: "INDEX", - value: [], - }, - ]); - t.names = []; - for (var i = 0; i < fontNames.length; i += 1) { - t.names.push({ - name: "name_" + i, - type: "NAME", - value: fontNames[i], - }); - } - return t; - } // Given a dictionary's metadata, create a DICT structure. - - function makeDict(meta, attrs, strings) { - var m = {}; - for (var i = 0; i < meta.length; i += 1) { - var entry = meta[i]; - var value = attrs[entry.name]; - if (value !== undefined && !equals(value, entry.value)) { - if (entry.type === "SID") { - value = encodeString(value, strings); - } - m[entry.op] = { - name: entry.name, - type: entry.type, - value: value, - }; - } - } - return m; - } // The Top DICT houses the global font attributes. - - function makeTopDict(attrs, strings) { - var t = new table.Record("Top DICT", [ - { - name: "dict", - type: "DICT", - value: {}, - }, - ]); - t.dict = makeDict(TOP_DICT_META, attrs, strings); - return t; - } - function makeTopDictIndex(topDict) { - var t = new table.Record("Top DICT INDEX", [ - { - name: "topDicts", - type: "INDEX", - value: [], - }, - ]); - t.topDicts = [ - { - name: "topDict_0", - type: "TABLE", - value: topDict, - }, - ]; - return t; - } - function makeStringIndex(strings) { - var t = new table.Record("String INDEX", [ - { - name: "strings", - type: "INDEX", - value: [], - }, - ]); - t.strings = []; - for (var i = 0; i < strings.length; i += 1) { - t.strings.push({ - name: "string_" + i, - type: "STRING", - value: strings[i], - }); - } - return t; - } - function makeGlobalSubrIndex() { - // Currently we don't use subroutines. - return new table.Record("Global Subr INDEX", [ - { - name: "subrs", - type: "INDEX", - value: [], - }, - ]); - } - function makeCharsets(glyphNames, strings) { - var t = new table.Record("Charsets", [ - { - name: "format", - type: "Card8", - value: 0, - }, - ]); - for (var i = 0; i < glyphNames.length; i += 1) { - var glyphName = glyphNames[i]; - var glyphSID = encodeString(glyphName, strings); - t.fields.push({ - name: "glyph_" + i, - type: "SID", - value: glyphSID, - }); - } - return t; - } - function glyphToOps(glyph) { - var ops = []; - var path = glyph.path; - ops.push({ - name: "width", - type: "NUMBER", - value: glyph.advanceWidth, - }); - var x = 0; - var y = 0; - for (var i = 0; i < path.commands.length; i += 1) { - var dx = void 0; - var dy = void 0; - var cmd = path.commands[i]; - if (cmd.type === "Q") { - // CFF only supports bézier curves, so convert the quad to a bézier. - var _13 = 1 / 3; - var _23 = 2 / 3; - // We're going to create a new command so we don't change the original path. - cmd = { - type: "C", - x: cmd.x, - y: cmd.y, - x1: _13 * x + _23 * cmd.x1, - y1: _13 * y + _23 * cmd.y1, - x2: _13 * cmd.x + _23 * cmd.x1, - y2: _13 * cmd.y + _23 * cmd.y1, - }; - } - if (cmd.type === "M") { - dx = Math.round(cmd.x - x); - dy = Math.round(cmd.y - y); - ops.push({ - name: "dx", - type: "NUMBER", - value: dx, - }); - ops.push({ - name: "dy", - type: "NUMBER", - value: dy, - }); - ops.push({ - name: "rmoveto", - type: "OP", - value: 21, - }); - x = Math.round(cmd.x); - y = Math.round(cmd.y); - } else if (cmd.type === "L") { - dx = Math.round(cmd.x - x); - dy = Math.round(cmd.y - y); - ops.push({ - name: "dx", - type: "NUMBER", - value: dx, - }); - ops.push({ - name: "dy", - type: "NUMBER", - value: dy, - }); - ops.push({ - name: "rlineto", - type: "OP", - value: 5, - }); - x = Math.round(cmd.x); - y = Math.round(cmd.y); - } else if (cmd.type === "C") { - var dx1 = Math.round(cmd.x1 - x); - var dy1 = Math.round(cmd.y1 - y); - var dx2 = Math.round(cmd.x2 - cmd.x1); - var dy2 = Math.round(cmd.y2 - cmd.y1); - dx = Math.round(cmd.x - cmd.x2); - dy = Math.round(cmd.y - cmd.y2); - ops.push({ - name: "dx1", - type: "NUMBER", - value: dx1, - }); - ops.push({ - name: "dy1", - type: "NUMBER", - value: dy1, - }); - ops.push({ - name: "dx2", - type: "NUMBER", - value: dx2, - }); - ops.push({ - name: "dy2", - type: "NUMBER", - value: dy2, - }); - ops.push({ - name: "dx", - type: "NUMBER", - value: dx, - }); - ops.push({ - name: "dy", - type: "NUMBER", - value: dy, - }); - ops.push({ - name: "rrcurveto", - type: "OP", - value: 8, - }); - x = Math.round(cmd.x); - y = Math.round(cmd.y); - } // Contours are closed automatically. - } - ops.push({ - name: "endchar", - type: "OP", - value: 14, - }); - return ops; - } - function makeCharStringsIndex(glyphs) { - var t = new table.Record("CharStrings INDEX", [ - { - name: "charStrings", - type: "INDEX", - value: [], - }, - ]); - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - var ops = glyphToOps(glyph); - t.charStrings.push({ - name: glyph.name, - type: "CHARSTRING", - value: ops, - }); - } - return t; - } - function makePrivateDict(attrs, strings) { - var t = new table.Record("Private DICT", [ - { - name: "dict", - type: "DICT", - value: {}, - }, - ]); - t.dict = makeDict(PRIVATE_DICT_META, attrs, strings); - return t; - } - function makeCFFTable(glyphs, options) { - var t = new table.Table("CFF ", [ - { - name: "header", - type: "RECORD", - }, - { - name: "nameIndex", - type: "RECORD", - }, - { - name: "topDictIndex", - type: "RECORD", - }, - { - name: "stringIndex", - type: "RECORD", - }, - { - name: "globalSubrIndex", - type: "RECORD", - }, - { - name: "charsets", - type: "RECORD", - }, - { - name: "charStringsIndex", - type: "RECORD", - }, - { - name: "privateDict", - type: "RECORD", - }, - ]); - var fontScale = 1 / options.unitsPerEm; - // We use non-zero values for the offsets so that the DICT encodes them. - // This is important because the size of the Top DICT plays a role in offset calculation, - // and the size shouldn't change after we've written correct offsets. - var attrs = { - version: options.version, - fullName: options.fullName, - familyName: options.familyName, - weight: options.weightName, - fontBBox: options.fontBBox || [0, 0, 0, 0], - fontMatrix: [fontScale, 0, 0, fontScale, 0, 0], - charset: 999, - encoding: 0, - charStrings: 999, - private: [0, 999], - }; - var privateAttrs = {}; - var glyphNames = []; - var glyph; - // Skip first glyph (.notdef) - for (var i = 1; i < glyphs.length; i += 1) { - glyph = glyphs.get(i); - glyphNames.push(glyph.name); - } - var strings = []; - t.header = makeHeader(); - t.nameIndex = makeNameIndex([options.postScriptName]); - var topDict = makeTopDict(attrs, strings); - t.topDictIndex = makeTopDictIndex(topDict); - t.globalSubrIndex = makeGlobalSubrIndex(); - t.charsets = makeCharsets(glyphNames, strings); - t.charStringsIndex = makeCharStringsIndex(glyphs); - t.privateDict = makePrivateDict(privateAttrs, strings); - // Needs to come at the end, to encode all custom strings used in the font. - t.stringIndex = makeStringIndex(strings); - var startOffset = - t.header.sizeOf() + - t.nameIndex.sizeOf() + - t.topDictIndex.sizeOf() + - t.stringIndex.sizeOf() + - t.globalSubrIndex.sizeOf(); - attrs.charset = startOffset; - // We use the CFF standard encoding; proper encoding will be handled in cmap. - attrs.encoding = 0; - attrs.charStrings = attrs.charset + t.charsets.sizeOf(); - attrs.private[1] = - attrs.charStrings + t.charStringsIndex.sizeOf(); - // Recreate the Top DICT INDEX with the correct offsets. - topDict = makeTopDict(attrs, strings); - t.topDictIndex = makeTopDictIndex(topDict); - return t; - } - var cff = { - parse: parseCFFTable, - make: makeCFFTable, - }; - // The `head` table contains global information about the font. - // Parse the header `head` table - function parseHeadTable(data, start) { - var head = {}; - var p = new parse.Parser(data, start); - head.version = p.parseVersion(); - head.fontRevision = Math.round(p.parseFixed() * 1000) / 1000; - head.checkSumAdjustment = p.parseULong(); - head.magicNumber = p.parseULong(); - check.argument( - head.magicNumber === 1594834165, - "Font header has wrong magic number.", - ); - head.flags = p.parseUShort(); - head.unitsPerEm = p.parseUShort(); - head.created = p.parseLongDateTime(); - head.modified = p.parseLongDateTime(); - head.xMin = p.parseShort(); - head.yMin = p.parseShort(); - head.xMax = p.parseShort(); - head.yMax = p.parseShort(); - head.macStyle = p.parseUShort(); - head.lowestRecPPEM = p.parseUShort(); - head.fontDirectionHint = p.parseShort(); - head.indexToLocFormat = p.parseShort(); - head.glyphDataFormat = p.parseShort(); - return head; - } - function makeHeadTable(options) { - // Apple Mac timestamp epoch is 01/01/1904 not 01/01/1970 - var timestamp = - Math.round(new Date().getTime() / 1000) + 2082844800; - var createdTimestamp = timestamp; - if (options.createdTimestamp) { - createdTimestamp = options.createdTimestamp + 2082844800; - } - return new table.Table( - "head", - [ - { - name: "version", - type: "FIXED", - value: 65536, - }, - { - name: "fontRevision", - type: "FIXED", - value: 65536, - }, - { - name: "checkSumAdjustment", - type: "ULONG", - value: 0, - }, - { - name: "magicNumber", - type: "ULONG", - value: 1594834165, - }, - { - name: "flags", - type: "USHORT", - value: 0, - }, - { - name: "unitsPerEm", - type: "USHORT", - value: 1000, - }, - { - name: "created", - type: "LONGDATETIME", - value: createdTimestamp, - }, - { - name: "modified", - type: "LONGDATETIME", - value: timestamp, - }, - { - name: "xMin", - type: "SHORT", - value: 0, - }, - { - name: "yMin", - type: "SHORT", - value: 0, - }, - { - name: "xMax", - type: "SHORT", - value: 0, - }, - { - name: "yMax", - type: "SHORT", - value: 0, - }, - { - name: "macStyle", - type: "USHORT", - value: 0, - }, - { - name: "lowestRecPPEM", - type: "USHORT", - value: 0, - }, - { - name: "fontDirectionHint", - type: "SHORT", - value: 2, - }, - { - name: "indexToLocFormat", - type: "SHORT", - value: 0, - }, - { - name: "glyphDataFormat", - type: "SHORT", - value: 0, - }, - ], - options, - ); - } - var head = { - parse: parseHeadTable, - make: makeHeadTable, - }; - // The `hhea` table contains information for horizontal layout. - // Parse the horizontal header `hhea` table - function parseHheaTable(data, start) { - var hhea = {}; - var p = new parse.Parser(data, start); - hhea.version = p.parseVersion(); - hhea.ascender = p.parseShort(); - hhea.descender = p.parseShort(); - hhea.lineGap = p.parseShort(); - hhea.advanceWidthMax = p.parseUShort(); - hhea.minLeftSideBearing = p.parseShort(); - hhea.minRightSideBearing = p.parseShort(); - hhea.xMaxExtent = p.parseShort(); - hhea.caretSlopeRise = p.parseShort(); - hhea.caretSlopeRun = p.parseShort(); - hhea.caretOffset = p.parseShort(); - p.relativeOffset += 8; - hhea.metricDataFormat = p.parseShort(); - hhea.numberOfHMetrics = p.parseUShort(); - return hhea; - } - function makeHheaTable(options) { - return new table.Table( - "hhea", - [ - { - name: "version", - type: "FIXED", - value: 65536, - }, - { - name: "ascender", - type: "FWORD", - value: 0, - }, - { - name: "descender", - type: "FWORD", - value: 0, - }, - { - name: "lineGap", - type: "FWORD", - value: 0, - }, - { - name: "advanceWidthMax", - type: "UFWORD", - value: 0, - }, - { - name: "minLeftSideBearing", - type: "FWORD", - value: 0, - }, - { - name: "minRightSideBearing", - type: "FWORD", - value: 0, - }, - { - name: "xMaxExtent", - type: "FWORD", - value: 0, - }, - { - name: "caretSlopeRise", - type: "SHORT", - value: 1, - }, - { - name: "caretSlopeRun", - type: "SHORT", - value: 0, - }, - { - name: "caretOffset", - type: "SHORT", - value: 0, - }, - { - name: "reserved1", - type: "SHORT", - value: 0, - }, - { - name: "reserved2", - type: "SHORT", - value: 0, - }, - { - name: "reserved3", - type: "SHORT", - value: 0, - }, - { - name: "reserved4", - type: "SHORT", - value: 0, - }, - { - name: "metricDataFormat", - type: "SHORT", - value: 0, - }, - { - name: "numberOfHMetrics", - type: "USHORT", - value: 0, - }, - ], - options, - ); - } - var hhea = { - parse: parseHheaTable, - make: makeHheaTable, - }; - // The `hmtx` table contains the horizontal metrics for all glyphs. - // Parse the `hmtx` table, which contains the horizontal metrics for all glyphs. - // This function augments the glyph array, adding the advanceWidth and leftSideBearing to each glyph. - function parseHmtxTable( - data, - start, - numMetrics, - numGlyphs, - glyphs, - ) { - var advanceWidth; - var leftSideBearing; - var p = new parse.Parser(data, start); - for (var i = 0; i < numGlyphs; i += 1) { - // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs. - if (i < numMetrics) { - advanceWidth = p.parseUShort(); - leftSideBearing = p.parseShort(); - } - var glyph = glyphs.get(i); - glyph.advanceWidth = advanceWidth; - glyph.leftSideBearing = leftSideBearing; - } - } - function makeHmtxTable(glyphs) { - var t = new table.Table("hmtx", []); - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs.get(i); - var advanceWidth = glyph.advanceWidth || 0; - var leftSideBearing = glyph.leftSideBearing || 0; - t.fields.push({ - name: "advanceWidth_" + i, - type: "USHORT", - value: advanceWidth, - }); - t.fields.push({ - name: "leftSideBearing_" + i, - type: "SHORT", - value: leftSideBearing, - }); - } - return t; - } - var hmtx = { - parse: parseHmtxTable, - make: makeHmtxTable, - }; - // The `ltag` table stores IETF BCP-47 language tags. It allows supporting - function makeLtagTable(tags) { - var result = new table.Table("ltag", [ - { - name: "version", - type: "ULONG", - value: 1, - }, - { - name: "flags", - type: "ULONG", - value: 0, - }, - { - name: "numTags", - type: "ULONG", - value: tags.length, - }, - ]); - var stringPool = ""; - var stringPoolOffset = 12 + tags.length * 4; - for (var i = 0; i < tags.length; ++i) { - var pos = stringPool.indexOf(tags[i]); - if (pos < 0) { - pos = stringPool.length; - stringPool += tags[i]; - } - result.fields.push({ - name: "offset " + i, - type: "USHORT", - value: stringPoolOffset + pos, - }); - result.fields.push({ - name: "length " + i, - type: "USHORT", - value: tags[i].length, - }); - } - result.fields.push({ - name: "stringPool", - type: "CHARARRAY", - value: stringPool, - }); - return result; - } - function parseLtagTable(data, start) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseULong(); - check.argument( - tableVersion === 1, - "Unsupported ltag table version.", - ); - // The 'ltag' specification does not define any flags; skip the field. - p.skip("uLong", 1); - var numTags = p.parseULong(); - var tags = []; - for (var i = 0; i < numTags; i++) { - var tag = ""; - var offset = start + p.parseUShort(); - var length = p.parseUShort(); - for (var j = offset; j < offset + length; ++j) { - tag += String.fromCharCode(data.getInt8(j)); - } - tags.push(tag); - } - return tags; - } - var ltag = { - make: makeLtagTable, - parse: parseLtagTable, - }; - // The `maxp` table establishes the memory requirements for the font. - // Parse the maximum profile `maxp` table. - function parseMaxpTable(data, start) { - var maxp = {}; - var p = new parse.Parser(data, start); - maxp.version = p.parseVersion(); - maxp.numGlyphs = p.parseUShort(); - if (maxp.version === 1) { - maxp.maxPoints = p.parseUShort(); - maxp.maxContours = p.parseUShort(); - maxp.maxCompositePoints = p.parseUShort(); - maxp.maxCompositeContours = p.parseUShort(); - maxp.maxZones = p.parseUShort(); - maxp.maxTwilightPoints = p.parseUShort(); - maxp.maxStorage = p.parseUShort(); - maxp.maxFunctionDefs = p.parseUShort(); - maxp.maxInstructionDefs = p.parseUShort(); - maxp.maxStackElements = p.parseUShort(); - maxp.maxSizeOfInstructions = p.parseUShort(); - maxp.maxComponentElements = p.parseUShort(); - maxp.maxComponentDepth = p.parseUShort(); - } - return maxp; - } - function makeMaxpTable(numGlyphs) { - return new table.Table("maxp", [ - { - name: "version", - type: "FIXED", - value: 20480, - }, - { - name: "numGlyphs", - type: "USHORT", - value: numGlyphs, - }, - ]); - } - var maxp = { - parse: parseMaxpTable, - make: makeMaxpTable, - }; - // The `name` naming table. - // NameIDs for the name table. - var nameTableNames = [ - "copyright", - // 0 - "fontFamily", - // 1 - "fontSubfamily", - // 2 - "uniqueID", - // 3 - "fullName", - // 4 - "version", - // 5 - "postScriptName", - // 6 - "trademark", - // 7 - "manufacturer", - // 8 - "designer", - // 9 - "description", - // 10 - "manufacturerURL", - // 11 - "designerURL", - // 12 - "license", - // 13 - "licenseURL", - // 14 - "reserved", - // 15 - "preferredFamily", - // 16 - "preferredSubfamily", - // 17 - "compatibleFullName", - // 18 - "sampleText", - // 19 - "postScriptFindFontName", - // 20 - "wwsFamily", - // 21 - "wwsSubfamily", // 22 - ]; - var macLanguages = { - 0: "en", - 1: "fr", - 2: "de", - 3: "it", - 4: "nl", - 5: "sv", - 6: "es", - 7: "da", - 8: "pt", - 9: "no", - 10: "he", - 11: "ja", - 12: "ar", - 13: "fi", - 14: "el", - 15: "is", - 16: "mt", - 17: "tr", - 18: "hr", - 19: "zh-Hant", - 20: "ur", - 21: "hi", - 22: "th", - 23: "ko", - 24: "lt", - 25: "pl", - 26: "hu", - 27: "es", - 28: "lv", - 29: "se", - 30: "fo", - 31: "fa", - 32: "ru", - 33: "zh", - 34: "nl-BE", - 35: "ga", - 36: "sq", - 37: "ro", - 38: "cz", - 39: "sk", - 40: "si", - 41: "yi", - 42: "sr", - 43: "mk", - 44: "bg", - 45: "uk", - 46: "be", - 47: "uz", - 48: "kk", - 49: "az-Cyrl", - 50: "az-Arab", - 51: "hy", - 52: "ka", - 53: "mo", - 54: "ky", - 55: "tg", - 56: "tk", - 57: "mn-CN", - 58: "mn", - 59: "ps", - 60: "ks", - 61: "ku", - 62: "sd", - 63: "bo", - 64: "ne", - 65: "sa", - 66: "mr", - 67: "bn", - 68: "as", - 69: "gu", - 70: "pa", - 71: "or", - 72: "ml", - 73: "kn", - 74: "ta", - 75: "te", - 76: "si", - 77: "my", - 78: "km", - 79: "lo", - 80: "vi", - 81: "id", - 82: "tl", - 83: "ms", - 84: "ms-Arab", - 85: "am", - 86: "ti", - 87: "om", - 88: "so", - 89: "sw", - 90: "rw", - 91: "rn", - 92: "ny", - 93: "mg", - 94: "eo", - 128: "cy", - 129: "eu", - 130: "ca", - 131: "la", - 132: "qu", - 133: "gn", - 134: "ay", - 135: "tt", - 136: "ug", - 137: "dz", - 138: "jv", - 139: "su", - 140: "gl", - 141: "af", - 142: "br", - 143: "iu", - 144: "gd", - 145: "gv", - 146: "ga", - 147: "to", - 148: "el-polyton", - 149: "kl", - 150: "az", - 151: "nn", - }; - // MacOS language ID → MacOS script ID - // - // Note that the script ID is not sufficient to determine what encoding - // to use in TrueType files. For some languages, MacOS used a modification - // of a mainstream script. For example, an Icelandic name would be stored - // with smRoman in the TrueType naming table, but the actual encoding - // is a special Icelandic version of the normal Macintosh Roman encoding. - // As another example, Inuktitut uses an 8-bit encoding for Canadian Aboriginal - // Syllables but MacOS had run out of available script codes, so this was - // done as a (pretty radical) "modification" of Ethiopic. - // - // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt - var macLanguageToScript = { - 0: 0, - // langEnglish → smRoman - 1: 0, - // langFrench → smRoman - 2: 0, - // langGerman → smRoman - 3: 0, - // langItalian → smRoman - 4: 0, - // langDutch → smRoman - 5: 0, - // langSwedish → smRoman - 6: 0, - // langSpanish → smRoman - 7: 0, - // langDanish → smRoman - 8: 0, - // langPortuguese → smRoman - 9: 0, - // langNorwegian → smRoman - 10: 5, - // langHebrew → smHebrew - 11: 1, - // langJapanese → smJapanese - 12: 4, - // langArabic → smArabic - 13: 0, - // langFinnish → smRoman - 14: 6, - // langGreek → smGreek - 15: 0, - // langIcelandic → smRoman (modified) - 16: 0, - // langMaltese → smRoman - 17: 0, - // langTurkish → smRoman (modified) - 18: 0, - // langCroatian → smRoman (modified) - 19: 2, - // langTradChinese → smTradChinese - 20: 4, - // langUrdu → smArabic - 21: 9, - // langHindi → smDevanagari - 22: 21, - // langThai → smThai - 23: 3, - // langKorean → smKorean - 24: 29, - // langLithuanian → smCentralEuroRoman - 25: 29, - // langPolish → smCentralEuroRoman - 26: 29, - // langHungarian → smCentralEuroRoman - 27: 29, - // langEstonian → smCentralEuroRoman - 28: 29, - // langLatvian → smCentralEuroRoman - 29: 0, - // langSami → smRoman - 30: 0, - // langFaroese → smRoman (modified) - 31: 4, - // langFarsi → smArabic (modified) - 32: 7, - // langRussian → smCyrillic - 33: 25, - // langSimpChinese → smSimpChinese - 34: 0, - // langFlemish → smRoman - 35: 0, - // langIrishGaelic → smRoman (modified) - 36: 0, - // langAlbanian → smRoman - 37: 0, - // langRomanian → smRoman (modified) - 38: 29, - // langCzech → smCentralEuroRoman - 39: 29, - // langSlovak → smCentralEuroRoman - 40: 0, - // langSlovenian → smRoman (modified) - 41: 5, - // langYiddish → smHebrew - 42: 7, - // langSerbian → smCyrillic - 43: 7, - // langMacedonian → smCyrillic - 44: 7, - // langBulgarian → smCyrillic - 45: 7, - // langUkrainian → smCyrillic (modified) - 46: 7, - // langByelorussian → smCyrillic - 47: 7, - // langUzbek → smCyrillic - 48: 7, - // langKazakh → smCyrillic - 49: 7, - // langAzerbaijani → smCyrillic - 50: 4, - // langAzerbaijanAr → smArabic - 51: 24, - // langArmenian → smArmenian - 52: 23, - // langGeorgian → smGeorgian - 53: 7, - // langMoldavian → smCyrillic - 54: 7, - // langKirghiz → smCyrillic - 55: 7, - // langTajiki → smCyrillic - 56: 7, - // langTurkmen → smCyrillic - 57: 27, - // langMongolian → smMongolian - 58: 7, - // langMongolianCyr → smCyrillic - 59: 4, - // langPashto → smArabic - 60: 4, - // langKurdish → smArabic - 61: 4, - // langKashmiri → smArabic - 62: 4, - // langSindhi → smArabic - 63: 26, - // langTibetan → smTibetan - 64: 9, - // langNepali → smDevanagari - 65: 9, - // langSanskrit → smDevanagari - 66: 9, - // langMarathi → smDevanagari - 67: 13, - // langBengali → smBengali - 68: 13, - // langAssamese → smBengali - 69: 11, - // langGujarati → smGujarati - 70: 10, - // langPunjabi → smGurmukhi - 71: 12, - // langOriya → smOriya - 72: 17, - // langMalayalam → smMalayalam - 73: 16, - // langKannada → smKannada - 74: 14, - // langTamil → smTamil - 75: 15, - // langTelugu → smTelugu - 76: 18, - // langSinhalese → smSinhalese - 77: 19, - // langBurmese → smBurmese - 78: 20, - // langKhmer → smKhmer - 79: 22, - // langLao → smLao - 80: 30, - // langVietnamese → smVietnamese - 81: 0, - // langIndonesian → smRoman - 82: 0, - // langTagalog → smRoman - 83: 0, - // langMalayRoman → smRoman - 84: 4, - // langMalayArabic → smArabic - 85: 28, - // langAmharic → smEthiopic - 86: 28, - // langTigrinya → smEthiopic - 87: 28, - // langOromo → smEthiopic - 88: 0, - // langSomali → smRoman - 89: 0, - // langSwahili → smRoman - 90: 0, - // langKinyarwanda → smRoman - 91: 0, - // langRundi → smRoman - 92: 0, - // langNyanja → smRoman - 93: 0, - // langMalagasy → smRoman - 94: 0, - // langEsperanto → smRoman - 128: 0, - // langWelsh → smRoman (modified) - 129: 0, - // langBasque → smRoman - 130: 0, - // langCatalan → smRoman - 131: 0, - // langLatin → smRoman - 132: 0, - // langQuechua → smRoman - 133: 0, - // langGuarani → smRoman - 134: 0, - // langAymara → smRoman - 135: 7, - // langTatar → smCyrillic - 136: 4, - // langUighur → smArabic - 137: 26, - // langDzongkha → smTibetan - 138: 0, - // langJavaneseRom → smRoman - 139: 0, - // langSundaneseRom → smRoman - 140: 0, - // langGalician → smRoman - 141: 0, - // langAfrikaans → smRoman - 142: 0, - // langBreton → smRoman (modified) - 143: 28, - // langInuktitut → smEthiopic (modified) - 144: 0, - // langScottishGaelic → smRoman (modified) - 145: 0, - // langManxGaelic → smRoman (modified) - 146: 0, - // langIrishGaelicScript → smRoman (modified) - 147: 0, - // langTongan → smRoman - 148: 6, - // langGreekAncient → smRoman - 149: 0, - // langGreenlandic → smRoman - 150: 0, - // langAzerbaijanRoman → smRoman - 151: 0, // langNynorsk → smRoman - }; - // While Microsoft indicates a region/country for all its language - // IDs, we omit the region code if it's equal to the "most likely - // region subtag" according to Unicode CLDR. For scripts, we omit - // the subtag if it is equal to the Suppress-Script entry in the - // IANA language subtag registry for IETF BCP 47. - // - // For example, Microsoft states that its language code 0x041A is - // Croatian in Croatia. We transform this to the BCP 47 language code 'hr' - // and not 'hr-HR' because Croatia is the default country for Croatian, - // according to Unicode CLDR. As another example, Microsoft states - // that 0x101A is Croatian (Latin) in Bosnia-Herzegovina. We transform - // this to 'hr-BA' and not 'hr-Latn-BA' because Latin is the default script - // for the Croatian language, according to IANA. - // - // http://www.unicode.org/cldr/charts/latest/supplemental/likely_subtags.html - // http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry - var windowsLanguages = { - 1078: "af", - 1052: "sq", - 1156: "gsw", - 1118: "am", - 5121: "ar-DZ", - 15361: "ar-BH", - 3073: "ar", - 2049: "ar-IQ", - 11265: "ar-JO", - 13313: "ar-KW", - 12289: "ar-LB", - 4097: "ar-LY", - 6145: "ary", - 8193: "ar-OM", - 16385: "ar-QA", - 1025: "ar-SA", - 10241: "ar-SY", - 7169: "aeb", - 14337: "ar-AE", - 9217: "ar-YE", - 1067: "hy", - 1101: "as", - 2092: "az-Cyrl", - 1068: "az", - 1133: "ba", - 1069: "eu", - 1059: "be", - 2117: "bn", - 1093: "bn-IN", - 8218: "bs-Cyrl", - 5146: "bs", - 1150: "br", - 1026: "bg", - 1027: "ca", - 3076: "zh-HK", - 5124: "zh-MO", - 2052: "zh", - 4100: "zh-SG", - 1028: "zh-TW", - 1155: "co", - 1050: "hr", - 4122: "hr-BA", - 1029: "cs", - 1030: "da", - 1164: "prs", - 1125: "dv", - 2067: "nl-BE", - 1043: "nl", - 3081: "en-AU", - 10249: "en-BZ", - 4105: "en-CA", - 9225: "en-029", - 16393: "en-IN", - 6153: "en-IE", - 8201: "en-JM", - 17417: "en-MY", - 5129: "en-NZ", - 13321: "en-PH", - 18441: "en-SG", - 7177: "en-ZA", - 11273: "en-TT", - 2057: "en-GB", - 1033: "en", - 12297: "en-ZW", - 1061: "et", - 1080: "fo", - 1124: "fil", - 1035: "fi", - 2060: "fr-BE", - 3084: "fr-CA", - 1036: "fr", - 5132: "fr-LU", - 6156: "fr-MC", - 4108: "fr-CH", - 1122: "fy", - 1110: "gl", - 1079: "ka", - 3079: "de-AT", - 1031: "de", - 5127: "de-LI", - 4103: "de-LU", - 2055: "de-CH", - 1032: "el", - 1135: "kl", - 1095: "gu", - 1128: "ha", - 1037: "he", - 1081: "hi", - 1038: "hu", - 1039: "is", - 1136: "ig", - 1057: "id", - 1117: "iu", - 2141: "iu-Latn", - 2108: "ga", - 1076: "xh", - 1077: "zu", - 1040: "it", - 2064: "it-CH", - 1041: "ja", - 1099: "kn", - 1087: "kk", - 1107: "km", - 1158: "quc", - 1159: "rw", - 1089: "sw", - 1111: "kok", - 1042: "ko", - 1088: "ky", - 1108: "lo", - 1062: "lv", - 1063: "lt", - 2094: "dsb", - 1134: "lb", - 1071: "mk", - 2110: "ms-BN", - 1086: "ms", - 1100: "ml", - 1082: "mt", - 1153: "mi", - 1146: "arn", - 1102: "mr", - 1148: "moh", - 1104: "mn", - 2128: "mn-CN", - 1121: "ne", - 1044: "nb", - 2068: "nn", - 1154: "oc", - 1096: "or", - 1123: "ps", - 1045: "pl", - 1046: "pt", - 2070: "pt-PT", - 1094: "pa", - 1131: "qu-BO", - 2155: "qu-EC", - 3179: "qu", - 1048: "ro", - 1047: "rm", - 1049: "ru", - 9275: "smn", - 4155: "smj-NO", - 5179: "smj", - 3131: "se-FI", - 1083: "se", - 2107: "se-SE", - 8251: "sms", - 6203: "sma-NO", - 7227: "sms", - 1103: "sa", - 7194: "sr-Cyrl-BA", - 3098: "sr", - 6170: "sr-Latn-BA", - 2074: "sr-Latn", - 1132: "nso", - 1074: "tn", - 1115: "si", - 1051: "sk", - 1060: "sl", - 11274: "es-AR", - 16394: "es-BO", - 13322: "es-CL", - 9226: "es-CO", - 5130: "es-CR", - 7178: "es-DO", - 12298: "es-EC", - 17418: "es-SV", - 4106: "es-GT", - 18442: "es-HN", - 2058: "es-MX", - 19466: "es-NI", - 6154: "es-PA", - 15370: "es-PY", - 10250: "es-PE", - 20490: "es-PR", - // Microsoft has defined two different language codes for - // “Spanish with modern sorting” and “Spanish with traditional - // sorting”. This makes sense for collation APIs, and it would be - // possible to express this in BCP 47 language tags via Unicode - // extensions (eg., es-u-co-trad is Spanish with traditional - // sorting). However, for storing names in fonts, the distinction - // does not make sense, so we give “es” in both cases. - 3082: "es", - 1034: "es", - 21514: "es-US", - 14346: "es-UY", - 8202: "es-VE", - 2077: "sv-FI", - 1053: "sv", - 1114: "syr", - 1064: "tg", - 2143: "tzm", - 1097: "ta", - 1092: "tt", - 1098: "te", - 1054: "th", - 1105: "bo", - 1055: "tr", - 1090: "tk", - 1152: "ug", - 1058: "uk", - 1070: "hsb", - 1056: "ur", - 2115: "uz-Cyrl", - 1091: "uz", - 1066: "vi", - 1106: "cy", - 1160: "wo", - 1157: "sah", - 1144: "ii", - 1130: "yo", - }; - // Returns a IETF BCP 47 language code, for example 'zh-Hant' - // for 'Chinese in the traditional script'. - function getLanguageCode(platformID, languageID, ltag) { - switch (platformID) { - case 0: - // Unicode - if (languageID === 65535) { - return "und"; - } else if (ltag) { - return ltag[languageID]; - } - break; - case 1: - // Macintosh - return macLanguages[languageID]; - case 3: - // Windows - return windowsLanguages[languageID]; - } - return undefined; - } - var utf16 = "utf-16"; - // MacOS script ID → encoding. This table stores the default case, - // which can be overridden by macLanguageEncodings. - var macScriptEncodings = { - 0: "macintosh", - // smRoman - 1: "x-mac-japanese", - // smJapanese - 2: "x-mac-chinesetrad", - // smTradChinese - 3: "x-mac-korean", - // smKorean - 6: "x-mac-greek", - // smGreek - 7: "x-mac-cyrillic", - // smCyrillic - 9: "x-mac-devanagai", - // smDevanagari - 10: "x-mac-gurmukhi", - // smGurmukhi - 11: "x-mac-gujarati", - // smGujarati - 12: "x-mac-oriya", - // smOriya - 13: "x-mac-bengali", - // smBengali - 14: "x-mac-tamil", - // smTamil - 15: "x-mac-telugu", - // smTelugu - 16: "x-mac-kannada", - // smKannada - 17: "x-mac-malayalam", - // smMalayalam - 18: "x-mac-sinhalese", - // smSinhalese - 19: "x-mac-burmese", - // smBurmese - 20: "x-mac-khmer", - // smKhmer - 21: "x-mac-thai", - // smThai - 22: "x-mac-lao", - // smLao - 23: "x-mac-georgian", - // smGeorgian - 24: "x-mac-armenian", - // smArmenian - 25: "x-mac-chinesesimp", - // smSimpChinese - 26: "x-mac-tibetan", - // smTibetan - 27: "x-mac-mongolian", - // smMongolian - 28: "x-mac-ethiopic", - // smEthiopic - 29: "x-mac-ce", - // smCentralEuroRoman - 30: "x-mac-vietnamese", - // smVietnamese - 31: "x-mac-extarabic", // smExtArabic - }; - // MacOS language ID → encoding. This table stores the exceptional - // cases, which override macScriptEncodings. For writing MacOS naming - // tables, we need to emit a MacOS script ID. Therefore, we cannot - // merge macScriptEncodings into macLanguageEncodings. - // - // http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt - var macLanguageEncodings = { - 15: "x-mac-icelandic", - // langIcelandic - 17: "x-mac-turkish", - // langTurkish - 18: "x-mac-croatian", - // langCroatian - 24: "x-mac-ce", - // langLithuanian - 25: "x-mac-ce", - // langPolish - 26: "x-mac-ce", - // langHungarian - 27: "x-mac-ce", - // langEstonian - 28: "x-mac-ce", - // langLatvian - 30: "x-mac-icelandic", - // langFaroese - 37: "x-mac-romanian", - // langRomanian - 38: "x-mac-ce", - // langCzech - 39: "x-mac-ce", - // langSlovak - 40: "x-mac-ce", - // langSlovenian - 143: "x-mac-inuit", - // langInuktitut - 146: "x-mac-gaelic", // langIrishGaelicScript - }; - function getEncoding(platformID, encodingID, languageID) { - switch (platformID) { - case 0: - // Unicode - return utf16; - case 1: - // Apple Macintosh - return ( - macLanguageEncodings[languageID] || - macScriptEncodings[encodingID] - ); - case 3: - // Microsoft Windows - if (encodingID === 1 || encodingID === 10) { - return utf16; - } - break; - } - return undefined; - } // Parse the naming `name` table. - // FIXME: Format 1 additional fields are not supported yet. - // ltag is the content of the `ltag' table, such as ['en', 'zh-Hans', 'de-CH-1904']. - - function parseNameTable(data, start, ltag) { - var name = {}; - var p = new parse.Parser(data, start); - var format = p.parseUShort(); - var count = p.parseUShort(); - var stringOffset = p.offset + p.parseUShort(); - for (var i = 0; i < count; i++) { - var platformID = p.parseUShort(); - var encodingID = p.parseUShort(); - var languageID = p.parseUShort(); - var nameID = p.parseUShort(); - var property = nameTableNames[nameID] || nameID; - var byteLength = p.parseUShort(); - var offset = p.parseUShort(); - var language = getLanguageCode(platformID, languageID, ltag); - var encoding = getEncoding( - platformID, - encodingID, - languageID, - ); - if (encoding !== undefined && language !== undefined) { - var text = void 0; - if (encoding === utf16) { - text = decode.UTF16( - data, - stringOffset + offset, - byteLength, - ); - } else { - text = decode.MACSTRING( - data, - stringOffset + offset, - byteLength, - encoding, - ); - } - if (text) { - var translations = name[property]; - if (translations === undefined) { - translations = name[property] = {}; - } - translations[language] = text; - } - } - } - var langTagCount = 0; - if (format === 1) { - // FIXME: Also handle Microsoft's 'name' table 1. - langTagCount = p.parseUShort(); - } - return name; - } // {23: 'foo'} → {'foo': 23} - // ['bar', 'baz'] → {'bar': 0, 'baz': 1} - - function reverseDict(dict) { - var result = {}; - for (var key in dict) { - result[dict[key]] = parseInt(key); - } - return result; - } - function makeNameRecord( - platformID, - encodingID, - languageID, - nameID, - length, - offset, - ) { - return new table.Record("NameRecord", [ - { - name: "platformID", - type: "USHORT", - value: platformID, - }, - { - name: "encodingID", - type: "USHORT", - value: encodingID, - }, - { - name: "languageID", - type: "USHORT", - value: languageID, - }, - { - name: "nameID", - type: "USHORT", - value: nameID, - }, - { - name: "length", - type: "USHORT", - value: length, - }, - { - name: "offset", - type: "USHORT", - value: offset, - }, - ]); - } // Finds the position of needle in haystack, or -1 if not there. - // Like String.indexOf(), but for arrays. - - function findSubArray(needle, haystack) { - var needleLength = needle.length; - var limit = haystack.length - needleLength + 1; - loop: for (var pos = 0; pos < limit; pos++) { - for (; pos < limit; pos++) { - for (var k = 0; k < needleLength; k++) { - if (haystack[pos + k] !== needle[k]) { - continue loop; - } - } - return pos; - } - } - return -1; - } - function addStringToPool(s, pool) { - var offset = findSubArray(s, pool); - if (offset < 0) { - offset = pool.length; - var i = 0; - var len = s.length; - for (; i < len; ++i) { - pool.push(s[i]); - } - } - return offset; - } - function makeNameTable(names, ltag) { - var nameID; - var nameIDs = []; - var namesWithNumericKeys = {}; - var nameTableIds = reverseDict(nameTableNames); - for (var key in names) { - var id = nameTableIds[key]; - if (id === undefined) { - id = key; - } - nameID = parseInt(id); - if (isNaN(nameID)) { - throw new Error( - 'Name table entry "' + - key + - '" does not exist, see nameTableNames for complete list.', - ); - } - namesWithNumericKeys[nameID] = names[key]; - nameIDs.push(nameID); - } - var macLanguageIds = reverseDict(macLanguages); - var windowsLanguageIds = reverseDict(windowsLanguages); - var nameRecords = []; - var stringPool = []; - for (var i = 0; i < nameIDs.length; i++) { - nameID = nameIDs[i]; - var translations = namesWithNumericKeys[nameID]; - for (var lang in translations) { - var text = translations[lang]; - // For MacOS, we try to emit the name in the form that was introduced - // in the initial version of the TrueType spec (in the late 1980s). - // However, this can fail for various reasons: the requested BCP 47 - // language code might not have an old-style Mac equivalent; - // we might not have a codec for the needed character encoding; - // or the name might contain characters that cannot be expressed - // in the old-style Macintosh encoding. In case of failure, we emit - // the name in a more modern fashion (Unicode encoding with BCP 47 - // language tags) that is recognized by MacOS 10.5, released in 2009. - // If fonts were only read by operating systems, we could simply - // emit all names in the modern form; this would be much easier. - // However, there are many applications and libraries that read - // 'name' tables directly, and these will usually only recognize - // the ancient form (silently skipping the unrecognized names). - var macPlatform = 1; // Macintosh - var macLanguage = macLanguageIds[lang]; - var macScript = macLanguageToScript[macLanguage]; - var macEncoding = getEncoding( - macPlatform, - macScript, - macLanguage, - ); - var macName = encode.MACSTRING(text, macEncoding); - if (macName === undefined) { - macPlatform = 0; // Unicode - macLanguage = ltag.indexOf(lang); - if (macLanguage < 0) { - macLanguage = ltag.length; - ltag.push(lang); - } - macScript = 4; // Unicode 2.0 and later - macName = encode.UTF16(text); - } - var macNameOffset = addStringToPool(macName, stringPool); - nameRecords.push( - makeNameRecord( - macPlatform, - macScript, - macLanguage, - nameID, - macName.length, - macNameOffset, - ), - ); - var winLanguage = windowsLanguageIds[lang]; - if (winLanguage !== undefined) { - var winName = encode.UTF16(text); - var winNameOffset = addStringToPool(winName, stringPool); - nameRecords.push( - makeNameRecord( - 3, - 1, - winLanguage, - nameID, - winName.length, - winNameOffset, - ), - ); - } - } - } - nameRecords.sort(function (a, b) { - return ( - a.platformID - b.platformID || - a.encodingID - b.encodingID || - a.languageID - b.languageID || - a.nameID - b.nameID - ); - }); - var t = new table.Table("name", [ - { - name: "format", - type: "USHORT", - value: 0, - }, - { - name: "count", - type: "USHORT", - value: nameRecords.length, - }, - { - name: "stringOffset", - type: "USHORT", - value: 6 + nameRecords.length * 12, - }, - ]); - for (var r = 0; r < nameRecords.length; r++) { - t.fields.push({ - name: "record_" + r, - type: "RECORD", - value: nameRecords[r], - }); - } - t.fields.push({ - name: "strings", - type: "LITERAL", - value: stringPool, - }); - return t; - } - var _name = { - parse: parseNameTable, - make: makeNameTable, - }; - // The `OS/2` table contains metrics required in OpenType fonts. - var unicodeRanges = [ - { - begin: 0, - end: 127, - }, - // Basic Latin - { - begin: 128, - end: 255, - }, - // Latin-1 Supplement - { - begin: 256, - end: 383, - }, - // Latin Extended-A - { - begin: 384, - end: 591, - }, - // Latin Extended-B - { - begin: 592, - end: 687, - }, - // IPA Extensions - { - begin: 688, - end: 767, - }, - // Spacing Modifier Letters - { - begin: 768, - end: 879, - }, - // Combining Diacritical Marks - { - begin: 880, - end: 1023, - }, - // Greek and Coptic - { - begin: 11392, - end: 11519, - }, - // Coptic - { - begin: 1024, - end: 1279, - }, - // Cyrillic - { - begin: 1328, - end: 1423, - }, - // Armenian - { - begin: 1424, - end: 1535, - }, - // Hebrew - { - begin: 42240, - end: 42559, - }, - // Vai - { - begin: 1536, - end: 1791, - }, - // Arabic - { - begin: 1984, - end: 2047, - }, - // NKo - { - begin: 2304, - end: 2431, - }, - // Devanagari - { - begin: 2432, - end: 2559, - }, - // Bengali - { - begin: 2560, - end: 2687, - }, - // Gurmukhi - { - begin: 2688, - end: 2815, - }, - // Gujarati - { - begin: 2816, - end: 2943, - }, - // Oriya - { - begin: 2944, - end: 3071, - }, - // Tamil - { - begin: 3072, - end: 3199, - }, - // Telugu - { - begin: 3200, - end: 3327, - }, - // Kannada - { - begin: 3328, - end: 3455, - }, - // Malayalam - { - begin: 3584, - end: 3711, - }, - // Thai - { - begin: 3712, - end: 3839, - }, - // Lao - { - begin: 4256, - end: 4351, - }, - // Georgian - { - begin: 6912, - end: 7039, - }, - // Balinese - { - begin: 4352, - end: 4607, - }, - // Hangul Jamo - { - begin: 7680, - end: 7935, - }, - // Latin Extended Additional - { - begin: 7936, - end: 8191, - }, - // Greek Extended - { - begin: 8192, - end: 8303, - }, - // General Punctuation - { - begin: 8304, - end: 8351, - }, - // Superscripts And Subscripts - { - begin: 8352, - end: 8399, - }, - // Currency Symbol - { - begin: 8400, - end: 8447, - }, - // Combining Diacritical Marks For Symbols - { - begin: 8448, - end: 8527, - }, - // Letterlike Symbols - { - begin: 8528, - end: 8591, - }, - // Number Forms - { - begin: 8592, - end: 8703, - }, - // Arrows - { - begin: 8704, - end: 8959, - }, - // Mathematical Operators - { - begin: 8960, - end: 9215, - }, - // Miscellaneous Technical - { - begin: 9216, - end: 9279, - }, - // Control Pictures - { - begin: 9280, - end: 9311, - }, - // Optical Character Recognition - { - begin: 9312, - end: 9471, - }, - // Enclosed Alphanumerics - { - begin: 9472, - end: 9599, - }, - // Box Drawing - { - begin: 9600, - end: 9631, - }, - // Block Elements - { - begin: 9632, - end: 9727, - }, - // Geometric Shapes - { - begin: 9728, - end: 9983, - }, - // Miscellaneous Symbols - { - begin: 9984, - end: 10175, - }, - // Dingbats - { - begin: 12288, - end: 12351, - }, - // CJK Symbols And Punctuation - { - begin: 12352, - end: 12447, - }, - // Hiragana - { - begin: 12448, - end: 12543, - }, - // Katakana - { - begin: 12544, - end: 12591, - }, - // Bopomofo - { - begin: 12592, - end: 12687, - }, - // Hangul Compatibility Jamo - { - begin: 43072, - end: 43135, - }, - // Phags-pa - { - begin: 12800, - end: 13055, - }, - // Enclosed CJK Letters And Months - { - begin: 13056, - end: 13311, - }, - // CJK Compatibility - { - begin: 44032, - end: 55215, - }, - // Hangul Syllables - { - begin: 55296, - end: 57343, - }, - // Non-Plane 0 * - { - begin: 67840, - end: 67871, - }, - // Phoenicia - { - begin: 19968, - end: 40959, - }, - // CJK Unified Ideographs - { - begin: 57344, - end: 63743, - }, - // Private Use Area (plane 0) - { - begin: 12736, - end: 12783, - }, - // CJK Strokes - { - begin: 64256, - end: 64335, - }, - // Alphabetic Presentation Forms - { - begin: 64336, - end: 65023, - }, - // Arabic Presentation Forms-A - { - begin: 65056, - end: 65071, - }, - // Combining Half Marks - { - begin: 65040, - end: 65055, - }, - // Vertical Forms - { - begin: 65104, - end: 65135, - }, - // Small Form Variants - { - begin: 65136, - end: 65279, - }, - // Arabic Presentation Forms-B - { - begin: 65280, - end: 65519, - }, - // Halfwidth And Fullwidth Forms - { - begin: 65520, - end: 65535, - }, - // Specials - { - begin: 3840, - end: 4095, - }, - // Tibetan - { - begin: 1792, - end: 1871, - }, - // Syriac - { - begin: 1920, - end: 1983, - }, - // Thaana - { - begin: 3456, - end: 3583, - }, - // Sinhala - { - begin: 4096, - end: 4255, - }, - // Myanmar - { - begin: 4608, - end: 4991, - }, - // Ethiopic - { - begin: 5024, - end: 5119, - }, - // Cherokee - { - begin: 5120, - end: 5759, - }, - // Unified Canadian Aboriginal Syllabics - { - begin: 5760, - end: 5791, - }, - // Ogham - { - begin: 5792, - end: 5887, - }, - // Runic - { - begin: 6016, - end: 6143, - }, - // Khmer - { - begin: 6144, - end: 6319, - }, - // Mongolian - { - begin: 10240, - end: 10495, - }, - // Braille Patterns - { - begin: 40960, - end: 42127, - }, - // Yi Syllables - { - begin: 5888, - end: 5919, - }, - // Tagalog - { - begin: 66304, - end: 66351, - }, - // Old Italic - { - begin: 66352, - end: 66383, - }, - // Gothic - { - begin: 66560, - end: 66639, - }, - // Deseret - { - begin: 118784, - end: 119039, - }, - // Byzantine Musical Symbols - { - begin: 119808, - end: 120831, - }, - // Mathematical Alphanumeric Symbols - { - begin: 1044480, - end: 1048573, - }, - // Private Use (plane 15) - { - begin: 65024, - end: 65039, - }, - // Variation Selectors - { - begin: 917504, - end: 917631, - }, - // Tags - { - begin: 6400, - end: 6479, - }, - // Limbu - { - begin: 6480, - end: 6527, - }, - // Tai Le - { - begin: 6528, - end: 6623, - }, - // New Tai Lue - { - begin: 6656, - end: 6687, - }, - // Buginese - { - begin: 11264, - end: 11359, - }, - // Glagolitic - { - begin: 11568, - end: 11647, - }, - // Tifinagh - { - begin: 19904, - end: 19967, - }, - // Yijing Hexagram Symbols - { - begin: 43008, - end: 43055, - }, - // Syloti Nagri - { - begin: 65536, - end: 65663, - }, - // Linear B Syllabary - { - begin: 65856, - end: 65935, - }, - // Ancient Greek Numbers - { - begin: 66432, - end: 66463, - }, - // Ugaritic - { - begin: 66464, - end: 66527, - }, - // Old Persian - { - begin: 66640, - end: 66687, - }, - // Shavian - { - begin: 66688, - end: 66735, - }, - // Osmanya - { - begin: 67584, - end: 67647, - }, - // Cypriot Syllabary - { - begin: 68096, - end: 68191, - }, - // Kharoshthi - { - begin: 119552, - end: 119647, - }, - // Tai Xuan Jing Symbols - { - begin: 73728, - end: 74751, - }, - // Cuneiform - { - begin: 119648, - end: 119679, - }, - // Counting Rod Numerals - { - begin: 7040, - end: 7103, - }, - // Sundanese - { - begin: 7168, - end: 7247, - }, - // Lepcha - { - begin: 7248, - end: 7295, - }, - // Ol Chiki - { - begin: 43136, - end: 43231, - }, - // Saurashtra - { - begin: 43264, - end: 43311, - }, - // Kayah Li - { - begin: 43312, - end: 43359, - }, - // Rejang - { - begin: 43520, - end: 43615, - }, - // Cham - { - begin: 65936, - end: 65999, - }, - // Ancient Symbols - { - begin: 66000, - end: 66047, - }, - // Phaistos Disc - { - begin: 66208, - end: 66271, - }, - // Carian - { - begin: 127024, - end: 127135, - }, // Domino Tiles - ]; - function getUnicodeRange(unicode) { - for (var i = 0; i < unicodeRanges.length; i += 1) { - var range = unicodeRanges[i]; - if (unicode >= range.begin && unicode < range.end) { - return i; - } - } - return -1; - } // Parse the OS/2 and Windows metrics `OS/2` table - - function parseOS2Table(data, start) { - var os2 = {}; - var p = new parse.Parser(data, start); - os2.version = p.parseUShort(); - os2.xAvgCharWidth = p.parseShort(); - os2.usWeightClass = p.parseUShort(); - os2.usWidthClass = p.parseUShort(); - os2.fsType = p.parseUShort(); - os2.ySubscriptXSize = p.parseShort(); - os2.ySubscriptYSize = p.parseShort(); - os2.ySubscriptXOffset = p.parseShort(); - os2.ySubscriptYOffset = p.parseShort(); - os2.ySuperscriptXSize = p.parseShort(); - os2.ySuperscriptYSize = p.parseShort(); - os2.ySuperscriptXOffset = p.parseShort(); - os2.ySuperscriptYOffset = p.parseShort(); - os2.yStrikeoutSize = p.parseShort(); - os2.yStrikeoutPosition = p.parseShort(); - os2.sFamilyClass = p.parseShort(); - os2.panose = []; - for (var i = 0; i < 10; i++) { - os2.panose[i] = p.parseByte(); - } - os2.ulUnicodeRange1 = p.parseULong(); - os2.ulUnicodeRange2 = p.parseULong(); - os2.ulUnicodeRange3 = p.parseULong(); - os2.ulUnicodeRange4 = p.parseULong(); - os2.achVendID = String.fromCharCode( - p.parseByte(), - p.parseByte(), - p.parseByte(), - p.parseByte(), - ); - os2.fsSelection = p.parseUShort(); - os2.usFirstCharIndex = p.parseUShort(); - os2.usLastCharIndex = p.parseUShort(); - os2.sTypoAscender = p.parseShort(); - os2.sTypoDescender = p.parseShort(); - os2.sTypoLineGap = p.parseShort(); - os2.usWinAscent = p.parseUShort(); - os2.usWinDescent = p.parseUShort(); - if (os2.version >= 1) { - os2.ulCodePageRange1 = p.parseULong(); - os2.ulCodePageRange2 = p.parseULong(); - } - if (os2.version >= 2) { - os2.sxHeight = p.parseShort(); - os2.sCapHeight = p.parseShort(); - os2.usDefaultChar = p.parseUShort(); - os2.usBreakChar = p.parseUShort(); - os2.usMaxContent = p.parseUShort(); - } - return os2; - } - function makeOS2Table(options) { - return new table.Table( - "OS/2", - [ - { - name: "version", - type: "USHORT", - value: 3, - }, - { - name: "xAvgCharWidth", - type: "SHORT", - value: 0, - }, - { - name: "usWeightClass", - type: "USHORT", - value: 0, - }, - { - name: "usWidthClass", - type: "USHORT", - value: 0, - }, - { - name: "fsType", - type: "USHORT", - value: 0, - }, - { - name: "ySubscriptXSize", - type: "SHORT", - value: 650, - }, - { - name: "ySubscriptYSize", - type: "SHORT", - value: 699, - }, - { - name: "ySubscriptXOffset", - type: "SHORT", - value: 0, - }, - { - name: "ySubscriptYOffset", - type: "SHORT", - value: 140, - }, - { - name: "ySuperscriptXSize", - type: "SHORT", - value: 650, - }, - { - name: "ySuperscriptYSize", - type: "SHORT", - value: 699, - }, - { - name: "ySuperscriptXOffset", - type: "SHORT", - value: 0, - }, - { - name: "ySuperscriptYOffset", - type: "SHORT", - value: 479, - }, - { - name: "yStrikeoutSize", - type: "SHORT", - value: 49, - }, - { - name: "yStrikeoutPosition", - type: "SHORT", - value: 258, - }, - { - name: "sFamilyClass", - type: "SHORT", - value: 0, - }, - { - name: "bFamilyType", - type: "BYTE", - value: 0, - }, - { - name: "bSerifStyle", - type: "BYTE", - value: 0, - }, - { - name: "bWeight", - type: "BYTE", - value: 0, - }, - { - name: "bProportion", - type: "BYTE", - value: 0, - }, - { - name: "bContrast", - type: "BYTE", - value: 0, - }, - { - name: "bStrokeVariation", - type: "BYTE", - value: 0, - }, - { - name: "bArmStyle", - type: "BYTE", - value: 0, - }, - { - name: "bLetterform", - type: "BYTE", - value: 0, - }, - { - name: "bMidline", - type: "BYTE", - value: 0, - }, - { - name: "bXHeight", - type: "BYTE", - value: 0, - }, - { - name: "ulUnicodeRange1", - type: "ULONG", - value: 0, - }, - { - name: "ulUnicodeRange2", - type: "ULONG", - value: 0, - }, - { - name: "ulUnicodeRange3", - type: "ULONG", - value: 0, - }, - { - name: "ulUnicodeRange4", - type: "ULONG", - value: 0, - }, - { - name: "achVendID", - type: "CHARARRAY", - value: "XXXX", - }, - { - name: "fsSelection", - type: "USHORT", - value: 0, - }, - { - name: "usFirstCharIndex", - type: "USHORT", - value: 0, - }, - { - name: "usLastCharIndex", - type: "USHORT", - value: 0, - }, - { - name: "sTypoAscender", - type: "SHORT", - value: 0, - }, - { - name: "sTypoDescender", - type: "SHORT", - value: 0, - }, - { - name: "sTypoLineGap", - type: "SHORT", - value: 0, - }, - { - name: "usWinAscent", - type: "USHORT", - value: 0, - }, - { - name: "usWinDescent", - type: "USHORT", - value: 0, - }, - { - name: "ulCodePageRange1", - type: "ULONG", - value: 0, - }, - { - name: "ulCodePageRange2", - type: "ULONG", - value: 0, - }, - { - name: "sxHeight", - type: "SHORT", - value: 0, - }, - { - name: "sCapHeight", - type: "SHORT", - value: 0, - }, - { - name: "usDefaultChar", - type: "USHORT", - value: 0, - }, - { - name: "usBreakChar", - type: "USHORT", - value: 0, - }, - { - name: "usMaxContext", - type: "USHORT", - value: 0, - }, - ], - options, - ); - } - var os2 = { - parse: parseOS2Table, - make: makeOS2Table, - unicodeRanges: unicodeRanges, - getUnicodeRange: getUnicodeRange, - }; - // The `post` table stores additional PostScript information, such as glyph names. - // Parse the PostScript `post` table - function parsePostTable(data, start) { - var post = {}; - var p = new parse.Parser(data, start); - post.version = p.parseVersion(); - post.italicAngle = p.parseFixed(); - post.underlinePosition = p.parseShort(); - post.underlineThickness = p.parseShort(); - post.isFixedPitch = p.parseULong(); - post.minMemType42 = p.parseULong(); - post.maxMemType42 = p.parseULong(); - post.minMemType1 = p.parseULong(); - post.maxMemType1 = p.parseULong(); - switch (post.version) { - case 1: - post.names = standardNames.slice(); - break; - case 2: - post.numberOfGlyphs = p.parseUShort(); - post.glyphNameIndex = new Array(post.numberOfGlyphs); - for (var i = 0; i < post.numberOfGlyphs; i++) { - post.glyphNameIndex[i] = p.parseUShort(); - } - post.names = []; - for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) { - if (post.glyphNameIndex[i$1] >= standardNames.length) { - var nameLength = p.parseChar(); - post.names.push(p.parseString(nameLength)); - } - } - break; - case 2.5: - post.numberOfGlyphs = p.parseUShort(); - post.offset = new Array(post.numberOfGlyphs); - for (var i$2 = 0; i$2 < post.numberOfGlyphs; i$2++) { - post.offset[i$2] = p.parseChar(); - } - break; - } - return post; - } - function makePostTable() { - return new table.Table("post", [ - { - name: "version", - type: "FIXED", - value: 196608, - }, - { - name: "italicAngle", - type: "FIXED", - value: 0, - }, - { - name: "underlinePosition", - type: "FWORD", - value: 0, - }, - { - name: "underlineThickness", - type: "FWORD", - value: 0, - }, - { - name: "isFixedPitch", - type: "ULONG", - value: 0, - }, - { - name: "minMemType42", - type: "ULONG", - value: 0, - }, - { - name: "maxMemType42", - type: "ULONG", - value: 0, - }, - { - name: "minMemType1", - type: "ULONG", - value: 0, - }, - { - name: "maxMemType1", - type: "ULONG", - value: 0, - }, - ]); - } - var post = { - parse: parsePostTable, - make: makePostTable, - }; - // The `GSUB` table contains ligatures, among other things. - var subtableParsers = new Array(9); // subtableParsers[0] is unused - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#SS - subtableParsers[1] = function parseLookup1() { - var start = this.offset + this.relativeOffset; - var substFormat = this.parseUShort(); - if (substFormat === 1) { - return { - substFormat: 1, - coverage: this.parsePointer(Parser.coverage), - deltaGlyphId: this.parseUShort(), - }; - } else if (substFormat === 2) { - return { - substFormat: 2, - coverage: this.parsePointer(Parser.coverage), - substitute: this.parseOffset16List(), - }; - } - check.assert( - false, - "0x" + - start.toString(16) + - ": lookup type 1 format must be 1 or 2.", - ); - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#MS - subtableParsers[2] = function parseLookup2() { - var substFormat = this.parseUShort(); - check.argument( - substFormat === 1, - "GSUB Multiple Substitution Subtable identifier-format must be 1", - ); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - sequences: this.parseListOfLists(), - }; - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#AS - subtableParsers[3] = function parseLookup3() { - var substFormat = this.parseUShort(); - check.argument( - substFormat === 1, - "GSUB Alternate Substitution Subtable identifier-format must be 1", - ); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - alternateSets: this.parseListOfLists(), - }; - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#LS - subtableParsers[4] = function parseLookup4() { - var substFormat = this.parseUShort(); - check.argument( - substFormat === 1, - "GSUB ligature table identifier-format must be 1", - ); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - ligatureSets: this.parseListOfLists(function () { - return { - ligGlyph: this.parseUShort(), - components: this.parseUShortList(this.parseUShort() - 1), - }; - }), - }; - }; - var lookupRecordDesc = { - sequenceIndex: Parser.uShort, - lookupListIndex: Parser.uShort, - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CSF - subtableParsers[5] = function parseLookup5() { - var start = this.offset + this.relativeOffset; - var substFormat = this.parseUShort(); - if (substFormat === 1) { - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - ruleSets: this.parseListOfLists(function () { - var glyphCount = this.parseUShort(); - var substCount = this.parseUShort(); - return { - input: this.parseUShortList(glyphCount - 1), - lookupRecords: this.parseRecordList( - substCount, - lookupRecordDesc, - ), - }; - }), - }; - } else if (substFormat === 2) { - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - classDef: this.parsePointer(Parser.classDef), - classSets: this.parseListOfLists(function () { - var glyphCount = this.parseUShort(); - var substCount = this.parseUShort(); - return { - classes: this.parseUShortList(glyphCount - 1), - lookupRecords: this.parseRecordList( - substCount, - lookupRecordDesc, - ), - }; - }), - }; - } else if (substFormat === 3) { - var glyphCount = this.parseUShort(); - var substCount = this.parseUShort(); - return { - substFormat: substFormat, - coverages: this.parseList( - glyphCount, - Parser.pointer(Parser.coverage), - ), - lookupRecords: this.parseRecordList( - substCount, - lookupRecordDesc, - ), - }; - } - check.assert( - false, - "0x" + - start.toString(16) + - ": lookup type 5 format must be 1, 2 or 3.", - ); - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#CC - subtableParsers[6] = function parseLookup6() { - var start = this.offset + this.relativeOffset; - var substFormat = this.parseUShort(); - if (substFormat === 1) { - return { - substFormat: 1, - coverage: this.parsePointer(Parser.coverage), - chainRuleSets: this.parseListOfLists(function () { - return { - backtrack: this.parseUShortList(), - input: this.parseUShortList(this.parseShort() - 1), - lookahead: this.parseUShortList(), - lookupRecords: this.parseRecordList(lookupRecordDesc), - }; - }), - }; - } else if (substFormat === 2) { - return { - substFormat: 2, - coverage: this.parsePointer(Parser.coverage), - backtrackClassDef: this.parsePointer(Parser.classDef), - inputClassDef: this.parsePointer(Parser.classDef), - lookaheadClassDef: this.parsePointer(Parser.classDef), - chainClassSet: this.parseListOfLists(function () { - return { - backtrack: this.parseUShortList(), - input: this.parseUShortList(this.parseShort() - 1), - lookahead: this.parseUShortList(), - lookupRecords: this.parseRecordList(lookupRecordDesc), - }; - }), - }; - } else if (substFormat === 3) { - return { - substFormat: 3, - backtrackCoverage: this.parseList( - Parser.pointer(Parser.coverage), - ), - inputCoverage: this.parseList( - Parser.pointer(Parser.coverage), - ), - lookaheadCoverage: this.parseList( - Parser.pointer(Parser.coverage), - ), - lookupRecords: this.parseRecordList(lookupRecordDesc), - }; - } - check.assert( - false, - "0x" + - start.toString(16) + - ": lookup type 6 format must be 1, 2 or 3.", - ); - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#ES - subtableParsers[7] = function parseLookup7() { - // Extension Substitution subtable - var substFormat = this.parseUShort(); - check.argument( - substFormat === 1, - "GSUB Extension Substitution subtable identifier-format must be 1", - ); - var extensionLookupType = this.parseUShort(); - var extensionParser = new Parser( - this.data, - this.offset + this.parseULong(), - ); - return { - substFormat: 1, - lookupType: extensionLookupType, - extension: - subtableParsers[extensionLookupType].call(extensionParser), - }; - }; - // https://www.microsoft.com/typography/OTSPEC/GSUB.htm#RCCS - subtableParsers[8] = function parseLookup8() { - var substFormat = this.parseUShort(); - check.argument( - substFormat === 1, - "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1", - ); - return { - substFormat: substFormat, - coverage: this.parsePointer(Parser.coverage), - backtrackCoverage: this.parseList( - Parser.pointer(Parser.coverage), - ), - lookaheadCoverage: this.parseList( - Parser.pointer(Parser.coverage), - ), - substitutes: this.parseUShortList(), - }; - }; - // https://www.microsoft.com/typography/OTSPEC/gsub.htm - function parseGsubTable(data, start) { - start = start || 0; - var p = new Parser(data, start); - var tableVersion = p.parseVersion(1); - check.argument( - tableVersion === 1 || tableVersion === 1.1, - "Unsupported GSUB table version.", - ); - if (tableVersion === 1) { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers), - }; - } else { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers), - variations: p.parseFeatureVariationsList(), - }; - } - } // GSUB Writing ////////////////////////////////////////////// - - var subtableMakers = new Array(9); - subtableMakers[1] = function makeLookup1(subtable) { - if (subtable.substFormat === 1) { - return new table.Table("substitutionTable", [ - { - name: "substFormat", - type: "USHORT", - value: 1, - }, - { - name: "coverage", - type: "TABLE", - value: new table.Coverage(subtable.coverage), - }, - { - name: "deltaGlyphID", - type: "USHORT", - value: subtable.deltaGlyphId, - }, - ]); - } else { - return new table.Table( - "substitutionTable", - [ - { - name: "substFormat", - type: "USHORT", - value: 2, - }, - { - name: "coverage", - type: "TABLE", - value: new table.Coverage(subtable.coverage), - }, - ].concat( - table.ushortList("substitute", subtable.substitute), - ), - ); - } - check.fail("Lookup type 1 substFormat must be 1 or 2."); - }; - subtableMakers[3] = function makeLookup3(subtable) { - check.assert( - subtable.substFormat === 1, - "Lookup type 3 substFormat must be 1.", - ); - return new table.Table( - "substitutionTable", - [ - { - name: "substFormat", - type: "USHORT", - value: 1, - }, - { - name: "coverage", - type: "TABLE", - value: new table.Coverage(subtable.coverage), - }, - ].concat( - table.tableList( - "altSet", - subtable.alternateSets, - function (alternateSet) { - return new table.Table( - "alternateSetTable", - table.ushortList("alternate", alternateSet), - ); - }, - ), - ), - ); - }; - subtableMakers[4] = function makeLookup4(subtable) { - check.assert( - subtable.substFormat === 1, - "Lookup type 4 substFormat must be 1.", - ); - return new table.Table( - "substitutionTable", - [ - { - name: "substFormat", - type: "USHORT", - value: 1, - }, - { - name: "coverage", - type: "TABLE", - value: new table.Coverage(subtable.coverage), - }, - ].concat( - table.tableList( - "ligSet", - subtable.ligatureSets, - function (ligatureSet) { - return new table.Table( - "ligatureSetTable", - table.tableList( - "ligature", - ligatureSet, - function (ligature) { - return new table.Table( - "ligatureTable", - [ - { - name: "ligGlyph", - type: "USHORT", - value: ligature.ligGlyph, - }, - ].concat( - table.ushortList( - "component", - ligature.components, - ligature.components.length + 1, - ), - ), - ); - }, - ), - ); - }, - ), - ), - ); - }; - function makeGsubTable(gsub) { - return new table.Table("GSUB", [ - { - name: "version", - type: "ULONG", - value: 65536, - }, - { - name: "scripts", - type: "TABLE", - value: new table.ScriptList(gsub.scripts), - }, - { - name: "features", - type: "TABLE", - value: new table.FeatureList(gsub.features), - }, - { - name: "lookups", - type: "TABLE", - value: new table.LookupList(gsub.lookups, subtableMakers), - }, - ]); - } - var gsub = { - parse: parseGsubTable, - make: makeGsubTable, - }; - // The `GPOS` table contains kerning pairs, among other things. - // Parse the metadata `meta` table. - // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html - function parseMetaTable(data, start) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseULong(); - check.argument( - tableVersion === 1, - "Unsupported META table version.", - ); - p.parseULong(); // flags - currently unused and set to 0 - p.parseULong(); // tableOffset - var numDataMaps = p.parseULong(); - var tags = {}; - for (var i = 0; i < numDataMaps; i++) { - var tag = p.parseTag(); - var dataOffset = p.parseULong(); - var dataLength = p.parseULong(); - var text = decode.UTF8(data, start + dataOffset, dataLength); - tags[tag] = text; - } - return tags; - } - function makeMetaTable(tags) { - var numTags = Object.keys(tags).length; - var stringPool = ""; - var stringPoolOffset = 16 + numTags * 12; - var result = new table.Table("meta", [ - { - name: "version", - type: "ULONG", - value: 1, - }, - { - name: "flags", - type: "ULONG", - value: 0, - }, - { - name: "offset", - type: "ULONG", - value: stringPoolOffset, - }, - { - name: "numTags", - type: "ULONG", - value: numTags, - }, - ]); - for (var tag in tags) { - var pos = stringPool.length; - stringPool += tags[tag]; - result.fields.push({ - name: "tag " + tag, - type: "TAG", - value: tag, - }); - result.fields.push({ - name: "offset " + tag, - type: "ULONG", - value: stringPoolOffset + pos, - }); - result.fields.push({ - name: "length " + tag, - type: "ULONG", - value: tags[tag].length, - }); - } - result.fields.push({ - name: "stringPool", - type: "CHARARRAY", - value: stringPool, - }); - return result; - } - var meta = { - parse: parseMetaTable, - make: makeMetaTable, - }; - // The `sfnt` wrapper provides organization for the tables in the font. - function log2(v) { - return (Math.log(v) / Math.log(2)) | 0; - } - function computeCheckSum(bytes) { - while (bytes.length % 4 !== 0) { - bytes.push(0); - } - var sum = 0; - for (var i = 0; i < bytes.length; i += 4) { - sum += - (bytes[i] << 24) + - (bytes[i + 1] << 16) + - (bytes[i + 2] << 8) + - bytes[i + 3]; - } - sum %= Math.pow(2, 32); - return sum; - } - function makeTableRecord(tag, checkSum, offset, length) { - return new table.Record("Table Record", [ - { - name: "tag", - type: "TAG", - value: tag !== undefined ? tag : "", - }, - { - name: "checkSum", - type: "ULONG", - value: checkSum !== undefined ? checkSum : 0, - }, - { - name: "offset", - type: "ULONG", - value: offset !== undefined ? offset : 0, - }, - { - name: "length", - type: "ULONG", - value: length !== undefined ? length : 0, - }, - ]); - } - function makeSfntTable(tables) { - var sfnt = new table.Table("sfnt", [ - { - name: "version", - type: "TAG", - value: "OTTO", - }, - { - name: "numTables", - type: "USHORT", - value: 0, - }, - { - name: "searchRange", - type: "USHORT", - value: 0, - }, - { - name: "entrySelector", - type: "USHORT", - value: 0, - }, - { - name: "rangeShift", - type: "USHORT", - value: 0, - }, - ]); - sfnt.tables = tables; - sfnt.numTables = tables.length; - var highestPowerOf2 = Math.pow(2, log2(sfnt.numTables)); - sfnt.searchRange = 16 * highestPowerOf2; - sfnt.entrySelector = log2(highestPowerOf2); - sfnt.rangeShift = sfnt.numTables * 16 - sfnt.searchRange; - var recordFields = []; - var tableFields = []; - var offset = - sfnt.sizeOf() + makeTableRecord().sizeOf() * sfnt.numTables; - while (offset % 4 !== 0) { - offset += 1; - tableFields.push({ - name: "padding", - type: "BYTE", - value: 0, - }); - } - for (var i = 0; i < tables.length; i += 1) { - var t = tables[i]; - check.argument( - t.tableName.length === 4, - "Table name" + t.tableName + " is invalid.", - ); - var tableLength = t.sizeOf(); - var tableRecord = makeTableRecord( - t.tableName, - computeCheckSum(t.encode()), - offset, - tableLength, - ); - recordFields.push({ - name: tableRecord.tag + " Table Record", - type: "RECORD", - value: tableRecord, - }); - tableFields.push({ - name: t.tableName + " table", - type: "RECORD", - value: t, - }); - offset += tableLength; - check.argument( - !isNaN(offset), - "Something went wrong calculating the offset.", - ); - while (offset % 4 !== 0) { - offset += 1; - tableFields.push({ - name: "padding", - type: "BYTE", - value: 0, - }); - } - } // Table records need to be sorted alphabetically. - - recordFields.sort(function (r1, r2) { - if (r1.value.tag > r2.value.tag) { - return 1; - } else { - return -1; - } - }); - sfnt.fields = sfnt.fields.concat(recordFields); - sfnt.fields = sfnt.fields.concat(tableFields); - return sfnt; - } // Get the metrics for a character. If the string has more than one character - // this function returns metrics for the first available character. - // You can provide optional fallback metrics if no characters are available. - - function metricsForChar(font, chars, notFoundMetrics) { - for (var i = 0; i < chars.length; i += 1) { - var glyphIndex = font.charToGlyphIndex(chars[i]); - if (glyphIndex > 0) { - var glyph = font.glyphs.get(glyphIndex); - return glyph.getMetrics(); - } - } - return notFoundMetrics; - } - function average(vs) { - var sum = 0; - for (var i = 0; i < vs.length; i += 1) { - sum += vs[i]; - } - return sum / vs.length; - } // Convert the font object to a SFNT data structure. - // This structure contains all the necessary tables and metadata to create a binary OTF file. - - function fontToSfntTable(font) { - var xMins = []; - var yMins = []; - var xMaxs = []; - var yMaxs = []; - var advanceWidths = []; - var leftSideBearings = []; - var rightSideBearings = []; - var firstCharIndex; - var lastCharIndex = 0; - var ulUnicodeRange1 = 0; - var ulUnicodeRange2 = 0; - var ulUnicodeRange3 = 0; - var ulUnicodeRange4 = 0; - for (var i = 0; i < font.glyphs.length; i += 1) { - var glyph = font.glyphs.get(i); - var unicode = glyph.unicode | 0; - if (isNaN(glyph.advanceWidth)) { - throw new Error( - "Glyph " + - glyph.name + - " (" + - i + - "): advanceWidth is not a number.", - ); - } - if ( - firstCharIndex > unicode || - firstCharIndex === undefined - ) { - // ignore .notdef char - if (unicode > 0) { - firstCharIndex = unicode; - } - } - if (lastCharIndex < unicode) { - lastCharIndex = unicode; - } - var position = os2.getUnicodeRange(unicode); - if (position < 32) { - ulUnicodeRange1 |= 1 << position; - } else if (position < 64) { - ulUnicodeRange2 |= 1 << (position - 32); - } else if (position < 96) { - ulUnicodeRange3 |= 1 << (position - 64); - } else if (position < 123) { - ulUnicodeRange4 |= 1 << (position - 96); - } else { - throw new Error( - "Unicode ranges bits > 123 are reserved for internal usage", - ); - } // Skip non-important characters. - - if (glyph.name === ".notdef") { - continue; - } - var metrics = glyph.getMetrics(); - xMins.push(metrics.xMin); - yMins.push(metrics.yMin); - xMaxs.push(metrics.xMax); - yMaxs.push(metrics.yMax); - leftSideBearings.push(metrics.leftSideBearing); - rightSideBearings.push(metrics.rightSideBearing); - advanceWidths.push(glyph.advanceWidth); - } - var globals = { - xMin: Math.min.apply(null, xMins), - yMin: Math.min.apply(null, yMins), - xMax: Math.max.apply(null, xMaxs), - yMax: Math.max.apply(null, yMaxs), - advanceWidthMax: Math.max.apply(null, advanceWidths), - advanceWidthAvg: average(advanceWidths), - minLeftSideBearing: Math.min.apply(null, leftSideBearings), - maxLeftSideBearing: Math.max.apply(null, leftSideBearings), - minRightSideBearing: Math.min.apply(null, rightSideBearings), - }; - globals.ascender = font.ascender; - globals.descender = font.descender; - var headTable = head.make({ - flags: 3, - // 00000011 (baseline for font at y=0; left sidebearing point at x=0) - unitsPerEm: font.unitsPerEm, - xMin: globals.xMin, - yMin: globals.yMin, - xMax: globals.xMax, - yMax: globals.yMax, - lowestRecPPEM: 3, - createdTimestamp: font.createdTimestamp, - }); - var hheaTable = hhea.make({ - ascender: globals.ascender, - descender: globals.descender, - advanceWidthMax: globals.advanceWidthMax, - minLeftSideBearing: globals.minLeftSideBearing, - minRightSideBearing: globals.minRightSideBearing, - xMaxExtent: - globals.maxLeftSideBearing + (globals.xMax - globals.xMin), - numberOfHMetrics: font.glyphs.length, - }); - var maxpTable = maxp.make(font.glyphs.length); - var os2Table = os2.make({ - xAvgCharWidth: Math.round(globals.advanceWidthAvg), - usWeightClass: font.tables.os2.usWeightClass, - usWidthClass: font.tables.os2.usWidthClass, - usFirstCharIndex: firstCharIndex, - usLastCharIndex: lastCharIndex, - ulUnicodeRange1: ulUnicodeRange1, - ulUnicodeRange2: ulUnicodeRange2, - ulUnicodeRange3: ulUnicodeRange3, - ulUnicodeRange4: ulUnicodeRange4, - fsSelection: font.tables.os2.fsSelection, - // REGULAR - // See http://typophile.com/node/13081 for more info on vertical metrics. - // We get metrics for typical characters (such as "x" for xHeight). - // We provide some fallback characters if characters are unavailable: their - // ordering was chosen experimentally. - sTypoAscender: globals.ascender, - sTypoDescender: globals.descender, - sTypoLineGap: 0, - usWinAscent: globals.yMax, - usWinDescent: Math.abs(globals.yMin), - ulCodePageRange1: 1, - // FIXME: hard-code Latin 1 support for now - sxHeight: metricsForChar(font, "xyvw", { - yMax: Math.round(globals.ascender / 2), - }).yMax, - sCapHeight: metricsForChar( - font, - "HIKLEFJMNTZBDPRAGOQSUVWXY", - globals, - ).yMax, - usDefaultChar: font.hasChar(" ") ? 32 : 0, - // Use space as the default character, if available. - usBreakChar: font.hasChar(" ") ? 32 : 0, // Use space as the break character, if available. - }); - var hmtxTable = hmtx.make(font.glyphs); - var cmapTable = cmap.make(font.glyphs); - var englishFamilyName = font.getEnglishName("fontFamily"); - var englishStyleName = font.getEnglishName("fontSubfamily"); - var englishFullName = - englishFamilyName + " " + englishStyleName; - var postScriptName = font.getEnglishName("postScriptName"); - if (!postScriptName) { - postScriptName = - englishFamilyName.replace(/\s/g, "") + - "-" + - englishStyleName; - } - var names = {}; - for (var n in font.names) { - names[n] = font.names[n]; - } - if (!names.uniqueID) { - names.uniqueID = { - en: - font.getEnglishName("manufacturer") + - ":" + - englishFullName, - }; - } - if (!names.postScriptName) { - names.postScriptName = { - en: postScriptName, - }; - } - if (!names.preferredFamily) { - names.preferredFamily = font.names.fontFamily; - } - if (!names.preferredSubfamily) { - names.preferredSubfamily = font.names.fontSubfamily; - } - var languageTags = []; - var nameTable = _name.make(names, languageTags); - var ltagTable = - languageTags.length > 0 ? ltag.make(languageTags) : undefined; - var postTable = post.make(); - var cffTable = cff.make(font.glyphs, { - version: font.getEnglishName("version"), - fullName: englishFullName, - familyName: englishFamilyName, - weightName: englishStyleName, - postScriptName: postScriptName, - unitsPerEm: font.unitsPerEm, - fontBBox: [ - 0, - globals.yMin, - globals.ascender, - globals.advanceWidthMax, - ], - }); - var metaTable = - font.metas && Object.keys(font.metas).length > 0 - ? meta.make(font.metas) - : undefined; - // The order does not matter because makeSfntTable() will sort them. - var tables = [ - headTable, - hheaTable, - maxpTable, - os2Table, - nameTable, - cmapTable, - postTable, - cffTable, - hmtxTable, - ]; - if (ltagTable) { - tables.push(ltagTable); - } // Optional tables - - if (font.tables.gsub) { - tables.push(gsub.make(font.tables.gsub)); - } - if (metaTable) { - tables.push(metaTable); - } - var sfntTable = makeSfntTable(tables); - // Compute the font's checkSum and store it in head.checkSumAdjustment. - var bytes = sfntTable.encode(); - var checkSum = computeCheckSum(bytes); - var tableFields = sfntTable.fields; - var checkSumAdjusted = false; - for (var i$1 = 0; i$1 < tableFields.length; i$1 += 1) { - if (tableFields[i$1].name === "head table") { - tableFields[i$1].value.checkSumAdjustment = - 2981146554 - checkSum; - checkSumAdjusted = true; - break; - } - } - if (!checkSumAdjusted) { - throw new Error( - "Could not find head table with checkSum to adjust.", - ); - } - return sfntTable; - } - var sfnt = { - make: makeSfntTable, - fontToTable: fontToSfntTable, - computeCheckSum: computeCheckSum, - }; - // The Layout object is the prototype of Substitution objects, and provides - function searchTag(arr, tag) { - /* jshint bitwise: false */ - var imin = 0; - var imax = arr.length - 1; - while (imin <= imax) { - var imid = (imin + imax) >>> 1; - var val = arr[imid].tag; - if (val === tag) { - return imid; - } else if (val < tag) { - imin = imid + 1; - } else { - imax = imid - 1; - } - } // Not found: return -1-insertion point - - return -imin - 1; - } - function binSearch(arr, value) { - /* jshint bitwise: false */ - var imin = 0; - var imax = arr.length - 1; - while (imin <= imax) { - var imid = (imin + imax) >>> 1; - var val = arr[imid]; - if (val === value) { - return imid; - } else if (val < value) { - imin = imid + 1; - } else { - imax = imid - 1; - } - } // Not found: return -1-insertion point - - return -imin - 1; - } // binary search in a list of ranges (coverage, class definition) - - function searchRange(ranges, value) { - // jshint bitwise: false - var range; - var imin = 0; - var imax = ranges.length - 1; - while (imin <= imax) { - var imid = (imin + imax) >>> 1; - range = ranges[imid]; - var start = range.start; - if (start === value) { - return range; - } else if (start < value) { - imin = imid + 1; - } else { - imax = imid - 1; - } - } - if (imin > 0) { - range = ranges[imin - 1]; - if (value > range.end) { - return 0; - } - return range; - } - } /** - * @exports opentype.Layout - * @class - */ - - function Layout(font, tableName) { - this.font = font; - this.tableName = tableName; - } - Layout.prototype = { - /** - * Binary search an object by "tag" property - * @instance - * @function searchTag - * @memberof opentype.Layout - * @param {Array} arr - * @param {string} tag - * @return {number} - */ - searchTag: searchTag, - /** - * Binary search in a list of numbers - * @instance - * @function binSearch - * @memberof opentype.Layout - * @param {Array} arr - * @param {number} value - * @return {number} - */ - binSearch: binSearch, - /** - * Get or create the Layout table (GSUB, GPOS etc). - * @param {boolean} create - Whether to create a new one. - * @return {Object} The GSUB or GPOS table. - */ - getTable: function (create) { - var layout = this.font.tables[this.tableName]; - if (!layout && create) { - layout = this.font.tables[this.tableName] = - this.createDefaultTable(); - } - return layout; - }, - /** - * Returns all scripts in the substitution table. - * @instance - * @return {Array} - */ - getScriptNames: function () { - var layout = this.getTable(); - if (!layout) { - return []; - } - return layout.scripts.map(function (script) { - return script.tag; - }); - }, - /** - * Returns the best bet for a script name. - * Returns 'DFLT' if it exists. - * If not, returns 'latn' if it exists. - * If neither exist, returns undefined. - */ - getDefaultScriptName: function () { - var layout = this.getTable(); - if (!layout) { - return; - } - var hasLatn = false; - for (var i = 0; i < layout.scripts.length; i++) { - var name = layout.scripts[i].tag; - if (name === "DFLT") { - return name; - } - if (name === "latn") { - hasLatn = true; - } - } - if (hasLatn) { - return "latn"; - } - }, - /** - * Returns all LangSysRecords in the given script. - * @instance - * @param {string} [script='DFLT'] - * @param {boolean} create - forces the creation of this script table if it doesn't exist. - * @return {Object} An object with tag and script properties. - */ - getScriptTable: function (script, create) { - var layout = this.getTable(create); - if (layout) { - script = script || "DFLT"; - var scripts = layout.scripts; - var pos = searchTag(layout.scripts, script); - if (pos >= 0) { - return scripts[pos].script; - } else if (create) { - var scr = { - tag: script, - script: { - defaultLangSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [], - }, - langSysRecords: [], - }, - }; - scripts.splice(-1 - pos, 0, scr); - return scr.script; - } - } - }, - /** - * Returns a language system table - * @instance - * @param {string} [script='DFLT'] - * @param {string} [language='dlft'] - * @param {boolean} create - forces the creation of this langSysTable if it doesn't exist. - * @return {Object} - */ - getLangSysTable: function (script, language, create) { - var scriptTable = this.getScriptTable(script, create); - if (scriptTable) { - if ( - !language || - language === "dflt" || - language === "DFLT" - ) { - return scriptTable.defaultLangSys; - } - var pos = searchTag(scriptTable.langSysRecords, language); - if (pos >= 0) { - return scriptTable.langSysRecords[pos].langSys; - } else if (create) { - var langSysRecord = { - tag: language, - langSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [], - }, - }; - scriptTable.langSysRecords.splice( - -1 - pos, - 0, - langSysRecord, - ); - return langSysRecord.langSys; - } - } - }, - /** - * Get a specific feature table. - * @instance - * @param {string} [script='DFLT'] - * @param {string} [language='dlft'] - * @param {string} feature - One of the codes listed at https://www.microsoft.com/typography/OTSPEC/featurelist.htm - * @param {boolean} create - forces the creation of the feature table if it doesn't exist. - * @return {Object} - */ - getFeatureTable: function (script, language, feature, create) { - var langSysTable = this.getLangSysTable( - script, - language, - create, - ); - if (langSysTable) { - var featureRecord; - var featIndexes = langSysTable.featureIndexes; - var allFeatures = this.font.tables[this.tableName].features; - // The FeatureIndex array of indices is in arbitrary order, - // even if allFeatures is sorted alphabetically by feature tag. - for (var i = 0; i < featIndexes.length; i++) { - featureRecord = allFeatures[featIndexes[i]]; - if (featureRecord.tag === feature) { - return featureRecord.feature; - } - } - if (create) { - var index = allFeatures.length; - // Automatic ordering of features would require to shift feature indexes in the script list. - check.assert( - index === 0 || feature >= allFeatures[index - 1].tag, - "Features must be added in alphabetical order.", - ); - featureRecord = { - tag: feature, - feature: { - params: 0, - lookupListIndexes: [], - }, - }; - allFeatures.push(featureRecord); - featIndexes.push(index); - return featureRecord.feature; - } - } - }, - /** - * Get the lookup tables of a given type for a script/language/feature. - * @instance - * @param {string} [script='DFLT'] - * @param {string} [language='dlft'] - * @param {string} feature - 4-letter feature code - * @param {number} lookupType - 1 to 9 - * @param {boolean} create - forces the creation of the lookup table if it doesn't exist, with no subtables. - * @return {Object[]} - */ - getLookupTables: function ( - script, - language, - feature, - lookupType, - create, - ) { - var featureTable = this.getFeatureTable( - script, - language, - feature, - create, - ); - var tables = []; - if (featureTable) { - var lookupTable; - var lookupListIndexes = featureTable.lookupListIndexes; - var allLookups = this.font.tables[this.tableName].lookups; - // lookupListIndexes are in no particular order, so use naive search. - for (var i = 0; i < lookupListIndexes.length; i++) { - lookupTable = allLookups[lookupListIndexes[i]]; - if (lookupTable.lookupType === lookupType) { - tables.push(lookupTable); - } - } - if (tables.length === 0 && create) { - lookupTable = { - lookupType: lookupType, - lookupFlag: 0, - subtables: [], - markFilteringSet: undefined, - }; - var index = allLookups.length; - allLookups.push(lookupTable); - lookupListIndexes.push(index); - return [lookupTable]; - } - } - return tables; - }, - /** - * Find a glyph in a class definition table - * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#class-definition-table - * @param {object} classDefTable - an OpenType Layout class definition table - * @param {number} glyphIndex - the index of the glyph to find - * @returns {number} -1 if not found - */ - getGlyphClass: function (classDefTable, glyphIndex) { - switch (classDefTable.format) { - case 1: - if ( - classDefTable.startGlyph <= glyphIndex && - glyphIndex < - classDefTable.startGlyph + - classDefTable.classes.length - ) { - return classDefTable.classes[ - glyphIndex - classDefTable.startGlyph - ]; - } - return 0; - case 2: - var range = searchRange(classDefTable.ranges, glyphIndex); - return range ? range.classId : 0; - } - }, - /** - * Find a glyph in a coverage table - * https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#coverage-table - * @param {object} coverageTable - an OpenType Layout coverage table - * @param {number} glyphIndex - the index of the glyph to find - * @returns {number} -1 if not found - */ - getCoverageIndex: function (coverageTable, glyphIndex) { - switch (coverageTable.format) { - case 1: - var index = binSearch(coverageTable.glyphs, glyphIndex); - return index >= 0 ? index : -1; - case 2: - var range = searchRange(coverageTable.ranges, glyphIndex); - return range - ? range.index + glyphIndex - range.start - : -1; - } - }, - /** - * Returns the list of glyph indexes of a coverage table. - * Format 1: the list is stored raw - * Format 2: compact list as range records. - * @instance - * @param {Object} coverageTable - * @return {Array} - */ - expandCoverage: function (coverageTable) { - if (coverageTable.format === 1) { - return coverageTable.glyphs; - } else { - var glyphs = []; - var ranges = coverageTable.ranges; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - var start = range.start; - var end = range.end; - for (var j = start; j <= end; j++) { - glyphs.push(j); - } - } - return glyphs; - } - }, - }; - // The Position object provides utility methods to manipulate - /** - * @exports opentype.Position - * @class - * @extends opentype.Layout - * @param {opentype.Font} - * @constructor - */ - function Position(font) { - Layout.call(this, font, "gpos"); - } - Position.prototype = Layout.prototype; - /** - * Init some data for faster and easier access later. - */ - Position.prototype.init = function () { - var script = this.getDefaultScriptName(); - this.defaultKerningTables = this.getKerningTables(script); - }; - /** - * Find a glyph pair in a list of lookup tables of type 2 and retrieve the xAdvance kerning value. - * - * @param {integer} leftIndex - left glyph index - * @param {integer} rightIndex - right glyph index - * @returns {integer} - */ - Position.prototype.getKerningValue = function ( - kerningLookups, - leftIndex, - rightIndex, - ) { - var this$1 = this; - for (var i = 0; i < kerningLookups.length; i++) { - var subtables = kerningLookups[i].subtables; - for (var j = 0; j < subtables.length; j++) { - var subtable = subtables[j]; - var covIndex = this$1.getCoverageIndex( - subtable.coverage, - leftIndex, - ); - if (covIndex < 0) { - continue; - } - switch (subtable.posFormat) { - case 1: - // Search Pair Adjustment Positioning Format 1 - var pairSet = subtable.pairSets[covIndex]; - for (var k = 0; k < pairSet.length; k++) { - var pair = pairSet[k]; - if (pair.secondGlyph === rightIndex) { - return (pair.value1 && pair.value1.xAdvance) || 0; - } - } - break; - // left glyph found, not right glyph - try next subtable - case 2: - // Search Pair Adjustment Positioning Format 2 - var class1 = this$1.getGlyphClass( - subtable.classDef1, - leftIndex, - ); - var class2 = this$1.getGlyphClass( - subtable.classDef2, - rightIndex, - ); - var pair$1 = subtable.classRecords[class1][class2]; - return (pair$1.value1 && pair$1.value1.xAdvance) || 0; - } - } - } - return 0; - }; - /** - * List all kerning lookup tables. - * - * @param {string} [script='DFLT'] - use font.position.getDefaultScriptName() for a better default value - * @param {string} [language='dflt'] - * @return {object[]} The list of kerning lookup tables (may be empty), or undefined if there is no GPOS table (and we should use the kern table) - */ - Position.prototype.getKerningTables = function ( - script, - language, - ) { - if (this.font.tables.gpos) { - return this.getLookupTables(script, language, "kern", 2); - } - }; - // The Substitution object provides utility methods to manipulate - /** - * @exports opentype.Substitution - * @class - * @extends opentype.Layout - * @param {opentype.Font} - * @constructor - */ - function Substitution(font) { - Layout.call(this, font, "gsub"); - } // Check if 2 arrays of primitives are equal. - - function arraysEqual(ar1, ar2) { - var n = ar1.length; - if (n !== ar2.length) { - return false; - } - for (var i = 0; i < n; i++) { - if (ar1[i] !== ar2[i]) { - return false; - } - } - return true; - } // Find the first subtable of a lookup table in a particular format. - - function getSubstFormat(lookupTable, format, defaultSubtable) { - var subtables = lookupTable.subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - if (subtable.substFormat === format) { - return subtable; - } - } - if (defaultSubtable) { - subtables.push(defaultSubtable); - return defaultSubtable; - } - return undefined; - } - Substitution.prototype = Layout.prototype; - /** - * Create a default GSUB table. - * @return {Object} gsub - The GSUB table. - */ - Substitution.prototype.createDefaultTable = function () { - // Generate a default empty GSUB table with just a DFLT script and dflt lang sys. - return { - version: 1, - scripts: [ - { - tag: "DFLT", - script: { - defaultLangSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [], - }, - langSysRecords: [], - }, - }, - ], - features: [], - lookups: [], - }; - }; - /** - * List all single substitutions (lookup type 1) for a given script, language, and feature. - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @param {string} feature - 4-character feature name ('aalt', 'salt', 'ss01'...) - * @return {Array} substitutions - The list of substitutions. - */ - Substitution.prototype.getSingle = function ( - feature, - script, - language, - ) { - var this$1 = this; - var substitutions = []; - var lookupTables = this.getLookupTables( - script, - language, - feature, - 1, - ); - for (var idx = 0; idx < lookupTables.length; idx++) { - var subtables = lookupTables[idx].subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - var glyphs = this$1.expandCoverage(subtable.coverage); - var j = void 0; - if (subtable.substFormat === 1) { - var delta = subtable.deltaGlyphId; - for (j = 0; j < glyphs.length; j++) { - var glyph = glyphs[j]; - substitutions.push({ - sub: glyph, - by: glyph + delta, - }); - } - } else { - var substitute = subtable.substitute; - for (j = 0; j < glyphs.length; j++) { - substitutions.push({ - sub: glyphs[j], - by: substitute[j], - }); - } - } - } - } - return substitutions; - }; - /** - * List all alternates (lookup type 3) for a given script, language, and feature. - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @param {string} feature - 4-character feature name ('aalt', 'salt'...) - * @return {Array} alternates - The list of alternates - */ - Substitution.prototype.getAlternates = function ( - feature, - script, - language, - ) { - var this$1 = this; - var alternates = []; - var lookupTables = this.getLookupTables( - script, - language, - feature, - 3, - ); - for (var idx = 0; idx < lookupTables.length; idx++) { - var subtables = lookupTables[idx].subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - var glyphs = this$1.expandCoverage(subtable.coverage); - var alternateSets = subtable.alternateSets; - for (var j = 0; j < glyphs.length; j++) { - alternates.push({ - sub: glyphs[j], - by: alternateSets[j], - }); - } - } - } - return alternates; - }; - /** - * List all ligatures (lookup type 4) for a given script, language, and feature. - * The result is an array of ligature objects like { sub: [ids], by: id } - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @return {Array} ligatures - The list of ligatures. - */ - Substitution.prototype.getLigatures = function ( - feature, - script, - language, - ) { - var this$1 = this; - var ligatures = []; - var lookupTables = this.getLookupTables( - script, - language, - feature, - 4, - ); - for (var idx = 0; idx < lookupTables.length; idx++) { - var subtables = lookupTables[idx].subtables; - for (var i = 0; i < subtables.length; i++) { - var subtable = subtables[i]; - var glyphs = this$1.expandCoverage(subtable.coverage); - var ligatureSets = subtable.ligatureSets; - for (var j = 0; j < glyphs.length; j++) { - var startGlyph = glyphs[j]; - var ligSet = ligatureSets[j]; - for (var k = 0; k < ligSet.length; k++) { - var lig = ligSet[k]; - ligatures.push({ - sub: [startGlyph].concat(lig.components), - by: lig.ligGlyph, - }); - } - } - } - } - return ligatures; - }; - /** - * Add or modify a single substitution (lookup type 1) - * Format 2, more flexible, is always used. - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {Object} substitution - { sub: id, delta: number } for format 1 or { sub: id, by: id } for format 2. - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.addSingle = function ( - feature, - substitution, - script, - language, - ) { - var lookupTable = this.getLookupTables( - script, - language, - feature, - 1, - true, - )[0]; - var subtable = getSubstFormat(lookupTable, 2, { - // lookup type 1 subtable, format 2, coverage format 1 - substFormat: 2, - coverage: { - format: 1, - glyphs: [], - }, - substitute: [], - }); - check.assert( - subtable.coverage.format === 1, - "Ligature: unable to modify coverage table format " + - subtable.coverage.format, - ); - var coverageGlyph = substitution.sub; - var pos = this.binSearch( - subtable.coverage.glyphs, - coverageGlyph, - ); - if (pos < 0) { - pos = -1 - pos; - subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); - subtable.substitute.splice(pos, 0, 0); - } - subtable.substitute[pos] = substitution.by; - }; - /** - * Add or modify an alternate substitution (lookup type 1) - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {Object} substitution - { sub: id, by: [ids] } - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.addAlternate = function ( - feature, - substitution, - script, - language, - ) { - var lookupTable = this.getLookupTables( - script, - language, - feature, - 3, - true, - )[0]; - var subtable = getSubstFormat(lookupTable, 1, { - // lookup type 3 subtable, format 1, coverage format 1 - substFormat: 1, - coverage: { - format: 1, - glyphs: [], - }, - alternateSets: [], - }); - check.assert( - subtable.coverage.format === 1, - "Ligature: unable to modify coverage table format " + - subtable.coverage.format, - ); - var coverageGlyph = substitution.sub; - var pos = this.binSearch( - subtable.coverage.glyphs, - coverageGlyph, - ); - if (pos < 0) { - pos = -1 - pos; - subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); - subtable.alternateSets.splice(pos, 0, 0); - } - subtable.alternateSets[pos] = substitution.by; - }; - /** - * Add a ligature (lookup type 4) - * Ligatures with more components must be stored ahead of those with fewer components in order to be found - * @param {string} feature - 4-letter feature name ('liga', 'rlig', 'dlig'...) - * @param {Object} ligature - { sub: [ids], by: id } - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.addLigature = function ( - feature, - ligature, - script, - language, - ) { - var lookupTable = this.getLookupTables( - script, - language, - feature, - 4, - true, - )[0]; - var subtable = lookupTable.subtables[0]; - if (!subtable) { - subtable = { - // lookup type 4 subtable, format 1, coverage format 1 - substFormat: 1, - coverage: { - format: 1, - glyphs: [], - }, - ligatureSets: [], - }; - lookupTable.subtables[0] = subtable; - } - check.assert( - subtable.coverage.format === 1, - "Ligature: unable to modify coverage table format " + - subtable.coverage.format, - ); - var coverageGlyph = ligature.sub[0]; - var ligComponents = ligature.sub.slice(1); - var ligatureTable = { - ligGlyph: ligature.by, - components: ligComponents, - }; - var pos = this.binSearch( - subtable.coverage.glyphs, - coverageGlyph, - ); - if (pos >= 0) { - // ligatureSet already exists - var ligatureSet = subtable.ligatureSets[pos]; - for (var i = 0; i < ligatureSet.length; i++) { - // If ligature already exists, return. - if (arraysEqual(ligatureSet[i].components, ligComponents)) { - return; - } - } // ligature does not exist: add it. - - ligatureSet.push(ligatureTable); - } else { - // Create a new ligatureSet and add coverage for the first glyph. - pos = -1 - pos; - subtable.coverage.glyphs.splice(pos, 0, coverageGlyph); - subtable.ligatureSets.splice(pos, 0, [ligatureTable]); - } - }; - /** - * List all feature data for a given script and language. - * @param {string} feature - 4-letter feature name - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - * @return {Array} substitutions - The list of substitutions. - */ - Substitution.prototype.getFeature = function ( - feature, - script, - language, - ) { - if (/ss\d\d/.test(feature)) { - // ss01 - ss20 - return this.getSingle(feature, script, language); - } - switch (feature) { - case "aalt": - case "salt": - return this.getSingle(feature, script, language).concat( - this.getAlternates(feature, script, language), - ); - case "dlig": - case "liga": - case "rlig": - return this.getLigatures(feature, script, language); - } - return undefined; - }; - /** - * Add a substitution to a feature for a given script and language. - * @param {string} feature - 4-letter feature name - * @param {Object} sub - the substitution to add (an object like { sub: id or [ids], by: id or [ids] }) - * @param {string} [script='DFLT'] - * @param {string} [language='dflt'] - */ - Substitution.prototype.add = function ( - feature, - sub, - script, - language, - ) { - if (/ss\d\d/.test(feature)) { - // ss01 - ss20 - return this.addSingle(feature, sub, script, language); - } - switch (feature) { - case "aalt": - case "salt": - if (typeof sub.by === "number") { - return this.addSingle(feature, sub, script, language); - } - return this.addAlternate(feature, sub, script, language); - case "dlig": - case "liga": - case "rlig": - return this.addLigature(feature, sub, script, language); - } - return undefined; - }; - function isBrowser() { - return typeof window !== "undefined"; - } - function nodeBufferToArrayBuffer(buffer) { - var ab = new ArrayBuffer(buffer.length); - var view = new Uint8Array(ab); - for (var i = 0; i < buffer.length; ++i) { - view[i] = buffer[i]; - } - return ab; - } - function arrayBufferToNodeBuffer(ab) { - var buffer = new Buffer(ab.byteLength); - var view = new Uint8Array(ab); - for (var i = 0; i < buffer.length; ++i) { - buffer[i] = view[i]; - } - return buffer; - } - function checkArgument(expression, message) { - if (!expression) { - throw message; - } - } // The `glyf` table describes the glyphs in TrueType outline format. - // Parse the coordinate data for a glyph. - - function parseGlyphCoordinate( - p, - flag, - previousValue, - shortVectorBitMask, - sameBitMask, - ) { - var v; - if ((flag & shortVectorBitMask) > 0) { - // The coordinate is 1 byte long. - v = p.parseByte(); - // The `same` bit is re-used for short values to signify the sign of the value. - if ((flag & sameBitMask) === 0) { - v = -v; - } - v = previousValue + v; - } else { - // The coordinate is 2 bytes long. - // If the `same` bit is set, the coordinate is the same as the previous coordinate. - if ((flag & sameBitMask) > 0) { - v = previousValue; - } else { - // Parse the coordinate as a signed 16-bit delta value. - v = previousValue + p.parseShort(); - } - } - return v; - } // Parse a TrueType glyph. - - function parseGlyph(glyph, data, start) { - var p = new parse.Parser(data, start); - glyph.numberOfContours = p.parseShort(); - glyph._xMin = p.parseShort(); - glyph._yMin = p.parseShort(); - glyph._xMax = p.parseShort(); - glyph._yMax = p.parseShort(); - var flags; - var flag; - if (glyph.numberOfContours > 0) { - // This glyph is not a composite. - var endPointIndices = (glyph.endPointIndices = []); - for (var i = 0; i < glyph.numberOfContours; i += 1) { - endPointIndices.push(p.parseUShort()); - } - glyph.instructionLength = p.parseUShort(); - glyph.instructions = []; - for (var i$1 = 0; i$1 < glyph.instructionLength; i$1 += 1) { - glyph.instructions.push(p.parseByte()); - } - var numberOfCoordinates = - endPointIndices[endPointIndices.length - 1] + 1; - flags = []; - for (var i$2 = 0; i$2 < numberOfCoordinates; i$2 += 1) { - flag = p.parseByte(); - flags.push(flag); - // If bit 3 is set, we repeat this flag n times, where n is the next byte. - if ((flag & 8) > 0) { - var repeatCount = p.parseByte(); - for (var j = 0; j < repeatCount; j += 1) { - flags.push(flag); - i$2 += 1; - } - } - } - check.argument( - flags.length === numberOfCoordinates, - "Bad flags.", - ); - if (endPointIndices.length > 0) { - var points = []; - var point; - // X/Y coordinates are relative to the previous point, except for the first point which is relative to 0,0. - if (numberOfCoordinates > 0) { - for (var i$3 = 0; i$3 < numberOfCoordinates; i$3 += 1) { - flag = flags[i$3]; - point = {}; - point.onCurve = !!(flag & 1); - point.lastPointOfContour = - endPointIndices.indexOf(i$3) >= 0; - points.push(point); - } - var px = 0; - for (var i$4 = 0; i$4 < numberOfCoordinates; i$4 += 1) { - flag = flags[i$4]; - point = points[i$4]; - point.x = parseGlyphCoordinate(p, flag, px, 2, 16); - px = point.x; - } - var py = 0; - for (var i$5 = 0; i$5 < numberOfCoordinates; i$5 += 1) { - flag = flags[i$5]; - point = points[i$5]; - point.y = parseGlyphCoordinate(p, flag, py, 4, 32); - py = point.y; - } - } - glyph.points = points; - } else { - glyph.points = []; - } - } else if (glyph.numberOfContours === 0) { - glyph.points = []; - } else { - glyph.isComposite = true; - glyph.points = []; - glyph.components = []; - var moreComponents = true; - while (moreComponents) { - flags = p.parseUShort(); - var component = { - glyphIndex: p.parseUShort(), - xScale: 1, - scale01: 0, - scale10: 0, - yScale: 1, - dx: 0, - dy: 0, - }; - if ((flags & 1) > 0) { - // The arguments are words - if ((flags & 2) > 0) { - // values are offset - component.dx = p.parseShort(); - component.dy = p.parseShort(); - } else { - // values are matched points - component.matchedPoints = [ - p.parseUShort(), - p.parseUShort(), - ]; - } - } else { - // The arguments are bytes - if ((flags & 2) > 0) { - // values are offset - component.dx = p.parseChar(); - component.dy = p.parseChar(); - } else { - // values are matched points - component.matchedPoints = [ - p.parseByte(), - p.parseByte(), - ]; - } - } - if ((flags & 8) > 0) { - // We have a scale - component.xScale = component.yScale = p.parseF2Dot14(); - } else if ((flags & 64) > 0) { - // We have an X / Y scale - component.xScale = p.parseF2Dot14(); - component.yScale = p.parseF2Dot14(); - } else if ((flags & 128) > 0) { - // We have a 2x2 transformation - component.xScale = p.parseF2Dot14(); - component.scale01 = p.parseF2Dot14(); - component.scale10 = p.parseF2Dot14(); - component.yScale = p.parseF2Dot14(); - } - glyph.components.push(component); - moreComponents = !!(flags & 32); - } - if (flags & 256) { - // We have instructions - glyph.instructionLength = p.parseUShort(); - glyph.instructions = []; - for (var i$6 = 0; i$6 < glyph.instructionLength; i$6 += 1) { - glyph.instructions.push(p.parseByte()); - } - } - } - } // Transform an array of points and return a new array. - - function transformPoints(points, transform) { - var newPoints = []; - for (var i = 0; i < points.length; i += 1) { - var pt = points[i]; - var newPt = { - x: - transform.xScale * pt.x + - transform.scale01 * pt.y + - transform.dx, - y: - transform.scale10 * pt.x + - transform.yScale * pt.y + - transform.dy, - onCurve: pt.onCurve, - lastPointOfContour: pt.lastPointOfContour, - }; - newPoints.push(newPt); - } - return newPoints; - } - function getContours(points) { - var contours = []; - var currentContour = []; - for (var i = 0; i < points.length; i += 1) { - var pt = points[i]; - currentContour.push(pt); - if (pt.lastPointOfContour) { - contours.push(currentContour); - currentContour = []; - } - } - check.argument( - currentContour.length === 0, - "There are still points left in the current contour.", - ); - return contours; - } // Convert the TrueType glyph outline to a Path. - - function getPath(points) { - var p = new Path(); - if (!points) { - return p; - } - var contours = getContours(points); - for ( - var contourIndex = 0; - contourIndex < contours.length; - ++contourIndex - ) { - var contour = contours[contourIndex]; - var prev = null; - var curr = contour[contour.length - 1]; - var next = contour[0]; - if (curr.onCurve) { - p.moveTo(curr.x, curr.y); - } else { - if (next.onCurve) { - p.moveTo(next.x, next.y); - } else { - // If both first and last points are off-curve, start at their middle. - var start = { - x: (curr.x + next.x) * 0.5, - y: (curr.y + next.y) * 0.5, - }; - p.moveTo(start.x, start.y); - } - } - for (var i = 0; i < contour.length; ++i) { - prev = curr; - curr = next; - next = contour[(i + 1) % contour.length]; - if (curr.onCurve) { - // This is a straight line. - p.lineTo(curr.x, curr.y); - } else { - var prev2 = prev; - var next2 = next; - if (!prev.onCurve) { - prev2 = { - x: (curr.x + prev.x) * 0.5, - y: (curr.y + prev.y) * 0.5, - }; - } - if (!next.onCurve) { - next2 = { - x: (curr.x + next.x) * 0.5, - y: (curr.y + next.y) * 0.5, - }; - } - p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y); - } - } - p.closePath(); - } - return p; - } - function buildPath(glyphs, glyph) { - if (glyph.isComposite) { - for (var j = 0; j < glyph.components.length; j += 1) { - var component = glyph.components[j]; - var componentGlyph = glyphs.get(component.glyphIndex); - // Force the ttfGlyphLoader to parse the glyph. - componentGlyph.getPath(); - if (componentGlyph.points) { - var transformedPoints = void 0; - if (component.matchedPoints === undefined) { - // component positioned by offset - transformedPoints = transformPoints( - componentGlyph.points, - component, - ); - } else { - // component positioned by matched points - if ( - component.matchedPoints[0] > - glyph.points.length - 1 || - component.matchedPoints[1] > - componentGlyph.points.length - 1 - ) { - throw Error( - "Matched points out of range in " + glyph.name, - ); - } - var firstPt = glyph.points[component.matchedPoints[0]]; - var secondPt = - componentGlyph.points[component.matchedPoints[1]]; - var transform = { - xScale: component.xScale, - scale01: component.scale01, - scale10: component.scale10, - yScale: component.yScale, - dx: 0, - dy: 0, - }; - secondPt = transformPoints([secondPt], transform)[0]; - transform.dx = firstPt.x - secondPt.x; - transform.dy = firstPt.y - secondPt.y; - transformedPoints = transformPoints( - componentGlyph.points, - transform, - ); - } - glyph.points = glyph.points.concat(transformedPoints); - } - } - } - return getPath(glyph.points); - } // Parse all the glyphs according to the offsets from the `loca` table. - - function parseGlyfTable(data, start, loca, font) { - var glyphs = new glyphset.GlyphSet(font); - // The last element of the loca table is invalid. - for (var i = 0; i < loca.length - 1; i += 1) { - var offset = loca[i]; - var nextOffset = loca[i + 1]; - if (offset !== nextOffset) { - glyphs.push( - i, - glyphset.ttfGlyphLoader( - font, - i, - parseGlyph, - data, - start + offset, - buildPath, - ), - ); - } else { - glyphs.push(i, glyphset.glyphLoader(font, i)); - } - } - return glyphs; - } - var glyf = { - getPath: getPath, - parse: parseGlyfTable, - }; - /* A TrueType font hinting interpreter. - * - * (c) 2017 Axel Kittenberger - * - * This interpreter has been implemented according to this documentation: - * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html - * - * According to the documentation F24DOT6 values are used for pixels. - * That means calculation is 1/64 pixel accurate and uses integer operations. - * However, Javascript has floating point operations by default and only - * those are available. One could make a case to simulate the 1/64 accuracy - * exactly by truncating after every division operation - * (for example with << 0) to get pixel exactly results as other TrueType - * implementations. It may make sense since some fonts are pixel optimized - * by hand using DELTAP instructions. The current implementation doesn't - * and rather uses full floating point precision. - * - * xScale, yScale and rotation is currently ignored. - * - * A few non-trivial instructions are missing as I didn't encounter yet - * a font that used them to test a possible implementation. - * - * Some fonts seem to use undocumented features regarding the twilight zone. - * Only some of them are implemented as they were encountered. - * - * The exports.DEBUG statements are removed on the minified distribution file. - */ - var instructionTable; - var exec; - var execGlyph; - var execComponent; - /* - * Creates a hinting object. - * - * There ought to be exactly one - * for each truetype font that is used for hinting. - */ - function Hinting(font) { - // the font this hinting object is for - this.font = font; - this.getCommands = function (hPoints) { - return glyf.getPath(hPoints).commands; - }; - // cached states - this._fpgmState = this._prepState = undefined; - // errorState - // 0 ... all okay - // 1 ... had an error in a glyf, - // continue working but stop spamming - // the console - // 2 ... error at prep, stop hinting at this ppem - // 3 ... error at fpeg, stop hinting for this font at all - this._errorState = 0; - } /* - * Not rounding. - */ - - function roundOff(v) { - return v; - } /* - * Rounding to grid. - */ - - function roundToGrid(v) { - //Rounding in TT is supposed to "symmetrical around zero" - return Math.sign(v) * Math.round(Math.abs(v)); - } /* - * Rounding to double grid. - */ - - function roundToDoubleGrid(v) { - return (Math.sign(v) * Math.round(Math.abs(v * 2))) / 2; - } /* - * Rounding to half grid. - */ - - function roundToHalfGrid(v) { - return Math.sign(v) * (Math.round(Math.abs(v) + 0.5) - 0.5); - } /* - * Rounding to up to grid. - */ - - function roundUpToGrid(v) { - return Math.sign(v) * Math.ceil(Math.abs(v)); - } /* - * Rounding to down to grid. - */ - - function roundDownToGrid(v) { - return Math.sign(v) * Math.floor(Math.abs(v)); - } /* - * Super rounding. - */ - - var roundSuper = function (v) { - var period = this.srPeriod; - var phase = this.srPhase; - var threshold = this.srThreshold; - var sign = 1; - if (v < 0) { - v = -v; - sign = -1; - } - v += threshold - phase; - v = Math.trunc(v / period) * period; - v += phase; - // according to http://xgridfit.sourceforge.net/round.html - if (v < 0) { - return phase * sign; - } - return v * sign; - }; - /* - * Unit vector of x-axis. - */ - var xUnitVector = { - x: 1, - y: 0, - axis: "x", - // Gets the projected distance between two points. - // o1/o2 ... if true, respective original position is used. - distance: function (p1, p2, o1, o2) { - return (o1 ? p1.xo : p1.x) - (o2 ? p2.xo : p2.x); - }, - // Moves point p so the moved position has the same relative - // position to the moved positions of rp1 and rp2 than the - // original positions had. - // - // See APPENDIX on INTERPOLATE at the bottom of this file. - interpolate: function (p, rp1, rp2, pv) { - var do1; - var do2; - var doa1; - var doa2; - var dm1; - var dm2; - var dt; - if (!pv || pv === this) { - do1 = p.xo - rp1.xo; - do2 = p.xo - rp2.xo; - dm1 = rp1.x - rp1.xo; - dm2 = rp2.x - rp2.xo; - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - p.x = p.xo + (dm1 + dm2) / 2; - return; - } - p.x = p.xo + (dm1 * doa2 + dm2 * doa1) / dt; - return; - } - do1 = pv.distance(p, rp1, true, true); - do2 = pv.distance(p, rp2, true, true); - dm1 = pv.distance(rp1, rp1, false, true); - dm2 = pv.distance(rp2, rp2, false, true); - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - xUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); - return; - } - xUnitVector.setRelative( - p, - p, - (dm1 * doa2 + dm2 * doa1) / dt, - pv, - true, - ); - }, - // Slope of line normal to this - normalSlope: Number.NEGATIVE_INFINITY, - // Sets the point 'p' relative to point 'rp' - // by the distance 'd'. - // - // See APPENDIX on SETRELATIVE at the bottom of this file. - // - // p ... point to set - // rp ... reference point - // d ... distance on projection vector - // pv ... projection vector (undefined = this) - // org ... if true, uses the original position of rp as reference. - setRelative: function (p, rp, d, pv, org) { - if (!pv || pv === this) { - p.x = (org ? rp.xo : rp.x) + d; - return; - } - var rpx = org ? rp.xo : rp.x; - var rpy = org ? rp.yo : rp.y; - var rpdx = rpx + d * pv.x; - var rpdy = rpy + d * pv.y; - p.x = rpdx + (p.y - rpdy) / pv.normalSlope; - }, - // Slope of vector line. - slope: 0, - // Touches the point p. - touch: function (p) { - p.xTouched = true; - }, - // Tests if a point p is touched. - touched: function (p) { - return p.xTouched; - }, - // Untouches the point p. - untouch: function (p) { - p.xTouched = false; - }, - }; - /* - * Unit vector of y-axis. - */ - var yUnitVector = { - x: 0, - y: 1, - axis: "y", - // Gets the projected distance between two points. - // o1/o2 ... if true, respective original position is used. - distance: function (p1, p2, o1, o2) { - return (o1 ? p1.yo : p1.y) - (o2 ? p2.yo : p2.y); - }, - // Moves point p so the moved position has the same relative - // position to the moved positions of rp1 and rp2 than the - // original positions had. - // - // See APPENDIX on INTERPOLATE at the bottom of this file. - interpolate: function (p, rp1, rp2, pv) { - var do1; - var do2; - var doa1; - var doa2; - var dm1; - var dm2; - var dt; - if (!pv || pv === this) { - do1 = p.yo - rp1.yo; - do2 = p.yo - rp2.yo; - dm1 = rp1.y - rp1.yo; - dm2 = rp2.y - rp2.yo; - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - p.y = p.yo + (dm1 + dm2) / 2; - return; - } - p.y = p.yo + (dm1 * doa2 + dm2 * doa1) / dt; - return; - } - do1 = pv.distance(p, rp1, true, true); - do2 = pv.distance(p, rp2, true, true); - dm1 = pv.distance(rp1, rp1, false, true); - dm2 = pv.distance(rp2, rp2, false, true); - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - yUnitVector.setRelative(p, p, (dm1 + dm2) / 2, pv, true); - return; - } - yUnitVector.setRelative( - p, - p, - (dm1 * doa2 + dm2 * doa1) / dt, - pv, - true, - ); - }, - // Slope of line normal to this. - normalSlope: 0, - // Sets the point 'p' relative to point 'rp' - // by the distance 'd' - // - // See APPENDIX on SETRELATIVE at the bottom of this file. - // - // p ... point to set - // rp ... reference point - // d ... distance on projection vector - // pv ... projection vector (undefined = this) - // org ... if true, uses the original position of rp as reference. - setRelative: function (p, rp, d, pv, org) { - if (!pv || pv === this) { - p.y = (org ? rp.yo : rp.y) + d; - return; - } - var rpx = org ? rp.xo : rp.x; - var rpy = org ? rp.yo : rp.y; - var rpdx = rpx + d * pv.x; - var rpdy = rpy + d * pv.y; - p.y = rpdy + pv.normalSlope * (p.x - rpdx); - }, - // Slope of vector line. - slope: Number.POSITIVE_INFINITY, - // Touches the point p. - touch: function (p) { - p.yTouched = true; - }, - // Tests if a point p is touched. - touched: function (p) { - return p.yTouched; - }, - // Untouches the point p. - untouch: function (p) { - p.yTouched = false; - }, - }; - Object.freeze(xUnitVector); - Object.freeze(yUnitVector); - /* - * Creates a unit vector that is not x- or y-axis. - */ - function UnitVector(x, y) { - this.x = x; - this.y = y; - this.axis = undefined; - this.slope = y / x; - this.normalSlope = -x / y; - Object.freeze(this); - } /* - * Gets the projected distance between two points. - * o1/o2 ... if true, respective original position is used. - */ - - UnitVector.prototype.distance = function (p1, p2, o1, o2) { - return ( - this.x * xUnitVector.distance(p1, p2, o1, o2) + - this.y * yUnitVector.distance(p1, p2, o1, o2) - ); - }; - /* - * Moves point p so the moved position has the same relative - * position to the moved positions of rp1 and rp2 than the - * original positions had. - * - * See APPENDIX on INTERPOLATE at the bottom of this file. - */ - UnitVector.prototype.interpolate = function (p, rp1, rp2, pv) { - var dm1; - var dm2; - var do1; - var do2; - var doa1; - var doa2; - var dt; - do1 = pv.distance(p, rp1, true, true); - do2 = pv.distance(p, rp2, true, true); - dm1 = pv.distance(rp1, rp1, false, true); - dm2 = pv.distance(rp2, rp2, false, true); - doa1 = Math.abs(do1); - doa2 = Math.abs(do2); - dt = doa1 + doa2; - if (dt === 0) { - this.setRelative(p, p, (dm1 + dm2) / 2, pv, true); - return; - } - this.setRelative( - p, - p, - (dm1 * doa2 + dm2 * doa1) / dt, - pv, - true, - ); - }; - /* - * Sets the point 'p' relative to point 'rp' - * by the distance 'd' - * - * See APPENDIX on SETRELATIVE at the bottom of this file. - * - * p ... point to set - * rp ... reference point - * d ... distance on projection vector - * pv ... projection vector (undefined = this) - * org ... if true, uses the original position of rp as reference. - */ - UnitVector.prototype.setRelative = function (p, rp, d, pv, org) { - pv = pv || this; - var rpx = org ? rp.xo : rp.x; - var rpy = org ? rp.yo : rp.y; - var rpdx = rpx + d * pv.x; - var rpdy = rpy + d * pv.y; - var pvns = pv.normalSlope; - var fvs = this.slope; - var px = p.x; - var py = p.y; - p.x = (fvs * px - pvns * rpdx + rpdy - py) / (fvs - pvns); - p.y = fvs * (p.x - px) + py; - }; - /* - * Touches the point p. - */ - UnitVector.prototype.touch = function (p) { - p.xTouched = true; - p.yTouched = true; - }; - /* - * Returns a unit vector with x/y coordinates. - */ - function getUnitVector(x, y) { - var d = Math.sqrt(x * x + y * y); - x /= d; - y /= d; - if (x === 1 && y === 0) { - return xUnitVector; - } else if (x === 0 && y === 1) { - return yUnitVector; - } else { - return new UnitVector(x, y); - } - } /* - * Creates a point in the hinting engine. - */ - - function HPoint(x, y, lastPointOfContour, onCurve) { - this.x = this.xo = Math.round(x * 64) / 64; // hinted x value and original x-value - this.y = this.yo = Math.round(y * 64) / 64; // hinted y value and original y-value - this.lastPointOfContour = lastPointOfContour; - this.onCurve = onCurve; - this.prevPointOnContour = undefined; - this.nextPointOnContour = undefined; - this.xTouched = false; - this.yTouched = false; - Object.preventExtensions(this); - } /* - * Returns the next touched point on the contour. - * - * v ... unit vector to test touch axis. - */ - - HPoint.prototype.nextTouched = function (v) { - var p = this.nextPointOnContour; - while (!v.touched(p) && p !== this) { - p = p.nextPointOnContour; - } - return p; - }; - /* - * Returns the previous touched point on the contour - * - * v ... unit vector to test touch axis. - */ - HPoint.prototype.prevTouched = function (v) { - var p = this.prevPointOnContour; - while (!v.touched(p) && p !== this) { - p = p.prevPointOnContour; - } - return p; - }; - /* - * The zero point. - */ - var HPZero = Object.freeze(new HPoint(0, 0)); - /* - * The default state of the interpreter. - * - * Note: Freezing the defaultState and then deriving from it - * makes the V8 Javascript engine going awkward, - * so this is avoided, albeit the defaultState shouldn't - * ever change. - */ - var defaultState = { - cvCutIn: 17 / 16, - // control value cut in - deltaBase: 9, - deltaShift: 0.125, - loop: 1, - // loops some instructions - minDis: 1, - // minimum distance - autoFlip: true, - }; - /* - * The current state of the interpreter. - * - * env ... 'fpgm' or 'prep' or 'glyf' - * prog ... the program - */ - function State(env, prog) { - this.env = env; - this.stack = []; - this.prog = prog; - switch (env) { - case "glyf": - this.zp0 = this.zp1 = this.zp2 = 1; - this.rp0 = this.rp1 = this.rp2 = 0; - /* fall through */ - case "prep": - this.fv = this.pv = this.dpv = xUnitVector; - this.round = roundToGrid; - } - } /* - * Executes a glyph program. - * - * This does the hinting for each glyph. - * - * Returns an array of moved points. - * - * glyph: the glyph to hint - * ppem: the size the glyph is rendered for - */ - - Hinting.prototype.exec = function (glyph, ppem) { - if (typeof ppem !== "number") { - throw new Error("Point size is not a number!"); - } // Received a fatal error, don't do any hinting anymore. - - if (this._errorState > 2) { - return; - } - var font = this.font; - var prepState = this._prepState; - if (!prepState || prepState.ppem !== ppem) { - var fpgmState = this._fpgmState; - if (!fpgmState) { - // Executes the fpgm state. - // This is used by fonts to define functions. - State.prototype = defaultState; - fpgmState = this._fpgmState = new State( - "fpgm", - font.tables.fpgm, - ); - fpgmState.funcs = []; - fpgmState.font = font; - if (exports.DEBUG) { - console.log("---EXEC FPGM---"); - fpgmState.step = -1; - } - try { - exec(fpgmState); - } catch (e) { - console.log("Hinting error in FPGM:" + e); - this._errorState = 3; - return; - } - } // Executes the prep program for this ppem setting. - // This is used by fonts to set cvt values - // depending on to be rendered font size. - - State.prototype = fpgmState; - prepState = this._prepState = new State( - "prep", - font.tables.prep, - ); - prepState.ppem = ppem; - // Creates a copy of the cvt table - // and scales it to the current ppem setting. - var oCvt = font.tables.cvt; - if (oCvt) { - var cvt = (prepState.cvt = new Array(oCvt.length)); - var scale = ppem / font.unitsPerEm; - for (var c = 0; c < oCvt.length; c++) { - cvt[c] = oCvt[c] * scale; - } - } else { - prepState.cvt = []; - } - if (exports.DEBUG) { - console.log("---EXEC PREP---"); - prepState.step = -1; - } - try { - exec(prepState); - } catch (e) { - if (this._errorState < 2) { - console.log("Hinting error in PREP:" + e); - } - this._errorState = 2; - } - } - if (this._errorState > 1) { - return; - } - try { - return execGlyph(glyph, prepState); - } catch (e) { - if (this._errorState < 1) { - console.log("Hinting error:" + e); - console.log("Note: further hinting errors are silenced"); - } - this._errorState = 1; - return undefined; - } - }; - /* - * Executes the hinting program for a glyph. - */ - execGlyph = function (glyph, prepState) { - // original point positions - var xScale = prepState.ppem / prepState.font.unitsPerEm; - var yScale = xScale; - var components = glyph.components; - var contours; - var gZone; - var state; - State.prototype = prepState; - if (!components) { - state = new State("glyf", glyph.instructions); - if (exports.DEBUG) { - console.log("---EXEC GLYPH---"); - state.step = -1; - } - execComponent(glyph, state, xScale, yScale); - gZone = state.gZone; - } else { - var font = prepState.font; - gZone = []; - contours = []; - for (var i = 0; i < components.length; i++) { - var c = components[i]; - var cg = font.glyphs.get(c.glyphIndex); - state = new State("glyf", cg.instructions); - if (exports.DEBUG) { - console.log("---EXEC COMP " + i + "---"); - state.step = -1; - } - execComponent(cg, state, xScale, yScale); - // appends the computed points to the result array - // post processes the component points - var dx = Math.round(c.dx * xScale); - var dy = Math.round(c.dy * yScale); - var gz = state.gZone; - var cc = state.contours; - for (var pi = 0; pi < gz.length; pi++) { - var p = gz[pi]; - p.xTouched = p.yTouched = false; - p.xo = p.x = p.x + dx; - p.yo = p.y = p.y + dy; - } - var gLen = gZone.length; - gZone.push.apply(gZone, gz); - for (var j = 0; j < cc.length; j++) { - contours.push(cc[j] + gLen); - } - } - if (glyph.instructions && !state.inhibitGridFit) { - // the composite has instructions on its own - state = new State("glyf", glyph.instructions); - state.gZone = state.z0 = state.z1 = state.z2 = gZone; - state.contours = contours; - // note: HPZero cannot be used here, since - // the point might be modified - gZone.push( - new HPoint(0, 0), - new HPoint(Math.round(glyph.advanceWidth * xScale), 0), - ); - if (exports.DEBUG) { - console.log("---EXEC COMPOSITE---"); - state.step = -1; - } - exec(state); - gZone.length -= 2; - } - } - return gZone; - }; - /* - * Executes the hinting program for a component of a multi-component glyph - * or of the glyph itself for a non-component glyph. - */ - execComponent = function (glyph, state, xScale, yScale) { - var points = glyph.points || []; - var pLen = points.length; - var gZone = (state.gZone = state.z0 = state.z1 = state.z2 = []); - var contours = (state.contours = []); - // Scales the original points and - // makes copies for the hinted points. - var cp; // current point - for (var i = 0; i < pLen; i++) { - cp = points[i]; - gZone[i] = new HPoint( - cp.x * xScale, - cp.y * yScale, - cp.lastPointOfContour, - cp.onCurve, - ); - } // Chain links the contours. - - var sp; // start point - var np; // next point - for (var i$1 = 0; i$1 < pLen; i$1++) { - cp = gZone[i$1]; - if (!sp) { - sp = cp; - contours.push(i$1); - } - if (cp.lastPointOfContour) { - cp.nextPointOnContour = sp; - sp.prevPointOnContour = cp; - sp = undefined; - } else { - np = gZone[i$1 + 1]; - cp.nextPointOnContour = np; - np.prevPointOnContour = cp; - } - } - if (state.inhibitGridFit) { - return; - } - if (exports.DEBUG) { - console.log("PROCESSING GLYPH", state.stack); - for (var i$2 = 0; i$2 < pLen; i$2++) { - console.log(i$2, gZone[i$2].x, gZone[i$2].y); - } - } - gZone.push( - new HPoint(0, 0), - new HPoint(Math.round(glyph.advanceWidth * xScale), 0), - ); - exec(state); - // Removes the extra points. - gZone.length -= 2; - if (exports.DEBUG) { - console.log("FINISHED GLYPH", state.stack); - for (var i$3 = 0; i$3 < pLen; i$3++) { - console.log(i$3, gZone[i$3].x, gZone[i$3].y); - } - } - }; - /* - * Executes the program loaded in state. - */ - exec = function (state) { - var prog = state.prog; - if (!prog) { - return; - } - var pLen = prog.length; - var ins; - for (state.ip = 0; state.ip < pLen; state.ip++) { - if (exports.DEBUG) { - state.step++; - } - ins = instructionTable[prog[state.ip]]; - if (!ins) { - throw new Error( - "unknown instruction: 0x" + - Number(prog[state.ip]).toString(16), - ); - } - ins(state); - // very extensive debugging for each step - /* - if (exports.DEBUG) { - var da; - if (state.gZone) { - da = []; - for (let i = 0; i < state.gZone.length; i++) - { - da.push(i + ' ' + - state.gZone[i].x * 64 + ' ' + - state.gZone[i].y * 64 + ' ' + - (state.gZone[i].xTouched ? 'x' : '') + - (state.gZone[i].yTouched ? 'y' : '') - ); + }, + { + key: 'move', + value: function move(x, y, z) { + var local = this._getLocalAxes(); + // scale local axes by movement amounts + // based on http://learnwebgl.brown37.net/07_cameras/camera_linear_motion.html + var dx = [ + local.x[0] * x, + local.x[1] * x, + local.x[2] * x + ]; + var dy = [ + local.y[0] * y, + local.y[1] * y, + local.y[2] * y + ]; + var dz = [ + local.z[0] * z, + local.z[1] * z, + local.z[2] * z + ]; + this.camera(this.eyeX + dx[0] + dy[0] + dz[0], this.eyeY + dx[1] + dy[1] + dz[1], this.eyeZ + dx[2] + dy[2] + dz[2], this.centerX + dx[0] + dy[0] + dz[0], this.centerY + dx[1] + dy[1] + dz[1], this.centerZ + dx[2] + dy[2] + dz[2], this.upX, this.upY, this.upZ); + } /** + * Set camera position in world-space while maintaining current camera + * orientation. + * @method setPosition + * @param {Number} x x position of a point in world space + * @param {Number} y y position of a point in world space + * @param {Number} z z position of a point in world space + * @example + *
                              + * + * // press '1' '2' or '3' keys to set camera position + * + * let cam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * cam = createCamera(); + * } + * + * function draw() { + * background(200); + * + * // '1' key + * if (keyIsDown(49)) { + * cam.setPosition(30, 0, 80); + * } + * // '2' key + * if (keyIsDown(50)) { + * cam.setPosition(0, 0, 80); + * } + * // '3' key + * if (keyIsDown(51)) { + * cam.setPosition(-30, 0, 80); + * } + * + * box(20); + * } + * + *
                              + * + * @alt + * camera position changes as the user presses keys, altering view of a 3D box + */ + + }, + { + key: 'setPosition', + value: function setPosition(x, y, z) { + var diffX = x - this.eyeX; + var diffY = y - this.eyeY; + var diffZ = z - this.eyeZ; + this.camera(x, y, z, this.centerX + diffX, this.centerY + diffY, this.centerZ + diffZ, this.upX, this.upY, this.upZ); + } /** + * Copies information about the argument camera's view and projection to + * the target camera. If the target camera is active, it will be reflected + * on the screen. + * + * @method set + * @param {p5.Camera} cam source camera + * + * @example + *
                              + * + * let cam, initialCam; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * strokeWeight(3); + * + * // Set the initial state to initialCamera and set it to the camera + * // used for drawing. Then set cam to be the active camera. + * cam = createCamera(); + * initialCam = createCamera(); + * initialCam.camera(100, 100, 100, 0, 0, 0, 0, 0, -1); + * cam.set(initialCam); + * + * setCamera(cam); + * } + * + * function draw() { + * orbitControl(); + * background(255); + * box(50); + * translate(0, 0, -25); + * plane(100); + * } + * + * function doubleClicked(){ + * // Double-click to return the camera to its initial position. + * cam.set(initialCam); + * } + * + *
                              + * @alt + * Prepare two cameras. One is the camera that sets the initial state, + * and the other is the camera that moves with interaction. + * Draw a plane and a box on top of it, operate the camera using orbitControl(). + * Double-click to set the camera in the initial state and return to + * the initial state. + */ + + }, + { + key: 'set', + value: function set(cam) { + var keyNamesOfThePropToCopy = [ + 'eyeX', + 'eyeY', + 'eyeZ', + 'centerX', + 'centerY', + 'centerZ', + 'upX', + 'upY', + 'upZ', + 'cameraFOV', + 'aspectRatio', + 'cameraNear', + 'cameraFar', + 'cameraType', + 'yScale' + ]; + for (var _i = 0, _keyNamesOfThePropToC = keyNamesOfThePropToCopy; _i < _keyNamesOfThePropToC.length; _i++) { + var keyName = _keyNamesOfThePropToC[_i]; + this[keyName] = cam[keyName]; + } + this.cameraMatrix = cam.cameraMatrix.copy(); + this.projMatrix = cam.projMatrix.copy(); + // If the target camera is active, update uMVMatrix and uPMatrix. + if (this._isActive()) { + this._renderer.uMVMatrix.mat4 = this.cameraMatrix.mat4.slice(); + this._renderer.uPMatrix.mat4 = this.projMatrix.mat4.slice(); + } + } /** + * For the cameras cam0 and cam1 with the given arguments, their view are combined + * with the parameter amt that represents the quantity, and the obtained view is applied. + * For example, if cam0 is looking straight ahead and cam1 is looking straight + * to the right and amt is 0.5, the applied camera will look to the halfway + * between front and right. + * If the applied camera is active, the applied result will be reflected on the screen. + * When applying this function, all cameras involved must have exactly the same projection + * settings. For example, if one is perspective, ortho, frustum, the other two must also be + * perspective, ortho, frustum respectively. However, if all cameras have ortho settings, + * interpolation is possible if the ratios of left, right, top and bottom are equal to each other. + * For example, when it is changed by orbitControl(). + * + * @method slerp + * @param {p5.Camera} cam0 first p5.Camera + * @param {p5.Camera} cam1 second p5.Camera + * @param {Number} amt amount to use for interpolation during slerp + * + * @example + *
                              + * + * let cam0, cam1, cam; + * function setup() { + * createCanvas(100, 100, WEBGL); + * strokeWeight(3); + * + * // camera for slerp. + * cam = createCamera(); + * // cam0 is looking at the cube from the front. + * // cam1 is pointing straight to the right in the cube + * // at the same position as cam0 by doing a pan(-PI/2). + * cam0 = createCamera(); + * cam1 = createCamera(); + * cam1.pan(-PI/2); + * + * // we only use cam. + * setCamera(cam); + * } + * + * function draw() { + * // calculate amount. + * const amt = 0.5 - 0.5 * cos(frameCount * TAU / 120); + * // slerp cam0 and cam1 with amt, set to cam. + * // When amt moves from 0 to 1, cam moves from cam0 to cam1, + * // shaking the camera to the right. + * cam.slerp(cam0, cam1, amt); + * + * background(255); + * // Every time the camera turns right, the cube drifts left. + * box(40); + * } + * + *
                              + * @alt + * Prepare two cameras. One camera is facing straight ahead to the cube and the other + * camera is in the same position and looking straight to the right. + * If you use a camera which interpolates these with slerp(), the facing direction + * of the camera will change smoothly between the front and the right. + * + * @example + *
                              + * + * let cam, lastCam, initialCam; + * let countForReset = 30; + * // This sample uses orbitControl() to move the camera. + * // Double-clicking the canvas restores the camera to its initial state. + * function setup() { + * createCanvas(100, 100, WEBGL); + * strokeWeight(3); + * + * cam = createCamera(); // main camera + * lastCam = createCamera(); // Camera for recording loc info before reset + * initialCam = createCamera(); // Camera for recording the initial state + * + * setCamera(cam); // set main camera + * } + * + * function draw() { + * if (countForReset < 30) { + * // if the reset count is less than 30, + * // it will move closer to the original camera as it increases. + * countForReset++; + * cam.slerp(lastCam, initialCam, countForReset / 30); + * } else { + * // if the count is 30, + * // you can freely move the main camera with orbitControl(). + * orbitControl(); + * } + * + * background(255); + * box(40); + * } + * // A double-click sets countForReset to 0 and initiates a reset. + * function doubleClicked() { + * if (countForReset === 30) { + * countForReset = 0; + * lastCam.set(cam); + * } + * } + * + *
                              + * @alt + * There is a camera, drawing a cube. The camera can be moved freely with + * orbitControl(). Double-click to smoothly return the camera to its initial state. + * The camera cannot be moved during that time. + */ + + }, + { + key: 'slerp', + value: function slerp(cam0, cam1, amt) { + // If t is 0 or 1, do not interpolate and set the argument camera. + if (amt === 0) { + this.set(cam0); + return; + } else if (amt === 1) { + this.set(cam1); + return; + } // For this cameras is ortho, assume that cam0 and cam1 are also ortho + // and interpolate the elements of the projection matrix. + // Use logarithmic interpolation for interpolation. + + if (this.projMatrix.mat4[15] !== 0) { + this.projMatrix.mat4[0] = cam0.projMatrix.mat4[0] * Math.pow(cam1.projMatrix.mat4[0] / cam0.projMatrix.mat4[0], amt); + this.projMatrix.mat4[5] = cam0.projMatrix.mat4[5] * Math.pow(cam1.projMatrix.mat4[5] / cam0.projMatrix.mat4[5], amt); + // If the camera is active, make uPMatrix reflect changes in projMatrix. + if (this._isActive()) { + this._renderer.uPMatrix.mat4 = this.projMatrix.mat4.slice(); + } + } // prepare eye vector and center vector of argument cameras. + + var eye0 = new _main.default.Vector(cam0.eyeX, cam0.eyeY, cam0.eyeZ); + var eye1 = new _main.default.Vector(cam1.eyeX, cam1.eyeY, cam1.eyeZ); + var center0 = new _main.default.Vector(cam0.centerX, cam0.centerY, cam0.centerZ); + var center1 = new _main.default.Vector(cam1.centerX, cam1.centerY, cam1.centerZ); + // Calculate the distance between eye and center for each camera. + // Logarithmically interpolate these with amt. + var dist0 = _main.default.Vector.dist(eye0, center0); + var dist1 = _main.default.Vector.dist(eye1, center1); + var lerpedDist = dist0 * Math.pow(dist1 / dist0, amt); + // Next, calculate the ratio to interpolate the eye and center by a constant + // ratio for each camera. This ratio is the same for both. Also, with this ratio + // of points, the distance is the minimum distance of the two points of + // the same ratio. + // With this method, if the viewpoint is fixed, linear interpolation is performed + // at the viewpoint, and if the center is fixed, linear interpolation is performed + // at the center, resulting in reasonable interpolation. If both move, the point + // halfway between them is taken. + var eyeDiff = _main.default.Vector.sub(eye0, eye1); + var diffDiff = eye0.copy().sub(eye1).sub(center0).add(center1); + // Suppose there are two line segments. Consider the distance between the points + // above them as if they were taken in the same ratio. This calculation figures out + // a ratio that minimizes this. + // Each line segment is, a line segment connecting the viewpoint and the center + // for each camera. + var divider = diffDiff.magSq(); + var ratio = 1; // default. + if (divider > 0.000001) { + ratio = _main.default.Vector.dot(eyeDiff, diffDiff) / divider; + ratio = Math.max(0, Math.min(ratio, 1)); + } // Take the appropriate proportions and work out the points + // that are between the new viewpoint and the new center position. + + var lerpedMedium = _main.default.Vector.lerp(_main.default.Vector.lerp(eye0, center0, ratio), _main.default.Vector.lerp(eye1, center1, ratio), amt); + // Prepare each of rotation matrix from their camera matrix + var rotMat0 = cam0.cameraMatrix.createSubMatrix3x3(); + var rotMat1 = cam1.cameraMatrix.createSubMatrix3x3(); + // get front and up vector from local-coordinate-system. + var front0 = rotMat0.row(2); + var front1 = rotMat1.row(2); + var up0 = rotMat0.row(1); + var up1 = rotMat1.row(1); + // prepare new vectors. + var newFront = new _main.default.Vector(); + var newUp = new _main.default.Vector(); + var newEye = new _main.default.Vector(); + var newCenter = new _main.default.Vector(); + // Create the inverse matrix of mat0 by transposing mat0, + // and multiply it to mat1 from the right. + // This matrix represents the difference between the two. + // 'deltaRot' means 'difference of rotation matrices'. + var deltaRot = rotMat1.mult3x3(rotMat0.copy().transpose3x3()); + // Calculate the trace and from it the cos value of the angle. + // An orthogonal matrix is just an orthonormal basis. If this is not the identity + // matrix, it is a centered orthonormal basis plus some angle of rotation about + // some axis. That's the angle. Letting this be theta, trace becomes 1+2cos(theta). + // reference: https://en.wikipedia.org/wiki/Rotation_matrix#Determining_the_angle + var diag = deltaRot.diagonal(); + var cosTheta = 0.5 * (diag[0] + diag[1] + diag[2] - 1); + // If the angle is close to 0, the two matrices are very close, + // so in that case we execute linearly interpolate. + if (1 - cosTheta < 1e-7) { + // Obtain the front vector and up vector by linear interpolation + // and normalize them. + // calculate newEye, newCenter with newFront vector. + newFront.set(_main.default.Vector.lerp(front0, front1, amt)).normalize(); + newEye.set(newFront).mult(ratio * lerpedDist).add(lerpedMedium); + newCenter.set(newFront).mult((ratio - 1) * lerpedDist).add(lerpedMedium); + newUp.set(_main.default.Vector.lerp(up0, up1, amt)).normalize(); + // set the camera + this.camera(newEye.x, newEye.y, newEye.z, newCenter.x, newCenter.y, newCenter.z, newUp.x, newUp.y, newUp.z); + return; + } // Calculates the axis vector and the angle of the difference orthogonal matrix. + // The axis vector is what I explained earlier in the comments. + // similar calculation is here: + // https://github.com/mrdoob/three.js/blob/883249620049d1632e8791732808fefd1a98c871/src/math/Quaternion.js#L294 + + var a, + b, + c, + sinTheta; + var invOneMinusCosTheta = 1 / (1 - cosTheta); + var maxDiag = Math.max(diag[0], diag[1], diag[2]); + var offDiagSum13 = deltaRot.mat3[1] + deltaRot.mat3[3]; + var offDiagSum26 = deltaRot.mat3[2] + deltaRot.mat3[6]; + var offDiagSum57 = deltaRot.mat3[5] + deltaRot.mat3[7]; + if (maxDiag === diag[0]) { + a = Math.sqrt((diag[0] - cosTheta) * invOneMinusCosTheta); // not zero. + invOneMinusCosTheta /= a; + b = 0.5 * offDiagSum13 * invOneMinusCosTheta; + c = 0.5 * offDiagSum26 * invOneMinusCosTheta; + sinTheta = 0.5 * (deltaRot.mat3[7] - deltaRot.mat3[5]) / a; + } else if (maxDiag === diag[1]) { + b = Math.sqrt((diag[1] - cosTheta) * invOneMinusCosTheta); // not zero. + invOneMinusCosTheta /= b; + c = 0.5 * offDiagSum57 * invOneMinusCosTheta; + a = 0.5 * offDiagSum13 * invOneMinusCosTheta; + sinTheta = 0.5 * (deltaRot.mat3[2] - deltaRot.mat3[6]) / b; + } else { + c = Math.sqrt((diag[2] - cosTheta) * invOneMinusCosTheta); // not zero. + invOneMinusCosTheta /= c; + a = 0.5 * offDiagSum26 * invOneMinusCosTheta; + b = 0.5 * offDiagSum57 * invOneMinusCosTheta; + sinTheta = 0.5 * (deltaRot.mat3[3] - deltaRot.mat3[1]) / c; + } // Constructs a new matrix after interpolating the angles. + // Multiplying mat0 by the first matrix yields mat1, but by creating a state + // in the middle of that matrix, you can obtain a matrix that is + // an intermediate state between mat0 and mat1. + + var angle = amt * Math.atan2(sinTheta, cosTheta); + var cosAngle = Math.cos(angle); + var sinAngle = Math.sin(angle); + var oneMinusCosAngle = 1 - cosAngle; + var ab = a * b; + var bc = b * c; + var ca = c * a; + var lerpedRotMat = new _main.default.Matrix('mat3', [ + cosAngle + oneMinusCosAngle * a * a, + oneMinusCosAngle * ab + sinAngle * c, + oneMinusCosAngle * ca - sinAngle * b, + oneMinusCosAngle * ab - sinAngle * c, + cosAngle + oneMinusCosAngle * b * b, + oneMinusCosAngle * bc + sinAngle * a, + oneMinusCosAngle * ca + sinAngle * b, + oneMinusCosAngle * bc - sinAngle * a, + cosAngle + oneMinusCosAngle * c * c + ]); + // Multiply this to mat0 from left to get the interpolated front vector. + // calculate newEye, newCenter with newFront vector. + lerpedRotMat.multiplyVec3(front0, newFront); + newEye.set(newFront).mult(ratio * lerpedDist).add(lerpedMedium); + newCenter.set(newFront).mult((ratio - 1) * lerpedDist).add(lerpedMedium); + lerpedRotMat.multiplyVec3(up0, newUp); + // We also get the up vector in the same way and set the camera. + // The eye position and center position are calculated based on the front vector. + this.camera(newEye.x, newEye.y, newEye.z, newCenter.x, newCenter.y, newCenter.z, newUp.x, newUp.y, newUp.z); + } //////////////////////////////////////////////////////////////////////////////// + // Camera Helper Methods + //////////////////////////////////////////////////////////////////////////////// + // @TODO: combine this function with _setDefaultCamera to compute these values + // as-needed + + }, + { + key: '_computeCameraDefaultSettings', + value: function _computeCameraDefaultSettings() { + this.defaultAspectRatio = this._renderer.width / this._renderer.height; + this.defaultEyeX = 0; + this.defaultEyeY = 0; + this.defaultEyeZ = 800; + this.defaultCameraFOV = 2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ); + this.defaultCenterX = 0; + this.defaultCenterY = 0; + this.defaultCenterZ = 0; + this.defaultCameraNear = this.defaultEyeZ * 0.1; + this.defaultCameraFar = this.defaultEyeZ * 10; + } //detect if user didn't set the camera + //then call this function below + + }, + { + key: '_setDefaultCamera', + value: function _setDefaultCamera() { + this.cameraFOV = this.defaultCameraFOV; + this.aspectRatio = this.defaultAspectRatio; + this.eyeX = this.defaultEyeX; + this.eyeY = this.defaultEyeY; + this.eyeZ = this.defaultEyeZ; + this.centerX = this.defaultCenterX; + this.centerY = this.defaultCenterY; + this.centerZ = this.defaultCenterZ; + this.upX = 0; + this.upY = 1; + this.upZ = 0; + this.cameraNear = this.defaultCameraNear; + this.cameraFar = this.defaultCameraFar; + this.perspective(); + this.camera(); + this.cameraType = 'default'; } - console.log('GZ', da); + }, + { + key: '_resize', + value: function _resize() { + // If we're using the default camera, update the aspect ratio + if (this.cameraType === 'default') { + this._computeCameraDefaultSettings(); + this.cameraFOV = this.defaultCameraFOV; + this.aspectRatio = this.defaultAspectRatio; + this.perspective(); + } + } /** + * Returns a copy of a camera. + * @method copy + * @private + */ + + }, + { + key: 'copy', + value: function copy() { + var _cam = new _main.default.Camera(this._renderer); + _cam.cameraFOV = this.cameraFOV; + _cam.aspectRatio = this.aspectRatio; + _cam.eyeX = this.eyeX; + _cam.eyeY = this.eyeY; + _cam.eyeZ = this.eyeZ; + _cam.centerX = this.centerX; + _cam.centerY = this.centerY; + _cam.centerZ = this.centerZ; + _cam.upX = this.upX; + _cam.upY = this.upY; + _cam.upZ = this.upZ; + _cam.cameraNear = this.cameraNear; + _cam.cameraFar = this.cameraFar; + _cam.cameraType = this.cameraType; + _cam.cameraMatrix = this.cameraMatrix.copy(); + _cam.projMatrix = this.projMatrix.copy(); + _cam.yScale = this.yScale; + return _cam; + } /** + * Returns a camera's local axes: left-right, up-down, and forward-backward, + * as defined by vectors in world-space. + * @method _getLocalAxes + * @private + */ + + }, + { + key: '_getLocalAxes', + value: function _getLocalAxes() { + // calculate camera local Z vector + var z0 = this.eyeX - this.centerX; + var z1 = this.eyeY - this.centerY; + var z2 = this.eyeZ - this.centerZ; + // normalize camera local Z vector + var eyeDist = Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + if (eyeDist !== 0) { + z0 /= eyeDist; + z1 /= eyeDist; + z2 /= eyeDist; + } // calculate camera Y vector + + var y0 = this.upX; + var y1 = this.upY; + var y2 = this.upZ; + // compute camera local X vector as up vector (local Y) cross local Z + var x0 = y1 * z2 - y2 * z1; + var x1 = - y0 * z2 + y2 * z0; + var x2 = y0 * z1 - y1 * z0; + // recompute y = z cross x + y0 = z1 * x2 - z2 * x1; + y1 = - z0 * x2 + z2 * x0; + y2 = z0 * x1 - z1 * x0; + // cross product gives area of parallelogram, which is < 1.0 for + // non-perpendicular unit-length vectors; so normalize x, y here: + var xmag = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (xmag !== 0) { + x0 /= xmag; + x1 /= xmag; + x2 /= xmag; + } + var ymag = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (ymag !== 0) { + y0 /= ymag; + y1 /= ymag; + y2 /= ymag; + } + return { + x: [ + x0, + x1, + x2 + ], + y: [ + y0, + y1, + y2 + ], + z: [ + z0, + z1, + z2 + ] + }; + } /** + * Orbits the camera about center point. For use with orbitControl(). + * @method _orbit + * @private + * @param {Number} dTheta change in spherical coordinate theta + * @param {Number} dPhi change in spherical coordinate phi + * @param {Number} dRadius change in radius + */ + + }, + { + key: '_orbit', + value: function _orbit(dTheta, dPhi, dRadius) { + // Calculate the vector and its magnitude from the center to the viewpoint + var diffX = this.eyeX - this.centerX; + var diffY = this.eyeY - this.centerY; + var diffZ = this.eyeZ - this.centerZ; + var camRadius = Math.hypot(diffX, diffY, diffZ); + // front vector. unit vector from center to eye. + var front = new _main.default.Vector(diffX, diffY, diffZ).normalize(); + // up vector. normalized camera's up vector. + var up = new _main.default.Vector(this.upX, this.upY, this.upZ).normalize(); // y-axis + // side vector. Right when viewed from the front + var side = new _main.default.Vector.cross(up, front).normalize(); // x-axis + // vertical vector. normalized vector of projection of front vector. + var vertical = new _main.default.Vector.cross(side, up); // z-axis + // update camRadius + camRadius *= Math.pow(10, dRadius); + // prevent zooming through the center: + if (camRadius < this.cameraNear) { + camRadius = this.cameraNear; + } + if (camRadius > this.cameraFar) { + camRadius = this.cameraFar; + } // calculate updated camera angle + // Find the angle between the "up" and the "front", add dPhi to that. + // angleBetween() may return negative value. Since this specification is subject to change + // due to version updates, it cannot be adopted, so here we calculate using a method + // that directly obtains the absolute value. + + var camPhi = Math.acos(Math.max( - 1, Math.min(1, _main.default.Vector.dot(front, up)))) + dPhi; + // Rotate by dTheta in the shortest direction from "vertical" to "side" + var camTheta = dTheta; + // Invert camera's upX, upY, upZ if dPhi is below 0 or above PI + if (camPhi <= 0 || camPhi >= Math.PI) { + this.upX *= - 1; + this.upY *= - 1; + this.upZ *= - 1; + } // update eye vector by calculate new front vector + + up.mult(Math.cos(camPhi)); + vertical.mult(Math.cos(camTheta) * Math.sin(camPhi)); + side.mult(Math.sin(camTheta) * Math.sin(camPhi)); + front.set(up).add(vertical).add(side); + this.eyeX = camRadius * front.x + this.centerX; + this.eyeY = camRadius * front.y + this.centerY; + this.eyeZ = camRadius * front.z + this.centerZ; + // update camera + this.camera(this.eyeX, this.eyeY, this.eyeZ, this.centerX, this.centerY, this.centerZ, this.upX, this.upY, this.upZ); + } /** + * Orbits the camera about center point. For use with orbitControl(). + * Unlike _orbit(), the direction of rotation always matches the direction of pointer movement. + * @method _orbitFree + * @private + * @param {Number} dx the x component of the rotation vector. + * @param {Number} dy the y component of the rotation vector. + * @param {Number} dRadius change in radius + */ + + }, + { + key: '_orbitFree', + value: function _orbitFree(dx, dy, dRadius) { + // Calculate the vector and its magnitude from the center to the viewpoint + var diffX = this.eyeX - this.centerX; + var diffY = this.eyeY - this.centerY; + var diffZ = this.eyeZ - this.centerZ; + var camRadius = Math.hypot(diffX, diffY, diffZ); + // front vector. unit vector from center to eye. + var front = new _main.default.Vector(diffX, diffY, diffZ).normalize(); + // up vector. camera's up vector. + var up = new _main.default.Vector(this.upX, this.upY, this.upZ); + // side vector. Right when viewed from the front. (like x-axis) + var side = new _main.default.Vector.cross(up, front).normalize(); + // down vector. Bottom when viewed from the front. (like y-axis) + var down = new _main.default.Vector.cross(front, side); + // side vector and down vector are no longer used as-is. + // Create a vector representing the direction of rotation + // in the form cos(direction)*side + sin(direction)*down. + // Make the current side vector into this. + var directionAngle = Math.atan2(dy, dx); + down.mult(Math.sin(directionAngle)); + side.mult(Math.cos(directionAngle)).add(down); + // The amount of rotation is the size of the vector (dx, dy). + var rotAngle = Math.sqrt(dx * dx + dy * dy); + // The vector that is orthogonal to both the front vector and + // the rotation direction vector is the rotation axis vector. + var axis = new _main.default.Vector.cross(front, side); + // update camRadius + camRadius *= Math.pow(10, dRadius); + // prevent zooming through the center: + if (camRadius < this.cameraNear) { + camRadius = this.cameraNear; + } + if (camRadius > this.cameraFar) { + camRadius = this.cameraFar; + } // If the axis vector is likened to the z-axis, the front vector is + // the x-axis and the side vector is the y-axis. Rotate the up and front + // vectors respectively by thinking of them as rotations around the z-axis. + // Calculate the components by taking the dot product and + // calculate a rotation based on that. + + var c = Math.cos(rotAngle); + var s = Math.sin(rotAngle); + var dotFront = up.dot(front); + var dotSide = up.dot(side); + var ux = dotFront * c + dotSide * s; + var uy = - dotFront * s + dotSide * c; + var uz = up.dot(axis); + up.x = ux * front.x + uy * side.x + uz * axis.x; + up.y = ux * front.y + uy * side.y + uz * axis.y; + up.z = ux * front.z + uy * side.z + uz * axis.z; + // We won't be using the side vector and the front vector anymore, + // so let's make the front vector into the vector from the center to the new eye. + side.mult( - s); + front.mult(c).add(side).mult(camRadius); + // it's complete. let's update camera. + this.camera(front.x + this.centerX, front.y + this.centerY, front.z + this.centerZ, this.centerX, this.centerY, this.centerZ, up.x, up.y, up.z); + } /** + * Returns true if camera is currently attached to renderer. + * @method _isActive + * @private + */ + + }, + { + key: '_isActive', + value: function _isActive() { + return this === this._renderer._curCamera; + } + } + ]); + return Camera; + }(); + /** + * Sets the current (active) camera of a 3D sketch. + * Allows for switching between multiple cameras. + * @method setCamera + * @param {p5.Camera} cam p5.Camera object + * @for p5 + * @example + *
                              + * + * let cam1, cam2; + * let currentCamera; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * normalMaterial(); + * + * cam1 = createCamera(); + * cam2 = createCamera(); + * cam2.setPosition(30, 0, 50); + * cam2.lookAt(0, 0, 0); + * cam2.ortho(); + * + * // set variable for previously active camera: + * currentCamera = 1; + * + * describe( + * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' + * ); + * } + * + * function draw() { + * background(200); + * + * // camera 1: + * cam1.lookAt(0, 0, 0); + * cam1.setPosition(sin(frameCount / 60) * 200, 0, 100); + * + * // every 100 frames, switch between the two cameras + * if (frameCount % 100 === 0) { + * if (currentCamera === 1) { + * setCamera(cam1); + * currentCamera = 0; + * } else { + * setCamera(cam2); + * currentCamera = 1; + * } + * } + * + * drawBoxes(); + * } + * + * function drawBoxes() { + * rotateX(frameCount * 0.01); + * translate(-100, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * translate(35, 0, 0); + * box(20); + * } + * + *
                              + * + * @alt + * Canvas switches between two camera views, each showing a series of spinning + * 3D boxes. + */ + _main.default.prototype.setCamera = function (cam) { + this._renderer._curCamera = cam; + // set the projection matrix (which is not normally updated each frame) + this._renderer.uPMatrix.set(cam.projMatrix.mat4[0], cam.projMatrix.mat4[1], cam.projMatrix.mat4[2], cam.projMatrix.mat4[3], cam.projMatrix.mat4[4], cam.projMatrix.mat4[5], cam.projMatrix.mat4[6], cam.projMatrix.mat4[7], cam.projMatrix.mat4[8], cam.projMatrix.mat4[9], cam.projMatrix.mat4[10], cam.projMatrix.mat4[11], cam.projMatrix.mat4[12], cam.projMatrix.mat4[13], cam.projMatrix.mat4[14], cam.projMatrix.mat4[15]); + }; + var _default = _main.default.Camera; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.math.hypot': 188, + 'core-js/modules/es.string.sub': 218 + } + ], + 348: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.log2'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.math.log2'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); } - if (state.tZone) { - da = []; - for (let i = 0; i < state.tZone.length; i++) { - da.push(i + ' ' + - state.tZone[i].x * 64 + ' ' + - state.tZone[i].y * 64 + ' ' + - (state.tZone[i].xTouched ? 'x' : '') + - (state.tZone[i].yTouched ? 'y' : '') - ); + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * An internal class to store data that will be sent to a p5.RenderBuffer. + * Those need to eventually go into a Float32Array, so this class provides a + * variable-length array container backed by a Float32Array so that it can be + * sent to the GPU without allocating a new array each frame. + * + * Like a C++ vector, its fixed-length Float32Array backing its contents will + * double in size when it goes over its capacity. + * + * @example + *
                              + * + * // Initialize storage with a capacity of 4 + * const storage = new DataArray(4); + * console.log(storage.data.length); // 4 + * console.log(storage.length); // 0 + * console.log(storage.dataArray()); // Empty Float32Array + * + * storage.push(1, 2, 3, 4, 5, 6); + * console.log(storage.data.length); // 8 + * console.log(storage.length); // 6 + * console.log(storage.dataArray()); // Float32Array{1, 2, 3, 4, 5, 6} + * + *
                              + */ + + _main.default.DataArray = /*#__PURE__*/ function () { + function DataArray() { + var initialLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 128; + _classCallCheck(this, DataArray); + this.length = 0; + this.data = new Float32Array(initialLength); + this.initialLength = initialLength; + } /** + * Returns a Float32Array window sized to the exact length of the data + */ + + _createClass(DataArray, [ + { + key: 'dataArray', + value: function dataArray() { + return this.subArray(0, this.length); + } /** + * A "soft" clear, which keeps the underlying storage size the same, but + * empties the contents of its dataArray() + */ + + }, + { + key: 'clear', + value: function clear() { + this.length = 0; + } /** + * Can be used to scale a DataArray back down to fit its contents. + */ + + }, + { + key: 'rescale', + value: function rescale() { + if (this.length < this.data.length / 2) { + // Find the power of 2 size that fits the data + var targetLength = 1 << Math.ceil(Math.log2(this.length)); + var newData = new Float32Array(targetLength); + newData.set(this.data.subarray(0, this.length), 0); + this.data = newData; + } + } /** + * A full reset, which allocates a new underlying Float32Array at its initial + * length + */ + + }, + { + key: 'reset', + value: function reset() { + this.clear(); + this.data = new Float32Array(this.initialLength); + } /** + * Adds values to the DataArray, expanding its internal storage to + * accommodate the new items. + */ + + }, + { + key: 'push', + value: function push() { + for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + this.ensureLength(this.length + values.length); + this.data.set(values, this.length); + this.length += values.length; + } /** + * Returns a copy of the data from the index `from`, inclusive, to the index + * `to`, exclusive + */ + + }, + { + key: 'slice', + value: function slice(from, to) { + return this.data.slice(from, Math.min(to, this.length)); + } /** + * Returns a mutable Float32Array window from the index `from`, inclusive, to + * the index `to`, exclusive + */ + + }, + { + key: 'subArray', + value: function subArray(from, to) { + return this.data.subarray(from, Math.min(to, this.length)); + } /** + * Expand capacity of the internal storage until it can fit a target size + */ + + }, + { + key: 'ensureLength', + value: function ensureLength(target) { + while (this.data.length < target) { + var newData = new Float32Array(this.data.length * 2); + newData.set(this.data, 0); + this.data = newData; + } } - console.log('TZ', da); + } + ]); + return DataArray; + }(); + var _default = _main.default.DataArray; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.math.log2': 189, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.float32-array': 229, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249 + } + ], + 349: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.reflect.get'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint8-clamped-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + var _p = _dereq_('./p5.Texture'); + var _p2 = _dereq_('./p5.RendererGL'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError('Invalid attempt to destructure non-iterable instance'); + } + function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === '[object Arguments]')) { + return; + } + var _arr = [ + ]; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i['return'] != null) _i['return'](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; } - if (state.stack.length > 10) { - console.log( - state.stack.length, - '...', state.stack.slice(state.stack.length - 10) - ); + return obj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _get(target, property, receiver) { + if (typeof Reflect !== 'undefined' && Reflect.get) { + _get = Reflect.get; } else { - console.log(state.stack.length, state.stack); + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; } - } - */ - } - }; - /* - * Initializes the twilight zone. - * - * This is only done if a SZPx instruction - * refers to the twilight zone. - */ - function initTZone(state) { - var tZone = (state.tZone = new Array(state.gZone.length)); - // no idea if this is actually correct... - for (var i = 0; i < tZone.length; i++) { - tZone[i] = new HPoint(0, 0); - } - } /* - * Skips the instruction pointer ahead over an IF/ELSE block. - * handleElse .. if true breaks on matching ELSE - */ - - function skip(state, handleElse) { - var prog = state.prog; - var ip = state.ip; - var nesting = 1; - var ins; - do { - ins = prog[++ip]; - if (ins === 88) { - // IF - nesting++; - } else if (ins === 89) { - // EIF - nesting--; - } else if (ins === 64) { - // NPUSHB - ip += prog[ip + 1] + 1; - } else if (ins === 65) { - // NPUSHW - ip += 2 * prog[ip + 1] + 1; - } else if (ins >= 176 && ins <= 183) { - // PUSHB - ip += ins - 176 + 1; - } else if (ins >= 184 && ins <= 191) { - // PUSHW - ip += (ins - 184 + 1) * 2; - } else if (handleElse && nesting === 1 && ins === 27) { - // ELSE - break; - } - } while (nesting > 0); - state.ip = ip; - } /*----------------------------------------------------------* - * And then a lot of instructions... * - *----------------------------------------------------------*/ - // SVTCA[a] Set freedom and projection Vectors To Coordinate Axis - // 0x00-0x01 - - function SVTCA(v, state) { - if (exports.DEBUG) { - console.log(state.step, "SVTCA[" + v.axis + "]"); - } - state.fv = state.pv = state.dpv = v; - } // SPVTCA[a] Set Projection Vector to Coordinate Axis - // 0x02-0x03 - - function SPVTCA(v, state) { - if (exports.DEBUG) { - console.log(state.step, "SPVTCA[" + v.axis + "]"); - } - state.pv = state.dpv = v; - } // SFVTCA[a] Set Freedom Vector to Coordinate Axis - // 0x04-0x05 - - function SFVTCA(v, state) { - if (exports.DEBUG) { - console.log(state.step, "SFVTCA[" + v.axis + "]"); - } - state.fv = v; - } // SPVTL[a] Set Projection Vector To Line - // 0x06-0x07 - - function SPVTL(a, state) { - var stack = state.stack; - var p2i = stack.pop(); - var p1i = stack.pop(); - var p2 = state.z2[p2i]; - var p1 = state.z1[p1i]; - if (exports.DEBUG) { - console.log("SPVTL[" + a + "]", p2i, p1i); - } - var dx; - var dy; - if (!a) { - dx = p1.x - p2.x; - dy = p1.y - p2.y; - } else { - dx = p2.y - p1.y; - dy = p1.x - p2.x; - } - state.pv = state.dpv = getUnitVector(dx, dy); - } // SFVTL[a] Set Freedom Vector To Line - // 0x08-0x09 - - function SFVTL(a, state) { - var stack = state.stack; - var p2i = stack.pop(); - var p1i = stack.pop(); - var p2 = state.z2[p2i]; - var p1 = state.z1[p1i]; - if (exports.DEBUG) { - console.log("SFVTL[" + a + "]", p2i, p1i); - } - var dx; - var dy; - if (!a) { - dx = p1.x - p2.x; - dy = p1.y - p2.y; - } else { - dx = p2.y - p1.y; - dy = p1.x - p2.x; - } - state.fv = getUnitVector(dx, dy); - } // SPVFS[] Set Projection Vector From Stack - // 0x0A - - function SPVFS(state) { - var stack = state.stack; - var y = stack.pop(); - var x = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SPVFS[]", y, x); - } - state.pv = state.dpv = getUnitVector(x, y); - } // SFVFS[] Set Freedom Vector From Stack - // 0x0B - - function SFVFS(state) { - var stack = state.stack; - var y = stack.pop(); - var x = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SPVFS[]", y, x); - } - state.fv = getUnitVector(x, y); - } // GPV[] Get Projection Vector - // 0x0C - - function GPV(state) { - var stack = state.stack; - var pv = state.pv; - if (exports.DEBUG) { - console.log(state.step, "GPV[]"); - } - stack.push(pv.x * 16384); - stack.push(pv.y * 16384); - } // GFV[] Get Freedom Vector - // 0x0C - - function GFV(state) { - var stack = state.stack; - var fv = state.fv; - if (exports.DEBUG) { - console.log(state.step, "GFV[]"); - } - stack.push(fv.x * 16384); - stack.push(fv.y * 16384); - } // SFVTPV[] Set Freedom Vector To Projection Vector - // 0x0E - - function SFVTPV(state) { - state.fv = state.pv; - if (exports.DEBUG) { - console.log(state.step, "SFVTPV[]"); - } - } // ISECT[] moves point p to the InterSECTion of two lines - // 0x0F - - function ISECT(state) { - var stack = state.stack; - var pa0i = stack.pop(); - var pa1i = stack.pop(); - var pb0i = stack.pop(); - var pb1i = stack.pop(); - var pi = stack.pop(); - var z0 = state.z0; - var z1 = state.z1; - var pa0 = z0[pa0i]; - var pa1 = z0[pa1i]; - var pb0 = z1[pb0i]; - var pb1 = z1[pb1i]; - var p = state.z2[pi]; - if (exports.DEBUG) { - console.log("ISECT[], ", pa0i, pa1i, pb0i, pb1i, pi); - } // math from - // en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line - - var x1 = pa0.x; - var y1 = pa0.y; - var x2 = pa1.x; - var y2 = pa1.y; - var x3 = pb0.x; - var y3 = pb0.y; - var x4 = pb1.x; - var y4 = pb1.y; - var div = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); - var f1 = x1 * y2 - y1 * x2; - var f2 = x3 * y4 - y3 * x4; - p.x = (f1 * (x3 - x4) - f2 * (x1 - x2)) / div; - p.y = (f1 * (y3 - y4) - f2 * (y1 - y2)) / div; - } // SRP0[] Set Reference Point 0 - // 0x10 - - function SRP0(state) { - state.rp0 = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SRP0[]", state.rp0); - } - } // SRP1[] Set Reference Point 1 - // 0x11 - - function SRP1(state) { - state.rp1 = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SRP1[]", state.rp1); - } - } // SRP1[] Set Reference Point 2 - // 0x12 - - function SRP2(state) { - state.rp2 = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SRP2[]", state.rp2); - } - } // SZP0[] Set Zone Pointer 0 - // 0x13 - - function SZP0(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SZP0[]", n); - } - state.zp0 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z0 = state.tZone; - break; - case 1: - state.z0 = state.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - } // SZP1[] Set Zone Pointer 1 - // 0x14 - - function SZP1(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SZP1[]", n); - } - state.zp1 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z1 = state.tZone; - break; - case 1: - state.z1 = state.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - } // SZP2[] Set Zone Pointer 2 - // 0x15 - - function SZP2(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SZP2[]", n); - } - state.zp2 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z2 = state.tZone; - break; - case 1: - state.z2 = state.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - } // SZPS[] Set Zone PointerS - // 0x16 - - function SZPS(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SZPS[]", n); - } - state.zp0 = state.zp1 = state.zp2 = n; - switch (n) { - case 0: - if (!state.tZone) { - initTZone(state); - } - state.z0 = state.z1 = state.z2 = state.tZone; - break; - case 1: - state.z0 = state.z1 = state.z2 = state.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - } // SLOOP[] Set LOOP variable - // 0x17 - - function SLOOP(state) { - state.loop = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SLOOP[]", state.loop); - } - } // RTG[] Round To Grid - // 0x18 - - function RTG(state) { - if (exports.DEBUG) { - console.log(state.step, "RTG[]"); - } - state.round = roundToGrid; - } // RTHG[] Round To Half Grid - // 0x19 - - function RTHG(state) { - if (exports.DEBUG) { - console.log(state.step, "RTHG[]"); - } - state.round = roundToHalfGrid; - } // SMD[] Set Minimum Distance - // 0x1A - - function SMD(state) { - var d = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SMD[]", d); - } - state.minDis = d / 64; - } // ELSE[] ELSE clause - // 0x1B - - function ELSE(state) { - // This instruction has been reached by executing a then branch - // so it just skips ahead until matching EIF. - // - // In case the IF was negative the IF[] instruction already - // skipped forward over the ELSE[] - if (exports.DEBUG) { - console.log(state.step, "ELSE[]"); - } - skip(state, false); - } // JMPR[] JuMP Relative - // 0x1C - - function JMPR(state) { - var o = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "JMPR[]", o); - } // A jump by 1 would do nothing. - - state.ip += o - 1; - } // SCVTCI[] Set Control Value Table Cut-In - // 0x1D - - function SCVTCI(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SCVTCI[]", n); - } - state.cvCutIn = n / 64; - } // DUP[] DUPlicate top stack element - // 0x20 - - function DUP(state) { - var stack = state.stack; - if (exports.DEBUG) { - console.log(state.step, "DUP[]"); - } - stack.push(stack[stack.length - 1]); - } // POP[] POP top stack element - // 0x21 - - function POP(state) { - if (exports.DEBUG) { - console.log(state.step, "POP[]"); - } - state.stack.pop(); - } // CLEAR[] CLEAR the stack - // 0x22 - - function CLEAR(state) { - if (exports.DEBUG) { - console.log(state.step, "CLEAR[]"); - } - state.stack.length = 0; - } // SWAP[] SWAP the top two elements on the stack - // 0x23 - - function SWAP(state) { - var stack = state.stack; - var a = stack.pop(); - var b = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SWAP[]"); - } - stack.push(a); - stack.push(b); - } // DEPTH[] DEPTH of the stack - // 0x24 - - function DEPTH(state) { - var stack = state.stack; - if (exports.DEBUG) { - console.log(state.step, "DEPTH[]"); - } - stack.push(stack.length); - } // LOOPCALL[] LOOPCALL function - // 0x2A - - function LOOPCALL(state) { - var stack = state.stack; - var fn = stack.pop(); - var c = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "LOOPCALL[]", fn, c); - } // saves callers program - - var cip = state.ip; - var cprog = state.prog; - state.prog = state.funcs[fn]; - // executes the function - for (var i = 0; i < c; i++) { - exec(state); - if (exports.DEBUG) { - console.log( - ++state.step, - i + 1 < c ? "next loopcall" : "done loopcall", - i, - ); - } - } // restores the callers program - - state.ip = cip; - state.prog = cprog; - } // CALL[] CALL function - // 0x2B - - function CALL(state) { - var fn = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "CALL[]", fn); - } // saves callers program - - var cip = state.ip; - var cprog = state.prog; - state.prog = state.funcs[fn]; - // executes the function - exec(state); - // restores the callers program - state.ip = cip; - state.prog = cprog; - if (exports.DEBUG) { - console.log(++state.step, "returning from", fn); - } - } // CINDEX[] Copy the INDEXed element to the top of the stack - // 0x25 - - function CINDEX(state) { - var stack = state.stack; - var k = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "CINDEX[]", k); - } // In case of k == 1, it copies the last element after popping - // thus stack.length - k. - - stack.push(stack[stack.length - k]); - } // MINDEX[] Move the INDEXed element to the top of the stack - // 0x26 - - function MINDEX(state) { - var stack = state.stack; - var k = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "MINDEX[]", k); - } - stack.push(stack.splice(stack.length - k, 1)[0]); - } // FDEF[] Function DEFinition - // 0x2C - - function FDEF(state) { - if (state.env !== "fpgm") { - throw new Error("FDEF not allowed here"); - } - var stack = state.stack; - var prog = state.prog; - var ip = state.ip; - var fn = stack.pop(); - var ipBegin = ip; - if (exports.DEBUG) { - console.log(state.step, "FDEF[]", fn); - } - while (prog[++ip] !== 45) {} - state.ip = ip; - state.funcs[fn] = prog.slice(ipBegin + 1, ip); - } // MDAP[a] Move Direct Absolute Point - // 0x2E-0x2F - - function MDAP(round, state) { - var pi = state.stack.pop(); - var p = state.z0[pi]; - var fv = state.fv; - var pv = state.pv; - if (exports.DEBUG) { - console.log(state.step, "MDAP[" + round + "]", pi); - } - var d = pv.distance(p, HPZero); - if (round) { - d = state.round(d); - } - fv.setRelative(p, HPZero, d, pv); - fv.touch(p); - state.rp0 = state.rp1 = pi; - } // IUP[a] Interpolate Untouched Points through the outline - // 0x30 - - function IUP(v, state) { - var z2 = state.z2; - var pLen = z2.length - 2; - var cp; - var pp; - var np; - if (exports.DEBUG) { - console.log(state.step, "IUP[" + v.axis + "]"); - } - for (var i = 0; i < pLen; i++) { - cp = z2[i]; // current point - // if this point has been touched go on - if (v.touched(cp)) { - continue; - } - pp = cp.prevTouched(v); - // no point on the contour has been touched? - if (pp === cp) { - continue; - } - np = cp.nextTouched(v); - if (pp === np) { - // only one point on the contour has been touched - // so simply moves the point like that - v.setRelative( - cp, - cp, - v.distance(pp, pp, false, true), - v, - true, - ); - } - v.interpolate(cp, pp, np, v); - } - } // SHP[] SHift Point using reference point - // 0x32-0x33 - - function SHP(a, state) { - var stack = state.stack; - var rpi = a ? state.rp1 : state.rp2; - var rp = (a ? state.z0 : state.z1)[rpi]; - var fv = state.fv; - var pv = state.pv; - var loop = state.loop; - var z2 = state.z2; - while (loop--) { - var pi = stack.pop(); - var p = z2[pi]; - var d = pv.distance(rp, rp, false, true); - fv.setRelative(p, p, d, pv); - fv.touch(p); - if (exports.DEBUG) { - console.log( - state.step, - (state.loop > 1 - ? "loop " + (state.loop - loop) + ": " - : "") + - "SHP[" + - (a ? "rp1" : "rp2") + - "]", - pi, - ); - } - } - state.loop = 1; - } // SHC[] SHift Contour using reference point - // 0x36-0x37 - - function SHC(a, state) { - var stack = state.stack; - var rpi = a ? state.rp1 : state.rp2; - var rp = (a ? state.z0 : state.z1)[rpi]; - var fv = state.fv; - var pv = state.pv; - var ci = stack.pop(); - var sp = state.z2[state.contours[ci]]; - var p = sp; - if (exports.DEBUG) { - console.log(state.step, "SHC[" + a + "]", ci); - } - var d = pv.distance(rp, rp, false, true); - do { - if (p !== rp) { - fv.setRelative(p, p, d, pv); - } - p = p.nextPointOnContour; - } while (p !== sp); - } // SHZ[] SHift Zone using reference point - // 0x36-0x37 - - function SHZ(a, state) { - var stack = state.stack; - var rpi = a ? state.rp1 : state.rp2; - var rp = (a ? state.z0 : state.z1)[rpi]; - var fv = state.fv; - var pv = state.pv; - var e = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SHZ[" + a + "]", e); - } - var z; - switch (e) { - case 0: - z = state.tZone; - break; - case 1: - z = state.gZone; - break; - default: - throw new Error("Invalid zone"); - } - var p; - var d = pv.distance(rp, rp, false, true); - var pLen = z.length - 2; - for (var i = 0; i < pLen; i++) { - p = z[i]; - fv.setRelative(p, p, d, pv); - //if (p !== rp) fv.setRelative(p, p, d, pv); - } - } // SHPIX[] SHift point by a PIXel amount - // 0x38 - - function SHPIX(state) { - var stack = state.stack; - var loop = state.loop; - var fv = state.fv; - var d = stack.pop() / 64; - var z2 = state.z2; - while (loop--) { - var pi = stack.pop(); - var p = z2[pi]; - if (exports.DEBUG) { - console.log( - state.step, - (state.loop > 1 - ? "loop " + (state.loop - loop) + ": " - : "") + "SHPIX[]", - pi, - d, - ); - } - fv.setRelative(p, p, d); - fv.touch(p); - } - state.loop = 1; - } // IP[] Interpolate Point - // 0x39 - - function IP(state) { - var stack = state.stack; - var rp1i = state.rp1; - var rp2i = state.rp2; - var loop = state.loop; - var rp1 = state.z0[rp1i]; - var rp2 = state.z1[rp2i]; - var fv = state.fv; - var pv = state.dpv; - var z2 = state.z2; - while (loop--) { - var pi = stack.pop(); - var p = z2[pi]; - if (exports.DEBUG) { - console.log( - state.step, - (state.loop > 1 - ? "loop " + (state.loop - loop) + ": " - : "") + "IP[]", - pi, - rp1i, - "<->", - rp2i, - ); - } - fv.interpolate(p, rp1, rp2, pv); - fv.touch(p); - } - state.loop = 1; - } // MSIRP[a] Move Stack Indirect Relative Point - // 0x3A-0x3B - - function MSIRP(a, state) { - var stack = state.stack; - var d = stack.pop() / 64; - var pi = stack.pop(); - var p = state.z1[pi]; - var rp0 = state.z0[state.rp0]; - var fv = state.fv; - var pv = state.pv; - fv.setRelative(p, rp0, d, pv); - fv.touch(p); - if (exports.DEBUG) { - console.log(state.step, "MSIRP[" + a + "]", d, pi); - } - state.rp1 = state.rp0; - state.rp2 = pi; - if (a) { - state.rp0 = pi; - } - } // ALIGNRP[] Align to reference point. - // 0x3C - - function ALIGNRP(state) { - var stack = state.stack; - var rp0i = state.rp0; - var rp0 = state.z0[rp0i]; - var loop = state.loop; - var fv = state.fv; - var pv = state.pv; - var z1 = state.z1; - while (loop--) { - var pi = stack.pop(); - var p = z1[pi]; - if (exports.DEBUG) { - console.log( - state.step, - (state.loop > 1 - ? "loop " + (state.loop - loop) + ": " - : "") + "ALIGNRP[]", - pi, - ); - } - fv.setRelative(p, rp0, 0, pv); - fv.touch(p); - } - state.loop = 1; - } // RTG[] Round To Double Grid - // 0x3D - - function RTDG(state) { - if (exports.DEBUG) { - console.log(state.step, "RTDG[]"); - } - state.round = roundToDoubleGrid; - } // MIAP[a] Move Indirect Absolute Point - // 0x3E-0x3F - - function MIAP(round, state) { - var stack = state.stack; - var n = stack.pop(); - var pi = stack.pop(); - var p = state.z0[pi]; - var fv = state.fv; - var pv = state.pv; - var cv = state.cvt[n]; - if (exports.DEBUG) { - console.log( - state.step, - "MIAP[" + round + "]", - n, - "(", - cv, - ")", - pi, - ); - } - var d = pv.distance(p, HPZero); - if (round) { - if (Math.abs(d - cv) < state.cvCutIn) { - d = cv; - } - d = state.round(d); - } - fv.setRelative(p, HPZero, d, pv); - if (state.zp0 === 0) { - p.xo = p.x; - p.yo = p.y; - } - fv.touch(p); - state.rp0 = state.rp1 = pi; - } // NPUSB[] PUSH N Bytes - // 0x40 - - function NPUSHB(state) { - var prog = state.prog; - var ip = state.ip; - var stack = state.stack; - var n = prog[++ip]; - if (exports.DEBUG) { - console.log(state.step, "NPUSHB[]", n); - } - for (var i = 0; i < n; i++) { - stack.push(prog[++ip]); - } - state.ip = ip; - } // NPUSHW[] PUSH N Words - // 0x41 - - function NPUSHW(state) { - var ip = state.ip; - var prog = state.prog; - var stack = state.stack; - var n = prog[++ip]; - if (exports.DEBUG) { - console.log(state.step, "NPUSHW[]", n); - } - for (var i = 0; i < n; i++) { - var w = (prog[++ip] << 8) | prog[++ip]; - if (w & 32768) { - w = -((w ^ 65535) + 1); - } - stack.push(w); - } - state.ip = ip; - } // WS[] Write Store - // 0x42 - - function WS(state) { - var stack = state.stack; - var store = state.store; - if (!store) { - store = state.store = []; - } - var v = stack.pop(); - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "WS", v, l); - } - store[l] = v; - } // RS[] Read Store - // 0x43 - - function RS(state) { - var stack = state.stack; - var store = state.store; - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "RS", l); - } - var v = (store && store[l]) || 0; - stack.push(v); - } // WCVTP[] Write Control Value Table in Pixel units - // 0x44 - - function WCVTP(state) { - var stack = state.stack; - var v = stack.pop(); - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "WCVTP", v, l); - } - state.cvt[l] = v / 64; - } // RCVT[] Read Control Value Table entry - // 0x45 - - function RCVT(state) { - var stack = state.stack; - var cvte = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "RCVT", cvte); - } - stack.push(state.cvt[cvte] * 64); - } // GC[] Get Coordinate projected onto the projection vector - // 0x46-0x47 - - function GC(a, state) { - var stack = state.stack; - var pi = stack.pop(); - var p = state.z2[pi]; - if (exports.DEBUG) { - console.log(state.step, "GC[" + a + "]", pi); - } - stack.push(state.dpv.distance(p, HPZero, a, false) * 64); - } // MD[a] Measure Distance - // 0x49-0x4A - - function MD(a, state) { - var stack = state.stack; - var pi2 = stack.pop(); - var pi1 = stack.pop(); - var p2 = state.z1[pi2]; - var p1 = state.z0[pi1]; - var d = state.dpv.distance(p1, p2, a, a); - if (exports.DEBUG) { - console.log(state.step, "MD[" + a + "]", pi2, pi1, "->", d); - } - state.stack.push(Math.round(d * 64)); - } // MPPEM[] Measure Pixels Per EM - // 0x4B - - function MPPEM(state) { - if (exports.DEBUG) { - console.log(state.step, "MPPEM[]"); - } - state.stack.push(state.ppem); - } // FLIPON[] set the auto FLIP Boolean to ON - // 0x4D - - function FLIPON(state) { - if (exports.DEBUG) { - console.log(state.step, "FLIPON[]"); - } - state.autoFlip = true; - } // LT[] Less Than - // 0x50 - - function LT(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "LT[]", e2, e1); - } - stack.push(e1 < e2 ? 1 : 0); - } // LTEQ[] Less Than or EQual - // 0x53 - - function LTEQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "LTEQ[]", e2, e1); - } - stack.push(e1 <= e2 ? 1 : 0); - } // GTEQ[] Greater Than - // 0x52 - - function GT(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "GT[]", e2, e1); - } - stack.push(e1 > e2 ? 1 : 0); - } // GTEQ[] Greater Than or EQual - // 0x53 - - function GTEQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "GTEQ[]", e2, e1); - } - stack.push(e1 >= e2 ? 1 : 0); - } // EQ[] EQual - // 0x54 - - function EQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "EQ[]", e2, e1); - } - stack.push(e2 === e1 ? 1 : 0); - } // NEQ[] Not EQual - // 0x55 - - function NEQ(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "NEQ[]", e2, e1); - } - stack.push(e2 !== e1 ? 1 : 0); - } // ODD[] ODD - // 0x56 - - function ODD(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "ODD[]", n); - } - stack.push(Math.trunc(n) % 2 ? 1 : 0); - } // EVEN[] EVEN - // 0x57 - - function EVEN(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "EVEN[]", n); - } - stack.push(Math.trunc(n) % 2 ? 0 : 1); - } // IF[] IF test - // 0x58 - - function IF(state) { - var test = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "IF[]", test); - } // if test is true it just continues - // if not the ip is skipped until matching ELSE or EIF - - if (!test) { - skip(state, true); - if (exports.DEBUG) { - console.log(state.step, "EIF[]"); - } - } - } // EIF[] End IF - // 0x59 - - function EIF(state) { - // this can be reached normally when - // executing an else branch. - // -> just ignore it - if (exports.DEBUG) { - console.log(state.step, "EIF[]"); - } - } // AND[] logical AND - // 0x5A - - function AND(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "AND[]", e2, e1); - } - stack.push(e2 && e1 ? 1 : 0); - } // OR[] logical OR - // 0x5B - - function OR(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "OR[]", e2, e1); - } - stack.push(e2 || e1 ? 1 : 0); - } // NOT[] logical NOT - // 0x5C - - function NOT(state) { - var stack = state.stack; - var e = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "NOT[]", e); - } - stack.push(e ? 0 : 1); - } // DELTAP1[] DELTA exception P1 - // DELTAP2[] DELTA exception P2 - // DELTAP3[] DELTA exception P3 - // 0x5D, 0x71, 0x72 - - function DELTAP123(b, state) { - var stack = state.stack; - var n = stack.pop(); - var fv = state.fv; - var pv = state.pv; - var ppem = state.ppem; - var base = state.deltaBase + (b - 1) * 16; - var ds = state.deltaShift; - var z0 = state.z0; - if (exports.DEBUG) { - console.log(state.step, "DELTAP[" + b + "]", n, stack); - } - for (var i = 0; i < n; i++) { - var pi = stack.pop(); - var arg = stack.pop(); - var appem = base + ((arg & 240) >> 4); - if (appem !== ppem) { - continue; - } - var mag = (arg & 15) - 8; - if (mag >= 0) { - mag++; - } - if (exports.DEBUG) { - console.log(state.step, "DELTAPFIX", pi, "by", mag * ds); - } - var p = z0[pi]; - fv.setRelative(p, p, mag * ds, pv); - } - } // SDB[] Set Delta Base in the graphics state - // 0x5E - - function SDB(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SDB[]", n); - } - state.deltaBase = n; - } // SDS[] Set Delta Shift in the graphics state - // 0x5F - - function SDS(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SDS[]", n); - } - state.deltaShift = Math.pow(0.5, n); - } // ADD[] ADD - // 0x60 - - function ADD(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "ADD[]", n2, n1); - } - stack.push(n1 + n2); - } // SUB[] SUB - // 0x61 - - function SUB(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SUB[]", n2, n1); - } - stack.push(n1 - n2); - } // DIV[] DIV - // 0x62 - - function DIV(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "DIV[]", n2, n1); - } - stack.push((n1 * 64) / n2); - } // MUL[] MUL - // 0x63 - - function MUL(state) { - var stack = state.stack; - var n2 = stack.pop(); - var n1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "MUL[]", n2, n1); - } - stack.push((n1 * n2) / 64); - } // ABS[] ABSolute value - // 0x64 - - function ABS(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "ABS[]", n); - } - stack.push(Math.abs(n)); - } // NEG[] NEGate - // 0x65 - - function NEG(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "NEG[]", n); - } - stack.push(-n); - } // FLOOR[] FLOOR - // 0x66 - - function FLOOR(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "FLOOR[]", n); - } - stack.push(Math.floor(n / 64) * 64); - } // CEILING[] CEILING - // 0x67 - - function CEILING(state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "CEILING[]", n); - } - stack.push(Math.ceil(n / 64) * 64); - } // ROUND[ab] ROUND value - // 0x68-0x6B - - function ROUND(dt, state) { - var stack = state.stack; - var n = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "ROUND[]"); - } - stack.push(state.round(n / 64) * 64); - } // WCVTF[] Write Control Value Table in Funits - // 0x70 - - function WCVTF(state) { - var stack = state.stack; - var v = stack.pop(); - var l = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "WCVTF[]", v, l); - } - state.cvt[l] = (v * state.ppem) / state.font.unitsPerEm; - } // DELTAC1[] DELTA exception C1 - // DELTAC2[] DELTA exception C2 - // DELTAC3[] DELTA exception C3 - // 0x73, 0x74, 0x75 - - function DELTAC123(b, state) { - var stack = state.stack; - var n = stack.pop(); - var ppem = state.ppem; - var base = state.deltaBase + (b - 1) * 16; - var ds = state.deltaShift; - if (exports.DEBUG) { - console.log(state.step, "DELTAC[" + b + "]", n, stack); - } - for (var i = 0; i < n; i++) { - var c = stack.pop(); - var arg = stack.pop(); - var appem = base + ((arg & 240) >> 4); - if (appem !== ppem) { - continue; - } - var mag = (arg & 15) - 8; - if (mag >= 0) { - mag++; - } - var delta = mag * ds; - if (exports.DEBUG) { - console.log(state.step, "DELTACFIX", c, "by", delta); - } - state.cvt[c] += delta; - } - } // SROUND[] Super ROUND - // 0x76 - - function SROUND(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "SROUND[]", n); - } - state.round = roundSuper; - var period; - switch (n & 192) { - case 0: - period = 0.5; - break; - case 64: - period = 1; - break; - case 128: - period = 2; - break; - default: - throw new Error("invalid SROUND value"); - } - state.srPeriod = period; - switch (n & 48) { - case 0: - state.srPhase = 0; - break; - case 16: - state.srPhase = 0.25 * period; - break; - case 32: - state.srPhase = 0.5 * period; - break; - case 48: - state.srPhase = 0.75 * period; - break; - default: - throw new Error("invalid SROUND value"); - } - n &= 15; - if (n === 0) { - state.srThreshold = 0; - } else { - state.srThreshold = (n / 8 - 0.5) * period; - } - } // S45ROUND[] Super ROUND 45 degrees - // 0x77 - - function S45ROUND(state) { - var n = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "S45ROUND[]", n); - } - state.round = roundSuper; - var period; - switch (n & 192) { - case 0: - period = Math.sqrt(2) / 2; - break; - case 64: - period = Math.sqrt(2); - break; - case 128: - period = 2 * Math.sqrt(2); - break; - default: - throw new Error("invalid S45ROUND value"); - } - state.srPeriod = period; - switch (n & 48) { - case 0: - state.srPhase = 0; - break; - case 16: - state.srPhase = 0.25 * period; - break; - case 32: - state.srPhase = 0.5 * period; - break; - case 48: - state.srPhase = 0.75 * period; - break; - default: - throw new Error("invalid S45ROUND value"); - } - n &= 15; - if (n === 0) { - state.srThreshold = 0; - } else { - state.srThreshold = (n / 8 - 0.5) * period; - } - } // ROFF[] Round Off - // 0x7A - - function ROFF(state) { - if (exports.DEBUG) { - console.log(state.step, "ROFF[]"); - } - state.round = roundOff; - } // RUTG[] Round Up To Grid - // 0x7C - - function RUTG(state) { - if (exports.DEBUG) { - console.log(state.step, "RUTG[]"); - } - state.round = roundUpToGrid; - } // RDTG[] Round Down To Grid - // 0x7D - - function RDTG(state) { - if (exports.DEBUG) { - console.log(state.step, "RDTG[]"); - } - state.round = roundDownToGrid; - } // SCANCTRL[] SCAN conversion ConTRoL - // 0x85 - - function SCANCTRL(state) { - var n = state.stack.pop(); - // ignored by opentype.js - if (exports.DEBUG) { - console.log(state.step, "SCANCTRL[]", n); - } - } // SDPVTL[a] Set Dual Projection Vector To Line - // 0x86-0x87 - - function SDPVTL(a, state) { - var stack = state.stack; - var p2i = stack.pop(); - var p1i = stack.pop(); - var p2 = state.z2[p2i]; - var p1 = state.z1[p1i]; - if (exports.DEBUG) { - console.log(state.step, "SDPVTL[" + a + "]", p2i, p1i); - } - var dx; - var dy; - if (!a) { - dx = p1.x - p2.x; - dy = p1.y - p2.y; - } else { - dx = p2.y - p1.y; - dy = p1.x - p2.x; - } - state.dpv = getUnitVector(dx, dy); - } // GETINFO[] GET INFOrmation - // 0x88 - - function GETINFO(state) { - var stack = state.stack; - var sel = stack.pop(); - var r = 0; - if (exports.DEBUG) { - console.log(state.step, "GETINFO[]", sel); - } // v35 as in no subpixel hinting - - if (sel & 1) { - r = 35; - } // TODO rotation and stretch currently not supported - // and thus those GETINFO are always 0. - // opentype.js is always gray scaling - - if (sel & 32) { - r |= 4096; - } - stack.push(r); - } // ROLL[] ROLL the top three stack elements - // 0x8A - - function ROLL(state) { - var stack = state.stack; - var a = stack.pop(); - var b = stack.pop(); - var c = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "ROLL[]"); - } - stack.push(b); - stack.push(a); - stack.push(c); - } // MAX[] MAXimum of top two stack elements - // 0x8B - - function MAX(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "MAX[]", e2, e1); - } - stack.push(Math.max(e1, e2)); - } // MIN[] MINimum of top two stack elements - // 0x8C - - function MIN(state) { - var stack = state.stack; - var e2 = stack.pop(); - var e1 = stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "MIN[]", e2, e1); - } - stack.push(Math.min(e1, e2)); - } // SCANTYPE[] SCANTYPE - // 0x8D - - function SCANTYPE(state) { - var n = state.stack.pop(); - // ignored by opentype.js - if (exports.DEBUG) { - console.log(state.step, "SCANTYPE[]", n); - } - } // INSTCTRL[] INSTCTRL - // 0x8D - - function INSTCTRL(state) { - var s = state.stack.pop(); - var v = state.stack.pop(); - if (exports.DEBUG) { - console.log(state.step, "INSTCTRL[]", s, v); - } - switch (s) { - case 1: - state.inhibitGridFit = !!v; - return; - case 2: - state.ignoreCvt = !!v; - return; - default: - throw new Error("invalid INSTCTRL[] selector"); - } - } // PUSHB[abc] PUSH Bytes - // 0xB0-0xB7 - - function PUSHB(n, state) { - var stack = state.stack; - var prog = state.prog; - var ip = state.ip; - if (exports.DEBUG) { - console.log(state.step, "PUSHB[" + n + "]"); - } - for (var i = 0; i < n; i++) { - stack.push(prog[++ip]); - } - state.ip = ip; - } // PUSHW[abc] PUSH Words - // 0xB8-0xBF - - function PUSHW(n, state) { - var ip = state.ip; - var prog = state.prog; - var stack = state.stack; - if (exports.DEBUG) { - console.log(state.ip, "PUSHW[" + n + "]"); - } - for (var i = 0; i < n; i++) { - var w = (prog[++ip] << 8) | prog[++ip]; - if (w & 32768) { - w = -((w ^ 65535) + 1); - } - stack.push(w); - } - state.ip = ip; - } // MDRP[abcde] Move Direct Relative Point - // 0xD0-0xEF - // (if indirect is 0) - // - // and - // - // MIRP[abcde] Move Indirect Relative Point - // 0xE0-0xFF - // (if indirect is 1) - - function MDRP_MIRP(indirect, setRp0, keepD, ro, dt, state) { - var stack = state.stack; - var cvte = indirect && stack.pop(); - var pi = stack.pop(); - var rp0i = state.rp0; - var rp = state.z0[rp0i]; - var p = state.z1[pi]; - var md = state.minDis; - var fv = state.fv; - var pv = state.dpv; - var od; // original distance - var d; // moving distance - var sign; // sign of distance - var cv; - d = od = pv.distance(p, rp, true, true); - sign = d >= 0 ? 1 : -1; // Math.sign would be 0 in case of 0 - // TODO consider autoFlip - d = Math.abs(d); - if (indirect) { - cv = state.cvt[cvte]; - if (ro && Math.abs(d - cv) < state.cvCutIn) { - d = cv; - } - } - if (keepD && d < md) { - d = md; - } - if (ro) { - d = state.round(d); - } - fv.setRelative(p, rp, sign * d, pv); - fv.touch(p); - if (exports.DEBUG) { - console.log( - state.step, - (indirect ? "MIRP[" : "MDRP[") + - (setRp0 ? "M" : "m") + - (keepD ? ">" : "_") + - (ro ? "R" : "_") + - (dt === 0 - ? "Gr" - : dt === 1 - ? "Bl" - : dt === 2 - ? "Wh" - : "") + - "]", - indirect - ? cvte + "(" + state.cvt[cvte] + "," + cv + ")" - : "", - pi, - "(d =", - od, - "->", - sign * d, - ")", - ); - } - state.rp1 = state.rp0; - state.rp2 = pi; - if (setRp0) { - state.rp0 = pi; - } - } /* - * The instruction table. - */ - - instructionTable = [ - /* 0x00 */ SVTCA.bind(undefined, yUnitVector), - /* 0x01 */ SVTCA.bind(undefined, xUnitVector), - /* 0x02 */ SPVTCA.bind(undefined, yUnitVector), - /* 0x03 */ SPVTCA.bind(undefined, xUnitVector), - /* 0x04 */ SFVTCA.bind(undefined, yUnitVector), - /* 0x05 */ SFVTCA.bind(undefined, xUnitVector), - /* 0x06 */ SPVTL.bind(undefined, 0), - /* 0x07 */ SPVTL.bind(undefined, 1), - /* 0x08 */ SFVTL.bind(undefined, 0), - /* 0x09 */ SFVTL.bind(undefined, 1), - /* 0x0A */ SPVFS, - /* 0x0B */ SFVFS, - /* 0x0C */ GPV, - /* 0x0D */ GFV, - /* 0x0E */ SFVTPV, - /* 0x0F */ ISECT, - /* 0x10 */ SRP0, - /* 0x11 */ SRP1, - /* 0x12 */ SRP2, - /* 0x13 */ SZP0, - /* 0x14 */ SZP1, - /* 0x15 */ SZP2, - /* 0x16 */ SZPS, - /* 0x17 */ SLOOP, - /* 0x18 */ RTG, - /* 0x19 */ RTHG, - /* 0x1A */ SMD, - /* 0x1B */ ELSE, - /* 0x1C */ JMPR, - /* 0x1D */ SCVTCI, - /* 0x1E */ undefined, - // TODO SSWCI - /* 0x1F */ - undefined, - // TODO SSW - /* 0x20 */ - DUP, - /* 0x21 */ POP, - /* 0x22 */ CLEAR, - /* 0x23 */ SWAP, - /* 0x24 */ DEPTH, - /* 0x25 */ CINDEX, - /* 0x26 */ MINDEX, - /* 0x27 */ undefined, - // TODO ALIGNPTS - /* 0x28 */ - undefined, - /* 0x29 */ undefined, - // TODO UTP - /* 0x2A */ - LOOPCALL, - /* 0x2B */ CALL, - /* 0x2C */ FDEF, - /* 0x2D */ undefined, - // ENDF (eaten by FDEF) - /* 0x2E */ - MDAP.bind(undefined, 0), - /* 0x2F */ MDAP.bind(undefined, 1), - /* 0x30 */ IUP.bind(undefined, yUnitVector), - /* 0x31 */ IUP.bind(undefined, xUnitVector), - /* 0x32 */ SHP.bind(undefined, 0), - /* 0x33 */ SHP.bind(undefined, 1), - /* 0x34 */ SHC.bind(undefined, 0), - /* 0x35 */ SHC.bind(undefined, 1), - /* 0x36 */ SHZ.bind(undefined, 0), - /* 0x37 */ SHZ.bind(undefined, 1), - /* 0x38 */ SHPIX, - /* 0x39 */ IP, - /* 0x3A */ MSIRP.bind(undefined, 0), - /* 0x3B */ MSIRP.bind(undefined, 1), - /* 0x3C */ ALIGNRP, - /* 0x3D */ RTDG, - /* 0x3E */ MIAP.bind(undefined, 0), - /* 0x3F */ MIAP.bind(undefined, 1), - /* 0x40 */ NPUSHB, - /* 0x41 */ NPUSHW, - /* 0x42 */ WS, - /* 0x43 */ RS, - /* 0x44 */ WCVTP, - /* 0x45 */ RCVT, - /* 0x46 */ GC.bind(undefined, 0), - /* 0x47 */ GC.bind(undefined, 1), - /* 0x48 */ undefined, - // TODO SCFS - /* 0x49 */ - MD.bind(undefined, 0), - /* 0x4A */ MD.bind(undefined, 1), - /* 0x4B */ MPPEM, - /* 0x4C */ undefined, - // TODO MPS - /* 0x4D */ - FLIPON, - /* 0x4E */ undefined, - // TODO FLIPOFF - /* 0x4F */ - undefined, - // TODO DEBUG - /* 0x50 */ - LT, - /* 0x51 */ LTEQ, - /* 0x52 */ GT, - /* 0x53 */ GTEQ, - /* 0x54 */ EQ, - /* 0x55 */ NEQ, - /* 0x56 */ ODD, - /* 0x57 */ EVEN, - /* 0x58 */ IF, - /* 0x59 */ EIF, - /* 0x5A */ AND, - /* 0x5B */ OR, - /* 0x5C */ NOT, - /* 0x5D */ DELTAP123.bind(undefined, 1), - /* 0x5E */ SDB, - /* 0x5F */ SDS, - /* 0x60 */ ADD, - /* 0x61 */ SUB, - /* 0x62 */ DIV, - /* 0x63 */ MUL, - /* 0x64 */ ABS, - /* 0x65 */ NEG, - /* 0x66 */ FLOOR, - /* 0x67 */ CEILING, - /* 0x68 */ ROUND.bind(undefined, 0), - /* 0x69 */ ROUND.bind(undefined, 1), - /* 0x6A */ ROUND.bind(undefined, 2), - /* 0x6B */ ROUND.bind(undefined, 3), - /* 0x6C */ undefined, - // TODO NROUND[ab] - /* 0x6D */ - undefined, - // TODO NROUND[ab] - /* 0x6E */ - undefined, - // TODO NROUND[ab] - /* 0x6F */ - undefined, - // TODO NROUND[ab] - /* 0x70 */ - WCVTF, - /* 0x71 */ DELTAP123.bind(undefined, 2), - /* 0x72 */ DELTAP123.bind(undefined, 3), - /* 0x73 */ DELTAC123.bind(undefined, 1), - /* 0x74 */ DELTAC123.bind(undefined, 2), - /* 0x75 */ DELTAC123.bind(undefined, 3), - /* 0x76 */ SROUND, - /* 0x77 */ S45ROUND, - /* 0x78 */ undefined, - // TODO JROT[] - /* 0x79 */ - undefined, - // TODO JROF[] - /* 0x7A */ - ROFF, - /* 0x7B */ undefined, - /* 0x7C */ RUTG, - /* 0x7D */ RDTG, - /* 0x7E */ POP, - // actually SANGW, supposed to do only a pop though - /* 0x7F */ - POP, - // actually AA, supposed to do only a pop though - /* 0x80 */ - undefined, - // TODO FLIPPT - /* 0x81 */ - undefined, - // TODO FLIPRGON - /* 0x82 */ - undefined, - // TODO FLIPRGOFF - /* 0x83 */ - undefined, - /* 0x84 */ undefined, - /* 0x85 */ SCANCTRL, - /* 0x86 */ SDPVTL.bind(undefined, 0), - /* 0x87 */ SDPVTL.bind(undefined, 1), - /* 0x88 */ GETINFO, - /* 0x89 */ undefined, - // TODO IDEF - /* 0x8A */ - ROLL, - /* 0x8B */ MAX, - /* 0x8C */ MIN, - /* 0x8D */ SCANTYPE, - /* 0x8E */ INSTCTRL, - /* 0x8F */ undefined, - /* 0x90 */ undefined, - /* 0x91 */ undefined, - /* 0x92 */ undefined, - /* 0x93 */ undefined, - /* 0x94 */ undefined, - /* 0x95 */ undefined, - /* 0x96 */ undefined, - /* 0x97 */ undefined, - /* 0x98 */ undefined, - /* 0x99 */ undefined, - /* 0x9A */ undefined, - /* 0x9B */ undefined, - /* 0x9C */ undefined, - /* 0x9D */ undefined, - /* 0x9E */ undefined, - /* 0x9F */ undefined, - /* 0xA0 */ undefined, - /* 0xA1 */ undefined, - /* 0xA2 */ undefined, - /* 0xA3 */ undefined, - /* 0xA4 */ undefined, - /* 0xA5 */ undefined, - /* 0xA6 */ undefined, - /* 0xA7 */ undefined, - /* 0xA8 */ undefined, - /* 0xA9 */ undefined, - /* 0xAA */ undefined, - /* 0xAB */ undefined, - /* 0xAC */ undefined, - /* 0xAD */ undefined, - /* 0xAE */ undefined, - /* 0xAF */ undefined, - /* 0xB0 */ PUSHB.bind(undefined, 1), - /* 0xB1 */ PUSHB.bind(undefined, 2), - /* 0xB2 */ PUSHB.bind(undefined, 3), - /* 0xB3 */ PUSHB.bind(undefined, 4), - /* 0xB4 */ PUSHB.bind(undefined, 5), - /* 0xB5 */ PUSHB.bind(undefined, 6), - /* 0xB6 */ PUSHB.bind(undefined, 7), - /* 0xB7 */ PUSHB.bind(undefined, 8), - /* 0xB8 */ PUSHW.bind(undefined, 1), - /* 0xB9 */ PUSHW.bind(undefined, 2), - /* 0xBA */ PUSHW.bind(undefined, 3), - /* 0xBB */ PUSHW.bind(undefined, 4), - /* 0xBC */ PUSHW.bind(undefined, 5), - /* 0xBD */ PUSHW.bind(undefined, 6), - /* 0xBE */ PUSHW.bind(undefined, 7), - /* 0xBF */ PUSHW.bind(undefined, 8), - /* 0xC0 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 0), - /* 0xC1 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 1), - /* 0xC2 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 2), - /* 0xC3 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 0, 3), - /* 0xC4 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 0), - /* 0xC5 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 1), - /* 0xC6 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 2), - /* 0xC7 */ MDRP_MIRP.bind(undefined, 0, 0, 0, 1, 3), - /* 0xC8 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 0), - /* 0xC9 */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 1), - /* 0xCA */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 2), - /* 0xCB */ MDRP_MIRP.bind(undefined, 0, 0, 1, 0, 3), - /* 0xCC */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 0), - /* 0xCD */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 1), - /* 0xCE */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 2), - /* 0xCF */ MDRP_MIRP.bind(undefined, 0, 0, 1, 1, 3), - /* 0xD0 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 0), - /* 0xD1 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 1), - /* 0xD2 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 2), - /* 0xD3 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 0, 3), - /* 0xD4 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 0), - /* 0xD5 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 1), - /* 0xD6 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 2), - /* 0xD7 */ MDRP_MIRP.bind(undefined, 0, 1, 0, 1, 3), - /* 0xD8 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 0), - /* 0xD9 */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 1), - /* 0xDA */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 2), - /* 0xDB */ MDRP_MIRP.bind(undefined, 0, 1, 1, 0, 3), - /* 0xDC */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 0), - /* 0xDD */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 1), - /* 0xDE */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 2), - /* 0xDF */ MDRP_MIRP.bind(undefined, 0, 1, 1, 1, 3), - /* 0xE0 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 0), - /* 0xE1 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 1), - /* 0xE2 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 2), - /* 0xE3 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 0, 3), - /* 0xE4 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 0), - /* 0xE5 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 1), - /* 0xE6 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 2), - /* 0xE7 */ MDRP_MIRP.bind(undefined, 1, 0, 0, 1, 3), - /* 0xE8 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 0), - /* 0xE9 */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 1), - /* 0xEA */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 2), - /* 0xEB */ MDRP_MIRP.bind(undefined, 1, 0, 1, 0, 3), - /* 0xEC */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 0), - /* 0xED */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 1), - /* 0xEE */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 2), - /* 0xEF */ MDRP_MIRP.bind(undefined, 1, 0, 1, 1, 3), - /* 0xF0 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 0), - /* 0xF1 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 1), - /* 0xF2 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 2), - /* 0xF3 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 0, 3), - /* 0xF4 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 0), - /* 0xF5 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 1), - /* 0xF6 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 2), - /* 0xF7 */ MDRP_MIRP.bind(undefined, 1, 1, 0, 1, 3), - /* 0xF8 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 0), - /* 0xF9 */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 1), - /* 0xFA */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 2), - /* 0xFB */ MDRP_MIRP.bind(undefined, 1, 1, 1, 0, 3), - /* 0xFC */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 0), - /* 0xFD */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 1), - /* 0xFE */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 2), - /* 0xFF */ MDRP_MIRP.bind(undefined, 1, 1, 1, 1, 3), - ]; - /***************************** - Mathematical Considerations - ****************************** - fv ... refers to freedom vector - pv ... refers to projection vector - rp ... refers to reference point - p ... refers to to point being operated on - d ... refers to distance - SETRELATIVE: - ============ - case freedom vector == x-axis: - ------------------------------ - (pv) - .-' - rpd .-' - .-* - d .-'90°' - .-' ' - .-' ' - *-' ' b - rp ' - ' - ' - p *----------*-------------- (fv) - pm - rpdx = rpx + d * pv.x - rpdy = rpy + d * pv.y - equation of line b - y - rpdy = pvns * (x- rpdx) - y = p.y - x = rpdx + ( p.y - rpdy ) / pvns - - case freedom vector == y-axis: - ------------------------------ - * pm - |\ - | \ - | \ - | \ - | \ - | \ - | \ - | \ - | \ - | \ b - | \ - | \ - | \ .-' (pv) - | 90° \.-' - | .-'* rpd - | .-' - * *-' d - p rp - rpdx = rpx + d * pv.x - rpdy = rpy + d * pv.y - equation of line b: - pvns ... normal slope to pv - y - rpdy = pvns * (x - rpdx) - x = p.x - y = rpdy + pvns * (p.x - rpdx) - - generic case: - ------------- - - .'(fv) - .' - .* pm - .' ! - .' . - .' ! - .' . b - .' ! - * . - p ! - 90° . ... (pv) - ...-*-''' - ...---''' rpd - ...---''' d - *--''' - rp - rpdx = rpx + d * pv.x - rpdy = rpy + d * pv.y - equation of line b: - pvns... normal slope to pv - y - rpdy = pvns * (x - rpdx) - equation of freedom vector line: - fvs ... slope of freedom vector (=fy/fx) - y - py = fvs * (x - px) - - on pm both equations are true for same x/y - y - rpdy = pvns * (x - rpdx) - y - py = fvs * (x - px) - form to y and set equal: - pvns * (x - rpdx) + rpdy = fvs * (x - px) + py - expand: - pvns * x - pvns * rpdx + rpdy = fvs * x - fvs * px + py - switch: - fvs * x - fvs * px + py = pvns * x - pvns * rpdx + rpdy - solve for x: - fvs * x - pvns * x = fvs * px - pvns * rpdx - py + rpdy - - fvs * px - pvns * rpdx + rpdy - py - x = ----------------------------------- - fvs - pvns - and: - y = fvs * (x - px) + py - - INTERPOLATE: - ============ - Examples of point interpolation. - The weight of the movement of the reference point gets bigger - the further the other reference point is away, thus the safest - option (that is avoiding 0/0 divisions) is to weight the - original distance of the other point by the sum of both distances. - If the sum of both distances is 0, then move the point by the - arithmetic average of the movement of both reference points. - - - (+6) - rp1o *---->*rp1 - . . (+12) - . . rp2o *---------->* rp2 - . . . . - . . . . - . 10 20 . . - |.........|...................| . - . . . - . . (+8) . - po *------>*p . - . . . - . 12 . 24 . - |...........|.......................| - 36 - - ------- - - (+10) - rp1o *-------->*rp1 - . . (-10) - . . rp2 *<---------* rpo2 - . . . . - . . . . - . 10 . 30 . . - |.........|.............................| - . . - . (+5) . - po *--->* p . - . . . - . . 20 . - |....|..............| - 5 15 - - ------- - - (+10) - rp1o *-------->*rp1 - . . - . . - rp2o *-------->*rp2 - - (+10) - po *-------->* p - ------- - - (+10) - rp1o *-------->*rp1 - . . - . .(+30) - rp2o *---------------------------->*rp2 - - (+25) - po *----------------------->* p - - vim: set ts=4 sw=4 expandtab: - *****/ - // The Font object - // This code is based on Array.from implementation for strings in https://github.com/mathiasbynens/Array.from - var arrayFromString = - Array.from || - function (s) { - return ( - s.match( - /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g, - ) || [] - ); - }; - /** - * @typedef FontOptions - * @type Object - * @property {Boolean} empty - whether to create a new empty font - * @property {string} familyName - * @property {string} styleName - * @property {string=} fullName - * @property {string=} postScriptName - * @property {string=} designer - * @property {string=} designerURL - * @property {string=} manufacturer - * @property {string=} manufacturerURL - * @property {string=} license - * @property {string=} licenseURL - * @property {string=} version - * @property {string=} description - * @property {string=} copyright - * @property {string=} trademark - * @property {Number} unitsPerEm - * @property {Number} ascender - * @property {Number} descender - * @property {Number} createdTimestamp - * @property {string=} weightClass - * @property {string=} widthClass - * @property {string=} fsSelection - */ - /** - * A Font represents a loaded OpenType font file. - * It contains a set of glyphs and methods to draw text on a drawing context, - * or to get a path representing the text. - * @exports opentype.Font - * @class - * @param {FontOptions} - * @constructor - */ - function Font(options) { - options = options || {}; - if (!options.empty) { - // Check that we've provided the minimum set of names. - checkArgument( - options.familyName, - "When creating a new Font object, familyName is required.", - ); - checkArgument( - options.styleName, - "When creating a new Font object, styleName is required.", - ); - checkArgument( - options.unitsPerEm, - "When creating a new Font object, unitsPerEm is required.", - ); - checkArgument( - options.ascender, - "When creating a new Font object, ascender is required.", - ); - checkArgument( - options.descender, - "When creating a new Font object, descender is required.", - ); - checkArgument( - options.descender < 0, - "Descender should be negative (e.g. -512).", - ); - // OS X will complain if the names are empty, so we put a single space everywhere by default. - this.names = { - fontFamily: { - en: options.familyName || " ", - }, - fontSubfamily: { - en: options.styleName || " ", - }, - fullName: { - en: - options.fullName || - options.familyName + " " + options.styleName, - }, - // postScriptName may not contain any whitespace - postScriptName: { - en: - options.postScriptName || - (options.familyName + options.styleName).replace( - /\s/g, - "", - ), - }, - designer: { - en: options.designer || " ", - }, - designerURL: { - en: options.designerURL || " ", - }, - manufacturer: { - en: options.manufacturer || " ", - }, - manufacturerURL: { - en: options.manufacturerURL || " ", - }, - license: { - en: options.license || " ", - }, - licenseURL: { - en: options.licenseURL || " ", - }, - version: { - en: options.version || "Version 0.1", - }, - description: { - en: options.description || " ", - }, - copyright: { - en: options.copyright || " ", - }, - trademark: { - en: options.trademark || " ", - }, - }; - this.unitsPerEm = options.unitsPerEm || 1000; - this.ascender = options.ascender; - this.descender = options.descender; - this.createdTimestamp = options.createdTimestamp; - this.tables = { - os2: { - usWeightClass: - options.weightClass || this.usWeightClasses.MEDIUM, - usWidthClass: - options.widthClass || this.usWidthClasses.MEDIUM, - fsSelection: - options.fsSelection || this.fsSelectionValues.REGULAR, - }, - }; - } - this.supported = true; // Deprecated: parseBuffer will throw an error if font is not supported. - this.glyphs = new glyphset.GlyphSet(this, options.glyphs || []); - this.encoding = new DefaultEncoding(this); - this.position = new Position(this); - this.substitution = new Substitution(this); - this.tables = this.tables || {}; - Object.defineProperty(this, "hinting", { - get: function () { - if (this._hinting) { - return this._hinting; - } - if (this.outlinesFormat === "truetype") { - return (this._hinting = new Hinting(this)); - } - }, - }); - } /** - * Check if the font has a glyph for the given character. - * @param {string} - * @return {Boolean} - */ - - Font.prototype.hasChar = function (c) { - return this.encoding.charToGlyphIndex(c) !== null; - }; - /** - * Convert the given character to a single glyph index. - * Note that this function assumes that there is a one-to-one mapping between - * the given character and a glyph; for complex scripts this might not be the case. - * @param {string} - * @return {Number} - */ - Font.prototype.charToGlyphIndex = function (s) { - return this.encoding.charToGlyphIndex(s); - }; - /** - * Convert the given character to a single Glyph object. - * Note that this function assumes that there is a one-to-one mapping between - * the given character and a glyph; for complex scripts this might not be the case. - * @param {string} - * @return {opentype.Glyph} - */ - Font.prototype.charToGlyph = function (c) { - var glyphIndex = this.charToGlyphIndex(c); - var glyph = this.glyphs.get(glyphIndex); - if (!glyph) { - // .notdef - glyph = this.glyphs.get(0); - } - return glyph; - }; - /** - * Convert the given text to a list of Glyph objects. - * Note that there is no strict one-to-one mapping between characters and - * glyphs, so the list of returned glyphs can be larger or smaller than the - * length of the given string. - * @param {string} - * @param {GlyphRenderOptions} [options] - * @return {opentype.Glyph[]} - */ - Font.prototype.stringToGlyphs = function (s, options) { - var this$1 = this; - options = options || this.defaultRenderOptions; - // Get glyph indexes - var chars = arrayFromString(s); - var indexes = []; - for (var i = 0; i < chars.length; i += 1) { - var c = chars[i]; - indexes.push(this$1.charToGlyphIndex(c)); - } - var length = indexes.length; - // Apply substitutions on glyph indexes - if (options.features) { - var script = - options.script || this.substitution.getDefaultScriptName(); - var manyToOne = []; - if (options.features.liga) { - manyToOne = manyToOne.concat( - this.substitution.getFeature( - "liga", - script, - options.language, - ), - ); - } - if (options.features.rlig) { - manyToOne = manyToOne.concat( - this.substitution.getFeature( - "rlig", - script, - options.language, - ), - ); - } - for (var i$1 = 0; i$1 < length; i$1 += 1) { - for (var j = 0; j < manyToOne.length; j++) { - var ligature = manyToOne[j]; - var components = ligature.sub; - var compCount = components.length; - var k = 0; - while ( - k < compCount && - components[k] === indexes[i$1 + k] - ) { - k++; - } - if (k === compCount) { - indexes.splice(i$1, compCount, ligature.by); - length = length - compCount + 1; - } - } - } - } // convert glyph indexes to glyph objects - - var glyphs = new Array(length); - var notdef = this.glyphs.get(0); - for (var i$2 = 0; i$2 < length; i$2 += 1) { - glyphs[i$2] = this$1.glyphs.get(indexes[i$2]) || notdef; - } - return glyphs; - }; - /** - * @param {string} - * @return {Number} - */ - Font.prototype.nameToGlyphIndex = function (name) { - return this.glyphNames.nameToGlyphIndex(name); - }; - /** - * @param {string} - * @return {opentype.Glyph} - */ - Font.prototype.nameToGlyph = function (name) { - var glyphIndex = this.nameToGlyphIndex(name); - var glyph = this.glyphs.get(glyphIndex); - if (!glyph) { - // .notdef - glyph = this.glyphs.get(0); - } - return glyph; - }; - /** - * @param {Number} - * @return {String} - */ - Font.prototype.glyphIndexToName = function (gid) { - if (!this.glyphNames.glyphIndexToName) { - return ""; - } - return this.glyphNames.glyphIndexToName(gid); - }; - /** - * Retrieve the value of the kerning pair between the left glyph (or its index) - * and the right glyph (or its index). If no kerning pair is found, return 0. - * The kerning value gets added to the advance width when calculating the spacing - * between glyphs. - * For GPOS kerning, this method uses the default script and language, which covers - * most use cases. To have greater control, use font.position.getKerningValue . - * @param {opentype.Glyph} leftGlyph - * @param {opentype.Glyph} rightGlyph - * @return {Number} - */ - Font.prototype.getKerningValue = function ( - leftGlyph, - rightGlyph, - ) { - leftGlyph = leftGlyph.index || leftGlyph; - rightGlyph = rightGlyph.index || rightGlyph; - var gposKerning = this.position.defaultKerningTables; - if (gposKerning) { - return this.position.getKerningValue( - gposKerning, - leftGlyph, - rightGlyph, - ); - } // "kern" table - - return this.kerningPairs[leftGlyph + "," + rightGlyph] || 0; - }; - /** - * @typedef GlyphRenderOptions - * @type Object - * @property {string} [script] - script used to determine which features to apply. By default, 'DFLT' or 'latn' is used. - * See https://www.microsoft.com/typography/otspec/scripttags.htm - * @property {string} [language='dflt'] - language system used to determine which features to apply. - * See https://www.microsoft.com/typography/developers/opentype/languagetags.aspx - * @property {boolean} [kerning=true] - whether to include kerning values - * @property {object} [features] - OpenType Layout feature tags. Used to enable or disable the features of the given script/language system. - * See https://www.microsoft.com/typography/otspec/featuretags.htm - */ - Font.prototype.defaultRenderOptions = { - kerning: true, - features: { - liga: true, - rlig: true, - }, - }; - /** - * Helper function that invokes the given callback for each glyph in the given text. - * The callback gets `(glyph, x, y, fontSize, options)`.* @param {string} text - * @param {string} text - The text to apply. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @param {Function} callback - */ - Font.prototype.forEachGlyph = function ( - text, - x, - y, - fontSize, - options, - callback, - ) { - var this$1 = this; - x = x !== undefined ? x : 0; - y = y !== undefined ? y : 0; - fontSize = fontSize !== undefined ? fontSize : 72; - options = options || this.defaultRenderOptions; - var fontScale = (1 / this.unitsPerEm) * fontSize; - var glyphs = this.stringToGlyphs(text, options); - var kerningLookups; - if (options.kerning) { - var script = - options.script || this.position.getDefaultScriptName(); - kerningLookups = this.position.getKerningTables( - script, - options.language, - ); - } - for (var i = 0; i < glyphs.length; i += 1) { - var glyph = glyphs[i]; - callback.call(this$1, glyph, x, y, fontSize, options); - if (glyph.advanceWidth) { - x += glyph.advanceWidth * fontScale; - } - if (options.kerning && i < glyphs.length - 1) { - // We should apply position adjustment lookups in a more generic way. - // Here we only use the xAdvance value. - var kerningValue = kerningLookups - ? this$1.position.getKerningValue( - kerningLookups, - glyph.index, - glyphs[i + 1].index, - ) - : this$1.getKerningValue(glyph, glyphs[i + 1]); - x += kerningValue * fontScale; - } - if (options.letterSpacing) { - x += options.letterSpacing * fontSize; - } else if (options.tracking) { - x += (options.tracking / 1000) * fontSize; - } - } - return x; - }; - /** - * Create a Path object that represents the given text. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @return {opentype.Path} - */ - Font.prototype.getPath = function ( - text, - x, - y, - fontSize, - options, - ) { - var fullPath = new Path(); - this.forEachGlyph( - text, - x, - y, - fontSize, - options, - function (glyph, gX, gY, gFontSize) { - var glyphPath = glyph.getPath( - gX, - gY, - gFontSize, - options, - this, - ); - fullPath.extend(glyphPath); - }, - ); - return fullPath; - }; - /** - * Create an array of Path objects that represent the glyphs of a given text. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @return {opentype.Path[]} - */ - Font.prototype.getPaths = function ( - text, - x, - y, - fontSize, - options, - ) { - var glyphPaths = []; - this.forEachGlyph( - text, - x, - y, - fontSize, - options, - function (glyph, gX, gY, gFontSize) { - var glyphPath = glyph.getPath( - gX, - gY, - gFontSize, - options, - this, - ); - glyphPaths.push(glyphPath); - }, - ); - return glyphPaths; - }; - /** - * Returns the advance width of a text. - * - * This is something different than Path.getBoundingBox() as for example a - * suffixed whitespace increases the advanceWidth but not the bounding box - * or an overhanging letter like a calligraphic 'f' might have a quite larger - * bounding box than its advance width. - * - * This corresponds to canvas2dContext.measureText(text).width - * - * @param {string} text - The text to create. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - * @return advance width - */ - Font.prototype.getAdvanceWidth = function ( - text, - fontSize, - options, - ) { - return this.forEachGlyph( - text, - 0, - 0, - fontSize, - options, - function () {}, - ); - }; - /** - * Draw the text on the given drawing context. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - */ - Font.prototype.draw = function ( - ctx, - text, - x, - y, - fontSize, - options, - ) { - this.getPath(text, x, y, fontSize, options).draw(ctx); - }; - /** - * Draw the points of all glyphs in the text. - * On-curve points will be drawn in blue, off-curve points will be drawn in red. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - */ - Font.prototype.drawPoints = function ( - ctx, - text, - x, - y, - fontSize, - options, - ) { - this.forEachGlyph( - text, - x, - y, - fontSize, - options, - function (glyph, gX, gY, gFontSize) { - glyph.drawPoints(ctx, gX, gY, gFontSize); - }, - ); - }; - /** - * Draw lines indicating important font measurements for all glyphs in the text. - * Black lines indicate the origin of the coordinate system (point 0,0). - * Blue lines indicate the glyph bounding box. - * Green line indicates the advance width of the glyph. - * @param {CanvasRenderingContext2D} ctx - A 2D drawing context, like Canvas. - * @param {string} text - The text to create. - * @param {number} [x=0] - Horizontal position of the beginning of the text. - * @param {number} [y=0] - Vertical position of the *baseline* of the text. - * @param {number} [fontSize=72] - Font size in pixels. We scale the glyph units by `1 / unitsPerEm * fontSize`. - * @param {GlyphRenderOptions=} options - */ - Font.prototype.drawMetrics = function ( - ctx, - text, - x, - y, - fontSize, - options, - ) { - this.forEachGlyph( - text, - x, - y, - fontSize, - options, - function (glyph, gX, gY, gFontSize) { - glyph.drawMetrics(ctx, gX, gY, gFontSize); - }, - ); - }; - /** - * @param {string} - * @return {string} - */ - Font.prototype.getEnglishName = function (name) { - var translations = this.names[name]; - if (translations) { - return translations.en; - } - }; - /** - * Validate - */ - Font.prototype.validate = function () { - var _this = this; - function assert(predicate, message) {} - function assertNamePresent(name) { - var englishName = _this.getEnglishName(name); - assert( - englishName && englishName.trim().length > 0, - "No English " + name + " specified.", - ); - } // Identification information - - assertNamePresent("fontFamily"); - assertNamePresent("weightName"); - assertNamePresent("manufacturer"); - assertNamePresent("copyright"); - assertNamePresent("version"); - // Dimension information - assert(this.unitsPerEm > 0, "No unitsPerEm specified."); - }; - /** - * Convert the font object to a SFNT data structure. - * This structure contains all the necessary tables and metadata to create a binary OTF file. - * @return {opentype.Table} - */ - Font.prototype.toTables = function () { - return sfnt.fontToTable(this); - }; - /** - * @deprecated Font.toBuffer is deprecated. Use Font.toArrayBuffer instead. - */ - Font.prototype.toBuffer = function () { - console.warn( - "Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.", - ); - return this.toArrayBuffer(); - }; - /** - * Converts a `opentype.Font` into an `ArrayBuffer` - * @return {ArrayBuffer} - */ - Font.prototype.toArrayBuffer = function () { - var sfntTable = this.toTables(); - var bytes = sfntTable.encode(); - var buffer = new ArrayBuffer(bytes.length); - var intArray = new Uint8Array(buffer); - for (var i = 0; i < bytes.length; i++) { - intArray[i] = bytes[i]; - } - return buffer; - }; - /** - * Initiate a download of the OpenType font. - */ - Font.prototype.download = function (fileName) { - var familyName = this.getEnglishName("fontFamily"); - var styleName = this.getEnglishName("fontSubfamily"); - fileName = - fileName || - familyName.replace(/\s/g, "") + "-" + styleName + ".otf"; - var arrayBuffer = this.toArrayBuffer(); - if (isBrowser()) { - window.requestFileSystem = - window.requestFileSystem || window.webkitRequestFileSystem; - window.requestFileSystem( - window.TEMPORARY, - arrayBuffer.byteLength, - function (fs) { - fs.root.getFile( - fileName, - { - create: true, - }, - function (fileEntry) { - fileEntry.createWriter(function (writer) { - var dataView = new DataView(arrayBuffer); - var blob = new Blob([dataView], { - type: "font/opentype", - }); - writer.write(blob); - writer.addEventListener( - "writeend", - function () { - // Navigating to the file will download it. - location.href = fileEntry.toURL(); - }, - false, - ); - }); - }, - ); - }, - function (err) { - throw new Error(err.name + ": " + err.message); - }, - ); - } else { - var fs = _dereq_("fs"); - var buffer = arrayBufferToNodeBuffer(arrayBuffer); - fs.writeFileSync(fileName, buffer); - } - }; - /** - * @private - */ - Font.prototype.fsSelectionValues = { - ITALIC: 1, - //1 - UNDERSCORE: 2, - //2 - NEGATIVE: 4, - //4 - OUTLINED: 8, - //8 - STRIKEOUT: 16, - //16 - BOLD: 32, - //32 - REGULAR: 64, - //64 - USER_TYPO_METRICS: 128, - //128 - WWS: 256, - //256 - OBLIQUE: 512, //512 - }; - /** - * @private - */ - Font.prototype.usWidthClasses = { - ULTRA_CONDENSED: 1, - EXTRA_CONDENSED: 2, - CONDENSED: 3, - SEMI_CONDENSED: 4, - MEDIUM: 5, - SEMI_EXPANDED: 6, - EXPANDED: 7, - EXTRA_EXPANDED: 8, - ULTRA_EXPANDED: 9, - }; - /** - * @private - */ - Font.prototype.usWeightClasses = { - THIN: 100, - EXTRA_LIGHT: 200, - LIGHT: 300, - NORMAL: 400, - MEDIUM: 500, - SEMI_BOLD: 600, - BOLD: 700, - EXTRA_BOLD: 800, - BLACK: 900, - }; - // The `fvar` table stores font variation axes and instances. - function addName(name, names) { - var nameString = JSON.stringify(name); - var nameID = 256; - for (var nameKey in names) { - var n = parseInt(nameKey); - if (!n || n < 256) { - continue; - } - if (JSON.stringify(names[nameKey]) === nameString) { - return n; - } - if (nameID <= n) { - nameID = n + 1; - } - } - names[nameID] = name; - return nameID; - } - function makeFvarAxis(n, axis, names) { - var nameID = addName(axis.name, names); - return [ - { - name: "tag_" + n, - type: "TAG", - value: axis.tag, - }, - { - name: "minValue_" + n, - type: "FIXED", - value: axis.minValue << 16, - }, - { - name: "defaultValue_" + n, - type: "FIXED", - value: axis.defaultValue << 16, - }, - { - name: "maxValue_" + n, - type: "FIXED", - value: axis.maxValue << 16, - }, - { - name: "flags_" + n, - type: "USHORT", - value: 0, - }, - { - name: "nameID_" + n, - type: "USHORT", - value: nameID, - }, - ]; - } - function parseFvarAxis(data, start, names) { - var axis = {}; - var p = new parse.Parser(data, start); - axis.tag = p.parseTag(); - axis.minValue = p.parseFixed(); - axis.defaultValue = p.parseFixed(); - axis.maxValue = p.parseFixed(); - p.skip("uShort", 1); // reserved for flags; no values defined - axis.name = names[p.parseUShort()] || {}; - return axis; - } - function makeFvarInstance(n, inst, axes, names) { - var nameID = addName(inst.name, names); - var fields = [ - { - name: "nameID_" + n, - type: "USHORT", - value: nameID, - }, - { - name: "flags_" + n, - type: "USHORT", - value: 0, - }, - ]; - for (var i = 0; i < axes.length; ++i) { - var axisTag = axes[i].tag; - fields.push({ - name: "axis_" + n + " " + axisTag, - type: "FIXED", - value: inst.coordinates[axisTag] << 16, - }); - } - return fields; - } - function parseFvarInstance(data, start, axes, names) { - var inst = {}; - var p = new parse.Parser(data, start); - inst.name = names[p.parseUShort()] || {}; - p.skip("uShort", 1); // reserved for flags; no values defined - inst.coordinates = {}; - for (var i = 0; i < axes.length; ++i) { - inst.coordinates[axes[i].tag] = p.parseFixed(); - } - return inst; - } - function makeFvarTable(fvar, names) { - var result = new table.Table("fvar", [ - { - name: "version", - type: "ULONG", - value: 65536, - }, - { - name: "offsetToData", - type: "USHORT", - value: 0, - }, - { - name: "countSizePairs", - type: "USHORT", - value: 2, - }, - { - name: "axisCount", - type: "USHORT", - value: fvar.axes.length, - }, - { - name: "axisSize", - type: "USHORT", - value: 20, - }, - { - name: "instanceCount", - type: "USHORT", - value: fvar.instances.length, - }, - { - name: "instanceSize", - type: "USHORT", - value: 4 + fvar.axes.length * 4, - }, - ]); - result.offsetToData = result.sizeOf(); - for (var i = 0; i < fvar.axes.length; i++) { - result.fields = result.fields.concat( - makeFvarAxis(i, fvar.axes[i], names), - ); - } - for (var j = 0; j < fvar.instances.length; j++) { - result.fields = result.fields.concat( - makeFvarInstance(j, fvar.instances[j], fvar.axes, names), - ); - } - return result; - } - function parseFvarTable(data, start, names) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseULong(); - check.argument( - tableVersion === 65536, - "Unsupported fvar table version.", - ); - var offsetToData = p.parseOffset16(); - // Skip countSizePairs. - p.skip("uShort", 1); - var axisCount = p.parseUShort(); - var axisSize = p.parseUShort(); - var instanceCount = p.parseUShort(); - var instanceSize = p.parseUShort(); - var axes = []; - for (var i = 0; i < axisCount; i++) { - axes.push( - parseFvarAxis( - data, - start + offsetToData + i * axisSize, - names, - ), - ); - } - var instances = []; - var instanceStart = start + offsetToData + axisCount * axisSize; - for (var j = 0; j < instanceCount; j++) { - instances.push( - parseFvarInstance( - data, - instanceStart + j * instanceSize, - axes, - names, - ), - ); - } - return { - axes: axes, - instances: instances, - }; - } - var fvar = { - make: makeFvarTable, - parse: parseFvarTable, - }; - // The `GPOS` table contains kerning pairs, among other things. - var subtableParsers$1 = new Array(10); // subtableParsers[0] is unused - // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-1-single-adjustment-positioning-subtable - // this = Parser instance - subtableParsers$1[1] = function parseLookup1() { - var start = this.offset + this.relativeOffset; - var posformat = this.parseUShort(); - if (posformat === 1) { - return { - posFormat: 1, - coverage: this.parsePointer(Parser.coverage), - value: this.parseValueRecord(), - }; - } else if (posformat === 2) { - return { - posFormat: 2, - coverage: this.parsePointer(Parser.coverage), - values: this.parseValueRecordList(), - }; - } - check.assert( - false, - "0x" + - start.toString(16) + - ": GPOS lookup type 1 format must be 1 or 2.", - ); - }; - // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#lookup-type-2-pair-adjustment-positioning-subtable - subtableParsers$1[2] = function parseLookup2() { - var start = this.offset + this.relativeOffset; - var posFormat = this.parseUShort(); - check.assert( - posFormat === 1 || posFormat === 2, - "0x" + - start.toString(16) + - ": GPOS lookup type 2 format must be 1 or 2.", - ); - var coverage = this.parsePointer(Parser.coverage); - var valueFormat1 = this.parseUShort(); - var valueFormat2 = this.parseUShort(); - if (posFormat === 1) { - // Adjustments for Glyph Pairs - return { - posFormat: posFormat, - coverage: coverage, - valueFormat1: valueFormat1, - valueFormat2: valueFormat2, - pairSets: this.parseList( - Parser.pointer( - Parser.list(function () { - return { - // pairValueRecord - secondGlyph: this.parseUShort(), - value1: this.parseValueRecord(valueFormat1), - value2: this.parseValueRecord(valueFormat2), - }; - }), - ), - ), - }; - } else if (posFormat === 2) { - var classDef1 = this.parsePointer(Parser.classDef); - var classDef2 = this.parsePointer(Parser.classDef); - var class1Count = this.parseUShort(); - var class2Count = this.parseUShort(); - return { - // Class Pair Adjustment - posFormat: posFormat, - coverage: coverage, - valueFormat1: valueFormat1, - valueFormat2: valueFormat2, - classDef1: classDef1, - classDef2: classDef2, - class1Count: class1Count, - class2Count: class2Count, - classRecords: this.parseList( - class1Count, - Parser.list(class2Count, function () { - return { - value1: this.parseValueRecord(valueFormat1), - value2: this.parseValueRecord(valueFormat2), - }; - }), - ), - }; - } - }; - subtableParsers$1[3] = function parseLookup3() { - return { - error: "GPOS Lookup 3 not supported", - }; - }; - subtableParsers$1[4] = function parseLookup4() { - return { - error: "GPOS Lookup 4 not supported", - }; - }; - subtableParsers$1[5] = function parseLookup5() { - return { - error: "GPOS Lookup 5 not supported", - }; - }; - subtableParsers$1[6] = function parseLookup6() { - return { - error: "GPOS Lookup 6 not supported", - }; - }; - subtableParsers$1[7] = function parseLookup7() { - return { - error: "GPOS Lookup 7 not supported", - }; - }; - subtableParsers$1[8] = function parseLookup8() { - return { - error: "GPOS Lookup 8 not supported", - }; - }; - subtableParsers$1[9] = function parseLookup9() { - return { - error: "GPOS Lookup 9 not supported", - }; - }; - // https://docs.microsoft.com/en-us/typography/opentype/spec/gpos - function parseGposTable(data, start) { - start = start || 0; - var p = new Parser(data, start); - var tableVersion = p.parseVersion(1); - check.argument( - tableVersion === 1 || tableVersion === 1.1, - "Unsupported GPOS table version " + tableVersion, - ); - if (tableVersion === 1) { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers$1), - }; - } else { - return { - version: tableVersion, - scripts: p.parseScriptList(), - features: p.parseFeatureList(), - lookups: p.parseLookupList(subtableParsers$1), - variations: p.parseFeatureVariationsList(), - }; - } - } // GPOS Writing ////////////////////////////////////////////// - // NOT SUPPORTED - - var subtableMakers$1 = new Array(10); - function makeGposTable(gpos) { - return new table.Table("GPOS", [ - { - name: "version", - type: "ULONG", - value: 65536, - }, - { - name: "scripts", - type: "TABLE", - value: new table.ScriptList(gpos.scripts), - }, - { - name: "features", - type: "TABLE", - value: new table.FeatureList(gpos.features), - }, - { - name: "lookups", - type: "TABLE", - value: new table.LookupList(gpos.lookups, subtableMakers$1), - }, - ]); - } - var gpos = { - parse: parseGposTable, - make: makeGposTable, - }; - // The `kern` table contains kerning pairs. - function parseWindowsKernTable(p) { - var pairs = {}; - // Skip nTables. - p.skip("uShort"); - var subtableVersion = p.parseUShort(); - check.argument( - subtableVersion === 0, - "Unsupported kern sub-table version.", - ); - // Skip subtableLength, subtableCoverage - p.skip("uShort", 2); - var nPairs = p.parseUShort(); - // Skip searchRange, entrySelector, rangeShift. - p.skip("uShort", 3); - for (var i = 0; i < nPairs; i += 1) { - var leftIndex = p.parseUShort(); - var rightIndex = p.parseUShort(); - var value = p.parseShort(); - pairs[leftIndex + "," + rightIndex] = value; - } - return pairs; - } - function parseMacKernTable(p) { - var pairs = {}; - // The Mac kern table stores the version as a fixed (32 bits) but we only loaded the first 16 bits. - // Skip the rest. - p.skip("uShort"); - var nTables = p.parseULong(); - //check.argument(nTables === 1, 'Only 1 subtable is supported (got ' + nTables + ').'); - if (nTables > 1) { - console.warn("Only the first kern subtable is supported."); - } - p.skip("uLong"); - var coverage = p.parseUShort(); - var subtableVersion = coverage & 255; - p.skip("uShort"); - if (subtableVersion === 0) { - var nPairs = p.parseUShort(); - // Skip searchRange, entrySelector, rangeShift. - p.skip("uShort", 3); - for (var i = 0; i < nPairs; i += 1) { - var leftIndex = p.parseUShort(); - var rightIndex = p.parseUShort(); - var value = p.parseShort(); - pairs[leftIndex + "," + rightIndex] = value; - } - } - return pairs; - } // Parse the `kern` table which contains kerning pairs. - - function parseKernTable(data, start) { - var p = new parse.Parser(data, start); - var tableVersion = p.parseUShort(); - if (tableVersion === 0) { - return parseWindowsKernTable(p); - } else if (tableVersion === 1) { - return parseMacKernTable(p); - } else { - throw new Error( - "Unsupported kern table version (" + tableVersion + ").", - ); - } - } - var kern = { - parse: parseKernTable, - }; - // The `loca` table stores the offsets to the locations of the glyphs in the font. - // Parse the `loca` table. This table stores the offsets to the locations of the glyphs in the font, - // relative to the beginning of the glyphData table. - // The number of glyphs stored in the `loca` table is specified in the `maxp` table (under numGlyphs) - // The loca table has two versions: a short version where offsets are stored as uShorts, and a long - // version where offsets are stored as uLongs. The `head` table specifies which version to use - // (under indexToLocFormat). - function parseLocaTable(data, start, numGlyphs, shortVersion) { - var p = new parse.Parser(data, start); - var parseFn = shortVersion ? p.parseUShort : p.parseULong; - // There is an extra entry after the last index element to compute the length of the last glyph. - // That's why we use numGlyphs + 1. - var glyphOffsets = []; - for (var i = 0; i < numGlyphs + 1; i += 1) { - var glyphOffset = parseFn.call(p); - if (shortVersion) { - // The short table version stores the actual offset divided by 2. - glyphOffset *= 2; - } - glyphOffsets.push(glyphOffset); - } - return glyphOffsets; - } - var loca = { - parse: parseLocaTable, - }; - // opentype.js - /** - * The opentype library. - * @namespace opentype - */ - // File loaders ///////////////////////////////////////////////////////// - /** - * Loads a font from a file. The callback throws an error message as the first parameter if it fails - * and the font as an ArrayBuffer in the second parameter if it succeeds. - * @param {string} path - The path of the file - * @param {Function} callback - The function to call when the font load completes - */ - function loadFromFile(path, callback) { - var fs = _dereq_("fs"); - fs.readFile(path, function (err, buffer) { - if (err) { - return callback(err.message); - } - callback(null, nodeBufferToArrayBuffer(buffer)); - }); - } /** - * Loads a font from a URL. The callback throws an error message as the first parameter if it fails - * and the font as an ArrayBuffer in the second parameter if it succeeds. - * @param {string} url - The URL of the font file. - * @param {Function} callback - The function to call when the font load completes - */ - - function loadFromUrl(url, callback) { - var request = new XMLHttpRequest(); - request.open("get", url, true); - request.responseType = "arraybuffer"; - request.onload = function () { - if (request.response) { - return callback(null, request.response); - } else { - return callback( - "Font could not be loaded: " + request.statusText, - ); - } - }; - request.onerror = function () { - callback("Font could not be loaded"); - }; - request.send(); - } // Table Directory Entries ////////////////////////////////////////////// - /** - * Parses OpenType table entries. - * @param {DataView} - * @param {Number} - * @return {Object[]} - */ - - function parseOpenTypeTableEntries(data, numTables) { - var tableEntries = []; - var p = 12; - for (var i = 0; i < numTables; i += 1) { - var tag = parse.getTag(data, p); - var checksum = parse.getULong(data, p + 4); - var offset = parse.getULong(data, p + 8); - var length = parse.getULong(data, p + 12); - tableEntries.push({ - tag: tag, - checksum: checksum, - offset: offset, - length: length, - compression: false, - }); - p += 16; - } - return tableEntries; - } /** - * Parses WOFF table entries. - * @param {DataView} - * @param {Number} - * @return {Object[]} - */ - - function parseWOFFTableEntries(data, numTables) { - var tableEntries = []; - var p = 44; // offset to the first table directory entry. - for (var i = 0; i < numTables; i += 1) { - var tag = parse.getTag(data, p); - var offset = parse.getULong(data, p + 4); - var compLength = parse.getULong(data, p + 8); - var origLength = parse.getULong(data, p + 12); - var compression = void 0; - if (compLength < origLength) { - compression = "WOFF"; - } else { - compression = false; - } - tableEntries.push({ - tag: tag, - offset: offset, - compression: compression, - compressedLength: compLength, - length: origLength, - }); - p += 20; - } - return tableEntries; - } - /** - * @typedef TableData - * @type Object - * @property {DataView} data - The DataView - * @property {number} offset - The data offset. - */ - /** - * @param {DataView} - * @param {Object} - * @return {TableData} - */ - - function uncompressTable(data, tableEntry) { - if (tableEntry.compression === "WOFF") { - var inBuffer = new Uint8Array( - data.buffer, - tableEntry.offset + 2, - tableEntry.compressedLength - 2, - ); - var outBuffer = new Uint8Array(tableEntry.length); - tinyInflate(inBuffer, outBuffer); - if (outBuffer.byteLength !== tableEntry.length) { - throw new Error( - "Decompression error: " + - tableEntry.tag + - " decompressed length doesn't match recorded length", - ); - } - var view = new DataView(outBuffer.buffer, 0); - return { - data: view, - offset: 0, - }; - } else { - return { - data: data, - offset: tableEntry.offset, - }; - } - } // Public API /////////////////////////////////////////////////////////// - /** - * Parse the OpenType file data (as an ArrayBuffer) and return a Font object. - * Throws an error if the font could not be parsed. - * @param {ArrayBuffer} - * @return {opentype.Font} - */ - - function parseBuffer(buffer) { - var indexToLocFormat; - var ltagTable; - // Since the constructor can also be called to create new fonts from scratch, we indicate this - // should be an empty font that we'll fill with our own data. - var font = new Font({ - empty: true, - }); - // OpenType fonts use big endian byte ordering. - // We can't rely on typed array view types, because they operate with the endianness of the host computer. - // Instead we use DataViews where we can specify endianness. - var data = new DataView(buffer, 0); - var numTables; - var tableEntries = []; - var signature = parse.getTag(data, 0); - if ( - signature === String.fromCharCode(0, 1, 0, 0) || - signature === "true" || - signature === "typ1" - ) { - font.outlinesFormat = "truetype"; - numTables = parse.getUShort(data, 4); - tableEntries = parseOpenTypeTableEntries(data, numTables); - } else if (signature === "OTTO") { - font.outlinesFormat = "cff"; - numTables = parse.getUShort(data, 4); - tableEntries = parseOpenTypeTableEntries(data, numTables); - } else if (signature === "wOFF") { - var flavor = parse.getTag(data, 4); - if (flavor === String.fromCharCode(0, 1, 0, 0)) { - font.outlinesFormat = "truetype"; - } else if (flavor === "OTTO") { - font.outlinesFormat = "cff"; - } else { - throw new Error("Unsupported OpenType flavor " + signature); - } - numTables = parse.getUShort(data, 12); - tableEntries = parseWOFFTableEntries(data, numTables); - } else { - throw new Error( - "Unsupported OpenType signature " + signature, - ); - } - var cffTableEntry; - var fvarTableEntry; - var glyfTableEntry; - var gposTableEntry; - var gsubTableEntry; - var hmtxTableEntry; - var kernTableEntry; - var locaTableEntry; - var nameTableEntry; - var metaTableEntry; - var p; - for (var i = 0; i < numTables; i += 1) { - var tableEntry = tableEntries[i]; - var table = void 0; - switch (tableEntry.tag) { - case "cmap": - table = uncompressTable(data, tableEntry); - font.tables.cmap = cmap.parse(table.data, table.offset); - font.encoding = new CmapEncoding(font.tables.cmap); - break; - case "cvt ": - table = uncompressTable(data, tableEntry); - p = new parse.Parser(table.data, table.offset); - font.tables.cvt = p.parseShortList(tableEntry.length / 2); - break; - case "fvar": - fvarTableEntry = tableEntry; - break; - case "fpgm": - table = uncompressTable(data, tableEntry); - p = new parse.Parser(table.data, table.offset); - font.tables.fpgm = p.parseByteList(tableEntry.length); - break; - case "head": - table = uncompressTable(data, tableEntry); - font.tables.head = head.parse(table.data, table.offset); - font.unitsPerEm = font.tables.head.unitsPerEm; - indexToLocFormat = font.tables.head.indexToLocFormat; - break; - case "hhea": - table = uncompressTable(data, tableEntry); - font.tables.hhea = hhea.parse(table.data, table.offset); - font.ascender = font.tables.hhea.ascender; - font.descender = font.tables.hhea.descender; - font.numberOfHMetrics = font.tables.hhea.numberOfHMetrics; - break; - case "hmtx": - hmtxTableEntry = tableEntry; - break; - case "ltag": - table = uncompressTable(data, tableEntry); - ltagTable = ltag.parse(table.data, table.offset); - break; - case "maxp": - table = uncompressTable(data, tableEntry); - font.tables.maxp = maxp.parse(table.data, table.offset); - font.numGlyphs = font.tables.maxp.numGlyphs; - break; - case "name": - nameTableEntry = tableEntry; - break; - case "OS/2": - table = uncompressTable(data, tableEntry); - font.tables.os2 = os2.parse(table.data, table.offset); - break; - case "post": - table = uncompressTable(data, tableEntry); - font.tables.post = post.parse(table.data, table.offset); - font.glyphNames = new GlyphNames(font.tables.post); - break; - case "prep": - table = uncompressTable(data, tableEntry); - p = new parse.Parser(table.data, table.offset); - font.tables.prep = p.parseByteList(tableEntry.length); - break; - case "glyf": - glyfTableEntry = tableEntry; - break; - case "loca": - locaTableEntry = tableEntry; - break; - case "CFF ": - cffTableEntry = tableEntry; - break; - case "kern": - kernTableEntry = tableEntry; - break; - case "GPOS": - gposTableEntry = tableEntry; - break; - case "GSUB": - gsubTableEntry = tableEntry; - break; - case "meta": - metaTableEntry = tableEntry; - break; - } - } - var nameTable = uncompressTable(data, nameTableEntry); - font.tables.name = _name.parse( - nameTable.data, - nameTable.offset, - ltagTable, - ); - font.names = font.tables.name; - if (glyfTableEntry && locaTableEntry) { - var shortVersion = indexToLocFormat === 0; - var locaTable = uncompressTable(data, locaTableEntry); - var locaOffsets = loca.parse( - locaTable.data, - locaTable.offset, - font.numGlyphs, - shortVersion, - ); - var glyfTable = uncompressTable(data, glyfTableEntry); - font.glyphs = glyf.parse( - glyfTable.data, - glyfTable.offset, - locaOffsets, - font, - ); - } else if (cffTableEntry) { - var cffTable = uncompressTable(data, cffTableEntry); - cff.parse(cffTable.data, cffTable.offset, font); - } else { - throw new Error( - "Font doesn't contain TrueType or CFF outlines.", - ); - } - var hmtxTable = uncompressTable(data, hmtxTableEntry); - hmtx.parse( - hmtxTable.data, - hmtxTable.offset, - font.numberOfHMetrics, - font.numGlyphs, - font.glyphs, - ); - addGlyphNames(font); - if (kernTableEntry) { - var kernTable = uncompressTable(data, kernTableEntry); - font.kerningPairs = kern.parse( - kernTable.data, - kernTable.offset, - ); - } else { - font.kerningPairs = {}; - } - if (gposTableEntry) { - var gposTable = uncompressTable(data, gposTableEntry); - font.tables.gpos = gpos.parse( - gposTable.data, - gposTable.offset, - ); - font.position.init(); - } - if (gsubTableEntry) { - var gsubTable = uncompressTable(data, gsubTableEntry); - font.tables.gsub = gsub.parse( - gsubTable.data, - gsubTable.offset, - ); - } - if (fvarTableEntry) { - var fvarTable = uncompressTable(data, fvarTableEntry); - font.tables.fvar = fvar.parse( - fvarTable.data, - fvarTable.offset, - font.names, - ); - } - if (metaTableEntry) { - var metaTable = uncompressTable(data, metaTableEntry); - font.tables.meta = meta.parse( - metaTable.data, - metaTable.offset, - ); - font.metas = font.tables.meta; - } - return font; - } /** - * Asynchronously load the font from a URL or a filesystem. When done, call the callback - * with two arguments `(err, font)`. The `err` will be null on success, - * the `font` is a Font object. - * We use the node.js callback convention so that - * opentype.js can integrate with frameworks like async.js. - * @alias opentype.load - * @param {string} url - The URL of the font to load. - * @param {Function} callback - The callback. - */ - - function load(url, callback) { - var isNode$$1 = typeof window === "undefined"; - var loadFn = isNode$$1 ? loadFromFile : loadFromUrl; - loadFn(url, function (err, arrayBuffer) { - if (err) { - return callback(err); - } - var font; - try { - font = parseBuffer(arrayBuffer); - } catch (e) { - return callback(e, null); - } - return callback(null, font); - }); - } /** - * Synchronously load the font from a URL or file. - * When done, returns the font object or throws an error. - * @alias opentype.loadSync - * @param {string} url - The URL of the font to load. - * @return {opentype.Font} - */ - - function loadSync(url) { - var fs = _dereq_("fs"); - var buffer = fs.readFileSync(url); - return parseBuffer(nodeBufferToArrayBuffer(buffer)); - } - exports.Font = Font; - exports.Glyph = Glyph; - exports.Path = Path; - exports.BoundingBox = BoundingBox; - exports._parse = parse; - exports.parse = parseBuffer; - exports.load = load; - exports.loadSync = loadSync; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - }); - }).call(this, _dereq_("buffer").Buffer); - }, - { - buffer: 22, - fs: 21, - }, - ], - 272: [ - function (_dereq_, module, exports) { - (function (process) { - // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, - // backported and transplited with Babel, with backwards-compat fixes - // Copyright Joyent, Inc. and other Node contributors. - // - // 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. - // resolves . and .. elements in a path array with directory names there - // must be no slashes, empty elements, or device names (c:\) in the array - // (so also no leading and trailing slashes - it does not distinguish - // relative and absolute paths) - function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === ".") { - parts.splice(i, 1); - } else if (last === "..") { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } // if the path is allowed to go above the root, restore leading ..s - - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift(".."); - } - } - return parts; - } // path.resolve([from ...], to) - // posix version - - exports.resolve = function () { - var resolvedPath = "", - resolvedAbsolute = false; - for ( - var i = arguments.length - 1; - i >= -1 && !resolvedAbsolute; - i-- - ) { - var path = i >= 0 ? arguments[i] : process.cwd(); - // Skip empty and invalid entries - if (typeof path !== "string") { - throw new TypeError( - "Arguments to path.resolve must be strings", - ); - } else if (!path) { - continue; - } - resolvedPath = path + "/" + resolvedPath; - resolvedAbsolute = path.charAt(0) === "/"; - } // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - // Normalize the path - - resolvedPath = normalizeArray( - filter(resolvedPath.split("/"), function (p) { - return !!p; - }), - !resolvedAbsolute, - ).join("/"); - return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; - }; - // path.normalize(path) - // posix version - exports.normalize = function (path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === "/"; - // Normalize the path - path = normalizeArray( - filter(path.split("/"), function (p) { - return !!p; - }), - !isAbsolute, - ).join("/"); - if (!path && !isAbsolute) { - path = "."; - } - if (path && trailingSlash) { - path += "/"; - } - return (isAbsolute ? "/" : "") + path; - }; - // posix version - exports.isAbsolute = function (path) { - return path.charAt(0) === "/"; - }; - // posix version - exports.join = function () { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize( - filter(paths, function (p, index) { - if (typeof p !== "string") { - throw new TypeError( - "Arguments to path.join must be strings", - ); - } - return p; - }).join("/"), - ); - }; - // path.relative(from, to) - // posix version - exports.relative = function (from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== "") break; - } - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== "") break; - } - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - var fromParts = trim(from.split("/")); - var toParts = trim(to.split("/")); - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push(".."); - } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - return outputParts.join("/"); - }; - exports.sep = "/"; - exports.delimiter = ":"; - exports.dirname = function (path) { - if (typeof path !== "string") path = path + ""; - if (path.length === 0) return "."; - var code = path.charCodeAt(0); - var hasRoot = code === 47; /*/*/ - var end = -1; - var matchedSlash = true; - for (var i = path.length - 1; i >= 1; --i) { - code = path.charCodeAt(i); - if (code === 47 /*/*/) { - if (!matchedSlash) { - end = i; - break; - } - } else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) return hasRoot ? "/" : "."; - if (hasRoot && end === 1) { - // return '//'; - // Backwards-compat fix: - return "/"; - } - return path.slice(0, end); - }; - function basename(path) { - if (typeof path !== "string") path = path + ""; - var start = 0; - var end = -1; - var matchedSlash = true; - var i; - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) return ""; - return path.slice(start, end); - } // Uses a mixed approach for backwards-compatibility, as ext behavior changed - // in new Node.js versions, so only basename() above is backported here - - exports.basename = function (path, ext) { - var f = basename(path); - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; - }; - exports.extname = function (path) { - if (typeof path !== "string") path = path + ""; - var startDot = -1; - var startPart = 0; - var end = -1; - var matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - var preDotState = 0; - for (var i = path.length - 1; i >= 0; --i) { - var code = path.charCodeAt(i); - if (code === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === 46 /*.*/) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) startDot = i; - else if (preDotState !== 1) preDotState = 1; - } else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if ( - startDot === -1 || - end === -1 || // We saw a non-dot character immediately before the dot - preDotState === 0 || // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1) - ) { - return ""; - } - return path.slice(startDot, end); - }; - function filter(xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; - } // String.prototype.substr - negative index don't work in IE8 - - var substr = - "ab".substr(-1) === "b" - ? function (str, start, len) { - return str.substr(start, len); - } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - }; - }).call(this, _dereq_("_process")); - }, - { - _process: 273, - }, - ], - 273: [ - function (_dereq_, module, exports) { - // shim for using process in browser - var process = (module.exports = {}); - // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. - var cachedSetTimeout; - var cachedClearTimeout; - function defaultSetTimout() { - throw new Error("setTimeout has not been defined"); - } - function defaultClearTimeout() { - throw new Error("clearTimeout has not been defined"); - } - (function () { - try { - if (typeof setTimeout === "function") { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === "function") { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - })(); - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } // if setTimeout wasn't available but was latter defined - - if ( - (cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && - setTimeout - ) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - } - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } // if clearTimeout wasn't available but was latter defined - - if ( - (cachedClearTimeout === defaultClearTimeout || - !cachedClearTimeout) && - clearTimeout - ) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e) { - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e) { - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - } - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - while (len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = "browser"; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ""; // empty string to avoid regexp issues - process.versions = {}; - function noop() {} - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - process.listeners = function (name) { - return []; - }; - process.binding = function (name) { - throw new Error("process.binding is not supported"); - }; - process.cwd = function () { - return "/"; - }; - process.chdir = function (dir) { - throw new Error("process.chdir is not supported"); - }; - process.umask = function () { - return 0; - }; - }, - {}, - ], - 274: [ - function (_dereq_, module, exports) { - /** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - var runtime = (function (exports) { - "use strict"; - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = - $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = - outerFn && outerFn.prototype instanceof Generator - ? outerFn - : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - return generator; - } - exports.wrap = wrap; - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { - type: "normal", - arg: fn.call(obj, arg), - }; - } catch (err) { - return { - type: "throw", - arg: err, - }; - } - } - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = - getProto && getProto(getProto(values([]))); - if ( - NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol) - ) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - var Gp = - (GeneratorFunctionPrototype.prototype = - Generator.prototype = - Object.create(IteratorPrototype)); - GeneratorFunction.prototype = Gp.constructor = - GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = - GeneratorFunction.displayName = "GeneratorFunction"; - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function (method) { - prototype[method] = function (arg) { - return this._invoke(method, arg); - }; - }); - } - exports.isGeneratorFunction = function (genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - exports.mark = function (genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function (arg) { - return { - __await: arg, - }; - }; - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if ( - value && - typeof value === "object" && - hasOwn.call(value, "__await") - ) { - return Promise.resolve(value.__await).then( - function (value) { - invoke("next", value, resolve, reject); - }, - function (err) { - invoke("throw", err, resolve, reject); - }, - ); - } - return Promise.resolve(value).then( - function (unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, - function (error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }, - ); - } - } - var previousPromise; - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function (resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - return (previousPromise = // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise - ? previousPromise.then( - callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg, - ) - : callInvokeWithMethodAndArg()); - } // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - - this._invoke = enqueue; - } - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - exports.AsyncIterator = AsyncIterator; - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function (innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList), - ); - return exports.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function (result) { - return result.done ? result.value : iter.next(); - }); - }; - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - - return doneResult(); - } - context.method = method; - context.arg = arg; - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - context.dispatchException(context.arg); - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - state = GenStateExecuting; - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - if (record.arg === ContinueSentinel) { - continue; - } - return { - value: record.arg, - done: context.done, - }; - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method", - ); - } - return ContinueSentinel; - } - var record = tryCatch(method, delegate.iterator, context.arg); - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - var info = record.arg; - if (!info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - } else { - // Re-yield the result returned by the delegate method. - return info; - } // The delegate iterator is finished, so forget it and continue with - // the outer generator. - - context.delegate = null; - return ContinueSentinel; - } // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - - defineIteratorMethods(Gp); - Gp[toStringTagSymbol] = "Generator"; - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function () { - return this; - }; - Gp.toString = function () { - return "[object Generator]"; - }; - function pushTryEntry(locs) { - var entry = { - tryLoc: locs[0], - }; - if (1 in locs) { - entry.catchLoc = locs[1]; - } - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - this.tryEntries.push(entry); - } - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [ - { - tryLoc: "root", - }, - ]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - exports.keys = function (object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - - next.done = true; - return next; - }; - }; - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - if (typeof iterable.next === "function") { - return iterable; - } - if (!isNaN(iterable.length)) { - var i = -1, - next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - next.value = undefined; - next.done = true; - return next; - }; - return (next.next = next); - } - } // Return an iterator with no values. - - return { - next: doneResult, - }; - } - exports.values = values; - function doneResult() { - return { - value: undefined, - done: true, - }; - } - Context.prototype = { - constructor: Context, - reset: function (skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - this.method = "next"; - this.arg = undefined; - this.tryEntries.forEach(resetTryEntry); - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if ( - name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1)) - ) { - this[name] = undefined; - } - } - } - }, - stop: function () { - this.done = true; - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - return this.rval; - }, - dispatchException: function (exception) { - if (this.done) { - throw exception; - } - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - return !!caught; - } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - abrupt: function (type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if ( - entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc - ) { - var finallyEntry = entry; - break; - } - } - if ( - finallyEntry && - (type === "break" || type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc - ) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - return this.complete(record); - }, - complete: function (record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - if (record.type === "break" || record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - return ContinueSentinel; - }, - finish: function (finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - catch: function (tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - - throw new Error("illegal catch attempt"); - }, - delegateYield: function (iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc, - }; - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - return ContinueSentinel; - }, - }; - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - })( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - typeof module === "object" ? module.exports : {}, - ); - try { - regeneratorRuntime = runtime; - } catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); - } - }, - {}, - ], - 275: [ - function (_dereq_, module, exports) { - (function (self) { - "use strict"; - if (self.fetch) { - return; - } - var support = { - searchParams: "URLSearchParams" in self, - iterable: "Symbol" in self && "iterator" in Symbol, - blob: - "FileReader" in self && - "Blob" in self && - (function () { - try { - new Blob(); - return true; - } catch (e) { - return false; - } - })(), - formData: "FormData" in self, - arrayBuffer: "ArrayBuffer" in self, - }; - if (support.arrayBuffer) { - var viewClasses = [ - "[object Int8Array]", - "[object Uint8Array]", - "[object Uint8ClampedArray]", - "[object Int16Array]", - "[object Uint16Array]", - "[object Int32Array]", - "[object Uint32Array]", - "[object Float32Array]", - "[object Float64Array]", - ]; - var isDataView = function (obj) { - return obj && DataView.prototype.isPrototypeOf(obj); - }; - var isArrayBufferView = - ArrayBuffer.isView || - function (obj) { - return ( - obj && - viewClasses.indexOf(Object.prototype.toString.call(obj)) > - -1 - ); - }; - } - function normalizeName(name) { - if (typeof name !== "string") { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { - throw new TypeError("Invalid character in header field name"); - } - return name.toLowerCase(); - } - function normalizeValue(value) { - if (typeof value !== "string") { - value = String(value); - } - return value; - } // Build a destructive iterator for the value list - - function iteratorFor(items) { - var iterator = { - next: function () { - var value = items.shift(); - return { - done: value === undefined, - value: value, - }; - }, - }; - if (support.iterable) { - iterator[Symbol.iterator] = function () { - return iterator; - }; - } - return iterator; - } - function Headers(headers) { - this.map = {}; - if (headers instanceof Headers) { - headers.forEach(function (value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function (header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function (name) { - this.append(name, headers[name]); - }, this); - } - } - Headers.prototype.append = function (name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + "," + value : value; - }; - Headers.prototype["delete"] = function (name) { - delete this.map[normalizeName(name)]; - }; - Headers.prototype.get = function (name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null; - }; - Headers.prototype.has = function (name) { - return this.map.hasOwnProperty(normalizeName(name)); - }; - Headers.prototype.set = function (name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - Headers.prototype.forEach = function (callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - Headers.prototype.keys = function () { - var items = []; - this.forEach(function (value, name) { - items.push(name); - }); - return iteratorFor(items); - }; - Headers.prototype.values = function () { - var items = []; - this.forEach(function (value) { - items.push(value); - }); - return iteratorFor(items); - }; - Headers.prototype.entries = function () { - var items = []; - this.forEach(function (value, name) { - items.push([name, value]); - }); - return iteratorFor(items); - }; - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError("Already read")); - } - body.bodyUsed = true; - } - function fileReaderReady(reader) { - return new Promise(function (resolve, reject) { - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error); - }; - }); - } - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise; - } - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise; - } - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join(""); - } - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0); - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer; - } - } - function Body() { - this.bodyUsed = false; - this._initBody = function (body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ""; - } else if (typeof body === "string") { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if ( - support.formData && - FormData.prototype.isPrototypeOf(body) - ) { - this._bodyFormData = body; - } else if ( - support.searchParams && - URLSearchParams.prototype.isPrototypeOf(body) - ) { - this._bodyText = body.toString(); - } else if ( - support.arrayBuffer && - support.blob && - isDataView(body) - ) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if ( - support.arrayBuffer && - (ArrayBuffer.prototype.isPrototypeOf(body) || - isArrayBufferView(body)) - ) { - this._bodyArrayBuffer = bufferClone(body); - } else { - throw new Error("unsupported BodyInit type"); - } - if (!this.headers.get("content-type")) { - if (typeof body === "string") { - this.headers.set( - "content-type", - "text/plain;charset=UTF-8", - ); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set("content-type", this._bodyBlob.type); - } else if ( - support.searchParams && - URLSearchParams.prototype.isPrototypeOf(body) - ) { - this.headers.set( - "content-type", - "application/x-www-form-urlencoded;charset=UTF-8", - ); - } - } - }; - if (support.blob) { - this.blob = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob); - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])); - } else if (this._bodyFormData) { - throw new Error("could not read FormData body as blob"); - } else { - return Promise.resolve(new Blob([this._bodyText])); - } - }; - this.arrayBuffer = function () { - if (this._bodyArrayBuffer) { - return ( - consumed(this) || Promise.resolve(this._bodyArrayBuffer) - ); - } else { - return this.blob().then(readBlobAsArrayBuffer); - } - }; - } - this.text = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob); - } else if (this._bodyArrayBuffer) { - return Promise.resolve( - readArrayBufferAsText(this._bodyArrayBuffer), - ); - } else if (this._bodyFormData) { - throw new Error("could not read FormData body as text"); - } else { - return Promise.resolve(this._bodyText); - } - }; - if (support.formData) { - this.formData = function () { - return this.text().then(decode); - }; - } - this.json = function () { - return this.text().then(JSON.parse); - }; - return this; - } // HTTP methods whose capitalization should be normalized - - var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method; - } - function Request(input, options) { - options = options || {}; - var body = options.body; - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError("Already read"); - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - this.credentials = - options.credentials || this.credentials || "omit"; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod( - options.method || this.method || "GET", - ); - this.mode = options.mode || this.mode || null; - this.referrer = null; - if ((this.method === "GET" || this.method === "HEAD") && body) { - throw new TypeError( - "Body not allowed for GET or HEAD requests", - ); - } - this._initBody(body); - } - Request.prototype.clone = function () { - return new Request(this, { - body: this._bodyInit, - }); - }; - function decode(body) { - var form = new FormData(); - body - .trim() - .split("&") - .forEach(function (bytes) { - if (bytes) { - var split = bytes.split("="); - var name = split.shift().replace(/\+/g, " "); - var value = split.join("=").replace(/\+/g, " "); - form.append( - decodeURIComponent(name), - decodeURIComponent(value), - ); - } - }); - return form; - } - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " "); - preProcessedHeaders.split(/\r?\n/).forEach(function (line) { - var parts = line.split(":"); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(":").trim(); - headers.append(key, value); - } - }); - return headers; - } - Body.call(Request.prototype); - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - this.type = "default"; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = - "statusText" in options ? options.statusText : "OK"; - this.headers = new Headers(options.headers); - this.url = options.url || ""; - this._initBody(bodyInit); - } - Body.call(Response.prototype); - Response.prototype.clone = function () { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url, - }); - }; - Response.error = function () { - var response = new Response(null, { - status: 0, - statusText: "", - }); - response.type = "error"; - return response; - }; - var redirectStatuses = [301, 302, 303, 307, 308]; - Response.redirect = function (url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError("Invalid status code"); - } - return new Response(null, { - status: status, - headers: { - location: url, - }, - }); - }; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - self.fetch = function (input, init) { - return new Promise(function (resolve, reject) { - var request = new Request(input, init); - var xhr = new XMLHttpRequest(); - xhr.onload = function () { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || ""), - }; - options.url = - "responseURL" in xhr - ? xhr.responseURL - : options.headers.get("X-Request-URL"); - var body = - "response" in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - xhr.onerror = function () { - reject(new TypeError("Network request failed")); - }; - xhr.ontimeout = function () { - reject(new TypeError("Network request failed")); - }; - xhr.open(request.method, request.url, true); - if (request.credentials === "include") { - xhr.withCredentials = true; - } else if (request.credentials === "omit") { - xhr.withCredentials = false; - } - if ("responseType" in xhr && support.blob) { - xhr.responseType = "blob"; - } - request.headers.forEach(function (value, name) { - xhr.setRequestHeader(name, value); - }); - xhr.send( - typeof request._bodyInit === "undefined" - ? null - : request._bodyInit, - ); - }); - }; - self.fetch.polyfill = true; - })(typeof self !== "undefined" ? self : this); - }, - {}, - ], - 276: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.split"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var _color_conversion = _interopRequireDefault( - _dereq_("../color/color_conversion"), - ); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - //stores the original hsb values - - var originalHSB; - //stores values for color name exceptions - var colorExceptions = [ - { - h: 0, - s: 0, - b: 0.8275, - name: "gray", - }, - { - h: 0, - s: 0, - b: 0.8627, - name: "gray", - }, - { - h: 0, - s: 0, - b: 0.7529, - name: "gray", - }, - { - h: 0.0167, - s: 0.1176, - b: 1, - name: "light pink", - }, - ]; - //stores values for color names - var colorLookUp = [ - { - h: 0, - s: 0, - b: 0, - name: "black", - }, - { - h: 0, - s: 0, - b: 0.5, - name: "gray", - }, - { - h: 0, - s: 0, - b: 1, - name: "white", - }, - { - h: 0, - s: 0.5, - b: 0.5, - name: "dark maroon", - }, - { - h: 0, - s: 0.5, - b: 1, - name: "salmon pink", - }, - { - h: 0, - s: 1, - b: 0, - name: "black", - }, - { - h: 0, - s: 1, - b: 0.5, - name: "dark red", - }, - { - h: 0, - s: 1, - b: 1, - name: "red", - }, - { - h: 5, - s: 0, - b: 1, - name: "very light peach", - }, - { - h: 5, - s: 0.5, - b: 0.5, - name: "brown", - }, - { - h: 5, - s: 0.5, - b: 1, - name: "peach", - }, - { - h: 5, - s: 1, - b: 0.5, - name: "brick red", - }, - { - h: 5, - s: 1, - b: 1, - name: "crimson", - }, - { - h: 10, - s: 0, - b: 1, - name: "light peach", - }, - { - h: 10, - s: 0.5, - b: 0.5, - name: "brown", - }, - { - h: 10, - s: 0.5, - b: 1, - name: "light orange", - }, - { - h: 10, - s: 1, - b: 0.5, - name: "brown", - }, - { - h: 10, - s: 1, - b: 1, - name: "orange", - }, - { - h: 15, - s: 0, - b: 1, - name: "very light yellow", - }, - { - h: 15, - s: 0.5, - b: 0.5, - name: "olive green", - }, - { - h: 15, - s: 0.5, - b: 1, - name: "light yellow", - }, - { - h: 15, - s: 1, - b: 0, - name: "dark olive green", - }, - { - h: 15, - s: 1, - b: 0.5, - name: "olive green", - }, - { - h: 15, - s: 1, - b: 1, - name: "yellow", - }, - { - h: 20, - s: 0, - b: 1, - name: "very light yellow", - }, - { - h: 20, - s: 0.5, - b: 0.5, - name: "olive green", - }, - { - h: 20, - s: 0.5, - b: 1, - name: "light yellow green", - }, - { - h: 20, - s: 1, - b: 0, - name: "dark olive green", - }, - { - h: 20, - s: 1, - b: 0.5, - name: "dark yellow green", - }, - { - h: 20, - s: 1, - b: 1, - name: "yellow green", - }, - { - h: 25, - s: 0.5, - b: 0.5, - name: "dark yellow green", - }, - { - h: 25, - s: 0.5, - b: 1, - name: "light green", - }, - { - h: 25, - s: 1, - b: 0.5, - name: "dark green", - }, - { - h: 25, - s: 1, - b: 1, - name: "green", - }, - { - h: 30, - s: 0.5, - b: 1, - name: "light green", - }, - { - h: 30, - s: 1, - b: 0.5, - name: "dark green", - }, - { - h: 30, - s: 1, - b: 1, - name: "green", - }, - { - h: 35, - s: 0, - b: 0.5, - name: "light green", - }, - { - h: 35, - s: 0, - b: 1, - name: "very light green", - }, - { - h: 35, - s: 0.5, - b: 0.5, - name: "dark green", - }, - { - h: 35, - s: 0.5, - b: 1, - name: "light green", - }, - { - h: 35, - s: 1, - b: 0, - name: "very dark green", - }, - { - h: 35, - s: 1, - b: 0.5, - name: "dark green", - }, - { - h: 35, - s: 1, - b: 1, - name: "green", - }, - { - h: 40, - s: 0, - b: 1, - name: "very light green", - }, - { - h: 40, - s: 0.5, - b: 0.5, - name: "dark green", - }, - { - h: 40, - s: 0.5, - b: 1, - name: "light green", - }, - { - h: 40, - s: 1, - b: 0.5, - name: "dark green", - }, - { - h: 40, - s: 1, - b: 1, - name: "green", - }, - { - h: 45, - s: 0.5, - b: 1, - name: "light turquoise", - }, - { - h: 45, - s: 1, - b: 0.5, - name: "dark turquoise", - }, - { - h: 45, - s: 1, - b: 1, - name: "turquoise", - }, - { - h: 50, - s: 0, - b: 1, - name: "light sky blue", - }, - { - h: 50, - s: 0.5, - b: 0.5, - name: "dark cyan", - }, - { - h: 50, - s: 0.5, - b: 1, - name: "light cyan", - }, - { - h: 50, - s: 1, - b: 0.5, - name: "dark cyan", - }, - { - h: 50, - s: 1, - b: 1, - name: "cyan", - }, - { - h: 55, - s: 0, - b: 1, - name: "light sky blue", - }, - { - h: 55, - s: 0.5, - b: 1, - name: "light sky blue", - }, - { - h: 55, - s: 1, - b: 0.5, - name: "dark blue", - }, - { - h: 55, - s: 1, - b: 1, - name: "sky blue", - }, - { - h: 60, - s: 0, - b: 0.5, - name: "gray", - }, - { - h: 60, - s: 0, - b: 1, - name: "very light blue", - }, - { - h: 60, - s: 0.5, - b: 0.5, - name: "blue", - }, - { - h: 60, - s: 0.5, - b: 1, - name: "light blue", - }, - { - h: 60, - s: 1, - b: 0.5, - name: "navy blue", - }, - { - h: 60, - s: 1, - b: 1, - name: "blue", - }, - { - h: 65, - s: 0, - b: 1, - name: "lavender", - }, - { - h: 65, - s: 0.5, - b: 0.5, - name: "navy blue", - }, - { - h: 65, - s: 0.5, - b: 1, - name: "light purple", - }, - { - h: 65, - s: 1, - b: 0.5, - name: "dark navy blue", - }, - { - h: 65, - s: 1, - b: 1, - name: "blue", - }, - { - h: 70, - s: 0, - b: 1, - name: "lavender", - }, - { - h: 70, - s: 0.5, - b: 0.5, - name: "navy blue", - }, - { - h: 70, - s: 0.5, - b: 1, - name: "lavender blue", - }, - { - h: 70, - s: 1, - b: 0.5, - name: "dark navy blue", - }, - { - h: 70, - s: 1, - b: 1, - name: "blue", - }, - { - h: 75, - s: 0.5, - b: 1, - name: "lavender", - }, - { - h: 75, - s: 1, - b: 0.5, - name: "dark purple", - }, - { - h: 75, - s: 1, - b: 1, - name: "purple", - }, - { - h: 80, - s: 0.5, - b: 1, - name: "pinkish purple", - }, - { - h: 80, - s: 1, - b: 0.5, - name: "dark purple", - }, - { - h: 80, - s: 1, - b: 1, - name: "purple", - }, - { - h: 85, - s: 0, - b: 1, - name: "light pink", - }, - { - h: 85, - s: 0.5, - b: 0.5, - name: "purple", - }, - { - h: 85, - s: 0.5, - b: 1, - name: "light fuchsia", - }, - { - h: 85, - s: 1, - b: 0.5, - name: "dark fuchsia", - }, - { - h: 85, - s: 1, - b: 1, - name: "fuchsia", - }, - { - h: 90, - s: 0.5, - b: 0.5, - name: "dark fuchsia", - }, - { - h: 90, - s: 0.5, - b: 1, - name: "hot pink", - }, - { - h: 90, - s: 1, - b: 0.5, - name: "dark fuchsia", - }, - { - h: 90, - s: 1, - b: 1, - name: "fuchsia", - }, - { - h: 95, - s: 0, - b: 1, - name: "pink", - }, - { - h: 95, - s: 0.5, - b: 1, - name: "light pink", - }, - { - h: 95, - s: 1, - b: 0.5, - name: "dark magenta", - }, - { - h: 95, - s: 1, - b: 1, - name: "magenta", - }, - ]; - //returns text with color name - function _calculateColor(hsb) { - var colortext; - //round hue - if (hsb[0] !== 0) { - hsb[0] = Math.round(hsb[0] * 100); - var hue = hsb[0].toString().split(""); - var last = hue.length - 1; - hue[last] = parseInt(hue[last]); - //if last digit of hue is < 2.5 make it 0 - if (hue[last] < 2.5) { - hue[last] = 0; - //if last digit of hue is >= 2.5 and less than 7.5 make it 5 - } else if (hue[last] >= 2.5 && hue[last] < 7.5) { - hue[last] = 5; - } //if hue only has two digits - - if (hue.length === 2) { - hue[0] = parseInt(hue[0]); - //if last is greater than 7.5 - if (hue[last] >= 7.5) { - //add one to the tens - hue[last] = 0; - hue[0] = hue[0] + 1; - } - hsb[0] = hue[0] * 10 + hue[1]; - } else { - if (hue[last] >= 7.5) { - hsb[0] = 10; - } else { - hsb[0] = hue[last]; - } - } - } //map brightness from 0 to 1 - - hsb[2] = hsb[2] / 255; - //round saturation and brightness - for (var i = hsb.length - 1; i >= 1; i--) { - if (hsb[i] <= 0.25) { - hsb[i] = 0; - } else if (hsb[i] > 0.25 && hsb[i] < 0.75) { - hsb[i] = 0.5; - } else { - hsb[i] = 1; - } - } //after rounding, if the values are hue 0, saturation 0 and brightness 1 - //look at color exceptions which includes several tones from white to gray - - if (hsb[0] === 0 && hsb[1] === 0 && hsb[2] === 1) { - //round original hsb values - for (var _i = 2; _i >= 0; _i--) { - originalHSB[_i] = Math.round(originalHSB[_i] * 10000) / 10000; - } //compare with the values in the colorExceptions array - - for (var e = 0; e < colorExceptions.length; e++) { - if ( - colorExceptions[e].h === originalHSB[0] && - colorExceptions[e].s === originalHSB[1] && - colorExceptions[e].b === originalHSB[2] - ) { - colortext = colorExceptions[e].name; - break; - } else { - //if there is no match return white - colortext = "white"; - } - } - } else { - //otherwise, compare with values in colorLookUp - for (var _i2 = 0; _i2 < colorLookUp.length; _i2++) { - if ( - colorLookUp[_i2].h === hsb[0] && - colorLookUp[_i2].s === hsb[1] && - colorLookUp[_i2].b === hsb[2] - ) { - colortext = colorLookUp[_i2].name; - break; - } - } - } - return colortext; - } //gets rgba and returs a color name - - _main.default.prototype._rgbColorName = function (arg) { - //conversts rgba to hsb - var hsb = _color_conversion.default._rgbaToHSBA(arg); - //stores hsb in global variable - originalHSB = hsb; - //calculate color name - return _calculateColor([hsb[0], hsb[1], hsb[2]]); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../color/color_conversion": 282, - "../core/main": 298, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.split": 216, - }, - ], - 277: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.ends-with"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.ends-with"); - _dereq_("core-js/modules/es.string.replace"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - - var descContainer = "_Description"; //Fallback container - var fallbackDescId = "_fallbackDesc"; //Fallback description - var fallbackTableId = "_fallbackTable"; //Fallback Table - var fallbackTableElId = "_fte_"; //Fallback Table Element - var labelContainer = "_Label"; //Label container - var labelDescId = "_labelDesc"; //Label description - var labelTableId = "_labelTable"; //Label Table - var labelTableElId = "_lte_"; //Label Table Element - /** - * Creates a screen reader-accessible description for the canvas. - * - * The first parameter, `text`, is the description of the canvas. - * - * The second parameter, `display`, is optional. It determines how the - * description is displayed. If `LABEL` is passed, as in - * `describe('A description.', LABEL)`, the description will be visible in - * a div element next to the canvas. If `FALLBACK` is passed, as in - * `describe('A description.', FALLBACK)`, the description will only be - * visible to screen readers. This is the default mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method describe - * @param {String} text description of the canvas. - * @param {Constant} [display] either LABEL or FALLBACK. - * - * @example - *
                              - * - * function setup() { - * background('pink'); - * - * // Draw a heart. - * fill('red'); - * noStroke(); - * circle(67, 67, 20); - * circle(83, 67, 20); - * triangle(91, 73, 75, 95, 59, 73); - * - * // Add a general description of the canvas. - * describe('A pink square with a red heart in the bottom-right corner.'); - * } - * - *
                              - * - *
                              - * - * function setup() { - * background('pink'); - * - * // Draw a heart. - * fill('red'); - * noStroke(); - * circle(67, 67, 20); - * circle(83, 67, 20); - * triangle(91, 73, 75, 95, 59, 73); - * - * // Add a general description of the canvas - * // and display it for debugging. - * describe('A pink square with a red heart in the bottom-right corner.', LABEL); - * } - * - *
                              - * - *
                              - * - * function draw() { - * background(200); - * - * // The expression - * // frameCount % 100 - * // causes x to increase from 0 - * // to 99, then restart from 0. - * let x = frameCount % 100; - * - * // Draw the circle. - * fill(0, 255, 0); - * circle(x, 50, 40); - * - * // Add a general description of the canvas. - * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`); - * } - * - *
                              - * - *
                              - * - * function draw() { - * background(200); - * - * // The expression - * // frameCount % 100 - * // causes x to increase from 0 - * // to 99, then restart from 0. - * let x = frameCount % 100; - * - * // Draw the circle. - * fill(0, 255, 0); - * circle(x, 50, 40); - * - * // Add a general description of the canvas - * // and display it for debugging. - * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); - * } - * - *
                              - */ - _main.default.prototype.describe = function (text, display) { - _main.default._validateParameters("describe", arguments); - if (typeof text !== "string") { - return; - } - var cnvId = this.canvas.id; - //calls function that adds punctuation for better screen reading - text = _descriptionText(text); - //if there is no dummyDOM - if (!this.dummyDOM) { - this.dummyDOM = document.getElementById(cnvId).parentNode; - } - if (!this.descriptions) { - this.descriptions = {}; - } //check if html structure for description is ready - - if (this.descriptions.fallback) { - //check if text is different from current description - if (this.descriptions.fallback.innerHTML !== text) { - //update description - this.descriptions.fallback.innerHTML = text; - } - } else { - //create fallback html structure - this._describeHTML("fallback", text); - } //if display is LABEL - - if (display === this.LABEL) { - //check if html structure for label is ready - if (this.descriptions.label) { - //check if text is different from current label - if (this.descriptions.label.innerHTML !== text) { - //update label description - this.descriptions.label.innerHTML = text; - } - } else { - //create label html structure - this._describeHTML("label", text); - } - } - }; - /** - * Creates a screen reader-accessible description for elements in the canvas. - * Elements are shapes or groups of shapes that create meaning together. - * - * The first parameter, `name`, is the name of the element. - * - * The second parameter, `text`, is the description of the element. - * - * The third parameter, `display`, is optional. It determines how the - * description is displayed. If `LABEL` is passed, as in - * `describe('A description.', LABEL)`, the description will be visible in - * a div element next to the canvas. Using `LABEL` creates unhelpful - * duplicates for screen readers. Only use `LABEL` during development. If - * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method describeElement - * @param {String} name name of the element. - * @param {String} text description of the element. - * @param {Constant} [display] either LABEL or FALLBACK. - * - * @example - *
                              - * - * function setup() { - * background('pink'); - * - * // Describe the first element - * // and draw it. - * describeElement('Circle', 'A yellow circle in the top-left corner.'); - * noStroke(); - * fill('yellow'); - * circle(25, 25, 40); - * - * // Describe the second element - * // and draw it. - * describeElement('Heart', 'A red heart in the bottom-right corner.'); - * fill('red'); - * circle(66.6, 66.6, 20); - * circle(83.2, 66.6, 20); - * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); - * - * // Add a general description of the canvas. - * describe('A red heart and yellow circle over a pink background.'); - * } - * - *
                              - * - *
                              - * - * function setup() { - * background('pink'); - * - * // Describe the first element - * // and draw it. Display the - * // description for debugging. - * describeElement('Circle', 'A yellow circle in the top-left corner.', LABEL); - * noStroke(); - * fill('yellow'); - * circle(25, 25, 40); - * - * // Describe the second element - * // and draw it. Display the - * // description for debugging. - * describeElement('Heart', 'A red heart in the bottom-right corner.', LABEL); - * fill('red'); - * circle(66.6, 66.6, 20); - * circle(83.2, 66.6, 20); - * triangle(91.2, 72.6, 75, 95, 58.6, 72.6); - * - * // Add a general description of the canvas. - * describe('A red heart and yellow circle over a pink background.'); - * } - * - *
                              - */ - _main.default.prototype.describeElement = function ( - name, - text, - display, - ) { - _main.default._validateParameters("describeElement", arguments); - if (typeof text !== "string" || typeof name !== "string") { - return; - } - var cnvId = this.canvas.id; - //calls function that adds punctuation for better screen reading - text = _descriptionText(text); - //calls function that adds punctuation for better screen reading - var elementName = _elementName(name); - //remove any special characters from name to use it as html id - name = name.replace(/[^a-zA-Z0-9]/g, ""); - //store element description - var inner = '' - .concat(elementName, "") - .concat(text, ""); - //if there is no dummyDOM - if (!this.dummyDOM) { - this.dummyDOM = document.getElementById(cnvId).parentNode; - } - if (!this.descriptions) { - this.descriptions = { - fallbackElements: {}, - }; - } else if (!this.descriptions.fallbackElements) { - this.descriptions.fallbackElements = {}; - } //check if html structure for element description is ready - - if (this.descriptions.fallbackElements[name]) { - //if current element description is not the same as inner - if ( - this.descriptions.fallbackElements[name].innerHTML !== inner - ) { - //update element description - this.descriptions.fallbackElements[name].innerHTML = inner; - } - } else { - //create fallback html structure - this._describeElementHTML("fallback", name, inner); - } //if display is LABEL - - if (display === this.LABEL) { - if (!this.descriptions.labelElements) { - this.descriptions.labelElements = {}; - } //if html structure for label element description is ready - - if (this.descriptions.labelElements[name]) { - //if label element description is different - if (this.descriptions.labelElements[name].innerHTML !== inner) { - //update label element description - this.descriptions.labelElements[name].innerHTML = inner; - } - } else { - //create label element html structure - this._describeElementHTML("label", name, inner); - } - } - }; - /* - * - * Helper functions for describe() and describeElement(). - * - */ - // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark - function _descriptionText(text) { - if (text === "label" || text === "fallback") { - throw new Error("description should not be LABEL or FALLBACK"); - } //if string does not end with '.' - - if ( - !text.endsWith(".") && - !text.endsWith(";") && - !text.endsWith(",") && - !text.endsWith("?") && - !text.endsWith("!") - ) { - //add '.' to the end of string - text = text + "."; - } - return text; - } /* - * Helper functions for describe() - */ - //creates HTML structure for canvas descriptions - - _main.default.prototype._describeHTML = function (type, text) { - var cnvId = this.canvas.id; - if (type === "fallback") { - //if there is no description container - if ( - !this.dummyDOM.querySelector("#".concat(cnvId + descContainer)) - ) { - //if there are no accessible outputs (see textOutput() and gridOutput()) - var html = '

                              '); - if ( - !this.dummyDOM.querySelector( - "#".concat(cnvId, "accessibleOutput"), - ) - ) { - //create description container +

                              for fallback description - this.dummyDOM.querySelector("#".concat(cnvId)).innerHTML = - html; - } else { - //create description container +

                              for fallback description before outputs - this.dummyDOM - .querySelector("#".concat(cnvId, "accessibleOutput")) - .insertAdjacentHTML("beforebegin", html); - } - } else { - //if describeElement() has already created the container and added a table of elements - //create fallback description

                              before the table - this.dummyDOM - .querySelector("#" + cnvId + fallbackTableId) - .insertAdjacentHTML( - "beforebegin", - '

                              '), - ); - } //if the container for the description exists - - this.descriptions.fallback = this.dummyDOM.querySelector( - "#".concat(cnvId).concat(fallbackDescId), - ); - this.descriptions.fallback.innerHTML = text; - return; - } else if (type === "label") { - //if there is no label container - if ( - !this.dummyDOM.querySelector("#".concat(cnvId + labelContainer)) - ) { - var _html = '

                              '); - //if there are no accessible outputs (see textOutput() and gridOutput()) - if ( - !this.dummyDOM.querySelector( - "#".concat(cnvId, "accessibleOutputLabel"), - ) - ) { - //create label container +

                              for label description - this.dummyDOM - .querySelector("#" + cnvId) - .insertAdjacentHTML("afterend", _html); - } else { - //create label container +

                              for label description before outputs - this.dummyDOM - .querySelector("#".concat(cnvId, "accessibleOutputLabel")) - .insertAdjacentHTML("beforebegin", _html); - } - } else if ( - this.dummyDOM.querySelector("#".concat(cnvId + labelTableId)) - ) { - //if describeElement() has already created the container and added a table of elements - //create label description

                              before the table - this.dummyDOM - .querySelector("#".concat(cnvId + labelTableId)) - .insertAdjacentHTML( - "beforebegin", - '

                              '), - ); - } - this.descriptions.label = this.dummyDOM.querySelector( - "#" + cnvId + labelDescId, - ); - this.descriptions.label.innerHTML = text; - return; - } - }; - /* - * Helper functions for describeElement(). - */ - //check that name is not LABEL or FALLBACK and ensure text ends with colon - function _elementName(name) { - if (name === "label" || name === "fallback") { - throw new Error("element name should not be LABEL or FALLBACK"); - } //check if last character of string n is '.', ';', or ',' - - if ( - name.endsWith(".") || - name.endsWith(";") || - name.endsWith(",") - ) { - //replace last character with ':' - name = name.replace(/.$/, ":"); - } else if (!name.endsWith(":")) { - //if string n does not end with ':' - //add ':'' at the end of string - name = name + ":"; - } - return name; - } //creates HTML structure for element descriptions - - _main.default.prototype._describeElementHTML = function ( - type, - name, - text, - ) { - var cnvId = this.canvas.id; - if (type === "fallback") { - //if there is no description container - if ( - !this.dummyDOM.querySelector("#".concat(cnvId + descContainer)) - ) { - //if there are no accessible outputs (see textOutput() and gridOutput()) - var html = '
                              Canvas elements and their descriptions
                              ', - ); - if ( - !this.dummyDOM.querySelector( - "#".concat(cnvId, "accessibleOutput"), - ) - ) { - //create container + table for element descriptions - this.dummyDOM.querySelector("#" + cnvId).innerHTML = html; - } else { - //create container + table for element descriptions before outputs - this.dummyDOM - .querySelector("#".concat(cnvId, "accessibleOutput")) - .insertAdjacentHTML("beforebegin", html); - } - } else if ( - !this.dummyDOM.querySelector("#" + cnvId + fallbackTableId) - ) { - //if describe() has already created the container and added a description - //and there is no table create fallback table for element description after - //fallback description - this.dummyDOM - .querySelector("#" + cnvId + fallbackDescId) - .insertAdjacentHTML( - "afterend", - '
                              Canvas elements and their descriptions
                              ', - ), - ); - } //create a table row for the element - - var tableRow = document.createElement("tr"); - tableRow.id = cnvId + fallbackTableElId + name; - this.dummyDOM - .querySelector("#" + cnvId + fallbackTableId) - .appendChild(tableRow); - //update element description - this.descriptions.fallbackElements[name] = - this.dummyDOM.querySelector( - "#".concat(cnvId).concat(fallbackTableElId).concat(name), - ); - this.descriptions.fallbackElements[name].innerHTML = text; - return; - } else if (type === "label") { - //If display is LABEL creates a div adjacent to the canvas element with - //a table, a row header cell with the name of the elements, - //and adds the description of the element in adjecent cell. - //if there is no label description container - if ( - !this.dummyDOM.querySelector("#".concat(cnvId + labelContainer)) - ) { - //if there are no accessible outputs (see textOutput() and gridOutput()) - var _html2 = '
                              '); - if ( - !this.dummyDOM.querySelector( - "#".concat(cnvId, "accessibleOutputLabel"), - ) - ) { - //create container + table for element descriptions - this.dummyDOM - .querySelector("#" + cnvId) - .insertAdjacentHTML("afterend", _html2); - } else { - //create container + table for element descriptions before outputs - this.dummyDOM - .querySelector("#".concat(cnvId, "accessibleOutputLabel")) - .insertAdjacentHTML("beforebegin", _html2); - } - } else if ( - !this.dummyDOM.querySelector("#".concat(cnvId + labelTableId)) - ) { - //if describe() has already created the label container and added a description - //and there is no table create label table for element description after - //label description - this.dummyDOM - .querySelector("#" + cnvId + labelDescId) - .insertAdjacentHTML( - "afterend", - '
                              '), - ); - } //create a table row for the element label description - - var _tableRow = document.createElement("tr"); - _tableRow.id = cnvId + labelTableElId + name; - this.dummyDOM - .querySelector("#" + cnvId + labelTableId) - .appendChild(_tableRow); - //update element label description - this.descriptions.labelElements[name] = - this.dummyDOM.querySelector( - "#".concat(cnvId).concat(labelTableElId).concat(name), - ); - this.descriptions.labelElements[name].innerHTML = text; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.ends-with": 208, - "core-js/modules/es.string.replace": 214, - }, - ], - 278: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.string.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - //the functions in this file support updating the grid output - //updates gridOutput - - _main.default.prototype._updateGridOutput = function (idT) { - //if html structure is not there yet - if (!this.dummyDOM.querySelector("#".concat(idT, "_summary"))) { - return; - } - var current = this._accessibleOutputs[idT]; - //create shape details list - var innerShapeDetails = _gridShapeDetails( - idT, - this.ingredients.shapes, - ); - //create summary - var innerSummary = _gridSummary( - innerShapeDetails.numShapes, - this.ingredients.colors.background, - this.width, - this.height, - ); - //create grid map - var innerMap = _gridMap(idT, this.ingredients.shapes); - //if it is different from current summary - if (innerSummary !== current.summary.innerHTML) { - //update - current.summary.innerHTML = innerSummary; - } //if it is different from current map - - if (innerMap !== current.map.innerHTML) { - //update - current.map.innerHTML = innerMap; - } //if it is different from current shape details - - if (innerShapeDetails.details !== current.shapeDetails.innerHTML) { - //update - current.shapeDetails.innerHTML = innerShapeDetails.details; - } - this._accessibleOutputs[idT] = current; - }; - //creates spatial grid that maps the location of shapes - function _gridMap(idT, ingredients) { - var shapeNumber = 0; - var table = ""; - //create an array of arrays 10*10 of empty cells - var cells = Array.from(Array(10), function () { - return Array(10); - }); - for (var x in ingredients) { - for (var y in ingredients[x]) { - var fill = void 0; - if (x !== "line") { - fill = '') - .concat(ingredients[x][y].color, " ") - .concat(x, ""); - } else { - fill = '') - .concat(ingredients[x][y].color, " ") - .concat(x, " midpoint"); - } //if empty cell of location of shape is undefined - - if ( - !cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] - ) { - //fill it with shape info - cells[ingredients[x][y].loc.locY][ - ingredients[x][y].loc.locX - ] = fill; - //if a shape is already in that location - } else { - //add it - cells[ingredients[x][y].loc.locY][ - ingredients[x][y].loc.locX - ] = - cells[ingredients[x][y].loc.locY][ - ingredients[x][y].loc.locX - ] + - " " + - fill; - } - shapeNumber++; - } - } //make table based on array - - for (var _r in cells) { - var row = ""; - for (var c in cells[_r]) { - row = row + ""; - if (cells[_r][c] !== undefined) { - row = row + cells[_r][c]; - } - row = row + ""; - } - table = table + row + ""; - } - return table; - } //creates grid summary - - function _gridSummary(numShapes, background, width, height) { - var text = "" - .concat(background, " canvas, ") - .concat(width, " by ") - .concat(height, " pixels, contains ") - .concat(numShapes[0]); - if (numShapes[0] === 1) { - text = "".concat(text, " shape: ").concat(numShapes[1]); - } else { - text = "".concat(text, " shapes: ").concat(numShapes[1]); - } - return text; - } //creates list of shapes - - function _gridShapeDetails(idT, ingredients) { - var shapeDetails = ""; - var shapes = ""; - var totalShapes = 0; - //goes trhough every shape type in ingredients - for (var x in ingredients) { - var shapeNum = 0; - for (var y in ingredients[x]) { - //it creates a line in a list - var line = '
                            • ') - .concat(ingredients[x][y].color, " ") - .concat(x, ","); - if (x === "line") { - line = - line + - " location = " - .concat(ingredients[x][y].pos, ", length = ") - .concat(ingredients[x][y].length, " pixels"); - } else { - line = line + " location = ".concat(ingredients[x][y].pos); - if (x !== "point") { - line = - line + ", area = ".concat(ingredients[x][y].area, " %"); - } - line = line + "
                            • "; - } - shapeDetails = shapeDetails + line; - shapeNum++; - totalShapes++; - } - if (shapeNum > 1) { - shapes = "" - .concat(shapes, " ") - .concat(shapeNum, " ") - .concat(x, "s"); - } else { - shapes = "".concat(shapes, " ").concat(shapeNum, " ").concat(x); - } - } - return { - numShapes: [totalShapes, shapes], - details: shapeDetails, - }; - } - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.string.iterator": 210, - }, - ], - 279: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.number.to-fixed"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - /** - * Creates a screen reader-accessible description for shapes on the canvas. - * `textOutput()` adds a general description, list of shapes, and - * table of shapes to the web page. - * - * The general description includes the canvas size, canvas color, and number - * of shapes. For example, - * `Your output is a, 100 by 100 pixels, gray canvas containing the following 2 shapes:`. - * - * A list of shapes follows the general description. The list describes the - * color, location, and area of each shape. For example, - * `a red circle at middle covering 3% of the canvas`. Each shape can be - * selected to get more details. - * - * `textOutput()` uses its table of shapes as a list. The table describes the - * shape, color, location, coordinates and area. For example, - * `red circle location = middle area = 3%`. This is different from - * gridOutput(), which uses its table as a grid. - * - * The `display` parameter is optional. It determines how the description is - * displayed. If `LABEL` is passed, as in `textOutput(LABEL)`, the description - * will be visible in a div element next to the canvas. Using `LABEL` creates - * unhelpful duplicates for screen readers. Only use `LABEL` during - * development. If `FALLBACK` is passed, as in `textOutput(FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method textOutput - * @param {Constant} [display] either FALLBACK or LABEL. - * - * @example - *
                              - * - * function setup() { - * // Add the text description. - * textOutput(); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
                              - * - *
                              - * - * function setup() { - * // Add the text description and - * // display it for debugging. - * textOutput(LABEL); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
                              - * - *
                              - * - * function draw() { - * // Add the text description. - * textOutput(); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
                              - * - *
                              - * - * function draw() { - * // Add the text description and - * // display it for debugging. - * textOutput(LABEL); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
                              - */ - - _main.default.prototype.textOutput = function (display) { - _main.default._validateParameters("textOutput", arguments); - //if textOutput is already true - if (this._accessibleOutputs.text) { - return; - } else { - //make textOutput true - this._accessibleOutputs.text = true; - //create output for fallback - this._createOutput("textOutput", "Fallback"); - if (display === this.LABEL) { - //make textOutput label true - this._accessibleOutputs.textLabel = true; - //create output for label - this._createOutput("textOutput", "Label"); - } - } - }; - /** - * Creates a screen reader-accessible description for shapes on the canvas. - * `gridOutput()` adds a general description, table of shapes, and list of - * shapes to the web page. - * - * The general description includes the canvas size, canvas color, and number of - * shapes. For example, - * `gray canvas, 100 by 100 pixels, contains 2 shapes: 1 circle 1 square`. - * - * `gridOutput()` uses its table of shapes as a grid. Each shape in the grid - * is placed in a cell whose row and column correspond to the shape's location - * on the canvas. The grid cells describe the color and type of shape at that - * location. For example, `red circle`. These descriptions can be selected - * individually to get more details. This is different from - * textOutput(), which uses its table as a list. - * - * A list of shapes follows the table. The list describes the color, type, - * location, and area of each shape. For example, - * `red circle, location = middle, area = 3 %`. - * - * The `display` parameter is optional. It determines how the description is - * displayed. If `LABEL` is passed, as in `gridOutput(LABEL)`, the description - * will be visible in a div element next to the canvas. Using `LABEL` creates - * unhelpful duplicates for screen readers. Only use `LABEL` during - * development. If `FALLBACK` is passed, as in `gridOutput(FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. - * - * Read - * How to label your p5.js code to - * learn more about making sketches accessible. - * - * @method gridOutput - * @param {Constant} [display] either FALLBACK or LABEL. - * - * @example - *
                              - * - * function setup() { - * // Add the grid description. - * gridOutput(); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
                              - * - *
                              - * - * function setup() { - * // Add the grid description and - * // display it for debugging. - * gridOutput(LABEL); - * - * // Draw a couple of shapes. - * background(200); - * fill(255, 0, 0); - * circle(20, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle and a blue square on a gray background.'); - * } - * - *
                              - * - *
                              - * - * function draw() { - * // Add the grid description. - * gridOutput(); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
                              - * - *
                              - * - * function draw() { - * // Add the grid description and - * // display it for debugging. - * gridOutput(LABEL); - * - * // Draw a moving circle. - * background(200); - * let x = frameCount * 0.1; - * fill(255, 0, 0); - * circle(x, 20, 20); - * fill(0, 0, 255); - * square(50, 50, 50); - * - * // Add a general description of the canvas. - * describe('A red circle moves from left to right above a blue square.'); - * } - * - *
                              - */ - _main.default.prototype.gridOutput = function (display) { - _main.default._validateParameters("gridOutput", arguments); - //if gridOutput is already true - if (this._accessibleOutputs.grid) { - return; - } else { - //make gridOutput true - this._accessibleOutputs.grid = true; - //create output for fallback - this._createOutput("gridOutput", "Fallback"); - if (display === this.LABEL) { - //make gridOutput label true - this._accessibleOutputs.gridLabel = true; - //create output for label - this._createOutput("gridOutput", "Label"); - } - } - }; - //helper function returns true when accessible outputs are true - _main.default.prototype._addAccsOutput = function () { - //if there are no accessible outputs create object with all false - if (!this._accessibleOutputs) { - this._accessibleOutputs = { - text: false, - grid: false, - textLabel: false, - gridLabel: false, - }; - } - return this._accessibleOutputs.grid || this._accessibleOutputs.text; - }; - //helper function that creates html structure for accessible outputs - _main.default.prototype._createOutput = function (type, display) { - var cnvId = this.canvas.id; - //if there are no ingredients create object. this object stores data for the outputs - if (!this.ingredients) { - this.ingredients = { - shapes: {}, - colors: { - background: "white", - fill: "white", - stroke: "black", - }, - pShapes: "", - }; - } //if there is no dummyDOM create it - - if (!this.dummyDOM) { - this.dummyDOM = document.getElementById(cnvId).parentNode; - } - var cIdT, container, inner; - var query = ""; - if (display === "Fallback") { - cIdT = cnvId + type; - container = cnvId + "accessibleOutput"; - if (!this.dummyDOM.querySelector("#".concat(container))) { - //if there is no canvas description (see describe() and describeElement()) - if ( - !this.dummyDOM.querySelector( - "#".concat(cnvId, "_Description"), - ) - ) { - //create html structure inside of canvas - this.dummyDOM.querySelector("#".concat(cnvId)).innerHTML = - '
                              ', - ); - } else { - //create html structure after canvas description container - this.dummyDOM - .querySelector("#".concat(cnvId, "_Description")) - .insertAdjacentHTML( - "afterend", - '
                              ', - ), - ); - } - } - } else if (display === "Label") { - query = display; - cIdT = cnvId + type + display; - container = cnvId + "accessibleOutput" + display; - if (!this.dummyDOM.querySelector("#".concat(container))) { - //if there is no canvas description label (see describe() and describeElement()) - if (!this.dummyDOM.querySelector("#".concat(cnvId, "_Label"))) { - //create html structure adjacent to canvas - this.dummyDOM - .querySelector("#".concat(cnvId)) - .insertAdjacentHTML( - "afterend", - '
                              '), - ); - } else { - //create html structure after canvas label - this.dummyDOM - .querySelector("#".concat(cnvId, "_Label")) - .insertAdjacentHTML( - "afterend", - '
                              '), - ); - } - } - } //create an object to store the latest output. this object is used in _updateTextOutput() and _updateGridOutput() - - this._accessibleOutputs[cIdT] = {}; - if (type === "textOutput") { - query = "#".concat(cnvId, "gridOutput").concat(query); //query is used to check if gridOutput already exists - inner = '
                              Text Output

                                ', - ); - //if gridOutput already exists - if (this.dummyDOM.querySelector(query)) { - //create textOutput before gridOutput - this.dummyDOM - .querySelector(query) - .insertAdjacentHTML("beforebegin", inner); - } else { - //create output inside of container - this.dummyDOM.querySelector("#".concat(container)).innerHTML = - inner; - } //store output html elements - - this._accessibleOutputs[cIdT].list = this.dummyDOM.querySelector( - "#".concat(cIdT, "_list"), - ); - } else if (type === "gridOutput") { - query = "#".concat(cnvId, "textOutput").concat(query); //query is used to check if textOutput already exists - inner = '
                                Grid Output

                                  ', - ); - //if textOutput already exists - if (this.dummyDOM.querySelector(query)) { - //create gridOutput after textOutput - this.dummyDOM - .querySelector(query) - .insertAdjacentHTML("afterend", inner); - } else { - //create output inside of container - this.dummyDOM.querySelector("#".concat(container)).innerHTML = - inner; - } //store output html elements - - this._accessibleOutputs[cIdT].map = this.dummyDOM.querySelector( - "#".concat(cIdT, "_map"), - ); - } - this._accessibleOutputs[cIdT].shapeDetails = - this.dummyDOM.querySelector("#".concat(cIdT, "_shapeDetails")); - this._accessibleOutputs[cIdT].summary = this.dummyDOM.querySelector( - "#".concat(cIdT, "_summary"), - ); - }; - //this function is called at the end of setup and draw if using - //accessibleOutputs and calls update functions of outputs - _main.default.prototype._updateAccsOutput = function () { - var cnvId = this.canvas.id; - //if the shapes are not the same as before - if ( - JSON.stringify(this.ingredients.shapes) !== - this.ingredients.pShapes - ) { - //save current shapes as string in pShapes - this.ingredients.pShapes = JSON.stringify( - this.ingredients.shapes, - ); - if (this._accessibleOutputs.text) { - this._updateTextOutput(cnvId + "textOutput"); - } - if (this._accessibleOutputs.grid) { - this._updateGridOutput(cnvId + "gridOutput"); - } - if (this._accessibleOutputs.textLabel) { - this._updateTextOutput(cnvId + "textOutputLabel"); - } - if (this._accessibleOutputs.gridLabel) { - this._updateGridOutput(cnvId + "gridOutputLabel"); - } - } - }; - //helper function that resets all ingredients when background is called - //and saves background color name - _main.default.prototype._accsBackground = function (args) { - //save current shapes as string in pShapes - this.ingredients.pShapes = JSON.stringify(this.ingredients.shapes); - //empty shapes JSON - this.ingredients.shapes = {}; - //update background different - if (this.ingredients.colors.backgroundRGBA !== args) { - this.ingredients.colors.backgroundRGBA = args; - this.ingredients.colors.background = this._rgbColorName(args); - } - }; - //helper function that gets fill and stroke of shapes - _main.default.prototype._accsCanvasColors = function (f, args) { - if (f === "fill") { - //update fill different - if (this.ingredients.colors.fillRGBA !== args) { - this.ingredients.colors.fillRGBA = args; - this.ingredients.colors.fill = this._rgbColorName(args); - } - } else if (f === "stroke") { - //update stroke if different - if (this.ingredients.colors.strokeRGBA !== args) { - this.ingredients.colors.strokeRGBA = args; - this.ingredients.colors.stroke = this._rgbColorName(args); - } - } - }; - //builds ingredients.shapes used for building outputs - _main.default.prototype._accsOutput = function (f, args) { - if (f === "ellipse" && args[2] === args[3]) { - f = "circle"; - } else if (f === "rectangle" && args[2] === args[3]) { - f = "square"; - } - var include = {}; - var add = true; - var middle = _getMiddle(f, args); - if (f === "line") { - //make color stroke - include.color = this.ingredients.colors.stroke; - //get lenght - include.length = Math.round( - this.dist(args[0], args[1], args[2], args[3]), - ); - //get position of end points - var p1 = this._getPos(args[0], [1]); - var p2 = this._getPos(args[2], [3]); - include.loc = _canvasLocator(middle, this.width, this.height); - if (p1 === p2) { - include.pos = "at ".concat(p1); - } else { - include.pos = "from ".concat(p1, " to ").concat(p2); - } - } else { - if (f === "point") { - //make color stroke - include.color = this.ingredients.colors.stroke; - } else { - //make color fill - include.color = this.ingredients.colors.fill; - //get area of shape - include.area = this._getArea(f, args); - } //get middle of shapes - //calculate position using middle of shape - - include.pos = this._getPos.apply( - this, - _toConsumableArray(middle), - ); - //calculate location using middle of shape - include.loc = _canvasLocator(middle, this.width, this.height); - } //if it is the first time this shape is created - - if (!this.ingredients.shapes[f]) { - this.ingredients.shapes[f] = [include]; - //if other shapes of this type have been created - } else if (this.ingredients.shapes[f] !== [include]) { - //for every shape of this type - for (var y in this.ingredients.shapes[f]) { - //compare it with current shape and if it already exists make add false - if ( - JSON.stringify(this.ingredients.shapes[f][y]) === - JSON.stringify(include) - ) { - add = false; - } - } //add shape by pushing it to the end - - if (add === true) { - this.ingredients.shapes[f].push(include); - } - } - }; - //gets middle point / centroid of shape - function _getMiddle(f, args) { - var x, y; - if ( - f === "rectangle" || - f === "ellipse" || - f === "arc" || - f === "circle" || - f === "square" - ) { - x = Math.round(args[0] + args[2] / 2); - y = Math.round(args[1] + args[3] / 2); - } else if (f === "triangle") { - x = (args[0] + args[2] + args[4]) / 3; - y = (args[1] + args[3] + args[5]) / 3; - } else if (f === "quadrilateral") { - x = (args[0] + args[2] + args[4] + args[6]) / 4; - y = (args[1] + args[3] + args[5] + args[7]) / 4; - } else if (f === "line") { - x = (args[0] + args[2]) / 2; - y = (args[1] + args[3]) / 2; - } else { - x = args[0]; - y = args[1]; - } - return [x, y]; - } //gets position of shape in the canvas - - _main.default.prototype._getPos = function (x, y) { - var untransformedPosition = new DOMPointReadOnly(x, y); - var currentTransform = this._renderer.isP3D - ? new DOMMatrix(this._renderer.uMVMatrix.mat4) - : this.drawingContext.getTransform(); - var _untransformedPositio = - untransformedPosition.matrixTransform(currentTransform), - transformedX = _untransformedPositio.x, - transformedY = _untransformedPositio.y; - var canvasWidth = this.width, - canvasHeight = this.height; - if (transformedX < 0.4 * canvasWidth) { - if (transformedY < 0.4 * canvasHeight) { - return "top left"; - } else if (transformedY > 0.6 * canvasHeight) { - return "bottom left"; - } else { - return "mid left"; - } - } else if (transformedX > 0.6 * canvasWidth) { - if (transformedY < 0.4 * canvasHeight) { - return "top right"; - } else if (transformedY > 0.6 * canvasHeight) { - return "bottom right"; - } else { - return "mid right"; - } - } else { - if (transformedY < 0.4 * canvasHeight) { - return "top middle"; - } else if (transformedY > 0.6 * canvasHeight) { - return "bottom middle"; - } else { - return "middle"; - } - } - }; - //locates shape in a 10*10 grid - function _canvasLocator(args, canvasWidth, canvasHeight) { - var noRows = 10; - var noCols = 10; - var locX = Math.floor((args[0] / canvasWidth) * noRows); - var locY = Math.floor((args[1] / canvasHeight) * noCols); - if (locX === noRows) { - locX = locX - 1; - } - if (locY === noCols) { - locY = locY - 1; - } - return { - locX: locX, - locY: locY, - }; - } //calculates area of shape - - _main.default.prototype._getArea = function (objectType, shapeArgs) { - var objectArea = 0; - if (objectType === "arc") { - // area of full ellipse = PI * horizontal radius * vertical radius. - // therefore, area of arc = difference bet. arc's start and end radians * horizontal radius * vertical radius. - // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 - var arcSizeInRadians = - (((shapeArgs[5] - shapeArgs[4]) % (Math.PI * 2)) + - Math.PI * 2) % - (Math.PI * 2); - objectArea = (arcSizeInRadians * shapeArgs[2] * shapeArgs[3]) / 8; - if (shapeArgs[6] === "open" || shapeArgs[6] === "chord") { - // when the arc's mode is OPEN or CHORD, we need to account for the area of the triangle that is formed to close the arc - // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ) )/2 - var Ax = shapeArgs[0]; - var Ay = shapeArgs[1]; - var Bx = - shapeArgs[0] + - (shapeArgs[2] / 2) * Math.cos(shapeArgs[4]).toFixed(2); - var By = - shapeArgs[1] + - (shapeArgs[3] / 2) * Math.sin(shapeArgs[4]).toFixed(2); - var Cx = - shapeArgs[0] + - (shapeArgs[2] / 2) * Math.cos(shapeArgs[5]).toFixed(2); - var Cy = - shapeArgs[1] + - (shapeArgs[3] / 2) * Math.sin(shapeArgs[5]).toFixed(2); - var areaOfExtraTriangle = - Math.abs(Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) / - 2; - if (arcSizeInRadians > Math.PI) { - objectArea = objectArea + areaOfExtraTriangle; - } else { - objectArea = objectArea - areaOfExtraTriangle; - } - } - } else if (objectType === "ellipse" || objectType === "circle") { - objectArea = (((3.14 * shapeArgs[2]) / 2) * shapeArgs[3]) / 2; - } else if (objectType === "line") { - objectArea = 0; - } else if (objectType === "point") { - objectArea = 0; - } else if (objectType === "quadrilateral") { - // ((x4+x1)*(y4-y1)+(x1+x2)*(y1-y2)+(x2+x3)*(y2-y3)+(x3+x4)*(y3-y4))/2 - objectArea = - Math.abs( - (shapeArgs[6] + shapeArgs[0]) * - (shapeArgs[7] - shapeArgs[1]) + - (shapeArgs[0] + shapeArgs[2]) * - (shapeArgs[1] - shapeArgs[3]) + - (shapeArgs[2] + shapeArgs[4]) * - (shapeArgs[3] - shapeArgs[5]) + - (shapeArgs[4] + shapeArgs[6]) * - (shapeArgs[5] - shapeArgs[7]), - ) / 2; - } else if (objectType === "rectangle" || objectType === "square") { - objectArea = shapeArgs[2] * shapeArgs[3]; - } else if (objectType === "triangle") { - objectArea = - Math.abs( - shapeArgs[0] * (shapeArgs[3] - shapeArgs[5]) + - shapeArgs[2] * (shapeArgs[5] - shapeArgs[1]) + - shapeArgs[4] * (shapeArgs[1] - shapeArgs[3]), - ) / 2; - // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ))/2 - } // Store the positions of the canvas corners - - var canvasWidth = this.width * this._pixelDensity; - var canvasHeight = this.height * this._pixelDensity; - var canvasCorners = [ - new DOMPoint(0, 0), - new DOMPoint(canvasWidth, 0), - new DOMPoint(canvasWidth, canvasHeight), - new DOMPoint(0, canvasHeight), - ]; - // Apply the inverse of the current transformations to the canvas corners - var currentTransform = this._renderer.isP3D - ? new DOMMatrix(this._renderer.uMVMatrix.mat4) - : this.drawingContext.getTransform(); - var invertedTransform = currentTransform.inverse(); - var tc = canvasCorners.map(function (corner) { - return corner.matrixTransform(invertedTransform); - }); - /* Use same shoelace formula used for quad area (above) to calculate - the area of the canvas with inverted transformation applied */ - var transformedCanvasArea = - Math.abs( - (tc[3].x + tc[0].x) * (tc[3].y - tc[0].y) + - (tc[0].x + tc[1].x) * (tc[0].y - tc[1].y) + - (tc[1].x + tc[2].x) * (tc[1].y - tc[2].y) + - (tc[2].x + tc[3].x) * (tc[2].y - tc[3].y), - ) / 2; - /* Compare area of shape (minus transformations) to area of canvas - with inverted transformation applied. - Return percentage */ - var untransformedArea = Math.round( - (objectArea * 100) / transformedCanvasArea, - ); - return untransformedArea; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.number.to-fixed": 193, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 280: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.concat"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - */ - //the functions in this file support updating the text output - //updates textOutput - - _main.default.prototype._updateTextOutput = function (idT) { - //if html structure is not there yet - if (!this.dummyDOM.querySelector("#".concat(idT, "_summary"))) { - return; - } - var current = this._accessibleOutputs[idT]; - //create shape list - var innerList = _shapeList(idT, this.ingredients.shapes); - //create output summary - var innerSummary = _textSummary( - innerList.numShapes, - this.ingredients.colors.background, - this.width, - this.height, - ); - //create shape details - var innerShapeDetails = _shapeDetails(idT, this.ingredients.shapes); - //if it is different from current summary - if (innerSummary !== current.summary.innerHTML) { - //update - current.summary.innerHTML = innerSummary; - } //if it is different from current shape list - - if (innerList.listShapes !== current.list.innerHTML) { - //update - current.list.innerHTML = innerList.listShapes; - } //if it is different from current shape details - - if (innerShapeDetails !== current.shapeDetails.innerHTML) { - //update - current.shapeDetails.innerHTML = innerShapeDetails; - } - this._accessibleOutputs[idT] = current; - }; - //Builds textOutput summary - function _textSummary(numShapes, background, width, height) { - var text = "Your output is a, " - .concat(width, " by ") - .concat(height, " pixels, ") - .concat(background, " canvas containing the following"); - if (numShapes === 1) { - text = "".concat(text, " shape:"); - } else { - text = "".concat(text, " ").concat(numShapes, " shapes:"); - } - return text; - } //Builds textOutput table with shape details - - function _shapeDetails(idT, ingredients) { - var shapeDetails = ""; - var shapeNumber = 0; - //goes trhough every shape type in ingredients - for (var x in ingredients) { - //and for every shape - for (var y in ingredients[x]) { - //it creates a table row - var row = '') - .concat(ingredients[x][y].color, " ") - .concat(x, ""); - if (x === "line") { - row = - row + - "location = " - .concat(ingredients[x][y].pos, "length = ") - .concat(ingredients[x][y].length, " pixels"); - } else { - row = - row + - "location = ".concat(ingredients[x][y].pos, ""); - if (x !== "point") { - row = - row + - " area = ".concat(ingredients[x][y].area, "%"); - } - row = row + ""; - } - shapeDetails = shapeDetails + row; - shapeNumber++; - } - } - return shapeDetails; - } //Builds textOutput shape list - - function _shapeList(idT, ingredients) { - var shapeList = ""; - var shapeNumber = 0; - //goes trhough every shape type in ingredients - for (var x in ingredients) { - for (var y in ingredients[x]) { - //it creates a line in a list - var _line = '
                                • ') - .concat(ingredients[x][y].color, " ") - .concat(x, ""); - if (x === "line") { - _line = - _line + - ", " - .concat(ingredients[x][y].pos, ", ") - .concat(ingredients[x][y].length, " pixels long.
                                • "); - } else { - _line = _line + ", at ".concat(ingredients[x][y].pos); - if (x !== "point") { - _line = - _line + - ", covering ".concat( - ingredients[x][y].area, - "% of the canvas", - ); - } - _line = _line + "."; - } - shapeList = shapeList + _line; - shapeNumber++; - } - } - return { - numShapes: shapeNumber, - listShapes: shapeList, - }; - } - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - }, - ], - 281: [ - function (_dereq_, module, exports) { - "use strict"; - var _main = _interopRequireDefault(_dereq_("./core/main")); - _dereq_("./core/constants"); - _dereq_("./core/environment"); - _dereq_("./core/friendly_errors/stacktrace"); - _dereq_("./core/friendly_errors/validate_params"); - _dereq_("./core/friendly_errors/file_errors"); - _dereq_("./core/friendly_errors/fes_core"); - _dereq_("./core/friendly_errors/sketch_reader"); - _dereq_("./core/helpers"); - _dereq_("./core/legacy"); - _dereq_("./core/preload"); - _dereq_("./core/p5.Element"); - _dereq_("./core/p5.Graphics"); - _dereq_("./core/p5.Renderer"); - _dereq_("./core/p5.Renderer2D"); - _dereq_("./core/rendering"); - _dereq_("./core/shim"); - _dereq_("./core/structure"); - _dereq_("./core/transform"); - _dereq_("./core/shape/2d_primitives"); - _dereq_("./core/shape/attributes"); - _dereq_("./core/shape/curves"); - _dereq_("./core/shape/vertex"); - _dereq_("./accessibility/outputs"); - _dereq_("./accessibility/textOutput"); - _dereq_("./accessibility/gridOutput"); - _dereq_("./accessibility/color_namer"); - _dereq_("./color/color_conversion"); - _dereq_("./color/creating_reading"); - _dereq_("./color/p5.Color"); - _dereq_("./color/setting"); - _dereq_("./data/p5.TypedDict"); - _dereq_("./data/local_storage.js"); - _dereq_("./dom/dom"); - _dereq_("./accessibility/describe"); - _dereq_("./events/acceleration"); - _dereq_("./events/keyboard"); - _dereq_("./events/mouse"); - _dereq_("./events/touch"); - _dereq_("./image/filters"); - _dereq_("./image/image"); - _dereq_("./image/loading_displaying"); - _dereq_("./image/p5.Image"); - _dereq_("./image/pixels"); - _dereq_("./io/files"); - _dereq_("./io/p5.Table"); - _dereq_("./io/p5.TableRow"); - _dereq_("./io/p5.XML"); - _dereq_("./math/calculation"); - _dereq_("./math/math"); - _dereq_("./math/noise"); - _dereq_("./math/p5.Vector"); - _dereq_("./math/random"); - _dereq_("./math/trigonometry"); - _dereq_("./typography/attributes"); - _dereq_("./typography/loading_displaying"); - _dereq_("./typography/p5.Font"); - _dereq_("./utilities/array_functions"); - _dereq_("./utilities/conversion"); - _dereq_("./utilities/string_functions"); - _dereq_("./utilities/time_date"); - _dereq_("./webgl/3d_primitives"); - _dereq_("./webgl/interaction"); - _dereq_("./webgl/light"); - _dereq_("./webgl/loading"); - _dereq_("./webgl/material"); - _dereq_("./webgl/p5.Camera"); - _dereq_("./webgl/p5.DataArray"); - _dereq_("./webgl/p5.Geometry"); - _dereq_("./webgl/p5.Matrix"); - _dereq_("./webgl/p5.RendererGL.Immediate"); - _dereq_("./webgl/p5.RendererGL"); - _dereq_("./webgl/p5.RendererGL.Retained"); - _dereq_("./webgl/p5.Framebuffer"); - _dereq_("./webgl/p5.Shader"); - _dereq_("./webgl/p5.RenderBuffer"); - _dereq_("./webgl/p5.Texture"); - _dereq_("./webgl/text"); - _dereq_("./core/init"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } // core - //accessibility - // color - // data - // DOM - // accessibility - // events - // image - // io - // math - // typography - // utilities - // webgl - - module.exports = _main.default; - }, - { - "./accessibility/color_namer": 276, - "./accessibility/describe": 277, - "./accessibility/gridOutput": 278, - "./accessibility/outputs": 279, - "./accessibility/textOutput": 280, - "./color/color_conversion": 282, - "./color/creating_reading": 283, - "./color/p5.Color": 284, - "./color/setting": 285, - "./core/constants": 286, - "./core/environment": 287, - "./core/friendly_errors/fes_core": 289, - "./core/friendly_errors/file_errors": 290, - "./core/friendly_errors/sketch_reader": 291, - "./core/friendly_errors/stacktrace": 292, - "./core/friendly_errors/validate_params": 293, - "./core/helpers": 294, - "./core/init": 295, - "./core/legacy": 297, - "./core/main": 298, - "./core/p5.Element": 299, - "./core/p5.Graphics": 300, - "./core/p5.Renderer": 301, - "./core/p5.Renderer2D": 302, - "./core/preload": 303, - "./core/rendering": 304, - "./core/shape/2d_primitives": 305, - "./core/shape/attributes": 306, - "./core/shape/curves": 307, - "./core/shape/vertex": 308, - "./core/shim": 309, - "./core/structure": 310, - "./core/transform": 311, - "./data/local_storage.js": 312, - "./data/p5.TypedDict": 313, - "./dom/dom": 314, - "./events/acceleration": 315, - "./events/keyboard": 316, - "./events/mouse": 317, - "./events/touch": 318, - "./image/filters": 319, - "./image/image": 320, - "./image/loading_displaying": 321, - "./image/p5.Image": 322, - "./image/pixels": 323, - "./io/files": 324, - "./io/p5.Table": 325, - "./io/p5.TableRow": 326, - "./io/p5.XML": 327, - "./math/calculation": 328, - "./math/math": 329, - "./math/noise": 330, - "./math/p5.Vector": 331, - "./math/random": 332, - "./math/trigonometry": 333, - "./typography/attributes": 334, - "./typography/loading_displaying": 335, - "./typography/p5.Font": 336, - "./utilities/array_functions": 337, - "./utilities/conversion": 338, - "./utilities/string_functions": 339, - "./utilities/time_date": 340, - "./webgl/3d_primitives": 341, - "./webgl/interaction": 343, - "./webgl/light": 344, - "./webgl/loading": 345, - "./webgl/material": 346, - "./webgl/p5.Camera": 347, - "./webgl/p5.DataArray": 348, - "./webgl/p5.Framebuffer": 349, - "./webgl/p5.Geometry": 350, - "./webgl/p5.Matrix": 351, - "./webgl/p5.RenderBuffer": 352, - "./webgl/p5.RendererGL": 355, - "./webgl/p5.RendererGL.Immediate": 353, - "./webgl/p5.RendererGL.Retained": 354, - "./webgl/p5.Shader": 356, - "./webgl/p5.Texture": 357, - "./webgl/text": 358, - }, - ], - 282: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Color - * @submodule Color Conversion - * @for p5 - * @requires core - */ - /** - * Conversions adapted from . - * - * In these functions, hue is always in the range [0, 1], just like all other - * components are in the range [0, 1]. 'Brightness' and 'value' are used - * interchangeably. - */ - - _main.default.ColorConversion = { - /** - * Convert an HSBA array to HSLA. - */ - _hsbaToHSLA: function _hsbaToHSLA(hsba) { - var hue = hsba[0]; - var sat = hsba[1]; - var val = hsba[2]; - // Calculate lightness. - var li = ((2 - sat) * val) / 2; - // Convert saturation. - if (li !== 0) { - if (li === 1) { - sat = 0; - } else if (li < 0.5) { - sat = sat / (2 - sat); - } else { - sat = (sat * val) / (2 - li * 2); - } - } // Hue and alpha stay the same. - - return [hue, sat, li, hsba[3]]; - }, - /** - * Convert an HSBA array to RGBA. - */ - _hsbaToRGBA: function _hsbaToRGBA(hsba) { - var hue = hsba[0] * 6; // We will split hue into 6 sectors. - var sat = hsba[1]; - var val = hsba[2]; - var RGBA = []; - if (sat === 0) { - RGBA = [val, val, val, hsba[3]]; // Return early if grayscale. - } else { - var sector = Math.floor(hue); - var tint1 = val * (1 - sat); - var tint2 = val * (1 - sat * (hue - sector)); - var tint3 = val * (1 - sat * (1 + sector - hue)); - var red, green, blue; - if (sector === 1) { - // Yellow to green. - red = tint2; - green = val; - blue = tint1; - } else if (sector === 2) { - // Green to cyan. - red = tint1; - green = val; - blue = tint3; - } else if (sector === 3) { - // Cyan to blue. - red = tint1; - green = tint2; - blue = val; - } else if (sector === 4) { - // Blue to magenta. - red = tint3; - green = tint1; - blue = val; - } else if (sector === 5) { - // Magenta to red. - red = val; - green = tint1; - blue = tint2; - } else { - // Red to yellow (sector could be 0 or 6). - red = val; - green = tint3; - blue = tint1; - } - RGBA = [red, green, blue, hsba[3]]; - } - return RGBA; - }, - /** - * Convert an HSLA array to HSBA. - */ - _hslaToHSBA: function _hslaToHSBA(hsla) { - var hue = hsla[0]; - var sat = hsla[1]; - var li = hsla[2]; - // Calculate brightness. - var val; - if (li < 0.5) { - val = (1 + sat) * li; - } else { - val = li + sat - li * sat; - } // Convert saturation. - - sat = (2 * (val - li)) / val; - // Hue and alpha stay the same. - return [hue, sat, val, hsla[3]]; - }, - /** - * Convert an HSLA array to RGBA. - * - * We need to change basis from HSLA to something that can be more easily be - * projected onto RGBA. We will choose hue and brightness as our first two - * components, and pick a convenient third one ('zest') so that we don't need - * to calculate formal HSBA saturation. - */ - _hslaToRGBA: function _hslaToRGBA(hsla) { - var hue = hsla[0] * 6; // We will split hue into 6 sectors. - var sat = hsla[1]; - var li = hsla[2]; - var RGBA = []; - if (sat === 0) { - RGBA = [li, li, li, hsla[3]]; // Return early if grayscale. - } else { - // Calculate brightness. - var val; - if (li < 0.5) { - val = (1 + sat) * li; - } else { - val = li + sat - li * sat; - } // Define zest. - - var zest = 2 * li - val; - // Implement projection (project onto green by default). - var hzvToRGB = function hzvToRGB(hue, zest, val) { - if (hue < 0) { - // Hue must wrap to allow projection onto red and blue. - hue += 6; - } else if (hue >= 6) { - hue -= 6; - } - if (hue < 1) { - // Red to yellow (increasing green). - return zest + (val - zest) * hue; - } else if (hue < 3) { - // Yellow to cyan (greatest green). - return val; - } else if (hue < 4) { - // Cyan to blue (decreasing green). - return zest + (val - zest) * (4 - hue); - } else { - // Blue to red (least green). - return zest; - } - }; - // Perform projections, offsetting hue as necessary. - RGBA = [ - hzvToRGB(hue + 2, zest, val), - hzvToRGB(hue, zest, val), - hzvToRGB(hue - 2, zest, val), - hsla[3], - ]; - } - return RGBA; - }, - /** - * Convert an RGBA array to HSBA. - */ - _rgbaToHSBA: function _rgbaToHSBA(rgba) { - var red = rgba[0]; - var green = rgba[1]; - var blue = rgba[2]; - var val = Math.max(red, green, blue); - var chroma = val - Math.min(red, green, blue); - var hue, sat; - if (chroma === 0) { - // Return early if grayscale. - hue = 0; - sat = 0; - } else { - sat = chroma / val; - if (red === val) { - // Magenta to yellow. - hue = (green - blue) / chroma; - } else if (green === val) { - // Yellow to cyan. - hue = 2 + (blue - red) / chroma; - } else if (blue === val) { - // Cyan to magenta. - hue = 4 + (red - green) / chroma; - } - if (hue < 0) { - // Confine hue to the interval [0, 1). - hue += 6; - } else if (hue >= 6) { - hue -= 6; - } - } - return [hue / 6, sat, val, rgba[3]]; - }, - /** - * Convert an RGBA array to HSLA. - */ - _rgbaToHSLA: function _rgbaToHSLA(rgba) { - var red = rgba[0]; - var green = rgba[1]; - var blue = rgba[2]; - var val = Math.max(red, green, blue); - var min = Math.min(red, green, blue); - var li = val + min; // We will halve this later. - var chroma = val - min; - var hue, sat; - if (chroma === 0) { - // Return early if grayscale. - hue = 0; - sat = 0; - } else { - if (li < 1) { - sat = chroma / li; - } else { - sat = chroma / (2 - li); - } - if (red === val) { - // Magenta to yellow. - hue = (green - blue) / chroma; - } else if (green === val) { - // Yellow to cyan. - hue = 2 + (blue - red) / chroma; - } else if (blue === val) { - // Cyan to magenta. - hue = 4 + (red - green) / chroma; - } - if (hue < 0) { - // Confine hue to the interval [0, 1). - hue += 6; - } else if (hue >= 6) { - hue -= 6; - } - } - return [hue / 6, sat, li / 2, rgba[3]]; - }, - }; - var _default = _main.default.ColorConversion; - exports.default = _default; - }, - { - "../core/main": 298, - }, - ], - 283: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.map"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - _dereq_("./p5.Color"); - _dereq_("../core/friendly_errors/validate_params"); - _dereq_("../core/friendly_errors/file_errors"); - _dereq_("../core/friendly_errors/fes_core"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Color - * @submodule Creating & Reading - * @for p5 - * @requires core - * @requires constants - */ - /** - * Extracts the alpha (transparency) value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method alpha - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the alpha value. - * - * @example - *
                                  - * - * noStroke(); - * const c = color(0, 126, 255, 102); - * fill(c); - * rect(15, 15, 35, 70); - * // Sets 'alphaValue' to 102. - * const alphaValue = alpha(c); - * fill(alphaValue); - * rect(50, 15, 35, 70); - * describe('Two rectangles. The left one is light blue and the right one is charcoal gray.'); - * - *
                                  - */ - - _main.default.prototype.alpha = function (c) { - _main.default._validateParameters("alpha", arguments); - return this.color(c)._getAlpha(); - }; - /** - * Extracts the blue value from a p5.Color object, - * array of color components, or CSS color string. - * - * @method blue - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the blue value. - * @example - *
                                  - * - * const c = color(175, 100, 220); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'blueValue' to 220. - * const blueValue = blue(c); - * fill(0, 0, blueValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The left one is light purple and the right one is royal blue.'); - * - *
                                  - * - */ - _main.default.prototype.blue = function (c) { - _main.default._validateParameters("blue", arguments); - return this.color(c)._getBlue(); - }; - /** - * Extracts the HSB brightness value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method brightness - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the brightness value. - * - * @example - *
                                  - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color(0, 126, 255); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'brightValue' to 255. - * const brightValue = brightness(c); - * fill(brightValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The left one is salmon pink and the right one is white.'); - * - *
                                  - * - *
                                  - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color('hsb(60, 100%, 50%)'); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'brightValue' to 127.5 (50% of 255) - * const brightValue = brightness(c); - * fill(brightValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The left one is olive and the right one is gray.'); - * - *
                                  - */ - _main.default.prototype.brightness = function (c) { - _main.default._validateParameters("brightness", arguments); - return this.color(c)._getBrightness(); - }; - /** - * Creates a p5.Color object. By default, the - * parameters are interpreted as RGB values. Calling `color(255, 204, 0)` will - * return a bright yellow color. The way these parameters are interpreted may - * be changed with the colorMode() function. - * - * The version of `color()` with one parameter interprets the value one of two - * ways. If the parameter is a number, it's interpreted as a grayscale value. - * If the parameter is a string, it's interpreted as a CSS color string. - * - * The version of `color()` with two parameters interprets the first one as a - * grayscale value. The second parameter sets the alpha (transparency) value. - * - * The version of `color()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current `colorMode()`. - * - * The version of `color()` with four parameters interprets them as RGBA, HSBA, - * or HSLA colors, depending on the current `colorMode()`. The last parameter - * sets the alpha (transparency) value. - * - * @method color - * @param {Number} gray number specifying value between white and black. - * @param {Number} [alpha] alpha value relative to current color range - * (default is 0-255). - * @return {p5.Color} resulting color. - * - * @example - *
                                  - * - * const c = color(255, 204, 0); - * fill(c); - * noStroke(); - * rect(30, 20, 55, 55); - * describe('A yellow rectangle on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * // RGB values. - * let c = color(255, 204, 0); - * fill(c); - * noStroke(); - * circle(25, 25, 80); - * // A grayscale value. - * c = color(65); - * fill(c); - * circle(75, 75, 80); - * describe( - * 'Two ellipses. The circle in the top-left corner is yellow and the one at the bottom-right is gray.' - * ); - * - *
                                  - * - *
                                  - * - * // A CSS named color. - * const c = color('magenta'); - * fill(c); - * noStroke(); - * square(20, 20, 60); - * describe('A magenta square on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * // CSS hex color codes. - * noStroke(); - * let c = color('#0f0'); - * fill(c); - * rect(0, 10, 45, 80); - * c = color('#00ff00'); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two bright green rectangles on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * // RGB and RGBA color strings. - * noStroke(); - * let c = color('rgb(0,0,255)'); - * fill(c); - * square(10, 10, 35); - * c = color('rgb(0%, 0%, 100%)'); - * fill(c); - * square(55, 10, 35); - * c = color('rgba(0, 0, 255, 1)'); - * fill(c); - * square(10, 55, 35); - * c = color('rgba(0%, 0%, 100%, 1)'); - * fill(c); - * square(55, 55, 35); - * describe('Four blue squares in corners of a gray canvas.'); - * - *
                                  - * - *
                                  - * - * // HSL and HSLA color strings. - * let c = color('hsl(160, 100%, 50%)'); - * noStroke(); - * fill(c); - * rect(0, 10, 45, 80); - * c = color('hsla(160, 100%, 50%, 0.5)'); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two sea green rectangles. A darker rectangle on the left and a brighter one on the right.'); - * - *
                                  - * - *
                                  - * - * // HSB and HSBA color strings. - * let c = color('hsb(160, 100%, 50%)'); - * noStroke(); - * fill(c); - * rect(0, 10, 45, 80); - * c = color('hsba(160, 100%, 50%, 0.5)'); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two green rectangles. A darker rectangle on the left and a brighter one on the right.'); - * - *
                                  - * - *
                                  - * - * // Changing color modes. - * noStroke(); - * let c = color(50, 55, 100); - * fill(c); - * rect(0, 10, 45, 80); - * colorMode(HSB, 100); - * c = color(50, 55, 100); - * fill(c); - * rect(55, 10, 45, 80); - * describe('Two blue rectangles. A darker rectangle on the left and a brighter one on the right.'); - * - *
                                  - */ - /** - * @method color - * @param {Number} v1 red or hue value relative to - * the current color range. - * @param {Number} v2 green or saturation value - * relative to the current color range. - * @param {Number} v3 blue or brightness value - * relative to the current color range. - * @param {Number} [alpha] - * @return {p5.Color} - */ - /** - * @method color - * @param {String} value a color string. - * @return {p5.Color} - */ - /** - * @method color - * @param {Number[]} values an array containing the red, green, blue, - * and alpha components of the color. - * @return {p5.Color} - */ - /** - * @method color - * @param {p5.Color} color - * @return {p5.Color} - */ - _main.default.prototype.color = function () { - _main.default._validateParameters("color", arguments); - if (arguments[0] instanceof _main.default.Color) { - return arguments[0]; // Do nothing if argument is already a color object. - } - var args = arguments[0] instanceof Array ? arguments[0] : arguments; - return new _main.default.Color(this, args); - }; - /** - * Extracts the green value from a p5.Color object, - * array of color components, or CSS color string. - * - * @method green - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the green value. - * @example - *
                                  - * - * const c = color(20, 75, 200); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'greenValue' to 75. - * const greenValue = green(c); - * fill(0, greenValue, 0); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The rectangle on the left is blue and the one on the right is green.'); - * - *
                                  - */ - _main.default.prototype.green = function (c) { - _main.default._validateParameters("green", arguments); - return this.color(c)._getGreen(); - }; - /** - * Extracts the hue value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * Hue exists in both HSB and HSL. It describes a color's position on the - * color wheel. By default, this function returns the HSL-normalized hue. If - * the colorMode() is set to HSB, it returns the - * HSB-normalized hue. - * - * @method hue - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the hue - * @example - *
                                  - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color(0, 126, 255); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'hueValue' to 0. - * const hueValue = hue(c); - * fill(hueValue); - * rect(50, 20, 35, 60); - * describe( - * 'Two rectangles. The rectangle on the left is salmon pink and the one on the right is black.' - * ); - * - *
                                  - * - */ - _main.default.prototype.hue = function (c) { - _main.default._validateParameters("hue", arguments); - return this.color(c)._getHue(); - }; - /** - * Blends two colors to find a third color between them. The `amt` parameter - * specifies the amount to interpolate between the two values. 0 is equal to - * the first color, 0.1 is very near the first color, 0.5 is halfway between - * the two colors, and so on. Negative numbers are set to 0. Numbers greater - * than 1 are set to 1. This differs from the behavior of - * lerp. It's necessary because numbers outside of the - * interval [0, 1] will produce strange and unexpected colors. - * - * The way that colors are interpolated depends on the current - * colorMode(). - * - * @method lerpColor - * @param {p5.Color} c1 interpolate from this color. - * @param {p5.Color} c2 interpolate to this color. - * @param {Number} amt number between 0 and 1. - * @return {p5.Color} interpolated color. - * - * @example - *
                                  - * - * colorMode(RGB); - * stroke(255); - * background(51); - * const from = color(218, 165, 32); - * const to = color(72, 61, 139); - * colorMode(RGB); - * const interA = lerpColor(from, to, 0.33); - * const interB = lerpColor(from, to, 0.66); - * fill(from); - * rect(10, 20, 20, 60); - * fill(interA); - * rect(30, 20, 20, 60); - * fill(interB); - * rect(50, 20, 20, 60); - * fill(to); - * rect(70, 20, 20, 60); - * describe( - * 'Four rectangles with white edges. From left to right, the rectangles are tan, brown, brownish purple, and purple.' - * ); - * - *
                                  - */ - _main.default.prototype.lerpColor = function (c1, c2, amt) { - _main.default._validateParameters("lerpColor", arguments); - var mode = this._colorMode; - var maxes = this._colorMaxes; - var l0, l1, l2, l3; - var fromArray, toArray; - if (mode === constants.RGB) { - fromArray = c1.levels.map(function (level) { - return level / 255; - }); - toArray = c2.levels.map(function (level) { - return level / 255; - }); - } else if (mode === constants.HSB) { - c1._getBrightness(); // Cache hsba so it definitely exists. - c2._getBrightness(); - fromArray = c1.hsba; - toArray = c2.hsba; - } else if (mode === constants.HSL) { - c1._getLightness(); // Cache hsla so it definitely exists. - c2._getLightness(); - fromArray = c1.hsla; - toArray = c2.hsla; - } else { - throw new Error( - "".concat(mode, "cannot be used for interpolation."), - ); - } // Prevent extrapolation. - - amt = Math.max(Math.min(amt, 1), 0); - // Define lerp here itself if user isn't using math module. - // Maintains the definition as found in math/calculation.js - if (typeof this.lerp === "undefined") { - this.lerp = function (start, stop, amt) { - return amt * (stop - start) + start; - }; - } // Perform interpolation. - - l0 = this.lerp(fromArray[0], toArray[0], amt); - l1 = this.lerp(fromArray[1], toArray[1], amt); - l2 = this.lerp(fromArray[2], toArray[2], amt); - l3 = this.lerp(fromArray[3], toArray[3], amt); - // Scale components. - l0 *= maxes[mode][0]; - l1 *= maxes[mode][1]; - l2 *= maxes[mode][2]; - l3 *= maxes[mode][3]; - return this.color(l0, l1, l2, l3); - }; - /** - * Extracts the HSL lightness value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method lightness - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the lightness - * - * @example - *
                                  - * - * noStroke(); - * colorMode(HSL); - * const c = color(156, 100, 50, 1); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'lightValue' to 50. - * const lightValue = lightness(c); - * fill(lightValue); - * rect(50, 20, 35, 60); - * describe('Two rectangles. The rectangle on the left is light green and the one on the right is gray.'); - * - *
                                  - */ - _main.default.prototype.lightness = function (c) { - _main.default._validateParameters("lightness", arguments); - return this.color(c)._getLightness(); - }; - /** - * Extracts the red value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * @method red - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the red value. - * @example - *
                                  - * - * const c = color(255, 204, 0); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'redValue' to 255. - * const redValue = red(c); - * fill(redValue, 0, 0); - * rect(50, 20, 35, 60); - * describe( - * 'Two rectangles with black edges. The rectangle on the left is yellow and the one on the right is red.' - * ); - * - *
                                  - */ - _main.default.prototype.red = function (c) { - _main.default._validateParameters("red", arguments); - return this.color(c)._getRed(); - }; - /** - * Extracts the saturation value from a - * p5.Color object, array of color components, or - * CSS color string. - * - * Saturation is scaled differently in HSB and HSL. By default, this function - * returns the HSL saturation. If the colorMode() - * is set to HSB, it returns the HSB saturation. - * - * @method saturation - * @param {p5.Color|Number[]|String} color p5.Color object, array of - * color components, or CSS color string. - * @return {Number} the saturation value - * @example - *
                                  - * - * noStroke(); - * colorMode(HSB, 255); - * const c = color(0, 126, 255); - * fill(c); - * rect(15, 20, 35, 60); - * // Sets 'satValue' to 126. - * const satValue = saturation(c); - * fill(satValue); - * rect(50, 20, 35, 60); - * describe( - * 'Two rectangles. The rectangle on the left is deep pink and the one on the right is gray.' - * ); - * - *
                                  - */ - _main.default.prototype.saturation = function (c) { - _main.default._validateParameters("saturation", arguments); - return this.color(c)._getSaturation(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/friendly_errors/fes_core": 289, - "../core/friendly_errors/file_errors": 290, - "../core/friendly_errors/validate_params": 293, - "../core/main": 298, - "./p5.Color": 284, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 284: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.trim"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - var _color_conversion = _interopRequireDefault( - _dereq_("./color_conversion"), - ); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Color - * @submodule Creating & Reading - * @for p5 - * @requires core - * @requires constants - * @requires color_conversion - */ - /** - * CSS named colors. - */ - - var namedColors = { - aliceblue: "#f0f8ff", - antiquewhite: "#faebd7", - aqua: "#00ffff", - aquamarine: "#7fffd4", - azure: "#f0ffff", - beige: "#f5f5dc", - bisque: "#ffe4c4", - black: "#000000", - blanchedalmond: "#ffebcd", - blue: "#0000ff", - blueviolet: "#8a2be2", - brown: "#a52a2a", - burlywood: "#deb887", - cadetblue: "#5f9ea0", - chartreuse: "#7fff00", - chocolate: "#d2691e", - coral: "#ff7f50", - cornflowerblue: "#6495ed", - cornsilk: "#fff8dc", - crimson: "#dc143c", - cyan: "#00ffff", - darkblue: "#00008b", - darkcyan: "#008b8b", - darkgoldenrod: "#b8860b", - darkgray: "#a9a9a9", - darkgreen: "#006400", - darkgrey: "#a9a9a9", - darkkhaki: "#bdb76b", - darkmagenta: "#8b008b", - darkolivegreen: "#556b2f", - darkorange: "#ff8c00", - darkorchid: "#9932cc", - darkred: "#8b0000", - darksalmon: "#e9967a", - darkseagreen: "#8fbc8f", - darkslateblue: "#483d8b", - darkslategray: "#2f4f4f", - darkslategrey: "#2f4f4f", - darkturquoise: "#00ced1", - darkviolet: "#9400d3", - deeppink: "#ff1493", - deepskyblue: "#00bfff", - dimgray: "#696969", - dimgrey: "#696969", - dodgerblue: "#1e90ff", - firebrick: "#b22222", - floralwhite: "#fffaf0", - forestgreen: "#228b22", - fuchsia: "#ff00ff", - gainsboro: "#dcdcdc", - ghostwhite: "#f8f8ff", - gold: "#ffd700", - goldenrod: "#daa520", - gray: "#808080", - green: "#008000", - greenyellow: "#adff2f", - grey: "#808080", - honeydew: "#f0fff0", - hotpink: "#ff69b4", - indianred: "#cd5c5c", - indigo: "#4b0082", - ivory: "#fffff0", - khaki: "#f0e68c", - lavender: "#e6e6fa", - lavenderblush: "#fff0f5", - lawngreen: "#7cfc00", - lemonchiffon: "#fffacd", - lightblue: "#add8e6", - lightcoral: "#f08080", - lightcyan: "#e0ffff", - lightgoldenrodyellow: "#fafad2", - lightgray: "#d3d3d3", - lightgreen: "#90ee90", - lightgrey: "#d3d3d3", - lightpink: "#ffb6c1", - lightsalmon: "#ffa07a", - lightseagreen: "#20b2aa", - lightskyblue: "#87cefa", - lightslategray: "#778899", - lightslategrey: "#778899", - lightsteelblue: "#b0c4de", - lightyellow: "#ffffe0", - lime: "#00ff00", - limegreen: "#32cd32", - linen: "#faf0e6", - magenta: "#ff00ff", - maroon: "#800000", - mediumaquamarine: "#66cdaa", - mediumblue: "#0000cd", - mediumorchid: "#ba55d3", - mediumpurple: "#9370db", - mediumseagreen: "#3cb371", - mediumslateblue: "#7b68ee", - mediumspringgreen: "#00fa9a", - mediumturquoise: "#48d1cc", - mediumvioletred: "#c71585", - midnightblue: "#191970", - mintcream: "#f5fffa", - mistyrose: "#ffe4e1", - moccasin: "#ffe4b5", - navajowhite: "#ffdead", - navy: "#000080", - oldlace: "#fdf5e6", - olive: "#808000", - olivedrab: "#6b8e23", - orange: "#ffa500", - orangered: "#ff4500", - orchid: "#da70d6", - palegoldenrod: "#eee8aa", - palegreen: "#98fb98", - paleturquoise: "#afeeee", - palevioletred: "#db7093", - papayawhip: "#ffefd5", - peachpuff: "#ffdab9", - peru: "#cd853f", - pink: "#ffc0cb", - plum: "#dda0dd", - powderblue: "#b0e0e6", - purple: "#800080", - rebeccapurple: "#663399", - red: "#ff0000", - rosybrown: "#bc8f8f", - royalblue: "#4169e1", - saddlebrown: "#8b4513", - salmon: "#fa8072", - sandybrown: "#f4a460", - seagreen: "#2e8b57", - seashell: "#fff5ee", - sienna: "#a0522d", - silver: "#c0c0c0", - skyblue: "#87ceeb", - slateblue: "#6a5acd", - slategray: "#708090", - slategrey: "#708090", - snow: "#fffafa", - springgreen: "#00ff7f", - steelblue: "#4682b4", - tan: "#d2b48c", - teal: "#008080", - thistle: "#d8bfd8", - tomato: "#ff6347", - turquoise: "#40e0d0", - violet: "#ee82ee", - wheat: "#f5deb3", - white: "#ffffff", - whitesmoke: "#f5f5f5", - yellow: "#ffff00", - yellowgreen: "#9acd32", - }; - /** - * These regular expressions are used to build up the patterns for matching - * viable CSS color strings: fragmenting the regexes in this way increases the - * legibility and comprehensibility of the code. - * - * Note that RGB values of .9 are not parsed by IE, but are supported here for - * color string consistency. - */ - var WHITESPACE = /\s*/; // Match zero or more whitespace characters. - var INTEGER = /(\d{1,3})/; // Match integers: 79, 255, etc. - var DECIMAL = /((?:\d+(?:\.\d+)?)|(?:\.\d+))/; // Match 129.6, 79, .9, etc. - var PERCENT = new RegExp("".concat(DECIMAL.source, "%")); // Match 12.9%, 79%, .9%, etc. - /** - * Full color string patterns. The capture groups are necessary. - */ - var colorPatterns = { - // Match colors in format #XXX, e.g. #416. - HEX3: /^#([a-f0-9])([a-f0-9])([a-f0-9])$/i, - // Match colors in format #XXXX, e.g. #5123. - HEX4: /^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i, - // Match colors in format #XXXXXX, e.g. #b4d455. - HEX6: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, - // Match colors in format #XXXXXXXX, e.g. #b4d45535. - HEX8: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, - // Match colors in format rgb(R, G, B), e.g. rgb(255, 0, 128). - RGB: new RegExp( - [ - "^rgb\\(", - INTEGER.source, - ",", - INTEGER.source, - ",", - INTEGER.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format rgb(R%, G%, B%), e.g. rgb(100%, 0%, 28.9%). - RGB_PERCENT: new RegExp( - [ - "^rgb\\(", - PERCENT.source, - ",", - PERCENT.source, - ",", - PERCENT.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format rgb(R, G, B, A), e.g. rgb(255, 0, 128, 0.25). - RGBA: new RegExp( - [ - "^rgba\\(", - INTEGER.source, - ",", - INTEGER.source, - ",", - INTEGER.source, - ",", - DECIMAL.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format rgb(R%, G%, B%, A), e.g. rgb(100%, 0%, 28.9%, 0.5). - RGBA_PERCENT: new RegExp( - [ - "^rgba\\(", - PERCENT.source, - ",", - PERCENT.source, - ",", - PERCENT.source, - ",", - DECIMAL.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format hsla(H, S%, L%), e.g. hsl(100, 40%, 28.9%). - HSL: new RegExp( - [ - "^hsl\\(", - INTEGER.source, - ",", - PERCENT.source, - ",", - PERCENT.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format hsla(H, S%, L%, A), e.g. hsla(100, 40%, 28.9%, 0.5). - HSLA: new RegExp( - [ - "^hsla\\(", - INTEGER.source, - ",", - PERCENT.source, - ",", - PERCENT.source, - ",", - DECIMAL.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format hsb(H, S%, B%), e.g. hsb(100, 40%, 28.9%). - HSB: new RegExp( - [ - "^hsb\\(", - INTEGER.source, - ",", - PERCENT.source, - ",", - PERCENT.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - // Match colors in format hsba(H, S%, B%, A), e.g. hsba(100, 40%, 28.9%, 0.5). - HSBA: new RegExp( - [ - "^hsba\\(", - INTEGER.source, - ",", - PERCENT.source, - ",", - PERCENT.source, - ",", - DECIMAL.source, - "\\)$", - ].join(WHITESPACE.source), - "i", - ), - }; - /** - * A class to describe a color. Each `p5.Color` object stores the color mode - * and level maxes that were active during its construction. These values are - * used to interpret the arguments passed to the object's constructor. They - * also determine output formatting such as when - * saturation() is called. - * - * Color is stored internally as an array of ideal RGBA values in floating - * point form, normalized from 0 to 1. These values are used to calculate the - * closest screen colors, which are RGBA levels from 0 to 255. Screen colors - * are sent to the renderer. - * - * When different color representations are calculated, the results are cached - * for performance. These values are normalized, floating-point numbers. - * - * color() is the recommended way to create an instance - * of this class. - * - * @class p5.Color - * @constructor - * @param {p5} [pInst] pointer to p5 instance. - * - * @param {Number[]|String} vals an array containing the color values - * for red, green, blue and alpha channel - * or CSS color. - */ - _main.default.Color = /*#__PURE__*/ (function () { - function Color(pInst, vals) { - _classCallCheck(this, Color); - // Record color mode and maxes at time of construction. - this._storeModeAndMaxes(pInst._colorMode, pInst._colorMaxes); - // Calculate normalized RGBA values. - if ( - ![constants.RGB, constants.HSL, constants.HSB].includes( - this.mode, - ) - ) { - throw new Error( - "".concat(this.mode, " is an invalid colorMode."), - ); - } else { - this._array = Color._parseInputs.apply(this, vals); - } // Expose closest screen color. - - this._calculateLevels(); - } /** - * Returns the color formatted as a string. Doing so can be useful for - * debugging, or for using p5.js with other libraries. - * - * @method toString - * @param {String} [format] how the color string will be formatted. - * Leaving this empty formats the string as rgba(r, g, b, a). - * '#rgb' '#rgba' '#rrggbb' and '#rrggbbaa' format as hexadecimal color codes. - * 'rgb' 'hsb' and 'hsl' return the color formatted in the specified color mode. - * 'rgba' 'hsba' and 'hsla' are the same as above but with alpha channels. - * 'rgb%' 'hsb%' 'hsl%' 'rgba%' 'hsba%' and 'hsla%' format as percentages. - * @return {String} the formatted string. - * - * @example - *
                                  - * - * createCanvas(200, 100); - * stroke(255); - * const myColor = color(100, 100, 250); - * fill(myColor); - * rotate(HALF_PI); - * text(myColor.toString(), 0, -5); - * text(myColor.toString('#rrggbb'), 0, -30); - * text(myColor.toString('rgba%'), 0, -55); - * describe('Three text representation of a color written sideways.'); - * - *
                                  - * - *
                                  - * - * const myColor = color(100, 130, 250); - * text(myColor.toString('#rrggbb'), 25, 25); - * describe('A hexadecimal representation of a color.'); - * - *
                                  - */ - - _createClass( - Color, - [ - { - key: "toString", - value: function toString(format) { - var a = this.levels; - var f = this._array; - var alpha = f[3]; // String representation uses normalized alpha - switch (format) { - case "#rrggbb": - return "#".concat( - a[0] < 16 - ? "0".concat(a[0].toString(16)) - : a[0].toString(16), - a[1] < 16 - ? "0".concat(a[1].toString(16)) - : a[1].toString(16), - a[2] < 16 - ? "0".concat(a[2].toString(16)) - : a[2].toString(16), - ); - case "#rrggbbaa": - return "#".concat( - a[0] < 16 - ? "0".concat(a[0].toString(16)) - : a[0].toString(16), - a[1] < 16 - ? "0".concat(a[1].toString(16)) - : a[1].toString(16), - a[2] < 16 - ? "0".concat(a[2].toString(16)) - : a[2].toString(16), - a[3] < 16 - ? "0".concat(a[3].toString(16)) - : a[3].toString(16), - ); - case "#rgb": - return "#".concat( - Math.round(f[0] * 15).toString(16), - Math.round(f[1] * 15).toString(16), - Math.round(f[2] * 15).toString(16), - ); - case "#rgba": - return "#".concat( - Math.round(f[0] * 15).toString(16), - Math.round(f[1] * 15).toString(16), - Math.round(f[2] * 15).toString(16), - Math.round(f[3] * 15).toString(16), - ); - case "rgb": - return "rgb(".concat(a[0], ", ", a[1], ", ", a[2], ")"); - case "rgb%": - return "rgb(".concat( - (100 * f[0]).toPrecision(3), - "%, ", - (100 * f[1]).toPrecision(3), - "%, ", - (100 * f[2]).toPrecision(3), - "%)", - ); - case "rgba%": - return "rgba(".concat( - (100 * f[0]).toPrecision(3), - "%, ", - (100 * f[1]).toPrecision(3), - "%, ", - (100 * f[2]).toPrecision(3), - "%, ", - (100 * f[3]).toPrecision(3), - "%)", - ); - case "hsb": - case "hsv": - if (!this.hsba) - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - return "hsb(".concat( - this.hsba[0] * this.maxes[constants.HSB][0], - ", ", - this.hsba[1] * this.maxes[constants.HSB][1], - ", ", - this.hsba[2] * this.maxes[constants.HSB][2], - ")", - ); - case "hsb%": - case "hsv%": - if (!this.hsba) - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - return "hsb(".concat( - (100 * this.hsba[0]).toPrecision(3), - "%, ", - (100 * this.hsba[1]).toPrecision(3), - "%, ", - (100 * this.hsba[2]).toPrecision(3), - "%)", - ); - case "hsba": - case "hsva": - if (!this.hsba) - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - return "hsba(".concat( - this.hsba[0] * this.maxes[constants.HSB][0], - ", ", - this.hsba[1] * this.maxes[constants.HSB][1], - ", ", - this.hsba[2] * this.maxes[constants.HSB][2], - ", ", - alpha, - ")", - ); - case "hsba%": - case "hsva%": - if (!this.hsba) - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - return "hsba(".concat( - (100 * this.hsba[0]).toPrecision(3), - "%, ", - (100 * this.hsba[1]).toPrecision(3), - "%, ", - (100 * this.hsba[2]).toPrecision(3), - "%, ", - (100 * alpha).toPrecision(3), - "%)", - ); - case "hsl": - if (!this.hsla) - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - return "hsl(".concat( - this.hsla[0] * this.maxes[constants.HSL][0], - ", ", - this.hsla[1] * this.maxes[constants.HSL][1], - ", ", - this.hsla[2] * this.maxes[constants.HSL][2], - ")", - ); - case "hsl%": - if (!this.hsla) - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - return "hsl(".concat( - (100 * this.hsla[0]).toPrecision(3), - "%, ", - (100 * this.hsla[1]).toPrecision(3), - "%, ", - (100 * this.hsla[2]).toPrecision(3), - "%)", - ); - case "hsla": - if (!this.hsla) - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - return "hsla(".concat( - this.hsla[0] * this.maxes[constants.HSL][0], - ", ", - this.hsla[1] * this.maxes[constants.HSL][1], - ", ", - this.hsla[2] * this.maxes[constants.HSL][2], - ", ", - alpha, - ")", - ); - case "hsla%": - if (!this.hsla) - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - return "hsl(".concat( - (100 * this.hsla[0]).toPrecision(3), - "%, ", - (100 * this.hsla[1]).toPrecision(3), - "%, ", - (100 * this.hsla[2]).toPrecision(3), - "%, ", - (100 * alpha).toPrecision(3), - "%)", - ); - case "rgba": - default: - return "rgba(".concat( - a[0], - ",", - a[1], - ",", - a[2], - ",", - alpha, - ")", - ); - } - } /** - * Sets the red component of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setRed - * @param {Number} red the new red value. - * - * @example - *
                                  - * - * let backgroundColor; - * - * function setup() { - * backgroundColor = color(100, 50, 150); - * } - * - * function draw() { - * backgroundColor.setRed(128 + 128 * sin(millis() / 1000)); - * background(backgroundColor); - * describe('A canvas with a gradually changing background color.'); - * } - * - *
                                  - */, - }, - { - key: "setRed", - value: function setRed(new_red) { - this._array[0] = new_red / this.maxes[constants.RGB][0]; - this._calculateLevels(); - } /** - * Sets the green component of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setGreen - * @param {Number} green the new green value. - * - * @example - *
                                  - * - * let backgroundColor; - * - * function setup() { - * backgroundColor = color(100, 50, 150); - * } - * - * function draw() { - * backgroundColor.setGreen(128 + 128 * sin(millis() / 1000)); - * background(backgroundColor); - * describe('A canvas with a gradually changing background color.'); - * } - * - *
                                  - **/, - }, - { - key: "setGreen", - value: function setGreen(new_green) { - this._array[1] = new_green / this.maxes[constants.RGB][1]; - this._calculateLevels(); - } /** - * Sets the blue component of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setBlue - * @param {Number} blue the new blue value. - * - * @example - *
                                  - * - * let backgroundColor; - * - * function setup() { - * backgroundColor = color(100, 50, 150); - * } - * - * function draw() { - * backgroundColor.setBlue(128 + 128 * sin(millis() / 1000)); - * background(backgroundColor); - * describe('A canvas with a gradually changing background color.'); - * } - * - *
                                  - **/, - }, - { - key: "setBlue", - value: function setBlue(new_blue) { - this._array[2] = new_blue / this.maxes[constants.RGB][2]; - this._calculateLevels(); - } /** - * Sets the alpha (transparency) value of a color. The range depends on the - * colorMode(). In the default RGB mode it's - * between 0 and 255. - * - * @method setAlpha - * @param {Number} alpha the new alpha value. - * - * @example - *
                                  - * - * function draw() { - * clear(); - * background(200); - * const squareColor = color(100, 50, 100); - * squareColor.setAlpha(128 + 128 * sin(millis() / 1000)); - * fill(squareColor); - * rect(13, 13, width - 26, height - 26); - * describe( - * 'A purple square with gradually changing opacity drawn on a gray background.' - * ); - * } - * - *
                                  - **/, - }, - { - key: "setAlpha", - value: function setAlpha(new_alpha) { - this._array[3] = new_alpha / this.maxes[this.mode][3]; - this._calculateLevels(); - }, // calculates and stores the closest screen levels - }, - { - key: "_calculateLevels", - value: function _calculateLevels() { - var array = this._array; - // (loop backwards for performance) - var levels = (this.levels = new Array(array.length)); - for (var i = array.length - 1; i >= 0; --i) { - levels[i] = Math.round(array[i] * 255); - } // Clear cached HSL/HSB values - - this.hsla = null; - this.hsba = null; - }, - }, - { - key: "_getAlpha", - value: function _getAlpha() { - return this._array[3] * this.maxes[this.mode][3]; - }, // stores the color mode and maxes in this instance of Color - // for later use (by _parseInputs()) - }, - { - key: "_storeModeAndMaxes", - value: function _storeModeAndMaxes(new_mode, new_maxes) { - this.mode = new_mode; - this.maxes = new_maxes; - }, - }, - { - key: "_getMode", - value: function _getMode() { - return this.mode; - }, - }, - { - key: "_getMaxes", - value: function _getMaxes() { - return this.maxes; - }, - }, - { - key: "_getBlue", - value: function _getBlue() { - return this._array[2] * this.maxes[constants.RGB][2]; - }, - }, - { - key: "_getBrightness", - value: function _getBrightness() { - if (!this.hsba) { - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - } - return this.hsba[2] * this.maxes[constants.HSB][2]; - }, - }, - { - key: "_getGreen", - value: function _getGreen() { - return this._array[1] * this.maxes[constants.RGB][1]; - } /** - * Hue is the same in HSB and HSL, but the maximum value may be different. - * This function will return the HSB-normalized saturation when supplied with - * an HSB color object, but will default to the HSL-normalized saturation - * otherwise. - */, - }, - { - key: "_getHue", - value: function _getHue() { - if (this.mode === constants.HSB) { - if (!this.hsba) { - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - } - return this.hsba[0] * this.maxes[constants.HSB][0]; - } else { - if (!this.hsla) { - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - } - return this.hsla[0] * this.maxes[constants.HSL][0]; - } - }, - }, - { - key: "_getLightness", - value: function _getLightness() { - if (!this.hsla) { - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - } - return this.hsla[2] * this.maxes[constants.HSL][2]; - }, - }, - { - key: "_getRed", - value: function _getRed() { - return this._array[0] * this.maxes[constants.RGB][0]; - } /** - * Saturation is scaled differently in HSB and HSL. This function will return - * the HSB saturation when supplied with an HSB color object, but will default - * to the HSL saturation otherwise. - */, - }, - { - key: "_getSaturation", - value: function _getSaturation() { - if (this.mode === constants.HSB) { - if (!this.hsba) { - this.hsba = _color_conversion.default._rgbaToHSBA( - this._array, - ); - } - return this.hsba[1] * this.maxes[constants.HSB][1]; - } else { - if (!this.hsla) { - this.hsla = _color_conversion.default._rgbaToHSLA( - this._array, - ); - } - return this.hsla[1] * this.maxes[constants.HSL][1]; - } - } /** - * For a number of different inputs, returns a color formatted as [r, g, b, a] - * arrays, with each component normalized between 0 and 1. - * - * @private - * @param {Array} [...args] An 'array-like' object that represents a list of - * arguments - * @return {Number[]} a color formatted as [r, g, b, a] - * Example: - * input ==> output - * g ==> [g, g, g, 255] - * g,a ==> [g, g, g, a] - * r, g, b ==> [r, g, b, 255] - * r, g, b, a ==> [r, g, b, a] - * [g] ==> [g, g, g, 255] - * [g, a] ==> [g, g, g, a] - * [r, g, b] ==> [r, g, b, 255] - * [r, g, b, a] ==> [r, g, b, a] - * @example - *
                                  - * - * // todo - * // - * // describe(''); - * - *
                                  - */, - }, - ], - [ - { - key: "_parseInputs", - value: function _parseInputs(r, g, b, a) { - var numArgs = arguments.length; - var mode = this.mode; - var maxes = this.maxes[mode]; - var results = []; - var i; - if (numArgs >= 3) { - // Argument is a list of component values. - results[0] = r / maxes[0]; - results[1] = g / maxes[1]; - results[2] = b / maxes[2]; - // Alpha may be undefined, so default it to 100%. - if (typeof a === "number") { - results[3] = a / maxes[3]; - } else { - results[3] = 1; - } // Constrain components to the range [0,1]. - // (loop backwards for performance) - - for (i = results.length - 1; i >= 0; --i) { - var result = results[i]; - if (result < 0) { - results[i] = 0; - } else if (result > 1) { - results[i] = 1; - } - } // Convert to RGBA and return. - - if (mode === constants.HSL) { - return _color_conversion.default._hslaToRGBA(results); - } else if (mode === constants.HSB) { - return _color_conversion.default._hsbaToRGBA(results); - } else { - return results; - } - } else if (numArgs === 1 && typeof r === "string") { - var str = r.trim().toLowerCase(); - // Return if string is a named colour. - if (namedColors[str]) { - return Color._parseInputs.call(this, namedColors[str]); - } // Try RGBA pattern matching. - - if (colorPatterns.HEX3.test(str)) { - // #rgb - results = colorPatterns.HEX3.exec(str) - .slice(1) - .map(function (color) { - return parseInt(color + color, 16) / 255; - }); - results[3] = 1; - return results; - } else if (colorPatterns.HEX6.test(str)) { - // #rrggbb - results = colorPatterns.HEX6.exec(str) - .slice(1) - .map(function (color) { - return parseInt(color, 16) / 255; - }); - results[3] = 1; - return results; - } else if (colorPatterns.HEX4.test(str)) { - // #rgba - results = colorPatterns.HEX4.exec(str) - .slice(1) - .map(function (color) { - return parseInt(color + color, 16) / 255; - }); - return results; - } else if (colorPatterns.HEX8.test(str)) { - // #rrggbbaa - results = colorPatterns.HEX8.exec(str) - .slice(1) - .map(function (color) { - return parseInt(color, 16) / 255; - }); - return results; - } else if (colorPatterns.RGB.test(str)) { - // rgb(R,G,B) - results = colorPatterns.RGB.exec(str) - .slice(1) - .map(function (color) { - return color / 255; - }); - results[3] = 1; - return results; - } else if (colorPatterns.RGB_PERCENT.test(str)) { - // rgb(R%,G%,B%) - results = colorPatterns.RGB_PERCENT.exec(str) - .slice(1) - .map(function (color) { - return parseFloat(color) / 100; - }); - results[3] = 1; - return results; - } else if (colorPatterns.RGBA.test(str)) { - // rgba(R,G,B,A) - results = colorPatterns.RGBA.exec(str) - .slice(1) - .map(function (color, idx) { - if (idx === 3) { - return parseFloat(color); - } - return color / 255; - }); - return results; - } else if (colorPatterns.RGBA_PERCENT.test(str)) { - // rgba(R%,G%,B%,A%) - results = colorPatterns.RGBA_PERCENT.exec(str) - .slice(1) - .map(function (color, idx) { - if (idx === 3) { - return parseFloat(color); - } - return parseFloat(color) / 100; - }); - return results; - } // Try HSLA pattern matching. - - if (colorPatterns.HSL.test(str)) { - // hsl(H,S,L) - results = colorPatterns.HSL.exec(str) - .slice(1) - .map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } - return parseInt(color, 10) / 100; - }); - results[3] = 1; - } else if (colorPatterns.HSLA.test(str)) { - // hsla(H,S,L,A) - results = colorPatterns.HSLA.exec(str) - .slice(1) - .map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } else if (idx === 3) { - return parseFloat(color); - } - return parseInt(color, 10) / 100; - }); - } - results = results.map(function (value) { - return Math.max(Math.min(value, 1), 0); - }); - if (results.length) { - return _color_conversion.default._hslaToRGBA(results); - } // Try HSBA pattern matching. - - if (colorPatterns.HSB.test(str)) { - // hsb(H,S,B) - results = colorPatterns.HSB.exec(str) - .slice(1) - .map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } - return parseInt(color, 10) / 100; - }); - results[3] = 1; - } else if (colorPatterns.HSBA.test(str)) { - // hsba(H,S,B,A) - results = colorPatterns.HSBA.exec(str) - .slice(1) - .map(function (color, idx) { - if (idx === 0) { - return parseInt(color, 10) / 360; - } else if (idx === 3) { - return parseFloat(color); - } - return parseInt(color, 10) / 100; - }); - } - if (results.length) { - // (loop backwards for performance) - for (i = results.length - 1; i >= 0; --i) { - results[i] = Math.max(Math.min(results[i], 1), 0); - } - return _color_conversion.default._hsbaToRGBA(results); - } // Input did not match any CSS color pattern: default to white. - - results = [1, 1, 1, 1]; - } else if ( - (numArgs === 1 || numArgs === 2) && - typeof r === "number" - ) { - // 'Grayscale' mode. - /** - * For HSB and HSL, interpret the gray level as a brightness/lightness - * value (they are equivalent when chroma is zero). For RGB, normalize the - * gray level according to the blue maximum. - */ - results[0] = r / maxes[2]; - results[1] = r / maxes[2]; - results[2] = r / maxes[2]; - // Alpha may be undefined, so default it to 100%. - if (typeof g === "number") { - results[3] = g / maxes[3]; - } else { - results[3] = 1; - } // Constrain components to the range [0,1]. - - results = results.map(function (value) { - return Math.max(Math.min(value, 1), 0); - }); - } else { - throw new Error( - "".concat( - arguments, - "is not a valid color representation.", - ), - ); - } - return results; - }, - }, - ], - ); - return Color; - })(); - var _default = _main.default.Color; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./color_conversion": 282, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.constructor": 204, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.trim": 219, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 285: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.fill"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - _dereq_("./p5.Color"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Color - * @submodule Setting - * @for p5 - * @requires core - * @requires constants - */ - /** - * Start defining a shape that will mask subsequent things drawn to the canvas. - * Only opaque regions of the mask shape will allow content to be drawn. - * Any shapes drawn between this and endClip() will - * contribute to the mask shape. - * - * The mask will apply to anything drawn after this call. To draw without a mask, contain - * the code to apply the mask and to draw the masked content between - * push() and pop(). - * - * Alternatively, rather than drawing the mask between this and - * endClip(), draw the mask in a callback function - * passed to clip(). - * - * Options can include: - * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. - * - * @method beginClip - * @param {Object} [options] An object containing clip settings. - * - * @example - *
                                  - * - * noStroke(); - * - * // Mask in some shapes - * push(); - * beginClip(); - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * endClip(); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - * translate(50, 50); - * - * // Mask out the same shapes - * push(); - * beginClip({ invert: true }); - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * endClip(); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - *
                                  - * - * @alt - * In the top left, a red triangle and circle. In the bottom right, a red - * square with a triangle and circle cut out of it. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(255); - * noStroke(); - * - * beginClip(); - * push(); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * scale(0.5); - * torus(30, 15); - * pop(); - * endClip(); - * - * beginShape(QUAD_STRIP); - * fill(0, 255, 255); - * vertex(-width/2, -height/2); - * vertex(width/2, -height/2); - * fill(100, 0, 100); - * vertex(-width/2, height/2); - * vertex(width/2, height/2); - * endShape(); - * } - * - *
                                  - * - * @alt - * A silhouette of a rotating torus colored with a gradient from - * cyan to purple - */ - - _main.default.prototype.beginClip = function () { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - this._renderer.beginClip(options); - }; - /** - * Finishes defining a shape that will mask subsequent things drawn to the canvas. - * Only opaque regions of the mask shape will allow content to be drawn. - * Any shapes drawn between beginClip() and this - * will contribute to the mask shape. - * - * @method endClip - */ - _main.default.prototype.endClip = function () { - this._renderer.endClip(); - }; - /** - * Use the shape drawn by a callback function to mask subsequent things drawn to the canvas. - * Only opaque regions of the mask shape will allow content to be drawn. - * - * The mask will apply to anything drawn after this call. To draw without a mask, contain - * the code to apply the mask and to draw the masked content between - * push() and pop(). - * - * Alternatively, rather than drawing the mask shape in a function, draw the - * shape between beginClip() and endClip(). - * - * Options can include: - * - `invert`: A boolean specifying whether or not to mask the areas *not* filled by the mask shape. Defaults to false. - * - * @method clip - * @param {Function} callback A function that draws the mask shape. - * @param {Object} [options] An object containing clip settings. - * - * @example - *
                                  - * - * noStroke(); - * - * // Mask in some shapes - * push(); - * clip(() => { - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * }); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - * translate(50, 50); - * - * // Mask out the same shapes - * push(); - * clip(() => { - * triangle(15, 37, 30, 13, 43, 37); - * circle(45, 45, 7); - * }, { invert: true }); - * - * fill('red'); - * rect(5, 5, 45, 45); - * pop(); - * - *
                                  - * - * @alt - * In the top left, a red triangle and circle. In the bottom right, a red - * square with a triangle and circle cut out of it. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(255); - * noStroke(); - * - * clip(() => { - * push(); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * scale(0.5); - * torus(30, 15); - * pop(); - * }); - * - * beginShape(QUAD_STRIP); - * fill(0, 255, 255); - * vertex(-width/2, -height/2); - * vertex(width/2, -height/2); - * fill(100, 0, 100); - * vertex(-width/2, height/2); - * vertex(width/2, height/2); - * endShape(); - * } - * - *
                                  - * - * @alt - * A silhouette of a rotating torus colored with a gradient from - * cyan to purple - */ - _main.default.prototype.clip = function (callback, options) { - this._renderer.beginClip(options); - callback(); - this._renderer.endClip(options); - }; - /** - * Sets the color used for the background of the canvas. By default, the - * background is transparent. This function is typically used within - * draw() to clear the display window at the beginning - * of each frame. It can also be used inside setup() to - * set the background on the first frame of animation. - * - * The version of `background()` with one parameter interprets the value one of four - * ways. If the parameter is a number, it's interpreted as a grayscale value. - * If the parameter is a string, it's interpreted as a CSS color string. RGB, RGBA, - * HSL, HSLA, hex, and named color strings are supported. If the parameter is a - * p5.Color object, it will be used as the background color. - * If the parameter is a p5.Image object, it will be used as - * the background image. - * - * The version of `background()` with two parameters interprets the first one as a - * grayscale value. The second parameter sets the alpha (transparency) value. - * - * The version of `background()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current colorMode(). - * By default, colors are specified in RGB values. Calling background(255, 204, 0) - * sets the background a bright yellow color. - * - * @method background - * @param {p5.Color} color any value created by the color() function - * @chainable - * - * @example - *
                                  - * - * // A grayscale integer value. - * background(51); - * describe('A canvas with a dark charcoal gray background.'); - * - *
                                  - * - *
                                  - * - * // A grayscale integer value and an alpha value. - * background(51, 0.4); - * describe('A canvas with a transparent gray background.'); - * - *
                                  - * - *
                                  - * - * // R, G & B integer values. - * background(255, 204, 0); - * describe('A canvas with a yellow background.'); - * - *
                                  - * - *
                                  - * - * // H, S & B integer values. - * colorMode(HSB); - * background(255, 204, 100); - * describe('A canvas with a royal blue background.'); - * - *
                                  - * - *
                                  - * - * // A CSS named color. - * background('red'); - * describe('A canvas with a red background.'); - * - *
                                  - * - *
                                  - * - * // Three-digit hex RGB notation. - * background('#fae'); - * describe('A canvas with a pink background.'); - * - *
                                  - * - *
                                  - * - * // Six-digit hex RGB notation. - * background('#222222'); - * describe('A canvas with a black background.'); - * - *
                                  - * - *
                                  - * - * // Integer RGB notation. - * background('rgb(0,255,0)'); - * describe('A canvas with a bright green background.'); - * - *
                                  - * - *
                                  - * - * // Integer RGBA notation. - * background('rgba(0,255,0, 0.25)'); - * describe('A canvas with a transparent green background.'); - * - *
                                  - * - *
                                  - * - * // Percentage RGB notation. - * background('rgb(100%,0%,10%)'); - * describe('A canvas with a red background.'); - * - *
                                  - * - *
                                  - * - * // Percentage RGBA notation. - * background('rgba(100%,0%,100%,0.5)'); - * describe('A canvas with a transparent purple background.'); - * - *
                                  - * - *
                                  - * - * // A p5.Color object. - * let c = color(0, 0, 255); - * background(c); - * describe('A canvas with a blue background.'); - * - *
                                  - * - */ - /** - * @method background - * @param {String} colorstring color string, possible formats include: integer - * rgb() or rgba(), percentage rgb() or rgba(), - * 3-digit hex, 6-digit hex. - * @param {Number} [a] opacity of the background relative to current - * color range (default is 0-255). - * @chainable - */ - /** - * @method background - * @param {Number} gray specifies a value between white and black. - * @param {Number} [a] - * @chainable - */ - /** - * @method background - * @param {Number} v1 red value if color mode is RGB, or hue value if color mode is HSB. - * @param {Number} v2 green value if color mode is RGB, or saturation value if color mode is HSB. - * @param {Number} v3 blue value if color mode is RGB, or brightness value if color mode is HSB. - * @param {Number} [a] - * @chainable - */ - /** - * @method background - * @param {Number[]} values an array containing the red, green, blue - * and alpha components of the color. - * @chainable - */ - /** - * @method background - * @param {p5.Image} image image created with loadImage() - * or createImage(), - * to set as background. - * (must be same size as the sketch window). - * @param {Number} [a] - * @chainable - */ - _main.default.prototype.background = function () { - var _this$_renderer; - (_this$_renderer = this._renderer).background.apply( - _this$_renderer, - arguments, - ); - return this; - }; - /** - * Clears the pixels on the canvas. This function makes every pixel 100% - * transparent. Calling `clear()` doesn't clear objects created by `createX()` - * functions such as createGraphics(), - * createVideo(), and - * createImg(). These objects will remain - * unchanged after calling clear() and can be redrawn. - * - * In WebGL mode, this function can clear the screen to a specific color. It - * interprets four numeric parameters as normalized RGBA color values. It also - * clears the depth buffer. If you are not using the WebGL renderer, these - * parameters will have no effect. - * - * @method clear - * @chainable - * @example - *
                                  - * - * function draw() { - * circle(mouseX, mouseY, 20); - * describe('A white circle is drawn at the mouse x- and y-coordinates.'); - * } - * - * function mousePressed() { - * clear(); - * background(128); - * describe('The canvas is cleared when the mouse is clicked.'); - * } - * - *
                                  - * - *
                                  - * - * let pg; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * pg = createGraphics(60, 60); - * pg.background(200); - * pg.noStroke(); - * pg.circle(pg.width / 2, pg.height / 2, 15); - * image(pg, 20, 20); - * describe('A white circle drawn on a gray square. The square gets smaller when the mouse is pressed.'); - * } - * - * function mousePressed() { - * clear(); - * image(pg, 20, 20); - * } - * - *
                                  - * - * @param {Number} r normalized red value. - * @param {Number} g normalized green value. - * @param {Number} b normalized blue value. - * @param {Number} a normalized alpha value. - */ - _main.default.prototype.clear = function () { - var _r = (arguments.length <= 0 ? undefined : arguments[0]) || 0; - var _g = (arguments.length <= 1 ? undefined : arguments[1]) || 0; - var _b = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - var _a = (arguments.length <= 3 ? undefined : arguments[3]) || 0; - this._renderer.clear(_r, _g, _b, _a); - return this; - }; - /** - * Changes the way p5.js interprets color data. By default, the numeric - * parameters for fill(), - * stroke(), - * background(), and - * color() are defined by values between 0 and 255 - * using the RGB color model. This is equivalent to calling - * `colorMode(RGB, 255)`. Pure red is `color(255, 0, 0)` in this model. - * - * Calling `colorMode(RGB, 100)` sets colors to be interpreted as RGB color - * values between 0 and 100. Pure red is `color(100, 0, 0)` in this model. - * - * Calling `colorMode(HSB)` or `colorMode(HSL)` changes to HSB or HSL system - * instead of RGB. - * - * p5.Color objects remember the mode that they were - * created in. Changing modes doesn't affect their appearance. - * - * @method colorMode - * @param {Constant} mode either RGB, HSB or HSL, corresponding to - * Red/Green/Blue and Hue/Saturation/Brightness - * (or Lightness). - * @param {Number} [max] range for all values. - * @chainable - * - * @example - *
                                  - * - * noStroke(); - * colorMode(RGB, 100); - * for (let i = 0; i < 100; i += 1) { - * for (let j = 0; j < 100; j += 1) { - * stroke(i, j, 0); - * point(i, j); - * } - * } - * describe( - * 'A diagonal green to red gradient from bottom-left to top-right with shading transitioning to black at top-left corner.' - * ); - * - *
                                  - * - *
                                  - * - * noStroke(); - * colorMode(HSB, 100); - * for (let i = 0; i < 100; i++) { - * for (let j = 0; j < 100; j++) { - * stroke(i, j, 100); - * point(i, j); - * } - * } - * describe('A rainbow gradient from left-to-right. Brightness transitions to white at the top.'); - * - *
                                  - * - *
                                  - * - * colorMode(RGB, 255); - * let myColor = color(180, 175, 230); - * background(myColor); - * colorMode(RGB, 1); - * let redValue = red(myColor); - * let greenValue = green(myColor); - * let blueValue = blue(myColor); - * text(`Red: ${redValue}`, 10, 10, 80, 80); - * text(`Green: ${greenValue}`, 10, 40, 80, 80); - * text(`Blue: ${blueValue}`, 10, 70, 80, 80); - * describe('A purple canvas with the red, green, and blue decimal values of the color written on it.'); - * - *
                                  - * - *
                                  - * - * noFill(); - * colorMode(RGB, 255, 255, 255, 1); - * background(255); - * strokeWeight(4); - * stroke(255, 0, 10, 0.3); - * circle(40, 40, 50); - * circle(50, 60, 50); - * describe('Two overlapping translucent pink circle outlines.'); - * - *
                                  - * - */ - /** - * @method colorMode - * @param {Constant} mode - * @param {Number} max1 range for the red or hue depending on the - * current color mode. - * @param {Number} max2 range for the green or saturation depending - * on the current color mode. - * @param {Number} max3 range for the blue or brightness/lightness - * depending on the current color mode. - * @param {Number} [maxA] range for the alpha. - * @chainable - */ - _main.default.prototype.colorMode = function ( - mode, - max1, - max2, - max3, - maxA, - ) { - _main.default._validateParameters("colorMode", arguments); - if ( - mode === constants.RGB || - mode === constants.HSB || - mode === constants.HSL - ) { - // Set color mode. - this._colorMode = mode; - // Set color maxes. - var maxes = this._colorMaxes[mode]; - if (arguments.length === 2) { - maxes[0] = max1; // Red - maxes[1] = max1; // Green - maxes[2] = max1; // Blue - maxes[3] = max1; // Alpha - } else if (arguments.length === 4) { - maxes[0] = max1; // Red - maxes[1] = max2; // Green - maxes[2] = max3; // Blue - } else if (arguments.length === 5) { - maxes[0] = max1; // Red - maxes[1] = max2; // Green - maxes[2] = max3; // Blue - maxes[3] = maxA; // Alpha - } - } - return this; - }; - /** - * Sets the color used to fill shapes. Calling `fill(255, 165, 0)` or - * `fill('orange')` means all shapes drawn after the fill command will be - * filled with the color orange. - * - * The version of `fill()` with one parameter interprets the value one of - * three ways. If the parameter is a number, it's interpreted as a grayscale - * value. If the parameter is a string, it's interpreted as a CSS color - * string. A p5.Color object can also be provided to - * set the fill color. - * - * The version of `fill()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current - * colorMode(). The default color space is RGB, - * with each value in the range from 0 to 255. - * - * @method fill - * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. - * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. - * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. - * @param {Number} [alpha] - * @chainable - * @example - *
                                  - * - * // Grayscale integer value. - * fill(51); - * square(20, 20, 60); - * describe('A dark charcoal gray square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // R, G & B integer values. - * fill(255, 204, 0); - * square(20, 20, 60); - * describe('A yellow square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // H, S & B integer values. - * colorMode(HSB); - * fill(255, 204, 100); - * square(20, 20, 60); - * describe('A royal blue square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // A CSS named color. - * fill('red'); - * square(20, 20, 60); - * describe('A red square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Three-digit hex RGB notation. - * fill('#fae'); - * square(20, 20, 60); - * describe('A pink square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Six-digit hex RGB notation. - * fill('#A251FA'); - * square(20, 20, 60); - * describe('A purple square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Integer RGB notation. - * fill('rgb(0,255,0)'); - * square(20, 20, 60); - * describe('A bright green square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Integer RGBA notation. - * fill('rgba(0,255,0, 0.25)'); - * square(20, 20, 60); - * describe('A soft green rectange with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Percentage RGB notation. - * fill('rgb(100%,0%,10%)'); - * square(20, 20, 60); - * describe('A red square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Percentage RGBA notation. - * fill('rgba(100%,0%,100%,0.5)'); - * square(20, 20, 60); - * describe('A dark fuchsia square with a black outline.'); - * - *
                                  - * - *
                                  - * - * // p5.Color object. - * let c = color(0, 0, 255); - * fill(c); - * square(20, 20, 60); - * describe('A blue square with a black outline.'); - * - *
                                  - */ - /** - * @method fill - * @param {String} value a color string. - * @chainable - */ - /** - * @method fill - * @param {Number} gray a grayscale value. - * @param {Number} [alpha] - * @chainable - */ - /** - * @method fill - * @param {Number[]} values an array containing the red, green, blue & - * and alpha components of the color. - * @chainable - */ - /** - * @method fill - * @param {p5.Color} color the fill color. - * @chainable - */ - _main.default.prototype.fill = function () { - var _this$_renderer2; - this._renderer._setProperty("_fillSet", true); - this._renderer._setProperty("_doFill", true); - (_this$_renderer2 = this._renderer).fill.apply( - _this$_renderer2, - arguments, - ); - return this; - }; - /** - * Disables setting the interior color of shapes. This is the same as making - * the fill completely transparent. If both - * noStroke() and - * noFill() are called, nothing will be drawn to the - * screen. - * - * @method noFill - * @chainable - * @example - *
                                  - * - * square(32, 10, 35); - * noFill(); - * square(32, 55, 35); - * describe('A white square on top of an empty square. Both squares have black outlines.'); - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(0); - * noFill(); - * stroke(100, 100, 240); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(45, 45, 45); - * describe('A purple cube wireframe spinning on a black canvas.'); - * } - * - *
                                  - */ - _main.default.prototype.noFill = function () { - this._renderer._setProperty("_doFill", false); - return this; - }; - /** - * Disables drawing the stroke (outline). If both - * noStroke() and - * noFill() are called, nothing will be drawn to the - * screen. - * - * @method noStroke - * @chainable - * @example - *
                                  - * - * noStroke(); - * square(20, 20, 60); - * describe('A white square with no outline.'); - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(0); - * noStroke(); - * fill(240, 150, 150); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(45, 45, 45); - * describe('A pink cube with no edge outlines spinning on a black canvas.'); - * } - * - *
                                  - */ - _main.default.prototype.noStroke = function () { - this._renderer._setProperty("_doStroke", false); - return this; - }; - /** - * Sets the color used to draw lines and borders around shapes. Calling - * `stroke(255, 165, 0)` or `stroke('orange')` means all shapes drawn after - * the `stroke()` command will be filled with the color orange. The way these - * parameters are interpreted may be changed with the - * colorMode() function. - * - * The version of `stroke()` with one parameter interprets the value one of - * three ways. If the parameter is a number, it's interpreted as a grayscale - * value. If the parameter is a string, it's interpreted as a CSS color - * string. A p5.Color object can also be provided to - * set the stroke color. - * - * The version of `stroke()` with two parameters interprets the first one as a - * grayscale value. The second parameter sets the alpha (transparency) value. - * - * The version of `stroke()` with three parameters interprets them as RGB, HSB, - * or HSL colors, depending on the current `colorMode()`. - * - * The version of `stroke()` with four parameters interprets them as RGBA, HSBA, - * or HSLA colors, depending on the current `colorMode()`. The last parameter - * sets the alpha (transparency) value. - * - * @method stroke - * @param {Number} v1 red value if color mode is RGB or hue value if color mode is HSB. - * @param {Number} v2 green value if color mode is RGB or saturation value if color mode is HSB. - * @param {Number} v3 blue value if color mode is RGB or brightness value if color mode is HSB. - * @param {Number} [alpha] - * @chainable - * - * @example - *
                                  - * - * // Grayscale integer value. - * strokeWeight(4); - * stroke(51); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a dark charcoal gray outline.'); - * - *
                                  - * - *
                                  - * - * // R, G & B integer values. - * stroke(255, 204, 0); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a yellow outline.'); - * - *
                                  - * - *
                                  - * - * // H, S & B integer values. - * colorMode(HSB); - * strokeWeight(4); - * stroke(255, 204, 100); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a royal blue outline.'); - * - *
                                  - * - *
                                  - * - * // A CSS named color. - * stroke('red'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a red outline.'); - * - *
                                  - * - *
                                  - * - * // Three-digit hex RGB notation. - * stroke('#fae'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a pink outline.'); - * - *
                                  - * - *
                                  - * - * // Six-digit hex RGB notation. - * stroke('#222222'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a black outline.'); - * - *
                                  - * - *
                                  - * - * // Integer RGB notation. - * stroke('rgb(0,255,0)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A whiite rectangle with a bright green outline.'); - * - *
                                  - * - *
                                  - * - * // Integer RGBA notation. - * stroke('rgba(0,255,0,0.25)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a soft green outline.'); - * - *
                                  - * - *
                                  - * - * // Percentage RGB notation. - * stroke('rgb(100%,0%,10%)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a red outline.'); - * - *
                                  - * - *
                                  - * - * // Percentage RGBA notation. - * stroke('rgba(100%,0%,100%,0.5)'); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a dark fuchsia outline.'); - * - *
                                  - * - *
                                  - * - * // p5.Color object. - * stroke(color(0, 0, 255)); - * strokeWeight(4); - * rect(20, 20, 60, 60); - * describe('A white rectangle with a blue outline.'); - * - *
                                  - */ - /** - * @method stroke - * @param {String} value a color string. - * @chainable - */ - /** - * @method stroke - * @param {Number} gray a grayscale value. - * @param {Number} [alpha] - * @chainable - */ - /** - * @method stroke - * @param {Number[]} values an array containing the red, green, blue, - * and alpha components of the color. - * @chainable - */ - /** - * @method stroke - * @param {p5.Color} color the stroke color. - * @chainable - */ - _main.default.prototype.stroke = function () { - var _this$_renderer3; - this._renderer._setProperty("_strokeSet", true); - this._renderer._setProperty("_doStroke", true); - (_this$_renderer3 = this._renderer).stroke.apply( - _this$_renderer3, - arguments, - ); - return this; - }; - /** - * All drawing that follows erase() will subtract - * from the canvas, revealing the web page underneath. The erased areas will - * become transparent, allowing the content behind the canvas to show through. - * The fill(), stroke(), and - * blendMode() have no effect once `erase()` is - * called. - * - * The `erase()` function has two optional parameters. The first parameter - * sets the strength of erasing by the shape's interior. A value of 0 means - * that no erasing will occur. A value of 255 means that the shape's interior - * will fully erase the content underneath. The default value is 255 - * (full strength). - * - * The second parameter sets the strength of erasing by the shape's edge. A - * value of 0 means that no erasing will occur. A value of 255 means that the - * shape's edge will fully erase the content underneath. The default value is - * 255 (full strength). - * - * To cancel the erasing effect, use the noErase() - * function. - * - * `erase()` has no effect on drawing done with the - * image() and - * background() functions. - * - * @method erase - * @param {Number} [strengthFill] a number (0-255) for the strength of erasing under a shape's interior. - * Defaults to 255, which is full strength. - * @param {Number} [strengthStroke] a number (0-255) for the strength of erasing under a shape's edge. - * Defaults to 255, which is full strength. - * - * @chainable - * @example - *
                                  - * - * background(100, 100, 250); - * fill(250, 100, 100); - * square(20, 20, 60); - * erase(); - * circle(25, 30, 30); - * noErase(); - * describe('A purple canvas with a pink square in the middle. A circle is erased from the top-left, leaving a white hole.'); - * - *
                                  - * - *
                                  - * - * let p = createP('I am a DOM element'); - * p.style('font-size', '12px'); - * p.style('width', '65px'); - * p.style('text-align', 'center'); - * p.position(18, 26); - * - * background(100, 170, 210); - * erase(200, 100); - * circle(50, 50, 77); - * noErase(); - * describe('A blue canvas with a circular hole in the center that reveals the message "I am a DOM element".'); - * - *
                                  - * - *
                                  - * - * background(150, 250, 150); - * fill(100, 100, 250); - * square(20, 20, 60); - * strokeWeight(5); - * erase(150, 255); - * triangle(50, 10, 70, 50, 90, 10); - * noErase(); - * describe('A mint green canvas with a purple square in the center. A triangle in the top-right corner partially erases its interior and a fully erases its outline.'); - * - *
                                  - */ - _main.default.prototype.erase = function () { - var opacityFill = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : 255; - var opacityStroke = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 255; - this._renderer.erase(opacityFill, opacityStroke); - return this; - }; - /** - * Ends erasing that was started with erase(). - * The fill(), stroke(), and - * blendMode() settings will return to what they - * were prior to calling erase(). - * - * @method noErase - * @chainable - * @example - *
                                  - * - * background(235, 145, 15); - * noStroke(); - * fill(30, 45, 220); - * rect(30, 10, 10, 80); - * erase(); - * circle(50, 50, 60); - * noErase(); - * rect(70, 10, 10, 80); - * describe('An orange canvas with two tall blue rectangles. A circular hole in the center erases the rectangle on the left but not the one on the right.'); - * - *
                                  - */ - _main.default.prototype.noErase = function () { - this._renderer.noErase(); - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.Color": 284, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 286: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.QUADRATIC = - exports.LINEAR = - exports._CTX_MIDDLE = - exports._DEFAULT_LEADMULT = - exports._DEFAULT_TEXT_FILL = - exports.WORD = - exports.CHAR = - exports.BOLDITALIC = - exports.BOLD = - exports.ITALIC = - exports.NORMAL = - exports.BLUR = - exports.ERODE = - exports.DILATE = - exports.POSTERIZE = - exports.INVERT = - exports.OPAQUE = - exports.GRAY = - exports.THRESHOLD = - exports.BURN = - exports.DODGE = - exports.SOFT_LIGHT = - exports.HARD_LIGHT = - exports.OVERLAY = - exports.REPLACE = - exports.SCREEN = - exports.MULTIPLY = - exports.EXCLUSION = - exports.SUBTRACT = - exports.DIFFERENCE = - exports.LIGHTEST = - exports.DARKEST = - exports.ADD = - exports.REMOVE = - exports.BLEND = - exports.UP_ARROW = - exports.TAB = - exports.SHIFT = - exports.RIGHT_ARROW = - exports.RETURN = - exports.OPTION = - exports.LEFT_ARROW = - exports.ESCAPE = - exports.ENTER = - exports.DOWN_ARROW = - exports.DELETE = - exports.CONTROL = - exports.BACKSPACE = - exports.ALT = - exports.AUTO = - exports.HSL = - exports.HSB = - exports.RGB = - exports.MITER = - exports.BEVEL = - exports.ROUND = - exports.SQUARE = - exports.PROJECT = - exports.PIE = - exports.CHORD = - exports.OPEN = - exports.CLOSE = - exports.TESS = - exports.QUAD_STRIP = - exports.QUADS = - exports.TRIANGLE_STRIP = - exports.TRIANGLE_FAN = - exports.TRIANGLES = - exports.LINE_LOOP = - exports.LINE_STRIP = - exports.LINES = - exports.POINTS = - exports.BASELINE = - exports.BOTTOM = - exports.TOP = - exports.CENTER = - exports.LEFT = - exports.RIGHT = - exports.RADIUS = - exports.CORNERS = - exports.CORNER = - exports.RAD_TO_DEG = - exports.DEG_TO_RAD = - exports.RADIANS = - exports.DEGREES = - exports.TWO_PI = - exports.TAU = - exports.QUARTER_PI = - exports.PI = - exports.HALF_PI = - exports.WAIT = - exports.TEXT = - exports.MOVE = - exports.HAND = - exports.CROSS = - exports.ARROW = - exports.WEBGL2 = - exports.WEBGL = - exports.P2D = - exports.VERSION = - void 0; - exports.RGBA = - exports.HALF_FLOAT = - exports.FLOAT = - exports.UNSIGNED_INT = - exports.UNSIGNED_BYTE = - exports.COVER = - exports.CONTAIN = - exports.FALLBACK = - exports.LABEL = - exports.AXES = - exports.GRID = - exports._DEFAULT_FILL = - exports._DEFAULT_STROKE = - exports.PORTRAIT = - exports.LANDSCAPE = - exports.SMOOTH = - exports.FLAT = - exports.MIRROR = - exports.CLAMP = - exports.REPEAT = - exports.NEAREST = - exports.IMAGE = - exports.IMMEDIATE = - exports.TEXTURE = - exports.FILL = - exports.STROKE = - exports.CURVE = - exports.BEZIER = - void 0; - /** - * @module Constants - * @submodule Constants - * @for p5 - */ - var _PI = Math.PI; - /** - * Version of this p5.js. - * @property {String} VERSION - * @final - */ - var VERSION = "1.9.0"; - // GRAPHICS RENDERER - /** - * The default, two-dimensional renderer. - * @property {String} P2D - * @final - */ - exports.VERSION = VERSION; - var P2D = "p2d"; - /** - * One of the two render modes in p5.js, used for computationally intensive tasks like 3D rendering and shaders. - * - * `WEBGL` differs from the default `P2D` renderer in the following ways: - * - * - **Coordinate System** - When drawing in `WEBGL` mode, the origin point (0,0,0) is located at the center of the screen, not the top-left corner. See the learn page about coordinates and transformations. - * - **3D Shapes** - `WEBGL` mode can be used to draw 3-dimensional shapes like box(), sphere(), cone(), and more. See the learn page about custom geometry to make more complex objects. - * - **Shape Detail** - When drawing in `WEBGL` mode, you can specify how smooth curves should be drawn by using a `detail` parameter. See the wiki section about shapes for a more information and an example. - * - **Textures** - A texture is like a skin that wraps onto a shape. See the wiki section about textures for examples of mapping images onto surfaces with textures. - * - **Materials and Lighting** - `WEBGL` offers different types of lights like ambientLight() to place around a scene. Materials like specularMaterial() reflect the lighting to convey shape and depth. See the learn page for styling and appearance to experiment with different combinations. - * - **Camera** - The viewport of a `WEBGL` sketch can be adjusted by changing camera attributes. See the learn page section about cameras for an explanation of camera controls. - * - **Text** - `WEBGL` requires opentype/truetype font files to be preloaded using loadFont(). See the wiki section about text for details, along with a workaround. - * - **Shaders** - Shaders are hardware accelerated programs that can be used for a variety of effects and graphics. See the introduction to shaders to get started with shaders in p5.js. - * - **Graphics Acceleration** - `WEBGL` mode uses the graphics card instead of the CPU, so it may help boost the performance of your sketch (example: drawing more shapes on the screen at once). - * - * To learn more about WEBGL mode, check out all the interactive WEBGL tutorials in the "Learn" section of this website, or read the wiki article "Getting started with WebGL in p5". - * - * @property {String} WEBGL - * @final - */ - exports.P2D = P2D; - var WEBGL = "webgl"; - /** - * One of the two possible values of a WebGL canvas (either WEBGL or WEBGL2), - * which can be used to determine what capabilities the rendering environment - * has. - * @property {String} WEBGL2 - * @final - */ - exports.WEBGL = WEBGL; - var WEBGL2 = "webgl2"; - // ENVIRONMENT - /** - * @property {String} ARROW - * @final - */ - exports.WEBGL2 = WEBGL2; - var ARROW = "default"; - /** - * @property {String} CROSS - * @final - */ - exports.ARROW = ARROW; - var CROSS = "crosshair"; - /** - * @property {String} HAND - * @final - */ - exports.CROSS = CROSS; - var HAND = "pointer"; - /** - * @property {String} MOVE - * @final - */ - exports.HAND = HAND; - var MOVE = "move"; - /** - * @property {String} TEXT - * @final - */ - exports.MOVE = MOVE; - var TEXT = "text"; - /** - * @property {String} WAIT - * @final - */ - exports.TEXT = TEXT; - var WAIT = "wait"; - // TRIGONOMETRY - /** - * HALF_PI is a mathematical constant with the value - * 1.57079632679489661923. It is half the ratio of the - * circumference of a circle to its diameter. It is useful in - * combination with the trigonometric functions sin() and cos(). - * - * @property {Number} HALF_PI - * @final - * - * @example - *
                                  - * arc(50, 50, 80, 80, 0, HALF_PI); - *
                                  - * - * @alt - * 80×80 white quarter-circle with curve toward bottom right of canvas. - */ - exports.WAIT = WAIT; - var HALF_PI = _PI / 2; - /** - * PI is a mathematical constant with the value - * 3.14159265358979323846. It is the ratio of the circumference - * of a circle to its diameter. It is useful in combination with - * the trigonometric functions sin() and cos(). - * - * @property {Number} PI - * @final - * - * @example - *
                                  - * arc(50, 50, 80, 80, 0, PI); - *
                                  - * - * @alt - * white half-circle with curve toward bottom of canvas. - */ - exports.HALF_PI = HALF_PI; - var PI = _PI; - /** - * QUARTER_PI is a mathematical constant with the value 0.7853982. - * It is one quarter the ratio of the circumference of a circle to - * its diameter. It is useful in combination with the trigonometric - * functions sin() and cos(). - * - * @property {Number} QUARTER_PI - * @final - * - * @example - *
                                  - * arc(50, 50, 80, 80, 0, QUARTER_PI); - *
                                  - * - * @alt - * white eighth-circle rotated about 40 degrees with curve bottom right canvas. - */ - exports.PI = PI; - var QUARTER_PI = _PI / 4; - /** - * TAU is an alias for TWO_PI, a mathematical constant with the - * value 6.28318530717958647693. It is twice the ratio of the - * circumference of a circle to its diameter. It is useful in - * combination with the trigonometric functions sin() and cos(). - * - * @property {Number} TAU - * @final - * - * @example - *
                                  - * arc(50, 50, 80, 80, 0, TAU); - *
                                  - * - * @alt - * 80×80 white ellipse shape in center of canvas. - */ - exports.QUARTER_PI = QUARTER_PI; - var TAU = _PI * 2; - /** - * TWO_PI is a mathematical constant with the value - * 6.28318530717958647693. It is twice the ratio of the - * circumference of a circle to its diameter. It is useful in - * combination with the trigonometric functions sin() and cos(). - * - * @property {Number} TWO_PI - * @final - * - * @example - *
                                  - * arc(50, 50, 80, 80, 0, TWO_PI); - *
                                  - * - * @alt - * 80×80 white ellipse shape in center of canvas. - */ - exports.TAU = TAU; - var TWO_PI = _PI * 2; - /** - * Constant to be used with the angleMode() function, to set the mode in - * which p5.js interprets and calculates angles (either DEGREES or RADIANS). - * @property {String} DEGREES - * @final - * - * @example - *
                                  - * function setup() { - * angleMode(DEGREES); - * } - *
                                  - */ - exports.TWO_PI = TWO_PI; - var DEGREES = "degrees"; - /** - * Constant to be used with the angleMode() function, to set the mode - * in which p5.js interprets and calculates angles (either RADIANS or DEGREES). - * @property {String} RADIANS - * @final - * - * @example - *
                                  - * function setup() { - * angleMode(RADIANS); - * } - *
                                  - */ - exports.DEGREES = DEGREES; - var RADIANS = "radians"; - exports.RADIANS = RADIANS; - var DEG_TO_RAD = _PI / 180; - exports.DEG_TO_RAD = DEG_TO_RAD; - var RAD_TO_DEG = 180 / _PI; - // SHAPE - /** - * @property {String} CORNER - * @final - */ - exports.RAD_TO_DEG = RAD_TO_DEG; - var CORNER = "corner"; - /** - * @property {String} CORNERS - * @final - */ - exports.CORNER = CORNER; - var CORNERS = "corners"; - /** - * @property {String} RADIUS - * @final - */ - exports.CORNERS = CORNERS; - var RADIUS = "radius"; - /** - * @property {String} RIGHT - * @final - */ - exports.RADIUS = RADIUS; - var RIGHT = "right"; - /** - * @property {String} LEFT - * @final - */ - exports.RIGHT = RIGHT; - var LEFT = "left"; - /** - * @property {String} CENTER - * @final - */ - exports.LEFT = LEFT; - var CENTER = "center"; - /** - * @property {String} TOP - * @final - */ - exports.CENTER = CENTER; - var TOP = "top"; - /** - * @property {String} BOTTOM - * @final - */ - exports.TOP = TOP; - var BOTTOM = "bottom"; - /** - * @property {String} BASELINE - * @final - * @default alphabetic - */ - exports.BOTTOM = BOTTOM; - var BASELINE = "alphabetic"; - /** - * @property {Number} POINTS - * @final - * @default 0x0000 - */ - exports.BASELINE = BASELINE; - var POINTS = 0; - /** - * @property {Number} LINES - * @final - * @default 0x0001 - */ - exports.POINTS = POINTS; - var LINES = 1; - /** - * @property {Number} LINE_STRIP - * @final - * @default 0x0003 - */ - exports.LINES = LINES; - var LINE_STRIP = 3; - /** - * @property {Number} LINE_LOOP - * @final - * @default 0x0002 - */ - exports.LINE_STRIP = LINE_STRIP; - var LINE_LOOP = 2; - /** - * @property {Number} TRIANGLES - * @final - * @default 0x0004 - */ - exports.LINE_LOOP = LINE_LOOP; - var TRIANGLES = 4; - /** - * @property {Number} TRIANGLE_FAN - * @final - * @default 0x0006 - */ - exports.TRIANGLES = TRIANGLES; - var TRIANGLE_FAN = 6; - /** - * @property {Number} TRIANGLE_STRIP - * @final - * @default 0x0005 - */ - exports.TRIANGLE_FAN = TRIANGLE_FAN; - var TRIANGLE_STRIP = 5; - /** - * @property {String} QUADS - * @final - */ - exports.TRIANGLE_STRIP = TRIANGLE_STRIP; - var QUADS = "quads"; - /** - * @property {String} QUAD_STRIP - * @final - * @default quad_strip - */ - exports.QUADS = QUADS; - var QUAD_STRIP = "quad_strip"; - /** - * @property {String} TESS - * @final - * @default tess - */ - exports.QUAD_STRIP = QUAD_STRIP; - var TESS = "tess"; - /** - * @property {String} CLOSE - * @final - */ - exports.TESS = TESS; - var CLOSE = "close"; - /** - * @property {String} OPEN - * @final - */ - exports.CLOSE = CLOSE; - var OPEN = "open"; - /** - * @property {String} CHORD - * @final - */ - exports.OPEN = OPEN; - var CHORD = "chord"; - /** - * @property {String} PIE - * @final - */ - exports.CHORD = CHORD; - var PIE = "pie"; - /** - * @property {String} PROJECT - * @final - * @default square - */ - exports.PIE = PIE; - var PROJECT = "square"; // PEND: careful this is counterintuitive - /** - * @property {String} SQUARE - * @final - * @default butt - */ - exports.PROJECT = PROJECT; - var SQUARE = "butt"; - /** - * @property {String} ROUND - * @final - */ - exports.SQUARE = SQUARE; - var ROUND = "round"; - /** - * @property {String} BEVEL - * @final - */ - exports.ROUND = ROUND; - var BEVEL = "bevel"; - /** - * @property {String} MITER - * @final - */ - exports.BEVEL = BEVEL; - var MITER = "miter"; - // COLOR - /** - * @property {String} RGB - * @final - */ - exports.MITER = MITER; - var RGB = "rgb"; - /** - * HSB (hue, saturation, brightness) is a type of color model. - * You can learn more about it at - * HSB. - * - * @property {String} HSB - * @final - */ - exports.RGB = RGB; - var HSB = "hsb"; - /** - * @property {String} HSL - * @final - */ - exports.HSB = HSB; - var HSL = "hsl"; - // DOM EXTENSION - /** - * AUTO allows us to automatically set the width or height of an element (but not both), - * based on the current height and width of the element. Only one parameter can - * be passed to the size function as AUTO, at a time. - * - * @property {String} AUTO - * @final - */ - exports.HSL = HSL; - var AUTO = "auto"; - /** - * @property {Number} ALT - * @final - */ - // INPUT - exports.AUTO = AUTO; - var ALT = 18; - /** - * @property {Number} BACKSPACE - * @final - */ - exports.ALT = ALT; - var BACKSPACE = 8; - /** - * @property {Number} CONTROL - * @final - */ - exports.BACKSPACE = BACKSPACE; - var CONTROL = 17; - /** - * @property {Number} DELETE - * @final - */ - exports.CONTROL = CONTROL; - var DELETE = 46; - /** - * @property {Number} DOWN_ARROW - * @final - */ - exports.DELETE = DELETE; - var DOWN_ARROW = 40; - /** - * @property {Number} ENTER - * @final - */ - exports.DOWN_ARROW = DOWN_ARROW; - var ENTER = 13; - /** - * @property {Number} ESCAPE - * @final - */ - exports.ENTER = ENTER; - var ESCAPE = 27; - /** - * @property {Number} LEFT_ARROW - * @final - */ - exports.ESCAPE = ESCAPE; - var LEFT_ARROW = 37; - /** - * @property {Number} OPTION - * @final - */ - exports.LEFT_ARROW = LEFT_ARROW; - var OPTION = 18; - /** - * @property {Number} RETURN - * @final - */ - exports.OPTION = OPTION; - var RETURN = 13; - /** - * @property {Number} RIGHT_ARROW - * @final - */ - exports.RETURN = RETURN; - var RIGHT_ARROW = 39; - /** - * @property {Number} SHIFT - * @final - */ - exports.RIGHT_ARROW = RIGHT_ARROW; - var SHIFT = 16; - /** - * @property {Number} TAB - * @final - */ - exports.SHIFT = SHIFT; - var TAB = 9; - /** - * @property {Number} UP_ARROW - * @final - */ - exports.TAB = TAB; - var UP_ARROW = 38; - // RENDERING - /** - * @property {String} BLEND - * @final - * @default source-over - */ - exports.UP_ARROW = UP_ARROW; - var BLEND = "source-over"; - /** - * @property {String} REMOVE - * @final - * @default destination-out - */ - exports.BLEND = BLEND; - var REMOVE = "destination-out"; - /** - * @property {String} ADD - * @final - * @default lighter - */ - exports.REMOVE = REMOVE; - var ADD = "lighter"; - //ADD: 'add', // - //SUBTRACT: 'subtract', // - /** - * @property {String} DARKEST - * @final - */ - exports.ADD = ADD; - var DARKEST = "darken"; - /** - * @property {String} LIGHTEST - * @final - * @default lighten - */ - exports.DARKEST = DARKEST; - var LIGHTEST = "lighten"; - /** - * @property {String} DIFFERENCE - * @final - */ - exports.LIGHTEST = LIGHTEST; - var DIFFERENCE = "difference"; - /** - * @property {String} SUBTRACT - * @final - */ - exports.DIFFERENCE = DIFFERENCE; - var SUBTRACT = "subtract"; - /** - * @property {String} EXCLUSION - * @final - */ - exports.SUBTRACT = SUBTRACT; - var EXCLUSION = "exclusion"; - /** - * @property {String} MULTIPLY - * @final - */ - exports.EXCLUSION = EXCLUSION; - var MULTIPLY = "multiply"; - /** - * @property {String} SCREEN - * @final - */ - exports.MULTIPLY = MULTIPLY; - var SCREEN = "screen"; - /** - * @property {String} REPLACE - * @final - * @default copy - */ - exports.SCREEN = SCREEN; - var REPLACE = "copy"; - /** - * @property {String} OVERLAY - * @final - */ - exports.REPLACE = REPLACE; - var OVERLAY = "overlay"; - /** - * @property {String} HARD_LIGHT - * @final - */ - exports.OVERLAY = OVERLAY; - var HARD_LIGHT = "hard-light"; - /** - * @property {String} SOFT_LIGHT - * @final - */ - exports.HARD_LIGHT = HARD_LIGHT; - var SOFT_LIGHT = "soft-light"; - /** - * @property {String} DODGE - * @final - * @default color-dodge - */ - exports.SOFT_LIGHT = SOFT_LIGHT; - var DODGE = "color-dodge"; - /** - * @property {String} BURN - * @final - * @default color-burn - */ - exports.DODGE = DODGE; - var BURN = "color-burn"; - // FILTERS - /** - * @property {String} THRESHOLD - * @final - */ - exports.BURN = BURN; - var THRESHOLD = "threshold"; - /** - * @property {String} GRAY - * @final - */ - exports.THRESHOLD = THRESHOLD; - var GRAY = "gray"; - /** - * @property {String} OPAQUE - * @final - */ - exports.GRAY = GRAY; - var OPAQUE = "opaque"; - /** - * @property {String} INVERT - * @final - */ - exports.OPAQUE = OPAQUE; - var INVERT = "invert"; - /** - * @property {String} POSTERIZE - * @final - */ - exports.INVERT = INVERT; - var POSTERIZE = "posterize"; - /** - * @property {String} DILATE - * @final - */ - exports.POSTERIZE = POSTERIZE; - var DILATE = "dilate"; - /** - * @property {String} ERODE - * @final - */ - exports.DILATE = DILATE; - var ERODE = "erode"; - /** - * @property {String} BLUR - * @final - */ - exports.ERODE = ERODE; - var BLUR = "blur"; - // TYPOGRAPHY - /** - * @property {String} NORMAL - * @final - */ - exports.BLUR = BLUR; - var NORMAL = "normal"; - /** - * @property {String} ITALIC - * @final - */ - exports.NORMAL = NORMAL; - var ITALIC = "italic"; - /** - * @property {String} BOLD - * @final - */ - exports.ITALIC = ITALIC; - var BOLD = "bold"; - /** - * @property {String} BOLDITALIC - * @final - */ - exports.BOLD = BOLD; - var BOLDITALIC = "bold italic"; - /** - * @property {String} CHAR - * @final - */ - exports.BOLDITALIC = BOLDITALIC; - var CHAR = "CHAR"; - /** - * @property {String} WORD - * @final - */ - exports.CHAR = CHAR; - var WORD = "WORD"; - // TYPOGRAPHY-INTERNAL - exports.WORD = WORD; - var _DEFAULT_TEXT_FILL = "#000000"; - exports._DEFAULT_TEXT_FILL = _DEFAULT_TEXT_FILL; - var _DEFAULT_LEADMULT = 1.25; - exports._DEFAULT_LEADMULT = _DEFAULT_LEADMULT; - var _CTX_MIDDLE = "middle"; - // VERTICES - /** - * @property {String} LINEAR - * @final - */ - exports._CTX_MIDDLE = _CTX_MIDDLE; - var LINEAR = "linear"; - /** - * @property {String} QUADRATIC - * @final - */ - exports.LINEAR = LINEAR; - var QUADRATIC = "quadratic"; - /** - * @property {String} BEZIER - * @final - */ - exports.QUADRATIC = QUADRATIC; - var BEZIER = "bezier"; - /** - * @property {String} CURVE - * @final - */ - exports.BEZIER = BEZIER; - var CURVE = "curve"; - // WEBGL DRAWMODES - /** - * @property {String} STROKE - * @final - */ - exports.CURVE = CURVE; - var STROKE = "stroke"; - /** - * @property {String} FILL - * @final - */ - exports.STROKE = STROKE; - var FILL = "fill"; - /** - * @property {String} TEXTURE - * @final - */ - exports.FILL = FILL; - var TEXTURE = "texture"; - /** - * @property {String} IMMEDIATE - * @final - */ - exports.TEXTURE = TEXTURE; - var IMMEDIATE = "immediate"; - // WEBGL TEXTURE MODE - // NORMAL already exists for typography - /** - * @property {String} IMAGE - * @final - */ - exports.IMMEDIATE = IMMEDIATE; - var IMAGE = "image"; - // WEBGL TEXTURE WRAP AND FILTERING - // LINEAR already exists above - /** - * @property {String} NEAREST - * @final - */ - exports.IMAGE = IMAGE; - var NEAREST = "nearest"; - /** - * @property {String} REPEAT - * @final - */ - exports.NEAREST = NEAREST; - var REPEAT = "repeat"; - /** - * @property {String} CLAMP - * @final - */ - exports.REPEAT = REPEAT; - var CLAMP = "clamp"; - /** - * @property {String} MIRROR - * @final - */ - exports.CLAMP = CLAMP; - var MIRROR = "mirror"; - // WEBGL GEOMETRY SHADING - /** - * @property {String} FLAT - * @final - */ - exports.MIRROR = MIRROR; - var FLAT = "flat"; - /** - * @property {String} SMOOTH - * @final - */ - exports.FLAT = FLAT; - var SMOOTH = "smooth"; - // DEVICE-ORIENTATION - /** - * @property {String} LANDSCAPE - * @final - */ - exports.SMOOTH = SMOOTH; - var LANDSCAPE = "landscape"; - /** - * @property {String} PORTRAIT - * @final - */ - exports.LANDSCAPE = LANDSCAPE; - var PORTRAIT = "portrait"; - // DEFAULTS - exports.PORTRAIT = PORTRAIT; - var _DEFAULT_STROKE = "#000000"; - exports._DEFAULT_STROKE = _DEFAULT_STROKE; - var _DEFAULT_FILL = "#FFFFFF"; - /** - * @property {String} GRID - * @final - */ - exports._DEFAULT_FILL = _DEFAULT_FILL; - var GRID = "grid"; - /** - * @property {String} AXES - * @final - */ - exports.GRID = GRID; - var AXES = "axes"; - /** - * @property {String} LABEL - * @final - */ - exports.AXES = AXES; - var LABEL = "label"; - /** - * @property {String} FALLBACK - * @final - */ - exports.LABEL = LABEL; - var FALLBACK = "fallback"; - /** - * @property {String} CONTAIN - * @final - */ - exports.FALLBACK = FALLBACK; - var CONTAIN = "contain"; - /** - * @property {String} COVER - * @final - */ - exports.CONTAIN = CONTAIN; - var COVER = "cover"; - /** - * @property {String} UNSIGNED_BYTE - * @final - */ - exports.COVER = COVER; - var UNSIGNED_BYTE = "unsigned-byte"; - /** - * @property {String} UNSIGNED_INT - * @final - */ - exports.UNSIGNED_BYTE = UNSIGNED_BYTE; - var UNSIGNED_INT = "unsigned-int"; - /** - * @property {String} FLOAT - * @final - */ - exports.UNSIGNED_INT = UNSIGNED_INT; - var FLOAT = "float"; - /** - * @property {String} HALF_FLOAT - * @final - */ - exports.FLOAT = FLOAT; - var HALF_FLOAT = "half-float"; - /** - * @property {String} RGBA - * @final - */ - exports.HALF_FLOAT = HALF_FLOAT; - var RGBA = "rgba"; - exports.RGBA = RGBA; - }, - {}, - ], - 287: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.search"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.search"); - _dereq_("core-js/modules/es.string.split"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - var C = _interopRequireWildcard(_dereq_("./constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Environment - * @submodule Environment - * @for p5 - * @requires core - * @requires constants - */ - - var standardCursors = [ - C.ARROW, - C.CROSS, - C.HAND, - C.MOVE, - C.TEXT, - C.WAIT, - ]; - _main.default.prototype._frameRate = 0; - _main.default.prototype._lastFrameTime = window.performance.now(); - _main.default.prototype._targetFrameRate = 60; - var _windowPrint = window.print; - var windowPrintDisabled = false; - /** - * Displays text in the web browser's console. - * - * `print()` is helpful for printing values while debugging. Each call to - * `print()` creates a new line of text. - * - * Note: Call `print('\n')` to print a blank line. Calling `print()` without - * an argument opens the browser's dialog for printing documents. - * - * @method print - * @param {Any} contents content to print to the console. - * @example - *
                                  - * - * function setup() { - * // Prints "hello, world" to the console. - * print('hello, world'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * let name = 'ada'; - * // Prints "hello, ada" to the console. - * print(`hello, ${name}`); - * } - * - *
                                  - */ - _main.default.prototype.print = function () { - if (!arguments.length) { - if (!windowPrintDisabled) { - _windowPrint(); - if ( - window.confirm( - "You just tried to print the webpage. Do you want to prevent this from running again?", - ) - ) { - windowPrintDisabled = true; - } - } - } else { - var _console; - (_console = console).log.apply(_console, arguments); - } - }; - /** - * Tracks the number of frames drawn since the sketch started. - * - * `frameCount`'s value is 0 inside setup(). It - * increments by 1 each time the code in draw() - * finishes executing. - * - * @property {Integer} frameCount - * @readOnly - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Display the value of - * // frameCount. - * textSize(30); - * textAlign(CENTER, CENTER); - * text(frameCount, 50, 50); - * - * describe('The number 0 written in black in the middle of a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Set the frameRate to 30. - * frameRate(30); - * - * textSize(30); - * textAlign(CENTER, CENTER); - * } - * - * function draw() { - * background(200); - * - * // Display the value of - * // frameCount. - * text(frameCount, 50, 50); - * - * describe('A number written in black in the middle of a gray square. Its value increases rapidly.'); - * } - * - *
                                  - */ - _main.default.prototype.frameCount = 0; - /** - * Tracks the amount of time, in milliseconds, it took for - * draw to draw the previous frame. `deltaTime` is - * useful for simulating physics. - * - * @property {Integer} deltaTime - * @readOnly - * @example - *
                                  - * - * let x = 0; - * let speed = 0.05; - * - * function setup() { - * // Set the frameRate to 30. - * frameRate(30); - * } - * - * function draw() { - * background(200); - * - * // Use deltaTime to calculate - * // a change in position. - * let deltaX = speed * deltaTime; - * - * // Update the x variable. - * x += deltaX; - * - * // Reset x to 0 if it's - * // greater than 100. - * if (x > 100) { - * x = 0; - * } - * - * // Use x to set the circle's - * // position. - * circle(x, 50, 20); - * - * describe('A white circle moves from left to right on a gray background. It reappears on the left side when it reaches the right side.'); - * } - * - *
                                  - */ - _main.default.prototype.deltaTime = 0; - /** - * Tracks whether the browser window is focused and can receive user input. - * `focused` is `true` if the window if focused and `false` if not. - * - * @property {Boolean} focused - * @readOnly - * @example - *
                                  - * - * // Open this example in two separate browser - * // windows placed side-by-side to demonstrate. - * - * function draw() { - * // Change the background color - * // when the browser window - * // goes in/out of focus. - * if (focused === true) { - * background(0, 255, 0); - * } else { - * background(255, 0, 0); - * } - * - * describe('A square changes color from green to red when the browser window is out of focus.'); - * } - * - *
                                  - */ - _main.default.prototype.focused = document.hasFocus(); - /** - * Changes the cursor's appearance. - * - * The first parameter, `type`, sets the type of cursor to display. The - * built-in options are `ARROW`, `CROSS`, `HAND`, `MOVE`, `TEXT`, and `WAIT`. - * `cursor()` also recognizes standard CSS cursor properties passed as - * strings: `'help'`, `'wait'`, `'crosshair'`, `'not-allowed'`, `'zoom-in'`, - * and `'grab'`. If the path to an image is passed, as in - * `cursor('assets/target.png')`, then the image will be used as the cursor. - * Images must be in .cur, .gif, .jpg, .jpeg, or .png format. - * - * The parameters `x` and `y` are optional. If an image is used for the - * cursor, `x` and `y` set the location pointed to within the image. They are - * both 0 by default, so the cursor points to the image's top-left corner. `x` - * and `y` must be less than the image's width and height, respectively. - * - * @method cursor - * @param {String|Constant} type Built-in: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT. - * Native CSS properties: 'grab', 'progress', and so on. - * Path to cursor image. - * @param {Number} [x] horizontal active spot of the cursor. - * @param {Number} [y] vertical active spot of the cursor. - * @example - *
                                  - * - * function draw() { - * background(200); - * - * // Set the cursor to crosshairs: + - * cursor(CROSS); - * - * describe('A gray square. The cursor appears as crosshairs.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * // Divide the canvas into quadrants. - * line(50, 0, 50, 100); - * line(0, 50, 100, 50); - * - * // Change cursor based on mouse position. - * if (mouseX < 50 && mouseY < 50) { - * cursor(CROSS); - * } else if (mouseX > 50 && mouseY < 50) { - * cursor('progress'); - * } else if (mouseX > 50 && mouseY > 50) { - * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); - * } else { - * cursor('grab'); - * } - * - * describe('A gray square divided into quadrants. The cursor image changes when the mouse moves to each quadrant.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * // Change the cursor's active spot - * // when the mouse is pressed. - * if (mouseIsPressed === true) { - * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16', 8, 8); - * } else { - * cursor('https://avatars0.githubusercontent.com/u/1617169?s=16'); - * } - * - * describe('An image of three purple curves follows the mouse. The image shifts when the mouse is pressed.'); - * } - * - *
                                  - */ - _main.default.prototype.cursor = function (type, x, y) { - var cursor = "auto"; - var canvas = this._curElement.elt; - if (standardCursors.includes(type)) { - // Standard css cursor - cursor = type; - } else if (typeof type === "string") { - var coords = ""; - if (x && y && typeof x === "number" && typeof y === "number") { - // Note that x and y values must be unit-less positive integers < 32 - // https://developer.mozilla.org/en-US/docs/Web/CSS/cursor - coords = "".concat(x, " ").concat(y); - } - if ( - type.substring(0, 7) === "http://" || - type.substring(0, 8) === "https://" - ) { - // Image (absolute url) - cursor = "url(".concat(type, ") ").concat(coords, ", auto"); - } else if ( - /\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(type) - ) { - // Image file (relative path) - Separated for performance reasons - cursor = "url(".concat(type, ") ").concat(coords, ", auto"); - } else { - // Any valid string for the css cursor property - cursor = type; - } - } - canvas.style.cursor = cursor; - }; - /** - * Sets the number of frames to draw per second. - * - * Calling `frameRate()` with one numeric argument, as in `frameRate(30)`, - * attempts to draw 30 frames per second (FPS). The target frame rate may not - * be achieved depending on the sketch's processing needs. Most computers - * default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are - * fast enough for smooth animations. - * - * Calling `frameRate()` without an argument returns the current frame rate. - * The value returned is an approximation. - * - * @method frameRate - * @param {Number} fps number of frames to draw per second. - * @chainable - * - * @example - *
                                  - * - * function draw() { - * background(200); - * - * // Set the x variable based - * // on the current frameCount. - * let x = frameCount % 100; - * - * // If the mouse is pressed, - * // decrease the frame rate. - * if (mouseIsPressed === true) { - * frameRate(10); - * } else { - * frameRate(60); - * } - * - * // Use x to set the circle's - * // position. - * circle(x, 50, 20); - * - * describe('A white circle on a gray background. The circle moves from left to right in a loop. It slows down when the mouse is pressed.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * // If the mouse is pressed, do lots - * // of math to slow down drawing. - * if (mouseIsPressed === true) { - * for (let i = 0; i < 1000000; i += 1) { - * random(); - * } - * } - * - * // Get the current frame rate - * // and display it. - * let fps = frameRate(); - * text(fps, 50, 50); - * - * describe('A number written in black written on a gray background. The number decreases when the mouse is pressed.'); - * } - * - *
                                  - */ - /** - * @method frameRate - * @return {Number} current frame rate. - */ - _main.default.prototype.frameRate = function (fps) { - _main.default._validateParameters("frameRate", arguments); - if (typeof fps !== "number" || fps < 0) { - return this._frameRate; - } else { - this._setProperty("_targetFrameRate", fps); - if (fps === 0) { - this._setProperty("_frameRate", fps); - } - return this; - } - }; - /** - * Returns the current framerate. - * - * @private - * @return {Number} current frameRate - */ - _main.default.prototype.getFrameRate = function () { - return this.frameRate(); - }; - /** - * Specifies the number of frames to be displayed every second. For example, - * the function call frameRate(30) will attempt to refresh 30 times a second. - * If the processor is not fast enough to maintain the specified rate, the - * frame rate will not be achieved. Setting the frame rate within setup() is - * recommended. The default rate is 60 frames per second. - * - * Calling `frameRate()` with no arguments returns the current frame rate. - * - * @private - * @param {Number} [fps] number of frames to be displayed every second - */ - _main.default.prototype.setFrameRate = function (fps) { - return this.frameRate(fps); - }; - /** - * Returns the target frame rate. The value is either the system frame rate or - * the last value passed to frameRate(). - * - * @method getTargetFrameRate - * @return {Number} _targetFrameRate - * @example - *
                                  - * - * function draw() { - * background(200); - * - * // Set the frame rate to 20. - * frameRate(20); - * - * // Get the target frame rate and - * // display it. - * let fps = getTargetFrameRate(); - * text(fps, 43, 54); - * - * describe('The number 20 written in black on a gray background.'); - * } - * - *
                                  - */ - _main.default.prototype.getTargetFrameRate = function () { - return this._targetFrameRate; - }; - /** - * Hides the cursor from view. - * - * @method noCursor - * @example - *
                                  - * - * function setup() { - * // Hide the cursor. - * noCursor(); - * } - * - * function draw() { - * background(200); - * - * circle(mouseX, mouseY, 10); - * - * describe('A white circle on a gray background. The circle follows the mouse as it moves. The cursor is hidden.'); - * } - * - *
                                  - */ - _main.default.prototype.noCursor = function () { - this._curElement.elt.style.cursor = "none"; - }; - /** - * A string variable with the WebGL version in use. Its value equals one of - * the followin string constants: - * - * - `WEBGL2` whose value is `'webgl2'`, - * - `WEBGL` whose value is `'webgl'`, or - * - `P2D` whose value is `'p2d'`. This is the default for 2D sketches. - * - * See setAttributes() for ways to set the - * WebGL version. - * - * @property {String} webglVersion - * @readOnly - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Display the current WebGL version. - * text(webglVersion, 42, 54); - * - * describe('The text "p2d" written in black on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * let font; - * - * function preload() { - * // Load a font to use. - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * // Create a canvas using WEBGL mode. - * createCanvas(100, 50, WEBGL); - * background(200); - * - * // Display the current WebGL version. - * fill(0); - * textFont(font); - * text(webglVersion, -15, 5); - * - * describe('The text "webgl2" written in black on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * let font; - * - * function preload() { - * // Load a font to use. - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * // Create a canvas using WEBGL mode. - * createCanvas(100, 50, WEBGL); - * - * // Set WebGL to version 1. - * setAttributes({ version: 1 }); - * - * background(200); - * - * // Display the current WebGL version. - * fill(0); - * textFont(font); - * text(webglVersion, -14, 5); - * - * describe('The text "webgl" written in black on a gray background.'); - * } - * - *
                                  - */ - _main.default.prototype.webglVersion = C.P2D; - /** - * A numeric variable that stores the width of the screen display. Its value - * depends on the current pixelDensity(). - * `displayWidth` is useful for running full-screen programs. - * - * Note: The actual screen width can be computed as - * `displayWidth * pixelDensity()`. - * - * @property {Number} displayWidth - * @readOnly - * @example - *
                                  - * - * function setup() { - * // Set the canvas' width and height - * // using the display's dimensions. - * createCanvas(displayWidth, displayHeight); - * - * background(200); - * - * describe('A gray canvas that is the same size as the display.'); - * } - * - *
                                  - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.displayWidth = screen.width; - /** - * A numeric variable that stores the height of the screen display. Its value - * depends on the current pixelDensity(). - * `displayHeight` is useful for running full-screen programs. - * - * Note: The actual screen height can be computed as - * `displayHeight * pixelDensity()`. - * - * @property {Number} displayHeight - * @readOnly - * @example - *
                                  - * - * function setup() { - * // Set the canvas' width and height - * // using the display's dimensions. - * createCanvas(displayWidth, displayHeight); - * - * background(200); - * - * describe('A gray canvas that is the same size as the display.'); - * } - * - *
                                  - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.displayHeight = screen.height; - /** - * A numeric variable that stores the width of the browser's - * layout viewport. - * This viewport is the area within the browser that's available for drawing. - * - * @property {Number} windowWidth - * @readOnly - * @example - *
                                  - * - * function setup() { - * // Set the canvas' width and height - * // using the browser's dimensions. - * createCanvas(windowWidth, windowHeight); - * - * background(200); - * - * describe('A gray canvas that takes up the entire browser window.'); - * } - * - *
                                  - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.windowWidth = getWindowWidth(); - /** - * A numeric variable that stores the height of the browser's - * layout viewport. - * This viewport is the area within the browser that's available for drawing. - * - * @property {Number} windowHeight - * @readOnly - * @example - *
                                  - * - * function setup() { - * // Set the canvas' width and height - * // using the browser's dimensions. - * createCanvas(windowWidth, windowHeight); - * - * background(200); - * - * describe('A gray canvas that takes up the entire browser window.'); - * } - * - *
                                  - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.windowHeight = getWindowHeight(); - /** - * The code in `windowResized()` is called once each time the browser window - * is resized. It's a good place to resize the canvas or make other - * adjustments to accommodate the new window size. - * - * The `event` parameter is optional. If added to the function definition, it - * can be used for debugging or other purposes. - * - * @method windowResized - * @param {UIEvent} [event] optional resize Event. - * @example - *
                                  - * - * function setup() { - * createCanvas(windowWidth, windowHeight); - * } - * - * function draw() { - * background(200); - * - * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); - * } - * - * // Resize the canvas when the - * // browser's size changes. - * function windowResized() { - * resizeCanvas(windowWidth, windowHeight); - * } - * - *
                                  - * @alt - * This example does not render anything. - * - *
                                  - * - * function setup() { - * createCanvas(windowWidth, windowHeight); - * } - * - * function draw() { - * background(200); - * - * describe('A gray canvas that takes up the entire browser window. It changes size to match the browser window.'); - * } - * - * function windowResized(event) { - * // Resize the canvas when the - * // browser's size changes. - * resizeCanvas(windowWidth, windowHeight); - * - * // Print the resize event to the console for debugging. - * print(event); - * } - * - *
                                  - * @alt - * This example does not render anything. - */ - _main.default.prototype._onresize = function (e) { - this._setProperty("windowWidth", getWindowWidth()); - this._setProperty("windowHeight", getWindowHeight()); - var context = this._isGlobal ? window : this; - var executeDefault; - if (typeof context.windowResized === "function") { - executeDefault = context.windowResized(e); - if (executeDefault !== undefined && !executeDefault) { - e.preventDefault(); - } - } - }; - function getWindowWidth() { - return ( - window.innerWidth || - (document.documentElement && - document.documentElement.clientWidth) || - (document.body && document.body.clientWidth) || - 0 - ); - } - function getWindowHeight() { - return ( - window.innerHeight || - (document.documentElement && - document.documentElement.clientHeight) || - (document.body && document.body.clientHeight) || - 0 - ); - } /** - * A numeric variable that stores the width of the drawing canvas. Its - * default value is 100. - * - * Calling createCanvas() or - * resizeCanvas() changes the value of - * `width`. Calling noCanvas() sets its value to - * 0. - * - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Display the canvas' width. - * text(width, 42, 54); - * - * describe('The number 100 written in black on a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(50, 100); - * - * background(200); - * - * // Display the canvas' width. - * text(width, 21, 54); - * - * describe('The number 50 written in black on a gray rectangle.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * - * background(200); - * - * // Display the canvas' width. - * text(width, 42, 54); - * - * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); - * } - * - * // If the mouse is pressed, reisze - * // the canvas and display its new - * // width. - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * resizeCanvas(50, 100); - * background(200); - * text(width, 42, 27); - * } - * } - * - *
                                  - * - * @property {Number} width - * @readOnly - */ - - _main.default.prototype.width = 0; - /** - * A numeric variable that stores the height of the drawing canvas. Its - * default value is 100. - * - * Calling createCanvas() or - * resizeCanvas() changes the value of - * `height`. Calling noCanvas() sets its value to - * 0. - * - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Display the canvas' height. - * text(height, 42, 54); - * - * describe('The number 100 written in black on a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 50); - * - * background(200); - * - * // Display the canvas' height. - * text(height, 21, 54); - * - * describe('The number 50 written in black on a gray rectangle.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * - * background(200); - * - * // Display the canvas' height. - * text(height, 42, 54); - * - * describe('The number 100 written in black on a gray square. When the mouse is pressed, the square becomes a rectangle and the number becomes 50.'); - * } - * - * // If the mouse is pressed, reisze - * // the canvas and display its new - * // height. - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * resizeCanvas(100, 50); - * background(200); - * text(height, 42, 27); - * } - * } - * - *
                                  - * - * @property {Number} height - * @readOnly - */ - _main.default.prototype.height = 0; - /** - * Toggles full-screen mode or returns the current mode. - * - * Calling `fullscreen(true)` makes the sketch full-screen. Calling - * `fullscreen(false)` makes the sketch its original size. - * - * Calling `fullscreen()` without an argument returns `true` if the sketch - * is in full-screen mode and `false` if not. - * - * Note: Due to browser restrictions, `fullscreen()` can only be called with - * user input such as a mouse press. - * - * @method fullscreen - * @param {Boolean} [val] whether the sketch should be in fullscreen mode. - * @return {Boolean} current fullscreen state. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * describe('A gray canvas that switches between default and full-screen display when clicked.'); - * } - * - * // If the mouse is pressed, - * // toggle full-screen mode. - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * let fs = fullscreen(); - * fullscreen(!fs); - * } - * } - * - *
                                  - */ - _main.default.prototype.fullscreen = function (val) { - _main.default._validateParameters("fullscreen", arguments); - // no arguments, return fullscreen or not - if (typeof val === "undefined") { - return ( - document.fullscreenElement || - document.webkitFullscreenElement || - document.mozFullScreenElement || - document.msFullscreenElement - ); - } else { - // otherwise set to fullscreen or not - if (val) { - launchFullscreen(document.documentElement); - } else { - exitFullscreen(); - } - } - }; - /** - * Sets the pixel scaling for high pixel density displays. - * - * By default, the pixel density is set to match display density. Calling - * `pixelDensity(1)` turn this off. - * - * Calling `pixelDensity()` without an argument returns the current pixel - * density. - * - * @method pixelDensity - * @param {Number} [val] desired pixel density. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Set the pixel density to 1. - * pixelDensity(1); - * - * // Create a canvas and draw - * // a circle. - * createCanvas(100, 100); - * background(200); - * circle(50, 50, 70); - * - * describe('A fuzzy white circle on a gray canvas.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Set the pixel density to 3. - * pixelDensity(3); - * - * // Create a canvas, paint the - * // background, and draw a - * // circle. - * createCanvas(100, 100); - * background(200); - * circle(50, 50, 70); - * - * describe('A sharp white circle on a gray canvas.'); - * } - * - *
                                  - */ - /** - * @method pixelDensity - * @returns {Number} current pixel density of the sketch. - */ - _main.default.prototype.pixelDensity = function (val) { - _main.default._validateParameters("pixelDensity", arguments); - var returnValue; - if (typeof val === "number") { - if (val !== this._pixelDensity) { - this._pixelDensity = val; - } - returnValue = this; - this.resizeCanvas(this.width, this.height, true); // as a side effect, it will clear the canvas - } else { - returnValue = this._pixelDensity; - } - return returnValue; - }; - /** - * Returns the display's current pixel density. - * - * @method displayDensity - * @returns {Number} current pixel density of the display. - * @example - *
                                  - * - * function setup() { - * // Set the pixel density to 1. - * pixelDensity(1); - * - * // Create a canvas and draw - * // a circle. - * createCanvas(100, 100); - * background(200); - * circle(50, 50, 70); - * - * describe('A fuzzy white circle drawn on a gray background. The circle becomes sharper when the mouse is pressed.'); - * } - * - * function mousePressed() { - * // Get the current display density. - * let d = displayDensity(); - * - * // Use the display density to set - * // the sketch's pixel density. - * pixelDensity(d); - * - * // Paint the background and - * // draw a circle. - * background(200); - * circle(50, 50, 70); - * } - * - *
                                  - */ - _main.default.prototype.displayDensity = function () { - return window.devicePixelRatio; - }; - function launchFullscreen(element) { - var enabled = - document.fullscreenEnabled || - document.webkitFullscreenEnabled || - document.mozFullScreenEnabled || - document.msFullscreenEnabled; - if (!enabled) { - throw new Error("Fullscreen not enabled in this browser."); - } - if (element.requestFullscreen) { - element.requestFullscreen(); - } else if (element.mozRequestFullScreen) { - element.mozRequestFullScreen(); - } else if (element.webkitRequestFullscreen) { - element.webkitRequestFullscreen(); - } else if (element.msRequestFullscreen) { - element.msRequestFullscreen(); - } - } - function exitFullscreen() { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } - } /** - * Returns the sketch's current - * URL - * as a string. - * - * @method getURL - * @return {String} url - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Get the sketch's URL - * // and display it. - * let url = getURL(); - * textWrap(CHAR); - * text(url, 0, 40, 100); - * - * describe('The URL "https://p5js.org/reference/#/p5/getURL" written in black on a gray background.'); - * } - * - *
                                  - */ - - _main.default.prototype.getURL = function () { - return location.href; - }; - /** - * Returns the current - * URL - * path as an array of strings. - * - * For example, consider a sketch hosted at the URL - * `https://example.com/sketchbook`. Calling `getURLPath()` returns - * `['sketchbook']`. For a sketch hosted at the URL - * `https://example.com/sketchbook/monday`, `getURLPath()` returns - * `['sketchbook', 'monday']`. - * - * @method getURLPath - * @return {String[]} path components. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Get the sketch's URL path - * // and display the first - * // part. - * let path = getURLPath(); - * text(path[0], 25, 54); - * - * describe('The word "reference" written in black on a gray background.'); - * } - * - *
                                  - */ - _main.default.prototype.getURLPath = function () { - return location.pathname.split("/").filter(function (v) { - return v !== ""; - }); - }; - /** - * Returns the current - * URL parameters - * in an Object. - * - * For example, calling `getURLParams()` in a sketch hosted at the URL - * `http://p5js.org?year=2014&month=May&day=15` returns - * `{ year: 2014, month: 'May', day: 15 }`. - * - * @method getURLParams - * @return {Object} URL params - * @example - *
                                  - * - * // Imagine this sketch is hosted at the following URL: - * // https://p5js.org?year=2014&month=May&day=15 - * - * function setup() { - * background(200); - * - * // Get the sketch's URL - * // parameters and display - * // them. - * let params = getURLParams(); - * text(params.day, 10, 20); - * text(params.month, 10, 40); - * text(params.year, 10, 60); - * - * describe('The text "15", "May", and "2014" written in black on separate lines.'); - * } - * - *
                                  - * - * @alt - * This example does not render anything. - */ - _main.default.prototype.getURLParams = function () { - var re = /[?&]([^&=]+)(?:[&=])([^&=]+)/gim; - var m; - var v = {}; - while ((m = re.exec(location.search)) != null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - v[m[1]] = m[2]; - } - return v; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "./constants": 286, - "./main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.search": 215, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 288: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - // This contains a data table used by ./fes_core.js/fesErrorMonitor(). - // - // Note: Different browsers use different error strings for the same error. - // Extracting info from the browser error messages is easier and cleaner - // if we have a predefined lookup. This file serves as that lookup. - // Using this lookup we match the errors obtained from the browser, classify - // them into types and extract the required information. - // The FES can use the extracted info to generate a friendly error message - // for the matching error. - var strings = { - ReferenceError: [ - { - msg: "{{}} is not defined", - type: "NOTDEFINED", - browser: "all", - }, - { - msg: "Can't find variable: {{}}", - type: "NOTDEFINED", - browser: "Safari", - }, - { - msg: "Cannot access '{{.}}' before initialization", - type: "CANNOTACCESS", - browser: "Chrome", - }, - { - msg: "can't access lexical declaration '{{.}}' before initialization", - type: "CANNOTACCESS", - browser: "Firefox", - }, - ], - SyntaxError: [ - { - msg: "illegal character", - type: "INVALIDTOKEN", - browser: "Firefox", - }, - { - msg: "Invalid character", - type: "INVALIDTOKEN", - browser: "Safari", - }, - { - msg: "Invalid or unexpected token", - type: "INVALIDTOKEN", - browser: "Chrome", - }, - { - msg: "Unexpected token '{{.}}'", - type: "UNEXPECTEDTOKEN", - browser: "Chrome", - }, - { - msg: "expected {{.}}, got '{{.}}'", - type: "UNEXPECTEDTOKEN", - browser: "Chrome", - }, - { - msg: "Identifier '{{.}}' has already been declared", - type: "REDECLAREDVARIABLE", - browser: "Chrome", - }, - { - msg: "redeclaration of {} {{.}}", - type: "REDECLAREDVARIABLE", - browser: "Firefox", - }, - { - msg: "Missing initializer in const declaration", - type: "MISSINGINITIALIZER", - browser: "Chrome", - }, - { - msg: "missing = in const declaration", - type: "MISSINGINITIALIZER", - browser: "Firefox", - }, - { - msg: "Illegal return statement", - type: "BADRETURNORYIELD", - browser: "Chrome", - }, - { - msg: "return not in function", - type: "BADRETURNORYIELD", - browser: "Firefox", - }, - ], - TypeError: [ - { - msg: "{{.}} is not a function", - type: "NOTFUNC", - browser: "all", - }, - { - msg: "Cannot read {{.}} null", - type: "READNULL", - browser: "Chrome", - }, - { - msg: "{{.}} is null", - type: "READNULL", - browser: "Firefox", - }, - { - msg: "Cannot read {{.}} undefined", - type: "READUDEFINED", - browser: "Chrome", - }, - { - msg: "{{.}} is undefined", - type: "READUDEFINED", - browser: "Firefox", - }, - { - msg: "Assignment to constant variable", - type: "CONSTASSIGN", - browser: "Chrome", - }, - { - msg: "invalid assignment to const '{{.}}'", - type: "CONSTASSIGN", - browser: "Firefox", - }, - ], - }; - var _default = strings; - exports.default = _default; - }, - {}, - ], - 289: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.get-own-property-names"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.starts-with"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.get-own-property-names"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.starts-with"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var _internationalization = _dereq_("../internationalization"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _slicedToArray(arr, i) { - return ( - _arrayWithHoles(arr) || - _iterableToArrayLimit(arr, i) || - _nonIterableRest() - ); - } - function _nonIterableRest() { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance", - ); - } - function _iterableToArrayLimit(arr, i) { - if ( - !( - Symbol.iterator in Object(arr) || - Object.prototype.toString.call(arr) === "[object Arguments]" - ) - ) { - return; - } - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - try { - for ( - var _i = arr[Symbol.iterator](), _s; - !(_n = (_s = _i.next()).done); - _n = true - ) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @for p5 - * @requires core - * - * This is the main file for the Friendly Error System (FES), containing - * the core as well as miscellaneous functionality of the FES. Here is a - * brief outline of the functions called in this system. - * - * The FES may be invoked by a call to either - * (1) _validateParameters, (2) _friendlyFileLoadError, (3) _friendlyError, - * (4) helpForMisusedAtTopLevelCode, or (5) _fesErrorMonitor. - * - * _validateParameters is located in validate_params.js along with other code - * used for parameter validation. - * _friendlyFileLoadError is located in file_errors.js along with other code - * used for dealing with file load errors. - * Apart from this, there's also a file stacktrace.js, which contains the code - * to parse the error stack, borrowed from: - * https://github.com/stacktracejs/stacktrace.js - * - * For more detailed information on the FES functions, including the call - * sequence of each function, please look at the FES Reference + Dev Notes: - * https://github.com/processing/p5.js/blob/main/contributor_docs/fes_reference_dev_notes.md - */ - // p5.js blue, p5.js orange, auto dark green; fallback p5.js darkened magenta - // See testColors below for all the color codes and names - - var typeColors = ["#2D7BB6", "#EE9900", "#4DB200", "#C83C00"]; - var misusedAtTopLevelCode = null; - var defineMisusedAtTopLevelCode = null; - // the threshold for the maximum allowed levenshtein distance - // used in misspelling detection - var EDIT_DIST_THRESHOLD = 2; - // to enable or disable styling (color, font-size, etc. ) for fes messages - var ENABLE_FES_STYLING = false; - if (typeof IS_MINIFIED !== "undefined") { - _main.default._friendlyError = - _main.default._checkForUserDefinedFunctions = - _main.default._fesErrorMonitor = - function () {}; - } else { - var doFriendlyWelcome = false; // TEMP until we get it all working LM - var errorTable = _dereq_("./browser_errors").default; - // -- Borrowed from jQuery 1.11.3 -- - var class2type = {}; - var _toString = class2type.toString; - var names = [ - "Boolean", - "Number", - "String", - "Function", - "Array", - "Date", - "RegExp", - "Object", - "Error", - ]; - for (var n = 0; n < names.length; n++) { - class2type["[object ".concat(names[n], "]")] = - names[n].toLowerCase(); - } - var getType = function getType(obj) { - if (obj == null) { - return "".concat(obj); - } - return _typeof(obj) === "object" || typeof obj === "function" - ? class2type[_toString.call(obj)] || "object" - : _typeof(obj); - }; - // -- End borrow -- - // entry points into user-defined code - var entryPoints = [ - "setup", - "draw", - "preload", - "deviceMoved", - "deviceTurned", - "deviceShaken", - "doubleClicked", - "mousePressed", - "mouseReleased", - "mouseMoved", - "mouseDragged", - "mouseClicked", - "mouseWheel", - "touchStarted", - "touchMoved", - "touchEnded", - "keyPressed", - "keyReleased", - "keyTyped", - "windowResized", - ]; - var friendlyWelcome = function friendlyWelcome() { - // p5.js brand - magenta: #ED225D - //const astrixBgColor = 'transparent'; - //const astrixTxtColor = '#ED225D'; - //const welcomeBgColor = '#ED225D'; - //const welcomeTextColor = 'white'; - var welcomeMessage = (0, _internationalization.translator)( - "fes.pre", - { - message: (0, _internationalization.translator)("fes.welcome"), - }, - ); - console.log( - " _ \n" + - " /\\| |/\\ \n" + - " \\ ` ' / \n" + - " / , . \\ \n" + - " \\/|_|\\/ " + - "\n\n" + - welcomeMessage, - ); - }; - /** - * Takes a message and a p5 function func, and adds a link pointing to - * the reference documentation of func at the end of the message - * - * @method mapToReference - * @private - * @param {String} message the words to be said - * @param {String} [func] the name of function - * - * @returns {String} - */ - var mapToReference = function mapToReference(message, func) { - var msgWithReference = ""; - if (func == null || func.substring(0, 4) === "load") { - msgWithReference = message; - } else { - var methodParts = func.split("."); - var referenceSection = - methodParts.length > 1 - ? "".concat(methodParts[0], ".").concat(methodParts[1]) - : "p5"; - var funcName = - methodParts.length === 1 - ? func - : methodParts.slice(2).join("/"); - //Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link - funcName.startsWith("p5.") - ? (msgWithReference = "" - .concat(message, " (http://p5js.org/reference/#/") - .concat(referenceSection, ".") - .concat(funcName, ")")) - : (msgWithReference = "" - .concat(message, " (http://p5js.org/reference/#/") - .concat(referenceSection, "/") - .concat(funcName, ")")); - } - return msgWithReference; - }; - /** - * Prints out a fancy, colorful message to the console log - * Attaches Friendly Errors prefix [fes.pre] to the message. - * - * @method _report - * @private - * @param {String} message Message to be printed - * @param {String} [func] Name of function - * @param {Number|String} [color] CSS color code - * - * @return console logs - */ - _main.default._report = function (message, func, color) { - // if p5._fesLogger is set ( i.e we are running tests ), use that - // instead of console.log - var log = - _main.default._fesLogger == null - ? console.log.bind(console) - : _main.default._fesLogger; - if (doFriendlyWelcome) { - friendlyWelcome(); - doFriendlyWelcome = false; - } - if ("undefined" === getType(color)) { - color = "#B40033"; // dark magenta - } else if (getType(color) === "number") { - // Type to color - color = typeColors[color]; - } // Add a link to the reference docs of func at the end of the message - - message = mapToReference(message, func); - var style = [ - "color: ".concat(color), - "font-family: Arial", - "font-size: larger", - ]; - var prefixedMsg = (0, _internationalization.translator)( - "fes.pre", - { - message: message, - }, - ); - if (ENABLE_FES_STYLING) { - log("%c" + prefixedMsg, style.join(";")); - } else { - log(prefixedMsg); - } - }; - /** - * This is a generic method that can be called from anywhere in the p5 - * library to alert users to a common error. - * - * @method _friendlyError - * @private - * @param {String} message Message to be printed - * @param {String} [func] Name of the function linked to error - * @param {Number|String} [color] CSS color code - */ - _main.default._friendlyError = function (message, func, color) { - _main.default._report(message, func, color); - }; - /** - * This is called internally if there is an error with autoplay. Generates - * and prints a friendly error message [fes.autoplay]. - * - * @method _friendlyAutoplayError - * @private - */ - _main.default._friendlyAutoplayError = function (src) { - var message = (0, _internationalization.translator)( - "fes.autoplay", - { - src: src, - url: "https://developer.mozilla.org/docs/Web/Media/Autoplay_guide", - }, - ); - console.log( - (0, _internationalization.translator)("fes.pre", { - message: message, - }), - ); - }; - /** - * Measures dissimilarity between two strings by calculating - * the Levenshtein distance. - * - * If the "distance" between them is small enough, it is - * reasonable to think that one is the misspelled version of the other. - * - * Specifically, this uses the Wagner–Fischer algorithm. - * @method computeEditDistance - * @private - * @param {String} w1 the first word - * @param {String} w2 the second word - * - * @returns {Number} the "distance" between the two words, a smaller value - * indicates that the words are similar - */ - var computeEditDistance = function computeEditDistance(w1, w2) { - var l1 = w1.length, - l2 = w2.length; - if (l1 === 0) return w2; - if (l2 === 0) return w1; - var prev = []; - var cur = []; - for (var j = 0; j < l2 + 1; j++) { - cur[j] = j; - } - prev = cur; - for (var i = 1; i < l1 + 1; i++) { - cur = []; - for (var _j = 0; _j < l2 + 1; _j++) { - if (_j === 0) { - cur[_j] = i; - } else { - var a1 = w1[i - 1], - a2 = w2[_j - 1]; - var temp = 999999; - var cost = a1.toLowerCase() === a2.toLowerCase() ? 0 : 1; - temp = - temp > cost + prev[_j - 1] ? cost + prev[_j - 1] : temp; - temp = temp > 1 + cur[_j - 1] ? 1 + cur[_j - 1] : temp; - temp = temp > 1 + prev[_j] ? 1 + prev[_j] : temp; - cur[_j] = temp; - } - } - prev = cur; - } - return cur[l2]; - }; - /** - * Checks capitalization for user defined functions. - * - * Generates and prints a friendly error message using key: - * "fes.checkUserDefinedFns". - * - * @method checkForUserDefinedFunctions - * @private - * @param {*} context Current default context. Set to window in - * "global mode" and to a p5 instance in "instance mode" - */ - var checkForUserDefinedFunctions = - function checkForUserDefinedFunctions(context) { - if (_main.default.disableFriendlyErrors) return; - // if using instance mode, this function would be called with the current - // instance as context - var instanceMode = context instanceof _main.default; - context = instanceMode ? context : window; - var fnNames = entryPoints; - var fxns = {}; - // lowercasename -> actualName mapping - fnNames.forEach(function (symbol) { - fxns[symbol.toLowerCase()] = symbol; - }); - for ( - var _i = 0, _Object$keys = Object.keys(context); - _i < _Object$keys.length; - _i++ - ) { - var prop = _Object$keys[_i]; - var lowercase = prop.toLowerCase(); - // check if the lowercase property name has an entry in fxns, if the - // actual name with correct capitalization doesnt exist in context, - // and if the user-defined symbol is of the type function - if ( - fxns[lowercase] && - !context[fxns[lowercase]] && - typeof context[prop] === "function" - ) { - var msg = (0, _internationalization.translator)( - "fes.checkUserDefinedFns", - { - name: prop, - actualName: fxns[lowercase], - }, - ); - _main.default._friendlyError(msg, fxns[lowercase]); - } - } - }; - /** - * Compares the symbol caught in the ReferenceError to everything in - * misusedAtTopLevel ( all public p5 properties ). - * - * Generates and prints a friendly error message using key: "fes.misspelling". - * - * @method handleMisspelling - * @private - * @param {String} errSym Symbol to whose spelling to check - * @param {Error} error ReferenceError object - * - * @returns {Boolean} tell whether error was likely due to typo - */ - var handleMisspelling = function handleMisspelling(errSym, error) { - if (!misusedAtTopLevelCode) { - defineMisusedAtTopLevelCode(); - } - var distanceMap = {}; - var min = 999999; - // compute the levenshtein distance for the symbol against all known - // public p5 properties. Find the property with the minimum distance - misusedAtTopLevelCode.forEach(function (symbol) { - var dist = computeEditDistance(errSym, symbol.name); - if (distanceMap[dist]) distanceMap[dist].push(symbol); - else distanceMap[dist] = [symbol]; - if (dist < min) min = dist; - }); - // if the closest match has more "distance" than the max allowed threshold - if (min > Math.min(EDIT_DIST_THRESHOLD, errSym.length)) - return false; - // Show a message only if the caught symbol and the matched property name - // differ in their name ( either letter difference or difference of case ) - var matchedSymbols = distanceMap[min].filter(function (symbol) { - return symbol.name !== errSym; - }); - if (matchedSymbols.length !== 0) { - var parsed = _main.default._getErrorStackParser().parse(error); - var locationObj; - if ( - parsed && - parsed[0] && - parsed[0].fileName && - parsed[0].lineNumber && - parsed[0].columnNumber - ) { - locationObj = { - location: "" - .concat(parsed[0].fileName, ":") - .concat(parsed[0].lineNumber, ":") - .concat(parsed[0].columnNumber), - file: parsed[0].fileName.split("/").slice(-1), - line: parsed[0].lineNumber, - }; - } - var msg; - if (matchedSymbols.length === 1) { - // To be used when there is only one closest match. The count parameter - // allows i18n to pick between the keys "fes.misspelling" and - // "fes.misspelling_plural" - msg = (0, _internationalization.translator)( - "fes.misspelling", - { - name: errSym, - actualName: matchedSymbols[0].name, - type: matchedSymbols[0].type, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - count: matchedSymbols.length, - }, - ); - } else { - // To be used when there are multiple closest matches. Gives each - // suggestion on its own line, the function name followed by a link to - // reference documentation - var suggestions = matchedSymbols - .map(function (symbol) { - var message = - "▶️ " + - symbol.name + - (symbol.type === "function" ? "()" : ""); - return mapToReference(message, symbol.name); - }) - .join("\n"); - msg = (0, _internationalization.translator)( - "fes.misspelling", - { - name: errSym, - suggestions: suggestions, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - count: matchedSymbols.length, - }, - ); - } // If there is only one closest match, tell _friendlyError to also add - // a link to the reference documentation. In case of multiple matches, - // this is already done in the suggestions variable, one link for each - // suggestion. - - _main.default._friendlyError( - msg, - matchedSymbols.length === 1 - ? matchedSymbols[0].name - : undefined, - ); - return true; - } - return false; - }; - /** - * Prints a friendly stacktrace for user-written functions for "global" errors - * - * Generates and prints a friendly error message using key: - * "fes.globalErrors.stackTop", "fes.globalErrors.stackSubseq". - * - * @method printFriendlyStack - * @private - * @param {Array} friendlyStack - */ - var printFriendlyStack = function printFriendlyStack( - friendlyStack, - ) { - var log = - _main.default._fesLogger && - typeof _main.default._fesLogger === "function" - ? _main.default._fesLogger - : console.log.bind(console); - if (friendlyStack.length > 1) { - var stacktraceMsg = ""; - friendlyStack.forEach(function (frame, idx) { - var location = "" - .concat(frame.fileName, ":") - .concat(frame.lineNumber, ":") - .concat(frame.columnNumber); - var frameMsg, - translationObj = { - func: frame.functionName, - line: frame.lineNumber, - location: location, - file: frame.fileName.split("/").slice(-1), - }; - if (idx === 0) { - frameMsg = (0, _internationalization.translator)( - "fes.globalErrors.stackTop", - translationObj, - ); - } else { - frameMsg = (0, _internationalization.translator)( - "fes.globalErrors.stackSubseq", - translationObj, - ); - } - stacktraceMsg += frameMsg; - }); - log(stacktraceMsg); - } - }; - /** - * Takes a stacktrace array and filters out all frames that show internal p5 - * details. - * - * Generates and prints a friendly error message using key: - * "fes.wrongPreload", "fes.libraryError". - * - * The processed stack is used to find whether the error happened internally - * within the library, and if the error was due to a non-loadX() method - * being used in preload. - * - * "Internally" here means that the exact location of the error (the top of - * the stack) is a piece of code written in the p5.js library (which may or - * may not have been called from the user's sketch). - * - * @method processStack - * @private - * @param {Error} error - * @param {Array} stacktrace - * - * @returns {Array} An array with two elements, [isInternal, friendlyStack] - * isInternal: a boolean value indicating whether the error - * happened internally - * friendlyStack: the filtered (simplified) stacktrace - */ - var processStack = function processStack(error, stacktrace) { - // cannot process a stacktrace that doesn't exist - if (!stacktrace) return [false, null]; - stacktrace.forEach(function (frame) { - frame.functionName = frame.functionName || ""; - }); - // isInternal - Did this error happen inside the library - var isInternal = false; - var p5FileName, friendlyStack, currentEntryPoint; - // Intentionally throw an error that we catch so that we can check the name - // of the current file. Any errors we see from this file, we treat as - // internal errors. - try { - throw new Error(); - } catch (testError) { - var testStacktrace = _main.default - ._getErrorStackParser() - .parse(testError); - p5FileName = testStacktrace[0].fileName; - } - for (var i = stacktrace.length - 1; i >= 0; i--) { - var splitted = stacktrace[i].functionName.split("."); - if (entryPoints.includes(splitted[splitted.length - 1])) { - // remove everything below an entry point function (setup, draw, etc). - // (it's usually the internal initialization calls) - friendlyStack = stacktrace.slice(0, i + 1); - currentEntryPoint = splitted[splitted.length - 1]; - // We call the error "internal" if the source of the error was a - // function from within the p5.js library file, but called from the - // user's code directly. We only need to check the topmost frame in - // the stack trace since any function internal to p5 should pass this - // check, not just public p5 functions. - if (stacktrace[0].fileName === p5FileName) { - isInternal = true; - break; - } - break; - } - } // in some cases ( errors in promises, callbacks, etc), no entry-point - // function may be found in the stacktrace. In that case just use the - // entire stacktrace for friendlyStack - - if (!friendlyStack) friendlyStack = stacktrace; - if (isInternal) { - // the frameIndex property is added before the filter, so frameIndex - // corresponds to the index of a frame in the original stacktrace. - // Then we filter out all frames which belong to the file that contains - // the p5 library - friendlyStack = friendlyStack - .map(function (frame, index) { - frame.frameIndex = index; - return frame; - }) - .filter(function (frame) { - return frame.fileName !== p5FileName; - }); - // a weird case, if for some reason we can't identify the function called - // from user's code - if (friendlyStack.length === 0) return [true, null]; - // get the function just above the topmost frame in the friendlyStack. - // i.e the name of the library function called from user's code - var func = stacktrace[ - friendlyStack[0].frameIndex - 1 - ].functionName - .split(".") - .slice(-1)[0]; - // Try and get the location (line no.) from the top element of the stack - var locationObj; - if ( - friendlyStack[0].fileName && - friendlyStack[0].lineNumber && - friendlyStack[0].columnNumber - ) { - locationObj = { - location: "" - .concat(friendlyStack[0].fileName, ":") - .concat(friendlyStack[0].lineNumber, ":") - .concat(friendlyStack[0].columnNumber), - file: friendlyStack[0].fileName.split("/").slice(-1), - line: friendlyStack[0].lineNumber, - }; - // if already handled by another part of the FES, don't handle again - if (_main.default._fesLogCache[locationObj.location]) - return [true, null]; - } // Check if the error is due to a non loadX method being used incorrectly - // in preload - - if ( - currentEntryPoint === "preload" && - _main.default.prototype._preloadMethods[func] == null - ) { - _main.default._friendlyError( - (0, _internationalization.translator)("fes.wrongPreload", { - func: func, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - error: error.message, - }), - "preload", - ); - } else { - // Library error - _main.default._friendlyError( - (0, _internationalization.translator)("fes.libraryError", { - func: func, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - error: error.message, - }), - func, - ); - } // Finally, if it's an internal error, print the friendlyStack - // ( fesErrorMonitor won't handle this error ) - - if (friendlyStack && friendlyStack.length) { - printFriendlyStack(friendlyStack); - } - } - return [isInternal, friendlyStack]; - }; - /** - * Handles "global" errors that the browser catches. - * - * Called when an error event happens and detects the type of error. - * - * Generates and prints a friendly error message using key: - * "fes.globalErrors.syntax.[*]", "fes.globalErrors.reference.[*]", - * "fes.globalErrors.type.[*]". - * - * @method fesErrorMonitor - * @private - * @param {*} e Event object to extract error details from - */ - var fesErrorMonitor = function fesErrorMonitor(e) { - if (_main.default.disableFriendlyErrors) return; - // Try to get the error object from e - var error; - if (e instanceof Error) { - error = e; - } else if (e instanceof ErrorEvent) { - error = e.error; - } else if (e instanceof PromiseRejectionEvent) { - error = e.reason; - if (!(error instanceof Error)) return; - } - if (!error) return; - var stacktrace = _main.default - ._getErrorStackParser() - .parse(error); - // process the stacktrace from the browser and simplify it to give - // friendlyStack. - var _processStack = processStack(error, stacktrace), - _processStack2 = _slicedToArray(_processStack, 2), - isInternal = _processStack2[0], - friendlyStack = _processStack2[1]; // if this is an internal library error, the type of the error is not relevant, - // only the user code that lead to it is. - if (isInternal) { - return; - } - var errList = errorTable[error.name]; - if (!errList) return; // this type of error can't be handled yet - var matchedError; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = errList[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var obj = _step.value; - var string = obj.msg; - // capture the primary symbol mentioned in the error - string = string.replace( - new RegExp("{{}}", "g"), - "([a-zA-Z0-9_]+)", - ); - string = string.replace(new RegExp("{{.}}", "g"), "(.+)"); - string = string.replace( - new RegExp("{}", "g"), - "(?:[a-zA-Z0-9_]+)", - ); - var matched = error.message.match(string); - if (matched) { - matchedError = Object.assign({}, obj); - matchedError.match = matched; - break; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - if (!matchedError) return; - // Try and get the location from the top element of the stack - var locationObj; - if ( - stacktrace && - stacktrace[0].fileName && - stacktrace[0].lineNumber && - stacktrace[0].columnNumber - ) { - locationObj = { - location: "" - .concat(stacktrace[0].fileName, ":") - .concat(stacktrace[0].lineNumber, ":") - .concat(stacktrace[0].columnNumber), - file: stacktrace[0].fileName.split("/").slice(-1), - line: friendlyStack[0].lineNumber, - }; - } - switch (error.name) { - case "SyntaxError": { - // We can't really do much with syntax errors other than try to use - // a simpler framing of the error message. The stack isn't available - // for syntax errors - switch (matchedError.type) { - case "INVALIDTOKEN": { - //Error if there is an invalid or unexpected token that doesn't belong at this position in the code - //let x = “not a string”; -> string not in proper quotes - var url = - "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character#What_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.syntax.invalidToken", - { - url: url, - }, - ), - ); - break; - } - case "UNEXPECTEDTOKEN": { - //Error if a specific language construct(, { ; etc) was expected, but something else was provided - //for (let i = 0; i < 5,; ++i) -> a comma after i<5 instead of a semicolon - var _url = - "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Unexpected_token#What_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.syntax.unexpectedToken", - { - url: _url, - }, - ), - ); - break; - } - case "REDECLAREDVARIABLE": { - //Error if a variable is redeclared by the user. Example=> - //let a = 10; - //let a = 100; - var errSym = matchedError.match[1]; - var _url2 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter#what_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.syntax.redeclaredVariable", - { - symbol: errSym, - url: _url2, - }, - ), - ); - break; - } - case "MISSINGINITIALIZER": { - //Error if a const variable is not initialized during declaration - //Example => const a; - var _url3 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const#what_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.syntax.missingInitializer", - { - url: _url3, - }, - ), - ); - break; - } - case "BADRETURNORYIELD": { - //Error when a return statement is misplaced(usually outside of a function) - // const a = function(){ - // ..... - // } - // return; -> misplaced return statement - var _url4 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return_or_yield#what_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.syntax.badReturnOrYield", - { - url: _url4, - }, - ), - ); - break; - } - } - break; - } - case "ReferenceError": { - switch (matchedError.type) { - case "NOTDEFINED": { - //Error if there is a non-existent variable referenced somewhere - //let a = 10; - //console.log(x); - var _errSym = matchedError.match[1]; - if (_errSym && handleMisspelling(_errSym, error)) { - break; - } // if the flow gets this far, this is likely not a misspelling - // of a p5 property/function - - var _url5 = - "https://p5js.org/examples/data-variable-scope.html"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.reference.notDefined", - { - url: _url5, - symbol: _errSym, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - }, - ), - ); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case "CANNOTACCESS": { - //Error if a lexical variable was accessed before it was initialized - //console.log(a); -> variable accessed before it was initialized - //let a=100; - var _errSym2 = matchedError.match[1]; - var _url6 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init#what_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.reference.cannotAccess", - { - url: _url6, - symbol: _errSym2, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - }, - ), - ); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - } - break; - } - case "TypeError": { - switch (matchedError.type) { - case "NOTFUNC": { - //Error when some code expects you to provide a function, but that didn't happen - //let a = document.getElementByID('foo'); -> getElementById instead of getElementByID - var _errSym3 = matchedError.match[1]; - var splitSym = _errSym3.split("."); - var _url7 = - "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_a_function#What_went_wrong"; - // if errSym is aa.bb.cc , symbol would be cc and obj would aa.bb - var translationObj = { - url: _url7, - symbol: splitSym[splitSym.length - 1], - obj: splitSym.slice(0, splitSym.length - 1).join("."), - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - }; - // There are two cases to handle here. When the function is called - // as a property of an object and when it's called independently. - // Both have different explanations. - if (splitSym.length > 1) { - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.type.notfuncObj", - translationObj, - ), - ); - } else { - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.type.notfunc", - translationObj, - ), - ); - } - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case "READNULL": { - //Error if a property of null is accessed - //let a = null; - //console.log(a.property); -> a is null - var _errSym4 = matchedError.match[1]; - var _url8 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong"; - /*let url2 = - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null';*/ - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.type.readFromNull", - { - url: _url8, - symbol: _errSym4, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - }, - ), - ); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case "READUDEFINED": { - //Error if a property of undefined is accessed - //let a; -> default value of a is undefined - //console.log(a.property); -> a is undefined - var _errSym5 = matchedError.match[1]; - var _url9 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong"; - /*let url2 = - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined#description';*/ - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.type.readFromUndefined", - { - url: _url9, - symbol: _errSym5, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - }, - ), - ); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - case "CONSTASSIGN": { - //Error when a const variable is reassigned a value - //const a = 100; - //a=10; - var _url10 = - "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment#what_went_wrong"; - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.globalErrors.type.constAssign", - { - url: _url10, - location: locationObj - ? (0, _internationalization.translator)( - "fes.location", - locationObj, - ) - : "", - }, - ), - ); - if (friendlyStack) printFriendlyStack(friendlyStack); - break; - } - } - } - } - }; - _main.default._fesErrorMonitor = fesErrorMonitor; - _main.default._checkForUserDefinedFunctions = - checkForUserDefinedFunctions; - // logger for testing purposes. - _main.default._fesLogger = null; - _main.default._fesLogCache = {}; - window.addEventListener( - "load", - checkForUserDefinedFunctions, - false, - ); - window.addEventListener( - "error", - _main.default._fesErrorMonitor, - false, - ); - window.addEventListener( - "unhandledrejection", - _main.default._fesErrorMonitor, - false, - ); - /** - * Prints out all the colors in the color pallete with white text. - * For color blindness testing. - */ - /* function testColors() { - const str = 'A box of biscuits, a box of mixed biscuits and a biscuit mixer'; - p5._friendlyError(str, 'print', '#ED225D'); // p5.js magenta - p5._friendlyError(str, 'print', '#2D7BB6'); // p5.js blue - p5._friendlyError(str, 'print', '#EE9900'); // p5.js orange - p5._friendlyError(str, 'print', '#A67F59'); // p5.js light brown - p5._friendlyError(str, 'print', '#704F21'); // p5.js gold - p5._friendlyError(str, 'print', '#1CC581'); // auto cyan - p5._friendlyError(str, 'print', '#FF6625'); // auto orange - p5._friendlyError(str, 'print', '#79EB22'); // auto green - p5._friendlyError(str, 'print', '#B40033'); // p5.js darkened magenta - p5._friendlyError(str, 'print', '#084B7F'); // p5.js darkened blue - p5._friendlyError(str, 'print', '#945F00'); // p5.js darkened orange - p5._friendlyError(str, 'print', '#6B441D'); // p5.js darkened brown - p5._friendlyError(str, 'print', '#2E1B00'); // p5.js darkened gold - p5._friendlyError(str, 'print', '#008851'); // auto dark cyan - p5._friendlyError(str, 'print', '#C83C00'); // auto dark orange - p5._friendlyError(str, 'print', '#4DB200'); // auto dark green - } */ - } // This is a lazily-defined list of p5 symbols that may be - // misused by beginners at top-level code, outside of setup/draw. We'd like - // to detect these errors and help the user by suggesting they move them - // into setup/draw. - // - // For more details, see https://github.com/processing/p5.js/issues/1121. - - misusedAtTopLevelCode = null; - var FAQ_URL = - "https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"; - /** - * A helper function for populating misusedAtTopLevel list. - * - * @method defineMisusedAtTopLevelCode - * @private - */ - defineMisusedAtTopLevelCode = function defineMisusedAtTopLevelCode() { - var uniqueNamesFound = {}; - var getSymbols = function getSymbols(obj) { - return Object.getOwnPropertyNames(obj) - .filter(function (name) { - if (name[0] === "_") { - return false; - } - if (name in uniqueNamesFound) { - return false; - } - uniqueNamesFound[name] = true; - return true; - }) - .map(function (name) { - var type; - if (typeof obj[name] === "function") { - type = "function"; - } else if (name === name.toUpperCase()) { - type = "constant"; - } else { - type = "variable"; - } - return { - name: name, - type: type, - }; - }); - }; - misusedAtTopLevelCode = [].concat( - getSymbols(_main.default.prototype), // At present, p5 only adds its constants to p5.prototype during - // construction, which may not have happened at the time a - // ReferenceError is thrown, so we'll manually add them to our list. - getSymbols(_dereq_("../constants")), - ); - // This will ultimately ensure that we report the most specific error - // possible to the user, e.g. advising them about HALF_PI instead of PI - // when their code misuses the former. - misusedAtTopLevelCode.sort(function (a, b) { - return b.name.length - a.name.length; - }); - }; - /** - * Detects browser level error event for p5 constants/functions used outside - * of setup() and draw(). - * - * Generates and prints a friendly error message using key: - * "fes.misusedTopLevel". - * - * @method helpForMisusedAtTopLevelCode - * @private - * @param {Event} e Error event - * @param {Boolean} log false - * - * @returns {Boolean} true - */ - var helpForMisusedAtTopLevelCode = - function helpForMisusedAtTopLevelCode(e, log) { - if (!log) { - log = console.log.bind(console); - } - if (!misusedAtTopLevelCode) { - defineMisusedAtTopLevelCode(); - } // If we find that we're logging lots of false positives, we can - // uncomment the following code to avoid displaying anything if the - // user's code isn't likely to be using p5's global mode. (Note that - // setup/draw are more likely to be defined due to JS function hoisting.) - // - //if (!('setup' in window || 'draw' in window)) { - // return; - //} - - misusedAtTopLevelCode.some(function (symbol) { - // Note that while just checking for the occurrence of the - // symbol name in the error message could result in false positives, - // a more rigorous test is difficult because different browsers - // log different messages, and the format of those messages may - // change over time. - // - // For example, if the user uses 'PI' in their code, it may result - // in any one of the following messages: - // - // * 'PI' is undefined (Microsoft Edge) - // * ReferenceError: PI is undefined (Firefox) - // * Uncaught ReferenceError: PI is not defined (Chrome) - if ( - e.message && - e.message.match("\\W?".concat(symbol.name, "\\W")) !== null - ) { - var symbolName = - symbol.type === "function" - ? "".concat(symbol.name, "()") - : symbol.name; - if (typeof IS_MINIFIED !== "undefined") { - log( - "Did you just try to use p5.js's " - .concat(symbolName, " ") - .concat( - symbol.type, - "? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ", - ) - .concat(FAQ_URL), - ); - } else { - log( - (0, _internationalization.translator)( - "fes.misusedTopLevel", - { - symbolName: symbolName, - symbolType: symbol.type, - url: FAQ_URL, - }, - ), - ); - } - return true; - } - }); - }; - // Exposing this primarily for unit testing. - _main.default.prototype._helpForMisusedAtTopLevelCode = - helpForMisusedAtTopLevelCode; - if (document.readyState !== "complete") { - window.addEventListener( - "error", - helpForMisusedAtTopLevelCode, - false, - ); - // Our job is only to catch ReferenceErrors that are thrown when - // global (non-instance mode) p5 APIs are used at the top-level - // scope of a file, so we'll unbind our error listener now to make - // sure we don't log false positives later. - window.addEventListener("load", function () { - window.removeEventListener( - "error", - helpForMisusedAtTopLevelCode, - false, - ); - }); - } - var _default = _main.default; - exports.default = _default; - }, - { - "../constants": 286, - "../internationalization": 296, - "../main": 298, - "./browser_errors": 288, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.some": 184, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.object.assign": 194, - "core-js/modules/es.object.get-own-property-names": 197, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.constructor": 204, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.match": 211, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.starts-with": 217, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 290: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var _internationalization = _dereq_("../internationalization"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @for p5 - * @requires core - */ - - if (typeof IS_MINIFIED !== "undefined") { - _main.default._friendlyFileLoadError = function () {}; - } else { - // mapping used by `_friendlyFileLoadError` - var fileLoadErrorCases = function fileLoadErrorCases( - num, - filePath, - ) { - var suggestion = (0, _internationalization.translator)( - "fes.fileLoadError.suggestion", - { - filePath: filePath, - url: "https://github.com/processing/p5.js/wiki/Local-server", - }, - ); - switch (num) { - case 0: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.image", - { - suggestion: suggestion, - }, - ), - method: "loadImage", - }; - case 1: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.xml", - { - suggestion: suggestion, - }, - ), - method: "loadXML", - }; - case 2: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.table", - { - suggestion: suggestion, - }, - ), - method: "loadTable", - }; - case 3: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.strings", - { - suggestion: suggestion, - }, - ), - method: "loadStrings", - }; - case 4: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.font", - { - suggestion: suggestion, - }, - ), - method: "loadFont", - }; - case 5: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.json", - { - suggestion: suggestion, - }, - ), - method: "loadJSON", - }; - case 6: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.bytes", - { - suggestion: suggestion, - }, - ), - method: "loadBytes", - }; - case 7: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.large", - ), - method: "loadX", - }; - case 8: - return { - message: (0, _internationalization.translator)( - "fes.fileLoadError.gif", - ), - method: "loadImage", - }; - } - }; - /** - * Called internally if there is an error during file loading. - * - * Generates and prints a friendly error message using key: - * "fes.fileLoadError.[*]". - * - * @method _friendlyFileLoadError - * @private - * @param {Number} errorType Number of file load error type - * @param {String} filePath Path to file caused the error - */ - _main.default._friendlyFileLoadError = function ( - errorType, - filePath, - ) { - var _fileLoadErrorCases = fileLoadErrorCases(errorType, filePath), - message = _fileLoadErrorCases.message, - method = _fileLoadErrorCases.method; - _main.default._friendlyError(message, method, 3); - }; - } - var _default = _main.default; - exports.default = _default; - }, - { - "../internationalization": 296, - "../main": 298, - }, - ], - 291: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var _internationalization = _dereq_("../internationalization"); - var constants = _interopRequireWildcard(_dereq_("../constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @for p5 - * @requires core - */ - /** - * Checks if any p5.js constant/function is declared outside of setup() - * and draw() function. Also checks any reserved constant/function is - * redeclared. - * - * Generates and prints a friendly error message using key: - * "fes.sketchReaderErrors.reservedConst", - * "fes.sketchReaderErrors.reservedFunc". - * - * @method _fesCodeReader - * @private - */ - - if (typeof IS_MINIFIED !== "undefined") { - _main.default._fesCodeReader = function () {}; - } else { - //list of functions to ignore as they either - //are ment to be defined or generate false positive - //outputs - var ignoreFunction = [ - "setup", - "draw", - "preload", - "deviceMoved", - "deviceTurned", - "deviceShaken", - "doubleClicked", - "mousePressed", - "mouseReleased", - "mouseMoved", - "mouseDragged", - "mouseClicked", - "mouseWheel", - "touchStarted", - "touchMoved", - "touchEnded", - "keyPressed", - "keyReleased", - "keyTyped", - "windowResized", - "name", - "parent", - "toString", - "print", - "stop", - "onended", - ]; - /** - * Takes a list of variables defined by the user in the code - * as an array and checks if the list contains p5.js constants and functions. - * - * @method checkForConstsAndFuncs - * @private - * @param {Array} variableArray - */ - var checkForConstsAndFuncs = function checkForConstsAndFuncs( - variableArray, - ) { - for (var i = 0; i < variableArray.length; i++) { - //if the element in variableArray is a p5.js constant then the below condidion - //will be true, hence a match is found - if (constants[variableArray[i]] !== undefined) { - var url = "https://p5js.org/reference/#/p5/".concat( - variableArray[i], - ); - //display the FES message if a match is found - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.sketchReaderErrors.reservedConst", - { - url: url, - symbol: variableArray[i], - }, - ), - ); - return; - //if match found then end search - } - } - var p5Constructors = {}; - for ( - var _i = 0, _Object$keys = Object.keys(_main.default); - _i < _Object$keys.length; - _i++ - ) { - var key = _Object$keys[_i]; - // Get a list of all constructors in p5. They are functions whose names - // start with a capital letter - if ( - typeof _main.default[key] === "function" && - key[0] !== key[0].toLowerCase() - ) { - p5Constructors[key] = _main.default[key]; - } - } - for (var _i2 = 0; _i2 < variableArray.length; _i2++) { - //ignoreFunction contains the list of functions to be ignored - if (!ignoreFunction.includes(variableArray[_i2])) { - var keyArray = Object.keys(p5Constructors); - var j = 0; - //for every function name obtained check if it matches any p5.js function name - for (; j < keyArray.length; j++) { - if ( - p5Constructors[keyArray[j]].prototype[ - variableArray[_i2] - ] !== undefined - ) { - //if a p5.js function is used ie it is in the funcs array - var _url = "https://p5js.org/reference/#/p5/".concat( - variableArray[_i2], - ); - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.sketchReaderErrors.reservedFunc", - { - url: _url, - symbol: variableArray[_i2], - }, - ), - ); - return; - } - } - } - } - }; - //these regex are used to perform variable extraction - //visit https://regexr.com/ for the detailed view - var optionalVarKeyword = /(?:(?:let|const|var)\s+)?/; - // Bracketed expressions start with an opening bracket, some amount of non - // bracket characters, then a closing bracket. Note that this won't properly - // parse nested brackets: `constrain(millis(), 0, 1000)` will match - // `constrain(millis()` only, but will still fail gracefully and not try to - // mistakenly read any subsequent code as assignment expressions. - var roundBracketedExpr = /(?:\([^)]*\))/; - var squareBracketedExpr = /(?:\[[^\]]*\])/; - var curlyBracketedExpr = /(?:\{[^}]*\})/; - var bracketedExpr = new RegExp( - [roundBracketedExpr, squareBracketedExpr, curlyBracketedExpr] - .map(function (regex) { - return regex.source; - }) - .join("|"), - ); - // In an a = b expression, `b` can be any character up to a newline or comma, - // unless the comma is inside of a bracketed expression of some kind (to make - // sure we parse function calls with multiple arguments properly.) - var rightHandSide = new RegExp( - "(?:" + bracketedExpr.source + "|[^\\n,])+", - ); - var leftHandSide = /([\w$]+)/; - var assignmentOperator = /\s*=\s*/; - var singleAssignment = new RegExp( - leftHandSide.source + - assignmentOperator.source + - rightHandSide.source, - ); - var listSeparator = /,\s*/; - var oneOrMoreAssignments = new RegExp( - "(?:" + - singleAssignment.source + - listSeparator.source + - ")*" + - singleAssignment.source, - ); - var assignmentStatement = new RegExp( - "^" + optionalVarKeyword.source + oneOrMoreAssignments.source, - ); - var letConstName = /(?:(?:let|const)\s+)([\w$]+)/; - /** - * Takes an array in which each element is a line of code - * containing a variable definition(Eg: arr=['let x = 100', 'const y = 200']) - * and extracts the variables defined. - * - * @method extractVariables - * @private - * @param {Array} linesArray array of lines of code - */ - var extractVariables = function extractVariables(linesArray) { - //extract variable names from the user's code - var matches = []; - linesArray.forEach(function (ele) { - // Match 0 is the part of the line of code that the regex looked at. - // Matches 1 and onward will be only the variable names on the left hand - // side of assignment expressions. - var match = ele.match(assignmentStatement); - if (!match) return; - matches.push.apply( - matches, - _toConsumableArray( - match.slice(1).filter(function (group) { - return group !== undefined; - }), - ), - ); - }); - //check if the obtained variables are a part of p5.js or not - checkForConstsAndFuncs(matches); - }; - /** - * Takes an array in which each element is a line of code - * containing a function definition(array=['let x = () => {...}']) - * and extracts the functions defined. - * - * @method extractFuncVariables - * @private - * @param {Array} linesArray array of lines of code - */ - var extractFuncVariables = function extractFuncVariables( - linesArray, - ) { - var matches = []; - //RegExp to extract function names from let/const x = function()... - //visit https://regexr.com/ for the detailed view. - linesArray.forEach(function (ele) { - var m = ele.match(letConstName); - if (m !== null) matches.push(ele.match(letConstName)[1]); - }); - //matches array contains the names of the functions - checkForConstsAndFuncs(matches); - }; - /** - * Converts code written by the user to an array - * every element of which is a seperate line of code. - * - * @method codeToLines - * @private - * @param {String} code code written by the user - */ - var codeToLines = function codeToLines(code) { - //convert code to array of code and filter out - //unnecessary lines - var arrayVariables = code - .split("\n") - .map(function (line) { - return line.trim(); - }) - .filter( - function (line) { - return ( - line !== "" && - !line.includes("//") && - (line.includes("let") || line.includes("const")) && - !line.includes("=>") && - !line.includes("function") - ); - }, //filter out lines containing variable names - ); - //filter out lines containing function names - var arrayFunctions = code - .split("\n") - .map(function (line) { - return line.trim(); - }) - .filter(function (line) { - return ( - line !== "" && - !line.includes("//") && - (line.includes("let") || line.includes("const")) && - (line.includes("=>") || line.includes("function")) - ); - }); - //pass the relevant array to a function which will extract all the variables/functions names - extractVariables(arrayVariables); - extractFuncVariables(arrayFunctions); - }; - /** - * Remove multiline comments and the content inside it. - * - * @method removeMultilineComments - * @private - * @param {String} code code written by the user - * @returns {String} - */ - var removeMultilineComments = function removeMultilineComments( - code, - ) { - var start = code.indexOf("/*"); - var end = code.indexOf("*/"); - //create a new string which don't have multiline comments - while (start !== -1 && end !== -1) { - if (start === 0) { - code = code.slice(end + 2); - } else code = code.slice(0, start) + code.slice(end + 2); - start = code.indexOf("/*"); - end = code.indexOf("*/"); - } - return code; - }; - /** - * Checks if any p5.js constant or function is declared outside a function - * and reports it if found. - * - * @method globalConstFuncCheck - * @private - * @returns {Boolean} - */ - var globalConstFuncCheck = function globalConstFuncCheck() { - // generate all the const key data as an array - var tempArray = Object.keys(constants); - var element; - for (var i = 0; i < tempArray.length; i++) { - try { - //if the user has not declared p5.js constant anywhere outside the - //setup or draw function then this will throw an - //error. - element = eval(tempArray[i]); - } catch (e) { - //We are catching the error due to the above mentioned - //reason. Since there is no declaration of constant everything - //is OK so we will skip the current iteration and check for the - //next element. - continue; - } //if we are not getting an error this means - //user have changed the value. We will check - //if the value is changed and if it is changed - //then report. - - if (constants[tempArray[i]] !== element) { - var url = "https://p5js.org/reference/#/p5/".concat( - tempArray[i], - ); - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.sketchReaderErrors.reservedConst", - { - url: url, - symbol: tempArray[i], - }, - ), - ); - //if a p5.js constant is already reported then no need to check - //for p5.js functions. - return true; - } - } //the below code gets a list of p5.js functions - - var p5Constructors = {}; - for ( - var _i3 = 0, _Object$keys2 = Object.keys(_main.default); - _i3 < _Object$keys2.length; - _i3++ - ) { - var key = _Object$keys2[_i3]; - // Get a list of all constructors in p5. They are functions whose names - // start with a capital letter - if ( - typeof _main.default[key] === "function" && - key[0] !== key[0].toLowerCase() - ) { - p5Constructors[key] = _main.default[key]; - } - } - var keyArray = Object.keys(p5Constructors); - var classesWithGlobalFns = [ - "Renderer", - "Renderer2D", - "RendererGL", - ]; - var functionArray = []; - //get the names of all p5.js functions which are available globally - for (var _i4 = 0; _i4 < classesWithGlobalFns.length; _i4++) { - functionArray.push.apply( - functionArray, - _toConsumableArray( - Object.keys( - p5Constructors[classesWithGlobalFns[_i4]].prototype, - ), - ), - ); - } //we have p5.js function names with us so we will check - //if they have been declared or not. - - for (var _i5 = 0; _i5 < functionArray.length; _i5++) { - //ignoreFunction contains the list of functions to be ignored - if (!ignoreFunction.includes(functionArray[_i5])) { - try { - //if we get an error that means the function is not declared - element = eval(functionArray[_i5]); - } catch (e) { - //we will skip the iteration - continue; - } //if we are not getting an error this means - //user have used p5.js function. Check if it is - //changed and if so then report it. - - for (var k = 0; k < keyArray.length; k++) { - if ( - p5Constructors[keyArray[k]].prototype[ - functionArray[_i5] - ] === undefined - ); - else { - if ( - p5Constructors[keyArray[k]].prototype[ - functionArray[_i5] - ] !== element - ) { - var _url2 = "https://p5js.org/reference/#/p5/".concat( - functionArray[_i5], - ); - _main.default._friendlyError( - (0, _internationalization.translator)( - "fes.sketchReaderErrors.reservedFunc", - { - url: _url2, - symbol: functionArray[_i5], - }, - ), - ); - return true; - } - } - } - } - } - }; - /** - * Initiates the sketch_reader's processes. - * Obtains the code in setup and draw function - * and forwards it for further processing and evaluation. - * - * @method fesCodeReader - * @private - */ - var fesCodeReader = function fesCodeReader() { - //moveAhead will determine if a match is found outside - //the setup and draw function. If a match is found then - //to prevent further potential reporting we will exit immidiately - var moveAhead = globalConstFuncCheck(); - if (moveAhead) return; - var code = ""; - try { - //get code from setup - code += "" + setup; - } catch (e) { - code += ""; - } - try { - //get code from draw - code += "\n" + draw; - } catch (e) { - code += ""; - } - if (code === "") return; - code = removeMultilineComments(code); - codeToLines(code); - }; - _main.default._fesCodeReader = fesCodeReader; - window.addEventListener("load", _main.default._fesCodeReader); - } - var _default = _main.default; - exports.default = _default; - }, - { - "../constants": 286, - "../internationalization": 296, - "../main": 298, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.constructor": 204, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.match": 211, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.trim": 219, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 292: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @for p5 - * @requires core - */ - // Borrow from stacktracejs https://github.com/stacktracejs/stacktrace.js with - // minor modifications. The license for the same and the code is included below - // Copyright (c) 2017 Eric Wendelin and other contributors - // 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. - - function ErrorStackParser() { - var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/; - var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m; - var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/; - return { - /** - * Given an Error object, extract the most information from it. - * @private - * @param {Error} error object - * @return {Array} of stack frames - */ - parse: function ErrorStackParser$$parse(error) { - if ( - typeof error.stacktrace !== "undefined" || - typeof error["opera#sourceloc"] !== "undefined" - ) { - return this.parseOpera(error); - } else if ( - error.stack && - error.stack.match(CHROME_IE_STACK_REGEXP) - ) { - return this.parseV8OrIE(error); - } else if (error.stack) { - return this.parseFFOrSafari(error); - } else { - // throw new Error('Cannot parse given Error object'); - } - }, - // Separate line and column numbers from a string of the form: (URI:Line:Column) - extractLocation: function ErrorStackParser$$extractLocation( - urlLike, - ) { - // Fail-fast but return locations like "(native)" - if (urlLike.indexOf(":") === -1) { - return [urlLike]; - } - var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/; - var parts = regExp.exec(urlLike.replace(/[()]/g, "")); - return [parts[1], parts[2] || undefined, parts[3] || undefined]; - }, - parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) { - var filtered = error.stack.split("\n").filter(function (line) { - return !!line.match(CHROME_IE_STACK_REGEXP); - }, this); - return filtered.map(function (line) { - if (line.indexOf("(eval ") > -1) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - line = line - .replace(/eval code/g, "eval") - .replace(/(\(eval at [^()]*)|(\),.*$)/g, ""); - } - var sanitizedLine = line - .replace(/^\s+/, "") - .replace(/\(eval code/g, "("); - // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in - // case it has spaces in it, as the string is split on \s+ later on - var location = sanitizedLine.match( - / (\((.+):(\d+):(\d+)\)$)/, - ); - // remove the parenthesized location from the line, if it was matched - sanitizedLine = location - ? sanitizedLine.replace(location[0], "") - : sanitizedLine; - var tokens = sanitizedLine.split(/\s+/).slice(1); - // if a location was matched, pass it to extractLocation() otherwise pop the last token - var locationParts = this.extractLocation( - location ? location[1] : tokens.pop(), - ); - var functionName = tokens.join(" ") || undefined; - var fileName = - ["eval", ""].indexOf(locationParts[0]) > -1 - ? undefined - : locationParts[0]; - return { - functionName: functionName, - fileName: fileName, - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line, - }; - }, this); - }, - parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari( - error, - ) { - var filtered = error.stack.split("\n").filter(function (line) { - return !line.match(SAFARI_NATIVE_CODE_REGEXP); - }, this); - return filtered.map(function (line) { - // Throw away eval information until we implement stacktrace.js/stackframe#8 - if (line.indexOf(" > eval") > -1) { - line = line.replace( - / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, - ":$1", - ); - } - if (line.indexOf("@") === -1 && line.indexOf(":") === -1) { - // Safari eval frames only have function names and nothing else - return { - functionName: line, - }; - } else { - var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/; - var matches = line.match(functionNameRegex); - var functionName = - matches && matches[1] ? matches[1] : undefined; - var locationParts = this.extractLocation( - line.replace(functionNameRegex, ""), - ); - return { - functionName: functionName, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line, - }; - } - }, this); - }, - parseOpera: function ErrorStackParser$$parseOpera(e) { - if ( - !e.stacktrace || - (e.message.indexOf("\n") > -1 && - e.message.split("\n").length > - e.stacktrace.split("\n").length) - ) { - return this.parseOpera9(e); - } else if (!e.stack) { - return this.parseOpera10(e); - } else { - return this.parseOpera11(e); - } - }, - parseOpera9: function ErrorStackParser$$parseOpera9(e) { - var lineRE = /Line (\d+).*script (?:in )?(\S+)/i; - var lines = e.message.split("\n"); - var result = []; - for (var i = 2, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - if (match) { - result.push({ - fileName: match[2], - lineNumber: match[1], - source: lines[i], - }); - } - } - return result; - }, - parseOpera10: function ErrorStackParser$$parseOpera10(e) { - var lineRE = - /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i; - var lines = e.stacktrace.split("\n"); - var result = []; - for (var i = 0, len = lines.length; i < len; i += 2) { - var match = lineRE.exec(lines[i]); - if (match) { - result.push({ - functionName: match[3] || undefined, - fileName: match[2], - lineNumber: match[1], - source: lines[i], - }); - } - } - return result; - }, - // Opera 10.65+ Error.stack very similar to FF/Safari - parseOpera11: function ErrorStackParser$$parseOpera11(error) { - var filtered = error.stack.split("\n").filter(function (line) { - return ( - !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && - !line.match(/^Error created at/) - ); - }, this); - return filtered.map(function (line) { - var tokens = line.split("@"); - var locationParts = this.extractLocation(tokens.pop()); - var functionCall = tokens.shift() || ""; - var functionName = - functionCall - .replace(//, "$2") - .replace(/\([^)]*\)/g, "") || undefined; - var argsRaw; - if (functionCall.match(/\(([^)]*)\)/)) { - argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, "$1"); - } - var args = - argsRaw === undefined || - argsRaw === "[arguments not available]" - ? undefined - : argsRaw.split(","); - return { - functionName: functionName, - args: args, - fileName: locationParts[0], - lineNumber: locationParts[1], - columnNumber: locationParts[2], - source: line, - }; - }, this); - }, - }; - } // End borrow - // wrapper exposing ErrorStackParser - - _main.default._getErrorStackParser = function getErrorStackParser() { - return new ErrorStackParser(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../main": 298, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.match": 211, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - }, - ], - 293: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.last-index-of"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.last-index-of"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var constants = _interopRequireWildcard(_dereq_("../constants")); - var _internationalization = _dereq_("../internationalization"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - if (typeof Class !== "function") { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - _cache.set(Class, Wrapper); - } - function Wrapper() { - return _construct( - Class, - arguments, - _getPrototypeOf(this).constructor, - ); - } - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true, - }, - }); - return _setPrototypeOf(Wrapper, Class); - }; - return _wrapNativeSuper(Class); - } - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - return _construct.apply(null, arguments); - } - function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @for p5 - * @requires core - */ - - if (typeof IS_MINIFIED !== "undefined") { - _main.default._validateParameters = - _main.default._clearValidateParamsCache = function () {}; - } else { - // for parameter validation - var dataDoc = _dereq_("../../../docs/parameterData.json"); - var arrDoc = JSON.parse(JSON.stringify(dataDoc)); - var docCache = {}; - var builtinTypes = new Set([ - "null", - "number", - "string", - "boolean", - "constant", - "function", - "any", - "integer", - ]); - var basicTypes = { - number: true, - boolean: true, - string: true, - function: true, - undefined: true, - }; - // reverse map of all constants - var constantsReverseMap = {}; - for (var key in constants) { - constantsReverseMap[constants[key]] = key; - } // mapping names of p5 types to their constructor function - // p5Constructors: - // - Color: f() - // - Graphics: f() - // - Vector: f() - // and so on - - var p5Constructors = {}; - // For speedup over many runs. funcSpecificConstructors[func] only has the - // constructors for types which were seen earlier as args of "func" - var funcSpecificConstructors = {}; - window.addEventListener("load", function () { - // Make a list of all p5 classes to be used for argument validation - // This must be done only when everything has loaded otherwise we get - // an empty array - for ( - var _i = 0, _Object$keys = Object.keys(_main.default); - _i < _Object$keys.length; - _i++ - ) { - var _key = _Object$keys[_i]; - // Get a list of all constructors in p5. They are functions whose names - // start with a capital letter - if ( - typeof _main.default[_key] === "function" && - _key[0] !== _key[0].toLowerCase() - ) { - p5Constructors[_key] = _main.default[_key]; - } - } - }); - var argumentTree = {}; - // The following two functions are responsible for querying and inserting - // into the argument tree. It stores the types of arguments that each - // function has seen so far. It is used to query if a sequence of - // arguments seen in validate parameters was seen before. - // Lets consider that the following segment of code runs repeatedly, perhaps - // in a loop or in draw() - // color(10, 10, 10); - // color(10, 10); - // color('r', 'g', 'b'); - // After the first of run the code segment, the argument tree looks like - // - color - // - number - // - number - // - number - // - seen: true - // - seen: true - // - string - // - string - // - string - // - seen: true - // seen: true signifies that this argument was also seen as the last - // argument in a call. Now in the second run of the sketch, it would traverse - // the existing tree and see seen: true, i.e this sequence was seen - // before and so scoring can be skipped. This also prevents logging multiple - // validation messages for the same thing. - /** - * Query type and return the result as an object - * - * This would be called repeatedly over and over again, - * so it needs to be as optimized for performance as possible - * @method addType - * @private - */ - var addType = function addType(value, obj, func) { - var type = _typeof(value); - if (basicTypes[type]) { - if (constantsReverseMap[value]) { - // check if the value is a p5 constant and if it is, we would want the - // value itself to be stored in the tree instead of the type - obj = obj[value] || (obj[value] = {}); - } else { - obj = obj[type] || (obj[type] = {}); - } - } else if (value === null) { - // typeof null -> "object". don't want that - obj = obj["null"] || (obj["null"] = {}); - } else { - // objects which are instances of p5 classes have nameless constructors. - // native objects have a constructor named "Object". This check - // differentiates between the two so that we dont waste time finding the - // p5 class if we just have a native object - if (value.constructor && value.constructor.name) { - obj = - obj[value.constructor.name] || - (obj[value.constructor.name] = {}); - return obj; - } // constructors for types defined in p5 do not have a name property. - // e.constructor.name gives "". Code in this segment is a workaround for it - // p5C will only have the name: constructor mapping for types - // which were already seen as args of "func" - - var p5C = funcSpecificConstructors[func]; - // p5C would contain much fewer items than p5Constructors. if we find our - // answer in p5C, we don't have to scan through p5Constructors - if (p5C === undefined) { - // if there isn't an entry yet for func - // make an entry of empty object - p5C = funcSpecificConstructors[func] = {}; - } - for (var _key2 in p5C) { - // search on the constructors we have already seen (smaller search space) - if (value instanceof p5C[_key2]) { - obj = obj[_key2] || (obj[_key2] = {}); - return obj; - } - } - for (var _key3 in p5Constructors) { - // if the above search didn't work, search on all p5 constructors - if (value instanceof p5Constructors[_key3]) { - obj = obj[_key3] || (obj[_key3] = {}); - // if found, add to known constructors for this function - p5C[_key3] = p5Constructors[_key3]; - return obj; - } - } // nothing worked, put the type as it is - - obj = obj[type] || (obj[type] = {}); - } - return obj; - }; - /** - * Build the argument type tree, argumentTree - * - * This would be called repeatedly over and over again, - * so it needs to be as optimized for performance as possible - * @method buildArgTypeCache - * @private - */ - var buildArgTypeCache = function buildArgTypeCache(func, arr) { - // get the if an argument tree for current function already exists - var obj = argumentTree[func]; - if (obj === undefined) { - // if it doesn't, create an empty tree - obj = argumentTree[func] = {}; - } - for (var i = 0, len = arr.length; i < len; ++i) { - var value = arr[i]; - if (value instanceof Array) { - // an array is passed as an argument, expand it and get the type of - // each of its element. We distinguish the start of an array with 'as' - // or arraystart. This would help distinguish between the arguments - // (number, number, number) and (number, [number, number]) - obj = obj["as"] || (obj["as"] = {}); - for (var j = 0, lenA = value.length; j < lenA; ++j) { - obj = addType(value[j], obj, func); - } - } else { - obj = addType(value, obj, func); - } - } - return obj; - }; - /** - * Query data.json - * This is a helper function for validateParameters() - * @method lookupParamDoc - * @private - */ - var lookupParamDoc = function lookupParamDoc(func) { - // look for the docs in the `data.json` datastructure - var ichDot = func.lastIndexOf("."); - var funcName = func.slice(ichDot + 1); - var funcClass = func.slice(0, ichDot !== -1 ? ichDot : 0) || "p5"; - var classitems = arrDoc; - var queryResult = classitems[funcClass][funcName]; - // different JSON structure for funct with multi-format - var overloads = []; - if (queryResult.hasOwnProperty("overloads")) { - // add all the overloads - for (var i = 0; i < queryResult.overloads.length; i++) { - overloads.push({ - formats: queryResult.overloads[i].params, - }); - } - } else { - // no overloads, just add the main method definition - overloads.push({ - formats: queryResult.params || [], - }); - } // parse the parameter types for each overload - - var mapConstants = {}; - var maxParams = 0; - overloads.forEach(function (overload) { - var formats = overload.formats; - // keep a record of the maximum number of arguments - // this method requires. - if (maxParams < formats.length) { - maxParams = formats.length; - } // calculate the minimum number of arguments - // this overload requires. - - var minParams = formats.length; - while (minParams > 0 && formats[minParams - 1].optional) { - minParams--; - } - overload.minParams = minParams; - // loop through each parameter position, and parse its types - formats.forEach(function (format) { - // split this parameter's types - format.types = format.type.split("|").map(function ct(type) { - // array - if (type.slice(-2) === "[]") { - return { - name: type, - array: ct(type.slice(0, -2)), - }; - } - var lowerType = type.toLowerCase(); - // constant - if (lowerType === "constant") { - var constant; - if (mapConstants.hasOwnProperty(format.name)) { - constant = mapConstants[format.name]; - } else { - // parse possible constant values from description - var myRe = - /either\s+(?:[A-Z0-9_]+\s*,?\s*(?:or)?\s*)+/g; - var values = {}; - var names = []; - constant = mapConstants[format.name] = { - values: values, - names: names, - }; - var myArray = myRe.exec(format.description); - if (func === "endShape" && format.name === "mode") { - values[constants.CLOSE] = true; - names.push("CLOSE"); - } else { - var match = myArray[0]; - var reConst = /[A-Z0-9_]+/g; - var matchConst; - while ((matchConst = reConst.exec(match)) !== null) { - var name = matchConst[0]; - if (constants.hasOwnProperty(name)) { - values[constants[name]] = true; - names.push(name); - } - } - } - } - return { - name: type, - builtin: lowerType, - names: constant.names, - values: constant.values, - }; - } // function - - if (lowerType.slice(0, "function".length) === "function") { - lowerType = "function"; - } // builtin - - if (builtinTypes.has(lowerType)) { - return { - name: type, - builtin: lowerType, - }; - } // find type's prototype - - var t = window; - var typeParts = type.split("."); - // special-case 'p5' since it may be non-global - if (typeParts[0] === "p5") { - t = _main.default; - typeParts.shift(); - } - typeParts.forEach(function (p) { - t = t && t[p]; - }); - if (t) { - return { - name: type, - prototype: t, - }; - } - return { - name: type, - type: lowerType, - }; - }); - }); - }); - return { - overloads: overloads, - maxParams: maxParams, - }; - }; - /** - * Checks whether input type is Number - * This is a helper function for validateParameters() - * @method isNumber - * @private - * - * @returns {Boolean} a boolean indicating whether input type is Number - */ - var isNumber = function isNumber(param) { - if (isNaN(parseFloat(param))) return false; - switch (_typeof(param)) { - case "number": - return true; - case "string": - return !isNaN(param); - default: - return false; - } - }; - /** - * Test type for non-object type parameter validation - * @method testParamType - * @private - */ - var testParamType = function testParamType(param, type) { - var isArray = param instanceof Array; - var matches = true; - if (type.array && isArray) { - for (var i = 0; i < param.length; i++) { - var error = testParamType(param[i], type.array); - if (error) return error / 2; // half error for elements - } - } else if (type.prototype) { - matches = param instanceof type.prototype; - } else if (type.builtin) { - switch (type.builtin) { - case "number": - matches = isNumber(param); - break; - case "integer": - matches = - isNumber(param) && Number(param) === Math.floor(param); - break; - case "boolean": - case "any": - matches = true; - break; - case "array": - matches = isArray; - break; - case "string": - matches = - /*typeof param === 'number' ||*/ typeof param === - "string"; - break; - case "constant": - matches = type.values.hasOwnProperty(param); - break; - case "function": - matches = param instanceof Function; - break; - case "null": - matches = param === null; - break; - } - } else { - matches = _typeof(param) === type.t; - } - return matches ? 0 : 1; - }; - /** - * Test type for multiple parameters - * @method testParamTypes - * @private - */ - var testParamTypes = function testParamTypes(param, types) { - var minScore = 9999; - for (var i = 0; minScore > 0 && i < types.length; i++) { - var score = testParamType(param, types[i]); - if (minScore > score) minScore = score; - } - return minScore; - }; - /** - * generate a score (higher is worse) for applying these args to - * this overload. - * @method scoreOverload - * @private - */ - var scoreOverload = function scoreOverload( - args, - argCount, - overload, - minScore, - ) { - var score = 0; - var formats = overload.formats; - var minParams = overload.minParams; - // check for too few/many args - // the score is double number of extra/missing args - if (argCount < minParams) { - score = (minParams - argCount) * 2; - } else if (argCount > formats.length) { - score = (argCount - formats.length) * 2; - } // loop through the formats, adding up the error score for each arg. - // quit early if the score gets higher than the previous best overload. - - for (var p = 0; score <= minScore && p < formats.length; p++) { - var arg = args[p]; - var format = formats[p]; - // '== null' checks for 'null' and typeof 'undefined' - if (arg == null) { - // handle undefined args - if (!format.optional || p < minParams || p < argCount) { - score += 1; - } - } else { - score += testParamTypes(arg, format.types); - } - } - return score; - }; - /** - * Gets a list of errors for this overload - * @method getOverloadErrors - * @private - */ - var getOverloadErrors = function getOverloadErrors( - args, - argCount, - overload, - ) { - var formats = overload.formats; - var minParams = overload.minParams; - // check for too few/many args - if (argCount < minParams) { - return [ - { - type: "TOO_FEW_ARGUMENTS", - argCount: argCount, - minParams: minParams, - }, - ]; - } else if (argCount > formats.length) { - return [ - { - type: "TOO_MANY_ARGUMENTS", - argCount: argCount, - maxParams: formats.length, - }, - ]; - } - var errorArray = []; - for (var p = 0; p < formats.length; p++) { - var arg = args[p]; - var format = formats[p]; - // '== null' checks for 'null' and typeof 'undefined' - if (arg == null) { - // handle undefined args - if (!format.optional || p < minParams || p < argCount) { - errorArray.push({ - type: "EMPTY_VAR", - position: p, - format: format, - }); - } - } else if (testParamTypes(arg, format.types) > 0) { - errorArray.push({ - type: "WRONG_TYPE", - position: p, - format: format, - arg: arg, - }); - } - } - return errorArray; - }; - /** - * a custom error type, used by the mocha - * tests when expecting validation errors - * @method ValidationError - * @private - */ - _main.default.ValidationError = (function (name) { - var err = /*#__PURE__*/ (function (_Error) { - _inherits(err, _Error); - var _super = _createSuper(err); - function err(message, func, type) { - var _this; - _classCallCheck(this, err); - _this = _super.call(this); - _this.message = message; - _this.func = func; - _this.type = type; - if ("captureStackTrace" in Error) - Error.captureStackTrace(_assertThisInitialized(_this), err); - else _this.stack = new Error().stack; - return _this; - } - return err; - })(/*#__PURE__*/ _wrapNativeSuper(Error)); - err.prototype.name = name; - return err; - })("ValidationError"); - /** - * Prints a friendly msg after parameter validation - * @method _friendlyParamError - * @private - */ - _main.default._friendlyParamError = function (errorObj, func) { - var message; - var translationObj; - function formatType() { - var format = errorObj.format; - return format.types - .map(function (type) { - return type.names ? type.names.join("|") : type.name; - }) - .join("|"); - } - switch (errorObj.type) { - case "EMPTY_VAR": { - translationObj = { - func: func, - formatType: formatType(), - // It needs to be this way for i18next-extract to work. The comment - // specifies the values that the context can take so that it can - // statically prepare the translation files with them. - /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ - position: (0, _internationalization.translator)( - "fes.positions.p", - { - context: (errorObj.position + 1).toString(), - defaultValue: (errorObj.position + 1).toString(), - }, - ), - url: "https://p5js.org/examples/data-variable-scope.html", - }; - break; - } - case "WRONG_TYPE": { - var arg = errorObj.arg; - var argType = - arg instanceof Array - ? "array" - : arg === null - ? "null" - : arg === undefined - ? "undefined" - : typeof arg === "number" && isNaN(arg) - ? "NaN" - : arg.name || _typeof(arg); - translationObj = { - func: func, - formatType: formatType(), - argType: argType, - /* i18next-extract-mark-context-next-line ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] */ - position: (0, _internationalization.translator)( - "fes.positions.p", - { - context: (errorObj.position + 1).toString(), - defaultValue: (errorObj.position + 1).toString(), - }, - ), - }; - break; - } - case "TOO_FEW_ARGUMENTS": { - translationObj = { - func: func, - minParams: errorObj.minParams, - argCount: errorObj.argCount, - }; - break; - } - case "TOO_MANY_ARGUMENTS": { - translationObj = { - func: func, - maxParams: errorObj.maxParams, - argCount: errorObj.argCount, - }; - break; - } - } - if (translationObj) { - try { - // const re = /Function\.validateParameters.*[\r\n].*[\r\n].*\(([^)]*)/; - var myError = new Error(); - var parsed = _main.default - ._getErrorStackParser() - .parse(myError); - if ( - parsed[3] && - parsed[3].functionName && - parsed[3].functionName.includes(".") && - _main.default.prototype[ - parsed[3].functionName.split(".").slice(-1)[0] - ] - ) { - return; - } - if (_main.default._throwValidationErrors) { - throw new _main.default.ValidationError( - message, - func, - errorObj.type, - ); - } // try to extract the location from where the function was called - - if ( - parsed[3] && - parsed[3].fileName && - parsed[3].lineNumber && - parsed[3].columnNumber - ) { - var location = "" - .concat(parsed[3].fileName, ":") - .concat(parsed[3].lineNumber, ":") - .concat(parsed[3].columnNumber); - translationObj.location = (0, - _internationalization.translator)("fes.location", { - location: location, - // for e.g. get "sketch.js" from "https://example.com/abc/sketch.js" - file: parsed[3].fileName.split("/").slice(-1), - line: parsed[3].lineNumber, - }); - // tell fesErrorMonitor that we have already given a friendly message - // for this line, so it need not to do the same in case of an error - _main.default._fesLogCache[location] = true; - } - } catch (err) { - if (err instanceof _main.default.ValidationError) { - throw err; - } - } - translationObj.context = errorObj.type; - // i18next-extract-mark-context-next-line ["EMPTY_VAR", "TOO_MANY_ARGUMENTS", "TOO_FEW_ARGUMENTS", "WRONG_TYPE"] - message = (0, _internationalization.translator)( - "fes.friendlyParamError.type", - translationObj, - ); - _main.default._friendlyError("".concat(message), func, 3); - } - }; - /** - * Clears cache to avoid having multiple FES messages for the same set of - * parameters. - * - * If a function is called with some set of wrong arguments, and then called - * again with the same set of arguments, the messages due to the second call - * will be supressed. If two tests test on the same wrong arguments, the - * second test won't see the validationError. clearing argumentTree solves it - * - * @method _clearValidateParamsCache - * @private - */ - _main.default._clearValidateParamsCache = - function clearValidateParamsCache() { - for ( - var _i2 = 0, _Object$keys2 = Object.keys(argumentTree); - _i2 < _Object$keys2.length; - _i2++ - ) { - var _key4 = _Object$keys2[_i2]; - delete argumentTree[_key4]; - } - }; - // allowing access to argumentTree for testing - _main.default._getValidateParamsArgTree = - function getValidateParamsArgTree() { - return argumentTree; - }; - /** - * Runs parameter validation by matching the input parameters with information - * from `docs/reference/data.json`. - * Generates and prints a friendly error message using key: - * "fes.friendlyParamError.[*]". - * - * @method _validateParameters - * @private - * @param {String} func Name of the function - * @param {Array} args User input arguments - * - * @example: - * const a; - * ellipse(10,10,a,5); - * console output: - * "It looks like ellipse received an empty variable in spot #2." - * - * @example: - * ellipse(10,"foo",5,5); - * console output: - * "ellipse was expecting a number for parameter #1, - * received "foo" instead." - */ - _main.default._validateParameters = function validateParameters( - func, - args, - ) { - if (_main.default.disableFriendlyErrors) { - return; // skip FES - } // query / build the argument type tree and check if this sequence - // has already been seen before. - - var obj = buildArgTypeCache(func, args); - if (obj.seen) { - return; - } // mark this sequence as seen - - obj.seen = true; - // lookup the docs in the 'data.json' file - var docs = - docCache[func] || (docCache[func] = lookupParamDoc(func)); - var overloads = docs.overloads; - var argCount = args.length; - // the following line ignores trailing undefined arguments, commenting - // it to resolve https://github.com/processing/p5.js/issues/4571 - // '== null' checks for 'null' and typeof 'undefined' - // while (argCount > 0 && args[argCount - 1] == null) argCount--; - // find the overload with the best score - var minScore = 99999; - var minOverload; - for (var i = 0; i < overloads.length; i++) { - var score = scoreOverload( - args, - argCount, - overloads[i], - minScore, - ); - if (score === 0) { - return; // done! - } else if (minScore > score) { - // this score is better that what we have so far... - minScore = score; - minOverload = i; - } - } // this should _always_ be true here... - - if (minScore > 0) { - // get the errors for the best overload - var errorArray = getOverloadErrors( - args, - argCount, - overloads[minOverload], - ); - // generate err msg - for (var n = 0; n < errorArray.length; n++) { - _main.default._friendlyParamError(errorArray[n], func); - } - } - }; - _main.default.prototype._validateParameters = - _main.default.validateParameters; - } - var _default = _main.default; - exports.default = _default; - }, - { - "../../../docs/parameterData.json": 1, - "../constants": 286, - "../internationalization": 296, - "../main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.last-index-of": 181, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.map": 187, - "core-js/modules/es.number.constructor": 191, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.set": 207, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 294: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var constants = _interopRequireWildcard(_dereq_("./constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } /** - * @requires constants - */ - - function modeAdjust(a, b, c, d, mode) { - if (mode === constants.CORNER) { - return { - x: a, - y: b, - w: c, - h: d, - }; - } else if (mode === constants.CORNERS) { - return { - x: a, - y: b, - w: c - a, - h: d - b, - }; - } else if (mode === constants.RADIUS) { - return { - x: a - c, - y: b - d, - w: 2 * c, - h: 2 * d, - }; - } else if (mode === constants.CENTER) { - return { - x: a - c * 0.5, - y: b - d * 0.5, - w: c, - h: d, - }; - } - } - var _default = { - modeAdjust: modeAdjust, - }; - exports.default = _default; - }, - { - "./constants": 286, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 295: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - var _main = _interopRequireDefault(_dereq_("../core/main")); - var _internationalization = _dereq_("./internationalization"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * _globalInit - * - * TODO: ??? - * if sketch is on window - * assume "global" mode - * and instantiate p5 automatically - * otherwise do nothing - * - * @private - * @return {Undefined} - */ - - var _globalInit = function _globalInit() { - // Could have been any property defined within the p5 constructor. - // If that property is already a part of the global object, - // this code has already run before, likely due to a duplicate import - if (typeof window._setupDone !== "undefined") { - console.warn( - "p5.js seems to have been imported multiple times. Please remove the duplicate import", - ); - return; - } - if (!window.mocha) { - // If there is a setup or draw function on the window - // then instantiate p5 in "global" mode - if ( - ((window.setup && typeof window.setup === "function") || - (window.draw && typeof window.draw === "function")) && - !_main.default.instance - ) { - new _main.default(); - } - } - }; - // make a promise that resolves when the document is ready - var waitForDocumentReady = function waitForDocumentReady() { - return new Promise(function (resolve, reject) { - // if the page is ready, initialize p5 immediately - if (document.readyState === "complete") { - resolve(); - // if the page is still loading, add an event listener - // and initialize p5 as soon as it finishes loading - } else { - window.addEventListener("load", resolve, false); - } - }); - }; - // only load translations if we're using the full, un-minified library - var waitingForTranslator = - typeof IS_MINIFIED === "undefined" - ? (0, _internationalization.initialize)() - : Promise.resolve(); - Promise.all([waitForDocumentReady(), waitingForTranslator]).then( - _globalInit, - ); - }, - { - "../core/main": 298, - "./internationalization": 296, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.promise": 201, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 296: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.setTranslatorLanguage = - exports.currentTranslatorLanguage = - exports.availableTranslatorLanguages = - exports.initialize = - exports.translator = - void 0; - var _i18next = _interopRequireDefault(_dereq_("i18next")); - var _i18nextBrowserLanguagedetector = _interopRequireDefault( - _dereq_("i18next-browser-languagedetector"), - ); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - var fallbackResources, languages; - if (typeof IS_MINIFIED === "undefined") { - // internationalization is only for the unminified build - var translationsModule = _dereq_("../../translations"); - fallbackResources = translationsModule.default; - languages = translationsModule.languages; - if (typeof P5_DEV_BUILD !== "undefined") { - // When the library is built in development mode ( using npm run dev ) - // we want to use the current translation files on the disk, which may have - // been updated but not yet pushed to the CDN. - var completeResources = _dereq_("../../translations/dev"); - for ( - var _i = 0, _Object$keys = Object.keys(completeResources); - _i < _Object$keys.length; - _i++ - ) { - var language = _Object$keys[_i]; - // In es_translation, language is es and namespace is translation - // In es_MX_translation, language is es-MX and namespace is translation - var parts = language.split("_"); - var lng = parts.slice(0, parts.length - 1).join("-"); - var ns = parts[parts.length - 1]; - fallbackResources[lng] = fallbackResources[lng] || {}; - fallbackResources[lng][ns] = completeResources[language]; - } - } - } /** - * This is our i18next "backend" plugin. It tries to fetch languages - * from a CDN. - */ - - var FetchResources = /*#__PURE__*/ (function () { - function FetchResources(services, options) { - _classCallCheck(this, FetchResources); - this.init(services, options); - } // run fetch with a timeout. Automatically rejects on timeout - // default timeout = 2000 ms - - _createClass(FetchResources, [ - { - key: "fetchWithTimeout", - value: function fetchWithTimeout(url, options) { - var timeout = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 2000; - return Promise.race([ - fetch(url, options), - new Promise(function (_, reject) { - return setTimeout(function () { - return reject(new Error("timeout")); - }, timeout); - }), - ]); - }, - }, - { - key: "init", - value: function init(services) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - this.services = services; - this.options = options; - }, - }, - { - key: "read", - value: function read(language, namespace, callback) { - var loadPath = this.options.loadPath; - if (language === this.options.fallback) { - // if the default language of the user is the same as our inbuilt fallback, - // there's no need to fetch resources from the cdn. This won't actually - // need to run when we use "partialBundledLanguages" in the init - // function. - callback(null, fallbackResources[language][namespace]); - } else if (languages.includes(language)) { - // The user's language is included in the list of languages - // that we so far added translations for. - var url = this.services.interpolator.interpolate(loadPath, { - lng: language, - ns: namespace, - }); - this.loadUrl(url, callback); - } else { - // We don't have translations for this language. i18next will use - // the default language instead. - callback("Not found", false); - } - }, - }, - { - key: "loadUrl", - value: function loadUrl(url, callback) { - this.fetchWithTimeout(url) - .then( - function (response) { - var ok = response.ok; - if (!ok) { - // caught in the catch() below - throw new Error("failed loading ".concat(url)); - } - return response.json(); - }, - function () { - // caught in the catch() below - throw new Error("failed loading ".concat(url)); - }, - ) - .then(function (data) { - return callback(null, data); - }) - .catch(callback); - }, - }, - ]); - return FetchResources; - })(); - FetchResources.type = "backend"; - /** - * This is our translation function. Give it a key and - * it will retrieve the appropriate string - * (within supported languages) according to the - * user's browser's language settings. - * @function translator - * @param {String} key a key that corresponds to a message in our translation files - * @param {Object} values values for use in the message under the given `key` - * @returns {String} message (with values inserted) in the user's browser language - * @private - */ - var translator = function translator(key, values) { - console.debug( - "p5.js translator called before translations were loaded", - ); - // Certain FES functionality may trigger before translations are downloaded. - // Using "partialBundledLanguages" option during initialization, we can - // still use our fallback language to display messages - _i18next.default.t(key, values); /* i18next-extract-disable-line */ - }; - // (We'll set this to a real value in the init function below!) - /** - * Set up our translation function, with loaded languages - */ - exports.translator = translator; - var initialize = function initialize() { - var i18init = _i18next.default - .use(_i18nextBrowserLanguagedetector.default) - .use(FetchResources) - .init({ - fallbackLng: "en", - nestingPrefix: "$tr(", - nestingSuffix: ")", - defaultNS: "translation", - returnEmptyString: false, - interpolation: { - escapeValue: false, - }, - detection: { - checkWhitelist: false, - // prevent storing or locating language from cookie or localStorage - // more info on https://github.com/processing/p5.js/issues/4862 - order: [ - "querystring", - "navigator", - "htmlTag", - "path", - "subdomain", - ], - caches: [], - }, - backend: { - fallback: "en", - loadPath: - "https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json", - }, - partialBundledLanguages: true, - resources: fallbackResources, - }) - .then( - function (translateFn) { - exports.translator = translator = translateFn; - }, - function (e) { - return console.debug( - "Translations failed to load (".concat(e, ")"), - ); - }, - ); - // i18next.init() returns a promise that resolves when the translations - // are loaded. We use this in core/init.js to hold p5 initialization until - // we have the translation files. - return i18init; - }; - /** - * Returns a list of languages we have translations loaded for - */ - exports.initialize = initialize; - var availableTranslatorLanguages = - function availableTranslatorLanguages() { - return _i18next.default.languages; - }; - /** - * Returns the current language selected for translation - */ - exports.availableTranslatorLanguages = availableTranslatorLanguages; - var currentTranslatorLanguage = function currentTranslatorLanguage( - language, - ) { - return _i18next.default.language; - }; - /** - * Sets the current language for translation - * Returns a promise that resolved when loading is finished, - * or rejects if it fails. - */ - exports.currentTranslatorLanguage = currentTranslatorLanguage; - var setTranslatorLanguage = function setTranslatorLanguage(language) { - return _i18next.default.changeLanguage( - language || undefined, - function (e) { - return console.debug( - "Translations failed to load (".concat(e, ")"), - ); - }, - ); - }; - exports.setTranslatorLanguage = setTranslatorLanguage; - }, - { - "../../translations": 360, - "../../translations/dev": undefined, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.promise": 201, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.split": 216, - "core-js/modules/web.dom-collections.iterator": 256, - i18next: 267, - "i18next-browser-languagedetector": 264, - }, - ], - 297: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @for p5 - * @requires core - * These are functions that are part of the Processing API but are not part of - * the p5.js API. In some cases they have a new name, in others, they are - * removed completely. Not all unsupported Processing functions are listed here - * but we try to include ones that a user coming from Processing might likely - * call. - */ - - _main.default.prototype.pushStyle = function () { - throw new Error("pushStyle() not used, see push()"); - }; - _main.default.prototype.popStyle = function () { - throw new Error("popStyle() not used, see pop()"); - }; - _main.default.prototype.popMatrix = function () { - throw new Error("popMatrix() not used, see pop()"); - }; - _main.default.prototype.pushMatrix = function () { - throw new Error("pushMatrix() not used, see push()"); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "./main": 298, - }, - ], - 298: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-own-property-names"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.object.get-own-property-names"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - _dereq_("./shim"); - var constants = _interopRequireWildcard(_dereq_("./constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Structure - * @submodule Structure - * @for p5 - * @requires constants - */ - // Core needs the PVariables object - /** - * This is the p5 instance constructor. - * - * A p5 instance holds all the properties and methods related to - * a p5 sketch. It expects an incoming sketch closure and it can also - * take an optional node parameter for attaching the generated p5 canvas - * to a node. The sketch closure takes the newly created p5 instance as - * its sole argument and may optionally set preload(), - * setup(), and/or - * draw() properties on it for running a sketch. - * - * A p5 sketch can run in "global" or "instance" mode: - * "global" - all properties and methods are attached to the window - * "instance" - all properties and methods are bound to this p5 object - * - * @class p5 - * @constructor - * @param {function(p5)} sketch a closure that can set optional preload(), - * setup(), and/or draw() properties on the - * given p5 instance - * @param {HTMLElement} [node] element to attach canvas to - * @return {p5} a p5 instance - */ - - var p5 = /*#__PURE__*/ (function () { - function p5(sketch, node) { - var _this = this; - _classCallCheck(this, p5); - ////////////////////////////////////////////// - // PUBLIC p5 PROPERTIES AND METHODS - ////////////////////////////////////////////// - /** - * Called directly before setup(), the preload() function is used to handle - * asynchronous loading of external files in a blocking way. If a preload - * function is defined, setup() will wait until any load calls within have - * finished. Nothing besides load calls (loadImage, loadJSON, loadFont, - * loadStrings, etc.) should be inside the preload function. If asynchronous - * loading is preferred, the load methods can instead be called in setup() - * or anywhere else with the use of a callback parameter. - * - * By default the text "loading..." will be displayed. To make your own - * loading page, include an HTML element with id "p5_loading" in your - * page. More information here. - * - * @method preload - * @example - *
                                  - * let img; - * let c; - * function preload() { - * // preload() runs once - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * // setup() waits until preload() is done - * img.loadPixels(); - * // get color of middle pixel - * c = img.get(img.width / 2, img.height / 2); - * } - * - * function draw() { - * background(c); - * image(img, 25, 25, 50, 50); - * } - *
                                  - * - * @alt - * nothing displayed - * - */ - /** - * The setup() function is called once when the program starts. It's used to - * define initial environment properties such as screen size and background - * color and to load media such as images and fonts as the program starts. - * There can only be one setup() function for each program and it shouldn't - * be called again after its initial execution. - * - * Note: Variables declared within setup() are not accessible within other - * functions, including draw(). - * - * @method setup - * @example - *
                                  - * let a = 0; - * - * function setup() { - * background(0); - * noStroke(); - * fill(102); - * } - * - * function draw() { - * rect(a++ % width, 10, 2, 80); - * } - *
                                  - * - * @alt - * nothing displayed - * - */ - /** - * Called directly after setup(), the draw() function continuously executes - * the lines of code contained inside its block until the program is stopped - * or noLoop() is called. Note if noLoop() is called in setup(), draw() will - * still be executed once before stopping. draw() is called automatically and - * should never be called explicitly. - * - * It should always be controlled with noLoop(), redraw() and loop(). After - * noLoop() stops the code in draw() from executing, redraw() causes the - * code inside draw() to execute once, and loop() will cause the code - * inside draw() to resume executing continuously. - * - * The number of times draw() executes in each second may be controlled with - * the frameRate() function. - * - * There can only be one draw() function for each sketch, and draw() must - * exist if you want the code to run continuously, or to process events such - * as mousePressed(). Sometimes, you might have an empty call to draw() in - * your program, as shown in the above example. - * - * It is important to note that the drawing coordinate system will be reset - * at the beginning of each draw() call. If any transformations are performed - * within draw() (ex: scale, rotate, translate), their effects will be - * undone at the beginning of draw(), so transformations will not accumulate - * over time. On the other hand, styling applied (ex: fill, stroke, etc) will - * remain in effect. - * - * @method draw - * @example - *
                                  - * let yPos = 0; - * function setup() { - * // setup() runs once - * frameRate(30); - * } - * function draw() { - * // draw() loops forever, until stopped - * background(204); - * yPos = yPos - 1; - * if (yPos < 0) { - * yPos = height; - * } - * line(0, yPos, width, yPos); - * } - *
                                  - * - * @alt - * nothing displayed - * - */ - ////////////////////////////////////////////// - // PRIVATE p5 PROPERTIES AND METHODS - ////////////////////////////////////////////// - this._setupDone = false; - this._preloadDone = false; - // for handling hidpi - this._pixelDensity = Math.ceil(window.devicePixelRatio) || 1; - this._userNode = node; - this._curElement = null; - this._elements = []; - this._glAttributes = null; - this._requestAnimId = 0; - this._preloadCount = 0; - this._isGlobal = false; - this._loop = true; - this._startListener = null; - this._initializeInstanceVariables(); - this._defaultCanvasSize = { - width: 100, - height: 100, - }; - this._events = { - // keep track of user-events for unregistering later - mousemove: null, - mousedown: null, - mouseup: null, - dragend: null, - dragover: null, - click: null, - dblclick: null, - mouseover: null, - mouseout: null, - keydown: null, - keyup: null, - keypress: null, - touchstart: null, - touchmove: null, - touchend: null, - resize: null, - blur: null, - }; - this._millisStart = -1; - this._recording = false; - // States used in the custom random generators - this._lcg_random_state = null; - this._gaussian_previous = false; - this._events.wheel = null; - this._loadingScreenId = "p5_loading"; - // Allows methods to be registered on an instance that - // are instance-specific. - this._registeredMethods = {}; - var methods = Object.getOwnPropertyNames( - p5.prototype._registeredMethods, - ); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = methods[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var prop = _step.value; - this._registeredMethods[prop] = - p5.prototype._registeredMethods[prop].slice(); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - if (window.DeviceOrientationEvent) { - this._events.deviceorientation = null; - } - if (window.DeviceMotionEvent && !window._isNodeWebkit) { - this._events.devicemotion = null; - } // Function to invoke registered hooks before or after events such as preload, setup, and pre/post draw. - - p5.prototype.callRegisteredHooksFor = function (hookName) { - var target = this || p5.prototype; - var context = this._isGlobal ? window : this; - if (target._registeredMethods.hasOwnProperty(hookName)) { - var _methods = target._registeredMethods[hookName]; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = _methods[Symbol.iterator](), _step2; - !(_iteratorNormalCompletion2 = (_step2 = - _iterator2.next()).done); - _iteratorNormalCompletion2 = true - ) { - var method = _step2.value; - if (typeof method === "function") { - method.call(context); - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - } - }; - this._start = function () { - // Find node if id given - if (_this._userNode) { - if (typeof _this._userNode === "string") { - _this._userNode = document.getElementById(_this._userNode); - } - } - var context = _this._isGlobal ? window : _this; - if (context.preload) { - _this.callRegisteredHooksFor("beforePreload"); - // Setup loading screen - // Set loading screen into dom if not present - // Otherwise displays and removes user provided loading screen - var loadingScreen = document.getElementById( - _this._loadingScreenId, - ); - if (!loadingScreen) { - loadingScreen = document.createElement("div"); - loadingScreen.innerHTML = "Loading..."; - loadingScreen.style.position = "absolute"; - loadingScreen.id = _this._loadingScreenId; - var _node = _this._userNode || document.body; - _node.appendChild(loadingScreen); - } - var _methods2 = _this._preloadMethods; - for (var method in _methods2) { - // default to p5 if no object defined - _methods2[method] = _methods2[method] || p5; - var obj = _methods2[method]; - //it's p5, check if it's global or instance - if (obj === p5.prototype || obj === p5) { - if (_this._isGlobal) { - window[method] = _this._wrapPreload(_this, method); - } - obj = _this; - } - _this._registeredPreloadMethods[method] = obj[method]; - obj[method] = _this._wrapPreload(obj, method); - } - context.preload(); - _this._runIfPreloadsAreDone(); - } else { - _this._setup(); - if (!_this._recording) { - _this._draw(); - } - } - }; - this._runIfPreloadsAreDone = function () { - var context = this._isGlobal ? window : this; - if (context._preloadCount === 0) { - var loadingScreen = document.getElementById( - context._loadingScreenId, - ); - if (loadingScreen) { - loadingScreen.parentNode.removeChild(loadingScreen); - } - this.callRegisteredHooksFor("afterPreload"); - if (!this._setupDone) { - this._lastTargetFrameTime = window.performance.now(); - this._lastRealFrameTime = window.performance.now(); - context._setup(); - if (!this._recording) { - context._draw(); - } - } - } - }; - this._decrementPreload = function () { - var context = this._isGlobal ? window : this; - if ( - !context._preloadDone && - typeof context.preload === "function" - ) { - context._setProperty( - "_preloadCount", - context._preloadCount - 1, - ); - context._runIfPreloadsAreDone(); - } - }; - this._wrapPreload = function (obj, fnName) { - var _this2 = this; - return function () { - //increment counter - _this2._incrementPreload(); - //call original function - for ( - var _len = arguments.length, - args = new Array(_len), - _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - return _this2._registeredPreloadMethods[fnName].apply( - obj, - args, - ); - }; - }; - this._incrementPreload = function () { - var context = this._isGlobal ? window : this; - // Do nothing if we tried to increment preloads outside of `preload` - if (context._preloadDone) return; - context._setProperty( - "_preloadCount", - context._preloadCount + 1, - ); - }; - this._setup = function () { - _this.callRegisteredHooksFor("beforeSetup"); - // Always create a default canvas. - // Later on if the user calls createCanvas, this default one - // will be replaced - _this.createCanvas( - _this._defaultCanvasSize.width, - _this._defaultCanvasSize.height, - "p2d", - ); - // return preload functions to their normal vals if switched by preload - var context = _this._isGlobal ? window : _this; - if (typeof context.preload === "function") { - for (var f in _this._preloadMethods) { - context[f] = _this._preloadMethods[f][f]; - if (context[f] && _this) { - context[f] = context[f].bind(_this); - } - } - } // Record the time when sketch starts - - _this._millisStart = window.performance.now(); - context._preloadDone = true; - // Short-circuit on this, in case someone used the library in "global" - // mode earlier - if (typeof context.setup === "function") { - context.setup(); - } // unhide any hidden canvases that were created - - var canvases = document.getElementsByTagName("canvas"); - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = canvases[Symbol.iterator](), _step3; - !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) - .done); - _iteratorNormalCompletion3 = true - ) { - var k = _step3.value; - if (k.dataset.hidden === "true") { - k.style.visibility = ""; - delete k.dataset.hidden; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion3 && - _iterator3.return != null - ) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - _this._lastTargetFrameTime = window.performance.now(); - _this._lastRealFrameTime = window.performance.now(); - _this._setupDone = true; - if ( - _this._accessibleOutputs.grid || - _this._accessibleOutputs.text - ) { - _this._updateAccsOutput(); - } - _this.callRegisteredHooksFor("afterSetup"); - }; - this._draw = function () { - var now = window.performance.now(); - var time_since_last = now - _this._lastTargetFrameTime; - var target_time_between_frames = 1000 / _this._targetFrameRate; - // only draw if we really need to; don't overextend the browser. - // draw if we're within 5ms of when our next frame should paint - // (this will prevent us from giving up opportunities to draw - // again when it's really about time for us to do so). fixes an - // issue where the frameRate is too low if our refresh loop isn't - // in sync with the browser. note that we have to draw once even - // if looping is off, so we bypass the time delay if that - // is the case. - var epsilon = 5; - if ( - !_this._loop || - time_since_last >= target_time_between_frames - epsilon - ) { - //mandatory update values(matrixes and stack) - _this.deltaTime = now - _this._lastRealFrameTime; - _this._setProperty("deltaTime", _this.deltaTime); - _this._frameRate = 1000 / _this.deltaTime; - _this.redraw(); - _this._lastTargetFrameTime = Math.max( - _this._lastTargetFrameTime + target_time_between_frames, - now, - ); - _this._lastRealFrameTime = now; - // If the user is actually using mouse module, then update - // coordinates, otherwise skip. We can test this by simply - // checking if any of the mouse functions are available or not. - // NOTE : This reflects only in complete build or modular build. - if (typeof _this._updateMouseCoords !== "undefined") { - _this._updateMouseCoords(); - //reset delta values so they reset even if there is no mouse event to set them - // for example if the mouse is outside the screen - _this._setProperty("movedX", 0); - _this._setProperty("movedY", 0); - } - } // get notified the next time the browser gives us - // an opportunity to draw. - - if (_this._loop) { - _this._requestAnimId = window.requestAnimationFrame( - _this._draw, - ); - } - }; - this._setProperty = function (prop, value) { - _this[prop] = value; - if (_this._isGlobal) { - window[prop] = value; - } - }; - /** - * Removes the entire p5 sketch. This will remove the canvas and any - * elements created by p5.js. It will also stop the draw loop and unbind - * any properties or methods from the window global scope. It will - * leave a variable p5 in case you wanted to create a new p5 sketch. - * If you like, you can set p5 = null to erase it. While all functions and - * variables and objects created by the p5 library will be removed, any - * other global variables created by your code will remain. - * - * @method remove - * @example - *
                                  - * function draw() { - * ellipse(50, 50, 10, 10); - * } - * - * function mousePressed() { - * remove(); // remove whole sketch on mouse press - * } - *
                                  - * - * @alt - * nothing displayed - * - */ - this.remove = function () { - // Remove start listener to prevent orphan canvas being created - if (_this._startListener) { - window.removeEventListener( - "load", - _this._startListener, - false, - ); - } - var loadingScreen = document.getElementById( - _this._loadingScreenId, - ); - if (loadingScreen) { - loadingScreen.parentNode.removeChild(loadingScreen); - // Add 1 to preload counter to prevent the sketch ever executing setup() - _this._incrementPreload(); - } - if (_this._curElement) { - // stop draw - _this._loop = false; - if (_this._requestAnimId) { - window.cancelAnimationFrame(_this._requestAnimId); - } // unregister events sketch-wide - - for (var ev in _this._events) { - window.removeEventListener(ev, _this._events[ev]); - } // remove DOM elements created by p5, and listeners - - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for ( - var _iterator4 = _this._elements[Symbol.iterator](), - _step4; - !(_iteratorNormalCompletion4 = (_step4 = - _iterator4.next()).done); - _iteratorNormalCompletion4 = true - ) { - var e = _step4.value; - if (e.elt && e.elt.parentNode) { - e.elt.parentNode.removeChild(e.elt); - } - for (var elt_ev in e._events) { - e.elt.removeEventListener(elt_ev, e._events[elt_ev]); - } - } // call any registered remove functions - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion4 && - _iterator4.return != null - ) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - var self = _this; - _this._registeredMethods.remove.forEach(function (f) { - if (typeof f !== "undefined") { - f.call(self); - } - }); - } // remove window bound properties and methods - - if (_this._isGlobal) { - for (var p in p5.prototype) { - try { - delete window[p]; - } catch (x) { - window[p] = undefined; - } - } - for (var p2 in _this) { - if (_this.hasOwnProperty(p2)) { - try { - delete window[p2]; - } catch (x) { - window[p2] = undefined; - } - } - } - p5.instance = null; - } - }; - // call any registered init functions - this._registeredMethods.init.forEach(function (f) { - if (typeof f !== "undefined") { - f.call(this); - } - }, this); - // Set up promise preloads - this._setupPromisePreloads(); - var friendlyBindGlobal = - this._createFriendlyGlobalFunctionBinder(); - // If the user has created a global setup or draw function, - // assume "global" mode and make everything global (i.e. on the window) - if (!sketch) { - this._isGlobal = true; - p5.instance = this; - // Loop through methods on the prototype and attach them to the window - for (var p in p5.prototype) { - if (typeof p5.prototype[p] === "function") { - var ev = p.substring(2); - if (!this._events.hasOwnProperty(ev)) { - if ( - Math.hasOwnProperty(p) && - Math[p] === p5.prototype[p] - ) { - // Multiple p5 methods are just native Math functions. These can be - // called without any binding. - friendlyBindGlobal(p, p5.prototype[p]); - } else { - friendlyBindGlobal(p, p5.prototype[p].bind(this)); - } - } - } else { - friendlyBindGlobal(p, p5.prototype[p]); - } - } // Attach its properties to the window - - for (var p2 in this) { - if (this.hasOwnProperty(p2)) { - friendlyBindGlobal(p2, this[p2]); - } - } - } else { - // Else, the user has passed in a sketch closure that may set - // user-provided 'setup', 'draw', etc. properties on this instance of p5 - sketch(this); - // Run a check to see if the user has misspelled 'setup', 'draw', etc - // detects capitalization mistakes only ( Setup, SETUP, MouseClicked, etc) - p5._checkForUserDefinedFunctions(this); - } // Bind events to window (not using container div bc key events don't work) - - for (var e in this._events) { - var f = this["_on".concat(e)]; - if (f) { - var m = f.bind(this); - window.addEventListener(e, m, { - passive: false, - }); - this._events[e] = m; - } - } - var focusHandler = function focusHandler() { - _this._setProperty("focused", true); - }; - var blurHandler = function blurHandler() { - _this._setProperty("focused", false); - }; - window.addEventListener("focus", focusHandler); - window.addEventListener("blur", blurHandler); - this.registerMethod("remove", function () { - window.removeEventListener("focus", focusHandler); - window.removeEventListener("blur", blurHandler); - }); - if (document.readyState === "complete") { - this._start(); - } else { - this._startListener = this._start.bind(this); - window.addEventListener("load", this._startListener, false); - } - } - _createClass(p5, [ - { - key: "_initializeInstanceVariables", - value: function _initializeInstanceVariables() { - this._accessibleOutputs = { - text: false, - grid: false, - textLabel: false, - gridLabel: false, - }; - this._styles = []; - this._bezierDetail = 20; - this._curveDetail = 20; - this._colorMode = constants.RGB; - this._colorMaxes = { - rgb: [255, 255, 255, 255], - hsb: [360, 100, 100, 1], - hsl: [360, 100, 100, 1], - }; - this._downKeys = {}; //Holds the key codes of currently pressed keys - }, - }, - { - key: "registerPreloadMethod", - value: function registerPreloadMethod(fnString, obj) { - // obj = obj || p5.prototype; - if (!p5.prototype._preloadMethods.hasOwnProperty(fnString)) { - p5.prototype._preloadMethods[fnString] = obj; - } - }, - }, - { - key: "registerMethod", - value: function registerMethod(name, m) { - var target = this || p5.prototype; - if (!target._registeredMethods.hasOwnProperty(name)) { - target._registeredMethods[name] = []; - } - target._registeredMethods[name].push(m); - }, - }, - { - key: "unregisterMethod", - value: function unregisterMethod(name, m) { - var target = this || p5.prototype; - if (target._registeredMethods.hasOwnProperty(name)) { - var methods = target._registeredMethods[name]; - var indexesToRemove = []; - // Find all indexes of the method `m` in the array of registered methods - for (var i = 0; i < methods.length; i++) { - if (methods[i] === m) { - indexesToRemove.push(i); - } - } // Remove all instances of the method `m` from the array - - for (var _i = indexesToRemove.length - 1; _i >= 0; _i--) { - methods.splice(indexesToRemove[_i], 1); - } - } - }, // create a function which provides a standardized process for binding - // globals; this is implemented as a factory primarily so that there's a - // way to redefine what "global" means for the binding function so it - // can be used in scenarios like unit testing where the window object - // might not exist - }, - { - key: "_createFriendlyGlobalFunctionBinder", - value: function _createFriendlyGlobalFunctionBinder() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - var globalObject = options.globalObject || window; - var log = options.log || console.log.bind(console); - var propsToForciblyOverwrite = { - // p5.print actually always overwrites an existing global function, - // albeit one that is very unlikely to be used: - // - // https://developer.mozilla.org/en-US/docs/Web/API/Window/print - print: true, - }; - return function (prop, value) { - if ( - !p5.disableFriendlyErrors && - typeof IS_MINIFIED === "undefined" && - typeof value === "function" && - !(prop in p5.prototype._preloadMethods) - ) { - try { - // Because p5 has so many common function names, it's likely - // that users may accidentally overwrite global p5 functions with - // their own variables. Let's allow this but log a warning to - // help users who may be doing this unintentionally. - // - // For more information, see: - // - // https://github.com/processing/p5.js/issues/1317 - if ( - prop in globalObject && - !(prop in propsToForciblyOverwrite) - ) { - throw new Error( - 'global "'.concat(prop, '" already exists'), - ); - } // It's possible that this might throw an error because there - // are a lot of edge-cases in which `Object.defineProperty` might - // not succeed; since this functionality is only intended to - // help beginners anyways, we'll just catch such an exception - // if it occurs, and fall back to legacy behavior. - - Object.defineProperty(globalObject, prop, { - configurable: true, - enumerable: true, - get: function get() { - return value; - }, - set: function set(newValue) { - Object.defineProperty(globalObject, prop, { - configurable: true, - enumerable: true, - value: newValue, - writable: true, - }); - log( - 'You just changed the value of "'.concat( - prop, - "\", which was a p5 function. This could cause problems later if you're not careful.", - ), - ); - }, - }); - } catch (e) { - var message = - 'p5 had problems creating the global function "'.concat( - prop, - '", possibly because your code is already using that name as a variable. You may want to rename your variable to something else.', - ); - p5._friendlyError(message, prop); - globalObject[prop] = value; - } - } else { - globalObject[prop] = value; - } - }; - }, - }, - ]); - return p5; - })(); // This is a pointer to our global mode p5 instance, if we're in - // global mode. - p5.instance = null; - /** - * Turn off some features of the friendly error system (FES), which can give - * a significant boost to performance when needed. - * - * Note that this will disable the parts of the FES that cause performance - * slowdown (like argument checking). Friendly errors that have no performance - * cost (like giving a descriptive error if a file load fails, or warning you - * if you try to override p5.js functions in the global space), - * will remain in place. - * - * See - * disabling the friendly error system. - * - * @property {Boolean} disableFriendlyErrors - * @example - *
                                  - * p5.disableFriendlyErrors = true; - * - * function setup() { - * createCanvas(100, 50); - * } - *
                                  - */ - p5.disableFriendlyErrors = false; - // attach constants to p5 prototype - for (var k in constants) { - p5.prototype[k] = constants[k]; - } // makes the `VERSION` constant available on the p5 object - // in instance mode, even if it hasn't been instantiated yet - - p5.VERSION = constants.VERSION; - // functions that cause preload to wait - // more can be added by using registerPreloadMethod(func) - p5.prototype._preloadMethods = { - loadJSON: p5.prototype, - loadImage: p5.prototype, - loadStrings: p5.prototype, - loadXML: p5.prototype, - loadBytes: p5.prototype, - loadTable: p5.prototype, - loadFont: p5.prototype, - loadModel: p5.prototype, - loadShader: p5.prototype, - }; - p5.prototype._registeredMethods = { - init: [], - pre: [], - post: [], - remove: [], - }; - p5.prototype._registeredPreloadMethods = {}; - var _default = p5; - exports.default = _default; - }, - { - "./constants": 286, - "./shim": 309, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-own-property-names": 197, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 299: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module DOM - * @submodule DOM - * @for p5.Element - */ - /** - * A class to describe an - * HTML element. - * Sketches can use many elements. Common elements include the drawing canvas, - * buttons, sliders, webcam feeds, and so on. - * - * All elements share the methods of the `p5.Element` class. They're created - * with functions such as createCanvas() and - * createButton(). - * - * @class p5.Element - * @constructor - * @param {HTMLElement} elt wrapped DOM element. - * @param {p5} [pInst] pointer to p5 instance. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * - * background(200); - * - * // Create a button element and - * // place it beneath the canvas. - * let btn = createButton('change'); - * btn.position(0, 100); - * - * // Call randomColor() when - * // the button is pressed. - * btn.mousePressed(randomColor); - * - * describe('A gray square with a button that says "change" beneath it. The square changes color when the user presses the button.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - */ - - _main.default.Element = /*#__PURE__*/ (function () { - function _class(elt, pInst) { - _classCallCheck(this, _class); - /** - * Underlying - * HTMLElement - * object. Its properties and methods can be used directly. - * - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Set the border style for the - * // canvas. - * cnv.elt.style.border = '5px dashed deeppink'; - * - * describe('A gray square with a pink border drawn with dashed lines.'); - * } - * - *
                                  - * - * @property elt - * @name elt - * @readOnly - */ - this.elt = elt; - /** - * @private - * @type {p5.Element} - * @name _pInst - */ - this._pInst = this._pixelsState = pInst; - this._events = {}; - /** - * @type {Number} - * @property width - * @name width - */ - this.width = this.elt.offsetWidth; - /** - * @type {Number} - * @property height - * @name height - */ - this.height = this.elt.offsetHeight; - } /** - * Attaches this element to a parent element. - * - * For example, a `<div></div>` element may be used as a box to - * hold two pieces of text, a header and a paragraph. The - * `<div></div>` is the parent element of both the header and - * paragraph. - * - * The parameter `parent` can have one of three types. `parent` can be a - * string with the parent element's ID, as in - * `myElement.parent('container')`. It can also be another - * p5.Element object, as in - * `myElement.parent(myDiv)`. Finally, `parent` can be an `HTMLElement` - * object, as in `myElement.parent(anotherElement)`. - * - * Calling `myElement.parent()` without an argument returns this element's - * parent. - * - * @method parent - * @param {String|p5.Element|Object} parent ID, p5.Element, - * or HTMLElement of desired parent element. - * @chainable - * - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a div element. - * let div = createDiv(); - * // Place the div in the top-left corner. - * div.position(10, 20); - * // Set its width and height. - * div.size(80, 60); - * // Set its background color to white - * div.style('background-color', 'white'); - * // Align any text to the center. - * div.style('text-align', 'center'); - * // Set its ID to "container". - * div.id('container'); - * - * // Create a paragraph element. - * let p = createP('p5*js'); - * // Make the div its parent - * // using its ID "container". - * p.parent('container'); - * - * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create rectangular div element. - * let div = createDiv(); - * // Place the div in the top-left corner. - * div.position(10, 20); - * // Set its width and height. - * div.size(80, 60); - * // Set its background color and align - * // any text to the center. - * div.style('background-color', 'white'); - * div.style('text-align', 'center'); - * - * // Create a paragraph element. - * let p = createP('p5*js'); - * // Make the div its parent. - * p.parent(div); - * - * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create rectangular div element. - * let div = createDiv(); - * // Place the div in the top-left corner. - * div.position(10, 20); - * // Set its width and height. - * div.size(80, 60); - * // Set its background color and align - * // any text to the center. - * div.style('background-color', 'white'); - * div.style('text-align', 'center'); - * - * // Create a paragraph element. - * let p = createP('p5*js'); - * // Make the div its parent - * // using the underlying - * // HTMLElement. - * p.parent(div.elt); - * - * describe('The text "p5*js" written in black at the center of a white rectangle. The rectangle is inside a gray square.'); - * } - * - *
                                  - */ - /** - * @method parent - * @return {p5.Element} - */ - - _createClass( - _class, - [ - { - key: "parent", - value: function parent(p) { - if (typeof p === "undefined") { - return this.elt.parentNode; - } - if (typeof p === "string") { - if (p[0] === "#") { - p = p.substring(1); - } - p = document.getElementById(p); - } else if (p instanceof _main.default.Element) { - p = p.elt; - } - p.appendChild(this.elt); - return this; - } /** - * Sets this element's ID using a given string. - * - * Calling `myElement.id()` without an argument returns its ID as a string. - * - * @method id - * @param {String} id ID of the element. - * @chainable - * - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Set the canvas' ID - * // to "mycanvas". - * cnv.id('mycanvas'); - * - * // Get the canvas' ID. - * let id = cnv.id(); - * text(id, 24, 54); - * - * describe('The text "mycanvas" written in black on a gray background.'); - * } - * - *
                                  - */, - /** - * @method id - * @return {String} ID of the element. - */ - }, - { - key: "id", - value: function id(_id) { - if (typeof _id === "undefined") { - return this.elt.id; - } - this.elt.id = _id; - this.width = this.elt.offsetWidth; - this.height = this.elt.offsetHeight; - return this; - } /** - * Adds a - * class attribute - * to the element. - * - * Calling `myElement.class()` without an argument returns a string with its current classes. - * - * @method class - * @param {String} class class to add. - * @chainable - * - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Add the class "small" to the - * // canvas element. - * cnv.class('small'); - * - * // Get the canvas element's class - * // and display it. - * let c = cnv.class(); - * text(c, 35, 54); - * - * describe('The word "small" written in black on a gray canvas.'); - * - * } - * - *
                                  - */, - /** - * @method class - * @return {String} element's classes, if any. - */ - }, - { - key: "class", - value: function _class(c) { - if (typeof c === "undefined") { - return this.elt.className; - } - this.elt.className = c; - return this; - } /** - * Calls a function when the mouse is pressed over the element. - * Calling `myElement.mousePressed(false)` disables the function. - * - * Note: Some mobile browsers may also trigger this event when the element - * receives a quick tap. - * - * @method mousePressed - * @param {Function|Boolean} fxn function to call when the mouse is - * pressed over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the canvas - * // is pressed. - * cnv.mousePressed(randomColor); - * - * describe('A gray square changes color when the mouse is pressed.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the canvas is pressed. - * cnv.mousePressed(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse is pressed.'); - * } - * - *
                                  - */, - }, - { - key: "mousePressed", - value: function mousePressed(fxn) { - // Prepend the mouse property setters to the event-listener. - // This is required so that mouseButton is set correctly prior to calling the callback (fxn). - // For details, see https://github.com/processing/p5.js/issues/3087. - var eventPrependedFxn = function eventPrependedFxn(event) { - this._pInst._setProperty("mouseIsPressed", true); - this._pInst._setMouseButton(event); - // Pass along the return-value of the callback: - return fxn.call(this, event); - }; - // Pass along the event-prepended form of the callback. - _main.default.Element._adjustListener( - "mousedown", - eventPrependedFxn, - this, - ); - return this; - } /** - * Calls a function when the mouse is pressed twice over the element. - * Calling `myElement.doubleClicked(false)` disables the function. - * - * @method doubleClicked - * @param {Function|Boolean} fxn function to call when the mouse is - * double clicked over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // canvas is double-clicked. - * cnv.doubleClicked(randomColor); - * - * describe('A gray square changes color when the user double-clicks the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the canvas is double-clicked. - * cnv.doubleClicked(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user double-clicks the canvas.'); - * } - * - *
                                  - */, - }, - { - key: "doubleClicked", - value: function doubleClicked(fxn) { - _main.default.Element._adjustListener( - "dblclick", - fxn, - this, - ); - return this; - } /** - * Calls a function when the mouse wheel scrolls over th element. - * - * The callback function, `fxn`, is passed an `event` object. `event` has - * two numeric properties, `deltaY` and `deltaX`. `event.deltaY` is - * negative if the mouse wheel rotates away from the user. It's positive if - * the mouse wheel rotates toward the user. `event.deltaX` is positive if - * the mouse wheel moves to the right. It's negative if the mouse wheel moves - * to the left. - * - * Calling `myElement.mouseWheel(false)` disables the function. - * - * @method mouseWheel - * @param {Function|Boolean} fxn function to call when the mouse wheel is - * scrolled over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse wheel moves. - * cnv.mouseWheel(randomColor); - * - * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse wheel moves. - * cnv.mouseWheel(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user scrolls the mouse wheel over the canvas.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call changeBackground() when the - * // mouse wheel moves. - * cnv.mouseWheel(changeBackground); - * - * describe('A gray square. When the mouse wheel scrolls over the square, it changes color and displays shapes.'); - * } - * - * function changeBackground(event) { - * // Change the background color - * // based on deltaY. - * if (event.deltaY > 0) { - * background('deeppink'); - * } else if (event.deltaY < 0) { - * background('cornflowerblue'); - * } else { - * background(200); - * } - * - * // Draw a shape based on deltaX. - * if (event.deltaX > 0) { - * circle(50, 50, 20); - * } else if (event.deltaX < 0) { - * square(40, 40, 20); - * } - * } - * - *
                                  - */, - }, - { - key: "mouseWheel", - value: function mouseWheel(fxn) { - _main.default.Element._adjustListener("wheel", fxn, this); - return this; - } /** - * Calls a function when the mouse is released over the element. Calling - * `myElement.mouseReleased(false)` disables the function. - * - * Note: Some mobile browsers may also trigger this event when the element - * receives a quick tap. - * - * @method mouseReleased - * @param {Function|Boolean} fxn function to call when the mouse is - * pressed over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when a - * // mouse press ends. - * cnv.mouseReleased(randomColor); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when a mouse press ends. - * cnv.mouseReleased(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - *
                                  - */, - }, - { - key: "mouseReleased", - value: function mouseReleased(fxn) { - _main.default.Element._adjustListener("mouseup", fxn, this); - return this; - } /** - * Calls a function when the mouse is pressed and released over the element. - * Calling `myElement.mouseReleased(false)` disables the function. - * - * Note: Some mobile browsers may also trigger this event when the element - * receives a quick tap. - * - * @method mouseClicked - * @param {Function|Boolean} fxn function to call when the mouse is - * pressed and released over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when a - * // mouse press ends. - * cnv.mouseClicked(randomColor); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when a mouse press ends. - * cnv.mouseClicked(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user releases a mouse press.'); - * } - * - *
                                  - */, - }, - { - key: "mouseClicked", - value: function mouseClicked(fxn) { - _main.default.Element._adjustListener("click", fxn, this); - return this; - } /** - * Calls a function when the mouse moves over the element. Calling - * `myElement.mouseMoved(false)` disables the function. - * - * @method mouseMoved - * @param {Function|Boolean} fxn function to call when the mouse - * moves over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse moves. - * cnv.mouseMoved(randomColor); - * - * describe('A gray square changes color when the mouse moves over the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse moves. - * cnv.mouseMoved(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse moves over the canvas.'); - * } - * - *
                                  - */, - }, - { - key: "mouseMoved", - value: function mouseMoved(fxn) { - _main.default.Element._adjustListener( - "mousemove", - fxn, - this, - ); - return this; - } /** - * Calls a function when the mouse moves onto the element. Calling - * `myElement.mouseOver(false)` disables the function. - * - * @method mouseOver - * @param {Function|Boolean} fxn function to call when the mouse - * moves onto the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse moves onto the canvas. - * cnv.mouseOver(randomColor); - * - * describe('A gray square changes color when the mouse moves onto the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse moves onto - * // the canvas. - * cnv.mouseOver(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse moves onto the canvas.'); - * } - * - *
                                  - */, - }, - { - key: "mouseOver", - value: function mouseOver(fxn) { - _main.default.Element._adjustListener( - "mouseover", - fxn, - this, - ); - return this; - } /** - * Calls a function when the mouse moves off the element. Calling - * `myElement.mouseOut(false)` disables the function. - * - * @method mouseOut - * @param {Function|Boolean} fxn function to call when the mouse - * moves off the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // mouse moves off the canvas. - * cnv.mouseOut(randomColor); - * - * describe('A gray square changes color when the mouse moves off the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the mouse moves off - * // the canvas. - * cnv.mouseOut(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the mouse moves off the canvas.'); - * } - * - *
                                  - */, - }, - { - key: "mouseOut", - value: function mouseOut(fxn) { - _main.default.Element._adjustListener( - "mouseout", - fxn, - this, - ); - return this; - } /** - * Calls a function when the element is touched. Calling - * `myElement.touchStarted(false)` disables the function. - * - * Note: Touch functions only work on mobile devices. - * - * @method touchStarted - * @param {Function|Boolean} fxn function to call when the touch - * starts. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // user touches the canvas. - * cnv.touchStarted(randomColor); - * - * describe('A gray square changes color when the user touches the canvas.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the user touches the - * // canvas. - * cnv.touchStarted(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user touches the canvas.'); - * } - * - *
                                  - */, - }, - { - key: "touchStarted", - value: function touchStarted(fxn) { - _main.default.Element._adjustListener( - "touchstart", - fxn, - this, - ); - return this; - } /** - * Calls a function when the user touches the element and moves their - * finger. Calling `myElement.touchMoved(false)` disables the - * function. - * - * Note: Touch functions only work on mobile devices. - * - * @method touchMoved - * @param {Function|Boolean} fxn function to call when the touch - * moves over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // user touches the canvas - * // and moves. - * cnv.touchMoved(randomColor); - * - * describe('A gray square changes color when the user touches the canvas and moves.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the user touches the - * // canvas and moves. - * cnv.touchMoved(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user touches the canvas and moves.'); - * } - * - *
                                  - */, - }, - { - key: "touchMoved", - value: function touchMoved(fxn) { - _main.default.Element._adjustListener( - "touchmove", - fxn, - this, - ); - return this; - } /** - * Calls a function when the user stops touching the element. Calling - * `myElement.touchMoved(false)` disables the function. - * - * Note: Touch functions only work on mobile devices. - * - * @method touchEnded - * @param {Function|Boolean} fxn function to call when the touch - * ends. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call randomColor() when the - * // user touches the canvas, - * // then lifts their finger. - * cnv.touchEnded(randomColor); - * - * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); - * } - * - * // Paint the background either - * // red, yellow, blue, or green. - * function randomColor() { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Paint the background either - * // red, yellow, blue, or green - * // when the user touches the - * // canvas, then lifts their - * // finger. - * cnv.touchEnded(() => { - * let c = random(['red', 'yellow', 'blue', 'green']); - * background(c); - * }); - * - * describe('A gray square changes color when the user touches the canvas, then lifts their finger.'); - * } - * - *
                                  - */, - }, - { - key: "touchEnded", - value: function touchEnded(fxn) { - _main.default.Element._adjustListener( - "touchend", - fxn, - this, - ); - return this; - } /** - * Calls a function when a file is dragged over the element. Calling - * `myElement.dragOver(false)` disables the function. - * - * @method dragOver - * @param {Function|Boolean} fxn function to call when the file is - * dragged over the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * // Drag a file over the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call helloFile() when a - * // file is dragged over - * // the canvas. - * cnv.dragOver(helloFile); - * - * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); - * } - * - * function helloFile() { - * text('hello, file', 50, 50); - * } - * - *
                                  - * - *
                                  - * - * // Drag a file over the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Say "hello, file" when a - * // file is dragged over - * // the canvas. - * cnv.dragOver(() => { - * text('hello, file', 50, 50); - * }); - * - * describe('A gray square. The text "hello, file" appears when a file is dragged over the square.'); - * } - * - *
                                  - */, - }, - { - key: "dragOver", - value: function dragOver(fxn) { - _main.default.Element._adjustListener( - "dragover", - fxn, - this, - ); - return this; - } /** - * Calls a function when a file is dragged off the element. Calling - * Calling `myElement.dragLeave(false)` disables the function. - * - * @method dragLeave - * @param {Function|Boolean} fxn function to call when the file is - * dragged off the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * // Drag a file over, then off - * // the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Call byeFile() when a - * // file is dragged over, - * // then off the canvas. - * cnv.dragLeave(byeFile); - * - * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); - * } - * - * function byeFile() { - * text('bye, file', 50, 50); - * } - * - *
                                  - * - *
                                  - * - * // Drag a file over, then off - * // the canvas to test. - * - * function setup() { - * // Create a canvas element and - * // assign it to cnv. - * let cnv = createCanvas(100, 100); - * - * background(200); - * - * // Say "bye, file" when a - * // file is dragged over, - * // then off the canvas. - * cnv.dragLeave(() => { - * text('bye, file', 50, 50); - * }); - * - * describe('A gray square. The text "bye, file" appears when a file is dragged over, then off the square.'); - * } - * - *
                                  - */, - }, - { - key: "dragLeave", - value: function dragLeave(fxn) { - _main.default.Element._adjustListener( - "dragleave", - fxn, - this, - ); - return this; - } /** - * - * @private - * @static - * @param {String} ev - * @param {Boolean|Function} fxn - * @param {Element} ctx - * @chainable - * @alt - * General handler for event attaching and detaching - */, - }, - { - key: "_setProperty", - /** - * Helper fxn for sharing pixel methods - */ - value: function _setProperty(prop, value) { - this[prop] = value; - }, - }, - ], - [ - { - key: "_adjustListener", - value: function _adjustListener(ev, fxn, ctx) { - if (fxn === false) { - _main.default.Element._detachListener(ev, ctx); - } else { - _main.default.Element._attachListener(ev, fxn, ctx); - } - return this; - } /** - * - * @private - * @static - * @param {String} ev - * @param {Function} fxn - * @param {Element} ctx - */, - }, - { - key: "_attachListener", - value: function _attachListener(ev, fxn, ctx) { - // detach the old listener if there was one - if (ctx._events[ev]) { - _main.default.Element._detachListener(ev, ctx); - } - var f = fxn.bind(ctx); - ctx.elt.addEventListener(ev, f, false); - ctx._events[ev] = f; - } /** - * - * @private - * @static - * @param {String} ev - * @param {Element} ctx - */, - }, - { - key: "_detachListener", - value: function _detachListener(ev, ctx) { - var f = ctx._events[ev]; - ctx.elt.removeEventListener(ev, f, false); - ctx._events[ev] = null; - }, - }, - ], - ); - return _class; - })(); - var _default = _main.default.Element; - exports.default = _default; - }, - { - "./main": 298, - }, - ], - 300: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - var constants = _interopRequireWildcard(_dereq_("./constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - /** - * Thin wrapper around a renderer, to be used for creating a - * graphics buffer object. Use this class if you need - * to draw into an off-screen graphics buffer. The two parameters define the - * width and height in pixels. The fields and methods for this class are - * extensive, but mirror the normal drawing API for p5. - * - * @class p5.Graphics - * @constructor - * @extends p5.Element - * @param {Number} w width - * @param {Number} h height - * @param {Constant} renderer the renderer to use, either P2D or WEBGL - * @param {p5} [pInst] pointer to p5 instance - * @param {HTMLCanvasElement} [canvas] existing html canvas element - */ - - _main.default.Graphics = /*#__PURE__*/ (function (_p5$Element) { - _inherits(_class, _p5$Element); - var _super = _createSuper(_class); - function _class(w, h, renderer, pInst, canvas) { - var _this; - _classCallCheck(this, _class); - var canvasTemp; - if (canvas) { - canvasTemp = canvas; - } else { - canvasTemp = document.createElement("canvas"); - } - _this = _super.call(this, canvasTemp, pInst); - _this.canvas = canvasTemp; - var r = renderer || constants.P2D; - var node = pInst._userNode || document.body; - if (!canvas) { - node.appendChild(_this.canvas); - } // bind methods and props of p5 to the new object - - for (var p in _main.default.prototype) { - if (!_this[p]) { - if (typeof _main.default.prototype[p] === "function") { - _this[p] = _main.default.prototype[p].bind( - _assertThisInitialized(_this), - ); - } else { - _this[p] = _main.default.prototype[p]; - } - } - } - _main.default.prototype._initializeInstanceVariables.apply( - _assertThisInitialized(_this), - ); - _this.width = w; - _this.height = h; - _this._pixelDensity = pInst._pixelDensity; - if (r === constants.WEBGL) { - _this._renderer = new _main.default.RendererGL( - _this.canvas, - _assertThisInitialized(_this), - false, - ); - } else { - _this._renderer = new _main.default.Renderer2D( - _this.canvas, - _assertThisInitialized(_this), - false, - ); - } - pInst._elements.push(_assertThisInitialized(_this)); - Object.defineProperty( - _assertThisInitialized(_this), - "deltaTime", - { - get: function get() { - return this._pInst.deltaTime; - }, - }, - ); - _this._renderer.resize(w, h); - _this._renderer._applyDefaults(); - return _possibleConstructorReturn( - _this, - _assertThisInitialized(_this), - ); - } /** - * Resets certain values such as those modified by functions in the Transform category - * and in the Lights category that are not automatically reset - * with graphics buffer objects. Calling this in draw() will copy the behavior - * of the standard canvas. - * - * @method reset - * @example - * - *
                                  - * let pg; - * function setup() { - * createCanvas(100, 100); - * background(0); - * pg = createGraphics(50, 100); - * pg.fill(0); - * frameRate(5); - * } - * - * function draw() { - * image(pg, width / 2, 0); - * pg.background(255); - * // p5.Graphics object behave a bit differently in some cases - * // The normal canvas on the left resets the translate - * // with every loop through draw() - * // the graphics object on the right doesn't automatically reset - * // so translate() is additive and it moves down the screen - * rect(0, 0, width / 2, 5); - * pg.rect(0, 0, width / 2, 5); - * translate(0, 5, 0); - * pg.translate(0, 5, 0); - * } - * function mouseClicked() { - * // if you click you will see that - * // reset() resets the translate back to the initial state - * // of the Graphics object - * pg.reset(); - * } - *
                                  - * - * @alt - * A white line on a black background stays still on the top-left half. - * A black line animates from top to bottom on a white background on the right half. - * When clicked, the black line starts back over at the top. - */ - - _createClass(_class, [ - { - key: "reset", - value: function reset() { - this._renderer.resetMatrix(); - if (this._renderer.isP3D) { - this._renderer._update(); - } - } /** - * Removes a Graphics object from the page and frees any resources - * associated with it. - * - * @method remove - * - * @example - *
                                  - * let bg; - * function setup() { - * bg = createCanvas(100, 100); - * bg.background(0); - * image(bg, 0, 0); - * bg.remove(); - * } - *
                                  - * - *
                                  - * let bg; - * function setup() { - * pixelDensity(1); - * createCanvas(100, 100); - * stroke(255); - * fill(0); - * - * // create and draw the background image - * bg = createGraphics(100, 100); - * bg.background(200); - * bg.ellipse(50, 50, 80, 80); - * } - * function draw() { - * let t = millis() / 1000; - * // draw the background - * if (bg) { - * image(bg, frameCount % 100, 0); - * image(bg, frameCount % 100 - 100, 0); - * } - * // draw the foreground - * let p = p5.Vector.fromAngle(t, 35).add(50, 50); - * ellipse(p.x, p.y, 30); - * } - * function mouseClicked() { - * // remove the background - * if (bg) { - * bg.remove(); - * bg = null; - * } - * } - *
                                  - * - * @alt - * no image - * a multi-colored circle moving back and forth over a scrolling background. - */, - }, - { - key: "remove", - value: function remove() { - if (this.elt.parentNode) { - this.elt.parentNode.removeChild(this.elt); - } - var idx = this._pInst._elements.indexOf(this); - if (idx !== -1) { - this._pInst._elements.splice(idx, 1); - } - for (var elt_ev in this._events) { - this.elt.removeEventListener(elt_ev, this._events[elt_ev]); - } - } /** - * Creates and returns a new p5.Framebuffer - * inside a p5.Graphics WebGL context. - * - * This takes the same parameters as the global - * createFramebuffer function. - * - * @method createFramebuffer - */, - }, - { - key: "createFramebuffer", - value: function createFramebuffer(options) { - return new _main.default.Framebuffer(this, options); - }, - }, - ]); - return _class; - })(_main.default.Element); - var _default = _main.default.Graphics; - exports.default = _default; - }, - { - "./constants": 286, - "./main": 298, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 301: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - /** - * Main graphics and rendering context, as well as the base API - * implementation for p5.js "core". To be used as the superclass for - * Renderer2D and Renderer3D classes, respectively. - * - * @class p5.Renderer - * @constructor - * @extends p5.Element - * @param {HTMLElement} elt DOM node that is wrapped - * @param {p5} [pInst] pointer to p5 instance - * @param {Boolean} [isMainCanvas] whether we're using it as main canvas - */ - - var Renderer = /*#__PURE__*/ (function (_p5$Element) { - _inherits(Renderer, _p5$Element); - var _super = _createSuper(Renderer); - function Renderer(elt, pInst, isMainCanvas) { - var _this; - _classCallCheck(this, Renderer); - _this = _super.call(this, elt, pInst); - _this.canvas = elt; - _this._pixelsState = pInst; - if (isMainCanvas) { - _this._isMainCanvas = true; - // for pixel method sharing with pimage - _this._pInst._setProperty( - "_curElement", - _assertThisInitialized(_this), - ); - _this._pInst._setProperty("canvas", _this.canvas); - _this._pInst._setProperty("width", _this.width); - _this._pInst._setProperty("height", _this.height); - } else { - // hide if offscreen buffer by default - _this.canvas.style.display = "none"; - _this._styles = []; // non-main elt styles stored in p5.Renderer - } - _this._clipping = false; - _this._clipInvert = false; - _this._textSize = 12; - _this._textLeading = 15; - _this._textFont = "sans-serif"; - _this._textStyle = constants.NORMAL; - _this._textAscent = null; - _this._textDescent = null; - _this._textAlign = constants.LEFT; - _this._textBaseline = constants.BASELINE; - _this._textWrap = constants.WORD; - _this._rectMode = constants.CORNER; - _this._ellipseMode = constants.CENTER; - _this._curveTightness = 0; - _this._imageMode = constants.CORNER; - _this._tint = null; - _this._doStroke = true; - _this._doFill = true; - _this._strokeSet = false; - _this._fillSet = false; - _this._leadingSet = false; - _this._pushPopDepth = 0; - return _this; - } // the renderer should return a 'style' object that it wishes to - // store on the push stack. - - _createClass(Renderer, [ - { - key: "push", - value: function push() { - this._pushPopDepth++; - return { - properties: { - _doStroke: this._doStroke, - _strokeSet: this._strokeSet, - _doFill: this._doFill, - _fillSet: this._fillSet, - _tint: this._tint, - _imageMode: this._imageMode, - _rectMode: this._rectMode, - _ellipseMode: this._ellipseMode, - _textFont: this._textFont, - _textLeading: this._textLeading, - _leadingSet: this._leadingSet, - _textSize: this._textSize, - _textAlign: this._textAlign, - _textBaseline: this._textBaseline, - _textStyle: this._textStyle, - _textWrap: this._textWrap, - }, - }; - }, // a pop() operation is in progress - // the renderer is passed the 'style' object that it returned - // from its push() method. - }, - { - key: "pop", - value: function pop(style) { - this._pushPopDepth--; - if (style.properties) { - // copy the style properties back into the renderer - Object.assign(this, style.properties); - } - }, - }, - { - key: "beginClip", - value: function beginClip() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - if (this._clipping) { - throw new Error( - "It looks like you're trying to clip while already in the middle of clipping. Did you forget to endClip()?", - ); - } - this._clipping = true; - this._clipInvert = options.invert; - }, - }, - { - key: "endClip", - value: function endClip() { - if (!this._clipping) { - throw new Error( - "It looks like you've called endClip() without beginClip(). Did you forget to call beginClip() first?", - ); - } - this._clipping = false; - } /** - * Resize our canvas element. - */, - }, - { - key: "resize", - value: function resize(w, h) { - this.width = w; - this.height = h; - this.elt.width = w * this._pInst._pixelDensity; - this.elt.height = h * this._pInst._pixelDensity; - this.elt.style.width = "".concat(w, "px"); - this.elt.style.height = "".concat(h, "px"); - if (this._isMainCanvas) { - this._pInst._setProperty("width", this.width); - this._pInst._setProperty("height", this.height); - } - }, - }, - { - key: "get", - value: function get(x, y, w, h) { - var pixelsState = this._pixelsState; - var pd = pixelsState._pixelDensity; - var canvas = this.canvas; - if (typeof x === "undefined" && typeof y === "undefined") { - // get() - x = y = 0; - w = pixelsState.width; - h = pixelsState.height; - } else { - x *= pd; - y *= pd; - if (typeof w === "undefined" && typeof h === "undefined") { - // get(x,y) - if ( - x < 0 || - y < 0 || - x >= canvas.width || - y >= canvas.height - ) { - return [0, 0, 0, 0]; - } - return this._getPixel(x, y); - } // get(x,y,w,h) - } - var region = new _main.default.Image(w * pd, h * pd); - region.pixelDensity(pd); - region.canvas - .getContext("2d") - .drawImage( - canvas, - x, - y, - w * pd, - h * pd, - 0, - 0, - w * pd, - h * pd, - ); - return region; - }, - }, - { - key: "textLeading", - value: function textLeading(l) { - if (typeof l === "number") { - this._setProperty("_leadingSet", true); - this._setProperty("_textLeading", l); - return this._pInst; - } - return this._textLeading; - }, - }, - { - key: "textStyle", - value: function textStyle(s) { - if (s) { - if ( - s === constants.NORMAL || - s === constants.ITALIC || - s === constants.BOLD || - s === constants.BOLDITALIC - ) { - this._setProperty("_textStyle", s); - } - return this._applyTextProperties(); - } - return this._textStyle; - }, - }, - { - key: "textAscent", - value: function textAscent() { - if (this._textAscent === null) { - this._updateTextMetrics(); - } - return this._textAscent; - }, - }, - { - key: "textDescent", - value: function textDescent() { - if (this._textDescent === null) { - this._updateTextMetrics(); - } - return this._textDescent; - }, - }, - { - key: "textAlign", - value: function textAlign(h, v) { - if (typeof h !== "undefined") { - this._setProperty("_textAlign", h); - if (typeof v !== "undefined") { - this._setProperty("_textBaseline", v); - } - return this._applyTextProperties(); - } else { - return { - horizontal: this._textAlign, - vertical: this._textBaseline, - }; - } - }, - }, - { - key: "textWrap", - value: function textWrap(wrapStyle) { - this._setProperty("_textWrap", wrapStyle); - return this._textWrap; - }, - }, - { - key: "text", - value: function text(str, x, y, maxWidth, maxHeight) { - var p = this._pInst; - var textWrapStyle = this._textWrap; - var lines; - var line; - var testLine; - var testWidth; - var words; - var chars; - var shiftedY; - var finalMaxHeight = Number.MAX_VALUE; - // fix for #5785 (top of bounding box) - var finalMinHeight = y; - if (!(this._doFill || this._doStroke)) { - return; - } - if (typeof str === "undefined") { - return; - } else if (typeof str !== "string") { - str = str.toString(); - } // Replaces tabs with double-spaces and splits string on any line - // breaks present in the original string - - str = str.replace(/(\t)/g, " "); - lines = str.split("\n"); - if (typeof maxWidth !== "undefined") { - if (this._rectMode === constants.CENTER) { - x -= maxWidth / 2; - } - switch (this._textAlign) { - case constants.CENTER: - x += maxWidth / 2; - break; - case constants.RIGHT: - x += maxWidth; - break; - } - if (typeof maxHeight !== "undefined") { - if (this._rectMode === constants.CENTER) { - y -= maxHeight / 2; - finalMinHeight -= maxHeight / 2; - } - var originalY = y; - var ascent = p.textAscent(); - switch (this._textBaseline) { - case constants.BOTTOM: - shiftedY = y + maxHeight; - y = Math.max(shiftedY, y); - // fix for #5785 (top of bounding box) - finalMinHeight += ascent; - break; - case constants.CENTER: - shiftedY = y + maxHeight / 2; - y = Math.max(shiftedY, y); - // fix for #5785 (top of bounding box) - finalMinHeight += ascent / 2; - break; - } // remember the max-allowed y-position for any line (fix to #928) - - finalMaxHeight = y + maxHeight - ascent; - // fix for #5785 (bottom of bounding box) - if (this._textBaseline === constants.CENTER) { - finalMaxHeight = originalY + maxHeight - ascent / 2; - } - } else { - // no text-height specified, show warning for BOTTOM / CENTER - if ( - this._textBaseline === constants.BOTTOM || - this._textBaseline === constants.CENTER - ) { - // use rectHeight as an approximation for text height - var rectHeight = p.textSize() * this._textLeading; - finalMinHeight = y - rectHeight / 2; - finalMaxHeight = y + rectHeight / 2; - } - } // Render lines of text according to settings of textWrap - // Splits lines at spaces, for loop adds one word + space - // at a time and tests length with next word added - - if (textWrapStyle === constants.WORD) { - var nlines = []; - for ( - var lineIndex = 0; - lineIndex < lines.length; - lineIndex++ - ) { - line = ""; - words = lines[lineIndex].split(" "); - for ( - var wordIndex = 0; - wordIndex < words.length; - wordIndex++ - ) { - testLine = "".concat(line + words[wordIndex]) + " "; - testWidth = this.textWidth(testLine); - if (testWidth > maxWidth && line.length > 0) { - nlines.push(line); - line = "".concat(words[wordIndex]) + " "; - } else { - line = testLine; - } - } - nlines.push(line); - } - var offset = 0; - if (this._textBaseline === constants.CENTER) { - offset = ((nlines.length - 1) * p.textLeading()) / 2; - } else if (this._textBaseline === constants.BOTTOM) { - offset = (nlines.length - 1) * p.textLeading(); - } - for ( - var _lineIndex = 0; - _lineIndex < lines.length; - _lineIndex++ - ) { - line = ""; - words = lines[_lineIndex].split(" "); - for ( - var _wordIndex = 0; - _wordIndex < words.length; - _wordIndex++ - ) { - testLine = "".concat(line + words[_wordIndex]) + " "; - testWidth = this.textWidth(testLine); - if (testWidth > maxWidth && line.length > 0) { - this._renderText( - p, - line.trim(), - x, - y - offset, - finalMaxHeight, - finalMinHeight, - ); - line = "".concat(words[_wordIndex]) + " "; - y += p.textLeading(); - } else { - line = testLine; - } - } - this._renderText( - p, - line.trim(), - x, - y - offset, - finalMaxHeight, - finalMinHeight, - ); - y += p.textLeading(); - } - } else { - var _nlines = []; - for ( - var _lineIndex2 = 0; - _lineIndex2 < lines.length; - _lineIndex2++ - ) { - line = ""; - chars = lines[_lineIndex2].split(""); - for ( - var charIndex = 0; - charIndex < chars.length; - charIndex++ - ) { - testLine = "".concat(line + chars[charIndex]); - testWidth = this.textWidth(testLine); - if (testWidth <= maxWidth) { - line += chars[charIndex]; - } else if (testWidth > maxWidth && line.length > 0) { - _nlines.push(line); - line = "".concat(chars[charIndex]); - } - } - } - _nlines.push(line); - var _offset = 0; - if (this._textBaseline === constants.CENTER) { - _offset = ((_nlines.length - 1) * p.textLeading()) / 2; - } else if (this._textBaseline === constants.BOTTOM) { - _offset = (_nlines.length - 1) * p.textLeading(); - } // Splits lines at characters, for loop adds one char at a time - // and tests length with next char added - - for ( - var _lineIndex3 = 0; - _lineIndex3 < lines.length; - _lineIndex3++ - ) { - line = ""; - chars = lines[_lineIndex3].split(""); - for ( - var _charIndex = 0; - _charIndex < chars.length; - _charIndex++ - ) { - testLine = "".concat(line + chars[_charIndex]); - testWidth = this.textWidth(testLine); - if (testWidth <= maxWidth) { - line += chars[_charIndex]; - } else if (testWidth > maxWidth && line.length > 0) { - this._renderText( - p, - line.trim(), - x, - y - _offset, - finalMaxHeight, - finalMinHeight, - ); - y += p.textLeading(); - line = "".concat(chars[_charIndex]); - } - } - } - this._renderText( - p, - line.trim(), - x, - y - _offset, - finalMaxHeight, - finalMinHeight, - ); - y += p.textLeading(); - } - } else { - // Offset to account for vertically centering multiple lines of text - no - // need to adjust anything for vertical align top or baseline - var _offset2 = 0; - if (this._textBaseline === constants.CENTER) { - _offset2 = ((lines.length - 1) * p.textLeading()) / 2; - } else if (this._textBaseline === constants.BOTTOM) { - _offset2 = (lines.length - 1) * p.textLeading(); - } // Renders lines of text at any line breaks present in the original string - - for (var i = 0; i < lines.length; i++) { - this._renderText( - p, - lines[i], - x, - y - _offset2, - finalMaxHeight, - finalMinHeight - _offset2, - ); - y += p.textLeading(); - } - } - return p; - }, - }, - { - key: "_applyDefaults", - value: function _applyDefaults() { - return this; - } /** - * Helper function to check font type (system or otf) - */, - }, - { - key: "_isOpenType", - value: function _isOpenType() { - var f = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : this._textFont; - return _typeof(f) === "object" && f.font && f.font.supported; - }, - }, - { - key: "_updateTextMetrics", - value: function _updateTextMetrics() { - if (this._isOpenType()) { - this._setProperty( - "_textAscent", - this._textFont._textAscent(), - ); - this._setProperty( - "_textDescent", - this._textFont._textDescent(), - ); - return this; - } // Adapted from http://stackoverflow.com/a/25355178 - - var text = document.createElement("span"); - text.style.fontFamily = this._textFont; - text.style.fontSize = "".concat(this._textSize, "px"); - text.innerHTML = "ABCjgq|"; - var block = document.createElement("div"); - block.style.display = "inline-block"; - block.style.width = "1px"; - block.style.height = "0px"; - var container = document.createElement("div"); - container.appendChild(text); - container.appendChild(block); - container.style.height = "0px"; - container.style.overflow = "hidden"; - document.body.appendChild(container); - block.style.verticalAlign = "baseline"; - var blockOffset = calculateOffset(block); - var textOffset = calculateOffset(text); - var ascent = blockOffset[1] - textOffset[1]; - block.style.verticalAlign = "bottom"; - blockOffset = calculateOffset(block); - textOffset = calculateOffset(text); - var height = blockOffset[1] - textOffset[1]; - var descent = height - ascent; - document.body.removeChild(container); - this._setProperty("_textAscent", ascent); - this._setProperty("_textDescent", descent); - return this; - }, - }, - ]); - return Renderer; - })(_main.default.Element); - /** - * Helper fxn to measure ascent and descent. - * Adapted from http://stackoverflow.com/a/25355178 - */ - function calculateOffset(object) { - var currentLeft = 0, - currentTop = 0; - if (object.offsetParent) { - do { - currentLeft += object.offsetLeft; - currentTop += object.offsetTop; - } while ((object = object.offsetParent)); - } else { - currentLeft += object.offsetLeft; - currentTop += object.offsetTop; - } - return [currentLeft, currentTop]; - } // This caused the test to failed. - - Renderer.prototype.textSize = function (s) { - if (typeof s === "number") { - this._setProperty("_textSize", s); - if (!this._leadingSet) { - // only use a default value if not previously set (#5181) - this._setProperty( - "_textLeading", - s * constants._DEFAULT_LEADMULT, - ); - } - return this._applyTextProperties(); - } - return this._textSize; - }; - _main.default.Renderer = Renderer; - var _default = _main.default.Renderer; - exports.default = _default; - }, - { - "../core/constants": 286, - "./main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.number.constructor": 191, - "core-js/modules/es.object.assign": 194, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.trim": 219, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 302: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.reflect.get"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - var constants = _interopRequireWildcard(_dereq_("./constants")); - _dereq_("./p5.Renderer"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * p5.Renderer2D - * The 2D graphics canvas renderer class. - * extends p5.Renderer - */ - - var styleEmpty = "rgba(0,0,0,0)"; - // const alphaThreshold = 0.00125; // minimum visible - var Renderer2D = /*#__PURE__*/ (function (_p5$Renderer) { - _inherits(Renderer2D, _p5$Renderer); - var _super = _createSuper(Renderer2D); - function Renderer2D(elt, pInst, isMainCanvas) { - var _this; - _classCallCheck(this, Renderer2D); - _this = _super.call(this, elt, pInst, isMainCanvas); - _this.drawingContext = _this.canvas.getContext("2d"); - _this._pInst._setProperty("drawingContext", _this.drawingContext); - return _this; - } - _createClass(Renderer2D, [ - { - key: "getFilterGraphicsLayer", - value: function getFilterGraphicsLayer() { - // create hidden webgl renderer if it doesn't exist - if (!this.filterGraphicsLayer) { - // the real _pInst is buried when this is a secondary p5.Graphics - var pInst = - this._pInst instanceof _main.default.Graphics - ? this._pInst._pInst - : this._pInst; - // create secondary layer - this.filterGraphicsLayer = new _main.default.Graphics( - this.width, - this.height, - constants.WEBGL, - pInst, - ); - } - if ( - this.filterGraphicsLayer.width !== this.width || - this.filterGraphicsLayer.height !== this.height - ) { - // Resize the graphics layer - this.filterGraphicsLayer.resizeCanvas( - this.width, - this.height, - ); - } - if ( - this.filterGraphicsLayer.pixelDensity() !== - this._pInst.pixelDensity() - ) { - this.filterGraphicsLayer.pixelDensity( - this._pInst.pixelDensity(), - ); - } - return this.filterGraphicsLayer; - }, - }, - { - key: "_applyDefaults", - value: function _applyDefaults() { - this._cachedFillStyle = this._cachedStrokeStyle = undefined; - this._cachedBlendMode = constants.BLEND; - this._setFill(constants._DEFAULT_FILL); - this._setStroke(constants._DEFAULT_STROKE); - this.drawingContext.lineCap = constants.ROUND; - this.drawingContext.font = "normal 12px sans-serif"; - }, - }, - { - key: "resize", - value: function resize(w, h) { - _get( - _getPrototypeOf(Renderer2D.prototype), - "resize", - this, - ).call(this, w, h); - this.drawingContext.scale( - this._pInst._pixelDensity, - this._pInst._pixelDensity, - ); - }, ////////////////////////////////////////////// - // COLOR | Setting - ////////////////////////////////////////////// - }, - { - key: "background", - value: function background() { - this.drawingContext.save(); - this.resetMatrix(); - if ( - (arguments.length <= 0 - ? undefined - : arguments[0]) instanceof _main.default.Image - ) { - if ( - (arguments.length <= 1 ? undefined : arguments[1]) >= 0 - ) { - // set transparency of background - var img = - arguments.length <= 0 ? undefined : arguments[0]; - this.drawingContext.globalAlpha = - (arguments.length <= 1 ? undefined : arguments[1]) / - 255; - this._pInst.image(img, 0, 0, this.width, this.height); - } else { - this._pInst.image( - arguments.length <= 0 ? undefined : arguments[0], - 0, - 0, - this.width, - this.height, - ); - } - } else { - var _this$_pInst; - var curFill = this._getFill(); - // create background rect - var color = (_this$_pInst = this._pInst).color.apply( - _this$_pInst, - arguments, - ); - //accessible Outputs - if (this._pInst._addAccsOutput()) { - this._pInst._accsBackground(color.levels); - } - var newFill = color.toString(); - this._setFill(newFill); - if (this._isErasing) { - this.blendMode(this._cachedBlendMode); - } - this.drawingContext.fillRect(0, 0, this.width, this.height); - // reset fill - this._setFill(curFill); - if (this._isErasing) { - this._pInst.erase(); - } - } - this.drawingContext.restore(); - }, - }, - { - key: "clear", - value: function clear() { - this.drawingContext.save(); - this.resetMatrix(); - this.drawingContext.clearRect(0, 0, this.width, this.height); - this.drawingContext.restore(); - }, - }, - { - key: "fill", - value: function fill() { - var _this$_pInst2; - var color = (_this$_pInst2 = this._pInst).color.apply( - _this$_pInst2, - arguments, - ); - this._setFill(color.toString()); - //accessible Outputs - if (this._pInst._addAccsOutput()) { - this._pInst._accsCanvasColors("fill", color.levels); - } - }, - }, - { - key: "stroke", - value: function stroke() { - var _this$_pInst3; - var color = (_this$_pInst3 = this._pInst).color.apply( - _this$_pInst3, - arguments, - ); - this._setStroke(color.toString()); - //accessible Outputs - if (this._pInst._addAccsOutput()) { - this._pInst._accsCanvasColors("stroke", color.levels); - } - }, - }, - { - key: "erase", - value: function erase(opacityFill, opacityStroke) { - if (!this._isErasing) { - // cache the fill style - this._cachedFillStyle = this.drawingContext.fillStyle; - var newFill = this._pInst - .color(255, opacityFill) - .toString(); - this.drawingContext.fillStyle = newFill; - // cache the stroke style - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - var newStroke = this._pInst - .color(255, opacityStroke) - .toString(); - this.drawingContext.strokeStyle = newStroke; - // cache blendMode - var tempBlendMode = this._cachedBlendMode; - this.blendMode(constants.REMOVE); - this._cachedBlendMode = tempBlendMode; - this._isErasing = true; - } - }, - }, - { - key: "noErase", - value: function noErase() { - if (this._isErasing) { - this.drawingContext.fillStyle = this._cachedFillStyle; - this.drawingContext.strokeStyle = this._cachedStrokeStyle; - this.blendMode(this._cachedBlendMode); - this._isErasing = false; - } - }, - }, - { - key: "beginClip", - value: function beginClip() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - _get( - _getPrototypeOf(Renderer2D.prototype), - "beginClip", - this, - ).call(this, options); - // cache the fill style - this._cachedFillStyle = this.drawingContext.fillStyle; - var newFill = this._pInst.color(255, 0).toString(); - this.drawingContext.fillStyle = newFill; - // cache the stroke style - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - var newStroke = this._pInst.color(255, 0).toString(); - this.drawingContext.strokeStyle = newStroke; - // cache blendMode - var tempBlendMode = this._cachedBlendMode; - this.blendMode(constants.BLEND); - this._cachedBlendMode = tempBlendMode; - // Start a new path. Everything from here on out should become part of this - // one path so that we can clip to the whole thing. - this.drawingContext.beginPath(); - if (this._clipInvert) { - // Slight hack: draw a big rectangle over everything with reverse winding - // order. This is hopefully large enough to cover most things. - this.drawingContext.moveTo( - -2 * this.width, - -2 * this.height, - ); - this.drawingContext.lineTo( - -2 * this.width, - 2 * this.height, - ); - this.drawingContext.lineTo(2 * this.width, 2 * this.height); - this.drawingContext.lineTo( - 2 * this.width, - -2 * this.height, - ); - this.drawingContext.closePath(); - } - }, - }, - { - key: "endClip", - value: function endClip() { - this._doFillStrokeClose(); - this.drawingContext.clip(); - _get( - _getPrototypeOf(Renderer2D.prototype), - "endClip", - this, - ).call(this); - this.drawingContext.fillStyle = this._cachedFillStyle; - this.drawingContext.strokeStyle = this._cachedStrokeStyle; - this.blendMode(this._cachedBlendMode); - }, ////////////////////////////////////////////// - // IMAGE | Loading & Displaying - ////////////////////////////////////////////// - }, - { - key: "image", - value: function image( - img, - sx, - sy, - sWidth, - sHeight, - dx, - dy, - dWidth, - dHeight, - ) { - var cnv; - if (img.gifProperties) { - img._animateGif(this._pInst); - } - try { - if ( - _main.default.MediaElement && - img instanceof _main.default.MediaElement - ) { - img._ensureCanvas(); - } - if (this._tint && img.canvas) { - cnv = this._getTintedImageCanvas(img); - } - if (!cnv) { - cnv = img.canvas || img.elt; - } - var s = 1; - if (img.width && img.width > 0) { - s = cnv.width / img.width; - } - if (this._isErasing) { - this.blendMode(this._cachedBlendMode); - } - this.drawingContext.drawImage( - cnv, - s * sx, - s * sy, - s * sWidth, - s * sHeight, - dx, - dy, - dWidth, - dHeight, - ); - if (this._isErasing) { - this._pInst.erase(); - } - } catch (e) { - if (e.name !== "NS_ERROR_NOT_AVAILABLE") { - throw e; - } - } - }, - }, - { - key: "_getTintedImageCanvas", - value: function _getTintedImageCanvas(img) { - if (!img.canvas) { - return img; - } - if (!img.tintCanvas) { - // Once an image has been tinted, keep its tint canvas - // around so we don't need to re-incur the cost of - // creating a new one for each tint - img.tintCanvas = document.createElement("canvas"); - } // Keep the size of the tint canvas up-to-date - - if (img.tintCanvas.width !== img.canvas.width) { - img.tintCanvas.width = img.canvas.width; - } - if (img.tintCanvas.height !== img.canvas.height) { - img.tintCanvas.height = img.canvas.height; - } // Goal: multiply the r,g,b,a values of the source by - // the r,g,b,a values of the tint color - - var ctx = img.tintCanvas.getContext("2d"); - ctx.save(); - ctx.clearRect(0, 0, img.canvas.width, img.canvas.height); - if ( - this._tint[0] < 255 || - this._tint[1] < 255 || - this._tint[2] < 255 - ) { - // Color tint: we need to use the multiply blend mode to change the colors. - // However, the canvas implementation of this destroys the alpha channel of - // the image. To accommodate, we first get a version of the image with full - // opacity everywhere, tint using multiply, and then use the destination-in - // blend mode to restore the alpha channel again. - // Start with the original image - ctx.drawImage(img.canvas, 0, 0); - // This blend mode makes everything opaque but forces the luma to match - // the original image again - ctx.globalCompositeOperation = "luminosity"; - ctx.drawImage(img.canvas, 0, 0); - // This blend mode forces the hue and chroma to match the original image. - // After this we should have the original again, but with full opacity. - ctx.globalCompositeOperation = "color"; - ctx.drawImage(img.canvas, 0, 0); - // Apply color tint - ctx.globalCompositeOperation = "multiply"; - ctx.fillStyle = "rgb(".concat( - this._tint.slice(0, 3).join(", "), - ")", - ); - ctx.fillRect(0, 0, img.canvas.width, img.canvas.height); - // Replace the alpha channel with the original alpha * the alpha tint - ctx.globalCompositeOperation = "destination-in"; - ctx.globalAlpha = this._tint[3] / 255; - ctx.drawImage(img.canvas, 0, 0); - } else { - // If we only need to change the alpha, we can skip all the extra work! - ctx.globalAlpha = this._tint[3] / 255; - ctx.drawImage(img.canvas, 0, 0); - } - ctx.restore(); - return img.tintCanvas; - }, ////////////////////////////////////////////// - // IMAGE | Pixels - ////////////////////////////////////////////// - }, - { - key: "blendMode", - value: function blendMode(mode) { - if (mode === constants.SUBTRACT) { - console.warn( - "blendMode(SUBTRACT) only works in WEBGL mode.", - ); - } else if ( - mode === constants.BLEND || - mode === constants.REMOVE || - mode === constants.DARKEST || - mode === constants.LIGHTEST || - mode === constants.DIFFERENCE || - mode === constants.MULTIPLY || - mode === constants.EXCLUSION || - mode === constants.SCREEN || - mode === constants.REPLACE || - mode === constants.OVERLAY || - mode === constants.HARD_LIGHT || - mode === constants.SOFT_LIGHT || - mode === constants.DODGE || - mode === constants.BURN || - mode === constants.ADD - ) { - this._cachedBlendMode = mode; - this.drawingContext.globalCompositeOperation = mode; - } else { - throw new Error("Mode ".concat(mode, " not recognized.")); - } - }, - }, - { - key: "blend", - value: function blend() { - var currBlend = this.drawingContext.globalCompositeOperation; - for ( - var _len = arguments.length, - args = new Array(_len), - _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - var blendMode = args[args.length - 1]; - var copyArgs = Array.prototype.slice.call( - args, - 0, - args.length - 1, - ); - this.drawingContext.globalCompositeOperation = blendMode; - _main.default.prototype.copy.apply(this, copyArgs); - this.drawingContext.globalCompositeOperation = currBlend; - }, // p5.Renderer2D.prototype.get = p5.Renderer.prototype.get; - // .get() is not overridden - // x,y are canvas-relative (pre-scaled by _pixelDensity) - }, - { - key: "_getPixel", - value: function _getPixel(x, y) { - var imageData, index; - imageData = this.drawingContext.getImageData(x, y, 1, 1).data; - index = 0; - return [ - imageData[index + 0], - imageData[index + 1], - imageData[index + 2], - imageData[index + 3], - ]; - }, - }, - { - key: "loadPixels", - value: function loadPixels() { - var pixelsState = this._pixelsState; // if called by p5.Image - var pd = pixelsState._pixelDensity; - var w = this.width * pd; - var h = this.height * pd; - var imageData = this.drawingContext.getImageData(0, 0, w, h); - // @todo this should actually set pixels per object, so diff buffers can - // have diff pixel arrays. - pixelsState._setProperty("imageData", imageData); - pixelsState._setProperty("pixels", imageData.data); - }, - }, - { - key: "set", - value: function set(x, y, imgOrCol) { - // round down to get integer numbers - x = Math.floor(x); - y = Math.floor(y); - var pixelsState = this._pixelsState; - if (imgOrCol instanceof _main.default.Image) { - this.drawingContext.save(); - this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); - this.drawingContext.scale( - pixelsState._pixelDensity, - pixelsState._pixelDensity, - ); - this.drawingContext.clearRect( - x, - y, - imgOrCol.width, - imgOrCol.height, - ); - this.drawingContext.drawImage(imgOrCol.canvas, x, y); - this.drawingContext.restore(); - } else { - var r = 0, - g = 0, - b = 0, - a = 0; - var idx = - 4 * - (y * - pixelsState._pixelDensity * - (this.width * pixelsState._pixelDensity) + - x * pixelsState._pixelDensity); - if (!pixelsState.imageData) { - pixelsState.loadPixels.call(pixelsState); - } - if (typeof imgOrCol === "number") { - if (idx < pixelsState.pixels.length) { - r = imgOrCol; - g = imgOrCol; - b = imgOrCol; - a = 255; - //this.updatePixels.call(this); - } - } else if (imgOrCol instanceof Array) { - if (imgOrCol.length < 4) { - throw new Error( - "pixel array must be of the form [R, G, B, A]", - ); - } - if (idx < pixelsState.pixels.length) { - r = imgOrCol[0]; - g = imgOrCol[1]; - b = imgOrCol[2]; - a = imgOrCol[3]; - //this.updatePixels.call(this); - } - } else if (imgOrCol instanceof _main.default.Color) { - if (idx < pixelsState.pixels.length) { - r = imgOrCol.levels[0]; - g = imgOrCol.levels[1]; - b = imgOrCol.levels[2]; - a = imgOrCol.levels[3]; - //this.updatePixels.call(this); - } - } // loop over pixelDensity * pixelDensity - - for (var i = 0; i < pixelsState._pixelDensity; i++) { - for (var j = 0; j < pixelsState._pixelDensity; j++) { - // loop over - idx = - 4 * - ((y * pixelsState._pixelDensity + j) * - this.width * - pixelsState._pixelDensity + - (x * pixelsState._pixelDensity + i)); - pixelsState.pixels[idx] = r; - pixelsState.pixels[idx + 1] = g; - pixelsState.pixels[idx + 2] = b; - pixelsState.pixels[idx + 3] = a; - } - } - } - }, - }, - { - key: "updatePixels", - value: function updatePixels(x, y, w, h) { - var pixelsState = this._pixelsState; - var pd = pixelsState._pixelDensity; - if ( - x === undefined && - y === undefined && - w === undefined && - h === undefined - ) { - x = 0; - y = 0; - w = this.width; - h = this.height; - } - x *= pd; - y *= pd; - w *= pd; - h *= pd; - if (this.gifProperties) { - this.gifProperties.frames[ - this.gifProperties.displayIndex - ].image = pixelsState.imageData; - } - this.drawingContext.putImageData( - pixelsState.imageData, - x, - y, - 0, - 0, - w, - h, - ); - }, ////////////////////////////////////////////// - // SHAPE | 2D Primitives - ////////////////////////////////////////////// - /** - * Generate a cubic Bezier representing an arc on the unit circle of total - * angle `size` radians, beginning `start` radians above the x-axis. Up to - * four of these curves are combined to make a full arc. - * - * See ecridge.com/bezier.pdf for an explanation of the method. - */ - }, - { - key: "_acuteArcToBezier", - value: function _acuteArcToBezier(start, size) { - // Evaluate constants. - var alpha = size / 2, - cos_alpha = Math.cos(alpha), - sin_alpha = Math.sin(alpha), - cot_alpha = 1 / Math.tan(alpha), - // This is how far the arc needs to be rotated. - phi = start + alpha, - cos_phi = Math.cos(phi), - sin_phi = Math.sin(phi), - lambda = (4 - cos_alpha) / 3, - mu = sin_alpha + (cos_alpha - lambda) * cot_alpha; - // Return rotated waypoints. - return { - ax: Math.cos(start).toFixed(7), - ay: Math.sin(start).toFixed(7), - bx: (lambda * cos_phi + mu * sin_phi).toFixed(7), - by: (lambda * sin_phi - mu * cos_phi).toFixed(7), - cx: (lambda * cos_phi - mu * sin_phi).toFixed(7), - cy: (lambda * sin_phi + mu * cos_phi).toFixed(7), - dx: Math.cos(start + size).toFixed(7), - dy: Math.sin(start + size).toFixed(7), - }; - } /* - * This function requires that: - * - * 0 <= start < TWO_PI - * - * start <= stop < start + TWO_PI - */, - }, - { - key: "arc", - value: function arc(x, y, w, h, start, stop, mode) { - var ctx = this.drawingContext; - var rx = w / 2; - var ry = h / 2; - var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. - var arcToDraw = 0; - var curves = []; - x += rx; - y += ry; - // Create curves - while (stop - start >= epsilon) { - arcToDraw = Math.min(stop - start, constants.HALF_PI); - curves.push(this._acuteArcToBezier(start, arcToDraw)); - start += arcToDraw; - } // Fill curves - - if (this._doFill) { - if (!this._clipping) ctx.beginPath(); - curves.forEach(function (curve, index) { - if (index === 0) { - ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); - } /* eslint-disable indent */ - - ctx.bezierCurveTo( - x + curve.bx * rx, - y + curve.by * ry, - x + curve.cx * rx, - y + curve.cy * ry, - x + curve.dx * rx, - y + curve.dy * ry, - ); - /* eslint-enable indent */ - }); - if (mode === constants.PIE || mode == null) { - ctx.lineTo(x, y); - } - ctx.closePath(); - if (!this._clipping) ctx.fill(); - } // Stroke curves - - if (this._doStroke) { - if (!this._clipping) ctx.beginPath(); - curves.forEach(function (curve, index) { - if (index === 0) { - ctx.moveTo(x + curve.ax * rx, y + curve.ay * ry); - } /* eslint-disable indent */ - - ctx.bezierCurveTo( - x + curve.bx * rx, - y + curve.by * ry, - x + curve.cx * rx, - y + curve.cy * ry, - x + curve.dx * rx, - y + curve.dy * ry, - ); - /* eslint-enable indent */ - }); - if (mode === constants.PIE) { - ctx.lineTo(x, y); - ctx.closePath(); - } else if (mode === constants.CHORD) { - ctx.closePath(); - } - if (!this._clipping) ctx.stroke(); - } - return this; - }, - }, - { - key: "ellipse", - value: function ellipse(args) { - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - var x = parseFloat(args[0]), - y = parseFloat(args[1]), - w = parseFloat(args[2]), - h = parseFloat(args[3]); - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - var kappa = 0.5522847498, - // control point offset horizontal - ox = (w / 2) * kappa, - // control point offset vertical - oy = (h / 2) * kappa, - // x-end - xe = x + w, - // y-end - ye = y + h, - // x-middle - xm = x + w / 2, - ym = y + h / 2; // y-middle - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x, ym); - ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - if (!this._clipping && doFill) { - ctx.fill(); - } - if (!this._clipping && doStroke) { - ctx.stroke(); - } - }, - }, - { - key: "line", - value: function line(x1, y1, x2, y2) { - var ctx = this.drawingContext; - if (!this._doStroke) { - return this; - } else if (this._getStroke() === styleEmpty) { - return this; - } - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.stroke(); - return this; - }, - }, - { - key: "point", - value: function point(x, y) { - var ctx = this.drawingContext; - if (!this._doStroke) { - return this; - } else if (this._getStroke() === styleEmpty) { - return this; - } - var s = this._getStroke(); - var f = this._getFill(); - if (!this._clipping) { - // swapping fill color to stroke and back after for correct point rendering - this._setFill(s); - } - if (!this._clipping) ctx.beginPath(); - ctx.arc(x, y, ctx.lineWidth / 2, 0, constants.TWO_PI, false); - if (!this._clipping) { - ctx.fill(); - this._setFill(f); - } - }, - }, - { - key: "quad", - value: function quad(x1, y1, x2, y2, x3, y3, x4, y4) { - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x3, y3); - ctx.lineTo(x4, y4); - ctx.closePath(); - if (!this._clipping && doFill) { - ctx.fill(); - } - if (!this._clipping && doStroke) { - ctx.stroke(); - } - return this; - }, - }, - { - key: "rect", - value: function rect(args) { - var x = args[0]; - var y = args[1]; - var w = args[2]; - var h = args[3]; - var tl = args[4]; - var tr = args[5]; - var br = args[6]; - var bl = args[7]; - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - if (!this._clipping) ctx.beginPath(); - if (typeof tl === "undefined") { - // No rounded corners - ctx.rect(x, y, w, h); - } else { - // At least one rounded corner - // Set defaults when not specified - if (typeof tr === "undefined") { - tr = tl; - } - if (typeof br === "undefined") { - br = tr; - } - if (typeof bl === "undefined") { - bl = br; - } // corner rounding must always be positive - - var absW = Math.abs(w); - var absH = Math.abs(h); - var hw = absW / 2; - var hh = absH / 2; - // Clip radii - if (absW < 2 * tl) { - tl = hw; - } - if (absH < 2 * tl) { - tl = hh; - } - if (absW < 2 * tr) { - tr = hw; - } - if (absH < 2 * tr) { - tr = hh; - } - if (absW < 2 * br) { - br = hw; - } - if (absH < 2 * br) { - br = hh; - } - if (absW < 2 * bl) { - bl = hw; - } - if (absH < 2 * bl) { - bl = hh; - } // Draw shape - - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x + tl, y); - ctx.arcTo(x + w, y, x + w, y + h, tr); - ctx.arcTo(x + w, y + h, x, y + h, br); - ctx.arcTo(x, y + h, x, y, bl); - ctx.arcTo(x, y, x + w, y, tl); - ctx.closePath(); - } - if (!this._clipping && this._doFill) { - ctx.fill(); - } - if (!this._clipping && this._doStroke) { - ctx.stroke(); - } - return this; - }, - }, - { - key: "triangle", - value: function triangle(args) { - var ctx = this.drawingContext; - var doFill = this._doFill, - doStroke = this._doStroke; - var x1 = args[0], - y1 = args[1]; - var x2 = args[2], - y2 = args[3]; - var x3 = args[4], - y3 = args[5]; - if (doFill && !doStroke) { - if (this._getFill() === styleEmpty) { - return this; - } - } else if (!doFill && doStroke) { - if (this._getStroke() === styleEmpty) { - return this; - } - } - if (!this._clipping) ctx.beginPath(); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x3, y3); - ctx.closePath(); - if (!this._clipping && doFill) { - ctx.fill(); - } - if (!this._clipping && doStroke) { - ctx.stroke(); - } - }, - }, - { - key: "endShape", - value: function endShape( - mode, - vertices, - isCurve, - isBezier, - isQuadratic, - isContour, - shapeKind, - ) { - if (vertices.length === 0) { - return this; - } - if (!this._doStroke && !this._doFill) { - return this; - } - var closeShape = mode === constants.CLOSE; - var v; - if (closeShape && !isContour) { - vertices.push(vertices[0]); - } - var i, j; - var numVerts = vertices.length; - if (isCurve && shapeKind === null) { - if (numVerts > 3) { - var b = [], - s = 1 - this._curveTightness; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo( - vertices[1][0], - vertices[1][1], - ); - for (i = 1; i + 2 < numVerts; i++) { - v = vertices[i]; - b[0] = [v[0], v[1]]; - b[1] = [ - v[0] + - (s * vertices[i + 1][0] - s * vertices[i - 1][0]) / - 6, - v[1] + - (s * vertices[i + 1][1] - s * vertices[i - 1][1]) / - 6, - ]; - b[2] = [ - vertices[i + 1][0] + - (s * vertices[i][0] - s * vertices[i + 2][0]) / 6, - vertices[i + 1][1] + - (s * vertices[i][1] - s * vertices[i + 2][1]) / 6, - ]; - b[3] = [vertices[i + 1][0], vertices[i + 1][1]]; - this.drawingContext.bezierCurveTo( - b[1][0], - b[1][1], - b[2][0], - b[2][1], - b[3][0], - b[3][1], - ); - } - if (closeShape) { - this.drawingContext.lineTo( - vertices[i + 1][0], - vertices[i + 1][1], - ); - } - this._doFillStrokeClose(closeShape); - } - } else if (isBezier && shapeKind === null) { - if (!this._clipping) this.drawingContext.beginPath(); - for (i = 0; i < numVerts; i++) { - if (vertices[i].isVert) { - if (vertices[i].moveTo) { - this.drawingContext.moveTo( - vertices[i][0], - vertices[i][1], - ); - } else { - this.drawingContext.lineTo( - vertices[i][0], - vertices[i][1], - ); - } - } else { - this.drawingContext.bezierCurveTo( - vertices[i][0], - vertices[i][1], - vertices[i][2], - vertices[i][3], - vertices[i][4], - vertices[i][5], - ); - } - } - this._doFillStrokeClose(closeShape); - } else if (isQuadratic && shapeKind === null) { - if (!this._clipping) this.drawingContext.beginPath(); - for (i = 0; i < numVerts; i++) { - if (vertices[i].isVert) { - if (vertices[i].moveTo) { - this.drawingContext.moveTo( - vertices[i][0], - vertices[i][1], - ); - } else { - this.drawingContext.lineTo( - vertices[i][0], - vertices[i][1], - ); - } - } else { - this.drawingContext.quadraticCurveTo( - vertices[i][0], - vertices[i][1], - vertices[i][2], - vertices[i][3], - ); - } - } - this._doFillStrokeClose(closeShape); - } else { - if (shapeKind === constants.POINTS) { - for (i = 0; i < numVerts; i++) { - v = vertices[i]; - if (this._doStroke) { - this._pInst.stroke(v[6]); - } - this._pInst.point(v[0], v[1]); - } - } else if (shapeKind === constants.LINES) { - for (i = 0; i + 1 < numVerts; i += 2) { - v = vertices[i]; - if (this._doStroke) { - this._pInst.stroke(vertices[i + 1][6]); - } - this._pInst.line( - v[0], - v[1], - vertices[i + 1][0], - vertices[i + 1][1], - ); - } - } else if (shapeKind === constants.TRIANGLES) { - for (i = 0; i + 2 < numVerts; i += 3) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(v[0], v[1]); - this.drawingContext.lineTo( - vertices[i + 1][0], - vertices[i + 1][1], - ); - this.drawingContext.lineTo( - vertices[i + 2][0], - vertices[i + 2][1], - ); - this.drawingContext.closePath(); - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 2][5]); - this.drawingContext.fill(); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 2][6]); - this.drawingContext.stroke(); - } - } - } else if (shapeKind === constants.TRIANGLE_STRIP) { - for (i = 0; i + 1 < numVerts; i++) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo( - vertices[i + 1][0], - vertices[i + 1][1], - ); - this.drawingContext.lineTo(v[0], v[1]); - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 1][6]); - } - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 1][5]); - } - if (i + 2 < numVerts) { - this.drawingContext.lineTo( - vertices[i + 2][0], - vertices[i + 2][1], - ); - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 2][6]); - } - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 2][5]); - } - } - this._doFillStrokeClose(closeShape); - } - } else if (shapeKind === constants.TRIANGLE_FAN) { - if (numVerts > 2) { - // For performance reasons, try to batch as many of the - // fill and stroke calls as possible. - if (!this._clipping) this.drawingContext.beginPath(); - for (i = 2; i < numVerts; i++) { - v = vertices[i]; - this.drawingContext.moveTo( - vertices[0][0], - vertices[0][1], - ); - this.drawingContext.lineTo( - vertices[i - 1][0], - vertices[i - 1][1], - ); - this.drawingContext.lineTo(v[0], v[1]); - this.drawingContext.lineTo( - vertices[0][0], - vertices[0][1], - ); - // If the next colour is going to be different, stroke / fill now - if (i < numVerts - 1) { - if ( - (this._doFill && v[5] !== vertices[i + 1][5]) || - (this._doStroke && v[6] !== vertices[i + 1][6]) - ) { - if (!this._clipping && this._doFill) { - this._pInst.fill(v[5]); - this.drawingContext.fill(); - this._pInst.fill(vertices[i + 1][5]); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(v[6]); - this.drawingContext.stroke(); - this._pInst.stroke(vertices[i + 1][6]); - } - this.drawingContext.closePath(); - if (!this._clipping) - this.drawingContext.beginPath(); // Begin the next one - } - } - } - this._doFillStrokeClose(closeShape); - } - } else if (shapeKind === constants.QUADS) { - for (i = 0; i + 3 < numVerts; i += 4) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo(v[0], v[1]); - for (j = 1; j < 4; j++) { - this.drawingContext.lineTo( - vertices[i + j][0], - vertices[i + j][1], - ); - } - this.drawingContext.lineTo(v[0], v[1]); - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 3][5]); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 3][6]); - } - this._doFillStrokeClose(closeShape); - } - } else if (shapeKind === constants.QUAD_STRIP) { - if (numVerts > 3) { - for (i = 0; i + 1 < numVerts; i += 2) { - v = vertices[i]; - if (!this._clipping) this.drawingContext.beginPath(); - if (i + 3 < numVerts) { - this.drawingContext.moveTo( - vertices[i + 2][0], - vertices[i + 2][1], - ); - this.drawingContext.lineTo(v[0], v[1]); - this.drawingContext.lineTo( - vertices[i + 1][0], - vertices[i + 1][1], - ); - this.drawingContext.lineTo( - vertices[i + 3][0], - vertices[i + 3][1], - ); - if (!this._clipping && this._doFill) { - this._pInst.fill(vertices[i + 3][5]); - } - if (!this._clipping && this._doStroke) { - this._pInst.stroke(vertices[i + 3][6]); - } - } else { - this.drawingContext.moveTo(v[0], v[1]); - this.drawingContext.lineTo( - vertices[i + 1][0], - vertices[i + 1][1], - ); - } - this._doFillStrokeClose(closeShape); - } - } - } else { - if (!this._clipping) this.drawingContext.beginPath(); - this.drawingContext.moveTo( - vertices[0][0], - vertices[0][1], - ); - for (i = 1; i < numVerts; i++) { - v = vertices[i]; - if (v.isVert) { - if (v.moveTo) { - if (closeShape) this.drawingContext.closePath(); - this.drawingContext.moveTo(v[0], v[1]); - } else { - this.drawingContext.lineTo(v[0], v[1]); - } - } - } - this._doFillStrokeClose(closeShape); - } - } - isCurve = false; - isBezier = false; - isQuadratic = false; - isContour = false; - if (closeShape) { - vertices.pop(); - } - return this; - }, ////////////////////////////////////////////// - // SHAPE | Attributes - ////////////////////////////////////////////// - }, - { - key: "strokeCap", - value: function strokeCap(cap) { - if ( - cap === constants.ROUND || - cap === constants.SQUARE || - cap === constants.PROJECT - ) { - this.drawingContext.lineCap = cap; - } - return this; - }, - }, - { - key: "strokeJoin", - value: function strokeJoin(join) { - if ( - join === constants.ROUND || - join === constants.BEVEL || - join === constants.MITER - ) { - this.drawingContext.lineJoin = join; - } - return this; - }, - }, - { - key: "strokeWeight", - value: function strokeWeight(w) { - if (typeof w === "undefined" || w === 0) { - // hack because lineWidth 0 doesn't work - this.drawingContext.lineWidth = 0.0001; - } else { - this.drawingContext.lineWidth = w; - } - return this; - }, - }, - { - key: "_getFill", - value: function _getFill() { - if (!this._cachedFillStyle) { - this._cachedFillStyle = this.drawingContext.fillStyle; - } - return this._cachedFillStyle; - }, - }, - { - key: "_setFill", - value: function _setFill(fillStyle) { - if (fillStyle !== this._cachedFillStyle) { - this.drawingContext.fillStyle = fillStyle; - this._cachedFillStyle = fillStyle; - } - }, - }, - { - key: "_getStroke", - value: function _getStroke() { - if (!this._cachedStrokeStyle) { - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - } - return this._cachedStrokeStyle; - }, - }, - { - key: "_setStroke", - value: function _setStroke(strokeStyle) { - if (strokeStyle !== this._cachedStrokeStyle) { - this.drawingContext.strokeStyle = strokeStyle; - this._cachedStrokeStyle = strokeStyle; - } - }, ////////////////////////////////////////////// - // SHAPE | Curves - ////////////////////////////////////////////// - }, - { - key: "bezier", - value: function bezier(x1, y1, x2, y2, x3, y3, x4, y4) { - this._pInst.beginShape(); - this._pInst.vertex(x1, y1); - this._pInst.bezierVertex(x2, y2, x3, y3, x4, y4); - this._pInst.endShape(); - return this; - }, - }, - { - key: "curve", - value: function curve(x1, y1, x2, y2, x3, y3, x4, y4) { - this._pInst.beginShape(); - this._pInst.curveVertex(x1, y1); - this._pInst.curveVertex(x2, y2); - this._pInst.curveVertex(x3, y3); - this._pInst.curveVertex(x4, y4); - this._pInst.endShape(); - return this; - }, ////////////////////////////////////////////// - // SHAPE | Vertex - ////////////////////////////////////////////// - }, - { - key: "_doFillStrokeClose", - value: function _doFillStrokeClose(closeShape) { - if (closeShape) { - this.drawingContext.closePath(); - } - if (!this._clipping && this._doFill) { - this.drawingContext.fill(); - } - if (!this._clipping && this._doStroke) { - this.drawingContext.stroke(); - } - }, ////////////////////////////////////////////// - // TRANSFORM - ////////////////////////////////////////////// - }, - { - key: "applyMatrix", - value: function applyMatrix(a, b, c, d, e, f) { - this.drawingContext.transform(a, b, c, d, e, f); - }, - }, - { - key: "resetMatrix", - value: function resetMatrix() { - this.drawingContext.setTransform(1, 0, 0, 1, 0, 0); - this.drawingContext.scale( - this._pInst._pixelDensity, - this._pInst._pixelDensity, - ); - return this; - }, - }, - { - key: "rotate", - value: function rotate(rad) { - this.drawingContext.rotate(rad); - }, - }, - { - key: "scale", - value: function scale(x, y) { - this.drawingContext.scale(x, y); - return this; - }, - }, - { - key: "translate", - value: function translate(x, y) { - // support passing a vector as the 1st parameter - if (x instanceof _main.default.Vector) { - y = x.y; - x = x.x; - } - this.drawingContext.translate(x, y); - return this; - }, ////////////////////////////////////////////// - // TYPOGRAPHY - // - ////////////////////////////////////////////// - }, - { - key: "_renderText", - value: function _renderText(p, line, x, y, maxY, minY) { - if (y < minY || y >= maxY) { - return; // don't render lines beyond our minY/maxY bounds (see #5785) - } - p.push(); // fix to #803 - if (!this._isOpenType()) { - // a system/browser font - // no stroke unless specified by user - if (this._doStroke && this._strokeSet) { - this.drawingContext.strokeText(line, x, y); - } - if (!this._clipping && this._doFill) { - // if fill hasn't been set by user, use default text fill - if (!this._fillSet) { - this._setFill(constants._DEFAULT_TEXT_FILL); - } - this.drawingContext.fillText(line, x, y); - } - } else { - // an opentype font, let it handle the rendering - this._textFont._renderPath(line, x, y, { - renderer: this, - }); - } - p.pop(); - return p; - }, - }, - { - key: "textWidth", - value: function textWidth(s) { - if (this._isOpenType()) { - return this._textFont._textWidth(s, this._textSize); - } - return this.drawingContext.measureText(s).width; - }, - }, - { - key: "_applyTextProperties", - value: function _applyTextProperties() { - var font; - var p = this._pInst; - this._setProperty("_textAscent", null); - this._setProperty("_textDescent", null); - font = this._textFont; - if (this._isOpenType()) { - font = this._textFont.font.familyName; - this._setProperty( - "_textStyle", - this._textFont.font.styleName, - ); - } - this.drawingContext.font = "" - .concat(this._textStyle || "normal", " ") - .concat(this._textSize || 12, "px ") - .concat(font || "sans-serif"); - this.drawingContext.textAlign = this._textAlign; - if (this._textBaseline === constants.CENTER) { - this.drawingContext.textBaseline = constants._CTX_MIDDLE; - } else { - this.drawingContext.textBaseline = this._textBaseline; - } - return p; - }, ////////////////////////////////////////////// - // STRUCTURE - ////////////////////////////////////////////// - // a push() operation is in progress. - // the renderer should return a 'style' object that it wishes to - // store on the push stack. - // derived renderers should call the base class' push() method - // to fetch the base style object. - }, - { - key: "push", - value: function push() { - this.drawingContext.save(); - // get the base renderer style - return _get( - _getPrototypeOf(Renderer2D.prototype), - "push", - this, - ).call(this); - }, // a pop() operation is in progress - // the renderer is passed the 'style' object that it returned - // from its push() method. - // derived renderers should pass this object to their base - // class' pop method - }, - { - key: "pop", - value: function pop(style) { - this.drawingContext.restore(); - // Re-cache the fill / stroke state - this._cachedFillStyle = this.drawingContext.fillStyle; - this._cachedStrokeStyle = this.drawingContext.strokeStyle; - _get(_getPrototypeOf(Renderer2D.prototype), "pop", this).call( - this, - style, - ); - }, - }, - ]); - return Renderer2D; - })(_main.default.Renderer); // Fix test - Renderer2D.prototype.text = function ( - str, - x, - y, - maxWidth, - maxHeight, - ) { - var baselineHacked; - // baselineHacked: (HACK) - // A temporary fix to conform to Processing's implementation - // of BASELINE vertical alignment in a bounding box - if (typeof maxWidth !== "undefined") { - if (this.drawingContext.textBaseline === constants.BASELINE) { - baselineHacked = true; - this.drawingContext.textBaseline = constants.TOP; - } - } - var p = _main.default.Renderer.prototype.text.apply( - this, - arguments, - ); - if (baselineHacked) { - this.drawingContext.textBaseline = constants.BASELINE; - } - return p; - }; - _main.default.Renderer2D = Renderer2D; - var _default = _main.default.Renderer2D; - exports.default = _default; - }, - { - "./constants": 286, - "./main": 298, - "./p5.Renderer": 301, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.number.to-fixed": 193, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.reflect.get": 203, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 303: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - var _main = _interopRequireDefault(_dereq_("./main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - _main.default.prototype._promisePreloads = [ - /* Example object - { - target: p5.prototype, // The target object to have the method modified - method: 'loadXAsync', // The name of the preload function to wrap - addCallbacks: true, // Whether to automatically handle the p5 callbacks - legacyPreloadSetup: { // Optional object to generate a legacy-style preload - method: 'loadX', // The name of the legacy preload function to generate - createBaseObject: function() { - return {}; - } // An optional function to create the base object for the legacy preload. - } - } - */ - ]; - _main.default.prototype.registerPromisePreload = function (setup) { - _main.default.prototype._promisePreloads.push(setup); - }; - var initialSetupRan = false; - _main.default.prototype._setupPromisePreloads = function () { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = this._promisePreloads[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()).done); - _iteratorNormalCompletion = true - ) { - var preloadSetup = _step.value; - var thisValue = this; - var method = preloadSetup.method, - addCallbacks = preloadSetup.addCallbacks, - legacyPreloadSetup = preloadSetup.legacyPreloadSetup; // Get the target object that the preload gets assigned to by default, - // that is the current object. - var target = preloadSetup.target || this; - var sourceFunction = target[method].bind(target); - // If the target is the p5 prototype, then only set it up on the first run per page - if (target === _main.default.prototype) { - if (initialSetupRan) { - continue; - } - thisValue = null; - sourceFunction = target[method]; - } // Replace the original method with a wrapped version - - target[method] = this._wrapPromisePreload( - thisValue, - sourceFunction, - addCallbacks, - ); - // If a legacy preload is required - if (legacyPreloadSetup) { - // What is the name for this legacy preload - var legacyMethod = legacyPreloadSetup.method; - // Wrap the already wrapped Promise-returning method with the legacy setup - target[legacyMethod] = this._legacyPreloadGenerator( - thisValue, - legacyPreloadSetup, - target[method], - ); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - initialSetupRan = true; - }; - _main.default.prototype._wrapPromisePreload = function ( - thisValue, - fn, - addCallbacks, - ) { - var replacementFunction = function replacementFunction() { - var _this = this; - // Uses the current preload counting mechanism for now. - this._incrementPreload(); - // A variable for the callback function if specified - var callback = null; - // A variable for the errorCallback function if specified - var errorCallback = null; - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - if (addCallbacks) { - // Loop from the end of the args array, pulling up to two functions off of - // the end and putting them in fns - for (var i = args.length - 1; i >= 0 && !errorCallback; i--) { - if (typeof args[i] !== "function") { - break; - } - errorCallback = callback; - callback = args.pop(); - } - } // Call the underlying function and pass it to Promise.resolve, - // so that even if it didn't return a promise we can still - // act on the result as if it did. - - var promise = Promise.resolve(fn.apply(this, args)); - // Add the optional callbacks - if (callback) { - promise.then(callback); - } - if (errorCallback) { - promise.catch(errorCallback); - } // Decrement the preload counter only if the promise resolved - - promise.then(function () { - return _this._decrementPreload(); - }); - // Return the original promise so that neither callback changes the result. - return promise; - }; - if (thisValue) { - replacementFunction = replacementFunction.bind(thisValue); - } - return replacementFunction; - }; - var objectCreator = function objectCreator() { - return {}; - }; - _main.default.prototype._legacyPreloadGenerator = function ( - thisValue, - legacyPreloadSetup, - fn, - ) { - // Create a function that will generate an object before the preload is - // launched. For example, if the object should be an array or be an instance - // of a specific class. - var baseValueGenerator = - legacyPreloadSetup.createBaseObject || objectCreator; - var returnedFunction = function returnedFunction() { - var _this2 = this; - // Our then clause needs to run before setup, so we also increment the preload counter - this._incrementPreload(); - // Generate the return value based on the generator. - for ( - var _len2 = arguments.length, - args = new Array(_len2), - _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - var returnValue = baseValueGenerator.apply(this, args); - // Run the original wrapper - fn.apply(this, args).then(function (data) { - // Copy each key from the resolved value into returnValue - Object.assign(returnValue, data); - // Decrement the preload counter, to allow setup to continue. - _this2._decrementPreload(); - }); - return returnValue; - }; - if (thisValue) { - returnedFunction = returnedFunction.bind(thisValue); - } - return returnedFunction; - }; - }, - { - "./main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.assign": 194, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.promise": 201, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 304: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - var constants = _interopRequireWildcard(_dereq_("./constants")); - _dereq_("./p5.Graphics"); - _dereq_("./p5.Renderer2D"); - _dereq_("../webgl/p5.RendererGL"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - - var defaultId = "defaultCanvas0"; // this gets set again in createCanvas - var defaultClass = "p5Canvas"; - /** - * Creates a canvas element in the document and sets its dimensions - * in pixels. This method should be called only once at the start of setup(). - * Calling createCanvas more than once in a - * sketch will result in very unpredictable behavior. If you want more than - * one drawing canvas you could use createGraphics() - * (hidden by default but it can be shown). - * - * Important note: in 2D mode (i.e. when `p5.Renderer` is not set) the origin (0,0) - * is positioned at the top left of the screen. In 3D mode (i.e. when `p5.Renderer` - * is set to `WEBGL`), the origin is positioned at the center of the canvas. - * See [this issue](https://github.com/processing/p5.js/issues/1545) for more information. - * - * A WebGL canvas will use a WebGL2 context if it is supported by the browser. - * Check the webglVersion property to check what - * version is being used, or call setAttributes({ version: 1 }) - * to create a WebGL1 context. - * - * The system variables width and height are set by the parameters passed to this - * function. If createCanvas() is not used, the - * window will be given a default size of 100×100 pixels. - * - * Optionally, an existing canvas can be passed using a selector, ie. `document.getElementById('')`. - * If specified, avoid using `setAttributes()` afterwards, as this will remove and recreate the existing canvas. - * - * For more ways to position the canvas, see the - * - * positioning the canvas wiki page. - * - * @method createCanvas - * @param {Number} w width of the canvas - * @param {Number} h height of the canvas - * @param {Constant} [renderer] either P2D or WEBGL - * @param {HTMLCanvasElement} [canvas] existing html canvas element - * @return {p5.Renderer} pointer to p5.Renderer holding canvas - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 50); - * background(153); - * line(0, 0, width, height); - * } - * - *
                                  - * - * @alt - * Black line extending from top-left of canvas to bottom right. - */ - /** - * @method createCanvas - * @param {Number} w - * @param {Number} h - * @param {HTMLCanvasElement} [canvas] - * @return {p5.Renderer} pointer to p5.Renderer holding canvas - */ - _main.default.prototype.createCanvas = function ( - w, - h, - renderer, - canvas, - ) { - _main.default._validateParameters("createCanvas", arguments); - //optional: renderer, otherwise defaults to p2d - var r; - if (arguments[2] instanceof HTMLCanvasElement) { - renderer = constants.P2D; - canvas = arguments[2]; - } else { - r = renderer || constants.P2D; - } - var c; - if (canvas) { - c = document.getElementById(defaultId); - if (c) { - c.parentNode.removeChild(c); //replace the existing defaultCanvas - } - c = canvas; - this._defaultGraphicsCreated = false; - } else { - if (r === constants.WEBGL) { - c = document.getElementById(defaultId); - if (c) { - //if defaultCanvas already exists - c.parentNode.removeChild(c); //replace the existing defaultCanvas - var thisRenderer = this._renderer; - this._elements = this._elements.filter(function (e) { - return e !== thisRenderer; - }); - } - c = document.createElement("canvas"); - c.id = defaultId; - c.classList.add(defaultClass); - } else { - if (!this._defaultGraphicsCreated) { - if (canvas) { - c = canvas; - } else { - c = document.createElement("canvas"); - } - var i = 0; - while (document.getElementById("defaultCanvas".concat(i))) { - i++; - } - defaultId = "defaultCanvas".concat(i); - c.id = defaultId; - c.classList.add(defaultClass); - } else { - // resize the default canvas if new one is created - c = this.canvas; - } - } // set to invisible if still in setup (to prevent flashing with manipulate) - - if (!this._setupDone) { - c.dataset.hidden = true; // tag to show later - c.style.visibility = "hidden"; - } - if (this._userNode) { - // user input node case - this._userNode.appendChild(c); - } else { - //create main element - if (document.getElementsByTagName("main").length === 0) { - var m = document.createElement("main"); - document.body.appendChild(m); - } //append canvas to main - - document.getElementsByTagName("main")[0].appendChild(c); - } - } // Init our graphics renderer - //webgl mode - - if (r === constants.WEBGL) { - this._setProperty( - "_renderer", - new _main.default.RendererGL(c, this, true), - ); - this._elements.push(this._renderer); - } else { - //P2D mode - if (!this._defaultGraphicsCreated) { - this._setProperty( - "_renderer", - new _main.default.Renderer2D(c, this, true), - ); - this._defaultGraphicsCreated = true; - this._elements.push(this._renderer); - } - } - this._renderer.resize(w, h); - this._renderer._applyDefaults(); - return this._renderer; - }; - /** - * Resizes the canvas to given width and height. The canvas will be cleared - * and draw will be called immediately, allowing the sketch to re-render itself - * in the resized canvas. - * @method resizeCanvas - * @param {Number} w width of the canvas - * @param {Number} h height of the canvas - * @param {Boolean} [noRedraw] don't redraw the canvas immediately - * @example - *
                                  - * function setup() { - * createCanvas(windowWidth, windowHeight); - * } - * - * function draw() { - * background(0, 100, 200); - * } - * - * function windowResized() { - * resizeCanvas(windowWidth, windowHeight); - * } - *
                                  - * - * @alt - * No image displayed. - */ - _main.default.prototype.resizeCanvas = function (w, h, noRedraw) { - _main.default._validateParameters("resizeCanvas", arguments); - if (this._renderer) { - // save canvas properties - var props = {}; - for (var key in this.drawingContext) { - var val = this.drawingContext[key]; - if (_typeof(val) !== "object" && typeof val !== "function") { - props[key] = val; - } - } - this.width = w; - this.height = h; - // Make sure width and height are updated before the renderer resizes so - // that framebuffers updated from the resize read the correct size - this._renderer.resize(w, h); - // reset canvas properties - for (var savedKey in props) { - try { - this.drawingContext[savedKey] = props[savedKey]; - } catch (err) { - // ignore read-only property errors - } - } - if (!noRedraw) { - this.redraw(); - } - } //accessible Outputs - - if (this._addAccsOutput()) { - this._updateAccsOutput(); - } - }; - /** - * Removes the default canvas for a p5 sketch that doesn't require a canvas - * @method noCanvas - * @example - *
                                  - * - * function setup() { - * noCanvas(); - * } - * - *
                                  - * - * @alt - * no image displayed - */ - _main.default.prototype.noCanvas = function () { - if (this.canvas) { - this.canvas.parentNode.removeChild(this.canvas); - } - }; - /** - * Creates and returns a new p5.Graphics object. Use this class if you need - * to draw into an off-screen graphics buffer. The two parameters define the - * width and height in pixels. - * - * A WebGL p5.Graphics will use a WebGL2 context if it is supported by the browser. - * Check the pg.webglVersion property of the renderer - * to check what version is being used, or call pg.setAttributes({ version: 1 }) - * to create a WebGL1 context. - * - * Optionally, an existing canvas can be passed using a selector, ie. document.getElementById(''). - * By default this canvas will be hidden (offscreen buffer), to make visible, set element's style to display:block; - * - * @method createGraphics - * @param {Number} w width of the offscreen graphics buffer - * @param {Number} h height of the offscreen graphics buffer - * @param {Constant} [renderer] either P2D or WEBGL - * undefined defaults to p2d - * @param {HTMLCanvasElement} [canvas] existing html canvas element - * @return {p5.Graphics} offscreen graphics buffer - * @example - *
                                  - * - * let pg; - * function setup() { - * createCanvas(100, 100); - * pg = createGraphics(100, 100); - * } - * - * function draw() { - * background(200); - * pg.background(100); - * pg.noStroke(); - * pg.ellipse(pg.width / 2, pg.height / 2, 50, 50); - * image(pg, 50, 50); - * image(pg, 0, 0, 50, 50); - * } - * - *
                                  - * - * @alt - * 4 grey squares alternating light and dark grey. White quarter circle mid-left. - */ - /** - * @method createGraphics - * @param {Number} w - * @param {Number} h - * @param {HTMLCanvasElement} [canvas] - * @return {p5.Graphics} offscreen graphics buffer - */ - _main.default.prototype.createGraphics = function (w, h) { - for ( - var _len = arguments.length, - args = new Array(_len > 2 ? _len - 2 : 0), - _key = 2; - _key < _len; - _key++ - ) { - args[_key - 2] = arguments[_key]; - } /** - * args[0] is expected to be renderer - * args[1] is expected to be canvas - */ - - if (args[0] instanceof HTMLCanvasElement) { - args[1] = args[0]; - args[0] = constants.P2D; - } - _main.default._validateParameters("createGraphics", arguments); - return new _main.default.Graphics(w, h, args[0], this, args[1]); - }; - /** - * Creates and returns a new p5.Framebuffer, a - * high-performance WebGL object that you can draw to and then use as a texture. - * - * Options can include: - * - `format`: The data format of the texture, either `UNSIGNED_BYTE`, `FLOAT`, or `HALF_FLOAT`. The default is `UNSIGNED_BYTE`. - * - `channels`: What color channels to store, either `RGB` or `RGBA`. The default is to match the channels in the main canvas (with alpha unless disabled with `setAttributes`.) - * - `depth`: A boolean, whether or not to include a depth buffer. Defaults to true. - * - `depthFormat`: The data format for depth information, either `UNSIGNED_INT` or `FLOAT`. The default is `FLOAT` if available, or `UNSIGNED_INT` otherwise. - * - `stencil`: A boolean, whether or not to include a stencil buffer, which can be used for masking. This may only be used if also using a depth buffer. Defaults to the value of `depth`, which is true if not provided. - * - `antialias`: Boolean or Number, whether or not to render with antialiased edges, and if so, optionally the number of samples to use. Defaults to whether or not the main canvas is antialiased, using a default of 2 samples if so. Antialiasing is only supported when WebGL 2 is available. - * - `width`: The width of the texture. Defaults to matching the main canvas. - * - `height`: The height of the texture. Defaults to matching the main canvas. - * - `density`: The pixel density of the texture. Defaults to the pixel density of the main canvas. - * - `textureFiltering`: Either `LINEAR` (nearby pixels will be interpolated when reading values from the color texture) or `NEAREST` (no interpolation.) Generally, use `LINEAR` when using the texture as an image, and use `NEAREST` if reading the texture as data. Defaults to `LINEAR`. - * - * If `width`, `height`, or `density` are specified, then the framebuffer will - * keep that size until manually changed. Otherwise, it will be autosized, and - * it will update to match the main canvas's size and density when the main - * canvas changes. - * - * @method createFramebuffer - * @param {Object} [options] An optional object with configuration - * - * @example - *
                                  - * - * let prev, next, cam; - * function setup() { - * createCanvas(100, 100, WEBGL); - * prev = createFramebuffer({ format: FLOAT }); - * next = createFramebuffer({ format: FLOAT }); - * cam = createCamera(); - * noStroke(); - * } - * - * function draw() { - * // Swap prev and next so that we can use the previous - * // frame as a texture when drawing the current frame - * [prev, next] = [next, prev]; - * - * // Draw to the framebuffer - * next.begin(); - * background(255); - * - * push(); - * // Draw the previous texture farther away, but scaled - * // up to fill the screen, plus a bit extra scale so it grows - * translate(0, 0, -200); - * scale(1.001 * (200 + cam.eyeZ) / cam.eyeZ); - * tint(255, 253); - * image(prev, -width/2, -height/2); - * pop(); - * - * push(); - * normalMaterial(); - * translate(25*sin(frameCount * 0.014), 25*sin(frameCount * 0.02), 0); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(12); - * pop(); - * next.end(); - * - * image(next, -width/2, -height/2); - * } - * - *
                                  - * - * @alt - * A red, green, and blue box (using normalMaterial) moves and rotates around - * the canvas, leaving a trail behind it that slowly grows and fades away. - */ - _main.default.prototype.createFramebuffer = function (options) { - return new _main.default.Framebuffer(this, options); - }; - /** - * Blends the pixels in the display window according to the defined mode. - * There is a choice of the following modes to blend the source pixels (A) - * with the ones of pixels already in the display window (B): - *
                                    - *
                                  • BLEND - linear interpolation of colours: C = - * A*factor + B. This is the default blending mode.
                                  • - *
                                  • ADD - sum of A and B
                                  • - *
                                  • DARKEST - only the darkest colour succeeds: C = - * min(A*factor, B).
                                  • - *
                                  • LIGHTEST - only the lightest colour succeeds: C = - * max(A*factor, B).
                                  • - *
                                  • DIFFERENCE - subtract colors from underlying image. - * (2D)
                                  • - *
                                  • EXCLUSION - similar to DIFFERENCE, but less - * extreme.
                                  • - *
                                  • MULTIPLY - multiply the colors, result will always be - * darker.
                                  • - *
                                  • SCREEN - opposite multiply, uses inverse values of the - * colors.
                                  • - *
                                  • REPLACE - the pixels entirely replace the others and - * don't utilize alpha (transparency) values.
                                  • - *
                                  • REMOVE - removes pixels from B with the alpha strength of A.
                                  • - *
                                  • OVERLAY - mix of MULTIPLY and SCREEN - * . Multiplies dark values, and screens light values. (2D)
                                  • - *
                                  • HARD_LIGHT - SCREEN when greater than 50% - * gray, MULTIPLY when lower. (2D)
                                  • - *
                                  • SOFT_LIGHT - mix of DARKEST and - * LIGHTEST. Works like OVERLAY, but not as harsh. (2D) - *
                                  • - *
                                  • DODGE - lightens light tones and increases contrast, - * ignores darks. (2D)
                                  • - *
                                  • BURN - darker areas are applied, increasing contrast, - * ignores lights. (2D)
                                  • - *
                                  • SUBTRACT - remainder of A and B (3D)
                                  • - *
                                  - * - * (2D) indicates that this blend mode only works in the 2D renderer.
                                  - * (3D) indicates that this blend mode only works in the WEBGL renderer. - * - * @method blendMode - * @param {Constant} mode blend mode to set for canvas. - * either BLEND, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY, - * EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, - * SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT - * @example - *
                                  - * - * blendMode(LIGHTEST); - * strokeWeight(30); - * stroke(80, 150, 255); - * line(25, 25, 75, 75); - * stroke(255, 50, 50); - * line(75, 25, 25, 75); - * - *
                                  - * - *
                                  - * - * blendMode(MULTIPLY); - * strokeWeight(30); - * stroke(80, 150, 255); - * line(25, 25, 75, 75); - * stroke(255, 50, 50); - * line(75, 25, 25, 75); - * - *
                                  - * - * @alt - * translucent image thick red & blue diagonal rounded lines intersecting center - * Thick red & blue diagonal rounded lines intersecting center. dark at overlap - */ - _main.default.prototype.blendMode = function (mode) { - _main.default._validateParameters("blendMode", arguments); - if (mode === constants.NORMAL) { - // Warning added 3/26/19, can be deleted in future (1.0 release?) - console.warn( - "NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead.", - ); - mode = constants.BLEND; - } - this._renderer.blendMode(mode); - }; - /** - * The p5.js API provides a lot of functionality for creating graphics, but there is - * some native HTML5 Canvas functionality that is not exposed by p5. You can still call - * it directly using the variable `drawingContext`, as in the example shown. This is - * the equivalent of calling `canvas.getContext('2d');` or `canvas.getContext('webgl');`. - * See this - * - * reference for the native canvas API for possible drawing functions you can call. - * - * @property drawingContext - * @example - *
                                  - * - * function setup() { - * drawingContext.shadowOffsetX = 5; - * drawingContext.shadowOffsetY = -5; - * drawingContext.shadowBlur = 10; - * drawingContext.shadowColor = 'black'; - * background(200); - * ellipse(width / 2, height / 2, 50, 50); - * } - * - *
                                  - * - * @alt - * white ellipse with shadow blur effect around edges - */ - var _default = _main.default; - exports.default = _default; - }, - { - "../webgl/p5.RendererGL": 355, - "./constants": 286, - "./main": 298, - "./p5.Graphics": 300, - "./p5.Renderer2D": 302, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 305: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.slice"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var constants = _interopRequireWildcard(_dereq_("../constants")); - var _helpers = _interopRequireDefault(_dereq_("../helpers")); - _dereq_("../friendly_errors/fes_core"); - _dereq_("../friendly_errors/file_errors"); - _dereq_("../friendly_errors/validate_params"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Shape - * @submodule 2D Primitives - * @for p5 - * @requires core - * @requires constants - */ - /** - * This function does 3 things: - * - * 1. Bounds the desired start/stop angles for an arc (in radians) so that: - * - * 0 <= start < TWO_PI ; start <= stop < start + TWO_PI - * - * This means that the arc rendering functions don't have to be concerned - * with what happens if stop is smaller than start, or if the arc 'goes - * round more than once', etc.: they can just start at start and increase - * until stop and the correct arc will be drawn. - * - * 2. Optionally adjusts the angles within each quadrant to counter the naive - * scaling of the underlying ellipse up from the unit circle. Without - * this, the angles become arbitrary when width != height: 45 degrees - * might be drawn at 5 degrees on a 'wide' ellipse, or at 85 degrees on - * a 'tall' ellipse. - * - * 3. Flags up when start and stop correspond to the same place on the - * underlying ellipse. This is useful if you want to do something special - * there (like rendering a whole ellipse instead). - */ - - _main.default.prototype._normalizeArcAngles = function ( - start, - stop, - width, - height, - correctForScaling, - ) { - var epsilon = 0.00001; // Smallest visible angle on displays up to 4K. - var separation; - // The order of the steps is important here: each one builds upon the - // adjustments made in the steps that precede it. - // Constrain both start and stop to [0,TWO_PI). - start = - start - constants.TWO_PI * Math.floor(start / constants.TWO_PI); - stop = - stop - constants.TWO_PI * Math.floor(stop / constants.TWO_PI); - // Get the angular separation between the requested start and stop points. - // - // Technically this separation only matches what gets drawn if - // correctForScaling is enabled. We could add a more complicated calculation - // for when the scaling is uncorrected (in which case the drawn points could - // end up pushed together or pulled apart quite dramatically relative to what - // was requested), but it would make things more opaque for little practical - // benefit. - // - // (If you do disable correctForScaling and find that correspondToSamePoint - // is set too aggressively, the easiest thing to do is probably to just make - // epsilon smaller...) - separation = Math.min( - Math.abs(start - stop), - constants.TWO_PI - Math.abs(start - stop), - ); - // Optionally adjust the angles to counter linear scaling. - if (correctForScaling) { - if (start <= constants.HALF_PI) { - start = Math.atan((width / height) * Math.tan(start)); - } else if ( - start > constants.HALF_PI && - start <= 3 * constants.HALF_PI - ) { - start = - Math.atan((width / height) * Math.tan(start)) + constants.PI; - } else { - start = - Math.atan((width / height) * Math.tan(start)) + - constants.TWO_PI; - } - if (stop <= constants.HALF_PI) { - stop = Math.atan((width / height) * Math.tan(stop)); - } else if ( - stop > constants.HALF_PI && - stop <= 3 * constants.HALF_PI - ) { - stop = - Math.atan((width / height) * Math.tan(stop)) + constants.PI; - } else { - stop = - Math.atan((width / height) * Math.tan(stop)) + - constants.TWO_PI; - } - } // Ensure that start <= stop < start + TWO_PI. - - if (start > stop) { - stop += constants.TWO_PI; - } - return { - start: start, - stop: stop, - correspondToSamePoint: separation < epsilon, - }; - }; - /** - * Draws an arc to the canvas. Arcs are drawn along the outer edge of an ellipse - * (oval) defined by the `x`, `y`, `w`, and `h` parameters. Use the `start` and `stop` - * parameters to specify the angles (in radians) at which to draw the arc. Arcs are - * always drawn clockwise from `start` to `stop`. The origin of the arc's ellipse may - * be changed with the ellipseMode() function. - * - * The optional `mode` parameter determines the arc's fill style. The fill modes are - * a semi-circle (`OPEN`), a closed semi-circle (`CHORD`), or a closed pie segment (`PIE`). - * - * @method arc - * @param {Number} x x-coordinate of the arc's ellipse. - * @param {Number} y y-coordinate of the arc's ellipse. - * @param {Number} w width of the arc's ellipse by default. - * @param {Number} h height of the arc's ellipse by default. - * @param {Number} start angle to start the arc, specified in radians. - * @param {Number} stop angle to stop the arc, specified in radians. - * @param {Constant} [mode] optional parameter to determine the way of drawing - * the arc. either CHORD, PIE, or OPEN. - * @param {Integer} [detail] optional parameter for WebGL mode only. This is to - * specify the number of vertices that makes up the - * perimeter of the arc. Default value is 25. Won't - * draw a stroke for a detail of more than 50. - * @chainable - * - * @example - *
                                  - * - * arc(50, 55, 50, 50, 0, HALF_PI); - * noFill(); - * arc(50, 55, 60, 60, HALF_PI, PI); - * arc(50, 55, 70, 70, PI, PI + QUARTER_PI); - * arc(50, 55, 80, 80, PI + QUARTER_PI, TWO_PI); - * describe( - * 'A shattered outline of an ellipse with a quarter of a white circle at the bottom-right.' - * ); - * - *
                                  - * - *
                                  - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI); - * describe('A white ellipse with the top-right third missing. The bottom is outlined in black.'); - * - *
                                  - * - *
                                  - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, OPEN); - * describe( - * 'A white ellipse missing a section from the top-right. The bottom is outlined in black.' - * ); - * - *
                                  - * - *
                                  - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, CHORD); - * describe('A white ellipse with a black outline missing a section from the top-right.'); - * - *
                                  - * - *
                                  - * - * arc(50, 50, 80, 80, 0, PI + QUARTER_PI, PIE); - * describe('A white ellipse with a black outline. The top-right third is missing.'); - * - *
                                  - * - */ - _main.default.prototype.arc = function ( - x, - y, - w, - h, - start, - stop, - mode, - detail, - ) { - _main.default._validateParameters("arc", arguments); - // if the current stroke and fill settings wouldn't result in something - // visible, exit immediately - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } - if (start === stop) { - return this; - } - start = this._toRadians(start); - stop = this._toRadians(stop); - // p5 supports negative width and heights for ellipses - w = Math.abs(w); - h = Math.abs(h); - var vals = _helpers.default.modeAdjust( - x, - y, - w, - h, - this._renderer._ellipseMode, - ); - var angles = this._normalizeArcAngles( - start, - stop, - vals.w, - vals.h, - true, - ); - if (angles.correspondToSamePoint) { - // If the arc starts and ends at (near enough) the same place, we choose to - // draw an ellipse instead. This is preferable to faking an ellipse (by - // making stop ever-so-slightly less than start + TWO_PI) because the ends - // join up to each other rather than at a vertex at the centre (leaving - // an unwanted spike in the stroke/fill). - this._renderer.ellipse([vals.x, vals.y, vals.w, vals.h, detail]); - } else { - this._renderer.arc( - vals.x, - vals.y, - vals.w, - vals.h, - angles.start, // [0, TWO_PI) - angles.stop, // [start, start + TWO_PI) - mode, - detail, - ); - //accessible Outputs - if ( - this._accessibleOutputs.grid || - this._accessibleOutputs.text - ) { - this._accsOutput("arc", [ - vals.x, - vals.y, - vals.w, - vals.h, - angles.start, - angles.stop, - mode, - ]); - } - } - return this; - }; - /** - * Draws an ellipse (oval) to the canvas. An ellipse with equal width and height - * is a circle. By default, the first two parameters set the location of the - * center of the ellipse. The third and fourth parameters set the shape's width - * and height, respectively. The origin may be changed with the - * ellipseMode() function. - * - * If no height is specified, the value of width is used for both the width and - * height. If a negative height or width is specified, the absolute value is - * taken. - * - * @method ellipse - * @param {Number} x x-coordinate of the center of the ellipse. - * @param {Number} y y-coordinate of the center of the ellipse. - * @param {Number} w width of the ellipse. - * @param {Number} [h] height of the ellipse. - * @chainable - * @example - *
                                  - * - * ellipse(56, 46, 55, 55); - * describe('A white ellipse with black outline in middle of a gray canvas.'); - * - *
                                  - * - */ - /** - * @method ellipse - * @param {Number} x - * @param {Number} y - * @param {Number} w - * @param {Number} h - * @param {Integer} [detail] optional parameter for WebGL mode only. This is to - * specify the number of vertices that makes up the - * perimeter of the ellipse. Default value is 25. Won't - * draw a stroke for a detail of more than 50. - */ - _main.default.prototype.ellipse = function (x, y, w, h, detailX) { - _main.default._validateParameters("ellipse", arguments); - return this._renderEllipse.apply(this, arguments); - }; - /** - * Draws a circle to the canvas. A circle is a round shape. Every point on the - * edge of a circle is the same distance from its center. By default, the first - * two parameters set the location of the center of the circle. The third - * parameter sets the shape's width and height (diameter). The origin may be - * changed with the ellipseMode() function. - * - * @method circle - * @param {Number} x x-coordinate of the center of the circle. - * @param {Number} y y-coordinate of the center of the circle. - * @param {Number} d diameter of the circle. - * @chainable - * @example - *
                                  - * - * circle(30, 30, 20); - * describe('A white circle with black outline in the middle of a gray canvas.'); - * - *
                                  - * - */ - _main.default.prototype.circle = function () { - _main.default._validateParameters("circle", arguments); - var args = Array.prototype.slice.call(arguments, 0, 2); - args.push(arguments[2]); - args.push(arguments[2]); - return this._renderEllipse.apply(this, _toConsumableArray(args)); - }; - // internal method for drawing ellipses (without parameter validation) - _main.default.prototype._renderEllipse = function ( - x, - y, - w, - h, - detailX, - ) { - // if the current stroke and fill settings wouldn't result in something - // visible, exit immediately - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } // p5 supports negative width and heights for rects - - if (w < 0) { - w = Math.abs(w); - } - if (typeof h === "undefined") { - // Duplicate 3rd argument if only 3 given. - h = w; - } else if (h < 0) { - h = Math.abs(h); - } - var vals = _helpers.default.modeAdjust( - x, - y, - w, - h, - this._renderer._ellipseMode, - ); - this._renderer.ellipse([vals.x, vals.y, vals.w, vals.h, detailX]); - //accessible Outputs - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput("ellipse", [vals.x, vals.y, vals.w, vals.h]); - } - return this; - }; - /** - * Draws a line, a straight path between two points. Its default width is one pixel. - * The version of `line()` with four parameters draws the line in 2D. To color a line, - * use the stroke() function. To change its width, use the - * strokeWeight() function. A line - * can't be filled, so the fill() function won't affect - * the color of a line. - * - * The version of `line()` with six parameters allows the line to be drawn in 3D - * space. Doing so requires adding the `WEBGL` argument to - * createCanvas(). - * - * @method line - * @param {Number} x1 the x-coordinate of the first point. - * @param {Number} y1 the y-coordinate of the first point. - * @param {Number} x2 the x-coordinate of the second point. - * @param {Number} y2 the y-coordinate of the second point. - * @chainable - * @example - *
                                  - * - * line(30, 20, 85, 75); - * describe( - * 'A black line on a gray canvas running from top-center to bottom-right.' - * ); - * - *
                                  - * - *
                                  - * - * line(30, 20, 85, 20); - * stroke(126); - * line(85, 20, 85, 75); - * stroke(255); - * line(85, 75, 30, 75); - * describe( - * 'Three lines drawn in grayscale on a gray canvas. They form the top, right, and bottom sides of a square.' - * ); - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('A black line drawn on a gray canvas.'); - * } - * - * function draw() { - * background(220); - * line(0, 0, 0, 10, 10, 0); - * } - * - *
                                  - * - */ - /** - * @method line - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 the z-coordinate of the first point. - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 the z-coordinate of the second point. - * @chainable - */ - _main.default.prototype.line = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("line", args); - if (this._renderer._doStroke) { - var _this$_renderer; - (_this$_renderer = this._renderer).line.apply( - _this$_renderer, - args, - ); - } //accessible Outputs - - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput("line", args); - } - return this; - }; - /** - * Draws a point, a single coordinate in space. Its default size is one pixel. The first two - * parameters are the point's x- and y-coordinates, respectively. To color a point, use - * the stroke() function. To change its size, use the - * strokeWeight() function. - * - * The version of `point()` with three parameters allows the point to be drawn in 3D - * space. Doing so requires adding the `WEBGL` argument to - * createCanvas(). - * - * The version of point() with one parameter allows the point's location to be set with - * a p5.Vector object. - * - * @method point - * @param {Number} x the x-coordinate. - * @param {Number} y the y-coordinate. - * @param {Number} [z] the z-coordinate (for WebGL mode). - * @chainable - * @example - *
                                  - * - * point(30, 20); - * point(85, 20); - * point(85, 75); - * point(30, 75); - * describe( - * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' - * ); - * - *
                                  - * - *
                                  - * - * point(30, 20); - * point(85, 20); - * stroke('purple'); - * strokeWeight(10); - * point(85, 75); - * point(30, 75); - * describe( - * 'Four points drawn on a gray canvas. Two are black and two are purple. The points form the corners of a square.' - * ); - * - *
                                  - * - *
                                  - * - * let a = createVector(10, 10); - * point(a); - * let b = createVector(10, 20); - * point(b); - * let c = createVector(20, 10); - * point(c); - * let d = createVector(20, 20); - * point(d); - * describe( - * 'Four small, black points drawn on a gray canvas. The points form the corners of a square.' - * ); - * - *
                                  - * - */ - /** - * @method point - * @param {p5.Vector} coordinateVector the coordinate vector. - * @chainable - */ - _main.default.prototype.point = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("point", args); - if (this._renderer._doStroke) { - if ( - args.length === 1 && - args[0] instanceof _main.default.Vector - ) { - this._renderer.point.call( - this._renderer, - args[0].x, - args[0].y, - args[0].z, - ); - } else { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).point.apply( - _this$_renderer2, - args, - ); - //accessible Outputs - if ( - this._accessibleOutputs.grid || - this._accessibleOutputs.text - ) { - this._accsOutput("point", args); - } - } - } - return this; - }; - /** - * Draws a quad to the canvas. A quad is a quadrilateral, a four-sided - * polygon. Some examples of quads include rectangles, squares, rhombuses, - * and trapezoids. The first pair of parameters (`x1`,`y1`) sets the quad's - * first point. The following pairs of parameters set the coordinates for - * its next three points. Parameters should proceed clockwise or - * counter-clockwise around the shape. - * - * The version of `quad()` with twelve parameters allows the quad to be drawn - * in 3D space. Doing so requires adding the `WEBGL` argument to - * createCanvas(). - * - * @method quad - * @param {Number} x1 the x-coordinate of the first point. - * @param {Number} y1 the y-coordinate of the first point. - * @param {Number} x2 the x-coordinate of the second point. - * @param {Number} y2 the y-coordinate of the second point. - * @param {Number} x3 the x-coordinate of the third point. - * @param {Number} y3 the y-coordinate of the third point. - * @param {Number} x4 the x-coordinate of the fourth point. - * @param {Number} y4 the y-coordinate of the fourth point. - * @param {Integer} [detailX] number of segments in the x-direction. - * @param {Integer} [detailY] number of segments in the y-direction. - * @chainable - * @example - *
                                  - * - * quad(20, 20, 80, 20, 80, 80, 20, 80); - * describe('A white square with a black outline drawn on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * quad(20, 30, 80, 30, 80, 70, 20, 70); - * describe('A white rectangle with a black outline drawn on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * quad(50, 62, 86, 50, 50, 38, 14, 50); - * describe('A white rhombus with a black outline drawn on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * quad(20, 50, 80, 30, 80, 70, 20, 70); - * describe('A white trapezoid with a black outline drawn on a gray canvas.'); - * - *
                                  - */ - /** - * @method quad - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 the z-coordinate of the first point. - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 the z-coordinate of the second point. - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 the z-coordinate of the third point. - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 the z-coordinate of the fourth point. - * @param {Integer} [detailX] - * @param {Integer} [detailY] - * @chainable - */ - _main.default.prototype.quad = function () { - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters("quad", args); - if (this._renderer._doStroke || this._renderer._doFill) { - if (this._renderer.isP3D && args.length < 12) { - // if 3D and we weren't passed 12 args, assume Z is 0 - this._renderer.quad.call( - this._renderer, - args[0], - args[1], - 0, - args[2], - args[3], - 0, - args[4], - args[5], - 0, - args[6], - args[7], - 0, - args[8], - args[9], - ); - } else { - var _this$_renderer3; - (_this$_renderer3 = this._renderer).quad.apply( - _this$_renderer3, - args, - ); - //accessibile outputs - if ( - this._accessibleOutputs.grid || - this._accessibleOutputs.text - ) { - this._accsOutput("quadrilateral", args); - } - } - } - return this; - }; - /** - * Draws a rectangle to the canvas. A rectangle is a four-sided polygon with - * every angle at ninety degrees. By default, the first two parameters set the - * location of the rectangle's upper-left corner. The third and fourth set the - * shape's the width and height, respectively. The way these parameters are - * interpreted may be changed with the rectMode() - * function. - * - * The version of `rect()` with five parameters creates a rounded rectangle. The - * fifth parameter is used as the radius value for all four corners. - * - * The version of `rect()` with eight parameters also creates a rounded rectangle. - * When using eight parameters, the latter four set the radius of the arc at - * each corner separately. The radii start with the top-left corner and move - * clockwise around the rectangle. If any of these parameters are omitted, they - * are set to the value of the last specified corner radius. - * - * @method rect - * @param {Number} x x-coordinate of the rectangle. - * @param {Number} y y-coordinate of the rectangle. - * @param {Number} w width of the rectangle. - * @param {Number} [h] height of the rectangle. - * @param {Number} [tl] optional radius of top-left corner. - * @param {Number} [tr] optional radius of top-right corner. - * @param {Number} [br] optional radius of bottom-right corner. - * @param {Number} [bl] optional radius of bottom-left corner. - * @chainable - * @example - *
                                  - * - * rect(30, 20, 55, 55); - * describe('A white rectangle with a black outline on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * rect(30, 20, 55, 55, 20); - * describe( - * 'A white rectangle with a black outline and round edges on a gray canvas.' - * ); - * - *
                                  - * - *
                                  - * - * rect(30, 20, 55, 55, 20, 15, 10, 5); - * describe('A white rectangle with a black outline and round edges of different radii.'); - * - *
                                  - * - */ - /** - * @method rect - * @param {Number} x - * @param {Number} y - * @param {Number} w - * @param {Number} h - * @param {Integer} [detailX] number of segments in the x-direction (for WebGL mode). - * @param {Integer} [detailY] number of segments in the y-direction (for WebGL mode). - * @chainable - */ - _main.default.prototype.rect = function () { - for ( - var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; - _key4 < _len4; - _key4++ - ) { - args[_key4] = arguments[_key4]; - } - _main.default._validateParameters("rect", args); - return this._renderRect.apply(this, args); - }; - /** - * Draws a square to the canvas. A square is a four-sided polygon with every - * angle at ninety degrees and equal side lengths. By default, the first two - * parameters set the location of the square's upper-left corner. The third - * parameter sets its side size. The way these parameters are interpreted may - * be changed with the rectMode() function. - * - * The version of `square()` with four parameters creates a rounded square. The - * fourth parameter is used as the radius value for all four corners. - * - * The version of `square()` with seven parameters also creates a rounded square. - * When using seven parameters, the latter four set the radius of the arc at - * each corner separately. The radii start with the top-left corner and move - * clockwise around the square. If any of these parameters are omitted, they - * are set to the value of the last specified corner radius. - * - * @method square - * @param {Number} x x-coordinate of the square. - * @param {Number} y y-coordinate of the square. - * @param {Number} s side size of the square. - * @param {Number} [tl] optional radius of top-left corner. - * @param {Number} [tr] optional radius of top-right corner. - * @param {Number} [br] optional radius of bottom-right corner. - * @param {Number} [bl] optional radius of bottom-left corner. - * @chainable - * @example - *
                                  - * - * square(30, 20, 55); - * describe('A white square with a black outline in on a gray canvas.'); - * - *
                                  - * - *
                                  - * - * square(30, 20, 55, 20); - * describe( - * 'A white square with a black outline and round edges on a gray canvas.' - * ); - * - *
                                  - * - *
                                  - * - * square(30, 20, 55, 20, 15, 10, 5); - * describe('A white square with a black outline and round edges of different radii.'); - * - *
                                  - * - */ - _main.default.prototype.square = function (x, y, s, tl, tr, br, bl) { - _main.default._validateParameters("square", arguments); - // duplicate width for height in case of square - return this._renderRect.call(this, x, y, s, s, tl, tr, br, bl); - }; - // internal method to have renderer draw a rectangle - _main.default.prototype._renderRect = function () { - if (this._renderer._doStroke || this._renderer._doFill) { - // duplicate width for height in case only 3 arguments is provided - if (arguments.length === 3) { - arguments[3] = arguments[2]; - } - var vals = _helpers.default.modeAdjust( - arguments[0], - arguments[1], - arguments[2], - arguments[3], - this._renderer._rectMode, - ); - var args = [vals.x, vals.y, vals.w, vals.h]; - // append the additional arguments (either cornder radii, or - // segment details) to the argument list - for (var i = 4; i < arguments.length; i++) { - args[i] = arguments[i]; - } - this._renderer.rect(args); - //accessible outputs - if ( - this._accessibleOutputs.grid || - this._accessibleOutputs.text - ) { - this._accsOutput("rectangle", [vals.x, vals.y, vals.w, vals.h]); - } - } - return this; - }; - /** - * Draws a triangle to the canvas. A triangle is a three-sided polygon. The - * first two parameters specify the triangle's first point `(x1,y1)`. The middle - * two parameters specify its second point `(x2,y2)`. And the last two parameters - * specify its third point `(x3, y3)`. - * - * @method triangle - * @param {Number} x1 x-coordinate of the first point. - * @param {Number} y1 y-coordinate of the first point. - * @param {Number} x2 x-coordinate of the second point. - * @param {Number} y2 y-coordinate of the second point. - * @param {Number} x3 x-coordinate of the third point. - * @param {Number} y3 y-coordinate of the third point. - * @chainable - * @example - *
                                  - * - * triangle(30, 75, 58, 20, 86, 75); - * describe('A white triangle with a black outline on a gray canvas.'); - * - *
                                  - * - */ - _main.default.prototype.triangle = function () { - for ( - var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; - _key5 < _len5; - _key5++ - ) { - args[_key5] = arguments[_key5]; - } - _main.default._validateParameters("triangle", args); - if (this._renderer._doStroke || this._renderer._doFill) { - this._renderer.triangle(args); - } //accessible outputs - - if (this._accessibleOutputs.grid || this._accessibleOutputs.text) { - this._accsOutput("triangle", args); - } - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../constants": 286, - "../friendly_errors/fes_core": 289, - "../friendly_errors/file_errors": 290, - "../friendly_errors/validate_params": 293, - "../helpers": 294, - "../main": 298, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 306: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var constants = _interopRequireWildcard(_dereq_("../constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Shape - * @submodule Attributes - * @for p5 - * @requires core - * @requires constants - */ - /** - * Modifies the location from which ellipses, circles, and arcs are drawn. By default, the - * first two parameters are the x- and y-coordinates of the shape's center. The next - * parameters are its width and height. This is equivalent to calling `ellipseMode(CENTER)`. - * - * `ellipseMode(RADIUS)` also uses the first two parameters to set the x- and y-coordinates - * of the shape's center. The next parameters are half of the shapes's width and height. - * Calling `ellipse(0, 0, 10, 15)` draws a shape with a width of 20 and height of 30. - * - * `ellipseMode(CORNER)` uses the first two parameters as the upper-left corner of the - * shape. The next parameters are its width and height. - * - * `ellipseMode(CORNERS)` uses the first two parameters as the location of one corner - * of the ellipse's bounding box. The third and fourth parameters are the location of the - * opposite corner. - * - * The argument passed to `ellipseMode()` must be written in ALL CAPS because the constants - * `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. JavaScript is a - * case-sensitive language. - * - * @method ellipseMode - * @param {Constant} mode either CENTER, RADIUS, CORNER, or CORNERS - * @chainable - * @example - *
                                  - * - * ellipseMode(RADIUS); - * fill(255); - * ellipse(50, 50, 30, 30); - * ellipseMode(CENTER); - * fill(100); - * ellipse(50, 50, 30, 30); - * describe('A white circle with a gray circle at its center. Both circles have black outlines.'); - * - *
                                  - * - *
                                  - * - * ellipseMode(CORNER); - * fill(255); - * ellipse(25, 25, 50, 50); - * ellipseMode(CORNERS); - * fill(100); - * ellipse(25, 25, 50, 50); - * describe('A white circle with a gray circle at its top-left corner. Both circles have black outlines.'); - * - *
                                  - */ - - _main.default.prototype.ellipseMode = function (m) { - _main.default._validateParameters("ellipseMode", arguments); - if ( - m === constants.CORNER || - m === constants.CORNERS || - m === constants.RADIUS || - m === constants.CENTER - ) { - this._renderer._ellipseMode = m; - } - return this; - }; - /** - * Draws all geometry with jagged (aliased) edges. - * - * smooth() is active by default in 2D mode. It's necessary to call - * noSmooth() to disable smoothing of geometry, images, and fonts. - * - * In WebGL mode, noSmooth() is active by default. It's necessary - * to call smooth() to draw smooth (antialiased) edges. - * - * @method noSmooth - * @chainable - * @example - *
                                  - * - * background(0); - * noStroke(); - * smooth(); - * ellipse(30, 48, 36, 36); - * noSmooth(); - * ellipse(70, 48, 36, 36); - * describe('Two pixelated white circles on a black background.'); - * - *
                                  - */ - _main.default.prototype.noSmooth = function () { - if (!this._renderer.isP3D) { - if ("imageSmoothingEnabled" in this.drawingContext) { - this.drawingContext.imageSmoothingEnabled = false; - } - } else { - this.setAttributes("antialias", false); - } - return this; - }; - /** - * Modifies the location from which rectangles and squares are drawn. By default, - * the first two parameters are the x- and y-coordinates of the shape's upper-left - * corner. The next parameters are its width and height. This is equivalent to - * calling `rectMode(CORNER)`. - * - * `rectMode(CORNERS)` also uses the first two parameters as the location of one of - * the corners. The third and fourth parameters are the location of the opposite - * corner. - * - * `rectMode(CENTER)` uses the first two parameters as the x- and y-coordinates of - * the shape's center. The next parameters are its width and height. - * - * `rectMode(RADIUS)` also uses the first two parameters as the x- and y-coordinates - * of the shape's center. The next parameters are half of the shape's width and - * height. - * - * The argument passed to `rectMode()` must be written in ALL CAPS because the - * constants `CENTER`, `RADIUS`, `CORNER`, and `CORNERS` are defined this way. - * JavaScript is a case-sensitive language. - * - * @method rectMode - * @param {Constant} mode either CORNER, CORNERS, CENTER, or RADIUS - * @chainable - * @example - *
                                  - * - * rectMode(CORNER); - * fill(255); - * rect(25, 25, 50, 50); - * - * rectMode(CORNERS); - * fill(100); - * rect(25, 25, 50, 50); - * - * describe('A small gray square drawn at the top-left corner of a white square.'); - * - *
                                  - * - *
                                  - * - * rectMode(RADIUS); - * fill(255); - * rect(50, 50, 30, 30); - * - * rectMode(CENTER); - * fill(100); - * rect(50, 50, 30, 30); - * - * describe('A small gray square drawn at the center of a white square.'); - * - *
                                  - */ - _main.default.prototype.rectMode = function (m) { - _main.default._validateParameters("rectMode", arguments); - if ( - m === constants.CORNER || - m === constants.CORNERS || - m === constants.RADIUS || - m === constants.CENTER - ) { - this._renderer._rectMode = m; - } - return this; - }; - /** - * Draws all geometry with smooth (anti-aliased) edges. smooth() will also - * improve image quality of resized images. - * - * smooth() is active by default in 2D mode. It's necessary to call - * noSmooth() to disable smoothing of geometry, images, and fonts. - * - * In WebGL mode, noSmooth() is active by default. It's necessary - * to call smooth() to draw smooth (antialiased) edges. - * - * @method smooth - * @chainable - * @example - *
                                  - * - * background(0); - * noStroke(); - * smooth(); - * ellipse(30, 48, 36, 36); - * noSmooth(); - * ellipse(70, 48, 36, 36); - * describe('Two pixelated white circles on a black background.'); - * - *
                                  - */ - _main.default.prototype.smooth = function () { - this.setAttributes("antialias", true); - if (!this._renderer.isP3D) { - if ("imageSmoothingEnabled" in this.drawingContext) { - this.drawingContext.imageSmoothingEnabled = true; - } - } - return this; - }; - /** - * Sets the style for rendering line endings. These ends are either rounded - * (`ROUND`), squared (`SQUARE`), or extended (`PROJECT`). The default cap is - * `ROUND`. - * - * The argument passed to `strokeCap()` must be written in ALL CAPS because - * the constants `ROUND`, `SQUARE`, and `PROJECT` are defined this way. - * JavaScript is a case-sensitive language. - * - * @method strokeCap - * @param {Constant} cap either ROUND, SQUARE, or PROJECT - * @chainable - * @example - *
                                  - * - * strokeWeight(12.0); - * strokeCap(ROUND); - * line(20, 30, 80, 30); - * strokeCap(SQUARE); - * line(20, 50, 80, 50); - * strokeCap(PROJECT); - * line(20, 70, 80, 70); - * describe('Three horizontal lines. The top line has rounded ends, the middle line has squared ends, and the bottom line has longer, squared ends.'); - * - *
                                  - */ - _main.default.prototype.strokeCap = function (cap) { - _main.default._validateParameters("strokeCap", arguments); - if ( - cap === constants.ROUND || - cap === constants.SQUARE || - cap === constants.PROJECT - ) { - this._renderer.strokeCap(cap); - } - return this; - }; - /** - * Sets the style of the joints which connect line segments. These joints are - * either mitered (`MITER`), beveled (`BEVEL`), or rounded (`ROUND`). The default - * joint is `MITER` in 2D mode and `ROUND` in WebGL mode. - * - * The argument passed to `strokeJoin()` must be written in ALL CAPS because - * the constants `MITER`, `BEVEL`, and `ROUND` are defined this way. - * JavaScript is a case-sensitive language. - * - * @method strokeJoin - * @param {Constant} join either MITER, BEVEL, or ROUND - * @chainable - * @example - *
                                  - * - * noFill(); - * strokeWeight(10.0); - * strokeJoin(MITER); - * beginShape(); - * vertex(35, 20); - * vertex(65, 50); - * vertex(35, 80); - * endShape(); - * describe('A right-facing arrowhead shape with a pointed tip in center of canvas.'); - * - *
                                  - * - *
                                  - * - * noFill(); - * strokeWeight(10.0); - * strokeJoin(BEVEL); - * beginShape(); - * vertex(35, 20); - * vertex(65, 50); - * vertex(35, 80); - * endShape(); - * describe('A right-facing arrowhead shape with a flat tip in center of canvas.'); - * - *
                                  - * - *
                                  - * - * noFill(); - * strokeWeight(10.0); - * strokeJoin(ROUND); - * beginShape(); - * vertex(35, 20); - * vertex(65, 50); - * vertex(35, 80); - * endShape(); - * describe('A right-facing arrowhead shape with a rounded tip in center of canvas.'); - * - *
                                  - */ - _main.default.prototype.strokeJoin = function (join) { - _main.default._validateParameters("strokeJoin", arguments); - if ( - join === constants.ROUND || - join === constants.BEVEL || - join === constants.MITER - ) { - this._renderer.strokeJoin(join); - } - return this; - }; - /** - * Sets the width of the stroke used for lines, points, and the border around - * shapes. All widths are set in units of pixels. - * - * Note that `strokeWeight()` is affected by any transformation or scaling that - * has been applied previously. - * - * @method strokeWeight - * @param {Number} weight the weight of the stroke (in pixels). - * @chainable - * @example - *
                                  - * - * // Default. - * line(20, 20, 80, 20); - * // Thicker. - * strokeWeight(4); - * line(20, 40, 80, 40); - * // Beastly. - * strokeWeight(10); - * line(20, 70, 80, 70); - * describe('Three horizontal black lines. The top line is thin, the middle is medium, and the bottom is thick.'); - * - *
                                  - * - *
                                  - * - * // Default. - * line(20, 20, 80, 20); - * // Adding scale transformation. - * scale(5); - * // Coordinates adjusted for scaling. - * line(4, 8, 16, 8); - * describe('Two horizontal black lines. The top line is thin and the bottom is five times thicker than the top.'); - * - *
                                  - */ - _main.default.prototype.strokeWeight = function (w) { - _main.default._validateParameters("strokeWeight", arguments); - this._renderer.strokeWeight(w); - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../constants": 286, - "../main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 307: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - _dereq_("../friendly_errors/fes_core"); - _dereq_("../friendly_errors/file_errors"); - _dereq_("../friendly_errors/validate_params"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Shape - * @submodule Curves - * @for p5 - * @requires core - */ - /** - * Draws a cubic Bezier curve on the screen. These curves are defined by a - * series of anchor and control points. The first two parameters specify - * the first anchor point and the last two parameters specify the other - * anchor point, which become the first and last points on the curve. The - * middle parameters specify the two control points which define the shape - * of the curve. Approximately speaking, control points "pull" the curve - * towards them. - * - * Bezier curves were developed by French automotive engineer Pierre Bezier, - * and are commonly used in computer graphics to define gently sloping curves. - * See also curve(). - * - * @method bezier - * @param {Number} x1 x-coordinate for the first anchor point - * @param {Number} y1 y-coordinate for the first anchor point - * @param {Number} x2 x-coordinate for the first control point - * @param {Number} y2 y-coordinate for the first control point - * @param {Number} x3 x-coordinate for the second control point - * @param {Number} y3 y-coordinate for the second control point - * @param {Number} x4 x-coordinate for the second anchor point - * @param {Number} y4 y-coordinate for the second anchor point - * @chainable - * @example - *
                                  - * - * noFill(); - * stroke(255, 102, 0); - * line(85, 20, 10, 10); - * line(90, 90, 15, 80); - * stroke(0, 0, 0); - * bezier(85, 20, 10, 10, 90, 90, 15, 80); - * - *
                                  - * - *
                                  - * - * background(0, 0, 0); - * noFill(); - * stroke(255); - * bezier(250, 250, 0, 100, 100, 0, 100, 0, 0, 0, 100, 0); - * - *
                                  - * - * @alt - * stretched black s-shape in center with orange lines extending from end points. - * a white colored curve on black background from the upper-right corner to the lower right corner. - */ - /** - * @method bezier - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 z-coordinate for the first anchor point - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate for the first control point - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the second control point - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 z-coordinate for the second anchor point - * @chainable - */ - - _main.default.prototype.bezier = function () { - var _this$_renderer; - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("bezier", args); - // if the current stroke and fill settings wouldn't result in something - // visible, exit immediately - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } - (_this$_renderer = this._renderer).bezier.apply( - _this$_renderer, - args, - ); - return this; - }; - /** - * Sets the resolution at which Bezier's curve is displayed. The default value is 20. - * - * Note, This function is only useful when using the WEBGL renderer - * as the default canvas renderer does not use this information. - * - * @method bezierDetail - * @param {Number} detail resolution of the curves - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noFill(); - * bezierDetail(5); - * } - * - * function draw() { - * background(200); - * bezier( - * -40, -40, 0, - * 90, -40, 0, - * -90, 40, 0, - * 40, 40, 0 - * ); - * } - * - *
                                  - * - * @alt - * stretched black s-shape with a low level of bezier detail - */ - _main.default.prototype.bezierDetail = function (d) { - _main.default._validateParameters("bezierDetail", arguments); - this._bezierDetail = d; - return this; - }; - /** - * Given the x or y co-ordinate values of control and anchor points of a bezier - * curve, it evaluates the x or y coordinate of the bezier at position t. The - * parameters a and d are the x or y coordinates of first and last points on the - * curve while b and c are of the control points.The final parameter t is the - * position of the resultant point which is given between 0 and 1. - * This can be done once with the x coordinates and a second time - * with the y coordinates to get the location of a bezier curve at t. + return _get(target, property, receiver || target); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + return object; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } /** + * @module Rendering + * @requires constants + */ + + var FramebufferCamera = /*#__PURE__*/ function (_p5$Camera) { + _inherits(FramebufferCamera, _p5$Camera); + var _super = _createSuper(FramebufferCamera); + /** + * A p5.Camera attached to a + * p5.Framebuffer. + * + * @class p5.FramebufferCamera + * @constructor + * @param {p5.Framebuffer} framebuffer The framebuffer this camera is + * attached to + * @private + */ + function FramebufferCamera(framebuffer) { + var _this; + _classCallCheck(this, FramebufferCamera); + _this = _super.call(this, framebuffer.target._renderer); + _this.fbo = framebuffer; + // WebGL textures are upside-down compared to textures that come from + // images and graphics. Framebuffer cameras need to invert their y + // axes when being rendered to so that the texture comes out rightway up + // when read in shaders or image(). + _this.yScale = - 1; + return _this; + } + _createClass(FramebufferCamera, [ + { + key: '_computeCameraDefaultSettings', + value: function _computeCameraDefaultSettings() { + _get(_getPrototypeOf(FramebufferCamera.prototype), '_computeCameraDefaultSettings', this).call(this); + this.defaultAspectRatio = this.fbo.width / this.fbo.height; + this.defaultCameraFOV = 2 * Math.atan(this.fbo.height / 2 / this.defaultEyeZ); + } + } + ]); + return FramebufferCamera; + }(_main.default.Camera); + _main.default.FramebufferCamera = FramebufferCamera; + var FramebufferTexture = /*#__PURE__*/ function () { + /** + * A p5.Texture corresponding to a property of a + * p5.Framebuffer. + * + * @class p5.FramebufferTexture + * @param {p5.Framebuffer} framebuffer The framebuffer represented by this + * texture + * @param {String} property The property of the framebuffer represented by + * this texture, either `color` or `depth` + * @private + */ + function FramebufferTexture(framebuffer, property) { + _classCallCheck(this, FramebufferTexture); + this.framebuffer = framebuffer; + this.property = property; + } + _createClass(FramebufferTexture, [ + { + key: 'rawTexture', + value: function rawTexture() { + return this.framebuffer[this.property]; + } + }, + { + key: 'width', + get: function get() { + return this.framebuffer.width * this.framebuffer.density; + } + }, + { + key: 'height', + get: function get() { + return this.framebuffer.height * this.framebuffer.density; + } + } + ]); + return FramebufferTexture; + }(); + _main.default.FramebufferTexture = FramebufferTexture; + var Framebuffer = /*#__PURE__*/ function () { + /** + * An object that one can draw to and then read as a texture. While similar + * to a p5.Graphics, using a p5.Framebuffer as a texture will generally run + * much faster, as it lives within the same WebGL context as the canvas it + * is created on. It only works in WebGL mode. + * + * @class p5.Framebuffer + * @constructor + * @param {p5.Graphics|p5} target A p5 global instance or p5.Graphics + * @param {Object} [settings] A settings object + */ + function Framebuffer(target) { + var _this2 = this; + var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }; + _classCallCheck(this, Framebuffer); + this.target = target; + this.target._renderer.framebuffers.add(this); + this._isClipApplied = false; + /** + * A Uint8ClampedArray + * containing the values for all the pixels in the Framebuffer. + * + * Like the main canvas pixels property, call + * loadPixels() before reading + * it, and call updatePixels() + * afterwards to update its data. + * + * Note that updating pixels via this property will be slower than + * drawing to the framebuffer directly. + * Consider using a shader instead of looping over pixels. + * + * @property {Number[]} pixels + */ + this.pixels = [ + ]; + this.format = settings.format || constants.UNSIGNED_BYTE; + this.channels = settings.channels || (target._renderer._pInst._glAttributes.alpha ? constants.RGBA : constants.RGB); + this.useDepth = settings.depth === undefined ? true : settings.depth; + this.depthFormat = settings.depthFormat || constants.FLOAT; + this.textureFiltering = settings.textureFiltering || constants.LINEAR; + if (settings.antialias === undefined) { + this.antialiasSamples = target._renderer._pInst._glAttributes.antialias ? 2 : 0; + } else if (typeof settings.antialias === 'number') { + this.antialiasSamples = settings.antialias; + } else { + this.antialiasSamples = settings.antialias ? 2 : 0; + } + this.antialias = this.antialiasSamples > 0; + if (this.antialias && target.webglVersion !== constants.WEBGL2) { + console.warn('Antialiasing is unsupported in a WebGL 1 context'); + this.antialias = false; + } + if (settings.width && settings.height) { + this.width = settings.width; + this.height = settings.height; + this.autoSized = false; + } else { + if (settings.width === undefined !== (settings.height === undefined)) { + console.warn('Please supply both width and height for a framebuffer to give it a ' + 'size. Only one was given, so the framebuffer will match the size ' + 'of its canvas.'); + } + this.width = target.width; + this.height = target.height; + this.autoSized = true; + } + this.density = settings.density || target.pixelDensity(); + var gl = target._renderer.GL; + this.gl = gl; + this._checkIfFormatsAvailable(); + if (settings.stencil && !this.useDepth) { + console.warn('A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored.'); + } + this.useStencil = this.useDepth && (settings.stencil === undefined ? true : settings.stencil); + this.framebuffer = gl.createFramebuffer(); + if (!this.framebuffer) { + throw new Error('Unable to create a framebuffer'); + } + if (this.antialias) { + this.aaFramebuffer = gl.createFramebuffer(); + if (!this.aaFramebuffer) { + throw new Error('Unable to create a framebuffer for antialiasing'); + } + } + this._recreateTextures(); + var prevCam = this.target._renderer._curCamera; + this.defaultCamera = this.createCamera(); + this.target._renderer._curCamera = prevCam; + this.draw(function () { + return _this2.target.clear(); + }); + } /** + * Resizes the framebuffer to the given width and height. + * + * @method resize + * @param {Number} width + * @param {Number} height + * + * @example + *
                                  + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function mouseMoved() { + * framebuffer.resize( + * max(20, mouseX), + * max(20, mouseY) + * ); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * normalMaterial(); + * sphere(20); + * framebuffer.end(); + * + * background(100); + * // Draw the framebuffer to the main canvas + * image(framebuffer, -width/2, -height/2); + * } + * + *
                                  + * + * @alt + * A red, green, and blue sphere is drawn in the middle of a white rectangle + * which starts in the top left of the canvas and whose bottom right is at + * the user's mouse + */ + + _createClass(Framebuffer, [ + { + key: 'resize', + value: function resize(width, height) { + this.autoSized = false; + this.width = width; + this.height = height; + this._handleResize(); + } /** + * Gets or sets the pixel scaling for high pixel density displays. By + * default, the density will match that of the canvas the framebuffer was + * created on, which will match the display density. + * + * Call this method with no arguments to get the current density, or pass + * in a number to set the density. + * + * @method pixelDensity + * @param {Number} [density] A scaling factor for the number of pixels per + * side of the framebuffer + */ + + }, + { + key: 'pixelDensity', + value: function pixelDensity(density) { + if (density) { + this.autoSized = false; + this.density = density; + this._handleResize(); + } else { + return this.density; + } + } /** + * Gets or sets whether or not this framebuffer will automatically resize + * along with the canvas it's attached to in order to match its size. + * + * Call this method with no arguments to see if it is currently auto-sized, + * or pass in a boolean to set this property. + * + * @method autoSized + * @param {Boolean} [autoSized] Whether or not the framebuffer should resize + * along with the canvas it's attached to + */ + + }, + { + key: 'autoSized', + value: function autoSized(_autoSized) { + if (_autoSized === undefined) { + return this.autoSized; + } else { + this.autoSized = _autoSized; + this._handleResize(); + } + } /** + * Checks the capabilities of the current WebGL environment to see if the + * settings supplied by the user are capable of being fulfilled. If they + * are not, warnings will be logged and the settings will be changed to + * something close that can be fulfilled. + * + * @private + */ + + }, + { + key: '_checkIfFormatsAvailable', + value: function _checkIfFormatsAvailable() { + var gl = this.gl; + if (this.useDepth && this.target.webglVersion === constants.WEBGL && !gl.getExtension('WEBGL_depth_texture')) { + console.warn('Unable to create depth textures in this environment. Falling back ' + 'to a framebuffer without depth.'); + this.useDepth = false; + } + if (this.useDepth && this.target.webglVersion === constants.WEBGL && this.depthFormat === constants.FLOAT) { + console.warn('FLOAT depth format is unavailable in WebGL 1. ' + 'Defaulting to UNSIGNED_INT.'); + this.depthFormat = constants.UNSIGNED_INT; + } + if (![constants.UNSIGNED_BYTE, + constants.FLOAT, + constants.HALF_FLOAT].includes(this.format)) { + console.warn('Unknown Framebuffer format. ' + 'Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. ' + 'Defaulting to UNSIGNED_BYTE.'); + this.format = constants.UNSIGNED_BYTE; + } + if (this.useDepth && ![constants.UNSIGNED_INT, + constants.FLOAT].includes(this.depthFormat)) { + console.warn('Unknown Framebuffer depth format. ' + 'Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT.'); + this.depthFormat = constants.FLOAT; + } + var support = (0, _p.checkWebGLCapabilities) (this.target._renderer); + if (!support.float && this.format === constants.FLOAT) { + console.warn('This environment does not support FLOAT textures. ' + 'Falling back to UNSIGNED_BYTE.'); + this.format = constants.UNSIGNED_BYTE; + } + if (this.useDepth && !support.float && this.depthFormat === constants.FLOAT) { + console.warn('This environment does not support FLOAT depth textures. ' + 'Falling back to UNSIGNED_INT.'); + this.depthFormat = constants.UNSIGNED_INT; + } + if (!support.halfFloat && this.format === constants.HALF_FLOAT) { + console.warn('This environment does not support HALF_FLOAT textures. ' + 'Falling back to UNSIGNED_BYTE.'); + this.format = constants.UNSIGNED_BYTE; + } + if (this.channels === constants.RGB && [ + constants.FLOAT, + constants.HALF_FLOAT + ].includes(this.format)) { + console.warn('FLOAT and HALF_FLOAT formats do not work cross-platform with only ' + 'RGB channels. Falling back to RGBA.'); + this.channels = constants.RGBA; + } + } /** + * Creates new textures and renderbuffers given the current size of the + * framebuffer. + * + * @private + */ + + }, + { + key: '_recreateTextures', + value: function _recreateTextures() { + var gl = this.gl; + this._updateSize(); + var prevBoundTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); + var prevBoundFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); + var colorTexture = gl.createTexture(); + if (!colorTexture) { + throw new Error('Unable to create color texture'); + } + gl.bindTexture(gl.TEXTURE_2D, colorTexture); + var colorFormat = this._glColorFormat(); + gl.texImage2D(gl.TEXTURE_2D, 0, colorFormat.internalFormat, this.width * this.density, this.height * this.density, 0, colorFormat.format, colorFormat.type, null); + this.colorTexture = colorTexture; + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTexture, 0); + if (this.useDepth) { + // Create the depth texture + var depthTexture = gl.createTexture(); + if (!depthTexture) { + throw new Error('Unable to create depth texture'); + } + var depthFormat = this._glDepthFormat(); + gl.bindTexture(gl.TEXTURE_2D, depthTexture); + gl.texImage2D(gl.TEXTURE_2D, 0, depthFormat.internalFormat, this.width * this.density, this.height * this.density, 0, depthFormat.format, depthFormat.type, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, this.useStencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture, 0); + this.depthTexture = depthTexture; + } // Create separate framebuffer for antialiasing + + if (this.antialias) { + this.colorRenderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, this.colorRenderbuffer); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, Math.max(0, Math.min(this.antialiasSamples, gl.getParameter(gl.MAX_SAMPLES))), colorFormat.internalFormat, this.width * this.density, this.height * this.density); + if (this.useDepth) { + var _depthFormat = this._glDepthFormat(); + this.depthRenderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, this.depthRenderbuffer); + gl.renderbufferStorageMultisample(gl.RENDERBUFFER, Math.max(0, Math.min(this.antialiasSamples, gl.getParameter(gl.MAX_SAMPLES))), _depthFormat.internalFormat, this.width * this.density, this.height * this.density); + } + gl.bindFramebuffer(gl.FRAMEBUFFER, this.aaFramebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.colorRenderbuffer); + if (this.useDepth) { + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, this.useStencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, this.depthRenderbuffer); + } + } + if (this.useDepth) { + this.depth = new FramebufferTexture(this, 'depthTexture'); + var depthFilter = gl.NEAREST; + this.depthP5Texture = new _main.default.Texture(this.target._renderer, this.depth, { + minFilter: depthFilter, + magFilter: depthFilter + }); + this.target._renderer.textures.set(this.depth, this.depthP5Texture); + } + this.color = new FramebufferTexture(this, 'colorTexture'); + var filter = this.textureFiltering === constants.LINEAR ? gl.LINEAR : gl.NEAREST; + this.colorP5Texture = new _main.default.Texture(this.target._renderer, this.color, { + minFilter: filter, + magFilter: filter + }); + this.target._renderer.textures.set(this.color, this.colorP5Texture); + gl.bindTexture(gl.TEXTURE_2D, prevBoundTexture); + gl.bindFramebuffer(gl.FRAMEBUFFER, prevBoundFramebuffer); + } /** + * To create a WebGL texture, one needs to supply three pieces of information: + * the type (the data type each channel will be stored as, e.g. int or float), + * the format (the color channels that will each be stored in the previously + * specified type, e.g. rgb or rgba), and the internal format (the specifics + * of how data for each channel, in the aforementioned type, will be packed + * together, such as how many bits to use, e.g. RGBA32F or RGB565.) + * + * The format and channels asked for by the user hint at what these values + * need to be, and the WebGL version affects what options are avaiable. + * This method returns the values for these three properties, given the + * framebuffer's settings. + * + * @private + */ + + }, + { + key: '_glColorFormat', + value: function _glColorFormat() { + var type, + format, + internalFormat; + var gl = this.gl; + if (this.format === constants.FLOAT) { + type = gl.FLOAT; + } else if (this.format === constants.HALF_FLOAT) { + type = this.target.webglVersion === constants.WEBGL2 ? gl.HALF_FLOAT : gl.getExtension('OES_texture_half_float').HALF_FLOAT_OES; + } else { + type = gl.UNSIGNED_BYTE; + } + if (this.channels === constants.RGBA) { + format = gl.RGBA; + } else { + format = gl.RGB; + } + if (this.target.webglVersion === constants.WEBGL2) { + var _gl$UNSIGNED_BYTE, + _table; + // https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html + var table = (_table = { + }, _defineProperty(_table, gl.FLOAT, _defineProperty({ + }, gl.RGBA, gl.RGBA32F)), _defineProperty(_table, gl.HALF_FLOAT, _defineProperty({ + }, gl.RGBA, gl.RGBA16F)), _defineProperty(_table, gl.UNSIGNED_BYTE, (_gl$UNSIGNED_BYTE = { + }, _defineProperty(_gl$UNSIGNED_BYTE, gl.RGBA, gl.RGBA8), _defineProperty(_gl$UNSIGNED_BYTE, gl.RGB, gl.RGB8), _gl$UNSIGNED_BYTE)), _table); + internalFormat = table[type][format]; + } else if (this.format === constants.HALF_FLOAT) { + internalFormat = gl.RGBA; + } else { + internalFormat = format; + } + return { + internalFormat: internalFormat, + format: format, + type: type + }; + } /** + * To create a WebGL texture, one needs to supply three pieces of information: + * the type (the data type each channel will be stored as, e.g. int or float), + * the format (the color channels that will each be stored in the previously + * specified type, e.g. rgb or rgba), and the internal format (the specifics + * of how data for each channel, in the aforementioned type, will be packed + * together, such as how many bits to use, e.g. RGBA32F or RGB565.) + * + * This method takes into account the settings asked for by the user and + * returns values for these three properties that can be used for the + * texture storing depth information. + * + * @private + */ + + }, + { + key: '_glDepthFormat', + value: function _glDepthFormat() { + var type, + format, + internalFormat; + var gl = this.gl; + if (this.useStencil) { + if (this.depthFormat === constants.FLOAT) { + type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; + } else if (this.target.webglVersion === constants.WEBGL2) { + type = gl.UNSIGNED_INT_24_8; + } else { + type = gl.getExtension('WEBGL_depth_texture').UNSIGNED_INT_24_8_WEBGL; + } + } else { + if (this.depthFormat === constants.FLOAT) { + type = gl.FLOAT; + } else { + type = gl.UNSIGNED_INT; + } + } + if (this.useStencil) { + format = gl.DEPTH_STENCIL; + } else { + format = gl.DEPTH_COMPONENT; + } + if (this.useStencil) { + if (this.depthFormat === constants.FLOAT) { + internalFormat = gl.DEPTH32F_STENCIL8; + } else if (this.target.webglVersion === constants.WEBGL2) { + internalFormat = gl.DEPTH24_STENCIL8; + } else { + internalFormat = gl.DEPTH_STENCIL; + } + } else if (this.target.webglVersion === constants.WEBGL2) { + if (this.depthFormat === constants.FLOAT) { + internalFormat = gl.DEPTH_COMPONENT32F; + } else { + internalFormat = gl.DEPTH_COMPONENT24; + } + } else { + internalFormat = gl.DEPTH_COMPONENT; + } + return { + internalFormat: internalFormat, + format: format, + type: type + }; + } /** + * A method that will be called when recreating textures. If the framebuffer + * is auto-sized, it will update its width, height, and density properties. + * + * @private + */ + + }, + { + key: '_updateSize', + value: function _updateSize() { + if (this.autoSized) { + this.width = this.target.width; + this.height = this.target.height; + this.density = this.target.pixelDensity(); + } + } /** + * Called when the canvas that the framebuffer is attached to resizes. If the + * framebuffer is auto-sized, it will update its textures to match the new + * size. + * + * @private + */ + + }, + { + key: '_canvasSizeChanged', + value: function _canvasSizeChanged() { + if (this.autoSized) { + this._handleResize(); + } + } /** + * Called when the size of the framebuffer has changed (either by being + * manually updated or from auto-size updates when its canvas changes size.) + * Old textures and renderbuffers will be deleted, and then recreated with the + * new size. + * + * @private + */ + + }, + { + key: '_handleResize', + value: function _handleResize() { + var oldColor = this.color; + var oldDepth = this.depth; + var oldColorRenderbuffer = this.colorRenderbuffer; + var oldDepthRenderbuffer = this.depthRenderbuffer; + this._deleteTexture(oldColor); + if (oldDepth) this._deleteTexture(oldDepth); + var gl = this.gl; + if (oldColorRenderbuffer) gl.deleteRenderbuffer(oldColorRenderbuffer); + if (oldDepthRenderbuffer) gl.deleteRenderbuffer(oldDepthRenderbuffer); + this._recreateTextures(); + this.defaultCamera._resize(); + } /** + * Creates and returns a new + * p5.FramebufferCamera to be used + * while drawing to this framebuffer. The camera will be set as the + * currently active camera. + * + * @method createCamera + * @returns {p5.Camera} A new camera + */ + + }, + { + key: 'createCamera', + value: function createCamera() { + var cam = new FramebufferCamera(this); + cam._computeCameraDefaultSettings(); + cam._setDefaultCamera(); + this.target._renderer._curCamera = cam; + return cam; + } /** + * Given a raw texture wrapper, delete its stored texture from WebGL memory, + * and remove it from p5's list of active textures. + * + * @param {p5.FramebufferTexture} texture + * @private + */ + + }, + { + key: '_deleteTexture', + value: function _deleteTexture(texture) { + var gl = this.gl; + gl.deleteTexture(texture.rawTexture()); + this.target._renderer.textures.delete(texture); + } /** + * Removes the framebuffer and frees its resources. + * + * @method remove + * + * @example + *
                                  + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * } + * + * function draw() { + * const useFramebuffer = (frameCount % 120) > 60; + * if (useFramebuffer && !framebuffer) { + * // Create a new framebuffer for us to use + * framebuffer = createFramebuffer(); + * } else if (!useFramebuffer && framebuffer) { + * // Free the old framebuffer's resources + * framebuffer.remove(); + * framebuffer = undefined; + * } + * + * background(255); + * if (useFramebuffer) { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * fill(255, 0, 0); + * box(30); + * framebuffer.end(); + * + * image(framebuffer, -width/2, -height/2); + * } + * } + * + *
                                  + * + * @alt + * A rotating red cube blinks on and off every second. + */ + + }, + { + key: 'remove', + value: function remove() { + var gl = this.gl; + this._deleteTexture(this.color); + if (this.depth) this._deleteTexture(this.depth); + gl.deleteFramebuffer(this.framebuffer); + if (this.aaFramebuffer) { + gl.deleteFramebuffer(this.aaFramebuffer); + } + if (this.depthRenderbuffer) { + gl.deleteRenderbuffer(this.depthRenderbuffer); + } + if (this.colorRenderbuffer) { + gl.deleteRenderbuffer(this.colorRenderbuffer); + } + this.target._renderer.framebuffers.delete(this); + } /** + * Begin drawing to this framebuffer. Subsequent drawing functions to the + * canvas the framebuffer is attached to will not be immediately visible, and + * will instead be drawn to the framebuffer's texture. Call + * end() when finished to make draw + * functions go right to the canvas again and to be able to read the + * contents of the framebuffer's texture. + * + * @method begin + * + * @example + *
                                  + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * translate(0, 10*sin(frameCount * 0.01), 0); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * fill(255, 0, 0); + * box(50); + * framebuffer.end(); + * + * background(100); + * // Draw the framebuffer to the main canvas + * image(framebuffer, -50, -50, 25, 25); + * image(framebuffer, 0, 0, 35, 35); + * } + * + *
                                  + * + * @alt + * A video of a floating and rotating red cube is pasted twice on the + * canvas: once in the top left, and again, larger, in the bottom right. + */ + + }, + { + key: 'begin', + value: function begin() { + this.prevFramebuffer = this.target._renderer.activeFramebuffer(); + if (this.prevFramebuffer) { + this.prevFramebuffer._beforeEnd(); + } + this.target._renderer.activeFramebuffers.push(this); + this._beforeBegin(); + this.target.push(); + // Apply the framebuffer's camera. This does almost what + // RendererGL.reset() does, but this does not try to clear any buffers; + // it only sets the camera. + this.target.setCamera(this.defaultCamera); + this.target._renderer.uMVMatrix.set(this.target._renderer._curCamera.cameraMatrix.mat4[0], this.target._renderer._curCamera.cameraMatrix.mat4[1], this.target._renderer._curCamera.cameraMatrix.mat4[2], this.target._renderer._curCamera.cameraMatrix.mat4[3], this.target._renderer._curCamera.cameraMatrix.mat4[4], this.target._renderer._curCamera.cameraMatrix.mat4[5], this.target._renderer._curCamera.cameraMatrix.mat4[6], this.target._renderer._curCamera.cameraMatrix.mat4[7], this.target._renderer._curCamera.cameraMatrix.mat4[8], this.target._renderer._curCamera.cameraMatrix.mat4[9], this.target._renderer._curCamera.cameraMatrix.mat4[10], this.target._renderer._curCamera.cameraMatrix.mat4[11], this.target._renderer._curCamera.cameraMatrix.mat4[12], this.target._renderer._curCamera.cameraMatrix.mat4[13], this.target._renderer._curCamera.cameraMatrix.mat4[14], this.target._renderer._curCamera.cameraMatrix.mat4[15]); + } /** + * When making a p5.Framebuffer active so that it may be drawn to, this method + * returns the underlying WebGL framebuffer that needs to be active to + * support this. Antialiased framebuffers first write to a multisampled + * renderbuffer, while other framebuffers can write directly to their main + * framebuffers. + * + * @method _framebufferToBind + * @private + */ + + }, + { + key: '_framebufferToBind', + value: function _framebufferToBind() { + if (this.antialias) { + // If antialiasing, draw to an antialiased renderbuffer rather + // than directly to the texture. In end() we will copy from the + // renderbuffer to the texture. + return this.aaFramebuffer; + } else { + return this.framebuffer; + } + } /** + * Ensures that the framebuffer is ready to be drawn to + * + * @method _beforeBegin + * @private + */ + + }, + { + key: '_beforeBegin', + value: function _beforeBegin() { + var gl = this.gl; + gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebufferToBind()); + this.target._renderer.viewport(this.width * this.density, this.height * this.density); + } /** + * Ensures that the framebuffer is ready to be read by other framebuffers. + * + * @method _beforeEnd + * @private + */ + + }, + { + key: '_beforeEnd', + value: function _beforeEnd() { + if (this.antialias) { + var gl = this.gl; + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.aaFramebuffer); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.framebuffer); + var partsToCopy = [ + [gl.COLOR_BUFFER_BIT, + this.colorP5Texture.glMagFilter] + ]; + if (this.useDepth) { + partsToCopy.push([gl.DEPTH_BUFFER_BIT, + this.depthP5Texture.glMagFilter]); + } + for (var _i = 0, _partsToCopy = partsToCopy; _i < _partsToCopy.length; _i++) { + var _partsToCopy$_i = _slicedToArray(_partsToCopy[_i], 2), + flag = _partsToCopy$_i[0], + filter = _partsToCopy$_i[1]; + gl.blitFramebuffer(0, 0, this.width * this.density, this.height * this.density, 0, 0, this.width * this.density, this.height * this.density, flag, filter); + } + } + } /** + * After having previously called + * begin(), this method stops drawing + * functions from going to the framebuffer's texture, allowing them to go + * right to the canvas again. After this, one can read from the framebuffer's + * texture. + * + * @method end + */ + + }, + { + key: 'end', + value: function end() { + var gl = this.gl; + this.target.pop(); + var fbo = this.target._renderer.activeFramebuffers.pop(); + if (fbo !== this) { + throw new Error('It looks like you\'ve called end() while another Framebuffer is active.'); + } + this._beforeEnd(); + if (this.prevFramebuffer) { + this.prevFramebuffer._beforeBegin(); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + this.target._renderer.viewport(this.target._renderer._origViewport.width, this.target._renderer._origViewport.height); + } + this.target._renderer._applyStencilTestIfClipping(); + } /** + * Run a function while drawing to the framebuffer rather than to its canvas. + * This is equivalent to calling `framebuffer.begin()`, running the function, + * and then calling `framebuffer.end()`, but ensures that one never + * accidentally forgets `begin` or `end`. + * + * @method draw + * @param {Function} callback A function to run that draws to the canvas. The + * function will immediately be run, but it will draw to the framebuffer + * instead of the canvas. + * + * @example + *
                                  + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.draw(function() { + * background(255); + * translate(0, 10*sin(frameCount * 0.01), 0); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * fill(255, 0, 0); + * box(50); + * }); + * + * background(100); + * // Draw the framebuffer to the main canvas + * image(framebuffer, -50, -50, 25, 25); + * image(framebuffer, 0, 0, 35, 35); + * } + * + *
                                  + * + * @alt + * A video of a floating and rotating red cube is pasted twice on the + * canvas: once in the top left, and again, larger, in the bottom right. + */ + + }, + { + key: 'draw', + value: function draw(callback) { + this.begin(); + callback(); + this.end(); + } /** + * Call this befpre updating pixels + * and calling updatePixels + * to replace the content of the framebuffer with the data in the pixels + * array. + */ + + }, + { + key: 'loadPixels', + value: function loadPixels() { + var gl = this.gl; + var prevFramebuffer = this.target._renderer.activeFramebuffer(); + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); + var colorFormat = this._glColorFormat(); + this.pixels = (0, _p2.readPixelsWebGL) (this.pixels, gl, this.framebuffer, 0, 0, this.width * this.density, this.height * this.density, colorFormat.format, colorFormat.type); + if (prevFramebuffer) { + gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer._framebufferToBind()); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + } /** + * Get a region of pixels from the canvas in the form of a + * p5.Image, or a single pixel as an array of + * numbers. + * + * Returns an array of [R,G,B,A] values for any pixel or grabs a section of + * an image. If the Framebuffer has been set up to not store alpha values, then + * only [R,G,B] will be returned. If no parameters are specified, the entire + * image is returned. + * Use the x and y parameters to get the value of one pixel. Get a section of + * the display window by specifying additional w and h parameters. When + * getting an image, the x and y parameters define the coordinates for the + * upper-left corner of the image, regardless of the current imageMode(). + * + * @method get + * @param {Number} x x-coordinate of the pixel + * @param {Number} y y-coordinate of the pixel + * @param {Number} w width of the section to be returned + * @param {Number} h height of the section to be returned + * @return {p5.Image} the rectangle p5.Image + */ + /** + * @method get + * @return {p5.Image} the whole p5.Image + */ + /** + * @method get + * @param {Number} x + * @param {Number} y + * @return {Number[]} color of pixel at x,y in array format [R, G, B, A] + */ + + }, + { + key: 'get', + value: function get(x, y, w, h) { + _main.default._validateParameters('p5.Framebuffer.get', arguments); + var colorFormat = this._glColorFormat(); + if (x === undefined && y === undefined) { + x = 0; + y = 0; + w = this.width; + h = this.height; + } else if (w === undefined && h === undefined) { + if (x < 0 || y < 0 || x >= this.width || y >= this.height) { + console.warn('The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped.'); + x = this.target.constrain(x, 0, this.width - 1); + y = this.target.constrain(y, 0, this.height - 1); + } + return (0, _p2.readPixelWebGL) (this.gl, this.framebuffer, x * this.density, y * this.density, colorFormat.format, colorFormat.type); + } + x = this.target.constrain(x, 0, this.width - 1); + y = this.target.constrain(y, 0, this.height - 1); + w = this.target.constrain(w, 1, this.width - x); + h = this.target.constrain(h, 1, this.height - y); + var rawData = (0, _p2.readPixelsWebGL) (undefined, this.gl, this.framebuffer, x * this.density, y * this.density, w * this.density, h * this.density, colorFormat.format, colorFormat.type); + // Framebuffer data might be either a Uint8Array or Float32Array + // depending on its format, and it may or may not have an alpha channel. + // To turn it into an image, we have to normalize the data into a + // Uint8ClampedArray with alpha. + var fullData = new Uint8ClampedArray(w * h * this.density * this.density * 4); + // Default channels that aren't in the framebuffer (e.g. alpha, if the + // framebuffer is in RGB mode instead of RGBA) to 255 + fullData.fill(255); + var channels = colorFormat.type === this.gl.RGB ? 3 : 4; + for (var _y = 0; _y < h * this.density; _y++) { + for (var _x = 0; _x < w * this.density; _x++) { + for (var channel = 0; channel < 4; channel++) { + var idx = (_y * w * this.density + _x) * 4 + channel; + if (channel < channels) { + // Find the index of this pixel in `rawData`, which might have a + // different number of channels + var rawDataIdx = channels === 4 ? idx : (_y * w * this.density + _x) * channels + channel; + fullData[idx] = rawData[rawDataIdx]; + } + } + } + } // Create an image from the data + + var region = new _main.default.Image(w * this.density, h * this.density); + region.imageData = region.canvas.getContext('2d').createImageData(region.width, region.height); + region.imageData.data.set(fullData); + region.pixels = region.imageData.data; + region.updatePixels(); + if (this.density !== 1) { + // TODO: support get() at a pixel density > 1 + region.resize(w, h); + } + return region; + } /** + * Call this after initially calling + * loadPixels() and updating pixels + * to replace the content of the framebuffer with the data in the pixels + * array. + * + * This will also clear the depth buffer so that any future drawing done + * afterwards will go on top. + * + * @example + *
                                  + * + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * } + * function draw() { + * noStroke(); + * lights(); + * + * // Draw a sphere to the framebuffer + * framebuffer.begin(); + * background(0); + * sphere(25); + * framebuffer.end(); + * + * // Load its pixels and draw a gradient over the lower half of the canvas + * framebuffer.loadPixels(); + * for (let y = height/2; y < height; y++) { + * for (let x = 0; x < width; x++) { + * const idx = (y * width + x) * 4; + * framebuffer.pixels[idx] = (x / width) * 255; + * framebuffer.pixels[idx + 1] = (y / height) * 255; + * framebuffer.pixels[idx + 2] = 255; + * framebuffer.pixels[idx + 3] = 255; + * } + * } + * framebuffer.updatePixels(); + * + * // Draw a cube on top of the pixels we just wrote + * framebuffer.begin(); + * push(); + * translate(20, 20); + * rotateX(0.5); + * rotateY(0.5); + * box(20); + * pop(); + * framebuffer.end(); + * + * image(framebuffer, -width/2, -height/2); + * noLoop(); + * } + * + *
                                  + * + * @alt + * A sphere partly occluded by a gradient from cyan to white to magenta on + * the lower half of the canvas, with a 3D cube drawn on top of that in the + * lower right corner. + */ + + }, + { + key: 'updatePixels', + value: function updatePixels() { + var gl = this.gl; + this.colorP5Texture.bindTexture(); + var colorFormat = this._glColorFormat(); + var channels = colorFormat.format === gl.RGBA ? 4 : 3; + var len = this.width * this.height * this.density * this.density * channels; + var TypedArrayClass = colorFormat.type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; + if (!(this.pixels instanceof TypedArrayClass) || this.pixels.length !== len) { + throw new Error('The pixels array has not been set correctly. Please call loadPixels() before updatePixels().'); + } + gl.texImage2D(gl.TEXTURE_2D, 0, colorFormat.internalFormat, this.width * this.density, this.height * this.density, 0, colorFormat.format, colorFormat.type, this.pixels); + this.colorP5Texture.unbindTexture(); + var prevFramebuffer = this.target._renderer.activeFramebuffer(); + if (this.antialias) { + // We need to make sure the antialiased framebuffer also has the updated + // pixels so that if more is drawn to it, it goes on top of the updated + // pixels instead of replacing them. + // We can't blit the framebuffer to the multisampled antialias + // framebuffer to leave both in the same state, so instead we have + // to use image() to put the framebuffer texture onto the antialiased + // framebuffer. + this.begin(); + this.target.push(); + this.target.imageMode(this.target.CENTER); + this.target.resetMatrix(); + this.target.noStroke(); + this.target.clear(); + this.target.image(this, 0, 0); + this.target.pop(); + if (this.useDepth) { + gl.clearDepth(1); + gl.clear(gl.DEPTH_BUFFER_BIT); + } + this.end(); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); + if (this.useDepth) { + gl.clearDepth(1); + gl.clear(gl.DEPTH_BUFFER_BIT); + } + if (prevFramebuffer) { + gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer._framebufferToBind()); + } else { + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + } + } + } + ]); + return Framebuffer; + }(); + /** + * A texture with the color information of the framebuffer. Pass this (or the + * framebuffer itself) to texture() to draw it to + * the canvas, or pass it to a shader with + * setUniform() to read its data. + * + * Since Framebuffers are controlled by WebGL, their y coordinates are stored + * flipped compared to images and videos. When texturing with a framebuffer + * texture, you may want to flip vertically, e.g. with + * `plane(framebuffer.width, -framebuffer.height)`. + * + * @property {p5.FramebufferTexture} color + * @for p5.Framebuffer * - * @method bezierPoint - * @param {Number} a coordinate of first point on the curve - * @param {Number} b coordinate of first control point - * @param {Number} c coordinate of second control point - * @param {Number} d coordinate of second point on the curve - * @param {Number} t value between 0 and 1 - * @return {Number} the value of the Bezier at position t * @example *
                                  * - * noFill(); - * let x1 = 85, - x2 = 10, - x3 = 90, - x4 = 15; - * let y1 = 20, - y2 = 10, - y3 = 90, - y4 = 80; - * bezier(x1, y1, x2, y2, x3, y3, x4, y4); - * fill(255); - * let steps = 10; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = bezierPoint(x1, x2, x3, x4, t); - * let y = bezierPoint(y1, y2, y3, y4, t); - * circle(x, y, 5); + * let framebuffer; + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * normalMaterial(); + * sphere(20); + * framebuffer.end(); + * + * // Draw the framebuffer to the main canvas + * image(framebuffer.color, -width/2, -height/2); * } * *
                                  * * @alt - * 10 points plotted on a given bezier at equal distances. + * A red, green, and blue sphere in the middle of the canvas */ - _main.default.prototype.bezierPoint = function (a, b, c, d, t) { - _main.default._validateParameters("bezierPoint", arguments); - var adjustedT = 1 - t; - return ( - Math.pow(adjustedT, 3) * a + - 3 * Math.pow(adjustedT, 2) * t * b + - 3 * adjustedT * Math.pow(t, 2) * c + - Math.pow(t, 3) * d - ); - }; - /** - * Evaluates the tangent to the Bezier at position t for points a, b, c, d. - * The parameters a and d are the first and last points - * on the curve, and b and c are the control points. - * The final parameter t varies between 0 and 1. - * - * @method bezierTangent - * @param {Number} a coordinate of first point on the curve - * @param {Number} b coordinate of first control point - * @param {Number} c coordinate of second control point - * @param {Number} d coordinate of second point on the curve - * @param {Number} t value between 0 and 1 - * @return {Number} the tangent at position t - * @example - *
                                  - * - * noFill(); - * bezier(85, 20, 10, 10, 90, 90, 15, 80); - * let steps = 6; - * fill(255); - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * // Get the location of the point - * let x = bezierPoint(85, 10, 90, 15, t); - * let y = bezierPoint(20, 10, 90, 80, t); - * // Get the tangent points - * let tx = bezierTangent(85, 10, 90, 15, t); - * let ty = bezierTangent(20, 10, 90, 80, t); - * // Calculate an angle from the tangent points - * let a = atan2(ty, tx); - * a += PI; - * stroke(255, 102, 0); - * line(x, y, cos(a) * 30 + x, sin(a) * 30 + y); - * // The following line of code makes a line - * // inverse of the above line - * //line(x, y, cos(a)*-30 + x, sin(a)*-30 + y); - * stroke(0); - * ellipse(x, y, 5, 5); - * } - * - *
                                  - * - *
                                  - * - * noFill(); - * bezier(85, 20, 10, 10, 90, 90, 15, 80); - * stroke(255, 102, 0); - * let steps = 16; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = bezierPoint(85, 10, 90, 15, t); - * let y = bezierPoint(20, 10, 90, 80, t); - * let tx = bezierTangent(85, 10, 90, 15, t); - * let ty = bezierTangent(20, 10, 90, 80, t); - * let a = atan2(ty, tx); - * a -= HALF_PI; - * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); - * } - * - *
                                  - * - * @alt - * s-shaped line with 6 short orange lines showing the tangents at those points. - * s-shaped line with 6 short orange lines showing lines coming out the underside of the bezier. - */ - _main.default.prototype.bezierTangent = function (a, b, c, d, t) { - _main.default._validateParameters("bezierTangent", arguments); - var adjustedT = 1 - t; - return ( - 3 * d * Math.pow(t, 2) - - 3 * c * Math.pow(t, 2) + - 6 * c * adjustedT * t - - 6 * b * adjustedT * t + - 3 * b * Math.pow(adjustedT, 2) - - 3 * a * Math.pow(adjustedT, 2) - ); - }; - /** - * Draws a curved line on the screen between two points, given as the - * middle four parameters. The first two parameters are a control point, as - * if the curve came from this point even though it's not drawn. The last - * two parameters similarly describe the other control point.

                                  - * Longer curves can be created by putting a series of curve() functions - * together or using curveVertex(). An additional function called - * curveTightness() provides control for the visual quality of the curve. - * The curve() function is an implementation of Catmull-Rom splines. - * - * @method curve - * @param {Number} x1 x-coordinate for the beginning control point - * @param {Number} y1 y-coordinate for the beginning control point - * @param {Number} x2 x-coordinate for the first point - * @param {Number} y2 y-coordinate for the first point - * @param {Number} x3 x-coordinate for the second point - * @param {Number} y3 y-coordinate for the second point - * @param {Number} x4 x-coordinate for the ending control point - * @param {Number} y4 y-coordinate for the ending control point - * @chainable - * @example - *
                                  - * - * noFill(); - * stroke(255, 102, 0); - * curve(5, 26, 5, 26, 73, 24, 73, 61); - * stroke(0); - * curve(5, 26, 73, 24, 73, 61, 15, 65); - * stroke(255, 102, 0); - * curve(73, 24, 73, 61, 15, 65, 15, 65); - * - *
                                  - * - *
                                  - * - * // Define the curve points as JavaScript objects - * let p1 = { x: 5, y: 26 }; - * let p2 = { x: 73, y: 24 }; - * let p3 = { x: 73, y: 61 }; - * let p4 = { x: 15, y: 65 }; - * noFill(); - * stroke(255, 102, 0); - * curve(p1.x, p1.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); - * stroke(0); - * curve(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y); - * stroke(255, 102, 0); - * curve(p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, p4.x, p4.y); - * - *
                                  - * - *
                                  - * - * noFill(); - * stroke(255, 102, 0); - * curve(5, 26, 0, 5, 26, 0, 73, 24, 0, 73, 61, 0); - * stroke(0); - * curve(5, 26, 0, 73, 24, 0, 73, 61, 0, 15, 65, 0); - * stroke(255, 102, 0); - * curve(73, 24, 0, 73, 61, 0, 15, 65, 0, 15, 65, 0); - * - *
                                  - * - * @alt - * horseshoe shape with orange ends facing left and black curved center. - * horseshoe shape with orange ends facing left and black curved center. - * curving black and orange lines. - */ - /** - * @method curve - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 z-coordinate for the beginning control point - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate for the first point - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the second point - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 z-coordinate for the ending control point - * @chainable - */ - _main.default.prototype.curve = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("curve", args); - if (this._renderer._doStroke) { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).curve.apply( - _this$_renderer2, - args, - ); - } - return this; - }; - /** - * Sets the resolution at which curves display. The default value is 20 while - * the minimum value is 3. - * - * This function is only useful when using the WEBGL renderer - * as the default canvas renderer does not use this - * information. - * - * @method curveDetail - * @param {Number} resolution resolution of the curves - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * curveDetail(5); - * } - * function draw() { - * background(200); - * - * curve(250, 600, 0, -30, 40, 0, 30, 30, 0, -250, 600, 0); - * } - * - *
                                  - * - * @alt - * white arch shape with a low level of curve detail. - */ - _main.default.prototype.curveDetail = function (d) { - _main.default._validateParameters("curveDetail", arguments); - if (d < 3) { - this._curveDetail = 3; - } else { - this._curveDetail = d; - } - return this; - }; - /** - * Modifies the quality of forms created with curve() - * and curveVertex().The parameter tightness - * determines how the curve fits to the vertex points. The value 0.0 is the - * default value for tightness (this value defines the curves to be Catmull-Rom - * splines) and the value 1.0 connects all the points with straight lines. - * Values within the range -5.0 and 5.0 will deform the curves but will leave - * them recognizable and as values increase in magnitude, they will continue to deform. - * - * @method curveTightness - * @param {Number} amount amount of deformation from the original vertices - * @chainable - * @example - *
                                  - * - * // Move the mouse left and right to see the curve change - * function setup() { - * createCanvas(100, 100); - * noFill(); - * } - * - * function draw() { - * background(204); - * let t = map(mouseX, 0, width, -5, 5); - * curveTightness(t); - * beginShape(); - * curveVertex(10, 26); - * curveVertex(10, 26); - * curveVertex(83, 24); - * curveVertex(83, 61); - * curveVertex(25, 65); - * curveVertex(25, 65); - * endShape(); - * } - * - *
                                  - * - * @alt - * Line shaped like right-facing arrow,points move with mouse-x and warp shape. - */ - _main.default.prototype.curveTightness = function (t) { - _main.default._validateParameters("curveTightness", arguments); - this._renderer._curveTightness = t; - return this; - }; - /** - * Evaluates the curve at position t for points a, b, c, d. - * The parameter t varies between 0 and 1, a and d are control points - * of the curve, and b and c are the start and end points of the curve. - * This can be done once with the x coordinates and a second time - * with the y coordinates to get the location of a curve at t. - * - * @method curvePoint - * @param {Number} a coordinate of first control point of the curve - * @param {Number} b coordinate of first point - * @param {Number} c coordinate of second point - * @param {Number} d coordinate of second control point - * @param {Number} t value between 0 and 1 - * @return {Number} Curve value at position t - * @example - *
                                  - * - * noFill(); - * curve(5, 26, 5, 26, 73, 24, 73, 61); - * curve(5, 26, 73, 24, 73, 61, 15, 65); - * fill(255); - * ellipseMode(CENTER); - * let steps = 6; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = curvePoint(5, 5, 73, 73, t); - * let y = curvePoint(26, 26, 24, 61, t); - * ellipse(x, y, 5, 5); - * x = curvePoint(5, 73, 73, 15, t); - * y = curvePoint(26, 24, 61, 65, t); - * ellipse(x, y, 5, 5); - * } - * - *
                                  - * - *line hooking down to right-bottom with 13 5×5 white ellipse points - */ - _main.default.prototype.curvePoint = function (a, b, c, d, t) { - _main.default._validateParameters("curvePoint", arguments); - var s = this._renderer._curveTightness, - t3 = t * t * t, - t2 = t * t, - f1 = ((s - 1) / 2) * t3 + (1 - s) * t2 + ((s - 1) / 2) * t, - f2 = ((s + 3) / 2) * t3 + ((-5 - s) / 2) * t2 + 1, - f3 = ((-3 - s) / 2) * t3 + (s + 2) * t2 + ((1 - s) / 2) * t, - f4 = ((1 - s) / 2) * t3 + ((s - 1) / 2) * t2; - return a * f1 + b * f2 + c * f3 + d * f4; - }; - /** - * Evaluates the tangent to the curve at position t for points a, b, c, d. - * The parameter t varies between 0 and 1, a and d are points on the curve, - * and b and c are the control points. - * - * @method curveTangent - * @param {Number} a coordinate of first control point - * @param {Number} b coordinate of first point on the curve - * @param {Number} c coordinate of second point on the curve - * @param {Number} d coordinate of second conrol point - * @param {Number} t value between 0 and 1 - * @return {Number} the tangent at position t - * @example - *
                                  - * - * noFill(); - * curve(5, 26, 73, 24, 73, 61, 15, 65); - * let steps = 6; - * for (let i = 0; i <= steps; i++) { - * let t = i / steps; - * let x = curvePoint(5, 73, 73, 15, t); - * let y = curvePoint(26, 24, 61, 65, t); - * //ellipse(x, y, 5, 5); - * let tx = curveTangent(5, 73, 73, 15, t); - * let ty = curveTangent(26, 24, 61, 65, t); - * let a = atan2(ty, tx); - * a -= PI / 2.0; - * line(x, y, cos(a) * 8 + x, sin(a) * 8 + y); - * } - * - *
                                  - * - * @alt - * right curving line mid-right of canvas with 7 short lines radiating from it. - */ - _main.default.prototype.curveTangent = function (a, b, c, d, t) { - _main.default._validateParameters("curveTangent", arguments); - var s = this._renderer._curveTightness, - tt3 = t * t * 3, - t2 = t * 2, - f1 = ((s - 1) / 2) * tt3 + (1 - s) * t2 + (s - 1) / 2, - f2 = ((s + 3) / 2) * tt3 + ((-5 - s) / 2) * t2, - f3 = ((-3 - s) / 2) * tt3 + (s + 2) * t2 + (1 - s) / 2, - f4 = ((1 - s) / 2) * tt3 + ((s - 1) / 2) * t2; - return a * f1 + b * f2 + c * f3 + d * f4; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../friendly_errors/fes_core": 289, - "../friendly_errors/file_errors": 290, - "../friendly_errors/validate_params": 293, - "../main": 298, - }, - ], - 308: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.slice"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../main")); - var constants = _interopRequireWildcard(_dereq_("../constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Shape - * @submodule Vertex - * @for p5 - * @requires core - * @requires constants - */ - - var shapeKind = null; - var vertices = []; - var contourVertices = []; - var isBezier = false; - var isCurve = false; - var isQuadratic = false; - var isContour = false; - var isFirstContour = true; - /** - * Use the beginContour() and - * endContour() functions to create negative shapes - * within shapes such as the center of the letter 'O'. beginContour() - * begins recording vertices for the shape and endContour() stops recording. - * The vertices that define a negative shape must "wind" in the opposite direction - * from the exterior shape. First draw vertices for the exterior clockwise order, then for internal shapes, draw vertices - * shape in counter-clockwise. - * - * These functions can only be used within a beginShape()/endShape() pair and - * transformations such as translate(), rotate(), and scale() do not work - * within a beginContour()/endContour() pair. It is also not possible to use - * other shapes, such as ellipse() or rect() within. - * - * @method beginContour - * @chainable - * @example - *
                                  - * - * translate(50, 50); - * stroke(255, 0, 0); - * beginShape(); - * // Exterior part of shape, clockwise winding - * vertex(-40, -40); - * vertex(40, -40); - * vertex(40, 40); - * vertex(-40, 40); - * // Interior part of shape, counter-clockwise winding - * beginContour(); - * vertex(-20, -20); - * vertex(-20, 20); - * vertex(20, 20); - * vertex(20, -20); - * endContour(); - * endShape(CLOSE); - * - *
                                  - * - * @alt - * white rect and smaller grey rect with red outlines in center of canvas. - */ - _main.default.prototype.beginContour = function () { - if (this._renderer.isP3D) { - this._renderer.beginContour(); - } else { - contourVertices = []; - isContour = true; - } - return this; - }; - /** - * Using the beginShape() and endShape() functions allow creating more - * complex forms. beginShape() begins recording vertices for a shape and - * endShape() stops recording. The value of the kind parameter tells it which - * types of shapes to create from the provided vertices. With no mode - * specified, the shape can be any irregular polygon. - * - * The parameters available for beginShape() are: - * - * POINTS - * Draw a series of points - * - * LINES - * Draw a series of unconnected line segments (individual lines) - * - * TRIANGLES - * Draw a series of separate triangles - * - * TRIANGLE_FAN - * Draw a series of connected triangles sharing the first vertex in a fan-like fashion - * - * TRIANGLE_STRIP - * Draw a series of connected triangles in strip fashion - * - * QUADS - * Draw a series of separate quads - * - * QUAD_STRIP - * Draw quad strip using adjacent edges to form the next quad - * - * TESS (WEBGL only) - * Handle irregular polygon for filling curve by explicit tessellation - * - * After calling the beginShape() function, a series of vertex() commands must follow. To stop - * drawing the shape, call endShape(). Each shape will be outlined with the - * current stroke color and filled with the fill color. - * - * Transformations such as translate(), rotate(), and scale() do not work - * within beginShape(). It is also not possible to use other shapes, such as - * ellipse() or rect() within beginShape(). - * - * @method beginShape - * @param {Constant} [kind] either POINTS, LINES, TRIANGLES, TRIANGLE_FAN - * TRIANGLE_STRIP, QUADS, QUAD_STRIP or TESS - * @chainable - * @example - *
                                  - * - * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(CLOSE); - * - *
                                  - * - *
                                  - * - * beginShape(POINTS); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(LINES); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * noFill(); - * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * noFill(); - * beginShape(); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(CLOSE); - * - *
                                  - * - *
                                  - * - * beginShape(TRIANGLES); - * vertex(30, 75); - * vertex(40, 20); - * vertex(50, 75); - * vertex(60, 20); - * vertex(70, 75); - * vertex(80, 20); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(TRIANGLE_STRIP); - * vertex(30, 75); - * vertex(40, 20); - * vertex(50, 75); - * vertex(60, 20); - * vertex(70, 75); - * vertex(80, 20); - * vertex(90, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(TRIANGLE_FAN); - * vertex(57.5, 50); - * vertex(57.5, 15); - * vertex(92, 50); - * vertex(57.5, 85); - * vertex(22, 50); - * vertex(57.5, 15); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(QUADS); - * vertex(30, 20); - * vertex(30, 75); - * vertex(50, 75); - * vertex(50, 20); - * vertex(65, 20); - * vertex(65, 75); - * vertex(85, 75); - * vertex(85, 20); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(QUAD_STRIP); - * vertex(30, 20); - * vertex(30, 75); - * vertex(50, 20); - * vertex(50, 75); - * vertex(65, 20); - * vertex(65, 75); - * vertex(85, 20); - * vertex(85, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(TESS); - * vertex(20, 20); - * vertex(80, 20); - * vertex(80, 40); - * vertex(40, 40); - * vertex(40, 60); - * vertex(80, 60); - * vertex(80, 80); - * vertex(20, 80); - * endShape(CLOSE); - * - *
                                  - * - * @alt - * white square-shape with black outline in middle-right of canvas. - * 4 black points in a square shape in middle-right of canvas. - * 2 horizontal black lines. In the top-right and bottom-right of canvas. - * 3 line shape with horizontal on top, vertical in middle and horizontal bottom. - * square line shape in middle-right of canvas. - * 2 white triangle shapes mid-right canvas. left one pointing up and right down. - * 5 horizontal interlocking and alternating white triangles in mid-right canvas. - * 4 interlocking white triangles in 45 degree rotated square-shape. - * 2 white rectangle shapes in mid-right canvas. Both 20×55. - * 3 side-by-side white rectangles center rect is smaller in mid-right canvas. - * Thick white l-shape with black outline mid-top-left of canvas. - */ - _main.default.prototype.beginShape = function (kind) { - _main.default._validateParameters("beginShape", arguments); - if (this._renderer.isP3D) { - var _this$_renderer; - (_this$_renderer = this._renderer).beginShape.apply( - _this$_renderer, - arguments, - ); - } else { - if ( - kind === constants.POINTS || - kind === constants.LINES || - kind === constants.TRIANGLES || - kind === constants.TRIANGLE_FAN || - kind === constants.TRIANGLE_STRIP || - kind === constants.QUADS || - kind === constants.QUAD_STRIP - ) { - shapeKind = kind; - } else { - shapeKind = null; - } - vertices = []; - contourVertices = []; - } - return this; - }; - /** - * Specifies vertex coordinates for Bezier curves. Each call to - * bezierVertex() defines the position of two control points and - * one anchor point of a Bezier curve, adding a new segment to a - * line or shape. For WebGL mode bezierVertex() can be used in 2D - * as well as 3D mode. 2D mode expects 6 parameters, while 3D mode - * expects 9 parameters (including z coordinates). - * - * The first time bezierVertex() is used within a beginShape() - * call, it must be prefaced with a call to vertex() to set the first anchor - * point. This function must be used between beginShape() and endShape() - * and only when there is no MODE or POINTS parameter specified to - * beginShape(). - * - * @method bezierVertex - * @param {Number} x2 x-coordinate for the first control point - * @param {Number} y2 y-coordinate for the first control point - * @param {Number} x3 x-coordinate for the second control point - * @param {Number} y3 y-coordinate for the second control point - * @param {Number} x4 x-coordinate for the anchor point - * @param {Number} y4 y-coordinate for the anchor point - * @chainable - * - * @example - *
                                  - * - * noFill(); - * beginShape(); - * vertex(30, 20); - * bezierVertex(80, 0, 80, 75, 30, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * beginShape(); - * vertex(30, 20); - * bezierVertex(80, 0, 80, 75, 30, 75); - * bezierVertex(50, 80, 60, 25, 30, 20); - * endShape(); - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * } - * function draw() { - * orbitControl(); - * background(50); - * strokeWeight(4); - * stroke(255); - * point(-25, 30); - * point(25, 30); - * point(25, -30); - * point(-25, -30); - * - * strokeWeight(1); - * noFill(); - * - * beginShape(); - * vertex(-25, 30); - * bezierVertex(25, 30, 25, -30, -25, -30); - * endShape(); - * - * beginShape(); - * vertex(-25, 30, 20); - * bezierVertex(25, 30, 20, 25, -30, 20, -25, -30, 20); - * endShape(); - * } - * - *
                                  - * - * @alt - * crescent-shaped line in middle of canvas. Points facing left. - * white crescent shape in middle of canvas. Points facing left. - * crescent shape in middle of canvas with another crescent shape on positive z-axis. - */ - /** - * @method bezierVertex - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate for the first control point (for WebGL mode) - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the second control point (for WebGL mode) - * @param {Number} x4 - * @param {Number} y4 - * @param {Number} z4 z-coordinate for the anchor point (for WebGL mode) - * @chainable - */ - _main.default.prototype.bezierVertex = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("bezierVertex", args); - if (this._renderer.isP3D) { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).bezierVertex.apply( - _this$_renderer2, - args, - ); - } else { - if (vertices.length === 0) { - _main.default._friendlyError( - "vertex() must be used once before calling bezierVertex()", - "bezierVertex", - ); - } else { - isBezier = true; - var vert = []; - for (var i = 0; i < args.length; i++) { - vert[i] = args[i]; - } - vert.isVert = false; - if (isContour) { - contourVertices.push(vert); - } else { - vertices.push(vert); - } - } - } - return this; - }; - /** - * Specifies vertex coordinates for curves. This function may only - * be used between beginShape() and endShape() and only when there - * is no MODE parameter specified to beginShape(). - * For WebGL mode curveVertex() can be used in 2D as well as 3D mode. - * 2D mode expects 2 parameters, while 3D mode expects 3 parameters. - * - * The first and last points in a series of curveVertex() lines will be used to - * guide the beginning and end of the curve. A minimum of four - * points is required to draw a tiny curve between the second and - * third points. Adding a fifth point with curveVertex() will draw - * the curve between the second, third, and fourth points. The - * curveVertex() function is an implementation of Catmull-Rom - * splines. - * - * @method curveVertex - * @param {Number} x x-coordinate of the vertex - * @param {Number} y y-coordinate of the vertex - * @chainable - * @example - *
                                  - * - * strokeWeight(5); - * point(84, 91); - * point(68, 19); - * point(21, 17); - * point(32, 91); - * strokeWeight(1); - * - * noFill(); - * beginShape(); - * curveVertex(84, 91); - * curveVertex(84, 91); - * curveVertex(68, 19); - * curveVertex(21, 17); - * curveVertex(32, 91); - * curveVertex(32, 91); - * endShape(); - * - *
                                  - * - * @alt - * Upside-down u-shape line, mid canvas. left point extends beyond canvas view. - */ - /** - * @method curveVertex - * @param {Number} x - * @param {Number} y - * @param {Number} [z] z-coordinate of the vertex (for WebGL mode) - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * } - * function draw() { - * orbitControl(); - * background(50); - * strokeWeight(4); - * stroke(255); - * - * point(-25, 25); - * point(-25, 25); - * point(-25, -25); - * point(25, -25); - * point(25, 25); - * point(25, 25); - * - * strokeWeight(1); - * noFill(); - * - * beginShape(); - * curveVertex(-25, 25); - * curveVertex(-25, 25); - * curveVertex(-25, -25); - * curveVertex(25, -25); - * curveVertex(25, 25); - * curveVertex(25, 25); - * endShape(); - * - * beginShape(); - * curveVertex(-25, 25, 20); - * curveVertex(-25, 25, 20); - * curveVertex(-25, -25, 20); - * curveVertex(25, -25, 20); - * curveVertex(25, 25, 20); - * curveVertex(25, 25, 20); - * endShape(); - * } - * - *
                                  - * - * @alt - * Upside-down u-shape line, mid canvas with the same shape in positive z-axis. - */ - _main.default.prototype.curveVertex = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("curveVertex", args); - if (this._renderer.isP3D) { - var _this$_renderer3; - (_this$_renderer3 = this._renderer).curveVertex.apply( - _this$_renderer3, - args, - ); - } else { - isCurve = true; - this.vertex(args[0], args[1]); - } - return this; - }; - /** - * Use the beginContour() and endContour() functions to create negative - * shapes within shapes such as the center of the letter 'O'. beginContour() - * begins recording vertices for the shape and endContour() stops recording. - * The vertices that define a negative shape must "wind" in the opposite - * direction from the exterior shape. First draw vertices for the exterior - * clockwise order, then for internal shapes, draw vertices - * shape in counter-clockwise. - * - * These functions can only be used within a beginShape()/endShape() pair and - * transformations such as translate(), rotate(), and scale() do not work - * within a beginContour()/endContour() pair. It is also not possible to use - * other shapes, such as ellipse() or rect() within. - * - * @method endContour - * @chainable - * @example - *
                                  - * - * translate(50, 50); - * stroke(255, 0, 0); - * beginShape(); - * // Exterior part of shape, clockwise winding - * vertex(-40, -40); - * vertex(40, -40); - * vertex(40, 40); - * vertex(-40, 40); - * // Interior part of shape, counter-clockwise winding - * beginContour(); - * vertex(-20, -20); - * vertex(-20, 20); - * vertex(20, 20); - * vertex(20, -20); - * endContour(); - * endShape(CLOSE); - * - *
                                  - * - * @alt - * white rect and smaller grey rect with red outlines in center of canvas. - */ - _main.default.prototype.endContour = function () { - if (this._renderer.isP3D) { - return this; - } - var vert = contourVertices[0].slice(); // copy all data - vert.isVert = contourVertices[0].isVert; - vert.moveTo = false; - contourVertices.push(vert); - // prevent stray lines with multiple contours - if (isFirstContour) { - vertices.push(vertices[0]); - isFirstContour = false; - } - for (var i = 0; i < contourVertices.length; i++) { - vertices.push(contourVertices[i]); - } - return this; - }; - /** - * The endShape() function is the companion to beginShape() and may only be - * called after beginShape(). When endShape() is called, all of the image - * data defined since the previous call to beginShape() is written into the image - * buffer. The constant CLOSE is the value for the `mode` parameter to close - * the shape (to connect the beginning and the end). - * When using instancing with endShape() the instancing will not apply to the strokes. - * When the count parameter is used with a value greater than 1, it enables instancing for shapes built when in WEBGL mode. Instancing - * is a feature that allows the GPU to efficiently draw multiples of the same shape. It's often used for particle effects or other - * times when you need a lot of repetition. In order to take advantage of instancing, you will also need to write your own custom - * shader using the gl_InstanceID keyword. You can read more about instancing - * here or by working from the example on this - * page. - * - * @method endShape - * @param {Constant} [mode] use CLOSE to close the shape - * @param {Integer} [count] number of times you want to draw/instance the shape (for WebGL mode). - * @chainable - * @example - *
                                  - * - * noFill(); - * - * beginShape(); - * vertex(20, 20); - * vertex(45, 20); - * vertex(45, 80); - * endShape(CLOSE); - * - * beginShape(); - * vertex(50, 20); - * vertex(75, 20); - * vertex(75, 80); - * endShape(); - * - *
                                  - * - * @example - *
                                  - * - * let fx; - * let vs = `#version 300 es - * - * precision mediump float; - * - * in vec3 aPosition; - * flat out int instanceID; - * - * uniform mat4 uModelViewMatrix; - * uniform mat4 uProjectionMatrix; - * - * void main() { - * - * // copy the instance ID to the fragment shader - * instanceID = gl_InstanceID; - * vec4 positionVec4 = vec4(aPosition, 1.0); - * - * // gl_InstanceID represents a numeric value for each instance - * // using gl_InstanceID allows us to move each instance separately - * // here we move each instance horizontally by id * 40 - * float xOffset = float(gl_InstanceID) * 40.0; - * - * // apply the offset to the final position - * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4 - - * vec4(xOffset, 0.0, 0.0, 0.0); - * } - * `; - * let fs = `#version 300 es - * - * precision mediump float; - * - * out vec4 outColor; - * flat in int instanceID; - * uniform float numInstances; - * - * void main() { - * vec4 red = vec4(1.0, 0.0, 0.0, 1.0); - * vec4 blue = vec4(0.0, 0.0, 1.0, 1.0); - * - * // Normalize the instance id - * float normId = float(instanceID) / numInstances; - * - * // Mix between two colors using the normalized instance id - * outColor = mix(red, blue, normId); - * } - * `; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * fx = createShader(vs, fs); - * } - * - * function draw() { - * background(220); - * - * // strokes aren't instanced, and are rather used for debug purposes - * shader(fx); - * fx.setUniform('numInstances', 4); - * - * // this doesn't have to do with instancing, this is just for centering the squares - * translate(25, -10); - * - * // here we draw the squares we want to instance - * beginShape(); - * vertex(0, 0); - * vertex(0, 20); - * vertex(20, 20); - * vertex(20, 0); - * vertex(0, 0); - * endShape(CLOSE, 4); - * - * resetShader(); - * } - * - *
                                  - * - * @alt - * Triangle line shape with smallest interior angle on bottom and upside-down L. - */ - _main.default.prototype.endShape = function (mode) { - var count = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 1; - _main.default._validateParameters("endShape", arguments); - if (count < 1) { - console.log( - "🌸 p5.js says: You can not have less than one instance", - ); - count = 1; - } - if (this._renderer.isP3D) { - this._renderer.endShape( - mode, - isCurve, - isBezier, - isQuadratic, - isContour, - shapeKind, - count, - ); - } else { - if (count !== 1) { - console.log( - "🌸 p5.js says: Instancing is only supported in WebGL2 mode", - ); - } - if (vertices.length === 0) { - return this; - } - if (!this._renderer._doStroke && !this._renderer._doFill) { - return this; - } - var closeShape = mode === constants.CLOSE; - // if the shape is closed, the first element is also the last element - if (closeShape && !isContour) { - vertices.push(vertices[0]); - } - this._renderer.endShape( - mode, - vertices, - isCurve, - isBezier, - isQuadratic, - isContour, - shapeKind, - ); - // Reset some settings - isCurve = false; - isBezier = false; - isQuadratic = false; - isContour = false; - isFirstContour = true; - // If the shape is closed, the first element was added as last element. - // We must remove it again to prevent the list of vertices from growing - // over successive calls to endShape(CLOSE) - if (closeShape) { - vertices.pop(); - } - } - return this; - }; - /** - * Specifies vertex coordinates for quadratic Bezier curves. Each call to - * quadraticVertex() defines the position of one control points and one - * anchor point of a Bezier curve, adding a new segment to a line or shape. - * The first time quadraticVertex() is used within a beginShape() call, it - * must be prefaced with a call to vertex() to set the first anchor point. - * For WebGL mode quadraticVertex() can be used in 2D as well as 3D mode. - * 2D mode expects 4 parameters, while 3D mode expects 6 parameters - * (including z coordinates). - * - * This function must be used between beginShape() and endShape() - * and only when there is no MODE or POINTS parameter specified to - * beginShape(). - * - * @method quadraticVertex - * @param {Number} cx x-coordinate for the control point - * @param {Number} cy y-coordinate for the control point - * @param {Number} x3 x-coordinate for the anchor point - * @param {Number} y3 y-coordinate for the anchor point - * @chainable - * - * @example - *
                                  - * - * strokeWeight(5); - * point(20, 20); - * point(80, 20); - * point(50, 50); - * - * noFill(); - * strokeWeight(1); - * beginShape(); - * vertex(20, 20); - * quadraticVertex(80, 20, 50, 50); - * endShape(); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * point(20, 20); - * point(80, 20); - * point(50, 50); - * - * point(20, 80); - * point(80, 80); - * point(80, 60); - * - * noFill(); - * strokeWeight(1); - * beginShape(); - * vertex(20, 20); - * quadraticVertex(80, 20, 50, 50); - * quadraticVertex(20, 80, 80, 80); - * vertex(80, 60); - * endShape(); - * - *
                                  - * - * @alt - * arched-shaped black line with 4 pixel thick stroke weight. - * backwards s-shaped black line with 4 pixel thick stroke weight. - */ - /** - * @method quadraticVertex - * @param {Number} cx - * @param {Number} cy - * @param {Number} cz z-coordinate for the control point (for WebGL mode) - * @param {Number} x3 - * @param {Number} y3 - * @param {Number} z3 z-coordinate for the anchor point (for WebGL mode) - * @chainable - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * } - * function draw() { - * orbitControl(); - * background(50); - * strokeWeight(4); - * stroke(255); - * - * point(-35, -35); - * point(35, -35); - * point(0, 0); - * point(-35, 35); - * point(35, 35); - * point(35, 10); - * - * strokeWeight(1); - * noFill(); - * - * beginShape(); - * vertex(-35, -35); - * quadraticVertex(35, -35, 0, 0); - * quadraticVertex(-35, 35, 35, 35); - * vertex(35, 10); - * endShape(); - * - * beginShape(); - * vertex(-35, -35, 20); - * quadraticVertex(35, -35, 20, 0, 0, 20); - * quadraticVertex(-35, 35, 20, 35, 35, 20); - * vertex(35, 10, 20); - * endShape(); - * } - * - *
                                  - * - * @alt - * backwards s-shaped black line with the same s-shaped line in positive z-axis. - */ - _main.default.prototype.quadraticVertex = function () { - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters("quadraticVertex", args); - if (this._renderer.isP3D) { - var _this$_renderer4; - (_this$_renderer4 = this._renderer).quadraticVertex.apply( - _this$_renderer4, - args, - ); - } else { - //if we're drawing a contour, put the points into an - // array for inside drawing - if (this._contourInited) { - var pt = {}; - pt.x = args[0]; - pt.y = args[1]; - pt.x3 = args[2]; - pt.y3 = args[3]; - pt.type = constants.QUADRATIC; - this._contourVertices.push(pt); - return this; - } - if (vertices.length > 0) { - isQuadratic = true; - var vert = []; - for (var i = 0; i < args.length; i++) { - vert[i] = args[i]; - } - vert.isVert = false; - if (isContour) { - contourVertices.push(vert); - } else { - vertices.push(vert); - } - } else { - _main.default._friendlyError( - "vertex() must be used once before calling quadraticVertex()", - "quadraticVertex", - ); - } - } - return this; - }; - /** - * All shapes are constructed by connecting a series of vertices. vertex() - * is used to specify the vertex coordinates for points, lines, triangles, - * quads, and polygons. It is used exclusively within the beginShape() and - * endShape() functions. - * - * @method vertex - * @param {Number} x x-coordinate of the vertex - * @param {Number} y y-coordinate of the vertex - * @chainable - * @example - *
                                  - * - * strokeWeight(3); - * beginShape(POINTS); - * vertex(30, 20); - * vertex(85, 20); - * vertex(85, 75); - * vertex(30, 75); - * endShape(); - * - *
                                  - * - *
                                  - * - * createCanvas(100, 100, WEBGL); - * background(240, 240, 240); - * fill(237, 34, 93); - * noStroke(); - * beginShape(); - * vertex(0, 35); - * vertex(35, 0); - * vertex(0, -35); - * vertex(-35, 0); - * endShape(); - * - *
                                  - * - *
                                  - * - * createCanvas(100, 100, WEBGL); - * background(240, 240, 240); - * fill(237, 34, 93); - * noStroke(); - * beginShape(); - * vertex(-10, 10); - * vertex(0, 35); - * vertex(10, 10); - * vertex(35, 0); - * vertex(10, -8); - * vertex(0, -35); - * vertex(-10, -8); - * vertex(-35, 0); - * endShape(); - * - *
                                  - * - *
                                  - * - * strokeWeight(3); - * stroke(237, 34, 93); - * beginShape(LINES); - * vertex(10, 35); - * vertex(90, 35); - * vertex(10, 65); - * vertex(90, 65); - * vertex(35, 10); - * vertex(35, 90); - * vertex(65, 10); - * vertex(65, 90); - * endShape(); - * - *
                                  - * - *
                                  - * - * // Click to change the number of sides. - * // In WebGL mode, custom shapes will only - * // display hollow fill sections when - * // all calls to vertex() use the same z-value. - * - * let sides = 3; - * let angle, px, py; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * fill(237, 34, 93); - * strokeWeight(3); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateZ(frameCount * 0.01); - * ngon(sides, 0, 0, 80); - * } - * - * function mouseClicked() { - * if (sides > 6) { - * sides = 3; - * } else { - * sides++; - * } - * } - * - * function ngon(n, x, y, d) { - * beginShape(TESS); - * for (let i = 0; i < n + 1; i++) { - * angle = TWO_PI / n * i; - * px = x + sin(angle) * d / 2; - * py = y - cos(angle) * d / 2; - * vertex(px, py, 0); - * } - * for (let i = 0; i < n + 1; i++) { - * angle = TWO_PI / n * i; - * px = x + sin(angle) * d / 4; - * py = y - cos(angle) * d / 4; - * vertex(px, py, 0); - * } - * endShape(); - * } - * - *
                                  - * @alt - * 4 black points in a square shape in middle-right of canvas. - * 4 points making a diamond shape. - * 8 points making a star. - * 8 points making 4 lines. - * A rotating 3D shape with a hollow section in the middle. - */ - /** - * @method vertex - * @param {Number} x - * @param {Number} y - * @param {Number} [z] z-coordinate of the vertex. - * Defaults to 0 if not specified. - * @chainable - */ - /** - * @method vertex - * @param {Number} x - * @param {Number} y - * @param {Number} [z] - * @param {Number} [u] the vertex's texture u-coordinate - * @param {Number} [v] the vertex's texture v-coordinate - * @chainable - */ - _main.default.prototype.vertex = function (x, y, moveTo, u, v) { - if (this._renderer.isP3D) { - var _this$_renderer5; - (_this$_renderer5 = this._renderer).vertex.apply( - _this$_renderer5, - arguments, - ); - } else { - var vert = []; - vert.isVert = true; - vert[0] = x; - vert[1] = y; - vert[2] = 0; - vert[3] = 0; - vert[4] = 0; - vert[5] = this._renderer._getFill(); - vert[6] = this._renderer._getStroke(); - if (moveTo) { - vert.moveTo = moveTo; - } - if (isContour) { - if (contourVertices.length === 0) { - vert.moveTo = true; - } - contourVertices.push(vert); - } else { - vertices.push(vert); - } - } - return this; - }; - /** - * Sets the 3d vertex normal to use for subsequent vertices drawn with - * vertex(). A normal is a vector that is generally - * nearly perpendicular to a shape's surface which controls how much light will - * be reflected from that part of the surface. - * - * @method normal - * @param {Vector} vector A p5.Vector representing the vertex normal. - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * } - * - * function draw() { - * background(255); - * rotateY(frameCount / 100); - * normalMaterial(); - * beginShape(TRIANGLE_STRIP); - * normal(-0.4, 0.4, 0.8); - * vertex(-30, 30, 0); - * - * normal(0, 0, 1); - * vertex(-30, -30, 30); - * vertex(30, 30, 30); - * - * normal(0.4, -0.4, 0.8); - * vertex(30, -30, 0); - * endShape(); - * } - * - *
                                  - */ - /** - * @method normal - * @param {Number} x The x component of the vertex normal. - * @param {Number} y The y component of the vertex normal. - * @param {Number} z The z component of the vertex normal. - * @chainable - */ - _main.default.prototype.normal = function (x, y, z) { - var _this$_renderer6; - this._assert3d("normal"); - _main.default._validateParameters("normal", arguments); - (_this$_renderer6 = this._renderer).normal.apply( - _this$_renderer6, - arguments, - ); - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../constants": 286, - "../main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 309: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } // requestAnim shim layer by Paul Irish - // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - // http://my.opera.com/emoller/blog/2011/12/20/ - // requestanimationframe-for-smart-er-animating - // requestAnimationFrame polyfill by Erik Möller - // fixes from Paul Irish and Tino Zijdel - - window.requestAnimationFrame = (function () { - return ( - window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function (callback, element) { - // should '60' here be framerate? - window.setTimeout(callback, 1000 / 60); - } - ); - })(); - /** - * shim for Uint8ClampedArray.slice - * (allows arrayCopy to work with pixels[]) - * with thanks to http://halfpapstudios.com/blog/tag/html5-canvas/ - * Enumerable set to false to protect for...in from - * Uint8ClampedArray.prototype pollution. - */ - (function () { - if ( - typeof Uint8ClampedArray !== "undefined" && - !Uint8ClampedArray.prototype.slice - ) { - Object.defineProperty(Uint8ClampedArray.prototype, "slice", { - value: Array.prototype.slice, - writable: true, - configurable: true, - enumerable: false, - }); - } - })(); - /** - * this is implementation of Object.assign() which is unavailable in - * IE11 and (non-Chrome) Android browsers. - * The assign() method is used to copy the values of all enumerable - * own properties from one or more source objects to a target object. - * It will return the target object. - * Modified from https://github.com/ljharb/object.assign - */ - (function () { - if (!Object.assign) { - var keys = Object.keys; - var defineProperty = Object.defineProperty; - var canBeObject = function canBeObject(obj) { - return typeof obj !== "undefined" && obj !== null; - }; - var hasSymbols = - typeof Symbol === "function" && _typeof(Symbol()) === "symbol"; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - var isEnumerableOn = function isEnumerableOn(obj) { - return function isEnumerable(prop) { - return propIsEnumerable.call(obj, prop); - }; - }; - // per ES6 spec, this function has to have a length of 2 - var assignShim = function assign(target, source1) { - if (!canBeObject(target)) { - throw new TypeError("target must be an object"); - } - var objTarget = Object(target); - var s, source, i, props; - for (s = 1; s < arguments.length; ++s) { - source = Object(arguments[s]); - props = keys(source); - if (hasSymbols && Object.getOwnPropertySymbols) { - var _props; - (_props = props).push.apply( - _props, - _toConsumableArray( - Object.getOwnPropertySymbols(source).filter( - isEnumerableOn(source), - ), - ), - ); - } - for (i = 0; i < props.length; ++i) { - objTarget[props[i]] = source[props[i]]; - } - } - return objTarget; - }; - defineProperty(Object, "assign", { - value: assignShim, - configurable: true, - enumerable: false, - writable: true, - }); - } - })(); - }, - { - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.assign": 194, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-clamped-array": 253, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 310: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.assign"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Structure - * @submodule Structure - * @for p5 - * @requires core - */ - /** - * Stops p5.js from continuously executing the code within draw(). - * If loop() is called, the code in draw() - * begins to run continuously again. If using noLoop() - * in setup(), it should be the last line inside the block. + /** + * A texture with the depth information of the framebuffer. If the framebuffer + * was created with `{ depth: false }` in its settings, then this property will + * be undefined. Pass this to texture() to draw it to + * the canvas, or pass it to a shader with + * setUniform() to read its data. * - * When noLoop() is used, it's not possible to manipulate - * or access the screen inside event handling functions such as - * mousePressed() or - * keyPressed(). Instead, use those functions to - * call redraw() or loop(), - * which will run draw(), which can update the screen - * properly. This means that when noLoop() has been - * called, no drawing can happen, and functions like saveFrames() - * or loadPixels() may not be used. + * Since Framebuffers are controlled by WebGL, their y coordinates are stored + * flipped compared to images and videos. When texturing with a framebuffer + * texture, you may want to flip vertically, e.g. with + * `plane(framebuffer.width, -framebuffer.height)`. * - * Note that if the sketch is resized, redraw() will - * be called to update the sketch, even after noLoop() - * has been specified. Otherwise, the sketch would enter an odd state until - * loop() was called. + * @property {p5.FramebufferTexture|undefined} depth + * @for p5.Framebuffer * - * Use isLooping() to check the current state of loop(). + * @example + *
                                  + * + * let framebuffer; + * let depthShader; + * + * const vert = ` + * precision highp float; + * attribute vec3 aPosition; + * attribute vec2 aTexCoord; + * uniform mat4 uModelViewMatrix; + * uniform mat4 uProjectionMatrix; + * varying vec2 vTexCoord; + * void main() { + * vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0); + * gl_Position = uProjectionMatrix * viewModelPosition; + * vTexCoord = aTexCoord; + * } + * `; + * + * const frag = ` + * precision highp float; + * varying vec2 vTexCoord; + * uniform sampler2D depth; + * void main() { + * float depthVal = texture2D(depth, vTexCoord).r; + * gl_FragColor = mix( + * vec4(1., 1., 0., 1.), // yellow + * vec4(0., 0., 1., 1.), // blue + * pow(depthVal, 6.) + * ); + * } + * `; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * framebuffer = createFramebuffer(); + * depthShader = createShader(vert, frag); + * noStroke(); + * } + * + * function draw() { + * // Draw to the framebuffer + * framebuffer.begin(); + * background(255); + * rotateX(frameCount * 0.01); + * box(20, 20, 100); + * framebuffer.end(); + * + * push(); + * shader(depthShader); + * depthShader.setUniform('depth', framebuffer.depth); + * plane(framebuffer.width, framebuffer.height); + * pop(); + * } + * + *
                                  + * + * @alt + * A video of a rectangular prism rotating, with parts closest to the camera + * appearing yellow and colors getting progressively more blue the farther + * from the camera they go + */ + _main.default.Framebuffer = Framebuffer; + var _default = Framebuffer; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.RendererGL': 355, + './p5.Texture': 357, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.reflect.get': 203, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.float32-array': 229, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/es.typed-array.uint8-clamped-array': 253, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 350: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.for-each'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/web.dom-collections.for-each'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @module Shape + * @submodule 3D Primitives + * @for p5 + * @requires core + * @requires p5.Geometry + */ + //some of the functions are adjusted from Three.js(http://threejs.org) + /** + * p5 Geometry class + * @class p5.Geometry + * @constructor + * @param {Integer} [detailX] number of vertices along the x-axis. + * @param {Integer} [detailY] number of vertices along the y-axis. + * @param {function} [callback] function to call upon object instantiation. + */ + + _main.default.Geometry = /*#__PURE__*/ function () { + function Geometry(detailX, detailY, callback) { + _classCallCheck(this, Geometry); + //an array containing every vertex + //@type [p5.Vector] + this.vertices = [ + ]; + //an array containing every vertex for stroke drawing + this.lineVertices = new _main.default.DataArray(); + // The tangents going into or out of a vertex on a line. Along a straight + // line segment, both should be equal. At an endpoint, one or the other + // will not exist and will be all 0. In joins between line segments, they + // may be different, as they will be the tangents on either side of the join. + this.lineTangentsIn = new _main.default.DataArray(); + this.lineTangentsOut = new _main.default.DataArray(); + // When drawing lines with thickness, entries in this buffer represent which + // side of the centerline the vertex will be placed. The sign of the number + // will represent the side of the centerline, and the absolute value will be + // used as an enum to determine which part of the cap or join each vertex + // represents. See the doc comments for _addCap and _addJoin for diagrams. + this.lineSides = new _main.default.DataArray(); + //an array containing 1 normal per vertex + //@type [p5.Vector] + //[p5.Vector, p5.Vector, p5.Vector,p5.Vector, p5.Vector, p5.Vector,...] + this.vertexNormals = [ + ]; + //an array containing each three vertex indices that form a face + //[[0, 1, 2], [2, 1, 3], ...] + this.faces = [ + ]; + //a 2D array containing uvs for every vertex + //[[0.0,0.0],[1.0,0.0], ...] + this.uvs = [ + ]; + // a 2D array containing edge connectivity pattern for create line vertices + //based on faces for most objects; + this.edges = [ + ]; + this.vertexColors = [ + ]; + // One color per vertex representing the stroke color at that vertex + this.vertexStrokeColors = [ + ]; + // One color per line vertex, generated automatically based on + // vertexStrokeColors in _edgesToVertices() + this.lineVertexColors = new _main.default.DataArray(); + this.detailX = detailX !== undefined ? detailX : 1; + this.detailY = detailY !== undefined ? detailY : 1; + this.dirtyFlags = { + }; + if (callback instanceof Function) { + callback.call(this); + } + return this; // TODO: is this a constructor? + } + _createClass(Geometry, [ + { + key: 'reset', + value: function reset() { + this.lineVertices.clear(); + this.lineTangentsIn.clear(); + this.lineTangentsOut.clear(); + this.lineSides.clear(); + this.vertices.length = 0; + this.edges.length = 0; + this.vertexColors.length = 0; + this.vertexStrokeColors.length = 0; + this.lineVertexColors.clear(); + this.vertexNormals.length = 0; + this.uvs.length = 0; + this.dirtyFlags = { + }; + } /** + * Removes the internal colors of p5.Geometry. + * Using `clearColors()`, you can use `fill()` to supply new colors before drawing each shape. + * If `clearColors()` is not used, the shapes will use their internal colors by ignoring `fill()`. + * + * @method clearColors + * + * @example + *
                                  + * + * let shape01; + * let shape02; + * let points = []; + * + * function setup() { + * createCanvas(600, 600, WEBGL); + * points.push(new p5.Vector(-1, -1, 0), new p5.Vector(-1, 1, 0), + * new p5.Vector(1, -1, 0), new p5.Vector(-1, -1, 0)); + * buildShape01(); + * buildShape02(); + * } + * function draw() { + * background(0); + * fill('pink'); // shape01 retains its internal blue color, so it won't turn pink. + * model(shape01); + * fill('yellow'); // Now, shape02 is yellow. + * model(shape02); + * } + * + * function buildShape01() { + * beginGeometry(); + * fill('blue'); // shape01's color is blue because its internal colors remain. + * beginShape(); + * for (let vec of points) vertex(vec.x * 100, vec.y * 100, vec.z * 100); + * endShape(CLOSE); + * shape01 = endGeometry(); + * } + * + * function buildShape02() { + * beginGeometry(); + * fill('red'); // shape02.clearColors() removes its internal colors. Now, shape02 is red. + * beginShape(); + * for (let vec of points) vertex(vec.x * 200, vec.y * 200, vec.z * 200); + * endShape(CLOSE); + * shape02 = endGeometry(); + * shape02.clearColors(); // Resets shape02's colors. + * } + * + *
                                  + */ + + }, + { + key: 'clearColors', + value: function clearColors() { + this.vertexColors = [ + ]; + return this; + } /** + * computes faces for geometry objects based on the vertices. + * @method computeFaces + * @chainable + */ + + }, + { + key: 'computeFaces', + value: function computeFaces() { + this.faces.length = 0; + var sliceCount = this.detailX + 1; + var a, + b, + c, + d; + for (var i = 0; i < this.detailY; i++) { + for (var j = 0; j < this.detailX; j++) { + a = i * sliceCount + j; // + offset; + b = i * sliceCount + j + 1; // + offset; + c = (i + 1) * sliceCount + j + 1; // + offset; + d = (i + 1) * sliceCount + j; // + offset; + this.faces.push([a, + b, + d]); + this.faces.push([d, + b, + c]); + } + } + return this; + } + }, + { + key: '_getFaceNormal', + value: function _getFaceNormal(faceId) { + //This assumes that vA->vB->vC is a counter-clockwise ordering + var face = this.faces[faceId]; + var vA = this.vertices[face[0]]; + var vB = this.vertices[face[1]]; + var vC = this.vertices[face[2]]; + var ab = _main.default.Vector.sub(vB, vA); + var ac = _main.default.Vector.sub(vC, vA); + var n = _main.default.Vector.cross(ab, ac); + var ln = _main.default.Vector.mag(n); + var sinAlpha = ln / (_main.default.Vector.mag(ab) * _main.default.Vector.mag(ac)); + if (sinAlpha === 0 || isNaN(sinAlpha)) { + console.warn('p5.Geometry.prototype._getFaceNormal:', 'face has colinear sides or a repeated vertex'); + return n; + } + if (sinAlpha > 1) sinAlpha = 1; // handle float rounding error + return n.mult(Math.asin(sinAlpha) / ln); + } /** + * This function calculates normals for each face, where each vertex's normal is the average of the normals of all faces it's connected to. + * i.e computes smooth normals per vertex as an average of each face. + * + * When using `FLAT` shading, vertices are disconnected/duplicated i.e each face has its own copy of vertices. + * When using `SMOOTH` shading, vertices are connected/deduplicated i.e each face has its vertices shared with other faces. + * + * Options can include: + * - `roundToPrecision`: Precision value for rounding computations. Defaults to 3. + * + * @method computeNormals + * @param {String} [shadingType] shading type (`FLAT` for flat shading or `SMOOTH` for smooth shading) for buildGeometry() outputs. Defaults to `FLAT`. + * @param {Object} [options] An optional object with configuration. + * @chainable + * + * @example + *
                                  + * + * let helix; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * helix = buildGeometry(() => { + * beginShape(); + * + * for (let i = 0; i < TWO_PI * 3; i += 0.6) { + * let radius = 20; + * let x = cos(i) * radius; + * let y = sin(i) * radius; + * let z = map(i, 0, TWO_PI * 3, -30, 30); + * vertex(x, y, z); + * } + * endShape(); + * }); + * helix.computeNormals(); + * } + * function draw() { + * background(255); + * stroke(0); + * fill(150, 200, 250); + * lights(); + * rotateX(PI*0.2); + * orbitControl(); + * model(helix); + * } + * + *
                                  + * + * @alt + * A 3D helix using the computeNormals() function by default uses `FLAT` to create a flat shading effect on the helix. + * + * @example + *
                                  + * + * let star; + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * + * star = buildGeometry(() => { + * beginShape(); + * for (let i = 0; i < TWO_PI; i += PI / 5) { + * let outerRadius = 60; + * let innerRadius = 30; + * let xOuter = cos(i) * outerRadius; + * let yOuter = sin(i) * outerRadius; + * let zOuter = random(-20, 20); + * vertex(xOuter, yOuter, zOuter); + * + * let nextI = i + PI / 5 / 2; + * let xInner = cos(nextI) * innerRadius; + * let yInner = sin(nextI) * innerRadius; + * let zInner = random(-20, 20); + * vertex(xInner, yInner, zInner); + * } + * endShape(CLOSE); + * }); + * star.computeNormals(SMOOTH); + * } + * function draw() { + * background(255); + * stroke(0); + * fill(150, 200, 250); + * lights(); + * rotateX(PI*0.2); + * orbitControl(); + * model(star); + * } + * + *
                                  + * + * @alt + * A star-like geometry, here the computeNormals(SMOOTH) is applied for a smooth shading effect. + * This helps to avoid the faceted appearance that can occur with flat shading. + */ + + }, + { + key: 'computeNormals', + value: function computeNormals() { + var _this = this; + var shadingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : constants.FLAT; + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + }, + _ref$roundToPrecision = _ref.roundToPrecision, + roundToPrecision = _ref$roundToPrecision === void 0 ? 3 : _ref$roundToPrecision; + var vertexNormals = this.vertexNormals; + var vertices = this.vertices; + var faces = this.faces; + var iv; + if (shadingType === constants.SMOOTH) { + var vertexIndices = { + }; + var uniqueVertices = [ + ]; + var power = Math.pow(10, roundToPrecision); + var rounded = function rounded(val) { + return Math.round(val * power) / power; + }; + var getKey = function getKey(vert) { + return ''.concat(rounded(vert.x), ',').concat(rounded(vert.y), ',').concat(rounded(vert.z)); + }; + // loop through each vertex and add uniqueVertices + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + var key = getKey(vertex); + if (vertexIndices[key] === undefined) { + vertexIndices[key] = uniqueVertices.length; + uniqueVertices.push(vertex); + } + } // update face indices to use the deduplicated vertex indices + + faces.forEach(function (face) { + for (var fv = 0; fv < 3; ++fv) { + var originalVertexIndex = face[fv]; + var originalVertex = vertices[originalVertexIndex]; + var _key = getKey(originalVertex); + face[fv] = vertexIndices[_key]; + } + }); + // update edge indices to use the deduplicated vertex indices + this.edges.forEach(function (edge) { + for (var ev = 0; ev < 2; ++ev) { + var originalVertexIndex = edge[ev]; + var originalVertex = vertices[originalVertexIndex]; + var _key2 = getKey(originalVertex); + edge[ev] = vertexIndices[_key2]; + } + }); + // update the deduplicated vertices + this.vertices = vertices = uniqueVertices; + } // initialize the vertexNormals array with empty vectors + + vertexNormals.length = 0; + for (iv = 0; iv < vertices.length; ++iv) { + vertexNormals.push(new _main.default.Vector()); + } // loop through all the faces adding its normal to the normal + // of each of its vertices + + faces.forEach(function (face, f) { + var faceNormal = _this._getFaceNormal(f); + // all three vertices get the normal added + for (var fv = 0; fv < 3; ++fv) { + var vertexIndex = face[fv]; + vertexNormals[vertexIndex].add(faceNormal); + } + }); + // normalize the normals + for (iv = 0; iv < vertices.length; ++iv) { + vertexNormals[iv].normalize(); + } + return this; + } /** + * Averages the vertex normals. Used in curved + * surfaces + * @method averageNormals + * @chainable + */ + + }, + { + key: 'averageNormals', + value: function averageNormals() { + for (var i = 0; i <= this.detailY; i++) { + var offset = this.detailX + 1; + var temp = _main.default.Vector.add(this.vertexNormals[i * offset], this.vertexNormals[i * offset + this.detailX]); + temp = _main.default.Vector.div(temp, 2); + this.vertexNormals[i * offset] = temp; + this.vertexNormals[i * offset + this.detailX] = temp; + } + return this; + } /** + * Averages pole normals. Used in spherical primitives + * @method averagePoleNormals + * @chainable + */ + + }, + { + key: 'averagePoleNormals', + value: function averagePoleNormals() { + //average the north pole + var sum = new _main.default.Vector(0, 0, 0); + for (var i = 0; i < this.detailX; i++) { + sum.add(this.vertexNormals[i]); + } + sum = _main.default.Vector.div(sum, this.detailX); + for (var _i = 0; _i < this.detailX; _i++) { + this.vertexNormals[_i] = sum; + } //average the south pole + + sum = new _main.default.Vector(0, 0, 0); + for (var _i2 = this.vertices.length - 1; _i2 > this.vertices.length - 1 - this.detailX; _i2--) { + sum.add(this.vertexNormals[_i2]); + } + sum = _main.default.Vector.div(sum, this.detailX); + for (var _i3 = this.vertices.length - 1; _i3 > this.vertices.length - 1 - this.detailX; _i3--) { + this.vertexNormals[_i3] = sum; + } + return this; + } /** + * Create a 2D array for establishing stroke connections + * @private + * @chainable + */ + + }, + { + key: '_makeTriangleEdges', + value: function _makeTriangleEdges() { + this.edges.length = 0; + for (var j = 0; j < this.faces.length; j++) { + this.edges.push([this.faces[j][0], + this.faces[j][1]]); + this.edges.push([this.faces[j][1], + this.faces[j][2]]); + this.edges.push([this.faces[j][2], + this.faces[j][0]]); + } + return this; + } /** + * Converts each line segment into the vertices and vertex attributes needed + * to turn the line into a polygon on screen. This will include: + * - Two triangles line segment to create a rectangle + * - Two triangles per endpoint to create a stroke cap rectangle. A fragment + * shader is responsible for displaying the appropriate cap style within + * that rectangle. + * - Four triangles per join between adjacent line segments, creating a quad on + * either side of the join, perpendicular to the lines. A vertex shader will + * discard the quad in the "elbow" of the join, and a fragment shader will + * display the appropriate join style within the remaining quad. + * + * @private + * @chainable + */ + + }, + { + key: '_edgesToVertices', + value: function _edgesToVertices() { + this.lineVertices.clear(); + this.lineTangentsIn.clear(); + this.lineTangentsOut.clear(); + this.lineSides.clear(); + var potentialCaps = new Map(); + var connected = new Set(); + var lastValidDir; + for (var i = 0; i < this.edges.length; i++) { + var prevEdge = this.edges[i - 1]; + var currEdge = this.edges[i]; + var begin = this.vertices[currEdge[0]]; + var end = this.vertices[currEdge[1]]; + var fromColor = this.vertexStrokeColors.length > 0 ? this.vertexStrokeColors.slice(currEdge[0] * 4, (currEdge[0] + 1) * 4) : [ + 0, + 0, + 0, + 0 + ]; + var toColor = this.vertexStrokeColors.length > 0 ? this.vertexStrokeColors.slice(currEdge[1] * 4, (currEdge[1] + 1) * 4) : [ + 0, + 0, + 0, + 0 + ]; + var dir = end.copy().sub(begin).normalize(); + var dirOK = dir.magSq() > 0; + if (dirOK) { + this._addSegment(begin, end, fromColor, toColor, dir); + } + if (i > 0 && prevEdge[1] === currEdge[0]) { + if (!connected.has(currEdge[0])) { + connected.add(currEdge[0]); + potentialCaps.delete(currEdge[0]); + // Add a join if this segment shares a vertex with the previous. Skip + // actually adding join vertices if either the previous segment or this + // one has a length of 0. + // + // Don't add a join if the tangents point in the same direction, which + // would mean the edges line up exactly, and there is no need for a join. + if (lastValidDir && dirOK && dir.dot(lastValidDir) < 1 - 1e-8) { + this._addJoin(begin, lastValidDir, dir, fromColor); + } + } + } else { + // Start a new line + if (dirOK && !connected.has(currEdge[0])) { + var existingCap = potentialCaps.get(currEdge[0]); + if (existingCap) { + this._addJoin(begin, existingCap.dir, dir, fromColor); + potentialCaps.delete(currEdge[0]); + connected.add(currEdge[0]); + } else { + potentialCaps.set(currEdge[0], { + point: begin, + dir: dir.copy().mult( - 1), + color: fromColor + }); + } + } + if (lastValidDir && !connected.has(prevEdge[1])) { + var _existingCap = potentialCaps.get(prevEdge[1]); + if (_existingCap) { + this._addJoin(this.vertices[prevEdge[1]], lastValidDir, _existingCap.dir.copy().mult( - 1), fromColor); + potentialCaps.delete(prevEdge[1]); + connected.add(prevEdge[1]); + } else { + // Close off the last segment with a cap + potentialCaps.set(prevEdge[1], { + point: this.vertices[prevEdge[1]], + dir: lastValidDir, + color: fromColor + }); + } + lastValidDir = undefined; + } + } + if (i === this.edges.length - 1 && !connected.has(currEdge[1])) { + var _existingCap2 = potentialCaps.get(currEdge[1]); + if (_existingCap2) { + this._addJoin(end, dir, _existingCap2.dir.copy().mult( - 1), toColor); + potentialCaps.delete(currEdge[1]); + connected.add(currEdge[1]); + } else { + potentialCaps.set(currEdge[1], { + point: end, + dir: dir, + color: toColor + }); + } + } + if (dirOK) { + lastValidDir = dir; + } + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = potentialCaps.values() [Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _step$value = _step.value, + point = _step$value.point, + _dir = _step$value.dir, + color = _step$value.color; + this._addCap(point, _dir, color); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return this; + } /** + * Adds the vertices and vertex attributes for two triangles making a rectangle + * for a straight line segment. A vertex shader is responsible for picking + * proper coordinates on the screen given the centerline positions, the tangent, + * and the side of the centerline each vertex belongs to. Sides follow the + * following scheme: + * + * -1 -1 + * o-------------o + * | | + * o-------------o + * 1 1 + * + * @private + * @chainable + */ + + }, + { + key: '_addSegment', + value: function _addSegment(begin, end, fromColor, toColor, dir) { + var _this$lineVertices, + _this$lineVertexColor; + var a = begin.array(); + var b = end.array(); + var dirArr = dir.array(); + this.lineSides.push(1, 1, - 1, 1, - 1, - 1); + for (var _i4 = 0, _arr = [ + this.lineTangentsIn, + this.lineTangentsOut + ]; _i4 < _arr.length; _i4++) { + var tangents = _arr[_i4]; + for (var i = 0; i < 6; i++) { + tangents.push.apply(tangents, _toConsumableArray(dirArr)); + } + }(_this$lineVertices = this.lineVertices).push.apply(_this$lineVertices, _toConsumableArray(a).concat(_toConsumableArray(b), _toConsumableArray(a), _toConsumableArray(b), _toConsumableArray(b), _toConsumableArray(a))); + (_this$lineVertexColor = this.lineVertexColors).push.apply(_this$lineVertexColor, _toConsumableArray(fromColor).concat(_toConsumableArray(toColor), _toConsumableArray(fromColor), _toConsumableArray(toColor), _toConsumableArray(toColor), _toConsumableArray(fromColor))); + return this; + } /** + * Adds the vertices and vertex attributes for two triangles representing the + * stroke cap of a line. A fragment shader is responsible for displaying the + * appropriate cap style within the rectangle they make. + * + * The lineSides buffer will include the following values for the points on + * the cap rectangle: + * + * -1 -2 + * -----------o---o + * | | + * -----------o---o + * 1 2 + * @private + * @chainable + */ + + }, + { + key: '_addCap', + value: function _addCap(point, tangent, color) { + var ptArray = point.array(); + var tanInArray = tangent.array(); + var tanOutArray = [ + 0, + 0, + 0 + ]; + for (var i = 0; i < 6; i++) { + var _this$lineVertices2, + _this$lineTangentsIn, + _this$lineTangentsOut, + _this$lineVertexColor2; + (_this$lineVertices2 = this.lineVertices).push.apply(_this$lineVertices2, _toConsumableArray(ptArray)); + (_this$lineTangentsIn = this.lineTangentsIn).push.apply(_this$lineTangentsIn, _toConsumableArray(tanInArray)); + (_this$lineTangentsOut = this.lineTangentsOut).push.apply(_this$lineTangentsOut, tanOutArray); + (_this$lineVertexColor2 = this.lineVertexColors).push.apply(_this$lineVertexColor2, _toConsumableArray(color)); + } + this.lineSides.push( - 1, 2, - 2, 1, 2, - 1); + return this; + } /** + * Adds the vertices and vertex attributes for four triangles representing a + * join between two adjacent line segments. This creates a quad on either side + * of the shared vertex of the two line segments, with each quad perpendicular + * to the lines. A vertex shader will discard all but the quad in the "elbow" of + * the join, and a fragment shader will display the appropriate join style + * within the remaining quad. + * + * The lineSides buffer will include the following values for the points on + * the join rectangles: + * + * -1 -2 + * -------------o----o + * | | + * 1 o----o----o -3 + * | | 0 | + * --------o----o | + * 2| 3 | + * | | + * | | + * @private + * @chainable + */ + + }, + { + key: '_addJoin', + value: function _addJoin(point, fromTangent, toTangent, color) { + var ptArray = point.array(); + var tanInArray = fromTangent.array(); + var tanOutArray = toTangent.array(); + for (var i = 0; i < 12; i++) { + var _this$lineVertices3, + _this$lineTangentsIn2, + _this$lineTangentsOut2, + _this$lineVertexColor3; + (_this$lineVertices3 = this.lineVertices).push.apply(_this$lineVertices3, _toConsumableArray(ptArray)); + (_this$lineTangentsIn2 = this.lineTangentsIn).push.apply(_this$lineTangentsIn2, _toConsumableArray(tanInArray)); + (_this$lineTangentsOut2 = this.lineTangentsOut).push.apply(_this$lineTangentsOut2, _toConsumableArray(tanOutArray)); + (_this$lineVertexColor3 = this.lineVertexColors).push.apply(_this$lineVertexColor3, _toConsumableArray(color)); + } + this.lineSides.push( - 1, - 3, - 2, - 1, 0, - 3); + this.lineSides.push(3, 1, 2, 3, 0, 1); + return this; + } /** + * Modifies all vertices to be centered within the range -100 to 100. + * @method normalize + * @chainable + */ + + }, + { + key: 'normalize', + value: function normalize() { + if (this.vertices.length > 0) { + // Find the corners of our bounding box + var maxPosition = this.vertices[0].copy(); + var minPosition = this.vertices[0].copy(); + for (var i = 0; i < this.vertices.length; i++) { + maxPosition.x = Math.max(maxPosition.x, this.vertices[i].x); + minPosition.x = Math.min(minPosition.x, this.vertices[i].x); + maxPosition.y = Math.max(maxPosition.y, this.vertices[i].y); + minPosition.y = Math.min(minPosition.y, this.vertices[i].y); + maxPosition.z = Math.max(maxPosition.z, this.vertices[i].z); + minPosition.z = Math.min(minPosition.z, this.vertices[i].z); + } + var center = _main.default.Vector.lerp(maxPosition, minPosition, 0.5); + var dist = _main.default.Vector.sub(maxPosition, minPosition); + var longestDist = Math.max(Math.max(dist.x, dist.y), dist.z); + var scale = 200 / longestDist; + for (var _i5 = 0; _i5 < this.vertices.length; _i5++) { + this.vertices[_i5].sub(center); + this.vertices[_i5].mult(scale); + } + } + return this; + } + } + ]); + return Geometry; + }(); + var _default = _main.default.Geometry; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.for-each': 175, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.map': 187, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.set': 207, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.sub': 218, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.for-each': 255, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 351: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * @requires constants + * @todo see methods below needing further implementation. + * future consideration: implement SIMD optimizations + * when browser compatibility becomes available + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/ + * Reference/Global_Objects/SIMD + */ + + var GLMAT_ARRAY_TYPE = Array; + var isMatrixArray = function isMatrixArray(x) { + return Array.isArray(x); + }; + if (typeof Float32Array !== 'undefined') { + GLMAT_ARRAY_TYPE = Float32Array; + isMatrixArray = function isMatrixArray(x) { + return Array.isArray(x) || x instanceof Float32Array; + }; + } /** + * A class to describe a 4×4 matrix + * for model and view matrix manipulation in the p5js webgl renderer. + * @class p5.Matrix + * @private + * @constructor + * @param {Array} [mat4] column-major array literal of our 4×4 matrix + */ + + _main.default.Matrix = /*#__PURE__*/ function () { + function _class() { + var _ref; + _classCallCheck(this, _class); + // This is default behavior when object + // instantiated using createMatrix() + // @todo implement createMatrix() in core/math.js + if (arguments.length && (_ref = arguments.length - 1, _ref < 0 || arguments.length <= _ref ? undefined : arguments[_ref]) instanceof _main.default) { + var _ref2; + this.p5 = (_ref2 = arguments.length - 1, _ref2 < 0 || arguments.length <= _ref2 ? undefined : arguments[_ref2]); + } + if ((arguments.length <= 0 ? undefined : arguments[0]) === 'mat3') { + this.mat3 = Array.isArray(arguments.length <= 1 ? undefined : arguments[1]) ? arguments.length <= 1 ? undefined : arguments[1] : new GLMAT_ARRAY_TYPE([1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1]); + } else { + this.mat4 = Array.isArray(arguments.length <= 0 ? undefined : arguments[0]) ? arguments.length <= 0 ? undefined : arguments[0] : new GLMAT_ARRAY_TYPE([1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1]); + } + return this; + } /** + * Sets the x, y, and z component of the vector using two or three separate + * variables, the data from a p5.Matrix, or the values from a float array. + * + * @method set + * @param {p5.Matrix|Float32Array|Number[]} [inMatrix] the input p5.Matrix or + * an Array of length 16 + * @chainable + */ + /** + * @method set + * @param {Number[]} elements 16 numbers passed by value to avoid + * array copying. + * @chainable + */ + + _createClass(_class, [ + { + key: 'set', + value: function set(inMatrix) { + if (inMatrix instanceof _main.default.Matrix) { + this.mat4 = inMatrix.mat4; + return this; + } else if (isMatrixArray(inMatrix)) { + this.mat4 = inMatrix; + return this; + } else if (arguments.length === 16) { + this.mat4[0] = arguments[0]; + this.mat4[1] = arguments[1]; + this.mat4[2] = arguments[2]; + this.mat4[3] = arguments[3]; + this.mat4[4] = arguments[4]; + this.mat4[5] = arguments[5]; + this.mat4[6] = arguments[6]; + this.mat4[7] = arguments[7]; + this.mat4[8] = arguments[8]; + this.mat4[9] = arguments[9]; + this.mat4[10] = arguments[10]; + this.mat4[11] = arguments[11]; + this.mat4[12] = arguments[12]; + this.mat4[13] = arguments[13]; + this.mat4[14] = arguments[14]; + this.mat4[15] = arguments[15]; + } + return this; + } /** + * Gets a copy of the vector, returns a p5.Matrix object. + * + * @method get + * @return {p5.Matrix} the copy of the p5.Matrix object + */ + + }, + { + key: 'get', + value: function get() { + return new _main.default.Matrix(this.mat4, this.p5); + } /** + * return a copy of this matrix. + * If this matrix is 4x4, a 4x4 matrix with exactly the same entries will be + * generated. The same is true if this matrix is 3x3. + * + * @method copy + * @return {p5.Matrix} the result matrix + */ + + }, + { + key: 'copy', + value: function copy() { + if (this.mat3 !== undefined) { + var copied3x3 = new _main.default.Matrix('mat3', this.p5); + copied3x3.mat3[0] = this.mat3[0]; + copied3x3.mat3[1] = this.mat3[1]; + copied3x3.mat3[2] = this.mat3[2]; + copied3x3.mat3[3] = this.mat3[3]; + copied3x3.mat3[4] = this.mat3[4]; + copied3x3.mat3[5] = this.mat3[5]; + copied3x3.mat3[6] = this.mat3[6]; + copied3x3.mat3[7] = this.mat3[7]; + copied3x3.mat3[8] = this.mat3[8]; + return copied3x3; + } + var copied = new _main.default.Matrix(this.p5); + copied.mat4[0] = this.mat4[0]; + copied.mat4[1] = this.mat4[1]; + copied.mat4[2] = this.mat4[2]; + copied.mat4[3] = this.mat4[3]; + copied.mat4[4] = this.mat4[4]; + copied.mat4[5] = this.mat4[5]; + copied.mat4[6] = this.mat4[6]; + copied.mat4[7] = this.mat4[7]; + copied.mat4[8] = this.mat4[8]; + copied.mat4[9] = this.mat4[9]; + copied.mat4[10] = this.mat4[10]; + copied.mat4[11] = this.mat4[11]; + copied.mat4[12] = this.mat4[12]; + copied.mat4[13] = this.mat4[13]; + copied.mat4[14] = this.mat4[14]; + copied.mat4[15] = this.mat4[15]; + return copied; + } /** + * return an identity matrix + * @method identity + * @return {p5.Matrix} the result matrix + */ + + }, + { + key: 'transpose', + /** + * transpose according to a given matrix + * @method transpose + * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be + * based on to transpose + * @chainable + */ + value: function transpose(a) { + var a01, + a02, + a03, + a12, + a13, + a23; + if (a instanceof _main.default.Matrix) { + a01 = a.mat4[1]; + a02 = a.mat4[2]; + a03 = a.mat4[3]; + a12 = a.mat4[6]; + a13 = a.mat4[7]; + a23 = a.mat4[11]; + this.mat4[0] = a.mat4[0]; + this.mat4[1] = a.mat4[4]; + this.mat4[2] = a.mat4[8]; + this.mat4[3] = a.mat4[12]; + this.mat4[4] = a01; + this.mat4[5] = a.mat4[5]; + this.mat4[6] = a.mat4[9]; + this.mat4[7] = a.mat4[13]; + this.mat4[8] = a02; + this.mat4[9] = a12; + this.mat4[10] = a.mat4[10]; + this.mat4[11] = a.mat4[14]; + this.mat4[12] = a03; + this.mat4[13] = a13; + this.mat4[14] = a23; + this.mat4[15] = a.mat4[15]; + } else if (isMatrixArray(a)) { + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a12 = a[6]; + a13 = a[7]; + a23 = a[11]; + this.mat4[0] = a[0]; + this.mat4[1] = a[4]; + this.mat4[2] = a[8]; + this.mat4[3] = a[12]; + this.mat4[4] = a01; + this.mat4[5] = a[5]; + this.mat4[6] = a[9]; + this.mat4[7] = a[13]; + this.mat4[8] = a02; + this.mat4[9] = a12; + this.mat4[10] = a[10]; + this.mat4[11] = a[14]; + this.mat4[12] = a03; + this.mat4[13] = a13; + this.mat4[14] = a23; + this.mat4[15] = a[15]; + } + return this; + } /** + * invert matrix according to a give matrix + * @method invert + * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be + * based on to invert + * @chainable + */ + + }, + { + key: 'invert', + value: function invert(a) { + var a00, + a01, + a02, + a03, + a10, + a11, + a12, + a13; + var a20, + a21, + a22, + a23, + a30, + a31, + a32, + a33; + if (a instanceof _main.default.Matrix) { + a00 = a.mat4[0]; + a01 = a.mat4[1]; + a02 = a.mat4[2]; + a03 = a.mat4[3]; + a10 = a.mat4[4]; + a11 = a.mat4[5]; + a12 = a.mat4[6]; + a13 = a.mat4[7]; + a20 = a.mat4[8]; + a21 = a.mat4[9]; + a22 = a.mat4[10]; + a23 = a.mat4[11]; + a30 = a.mat4[12]; + a31 = a.mat4[13]; + a32 = a.mat4[14]; + a33 = a.mat4[15]; + } else if (isMatrixArray(a)) { + a00 = a[0]; + a01 = a[1]; + a02 = a[2]; + a03 = a[3]; + a10 = a[4]; + a11 = a[5]; + a12 = a[6]; + a13 = a[7]; + a20 = a[8]; + a21 = a[9]; + a22 = a[10]; + a23 = a[11]; + a30 = a[12]; + a31 = a[13]; + a32 = a[14]; + a33 = a[15]; + } + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + if (!det) { + return null; + } + det = 1 / det; + this.mat4[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + this.mat4[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + this.mat4[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + this.mat4[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + this.mat4[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + this.mat4[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + this.mat4[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + this.mat4[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + this.mat4[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + this.mat4[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + this.mat4[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + this.mat4[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + this.mat4[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + this.mat4[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + this.mat4[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + this.mat4[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + return this; + } /** + * Inverts a 3×3 matrix + * @method invert3x3 + * @chainable + */ + + }, + { + key: 'invert3x3', + value: function invert3x3() { + var a00 = this.mat3[0]; + var a01 = this.mat3[1]; + var a02 = this.mat3[2]; + var a10 = this.mat3[3]; + var a11 = this.mat3[4]; + var a12 = this.mat3[5]; + var a20 = this.mat3[6]; + var a21 = this.mat3[7]; + var a22 = this.mat3[8]; + var b01 = a22 * a11 - a12 * a21; + var b11 = - a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + if (!det) { + return null; + } + det = 1 / det; + this.mat3[0] = b01 * det; + this.mat3[1] = ( - a22 * a01 + a02 * a21) * det; + this.mat3[2] = (a12 * a01 - a02 * a11) * det; + this.mat3[3] = b11 * det; + this.mat3[4] = (a22 * a00 - a02 * a20) * det; + this.mat3[5] = ( - a12 * a00 + a02 * a10) * det; + this.mat3[6] = b21 * det; + this.mat3[7] = ( - a21 * a00 + a01 * a20) * det; + this.mat3[8] = (a11 * a00 - a01 * a10) * det; + return this; + } /** + * This function is only for 3x3 matrices. + * transposes a 3×3 p5.Matrix by a mat3 + * If there is an array of arguments, the matrix obtained by transposing + * the 3x3 matrix generated based on that array is set. + * If no arguments, it transposes itself and returns it. + * + * @method transpose3x3 + * @param {Number[]} mat3 1-dimensional array + * @chainable + */ + + }, + { + key: 'transpose3x3', + value: function transpose3x3(mat3) { + if (mat3 === undefined) { + mat3 = this.mat3; + } + var a01 = mat3[1]; + var a02 = mat3[2]; + var a12 = mat3[5]; + this.mat3[0] = mat3[0]; + this.mat3[1] = mat3[3]; + this.mat3[2] = mat3[6]; + this.mat3[3] = a01; + this.mat3[4] = mat3[4]; + this.mat3[5] = mat3[7]; + this.mat3[6] = a02; + this.mat3[7] = a12; + this.mat3[8] = mat3[8]; + return this; + } /** + * converts a 4×4 matrix to its 3×3 inverse transform + * commonly used in MVMatrix to NMatrix conversions. + * @method invertTranspose + * @param {p5.Matrix} mat4 the matrix to be based on to invert + * @chainable + * @todo finish implementation + */ + + }, + { + key: 'inverseTranspose', + value: function inverseTranspose(_ref3) { + var mat4 = _ref3.mat4; + if (this.mat3 === undefined) { + _main.default._friendlyError('sorry, this function only works with mat3'); + } else { + //convert mat4 -> mat3 + this.mat3[0] = mat4[0]; + this.mat3[1] = mat4[1]; + this.mat3[2] = mat4[2]; + this.mat3[3] = mat4[4]; + this.mat3[4] = mat4[5]; + this.mat3[5] = mat4[6]; + this.mat3[6] = mat4[8]; + this.mat3[7] = mat4[9]; + this.mat3[8] = mat4[10]; + } + var inverse = this.invert3x3(); + // check inverse succeeded + if (inverse) { + inverse.transpose3x3(this.mat3); + } else { + // in case of singularity, just zero the matrix + for (var i = 0; i < 9; i++) { + this.mat3[i] = 0; + } + } + return this; + } /** + * inspired by Toji's mat4 determinant + * @method determinant + * @return {Number} Determinant of our 4×4 matrix + */ + + }, + { + key: 'determinant', + value: function determinant() { + var d00 = this.mat4[0] * this.mat4[5] - this.mat4[1] * this.mat4[4], + d01 = this.mat4[0] * this.mat4[6] - this.mat4[2] * this.mat4[4], + d02 = this.mat4[0] * this.mat4[7] - this.mat4[3] * this.mat4[4], + d03 = this.mat4[1] * this.mat4[6] - this.mat4[2] * this.mat4[5], + d04 = this.mat4[1] * this.mat4[7] - this.mat4[3] * this.mat4[5], + d05 = this.mat4[2] * this.mat4[7] - this.mat4[3] * this.mat4[6], + d06 = this.mat4[8] * this.mat4[13] - this.mat4[9] * this.mat4[12], + d07 = this.mat4[8] * this.mat4[14] - this.mat4[10] * this.mat4[12], + d08 = this.mat4[8] * this.mat4[15] - this.mat4[11] * this.mat4[12], + d09 = this.mat4[9] * this.mat4[14] - this.mat4[10] * this.mat4[13], + d10 = this.mat4[9] * this.mat4[15] - this.mat4[11] * this.mat4[13], + d11 = this.mat4[10] * this.mat4[15] - this.mat4[11] * this.mat4[14]; + // Calculate the determinant + return d00 * d11 - d01 * d10 + d02 * d09 + d03 * d08 - d04 * d07 + d05 * d06; + } /** + * multiply two mat4s + * @method mult + * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix + * we want to multiply by + * @chainable + */ + + }, + { + key: 'mult', + value: function mult(multMatrix) { + var _src; + if (multMatrix === this || multMatrix === this.mat4) { + _src = this.copy().mat4; // only need to allocate in this rare case + } else if (multMatrix instanceof _main.default.Matrix) { + _src = multMatrix.mat4; + } else if (isMatrixArray(multMatrix)) { + _src = multMatrix; + } else if (arguments.length === 16) { + _src = arguments; + } else { + return; // nothing to do. + } // each row is used for the multiplier + + var b0 = this.mat4[0], + b1 = this.mat4[1], + b2 = this.mat4[2], + b3 = this.mat4[3]; + this.mat4[0] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; + this.mat4[1] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; + this.mat4[2] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; + this.mat4[3] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; + b0 = this.mat4[4]; + b1 = this.mat4[5]; + b2 = this.mat4[6]; + b3 = this.mat4[7]; + this.mat4[4] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; + this.mat4[5] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; + this.mat4[6] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; + this.mat4[7] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; + b0 = this.mat4[8]; + b1 = this.mat4[9]; + b2 = this.mat4[10]; + b3 = this.mat4[11]; + this.mat4[8] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; + this.mat4[9] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; + this.mat4[10] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; + this.mat4[11] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; + b0 = this.mat4[12]; + b1 = this.mat4[13]; + b2 = this.mat4[14]; + b3 = this.mat4[15]; + this.mat4[12] = b0 * _src[0] + b1 * _src[4] + b2 * _src[8] + b3 * _src[12]; + this.mat4[13] = b0 * _src[1] + b1 * _src[5] + b2 * _src[9] + b3 * _src[13]; + this.mat4[14] = b0 * _src[2] + b1 * _src[6] + b2 * _src[10] + b3 * _src[14]; + this.mat4[15] = b0 * _src[3] + b1 * _src[7] + b2 * _src[11] + b3 * _src[15]; + return this; + } + }, + { + key: 'apply', + value: function apply(multMatrix) { + var _src; + if (multMatrix === this || multMatrix === this.mat4) { + _src = this.copy().mat4; // only need to allocate in this rare case + } else if (multMatrix instanceof _main.default.Matrix) { + _src = multMatrix.mat4; + } else if (isMatrixArray(multMatrix)) { + _src = multMatrix; + } else if (arguments.length === 16) { + _src = arguments; + } else { + return; // nothing to do. + } + var mat4 = this.mat4; + // each row is used for the multiplier + var m0 = mat4[0]; + var m4 = mat4[4]; + var m8 = mat4[8]; + var m12 = mat4[12]; + mat4[0] = _src[0] * m0 + _src[1] * m4 + _src[2] * m8 + _src[3] * m12; + mat4[4] = _src[4] * m0 + _src[5] * m4 + _src[6] * m8 + _src[7] * m12; + mat4[8] = _src[8] * m0 + _src[9] * m4 + _src[10] * m8 + _src[11] * m12; + mat4[12] = _src[12] * m0 + _src[13] * m4 + _src[14] * m8 + _src[15] * m12; + var m1 = mat4[1]; + var m5 = mat4[5]; + var m9 = mat4[9]; + var m13 = mat4[13]; + mat4[1] = _src[0] * m1 + _src[1] * m5 + _src[2] * m9 + _src[3] * m13; + mat4[5] = _src[4] * m1 + _src[5] * m5 + _src[6] * m9 + _src[7] * m13; + mat4[9] = _src[8] * m1 + _src[9] * m5 + _src[10] * m9 + _src[11] * m13; + mat4[13] = _src[12] * m1 + _src[13] * m5 + _src[14] * m9 + _src[15] * m13; + var m2 = mat4[2]; + var m6 = mat4[6]; + var m10 = mat4[10]; + var m14 = mat4[14]; + mat4[2] = _src[0] * m2 + _src[1] * m6 + _src[2] * m10 + _src[3] * m14; + mat4[6] = _src[4] * m2 + _src[5] * m6 + _src[6] * m10 + _src[7] * m14; + mat4[10] = _src[8] * m2 + _src[9] * m6 + _src[10] * m10 + _src[11] * m14; + mat4[14] = _src[12] * m2 + _src[13] * m6 + _src[14] * m10 + _src[15] * m14; + var m3 = mat4[3]; + var m7 = mat4[7]; + var m11 = mat4[11]; + var m15 = mat4[15]; + mat4[3] = _src[0] * m3 + _src[1] * m7 + _src[2] * m11 + _src[3] * m15; + mat4[7] = _src[4] * m3 + _src[5] * m7 + _src[6] * m11 + _src[7] * m15; + mat4[11] = _src[8] * m3 + _src[9] * m7 + _src[10] * m11 + _src[11] * m15; + mat4[15] = _src[12] * m3 + _src[13] * m7 + _src[14] * m11 + _src[15] * m15; + return this; + } /** + * scales a p5.Matrix by scalars or a vector + * @method scale + * @param {p5.Vector|Float32Array|Number[]} s vector to scale by + * @chainable + */ + + }, + { + key: 'scale', + value: function scale(x, y, z) { + if (x instanceof _main.default.Vector) { + // x is a vector, extract the components from it. + y = x.y; + z = x.z; + x = x.x; // must be last + } else if (x instanceof Array) { + // x is an array, extract the components from it. + y = x[1]; + z = x[2]; + x = x[0]; // must be last + } + this.mat4[0] *= x; + this.mat4[1] *= x; + this.mat4[2] *= x; + this.mat4[3] *= x; + this.mat4[4] *= y; + this.mat4[5] *= y; + this.mat4[6] *= y; + this.mat4[7] *= y; + this.mat4[8] *= z; + this.mat4[9] *= z; + this.mat4[10] *= z; + this.mat4[11] *= z; + return this; + } /** + * rotate our Matrix around an axis by the given angle. + * @method rotate + * @param {Number} a The angle of rotation in radians + * @param {p5.Vector|Number[]} axis the axis(es) to rotate around + * @chainable + * inspired by Toji's gl-matrix lib, mat4 rotation + */ + + }, + { + key: 'rotate', + value: function rotate(a, x, y, z) { + if (x instanceof _main.default.Vector) { + // x is a vector, extract the components from it. + y = x.y; + z = x.z; + x = x.x; //must be last + } else if (x instanceof Array) { + // x is an array, extract the components from it. + y = x[1]; + z = x[2]; + x = x[0]; //must be last + } + var len = Math.sqrt(x * x + y * y + z * z); + x *= 1 / len; + y *= 1 / len; + z *= 1 / len; + var a00 = this.mat4[0]; + var a01 = this.mat4[1]; + var a02 = this.mat4[2]; + var a03 = this.mat4[3]; + var a10 = this.mat4[4]; + var a11 = this.mat4[5]; + var a12 = this.mat4[6]; + var a13 = this.mat4[7]; + var a20 = this.mat4[8]; + var a21 = this.mat4[9]; + var a22 = this.mat4[10]; + var a23 = this.mat4[11]; + //sin,cos, and tan of respective angle + var sA = Math.sin(a); + var cA = Math.cos(a); + var tA = 1 - cA; + // Construct the elements of the rotation matrix + var b00 = x * x * tA + cA; + var b01 = y * x * tA + z * sA; + var b02 = z * x * tA - y * sA; + var b10 = x * y * tA - z * sA; + var b11 = y * y * tA + cA; + var b12 = z * y * tA + x * sA; + var b20 = x * z * tA + y * sA; + var b21 = y * z * tA - x * sA; + var b22 = z * z * tA + cA; + // rotation-specific matrix multiplication + this.mat4[0] = a00 * b00 + a10 * b01 + a20 * b02; + this.mat4[1] = a01 * b00 + a11 * b01 + a21 * b02; + this.mat4[2] = a02 * b00 + a12 * b01 + a22 * b02; + this.mat4[3] = a03 * b00 + a13 * b01 + a23 * b02; + this.mat4[4] = a00 * b10 + a10 * b11 + a20 * b12; + this.mat4[5] = a01 * b10 + a11 * b11 + a21 * b12; + this.mat4[6] = a02 * b10 + a12 * b11 + a22 * b12; + this.mat4[7] = a03 * b10 + a13 * b11 + a23 * b12; + this.mat4[8] = a00 * b20 + a10 * b21 + a20 * b22; + this.mat4[9] = a01 * b20 + a11 * b21 + a21 * b22; + this.mat4[10] = a02 * b20 + a12 * b21 + a22 * b22; + this.mat4[11] = a03 * b20 + a13 * b21 + a23 * b22; + return this; + } /** + * @todo finish implementing this method! + * translates + * @method translate + * @param {Number[]} v vector to translate by + * @chainable + */ + + }, + { + key: 'translate', + value: function translate(v) { + var x = v[0], + y = v[1], + z = v[2] || 0; + this.mat4[12] += this.mat4[0] * x + this.mat4[4] * y + this.mat4[8] * z; + this.mat4[13] += this.mat4[1] * x + this.mat4[5] * y + this.mat4[9] * z; + this.mat4[14] += this.mat4[2] * x + this.mat4[6] * y + this.mat4[10] * z; + this.mat4[15] += this.mat4[3] * x + this.mat4[7] * y + this.mat4[11] * z; + } + }, + { + key: 'rotateX', + value: function rotateX(a) { + this.rotate(a, 1, 0, 0); + } + }, + { + key: 'rotateY', + value: function rotateY(a) { + this.rotate(a, 0, 1, 0); + } + }, + { + key: 'rotateZ', + value: function rotateZ(a) { + this.rotate(a, 0, 0, 1); + } /** + * sets the perspective matrix + * @method perspective + * @param {Number} fovy [description] + * @param {Number} aspect [description] + * @param {Number} near near clipping plane + * @param {Number} far far clipping plane + * @chainable + */ + + }, + { + key: 'perspective', + value: function perspective(fovy, aspect, near, far) { + var f = 1 / Math.tan(fovy / 2), + nf = 1 / (near - far); + this.mat4[0] = f / aspect; + this.mat4[1] = 0; + this.mat4[2] = 0; + this.mat4[3] = 0; + this.mat4[4] = 0; + this.mat4[5] = f; + this.mat4[6] = 0; + this.mat4[7] = 0; + this.mat4[8] = 0; + this.mat4[9] = 0; + this.mat4[10] = (far + near) * nf; + this.mat4[11] = - 1; + this.mat4[12] = 0; + this.mat4[13] = 0; + this.mat4[14] = 2 * far * near * nf; + this.mat4[15] = 0; + return this; + } /** + * sets the ortho matrix + * @method ortho + * @param {Number} left [description] + * @param {Number} right [description] + * @param {Number} bottom [description] + * @param {Number} top [description] + * @param {Number} near near clipping plane + * @param {Number} far far clipping plane + * @chainable + */ + + }, + { + key: 'ortho', + value: function ortho(left, right, bottom, top, near, far) { + var lr = 1 / (left - right), + bt = 1 / (bottom - top), + nf = 1 / (near - far); + this.mat4[0] = - 2 * lr; + this.mat4[1] = 0; + this.mat4[2] = 0; + this.mat4[3] = 0; + this.mat4[4] = 0; + this.mat4[5] = - 2 * bt; + this.mat4[6] = 0; + this.mat4[7] = 0; + this.mat4[8] = 0; + this.mat4[9] = 0; + this.mat4[10] = 2 * nf; + this.mat4[11] = 0; + this.mat4[12] = (left + right) * lr; + this.mat4[13] = (top + bottom) * bt; + this.mat4[14] = (far + near) * nf; + this.mat4[15] = 1; + return this; + } /** + * apply a matrix to a vector with x,y,z,w components + * get the results in the form of an array + * @method multiplyVec4 + * @param {Number} + * @return {Number[]} + */ + + }, + { + key: 'multiplyVec4', + value: function multiplyVec4(x, y, z, w) { + var result = new Array(4); + var m = this.mat4; + result[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + result[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + result[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + result[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return result; + } /** + * Applies a matrix to a vector. + * The fourth component is set to 1. + * Returns a vector consisting of the first + * through third components of the result. + * + * @method multiplyPoint + * @param {p5.Vector} + * @return {p5.Vector} + */ + + }, + { + key: 'multiplyPoint', + value: function multiplyPoint(_ref4) { + var x = _ref4.x, + y = _ref4.y, + z = _ref4.z; + var array = this.multiplyVec4(x, y, z, 1); + return new _main.default.Vector(array[0], array[1], array[2]); + } /** + * Applies a matrix to a vector. + * The fourth component is set to 1. + * Returns the result of dividing the 1st to 3rd components + * of the result by the 4th component as a vector. + * + * @method multiplyAndNormalizePoint + * @param {p5.Vector} + * @return {p5.Vector} + */ + + }, + { + key: 'multiplyAndNormalizePoint', + value: function multiplyAndNormalizePoint(_ref5) { + var x = _ref5.x, + y = _ref5.y, + z = _ref5.z; + var array = this.multiplyVec4(x, y, z, 1); + array[0] /= array[3]; + array[1] /= array[3]; + array[2] /= array[3]; + return new _main.default.Vector(array[0], array[1], array[2]); + } /** + * Applies a matrix to a vector. + * The fourth component is set to 0. + * Returns a vector consisting of the first + * through third components of the result. + * + * @method multiplyDirection + * @param {p5.Vector} + * @return {p5.Vector} + */ + + }, + { + key: 'multiplyDirection', + value: function multiplyDirection(_ref6) { + var x = _ref6.x, + y = _ref6.y, + z = _ref6.z; + var array = this.multiplyVec4(x, y, z, 0); + return new _main.default.Vector(array[0], array[1], array[2]); + } /** + * This function is only for 3x3 matrices. + * multiply two mat3s. It is an operation to multiply the 3x3 matrix of + * the argument from the right. Arguments can be a 3x3 p5.Matrix, + * a Float32Array of length 9, or a javascript array of length 9. + * In addition, it can also be done by enumerating 9 numbers. + * + * @method mult3x3 + * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix + * we want to multiply by + * @chainable + */ + + }, + { + key: 'mult3x3', + value: function mult3x3(multMatrix) { + var _src; + if (multMatrix === this || multMatrix === this.mat3) { + _src = this.copy().mat3; // only need to allocate in this rare case + } else if (multMatrix instanceof _main.default.Matrix) { + _src = multMatrix.mat3; + } else if (isMatrixArray(multMatrix)) { + _src = multMatrix; + } else if (arguments.length === 9) { + _src = arguments; + } else { + return; // nothing to do. + } // each row is used for the multiplier + + var b0 = this.mat3[0]; + var b1 = this.mat3[1]; + var b2 = this.mat3[2]; + this.mat3[0] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; + this.mat3[1] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; + this.mat3[2] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; + b0 = this.mat3[3]; + b1 = this.mat3[4]; + b2 = this.mat3[5]; + this.mat3[3] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; + this.mat3[4] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; + this.mat3[5] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; + b0 = this.mat3[6]; + b1 = this.mat3[7]; + b2 = this.mat3[8]; + this.mat3[6] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; + this.mat3[7] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; + this.mat3[8] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; + return this; + } /** + * This function is only for 3x3 matrices. + * A function that returns a column vector of a 3x3 matrix. + * + * @method column + * @param {Number} columnIndex matrix column number + * @return {p5.Vector} + */ + + }, + { + key: 'column', + value: function column(columnIndex) { + return new _main.default.Vector(this.mat3[3 * columnIndex], this.mat3[3 * columnIndex + 1], this.mat3[3 * columnIndex + 2]); + } /** + * This function is only for 3x3 matrices. + * A function that returns a row vector of a 3x3 matrix. + * + * @method row + * @param {Number} rowIndex matrix row number + * @return {p5.Vector} + */ + + }, + { + key: 'row', + value: function row(rowIndex) { + return new _main.default.Vector(this.mat3[rowIndex], this.mat3[rowIndex + 3], this.mat3[rowIndex + 6]); + } /** + * Returns the diagonal elements of the matrix in the form of an array. + * A 3x3 matrix will return an array of length 3. + * A 4x4 matrix will return an array of length 4. + * + * @method diagonal + * @return {Number[]} An array obtained by arranging the diagonal elements + * of the matrix in ascending order of index + */ + + }, + { + key: 'diagonal', + value: function diagonal() { + if (this.mat3 !== undefined) { + return [this.mat3[0], + this.mat3[4], + this.mat3[8]]; + } + return [this.mat4[0], + this.mat4[5], + this.mat4[10], + this.mat4[15]]; + } /** + * This function is only for 3x3 matrices. + * Takes a vector and returns the vector resulting from multiplying to + * that vector by this matrix from left. + * + * @method multiplyVec3 + * @param {p5.Vector} multVector the vector to which this matrix applies + * @param {p5.Vector} [target] The vector to receive the result + * @return {p5.Vector} + */ + + }, + { + key: 'multiplyVec3', + value: function multiplyVec3(multVector, target) { + if (target === undefined) { + target = multVector.copy(); + } + target.x = this.row(0).dot(multVector); + target.y = this.row(1).dot(multVector); + target.z = this.row(2).dot(multVector); + return target; + } /** + * This function is only for 4x4 matrices. + * Creates a 3x3 matrix whose entries are the top left 3x3 part and returns it. + * + * @method createSubMatrix3x3 + * @return {p5.Matrix} + */ + + }, + { + key: 'createSubMatrix3x3', + value: function createSubMatrix3x3() { + var result = new _main.default.Matrix('mat3'); + result.mat3[0] = this.mat4[0]; + result.mat3[1] = this.mat4[1]; + result.mat3[2] = this.mat4[2]; + result.mat3[3] = this.mat4[4]; + result.mat3[4] = this.mat4[5]; + result.mat3[5] = this.mat4[6]; + result.mat3[6] = this.mat4[8]; + result.mat3[7] = this.mat4[9]; + result.mat3[8] = this.mat4[10]; + return result; + } /** + * PRIVATE + */ + // matrix methods adapted from: + // https://developer.mozilla.org/en-US/docs/Web/WebGL/ + // gluPerspective + // + // function _makePerspective(fovy, aspect, znear, zfar){ + // const ymax = znear * Math.tan(fovy * Math.PI / 360.0); + // const ymin = -ymax; + // const xmin = ymin * aspect; + // const xmax = ymax * aspect; + // return _makeFrustum(xmin, xmax, ymin, ymax, znear, zfar); + // } + //// + //// glFrustum + //// + //function _makeFrustum(left, right, bottom, top, znear, zfar){ + // const X = 2*znear/(right-left); + // const Y = 2*znear/(top-bottom); + // const A = (right+left)/(right-left); + // const B = (top+bottom)/(top-bottom); + // const C = -(zfar+znear)/(zfar-znear); + // const D = -2*zfar*znear/(zfar-znear); + // const frustrumMatrix =[ + // X, 0, A, 0, + // 0, Y, B, 0, + // 0, 0, C, D, + // 0, 0, -1, 0 + //]; + //return frustrumMatrix; + // } + // function _setMVPMatrices(){ + ////an identity matrix + ////@TODO use the p5.Matrix class to abstract away our MV matrices and + ///other math + //const _mvMatrix = + //[ + // 1.0,0.0,0.0,0.0, + // 0.0,1.0,0.0,0.0, + // 0.0,0.0,1.0,0.0, + // 0.0,0.0,0.0,1.0 + //]; + + } + ], [ + { + key: 'identity', + value: function identity(pInst) { + return new _main.default.Matrix(pInst); + } + } + ]); + return _class; + }(); + var _default = _main.default.Matrix; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.float32-array': 229, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249 + } + ], + 352: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.map'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + _main.default.RenderBuffer = /*#__PURE__*/ function () { + function _class(size, src, dst, attr, renderer, map) { + _classCallCheck(this, _class); + this.size = size; // the number of FLOATs in each vertex + this.src = src; // the name of the model's source array + this.dst = dst; // the name of the geometry's buffer + this.attr = attr; // the name of the vertex attribute + this._renderer = renderer; + this.map = map; // optional, a transformation function to apply to src + } /** + * Enables and binds the buffers used by shader when the appropriate data exists in geometry. + * Must always be done prior to drawing geometry in WebGL. + * @param {p5.Geometry} geometry Geometry that is going to be drawn + * @param {p5.Shader} shader Active shader + * @private + */ + + _createClass(_class, [ + { + key: '_prepareBuffer', + value: function _prepareBuffer(geometry, shader) { + var attributes = shader.attributes; + var gl = this._renderer.GL; + var model; + if (geometry.model) { + model = geometry.model; + } else { + model = geometry; + } // loop through each of the buffer definitions + + var attr = attributes[this.attr]; + if (!attr) { + return; + } // check if the model has the appropriate source array + + var buffer = geometry[this.dst]; + var src = model[this.src]; + if (src.length > 0) { + // check if we need to create the GL buffer + var createBuffer = !buffer; + if (createBuffer) { + // create and remember the buffer + geometry[this.dst] = buffer = gl.createBuffer(); + } // bind the buffer + + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + // check if we need to fill the buffer with data + if (createBuffer || model.dirtyFlags[this.src] !== false) { + var map = this.map; + // get the values from the model, possibly transformed + var values = map ? map(src) : src; + // fill the buffer with the values + this._renderer._bindBuffer(buffer, gl.ARRAY_BUFFER, values); + // mark the model's source array as clean + model.dirtyFlags[this.src] = false; + } // enable the attribute + + shader.enableAttrib(attr, this.size); + } else { + var loc = attr.location; + if (loc === - 1 || !this._renderer.registerEnabled.has(loc)) { + return; + } // Disable register corresponding to unused attribute + + gl.disableVertexAttribArray(loc); + // Record register availability + this._renderer.registerEnabled.delete(loc); + } + } + } + ]); + return _class; + }(); + var _default = _main.default.RenderBuffer; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.map': 182 + } + ], + 353: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.find-index'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.find-index'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.map'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + _dereq_('./p5.RenderBuffer'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } /** + * Welcome to RendererGL Immediate Mode. + * Immediate mode is used for drawing custom shapes + * from a set of vertices. Immediate Mode is activated + * when you call beginShape() & de-activated when you call endShape(). + * Immediate mode is a style of programming borrowed + * from OpenGL's (now-deprecated) immediate mode. + * It differs from p5.js' default, Retained Mode, which caches + * geometries and buffers on the CPU to reduce the number of webgl + * draw calls. Retained mode is more efficient & performative, + * however, Immediate Mode is useful for sketching quick + * geometric ideas. + */ + /** + * Begin shape drawing. This is a helpful way of generating + * custom shapes quickly. However in WEBGL mode, application + * performance will likely drop as a result of too many calls to + * beginShape() / endShape(). As a high performance alternative, + * please use p5.js geometry primitives. + * @private + * @method beginShape + * @param {Number} mode webgl primitives mode. beginShape supports the + * following modes: + * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, + * TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP, + * and TESS(WEBGL only) + * @chainable + */ + + _main.default.RendererGL.prototype.beginShape = function (mode) { + this.immediateMode.shapeMode = mode !== undefined ? mode : constants.TESS; + this.immediateMode.geometry.reset(); + this.immediateMode.contourIndices = [ + ]; + return this; + }; + var immediateBufferStrides = { + vertices: 1, + vertexNormals: 1, + vertexColors: 4, + vertexStrokeColors: 4, + uvs: 2 + }; + _main.default.RendererGL.prototype.beginContour = function () { + if (this.immediateMode.shapeMode !== constants.TESS) { + throw new Error('WebGL mode can only use contours with beginShape(TESS).'); + } + this.immediateMode.contourIndices.push(this.immediateMode.geometry.vertices.length); + }; + /** + * adds a vertex to be drawn in a custom Shape. + * @private + * @method vertex + * @param {Number} x x-coordinate of vertex + * @param {Number} y y-coordinate of vertex + * @param {Number} z z-coordinate of vertex + * @chainable + * @TODO implement handling of p5.Vector args + */ + _main.default.RendererGL.prototype.vertex = function (x, y) { + // WebGL 1 doesn't support QUADS or QUAD_STRIP, so we duplicate data to turn + // QUADS into TRIANGLES and QUAD_STRIP into TRIANGLE_STRIP. (There is no extra + // work to convert QUAD_STRIP here, since the only difference is in how edges + // are rendered.) + if (this.immediateMode.shapeMode === constants.QUADS) { + // A finished quad turned into triangles should leave 6 vertices in the + // buffer: + // 0--3 0 3--5 + // | | --> | \ \ | + // 1--2 1--2 4 + // When vertex index 3 is being added, add the necessary duplicates. + if (this.immediateMode.geometry.vertices.length % 6 === 3) { + for (var key in immediateBufferStrides) { + var stride = immediateBufferStrides[key]; + var buffer = this.immediateMode.geometry[key]; + buffer.push.apply(buffer, _toConsumableArray(buffer.slice(buffer.length - 3 * stride, buffer.length - 2 * stride)).concat(_toConsumableArray(buffer.slice(buffer.length - stride, buffer.length)))); + } + } + } + var z, + u, + v; + // default to (x, y) mode: all other arguments assumed to be 0. + z = u = v = 0; + if (arguments.length === 3) { + // (x, y, z) mode: (u, v) assumed to be 0. + z = arguments[2]; + } else if (arguments.length === 4) { + // (x, y, u, v) mode: z assumed to be 0. + u = arguments[2]; + v = arguments[3]; + } else if (arguments.length === 5) { + // (x, y, z, u, v) mode + z = arguments[2]; + u = arguments[3]; + v = arguments[4]; + } + var vert = new _main.default.Vector(x, y, z); + this.immediateMode.geometry.vertices.push(vert); + this.immediateMode.geometry.vertexNormals.push(this._currentNormal); + var vertexColor = this.curFillColor || [ + 0.5, + 0.5, + 0.5, + 1 + ]; + this.immediateMode.geometry.vertexColors.push(vertexColor[0], vertexColor[1], vertexColor[2], vertexColor[3]); + var lineVertexColor = this.curStrokeColor || [ + 0.5, + 0.5, + 0.5, + 1 + ]; + this.immediateMode.geometry.vertexStrokeColors.push(lineVertexColor[0], lineVertexColor[1], lineVertexColor[2], lineVertexColor[3]); + if (this.textureMode === constants.IMAGE && !this.isProcessingVertices) { + if (this._tex !== null) { + if (this._tex.width > 0 && this._tex.height > 0) { + u /= this._tex.width; + v /= this._tex.height; + } + } else if (this.userFillShader !== undefined || this.userStrokeShader !== undefined || this.userPointShader !== undefined) { + // Do nothing if user-defined shaders are present + } else if (this._tex === null && arguments.length >= 4) { + // Only throw this warning if custom uv's have been provided + console.warn('You must first call texture() before using' + ' vertex() with image based u and v coordinates'); + } + } + this.immediateMode.geometry.uvs.push(u, v); + this.immediateMode._bezierVertex[0] = x; + this.immediateMode._bezierVertex[1] = y; + this.immediateMode._bezierVertex[2] = z; + this.immediateMode._quadraticVertex[0] = x; + this.immediateMode._quadraticVertex[1] = y; + this.immediateMode._quadraticVertex[2] = z; + return this; + }; + /** + * Sets the normal to use for subsequent vertices. + * @method vertexNormal + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @chainable * - * @method noLoop - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * noLoop(); - * } + * @method vertexNormal + * @param {Vector} v + * @chainable + */ + _main.default.RendererGL.prototype.normal = function (xorv, y, z) { + if (xorv instanceof _main.default.Vector) { + this._currentNormal = xorv; + } else { + this._currentNormal = new _main.default.Vector(xorv, y, z); + } + return this; + }; + /** + * End shape drawing and render vertices to screen. + * @chainable + */ + _main.default.RendererGL.prototype.endShape = function (mode, isCurve, isBezier, isQuadratic, isContour, shapeKind) { + var count = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1; + if (this.immediateMode.shapeMode === constants.POINTS) { + this._drawPoints(this.immediateMode.geometry.vertices, this.immediateMode.buffers.point); + return this; + } // When we are drawing a shape then the shape mode is TESS, + // but in case of triangle we can skip the breaking into small triangle + // this can optimize performance by skipping the step of breaking it into triangles + + if (this.immediateMode.geometry.vertices.length === 3 && this.immediateMode.shapeMode === constants.TESS) { + this.immediateMode.shapeMode === constants.TRIANGLES; + } + this.isProcessingVertices = true; + this._processVertices.apply(this, arguments); + this.isProcessingVertices = false; + // LINE_STRIP and LINES are not used for rendering, instead + // they only indicate a way to modify vertices during the _processVertices() step + if (this.immediateMode.shapeMode === constants.LINE_STRIP || this.immediateMode.shapeMode === constants.LINES) { + this.immediateMode.shapeMode = constants.TRIANGLE_FAN; + } // WebGL doesn't support the QUADS and QUAD_STRIP modes, so we + // need to convert them to a supported format. In `vertex()`, we reformat + // the input data into the formats specified below. + + if (this.immediateMode.shapeMode === constants.QUADS) { + this.immediateMode.shapeMode = constants.TRIANGLES; + } else if (this.immediateMode.shapeMode === constants.QUAD_STRIP) { + this.immediateMode.shapeMode = constants.TRIANGLE_STRIP; + } + if (this._doFill) { + if (!this.geometryBuilder && this.immediateMode.geometry.vertices.length >= 3) { + this._drawImmediateFill(count); + } + } + if (this._doStroke) { + if (!this.geometryBuilder && this.immediateMode.geometry.lineVertices.length >= 1) { + this._drawImmediateStroke(); + } + } + if (this.geometryBuilder) { + this.geometryBuilder.addImmediate(); + } + this.isBezier = false; + this.isQuadratic = false; + this.isCurve = false; + this.immediateMode._bezierVertex.length = 0; + this.immediateMode._quadraticVertex.length = 0; + this.immediateMode._curveVertex.length = 0; + return this; + }; + /** + * Called from endShape(). This function calculates the stroke vertices for custom shapes and + * tesselates shapes when applicable. + * @private + * @param {Number} mode webgl primitives mode. beginShape supports the + * following modes: + * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, + * TRIANGLE_STRIP, TRIANGLE_FAN and TESS(WEBGL only) + */ + _main.default.RendererGL.prototype._processVertices = function (mode) { + if (this.immediateMode.geometry.vertices.length === 0) return; + var calculateStroke = this._doStroke; + var shouldClose = mode === constants.CLOSE; + if (calculateStroke) { + this.immediateMode.geometry.edges = this._calculateEdges(this.immediateMode.shapeMode, this.immediateMode.geometry.vertices, shouldClose); + if (!this.geometryBuilder) { + this.immediateMode.geometry._edgesToVertices(); + } + } // For hollow shapes, user must set mode to TESS + + var convexShape = this.immediateMode.shapeMode === constants.TESS; + // If the shape has a contour, we have to re-triangulate to cut out the + // contour region + var hasContour = this.immediateMode.contourIndices.length > 0; + // We tesselate when drawing curves or convex shapes + var shouldTess = this._doFill && (this.isBezier || this.isQuadratic || this.isCurve || convexShape || hasContour) && this.immediateMode.shapeMode !== constants.LINES; + if (shouldTess) { + this._tesselateShape(); + } + }; + /** + * Called from _processVertices(). This function calculates the stroke vertices for custom shapes and + * tesselates shapes when applicable. + * @private + * @returns {Array[Number]} indices for custom shape vertices indicating edges. + */ + _main.default.RendererGL.prototype._calculateEdges = function (shapeMode, verts, shouldClose) { + var res = [ + ]; + var i = 0; + var contourIndices = this.immediateMode.contourIndices.slice(); + var contourStart = 0; + switch (shapeMode) { + case constants.TRIANGLE_STRIP: + for (i = 0; i < verts.length - 2; i++) { + res.push([i, + i + 1]); + res.push([i, + i + 2]); + } + res.push([i, + i + 1]); + break; + case constants.TRIANGLE_FAN: + for (i = 1; i < verts.length - 1; i++) { + res.push([0, + i]); + res.push([i, + i + 1]); + } + res.push([0, + verts.length - 1]); + break; + case constants.TRIANGLES: + for (i = 0; i < verts.length - 2; i = i + 3) { + res.push([i, + i + 1]); + res.push([i + 1, + i + 2]); + res.push([i + 2, + i]); + } + break; + case constants.LINES: + for (i = 0; i < verts.length - 1; i = i + 2) { + res.push([i, + i + 1]); + } + break; + case constants.QUADS: + // Quads have been broken up into two triangles by `vertex()`: + // 0 3--5 + // | \ \ | + // 1--2 4 + for (i = 0; i < verts.length - 5; i += 6) { + res.push([i, + i + 1]); + res.push([i + 1, + i + 2]); + res.push([i + 3, + i + 5]); + res.push([i + 4, + i + 5]); + } + break; + case constants.QUAD_STRIP: + // 0---2---4 + // | | | + // 1---3---5 + for (i = 0; i < verts.length - 2; i += 2) { + res.push([i, + i + 1]); + res.push([i, + i + 2]); + res.push([i + 1, + i + 3]); + } + res.push([i, + i + 1]); + break; + default: + // TODO: handle contours in other modes too + for (i = 0; i < verts.length; i++) { + // Handle breaks between contours + if (i + 1 < verts.length && i + 1 !== contourIndices[0]) { + res.push([i, + i + 1]); + } else { + if (shouldClose || contourStart) { + res.push([i, + contourStart]); + } + if (contourIndices.length > 0) { + contourStart = contourIndices.shift(); + } + } + } + break; + } + if (shapeMode !== constants.TESS && shouldClose) { + res.push([verts.length - 1, + 0]); + } + return res; + }; + /** + * Called from _processVertices() when applicable. This function tesselates immediateMode.geometry. + * @private + */ + _main.default.RendererGL.prototype._tesselateShape = function () { + var _this = this; + // TODO: handle non-TESS shape modes that have contours + this.immediateMode.shapeMode = constants.TRIANGLES; + var contours = [ + [] + ]; + for (var i = 0; i < this.immediateMode.geometry.vertices.length; i++) { + if (this.immediateMode.contourIndices.length > 0 && this.immediateMode.contourIndices[0] === i) { + this.immediateMode.contourIndices.shift(); + contours.push([]); + } + contours[contours.length - 1].push(this.immediateMode.geometry.vertices[i].x, this.immediateMode.geometry.vertices[i].y, this.immediateMode.geometry.vertices[i].z, this.immediateMode.geometry.uvs[i * 2], this.immediateMode.geometry.uvs[i * 2 + 1], this.immediateMode.geometry.vertexColors[i * 4], this.immediateMode.geometry.vertexColors[i * 4 + 1], this.immediateMode.geometry.vertexColors[i * 4 + 2], this.immediateMode.geometry.vertexColors[i * 4 + 3], this.immediateMode.geometry.vertexNormals[i].x, this.immediateMode.geometry.vertexNormals[i].y, this.immediateMode.geometry.vertexNormals[i].z); + } + var polyTriangles = this._triangulate(contours); + var originalVertices = this.immediateMode.geometry.vertices; + this.immediateMode.geometry.vertices = [ + ]; + this.immediateMode.geometry.vertexNormals = [ + ]; + this.immediateMode.geometry.uvs = [ + ]; + var colors = [ + ]; + for (var j = 0, polyTriLength = polyTriangles.length; j < polyTriLength; j = j + _main.default.RendererGL.prototype.tessyVertexSize) { + colors.push.apply(colors, _toConsumableArray(polyTriangles.slice(j + 5, j + 9))); + this.normal.apply(this, _toConsumableArray(polyTriangles.slice(j + 9, j + 12))); + this.vertex.apply(this, _toConsumableArray(polyTriangles.slice(j, j + 5))); + } + if (this.geometryBuilder) { + // Tesselating the face causes the indices of edge vertices to stop being + // correct. When rendering, this is not a problem, since _edgesToVertices + // will have been called before this, and edge vertex indices are no longer + // needed. However, the geometry builder still needs this information, so + // when one is active, we need to update the indices. + // + // We record index mappings in a Map so that once we have found a + // corresponding vertex, we don't need to loop to find it again. + var newIndex = new Map(); + this.immediateMode.geometry.edges = this.immediateMode.geometry.edges.map(function (edge) { + return edge.map(function (origIdx) { + if (!newIndex.has(origIdx)) { + var orig = originalVertices[origIdx]; + var newVertIndex = _this.immediateMode.geometry.vertices.findIndex(function (v) { + return orig.x === v.x && orig.y === v.y && orig.z === v.z; + }); + if (newVertIndex === - 1) { + // The tesselation process didn't output a vertex with the exact + // coordinate as before, potentially due to numerical issues. This + // doesn't happen often, but in this case, pick the closest point + var closestDist = Infinity; + var closestIndex = 0; + for (var _i = 0; _i < _this.immediateMode.geometry.vertices.length; _i++) { + var vert = _this.immediateMode.geometry.vertices[_i]; + var dX = orig.x - vert.x; + var dY = orig.y - vert.y; + var dZ = orig.z - vert.z; + var dist = dX * dX + dY * dY + dZ * dZ; + if (dist < closestDist) { + closestDist = dist; + closestIndex = _i; + } + } + newVertIndex = closestIndex; + } + newIndex.set(origIdx, newVertIndex); + } + return newIndex.get(origIdx); + }); + }); + } + this.immediateMode.geometry.vertexColors = colors; + }; + /** + * Called from endShape(). Responsible for calculating normals, setting shader uniforms, + * enabling all appropriate buffers, applying color blend, and drawing the fill geometry. + * @private + */ + _main.default.RendererGL.prototype._drawImmediateFill = function () { + var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var gl = this.GL; + this._useVertexColor = this.immediateMode.geometry.vertexColors.length > 0; + var shader; + shader = this._getImmediateFillShader(); + this._setFillUniforms(shader); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this.immediateMode.buffers.fill[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var buff = _step.value; + buff._prepareBuffer(this.immediateMode.geometry, shader); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + shader.disableRemainingAttributes(); + this._applyColorBlend(this.curFillColor); + if (count === 1) { + gl.drawArrays(this.immediateMode.shapeMode, 0, this.immediateMode.geometry.vertices.length); + } else { + try { + gl.drawArraysInstanced(this.immediateMode.shapeMode, 0, this.immediateMode.geometry.vertices.length, count); + } catch (e) { + console.log('🌸 p5.js says: Instancing is only supported in WebGL2 mode'); + } + } + shader.unbindShader(); + }; + /** + * Called from endShape(). Responsible for calculating normals, setting shader uniforms, + * enabling all appropriate buffers, applying color blend, and drawing the stroke geometry. + * @private + */ + _main.default.RendererGL.prototype._drawImmediateStroke = function () { + var gl = this.GL; + this._useLineColor = this.immediateMode.geometry.vertexStrokeColors.length > 0; + var shader = this._getImmediateStrokeShader(); + this._setStrokeUniforms(shader); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = this.immediateMode.buffers.stroke[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var buff = _step2.value; + buff._prepareBuffer(this.immediateMode.geometry, shader); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + shader.disableRemainingAttributes(); + this._applyColorBlend(this.curStrokeColor); + gl.drawArrays(gl.TRIANGLES, 0, this.immediateMode.geometry.lineVertices.length / 3); + shader.unbindShader(); + }; + var _default = _main.default.RendererGL; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.RenderBuffer': 352, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.find-index': 174, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.map': 182, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.map': 187, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 354: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.uint16-array'); + _dereq_('core-js/modules/es.typed-array.uint32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.uint16-array'); + _dereq_('core-js/modules/es.typed-array.uint32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + _dereq_('./p5.RendererGL'); + _dereq_('./p5.RenderBuffer'); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } //Retained Mode. The default mode for rendering 3D primitives + //in WEBGL. + /** + * @param {p5.Geometry} geometry The model whose resources will be freed + */ - * function draw() { - * line(10, 10, 90, 90); - * } - * - *
                                  - * - *
                                  - * - * let x = 0; - * function setup() { - * createCanvas(100, 100); - * } - * - * function draw() { - * background(204); - * x = x + 0.1; - * if (x > width) { - * x = 0; - * } - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * noLoop(); - * } - * - * function mouseReleased() { - * loop(); - * } - * - *
                                  - * - * @alt - * 113 pixel long line extending from top-left to bottom right of canvas. - * horizontal line moves slowly from left. Loops but stops on mouse press. + _main.default.RendererGL.prototype.freeGeometry = function (geometry) { + if (!geometry.gid) { + console.warn('The model you passed to freeGeometry does not have an id!'); + return; + } + this._freeBuffers(geometry.gid); + }; + /** + * _initBufferDefaults + * @private + * @description initializes buffer defaults. runs each time a new geometry is + * registered + * @param {String} gId key of the geometry object + * @returns {Object} a new buffer object + */ + _main.default.RendererGL.prototype._initBufferDefaults = function (gId) { + this._freeBuffers(gId); + //@TODO remove this limit on hashes in retainedMode.geometry + if (Object.keys(this.retainedMode.geometry).length > 1000) { + var key = Object.keys(this.retainedMode.geometry) [0]; + this._freeBuffers(key); + } //create a new entry in our retainedMode.geometry + + return this.retainedMode.geometry[gId] = { + }; + }; + _main.default.RendererGL.prototype._freeBuffers = function (gId) { + var buffers = this.retainedMode.geometry[gId]; + if (!buffers) { + return; + } + delete this.retainedMode.geometry[gId]; + var gl = this.GL; + if (buffers.indexBuffer) { + gl.deleteBuffer(buffers.indexBuffer); + } + function freeBuffers(defs) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = defs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + if (buffers[def.dst]) { + gl.deleteBuffer(buffers[def.dst]); + buffers[def.dst] = null; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } // free all the buffers + + freeBuffers(this.retainedMode.buffers.stroke); + freeBuffers(this.retainedMode.buffers.fill); + }; + /** + * creates a buffers object that holds the WebGL render buffers + * for a geometry. + * @private + * @param {String} gId key of the geometry object + * @param {p5.Geometry} model contains geometry data */ + _main.default.RendererGL.prototype.createBuffers = function (gId, model) { + var gl = this.GL; + //initialize the gl buffers for our geom groups + var buffers = this._initBufferDefaults(gId); + buffers.model = model; + var indexBuffer = buffers.indexBuffer; + if (model.faces.length) { + // allocate space for faces + if (!indexBuffer) indexBuffer = buffers.indexBuffer = gl.createBuffer(); + var vals = _main.default.RendererGL.prototype._flatten(model.faces); + // If any face references a vertex with an index greater than the maximum + // un-singed 16 bit integer, then we need to use a Uint32Array instead of a + // Uint16Array + var hasVertexIndicesOverMaxUInt16 = vals.some(function (v) { + return v > 65535; + }); + var type = hasVertexIndicesOverMaxUInt16 ? Uint32Array : Uint16Array; + this._bindBuffer(indexBuffer, gl.ELEMENT_ARRAY_BUFFER, vals, type); + // If we're using a Uint32Array for our indexBuffer we will need to pass a + // different enum value to WebGL draw triangles. This happens in + // the _drawElements function. + buffers.indexBufferType = hasVertexIndicesOverMaxUInt16 ? gl.UNSIGNED_INT : gl.UNSIGNED_SHORT; + // the vertex count is based on the number of faces + buffers.vertexCount = model.faces.length * 3; + } else { + // the index buffer is unused, remove it + if (indexBuffer) { + gl.deleteBuffer(indexBuffer); + buffers.indexBuffer = null; + } // the vertex count comes directly from the model - _main.default.prototype.noLoop = function () { - this._loop = false; - }; - /** - * By default, p5.js loops through draw() continuously, executing the code within - * it. However, the draw() loop may be stopped by calling - * noLoop(). In that case, the draw() - * loop can be resumed with loop(). - * - * Avoid calling loop() from inside setup(). - * - * Use isLooping() to check the current state of loop(). - * - * @method loop - * @example - *
                                  - * - * let x = 0; - * function setup() { - * createCanvas(100, 100); - * noLoop(); - * } - * - * function draw() { - * background(204); - * x = x + 0.1; - * if (x > width) { - * x = 0; - * } - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * loop(); - * } - * - * function mouseReleased() { - * noLoop(); - * } - * - *
                                  - * - * @alt - * horizontal line moves slowly from left. Loops but stops on mouse press. - */ - _main.default.prototype.loop = function () { - if (!this._loop) { - this._loop = true; - if (this._setupDone) { - this._draw(); - } - } - }; - /** - * By default, p5.js loops through draw() continuously, - * executing the code within it. If the sketch is stopped with - * noLoop() or resumed with loop(), - * isLooping() returns the current state for use within custom event handlers. - * - * @method isLooping - * @returns {boolean} - * @example - *
                                  - * - * let checkbox, button, colBG, colFill; - * - * function setup() { - * createCanvas(100, 100); - * - * button = createButton('Colorize if loop()'); - * button.position(0, 120); - * button.mousePressed(changeBG); - * - * checkbox = createCheckbox('loop()', true); - * checkbox.changed(checkLoop); - * - * colBG = color(0); - * colFill = color(255); - * } - * - * function changeBG() { - * if (isLooping()) { - * colBG = color(random(255), random(255), random(255)); - * colFill = color(random(255), random(255), random(255)); - * } - * } - * - * function checkLoop() { - * if (this.checked()) { - * loop(); - * } else { - * noLoop(); - * } - * } - * - * function draw() { - * background(colBG); - * fill(colFill); - * ellipse(frameCount % width, height / 2, 50); - * } - * - *
                                  - * - * @alt - * Ellipse moves slowly from left. Checkbox toggles loop()/noLoop(). - * Button colorizes sketch if isLooping(). - * - */ - _main.default.prototype.isLooping = function () { - return this._loop; - }; - /** - * The push() function saves the current drawing style - * settings and transformations, while pop() restores these - * settings. Note that these functions are always used together. They allow you to - * change the style and transformation settings and later return to what you had. - * When a new state is started with push(), it builds on - * the current style and transform information. The push() - * and pop() functions can be embedded to provide more - * control. (See the second example for a demonstration.) - * - * push() stores information related to the current transformation state - * and style settings controlled by the following functions: - * fill(), - * noFill(), - * noStroke(), - * stroke(), - * tint(), - * noTint(), - * strokeWeight(), - * strokeCap(), - * strokeJoin(), - * imageMode(), - * rectMode(), - * ellipseMode(), - * colorMode(), - * textAlign(), - * textFont(), - * textSize(), - * textLeading(), - * applyMatrix(), - * resetMatrix(), - * rotate(), - * scale(), - * shearX(), - * shearY(), - * translate(), - * noiseSeed(). - * - * In WEBGL mode additional style settings are stored. These are controlled by the - * following functions: setCamera(), - * ambientLight(), - * directionalLight(), - * pointLight(), texture(), - * specularMaterial(), - * shininess(), - * normalMaterial() - * and shader(). - * - * @method push - * @example - *
                                  - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * strokeWeight(10); - * fill(204, 153, 0); - * translate(50, 0); - * ellipse(0, 50, 33, 33); // Middle circle - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                                  - * - *
                                  - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * strokeWeight(10); - * fill(204, 153, 0); - * ellipse(33, 50, 33, 33); // Left-middle circle - * - * push(); // Start another new drawing state - * stroke(0, 102, 153); - * ellipse(66, 50, 33, 33); // Right-middle circle - * pop(); // Restore previous state - * - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                                  - * - * @alt - * Gold ellipse + thick black outline @center 2 white ellipses on left and right. - * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. - */ - _main.default.prototype.push = function () { - this._styles.push({ - props: { - _colorMode: this._colorMode, - }, - renderer: this._renderer.push(), - }); - }; - /** - * The push() function saves the current drawing style - * settings and transformations, while pop() restores - * these settings. Note that these functions are always used together. They allow - * you to change the style and transformation settings and later return to what - * you had. When a new state is started with push(), it - * builds on the current style and transform information. The push() - * and pop() functions can be embedded to provide more - * control. (See the second example for a demonstration.) - * - * push() stores information related to the current transformation state - * and style settings controlled by the following functions: - * fill(), - * noFill(), - * noStroke(), - * stroke(), - * tint(), - * noTint(), - * strokeWeight(), - * strokeCap(), - * strokeJoin(), - * imageMode(), - * rectMode(), - * ellipseMode(), - * colorMode(), - * textAlign(), - * textFont(), - * textSize(), - * textLeading(), - * applyMatrix(), - * resetMatrix(), - * rotate(), - * scale(), - * shearX(), - * shearY(), - * translate(), - * noiseSeed(). - * - * In WEBGL mode additional style settings are stored. These are controlled by - * the following functions: - * setCamera(), - * ambientLight(), - * directionalLight(), - * pointLight(), - * texture(), - * specularMaterial(), - * shininess(), - * normalMaterial() and - * shader(). - * - * @method pop - * @example - *
                                  - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * translate(50, 0); - * strokeWeight(10); - * fill(204, 153, 0); - * ellipse(0, 50, 33, 33); // Middle circle - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                                  - * - *
                                  - * - * ellipse(0, 50, 33, 33); // Left circle - * - * push(); // Start a new drawing state - * strokeWeight(10); - * fill(204, 153, 0); - * ellipse(33, 50, 33, 33); // Left-middle circle - * - * push(); // Start another new drawing state - * stroke(0, 102, 153); - * ellipse(66, 50, 33, 33); // Right-middle circle - * pop(); // Restore previous state - * - * pop(); // Restore original state - * - * ellipse(100, 50, 33, 33); // Right circle - * - *
                                  - * - * @alt - * Gold ellipse + thick black outline @center 2 white ellipses on left and right. - * 2 Gold ellipses left black right blue stroke. 2 white ellipses on left+right. - */ - _main.default.prototype.pop = function () { - var style = this._styles.pop(); - if (style) { - this._renderer.pop(style.renderer); - Object.assign(this, style.props); - } else { - console.warn("pop() was called without matching push()"); - } - }; - /** - * Executes the code within draw() one time. This - * function allows the program to update the display window only when necessary, - * for example when an event registered by mousePressed() - * or keyPressed() occurs. - * - * In structuring a program, it only makes sense to call redraw() - * within events such as mousePressed(). This - * is because redraw() does not run - * draw() immediately (it only sets a flag that indicates - * an update is needed). - * - * The redraw() function does not work properly when - * called inside draw().To enable/disable animations, - * use loop() and noLoop(). - * - * In addition you can set the number of redraws per method call. Just - * add an integer as single parameter for the number of redraws. - * - * @method redraw - * @param {Integer} [n] Redraw for n-times. The default value is 1. - * @example - *
                                  - * let x = 0; - * - * function setup() { - * createCanvas(100, 100); - * noLoop(); - * } - * - * function draw() { - * background(204); - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * x += 1; - * redraw(); - * } - * - *
                                  - * - *
                                  - * - * let x = 0; - * - * function setup() { - * createCanvas(100, 100); - * noLoop(); - * } - * - * function draw() { - * background(204); - * x += 1; - * line(x, 0, x, height); - * } - * - * function mousePressed() { - * redraw(5); - * } - * - *
                                  - * - * @alt - * black line on far left of canvas - * black line on far left of canvas - */ - _main.default.prototype.redraw = function (n) { - if (this._inUserDraw || !this._setupDone) { - return; - } - var numberOfRedraws = parseInt(n); - if (isNaN(numberOfRedraws) || numberOfRedraws < 1) { - numberOfRedraws = 1; - } - var context = this._isGlobal ? window : this; - if (typeof context.draw === "function") { - if (typeof context.setup === "undefined") { - context.scale(context._pixelDensity, context._pixelDensity); - } - for ( - var idxRedraw = 0; - idxRedraw < numberOfRedraws; - idxRedraw++ - ) { - context.resetMatrix(); - if ( - this._accessibleOutputs.grid || - this._accessibleOutputs.text - ) { - this._updateAccsOutput(); - } - if (context._renderer.isP3D) { - context._renderer._update(); - } - context._setProperty("frameCount", context.frameCount + 1); - this.callRegisteredHooksFor("pre"); - this._inUserDraw = true; - try { - context.draw(); - } finally { - this._inUserDraw = false; - } - this.callRegisteredHooksFor("post"); - } - } - }; - /** - * The `p5()` constructor enables you to activate "instance mode" instead of normal - * "global mode". This is an advanced topic. A short description and example is - * included below. Please see - * - * Dan Shiffman's Coding Train video tutorial or this - * tutorial page - * for more info. - * - * By default, all p5.js functions are in the global namespace (i.e. bound to the window - * object), meaning you can call them simply `ellipse()`, `fill()`, etc. However, this - * might be inconvenient if you are mixing with other JS libraries (synchronously or - * asynchronously) or writing long programs of your own. p5.js currently supports a - * way around this problem called "instance mode". In instance mode, all p5 functions - * are bound up in a single variable instead of polluting your global namespace. - * - * Optionally, you can specify a default container for the canvas and any other elements - * to append to with a second argument. You can give the ID of an element in your html, - * or an html node itself. - * - * Note that creating instances like this also allows you to have more than one p5 sketch on - * a single web page, as they will each be wrapped up with their own set up variables. Of - * course, you could also use iframes to have multiple sketches in global mode. - * - * @method p5 - * @param {Object} sketch a function containing a p5.js sketch - * @param {String|Object} node ID or pointer to HTML DOM node to contain sketch in - * @example - *
                                  - * const s = p => { - * let x = 100; - * let y = 100; - * - * p.setup = function() { - * p.createCanvas(700, 410); - * }; - * - * p.draw = function() { - * p.background(0); - * p.fill(255); - * p.rect(x, y, 50, 50); - * }; - * }; - * - * new p5(s); // invoke p5 - *
                                  - * - * @alt - * white rectangle on black background - */ - var _default = _main.default; - exports.default = _default; - }, - { - "./main": 298, - "core-js/modules/es.object.assign": 194, - }, - ], - 311: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("./main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Transform - * @submodule Transform - * @for p5 - * @requires core - * @requires constants - */ - /** - * Multiplies the current matrix by the one specified through the parameters. - * This is a powerful operation that can perform the equivalent of translate, - * scale, shear and rotate all at once. You can learn more about transformation - * matrices on - * Wikipedia. - * - * The naming of the arguments here follows the naming of the - * WHATWG specification and corresponds to a - * transformation matrix of the - * form: - * - * > The transformation matrix used when applyMatrix is called - * - * The transformation matrix used when applyMatrix is called with 4x4 matrix - * - * @method applyMatrix - * @param {Array} arr an array of numbers - should be 6 or 16 length (2×3 or 4×4 matrix values) - * @chainable - * @example - *
                                  - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * background(200); - * // Equivalent to translate(x, y); - * applyMatrix(1, 0, 0, 1, 40 + step, 50); - * rect(0, 0, 50, 50); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * background(200); - * translate(50, 50); - * // Equivalent to scale(x, y); - * applyMatrix(1 / step, 0, 0, 1 / step, 0, 0); - * rect(0, 0, 50, 50); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * let angle = map(step, 0, 20, 0, TWO_PI); - * let cos_a = cos(angle); - * let sin_a = sin(angle); - * background(200); - * translate(50, 50); - * // Equivalent to rotate(angle); - * applyMatrix(cos_a, sin_a, -sin_a, cos_a, 0, 0); - * rect(0, 0, 50, 50); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * frameRate(10); - * rectMode(CENTER); - * } - * - * function draw() { - * let step = frameCount % 20; - * let angle = map(step, 0, 20, -PI / 4, PI / 4); - * background(200); - * translate(50, 50); - * // equivalent to shearX(angle); - * let shear_factor = 1 / tan(PI / 2 - angle); - * applyMatrix(1, 0, shear_factor, 1, 0, 0); - * rect(0, 0, 50, 50); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noFill(); - * } - * - * function draw() { - * background(200); - * rotateY(PI / 6); - * stroke(153); - * box(35); - * let rad = millis() / 1000; - * // Set rotation angles - * let ct = cos(rad); - * let st = sin(rad); - * // Matrix for rotation around the Y axis - * applyMatrix( - * ct, 0.0, st, 0.0, - * 0.0, 1.0, 0.0, 0.0, - * -st, 0.0, ct, 0.0, - * 0.0, 0.0, 0.0, 1.0 - * ); - * stroke(255); - * box(50); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * let testMatrix = [1, 0, 0, 1, 0, 0]; - * applyMatrix(testMatrix); - * rect(0, 0, 50, 50); - * } - * - *
                                  - * - * @alt - * A rectangle translating to the right - * A rectangle shrinking to the center - * A rectangle rotating clockwise about the center - * A rectangle shearing - * A rectangle in the upper left corner - */ - /** - * @method applyMatrix - * @param {Number} a numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} b numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} c numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} d numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} e numbers which define the 2×3 or 4×4 matrix to be multiplied - * @param {Number} f numbers which define the 2×3 or 4×4 matrix to be multiplied - * @chainable - */ - /** - * @method applyMatrix - * @param {Number} a - * @param {Number} b - * @param {Number} c - * @param {Number} d - * @param {Number} e - * @param {Number} f - * @param {Number} g numbers which define the 4×4 matrix to be multiplied - * @param {Number} h numbers which define the 4×4 matrix to be multiplied - * @param {Number} i numbers which define the 4×4 matrix to be multiplied - * @param {Number} j numbers which define the 4×4 matrix to be multiplied - * @param {Number} k numbers which define the 4×4 matrix to be multiplied - * @param {Number} l numbers which define the 4×4 matrix to be multiplied - * @param {Number} m numbers which define the 4×4 matrix to be multiplied - * @param {Number} n numbers which define the 4×4 matrix to be multiplied - * @param {Number} o numbers which define the 4×4 matrix to be multiplied - * @param {Number} p numbers which define the 4×4 matrix to be multiplied - * @chainable - */ - - _main.default.prototype.applyMatrix = function () { - var isTypedArray = - (arguments.length <= 0 ? undefined : arguments[0]) instanceof - Object.getPrototypeOf(Uint8Array); - if ( - Array.isArray(arguments.length <= 0 ? undefined : arguments[0]) || - isTypedArray - ) { - var _this$_renderer; - (_this$_renderer = this._renderer).applyMatrix.apply( - _this$_renderer, - _toConsumableArray( - arguments.length <= 0 ? undefined : arguments[0], - ), - ); - } else { - var _this$_renderer2; - (_this$_renderer2 = this._renderer).applyMatrix.apply( - _this$_renderer2, - arguments, - ); - } - return this; - }; - /** - * Replaces the current matrix with the identity matrix. - * - * @method resetMatrix - * @chainable - * @example - *
                                  - * - * translate(50, 50); - * applyMatrix(0.5, 0.5, -0.5, 0.5, 0, 0); - * rect(0, 0, 20, 20); - * // Note that the translate is also reset. - * resetMatrix(); - * rect(0, 0, 20, 20); - * - *
                                  - * - * @alt - * A rotated rectangle in the center with another at the top left corner - */ - _main.default.prototype.resetMatrix = function () { - this._renderer.resetMatrix(); - return this; - }; - /** - * Rotates a shape by the amount specified by the angle parameter. This - * function accounts for angleMode, so angles - * can be entered in either RADIANS or DEGREES. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * Transformations apply to everything that happens after and subsequent - * calls to the function accumulate the effect. For example, calling - * rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). - * All transformations are reset when draw() begins again. - * - * Technically, rotate() multiplies the current transformation matrix - * by a rotation matrix. This function can be further controlled by - * push() and pop(). - * - * @method rotate - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @param {p5.Vector|Number[]} [axis] (in 3d) the axis to rotate around - * @chainable - * @example - *
                                  - * - * translate(width / 2, height / 2); - * rotate(PI / 3.0); - * rect(-26, -26, 52, 52); - * - *
                                  - * - * @alt - * white 52×52 rect with black outline at center rotated counter 45 degrees - */ - _main.default.prototype.rotate = function (angle, axis) { - _main.default._validateParameters("rotate", arguments); - this._renderer.rotate(this._toRadians(angle), axis); - return this; - }; - /** - * Rotates a shape around X axis by the amount specified in angle parameter. - * The angles can be entered in either RADIANS or DEGREES. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * All transformations are reset when draw() begins again. - * - * @method rotateX - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(255); - * rotateX(millis() / 1000); - * box(); - * } - * - *
                                  - * - * @alt - * 3d box rotating around the x axis. - */ - _main.default.prototype.rotateX = function (angle) { - this._assert3d("rotateX"); - _main.default._validateParameters("rotateX", arguments); - this._renderer.rotateX(this._toRadians(angle)); - return this; - }; - /** - * Rotates a shape around Y axis by the amount specified in angle parameter. - * The angles can be entered in either RADIANS or DEGREES. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * All transformations are reset when draw() begins again. - * - * @method rotateY - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(255); - * rotateY(millis() / 1000); - * box(); - * } - * - *
                                  - * - * @alt - * 3d box rotating around the y axis. - */ - _main.default.prototype.rotateY = function (angle) { - this._assert3d("rotateY"); - _main.default._validateParameters("rotateY", arguments); - this._renderer.rotateY(this._toRadians(angle)); - return this; - }; - /** - * Rotates a shape around Z axis by the amount specified in angle parameter. - * The angles can be entered in either RADIANS or DEGREES. - * - * This method works in WEBGL mode only. - * - * Objects are always rotated around their relative position to the - * origin and positive numbers rotate objects in a clockwise direction. - * All transformations are reset when draw() begins again. - * - * @method rotateZ - * @param {Number} angle the angle of rotation, specified in radians - * or degrees, depending on current angleMode - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(255); - * rotateZ(millis() / 1000); - * box(); - * } - * - *
                                  - * - * @alt - * 3d box rotating around the z axis. - */ - _main.default.prototype.rotateZ = function (angle) { - this._assert3d("rotateZ"); - _main.default._validateParameters("rotateZ", arguments); - this._renderer.rotateZ(this._toRadians(angle)); - return this; - }; - /** - * Increases or decreases the size of a shape by expanding or contracting - * vertices. Objects always scale from their relative origin to the - * coordinate system. Scale values are specified as decimal percentages. - * For example, the function call scale(2.0) increases the dimension of a - * shape by 200%. - * - * Transformations apply to everything that happens after and subsequent - * calls to the function multiply the effect. For example, calling scale(2.0) - * and then scale(1.5) is the same as scale(3.0). If scale() is called - * within draw(), the transformation is reset when the loop begins again. - * - * Using this function with the z parameter is only available in WEBGL mode. - * This function can be further controlled with push() and pop(). - * - * @method scale - * @param {Number|p5.Vector|Number[]} s - * percent to scale the object, or percentage to - * scale the object in the x-axis if multiple arguments - * are given - * @param {Number} [y] percent to scale the object in the y-axis - * @param {Number} [z] percent to scale the object in the z-axis (webgl only) - * @chainable - * @example - *
                                  - * - * rect(30, 20, 50, 50); - * scale(0.5); - * rect(30, 20, 50, 50); - * - *
                                  - * - *
                                  - * - * rect(30, 20, 50, 50); - * scale(0.5, 1.3); - * rect(30, 20, 50, 50); - * - *
                                  - * - * @alt - * white 52×52 rect with black outline at center rotated counter 45 degrees - * 2 white rects with black outline- 1 50×50 at center. other 25×65 bottom left - */ - /** - * @method scale - * @param {p5.Vector|Number[]} scales per-axis percents to scale the object - * @chainable - */ - _main.default.prototype.scale = function (x, y, z) { - _main.default._validateParameters("scale", arguments); - // Only check for Vector argument type if Vector is available - if (x instanceof _main.default.Vector) { - var v = x; - x = v.x; - y = v.y; - z = v.z; - } else if (x instanceof Array) { - var rg = x; - x = rg[0]; - y = rg[1]; - z = rg[2] || 1; - } - if (isNaN(y)) { - y = z = x; - } else if (isNaN(z)) { - z = 1; - } - this._renderer.scale.call(this._renderer, x, y, z); - return this; - }; - /** - * Shears a shape around the x-axis by the amount specified by the angle - * parameter. Angles should be specified in the current angleMode. - * Objects are always sheared around their relative position to the origin - * and positive numbers shear objects in a clockwise direction. - * - * Transformations apply to everything that happens after and subsequent - * calls to the function accumulates the effect. For example, calling - * shearX(PI/2) and then shearX(PI/2) is the same as shearX(PI). - * If shearX() is called within the draw(), - * the transformation is reset when the loop begins again. - * - * Technically, shearX() multiplies the current - * transformation matrix by a rotation matrix. This function can be further - * controlled by the push() and pop() functions. - * - * @method shearX - * @param {Number} angle angle of shear specified in radians or degrees, - * depending on current angleMode - * @chainable - * @example - *
                                  - * - * translate(width / 4, height / 4); - * shearX(PI / 4.0); - * rect(0, 0, 30, 30); - * - *
                                  - * - * @alt - * white irregular quadrilateral with black outline at top middle. - */ - _main.default.prototype.shearX = function (angle) { - _main.default._validateParameters("shearX", arguments); - var rad = this._toRadians(angle); - this._renderer.applyMatrix(1, 0, Math.tan(rad), 1, 0, 0); - return this; - }; - /** - * Shears a shape around the y-axis the amount specified by the angle - * parameter. Angles should be specified in the current angleMode. Objects - * are always sheared around their relative position to the origin and - * positive numbers shear objects in a clockwise direction. - * - * Transformations apply to everything that happens after and subsequent - * calls to the function accumulates the effect. For example, calling - * shearY(PI/2) and then shearY(PI/2) is the same as shearY(PI). If - * shearY() is called within the draw(), the transformation is reset when - * the loop begins again. - * - * Technically, shearY() multiplies the current transformation matrix by a - * rotation matrix. This function can be further controlled by the - * push() and pop() functions. - * - * @method shearY - * @param {Number} angle angle of shear specified in radians or degrees, - * depending on current angleMode - * @chainable - * @example - *
                                  - * - * translate(width / 4, height / 4); - * shearY(PI / 4.0); - * rect(0, 0, 30, 30); - * - *
                                  - * - * @alt - * white irregular quadrilateral with black outline at middle bottom. - */ - _main.default.prototype.shearY = function (angle) { - _main.default._validateParameters("shearY", arguments); - var rad = this._toRadians(angle); - this._renderer.applyMatrix(1, Math.tan(rad), 0, 1, 0, 0); - return this; - }; - /** - * Specifies an amount to displace objects within the display window. - * The x parameter specifies left/right translation, the y parameter - * specifies up/down translation. - * - * Transformations are cumulative and apply to everything that happens after - * and subsequent calls to the function accumulates the effect. For example, - * calling translate(50, 0) and then translate(20, 0) is the same as - * translate(70, 0). If translate() is called within draw(), the - * transformation is reset when the loop begins again. This function can be - * further controlled by using push() and pop(). - * - * @method translate - * @param {Number} x left/right translation - * @param {Number} y up/down translation - * @param {Number} [z] forward/backward translation (WEBGL only) + buffers.vertexCount = model.vertices ? model.vertices.length : 0; + } + buffers.lineVertexCount = model.lineVertices ? model.lineVertices.length / 3 : 0; + return buffers; + }; + /** + * Draws buffers given a geometry key ID + * @private + * @param {String} gId ID in our geom hash * @chainable - * @example - *
                                  - * - * translate(30, 20); - * rect(0, 0, 55, 55); - * - *
                                  + */ + _main.default.RendererGL.prototype.drawBuffers = function (gId) { + var gl = this.GL; + var geometry = this.retainedMode.geometry[gId]; + if (!this.geometryBuilder && this._doFill && this.retainedMode.geometry[gId].vertexCount > 0) { + this._useVertexColor = geometry.model.vertexColors.length > 0; + var fillShader = this._getRetainedFillShader(); + this._setFillUniforms(fillShader); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = this.retainedMode.buffers.fill[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var buff = _step2.value; + buff._prepareBuffer(geometry, fillShader); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + fillShader.disableRemainingAttributes(); + if (geometry.indexBuffer) { + //vertex index buffer + this._bindBuffer(geometry.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); + } + this._applyColorBlend(this.curFillColor); + this._drawElements(gl.TRIANGLES, gId); + fillShader.unbindShader(); + } + if (!this.geometryBuilder && this._doStroke && geometry.lineVertexCount > 0) { + this._useLineColor = geometry.model.vertexStrokeColors.length > 0; + var strokeShader = this._getRetainedStrokeShader(); + this._setStrokeUniforms(strokeShader); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = this.retainedMode.buffers.stroke[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _buff = _step3.value; + _buff._prepareBuffer(geometry, strokeShader); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + strokeShader.disableRemainingAttributes(); + this._applyColorBlend(this.curStrokeColor); + this._drawArrays(gl.TRIANGLES, gId); + strokeShader.unbindShader(); + } + if (this.geometryBuilder) { + this.geometryBuilder.addRetained(geometry); + } + return this; + }; + /** + * Calls drawBuffers() with a scaled model/view matrix. * - *
                                  - * - * rect(0, 0, 55, 55); // Draw rect at original 0,0 - * translate(30, 20); - * rect(0, 0, 55, 55); // Draw rect at new 0,0 - * translate(14, 14); - * rect(0, 0, 55, 55); // Draw rect at new 0,0 - * - *
                                  + * This is used by various 3d primitive methods (in primitives.js, eg. plane, + * box, torus, etc...) to allow caching of un-scaled geometries. Those + * geometries are generally created with unit-length dimensions, cached as + * such, and then scaled appropriately in this method prior to rendering. + * + * @private + * @method drawBuffersScaled + * @param {String} gId ID in our geom hash + * @param {Number} scaleX the amount to scale in the X direction + * @param {Number} scaleY the amount to scale in the Y direction + * @param {Number} scaleZ the amount to scale in the Z direction + */ + _main.default.RendererGL.prototype.drawBuffersScaled = function (gId, scaleX, scaleY, scaleZ) { + var uMVMatrix = this.uMVMatrix.copy(); + try { + this.uMVMatrix.scale(scaleX, scaleY, scaleZ); + this.drawBuffers(gId); + } finally { + this.uMVMatrix = uMVMatrix; + } + }; + _main.default.RendererGL.prototype._drawArrays = function (drawMode, gId) { + this.GL.drawArrays(drawMode, 0, this.retainedMode.geometry[gId].lineVertexCount); + return this; + }; + _main.default.RendererGL.prototype._drawElements = function (drawMode, gId) { + var buffers = this.retainedMode.geometry[gId]; + var gl = this.GL; + // render the fill + if (buffers.indexBuffer) { + // If this model is using a Uint32Array we need to ensure the + // OES_element_index_uint WebGL extension is enabled. + if (this._pInst.webglVersion !== constants.WEBGL2 && buffers.indexBufferType === gl.UNSIGNED_INT) { + if (!gl.getExtension('OES_element_index_uint')) { + throw new Error('Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.'); + } + } // we're drawing faces + + gl.drawElements(gl.TRIANGLES, buffers.vertexCount, buffers.indexBufferType, 0); + } else { + // drawing vertices + gl.drawArrays(drawMode || gl.TRIANGLES, 0, buffers.vertexCount); + } + }; + _main.default.RendererGL.prototype._drawPoints = function (vertices, vertexBuffer) { + var gl = this.GL; + var pointShader = this._getImmediatePointShader(); + this._setPointUniforms(pointShader); + this._bindBuffer(vertexBuffer, gl.ARRAY_BUFFER, this._vToNArray(vertices), Float32Array, gl.STATIC_DRAW); + pointShader.enableAttrib(pointShader.attributes.aPosition, 3); + this._applyColorBlend(this.curStrokeColor); + gl.drawArrays(gl.Points, 0, vertices.length); + pointShader.unbindShader(); + }; + var _default = _main.default.RendererGL; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.RenderBuffer': 352, + './p5.RendererGL': 355, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.some': 184, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.float32-array': 229, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint16-array': 250, + 'core-js/modules/es.typed-array.uint32-array': 251, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 355: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.copy-within'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.reflect.get'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.float64-array'); + _dereq_('core-js/modules/es.typed-array.int16-array'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint16-array'); + _dereq_('core-js/modules/es.typed-array.uint32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.concat'); + _dereq_('core-js/modules/es.array.copy-within'); + _dereq_('core-js/modules/es.array.every'); + _dereq_('core-js/modules/es.array.fill'); + _dereq_('core-js/modules/es.array.from'); + _dereq_('core-js/modules/es.array.includes'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.map'); + _dereq_('core-js/modules/es.object.assign'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.set'); + _dereq_('core-js/modules/es.string.includes'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.float32-array'); + _dereq_('core-js/modules/es.typed-array.float64-array'); + _dereq_('core-js/modules/es.typed-array.int16-array'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.uint16-array'); + _dereq_('core-js/modules/es.typed-array.uint32-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.readPixelsWebGL = readPixelsWebGL; + exports.readPixelWebGL = readPixelWebGL; + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + var _GeometryBuilder = _interopRequireDefault(_dereq_('./GeometryBuilder')); + var _libtess = _interopRequireDefault(_dereq_('libtess')); + _dereq_('./p5.Shader'); + _dereq_('./p5.Camera'); + _dereq_('../core/p5.Renderer'); + _dereq_('./p5.Matrix'); + _dereq_('./p5.Framebuffer'); + var _path = _dereq_('path'); + var _p6 = _dereq_('./p5.Texture'); + var _filterShaderFrags; + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError('Invalid attempt to spread non-iterable instance'); + } + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === '[object Arguments]') return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + function _get(target, property, receiver) { + if (typeof Reflect !== 'undefined' && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(receiver); + } + return desc.value; + }; + } + return _get(target, property, receiver || target); + } + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _getPrototypeOf(object); + if (object === null) break; + } + return object; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + var STROKE_CAP_ENUM = { + }; + var STROKE_JOIN_ENUM = { + }; + var lineDefs = ''; + var defineStrokeCapEnum = function defineStrokeCapEnum(key, val) { + lineDefs += '#define STROKE_CAP_'.concat(key, ' ').concat(val, '\n'); + STROKE_CAP_ENUM[constants[key]] = val; + }; + var defineStrokeJoinEnum = function defineStrokeJoinEnum(key, val) { + lineDefs += '#define STROKE_JOIN_'.concat(key, ' ').concat(val, '\n'); + STROKE_JOIN_ENUM[constants[key]] = val; + }; + // Define constants in line shaders for each type of cap/join, and also record + // the values in JS objects + defineStrokeCapEnum('ROUND', 0); + defineStrokeCapEnum('PROJECT', 1); + defineStrokeCapEnum('SQUARE', 2); + defineStrokeJoinEnum('ROUND', 0); + defineStrokeJoinEnum('MITER', 1); + defineStrokeJoinEnum('BEVEL', 2); + var lightingShader = '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'; + var webgl2CompatibilityShader = '#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n'; + var defaultShaders = { + immediateVert: 'IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n', + vertexColorVert: 'IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n', + vertexColorFrag: 'IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', + normalVert: 'IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', + normalFrag: 'IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n', + basicFrag: 'IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', + lightVert: lightingShader + '// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', + lightTextureFrag: 'uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n', + phongVert: 'precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n', + phongFrag: lightingShader + '// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n', + fontVert: 'IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph\'s rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter\'s line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n', + fontFrag: '#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of \'t\' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n', + lineVert: lineDefs + '/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent\'s z value is 0 if it\'s facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don\'t get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don\'t care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can\'t remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the "elbow" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We\'ll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n', + lineFrag: lineDefs + 'precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n', + pointVert: 'IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n', + pointFrag: 'precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n', + imageLightVert: 'precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we\'ll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n', + imageLightDiffusedFrag: 'precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere\'s orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral\'s\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}', + imageLightSpecularFrag: 'precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n' + }; + for (var key in defaultShaders) { + defaultShaders[key] = webgl2CompatibilityShader + defaultShaders[key]; + } + var filterShaderFrags = (_filterShaderFrags = { + }, _defineProperty(_filterShaderFrags, constants.GRAY, 'precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.ERODE, '// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.DILATE, '// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n'), _defineProperty(_filterShaderFrags, constants.BLUR, 'precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss\' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn\'t a real Gaussian weight, it\'s a quadratic weight. It\'s what the\n// CPU mode\'s blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n'), _defineProperty(_filterShaderFrags, constants.POSTERIZE, '// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.OPAQUE, '// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n'), _defineProperty(_filterShaderFrags, constants.INVERT, '// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n'), _defineProperty(_filterShaderFrags, constants.THRESHOLD, '// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n'), _filterShaderFrags); + var filterShaderVert = 'uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n'; + /** + * @module Rendering + * @submodule Rendering + * @for p5 + */ + /** + * Set attributes for the WebGL Drawing context. + * This is a way of adjusting how the WebGL + * renderer works to fine-tune the display and performance. * - - *
                                  - * - * function draw() { - * background(200); - * rectMode(CENTER); - * translate(width / 2, height / 2); - * translate(p5.Vector.fromAngle(millis() / 1000, 40)); - * rect(0, 0, 20, 20); - * } - * - *
                                  + * Note that this will reinitialize the drawing context + * if called after the WebGL canvas is made. * - * @alt - * white 55×55 rect with black outline at center right. - * 3 white 55×55 rects with black outlines at top-l, center-r and bottom-r. - * a 20×20 white rect moving in a circle around the canvas - */ - /** - * @method translate - * @param {p5.Vector} vector the vector to translate by - * @chainable - */ - _main.default.prototype.translate = function (x, y, z) { - _main.default._validateParameters("translate", arguments); - if (this._renderer.isP3D) { - this._renderer.translate(x, y, z); - } else { - this._renderer.translate(x, y); - } - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "./main": 298, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 312: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.ends-with"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.ends-with"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module Data - * @submodule LocalStorage - * @requires core - * - * This module defines the p5 methods for working with local storage - */ - /** - * - * Stores a value in local storage under the key name. - * Local storage is saved in the browser and persists - * between browsing sessions and page reloads. - * The key can be the name of the variable but doesn't - * have to be. To retrieve stored items - * see getItem. - * - * Sensitive data such as passwords or personal information - * should not be stored in local storage. - * - * @method storeItem - * @for p5 - * @param {String} key - * @param {String|Number|Object|Boolean|p5.Color|p5.Vector} value - * - * @example - *
                                  - * // Type to change the letter in the - * // center of the canvas. - * // If you reload the page, it will - * // still display the last key you entered - * - * let myText; - * - * function setup() { - * createCanvas(100, 100); - * myText = getItem('myText'); - * if (myText === null) { - * myText = ''; - * } - * describe(`When you type the key name is displayed as black text on white background. - * If you reload the page, the last letter typed is still displaying.`); - * } - * - * function draw() { - * textSize(40); - * background(255); - * text(myText, width / 2, height / 2); - * } - * - * function keyPressed() { - * myText = key; - * storeItem('myText', myText); - * } - *
                                  - */ - - _main.default.prototype.storeItem = function (key, value) { - if (typeof key !== "string") { - console.log( - "The argument that you passed to storeItem() - ".concat( - key, - " is not a string.", - ), - ); - } - if (key.endsWith("p5TypeID")) { - console.log( - "The argument that you passed to storeItem() - ".concat( - key, - " must not end with 'p5TypeID'.", - ), - ); - } - if (typeof value === "undefined") { - console.log( - "You cannot store undefined variables using storeItem().", - ); - } - var type = _typeof(value); - switch (type) { - case "number": - case "boolean": - value = value.toString(); - break; - case "object": - if (value instanceof _main.default.Color) { - type = "p5.Color"; - } else if (value instanceof _main.default.Vector) { - type = "p5.Vector"; - var coord = [value.x, value.y, value.z]; - value = coord; - } - value = JSON.stringify(value); - break; - case "string": - default: - break; - } - localStorage.setItem(key, value); - var typeKey = "".concat(key, "p5TypeID"); - localStorage.setItem(typeKey, type); - }; - /** - * - * Returns the value of an item that was stored in local storage - * using storeItem() - * - * @method getItem - * @for p5 - * @param {String} key name that you wish to use to store in local storage - * @return {Number|Object|String|Boolean|p5.Color|p5.Vector} Value of stored item - * - * @example - *
                                  - * // Click the mouse to change - * // the color of the background - * // Once you have changed the color - * // it will stay changed even when you - * // reload the page. - * - * let myColor; - * - * function setup() { - * createCanvas(100, 100); - * myColor = getItem('myColor'); - * } - * - * function draw() { - * if (myColor !== null) { - * background(myColor); - * } - * describe(`If you click, the canvas changes to a random color.· - * If you reload the page, the canvas is still the color it was when the - * page was previously loaded.`); - * } - * - * function mousePressed() { - * myColor = color(random(255), random(255), random(255)); - * storeItem('myColor', myColor); - * } - *
                                  - */ - _main.default.prototype.getItem = function (key) { - var value = localStorage.getItem(key); - var type = localStorage.getItem("".concat(key, "p5TypeID")); - if (typeof type === "undefined") { - console.log( - "Unable to determine type of item stored under ".concat( - key, - "in local storage. Did you save the item with something other than setItem()?", - ), - ); - } else if (value !== null) { - switch (type) { - case "number": - value = parseFloat(value); - break; - case "boolean": - value = value === "true"; - break; - case "object": - value = JSON.parse(value); - break; - case "p5.Color": - value = JSON.parse(value); - value = this.color.apply( - this, - _toConsumableArray(value.levels), - ); - break; - case "p5.Vector": - value = JSON.parse(value); - value = this.createVector.apply( - this, - _toConsumableArray(value), - ); - break; - case "string": - default: - break; - } - } - return value; - }; - /** - * - * Clears all local storage items set with storeItem() - * for the current domain. - * - * @method clearStorage - * @for p5 - * - * @example - *
                                  - * - * function setup() { - * let myNum = 10; - * let myBool = false; - * storeItem('myNum', myNum); - * storeItem('myBool', myBool); - * print(getItem('myNum')); // logs 10 to the console - * print(getItem('myBool')); // logs false to the console - * clearStorage(); - * print(getItem('myNum')); // logs null to the console - * print(getItem('myBool')); // logs null to the console - * } - *
                                  - */ - _main.default.prototype.clearStorage = function () { - localStorage.clear(); - }; - /** - * - * Removes an item that was stored with storeItem() - * - * @method removeItem - * @param {String} key - * @for p5 - * - * @example - *
                                  - * - * function setup() { - * let myVar = 10; - * storeItem('myVar', myVar); - * print(getItem('myVar')); // logs 10 to the console - * removeItem('myVar'); - * print(getItem('myVar')); // logs null to the console - * } - *
                                  - */ - _main.default.prototype.removeItem = function (key) { - if (typeof key !== "string") { - console.log( - "The argument that you passed to removeItem() - ".concat( - key, - " is not a string.", - ), - ); - } - localStorage.removeItem(key); - localStorage.removeItem("".concat(key, "p5TypeID")); - }; - }, - { - "../core/main": 298, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.ends-with": 208, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 313: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.object.keys"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Data - * @submodule Dictionary - * @for p5.TypedDict - * @requires core - * - * This module defines the p5 methods for the p5 Dictionary classes. - * The classes StringDict and NumberDict are for storing and working - * with key-value pairs. - */ - /** - * - * Creates a new instance of p5.StringDict using the key-value pair - * or the object you provide. - * - * @method createStringDict - * @for p5 - * @param {String} key - * @param {String} value - * @return {p5.StringDict} - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * print(myDictionary.hasKey('p5')); // logs true to console - * - * let anotherDictionary = createStringDict({ happy: 'coding' }); - * print(anotherDictionary.hasKey('happy')); // logs true to console - * } - *
                                  - */ - /** - * @method createStringDict - * @param {Object} object object - * @return {p5.StringDict} - */ - - _main.default.prototype.createStringDict = function (key, value) { - _main.default._validateParameters("createStringDict", arguments); - return new _main.default.StringDict(key, value); - }; - /** - * - * Creates a new instance of p5.NumberDict using the key-value pair - * or object you provide. - * - * @method createNumberDict - * @for p5 - * @param {Number} key - * @param {Number} value - * @return {p5.NumberDict} - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict(100, 42); - * print(myDictionary.hasKey(100)); // logs true to console - * - * let anotherDictionary = createNumberDict({ 200: 84 }); - * print(anotherDictionary.hasKey(200)); // logs true to console - * } - *
                                  - */ - /** - * @method createNumberDict - * @param {Object} object object - * @return {p5.NumberDict} - */ - _main.default.prototype.createNumberDict = function (key, value) { - _main.default._validateParameters("createNumberDict", arguments); - return new _main.default.NumberDict(key, value); - }; - /** - * - * Base class for all p5.Dictionary types. Specifically - * typed Dictionary classes inherit from this class. - * - * @class p5.TypedDict - * @constructor - */ - _main.default.TypedDict = /*#__PURE__*/ (function () { - function TypedDict(key, value) { - _classCallCheck(this, TypedDict); - if (key instanceof Object) { - this.data = key; - } else { - this.data = {}; - this.data[key] = value; - } - return this; - } /** - * Returns the number of key-value pairs currently stored in the Dictionary. - * - * @method size - * @return {Integer} the number of key-value pairs in the Dictionary - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict(1, 10); - * myDictionary.create(2, 20); - * myDictionary.create(3, 30); - * print(myDictionary.size()); // logs 3 to the console - * } - *
                                  - */ - - _createClass(TypedDict, [ - { - key: "size", - value: function size() { - return Object.keys(this.data).length; - } /** - * Returns true if the given key exists in the Dictionary, - * otherwise returns false. - * - * @method hasKey - * @param {Number|String} key that you want to look up - * @return {Boolean} whether that key exists in Dictionary - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * print(myDictionary.hasKey('p5')); // logs true to console - * } - *
                                  - */, - }, - { - key: "hasKey", - value: function hasKey(key) { - return this.data.hasOwnProperty(key); - } /** - * Returns the value stored at the given key. - * - * @method get - * @param {Number|String} the key you want to access - * @return {Number|String} the value stored at that key - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * let myValue = myDictionary.get('p5'); - * print(myValue === 'js'); // logs true to console - * } - *
                                  - */, - }, - { - key: "get", - value: function get(key) { - if (this.data.hasOwnProperty(key)) { - return this.data[key]; - } else { - console.log( - "".concat(key, " does not exist in this Dictionary"), - ); - } - } /** - * Updates the value associated with the given key in case it already exists - * in the Dictionary. Otherwise a new key-value pair is added. - * - * @method set - * @param {Number|String} key - * @param {Number|String} value - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.set('p5', 'JS'); - * myDictionary.print(); // logs "key: p5 - value: JS" to console - * } - *
                                  - */, - }, - { - key: "set", - value: function set(key, value) { - if (this._validate(value)) { - this.data[key] = value; - } else { - console.log( - "Those values dont work for this dictionary type.", - ); - } - } /** - * private helper function to handle the user passing in objects - * during construction or calls to create() - */, - }, - { - key: "_addObj", - value: function _addObj(obj) { - for (var key in obj) { - this.set(key, obj[key]); - } - } /** - * Creates a new key-value pair in the Dictionary. - * - * @method create - * @param {Number|String} key - * @param {Number|String} value - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.create('happy', 'coding'); - * myDictionary.print(); - * // above logs "key: p5 - value: js, key: happy - value: coding" to console - * } - *
                                  - */, - /** - * @method create - * @param {Object} obj key/value pair - */ - }, - { - key: "create", - value: function create(key, value) { - if (key instanceof Object && typeof value === "undefined") { - this._addObj(key); - } else if (typeof key !== "undefined") { - this.set(key, value); - } else { - console.log( - "In order to create a new Dictionary entry you must pass " + - "an object or a key, value pair", - ); - } - } /** - * Removes all previously stored key-value pairs from the Dictionary. - * - * @method clear - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * print(myDictionary.hasKey('p5')); // prints 'true' - * myDictionary.clear(); - * print(myDictionary.hasKey('p5')); // prints 'false' - * } - * - *
                                  - */, - }, - { - key: "clear", - value: function clear() { - this.data = {}; - } /** - * Removes the key-value pair stored at the given key from the Dictionary. - * - * @method remove - * @param {Number|String} key for the pair to remove - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.create('happy', 'coding'); - * myDictionary.print(); - * // above logs "key: p5 - value: js, key: happy - value: coding" to console - * myDictionary.remove('p5'); - * myDictionary.print(); - * // above logs "key: happy value: coding" to console - * } - *
                                  - */, - }, - { - key: "remove", - value: function remove(key) { - if (this.data.hasOwnProperty(key)) { - delete this.data[key]; - } else { - throw new Error( - "".concat(key, " does not exist in this Dictionary"), - ); - } - } /** - * Logs the set of items currently stored in the Dictionary to the console. - * - * @method print - * - * @example - *
                                  - * - * function setup() { - * let myDictionary = createStringDict('p5', 'js'); - * myDictionary.create('happy', 'coding'); - * myDictionary.print(); - * // above logs "key: p5 - value: js, key: happy - value: coding" to console - * } - * - *
                                  - */, - }, - { - key: "print", - value: function print() { - for (var item in this.data) { - console.log( - "key:".concat(item, " value:").concat(this.data[item]), - ); - } - } /** - * Converts the Dictionary into a CSV file for local download. - * - * @method saveTable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * createStringDict({ - * john: 1940, - * paul: 1942, - * george: 1943, - * ringo: 1940 - * }).saveTable('beatles'); - * } - * } - * - *
                                  - */, - }, - { - key: "saveTable", - value: function saveTable(filename) { - var output = ""; - for (var key in this.data) { - output += "".concat(key, ",").concat(this.data[key], "\n"); - } - var blob = new Blob([output], { - type: "text/csv", - }); - _main.default.prototype.downloadFile( - blob, - filename || "mycsv", - "csv", - ); - } /** - * Converts the Dictionary into a JSON file for local download. - * - * @method saveJSON - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * createStringDict({ - * john: 1940, - * paul: 1942, - * george: 1943, - * ringo: 1940 - * }).saveJSON('beatles'); - * } - * } - * - *
                                  - */, - }, - { - key: "saveJSON", - value: function saveJSON(filename, opt) { - _main.default.prototype.saveJSON(this.data, filename, opt); - } /** - * private helper function to ensure that the user passed in valid - * values for the Dictionary type - */, - }, - { - key: "_validate", - value: function _validate(value) { - return true; - }, - }, - ]); - return TypedDict; - })(); - /** - * - * A simple Dictionary class for Strings. - * - * @class p5.StringDict - * @extends p5.TypedDict - */ - _main.default.StringDict = /*#__PURE__*/ (function (_p5$TypedDict) { - _inherits(StringDict, _p5$TypedDict); - var _super = _createSuper(StringDict); - function StringDict() { - _classCallCheck(this, StringDict); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - return _super.call.apply(_super, [this].concat(args)); - } - _createClass(StringDict, [ - { - key: "_validate", - value: function _validate(value) { - return typeof value === "string"; - }, - }, - ]); - return StringDict; - })(_main.default.TypedDict); - /** - * - * A simple Dictionary class for Numbers. - * - * @class p5.NumberDict - * @constructor - * @extends p5.TypedDict - */ - _main.default.NumberDict = /*#__PURE__*/ (function (_p5$TypedDict2) { - _inherits(NumberDict, _p5$TypedDict2); - var _super2 = _createSuper(NumberDict); - function NumberDict() { - _classCallCheck(this, NumberDict); - for ( - var _len2 = arguments.length, - args = new Array(_len2), - _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - return _super2.call.apply(_super2, [this].concat(args)); - } /** - * private helper function to ensure that the user passed in valid - * values for the Dictionary type - */ - - _createClass(NumberDict, [ - { - key: "_validate", - value: function _validate(value) { - return typeof value === "number"; - } /** - * Add the given number to the value currently stored at the given key. - * The sum then replaces the value previously stored in the Dictionary. - * - * @method add - * @param {Number} Key for the value you wish to add to - * @param {Number} Number to add to the value - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict(2, 5); - * myDictionary.add(2, 2); - * print(myDictionary.get(2)); // logs 7 to console. - * } - *
                                  - * - */, - }, - { - key: "add", - value: function add(key, amount) { - if (this.data.hasOwnProperty(key)) { - this.data[key] += amount; - } else { - console.log( - "The key - ".concat( - key, - " does not exist in this dictionary.", - ), - ); - } - } /** - * Subtract the given number from the value currently stored at the given key. - * The difference then replaces the value previously stored in the Dictionary. - * - * @method sub - * @param {Number} Key for the value you wish to subtract from - * @param {Number} Number to subtract from the value - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict(2, 5); - * myDictionary.sub(2, 2); - * print(myDictionary.get(2)); // logs 3 to console. - * } - *
                                  - * - */, - }, - { - key: "sub", - value: function sub(key, amount) { - this.add(key, -amount); - } /** - * Multiply the given number with the value currently stored at the given key. - * The product then replaces the value previously stored in the Dictionary. - * - * @method mult - * @param {Number} Key for value you wish to multiply - * @param {Number} Amount to multiply the value by - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict(2, 4); - * myDictionary.mult(2, 2); - * print(myDictionary.get(2)); // logs 8 to console. - * } - *
                                  - * - */, - }, - { - key: "mult", - value: function mult(key, amount) { - if (this.data.hasOwnProperty(key)) { - this.data[key] *= amount; - } else { - console.log( - "The key - ".concat( - key, - " does not exist in this dictionary.", - ), - ); - } - } /** - * Divide the given number with the value currently stored at the given key. - * The quotient then replaces the value previously stored in the Dictionary. - * - * @method div - * @param {Number} Key for value you wish to divide - * @param {Number} Amount to divide the value by - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict(2, 8); - * myDictionary.div(2, 2); - * print(myDictionary.get(2)); // logs 4 to console. - * } - *
                                  - * - */, - }, - { - key: "div", - value: function div(key, amount) { - if (this.data.hasOwnProperty(key)) { - this.data[key] /= amount; - } else { - console.log( - "The key - ".concat( - key, - " does not exist in this dictionary.", - ), - ); - } - } /** - * private helper function for finding lowest or highest value - * the argument 'flip' is used to flip the comparison arrow - * from 'less than' to 'greater than' - */, - }, - { - key: "_valueTest", - value: function _valueTest(flip) { - if (Object.keys(this.data).length === 0) { - throw new Error( - "Unable to search for a minimum or maximum value on an empty NumberDict", - ); - } else if (Object.keys(this.data).length === 1) { - return this.data[Object.keys(this.data)[0]]; - } else { - var result = this.data[Object.keys(this.data)[0]]; - for (var key in this.data) { - if (this.data[key] * flip < result * flip) { - result = this.data[key]; - } - } - return result; - } - } /** - * Return the lowest number currently stored in the Dictionary. - * - * @method minValue - * @return {Number} - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); - * let lowestValue = myDictionary.minValue(); // value is -10 - * print(lowestValue); - * } - *
                                  - */, - }, - { - key: "minValue", - value: function minValue() { - return this._valueTest(1); - } /** - * Return the highest number currently stored in the Dictionary. - * - * @method maxValue - * @return {Number} - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict({ 2: -10, 4: 0.65, 1.2: 3 }); - * let highestValue = myDictionary.maxValue(); // value is 3 - * print(highestValue); - * } - *
                                  - */, - }, - { - key: "maxValue", - value: function maxValue() { - return this._valueTest(-1); - } /** - * private helper function for finding lowest or highest key - * the argument 'flip' is used to flip the comparison arrow - * from 'less than' to 'greater than' - */, - }, - { - key: "_keyTest", - value: function _keyTest(flip) { - if (Object.keys(this.data).length === 0) { - throw new Error( - "Unable to use minValue on an empty NumberDict", - ); - } else if (Object.keys(this.data).length === 1) { - return Object.keys(this.data)[0]; - } else { - var result = Object.keys(this.data)[0]; - for (var i = 1; i < Object.keys(this.data).length; i++) { - if (Object.keys(this.data)[i] * flip < result * flip) { - result = Object.keys(this.data)[i]; - } - } - return result; - } - } /** - * Return the lowest key currently used in the Dictionary. - * - * @method minKey - * @return {Number} - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); - * let lowestKey = myDictionary.minKey(); // value is 1.2 - * print(lowestKey); - * } - *
                                  - */, - }, - { - key: "minKey", - value: function minKey() { - return this._keyTest(1); - } /** - * Return the highest key currently used in the Dictionary. - * - * @method maxKey - * @return {Number} - * @example - *
                                  - * - * function setup() { - * let myDictionary = createNumberDict({ 2: 4, 4: 6, 1.2: 3 }); - * let highestKey = myDictionary.maxKey(); // value is 4 - * print(highestKey); - * } - *
                                  - */, - }, - { - key: "maxKey", - value: function maxKey() { - return this._keyTest(-1); - }, - }, - ]); - return NumberDict; - })(_main.default.TypedDict); - var _default = _main.default.TypedDict; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 314: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/web.url"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/web.url"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * The web is much more than just canvas and the DOM functionality makes it easy to interact - * with other HTML5 objects, including text, hyperlink, image, input, video, - * audio, and webcam. - * There is a set of creation methods, DOM manipulation methods, and - * an extended p5.Element that supports a range of HTML elements. See the - * - * beyond the canvas tutorial for a full overview of how this addon works. - * - * See tutorial: beyond the canvas - * for more info on how to use this library. - * - * @module DOM - * @submodule DOM - * @for p5 - * @requires p5 - */ - /** - * Searches the page for the first element that matches the given - * CSS selector string. - * The string can be an ID, class, tag name, or a combination. `select()` - * returns a p5.Element object if it finds a match - * and `null` otherwise. - * - * The second parameter, `container`, is optional. It specifies a container to - * search within. container can be CSS selector string, a - * p5.Element object, or an - * HTMLElement object. - * - * @method select - * @param {String} selectors CSS selector string of element to search for. - * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or - * HTMLElement to search within. - * @return {p5.Element|null} p5.Element containing the element. - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * // Select the canvas by its tag. - * let cnv = select('canvas'); - * cnv.style('border', '5px deeppink dashed'); - * - * describe('A gray square with a dashed pink border.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * let cnv = createCanvas(100, 100); - * // Add a class attribute to the canvas. - * cnv.class('pinkborder'); - * - * background(200); - * - * // Select the canvas by its class. - * cnv = select('.pinkborder'); - * // Style its border. - * cnv.style('border', '5px deeppink dashed'); - * - * describe('A gray square with a dashed pink border.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * let cnv = createCanvas(100, 100); - * // Set the canvas ID. - * cnv.id('mycanvas'); - * - * background(200); - * - * // Select the canvas by its ID. - * cnv = select('#mycanvas'); - * // Style its border. - * cnv.style('border', '5px deeppink dashed'); - * - * describe('A gray square with a dashed pink border.'); - * } - * - *
                                  - */ - - _main.default.prototype.select = function (e, p) { - _main.default._validateParameters("select", arguments); - var container = this._getContainer(p); - var res = container.querySelector(e); - if (res) { - return this._wrapElement(res); - } else { - return null; - } - }; - /** - * Searches the page for all elements that matches the given - * CSS selector string. - * The string can be an ID, class, tag name, or a combination. `selectAll()` - * returns an array of p5.Element objects if it - * finds any matches and an empty array otherwise. - * - * The second parameter, `container`, is optional. It specifies a container to - * search within. container can be CSS selector string, a - * p5.Element object, or an - * HTMLElement object. - * - * @method selectAll - * @param {String} selectors CSS selector string of element to search for. - * @param {String|p5.Element|HTMLElement} [container] CSS selector string, p5.Element, or - * HTMLElement to search within. - * @return {p5.Element[]} array of p5.Elements containing any elements found. - * @example - *
                                  - * - * function setup() { - * // Create three buttons. - * createButton('1'); - * createButton('2'); - * createButton('3'); - * - * // Select the buttons by their tag. - * let buttons = selectAll('button'); - * - * // Position the buttons. - * for (let i = 0; i < 3; i += 1) { - * buttons[i].position(0, i * 30); - * } - * - * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3".'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * // Create three buttons and position them. - * let b1 = createButton('1'); - * b1.position(0, 0); - * let b2 = createButton('2'); - * b2.position(0, 30); - * let b3 = createButton('3'); - * b3.position(0, 60); - * - * // Add a class attribute to each button. - * b1.class('btn'); - * b2.class('btn btn-pink'); - * b3.class('btn'); - * - * // Select the buttons by their class. - * let buttons = selectAll('.btn'); - * let pinkButtons = selectAll('.btn-pink'); - * - * // Style the selected buttons. - * buttons.forEach(btn => { - * btn.style('font-family', 'Comic Sans MS'); - * }); - * - * pinkButtons.forEach(btn => { - * btn.style('background', 'deeppink'); - * btn.style('color', 'white'); - * }); - * - * describe('Three buttons stacked vertically. The buttons are labeled, "1", "2", and "3". Buttons "1" and "3" are gray. Button "2" is pink.'); - * } - * - *
                                  - */ - _main.default.prototype.selectAll = function (e, p) { - _main.default._validateParameters("selectAll", arguments); - var arr = []; - var container = this._getContainer(p); - var res = container.querySelectorAll(e); - if (res) { - for (var j = 0; j < res.length; j++) { - var obj = this._wrapElement(res[j]); - arr.push(obj); - } - } - return arr; - }; - /** - * Helper function for select and selectAll - */ - _main.default.prototype._getContainer = function (p) { - var container = document; - if (typeof p === "string") { - container = document.querySelector(p) || document; - } else if (p instanceof _main.default.Element) { - container = p.elt; - } else if (p instanceof HTMLElement) { - container = p; - } - return container; - }; - /** - * Helper function for getElement and getElements. - */ - _main.default.prototype._wrapElement = function (elt) { - var children = Array.prototype.slice.call(elt.children); - if (elt.tagName === "INPUT" && elt.type === "checkbox") { - var converted = new _main.default.Element(elt, this); - converted.checked = function () { - if (arguments.length === 0) { - return this.elt.checked; - } else if (arguments.length <= 0 ? undefined : arguments[0]) { - this.elt.checked = true; - } else { - this.elt.checked = false; - } - return this; - }; - return converted; - } else if (elt.tagName === "VIDEO" || elt.tagName === "AUDIO") { - return new _main.default.MediaElement(elt, this); - } else if (elt.tagName === "SELECT") { - return this.createSelect(new _main.default.Element(elt, this)); - } else if ( - children.length > 0 && - children.every(function (c) { - return c.tagName === "INPUT" || c.tagName === "LABEL"; - }) - ) { - return this.createRadio(new _main.default.Element(elt, this)); - } else { - return new _main.default.Element(elt, this); - } - }; - /** - * Removes all elements created by p5.js, including any event handlers. - * There are two exceptions: - * canvas elements created by createCanvas - * and p5.Render objects created by - * createGraphics. - * - * @method removeElements - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * // Create a paragraph element and place - * // it in the middle of the canvas. - * let p = createP('p5*js'); - * p.position(25, 25); - * - * describe('A gray square with the text "p5*js" written in its center. The text disappears when the mouse is pressed.'); - * } - * - * function mousePressed() { - * removeElements(); - * } - * - *
                                  - * - *
                                  - * - * let slider; - * - * function setup() { - * createCanvas(100, 100); - * - * // Create a paragraph element and place - * // it at the top of the canvas. - * let p = createP('p5*js'); - * p.position(25, 25); - * - * // Create a slider element and place it - * // beneath the canvas. - * slider = createSlider(0, 255, 200); - * slider.position(0, 100); - * - * describe('A gray square with the text "p5*js" written in its center and a range slider beneath it. The square changes color when the slider is moved. The text and slider disappear when the square is double-clicked.'); - * } - * - * function draw() { - * // Use the slider value to change the background color. - * let g = slider.value(); - * background(g); - * } - * - * function doubleClicked() { - * removeElements(); - * } - * - *
                                  - */ - _main.default.prototype.removeElements = function (e) { - _main.default._validateParameters("removeElements", arguments); - // el.remove splices from this._elements, so don't mix iteration with it - var isNotCanvasElement = function isNotCanvasElement(el) { - return !(el.elt instanceof HTMLCanvasElement); - }; - var removeableElements = this._elements.filter(isNotCanvasElement); - removeableElements.map(function (el) { - return el.remove(); - }); - }; - /** - * `myElement.changed()` sets a function to call when the value of the - * p5.Element object changes. Calling - * `myElement.changed(false)` disables the function. - * - * @method changed - * @param {Function|Boolean} fxn function to call when the element changes. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a dropdown menu and add a few color options. - * let drop = createSelect(); - * drop.position(0, 0); - * drop.option('red'); - * drop.option('green'); - * drop.option('blue'); - * - * // When the color option changes, paint the background with - * // that color. - * drop.changed(() => { - * let c = drop.value(); - * background(c); - * }); - * - * describe('A gray square with a dropdown menu at the top. The square changes color when an option is selected.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create a checkbox and place it beneath the canvas. - * let checkbox = createCheckbox(' circle'); - * checkbox.position(0, 100); - * - * // When the checkbox changes, paint the background gray - * // and determine whether to draw a circle. - * checkbox.changed(() => { - * background(200); - * if (checkbox.checked() === true) { - * circle(50, 50, 30); - * } - * }); - * - * describe('A gray square with a checkbox underneath it that says "circle". A white circle appears when the box is checked and disappears otherwise.'); - * } - * - *
                                  - */ - _main.default.Element.prototype.changed = function (fxn) { - _main.default.Element._adjustListener("change", fxn, this); - return this; - }; - /** - * `myElement.input()` sets a function to call when input is detected within - * the p5.Element object. It's often used to with - * text inputs and sliders. Calling `myElement.input(false)` disables the - * function. - * - * @method input - * @param {Function|Boolean} fxn function to call when input is detected within - * the element. - * `false` disables the function. - * @chainable - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a slider and place it beneath the canvas. - * let slider = createSlider(0, 255, 200); - * slider.position(0, 100); - * - * // When the slider changes, use its value to paint - * // the background. - * slider.input(() => { - * let g = slider.value(); - * background(g); - * }); - * - * describe('A gray square with a range slider underneath it. The background changes shades of gray when the slider is moved.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create an input and place it beneath the canvas. - * let inp = createInput(''); - * inp.position(0, 100); - * - * // When input is detected, paint the background gray - * // and display the text. - * inp.input(() => { - * background(200); - * let msg = inp.value(); - * text(msg, 5, 50); - * }); - * - * describe('A gray square with a text input bar beneath it. Any text written in the input appears in the middle of the square.'); - * } - * - *
                                  - */ - _main.default.Element.prototype.input = function (fxn) { - _main.default.Element._adjustListener("input", fxn, this); - return this; - }; - /** - * Helpers for create methods. - */ - function addElement(elt, pInst, media) { - var node = pInst._userNode ? pInst._userNode : document.body; - node.appendChild(elt); - var c = media - ? new _main.default.MediaElement(elt, pInst) - : new _main.default.Element(elt, pInst); - pInst._elements.push(c); - return c; - } /** - * Creates a `<div></div>` element. It's commonly used as a - * container for other elements. - * - * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<div></div>`. - * - * @method createDiv - * @param {String} [html] inner HTML for the new `<div></div>` element. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * let div = createDiv('p5*js'); - * div.position(25, 35); - * - * describe('A gray square with the text "p5*js" written in its center.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create an h3 element within the div. - * let div = createDiv('

                                  p5*js

                                  '); - * div.position(20, 5); - * - * describe('A gray square with the text "p5*js" written in its center.'); - * } - *
                                  - *
                                  - */ - - _main.default.prototype.createDiv = function () { - var html = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : ""; - var elt = document.createElement("div"); - elt.innerHTML = html; - return addElement(elt, this); - }; - /** - * Creates a `<p></p>` element. It's commonly used for - * paragraph-length text. - * - * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<p></p>`. - * - * @method createP - * @param {String} [html] inner HTML for the new `<p></p>` element. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * let p = createP('Tell me a story.'); - * p.position(5, 0); - * - * describe('A gray square displaying the text "Tell me a story." written in black.'); - * } - * - *
                                  - */ - _main.default.prototype.createP = function () { - var html = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : ""; - var elt = document.createElement("p"); - elt.innerHTML = html; - return addElement(elt, this); - }; - /** - * Creates a `<span></span>` element. It's commonly used as a - * container for inline elements. For example, a `<span></span>` - * can hold part of a sentence that's a - * different style. - * - * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<span></span>`. - * - * @method createSpan - * @param {String} [html] inner HTML for the new `<span></span>` element. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a span element. - * let span = createSpan('p5*js'); - * span.position(25, 35); - * - * describe('A gray square with the text "p5*js" written in its center.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create a div element as - * // a container. - * let div = createDiv(); - * // Place the div at the - * // center. - * div.position(25, 35); - * - * // Create a span element. - * let s1 = createSpan('p5'); - * // Create a second span element. - * let s2 = createSpan('*'); - * // Set the span's font color. - * s2.style('color', 'deeppink'); - * // Create a third span element. - * let s3 = createSpan('js'); - * - * // Add all the spans to the - * // container div. - * s1.parent(div); - * s2.parent(div); - * s3.parent(div); - * - * describe('A gray square with the text "p5*js" written in black at its center. The asterisk is pink.'); - * } - * - *
                                  - */ - _main.default.prototype.createSpan = function () { - var html = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : ""; - var elt = document.createElement("span"); - elt.innerHTML = html; - return addElement(elt, this); - }; - /** - * Creates an `<img>` element that can appear outside of the canvas. - * - * The first parameter, `src`, is a string with the path to the image file. - * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as - * in `'https://example.com/image.png'`. - * - * The second parameter, `alt`, is a string with the - * alternate text - * for the image. An empty string `''` can be used for images that aren't displayed. - * - * The third parameter, `crossOrigin`, is optional. It's a string that sets the - * crossOrigin property - * of the image. Use `'anonymous'` or `'use-credentials'` to fetch the image - * with cross-origin access. - * - * The fourth parameter, `callback`, is also optional. It sets a function to - * call after the image loads. The new image is passed to the callback - * function as a p5.Element object. - * - * @method createImg - * @param {String} src relative path or URL for the image. - * @param {String} alt alternate text for the image. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * let img = createImg( - * 'https://p5js.org/assets/img/asterisk-01.png', - * 'The p5.js magenta asterisk.' - * ); - * img.position(0, -10); - * - * describe('A gray square with a magenta asterisk in its center.'); - * } - * - *
                                  - */ - /** - * @method createImg - * @param {String} src - * @param {String} alt - * @param {String} [crossOrigin] crossOrigin property to use when fetching the image. - * @param {Function} [successCallback] function to call once the image loads. The new image will be passed - * to the function as a p5.Element object. - * @return {p5.Element} new p5.Element object. - */ - _main.default.prototype.createImg = function () { - _main.default._validateParameters("createImg", arguments); - var elt = document.createElement("img"); - var args = arguments; - var self; - if (args.length > 1 && typeof args[1] === "string") { - elt.alt = args[1]; - } - if (args.length > 2 && typeof args[2] === "string") { - elt.crossOrigin = args[2]; - } - elt.src = args[0]; - self = addElement(elt, this); - elt.addEventListener("load", function () { - self.width = elt.offsetWidth || elt.width; - self.height = elt.offsetHeight || elt.height; - var last = args[args.length - 1]; - if (typeof last === "function") last(self); - }); - return self; - }; - /** - * Creates an `<a></a>` element that links to another web page. - * - * The first parmeter, `href`, is a string that sets the URL of the linked - * page. - * - * The second parameter, `html`, is a string that sets the inner HTML of the - * link. It's common to use text, images, or buttons as links. - * - * The third parameter, `target`, is optional. It's a string that tells the - * web browser where to open the link. By default, links open in the current - * browser tab. Passing `'_blank'` will cause the link to open in a new - * browser tab. MDN describes a few - * other options. - * - * @method createA - * @param {String} href URL of linked page. - * @param {String} html inner HTML of link element to display. - * @param {String} [target] target where the new link should open, - * either `'_blank'`, `'_self'`, `'_parent'`, or `'_top'`. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create an anchor element that links to p5js.org. - * let a = createA('http://p5js.org/', 'p5*js'); - * a.position(25, 35); - * - * describe('The text "p5*js" written at the center of a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create an anchor element that links to p5js.org. - * // Open the link in a new tab. - * let a = createA('http://p5js.org/', 'p5*js', '_blank'); - * a.position(25, 35); - * - * describe('The text "p5*js" written at the center of a gray square.'); - * } - * - *
                                  - */ - _main.default.prototype.createA = function (href, html, target) { - _main.default._validateParameters("createA", arguments); - var elt = document.createElement("a"); - elt.href = href; - elt.innerHTML = html; - if (target) elt.target = target; - return addElement(elt, this); - }; - /** INPUT **/ - /** - * Creates a slider `<input></input>` element. Range sliders are - * useful for quickly selecting numbers from a given range. - * - * The first two parameters, `min` and `max`, are numbers that set the - * slider's minimum and maximum. - * - * The third parameter, `value`, is optional. It's a number that sets the - * slider's default value. - * - * The fourth parameter, `step`, is also optional. It's a number that sets the - * spacing between each value in the slider's range. Setting `step` to 0 - * allows the slider to move smoothly from `min` to `max`. - * - * @method createSlider - * @param {Number} min minimum value of the slider. - * @param {Number} max maximum value of the slider. - * @param {Number} [value] default value of the slider. - * @param {Number} [step] size for each step in the slider's range. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * slider = createSlider(0, 255); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A dark gray square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                                  - * - *
                                  - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * // Set its default value to 0. - * slider = createSlider(0, 255, 0); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                                  - * - *
                                  - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * // Set its default value to 0. - * // Set its step size to 50. - * slider = createSlider(0, 255, 0, 50); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                                  - * - *
                                  - * - * let slider; - * - * function setup() { - * // Create a slider and place it at the top of the canvas. - * // Set its default value to 0. - * // Set its step size to 0 so that it moves smoothly. - * slider = createSlider(0, 255, 0, 0); - * slider.position(10, 10); - * slider.size(80); - * - * describe('A black square with a range slider at the top. The square changes color when the slider is moved.'); - * } - * - * function draw() { - * // Use the slider as a grayscale value. - * let g = slider.value(); - * background(g); - * } - * - *
                                  - */ - _main.default.prototype.createSlider = function ( - min, - max, - value, - step, - ) { - _main.default._validateParameters("createSlider", arguments); - var elt = document.createElement("input"); - elt.type = "range"; - elt.min = min; - elt.max = max; - if (step === 0) { - elt.step = 1e-18; // smallest valid step - } else if (step) { - elt.step = step; - } - if (typeof value === "number") elt.value = value; - return addElement(elt, this); - }; - /** - * Creates a `<button></button>` element. - * - * The first parameter, `label`, is a string that sets the label displayed on - * the button. - * - * The second parameter, `value`, is optional. It's a string that sets the - * button's value. See - * MDN - * for more details. - * - * @method createButton - * @param {String} label label displayed on the button. - * @param {String} [value] value of the button. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a button and place it beneath the canvas. - * let button = createButton('click me'); - * button.position(0, 100); - * - * // Use the button to change the background color. - * button.mousePressed(() => { - * let g = random(255); - * background(g); - * }); - * - * describe('A gray square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); - * } - * - *
                                  - * - *
                                  - * - * let button; - * - * function setup() { - * // Create a button and set its value to 0. - * // Place the button beneath the canvas. - * button = createButton('click me', 'red'); - * button.position(0, 100); - * - * // Change the button's value when the mouse - * // is pressed. - * button.mousePressed(() => { - * let c = random(['red', 'green', 'blue', 'yellow']); - * button.value(c); - * }); - * - * describe('A red square with a button that says "click me" beneath it. The square changes color when the button is clicked.'); - * } - * - * function draw() { - * // Use the button's value to set the background color. - * let c = button.value(); - * background(c); - * } - * - *
                                  - */ - _main.default.prototype.createButton = function (label, value) { - _main.default._validateParameters("createButton", arguments); - var elt = document.createElement("button"); - elt.innerHTML = label; - if (value) elt.value = value; - return addElement(elt, this); - }; - /** - * Creates a checkbox `<input></input>` element. Checkboxes extend - * the p5.Element class with a `checked()` method. - * Calling `myBox.checked()` returns `true` if it the box is checked and - * `false` otherwise. - * - * The first parameter, `label`, is optional. It's a string that sets the label - * to display next to the checkbox. - * - * The second parameter, `value`, is also optional. It's a boolean that sets the - * checkbox's value. - * - * @method createCheckbox - * @param {String} [label] label displayed after the checkbox. - * @param {boolean} [value] value of the checkbox. Checked is `true` and unchecked is `false`. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * let checkbox; - * - * function setup() { - * // Create a checkbox and place it beneath the canvas. - * checkbox = createCheckbox(); - * checkbox.position(0, 100); - * - * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.'); - * } - * - * function draw() { - * // Use the checkbox to set the background color. - * if (checkbox.checked()) { - * background(255); - * } else { - * background(0); - * } - * } - * - *
                                  - * - *
                                  - * - * let checkbox; - * - * function setup() { - * // Create a checkbox and place it beneath the canvas. - * // Label the checkbox "white". - * checkbox = createCheckbox(' white'); - * checkbox.position(0, 100); - * - * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.'); - * } - * - * function draw() { - * // Use the checkbox to set the background color. - * if (checkbox.checked()) { - * background(255); - * } else { - * background(0); - * } - * } - * - *
                                  - * - *
                                  - * - * let checkbox; - * - * function setup() { - * // Create a checkbox and place it beneath the canvas. - * // Label the checkbox "white" and set its value to true. - * checkbox = createCheckbox(' white', true); - * checkbox.position(0, 100); - * - * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.'); - * } - * - * function draw() { - * // Use the checkbox to set the background color. - * if (checkbox.checked()) { - * background(255); - * } else { - * background(0); - * } - * } - * - *
                                  - */ - _main.default.prototype.createCheckbox = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("createCheckbox", args); - // Create a container element - var elt = document.createElement("div"); - // Create checkbox type input element - var checkbox = document.createElement("input"); - checkbox.type = "checkbox"; - // Create label element and wrap it around checkbox - var label = document.createElement("label"); - label.appendChild(checkbox); - // Append label element inside the container - elt.appendChild(label); - //checkbox must be wrapped in p5.Element before label so that label appears after - var self = addElement(elt, this); - self.checked = function () { - var cb = - self.elt.firstElementChild.getElementsByTagName("input")[0]; - if (cb) { - if (arguments.length === 0) { - return cb.checked; - } else if (arguments.length <= 0 ? undefined : arguments[0]) { - cb.checked = true; - } else { - cb.checked = false; - } - } - return self; - }; - this.value = function (val) { - self.value = val; - return this; - }; - // Set the span element innerHTML as the label value if passed - if (args[0]) { - self.value(args[0]); - var span = document.createElement("span"); - span.innerHTML = args[0]; - label.appendChild(span); - } // Set the checked value of checkbox if passed - - if (args[1]) { - checkbox.checked = true; - } - return self; - }; - /** - * Creates a dropdown menu `<select></select>` element. - * - * The parameter is optional. If `true` is passed, as in - * `let mySelect = createSelect(true)`, then the dropdown will support - * multiple selections. If an existing `<select></select>` element - * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing - * element will be wrapped in a new p5.Element - * object. - * - * Dropdowns extend the p5.Element class with a few - * helpful methods for managing options: - * - `mySelect.option(name, [value])` adds an option to the menu. The first paremeter, `name`, is a string that sets the option's name and value. The second parameter, `value`, is optional. If provided, it sets the value that corresponds to the key `name`. If an option with `name` already exists, its value is changed to `value`. - * - `mySelect.value()` returns the currently-selected option's value. - * - `mySelect.selected()` returns the currently-selected option. - * - `mySelect.selected(option)` selects the given option by default. - * - `mySelect.disable()` marks the whole dropdown element as disabled. - * - `mySelect.disable(option)` marks a given option as disabled. - * - `mySelect.enable()` marks the whole dropdown element as enabled. - * - `mySelect.enable(option)` marks a given option as enabled. - * - * @method createSelect - * @param {boolean} [multiple] support multiple selections. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * let mySelect; - * - * function setup() { - * // Create a dropdown and place it beneath the canvas. - * mySelect = createSelect(); - * mySelect.position(0, 100); - * - * // Add color options. - * mySelect.option('red'); - * mySelect.option('green'); - * mySelect.option('blue'); - * mySelect.option('yellow'); - * - * // Set the selected option to "red". - * mySelect.selected('red'); - * - * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); - * } - * - * function draw() { - * // Use the selected value to paint the background. - * let c = mySelect.selected(); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * let mySelect; - * - * function setup() { - * // Create a dropdown and place it beneath the canvas. - * mySelect = createSelect(); - * mySelect.position(0, 100); - * - * // Add color options. - * mySelect.option('red'); - * mySelect.option('green'); - * mySelect.option('blue'); - * mySelect.option('yellow'); - * - * // Set the selected option to "red". - * mySelect.selected('red'); - * - * // Disable the "yellow" option. - * mySelect.disable('yellow'); - * - * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); - * } - * - * function draw() { - * // Use the selected value to paint the background. - * let c = mySelect.selected(); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * let mySelect; - * - * function setup() { - * // Create a dropdown and place it beneath the canvas. - * mySelect = createSelect(); - * mySelect.position(0, 100); - * - * // Add color options with names and values. - * mySelect.option('one', 'red'); - * mySelect.option('two', 'green'); - * mySelect.option('three', 'blue'); - * mySelect.option('four', 'yellow'); - * - * // Set the selected option to "one". - * mySelect.selected('one'); - * - * describe('A red square with a dropdown menu beneath it. The square changes color when a new color is selected.'); - * } - * - * function draw() { - * // Use the selected value to paint the background. - * let c = mySelect.selected(); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * // Hold CTRL to select multiple options on Windows and Linux. - * // Hold CMD to select multiple options on macOS. - * let mySelect; - * - * function setup() { - * // Create a dropdown and allow multiple selections. - * // Place it beneath the canvas. - * mySelect = createSelect(true); - * mySelect.position(0, 100); - * - * // Add color options. - * mySelect.option('red'); - * mySelect.option('green'); - * mySelect.option('blue'); - * mySelect.option('yellow'); - * - * describe('A gray square with a dropdown menu beneath it. Colorful circles appear when their color is selected.'); - * } - * - * function draw() { - * background(200); - * - * // Use the selected value(s) to draw circles. - * let colors = mySelect.selected(); - * colors.forEach((c, index) => { - * let x = 10 + index * 20; - * fill(c); - * circle(x, 50, 20); - * }); - * } - * - *
                                  - */ - /** - * @method createSelect - * @param {Object} existing select element to wrap, either as a p5.Element or - * a HTMLSelectElement. - * @return {p5.Element} - */ - _main.default.prototype.createSelect = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("createSelect", args); - var self; - var arg = args[0]; - if ( - arg instanceof _main.default.Element && - arg.elt instanceof HTMLSelectElement - ) { - // If given argument is p5.Element of select type - self = arg; - this.elt = arg.elt; - } else if (arg instanceof HTMLSelectElement) { - self = addElement(arg, this); - this.elt = arg; - } else { - var elt = document.createElement("select"); - if (arg && typeof arg === "boolean") { - elt.setAttribute("multiple", "true"); - } - self = addElement(elt, this); - this.elt = elt; - } - self.option = function (name, value) { - var index; - // if no name is passed, return - if (name === undefined) { - return; - } //see if there is already an option with this name - - for (var i = 0; i < this.elt.length; i += 1) { - if (this.elt[i].textContent === name) { - index = i; - break; - } - } //if there is an option with this name we will modify it - - if (index !== undefined) { - //if the user passed in false then delete that option - if (value === false) { - this.elt.remove(index); - } else { - // Update the option at index with the value - this.elt[index].value = value; - } - } else { - //if it doesn't exist create it - var opt = document.createElement("option"); - opt.textContent = name; - opt.value = value === undefined ? name : value; - this.elt.appendChild(opt); - this._pInst._elements.push(opt); - } - }; - self.selected = function (value) { - // Update selected status of option - if (value !== undefined) { - for (var i = 0; i < this.elt.length; i += 1) { - if (this.elt[i].value.toString() === value.toString()) { - this.elt.selectedIndex = i; - } - } - return this; - } else { - if (this.elt.getAttribute("multiple")) { - var arr = []; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = - this.elt.selectedOptions[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var selectedOption = _step.value; - arr.push(selectedOption.value); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return arr; - } else { - return this.elt.value; - } - } - }; - self.disable = function (value) { - if (typeof value === "string") { - for (var i = 0; i < this.elt.length; i++) { - if (this.elt[i].value.toString() === value) { - this.elt[i].disabled = true; - this.elt[i].selected = false; - } - } - } else { - this.elt.disabled = true; - } - return this; - }; - self.enable = function (value) { - if (typeof value === "string") { - for (var i = 0; i < this.elt.length; i++) { - if (this.elt[i].value.toString() === value) { - this.elt[i].disabled = false; - this.elt[i].selected = false; - } - } - } else { - this.elt.disabled = false; - for (var _i = 0; _i < this.elt.length; _i++) { - this.elt[_i].disabled = false; - this.elt[_i].selected = false; - } - } - return this; - }; - return self; - }; - /** - * Creates a radio button element. - * - * The parameter is optional. If a string is passed, as in - * `let myRadio = createSelect('food')`, then each radio option will - * have `"food"` as its `name` parameter: `<input name="food"></input>`. - * If an existing `<div></div>` or `<span></span>` - * element is passed, as in `let myRadio = createSelect(container)`, it will - * become the radio button's parent element. - * - * Radio buttons extend the p5.Element class with a few - * helpful methods for managing options: - * - `myRadio.option(value, [label])` adds an option to the menu. The first paremeter, `value`, is a string that sets the option's value and label. The second parameter, `label`, is optional. If provided, it sets the label displayed for the `value`. If an option with `value` already exists, its label is changed and its value is returned. - * - `myRadio.value()` returns the currently-selected option's value. - * - `myRadio.selected()` returns the currently-selected option. - * - `myRadio.selected(value)` selects the given option and returns it as an `HTMLInputElement`. - * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed. - * - * @method createRadio - * @param {Object} [containerElement] container HTML Element, either a `<div></div>` - * or `<span></span>`. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * let myRadio; - * - * function setup() { - * // Create a radio button element and place it - * // in the top-left corner. - * myRadio = createRadio(); - * myRadio.position(0, 0); - * myRadio.size(60); - * - * // Add a few color options. - * myRadio.option('red'); - * myRadio.option('yellow'); - * myRadio.option('blue'); - * - * // Choose a default option. - * myRadio.selected('yellow'); - * - * describe('A yellow square with three color options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option.'); - * } - * - * function draw() { - * // Set the background color using the radio button. - * let g = myRadio.value(); - * background(g); - * } - * - *
                                  - * - *
                                  - * - * let myRadio; - * - * function setup() { - * // Create a radio button element and place it - * // in the top-left corner. - * myRadio = createRadio(); - * myRadio.position(0, 0); - * myRadio.size(50); - * - * // Add a few color options. - * // Color values are labeled with - * // emotions they evoke. - * myRadio.option('red', 'love'); - * myRadio.option('yellow', 'joy'); - * myRadio.option('blue', 'trust'); - * - * // Choose a default option. - * myRadio.selected('yellow'); - * - * describe('A yellow square with three options listed, "love", "joy", and "trust". The square changes color when the user selects a new option.'); - * } - * - * function draw() { - * // Set the background color using the radio button. - * let c = myRadio.value(); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * let myRadio; - * - * function setup() { - * // Create a radio button element and place it - * // in the top-left corner. - * myRadio = createRadio(); - * myRadio.position(0, 0); - * myRadio.size(50); - * - * // Add a few color options. - * myRadio.option('red'); - * myRadio.option('yellow'); - * myRadio.option('blue'); - * - * // Choose a default option. - * myRadio.selected('yellow'); - * - * // Create a button and place it beneath the canvas. - * let btn = createButton('disable'); - * btn.position(0, 100); - * - * // Use the button to disable the radio button. - * btn.mousePressed(() => { - * myRadio.disable(true); - * }); - * - * describe('A yellow square with three options listed, "red", "yellow", and "blue". The square changes color when the user selects a new option. A "disable" button beneath the canvas disables the color options when pressed.'); - * } - * - * function draw() { - * // Set the background color using the radio button. - * let c = myRadio.value(); - * background(c); - * } - * - *
                                  - */ - /** - * @method createRadio - * @param {String} [name] name parameter assigned to each option's `<input></input>` element. - * @return {p5.Element} new p5.Element object. - */ - /** - * @method createRadio - * @return {p5.Element} new p5.Element object. - */ - _main.default.prototype.createRadio = function () { - // Creates a div, adds each option as an individual input inside it. - // If already given with a containerEl, will search for all input[radio] - // it, create a p5.Element out of it, add options to it and return the p5.Element. - var self; - var radioElement; - var name; - var arg0 = arguments.length <= 0 ? undefined : arguments[0]; - if ( - arg0 instanceof _main.default.Element && - (arg0.elt instanceof HTMLDivElement || - arg0.elt instanceof HTMLSpanElement) - ) { - // If given argument is p5.Element of div/span type - self = arg0; - this.elt = arg0.elt; - } else if ( - // If existing radio Element is provided as argument 0 - arg0 instanceof HTMLDivElement || - arg0 instanceof HTMLSpanElement - ) { - self = addElement(arg0, this); - this.elt = arg0; - radioElement = arg0; - if ( - typeof (arguments.length <= 1 ? undefined : arguments[1]) === - "string" - ) - name = arguments.length <= 1 ? undefined : arguments[1]; - } else { - if (typeof arg0 === "string") name = arg0; - radioElement = document.createElement("div"); - self = addElement(radioElement, this); - this.elt = radioElement; - } - self._name = name || "radioOption"; - // setup member functions - var isRadioInput = function isRadioInput(el) { - return el instanceof HTMLInputElement && el.type === "radio"; - }; - var isLabelElement = function isLabelElement(el) { - return el instanceof HTMLLabelElement; - }; - var isSpanElement = function isSpanElement(el) { - return el instanceof HTMLSpanElement; - }; - self._getOptionsArray = function () { - return Array.from(this.elt.children) - .filter(function (el) { - return ( - isRadioInput(el) || - (isLabelElement(el) && isRadioInput(el.firstElementChild)) - ); - }) - .map(function (el) { - return isRadioInput(el) ? el : el.firstElementChild; - }); - }; - self.option = function (value, label) { - // return an option with this value, create if not exists. - var optionEl; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = self._getOptionsArray()[Symbol.iterator](), - _step2; - !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) - .done); - _iteratorNormalCompletion2 = true - ) { - var option = _step2.value; - if (option.value === value) { - optionEl = option; - break; - } - } // Create a new option, add it to radioElement and return it. - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - if (optionEl === undefined) { - optionEl = document.createElement("input"); - optionEl.setAttribute("type", "radio"); - optionEl.setAttribute("value", value); - } - optionEl.setAttribute("name", self._name); - // Check if label element exists, else create it - var labelElement; - if (!isLabelElement(optionEl.parentElement)) { - labelElement = document.createElement("label"); - labelElement.insertAdjacentElement("afterbegin", optionEl); - } else { - labelElement = optionEl.parentElement; - } // Check if span element exists, else create it - - var spanElement; - if (!isSpanElement(labelElement.lastElementChild)) { - spanElement = document.createElement("span"); - optionEl.insertAdjacentElement("afterend", spanElement); - } else { - spanElement = labelElement.lastElementChild; - } // Set the innerHTML of span element as the label text - - spanElement.innerHTML = label === undefined ? value : label; - // Append the label element, which includes option element and - // span element to the radio container element - this.elt.appendChild(labelElement); - return optionEl; - }; - self.remove = function (value) { - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = self._getOptionsArray()[Symbol.iterator](), - _step3; - !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) - .done); - _iteratorNormalCompletion3 = true - ) { - var optionEl = _step3.value; - if (optionEl.value === value) { - if (isLabelElement(optionEl.parentElement)) { - // Remove parent label which also removes children elements - optionEl.parentElement.remove(); - } else { - // Remove the option input if parent label does not exist - optionEl.remove(); - } - return; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion3 && - _iterator3.return != null - ) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - }; - self.value = function () { - var result = ""; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for ( - var _iterator4 = self._getOptionsArray()[Symbol.iterator](), - _step4; - !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()) - .done); - _iteratorNormalCompletion4 = true - ) { - var option = _step4.value; - if (option.checked) { - result = option.value; - break; - } - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion4 && - _iterator4.return != null - ) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - return result; - }; - self.selected = function (value) { - var result = null; - if (value === undefined) { - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - try { - for ( - var _iterator5 = self._getOptionsArray()[Symbol.iterator](), - _step5; - !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()) - .done); - _iteratorNormalCompletion5 = true - ) { - var option = _step5.value; - if (option.checked) { - result = option; - break; - } - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion5 && - _iterator5.return != null - ) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - } else { - // forEach loop to uncheck all radio buttons before - // setting any one as checked. - self._getOptionsArray().forEach(function (option) { - option.checked = false; - option.removeAttribute("checked"); - }); - var _iteratorNormalCompletion6 = true; - var _didIteratorError6 = false; - var _iteratorError6 = undefined; - try { - for ( - var _iterator6 = self._getOptionsArray()[Symbol.iterator](), - _step6; - !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()) - .done); - _iteratorNormalCompletion6 = true - ) { - var _option = _step6.value; - if (_option.value === value) { - _option.setAttribute("checked", true); - _option.checked = true; - result = _option; - } - } - } catch (err) { - _didIteratorError6 = true; - _iteratorError6 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion6 && - _iterator6.return != null - ) { - _iterator6.return(); - } - } finally { - if (_didIteratorError6) { - throw _iteratorError6; - } - } - } - } - return result; - }; - self.disable = function () { - var shouldDisable = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : true; - var _iteratorNormalCompletion7 = true; - var _didIteratorError7 = false; - var _iteratorError7 = undefined; - try { - for ( - var _iterator7 = self._getOptionsArray()[Symbol.iterator](), - _step7; - !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()) - .done); - _iteratorNormalCompletion7 = true - ) { - var radioInput = _step7.value; - radioInput.setAttribute("disabled", shouldDisable); - } - } catch (err) { - _didIteratorError7 = true; - _iteratorError7 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion7 && - _iterator7.return != null - ) { - _iterator7.return(); - } - } finally { - if (_didIteratorError7) { - throw _iteratorError7; - } - } - } - }; - return self; - }; - /** - * Creates a color picker element. - * - * The parameter, `value`, is optional. If a color string or - * p5.Color object is passed, it will set the default - * color. - * - * Color pickers extend the p5.Element class with a - * couple of helpful methods for managing colors: - * - `myPicker.value()` returns the current color as a hex string in the format `'#rrggbb'`. - * - `myPicker.color()` returns the current color as a p5.Color object. - * - * - * @method createColorPicker - * @param {String|p5.Color} [value] default color as a CSS color string. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * let myPicker; - * - * function setup() { - * myPicker = createColorPicker('deeppink'); - * myPicker.position(0, 100); - * - * describe('A pink square with a color picker beneath it. The square changes color when the user picks a new color.'); - * } - * - * function draw() { - * // Use the color picker to paint the background. - * let c = myPicker.color(); - * background(c); - * } - * - *
                                  - * - *
                                  - * - * let myPicker; - * - * function setup() { - * myPicker = createColorPicker('deeppink'); - * myPicker.position(0, 100); - * - * describe('A number with the format "#rrggbb" is displayed on a pink canvas. The background color and number change when the user picks a new color.'); - * } - * - * function draw() { - * // Use the color picker to paint the background. - * let c = myPicker.value(); - * background(c); - * - * // Display the current color as a hex string. - * text(c, 25, 55); - * } - * - *
                                  - */ - _main.default.prototype.createColorPicker = function (value) { - _main.default._validateParameters("createColorPicker", arguments); - var elt = document.createElement("input"); - var self; - elt.type = "color"; - if (value) { - if (value instanceof _main.default.Color) { - elt.value = value.toString("#rrggbb"); - } else { - _main.default.prototype._colorMode = "rgb"; - _main.default.prototype._colorMaxes = { - rgb: [255, 255, 255, 255], - hsb: [360, 100, 100, 1], - hsl: [360, 100, 100, 1], - }; - elt.value = _main.default.prototype - .color(value) - .toString("#rrggbb"); - } - } else { - elt.value = "#000000"; - } - self = addElement(elt, this); - // Method to return a p5.Color object for the given color. - self.color = function () { - if (value) { - if (value.mode) { - _main.default.prototype._colorMode = value.mode; - } - if (value.maxes) { - _main.default.prototype._colorMaxes = value.maxes; - } - } - return _main.default.prototype.color(this.elt.value); - }; - return self; - }; - /** - * Creates a text `<input></input>` element. Call `myInput.size()` - * to set the length of the text box. - * - * The first parameter, `value`, is optional. It's a string that sets the - * input's default value. The input is blank by default. - * - * The second parameter, `type`, is also optional. It's a string that - * specifies the type of text being input. See MDN for a full - * list of options. - * The default is `'text'`. - * - * @method createInput - * @param {String} [value] default value of the input box. Defaults to an empty string `''`. - * @param {String} [type] type of input. Defaults to `'text'`. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * let myInput; - * - * function setup() { - * // Create an input element and place it - * // beneath the canvas. - * myInput = createInput(); - * myInput.position(0, 100); - * - * describe('A gray square with a text box beneath it. The text in the square changes when the user types something new in the input bar.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input to display a message. - * let msg = myInput.value(); - * text(msg, 25, 55); - * } - * - *
                                  - * - *
                                  - * - * let myInput; - * - * function setup() { - * // Create an input element and place it - * // beneath the canvas. Set its default - * // text to "hello!". - * myInput = createInput('hello!'); - * myInput.position(0, 100); - * - * describe('The text "hello!" written at the center of a gray square. A text box beneath the square also says "hello!". The text in the square changes when the user types something new in the input bar.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input to display a message. - * let msg = myInput.value(); - * text(msg, 25, 55); - * } - * - *
                                  - */ - /** - * @method createInput - * @param {String} [value] - * @return {p5.Element} - */ - _main.default.prototype.createInput = function () { - var value = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : ""; - var type = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : "text"; - _main.default._validateParameters("createInput", arguments); - var elt = document.createElement("input"); - elt.setAttribute("value", value); - elt.setAttribute("type", type); - return addElement(elt, this); - }; - /** - * Creates an `<input></input>` element of type `'file'`. - * This allows users to select local files for use in a sketch. - * - * The first parameter, `callback`, is a function that's called when the file - * loads. The callback function should have one parameter, `file`, that's a - * p5.File object. - * - * The second parameter, `multiple`, is optional. It's a boolean value that - * allows loading multiple files if set to `true`. If `true`, `callback` - * will be called once per file. - * - * @method createFileInput - * @param {Function} callback function to call once the file loads. - * @param {Boolean} [multiple] allow multiple files to be selected. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * // Use the file input to select an image to - * // load and display. - * let input; - * let img; - * - * function setup() { - * // Create a file input and place it beneath - * // the canvas. - * input = createFileInput(handleImage); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); - * } - * - * function draw() { - * background(200); - * - * // Draw the image if loaded. - * if (img) { - * image(img, 0, 0, width, height); - * } - * } - * - * // Create an image if the file is an image. - * function handleImage(file) { - * if (file.type === 'image') { - * img = createImg(file.data, ''); - * img.hide(); - * } else { - * img = null; - * } - * } - * - *
                                  - * - *
                                  - * - * // Use the file input to select multiple images - * // to load and display. - * let input; - * let images = []; - * - * function setup() { - * // Create a file input and place it beneath - * // the canvas. Allow it to load multiple files. - * input = createFileInput(handleImage, true); - * input.position(0, 100); - * } - * - * function draw() { - * background(200); - * - * // Draw the images if loaded. Each image - * // is drawn 20 pixels lower than the - * // previous image. - * images.forEach((img, index) => { - * let y = index * 20; - * image(img, 0, y, width, height); - * }); - * - * describe('A gray square with a file input beneath it. If the user selects multiple image files to load, they are displayed on the square.'); - * } - * - * // Create an image if the file is an image, - * // then add it to the images array. - * function handleImage(file) { - * if (file.type === 'image') { - * let img = createImg(file.data, ''); - * img.hide(); - * images.push(img); - * } - * } - * - *
                                  - */ - _main.default.prototype.createFileInput = function (callback) { - var multiple = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : false; - _main.default._validateParameters("createFileInput", arguments); - var handleFileSelect = function handleFileSelect(event) { - var _iteratorNormalCompletion8 = true; - var _didIteratorError8 = false; - var _iteratorError8 = undefined; - try { - for ( - var _iterator8 = event.target.files[Symbol.iterator](), - _step8; - !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()) - .done); - _iteratorNormalCompletion8 = true - ) { - var file = _step8.value; - _main.default.File._load(file, callback); - } - } catch (err) { - _didIteratorError8 = true; - _iteratorError8 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion8 && - _iterator8.return != null - ) { - _iterator8.return(); - } - } finally { - if (_didIteratorError8) { - throw _iteratorError8; - } - } - } - }; - // If File API's are not supported, throw Error - if ( - !( - window.File && - window.FileReader && - window.FileList && - window.Blob - ) - ) { - console.log( - "The File APIs are not fully supported in this browser. Cannot create element.", - ); - return; - } - var fileInput = document.createElement("input"); - fileInput.setAttribute("type", "file"); - if (multiple) fileInput.setAttribute("multiple", true); - fileInput.addEventListener("change", handleFileSelect, false); - return addElement(fileInput, this); - }; - /** VIDEO STUFF **/ - // Helps perform similar tasks for media element methods. - function createMedia(pInst, type, src, callback) { - var elt = document.createElement(type); - // Create source elements from given sources - src = src || ""; - if (typeof src === "string") { - src = [src]; - } - var _iteratorNormalCompletion9 = true; - var _didIteratorError9 = false; - var _iteratorError9 = undefined; - try { - for ( - var _iterator9 = src[Symbol.iterator](), _step9; - !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()) - .done); - _iteratorNormalCompletion9 = true - ) { - var mediaSource = _step9.value; - var sourceEl = document.createElement("source"); - sourceEl.setAttribute("src", mediaSource); - elt.appendChild(sourceEl); - } // If callback is provided, attach to element - } catch (err) { - _didIteratorError9 = true; - _iteratorError9 = err; - } finally { - try { - if (!_iteratorNormalCompletion9 && _iterator9.return != null) { - _iterator9.return(); - } - } finally { - if (_didIteratorError9) { - throw _iteratorError9; - } - } - } - if (typeof callback === "function") { - var callbackHandler = function callbackHandler() { - callback(); - elt.removeEventListener("canplaythrough", callbackHandler); - }; - elt.addEventListener("canplaythrough", callbackHandler); - } - var mediaEl = addElement(elt, pInst, true); - mediaEl.loadedmetadata = false; - // set width and height onload metadata - elt.addEventListener("loadedmetadata", function () { - mediaEl.width = elt.videoWidth; - mediaEl.height = elt.videoHeight; - // set elt width and height if not set - if (mediaEl.elt.width === 0) mediaEl.elt.width = elt.videoWidth; - if (mediaEl.elt.height === 0) - mediaEl.elt.height = elt.videoHeight; - if (mediaEl.presetPlaybackRate) { - mediaEl.elt.playbackRate = mediaEl.presetPlaybackRate; - delete mediaEl.presetPlaybackRate; - } - mediaEl.loadedmetadata = true; - }); - return mediaEl; - } /** - * Creates a `<video>` element for simple audio/video playback. - * Returns a new p5.MediaElement object. - * - * Videos are shown by default. They can be hidden by calling `video.hide()` - * and drawn to the canvas using image(). - * - * The first parameter, `src`, is the path the video. If a single string is - * passed, as in `'assets/topsecret.mp4'`, a single video is loaded. An array - * of strings can be used to load the same video in different formats. For - * example, `['assets/topsecret.mp4', 'assets/topsecret.ogv', 'assets/topsecret.webm']`. - * This is useful for ensuring that the video can play across different browsers with - * different capabilities. See - * MDN - * for more information about supported formats. - * - * The second parameter, `callback`, is optional. It's a function to call once - * the video is ready to play. - * - * @method createVideo - * @param {String|String[]} src path to a video file, or an array of paths for - * supporting different browsers. - * @param {Function} [callback] function to call once the video is ready to play. - * @return {p5.MediaElement} new p5.MediaElement object. - * @example - *
                                  - * - * function setup() { - * noCanvas(); - * - * // Load a video and add it to the page. - * // Note: this may not work in some browsers. - * let video = createVideo('assets/small.mp4'); - * // Show the default video controls. - * video.showControls(); - * - * describe('A video of a toy robot with playback controls beneath it.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * noCanvas(); - * - * // Load a video and add it to the page. - * // Provide an array options for different file formats. - * let video = createVideo( - * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'] - * ); - * // Show the default video controls. - * video.showControls(); - * - * describe('A video of a toy robot with playback controls beneath it.'); - * } - * - *
                                  - * - *
                                  - * - * let video; - * - * function setup() { - * noCanvas(); - * - * // Load a video and add it to the page. - * // Provide an array options for different file formats. - * // Call mute() once the video loads. - * video = createVideo( - * ['assets/small.mp4', 'assets/small.ogv', 'assets/small.webm'], - * muteVideo - * ); - * // Show the default video controls. - * video.showControls(); - * - * describe('A video of a toy robot with playback controls beneath it.'); - * } - * - * // Mute the video once it loads. - * function muteVideo() { - * video.volume(0); - * } - * - *
                                  - */ - - _main.default.prototype.createVideo = function (src, callback) { - _main.default._validateParameters("createVideo", arguments); - return createMedia(this, "video", src, callback); - }; - /** AUDIO STUFF **/ - /** - * Creates a hidden `<audio>` element for simple audio playback. - * Returns a new p5.MediaElement object. - * - * The first parameter, `src`, is the path the video. If a single string is - * passed, as in `'assets/video.mp4'`, a single video is loaded. An array - * of strings can be used to load the same video in different formats. For - * example, `['assets/video.mp4', 'assets/video.ogv', 'assets/video.webm']`. - * This is useful for ensuring that the video can play across different - * browsers with different capabilities. See - * MDN - * for more information about supported formats. - * - * The second parameter, `callback`, is optional. It's a function to call once - * the audio is ready to play. - * - * @method createAudio - * @param {String|String[]} [src] path to an audio file, or an array of paths - * for supporting different browsers. - * @param {Function} [callback] function to call once the audio is ready to play. - * @return {p5.MediaElement} new p5.MediaElement object. - * @example - *
                                  - * - * function setup() { - * noCanvas(); - * - * // Load the audio. - * let beat = createAudio('assets/beat.mp3'); - * // Show the default audio controls. - * beat.showControls(); - * - * describe('An audio beat plays when the user double-clicks the square.'); - * } - * - *
                                  - */ - _main.default.prototype.createAudio = function (src, callback) { - _main.default._validateParameters("createAudio", arguments); - return createMedia(this, "audio", src, callback); - }; - /** CAMERA STUFF **/ - _main.default.prototype.VIDEO = "video"; - _main.default.prototype.AUDIO = "audio"; - // from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia - // Older browsers might not implement mediaDevices at all, so we set an empty object first - if (navigator.mediaDevices === undefined) { - navigator.mediaDevices = {}; - } // Some browsers partially implement mediaDevices. We can't just assign an object - // with getUserMedia as it would overwrite existing properties. - // Here, we will just add the getUserMedia property if it's missing. - - if (navigator.mediaDevices.getUserMedia === undefined) { - navigator.mediaDevices.getUserMedia = function (constraints) { - // First get ahold of the legacy getUserMedia, if present - var getUserMedia = - navigator.webkitGetUserMedia || navigator.mozGetUserMedia; - // Some browsers just don't implement it - return a rejected promise with an error - // to keep a consistent interface - if (!getUserMedia) { - return Promise.reject( - new Error("getUserMedia is not implemented in this browser"), - ); - } // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise - - return new Promise(function (resolve, reject) { - getUserMedia.call(navigator, constraints, resolve, reject); - }); - }; - } /** - * Creates a `<video>` element that "captures" the audio/video stream from - * the webcam and microphone. Returns a new - * p5.Element object. - * - * Videos are shown by default. They can be hidden by calling `capture.hide()` - * and drawn to the canvas using image(). - * - * The first parameter, `type`, is optional. It sets the type of capture to - * use. By default, `createCapture()` captures both audio and video. If `VIDEO` - * is passed, as in `createCapture(VIDEO)`, only video will be captured. - * If `AUDIO` is passed, as in `createCapture(AUDIO)`, only audio will be - * captured. A constraints object can also be passed to customize the stream. - * See the - * W3C documentation for possible properties. Different browsers support different - * properties. - * - * The second parameter, `callback`, is optional. It's a function to call once - * the capture is ready for use. The callback function should have one - * parameter, `stream`, that's a - * MediaStream object. - * - * Note: `createCapture()` only works when running a sketch locally or using HTTPS. Learn more - * here - * and here. - * - * @method createCapture - * @param {String|Constant|Object} [type] type of capture, either AUDIO or VIDEO, - * or a constraints object. Both video and audio - * audio streams are captured by default. - * @param {Function} [callback] function to call once the stream - * has loaded. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * noCanvas(); - * createCapture(VIDEO); - * - * describe('A video stream from the webcam.'); - * } - * - *
                                  - * - *
                                  - * - * let capture; - * - * function setup() { - * // Create the video capture and hide the element. - * capture = createCapture(VIDEO); - * capture.hide(); - * - * describe('A video stream from the webcam with inverted colors.'); - * } - * - * function draw() { - * // Draw the video capture within the canvas. - * image(capture, 0, 0, width, width * capture.height / capture.width); - * // Invert the colors in the stream. - * filter(INVERT); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(480, 120); - * - * // Create a constraints object. - * let constraints = { - * video: { - * mandatory: { - * minWidth: 1280, - * minHeight: 720 - * }, - * optional: [{ maxFrameRate: 10 }] - * }, - * audio: false - * }; - * - * // Create the video capture. - * createCapture(constraints); - * - * describe('A video stream from the webcam.'); - * } - * - *
                                  - */ - - _main.default.prototype.createCapture = function () { - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters("createCapture", args); - // return if getUserMedia is not supported by browser - if ( - !(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) - ) { - throw new DOMException( - "getUserMedia not supported in this browser", - ); - } - var useVideo = true; - var useAudio = true; - var constraints; - var callback; - for (var _i2 = 0, _args = args; _i2 < _args.length; _i2++) { - var arg = _args[_i2]; - if (arg === _main.default.prototype.VIDEO) useAudio = false; - else if (arg === _main.default.prototype.AUDIO) useVideo = false; - else if (_typeof(arg) === "object") constraints = arg; - else if (typeof arg === "function") callback = arg; - } - if (!constraints) - constraints = { - video: useVideo, - audio: useAudio, - }; - var domElement = document.createElement("video"); - // required to work in iOS 11 & up: - domElement.setAttribute("playsinline", ""); - navigator.mediaDevices.getUserMedia(constraints).then(function ( - stream, - ) { - try { - if ("srcObject" in domElement) { - domElement.srcObject = stream; - } else { - domElement.src = window.URL.createObjectURL(stream); - } - } catch (err) { - domElement.src = stream; - } - }, console.log); - var videoEl = addElement(domElement, this, true); - videoEl.loadedmetadata = false; - // set width and height onload metadata - domElement.addEventListener("loadedmetadata", function () { - domElement.play(); - if (domElement.width) { - videoEl.width = domElement.width; - videoEl.height = domElement.height; - } else { - videoEl.width = videoEl.elt.width = domElement.videoWidth; - videoEl.height = videoEl.elt.height = domElement.videoHeight; - } - videoEl.loadedmetadata = true; - if (callback) callback(domElement.srcObject); - }); - return videoEl; - }; - /** - * Creates a new p5.Element object. - * - * The first parameter, `tag`, is a string an HTML tag such as `'h5'`. - * - * The second parameter, `content`, is optional. It's a string that sets the - * HTML content to insert into the new element. New elements have no content - * by default. - * - * @method createElement - * @param {String} tag tag for the new element. - * @param {String} [content] HTML content to insert into the element. - * @return {p5.Element} new p5.Element object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create an h5 element with nothing in it. - * createElement('h5'); - * - * describe('A gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create an h5 element with the content - * // "p5*js". - * let h5 = createElement('h5', 'p5*js'); - * // Set the element's style and position. - * h5.style('color', 'deeppink'); - * h5.position(30, 15); - * - * describe('The text "p5*js" written in pink in the middle of a gray square.'); - * } - * - *
                                  - */ - _main.default.prototype.createElement = function (tag, content) { - _main.default._validateParameters("createElement", arguments); - var elt = document.createElement(tag); - if (typeof content !== "undefined") { - elt.innerHTML = content; - } - return addElement(elt, this); - }; - // ============================================================================= - // p5.Element additions - // ============================================================================= - /** - * - * Adds specified class to the element. - * - * @for p5.Element - * @method addClass - * @param {String} class name of class to add - * @chainable - * @example - *
                                  - * let div = createDiv('div'); - * div.addClass('myClass'); - *
                                  - */ - _main.default.Element.prototype.addClass = function (c) { - if (this.elt.className) { - if (!this.hasClass(c)) { - this.elt.className = this.elt.className + " " + c; - } - } else { - this.elt.className = c; - } - return this; - }; - /** - * - * Removes specified class from the element. - * - * @method removeClass - * @param {String} class name of class to remove - * @chainable - * @example - *
                                  - * // In this example, a class is set when the div is created - * // and removed when mouse is pressed. This could link up - * // with a CSS style rule to toggle style properties. - * - * let div; - * - * function setup() { - * div = createDiv('div'); - * div.addClass('myClass'); - * } - * - * function mousePressed() { - * div.removeClass('myClass'); - * } - *
                                  - */ - _main.default.Element.prototype.removeClass = function (c) { - // Note: Removing a class that does not exist does NOT throw an error in classList.remove method - this.elt.classList.remove(c); - return this; - }; - /** - * - * Checks if specified class is already applied to element. - * - * @method hasClass - * @returns {boolean} a boolean value if element has specified class - * @param c {String} class name of class to check - * @example - *
                                  - * let div; - * - * function setup() { - * div = createDiv('div'); - * div.addClass('show'); - * } - * - * function mousePressed() { - * if (div.hasClass('show')) { - * div.addClass('show'); - * } else { - * div.removeClass('show'); - * } - * } - *
                                  - */ - _main.default.Element.prototype.hasClass = function (c) { - return this.elt.classList.contains(c); - }; - /** - * - * Toggles element class. - * - * @method toggleClass - * @param c {String} class name to toggle - * @chainable - * @example - *
                                  - * let div; - * - * function setup() { - * div = createDiv('div'); - * div.addClass('show'); - * } - * - * function mousePressed() { - * div.toggleClass('show'); - * } - *
                                  - */ - _main.default.Element.prototype.toggleClass = function (c) { - // classList also has a toggle() method, but we cannot use that yet as support is unclear. - // See https://github.com/processing/p5.js/issues/3631 - // this.elt.classList.toggle(c); - if (this.elt.classList.contains(c)) { - this.elt.classList.remove(c); - } else { - this.elt.classList.add(c); - } - return this; - }; - /** - * - * Attaches the element as a child to the parent specified. - * Accepts either a string ID, DOM node, or p5.Element. - * If no argument is specified, an array of children DOM nodes is returned. - * - * @method child - * @returns {Node[]} an array of child nodes - * @example - *
                                  - * let div0 = createDiv('this is the parent'); - * let div1 = createDiv('this is the child'); - * div0.child(div1); // use p5.Element - *
                                  - *
                                  - * let div0 = createDiv('this is the parent'); - * let div1 = createDiv('this is the child'); - * div1.id('apples'); - * div0.child('apples'); // use id - *
                                  - *
                                  - * // this example assumes there is a div already on the page - * // with id "myChildDiv" - * let div0 = createDiv('this is the parent'); - * let elt = document.getElementById('myChildDiv'); - * div0.child(elt); // use element from page - *
                                  - */ - /** - * @method child - * @param {String|p5.Element} [child] the ID, DOM node, or p5.Element - * to add to the current element - * @chainable - */ - _main.default.Element.prototype.child = function (childNode) { - if (typeof childNode === "undefined") { - return this.elt.childNodes; - } - if (typeof childNode === "string") { - if (childNode[0] === "#") { - childNode = childNode.substring(1); - } - childNode = document.getElementById(childNode); - } else if (childNode instanceof _main.default.Element) { - childNode = childNode.elt; - } - if (childNode instanceof HTMLElement) { - this.elt.appendChild(childNode); - } - return this; - }; - /** - * Centers a p5.Element either vertically, horizontally, - * or both, relative to its parent or according to - * the body if the p5.Element has no parent. If no argument is passed - * the p5.Element is aligned both vertically and horizontally. - * - * @method center - * @param {String} [align] passing 'vertical', 'horizontal' aligns element accordingly - * @chainable - * - * @example - *
                                  - * function setup() { - * let div = createDiv('').size(10, 10); - * div.style('background-color', 'orange'); - * div.center(); - * } - *
                                  - */ - _main.default.Element.prototype.center = function (align) { - var style = this.elt.style.display; - var hidden = this.elt.style.display === "none"; - var parentHidden = this.parent().style.display === "none"; - var pos = { - x: this.elt.offsetLeft, - y: this.elt.offsetTop, - }; - if (hidden) this.show(); - if (parentHidden) this.parent().show(); - this.elt.style.display = "block"; - this.position(0, 0); - var wOffset = Math.abs( - this.parent().offsetWidth - this.elt.offsetWidth, - ); - var hOffset = Math.abs( - this.parent().offsetHeight - this.elt.offsetHeight, - ); - if (align === "both" || align === undefined) { - this.position( - wOffset / 2 + this.parent().offsetLeft, - hOffset / 2 + this.parent().offsetTop, - ); - } else if (align === "horizontal") { - this.position(wOffset / 2 + this.parent().offsetLeft, pos.y); - } else if (align === "vertical") { - this.position(pos.x, hOffset / 2 + this.parent().offsetTop); - } - this.style("display", style); - if (hidden) this.hide(); - if (parentHidden) this.parent().hide(); - return this; - }; - /** - * - * If an argument is given, sets the inner HTML of the element, - * replacing any existing HTML. If true is included as a second - * argument, HTML is appended instead of replacing existing HTML. - * If no arguments are given, returns - * the inner HTML of the element. - * - * @for p5.Element - * @method html - * @returns {String} the inner HTML of the element - * @example - *
                                  - * let div = createDiv('').size(100, 100); - * div.html('hi'); - *
                                  - *
                                  - * let div = createDiv('Hello ').size(100, 100); - * div.html('World', true); - *
                                  - */ - /** - * @method html - * @param {String} [html] the HTML to be placed inside the element - * @param {boolean} [append] whether to append HTML to existing - * @chainable - */ - _main.default.Element.prototype.html = function () { - if (arguments.length === 0) { - return this.elt.innerHTML; - } else if (arguments.length <= 1 ? undefined : arguments[1]) { - this.elt.insertAdjacentHTML( - "beforeend", - arguments.length <= 0 ? undefined : arguments[0], - ); - return this; - } else { - this.elt.innerHTML = - arguments.length <= 0 ? undefined : arguments[0]; - return this; - } - }; - /** - * - * Sets the position of the element. If no position type argument is given, the - * position will be relative to (0, 0) of the window. - * Essentially, this sets position:absolute and left and top - * properties of style. If an optional third argument specifying position type is given, - * the x and y-coordinates will be interpreted based on the positioning scheme. - * If no arguments given, the function returns the x and y position of the element. - * - * found documentation on how to be more specific with object type - * https://stackoverflow.com/questions/14714314/how-do-i-comment-object-literals-in-yuidoc - * - * @method position - * @returns {Object} object of form { x: 0, y: 0 } containing the position of the element in an object - * @example - *
                                  - * function setup() { - * let cnv = createCanvas(100, 100); - * // positions canvas 50px to the right and 100px - * // below upper left corner of the window - * cnv.position(50, 100); - * } - *
                                  - *
                                  - * function setup() { - * let cnv = createCanvas(100, 100); - * // positions canvas at upper left corner of the window - * // with a 'fixed' position type - * cnv.position(0, 0, 'fixed'); - * } - *
                                  - */ - /** - * @method position - * @param {Number} [x] x-position relative to upper left of window (optional) - * @param {Number} [y] y-position relative to upper left of window (optional) - * @param {String} [positionType] it can be static, fixed, relative, sticky, initial or inherit (optional) - * @chainable - */ - _main.default.Element.prototype.position = function () { - if (arguments.length === 0) { - return { - x: this.elt.offsetLeft, - y: this.elt.offsetTop, - }; - } else { - var positionType = "absolute"; - if ( - (arguments.length <= 2 ? undefined : arguments[2]) === - "static" || - (arguments.length <= 2 ? undefined : arguments[2]) === - "fixed" || - (arguments.length <= 2 ? undefined : arguments[2]) === - "relative" || - (arguments.length <= 2 ? undefined : arguments[2]) === - "sticky" || - (arguments.length <= 2 ? undefined : arguments[2]) === - "initial" || - (arguments.length <= 2 ? undefined : arguments[2]) === "inherit" - ) { - positionType = arguments.length <= 2 ? undefined : arguments[2]; - } - this.elt.style.position = positionType; - this.elt.style.left = - (arguments.length <= 0 ? undefined : arguments[0]) + "px"; - this.elt.style.top = - (arguments.length <= 1 ? undefined : arguments[1]) + "px"; - this.x = arguments.length <= 0 ? undefined : arguments[0]; - this.y = arguments.length <= 1 ? undefined : arguments[1]; - return this; - } - }; - /* Helper method called by p5.Element.style() */ - _main.default.Element.prototype._translate = function () { - this.elt.style.position = "absolute"; - // save out initial non-translate transform styling - var transform = ""; - if (this.elt.style.transform) { - transform = this.elt.style.transform.replace( - /translate3d\(.*\)/g, - "", - ); - transform = transform.replace(/translate[X-Z]?\(.*\)/g, ""); - } - if (arguments.length === 2) { - this.elt.style.transform = - "translate(" + - (arguments.length <= 0 ? undefined : arguments[0]) + - "px, " + - (arguments.length <= 1 ? undefined : arguments[1]) + - "px)"; - } else if (arguments.length > 2) { - this.elt.style.transform = - "translate3d(" + - (arguments.length <= 0 ? undefined : arguments[0]) + - "px," + - (arguments.length <= 1 ? undefined : arguments[1]) + - "px," + - (arguments.length <= 2 ? undefined : arguments[2]) + - "px)"; - if (arguments.length === 3) { - this.elt.parentElement.style.perspective = "1000px"; - } else { - this.elt.parentElement.style.perspective = - (arguments.length <= 3 ? undefined : arguments[3]) + "px"; - } - } // add any extra transform styling back on end - - this.elt.style.transform += transform; - return this; - }; - /* Helper method called by p5.Element.style() */ - _main.default.Element.prototype._rotate = function () { - // save out initial non-rotate transform styling - var transform = ""; - if (this.elt.style.transform) { - transform = this.elt.style.transform.replace( - /rotate3d\(.*\)/g, - "", - ); - transform = transform.replace(/rotate[X-Z]?\(.*\)/g, ""); - } - if (arguments.length === 1) { - this.elt.style.transform = - "rotate(" + - (arguments.length <= 0 ? undefined : arguments[0]) + - "deg)"; - } else if (arguments.length === 2) { - this.elt.style.transform = - "rotate(" + - (arguments.length <= 0 ? undefined : arguments[0]) + - "deg, " + - (arguments.length <= 1 ? undefined : arguments[1]) + - "deg)"; - } else if (arguments.length === 3) { - this.elt.style.transform = - "rotateX(" + - (arguments.length <= 0 ? undefined : arguments[0]) + - "deg)"; - this.elt.style.transform += - "rotateY(" + - (arguments.length <= 1 ? undefined : arguments[1]) + - "deg)"; - this.elt.style.transform += - "rotateZ(" + - (arguments.length <= 2 ? undefined : arguments[2]) + - "deg)"; - } // add remaining transform back on - - this.elt.style.transform += transform; - return this; - }; - /** - * Applies a style to an element by adding a - * CSS declaration. - * - * The first parameter, `property`, is a string. If the name of a style - * property is passed, as in `myElement.style('color')`, the method returns - * the current value as a string or `null` if it hasn't been set. If a - * `property:style` string is passed, as in - * `myElement.style('color:deeppink')`, the method sets `property` to - * `value`. - * - * The second parameter, `value`, is optional. It sets the property's value. - * `value` can be a string, as in - * `myElement.style('color', 'deeppink')`, or a - * p5.Color object, as in - * `myElement.style('color', myColor)`. - * - * @method style - * @param {String} property style property to set. - * @returns {String} value of the property. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a paragraph element and - * // set its font color to "deeppink". - * let p = createP('p5*js'); - * p.position(25, 20); - * p.style('color', 'deeppink'); - * - * describe('The text p5*js written in pink on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create a p5.Color object. - * let c = color('deeppink'); - * - * // Create a paragraph element and - * // set its font color using a - * // p5.Color object. - * let p = createP('p5*js'); - * p.position(25, 20); - * p.style('color', c); - * - * describe('The text p5*js written in pink on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create a paragraph element and - * // set its font color to "deeppink" - * // using property:value syntax. - * let p = createP('p5*js'); - * p.position(25, 20); - * p.style('color:deeppink'); - * - * describe('The text p5*js written in pink on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create an empty paragraph element - * // and set its font color to "deeppink". - * let p = createP(); - * p.position(5, 5); - * p.style('color', 'deeppink'); - * - * // Get the element's color as an - * // RGB color string. - * let c = p.style('color'); - * - * // Set the element's inner HTML - * // using the RGB color string. - * p.html(c); - * - * describe('The text "rgb(255, 20, 147)" written in pink on a gray background.'); - * } - * - *
                                  - */ - /** - * @method style - * @param {String} property - * @param {String|p5.Color} value value to assign to the property. - * @return {String} value of the property. - * @chainable - */ - _main.default.Element.prototype.style = function (prop, val) { - var self = this; - if (val instanceof _main.default.Color) { - val = - "rgba(" + - val.levels[0] + - "," + - val.levels[1] + - "," + - val.levels[2] + - "," + - val.levels[3] / 255 + - ")"; - } - if (typeof val === "undefined") { - if (prop.indexOf(":") === -1) { - // no value set, so assume requesting a value - var styles = window.getComputedStyle(self.elt); - var style = styles.getPropertyValue(prop); - return style; - } else { - // value set using `:` in a single line string - var attrs = prop.split(";"); - for (var i = 0; i < attrs.length; i++) { - var parts = attrs[i].split(":"); - if (parts[0] && parts[1]) { - this.elt.style[parts[0].trim()] = parts[1].trim(); - } - } - } - } else { - // input provided as key,val pair - this.elt.style[prop] = val; - if ( - prop === "width" || - prop === "height" || - prop === "left" || - prop === "top" - ) { - var _styles = window.getComputedStyle(self.elt); - var styleVal = _styles.getPropertyValue(prop); - var numVal = styleVal.replace(/[^\d.]/g, ""); - this[prop] = Math.round(parseFloat(numVal, 10)); - } - } - return this; - }; - /** - * Adds an - * attribute - * to the element. This method is useful for advanced tasks. - * - * Most commonly-used attributes, such as `id`, can be set with their - * dedicated methods. For example, `nextButton.id('next')` sets an element's - * `id` attribute. - * - * The first parameter, `attr`, is the attribute's name as a string. Calling - * `myElement.attribute('align')` returns the attribute's current value as a - * string or `null` if it hasn't been set. - * - * The second parameter, `value`, is optional. It's a string used to set the - * attribute's value. For example, calling - * `myElement.attribute('align', 'center')` sets the element's horizontal - * alignment to `center`. - * - * @method attribute - * @return {String} value of the attribute. - * - * @example - *
                                  - * - * function setup() { - * // Create a container div and - * // place it at the top-left - * // corner. - * let container = createDiv(); - * container.position(0, 0); - * - * // Create a paragraph element - * // and place it within the container. - * // Set its horizontal alignment to - * // "left". - * let p1 = createP('hi'); - * p1.parent(container); - * p1.attribute('align', 'left'); - * - * // Create a paragraph element - * // and place it within the container. - * // Set its horizontal alignment to - * // "center". - * let p2 = createP('hi'); - * p2.parent(container); - * p2.attribute('align', 'center'); - * - * // Create a paragraph element - * // and place it within the container. - * // Set its horizontal alignment to - * // "right". - * let p3 = createP('hi'); - * p3.parent(container); - * p3.attribute('align', 'right'); - * - * describe('A gray square with the text "hi" written on three separate lines, each placed further to the right.'); - * } - * - *
                                  - */ - /** - * @method attribute - * @param {String} attr attribute to set. - * @param {String} value value to assign to the attribute. - * @chainable - */ - _main.default.Element.prototype.attribute = function (attr, value) { - //handling for checkboxes and radios to ensure options get - //attributes not divs - if ( - this.elt.firstChild != null && - (this.elt.firstChild.type === "checkbox" || - this.elt.firstChild.type === "radio") - ) { - if (typeof value === "undefined") { - return this.elt.firstChild.getAttribute(attr); - } else { - for (var i = 0; i < this.elt.childNodes.length; i++) { - this.elt.childNodes[i].setAttribute(attr, value); - } - } - } else if (typeof value === "undefined") { - return this.elt.getAttribute(attr); - } else { - this.elt.setAttribute(attr, value); - return this; - } - }; - /** - * Removes an attribute from the element. - * - * The parameter `attr` is the attribute's name as a string. For example, - * calling `myElement.removeAttribute('align')` removes its `align` - * attribute if it's been set. - * - * @method removeAttribute - * @param {String} attr attribute to remove. - * @chainable - * - * @example - *
                                  - * - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element and place it - * // in the center of the canvas. - * // Set its "align" attribute to "center". - * p = createP('hi'); - * p.position(0, 20); - * p.attribute('align', 'center'); - * - * describe('The text "hi" written in black at the center of a gray square. The text moves to the left edge when double-clicked.'); - * } - * - * function doubleClicked() { - * p.removeAttribute('align'); - * } - * - *
                                  - */ - _main.default.Element.prototype.removeAttribute = function (attr) { - if ( - this.elt.firstChild != null && - (this.elt.firstChild.type === "checkbox" || - this.elt.firstChild.type === "radio") - ) { - for (var i = 0; i < this.elt.childNodes.length; i++) { - this.elt.childNodes[i].removeAttribute(attr); - } - } - this.elt.removeAttribute(attr); - return this; - }; - /** - * Returns or sets the element's value. - * - * Calling `myElement.value()` returns the element's current value. - * - * The parameter, `value`, is an optional number or string. If provided, - * as in `myElement.value(123)`, it's used to set the element's value. - * - * @method value - * @return {String|Number} value of the element. - * @example - *
                                  - * - * let inp; - * - * function setup() { - * // Create a text input and place it - * // beneath the canvas. Set its default - * // value to "hello". - * inp = createInput('hello'); - * inp.position(0, 100); - * - * describe('The text from an input box is displayed on a gray square.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input's value to display a message. - * let msg = inp.value(); - * text(msg, 0, 55); - * } - * - *
                                  - * - *
                                  - * - * let inp; - * - * function setup() { - * // Create a text input and place it - * // beneath the canvas. Set its default - * // value to "hello". - * inp = createInput('hello'); - * inp.position(0, 100); - * - * describe('The text from an input box is displayed on a gray square. The text resets to "hello" when the user double-clicks the square.'); - * } - * - * function draw() { - * background(200); - * - * // Use the input's value to display a message. - * let msg = inp.value(); - * text(msg, 0, 55); - * } - * - * // Reset the input's value. - * function doubleClicked() { - * inp.value('hello'); - * } - * - *
                                  - */ - /** - * @method value - * @param {String|Number} value - * @chainable - */ - _main.default.Element.prototype.value = function () { - if (arguments.length > 0) { - this.elt.value = arguments.length <= 0 ? undefined : arguments[0]; - return this; - } else { - if (this.elt.type === "range") { - return parseFloat(this.elt.value); - } else return this.elt.value; - } - }; - /** - * Shows the current element. - * - * @method show - * @chainable - * @example - *
                                  - * - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element and hide it. - * p = createP('p5*js'); - * p.position(10, 10); - * p.hide(); - * - * describe('A gray square. The text "p5*js" appears when the user double-clicks the square.'); - * } - * - * // Show the paragraph when double-clicked. - * function doubleClicked() { - * p.show(); - * } - * - *
                                  - */ - _main.default.Element.prototype.show = function () { - this.elt.style.display = "block"; - return this; - }; - /** - * Hides the current element. - * - * @method hide - * @chainable - * @example - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element. - * p = createP('p5*js'); - * p.position(10, 10); - * - * describe('The text "p5*js" at the center of a gray square. The text disappears when the user double-clicks the square.'); - * } - * - * // Hide the paragraph when double-clicked. - * function doubleClicked() { - * p.hide(); - * } - * - *
                                  - */ - _main.default.Element.prototype.hide = function () { - this.elt.style.display = "none"; - return this; - }; - /** - * Sets the element's width and height. - * - * Calling `myElement.size()` without an argument returns the element's size - * as an object with the properties `width` and `height`. For example, - * `{ width: 20, height: 10 }`. - * - * The first parameter, `width`, is optional. It's a number used to set the - * element's width. Calling `myElement.size(10)` - * - * The second parameter, 'height`, is also optional. It's a - * number used to set the element's height. For example, calling - * `myElement.size(20, 10)` sets the element's width to 20 pixels and height - * to 10 pixels. - * - * The constant `AUTO` can be used to adjust one dimension at a time while - * maintaining the aspect ratio, which is `width / height`. For example, - * consider an element that's 200 pixels wide and 100 pixels tall. Calling - * `myElement.size(20, AUTO)` sets the width to 20 pixels and height to 10 - * pixels. - * - * Note: In the case of elements that need to load data, such as images, wait - * to call `myElement.size()` until after the data loads. - * - * @method size - * @return {Object} width and height of the element in an object. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * // Create a pink div element and place it at - * // the top-left corner. - * let div = createDiv(); - * div.position(10, 10); - * div.style('background-color', 'deeppink'); - * - * // Set the div's width to 80 pixels and - * // height to 20 pixels. - * div.size(80, 20); - * - * describe('A gray square with a pink rectangle near its top.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Create a pink div element and place it at - * // the top-left corner. - * let div = createDiv(); - * div.position(10, 10); - * div.style('background-color', 'deeppink'); - * - * // Set the div's width to 80 pixels and - * // height to 40 pixels. - * div.size(80, 40); - * - * // Get the div's size as an object. - * let s = div.size(); - * // Write the div's dimensions. - * div.html(`${s.width} x ${s.height}`); - * - * describe('A gray square with a pink rectangle near its top. The text "80 x 40" is written within the rectangle.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * // Load an image of an astronaut on the moon - * // and place it at the top-left of the canvas. - * let img1 = createImg( - * 'assets/moonwalk.jpg', - * 'An astronaut walking on the moon', - * '' - * ); - * img1.position(0, 0); - * - * // Load an image of an astronaut on the moon - * // and place it at the top-left of the canvas. - * // Resize the image once it's loaded. - * let img2 = createImg( - * 'assets/moonwalk.jpg', - * 'An astronaut walking on the moon', - * '', - * () => { - * img2.size(50, AUTO); - * } - * ); - * img2.position(0, 0); - * - * describe('A gray square two copies of a space image at the top-left. The copy in front is smaller.'); - * } - * - *
                                  - */ - /** - * @method size - * @param {Number|Constant} w width of the element, either AUTO, or a number. - * @param {Number|Constant} [h] height of the element, either AUTO, or a number. - * @chainable - */ - _main.default.Element.prototype.size = function (w, h) { - if (arguments.length === 0) { - return { - width: this.elt.offsetWidth, - height: this.elt.offsetHeight, - }; - } else { - var aW = w; - var aH = h; - var AUTO = _main.default.prototype.AUTO; - if (aW !== AUTO || aH !== AUTO) { - if (aW === AUTO) { - aW = (h * this.width) / this.height; - } else if (aH === AUTO) { - aH = (w * this.height) / this.width; - } // set diff for cnv vs normal div - - if (this.elt instanceof HTMLCanvasElement) { - var j = {}; - var k = this.elt.getContext("2d"); - var prop; - for (prop in k) { - j[prop] = k[prop]; - } - this.elt.setAttribute( - "width", - aW * this._pInst._pixelDensity, - ); - this.elt.setAttribute( - "height", - aH * this._pInst._pixelDensity, - ); - this.elt.style.width = aW + "px"; - this.elt.style.height = aH + "px"; - this._pInst.scale( - this._pInst._pixelDensity, - this._pInst._pixelDensity, - ); - for (prop in j) { - this.elt.getContext("2d")[prop] = j[prop]; - } - } else { - this.elt.style.width = aW + "px"; - this.elt.style.height = aH + "px"; - this.elt.width = aW; - this.elt.height = aH; - } - this.width = this.elt.offsetWidth; - this.height = this.elt.offsetHeight; - if (this._pInst && this._pInst._curElement) { - // main canvas associated with p5 instance - if (this._pInst._curElement.elt === this.elt) { - this._pInst._setProperty("width", this.elt.offsetWidth); - this._pInst._setProperty("height", this.elt.offsetHeight); - } - } - } - return this; - } - }; - /** - * Removes the element, stops all audio/video streams, and removes all - * callback functions. - * - * @method remove - * @example - *
                                  - * - * let p; - * - * function setup() { - * background(200); - * - * // Create a paragraph element. - * p = createP('p5*js'); - * p.position(10, 10); - * - * describe('The text "p5*js" written at the center of a gray square. '); - * } - * - * // Remove the paragraph when double-clicked. - * function doubleClicked() { - * p.remove(); - * } - * - *
                                  - */ - _main.default.Element.prototype.remove = function () { - // stop all audios/videos and detach all devices like microphone/camera etc - // used as input/output for audios/videos. - if (this instanceof _main.default.MediaElement) { - this.stop(); - var sources = this.elt.srcObject; - if (sources !== null) { - var tracks = sources.getTracks(); - tracks.forEach(function (track) { - track.stop(); - }); - } - } // delete the reference in this._pInst._elements - - var index = this._pInst._elements.indexOf(this); - if (index !== -1) { - this._pInst._elements.splice(index, 1); - } // deregister events - - for (var ev in this._events) { - this.elt.removeEventListener(ev, this._events[ev]); - } - if (this.elt && this.elt.parentNode) { - this.elt.parentNode.removeChild(this.elt); - } - }; - /** - * Sets a function to call when the user drops a file on the element. - * - * The first parameter, `callback`, is a function to call once the file loads. - * The callback function should have one parameter, `file`, that's a - * p5.File object. If the user drops multiple files on - * the element, `callback`, is called once for each file. - * - * The second parameter, `fxn`, is a function to call when the browser detects - * one or more dropped files. The callback function should have one - * parameter, `event`, that's a - * DragEvent. - * - * @method drop - * @param {Function} callback called when a file loads. Called once for each file dropped. - * @param {Function} [fxn] called once when any files are dropped. - * @chainable - * @example - *
                                  - * - * // Drop an image on the canvas to view - * // this example. - * let img; - * - * function setup() { - * let c = createCanvas(100, 100); - * - * background(200); - * - * // Call a function when a file - * // dropped on the canvas has - * // loaded. - * c.drop(file => { - * // Remove the current image, if any. - * if (img) { - * img.remove(); - * } - * - * // Create an element with the - * // dropped file. - * img = createImg(file.data, ''); - * img.hide(); - * - * // Draw the image. - * image(img, 0, 0, width, height); - * }); - * - * describe('A gray square. When the user drops an image on the square, it is displayed.'); - * } - * - *
                                  - * - *
                                  - * - * // Drop an image on the canvas to view - * // this example. - * let img; - * let msg; - * - * function setup() { - * let c = createCanvas(100, 100); - * - * background(200); - * - * // Call functions when the user - * // drops a file on the canvas - * // and when the file loads. - * c.drop(handleFile, handleDrop); - * - * describe('A gray square. When the user drops an image on the square, it is displayed. The id attribute of canvas element is also displayed.'); - * } - * - * function handleFile(file) { - * // Remove the current image, if any. - * if (img) { - * img.remove(); - * } - * - * // Create an element with the - * // dropped file. - * img = createImg(file.data, ''); - * img.hide(); - * - * // Draw the image. - * image(img, 0, 0, width, height); - * } - * - * function handleDrop(event) { - * // Remove current paragraph, if any. - * if (msg) { - * msg.remove(); - * } - * - * // Use event to get the drop - * // target's id. - * let id = event.target.id; - * - * // Write the canvas' id - * // beneath it. - * msg = createP(id); - * msg.position(0, 100); - * - * // Set the font color - * // randomly for each drop. - * let c = random(['red', 'green', 'blue']); - * msg.style('color', c); - * msg.style('font-size', '12px'); - * } - * - *
                                  - */ - _main.default.Element.prototype.drop = function (callback, fxn) { - // Is the file stuff supported? - if ( - window.File && - window.FileReader && - window.FileList && - window.Blob - ) { - if (!this._dragDisabled) { - this._dragDisabled = true; - var preventDefault = function preventDefault(evt) { - evt.preventDefault(); - }; - // If you want to be able to drop you've got to turn off - // a lot of default behavior. - // avoid `attachListener` here, since it overrides other handlers. - this.elt.addEventListener("dragover", preventDefault); - // If this is a drag area we need to turn off the default behavior - this.elt.addEventListener("dragleave", preventDefault); - } // Deal with the files - - _main.default.Element._attachListener( - "drop", - function (evt) { - evt.preventDefault(); - // Call the second argument as a callback that receives the raw drop event - if (typeof fxn === "function") { - fxn.call(this, evt); - } // A FileList - - var files = evt.dataTransfer.files; - // Load each one and trigger the callback - var _iteratorNormalCompletion10 = true; - var _didIteratorError10 = false; - var _iteratorError10 = undefined; - try { - for ( - var _iterator10 = files[Symbol.iterator](), _step10; - !(_iteratorNormalCompletion10 = (_step10 = - _iterator10.next()).done); - _iteratorNormalCompletion10 = true - ) { - var f = _step10.value; - _main.default.File._load(f, callback); - } - } catch (err) { - _didIteratorError10 = true; - _iteratorError10 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion10 && - _iterator10.return != null - ) { - _iterator10.return(); - } - } finally { - if (_didIteratorError10) { - throw _iteratorError10; - } - } - } - }, - this, - ); - } else { - console.log( - "The File APIs are not fully supported in this browser.", - ); - } - return this; - }; - /** - * Turns p5.Element into a draggable item. If an argument is given, it will drag that p5.Element instead, ie. drag a entire GUI panel (parent container) with the panel's title bar. - * - * @method draggable - * @param {p5.Element} [elmnt] pass another p5.Element - * @chainable - * - * @example - *
                                  - * function setup() { - * createCanvas(100, 100); - * background(200); - * - * createDiv('Post-It') - * .position(5, 5) - * .size(75, 20) - * .style('font-size', '16px') - * .style('background', 'yellow') - * .style('color', '#000') - * .style('border', '1px solid #aaaa00') - * .style('padding', '5px') - * .draggable(); - * // .style('cursor', 'help') // override cursor - * - * let gui = createDiv('') - * .position(5, 40) - * .size(85, 50) - * .style('font-size', '16px') - * .style('background', 'yellow') - * .style('z-index', '100') - * .style('border', '1px solid #00aaaa'); - * - * createDiv('= PANEL =') - * .parent(gui) - * .style('background', 'cyan') - * .style('padding', '2px') - * .style('text-align', 'center') - * .draggable(gui); - * - * createSlider(0, 100, random(100)) - * .style('cursor', 'pointer') - * .size(80, 5) - * .parent(gui); - * } - *
                                  - */ - _main.default.Element.prototype.draggable = function (elmMove) { - var isTouch = "ontouchstart" in window; - var x = 0, - y = 0, - px = 0, - py = 0, - elmDrag, - dragMouseDownEvt = isTouch ? "touchstart" : "mousedown", - closeDragElementEvt = isTouch ? "touchend" : "mouseup", - elementDragEvt = isTouch ? "touchmove" : "mousemove"; - if (elmMove === undefined) { - elmMove = this.elt; - elmDrag = elmMove; - } else if (elmMove !== this.elt && elmMove.elt !== this.elt) { - elmMove = elmMove.elt; - elmDrag = this.elt; - } - elmDrag.addEventListener(dragMouseDownEvt, dragMouseDown, false); - elmDrag.style.cursor = "move"; - function dragMouseDown(e) { - e = e || window.event; - if (isTouch) { - var touches = e.changedTouches; - px = parseInt(touches[0].clientX); - py = parseInt(touches[0].clientY); - } else { - px = parseInt(e.clientX); - py = parseInt(e.clientY); - } - document.addEventListener( - closeDragElementEvt, - closeDragElement, - false, - ); - document.addEventListener(elementDragEvt, elementDrag, false); - return false; - } - function elementDrag(e) { - e = e || window.event; - if (isTouch) { - var touches = e.changedTouches; - x = px - parseInt(touches[0].clientX); - y = py - parseInt(touches[0].clientY); - px = parseInt(touches[0].clientX); - py = parseInt(touches[0].clientY); - } else { - x = px - parseInt(e.clientX); - y = py - parseInt(e.clientY); - px = parseInt(e.clientX); - py = parseInt(e.clientY); - } - elmMove.style.left = elmMove.offsetLeft - x + "px"; - elmMove.style.top = elmMove.offsetTop - y + "px"; - } - function closeDragElement() { - document.removeEventListener( - closeDragElementEvt, - closeDragElement, - false, - ); - document.removeEventListener(elementDragEvt, elementDrag, false); - } - return this; - }; - /*** SCHEDULE EVENTS ***/ - // Cue inspired by JavaScript setTimeout, and the - // Tone.js Transport Timeline Event, MIT License Yotam Mann 2015 tonejs.org - // eslint-disable-next-line no-unused-vars - var Cue = function Cue(callback, time, id, val) { - _classCallCheck(this, Cue); - this.callback = callback; - this.time = time; - this.id = id; - this.val = val; - }; // ============================================================================= - // p5.MediaElement additions - // ============================================================================= - /** - * A class to handle audio and video. - * - * `p5.MediaElement` extends p5.Element with - * methods to handle audio and video. `p5.MediaElement` objects are created by - * calling createVideo, - * createAudio, and - * createCapture. - * - * @class p5.MediaElement - * @constructor - * @param {String} elt DOM node that is wrapped - * @extends p5.Element - * @example - *
                                  - * - * let capture; - * - * function setup() { - * createCanvas(100, 100); - * - * // Create a p5.MediaElement using createCapture(). - * capture = createCapture(VIDEO); - * capture.hide(); - * } - * - * function draw() { - * // Display the video stream and invert the colors. - * image(capture, 0, 0, width, width * capture.height / capture.width); - * filter(INVERT); - * } - * - *
                                  - */ - var MediaElement = /*#__PURE__*/ (function (_p5$Element) { - _inherits(MediaElement, _p5$Element); - var _super = _createSuper(MediaElement); - function MediaElement(elt, pInst) { - var _this; - _classCallCheck(this, MediaElement); - _this = _super.call(this, elt, pInst); - var self = _assertThisInitialized(_this); - _this.elt.crossOrigin = "anonymous"; - _this._prevTime = 0; - _this._cueIDCounter = 0; - _this._cues = []; - _this.pixels = []; - _this._pixelsState = _assertThisInitialized(_this); - _this._pixelDensity = 1; - _this._modified = false; - // Media has an internal canvas that is used when drawing it to the main - // canvas. It will need to be updated each frame as the video itself plays. - // We don't want to update it every time we draw, however, in case the user - // has used load/updatePixels. To handle this, we record the frame drawn to - // the internal canvas so we only update it if the frame has changed. - _this._frameOnCanvas = -1; - /** - * Path to the media element's source as a string. - * - * @property src - * @return {String} src - * @example - *
                                  - * - * let beat; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "https://p5js.org/reference/assets/beat.mp3" written in black on a gray background.'); - * } - * - * function draw() { - * background(200); - * - * textWrap(CHAR); - * text(beat.src, 10, 10, 80, 80); - * } - * - *
                                  - */ - Object.defineProperty(self, "src", { - get: function get() { - var firstChildSrc = self.elt.children[0].src; - var srcVal = - self.elt.src === window.location.href ? "" : self.elt.src; - var ret = - firstChildSrc === window.location.href - ? srcVal - : firstChildSrc; - return ret; - }, - set: function set(newValue) { - for (var i = 0; i < self.elt.children.length; i++) { - self.elt.removeChild(self.elt.children[i]); - } - var source = document.createElement("source"); - source.src = newValue; - elt.appendChild(source); - self.elt.src = newValue; - self.modified = true; - }, - }); - // private _onended callback, set by the method: onended(callback) - self._onended = function () {}; - self.elt.onended = function () { - self._onended(self); - }; - return _this; - } /** - * Play audio or video from a media element. - * - * @method play - * @chainable - * @example - *
                                  - * - * let beat; - * - * function setup() { - * background(200); - * - * textAlign(CENTER); - * text('Click to play', 50, 50); - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks the square.'); - * } - * - * // Play the beat when the user - * // presses the mouse. - * function mousePressed() { - * beat.play(); - * } - * - *
                                  - */ - - _createClass(MediaElement, [ - { - key: "play", - value: function play() { - var _this2 = this; - if (this.elt.currentTime === this.elt.duration) { - this.elt.currentTime = 0; - } - var promise; - if (this.elt.readyState > 1) { - promise = this.elt.play(); - } else { - // in Chrome, playback cannot resume after being stopped and must reload - this.elt.load(); - promise = this.elt.play(); - } - if (promise && promise.catch) { - promise.catch(function (e) { - // if it's an autoplay failure error - if (e.name === "NotAllowedError") { - if (typeof IS_MINIFIED === "undefined") { - _main.default._friendlyAutoplayError(_this2.src); - } else { - console.error(e); - } - } else { - // any other kind of error - console.error( - "Media play method encountered an unexpected error", - e, - ); - } - }); - } - return this; - } /** - * Stops a media element and sets its current time to zero. Calling - * `media.play()` will restart playing audio/video from the beginning. - * - * @method stop - * @chainable - * @example - *
                                  - * - * let beat; - * let isStopped = true; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to start" written in black on a gray background. The beat starts or stops when the user presses the mouse.'); - * } - * - * function draw() { - * background(200); - * - * textAlign(CENTER); - * if (isStopped === true) { - * text('Click to start', 50, 50); - * } else { - * text('Click to stop', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isStopped === true) { - * // If the beat is stopped, - * // play it. - * beat.play(); - * isStopped = false; - * } else { - * // If the beat is playing, - * // stop it. - * beat.stop(); - * isStopped = true; - * } - * } - * - *
                                  - */, - }, - { - key: "stop", - value: function stop() { - this.elt.pause(); - this.elt.currentTime = 0; - return this; - } /** - * Pauses a media element. Calling `media.play()` will resume playing - * audio/video from the moment it paused. - * - * @method pause - * @chainable - * @example - *
                                  - * - * let beat; - * let isPaused = true; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to play" written in black on a gray background. The beat plays or pauses when the user clicks the square.'); - * } - * - * function draw() { - * background(200); - * - * // Display different instructions - * // based on playback. - * textAlign(CENTER); - * if (isPaused === true) { - * text('Click to play', 50, 50); - * } else { - * text('Click to pause', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isPaused === true) { - * // If the beat is paused, - * // play it. - * beat.play(); - * isPaused = false; - * } else { - * // If the beat is playing, - * // pause it. - * beat.pause(); - * isPaused = true; - * } - * } - * - *
                                  - */, - }, - { - key: "pause", - value: function pause() { - this.elt.pause(); - return this; - } /** - * Play the audio/video repeatedly in a loop. - * - * @method loop - * @chainable - * @example - *
                                  - * - * let beat; - * let isLooping = false; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to loop" written in black on a gray background. A beat plays repeatedly in a loop when the user clicks. The beat stops when the user clicks again.'); - * } - * - * function draw() { - * background(200); - * - * // Display different instructions - * // based on playback. - * textAlign(CENTER); - * if (isLooping === true) { - * text('Click to stop', 50, 50); - * } else { - * text('Click to loop', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isLooping === true) { - * // If the beat is looping, - * // stop it. - * beat.stop(); - * isLooping = false; - * } else { - * // If the beat is stopped, - * // loop it. - * beat.loop(); - * isLooping = true; - * } - * } - * - *
                                  - */, - }, - { - key: "loop", - value: function loop() { - this.elt.setAttribute("loop", true); - this.play(); - return this; - } /** - * Stops the audio/video from playing in a loop. It will stop when it - * reaches the end. - * - * @method noLoop - * @chainable - * @example - *
                                  - * - * let beat; - * let isPlaying = false; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * describe('The text "Click to play" written in black on a gray background. A beat plays when the user clicks. The beat stops when the user clicks again.'); - * } - * - * function draw() { - * background(200); - * - * // Display different instructions - * // based on playback. - * textAlign(CENTER); - * if (isPlaying === true) { - * text('Click to stop', 50, 50); - * } else { - * text('Click to play', 50, 50); - * } - * } - * - * // Adjust playback when the user - * // presses the mouse. - * function mousePressed() { - * if (isPlaying === true) { - * // If the beat is playing, - * // stop it. - * beat.stop(); - * isPlaying = false; - * } else { - * // If the beat is stopped, - * // play it. - * beat.play(); - * isPlaying = true; - * } - * } - * - *
                                  - */, - }, - { - key: "noLoop", - value: function noLoop() { - this.elt.removeAttribute("loop"); - return this; - } /** - * Sets up logic to check that autoplay succeeded. - * - * @method setupAutoplayFailDetection - * @private - */, - }, - { - key: "_setupAutoplayFailDetection", - value: function _setupAutoplayFailDetection() { - var _this3 = this; - var timeout = setTimeout(function () { - if (typeof IS_MINIFIED === "undefined") { - _main.default._friendlyAutoplayError(_this3.src); - } else { - console.error(e); - } - }, 500); - this.elt.addEventListener( - "play", - function () { - return clearTimeout(timeout); - }, - { - passive: true, - once: true, - }, - ); - } /** - * Sets the audio/video to play once it's loaded. - * - * The parameter, `shouldAutoplay`, is optional. Calling - * `media.autoplay()` without an argument causes the media to play - * automatically. If `true` is passed, as in `media.autoplay(true)`, the - * media will automatically play. If `false` is passed, as in - * `media.autoPlay(false)`, it won't play automatically. - * - * @method autoplay - * @param {Boolean} [shouldAutoplay] whether the element should autoplay. - * @chainable - * @example - *
                                  - * - * function setup() { - * noCanvas(); - * - * // Load a video and play it automatically. - * let video = createVideo('assets/fingers.mov', () => { - * video.autoplay(); - * video.size(100, 100); - * }); - * - * describe('A video of fingers walking on a treadmill.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * noCanvas(); - * - * // Load a video, but don't play it automatically. - * let video = createVideo('assets/fingers.mov', () => { - * video.autoplay(false); - * video.size(100, 100); - * }); - * - * // Play the video when the user clicks on it. - * video.mousePressed(() => { - * video.play(); - * }); - * - * describe('An image of fingers on a treadmill. They start walking when the user double-clicks on them.'); - * } - * - *
                                  - */, - }, - { - key: "autoplay", - value: function autoplay(val) { - var _this4 = this; - var oldVal = this.elt.getAttribute("autoplay"); - this.elt.setAttribute("autoplay", val); - // if we turned on autoplay - if (val && !oldVal) { - // bind method to this scope - var setupAutoplayFailDetection = - function setupAutoplayFailDetection() { - return _this4._setupAutoplayFailDetection(); - }; - // if media is ready to play, schedule check now - if (this.elt.readyState === 4) { - setupAutoplayFailDetection(); - } else { - // otherwise, schedule check whenever it is ready - this.elt.addEventListener( - "canplay", - setupAutoplayFailDetection, - { - passive: true, - once: true, - }, - ); - } - } - return this; - } /** - * Manages the audio/video volume. - * - * Calling `media.volume()` without an argument returns the current volume - * as a number in the range 0 (off) to 1 (maximum). - * - * The parameter, `val`, is optional. It's a number that sets the volume - * from 0 (off) to 1 (maximum). For example, calling `media.volume(0.5)` - * sets the volume to half of its maximum. - * - * @method volume - * @return {Number} current volume. - * - * @example - *
                                  - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "Volume: V" on a gray square with media controls beneath it. The number "V" oscillates between 0 and 1 as the music plays.'); - * } - * - * function draw() { - * background(200); - * - * // Produce a number between 0 and 1. - * let n = 0.5 * sin(frameCount * 0.01) + 0.5; - * // Use n to set the volume. - * dragon.volume(n); - * - * // Get the current volume - * // and display it. - * let v = dragon.volume(); - * // Round v to 1 decimal place - * // for display. - * v = round(v, 1); - * textAlign(CENTER); - * text(`Volume: ${v}`, 50, 50); - * } - * - *
                                  - */, - /** - * @method volume - * @param {Number} val volume between 0.0 and 1.0. - * @chainable - */ - }, - { - key: "volume", - value: function volume(val) { - if (typeof val === "undefined") { - return this.elt.volume; - } else { - this.elt.volume = val; - } - } /** - * Manages the audio/video playback speed. Calling `media.speed()` returns - * the current speed as a number. - * - * The parameter, `val`, is optional. It's a number that sets the playback - * speed. 1 plays the media at normal speed, 0.5 plays it at half speed, 2 - * plays it at double speed, and so on. -1 plays the media at normal speed - * in reverse. - * - * Note: Not all browsers support backward playback. Even if they do, - * playback might not be smooth. - * - * @method speed - * @return {Number} current playback speed. - * - * @example - *
                                  - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "Speed: S" on a gray square with media controls beneath it. The number "S" oscillates between 0 and 1 as the music plays.'); - * } - * - * function draw() { - * background(200); - * - * // Produce a number between 0 and 2. - * let n = sin(frameCount * 0.01) + 1; - * // Use n to set the playback speed. - * dragon.speed(n); - * - * // Get the current speed - * // and display it. - * let s = dragon.speed(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * textAlign(CENTER); - * text(`Speed: ${s}`, 50, 50); - * } - * - */, - /** - * @method speed - * @param {Number} speed speed multiplier for playback. - * @chainable - */ - }, - { - key: "speed", - value: function speed(val) { - if (typeof val === "undefined") { - return this.presetPlaybackRate || this.elt.playbackRate; - } else { - if (this.loadedmetadata) { - this.elt.playbackRate = val; - } else { - this.presetPlaybackRate = val; - } - } - } /** - * Manages the media element's playback time. Calling `media.time()` - * returns the number of seconds the audio/video has played. Time resets to - * 0 when the looping media restarts. - * - * The parameter, `time`, is optional. It's a number that specifies the - * time, in seconds, to jump to when playback begins. - * - * @method time - * @return {Number} current time (in seconds). - * - * @example - *
                                  - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); - * } - * - * function draw() { - * background(200); - * - * // Display the current time. - * let s = dragon.time(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * textAlign(CENTER); - * text(`${s} seconds`, 50, 50); - * } - * - *
                                  - * - *
                                  - * - * let dragon; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * // Jump to 2 seconds - * // to start. - * dragon.time(2); - * - * describe('The text "S seconds" on a gray square with media controls beneath it. The number "S" increases as the song plays.'); - * } - * - * function draw() { - * background(200); - * - * // Display the current time. - * let s = dragon.time(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * textAlign(CENTER); - * text(`${s} seconds`, 50, 50); - * } - * - *
                                  - */, - /** - * @method time - * @param {Number} time time to jump to (in seconds). - * @chainable - */ - }, - { - key: "time", - value: function time(val) { - if (typeof val === "undefined") { - return this.elt.currentTime; - } else { - this.elt.currentTime = val; - return this; - } - } /** - * Returns the audio/video's duration in seconds. - * - * @method duration - * @return {Number} duration (in seconds). - * - * @example - *
                                  - * - * let dragon; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "S seconds left" on a gray square with media controls beneath it. The number "S" decreases as the song plays.'); - * } - * - * function draw() { - * background(200); - * - * // Calculate the time remaining. - * let s = dragon.duration() - dragon.time(); - * // Round s to 1 decimal place - * // for display. - * s = round(s, 1); - * - * // Display the time remaining. - * textAlign(CENTER); - * text(`${s} seconds left`, 50, 50); - * } - * - *
                                  - */, - }, - { - key: "duration", - value: function duration() { - return this.elt.duration; - }, - }, - { - key: "_ensureCanvas", - value: function _ensureCanvas() { - if (!this.canvas) { - this.canvas = document.createElement("canvas"); - this.drawingContext = this.canvas.getContext("2d"); - this.setModified(true); - } // Don't update the canvas again if we have already updated the canvas with - // the current frame - - var needsRedraw = - this._frameOnCanvas !== this._pInst.frameCount; - if (this.loadedmetadata && needsRedraw) { - // wait for metadata for w/h - if (this.canvas.width !== this.elt.width) { - this.canvas.width = this.elt.width; - this.canvas.height = this.elt.height; - this.width = this.canvas.width; - this.height = this.canvas.height; - } - this.drawingContext.clearRect( - 0, - 0, - this.canvas.width, - this.canvas.height, - ); - this.drawingContext.drawImage( - this.elt, - 0, - 0, - this.canvas.width, - this.canvas.height, - ); - this.setModified(true); - this._frameOnCanvas = this._pInst.frameCount; - } - }, - }, - { - key: "loadPixels", - value: function loadPixels() { - this._ensureCanvas(); - for ( - var _len4 = arguments.length, - args = new Array(_len4), - _key4 = 0; - _key4 < _len4; - _key4++ - ) { - args[_key4] = arguments[_key4]; - } - return _main.default.Renderer2D.prototype.loadPixels.apply( - this, - args, - ); - }, - }, - { - key: "updatePixels", - value: function updatePixels(x, y, w, h) { - if (this.loadedmetadata) { - // wait for metadata - this._ensureCanvas(); - _main.default.Renderer2D.prototype.updatePixels.call( - this, - x, - y, - w, - h, - ); - } - this.setModified(true); - return this; - }, - }, - { - key: "get", - value: function get() { - this._ensureCanvas(); - for ( - var _len5 = arguments.length, - args = new Array(_len5), - _key5 = 0; - _key5 < _len5; - _key5++ - ) { - args[_key5] = arguments[_key5]; - } - return _main.default.Renderer2D.prototype.get.apply( - this, - args, - ); - }, - }, - { - key: "_getPixel", - value: function _getPixel() { - this.loadPixels(); - for ( - var _len6 = arguments.length, - args = new Array(_len6), - _key6 = 0; - _key6 < _len6; - _key6++ - ) { - args[_key6] = arguments[_key6]; - } - return _main.default.Renderer2D.prototype._getPixel.apply( - this, - args, - ); - }, - }, - { - key: "set", - value: function set(x, y, imgOrCol) { - if (this.loadedmetadata) { - // wait for metadata - this._ensureCanvas(); - _main.default.Renderer2D.prototype.set.call( - this, - x, - y, - imgOrCol, - ); - this.setModified(true); - } - }, - }, - { - key: "copy", - value: function copy() { - this._ensureCanvas(); - for ( - var _len7 = arguments.length, - args = new Array(_len7), - _key7 = 0; - _key7 < _len7; - _key7++ - ) { - args[_key7] = arguments[_key7]; - } - _main.default.prototype.copy.apply(this, args); - }, - }, - { - key: "mask", - value: function mask() { - this.loadPixels(); - this.setModified(true); - for ( - var _len8 = arguments.length, - args = new Array(_len8), - _key8 = 0; - _key8 < _len8; - _key8++ - ) { - args[_key8] = arguments[_key8]; - } - _main.default.Image.prototype.mask.apply(this, args); - } /** - * helper method for web GL mode to figure out if the element - * has been modified and might need to be re-uploaded to texture - * memory between frames. - * @method isModified - * @private - * @return {boolean} a boolean indicating whether or not the - * image has been updated or modified since last texture upload. - */, - }, - { - key: "isModified", - value: function isModified() { - return this._modified; - } /** - * helper method for web GL mode to indicate that an element has been - * changed or unchanged since last upload. gl texture upload will - * set this value to false after uploading the texture; or might set - * it to true if metadata has become available but there is no actual - * texture data available yet.. - * @method setModified - * @param {boolean} val sets whether or not the element has been - * modified. - * @private - */, - }, - { - key: "setModified", - value: function setModified(value) { - this._modified = value; - } /** - * Calls a function when the audio/video reaches the end of its playback - * The function won't be called if the media is looping. - * - * The `p5.MediaElement` is passed as an argument to the callback function. - * - * @method onended - * @param {Function} callback function to call when playback ends. - * The `p5.MediaElement` is passed as - * the argument. - * @chainable - * @example - *
                                  - * - * let beat; - * let isPlaying = false; - * let isDone = false; - * - * function setup() { - * - * // Create a p5.MediaElement using createAudio(). - * beat = createAudio('assets/beat.mp3'); - * - * // Set isDone to false when - * // the beat finishes. - * beat.onended(() => { - * isDone = true; - * }); - * - * describe('The text "Click to play" written in black on a gray square. A beat plays when the user clicks. The text "Done!" appears when the beat finishes playing.'); - * } - * - * function draw() { - * background(200); - * - * // Display different messages - * // based on playback. - * textAlign(CENTER); - * if (isDone === true) { - * text('Done!', 50, 50); - * } else if (isPlaying === false) { - * text('Click to play', 50, 50); - * } else { - * text('Playing...', 50, 50); - * } - * } - * - * // Play the beat when the - * // user presses the mouse. - * function mousePressed() { - * if (isPlaying === false) { - * isPlaying = true; - * beat.play(); - * } - * } - * - *
                                  - */, - }, - { - key: "onended", - value: function onended(callback) { - this._onended = callback; - return this; - } /*** CONNECT TO WEB AUDIO API / p5.sound.js ***/, - /** - * Send the audio output of this element to a specified audioNode or - * p5.sound object. If no element is provided, connects to p5's main - * output. That connection is established when this method is first called. - * All connections are removed by the .disconnect() method. - * - * This method is meant to be used with the p5.sound.js addon library. - * - * @method connect - * @param {AudioNode|Object} audioNode AudioNode from the Web Audio API, - * or an object from the p5.sound library - */ - }, - { - key: "connect", - value: function connect(obj) { - var audioContext, mainOutput; - // if p5.sound exists, same audio context - if ( - typeof _main.default.prototype.getAudioContext === - "function" - ) { - audioContext = _main.default.prototype.getAudioContext(); - mainOutput = _main.default.soundOut.input; - } else { - try { - audioContext = obj.context; - mainOutput = audioContext.destination; - } catch (e) { - throw "connect() is meant to be used with Web Audio API or p5.sound.js"; - } - } // create a Web Audio MediaElementAudioSourceNode if none already exists - - if (!this.audioSourceNode) { - this.audioSourceNode = - audioContext.createMediaElementSource(this.elt); - // connect to main output when this method is first called - this.audioSourceNode.connect(mainOutput); - } // connect to object if provided - - if (obj) { - if (obj.input) { - this.audioSourceNode.connect(obj.input); - } else { - this.audioSourceNode.connect(obj); - } - } else { - // otherwise connect to main output of p5.sound / AudioContext - this.audioSourceNode.connect(mainOutput); - } - } /** - * Disconnect all Web Audio routing, including to main output. - * This is useful if you want to re-route the output through - * audio effects, for example. - * - * @method disconnect - */, - }, - { - key: "disconnect", - value: function disconnect() { - if (this.audioSourceNode) { - this.audioSourceNode.disconnect(); - } else { - throw "nothing to disconnect"; - } - } /*** SHOW / HIDE CONTROLS ***/, - /** - * Show the default - * HTMLMediaElement - * controls. These vary between web browser. - * - * @method showControls - * @example - *
                                  - * - * function setup() { - * background('cornflowerblue'); - * - * textAlign(CENTER); - * textSize(50); - * text('🐉', 50, 50); - * - * // Create a p5.MediaElement using createAudio(). - * let dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('A dragon emoji, 🐉, drawn in the center of a blue square. A song plays in the background. Audio controls are displayed beneath the canvas.'); - * } - * - *
                                  - */ - }, - { - key: "showControls", - value: function showControls() { - // must set style for the element to show on the page - this.elt.style["text-align"] = "inherit"; - this.elt.controls = true; - } /** - * Hide the default - * HTMLMediaElement - * controls. - * - * @method hideControls - * @example - *
                                  - * - * let dragon; - * let isHidden = false; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * dragon = createAudio('assets/lucky_dragons.mp3'); - * // Show the default media controls. - * dragon.showControls(); - * - * describe('The text "Double-click to hide controls" written in the middle of a gray square. A song plays in the background. Audio controls are displayed beneath the canvas. The controls appear/disappear when the user double-clicks the square.'); - * } - * - * function draw() { - * background(200); - * - * // Display a different message when - * // controls are hidden or shown. - * textAlign(CENTER); - * if (isHidden === true) { - * text('Double-click to show controls', 10, 20, 80, 80); - * } else { - * text('Double-click to hide controls', 10, 20, 80, 80); - * } - * } - * - * // Show/hide controls based on a double-click. - * function doubleClicked() { - * if (isHidden === true) { - * dragon.showControls(); - * isHidden = false; - * } else { - * dragon.hideControls(); - * isHidden = true; - * } - * } - * - *
                                  - */, - }, - { - key: "hideControls", - value: function hideControls() { - this.elt.controls = false; - } /** - * Schedules a function to call when the audio/video reaches a specific time - * during its playback. - * - * The first parameter, `time`, is the time, in seconds, when the function - * should run. This value is passed to `callback` as its first argument. - * - * The second parameter, `callback`, is the function to call at the specified - * cue time. - * - * The third parameter, `value`, is optional and can be any type of value. - * `value` is passed to `callback`. - * - * Calling `media.addCue()` returns an ID as a string. This is useful for - * removing the cue later. - * - * @method addCue - * @param {Number} time cue time to run the callback function. - * @param {Function} callback function to call at the cue time. - * @param {Object} [value] object to pass as the argument to - * `callback`. - * @return {Number} id ID of this cue, - * useful for `media.removeCue(id)`. - * @example - *
                                  - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * let beat = createAudio('assets/beat.mp3'); - * // Play the beat in a loop. - * beat.loop(); - * - * // Schedule a few events. - * beat.addCue(0, changeBackground, 'red'); - * beat.addCue(2, changeBackground, 'deeppink'); - * beat.addCue(4, changeBackground, 'orchid'); - * beat.addCue(6, changeBackground, 'lavender'); - * - * describe('A red square with a beat playing in the background. Its color changes every 2 seconds while the audio plays.'); - * } - * - * function changeBackground(c) { - * background(c); - * } - * - *
                                  - */, - }, - { - key: "addCue", - value: function addCue(time, callback, val) { - var id = this._cueIDCounter++; - var cue = new Cue(callback, time, id, val); - this._cues.push(cue); - if (!this.elt.ontimeupdate) { - this.elt.ontimeupdate = this._onTimeUpdate.bind(this); - } - return id; - } /** - * Remove a callback based on its ID. - * - * @method removeCue - * @param {Number} id ID of the cue, created by `media.addCue()`. - * @example - *
                                  - * - * let lavenderID; - * let isRemoved = false; - * - * function setup() { - * // Create a p5.MediaElement using createAudio(). - * let beat = createAudio('assets/beat.mp3'); - * // Play the beat in a loop. - * beat.loop(); - * - * // Schedule a few events. - * beat.addCue(0, changeBackground, 'red'); - * beat.addCue(2, changeBackground, 'deeppink'); - * beat.addCue(4, changeBackground, 'orchid'); - * - * // Record the ID of the "lavender" callback. - * lavenderID = beat.addCue(6, changeBackground, 'lavender'); - * - * describe('The text "Double-click to remove lavender." written on a red square. The color changes every 2 seconds while the audio plays. The lavender option is removed when the user double-clicks the square.'); - * } - * - * function draw() { - * if (isRemoved === false) { - * text('Double-click to remove lavender.', 10, 10, 80, 80); - * } else { - * text('No more lavender.', 10, 10, 80, 80); - * } - * } - * - * function changeBackground(c) { - * background(c); - * } - * - * // Remove the lavender color-change cue - * // when the user double-clicks. - * function doubleClicked() { - * if (isRemoved === false) { - * beat.removeCue(lavenderID); - * isRemoved = true; - * } - * } - * - *
                                  - */, - }, - { - key: "removeCue", - value: function removeCue(id) { - for (var i = 0; i < this._cues.length; i++) { - if (this._cues[i].id === id) { - console.log(id); - this._cues.splice(i, 1); - } - } - if (this._cues.length === 0) { - this.elt.ontimeupdate = null; - } - } /** - * Removes all functions scheduled with `media.addCue()`. - * - * @method clearCues - * @example - *
                                  - * - * let isChanging = true; - * - * function setup() { - * background(200); - * - * // Create a p5.MediaElement using createAudio(). - * let beat = createAudio('assets/beat.mp3'); - * // Play the beat in a loop. - * beat.loop(); - * - * // Schedule a few events. - * beat.addCue(0, changeBackground, 'red'); - * beat.addCue(2, changeBackground, 'deeppink'); - * beat.addCue(4, changeBackground, 'orchid'); - * beat.addCue(6, changeBackground, 'lavender'); - * - * describe('The text "Double-click to stop changing." written on a square. The color changes every 2 seconds while the audio plays. The color stops changing when the user double-clicks the square.'); - * } - * - * function draw() { - * if (isChanging === true) { - * text('Double-click to stop changing.', 10, 10, 80, 80); - * } else { - * text('No more changes.', 10, 10, 80, 80); - * } - * } - * - * function changeBackground(c) { - * background(c); - * } - * - * // Remove cued functions and stop - * // changing colors when the user - * // double-clicks. - * function doubleClicked() { - * if (isChanging === true) { - * beat.clearCues(); - * isChanging = false; - * } - * } - * - *
                                  - */, - }, - { - key: "clearCues", - value: function clearCues() { - this._cues = []; - this.elt.ontimeupdate = null; - }, // private method that checks for cues to be fired if events - // have been scheduled using addCue(callback, time). - }, - { - key: "_onTimeUpdate", - value: function _onTimeUpdate() { - var playbackTime = this.time(); - for (var i = 0; i < this._cues.length; i++) { - var callbackTime = this._cues[i].time; - var val = this._cues[i].val; - if ( - this._prevTime < callbackTime && - callbackTime <= playbackTime - ) { - // pass the scheduled callbackTime as parameter to the callback - this._cues[i].callback(val); - } - } - this._prevTime = playbackTime; - }, - }, - ]); - return MediaElement; - })(_main.default.Element); - _main.default.MediaElement = MediaElement; - /** - * A class to describe a file. - * - * `p5.File` objects are used by - * myElement.drop() and - * created by - * createFileInput. - * - * @class p5.File - * @constructor - * @param {File} file wrapped file. - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayInfo() when - * // the file loads. - * let input = createFileInput(displayInfo); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); - * } - * - * // Display the p5.File's info - * // once it loads. - * function displayInfo(file) { - * background(200); - * - * // Display the p5.File's name. - * text(file.name, 10, 10, 80, 40); - * // Display the p5.File's type and subtype. - * text(`${file.type}/${file.subtype}`, 10, 70); - * // Display the p5.File's size in bytes. - * text(file.size, 10, 90); - * } - * - *
                                  - * - *
                                  - * - * // Use the file input to select an image to - * // load and display. - * let img; - * - * function setup() { - * // Create a file input and place it beneath - * // the canvas. Call handleImage() when - * // the file image loads. - * let input = createFileInput(handleImage); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user selects an image file to load, it is displayed on the square.'); - * } - * - * function draw() { - * background(200); - * - * // Draw the image if it's ready. - * if (img) { - * image(img, 0, 0, width, height); - * } - * } - * - * // Use the p5.File's data once - * // it loads. - * function handleImage(file) { - * // Check the p5.File's type. - * if (file.type === 'image') { - * // Create an image using using - * // the p5.File's data. - * img = createImg(file.data, ''); - * - * // Hide the image element so it - * // doesn't appear twice. - * img.hide(); - * } else { - * img = null; - * } - * } - * - *
                                  - */ - var File = /*#__PURE__*/ (function () { - function File(file, pInst) { - _classCallCheck(this, File); - /** - * Underlying - * File - * object. All `File` properties and methods are accessible. - * - * @property file - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayInfo() when - * // the file loads. - * let input = createFileInput(displayInfo); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its info is written in black.'); - * } - * - * // Use the p5.File once - * // it loads. - * function displayInfo(file) { - * background(200); - * - * // Display the p5.File's name. - * text(file.name, 10, 10, 80, 40); - * // Display the p5.File's type and subtype. - * text(`${file.type}/${file.subtype}`, 10, 70); - * // Display the p5.File's size in bytes. - * text(file.size, 10, 90); - * } - * - *
                                  - */ - this.file = file; - this._pInst = pInst; - // Splitting out the file type into two components - // This makes determining if image or text etc simpler - var typeList = file.type.split("/"); - /** - * The file - * MIME type - * as a string. For example, `'image'`, `'text'`, and so on. - * - * @property type - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayType() when - * // the file loads. - * let input = createFileInput(displayType); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its type is written in black.'); - * } - * - * // Display the p5.File's type - * // once it loads. - * function displayType(file) { - * background(200); - * - * // Display the p5.File's type. - * text(`This is file's type is: ${file.type}`, 10, 10, 80, 80); - * } - * - *
                                  - */ - this.type = typeList[0]; - /** - * The file subtype as a string. For example, a file with an `'image'` - * MIME type - * may have a subtype such as ``png`` or ``jpeg``. - * - * @property subtype - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displaySubtype() when - * // the file loads. - * let input = createFileInput(displaySubtype); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its subtype is written in black.'); - * } - * - * // Display the p5.File's type - * // once it loads. - * function displaySubtype(file) { - * background(200); - * - * // Display the p5.File's subtype. - * text(`This is file's subtype is: ${file.subtype}`, 10, 10, 80, 80); - * } - * - *
                                  - */ - this.subtype = typeList[1]; - /** - * The file name as a string. - * - * @property name - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayName() when - * // the file loads. - * let input = createFileInput(displayName); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its name is written in black.'); - * } - * - * // Display the p5.File's name - * // once it loads. - * function displayName(file) { - * background(200); - * - * // Display the p5.File's name. - * text(`This is file's name is: ${file.name}`, 10, 10, 80, 80); - * } - * - *
                                  - */ - this.name = file.name; - /** - * The number of bytes in the file. - * - * @property size - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displaySize() when - * // the file loads. - * let input = createFileInput(displaySize); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its size in bytes is written in black.'); - * } - * - * // Display the p5.File's size - * // in bytes once it loads. - * function displaySize(file) { - * background(200); - * - * // Display the p5.File's size. - * text(`This is file has ${file.size} bytes.`, 10, 10, 80, 80); - * } - * - *
                                  - */ - this.size = file.size; - /** - * A string containing either the file's image data, text contents, or - * a parsed object in the case of JSON and - * p5.XML objects. - * - * @property data - * @example - *
                                  - * - * // Use the file input to load a - * // file and display its info. - * - * function setup() { - * background(200); - * - * // Create a file input and place it beneath - * // the canvas. Call displayData() when - * // the file loads. - * let input = createFileInput(displayData); - * input.position(0, 100); - * - * describe('A gray square with a file input beneath it. If the user loads a file, its data is written in black.'); - * } - * - * // Display the p5.File's data - * // once it loads. - * function displayData(file) { - * background(200); - * - * // Display the p5.File's data, - * // which looks like a random - * // string of characters. - * text(file.data, 10, 10, 80, 80); - * } - * - *
                                  - */ - this.data = undefined; - } - _createClass(File, null, [ - { - key: "_createLoader", - value: function _createLoader(theFile, callback) { - var reader = new FileReader(); - reader.onload = function (e) { - var p5file = new _main.default.File(theFile); - if (p5file.file.type === "application/json") { - // Parse JSON and store the result in data - p5file.data = JSON.parse(e.target.result); - } else if (p5file.file.type === "text/xml") { - // Parse XML, wrap it in p5.XML and store the result in data - var parser = new DOMParser(); - var xml = parser.parseFromString( - e.target.result, - "text/xml", - ); - p5file.data = new _main.default.XML(xml.documentElement); - } else { - p5file.data = e.target.result; - } - callback(p5file); - }; - return reader; - }, - }, - { - key: "_load", - value: function _load(f, callback) { - // Text or data? - // This should likely be improved - if (/^text\//.test(f.type) || f.type === "application/json") { - _main.default.File._createLoader(f, callback).readAsText(f); - } else if (!/^(video|audio)\//.test(f.type)) { - _main.default.File._createLoader(f, callback).readAsDataURL( - f, - ); - } else { - var file = new _main.default.File(f); - file.data = URL.createObjectURL(f); - callback(file); - } - }, - }, - ]); - return File; - })(); - _main.default.File = File; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.every": 171, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.promise": 201, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.trim": 219, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - "core-js/modules/web.url": 258, - }, - ], - 315: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Events - * @submodule Acceleration - * @for p5 - * @requires core - * @main Events - */ - /** - * The system variable deviceOrientation always contains the orientation of - * the device. The value of this variable will either be set 'landscape' - * or 'portrait'. If no data is available it will be set to 'undefined'. - * either LANDSCAPE or PORTRAIT. - * - * @property {Constant} deviceOrientation - * @readOnly - */ - - _main.default.prototype.deviceOrientation = - window.innerWidth / window.innerHeight > 1 - ? "landscape" - : "portrait"; - /** - * The system variable accelerationX always contains the acceleration of the - * device along the x axis. Value is represented as meters per second squared. - * - * @property {Number} accelerationX - * @readOnly - * @example - *
                                  - * - * // Move a touchscreen device to register - * // acceleration changes. - * function draw() { - * background(220, 50); - * fill('magenta'); - * ellipse(width / 2, height / 2, accelerationX); - * describe('Magnitude of device acceleration is displayed as ellipse size.'); - * } - * - *
                                  - */ - _main.default.prototype.accelerationX = 0; - /** - * The system variable accelerationY always contains the acceleration of the - * device along the y axis. Value is represented as meters per second squared. - * - * @property {Number} accelerationY - * @readOnly - * @example - *
                                  - * - * // Move a touchscreen device to register - * // acceleration changes. - * function draw() { - * background(220, 50); - * fill('magenta'); - * ellipse(width / 2, height / 2, accelerationY); - * describe('Magnitude of device acceleration is displayed as ellipse size'); - * } - * - *
                                  - */ - _main.default.prototype.accelerationY = 0; - /** - * The system variable accelerationZ always contains the acceleration of the - * device along the z axis. Value is represented as meters per second squared. - * - * @property {Number} accelerationZ - * @readOnly - * - * @example - *
                                  - * - * // Move a touchscreen device to register - * // acceleration changes. - * function draw() { - * background(220, 50); - * fill('magenta'); - * ellipse(width / 2, height / 2, accelerationZ); - * describe('Magnitude of device acceleration is displayed as ellipse size'); - * } - * - *
                                  - */ - _main.default.prototype.accelerationZ = 0; - /** - * The system variable pAccelerationX always contains the acceleration of the - * device along the x axis in the frame previous to the current frame. Value - * is represented as meters per second squared. - * - * @property {Number} pAccelerationX - * @readOnly - */ - _main.default.prototype.pAccelerationX = 0; - /** - * The system variable pAccelerationY always contains the acceleration of the - * device along the y axis in the frame previous to the current frame. Value - * is represented as meters per second squared. - * - * @property {Number} pAccelerationY - * @readOnly - */ - _main.default.prototype.pAccelerationY = 0; - /** - * The system variable pAccelerationZ always contains the acceleration of the - * device along the z axis in the frame previous to the current frame. Value - * is represented as meters per second squared. - * - * @property {Number} pAccelerationZ - * @readOnly - */ - _main.default.prototype.pAccelerationZ = 0; - /** - * _updatePAccelerations updates the pAcceleration values - * - * @private - */ - _main.default.prototype._updatePAccelerations = function () { - this._setProperty("pAccelerationX", this.accelerationX); - this._setProperty("pAccelerationY", this.accelerationY); - this._setProperty("pAccelerationZ", this.accelerationZ); - }; - /** - * The system variable rotationX always contains the rotation of the - * device along the x axis. If the sketch - * angleMode() is set to DEGREES, the value will be -180 to 180. If - * it is set to RADIANS, the value will be -PI to PI. - * - * Note: The order the rotations are called is important, ie. if used - * together, it must be called in the order Z-X-Y or there might be - * unexpected behaviour. - * - * @property {Number} rotationX - * @readOnly - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * //rotateZ(radians(rotationZ)); - * rotateX(radians(rotationX)); - * //rotateY(radians(rotationY)); - * box(200, 200, 200); - * describe(`red horizontal line right, green vertical line bottom. - * black background.`); - * } - * - *
                                  - */ - _main.default.prototype.rotationX = 0; - /** - * The system variable rotationY always contains the rotation of the - * device along the y axis. If the sketch - * angleMode() is set to DEGREES, the value will be -90 to 90. If - * it is set to RADIANS, the value will be -PI/2 to PI/2. - * - * Note: The order the rotations are called is important, ie. if used - * together, it must be called in the order Z-X-Y or there might be - * unexpected behaviour. - * - * @property {Number} rotationY - * @readOnly - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * //rotateZ(radians(rotationZ)); - * //rotateX(radians(rotationX)); - * rotateY(radians(rotationY)); - * box(200, 200, 200); - * describe(`red horizontal line right, green vertical line bottom. - * black background.`); - * } - * - *
                                  - */ - _main.default.prototype.rotationY = 0; - /** - * The system variable rotationZ always contains the rotation of the - * device along the z axis. If the sketch - * angleMode() is set to DEGREES, the value will be 0 to 360. If - * it is set to RADIANS, the value will be 0 to 2*PI. - * - * Unlike rotationX and rotationY, this variable is available for devices - * with a built-in compass only. - * - * Note: The order the rotations are called is important, ie. if used - * together, it must be called in the order Z-X-Y or there might be - * unexpected behaviour. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * rotateZ(radians(rotationZ)); - * //rotateX(radians(rotationX)); - * //rotateY(radians(rotationY)); - * box(200, 200, 200); - * describe(`red horizontal line right, green vertical line bottom. - * black background.`); - * } - * - *
                                  - * - * @property {Number} rotationZ - * @readOnly - */ - _main.default.prototype.rotationZ = 0; - /** - * The system variable pRotationX always contains the rotation of the - * device along the x axis in the frame previous to the current frame. - * If the sketch angleMode() is set to DEGREES, - * the value will be -180 to 180. If it is set to RADIANS, the value will - * be -PI to PI. - * - * pRotationX can also be used with rotationX to determine the rotate - * direction of the device along the X-axis. - * @example - *
                                  - * - * // A simple if statement looking at whether - * // rotationX - pRotationX < 0 is true or not will be - * // sufficient for determining the rotate direction - * // in most cases. - * - * // Some extra logic is needed to account for cases where - * // the angles wrap around. - * let rotateDirection = 'clockwise'; - * - * // Simple range conversion to make things simpler. - * // This is not absolutely necessary but the logic - * // will be different in that case. - * - * let rX = rotationX + 180; - * let pRX = pRotationX + 180; - * - * if ((rX - pRX > 0 && rX - pRX < 270) || rX - pRX < -270) { - * rotateDirection = 'clockwise'; - * } else if (rX - pRX < 0 || rX - pRX > 270) { - * rotateDirection = 'counter-clockwise'; - * } - * - * print(rotateDirection); - * describe('no image to display.'); - * - *
                                  - * - * @property {Number} pRotationX - * @readOnly - */ - _main.default.prototype.pRotationX = 0; - /** - * The system variable pRotationY always contains the rotation of the - * device along the y axis in the frame previous to the current frame. - * If the sketch angleMode() is set to DEGREES, - * the value will be -90 to 90. If it is set to RADIANS, the value will - * be -PI/2 to PI/2. - * - * pRotationY can also be used with rotationY to determine the rotate - * direction of the device along the Y-axis. - * @example - *
                                  - * - * // A simple if statement looking at whether - * // rotationY - pRotationY < 0 is true or not will be - * // sufficient for determining the rotate direction - * // in most cases. - * - * // Some extra logic is needed to account for cases where - * // the angles wrap around. - * let rotateDirection = 'clockwise'; - * - * // Simple range conversion to make things simpler. - * // This is not absolutely necessary but the logic - * // will be different in that case. - * - * let rY = rotationY + 180; - * let pRY = pRotationY + 180; - * - * if ((rY - pRY > 0 && rY - pRY < 270) || rY - pRY < -270) { - * rotateDirection = 'clockwise'; - * } else if (rY - pRY < 0 || rY - pRY > 270) { - * rotateDirection = 'counter-clockwise'; - * } - * print(rotateDirection); - * describe('no image to display.'); - * - *
                                  - * - * @property {Number} pRotationY - * @readOnly - */ - _main.default.prototype.pRotationY = 0; - /** - * The system variable pRotationZ always contains the rotation of the - * device along the z axis in the frame previous to the current frame. - * If the sketch angleMode() is set to DEGREES, - * the value will be 0 to 360. If it is set to RADIANS, the value will - * be 0 to 2*PI. - * - * pRotationZ can also be used with rotationZ to determine the rotate - * direction of the device along the Z-axis. - * @example - *
                                  - * - * // A simple if statement looking at whether - * // rotationZ - pRotationZ < 0 is true or not will be - * // sufficient for determining the rotate direction - * // in most cases. - * - * // Some extra logic is needed to account for cases where - * // the angles wrap around. - * let rotateDirection = 'clockwise'; - * - * if ( - * (rotationZ - pRotationZ > 0 && rotationZ - pRotationZ < 270) || - * rotationZ - pRotationZ < -270 - * ) { - * rotateDirection = 'clockwise'; - * } else if (rotationZ - pRotationZ < 0 || rotationZ - pRotationZ > 270) { - * rotateDirection = 'counter-clockwise'; - * } - * print(rotateDirection); - * describe('no image to display.'); - * - *
                                  - * - * @property {Number} pRotationZ - * @readOnly - */ - _main.default.prototype.pRotationZ = 0; - var startAngleX = 0; - var startAngleY = 0; - var startAngleZ = 0; - var rotateDirectionX = "clockwise"; - var rotateDirectionY = "clockwise"; - var rotateDirectionZ = "clockwise"; - _main.default.prototype.pRotateDirectionX = undefined; - _main.default.prototype.pRotateDirectionY = undefined; - _main.default.prototype.pRotateDirectionZ = undefined; - _main.default.prototype._updatePRotations = function () { - this._setProperty("pRotationX", this.rotationX); - this._setProperty("pRotationY", this.rotationY); - this._setProperty("pRotationZ", this.rotationZ); - }; - /** - * When a device is rotated, the axis that triggers the deviceTurned() - * method is stored in the turnAxis variable. The turnAxis variable is only defined within - * the scope of deviceTurned(). - * @property {String} turnAxis - * @readOnly - * @example - *
                                  - * - * // Run this example on a mobile device - * // Rotate the device by 90 degrees in the - * // X-axis to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device turns`); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when x-axis turns`); - * } - * function deviceTurned() { - * if (turnAxis === 'X') { - * if (value === 0) { - * value = 255; - * } else if (value === 255) { - * value = 0; - * } - * } - * } - * - *
                                  - */ - _main.default.prototype.turnAxis = undefined; - var move_threshold = 0.5; - var shake_threshold = 30; - /** - * The setMoveThreshold() function is used to set the movement threshold for - * the deviceMoved() function. The default threshold is set to 0.5. - * - * @method setMoveThreshold - * @param {number} value The threshold value - * @example - *
                                  - * - * // Run this example on a mobile device - * // You will need to move the device incrementally further - * // the closer the square's color gets to white in order to change the value. - * - * let value = 0; - * let threshold = 0.5; - * function setup() { - * setMoveThreshold(threshold); - * } - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device moves`); - * } - * function deviceMoved() { - * value = value + 5; - * threshold = threshold + 0.1; - * if (value > 255) { - * value = 0; - * threshold = 30; - * } - * setMoveThreshold(threshold); - * } - * - *
                                  - */ - _main.default.prototype.setMoveThreshold = function (val) { - _main.default._validateParameters("setMoveThreshold", arguments); - move_threshold = val; - }; - /** - * The setShakeThreshold() function is used to set the movement threshold for - * the deviceShaken() function. The default threshold is set to 30. - * - * @method setShakeThreshold - * @param {number} value The threshold value - * @example - *
                                  - * - * // Run this example on a mobile device - * // You will need to shake the device more firmly - * // the closer the box's fill gets to white in order to change the value. - * - * let value = 0; - * let threshold = 30; - * function setup() { - * setShakeThreshold(threshold); - * } - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device is being shaked`); - * } - * function deviceMoved() { - * value = value + 5; - * threshold = threshold + 5; - * if (value > 255) { - * value = 0; - * threshold = 30; - * } - * setShakeThreshold(threshold); - * } - * - *
                                  - */ - _main.default.prototype.setShakeThreshold = function (val) { - _main.default._validateParameters("setShakeThreshold", arguments); - shake_threshold = val; - }; - /** - * The deviceMoved() function is called when the device is moved by more than - * the threshold value along X, Y or Z axis. The default threshold is set to 0.5. - * The threshold value can be changed using setMoveThreshold(). - * - * @method deviceMoved - * @example - *
                                  - * - * // Run this example on a mobile device - * // Move the device around - * // to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device moves`); - * } - * function deviceMoved() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                                  - */ - /** - * The deviceTurned() function is called when the device rotates by - * more than 90 degrees continuously. - * - * The axis that triggers the deviceTurned() method is stored in the turnAxis - * variable. The deviceTurned() method can be locked to trigger on any axis: - * X, Y or Z by comparing the turnAxis variable to 'X', 'Y' or 'Z'. - * - * @method deviceTurned - * @example - *
                                  - * - * // Run this example on a mobile device - * // Rotate the device by 90 degrees - * // to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device turns`); - * } - * function deviceTurned() { - * if (value === 0) { - * value = 255; - * } else if (value === 255) { - * value = 0; - * } - * } - * - *
                                  - *
                                  - * - * // Run this example on a mobile device - * // Rotate the device by 90 degrees in the - * // X-axis to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when x-axis turns`); - * } - * function deviceTurned() { - * if (turnAxis === 'X') { - * if (value === 0) { - * value = 255; - * } else if (value === 255) { - * value = 0; - * } - * } - * } - * - *
                                  - */ - /** - * The deviceShaken() function is called when the device total acceleration - * changes of accelerationX and accelerationY values is more than - * the threshold value. The default threshold is set to 30. - * The threshold value can be changed using setShakeThreshold(). - * - * @method deviceShaken - * @example - *
                                  - * - * // Run this example on a mobile device - * // Shake the device to change the value. - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`50-by-50 black rect in center of canvas. - * turns white on mobile when device shakes`); - * } - * function deviceShaken() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                                  - */ - _main.default.prototype._ondeviceorientation = function (e) { - this._updatePRotations(); - if (this._angleMode === constants.radians) { - e.beta = e.beta * (_PI / 180); - e.gamma = e.gamma * (_PI / 180); - e.alpha = e.alpha * (_PI / 180); - } - this._setProperty("rotationX", e.beta); - this._setProperty("rotationY", e.gamma); - this._setProperty("rotationZ", e.alpha); - this._handleMotion(); - }; - _main.default.prototype._ondevicemotion = function (e) { - this._updatePAccelerations(); - this._setProperty("accelerationX", e.acceleration.x * 2); - this._setProperty("accelerationY", e.acceleration.y * 2); - this._setProperty("accelerationZ", e.acceleration.z * 2); - this._handleMotion(); - }; - _main.default.prototype._handleMotion = function () { - if (window.orientation === 90 || window.orientation === -90) { - this._setProperty("deviceOrientation", "landscape"); - } else if (window.orientation === 0) { - this._setProperty("deviceOrientation", "portrait"); - } else if (window.orientation === undefined) { - this._setProperty("deviceOrientation", "undefined"); - } - var context = this._isGlobal ? window : this; - if (typeof context.deviceMoved === "function") { - if ( - Math.abs(this.accelerationX - this.pAccelerationX) > - move_threshold || - Math.abs(this.accelerationY - this.pAccelerationY) > - move_threshold || - Math.abs(this.accelerationZ - this.pAccelerationZ) > - move_threshold - ) { - context.deviceMoved(); - } - } - if (typeof context.deviceTurned === "function") { - // The angles given by rotationX etc is from range -180 to 180. - // The following will convert them to 0 to 360 for ease of calculation - // of cases when the angles wrapped around. - // _startAngleX will be converted back at the end and updated. - var wRX = this.rotationX + 180; - var wPRX = this.pRotationX + 180; - var wSAX = startAngleX + 180; - if ((wRX - wPRX > 0 && wRX - wPRX < 270) || wRX - wPRX < -270) { - rotateDirectionX = "clockwise"; - } else if (wRX - wPRX < 0 || wRX - wPRX > 270) { - rotateDirectionX = "counter-clockwise"; - } - if (rotateDirectionX !== this.pRotateDirectionX) { - wSAX = wRX; - } - if (Math.abs(wRX - wSAX) > 90 && Math.abs(wRX - wSAX) < 270) { - wSAX = wRX; - this._setProperty("turnAxis", "X"); - context.deviceTurned(); - } - this.pRotateDirectionX = rotateDirectionX; - startAngleX = wSAX - 180; - // Y-axis is identical to X-axis except for changing some names. - var wRY = this.rotationY + 180; - var wPRY = this.pRotationY + 180; - var wSAY = startAngleY + 180; - if ((wRY - wPRY > 0 && wRY - wPRY < 270) || wRY - wPRY < -270) { - rotateDirectionY = "clockwise"; - } else if (wRY - wPRY < 0 || wRY - this.pRotationY > 270) { - rotateDirectionY = "counter-clockwise"; - } - if (rotateDirectionY !== this.pRotateDirectionY) { - wSAY = wRY; - } - if (Math.abs(wRY - wSAY) > 90 && Math.abs(wRY - wSAY) < 270) { - wSAY = wRY; - this._setProperty("turnAxis", "Y"); - context.deviceTurned(); - } - this.pRotateDirectionY = rotateDirectionY; - startAngleY = wSAY - 180; - // Z-axis is already in the range 0 to 360 - // so no conversion is needed. - if ( - (this.rotationZ - this.pRotationZ > 0 && - this.rotationZ - this.pRotationZ < 270) || - this.rotationZ - this.pRotationZ < -270 - ) { - rotateDirectionZ = "clockwise"; - } else if ( - this.rotationZ - this.pRotationZ < 0 || - this.rotationZ - this.pRotationZ > 270 - ) { - rotateDirectionZ = "counter-clockwise"; - } - if (rotateDirectionZ !== this.pRotateDirectionZ) { - startAngleZ = this.rotationZ; - } - if ( - Math.abs(this.rotationZ - startAngleZ) > 90 && - Math.abs(this.rotationZ - startAngleZ) < 270 - ) { - startAngleZ = this.rotationZ; - this._setProperty("turnAxis", "Z"); - context.deviceTurned(); - } - this.pRotateDirectionZ = rotateDirectionZ; - this._setProperty("turnAxis", undefined); - } - if (typeof context.deviceShaken === "function") { - var accelerationChangeX; - var accelerationChangeY; - // Add accelerationChangeZ if acceleration change on Z is needed - if (this.pAccelerationX !== null) { - accelerationChangeX = Math.abs( - this.accelerationX - this.pAccelerationX, - ); - accelerationChangeY = Math.abs( - this.accelerationY - this.pAccelerationY, - ); - } - if (accelerationChangeX + accelerationChangeY > shake_threshold) { - context.deviceShaken(); - } - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 316: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Events - * @submodule Keyboard - * @for p5 - * @requires core - */ - /** - * The boolean system variable keyIsPressed is true if any key is pressed - * and false if no keys are pressed. - * - * @property {Boolean} keyIsPressed - * @readOnly - * @example - *
                                  - * - * function draw() { - * if (keyIsPressed === true) { - * fill(0); - * } else { - * fill(255); - * } - * rect(25, 25, 50, 50); - * describe('50-by-50 white rect that turns black on keypress.'); - * } - * - *
                                  - */ - - _main.default.prototype.isKeyPressed = false; - _main.default.prototype.keyIsPressed = false; // khan - /** - * The system variable key always contains the value of the most recent - * key on the keyboard that was typed. To get the proper capitalization, it - * is best to use it within keyTyped(). For non-ASCII keys, use the keyCode - * variable. - * - * @property {String} key - * @readOnly - * @example - *
                                  - * // Click any key to display it! - * // (Not Guaranteed to be Case Sensitive) - * function setup() { - * fill(245, 123, 158); - * textSize(50); - * } - * - * function draw() { - * background(200); - * text(key, 33, 65); // Display last key pressed. - * describe('canvas displays any key value that is pressed in pink font.'); - * } - *
                                  - */ - _main.default.prototype.key = ""; - /** - * The variable keyCode is used to detect special keys such as BACKSPACE, - * DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, OPTION, ALT, UP_ARROW, - * DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. - * You can also check for custom keys by looking up the keyCode of any key - * on a site like this: keycode.info. - * - * @property {Integer} keyCode - * @readOnly - * @example - *
                                  - * let fillVal = 126; - * function draw() { - * fill(fillVal); - * rect(25, 25, 50, 50); - * describe(`Grey rect center. turns white when up arrow pressed and black when down. - * Display key pressed and its keyCode in a yellow box.`); - * } - * - * function keyPressed() { - * if (keyCode === UP_ARROW) { - * fillVal = 255; - * } else if (keyCode === DOWN_ARROW) { - * fillVal = 0; - * } - * } - *
                                  - *
                                  - * function draw() {} - * function keyPressed() { - * background('yellow'); - * text(`${key} ${keyCode}`, 10, 40); - * print(key, ' ', keyCode); - * } - *
                                  - */ - _main.default.prototype.keyCode = 0; - /** - * The keyPressed() function is called once every time a key is pressed. The - * keyCode for the key that was pressed is stored in the keyCode variable. - * - * For non-ASCII keys, use the keyCode variable. You can check if the keyCode - * equals BACKSPACE, DELETE, ENTER, RETURN, TAB, ESCAPE, SHIFT, CONTROL, - * OPTION, ALT, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW. - * - * For ASCII keys, the key that was pressed is stored in the key variable. However, it - * does not distinguish between uppercase and lowercase. For this reason, it - * is recommended to use keyTyped() to read the key variable, in which the - * case of the variable will be distinguished. - * - * Because of how operating systems handle key repeats, holding down a key - * may cause multiple calls to keyTyped() (and keyReleased() as well). The - * rate of repeat is set by the operating system and how each computer is - * configured.

                                  - * Browsers may have different default - * behaviors attached to various key events. To prevent any default - * behavior for this event, add "return false" to the end of the method. - * - * @method keyPressed - * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. - * @example - *
                                  - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when key pressed and black - * when released.`); - * } - * function keyPressed() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                                  - *
                                  - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when left arrow pressed and - * black when right.`); - * } - * function keyPressed() { - * if (keyCode === LEFT_ARROW) { - * value = 255; - * } else if (keyCode === RIGHT_ARROW) { - * value = 0; - * } - * } - * - *
                                  - *
                                  - * - * function keyPressed() { - * // Do something - * return false; // prevent any default behaviour - * } - * - *
                                  - */ - _main.default.prototype._onkeydown = function (e) { - if (this._downKeys[e.which]) { - // prevent multiple firings - return; - } - this._setProperty("isKeyPressed", true); - this._setProperty("keyIsPressed", true); - this._setProperty("keyCode", e.which); - this._downKeys[e.which] = true; - this._setProperty( - "key", - e.key || String.fromCharCode(e.which) || e.which, - ); - var context = this._isGlobal ? window : this; - if (typeof context.keyPressed === "function" && !e.charCode) { - var executeDefault = context.keyPressed(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The keyReleased() function is called once every time a key is released. - * See key and keyCode for more information.

                                  - * Browsers may have different default - * behaviors attached to various key events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method keyReleased - * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. - * @example - *
                                  - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when key pressed and black - * when pressed again`); - * } - * function keyReleased() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * return false; // prevent any default behavior - * } - * - *
                                  - */ - _main.default.prototype._onkeyup = function (e) { - this._downKeys[e.which] = false; - if (!this._areDownKeys()) { - this._setProperty("isKeyPressed", false); - this._setProperty("keyIsPressed", false); - } - this._setProperty("_lastKeyCodeTyped", null); - this._setProperty( - "key", - e.key || String.fromCharCode(e.which) || e.which, - ); - this._setProperty("keyCode", e.which); - var context = this._isGlobal ? window : this; - if (typeof context.keyReleased === "function") { - var executeDefault = context.keyReleased(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The keyTyped() function is called once every time a key is pressed, but - * action keys such as Backspace, Delete, Ctrl, Shift, and Alt are ignored. If you are trying to detect - * a keyCode for one of these keys, use the keyPressed() function instead. - * The most recent key typed will be stored in the key variable. - * - * Because of how operating systems handle key repeats, holding down a key - * will cause multiple calls to keyTyped() (and keyReleased() as well). The - * rate of repeat is set by the operating system and how each computer is - * configured.

                                  - * Browsers may have different default behaviors attached to various key - * events. To prevent any default behavior for this event, add "return false" - * to the end of the function. - * - * @method keyTyped - * @param {KeyboardEvent} [event] optional KeyboardEvent callback argument. - * @example - *
                                  - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black rect center. turns white when 'a' key typed and - * black when 'b' pressed`); - * } - * function keyTyped() { - * if (key === 'a') { - * value = 255; - * } else if (key === 'b') { - * value = 0; - * } - * // uncomment to prevent any default behavior - * // return false; - * } - * - *
                                  - */ - _main.default.prototype._onkeypress = function (e) { - if (e.which === this._lastKeyCodeTyped) { - // prevent multiple firings - return; - } - this._setProperty("_lastKeyCodeTyped", e.which); // track last keyCode - this._setProperty( - "key", - e.key || String.fromCharCode(e.which) || e.which, - ); - var context = this._isGlobal ? window : this; - if (typeof context.keyTyped === "function") { - var executeDefault = context.keyTyped(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The onblur function is called when the user is no longer focused - * on the p5 element. Because the keyup events will not fire if the user is - * not focused on the element we must assume all keys currently down have - * been released. - */ - _main.default.prototype._onblur = function (e) { - this._downKeys = {}; - }; - /** - * The keyIsDown() function checks if the key is currently down, i.e. pressed. - * It can be used if you have an object that moves, and you want several keys - * to be able to affect its behaviour simultaneously, such as moving a - * sprite diagonally. You can put in any number representing the keyCode of - * the key, or use any of the variable keyCode names listed - * here. - * - * @method keyIsDown - * @param {Number} code The key to check for. - * @return {Boolean} whether key is down or not - * @example - *
                                  - * let x = 100; - * let y = 100; - * - * function setup() { - * createCanvas(512, 512); - * fill(255, 0, 0); - * } - * - * function draw() { - * if (keyIsDown(LEFT_ARROW)) { - * x -= 5; - * } - * - * if (keyIsDown(RIGHT_ARROW)) { - * x += 5; - * } - * - * if (keyIsDown(UP_ARROW)) { - * y -= 5; - * } - * - * if (keyIsDown(DOWN_ARROW)) { - * y += 5; - * } - * - * clear(); - * ellipse(x, y, 50, 50); - * describe(`50-by-50 red ellipse moves left, right, up, and - * down with arrow presses.`); - * } - *
                                  - * - *
                                  - * let diameter = 50; - * - * function setup() { - * createCanvas(512, 512); - * } - * - * function draw() { - * // 107 and 187 are keyCodes for "+" - * if (keyIsDown(107) || keyIsDown(187)) { - * diameter += 1; - * } - * - * // 109 and 189 are keyCodes for "-" - * if (keyIsDown(109) || keyIsDown(189)) { - * diameter -= 1; - * } - * - * clear(); - * fill(255, 0, 0); - * ellipse(50, 50, diameter, diameter); - * describe(`50-by-50 red ellipse gets bigger or smaller when - * + or - are pressed.`); - * } - *
                                  - */ - _main.default.prototype.keyIsDown = function (code) { - _main.default._validateParameters("keyIsDown", arguments); - return this._downKeys[code] || false; - }; - /** - * The _areDownKeys function returns a boolean true if any keys pressed - * and a false if no keys are currently pressed. - - * Helps avoid instances where multiple keys are pressed simultaneously and - * releasing a single key will then switch the - * keyIsPressed property to true. - * @private -**/ - _main.default.prototype._areDownKeys = function () { - for (var key in this._downKeys) { - if ( - this._downKeys.hasOwnProperty(key) && - this._downKeys[key] === true - ) { - return true; - } - } - return false; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - }, - ], - 317: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.string.includes"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Events - * @submodule Mouse - * @for p5 - * @requires core - * @requires constants - */ - /** - * - * The variable movedX contains the horizontal movement of the mouse since the last frame - * @property {Number} movedX - * @readOnly - * @example - *
                                  - * - * let x = 50; - * function setup() { - * rectMode(CENTER); - * } - * - * function draw() { - * if (x > 48) { - * x -= 2; - * } else if (x < 48) { - * x += 2; - * } - * x += floor(movedX / 5); - * background(237, 34, 93); - * fill(0); - * rect(x, 50, 50, 50); - * describe(`box moves left and right according to mouse movement - * then slowly back towards the center`); - * } - * - *
                                  - */ - - _main.default.prototype.movedX = 0; - /** - * The variable movedY contains the vertical movement of the mouse since the last frame - * @property {Number} movedY - * @readOnly - * @example - *
                                  - * - * let y = 50; - * function setup() { - * rectMode(CENTER); - * } - * - * function draw() { - * if (y > 48) { - * y -= 2; - * } else if (y < 48) { - * y += 2; - * } - * y += floor(movedY / 5); - * background(237, 34, 93); - * fill(0); - * rect(50, y, 50, 50); - * describe(`box moves up and down according to mouse movement then - * slowly back towards the center`); - * } - * - *
                                  - */ - _main.default.prototype.movedY = 0; - /* - * This is a flag which is false until the first time - * we receive a mouse event. The pmouseX and pmouseY - * values will match the mouseX and mouseY values until - * this interaction takes place. - */ - _main.default.prototype._hasMouseInteracted = false; - /** - * The system variable mouseX always contains the current horizontal - * position of the mouse, relative to (0, 0) of the canvas. The value at - * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. - * If touch is used instead of mouse input, mouseX will hold the x value - * of the most recent touch point. - * - * @property {Number} mouseX - * @readOnly - * - * @example - *
                                  - * - * // Move the mouse across the canvas - * function draw() { - * background(244, 248, 252); - * line(mouseX, 0, mouseX, 100); - * describe('horizontal black line moves left and right with mouse x-position'); - * } - * - *
                                  - */ - _main.default.prototype.mouseX = 0; - /** - * The system variable mouseY always contains the current vertical - * position of the mouse, relative to (0, 0) of the canvas. The value at - * the top-left corner is (0, 0) for 2-D and (-width/2, -height/2) for WebGL. - * If touch is used instead of mouse input, mouseY will hold the y value - * of the most recent touch point. - * - * @property {Number} mouseY - * @readOnly - * - * @example - *
                                  - * - * // Move the mouse across the canvas - * function draw() { - * background(244, 248, 252); - * line(0, mouseY, 100, mouseY); - * describe('vertical black line moves up and down with mouse y-position'); - * } - * - *
                                  - */ - _main.default.prototype.mouseY = 0; - /** - * The system variable pmouseX always contains the horizontal position of - * the mouse or finger in the frame previous to the current frame, relative to - * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and - * (-width/2, -height/2) for WebGL. Note: pmouseX will be reset to the current mouseX - * value at the start of each touch event. - * - * @property {Number} pmouseX - * @readOnly - * - * @example - *
                                  - * - * // Move the mouse across the canvas to leave a trail - * function setup() { - * //slow down the frameRate to make it more visible - * frameRate(10); - * } - * - * function draw() { - * background(244, 248, 252); - * line(mouseX, mouseY, pmouseX, pmouseY); - * print(pmouseX + ' -> ' + mouseX); - * describe(`line trail is created from cursor movements. - * faster movement make longer line.`); - * } - * - *
                                  - */ - _main.default.prototype.pmouseX = 0; - /** - * The system variable pmouseY always contains the vertical position of - * the mouse or finger in the frame previous to the current frame, relative to - * (0, 0) of the canvas. The value at the top-left corner is (0, 0) for 2-D and - * (-width/2, -height/2) for WebGL. Note: pmouseY will be reset to the current mouseY - * value at the start of each touch event. - * - * @property {Number} pmouseY - * @readOnly - * - * @example - *
                                  - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * //draw a square only if the mouse is not moving - * if (mouseY === pmouseY && mouseX === pmouseX) { - * rect(20, 20, 60, 60); - * } - * - * print(pmouseY + ' -> ' + mouseY); - * describe(`60-by-60 black rect center, fuchsia background. - * rect flickers on mouse movement`); - * } - * - *
                                  - */ - _main.default.prototype.pmouseY = 0; - /** - * The system variable winMouseX always contains the current horizontal - * position of the mouse, relative to (0, 0) of the window. - * - * @property {Number} winMouseX - * @readOnly - * - * @example - *
                                  - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * let body = document.getElementsByTagName('body')[0]; - * myCanvas.parent(body); - * } - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * //move the canvas to the horizontal mouse position - * //relative to the window - * myCanvas.position(winMouseX + 1, windowHeight / 2); - * - * //the y of the square is relative to the canvas - * rect(20, mouseY, 60, 60); - * describe(`60-by-60 black rect y moves with mouse y and fuchsia - * canvas moves with mouse x`); - * } - * - *
                                  - */ - _main.default.prototype.winMouseX = 0; - /** - * The system variable winMouseY always contains the current vertical - * position of the mouse, relative to (0, 0) of the window. - * - * @property {Number} winMouseY - * @readOnly - * - * @example - *
                                  - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * let body = document.getElementsByTagName('body')[0]; - * myCanvas.parent(body); - * } - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * //move the canvas to the vertical mouse position - * //relative to the window - * myCanvas.position(windowWidth / 2, winMouseY + 1); - * - * //the x of the square is relative to the canvas - * rect(mouseX, 20, 60, 60); - * describe(`60-by-60 black rect x moves with mouse x and - * fuchsia canvas y moves with mouse y`); - * } - * - *
                                  - */ - _main.default.prototype.winMouseY = 0; - /** - * The system variable pwinMouseX always contains the horizontal position - * of the mouse in the frame previous to the current frame, relative to - * (0, 0) of the window. Note: pwinMouseX will be reset to the current winMouseX - * value at the start of each touch event. - * - * @property {Number} pwinMouseX - * @readOnly - * - * @example - *
                                  - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * noStroke(); - * fill(237, 34, 93); - * } - * - * function draw() { - * clear(); - * //the difference between previous and - * //current x position is the horizontal mouse speed - * let speed = abs(winMouseX - pwinMouseX); - * //change the size of the circle - * //according to the horizontal speed - * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); - * //move the canvas to the mouse position - * myCanvas.position(winMouseX + 1, winMouseY + 1); - * describe(`fuchsia ellipse moves with mouse x and y. - * Grows and shrinks with mouse speed`); - * } - * - *
                                  - */ - _main.default.prototype.pwinMouseX = 0; - /** - * The system variable pwinMouseY always contains the vertical position of - * the mouse in the frame previous to the current frame, relative to (0, 0) - * of the window. Note: pwinMouseY will be reset to the current winMouseY - * value at the start of each touch event. - * - * @property {Number} pwinMouseY - * @readOnly - * - * @example - *
                                  - * - * let myCanvas; - * - * function setup() { - * //use a variable to store a pointer to the canvas - * myCanvas = createCanvas(100, 100); - * noStroke(); - * fill(237, 34, 93); - * } - * - * function draw() { - * clear(); - * //the difference between previous and - * //current y position is the vertical mouse speed - * let speed = abs(winMouseY - pwinMouseY); - * //change the size of the circle - * //according to the vertical speed - * ellipse(50, 50, 10 + speed * 5, 10 + speed * 5); - * //move the canvas to the mouse position - * myCanvas.position(winMouseX + 1, winMouseY + 1); - * describe(`fuchsia ellipse moves with mouse x and y. - * Grows and shrinks with mouse speed`); - * } - * - *
                                  - */ - _main.default.prototype.pwinMouseY = 0; - /** - * p5 automatically tracks if the mouse button is pressed and which - * button is pressed. The value of the system variable mouseButton is either - * LEFT, RIGHT, or CENTER depending on which button was pressed last. - * Warning: different browsers may track mouseButton differently. - * - * @property {Constant} mouseButton - * @readOnly - * - * @example - *
                                  - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * if (mouseIsPressed === true) { - * if (mouseButton === LEFT) { - * ellipse(50, 50, 50, 50); - * } - * if (mouseButton === RIGHT) { - * rect(25, 25, 50, 50); - * } - * if (mouseButton === CENTER) { - * triangle(23, 75, 50, 20, 78, 75); - * } - * } - * - * print(mouseButton); - * describe(`50-by-50 black ellipse appears on center of fuchsia - * canvas on mouse click/press.`); - * } - * - *
                                  - */ - _main.default.prototype.mouseButton = 0; - /** - * The boolean system variable mouseIsPressed is true if the mouse is pressed - * and false if not. - * - * @property {Boolean} mouseIsPressed - * @readOnly - * - * @example - *
                                  - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * - * if (mouseIsPressed === true) { - * ellipse(50, 50, 50, 50); - * } else { - * rect(25, 25, 50, 50); - * } - * - * print(mouseIsPressed); - * describe(`black 50-by-50 rect becomes ellipse with mouse click/press. - * fuchsia background.`); - * } - * - *
                                  - */ - _main.default.prototype.mouseIsPressed = false; - _main.default.prototype._updateNextMouseCoords = function (e) { - if ( - this._curElement !== null && - (!e.touches || e.touches.length > 0) - ) { - var mousePos = getMousePos( - this._curElement.elt, - this.width, - this.height, - e, - ); - this._setProperty("movedX", e.movementX); - this._setProperty("movedY", e.movementY); - this._setProperty("mouseX", mousePos.x); - this._setProperty("mouseY", mousePos.y); - this._setProperty("winMouseX", mousePos.winX); - this._setProperty("winMouseY", mousePos.winY); - } - if (!this._hasMouseInteracted) { - // For first draw, make previous and next equal - this._updateMouseCoords(); - this._setProperty("_hasMouseInteracted", true); - } - }; - _main.default.prototype._updateMouseCoords = function () { - this._setProperty("pmouseX", this.mouseX); - this._setProperty("pmouseY", this.mouseY); - this._setProperty("pwinMouseX", this.winMouseX); - this._setProperty("pwinMouseY", this.winMouseY); - this._setProperty("_pmouseWheelDeltaY", this._mouseWheelDeltaY); - }; - function getMousePos(canvas, w, h, evt) { - if (evt && !evt.clientX) { - // use touches if touch and not mouse - if (evt.touches) { - evt = evt.touches[0]; - } else if (evt.changedTouches) { - evt = evt.changedTouches[0]; - } - } - var rect = canvas.getBoundingClientRect(); - var sx = canvas.scrollWidth / w || 1; - var sy = canvas.scrollHeight / h || 1; - return { - x: (evt.clientX - rect.left) / sx, - y: (evt.clientY - rect.top) / sy, - winX: evt.clientX, - winY: evt.clientY, - id: evt.identifier, - }; - } - _main.default.prototype._setMouseButton = function (e) { - if (e.button === 1) { - this._setProperty("mouseButton", constants.CENTER); - } else if (e.button === 2) { - this._setProperty("mouseButton", constants.RIGHT); - } else { - this._setProperty("mouseButton", constants.LEFT); - } - }; - /** - * The mouseMoved() function is called every time the mouse moves and a mouse - * button is not pressed.

                                  - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the method. - * - * @method mouseMoved - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                                  - * - * // Move the mouse across the page - * // to change its value - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black 50-by-50 rect becomes lighter with mouse movements until - * white then resets no image displayed`); - * } - * function mouseMoved() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function mouseMoved() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                                  - * - *
                                  - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseMoved(event) { - * console.log(event); - * } - * - *
                                  - */ - /** - * The mouseDragged() function is called once every time the mouse moves and - * a mouse button is pressed. If no mouseDragged() function is defined, the - * touchMoved() function will be called instead if it is defined.

                                  - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mouseDragged - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                                  - * - * // Drag the mouse across the page - * // to change its value - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe(`black 50-by-50 rect turns lighter with mouse click and - * drag until white, resets`); - * } - * function mouseDragged() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function mouseDragged() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                                  - * - *
                                  - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseDragged(event) { - * console.log(event); - * } - * - *
                                  - */ - _main.default.prototype._onmousemove = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._updateNextMouseCoords(e); - if (!this.mouseIsPressed) { - if (typeof context.mouseMoved === "function") { - executeDefault = context.mouseMoved(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - } else { - if (typeof context.mouseDragged === "function") { - executeDefault = context.mouseDragged(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.touchMoved === "function") { - executeDefault = context.touchMoved(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - } - }; - /** - * The mousePressed() function is called once after every time a mouse button - * is pressed. The mouseButton variable (see the related reference entry) - * can be used to determine which button has been pressed. If no - * mousePressed() function is defined, the touchStarted() function will be - * called instead if it is defined.

                                  - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mousePressed - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                                  - * - * // Click anywhere in the webpage to change - * // the color value of the rectangle - * - * let colorValue = 0; - * function draw() { - * fill(colorValue); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse click/press.'); - * } - * function mousePressed() { - * if (colorValue === 0) { - * colorValue = 255; - * } else { - * colorValue = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function mousePressed() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                                  - * - *
                                  - * - * // returns a MouseEvent object - * // as a callback argument - * function mousePressed(event) { - * console.log(event); - * } - * - *
                                  - */ - _main.default.prototype._onmousedown = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._setProperty("mouseIsPressed", true); - this._setMouseButton(e); - this._updateNextMouseCoords(e); - if (typeof context.mousePressed === "function") { - executeDefault = context.mousePressed(e); - if (executeDefault === false) { - e.preventDefault(); - } // only safari needs this manual fallback for consistency - } else if ( - navigator.userAgent.toLowerCase().includes("safari") && - typeof context.touchStarted === "function" - ) { - executeDefault = context.touchStarted(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The mouseReleased() function is called every time a mouse button is - * released. If no mouseReleased() function is defined, the touchEnded() - * function will be called instead if it is defined.

                                  - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mouseReleased - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                                  - * - * // Click within the image to change - * // the value of the rectangle - * // after the mouse has been clicked - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse click/press.'); - * } - * function mouseReleased() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function mouseReleased() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                                  - * - *
                                  - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseReleased(event) { - * console.log(event); - * } - * - *
                                  - */ - _main.default.prototype._onmouseup = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._setProperty("mouseIsPressed", false); - if (typeof context.mouseReleased === "function") { - executeDefault = context.mouseReleased(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.touchEnded === "function") { - executeDefault = context.touchEnded(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - _main.default.prototype._ondragend = - _main.default.prototype._onmouseup; - _main.default.prototype._ondragover = - _main.default.prototype._onmousemove; - /** - * The mouseClicked() function is called once after a mouse button has been - * pressed and then released.

                                  - * Browsers handle clicks differently, so this function is only guaranteed to be - * run when the left mouse button is clicked. To handle other mouse buttons - * being pressed or released, see mousePressed() or mouseReleased().

                                  - * Browsers may have different default - * behaviors attached to various mouse events. To prevent any default - * behavior for this event, add "return false" to the end of the function. - * - * @method mouseClicked - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                                  - * - * // Click within the image to change - * // the value of the rectangle - * // after the mouse has been clicked - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse click/press.'); - * } - * - * function mouseClicked() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function mouseClicked() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                                  - * - *
                                  - * - * // returns a MouseEvent object - * // as a callback argument - * function mouseClicked(event) { - * console.log(event); - * } - * - *
                                  - */ - _main.default.prototype._onclick = function (e) { - var context = this._isGlobal ? window : this; - if (typeof context.mouseClicked === "function") { - var executeDefault = context.mouseClicked(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The doubleClicked() function is executed every time a event - * listener has detected a dblclick event which is a part of the - * DOM L3 specification. The doubleClicked event is fired when a - * pointing device button (usually a mouse's primary button) - * is clicked twice on a single element. For more info on the - * dblclick event refer to mozilla's documentation here: - * https://developer.mozilla.org/en-US/docs/Web/Events/dblclick - * - * @method doubleClicked - * @param {MouseEvent} [event] optional MouseEvent callback argument. - * @example - *
                                  - * - * // Click within the image to change - * // the value of the rectangle - * // after the mouse has been double clicked - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('black 50-by-50 rect turns white with mouse doubleClick/press.'); - * } - * - * function doubleClicked() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function doubleClicked() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * - *
                                  - * - *
                                  - * - * // returns a MouseEvent object - * // as a callback argument - * function doubleClicked(event) { - * console.log(event); - * } - * - *
                                  - */ - _main.default.prototype._ondblclick = function (e) { - var context = this._isGlobal ? window : this; - if (typeof context.doubleClicked === "function") { - var executeDefault = context.doubleClicked(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * For use with WebGL orbitControl. - * @property {Number} _mouseWheelDeltaY - * @readOnly - * @private - */ - _main.default.prototype._mouseWheelDeltaY = 0; - /** - * For use with WebGL orbitControl. - * @property {Number} _pmouseWheelDeltaY - * @readOnly - * @private - */ - _main.default.prototype._pmouseWheelDeltaY = 0; - /** - * The function mouseWheel() is executed every time a vertical mouse wheel - * event is detected either triggered by an actual mouse wheel or by a - * touchpad.

                                  - * The event.delta property returns the amount the mouse wheel - * have scrolled. The values can be positive or negative depending on the - * scroll direction (on macOS with "natural" scrolling enabled, the signs - * are inverted).

                                  - * Browsers may have different default behaviors attached to various - * mouse events. To prevent any default behavior for this event, add - * "return false" to the end of the method.

                                  - * Due to the current support of the "wheel" event on Safari, the function - * may only work as expected if "return false" is included while using Safari. - * - * @method mouseWheel - * @param {WheelEvent} [event] optional WheelEvent callback argument. - * - * @example - *
                                  - * - * let pos = 25; - * - * function draw() { - * background(237, 34, 93); - * fill(0); - * rect(25, pos, 50, 50); - * describe(`black 50-by-50 rect moves up and down with vertical scroll. - * fuchsia background`); - * } - * - * function mouseWheel(event) { - * print(event.delta); - * //move the square according to the vertical scroll amount - * pos += event.delta; - * //uncomment to block page scrolling - * //return false; - * } - * - *
                                  - */ - _main.default.prototype._onwheel = function (e) { - var context = this._isGlobal ? window : this; - this._setProperty("_mouseWheelDeltaY", e.deltaY); - if (typeof context.mouseWheel === "function") { - e.delta = e.deltaY; - var executeDefault = context.mouseWheel(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The function requestPointerLock() - * locks the pointer to its current position and makes it invisible. - * Use movedX and movedY to get the difference the mouse was moved since - * the last call of draw. - * Note that not all browsers support this feature. - * This enables you to create experiences that aren't limited by the mouse moving out of the screen - * even if it is repeatedly moved into one direction. - * For example, a first person perspective experience. - * - * @method requestPointerLock - * @example - *
                                  - * - * let cam; - * function setup() { - * createCanvas(100, 100, WEBGL); - * requestPointerLock(); - * cam = createCamera(); - * } - * - * function draw() { - * background(255); - * cam.pan(-movedX * 0.001); - * cam.tilt(movedY * 0.001); - * sphere(25); - * describe(`3D scene moves according to mouse mouse movement in a - * first person perspective`); - * } - * - *
                                  - */ - _main.default.prototype.requestPointerLock = function () { - // pointer lock object forking for cross browser - var canvas = this._curElement.elt; - canvas.requestPointerLock = - canvas.requestPointerLock || canvas.mozRequestPointerLock; - if (!canvas.requestPointerLock) { - console.log( - "requestPointerLock is not implemented in this browser", - ); - return false; - } - canvas.requestPointerLock(); - return true; - }; - /** - * The function exitPointerLock() - * exits a previously triggered pointer Lock - * for example to make ui elements usable etc - * - * @method exitPointerLock - * @example - *
                                  - * - * //click the canvas to lock the pointer - * //click again to exit (otherwise escape) - * let locked = false; - * function draw() { - * background(237, 34, 93); - * describe('cursor gets locked / unlocked on mouse-click'); - * } - * function mouseClicked() { - * if (!locked) { - * locked = true; - * requestPointerLock(); - * } else { - * exitPointerLock(); - * locked = false; - * } - * } - * - *
                                  - */ - _main.default.prototype.exitPointerLock = function () { - document.exitPointerLock(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 318: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.string.includes"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Events - * @submodule Touch - * @for p5 - * @requires core - */ - /** - * The system variable touches[] contains an array of the positions of all - * current touch points, relative to (0, 0) of the canvas, and IDs identifying a - * unique touch as it moves. Each element in the array is an object with x, y, - * and id properties. - * - * The touches[] array is not supported on Safari and IE on touch-based - * desktops (laptops). - * - * @property {Object[]} touches - * @readOnly - * - * @example - *
                                  - * - * // On a touchscreen device, touch - * // the canvas using one or more fingers - * // at the same time - * function draw() { - * clear(); - * let display = touches.length + ' touches'; - * text(display, 5, 10); - * describe(`Number of touches currently registered are displayed - * on the canvas`); - * } - * - *
                                  - */ - - _main.default.prototype.touches = []; - _main.default.prototype._updateTouchCoords = function (e) { - if (this._curElement !== null) { - var touches = []; - for (var i = 0; i < e.touches.length; i++) { - touches[i] = getTouchInfo( - this._curElement.elt, - this.width, - this.height, - e, - i, - ); - } - this._setProperty("touches", touches); - } - }; - function getTouchInfo(canvas, w, h, e) { - var i = - arguments.length > 4 && arguments[4] !== undefined - ? arguments[4] - : 0; - var rect = canvas.getBoundingClientRect(); - var sx = canvas.scrollWidth / w || 1; - var sy = canvas.scrollHeight / h || 1; - var touch = e.touches[i] || e.changedTouches[i]; - return { - x: (touch.clientX - rect.left) / sx, - y: (touch.clientY - rect.top) / sy, - winX: touch.clientX, - winY: touch.clientY, - id: touch.identifier, - }; - } /** - * The touchStarted() function is called once after every time a touch is - * registered. If no touchStarted() function is defined, the mousePressed() - * function will be called instead if it is defined.

                                  - * Browsers may have different default behaviors attached to various touch - * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. - * - * @method touchStarted - * @param {TouchEvent} [event] optional TouchEvent callback argument. - * @example - *
                                  - * - * // Touch within the image to change - * // the value of the rectangle - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('50-by-50 black rect turns white with touch event.'); - * } - * function touchStarted() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function touchStarted() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * describe('no image displayed'); - * - *
                                  - * - *
                                  - * - * // returns a TouchEvent object - * // as a callback argument - * function touchStarted(event) { - * console.log(event); - * } - * describe('no image displayed'); - * - *
                                  - */ - - _main.default.prototype._ontouchstart = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._setProperty("mouseIsPressed", true); - this._updateTouchCoords(e); - this._updateNextMouseCoords(e); - this._updateMouseCoords(); // reset pmouseXY at the start of each touch event - if (typeof context.touchStarted === "function") { - executeDefault = context.touchStarted(e); - if (executeDefault === false) { - e.preventDefault(); - } // only safari needs this manual fallback for consistency - } else if ( - navigator.userAgent.toLowerCase().includes("safari") && - typeof context.mousePressed === "function" - ) { - executeDefault = context.mousePressed(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The touchMoved() function is called every time a touch move is registered. - * If no touchMoved() function is defined, the mouseDragged() function will - * be called instead if it is defined.

                                  - * Browsers may have different default behaviors attached to various touch - * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. - * - * @method touchMoved - * @param {TouchEvent} [event] optional TouchEvent callback argument. - * @example - *
                                  - * - * // Move your finger across the page - * // to change its value - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('50-by-50 black rect turns lighter with touch until white. resets'); - * } - * function touchMoved() { - * value = value + 5; - * if (value > 255) { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function touchMoved() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * describe('no image displayed'); - * - *
                                  - * - *
                                  - * - * // returns a TouchEvent object - * // as a callback argument - * function touchMoved(event) { - * console.log(event); - * } - * describe('no image displayed'); - * - *
                                  - */ - _main.default.prototype._ontouchmove = function (e) { - var context = this._isGlobal ? window : this; - var executeDefault; - this._updateTouchCoords(e); - this._updateNextMouseCoords(e); - if (typeof context.touchMoved === "function") { - executeDefault = context.touchMoved(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.mouseDragged === "function") { - executeDefault = context.mouseDragged(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - /** - * The touchEnded() function is called every time a touch ends. If no - * touchEnded() function is defined, the mouseReleased() function will be - * called instead if it is defined.

                                  - * Browsers may have different default behaviors attached to various touch - * events. To prevent any default behavior for this event, add "return false" - * to the end of the method. - * - * @method touchEnded - * @param {TouchEvent} [event] optional TouchEvent callback argument. - * @example - *
                                  - * - * // Release touch within the image to - * // change the value of the rectangle - * - * let value = 0; - * function draw() { - * fill(value); - * rect(25, 25, 50, 50); - * describe('50-by-50 black rect turns white with touch.'); - * } - * function touchEnded() { - * if (value === 0) { - * value = 255; - * } else { - * value = 0; - * } - * } - * - *
                                  - * - *
                                  - * - * function touchEnded() { - * ellipse(mouseX, mouseY, 5, 5); - * // prevent default - * return false; - * } - * describe('no image displayed'); - * - *
                                  - * - *
                                  - * - * // returns a TouchEvent object - * // as a callback argument - * function touchEnded(event) { - * console.log(event); - * } - * describe('no image displayed'); - * - *
                                  - */ - _main.default.prototype._ontouchend = function (e) { - this._setProperty("mouseIsPressed", false); - this._updateTouchCoords(e); - this._updateNextMouseCoords(e); - var context = this._isGlobal ? window : this; - var executeDefault; - if (typeof context.touchEnded === "function") { - executeDefault = context.touchEnded(e); - if (executeDefault === false) { - e.preventDefault(); - } - } else if (typeof context.mouseReleased === "function") { - executeDefault = context.mouseReleased(e); - if (executeDefault === false) { - e.preventDefault(); - } - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.string.includes": 209, - }, - ], - 319: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.int32-array"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.int32-array"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - /** - * This module defines the filters for use with image buffers. - * - * This module is basically a collection of functions stored in an object - * as opposed to modules. The functions are destructive, modifying - * the passed in canvas rather than creating a copy. - * - * Generally speaking users of this module will use the Filters.apply method - * on a canvas to create an effect. - * - * A number of functions are borrowed/adapted from - * http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ - * or the java processing implementation. - */ - var Filters = { - /* - * Helper functions - */ - /** - * Returns the pixel buffer for a canvas. - * - * @private - * - * @param {Canvas|ImageData} canvas the canvas to get pixels from - * @return {Uint8ClampedArray} a one-dimensional array containing - * the data in the RGBA order, with integer - * values between 0 and 255. - */ - _toPixels: function _toPixels(canvas) { - // Return pixel data if 'canvas' is an ImageData object. - if (canvas instanceof ImageData) { - return canvas.data; - } else { - // Check 2D context support. - if (canvas.getContext("2d")) { - // Retrieve pixel data. - return canvas - .getContext("2d") - .getImageData(0, 0, canvas.width, canvas.height).data; - } else if (canvas.getContext("webgl")) { - //Check WebGL context support - var gl = canvas.getContext("webgl"); - // Calculate the size of pixel data - // (4 bytes per pixel - one byte for each RGBA channel). - var len = gl.drawingBufferWidth * gl.drawingBufferHeight * 4; - var data = new Uint8Array(len); - // Use gl.readPixels to fetch pixel data from the WebGL - // canvas, storing it in the data array as UNSIGNED_BYTE integers. - gl.readPixels( - 0, - 0, - canvas.width, - canvas.height, - gl.RGBA, - gl.UNSIGNED_BYTE, - data, - ); - return data; - } - } - }, - /** - * Returns a 32-bit number containing ARGB data at the ith pixel in the - * 1D array containing pixels data. - * - * @private - * - * @param {Uint8ClampedArray} data array returned by _toPixels() - * @param {Integer} i index of a 1D Image Array - * @return {Integer} 32-bit integer value representing - * ARGB value. - */ - _getARGB: function _getARGB(data, i) { - // Determine the starting position in the 'data' array for the 'i'-th pixel. - var offset = i * 4; - return ( - // Combining the extracted components using bitwise OR operations to form the final ARGB value. - ((data[offset + 3] << 24) & 4278190080) | //Extract alpha component - ((data[offset] << 16) & 16711680) | //Extract Red component - ((data[offset + 1] << 8) & 65280) | //Extract green component - (data[offset + 2] & 255) //Extract blue component - ); - }, - /** - * Modifies pixels RGBA values to values contained in the data object. - * - * @private - * - * @param {Uint8ClampedArray} pixels array returned by _toPixels() - * @param {Int32Array} data source 1D array where each value - * represents ARGB values - */ - _setPixels: function _setPixels(pixels, data) { - var offset = 0; - for (var i = 0, al = pixels.length; i < al; i++) { - offset = i * 4; - pixels[offset + 0] = (data[i] & 16711680) >>> 16; - pixels[offset + 1] = (data[i] & 65280) >>> 8; - pixels[offset + 2] = data[i] & 255; - pixels[offset + 3] = (data[i] & 4278190080) >>> 24; - } - }, - /** - * Returns the ImageData object for a canvas. - * https://developer.mozilla.org/en-US/docs/Web/API/ImageData - * - * @private - * - * @param {Canvas|ImageData} canvas canvas to get image data from - * @return {ImageData} Holder of pixel data (and width and - * height) for a canvas - */ - _toImageData: function _toImageData(canvas) { - if (canvas instanceof ImageData) { - return canvas; - } else { - return canvas - .getContext("2d") - .getImageData(0, 0, canvas.width, canvas.height); - } - }, - /** - * Returns a blank ImageData object. - * - * @private - * - * @param {Integer} width - * @param {Integer} height - * @return {ImageData} - */ - _createImageData: function _createImageData(width, height) { - Filters._tmpCanvas = document.createElement("canvas"); - Filters._tmpCtx = Filters._tmpCanvas.getContext("2d"); - return this._tmpCtx.createImageData(width, height); - }, - /** - * Applys a filter function to a canvas. - * - * The difference between this and the actual filter functions defined below - * is that the filter functions generally modify the pixel buffer but do - * not actually put that data back to the canvas (where it would actually - * update what is visible). By contrast this method does make the changes - * actually visible in the canvas. - * - * The apply method is the method that callers of this module would generally - * use. It has been separated from the actual filters to support an advanced - * use case of creating a filter chain that executes without actually updating - * the canvas in between everystep. - * - * @private - * @param {HTMLCanvasElement} canvas The input canvas to apply the filter on. - * @param {function(ImageData,Object)} func The filter function to apply to the canvas's pixel data. - * @param {Object} filterParam An optional parameter to pass to the filter function. - */ - apply: function apply(canvas, func, filterParam) { - var pixelsState = canvas.getContext("2d"); - var imageData = pixelsState.getImageData( - 0, - 0, - canvas.width, - canvas.height, - ); - //Filters can either return a new ImageData object, or just modify - //the one they received. - var newImageData = func(imageData, filterParam); - //If new ImageData is returned, replace the canvas's pixel data with it. - if (newImageData instanceof ImageData) { - pixelsState.putImageData( - newImageData, - 0, - 0, - 0, - 0, - canvas.width, - canvas.height, - ); - } else { - //Restore the original pixel. - pixelsState.putImageData( - imageData, - 0, - 0, - 0, - 0, - canvas.width, - canvas.height, - ); - } - }, - /* - * Filters - */ - /** - * Converts the image to black and white pixels depending if they are above or - * below the threshold defined by the level parameter. The parameter must be - * between 0.0 (black) and 1.0 (white). If no level is specified, 0.5 is used. - * - * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ - * - * @private - * @param {Canvas} canvas Canvas to apply thershold filter on. - * @param {Float} level Threshold level (0-1). - */ - threshold: function threshold(canvas, level) { - var pixels = Filters._toPixels(canvas); - if (level === undefined) { - level = 0.5; - } // Calculate threshold value on a (0-255) scale. - - var thresh = Math.floor(level * 255); - for (var i = 0; i < pixels.length; i += 4) { - var r = pixels[i]; - var g = pixels[i + 1]; - var b = pixels[i + 2]; - // CIE luminance for RGB - var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; - var val = void 0; - if (gray >= thresh) { - val = 255; - } else { - val = 0; - } - pixels[i] = pixels[i + 1] = pixels[i + 2] = val; //set pixel to val. - } - }, - /** - * Converts any colors in the image to grayscale equivalents. - * No parameter is used. - * - * Borrowed from http://www.html5rocks.com/en/tutorials/canvas/imagefilters/ - * - * @private - * @param {Canvas} canvas Canvas to apply gray filter on. - */ - gray: function gray(canvas) { - var pixels = Filters._toPixels(canvas); - for (var i = 0; i < pixels.length; i += 4) { - var r = pixels[i]; - var g = pixels[i + 1]; - var b = pixels[i + 2]; - // CIE luminance for RGB - var gray = 0.2126 * r + 0.7152 * g + 0.0722 * b; - pixels[i] = pixels[i + 1] = pixels[i + 2] = gray; // set pixel to gray. - } - }, - /** - * Sets the alpha channel to entirely opaque. No parameter is used. - * - * @private - * @param {Canvas} canvas - */ - opaque: function opaque(canvas) { - var pixels = Filters._toPixels(canvas); - for (var i = 0; i < pixels.length; i += 4) { - pixels[i + 3] = 255; - } - return pixels; - }, - /** - * Sets each pixel to its inverse value. No parameter is used. - * @private - * @param {Canvas} canvas - */ - invert: function invert(canvas) { - var pixels = Filters._toPixels(canvas); - for (var i = 0; i < pixels.length; i += 4) { - pixels[i] = 255 - pixels[i]; - pixels[i + 1] = 255 - pixels[i + 1]; - pixels[i + 2] = 255 - pixels[i + 2]; - } - }, - /** - * Limits each channel of the image to the number of colors specified as - * the parameter. The parameter can be set to values between 2 and 255, but - * results are most noticeable in the lower ranges. - * - * Adapted from java based processing implementation - * - * @private - * @param {Canvas} canvas - * @param {Integer} level - */ - posterize: function posterize(canvas, level) { - var pixels = Filters._toPixels(canvas); - if (level === undefined) { - level = 4; - } - if (level < 2 || level > 255) { - throw new Error( - "Level must be greater than 2 and less than 255 for posterize", - ); - } - var levels1 = level - 1; - for (var i = 0; i < pixels.length; i += 4) { - var rlevel = pixels[i]; - var glevel = pixels[i + 1]; - var blevel = pixels[i + 2]; - // New pixel value by posterizing each color. - pixels[i] = (((rlevel * level) >> 8) * 255) / levels1; - pixels[i + 1] = (((glevel * level) >> 8) * 255) / levels1; - pixels[i + 2] = (((blevel * level) >> 8) * 255) / levels1; - } - }, - /** - * Increases the bright areas in an image. - * @private - * @param {Canvas} canvas - */ - dilate: function dilate(canvas) { - var pixels = Filters._toPixels(canvas); - var currIdx = 0; - var maxIdx = pixels.length ? pixels.length / 4 : 0; - var out = new Int32Array(maxIdx); - var currRowIdx, maxRowIdx, colOrig, colOut, currLum; - var idxRight, idxLeft, idxUp, idxDown; - var colRight, colLeft, colUp, colDown; - var lumRight, lumLeft, lumUp, lumDown; - // Iterates through rows of pixels. - while (currIdx < maxIdx) { - currRowIdx = currIdx; - maxRowIdx = currIdx + canvas.width; - // Iterates through pixels within the current row. - while (currIdx < maxRowIdx) { - // Get original color of current pixel. - colOrig = colOut = Filters._getARGB(pixels, currIdx); - idxLeft = currIdx - 1; - idxRight = currIdx + 1; - idxUp = currIdx - canvas.width; - idxDown = currIdx + canvas.width; - // Adjust the indices to avoid going out of bounds. - if (idxLeft < currRowIdx) { - idxLeft = currIdx; - } - if (idxRight >= maxRowIdx) { - idxRight = currIdx; - } - if (idxUp < 0) { - idxUp = 0; - } - if (idxDown >= maxIdx) { - idxDown = currIdx; - } - colUp = Filters._getARGB(pixels, idxUp); - colLeft = Filters._getARGB(pixels, idxLeft); - colDown = Filters._getARGB(pixels, idxDown); - colRight = Filters._getARGB(pixels, idxRight); - // Compute luminance - currLum = - 77 * ((colOrig >> 16) & 255) + - 151 * ((colOrig >> 8) & 255) + - 28 * (colOrig & 255); - lumLeft = - 77 * ((colLeft >> 16) & 255) + - 151 * ((colLeft >> 8) & 255) + - 28 * (colLeft & 255); - lumRight = - 77 * ((colRight >> 16) & 255) + - 151 * ((colRight >> 8) & 255) + - 28 * (colRight & 255); - lumUp = - 77 * ((colUp >> 16) & 255) + - 151 * ((colUp >> 8) & 255) + - 28 * (colUp & 255); - lumDown = - 77 * ((colDown >> 16) & 255) + - 151 * ((colDown >> 8) & 255) + - 28 * (colDown & 255); - // Update the output color based on the highest luminance value - if (lumLeft > currLum) { - colOut = colLeft; - currLum = lumLeft; - } - if (lumRight > currLum) { - colOut = colRight; - currLum = lumRight; - } - if (lumUp > currLum) { - colOut = colUp; - currLum = lumUp; - } - if (lumDown > currLum) { - colOut = colDown; - currLum = lumDown; - } // Store the updated color. - - out[currIdx++] = colOut; - } - } - Filters._setPixels(pixels, out); - }, - /** - * Reduces the bright areas in an image. - * Similar to `dilate()`, but updates the output color based on the lowest luminance value. - * @private - * @param {Canvas} canvas - */ - erode: function erode(canvas) { - var pixels = Filters._toPixels(canvas); - var currIdx = 0; - var maxIdx = pixels.length ? pixels.length / 4 : 0; - var out = new Int32Array(maxIdx); - var currRowIdx, maxRowIdx, colOrig, colOut, currLum; - var idxRight, idxLeft, idxUp, idxDown; - var colRight, colLeft, colUp, colDown; - var lumRight, lumLeft, lumUp, lumDown; - while (currIdx < maxIdx) { - currRowIdx = currIdx; - maxRowIdx = currIdx + canvas.width; - while (currIdx < maxRowIdx) { - colOrig = colOut = Filters._getARGB(pixels, currIdx); - idxLeft = currIdx - 1; - idxRight = currIdx + 1; - idxUp = currIdx - canvas.width; - idxDown = currIdx + canvas.width; - if (idxLeft < currRowIdx) { - idxLeft = currIdx; - } - if (idxRight >= maxRowIdx) { - idxRight = currIdx; - } - if (idxUp < 0) { - idxUp = 0; - } - if (idxDown >= maxIdx) { - idxDown = currIdx; - } - colUp = Filters._getARGB(pixels, idxUp); - colLeft = Filters._getARGB(pixels, idxLeft); - colDown = Filters._getARGB(pixels, idxDown); - colRight = Filters._getARGB(pixels, idxRight); - //compute luminance - currLum = - 77 * ((colOrig >> 16) & 255) + - 151 * ((colOrig >> 8) & 255) + - 28 * (colOrig & 255); - lumLeft = - 77 * ((colLeft >> 16) & 255) + - 151 * ((colLeft >> 8) & 255) + - 28 * (colLeft & 255); - lumRight = - 77 * ((colRight >> 16) & 255) + - 151 * ((colRight >> 8) & 255) + - 28 * (colRight & 255); - lumUp = - 77 * ((colUp >> 16) & 255) + - 151 * ((colUp >> 8) & 255) + - 28 * (colUp & 255); - lumDown = - 77 * ((colDown >> 16) & 255) + - 151 * ((colDown >> 8) & 255) + - 28 * (colDown & 255); - if (lumLeft < currLum) { - colOut = colLeft; - currLum = lumLeft; - } - if (lumRight < currLum) { - colOut = colRight; - currLum = lumRight; - } - if (lumUp < currLum) { - colOut = colUp; - currLum = lumUp; - } - if (lumDown < currLum) { - colOut = colDown; - currLum = lumDown; - } // Store the updated color. - - out[currIdx++] = colOut; - } - } - Filters._setPixels(pixels, out); - }, - blur: function blur(canvas, radius) { - blurARGB(canvas, radius); - }, - }; - // BLUR - // Internal kernel stuff for the gaussian blur filter. - var blurRadius; - var blurKernelSize; - var blurKernel; - var blurMult; - /* - * Port of https://github.com/processing/processing/blob/ - * main/core/src/processing/core/PImage.java#L1250 - * - * Optimized code for building the blur kernel. - * further optimized blur code (approx. 15% for radius=20) - * bigger speed gains for larger radii (~30%) - * added support for various image types (ALPHA, RGB, ARGB) - * [toxi 050728] - */ - function buildBlurKernel(r) { - var radius = (r * 3.5) | 0; - radius = radius < 1 ? 1 : radius < 248 ? radius : 248; - if (blurRadius !== radius) { - blurRadius = radius; - // Calculating the size of the blur kernel - blurKernelSize = (1 + blurRadius) << 1; - blurKernel = new Int32Array(blurKernelSize); - blurMult = new Array(blurKernelSize); - for (var l = 0; l < blurKernelSize; l++) { - blurMult[l] = new Int32Array(256); - } - var bk, bki; - var bm, bmi; - // Generating blur kernel values. - for (var i = 1, radiusi = radius - 1; i < radius; i++) { - blurKernel[radius + i] = - blurKernel[radiusi] = - bki = - radiusi * radiusi; - bm = blurMult[radius + i]; - bmi = blurMult[radiusi--]; - for (var j = 0; j < 256; j++) { - bm[j] = bmi[j] = bki * j; - } - } - bk = blurKernel[radius] = radius * radius; - bm = blurMult[radius]; - for (var k = 0; k < 256; k++) { - bm[k] = bk * k; - } - } - } // Port of https://github.com/processing/processing/blob/ - // main/core/src/processing/core/PImage.java#L1433 - - function blurARGB(canvas, radius) { - // Get pixel data. - var pixels = Filters._toPixels(canvas); - var width = canvas.width; - var height = canvas.height; - var numPackedPixels = width * height; - var argb = new Int32Array(numPackedPixels); - for (var j = 0; j < numPackedPixels; j++) { - argb[j] = Filters._getARGB(pixels, j); - } - var sum, cr, cg, cb, ca; - var read, ri, ym, ymi, bk0; - var a2 = new Int32Array(numPackedPixels); - var r2 = new Int32Array(numPackedPixels); - var g2 = new Int32Array(numPackedPixels); - var b2 = new Int32Array(numPackedPixels); - var yi = 0; - buildBlurKernel(radius); - var x, y, i; - var bm; - // Horizontal pass. - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - cb = cg = cr = ca = sum = 0; - read = x - blurRadius; - // Handle edge cases. - if (read < 0) { - bk0 = -read; - read = 0; - } else { - if (read >= width) { - break; - } - bk0 = 0; - } - for (i = bk0; i < blurKernelSize; i++) { - if (read >= width) { - break; - } - var c = argb[read + yi]; - bm = blurMult[i]; - ca += bm[(c & -16777216) >>> 24]; - cr += bm[(c & 16711680) >> 16]; - cg += bm[(c & 65280) >> 8]; - cb += bm[c & 255]; - sum += blurKernel[i]; - read++; - } - ri = yi + x; - a2[ri] = ca / sum; - r2[ri] = cr / sum; - g2[ri] = cg / sum; - b2[ri] = cb / sum; - } - yi += width; - } - yi = 0; - ym = -blurRadius; - ymi = ym * width; - // Vertical pass. - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - cb = cg = cr = ca = sum = 0; - // Handle edge cases. - if (ym < 0) { - bk0 = ri = -ym; - read = x; - } else { - if (ym >= height) { - break; - } - bk0 = 0; - ri = ym; - read = x + ymi; - } - for (i = bk0; i < blurKernelSize; i++) { - if (ri >= height) { - break; - } - bm = blurMult[i]; - ca += bm[a2[read]]; - cr += bm[r2[read]]; - cg += bm[g2[read]]; - cb += bm[b2[read]]; - sum += blurKernel[i]; - ri++; - read += width; - } // Set final ARGB value - - argb[x + yi] = - ((ca / sum) << 24) | - ((cr / sum) << 16) | - ((cg / sum) << 8) | - (cb / sum); - } - yi += width; - ymi += width; - ym++; - } - Filters._setPixels(pixels, argb); - } - var _default = Filters; - exports.default = _default; - }, - { - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.int32-array": 235, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-array": 252, - }, - ], - 320: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var _omggif = _interopRequireDefault(_dereq_("omggif")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * @module Image - * @submodule Image - * @for p5 - * @requires core - */ - /** - * This module defines the p5 methods for the p5.Image class - * for drawing images to the main display canvas. - */ - /** - * Creates a new p5.Image object. The new image is - * transparent by default. - * - * `createImage()` uses the `width` and `height` paremeters to set the new - * p5.Image object's dimensions in pixels. The new - * p5.Image can be modified by updating its - * pixels array or by calling its - * get() and - * set() methods. The - * loadPixels() method must be called - * before reading or modifying pixel values. The - * updatePixels() method must be called - * for updates to take effect. - * - * @method createImage - * @param {Integer} width width in pixels. - * @param {Integer} height height in pixels. - * @return {p5.Image} new p5.Image object. - * @example - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * let a = map(x, 0, img.width, 0, 255); - * let c = color(0, a); - * img.set(x, y, c); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A square with a horizontal color gradient that transitions from gray to black.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let d = pixelDensity(); - * let halfImage = 4 * (d * img.width) * (d * img.height / 2); - * for (let i = 0; i < halfImage; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - */ - - _main.default.prototype.createImage = function (width, height) { - _main.default._validateParameters("createImage", arguments); - return new _main.default.Image(width, height); - }; - /** - * Saves the current canvas as an image. The browser will either save the - * file immediately or prompt the user with a dialogue window. - * - * @method saveCanvas - * @param {p5.Framebuffer|p5.Element|HTMLCanvasElement} selectedCanvas reference to a - * specific HTML5 canvas element. - * @param {String} [filename] file name. Defaults to 'untitled'. - * @param {String} [extension] file extension, either 'jpg' or 'png'. Defaults to 'png'. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(255); - * saveCanvas(); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(255); - * saveCanvas('myCanvas.jpg'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(255); - * saveCanvas('myCanvas', 'jpg'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(255); - * saveCanvas(cnv); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(255); - * saveCanvas(cnv, 'myCanvas.jpg'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * let cnv = createCanvas(100, 100); - * background(255); - * saveCanvas(cnv, 'myCanvas', 'jpg'); - * } - * - *
                                  - */ - /** - * @method saveCanvas - * @param {String} [filename] - * @param {String} [extension] - */ - _main.default.prototype.saveCanvas = function () { - _main.default._validateParameters("saveCanvas", arguments); - // copy arguments to array - var args = [].slice.call(arguments); - var htmlCanvas, filename, extension, temporaryGraphics; - if (arguments[0] instanceof HTMLCanvasElement) { - htmlCanvas = arguments[0]; - args.shift(); - } else if (arguments[0] instanceof _main.default.Element) { - htmlCanvas = arguments[0].elt; - args.shift(); - } else if (arguments[0] instanceof _main.default.Framebuffer) { - var framebuffer = arguments[0]; - temporaryGraphics = this.createGraphics( - framebuffer.width, - framebuffer.height, - ); - temporaryGraphics.pixelDensity(pixelDensity()); - framebuffer.loadPixels(); - temporaryGraphics.loadPixels(); - temporaryGraphics.pixels.set(framebuffer.pixels); - temporaryGraphics.updatePixels(); - htmlCanvas = temporaryGraphics.elt; - args.shift(); - } else { - htmlCanvas = this._curElement && this._curElement.elt; - } - if (args.length >= 1) { - filename = args[0]; - } - if (args.length >= 2) { - extension = args[1]; - } - extension = - extension || - _main.default.prototype._checkFileExtension( - filename, - extension, - )[1] || - "png"; - var mimeType; - switch (extension) { - default: - //case 'png': - mimeType = "image/png"; - break; - case "jpeg": - case "jpg": - mimeType = "image/jpeg"; - break; - } - htmlCanvas.toBlob(function (blob) { - _main.default.prototype.downloadFile(blob, filename, extension); - if (temporaryGraphics) temporaryGraphics.remove(); - }, mimeType); - }; - // this is the old saveGif, left here for compatibility purposes - // the only place I found it being used was on image/p5.Image.js, on the - // save function. that has been changed to use this function. - _main.default.prototype.encodeAndDownloadGif = function ( - pImg, - filename, - ) { - var props = pImg.gifProperties; - //convert loopLimit back into Netscape Block formatting - var loopLimit = props.loopLimit; - if (loopLimit === 1) { - loopLimit = null; - } else if (loopLimit === null) { - loopLimit = 0; - } - var buffer = new Uint8Array( - pImg.width * pImg.height * props.numFrames, - ); - var allFramesPixelColors = []; - // Used to determine the occurrence of unique palettes and the frames - // which use them - var paletteFreqsAndFrames = {}; - // Pass 1: - //loop over frames and get the frequency of each palette - for (var i = 0; i < props.numFrames; i++) { - var paletteSet = new Set(); - var data = props.frames[i].image.data; - var dataLength = data.length; - // The color for each pixel in this frame ( for easier lookup later ) - var pixelColors = new Uint32Array(pImg.width * pImg.height); - for (var j = 0, k = 0; j < dataLength; j += 4, k++) { - var r = data[j + 0]; - var g = data[j + 1]; - var b = data[j + 2]; - var color = (r << 16) | (g << 8) | (b << 0); - paletteSet.add(color); - // What color does this pixel have in this frame ? - pixelColors[k] = color; - } // A way to put use the entire palette as an object key - - var paletteStr = _toConsumableArray(paletteSet).sort().toString(); - if (paletteFreqsAndFrames[paletteStr] === undefined) { - paletteFreqsAndFrames[paletteStr] = { - freq: 1, - frames: [i], - }; - } else { - paletteFreqsAndFrames[paletteStr].freq += 1; - paletteFreqsAndFrames[paletteStr].frames.push(i); - } - allFramesPixelColors.push(pixelColors); - } - var framesUsingGlobalPalette = []; - // Now to build the global palette - // Sort all the unique palettes in descending order of their occurrence - var palettesSortedByFreq = Object.keys(paletteFreqsAndFrames).sort( - function (a, b) { - return ( - paletteFreqsAndFrames[b].freq - paletteFreqsAndFrames[a].freq - ); - }, - ); - // The initial global palette is the one with the most occurrence - var globalPalette = palettesSortedByFreq[0] - .split(",") - .map(function (a) { - return parseInt(a); - }); - framesUsingGlobalPalette = framesUsingGlobalPalette.concat( - paletteFreqsAndFrames[globalPalette].frames, - ); - var globalPaletteSet = new Set(globalPalette); - // Build a more complete global palette - // Iterate over the remaining palettes in the order of - // their occurrence and see if the colors in this palette which are - // not in the global palette can be added there, while keeping the length - // of the global palette <= 256 - for (var _i = 1; _i < palettesSortedByFreq.length; _i++) { - var palette = palettesSortedByFreq[_i] - .split(",") - .map(function (a) { - return parseInt(a); - }); - var difference = palette.filter(function (x) { - return !globalPaletteSet.has(x); - }); - if (globalPalette.length + difference.length <= 256) { - for (var _j = 0; _j < difference.length; _j++) { - globalPalette.push(difference[_j]); - globalPaletteSet.add(difference[_j]); - } // All frames using this palette now use the global palette - - framesUsingGlobalPalette = framesUsingGlobalPalette.concat( - paletteFreqsAndFrames[palettesSortedByFreq[_i]].frames, - ); - } - } - framesUsingGlobalPalette = new Set(framesUsingGlobalPalette); - // Build a lookup table of the index of each color in the global palette - // Maps a color to its index - var globalIndicesLookup = {}; - for (var _i2 = 0; _i2 < globalPalette.length; _i2++) { - if (!globalIndicesLookup[globalPalette[_i2]]) { - globalIndicesLookup[globalPalette[_i2]] = _i2; - } - } // force palette to be power of 2 - - var powof2 = 1; - while (powof2 < globalPalette.length) { - powof2 <<= 1; - } - globalPalette.length = powof2; - // global opts - var opts = { - loop: loopLimit, - palette: new Uint32Array(globalPalette), - }; - var gifWriter = new _omggif.default.GifWriter( - buffer, - pImg.width, - pImg.height, - opts, - ); - var previousFrame = {}; - // Pass 2 - // Determine if the frame needs a local palette - // Also apply transparency optimization. This function will often blow up - // the size of a GIF if not for transparency. If a pixel in one frame has - // the same color in the previous frame, that pixel can be marked as - // transparent. We decide one particular color as transparent and make all - // transparent pixels take this color. This helps in later in compression. - var _loop = function _loop(_i3) { - var localPaletteRequired = !framesUsingGlobalPalette.has(_i3); - var palette = localPaletteRequired ? [] : globalPalette; - var pixelPaletteIndex = new Uint8Array(pImg.width * pImg.height); - // Lookup table mapping color to its indices - var colorIndicesLookup = {}; - // All the colors that cannot be marked transparent in this frame - var cannotBeTransparent = new Set(); - allFramesPixelColors[_i3].forEach(function (color, k) { - if (localPaletteRequired) { - if (colorIndicesLookup[color] === undefined) { - colorIndicesLookup[color] = palette.length; - palette.push(color); - } - pixelPaletteIndex[k] = colorIndicesLookup[color]; - } else { - pixelPaletteIndex[k] = globalIndicesLookup[color]; - } - if (_i3 > 0) { - // If even one pixel of this color has changed in this frame - // from the previous frame, we cannot mark it as transparent - if (allFramesPixelColors[_i3 - 1][k] !== color) { - cannotBeTransparent.add(color); - } - } - }); - var frameOpts = {}; - // Transparency optimization - var canBeTransparent = palette.filter(function (a) { - return !cannotBeTransparent.has(a); - }); - if (canBeTransparent.length > 0) { - // Select a color to mark as transparent - var transparent = canBeTransparent[0]; - var transparentIndex = localPaletteRequired - ? colorIndicesLookup[transparent] - : globalIndicesLookup[transparent]; - if (_i3 > 0) { - for ( - var _k = 0; - _k < allFramesPixelColors[_i3].length; - _k++ - ) { - // If this pixel in this frame has the same color in previous frame - if ( - allFramesPixelColors[_i3 - 1][_k] === - allFramesPixelColors[_i3][_k] - ) { - pixelPaletteIndex[_k] = transparentIndex; - } - } - frameOpts.transparent = transparentIndex; - // If this frame has any transparency, do not dispose the previous frame - previousFrame.frameOpts.disposal = 1; - } - } - frameOpts.delay = props.frames[_i3].delay / 10; // Move timing back into GIF formatting - if (localPaletteRequired) { - // force palette to be power of 2 - var _powof = 1; - while (_powof < palette.length) { - _powof <<= 1; - } - palette.length = _powof; - frameOpts.palette = new Uint32Array(palette); - } - if (_i3 > 0) { - // add the frame that came before the current one - gifWriter.addFrame( - 0, - 0, - pImg.width, - pImg.height, - previousFrame.pixelPaletteIndex, - previousFrame.frameOpts, - ); - } // previous frame object should now have details of this frame - - previousFrame = { - pixelPaletteIndex: pixelPaletteIndex, - frameOpts: frameOpts, - }; - }; - for (var _i3 = 0; _i3 < props.numFrames; _i3++) { - _loop(_i3); - } - previousFrame.frameOpts.disposal = 1; - // add the last frame - gifWriter.addFrame( - 0, - 0, - pImg.width, - pImg.height, - previousFrame.pixelPaletteIndex, - previousFrame.frameOpts, - ); - var extension = "gif"; - var blob = new Blob([buffer.slice(0, gifWriter.end())], { - type: "image/gif", - }); - _main.default.prototype.downloadFile(blob, filename, extension); - }; - /** - * Captures a sequence of frames from the canvas that can be used to create a - * movie. Frames are downloaded as individual image files by default. + * If an object is passed as the parameter, all attributes + * not declared in the object will be set to defaults. * - * The first parameter, `filename`, sets the prefix for the file names. For - * example, setting the prefix to `'frame'` would generate the image files - * `frame0.png`, `frame1.png`, and so on. The second parameter, `extension`, - * sets the file type to either `'png'` or `'jpg'`. + * The available attributes are: + *
                                  + * alpha - indicates if the canvas contains an alpha buffer + * default is true * - * The third parameter, `duration`, sets the duration to record in seconds. - * The maximum duration is 15 seconds. The fourth parameter, `framerate`, sets - * the number of frames to record per second. The maximum frame rate value is - * 22. Limits are placed on `duration` and `framerate` to avoid using too much - * memory. Recording large canvases can easily crash sketches or even web - * browsers. + * depth - indicates whether the drawing buffer has a depth buffer + * of at least 16 bits - default is true * - * The fifth parameter, `callback`, is optional. If a function is passed, - * image files won't be saved by default. The callback function can be used - * to process an array containing the data for each captured frame. The array - * of image data contains a sequence of objects with three properties for each - * frame: `imageData`, `filename`, and `extension`. + * stencil - indicates whether the drawing buffer has a stencil buffer + * of at least 8 bits * - * @method saveFrames - * @param {String} filename prefix of file name. - * @param {String} extension file extension, either 'jpg' or 'png'. - * @param {Number} duration duration in seconds to record. This parameter will be constrained to be less or equal to 15. - * @param {Number} framerate number of frames to save per second. This parameter will be constrained to be less or equal to 22. - * @param {function(Array)} [callback] callback function that will be executed - to handle the image data. This function - should accept an array as argument. The - array will contain the specified number of - frames of objects. Each object has three - properties: `imageData`, `filename`, and `extension`. + * antialias - indicates whether or not to perform anti-aliasing + * default is false (true in Safari) + * + * premultipliedAlpha - indicates that the page compositor will assume + * the drawing buffer contains colors with pre-multiplied alpha + * default is true + * + * preserveDrawingBuffer - if true the buffers will not be cleared and + * and will preserve their values until cleared or overwritten by author + * (note that p5 clears automatically on draw loop) + * default is true + * + * perPixelLighting - if true, per-pixel lighting will be used in the + * lighting shader otherwise per-vertex lighting is used. + * default is true. + * + * version - either 1 or 2, to specify which WebGL version to ask for. By + * default, WebGL 2 will be requested. If WebGL2 is not available, it will + * fall back to WebGL 1. You can check what version is used with by looking at + * the global `webglVersion` property. + * + * @method setAttributes + * @for p5 + * @param {String} key Name of attribute + * @param {Boolean} value New value of named attribute * @example *
                                  * - * function draw() { - * let r = frameCount % 255; - * let g = 50; - * let b = 100; - * background(r, g, b); - * - * describe('A square repeatedly changes color from blue to pink.'); + * function setup() { + * createCanvas(100, 100, WEBGL); * } * - * function keyPressed() { - * if (key === 's') { - * saveFrames('frame', 'png', 1, 5); - * } + * function draw() { + * background(255); + * push(); + * rotateZ(frameCount * 0.02); + * rotateX(frameCount * 0.02); + * rotateY(frameCount * 0.02); + * fill(0, 0, 0); + * box(50); + * pop(); * } * *
                                  - * + *
                                  + * Now with the antialias attribute set to true. + *
                                  *
                                  * - * function draw() { - * let r = frameCount % 255; - * let g = 50; - * let b = 100; - * background(r, g, b); - * - * describe('A square repeatedly changes color from blue to pink.'); + * function setup() { + * setAttributes('antialias', true); + * createCanvas(100, 100, WEBGL); * } * - * function mousePressed() { - * saveFrames('frame', 'png', 1, 5, data => { - * // Prints an array of objects containing raw image data, - * // filenames, and extensions. - * print(data); - * }); + * function draw() { + * background(255); + * push(); + * rotateZ(frameCount * 0.02); + * rotateX(frameCount * 0.02); + * rotateY(frameCount * 0.02); + * fill(0, 0, 0); + * box(50); + * pop(); * } * *
                                  - */ - _main.default.prototype.saveFrames = function ( - fName, - ext, - _duration, - _fps, - callback, - ) { - _main.default._validateParameters("saveFrames", arguments); - var duration = _duration || 3; - duration = _main.default.prototype.constrain(duration, 0, 15); - duration = duration * 1000; - var fps = _fps || 15; - fps = _main.default.prototype.constrain(fps, 0, 22); - var count = 0; - var makeFrame = _main.default.prototype._makeFrame; - var cnv = this._curElement.elt; - var frames = []; - var frameFactory = setInterval(function () { - frames.push(makeFrame(fName + count, ext, cnv)); - count++; - }, 1000 / fps); - setTimeout(function () { - clearInterval(frameFactory); - if (callback) { - callback(frames); - } else { - for ( - var _i4 = 0, _frames = frames; - _i4 < _frames.length; - _i4++ - ) { - var f = _frames[_i4]; - _main.default.prototype.downloadFile( - f.imageData, - f.filename, - f.ext, - ); - } - } - frames = []; // clear frames - }, duration + 0.01); - }; - _main.default.prototype._makeFrame = function ( - filename, - extension, - _cnv, - ) { - var cnv; - if (this) { - cnv = this._curElement.elt; - } else { - cnv = _cnv; - } - var mimeType; - if (!extension) { - extension = "png"; - mimeType = "image/png"; - } else { - switch (extension.toLowerCase()) { - case "png": - mimeType = "image/png"; - break; - case "jpeg": - mimeType = "image/jpeg"; - break; - case "jpg": - mimeType = "image/jpeg"; - break; - default: - mimeType = "image/png"; - break; - } - } - var downloadMime = "image/octet-stream"; - var imageData = cnv.toDataURL(mimeType); - imageData = imageData.replace(mimeType, downloadMime); - var thisFrame = {}; - thisFrame.imageData = imageData; - thisFrame.filename = filename; - thisFrame.ext = extension; - return thisFrame; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.set": 207, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint32-array": 251, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - omggif: 270, - }, - ], - 321: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.copy-within"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.copy-within"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - _dereq_("regenerator-runtime/runtime"); - var _main = _interopRequireDefault(_dereq_("../core/main")); - var _helpers = _interopRequireDefault(_dereq_("../core/helpers")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - var _omggif = _interopRequireDefault(_dereq_("omggif")); - var _gifenc = _dereq_("gifenc"); - _dereq_("../core/friendly_errors/validate_params"); - _dereq_("../core/friendly_errors/file_errors"); - _dereq_("../core/friendly_errors/fes_core"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function asyncGeneratorStep( - gen, - resolve, - reject, - _next, - _throw, - key, - arg, - ) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep( - gen, - resolve, - reject, - _next, - _throw, - "next", - value, - ); - } - function _throw(err) { - asyncGeneratorStep( - gen, - resolve, - reject, - _next, - _throw, - "throw", - err, - ); - } - _next(undefined); - }); - }; - } /** - * @module Image - * @submodule Loading & Displaying - * @for p5 - * @requires core - */ - /** - * Loads an image to create a p5.Image object. - * - * `loadImage()` interprets the first parameter one of three ways. If the path - * to an image file is provided, `loadImage()` will load it. Paths to local - * files should be relative, such as `'assets/thundercat.jpg'`. URLs such as - * `'https://example.com/thundercat.jpg'` may be blocked due to browser - * security. Raw image data can also be passed as a base64 encoded image in - * the form `'data:image/png;base64,arandomsequenceofcharacters'`. - * - * The second parameter is optional. If a function is passed, it will be - * called once the image has loaded. The callback function can optionally use - * the new p5.Image object. - * - * The third parameter is also optional. If a function is passed, it will be - * called if the image fails to load. The callback function can optionally use - * the event error. - * - * Images can take time to load. Calling `loadImage()` in - * preload() ensures images load before they're - * used in setup() or draw(). - * - * @method loadImage - * @param {String} path path of the image to be loaded or base64 encoded image. - * @param {function(p5.Image)} [successCallback] function called with - * p5.Image once it - * loads. - * @param {function(Event)} [failureCallback] function called with event - * error if the image fails to load. - * @return {p5.Image} the p5.Image object. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * describe('Image of the underside of a white umbrella and a gridded ceiling.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * loadImage('assets/laDefense.jpg', img => { - * image(img, 0, 0); - * }); - * describe('Image of the underside of a white umbrella and a gridded ceiling.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * loadImage('assets/laDefense.jpg', success, failure); - * } - * - * function success(img) { - * image(img, 0, 0); - * describe('Image of the underside of a white umbrella and a gridded ceiling.'); - * } - * - * function failure(event) { - * console.error('Oops!', event); - * } - * - *
                                  - */ - - _main.default.prototype.loadImage = function ( - path, - successCallback, - failureCallback, - ) { - _main.default._validateParameters("loadImage", arguments); - var pImg = new _main.default.Image(1, 1, this); - var self = this; - var req = new Request(path, { - method: "GET", - mode: "cors", - }); - fetch(path, req) - .then(function (response) { - // GIF section - var contentType = response.headers.get("content-type"); - if (contentType === null) { - console.warn( - "The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset.", - ); - } - if (contentType && contentType.includes("image/gif")) { - response.arrayBuffer().then( - function (arrayBuffer) { - if (arrayBuffer) { - var byteArray = new Uint8Array(arrayBuffer); - _createGif( - byteArray, - pImg, - successCallback, - failureCallback, - function (pImg) { - self._decrementPreload(); - }.bind(self), - ); - } - }, - function (e) { - if (typeof failureCallback === "function") { - failureCallback(e); - self._decrementPreload(); - } else { - console.error(e); - } - }, - ); - } else { - // Non-GIF Section - var img = new Image(); - img.onload = function () { - pImg.width = pImg.canvas.width = img.width; - pImg.height = pImg.canvas.height = img.height; - // Draw the image into the backing canvas of the p5.Image - pImg.drawingContext.drawImage(img, 0, 0); - pImg.modified = true; - if (typeof successCallback === "function") { - successCallback(pImg); - } - self._decrementPreload(); - }; - img.onerror = function (e) { - _main.default._friendlyFileLoadError(0, img.src); - if (typeof failureCallback === "function") { - failureCallback(e); - self._decrementPreload(); - } else { - console.error(e); - } - }; - // Set crossOrigin in case image is served with CORS headers. - // This will let us draw to the canvas without tainting it. - // See https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image - // When using data-uris the file will be loaded locally - // so we don't need to worry about crossOrigin with base64 file types. - if (path.indexOf("data:image/") !== 0) { - img.crossOrigin = "Anonymous"; - } // start loading the image - - img.src = path; - } - pImg.modified = true; - }) - .catch(function (e) { - _main.default._friendlyFileLoadError(0, path); - if (typeof failureCallback === "function") { - failureCallback(e); - self._decrementPreload(); - } else { - console.error(e); - } - }); - return pImg; - }; - /** - * Generates a gif from a sketch and saves it to a file. `saveGif()` may be - * called in setup() or at any point while a sketch - * is running. - * - * The first parameter, `fileName`, sets the gif's file name. The second - * parameter, `duration`, sets the gif's duration in seconds. - * - * The third parameter, `options`, is optional. If an object is passed, - * `saveGif()` will use its properties to customize the gif. `saveGif()` - * recognizes the properties `delay`, `units`, `silent`, - * `notificationDuration`, and `notificationID`. - * - * @method saveGif - * @param {String} filename file name of gif. - * @param {Number} duration duration in seconds to capture from the sketch. - * @param {Object} [options] an object that can contain five more properties: - * `delay`, a Number specifying how much time to wait before recording; - * `units`, a String that can be either 'seconds' or 'frames'. By default it's 'seconds’; - * `silent`, a Boolean that defines presence of progress notifications. By default it’s `false`; - * `notificationDuration`, a Number that defines how long in seconds the final notification - * will live. By default it's `0`, meaning the notification will never be removed; - * `notificationID`, a String that specifies the id of the notification's DOM element. By default it’s `'progressBar’`. - * - * @example - *
                                  - * - * function draw() { - * background(200); - * let c = frameCount % 255; - * fill(c); - * circle(50, 50, 25); - * - * describe('A circle drawn in the middle of a gray square. The circle changes color from black to white, then repeats.'); - * } - * - * function keyPressed() { - * if (key === 's') { - * saveGif('mySketch', 5); - * } - * } - * - *
                                  - */ - _main.default.prototype.saveGif = /*#__PURE__*/ (function () { - var _ref = _asyncToGenerator( - /*#__PURE__*/ regeneratorRuntime.mark( - function _callee(fileName, duration) { - var options, - delay, - units, - silent, - notificationDuration, - notificationID, - _frameRate, - gifFrameDelay, - nFrames, - nFramesDelay, - totalNumberOfFrames, - frameIterator, - lastPixelDensity, - frames, - p, - pixels, - gl, - data, - gif, - globalPalette, - paletteCache, - getIndexedFrame, - transparentIndex, - prevIndexedFrame, - i, - indexedFrame, - originalIndexedFrame, - _i, - buffer, - extension, - blob, - _args = arguments; - return regeneratorRuntime.wrap( - function _callee$(_context) { - while (1) { - switch ((_context.prev = _context.next)) { - case 0: - options = - _args.length > 2 && _args[2] !== undefined - ? _args[2] - : { - delay: 0, - units: "seconds", - silent: false, - notificationDuration: 0, - notificationID: "progressBar", - }; - if (!(typeof fileName !== "string")) { - _context.next = 3; - break; - } - throw TypeError( - "fileName parameter must be a string", - ); - case 3: - if (!(typeof duration !== "number")) { - _context.next = 5; - break; - } - throw TypeError( - "Duration parameter must be a number", - ); - case 5: - // extract variables for more comfortable use - delay = (options && options.delay) || 0; // in seconds - units = (options && options.units) || "seconds"; // either 'seconds' or 'frames' - silent = (options && options.silent) || false; - notificationDuration = - (options && options.notificationDuration) || 0; - notificationID = - (options && options.notificationID) || - "progressBar"; // if arguments in the options object are not correct, cancel operation - if (!(typeof delay !== "number")) { - _context.next = 12; - break; - } - throw TypeError("Delay parameter must be a number"); - case 12: - if (!(units !== "seconds" && units !== "frames")) { - _context.next = 14; - break; - } - throw TypeError( - 'Units parameter must be either "frames" or "seconds"', - ); - case 14: - if (!(typeof silent !== "boolean")) { - _context.next = 16; - break; - } - throw TypeError( - "Silent parameter must be a boolean", - ); - case 16: - if (!(typeof notificationDuration !== "number")) { - _context.next = 18; - break; - } - throw TypeError( - "Notification duration parameter must be a number", - ); - case 18: - if (!(typeof notificationID !== "string")) { - _context.next = 20; - break; - } - throw TypeError( - "Notification ID parameter must be a string", - ); - case 20: - this._recording = true; - // get the project's framerate - _frameRate = this._targetFrameRate; // if it is undefined or some non useful value, assume it's 60 - if ( - _frameRate === Infinity || - _frameRate === undefined || - _frameRate === 0 - ) { - _frameRate = 60; - } // calculate frame delay based on frameRate - // this delay has nothing to do with the - // delay in options, but rather is the delay - // we have to specify to the gif encoder between frames. - - gifFrameDelay = (1 / _frameRate) * 1000; // constrain it to be always greater than 20, - // otherwise it won't work in some browsers and systems - // reference: https://stackoverflow.com/questions/64473278/gif-frame-duration-seems-slower-than-expected - gifFrameDelay = - gifFrameDelay < 20 ? 20 : gifFrameDelay; - // check the mode we are in and how many frames - // that duration translates to - nFrames = - units === "seconds" - ? duration * _frameRate - : duration; - nFramesDelay = - units === "seconds" ? delay * _frameRate : delay; - totalNumberOfFrames = nFrames + nFramesDelay; // initialize variables for the frames processing - frameIterator = nFramesDelay; - this.frameCount = frameIterator; - lastPixelDensity = this._pixelDensity; - this.pixelDensity(1); - // We first take every frame that we are going to use for the animation - frames = []; - if ( - document.getElementById(notificationID) !== null - ) - document.getElementById(notificationID).remove(); - if (!silent) { - p = this.createP(""); - p.id(notificationID); - p.style("font-size", "16px"); - p.style("font-family", "Montserrat"); - p.style("background-color", "#ffffffa0"); - p.style("padding", "8px"); - p.style("border-radius", "10px"); - p.position(0, 0); - } - if ( - this._renderer instanceof _main.default.RendererGL - ) { - // if we have a WEBGL context, initialize the pixels array - // and the gl context to use them inside the loop - gl = this.drawingContext; - pixels = new Uint8Array( - gl.drawingBufferWidth * - gl.drawingBufferHeight * - 4, - ); - } // stop the loop since we are going to manually redraw - - this.noLoop(); - // Defer execution until the rest of the call stack finishes, allowing the - // rest of `setup` to be called (and, importantly, canvases hidden in setup - // to be unhidden.) - // - // Waiting on this empty promise means we'll continue as soon as setup - // finishes without waiting for another frame. - _context.next = 39; - return Promise.resolve(); - case 39: - if (!(frameIterator < totalNumberOfFrames)) { - _context.next = 50; - break; - } /* - we draw the next frame. this is important, since - busy sketches or low end devices might take longer - to render some frames. So we just wait for the frame - to be drawn and immediately save it to a buffer and continue - */ - - this.redraw(); - // depending on the context we'll extract the pixels one way - // or another - data = undefined; - if ( - this._renderer instanceof _main.default.RendererGL - ) { - pixels = new Uint8Array( - gl.drawingBufferWidth * - gl.drawingBufferHeight * - 4, - ); - gl.readPixels( - 0, - 0, - gl.drawingBufferWidth, - gl.drawingBufferHeight, - gl.RGBA, - gl.UNSIGNED_BYTE, - pixels, - ); - data = _flipPixels(pixels); - } else { - data = this.drawingContext.getImageData( - 0, - 0, - this.width, - this.height, - ).data; - } - frames.push(data); - frameIterator++; - if (!silent) { - p.html( - "Saved frame " + - frames.length.toString() + - " out of " + - nFrames.toString(), - ); - } - _context.next = 48; - return new Promise(function (resolve) { - return setTimeout(resolve, 0); - }); - case 48: - _context.next = 39; - break; - case 50: - if (!silent) - p.html( - "Frames processed, generating color palette...", - ); - this.loop(); - this.pixelDensity(lastPixelDensity); - // create the gif encoder and the colorspace format - gif = (0, _gifenc.GIFEncoder)(); // calculate the global palette for this set of frames - globalPalette = _generateGlobalPalette(frames); // Rather than using applyPalette() from the gifenc library, we use our - // own function to map frame pixels to a palette color. This way, we can - // cache palette color mappings between frames for extra performance, and - // use our own caching mechanism to avoid flickering colors from cache - // key collisions. - paletteCache = {}; - getIndexedFrame = function getIndexedFrame(frame) { - var length = frame.length / 4; - var index = new Uint8Array(length); - for (var i = 0; i < length; i++) { - var key = - (frame[i * 4] << 24) | - (frame[i * 4 + 1] << 16) | - (frame[i * 4 + 2] << 8) | - frame[i * 4 + 3]; - if (paletteCache[key] === undefined) { - paletteCache[key] = (0, - _gifenc.nearestColorIndex)( - globalPalette, - frame.slice(i * 4, (i + 1) * 4), - ); - } - index[i] = paletteCache[key]; - } - return index; - }; // the way we designed the palette means we always take the last index for transparency - transparentIndex = globalPalette.length - 1; // we are going to iterate the frames in pairs, n-1 and n - prevIndexedFrame = []; - i = 0; - case 60: - if (!(i < frames.length)) { - _context.next = 71; - break; - } //const indexedFrame = applyPalette(frames[i], globalPaletteWithoutAlpha, 'rgba565'); - - indexedFrame = getIndexedFrame(frames[i]); // Make a copy of the palette-applied frame before editing the original - // to use transparent pixels - originalIndexedFrame = indexedFrame.slice(); - if (i === 0) { - gif.writeFrame( - indexedFrame, - this.width, - this.height, - { - palette: globalPalette, - delay: gifFrameDelay, - dispose: 1, - }, - ); - } else { - // Matching pixels between frames can be set to full transparency, - // allowing the previous frame's pixels to show through. We only do - // this for pixels that get mapped to the same quantized color so that - // the resulting image would be the same. - for (_i = 0; _i < indexedFrame.length; _i++) { - if (indexedFrame[_i] === prevIndexedFrame[_i]) { - indexedFrame[_i] = transparentIndex; - } - } // Write frame into the encoder - - gif.writeFrame( - indexedFrame, - this.width, - this.height, - { - delay: gifFrameDelay, - transparent: true, - transparentIndex: transparentIndex, - dispose: 1, - }, - ); - } - prevIndexedFrame = originalIndexedFrame; - if (!silent) { - p.html( - "Rendered frame " + - i.toString() + - " out of " + - nFrames.toString(), - ); - } // this just makes the process asynchronous, preventing - // that the encoding locks up the browser - - _context.next = 68; - return new Promise(function (resolve) { - return setTimeout(resolve, 0); - }); - case 68: - i++; - _context.next = 60; - break; - case 71: - gif.finish(); - // Get a direct typed array view into the buffer to avoid copying it - buffer = gif.bytesView(); - extension = "gif"; - blob = new Blob([buffer], { - type: "image/gif", - }); - frames = []; - this._recording = false; - this.loop(); - if (!silent) { - p.html("Done. Downloading your gif!🌸"); - if (notificationDuration > 0) - setTimeout(function () { - return p.remove(); - }, notificationDuration * 1000); - } - _main.default.prototype.downloadFile( - blob, - fileName, - extension, - ); - case 80: - case "end": - return _context.stop(); - } - } - }, - _callee, - this, - ); - }, - ), - ); - return function (_x, _x2) { - return _ref.apply(this, arguments); - }; - })(); - function _flipPixels(pixels) { - // extracting the pixels using readPixels returns - // an upside down image. we have to flip it back - // first. this solution is proposed by gman on - // this stack overflow answer: - // https://stackoverflow.com/questions/41969562/how-can-i-flip-the-result-of-webglrenderingcontext-readpixels - var halfHeight = parseInt(height / 2); - var bytesPerRow = width * 4; - // make a temp buffer to hold one row - var temp = new Uint8Array(width * 4); - for (var y = 0; y < halfHeight; ++y) { - var topOffset = y * bytesPerRow; - var bottomOffset = (height - y - 1) * bytesPerRow; - // make copy of a row on the top half - temp.set(pixels.subarray(topOffset, topOffset + bytesPerRow)); - // copy a row from the bottom half to the top - pixels.copyWithin( - topOffset, - bottomOffset, - bottomOffset + bytesPerRow, - ); - // copy the copy of the top half row to the bottom half - pixels.set(temp, bottomOffset); - } - return pixels; - } - function _generateGlobalPalette(frames) { - // make an array the size of every possible color in every possible frame - // that is: width * height * frames. - var allColors = new Uint8Array(frames.length * frames[0].length); - // put every frame one after the other in sequence. - // this array will hold absolutely every pixel from the animation. - // the set function on the Uint8Array works super fast tho! - for (var f = 0; f < frames.length; f++) { - allColors.set(frames[f], f * frames[0].length); - } // quantize this massive array into 256 colors and return it! - - var colorPalette = (0, _gifenc.quantize)(allColors, 256, { - format: "rgba4444", - oneBitAlpha: true, - }); - // when generating the palette, we have to leave space for 1 of the - // indices to be a random color that does not appear anywhere in our - // animation to use for transparency purposes. So, if the palette is full - // (has 256 colors), we overwrite the last one with a random, fully transparent - // color. Otherwise, we just push a new color into the palette the same way. - // this guarantees that when using the transparency index, there are no matches - // between some colors of the animation and the "holes" we want to dig on them, - // which would cause pieces of some frames to be transparent and thus look glitchy. - if (colorPalette.length === 256) { - colorPalette[colorPalette.length - 1] = [ - Math.random() * 255, - Math.random() * 255, - Math.random() * 255, - 0, - ]; - } else { - colorPalette.push([ - Math.random() * 255, - Math.random() * 255, - Math.random() * 255, - 0, - ]); - } - return colorPalette; - } /** - * Helper function for loading GIF-based images - */ - - function _createGif( - arrayBuffer, - pImg, - successCallback, - failureCallback, - finishCallback, - ) { - var gifReader = new _omggif.default.GifReader(arrayBuffer); - pImg.width = pImg.canvas.width = gifReader.width; - pImg.height = pImg.canvas.height = gifReader.height; - var frames = []; - var numFrames = gifReader.numFrames(); - var framePixels = new Uint8ClampedArray( - pImg.width * pImg.height * 4, - ); - var loadGIFFrameIntoImage = function loadGIFFrameIntoImage( - frameNum, - gifReader, - ) { - try { - gifReader.decodeAndBlitFrameRGBA(frameNum, framePixels); - } catch (e) { - _main.default._friendlyFileLoadError(8, pImg.src); - if (typeof failureCallback === "function") { - failureCallback(e); - } else { - console.error(e); - } - } - }; - for (var j = 0; j < numFrames; j++) { - var frameInfo = gifReader.frameInfo(j); - var prevFrameData = pImg.drawingContext.getImageData( - 0, - 0, - pImg.width, - pImg.height, - ); - framePixels = prevFrameData.data.slice(); - loadGIFFrameIntoImage(j, gifReader); - var imageData = new ImageData( - framePixels, - pImg.width, - pImg.height, - ); - pImg.drawingContext.putImageData(imageData, 0, 0); - var frameDelay = frameInfo.delay; - // To maintain the default of 10FPS when frameInfo.delay equals to 0 - if (frameDelay === 0) { - frameDelay = 10; - } - frames.push({ - image: pImg.drawingContext.getImageData( - 0, - 0, - pImg.width, - pImg.height, - ), - delay: frameDelay * 10, //GIF stores delay in one-hundredth of a second, shift to ms - }); - // Some GIFs are encoded so that they expect the previous frame - // to be under the current frame. This can occur at a sub-frame level - // - // Values : 0 - No disposal specified. The decoder is - // not required to take any action. - // 1 - Do not dispose. The graphic is to be left - // in place. - // 2 - Restore to background color. The area used by the - // graphic must be restored to the background color. - // 3 - Restore to previous. The decoder is required to - // restore the area overwritten by the graphic with - // what was there prior to rendering the graphic. - // 4-7 - To be defined. - if (frameInfo.disposal === 2) { - // Restore background color - pImg.drawingContext.clearRect( - frameInfo.x, - frameInfo.y, - frameInfo.width, - frameInfo.height, - ); - } else if (frameInfo.disposal === 3) { - // Restore previous - pImg.drawingContext.putImageData( - prevFrameData, - 0, - 0, - frameInfo.x, - frameInfo.y, - frameInfo.width, - frameInfo.height, - ); - } - } //Uses Netscape block encoding - //to repeat forever, this will be 0 - //to repeat just once, this will be null - //to repeat N times (1 1) { - pImg.gifProperties = { - displayIndex: 0, - loopLimit: loopLimit, - loopCount: 0, - frames: frames, - numFrames: numFrames, - playing: true, - timeDisplayed: 0, - lastChangeTime: 0, - }; - } - if (typeof successCallback === "function") { - successCallback(pImg); - } - finishCallback(); - } /** - * @private - * @param {Constant} xAlign either LEFT, RIGHT or CENTER - * @param {Constant} yAlign either TOP, BOTTOM or CENTER - * @param {Number} dx - * @param {Number} dy - * @param {Number} dw - * @param {Number} dh - * @param {Number} sw - * @param {Number} sh - * @returns {Object} - */ - - function _imageContain(xAlign, yAlign, dx, dy, dw, dh, sw, sh) { - var r = Math.max(sw / dw, sh / dh); - var adjusted_dw = sw / r, - adjusted_dh = sh / r; - var x = dx; - var y = dy; - if (xAlign === constants.CENTER) { - x += (dw - adjusted_dw) / 2; - } else if (xAlign === constants.RIGHT) { - x += dw - adjusted_dw; - } - if (yAlign === constants.CENTER) { - y += (dh - adjusted_dh) / 2; - } else if (yAlign === constants.BOTTOM) { - y += dh - adjusted_dh; - } - return { - x: x, - y: y, - w: adjusted_dw, - h: adjusted_dh, - }; - } /** - * @private - * @param {Constant} xAlign either LEFT, RIGHT or CENTER - * @param {Constant} yAlign either TOP, BOTTOM or CENTER - * @param {Number} dw - * @param {Number} dh - * @param {Number} sx - * @param {Number} sy - * @param {Number} sw - * @param {Number} sh - * @returns {Object} - */ - - function _imageCover(xAlign, yAlign, dw, dh, sx, sy, sw, sh) { - var r = Math.max(dw / sw, dh / sh); - var adjusted_sw = dw / r, - adjusted_sh = dh / r; - var x = sx; - var y = sy; - if (xAlign === constants.CENTER) { - x += (sw - adjusted_sw) / 2; - } else if (xAlign === constants.RIGHT) { - x += sw - adjusted_sw; - } - if (yAlign === constants.CENTER) { - y += (sh - adjusted_sh) / 2; - } else if (yAlign === constants.BOTTOM) { - y += sh - adjusted_sh; - } - return { - x: x, - y: y, - w: adjusted_sw, - h: adjusted_sh, - }; - } /** - * @private - * @param {Constant} [fit] either CONTAIN or COVER - * @param {Constant} xAlign either LEFT, RIGHT or CENTER - * @param {Constant} yAlign either TOP, BOTTOM or CENTER - * @param {Number} dx - * @param {Number} dy - * @param {Number} dw - * @param {Number} dh - * @param {Number} sx - * @param {Number} sy - * @param {Number} sw - * @param {Number} sh - * @returns {Object} - */ - - function _imageFit( - fit, - xAlign, - yAlign, - dx, - dy, - dw, - dh, - sx, - sy, - sw, - sh, - ) { - if (fit === constants.COVER) { - var _imageCover2 = _imageCover( - xAlign, - yAlign, - dw, - dh, - sx, - sy, - sw, - sh, - ), - x = _imageCover2.x, - y = _imageCover2.y, - w = _imageCover2.w, - h = _imageCover2.h; - sx = x; - sy = y; - sw = w; - sh = h; - } - if (fit === constants.CONTAIN) { - var _imageContain2 = _imageContain( - xAlign, - yAlign, - dx, - dy, - dw, - dh, - sw, - sh, - ), - _x3 = _imageContain2.x, - _y = _imageContain2.y, - _w = _imageContain2.w, - _h = _imageContain2.h; - dx = _x3; - dy = _y; - dw = _w; - dh = _h; - } - return { - sx: sx, - sy: sy, - sw: sw, - sh: sh, - dx: dx, - dy: dy, - dw: dw, - dh: dh, - }; - } /** - * Validates clipping params. Per drawImage spec sWidth and sHight cannot be - * negative or greater than image intrinsic width and height - * @private - * @param {Number} sVal - * @param {Number} iVal - * @returns {Number} - * @private - */ - - function _sAssign(sVal, iVal) { - if (sVal > 0 && sVal < iVal) { - return sVal; - } else { - return iVal; - } - } /** - * Draws a source image to the canvas. - * - * The first parameter, `img`, is the source image to be drawn. The second and - * third parameters, `dx` and `dy`, set the coordinates of the destination - * image's top left corner. See imageMode() for - * other ways to position images. - * - * Here's a diagram that explains how optional parameters work in `image()`: - * - * - * - * The fourth and fifth parameters, `dw` and `dh`, are optional. They set the - * the width and height to draw the destination image. By default, `image()` - * draws the full source image at its original size. - * - * The sixth and seventh parameters, `sx` and `sy`, are also optional. - * These coordinates define the top left corner of a subsection to draw from - * the source image. - * - * The eighth and ninth parameters, `sw` and `sh`, are also optional. - * They define the width and height of a subsection to draw from the source - * image. By default, `image()` draws the full subsection that begins at - * (`sx`, `sy`) and extends to the edges of the source image. - * - * The ninth parameter, `fit`, is also optional. It enables a subsection of - * the source image to be drawn without affecting its aspect ratio. If - * `CONTAIN` is passed, the full subsection will appear within the destination - * rectangle. If `COVER` is passed, the subsection will completely cover the - * destination rectangle. This may have the effect of zooming into the - * subsection. - * - * The tenth and eleventh paremeters, `xAlign` and `yAlign`, are also - * optional. They determine how to align the fitted subsection. `xAlign` can - * be set to either `LEFT`, `RIGHT`, or `CENTER`. `yAlign` can be set to - * either `TOP`, `BOTTOM`, or `CENTER`. By default, both `xAlign` and `yAlign` - * are set to `CENTER`. - * - * @method image - * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img image to display. - * @param {Number} x x-coordinate of the top-left corner of the image. - * @param {Number} y y-coordinate of the top-left corner of the image. - * @param {Number} [width] width to draw the image. - * @param {Number} [height] height to draw the image. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0); - * - * describe('An image of the underside of a white umbrella with a gridded ceiling above.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 10, 10); - * - * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image has dark gray borders on its left and top.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0, 50, 50); - * - * describe('An image of the underside of a white umbrella with a gridded ceiling above. The image is drawn in the top left corner of a dark gray square.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 25, 25, 50, 50, 25, 25, 50, 50); - * - * describe('An image of a gridded ceiling drawn in the center of a dark gray square.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/moonwalk.jpg'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0, width, height, 0, 0, img.width, img.height, CONTAIN); - * - * describe('An image of an astronaut on the moon. The top and bottom borders of the image are dark gray.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * // Image is 50 x 50 pixels. - * img = loadImage('assets/laDefense50.png'); - * } - * - * function setup() { - * background(50); - * image(img, 0, 0, width, height, 0, 0, img.width, img.height, COVER); - * - * describe('A pixelated image of the underside of a white umbrella with a gridded ceiling above.'); - * } - * - *
                                  - */ - /** - * @method image - * @param {p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} img - * @param {Number} dx the x-coordinate of the destination - * rectangle in which to draw the source image - * @param {Number} dy the y-coordinate of the destination - * rectangle in which to draw the source image - * @param {Number} dWidth the width of the destination rectangle - * @param {Number} dHeight the height of the destination rectangle - * @param {Number} sx the x-coordinate of the subsection of the source - * image to draw into the destination rectangle - * @param {Number} sy the y-coordinate of the subsection of the source - * image to draw into the destination rectangle - * @param {Number} [sWidth] the width of the subsection of the - * source image to draw into the destination - * rectangle - * @param {Number} [sHeight] the height of the subsection of the - * source image to draw into the destination rectangle - * @param {Constant} [fit] either CONTAIN or COVER - * @param {Constant} [xAlign] either LEFT, RIGHT or CENTER default is CENTER - * @param {Constant} [yAlign] either TOP, BOTTOM or CENTER default is CENTER - */ - - _main.default.prototype.image = function ( - img, - dx, - dy, - dWidth, - dHeight, - sx, - sy, - sWidth, - sHeight, - fit, - xAlign, - yAlign, - ) { - // set defaults per spec: https://goo.gl/3ykfOq - _main.default._validateParameters("image", arguments); - var defW = img.width; - var defH = img.height; - yAlign = yAlign || constants.CENTER; - xAlign = xAlign || constants.CENTER; - if (img.elt) { - defW = defW !== undefined ? defW : img.elt.width; - defH = defH !== undefined ? defH : img.elt.height; - } - if (img.elt && img.elt.videoWidth && !img.canvas) { - // video no canvas - defW = defW !== undefined ? defW : img.elt.videoWidth; - defH = defH !== undefined ? defH : img.elt.videoHeight; - } - var _dx = dx; - var _dy = dy; - var _dw = dWidth || defW; - var _dh = dHeight || defH; - var _sx = sx || 0; - var _sy = sy || 0; - var _sw = sWidth !== undefined ? sWidth : defW; - var _sh = sHeight !== undefined ? sHeight : defH; - _sw = _sAssign(_sw, defW); - _sh = _sAssign(_sh, defH); - // This part needs cleanup and unit tests - // see issues https://github.com/processing/p5.js/issues/1741 - // and https://github.com/processing/p5.js/issues/1673 - var pd = 1; - if (img.elt && !img.canvas && img.elt.style.width) { - //if img is video and img.elt.size() has been used and - //no width passed to image() - if (img.elt.videoWidth && !dWidth) { - pd = img.elt.videoWidth; - } else { - //all other cases - pd = img.elt.width; - } - pd /= parseInt(img.elt.style.width, 10); - } - _sx *= pd; - _sy *= pd; - _sh *= pd; - _sw *= pd; - var vals = _helpers.default.modeAdjust( - _dx, - _dy, - _dw, - _dh, - this._renderer._imageMode, - ); - vals = _imageFit( - fit, - xAlign, - yAlign, - vals.x, - vals.y, - vals.w, - vals.h, - _sx, - _sy, - _sw, - _sh, - ); - // tint the image if there is a tint - this._renderer.image( - img, - vals.sx, - vals.sy, - vals.sw, - vals.sh, - vals.dx, - vals.dy, - vals.dw, - vals.dh, - ); - }; - /** - * Tints images using a specified color. - * - * The version of `tint()` with one parameter interprets it one of four ways. - * If the parameter is a number, it's interpreted as a grayscale value. If the - * parameter is a string, it's interpreted as a CSS color string. An array of - * `[R, G, B, A]` values or a p5.Color object can - * also be used to set the tint color. - * - * The version of `tint()` with two parameters uses the first one as a - * grayscale value and the second as an alpha value. For example, calling - * `tint(255, 128)` will make an image 50% transparent. - * - * The version of `tint()` with three parameters interprets them as RGB or - * HSB values, depending on the current - * colorMode(). The optional fourth parameter - * sets the alpha value. For example, `tint(255, 0, 0, 100)` will give images - * a red tint and make them transparent. - * - * @method tint - * @param {Number} v1 red or hue value. - * @param {Number} v2 green or saturation value. - * @param {Number} v3 blue or brightness. - * @param {Number} [alpha] - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint('red'); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint(255, 0, 0); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a red tint.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint(255, 0, 0, 100); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right has a transparent red tint.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * tint(255, 180); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the right is transparent.'); - * } - * - *
                                  - */ - /** - * @method tint - * @param {String} value CSS color string. - */ - /** - * @method tint - * @param {Number} gray grayscale value. - * @param {Number} [alpha] - */ - /** - * @method tint - * @param {Number[]} values array containing the red, green, blue & - * alpha components of the color. - */ - /** - * @method tint - * @param {p5.Color} color the tint color - */ - _main.default.prototype.tint = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("tint", args); - var c = this.color.apply(this, args); - this._renderer._tint = c.levels; - }; - /** - * Removes the current tint set by tint() and restores - * images to their original colors. - * - * @method noTint - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * function setup() { - * tint('red'); - * image(img, 0, 0); - * noTint(); - * image(img, 50, 0); - * - * describe('Two images of an umbrella and a ceiling side-by-side. The image on the left has a red tint.'); - * } - * - *
                                  - */ - _main.default.prototype.noTint = function () { - this._renderer._tint = null; - }; - /** - * Apply the current tint color to the input image, return the resulting - * canvas. - * - * @private - * @param {p5.Image} The image to be tinted - * @return {canvas} The resulting tinted canvas - */ - _main.default.prototype._getTintedImageCanvas = - _main.default.Renderer2D.prototype._getTintedImageCanvas; - /** - * Changes the location from which images are drawn when - * image() is called. - * - * By default, the first - * two parameters of image() are the x- and - * y-coordinates of the image's upper-left corner. The next parameters are - * its width and height. This is the same as calling `imageMode(CORNER)`. - * - * `imageMode(CORNERS)` also uses the first two parameters of - * image() as the x- and y-coordinates of the image's - * top-left corner. The third and fourth parameters are the coordinates of its - * bottom-right corner. - * - * `imageMode(CENTER)` uses the first two parameters of - * image() as the x- and y-coordinates of the image's - * center. The next parameters are its width and height. - * - * @method imageMode - * @param {Constant} mode either CORNER, CORNERS, or CENTER. - * @example - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * background(200); - * imageMode(CORNER); - * image(img, 10, 10, 50, 50); - * - * describe('A square image of a brick wall is drawn at the top left of a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * background(200); - * imageMode(CORNERS); - * image(img, 10, 10, 90, 40); - * - * describe('An image of a brick wall is drawn on a gray square. The image is squeezed into a small rectangular area.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * background(200); - * imageMode(CENTER); - * image(img, 50, 50, 80, 80); - * - * describe('A square image of a brick wall is drawn on a gray square.'); - * } - * - *
                                  - */ - _main.default.prototype.imageMode = function (m) { - _main.default._validateParameters("imageMode", arguments); - if ( - m === constants.CORNER || - m === constants.CORNERS || - m === constants.CENTER - ) { - this._renderer._imageMode = m; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/friendly_errors/fes_core": 289, - "../core/friendly_errors/file_errors": 290, - "../core/friendly_errors/validate_params": 293, - "../core/helpers": 294, - "../core/main": 298, - "core-js/modules/es.array.copy-within": 170, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.promise": 201, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/es.typed-array.uint8-clamped-array": 253, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - gifenc: 263, - omggif: 270, - "regenerator-runtime/runtime": 274, - }, - ], - 322: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var _filters = _interopRequireDefault(_dereq_("./filters")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Image - * @submodule Image - * @requires core - * @requires constants - * @requires filters - */ - /** - * This module defines the p5.Image class and P5 methods for - * drawing images to the main display canvas. - */ - /* - * Class methods - */ - /** - * A class to describe an image. Images are rectangular grids of pixels that - * can be displayed and modified. - * - * Existing images can be loaded by calling - * loadImage(). Blank images can be created by - * calling createImage(). `p5.Image` objects - * have methods for common tasks such as applying filters and modifying - * pixel values. - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * - * describe('An image of a brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(GRAY); - * image(img, 0, 0); - * - * describe('A grayscale image of a brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * background(200); - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - * - * @class p5.Image - * @constructor - * @param {Number} width - * @param {Number} height - */ - - _main.default.Image = /*#__PURE__*/ (function () { - function _class(width, height) { - _classCallCheck(this, _class); - /** - * Image width. - * @type {Number} - * @property {Number} width - * @name width - * @readOnly - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let x = img.width / 2; - * let y = img.height / 2; - * let d = 20; - * circle(x, y, d); - * - * describe('An image of a mountain landscape with a white circle drawn in the middle.'); - * } - * - *
                                  - */ - this.width = width; - /** - * Image height. - * @type {Number} - * @property height - * @name height - * @readOnly - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let x = img.width / 2; - * let y = img.height / 2; - * let d = 20; - * circle(x, y, d); - * - * describe('An image of a mountain landscape with a white circle drawn in the middle.'); - * } - * - *
                                  - */ - this.height = height; - this.canvas = document.createElement("canvas"); - this.canvas.width = this.width; - this.canvas.height = this.height; - this.drawingContext = this.canvas.getContext("2d"); - this._pixelsState = this; - this._pixelDensity = 1; - //Object for working with GIFs, defaults to null - this.gifProperties = null; - //For WebGL Texturing only: used to determine whether to reupload texture to GPU - this._modified = false; - /** - * An array containing the color of each pixel in the - * p5.Image object. Colors are stored as numbers - * representing red, green, blue, and alpha (RGBA) values. `img.pixels` is a - * one-dimensional array for performance reasons. - * - * Each pixel occupies four elements in the pixels array, one for each - * RGBA value. For example, the pixel at coordinates (0, 0) stores its - * RGBA values at `img.pixels[0]`, `img.pixels[1]`, `img.pixels[2]`, - * and `img.pixels[3]`, respectively. The next pixel at coordinates (1, 0) - * stores its RGBA values at `img.pixels[4]`, `img.pixels[5]`, - * `img.pixels[6]`, and `img.pixels[7]`. And so on. The `img.pixels` array - * for a 100×100 p5.Image object has - * 100 × 100 × 4 = 40,000 elements. - * - * Accessing the RGBA values for a pixel in the - * p5.Image object requires a little math as - * shown below. The img.loadPixels() - * method must be called before accessing the `img.pixels` array. The - * img.updatePixels() method must be - * called after any changes are made. - * - * @property {Number[]} pixels - * @name pixels - * @example - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 255; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A red square drawn in the middle of a gray square.'); - * - *
                                  - */ - this.pixels = []; - } /** - * Gets or sets the pixel density for high pixel density displays. By default, - * the density will be set to 1. - * - * Call this method with no arguments to get the default density, or pass - * in a number to set the density. If a non-positive number is provided, - * it defaults to 1. - * - * @method pixelDensity - * @param {Number} [density] A scaling factor for the number of pixels per - * side - * @returns {Number} The current density if called without arguments, or the instance for chaining if setting density. - */ - - _createClass(_class, [ - { - key: "pixelDensity", - value: function pixelDensity(density) { - if (typeof density !== "undefined") { - // Setter: set the density and handle resize - if (density <= 0) { - var errorObj = { - type: "INVALID_VALUE", - format: { - types: ["Number"], - }, - position: 1, - }; - _main.default._friendlyParamError( - errorObj, - "pixelDensity", - ); - // Default to 1 in case of an invalid value - density = 1; - } - this._pixelDensity = density; - // Adjust canvas dimensions based on pixel density - this.width /= density; - this.height /= density; - return this; // Return the image instance for chaining if needed - } else { - // Getter: return the default density - return this._pixelDensity; - } - } /** - * Helper function for animating GIF-based images with time - */, - }, - { - key: "_animateGif", - value: function _animateGif(pInst) { - var props = this.gifProperties; - var curTime = pInst._lastRealFrameTime; - if (props.lastChangeTime === 0) { - props.lastChangeTime = curTime; - } - if (props.playing) { - props.timeDisplayed = curTime - props.lastChangeTime; - var curDelay = props.frames[props.displayIndex].delay; - if (props.timeDisplayed >= curDelay) { - //GIF is bound to 'realtime' so can skip frames - var skips = Math.floor(props.timeDisplayed / curDelay); - props.timeDisplayed = 0; - props.lastChangeTime = curTime; - props.displayIndex += skips; - props.loopCount = Math.floor( - props.displayIndex / props.numFrames, - ); - if ( - props.loopLimit !== null && - props.loopCount >= props.loopLimit - ) { - props.playing = false; - } else { - var ind = props.displayIndex % props.numFrames; - this.drawingContext.putImageData( - props.frames[ind].image, - 0, - 0, - ); - props.displayIndex = ind; - this.setModified(true); - } - } - } - } /** - * Helper fxn for sharing pixel methods - */, - }, - { - key: "_setProperty", - value: function _setProperty(prop, value) { - this[prop] = value; - this.setModified(true); - } /** - * Loads the current value of each pixel in the - * p5.Image object into the `img.pixels` array. - * This method must be called before reading or modifying pixel values. - * - * @method loadPixels - * @example - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - */, - }, - { - key: "loadPixels", - value: function loadPixels() { - _main.default.Renderer2D.prototype.loadPixels.call(this); - this.setModified(true); - } /** - * Updates the canvas with the RGBA values in the - * img.pixels array. - * - * `img.updatePixels()` only needs to be called after changing values in - * the img.pixels array. Such changes can be - * made directly after calling - * img.loadPixels() or by calling - * img.set(). - * - * The optional parameters `x`, `y`, `width`, and `height` define a - * subsection of the p5.Image object to update. - * Doing so can improve performance in some cases. - * - * If the p5.Image object was loaded from a GIF, - * then calling `img.updatePixels()` will update the pixels in current - * frame. - * - * @method updatePixels - * @param {Integer} x x-coordinate of the upper-left corner - * of the subsection to update. - * @param {Integer} y y-coordinate of the upper-left corner - * of the subsection to update. - * @param {Integer} w width of the subsection to update. - * @param {Integer} h height of the subsection to update. - * @example - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * img.set(x, y, 0); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(66, 66); - * img.loadPixels(); - * let numPixels = 4 * img.width * img.height; - * for (let i = 0; i < numPixels; i += 4) { - * // Red. - * img.pixels[i] = 0; - * // Green. - * img.pixels[i + 1] = 0; - * // Blue. - * img.pixels[i + 2] = 0; - * // Alpha. - * img.pixels[i + 3] = 255; - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A black square drawn in the middle of a gray square.'); - * - *
                                  - */, - /** - * @method updatePixels - */ - }, - { - key: "updatePixels", - value: function updatePixels(x, y, w, h) { - _main.default.Renderer2D.prototype.updatePixels.call( - this, - x, - y, - w, - h, - ); - this.setModified(true); - } /** - * Gets a pixel or a region of pixels from a - * p5.Image object. - * - * `img.get()` is easy to use but it's not as fast as - * img.pixels. Use - * img.pixels to read many pixel values. - * - * The version of `img.get()` with no parameters returns the entire image. - * - * The version of `img.get()` with two parameters interprets them as - * coordinates. It returns an array with the `[R, G, B, A]` values of the - * pixel at the given point. - * - * The version of `img.get()` with four parameters interprets them as - * coordinates and dimensions. It returns a subsection of the canvas as a - * p5.Image object. The first two parameters are - * the coordinates for the upper-left corner of the subsection. The last two - * parameters are the width and height of the subsection. - * - * Use img.get() to work directly with - * p5.Image objects. - * - * @method get - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number} w width of the subsection to be returned. - * @param {Number} h height of the subsection to be returned. - * @return {p5.Image} subsection as a p5.Image object. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let img2 = get(); - * image(img2, width / 2, 0); - * - * describe('Two identical mountain landscapes shown side-by-side.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = img.get(50, 90); - * fill(c); - * noStroke(); - * square(25, 25, 50); - * - * describe('A mountain landscape with an olive green square in its center.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let img2 = img.get(0, 0, img.width / 2, img.height / 2); - * image(img2, width / 2, height / 2); - * - * describe('A mountain landscape drawn on top of another mountain landscape.'); - * } - * - *
                                  - */, - /** - * @method get - * @return {p5.Image} whole p5.Image - */ - /** - * @method get - * @param {Number} x - * @param {Number} y - * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. - */ - }, - { - key: "get", - value: function get(x, y, w, h) { - _main.default._validateParameters("p5.Image.get", arguments); - return _main.default.Renderer2D.prototype.get.apply( - this, - arguments, - ); - }, - }, - { - key: "_getPixel", - value: function _getPixel() { - for ( - var _len = arguments.length, - args = new Array(_len), - _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - return _main.default.Renderer2D.prototype._getPixel.apply( - this, - args, - ); - } /** - * Sets the color of one or more pixels within a - * p5.Image object. - * - * `img.set()` is easy to use but it's not as fast as - * img.pixels. Use - * img.pixels to set many pixel values. - * - * `img.set()` interprets the first two parameters as x- and y-coordinates. It - * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel - * array, a p5.Color object, or another - * p5.Image object. - * - * img.updatePixels() must be called - * after using `img.set()` for changes to appear. - * - * @method set - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number|Number[]|Object} a grayscale value | pixel array | - * p5.Color object | - * p5.Image to copy. - * @example - *
                                  - * - * let img = createImage(100, 100); - * img.set(30, 20, 0); - * img.set(85, 20, 0); - * img.set(85, 75, 0); - * img.set(30, 75, 0); - * img.updatePixels(); - * image(img, 0, 0); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(100, 100); - * let black = color(0); - * img.set(30, 20, black); - * img.set(85, 20, black); - * img.set(85, 75, black); - * img.set(30, 75, black); - * img.updatePixels(); - * image(img, 0, 0); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                                  - * - *
                                  - * - * let img = createImage(66, 66); - * for (let x = 0; x < img.width; x += 1) { - * for (let y = 0; y < img.height; y += 1) { - * let c = map(x, 0, img.width, 0, 255); - * img.set(x, y, c); - * } - * } - * img.updatePixels(); - * image(img, 17, 17); - * - * describe('A square with a horiztonal color gradient from black to white drawn on a gray background.'); - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * let img2 = createImage(100, 100); - * img2.set(0, 0, img); - * image(img2, 0, 0); - * - * describe('An image of a mountain landscape.'); - * } - * - *
                                  - */, - }, - { - key: "set", - value: function set(x, y, imgOrCol) { - _main.default.Renderer2D.prototype.set.call( - this, - x, - y, - imgOrCol, - ); - this.setModified(true); - } /** - * Resizes the p5.Image object to a given `width` - * and `height`. The image's original aspect ratio can be kept by passing 0 - * for either `width` or `height`. For example, calling `img.resize(50, 0)` - * on an image that was 500 × 300 pixels will resize it to - * 50 × 30 pixels. - * - * @method resize - * @param {Number} width resized image width. - * @param {Number} height resized image height. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * function setup() { - * image(img, 0, 0); - * img.resize(50, 100); - * image(img, 0, 0); - * - * describe('Two images of a mountain landscape. One copy of the image is squeezed horizontally.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * function setup() { - * image(img, 0, 0); - * img.resize(0, 30); - * image(img, 0, 0); - * - * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * function setup() { - * image(img, 0, 0); - * img.resize(60, 0); - * image(img, 0, 0); - * - * describe('Two images of a mountain landscape. The small copy of the image covers the top-left corner of the larger image.'); - * } - * - *
                                  - */, - }, - { - key: "resize", - value: function resize(width, height) { - // Copy contents to a temporary canvas, resize the original - // and then copy back. - // - // There is a faster approach that involves just one copy and swapping the - // this.canvas reference. We could switch to that approach if (as i think - // is the case) there an expectation that the user would not hold a - // reference to the backing canvas of a p5.Image. But since we do not - // enforce that at the moment, I am leaving in the slower, but safer - // implementation. - // auto-resize - if (width === 0 && height === 0) { - width = this.canvas.width; - height = this.canvas.height; - } else if (width === 0) { - width = (this.canvas.width * height) / this.canvas.height; - } else if (height === 0) { - height = (this.canvas.height * width) / this.canvas.width; - } - width = Math.floor(width); - height = Math.floor(height); - var tempCanvas = document.createElement("canvas"); - tempCanvas.width = width; - tempCanvas.height = height; - if (this.gifProperties) { - var props = this.gifProperties; - //adapted from github.com/LinusU/resize-image-data - var nearestNeighbor = function nearestNeighbor(src, dst) { - var pos = 0; - for (var y = 0; y < dst.height; y++) { - for (var x = 0; x < dst.width; x++) { - var srcX = Math.floor((x * src.width) / dst.width); - var srcY = Math.floor((y * src.height) / dst.height); - var srcPos = (srcY * src.width + srcX) * 4; - dst.data[pos++] = src.data[srcPos++]; // R - dst.data[pos++] = src.data[srcPos++]; // G - dst.data[pos++] = src.data[srcPos++]; // B - dst.data[pos++] = src.data[srcPos++]; // A - } - } - }; - for (var i = 0; i < props.numFrames; i++) { - var resizedImageData = - this.drawingContext.createImageData(width, height); - nearestNeighbor(props.frames[i].image, resizedImageData); - props.frames[i].image = resizedImageData; - } - } - tempCanvas - .getContext("2d") - .drawImage( - this.canvas, - 0, - 0, - this.canvas.width, - this.canvas.height, - 0, - 0, - tempCanvas.width, - tempCanvas.height, - ); - // Resize the original canvas, which will clear its contents - this.canvas.width = this.width = width; - this.canvas.height = this.height = height; - //Copy the image back - this.drawingContext.drawImage( - tempCanvas, - 0, - 0, - width, - height, - 0, - 0, - width, - height, - ); - if (this.pixels.length > 0) { - this.loadPixels(); - } - this.setModified(true); - } /** - * - * Copies pixels from a source p5.Image - * to this one. Calling `img.copy()` will scale pixels from the source - * region if it isn't the same size as the destination region. - * - * @method copy - * @param {p5.Image|p5.Element} srcImage source image. - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * img.copy(7, 22, 10, 10, 35, 25, 50, 50); - * image(img, 0, 0); - * // Outline copied region. - * stroke(255); - * noFill(); - * square(7, 22, 10); - * - * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); - * } - * - *
                                  - * - *
                                  - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * let x = bricks.width / 2; - * let y = bricks.height / 2; - * mountains.copy(bricks, 0, 0, x, y, 0, 0, x, y); - * image(mountains, 0, 0); - * - * describe('An image of a brick wall drawn at the top-left of an image of a mountain landscape.'); - * } - * - *
                                  - */, - /** - * @method copy - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - */ - }, - { - key: "copy", - value: function copy() { - for ( - var _len2 = arguments.length, - args = new Array(_len2), - _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default.prototype.copy.apply(this, args); - } /** - * Masks part of an image from displaying by loading another - * image and using its alpha channel as an alpha channel for - * this image. Masks are cumulative, once applied to an image - * object, they cannot be removed. - * - * @method mask - * @param {p5.Image} srcImage source image. - * - * @example - *
                                  - * - * let photo; - * let maskImage; - * - * function preload() { - * photo = loadImage('assets/rockies.jpg'); - * maskImage = loadImage('assets/mask2.png'); - * } - * - * function setup() { - * photo.mask(maskImage); - * image(photo, 0, 0); - * - * describe('An image of a mountain landscape. The right side of the image has a faded patch of white.'); - * } - * - *
                                  - */, - // TODO: - Accept an array of alpha values. - }, - { - key: "mask", - value: function mask(p5Image) { - if (p5Image === undefined) { - p5Image = this; - } - var currBlend = this.drawingContext.globalCompositeOperation; - var scaleFactor = 1; - if (p5Image instanceof _main.default.Renderer) { - scaleFactor = p5Image._pInst._pixelDensity; - } - var copyArgs = [ - p5Image, - 0, - 0, - scaleFactor * p5Image.width, - scaleFactor * p5Image.height, - 0, - 0, - this.width, - this.height, - ]; - this.drawingContext.globalCompositeOperation = - "destination-in"; - if (this.gifProperties) { - for (var i = 0; i < this.gifProperties.frames.length; i++) { - this.drawingContext.putImageData( - this.gifProperties.frames[i].image, - 0, - 0, - ); - this.copy.apply(this, copyArgs); - this.gifProperties.frames[i].image = - this.drawingContext.getImageData( - 0, - 0, - this.width, - this.height, - ); - } - this.drawingContext.putImageData( - this.gifProperties.frames[this.gifProperties.displayIndex] - .image, - 0, - 0, - ); - } else { - this.copy.apply(this, copyArgs); - } - this.drawingContext.globalCompositeOperation = currBlend; - this.setModified(true); - } /** - * Applies an image filter to the p5.Image object. - * The preset options are: - * - * `INVERT` - * Inverts the colors in the image. No parameter is used. - * - * `GRAY` - * Converts the image to grayscale. No parameter is used. - * - * `THRESHOLD` - * Converts the image to black and white. Pixels with a grayscale value - * above a given threshold are converted to white. The rest are converted to - * black. The threshold must be between 0.0 (black) and 1.0 (white). If no - * value is specified, 0.5 is used. - * - * `OPAQUE` - * Sets the alpha channel to be entirely opaque. No parameter is used. - * - * `POSTERIZE` - * Limits the number of colors in the image. Each color channel is limited to - * the number of colors specified. Values between 2 and 255 are valid, but - * results are most noticeable with lower values. The default value is 4. - * - * `BLUR` - * Blurs the image. The level of blurring is specified by a blur radius. Larger - * values increase the blur. The default value is 4. A gaussian blur is used - * in `P2D` mode. A box blur is used in `WEBGL` mode. - * - * `ERODE` - * Reduces the light areas. No parameter is used. - * - * `DILATE` - * Increases the light areas. No parameter is used. - * - * @method filter - * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, - * POSTERIZE, ERODE, DILATE or BLUR. - * @param {Number} [filterParam] parameter unique to each filter. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(INVERT); - * image(img, 0, 0); - * - * describe('A blue brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(GRAY); - * image(img, 0, 0); - * - * describe('A brick wall drawn in grayscale.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(THRESHOLD); - * image(img, 0, 0); - * - * describe('A brick wall drawn in black and white.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(OPAQUE); - * image(img, 0, 0); - * - * describe('A red brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(POSTERIZE, 3); - * image(img, 0, 0); - * - * describe('An image of a red brick wall drawn with a limited color palette.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(BLUR, 3); - * image(img, 0, 0); - * - * describe('A blurry image of a red brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(DILATE); - * image(img, 0, 0); - * - * describe('A red brick wall with bright lines between each brick.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * img.filter(ERODE); - * image(img, 0, 0); - * - * describe('A red brick wall with faint lines between each brick.'); - * } - * - *
                                  - */, - }, - { - key: "filter", - value: function filter(operation, value) { - _filters.default.apply( - this.canvas, - _filters.default[operation], - value, - ); - this.setModified(true); - } /** - * Copies a region of pixels from another - * p5.Image object into this one. The `blendMode` - * parameter blends the images' colors to create different effects. - * - * @method blend - * @param {p5.Image} srcImage source image - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * @param {Constant} blendMode the blend mode. either - * BLEND, DARKEST, LIGHTEST, DIFFERENCE, - * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, - * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. - * - * Available blend modes are: normal | multiply | screen | overlay | - * darken | lighten | color-dodge | color-burn | hard-light | - * soft-light | difference | exclusion | hue | saturation | - * color | luminosity - * - * http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/ - * @example - *
                                  - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, ADD); - * image(mountains, 0, 0); - * image(bricks, 0, 0); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); - * } - * - *
                                  - * - *
                                  - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); - * image(mountains, 0, 0); - * image(bricks, 0, 0); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); - * } - * - *
                                  - * - *
                                  - * - * let mountains; - * let bricks; - * - * function preload() { - * mountains = loadImage('assets/rockies.jpg'); - * bricks = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); - * image(mountains, 0, 0); - * image(bricks, 0, 0); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); - * } - * - *
                                  - */, - /** - * @method blend - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - * @param {Constant} blendMode - */ - }, - { - key: "blend", - value: function blend() { - for ( - var _len3 = arguments.length, - args = new Array(_len3), - _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters( - "p5.Image.blend", - arguments, - ); - _main.default.prototype.blend.apply(this, args); - this.setModified(true); - } /** - * helper method for web GL mode to indicate that an image has been - * changed or unchanged since last upload. gl texture upload will - * set this value to false after uploading the texture. - * @method setModified - * @param {boolean} val sets whether or not the image has been - * modified. - * @private - */, - }, - { - key: "setModified", - value: function setModified(val) { - this._modified = val; //enforce boolean? - } /** - * helper method for web GL mode to figure out if the image - * has been modified and might need to be re-uploaded to texture - * memory between frames. - * @method isModified - * @private - * @return {boolean} a boolean indicating whether or not the - * image has been updated or modified since last texture upload. - */, - }, - { - key: "isModified", - value: function isModified() { - return this._modified; - } /** - * Saves the p5.Image object to a file. - * The browser will either save the file immediately or prompt the user - * with a dialogue window. - * - * By default, calling `img.save()` will save the image as `untitled.png`. - * - * Calling `img.save()` with one argument, as in `img.save('photo.png')`, - * will set the image's filename and type together. - * - * Calling `img.save()` with two arguments, as in - * `image.save('photo', 'png')`, will set the image's filename and type - * separately. - * - * The image will only be downloaded as an animated GIF if the - * p5.Image object was loaded from a GIF file. - * See saveGif() to create new GIFs. - * @method save - * @param {String} filename filename. Defaults to 'untitled'. - * @param {String} [extension] file extension, either 'png' or 'jpg'. - * Defaults to 'png'. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function draw() { - * image(img, 0, 0); - * - * describe('An image of a mountain landscape.'); - * } - * - * function keyPressed() { - * if (key === 's') { - * img.save(); - * } else if (key === 'j') { - * img.save('rockies.jpg'); - * } else if (key === 'p') { - * img.save('rockies', 'png'); - * } - * } - * - *
                                  - */, - }, - { - key: "save", - value: function save(filename, extension) { - if (this.gifProperties) { - _main.default.prototype.encodeAndDownloadGif( - this, - filename, - ); - } else { - _main.default.prototype.saveCanvas( - this.canvas, - filename, - extension, - ); - } - }, // GIF Section - /** - * Restarts an animated GIF at its first frame. - * - * @method reset - * @example - *
                                  - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-wink-loop-once.gif'); - * } - * - * function draw() { - * background(255); - * image(gif, 0, 0); - * - * describe('A cartoon face winks once and then freezes. Clicking resets the face and makes it wink again.'); - * } - * - * function mousePressed() { - * gif.reset(); - * } - * - *
                                  - */ - }, - { - key: "reset", - value: function reset() { - if (this.gifProperties) { - var props = this.gifProperties; - props.playing = true; - props.timeSinceStart = 0; - props.timeDisplayed = 0; - props.lastChangeTime = 0; - props.loopCount = 0; - props.displayIndex = 0; - this.drawingContext.putImageData( - props.frames[0].image, - 0, - 0, - ); - } - } /** - * Gets the index of the current frame in an animated GIF. - * - * @method getCurrentFrame - * @return {Number} index of the GIF's current frame. - * @example - *
                                  - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function draw() { - * let index = gif.getCurrentFrame(); - * image(gif, 0, 0); - * text(index, 10, 90); - * - * describe('A cartoon eye repeatedly looks around, then outwards. A number displayed in the bottom-left corner increases from 0 to 124, then repeats.'); - * } - * - *
                                  - */, - }, - { - key: "getCurrentFrame", - value: function getCurrentFrame() { - if (this.gifProperties) { - var props = this.gifProperties; - return props.displayIndex % props.numFrames; - } - } /** - * Sets the current frame in an animated GIF. - * - * @method setFrame - * @param {Number} index index of the frame to display. - * @example - *
                                  - * - * let gif; - * let frameSlider; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function setup() { - * let maxFrame = gif.numFrames() - 1; - * frameSlider = createSlider(0, maxFrame); - * frameSlider.position(10, 80); - * frameSlider.size(80); - * } - * - * function draw() { - * let index = frameSlider.value(); - * gif.setFrame(index); - * image(gif, 0, 0); - * - * describe('A cartoon eye looks around when a slider is moved.'); - * } - * - *
                                  - */, - }, - { - key: "setFrame", - value: function setFrame(index) { - if (this.gifProperties) { - var props = this.gifProperties; - if (index < props.numFrames && index >= 0) { - props.timeDisplayed = 0; - props.lastChangeTime = 0; - props.displayIndex = index; - this.drawingContext.putImageData( - props.frames[index].image, - 0, - 0, - ); - } else { - console.log( - "Cannot set GIF to a frame number that is higher than total number of frames or below zero.", - ); - } - } - } /** - * Returns the number of frames in an animated GIF. - * - * @method numFrames - * @return {Number} number of frames in the GIF. - * - * @example - *
                                  - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function draw() { - * image(gif, 0, 0); - * let total = gif.numFrames(); - * let index = gif.getCurrentFrame(); - * text(`${index} / ${total}`, 30, 90); - * - * describe('A cartoon eye looks around. The text "n / 125" is shown at the bottom of the canvas.'); - * } - * - *
                                  - */, - }, - { - key: "numFrames", - value: function numFrames() { - if (this.gifProperties) { - return this.gifProperties.numFrames; - } - } /** - * Plays an animated GIF that was paused with - * img.pause(). - * - * @method play - * - * @example - *
                                  - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); - * } - * - * function draw() { - * background(255); - * image(gif, 0, 0); - * - * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); - * } - * - * function mousePressed() { - * gif.pause(); - * } - * - * function mouseReleased() { - * gif.play(); - * } - * - *
                                  - */, - }, - { - key: "play", - value: function play() { - if (this.gifProperties) { - this.gifProperties.playing = true; - } - } /** - * Pauses an animated GIF. The GIF can be resumed by calling - * img.play(). - * - * @method pause - * - * @example - *
                                  - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/nancy-liang-wind-loop-forever.gif'); - * } - * - * function draw() { - * background(255); - * image(gif, 0, 0); - * - * describe('A drawing of a child with hair blowing in the wind. The animation freezes when clicked and resumes when released.'); - * } - * - * function mousePressed() { - * gif.pause(); - * } - * - * function mouseReleased() { - * gif.play(); - * } - * - *
                                  - */, - }, - { - key: "pause", - value: function pause() { - if (this.gifProperties) { - this.gifProperties.playing = false; - } - } /** - * Changes the delay between frames in an animated GIF. - * - * The second parameter, `index`, is optional. If provided, only the frame - * at `index` will have its delay modified. All other frames will keep - * their default delay. - * - * @method delay - * @param {Number} d delay in milliseconds between switching frames. - * @param {Number} [index] index of the frame that will have its delay modified. - * - * @example - *
                                  - * - * let gifFast; - * let gifSlow; - * - * function preload() { - * gifFast = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * gifSlow = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function setup() { - * gifFast.resize(50, 50); - * gifSlow.resize(50, 50); - * gifFast.delay(10); - * gifSlow.delay(100); - * } - * - * function draw() { - * image(gifFast, 0, 0); - * image(gifSlow, 50, 0); - * - * describe('Two animated eyes looking around. The eye on the left moves faster than the eye on the right.'); - * } - * - *
                                  - * - *
                                  - * - * let gif; - * - * function preload() { - * gif = loadImage('assets/arnott-wallace-eye-loop-forever.gif'); - * } - * - * function setup() { - * gif.delay(3000, 67); - * } - * - * function draw() { - * image(gif, 0, 0); - * - * describe('An animated eye looking around. It pauses for three seconds while it looks down.'); - * } - * - *
                                  - */, - }, - { - key: "delay", - value: function delay(d, index) { - if (this.gifProperties) { - var props = this.gifProperties; - if (index < props.numFrames && index >= 0) { - props.frames[index].delay = d; - } else { - // change all frames - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = props.frames[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = - _iterator.next()).done); - _iteratorNormalCompletion = true - ) { - var frame = _step.value; - frame.delay = d; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - } - }, - }, - ]); - return _class; - })(); - var _default = _main.default.Image; - exports.default = _default; - }, - { - "../core/main": 298, - "./filters": 319, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 323: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.filter"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var _filters = _interopRequireDefault(_dereq_("./filters")); - _dereq_("../color/p5.Color"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Image - * @submodule Pixels - * @for p5 - * @requires core - */ - /** - * An array containing the color of each pixel on the canvas. Colors are - * stored as numbers representing red, green, blue, and alpha (RGBA) values. - * `pixels` is a one-dimensional array for performance reasons. - * - * Each pixel occupies four elements in the `pixels` array, one for each RGBA - * value. For example, the pixel at coordinates (0, 0) stores its RGBA values - * at `pixels[0]`, `pixels[1]`, `pixels[2]`, and `pixels[3]`, respectively. - * The next pixel at coordinates (1, 0) stores its RGBA values at `pixels[4]`, - * `pixels[5]`, `pixels[6]`, and `pixels[7]`. And so on. The `pixels` array - * for a 100×100 canvas has 100 × 100 × 4 = 40,000 elements. - * - * Some displays use several smaller pixels to set the color at a single - * point. The pixelDensity() function returns - * the pixel density of the canvas. High density displays often have a - * pixelDensity() of 2. On such a display, the - * `pixels` array for a 100×100 canvas has 200 × 200 × 4 = - * 160,000 elements. - * - * Accessing the RGBA values for a point on the canvas requires a little math - * as shown below. The loadPixels() function - * must be called before accessing the `pixels` array. The - * updatePixels() function must be called - * after any changes are made. - * - * @property {Number[]} pixels - * - * @example - *
                                  - * - * loadPixels(); - * let x = 50; - * let y = 50; - * let d = pixelDensity(); - * for (let i = 0; i < d; i += 1) { - * for (let j = 0; j < d; j += 1) { - * let index = 4 * ((y * d + j) * width * d + (x * d + i)); - * // Red. - * pixels[index] = 0; - * // Green. - * pixels[index + 1] = 0; - * // Blue. - * pixels[index + 2] = 0; - * // Alpha. - * pixels[index + 3] = 255; - * } - * } - * updatePixels(); - * - * describe('A black dot in the middle of a gray rectangle.'); - * - *
                                  - * - *
                                  - * - * loadPixels(); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * for (let i = 0; i < halfImage; i += 4) { - * // Red. - * pixels[i] = 255; - * // Green. - * pixels[i + 1] = 0; - * // Blue. - * pixels[i + 2] = 0; - * // Alpha. - * pixels[i + 3] = 255; - * } - * updatePixels(); - * - * describe('A red rectangle drawn above a gray rectangle.'); - * - *
                                  - * - *
                                  - * - * let pink = color(255, 102, 204); - * loadPixels(); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * for (let i = 0; i < halfImage; i += 4) { - * pixels[i] = red(pink); - * pixels[i + 1] = green(pink); - * pixels[i + 2] = blue(pink); - * pixels[i + 3] = alpha(pink); - * } - * updatePixels(); - * - * describe('A pink rectangle drawn above a gray rectangle.'); - * - *
                                  - */ - - _main.default.prototype.pixels = []; - /** - * Copies a region of pixels from one image to another. The `blendMode` - * parameter blends the images' colors to create different effects. - * - * @method blend - * @param {p5.Image} srcImage source image. - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * @param {Constant} blendMode the blend mode. either - * BLEND, DARKEST, LIGHTEST, DIFFERENCE, - * MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT, - * SOFT_LIGHT, DODGE, BURN, ADD or NORMAL. - * - * @example - *
                                  - * - * let img0; - * let img1; - * - * function preload() { - * img0 = loadImage('assets/rockies.jpg'); - * img1 = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * background(img0); - * image(img1, 0, 0); - * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears faded on the right of the image.'); - * } - * - *
                                  - * - *
                                  - * - * let img0; - * let img1; - * - * function preload() { - * img0 = loadImage('assets/rockies.jpg'); - * img1 = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * background(img0); - * image(img1, 0, 0); - * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears transparent on the right of the image.'); - * } - * - *
                                  - * - *
                                  - * - * let img0; - * let img1; - * - * function preload() { - * img0 = loadImage('assets/rockies.jpg'); - * img1 = loadImage('assets/bricks_third.jpg'); - * } - * - * function setup() { - * background(img0); - * image(img1, 0, 0); - * blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, ADD); - * - * describe('A wall of bricks in front of a mountain landscape. The same wall of bricks appears washed out on the right of the image.'); - * } - * - *
                                  - */ - /** - * @method blend - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - * @param {Constant} blendMode - */ - _main.default.prototype.blend = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("blend", args); - if (this._renderer) { - var _this$_renderer; - (_this$_renderer = this._renderer).blend.apply( - _this$_renderer, - args, - ); - } else { - _main.default.Renderer2D.prototype.blend.apply(this, args); - } - }; - /** - * Copies pixels from a source image to a region of the canvas. The source - * image can be the canvas itself or a p5.Image - * object. `copy()` will scale pixels from the source region if it isn't the - * same size as the destination region. - * - * @method copy - * @param {p5.Image|p5.Element} srcImage source image. - * @param {Integer} sx x-coordinate of the source's upper-left corner. - * @param {Integer} sy y-coordinate of the source's upper-left corner. - * @param {Integer} sw source image width. - * @param {Integer} sh source image height. - * @param {Integer} dx x-coordinate of the destination's upper-left corner. - * @param {Integer} dy y-coordinate of the destination's upper-left corner. - * @param {Integer} dw destination image width. - * @param {Integer} dh destination image height. - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * background(img); - * copy(img, 7, 22, 10, 10, 35, 25, 50, 50); - * // Show copied region. - * stroke(255); - * noFill(); - * square(7, 22, 10); - * - * describe('An image of a mountain landscape. A square region is outlined in white. A larger square contains a pixelated view of the outlined region.'); - * } - * - *
                                  - */ - /** - * @method copy - * @param {Integer} sx - * @param {Integer} sy - * @param {Integer} sw - * @param {Integer} sh - * @param {Integer} dx - * @param {Integer} dy - * @param {Integer} dw - * @param {Integer} dh - */ - _main.default.prototype.copy = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("copy", args); - var srcImage, sx, sy, sw, sh, dx, dy, dw, dh; - if (args.length === 9) { - srcImage = args[0]; - sx = args[1]; - sy = args[2]; - sw = args[3]; - sh = args[4]; - dx = args[5]; - dy = args[6]; - dw = args[7]; - dh = args[8]; - } else if (args.length === 8) { - srcImage = this; - sx = args[0]; - sy = args[1]; - sw = args[2]; - sh = args[3]; - dx = args[4]; - dy = args[5]; - dw = args[6]; - dh = args[7]; - } else { - throw new Error("Signature not supported"); - } - _main.default.prototype._copyHelper( - this, - srcImage, - sx, - sy, - sw, - sh, - dx, - dy, - dw, - dh, - ); - }; - _main.default.prototype._copyHelper = function ( - dstImage, - srcImage, - sx, - sy, - sw, - sh, - dx, - dy, - dw, - dh, - ) { - var s = srcImage.canvas.width / srcImage.width; - // adjust coord system for 3D when renderer - // ie top-left = -width/2, -height/2 - var sxMod = 0; - var syMod = 0; - if (srcImage._renderer && srcImage._renderer.isP3D) { - sxMod = srcImage.width / 2; - syMod = srcImage.height / 2; - } - if (dstImage._renderer && dstImage._renderer.isP3D) { - _main.default.RendererGL.prototype.image.call( - dstImage._renderer, - srcImage, - sx + sxMod, - sy + syMod, - sw, - sh, - dx, - dy, - dw, - dh, - ); - } else { - dstImage.drawingContext.drawImage( - srcImage.canvas, - s * (sx + sxMod), - s * (sy + syMod), - s * sw, - s * sh, - dx, - dy, - dw, - dh, - ); - } - }; - /** - * Applies an image filter to the canvas. The preset options are: - * - * `INVERT` - * Inverts the colors in the image. No parameter is used. - * - * `GRAY` - * Converts the image to grayscale. No parameter is used. - * - * `THRESHOLD` - * Converts the image to black and white. Pixels with a grayscale value - * above a given threshold are converted to white. The rest are converted to - * black. The threshold must be between 0.0 (black) and 1.0 (white). If no - * value is specified, 0.5 is used. - * - * `OPAQUE` - * Sets the alpha channel to entirely opaque. No parameter is used. - * - * `POSTERIZE` - * Limits the number of colors in the image. Each color channel is limited to - * the number of colors specified. Values between 2 and 255 are valid, but - * results are most noticeable with lower values. The default value is 4. - * - * `BLUR` - * Blurs the image. The level of blurring is specified by a blur radius. Larger - * values increase the blur. The default value is 4. A gaussian blur is used - * in `P2D` mode. A box blur is used in `WEBGL` mode. - * - * `ERODE` - * Reduces the light areas. No parameter is used. - * - * `DILATE` - * Increases the light areas. No parameter is used. - * - * `filter()` uses WebGL in the background by default because it's faster. - * This can be disabled in `P2D` mode by adding a `false` argument, as in - * `filter(BLUR, false)`. This may be useful to keep computation off the GPU - * or to work around a lack of WebGL support. - * - * In `WEBGL` mode, `filter()` can also use custom shaders. See - * createFilterShader() for more - * information. - * - * - * @method filter - * @param {Constant} filterType either THRESHOLD, GRAY, OPAQUE, INVERT, - * POSTERIZE, BLUR, ERODE, DILATE or BLUR. - * @param {Number} [filterParam] parameter unique to each filter. - * @param {Boolean} [useWebGL] flag to control whether to use fast - * WebGL filters (GPU) or original image - * filters (CPU); defaults to `true`. - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(INVERT); - * - * describe('A blue brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(GRAY); - * - * describe('A brick wall drawn in grayscale.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(THRESHOLD); - * - * describe('A brick wall drawn in black and white.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(OPAQUE); - * - * describe('A red brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(POSTERIZE, 3); - * - * describe('An image of a red brick wall drawn with limited color palette.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(BLUR, 3); - * - * describe('A blurry image of a red brick wall.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(DILATE); - * - * describe('A red brick wall with bright lines between each brick.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * filter(ERODE); - * - * describe('A red brick wall with faint lines between each brick.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * // Don't use WebGL. - * filter(BLUR, 3, false); - * - * describe('A blurry image of a red brick wall.'); - * } - * - *
                                  - */ - /** - * @method getFilterGraphicsLayer - * @private - * @returns {p5.Graphics} - */ - _main.default.prototype.getFilterGraphicsLayer = function () { - return this._renderer.getFilterGraphicsLayer(); - }; - /** - * @method filter - * @param {Constant} filterType - * @param {Boolean} [useWebGL] - */ - /** - * @method filter - * @param {p5.Shader} shaderFilter shader that's been loaded, with the - * frag shader using a `tex0` uniform. - */ - _main.default.prototype.filter = function () { - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters("filter", arguments); - var _parseFilterArgs = parseFilterArgs.apply(void 0, args), - shader = _parseFilterArgs.shader, - operation = _parseFilterArgs.operation, - value = _parseFilterArgs.value, - useWebGL = _parseFilterArgs.useWebGL; // when passed a shader, use it directly - if (this._renderer.isP3D && shader) { - _main.default.RendererGL.prototype.filter.call( - this._renderer, - shader, - ); - return; - } // when opting out of webgl, use old pixels method - - if (!useWebGL && !this._renderer.isP3D) { - if (this.canvas !== undefined) { - _filters.default.apply( - this.canvas, - _filters.default[operation], - value, - ); - } else { - _filters.default.apply( - this.elt, - _filters.default[operation], - value, - ); - } - return; - } - if (!useWebGL && this._renderer.isP3D) { - console.warn( - "filter() with useWebGL=false is not supported in WEBGL", - ); - } // when this is a webgl renderer, apply constant shader filter - - if (this._renderer.isP3D) { - _main.default.RendererGL.prototype.filter.call( - this._renderer, - operation, - value, - ); - } // when this is P2D renderer, create/use hidden webgl renderer - else { - var filterGraphicsLayer = this.getFilterGraphicsLayer(); - // copy p2d canvas contents to secondary webgl renderer - // dest - filterGraphicsLayer.copy( - // src - this._renderer, // src coods - 0, - 0, - this.width, - this.height, // dest coords - -this.width / 2, - -this.height / 2, - this.width, - this.height, - ); - //clearing the main canvas - this._renderer.clear(); - this._renderer.resetMatrix(); - // filter it with shaders - filterGraphicsLayer.filter.apply(filterGraphicsLayer, args); - // copy secondary webgl renderer back to original p2d canvas - this._renderer._pInst.image(filterGraphicsLayer, 0, 0); - filterGraphicsLayer.clear(); // prevent feedback effects on p2d canvas - } - }; - function parseFilterArgs() { - var _ref; - // args could be: - // - operation, value, [useWebGL] - // - operation, [useWebGL] - // - shader - var result = { - shader: undefined, - operation: undefined, - value: undefined, - useWebGL: true, - }; - if ( - (arguments.length <= 0 ? undefined : arguments[0]) instanceof - _main.default.Shader - ) { - result.shader = arguments.length <= 0 ? undefined : arguments[0]; - return result; - } else { - result.operation = - arguments.length <= 0 ? undefined : arguments[0]; - } - if ( - arguments.length > 1 && - typeof (arguments.length <= 1 ? undefined : arguments[1]) === - "number" - ) { - result.value = arguments.length <= 1 ? undefined : arguments[1]; - } - if ( - ((_ref = arguments.length - 1), - _ref < 0 || arguments.length <= _ref - ? undefined - : arguments[_ref]) === false - ) { - result.useWebGL = false; - } - return result; - } /** - * Gets a pixel or a region of pixels from the canvas. - * - * `get()` is easy to use but it's not as fast as - * pixels. Use pixels - * to read many pixel values. - * - * The version of `get()` with no parameters returns the entire canvas. - * - * The version of `get()` with two parameters interprets them as - * coordinates. It returns an array with the `[R, G, B, A]` values of the - * pixel at the given point. - * - * The version of `get()` with four parameters interprets them as coordinates - * and dimensions. It returns a subsection of the canvas as a - * p5.Image object. The first two parameters are the - * coordinates for the upper-left corner of the subsection. The last two - * parameters are the width and height of the subsection. - * - * Use p5.Image.get() to work directly with - * p5.Image objects. - * - * @method get - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number} w width of the subsection to be returned. - * @param {Number} h height of the subsection to be returned. - * @return {p5.Image} subsection as a p5.Image object. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = get(); - * image(c, width / 2, 0); - * - * describe('Two identical mountain landscapes shown side-by-side.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = get(50, 90); - * fill(c); - * noStroke(); - * square(25, 25, 50); - * - * describe('A mountain landscape with an olive green square in its center.'); - * } - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0); - * let c = get(0, 0, width / 2, height / 2); - * image(c, width / 2, height / 2); - * - * describe('A mountain landscape drawn on top of another mountain landscape.'); - * } - * - *
                                  - */ - /** - * @method get - * @return {p5.Image} whole canvas as a p5.Image. - */ - /** - * @method get - * @param {Number} x - * @param {Number} y - * @return {Number[]} color of the pixel at (x, y) in array format `[R, G, B, A]`. - */ - - _main.default.prototype.get = function (x, y, w, h) { - var _this$_renderer2; - _main.default._validateParameters("get", arguments); - return (_this$_renderer2 = this._renderer).get.apply( - _this$_renderer2, - arguments, - ); - }; - /** - * Loads the current value of each pixel on the canvas into the - * pixels array. This - * function must be called before reading from or writing to - * pixels. - * - * @method loadPixels - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0, width, height); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * loadPixels(); - * for (let i = 0; i < halfImage; i += 1) { - * pixels[i + halfImage] = pixels[i]; - * } - * updatePixels(); - * - * describe('Two identical images of mountain landscapes, one on top of the other.'); - * } - * - *
                                  - */ - _main.default.prototype.loadPixels = function () { - for ( - var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; - _key4 < _len4; - _key4++ - ) { - args[_key4] = arguments[_key4]; - } - _main.default._validateParameters("loadPixels", args); - this._renderer.loadPixels(); - }; - /** - * Sets the color of a pixel or draws an image to the canvas. - * - * `set()` is easy to use but it's not as fast as - * pixels. Use pixels - * to set many pixel values. - * - * `set()` interprets the first two parameters as x- and y-coordinates. It - * interprets the last parameter as a grayscale value, a `[R, G, B, A]` pixel - * array, a p5.Color object, or a - * p5.Image object. If an image is passed, the first - * two parameters set the coordinates for the image's upper-left corner, - * regardless of the current imageMode(). - * - * updatePixels() must be called after using - * `set()` for changes to appear. - * - * @method set - * @param {Number} x x-coordinate of the pixel. - * @param {Number} y y-coordinate of the pixel. - * @param {Number|Number[]|Object} c grayscale value | pixel array | - * p5.Color object | p5.Image to copy. - * @example - *
                                  - * - * set(30, 20, 0); - * set(85, 20, 0); - * set(85, 75, 0); - * set(30, 75, 0); - * updatePixels(); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                                  - * - *
                                  - * - * let black = color(0); - * set(30, 20, black); - * set(85, 20, black); - * set(85, 75, black); - * set(30, 75, black); - * updatePixels(); - * - * describe('Four black dots arranged in a square drawn on a gray background.'); - * - *
                                  - * - *
                                  - * - * for (let x = 0; x < width; x += 1) { - * for (let y = 0; y < height; y += 1) { - * let c = map(x, 0, width, 0, 255); - * set(x, y, c); - * } - * } - * updatePixels(); - * - * describe('A horiztonal color gradient from black to white.'); - * - *
                                  - * - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * set(0, 0, img); - * updatePixels(); - * - * describe('An image of a mountain landscape.'); - * } - * - *
                                  - */ - _main.default.prototype.set = function (x, y, imgOrCol) { - this._renderer.set(x, y, imgOrCol); - }; - /** - * Updates the canvas with the RGBA values in the - * pixels array. - * - * `updatePixels()` only needs to be called after changing values in the - * pixels array. Such changes can be made directly - * after calling loadPixels() or by calling - * set(). - * - * @method updatePixels - * @param {Number} [x] x-coordinate of the upper-left corner of region - * to update. - * @param {Number} [y] y-coordinate of the upper-left corner of region - * to update. - * @param {Number} [w] width of region to update. - * @param {Number} [h] height of region to update. - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/rockies.jpg'); - * } - * - * function setup() { - * image(img, 0, 0, width, height); - * let d = pixelDensity(); - * let halfImage = 4 * (d * width) * (d * height / 2); - * loadPixels(); - * for (let i = 0; i < halfImage; i += 1) { - * pixels[i + halfImage] = pixels[i]; - * } - * updatePixels(); - * - * describe('Two identical images of mountain landscapes, one on top of the other.'); - * } - * - *
                                  - */ - _main.default.prototype.updatePixels = function (x, y, w, h) { - _main.default._validateParameters("updatePixels", arguments); - // graceful fail - if loadPixels() or set() has not been called, pixel - // array will be empty, ignore call to updatePixels() - if (this.pixels.length === 0) { - return; - } - this._renderer.updatePixels(x, y, w, h); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../color/p5.Color": 284, - "../core/main": 298, - "./filters": 319, - "core-js/modules/es.array.filter": 173, - }, - ], - 324: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.last-index-of"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.from-entries"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/web.url"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.last-index-of"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.from-entries"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.promise"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/web.url"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - _dereq_("whatwg-fetch"); - _dereq_("es6-promise/auto"); - var _fetchJsonp = _interopRequireDefault(_dereq_("fetch-jsonp")); - var _fileSaver = _interopRequireDefault(_dereq_("file-saver")); - _dereq_("../core/friendly_errors/validate_params"); - _dereq_("../core/friendly_errors/file_errors"); - _dereq_("../core/friendly_errors/fes_core"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module IO - * @submodule Input - * @for p5 - * @requires core - */ - /** - * Loads a JSON file from a file or a URL, and returns an Object. - * Note that even if the JSON file contains an Array, an Object will be - * returned with index numbers as keys. * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. JSONP is supported via a polyfill and you - * can pass in as the second argument an object with definitions of the json - * callback following the syntax specified here. + *
                                  + * + * // press the mouse button to disable perPixelLighting + * function setup() { + * createCanvas(100, 100, WEBGL); + * noStroke(); + * fill(255); + * } * - * This method is suitable for fetching files up to size of 64MB. - * @method loadJSON - * @param {String} path name of the file or url to load - * @param {Object} [jsonpOptions] options object for jsonp related settings - * @param {String} [datatype] "json" or "jsonp" - * @param {function} [callback] function to be executed after - * loadJSON() completes, data is passed - * in as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Object|Array} JSON data - * @example + * let lights = [ + * { c: '#f00', t: 1.12, p: 1.91, r: 0.2 }, + * { c: '#0f0', t: 1.21, p: 1.31, r: 0.2 }, + * { c: '#00f', t: 1.37, p: 1.57, r: 0.2 }, + * { c: '#ff0', t: 1.12, p: 1.91, r: 0.7 }, + * { c: '#0ff', t: 1.21, p: 1.31, r: 0.7 }, + * { c: '#f0f', t: 1.37, p: 1.57, r: 0.7 } + * ]; * - * Calling loadJSON() inside preload() guarantees to complete the - * operation before setup() and draw() are called. + * function draw() { + * let t = millis() / 1000 + 1000; + * background(0); + * directionalLight(color('#222'), 1, 1, 1); * - *
                                  - * // Examples use USGS Earthquake API: - * // https://earthquake.usgs.gov/fdsnws/event/1/#methods - * let earthquakes; - * function preload() { - * // Get the most recent earthquake in the database - * let url = - 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + - * 'summary/all_day.geojson'; - * earthquakes = loadJSON(url); - * } + * for (let i = 0; i < lights.length; i++) { + * let light = lights[i]; + * pointLight( + * color(light.c), + * p5.Vector.fromAngles(t * light.t, t * light.p, width * light.r) + * ); + * } * - * function setup() { - * noLoop(); - * } + * specularMaterial(255); + * sphere(width * 0.1); * - * function draw() { - * background(200); - * // Get the magnitude and name of the earthquake out of the loaded JSON - * let earthquakeMag = earthquakes.features[0].properties.mag; - * let earthquakeName = earthquakes.features[0].properties.place; - * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); - * textAlign(CENTER); - * text(earthquakeName, 0, height - 30, width, 30); - * describe(`50×50 ellipse that changes from black to white - * depending on the current humidity`); + * rotateX(t * 0.77); + * rotateY(t * 0.83); + * rotateZ(t * 0.91); + * torus(width * 0.3, width * 0.07, 24, 10); * } - *
                                  * - * Outside of preload(), you may supply a callback function to handle the - * object: - *
                                  - * function setup() { - * noLoop(); - * let url = - 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/' + - * 'summary/all_day.geojson'; - * loadJSON(url, drawEarthquake); + * function mousePressed() { + * setAttributes('perPixelLighting', false); + * noStroke(); + * fill(255); * } - * - * function draw() { - * background(200); - * describe(`50×50 ellipse that changes from black to white - * depending on the current humidity`); + * function mouseReleased() { + * setAttributes('perPixelLighting', true); + * noStroke(); + * fill(255); * } + * + *
                                  * - * function drawEarthquake(earthquakes) { - * // Get the magnitude and name of the earthquake out of the loaded JSON - * let earthquakeMag = earthquakes.features[0].properties.mag; - * let earthquakeName = earthquakes.features[0].properties.place; - * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); - * textAlign(CENTER); - * text(earthquakeName, 0, height - 30, width, 30); - * } - *
                                  + * @alt a rotating cube with smoother edges + */ + /** + * @method setAttributes + * @for p5 + * @param {Object} obj object with key-value pairs + */ + _main.default.prototype.setAttributes = function (key, value) { + if (typeof this._glAttributes === 'undefined') { + console.log('You are trying to use setAttributes on a p5.Graphics object ' + 'that does not use a WEBGL renderer.'); + return; + } + var unchanged = true; + if (typeof value !== 'undefined') { + //first time modifying the attributes + if (this._glAttributes === null) { + this._glAttributes = { + }; + } + if (this._glAttributes[key] !== value) { + //changing value of previously altered attribute + this._glAttributes[key] = value; + unchanged = false; + } //setting all attributes with some change + + } else if (key instanceof Object) { + if (this._glAttributes !== key) { + this._glAttributes = key; + unchanged = false; + } + } //@todo_FES + + if (!this._renderer.isP3D || unchanged) { + return; + } + if (!this._setupDone) { + for (var x in this._renderer.retainedMode.geometry) { + if (this._renderer.retainedMode.geometry.hasOwnProperty(x)) { + _main.default._friendlyError('Sorry, Could not set the attributes, you need to call setAttributes() ' + 'before calling the other drawing methods in setup()'); + return; + } + } + } + this.push(); + this._renderer._resetContext(); + this.pop(); + if (this._renderer._curCamera) { + this._renderer._curCamera._renderer = this._renderer; + } + }; + /** + * @private + * @param {Uint8Array|Float32Array|undefined} pixels An existing pixels array to reuse if the size is the same + * @param {WebGLRenderingContext} gl The WebGL context + * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read + * @param {Number} x The x coordiante to read, premultiplied by pixel density + * @param {Number} y The y coordiante to read, premultiplied by pixel density + * @param {Number} width The width in pixels to be read (factoring in pixel density) + * @param {Number} height The height in pixels to be read (factoring in pixel density) + * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read + * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT + * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about + * @returns {Uint8Array|Float32Array} pixels A pixels array with the current state of the + * WebGL context read into it + */ + function readPixelsWebGL(pixels, gl, framebuffer, x, y, width, height, format, type, flipY) { + // Record the currently bound framebuffer so we can go back to it after, and + // bind the framebuffer we want to read from + var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + var channels = format === gl.RGBA ? 4 : 3; + // Make a pixels buffer if it doesn't already exist + var len = width * height * channels; + var TypedArrayClass = type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; + if (!(pixels instanceof TypedArrayClass) || pixels.length !== len) { + pixels = new TypedArrayClass(len); + } + gl.readPixels(x, flipY ? flipY - y - height : y, width, height, format, type, pixels); + // Re-bind whatever was previously bound + gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); + if (flipY) { + // WebGL pixels are inverted compared to 2D pixels, so we have to flip + // the resulting rows. Adapted from https://stackoverflow.com/a/41973289 + var halfHeight = Math.floor(height / 2); + var tmpRow = new TypedArrayClass(width * channels); + for (var _y = 0; _y < halfHeight; _y++) { + var topOffset = _y * width * 4; + var bottomOffset = (height - _y - 1) * width * 4; + tmpRow.set(pixels.subarray(topOffset, topOffset + width * 4)); + pixels.copyWithin(topOffset, bottomOffset, bottomOffset + width * 4); + pixels.set(tmpRow, bottomOffset); + } + } + return pixels; + } /** + * @private + * @param {WebGLRenderingContext} gl The WebGL context + * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read + * @param {Number} x The x coordinate to read, premultiplied by pixel density + * @param {Number} y The y coordinate to read, premultiplied by pixel density + * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read + * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT + * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about + * @returns {Number[]} pixels The channel data for the pixel at that location + */ + + function readPixelWebGL(gl, framebuffer, x, y, format, type, flipY) { + // Record the currently bound framebuffer so we can go back to it after, and + // bind the framebuffer we want to read from + var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + var channels = format === gl.RGBA ? 4 : 3; + var TypedArrayClass = type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; + var pixels = new TypedArrayClass(channels); + gl.readPixels(x, flipY ? flipY - y - 1 : y, 1, 1, format, type, pixels); + // Re-bind whatever was previously bound + gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); + return Array.from(pixels); + } /** + * 3D graphics class + * @private + * @class p5.RendererGL + * @constructor + * @extends p5.Renderer + * @todo extend class to include public method for offscreen + * rendering (FBO). + */ + + _main.default.RendererGL = /*#__PURE__*/ function (_p5$Renderer) { + _inherits(RendererGL, _p5$Renderer); + var _super = _createSuper(RendererGL); + function RendererGL(elt, pInst, isMainCanvas, attr) { + var _this; + _classCallCheck(this, RendererGL); + _this = _super.call(this, elt, pInst, isMainCanvas); + _this._setAttributeDefaults(pInst); + _this._initContext(); + _this.isP3D = true; //lets us know we're in 3d mode + // When constructing a new p5.Geometry, this will represent the builder + _this.geometryBuilder = undefined; + // This redundant property is useful in reminding you that you are + // interacting with WebGLRenderingContext, still worth considering future removal + _this.GL = _this.drawingContext; + _this._pInst._setProperty('drawingContext', _this.drawingContext); + // erasing + _this._isErasing = false; + // clipping + _this._clipDepths = [ + ]; + _this._isClipApplied = false; + _this._stencilTestOn = false; + // lights + _this._enableLighting = false; + _this.ambientLightColors = [ + ]; + _this.specularColors = [ + 1, + 1, + 1 + ]; + _this.directionalLightDirections = [ + ]; + _this.directionalLightDiffuseColors = [ + ]; + _this.directionalLightSpecularColors = [ + ]; + _this.pointLightPositions = [ + ]; + _this.pointLightDiffuseColors = [ + ]; + _this.pointLightSpecularColors = [ + ]; + _this.spotLightPositions = [ + ]; + _this.spotLightDirections = [ + ]; + _this.spotLightDiffuseColors = [ + ]; + _this.spotLightSpecularColors = [ + ]; + _this.spotLightAngle = [ + ]; + _this.spotLightConc = [ + ]; + // This property contains the input image if imageLight function + // is called. + // activeImageLight is checked by _setFillUniforms + // for sending uniforms to the fillshader + _this.activeImageLight = null; + // If activeImageLight property is Null, diffusedTextures, + // specularTextures are Empty. + // Else, it maps a p5.Image used by imageLight() to a p5.Graphics. + // p5.Graphics for this are calculated in getDiffusedTexture function + _this.diffusedTextures = new Map(); + // p5.Graphics for this are calculated in getSpecularTexture function + _this.specularTextures = new Map(); + _this.drawMode = constants.FILL; + _this.curFillColor = _this._cachedFillStyle = [ + 1, + 1, + 1, + 1 + ]; + _this.curAmbientColor = _this._cachedFillStyle = [ + 1, + 1, + 1, + 1 + ]; + _this.curSpecularColor = _this._cachedFillStyle = [ + 0, + 0, + 0, + 0 + ]; + _this.curEmissiveColor = _this._cachedFillStyle = [ + 0, + 0, + 0, + 0 + ]; + _this.curStrokeColor = _this._cachedStrokeStyle = [ + 0, + 0, + 0, + 1 + ]; + _this.curBlendMode = constants.BLEND; + _this._cachedBlendMode = undefined; + if (_this.webglVersion === constants.WEBGL2) { + _this.blendExt = _this.GL; + } else { + _this.blendExt = _this.GL.getExtension('EXT_blend_minmax'); + } + _this._isBlending = false; + _this._hasSetAmbient = false; + _this._useSpecularMaterial = false; + _this._useEmissiveMaterial = false; + _this._useNormalMaterial = false; + _this._useShininess = 1; + _this._useLineColor = false; + _this._useVertexColor = false; + _this.registerEnabled = new Set(); + _this._tint = [ + 255, + 255, + 255, + 255 + ]; + // lightFalloff variables + _this.constantAttenuation = 1; + _this.linearAttenuation = 0; + _this.quadraticAttenuation = 0; + /** + * model view, projection, & normal + * matrices + */ + _this.uMVMatrix = new _main.default.Matrix(); + _this.uPMatrix = new _main.default.Matrix(); + _this.uNMatrix = new _main.default.Matrix('mat3'); + // Current vertex normal + _this._currentNormal = new _main.default.Vector(0, 0, 1); + // Camera + _this._curCamera = new _main.default.Camera(_assertThisInitialized(_this)); + _this._curCamera._computeCameraDefaultSettings(); + _this._curCamera._setDefaultCamera(); + // FilterCamera + _this.filterCamera = new _main.default.Camera(_assertThisInitialized(_this)); + _this.filterCamera._computeCameraDefaultSettings(); + _this.filterCamera._setDefaultCamera(); + // Information about the previous frame's touch object + // for executing orbitControl() + _this.prevTouches = [ + ]; + // Velocity variable for use with orbitControl() + _this.zoomVelocity = 0; + _this.rotateVelocity = new _main.default.Vector(0, 0); + _this.moveVelocity = new _main.default.Vector(0, 0); + // Flags for recording the state of zooming, rotation and moving + _this.executeZoom = false; + _this.executeRotateAndMove = false; + _this._defaultLightShader = undefined; + _this._defaultImmediateModeShader = undefined; + _this._defaultNormalShader = undefined; + _this._defaultColorShader = undefined; + _this._defaultPointShader = undefined; + _this.userFillShader = undefined; + _this.userStrokeShader = undefined; + _this.userPointShader = undefined; + // Default drawing is done in Retained Mode + // Geometry and Material hashes stored here + _this.retainedMode = { + geometry: { + }, + buffers: { + stroke: [ + new _main.default.RenderBuffer(4, 'lineVertexColors', 'lineColorBuffer', 'aVertexColor', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'lineVertices', 'lineVerticesBuffer', 'aPosition', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'lineTangentsIn', 'lineTangentsInBuffer', 'aTangentIn', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'lineTangentsOut', 'lineTangentsOutBuffer', 'aTangentOut', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(1, 'lineSides', 'lineSidesBuffer', 'aSide', _assertThisInitialized(_this)) + ], + fill: [ + new _main.default.RenderBuffer(3, 'vertices', 'vertexBuffer', 'aPosition', _assertThisInitialized(_this), _this._vToNArray), + new _main.default.RenderBuffer(3, 'vertexNormals', 'normalBuffer', 'aNormal', _assertThisInitialized(_this), _this._vToNArray), + new _main.default.RenderBuffer(4, 'vertexColors', 'colorBuffer', 'aVertexColor', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'vertexAmbients', 'ambientBuffer', 'aAmbientColor', _assertThisInitialized(_this)), + //new BufferDef(3, 'vertexSpeculars', 'specularBuffer', 'aSpecularColor'), + new _main.default.RenderBuffer(2, 'uvs', 'uvBuffer', 'aTexCoord', _assertThisInitialized(_this), _this._flatten) + ], + text: [ + new _main.default.RenderBuffer(3, 'vertices', 'vertexBuffer', 'aPosition', _assertThisInitialized(_this), _this._vToNArray), + new _main.default.RenderBuffer(2, 'uvs', 'uvBuffer', 'aTexCoord', _assertThisInitialized(_this), _this._flatten) + ] + } + }; + // Immediate Mode + // Geometry and Material hashes stored here + _this.immediateMode = { + geometry: new _main.default.Geometry(), + shapeMode: constants.TRIANGLE_FAN, + contourIndices: [ + ], + _bezierVertex: [ + ], + _quadraticVertex: [ + ], + _curveVertex: [ + ], + buffers: { + fill: [ + new _main.default.RenderBuffer(3, 'vertices', 'vertexBuffer', 'aPosition', _assertThisInitialized(_this), _this._vToNArray), + new _main.default.RenderBuffer(3, 'vertexNormals', 'normalBuffer', 'aNormal', _assertThisInitialized(_this), _this._vToNArray), + new _main.default.RenderBuffer(4, 'vertexColors', 'colorBuffer', 'aVertexColor', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'vertexAmbients', 'ambientBuffer', 'aAmbientColor', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(2, 'uvs', 'uvBuffer', 'aTexCoord', _assertThisInitialized(_this), _this._flatten) + ], + stroke: [ + new _main.default.RenderBuffer(4, 'lineVertexColors', 'lineColorBuffer', 'aVertexColor', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'lineVertices', 'lineVerticesBuffer', 'aPosition', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'lineTangentsIn', 'lineTangentsInBuffer', 'aTangentIn', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(3, 'lineTangentsOut', 'lineTangentsOutBuffer', 'aTangentOut', _assertThisInitialized(_this)), + new _main.default.RenderBuffer(1, 'lineSides', 'lineSidesBuffer', 'aSide', _assertThisInitialized(_this)) + ], + point: _this.GL.createBuffer() + } + }; + _this.pointSize = 5; //default point size + _this.curStrokeWeight = 1; + _this.curStrokeCap = constants.ROUND; + _this.curStrokeJoin = constants.ROUND; + // map of texture sources to textures created in this gl context via this.getTexture(src) + _this.textures = new Map(); + // set of framebuffers in use + _this.framebuffers = new Set(); + // stack of active framebuffers + _this.activeFramebuffers = [ + ]; + // for post processing step + _this.filterShader = undefined; + _this.filterLayer = undefined; + _this.filterLayerTemp = undefined; + _this.defaultFilterShaders = { + }; + _this.textureMode = constants.IMAGE; + // default wrap settings + _this.textureWrapX = constants.CLAMP; + _this.textureWrapY = constants.CLAMP; + _this._tex = null; + _this._curveTightness = 6; + // lookUpTable for coefficients needed to be calculated for bezierVertex, same are used for curveVertex + _this._lookUpTableBezier = [ + ]; + // lookUpTable for coefficients needed to be calculated for quadraticVertex + _this._lookUpTableQuadratic = [ + ]; + // current curveDetail in the Bezier lookUpTable + _this._lutBezierDetail = 0; + // current curveDetail in the Quadratic lookUpTable + _this._lutQuadraticDetail = 0; + // Used to distinguish between user calls to vertex() and internal calls + _this.isProcessingVertices = false; + _this._tessy = _this._initTessy(); + _this.fontInfos = { + }; + _this._curShader = undefined; + return _this; + } /** + * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added + * to the geometry and then returned when + * endGeometry() is called. One can also use + * buildGeometry() to pass a function that + * draws shapes. + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them upfront with `beginGeometry()` and `endGeometry()` and then + * drawing that will run faster than repeatedly drawing the individual pieces. + * + * @method beginGeometry + */ + + _createClass(RendererGL, [ + { + key: 'beginGeometry', + value: function beginGeometry() { + if (this.geometryBuilder) { + throw new Error('It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.'); + } + this.geometryBuilder = new _GeometryBuilder.default(this); + } /** + * Finishes creating a new p5.Geometry that was + * started using beginGeometry(). One can also + * use buildGeometry() to pass a function that + * draws shapes. + * + * @method endGeometry + * @returns {p5.Geometry} The model that was built. + */ + + }, + { + key: 'endGeometry', + value: function endGeometry() { + if (!this.geometryBuilder) { + throw new Error('Make sure you call beginGeometry() before endGeometry()!'); + } + var geometry = this.geometryBuilder.finish(); + this.geometryBuilder = undefined; + return geometry; + } /** + * Creates a new p5.Geometry that contains all + * the shapes drawn in a provided callback function. The returned combined shape + * can then be drawn all at once using model(). + * + * If you need to draw complex shapes every frame which don't change over time, + * combining them with `buildGeometry()` once and then drawing that will run + * faster than repeatedly drawing the individual pieces. + * + * One can also draw shapes directly between + * beginGeometry() and + * endGeometry() instead of using a callback + * function. + * + * @method buildGeometry + * @param {Function} callback A function that draws shapes. + * @returns {p5.Geometry} The model that was built from the callback function. + */ + + }, + { + key: 'buildGeometry', + value: function buildGeometry(callback) { + this.beginGeometry(); + callback(); + return this.endGeometry(); + } ////////////////////////////////////////////// + // Setting + ////////////////////////////////////////////// + + }, + { + key: '_setAttributeDefaults', + value: function _setAttributeDefaults(pInst) { + // See issue #3850, safer to enable AA in Safari + var applyAA = navigator.userAgent.toLowerCase().includes('safari'); + var defaults = { + alpha: true, + depth: true, + stencil: true, + antialias: applyAA, + premultipliedAlpha: true, + preserveDrawingBuffer: true, + perPixelLighting: true, + version: 2 + }; + if (pInst._glAttributes === null) { + pInst._glAttributes = defaults; + } else { + pInst._glAttributes = Object.assign(defaults, pInst._glAttributes); + } + return; + } + }, + { + key: '_initContext', + value: function _initContext() { + if (this._pInst._glAttributes.version !== 1) { + // Unless WebGL1 is explicitly asked for, try to create a WebGL2 context + this.drawingContext = this.canvas.getContext('webgl2', this._pInst._glAttributes); + } + this.webglVersion = this.drawingContext ? constants.WEBGL2 : constants.WEBGL; + // If this is the main canvas, make sure the global `webglVersion` is set + this._pInst._setProperty('webglVersion', this.webglVersion); + if (!this.drawingContext) { + // If we were unable to create a WebGL2 context (either because it was + // disabled via `setAttributes({ version: 1 })` or because the device + // doesn't support it), fall back to a WebGL1 context + this.drawingContext = this.canvas.getContext('webgl', this._pInst._glAttributes) || this.canvas.getContext('experimental-webgl', this._pInst._glAttributes); + } + if (this.drawingContext === null) { + throw new Error('Error creating webgl context'); + } else { + var gl = this.drawingContext; + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LEQUAL); + gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); + // Make sure all images are loaded into the canvas premultiplied so that + // they match the way we render colors. This will make framebuffer textures + // be encoded the same way as textures from everything else. + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); + this._viewport = this.drawingContext.getParameter(this.drawingContext.VIEWPORT); + } + } //This is helper function to reset the context anytime the attributes + //are changed with setAttributes() + + }, + { + key: '_resetContext', + value: function _resetContext(options, callback) { + var w = this.width; + var h = this.height; + var defaultId = this.canvas.id; + var isPGraphics = this._pInst instanceof _main.default.Graphics; + if (isPGraphics) { + var pg = this._pInst; + pg.canvas.parentNode.removeChild(pg.canvas); + pg.canvas = document.createElement('canvas'); + var node = pg._pInst._userNode || document.body; + node.appendChild(pg.canvas); + _main.default.Element.call(pg, pg.canvas, pg._pInst); + pg.width = w; + pg.height = h; + } else { + var c = this.canvas; + if (c) { + c.parentNode.removeChild(c); + } + c = document.createElement('canvas'); + c.id = defaultId; + if (this._pInst._userNode) { + this._pInst._userNode.appendChild(c); + } else { + document.body.appendChild(c); + } + this._pInst.canvas = c; + this.canvas = c; + } + var renderer = new _main.default.RendererGL(this._pInst.canvas, this._pInst, !isPGraphics); + this._pInst._setProperty('_renderer', renderer); + renderer.resize(w, h); + renderer._applyDefaults(); + if (!isPGraphics) { + this._pInst._elements.push(renderer); + } + if (typeof callback === 'function') { + //setTimeout with 0 forces the task to the back of the queue, this ensures that + //we finish switching out the renderer + setTimeout(function () { + callback.apply(window._renderer, options); + }, 0); + } + } /** + * @class p5.RendererGL + */ + + }, + { + key: '_update', + value: function _update() { + // reset model view and apply initial camera transform + // (containing only look at info; no projection). + this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0], this._curCamera.cameraMatrix.mat4[1], this._curCamera.cameraMatrix.mat4[2], this._curCamera.cameraMatrix.mat4[3], this._curCamera.cameraMatrix.mat4[4], this._curCamera.cameraMatrix.mat4[5], this._curCamera.cameraMatrix.mat4[6], this._curCamera.cameraMatrix.mat4[7], this._curCamera.cameraMatrix.mat4[8], this._curCamera.cameraMatrix.mat4[9], this._curCamera.cameraMatrix.mat4[10], this._curCamera.cameraMatrix.mat4[11], this._curCamera.cameraMatrix.mat4[12], this._curCamera.cameraMatrix.mat4[13], this._curCamera.cameraMatrix.mat4[14], this._curCamera.cameraMatrix.mat4[15]); + // reset light data for new frame. + this.ambientLightColors.length = 0; + this.specularColors = [ + 1, + 1, + 1 + ]; + this.directionalLightDirections.length = 0; + this.directionalLightDiffuseColors.length = 0; + this.directionalLightSpecularColors.length = 0; + this.pointLightPositions.length = 0; + this.pointLightDiffuseColors.length = 0; + this.pointLightSpecularColors.length = 0; + this.spotLightPositions.length = 0; + this.spotLightDirections.length = 0; + this.spotLightDiffuseColors.length = 0; + this.spotLightSpecularColors.length = 0; + this.spotLightAngle.length = 0; + this.spotLightConc.length = 0; + this._enableLighting = false; + //reset tint value for new frame + this._tint = [ + 255, + 255, + 255, + 255 + ]; + //Clear depth every frame + this.GL.clearStencil(0); + this.GL.clear(this.GL.DEPTH_BUFFER_BIT | this.GL.STENCIL_BUFFER_BIT); + this.GL.disable(this.GL.STENCIL_TEST); + } /** + * [background description] + */ + + }, + { + key: 'background', + value: function background() { + var _this$_pInst; + var _col = (_this$_pInst = this._pInst).color.apply(_this$_pInst, arguments); + var _r = _col.levels[0] / 255; + var _g = _col.levels[1] / 255; + var _b = _col.levels[2] / 255; + var _a = _col.levels[3] / 255; + this.clear(_r, _g, _b, _a); + } ////////////////////////////////////////////// + // COLOR + ////////////////////////////////////////////// + /** + * Basic fill material for geometry with a given color + * @method fill + * @class p5.RendererGL + * @param {Number|Number[]|String|p5.Color} v1 gray value, + * red or hue value (depending on the current color mode), + * or color Array, or CSS color string + * @param {Number} [v2] green or saturation value + * @param {Number} [v3] blue or brightness value + * @param {Number} [a] opacity + * @chainable + * @example + *
                                  + * + * function setup() { + * createCanvas(200, 200, WEBGL); + * } + * + * function draw() { + * background(0); + * noStroke(); + * fill(100, 100, 240); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(75, 75, 75); + * } + * + *
                                  + * + * @alt + * black canvas with purple cube spinning + */ + + }, + { + key: 'fill', + value: function fill(v1, v2, v3, a) { + //see material.js for more info on color blending in webgl + var color = _main.default.prototype.color.apply(this._pInst, arguments); + this.curFillColor = color._array; + this.drawMode = constants.FILL; + this._useNormalMaterial = false; + this._tex = null; + } /** + * Basic stroke material for geometry with a given color + * @method stroke + * @param {Number|Number[]|String|p5.Color} v1 gray value, + * red or hue value (depending on the current color mode), + * or color Array, or CSS color string + * @param {Number} [v2] green or saturation value + * @param {Number} [v3] blue or brightness value + * @param {Number} [a] opacity + * @example + *
                                  + * + * function setup() { + * createCanvas(200, 200, WEBGL); + * } + * + * function draw() { + * background(0); + * stroke(240, 150, 150); + * fill(100, 100, 240); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * box(75, 75, 75); + * } + * + *
                                  + * + * @alt + * black canvas with purple cube with pink outline spinning + */ + + }, + { + key: 'stroke', + value: function stroke(r, g, b, a) { + var color = _main.default.prototype.color.apply(this._pInst, arguments); + this.curStrokeColor = color._array; + } + }, + { + key: 'strokeCap', + value: function strokeCap(cap) { + this.curStrokeCap = cap; + } + }, + { + key: 'strokeJoin', + value: function strokeJoin(join) { + this.curStrokeJoin = join; + } + }, + { + key: 'getFilterLayer', + value: function getFilterLayer() { + if (!this.filterLayer) { + this.filterLayer = this._pInst.createFramebuffer(); + } + return this.filterLayer; + } + }, + { + key: 'getFilterLayerTemp', + value: function getFilterLayerTemp() { + if (!this.filterLayerTemp) { + this.filterLayerTemp = this._pInst.createFramebuffer(); + } + return this.filterLayerTemp; + } + }, + { + key: 'matchSize', + value: function matchSize(fboToMatch, target) { + if (fboToMatch.width !== target.width || fboToMatch.height !== target.height) { + fboToMatch.resize(target.width, target.height); + } + if (fboToMatch.pixelDensity() !== target.pixelDensity()) { + fboToMatch.pixelDensity(target.pixelDensity()); + } + } + }, + { + key: 'filter', + value: function filter() { + var _this2 = this; + var fbo = this.getFilterLayer(); + // use internal shader for filter constants BLUR, INVERT, etc + var filterParameter = undefined; + var operation = undefined; + if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') { + var _defaults; + operation = arguments.length <= 0 ? undefined : arguments[0]; + var defaults = (_defaults = { + }, _defineProperty(_defaults, constants.BLUR, 3), _defineProperty(_defaults, constants.POSTERIZE, 4), _defineProperty(_defaults, constants.THRESHOLD, 0.5), _defaults); + var useDefaultParam = operation in defaults && (arguments.length <= 1 ? undefined : arguments[1]) === undefined; + filterParameter = useDefaultParam ? defaults[operation] : arguments.length <= 1 ? undefined : arguments[1]; + // Create and store shader for constants once on initial filter call. + // Need to store multiple in case user calls different filters, + // eg. filter(BLUR) then filter(GRAY) + if (!(operation in this.defaultFilterShaders)) { + this.defaultFilterShaders[operation] = new _main.default.Shader(fbo._renderer, filterShaderVert, filterShaderFrags[operation]); + } + this.filterShader = this.defaultFilterShaders[operation]; + } // use custom user-supplied shader + else { + this.filterShader = arguments.length <= 0 ? undefined : arguments[0]; + } // Setting the target to the framebuffer when applying a filter to a framebuffer. + + var target = this.activeFramebuffer() || this; + // Resize the framebuffer 'fbo' and adjust its pixel density if it doesn't match the target. + this.matchSize(fbo, target); + // Set filterCamera for framebuffers. + if (target !== this) { + this.filterCamera = this.getFilterLayer().createCamera(); + } + fbo.draw(function () { + return _this2._pInst.clear(); + }); // prevent undesirable feedback effects accumulating secretly. + var texelSize = [ + 1 / (target.width * target.pixelDensity()), + 1 / (target.height * target.pixelDensity()) + ]; + // apply blur shader with multiple passes. + if (operation === constants.BLUR) { + // Treating 'tmp' as a framebuffer. + var tmp = this.getFilterLayerTemp(); + // Resize the framebuffer 'tmp' and adjust its pixel density if it doesn't match the target. + this.matchSize(tmp, target); + // setup + this._pInst.push(); + this._pInst.noStroke(); + // draw main to temp buffer + this._pInst.shader(this.filterShader); + this.filterShader.setUniform('texelSize', texelSize); + this.filterShader.setUniform('canvasSize', [ + target.width, + target.height + ]); + this.filterShader.setUniform('radius', Math.max(1, filterParameter)); + // Horiz pass: draw `target` to `tmp` + tmp.draw(function () { + _this2.filterShader.setUniform('direction', [ + 1, + 0 + ]); + _this2.filterShader.setUniform('tex0', target); + _this2._pInst.clear(); + _this2._pInst.shader(_this2.filterShader); + _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); + }); + // Vert pass: draw `tmp` to `fbo` + fbo.draw(function () { + _this2.filterShader.setUniform('direction', [ + 0, + 1 + ]); + _this2.filterShader.setUniform('tex0', tmp); + _this2._pInst.clear(); + _this2._pInst.shader(_this2.filterShader); + _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); + }); + this._pInst.pop(); + } // every other non-blur shader uses single pass + else { + fbo.draw(function () { + _this2._pInst.noStroke(); + _this2._pInst.shader(_this2.filterShader); + _this2.filterShader.setUniform('tex0', target); + _this2.filterShader.setUniform('texelSize', texelSize); + _this2.filterShader.setUniform('canvasSize', [ + target.width, + target.height + ]); + // filterParameter uniform only used for POSTERIZE, and THRESHOLD + // but shouldn't hurt to always set + _this2.filterShader.setUniform('filterParameter', filterParameter); + _this2._pInst.rect( - target.width / 2, - target.height / 2, target.width, target.height); + }); + } // draw fbo contents onto main renderer. + + this._pInst.push(); + this._pInst.noStroke(); + this.clear(); + this._pInst.push(); + this._pInst.imageMode(constants.CORNER); + this._pInst.blendMode(constants.BLEND); + this.filterCamera._resize(); + this._pInst.setCamera(this.filterCamera); + this._pInst.resetMatrix(); + this._pInst.image(fbo, - this.width / 2, - this.height / 2, this.width, this.height); + this._pInst.pop(); + this._pInst.pop(); + } // Pass this off to the host instance so that we can treat a renderer and a + // framebuffer the same in filter() + + }, + { + key: 'pixelDensity', + value: function pixelDensity(newDensity) { + if (newDensity) { + return this._pInst.pixelDensity(newDensity); + } + return this._pInst.pixelDensity(); + } + }, + { + key: 'blendMode', + value: function blendMode(mode) { + if (mode === constants.DARKEST || mode === constants.LIGHTEST || mode === constants.ADD || mode === constants.BLEND || mode === constants.SUBTRACT || mode === constants.SCREEN || mode === constants.EXCLUSION || mode === constants.REPLACE || mode === constants.MULTIPLY || mode === constants.REMOVE) this.curBlendMode = mode; + else if (mode === constants.BURN || mode === constants.OVERLAY || mode === constants.HARD_LIGHT || mode === constants.SOFT_LIGHT || mode === constants.DODGE) { + console.warn('BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.'); + } + } + }, + { + key: 'erase', + value: function erase(opacityFill, opacityStroke) { + if (!this._isErasing) { + this._cachedBlendMode = this.curBlendMode; + this._isErasing = true; + this.blendMode(constants.REMOVE); + this._cachedFillStyle = this.curFillColor.slice(); + this.curFillColor = [ + 1, + 1, + 1, + opacityFill / 255 + ]; + this._cachedStrokeStyle = this.curStrokeColor.slice(); + this.curStrokeColor = [ + 1, + 1, + 1, + opacityStroke / 255 + ]; + } + } + }, + { + key: 'noErase', + value: function noErase() { + if (this._isErasing) { + this.curFillColor = this._cachedFillStyle.slice(); + this.curStrokeColor = this._cachedStrokeStyle.slice(); + // It's necessary to restore post-erase state. Needs rework + var temp = this.curBlendMode; + this.blendMode(this._cachedBlendMode); + this._cachedBlendMode = temp; // If we don't do this, applyBlendMode() returns null + this._isErasing = false; + this._applyBlendMode(); // This sets _cachedBlendMode back to the original blendmode + } + } + }, + { + key: 'drawTarget', + value: function drawTarget() { + return this.activeFramebuffers[this.activeFramebuffers.length - 1] || this; + } + }, + { + key: 'beginClip', + value: function beginClip() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + }; + _get(_getPrototypeOf(RendererGL.prototype), 'beginClip', this).call(this, options); + this.drawTarget()._isClipApplied = true; + var gl = this.GL; + gl.clearStencil(0); + gl.clear(gl.STENCIL_BUFFER_BIT); + gl.enable(gl.STENCIL_TEST); + this._stencilTestOn = true; + gl.stencilFunc(gl.ALWAYS, // the test + 1, // reference value + 255 // mask + ); + gl.stencilOp(gl.KEEP, // what to do if the stencil test fails + gl.KEEP, // what to do if the depth test fails + gl.REPLACE // what to do if both tests pass + ); + gl.disable(gl.DEPTH_TEST); + this._pInst.push(); + this._pInst.resetShader(); + if (this._doFill) this._pInst.fill(0, 0); + if (this._doStroke) this._pInst.stroke(0, 0); + } + }, + { + key: 'endClip', + value: function endClip() { + this._pInst.pop(); + var gl = this.GL; + gl.stencilOp(gl.KEEP, // what to do if the stencil test fails + gl.KEEP, // what to do if the depth test fails + gl.KEEP // what to do if both tests pass + ); + gl.stencilFunc(this._clipInvert ? gl.EQUAL : gl.NOTEQUAL, // the test + 0, // reference value + 255 // mask + ); + gl.enable(gl.DEPTH_TEST); + // Mark the depth at which the clip has been applied so that we can clear it + // when we pop past this depth + this._clipDepths.push(this._pushPopDepth); + _get(_getPrototypeOf(RendererGL.prototype), 'endClip', this).call(this); + } + }, + { + key: '_clearClip', + value: function _clearClip() { + this.GL.clearStencil(1); + this.GL.clear(this.GL.STENCIL_BUFFER_BIT); + if (this._clipDepths.length > 0) { + this._clipDepths.pop(); + } + this.drawTarget()._isClipApplied = false; + } /** + * Change weight of stroke + * @method strokeWeight + * @param {Number} stroke weight to be used for drawing + * @example + *
                                  + * + * function setup() { + * createCanvas(200, 400, WEBGL); + * setAttributes('antialias', true); + * } + * + * function draw() { + * background(0); + * noStroke(); + * translate(0, -100, 0); + * stroke(240, 150, 150); + * fill(100, 100, 240); + * push(); + * strokeWeight(8); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * sphere(75); + * pop(); + * push(); + * translate(0, 200, 0); + * strokeWeight(1); + * rotateX(frameCount * 0.01); + * rotateY(frameCount * 0.01); + * sphere(75); + * pop(); + * } + * + *
                                  + * + * @alt + * black canvas with two purple rotating spheres with pink + * outlines the sphere on top has much heavier outlines, + */ + + }, + { + key: 'strokeWeight', + value: function strokeWeight(w) { + if (this.curStrokeWeight !== w) { + this.pointSize = w; + this.curStrokeWeight = w; + } + } // x,y are canvas-relative (pre-scaled by _pixelDensity) + + }, + { + key: '_getPixel', + value: function _getPixel(x, y) { + var gl = this.GL; + return readPixelWebGL(gl, null, x, y, gl.RGBA, gl.UNSIGNED_BYTE, this._pInst.height * this._pInst.pixelDensity()); + } /** + * Loads the pixels data for this canvas into the pixels[] attribute. + * Note that updatePixels() and set() do not work. + * Any pixel manipulation must be done directly to the pixels[] array. + * + * @private + * @method loadPixels + */ + + }, + { + key: 'loadPixels', + value: function loadPixels() { + var pixelsState = this._pixelsState; + //@todo_FES + if (this._pInst._glAttributes.preserveDrawingBuffer !== true) { + console.log('loadPixels only works in WebGL when preserveDrawingBuffer ' + 'is true.'); + return; + } + var pd = this._pInst._pixelDensity; + var gl = this.GL; + pixelsState._setProperty('pixels', readPixelsWebGL(pixelsState.pixels, gl, null, 0, 0, this.width * pd, this.height * pd, gl.RGBA, gl.UNSIGNED_BYTE, this.height * pd)); + } + }, + { + key: 'updatePixels', + value: function updatePixels() { + var fbo = this._getTempFramebuffer(); + fbo.pixels = this._pixelsState.pixels; + fbo.updatePixels(); + this._pInst.push(); + this._pInst.resetMatrix(); + this._pInst.clear(); + this._pInst.imageMode(constants.CENTER); + this._pInst.image(fbo, 0, 0); + this._pInst.pop(); + this.GL.clearDepth(1); + this.GL.clear(this.GL.DEPTH_BUFFER_BIT); + } /** + * @private + * @returns {p5.Framebuffer} A p5.Framebuffer set to match the size and settings + * of the renderer's canvas. It will be created if it does not yet exist, and + * reused if it does. + */ + + }, + { + key: '_getTempFramebuffer', + value: function _getTempFramebuffer() { + if (!this._tempFramebuffer) { + this._tempFramebuffer = this._pInst.createFramebuffer({ + format: constants.UNSIGNED_BYTE, + useDepth: this._pInst._glAttributes.depth, + depthFormat: constants.UNSIGNED_INT, + antialias: this._pInst._glAttributes.antialias + }); + } + return this._tempFramebuffer; + } ////////////////////////////////////////////// + // HASH | for geometry + ////////////////////////////////////////////// + + }, + { + key: 'geometryInHash', + value: function geometryInHash(gId) { + return this.retainedMode.geometry[gId] !== undefined; + } + }, + { + key: 'viewport', + value: function viewport(w, h) { + this._viewport = [ + 0, + 0, + w, + h + ]; + this.GL.viewport(0, 0, w, h); + } /** + * [resize description] + * @private + * @param {Number} w [description] + * @param {Number} h [description] + */ + + }, + { + key: 'resize', + value: function resize(w, h) { + _main.default.Renderer.prototype.resize.call(this, w, h); + this._origViewport = { + width: this.GL.drawingBufferWidth, + height: this.GL.drawingBufferHeight + }; + this.viewport(this._origViewport.width, this._origViewport.height); + this._curCamera._resize(); + //resize pixels buffer + var pixelsState = this._pixelsState; + if (typeof pixelsState.pixels !== 'undefined') { + pixelsState._setProperty('pixels', new Uint8Array(this.GL.drawingBufferWidth * this.GL.drawingBufferHeight * 4)); + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this.framebuffers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var framebuffer = _step.value; + // Notify framebuffers of the resize so that any auto-sized framebuffers + // can also update their size + framebuffer._canvasSizeChanged(); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } /** + * clears color and depth buffers + * with r,g,b,a + * @private + * @param {Number} r normalized red val. + * @param {Number} g normalized green val. + * @param {Number} b normalized blue val. + * @param {Number} a normalized alpha val. + */ + + }, + { + key: 'clear', + value: function clear() { + var _r = (arguments.length <= 0 ? undefined : arguments[0]) || 0; + var _g = (arguments.length <= 1 ? undefined : arguments[1]) || 0; + var _b = (arguments.length <= 2 ? undefined : arguments[2]) || 0; + var _a = (arguments.length <= 3 ? undefined : arguments[3]) || 0; + var activeFramebuffer = this.activeFramebuffer(); + if (activeFramebuffer && activeFramebuffer.format === constants.UNSIGNED_BYTE && !activeFramebuffer.antialias && _a === 0) { + // Drivers on Intel Macs check for 0,0,0,0 exactly when drawing to a + // framebuffer and ignore the command if it's the only drawing command to + // the framebuffer. To work around it, we can set the alpha to a value so + // low that it still rounds down to 0, but that circumvents the buggy + // check in the driver. + _a = 1e-10; + } + this.GL.clearColor(_r * _a, _g * _a, _b * _a, _a); + this.GL.clearDepth(1); + this.GL.clear(this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT); + } + }, + { + key: 'applyMatrix', + value: function applyMatrix(a, b, c, d, e, f) { + if (arguments.length === 16) { + _main.default.Matrix.prototype.apply.apply(this.uMVMatrix, arguments); + } else { + this.uMVMatrix.apply([a, + b, + 0, + 0, + c, + d, + 0, + 0, + 0, + 0, + 1, + 0, + e, + f, + 0, + 1]); + } + } /** + * [translate description] + * @private + * @param {Number} x [description] + * @param {Number} y [description] + * @param {Number} z [description] + * @chainable + * @todo implement handle for components or vector as args + */ + + }, + { + key: 'translate', + value: function translate(x, y, z) { + if (x instanceof _main.default.Vector) { + z = x.z; + y = x.y; + x = x.x; + } + this.uMVMatrix.translate([x, + y, + z]); + return this; + } /** + * Scales the Model View Matrix by a vector + * @private + * @param {Number | p5.Vector | Array} x [description] + * @param {Number} [y] y-axis scalar + * @param {Number} [z] z-axis scalar + * @chainable + */ + + }, + { + key: 'scale', + value: function scale(x, y, z) { + this.uMVMatrix.scale(x, y, z); + return this; + } + }, + { + key: 'rotate', + value: function rotate(rad, axis) { + if (typeof axis === 'undefined') { + return this.rotateZ(rad); + } + _main.default.Matrix.prototype.rotate.apply(this.uMVMatrix, arguments); + return this; + } + }, + { + key: 'rotateX', + value: function rotateX(rad) { + this.rotate(rad, 1, 0, 0); + return this; + } + }, + { + key: 'rotateY', + value: function rotateY(rad) { + this.rotate(rad, 0, 1, 0); + return this; + } + }, + { + key: 'rotateZ', + value: function rotateZ(rad) { + this.rotate(rad, 0, 0, 1); + return this; + } + }, + { + key: 'push', + value: function push() { + // get the base renderer style + var style = _main.default.Renderer.prototype.push.apply(this); + // add webgl-specific style properties + var properties = style.properties; + properties.uMVMatrix = this.uMVMatrix.copy(); + properties.uPMatrix = this.uPMatrix.copy(); + properties._curCamera = this._curCamera; + // make a copy of the current camera for the push state + // this preserves any references stored using 'createCamera' + this._curCamera = this._curCamera.copy(); + properties.ambientLightColors = this.ambientLightColors.slice(); + properties.specularColors = this.specularColors.slice(); + properties.directionalLightDirections = this.directionalLightDirections.slice(); + properties.directionalLightDiffuseColors = this.directionalLightDiffuseColors.slice(); + properties.directionalLightSpecularColors = this.directionalLightSpecularColors.slice(); + properties.pointLightPositions = this.pointLightPositions.slice(); + properties.pointLightDiffuseColors = this.pointLightDiffuseColors.slice(); + properties.pointLightSpecularColors = this.pointLightSpecularColors.slice(); + properties.spotLightPositions = this.spotLightPositions.slice(); + properties.spotLightDirections = this.spotLightDirections.slice(); + properties.spotLightDiffuseColors = this.spotLightDiffuseColors.slice(); + properties.spotLightSpecularColors = this.spotLightSpecularColors.slice(); + properties.spotLightAngle = this.spotLightAngle.slice(); + properties.spotLightConc = this.spotLightConc.slice(); + properties.userFillShader = this.userFillShader; + properties.userStrokeShader = this.userStrokeShader; + properties.userPointShader = this.userPointShader; + properties.pointSize = this.pointSize; + properties.curStrokeWeight = this.curStrokeWeight; + properties.curStrokeColor = this.curStrokeColor; + properties.curFillColor = this.curFillColor; + properties.curAmbientColor = this.curAmbientColor; + properties.curSpecularColor = this.curSpecularColor; + properties.curEmissiveColor = this.curEmissiveColor; + properties._hasSetAmbient = this._hasSetAmbient; + properties._useSpecularMaterial = this._useSpecularMaterial; + properties._useEmissiveMaterial = this._useEmissiveMaterial; + properties._useShininess = this._useShininess; + properties.constantAttenuation = this.constantAttenuation; + properties.linearAttenuation = this.linearAttenuation; + properties.quadraticAttenuation = this.quadraticAttenuation; + properties._enableLighting = this._enableLighting; + properties._useNormalMaterial = this._useNormalMaterial; + properties._tex = this._tex; + properties.drawMode = this.drawMode; + properties._currentNormal = this._currentNormal; + properties.curBlendMode = this.curBlendMode; + // So that the activeImageLight gets reset in push/pop + properties.activeImageLight = this.activeImageLight; + return style; + } + }, + { + key: 'pop', + value: function pop() { + var _get2; + if (this._clipDepths.length > 0 && this._pushPopDepth === this._clipDepths[this._clipDepths.length - 1]) { + this._clearClip(); + } + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + }(_get2 = _get(_getPrototypeOf(RendererGL.prototype), 'pop', this)).call.apply(_get2, [ + this + ].concat(args)); + this._applyStencilTestIfClipping(); + } + }, + { + key: '_applyStencilTestIfClipping', + value: function _applyStencilTestIfClipping() { + var drawTarget = this.drawTarget(); + if (drawTarget._isClipApplied !== this._stencilTestOn) { + if (drawTarget._isClipApplied) { + this.GL.enable(this.GL.STENCIL_TEST); + this._stencilTestOn = true; + } else { + this.GL.disable(this.GL.STENCIL_TEST); + this._stencilTestOn = false; + } + } + } + }, + { + key: 'resetMatrix', + value: function resetMatrix() { + this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0], this._curCamera.cameraMatrix.mat4[1], this._curCamera.cameraMatrix.mat4[2], this._curCamera.cameraMatrix.mat4[3], this._curCamera.cameraMatrix.mat4[4], this._curCamera.cameraMatrix.mat4[5], this._curCamera.cameraMatrix.mat4[6], this._curCamera.cameraMatrix.mat4[7], this._curCamera.cameraMatrix.mat4[8], this._curCamera.cameraMatrix.mat4[9], this._curCamera.cameraMatrix.mat4[10], this._curCamera.cameraMatrix.mat4[11], this._curCamera.cameraMatrix.mat4[12], this._curCamera.cameraMatrix.mat4[13], this._curCamera.cameraMatrix.mat4[14], this._curCamera.cameraMatrix.mat4[15]); + return this; + } ////////////////////////////////////////////// + // SHADER + ////////////////////////////////////////////// + /* + * shaders are created and cached on a per-renderer basis, + * on the grounds that each renderer will have its own gl context + * and the shader must be valid in that context. + */ + + }, + { + key: '_getImmediateStrokeShader', + value: function _getImmediateStrokeShader() { + // select the stroke shader to use + var stroke = this.userStrokeShader; + if (!stroke || !stroke.isStrokeShader()) { + return this._getLineShader(); + } + return stroke; + } + }, + { + key: '_getRetainedStrokeShader', + value: function _getRetainedStrokeShader() { + return this._getImmediateStrokeShader(); + } /* + * selects which fill shader should be used based on renderer state, + * for use with begin/endShape and immediate vertex mode. + */ + + }, + { + key: '_getImmediateFillShader', + value: function _getImmediateFillShader() { + var fill = this.userFillShader; + if (this._useNormalMaterial) { + if (!fill || !fill.isNormalShader()) { + return this._getNormalShader(); + } + } + if (this._enableLighting) { + if (!fill || !fill.isLightShader()) { + return this._getLightShader(); + } + } else if (this._tex) { + if (!fill || !fill.isTextureShader()) { + return this._getLightShader(); + } + } else if (!fill /*|| !fill.isColorShader()*/ ) { + return this._getImmediateModeShader(); + } + return fill; + } /* + * selects which fill shader should be used based on renderer state + * for retained mode. + */ + + }, + { + key: '_getRetainedFillShader', + value: function _getRetainedFillShader() { + if (this._useNormalMaterial) { + return this._getNormalShader(); + } + var fill = this.userFillShader; + if (this._enableLighting) { + if (!fill || !fill.isLightShader()) { + return this._getLightShader(); + } + } else if (this._tex) { + if (!fill || !fill.isTextureShader()) { + return this._getLightShader(); + } + } else if (!fill /* || !fill.isColorShader()*/ ) { + return this._getColorShader(); + } + return fill; + } + }, + { + key: '_getImmediatePointShader', + value: function _getImmediatePointShader() { + // select the point shader to use + var point = this.userPointShader; + if (!point || !point.isPointShader()) { + return this._getPointShader(); + } + return point; + } + }, + { + key: '_getRetainedLineShader', + value: function _getRetainedLineShader() { + return this._getImmediateLineShader(); + } + }, + { + key: '_getLightShader', + value: function _getLightShader() { + if (!this._defaultLightShader) { + if (this._pInst._glAttributes.perPixelLighting) { + this._defaultLightShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.phongVert, this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.phongFrag); + } else { + this._defaultLightShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'highp') + defaultShaders.lightVert, this._webGL2CompatibilityPrefix('frag', 'highp') + defaultShaders.lightTextureFrag); + } + } + return this._defaultLightShader; + } + }, + { + key: '_getImmediateModeShader', + value: function _getImmediateModeShader() { + if (!this._defaultImmediateModeShader) { + this._defaultImmediateModeShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.immediateVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.vertexColorFrag); + } + return this._defaultImmediateModeShader; + } + }, + { + key: '_getNormalShader', + value: function _getNormalShader() { + if (!this._defaultNormalShader) { + this._defaultNormalShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.normalVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.normalFrag); + } + return this._defaultNormalShader; + } + }, + { + key: '_getColorShader', + value: function _getColorShader() { + if (!this._defaultColorShader) { + this._defaultColorShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.normalVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.basicFrag); + } + return this._defaultColorShader; + } + }, + { + key: '_getPointShader', + value: function _getPointShader() { + if (!this._defaultPointShader) { + this._defaultPointShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.pointVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.pointFrag); + } + return this._defaultPointShader; + } + }, + { + key: '_getLineShader', + value: function _getLineShader() { + if (!this._defaultLineShader) { + this._defaultLineShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.lineVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.lineFrag); + } + return this._defaultLineShader; + } + }, + { + key: '_getFontShader', + value: function _getFontShader() { + if (!this._defaultFontShader) { + if (this.webglVersion === constants.WEBGL) { + this.GL.getExtension('OES_standard_derivatives'); + } + this._defaultFontShader = new _main.default.Shader(this, this._webGL2CompatibilityPrefix('vert', 'mediump') + defaultShaders.fontVert, this._webGL2CompatibilityPrefix('frag', 'mediump') + defaultShaders.fontFrag); + } + return this._defaultFontShader; + } + }, + { + key: '_webGL2CompatibilityPrefix', + value: function _webGL2CompatibilityPrefix(shaderType, floatPrecision) { + var code = ''; + if (this.webglVersion === constants.WEBGL2) { + code += '#version 300 es\n#define WEBGL2\n'; + } + if (shaderType === 'vert') { + code += '#define VERTEX_SHADER\n'; + } else if (shaderType === 'frag') { + code += '#define FRAGMENT_SHADER\n'; + } + if (floatPrecision) { + code += 'precision '.concat(floatPrecision, ' float;\n'); + } + return code; + } + }, + { + key: '_getEmptyTexture', + value: function _getEmptyTexture() { + if (!this._emptyTexture) { + // a plain white texture RGBA, full alpha, single pixel. + var im = new _main.default.Image(1, 1); + im.set(0, 0, 255); + this._emptyTexture = new _main.default.Texture(this, im); + } + return this._emptyTexture; + } + }, + { + key: 'getTexture', + value: function getTexture(input) { + var src = input; + if (src instanceof _main.default.Framebuffer) { + src = src.color; + } + var texture = this.textures.get(src); + if (texture) { + return texture; + } + var tex = new _main.default.Texture(this, src); + this.textures.set(src, tex); + return tex; + } /* + * used in imageLight, + * To create a blurry image from the input non blurry img, if it doesn't already exist + * Add it to the diffusedTexture map, + * Returns the blurry image + * maps a p5.Image used by imageLight() to a p5.Graphics + */ + + }, + { + key: 'getDiffusedTexture', + value: function getDiffusedTexture(input) { + // if one already exists for a given input image + if (this.diffusedTextures.get(input) != null) { + return this.diffusedTextures.get(input); + } // if not, only then create one + + var newGraphic; // maybe switch to framebuffer + // hardcoded to 200px, because it's going to be blurry and smooth + var smallWidth = 200; + var width = smallWidth; + var height = Math.floor(smallWidth * (input.height / input.width)); + newGraphic = this._pInst.createGraphics(width, height, constants.WEBGL); + // create graphics is like making a new sketch, all functions on main + // sketch it would be available on graphics + var irradiance = newGraphic.createShader(defaultShaders.imageLightVert, defaultShaders.imageLightDiffusedFrag); + newGraphic.shader(irradiance); + irradiance.setUniform('environmentMap', input); + newGraphic.noStroke(); + newGraphic.rectMode(newGraphic.CENTER); + newGraphic.rect(0, 0, newGraphic.width, newGraphic.height); + this.diffusedTextures.set(input, newGraphic); + return newGraphic; + } /* + * used in imageLight, + * To create a texture from the input non blurry image, if it doesn't already exist + * Creating 8 different levels of textures according to different + * sizes and atoring them in `levels` array + * Creating a new Mipmap texture with that `levels` array + * Storing the texture for input image in map called `specularTextures` + * maps the input p5.Image to a p5.MipmapTexture + */ + + }, + { + key: 'getSpecularTexture', + value: function getSpecularTexture(input) { + // check if already exits (there are tex of diff resolution so which one to check) + // currently doing the whole array + if (this.specularTextures.get(input) != null) { + return this.specularTextures.get(input); + } // Hardcoded size + + var size = 512; + var tex; + var levels = [ + ]; + var graphic = this._pInst.createGraphics(size, size, constants.WEBGL); + var count = Math.log(size) / Math.log(2); + graphic.pixelDensity(1); + // currently only 8 levels + // This loop calculates 8 graphics of varying size of canvas + // and corresponding different roughness levels. + // Roughness increases with the decrease in canvas size, + // because rougher surfaces have less detailed/more blurry reflections. + for (var w = size; w >= 1; w /= 2) { + graphic.resizeCanvas(w, w); + var currCount = Math.log(w) / Math.log(2); + var roughness = 1 - currCount / count; + var myShader = graphic.createShader(defaultShaders.imageLightVert, defaultShaders.imageLightSpecularFrag); + graphic.shader(myShader); + graphic.clear(); + myShader.setUniform('environmentMap', input); + myShader.setUniform('roughness', roughness); + graphic.noStroke(); + graphic.plane(w, w); + levels.push(graphic.get().drawingContext.getImageData(0, 0, w, w)); + } + graphic.remove(); + tex = new _p6.MipmapTexture(this, levels, { + }); + this.specularTextures.set(input, tex); + return tex; + } /** + * @method activeFramebuffer + * @private + * @returns {p5.Framebuffer|null} The currently active framebuffer, or null if + * the main canvas is the current draw target. + */ + + }, + { + key: 'activeFramebuffer', + value: function activeFramebuffer() { + return this.activeFramebuffers[this.activeFramebuffers.length - 1] || null; + } + }, + { + key: 'createFramebuffer', + value: function createFramebuffer(options) { + return new _main.default.Framebuffer(this, options); + } + }, + { + key: '_setStrokeUniforms', + value: function _setStrokeUniforms(strokeShader) { + strokeShader.bindShader(); + // set the uniform values + strokeShader.setUniform('uUseLineColor', this._useLineColor); + strokeShader.setUniform('uMaterialColor', this.curStrokeColor); + strokeShader.setUniform('uStrokeWeight', this.curStrokeWeight); + strokeShader.setUniform('uStrokeCap', STROKE_CAP_ENUM[this.curStrokeCap]); + strokeShader.setUniform('uStrokeJoin', STROKE_JOIN_ENUM[this.curStrokeJoin]); + } + }, + { + key: '_setFillUniforms', + value: function _setFillUniforms(fillShader) { + fillShader.bindShader(); + // TODO: optimize + fillShader.setUniform('uUseVertexColor', this._useVertexColor); + fillShader.setUniform('uMaterialColor', this.curFillColor); + fillShader.setUniform('isTexture', !!this._tex); + if (this._tex) { + fillShader.setUniform('uSampler', this._tex); + } + fillShader.setUniform('uTint', this._tint); + fillShader.setUniform('uHasSetAmbient', this._hasSetAmbient); + fillShader.setUniform('uAmbientMatColor', this.curAmbientColor); + fillShader.setUniform('uSpecularMatColor', this.curSpecularColor); + fillShader.setUniform('uEmissiveMatColor', this.curEmissiveColor); + fillShader.setUniform('uSpecular', this._useSpecularMaterial); + fillShader.setUniform('uEmissive', this._useEmissiveMaterial); + fillShader.setUniform('uShininess', this._useShininess); + this._setImageLightUniforms(fillShader); + fillShader.setUniform('uUseLighting', this._enableLighting); + var pointLightCount = this.pointLightDiffuseColors.length / 3; + fillShader.setUniform('uPointLightCount', pointLightCount); + fillShader.setUniform('uPointLightLocation', this.pointLightPositions); + fillShader.setUniform('uPointLightDiffuseColors', this.pointLightDiffuseColors); + fillShader.setUniform('uPointLightSpecularColors', this.pointLightSpecularColors); + var directionalLightCount = this.directionalLightDiffuseColors.length / 3; + fillShader.setUniform('uDirectionalLightCount', directionalLightCount); + fillShader.setUniform('uLightingDirection', this.directionalLightDirections); + fillShader.setUniform('uDirectionalDiffuseColors', this.directionalLightDiffuseColors); + fillShader.setUniform('uDirectionalSpecularColors', this.directionalLightSpecularColors); + // TODO: sum these here... + var ambientLightCount = this.ambientLightColors.length / 3; + fillShader.setUniform('uAmbientLightCount', ambientLightCount); + fillShader.setUniform('uAmbientColor', this.ambientLightColors); + var spotLightCount = this.spotLightDiffuseColors.length / 3; + fillShader.setUniform('uSpotLightCount', spotLightCount); + fillShader.setUniform('uSpotLightAngle', this.spotLightAngle); + fillShader.setUniform('uSpotLightConc', this.spotLightConc); + fillShader.setUniform('uSpotLightDiffuseColors', this.spotLightDiffuseColors); + fillShader.setUniform('uSpotLightSpecularColors', this.spotLightSpecularColors); + fillShader.setUniform('uSpotLightLocation', this.spotLightPositions); + fillShader.setUniform('uSpotLightDirection', this.spotLightDirections); + fillShader.setUniform('uConstantAttenuation', this.constantAttenuation); + fillShader.setUniform('uLinearAttenuation', this.linearAttenuation); + fillShader.setUniform('uQuadraticAttenuation', this.quadraticAttenuation); + fillShader.bindTextures(); + } // getting called from _setFillUniforms + + }, + { + key: '_setImageLightUniforms', + value: function _setImageLightUniforms(shader) { + //set uniform values + shader.setUniform('uUseImageLight', this.activeImageLight != null); + // true + if (this.activeImageLight) { + // this.activeImageLight has image as a key + // look up the texture from the diffusedTexture map + var diffusedLight = this.getDiffusedTexture(this.activeImageLight); + shader.setUniform('environmentMapDiffused', diffusedLight); + var specularLight = this.getSpecularTexture(this.activeImageLight); + // In p5js the range of shininess is >= 1, + // Therefore roughness range will be ([0,1]*8)*20 or [0, 160] + // The factor of 8 is because currently the getSpecularTexture + // only calculated 8 different levels of roughness + // The factor of 20 is just to spread up this range so that, + // [1, max] of shininess is converted to [0,160] of roughness + var roughness = 20 / this._useShininess; + shader.setUniform('levelOfDetail', roughness * 8); + shader.setUniform('environmentMapSpecular', specularLight); + } + } + }, + { + key: '_setPointUniforms', + value: function _setPointUniforms(pointShader) { + pointShader.bindShader(); + // set the uniform values + pointShader.setUniform('uMaterialColor', this.curStrokeColor); + // @todo is there an instance where this isn't stroke weight? + // should be they be same var? + pointShader.setUniform('uPointSize', this.pointSize * this._pInst._pixelDensity); + } /* Binds a buffer to the drawing context + * when passed more than two arguments it also updates or initializes + * the data associated with the buffer + */ + + }, + { + key: '_bindBuffer', + value: function _bindBuffer(buffer, target, values, type, usage) { + if (!target) target = this.GL.ARRAY_BUFFER; + this.GL.bindBuffer(target, buffer); + if (values !== undefined) { + var data = values; + if (values instanceof _main.default.DataArray) { + data = values.dataArray(); + } else if (!(data instanceof (type || Float32Array))) { + data = new (type || Float32Array) (data); + } + this.GL.bufferData(target, data, usage || this.GL.STATIC_DRAW); + } + } /////////////////////////////// + //// UTILITY FUNCTIONS + ////////////////////////////// + + }, + { + key: '_arraysEqual', + value: function _arraysEqual(a, b) { + var aLength = a.length; + if (aLength !== b.length) return false; + return a.every(function (ai, i) { + return ai === b[i]; + }); + } + }, + { + key: '_isTypedArray', + value: function _isTypedArray(arr) { + return [Float32Array, + Float64Array, + Int16Array, + Uint16Array, + Uint32Array].some(function (x) { + return arr instanceof x; + }); + } /** + * turn a two dimensional array into one dimensional array + * @private + * @param {Array} arr 2-dimensional array + * @return {Array} 1-dimensional array + * [[1, 2, 3],[4, 5, 6]] -> [1, 2, 3, 4, 5, 6] + */ + + }, + { + key: '_flatten', + value: function _flatten(arr) { + //when empty, return empty + if (arr.length === 0) { + return []; + } else if (arr.length > 20000) { + //big models , load slower to avoid stack overflow + //faster non-recursive flatten via axelduch + //stackoverflow.com/questions/27266550/how-to-flatten-nested-array-in-javascript + var result = [ + ]; + var nodes = arr.slice(); + var node; + node = nodes.pop(); + do { + if (Array.isArray(node)) { + nodes.push.apply(nodes, _toConsumableArray(node)); + } else { + result.push(node); + } + } while (nodes.length && (node = nodes.pop()) !== undefined); + result.reverse(); // we reverse result to restore the original order + return result; + } else { + var _ref; + //otherwise if model within limits for browser + //use faster recursive loading + return (_ref = [ + ]).concat.apply(_ref, _toConsumableArray(arr)); + } + } /** + * turn a p5.Vector Array into a one dimensional number array + * @private + * @param {p5.Vector[]} arr an array of p5.Vector + * @return {Number[]} a one dimensional array of numbers + * [p5.Vector(1, 2, 3), p5.Vector(4, 5, 6)] -> + * [1, 2, 3, 4, 5, 6] + */ + + }, + { + key: '_vToNArray', + value: function _vToNArray(arr) { + var ret = [ + ]; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = arr[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var item = _step2.value; + ret.push(item.x, item.y, item.z); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + return ret; + } // function to calculate BezierVertex Coefficients + + }, + { + key: '_bezierCoefficients', + value: function _bezierCoefficients(t) { + var t2 = t * t; + var t3 = t2 * t; + var mt = 1 - t; + var mt2 = mt * mt; + var mt3 = mt2 * mt; + return [mt3, + 3 * mt2 * t, + 3 * mt * t2, + t3]; + } // function to calculate QuadraticVertex Coefficients + + }, + { + key: '_quadraticCoefficients', + value: function _quadraticCoefficients(t) { + var t2 = t * t; + var mt = 1 - t; + var mt2 = mt * mt; + return [mt2, + 2 * mt * t, + t2]; + } // function to convert Bezier coordinates to Catmull Rom Splines + + }, + { + key: '_bezierToCatmull', + value: function _bezierToCatmull(w) { + var p1 = w[1]; + var p2 = w[1] + (w[2] - w[0]) / this._curveTightness; + var p3 = w[2] - (w[3] - w[1]) / this._curveTightness; + var p4 = w[2]; + var p = [ + p1, + p2, + p3, + p4 + ]; + return p; + } + }, + { + key: '_initTessy', + value: function _initTessy() { + // function called for each vertex of tesselator output + function vertexCallback(data, polyVertArray) { + for (var i = 0; i < data.length; i++) { + polyVertArray.push(data[i]); + } + } + function begincallback(type) { + if (type !== _libtess.default.primitiveType.GL_TRIANGLES) { + console.log('expected TRIANGLES but got type: '.concat(type)); + } + } + function errorcallback(errno) { + console.log('error callback'); + console.log('error number: '.concat(errno)); + } // callback for when segments intersect and must be split + + function combinecallback(coords, data, weight) { + var result = new Array(_main.default.RendererGL.prototype.tessyVertexSize).fill(0); + for (var i = 0; i < weight.length; i++) { + for (var j = 0; j < result.length; j++) { + if (weight[i] === 0 || !data[i]) continue; + result[j] += data[i][j] * weight[i]; + } + } + return result; + } + function edgeCallback(flag) { + // don't really care about the flag, but need no-strip/no-fan behavior + } + var tessy = new _libtess.default.GluTesselator(); + tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_VERTEX_DATA, vertexCallback); + tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_BEGIN, begincallback); + tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_ERROR, errorcallback); + tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_COMBINE, combinecallback); + tessy.gluTessCallback(_libtess.default.gluEnum.GLU_TESS_EDGE_FLAG, edgeCallback); + tessy.gluTessProperty(_libtess.default.gluEnum.GLU_TESS_WINDING_RULE, _libtess.default.windingRule.GLU_TESS_WINDING_NONZERO); + return tessy; + } + }, + { + key: '_triangulate', + value: function _triangulate(contours) { + // libtess will take 3d verts and flatten to a plane for tesselation. + // libtess is capable of calculating a plane to tesselate on, but + // if all of the vertices have the same z values, we'll just + // assume the face is facing the camera, letting us skip any performance + // issues or bugs in libtess's automatic calculation. + var z = contours[0] ? contours[0][2] : undefined; + var allSameZ = true; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = contours[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var contour = _step3.value; + for (var j = 0; j < contour.length; j += _main.default.RendererGL.prototype.tessyVertexSize) { + if (contour[j + 2] !== z) { + allSameZ = false; + break; + } + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + if (allSameZ) { + this._tessy.gluTessNormal(0, 0, 1); + } else { + // Let libtess pick a plane for us + this._tessy.gluTessNormal(0, 0, 0); + } + var triangleVerts = [ + ]; + this._tessy.gluTessBeginPolygon(triangleVerts); + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for (var _iterator4 = contours[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _contour = _step4.value; + this._tessy.gluTessBeginContour(); + for (var _j = 0; _j < _contour.length; _j += _main.default.RendererGL.prototype.tessyVertexSize) { + var coords = _contour.slice(_j, _j + _main.default.RendererGL.prototype.tessyVertexSize); + this._tessy.gluTessVertex(coords, coords); + } + this._tessy.gluTessEndContour(); + } // finish polygon + + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + this._tessy.gluTessEndPolygon(); + return triangleVerts; + } + } + ]); + return RendererGL; + }(_main.default.Renderer); + /** + * ensures that p5 is using a 3d renderer. throws an error if not. + */ + _main.default.prototype._assert3d = function (name) { + if (!this._renderer.isP3D) throw new Error(''.concat(name, '() is only supported in WEBGL mode. If you\'d like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.')); + }; + // function to initialize GLU Tesselator + _main.default.RendererGL.prototype.tessyVertexSize = 12; + var _default = _main.default.RendererGL; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + '../core/p5.Renderer': 301, + './GeometryBuilder': 342, + './p5.Camera': 347, + './p5.Framebuffer': 349, + './p5.Matrix': 351, + './p5.Shader': 356, + './p5.Texture': 357, + 'core-js/modules/es.array.concat': 169, + 'core-js/modules/es.array.copy-within': 170, + 'core-js/modules/es.array.every': 171, + 'core-js/modules/es.array.fill': 172, + 'core-js/modules/es.array.from': 176, + 'core-js/modules/es.array.includes': 177, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.some': 184, + 'core-js/modules/es.map': 187, + 'core-js/modules/es.object.assign': 194, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.reflect.get': 203, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.set': 207, + 'core-js/modules/es.string.includes': 209, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.float32-array': 229, + 'core-js/modules/es.typed-array.float64-array': 230, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.int16-array': 234, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint16-array': 250, + 'core-js/modules/es.typed-array.uint32-array': 251, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256, + 'libtess': 269, + 'path': 272 + } + ], + 356: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.index-of'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.array.slice'); + _dereq_('core-js/modules/es.array.some'); + _dereq_('core-js/modules/es.function.name'); + _dereq_('core-js/modules/es.object.keys'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.default = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * This module defines the p5.Shader class + * @module 3D + * @submodule Material + * @for p5 + * @requires core + */ + /** + * Shader class for WEBGL Mode + * @class p5.Shader + * @constructor + * @param {p5.RendererGL} renderer an instance of p5.RendererGL that + * will provide the GL context for this new p5.Shader + * @param {String} vertSrc source code for the vertex shader (as a string) + * @param {String} fragSrc source code for the fragment shader (as a string) */ - /** - * @method loadJSON - * @param {String} path - * @param {String} datatype - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Object|Array} - */ - /** - * @method loadJSON - * @param {String} path - * @param {function} callback - * @param {function} [errorCallback] - * @return {Object|Array} - */ - - _main.default.prototype.loadJSON = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("loadJSON", args); - var path = args[0]; - var callback; - var errorCallback; - var options; - var ret = {}; // object needed for preload - var t = "json"; - // check for explicit data type argument - for (var i = 1; i < args.length; i++) { - var arg = args[i]; - if (typeof arg === "string") { - if (arg === "jsonp" || arg === "json") { - t = arg; - } - } else if (typeof arg === "function") { - if (!callback) { - callback = arg; - } else { - errorCallback = arg; - } - } else if ( - _typeof(arg) === "object" && - (arg.hasOwnProperty("jsonpCallback") || - arg.hasOwnProperty("jsonpCallbackFunction")) - ) { - t = "jsonp"; - options = arg; - } - } - var self = this; - this.httpDo( - path, - "GET", - options, - t, - function (resp) { - for (var k in resp) { - ret[k] = resp[k]; - } - if (typeof callback !== "undefined") { - callback(resp); - } - self._decrementPreload(); - }, - function (err) { - // Error handling - _main.default._friendlyFileLoadError(5, path); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }, - ); - return ret; - }; - /** - * Reads the contents of a file and creates a String array of its individual - * lines. If the name of the file is used as the parameter, as in the above - * example, the file must be located in the sketch directory/folder. - * - * Alternatively, the file may be loaded from anywhere on the local - * computer using an absolute path (something that starts with / on Unix and - * Linux, or a drive letter on Windows), or the filename parameter can be a - * URL for a file found on a network. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. - * - * This method is suitable for fetching files up to size of 64MB. - * @method loadStrings - * @param {String} filename name of the file or url to load - * @param {function} [callback] function to be executed after loadStrings() - * completes, Array is passed in as first - * argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {String[]} Array of Strings - * @example - * - * Calling loadStrings() inside preload() guarantees to complete the - * operation before setup() and draw() are called. - * - *
                                  - * let result; - * function preload() { - * result = loadStrings('assets/test.txt'); - * } - * function setup() { - * background(200); - * text(random(result), 10, 10, 80, 80); - * describe(`randomly generated text from a file, - * for example "i smell like butter"`); - * } - *
                                  - * - * Outside of preload(), you may supply a callback function to handle the - * object: + _main.default.Shader = /*#__PURE__*/ function () { + function _class(renderer, vertSrc, fragSrc) { + _classCallCheck(this, _class); + // TODO: adapt this to not take ids, but rather, + // to take the source for a vertex and fragment shader + // to enable custom shaders at some later date + this._renderer = renderer; + this._vertSrc = vertSrc; + this._fragSrc = fragSrc; + this._vertShader = - 1; + this._fragShader = - 1; + this._glProgram = 0; + this._loadedAttributes = false; + this.attributes = { + }; + this._loadedUniforms = false; + this.uniforms = { + }; + this._bound = false; + this.samplers = [ + ]; + } /** + * Creates, compiles, and links the shader based on its + * sources for the vertex and fragment shaders (provided + * to the constructor). Populates known attributes and + * uniforms from the shader. + * @method init + * @chainable + * @private + */ + + _createClass(_class, [ + { + key: 'init', + value: function init() { + if (this._glProgram === 0 /* or context is stale? */ ) { + var gl = this._renderer.GL; + // @todo: once custom shading is allowed, + // friendly error messages should be used here to share + // compiler and linker errors. + //set up the shader by + // 1. creating and getting a gl id for the shader program, + // 2. compliling its vertex & fragment sources, + // 3. linking the vertex and fragment shaders + this._vertShader = gl.createShader(gl.VERTEX_SHADER); + //load in our default vertex shader + gl.shaderSource(this._vertShader, this._vertSrc); + gl.compileShader(this._vertShader); + // if our vertex shader failed compilation? + if (!gl.getShaderParameter(this._vertShader, gl.COMPILE_STATUS)) { + _main.default._friendlyError('Yikes! An error occurred compiling the vertex shader:'.concat(gl.getShaderInfoLog(this._vertShader))); + return null; + } + this._fragShader = gl.createShader(gl.FRAGMENT_SHADER); + //load in our material frag shader + gl.shaderSource(this._fragShader, this._fragSrc); + gl.compileShader(this._fragShader); + // if our frag shader failed compilation? + if (!gl.getShaderParameter(this._fragShader, gl.COMPILE_STATUS)) { + _main.default._friendlyError('Darn! An error occurred compiling the fragment shader:'.concat(gl.getShaderInfoLog(this._fragShader))); + return null; + } + this._glProgram = gl.createProgram(); + gl.attachShader(this._glProgram, this._vertShader); + gl.attachShader(this._glProgram, this._fragShader); + gl.linkProgram(this._glProgram); + if (!gl.getProgramParameter(this._glProgram, gl.LINK_STATUS)) { + _main.default._friendlyError('Snap! Error linking shader program: '.concat(gl.getProgramInfoLog(this._glProgram))); + } + this._loadAttributes(); + this._loadUniforms(); + } + return this; + } /** + * Shaders belong to the main canvas or a p5.Graphics. Once they are compiled, + * they can only be used in the context they were compiled on. + * + * Use this method to make a new copy of a shader that gets compiled on a + * different context. + * + * @method copyToContext + * @param {p5|p5.Graphics} context The graphic or instance to copy this shader to. + * Pass `window` if you need to copy to the main canvas. + * @returns {p5.Shader} A new shader on the target context. + * + * @example + *
                                  + * + * let graphic = createGraphics(200, 200, WEBGL); + * let graphicShader = graphic.createShader(vert, frag); + * graphic.shader(graphicShader); // Use graphicShader on the graphic + * + * let mainShader = graphicShader.copyToContext(window); + * shader(mainShader); // Use `mainShader` on the main canvas + * + *
                                  + */ + + }, + { + key: 'copyToContext', + value: function copyToContext(context) { + var shader = new _main.default.Shader(context._renderer, this._vertSrc, this._fragSrc); + shader.ensureCompiledOnContext(context); + return shader; + } /** + * @private + */ + + }, + { + key: 'ensureCompiledOnContext', + value: function ensureCompiledOnContext(context) { + if (this._glProgram !== 0 && this._renderer !== context._renderer) { + throw new Error('The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?'); + } else if (this._glProgram === 0) { + this._renderer = context._renderer; + this.init(); + } + } /** + * Queries the active attributes for this shader and loads + * their names and locations into the attributes array. + * @method _loadAttributes + * @private + */ + + }, + { + key: '_loadAttributes', + value: function _loadAttributes() { + if (this._loadedAttributes) { + return; + } + this.attributes = { + }; + var gl = this._renderer.GL; + var numAttributes = gl.getProgramParameter(this._glProgram, gl.ACTIVE_ATTRIBUTES); + for (var i = 0; i < numAttributes; ++i) { + var attributeInfo = gl.getActiveAttrib(this._glProgram, i); + var name = attributeInfo.name; + var location = gl.getAttribLocation(this._glProgram, name); + var attribute = { + }; + attribute.name = name; + attribute.location = location; + attribute.index = i; + attribute.type = attributeInfo.type; + attribute.size = attributeInfo.size; + this.attributes[name] = attribute; + } + this._loadedAttributes = true; + } /** + * Queries the active uniforms for this shader and loads + * their names and locations into the uniforms array. + * @method _loadUniforms + * @private + */ + + }, + { + key: '_loadUniforms', + value: function _loadUniforms() { + if (this._loadedUniforms) { + return; + } + var gl = this._renderer.GL; + // Inspect shader and cache uniform info + var numUniforms = gl.getProgramParameter(this._glProgram, gl.ACTIVE_UNIFORMS); + var samplerIndex = 0; + for (var i = 0; i < numUniforms; ++i) { + var uniformInfo = gl.getActiveUniform(this._glProgram, i); + var uniform = { + }; + uniform.location = gl.getUniformLocation(this._glProgram, uniformInfo.name); + uniform.size = uniformInfo.size; + var uniformName = uniformInfo.name; + //uniforms thats are arrays have their name returned as + //someUniform[0] which is a bit silly so we trim it + //off here. The size property tells us that its an array + //so we dont lose any information by doing this + if (uniformInfo.size > 1) { + uniformName = uniformName.substring(0, uniformName.indexOf('[0]')); + } + uniform.name = uniformName; + uniform.type = uniformInfo.type; + uniform._cachedData = undefined; + if (uniform.type === gl.SAMPLER_2D) { + uniform.samplerIndex = samplerIndex; + samplerIndex++; + this.samplers.push(uniform); + } + uniform.isArray = uniformInfo.size > 1 || uniform.type === gl.FLOAT_MAT3 || uniform.type === gl.FLOAT_MAT4 || uniform.type === gl.FLOAT_VEC2 || uniform.type === gl.FLOAT_VEC3 || uniform.type === gl.FLOAT_VEC4 || uniform.type === gl.INT_VEC2 || uniform.type === gl.INT_VEC4 || uniform.type === gl.INT_VEC3; + this.uniforms[uniformName] = uniform; + } + this._loadedUniforms = true; + } + }, + { + key: 'compile', + value: function compile() { + // TODO + } /** + * initializes (if needed) and binds the shader program. + * @method bindShader + * @private + */ + + }, + { + key: 'bindShader', + value: function bindShader() { + this.init(); + if (!this._bound) { + this.useProgram(); + this._bound = true; + this._setMatrixUniforms(); + this.setUniform('uViewport', this._renderer._viewport); + } + } /** + * @method unbindShader + * @chainable + * @private + */ + + }, + { + key: 'unbindShader', + value: function unbindShader() { + if (this._bound) { + this.unbindTextures(); + //this._renderer.GL.useProgram(0); ?? + this._bound = false; + } + return this; + } + }, + { + key: 'bindTextures', + value: function bindTextures() { + var gl = this._renderer.GL; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = this.samplers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var uniform = _step.value; + var tex = uniform.texture; + if (tex === undefined) { + // user hasn't yet supplied a texture for this slot. + // (or there may not be one--maybe just lighting), + // so we supply a default texture instead. + tex = this._renderer._getEmptyTexture(); + } + gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); + tex.bindTexture(); + tex.update(); + gl.uniform1i(uniform.location, uniform.samplerIndex); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + }, + { + key: 'updateTextures', + value: function updateTextures() { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = this.samplers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var uniform = _step2.value; + var tex = uniform.texture; + if (tex) { + tex.update(); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + }, + { + key: 'unbindTextures', + value: function unbindTextures() { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = this.samplers[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var uniform = _step3.value; + this.setUniform(uniform.name, this._renderer._getEmptyTexture()); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + }, + { + key: '_setMatrixUniforms', + value: function _setMatrixUniforms() { + var viewMatrix = this._renderer._curCamera.cameraMatrix; + var projectionMatrix = this._renderer.uPMatrix; + var modelViewMatrix = this._renderer.uMVMatrix; + var modelViewProjectionMatrix = modelViewMatrix.copy(); + modelViewProjectionMatrix.mult(projectionMatrix); + if (this.isStrokeShader()) { + if (this._renderer._curCamera.cameraType === 'default') { + // strokes scale up as they approach camera, default + this.setUniform('uPerspective', 1); + } else { + // strokes have uniform scale regardless of distance from camera + this.setUniform('uPerspective', 0); + } + } + this.setUniform('uViewMatrix', viewMatrix.mat4); + this.setUniform('uProjectionMatrix', projectionMatrix.mat4); + this.setUniform('uModelViewMatrix', modelViewMatrix.mat4); + this.setUniform('uModelViewProjectionMatrix', modelViewProjectionMatrix.mat4); + if (this.uniforms.uNormalMatrix) { + this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix); + this.setUniform('uNormalMatrix', this._renderer.uNMatrix.mat3); + } + } /** + * @method useProgram + * @chainable + * @private + */ + + }, + { + key: 'useProgram', + value: function useProgram() { + var gl = this._renderer.GL; + if (this._renderer._curShader !== this) { + gl.useProgram(this._glProgram); + this._renderer._curShader = this; + } + return this; + } /** + * Used to set the uniforms of a + * p5.Shader object. + * + * Uniforms are used as a way to provide shader programs + * (which run on the GPU) with values from a sketch + * (which runs on the CPU). + * + * Here are some examples of uniforms you can make: + * - booleans + * - Example: `setUniform('x', true)` becomes `uniform float x` with the value `1.0` + * - numbers + * - Example: `setUniform('x', -2)` becomes `uniform float x` with the value `-2.0` + * - arrays of numbers + * - Example: `setUniform('x', [0, 0.5, 1])` becomes `uniform vec3 x` with the value `vec3(0.0, 0.5, 1.0)` + * - a p5.Image, p5.Graphics, p5.MediaElement, or p5.Texture + * - Example: `setUniform('x', img)` becomes `uniform sampler2D x` + * + * @method setUniform + * @chainable + * @param {String} uniformName the name of the uniform. + * Must correspond to the name used in the vertex and fragment shaders + * @param {Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture} + * data the data to associate with the uniform. The type can be + * a boolean (true/false), a number, an array of numbers, or + * an image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture) + * + * @example + *
                                  + * + * // Click within the image to toggle the value of uniforms + * // Note: for an alternative approach to the same example, + * // involving toggling between shaders please refer to: + * // https://p5js.org/reference/#/p5/shader + * + * let grad; + * let showRedGreen = false; + * + * function preload() { + * // note that we are using two instances + * // of the same vertex and fragment shaders + * grad = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); + * } + * + * function setup() { + * createCanvas(100, 100, WEBGL); + * shader(grad); + * noStroke(); + * + * describe( + * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' + * ); + * } + * + * function draw() { + * // update the offset values for each scenario, + * // moving the "grad" shader in either vertical or + * // horizontal direction each with differing colors + * + * if (showRedGreen === true) { + * grad.setUniform('colorCenter', [1, 0, 0]); + * grad.setUniform('colorBackground', [0, 1, 0]); + * grad.setUniform('offset', [sin(millis() / 2000), 1]); + * } else { + * grad.setUniform('colorCenter', [1, 0.5, 0]); + * grad.setUniform('colorBackground', [0.226, 0, 0.615]); + * grad.setUniform('offset', [0, sin(millis() / 2000) + 1]); + * } + * quad(-1, -1, 1, -1, 1, 1, -1, 1); + * } + * + * function mouseClicked() { + * showRedGreen = !showRedGreen; + * } + * + *
                                  + * + * @alt + * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. + */ + + }, + { + key: 'setUniform', + value: function setUniform(uniformName, data) { + var uniform = this.uniforms[uniformName]; + if (!uniform) { + return; + } + var gl = this._renderer.GL; + if (uniform.isArray) { + if (uniform._cachedData && this._renderer._arraysEqual(uniform._cachedData, data)) { + return; + } else { + uniform._cachedData = data.slice(0); + } + } else if (uniform._cachedData && uniform._cachedData === data) { + return; + } else { + if (Array.isArray(data)) { + uniform._cachedData = data.slice(0); + } else { + uniform._cachedData = data; + } + } + var location = uniform.location; + this.useProgram(); + switch (uniform.type) { + case gl.BOOL: + if (data === true) { + gl.uniform1i(location, 1); + } else { + gl.uniform1i(location, 0); + } + break; + case gl.INT: + if (uniform.size > 1) { + data.length && gl.uniform1iv(location, data); + } else { + gl.uniform1i(location, data); + } + break; + case gl.FLOAT: + if (uniform.size > 1) { + data.length && gl.uniform1fv(location, data); + } else { + gl.uniform1f(location, data); + } + break; + case gl.FLOAT_MAT3: + gl.uniformMatrix3fv(location, false, data); + break; + case gl.FLOAT_MAT4: + gl.uniformMatrix4fv(location, false, data); + break; + case gl.FLOAT_VEC2: + if (uniform.size > 1) { + data.length && gl.uniform2fv(location, data); + } else { + gl.uniform2f(location, data[0], data[1]); + } + break; + case gl.FLOAT_VEC3: + if (uniform.size > 1) { + data.length && gl.uniform3fv(location, data); + } else { + gl.uniform3f(location, data[0], data[1], data[2]); + } + break; + case gl.FLOAT_VEC4: + if (uniform.size > 1) { + data.length && gl.uniform4fv(location, data); + } else { + gl.uniform4f(location, data[0], data[1], data[2], data[3]); + } + break; + case gl.INT_VEC2: + if (uniform.size > 1) { + data.length && gl.uniform2iv(location, data); + } else { + gl.uniform2i(location, data[0], data[1]); + } + break; + case gl.INT_VEC3: + if (uniform.size > 1) { + data.length && gl.uniform3iv(location, data); + } else { + gl.uniform3i(location, data[0], data[1], data[2]); + } + break; + case gl.INT_VEC4: + if (uniform.size > 1) { + data.length && gl.uniform4iv(location, data); + } else { + gl.uniform4i(location, data[0], data[1], data[2], data[3]); + } + break; + case gl.SAMPLER_2D: + gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); + uniform.texture = data instanceof _main.default.Texture ? data : this._renderer.getTexture(data); + gl.uniform1i(location, uniform.samplerIndex); + if (uniform.texture.src.gifProperties) { + uniform.texture.src._animateGif(this._renderer._pInst); + } + break; + //@todo complete all types + } + return this; + } /* NONE OF THIS IS FAST OR EFFICIENT BUT BEAR WITH ME + * + * these shader "type" query methods are used by various + * facilities of the renderer to determine if changing + * the shader type for the required action (for example, + * do we need to load the default lighting shader if the + * current shader cannot handle lighting?) + * + **/ + + }, + { + key: 'isLightShader', + value: function isLightShader() { + return this.attributes.aNormal !== undefined || this.uniforms.uUseLighting !== undefined || this.uniforms.uAmbientLightCount !== undefined || this.uniforms.uDirectionalLightCount !== undefined || this.uniforms.uPointLightCount !== undefined || this.uniforms.uAmbientColor !== undefined || this.uniforms.uDirectionalDiffuseColors !== undefined || this.uniforms.uDirectionalSpecularColors !== undefined || this.uniforms.uPointLightLocation !== undefined || this.uniforms.uPointLightDiffuseColors !== undefined || this.uniforms.uPointLightSpecularColors !== undefined || this.uniforms.uLightingDirection !== undefined || this.uniforms.uSpecular !== undefined; + } + }, + { + key: 'isNormalShader', + value: function isNormalShader() { + return this.attributes.aNormal !== undefined; + } + }, + { + key: 'isTextureShader', + value: function isTextureShader() { + return this.samplers.length > 0; + } + }, + { + key: 'isColorShader', + value: function isColorShader() { + return this.attributes.aVertexColor !== undefined || this.uniforms.uMaterialColor !== undefined; + } + }, + { + key: 'isTexLightShader', + value: function isTexLightShader() { + return this.isLightShader() && this.isTextureShader(); + } + }, + { + key: 'isStrokeShader', + value: function isStrokeShader() { + return this.uniforms.uStrokeWeight !== undefined; + } /** + * @method enableAttrib + * @chainable + * @private + */ + + }, + { + key: 'enableAttrib', + value: function enableAttrib(attr, size, type, normalized, stride, offset) { + if (attr) { + if (typeof IS_MINIFIED === 'undefined' && this.attributes[attr.name] !== attr) { + console.warn('The attribute "'.concat(attr.name, '"passed to enableAttrib does not belong to this shader.')); + } + var loc = attr.location; + if (loc !== - 1) { + var gl = this._renderer.GL; + // Enable register even if it is disabled + if (!this._renderer.registerEnabled.has(loc)) { + gl.enableVertexAttribArray(loc); + // Record register availability + this._renderer.registerEnabled.add(loc); + } + this._renderer.GL.vertexAttribPointer(loc, size, type || gl.FLOAT, normalized || false, stride || 0, offset || 0); + } + } + return this; + } /** + * Once all buffers have been bound, this checks to see if there are any + * remaining active attributes, likely left over from previous renders, + * and disables them so that they don't affect rendering. + * @method disableRemainingAttributes + * @private + */ + + }, + { + key: 'disableRemainingAttributes', + value: function disableRemainingAttributes() { + var _this = this; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + var _loop = function _loop() { + var location = _step4.value; + if (!Object.keys(_this.attributes).some(function (key) { + return _this.attributes[key].location === location; + })) { + _this._renderer.GL.disableVertexAttribArray(location); + _this._renderer.registerEnabled.delete(location); + } + }; + for (var _iterator4 = this._renderer.registerEnabled.values() [Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + _loop(); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } + } + ]); + return _class; + }(); + var _default = _main.default.Shader; + exports.default = _default; + }, + { + '../core/main': 298, + 'core-js/modules/es.array.index-of': 178, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.array.slice': 183, + 'core-js/modules/es.array.some': 184, + 'core-js/modules/es.function.name': 186, + 'core-js/modules/es.object.keys': 199, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 357: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.get-prototype-of'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.reflect.construct'); + _dereq_('core-js/modules/es.regexp.to-string'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.typed-array.uint8-array'); + _dereq_('core-js/modules/es.typed-array.copy-within'); + _dereq_('core-js/modules/es.typed-array.every'); + _dereq_('core-js/modules/es.typed-array.fill'); + _dereq_('core-js/modules/es.typed-array.filter'); + _dereq_('core-js/modules/es.typed-array.find'); + _dereq_('core-js/modules/es.typed-array.find-index'); + _dereq_('core-js/modules/es.typed-array.for-each'); + _dereq_('core-js/modules/es.typed-array.includes'); + _dereq_('core-js/modules/es.typed-array.index-of'); + _dereq_('core-js/modules/es.typed-array.iterator'); + _dereq_('core-js/modules/es.typed-array.join'); + _dereq_('core-js/modules/es.typed-array.last-index-of'); + _dereq_('core-js/modules/es.typed-array.map'); + _dereq_('core-js/modules/es.typed-array.reduce'); + _dereq_('core-js/modules/es.typed-array.reduce-right'); + _dereq_('core-js/modules/es.typed-array.reverse'); + _dereq_('core-js/modules/es.typed-array.set'); + _dereq_('core-js/modules/es.typed-array.slice'); + _dereq_('core-js/modules/es.typed-array.some'); + _dereq_('core-js/modules/es.typed-array.sort'); + _dereq_('core-js/modules/es.typed-array.subarray'); + _dereq_('core-js/modules/es.typed-array.to-locale-string'); + _dereq_('core-js/modules/es.typed-array.to-string'); + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.checkWebGLCapabilities = checkWebGLCapabilities; + exports.default = exports.MipmapTexture = void 0; + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + function isNativeReflectConstruct() { + if (typeof Reflect === 'undefined' || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === 'function') return true; + try { + Date.prototype.toString.call(Reflect.construct(Date, [ + ], function () { + })); + return true; + } catch (e) { + return false; + } + } + return function () { + var Super = _getPrototypeOf(Derived), + result; + if (isNativeReflectConstruct()) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === 'object' || typeof call === 'function')) { + return call; + } + return _assertThisInitialized(self); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); + } + return self; + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } /** + * This module defines the p5.Texture class + * @module 3D + * @submodule Material + * @for p5 + * @requires core + */ + /** + * Texture class for WEBGL Mode + * @private + * @class p5.Texture + * @param {p5.RendererGL} renderer an instance of p5.RendererGL that + * will provide the GL context for this new p5.Texture + * @param {p5.Image|p5.Graphics|p5.Element|p5.MediaElement|ImageData|p5.Framebuffer|p5.FramebufferTexture|ImageData} [obj] the + * object containing the image data to store in the texture. + * @param {Object} [settings] optional A javascript object containing texture + * settings. + * @param {Number} [settings.format] optional The internal color component + * format for the texture. Possible values for format include gl.RGBA, + * gl.RGB, gl.ALPHA, gl.LUMINANCE, gl.LUMINANCE_ALPHA. Defaults to gl.RBGA + * @param {Number} [settings.minFilter] optional The texture minification + * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults + * to gl.LINEAR. Note, Mipmaps are not implemented in p5. + * @param {Number} [settings.magFilter] optional The texture magnification + * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults + * to gl.LINEAR. Note, Mipmaps are not implemented in p5. + * @param {Number} [settings.wrapS] optional The texture wrap settings for + * the s coordinate, or x axis. Possible values are gl.CLAMP_TO_EDGE, + * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available + * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE + * @param {Number} [settings.wrapT] optional The texture wrap settings for + * the t coordinate, or y axis. Possible values are gl.CLAMP_TO_EDGE, + * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available + * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE + * @param {Number} [settings.dataType] optional The data type of the texel + * data. Possible values are gl.UNSIGNED_BYTE or gl.FLOAT. There are more + * formats that are not implemented in p5. Defaults to gl.UNSIGNED_BYTE. + */ + + _main.default.Texture = /*#__PURE__*/ function () { + function Texture(renderer, obj, settings) { + _classCallCheck(this, Texture); + this._renderer = renderer; + var gl = this._renderer.GL; + settings = settings || { + }; + this.src = obj; + this.glTex = undefined; + this.glTarget = gl.TEXTURE_2D; + this.glFormat = settings.format || gl.RGBA; + this.mipmaps = false; + this.glMinFilter = settings.minFilter || gl.LINEAR; + this.glMagFilter = settings.magFilter || gl.LINEAR; + this.glWrapS = settings.wrapS || gl.CLAMP_TO_EDGE; + this.glWrapT = settings.wrapT || gl.CLAMP_TO_EDGE; + this.glDataType = settings.dataType || gl.UNSIGNED_BYTE; + var support = checkWebGLCapabilities(renderer); + if (this.glFormat === gl.HALF_FLOAT && !support.halfFloat) { + console.log('This device does not support dataType HALF_FLOAT. Falling back to FLOAT.'); + this.glDataType = gl.FLOAT; + } + if (this.glFormat === gl.HALF_FLOAT && (this.glMinFilter === gl.LINEAR || this.glMagFilter === gl.LINEAR) && !support.halfFloatLinear) { + console.log('This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.'); + if (this.glMinFilter === gl.LINEAR) this.glMinFilter = gl.NEAREST; + if (this.glMagFilter === gl.LINEAR) this.glMagFilter = gl.NEAREST; + } + if (this.glFormat === gl.FLOAT && !support.float) { + console.log('This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE.'); + this.glDataType = gl.UNSIGNED_BYTE; + } + if (this.glFormat === gl.FLOAT && (this.glMinFilter === gl.LINEAR || this.glMagFilter === gl.LINEAR) && !support.floatLinear) { + console.log('This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.'); + if (this.glMinFilter === gl.LINEAR) this.glMinFilter = gl.NEAREST; + if (this.glMagFilter === gl.LINEAR) this.glMagFilter = gl.NEAREST; + } // used to determine if this texture might need constant updating + // because it is a video or gif. + + this.isSrcMediaElement = typeof _main.default.MediaElement !== 'undefined' && obj instanceof _main.default.MediaElement; + this._videoPrevUpdateTime = 0; + this.isSrcHTMLElement = typeof _main.default.Element !== 'undefined' && obj instanceof _main.default.Element && !(obj instanceof _main.default.Graphics) && !(obj instanceof _main.default.Renderer); + this.isSrcP5Image = obj instanceof _main.default.Image; + this.isSrcP5Graphics = obj instanceof _main.default.Graphics; + this.isSrcP5Renderer = obj instanceof _main.default.Renderer; + this.isImageData = typeof ImageData !== 'undefined' && obj instanceof ImageData; + this.isFramebufferTexture = obj instanceof _main.default.FramebufferTexture; + var textureData = this._getTextureDataFromSource(); + this.width = textureData.width; + this.height = textureData.height; + this.init(textureData); + return this; + } + _createClass(Texture, [ + { + key: '_getTextureDataFromSource', + value: function _getTextureDataFromSource() { + var textureData; + if (this.isFramebufferTexture) { + textureData = this.src.rawTexture(); + } else if (this.isSrcP5Image) { + // param is a p5.Image + textureData = this.src.canvas; + } else if (this.isSrcMediaElement || this.isSrcP5Graphics || this.isSrcP5Renderer || this.isSrcHTMLElement) { + // if param is a video HTML element + textureData = this.src.elt; + } else if (this.isImageData) { + textureData = this.src; + } + return textureData; + } /** + * Initializes common texture parameters, creates a gl texture, + * tries to upload the texture for the first time if data is + * already available. + * @private + * @method init + */ + + }, + { + key: 'init', + value: function init(data) { + var gl = this._renderer.GL; + if (!this.isFramebufferTexture) { + this.glTex = gl.createTexture(); + } + this.glWrapS = this._renderer.textureWrapX; + this.glWrapT = this._renderer.textureWrapY; + this.setWrapMode(this.glWrapS, this.glWrapT); + this.bindTexture(); + //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); + if (this.isFramebufferTexture) { + // Do nothing, the framebuffer manages its own content + } else if (this.width === 0 || this.height === 0 || this.isSrcMediaElement && !this.src.loadedmetadata) { + // assign a 1×1 empty texture initially, because data is not yet ready, + // so that no errors occur in gl console! + var tmpdata = new Uint8Array([1, + 1, + 1, + 1]); + gl.texImage2D(this.glTarget, 0, gl.RGBA, 1, 1, 0, this.glFormat, this.glDataType, tmpdata); + } else { + // data is ready: just push the texture! + gl.texImage2D(this.glTarget, 0, this.glFormat, this.glFormat, this.glDataType, data); + } + } /** + * Checks if the source data for this texture has changed (if it's + * easy to do so) and reuploads the texture if necessary. If it's not + * possible or to expensive to do a calculation to determine wheter or + * not the data has occurred, this method simply re-uploads the texture. + * @method update + */ + + }, + { + key: 'update', + value: function update() { + var data = this.src; + if (data.width === 0 || data.height === 0) { + return false; // nothing to do! + } // FramebufferTexture instances wrap raw WebGL textures already, which + // don't need any extra updating, as they already live on the GPU + + if (this.isFramebufferTexture) { + return false; + } + var textureData = this._getTextureDataFromSource(); + var updated = false; + var gl = this._renderer.GL; + // pull texture from data, make sure width & height are appropriate + if (textureData.width !== this.width || textureData.height !== this.height) { + updated = true; + // make sure that if the width and height of this.src have changed + // for some reason, we update our metadata and upload the texture again + this.width = textureData.width || data.width; + this.height = textureData.height || data.height; + if (this.isSrcP5Image) { + data.setModified(false); + } else if (this.isSrcMediaElement || this.isSrcHTMLElement) { + // on the first frame the metadata comes in, the size will be changed + // from 0 to actual size, but pixels may not be available. + // flag for update in a future frame. + // if we don't do this, a paused video, for example, may not + // send the first frame to texture memory. + data.setModified(true); + } + } else if (this.isSrcP5Image) { + // for an image, we only update if the modified field has been set, + // for example, by a call to p5.Image.set + if (data.isModified()) { + updated = true; + data.setModified(false); + } + } else if (this.isSrcMediaElement) { + // for a media element (video), we'll check if the current time in + // the video frame matches the last time. if it doesn't match, the + // video has advanced or otherwise been taken to a new frame, + // and we need to upload it. + if (data.isModified()) { + // p5.MediaElement may have also had set/updatePixels, etc. called + // on it and should be updated, or may have been set for the first + // time! + updated = true; + data.setModified(false); + } else if (data.loadedmetadata) { + // if the meta data has been loaded, we can ask the video + // what it's current position (in time) is. + if (this._videoPrevUpdateTime !== data.time()) { + // update the texture in gpu mem only if the current + // video timestamp does not match the timestamp of the last + // time we uploaded this texture (and update the time we + // last uploaded, too) + this._videoPrevUpdateTime = data.time(); + updated = true; + } + } + } else if (this.isImageData) { + if (data._dirty) { + data._dirty = false; + updated = true; + } + } else { + /* data instanceof p5.Graphics, probably */ + // there is not enough information to tell if the texture can be + // conditionally updated; so to be safe, we just go ahead and upload it. + updated = true; + } + if (updated) { + this.bindTexture(); + gl.texImage2D(this.glTarget, 0, this.glFormat, this.glFormat, this.glDataType, textureData); + } + return updated; + } /** + * Binds the texture to the appropriate GL target. + * @method bindTexture + */ + + }, + { + key: 'bindTexture', + value: function bindTexture() { + // bind texture using gl context + glTarget and + // generated gl texture object + var gl = this._renderer.GL; + gl.bindTexture(this.glTarget, this.getTexture()); + return this; + } /** + * Unbinds the texture from the appropriate GL target. + * @method unbindTexture + */ + + }, + { + key: 'unbindTexture', + value: function unbindTexture() { + // unbind per above, disable texturing on glTarget + var gl = this._renderer.GL; + gl.bindTexture(this.glTarget, null); + } + }, + { + key: 'getTexture', + value: function getTexture() { + if (this.isFramebufferTexture) { + return this.src.rawTexture(); + } else { + return this.glTex; + } + } /** + * Sets how a texture is be interpolated when upscaled or downscaled. + * Nearest filtering uses nearest neighbor scaling when interpolating + * Linear filtering uses WebGL's linear scaling when interpolating + * @method setInterpolation + * @param {String} downScale Specifies the texture filtering when + * textures are shrunk. Options are LINEAR or NEAREST + * @param {String} upScale Specifies the texture filtering when + * textures are magnified. Options are LINEAR or NEAREST + * @todo implement mipmapping filters + */ + + }, + { + key: 'setInterpolation', + value: function setInterpolation(downScale, upScale) { + var gl = this._renderer.GL; + this.glMinFilter = this.glFilter(downScale); + this.glMagFilter = this.glFilter(upScale); + this.bindTexture(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); + this.unbindTexture(); + } + }, + { + key: 'glFilter', + value: function glFilter(filter) { + var gl = this._renderer.GL; + if (filter === constants.NEAREST) { + return gl.NEAREST; + } else { + return gl.LINEAR; + } + } /** + * Sets the texture wrapping mode. This controls how textures behave + * when their uv's go outside of the 0 - 1 range. There are three options: + * CLAMP, REPEAT, and MIRROR. REPEAT & MIRROR are only available if the texture + * is a power of two size (128, 256, 512, 1024, etc.). + * @method setWrapMode + * @param {String} wrapX Controls the horizontal texture wrapping behavior + * @param {String} wrapY Controls the vertical texture wrapping behavior + */ + + }, + { + key: 'setWrapMode', + value: function setWrapMode(wrapX, wrapY) { + var gl = this._renderer.GL; + // for webgl 1 we need to check if the texture is power of two + // if it isn't we will set the wrap mode to CLAMP + // webgl2 will support npot REPEAT and MIRROR but we don't check for it yet + var isPowerOfTwo = function isPowerOfTwo(x) { + return (x & x - 1) === 0; + }; + var textureData = this._getTextureDataFromSource(); + var wrapWidth; + var wrapHeight; + if (textureData.naturalWidth && textureData.naturalHeight) { + wrapWidth = textureData.naturalWidth; + wrapHeight = textureData.naturalHeight; + } else { + wrapWidth = this.width; + wrapHeight = this.height; + } + var widthPowerOfTwo = isPowerOfTwo(wrapWidth); + var heightPowerOfTwo = isPowerOfTwo(wrapHeight); + if (wrapX === constants.REPEAT) { + if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { + this.glWrapS = gl.REPEAT; + } else { + console.warn('You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead'); + this.glWrapS = gl.CLAMP_TO_EDGE; + } + } else if (wrapX === constants.MIRROR) { + if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { + this.glWrapS = gl.MIRRORED_REPEAT; + } else { + console.warn('You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead'); + this.glWrapS = gl.CLAMP_TO_EDGE; + } + } else { + // falling back to default if didn't get a proper mode + this.glWrapS = gl.CLAMP_TO_EDGE; + } + if (wrapY === constants.REPEAT) { + if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { + this.glWrapT = gl.REPEAT; + } else { + console.warn('You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead'); + this.glWrapT = gl.CLAMP_TO_EDGE; + } + } else if (wrapY === constants.MIRROR) { + if (this._renderer.webglVersion === constants.WEBGL2 || widthPowerOfTwo && heightPowerOfTwo) { + this.glWrapT = gl.MIRRORED_REPEAT; + } else { + console.warn('You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead'); + this.glWrapT = gl.CLAMP_TO_EDGE; + } + } else { + // falling back to default if didn't get a proper mode + this.glWrapT = gl.CLAMP_TO_EDGE; + } + this.bindTexture(); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.glWrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.glWrapT); + this.unbindTexture(); + } + } + ]); + return Texture; + }(); + var MipmapTexture = /*#__PURE__*/ function (_p5$Texture) { + _inherits(MipmapTexture, _p5$Texture); + var _super = _createSuper(MipmapTexture); + function MipmapTexture(renderer, levels, settings) { + var _this; + _classCallCheck(this, MipmapTexture); + _this = _super.call(this, renderer, levels, settings); + var gl = _this._renderer.GL; + if (_this.glMinFilter === gl.LINEAR) { + _this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; + } + return _this; + } + _createClass(MipmapTexture, [ + { + key: 'glFilter', + value: function glFilter(_filter) { + var gl = this._renderer.GL; + // TODO: support others + return gl.LINEAR_MIPMAP_LINEAR; + } + }, + { + key: '_getTextureDataFromSource', + value: function _getTextureDataFromSource() { + return this.src; + } + }, + { + key: 'init', + value: function init(levels) { + var gl = this._renderer.GL; + this.glTex = gl.createTexture(); + this.bindTexture(); + for (var level = 0; level < levels.length; level++) { + gl.texImage2D(this.glTarget, level, this.glFormat, this.glFormat, this.glDataType, levels[level]); + } + this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.glMagFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.glMinFilter); + this.unbindTexture(); + } + }, + { + key: 'update', + value: function update() { + } + } + ]); + return MipmapTexture; + }(_main.default.Texture); + exports.MipmapTexture = MipmapTexture; + function checkWebGLCapabilities(_ref) { + var GL = _ref.GL, + webglVersion = _ref.webglVersion; + var gl = GL; + var supportsFloat = webglVersion === constants.WEBGL2 ? gl.getExtension('EXT_color_buffer_float') && gl.getExtension('EXT_float_blend') : gl.getExtension('OES_texture_float'); + var supportsFloatLinear = supportsFloat && gl.getExtension('OES_texture_float_linear'); + var supportsHalfFloat = webglVersion === constants.WEBGL2 ? gl.getExtension('EXT_color_buffer_float') : gl.getExtension('OES_texture_half_float'); + var supportsHalfFloatLinear = supportsHalfFloat && gl.getExtension('OES_texture_half_float_linear'); + return { + float: supportsFloat, + floatLinear: supportsFloatLinear, + halfFloat: supportsHalfFloat, + halfFloatLinear: supportsHalfFloatLinear + }; + } + var _default = _main.default.Texture; + exports.default = _default; + }, + { + '../core/constants': 286, + '../core/main': 298, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.get-prototype-of': 198, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.reflect.construct': 202, + 'core-js/modules/es.regexp.to-string': 206, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.typed-array.copy-within': 223, + 'core-js/modules/es.typed-array.every': 224, + 'core-js/modules/es.typed-array.fill': 225, + 'core-js/modules/es.typed-array.filter': 226, + 'core-js/modules/es.typed-array.find': 228, + 'core-js/modules/es.typed-array.find-index': 227, + 'core-js/modules/es.typed-array.for-each': 231, + 'core-js/modules/es.typed-array.includes': 232, + 'core-js/modules/es.typed-array.index-of': 233, + 'core-js/modules/es.typed-array.iterator': 236, + 'core-js/modules/es.typed-array.join': 237, + 'core-js/modules/es.typed-array.last-index-of': 238, + 'core-js/modules/es.typed-array.map': 239, + 'core-js/modules/es.typed-array.reduce': 241, + 'core-js/modules/es.typed-array.reduce-right': 240, + 'core-js/modules/es.typed-array.reverse': 242, + 'core-js/modules/es.typed-array.set': 243, + 'core-js/modules/es.typed-array.slice': 244, + 'core-js/modules/es.typed-array.some': 245, + 'core-js/modules/es.typed-array.sort': 246, + 'core-js/modules/es.typed-array.subarray': 247, + 'core-js/modules/es.typed-array.to-locale-string': 248, + 'core-js/modules/es.typed-array.to-string': 249, + 'core-js/modules/es.typed-array.uint8-array': 252, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 358: [ + function (_dereq_, module, exports) { + 'use strict'; + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.get-own-property-descriptor'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/es.weak-map'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + function _typeof2(obj) { + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof2 = function _typeof2(obj) { + return typeof obj; + }; + } else { + _typeof2 = function _typeof2(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + return _typeof2(obj); + } + function _typeof(obj) { + if (typeof Symbol === 'function' && _typeof2(Symbol.iterator) === 'symbol') { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : _typeof2(obj); + }; + } + return _typeof(obj); + } + _dereq_('core-js/modules/es.symbol'); + _dereq_('core-js/modules/es.symbol.description'); + _dereq_('core-js/modules/es.symbol.iterator'); + _dereq_('core-js/modules/es.array.iterator'); + _dereq_('core-js/modules/es.object.to-string'); + _dereq_('core-js/modules/es.regexp.exec'); + _dereq_('core-js/modules/es.string.iterator'); + _dereq_('core-js/modules/es.string.split'); + _dereq_('core-js/modules/es.string.sub'); + _dereq_('core-js/modules/web.dom-collections.iterator'); + var _main = _interopRequireDefault(_dereq_('../core/main')); + var constants = _interopRequireWildcard(_dereq_('../core/constants')); + _dereq_('./p5.Shader'); + _dereq_('./p5.RendererGL.Retained'); + function _getRequireWildcardCache() { + if (typeof WeakMap !== 'function') return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function _getRequireWildcardCache() { + return cache; + }; + return cache; + } + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== 'object' && typeof obj !== 'function') { + return { + default: + obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } // Text/Typography + // @TODO: + + _main.default.RendererGL.prototype._applyTextProperties = function () { + //@TODO finish implementation + //console.error('text commands not yet implemented in webgl'); + }; + _main.default.RendererGL.prototype.textWidth = function (s) { + if (this._isOpenType()) { + return this._textFont._textWidth(s, this._textSize); + } + return 0; // TODO: error + }; + // rendering constants + // the number of rows/columns dividing each glyph + var charGridWidth = 9; + var charGridHeight = charGridWidth; + // size of the image holding the bezier stroke info + var strokeImageWidth = 64; + var strokeImageHeight = 64; + // size of the image holding the stroke indices for each row/col + var gridImageWidth = 64; + var gridImageHeight = 64; + // size of the image holding the offset/length of each row/col stripe + var cellImageWidth = 64; + var cellImageHeight = 64; + /** + * @private + * @class ImageInfos + * @param {Integer} width + * @param {Integer} height * - *
                                  - * function setup() { - * loadStrings('assets/test.txt', pickString); - * describe(`randomly generated text from a file, - * for example "i have three feet"`); - * } + * the ImageInfos class holds a list of ImageDatas of a given size. + */ + var ImageInfos = /*#__PURE__*/ function () { + function ImageInfos(width, height) { + _classCallCheck(this, ImageInfos); + this.width = width; + this.height = height; + this.infos = [ + ]; // the list of images + } /** + * + * @method findImage + * @param {Integer} space + * @return {Object} contains the ImageData, and pixel index into that + * ImageData where the free space was allocated. + * + * finds free space of a given size in the ImageData list + */ + + _createClass(ImageInfos, [ + { + key: 'findImage', + value: function findImage(space) { + var imageSize = this.width * this.height; + if (space > imageSize) throw new Error('font is too complex to render in 3D'); + // search through the list of images, looking for one with + // anough unused space. + var imageInfo, + imageData; + for (var ii = this.infos.length - 1; ii >= 0; --ii) { + var imageInfoTest = this.infos[ii]; + if (imageInfoTest.index + space < imageSize) { + // found one + imageInfo = imageInfoTest; + imageData = imageInfoTest.imageData; + break; + } + } + if (!imageInfo) { + try { + // create a new image + imageData = new ImageData(this.width, this.height); + } catch (err) { + // for browsers that don't support ImageData constructors (ie IE11) + // create an ImageData using the old method + var canvas = document.getElementsByTagName('canvas') [0]; + var created = !canvas; + if (!canvas) { + // create a temporary canvas + canvas = document.createElement('canvas'); + canvas.style.display = 'none'; + document.body.appendChild(canvas); + } + var ctx = canvas.getContext('2d'); + if (ctx) { + imageData = ctx.createImageData(this.width, this.height); + } + if (created) { + // distroy the temporary canvas, if necessary + document.body.removeChild(canvas); + } + } // construct & dd the new image info + + imageInfo = { + index: 0, + imageData: imageData + }; + this.infos.push(imageInfo); + } + var index = imageInfo.index; + imageInfo.index += space; // move to the start of the next image + imageData._dirty = true; + return { + imageData: imageData, + index: index + }; + } + } + ]); + return ImageInfos; + }(); + /** + * @function setPixel + * @param {Object} imageInfo + * @param {Number} r + * @param {Number} g + * @param {Number} b + * @param {Number} a * - * function pickString(result) { - * background(200); - * text(random(result), 10, 10, 80, 80); - * } - *
                                  + * writes the next pixel into an indexed ImageData */ - _main.default.prototype.loadStrings = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("loadStrings", args); - var ret = []; - var callback, errorCallback; - for (var i = 1; i < args.length; i++) { - var arg = args[i]; - if (typeof arg === "function") { - if (typeof callback === "undefined") { - callback = arg; - } else if (typeof errorCallback === "undefined") { - errorCallback = arg; - } - } - } - var self = this; - _main.default.prototype.httpDo.call( - this, - args[0], - "GET", - "text", - function (data) { - // split lines handling mac/windows/linux endings - var lines = data - .replace(/\r\n/g, "\r") - .replace(/\n/g, "\r") - .split(/\r/); - // safe insert approach which will not blow up stack when inserting - // >100k lines, but still be faster than iterating line-by-line. based on - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#Examples - var QUANTUM = 32768; - for (var _i = 0, len = lines.length; _i < len; _i += QUANTUM) { - Array.prototype.push.apply( - ret, - lines.slice(_i, Math.min(_i + QUANTUM, len)), - ); - } - if (typeof callback !== "undefined") { - callback(ret); - } - self._decrementPreload(); - }, - function (err) { - // Error handling - _main.default._friendlyFileLoadError(3, arguments[0]); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }, - ); - return ret; - }; - /** - * Reads the contents of a file or URL and creates a p5.Table object with - * its values. If a file is specified, it must be located in the sketch's - * "data" folder. The filename parameter can also be a URL to a file found - * online. By default, the file is assumed to be comma-separated (in CSV - * format). Table only looks for a header row if the 'header' option is - * included. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. Calling loadTable() inside preload() - * guarantees to complete the operation before setup() and draw() are called. - * Outside of preload(), you may supply a callback function to handle the - * object: - * - * All files loaded and saved use UTF-8 encoding. This method is suitable for fetching files up to size of 64MB. - * @method loadTable - * @param {String} filename name of the file or URL to load - * @param {String} [extension] parse the table by comma-separated values "csv", semicolon-separated - * values "ssv", or tab-separated values "tsv" - * @param {String} [header] "header" to indicate table has header row - * @param {function} [callback] function to be executed after - * loadTable() completes. On success, the - * Table object is passed in as the - * first argument. - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Object} Table object containing data - * - * @example - *
                                  - * - * // Given the following CSV file called "mammals.csv" - * // located in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * //the file can be remote - * //table = loadTable("http://p5js.org/reference/assets/mammals.csv", - * // "csv", "header"); - * } - * - * function setup() { - * //count the columns - * print(table.getRowCount() + ' total rows in table'); - * print(table.getColumnCount() + ' total columns in table'); - * - * print(table.getColumn('name')); - * //["Goat", "Leopard", "Zebra"] - * - * //cycle through the table - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) { - * print(table.getString(r, c)); - * } - * describe(`randomly generated text from a file, - * for example "i smell like butter"`); - * } - * - *
                                  - */ - _main.default.prototype.loadTable = function (path) { - // p5._validateParameters('loadTable', arguments); - var callback; - var errorCallback; - var options = []; - var header = false; - var ext = path.substring(path.lastIndexOf(".") + 1, path.length); - var sep; - if (ext === "csv") { - sep = ","; - } else if (ext === "ssv") { - sep = ";"; - } else if (ext === "tsv") { - sep = "\t"; - } - for (var i = 1; i < arguments.length; i++) { - if (typeof arguments[i] === "function") { - if (typeof callback === "undefined") { - callback = arguments[i]; - } else if (typeof errorCallback === "undefined") { - errorCallback = arguments[i]; - } - } else if (typeof arguments[i] === "string") { - options.push(arguments[i]); - if (arguments[i] === "header") { - header = true; - } - if (arguments[i] === "csv") { - sep = ","; - } else if (arguments[i] === "ssv") { - sep = ";"; - } else if (arguments[i] === "tsv") { - sep = "\t"; - } - } - } - var t = new _main.default.Table(); - var self = this; - this.httpDo( - path, - "GET", - "table", - function (resp) { - var state = {}; - // define constants - var PRE_TOKEN = 0, - MID_TOKEN = 1, - POST_TOKEN = 2, - POST_RECORD = 4; - var QUOTE = '"', - CR = "\r", - LF = "\n"; - var records = []; - var offset = 0; - var currentRecord = null; - var currentChar; - var tokenBegin = function tokenBegin() { - state.currentState = PRE_TOKEN; - state.token = ""; - }; - var tokenEnd = function tokenEnd() { - currentRecord.push(state.token); - tokenBegin(); - }; - var recordBegin = function recordBegin() { - state.escaped = false; - currentRecord = []; - tokenBegin(); - }; - var recordEnd = function recordEnd() { - state.currentState = POST_RECORD; - records.push(currentRecord); - currentRecord = null; - }; - for (;;) { - currentChar = resp[offset++]; - // EOF - if (currentChar == null) { - if (state.escaped) { - throw new Error("Unclosed quote in file."); - } - if (currentRecord) { - tokenEnd(); - recordEnd(); - break; - } - } - if (currentRecord === null) { - recordBegin(); - } // Handle opening quote - - if (state.currentState === PRE_TOKEN) { - if (currentChar === QUOTE) { - state.escaped = true; - state.currentState = MID_TOKEN; - continue; - } - state.currentState = MID_TOKEN; - } // mid-token and escaped, look for sequences and end quote - - if (state.currentState === MID_TOKEN && state.escaped) { - if (currentChar === QUOTE) { - if (resp[offset] === QUOTE) { - state.token += QUOTE; - offset++; - } else { - state.escaped = false; - state.currentState = POST_TOKEN; - } - } else if (currentChar === CR) { - continue; - } else { - state.token += currentChar; - } - continue; - } // fall-through: mid-token or post-token, not escaped - - if (currentChar === CR) { - if (resp[offset] === LF) { - offset++; - } - tokenEnd(); - recordEnd(); - } else if (currentChar === LF) { - tokenEnd(); - recordEnd(); - } else if (currentChar === sep) { - tokenEnd(); - } else if (state.currentState === MID_TOKEN) { - state.token += currentChar; - } - } // set up column names - - if (header) { - t.columns = records.shift(); - } else { - for (var _i2 = 0; _i2 < records[0].length; _i2++) { - t.columns[_i2] = "null"; - } - } - var row; - for (var _i3 = 0; _i3 < records.length; _i3++) { - //Handles row of 'undefined' at end of some CSVs - if (records[_i3].length === 1) { - if ( - records[_i3][0] === "undefined" || - records[_i3][0] === "" - ) { - continue; - } - } - row = new _main.default.TableRow(); - row.arr = records[_i3]; - row.obj = makeObject(records[_i3], t.columns); - t.addRow(row); - } - if (typeof callback === "function") { - callback(t); - } - self._decrementPreload(); - }, - function (err) { - // Error handling - _main.default._friendlyFileLoadError(2, path); - if (errorCallback) { - errorCallback(err); - } else { - console.error(err); - } - }, - ); - return t; - }; - // helper function to turn a row into a JSON object - function makeObject(row, headers) { - headers = headers || []; - if (typeof headers === "undefined") { - for (var j = 0; j < row.length; j++) { - headers[j.toString()] = j; - } - } - return Object.fromEntries( - headers.map(function (key, i) { - return [key, row[i]]; - }), - ); - } /** - * Reads the contents of a file and creates an XML object with its values. - * If the name of the file is used as the parameter, as in the above example, - * the file must be located in the sketch directory/folder. - * - * Alternatively, the file maybe be loaded from anywhere on the local - * computer using an absolute path (something that starts with / on Unix and - * Linux, or a drive letter on Windows), or the filename parameter can be a - * URL for a file found on a network. - * - * This method is asynchronous, meaning it may not finish before the next - * line in your sketch is executed. Calling loadXML() inside preload() - * guarantees to complete the operation before setup() and draw() are called. - * - * Outside of preload(), you may supply a callback function to handle the - * object. - * - * This method is suitable for fetching files up to size of 64MB. - * @method loadXML - * @param {String} filename name of the file or URL to load - * @param {function} [callback] function to be executed after loadXML() - * completes, XML object is passed in as - * first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Object} XML object containing data - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let children = xml.getChildren('animal'); - * - * for (let i = 0; i < children.length; i++) { - * let id = children[i].getNum('id'); - * let coloring = children[i].getString('species'); - * let name = children[i].getContent(); - * print(id + ', ' + coloring + ', ' + name); - * } - * describe('no image displayed'); - * } - * - * // Sketch prints: - * // 0, Capra hircus, Goat - * // 1, Panthera pardus, Leopard - * // 2, Equus zebra, Zebra - *
                                  - */ - - _main.default.prototype.loadXML = function () { - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - var ret = new _main.default.XML(); - var callback, errorCallback; - for (var i = 1; i < args.length; i++) { - var arg = args[i]; - if (typeof arg === "function") { - if (typeof callback === "undefined") { - callback = arg; - } else if (typeof errorCallback === "undefined") { - errorCallback = arg; - } - } - } - var self = this; - this.httpDo( - args[0], - "GET", - "xml", - function (xml) { - for (var key in xml) { - ret[key] = xml[key]; - } - if (typeof callback !== "undefined") { - callback(ret); - } - self._decrementPreload(); - }, - function (err) { - // Error handling - _main.default._friendlyFileLoadError(1, arguments[0]); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }, - ); - return ret; - }; - /** - * This method is suitable for fetching files up to size of 64MB. - * @method loadBytes - * @param {string} file name of the file or URL to load - * @param {function} [callback] function to be executed after loadBytes() - * completes - * @param {function} [errorCallback] function to be executed if there - * is an error - * @returns {Object} an object whose 'bytes' property will be the loaded buffer - * - * @example - *
                                  - * let data; - * - * function preload() { - * data = loadBytes('assets/mammals.xml'); - * } - * - * function setup() { - * for (let i = 0; i < 5; i++) { - * console.log(data.bytes[i].toString(16)); - * } - * describe('no image displayed'); - * } - *
                                  - */ - _main.default.prototype.loadBytes = function ( - file, - callback, - errorCallback, - ) { - var ret = {}; - var self = this; - this.httpDo( - file, - "GET", - "arrayBuffer", - function (arrayBuffer) { - ret.bytes = new Uint8Array(arrayBuffer); - if (typeof callback === "function") { - callback(ret); - } - self._decrementPreload(); - }, - function (err) { - // Error handling - _main.default._friendlyFileLoadError(6, file); - if (errorCallback) { - errorCallback(err); - } else { - throw err; - } - }, - ); - return ret; - }; - /** - * Method for executing an HTTP GET request. If data type is not specified, - * p5 will try to guess based on the URL, defaulting to text. This is equivalent to - * calling httpDo(path, 'GET'). The 'binary' datatype will return - * a Blob object, and the 'arrayBuffer' datatype will return an ArrayBuffer - * which can be used to initialize typed arrays (such as Uint8Array). + function setPixel(imageInfo, r, g, b, a) { + var imageData = imageInfo.imageData; + var pixels = imageData.data; + var index = imageInfo.index++ * 4; + pixels[index++] = r; + pixels[index++] = g; + pixels[index++] = b; + pixels[index++] = a; + } + var SQRT3 = Math.sqrt(3); + /** + * @private + * @class FontInfo + * @param {Object} font an opentype.js font object * - * @method httpGet - * @param {String} path name of the file or url to load - * @param {String} [datatype] "json", "jsonp", "binary", "arrayBuffer", - * "xml", or "text" - * @param {Object|Boolean} [data] param data passed sent with request - * @param {function} [callback] function to be executed after - * httpGet() completes, data is passed in - * as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Promise} A promise that resolves with the data when the operation - * completes successfully or rejects with the error after - * one occurs. - * @example - *
                                  - * // Examples use USGS Earthquake API: - * // https://earthquake.usgs.gov/fdsnws/event/1/#methods - * let earthquakes; - * function preload() { - * // Get the most recent earthquake in the database - * let url = - 'https://earthquake.usgs.gov/fdsnws/event/1/query?' + - * 'format=geojson&limit=1&orderby=time'; - * httpGet(url, 'jsonp', false, function(response) { - * // when the HTTP request completes, populate the variable that holds the - * // earthquake data used in the visualization. - * earthquakes = response; - * }); - * } + * contains cached images and glyph information for an opentype font + */ + var FontInfo = /*#__PURE__*/ function () { + function FontInfo(font) { + _classCallCheck(this, FontInfo); + this.font = font; + // the bezier curve coordinates + this.strokeImageInfos = new ImageInfos(strokeImageWidth, strokeImageHeight); + // lists of curve indices for each row/column slice + this.colDimImageInfos = new ImageInfos(gridImageWidth, gridImageHeight); + this.rowDimImageInfos = new ImageInfos(gridImageWidth, gridImageHeight); + // the offset & length of each row/col slice in the glyph + this.colCellImageInfos = new ImageInfos(cellImageWidth, cellImageHeight); + this.rowCellImageInfos = new ImageInfos(cellImageWidth, cellImageHeight); + // the cached information for each glyph + this.glyphInfos = { + }; + } /** + * @method getGlyphInfo + * @param {Glyph} glyph the x positions of points in the curve + * @returns {Object} the glyphInfo for that glyph + * + * calculates rendering info for a glyph, including the curve information, + * row & column stripes compiled into textures. + */ + + _createClass(FontInfo, [ + { + key: 'getGlyphInfo', + value: function getGlyphInfo(glyph) { + // check the cache + var gi = this.glyphInfos[glyph.index]; + if (gi) return gi; + // get the bounding box of the glyph from opentype.js + var bb = glyph.getBoundingBox(); + var xMin = bb.x1; + var yMin = bb.y1; + var gWidth = bb.x2 - xMin; + var gHeight = bb.y2 - yMin; + var cmds = glyph.path.commands; + // don't bother rendering invisible glyphs + if (gWidth === 0 || gHeight === 0 || !cmds.length) { + return this.glyphInfos[glyph.index] = { + }; + } + var i; + var strokes = [ + ]; // the strokes in this glyph + var rows = [ + ]; // the indices of strokes in each row + var cols = [ + ]; // the indices of strokes in each column + for (i = charGridWidth - 1; i >= 0; --i) { + cols.push([]); + } + for (i = charGridHeight - 1; i >= 0; --i) { + rows.push([]); + } /** + * @function push + * @param {Number[]} xs the x positions of points in the curve + * @param {Number[]} ys the y positions of points in the curve + * @param {Object} v the curve information + * + * adds a curve to the rows & columns that it intersects with + */ + + function push(xs, ys, v) { + var index = strokes.length; // the index of this stroke + strokes.push(v); // add this stroke to the list + /** + * @function minMax + * @param {Number[]} rg the list of values to compare + * @param {Number} min the initial minimum value + * @param {Number} max the initial maximum value + * + * find the minimum & maximum value in a list of values + */ + function minMax(rg, min, max) { + for (var _i = rg.length; _i-- > 0; ) { + var _v = rg[_i]; + if (min > _v) min = _v; + if (max < _v) max = _v; + } + return { + min: min, + max: max + }; + } // Expand the bounding box of the glyph by the number of cells below + // before rounding. Curves only partially through a cell won't be added + // to adjacent cells, but ones that are close will be. This helps fix + // small visual glitches that occur when curves are close to grid cell + // boundaries. + + var cellOffset = 0.5; + // loop through the rows & columns that the curve intersects + // adding the curve to those slices + var mmX = minMax(xs, 1, 0); + var ixMin = Math.max(Math.floor(mmX.min * charGridWidth - cellOffset), 0); + var ixMax = Math.min(Math.ceil(mmX.max * charGridWidth + cellOffset), charGridWidth); + for (var iCol = ixMin; iCol < ixMax; ++iCol) { + cols[iCol].push(index); + } + var mmY = minMax(ys, 1, 0); + var iyMin = Math.max(Math.floor(mmY.min * charGridHeight - cellOffset), 0); + var iyMax = Math.min(Math.ceil(mmY.max * charGridHeight + cellOffset), charGridHeight); + for (var iRow = iyMin; iRow < iyMax; ++iRow) { + rows[iRow].push(index); + } + } /** + * @function clamp + * @param {Number} v the value to clamp + * @param {Number} min the minimum value + * @param {Number} max the maxmimum value + * + * clamps a value between a minimum & maximum value + */ + + function clamp(v, min, max) { + if (v < min) return min; + if (v > max) return max; + return v; + } /** + * @function byte + * @param {Number} v the value to scale + * + * converts a floating-point number in the range 0-1 to a byte 0-255 + */ + + function byte(v) { + return clamp(255 * v, 0, 255); + } /** + * @private + * @class Cubic + * @param {Number} p0 the start point of the curve + * @param {Number} c0 the first control point + * @param {Number} c1 the second control point + * @param {Number} p1 the end point + * + * a cubic curve + */ + + var Cubic = /*#__PURE__*/ function () { + function Cubic(p0, c0, c1, p1) { + _classCallCheck(this, Cubic); + this.p0 = p0; + this.c0 = c0; + this.c1 = c1; + this.p1 = p1; + } /** + * @method toQuadratic + * @return {Object} the quadratic approximation + * + * converts the cubic to a quadtratic approximation by + * picking an appropriate quadratic control point + */ + + _createClass(Cubic, [ + { + key: 'toQuadratic', + value: function toQuadratic() { + return { + x: this.p0.x, + y: this.p0.y, + x1: this.p1.x, + y1: this.p1.y, + cx: ((this.c0.x + this.c1.x) * 3 - (this.p0.x + this.p1.x)) / 4, + cy: ((this.c0.y + this.c1.y) * 3 - (this.p0.y + this.p1.y)) / 4 + }; + } /** + * @method quadError + * @return {Number} the error + * + * calculates the magnitude of error of this curve's + * quadratic approximation. + */ + + }, + { + key: 'quadError', + value: function quadError() { + return _main.default.Vector.sub(_main.default.Vector.sub(this.p1, this.p0), _main.default.Vector.mult(_main.default.Vector.sub(this.c1, this.c0), 3)).mag() / 2; + } /** + * @method split + * @param {Number} t the value (0-1) at which to split + * @return {Cubic} the second part of the curve + * + * splits the cubic into two parts at a point 't' along the curve. + * this cubic keeps its start point and its end point becomes the + * point at 't'. the 'end half is returned. + */ + + }, + { + key: 'split', + value: function split(t) { + var m1 = _main.default.Vector.lerp(this.p0, this.c0, t); + var m2 = _main.default.Vector.lerp(this.c0, this.c1, t); + var mm1 = _main.default.Vector.lerp(m1, m2, t); + this.c1 = _main.default.Vector.lerp(this.c1, this.p1, t); + this.c0 = _main.default.Vector.lerp(m2, this.c1, t); + var pt = _main.default.Vector.lerp(mm1, this.c0, t); + var part1 = new Cubic(this.p0, m1, mm1, pt); + this.p0 = pt; + return part1; + } /** + * @method splitInflections + * @return {Cubic[]} the non-inflecting pieces of this cubic + * + * returns an array containing 0, 1 or 2 cubics split resulting + * from splitting this cubic at its inflection points. + * this cubic is (potentially) altered and returned in the list. + */ + + }, + { + key: 'splitInflections', + value: function splitInflections() { + var a = _main.default.Vector.sub(this.c0, this.p0); + var b = _main.default.Vector.sub(_main.default.Vector.sub(this.c1, this.c0), a); + var c = _main.default.Vector.sub(_main.default.Vector.sub(_main.default.Vector.sub(this.p1, this.c1), a), _main.default.Vector.mult(b, 2)); + var cubics = [ + ]; + // find the derivative coefficients + var A = b.x * c.y - b.y * c.x; + if (A !== 0) { + var B = a.x * c.y - a.y * c.x; + var C = a.x * b.y - a.y * b.x; + var disc = B * B - 4 * A * C; + if (disc >= 0) { + if (A < 0) { + A = - A; + B = - B; + C = - C; + } + var Q = Math.sqrt(disc); + var t0 = ( - B - Q) / (2 * A); // the first inflection point + var t1 = ( - B + Q) / (2 * A); // the second inflection point + // test if the first inflection point lies on the curve + if (t0 > 0 && t0 < 1) { + // split at the first inflection point + cubics.push(this.split(t0)); + // scale t2 into the second part + t1 = 1 - (1 - t1) / (1 - t0); + } // test if the second inflection point lies on the curve + + if (t1 > 0 && t1 < 1) { + // split at the second inflection point + cubics.push(this.split(t1)); + } + } + } + cubics.push(this); + return cubics; + } + } + ]); + return Cubic; + }(); + /** + * @function cubicToQuadratics + * @param {Number} x0 + * @param {Number} y0 + * @param {Number} cx0 + * @param {Number} cy0 + * @param {Number} cx1 + * @param {Number} cy1 + * @param {Number} x1 + * @param {Number} y1 + * @returns {Cubic[]} an array of cubics whose quadratic approximations + * closely match the civen cubic. + * + * converts a cubic curve to a list of quadratics. + */ + function cubicToQuadratics(x0, y0, cx0, cy0, cx1, cy1, x1, y1) { + // create the Cubic object and split it at its inflections + var cubics = new Cubic(new _main.default.Vector(x0, y0), new _main.default.Vector(cx0, cy0), new _main.default.Vector(cx1, cy1), new _main.default.Vector(x1, y1)).splitInflections(); + var qs = [ + ]; // the final list of quadratics + var precision = 30 / SQRT3; + // for each of the non-inflected pieces of the original cubic + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + try { + for (var _iterator = cubics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var cubic = _step.value; + // the cubic is iteratively split in 3 pieces: + // the first piece is accumulated in 'qs', the result. + // the last piece is accumulated in 'tail', temporarily. + // the middle piece is repeatedly split again, while necessary. + var tail = [ + ]; + var t3 = void 0; + for (; ; ) { + // calculate this cubic's precision + t3 = precision / cubic.quadError(); + if (t3 >= 0.5 * 0.5 * 0.5) { + break; // not too bad, we're done + } // find a split point based on the error + + var t = Math.pow(t3, 1 / 3); + // split the cubic in 3 + var start = cubic.split(t); + var middle = cubic.split(1 - t / (1 - t)); + qs.push(start); // the first part + tail.push(cubic); // the last part + cubic = middle; // iterate on the middle piece + } + if (t3 < 1) { + // a little excess error, split the middle in two + qs.push(cubic.split(0.5)); + } // add the middle piece to the result + + qs.push(cubic); + // finally add the tail, reversed, onto the result + Array.prototype.push.apply(qs, tail.reverse()); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return qs; + } /** + * @function pushLine + * @param {Number} x0 + * @param {Number} y0 + * @param {Number} x1 + * @param {Number} y1 + * + * add a straight line to the row/col grid of a glyph + */ + + function pushLine(x0, y0, x1, y1) { + var mx = (x0 + x1) / 2; + var my = (y0 + y1) / 2; + push([x0, + x1], [ + y0, + y1 + ], { + x: x0, + y: y0, + cx: mx, + cy: my + }); + } /** + * @function samePoint + * @param {Number} x0 + * @param {Number} y0 + * @param {Number} x1 + * @param {Number} y1 + * @return {Boolean} true if the two points are sufficiently close + * + * tests if two points are close enough to be considered the same + */ + + function samePoint(x0, y0, x1, y1) { + return Math.abs(x1 - x0) < 0.00001 && Math.abs(y1 - y0) < 0.00001; + } + var x0, + y0, + xs, + ys; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + try { + for (var _iterator2 = cmds[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var cmd = _step2.value; + // scale the coordinates to the range 0-1 + var x1 = (cmd.x - xMin) / gWidth; + var y1 = (cmd.y - yMin) / gHeight; + // don't bother if this point is the same as the last + if (samePoint(x0, y0, x1, y1)) continue; + switch (cmd.type) { + case 'M': + { + // move + xs = x1; + ys = y1; + break; + } + case 'L': + { + // line + pushLine(x0, y0, x1, y1); + break; + } + case 'Q': + { + // quadratic + var cx = (cmd.x1 - xMin) / gWidth; + var cy = (cmd.y1 - yMin) / gHeight; + push([x0, + x1, + cx], [ + y0, + y1, + cy + ], { + x: x0, + y: y0, + cx: cx, + cy: cy + }); + break; + } + case 'Z': + { + // end + if (!samePoint(x0, y0, xs, ys)) { + // add an extra line closing the loop, if necessary + pushLine(x0, y0, xs, ys); + strokes.push({ + x: xs, + y: ys + }); + } else { + strokes.push({ + x: x0, + y: y0 + }); + } + break; + } + case 'C': + { + // cubic + var cx1 = (cmd.x1 - xMin) / gWidth; + var cy1 = (cmd.y1 - yMin) / gHeight; + var cx2 = (cmd.x2 - xMin) / gWidth; + var cy2 = (cmd.y2 - yMin) / gHeight; + var qs = cubicToQuadratics(x0, y0, cx1, cy1, cx2, cy2, x1, y1); + for (var iq = 0; iq < qs.length; iq++) { + var q = qs[iq].toQuadratic(); + push([q.x, + q.x1, + q.cx], [ + q.y, + q.y1, + q.cy + ], q); + } + break; + } + default: + throw new Error('unknown command type: '.concat(cmd.type)); + } + x0 = x1; + y0 = y1; + } // allocate space for the strokes + + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + var strokeCount = strokes.length; + var strokeImageInfo = this.strokeImageInfos.findImage(strokeCount); + var strokeOffset = strokeImageInfo.index; + // fill the stroke image + for (var il = 0; il < strokeCount; ++il) { + var s = strokes[il]; + setPixel(strokeImageInfo, byte(s.x), byte(s.y), byte(s.cx), byte(s.cy)); + } /** + * @function layout + * @param {Number[][]} dim + * @param {ImageInfo[]} dimImageInfos + * @param {ImageInfo[]} cellImageInfos + * @return {Object} + * + * lays out the curves in a dimension (row or col) into two + * images, one for the indices of the curves themselves, and + * one containing the offset and length of those index spans. + */ + + function layout(dim, dimImageInfos, cellImageInfos) { + var dimLength = dim.length; // the number of slices in this dimension + var dimImageInfo = dimImageInfos.findImage(dimLength); + var dimOffset = dimImageInfo.index; + // calculate the total number of stroke indices in this dimension + var totalStrokes = 0; + for (var id = 0; id < dimLength; ++id) { + totalStrokes += dim[id].length; + } // allocate space for the stroke indices + + var cellImageInfo = cellImageInfos.findImage(totalStrokes); + // for each slice in the glyph + for (var _i2 = 0; _i2 < dimLength; ++_i2) { + var strokeIndices = dim[_i2]; + var _strokeCount = strokeIndices.length; + var cellLineIndex = cellImageInfo.index; + // write the offset and count into the glyph slice image + setPixel(dimImageInfo, cellLineIndex >> 7, cellLineIndex & 127, _strokeCount >> 7, _strokeCount & 127); + // for each stroke index in that slice + for (var iil = 0; iil < _strokeCount; ++iil) { + // write the stroke index into the slice's image + var strokeIndex = strokeIndices[iil] + strokeOffset; + setPixel(cellImageInfo, strokeIndex >> 7, strokeIndex & 127, 0, 0); + } + } + return { + cellImageInfo: cellImageInfo, + dimOffset: dimOffset, + dimImageInfo: dimImageInfo + }; + } // initialize the info for this glyph + + gi = this.glyphInfos[glyph.index] = { + glyph: glyph, + uGlyphRect: [ + bb.x1, + - bb.y1, + bb.x2, + - bb.y2 + ], + strokeImageInfo: strokeImageInfo, + strokes: strokes, + colInfo: layout(cols, this.colDimImageInfos, this.colCellImageInfos), + rowInfo: layout(rows, this.rowDimImageInfos, this.rowCellImageInfos) + }; + gi.uGridOffset = [ + gi.colInfo.dimOffset, + gi.rowInfo.dimOffset + ]; + return gi; + } + } + ]); + return FontInfo; + }(); + _main.default.RendererGL.prototype._renderText = function (p, line, x, y, maxY) { + if (!this._textFont || typeof this._textFont === 'string') { + console.log('WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.'); + return; + } + if (y >= maxY || !this._doFill) { + return; // don't render lines beyond our maxY position + } + if (!this._isOpenType()) { + console.log('WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported'); + return p; + } + p.push(); // fix to #803 + // remember this state, so it can be restored later + var doStroke = this._doStroke; + var drawMode = this.drawMode; + this._doStroke = false; + this.drawMode = constants.TEXTURE; + // get the cached FontInfo object + var font = this._textFont.font; + var fontInfo = this._textFont._fontInfo; + if (!fontInfo) { + fontInfo = this._textFont._fontInfo = new FontInfo(font); + } // calculate the alignment and move/scale the view accordingly + + var pos = this._textFont._handleAlignment(this, line, x, y); + var fontSize = this._textSize; + var scale = fontSize / font.unitsPerEm; + this.translate(pos.x, pos.y, 0); + this.scale(scale, scale, 1); + // initialize the font shader + var gl = this.GL; + var initializeShader = !this._defaultFontShader; + var sh = this._getFontShader(); + sh.init(); + sh.bindShader(); // first time around, bind the shader fully + if (initializeShader) { + // these are constants, really. just initialize them one-time. + sh.setUniform('uGridImageSize', [ + gridImageWidth, + gridImageHeight + ]); + sh.setUniform('uCellsImageSize', [ + cellImageWidth, + cellImageHeight + ]); + sh.setUniform('uStrokeImageSize', [ + strokeImageWidth, + strokeImageHeight + ]); + sh.setUniform('uGridSize', [ + charGridWidth, + charGridHeight + ]); + } + this._applyColorBlend(this.curFillColor); + var g = this.retainedMode.geometry['glyph']; + if (!g) { + // create the geometry for rendering a quad + var geom = this._textGeom = new _main.default.Geometry(1, 1, function () { + for (var i = 0; i <= 1; i++) { + for (var j = 0; j <= 1; j++) { + this.vertices.push(new _main.default.Vector(j, i, 0)); + this.uvs.push(j, i); + } + } + }); + geom.computeFaces().computeNormals(); + g = this.createBuffers('glyph', geom); + } // bind the shader buffers + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + try { + for (var _iterator3 = this.retainedMode.buffers.text[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var buff = _step3.value; + buff._prepareBuffer(g, sh); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + this._bindBuffer(g.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); + // this will have to do for now... + sh.setUniform('uMaterialColor', this.curFillColor); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + try { + var dx = 0; // the x position in the line + var glyphPrev = null; // the previous glyph, used for kerning + // fetch the glyphs in the line of text + var glyphs = font.stringToGlyphs(line); + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + try { + for (var _iterator4 = glyphs[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var glyph = _step4.value; + // kern + if (glyphPrev) dx += font.getKerningValue(glyphPrev, glyph); + var gi = fontInfo.getGlyphInfo(glyph); + if (gi.uGlyphRect) { + var rowInfo = gi.rowInfo; + var colInfo = gi.colInfo; + sh.setUniform('uSamplerStrokes', gi.strokeImageInfo.imageData); + sh.setUniform('uSamplerRowStrokes', rowInfo.cellImageInfo.imageData); + sh.setUniform('uSamplerRows', rowInfo.dimImageInfo.imageData); + sh.setUniform('uSamplerColStrokes', colInfo.cellImageInfo.imageData); + sh.setUniform('uSamplerCols', colInfo.dimImageInfo.imageData); + sh.setUniform('uGridOffset', gi.uGridOffset); + sh.setUniform('uGlyphRect', gi.uGlyphRect); + sh.setUniform('uGlyphOffset', dx); + sh.bindTextures(); // afterwards, only textures need updating + // draw it + gl.drawElements(gl.TRIANGLES, 6, this.GL.UNSIGNED_SHORT, 0); + } + dx += glyph.advanceWidth; + glyphPrev = glyph; + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } finally { + // clean up + sh.unbindShader(); + this._doStroke = doStroke; + this.drawMode = drawMode; + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); + p.pop(); + } + return p; + }; + }, + { + '../core/constants': 286, + '../core/main': 298, + './p5.RendererGL.Retained': 354, + './p5.Shader': 356, + 'core-js/modules/es.array.iterator': 179, + 'core-js/modules/es.object.get-own-property-descriptor': 196, + 'core-js/modules/es.object.to-string': 200, + 'core-js/modules/es.regexp.exec': 205, + 'core-js/modules/es.string.iterator': 210, + 'core-js/modules/es.string.split': 216, + 'core-js/modules/es.string.sub': 218, + 'core-js/modules/es.symbol': 222, + 'core-js/modules/es.symbol.description': 220, + 'core-js/modules/es.symbol.iterator': 221, + 'core-js/modules/es.weak-map': 254, + 'core-js/modules/web.dom-collections.iterator': 256 + } + ], + 359: [ + function (_dereq_, module, exports) { + module.exports = { + 'fes': { + 'autoplay': 'The media that tried to play (with \'{{src}}\') wasn\'t allowed to by this browser, most likely due to the browser\'s autoplay policy.\n\n+ More info: {{url}}', + 'checkUserDefinedFns': 'It seems that you may have accidentally written {{name}} instead of {{actualName}}. Please correct it if it\'s not intentional.', + 'fileLoadError': { + 'bytes': 'It looks like there was a problem loading your file. {{suggestion}}', + 'font': 'It looks like there was a problem loading your font. {{suggestion}}', + 'gif': 'There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.', + 'image': 'It looks like there was a problem loading your image. {{suggestion}}', + 'json': 'It looks like there was a problem loading your JSON file. {{suggestion}}', + 'large': 'If your large file isn\'t fetched successfully, we recommend splitting the file into smaller segments and fetching those.', + 'strings': 'It looks like there was a problem loading your text file. {{suggestion}}', + 'suggestion': 'Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server.\n\n+ More info: {{url}}', + 'table': 'It looks like there was a problem loading your table file. {{suggestion}}', + 'xml': 'It looks like there was a problem loading your XML file. {{suggestion}}' + }, + 'friendlyParamError': { + 'type_EMPTY_VAR': '{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received an empty variable instead. If not intentional, this is often a problem with scope.\n\n+ More info: {{url}}', + 'type_TOO_FEW_ARGUMENTS': '{{location}} {{func}}() was expecting at least {{minParams}} arguments, but received only {{argCount}}.', + 'type_TOO_MANY_ARGUMENTS': '{{location}} {{func}}() was expecting no more than {{maxParams}} arguments, but received {{argCount}}.', + 'type_WRONG_TYPE': '{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received {{argType}} instead.' + }, + 'globalErrors': { + 'reference': { + 'cannotAccess': '\n{{location}} "{{symbol}}" is used before declaration. Make sure you have declared the variable before using it.\n\n+ More info: {{url}}', + 'notDefined': '\n{{location}} "{{symbol}}" is not defined in the current scope. If you have defined it in your code, you should check its scope, spelling, and letter-casing (JavaScript is case-sensitive).\n\n+ More info: {{url}}' + }, + 'stackSubseq': '└[{{location}}] \n\t Called from line {{line}} in {{func}}()\n', + 'stackTop': '┌[{{location}}] \n\t Error at line {{line}} in {{func}}()\n', + 'syntax': { + 'badReturnOrYield': '\nSyntax Error - return lies outside of a function. Make sure you’re not missing any brackets, so that return lies inside a function.\n\n+ More info: {{url}}', + 'invalidToken': '\nSyntax Error - Found a symbol that JavaScript doesn\'t recognize or didn\'t expect at it\'s place.\n\n+ More info: {{url}}', + 'missingInitializer': '\nSyntax Error - A const variable is declared but not initialized. In JavaScript, an initializer for a const is required. A value must be specified in the same statement in which the variable is declared. Check the line number in the error and assign the const variable a value.\n\n+ More info: {{url}}', + 'redeclaredVariable': '\nSyntax Error - "{{symbol}}" is being redeclared. JavaScript doesn\'t allow declaring a variable more than once. Check the line number in error for redeclaration of the variable.\n\n+ More info: {{url}}', + 'unexpectedToken': '\nSyntax Error - Symbol present at a place that wasn\'t expected.\nUsually this is due to a typo. Check the line number in the error for anything missing/extra.\n\n+ More info: {{url}}' + }, + 'type': { + 'constAssign': '\n{{location}} A const variable is being re-assigned. In javascript, re-assigning a value to a constant is not allowed. If you want to re-assign new values to a variable, make sure it is declared as var or let.\n\n+ More info: {{url}}', + 'notfunc': '\n{{location}} "{{symbol}}" could not be called as a function.\nCheck the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', + 'notfuncObj': '\n{{location}} "{{symbol}}" could not be called as a function.\nVerify whether "{{obj}}" has "{{symbol}}" in it and check the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', + 'readFromNull': '\n{{location}} The property of null can\'t be read. In javascript the value null indicates that an object has no value.\n\n+ More info: {{url}}', + 'readFromUndefined': '\n{{location}} Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated is not undefined.\n\n + More info: {{url}}' + } + }, + 'libraryError': '{{location}} An error with message "{{error}}" occurred inside the p5js library when {{func}} was called. If not stated otherwise, it might be an issue with the arguments passed to {{func}}.', + 'location': '[{{file}}, line {{line}}]', + 'misspelling': '{{location}} It seems that you may have accidentally written "{{name}}" instead of "{{actualName}}". Please correct it to {{actualName}} if you wish to use the {{type}} from p5.js.', + 'misspelling_plural': '{{location}} It seems that you may have accidentally written "{{name}}".\nYou may have meant one of the following: \n{{suggestions}}', + 'misusedTopLevel': 'Did you just try to use p5.js\'s {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch\'s setup() function.\n\n+ More info: {{url}}', + 'positions': { + 'p_1': 'first', + 'p_10': 'tenth', + 'p_11': 'eleventh', + 'p_12': 'twelfth', + 'p_2': 'second', + 'p_3': 'third', + 'p_4': 'fourth', + 'p_5': 'fifth', + 'p_6': 'sixth', + 'p_7': 'seventh', + 'p_8': 'eighth', + 'p_9': 'ninth' + }, + 'pre': '\n🌸 p5.js says: {{message}}', + 'sketchReaderErrors': { + 'reservedConst': 'you have used a p5.js reserved variable "{{symbol}}" make sure you change the variable name to something else.\n\n+ More info: {{url}}', + 'reservedFunc': 'you have used a p5.js reserved function "{{symbol}}" make sure you change the function name to something else.\n\n+ More info: {{url}}' + }, + 'welcome': 'Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js.', + 'wrongPreload': '{{location}} An error with message "{{error}}" occurred inside the p5js library when "{{func}}" was called. If not stated otherwise, it might be due to "{{func}}" being called from preload. Nothing besides load calls (loadImage, loadJSON, loadFont, loadStrings, etc.) should be inside the preload function.' + } + } + }, + { + } + ], + 360: [ + function (_dereq_, module, exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true + }); + exports.languages = exports.default = void 0; + var _translation = _interopRequireDefault(_dereq_('./en/translation')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: + obj + }; + } // Only one language is imported above. This is intentional as other languages + // will be hosted online and then downloaded whenever needed + /** + * Here, we define a default/fallback language which we can use without internet. + * You won't have to change this when adding a new language. * - * function draw() { - * if (!earthquakes) { - * // Wait until the earthquake data has loaded before drawing. - * return; - * } - * background(200); - * // Get the magnitude and name of the earthquake out of the loaded JSON - * let earthquakeMag = earthquakes.features[0].properties.mag; - * let earthquakeName = earthquakes.features[0].properties.place; - * ellipse(width / 2, height / 2, earthquakeMag * 10, earthquakeMag * 10); - * textAlign(CENTER); - * text(earthquakeName, 0, height - 30, width, 30); - * noLoop(); - * } - *
                                  + * `translation` is the namespace we are using for our initial set of strings + */ + + var _default = { + en: { + translation: _translation.default + } + }; + /** + * This is a list of languages that we have added so far. + * If you have just added a new language (yay!), add its key to the list below + * (`en` is english, `es` es español). Also add its export to + * dev.js, which is another file in this folder. */ - /** - * @method httpGet - * @param {String} path - * @param {Object|Boolean} data - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Promise} - */ - /** - * @method httpGet - * @param {String} path - * @param {function} callback - * @param {function} [errorCallback] - * @return {Promise} - */ - _main.default.prototype.httpGet = function () { - _main.default._validateParameters("httpGet", arguments); - var args = Array.prototype.slice.call(arguments); - args.splice(1, 0, "GET"); - return _main.default.prototype.httpDo.apply(this, args); - }; - /** - * Method for executing an HTTP POST request. If data type is not specified, - * p5 will try to guess based on the URL, defaulting to text. This is equivalent to - * calling httpDo(path, 'POST'). - * - * @method httpPost - * @param {String} path name of the file or url to load - * @param {String} [datatype] "json", "jsonp", "xml", or "text". - * If omitted, httpPost() will guess. - * @param {Object|Boolean} [data] param data passed sent with request - * @param {function} [callback] function to be executed after - * httpPost() completes, data is passed in - * as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Promise} A promise that resolves with the data when the operation - * completes successfully or rejects with the error after - * one occurs. - * - * @example - *
                                  - * - * // Examples use jsonplaceholder.typicode.com for a Mock Data API - * - * let url = 'https://jsonplaceholder.typicode.com/posts'; - * let postData = { userId: 1, title: 'p5 Clicked!', body: 'p5.js is very cool.' }; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * } - * - * function mousePressed() { - * httpPost(url, 'json', postData, function(result) { - * strokeWeight(2); - * text(result.body, mouseX, mouseY); - * }); - * } - * - *
                                  - * - *
                                  - * let url = 'ttps://invalidURL'; // A bad URL that will cause errors - * let postData = { title: 'p5 Clicked!', body: 'p5.js is very cool.' }; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * } - * - * function mousePressed() { - * httpPost( - * url, - * 'json', - * postData, - * function(result) { - * // ... won't be called - * }, - * function(error) { - * strokeWeight(2); - * text(error.toString(), mouseX, mouseY); - * } - * ); - * } - *
                                  - */ - /** - * @method httpPost - * @param {String} path - * @param {Object|Boolean} data - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Promise} - */ - /** - * @method httpPost - * @param {String} path - * @param {function} callback - * @param {function} [errorCallback] - * @return {Promise} - */ - _main.default.prototype.httpPost = function () { - _main.default._validateParameters("httpPost", arguments); - var args = Array.prototype.slice.call(arguments); - args.splice(1, 0, "POST"); - return _main.default.prototype.httpDo.apply(this, args); - }; - /** - * Method for executing an HTTP request. If data type is not specified, - * p5 will try to guess based on the URL, defaulting to text.

                                  - * For more advanced use, you may also pass in the path as the first argument - * and a object as the second argument, the signature follows the one specified - * in the Fetch API specification. - * This method is suitable for fetching files up to size of 64MB when "GET" is used. - * - * @method httpDo - * @param {String} path name of the file or url to load - * @param {String} [method] either "GET", "POST", or "PUT", - * defaults to "GET" - * @param {String} [datatype] "json", "jsonp", "xml", or "text" - * @param {Object} [data] param data passed sent with request - * @param {function} [callback] function to be executed after - * httpGet() completes, data is passed in - * as first argument - * @param {function} [errorCallback] function to be executed if - * there is an error, response is passed - * in as first argument - * @return {Promise} A promise that resolves with the data when the operation - * completes successfully or rejects with the error after - * one occurs. - * - * @example - *
                                  - * - * // Examples use USGS Earthquake API: - * // https://earthquake.usgs.gov/fdsnws/event/1/#methods - * - * // displays an animation of all USGS earthquakes - * let earthquakes; - * let eqFeatureIndex = 0; - * - * function preload() { - * let url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson'; - * httpDo( - * url, - * { - * method: 'GET', - * // Other Request options, like special headers for apis - * headers: { authorization: 'Bearer secretKey' } - * }, - * function(res) { - * earthquakes = res; - * } - * ); - * } - * - * function draw() { - * // wait until the data is loaded - * if (!earthquakes || !earthquakes.features[eqFeatureIndex]) { - * return; - * } - * clear(); - * - * let feature = earthquakes.features[eqFeatureIndex]; - * let mag = feature.properties.mag; - * let rad = mag / 11 * ((width + height) / 2); - * fill(255, 0, 0, 100); - * ellipse(width / 2 + random(-2, 2), height / 2 + random(-2, 2), rad, rad); - * - * if (eqFeatureIndex >= earthquakes.features.length) { - * eqFeatureIndex = 0; - * } else { - * eqFeatureIndex += 1; - * } - * } - * - *
                                  - */ - /** - * @method httpDo - * @param {String} path - * @param {Object} options Request object options as documented in the - * "fetch" API - * reference - * @param {function} [callback] - * @param {function} [errorCallback] - * @return {Promise} - */ - _main.default.prototype.httpDo = function () { - var type; - var callback; - var errorCallback; - var request; - var promise; - var jsonpOptions = {}; - var cbCount = 0; - var contentType = "text/plain"; - // Trim the callbacks off the end to get an idea of how many arguments are passed - for (var i = arguments.length - 1; i > 0; i--) { - if ( - typeof (i < 0 || arguments.length <= i - ? undefined - : arguments[i]) === "function" - ) { - cbCount++; - } else { - break; - } - } // The number of arguments minus callbacks - - var argsCount = arguments.length - cbCount; - var path = arguments.length <= 0 ? undefined : arguments[0]; - if ( - argsCount === 2 && - typeof path === "string" && - _typeof(arguments.length <= 1 ? undefined : arguments[1]) === - "object" - ) { - // Intended for more advanced use, pass in Request parameters directly - request = new Request( - path, - arguments.length <= 1 ? undefined : arguments[1], - ); - callback = arguments.length <= 2 ? undefined : arguments[2]; - errorCallback = arguments.length <= 3 ? undefined : arguments[3]; - } else { - // Provided with arguments - var method = "GET"; - var data; - for (var j = 1; j < arguments.length; j++) { - var a = - j < 0 || arguments.length <= j ? undefined : arguments[j]; - if (typeof a === "string") { - if ( - a === "GET" || - a === "POST" || - a === "PUT" || - a === "DELETE" - ) { - method = a; - } else if ( - a === "json" || - a === "jsonp" || - a === "binary" || - a === "arrayBuffer" || - a === "xml" || - a === "text" || - a === "table" - ) { - type = a; - } else { - data = a; - } - } else if (typeof a === "number") { - data = a.toString(); - } else if (_typeof(a) === "object") { - if ( - a.hasOwnProperty("jsonpCallback") || - a.hasOwnProperty("jsonpCallbackFunction") - ) { - for (var attr in a) { - jsonpOptions[attr] = a[attr]; - } - } else if (a instanceof _main.default.XML) { - data = a.serialize(); - contentType = "application/xml"; - } else { - data = JSON.stringify(a); - contentType = "application/json"; - } - } else if (typeof a === "function") { - if (!callback) { - callback = a; - } else { - errorCallback = a; - } - } - } - var headers = - method === "GET" - ? new Headers() - : new Headers({ - "Content-Type": contentType, - }); - request = new Request(path, { - method: method, - mode: "cors", - body: data, - headers: headers, - }); - } // do some sort of smart type checking - - if (!type) { - if (path.includes("json")) { - type = "json"; - } else if (path.includes("xml")) { - type = "xml"; - } else { - type = "text"; - } - } - if (type === "jsonp") { - promise = (0, _fetchJsonp.default)(path, jsonpOptions); - } else { - promise = fetch(request); - } - promise = promise.then(function (res) { - if (!res.ok) { - var err = new Error(res.body); - err.status = res.status; - err.ok = false; - throw err; - } else { - var fileSize = 0; - if (type !== "jsonp") { - fileSize = res.headers.get("content-length"); - } - if (fileSize && fileSize > 64000000) { - _main.default._friendlyFileLoadError(7, path); - } - switch (type) { - case "json": - case "jsonp": - return res.json(); - case "binary": - return res.blob(); - case "arrayBuffer": - return res.arrayBuffer(); - case "xml": - return res.text().then(function (text) { - var parser = new DOMParser(); - var xml = parser.parseFromString(text, "text/xml"); - return new _main.default.XML(xml.documentElement); - }); - default: - return res.text(); - } - } - }); - promise.then(callback || function () {}); - promise.catch(errorCallback || console.error); - return promise; - }; - /** - * @module IO - * @submodule Output - * @for p5 - */ - window.URL = window.URL || window.webkitURL; - // private array of p5.PrintWriter objects - _main.default.prototype._pWriters = []; - /** - * @method createWriter - * @param {String} name name of the file to be created - * @param {String} [extension] - * @return {p5.PrintWriter} - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * const writer = createWriter('squares.txt'); - * for (let i = 0; i < 10; i++) { - * writer.print(i * i); - * } - * writer.close(); - * writer.clear(); - * } - * } - * - *
                                  - */ - _main.default.prototype.createWriter = function (name, extension) { - var newPW; - // check that it doesn't already exist - for (var i in _main.default.prototype._pWriters) { - if (_main.default.prototype._pWriters[i].name === name) { - // if a p5.PrintWriter w/ this name already exists... - // return p5.prototype._pWriters[i]; // return it w/ contents intact. - // or, could return a new, empty one with a unique name: - newPW = new _main.default.PrintWriter( - name + this.millis(), - extension, - ); - _main.default.prototype._pWriters.push(newPW); - return newPW; - } - } - newPW = new _main.default.PrintWriter(name, extension); - _main.default.prototype._pWriters.push(newPW); - return newPW; - }; - /** - * @class p5.PrintWriter - * @param {String} filename - * @param {String} [extension] - */ - _main.default.PrintWriter = function (filename, extension) { - var self = this; - this.name = filename; - this.content = ""; - //Changed to write because it was being overloaded by function below. - /** - * Writes data to the PrintWriter stream - * @method write - * @param {Array} data all data to be written by the PrintWriter - * @example - *
                                  - * - * // creates a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // write 'Hello world!'' to the file - * writer.write(['Hello world!']); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                                  - *
                                  - * - * // creates a file called 'newFile2.txt' - * let writer = createWriter('newFile2.txt'); - * // write 'apples,bananas,123' to the file - * writer.write(['apples', 'bananas', 123]); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                                  - *
                                  - * - * // creates a file called 'newFile3.txt' - * let writer = createWriter('newFile3.txt'); - * // write 'My name is: Teddy' to the file - * writer.write('My name is:'); - * writer.write(' Teddy'); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                                  - *
                                  - * - * function setup() { - * createCanvas(100, 100); - * button = createButton('SAVE FILE'); - * button.position(21, 40); - * button.mousePressed(createFile); - * } - * - * function createFile() { - * // creates a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // write 'Hello world!'' to the file - * writer.write(['Hello world!']); - * // close the PrintWriter and save the file - * writer.close(); - * } - * - *
                                  - */ - this.write = function (data) { - this.content += data; - }; - /** - * Writes data to the PrintWriter stream, and adds a new line at the end - * @method print - * @param {Array} data all data to be printed by the PrintWriter - * @example - *
                                  - * - * // creates a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // creates a file containing - * // My name is: - * // Teddy - * writer.print('My name is:'); - * writer.print('Teddy'); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                                  - *
                                  - * - * let writer; - * - * function setup() { - * createCanvas(400, 400); - * // create a PrintWriter - * writer = createWriter('newFile.txt'); - * } - * - * function draw() { - * writer.print([mouseX, mouseY]); - * } - * - * function mouseClicked() { - * writer.close(); - * } - * - *
                                  - */ - this.print = function (data) { - this.content += "".concat(data, "\n"); - }; - /** - * Clears the data already written to the PrintWriter object - * @method clear - * @example - *
                                  - * // create writer object - * let writer = createWriter('newFile.txt'); - * writer.write(['clear me']); - * // clear writer object here - * writer.clear(); - * // close writer - * writer.close(); - *
                                  - *
                                  - * - * function setup() { - * button = createButton('CLEAR ME'); - * button.position(21, 40); - * button.mousePressed(createFile); - * } - * - * function createFile() { - * let writer = createWriter('newFile.txt'); - * writer.write(['clear me']); - * writer.clear(); - * writer.close(); - * } - * - *
                                  - * - */ - this.clear = function () { - this.content = ""; - }; - /** - * Closes the PrintWriter - * @method close - * @example - *
                                  - * - * // create a file called 'newFile.txt' - * let writer = createWriter('newFile.txt'); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                                  - *
                                  - * - * // create a file called 'newFile2.txt' - * let writer = createWriter('newFile2.txt'); - * // write some data to the file - * writer.write([100, 101, 102]); - * // close the PrintWriter and save the file - * writer.close(); - * - *
                                  - */ - this.close = function () { - // convert String to Array for the writeFile Blob - var arr = []; - arr.push(this.content); - _main.default.prototype.writeFile(arr, filename, extension); - // remove from _pWriters array and delete self - for (var i in _main.default.prototype._pWriters) { - if (_main.default.prototype._pWriters[i].name === this.name) { - // remove from _pWriters array - _main.default.prototype._pWriters.splice(i, 1); - } - } - self.clear(); - self = {}; - }; - }; - /** - * @module IO - * @submodule Output - * @for p5 - */ - // object, filename, options --> saveJSON, saveStrings, - // filename, [extension] [canvas] --> saveImage - /** - * Saves a given element(image, text, json, csv, wav, or html) to the client's - * computer. The first parameter can be a pointer to element we want to save. - * The element can be one of p5.Element,an Array of - * Strings, an Array of JSON, a JSON object, a p5.Table - * , a p5.Image, or a p5.SoundFile (requires - * p5.sound). The second parameter is a filename (including extension).The - * third parameter is for options specific to this type of object. This method - * will save a file that fits the given parameters. - * If it is called without specifying an element, by default it will save the - * whole canvas as an image file. You can optionally specify a filename as - * the first parameter in such a case. - * **Note that it is not recommended to - * call this method within draw, as it will open a new save dialog on every - * render.** - * - * @method save - * @param {Object|String} [objectOrFilename] If filename is provided, will - * save canvas as an image with - * either png or jpg extension - * depending on the filename. - * If object is provided, will - * save depending on the object - * and filename (see examples - * above). - * @param {String} [filename] If an object is provided as the first - * parameter, then the second parameter - * indicates the filename, - * and should include an appropriate - * file extension (see examples above). - * @param {Boolean|String} [options] Additional options depend on - * filetype. For example, when saving JSON, - * true indicates that the - * output will be optimized for filesize, - * rather than readability. - * - * @example - *
                                  - * // Saves the canvas as an image - * cnv = createCanvas(300, 300); - * save(cnv, 'myCanvas.jpg'); - * - * // Saves the canvas as an image by default - * save('myCanvas.jpg'); - * describe('An example for saving a canvas as an image.'); - *
                                  - * - *
                                  - * // Saves p5.Image as an image - * img = createImage(10, 10); - * save(img, 'myImage.png'); - * describe('An example for saving a p5.Image element as an image.'); - *
                                  - * - *
                                  - * // Saves p5.Renderer object as an image - * obj = createGraphics(100, 100); - * save(obj, 'myObject.png'); - * describe('An example for saving a p5.Renderer element.'); - *
                                  - * - *
                                  - * let myTable = new p5.Table(); - * // Saves table as html file - * save(myTable, 'myTable.html'); - * - * // Comma Separated Values - * save(myTable, 'myTable.csv'); - * - * // Tab Separated Values - * save(myTable, 'myTable.tsv'); - * - * describe(`An example showing how to save a table in formats of - * HTML, CSV and TSV.`); - *
                                  - * - *
                                  - * let myJSON = { a: 1, b: true }; - * - * // Saves pretty JSON - * save(myJSON, 'my.json'); - * - * // Optimizes JSON filesize - * save(myJSON, 'my.json', true); - * - * describe('An example for saving JSON to a txt file with some extra arguments.'); - *
                                  - * - *
                                  - * // Saves array of strings to text file with line breaks after each item - * let arrayOfStrings = ['a', 'b']; - * save(arrayOfStrings, 'my.txt'); - * describe(`An example for saving an array of strings to text file - * with line breaks.`); - *
                                  - */ - _main.default.prototype.save = function ( - object, - _filename, - _options, - ) { - // parse the arguments and figure out which things we are saving - var args = arguments; - // ================================================= - // OPTION 1: saveCanvas... - // if no arguments are provided, save canvas - var cnv = this._curElement ? this._curElement.elt : this.elt; - if (args.length === 0) { - _main.default.prototype.saveCanvas(cnv); - return; - } else if ( - args[0] instanceof _main.default.Renderer || - args[0] instanceof _main.default.Graphics - ) { - // otherwise, parse the arguments - // if first param is a p5Graphics, then saveCanvas - _main.default.prototype.saveCanvas(args[0].elt, args[1], args[2]); - return; - } else if (args.length === 1 && typeof args[0] === "string") { - // if 1st param is String and only one arg, assume it is canvas filename - _main.default.prototype.saveCanvas(cnv, args[0]); - } else { - // ================================================= - // OPTION 2: extension clarifies saveStrings vs. saveJSON - var extension = _checkFileExtension(args[1], args[2])[1]; - switch (extension) { - case "json": - _main.default.prototype.saveJSON(args[0], args[1], args[2]); - return; - case "txt": - _main.default.prototype.saveStrings( - args[0], - args[1], - args[2], - ); - return; - // ================================================= - // OPTION 3: decide based on object... - default: - if (args[0] instanceof Array) { - _main.default.prototype.saveStrings( - args[0], - args[1], - args[2], - ); - } else if (args[0] instanceof _main.default.Table) { - _main.default.prototype.saveTable( - args[0], - args[1], - args[2], - ); - } else if (args[0] instanceof _main.default.Image) { - _main.default.prototype.saveCanvas(args[0].canvas, args[1]); - } else if (args[0] instanceof _main.default.SoundFile) { - _main.default.prototype.saveSound( - args[0], - args[1], - args[2], - args[3], - ); - } - } - } - }; - /** - * Writes the contents of an Array or a JSON object to a .json file. - * The file saving process and location of the saved file will - * vary between web browsers. - * - * @method saveJSON - * @param {Array|Object} json - * @param {String} filename - * @param {Boolean} [optimize] If true, removes line breaks - * and spaces from the output - * file to optimize filesize - * (but not readability). - * @example - *
                                  - * let json = {}; // new JSON Object - * - * json.id = 0; - * json.species = 'Panthera leo'; - * json.name = 'Lion'; - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * describe('no image displayed'); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * saveJSON(json, 'lion.json'); - * } - * } - * - * // saves the following to a file called "lion.json": - * // { - * // "id": 0, - * // "species": "Panthera leo", - * // "name": "Lion" - * // } - *
                                  - */ - _main.default.prototype.saveJSON = function (json, filename, opt) { - _main.default._validateParameters("saveJSON", arguments); - var stringify; - if (opt) { - stringify = JSON.stringify(json); - } else { - stringify = JSON.stringify(json, undefined, 2); - } - this.saveStrings(stringify.split("\n"), filename, "json"); - }; - _main.default.prototype.saveJSONObject = - _main.default.prototype.saveJSON; - _main.default.prototype.saveJSONArray = - _main.default.prototype.saveJSON; - /** - * Writes an array of Strings to a text file, one line per String. - * The file saving process and location of the saved file will - * vary between web browsers. - * - * @method saveStrings - * @param {String[]} list string array to be written - * @param {String} filename filename for output - * @param {String} [extension] the filename's extension - * @param {Boolean} [isCRLF] if true, change line-break to CRLF - * @example - *
                                  - * let words = 'apple bear cat dog'; - * - * // .split() outputs an Array - * let list = split(words, ' '); - * - * function setup() { - * createCanvas(100, 100); - * background(200); - * text('click here to save', 10, 10, 70, 80); - * describe('no image displayed'); - * } - * - * function mousePressed() { - * if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) { - * saveStrings(list, 'nouns.txt'); - * } - * } - * - * // Saves the following to a file called 'nouns.txt': - * // - * // apple - * // bear - * // cat - * // dog - *
                                  - */ - _main.default.prototype.saveStrings = function ( - list, - filename, - extension, - isCRLF, - ) { - _main.default._validateParameters("saveStrings", arguments); - var ext = extension || "txt"; - var pWriter = this.createWriter(filename, ext); - for (var i = 0; i < list.length; i++) { - isCRLF - ? pWriter.write(list[i] + "\r\n") - : pWriter.write(list[i] + "\n"); - } - pWriter.close(); - pWriter.clear(); - }; - // ======= - // HELPERS - // ======= - function escapeHelper(content) { - return content - .replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); - } /** - * Writes the contents of a Table object to a file. Defaults to a - * text file with comma-separated-values ('csv') but can also - * use tab separation ('tsv'), or generate an HTML table ('html'). - * The file saving process and location of the saved file will - * vary between web browsers. - * - * @method saveTable - * @param {p5.Table} Table the Table object to save to a file - * @param {String} filename the filename to which the Table should be saved - * @param {String} [options] can be one of "tsv", "csv", or "html" - * @example - *
                                  - * let table; - * - * function setup() { - * table = new p5.Table(); - * - * table.addColumn('id'); - * table.addColumn('species'); - * table.addColumn('name'); - * - * let newRow = table.addRow(); - * newRow.setNum('id', table.getRowCount() - 1); - * newRow.setString('species', 'Panthera leo'); - * newRow.setString('name', 'Lion'); - * - * // To save, un-comment next line then click 'run' - * // saveTable(table, 'new.csv'); - * - * describe('no image displayed'); - * } - * - * // Saves the following to a file called 'new.csv': - * // id,species,name - * // 0,Panthera leo,Lion - *
                                  - */ - - _main.default.prototype.saveTable = function ( - table, - filename, - options, - ) { - _main.default._validateParameters("saveTable", arguments); - var ext; - if (options === undefined) { - ext = filename.substring( - filename.lastIndexOf(".") + 1, - filename.length, - ); - } else { - ext = options; - } - var pWriter = this.createWriter(filename, ext); - var header = table.columns; - var sep = ","; // default to CSV - if (ext === "tsv") { - sep = "\t"; - } - if (ext !== "html") { - // make header if it has values - if (header[0] !== "0") { - for (var h = 0; h < header.length; h++) { - if (h < header.length - 1) { - pWriter.write(header[h] + sep); - } else { - pWriter.write(header[h]); - } - } - pWriter.write("\n"); - } // make rows - - for (var i = 0; i < table.rows.length; i++) { - var j = void 0; - for (j = 0; j < table.rows[i].arr.length; j++) { - if (j < table.rows[i].arr.length - 1) { - //double quotes should be inserted in csv only if contains comma separated single value - if ( - ext === "csv" && - String(table.rows[i].arr[j]).includes(",") - ) { - pWriter.write('"' + table.rows[i].arr[j] + '"' + sep); - } else { - pWriter.write(table.rows[i].arr[j] + sep); - } - } else { - //double quotes should be inserted in csv only if contains comma separated single value - if ( - ext === "csv" && - String(table.rows[i].arr[j]).includes(",") - ) { - pWriter.write('"' + table.rows[i].arr[j] + '"'); - } else { - pWriter.write(table.rows[i].arr[j]); - } - } - } - pWriter.write("\n"); - } - } else { - // otherwise, make HTML - pWriter.print(""); - pWriter.print(""); - var str = ' "); - pWriter.print(""); - pWriter.print(" "); - // make header if it has values - if (header[0] !== "0") { - pWriter.print(" "); - for (var k = 0; k < header.length; k++) { - var e = escapeHelper(header[k]); - pWriter.print(" "); - } - pWriter.print(" "); - } // make rows - - for (var row = 0; row < table.rows.length; row++) { - pWriter.print(" "); - for (var col = 0; col < table.columns.length; col++) { - var entry = table.rows[row].getString(col); - var htmlEntry = escapeHelper(entry); - pWriter.print(" "); - } - pWriter.print(" "); - } - pWriter.print("
                                  ".concat(e)); - pWriter.print("
                                  ".concat(htmlEntry)); - pWriter.print("
                                  "); - pWriter.print(""); - pWriter.print(""); - } // close and clear the pWriter - - pWriter.close(); - pWriter.clear(); - }; // end saveTable() - /** - * Generate a blob of file data as a url to prepare for download. - * Accepts an array of data, a filename, and an extension (optional). - * This is a private function because it does not do any formatting, - * but it is used by saveStrings, saveJSON, saveTable etc. - * - * @param {Array} dataToDownload - * @param {String} filename - * @param {String} [extension] - * @private - */ - _main.default.prototype.writeFile = function ( - dataToDownload, - filename, - extension, - ) { - var type = "application/octet-stream"; - if (_main.default.prototype._isSafari()) { - type = "text/plain"; - } - var blob = new Blob(dataToDownload, { - type: type, - }); - _main.default.prototype.downloadFile(blob, filename, extension); - }; - /** - * Forces download. Accepts a url to filedata/blob, a filename, - * and an extension (optional). - * This is a private function because it does not do any formatting, - * but it is used by saveStrings, saveJSON, saveTable etc. - * - * @method downloadFile - * @private - * @param {String|Blob} data either an href generated by createObjectURL, - * or a Blob object containing the data - * @param {String} [filename] - * @param {String} [extension] - */ - _main.default.prototype.downloadFile = function ( - data, - fName, - extension, - ) { - var fx = _checkFileExtension(fName, extension); - var filename = fx[0]; - if (data instanceof Blob) { - _fileSaver.default.saveAs(data, filename); - return; - } - var a = document.createElement("a"); - a.href = data; - a.download = filename; - // Firefox requires the link to be added to the DOM before click() - a.onclick = function (e) { - destroyClickedElement(e); - e.stopPropagation(); - }; - a.style.display = "none"; - document.body.appendChild(a); - // Safari will open this file in the same page as a confusing Blob. - if (_main.default.prototype._isSafari()) { - var aText = "Hello, Safari user! To download this file...\n"; - aText += "1. Go to File --> Save As.\n"; - aText += '2. Choose "Page Source" as the Format.\n'; - aText += '3. Name it with this extension: ."'.concat(fx[1], '"'); - alert(aText); - } - a.click(); - }; - /** - * Returns a file extension, or another string - * if the provided parameter has no extension. - * - * @param {String} filename - * @param {String} [extension] - * @return {String[]} [fileName, fileExtension] - * - * @private - */ - function _checkFileExtension(filename, extension) { - if (!extension || extension === true || extension === "true") { - extension = ""; - } - if (!filename) { - filename = "untitled"; - } - var ext = ""; - // make sure the file will have a name, see if filename needs extension - if (filename && filename.includes(".")) { - ext = filename.split(".").pop(); - } // append extension if it doesn't exist - - if (extension) { - if (ext !== extension) { - ext = extension; - filename = "".concat(filename, ".").concat(ext); - } - } - return [filename, ext]; - } - _main.default.prototype._checkFileExtension = _checkFileExtension; - /** - * Returns true if the browser is Safari, false if not. - * Safari makes trouble for downloading files. - * - * @return {Boolean} [description] - * @private - */ - _main.default.prototype._isSafari = function () { - var x = Object.prototype.toString.call(window.HTMLElement); - return x.indexOf("Constructor") > 0; - }; - /** - * Helper function, a callback for download that deletes - * an invisible anchor element from the DOM once the file - * has been automatically downloaded. - * - * @private - */ - function destroyClickedElement(event) { - document.body.removeChild(event.target); - } - var _default = _main.default; - exports.default = _default; - }, - { - "../core/friendly_errors/fes_core": 289, - "../core/friendly_errors/file_errors": 290, - "../core/friendly_errors/validate_params": 293, - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.last-index-of": 181, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.object.from-entries": 195, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.promise": 201, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/web.dom-collections.iterator": 256, - "core-js/modules/web.url": 258, - "es6-promise/auto": 259, - "fetch-jsonp": 261, - "file-saver": 262, - "whatwg-fetch": 275, - }, - ], - 325: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.replace"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module IO - * @submodule Table - * @requires core - */ - /** - * Table Options - * Generic class for handling tabular data, typically from a - * CSV, TSV, or other sort of spreadsheet file. - * CSV files are - * - * comma separated values, often with the data in quotes. TSV - * files use tabs as separators, and usually don't bother with the - * quotes. - * File names should end with .csv if they're comma separated. - * A rough "spec" for CSV can be found - * here. - * To load files, use the loadTable method. - * To save tables to your computer, use the save method - * or the saveTable method. - * - * Possible options include: - *
                                    - *
                                  • csv - parse the table as comma-separated values - *
                                  • tsv - parse the table as tab-separated values - *
                                  • header - this table has a header (title) row - *
                                  - */ - /** - * Table objects store data with multiple rows and columns, much - * like in a traditional spreadsheet. Tables can be generated from - * scratch, dynamically, or using data from an existing file. - * - * @class p5.Table - * @constructor - * @param {p5.TableRow[]} [rows] An array of p5.TableRow objects - */ - - _main.default.Table = /*#__PURE__*/ (function () { - /** - * An array containing the names of the columns in the table, if the "header" the table is - * loaded with the "header" parameter. - * @type {String[]} - * @property columns - * @name columns - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //print the column names - * for (let c = 0; c < table.getColumnCount(); c++) { - * print('column ' + c + ' is named ' + table.columns[c]); - * } - * } - * - *
                                  - */ - function _class(rows) { - _classCallCheck(this, _class); - this.columns = []; - /** - * An array containing the p5.TableRow objects that make up the - * rows of the table. The same result as calling getRows() - * @type {p5.TableRow[]} - * @property rows - * @name rows - */ - this.rows = []; - } /** - * Use addRow() to add a new row of data to a p5.Table object. By default, - * an empty row is created. Typically, you would store a reference to - * the new row in a TableRow object (see newRow in the example above), - * and then set individual values using set(). - * - * If a p5.TableRow object is included as a parameter, then that row is - * duplicated and added to the table. - * - * @method addRow - * @param {p5.TableRow} [row] row to be added to the table - * @return {p5.TableRow} the row that was added - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //add a row - * let newRow = table.addRow(); - * newRow.setString('id', table.getRowCount() - 1); - * newRow.setString('species', 'Canis Lupus'); - * newRow.setString('name', 'Wolf'); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                                  - */ - - _createClass(_class, [ - { - key: "addRow", - value: function addRow(row) { - // make sure it is a valid TableRow - var r = row || new _main.default.TableRow(); - if ( - typeof r.arr === "undefined" || - typeof r.obj === "undefined" - ) { - //r = new p5.prototype.TableRow(r); - throw new Error("invalid TableRow: ".concat(r)); - } - r.table = this; - this.rows.push(r); - return r; - } /** - * Removes a row from the table object. - * - * @method removeRow - * @param {Integer} id ID number of the row to remove - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //remove the first row - * table.removeRow(0); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "removeRow", - value: function removeRow(id) { - this.rows[id].table = null; // remove reference to table - var chunk = this.rows.splice(id + 1, this.rows.length); - this.rows.pop(); - this.rows = this.rows.concat(chunk); - } /** - * Returns a reference to the specified p5.TableRow. The reference - * can then be used to get and set values of the selected row. - * - * @method getRow - * @param {Integer} rowID ID number of the row to get - * @return {p5.TableRow} p5.TableRow object - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let row = table.getRow(1); - * //print it column by column - * //note: a row is an object, not an array - * for (let c = 0; c < table.getColumnCount(); c++) { - * print(row.getString(c)); - * } - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getRow", - value: function getRow(r) { - return this.rows[r]; - } /** - * Gets all rows from the table. Returns an array of p5.TableRows. - * - * @method getRows - * @return {p5.TableRow[]} Array of p5.TableRows - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * - * //warning: rows is an array of objects - * for (let r = 0; r < rows.length; r++) { - * rows[r].set('name', 'Unicorn'); - * } - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getRows", - value: function getRows() { - return this.rows; - } /** - * Finds the first row in the Table that contains the value - * provided, and returns a reference to that row. Even if - * multiple rows are possible matches, only the first matching - * row is returned. The column to search may be specified by - * either its ID or title. - * - * @method findRow - * @param {String} value The value to match - * @param {Integer|String} column ID number or title of the - * column to search - * @return {p5.TableRow} - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //find the animal named zebra - * let row = table.findRow('Zebra', 'name'); - * //find the corresponding species - * print(row.getString('species')); - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "findRow", - value: function findRow(value, column) { - // try the Object - if (typeof column === "string") { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column] === value) { - return this.rows[i]; - } - } - } else { - // try the Array - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column] === value) { - return this.rows[j]; - } - } - } // otherwise... - - return null; - } /** - * Finds the rows in the Table that contain the value - * provided, and returns references to those rows. Returns an - * Array, so for must be used to iterate through all the rows, - * as shown in the example above. The column to search may be - * specified by either its ID or title. - * - * @method findRows - * @param {String} value The value to match - * @param {Integer|String} column ID number or title of the - * column to search - * @return {p5.TableRow[]} An Array of TableRow objects - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //add another goat - * let newRow = table.addRow(); - * newRow.setString('id', table.getRowCount() - 1); - * newRow.setString('species', 'Scape Goat'); - * newRow.setString('name', 'Goat'); - * - * //find the rows containing animals named Goat - * let rows = table.findRows('Goat', 'name'); - * print(rows.length + ' Goats found'); - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "findRows", - value: function findRows(value, column) { - var ret = []; - if (typeof column === "string") { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column] === value) { - ret.push(this.rows[i]); - } - } - } else { - // try the Array - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column] === value) { - ret.push(this.rows[j]); - } - } - } - return ret; - } /** - * Finds the first row in the Table that matches the regular - * expression provided, and returns a reference to that row. - * Even if multiple rows are possible matches, only the first - * matching row is returned. The column to search may be - * specified by either its ID or title. - * - * @method matchRow - * @param {String|RegExp} regexp The regular expression to match - * @param {String|Integer} column The column ID (number) or - * title (string) - * @return {p5.TableRow} TableRow object - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //Search using specified regex on a given column, return TableRow object - * let mammal = table.matchRow(new RegExp('ant'), 1); - * print(mammal.getString(1)); - * //Output "Panthera pardus" - * } - * - *
                                  - */, - }, - { - key: "matchRow", - value: function matchRow(regexp, column) { - if (typeof column === "number") { - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column].match(regexp)) { - return this.rows[j]; - } - } - } else { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column].match(regexp)) { - return this.rows[i]; - } - } - } - return null; - } /** - * Finds the rows in the Table that match the regular expression provided, - * and returns references to those rows. Returns an array, so for must be - * used to iterate through all the rows, as shown in the example. The - * column to search may be specified by either its ID or title. - * - * @method matchRows - * @param {String} regexp The regular expression to match - * @param {String|Integer} [column] The column ID (number) or - * title (string) - * @return {p5.TableRow[]} An Array of TableRow objects - * @example - *
                                  - * - * let table; - * - * function setup() { - * table = new p5.Table(); - * - * table.addColumn('name'); - * table.addColumn('type'); - * - * let newRow = table.addRow(); - * newRow.setString('name', 'Lion'); - * newRow.setString('type', 'Mammal'); - * - * newRow = table.addRow(); - * newRow.setString('name', 'Snake'); - * newRow.setString('type', 'Reptile'); - * - * newRow = table.addRow(); - * newRow.setString('name', 'Mosquito'); - * newRow.setString('type', 'Insect'); - * - * newRow = table.addRow(); - * newRow.setString('name', 'Lizard'); - * newRow.setString('type', 'Reptile'); - * - * let rows = table.matchRows('R.*', 'type'); - * for (let i = 0; i < rows.length; i++) { - * print(rows[i].getString('name') + ': ' + rows[i].getString('type')); - * } - * } - * // Sketch prints: - * // Snake: Reptile - * // Lizard: Reptile - * - *
                                  - */, - }, - { - key: "matchRows", - value: function matchRows(regexp, column) { - var ret = []; - if (typeof column === "number") { - for (var j = 0; j < this.rows.length; j++) { - if (this.rows[j].arr[column].match(regexp)) { - ret.push(this.rows[j]); - } - } - } else { - for (var i = 0; i < this.rows.length; i++) { - if (this.rows[i].obj[column].match(regexp)) { - ret.push(this.rows[i]); - } - } - } - return ret; - } /** - * Retrieves all values in the specified column, and returns them - * as an array. The column may be specified by either its ID or title. - * - * @method getColumn - * @param {String|Number} column String or Number of the column to return - * @return {Array} Array of column values - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //getColumn returns an array that can be printed directly - * print(table.getColumn('species')); - * //outputs ["Capra hircus", "Panthera pardus", "Equus zebra"] - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getColumn", - value: function getColumn(value) { - var ret = []; - if (typeof value === "string") { - for (var i = 0; i < this.rows.length; i++) { - ret.push(this.rows[i].obj[value]); - } - } else { - for (var j = 0; j < this.rows.length; j++) { - ret.push(this.rows[j].arr[value]); - } - } - return ret; - } /** - * Removes all rows from a Table. While all rows are removed, - * columns and column titles are maintained. - * - * @method clearRows - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.clearRows(); - * print(table.getRowCount() + ' total rows in table'); - * print(table.getColumnCount() + ' total columns in table'); - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "clearRows", - value: function clearRows() { - delete this.rows; - this.rows = []; - } /** - * Use addColumn() to add a new column to a Table object. - * Typically, you will want to specify a title, so the column - * may be easily referenced later by name. (If no title is - * specified, the new column's title will be null.) - * - * @method addColumn - * @param {String} [title] title of the given column - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.addColumn('carnivore'); - * table.set(0, 'carnivore', 'no'); - * table.set(1, 'carnivore', 'yes'); - * table.set(2, 'carnivore', 'no'); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "addColumn", - value: function addColumn(title) { - var t = title || null; - this.columns.push(t); - } /** - * Returns the total number of columns in a Table. - * - * @method getColumnCount - * @return {Integer} Number of columns in this table - * @example - *
                                  - * - * // given the cvs file "blobs.csv" in /assets directory - * // ID, Name, Flavor, Shape, Color - * // Blob1, Blobby, Sweet, Blob, Pink - * // Blob2, Saddy, Savory, Blob, Blue - * - * let table; - * - * function preload() { - * table = loadTable('assets/blobs.csv'); - * } - * - * function setup() { - * createCanvas(200, 100); - * textAlign(CENTER); - * background(255); - * } - * - * function draw() { - * let numOfColumn = table.getColumnCount(); - * text('There are ' + numOfColumn + ' columns in the table.', 100, 50); - * } - * - *
                                  - */, - }, - { - key: "getColumnCount", - value: function getColumnCount() { - return this.columns.length; - } /** - * Returns the total number of rows in a Table. - * - * @method getRowCount - * @return {Integer} Number of rows in this table - * @example - *
                                  - * - * // given the cvs file "blobs.csv" in /assets directory - * // - * // ID, Name, Flavor, Shape, Color - * // Blob1, Blobby, Sweet, Blob, Pink - * // Blob2, Saddy, Savory, Blob, Blue - * - * let table; - * - * function preload() { - * table = loadTable('assets/blobs.csv'); - * } - * - * function setup() { - * createCanvas(200, 100); - * textAlign(CENTER); - * background(255); - * } - * - * function draw() { - * text('There are ' + table.getRowCount() + ' rows in the table.', 100, 50); - * } - * - *
                                  - */, - }, - { - key: "getRowCount", - value: function getRowCount() { - return this.rows.length; - } /** - * Removes any of the specified characters (or "tokens"). - * - * If no column is specified, then the values in all columns and - * rows are processed. A specific column may be referenced by - * either its ID or title. - * - * @method removeTokens - * @param {String} chars String listing characters to be removed - * @param {String|Integer} [column] Column ID (number) - * or name (string) - * - * @example - *
                                  - * function setup() { - * let table = new p5.Table(); - * - * table.addColumn('name'); - * table.addColumn('type'); - * - * let newRow = table.addRow(); - * newRow.setString('name', ' $Lion ,'); - * newRow.setString('type', ',,,Mammal'); - * - * newRow = table.addRow(); - * newRow.setString('name', '$Snake '); - * newRow.setString('type', ',,,Reptile'); - * - * table.removeTokens(',$ '); - * print(table.getArray()); - * } - * - * // prints: - * // 0 "Lion" "Mamal" - * // 1 "Snake" "Reptile" - *
                                  - */, - }, - { - key: "removeTokens", - value: function removeTokens(chars, column) { - var escape = function escape(s) { - return s.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); - }; - var charArray = []; - for (var i = 0; i < chars.length; i++) { - charArray.push(escape(chars.charAt(i))); - } - var regex = new RegExp(charArray.join("|"), "g"); - if (typeof column === "undefined") { - for (var c = 0; c < this.columns.length; c++) { - for (var d = 0; d < this.rows.length; d++) { - var s = this.rows[d].arr[c]; - s = s.replace(regex, ""); - this.rows[d].arr[c] = s; - this.rows[d].obj[this.columns[c]] = s; - } - } - } else if (typeof column === "string") { - for (var j = 0; j < this.rows.length; j++) { - var val = this.rows[j].obj[column]; - val = val.replace(regex, ""); - this.rows[j].obj[column] = val; - var pos = this.columns.indexOf(column); - this.rows[j].arr[pos] = val; - } - } else { - for (var k = 0; k < this.rows.length; k++) { - var str = this.rows[k].arr[column]; - str = str.replace(regex, ""); - this.rows[k].arr[column] = str; - this.rows[k].obj[this.columns[column]] = str; - } - } - } /** - * Trims leading and trailing whitespace, such as spaces and tabs, - * from String table values. If no column is specified, then the - * values in all columns and rows are trimmed. A specific column - * may be referenced by either its ID or title. - * - * @method trim - * @param {String|Integer} [column] Column ID (number) - * or name (string) - * @example - *
                                  - * function setup() { - * let table = new p5.Table(); - * - * table.addColumn('name'); - * table.addColumn('type'); - * - * let newRow = table.addRow(); - * newRow.setString('name', ' Lion ,'); - * newRow.setString('type', ' Mammal '); - * - * newRow = table.addRow(); - * newRow.setString('name', ' Snake '); - * newRow.setString('type', ' Reptile '); - * - * table.trim(); - * print(table.getArray()); - * } - * - * // prints: - * // 0 "Lion" "Mamal" - * // 1 "Snake" "Reptile" - *
                                  - */, - }, - { - key: "trim", - value: function trim(column) { - var regex = new RegExp(" ", "g"); - if (typeof column === "undefined") { - for (var c = 0; c < this.columns.length; c++) { - for (var d = 0; d < this.rows.length; d++) { - var s = this.rows[d].arr[c]; - s = s.replace(regex, ""); - this.rows[d].arr[c] = s; - this.rows[d].obj[this.columns[c]] = s; - } - } - } else if (typeof column === "string") { - for (var j = 0; j < this.rows.length; j++) { - var val = this.rows[j].obj[column]; - val = val.replace(regex, ""); - this.rows[j].obj[column] = val; - var pos = this.columns.indexOf(column); - this.rows[j].arr[pos] = val; - } - } else { - for (var k = 0; k < this.rows.length; k++) { - var str = this.rows[k].arr[column]; - str = str.replace(regex, ""); - this.rows[k].arr[column] = str; - this.rows[k].obj[this.columns[column]] = str; - } - } - } /** - * Use removeColumn() to remove an existing column from a Table - * object. The column to be removed may be identified by either - * its title (a String) or its index value (an int). - * removeColumn(0) would remove the first column, removeColumn(1) - * would remove the second column, and so on. - * - * @method removeColumn - * @param {String|Integer} column columnName (string) or ID (number) - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.removeColumn('id'); - * print(table.getColumnCount()); - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "removeColumn", - value: function removeColumn(c) { - var cString; - var cNumber; - if (typeof c === "string") { - // find the position of c in the columns - cString = c; - cNumber = this.columns.indexOf(c); - } else { - cNumber = c; - cString = this.columns[c]; - } - var chunk = this.columns.splice( - cNumber + 1, - this.columns.length, - ); - this.columns.pop(); - this.columns = this.columns.concat(chunk); - for (var i = 0; i < this.rows.length; i++) { - var tempR = this.rows[i].arr; - var chip = tempR.splice(cNumber + 1, tempR.length); - tempR.pop(); - this.rows[i].arr = tempR.concat(chip); - delete this.rows[i].obj[cString]; - } - } /** - * Stores a value in the Table's specified row and column. - * The row is specified by its ID, while the column may be specified - * by either its ID or title. - * - * @method set - * @param {Integer} row row ID - * @param {String|Integer} column column ID (Number) - * or title (String) - * @param {String|Number} value value to assign - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.set(0, 'species', 'Canis Lupus'); - * table.set(0, 'name', 'Wolf'); - * - * //print the results - * for (let r = 0; r < table.getRowCount(); r++) - * for (let c = 0; c < table.getColumnCount(); c++) - * print(table.getString(r, c)); - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "set", - value: function set(row, column, value) { - this.rows[row].set(column, value); - } /** - * Stores a Float value in the Table's specified row and column. - * The row is specified by its ID, while the column may be specified - * by either its ID or title. - * - * @method setNum - * @param {Integer} row row ID - * @param {String|Integer} column column ID (Number) - * or title (String) - * @param {Number} value value to assign - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * table.setNum(1, 'id', 1); - * - * print(table.getColumn(0)); - * //["0", 1, "2"] - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "setNum", - value: function setNum(row, column, value) { - this.rows[row].setNum(column, value); - } /** - * Stores a String value in the Table's specified row and column. - * The row is specified by its ID, while the column may be specified - * by either its ID or title. - * - * @method setString - * @param {Integer} row row ID - * @param {String|Integer} column column ID (Number) - * or title (String) - * @param {String} value value to assign - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * //add a row - * let newRow = table.addRow(); - * newRow.setString('id', table.getRowCount() - 1); - * newRow.setString('species', 'Canis Lupus'); - * newRow.setString('name', 'Wolf'); - * - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                                  - */, - }, - { - key: "setString", - value: function setString(row, column, value) { - this.rows[row].setString(column, value); - } /** - * Retrieves a value from the Table's specified row and column. - * The row is specified by its ID, while the column may be specified by - * either its ID or title. - * - * @method get - * @param {Integer} row row ID - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String|Number} - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * print(table.get(0, 1)); - * //Capra hircus - * print(table.get(0, 'species')); - * //Capra hircus - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "get", - value: function get(row, column) { - return this.rows[row].get(column); - } /** - * Retrieves a Float value from the Table's specified row and column. - * The row is specified by its ID, while the column may be specified by - * either its ID or title. - * - * @method getNum - * @param {Integer} row row ID - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {Number} - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * print(table.getNum(1, 0) + 100); - * //id 1 + 100 = 101 - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getNum", - value: function getNum(row, column) { - return this.rows[row].getNum(column); - } /** - * Retrieves a String value from the Table's specified row and column. - * The row is specified by its ID, while the column may be specified by - * either its ID or title. - * - * @method getString - * @param {Integer} row row ID - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String} - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * // table is comma separated value "CSV" - * // and has specifiying header for column labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * print(table.getString(0, 0)); // 0 - * print(table.getString(0, 1)); // Capra hircus - * print(table.getString(0, 2)); // Goat - * print(table.getString(1, 0)); // 1 - * print(table.getString(1, 1)); // Panthera pardus - * print(table.getString(1, 2)); // Leopard - * print(table.getString(2, 0)); // 2 - * print(table.getString(2, 1)); // Equus zebra - * print(table.getString(2, 2)); // Zebra - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getString", - value: function getString(row, column) { - return this.rows[row].getString(column); - } /** - * Retrieves all table data and returns as an object. If a column name is - * passed in, each row object will be stored with that attribute as its - * title. - * - * @method getObject - * @param {String} [headerColumn] Name of the column which should be used to - * title each row object (optional) - * @return {Object} - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let tableObject = table.getObject(); - * - * print(tableObject); - * //outputs an object - * - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getObject", - value: function getObject(headerColumn) { - var tableObject = {}; - var obj, cPos, index; - for (var i = 0; i < this.rows.length; i++) { - obj = this.rows[i].obj; - if (typeof headerColumn === "string") { - cPos = this.columns.indexOf(headerColumn); // index of columnID - if (cPos >= 0) { - index = obj[headerColumn]; - tableObject[index] = obj; - } else { - throw new Error( - 'This table has no column named "'.concat( - headerColumn, - '"', - ), - ); - } - } else { - tableObject[i] = this.rows[i].obj; - } - } - return tableObject; - } /** - * Retrieves all table data and returns it as a multidimensional array. - * - * @method getArray - * @return {Array} - * - * @example - *
                                  - * - * // Given the CSV file "mammals.csv" - * // in the project's "assets" folder - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leoperd - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * // table is comma separated value "CSV" - * // and has specifiying header for column labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let tableArray = table.getArray(); - * for (let i = 0; i < tableArray.length; i++) { - * print(tableArray[i]); - * } - * describe('no image displayed'); - * } - * - *
                                  - */, - }, - { - key: "getArray", - value: function getArray() { - var tableArray = []; - for (var i = 0; i < this.rows.length; i++) { - tableArray.push(this.rows[i].arr); - } - return tableArray; - }, - }, - ]); - return _class; - })(); - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.regexp.constructor": 204, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.match": 211, - "core-js/modules/es.string.replace": 214, - }, - ], - 326: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.from-entries"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.from-entries"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module IO - * @submodule Table - * @requires core - */ - /** - * A TableRow object represents a single row of data values, - * stored in columns, from a table. - * - * A Table Row contains both an ordered array, and an unordered - * JSON object. - * - * @class p5.TableRow - * @constructor - * @param {String} [str] optional: populate the row with a - * string of values, separated by the - * separator - * @param {String} [separator] comma separated values (csv) by default - */ - - _main.default.TableRow = /*#__PURE__*/ (function () { - function _class(str, separator) { - _classCallCheck(this, _class); - var arr = []; - if (str) { - separator = separator || ","; - arr = str.split(separator); - } - this.arr = arr; - this.obj = Object.fromEntries(arr.entries()); - this.table = null; - } /** - * Stores a value in the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method set - * @param {String|Integer} column Column ID (Number) - * or Title (String) - * @param {String|Number} value The value to be stored - * - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * rows[r].set('name', 'Unicorn'); - * } - * - * //print the results - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                                  - */ - - _createClass(_class, [ - { - key: "set", - value: function set(column, value) { - // if typeof column is string, use .obj - if (typeof column === "string") { - var cPos = this.table.columns.indexOf(column); // index of columnID - if (cPos >= 0) { - this.obj[column] = value; - this.arr[cPos] = value; - } else { - throw new Error( - 'This table has no column named "'.concat(column, '"'), - ); - } - } else { - // if typeof column is number, use .arr - if (column < this.table.columns.length) { - this.arr[column] = value; - var cTitle = this.table.columns[column]; - this.obj[cTitle] = value; - } else { - throw new Error( - "Column #".concat( - column, - " is out of the range of this table", - ), - ); - } - } - } /** - * Stores a Float value in the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method setNum - * @param {String|Integer} column Column ID (Number) - * or Title (String) - * @param {Number|String} value The value to be stored - * as a Float - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * rows[r].setNum('id', r + 10); - * } - * - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                                  - */, - }, - { - key: "setNum", - value: function setNum(column, value) { - var floatVal = parseFloat(value); - this.set(column, floatVal); - } /** - * Stores a String value in the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method setString - * @param {String|Integer} column Column ID (Number) - * or Title (String) - * @param {String|Number|Boolean|Object} value The value to be stored - * as a String - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * let name = rows[r].getString('name'); - * rows[r].setString('name', 'A ' + name + ' named George'); - * } - * - * print(table.getArray()); - * - * describe('no image displayed'); - * } - *
                                  - */, - }, - { - key: "setString", - value: function setString(column, value) { - var stringVal = value.toString(); - this.set(column, stringVal); - } /** - * Retrieves a value from the TableRow's specified column. - * The column may be specified by either its ID or title. - * - * @method get - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String|Number} - * - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let names = []; - * let rows = table.getRows(); - * for (let r = 0; r < rows.length; r++) { - * names.push(rows[r].get('name')); - * } - * - * print(names); - * - * describe('no image displayed'); - * } - *
                                  - */, - }, - { - key: "get", - value: function get(column) { - if (typeof column === "string") { - return this.obj[column]; - } else { - return this.arr[column]; - } - } /** - * Retrieves a Float value from the TableRow's specified - * column. The column may be specified by either its ID or - * title. - * - * @method getNum - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {Number} Float Floating point number - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * let minId = Infinity; - * let maxId = -Infinity; - * for (let r = 0; r < rows.length; r++) { - * let id = rows[r].getNum('id'); - * minId = min(minId, id); - * maxId = min(maxId, id); - * } - * print('minimum id = ' + minId + ', maximum id = ' + maxId); - * describe('no image displayed'); - * } - *
                                  - */, - }, - { - key: "getNum", - value: function getNum(column) { - var ret; - if (typeof column === "string") { - ret = parseFloat(this.obj[column]); - } else { - ret = parseFloat(this.arr[column]); - } - if (ret.toString() === "NaN") { - throw "Error: ".concat( - this.obj[column], - " is NaN (Not a Number)", - ); - } - return ret; - } /** - * Retrieves an String value from the TableRow's specified - * column. The column may be specified by either its ID or - * title. - * - * @method getString - * @param {String|Integer} column columnName (string) or - * ID (number) - * @return {String} String - * @example - *
                                  - * // Given the CSV file "mammals.csv" in the project's "assets" folder: - * // - * // id,species,name - * // 0,Capra hircus,Goat - * // 1,Panthera pardus,Leopard - * // 2,Equus zebra,Zebra - * - * let table; - * - * function preload() { - * //my table is comma separated value "csv" - * //and has a header specifying the columns labels - * table = loadTable('assets/mammals.csv', 'csv', 'header'); - * } - * - * function setup() { - * let rows = table.getRows(); - * let longest = ''; - * for (let r = 0; r < rows.length; r++) { - * let species = rows[r].getString('species'); - * if (longest.length < species.length) { - * longest = species; - * } - * } - * - * print('longest: ' + longest); - * - * describe('no image displayed'); - * } - *
                                  - */, - }, - { - key: "getString", - value: function getString(column) { - if (typeof column === "string") { - return this.obj[column].toString(); - } else { - return this.arr[column].toString(); - } - }, - }, - ]); - return _class; - })(); - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.from-entries": 195, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.split": 216, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 327: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module IO - * @submodule Input - * @requires core - */ - /** - * XML is a representation of an XML object, able to parse XML code. Use - * loadXML() to load external XML files and create XML objects. - * - * @class p5.XML - * @constructor - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let children = xml.getChildren('animal'); - * - * for (let i = 0; i < children.length; i++) { - * let id = children[i].getNum('id'); - * let coloring = children[i].getString('species'); - * let name = children[i].getContent(); - * print(id + ', ' + coloring + ', ' + name); - * } - * - * describe('no image displayed'); - * } - * - * // Sketch prints: - * // 0, Capra hircus, Goat - * // 1, Panthera pardus, Leopard - * // 2, Equus zebra, Zebra - *
                                  - */ - - _main.default.XML = /*#__PURE__*/ (function () { - function _class(DOM) { - _classCallCheck(this, _class); - if (!DOM) { - var xmlDoc = document.implementation.createDocument( - null, - "doc", - ); - this.DOM = xmlDoc.createElement("root"); - } else { - this.DOM = DOM; - } - } /** - * Gets a copy of the element's parent. Returns the parent as another - * p5.XML object. - * - * @method getParent - * @return {p5.XML} element parent - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let children = xml.getChildren('animal'); - * let parent = children[1].getParent(); - * print(parent.getName()); - * } - * - * // Sketch prints: - * // mammals - *
                                  - */ - - _createClass(_class, [ - { - key: "getParent", - value: function getParent() { - return new _main.default.XML(this.DOM.parentElement); - } /** - * Gets the element's full name, which is returned as a String. - * - * @method getName - * @return {String} the name of the node - * @example<animal - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.getName()); - * } - * - * // Sketch prints: - * // mammals - *
                                  - */, - }, - { - key: "getName", - value: function getName() { - return this.DOM.tagName; - } /** - * Sets the element's name, which is specified as a String. - * - * @method setName - * @param {String} the new name of the node - * @example<animal - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.getName()); - * xml.setName('fish'); - * print(xml.getName()); - * } - * - * // Sketch prints: - * // mammals - * // fish - *
                                  - */, - }, - { - key: "setName", - value: function setName(name) { - var content = this.DOM.innerHTML; - var attributes = this.DOM.attributes; - var xmlDoc = document.implementation.createDocument( - null, - "default", - ); - var newDOM = xmlDoc.createElement(name); - newDOM.innerHTML = content; - for (var i = 0; i < attributes.length; i++) { - newDOM.setAttribute( - attributes[i].nodeName, - attributes.nodeValue, - ); - } - this.DOM = newDOM; - } /** - * Checks whether or not the element has any children, and returns the result - * as a boolean. - * - * @method hasChildren - * @return {boolean} - * @example<animal - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.hasChildren()); - * } - * - * // Sketch prints: - * // true - *
                                  - */, - }, - { - key: "hasChildren", - value: function hasChildren() { - return this.DOM.children.length > 0; - } /** - * Get the names of all of the element's children, and returns the names as an - * array of Strings. This is the same as looping through and calling getName() - * on each child element individually. - * - * @method listChildren - * @return {String[]} names of the children of the element - * @example<animal - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.listChildren()); - * } - * - * // Sketch prints: - * // ["animal", "animal", "animal"] - *
                                  - */, - }, - { - key: "listChildren", - value: function listChildren() { - var arr = []; - for (var i = 0; i < this.DOM.childNodes.length; i++) { - arr.push(this.DOM.childNodes[i].nodeName); - } - return arr; - } /** - * Returns all of the element's children as an array of p5.XML objects. When - * the name parameter is specified, then it will return all children that match - * that name. - * - * @method getChildren - * @param {String} [name] element name - * @return {p5.XML[]} children of the element - * @example<animal - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let animals = xml.getChildren('animal'); - * - * for (let i = 0; i < animals.length; i++) { - * print(animals[i].getContent()); - * } - * } - * - * // Sketch prints: - * // "Goat" - * // "Leopard" - * // "Zebra" - *
                                  - */, - }, - { - key: "getChildren", - value: function getChildren(param) { - if (param) { - return elementsToP5XML( - this.DOM.getElementsByTagName(param), - ); - } else { - return elementsToP5XML(this.DOM.children); - } - } /** - * Returns the first of the element's children that matches the name parameter - * or the child of the given index.It returns undefined if no matching - * child is found. - * - * @method getChild - * @param {String|Integer} name element name or index - * @return {p5.XML} - * @example<animal - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getContent()); - * } - * - * // Sketch prints: - * // "Goat" - *
                                  - *
                                  - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let secondChild = xml.getChild(1); - * print(secondChild.getContent()); - * } - * - * // Sketch prints: - * // "Leopard" - *
                                  - */, - }, - { - key: "getChild", - value: function getChild(param) { - if (typeof param === "string") { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = this.DOM.children[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var child = _step.value; - if (child.tagName === param) - return new _main.default.XML(child); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } else { - return new _main.default.XML(this.DOM.children[param]); - } - } /** - * Appends a new child to the element. The child can be specified with - * either a String, which will be used as the new tag's name, or as a - * reference to an existing p5.XML object. - * A reference to the newly created child is returned as an p5.XML object. - * - * @method addChild - * @param {p5.XML} node a p5.XML Object which will be the child to be added - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let child = new p5.XML(); - * child.setName('animal'); - * child.setAttribute('id', '3'); - * child.setAttribute('species', 'Ornithorhynchus anatinus'); - * child.setContent('Platypus'); - * xml.addChild(child); - * - * let animals = xml.getChildren('animal'); - * print(animals[animals.length - 1].getContent()); - * } - * - * // Sketch prints: - * // "Goat" - * // "Leopard" - * // "Zebra" - *
                                  - */, - }, - { - key: "addChild", - value: function addChild(node) { - if (node instanceof _main.default.XML) { - this.DOM.appendChild(node.DOM); - } else { - // PEND - } - } /** - * Removes the element specified by name or index. - * - * @method removeChild - * @param {String|Integer} name element name or index - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * xml.removeChild('animal'); - * let children = xml.getChildren(); - * for (let i = 0; i < children.length; i++) { - * print(children[i].getContent()); - * } - * } - * - * // Sketch prints: - * // "Leopard" - * // "Zebra" - *
                                  - *
                                  - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * xml.removeChild(1); - * let children = xml.getChildren(); - * for (let i = 0; i < children.length; i++) { - * print(children[i].getContent()); - * } - * } - * - * // Sketch prints: - * // "Goat" - * // "Zebra" - *
                                  - */, - }, - { - key: "removeChild", - value: function removeChild(param) { - var ind = -1; - if (typeof param === "string") { - for (var i = 0; i < this.DOM.children.length; i++) { - if (this.DOM.children[i].tagName === param) { - ind = i; - break; - } - } - } else { - ind = param; - } - if (ind !== -1) { - this.DOM.removeChild(this.DOM.children[ind]); - } - } /** - * Counts the specified element's number of attributes, returned as an Number. - * - * @method getAttributeCount - * @return {Integer} - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getAttributeCount()); - * } - * - * // Sketch prints: - * // 2 - *
                                  - */, - }, - { - key: "getAttributeCount", - value: function getAttributeCount() { - return this.DOM.attributes.length; - } /** - * Gets all of the specified element's attributes, and returns them as an - * array of Strings. - * - * @method listAttributes - * @return {String[]} an array of strings containing the names of attributes - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.listAttributes()); - * } - * - * // Sketch prints: - * // ["id", "species"] - *
                                  - */, - }, - { - key: "listAttributes", - value: function listAttributes() { - var arr = []; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = this.DOM.attributes[Symbol.iterator](), - _step2; - !(_iteratorNormalCompletion2 = (_step2 = - _iterator2.next()).done); - _iteratorNormalCompletion2 = true - ) { - var attribute = _step2.value; - arr.push(attribute.nodeName); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return arr; - } /** - * Checks whether or not an element has the specified attribute. - * - * @method hasAttribute - * @param {String} the attribute to be checked - * @return {boolean} true if attribute found else false - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.hasAttribute('species')); - * print(firstChild.hasAttribute('color')); - * } - * - * // Sketch prints: - * // true - * // false - *
                                  - */, - }, - { - key: "hasAttribute", - value: function hasAttribute(name) { - var obj = {}; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = this.DOM.attributes[Symbol.iterator](), - _step3; - !(_iteratorNormalCompletion3 = (_step3 = - _iterator3.next()).done); - _iteratorNormalCompletion3 = true - ) { - var attribute = _step3.value; - obj[attribute.nodeName] = attribute.nodeValue; - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion3 && - _iterator3.return != null - ) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - return obj[name] ? true : false; - } /** - * Returns an attribute value of the element as an Number. If the defaultValue - * parameter is specified and the attribute doesn't exist, then defaultValue - * is returned. If no defaultValue is specified and the attribute doesn't - * exist, the value 0 is returned. - * - * @method getNum - * @param {String} name the non-null full name of the attribute - * @param {Number} [defaultValue] the default value of the attribute - * @return {Number} - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getNum('id')); - * } - * - * // Sketch prints: - * // 0 - *
                                  - */, - }, - { - key: "getNum", - value: function getNum(name, defaultValue) { - var obj = {}; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for ( - var _iterator4 = this.DOM.attributes[Symbol.iterator](), - _step4; - !(_iteratorNormalCompletion4 = (_step4 = - _iterator4.next()).done); - _iteratorNormalCompletion4 = true - ) { - var attribute = _step4.value; - obj[attribute.nodeName] = attribute.nodeValue; - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion4 && - _iterator4.return != null - ) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - return Number(obj[name]) || defaultValue || 0; - } /** - * Returns an attribute value of the element as an String. If the defaultValue - * parameter is specified and the attribute doesn't exist, then defaultValue - * is returned. If no defaultValue is specified and the attribute doesn't - * exist, null is returned. - * - * @method getString - * @param {String} name the non-null full name of the attribute - * @param {Number} [defaultValue] the default value of the attribute - * @return {String} - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getString('species')); - * } - * - * // Sketch prints: - * // "Capra hircus" - *
                                  - */, - }, - { - key: "getString", - value: function getString(name, defaultValue) { - var obj = {}; - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = undefined; - try { - for ( - var _iterator5 = this.DOM.attributes[Symbol.iterator](), - _step5; - !(_iteratorNormalCompletion5 = (_step5 = - _iterator5.next()).done); - _iteratorNormalCompletion5 = true - ) { - var attribute = _step5.value; - obj[attribute.nodeName] = attribute.nodeValue; - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion5 && - _iterator5.return != null - ) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - return obj[name] ? String(obj[name]) : defaultValue || null; - } /** - * Sets the content of an element's attribute. The first parameter specifies - * the attribute name, while the second specifies the new content. - * - * @method setAttribute - * @param {String} name the full name of the attribute - * @param {Number|String|Boolean} value the value of the attribute - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getString('species')); - * firstChild.setAttribute('species', 'Jamides zebra'); - * print(firstChild.getString('species')); - * } - * - * // Sketch prints: - * // "Capra hircus" - * // "Jamides zebra" - *
                                  - */, - }, - { - key: "setAttribute", - value: function setAttribute(name, value) { - this.DOM.setAttribute(name, value); - } /** - * Returns the content of an element. If there is no such content, - * defaultValue is returned if specified, otherwise null is returned. - * - * @method getContent - * @param {String} [defaultValue] value returned if no content is found - * @return {String} - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getContent()); - * } - * - * // Sketch prints: - * // "Goat" - *
                                  - */, - }, - { - key: "getContent", - value: function getContent(defaultValue) { - var str; - str = this.DOM.textContent; - str = str.replace(/\s\s+/g, ","); - return str || defaultValue || null; - } /** - * Sets the element's content. - * - * @method setContent - * @param {String} text the new content - * @example - *
                                  - * // The following short XML file called "mammals.xml" is parsed - * // in the code below. - * // - * // - * // <mammals> - * // <animal id="0" species="Capra hircus">Goat</animal> - * // <animal id="1" species="Panthera pardus">Leopard</animal> - * // <animal id="2" species="Equus zebra">Zebra</animal> - * // </mammals> - * - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * let firstChild = xml.getChild('animal'); - * print(firstChild.getContent()); - * firstChild.setContent('Mountain Goat'); - * print(firstChild.getContent()); - * } - * - * // Sketch prints: - * // "Goat" - * // "Mountain Goat" - *
                                  - */, - }, - { - key: "setContent", - value: function setContent(content) { - if (!this.DOM.children.length) { - this.DOM.textContent = content; - } - } /** - * Serializes the element into a string. This function is useful for preparing - * the content to be sent over a http request or saved to file. - * - * @method serialize - * @return {String} Serialized string of the element - * @example - *
                                  - * let xml; - * - * function preload() { - * xml = loadXML('assets/mammals.xml'); - * } - * - * function setup() { - * print(xml.serialize()); - * } - * - * // Sketch prints: - * // - * // Goat - * // Leopard - * // Zebra - * // - *
                                  - */, - }, - { - key: "serialize", - value: function serialize() { - var xmlSerializer = new XMLSerializer(); - return xmlSerializer.serializeToString(this.DOM); - }, - }, - ]); - return _class; - })(); - function elementsToP5XML(elements) { - var arr = []; - for (var i = 0; i < elements.length; i++) { - arr.push(new _main.default.XML(elements[i])); - } - return arr; - } - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.number.constructor": 191, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 328: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Math - * @submodule Calculation - * @for p5 - * @requires core - */ - /** - * Calculates the absolute value of a number. A number's absolute value is its - * distance from zero on the number line. -5 and 5 are both five units away - * from zero, so calling `abs(-5)` and `abs(5)` both return 5. The absolute - * value of a number is always positive. - * - * @method abs - * @param {Number} n number to compute. - * @return {Number} absolute value of given number. - * @example - *
                                  - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let centerX = width / 2; - * let x = frameCount; - * let y = abs(x - centerX); - * point(x, y); - * - * describe('A series of black dots that form a "V" shape.'); - * } - * - *
                                  - */ - - _main.default.prototype.abs = Math.abs; - /** - * Calculates the closest integer value that is greater than or equal to the - * parameter's value. For example, calling `ceil(9.03)` returns the value - * 10. - * - * @method ceil - * @param {Number} n number to round up. - * @return {Integer} rounded up number. - * @example - *
                                  - * - * // Set the range for RGB values from 0 to 1. - * colorMode(RGB, 1); - * noStroke(); - * - * let r = 0.3; - * fill(r, 0, 0); - * rect(0, 0, width / 2, height); - * - * // Round r up to 1. - * r = ceil(r); - * fill(r, 0, 0); - * rect(width / 2, 0, width / 2, height); - * - * describe('Two rectangles. The one on the left is dark red and the one on the right is bright red.'); - * - *
                                  - */ - _main.default.prototype.ceil = Math.ceil; - /** - * Constrains a number between a minimum and maximum value. - * - * @method constrain - * @param {Number} n number to constrain. - * @param {Number} low minimum limit. - * @param {Number} high maximum limit. - * @return {Number} constrained number. - * @example - *
                                  - * - * function draw() { - * background(200); - * - * let x = constrain(mouseX, 33, 67); - * let y = 50; - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot drawn on a gray square follows the mouse from left to right. Its movement is constrained to the middle third of the square.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * // Set boundaries and draw them. - * let leftWall = width * 0.25; - * let rightWall = width * 0.75; - * line(leftWall, 0, leftWall, height); - * line(rightWall, 0, rightWall, height); - * - * // Draw a circle that follows the mouse freely. - * fill(255); - * circle(mouseX, height / 3, 9); - * - * // Draw a circle that's constrained. - * let xc = constrain(mouseX, leftWall, rightWall); - * fill(0); - * circle(xc, 2 * height / 3, 9); - * - * describe('Two vertical lines. Two circles move horizontally with the mouse. One circle stops at the vertical lines.'); - * } - * - *
                                  - */ - _main.default.prototype.constrain = function (n, low, high) { - _main.default._validateParameters("constrain", arguments); - return Math.max(Math.min(n, high), low); - }; - /** - * Calculates the distance between two points. - * - * The version of `dist()` with four parameters calculates distance in two - * dimensions. - * - * The version of `dist()` with six parameters calculates distance in three - * dimensions. - * - * Use p5.Vector.dist() to calculate the - * distance between two p5.Vector objects. - * - * @method dist - * @param {Number} x1 x-coordinate of the first point. - * @param {Number} y1 y-coordinate of the first point. - * @param {Number} x2 x-coordinate of the second point. - * @param {Number} y2 y-coordinate of the second point. - * @return {Number} distance between the two points. - * - * @example - *
                                  - * - * let x1 = 10; - * let y1 = 50; - * let x2 = 90; - * let y2 = 50; - * - * line(x1, y1, x2, y2); - * strokeWeight(5); - * point(x1, y1); - * point(x2, y2); - * - * let d = dist(x1, y1, x2, y2); - * text(d, 43, 40); - * - * describe('Two dots connected by a horizontal line. The number 80 is written above the center of the line.'); - * - *
                                  - */ - /** - * @method dist - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} z1 z-coordinate of the first point. - * @param {Number} x2 - * @param {Number} y2 - * @param {Number} z2 z-coordinate of the second point. - * @return {Number} distance between the two points. - */ - _main.default.prototype.dist = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("dist", args); - if (args.length === 4) { - //2D - return Math.hypot(args[2] - args[0], args[3] - args[1]); - } else if (args.length === 6) { - //3D - return Math.hypot( - args[3] - args[0], - args[4] - args[1], - args[5] - args[2], - ); - } - }; - /** - * Returns Euler's number e (2.71828...) raised to the power of the `n` - * parameter. - * - * @method exp - * @param {Number} n exponent to raise. - * @return {Number} e^n - * @example - *
                                  - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 0.005 * exp(x * 0.1); - * point(x, y); - * - * describe('A series of black dots that grow exponentially from left to right.'); - * } - * - *
                                  - */ - _main.default.prototype.exp = Math.exp; - /** - * Calculates the closest integer value that is less than or equal to the - * value of the `n` parameter. - * - * @method floor - * @param {Number} n number to round down. - * @return {Integer} rounded down number. - * @example - *
                                  - * - * // Set the range for RGB values from 0 to 1. - * colorMode(RGB, 1); - * noStroke(); - * - * let r = 0.8; - * fill(r, 0, 0); - * rect(0, 0, width / 2, height); - * - * // Round r down to 0. - * r = floor(r); - * fill(r, 0, 0); - * rect(width / 2, 0, width / 2, height); - * - * describe('Two rectangles. The one on the left is bright red and the one on the right is black.'); - * - *
                                  - */ - _main.default.prototype.floor = Math.floor; - /** - * Calculates a number between two numbers at a specific increment. The `amt` - * parameter is the amount to interpolate between the two numbers. 0.0 is - * equal to the first number, 0.1 is very near the first number, 0.5 is - * half-way in between, and 1.0 is equal to the second number. The `lerp()` - * function is convenient for creating motion along a straight path and for - * drawing dotted lines. - * - * If the value of `amt` is less than 0 or more than 1, `lerp()` will return a - * number outside of the original interval. For example, calling - * `lerp(0, 10, 1.5)` will return 15. - * - * @method lerp - * @param {Number} start first value. - * @param {Number} stop second value. - * @param {Number} amt number. - * @return {Number} lerped value. - * @example - *
                                  - * - * let a = 20; - * let b = 80; - * let c = lerp(a, b, 0.2); - * let d = lerp(a, b, 0.5); - * let e = lerp(a, b, 0.8); - * - * let y = 50; - * - * strokeWeight(5); - * - * // Draw the original points in black. - * stroke(0); - * point(a, y); - * point(b, y); - * - * // Draw the lerped points in gray. - * stroke(100); - * point(c, y); - * point(d, y); - * point(e, y); - * - * describe('Five points in a horizontal line. The outer points are black and the inner points are gray.'); - * - *
                                  - */ - _main.default.prototype.lerp = function (start, stop, amt) { - _main.default._validateParameters("lerp", arguments); - return amt * (stop - start) + start; - }; - /** - * Calculates the natural logarithm (the base-e logarithm) of a number. This - * function expects the `n` parameter to be a value greater than 0.0. - * - * @method log - * @param {Number} n number greater than 0. - * @return {Number} natural logarithm of n. - * @example - *
                                  - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 15 * log(x); - * point(x, y); - * - * describe('A series of black dots that get higher slowly from left to right.'); - * } - * - *
                                  - */ - _main.default.prototype.log = Math.log; - /** - * Calculates the magnitude, or length, of a vector. A vector is like an arrow - * pointing in space. Vectors are commonly used for programming motion. - * - * Vectors don't have a "start" position because the same arrow can be drawn - * anywhere. A vector's magnitude can be thought of as the distance from the - * origin (0, 0) to its tip at (x, y). `mag(x, y)` is a shortcut for calling - * `dist(0, 0, x, y)`. - * - * @method mag - * @param {Number} x first component. - * @param {Number} y second component. - * @return {Number} magnitude of vector from (0,0) to (x,y). - * @example - *
                                  - * - * let x = 30; - * let y = 40; - * let m = mag(x, y); - * - * line(0, 0, x, y); - * text(m, x, y); - * - * describe('A diagonal line is drawn from the top left of the canvas. The number 50 is written at the end of the line.'); - * - *
                                  - */ - _main.default.prototype.mag = function (x, y) { - _main.default._validateParameters("mag", arguments); - return Math.hypot(x, y); - }; - /** - * Re-maps a number from one range to another. - * - * For example, calling `map(2, 0, 10, 0, 100)` returns 20. The first three - * arguments set the original value to 2 and the original range from 0 to 10. - * The last two arguments set the target range from 0 to 100. 20's position - * in the target range [0, 100] is proportional to 2's position in the - * original range [0, 10]. - * - * @method map - * @param {Number} value the incoming value to be converted. - * @param {Number} start1 lower bound of the value's current range. - * @param {Number} stop1 upper bound of the value's current range. - * @param {Number} start2 lower bound of the value's target range. - * @param {Number} stop2 upper bound of the value's target range. - * @param {Boolean} [withinBounds] constrain the value to the newly mapped range. - * @return {Number} remapped number. - * @example - *
                                  - * - * let n = map(7, 0, 10, 0, 100); - * text(n, 50, 50); - * - * describe('The number 70 written in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let x = map(2, 0, 10, 0, width); - * circle(x, 50, 10); - * - * describe('A white circle drawn on the left side of a gray square.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let c = map(mouseX, 0, width, 0, 255); - * fill(c); - * circle(50, 50, 20); - * - * describe('A circle changes color from black to white as the mouse moves from left to right.'); - * } - * - *
                                  - */ - _main.default.prototype.map = function ( - n, - start1, - stop1, - start2, - stop2, - withinBounds, - ) { - _main.default._validateParameters("map", arguments); - var newval = - ((n - start1) / (stop1 - start1)) * (stop2 - start2) + start2; - if (!withinBounds) { - return newval; - } - if (start2 < stop2) { - return this.constrain(newval, start2, stop2); - } else { - return this.constrain(newval, stop2, start2); - } - }; - /** - * Returns the largest value in a sequence of numbers. - * - * The version of `max()` with one parameter interprets it as an array of - * numbers and returns the largest number. - * - * The version of `max()` with two or more parameters interprets them as - * individual numbers and returns the largest number. - * - * @method max - * @param {Number} n0 first number to compare. - * @param {Number} n1 second number to compare. - * @return {Number} maximum number. - * @example - *
                                  - * - * let m = max(10, 20); - * text(m, 50, 50); - * - * describe('The number 20 written in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let m = max([10, 20]); - * text(m, 50, 50); - * - * describe('The number 20 written in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let numbers = [2, 1, 5, 4, 8, 9]; - * - * // Draw all of the numbers in the array. - * noStroke(); - * let spacing = 15; - * numbers.forEach((n, index) => { - * let x = index * spacing; - * let y = 25; - * text(n, x, y); - * }); - * - * // Draw the maximum value in the array. - * let m = max(numbers); - * let maxX = 33; - * let maxY = 80; - * - * textSize(32); - * text(m, maxX, maxY); - * - * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 9 is written in large text at the center of the square.'); - * - *
                                  - */ - /** - * @method max - * @param {Number[]} nums numbers to compare. - * @return {Number} - */ - _main.default.prototype.max = function () { - var findMax = function findMax(arr) { - var max = -Infinity; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = arr[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var x = _step.value; - max = x > max ? x : max; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return max; - }; - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - if (args[0] instanceof Array) { - return findMax(args[0]); - } else { - return findMax(args); - } - }; - /** - * Returns the smallest value in a sequence of numbers. - * - * The version of `min()` with one parameter interprets it as an array of - * numbers and returns the smallest number. - * - * The version of `min()` with two or more parameters interprets them as - * individual numbers and returns the smallest number. - * - * @method min - * @param {Number} n0 first number to compare. - * @param {Number} n1 second number to compare. - * @return {Number} minimum number. - * @example - *
                                  - * - * let m = min(10, 20); - * text(m, 50, 50); - * - * describe('The number 10 written in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let m = min([10, 20]); - * text(m, 50, 50); - * - * describe('The number 10 written in the middle of a gray square.'); - * - *
                                  - * - *
                                  - * - * let numbers = [2, 1, 5, 4, 8, 9]; - * - * // Draw all of the numbers in the array. - * noStroke(); - * let spacing = 15; - * numbers.forEach((n, index) => { - * let x = index * spacing; - * let y = 25; - * text(n, x, y); - * }); - * - * // Draw the minimum value in the array. - * let m = min(numbers); - * let minX = 33; - * let minY = 80; - * - * textSize(32); - * text(m, minX, minY); - * - * describe('The numbers 2 1 5 4 8 9 are written in small text at the top of a gray square. The number 1 is written in large text at the center of the square.'); - * - *
                                  - */ - /** - * @method min - * @param {Number[]} nums numbers to compare. - * @return {Number} - */ - _main.default.prototype.min = function () { - var findMin = function findMin(arr) { - var min = Infinity; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = arr[Symbol.iterator](), _step2; - !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) - .done); - _iteratorNormalCompletion2 = true - ) { - var x = _step2.value; - min = x < min ? x : min; - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return min; - }; - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - if (args[0] instanceof Array) { - return findMin(args[0]); - } else { - return findMin(args); - } - }; - /** - * Maps a number from one range to a value between 0 and 1. - * - * For example, `norm(2, 0, 10)` returns 0.2. 2's position in the original - * range [0, 10] is proportional to 0.2's position in the range [0, 1]. This - * is equivalent to calling `map(2, 0, 10, 0, 1)`. - * - * Numbers outside of the original range are not constrained between 0 and 1. - * Out-of-range values are often intentional and useful. - * - * @method norm - * @param {Number} value incoming value to be normalized. - * @param {Number} start lower bound of the value's current range. - * @param {Number} stop upper bound of the value's current range. - * @return {Number} normalized number. - * @example - *
                                  - * - * function draw() { - * // Set the range for RGB values from 0 to 1. - * colorMode(RGB, 1); - * - * let r = norm(mouseX, 0, width); - * background(r, 0, 0); - * - * describe('A square changes color from black to red as the mouse moves from left to right.'); - * } - * - *
                                  - */ - _main.default.prototype.norm = function (n, start, stop) { - _main.default._validateParameters("norm", arguments); - return this.map(n, start, stop, 0, 1); - }; - /** - * Calculates exponential expressions such as 2^3. - * - * For example, `pow(2, 3)` is equivalent to the expression - * 2 × 2 × 2. `pow(2, -3)` is equivalent to 1 ÷ - * (2 × 2 × 2). - * - * @method pow - * @param {Number} n base of the exponential expression. - * @param {Number} e power by which to raise the base. - * @return {Number} n^e. - * @example - *
                                  - * - * let base = 3; - * - * let d = pow(base, 1); - * circle(10, 10, d); - * - * d = pow(base, 2); - * circle(20, 20, d); - * - * d = pow(base, 3); - * circle(40, 40, d); - * - * d = pow(base, 4); - * circle(80, 80, d); - * - * describe('A series of circles that grow exponentially from top left to bottom right.'); - * - *
                                  - */ - _main.default.prototype.pow = Math.pow; - /** - * Calculates the integer closest to the `n` parameter. For example, - * `round(133.8)` returns the value 134. - * - * @method round - * @param {Number} n number to round. - * @param {Number} [decimals] number of decimal places to round to, default is 0. - * @return {Integer} rounded number. - * @example - *
                                  - * - * let x = round(3.7); - * text(x, width / 2, height / 2); - * - * describe('The number 4 written in middle of canvas.'); - * - *
                                  - * - *
                                  - * - * let x = round(12.782383, 2); - * text(x, width / 2, height / 2); - * - * describe('The number 12.78 written in middle of canvas.'); - * - *
                                  - */ - _main.default.prototype.round = function (n, decimals) { - if (!decimals) { - return Math.round(n); - } - var multiplier = Math.pow(10, decimals); - return Math.round(n * multiplier) / multiplier; - }; - /** - * Squares a number, which means multiplying the number by itself. The value - * returned is always a positive number. - * - * For example, `sq(3)` evaluates 3 × 3 which is 9. `sq(-3)` evaluates - * -3 × -3 which is also 9. Multiplying two negative numbers produces - * a positive number. - * - * @method sq - * @param {Number} n number to square. - * @return {Number} squared number. - * @example - *
                                  - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 0.01 * sq(x); - * point(x, y); - * - * describe('A series of black dots that get higher quickly from left to right.'); - * } - * - *
                                  - */ - _main.default.prototype.sq = function (n) { - return n * n; - }; - /** - * Calculates the square root of a number. A number's square root can be - * multiplied by itself to produce the original number. - * - * For example, `sqrt(9)` returns 3 because 3 × 3 = 9. `sqrt()` always - * returns a positive value. `sqrt()` doesn't work with negative arguments - * such as `sqrt(-9)`. - * - * @method sqrt - * @param {Number} n non-negative number to square root. - * @return {Number} square root of number. - * @example - *
                                  - * - * function draw() { - * // Invert the y-axis. - * scale(1, -1); - * translate(0, -height); - * - * let x = frameCount; - * let y = 5 * sqrt(x); - * point(x, y); - * - * describe('A series of black dots that get higher slowly from left to right.'); - * } - * - *
                                  - */ - _main.default.prototype.sqrt = Math.sqrt; - /** - * Calculates the fractional part of a number. For example, - * `fract(12.34)` returns 0.34. - * - * @method fract - * @param {Number} n number whose fractional part will be found. - * @returns {Number} fractional part of n. - * @example - *
                                  - * - * let n = 56.78; - * text(n, 20, 33); - * let f = fract(n); - * text(f, 20, 66); - * - * describe('The number 56.78 written above the number 0.78.'); - * - *
                                  - */ - _main.default.prototype.fract = function (toConvert) { - _main.default._validateParameters("fract", arguments); - var sign = 0; - var num = Number(toConvert); - if (isNaN(num) || Math.abs(num) === Infinity) { - return num; - } else if (num < 0) { - num = -num; - sign = 1; - } - if (String(num).includes(".") && !String(num).includes("e")) { - var toFract = String(num); - toFract = Number("0" + toFract.slice(toFract.indexOf("."))); - return Math.abs(sign - toFract); - } else if (num < 1) { - return Math.abs(sign - num); - } else { - return 0; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.math.hypot": 188, - "core-js/modules/es.number.constructor": 191, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 329: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.slice"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - return _construct.apply(null, arguments); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } /** - * @module Math - * @submodule Vector - * @for p5 - * @requires core - */ - /** - * Creates a new p5.Vector object. A vector is like - * an arrow pointing in space. Vectors have both magnitude (length) - * and direction. Calling `createVector()` without arguments sets the new - * vector's components to 0. - * - * p5.Vector objects are often used to program - * motion because they simplify the math. For example, a moving ball has a - * position and a velocity. Position describes where the ball is in space. The - * ball's position vector extends from the origin to the ball's center. - * Velocity describes the ball's speed and the direction it's moving. If the - * ball is moving straight up, its velocity vector points straight up. Adding - * the ball's velocity vector to its position vector moves it, as in - * `pos.add(vel)`. Vector math relies on methods inside the - * p5.Vector class. - * - * @method createVector - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @return {p5.Vector} new p5.Vector object. - * @example - *
                                  - * - * let p1 = createVector(25, 25); - * let p2 = createVector(50, 50); - * let p3 = createVector(75, 75); - * - * strokeWeight(5); - * point(p1); - * point(p2); - * point(p3); - * - * describe('Three black dots form a diagonal line from top left to bottom right.'); - * - *
                                  - * - *
                                  - * - * let pos; - * let vel; - * - * function setup() { - * createCanvas(100, 100); - * pos = createVector(width / 2, height); - * vel = createVector(0, -1); - * } - * - * function draw() { - * background(200); - * - * pos.add(vel); - * - * if (pos.y < 0) { - * pos.y = height; - * } - * - * strokeWeight(5); - * point(pos); - * - * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); - * } - * - *
                                  - */ - - _main.default.prototype.createVector = function (x, y, z) { - if (this instanceof _main.default) { - return _construct( - _main.default.Vector, - [ - this._fromRadians.bind(this), - this._toRadians.bind(this), - ].concat(Array.prototype.slice.call(arguments)), - ); - } else { - return new _main.default.Vector(x, y, z); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.to-string": 206, - }, - ], - 330: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } ////////////////////////////////////////////////////////////// - // http://mrl.nyu.edu/~perlin/noise/ - // Adapting from PApplet.java - // which was adapted from toxi - // which was adapted from the german demo group farbrausch - // as used in their demo "art": http://www.farb-rausch.de/fr010src.zip - // someday we might consider using "improved noise" - // http://mrl.nyu.edu/~perlin/paper445.pdf - // See: https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/ - // blob/main/introduction/Noise1D/noise.js - /** - * @module Math - * @submodule Noise - * @for p5 - * @requires core - */ - - var PERLIN_YWRAPB = 4; - var PERLIN_YWRAP = 1 << PERLIN_YWRAPB; - var PERLIN_ZWRAPB = 8; - var PERLIN_ZWRAP = 1 << PERLIN_ZWRAPB; - var PERLIN_SIZE = 4095; - var perlin_octaves = 4; // default to medium smooth - var perlin_amp_falloff = 0.5; // 50% reduction/octave - var scaled_cosine = function scaled_cosine(i) { - return 0.5 * (1 - Math.cos(i * Math.PI)); - }; - var perlin; // will be initialized lazily by noise() or noiseSeed() - /** - * Returns random numbers that can be tuned to feel more organic. The values - * returned will always be between 0 and 1. - * - * Values returned by random() and - * randomGaussian() can change by large - * amounts between function calls. By contrast, values returned by `noise()` - * can be made "smooth". Calls to `noise()` with similar inputs will produce - * similar outputs. `noise()` is used to create textures, motion, shapes, - * terrains, and so on. Ken Perlin invented `noise()` while animating the - * original Tron film in the 1980s. - * - * `noise()` returns the same value for a given input while a sketch is - * running. It produces different results each time a sketch runs. The - * noiseSeed() function can be used to generate - * the same sequence of Perlin noise values each time a sketch runs. - * - * The character of the noise can be adjusted in two ways. The first way is to - * scale the inputs. `noise()` interprets inputs as coordinates. The sequence - * of noise values will be smoother when the input coordinates are closer. The - * second way is to use the noiseDetail() - * function. - * - * The version of `noise()` with one parameter computes noise values in one - * dimension. This dimension can be thought of as space, as in `noise(x)`, or - * time, as in `noise(t)`. - * - * The version of `noise()` with two parameters computes noise values in two - * dimensions. These dimensions can be thought of as space, as in - * `noise(x, y)`, or space and time, as in `noise(x, t)`. - * - * The version of `noise()` with three parameters computes noise values in - * three dimensions. These dimensions can be thought of as space, as in - * `noise(x, y, z)`, or space and time, as in `noise(x, y, t)`. - * - * @method noise - * @param {Number} x x-coordinate in noise space. - * @param {Number} [y] y-coordinate in noise space. - * @param {Number} [z] z-coordinate in noise space. - * @return {Number} Perlin noise value at specified coordinates. - * @example - *
                                  - * - * function draw() { - * background(200); - * - * let x = 100 * noise(0.005 * frameCount); - * let y = 100 * noise(0.005 * frameCount + 10000); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves randomly on a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let noiseLevel = 100; - * let noiseScale = 0.005; - * // Scale input coordinate. - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let x = noiseLevel * noise(nt); - * let y = noiseLevel * noise(nt + 10000); - * // Render. - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves randomly on a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * let noiseLevel = 100; - * let noiseScale = 0.02; - * // Scale input coordinate. - * let x = frameCount; - * let nx = noiseScale * x; - * // Compute noise value. - * let y = noiseLevel * noise(nx); - * // Render. - * line(x, 0, x, y); - * - * describe('A hilly terrain drawn in gray against a black sky.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let noiseLevel = 100; - * let noiseScale = 0.002; - * for (let x = 0; x < width; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let y = noiseLevel * noise(nx, nt); - * // Render. - * line(x, 0, x, y); - * } - * - * describe('A calm sea drawn in gray against a black sky.'); - * } - * - *
                                  - * - *
                                  - * - * let noiseLevel = 255; - * let noiseScale = 0.01; - * for (let y = 0; y < height; y += 1) { - * for (let x = 0; x < width; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let ny = noiseScale * y; - * // Compute noise value. - * let c = noiseLevel * noise(nx, ny); - * // Render. - * stroke(c); - * point(x, y); - * } - * } - * - * describe('A gray cloudy pattern.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * let noiseLevel = 255; - * let noiseScale = 0.009; - * for (let y = 0; y < height; y += 1) { - * for (let x = 0; x < width; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let ny = noiseScale * y; - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let c = noiseLevel * noise(nx, ny, nt); - * // Render. - * stroke(c); - * point(x, y); - * } - * } - * - * describe('A gray cloudy pattern that changes.'); - * } - * - *
                                  - */ - _main.default.prototype.noise = function (x) { - var y = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var z = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - if (perlin == null) { - perlin = new Array(PERLIN_SIZE + 1); - for (var i = 0; i < PERLIN_SIZE + 1; i++) { - perlin[i] = Math.random(); - } - } - if (x < 0) { - x = -x; - } - if (y < 0) { - y = -y; - } - if (z < 0) { - z = -z; - } - var xi = Math.floor(x), - yi = Math.floor(y), - zi = Math.floor(z); - var xf = x - xi; - var yf = y - yi; - var zf = z - zi; - var rxf, ryf; - var r = 0; - var ampl = 0.5; - var n1, n2, n3; - for (var o = 0; o < perlin_octaves; o++) { - var of = xi + (yi << PERLIN_YWRAPB) + (zi << PERLIN_ZWRAPB); - rxf = scaled_cosine(xf); - ryf = scaled_cosine(yf); - n1 = perlin[of & PERLIN_SIZE]; - n1 += rxf * (perlin[(of + 1) & PERLIN_SIZE] - n1); - n2 = perlin[(of + PERLIN_YWRAP) & PERLIN_SIZE]; - n2 += rxf * (perlin[(of + PERLIN_YWRAP + 1) & PERLIN_SIZE] - n2); - n1 += ryf * (n2 - n1); - of += PERLIN_ZWRAP; - n2 = perlin[of & PERLIN_SIZE]; - n2 += rxf * (perlin[(of + 1) & PERLIN_SIZE] - n2); - n3 = perlin[(of + PERLIN_YWRAP) & PERLIN_SIZE]; - n3 += rxf * (perlin[(of + PERLIN_YWRAP + 1) & PERLIN_SIZE] - n3); - n2 += ryf * (n3 - n2); - n1 += scaled_cosine(zf) * (n2 - n1); - r += n1 * ampl; - ampl *= perlin_amp_falloff; - xi <<= 1; - xf *= 2; - yi <<= 1; - yf *= 2; - zi <<= 1; - zf *= 2; - if (xf >= 1) { - xi++; - xf--; - } - if (yf >= 1) { - yi++; - yf--; - } - if (zf >= 1) { - zi++; - zf--; - } - } - return r; - }; - /** - * Adjusts the character of the noise produced by the - * noise() function. - * - * Perlin noise values are created by adding layers of noise together. The - * noise layers, called octaves, are similar to harmonics in music. Lower - * octaves contribute more to the output signal. They define the overall - * intensity of the noise. Higher octaves create finer-grained details. - * - * By default, noise values are created by combining four octaves. Each higher - * octave contributes half as much (50% less) compared to its predecessor. - * `noiseDetail()` changes the number of octaves and the falloff amount. For - * example, calling `noiseDetail(6, 0.25)` ensures that - * noise() will use six octaves. Each higher octave - * will contribute 25% as much (75% less) compared to its predecessor. Falloff - * values between 0 and 1 are valid. However, falloff values greater than 0.5 - * might result in noise values greater than 1. - * - * @method noiseDetail - * @param {Number} lod number of octaves to be used by the noise. - * @param {Number} falloff falloff factor for each octave. - * @example - *
                                  - * - * let noiseLevel = 255; - * let noiseScale = 0.02; - * for (let y = 0; y < height; y += 1) { - * for (let x = 0; x < width / 2; x += 1) { - * // Scale input coordinates. - * let nx = noiseScale * x; - * let ny = noiseScale * y; - * - * // Compute noise value. - * noiseDetail(6, 0.25); - * let c = noiseLevel * noise(nx, ny); - * // Render left side. - * stroke(c); - * point(x, y); - * - * // Compute noise value. - * noiseDetail(4, 0.5); - * c = noiseLevel * noise(nx, ny); - * // Render right side. - * stroke(c); - * point(x + width / 2, y); - * } - * } - * - * describe('Two gray cloudy patterns. The pattern on the right is cloudier than the pattern on the left.'); - * - *
                                  - */ - _main.default.prototype.noiseDetail = function (lod, falloff) { - if (lod > 0) { - perlin_octaves = lod; - } - if (falloff > 0) { - perlin_amp_falloff = falloff; - } - }; - /** - * Sets the seed value for noise(). By default, - * noise() produces different results each time - * a sketch is run. Calling `noiseSeed()` with a constant - * argument, such as `noiseSeed(99)`, makes noise() - * produce the same results each time a sketch is run. - * - * @method noiseSeed - * @param {Number} seed seed value. - * @example - *
                                  - * - * function setup() { - * noiseSeed(99); - * background(255); - * } - * - * function draw() { - * let noiseLevel = 100; - * let noiseScale = 0.005; - * // Scale input coordinate. - * let nt = noiseScale * frameCount; - * // Compute noise value. - * let x = noiseLevel * noise(nt); - * // Render. - * line(x, 0, x, height); - * - * describe('A black rectangle that grows randomly, first to the right and then to the left.'); - * } - * - *
                                  - */ - _main.default.prototype.noiseSeed = function (seed) { - // Linear Congruential Generator - // Variant of a Lehman Generator - var lcg = (function () { - // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes - // m is basically chosen to be large (as it is the max period) - // and for its relationships to a and c - var m = 4294967296; - // a - 1 should be divisible by m's prime factors - var a = 1664525; - // c and m should be co-prime - var c = 1013904223; - var seed, z; - return { - setSeed: function setSeed(val) { - // pick a random seed if val is undefined or null - // the >>> 0 casts the seed to an unsigned 32-bit integer - z = seed = (val == null ? Math.random() * m : val) >>> 0; - }, - getSeed: function getSeed() { - return seed; - }, - rand: function rand() { - // define the recurrence relationship - z = (a * z + c) % m; - // return a float in [0, 1) - // if z = m then z / m = 0 therefore (z % m) / m < 1 always - return z / m; - }, - }; - })(); - lcg.setSeed(seed); - perlin = new Array(PERLIN_SIZE + 1); - for (var i = 0; i < PERLIN_SIZE + 1; i++) { - perlin[i] = lcg.rand(); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - }, - ], - 331: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.math.sign"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.number.is-finite"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.sub"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.math.sign"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.number.is-finite"); - _dereq_("core-js/modules/es.string.sub"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Math - * @submodule Vector - * @requires constants - */ - /// HELPERS FOR REMAINDER METHOD - - var calculateRemainder2D = function calculateRemainder2D( - xComponent, - yComponent, - ) { - if (xComponent !== 0) { - this.x = this.x % xComponent; - } - if (yComponent !== 0) { - this.y = this.y % yComponent; - } - return this; - }; - var calculateRemainder3D = function calculateRemainder3D( - xComponent, - yComponent, - zComponent, - ) { - if (xComponent !== 0) { - this.x = this.x % xComponent; - } - if (yComponent !== 0) { - this.y = this.y % yComponent; - } - if (zComponent !== 0) { - this.z = this.z % zComponent; - } - return this; - }; - /** - * A class to describe a two or three-dimensional vector. A vector is like an - * arrow pointing in space. Vectors have both magnitude (length) and - * direction. - * - * `p5.Vector` objects are often used to program motion because they simplify - * the math. For example, a moving ball has a position and a velocity. - * Position describes where the ball is in space. The ball's position vector - * extends from the origin to the ball's center. Velocity describes the ball's - * speed and the direction it's moving. If the ball is moving straight up, its - * velocity vector points straight up. Adding the ball's velocity vector to - * its position vector moves it, as in `pos.add(vel)`. Vector math relies on - * methods inside the `p5.Vector` class. - * - * @class p5.Vector - * @constructor - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @example - *
                                  - * - * let p1 = createVector(25, 25); - * let p2 = createVector(75, 75); - * - * strokeWeight(5); - * point(p1); - * point(p2.x, p2.y); - * - * describe('Two black dots on a gray square, one at the top left and the other at the bottom right.'); - * - *
                                  - * - *
                                  - * - * let pos; - * let vel; - * - * function setup() { - * createCanvas(100, 100); - * pos = createVector(width / 2, height); - * vel = createVector(0, -1); - * } - * - * function draw() { - * background(200); - * - * pos.add(vel); - * - * if (pos.y < 0) { - * pos.y = height; - * } - * - * strokeWeight(5); - * point(pos); - * - * describe('A black dot moves from bottom to top on a gray square. The dot reappears at the bottom when it reaches the top.'); - * } - * - *
                                  - */ - _main.default.Vector = /*#__PURE__*/ (function () { - // This is how it comes in with createVector() - // This check if the first argument is a function - function _class() { - _classCallCheck(this, _class); - var x, y, z; - if ( - typeof (arguments.length <= 0 ? undefined : arguments[0]) === - "function" - ) { - this.isPInst = true; - this._fromRadians = - arguments.length <= 0 ? undefined : arguments[0]; - this._toRadians = - arguments.length <= 1 ? undefined : arguments[1]; - x = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - y = (arguments.length <= 3 ? undefined : arguments[3]) || 0; - z = (arguments.length <= 4 ? undefined : arguments[4]) || 0; - // This is what we'll get with new p5.Vector() - } else { - x = (arguments.length <= 0 ? undefined : arguments[0]) || 0; - y = (arguments.length <= 1 ? undefined : arguments[1]) || 0; - z = (arguments.length <= 2 ? undefined : arguments[2]) || 0; - } - - /** - * The x component of the vector - * @type {Number} - * @property x - * @name x - */ - - this.x = x; - /** - * The y component of the vector - * @type {Number} - * @property y - * @name y - */ - this.y = y; - /** - * The z component of the vector - * @type {Number} - * @property z - * @name z - */ - this.z = z; - } /** - * Returns a string representation of a vector. This method is useful for - * printing vectors to the console while debugging. - * @method toString - * @return {String} string representation of the vector. - * @example - *
                                  - * - * function setup() { - * let v = createVector(20, 30); - * // Prints 'p5.Vector Object : [20, 30, 0]'. - * print(v.toString()); - * } - * - *
                                  - */ - - _createClass( - _class, - [ - { - key: "toString", - value: function toString() { - return "p5.Vector Object : [" - .concat(this.x, ", ") - .concat(this.y, ", ") - .concat(this.z, "]"); - } /** - * Sets the `x`, `y`, and `z` components of the vector using separate numbers, - * a p5.Vector object, or an array of numbers. - * Calling `set()` with no arguments sets the vector's components to 0. - * - * @method set - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @chainable - * @example - *
                                  - * - * strokeWeight(5); - * - * // Top left. - * let pos = createVector(25, 25); - * point(pos); - * - * // Top right. - * pos.set(75, 25); - * point(pos); - * - * // Bottom right. - * let p2 = createVector(75, 75); - * pos.set(p2); - * point(pos); - * - * // Bottom left. - * let arr = [25, 75]; - * pos.set(arr); - * point(pos); - * - * describe('Four black dots arranged in a square on a gray background.'); - * - *
                                  - */, - /** - * @method set - * @param {p5.Vector|Number[]} value vector to set. - * @chainable - */ - }, - { - key: "set", - value: function set(x, y, z) { - if (x instanceof _main.default.Vector) { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - return this; - } - if (Array.isArray(x)) { - this.x = x[0] || 0; - this.y = x[1] || 0; - this.z = x[2] || 0; - return this; - } - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - return this; - } /** - * Returns a copy of the p5.Vector object. - * - * @method copy - * @return {p5.Vector} copy of the p5.Vector object. - * @example - *
                                  - * - * let pos = createVector(50, 50); - * let pc = pos.copy(); - * - * strokeWeight(5); - * point(pc); - * - * describe('A black point drawn in the middle of a gray square.'); - * - *
                                  - */, - }, - { - key: "copy", - value: function copy() { - if (this.isPInst) { - return new _main.default.Vector( - this._fromRadians, - this._toRadians, - this.x, - this.y, - this.z, - ); - } else { - return new _main.default.Vector(this.x, this.y, this.z); - } - } /** - * Adds to a vector's `x`, `y`, and `z` components using separate numbers, - * another p5.Vector object, or an array of numbers. - * Calling `add()` with no arguments has no effect. - * - * The static version of `add()`, as in `p5.Vector.add(v2, v1)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method add - * @param {Number} x x component of the vector to be added. - * @param {Number} [y] y component of the vector to be added. - * @param {Number} [z] z component of the vector to be added. - * @chainable - * @example - *
                                  - * - * strokeWeight(5); - * - * // Top left. - * let pos = createVector(25, 25); - * point(pos); - * - * // Top right. - * pos.add(50, 0); - * point(pos); - * - * // Bottom right. - * let p2 = createVector(0, 50); - * pos.add(p2); - * point(pos); - * - * // Bottom left. - * let arr = [-50, 0]; - * pos.add(arr); - * point(pos); - * - * describe('Four black dots arranged in a square on a gray background.'); - * - *
                                  - * - *
                                  - * - * // Top left. - * let p1 = createVector(25, 25); - * - * // Center. - * let p2 = createVector(50, 50); - * - * // Bottom right. - * let p3 = p5.Vector.add(p1, p2); - * - * strokeWeight(5); - * point(p1); - * point(p2); - * point(p3); - * - * describe('Three black dots in a diagonal line from top left to bottom right.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = createVector(-30, 20); - * drawArrow(v1, v2, 'blue'); - * - * let v3 = p5.Vector.add(v1, v2); - * drawArrow(origin, v3, 'purple'); - * - * describe('Three arrows drawn on a gray square. A red arrow extends from the top left corner to the center. A blue arrow extends from the tip of the red arrow. A purple arrow extends from the origin to the tip of the blue arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - /** - * @method add - * @param {p5.Vector|Number[]} value The vector to add - * @chainable - */ - }, - { - key: "add", - value: function add(x, y, z) { - if (x instanceof _main.default.Vector) { - this.x += x.x || 0; - this.y += x.y || 0; - this.z += x.z || 0; - return this; - } - if (Array.isArray(x)) { - this.x += x[0] || 0; - this.y += x[1] || 0; - this.z += x[2] || 0; - return this; - } - this.x += x || 0; - this.y += y || 0; - this.z += z || 0; - return this; - } /** - * Performs modulo (remainder) division with a vector's `x`, `y`, and `z` - * components using separate numbers, another - * p5.Vector object, or an array of numbers. - * - * The static version of `rem()` as in `p5.Vector.rem(v2, v1)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method rem - * @param {Number} x x component of divisor vector. - * @param {Number} y y component of divisor vector. - * @param {Number} z z component of divisor vector. - * @chainable - * @example - *
                                  - * - * let v = createVector(3, 4, 5); - * v.rem(2, 3, 4); - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v1 = createVector(3, 4, 5); - * let v2 = createVector(2, 3, 4); - * v1.rem(v2); - * - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * let v = createVector(3, 4, 5); - * let arr = [2, 3, 4]; - * v.rem(arr); - * - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v1 = createVector(3, 4, 5); - * let v2 = createVector(2, 3, 4); - * let v3 = p5.Vector.rem(v1, v2); - * - * // Prints 'p5.Vector Object : [1, 1, 1]'. - * print(v3.toString()); - * - *
                                  - */, - /** - * @method rem - * @param {p5.Vector | Number[]} value divisor vector. - * @chainable - */ - }, - { - key: "rem", - value: function rem(x, y, z) { - if (x instanceof _main.default.Vector) { - if ([x.x, x.y, x.z].every(Number.isFinite)) { - var xComponent = parseFloat(x.x); - var yComponent = parseFloat(x.y); - var zComponent = parseFloat(x.z); - return calculateRemainder3D.call( - this, - xComponent, - yComponent, - zComponent, - ); - } - } else if (Array.isArray(x)) { - if ( - x.every(function (element) { - return Number.isFinite(element); - }) - ) { - if (x.length === 2) { - return calculateRemainder2D.call(this, x[0], x[1]); - } - if (x.length === 3) { - return calculateRemainder3D.call( - this, - x[0], - x[1], - x[2], - ); - } - } - } else if (arguments.length === 1) { - if (Number.isFinite(arguments[0]) && arguments[0] !== 0) { - this.x = this.x % arguments[0]; - this.y = this.y % arguments[0]; - this.z = this.z % arguments[0]; - return this; - } - } else if (arguments.length === 2) { - var vectorComponents = - Array.prototype.slice.call(arguments); - if ( - vectorComponents.every(function (element) { - return Number.isFinite(element); - }) - ) { - if (vectorComponents.length === 2) { - return calculateRemainder2D.call( - this, - vectorComponents[0], - vectorComponents[1], - ); - } - } - } else if (arguments.length === 3) { - var _vectorComponents = - Array.prototype.slice.call(arguments); - if ( - _vectorComponents.every(function (element) { - return Number.isFinite(element); - }) - ) { - if (_vectorComponents.length === 3) { - return calculateRemainder3D.call( - this, - _vectorComponents[0], - _vectorComponents[1], - _vectorComponents[2], - ); - } - } - } - } /** - * Subtracts from a vector's `x`, `y`, and `z` components using separate - * numbers, another p5.Vector object, or an array of - * numbers. Calling `sub()` with no arguments has no effect. - * - * The static version of `sub()`, as in `p5.Vector.sub(v2, v1)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method sub - * @param {Number} x x component of the vector to subtract. - * @param {Number} [y] y component of the vector to subtract. - * @param {Number} [z] z component of the vector to subtract. - * @chainable - * @example - *
                                  - * - * strokeWeight(5); - * - * // Bottom right. - * let pos = createVector(75, 75); - * point(pos); - * - * // Top right. - * pos.sub(0, 50); - * point(pos); - * - * // Top left. - * let p2 = createVector(50, 0); - * pos.sub(p2); - * point(pos); - * - * // Bottom left. - * let arr = [0, -50]; - * pos.sub(arr); - * point(pos); - * - * describe('Four black dots arranged in a square on a gray background.'); - * - *
                                  - * - *
                                  - * - * // Bottom right. - * let p1 = createVector(75, 75); - * - * // Center. - * let p2 = createVector(50, 50); - * - * // Top left. - * let p3 = p5.Vector.sub(p1, p2); - * - * strokeWeight(5); - * point(p1); - * point(p2); - * point(p3); - * - * describe('Three black dots in a diagonal line from top left to bottom right.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = createVector(20, 70); - * drawArrow(origin, v2, 'blue'); - * - * let v3 = p5.Vector.sub(v2, v1); - * drawArrow(v1, v3, 'purple'); - * - * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - /** - * @method sub - * @param {p5.Vector|Number[]} value the vector to subtract - * @chainable - */ - }, - { - key: "sub", - value: function sub(x, y, z) { - if (x instanceof _main.default.Vector) { - this.x -= x.x || 0; - this.y -= x.y || 0; - this.z -= x.z || 0; - return this; - } - if (Array.isArray(x)) { - this.x -= x[0] || 0; - this.y -= x[1] || 0; - this.z -= x[2] || 0; - return this; - } - this.x -= x || 0; - this.y -= y || 0; - this.z -= z || 0; - return this; - } /** - * Multiplies a vector's `x`, `y`, and `z` components by the same number, - * separate numbers, the components of another - * p5.Vector object, or an array of numbers. Calling - * `mult()` with no arguments has no effect. - * - * The static version of `mult()`, as in `p5.Vector.mult(v, 2)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method mult - * @param {Number} n The number to multiply with the vector - * @chainable - * @example - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * p.mult(2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * p.mult(2, 3); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * let arr = [2, 3]; - * p.mult(arr); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * let p2 = createVector(2, 3); - * p.mult(p2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(25, 25); - * point(p); - * - * let p2 = createVector(2, 3); - * let p3 = p5.Vector.mult(p, p2); - * point(p3); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(25, 25); - * drawArrow(origin, v1, 'red'); - * - * let v2 = p5.Vector.mult(v1, 2); - * drawArrow(origin, v2, 'blue'); - * - * describe('Two arrows extending from the top left corner. The blue arrow is twice the length of the red arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - /** - * @method mult - * @param {Number} x number to multiply with the x component of the vector. - * @param {Number} y number to multiply with the y component of the vector. - * @param {Number} [z] number to multiply with the z component of the vector. - * @chainable - */ - /** - * @method mult - * @param {Number[]} arr array to multiply with the components of the vector. - * @chainable - */ - /** - * @method mult - * @param {p5.Vector} v vector to multiply with the components of the original vector. - * @chainable - */ - }, - { - key: "mult", - value: function mult(x, y, z) { - if (x instanceof _main.default.Vector) { - // new p5.Vector will check that values are valid upon construction but it's possible - // that someone could change the value of a component after creation, which is why we still - // perform this check - if ( - Number.isFinite(x.x) && - Number.isFinite(x.y) && - Number.isFinite(x.z) && - typeof x.x === "number" && - typeof x.y === "number" && - typeof x.z === "number" - ) { - this.x *= x.x; - this.y *= x.y; - this.z *= x.z; - } else { - console.warn( - "p5.Vector.prototype.mult:", - "x contains components that are either undefined or not finite numbers", - ); - } - return this; - } - if (Array.isArray(x)) { - if ( - x.every(function (element) { - return Number.isFinite(element); - }) && - x.every(function (element) { - return typeof element === "number"; - }) - ) { - if (x.length === 1) { - this.x *= x[0]; - this.y *= x[0]; - this.z *= x[0]; - } else if (x.length === 2) { - this.x *= x[0]; - this.y *= x[1]; - } else if (x.length === 3) { - this.x *= x[0]; - this.y *= x[1]; - this.z *= x[2]; - } - } else { - console.warn( - "p5.Vector.prototype.mult:", - "x contains elements that are either undefined or not finite numbers", - ); - } - return this; - } - var vectorComponents = - Array.prototype.slice.call(arguments); - if ( - vectorComponents.every(function (element) { - return Number.isFinite(element); - }) && - vectorComponents.every(function (element) { - return typeof element === "number"; - }) - ) { - if (arguments.length === 1) { - this.x *= x; - this.y *= x; - this.z *= x; - } - if (arguments.length === 2) { - this.x *= x; - this.y *= y; - } - if (arguments.length === 3) { - this.x *= x; - this.y *= y; - this.z *= z; - } - } else { - console.warn( - "p5.Vector.prototype.mult:", - "x, y, or z arguments are either undefined or not a finite number", - ); - } - return this; - } /** - * Divides a vector's `x`, `y`, and `z` components by the same number, - * separate numbers, the components of another - * p5.Vector object, or an array of numbers. Calling - * `div()` with no arguments has no effect. - * - * The static version of `div()`, as in `p5.Vector.div(v, 2)`, returns a new - * p5.Vector object and doesn't change the - * originals. - * - * @method div - * @param {number} n The number to divide the vector by - * @chainable - * @example - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(50, 50); - * point(p); - * - * p.div(2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * p.div(2, 3); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * let arr = [2, 3]; - * p.div(arr); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * let p2 = createVector(2, 3); - * p.div(p2); - * point(p); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(5); - * - * let p = createVector(50, 75); - * point(p); - * - * let p2 = createVector(2, 3); - * let p3 = p5.Vector.div(p, p2); - * point(p3); - * - * describe('Two black dots drawn on a gray square. One dot is in the top left corner and the other is in the bottom center.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = p5.Vector.div(v1, 2); - * drawArrow(origin, v2, 'blue'); - * - * describe('Two arrows extending from the top left corner. The blue arrow is half the length of the red arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - /** - * @method div - * @param {Number} x number to divide with the x component of the vector. - * @param {Number} y number to divide with the y component of the vector. - * @param {Number} [z] number to divide with the z component of the vector. - * @chainable - */ - /** - * @method div - * @param {Number[]} arr array to divide the components of the vector by. - * @chainable - */ - /** - * @method div - * @param {p5.Vector} v vector to divide the components of the original vector by. - * @chainable - */ - }, - { - key: "div", - value: function div(x, y, z) { - if (x instanceof _main.default.Vector) { - // new p5.Vector will check that values are valid upon construction but it's possible - // that someone could change the value of a component after creation, which is why we still - // perform this check - if ( - Number.isFinite(x.x) && - Number.isFinite(x.y) && - Number.isFinite(x.z) && - typeof x.x === "number" && - typeof x.y === "number" && - typeof x.z === "number" - ) { - var isLikely2D = x.z === 0 && this.z === 0; - if ( - x.x === 0 || - x.y === 0 || - (!isLikely2D && x.z === 0) - ) { - console.warn( - "p5.Vector.prototype.div:", - "divide by 0", - ); - return this; - } - this.x /= x.x; - this.y /= x.y; - if (!isLikely2D) { - this.z /= x.z; - } - } else { - console.warn( - "p5.Vector.prototype.div:", - "x contains components that are either undefined or not finite numbers", - ); - } - return this; - } - if (Array.isArray(x)) { - if ( - x.every(function (element) { - return Number.isFinite(element); - }) && - x.every(function (element) { - return typeof element === "number"; - }) - ) { - if ( - x.some(function (element) { - return element === 0; - }) - ) { - console.warn( - "p5.Vector.prototype.div:", - "divide by 0", - ); - return this; - } - if (x.length === 1) { - this.x /= x[0]; - this.y /= x[0]; - this.z /= x[0]; - } else if (x.length === 2) { - this.x /= x[0]; - this.y /= x[1]; - } else if (x.length === 3) { - this.x /= x[0]; - this.y /= x[1]; - this.z /= x[2]; - } - } else { - console.warn( - "p5.Vector.prototype.div:", - "x contains components that are either undefined or not finite numbers", - ); - } - return this; - } - var vectorComponents = - Array.prototype.slice.call(arguments); - if ( - vectorComponents.every(function (element) { - return Number.isFinite(element); - }) && - vectorComponents.every(function (element) { - return typeof element === "number"; - }) - ) { - if ( - vectorComponents.some(function (element) { - return element === 0; - }) - ) { - console.warn("p5.Vector.prototype.div:", "divide by 0"); - return this; - } - if (arguments.length === 1) { - this.x /= x; - this.y /= x; - this.z /= x; - } - if (arguments.length === 2) { - this.x /= x; - this.y /= y; - } - if (arguments.length === 3) { - this.x /= x; - this.y /= y; - this.z /= z; - } - } else { - console.warn( - "p5.Vector.prototype.div:", - "x, y, or z arguments are either undefined or not a finite number", - ); - } - return this; - } /** - * Returns the magnitude (length) of the vector. - * - * @method mag - * @return {Number} magnitude of the vector. - * @example - *
                                  - * - * let p = createVector(30, 40); - * line(0, 0, p.x, p.y); - * - * let m = p.mag(); - * text(m, p.x, p.y); - * - * describe('A diagonal black line extends from the top left corner of a gray square. The number 50 is written at the end of the line.'); - * - *
                                  - */, - }, - { - key: "mag", - value: function mag() { - return Math.sqrt(this.magSq()); - } /** - * Returns the magnitude (length) of the vector squared. - * - * @method magSq - * @return {number} squared magnitude of the vector. - * @example - *
                                  - * - * let p = createVector(30, 40); - * line(0, 0, p.x, p.y); - * - * let m = p.magSq(); - * text(m, p.x, p.y); - * - * describe('A diagonal black line extends from the top left corner of a gray square. The number 2500 is written at the end of the line.'); - * - *
                                  - */, - }, - { - key: "magSq", - value: function magSq() { - var x = this.x; - var y = this.y; - var z = this.z; - return x * x + y * y + z * z; - } /** - * Returns the dot product of two vectors. The dot product is a number that - * describes the overlap between two vectors. Visually, the dot product can be - * thought of as the "shadow" one vector casts on another. The dot product's - * magnitude is largest when two vectors point in the same or opposite - * directions. Its magnitude is 0 when two vectors form a right angle. - * - * The version of `dot()` with one parameter interprets it as another - * p5.Vector object. - * - * The version of `dot()` with multiple parameters interprets them as the - * `x`, `y`, and `z` components of another vector. - * - * The static version of `dot()`, as in `p5.Vector.dot(v1, v2)`, is the same - * as calling `v1.dot(v2)`. - * - * @method dot - * @param {Number} x x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @return {Number} dot product. - * - * @example - *
                                  - * - * let v1 = createVector(3, 4); - * let v2 = createVector(3, 0); - * let dp = v1.dot(v2); - * // Prints "9" to the console. - * print(dp); - * - *
                                  - * - *
                                  - * - * let v1 = createVector(1, 0); - * let v2 = createVector(0, 1); - * let dp = p5.Vector.dot(v1, v2); - * // Prints "0" to the console. - * print(dp); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let v0 = createVector(width / 2, height / 2); - * let v1 = createVector(30, 0); - * drawArrow(v0, v1, 'black'); - * - * let v2 = createVector(mouseX - width / 2, mouseY - height / 2); - * drawArrow(v0, v2, 'red'); - * - * let dp = v2.dot(v1); - * text(`v2 • v1 = ${dp}`, 15, 20); - * - * describe('Two arrows drawn on a gray square. A black arrow points to the right and a red arrow follows the mouse. The text "v1 • v2 = something" changes as the mouse moves.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - /** - * @method dot - * @param {p5.Vector} v p5.Vector to be dotted. - * @return {Number} - */ - }, - { - key: "dot", - value: function dot(x, y, z) { - if (x instanceof _main.default.Vector) { - return this.dot(x.x, x.y, x.z); - } - return ( - this.x * (x || 0) + this.y * (y || 0) + this.z * (z || 0) - ); - } /** - * Returns the cross product of two vectors. The cross product is a vector - * that points straight out of the plane created by two vectors. The cross - * product's magnitude is the area of the parallelogram formed by the original - * two vectors. - * - * The static version of `cross()`, as in `p5.Vector.cross(v1, v2)`, is the same - * as calling `v1.cross(v2)`. - * - * @method cross - * @param {p5.Vector} v p5.Vector to be crossed. - * @return {p5.Vector} cross product as a p5.Vector. - * @example - *
                                  - * - * let v1 = createVector(1, 0); - * let v2 = createVector(3, 4); - * let cp = v1.cross(v2); - * // Prints "p5.Vector Object : [0, 0, 4]" to the console. - * print(cp.toString()); - * - *
                                  - * - *
                                  - * - * let v1 = createVector(1, 0); - * let v2 = createVector(3, 4); - * let cp = p5.Vector.cross(v1, v2); - * // Prints "p5.Vector Object : [0, 0, 4]" to the console. - * print(cp.toString()); - * - *
                                  - */, - }, - { - key: "cross", - value: function cross(v) { - var x = this.y * v.z - this.z * v.y; - var y = this.z * v.x - this.x * v.z; - var z = this.x * v.y - this.y * v.x; - if (this.isPInst) { - return new _main.default.Vector( - this._fromRadians, - this._toRadians, - x, - y, - z, - ); - } else { - return new _main.default.Vector(x, y, z); - } - } /** - * Returns the distance between two points represented by vectors. A point's - * coordinates can be thought of as a vector's components. - * - * The static version of `dist()`, as in `p5.Vector.dist(v1, v2)`, is the same - * as calling `v1.dist(v2)`. - * - * Use dist() to calculate the distance between points - * using coordinates as in `dist(x1, y1, x2, y2)`. - * - * @method dist - * @param {p5.Vector} v x, y, and z coordinates of a p5.Vector. - * @return {Number} distance. - * @example - *
                                  - * - * let v1 = createVector(1, 0); - * let v2 = createVector(0, 1); - * let d = v1.dist(v2); - * // Prints "1.414..." to the console. - * print(d); - * - *
                                  - * - *
                                  - * - * let v1 = createVector(1, 0); - * let v2 = createVector(0, 1); - * let d = p5.Vector.dist(v1, v2); - * // Prints "1.414..." to the console. - * print(d); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v1 = createVector(50, 50); - * drawArrow(origin, v1, 'red'); - * - * let v2 = createVector(20, 70); - * drawArrow(origin, v2, 'blue'); - * - * let v3 = p5.Vector.sub(v2, v1); - * drawArrow(v1, v3, 'purple'); - * - * let m = floor(v3.mag()); - * text(m, 50, 75); - * - * describe('Three arrows drawn on a gray square. A red and a blue arrow extend from the top left. A purple arrow extends from the tip of the red arrow to the tip of the blue arrow. The number 36 is written in black near the purple arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "dist", - value: function dist(v) { - return v.copy().sub(this).mag(); - } /** - * Scales the components of a p5.Vector object so - * that its magnitude is 1. - * - * The static version of `normalize()`, as in `p5.Vector.normalize(v)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method normalize - * @return {p5.Vector} normalized p5.Vector. - * @example - *
                                  - * - * let v = createVector(10, 20, 2); - * v.normalize(); - * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(10, 20, 2); - * let v1 = p5.Vector.normalize(v0); - * // Prints "p5.Vector Object : [10, 20, 2]" to the console. - * print(v0.toString()); - * // Prints "p5.Vector Object : [0.445..., 0.890..., 0.089...]" to the console. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(240); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(mouseX - 50, mouseY - 50); - * - * let r = 25; - * drawArrow(v0, v1, 'red'); - * v1.normalize(); - * drawArrow(v0, v1.mult(r), 'blue'); - * - * noFill(); - * circle(50, 50, r * 2); - * - * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow's length is fixed to the circle's radius."); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "normalize", - value: function normalize() { - var len = this.mag(); - // here we multiply by the reciprocal instead of calling 'div()' - // since div duplicates this zero check. - if (len !== 0) this.mult(1 / len); - return this; - } /** - * Limits a vector's magnitude to a maximum value. - * - * The static version of `limit()`, as in `p5.Vector.limit(v, 5)`, returns a - * new p5.Vector object and doesn't change the - * original. - * - * @method limit - * @param {Number} max maximum magnitude for the vector. - * @chainable - * @example - *
                                  - * - * let v = createVector(10, 20, 2); - * v.limit(5); - * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(10, 20, 2); - * let v1 = p5.Vector.limit(v0, 5); - * // Prints "p5.Vector Object : [2.227..., 4.454..., 0.445...]" to the console. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(240); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(mouseX - 50, mouseY - 50); - * - * let r = 25; - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v1.limit(r), 'blue'); - * - * noFill(); - * circle(50, 50, r * 2); - * - * describe("A red and blue arrow extend from the center of a circle. Both arrows follow the mouse, but the blue arrow never crosses the circle's edge."); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "limit", - value: function limit(max) { - var mSq = this.magSq(); - if (mSq > max * max) { - this.div(Math.sqrt(mSq)) //normalize it - .mult(max); - } - return this; - } /** - * Sets a vector's magnitude to a given value. - * - * The static version of `setMag()`, as in `p5.Vector.setMag(v, 10)`, returns - * a new p5.Vector object and doesn't change the - * original. - * - * @method setMag - * @param {number} len new length for this vector. - * @chainable - * @example - *
                                  - * - * let v = createVector(3, 4, 0); - * // Prints "5" to the console. - * print(v.mag()); - * - * v.setMag(10); - * // Prints "p5.Vector Object : [6, 8, 0]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(3, 4, 0); - * let v1 = p5.Vector.setMag(v0, 10); - * // Prints "5" to the console. - * print(v0.mag()); - * // Prints "p5.Vector Object : [6, 8, 0]" to the console. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(240); - * - * let origin = createVector(0, 0); - * let v = createVector(50, 50); - * - * drawArrow(origin, v, 'red'); - * - * v.setMag(30); - * drawArrow(origin, v, 'blue'); - * - * describe('Two arrows extend from the top left corner of a square toward its center. The red arrow reaches the center and the blue arrow only extends part of the way.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "setMag", - value: function setMag(n) { - return this.normalize().mult(n); - } /** - * Calculates the angle a 2D vector makes with the positive x-axis. Angles - * increase in the clockwise direction. - * - * If the vector was created with - * createVector(), `heading()` returns angles - * in the units of the current angleMode(). - * - * The static version of `heading()`, as in `p5.Vector.heading(v)`, works the - * same way. - * - * @method heading - * @return {Number} angle of rotation. - * @example - *
                                  - * - * let v = createVector(1, 1); - * // Prints "0.785..." to the console. - * print(v.heading()); - * - * angleMode(DEGREES); - * // Prints "45" to the console. - * print(v.heading()); - * - *
                                  - * - *
                                  - * - * let v = createVector(1, 1); - * // Prints "0.785..." to the console. - * print(p5.Vector.heading(v)); - * - * angleMode(DEGREES); - * // Prints "45" to the console. - * print(p5.Vector.heading(v)); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let origin = createVector(0, 0); - * let v = createVector(50, 50); - * - * drawArrow(origin, v, 'black'); - * - * angleMode(RADIANS); - * let h = round(v.heading(), 2); - * text(`Radians: ${h}`, 20, 70); - * angleMode(DEGREES); - * h = v.heading(); - * text(`Degrees: ${h}`, 20, 85); - * - * describe('A black arrow extends from the top left of a square to its center. The text "Radians: 0.79" and "Degrees: 45" is written near the tip of the arrow.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "heading", - value: function heading() { - var h = Math.atan2(this.y, this.x); - if (this.isPInst) return this._fromRadians(h); - return h; - } /** - * Rotates a 2D vector to a specific angle without changing its magnitude. - * By convention, the positive x-axis has an angle of 0. Angles increase in - * the clockwise direction. - * - * If the vector was created with - * createVector(), `setHeading()` uses - * the units of the current angleMode(). - * - * @method setHeading - * @param {number} angle angle of rotation. - * @chainable - * @example - *
                                  - * - * let v = createVector(0, 1); - * // Prints "1.570..." to the console. - * print(v.heading()); - * - * v.setHeading(PI); - * // Prints "3.141..." to the console. - * print(v.heading()); - * - *
                                  - * - *
                                  - * - * angleMode(DEGREES); - * let v = createVector(0, 1); - * // Prints "90" to the console. - * print(v.heading()); - * - * v.setHeading(180); - * // Prints "180" to the console. - * print(v.heading()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 0); - * - * drawArrow(v0, v1, 'red'); - * - * v1.setHeading(HALF_PI); - * drawArrow(v0, v1, 'blue'); - * - * describe('Two arrows extend from the center of a gray square. The red arrow points to the right and the blue arrow points down.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "setHeading", - value: function setHeading(a) { - if (this.isPInst) a = this._toRadians(a); - var m = this.mag(); - this.x = m * Math.cos(a); - this.y = m * Math.sin(a); - return this; - } /** - * Rotates a 2D vector by an angle without changing its magnitude. - * By convention, the positive x-axis has an angle of 0. Angles increase in - * the clockwise direction. - * - * If the vector was created with - * createVector(), `rotate()` uses - * the units of the current angleMode(). - * - * The static version of `rotate()`, as in `p5.Vector.rotate(v, PI)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method rotate - * @param {number} angle angle of rotation. - * @chainable - * @example - *
                                  - * - * let v = createVector(1, 0); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v.toString()); - * v.rotate(HALF_PI); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * angleMode(DEGREES); - * let v = createVector(1, 0); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v.toString()); - * v.rotate(90); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(1, 0); - * let v1 = p5.Vector.rotate(v0, HALF_PI); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v0.toString()); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * angleMode(DEGREES); - * let v0 = createVector(1, 0); - * let v1 = p5.Vector.rotate(v0, 90); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v0.toString()); - * // Prints "p5.Vector Object : [0, 1, 0]" to the console. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * let v0; - * let v1; - * - * function setup() { - * v0 = createVector(50, 50); - * v1 = createVector(30, 0); - * } - * - * function draw() { - * background(240); - * - * v1.rotate(0.01); - * - * drawArrow(v0, v1, 'black'); - * - * describe('A black arrow extends from the center of a gray square. The arrow rotates counterclockwise.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "rotate", - value: function rotate(a) { - var newHeading = this.heading() + a; - if (this.isPInst) newHeading = this._toRadians(newHeading); - var mag = this.mag(); - this.x = Math.cos(newHeading) * mag; - this.y = Math.sin(newHeading) * mag; - return this; - } /** - * Returns the angle between two vectors. The angles returned are signed, - * which means that `v1.angleBetween(v2) === -v2.angleBetween(v1)`. - * - * If the vector was created with - * createVector(), `angleBetween()` returns - * angles in the units of the current - * angleMode(). - * - * @method angleBetween - * @param {p5.Vector} value x, y, and z components of a p5.Vector. - * @return {Number} angle between the vectors. - * @example - *
                                  - * - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "1.570..." to the console. - * print(v0.angleBetween(v1)); - * // Prints "-1.570..." to the console. - * print(v1.angleBetween(v0)); - * - *
                                  - * - *
                                  - * - * angleMode(DEGREES); - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "90" to the console. - * print(v0.angleBetween(v1)); - * // Prints "-90" to the console. - * print(v1.angleBetween(v0)); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "1.570..." to the console. - * print(p5.Vector.angleBetween(v0, v1)); - * // Prints "-1.570..." to the console. - * print(p5.Vector.angleBetween(v1, v0)); - * - *
                                  - * - *
                                  - * - * angleMode(DEGREES); - * let v0 = createVector(1, 0); - * let v1 = createVector(0, 1); - * // Prints "90" to the console. - * print(p5.Vector.angleBetween(v0, v1)); - * // Prints "-90" to the console. - * print(p5.Vector.angleBetween(v1, v0)); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 0); - * let v2 = createVector(0, 30); - * - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * - * angleMode(RADIANS); - * let angle = round(v1.angleBetween(v2), 2); - * text(`Radians: ${angle}`, 20, 20); - * angleMode(DEGREES); - * angle = round(v1.angleBetween(v2), 2); - * text(`Degrees: ${angle}`, 20, 35); - * - * describe('Two arrows extend from the center of a gray square. A red arrow points to the right and a blue arrow points down. The text "Radians: 1.57" and "Degrees: 90" is written above the arrows.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "angleBetween", - value: function angleBetween(v) { - var magSqMult = this.magSq() * v.magSq(); - // Returns NaN if either vector is the zero vector. - if (magSqMult === 0) { - return NaN; - } - var u = this.cross(v); - // The dot product computes the cos value, and the cross product computes - // the sin value. Find the angle based on them. In addition, in the case of - // 2D vectors, a sign is added according to the direction of the vector. - var angle = - Math.atan2(u.mag(), this.dot(v)) * Math.sign(u.z || 1); - if (this.isPInst) { - angle = this._fromRadians(angle); - } - return angle; - } /** - * Calculates new `x`, `y`, and `z` components that are proportionally the - * same distance between two vectors. The `amt` parameter is the amount to - * interpolate between the old vector and the new vector. 0.0 keeps all - * components equal to the old vector's, 0.5 is halfway between, and 1.0 sets - * all components equal to the new vector's. - * - * The static version of `lerp()`, as in `p5.Vector.lerp(v0, v1, 0.5)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method lerp - * @param {Number} x x component. - * @param {Number} y y component. - * @param {Number} z z component. - * @param {Number} amt amount of interpolation between 0.0 (old vector) - * and 1.0 (new vector). 0.5 is halfway between. - * @chainable - * - * @example - *
                                  - * - * let v0 = createVector(1, 1, 1); - * let v1 = createVector(3, 3, 3); - * v0.lerp(v1, 0.5); - * // Prints "p5.Vector Object : [2, 2, 2]" to the console. - * print(v0.toString()); - * - *
                                  - * - *
                                  - * - * let v = createVector(1, 1, 1); - * v.lerp(3, 3, 3, 0.5); - * // Prints "p5.Vector Object : [2, 2, 2]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(1, 1, 1); - * let v1 = createVector(3, 3, 3); - * let v2 = p5.Vector.lerp(v0, v1, 0.5); - * // Prints "p5.Vector Object : [2, 2, 2]" to the console. - * print(v2.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 0); - * let v2 = createVector(0, 30); - * let v3 = p5.Vector.lerp(v1, v2, 0.5); - * - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * drawArrow(v0, v3, 'purple'); - * - * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points down, and a purple arrow points to the bottom right.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - /** - * @method lerp - * @param {p5.Vector} v p5.Vector to lerp toward. - * @param {Number} amt - * @chainable - */ - }, - { - key: "lerp", - value: function lerp(x, y, z, amt) { - if (x instanceof _main.default.Vector) { - return this.lerp(x.x, x.y, x.z, y); - } - this.x += (x - this.x) * amt || 0; - this.y += (y - this.y) * amt || 0; - this.z += (z - this.z) * amt || 0; - return this; - } /** - * Calculates a new heading and magnitude that are between two vectors. The - * `amt` parameter is the amount to interpolate between the old vector and - * the new vector. 0.0 keeps the heading and magnitude equal to the old - * vector's, 0.5 sets them halfway between, and 1.0 sets the heading and - * magnitude equal to the new vector's. - * - * `slerp()` differs from lerp() because - * it interpolates magnitude. Calling `v0.slerp(v1, 0.5)` sets `v0`'s - * magnitude to a value halfway between its original magnitude and `v1`'s. - * Calling `v0.lerp(v1, 0.5)` makes no such guarantee. - * - * The static version of `slerp()`, as in `p5.Vector.slerp(v0, v1, 0.5)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method slerp - * @param {p5.Vector} v p5.Vector to slerp toward. - * @param {Number} amt amount of interpolation between 0.0 (old vector) - * and 1.0 (new vector). 0.5 is halfway between. - * @return {p5.Vector} - * - * @example - *
                                  - * - * let v0 = createVector(3, 0); - * // Prints "3" to the console. - * print(v0.mag()); - * // Prints "0" to the console. - * print(v0.heading()); - * - * let v1 = createVector(0, 1); - * // Prints "1" to the console. - * print(v1.mag()); - * // Prints "1.570..." to the console. - * print(v1.heading()); - * - * v0.slerp(v1, 0.5); - * // Prints "2" to the console. - * print(v0.mag()); - * // Prints "0.785..." to the console. - * print(v0.heading()); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(3, 0); - * // Prints "3" to the console. - * print(v0.mag()); - * // Prints "0" to the console. - * print(v0.heading()); - * - * let v1 = createVector(0, 1); - * // Prints "1" to the console. - * print(v1.mag()); - * // Prints "1.570..." to the console. - * print(v1.heading()); - * - * let v3 = p5.Vector.slerp(v0, v1, 0.5); - * // Prints "2" to the console. - * print(v3.mag()); - * // Prints "0.785..." to the console. - * print(v3.heading()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(20, 0); - * let v2 = createVector(-40, 0); - * let v3 = p5.Vector.slerp(v1, v2, 0.5); - * - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * drawArrow(v0, v3, 'purple'); - * - * describe('Three arrows extend from the center of a gray square. A red arrow points to the right, a blue arrow points to the left, and a purple arrow points down.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "slerp", - value: function slerp(v, amt) { - // edge cases. - if (amt === 0) { - return this; - } - if (amt === 1) { - return this.set(v); - } // calculate magnitudes - - var selfMag = this.mag(); - var vMag = v.mag(); - var magmag = selfMag * vMag; - // if either is a zero vector, linearly interpolate by these vectors - if (magmag === 0) { - this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); - return this; - } // the cross product of 'this' and 'v' is the axis of rotation - - var axis = this.cross(v); - var axisMag = axis.mag(); - // Calculates the angle between 'this' and 'v' - var theta = Math.atan2(axisMag, this.dot(v)); - // However, if the norm of axis is 0, normalization cannot be performed, - // so we will divide the cases - if (axisMag > 0) { - axis.x /= axisMag; - axis.y /= axisMag; - axis.z /= axisMag; - } else if (theta < Math.PI * 0.5) { - // if the norm is 0 and the angle is less than PI/2, - // the angle is very close to 0, so do linear interpolation. - this.mult(1 - amt).add(v.x * amt, v.y * amt, v.z * amt); - return this; - } else { - // If the norm is 0 and the angle is more than PI/2, the angle is - // very close to PI. - // In this case v can be regarded as '-this', so take any vector - // that is orthogonal to 'this' and use that as the axis. - if (this.z === 0 && v.z === 0) { - // if both this and v are 2D vectors, use (0,0,1) - // this makes the result also a 2D vector. - axis.set(0, 0, 1); - } else if (this.x !== 0) { - // if the x components is not 0, use (y, -x, 0) - axis.set(this.y, -this.x, 0).normalize(); - } else { - // if the x components is 0, use (1,0,0) - axis.set(1, 0, 0); - } - } // Since 'axis' is a unit vector, ey is a vector of the same length as 'this'. - - var ey = axis.cross(this); - // interpolate the length with 'this' and 'v'. - var lerpedMagFactor = 1 - amt + (amt * vMag) / selfMag; - // imagine a situation where 'axis', 'this', and 'ey' are pointing - // along the z, x, and y axes, respectively. - // rotates 'this' around 'axis' by amt * theta towards 'ey'. - var cosMultiplier = lerpedMagFactor * Math.cos(amt * theta); - var sinMultiplier = lerpedMagFactor * Math.sin(amt * theta); - // then, calculate 'result'. - this.x = this.x * cosMultiplier + ey.x * sinMultiplier; - this.y = this.y * cosMultiplier + ey.y * sinMultiplier; - this.z = this.z * cosMultiplier + ey.z * sinMultiplier; - return this; - } /** - * Reflects a vector about a line in 2D or a plane in 3D. The orientation of - * the line or plane is described by a normal vector that points away from the - * shape. - * - * The static version of `reflect()`, as in `p5.Vector.reflect(v, n)`, - * returns a new p5.Vector object and doesn't change - * the original. - * - * @method reflect - * @param {p5.Vector} surfaceNormal p5.Vector - * to reflect about. - * @chainable - * @example - *
                                  - * - * let n = createVector(0, 1); - * let v = createVector(4, 6); - * v.reflect(n); - * // Prints "p5.Vector Object : [4, -6, 0]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * let n = createVector(0, 1); - * let v0 = createVector(4, 6); - * let v1 = p5.Vector.reflect(v0, n); - * // Prints "p5.Vector Object : [4, -6, 0]" to the console. - * print(v1.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * line(50, 0, 50, 100); - * let n = createVector(1, 0); - * - * let v0 = createVector(50, 50); - * let v1 = createVector(30, 40); - * let v2 = p5.Vector.reflect(v1, n); - * - * n.setMag(30); - * drawArrow(v0, n, 'black'); - * drawArrow(v0, v1, 'red'); - * drawArrow(v0, v2, 'blue'); - * - * describe('Three arrows extend from the center of a gray square with a vertical line down its middle. A black arrow points to the right, a blue arrow points to the bottom left, and a red arrow points to the bottom right.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "reflect", - value: function reflect(surfaceNormal) { - surfaceNormal.normalize(); - return this.sub( - surfaceNormal.mult(2 * this.dot(surfaceNormal)), - ); - } /** - * Returns the vector's components as an array of numbers. - * - * @method array - * @return {Number[]} array with the vector's components. - * @example - *
                                  - * - * let v = createVector(20, 30); - * // Prints "[20, 30, 0]" to the console. - * print(v.array()); - * - *
                                  - */, - }, - { - key: "array", - value: function array() { - return [this.x || 0, this.y || 0, this.z || 0]; - } /** - * Returns `true` if the vector's components are all the same as another - * vector's and `false` if not. - * - * The version of `equals()` with one parameter interprets it as another - * p5.Vector object. - * - * The version of `equals()` with multiple parameters interprets them as the - * components of another vector. Any missing parameters are assigned the value - * 0. - * - * The static version of `equals()`, as in `p5.Vector.equals(v0, v1)`, - * interprets both parameters as p5.Vector objects. - * - * @method equals - * @param {Number} [x] x component of the vector. - * @param {Number} [y] y component of the vector. - * @param {Number} [z] z component of the vector. - * @return {Boolean} whether the vectors are equal. - * @example - *
                                  - * - * let v0 = createVector(10, 20, 30); - * let v1 = createVector(10, 20, 30); - * let v2 = createVector(0, 0, 0); - * - * // Prints "true" to the console. - * print(v0.equals(v1)); - * // Prints "false" to the console. - * print(v0.equals(v2)); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(5, 10, 20); - * let v1 = createVector(5, 10, 20); - * let v2 = createVector(13, 10, 19); - * - * // Prints "true" to the console. - * print(v0.equals(v1.x, v1.y, v1.z)); - * // Prints "false" to the console. - * print(v0.equals(v2.x, v2.y, v2.z)); - * - *
                                  - * - *
                                  - * - * let v0 = createVector(10, 20, 30); - * let v1 = createVector(10, 20, 30); - * let v2 = createVector(0, 0, 0); - * - * // Prints "true" to the console. - * print(p5.Vector.equals(v0, v1)); - * // Prints "false" to the console. - * print(p5.Vector.equals(v0, v2)); - * - *
                                  - */, - /** - * @method equals - * @param {p5.Vector|Array} value vector to compare. - * @return {Boolean} - */ - }, - { - key: "equals", - value: function equals(x, y, z) { - var a, b, c; - if (x instanceof _main.default.Vector) { - a = x.x || 0; - b = x.y || 0; - c = x.z || 0; - } else if (Array.isArray(x)) { - a = x[0] || 0; - b = x[1] || 0; - c = x[2] || 0; - } else { - a = x || 0; - b = y || 0; - c = z || 0; - } - return this.x === a && this.y === b && this.z === c; - }, // Static Methods - /** - * Make a new 2D vector from an angle. - * - * @method fromAngle - * @static - * @param {Number} angle desired angle, in radians. Unaffected by angleMode(). - * @param {Number} [length] length of the new vector (defaults to 1). - * @return {p5.Vector} new p5.Vector object. - * @example - *
                                  - * - * let v = p5.Vector.fromAngle(0); - * // Prints "p5.Vector Object : [1, 0, 0]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * let v0 = createVector(50, 50); - * let v1 = p5.Vector.fromAngle(0, 30); - * - * drawArrow(v0, v1, 'black'); - * - * describe('A black arrow extends from the center of a gray square. It points to the right.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */ - }, - ], - [ - { - key: "fromAngle", - value: function fromAngle(angle, length) { - if (typeof length === "undefined") { - length = 1; - } - return new _main.default.Vector( - length * Math.cos(angle), - length * Math.sin(angle), - 0, - ); - } /** - * Make a new 3D vector from a pair of ISO spherical angles. - * - * @method fromAngles - * @static - * @param {Number} theta polar angle in radians (zero is up). - * @param {Number} phi azimuthal angle in radians - * (zero is out of the screen). - * @param {Number} [length] length of the new vector (defaults to 1). - * @return {p5.Vector} new p5.Vector object. - * @example - *
                                  - * - * let v = p5.Vector.fromAngles(0, 0); - * // Prints "p5.Vector Object : [0, -1, 0]" to the console. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(0); - * - * fill(255); - * noStroke(); - * - * let theta = frameCount * 0.05; - * let phi = 0; - * let v = p5.Vector.fromAngles(theta, phi, 100); - * let c = color('deeppink'); - * pointLight(c, v); - * - * sphere(35); - * - * describe('A light shines on a pink sphere as it orbits.'); - * } - * - *
                                  - */, - }, - { - key: "fromAngles", - value: function fromAngles(theta, phi, length) { - if (typeof length === "undefined") { - length = 1; - } - var cosPhi = Math.cos(phi); - var sinPhi = Math.sin(phi); - var cosTheta = Math.cos(theta); - var sinTheta = Math.sin(theta); - return new _main.default.Vector( - length * sinTheta * sinPhi, - -length * cosTheta, - length * sinTheta * cosPhi, - ); - } /** - * Make a new 2D unit vector with a random heading. - * - * @method random2D - * @static - * @return {p5.Vector} new p5.Vector object. - * @example - *
                                  - * - * let v = p5.Vector.random2D(); - * // Prints "p5.Vector Object : [x, y, 0]" to the console - * // where x and y are small random numbers. - * print(v.toString()); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * frameRate(1); - * - * let v0 = createVector(50, 50); - * let v1 = p5.Vector.random2D(); - * v1.mult(30); - * drawArrow(v0, v1, 'black'); - * - * describe('A black arrow in extends from the center of a gray square. It changes direction once per second.'); - * } - * - * function drawArrow(base, vec, myColor) { - * push(); - * stroke(myColor); - * strokeWeight(3); - * fill(myColor); - * translate(base.x, base.y); - * line(0, 0, vec.x, vec.y); - * rotate(vec.heading()); - * let arrowSize = 7; - * translate(vec.mag() - arrowSize, 0); - * triangle(0, arrowSize / 2, 0, -arrowSize / 2, arrowSize, 0); - * pop(); - * } - * - *
                                  - */, - }, - { - key: "random2D", - value: function random2D() { - return this.fromAngle(Math.random() * constants.TWO_PI); - } /** - * Make a new 3D unit vector with a random heading. - * - * @method random3D - * @static - * @return {p5.Vector} new p5.Vector object. - * @example - *
                                  - * - * let v = p5.Vector.random3D(); - * // Prints "p5.Vector Object : [x, y, z]" to the console - * // where x, y, and z are small random numbers. - * print(v.toString()); - * - *
                                  - */, - }, - { - key: "random3D", - value: function random3D() { - var angle = Math.random() * constants.TWO_PI; - var vz = Math.random() * 2 - 1; - var vzBase = Math.sqrt(1 - vz * vz); - var vx = vzBase * Math.cos(angle); - var vy = vzBase * Math.sin(angle); - return new _main.default.Vector(vx, vy, vz); - }, // Returns a copy of a vector. - /** - * @method copy - * @static - * @param {p5.Vector} v the p5.Vector to create a copy of - * @return {p5.Vector} the copy of the p5.Vector object - */ - }, - { - key: "copy", - value: function copy(v) { - return v.copy(v); - }, // Adds two vectors together and returns a new one. - /** - * @method add - * @static - * @param {p5.Vector} v1 A p5.Vector to add - * @param {p5.Vector} v2 A p5.Vector to add - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} resulting p5.Vector. - */ - }, - { - key: "add", - value: function add(v1, v2, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 3) { - _main.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.add", - ); - } - } else { - target.set(v1); - } - target.add(v2); - return target; - }, // Returns a vector remainder when it is divided by another vector - /** - * @method rem - * @static - * @param {p5.Vector} v1 The dividend p5.Vector - * @param {p5.Vector} v2 The divisor p5.Vector - */ - /** - * @method rem - * @static - * @param {p5.Vector} v1 - * @param {p5.Vector} v2 - * @return {p5.Vector} The resulting p5.Vector - */ - }, - { - key: "rem", - value: function rem(v1, v2) { - if ( - v1 instanceof _main.default.Vector && - v2 instanceof _main.default.Vector - ) { - var target = v1.copy(); - target.rem(v2); - return target; - } - } /* - * Subtracts one p5.Vector from another and returns a new one. The second - * vector (`v2`) is subtracted from the first (`v1`), resulting in `v1-v2`. - */, - /** - * @method sub - * @static - * @param {p5.Vector} v1 A p5.Vector to subtract from - * @param {p5.Vector} v2 A p5.Vector to subtract - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} The resulting p5.Vector - */ - }, - { - key: "sub", - value: function sub(v1, v2, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 3) { - _main.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.sub", - ); - } - } else { - target.set(v1); - } - target.sub(v2); - return target; - } /** - * Multiplies a vector by a scalar and returns a new vector. - */, - /** - * @method mult - * @static - * @param {Number} x - * @param {Number} y - * @param {Number} [z] - * @return {p5.Vector} resulting new p5.Vector. - */ - /** - * @method mult - * @static - * @param {p5.Vector} v - * @param {Number} n - * @param {p5.Vector} [target] vector to receive the result. - */ - /** - * @method mult - * @static - * @param {p5.Vector} v0 - * @param {p5.Vector} v1 - * @param {p5.Vector} [target] - */ - /** - * @method mult - * @static - * @param {p5.Vector} v0 - * @param {Number[]} arr - * @param {p5.Vector} [target] - */ - }, - { - key: "mult", - value: function mult(v, n, target) { - if (!target) { - target = v.copy(); - if (arguments.length === 3) { - _main.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.mult", - ); - } - } else { - target.set(v); - } - target.mult(n); - return target; - } /** - * Rotates the vector (only 2D vectors) by the given angle; magnitude remains the same. Returns a new vector. - */, - /** - * @method rotate - * @static - * @param {p5.Vector} v - * @param {Number} angle - * @param {p5.Vector} [target] The vector to receive the result - */ - }, - { - key: "rotate", - value: function rotate(v, a, target) { - if (arguments.length === 2) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.rotate", - ); - } - target.set(v); - } - target.rotate(a); - return target; - } /** - * Divides a vector by a scalar and returns a new vector. - */, - /** - * @method div - * @static - * @param {Number} x - * @param {Number} y - * @param {Number} [z] - * @return {p5.Vector} The resulting new p5.Vector - */ - /** - * @method div - * @static - * @param {p5.Vector} v - * @param {Number} n - * @param {p5.Vector} [target] The vector to receive the result - */ - /** - * @method div - * @static - * @param {p5.Vector} v0 - * @param {p5.Vector} v1 - * @param {p5.Vector} [target] - */ - /** - * @method div - * @static - * @param {p5.Vector} v0 - * @param {Number[]} arr - * @param {p5.Vector} [target] - */ - }, - { - key: "div", - value: function div(v, n, target) { - if (!target) { - target = v.copy(); - if (arguments.length === 3) { - _main.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.div", - ); - } - } else { - target.set(v); - } - target.div(n); - return target; - } /** - * Calculates the dot product of two vectors. - */, - /** - * @method dot - * @static - * @param {p5.Vector} v1 first p5.Vector. - * @param {p5.Vector} v2 second p5.Vector. - * @return {Number} dot product. - */ - }, - { - key: "dot", - value: function dot(v1, v2) { - return v1.dot(v2); - } /** - * Calculates the cross product of two vectors. - */, - /** - * @method cross - * @static - * @param {p5.Vector} v1 first p5.Vector. - * @param {p5.Vector} v2 second p5.Vector. - * @return {Number} cross product. - */ - }, - { - key: "cross", - value: function cross(v1, v2) { - return v1.cross(v2); - } /** - * Calculates the Euclidean distance between two points (considering a - * point as a vector object). - */, - /** - * @method dist - * @static - * @param {p5.Vector} v1 The first p5.Vector - * @param {p5.Vector} v2 The second p5.Vector - * @return {Number} The distance - */ - }, - { - key: "dist", - value: function dist(v1, v2) { - return v1.dist(v2); - } /** - * Linear interpolate a vector to another vector and return the result as a - * new vector. - */, - /** - * @method lerp - * @static - * @param {p5.Vector} v1 - * @param {p5.Vector} v2 - * @param {Number} amt - * @param {p5.Vector} [target] The vector to receive the result - * @return {p5.Vector} The lerped value - */ - }, - { - key: "lerp", - value: function lerp(v1, v2, amt, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 4) { - _main.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.lerp", - ); - } - } else { - target.set(v1); - } - target.lerp(v2, amt); - return target; - } /** - * Performs spherical linear interpolation with the other vector - * and returns the resulting vector. - * This works in both 3D and 2D. As for 2D, the result of slerping - * between 2D vectors is always a 2D vector. - */, - /** - * @method slerp - * @static - * @param {p5.Vector} v1 old vector. - * @param {p5.Vector} v2 new vector. - * @param {Number} amt - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} slerped vector between v1 and v2 - */ - }, - { - key: "slerp", - value: function slerp(v1, v2, amt, target) { - if (!target) { - target = v1.copy(); - if (arguments.length === 4) { - _main.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.slerp", - ); - } - } else { - target.set(v1); - } - target.slerp(v2, amt); - return target; - } /** - * Calculates the magnitude (length) of the vector and returns the result as - * a float (this is simply the equation `sqrt(x*x + y*y + z*z)`.) - */, - /** - * @method mag - * @static - * @param {p5.Vector} vecT The vector to return the magnitude of - * @return {Number} The magnitude of vecT - */ - }, - { - key: "mag", - value: function mag(vecT) { - return vecT.mag(); - } /** - * Calculates the squared magnitude of the vector and returns the result - * as a float (this is simply the equation (x\*x + y\*y + z\*z).) - * Faster if the real length is not required in the - * case of comparing vectors, etc. - */, - /** - * @method magSq - * @static - * @param {p5.Vector} vecT the vector to return the squared magnitude of - * @return {Number} the squared magnitude of vecT - */ - }, - { - key: "magSq", - value: function magSq(vecT) { - return vecT.magSq(); - } /** - * Normalize the vector to length 1 (make it a unit vector). - */, - /** - * @method normalize - * @static - * @param {p5.Vector} v The vector to normalize - * @param {p5.Vector} [target] The vector to receive the result - * @return {p5.Vector} The vector v, normalized to a length of 1 - */ - }, - { - key: "normalize", - value: function normalize(v, target) { - if (arguments.length < 2) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.normalize", - ); - } - target.set(v); - } - return target.normalize(); - } /** - * Limit the magnitude of the vector to the value used for the max - * parameter. - */, - /** - * @method limit - * @static - * @param {p5.Vector} v the vector to limit - * @param {Number} max - * @param {p5.Vector} [target] the vector to receive the result (Optional) - * @return {p5.Vector} v with a magnitude limited to max - */ - }, - { - key: "limit", - value: function limit(v, max, target) { - if (arguments.length < 3) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.limit", - ); - } - target.set(v); - } - return target.limit(max); - } /** - * Set the magnitude of the vector to the value used for the len - * parameter. - */, - /** - * @method setMag - * @static - * @param {p5.Vector} v the vector to set the magnitude of - * @param {number} len - * @param {p5.Vector} [target] the vector to receive the result (Optional) - * @return {p5.Vector} v with a magnitude set to len - */ - }, - { - key: "setMag", - value: function setMag(v, len, target) { - if (arguments.length < 3) { - target = v.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.setMag", - ); - } - target.set(v); - } - return target.setMag(len); - } /** - * Calculate the angle of rotation for this vector (only 2D vectors). - * p5.Vectors created using createVector() - * will take the current angleMode into - * consideration, and give the angle in radians or degrees accordingly. - */, - /** - * @method heading - * @static - * @param {p5.Vector} v the vector to find the angle of - * @return {Number} the angle of rotation - */ - }, - { - key: "heading", - value: function heading(v) { - return v.heading(); - } /** - * Calculates and returns the angle between two vectors. This function will take - * the angleMode on v1 into consideration, and - * give the angle in radians or degrees accordingly. - */, - /** - * @method angleBetween - * @static - * @param {p5.Vector} v1 the first vector. - * @param {p5.Vector} v2 the second vector. - * @return {Number} angle between the two vectors. - */ - }, - { - key: "angleBetween", - value: function angleBetween(v1, v2) { - return v1.angleBetween(v2); - } /** - * Reflect a vector about a normal to a line in 2D, or about a normal to a - * plane in 3D. - */, - /** - * @method reflect - * @static - * @param {p5.Vector} incidentVector vector to be reflected. - * @param {p5.Vector} surfaceNormal - * @param {p5.Vector} [target] vector to receive the result. - * @return {p5.Vector} the reflected vector - */ - }, - { - key: "reflect", - value: function reflect( - incidentVector, - surfaceNormal, - target, - ) { - if (arguments.length < 3) { - target = incidentVector.copy(); - } else { - if (!(target instanceof _main.default.Vector)) { - _main.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.reflect", - ); - } - target.set(incidentVector); - } - return target.reflect(surfaceNormal); - } /** - * Return a representation of this vector as a float array. This is only - * for temporary use. If used in any other fashion, the contents should be - * copied by using the p5.Vector.copy() - * method to copy into your own vector. - */, - /** - * @method array - * @static - * @param {p5.Vector} v the vector to convert to an array - * @return {Number[]} an Array with the 3 values - */ - }, - { - key: "array", - value: function array(v) { - return v.array(); - } /** - * Equality check against a p5.Vector - */, - /** - * @method equals - * @static - * @param {p5.Vector|Array} v1 the first vector to compare - * @param {p5.Vector|Array} v2 the second vector to compare - * @return {Boolean} - */ - }, - { - key: "equals", - value: function equals(v1, v2) { - var v; - if (v1 instanceof _main.default.Vector) { - v = v1; - } else if (v1 instanceof Array) { - v = new _main.default.Vector().set(v1); - } else { - _main.default._friendlyError( - "The v1 parameter should be of type Array or p5.Vector", - "p5.Vector.equals", - ); - } - return v.equals(v2); - }, - }, - ], - ); - return _class; - })(); - var _default = _main.default.Vector; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.every": 171, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.some": 184, - "core-js/modules/es.math.sign": 190, - "core-js/modules/es.number.constructor": 191, - "core-js/modules/es.number.is-finite": 192, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.sub": 218, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 332: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Math - * @submodule Random - * @for p5 - * @requires core - */ - // variables used for random number generators - - var randomStateProp = "_lcg_random_state"; - // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes - // m is basically chosen to be large (as it is the max period) - // and for its relationships to a and c - var m = 4294967296; - // a - 1 should be divisible by m's prime factors - var a = 1664525; - // c and m should be co-prime - var c = 1013904223; - var y2 = 0; - // Linear Congruential Generator that stores its state at instance[stateProperty] - _main.default.prototype._lcg = function (stateProperty) { - // define the recurrence relationship - this[stateProperty] = (a * this[stateProperty] + c) % m; - // return a float in [0, 1) - // we've just used % m, so / m is always < 1 - return this[stateProperty] / m; - }; - _main.default.prototype._lcgSetSeed = function (stateProperty, val) { - // pick a random seed if val is undefined or null - // the >>> 0 casts the seed to an unsigned 32-bit integer - this[stateProperty] = (val == null ? Math.random() * m : val) >>> 0; - }; - /** - * Sets the seed value for random() and - * randomGaussian(). By default, - * random() and - * randomGaussian() produce different - * results each time a sketch is run. Calling `randomSeed()` with a constant - * argument, such as `randomSeed(99)`, makes these functions produce the same - * results each time a sketch is run. - * - * @method randomSeed - * @param {Number} seed seed value. - * @example - *
                                  - * - * let x = random(width); - * let y = random(height); - * circle(x, y, 10); - * - * randomSeed(99); - * x = random(width); - * y = random(height); - * fill(0); - * circle(x, y, 10); - * - * describe('A white circle appears at a random position. A black circle appears at (27.4, 25.8).'); - * - *
                                  - */ - _main.default.prototype.randomSeed = function (seed) { - this._lcgSetSeed(randomStateProp, seed); - this._gaussian_previous = false; - }; - /** - * Returns a random number or a random element from an array. - * - * `random()` follows uniform distribution, which means that all outcomes are - * equally likely. When `random()` is used to generate numbers, all - * numbers in the output range are equally likely to be returned. When - * `random()` is used to select elements from an array, all elements are - * equally likely to be chosen. - * - * By default, `random()` produces different results each time a sketch runs. - * The randomSeed() function can be used to - * generate the same sequence of numbers or choices each time a sketch runs. - * - * The version of `random()` with no parameters returns a random number from 0 - * up to but not including 1. - * - * The version of `random()` with one parameter works one of two ways. If the - * argument passed is a number, `random()` returns a random number from 0 up - * to but not including the number. For example, calling `random(5)` returns - * values between 0 and 5. If the argument passed is an array, `random()` - * returns a random element from that array. For example, calling - * `random(['🦁', '🐯', '🐻'])` returns either a lion, tiger, or bear emoji. - * - * The version of `random()` with two parameters returns a random number from - * a given range. The arguments passed set the range's lower and upper bounds. - * For example, calling `random(-5, 10.2)` returns values from -5 up to but - * not including 10.2. - * - * @method random - * @param {Number} [min] lower bound (inclusive). - * @param {Number} [max] upper bound (exclusive). - * @return {Number} random number. - * @example - *
                                  - * - * let x = random(width); - * let y = random(height); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot appears in a random posiiton on a gray square.'); - * - *
                                  - * - *
                                  - * - * let animals = ['🦁', '🐯', '🐻']; - * let animal = random(animals); - * text(animal, 50, 50); - * - * describe('An animal face is displayed at random. Either a lion, tiger, or bear.'); - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * frameRate(5); - * let x = random(width); - * let y = random(height); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves around randomly on a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * background(200); - * - * frameRate(5); - * let x = random(45, 55); - * let y = random(45, 55); - * - * strokeWeight(5); - * point(x, y); - * - * describe('A black dot moves around randomly in the middle of a gray square.'); - * } - * - *
                                  - */ - /** - * @method random - * @param {Array} choices array to choose from. - * @return {*} random element from the array. - * @example - */ - _main.default.prototype.random = function (min, max) { - _main.default._validateParameters("random", arguments); - var rand; - if (this[randomStateProp] != null) { - rand = this._lcg(randomStateProp); - } else { - rand = Math.random(); - } - if (typeof min === "undefined") { - return rand; - } else if (typeof max === "undefined") { - if (min instanceof Array) { - return min[Math.floor(rand * min.length)]; - } else { - return rand * min; - } - } else { - if (min > max) { - var tmp = min; - min = max; - max = tmp; - } - return rand * (max - min) + min; - } - }; - /** - * Returns a random number fitting a Gaussian, or normal, distribution. Normal - * distributions look like bell curves when plotted. Values from a normal - * distribution cluster around a central value called the mean. The cluster's - * standard deviation describes its spread. - * - * By default, `randomGaussian()` produces different results each time a - * sketch runs. The randomSeed() function can be - * used to generate the same sequence of numbers each time a sketch runs. - * - * There's no minimum or maximum value that `randomGaussian()` might return. - * Values far from the mean are very unlikely and values near the mean are - * very likely. - * - * The version of `randomGaussian()` with no parameters returns values with a - * mean of 0 and standard deviation of 1. - * - * The version of `randomGaussian()` with one parameter interprets the - * argument passed as the mean. The standard deviation is 1. - * - * The version of `randomGaussian()` with two parameters interprets the first - * argument passed as the mean and the second as the standard deviation. - * - * @method randomGaussian - * @param {Number} [mean] mean. - * @param {Number} [sd] standard deviation. - * @return {Number} random number. - * @example - *
                                  - * - * function draw() { - * noStroke(); - * fill(0, 10); - * - * // Uniform distribution. - * let x = random(width); - * let y = 25; - * circle(x, y, 5); - * - * // Gaussian distribution with sd = 1. - * x = randomGaussian(50); - * y = 50; - * circle(x, y, 5); - * - * // Gaussian distribution with sd = 10. - * x = randomGaussian(50, 10); - * y = 75; - * circle(x, y, 5); - * - * describe('Three horizontal black lines are filled in randomly. The top line spans entire canvas. The middle line is very short. The bottom line spans two-thirds of the canvas.'); - * } - * - *
                                  - */ - _main.default.prototype.randomGaussian = function (mean) { - var sd = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 1; - var y1, x1, x2, w; - if (this._gaussian_previous) { - y1 = y2; - this._gaussian_previous = false; - } else { - do { - x1 = this.random(2) - 1; - x2 = this.random(2) - 1; - w = x1 * x1 + x2 * x2; - } while (w >= 1); - w = Math.sqrt((-2 * Math.log(w)) / w); - y1 = x1 * w; - y2 = x2 * w; - this._gaussian_previous = true; - } - var m = mean || 0; - return y1 * sd + m; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - }, - ], - 333: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Math - * @submodule Trigonometry - * @for p5 - * @requires core - * @requires constants - */ - /* - * all DEGREES/RADIANS conversion should be done in the p5 instance - * if possible, using the p5._toRadians(), p5._fromRadians() methods. - */ - - _main.default.prototype._angleMode = constants.RADIANS; - /** - * The inverse of cos(), returns the arc cosine of a - * value. This function expects arguments in the range -1 to 1. By default, - * `acos()` returns values in the range 0 to π (about 3.14). If the - * angleMode() is `DEGREES`, then values are - * returned in the range 0 to 180. - * - * @method acos - * @param {Number} value value whose arc cosine is to be returned. - * @return {Number} arc cosine of the given value. - * - * @example - *
                                  - * - * let a = PI; - * let c = cos(a); - * let ac = acos(c); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(c, 3)}`, 35, 50); - * text(`${round(ac, 3)}`, 35, 75); - * - * describe('The numbers 3.142, -1, and 3.142 written on separate rows.'); - * - *
                                  - * - *
                                  - * - * let a = PI; - * let c = cos(a); - * let ac = acos(c); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(c, 3)}`, 35, 50); - * text(`${round(ac, 3)}`, 35, 75); - * - * describe('The numbers 3.927, -0.707, and 2.356 written on separate rows.'); - * - *
                                  - */ - _main.default.prototype.acos = function (ratio) { - return this._fromRadians(Math.acos(ratio)); - }; - /** - * The inverse of sin(), returns the arc sine of a - * value. This function expects input values in the range of -1 to 1. By - * default, `asin()` returns values in the range -π ÷ 2 - * (about -1.57) to π ÷ 2 (about 1.57). If the - * angleMode() is `DEGREES` then values are - * returned in the range -90 to 90. - * - * @method asin - * @param {Number} value value whose arc sine is to be returned. - * @return {Number} arc sine of the given value. - * - * @example - *
                                  - * - * let a = PI / 3; - * let s = sin(a); - * let as = asin(s); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(s, 3)}`, 35, 50); - * text(`${round(as, 3)}`, 35, 75); - * - * describe('The numbers 1.047, 0.866, and 1.047 written on separate rows.'); - * - *
                                  - * - *
                                  - * - * let a = PI + PI / 3; - * let s = sin(a); - * let as = asin(s); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(s, 3)}`, 35, 50); - * text(`${round(as, 3)}`, 35, 75); - * - * describe('The numbers 4.189, -0.866, and -1.047 written on separate rows.'); - * - *
                                  - */ - _main.default.prototype.asin = function (ratio) { - return this._fromRadians(Math.asin(ratio)); - }; - /** - * The inverse of tan(), returns the arc tangent of a - * value. This function expects input values in the range of -Infinity to - * Infinity. By default, `atan()` returns values in the range -π ÷ 2 - * (about -1.57) to π ÷ 2 (about 1.57). If the - * angleMode() is `DEGREES` then values are - * returned in the range -90 to 90. - * - * @method atan - * @param {Number} value value whose arc tangent is to be returned. - * @return {Number} arc tangent of the given value. - * - * @example - *
                                  - * - * let a = PI / 3; - * let t = tan(a); - * let at = atan(t); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(t, 3)}`, 35, 50); - * text(`${round(at, 3)}`, 35, 75); - * - * describe('The numbers 1.047, 1.732, and 1.047 written on separate rows.'); - * - *
                                  - * - *
                                  - * - * let a = PI + PI / 3; - * let t = tan(a); - * let at = atan(t); - * text(`${round(a, 3)}`, 35, 25); - * text(`${round(t, 3)}`, 35, 50); - * text(`${round(at, 3)}`, 35, 75); - * - * describe('The numbers 4.189, 1.732, and 1.047 written on separate rows.'); - * - *
                                  - */ - _main.default.prototype.atan = function (ratio) { - return this._fromRadians(Math.atan(ratio)); - }; - /** - * Calculates the angle formed by a specified point, the origin, and the - * positive x-axis. By default, `atan2()` returns values in the range - * -π (about -3.14) to π (3.14). If the - * angleMode() is `DEGREES`, then values are - * returned in the range -180 to 180. The `atan2()` function is most often - * used for orienting geometry to the mouse's position. - * - * Note: The y-coordinate of the point is the first parameter and the - * x-coordinate is the second parameter. - * - * @method atan2 - * @param {Number} y y-coordinate of the point. - * @param {Number} x x-coordinate of the point. - * @return {Number} arc tangent of the given point. - * - * @example - *
                                  - * - * function draw() { - * background(200); - * translate(width / 2, height / 2); - * let x = mouseX - width / 2; - * let y = mouseY - height / 2; - * let a = atan2(y, x); - * rotate(a); - * rect(-30, -5, 60, 10); - * - * describe('A rectangle at the center of the canvas rotates with mouse movements.'); - * } - * - *
                                  - */ - _main.default.prototype.atan2 = function (y, x) { - return this._fromRadians(Math.atan2(y, x)); - }; - /** - * Calculates the cosine of an angle. `cos()` is useful for many geometric - * tasks in creative coding. The values returned oscillate between -1 and 1 - * as the input angle increases. `cos()` takes into account the current - * angleMode. - * - * @method cos - * @param {Number} angle the angle. - * @return {Number} cosine of the angle. - * - * @example - *
                                  - * - * function draw() { - * background(200); - * - * let t = frameCount; - * let x = 30 * cos(t * 0.05) + 50; - * let y = 50; - * line(50, y, x, y); - * circle(x, y, 20); - * - * describe('A white ball on a string oscillates left and right.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * let x = frameCount; - * let y = 30 * cos(x * 0.1) + 50; - * point(x, y); - * - * describe('A series of black dots form a wave pattern.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * let t = frameCount; - * let x = 30 * cos(t * 0.1) + 50; - * let y = 10 * sin(t * 0.2) + 50; - * point(x, y); - * - * describe('A series of black dots form an infinity symbol.'); - * } - * - *
                                  - */ - _main.default.prototype.cos = function (angle) { - return Math.cos(this._toRadians(angle)); - }; - /** - * Calculates the sine of an angle. `sin()` is useful for many geometric tasks - * in creative coding. The values returned oscillate between -1 and 1 as the - * input angle increases. `sin()` takes into account the current - * angleMode. - * - * @method sin - * @param {Number} angle the angle. - * @return {Number} sine of the angle. - * - * @example - *
                                  - * - * function draw() { - * background(200); - * - * let t = frameCount; - * let x = 50; - * let y = 30 * sin(t * 0.05) + 50; - * line(x, 50, x, y); - * circle(x, y, 20); - * - * describe('A white ball on a string oscillates up and down.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * let x = frameCount; - * let y = 30 * sin(x * 0.1) + 50; - * point(x, y); - * - * describe('A series of black dots form a wave pattern.'); - * } - * - *
                                  - * - *
                                  - * - * function draw() { - * let t = frameCount; - * let x = 30 * cos(t * 0.1) + 50; - * let y = 10 * sin(t * 0.2) + 50; - * point(x, y); - * - * describe('A series of black dots form an infinity symbol.'); - * } - * - *
                                  - */ - _main.default.prototype.sin = function (angle) { - return Math.sin(this._toRadians(angle)); - }; - /** - * Calculates the tangent of an angle. `tan()` is useful for many geometric - * tasks in creative coding. The values returned range from -Infinity - * to Infinity and repeat periodically as the input angle increases. `tan()` - * takes into account the current angleMode. - * - * @method tan - * @param {Number} angle the angle. - * @return {Number} tangent of the angle. - * - * @example - *
                                  - * - * function draw() { - * let x = frameCount; - * let y = 5 * tan(x * 0.1) + 50; - * point(x, y); - * - * describe('A series of identical curves drawn with black dots. Each curve starts from the top of the canvas, continues down at a slight angle, flattens out at the middle of the canvas, then continues to the bottom.'); - * } - * - *
                                  - */ - _main.default.prototype.tan = function (angle) { - return Math.tan(this._toRadians(angle)); - }; - /** - * Converts an angle measurement in radians to its corresponding value in - * degrees. Degrees and radians are two ways of measuring the same thing. - * There are 360 degrees in a circle and 2 × π (about 6.28) - * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) - * radians. This function doesn't take into account the current - * angleMode(). - * - * @method degrees - * @param {Number} radians radians value to convert to degrees. - * @return {Number} converted angle. - * - * @example - *
                                  - * - * let rad = QUARTER_PI; - * let deg = degrees(rad); - * text(`${round(rad, 2)} rad = ${deg}˚`, 10, 50); - * - * describe('The text "0.79 rad = 45˚".'); - * - *
                                  - */ - _main.default.prototype.degrees = function (angle) { - return angle * constants.RAD_TO_DEG; - }; - /** - * Converts an angle measurement in degrees to its corresponding value in - * radians. Degrees and radians are two ways of measuring the same thing. - * There are 360 degrees in a circle and 2 × π (about 6.28) - * radians in a circle. For example, 90° = π ÷ 2 (about 1.57) - * radians. This function doesn't take into account the current - * angleMode(). - * - * @method radians - * @param {Number} degrees degree value to convert to radians. - * @return {Number} converted angle. - * - * @example - *
                                  - * - * let deg = 45; - * let rad = radians(deg); - * text(`${deg}˚ = ${round(rad, 3)} rad`, 10, 50); - * - * describe('The text "45˚ = 0.785 rad".'); - * - *
                                  - */ - _main.default.prototype.radians = function (angle) { - return angle * constants.DEG_TO_RAD; - }; - /** - * Changes the way trigonometric functions interpret angle values. By default, - * the mode is `RADIANS`. - * - * Calling `angleMode()` with no arguments returns current angle mode. - * @method angleMode - * @param {Constant} mode either RADIANS or DEGREES. - * @example - *
                                  - * - * let r = 40; - * push(); - * rotate(PI / 6); - * line(0, 0, r, 0); - * text('0.524 rad', r, 0); - * pop(); - * - * angleMode(DEGREES); - * push(); - * rotate(60); - * line(0, 0, r, 0); - * text('60˚', r, 0); - * pop(); - * - * describe('Two diagonal lines radiating from the top left corner of a square. The lines are oriented 30 degrees from the edges of the square and 30 degrees apart from each other.'); - * - *
                                  - * - */ - /** - * @method angleMode - * @return {Constant} mode either RADIANS or DEGREES - */ - _main.default.prototype.angleMode = function (mode) { - _main.default._validateParameters("angleMode", arguments); - if (typeof mode === "undefined") { - return this._angleMode; - } else if ( - mode === constants.DEGREES || - mode === constants.RADIANS - ) { - this._angleMode = mode; - } - }; - /** - * converts angles from the current angleMode to RADIANS - * - * @method _toRadians - * @private - * @param {Number} angle - * @returns {Number} - */ - _main.default.prototype._toRadians = function (angle) { - if (this._angleMode === constants.DEGREES) { - return angle * constants.DEG_TO_RAD; - } - return angle; - }; - /** - * converts angles from the current angleMode to DEGREES - * - * @method _toDegrees - * @private - * @param {Number} angle - * @returns {Number} - */ - _main.default.prototype._toDegrees = function (angle) { - if (this._angleMode === constants.RADIANS) { - return angle * constants.RAD_TO_DEG; - } - return angle; - }; - /** - * converts angles from RADIANS into the current angleMode - * - * @method _fromRadians - * @private - * @param {Number} angle - * @returns {Number} - */ - _main.default.prototype._fromRadians = function (angle) { - if (this._angleMode === constants.DEGREES) { - return angle * constants.RAD_TO_DEG; - } - return angle; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 334: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Typography - * @submodule Attributes - * @for p5 - * @requires core - * @requires constants - */ - /** - * Sets the way text is aligned when text() is called. - * - * By default, calling `text('hi', 10, 20)` places the bottom-left corner of - * the text's bounding box at (10, 20). - * - * The first parameter, `horizAlign`, changes the way - * text() interprets x-coordinates. By default, the - * x-coordinate sets the left edge of the bounding box. `textAlign()` accepts - * the following values for `horizAlign`: `LEFT`, `CENTER`, or `RIGHT`. - * - * The second parameter, `vertAlign`, is optional. It changes the way - * text() interprets y-coordinates. By default, the - * y-coordinate sets the bottom edge of the bounding box. `textAlign()` - * accepts the following values for `vertAlign`: `TOP`, `BOTTOM`, `CENTER`, - * or `BASELINE`. - * - * @method textAlign - * @param {Constant} horizAlign horizontal alignment, either LEFT, - * CENTER, or RIGHT. - * @param {Constant} [vertAlign] vertical alignment, either TOP, - * BOTTOM, CENTER, or BASELINE. - * @chainable - * @example - *
                                  - * - * strokeWeight(0.5); - * line(50, 0, 50, 100); - * - * textSize(16); - * textAlign(RIGHT); - * text('ABCD', 50, 30); - * textAlign(CENTER); - * text('EFGH', 50, 50); - * textAlign(LEFT); - * text('IJKL', 50, 70); - * - * describe('The letters ABCD displayed at top-left, EFGH at center, and IJKL at bottom-right. A vertical line divides the canvas in half.'); - * - *
                                  - * - *
                                  - * - * strokeWeight(0.5); - * - * line(0, 12, width, 12); - * textAlign(CENTER, TOP); - * text('TOP', 50, 12); - * - * line(0, 37, width, 37); - * textAlign(CENTER, CENTER); - * text('CENTER', 50, 37); - * - * line(0, 62, width, 62); - * textAlign(CENTER, BASELINE); - * text('BASELINE', 50, 62); - * - * line(0, 97, width, 97); - * textAlign(CENTER, BOTTOM); - * text('BOTTOM', 50, 97); - * - * describe('The words "TOP", "CENTER", "BASELINE", and "BOTTOM" each drawn relative to a horizontal line. Their positions demonstrate different vertical alignments.'); - * - *
                                  - */ - /** - * @method textAlign - * @return {Object} - */ - - _main.default.prototype.textAlign = function (horizAlign, vertAlign) { - var _this$_renderer; - _main.default._validateParameters("textAlign", arguments); - return (_this$_renderer = this._renderer).textAlign.apply( - _this$_renderer, - arguments, - ); - }; - /** - * Sets the spacing between lines of text when - * text() is called. Spacing is measured in pixels. - * - * Calling `textLeading()` without an argument returns the current spacing. - * - * @method textLeading - * @param {Number} leading spacing between lines of text in units of pixels. - * @chainable - * - * @example - *
                                  - * - * // "\n" starts a new line of text. - * let lines = 'one\ntwo'; - * - * text(lines, 10, 25); - * - * textLeading(30); - * text(lines, 70, 25); - * - * describe('The words "one" and "two" written on separate lines twice. The words on the left have less vertical spacing than the words on the right.'); - * - *
                                  - */ - /** - * @method textLeading - * @return {Number} - */ - _main.default.prototype.textLeading = function (theLeading) { - var _this$_renderer2; - _main.default._validateParameters("textLeading", arguments); - return (_this$_renderer2 = this._renderer).textLeading.apply( - _this$_renderer2, - arguments, - ); - }; - /** - * Sets the font size when - * text() is called. Font size is measured in pixels. - * - * Calling `textSize()` without an arugment returns the current size. - * - * @method textSize - * @param {Number} size size of the letters in units of pixels - * @chainable - * - * @example - *
                                  - * - * textSize(12); - * text('Font Size 12', 10, 30); - * textSize(14); - * text('Font Size 14', 10, 60); - * textSize(16); - * text('Font Size 16', 10, 90); - * - * describe('The text "Font Size 12" drawn small, "Font Size 14" drawn medium, and "Font Size 16" drawn large.'); - * - *
                                  - */ - /** - * @method textSize - * @return {Number} - */ - _main.default.prototype.textSize = function (theSize) { - var _this$_renderer3; - _main.default._validateParameters("textSize", arguments); - return (_this$_renderer3 = this._renderer).textSize.apply( - _this$_renderer3, - arguments, - ); - }; - /** - * Sets the style for system fonts when - * text() is called. `textStyle()` accepts the - * following values: `NORMAL`, `ITALIC`, `BOLD` or `BOLDITALIC`. - * - * `textStyle()` may be overridden by CSS styling. This function doesn't - * affect fonts loaded with loadFont(). - * - * @method textStyle - * @param {Constant} style styling for text, either NORMAL, - * ITALIC, BOLD or BOLDITALIC - * @chainable - * @example - *
                                  - * - * textSize(12); - * textAlign(CENTER); - * - * textStyle(NORMAL); - * text('Normal', 50, 15); - * textStyle(ITALIC); - * text('Italic', 50, 40); - * textStyle(BOLD); - * text('Bold', 50, 65); - * textStyle(BOLDITALIC); - * text('Bold Italic', 50, 90); - * - * describe('The words "Normal" displayed normally, "Italic" in italic, "Bold" in bold, and "Bold Italic" in bold italics.'); - * - *
                                  - */ - /** - * @method textStyle - * @return {String} - */ - _main.default.prototype.textStyle = function (theStyle) { - var _this$_renderer4; - _main.default._validateParameters("textStyle", arguments); - return (_this$_renderer4 = this._renderer).textStyle.apply( - _this$_renderer4, - arguments, - ); - }; - /** - * Returns the maximum width of a string of text drawn when - * text() is called. - * - * @method textWidth - * @param {String} str string of text to measure. - * @return {Number} width measured in units of pixels. - * @example - *
                                  - * - * function setup() { - * background(200); - * - * textSize(28); - * strokeWeight(0.5); - * let s = 'yoyo'; - * let w = textWidth(s); - * text(s, 22, 55); - * line(22, 55, 22 + w, 55); - * - * describe('The word "yoyo" underlined.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * - * textSize(28); - * strokeWeight(0.5); - * // "\n" starts a new line. - * let s = 'yo\nyo'; - * let w = textWidth(s); - * text(s, 22, 55); - * line(22, 55, 22 + w, 55); - * - * describe('The word "yo" written twice, one copy beneath the other. The words are divided by a horizontal line.'); - * } - * - *
                                  - */ - _main.default.prototype.textWidth = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - args[0] += ""; - _main.default._validateParameters("textWidth", args); - if (args[0].length === 0) { - return 0; - } // Only use the line with the longest width, and replace tabs with double-space - - var textLines = args[0].replace(/\t/g, " ").split(/\r?\n|\r|\n/g); - var newArr = []; - // Return the textWidth for every line - for (var i = 0; i < textLines.length; i++) { - newArr.push(this._renderer.textWidth(textLines[i])); - } // Return the largest textWidth - - var largestWidth = Math.max.apply(Math, newArr); - return largestWidth; - }; - /** - * Returns the ascent of the current font at its current size. The ascent - * represents the distance, in pixels, of the tallest character above - * the baseline. - * - * @method textAscent - * @return {Number} ascent measured in units of pixels. - * @example - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * textFont(font); - * - * // Different for each font. - * let fontScale = 0.8; - * - * let baseY = 75; - * strokeWeight(0.5); - * - * // Draw small text. - * textSize(24); - * text('dp', 0, baseY); - * // Draw baseline and ascent. - * let a = textAscent() * fontScale; - * line(0, baseY, 23, baseY); - * line(23, baseY - a, 23, baseY); - * - * // Draw large text. - * textSize(48); - * text('dp', 45, baseY); - * // Draw baseline and ascent. - * a = textAscent() * fontScale; - * line(45, baseY, 91, baseY); - * line(91, baseY - a, 91, baseY); - * - * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends upward from each baseline to the top of the "d".'); - * } - * - *
                                  - */ - _main.default.prototype.textAscent = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("textAscent", args); - return this._renderer.textAscent(); - }; - /** - * Returns the descent of the current font at its current size. The descent - * represents the distance, in pixels, of the character with the longest - * descender below the baseline. - * - * @method textDescent - * @return {Number} descent measured in units of pixels. - * @example - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * textFont(font); - * - * // Different for each font. - * let fontScale = 0.9; - * - * let baseY = 75; - * strokeWeight(0.5); - * - * // Draw small text. - * textSize(24); - * text('dp', 0, baseY); - * // Draw baseline and descent. - * let d = textDescent() * fontScale; - * line(0, baseY, 23, baseY); - * line(23, baseY, 23, baseY + d); - * - * // Draw large text. - * textSize(48); - * text('dp', 45, baseY); - * // Draw baseline and descent. - * d = textDescent() * fontScale; - * line(45, baseY, 91, baseY); - * line(91, baseY, 91, baseY + d); - * - * describe('The letters "dp" written twice in different sizes. Each version has a horizontal baseline. A vertical line extends downward from each baseline to the bottom of the "p".'); - * } - * - *
                                  - */ - _main.default.prototype.textDescent = function () { - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters("textDescent", args); - return this._renderer.textDescent(); - }; - /** - * Helper function to measure ascent and descent. - */ - _main.default.prototype._updateTextMetrics = function () { - return this._renderer._updateTextMetrics(); - }; - /** - * Sets the style for wrapping text when - * text() is called. `textWrap()` accepts the - * following values: - * - * `WORD` starts new lines of text at spaces. If a string of text doesn't - * have spaces, it may overflow the text box and the canvas. This is the - * default style. - * - * `CHAR` starts new lines as needed to stay within the text box. - * - * `textWrap()` only works when the maximum width is set for a text box. For - * example, calling `text('Have a wonderful day', 0, 10, 100)` sets the - * maximum width to 100 pixels. - * - * Calling `textWrap()` without an argument returns the current style. - * - * @method textWrap - * @param {Constant} style text wrapping style, either WORD or CHAR. - * @return {String} style - * @example - *
                                  - * - * textSize(20); - * textWrap(WORD); - * text('Have a wonderful day', 0, 10, 100); - * - *
                                  - * - *
                                  - * - * textSize(20); - * textWrap(CHAR); - * text('Have a wonderful day', 0, 10, 100); - * - *
                                  - * - *
                                  - * - * textSize(20); - * textWrap(CHAR); - * text('祝你有美好的一天', 0, 10, 100); - * - *
                                  - */ - _main.default.prototype.textWrap = function (wrapStyle) { - if (wrapStyle !== "WORD" && wrapStyle !== "CHAR") { - throw "Error: textWrap accepts only WORD or CHAR"; - } - return this._renderer.textWrap(wrapStyle); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - }, - ], - 335: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.last-index-of"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.last-index-of"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.split"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - var opentype = _interopRequireWildcard(_dereq_("opentype.js")); - _dereq_("../core/friendly_errors/validate_params"); - _dereq_("../core/friendly_errors/file_errors"); - _dereq_("../core/friendly_errors/fes_core"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Typography - * @submodule Loading & Displaying - * @for p5 - * @requires core - */ - /** - * Loads a font and creates a p5.Font object. - * `loadFont()` can load fonts in either .otf or .ttf format. Loaded fonts can - * be used to style text on the canvas and in HTML elements. - * - * The first parameter, `path`, is the path to a font file. - * Paths to local files should be relative. For example, - * `'assets/inconsolata.otf'`. The Inconsolata font used in the following - * examples can be downloaded for free - * here. - * Paths to remote files should be URLs. For example, - * `'https://example.com/inconsolata.otf'`. URLs may be blocked due to browser - * security. - * - * The second parameter, `successCallback`, is optional. If a function is - * passed, it will be called once the font has loaded. The callback function - * may use the new p5.Font object if needed. - * - * The third parameter, `failureCallback`, is also optional. If a function is - * passed, it will be called if the font fails to load. The callback function - * may use the error - * Event - * object if needed. - * - * Fonts can take time to load. Calling `loadFont()` in - * preload() ensures fonts load before they're - * used in setup() or - * draw(). - * - * @method loadFont - * @param {String} path path of the font to be loaded. - * @param {Function} [successCallback] function called with the - * p5.Font object after it - * loads. - * @param {Function} [failureCallback] function called with the error - * Event - * object if the font fails to load. - * @return {p5.Font} p5.Font object. - * @example - * - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * loadFont('assets/inconsolata.otf', font => { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * }); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * loadFont('assets/inconsolata.otf', success, failure); - * } - * - * function success(font) { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - * function failure(event) { - * console.error('Oops!', event); - * } - * - *
                                  - * - *
                                  - * - * function preload() { - * loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * let p = createP('p5*js'); - * p.style('color', 'deeppink'); - * p.style('font-family', 'Inconsolata'); - * p.style('font-size', '36px'); - * p.position(10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - *
                                  - */ - - _main.default.prototype.loadFont = function ( - path, - onSuccess, - onError, - ) { - _main.default._validateParameters("loadFont", arguments); - var p5Font = new _main.default.Font(this); - var self = this; - opentype.load(path, function (err, font) { - if (err) { - _main.default._friendlyFileLoadError(4, path); - if (typeof onError !== "undefined") { - return onError(err); - } - console.error(err, path); - return; - } - p5Font.font = font; - if (typeof onSuccess !== "undefined") { - onSuccess(p5Font); - } - self._decrementPreload(); - // check that we have an acceptable font type - var validFontTypes = ["ttf", "otf", "woff", "woff2"]; - var fileNoPath = path.split("\\").pop().split("/").pop(); - var lastDotIdx = fileNoPath.lastIndexOf("."); - var fontFamily; - var newStyle; - var fileExt = - lastDotIdx < 1 ? null : fileNoPath.slice(lastDotIdx + 1); - // if so, add it to the DOM (name-only) for use with DOM module - if (validFontTypes.includes(fileExt)) { - fontFamily = fileNoPath.slice( - 0, - lastDotIdx !== -1 ? lastDotIdx : 0, - ); - newStyle = document.createElement("style"); - newStyle.appendChild( - document.createTextNode( - "\n@font-face {\nfont-family: " - .concat(fontFamily, ";\nsrc: url(") - .concat(path, ");\n}\n"), - ), - ); - document.head.appendChild(newStyle); - } - }); - return p5Font; - }; - /** - * Draws text to the canvas. - * - * The first parameter, `str`, is the text to be drawn. The second and third - * parameters, `x` and `y`, set the coordinates of the text's bottom-left - * corner. See textAlign() for other ways to - * align text. - * - * The fourth and fifth parameters, `maxWidth` and `maxHeight`, are optional. - * They set the dimensions of the invisible rectangle containing the text. By - * default, they set its maximum width and height. See - * rectMode() for other ways to define the - * rectangular text box. Text will wrap to fit within the text box. Text - * outside of the box won't be drawn. - * - * Text can be styled a few ways. Call the fill() - * function to set the text's fill color. Call - * stroke() and - * strokeWeight() to set the text's outline. - * Call textSize() and - * textFont() to set the text's size and font, - * respectively. - * - * Note: `WEBGL` mode only supports fonts loaded with - * loadFont(). Calling - * stroke() has no effect in `WEBGL` mode. - * - * @method text - * @param {String|Object|Array|Number|Boolean} str text to be displayed. - * @param {Number} x x-coordinate of the text box. - * @param {Number} y y-coordinate of the text box. - * @param {Number} [maxWidth] maximum width of the text box. See - * rectMode() for - * other options. - * @param {Number} [maxHeight] maximum height of the text box. See - * rectMode() for - * other options. - * - * @chainable - * @example - *
                                  - * - * function setup() { - * background(200); - * text('hi', 50, 50); - * - * describe('The text "hi" written in black in the middle of a gray square.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background('skyblue'); - * textSize(100); - * text('🌈', 0, 100); - * - * describe('A rainbow in a blue sky.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * textSize(32); - * fill(255); - * stroke(0); - * strokeWeight(4); - * text('hi', 50, 50); - * - * describe('The text "hi" written in white with a black outline.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background('black'); - * textSize(22); - * fill('yellow'); - * text('rainbows', 6, 20); - * fill('cornflowerblue'); - * text('rainbows', 6, 45); - * fill('tomato'); - * text('rainbows', 6, 70); - * fill('limegreen'); - * text('rainbows', 6, 95); - * - * describe('The text "rainbows" written on several lines, each in a different color.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * let s = 'The quick brown fox jumps over the lazy dog.'; - * text(s, 10, 10, 70, 80); - * - * describe('The sample text "The quick brown fox..." written in black across several lines.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * rectMode(CENTER); - * let s = 'The quick brown fox jumps over the lazy dog.'; - * text(s, 50, 50, 70, 80); - * - * describe('The sample text "The quick brown fox..." written in black across several lines.'); - * } - * - *
                                  - * - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * textFont(font); - * textSize(32); - * textAlign(CENTER, CENTER); - * } - * - * function draw() { - * background(0); - * rotateY(frameCount / 30); - * text('p5*js', 0, 0); - * - * describe('The text "p5*js" written in white and spinning in 3D.'); - * } - * - *
                                  - */ - _main.default.prototype.text = function ( - str, - x, - y, - maxWidth, - maxHeight, - ) { - var _this$_renderer; - _main.default._validateParameters("text", arguments); - return !(this._renderer._doFill || this._renderer._doStroke) - ? this - : (_this$_renderer = this._renderer).text.apply( - _this$_renderer, - arguments, - ); - }; - /** - * Sets the font used by the text() function. - * - * The first parameter, `font`, sets the font. `textFont()` recognizes either - * a p5.Font object or a string with the name of a - * system font. For example, `'Courier New'`. - * - * The second parameter, `size`, is optional. It sets the font size in pixels. - * This has the same effect as calling textSize(). - * - * Note: `WEBGL` mode only supports fonts loaded with - * loadFont(). - * - * @method textFont - * @return {Object} current font or p5 Object. - * - * @example - *
                                  - * - * function setup() { - * background(200); - * textFont('Courier New'); - * textSize(24); - * text('hi', 35, 55); - * - * describe('The text "hi" written in a black, monospace font on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background('black'); - * fill('palegreen'); - * textFont('Courier New', 10); - * text('You turn to the left and see a door. Do you enter?', 5, 5, 90, 90); - * text('>', 5, 70); - * - * describe('A text prompt from a game is written in a green, monospace font on a black background.'); - * } - * - *
                                  - * - *
                                  - * - * function setup() { - * background(200); - * textFont('Verdana'); - * let currentFont = textFont(); - * text(currentFont, 25, 50); - * - * describe('The text "Verdana" written in a black, sans-serif font on a gray background.'); - * } - * - *
                                  - * - *
                                  - * - * let fontRegular; - * let fontItalic; - * let fontBold; - * - * function preload() { - * fontRegular = loadFont('assets/Regular.otf'); - * fontItalic = loadFont('assets/Italic.ttf'); - * fontBold = loadFont('assets/Bold.ttf'); - * } - * - * function setup() { - * background(200); - * textFont(fontRegular); - * text('I am Normal', 10, 30); - * textFont(fontItalic); - * text('I am Italic', 10, 50); - * textFont(fontBold); - * text('I am Bold', 10, 70); - * - * describe('The statements "I am Normal", "I am Italic", and "I am Bold" written in black on separate lines. The statements have normal, italic, and bold fonts, respectively.'); - * } - * - *
                                  - */ - /** - * @method textFont - * @param {Object|String} font font as a p5.Font object or a string. - * @param {Number} [size] font size in pixels. - * @chainable - */ - _main.default.prototype.textFont = function (theFont, theSize) { - _main.default._validateParameters("textFont", arguments); - if (arguments.length) { - if (!theFont) { - throw new Error("null font passed to textFont"); - } - this._renderer._setProperty("_textFont", theFont); - if (theSize) { - this._renderer._setProperty("_textSize", theSize); - if (!this._renderer._leadingSet) { - // only use a default value if not previously set (#5181) - this._renderer._setProperty( - "_textLeading", - theSize * constants._DEFAULT_LEADMULT, - ); - } - } - return this._renderer._applyTextProperties(); - } - return this._renderer._textFont; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/friendly_errors/fes_core": 289, - "../core/friendly_errors/file_errors": 290, - "../core/friendly_errors/validate_params": 293, - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.last-index-of": 181, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - "opentype.js": 271, - }, - ], - 336: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * This module defines the p5.Font class and functions for - * drawing text to the display canvas. - * @module Typography - * @submodule Loading & Displaying - * @requires core - * @requires constants - */ - /** - * A class to describe fonts. - * @class p5.Font - * @constructor - * @param {p5} [pInst] pointer to p5 instance. - * @example - *
                                  - * - * let font; - * - * function preload() { - * // Creates a p5.Font object. - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * fill('deeppink'); - * textFont(font); - * textSize(36); - * text('p5*js', 10, 50); - * - * describe('The text "p5*js" written in pink on a white background.'); - * } - * - *
                                  - */ - - _main.default.Font = /*#__PURE__*/ (function () { - function _class(p) { - _classCallCheck(this, _class); - this.parent = p; - this.cache = {}; - /** - * Underlying - * opentype.js - * font object. - * @property font - * @name font - */ - this.font = undefined; - } /** - * Returns the bounding box for a string of text written using this - * p5.Font. - * - * The first parameter, `str`, is a string of text. The second and third - * parameters, `x` and `y`, are the text's position. By default, they set the - * coordinates of the bounding box's bottom-left corner. See - * textAlign() for more ways to align text. - * - * The fourth parameter, `fontSize`, is optional. It sets the font size used to - * determine the bounding box. By default, `font.textBounds()` will use the - * current textSize(). - * - * @method textBounds - * @param {String} str string of text. - * @param {Number} x x-coordinate of the text. - * @param {Number} y y-coordinate of the text. - * @param {Number} [fontSize] font size. Defaults to the current - * textSize(). - * @return {Object} object describing the bounding box with - * properties x, y, w, and h. - * - * @example - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * - * let bbox = font.textBounds('p5*js', 35, 53); - * rect(bbox.x, bbox.y, bbox.w, bbox.h); - * - * textFont(font); - * text('p5*js', 35, 53); - * - * describe('The text "p5*js" written in black inside a white rectangle.'); - * } - * - *
                                  - * - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * - * textFont(font); - * textSize(15); - * textAlign(CENTER, CENTER); - * - * let bbox = font.textBounds('p5*js', 50, 50); - * rect(bbox.x, bbox.y, bbox.w, bbox.h); - * - * text('p5*js', 50, 50); - * - * describe('The text "p5*js" written in black inside a white rectangle.'); - * } - * - *
                                  - * - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * - * let bbox = font.textBounds('p5*js', 31, 53, 15); - * rect(bbox.x, bbox.y, bbox.w, bbox.h); - * - * textFont(font); - * textSize(15); - * text('p5*js', 31, 53); - * - * describe('The text "p5*js" written in black inside a white rectangle.'); - * } - * - *
                                  - */ - - _createClass(_class, [ - { - key: "textBounds", - value: function textBounds(str) { - var x = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var y = - arguments.length > 2 && arguments[2] !== undefined - ? arguments[2] - : 0; - var fontSize = - arguments.length > 3 ? arguments[3] : undefined; - var opts = arguments.length > 4 ? arguments[4] : undefined; - // Check cache for existing bounds. Take into consideration the text alignment - // settings. Default alignment should match opentype's origin: left-aligned & - // alphabetic baseline. - var p = - (opts && opts.renderer && opts.renderer._pInst) || - this.parent; - var ctx = p._renderer.drawingContext; - var alignment = ctx.textAlign || constants.LEFT; - var baseline = ctx.textBaseline || constants.BASELINE; - var cacheResults = false; - var result; - var key; - fontSize = fontSize || p._renderer._textSize; - // NOTE: cache disabled for now pending further discussion of #3436 - if (cacheResults) { - key = cacheKey( - "textBounds", - str, - x, - y, - fontSize, - alignment, - baseline, - ); - result = this.cache[key]; - } - if (!result) { - var minX = []; - var minY; - var maxX = []; - var maxY; - var pos; - var xCoords = []; - xCoords[0] = []; - var yCoords = []; - var scale = this._scale(fontSize); - var lineHeight = p._renderer.textLeading(); - var lineCount = 0; - this.font.forEachGlyph( - str, - x, - y, - fontSize, - opts, - function (glyph, gX, gY, gFontSize) { - var gm = glyph.getMetrics(); - if (glyph.index === 0 || glyph.index === 10) { - lineCount += 1; - xCoords[lineCount] = []; - } else { - xCoords[lineCount].push(gX + gm.xMin * scale); - xCoords[lineCount].push(gX + gm.xMax * scale); - yCoords.push( - gY + lineCount * lineHeight + -gm.yMin * scale, - ); - yCoords.push( - gY + lineCount * lineHeight + -gm.yMax * scale, - ); - } - }, - ); - if (xCoords[lineCount].length > 0) { - minX[lineCount] = Math.min.apply( - null, - xCoords[lineCount], - ); - maxX[lineCount] = Math.max.apply( - null, - xCoords[lineCount], - ); - } - var finalMaxX = 0; - for (var i = 0; i <= lineCount; i++) { - minX[i] = Math.min.apply(null, xCoords[i]); - maxX[i] = Math.max.apply(null, xCoords[i]); - var lineLength = maxX[i] - minX[i]; - if (lineLength > finalMaxX) { - finalMaxX = lineLength; - } - } - var finalMinX = Math.min.apply(null, minX); - minY = Math.min.apply(null, yCoords); - maxY = Math.max.apply(null, yCoords); - result = { - x: finalMinX, - y: minY, - h: maxY - minY, - w: finalMaxX, - advance: finalMinX - x, - }; - // Bounds are now calculated, so shift the x & y to match alignment settings - pos = this._handleAlignment( - p._renderer, - str, - result.x, - result.y, - result.w + result.advance, - ); - result.x = pos.x; - result.y = pos.y; - if (cacheResults) { - this.cache[key] = result; - } - } - return result; - } /** - * Returns an array of points outlining a string of text written using this - * p5.Font. - * - * The first parameter, `str`, is a string of text. The second and third - * parameters, `x` and `y`, are the text's position. By default, they set the - * coordinates of the bounding box's bottom-left corner. See - * textAlign() for more ways to align text. - * - * The fourth parameter, `fontSize`, is optional. It sets the text's font - * size. By default, `font.textToPoints()` will use the current - * textSize(). - * - * The fifth parameter, `options`, is also optional. `font.textToPoints()` - * expects an object with the following properties: - * - * `sampleFactor` is the ratio of the text's path length to the number of - * samples. It defaults to 0.1. Higher values produce more points along the - * path and are more precise. - * - * `simplifyThreshold` removes collinear points if it's set to a number other - * than 0. The value represents the threshold angle to use when determining - * whether two edges are collinear. - * - * @method textToPoints - * @param {String} str string of text. - * @param {Number} x x-coordinate of the text. - * @param {Number} y y-coordinate of the text. - * @param {Number} [fontSize] font size. Defaults to the current - * textSize(). - * @param {Object} [options] object with sampleFactor and simplifyThreshold - * properties. - * @return {Array} array of point objects, each with x, y, and alpha (path angle) properties. - * @example - *
                                  - * - * let font; - * - * function preload() { - * font = loadFont('assets/inconsolata.otf'); - * } - * - * function setup() { - * background(200); - * let points = font.textToPoints('p5*js', 6, 60, 35, { sampleFactor: 0.5 }); - * points.forEach(p => { - * point(p.x, p.y); - * }); - * - * describe('A set of black dots outlining the text "p5*js" on a gray background.'); - * } - * - *
                                  - */, - }, - { - key: "textToPoints", - value: function textToPoints(txt, x, y, fontSize, options) { - var xOriginal = x; - var result = []; - var lines = txt.split(/\r?\n|\r|\n/g); - fontSize = fontSize || this.parent._renderer._textSize; - function isSpace(i, text, glyphsLine) { - return ( - (glyphsLine[i].name && glyphsLine[i].name === "space") || - (text.length === glyphsLine.length && text[i] === " ") //|| - //(glyphs[i].index && glyphs[i].index === 3) - ); - } - for (var i = 0; i < lines.length; i++) { - var xoff = 0; - x = xOriginal; - var line = lines[i]; - line = line.replace("\t", " "); - var glyphs = this._getGlyphs(line); - for (var j = 0; j < glyphs.length; j++) { - if (!isSpace(j, line, glyphs)) { - // fix to #1817, #2069 - var gpath = glyphs[j].getPath(x, y, fontSize), - paths = splitPaths(gpath.commands); - for (var k = 0; k < paths.length; k++) { - var pts = pathToPoints(paths[k], options); - for (var l = 0; l < pts.length; l++) { - pts[l].x += xoff; - result.push(pts[l]); - } - } - } - xoff += glyphs[j].advanceWidth * this._scale(fontSize); - } - y = y + this.parent._renderer._textLeading; - } - return result; - }, // ----------------------------- End API ------------------------------ - /** - * Returns the set of opentype glyphs for the supplied string. - * - * Note that there is not a strict one-to-one mapping between characters - * and glyphs, so the list of returned glyphs can be larger or smaller - * than the length of the given string. - * - * @private - * @param {String} str the string to be converted - * @return {Array} the opentype glyphs - */ - }, - { - key: "_getGlyphs", - value: function _getGlyphs(str) { - return this.font.stringToGlyphs(str); - } /** - * Returns an opentype path for the supplied string and position. - * - * @private - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional) - * @return {Object} the opentype path - */, - }, - { - key: "_getPath", - value: function _getPath(line, x, y, options) { - var p = - (options && - options.renderer && - options.renderer._pInst) || - this.parent, - renderer = p._renderer, - pos = this._handleAlignment(renderer, line, x, y); - return this.font.getPath( - line, - pos.x, - pos.y, - renderer._textSize, - options, - ); - } /* - * Creates an SVG-formatted path-data string - * (See http://www.w3.org/TR/SVG/paths.html#PathData) - * from the given opentype path or string/position - * - * @param {Object} path an opentype path, OR the following: - * - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional), set options.decimals - * to set the decimal precision of the path-data - * - * @return {Object} this p5.Font object - */, - }, - { - key: "_getPathData", - value: function _getPathData(line, x, y, options) { - var decimals = 3; - // create path from string/position - if (typeof line === "string" && arguments.length > 2) { - line = this._getPath(line, x, y, options); - } else if (_typeof(x) === "object") { - // handle options specified in 2nd arg - options = x; - } // handle svg arguments - - if (options && typeof options.decimals === "number") { - decimals = options.decimals; - } - return line.toPathData(decimals); - } /* - * Creates an SVG element, as a string, - * from the given opentype path or string/position - * - * @param {Object} path an opentype path, OR the following: - * - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional), set options.decimals - * to set the decimal precision of the path-data in the element, - * options.fill to set the fill color for the element, - * options.stroke to set the stroke color for the element, - * options.strokeWidth to set the strokeWidth for the element. - * - * @return {Object} this p5.Font object - */, - }, - { - key: "_getSVG", - value: function _getSVG(line, x, y, options) { - var decimals = 3; - // create path from string/position - if (typeof line === "string" && arguments.length > 2) { - line = this._getPath(line, x, y, options); - } else if (_typeof(x) === "object") { - // handle options specified in 2nd arg - options = x; - } // handle svg arguments - - if (options) { - if (typeof options.decimals === "number") { - decimals = options.decimals; - } - if (typeof options.strokeWidth === "number") { - line.strokeWidth = options.strokeWidth; - } - if (typeof options.fill !== "undefined") { - line.fill = options.fill; - } - if (typeof options.stroke !== "undefined") { - line.stroke = options.stroke; - } - } - return line.toSVG(decimals); - } /* - * Renders an opentype path or string/position - * to the current graphics context - * - * @param {Object} path an opentype path, OR the following: - * - * @param {String} line a line of text - * @param {Number} x x-position - * @param {Number} y y-position - * @param {Object} options opentype options (optional) - * - * @return {p5.Font} this p5.Font object - */, - }, - { - key: "_renderPath", - value: function _renderPath(line, x, y, options) { - var pdata; - var pg = - (options && options.renderer) || this.parent._renderer; - var ctx = pg.drawingContext; - if (_typeof(line) === "object" && line.commands) { - pdata = line.commands; - } else { - //pos = handleAlignment(p, ctx, line, x, y); - pdata = this._getPath(line, x, y, options).commands; - } - ctx.beginPath(); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = pdata[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var cmd = _step.value; - if (cmd.type === "M") { - ctx.moveTo(cmd.x, cmd.y); - } else if (cmd.type === "L") { - ctx.lineTo(cmd.x, cmd.y); - } else if (cmd.type === "C") { - ctx.bezierCurveTo( - cmd.x1, - cmd.y1, - cmd.x2, - cmd.y2, - cmd.x, - cmd.y, - ); - } else if (cmd.type === "Q") { - ctx.quadraticCurveTo(cmd.x1, cmd.y1, cmd.x, cmd.y); - } else if (cmd.type === "Z") { - ctx.closePath(); - } - } // only draw stroke if manually set by user - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - if (pg._doStroke && pg._strokeSet && !pg._clipping) { - ctx.stroke(); - } - if (pg._doFill && !pg._clipping) { - // if fill hasn't been set by user, use default-text-fill - if (!pg._fillSet) { - pg._setFill(constants._DEFAULT_TEXT_FILL); - } - ctx.fill(); - } - return this; - }, - }, - { - key: "_textWidth", - value: function _textWidth(str, fontSize) { - return this.font.getAdvanceWidth(str, fontSize); - }, - }, - { - key: "_textAscent", - value: function _textAscent(fontSize) { - return this.font.ascender * this._scale(fontSize); - }, - }, - { - key: "_textDescent", - value: function _textDescent(fontSize) { - return -this.font.descender * this._scale(fontSize); - }, - }, - { - key: "_scale", - value: function _scale(fontSize) { - return ( - (1 / this.font.unitsPerEm) * - (fontSize || this.parent._renderer._textSize) - ); - }, - }, - { - key: "_handleAlignment", - value: function _handleAlignment( - renderer, - line, - x, - y, - textWidth, - ) { - var fontSize = renderer._textSize; - if (typeof textWidth === "undefined") { - textWidth = this._textWidth(line, fontSize); - } - switch (renderer._textAlign) { - case constants.CENTER: - x -= textWidth / 2; - break; - case constants.RIGHT: - x -= textWidth; - break; - } - switch (renderer._textBaseline) { - case constants.TOP: - y += this._textAscent(fontSize); - break; - case constants.CENTER: - y += this._textAscent(fontSize) / 2; - break; - case constants.BOTTOM: - y -= this._textDescent(fontSize); - break; - } - return { - x: x, - y: y, - }; - }, - }, - ]); - return _class; - })(); - // path-utils - function pathToPoints(cmds, options) { - var opts = parseOpts(options, { - sampleFactor: 0.1, - simplifyThreshold: 0, - }); - var // total-length - len = pointAtLength(cmds, 0, 1), - t = len / (len * opts.sampleFactor), - pts = []; - for (var i = 0; i < len; i += t) { - pts.push(pointAtLength(cmds, i)); - } - if (opts.simplifyThreshold) { - simplify(pts, opts.simplifyThreshold); - } - return pts; - } - function simplify(pts) { - var angle = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 0; - var num = 0; - for (var i = pts.length - 1; pts.length > 3 && i >= 0; --i) { - if ( - collinear(at(pts, i - 1), at(pts, i), at(pts, i + 1), angle) - ) { - // Remove the middle point - pts.splice(i % pts.length, 1); - num++; - } - } - return num; - } - function splitPaths(cmds) { - var paths = []; - var current; - for (var i = 0; i < cmds.length; i++) { - if (cmds[i].type === "M") { - if (current) { - paths.push(current); - } - current = []; - } - current.push(cmdToArr(cmds[i])); - } - paths.push(current); - return paths; - } - function cmdToArr(cmd) { - var arr = [cmd.type]; - if (cmd.type === "M" || cmd.type === "L") { - // moveto or lineto - arr.push(cmd.x, cmd.y); - } else if (cmd.type === "C") { - arr.push(cmd.x1, cmd.y1, cmd.x2, cmd.y2, cmd.x, cmd.y); - } else if (cmd.type === "Q") { - arr.push(cmd.x1, cmd.y1, cmd.x, cmd.y); - } // else if (cmd.type === 'Z') { /* no-op */ } - - return arr; - } - function parseOpts(options, defaults) { - if (_typeof(options) !== "object") { - options = defaults; - } else { - for (var key in defaults) { - if (typeof options[key] === "undefined") { - options[key] = defaults[key]; - } - } - } - return options; - } //////////////////////// Helpers //////////////////////////// - - function at(v, i) { - var s = v.length; - return v[i < 0 ? (i % s) + s : i % s]; - } - function collinear(a, b, c, thresholdAngle) { - if (!thresholdAngle) { - return areaTriangle(a, b, c) === 0; - } - if (typeof collinear.tmpPoint1 === "undefined") { - collinear.tmpPoint1 = []; - collinear.tmpPoint2 = []; - } - var ab = collinear.tmpPoint1, - bc = collinear.tmpPoint2; - ab.x = b.x - a.x; - ab.y = b.y - a.y; - bc.x = c.x - b.x; - bc.y = c.y - b.y; - var dot = ab.x * bc.x + ab.y * bc.y, - magA = Math.sqrt(ab.x * ab.x + ab.y * ab.y), - magB = Math.sqrt(bc.x * bc.x + bc.y * bc.y), - angle = Math.acos(dot / (magA * magB)); - return angle < thresholdAngle; - } - function areaTriangle(a, b, c) { - return ( - (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]) - ); - } // Portions of below code copyright 2008 Dmitry Baranovskiy (via MIT license) - - function findDotsAtSegment( - p1x, - p1y, - c1x, - c1y, - c2x, - c2y, - p2x, - p2y, - t, - ) { - var t1 = 1 - t; - var t13 = Math.pow(t1, 3); - var t12 = Math.pow(t1, 2); - var t2 = t * t; - var t3 = t2 * t; - var x = - t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x; - var y = - t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y; - var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x); - var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y); - var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x); - var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y); - var ax = t1 * p1x + t * c1x; - var ay = t1 * p1y + t * c1y; - var cx = t1 * c2x + t * p2x; - var cy = t1 * c2y + t * p2y; - var alpha = 90 - (Math.atan2(mx - nx, my - ny) * 180) / Math.PI; - if (mx > nx || my < ny) { - alpha += 180; - } - return { - x: x, - y: y, - m: { - x: mx, - y: my, - }, - n: { - x: nx, - y: ny, - }, - start: { - x: ax, - y: ay, - }, - end: { - x: cx, - y: cy, - }, - alpha: alpha, - }; - } - function getPointAtSegmentLength( - p1x, - p1y, - c1x, - c1y, - c2x, - c2y, - p2x, - p2y, - length, - ) { - return length == null - ? bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) - : findDotsAtSegment( - p1x, - p1y, - c1x, - c1y, - c2x, - c2y, - p2x, - p2y, - getTatLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length), - ); - } - function pointAtLength(path, length, istotal) { - path = path2curve(path); - var x; - var y; - var p; - var l; - var sp = ""; - var subpaths = {}; - var point; - var len = 0; - for (var i = 0, ii = path.length; i < ii; i++) { - p = path[i]; - if (p[0] === "M") { - x = +p[1]; - y = +p[2]; - } else { - l = getPointAtSegmentLength( - x, - y, - p[1], - p[2], - p[3], - p[4], - p[5], - p[6], - ); - if (len + l > length) { - if (!istotal) { - point = getPointAtSegmentLength( - x, - y, - p[1], - p[2], - p[3], - p[4], - p[5], - p[6], - length - len, - ); - return { - x: point.x, - y: point.y, - alpha: point.alpha, - }; - } - } - len += l; - x = +p[5]; - y = +p[6]; - } - sp += p.shift() + p; - } - subpaths.end = sp; - point = istotal - ? len - : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1); - if (point.alpha) { - point = { - x: point.x, - y: point.y, - alpha: point.alpha, - }; - } - return point; - } - function pathToAbsolute(pathArray) { - var res = [], - x = 0, - y = 0, - mx = 0, - my = 0, - start = 0; - if (!pathArray) { - // console.warn("Unexpected state: undefined pathArray"); // shouldn't happen - return res; - } - if (pathArray[0][0] === "M") { - x = +pathArray[0][1]; - y = +pathArray[0][2]; - mx = x; - my = y; - start++; - res[0] = ["M", x, y]; - } - var dots; - var crz = - pathArray.length === 3 && - pathArray[0][0] === "M" && - pathArray[1][0].toUpperCase() === "R" && - pathArray[2][0].toUpperCase() === "Z"; - for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) { - res.push((r = [])); - pa = pathArray[i]; - if (pa[0] !== String.prototype.toUpperCase.call(pa[0])) { - r[0] = String.prototype.toUpperCase.call(pa[0]); - switch (r[0]) { - case "A": - r[1] = pa[1]; - r[2] = pa[2]; - r[3] = pa[3]; - r[4] = pa[4]; - r[5] = pa[5]; - r[6] = +(pa[6] + x); - r[7] = +(pa[7] + y); - break; - case "V": - r[1] = +pa[1] + y; - break; - case "H": - r[1] = +pa[1] + x; - break; - case "R": - dots = [x, y].concat(pa.slice(1)); - for (var j = 2, jj = dots.length; j < jj; j++) { - dots[j] = +dots[j] + x; - dots[++j] = +dots[j] + y; - } - res.pop(); - res = res.concat(catmullRom2bezier(dots, crz)); - break; - case "M": - mx = +pa[1] + x; - my = +pa[2] + y; - break; - default: - for (var _j = 1, _jj = pa.length; _j < _jj; _j++) { - r[_j] = +pa[_j] + (_j % 2 ? x : y); - } - } - } else if (pa[0] === "R") { - dots = [x, y].concat(pa.slice(1)); - res.pop(); - res = res.concat(catmullRom2bezier(dots, crz)); - r = ["R"].concat(pa.slice(-2)); - } else { - for (var k = 0, kk = pa.length; k < kk; k++) { - r[k] = pa[k]; - } - } - switch (r[0]) { - case "Z": - x = mx; - y = my; - break; - case "H": - x = r[1]; - break; - case "V": - y = r[1]; - break; - case "M": - mx = r[r.length - 2]; - my = r[r.length - 1]; - break; - default: - x = r[r.length - 2]; - y = r[r.length - 1]; - } - } - return res; - } - function path2curve(path, path2) { - var p = pathToAbsolute(path), - p2 = path2 && pathToAbsolute(path2); - var attrs = { - x: 0, - y: 0, - bx: 0, - by: 0, - X: 0, - Y: 0, - qx: null, - qy: null, - }; - var attrs2 = { - x: 0, - y: 0, - bx: 0, - by: 0, - X: 0, - Y: 0, - qx: null, - qy: null, - }; - var pcoms1 = []; // path commands of original path p - var pcoms2 = []; // path commands of original path p2 - var ii; - var processPath = function processPath(path, d, pcom) { - var nx; - var ny; - var tq = { - T: 1, - Q: 1, - }; - if (!path) { - return ["C", d.x, d.y, d.x, d.y, d.x, d.y]; - } - if (!(path[0] in tq)) { - d.qx = d.qy = null; - } - switch (path[0]) { - case "M": - d.X = path[1]; - d.Y = path[2]; - break; - case "A": - path = ["C"].concat( - a2c.apply(0, [d.x, d.y].concat(path.slice(1))), - ); - break; - case "S": - if (pcom === "C" || pcom === "S") { - nx = d.x * 2 - d.bx; - ny = d.y * 2 - d.by; - } else { - nx = d.x; - ny = d.y; - } - path = ["C", nx, ny].concat(path.slice(1)); - break; - case "T": - if (pcom === "Q" || pcom === "T") { - d.qx = d.x * 2 - d.qx; - d.qy = d.y * 2 - d.qy; - } else { - d.qx = d.x; - d.qy = d.y; - } - path = ["C"].concat( - q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]), - ); - break; - case "Q": - d.qx = path[1]; - d.qy = path[2]; - path = ["C"].concat( - q2c(d.x, d.y, path[1], path[2], path[3], path[4]), - ); - break; - case "L": - path = ["C"].concat(l2c(d.x, d.y, path[1], path[2])); - break; - case "H": - path = ["C"].concat(l2c(d.x, d.y, path[1], d.y)); - break; - case "V": - path = ["C"].concat(l2c(d.x, d.y, d.x, path[1])); - break; - case "Z": - path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y)); - break; - } - return path; - }, - fixArc = function fixArc(pp, i) { - if (pp[i].length > 7) { - pp[i].shift(); - var pi = pp[i]; - while (pi.length) { - pcoms1[i] = "A"; - if (p2) { - pcoms2[i] = "A"; - } - pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6))); - } - pp.splice(i, 1); - ii = Math.max(p.length, (p2 && p2.length) || 0); - } - }, - fixM = function fixM(path1, path2, a1, a2, i) { - if ( - path1 && - path2 && - path1[i][0] === "M" && - path2[i][0] !== "M" - ) { - path2.splice(i, 0, ["M", a2.x, a2.y]); - a1.bx = 0; - a1.by = 0; - a1.x = path1[i][1]; - a1.y = path1[i][2]; - ii = Math.max(p.length, (p2 && p2.length) || 0); - } - }; - var pfirst = ""; // temporary holder for original path command - var pcom = ""; // holder for previous path command of original path - ii = Math.max(p.length, (p2 && p2.length) || 0); - for (var i = 0; i < ii; i++) { - if (p[i]) { - pfirst = p[i][0]; - } // save current path command - - if (pfirst !== "C") { - pcoms1[i] = pfirst; // Save current path command - if (i) { - pcom = pcoms1[i - 1]; - } // Get previous path command pcom - } - p[i] = processPath(p[i], attrs, pcom); - if (pcoms1[i] !== "A" && pfirst === "C") { - pcoms1[i] = "C"; - } - fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1 - if (p2) { - // the same procedures is done to p2 - if (p2[i]) { - pfirst = p2[i][0]; - } - if (pfirst !== "C") { - pcoms2[i] = pfirst; - if (i) { - pcom = pcoms2[i - 1]; - } - } - p2[i] = processPath(p2[i], attrs2, pcom); - if (pcoms2[i] !== "A" && pfirst === "C") { - pcoms2[i] = "C"; - } - fixArc(p2, i); - } - fixM(p, p2, attrs, attrs2, i); - fixM(p2, p, attrs2, attrs, i); - var seg = p[i], - seg2 = p2 && p2[i], - seglen = seg.length, - seg2len = p2 && seg2.length; - attrs.x = seg[seglen - 2]; - attrs.y = seg[seglen - 1]; - attrs.bx = parseFloat(seg[seglen - 4]) || attrs.x; - attrs.by = parseFloat(seg[seglen - 3]) || attrs.y; - attrs2.bx = p2 && (parseFloat(seg2[seg2len - 4]) || attrs2.x); - attrs2.by = p2 && (parseFloat(seg2[seg2len - 3]) || attrs2.y); - attrs2.x = p2 && seg2[seg2len - 2]; - attrs2.y = p2 && seg2[seg2len - 1]; - } - return p2 ? [p, p2] : p; - } - function a2c( - x1, - y1, - rx, - ry, - angle, - lac, - sweep_flag, - x2, - y2, - recursive, - ) { - // for more information of where this Math came from visit: - // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes - var PI = Math.PI; - var _120 = (PI * 120) / 180; - var f1; - var f2; - var cx; - var cy; - var rad = (PI / 180) * (+angle || 0); - var res = []; - var xy; - var rotate = function rotate(x, y, rad) { - var X = x * Math.cos(rad) - y * Math.sin(rad), - Y = x * Math.sin(rad) + y * Math.cos(rad); - return { - x: X, - y: Y, - }; - }; - if (!recursive) { - xy = rotate(x1, y1, -rad); - x1 = xy.x; - y1 = xy.y; - xy = rotate(x2, y2, -rad); - x2 = xy.x; - y2 = xy.y; - var x = (x1 - x2) / 2; - var y = (y1 - y2) / 2; - var h = (x * x) / (rx * rx) + (y * y) / (ry * ry); - if (h > 1) { - h = Math.sqrt(h); - rx = h * rx; - ry = h * ry; - } - var rx2 = rx * rx, - ry2 = ry * ry; - var k = - (lac === sweep_flag ? -1 : 1) * - Math.sqrt( - Math.abs( - (rx2 * ry2 - rx2 * y * y - ry2 * x * x) / - (rx2 * y * y + ry2 * x * x), - ), - ); - cx = (k * rx * y) / ry + (x1 + x2) / 2; - cy = (k * -ry * x) / rx + (y1 + y2) / 2; - f1 = Math.asin(((y1 - cy) / ry).toFixed(9)); - f2 = Math.asin(((y2 - cy) / ry).toFixed(9)); - f1 = x1 < cx ? PI - f1 : f1; - f2 = x2 < cx ? PI - f2 : f2; - if (f1 < 0) { - f1 = PI * 2 + f1; - } - if (f2 < 0) { - f2 = PI * 2 + f2; - } - if (sweep_flag && f1 > f2) { - f1 = f1 - PI * 2; - } - if (!sweep_flag && f2 > f1) { - f2 = f2 - PI * 2; - } - } else { - f1 = recursive[0]; - f2 = recursive[1]; - cx = recursive[2]; - cy = recursive[3]; - } - var df = f2 - f1; - if (Math.abs(df) > _120) { - var f2old = f2, - x2old = x2, - y2old = y2; - f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1); - x2 = cx + rx * Math.cos(f2); - y2 = cy + ry * Math.sin(f2); - res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [ - f2, - f2old, - cx, - cy, - ]); - } - df = f2 - f1; - var c1 = Math.cos(f1), - s1 = Math.sin(f1), - c2 = Math.cos(f2), - s2 = Math.sin(f2), - t = Math.tan(df / 4), - hx = (4 / 3) * rx * t, - hy = (4 / 3) * ry * t, - m1 = [x1, y1], - m2 = [x1 + hx * s1, y1 - hy * c1], - m3 = [x2 + hx * s2, y2 - hy * c2], - m4 = [x2, y2]; - m2[0] = 2 * m1[0] - m2[0]; - m2[1] = 2 * m1[1] - m2[1]; - if (recursive) { - return [m2, m3, m4].concat(res); - } else { - res = [m2, m3, m4].concat(res).join().split(","); - var newres = []; - for (var i = 0, ii = res.length; i < ii; i++) { - newres[i] = - i % 2 - ? rotate(res[i - 1], res[i], rad).y - : rotate(res[i], res[i + 1], rad).x; - } - return newres; - } - } // http://schepers.cc/getting-to-the-point - - function catmullRom2bezier(crp, z) { - var d = []; - for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) { - var p = [ - { - x: +crp[i - 2], - y: +crp[i - 1], - }, - { - x: +crp[i], - y: +crp[i + 1], - }, - { - x: +crp[i + 2], - y: +crp[i + 3], - }, - { - x: +crp[i + 4], - y: +crp[i + 5], - }, - ]; - if (z) { - if (!i) { - p[0] = { - x: +crp[iLen - 2], - y: +crp[iLen - 1], - }; - } else if (iLen - 4 === i) { - p[3] = { - x: +crp[0], - y: +crp[1], - }; - } else if (iLen - 2 === i) { - p[2] = { - x: +crp[0], - y: +crp[1], - }; - p[3] = { - x: +crp[2], - y: +crp[3], - }; - } - } else { - if (iLen - 4 === i) { - p[3] = p[2]; - } else if (!i) { - p[0] = { - x: +crp[i], - y: +crp[i + 1], - }; - } - } - d.push([ - "C", - (-p[0].x + 6 * p[1].x + p[2].x) / 6, - (-p[0].y + 6 * p[1].y + p[2].y) / 6, - (p[1].x + 6 * p[2].x - p[3].x) / 6, - (p[1].y + 6 * p[2].y - p[3].y) / 6, - p[2].x, - p[2].y, - ]); - } - return d; - } - function l2c(x1, y1, x2, y2) { - return [x1, y1, x2, y2, x2, y2]; - } - function q2c(x1, y1, ax, ay, x2, y2) { - var _13 = 1 / 3, - _23 = 2 / 3; - return [ - _13 * x1 + _23 * ax, - _13 * y1 + _23 * ay, - _13 * x2 + _23 * ax, - _13 * y2 + _23 * ay, - x2, - y2, - ]; - } - function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) { - if (z == null) { - z = 1; - } - z = z > 1 ? 1 : z < 0 ? 0 : z; - var z2 = z / 2; - var n = 12; - var Tvalues = [ - -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, - 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, - ]; - var sum = 0; - var Cvalues = [ - 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, - 0.1069, 0.1069, 0.0472, 0.0472, - ]; - for (var i = 0; i < n; i++) { - var ct = z2 * Tvalues[i] + z2, - xbase = base3(ct, x1, x2, x3, x4), - ybase = base3(ct, y1, y2, y3, y4), - comb = xbase * xbase + ybase * ybase; - sum += Cvalues[i] * Math.sqrt(comb); - } - return z2 * sum; - } - function getTatLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) { - if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) { - return; - } - var t = 1; - var step = t / 2; - var t2 = t - step; - var l; - var e = 0.01; - l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); - while (Math.abs(l - ll) > e) { - step /= 2; - t2 += (l < ll ? 1 : -1) * step; - l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2); - } - return t2; - } - function base3(t, p1, p2, p3, p4) { - var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4, - t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3; - return t * t2 - 3 * p1 + 3 * p2; - } - function cacheKey() { - var hash = ""; - for (var i = arguments.length - 1; i >= 0; --i) { - hash += "?".concat( - i < 0 || arguments.length <= i ? undefined : arguments[i], - ); - } - return hash; - } - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.number.to-fixed": 193, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 337: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.array-buffer.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.array-buffer.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Data - * @submodule Array Functions - * @for p5 - * @requires core - */ - /** - * Adds a value to the end of an array. Extends the length of - * the array by one. Maps to Array.push(). - * - * @method append - * @deprecated Use array.push(value) instead. - * @param {Array} array Array to append - * @param {any} value to be added to the Array - * @return {Array} the array that was appended to - * @example - *
                                  - * function setup() { - * let myArray = ['Mango', 'Apple', 'Papaya']; - * print(myArray); // ['Mango', 'Apple', 'Papaya'] - * - * append(myArray, 'Peach'); - * print(myArray); // ['Mango', 'Apple', 'Papaya', 'Peach'] - * } - *
                                  - */ - - _main.default.prototype.append = function (array, value) { - array.push(value); - return array; - }; - /** - * Copies an array (or part of an array) to another array. The src array is - * copied to the dst array, beginning at the position specified by - * srcPosition and into the position specified by dstPosition. The number of - * elements to copy is determined by length. Note that copying values - * overwrites existing values in the destination array. To append values - * instead of overwriting them, use concat(). - * - * The simplified version with only two arguments, arrayCopy(src, dst), - * copies an entire array to another of the same size. It is equivalent to - * arrayCopy(src, 0, dst, 0, src.length). - * - * Using this function is far more efficient for copying array data than - * iterating through a for() loop and copying each element individually. - * - * @method arrayCopy - * @deprecated Use arr1.copyWithin(arr2) instead. - * @param {Array} src the source Array - * @param {Integer} srcPosition starting position in the source Array - * @param {Array} dst the destination Array - * @param {Integer} dstPosition starting position in the destination Array - * @param {Integer} length number of Array elements to be copied - * - * @example - *
                                  - * let src = ['A', 'B', 'C']; - * let dst = [1, 2, 3]; - * let srcPosition = 1; - * let dstPosition = 0; - * let length = 2; - * - * print(src); // ['A', 'B', 'C'] - * print(dst); // [ 1 , 2 , 3 ] - * - * arrayCopy(src, srcPosition, dst, dstPosition, length); - * print(dst); // ['B', 'C', 3] - *
                                  - */ - /** - * @method arrayCopy - * @deprecated Use arr1.copyWithin(arr2) instead. - * @param {Array} src - * @param {Array} dst - * @param {Integer} [length] - */ - _main.default.prototype.arrayCopy = function ( - src, - srcPosition, - dst, - dstPosition, - length, - ) { - // the index to begin splicing from dst array - var start; - var end; - if (typeof length !== "undefined") { - end = Math.min(length, src.length); - start = dstPosition; - src = src.slice(srcPosition, end + srcPosition); - } else { - if (typeof dst !== "undefined") { - // src, dst, length - // rename so we don't get confused - end = dst; - end = Math.min(end, src.length); - } else { - // src, dst - end = src.length; - } - start = 0; - // rename so we don't get confused - dst = srcPosition; - src = src.slice(0, end); - } // Since we are not returning the array and JavaScript is pass by reference - // we must modify the actual values of the array - // instead of reassigning arrays - - Array.prototype.splice.apply(dst, [start, end].concat(src)); - }; - /** - * Concatenates two arrays, maps to Array.concat(). Does not modify the - * input arrays. - * - * @method concat - * @deprecated Use arr1.concat(arr2) instead. - * @param {Array} a first Array to concatenate - * @param {Array} b second Array to concatenate - * @return {Array} concatenated array - * - * @example - *
                                  - * function setup() { - * let arr1 = ['A', 'B', 'C']; - * let arr2 = [1, 2, 3]; - * - * print(arr1); // ['A','B','C'] - * print(arr2); // [1,2,3] - * - * let arr3 = concat(arr1, arr2); - * - * print(arr1); // ['A','B','C'] - * print(arr2); // [1, 2, 3] - * print(arr3); // ['A','B','C', 1, 2, 3] - * } - *
                                  - */ - _main.default.prototype.concat = function (list0, list1) { - return list0.concat(list1); - }; - /** - * Reverses the order of an array, maps to Array.reverse() - * - * @method reverse - * @deprecated Use array.reverse() instead. - * @param {Array} list Array to reverse - * @return {Array} the reversed list - * @example - *
                                  - * function setup() { - * let myArray = ['A', 'B', 'C']; - * print(myArray); // ['A','B','C'] - * - * reverse(myArray); - * print(myArray); // ['C','B','A'] - * } - *
                                  - */ - _main.default.prototype.reverse = function (list) { - return list.reverse(); - }; - /** - * Decreases an array by one element and returns the shortened array, - * maps to Array.pop(). - * - * @method shorten - * @deprecated Use array.pop() instead. - * @param {Array} list Array to shorten - * @return {Array} shortened Array - * @example - *
                                  - * function setup() { - * let myArray = ['A', 'B', 'C']; - * print(myArray); // ['A', 'B', 'C'] - * let newArray = shorten(myArray); - * print(myArray); // ['A','B','C'] - * print(newArray); // ['A','B'] - * } - *
                                  - */ - _main.default.prototype.shorten = function (list) { - list.pop(); - return list; - }; - /** - * Randomizes the order of the elements of an array. Implements - * - * Fisher-Yates Shuffle Algorithm. - * - * @method shuffle - * @param {Array} array Array to shuffle - * @param {Boolean} [bool] modify passed array - * @return {Array} shuffled Array - * @example - *
                                  - * function setup() { - * let regularArr = ['ABC', 'def', createVector(), TAU, Math.E]; - * print(regularArr); - * shuffle(regularArr, true); // force modifications to passed array - * print(regularArr); - * - * // By default shuffle() returns a shuffled cloned array: - * let newArr = shuffle(regularArr); - * print(regularArr); - * print(newArr); - * } - *
                                  - */ - _main.default.prototype.shuffle = function (arr, bool) { - var isView = - ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(arr); - arr = bool || isView ? arr : arr.slice(); - var rnd, - tmp, - idx = arr.length; - while (idx > 1) { - rnd = (this.random(0, 1) * idx) | 0; - tmp = arr[--idx]; - arr[idx] = arr[rnd]; - arr[rnd] = tmp; - } - return arr; - }; - /** - * Sorts an array of numbers from smallest to largest, or puts an array of - * words in alphabetical order. The original array is not modified; a - * re-ordered array is returned. The count parameter states the number of - * elements to sort. For example, if there are 12 elements in an array and - * count is set to 5, only the first 5 elements in the array will be sorted. - * - * @method sort - * @deprecated Use array.sort() instead. - * @param {Array} list Array to sort - * @param {Integer} [count] number of elements to sort, starting from 0 - * @return {Array} the sorted list - * - * @example - *
                                  - * function setup() { - * let words = ['banana', 'apple', 'pear', 'lime']; - * print(words); // ['banana', 'apple', 'pear', 'lime'] - * let count = 4; // length of array - * - * words = sort(words, count); - * print(words); // ['apple', 'banana', 'lime', 'pear'] - * } - *
                                  - *
                                  - * function setup() { - * let numbers = [2, 6, 1, 5, 14, 9, 8, 12]; - * print(numbers); // [2, 6, 1, 5, 14, 9, 8, 12] - * let count = 5; // Less than the length of the array - * - * numbers = sort(numbers, count); - * print(numbers); // [1,2,5,6,14,9,8,12] - * } - *
                                  - */ - _main.default.prototype.sort = function (list, count) { - var arr = count - ? list.slice(0, Math.min(count, list.length)) - : list; - var rest = count ? list.slice(Math.min(count, list.length)) : []; - if (typeof arr[0] === "string") { - arr = arr.sort(); - } else { - arr = arr.sort(function (a, b) { - return a - b; - }); - } - return arr.concat(rest); - }; - /** - * Inserts a value or an array of values into an existing array. The first - * parameter specifies the initial array to be modified, and the second - * parameter defines the data to be inserted. The third parameter is an index - * value which specifies the array position from which to insert data. - * (Remember that array index numbering starts at zero, so the first position - * is 0, the second position is 1, and so on.) - * - * @method splice - * @deprecated Use array.splice() instead. - * @param {Array} list Array to splice into - * @param {any} value value to be spliced in - * @param {Integer} position in the array from which to insert data - * @return {Array} the list - * - * @example - *
                                  - * function setup() { - * let myArray = [0, 1, 2, 3, 4]; - * let insArray = ['A', 'B', 'C']; - * print(myArray); // [0, 1, 2, 3, 4] - * print(insArray); // ['A','B','C'] - * - * splice(myArray, insArray, 3); - * print(myArray); // [0,1,2,'A','B','C',3,4] - * } - *
                                  - */ - _main.default.prototype.splice = function (list, value, index) { - // note that splice returns spliced elements and not an array - Array.prototype.splice.apply(list, [index, 0].concat(value)); - return list; - }; - /** - * Extracts an array of elements from an existing array. The list parameter - * defines the array from which the elements will be copied, and the start - * and count parameters specify which elements to extract. If no count is - * given, elements will be extracted from the start to the end of the array. - * When specifying the start, remember that the first array element is 0. - * This function does not change the source array. - * - * @method subset - * @deprecated Use array.slice() instead. - * @param {Array} list Array to extract from - * @param {Integer} start position to begin - * @param {Integer} [count] number of values to extract - * @return {Array} Array of extracted elements - * - * @example - *
                                  - * function setup() { - * let myArray = [1, 2, 3, 4, 5]; - * print(myArray); // [1, 2, 3, 4, 5] - * - * let sub1 = subset(myArray, 0, 3); - * let sub2 = subset(myArray, 2, 2); - * print(sub1); // [1,2,3] - * print(sub2); // [3,4] - * } - *
                                  - */ - _main.default.prototype.subset = function (list, start, count) { - if (typeof count !== "undefined") { - return list.slice(start, start + count); - } else { - return list.slice(start, list.length); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array-buffer.constructor": 168, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.object.to-string": 200, - }, - ], - 338: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.repeat"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.number.constructor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.repeat"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Data - * @submodule Conversion - * @for p5 - * @requires core - */ - /** - * Converts a string to its floating point representation. The contents of a - * string must resemble a number, or NaN (not a number) will be returned. - * For example, float("1234.56") evaluates to 1234.56, but float("giraffe") - * will return NaN. - * - * When an array of values is passed in, then an array of floats of the same - * length is returned. - * - * @method float - * @param {String} str float string to parse - * @return {Number} floating point representation of string - * @example - *
                                  - * let str = '20'; - * let diameter = float(str); - * ellipse(width / 2, height / 2, diameter, diameter); - * describe('20-by-20 white ellipse in the center of the canvas'); - *
                                  - *
                                  - * print(float('10.31')); // 10.31 - * print(float('Infinity')); // Infinity - * print(float('-Infinity')); // -Infinity - *
                                  - */ - - _main.default.prototype.float = function (str) { - if (str instanceof Array) { - return str.map(parseFloat); - } - return parseFloat(str); - }; - /** - * Converts a boolean, string, or float to its integer representation. - * When an array of values is passed in, then an int array of the same length - * is returned. - * - * @method int - * @param {String|Boolean|Number} n value to parse - * @param {Integer} [radix] the radix to convert to (default: 10) - * @return {Number} integer representation of value - * - * @example - *
                                  - * print(int('10')); // 10 - * print(int(10.31)); // 10 - * print(int(-10)); // -10 - * print(int(true)); // 1 - * print(int(false)); // 0 - * print(int([false, true, '10.3', 9.8])); // [0, 1, 10, 9] - * print(int(Infinity)); // Infinity - * print(int('-Infinity')); // -Infinity - *
                                  - */ - /** - * @method int - * @param {Array} ns values to parse - * @param {Integer} [radix] - * @return {Number[]} integer representation of values - */ - _main.default.prototype.int = function (n) { - var radix = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : 10; - if (n === Infinity || n === "Infinity") { - return Infinity; - } else if (n === -Infinity || n === "-Infinity") { - return -Infinity; - } else if (typeof n === "string") { - return parseInt(n, radix); - } else if (typeof n === "number") { - return n | 0; - } else if (typeof n === "boolean") { - return n ? 1 : 0; - } else if (n instanceof Array) { - return n.map(function (n) { - return _main.default.prototype.int(n, radix); - }); - } - }; - /** - * Converts a boolean, string or number to its string representation. - * When an array of values is passed in, then an array of strings of the same - * length is returned. - * - * @method str - * @param {String|Boolean|Number|Array} n value to parse - * @return {String} string representation of value - * @example - *
                                  - * print(str('10')); // "10" - * print(str(10.31)); // "10.31" - * print(str(-10)); // "-10" - * print(str(true)); // "true" - * print(str(false)); // "false" - * print(str([true, '10.3', 9.8])); // [ "true", "10.3", "9.8" ] - *
                                  - */ - _main.default.prototype.str = function (n) { - if (n instanceof Array) { - return n.map(_main.default.prototype.str); - } else { - return String(n); - } - }; - /** - * Converts a number or string to its boolean representation. - * For a number, any non-zero value (positive or negative) evaluates to true, - * while zero evaluates to false. For a string, the value "true" evaluates to - * true, while any other value evaluates to false. When an array of number or - * string values is passed in, then a array of booleans of the same length is - * returned. - * - * @method boolean - * @param {String|Boolean|Number|Array} n value to parse - * @return {Boolean} boolean representation of value - * @example - *
                                  - * print(boolean(0)); // false - * print(boolean(1)); // true - * print(boolean('true')); // true - * print(boolean('abcd')); // false - * print(boolean([0, 12, 'true'])); // [false, true, true] - *
                                  - */ - _main.default.prototype.boolean = function (n) { - if (typeof n === "number") { - return n !== 0; - } else if (typeof n === "string") { - return n.toLowerCase() === "true"; - } else if (typeof n === "boolean") { - return n; - } else if (n instanceof Array) { - return n.map(_main.default.prototype.boolean); - } - }; - /** - * Converts a number, string representation of a number, or boolean to its byte - * representation. A byte can be only a whole number between -128 and 127, so - * when a value outside of this range is converted, it wraps around to the - * corresponding byte representation. When an array of number, string or boolean - * values is passed in, then an array of bytes the same length is returned. - * - * @method byte - * @param {String|Boolean|Number} n value to parse - * @return {Number} byte representation of value - * - * @example - *
                                  - * print(byte(127)); // 127 - * print(byte(128)); // -128 - * print(byte(23.4)); // 23 - * print(byte('23.4')); // 23 - * print(byte('hello')); // NaN - * print(byte(true)); // 1 - * print(byte([0, 255, '100'])); // [0, -1, 100] - *
                                  - */ - /** - * @method byte - * @param {Array} ns values to parse - * @return {Number[]} array of byte representation of values - */ - _main.default.prototype.byte = function (n) { - var nn = _main.default.prototype.int(n, 10); - if (typeof nn === "number") { - return ((nn + 128) % 256) - 128; - } else if (nn instanceof Array) { - return nn.map(_main.default.prototype.byte); - } - }; - /** - * Converts a number or string to its corresponding single-character - * string representation. If a string parameter is provided, it is first - * parsed as an integer and then translated into a single-character string. - * When an array of number or string values is passed in, then an array of - * single-character strings of the same length is returned. - * - * @method char - * @param {String|Number} n value to parse - * @return {String} string representation of value - * - * @example - *
                                  - * print(char(65)); // "A" - * print(char('65')); // "A" - * print(char([65, 66, 67])); // [ "A", "B", "C" ] - * print(join(char([65, 66, 67]), '')); // "ABC" - *
                                  - */ - /** - * @method char - * @param {Array} ns values to parse - * @return {String[]} array of string representation of values - */ - _main.default.prototype.char = function (n) { - if (typeof n === "number" && !isNaN(n)) { - return String.fromCharCode(n); - } else if (n instanceof Array) { - return n.map(_main.default.prototype.char); - } else if (typeof n === "string") { - return _main.default.prototype.char(parseInt(n, 10)); - } - }; - /** - * Converts a single-character string to its corresponding integer - * representation. When an array of single-character string values is passed - * in, then an array of integers of the same length is returned. - * - * @method unchar - * @param {String} n value to parse - * @return {Number} integer representation of value - * - * @example - *
                                  - * print(unchar('A')); // 65 - * print(unchar(['A', 'B', 'C'])); // [ 65, 66, 67 ] - * print(unchar(split('ABC', ''))); // [ 65, 66, 67 ] - *
                                  - */ - /** - * @method unchar - * @param {Array} ns values to parse - * @return {Number[]} integer representation of values - */ - _main.default.prototype.unchar = function (n) { - if (typeof n === "string" && n.length === 1) { - return n.charCodeAt(0); - } else if (n instanceof Array) { - return n.map(_main.default.prototype.unchar); - } - }; - /** - * Converts a number to a string in its equivalent hexadecimal notation. If a - * second parameter is passed, it is used to set the number of characters to - * generate in the hexadecimal notation. When an array is passed in, an - * array of strings in hexadecimal notation of the same length is returned. - * - * @method hex - * @param {Number} n value to parse - * @param {Number} [digits] - * @return {String} hexadecimal string representation of value - * - * @example - *
                                  - * print(hex(255)); // "000000FF" - * print(hex(255, 6)); // "0000FF" - * print(hex([0, 127, 255], 6)); // [ "000000", "00007F", "0000FF" ] - * print(Infinity); // "FFFFFFFF" - * print(-Infinity); // "00000000" - *
                                  - */ - /** - * @method hex - * @param {Number[]} ns array of values to parse - * @param {Number} [digits] - * @return {String[]} hexadecimal string representation of values - */ - _main.default.prototype.hex = function (n, digits) { - digits = - digits === undefined || digits === null ? (digits = 8) : digits; - if (n instanceof Array) { - return n.map(function (n) { - return _main.default.prototype.hex(n, digits); - }); - } else if (n === Infinity || n === -Infinity) { - var c = n === Infinity ? "F" : "0"; - return c.repeat(digits); - } else if (typeof n === "number") { - if (n < 0) { - n = 4294967295 + n + 1; - } - var hex = Number(n).toString(16).toUpperCase(); - while (hex.length < digits) { - hex = "0".concat(hex); - } - if (hex.length >= digits) { - hex = hex.substring(hex.length - digits, hex.length); - } - return hex; - } - }; - /** - * Converts a string representation of a hexadecimal number to its equivalent - * integer value. When an array of strings in hexadecimal notation is passed - * in, an array of integers of the same length is returned. - * - * @method unhex - * @param {String} n value to parse - * @return {Number} integer representation of hexadecimal value - * - * @example - *
                                  - * print(unhex('A')); // 10 - * print(unhex('FF')); // 255 - * print(unhex(['FF', 'AA', '00'])); // [ 255, 170, 0 ] - *
                                  - */ - /** - * @method unhex - * @param {Array} ns values to parse - * @return {Number[]} integer representations of hexadecimal value - */ - _main.default.prototype.unhex = function (n) { - if (n instanceof Array) { - return n.map(_main.default.prototype.unhex); - } else { - return parseInt("0x".concat(n), 16); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.number.constructor": 191, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.repeat": 213, - }, - ], - 339: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.pad-start"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.array.filter"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.constructor"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.pad-start"); - _dereq_("core-js/modules/es.string.replace"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - _dereq_("../core/friendly_errors/validate_params"); - _dereq_("../core/friendly_errors/file_errors"); - _dereq_("../core/friendly_errors/fes_core"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _slicedToArray(arr, i) { - return ( - _arrayWithHoles(arr) || - _iterableToArrayLimit(arr, i) || - _nonIterableRest() - ); - } - function _nonIterableRest() { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance", - ); - } - function _iterableToArrayLimit(arr, i) { - if ( - !( - Symbol.iterator in Object(arr) || - Object.prototype.toString.call(arr) === "[object Arguments]" - ) - ) { - return; - } - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - try { - for ( - var _i = arr[Symbol.iterator](), _s; - !(_n = (_s = _i.next()).done); - _n = true - ) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } /** - * @module Data - * @submodule String Functions - * @for p5 - * @requires core - */ - //return p5; //LM is this a mistake? - /** - * Combines an array of Strings into one String, each separated by the - * character(s) used for the separator parameter. To join arrays of ints or - * floats, it's necessary to first convert them to Strings using nf() or - * nfs(). - * - * @method join - * @param {Array} list array of Strings to be joined - * @param {String} separator String to be placed between each item - * @return {String} joined String - * @example - *
                                  - * - * let array = ['Hello', 'world!']; - * let separator = ' '; - * let message = join(array, separator); - * text(message, 5, 50); - * describe('“Hello world!” displayed middle left of canvas.'); - * - *
                                  - */ - - _main.default.prototype.join = function (list, separator) { - _main.default._validateParameters("join", arguments); - return list.join(separator); - }; - /** - * This function is used to apply a regular expression to a piece of text, - * and return matching groups (elements found inside parentheses) as a - * String array. If there are no matches, a null value will be returned. - * If no groups are specified in the regular expression, but the sequence - * matches, an array of length 1 (with the matched text as the first element - * of the array) will be returned. - * - * To use the function, first check to see if the result is null. If the - * result is null, then the sequence did not match at all. If the sequence - * did match, an array is returned. - * - * If there are groups (specified by sets of parentheses) in the regular - * expression, then the contents of each will be returned in the array. - * Element [0] of a regular expression match returns the entire matching - * string, and the match groups start at element [1] (the first group is [1], - * the second [2], and so on). - * - * @method match - * @param {String} str the String to be searched - * @param {String} regexp the regexp to be used for matching - * @return {String[]} Array of Strings found - * @example - *
                                  - * - * let string = 'Hello p5js*!'; - * let regexp = 'p5js\\*'; - * let m = match(string, regexp); - * text(m, 5, 50); - * describe('“p5js*” displayed middle left of canvas.'); - * - *
                                  - */ - _main.default.prototype.match = function (str, reg) { - _main.default._validateParameters("match", arguments); - return str.match(reg); - }; - /** - * This function is used to apply a regular expression to a piece of text, - * and return a list of matching groups (elements found inside parentheses) - * as a two-dimensional String array. If there are no matches, a null value - * will be returned. If no groups are specified in the regular expression, - * but the sequence matches, a two dimensional array is still returned, but - * the second dimension is only of length one. - * - * To use the function, first check to see if the result is null. If the - * result is null, then the sequence did not match at all. If the sequence - * did match, a 2D array is returned. - * - * If there are groups (specified by sets of parentheses) in the regular - * expression, then the contents of each will be returned in the array. - * Assuming a loop with counter variable i, element [i][0] of a regular - * expression match returns the entire matching string, and the match groups - * start at element [i][1] (the first group is [i][1], the second [i][2], - * and so on). - * - * @method matchAll - * @param {String} str the String to be searched - * @param {String} regexp the regexp to be used for matching - * @return {String[]} 2d Array of Strings found - * @example - *
                                  - * - * let string = 'Hello p5js*! Hello world!'; - * let regexp = 'Hello'; - * matchAll(string, regexp); - * - *
                                  - */ - _main.default.prototype.matchAll = function (str, reg) { - _main.default._validateParameters("matchAll", arguments); - var re = new RegExp(reg, "g"); - var match = re.exec(str); - var matches = []; - while (match !== null) { - matches.push(match); - // matched text: match[0] - // match start: match.index - // capturing group n: match[n] - match = re.exec(str); - } - return matches; - }; - /** - * Utility function for formatting numbers into strings. There are two - * versions: one for formatting floats, and one for formatting ints. - * - * The values for the digits, left, and right parameters should always - * be positive integers. - * - * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter - * if greater than the current length of the number. - * - * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 - * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than - * the result will be 123.200. - * - * @method nf - * @param {Number|String} num the Number to format - * @param {Integer|String} [left] number of digits to the left of the - * decimal point - * @param {Integer|String} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                                  - * - * function setup() { - * background(200); - * let num1 = 321; - * let num2 = -1321; - * - * noStroke(); - * fill(0); - * textSize(16); - * - * text(nf(num1, 4, 2), 10, 30); - * text(nf(num2, 4, 2), 10, 80); - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“0321.00” middle top, “-1321.00” middle bottom canvas'); - * } - * - *
                                  - */ - /** - * @method nf - * @param {Array} nums the Numbers to format - * @param {Integer|String} [left] - * @param {Integer|String} [right] - * @return {String[]} formatted Strings - */ - _main.default.prototype.nf = function (nums, left, right) { - _main.default._validateParameters("nf", arguments); - if (nums instanceof Array) { - return nums.map(function (x) { - return doNf(x, left, right); - }); - } else { - var typeOfFirst = Object.prototype.toString.call(nums); - if (typeOfFirst === "[object Arguments]") { - if (nums.length === 3) { - return this.nf(nums[0], nums[1], nums[2]); - } else if (nums.length === 2) { - return this.nf(nums[0], nums[1]); - } else { - return this.nf(nums[0]); - } - } else { - return doNf(nums, left, right); - } - } - }; - function doNf(num, left, right) { - var _num$toString$split = num.toString().split("."), - _num$toString$split2 = _slicedToArray(_num$toString$split, 2), - leftPart = _num$toString$split2[0], - rightPart = _num$toString$split2[1]; - if (typeof right === "undefined") { - leftPart = leftPart.padStart(left, "0"); - return rightPart ? leftPart + "." + rightPart : leftPart; - } else { - var roundedOff = num.toFixed(right); - var _roundedOff$toString$ = roundedOff.toString().split("."); - var _roundedOff$toString$2 = _slicedToArray( - _roundedOff$toString$, - 2, - ); - leftPart = _roundedOff$toString$2[0]; - rightPart = _roundedOff$toString$2[1]; - leftPart = leftPart.padStart(left, "0"); - if (typeof rightPart === "undefined") { - return leftPart; - } else { - return leftPart + "." + rightPart; - } - } - } /** - * Utility function for formatting numbers into strings and placing - * appropriate commas to mark units of 1000. There are two versions: one - * for formatting ints, and one for formatting an array of ints. The value - * for the right parameter should always be a positive integer. - * - * @method nfc - * @param {Number|String} num the Number to format - * @param {Integer|String} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                                  - * - * function setup() { - * background(200); - * let num = 11253106.115; - * let numArr = [1, 1, 2]; - * - * noStroke(); - * fill(0); - * textSize(12); - * - * // Draw formatted numbers - * text(nfc(num, 4), 10, 30); - * text(nfc(numArr, 2), 10, 80); - * - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“11,253,106.115” top middle and “1.00,1.00,2.00” displayed bottom mid'); - * } - * - *
                                  - */ - /** - * @method nfc - * @param {Array} nums the Numbers to format - * @param {Integer|String} [right] - * @return {String[]} formatted Strings - */ - - _main.default.prototype.nfc = function (num, right) { - _main.default._validateParameters("nfc", arguments); - if (num instanceof Array) { - return num.map(function (x) { - return doNfc(x, right); - }); - } else { - return doNfc(num, right); - } - }; - function doNfc(num, right) { - num = num.toString(); - var dec = num.indexOf("."); - var rem = dec !== -1 ? num.substring(dec) : ""; - var n = dec !== -1 ? num.substring(0, dec) : num; - n = n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); - if (right === 0) { - rem = ""; - } else if (typeof right !== "undefined") { - if (right > rem.length) { - rem += dec === -1 ? "." : ""; - var len = right - rem.length + 1; - for (var i = 0; i < len; i++) { - rem += "0"; - } - } else { - rem = rem.substring(0, right + 1); - } - } - return n + rem; - } /** - * Utility function for formatting numbers into strings. Similar to nf() but - * puts a "+" in front of positive numbers and a "-" in front of negative - * numbers. There are two versions: one for formatting floats, and one for - * formatting ints. The values for left, and right parameters - * should always be positive integers. - * - * @method nfp - * @param {Number} num the Number to format - * @param {Integer} [left] number of digits to the left of the decimal - * point - * @param {Integer} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                                  - * - * function setup() { - * background(200); - * let num1 = 11253106.115; - * let num2 = -11253106.115; - * - * noStroke(); - * fill(0); - * textSize(12); - * - * // Draw formatted numbers - * text(nfp(num1, 4, 2), 10, 30); - * text(nfp(num2, 4, 2), 10, 80); - * - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“+11253106.11” top middle and “-11253106.11” displayed bottom middle'); - * } - * - *
                                  - */ - /** - * @method nfp - * @param {Number[]} nums the Numbers to format - * @param {Integer} [left] - * @param {Integer} [right] - * @return {String[]} formatted Strings - */ - - _main.default.prototype.nfp = function () { - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("nfp", args); - var nfRes = _main.default.prototype.nf.apply(this, args); - if (nfRes instanceof Array) { - return nfRes.map(addNfp); - } else { - return addNfp(nfRes); - } - }; - function addNfp(num) { - return parseFloat(num) > 0 - ? "+".concat(num.toString()) - : num.toString(); - } /** - * Utility function for formatting numbers into strings. Similar to nf() but - * puts an additional "_" (space) in front of positive numbers just in case to align it with negative - * numbers which includes "-" (minus) sign. - * - * The main usecase of nfs() can be seen when one wants to align the digits (place values) of a non-negative - * number with some negative number (See the example to get a clear picture). - * There are two versions: one for formatting float, and one for formatting int. - * - * The values for the digits, left, and right parameters should always be positive integers. - * - * (IMP): The result on the canvas basically the expected alignment can vary based on the typeface you are using. - * - * (NOTE): Be cautious when using left and right parameters as it prepends numbers of 0's if the parameter - * if greater than the current length of the number. - * - * For example if number is 123.2 and left parameter passed is 4 which is greater than length of 123 - * (integer part) i.e 3 than result will be 0123.2. Same case for right parameter i.e. if right is 3 than - * the result will be 123.200. - * - * @method nfs - * @param {Number} num the Number to format - * @param {Integer} [left] number of digits to the left of the decimal - * point - * @param {Integer} [right] number of digits to the right of the - * decimal point - * @return {String} formatted String - * - * @example - *
                                  - * - * function setup() { - * background(200); - * let num1 = 321; - * let num2 = -1321; - * - * noStroke(); - * fill(0); - * textSize(16); - * - * // nfs() aligns num1 (positive number) with num2 (negative number) by - * // adding a blank space in front of the num1 (positive number) - * // [left = 4] in num1 add one 0 in front, to align the digits with num2 - * // [right = 2] in num1 and num2 adds two 0's after both numbers - * // To see the differences check the example of nf() too. - * text(nfs(num1, 4, 2), 10, 30); - * text(nfs(num2, 4, 2), 10, 80); - * // Draw dividing line - * stroke(120); - * line(0, 50, width, 50); - * - * describe('“0321.00” top middle and “-1321.00” displayed bottom middle'); - * } - * - *
                                  - */ - /** - * @method nfs - * @param {Array} nums the Numbers to format - * @param {Integer} [left] - * @param {Integer} [right] - * @return {String[]} formatted Strings - */ - - _main.default.prototype.nfs = function () { - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("nfs", args); - var nfRes = _main.default.prototype.nf.apply(this, args); - if (nfRes instanceof Array) { - return nfRes.map(addNfs); - } else { - return addNfs(nfRes); - } - }; - function addNfs(num) { - return parseFloat(num) >= 0 - ? " ".concat(num.toString()) - : num.toString(); - } /** - * The split() function maps to String.split(), it breaks a String into - * pieces using a character or string as the delimiter. The delim parameter - * specifies the character or characters that mark the boundaries between - * each piece. A String[] array is returned that contains each of the pieces. - * - * The splitTokens() function works in a similar fashion, except that it - * splits using a range of characters instead of a specific character or - * sequence. - * - * @method split - * @param {String} value the String to be split - * @param {String} delim the String used to separate the data - * @return {String[]} Array of Strings - * @example - *
                                  - * - * let names = 'Pat,Xio,Alex'; - * let splitString = split(names, ','); - * text(splitString[0], 5, 30); - * text(splitString[1], 5, 50); - * text(splitString[2], 5, 70); - * describe('“Pat” top left, “Xio” mid left, and “Alex” displayed bottom left'); - * - *
                                  - */ - - _main.default.prototype.split = function (str, delim) { - _main.default._validateParameters("split", arguments); - return str.split(delim); - }; - /** - * The splitTokens() function splits a String at one or many character - * delimiters or "tokens." The delim parameter specifies the character or - * characters to be used as a boundary. - * - * If no delim characters are specified, any whitespace character is used to - * split. Whitespace characters include tab (\t), line feed (\n), carriage - * return (\r), form feed (\f), and space. - * - * @method splitTokens - * @param {String} value the String to be split - * @param {String} [delim] list of individual Strings that will be used as - * separators - * @return {String[]} Array of Strings - * @example - *
                                  - * - * function setup() { - * let myStr = 'Mango, Banana, Lime'; - * let myStrArr = splitTokens(myStr, ','); - * - * print(myStrArr); // prints : ["Mango"," Banana"," Lime"] - * } - * - *
                                  - */ - _main.default.prototype.splitTokens = function (value, delims) { - _main.default._validateParameters("splitTokens", arguments); - var d; - if (typeof delims !== "undefined") { - var str = delims; - var sqc = /\]/g.exec(str); - var sqo = /\[/g.exec(str); - if (sqo && sqc) { - str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); - sqo = /\[/g.exec(str); - str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); - d = new RegExp("[\\[".concat(str, "\\]]"), "g"); - } else if (sqc) { - str = str.slice(0, sqc.index) + str.slice(sqc.index + 1); - d = new RegExp("[".concat(str, "\\]]"), "g"); - } else if (sqo) { - str = str.slice(0, sqo.index) + str.slice(sqo.index + 1); - d = new RegExp("[".concat(str, "\\[]"), "g"); - } else { - d = new RegExp("[".concat(str, "]"), "g"); - } - } else { - d = /\s/g; - } - return value.split(d).filter(function (n) { - return n; - }); - }; - /** - * Removes whitespace characters from the beginning and end of a String. In - * addition to standard whitespace characters such as space, carriage return, - * and tab, this function also removes the Unicode "nbsp" character. - * - * @method trim - * @param {String} str a String to be trimmed - * @return {String} a trimmed String - * - * @example - *
                                  - * - * let string = trim(' No new lines\n '); - * text(string + ' here', 2, 50); - * describe('“No new lines here” displayed center canvas'); - * - *
                                  - */ - /** - * @method trim - * @param {Array} strs an Array of Strings to be trimmed - * @return {String[]} an Array of trimmed Strings - */ - _main.default.prototype.trim = function (str) { - _main.default._validateParameters("trim", arguments); - if (str instanceof Array) { - return str.map(this.trim); - } else { - return str.trim(); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/friendly_errors/fes_core": 289, - "../core/friendly_errors/file_errors": 290, - "../core/friendly_errors/validate_params": 293, - "../core/main": 298, - "core-js/modules/es.array.filter": 173, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.number.to-fixed": 193, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.constructor": 204, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.match": 211, - "core-js/modules/es.string.pad-start": 212, - "core-js/modules/es.string.replace": 214, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.trim": 219, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 340: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module IO - * @submodule Time & Date - * @for p5 - * @requires core - */ - /** - * p5.js communicates with the clock on your computer. The day() function - * returns the current day as a value from 1 - 31. - * - * @method day - * @return {Integer} the current day - * @example - *
                                  - * - * let d = day(); - * text('Current day: \n' + d, 5, 50); - * describe('Current day is displayed'); - * - *
                                  - */ - - _main.default.prototype.day = function () { - return new Date().getDate(); - }; - /** - * p5.js communicates with the clock on your computer. The hour() function - * returns the current hour as a value from 0 - 23. - * - * @method hour - * @return {Integer} the current hour - * @example - *
                                  - * - * let h = hour(); - * text('Current hour:\n' + h, 5, 50); - * describe('Current hour is displayed'); - * - *
                                  - */ - _main.default.prototype.hour = function () { - return new Date().getHours(); - }; - /** - * p5.js communicates with the clock on your computer. The minute() function - * returns the current minute as a value from 0 - 59. - * - * @method minute - * @return {Integer} the current minute - * @example - *
                                  - * - * let m = minute(); - * text('Current minute: \n' + m, 5, 50); - * describe('Current minute is displayed'); - * - *
                                  - */ - _main.default.prototype.minute = function () { - return new Date().getMinutes(); - }; - /** - * Returns the number of milliseconds (thousandths of a second) since - * starting the sketch (when `setup()` is called). This information is often - * used for timing events and animation sequences. - * - * @method millis - * @return {Number} the number of milliseconds since starting the sketch - * @example - *
                                  - * - * let millisecond = millis(); - * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); - * describe('number of milliseconds since sketch has started displayed'); - * - *
                                  - */ - _main.default.prototype.millis = function () { - if (this._millisStart === -1) { - // Sketch has not started - return 0; - } else { - return window.performance.now() - this._millisStart; - } - }; - /** - * p5.js communicates with the clock on your computer. The month() function - * returns the current month as a value from 1 - 12. - * - * @method month - * @return {Integer} the current month - * @example - *
                                  - * - * let m = month(); - * text('Current month: \n' + m, 5, 50); - * describe('Current month is displayed'); - * - *
                                  - */ - _main.default.prototype.month = function () { - //January is 0! - return new Date().getMonth() + 1; - }; - /** - * p5.js communicates with the clock on your computer. The second() function - * returns the current second as a value from 0 - 59. - * - * @method second - * @return {Integer} the current second - * @example - *
                                  - * - * let s = second(); - * text('Current second: \n' + s, 5, 50); - * describe('Current second is displayed'); - * - *
                                  - */ - _main.default.prototype.second = function () { - return new Date().getSeconds(); - }; - /** - * p5.js communicates with the clock on your computer. The year() function - * returns the current year as an integer (2014, 2015, 2016, etc). - * - * @method year - * @return {Integer} the current year - * @example - *
                                  - * - * let y = year(); - * text('Current year: \n' + y, 5, 50); - * describe('Current year is displayed'); - * - *
                                  - */ - _main.default.prototype.year = function () { - return new Date().getFullYear(); - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - }, - ], - 341: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.math.sign"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.math.sign"); - _dereq_("core-js/modules/es.number.to-fixed"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - _dereq_("./p5.Geometry"); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Shape - * @submodule 3D Primitives - * @for p5 - * @requires core - * @requires p5.Geometry - */ - /** - * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added - * to the geometry and then returned when - * endGeometry() is called. One can also use - * buildGeometry() to pass a function that - * draws shapes. - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them upfront with `beginGeometry()` and `endGeometry()` and then - * drawing that will run faster than repeatedly drawing the individual pieces. - * - * @method beginGeometry - * - * @example - *
                                  - * - * let shapes; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * makeShapes(); - * } - * - * function makeShapes() { - * beginGeometry(); - * scale(0.18); - * - * push(); - * translate(100, -50); - * scale(0.5); - * rotateX(PI/4); - * cone(); - * pop(); - * cone(); - * - * beginShape(); - * vertex(-20, -50); - * quadraticVertex( - * -40, -70, - * 0, -60 - * ); - * endShape(); - * - * beginShape(TRIANGLE_STRIP); - * for (let y = 20; y <= 60; y += 10) { - * for (let x of [20, 60]) { - * vertex(x, y); - * } - * } - * endShape(); - * - * beginShape(); - * vertex(-100, -120); - * vertex(-120, -110); - * vertex(-105, -100); - * endShape(); - * - * shapes = endGeometry(); - * } - * - * function draw() { - * background(255); - * lights(); - * orbitControl(); - * model(shapes); - * } - * - *
                                  - * - * @alt - * A series of different flat, curved, and 3D shapes floating in space. - */ - - _main.default.prototype.beginGeometry = function () { - return this._renderer.beginGeometry(); - }; - /** - * Finishes creating a new p5.Geometry that was - * started using beginGeometry(). One can also - * use buildGeometry() to pass a function that - * draws shapes. - * - * @method endGeometry - * @returns {p5.Geometry} The model that was built. - */ - _main.default.prototype.endGeometry = function () { - return this._renderer.endGeometry(); - }; - /** - * Creates a new p5.Geometry that contains all - * the shapes drawn in a provided callback function. The returned combined shape - * can then be drawn all at once using model(). - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them with `buildGeometry()` once and then drawing that will run - * faster than repeatedly drawing the individual pieces. - * - * One can also draw shapes directly between - * beginGeometry() and - * endGeometry() instead of using a callback - * function. - * - * @method buildGeometry - * @param {Function} callback A function that draws shapes. - * @returns {p5.Geometry} The model that was built from the callback function. - * - * @example - *
                                  - * - * let particles; - * let button; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * button = createButton('New'); - * button.mousePressed(makeParticles); - * makeParticles(); - * } - * - * function makeParticles() { - * if (particles) freeGeometry(particles); - * - * particles = buildGeometry(() => { - * for (let i = 0; i < 60; i++) { - * push(); - * translate( - * randomGaussian(0, 20), - * randomGaussian(0, 20), - * randomGaussian(0, 20) - * ); - * sphere(5); - * pop(); - * } - * }); - * } - * - * function draw() { - * background(255); - * noStroke(); - * lights(); - * orbitControl(); - * model(particles); - * } - * - *
                                  - * - * @alt - * A cluster of spheres. - */ - _main.default.prototype.buildGeometry = function (callback) { - return this._renderer.buildGeometry(callback); - }; - /** - * Clears the resources of a model to free up browser memory. A model whose - * resources have been cleared can still be drawn, but the first time it is - * drawn again, it might take longer. - * - * This method works on models generated with - * buildGeometry() as well as those loaded - * from loadModel(). - * - * @method freeGeometry - * @param {p5.Geometry} geometry The geometry whose resources should be freed - */ - _main.default.prototype.freeGeometry = function (geometry) { - this._renderer._freeBuffers(geometry.gid); - }; - /** - * Draw a plane with given a width and height - * @method plane - * @param {Number} [width] width of the plane - * @param {Number} [height] height of the plane - * @param {Integer} [detailX] Optional number of triangle - * subdivisions in x-dimension - * @param {Integer} [detailY] Optional number of triangle - * subdivisions in y-dimension - * @chainable - * @example - *
                                  - * - * // draw a plane - * // with width 50 and height 50 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white plane with black wireframe lines'); - * } - * - * function draw() { - * background(200); - * plane(50, 50); - * } - * - *
                                  - * - * @alt - * Nothing displayed on canvas - * Rotating interior view of a box with sides that change color. - * 3d red and green gradient. - * Rotating interior view of a cylinder with sides that change color. - * Rotating view of a cylinder with sides that change color. - * 3d red and green gradient. - * rotating view of a multi-colored cylinder with concave sides. - */ - _main.default.prototype.plane = function ( - width, - height, - detailX, - detailY, - ) { - this._assert3d("plane"); - _main.default._validateParameters("plane", arguments); - if (typeof width === "undefined") { - width = 50; - } - if (typeof height === "undefined") { - height = width; - } - if (typeof detailX === "undefined") { - detailX = 1; - } - if (typeof detailY === "undefined") { - detailY = 1; - } - var gId = "plane|".concat(detailX, "|").concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _plane = function _plane() { - var u, v, p; - for (var i = 0; i <= this.detailY; i++) { - v = i / this.detailY; - for (var j = 0; j <= this.detailX; j++) { - u = j / this.detailX; - p = new _main.default.Vector(u - 0.5, v - 0.5, 0); - this.vertices.push(p); - this.uvs.push(u, v); - } - } - }; - var planeGeom = new _main.default.Geometry( - detailX, - detailY, - _plane, - ); - planeGeom.computeFaces().computeNormals(); - if (detailX <= 1 && detailY <= 1) { - planeGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log( - "Cannot draw stroke on plane objects with more" + - " than 1 detailX or 1 detailY", - ); - } - this._renderer.createBuffers(gId, planeGeom); - } - this._renderer.drawBuffersScaled(gId, width, height, 1); - return this; - }; - /** - * Draw a box with given width, height and depth - * @method box - * @param {Number} [width] width of the box - * @param {Number} [height] height of the box - * @param {Number} [depth] depth of the box - * @param {Integer} [detailX] Optional number of triangle - * subdivisions in x-dimension - * @param {Integer} [detailY] Optional number of triangle - * subdivisions in y-dimension - * @chainable - * @example - *
                                  - * - * // draw a spinning box - * // with width, height and depth of 50 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white box rotating in 3D space'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(50); - * } - * - *
                                  - */ - _main.default.prototype.box = function ( - width, - height, - depth, - detailX, - detailY, - ) { - this._assert3d("box"); - _main.default._validateParameters("box", arguments); - if (typeof width === "undefined") { - width = 50; - } - if (typeof height === "undefined") { - height = width; - } - if (typeof depth === "undefined") { - depth = height; - } - var perPixelLighting = - this._renderer.attributes && - this._renderer.attributes.perPixelLighting; - if (typeof detailX === "undefined") { - detailX = perPixelLighting ? 1 : 4; - } - if (typeof detailY === "undefined") { - detailY = perPixelLighting ? 1 : 4; - } - var gId = "box|".concat(detailX, "|").concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _box = function _box() { - var _this = this; - var cubeIndices = [ - [0, 4, 2, 6], - // -1, 0, 0],// -x - [1, 3, 5, 7], - // +1, 0, 0],// +x - [0, 1, 4, 5], - // 0, -1, 0],// -y - [2, 6, 3, 7], - // 0, +1, 0],// +y - [0, 2, 1, 3], - // 0, 0, -1],// -z - [4, 5, 6, 7], // 0, 0, +1] // +z - ]; - //using custom edges - //to avoid diagonal stroke lines across face of box - this.edges = [ - [0, 1], - [1, 3], - [3, 2], - [6, 7], - [8, 9], - [9, 11], - [14, 15], - [16, 17], - [17, 19], - [18, 19], - [20, 21], - [22, 23], - ]; - cubeIndices.forEach(function (cubeIndex, i) { - var v = i * 4; - for (var j = 0; j < 4; j++) { - var d = cubeIndex[j]; - //inspired by lightgl: - //https://github.com/evanw/lightgl.js - //octants:https://en.wikipedia.org/wiki/Octant_(solid_geometry) - var octant = new _main.default.Vector( - ((d & 1) * 2 - 1) / 2, - ((d & 2) - 1) / 2, - ((d & 4) / 2 - 1) / 2, - ); - _this.vertices.push(octant); - _this.uvs.push(j & 1, (j & 2) / 2); - } - _this.faces.push([v, v + 1, v + 2]); - _this.faces.push([v + 2, v + 1, v + 3]); - }); - }; - var boxGeom = new _main.default.Geometry(detailX, detailY, _box); - boxGeom.computeNormals(); - if (detailX <= 4 && detailY <= 4) { - boxGeom._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log( - "Cannot draw stroke on box objects with more" + - " than 4 detailX or 4 detailY", - ); - } //initialize our geometry buffer with - //the key val pair: - //geometry Id, Geom object - - this._renderer.createBuffers(gId, boxGeom); - } - this._renderer.drawBuffersScaled(gId, width, height, depth); - return this; - }; - /** - * Draw a sphere with given radius. - * - * DetailX and detailY determines the number of subdivisions in the x-dimension - * and the y-dimension of a sphere. More subdivisions make the sphere seem - * smoother. The recommended maximum values are both 24. Using a value greater - * than 24 may cause a warning or slow down the browser. - * @method sphere - * @param {Number} [radius] radius of circle - * @param {Integer} [detailX] optional number of subdivisions in x-dimension - * @param {Integer} [detailY] optional number of subdivisions in y-dimension - * - * @chainable - * @example - *
                                  - * - * // draw a sphere with radius 40 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white sphere with black wireframe lines'); - * } - * - * function draw() { - * background(205, 102, 94); - * sphere(40); - * } - * - *
                                  - * - * @example - *
                                  - * - * let detailX; - * // slide to see how detailX works - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 24, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a white sphere with low detail on the x-axis, including a slider to adjust detailX' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * sphere(40, detailX.value(), 16); - * } - * - *
                                  - * - * @example - *
                                  - * - * let detailY; - * // slide to see how detailY works - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(3, 16, 3); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a white sphere with low detail on the y-axis, including a slider to adjust detailY' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * sphere(40, 16, detailY.value()); - * } - * - *
                                  - */ - _main.default.prototype.sphere = function (radius, detailX, detailY) { - this._assert3d("sphere"); - _main.default._validateParameters("sphere", arguments); - if (typeof radius === "undefined") { - radius = 50; - } - if (typeof detailX === "undefined") { - detailX = 24; - } - if (typeof detailY === "undefined") { - detailY = 16; - } - this.ellipsoid(radius, radius, radius, detailX, detailY); - return this; - }; - /** - * @private - * Helper function for creating both cones and cylinders - * Will only generate well-defined geometry when bottomRadius, height > 0 - * and topRadius >= 0 - * If topRadius == 0, topCap should be false - */ - var _truncatedCone = function _truncatedCone( - bottomRadius, - topRadius, - height, - detailX, - detailY, - bottomCap, - topCap, - ) { - bottomRadius = bottomRadius <= 0 ? 1 : bottomRadius; - topRadius = topRadius < 0 ? 0 : topRadius; - height = height <= 0 ? bottomRadius : height; - detailX = detailX < 3 ? 3 : detailX; - detailY = detailY < 1 ? 1 : detailY; - bottomCap = bottomCap === undefined ? true : bottomCap; - topCap = topCap === undefined ? topRadius !== 0 : topCap; - var start = bottomCap ? -2 : 0; - var end = detailY + (topCap ? 2 : 0); - //ensure constant slant for interior vertex normals - var slant = Math.atan2(bottomRadius - topRadius, height); - var sinSlant = Math.sin(slant); - var cosSlant = Math.cos(slant); - var yy, ii, jj; - for (yy = start; yy <= end; ++yy) { - var v = yy / detailY; - var y = height * v; - var ringRadius = void 0; - if (yy < 0) { - //for the bottomCap edge - y = 0; - v = 0; - ringRadius = bottomRadius; - } else if (yy > detailY) { - //for the topCap edge - y = height; - v = 1; - ringRadius = topRadius; - } else { - //for the middle - ringRadius = bottomRadius + (topRadius - bottomRadius) * v; - } - if (yy === -2 || yy === detailY + 2) { - //center of bottom or top caps - ringRadius = 0; - } - y -= height / 2; //shift coordiate origin to the center of object - for (ii = 0; ii < detailX; ++ii) { - var u = ii / (detailX - 1); - var ur = 2 * Math.PI * u; - var sur = Math.sin(ur); - var cur = Math.cos(ur); - //VERTICES - this.vertices.push( - new _main.default.Vector( - sur * ringRadius, - y, - cur * ringRadius, - ), - ); - //VERTEX NORMALS - var vertexNormal = void 0; - if (yy < 0) { - vertexNormal = new _main.default.Vector(0, -1, 0); - } else if (yy > detailY && topRadius) { - vertexNormal = new _main.default.Vector(0, 1, 0); - } else { - vertexNormal = new _main.default.Vector( - sur * cosSlant, - sinSlant, - cur * cosSlant, - ); - } - this.vertexNormals.push(vertexNormal); - //UVs - this.uvs.push(u, v); - } - } - var startIndex = 0; - if (bottomCap) { - for (jj = 0; jj < detailX; ++jj) { - var nextjj = (jj + 1) % detailX; - this.faces.push([ - startIndex + jj, - startIndex + detailX + nextjj, - startIndex + detailX + jj, - ]); - } - startIndex += detailX * 2; - } - for (yy = 0; yy < detailY; ++yy) { - for (ii = 0; ii < detailX; ++ii) { - var nextii = (ii + 1) % detailX; - this.faces.push([ - startIndex + ii, - startIndex + nextii, - startIndex + detailX + nextii, - ]); - this.faces.push([ - startIndex + ii, - startIndex + detailX + nextii, - startIndex + detailX + ii, - ]); - } - startIndex += detailX; - } - if (topCap) { - startIndex += detailX; - for (ii = 0; ii < detailX; ++ii) { - this.faces.push([ - startIndex + ii, - startIndex + ((ii + 1) % detailX), - startIndex + detailX, - ]); - } - } - }; - /** - * Draw a cylinder with given radius and height - * - * DetailX and detailY determines the number of subdivisions in the x-dimension - * and the y-dimension of a cylinder. More subdivisions make the cylinder seem smoother. - * The recommended maximum value for detailX is 24. Using a value greater than 24 - * may cause a warning or slow down the browser. - * - * @method cylinder - * @param {Number} [radius] radius of the surface - * @param {Number} [height] height of the cylinder - * @param {Integer} [detailX] number of subdivisions in x-dimension; - * default is 24 - * @param {Integer} [detailY] number of subdivisions in y-dimension; - * default is 1 - * @param {Boolean} [bottomCap] whether to draw the bottom of the cylinder - * @param {Boolean} [topCap] whether to draw the top of the cylinder - * @chainable - * @example - *
                                  - * - * // draw a spinning cylinder - * // with radius 20 and height 50 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a rotating white cylinder'); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateX(frameCount * 0.01); - * rotateZ(frameCount * 0.01); - * cylinder(20, 50); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailX works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 24, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white cylinder with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * cylinder(20, 75, detailX.value(), 1); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(1, 16, 1); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white cylinder with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * cylinder(20, 75, 16, detailY.value()); - * } - * - *
                                  - */ - _main.default.prototype.cylinder = function ( - radius, - height, - detailX, - detailY, - bottomCap, - topCap, - ) { - this._assert3d("cylinder"); - _main.default._validateParameters("cylinder", arguments); - if (typeof radius === "undefined") { - radius = 50; - } - if (typeof height === "undefined") { - height = radius; - } - if (typeof detailX === "undefined") { - detailX = 24; - } - if (typeof detailY === "undefined") { - detailY = 1; - } - if (typeof topCap === "undefined") { - topCap = true; - } - if (typeof bottomCap === "undefined") { - bottomCap = true; - } - var gId = "cylinder|" - .concat(detailX, "|") - .concat(detailY, "|") - .concat(bottomCap, "|") - .concat(topCap); - if (!this._renderer.geometryInHash(gId)) { - var cylinderGeom = new _main.default.Geometry(detailX, detailY); - _truncatedCone.call( - cylinderGeom, - 1, - 1, - 1, - detailX, - detailY, - bottomCap, - topCap, - ); - // normals are computed in call to _truncatedCone - if (detailX <= 24 && detailY <= 16) { - cylinderGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log( - "Cannot draw stroke on cylinder objects with more" + - " than 24 detailX or 16 detailY", - ); - } - this._renderer.createBuffers(gId, cylinderGeom); - } - this._renderer.drawBuffersScaled(gId, radius, height, radius); - return this; - }; - /** - * Draw a cone with given radius and height - * - * DetailX and detailY determine the number of subdivisions in the x-dimension and - * the y-dimension of a cone. More subdivisions make the cone seem smoother. The - * recommended maximum value for detailX is 24. Using a value greater than 24 - * may cause a warning or slow down the browser. - * @method cone - * @param {Number} [radius] radius of the bottom surface - * @param {Number} [height] height of the cone - * @param {Integer} [detailX] number of segments, - * the more segments the smoother geometry - * default is 24 - * @param {Integer} [detailY] number of segments, - * the more segments the smoother geometry - * default is 1 - * @param {Boolean} [cap] whether to draw the base of the cone - * @chainable - * @example - *
                                  - * - * // draw a spinning cone - * // with radius 40 and height 70 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a rotating white cone'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateZ(frameCount * 0.01); - * cone(40, 70); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailx works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 16, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white cone with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * cone(30, 65, detailX.value(), 16); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(3, 16, 3); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white cone with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * cone(30, 65, 16, detailY.value()); - * } - * - *
                                  - */ - _main.default.prototype.cone = function ( - radius, - height, - detailX, - detailY, - cap, - ) { - this._assert3d("cone"); - _main.default._validateParameters("cone", arguments); - if (typeof radius === "undefined") { - radius = 50; - } - if (typeof height === "undefined") { - height = radius; - } - if (typeof detailX === "undefined") { - detailX = 24; - } - if (typeof detailY === "undefined") { - detailY = 1; - } - if (typeof cap === "undefined") { - cap = true; - } - var gId = "cone|" - .concat(detailX, "|") - .concat(detailY, "|") - .concat(cap); - if (!this._renderer.geometryInHash(gId)) { - var coneGeom = new _main.default.Geometry(detailX, detailY); - _truncatedCone.call( - coneGeom, - 1, - 0, - 1, - detailX, - detailY, - cap, - false, - ); - if (detailX <= 24 && detailY <= 16) { - coneGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log( - "Cannot draw stroke on cone objects with more" + - " than 24 detailX or 16 detailY", - ); - } - this._renderer.createBuffers(gId, coneGeom); - } - this._renderer.drawBuffersScaled(gId, radius, height, radius); - return this; - }; - /** - * Draw an ellipsoid with given radius - * - * DetailX and detailY determine the number of subdivisions in the x-dimension and - * the y-dimension of a cone. More subdivisions make the ellipsoid appear to be smoother. - * Avoid detail number above 150, it may crash the browser. - * @method ellipsoid - * @param {Number} [radiusx] x-radius of ellipsoid - * @param {Number} [radiusy] y-radius of ellipsoid - * @param {Number} [radiusz] z-radius of ellipsoid - * @param {Integer} [detailX] number of segments, - * the more segments the smoother geometry - * default is 24. Avoid detail number above - * 150, it may crash the browser. - * @param {Integer} [detailY] number of segments, - * the more segments the smoother geometry - * default is 16. Avoid detail number above - * 150, it may crash the browser. - * @chainable - * @example - *
                                  - * - * // draw an ellipsoid - * // with radius 30, 40 and 40. - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a white 3d ellipsoid'); - * } - * - * function draw() { - * background(205, 105, 94); - * ellipsoid(30, 40, 40); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailX works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(2, 24, 12); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white ellipsoid with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 105, 94); - * rotateY(millis() / 1000); - * ellipsoid(30, 40, 40, detailX.value(), 8); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(2, 24, 6); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white ellipsoid with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 105, 9); - * rotateY(millis() / 1000); - * ellipsoid(30, 40, 40, 12, detailY.value()); - * } - * - *
                                  - */ - _main.default.prototype.ellipsoid = function ( - radiusX, - radiusY, - radiusZ, - detailX, - detailY, - ) { - this._assert3d("ellipsoid"); - _main.default._validateParameters("ellipsoid", arguments); - if (typeof radiusX === "undefined") { - radiusX = 50; - } - if (typeof radiusY === "undefined") { - radiusY = radiusX; - } - if (typeof radiusZ === "undefined") { - radiusZ = radiusX; - } - if (typeof detailX === "undefined") { - detailX = 24; - } - if (typeof detailY === "undefined") { - detailY = 16; - } - var gId = "ellipsoid|".concat(detailX, "|").concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _ellipsoid = function _ellipsoid() { - for (var i = 0; i <= this.detailY; i++) { - var v = i / this.detailY; - var phi = Math.PI * v - Math.PI / 2; - var cosPhi = Math.cos(phi); - var sinPhi = Math.sin(phi); - for (var j = 0; j <= this.detailX; j++) { - var u = j / this.detailX; - var theta = 2 * Math.PI * u; - var cosTheta = Math.cos(theta); - var sinTheta = Math.sin(theta); - var p = new _main.default.Vector( - cosPhi * sinTheta, - sinPhi, - cosPhi * cosTheta, - ); - this.vertices.push(p); - this.vertexNormals.push(p); - this.uvs.push(u, v); - } - } - }; - var ellipsoidGeom = new _main.default.Geometry( - detailX, - detailY, - _ellipsoid, - ); - ellipsoidGeom.computeFaces(); - if (detailX <= 24 && detailY <= 24) { - ellipsoidGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log( - "Cannot draw stroke on ellipsoids with more" + - " than 24 detailX or 24 detailY", - ); - } - this._renderer.createBuffers(gId, ellipsoidGeom); - } - this._renderer.drawBuffersScaled(gId, radiusX, radiusY, radiusZ); - return this; - }; - /** - * Draw a torus with given radius and tube radius - * - * DetailX and detailY determine the number of subdivisions in the x-dimension and - * the y-dimension of a torus. More subdivisions make the torus appear to be smoother. - * The default and maximum values for detailX and detailY are 24 and 16, respectively. - * Setting them to relatively small values like 4 and 6 allows you to create new - * shapes other than a torus. - * @method torus - * @param {Number} [radius] radius of the whole ring - * @param {Number} [tubeRadius] radius of the tube - * @param {Integer} [detailX] number of segments in x-dimension, - * the more segments the smoother geometry - * default is 24 - * @param {Integer} [detailY] number of segments in y-dimension, - * the more segments the smoother geometry - * default is 16 - * @chainable - * @example - *
                                  - * - * // draw a spinning torus - * // with ring radius 30 and tube radius 15 - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a rotating white torus'); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * torus(30, 15); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailX works - * let detailX; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailX = createSlider(3, 24, 3); - * detailX.position(10, height + 5); - * detailX.style('width', '80px'); - * describe( - * 'a rotating white torus with limited X detail, with a slider that adjusts detailX' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * torus(30, 15, detailX.value(), 12); - * } - * - *
                                  - * - * @example - *
                                  - * - * // slide to see how detailY works - * let detailY; - * function setup() { - * createCanvas(100, 100, WEBGL); - * detailY = createSlider(3, 16, 3); - * detailY.position(10, height + 5); - * detailY.style('width', '80px'); - * describe( - * 'a rotating white torus with limited Y detail, with a slider that adjusts detailY' - * ); - * } - * - * function draw() { - * background(205, 102, 94); - * rotateY(millis() / 1000); - * torus(30, 15, 16, detailY.value()); - * } - * - *
                                  - */ - _main.default.prototype.torus = function ( - radius, - tubeRadius, - detailX, - detailY, - ) { - this._assert3d("torus"); - _main.default._validateParameters("torus", arguments); - if (typeof radius === "undefined") { - radius = 50; - } else if (!radius) { - return; // nothing to draw - } - if (typeof tubeRadius === "undefined") { - tubeRadius = 10; - } else if (!tubeRadius) { - return; // nothing to draw - } - if (typeof detailX === "undefined") { - detailX = 24; - } - if (typeof detailY === "undefined") { - detailY = 16; - } - var tubeRatio = (tubeRadius / radius).toPrecision(4); - var gId = "torus|" - .concat(tubeRatio, "|") - .concat(detailX, "|") - .concat(detailY); - if (!this._renderer.geometryInHash(gId)) { - var _torus = function _torus() { - for (var i = 0; i <= this.detailY; i++) { - var v = i / this.detailY; - var phi = 2 * Math.PI * v; - var cosPhi = Math.cos(phi); - var sinPhi = Math.sin(phi); - var r = 1 + tubeRatio * cosPhi; - for (var j = 0; j <= this.detailX; j++) { - var u = j / this.detailX; - var theta = 2 * Math.PI * u; - var cosTheta = Math.cos(theta); - var sinTheta = Math.sin(theta); - var p = new _main.default.Vector( - r * cosTheta, - r * sinTheta, - tubeRatio * sinPhi, - ); - var n = new _main.default.Vector( - cosPhi * cosTheta, - cosPhi * sinTheta, - sinPhi, - ); - this.vertices.push(p); - this.vertexNormals.push(n); - this.uvs.push(u, v); - } - } - }; - var torusGeom = new _main.default.Geometry( - detailX, - detailY, - _torus, - ); - torusGeom.computeFaces(); - if (detailX <= 24 && detailY <= 16) { - torusGeom._makeTriangleEdges()._edgesToVertices(); - } else if (this._renderer._doStroke) { - console.log( - "Cannot draw strokes on torus object with more" + - " than 24 detailX or 16 detailY", - ); - } - this._renderer.createBuffers(gId, torusGeom); - } - this._renderer.drawBuffersScaled(gId, radius, radius, radius); - return this; - }; - /////////////////////// - /// 2D primitives - ///////////////////////// - // - // Note: Documentation is not generated on the p5.js website for functions on - // the p5.RendererGL prototype. - /** - * Draws a point, a coordinate in space at the dimension of one pixel, - * given x, y and z coordinates. The color of the point is determined - * by the current stroke, while the point size is determined by current - * stroke weight. - * @private - * @param {Number} x x-coordinate of point - * @param {Number} y y-coordinate of point - * @param {Number} z z-coordinate of point - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(50); - * stroke(255); - * strokeWeight(4); - * point(25, 0); - * strokeWeight(3); - * point(-25, 0); - * strokeWeight(2); - * point(0, 25); - * strokeWeight(1); - * point(0, -25); - * } - * - *
                                  - */ - _main.default.RendererGL.prototype.point = function (x, y, z) { - if (typeof z === "undefined") { - z = 0; - } - var _vertex = []; - _vertex.push(new _main.default.Vector(x, y, z)); - this._drawPoints(_vertex, this.immediateMode.buffers.point); - return this; - }; - _main.default.RendererGL.prototype.triangle = function (args) { - var x1 = args[0], - y1 = args[1]; - var x2 = args[2], - y2 = args[3]; - var x3 = args[4], - y3 = args[5]; - var gId = "tri"; - if (!this.geometryInHash(gId)) { - var _triangle = function _triangle() { - var vertices = []; - vertices.push(new _main.default.Vector(0, 0, 0)); - vertices.push(new _main.default.Vector(1, 0, 0)); - vertices.push(new _main.default.Vector(0, 1, 0)); - this.edges = [ - [0, 1], - [1, 2], - [2, 0], - ]; - this.vertices = vertices; - this.faces = [[0, 1, 2]]; - this.uvs = [0, 0, 1, 0, 1, 1]; - }; - var triGeom = new _main.default.Geometry(1, 1, _triangle); - triGeom._edgesToVertices(); - triGeom.computeNormals(); - this.createBuffers(gId, triGeom); - } // only one triangle is cached, one point is at the origin, and the - // two adjacent sides are tne unit vectors along the X & Y axes. - // - // this matrix multiplication transforms those two unit vectors - // onto the required vector prior to rendering, and moves the - // origin appropriately. - - var uMVMatrix = this.uMVMatrix.copy(); - try { - // triangle orientation. - var orientation = Math.sign( - x1 * y2 - x2 * y1 + x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3, - ); - var mult = new _main.default.Matrix([ - x2 - x1, - y2 - y1, - 0, - 0, - // the resulting unit X-axis - x3 - x1, - y3 - y1, - 0, - 0, - // the resulting unit Y-axis - 0, - 0, - orientation, - 0, - // the resulting unit Z-axis (Reflect the specified order of vertices) - x1, - y1, - 0, - 1, // the resulting origin - ]).mult(this.uMVMatrix); - this.uMVMatrix = mult; - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - return this; - }; - _main.default.RendererGL.prototype.ellipse = function (args) { - this.arc( - args[0], - args[1], - args[2], - args[3], - 0, - constants.TWO_PI, - constants.OPEN, - args[4], - ); - }; - _main.default.RendererGL.prototype.arc = function (args) { - var x = arguments[0]; - var y = arguments[1]; - var width = arguments[2]; - var height = arguments[3]; - var start = arguments[4]; - var stop = arguments[5]; - var mode = arguments[6]; - var detail = arguments[7] || 25; - var shape; - var gId; - // check if it is an ellipse or an arc - if (Math.abs(stop - start) >= constants.TWO_PI) { - shape = "ellipse"; - gId = "".concat(shape, "|").concat(detail, "|"); - } else { - shape = "arc"; - gId = "" - .concat(shape, "|") - .concat(start, "|") - .concat(stop, "|") - .concat(mode, "|") - .concat(detail, "|"); - } - if (!this.geometryInHash(gId)) { - var _arc = function _arc() { - // if the start and stop angles are not the same, push vertices to the array - if (start.toFixed(10) !== stop.toFixed(10)) { - // if the mode specified is PIE or null, push the mid point of the arc in vertices - if (mode === constants.PIE || typeof mode === "undefined") { - this.vertices.push(new _main.default.Vector(0.5, 0.5, 0)); - this.uvs.push([0.5, 0.5]); - } // vertices for the perimeter of the circle - - for (var i = 0; i <= detail; i++) { - var u = i / detail; - var theta = (stop - start) * u + start; - var _x = 0.5 + Math.cos(theta) / 2; - var _y = 0.5 + Math.sin(theta) / 2; - this.vertices.push(new _main.default.Vector(_x, _y, 0)); - this.uvs.push([_x, _y]); - if (i < detail - 1) { - this.faces.push([0, i + 1, i + 2]); - this.edges.push([i + 1, i + 2]); - } - } // check the mode specified in order to push vertices and faces, different for each mode - - switch (mode) { - case constants.PIE: - this.faces.push([ - 0, - this.vertices.length - 2, - this.vertices.length - 1, - ]); - this.edges.push([0, 1]); - this.edges.push([ - this.vertices.length - 2, - this.vertices.length - 1, - ]); - this.edges.push([0, this.vertices.length - 1]); - break; - case constants.CHORD: - this.edges.push([0, 1]); - this.edges.push([0, this.vertices.length - 1]); - break; - case constants.OPEN: - this.edges.push([0, 1]); - break; - default: - this.faces.push([ - 0, - this.vertices.length - 2, - this.vertices.length - 1, - ]); - this.edges.push([ - this.vertices.length - 2, - this.vertices.length - 1, - ]); - } - } - }; - var arcGeom = new _main.default.Geometry(detail, 1, _arc); - arcGeom.computeNormals(); - if (detail <= 50) { - arcGeom._edgesToVertices(arcGeom); - } else if (this._doStroke) { - console.log( - "Cannot apply a stroke to an ".concat( - shape, - " with more than 50 detail", - ), - ); - } - this.createBuffers(gId, arcGeom); - } - var uMVMatrix = this.uMVMatrix.copy(); - try { - this.uMVMatrix.translate([x, y, 0]); - this.uMVMatrix.scale(width, height, 1); - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - return this; - }; - _main.default.RendererGL.prototype.rect = function (args) { - var x = args[0]; - var y = args[1]; - var width = args[2]; - var height = args[3]; - if (typeof args[4] === "undefined") { - // Use the retained mode for drawing rectangle, - // if args for rounding rectangle is not provided by user. - var perPixelLighting = this._pInst._glAttributes.perPixelLighting; - var detailX = args[4] || (perPixelLighting ? 1 : 24); - var detailY = args[5] || (perPixelLighting ? 1 : 16); - var gId = "rect|".concat(detailX, "|").concat(detailY); - if (!this.geometryInHash(gId)) { - var _rect = function _rect() { - for (var i = 0; i <= this.detailY; i++) { - var v = i / this.detailY; - for (var j = 0; j <= this.detailX; j++) { - var u = j / this.detailX; - var p = new _main.default.Vector(u, v, 0); - this.vertices.push(p); - this.uvs.push(u, v); - } - } // using stroke indices to avoid stroke over face(s) of rectangle - - if (detailX > 0 && detailY > 0) { - this.edges = [ - [0, detailX], - [detailX, (detailX + 1) * (detailY + 1) - 1], - [ - (detailX + 1) * (detailY + 1) - 1, - (detailX + 1) * detailY, - ], - [(detailX + 1) * detailY, 0], - ]; - } - }; - var rectGeom = new _main.default.Geometry( - detailX, - detailY, - _rect, - ); - rectGeom.computeFaces().computeNormals()._edgesToVertices(); - this.createBuffers(gId, rectGeom); - } // only a single rectangle (of a given detail) is cached: a square with - // opposite corners at (0,0) & (1,1). - // - // before rendering, this square is scaled & moved to the required location. - - var uMVMatrix = this.uMVMatrix.copy(); - try { - this.uMVMatrix.translate([x, y, 0]); - this.uMVMatrix.scale(width, height, 1); - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - } else { - // Use Immediate mode to round the rectangle corner, - // if args for rounding corners is provided by user - var tl = args[4]; - var tr = typeof args[5] === "undefined" ? tl : args[5]; - var br = typeof args[6] === "undefined" ? tr : args[6]; - var bl = typeof args[7] === "undefined" ? br : args[7]; - var a = x; - var b = y; - var c = width; - var d = height; - c += a; - d += b; - if (a > c) { - var temp = a; - a = c; - c = temp; - } - if (b > d) { - var _temp = b; - b = d; - d = _temp; - } - var maxRounding = Math.min((c - a) / 2, (d - b) / 2); - if (tl > maxRounding) tl = maxRounding; - if (tr > maxRounding) tr = maxRounding; - if (br > maxRounding) br = maxRounding; - if (bl > maxRounding) bl = maxRounding; - var x1 = a; - var y1 = b; - var x2 = c; - var y2 = d; - this.beginShape(); - if (tr !== 0) { - this.vertex(x2 - tr, y1); - this.quadraticVertex(x2, y1, x2, y1 + tr); - } else { - this.vertex(x2, y1); - } - if (br !== 0) { - this.vertex(x2, y2 - br); - this.quadraticVertex(x2, y2, x2 - br, y2); - } else { - this.vertex(x2, y2); - } - if (bl !== 0) { - this.vertex(x1 + bl, y2); - this.quadraticVertex(x1, y2, x1, y2 - bl); - } else { - this.vertex(x1, y2); - } - if (tl !== 0) { - this.vertex(x1, y1 + tl); - this.quadraticVertex(x1, y1, x1 + tl, y1); - } else { - this.vertex(x1, y1); - } - this.immediateMode.geometry.uvs.length = 0; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = - this.immediateMode.geometry.vertices[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var vert = _step.value; - var u = (vert.x - x1) / width; - var v = (vert.y - y1) / height; - this.immediateMode.geometry.uvs.push(u, v); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - this.endShape(constants.CLOSE); - } - return this; - }; - /* eslint-disable max-len */ - _main.default.RendererGL.prototype.quad = function ( - x1, - y1, - z1, - x2, - y2, - z2, - x3, - y3, - z3, - x4, - y4, - z4, - detailX, - detailY, - ) { - /* eslint-enable max-len */ - if (typeof detailX === "undefined") { - detailX = 2; - } - if (typeof detailY === "undefined") { - detailY = 2; - } - var gId = "quad|" - .concat(x1, "|") - .concat(y1, "|") - .concat(z1, "|") - .concat(x2, "|") - .concat(y2, "|") - .concat(z2, "|") - .concat(x3, "|") - .concat(y3, "|") - .concat(z3, "|") - .concat(x4, "|") - .concat(y4, "|") - .concat(z4, "|") - .concat(detailX, "|") - .concat(detailY); - if (!this.geometryInHash(gId)) { - var quadGeom = new _main.default.Geometry( - detailX, - detailY, - function () { - //algorithm adapted from c++ to js - //https://stackoverflow.com/questions/16989181/whats-the-correct-way-to-draw-a-distorted-plane-in-opengl/16993202#16993202 - var xRes = 1 / (this.detailX - 1); - var yRes = 1 / (this.detailY - 1); - for (var y = 0; y < this.detailY; y++) { - for (var x = 0; x < this.detailX; x++) { - var pctx = x * xRes; - var pcty = y * yRes; - var linePt0x = (1 - pcty) * x1 + pcty * x4; - var linePt0y = (1 - pcty) * y1 + pcty * y4; - var linePt0z = (1 - pcty) * z1 + pcty * z4; - var linePt1x = (1 - pcty) * x2 + pcty * x3; - var linePt1y = (1 - pcty) * y2 + pcty * y3; - var linePt1z = (1 - pcty) * z2 + pcty * z3; - var ptx = (1 - pctx) * linePt0x + pctx * linePt1x; - var pty = (1 - pctx) * linePt0y + pctx * linePt1y; - var ptz = (1 - pctx) * linePt0z + pctx * linePt1z; - this.vertices.push( - new _main.default.Vector(ptx, pty, ptz), - ); - this.uvs.push([pctx, pcty]); - } - } - }, - ); - quadGeom.faces = []; - for (var y = 0; y < detailY - 1; y++) { - for (var x = 0; x < detailX - 1; x++) { - var pt0 = x + y * detailX; - var pt1 = x + 1 + y * detailX; - var pt2 = x + 1 + (y + 1) * detailX; - var pt3 = x + (y + 1) * detailX; - quadGeom.faces.push([pt0, pt1, pt2]); - quadGeom.faces.push([pt0, pt2, pt3]); - } - } - quadGeom.computeNormals(); - quadGeom.edges.length = 0; - var vertexOrder = [0, 2, 3, 1]; - for (var i = 0; i < vertexOrder.length; i++) { - var startVertex = vertexOrder[i]; - var endVertex = vertexOrder[(i + 1) % vertexOrder.length]; - quadGeom.edges.push([startVertex, endVertex]); - } - quadGeom._edgesToVertices(); - this.createBuffers(gId, quadGeom); - } - this.drawBuffers(gId); - return this; - }; - //this implementation of bezier curve - //is based on Bernstein polynomial - // pretier-ignore - _main.default.RendererGL.prototype.bezier = function ( - x1, - y1, - z1, // x2 - x2, // y2 - y2, // x3 - z2, // y3 - x3, // x4 - y3, // y4 - z3, - x4, - y4, - z4, - ) { - if (arguments.length === 8) { - y4 = y3; - x4 = x3; - y3 = z2; - x3 = y2; - y2 = x2; - x2 = z1; - z1 = z2 = z3 = z4 = 0; - } - var bezierDetail = this._pInst._bezierDetail || 20; //value of Bezier detail - this.beginShape(); - for (var i = 0; i <= bezierDetail; i++) { - var c1 = Math.pow(1 - i / bezierDetail, 3); - var c2 = - 3 * (i / bezierDetail) * Math.pow(1 - i / bezierDetail, 2); - var c3 = - 3 * Math.pow(i / bezierDetail, 2) * (1 - i / bezierDetail); - var c4 = Math.pow(i / bezierDetail, 3); - this.vertex( - x1 * c1 + x2 * c2 + x3 * c3 + x4 * c4, - y1 * c1 + y2 * c2 + y3 * c3 + y4 * c4, - z1 * c1 + z2 * c2 + z3 * c3 + z4 * c4, - ); - } - this.endShape(); - return this; - }; - // pretier-ignore - _main.default.RendererGL.prototype.curve = function ( - x1, - y1, - z1, // x2 - x2, // y2 - y2, // x3 - z2, // y3 - x3, // x4 - y3, // y4 - z3, - x4, - y4, - z4, - ) { - if (arguments.length === 8) { - x4 = x3; - y4 = y3; - x3 = y2; - y3 = x2; - x2 = z1; - y2 = x2; - z1 = z2 = z3 = z4 = 0; - } - var curveDetail = this._pInst._curveDetail; - this.beginShape(); - for (var i = 0; i <= curveDetail; i++) { - var c1 = Math.pow(i / curveDetail, 3) * 0.5; - var c2 = Math.pow(i / curveDetail, 2) * 0.5; - var c3 = (i / curveDetail) * 0.5; - var c4 = 0.5; - var vx = - c1 * (-x1 + 3 * x2 - 3 * x3 + x4) + - c2 * (2 * x1 - 5 * x2 + 4 * x3 - x4) + - c3 * (-x1 + x3) + - c4 * (2 * x2); - var vy = - c1 * (-y1 + 3 * y2 - 3 * y3 + y4) + - c2 * (2 * y1 - 5 * y2 + 4 * y3 - y4) + - c3 * (-y1 + y3) + - c4 * (2 * y2); - var vz = - c1 * (-z1 + 3 * z2 - 3 * z3 + z4) + - c2 * (2 * z1 - 5 * z2 + 4 * z3 - z4) + - c3 * (-z1 + z3) + - c4 * (2 * z2); - this.vertex(vx, vy, vz); - } - this.endShape(); - return this; - }; - /** - * Draw a line given two points - * @private - * @param {Number} x0 x-coordinate of first vertex - * @param {Number} y0 y-coordinate of first vertex - * @param {Number} z0 z-coordinate of first vertex - * @param {Number} x1 x-coordinate of second vertex - * @param {Number} y1 y-coordinate of second vertex - * @param {Number} z1 z-coordinate of second vertex - * @chainable - * @example - *
                                  - * - * //draw a line - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * // Use fill instead of stroke to change the color of shape. - * fill(255, 0, 0); - * line(10, 10, 0, 60, 60, 20); - * } - * - *
                                  - */ - _main.default.RendererGL.prototype.line = function () { - if (arguments.length === 6) { - this.beginShape(constants.LINES); - this.vertex( - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 2 ? undefined : arguments[2], - ); - this.vertex( - arguments.length <= 3 ? undefined : arguments[3], - arguments.length <= 4 ? undefined : arguments[4], - arguments.length <= 5 ? undefined : arguments[5], - ); - this.endShape(); - } else if (arguments.length === 4) { - this.beginShape(constants.LINES); - this.vertex( - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 1 ? undefined : arguments[1], - 0, - ); - this.vertex( - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 3 ? undefined : arguments[3], - 0, - ); - this.endShape(); - } - return this; - }; - _main.default.RendererGL.prototype.bezierVertex = function () { - if (this.immediateMode._bezierVertex.length === 0) { - throw Error( - "vertex() must be used once before calling bezierVertex()", - ); - } else { - var w_x = []; - var w_y = []; - var w_z = []; - var t, _x, _y, _z, i, k, m; - // variable i for bezierPoints, k for components, and m for anchor points. - var argLength = arguments.length; - t = 0; - if ( - this._lookUpTableBezier.length === 0 || - this._lutBezierDetail !== this._pInst._curveDetail - ) { - this._lookUpTableBezier = []; - this._lutBezierDetail = this._pInst._curveDetail; - var step = 1 / this._lutBezierDetail; - var start = 0; - var end = 1; - var j = 0; - while (start < 1) { - t = parseFloat(start.toFixed(6)); - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - if (end.toFixed(6) === step.toFixed(6)) { - t = - parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); - ++j; - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - break; - } - start += step; - end -= step; - ++j; - } - } - var LUTLength = this._lookUpTableBezier.length; - // fillColors[0]: start point color - // fillColors[1],[2]: control point color - // fillColors[3]: end point color - var fillColors = []; - for (m = 0; m < 4; m++) { - fillColors.push([]); - } - fillColors[0] = - this.immediateMode.geometry.vertexColors.slice(-4); - fillColors[3] = this.curFillColor.slice(); - // Do the same for strokeColor. - var strokeColors = []; - for (m = 0; m < 4; m++) { - strokeColors.push([]); - } - strokeColors[0] = - this.immediateMode.geometry.vertexStrokeColors.slice(-4); - strokeColors[3] = this.curStrokeColor.slice(); - if (argLength === 6) { - this.isBezier = true; - w_x = [ - this.immediateMode._bezierVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 4 ? undefined : arguments[4], - ]; - w_y = [ - this.immediateMode._bezierVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 3 ? undefined : arguments[3], - arguments.length <= 5 ? undefined : arguments[5], - ]; - // The ratio of the distance between the start point, the two control- - // points, and the end point determines the intermediate color. - var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); - var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); - var d2 = Math.hypot(w_x[2] - w_x[3], w_y[2] - w_y[3]); - var totalLength = d0 + d1 + d2; - d0 /= totalLength; - d2 /= totalLength; - for (k = 0; k < 4; k++) { - fillColors[1].push( - fillColors[0][k] * (1 - d0) + fillColors[3][k] * d0, - ); - fillColors[2].push( - fillColors[0][k] * d2 + fillColors[3][k] * (1 - d2), - ); - strokeColors[1].push( - strokeColors[0][k] * (1 - d0) + strokeColors[3][k] * d0, - ); - strokeColors[2].push( - strokeColors[0][k] * d2 + strokeColors[3][k] * (1 - d2), - ); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [0, 0, 0, 0]; - this.curStrokeColor = [0, 0, 0, 0]; - _x = _y = 0; - for (m = 0; m < 4; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += - this._lookUpTableBezier[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += - this._lookUpTableBezier[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableBezier[i][m]; - _y += w_y[m] * this._lookUpTableBezier[i][m]; - } - this.vertex(_x, _y); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[3]; - this.curStrokeColor = strokeColors[3]; - this.immediateMode._bezierVertex[0] = - arguments.length <= 4 ? undefined : arguments[4]; - this.immediateMode._bezierVertex[1] = - arguments.length <= 5 ? undefined : arguments[5]; - } else if (argLength === 9) { - this.isBezier = true; - w_x = [ - this.immediateMode._bezierVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 3 ? undefined : arguments[3], - arguments.length <= 6 ? undefined : arguments[6], - ]; - w_y = [ - this.immediateMode._bezierVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 4 ? undefined : arguments[4], - arguments.length <= 7 ? undefined : arguments[7], - ]; - w_z = [ - this.immediateMode._bezierVertex[2], - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 5 ? undefined : arguments[5], - arguments.length <= 8 ? undefined : arguments[8], - ]; - // The ratio of the distance between the start point, the two control- - // points, and the end point determines the intermediate color. - var _d = Math.hypot( - w_x[0] - w_x[1], - w_y[0] - w_y[1], - w_z[0] - w_z[1], - ); - var _d2 = Math.hypot( - w_x[1] - w_x[2], - w_y[1] - w_y[2], - w_z[1] - w_z[2], - ); - var _d3 = Math.hypot( - w_x[2] - w_x[3], - w_y[2] - w_y[3], - w_z[2] - w_z[3], - ); - var _totalLength = _d + _d2 + _d3; - _d /= _totalLength; - _d3 /= _totalLength; - for (k = 0; k < 4; k++) { - fillColors[1].push( - fillColors[0][k] * (1 - _d) + fillColors[3][k] * _d, - ); - fillColors[2].push( - fillColors[0][k] * _d3 + fillColors[3][k] * (1 - _d3), - ); - strokeColors[1].push( - strokeColors[0][k] * (1 - _d) + strokeColors[3][k] * _d, - ); - strokeColors[2].push( - strokeColors[0][k] * _d3 + strokeColors[3][k] * (1 - _d3), - ); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [0, 0, 0, 0]; - this.curStrokeColor = [0, 0, 0, 0]; - _x = _y = _z = 0; - for (m = 0; m < 4; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += - this._lookUpTableBezier[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += - this._lookUpTableBezier[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableBezier[i][m]; - _y += w_y[m] * this._lookUpTableBezier[i][m]; - _z += w_z[m] * this._lookUpTableBezier[i][m]; - } - this.vertex(_x, _y, _z); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[3]; - this.curStrokeColor = strokeColors[3]; - this.immediateMode._bezierVertex[0] = - arguments.length <= 6 ? undefined : arguments[6]; - this.immediateMode._bezierVertex[1] = - arguments.length <= 7 ? undefined : arguments[7]; - this.immediateMode._bezierVertex[2] = - arguments.length <= 8 ? undefined : arguments[8]; - } - } - }; - _main.default.RendererGL.prototype.quadraticVertex = function () { - if (this.immediateMode._quadraticVertex.length === 0) { - throw Error( - "vertex() must be used once before calling quadraticVertex()", - ); - } else { - var w_x = []; - var w_y = []; - var w_z = []; - var t, _x, _y, _z, i, k, m; - // variable i for bezierPoints, k for components, and m for anchor points. - var argLength = arguments.length; - t = 0; - if ( - this._lookUpTableQuadratic.length === 0 || - this._lutQuadraticDetail !== this._pInst._curveDetail - ) { - this._lookUpTableQuadratic = []; - this._lutQuadraticDetail = this._pInst._curveDetail; - var step = 1 / this._lutQuadraticDetail; - var start = 0; - var end = 1; - var j = 0; - while (start < 1) { - t = parseFloat(start.toFixed(6)); - this._lookUpTableQuadratic[j] = - this._quadraticCoefficients(t); - if (end.toFixed(6) === step.toFixed(6)) { - t = - parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); - ++j; - this._lookUpTableQuadratic[j] = - this._quadraticCoefficients(t); - break; - } - start += step; - end -= step; - ++j; - } - } - var LUTLength = this._lookUpTableQuadratic.length; - // fillColors[0]: start point color - // fillColors[1]: control point color - // fillColors[2]: end point color - var fillColors = []; - for (m = 0; m < 3; m++) { - fillColors.push([]); - } - fillColors[0] = - this.immediateMode.geometry.vertexColors.slice(-4); - fillColors[2] = this.curFillColor.slice(); - // Do the same for strokeColor. - var strokeColors = []; - for (m = 0; m < 3; m++) { - strokeColors.push([]); - } - strokeColors[0] = - this.immediateMode.geometry.vertexStrokeColors.slice(-4); - strokeColors[2] = this.curStrokeColor.slice(); - if (argLength === 4) { - this.isQuadratic = true; - w_x = [ - this.immediateMode._quadraticVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 2 ? undefined : arguments[2], - ]; - w_y = [ - this.immediateMode._quadraticVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 3 ? undefined : arguments[3], - ]; - // The ratio of the distance between the start point, the control- - // point, and the end point determines the intermediate color. - var d0 = Math.hypot(w_x[0] - w_x[1], w_y[0] - w_y[1]); - var d1 = Math.hypot(w_x[1] - w_x[2], w_y[1] - w_y[2]); - var totalLength = d0 + d1; - d0 /= totalLength; - for (k = 0; k < 4; k++) { - fillColors[1].push( - fillColors[0][k] * (1 - d0) + fillColors[2][k] * d0, - ); - strokeColors[1].push( - strokeColors[0][k] * (1 - d0) + strokeColors[2][k] * d0, - ); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [0, 0, 0, 0]; - this.curStrokeColor = [0, 0, 0, 0]; - _x = _y = 0; - for (m = 0; m < 3; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += - this._lookUpTableQuadratic[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += - this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableQuadratic[i][m]; - _y += w_y[m] * this._lookUpTableQuadratic[i][m]; - } - this.vertex(_x, _y); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[2]; - this.curStrokeColor = strokeColors[2]; - this.immediateMode._quadraticVertex[0] = - arguments.length <= 2 ? undefined : arguments[2]; - this.immediateMode._quadraticVertex[1] = - arguments.length <= 3 ? undefined : arguments[3]; - } else if (argLength === 6) { - this.isQuadratic = true; - w_x = [ - this.immediateMode._quadraticVertex[0], - arguments.length <= 0 ? undefined : arguments[0], - arguments.length <= 3 ? undefined : arguments[3], - ]; - w_y = [ - this.immediateMode._quadraticVertex[1], - arguments.length <= 1 ? undefined : arguments[1], - arguments.length <= 4 ? undefined : arguments[4], - ]; - w_z = [ - this.immediateMode._quadraticVertex[2], - arguments.length <= 2 ? undefined : arguments[2], - arguments.length <= 5 ? undefined : arguments[5], - ]; - // The ratio of the distance between the start point, the control- - // point, and the end point determines the intermediate color. - var _d4 = Math.hypot( - w_x[0] - w_x[1], - w_y[0] - w_y[1], - w_z[0] - w_z[1], - ); - var _d5 = Math.hypot( - w_x[1] - w_x[2], - w_y[1] - w_y[2], - w_z[1] - w_z[2], - ); - var _totalLength2 = _d4 + _d5; - _d4 /= _totalLength2; - for (k = 0; k < 4; k++) { - fillColors[1].push( - fillColors[0][k] * (1 - _d4) + fillColors[2][k] * _d4, - ); - strokeColors[1].push( - strokeColors[0][k] * (1 - _d4) + strokeColors[2][k] * _d4, - ); - } - for (i = 0; i < LUTLength; i++) { - // Interpolate colors using control points - this.curFillColor = [0, 0, 0, 0]; - this.curStrokeColor = [0, 0, 0, 0]; - _x = _y = _z = 0; - for (m = 0; m < 3; m++) { - for (k = 0; k < 4; k++) { - this.curFillColor[k] += - this._lookUpTableQuadratic[i][m] * fillColors[m][k]; - this.curStrokeColor[k] += - this._lookUpTableQuadratic[i][m] * strokeColors[m][k]; - } - _x += w_x[m] * this._lookUpTableQuadratic[i][m]; - _y += w_y[m] * this._lookUpTableQuadratic[i][m]; - _z += w_z[m] * this._lookUpTableQuadratic[i][m]; - } - this.vertex(_x, _y, _z); - } // so that we leave currentColor with the last value the user set it to - - this.curFillColor = fillColors[2]; - this.curStrokeColor = strokeColors[2]; - this.immediateMode._quadraticVertex[0] = - arguments.length <= 3 ? undefined : arguments[3]; - this.immediateMode._quadraticVertex[1] = - arguments.length <= 4 ? undefined : arguments[4]; - this.immediateMode._quadraticVertex[2] = - arguments.length <= 5 ? undefined : arguments[5]; - } - } - }; - _main.default.RendererGL.prototype.curveVertex = function () { - var w_x = []; - var w_y = []; - var w_z = []; - var t, _x, _y, _z, i; - t = 0; - var argLength = arguments.length; - if ( - this._lookUpTableBezier.length === 0 || - this._lutBezierDetail !== this._pInst._curveDetail - ) { - this._lookUpTableBezier = []; - this._lutBezierDetail = this._pInst._curveDetail; - var step = 1 / this._lutBezierDetail; - var start = 0; - var end = 1; - var j = 0; - while (start < 1) { - t = parseFloat(start.toFixed(6)); - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - if (end.toFixed(6) === step.toFixed(6)) { - t = parseFloat(end.toFixed(6)) + parseFloat(start.toFixed(6)); - ++j; - this._lookUpTableBezier[j] = this._bezierCoefficients(t); - break; - } - start += step; - end -= step; - ++j; - } - } - var LUTLength = this._lookUpTableBezier.length; - if (argLength === 2) { - this.immediateMode._curveVertex.push( - arguments.length <= 0 ? undefined : arguments[0], - ); - this.immediateMode._curveVertex.push( - arguments.length <= 1 ? undefined : arguments[1], - ); - if (this.immediateMode._curveVertex.length === 8) { - this.isCurve = true; - w_x = this._bezierToCatmull([ - this.immediateMode._curveVertex[0], - this.immediateMode._curveVertex[2], - this.immediateMode._curveVertex[4], - this.immediateMode._curveVertex[6], - ]); - w_y = this._bezierToCatmull([ - this.immediateMode._curveVertex[1], - this.immediateMode._curveVertex[3], - this.immediateMode._curveVertex[5], - this.immediateMode._curveVertex[7], - ]); - for (i = 0; i < LUTLength; i++) { - _x = - w_x[0] * this._lookUpTableBezier[i][0] + - w_x[1] * this._lookUpTableBezier[i][1] + - w_x[2] * this._lookUpTableBezier[i][2] + - w_x[3] * this._lookUpTableBezier[i][3]; - _y = - w_y[0] * this._lookUpTableBezier[i][0] + - w_y[1] * this._lookUpTableBezier[i][1] + - w_y[2] * this._lookUpTableBezier[i][2] + - w_y[3] * this._lookUpTableBezier[i][3]; - this.vertex(_x, _y); - } - for (i = 0; i < argLength; i++) { - this.immediateMode._curveVertex.shift(); - } - } - } else if (argLength === 3) { - this.immediateMode._curveVertex.push( - arguments.length <= 0 ? undefined : arguments[0], - ); - this.immediateMode._curveVertex.push( - arguments.length <= 1 ? undefined : arguments[1], - ); - this.immediateMode._curveVertex.push( - arguments.length <= 2 ? undefined : arguments[2], - ); - if (this.immediateMode._curveVertex.length === 12) { - this.isCurve = true; - w_x = this._bezierToCatmull([ - this.immediateMode._curveVertex[0], - this.immediateMode._curveVertex[3], - this.immediateMode._curveVertex[6], - this.immediateMode._curveVertex[9], - ]); - w_y = this._bezierToCatmull([ - this.immediateMode._curveVertex[1], - this.immediateMode._curveVertex[4], - this.immediateMode._curveVertex[7], - this.immediateMode._curveVertex[10], - ]); - w_z = this._bezierToCatmull([ - this.immediateMode._curveVertex[2], - this.immediateMode._curveVertex[5], - this.immediateMode._curveVertex[8], - this.immediateMode._curveVertex[11], - ]); - for (i = 0; i < LUTLength; i++) { - _x = - w_x[0] * this._lookUpTableBezier[i][0] + - w_x[1] * this._lookUpTableBezier[i][1] + - w_x[2] * this._lookUpTableBezier[i][2] + - w_x[3] * this._lookUpTableBezier[i][3]; - _y = - w_y[0] * this._lookUpTableBezier[i][0] + - w_y[1] * this._lookUpTableBezier[i][1] + - w_y[2] * this._lookUpTableBezier[i][2] + - w_y[3] * this._lookUpTableBezier[i][3]; - _z = - w_z[0] * this._lookUpTableBezier[i][0] + - w_z[1] * this._lookUpTableBezier[i][1] + - w_z[2] * this._lookUpTableBezier[i][2] + - w_z[3] * this._lookUpTableBezier[i][3]; - this.vertex(_x, _y, _z); - } - for (i = 0; i < argLength; i++) { - this.immediateMode._curveVertex.shift(); - } - } - } - }; - _main.default.RendererGL.prototype.image = function ( - img, - sx, - sy, - sWidth, - sHeight, - dx, - dy, - dWidth, - dHeight, - ) { - if (this._isErasing) { - this.blendMode(this._cachedBlendMode); - } - this._pInst.push(); - this._pInst.noLights(); - this._pInst.noStroke(); - this._pInst.texture(img); - this._pInst.textureMode(constants.NORMAL); - var u0 = 0; - if (sx <= img.width) { - u0 = sx / img.width; - } - var u1 = 1; - if (sx + sWidth <= img.width) { - u1 = (sx + sWidth) / img.width; - } - var v0 = 0; - if (sy <= img.height) { - v0 = sy / img.height; - } - var v1 = 1; - if (sy + sHeight <= img.height) { - v1 = (sy + sHeight) / img.height; - } - this.beginShape(); - this.vertex(dx, dy, 0, u0, v0); - this.vertex(dx + dWidth, dy, 0, u1, v0); - this.vertex(dx + dWidth, dy + dHeight, 0, u1, v1); - this.vertex(dx, dy + dHeight, 0, u0, v1); - this.endShape(constants.CLOSE); - this._pInst.pop(); - if (this._isErasing) { - this.blendMode(constants.REMOVE); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.Geometry": 350, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.math.hypot": 188, - "core-js/modules/es.math.sign": 190, - "core-js/modules/es.number.to-fixed": 193, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 342: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.object.assign"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @private - * A class responsible for converting successive WebGL draw calls into a single - * `p5.Geometry` that can be reused and drawn with `model()`. - */ - - var GeometryBuilder = /*#__PURE__*/ (function () { - function GeometryBuilder(renderer) { - _classCallCheck(this, GeometryBuilder); - this.renderer = renderer; - renderer._pInst.push(); - this.identityMatrix = new _main.default.Matrix(); - renderer.uMVMatrix = new _main.default.Matrix(); - this.geometry = new _main.default.Geometry(); - this.geometry.gid = "_p5_GeometryBuilder_".concat( - GeometryBuilder.nextGeometryId, - ); - GeometryBuilder.nextGeometryId++; - this.hasTransform = false; - } /** - * @private - * Applies the current transformation matrix to each vertex. - */ - - _createClass(GeometryBuilder, [ - { - key: "transformVertices", - value: function transformVertices(vertices) { - var _this = this; - if (!this.hasTransform) return vertices; - return vertices.map(function (v) { - return _this.renderer.uMVMatrix.multiplyPoint(v); - }); - } /** - * @private - * Applies the current normal matrix to each normal. - */, - }, - { - key: "transformNormals", - value: function transformNormals(normals) { - var _this2 = this; - if (!this.hasTransform) return normals; - return normals.map(function (v) { - return _this2.renderer.uNMatrix.multiplyVec3(v); - }); - } /** - * @private - * Adds a p5.Geometry to the builder's combined geometry, flattening - * transformations. - */, - }, - { - key: "addGeometry", - value: function addGeometry(input) { - var _this3 = this, - _this$geometry$vertic, - _this$geometry$vertex, - _this$geometry$uvs, - _this$geometry$vertex2; - this.hasTransform = !this.renderer.uMVMatrix.mat4.every( - function (v, i) { - return v === _this3.identityMatrix.mat4[i]; - }, - ); - if (this.hasTransform) { - this.renderer.uNMatrix.inverseTranspose( - this.renderer.uMVMatrix, - ); - } - var startIdx = this.geometry.vertices.length; - (_this$geometry$vertic = this.geometry.vertices).push.apply( - _this$geometry$vertic, - _toConsumableArray(this.transformVertices(input.vertices)), - ); - (_this$geometry$vertex = - this.geometry.vertexNormals).push.apply( - _this$geometry$vertex, - _toConsumableArray( - this.transformNormals(input.vertexNormals), - ), - ); - (_this$geometry$uvs = this.geometry.uvs).push.apply( - _this$geometry$uvs, - _toConsumableArray(input.uvs), - ); - if (this.renderer._doFill) { - var _this$geometry$faces; - (_this$geometry$faces = this.geometry.faces).push.apply( - _this$geometry$faces, - _toConsumableArray( - input.faces.map(function (f) { - return f.map(function (idx) { - return idx + startIdx; - }); - }), - ), - ); - } - if (this.renderer._doStroke) { - var _this$geometry$edges; - (_this$geometry$edges = this.geometry.edges).push.apply( - _this$geometry$edges, - _toConsumableArray( - input.edges.map(function (edge) { - return edge.map(function (idx) { - return idx + startIdx; - }); - }), - ), - ); - } - var vertexColors = _toConsumableArray(input.vertexColors); - while (vertexColors.length < input.vertices.length * 4) { - vertexColors.push.apply( - vertexColors, - _toConsumableArray(this.renderer.curFillColor), - ); - } - (_this$geometry$vertex2 = - this.geometry.vertexColors).push.apply( - _this$geometry$vertex2, - _toConsumableArray(vertexColors), - ); - } /** - * Adds geometry from the renderer's immediate mode into the builder's - * combined geometry. - */, - }, - { - key: "addImmediate", - value: function addImmediate() { - var geometry = this.renderer.immediateMode.geometry; - var shapeMode = this.renderer.immediateMode.shapeMode; - var faces = []; - if (this.renderer._doFill) { - if ( - shapeMode === constants.TRIANGLE_STRIP || - shapeMode === constants.QUAD_STRIP - ) { - for (var i = 2; i < geometry.vertices.length; i++) { - if (i % 2 === 0) { - faces.push([i, i - 1, i - 2]); - } else { - faces.push([i, i - 2, i - 1]); - } - } - } else if (shapeMode === constants.TRIANGLE_FAN) { - for (var _i = 2; _i < geometry.vertices.length; _i++) { - faces.push([0, _i - 1, _i]); - } - } else { - for ( - var _i2 = 0; - _i2 < geometry.vertices.length; - _i2 += 3 - ) { - faces.push([_i2, _i2 + 1, _i2 + 2]); - } - } - } - this.addGeometry( - Object.assign({}, geometry, { - faces: faces, - }), - ); - } /** - * Adds geometry from the renderer's retained mode into the builder's - * combined geometry. - */, - }, - { - key: "addRetained", - value: function addRetained(geometry) { - this.addGeometry(geometry.model); - } /** - * Cleans up the state of the renderer and returns the combined geometry that - * was built. - * @returns p5.Geometry The flattened, combined geometry - */, - }, - { - key: "finish", - value: function finish() { - this.renderer._pInst.pop(); - return this.geometry; - }, - }, - ]); - return GeometryBuilder; - })(); - /** - * Keeps track of how many custom geometry objects have been made so that each - * can be assigned a unique ID. - */ - GeometryBuilder.nextGeometryId = 0; - var _default = GeometryBuilder; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.every": 171, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.object.assign": 194, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 343: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.math.sign"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.math.sign"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } /** - * @module 3D - * @submodule Interaction - * @for p5 - * @requires core - */ - /** - * Allows movement around a 3D sketch using a mouse or trackpad or touch. - * Left-clicking and dragging or swipe motion will rotate the camera position - * about the center of the sketch, right-clicking and dragging or multi-swipe - * will pan the camera position without rotation, and using the mouse wheel - * (scrolling) or pinch in/out will move the camera further or closer - * from the center of the sketch. This function can be called with parameters - * dictating sensitivity to mouse/touch movement along the X and Y axes. - * Calling this function without parameters is equivalent to calling - * orbitControl(1,1). To reverse direction of movement in either axis, - * enter a negative number for sensitivity. - * @method orbitControl - * @for p5 - * @param {Number} [sensitivityX] sensitivity to mouse movement along X axis - * @param {Number} [sensitivityY] sensitivity to mouse movement along Y axis - * @param {Number} [sensitivityZ] sensitivity to scroll movement along Z axis - * @param {Object} [options] An optional object that can contain additional settings, - * disableTouchActions - Boolean, default value is true. - * Setting this to true makes mobile interactions smoother by preventing - * accidental interactions with the page while orbiting. But if you're already - * doing it via css or want the default touch actions, consider setting it to false. - * freeRotation - Boolean, default value is false. - * By default, horizontal movement of the mouse or touch pointer rotates the camera - * around the y-axis, and vertical movement rotates the camera around the x-axis. - * But if setting this option to true, the camera always rotates in the direction - * the pointer is moving. For zoom and move, the behavior is the same regardless of - * true/false. - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * describe( - * 'Camera orbits around a box when mouse is hold-clicked & then moved.' - * ); - * } - * function draw() { - * background(200); - * - * // If you execute the line commented out instead of next line, the direction of rotation - * // will be the direction the mouse or touch pointer moves, not around the X or Y axis. - * orbitControl(); - * // orbitControl(1, 1, 1, {freeRotation: true}); - * - * rotateY(0.5); - * box(30, 50); - * } - * - *
                                  - * - * @alt - * Camera orbits around a box when mouse is hold-clicked & then moved. - */ - // implementation based on three.js 'orbitControls': - // https://github.com/mrdoob/three.js/blob/6afb8595c0bf8b2e72818e42b64e6fe22707d896/examples/jsm/controls/OrbitControls.js#L22 - - _main.default.prototype.orbitControl = function ( - sensitivityX, - sensitivityY, - sensitivityZ, - options, - ) { - var _this = this; - this._assert3d("orbitControl"); - _main.default._validateParameters("orbitControl", arguments); - var cam = this._renderer._curCamera; - if (typeof sensitivityX === "undefined") { - sensitivityX = 1; - } - if (typeof sensitivityY === "undefined") { - sensitivityY = sensitivityX; - } - if (typeof sensitivityZ === "undefined") { - sensitivityZ = 1; - } - if (_typeof(options) !== "object") { - options = {}; - } // default right-mouse and mouse-wheel behaviors (context menu and scrolling, - // respectively) are disabled here to allow use of those events for panning and - // zooming. However, whether or not to disable touch actions is an option. - // disable context menu for canvas element and add 'contextMenuDisabled' - // flag to p5 instance - - if (this.contextMenuDisabled !== true) { - this.canvas.oncontextmenu = function () { - return false; - }; - this._setProperty("contextMenuDisabled", true); - } // disable default scrolling behavior on the canvas element and add - // 'wheelDefaultDisabled' flag to p5 instance - - if (this.wheelDefaultDisabled !== true) { - this.canvas.onwheel = function () { - return false; - }; - this._setProperty("wheelDefaultDisabled", true); - } // disable default touch behavior on the canvas element and add - // 'touchActionsDisabled' flag to p5 instance - - var _options = options, - _options$disableTouch = _options.disableTouchActions, - disableTouchActions = - _options$disableTouch === void 0 ? true : _options$disableTouch; - if (this.touchActionsDisabled !== true && disableTouchActions) { - this.canvas.style["touch-action"] = "none"; - this._setProperty("touchActionsDisabled", true); - } // If option.freeRotation is true, the camera always rotates freely in the direction - // the pointer moves. default value is false (normal behavior) - - var _options2 = options, - _options2$freeRotatio = _options2.freeRotation, - freeRotation = - _options2$freeRotatio === void 0 - ? false - : _options2$freeRotatio; // get moved touches. - var movedTouches = []; - this.touches.forEach(function (curTouch) { - _this._renderer.prevTouches.forEach(function (prevTouch) { - if (curTouch.id === prevTouch.id) { - var movedTouch = { - x: curTouch.x, - y: curTouch.y, - px: prevTouch.x, - py: prevTouch.y, - }; - movedTouches.push(movedTouch); - } - }); - }); - this._renderer.prevTouches = this.touches; - // The idea of using damping is based on the following website. thank you. - // https://github.com/freshfork/p5.EasyCam/blob/9782964680f6a5c4c9bee825c475d9f2021d5134/p5.easycam.js#L1124 - // variables for interaction - var deltaRadius = 0; - var deltaTheta = 0; - var deltaPhi = 0; - var moveDeltaX = 0; - var moveDeltaY = 0; - // constants for dampingProcess - var damping = 0.85; - var rotateAccelerationFactor = 0.6; - var moveAccelerationFactor = 0.15; - // For touches, the appropriate scale is different - // because the distance difference is multiplied. - var mouseZoomScaleFactor = 0.01; - var touchZoomScaleFactor = 0.0004; - var scaleFactor = - this.height < this.width ? this.height : this.width; - // Flag whether the mouse or touch pointer is inside the canvas - var pointersInCanvas = false; - // calculate and determine flags and variables. - if (movedTouches.length > 0) { - /* for touch */ - // if length === 1, rotate - // if length > 1, zoom and move - // for touch, it is calculated based on one moved touch pointer position. - pointersInCanvas = - movedTouches[0].x > 0 && - movedTouches[0].x < this.width && - movedTouches[0].y > 0 && - movedTouches[0].y < this.height; - if (movedTouches.length === 1) { - var t = movedTouches[0]; - deltaTheta = (-sensitivityX * (t.x - t.px)) / scaleFactor; - deltaPhi = (sensitivityY * (t.y - t.py)) / scaleFactor; - } else { - var t0 = movedTouches[0]; - var t1 = movedTouches[1]; - var distWithTouches = Math.hypot(t0.x - t1.x, t0.y - t1.y); - var prevDistWithTouches = Math.hypot( - t0.px - t1.px, - t0.py - t1.py, - ); - var changeDist = distWithTouches - prevDistWithTouches; - // move the camera farther when the distance between the two touch points - // decreases, move the camera closer when it increases. - deltaRadius = -changeDist * sensitivityZ * touchZoomScaleFactor; - // Move the center of the camera along with the movement of - // the center of gravity of the two touch points. - moveDeltaX = 0.5 * (t0.x + t1.x) - 0.5 * (t0.px + t1.px); - moveDeltaY = 0.5 * (t0.y + t1.y) - 0.5 * (t0.py + t1.py); - } - if (this.touches.length > 0) { - if (pointersInCanvas) { - // Initiate an interaction if touched in the canvas - this._renderer.executeRotateAndMove = true; - this._renderer.executeZoom = true; - } - } else { - // End an interaction when the touch is released - this._renderer.executeRotateAndMove = false; - this._renderer.executeZoom = false; - } - } else { - /* for mouse */ - // if wheelDeltaY !== 0, zoom - // if mouseLeftButton is down, rotate - // if mouseRightButton is down, move - // For mouse, it is calculated based on the mouse position. - pointersInCanvas = - this.mouseX > 0 && - this.mouseX < this.width && - this.mouseY > 0 && - this.mouseY < this.height; - if (this._mouseWheelDeltaY !== 0) { - // zoom the camera depending on the value of _mouseWheelDeltaY. - // move away if positive, move closer if negative - deltaRadius = Math.sign(this._mouseWheelDeltaY) * sensitivityZ; - deltaRadius *= mouseZoomScaleFactor; - this._mouseWheelDeltaY = 0; - // start zoom when the mouse is wheeled within the canvas. - if (pointersInCanvas) this._renderer.executeZoom = true; - } else { - // quit zoom when you stop wheeling. - this._renderer.zoomFlag = false; - } - if (this.mouseIsPressed) { - if (this.mouseButton === this.LEFT) { - deltaTheta = (-sensitivityX * this.movedX) / scaleFactor; - deltaPhi = (sensitivityY * this.movedY) / scaleFactor; - } else if (this.mouseButton === this.RIGHT) { - moveDeltaX = this.movedX; - moveDeltaY = this.movedY * cam.yScale; - } // start rotate and move when mouse is pressed within the canvas. - - if (pointersInCanvas) - this._renderer.executeRotateAndMove = true; - } else { - // quit rotate and move if mouse is released. - this._renderer.executeRotateAndMove = false; - } - } // interactions - // zoom process - - if (deltaRadius !== 0 && this._renderer.executeZoom) { - // accelerate zoom velocity - this._renderer.zoomVelocity += deltaRadius; - } - if (Math.abs(this._renderer.zoomVelocity) > 0.001) { - // if freeRotation is true, we use _orbitFree() instead of _orbit() - if (freeRotation) { - cam._orbitFree(0, 0, this._renderer.zoomVelocity); - } else { - cam._orbit(0, 0, this._renderer.zoomVelocity); - } // In orthogonal projection, the scale does not change even if - // the distance to the gaze point is changed, so the projection matrix - // needs to be modified. - - if (cam.projMatrix.mat4[15] !== 0) { - cam.projMatrix.mat4[0] *= Math.pow( - 10, - -this._renderer.zoomVelocity, - ); - cam.projMatrix.mat4[5] *= Math.pow( - 10, - -this._renderer.zoomVelocity, - ); - // modify uPMatrix - this._renderer.uPMatrix.mat4[0] = cam.projMatrix.mat4[0]; - this._renderer.uPMatrix.mat4[5] = cam.projMatrix.mat4[5]; - } // damping - - this._renderer.zoomVelocity *= damping; - } else { - this._renderer.zoomVelocity = 0; - } // rotate process - - if ( - (deltaTheta !== 0 || deltaPhi !== 0) && - this._renderer.executeRotateAndMove - ) { - // accelerate rotate velocity - this._renderer.rotateVelocity.add( - deltaTheta * rotateAccelerationFactor, - deltaPhi * rotateAccelerationFactor, - ); - } - if (this._renderer.rotateVelocity.magSq() > 0.000001) { - // if freeRotation is true, the camera always rotates freely in the direction the pointer moves - if (freeRotation) { - cam._orbitFree( - -this._renderer.rotateVelocity.x, - this._renderer.rotateVelocity.y, - 0, - ); - } else { - cam._orbit( - this._renderer.rotateVelocity.x, - this._renderer.rotateVelocity.y, - 0, - ); - } // damping - - this._renderer.rotateVelocity.mult(damping); - } else { - this._renderer.rotateVelocity.set(0, 0); - } // move process - - if ( - (moveDeltaX !== 0 || moveDeltaY !== 0) && - this._renderer.executeRotateAndMove - ) { - // Normalize movement distance - var ndcX = (moveDeltaX * 2) / this.width; - var ndcY = (-moveDeltaY * 2) / this.height; - // accelerate move velocity - this._renderer.moveVelocity.add( - ndcX * moveAccelerationFactor, - ndcY * moveAccelerationFactor, - ); - } - if (this._renderer.moveVelocity.magSq() > 0.000001) { - // Translate the camera so that the entire object moves - // perpendicular to the line of sight when the mouse is moved - // or when the centers of gravity of the two touch pointers move. - var local = cam._getLocalAxes(); - // Calculate the z coordinate in the view coordinates of - // the center, that is, the distance to the view point - var diffX = cam.eyeX - cam.centerX; - var diffY = cam.eyeY - cam.centerY; - var diffZ = cam.eyeZ - cam.centerZ; - var viewZ = Math.sqrt( - diffX * diffX + diffY * diffY + diffZ * diffZ, - ); - // position vector of the center. - var cv = new _main.default.Vector( - cam.centerX, - cam.centerY, - cam.centerZ, - ); - // Calculate the normalized device coordinates of the center. - cv = cam.cameraMatrix.multiplyPoint(cv); - cv = this._renderer.uPMatrix.multiplyAndNormalizePoint(cv); - // Move the center by this distance - // in the normalized device coordinate system. - cv.x -= this._renderer.moveVelocity.x; - cv.y -= this._renderer.moveVelocity.y; - // Calculate the translation vector - // in the direction perpendicular to the line of sight of center. - var dx, dy; - var uP = this._renderer.uPMatrix.mat4; - if (uP[15] === 0) { - dx = ((uP[8] + cv.x) / uP[0]) * viewZ; - dy = ((uP[9] + cv.y) / uP[5]) * viewZ; - } else { - dx = (cv.x - uP[12]) / uP[0]; - dy = (cv.y - uP[13]) / uP[5]; - } // translate the camera. - - cam.setPosition( - cam.eyeX + dx * local.x[0] + dy * local.y[0], - cam.eyeY + dx * local.x[1] + dy * local.y[1], - cam.eyeZ + dx * local.x[2] + dy * local.y[2], - ); - // damping - this._renderer.moveVelocity.mult(damping); - } else { - this._renderer.moveVelocity.set(0, 0); - } - return this; - }; - /** - * debugMode() helps visualize 3D space by adding a grid to indicate where the - * ‘ground’ is in a sketch and an axes icon which indicates the +X, +Y, and +Z - * directions. This function can be called without parameters to create a - * default grid and axes icon, or it can be called according to the examples - * above to customize the size and position of the grid and/or axes icon. The - * grid is drawn using the most recently set stroke color and weight. To - * specify these parameters, add a call to stroke() and strokeWeight() - * just before the end of the draw() loop. - * - * By default, the grid will run through the origin (0,0,0) of the sketch - * along the XZ plane - * and the axes icon will be offset from the origin. Both the grid and axes - * icon will be sized according to the current canvas size. Note that because the - * grid runs parallel to the default camera view, it is often helpful to use - * debugMode along with orbitControl to allow full view of the grid. - * @method debugMode - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(); - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' - * ); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * // Press the spacebar to turn debugMode off! - * if (keyIsDown(32)) { - * noDebugMode(); - * } - * } - * - *
                                  - * @alt - * a 3D box is centered on a grid in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. the grid and icon disappear when the - * spacebar is pressed. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(GRID); - * describe('a 3D box is centered on a grid in a 3D sketch.'); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * } - * - *
                                  - * @alt - * a 3D box is centered on a grid in a 3D sketch. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(AXES); - * describe( - * 'a 3D box is centered in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' - * ); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * } - * - *
                                  - * @alt - * a 3D box is centered in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(GRID, 100, 10, 0, 0, 0); - * describe('a 3D box is centered on a grid in a 3D sketch'); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * } - * - *
                                  - * @alt - * a 3D box is centered on a grid in a 3D sketch - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(100, 10, 0, 0, 0, 20, 0, -40, 0); - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z.' - * ); - * } - * - * function draw() { - * noStroke(); - * background(200); - * orbitControl(); - * box(15, 30); - * // set the stroke color and weight for the grid! - * stroke(255, 0, 150); - * strokeWeight(0.8); - * } - * - *
                                  - * @alt - * a 3D box is centered on a grid in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. - */ - /** - * @method debugMode - * @param {Constant} mode either GRID or AXES - */ - /** - * @method debugMode - * @param {Constant} mode - * @param {Number} [gridSize] size of one side of the grid - * @param {Number} [gridDivisions] number of divisions in the grid - * @param {Number} [xOff] X axis offset from origin (0,0,0) - * @param {Number} [yOff] Y axis offset from origin (0,0,0) - * @param {Number} [zOff] Z axis offset from origin (0,0,0) - */ - /** - * @method debugMode - * @param {Constant} mode - * @param {Number} [axesSize] size of axes icon - * @param {Number} [xOff] - * @param {Number} [yOff] - * @param {Number} [zOff] - */ - /** - * @method debugMode - * @param {Number} [gridSize] - * @param {Number} [gridDivisions] - * @param {Number} [gridXOff] - * @param {Number} [gridYOff] - * @param {Number} [gridZOff] - * @param {Number} [axesSize] - * @param {Number} [axesXOff] - * @param {Number} [axesYOff] - * @param {Number} [axesZOff] - */ - _main.default.prototype.debugMode = function () { - this._assert3d("debugMode"); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("debugMode", args); - // start by removing existing 'post' registered debug methods - for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { - // test for equality... - if ( - this._registeredMethods.post[i].toString() === - this._grid().toString() || - this._registeredMethods.post[i].toString() === - this._axesIcon().toString() - ) { - this._registeredMethods.post.splice(i, 1); - } - } // then add new debugMode functions according to the argument list - - if (args[0] === constants.GRID) { - this.registerMethod( - "post", - this._grid.call( - this, - args[1], - args[2], - args[3], - args[4], - args[5], - ), - ); - } else if (args[0] === constants.AXES) { - this.registerMethod( - "post", - this._axesIcon.call(this, args[1], args[2], args[3], args[4]), - ); - } else { - this.registerMethod( - "post", - this._grid.call( - this, - args[0], - args[1], - args[2], - args[3], - args[4], - ), - ); - this.registerMethod( - "post", - this._axesIcon.call(this, args[5], args[6], args[7], args[8]), - ); - } - }; - /** - * Turns off debugMode() in a 3D sketch. - * @method noDebugMode - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * camera(0, -30, 100, 0, 0, 0, 0, 1, 0); - * normalMaterial(); - * debugMode(); - * describe( - * 'a 3D box is centered on a grid in a 3D sketch. an icon indicates the direction of each axis: a red line points +X, a green line +Y, and a blue line +Z. the grid and icon disappear when the spacebar is pressed.' - * ); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * box(15, 30); - * // Press the spacebar to turn debugMode off! - * if (keyIsDown(32)) { - * noDebugMode(); - * } - * } - * - *
                                  - * @alt - * a 3D box is centered on a grid in a 3D sketch. an icon - * indicates the direction of each axis: a red line points +X, - * a green line +Y, and a blue line +Z. the grid and icon disappear when the - * spacebar is pressed. - */ - _main.default.prototype.noDebugMode = function () { - this._assert3d("noDebugMode"); - // start by removing existing 'post' registered debug methods - for (var i = this._registeredMethods.post.length - 1; i >= 0; i--) { - // test for equality... - if ( - this._registeredMethods.post[i].toString() === - this._grid().toString() || - this._registeredMethods.post[i].toString() === - this._axesIcon().toString() - ) { - this._registeredMethods.post.splice(i, 1); - } - } - }; - /** - * For use with debugMode - * @private - * @method _grid - * @param {Number} [size] size of grid sides - * @param {Number} [div] number of grid divisions - * @param {Number} [xOff] offset of grid center from origin in X axis - * @param {Number} [yOff] offset of grid center from origin in Y axis - * @param {Number} [zOff] offset of grid center from origin in Z axis - */ - _main.default.prototype._grid = function ( - size, - numDivs, - xOff, - yOff, - zOff, - ) { - if (typeof size === "undefined") { - size = this.width / 2; - } - if (typeof numDivs === "undefined") { - // ensure at least 2 divisions - numDivs = Math.round(size / 30) < 4 ? 4 : Math.round(size / 30); - } - if (typeof xOff === "undefined") { - xOff = 0; - } - if (typeof yOff === "undefined") { - yOff = 0; - } - if (typeof zOff === "undefined") { - zOff = 0; - } - var spacing = size / numDivs; - var halfSize = size / 2; - return function () { - this.push(); - this.stroke( - this._renderer.curStrokeColor[0] * 255, - this._renderer.curStrokeColor[1] * 255, - this._renderer.curStrokeColor[2] * 255, - ); - this._renderer.uMVMatrix.set( - this._renderer._curCamera.cameraMatrix.mat4[0], - this._renderer._curCamera.cameraMatrix.mat4[1], - this._renderer._curCamera.cameraMatrix.mat4[2], - this._renderer._curCamera.cameraMatrix.mat4[3], - this._renderer._curCamera.cameraMatrix.mat4[4], - this._renderer._curCamera.cameraMatrix.mat4[5], - this._renderer._curCamera.cameraMatrix.mat4[6], - this._renderer._curCamera.cameraMatrix.mat4[7], - this._renderer._curCamera.cameraMatrix.mat4[8], - this._renderer._curCamera.cameraMatrix.mat4[9], - this._renderer._curCamera.cameraMatrix.mat4[10], - this._renderer._curCamera.cameraMatrix.mat4[11], - this._renderer._curCamera.cameraMatrix.mat4[12], - this._renderer._curCamera.cameraMatrix.mat4[13], - this._renderer._curCamera.cameraMatrix.mat4[14], - this._renderer._curCamera.cameraMatrix.mat4[15], - ); - // Lines along X axis - for (var q = 0; q <= numDivs; q++) { - this.beginShape(this.LINES); - this.vertex( - -halfSize + xOff, - yOff, - q * spacing - halfSize + zOff, - ); - this.vertex( - +halfSize + xOff, - yOff, - q * spacing - halfSize + zOff, - ); - this.endShape(); - } // Lines along Z axis - - for (var i = 0; i <= numDivs; i++) { - this.beginShape(this.LINES); - this.vertex( - i * spacing - halfSize + xOff, - yOff, - -halfSize + zOff, - ); - this.vertex( - i * spacing - halfSize + xOff, - yOff, - +halfSize + zOff, - ); - this.endShape(); - } - this.pop(); - }; - }; - /** - * For use with debugMode - * @private - * @method _axesIcon - * @param {Number} [size] size of axes icon lines - * @param {Number} [xOff] offset of icon from origin in X axis - * @param {Number} [yOff] offset of icon from origin in Y axis - * @param {Number} [zOff] offset of icon from origin in Z axis - */ - _main.default.prototype._axesIcon = function ( - size, - xOff, - yOff, - zOff, - ) { - if (typeof size === "undefined") { - size = this.width / 20 > 40 ? this.width / 20 : 40; - } - if (typeof xOff === "undefined") { - xOff = -this.width / 4; - } - if (typeof yOff === "undefined") { - yOff = xOff; - } - if (typeof zOff === "undefined") { - zOff = xOff; - } - return function () { - this.push(); - this._renderer.uMVMatrix.set( - this._renderer._curCamera.cameraMatrix.mat4[0], - this._renderer._curCamera.cameraMatrix.mat4[1], - this._renderer._curCamera.cameraMatrix.mat4[2], - this._renderer._curCamera.cameraMatrix.mat4[3], - this._renderer._curCamera.cameraMatrix.mat4[4], - this._renderer._curCamera.cameraMatrix.mat4[5], - this._renderer._curCamera.cameraMatrix.mat4[6], - this._renderer._curCamera.cameraMatrix.mat4[7], - this._renderer._curCamera.cameraMatrix.mat4[8], - this._renderer._curCamera.cameraMatrix.mat4[9], - this._renderer._curCamera.cameraMatrix.mat4[10], - this._renderer._curCamera.cameraMatrix.mat4[11], - this._renderer._curCamera.cameraMatrix.mat4[12], - this._renderer._curCamera.cameraMatrix.mat4[13], - this._renderer._curCamera.cameraMatrix.mat4[14], - this._renderer._curCamera.cameraMatrix.mat4[15], - ); - // X axis - this.strokeWeight(2); - this.stroke(255, 0, 0); - this.beginShape(this.LINES); - this.vertex(xOff, yOff, zOff); - this.vertex(xOff + size, yOff, zOff); - this.endShape(); - // Y axis - this.stroke(0, 255, 0); - this.beginShape(this.LINES); - this.vertex(xOff, yOff, zOff); - this.vertex(xOff, yOff + size, zOff); - this.endShape(); - // Z axis - this.stroke(0, 0, 255); - this.beginShape(this.LINES); - this.vertex(xOff, yOff, zOff); - this.vertex(xOff, yOff, zOff + size); - this.endShape(); - this.pop(); - }; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.math.hypot": 188, - "core-js/modules/es.math.sign": 190, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 344: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module 3D - * @submodule Lights - * @for p5 - * @requires core - */ - /** - * Creates an ambient light with the given color. - * - * Ambient light does not come from a specific direction. - * Objects are evenly lit from all sides. Ambient lights are - * almost always used in combination with other types of lights. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method ambientLight - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @param {Number} [alpha] alpha value relative to current - * color range (default is 0-255) - * @chainable - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe('sphere with coral color under black light'); - * } - * function draw() { - * background(100); - * ambientLight(0); // black light (no light) - * ambientMaterial(255, 127, 80); // coral material - * sphere(40); - * } - * - *
                                  - * @alt - * sphere with coral color under black light - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe('sphere with coral color under white light'); - * } - * function draw() { - * background(100); - * ambientLight(255); // white light - * ambientMaterial(255, 127, 80); // coral material - * sphere(40); - * } - * - *
                                  - * @alt - * sphere with coral color under white light - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100,100,WEBGL); - * camera(0,-100,300); - * } - * function draw() { - * background(230); - * ambientMaterial(237,34,93); //Pink Material - * ambientLight(mouseY); - * //As you move the mouse up to down it changes from no ambient light to full ambient light. - * rotateY(millis()/2000); - * box(100); - * } - * - *
                                  - * @alt - * pink ambient material cube under the ambient light - */ - /** - * @method ambientLight - * @param {Number} gray number specifying value between - * white and black - * @param {Number} [alpha] - * @chainable - */ - /** - * @method ambientLight - * @param {String} value a color string - * @chainable - */ - /** - * @method ambientLight - * @param {Number[]} values an array containing the red,green,blue & - * and alpha components of the color - * @chainable - */ - /** - * @method ambientLight - * @param {p5.Color} color color as a p5.Color - * @chainable - */ - - _main.default.prototype.ambientLight = function (v1, v2, v3, a) { - this._assert3d("ambientLight"); - _main.default._validateParameters("ambientLight", arguments); - var color = this.color.apply(this, arguments); - this._renderer.ambientLightColors.push( - color._array[0], - color._array[1], - color._array[2], - ); - this._renderer._enableLighting = true; - return this; - }; - /** - * Sets the color of the specular highlight of a non-ambient light - * (i.e. all lights except ambientLight()). - * - * specularColor() affects only the lights which are created after - * it in the code. - * - * This function is used in combination with - * specularMaterial(). - * If a geometry does not use specularMaterial(), this function - * will have no effect. - * - * The default color is white (255, 255, 255), which is used if - * specularColor() is not explicitly called. - * - * Note: specularColor is equivalent to the Processing function - * lightSpecular. - * - * @method specularColor - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @chainable - * @example - *
                                  - * - * let setRedSpecularColor = true; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe( - * 'Sphere with specular highlight. Clicking the mouse toggles the specular highlight color between red and the default white.' - * ); - * } - * - * function draw() { - * background(0); - * - * ambientLight(60); - * - * // add a point light to showcase specular color - * // -- use mouse location to position the light - * let lightPosX = mouseX - width / 2; - * let lightPosY = mouseY - height / 2; - * // -- set the light's specular color - * if (setRedSpecularColor) { - * specularColor(255, 0, 0); // red specular highlight - * } - * // -- create the light - * pointLight(200, 200, 200, lightPosX, lightPosY, 50); // white light - * - * // use specular material with high shininess - * specularMaterial(150); - * shininess(50); - * - * sphere(30, 64, 64); - * } - * - * function mouseClicked() { - * setRedSpecularColor = !setRedSpecularColor; - * } - * - *
                                  - * - * @alt - * Sphere with specular highlight. Clicking the mouse toggles the - * specular highlight color between red and the default white. - */ - /** - * @method specularColor - * @param {Number} gray number specifying value between - * white and black - * @chainable - */ - /** - * @method specularColor - * @param {String} value color as a CSS string - * @chainable - */ - /** - * @method specularColor - * @param {Number[]} values color as an array containing the - * red, green, and blue components - * @chainable - */ - /** - * @method specularColor - * @param {p5.Color} color color as a p5.Color - * @chainable - */ - _main.default.prototype.specularColor = function (v1, v2, v3) { - this._assert3d("specularColor"); - _main.default._validateParameters("specularColor", arguments); - var color = this.color.apply(this, arguments); - this._renderer.specularColors = [ - color._array[0], - color._array[1], - color._array[2], - ]; - return this; - }; - /** - * Creates a directional light with the given color and direction. - * - * Directional light comes from one direction. - * The direction is specified as numbers inclusively between -1 and 1. - * For example, setting the direction as (0, -1, 0) will cause the - * geometry to be lit from below (since the light will be facing - * directly upwards). Similarly, setting the direction as (1, 0, 0) - * will cause the geometry to be lit from the left (since the light - * will be facing directly rightwards). - * - * Directional lights do not have a specific point of origin, and - * therefore cannot be positioned closer or farther away from a geometry. - * - * A maximum of **5** directional lights can be active at once. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method directionalLight - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @param {Number} x x component of direction (inclusive range of -1 to 1) - * @param {Number} y y component of direction (inclusive range of -1 to 1) - * @param {Number} z z component of direction (inclusive range of -1 to 1) - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'scene with sphere and directional light. The direction of the light is controlled with the mouse position.' - * ); - * } - * function draw() { - * background(0); - * //move your mouse to change light direction - * let dirX = (mouseX / width - 0.5) * 2; - * let dirY = (mouseY / height - 0.5) * 2; - * directionalLight(250, 250, 250, -dirX, -dirY, -1); - * noStroke(); - * sphere(40); - * } - * - *
                                  - * - * @alt - * scene with sphere and directional light. The direction of - * the light is controlled with the mouse position. - */ - /** - * @method directionalLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} direction direction of light as a - * p5.Vector - * @chainable - */ - /** - * @method directionalLight - * @param {p5.Color|Number[]|String} color color as a p5.Color, - * as an array, or as a CSS string - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @chainable - */ - /** - * @method directionalLight - * @param {p5.Color|Number[]|String} color - * @param {p5.Vector} direction - * @chainable - */ - _main.default.prototype.directionalLight = function ( - v1, - v2, - v3, - x, - y, - z, - ) { - this._assert3d("directionalLight"); - _main.default._validateParameters("directionalLight", arguments); - //@TODO: check parameters number - var color; - if (v1 instanceof _main.default.Color) { - color = v1; - } else { - color = this.color(v1, v2, v3); - } - var _x, _y, _z; - var v = arguments[arguments.length - 1]; - if (typeof v === "number") { - _x = arguments[arguments.length - 3]; - _y = arguments[arguments.length - 2]; - _z = arguments[arguments.length - 1]; - } else { - _x = v.x; - _y = v.y; - _z = v.z; - } // normalize direction - - var l = Math.sqrt(_x * _x + _y * _y + _z * _z); - this._renderer.directionalLightDirections.push( - _x / l, - _y / l, - _z / l, - ); - this._renderer.directionalLightDiffuseColors.push( - color._array[0], - color._array[1], - color._array[2], - ); - Array.prototype.push.apply( - this._renderer.directionalLightSpecularColors, - this._renderer.specularColors, - ); - this._renderer._enableLighting = true; - return this; - }; - /** - * Creates a point light with the given color and position. - * - * A point light emits light from a single point in all directions. - * Because the light is emitted from a specific point (position), - * it has a different effect when it is positioned farther vs. nearer - * an object. - * - * A maximum of **5** point lights can be active at once. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method pointLight - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @param {Number} x x component of position - * @param {Number} y y component of position - * @param {Number} z z component of position - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'scene with sphere and point light. The position of the light is controlled with the mouse position.' - * ); - * } - * function draw() { - * background(0); - * // move your mouse to change light position - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * // to set the light position, - * // think of the world's coordinate as: - * // -width/2,-height/2 ----------- width/2,-height/2 - * // | | - * // | 0,0 | - * // | | - * // -width/2,height/2 ----------- width/2,height/2 - * pointLight(250, 250, 250, locX, locY, 50); - * noStroke(); - * sphere(40); - * } - * - *
                                  - * - * @alt - * scene with sphere and point light. The position of - * the light is controlled with the mouse position. - */ - /** - * @method pointLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position of light as a p5.Vector - * @chainable - */ - /** - * @method pointLight - * @param {p5.Color|Number[]|String} color color as a p5.Color, - * as an array, or as a CSS string - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @chainable - */ - /** - * @method pointLight - * @param {p5.Color|Number[]|String} color - * @param {p5.Vector} position - * @chainable - */ - _main.default.prototype.pointLight = function (v1, v2, v3, x, y, z) { - this._assert3d("pointLight"); - _main.default._validateParameters("pointLight", arguments); - //@TODO: check parameters number - var color; - if (v1 instanceof _main.default.Color) { - color = v1; - } else { - color = this.color(v1, v2, v3); - } - var _x, _y, _z; - var v = arguments[arguments.length - 1]; - if (typeof v === "number") { - _x = arguments[arguments.length - 3]; - _y = arguments[arguments.length - 2]; - _z = arguments[arguments.length - 1]; - } else { - _x = v.x; - _y = v.y; - _z = v.z; - } - this._renderer.pointLightPositions.push(_x, _y, _z); - this._renderer.pointLightDiffuseColors.push( - color._array[0], - color._array[1], - color._array[2], - ); - Array.prototype.push.apply( - this._renderer.pointLightSpecularColors, - this._renderer.specularColors, - ); - this._renderer._enableLighting = true; - return this; - }; - /** - * Creates an image light with the given image. - * - * The image light simulates light from all the directions. - * This is done by using the image as a texture for an infinitely - * large sphere light. This sphere contains - * or encapsulates the whole scene/drawing. - * It will have different effect for varying shininess of the - * object in the drawing. - * Under the hood it is mainly doing 2 types of calculations, - * the first one is creating an irradiance map the - * environment map of the input image. - * The second one is managing reflections based on the shininess - * or roughness of the material used in the scene. - * - * Note: The image's diffuse light will be affected by fill() - * and the specular reflections will be affected by specularMaterial() - * and shininess(). - * - * @method imageLight - * @param {p5.image} img image for the background - * @example - *
                                  - * - * let img; - * function preload() { - * img = loadImage('assets/outdoor_image.jpg'); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * function draw() { - * background(220); - * imageMode(CENTER); - * push(); - * translate(0, 0, -200); - * scale(2); - * image(img, 0, 0, width, height); - * pop(); - * ambientLight(50); - * imageLight(img); - * specularMaterial(20); - * noStroke(); - * scale(2); - * rotateX(frameCount * 0.005); - * rotateY(frameCount * 0.005); - * box(25); - * } - * - *
                                  - * @alt - * image light example - * @example - *
                                  - * - * let img; - * let slider; - * function preload() { - * img = loadImage('assets/outdoor_spheremap.jpg'); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * slider = createSlider(0, 400, 100, 1); - * slider.position(0, height); - * } - * function draw() { - * background(220); - * imageMode(CENTER); - * push(); - * translate(0, 0, -200); - * scale(2); - * image(img, 0, 0, width, height); - * pop(); - * ambientLight(50); - * imageLight(img); - * specularMaterial(20); - * shininess(slider.value()); - * noStroke(); - * scale(2); - * sphere(15); - * } - * - *
                                  - * @alt - * light with slider having a slider for varying roughness - */ - _main.default.prototype.imageLight = function (img) { - // activeImageLight property is checked by _setFillUniforms - // for sending uniforms to the fillshader - this._renderer.activeImageLight = img; - this._renderer._enableLighting = true; - }; - /** - * Places an ambient and directional light in the scene. - * The lights are set to ambientLight(128, 128, 128) and - * directionalLight(128, 128, 128, 0, 0, -1). - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method lights - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('the light is partially ambient and partially directional'); - * } - * function draw() { - * background(0); - * lights(); - * rotateX(millis() / 1000); - * rotateY(millis() / 1000); - * rotateZ(millis() / 1000); - * box(); - * } - * - *
                                  - * - * @alt - * the light is partially ambient and partially directional - */ - _main.default.prototype.lights = function () { - this._assert3d("lights"); - // Both specify gray by default. - var grayColor = this.color("rgb(128,128,128)"); - this.ambientLight(grayColor); - this.directionalLight(grayColor, 0, 0, -1); - return this; - }; - /** - * Sets the falloff rate for pointLight() - * and spotLight(). - * - * lightFalloff() affects only the lights which are created after it - * in the code. - * - * The `constant`, `linear`, an `quadratic` parameters are used to calculate falloff as follows: - * - * d = distance from light position to vertex position - * - * falloff = 1 / (CONSTANT + d \* LINEAR + (d \* d) \* QUADRATIC) - * - * @method lightFalloff - * @param {Number} constant CONSTANT value for determining falloff - * @param {Number} linear LINEAR value for determining falloff - * @param {Number} quadratic QUADRATIC value for determining falloff - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe( - * 'Two spheres with different falloff values show different intensity of light' - * ); - * } - * function draw() { - * ortho(); - * background(0); - * - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * locX /= 2; // half scale - * - * lightFalloff(1, 0, 0); - * push(); - * translate(-25, 0, 0); - * pointLight(250, 250, 250, locX - 25, locY, 50); - * sphere(20); - * pop(); - * - * lightFalloff(0.97, 0.03, 0); - * push(); - * translate(25, 0, 0); - * pointLight(250, 250, 250, locX + 25, locY, 50); - * sphere(20); - * pop(); - * } - * - *
                                  - * - * @alt - * Two spheres with different falloff values show different intensity of light - */ - _main.default.prototype.lightFalloff = function ( - constantAttenuation, - linearAttenuation, - quadraticAttenuation, - ) { - this._assert3d("lightFalloff"); - _main.default._validateParameters("lightFalloff", arguments); - if (constantAttenuation < 0) { - constantAttenuation = 0; - console.warn( - "Value of constant argument in lightFalloff() should be never be negative. Set to 0.", - ); - } - if (linearAttenuation < 0) { - linearAttenuation = 0; - console.warn( - "Value of linear argument in lightFalloff() should be never be negative. Set to 0.", - ); - } - if (quadraticAttenuation < 0) { - quadraticAttenuation = 0; - console.warn( - "Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.", - ); - } - if ( - constantAttenuation === 0 && - linearAttenuation === 0 && - quadraticAttenuation === 0 - ) { - constantAttenuation = 1; - console.warn( - "Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.", - ); - } - this._renderer.constantAttenuation = constantAttenuation; - this._renderer.linearAttenuation = linearAttenuation; - this._renderer.quadraticAttenuation = quadraticAttenuation; - return this; - }; - /** - * Creates a spot light with the given color, position, - * light direction, angle, and concentration. - * - * Like a pointLight(), a spotLight() - * emits light from a specific point (position). It has a different effect - * when it is positioned farther vs. nearer an object. - * - * However, unlike a pointLight(), the light is emitted in **one direction** - * along a conical shape. The shape of the cone can be controlled using - * the `angle` and `concentration` parameters. - * - * The `angle` parameter is used to - * determine the radius of the cone. And the `concentration` - * parameter is used to focus the light towards the center of - * the cone. Both parameters are optional, however if you want - * to specify `concentration`, you must also specify `angle`. - * The minimum concentration value is 1. - * - * A maximum of **5** spot lights can be active at once. - * - * Note: lights need to be called (whether directly or indirectly) - * within draw() to remain persistent in a looping program. - * Placing them in setup() will cause them to only have an effect - * the first time through the loop. - * - * @method spotLight - * @param {Number} v1 red or hue value relative to the current color range - * @param {Number} v2 green or saturation value relative to the current color range - * @param {Number} v3 blue or brightness value relative to the current color range - * @param {Number} x x component of position - * @param {Number} y y component of position - * @param {Number} z z component of position - * @param {Number} rx x component of light direction (inclusive range of -1 to 1) - * @param {Number} ry y component of light direction (inclusive range of -1 to 1) - * @param {Number} rz z component of light direction (inclusive range of -1 to 1) - * @param {Number} [angle] angle of cone. Defaults to PI/3 - * @param {Number} [concentration] concentration of cone. Defaults to 100 - * @chainable - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'scene with sphere and spot light. The position of the light is controlled with the mouse position.' - * ); - * } - * function draw() { - * background(0); - * // move your mouse to change light position - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * // to set the light position, - * // think of the world's coordinate as: - * // -width/2,-height/2 ----------- width/2,-height/2 - * // | | - * // | 0,0 | - * // | | - * // -width/2,height/2 ----------- width/2,height/2 - * ambientLight(50); - * spotLight(0, 250, 0, locX, locY, 100, 0, 0, -1, Math.PI / 16); - * noStroke(); - * sphere(40); - * } - * - *
                                  - * - * @alt - * scene with sphere and spot light. The position of - * the light is controlled with the mouse position. - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color color as a p5.Color, - * as an array, or as a CSS string - * @param {p5.Vector} position position of light as a p5.Vector - * @param {p5.Vector} direction direction of light as a p5.Vector - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position - * @param {p5.Vector} direction - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {p5.Vector} direction - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color - * @param {p5.Vector} position - * @param {Number} rx - * @param {Number} ry - * @param {Number} rz - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {p5.Vector} direction - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {Number} v1 - * @param {Number} v2 - * @param {Number} v3 - * @param {p5.Vector} position - * @param {Number} rx - * @param {Number} ry - * @param {Number} rz - * @param {Number} [angle] - * @param {Number} [concentration] - */ - /** - * @method spotLight - * @param {p5.Color|Number[]|String} color - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {Number} rx - * @param {Number} ry - * @param {Number} rz - * @param {Number} [angle] - * @param {Number} [concentration] - */ - _main.default.prototype.spotLight = function ( - v1, - v2, - v3, - x, - y, - z, - nx, - ny, - nz, - angle, - concentration, - ) { - this._assert3d("spotLight"); - _main.default._validateParameters("spotLight", arguments); - var color, position, direction; - var length = arguments.length; - switch (length) { - case 11: - case 10: - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = new _main.default.Vector(nx, ny, nz); - break; - case 9: - if (v1 instanceof _main.default.Color) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = new _main.default.Vector(y, z, nx); - angle = ny; - concentration = nz; - } else if (x instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = new _main.default.Vector(y, z, nx); - angle = ny; - concentration = nz; - } else if (nx instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = nx; - angle = ny; - concentration = nz; - } else { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = new _main.default.Vector(nx, ny, nz); - } - break; - case 8: - if (v1 instanceof _main.default.Color) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = new _main.default.Vector(y, z, nx); - angle = ny; - } else if (x instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = new _main.default.Vector(y, z, nx); - angle = ny; - } else { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = nx; - angle = ny; - } - break; - case 7: - if ( - v1 instanceof _main.default.Color && - v2 instanceof _main.default.Vector - ) { - color = v1; - position = v2; - direction = new _main.default.Vector(v3, x, y); - angle = z; - concentration = nx; - } else if ( - v1 instanceof _main.default.Color && - y instanceof _main.default.Vector - ) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = y; - angle = z; - concentration = nx; - } else if ( - x instanceof _main.default.Vector && - y instanceof _main.default.Vector - ) { - color = this.color(v1, v2, v3); - position = x; - direction = y; - angle = z; - concentration = nx; - } else if (v1 instanceof _main.default.Color) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = new _main.default.Vector(y, z, nx); - } else if (x instanceof _main.default.Vector) { - color = this.color(v1, v2, v3); - position = x; - direction = new _main.default.Vector(y, z, nx); - } else { - color = this.color(v1, v2, v3); - position = new _main.default.Vector(x, y, z); - direction = nx; - } - break; - case 6: - if ( - x instanceof _main.default.Vector && - y instanceof _main.default.Vector - ) { - color = this.color(v1, v2, v3); - position = x; - direction = y; - angle = z; - } else if ( - v1 instanceof _main.default.Color && - y instanceof _main.default.Vector - ) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = y; - angle = z; - } else if ( - v1 instanceof _main.default.Color && - v2 instanceof _main.default.Vector - ) { - color = v1; - position = v2; - direction = new _main.default.Vector(v3, x, y); - angle = z; - } - break; - case 5: - if ( - v1 instanceof _main.default.Color && - v2 instanceof _main.default.Vector && - v3 instanceof _main.default.Vector - ) { - color = v1; - position = v2; - direction = v3; - angle = x; - concentration = y; - } else if ( - x instanceof _main.default.Vector && - y instanceof _main.default.Vector - ) { - color = this.color(v1, v2, v3); - position = x; - direction = y; - } else if ( - v1 instanceof _main.default.Color && - y instanceof _main.default.Vector - ) { - color = v1; - position = new _main.default.Vector(v2, v3, x); - direction = y; - } else if ( - v1 instanceof _main.default.Color && - v2 instanceof _main.default.Vector - ) { - color = v1; - position = v2; - direction = new _main.default.Vector(v3, x, y); - } - break; - case 4: - color = v1; - position = v2; - direction = v3; - angle = x; - break; - case 3: - color = v1; - position = v2; - direction = v3; - break; - default: - console.warn( - "Sorry, input for spotlight() is not in prescribed format. Too ".concat( - length < 3 ? "few" : "many", - " arguments were provided", - ), - ); - return this; - } - this._renderer.spotLightDiffuseColors.push( - color._array[0], - color._array[1], - color._array[2], - ); - Array.prototype.push.apply( - this._renderer.spotLightSpecularColors, - this._renderer.specularColors, - ); - this._renderer.spotLightPositions.push( - position.x, - position.y, - position.z, - ); - direction.normalize(); - this._renderer.spotLightDirections.push( - direction.x, - direction.y, - direction.z, - ); - if (angle === undefined) { - angle = Math.PI / 3; - } - if (concentration !== undefined && concentration < 1) { - concentration = 1; - console.warn( - "Value of concentration needs to be greater than 1. Setting it to 1", - ); - } else if (concentration === undefined) { - concentration = 100; - } - angle = this._renderer._pInst._toRadians(angle); - this._renderer.spotLightAngle.push(Math.cos(angle)); - this._renderer.spotLightConc.push(concentration); - this._renderer._enableLighting = true; - return this; - }; - /** - * Removes all lights present in a sketch. - * - * All subsequent geometry is rendered without lighting (until a new - * light is created with a call to one of the lighting functions - * (lights(), - * ambientLight(), - * directionalLight(), - * pointLight(), - * spotLight()). - * - * @method noLights - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe( - * 'Three white spheres. Each appears as a different color due to lighting.' - * ); - * } - * function draw() { - * background(200); - * noStroke(); - * - * ambientLight(255, 0, 0); - * translate(-30, 0, 0); - * ambientMaterial(255); - * sphere(13); - * - * noLights(); - * translate(30, 0, 0); - * ambientMaterial(255); - * sphere(13); - * - * ambientLight(0, 255, 0); - * translate(30, 0, 0); - * ambientMaterial(255); - * sphere(13); - * } - * - *
                                  - * - * @alt - * Three white spheres. Each appears as a different - * color due to lighting. - */ - _main.default.prototype.noLights = function () { - this._assert3d("noLights"); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("noLights", args); - this._renderer._enableLighting = false; - this._renderer.ambientLightColors.length = 0; - this._renderer.specularColors = [1, 1, 1]; - this._renderer.directionalLightDirections.length = 0; - this._renderer.directionalLightDiffuseColors.length = 0; - this._renderer.directionalLightSpecularColors.length = 0; - this._renderer.pointLightPositions.length = 0; - this._renderer.pointLightDiffuseColors.length = 0; - this._renderer.pointLightSpecularColors.length = 0; - this._renderer.spotLightPositions.length = 0; - this._renderer.spotLightDirections.length = 0; - this._renderer.spotLightDiffuseColors.length = 0; - this._renderer.spotLightSpecularColors.length = 0; - this._renderer.spotLightAngle.length = 0; - this._renderer.spotLightConc.length = 0; - this._renderer.constantAttenuation = 1; - this._renderer.linearAttenuation = 0; - this._renderer.quadraticAttenuation = 0; - this._renderer._useShininess = 1; - return this; - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - }, - ], - 345: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.splice"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.match"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.trim"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - _dereq_("./p5.Geometry"); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module Shape - * @submodule 3D Models - * @for p5 - * @requires core - * @requires p5.Geometry - */ - /** - * Load a 3d model from an OBJ or STL file. - * - * loadModel() should be placed inside of preload(). - * This allows the model to load fully before the rest of your code is run. - * - * One of the limitations of the OBJ and STL format is that it doesn't have a built-in - * sense of scale. This means that models exported from different programs might - * be very different sizes. If your model isn't displaying, try calling - * loadModel() with the normalized parameter set to true. This will resize the - * model to a scale appropriate for p5. You can also make additional changes to - * the final size of your model with the scale() function. - * - * Also, the support for colored STL files is not present. STL files with color will be - * rendered without color properties. - * - * @method loadModel - * @param {String} path Path of the model to be loaded - * @param {Boolean} normalize If true, scale the model to a - * standardized size when loading - * @param {function(p5.Geometry)} [successCallback] Function to be called - * once the model is loaded. Will be passed - * the 3D model object. - * @param {function(Event)} [failureCallback] called with event error if - * the model fails to load. - * @param {String} [fileType] The file extension of the model - * (.stl, .obj). - * @return {p5.Geometry} the p5.Geometry object - * - * @example - *
                                  - * - * //draw a spinning octahedron - * let octahedron; - * - * function preload() { - * octahedron = loadModel('assets/octahedron.obj'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Vertically rotating 3-d octahedron.'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * model(octahedron); - * } - * - *
                                  - * - * @alt - * Vertically rotating 3-d octahedron. - * - * @example - *
                                  - * - * //draw a spinning teapot - * let teapot; - * - * function preload() { - * // Load model with normalise parameter set to true - * teapot = loadModel('assets/teapot.obj', true); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Vertically rotating 3-d teapot with red, green and blue gradient.'); - * } - * - * function draw() { - * background(200); - * scale(0.4); // Scaled to make model fit into canvas - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * normalMaterial(); // For effect - * model(teapot); - * } - * - *
                                  - * - * @alt - * Vertically rotating 3-d teapot with red, green and blue gradient. - */ - /** - * @method loadModel - * @param {String} path - * @param {function(p5.Geometry)} [successCallback] - * @param {function(Event)} [failureCallback] - * @param {String} [fileType] - * @return {p5.Geometry} the p5.Geometry object - */ - - _main.default.prototype.loadModel = function (path) { - _main.default._validateParameters("loadModel", arguments); - var normalize; - var successCallback; - var failureCallback; - var fileType = path.slice(-4); - if (typeof arguments[1] === "boolean") { - normalize = arguments[1]; - successCallback = arguments[2]; - failureCallback = arguments[3]; - if (typeof arguments[4] !== "undefined") { - fileType = arguments[4]; - } - } else { - normalize = false; - successCallback = arguments[1]; - failureCallback = arguments[2]; - if (typeof arguments[3] !== "undefined") { - fileType = arguments[3]; - } - } - var model = new _main.default.Geometry(); - model.gid = "".concat(path, "|").concat(normalize); - var self = this; - if (fileType.match(/\.stl$/i)) { - this.httpDo( - path, - "GET", - "arrayBuffer", - function (arrayBuffer) { - parseSTL(model, arrayBuffer); - if (normalize) { - model.normalize(); - } - self._decrementPreload(); - if (typeof successCallback === "function") { - successCallback(model); - } - }, - failureCallback, - ); - } else if (fileType.match(/\.obj$/i)) { - this.loadStrings( - path, - function (strings) { - parseObj(model, strings); - if (normalize) { - model.normalize(); - } - self._decrementPreload(); - if (typeof successCallback === "function") { - successCallback(model); - } - }, - failureCallback, - ); - } else { - _main.default._friendlyFileLoadError(3, path); - if (failureCallback) { - failureCallback(); - } else { - _main.default._friendlyError( - "Sorry, the file type is invalid. Only OBJ and STL files are supported.", - ); - } - } - return model; - }; - /** - * Parse OBJ lines into model. For reference, this is what a simple model of a - * square might look like: - * - * v -0.5 -0.5 0.5 - * v -0.5 -0.5 -0.5 - * v -0.5 0.5 -0.5 - * v -0.5 0.5 0.5 - * - * f 4 3 2 1 - */ - function parseObj(model, lines) { - // OBJ allows a face to specify an index for a vertex (in the above example), - // but it also allows you to specify a custom combination of vertex, UV - // coordinate, and vertex normal. So, "3/4/3" would mean, "use vertex 3 with - // UV coordinate 4 and vertex normal 3". In WebGL, every vertex with different - // parameters must be a different vertex, so loadedVerts is used to - // temporarily store the parsed vertices, normals, etc., and indexedVerts is - // used to map a specific combination (keyed on, for example, the string - // "3/4/3"), to the actual index of the newly created vertex in the final - // object. - var loadedVerts = { - v: [], - vt: [], - vn: [], - }; - var indexedVerts = {}; - for (var line = 0; line < lines.length; ++line) { - // Each line is a separate object (vertex, face, vertex normal, etc) - // For each line, split it into tokens on whitespace. The first token - // describes the type. - var tokens = lines[line].trim().split(/\b\s+/); - if (tokens.length > 0) { - if (tokens[0] === "v" || tokens[0] === "vn") { - // Check if this line describes a vertex or vertex normal. - // It will have three numeric parameters. - var vertex = new _main.default.Vector( - parseFloat(tokens[1]), - parseFloat(tokens[2]), - parseFloat(tokens[3]), - ); - loadedVerts[tokens[0]].push(vertex); - } else if (tokens[0] === "vt") { - // Check if this line describes a texture coordinate. - // It will have two numeric parameters U and V (W is omitted). - // Because of WebGL texture coordinates rendering behaviour, the V - // coordinate is inversed. - var texVertex = [ - parseFloat(tokens[1]), - 1 - parseFloat(tokens[2]), - ]; - loadedVerts[tokens[0]].push(texVertex); - } else if (tokens[0] === "f") { - // Check if this line describes a face. - // OBJ faces can have more than three points. Triangulate points. - for (var tri = 3; tri < tokens.length; ++tri) { - var face = []; - var vertexTokens = [1, tri - 1, tri]; - for ( - var tokenInd = 0; - tokenInd < vertexTokens.length; - ++tokenInd - ) { - // Now, convert the given token into an index - var vertString = tokens[vertexTokens[tokenInd]]; - var vertIndex = 0; - // TODO: Faces can technically use negative numbers to refer to the - // previous nth vertex. I haven't seen this used in practice, but - // it might be good to implement this in the future. - if (indexedVerts[vertString] !== undefined) { - vertIndex = indexedVerts[vertString]; - } else { - var vertParts = vertString.split("/"); - for (var i = 0; i < vertParts.length; i++) { - vertParts[i] = parseInt(vertParts[i]) - 1; - } - vertIndex = indexedVerts[vertString] = - model.vertices.length; - model.vertices.push(loadedVerts.v[vertParts[0]].copy()); - if (loadedVerts.vt[vertParts[1]]) { - model.uvs.push(loadedVerts.vt[vertParts[1]].slice()); - } else { - model.uvs.push([0, 0]); - } - if (loadedVerts.vn[vertParts[2]]) { - model.vertexNormals.push( - loadedVerts.vn[vertParts[2]].copy(), - ); - } - } - face.push(vertIndex); - } - if ( - face[0] !== face[1] && - face[0] !== face[2] && - face[1] !== face[2] - ) { - model.faces.push(face); - } - } - } - } - } // If the model doesn't have normals, compute the normals - - if (model.vertexNormals.length === 0) { - model.computeNormals(); - } - return model; - } /** - * STL files can be of two types, ASCII and Binary, - * - * We need to convert the arrayBuffer to an array of strings, - * to parse it as an ASCII file. - */ - - function parseSTL(model, buffer) { - if (isBinary(buffer)) { - parseBinarySTL(model, buffer); - } else { - var reader = new DataView(buffer); - if (!("TextDecoder" in window)) { - console.warn( - "Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)", - ); - return model; - } - var decoder = new TextDecoder("utf-8"); - var lines = decoder.decode(reader); - var lineArray = lines.split("\n"); - parseASCIISTL(model, lineArray); - } - return model; - } /** - * This function checks if the file is in ASCII format or in Binary format - * - * It is done by searching keyword `solid` at the start of the file. - * - * An ASCII STL data must begin with `solid` as the first six bytes. - * However, ASCII STLs lacking the SPACE after the `d` are known to be - * plentiful. So, check the first 5 bytes for `solid`. - * - * Several encodings, such as UTF-8, precede the text with up to 5 bytes: - * https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding - * Search for `solid` to start anywhere after those prefixes. - */ - - function isBinary(data) { - var reader = new DataView(data); - // US-ASCII ordinal values for `s`, `o`, `l`, `i`, `d` - var solid = [115, 111, 108, 105, 100]; - for (var off = 0; off < 5; off++) { - // If "solid" text is matched to the current offset, declare it to be an ASCII STL. - if (matchDataViewAt(solid, reader, off)) return false; - } // Couldn't find "solid" text at the beginning; it is binary STL. - - return true; - } /** - * This function matches the `query` at the provided `offset` - */ - - function matchDataViewAt(query, reader, offset) { - // Check if each byte in query matches the corresponding byte from the current offset - for (var i = 0, il = query.length; i < il; i++) { - if (query[i] !== reader.getUint8(offset + i, false)) return false; - } - return true; - } /** - * This function parses the Binary STL files. - * https://en.wikipedia.org/wiki/STL_%28file_format%29#Binary_STL - * - * Currently there is no support for the colors provided in STL files. - */ - - function parseBinarySTL(model, buffer) { - var reader = new DataView(buffer); - // Number of faces is present following the header - var faces = reader.getUint32(80, true); - var r, - g, - b, - hasColors = false, - colors; - var defaultR, defaultG, defaultB; - // Binary files contain 80-byte header, which is generally ignored. - for (var index = 0; index < 80 - 10; index++) { - // Check for `COLOR=` - if ( - reader.getUint32(index, false) === 1129270351 /*COLO*/ && - reader.getUint8(index + 4) === 82 /*'R'*/ && - reader.getUint8(index + 5) === 61 /*'='*/ - ) { - hasColors = true; - colors = []; - defaultR = reader.getUint8(index + 6) / 255; - defaultG = reader.getUint8(index + 7) / 255; - defaultB = reader.getUint8(index + 8) / 255; - // To be used when color support is added - // alpha = reader.getUint8(index + 9) / 255; - } - } - var dataOffset = 84; - var faceLength = 12 * 4 + 2; - // Iterate the faces - for (var face = 0; face < faces; face++) { - var start = dataOffset + face * faceLength; - var normalX = reader.getFloat32(start, true); - var normalY = reader.getFloat32(start + 4, true); - var normalZ = reader.getFloat32(start + 8, true); - if (hasColors) { - var packedColor = reader.getUint16(start + 48, true); - if ((packedColor & 32768) === 0) { - // facet has its own unique color - r = (packedColor & 31) / 31; - g = ((packedColor >> 5) & 31) / 31; - b = ((packedColor >> 10) & 31) / 31; - } else { - r = defaultR; - g = defaultG; - b = defaultB; - } - } - var newNormal = new _main.default.Vector( - normalX, - normalY, - normalZ, - ); - for (var i = 1; i <= 3; i++) { - var vertexstart = start + i * 12; - var newVertex = new _main.default.Vector( - reader.getFloat32(vertexstart, true), - reader.getFloat32(vertexstart + 4, true), - reader.getFloat32(vertexstart + 8, true), - ); - model.vertices.push(newVertex); - model.vertexNormals.push(newNormal); - if (hasColors) { - colors.push(r, g, b); - } - } - model.faces.push([3 * face, 3 * face + 1, 3 * face + 2]); - model.uvs.push([0, 0], [0, 0], [0, 0]); - } - if (hasColors) { - // add support for colors here. - } - return model; - } /** - * ASCII STL file starts with `solid 'nameOfFile'` - * Then contain the normal of the face, starting with `facet normal` - * Next contain a keyword indicating the start of face vertex, `outer loop` - * Next comes the three vertex, starting with `vertex x y z` - * Vertices ends with `endloop` - * Face ends with `endfacet` - * Next face starts with `facet normal` - * The end of the file is indicated by `endsolid` - */ - - function parseASCIISTL(model, lines) { - var state = ""; - var curVertexIndex = []; - var newNormal, newVertex; - for (var iterator = 0; iterator < lines.length; ++iterator) { - var line = lines[iterator].trim(); - var parts = line.split(" "); - for ( - var partsiterator = 0; - partsiterator < parts.length; - ++partsiterator - ) { - if (parts[partsiterator] === "") { - // Ignoring multiple whitespaces - parts.splice(partsiterator, 1); - } - } - if (parts.length === 0) { - // Remove newline - continue; - } - switch (state) { - case "": - // First run - if (parts[0] !== "solid") { - // Invalid state - console.error(line); - console.error( - 'Invalid state "'.concat( - parts[0], - '", should be "solid"', - ), - ); - return; - } else { - state = "solid"; - } - break; - case "solid": - // First face - if (parts[0] !== "facet" || parts[1] !== "normal") { - // Invalid state - console.error(line); - console.error( - 'Invalid state "'.concat( - parts[0], - '", should be "facet normal"', - ), - ); - return; - } else { - // Push normal for first face - newNormal = new _main.default.Vector( - parseFloat(parts[2]), - parseFloat(parts[3]), - parseFloat(parts[4]), - ); - model.vertexNormals.push(newNormal, newNormal, newNormal); - state = "facet normal"; - } - break; - case "facet normal": - // After normal is defined - if (parts[0] !== "outer" || parts[1] !== "loop") { - // Invalid State - console.error(line); - console.error( - 'Invalid state "'.concat( - parts[0], - '", should be "outer loop"', - ), - ); - return; - } else { - // Next should be vertices - state = "vertex"; - } - break; - case "vertex": - if (parts[0] === "vertex") { - //Vertex of triangle - newVertex = new _main.default.Vector( - parseFloat(parts[1]), - parseFloat(parts[2]), - parseFloat(parts[3]), - ); - model.vertices.push(newVertex); - model.uvs.push([0, 0]); - curVertexIndex.push(model.vertices.indexOf(newVertex)); - } else if (parts[0] === "endloop") { - // End of vertices - model.faces.push(curVertexIndex); - curVertexIndex = []; - state = "endloop"; - } else { - // Invalid State - console.error(line); - console.error( - 'Invalid state "'.concat( - parts[0], - '", should be "vertex" or "endloop"', - ), - ); - return; - } - break; - case "endloop": - if (parts[0] !== "endfacet") { - // End of face - console.error(line); - console.error( - 'Invalid state "'.concat( - parts[0], - '", should be "endfacet"', - ), - ); - return; - } else { - state = "endfacet"; - } - break; - case "endfacet": - if (parts[0] === "endsolid") { - // End of solid - } else if (parts[0] === "facet" && parts[1] === "normal") { - // Next face - newNormal = new _main.default.Vector( - parseFloat(parts[2]), - parseFloat(parts[3]), - parseFloat(parts[4]), - ); - model.vertexNormals.push(newNormal, newNormal, newNormal); - state = "facet normal"; - } else { - // Invalid State - console.error(line); - console.error( - 'Invalid state "'.concat( - parts[0], - '", should be "endsolid" or "facet normal"', - ), - ); - return; - } - break; - default: - console.error('Invalid state "'.concat(state, '"')); - break; - } - } - return model; - } /** - * Render a 3d model to the screen. - * - * @method model - * @param {p5.Geometry} model Loaded 3d model to be rendered - * @example - *
                                  - * - * //draw a spinning octahedron - * let octahedron; - * - * function preload() { - * octahedron = loadModel('assets/octahedron.obj'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Vertically rotating 3-d octahedron.'); - * } - * - * function draw() { - * background(200); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * model(octahedron); - * } - * - *
                                  - * - * @alt - * Vertically rotating 3-d octahedron. - */ - - _main.default.prototype.model = function (model) { - this._assert3d("model"); - _main.default._validateParameters("model", arguments); - if (model.vertices.length > 0) { - if (!this._renderer.geometryInHash(model.gid)) { - if (model.edges.length === 0) { - model._makeTriangleEdges(); - } - model._edgesToVertices(); - this._renderer.createBuffers(model.gid, model); - } - this._renderer.drawBuffers(model.gid); - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/main": 298, - "./p5.Geometry": 350, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.splice": 185, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.match": 211, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.trim": 219, - }, - ], - 346: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.join"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - _dereq_("./p5.Texture"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } /** - * @module 3D - * @submodule Material - * @for p5 - * @requires core - */ - /** - * Creates a new p5.Shader object - * from the provided vertex and fragment shader files. - * - * The shader files are loaded asynchronously in the - * background, so this method should be used in preload(). - * - * Shaders can alter the positioning of shapes drawn with them. - * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. - * - * Note, shaders can only be used in WEBGL mode. - * - * @method loadShader - * @param {String} vertFilename path to file containing vertex shader - * source code - * @param {String} fragFilename path to file containing fragment shader - * source code - * @param {function} [callback] callback to be executed after loadShader - * completes. On success, the p5.Shader object is passed as the first argument. - * @param {function} [errorCallback] callback to be executed when an error - * occurs inside loadShader. On error, the error is passed as the first - * argument. - * @return {p5.Shader} a shader object created from the provided - * vertex and fragment shader files. - * - * @example - *
                                  - * - * let mandel; - * function preload() { - * // load the shader definitions from files - * mandel = loadShader('assets/shader.vert', 'assets/shader.frag'); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * // use the shader - * shader(mandel); - * noStroke(); - * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); - * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); - * } - * - * function draw() { - * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); - * quad(-1, -1, 1, -1, 1, 1, -1, 1); - * } - * - *
                                  - * - * @alt - * zooming Mandelbrot set. a colorful, infinitely detailed fractal. - */ - - _main.default.prototype.loadShader = function ( - vertFilename, - fragFilename, - callback, - errorCallback, - ) { - _main.default._validateParameters("loadShader", arguments); - if (!errorCallback) { - errorCallback = console.error; - } - var loadedShader = new _main.default.Shader(); - var self = this; - var loadedFrag = false; - var loadedVert = false; - var onLoad = function onLoad() { - self._decrementPreload(); - if (callback) { - callback(loadedShader); - } - }; - this.loadStrings( - vertFilename, - function (result) { - loadedShader._vertSrc = result.join("\n"); - loadedVert = true; - if (loadedFrag) { - onLoad(); - } - }, - errorCallback, - ); - this.loadStrings( - fragFilename, - function (result) { - loadedShader._fragSrc = result.join("\n"); - loadedFrag = true; - if (loadedVert) { - onLoad(); - } - }, - errorCallback, - ); - return loadedShader; - }; - /** - * Creates a new p5.Shader object - * from the provided vertex and fragment shader code. - * - * Note, shaders can only be used in WEBGL mode. - * - * Shaders can alter the positioning of shapes drawn with them. - * To ensure consistency in rendering, it's recommended to use the vertex shader shown in the example below. - * - * @method createShader - * @param {String} vertSrc source code for the vertex shader - * @param {String} fragSrc source code for the fragment shader - * @returns {p5.Shader} a shader object created from the provided - * vertex and fragment shaders. - * - * @example - *
                                  - * - * - * // the vertex shader is called for each vertex - * let vs = ` - * precision highp float; - * uniform mat4 uModelViewMatrix; - * uniform mat4 uProjectionMatrix; - * - * attribute vec3 aPosition; - * attribute vec2 aTexCoord; - * varying vec2 vTexCoord; - * - * void main() { - * vTexCoord = aTexCoord; - * vec4 positionVec4 = vec4(aPosition, 1.0); - * gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; - * } - * `; - * - * - * // the fragment shader is called for each pixel - * let fs = ` - * precision highp float; - * uniform vec2 p; - * uniform float r; - * const int I = 500; - * varying vec2 vTexCoord; - * void main() { - * vec2 c = p + gl_FragCoord.xy * r, z = c; - * float n = 0.0; - * for (int i = I; i > 0; i --) { - * if(z.x*z.x+z.y*z.y > 4.0) { - * n = float(i)/float(I); - * break; - * } - * z = vec2(z.x*z.x-z.y*z.y, 2.0*z.x*z.y) + c; - * } - * gl_FragColor = vec4(0.5-cos(n*17.0)/2.0,0.5-cos(n*13.0)/2.0,0.5-cos(n*23.0)/2.0,1.0); - * }`; - * - * let mandel; - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * // create and initialize the shader - * mandel = createShader(vs, fs); - * shader(mandel); - * noStroke(); - * - * // 'p' is the center point of the Mandelbrot image - * mandel.setUniform('p', [-0.74364388703, 0.13182590421]); - * describe('zooming Mandelbrot set. a colorful, infinitely detailed fractal.'); - * } - * - * function draw() { - * // 'r' is the size of the image in Mandelbrot-space - * mandel.setUniform('r', 1.5 * exp(-6.5 * (1 + sin(millis() / 2000)))); - * plane(width, height); - * } - * - *
                                  - * - * @alt - * zooming Mandelbrot set. a colorful, infinitely detailed fractal. - */ - _main.default.prototype.createShader = function (vertSrc, fragSrc) { - _main.default._validateParameters("createShader", arguments); - return new _main.default.Shader(this._renderer, vertSrc, fragSrc); - }; - /** - * Creates a new p5.Shader using only a fragment shader, as a convenience method for creating image effects. - * It's like createShader() but with a default vertex shader included. - * - * createFilterShader() is intended to be used along with filter() for filtering the contents of a canvas. - * A filter shader will not be applied to any geometries. - * - * The fragment shader receives some uniforms: - * - `sampler2D tex0`, which contains the canvas contents as a texture - * - `vec2 canvasSize`, which is the p5 width and height of the canvas (not including pixel density) - * - `vec2 texelSize`, which is the size of a physical pixel including pixel density (`1.0/(width*density)`, `1.0/(height*density)`) - * - * For more info about filters and shaders, see Adam Ferriss' repo of shader examples - * or the introduction to shaders page. - * - * @method createFilterShader - * @param {String} fragSrc source code for the fragment shader - * @returns {p5.Shader} a shader object created from the provided - * fragment shader. - * @example - *
                                  - * - * function setup() { - * let fragSrc = `precision highp float; - * void main() { - * gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); - * }`; - * - * createCanvas(100, 100, WEBGL); - * let s = createFilterShader(fragSrc); - * filter(s); - * describe('a yellow canvas'); - * } - * - *
                                  - * - *
                                  - * - * let img, s; - * function preload() { - * img = loadImage('assets/bricks.jpg'); - * } - * function setup() { - * let fragSrc = `precision highp float; - * - * // x,y coordinates, given from the vertex shader - * varying vec2 vTexCoord; - * - * // the canvas contents, given from filter() - * uniform sampler2D tex0; - * // other useful information from the canvas - * uniform vec2 texelSize; - * uniform vec2 canvasSize; - * // a custom variable from this sketch - * uniform float darkness; - * - * void main() { - * // get the color at current pixel - * vec4 color = texture2D(tex0, vTexCoord); - * // set the output color - * color.b = 1.0; - * color *= darkness; - * gl_FragColor = vec4(color.rgb, 1.0); - * }`; - * - * createCanvas(100, 100, WEBGL); - * s = createFilterShader(fragSrc); - * } - * function draw() { - * image(img, -50, -50); - * s.setUniform('darkness', 0.5); - * filter(s); - * describe('a image of bricks tinted dark blue'); - * } - * - *
                                  - */ - _main.default.prototype.createFilterShader = function (fragSrc) { - _main.default._validateParameters("createFilterShader", arguments); - var defaultVertV1 = - "\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n "; - var defaultVertV2 = - "#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n "; - var vertSrc = fragSrc.includes("#version 300 es") - ? defaultVertV2 - : defaultVertV1; - var shader = new _main.default.Shader( - this._renderer, - vertSrc, - fragSrc, - ); - if (this._renderer.GL) { - shader.ensureCompiledOnContext(this); - } else { - shader.ensureCompiledOnContext( - this._renderer.getFilterGraphicsLayer(), - ); - } - return shader; - }; - /** - * Sets the p5.Shader object to - * be used to render subsequent shapes. - * - * Shaders can alter the positioning of shapes drawn with them. - * To ensure consistency in rendering, it's recommended to use the vertex shader in the createShader example. - * - * Custom shaders can be created using the - * createShader() and - * loadShader() functions. - * - * Use resetShader() to - * restore the default shaders. - * - * Note, shaders can only be used in WEBGL mode. - * - * @method shader - * @chainable - * @param {p5.Shader} s the p5.Shader object - * to use for rendering shapes. - * - * @example - *
                                  - * - * // Click within the image to toggle - * // the shader used by the quad shape - * // Note: for an alternative approach to the same example, - * // involving changing uniforms please refer to: - * // https://p5js.org/reference/#/p5.Shader/setUniform - * - * let redGreen; - * let orangeBlue; - * let showRedGreen = false; - * - * function preload() { - * // note that we are using two instances - * // of the same vertex and fragment shaders - * redGreen = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); - * orangeBlue = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * // initialize the colors for redGreen shader - * shader(redGreen); - * redGreen.setUniform('colorCenter', [1.0, 0.0, 0.0]); - * redGreen.setUniform('colorBackground', [0.0, 1.0, 0.0]); - * - * // initialize the colors for orangeBlue shader - * shader(orangeBlue); - * orangeBlue.setUniform('colorCenter', [1.0, 0.5, 0.0]); - * orangeBlue.setUniform('colorBackground', [0.226, 0.0, 0.615]); - * - * noStroke(); - * - * describe( - * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' - * ); - * } - * - * function draw() { - * // update the offset values for each shader, - * // moving orangeBlue in vertical and redGreen - * // in horizontal direction - * orangeBlue.setUniform('offset', [0, sin(millis() / 2000) + 1]); - * redGreen.setUniform('offset', [sin(millis() / 2000), 1]); - * - * if (showRedGreen === true) { - * shader(redGreen); - * } else { - * shader(orangeBlue); - * } - * quad(-1, -1, 1, -1, 1, 1, -1, 1); - * } - * - * function mouseClicked() { - * showRedGreen = !showRedGreen; - * } - * - *
                                  - * - * @alt - * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. - */ - _main.default.prototype.shader = function (s) { - this._assert3d("shader"); - _main.default._validateParameters("shader", arguments); - s.ensureCompiledOnContext(this); - if (s.isStrokeShader()) { - this._renderer.userStrokeShader = s; - } else { - this._renderer.userFillShader = s; - this._renderer._useNormalMaterial = false; - } - return this; - }; - /** - * Restores the default shaders. Code that runs after resetShader() - * will not be affected by the shader previously set by - * shader() - * - * @method resetShader - * @chainable - * @example - *
                                  - * - * // This variable will hold our shader object - * let shaderProgram; - * - * // This variable will hold our vertex shader source code - * let vertSrc = ` - * attribute vec3 aPosition; - * attribute vec2 aTexCoord; - * uniform mat4 uProjectionMatrix; - * uniform mat4 uModelViewMatrix; - * varying vec2 vTexCoord; - * - * void main() { - * vTexCoord = aTexCoord; - * vec4 position = vec4(aPosition, 1.0); - * gl_Position = uProjectionMatrix * uModelViewMatrix * position; - * } - * `; - * - * // This variable will hold our fragment shader source code - * let fragSrc = ` - * precision mediump float; - * - * varying vec2 vTexCoord; - * - * void main() { - * vec2 uv = vTexCoord; - * vec3 color = vec3(uv.x, uv.y, min(uv.x + uv.y, 1.0)); - * gl_FragColor = vec4(color, 1.0); - * } - * `; - * - * function setup() { - * // Shaders require WEBGL mode to work - * createCanvas(100, 100, WEBGL); - * - * // Create our shader - * shaderProgram = createShader(vertSrc, fragSrc); - * - * describe( - * 'Two rotating cubes. The left one is painted using a custom (user-defined) shader, while the right one is painted using the default fill shader.' - * ); - * } - * - * function draw() { - * // Clear the scene - * background(200); - * - * // Draw a box using our shader - * // shader() sets the active shader with our shader - * shader(shaderProgram); - * push(); - * translate(-width / 4, 0, 0); - * rotateX(millis() * 0.00025); - * rotateY(millis() * 0.0005); - * box(width / 4); - * pop(); - * - * // Draw a box using the default fill shader - * // resetShader() restores the default fill shader - * resetShader(); - * fill(255, 0, 0); - * push(); - * translate(width / 4, 0, 0); - * rotateX(millis() * 0.00025); - * rotateY(millis() * 0.0005); - * box(width / 4); - * pop(); - * } - * - *
                                  - * @alt - * Two rotating cubes. The left one is painted using a custom (user-defined) shader, - * while the right one is painted using the default fill shader. - */ - _main.default.prototype.resetShader = function () { - this._renderer.userFillShader = this._renderer.userStrokeShader = - null; - return this; - }; - /** - * Sets the texture that will be used to render subsequent shapes. - * - * A texture is like a "skin" that wraps around a 3D geometry. Currently - * supported textures are images, video, and offscreen renders. - * - * To texture a geometry created with beginShape(), - * you will need to specify uv coordinates in vertex(). - * - * Note, texture() can only be used in WEBGL mode. - * - * You can view more materials in this - * example. - * - * @method texture - * @param {p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture} tex image to use as texture - * @chainable - * @example - *
                                  - * - * let img; - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('spinning cube with a texture from an image'); - * } - * - * function draw() { - * background(0); - * rotateZ(frameCount * 0.01); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * //pass image as texture - * texture(img); - * box(width / 2); - * } - * - *
                                  - * @alt - * spinning cube with a texture from an image - * - * @example - *
                                  - * - * let pg; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * pg = createGraphics(200, 200); - * pg.textSize(75); - * describe('plane with a texture from an image created by createGraphics()'); - * } - * - * function draw() { - * background(0); - * pg.background(255); - * pg.text('hello!', 0, 100); - * //pass image as texture - * texture(pg); - * rotateX(0.5); - * noStroke(); - * plane(50); - * } - * - *
                                  - * @alt - * plane with a texture from an image created by createGraphics() - * - * @example - *
                                  - * - * let vid; - * function preload() { - * vid = createVideo('assets/fingers.mov'); - * vid.hide(); - * } - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('rectangle with video as texture'); - * } - * - * function draw() { - * background(0); - * //pass video frame as texture - * texture(vid); - * rect(-40, -40, 80, 80); - * } - * - * function mousePressed() { - * vid.loop(); - * } - * - *
                                  - * - * @alt - * rectangle with video as texture - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('quad with a texture, mapped using normalized coordinates'); - * } - * - * function draw() { - * background(0); - * texture(img); - * textureMode(NORMAL); - * beginShape(); - * vertex(-40, -40, 0, 0); - * vertex(40, -40, 1, 0); - * vertex(40, 40, 1, 1); - * vertex(-40, 40, 0, 1); - * endShape(); - * } - * - *
                                  - * @alt - * quad with a texture, mapped using normalized coordinates - */ - _main.default.prototype.texture = function (tex) { - this._assert3d("texture"); - _main.default._validateParameters("texture", arguments); - if (tex.gifProperties) { - tex._animateGif(this); - } - this._renderer.drawMode = constants.TEXTURE; - this._renderer._useNormalMaterial = false; - this._renderer._tex = tex; - this._renderer._setProperty("_doFill", true); - return this; - }; - /** - * Sets the coordinate space for texture mapping. The default mode is IMAGE - * which refers to the actual coordinates of the image. - * NORMAL refers to a normalized space of values ranging from 0 to 1. - * - * With IMAGE, if an image is 100×200 pixels, mapping the image onto the entire - * size of a quad would require the points (0,0) (100, 0) (100,200) (0,200). - * The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1). - * @method textureMode - * @param {Constant} mode either IMAGE or NORMAL - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('quad with a texture, mapped using normalized coordinates'); - * } - * - * function draw() { - * texture(img); - * textureMode(NORMAL); - * beginShape(); - * vertex(-50, -50, 0, 0); - * vertex(50, -50, 1, 0); - * vertex(50, 50, 1, 1); - * vertex(-50, 50, 0, 1); - * endShape(); - * } - * - *
                                  - * @alt - * quad with a texture, mapped using normalized coordinates - * - * @example - *
                                  - * - * let img; - * - * function preload() { - * img = loadImage('assets/laDefense.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('quad with a texture, mapped using image coordinates'); - * } - * - * function draw() { - * texture(img); - * textureMode(IMAGE); - * beginShape(); - * vertex(-50, -50, 0, 0); - * vertex(50, -50, img.width, 0); - * vertex(50, 50, img.width, img.height); - * vertex(-50, 50, 0, img.height); - * endShape(); - * } - * - *
                                  - * @alt - * quad with a texture, mapped using image coordinates - */ - _main.default.prototype.textureMode = function (mode) { - if (mode !== constants.IMAGE && mode !== constants.NORMAL) { - console.warn( - "You tried to set ".concat( - mode, - " textureMode only supports IMAGE & NORMAL ", - ), - ); - } else { - this._renderer.textureMode = mode; - } - }; - /** - * Sets the global texture wrapping mode. This controls how textures behave - * when their uv's go outside of the 0 to 1 range. There are three options: - * CLAMP, REPEAT, and MIRROR. - * - * CLAMP causes the pixels at the edge of the texture to extend to the bounds. - * REPEAT causes the texture to tile repeatedly until reaching the bounds. - * MIRROR works similarly to REPEAT but it flips the texture with every new tile. - * - * REPEAT & MIRROR are only available if the texture - * is a power of two size (128, 256, 512, 1024, etc.). - * - * This method will affect all textures in your sketch until a subsequent - * textureWrap() call is made. - * - * If only one argument is provided, it will be applied to both the - * horizontal and vertical axes. - * @method textureWrap - * @param {Constant} wrapX either CLAMP, REPEAT, or MIRROR - * @param {Constant} [wrapY] either CLAMP, REPEAT, or MIRROR - * @example - *
                                  - * - * let img; - * function preload() { - * img = loadImage('assets/rockies128.jpg'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * textureWrap(MIRROR); - * describe('an image of the rocky mountains repeated in mirrored tiles'); - * } - * - * function draw() { - * background(0); - * - * let dX = mouseX; - * let dY = mouseY; - * - * let u = lerp(1.0, 2.0, dX); - * let v = lerp(1.0, 2.0, dY); - * - * scale(width / 2); - * - * texture(img); - * - * beginShape(TRIANGLES); - * vertex(-1, -1, 0, 0, 0); - * vertex(1, -1, 0, u, 0); - * vertex(1, 1, 0, u, v); - * - * vertex(1, 1, 0, u, v); - * vertex(-1, 1, 0, 0, v); - * vertex(-1, -1, 0, 0, 0); - * endShape(); - * } - * - *
                                  - * - * @alt - * an image of the rocky mountains repeated in mirrored tiles - */ - _main.default.prototype.textureWrap = function (wrapX) { - var wrapY = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : wrapX; - this._renderer.textureWrapX = wrapX; - this._renderer.textureWrapY = wrapY; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = this._renderer.textures - .values() - [Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()).done); - _iteratorNormalCompletion = true - ) { - var texture = _step.value; - texture.setWrapMode(wrapX, wrapY); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }; - /** - * Sets the current material as a normal material. - * - * A normal material is not affected by light. It is often used as - * a placeholder material when debugging. - * - * Surfaces facing the X-axis become red, those facing the Y-axis - * become green, and those facing the Z-axis become blue. - * - * You can view more materials in this - * example. - * - * @method normalMaterial - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('Sphere with normal material'); - * } - * - * function draw() { - * background(200); - * normalMaterial(); - * sphere(40); - * } - * - *
                                  - * @alt - * Sphere with normal material - */ - _main.default.prototype.normalMaterial = function () { - this._assert3d("normalMaterial"); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("normalMaterial", args); - this._renderer.drawMode = constants.FILL; - this._renderer._useSpecularMaterial = false; - this._renderer._useEmissiveMaterial = false; - this._renderer._useNormalMaterial = true; - this._renderer.curFillColor = [1, 1, 1, 1]; - this._renderer._setProperty("_doFill", true); - this.noStroke(); - return this; - }; - /** - * Sets the ambient color of the material. - * - * The ambientMaterial() color represents the components - * of the **ambientLight()** color that the object reflects. - * - * Consider an ambientMaterial() with the color yellow (255, 255, 0). - * If the ambientLight() emits the color white (255, 255, 255), then the object - * will appear yellow as it will reflect the red and green components - * of the light. If the ambientLight() emits the color red (255, 0, 0), then - * the object will appear red as it will reflect the red component - * of the light. If the ambientLight() emits the color blue (0, 0, 255), - * then the object will appear black, as there is no component of - * the light that it can reflect. - * - * You can view more materials in this - * example. - * - * @method ambientMaterial - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('sphere reflecting red, blue, and green light'); - * } - * function draw() { - * background(0); - * noStroke(); - * ambientLight(255); - * ambientMaterial(70, 130, 230); - * sphere(40); - * } - * - *
                                  - * @alt - * sphere reflecting red, blue, and green light - * - * @example - *
                                  - * - * // ambientLight is both red and blue (magenta), - * // so object only reflects it's red and blue components - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('box reflecting only red and blue light'); - * } - * function draw() { - * background(70); - * ambientLight(255, 0, 255); // magenta light - * ambientMaterial(255); // white material - * box(30); - * } - * - *
                                  - * @alt - * box reflecting only red and blue light - * - * @example - *
                                  - * - * // ambientLight is green. Since object does not contain - * // green, it does not reflect any light - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('box reflecting no light'); - * } - * function draw() { - * background(70); - * ambientLight(0, 255, 0); // green light - * ambientMaterial(255, 0, 255); // magenta material - * box(30); - * } - * - *
                                  - * @alt - * box reflecting no light - */ - /** - * @method ambientMaterial - * @param {Number} gray number specifying value between - * white and black - * @chainable - */ - /** - * @method ambientMaterial - * @param {p5.Color|Number[]|String} color - * color as a p5.Color, - * as an array, or as a CSS string - * @chainable - */ - _main.default.prototype.ambientMaterial = function (v1, v2, v3) { - this._assert3d("ambientMaterial"); - _main.default._validateParameters("ambientMaterial", arguments); - var color = _main.default.prototype.color.apply(this, arguments); - this._renderer._hasSetAmbient = true; - this._renderer.curAmbientColor = color._array; - this._renderer._useNormalMaterial = false; - this._renderer._enableLighting = true; - this._renderer._setProperty("_doFill", true); - return this; - }; - /** - * Sets the emissive color of the material. - * - * An emissive material will display the emissive color at - * full strength regardless of lighting. This can give the - * appearance that the object is glowing. - * - * Note, "emissive" is a misnomer in the sense that the material - * does not actually emit light that will affect surrounding objects. - * - * You can view more materials in this - * example. - * - * @method emissiveMaterial - * @param {Number} v1 red or hue value relative to the current - * color range - * @param {Number} v2 green or saturation value relative to the - * current color range - * @param {Number} v3 blue or brightness value relative to the - * current color range - * @param {Number} [alpha] alpha value relative to current color - * range (default is 0-255) - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('sphere with green emissive material'); - * } - * function draw() { - * background(0); - * noStroke(); - * ambientLight(0); - * emissiveMaterial(130, 230, 0); - * sphere(40); - * } - * - *
                                  - * - * @alt - * sphere with green emissive material - */ - /** - * @method emissiveMaterial - * @param {Number} gray number specifying value between - * white and black - * @chainable - */ - /** - * @method emissiveMaterial - * @param {p5.Color|Number[]|String} color - * color as a p5.Color, - * as an array, or as a CSS string - * @chainable - */ - _main.default.prototype.emissiveMaterial = function (v1, v2, v3, a) { - this._assert3d("emissiveMaterial"); - _main.default._validateParameters("emissiveMaterial", arguments); - var color = _main.default.prototype.color.apply(this, arguments); - this._renderer.curEmissiveColor = color._array; - this._renderer._useEmissiveMaterial = true; - this._renderer._useNormalMaterial = false; - this._renderer._enableLighting = true; - return this; - }; - /** - * Sets the specular color of the material. - * - * A specular material is reflective (shiny). The shininess can be - * controlled by the shininess() function. - * - * Like ambientMaterial(), - * the specularMaterial() color is the color the object will reflect - * under ambientLight(). - * However unlike ambientMaterial(), for all other types of lights - * (directionalLight(), - * pointLight(), - * spotLight()), - * a specular material will reflect the **color of the light source**. - * This is what gives it its "shiny" appearance. - * - * You can view more materials in this - * example. - * - * @method specularMaterial - * @param {Number} gray number specifying value between white and black. - * @param {Number} [alpha] alpha value relative to current color range - * (default is 0-255) - * @chainable - * - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * describe('torus with specular material'); - * } - * - * function draw() { - * background(0); - * - * ambientLight(60); - * - * // add point light to showcase specular material - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * pointLight(255, 255, 255, locX, locY, 50); - * - * specularMaterial(250); - * shininess(50); - * torus(30, 10, 64, 64); - * } - * - *
                                  - * @alt - * torus with specular material - */ - /** - * @method specularMaterial - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @param {Number} [alpha] - * @chainable - */ - /** - * @method specularMaterial - * @param {p5.Color|Number[]|String} color - * color as a p5.Color, - * as an array, or as a CSS string - * @chainable - */ - _main.default.prototype.specularMaterial = function ( - v1, - v2, - v3, - alpha, - ) { - this._assert3d("specularMaterial"); - _main.default._validateParameters("specularMaterial", arguments); - var color = _main.default.prototype.color.apply(this, arguments); - this._renderer.curSpecularColor = color._array; - this._renderer._useSpecularMaterial = true; - this._renderer._useNormalMaterial = false; - this._renderer._enableLighting = true; - return this; - }; - /** - * Sets the amount of gloss ("shininess") of a - * specularMaterial(). - * - * The default and minimum value is 1. - * - * @method shininess - * @param {Number} shine degree of shininess - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('two spheres, one more shiny than the other'); - * } - * function draw() { - * background(0); - * noStroke(); - * let locX = mouseX - width / 2; - * let locY = mouseY - height / 2; - * ambientLight(60, 60, 60); - * pointLight(255, 255, 255, locX, locY, 50); - * specularMaterial(250); - * translate(-25, 0, 0); - * shininess(1); - * sphere(20); - * translate(50, 0, 0); - * shininess(20); - * sphere(20); - * } - * - *
                                  - * @alt - * two spheres, one more shiny than the other - */ - _main.default.prototype.shininess = function (shine) { - this._assert3d("shininess"); - _main.default._validateParameters("shininess", arguments); - if (shine < 1) { - shine = 1; - } - this._renderer._useShininess = shine; - return this; - }; - /** - * @private blends colors according to color components. - * If alpha value is less than 1, or non-standard blendMode - * we need to enable blending on our gl context. - * @param {Number[]} color [description] - * @return {Number[]]} Normalized numbers array - */ - _main.default.RendererGL.prototype._applyColorBlend = function ( - colors, - ) { - var gl = this.GL; - var isTexture = this.drawMode === constants.TEXTURE; - var doBlend = - this.userFillShader || - this.userStrokeShader || - this.userPointShader || - isTexture || - this.curBlendMode !== constants.BLEND || - colors[colors.length - 1] < 1 || - this._isErasing; - if (doBlend !== this._isBlending) { - if ( - doBlend || - (this.curBlendMode !== constants.BLEND && - this.curBlendMode !== constants.ADD) - ) { - gl.enable(gl.BLEND); - } else { - gl.disable(gl.BLEND); - } - gl.depthMask(true); - this._isBlending = doBlend; - } - this._applyBlendMode(); - return colors; - }; - /** - * @private sets blending in gl context to curBlendMode - * @param {Number[]} color [description] - * @return {Number[]]} Normalized numbers array - */ - _main.default.RendererGL.prototype._applyBlendMode = function () { - if (this._cachedBlendMode === this.curBlendMode) { - return; - } - var gl = this.GL; - switch (this.curBlendMode) { - case constants.BLEND: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.ADD: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ONE); - break; - case constants.REMOVE: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ZERO, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.MULTIPLY: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA); - break; - case constants.SCREEN: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR); - break; - case constants.EXCLUSION: - gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); - gl.blendFuncSeparate( - gl.ONE_MINUS_DST_COLOR, - gl.ONE_MINUS_SRC_COLOR, - gl.ONE, - gl.ONE, - ); - break; - case constants.REPLACE: - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ZERO); - break; - case constants.SUBTRACT: - gl.blendEquationSeparate(gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD); - gl.blendFuncSeparate( - gl.ONE, - gl.ONE, - gl.ONE, - gl.ONE_MINUS_SRC_ALPHA, - ); - break; - case constants.DARKEST: - if (this.blendExt) { - gl.blendEquationSeparate( - this.blendExt.MIN || this.blendExt.MIN_EXT, - gl.FUNC_ADD, - ); - gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); - } else { - console.warn( - "blendMode(DARKEST) does not work in your browser in WEBGL mode.", - ); - } - break; - case constants.LIGHTEST: - if (this.blendExt) { - gl.blendEquationSeparate( - this.blendExt.MAX || this.blendExt.MAX_EXT, - gl.FUNC_ADD, - ); - gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE); - } else { - console.warn( - "blendMode(LIGHTEST) does not work in your browser in WEBGL mode.", - ); - } - break; - default: - console.error( - "Oops! Somehow RendererGL set curBlendMode to an unsupported mode.", - ); - break; - } - if (!this._isErasing) { - this._cachedBlendMode = this.curBlendMode; - } - }; - var _default = _main.default; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.Texture": 357, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.join": 180, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 347: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.string.sub"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.hypot"); - _dereq_("core-js/modules/es.string.sub"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module 3D - * @submodule Camera - * @requires core - */ - //////////////////////////////////////////////////////////////////////////////// - // p5.Prototype Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Sets the position of the current camera in a 3D sketch. - * Parameters for this function define the camera's position, - * the center of the sketch (where the camera is pointing), - * and an up direction (the orientation of the camera). - * - * This function simulates the movements of the camera, allowing objects to be - * viewed from various angles. Remember, it does not move the objects themselves - * but the camera instead. For example when the centerX value is positive, - * and the camera is rotating to the right side of the sketch, - * the object will seem like it's moving to the left. - * - * See this example - * to view the position of your camera. - * - * If no parameters are given, the following default is used: - * camera(0, 0, (height/2) / tan(PI/6), 0, 0, 0, 0, 1, 0) - * @method camera - * @constructor - * @for p5 - * @param {Number} [x] camera position value on x axis - * @param {Number} [y] camera position value on y axis - * @param {Number} [z] camera position value on z axis - * @param {Number} [centerX] x coordinate representing center of the sketch - * @param {Number} [centerY] y coordinate representing center of the sketch - * @param {Number} [centerZ] z coordinate representing center of the sketch - * @param {Number} [upX] x component of direction 'up' from camera - * @param {Number} [upY] y component of direction 'up' from camera - * @param {Number} [upZ] z component of direction 'up' from camera - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * describe('a square moving closer and then away from the camera.'); - * } - * function draw() { - * background(204); - * //move the camera away from the plane by a sin wave - * camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); - * plane(10, 10); - * } - * - *
                                  - * - * @example - *
                                  - * - * //move slider to see changes! - * //sliders control the first 6 parameters of camera() - * let sliderGroup = []; - * let X; - * let Y; - * let Z; - * let centerX; - * let centerY; - * let centerZ; - * let h = 20; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * //create sliders - * for (var i = 0; i < 6; i++) { - * if (i === 2) { - * sliderGroup[i] = createSlider(10, 400, 200); - * } else { - * sliderGroup[i] = createSlider(-400, 400, 0); - * } - * h = map(i, 0, 6, 5, 85); - * sliderGroup[i].position(10, height + h); - * sliderGroup[i].style('width', '80px'); - * } - * describe( - * 'White square repeatedly grows to fill canvas and then shrinks. An interactive example of a red cube with 3 sliders for moving it across x, y, z axis and 3 sliders for shifting its center.' - * ); - * } - * - * function draw() { - * background(60); - * // assigning sliders' value to each parameters - * X = sliderGroup[0].value(); - * Y = sliderGroup[1].value(); - * Z = sliderGroup[2].value(); - * centerX = sliderGroup[3].value(); - * centerY = sliderGroup[4].value(); - * centerZ = sliderGroup[5].value(); - * camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); - * stroke(255); - * fill(255, 102, 94); - * box(85); - * } - * - *
                                  - * @alt - * White square repeatedly grows to fill canvas and then shrinks. - * An interactive example of a red cube with 3 sliders for moving it across x, y, - * z axis and 3 sliders for shifting its center. - */ - - _main.default.prototype.camera = function () { - var _this$_renderer$_curC; - this._assert3d("camera"); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _main.default._validateParameters("camera", args); - (_this$_renderer$_curC = this._renderer._curCamera).camera.apply( - _this$_renderer$_curC, - args, - ); - return this; - }; - /** - * Sets a perspective projection for the current camera in a 3D sketch. - * This projection represents depth through foreshortening: objects - * that are close to the camera appear their actual size while those - * that are further away from the camera appear smaller. - * - * The parameters to this function define the viewing frustum - * (the truncated pyramid within which objects are seen by the camera) through - * vertical field of view, aspect ratio (usually width/height), and near and far - * clipping planes. - * - * If no parameters are given, the default values are used as: - * - * - `fov` : The default field of view for the camera is such that the full height of renderer is visible when it is positioned at a default distance of 800 units from the camera. - * - `aspect` : The default aspect ratio is the ratio of renderer's width to renderer's height. - * - `near` : The default value for the near clipping plane is 80, which is 0.1 times the default distance from the camera to its subject. - * - `far` : The default value for the far clipping plane is 8000, which is 10 times the default distance from the camera to its subject. - * - * If you prefer a fixed field of view, follow these steps: - * 1. Choose your desired field of view angle (`fovy`). This is how wide the camera can see. - * 2. To ensure that you can see the entire width across horizontally and height across vertically, place the camera a distance of `(height / 2) / tan(fovy / 2)` back from its subject. - * 3. Call perspective with the chosen field of view, canvas aspect ratio, and near/far values: - * `perspective(fovy, width / height, cameraDistance / 10, cameraDistance * 10);` - * - * @method perspective - * @for p5 - * @param {Number} [fovy] camera frustum vertical field of view, - * from bottom to top of view, in angleMode units - * @param {Number} [aspect] camera frustum aspect ratio - * @param {Number} [near] frustum near plane length - * @param {Number} [far] frustum far plane length - * @chainable - * @example - *
                                  - * - * //drag the mouse to look around! - * function setup() { - * createCanvas(100, 100, WEBGL); - * perspective(PI / 3.0, width / height, 0.1, 500); - * describe( - * 'two colored 3D boxes move back and forth, rotating as mouse is dragged.' - * ); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * - * translate(0, 0, 550); - * rotateX(-0.3); - * rotateY(-0.2); - * - * push(); - * translate(-15, 0, sin(frameCount / 30) * 95); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 95); - * box(30); - * pop(); - * } - * - *
                                  - * - * @alt - * two colored 3D boxes move back and forth, rotating as mouse is dragged. - */ - _main.default.prototype.perspective = function () { - var _this$_renderer$_curC2; - this._assert3d("perspective"); - for ( - var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; - _key2 < _len2; - _key2++ - ) { - args[_key2] = arguments[_key2]; - } - _main.default._validateParameters("perspective", args); - (_this$_renderer$_curC2 = - this._renderer._curCamera).perspective.apply( - _this$_renderer$_curC2, - args, - ); - return this; - }; - /** - * Sets an orthographic projection for the current camera in a 3D sketch - * and defines a box-shaped viewing frustum within which objects are seen. - * In this projection, all objects with the same dimension appear the same - * size, regardless of whether they are near or far from the camera. - * - * The parameters to this function specify the viewing frustum where - * left and right are the minimum and maximum x values, top and bottom are - * the minimum and maximum y values, and near and far are the minimum and - * maximum z values. - * - * If no parameters are given, the following default is used: - * ortho(-width/2, width/2, -height/2, height/2). - * @method ortho - * @for p5 - * @param {Number} [left] camera frustum left plane - * @param {Number} [right] camera frustum right plane - * @param {Number} [bottom] camera frustum bottom plane - * @param {Number} [top] camera frustum top plane - * @param {Number} [near] camera frustum near plane - * @param {Number} [far] camera frustum far plane - * @chainable - * @example - *
                                  - * - * //drag the mouse to look around! - * //there's no vanishing point - * function setup() { - * createCanvas(100, 100, WEBGL); - * ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); - * describe( - * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' - * ); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * - * translate(0,0,500); - * rotateX(0.2); - * rotateY(-0.2); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 65); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 65); - * box(30); - * pop(); - * } - * - *
                                  - * - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */ - _main.default.prototype.ortho = function () { - var _this$_renderer$_curC3; - this._assert3d("ortho"); - for ( - var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; - _key3 < _len3; - _key3++ - ) { - args[_key3] = arguments[_key3]; - } - _main.default._validateParameters("ortho", args); - (_this$_renderer$_curC3 = this._renderer._curCamera).ortho.apply( - _this$_renderer$_curC3, - args, - ); - return this; - }; - /** - * Sets the frustum of the current camera as defined by - * the parameters. - * - * A frustum is a geometric form: a pyramid with its top - * cut off. With the viewer's eye at the imaginary top of - * the pyramid, the six planes of the frustum act as clipping - * planes when rendering a 3D view. Thus, any form inside the - * clipping planes is visible; anything outside - * those planes is not visible. - * - * Setting the frustum changes the perspective of the scene being rendered. - * This can be achieved more simply in many cases by using - * perspective(). - * - * If no parameters are given, the following default is used: - * frustum(-width/20, width/20, height/20, -height/20, eyeZ/10, eyeZ*10), - * where eyeZ is equal to ((height/2) / tan(PI/6)). - * @method frustum - * @for p5 - * @param {Number} [left] camera frustum left plane - * @param {Number} [right] camera frustum right plane - * @param {Number} [bottom] camera frustum bottom plane - * @param {Number} [top] camera frustum top plane - * @param {Number} [near] camera frustum near plane - * @param {Number} [far] camera frustum far plane - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); - * describe( - * 'two 3D boxes move back and forth along same plane, rotating as mouse is dragged.' - * ); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * translate(0,0,700); - * rotateY(-0.2); - * rotateX(-0.3); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 25); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 25); - * box(30); - * pop(); - * } - * - *
                                  - * - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */ - _main.default.prototype.frustum = function () { - var _this$_renderer$_curC4; - this._assert3d("frustum"); - for ( - var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; - _key4 < _len4; - _key4++ - ) { - args[_key4] = arguments[_key4]; - } - _main.default._validateParameters("frustum", args); - (_this$_renderer$_curC4 = this._renderer._curCamera).frustum.apply( - _this$_renderer$_curC4, - args, - ); - return this; - }; - //////////////////////////////////////////////////////////////////////////////// - // p5.Camera - //////////////////////////////////////////////////////////////////////////////// - /** - * Creates a new p5.Camera object and sets it - * as the current (active) camera. - * - * The new camera is initialized with a default position - * (see camera()) - * and a default perspective projection - * (see perspective()). - * Its properties can be controlled with the p5.Camera - * methods. - * - * Note: Every 3D sketch starts with a default camera initialized. - * This camera can be controlled with the global methods - * camera(), - * perspective(), ortho(), - * and frustum() if it is the only camera - * in the scene. - * @method createCamera - * @return {p5.Camera} The newly created camera object. - * @for p5 - * @example - *
                                  - * // Creates a camera object and animates it around a box. - * let camera; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * camera = createCamera(); - * describe('An example that creates a camera and moves it around the box.'); - * } - * - * function draw() { - * background(0); - * // The camera will automatically - * // rotate to look at [0, 0, 0]. - * camera.lookAt(0, 0, 0); - * - * // The camera will move on the - * // x axis. - * camera.setPosition(sin(frameCount / 60) * 200, 0, 100); - * box(20); - * - * // A 'ground' box to give the viewer - * // a better idea of where the camera - * // is looking. - * translate(0, 50, 0); - * rotateX(HALF_PI); - * box(150, 150, 20); - * } - *
                                  - * - * @alt - * An example that creates a camera and moves it around the box. - */ - _main.default.prototype.createCamera = function () { - this._assert3d("createCamera"); - var _cam = new _main.default.Camera(this._renderer); - // compute default camera settings, then set a default camera - _cam._computeCameraDefaultSettings(); - _cam._setDefaultCamera(); - // set renderer current camera to the new camera - this._renderer._curCamera = _cam; - return _cam; - }; - /** - * This class describes a camera for use in p5's - * - * WebGL mode. It contains camera position, orientation, and projection - * information necessary for rendering a 3D scene. - * - * New p5.Camera objects can be made through the - * createCamera() function and controlled through - * the methods described below. A camera created in this way will use a default - * position in the scene and a default perspective projection until these - * properties are changed through the various methods available. It is possible - * to create multiple cameras, in which case the current camera - * can be set through the setCamera() method. - * - * Note: - * The methods below operate in two coordinate systems: the 'world' coordinate - * system describe positions in terms of their relationship to the origin along - * the X, Y and Z axes whereas the camera's 'local' coordinate system - * describes positions from the camera's point of view: left-right, up-down, - * and forward-backward. The move() method, - * for instance, moves the camera along its own axes, whereas the - * setPosition() - * method sets the camera's position in world-space. - * - * The camera object propreties - * eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ - * which describes camera position, orientation, and projection - * are also accessible via the camera object generated using - * createCamera() - * - * @class p5.Camera - * @param {rendererGL} rendererGL instance of WebGL renderer - * @example - *
                                  - * - * let cam; - * let delta = 0.01; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * // set initial pan angle - * cam.pan(-0.8); - * describe( - * 'camera view pans left and right across a series of rotating 3D boxes.' - * ); - * } - * - * function draw() { - * background(200); - * - * // pan camera according to angle 'delta' - * cam.pan(delta); - * - * // every 160 frames, switch direction - * if (frameCount % 160 === 0) { - * delta *= -1; - * } - * - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                                  - * - * @alt - * camera view pans left and right across a series of rotating 3D boxes. - */ - _main.default.Camera = /*#__PURE__*/ (function () { - function Camera(renderer) { - _classCallCheck(this, Camera); - this._renderer = renderer; - this.cameraType = "default"; - this.cameraMatrix = new _main.default.Matrix(); - this.projMatrix = new _main.default.Matrix(); - this.yScale = 1; - } /** - * camera position value on x axis - * @property {Number} eyeX - * @readonly - * @example - * - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * cam = createCamera(); - * div = createDiv(); - * div.position(0, 0); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * div.html('eyeX = ' + cam.eyeX); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * camera position value on y axis - * @property {Number} eyeY - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * cam = createCamera(); - * div = createDiv(); - * div.position(0, 0); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * div.html('eyeY = ' + cam.eyeY); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * camera position value on z axis - * @property {Number} eyeZ - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(0); - * cam = createCamera(); - * div = createDiv(); - * div.position(0, 0); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * div.html('eyeZ = ' + cam.eyeZ); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * x coordinate representing center of the sketch - * @property {Number} centerX - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * cam.lookAt(1, 0, 0); - * div = createDiv('centerX = ' + cam.centerX); - * div.position(0, 0); - * div.style('color', 'white'); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * y coordinate representing center of the sketch - * @property {Number} centerY - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * cam.lookAt(0, 1, 0); - * div = createDiv('centerY = ' + cam.centerY); - * div.position(0, 0); - * div.style('color', 'white'); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * z coordinate representing center of the sketch - * @property {Number} centerZ - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * cam.lookAt(0, 0, 1); - * div = createDiv('centerZ = ' + cam.centerZ); - * div.position(0, 0); - * div.style('color', 'white'); - * describe('An example showing the use of camera object properties'); - * } - * - * function draw() { - * orbitControl(); - * box(10); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * x component of direction 'up' from camera - * @property {Number} upX - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * div = createDiv('upX = ' + cam.upX); - * div.position(0, 0); - * div.style('color', 'blue'); - * div.style('font-size', '18px'); - * describe('An example showing the use of camera object properties'); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * y component of direction 'up' from camera - * @property {Number} upY - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * div = createDiv('upY = ' + cam.upY); - * div.position(0, 0); - * div.style('color', 'blue'); - * div.style('font-size', '18px'); - * describe('An example showing the use of camera object properties'); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - /** - * z component of direction 'up' from camera - * @property {Number} upZ - * @readonly - * @example - *
                                  - * let cam, div; - * function setup() { - * createCanvas(100, 100, WEBGL); - * background(255); - * cam = createCamera(); - * div = createDiv('upZ = ' + cam.upZ); - * div.position(0, 0); - * div.style('color', 'blue'); - * div.style('font-size', '18px'); - * describe('An example showing the use of camera object properties'); - * } - *
                                  - * - * @alt - * An example showing the use of camera object properties - * - */ - //////////////////////////////////////////////////////////////////////////////// - // Camera Projection Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Sets a perspective projection. - * Accepts the same parameters as the global - * perspective(). - * More information on this function can be found there. - * @method perspective - * @for p5.Camera - * @example - *
                                  - * - * // drag the mouse to look around! - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // create a camera - * cam = createCamera(); - * // give it a perspective projection - * cam.perspective(PI / 3.0, width / height, 0.1, 500); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * - * translate(0, 0, 550); - * rotateX(-0.3); - * rotateY(-0.2); - * - * push(); - * translate(-15, 0, sin(frameCount / 30) * 95); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 95); - * box(30); - * pop(); - * } - * - *
                                  - * @alt - * two colored 3D boxes move back and forth, rotating as mouse is dragged. - */ - - _createClass(Camera, [ - { - key: "perspective", - value: function perspective(fovy, aspect, near, far) { - this.cameraType = arguments.length > 0 ? "custom" : "default"; - if (typeof fovy === "undefined") { - fovy = this.defaultCameraFOV; - // this avoids issue where setting angleMode(DEGREES) before calling - // perspective leads to a smaller than expected FOV (because - // _computeCameraDefaultSettings computes in radians) - this.cameraFOV = fovy; - } else { - this.cameraFOV = this._renderer._pInst._toRadians(fovy); - } - if (typeof aspect === "undefined") { - aspect = this.defaultAspectRatio; - } - if (typeof near === "undefined") { - near = this.defaultCameraNear; - } - if (typeof far === "undefined") { - far = this.defaultCameraFar; - } - if (near <= 0.0001) { - near = 0.01; - console.log( - "Avoid perspective near plane values close to or below 0. " + - "Setting value to 0.01.", - ); - } - if (far < near) { - console.log( - "Perspective far plane value is less than near plane value. " + - "Nothing will be shown.", - ); - } - this.aspectRatio = aspect; - this.cameraNear = near; - this.cameraFar = far; - this.projMatrix = _main.default.Matrix.identity(); - var f = 1 / Math.tan(this.cameraFOV / 2); - var nf = 1 / (this.cameraNear - this.cameraFar); - /* eslint-disable indent */ - this.projMatrix.set( - f / aspect, - 0, - 0, - 0, - 0, - -f * this.yScale, - 0, - 0, - 0, - 0, - (far + near) * nf, - -1, - 0, - 0, - 2 * far * near * nf, - 0, - ); - /* eslint-enable indent */ - if (this._isActive()) { - this._renderer.uPMatrix.set( - this.projMatrix.mat4[0], - this.projMatrix.mat4[1], - this.projMatrix.mat4[2], - this.projMatrix.mat4[3], - this.projMatrix.mat4[4], - this.projMatrix.mat4[5], - this.projMatrix.mat4[6], - this.projMatrix.mat4[7], - this.projMatrix.mat4[8], - this.projMatrix.mat4[9], - this.projMatrix.mat4[10], - this.projMatrix.mat4[11], - this.projMatrix.mat4[12], - this.projMatrix.mat4[13], - this.projMatrix.mat4[14], - this.projMatrix.mat4[15], - ); - } - } /** - * Sets an orthographic projection. - * Accepts the same parameters as the global - * ortho(). - * More information on this function can be found there. - * @method ortho - * @for p5.Camera - * @example - *
                                  - * - * // drag the mouse to look around! - * // there's no vanishing point - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // create a camera - * cam = createCamera(); - * // give it an orthographic projection - * cam.ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500); - * } - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * translate(0,0,500); - * rotateX(0.2); - * rotateY(-0.2); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 65); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 65); - * box(30); - * pop(); - * } - * - *
                                  - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */, - }, - { - key: "ortho", - value: function ortho(left, right, bottom, top, near, far) { - if (left === undefined) left = -this._renderer.width / 2; - if (right === undefined) right = +this._renderer.width / 2; - if (bottom === undefined) bottom = -this._renderer.height / 2; - if (top === undefined) top = +this._renderer.height / 2; - if (near === undefined) near = 0; - if (far === undefined) - far = Math.max(this._renderer.width, this._renderer.height); - this.cameraNear = near; - this.cameraFar = far; - var w = right - left; - var h = top - bottom; - var d = far - near; - var x = +2 / w; - var y = (+2 / h) * this.yScale; - var z = -2 / d; - var tx = -(right + left) / w; - var ty = -(top + bottom) / h; - var tz = -(far + near) / d; - this.projMatrix = _main.default.Matrix.identity(); - /* eslint-disable indent */ - this.projMatrix.set( - x, - 0, - 0, - 0, - 0, - -y, - 0, - 0, - 0, - 0, - z, - 0, - tx, - ty, - tz, - 1, - ); - /* eslint-enable indent */ - if (this._isActive()) { - this._renderer.uPMatrix.set( - this.projMatrix.mat4[0], - this.projMatrix.mat4[1], - this.projMatrix.mat4[2], - this.projMatrix.mat4[3], - this.projMatrix.mat4[4], - this.projMatrix.mat4[5], - this.projMatrix.mat4[6], - this.projMatrix.mat4[7], - this.projMatrix.mat4[8], - this.projMatrix.mat4[9], - this.projMatrix.mat4[10], - this.projMatrix.mat4[11], - this.projMatrix.mat4[12], - this.projMatrix.mat4[13], - this.projMatrix.mat4[14], - this.projMatrix.mat4[15], - ); - } - this.cameraType = "custom"; - } /** - * Sets the camera's frustum. - * Accepts the same parameters as the global - * frustum(). - * More information on this function can be found there. - * @method frustum - * @for p5.Camera - * @example - *
                                  - * - * let cam; - * - * function setup() { - * x = createCanvas(100, 100, WEBGL); - * setAttributes('antialias', true); - * // create a camera - * cam = createCamera(); - * // set its frustum - * cam.frustum(-0.1, 0.1, -0.1, 0.1, 0.1, 200); - * } - * - * function draw() { - * background(200); - * orbitControl(); - * normalMaterial(); - * translate(0,0,700); - * rotateY(-0.2); - * rotateX(-0.3); - * push(); - * translate(-15, 0, sin(frameCount / 30) * 25); - * box(30); - * pop(); - * push(); - * translate(15, 0, sin(frameCount / 30 + PI) * 25); - * box(30); - * pop(); - * } - * - *
                                  - * @alt - * two 3D boxes move back and forth along same plane, rotating as mouse is dragged. - */, - }, - { - key: "frustum", - value: function frustum(left, right, bottom, top, near, far) { - if (left === undefined) left = -this._renderer.width * 0.05; - if (right === undefined) right = +this._renderer.width * 0.05; - if (bottom === undefined) - bottom = +this._renderer.height * 0.05; - if (top === undefined) top = -this._renderer.height * 0.05; - if (near === undefined) near = this.defaultCameraNear; - if (far === undefined) far = this.defaultCameraFar; - this.cameraNear = near; - this.cameraFar = far; - var w = right - left; - var h = top - bottom; - var d = far - near; - var x = +(2 * near) / w; - var y = (+(2 * near) / h) * this.yScale; - var z = -(2 * far * near) / d; - var tx = (right + left) / w; - var ty = (top + bottom) / h; - var tz = -(far + near) / d; - this.projMatrix = _main.default.Matrix.identity(); - /* eslint-disable indent */ - this.projMatrix.set( - x, - 0, - 0, - 0, - 0, - -y, - 0, - 0, - tx, - ty, - tz, - -1, - 0, - 0, - z, - 0, - ); - /* eslint-enable indent */ - if (this._isActive()) { - this._renderer.uPMatrix.set( - this.projMatrix.mat4[0], - this.projMatrix.mat4[1], - this.projMatrix.mat4[2], - this.projMatrix.mat4[3], - this.projMatrix.mat4[4], - this.projMatrix.mat4[5], - this.projMatrix.mat4[6], - this.projMatrix.mat4[7], - this.projMatrix.mat4[8], - this.projMatrix.mat4[9], - this.projMatrix.mat4[10], - this.projMatrix.mat4[11], - this.projMatrix.mat4[12], - this.projMatrix.mat4[13], - this.projMatrix.mat4[14], - this.projMatrix.mat4[15], - ); - } - this.cameraType = "custom"; - }, //////////////////////////////////////////////////////////////////////////////// - // Camera Orientation Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Rotate camera view about arbitrary axis defined by x,y,z - * based on http://learnwebgl.brown37.net/07_cameras/camera_rotating_motion.html - * @method _rotateView - * @private - */ - }, - { - key: "_rotateView", - value: function _rotateView(a, x, y, z) { - var centerX = this.centerX; - var centerY = this.centerY; - var centerZ = this.centerZ; - // move center by eye position such that rotation happens around eye position - centerX -= this.eyeX; - centerY -= this.eyeY; - centerZ -= this.eyeZ; - var rotation = _main.default.Matrix.identity( - this._renderer._pInst, - ); - rotation.rotate(this._renderer._pInst._toRadians(a), x, y, z); - /* eslint-disable max-len */ - var rotatedCenter = [ - centerX * rotation.mat4[0] + - centerY * rotation.mat4[4] + - centerZ * rotation.mat4[8], - centerX * rotation.mat4[1] + - centerY * rotation.mat4[5] + - centerZ * rotation.mat4[9], - centerX * rotation.mat4[2] + - centerY * rotation.mat4[6] + - centerZ * rotation.mat4[10], - ]; - /* eslint-enable max-len */ - // add eye position back into center - rotatedCenter[0] += this.eyeX; - rotatedCenter[1] += this.eyeY; - rotatedCenter[2] += this.eyeZ; - this.camera( - this.eyeX, - this.eyeY, - this.eyeZ, - rotatedCenter[0], - rotatedCenter[1], - rotatedCenter[2], - this.upX, - this.upY, - this.upZ, - ); - } /** - * Panning rotates the camera view to the left and right. - * @method pan - * @param {Number} angle amount to rotate camera in current - * angleMode units. - * Greater than 0 values rotate counterclockwise (to the left). - * @example - *
                                  - * - * let cam; - * let delta = 0.01; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * // set initial pan angle - * cam.pan(-0.8); - * } - * - * function draw() { - * background(200); - * - * // pan camera according to angle 'delta' - * cam.pan(delta); - * - * // every 160 frames, switch direction - * if (frameCount % 160 === 0) { - * delta *= -1; - * } - * - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                                  - * - * @alt - * camera view pans left and right across a series of rotating 3D boxes. - */, - }, - { - key: "pan", - value: function pan(amount) { - var local = this._getLocalAxes(); - this._rotateView(amount, local.y[0], local.y[1], local.y[2]); - } /** - * Tilting rotates the camera view up and down. - * @method tilt - * @param {Number} angle amount to rotate camera in current - * angleMode units. - * Greater than 0 values rotate counterclockwise (to the left). - * @example - *
                                  - * - * let cam; - * let delta = 0.01; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * // set initial tilt - * cam.tilt(-0.8); - * } - * - * function draw() { - * background(200); - * - * // pan camera according to angle 'delta' - * cam.tilt(delta); - * - * // every 160 frames, switch direction - * if (frameCount % 160 === 0) { - * delta *= -1; - * } - * - * rotateY(frameCount * 0.01); - * translate(0, -100, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * translate(0, 35, 0); - * box(20); - * } - * - *
                                  - * - * @alt - * camera view tilts up and down across a series of rotating 3D boxes. - */, - }, - { - key: "tilt", - value: function tilt(amount) { - var local = this._getLocalAxes(); - this._rotateView(amount, local.x[0], local.x[1], local.x[2]); - } /** - * Reorients the camera to look at a position in world space. - * @method lookAt - * @for p5.Camera - * @param {Number} x x position of a point in world space - * @param {Number} y y position of a point in world space - * @param {Number} z z position of a point in world space - * @example - *
                                  - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * } - * - * function draw() { - * background(200); - * - * // look at a new random point every 60 frames - * if (frameCount % 60 === 0) { - * cam.lookAt(random(-100, 100), random(-50, 50), 0); - * } - * - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                                  - * - * @alt - * camera view of rotating 3D cubes changes to look at a new random - * point every second . - */, - }, - { - key: "lookAt", - value: function lookAt(x, y, z) { - this.camera( - this.eyeX, - this.eyeY, - this.eyeZ, - x, - y, - z, - this.upX, - this.upY, - this.upZ, - ); - }, //////////////////////////////////////////////////////////////////////////////// - // Camera Position Methods - //////////////////////////////////////////////////////////////////////////////// - /** - * Sets the camera's position and orientation. - * Accepts the same parameters as the global - * camera(). - * More information on this function can be found there. - * @method camera - * @for p5.Camera - * @example - *
                                  - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // Create a camera. - * // createCamera() sets the newly created camera as - * // the current (active) camera. - * cam = createCamera(); - * } - * - * function draw() { - * background(204); - * // Move the camera away from the plane by a sin wave - * cam.camera(0, 0, 20 + sin(frameCount * 0.01) * 10, 0, 0, 0, 0, 1, 0); - * plane(10, 10); - * } - * - *
                                  - * @alt - * White square repeatedly grows to fill canvas and then shrinks. - * - * @example - *
                                  - * - * // move slider to see changes! - * // sliders control the first 6 parameters of camera() - * - * let sliderGroup = []; - * let X; - * let Y; - * let Z; - * let centerX; - * let centerY; - * let centerZ; - * let h = 20; - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * // create a camera - * cam = createCamera(); - * // create sliders - * for (var i = 0; i < 6; i++) { - * if (i === 2) { - * sliderGroup[i] = createSlider(10, 400, 200); - * } else { - * sliderGroup[i] = createSlider(-400, 400, 0); - * } - * h = map(i, 0, 6, 5, 85); - * sliderGroup[i].position(10, height + h); - * sliderGroup[i].style('width', '80px'); - * } - * } - * - * function draw() { - * background(60); - * // assigning sliders' value to each parameters - * X = sliderGroup[0].value(); - * Y = sliderGroup[1].value(); - * Z = sliderGroup[2].value(); - * centerX = sliderGroup[3].value(); - * centerY = sliderGroup[4].value(); - * centerZ = sliderGroup[5].value(); - * cam.camera(X, Y, Z, centerX, centerY, centerZ, 0, 1, 0); - * stroke(255); - * fill(255, 102, 94); - * box(85); - * } - * - *
                                  - * @alt - * An interactive example of a red cube with 3 sliders for moving it across x, y, - * z axis and 3 sliders for shifting its center. - */ - }, - { - key: "camera", - value: function camera( - eyeX, - eyeY, - eyeZ, - centerX, - centerY, - centerZ, - upX, - upY, - upZ, - ) { - if (typeof eyeX === "undefined") { - eyeX = this.defaultEyeX; - eyeY = this.defaultEyeY; - eyeZ = this.defaultEyeZ; - centerX = eyeX; - centerY = eyeY; - centerZ = 0; - upX = 0; - upY = 1; - upZ = 0; - } - this.eyeX = eyeX; - this.eyeY = eyeY; - this.eyeZ = eyeZ; - if (typeof centerX !== "undefined") { - this.centerX = centerX; - this.centerY = centerY; - this.centerZ = centerZ; - } - if (typeof upX !== "undefined") { - this.upX = upX; - this.upY = upY; - this.upZ = upZ; - } - var local = this._getLocalAxes(); - // the camera affects the model view matrix, insofar as it - // inverse translates the world to the eye position of the camera - // and rotates it. - /* eslint-disable indent */ - this.cameraMatrix.set( - local.x[0], - local.y[0], - local.z[0], - 0, - local.x[1], - local.y[1], - local.z[1], - 0, - local.x[2], - local.y[2], - local.z[2], - 0, - 0, - 0, - 0, - 1, - ); - /* eslint-enable indent */ - var tx = -eyeX; - var ty = -eyeY; - var tz = -eyeZ; - this.cameraMatrix.translate([tx, ty, tz]); - if (this._isActive()) { - this._renderer.uMVMatrix.set( - this.cameraMatrix.mat4[0], - this.cameraMatrix.mat4[1], - this.cameraMatrix.mat4[2], - this.cameraMatrix.mat4[3], - this.cameraMatrix.mat4[4], - this.cameraMatrix.mat4[5], - this.cameraMatrix.mat4[6], - this.cameraMatrix.mat4[7], - this.cameraMatrix.mat4[8], - this.cameraMatrix.mat4[9], - this.cameraMatrix.mat4[10], - this.cameraMatrix.mat4[11], - this.cameraMatrix.mat4[12], - this.cameraMatrix.mat4[13], - this.cameraMatrix.mat4[14], - this.cameraMatrix.mat4[15], - ); - } - return this; - } /** - * Move camera along its local axes while maintaining current camera orientation. - * @method move - * @param {Number} x amount to move along camera's left-right axis - * @param {Number} y amount to move along camera's up-down axis - * @param {Number} z amount to move along camera's forward-backward axis - * @example - *
                                  - * - * // see the camera move along its own axes while maintaining its orientation - * let cam; - * let delta = 0.5; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * } - * - * function draw() { - * background(200); - * - * // move the camera along its local axes - * cam.move(delta, delta, 0); - * - * // every 100 frames, switch direction - * if (frameCount % 150 === 0) { - * delta *= -1; - * } - * - * translate(-10, -10, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * translate(15, 15, 0); - * box(50, 8, 50); - * } - * - *
                                  - * - * @alt - * camera view moves along a series of 3D boxes, maintaining the same - * orientation throughout the move - */, - }, - { - key: "move", - value: function move(x, y, z) { - var local = this._getLocalAxes(); - // scale local axes by movement amounts - // based on http://learnwebgl.brown37.net/07_cameras/camera_linear_motion.html - var dx = [local.x[0] * x, local.x[1] * x, local.x[2] * x]; - var dy = [local.y[0] * y, local.y[1] * y, local.y[2] * y]; - var dz = [local.z[0] * z, local.z[1] * z, local.z[2] * z]; - this.camera( - this.eyeX + dx[0] + dy[0] + dz[0], - this.eyeY + dx[1] + dy[1] + dz[1], - this.eyeZ + dx[2] + dy[2] + dz[2], - this.centerX + dx[0] + dy[0] + dz[0], - this.centerY + dx[1] + dy[1] + dz[1], - this.centerZ + dx[2] + dy[2] + dz[2], - this.upX, - this.upY, - this.upZ, - ); - } /** - * Set camera position in world-space while maintaining current camera - * orientation. - * @method setPosition - * @param {Number} x x position of a point in world space - * @param {Number} y y position of a point in world space - * @param {Number} z z position of a point in world space - * @example - *
                                  - * - * // press '1' '2' or '3' keys to set camera position - * - * let cam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * cam = createCamera(); - * } - * - * function draw() { - * background(200); - * - * // '1' key - * if (keyIsDown(49)) { - * cam.setPosition(30, 0, 80); - * } - * // '2' key - * if (keyIsDown(50)) { - * cam.setPosition(0, 0, 80); - * } - * // '3' key - * if (keyIsDown(51)) { - * cam.setPosition(-30, 0, 80); - * } - * - * box(20); - * } - * - *
                                  - * - * @alt - * camera position changes as the user presses keys, altering view of a 3D box - */, - }, - { - key: "setPosition", - value: function setPosition(x, y, z) { - var diffX = x - this.eyeX; - var diffY = y - this.eyeY; - var diffZ = z - this.eyeZ; - this.camera( - x, - y, - z, - this.centerX + diffX, - this.centerY + diffY, - this.centerZ + diffZ, - this.upX, - this.upY, - this.upZ, - ); - } /** - * Copies information about the argument camera's view and projection to - * the target camera. If the target camera is active, it will be reflected - * on the screen. - * - * @method set - * @param {p5.Camera} cam source camera - * - * @example - *
                                  - * - * let cam, initialCam; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * strokeWeight(3); - * - * // Set the initial state to initialCamera and set it to the camera - * // used for drawing. Then set cam to be the active camera. - * cam = createCamera(); - * initialCam = createCamera(); - * initialCam.camera(100, 100, 100, 0, 0, 0, 0, 0, -1); - * cam.set(initialCam); - * - * setCamera(cam); - * } - * - * function draw() { - * orbitControl(); - * background(255); - * box(50); - * translate(0, 0, -25); - * plane(100); - * } - * - * function doubleClicked(){ - * // Double-click to return the camera to its initial position. - * cam.set(initialCam); - * } - * - *
                                  - * @alt - * Prepare two cameras. One is the camera that sets the initial state, - * and the other is the camera that moves with interaction. - * Draw a plane and a box on top of it, operate the camera using orbitControl(). - * Double-click to set the camera in the initial state and return to - * the initial state. - */, - }, - { - key: "set", - value: function set(cam) { - var keyNamesOfThePropToCopy = [ - "eyeX", - "eyeY", - "eyeZ", - "centerX", - "centerY", - "centerZ", - "upX", - "upY", - "upZ", - "cameraFOV", - "aspectRatio", - "cameraNear", - "cameraFar", - "cameraType", - "yScale", - ]; - for ( - var _i = 0, _keyNamesOfThePropToC = keyNamesOfThePropToCopy; - _i < _keyNamesOfThePropToC.length; - _i++ - ) { - var keyName = _keyNamesOfThePropToC[_i]; - this[keyName] = cam[keyName]; - } - this.cameraMatrix = cam.cameraMatrix.copy(); - this.projMatrix = cam.projMatrix.copy(); - // If the target camera is active, update uMVMatrix and uPMatrix. - if (this._isActive()) { - this._renderer.uMVMatrix.mat4 = - this.cameraMatrix.mat4.slice(); - this._renderer.uPMatrix.mat4 = this.projMatrix.mat4.slice(); - } - } /** - * For the cameras cam0 and cam1 with the given arguments, their view are combined - * with the parameter amt that represents the quantity, and the obtained view is applied. - * For example, if cam0 is looking straight ahead and cam1 is looking straight - * to the right and amt is 0.5, the applied camera will look to the halfway - * between front and right. - * If the applied camera is active, the applied result will be reflected on the screen. - * When applying this function, all cameras involved must have exactly the same projection - * settings. For example, if one is perspective, ortho, frustum, the other two must also be - * perspective, ortho, frustum respectively. However, if all cameras have ortho settings, - * interpolation is possible if the ratios of left, right, top and bottom are equal to each other. - * For example, when it is changed by orbitControl(). - * - * @method slerp - * @param {p5.Camera} cam0 first p5.Camera - * @param {p5.Camera} cam1 second p5.Camera - * @param {Number} amt amount to use for interpolation during slerp - * - * @example - *
                                  - * - * let cam0, cam1, cam; - * function setup() { - * createCanvas(100, 100, WEBGL); - * strokeWeight(3); - * - * // camera for slerp. - * cam = createCamera(); - * // cam0 is looking at the cube from the front. - * // cam1 is pointing straight to the right in the cube - * // at the same position as cam0 by doing a pan(-PI/2). - * cam0 = createCamera(); - * cam1 = createCamera(); - * cam1.pan(-PI/2); - * - * // we only use cam. - * setCamera(cam); - * } - * - * function draw() { - * // calculate amount. - * const amt = 0.5 - 0.5 * cos(frameCount * TAU / 120); - * // slerp cam0 and cam1 with amt, set to cam. - * // When amt moves from 0 to 1, cam moves from cam0 to cam1, - * // shaking the camera to the right. - * cam.slerp(cam0, cam1, amt); - * - * background(255); - * // Every time the camera turns right, the cube drifts left. - * box(40); - * } - * - *
                                  - * @alt - * Prepare two cameras. One camera is facing straight ahead to the cube and the other - * camera is in the same position and looking straight to the right. - * If you use a camera which interpolates these with slerp(), the facing direction - * of the camera will change smoothly between the front and the right. - * - * @example - *
                                  - * - * let cam, lastCam, initialCam; - * let countForReset = 30; - * // This sample uses orbitControl() to move the camera. - * // Double-clicking the canvas restores the camera to its initial state. - * function setup() { - * createCanvas(100, 100, WEBGL); - * strokeWeight(3); - * - * cam = createCamera(); // main camera - * lastCam = createCamera(); // Camera for recording loc info before reset - * initialCam = createCamera(); // Camera for recording the initial state - * - * setCamera(cam); // set main camera - * } - * - * function draw() { - * if (countForReset < 30) { - * // if the reset count is less than 30, - * // it will move closer to the original camera as it increases. - * countForReset++; - * cam.slerp(lastCam, initialCam, countForReset / 30); - * } else { - * // if the count is 30, - * // you can freely move the main camera with orbitControl(). - * orbitControl(); - * } - * - * background(255); - * box(40); - * } - * // A double-click sets countForReset to 0 and initiates a reset. - * function doubleClicked() { - * if (countForReset === 30) { - * countForReset = 0; - * lastCam.set(cam); - * } - * } - * - *
                                  - * @alt - * There is a camera, drawing a cube. The camera can be moved freely with - * orbitControl(). Double-click to smoothly return the camera to its initial state. - * The camera cannot be moved during that time. - */, - }, - { - key: "slerp", - value: function slerp(cam0, cam1, amt) { - // If t is 0 or 1, do not interpolate and set the argument camera. - if (amt === 0) { - this.set(cam0); - return; - } else if (amt === 1) { - this.set(cam1); - return; - } // For this cameras is ortho, assume that cam0 and cam1 are also ortho - // and interpolate the elements of the projection matrix. - // Use logarithmic interpolation for interpolation. - - if (this.projMatrix.mat4[15] !== 0) { - this.projMatrix.mat4[0] = - cam0.projMatrix.mat4[0] * - Math.pow( - cam1.projMatrix.mat4[0] / cam0.projMatrix.mat4[0], - amt, - ); - this.projMatrix.mat4[5] = - cam0.projMatrix.mat4[5] * - Math.pow( - cam1.projMatrix.mat4[5] / cam0.projMatrix.mat4[5], - amt, - ); - // If the camera is active, make uPMatrix reflect changes in projMatrix. - if (this._isActive()) { - this._renderer.uPMatrix.mat4 = - this.projMatrix.mat4.slice(); - } - } // prepare eye vector and center vector of argument cameras. - - var eye0 = new _main.default.Vector( - cam0.eyeX, - cam0.eyeY, - cam0.eyeZ, - ); - var eye1 = new _main.default.Vector( - cam1.eyeX, - cam1.eyeY, - cam1.eyeZ, - ); - var center0 = new _main.default.Vector( - cam0.centerX, - cam0.centerY, - cam0.centerZ, - ); - var center1 = new _main.default.Vector( - cam1.centerX, - cam1.centerY, - cam1.centerZ, - ); - // Calculate the distance between eye and center for each camera. - // Logarithmically interpolate these with amt. - var dist0 = _main.default.Vector.dist(eye0, center0); - var dist1 = _main.default.Vector.dist(eye1, center1); - var lerpedDist = dist0 * Math.pow(dist1 / dist0, amt); - // Next, calculate the ratio to interpolate the eye and center by a constant - // ratio for each camera. This ratio is the same for both. Also, with this ratio - // of points, the distance is the minimum distance of the two points of - // the same ratio. - // With this method, if the viewpoint is fixed, linear interpolation is performed - // at the viewpoint, and if the center is fixed, linear interpolation is performed - // at the center, resulting in reasonable interpolation. If both move, the point - // halfway between them is taken. - var eyeDiff = _main.default.Vector.sub(eye0, eye1); - var diffDiff = eye0 - .copy() - .sub(eye1) - .sub(center0) - .add(center1); - // Suppose there are two line segments. Consider the distance between the points - // above them as if they were taken in the same ratio. This calculation figures out - // a ratio that minimizes this. - // Each line segment is, a line segment connecting the viewpoint and the center - // for each camera. - var divider = diffDiff.magSq(); - var ratio = 1; // default. - if (divider > 0.000001) { - ratio = - _main.default.Vector.dot(eyeDiff, diffDiff) / divider; - ratio = Math.max(0, Math.min(ratio, 1)); - } // Take the appropriate proportions and work out the points - // that are between the new viewpoint and the new center position. - - var lerpedMedium = _main.default.Vector.lerp( - _main.default.Vector.lerp(eye0, center0, ratio), - _main.default.Vector.lerp(eye1, center1, ratio), - amt, - ); - // Prepare each of rotation matrix from their camera matrix - var rotMat0 = cam0.cameraMatrix.createSubMatrix3x3(); - var rotMat1 = cam1.cameraMatrix.createSubMatrix3x3(); - // get front and up vector from local-coordinate-system. - var front0 = rotMat0.row(2); - var front1 = rotMat1.row(2); - var up0 = rotMat0.row(1); - var up1 = rotMat1.row(1); - // prepare new vectors. - var newFront = new _main.default.Vector(); - var newUp = new _main.default.Vector(); - var newEye = new _main.default.Vector(); - var newCenter = new _main.default.Vector(); - // Create the inverse matrix of mat0 by transposing mat0, - // and multiply it to mat1 from the right. - // This matrix represents the difference between the two. - // 'deltaRot' means 'difference of rotation matrices'. - var deltaRot = rotMat1.mult3x3(rotMat0.copy().transpose3x3()); - // Calculate the trace and from it the cos value of the angle. - // An orthogonal matrix is just an orthonormal basis. If this is not the identity - // matrix, it is a centered orthonormal basis plus some angle of rotation about - // some axis. That's the angle. Letting this be theta, trace becomes 1+2cos(theta). - // reference: https://en.wikipedia.org/wiki/Rotation_matrix#Determining_the_angle - var diag = deltaRot.diagonal(); - var cosTheta = 0.5 * (diag[0] + diag[1] + diag[2] - 1); - // If the angle is close to 0, the two matrices are very close, - // so in that case we execute linearly interpolate. - if (1 - cosTheta < 1e-7) { - // Obtain the front vector and up vector by linear interpolation - // and normalize them. - // calculate newEye, newCenter with newFront vector. - newFront - .set(_main.default.Vector.lerp(front0, front1, amt)) - .normalize(); - newEye - .set(newFront) - .mult(ratio * lerpedDist) - .add(lerpedMedium); - newCenter - .set(newFront) - .mult((ratio - 1) * lerpedDist) - .add(lerpedMedium); - newUp - .set(_main.default.Vector.lerp(up0, up1, amt)) - .normalize(); - // set the camera - this.camera( - newEye.x, - newEye.y, - newEye.z, - newCenter.x, - newCenter.y, - newCenter.z, - newUp.x, - newUp.y, - newUp.z, - ); - return; - } // Calculates the axis vector and the angle of the difference orthogonal matrix. - // The axis vector is what I explained earlier in the comments. - // similar calculation is here: - // https://github.com/mrdoob/three.js/blob/883249620049d1632e8791732808fefd1a98c871/src/math/Quaternion.js#L294 - - var a, b, c, sinTheta; - var invOneMinusCosTheta = 1 / (1 - cosTheta); - var maxDiag = Math.max(diag[0], diag[1], diag[2]); - var offDiagSum13 = deltaRot.mat3[1] + deltaRot.mat3[3]; - var offDiagSum26 = deltaRot.mat3[2] + deltaRot.mat3[6]; - var offDiagSum57 = deltaRot.mat3[5] + deltaRot.mat3[7]; - if (maxDiag === diag[0]) { - a = Math.sqrt((diag[0] - cosTheta) * invOneMinusCosTheta); // not zero. - invOneMinusCosTheta /= a; - b = 0.5 * offDiagSum13 * invOneMinusCosTheta; - c = 0.5 * offDiagSum26 * invOneMinusCosTheta; - sinTheta = - (0.5 * (deltaRot.mat3[7] - deltaRot.mat3[5])) / a; - } else if (maxDiag === diag[1]) { - b = Math.sqrt((diag[1] - cosTheta) * invOneMinusCosTheta); // not zero. - invOneMinusCosTheta /= b; - c = 0.5 * offDiagSum57 * invOneMinusCosTheta; - a = 0.5 * offDiagSum13 * invOneMinusCosTheta; - sinTheta = - (0.5 * (deltaRot.mat3[2] - deltaRot.mat3[6])) / b; - } else { - c = Math.sqrt((diag[2] - cosTheta) * invOneMinusCosTheta); // not zero. - invOneMinusCosTheta /= c; - a = 0.5 * offDiagSum26 * invOneMinusCosTheta; - b = 0.5 * offDiagSum57 * invOneMinusCosTheta; - sinTheta = - (0.5 * (deltaRot.mat3[3] - deltaRot.mat3[1])) / c; - } // Constructs a new matrix after interpolating the angles. - // Multiplying mat0 by the first matrix yields mat1, but by creating a state - // in the middle of that matrix, you can obtain a matrix that is - // an intermediate state between mat0 and mat1. - - var angle = amt * Math.atan2(sinTheta, cosTheta); - var cosAngle = Math.cos(angle); - var sinAngle = Math.sin(angle); - var oneMinusCosAngle = 1 - cosAngle; - var ab = a * b; - var bc = b * c; - var ca = c * a; - var lerpedRotMat = new _main.default.Matrix("mat3", [ - cosAngle + oneMinusCosAngle * a * a, - oneMinusCosAngle * ab + sinAngle * c, - oneMinusCosAngle * ca - sinAngle * b, - oneMinusCosAngle * ab - sinAngle * c, - cosAngle + oneMinusCosAngle * b * b, - oneMinusCosAngle * bc + sinAngle * a, - oneMinusCosAngle * ca + sinAngle * b, - oneMinusCosAngle * bc - sinAngle * a, - cosAngle + oneMinusCosAngle * c * c, - ]); - // Multiply this to mat0 from left to get the interpolated front vector. - // calculate newEye, newCenter with newFront vector. - lerpedRotMat.multiplyVec3(front0, newFront); - newEye - .set(newFront) - .mult(ratio * lerpedDist) - .add(lerpedMedium); - newCenter - .set(newFront) - .mult((ratio - 1) * lerpedDist) - .add(lerpedMedium); - lerpedRotMat.multiplyVec3(up0, newUp); - // We also get the up vector in the same way and set the camera. - // The eye position and center position are calculated based on the front vector. - this.camera( - newEye.x, - newEye.y, - newEye.z, - newCenter.x, - newCenter.y, - newCenter.z, - newUp.x, - newUp.y, - newUp.z, - ); - }, //////////////////////////////////////////////////////////////////////////////// - // Camera Helper Methods - //////////////////////////////////////////////////////////////////////////////// - // @TODO: combine this function with _setDefaultCamera to compute these values - // as-needed - }, - { - key: "_computeCameraDefaultSettings", - value: function _computeCameraDefaultSettings() { - this.defaultAspectRatio = - this._renderer.width / this._renderer.height; - this.defaultEyeX = 0; - this.defaultEyeY = 0; - this.defaultEyeZ = 800; - this.defaultCameraFOV = - 2 * Math.atan(this._renderer.height / 2 / this.defaultEyeZ); - this.defaultCenterX = 0; - this.defaultCenterY = 0; - this.defaultCenterZ = 0; - this.defaultCameraNear = this.defaultEyeZ * 0.1; - this.defaultCameraFar = this.defaultEyeZ * 10; - }, //detect if user didn't set the camera - //then call this function below - }, - { - key: "_setDefaultCamera", - value: function _setDefaultCamera() { - this.cameraFOV = this.defaultCameraFOV; - this.aspectRatio = this.defaultAspectRatio; - this.eyeX = this.defaultEyeX; - this.eyeY = this.defaultEyeY; - this.eyeZ = this.defaultEyeZ; - this.centerX = this.defaultCenterX; - this.centerY = this.defaultCenterY; - this.centerZ = this.defaultCenterZ; - this.upX = 0; - this.upY = 1; - this.upZ = 0; - this.cameraNear = this.defaultCameraNear; - this.cameraFar = this.defaultCameraFar; - this.perspective(); - this.camera(); - this.cameraType = "default"; - }, - }, - { - key: "_resize", - value: function _resize() { - // If we're using the default camera, update the aspect ratio - if (this.cameraType === "default") { - this._computeCameraDefaultSettings(); - this.cameraFOV = this.defaultCameraFOV; - this.aspectRatio = this.defaultAspectRatio; - this.perspective(); - } - } /** - * Returns a copy of a camera. - * @method copy - * @private - */, - }, - { - key: "copy", - value: function copy() { - var _cam = new _main.default.Camera(this._renderer); - _cam.cameraFOV = this.cameraFOV; - _cam.aspectRatio = this.aspectRatio; - _cam.eyeX = this.eyeX; - _cam.eyeY = this.eyeY; - _cam.eyeZ = this.eyeZ; - _cam.centerX = this.centerX; - _cam.centerY = this.centerY; - _cam.centerZ = this.centerZ; - _cam.upX = this.upX; - _cam.upY = this.upY; - _cam.upZ = this.upZ; - _cam.cameraNear = this.cameraNear; - _cam.cameraFar = this.cameraFar; - _cam.cameraType = this.cameraType; - _cam.cameraMatrix = this.cameraMatrix.copy(); - _cam.projMatrix = this.projMatrix.copy(); - _cam.yScale = this.yScale; - return _cam; - } /** - * Returns a camera's local axes: left-right, up-down, and forward-backward, - * as defined by vectors in world-space. - * @method _getLocalAxes - * @private - */, - }, - { - key: "_getLocalAxes", - value: function _getLocalAxes() { - // calculate camera local Z vector - var z0 = this.eyeX - this.centerX; - var z1 = this.eyeY - this.centerY; - var z2 = this.eyeZ - this.centerZ; - // normalize camera local Z vector - var eyeDist = Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - if (eyeDist !== 0) { - z0 /= eyeDist; - z1 /= eyeDist; - z2 /= eyeDist; - } // calculate camera Y vector - - var y0 = this.upX; - var y1 = this.upY; - var y2 = this.upZ; - // compute camera local X vector as up vector (local Y) cross local Z - var x0 = y1 * z2 - y2 * z1; - var x1 = -y0 * z2 + y2 * z0; - var x2 = y0 * z1 - y1 * z0; - // recompute y = z cross x - y0 = z1 * x2 - z2 * x1; - y1 = -z0 * x2 + z2 * x0; - y2 = z0 * x1 - z1 * x0; - // cross product gives area of parallelogram, which is < 1.0 for - // non-perpendicular unit-length vectors; so normalize x, y here: - var xmag = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - if (xmag !== 0) { - x0 /= xmag; - x1 /= xmag; - x2 /= xmag; - } - var ymag = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - if (ymag !== 0) { - y0 /= ymag; - y1 /= ymag; - y2 /= ymag; - } - return { - x: [x0, x1, x2], - y: [y0, y1, y2], - z: [z0, z1, z2], - }; - } /** - * Orbits the camera about center point. For use with orbitControl(). - * @method _orbit - * @private - * @param {Number} dTheta change in spherical coordinate theta - * @param {Number} dPhi change in spherical coordinate phi - * @param {Number} dRadius change in radius - */, - }, - { - key: "_orbit", - value: function _orbit(dTheta, dPhi, dRadius) { - // Calculate the vector and its magnitude from the center to the viewpoint - var diffX = this.eyeX - this.centerX; - var diffY = this.eyeY - this.centerY; - var diffZ = this.eyeZ - this.centerZ; - var camRadius = Math.hypot(diffX, diffY, diffZ); - // front vector. unit vector from center to eye. - var front = new _main.default.Vector( - diffX, - diffY, - diffZ, - ).normalize(); - // up vector. normalized camera's up vector. - var up = new _main.default.Vector( - this.upX, - this.upY, - this.upZ, - ).normalize(); // y-axis - // side vector. Right when viewed from the front - var side = new _main.default.Vector.cross( - up, - front, - ).normalize(); // x-axis - // vertical vector. normalized vector of projection of front vector. - var vertical = new _main.default.Vector.cross(side, up); // z-axis - // update camRadius - camRadius *= Math.pow(10, dRadius); - // prevent zooming through the center: - if (camRadius < this.cameraNear) { - camRadius = this.cameraNear; - } - if (camRadius > this.cameraFar) { - camRadius = this.cameraFar; - } // calculate updated camera angle - // Find the angle between the "up" and the "front", add dPhi to that. - // angleBetween() may return negative value. Since this specification is subject to change - // due to version updates, it cannot be adopted, so here we calculate using a method - // that directly obtains the absolute value. - - var camPhi = - Math.acos( - Math.max( - -1, - Math.min(1, _main.default.Vector.dot(front, up)), - ), - ) + dPhi; - // Rotate by dTheta in the shortest direction from "vertical" to "side" - var camTheta = dTheta; - // Invert camera's upX, upY, upZ if dPhi is below 0 or above PI - if (camPhi <= 0 || camPhi >= Math.PI) { - this.upX *= -1; - this.upY *= -1; - this.upZ *= -1; - } // update eye vector by calculate new front vector - - up.mult(Math.cos(camPhi)); - vertical.mult(Math.cos(camTheta) * Math.sin(camPhi)); - side.mult(Math.sin(camTheta) * Math.sin(camPhi)); - front.set(up).add(vertical).add(side); - this.eyeX = camRadius * front.x + this.centerX; - this.eyeY = camRadius * front.y + this.centerY; - this.eyeZ = camRadius * front.z + this.centerZ; - // update camera - this.camera( - this.eyeX, - this.eyeY, - this.eyeZ, - this.centerX, - this.centerY, - this.centerZ, - this.upX, - this.upY, - this.upZ, - ); - } /** - * Orbits the camera about center point. For use with orbitControl(). - * Unlike _orbit(), the direction of rotation always matches the direction of pointer movement. - * @method _orbitFree - * @private - * @param {Number} dx the x component of the rotation vector. - * @param {Number} dy the y component of the rotation vector. - * @param {Number} dRadius change in radius - */, - }, - { - key: "_orbitFree", - value: function _orbitFree(dx, dy, dRadius) { - // Calculate the vector and its magnitude from the center to the viewpoint - var diffX = this.eyeX - this.centerX; - var diffY = this.eyeY - this.centerY; - var diffZ = this.eyeZ - this.centerZ; - var camRadius = Math.hypot(diffX, diffY, diffZ); - // front vector. unit vector from center to eye. - var front = new _main.default.Vector( - diffX, - diffY, - diffZ, - ).normalize(); - // up vector. camera's up vector. - var up = new _main.default.Vector( - this.upX, - this.upY, - this.upZ, - ); - // side vector. Right when viewed from the front. (like x-axis) - var side = new _main.default.Vector.cross( - up, - front, - ).normalize(); - // down vector. Bottom when viewed from the front. (like y-axis) - var down = new _main.default.Vector.cross(front, side); - // side vector and down vector are no longer used as-is. - // Create a vector representing the direction of rotation - // in the form cos(direction)*side + sin(direction)*down. - // Make the current side vector into this. - var directionAngle = Math.atan2(dy, dx); - down.mult(Math.sin(directionAngle)); - side.mult(Math.cos(directionAngle)).add(down); - // The amount of rotation is the size of the vector (dx, dy). - var rotAngle = Math.sqrt(dx * dx + dy * dy); - // The vector that is orthogonal to both the front vector and - // the rotation direction vector is the rotation axis vector. - var axis = new _main.default.Vector.cross(front, side); - // update camRadius - camRadius *= Math.pow(10, dRadius); - // prevent zooming through the center: - if (camRadius < this.cameraNear) { - camRadius = this.cameraNear; - } - if (camRadius > this.cameraFar) { - camRadius = this.cameraFar; - } // If the axis vector is likened to the z-axis, the front vector is - // the x-axis and the side vector is the y-axis. Rotate the up and front - // vectors respectively by thinking of them as rotations around the z-axis. - // Calculate the components by taking the dot product and - // calculate a rotation based on that. - - var c = Math.cos(rotAngle); - var s = Math.sin(rotAngle); - var dotFront = up.dot(front); - var dotSide = up.dot(side); - var ux = dotFront * c + dotSide * s; - var uy = -dotFront * s + dotSide * c; - var uz = up.dot(axis); - up.x = ux * front.x + uy * side.x + uz * axis.x; - up.y = ux * front.y + uy * side.y + uz * axis.y; - up.z = ux * front.z + uy * side.z + uz * axis.z; - // We won't be using the side vector and the front vector anymore, - // so let's make the front vector into the vector from the center to the new eye. - side.mult(-s); - front.mult(c).add(side).mult(camRadius); - // it's complete. let's update camera. - this.camera( - front.x + this.centerX, - front.y + this.centerY, - front.z + this.centerZ, - this.centerX, - this.centerY, - this.centerZ, - up.x, - up.y, - up.z, - ); - } /** - * Returns true if camera is currently attached to renderer. - * @method _isActive - * @private - */, - }, - { - key: "_isActive", - value: function _isActive() { - return this === this._renderer._curCamera; - }, - }, - ]); - return Camera; - })(); - /** - * Sets the current (active) camera of a 3D sketch. - * Allows for switching between multiple cameras. - * @method setCamera - * @param {p5.Camera} cam p5.Camera object - * @for p5 - * @example - *
                                  - * - * let cam1, cam2; - * let currentCamera; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * normalMaterial(); - * - * cam1 = createCamera(); - * cam2 = createCamera(); - * cam2.setPosition(30, 0, 50); - * cam2.lookAt(0, 0, 0); - * cam2.ortho(); - * - * // set variable for previously active camera: - * currentCamera = 1; - * - * describe( - * 'Canvas switches between two camera views, each showing a series of spinning 3D boxes.' - * ); - * } - * - * function draw() { - * background(200); - * - * // camera 1: - * cam1.lookAt(0, 0, 0); - * cam1.setPosition(sin(frameCount / 60) * 200, 0, 100); - * - * // every 100 frames, switch between the two cameras - * if (frameCount % 100 === 0) { - * if (currentCamera === 1) { - * setCamera(cam1); - * currentCamera = 0; - * } else { - * setCamera(cam2); - * currentCamera = 1; - * } - * } - * - * drawBoxes(); - * } - * - * function drawBoxes() { - * rotateX(frameCount * 0.01); - * translate(-100, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * translate(35, 0, 0); - * box(20); - * } - * - *
                                  - * - * @alt - * Canvas switches between two camera views, each showing a series of spinning - * 3D boxes. - */ - _main.default.prototype.setCamera = function (cam) { - this._renderer._curCamera = cam; - // set the projection matrix (which is not normally updated each frame) - this._renderer.uPMatrix.set( - cam.projMatrix.mat4[0], - cam.projMatrix.mat4[1], - cam.projMatrix.mat4[2], - cam.projMatrix.mat4[3], - cam.projMatrix.mat4[4], - cam.projMatrix.mat4[5], - cam.projMatrix.mat4[6], - cam.projMatrix.mat4[7], - cam.projMatrix.mat4[8], - cam.projMatrix.mat4[9], - cam.projMatrix.mat4[10], - cam.projMatrix.mat4[11], - cam.projMatrix.mat4[12], - cam.projMatrix.mat4[13], - cam.projMatrix.mat4[14], - cam.projMatrix.mat4[15], - ); - }; - var _default = _main.default.Camera; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.math.hypot": 188, - "core-js/modules/es.string.sub": 218, - }, - ], - 348: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.log2"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.math.log2"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * An internal class to store data that will be sent to a p5.RenderBuffer. - * Those need to eventually go into a Float32Array, so this class provides a - * variable-length array container backed by a Float32Array so that it can be - * sent to the GPU without allocating a new array each frame. - * - * Like a C++ vector, its fixed-length Float32Array backing its contents will - * double in size when it goes over its capacity. - * - * @example - *
                                  - * - * // Initialize storage with a capacity of 4 - * const storage = new DataArray(4); - * console.log(storage.data.length); // 4 - * console.log(storage.length); // 0 - * console.log(storage.dataArray()); // Empty Float32Array - * - * storage.push(1, 2, 3, 4, 5, 6); - * console.log(storage.data.length); // 8 - * console.log(storage.length); // 6 - * console.log(storage.dataArray()); // Float32Array{1, 2, 3, 4, 5, 6} - * - *
                                  - */ - - _main.default.DataArray = /*#__PURE__*/ (function () { - function DataArray() { - var initialLength = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : 128; - _classCallCheck(this, DataArray); - this.length = 0; - this.data = new Float32Array(initialLength); - this.initialLength = initialLength; - } /** - * Returns a Float32Array window sized to the exact length of the data - */ - - _createClass(DataArray, [ - { - key: "dataArray", - value: function dataArray() { - return this.subArray(0, this.length); - } /** - * A "soft" clear, which keeps the underlying storage size the same, but - * empties the contents of its dataArray() - */, - }, - { - key: "clear", - value: function clear() { - this.length = 0; - } /** - * Can be used to scale a DataArray back down to fit its contents. - */, - }, - { - key: "rescale", - value: function rescale() { - if (this.length < this.data.length / 2) { - // Find the power of 2 size that fits the data - var targetLength = 1 << Math.ceil(Math.log2(this.length)); - var newData = new Float32Array(targetLength); - newData.set(this.data.subarray(0, this.length), 0); - this.data = newData; - } - } /** - * A full reset, which allocates a new underlying Float32Array at its initial - * length - */, - }, - { - key: "reset", - value: function reset() { - this.clear(); - this.data = new Float32Array(this.initialLength); - } /** - * Adds values to the DataArray, expanding its internal storage to - * accommodate the new items. - */, - }, - { - key: "push", - value: function push() { - for ( - var _len = arguments.length, - values = new Array(_len), - _key = 0; - _key < _len; - _key++ - ) { - values[_key] = arguments[_key]; - } - this.ensureLength(this.length + values.length); - this.data.set(values, this.length); - this.length += values.length; - } /** - * Returns a copy of the data from the index `from`, inclusive, to the index - * `to`, exclusive - */, - }, - { - key: "slice", - value: function slice(from, to) { - return this.data.slice(from, Math.min(to, this.length)); - } /** - * Returns a mutable Float32Array window from the index `from`, inclusive, to - * the index `to`, exclusive - */, - }, - { - key: "subArray", - value: function subArray(from, to) { - return this.data.subarray(from, Math.min(to, this.length)); - } /** - * Expand capacity of the internal storage until it can fit a target size - */, - }, - { - key: "ensureLength", - value: function ensureLength(target) { - while (this.data.length < target) { - var newData = new Float32Array(this.data.length * 2); - newData.set(this.data, 0); - this.data = newData; - } - }, - }, - ]); - return DataArray; - })(); - var _default = _main.default.DataArray; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.math.log2": 189, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.float32-array": 229, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - }, - ], - 349: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.reflect.get"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint8-clamped-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - var _p = _dereq_("./p5.Texture"); - var _p2 = _dereq_("./p5.RendererGL"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _slicedToArray(arr, i) { - return ( - _arrayWithHoles(arr) || - _iterableToArrayLimit(arr, i) || - _nonIterableRest() - ); - } - function _nonIterableRest() { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance", - ); - } - function _iterableToArrayLimit(arr, i) { - if ( - !( - Symbol.iterator in Object(arr) || - Object.prototype.toString.call(arr) === "[object Arguments]" - ) - ) { - return; - } - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - try { - for ( - var _i = arr[Symbol.iterator](), _s; - !(_n = (_s = _i.next()).done); - _n = true - ) { - _arr.push(_s.value); - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true, - }); - } else { - obj[key] = value; - } - return obj; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /** - * @module Rendering - * @requires constants - */ - - var FramebufferCamera = /*#__PURE__*/ (function (_p5$Camera) { - _inherits(FramebufferCamera, _p5$Camera); - var _super = _createSuper(FramebufferCamera); - /** - * A p5.Camera attached to a - * p5.Framebuffer. - * - * @class p5.FramebufferCamera - * @constructor - * @param {p5.Framebuffer} framebuffer The framebuffer this camera is - * attached to - * @private - */ - function FramebufferCamera(framebuffer) { - var _this; - _classCallCheck(this, FramebufferCamera); - _this = _super.call(this, framebuffer.target._renderer); - _this.fbo = framebuffer; - // WebGL textures are upside-down compared to textures that come from - // images and graphics. Framebuffer cameras need to invert their y - // axes when being rendered to so that the texture comes out rightway up - // when read in shaders or image(). - _this.yScale = -1; - return _this; - } - _createClass(FramebufferCamera, [ - { - key: "_computeCameraDefaultSettings", - value: function _computeCameraDefaultSettings() { - _get( - _getPrototypeOf(FramebufferCamera.prototype), - "_computeCameraDefaultSettings", - this, - ).call(this); - this.defaultAspectRatio = this.fbo.width / this.fbo.height; - this.defaultCameraFOV = - 2 * Math.atan(this.fbo.height / 2 / this.defaultEyeZ); - }, - }, - ]); - return FramebufferCamera; - })(_main.default.Camera); - _main.default.FramebufferCamera = FramebufferCamera; - var FramebufferTexture = /*#__PURE__*/ (function () { - /** - * A p5.Texture corresponding to a property of a - * p5.Framebuffer. - * - * @class p5.FramebufferTexture - * @param {p5.Framebuffer} framebuffer The framebuffer represented by this - * texture - * @param {String} property The property of the framebuffer represented by - * this texture, either `color` or `depth` - * @private - */ - function FramebufferTexture(framebuffer, property) { - _classCallCheck(this, FramebufferTexture); - this.framebuffer = framebuffer; - this.property = property; - } - _createClass(FramebufferTexture, [ - { - key: "rawTexture", - value: function rawTexture() { - return this.framebuffer[this.property]; - }, - }, - { - key: "width", - get: function get() { - return this.framebuffer.width * this.framebuffer.density; - }, - }, - { - key: "height", - get: function get() { - return this.framebuffer.height * this.framebuffer.density; - }, - }, - ]); - return FramebufferTexture; - })(); - _main.default.FramebufferTexture = FramebufferTexture; - var Framebuffer = /*#__PURE__*/ (function () { - /** - * An object that one can draw to and then read as a texture. While similar - * to a p5.Graphics, using a p5.Framebuffer as a texture will generally run - * much faster, as it lives within the same WebGL context as the canvas it - * is created on. It only works in WebGL mode. - * - * @class p5.Framebuffer - * @constructor - * @param {p5.Graphics|p5} target A p5 global instance or p5.Graphics - * @param {Object} [settings] A settings object - */ - function Framebuffer(target) { - var _this2 = this; - var settings = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}; - _classCallCheck(this, Framebuffer); - this.target = target; - this.target._renderer.framebuffers.add(this); - this._isClipApplied = false; - /** - * A Uint8ClampedArray - * containing the values for all the pixels in the Framebuffer. - * - * Like the main canvas pixels property, call - * loadPixels() before reading - * it, and call updatePixels() - * afterwards to update its data. - * - * Note that updating pixels via this property will be slower than - * drawing to the framebuffer directly. - * Consider using a shader instead of looping over pixels. - * - * @property {Number[]} pixels - */ - this.pixels = []; - this.format = settings.format || constants.UNSIGNED_BYTE; - this.channels = - settings.channels || - (target._renderer._pInst._glAttributes.alpha - ? constants.RGBA - : constants.RGB); - this.useDepth = - settings.depth === undefined ? true : settings.depth; - this.depthFormat = settings.depthFormat || constants.FLOAT; - this.textureFiltering = - settings.textureFiltering || constants.LINEAR; - if (settings.antialias === undefined) { - this.antialiasSamples = target._renderer._pInst._glAttributes - .antialias - ? 2 - : 0; - } else if (typeof settings.antialias === "number") { - this.antialiasSamples = settings.antialias; - } else { - this.antialiasSamples = settings.antialias ? 2 : 0; - } - this.antialias = this.antialiasSamples > 0; - if (this.antialias && target.webglVersion !== constants.WEBGL2) { - console.warn( - "Antialiasing is unsupported in a WebGL 1 context", - ); - this.antialias = false; - } - if (settings.width && settings.height) { - this.width = settings.width; - this.height = settings.height; - this.autoSized = false; - } else { - if ( - (settings.width === undefined) !== - (settings.height === undefined) - ) { - console.warn( - "Please supply both width and height for a framebuffer to give it a " + - "size. Only one was given, so the framebuffer will match the size " + - "of its canvas.", - ); - } - this.width = target.width; - this.height = target.height; - this.autoSized = true; - } - this.density = settings.density || target.pixelDensity(); - var gl = target._renderer.GL; - this.gl = gl; - this._checkIfFormatsAvailable(); - if (settings.stencil && !this.useDepth) { - console.warn( - "A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored.", - ); - } - this.useStencil = - this.useDepth && - (settings.stencil === undefined ? true : settings.stencil); - this.framebuffer = gl.createFramebuffer(); - if (!this.framebuffer) { - throw new Error("Unable to create a framebuffer"); - } - if (this.antialias) { - this.aaFramebuffer = gl.createFramebuffer(); - if (!this.aaFramebuffer) { - throw new Error( - "Unable to create a framebuffer for antialiasing", - ); - } - } - this._recreateTextures(); - var prevCam = this.target._renderer._curCamera; - this.defaultCamera = this.createCamera(); - this.target._renderer._curCamera = prevCam; - this.draw(function () { - return _this2.target.clear(); - }); - } /** - * Resizes the framebuffer to the given width and height. - * - * @method resize - * @param {Number} width - * @param {Number} height - * - * @example - *
                                  - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function mouseMoved() { - * framebuffer.resize( - * max(20, mouseX), - * max(20, mouseY) - * ); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * normalMaterial(); - * sphere(20); - * framebuffer.end(); - * - * background(100); - * // Draw the framebuffer to the main canvas - * image(framebuffer, -width/2, -height/2); - * } - * - *
                                  - * - * @alt - * A red, green, and blue sphere is drawn in the middle of a white rectangle - * which starts in the top left of the canvas and whose bottom right is at - * the user's mouse - */ - - _createClass(Framebuffer, [ - { - key: "resize", - value: function resize(width, height) { - this.autoSized = false; - this.width = width; - this.height = height; - this._handleResize(); - } /** - * Gets or sets the pixel scaling for high pixel density displays. By - * default, the density will match that of the canvas the framebuffer was - * created on, which will match the display density. - * - * Call this method with no arguments to get the current density, or pass - * in a number to set the density. - * - * @method pixelDensity - * @param {Number} [density] A scaling factor for the number of pixels per - * side of the framebuffer - */, - }, - { - key: "pixelDensity", - value: function pixelDensity(density) { - if (density) { - this.autoSized = false; - this.density = density; - this._handleResize(); - } else { - return this.density; - } - } /** - * Gets or sets whether or not this framebuffer will automatically resize - * along with the canvas it's attached to in order to match its size. - * - * Call this method with no arguments to see if it is currently auto-sized, - * or pass in a boolean to set this property. - * - * @method autoSized - * @param {Boolean} [autoSized] Whether or not the framebuffer should resize - * along with the canvas it's attached to - */, - }, - { - key: "autoSized", - value: function autoSized(_autoSized) { - if (_autoSized === undefined) { - return this.autoSized; - } else { - this.autoSized = _autoSized; - this._handleResize(); - } - } /** - * Checks the capabilities of the current WebGL environment to see if the - * settings supplied by the user are capable of being fulfilled. If they - * are not, warnings will be logged and the settings will be changed to - * something close that can be fulfilled. - * - * @private - */, - }, - { - key: "_checkIfFormatsAvailable", - value: function _checkIfFormatsAvailable() { - var gl = this.gl; - if ( - this.useDepth && - this.target.webglVersion === constants.WEBGL && - !gl.getExtension("WEBGL_depth_texture") - ) { - console.warn( - "Unable to create depth textures in this environment. Falling back " + - "to a framebuffer without depth.", - ); - this.useDepth = false; - } - if ( - this.useDepth && - this.target.webglVersion === constants.WEBGL && - this.depthFormat === constants.FLOAT - ) { - console.warn( - "FLOAT depth format is unavailable in WebGL 1. " + - "Defaulting to UNSIGNED_INT.", - ); - this.depthFormat = constants.UNSIGNED_INT; - } - if ( - ![ - constants.UNSIGNED_BYTE, - constants.FLOAT, - constants.HALF_FLOAT, - ].includes(this.format) - ) { - console.warn( - "Unknown Framebuffer format. " + - "Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. " + - "Defaulting to UNSIGNED_BYTE.", - ); - this.format = constants.UNSIGNED_BYTE; - } - if ( - this.useDepth && - ![constants.UNSIGNED_INT, constants.FLOAT].includes( - this.depthFormat, - ) - ) { - console.warn( - "Unknown Framebuffer depth format. " + - "Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT.", - ); - this.depthFormat = constants.FLOAT; - } - var support = (0, _p.checkWebGLCapabilities)( - this.target._renderer, - ); - if (!support.float && this.format === constants.FLOAT) { - console.warn( - "This environment does not support FLOAT textures. " + - "Falling back to UNSIGNED_BYTE.", - ); - this.format = constants.UNSIGNED_BYTE; - } - if ( - this.useDepth && - !support.float && - this.depthFormat === constants.FLOAT - ) { - console.warn( - "This environment does not support FLOAT depth textures. " + - "Falling back to UNSIGNED_INT.", - ); - this.depthFormat = constants.UNSIGNED_INT; - } - if ( - !support.halfFloat && - this.format === constants.HALF_FLOAT - ) { - console.warn( - "This environment does not support HALF_FLOAT textures. " + - "Falling back to UNSIGNED_BYTE.", - ); - this.format = constants.UNSIGNED_BYTE; - } - if ( - this.channels === constants.RGB && - [constants.FLOAT, constants.HALF_FLOAT].includes( - this.format, - ) - ) { - console.warn( - "FLOAT and HALF_FLOAT formats do not work cross-platform with only " + - "RGB channels. Falling back to RGBA.", - ); - this.channels = constants.RGBA; - } - } /** - * Creates new textures and renderbuffers given the current size of the - * framebuffer. - * - * @private - */, - }, - { - key: "_recreateTextures", - value: function _recreateTextures() { - var gl = this.gl; - this._updateSize(); - var prevBoundTexture = gl.getParameter(gl.TEXTURE_BINDING_2D); - var prevBoundFramebuffer = gl.getParameter( - gl.FRAMEBUFFER_BINDING, - ); - var colorTexture = gl.createTexture(); - if (!colorTexture) { - throw new Error("Unable to create color texture"); - } - gl.bindTexture(gl.TEXTURE_2D, colorTexture); - var colorFormat = this._glColorFormat(); - gl.texImage2D( - gl.TEXTURE_2D, - 0, - colorFormat.internalFormat, - this.width * this.density, - this.height * this.density, - 0, - colorFormat.format, - colorFormat.type, - null, - ); - this.colorTexture = colorTexture; - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); - gl.framebufferTexture2D( - gl.FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - gl.TEXTURE_2D, - colorTexture, - 0, - ); - if (this.useDepth) { - // Create the depth texture - var depthTexture = gl.createTexture(); - if (!depthTexture) { - throw new Error("Unable to create depth texture"); - } - var depthFormat = this._glDepthFormat(); - gl.bindTexture(gl.TEXTURE_2D, depthTexture); - gl.texImage2D( - gl.TEXTURE_2D, - 0, - depthFormat.internalFormat, - this.width * this.density, - this.height * this.density, - 0, - depthFormat.format, - depthFormat.type, - null, - ); - gl.framebufferTexture2D( - gl.FRAMEBUFFER, - this.useStencil - ? gl.DEPTH_STENCIL_ATTACHMENT - : gl.DEPTH_ATTACHMENT, - gl.TEXTURE_2D, - depthTexture, - 0, - ); - this.depthTexture = depthTexture; - } // Create separate framebuffer for antialiasing - - if (this.antialias) { - this.colorRenderbuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer( - gl.RENDERBUFFER, - this.colorRenderbuffer, - ); - gl.renderbufferStorageMultisample( - gl.RENDERBUFFER, - Math.max( - 0, - Math.min( - this.antialiasSamples, - gl.getParameter(gl.MAX_SAMPLES), - ), - ), - colorFormat.internalFormat, - this.width * this.density, - this.height * this.density, - ); - if (this.useDepth) { - var _depthFormat = this._glDepthFormat(); - this.depthRenderbuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer( - gl.RENDERBUFFER, - this.depthRenderbuffer, - ); - gl.renderbufferStorageMultisample( - gl.RENDERBUFFER, - Math.max( - 0, - Math.min( - this.antialiasSamples, - gl.getParameter(gl.MAX_SAMPLES), - ), - ), - _depthFormat.internalFormat, - this.width * this.density, - this.height * this.density, - ); - } - gl.bindFramebuffer(gl.FRAMEBUFFER, this.aaFramebuffer); - gl.framebufferRenderbuffer( - gl.FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - gl.RENDERBUFFER, - this.colorRenderbuffer, - ); - if (this.useDepth) { - gl.framebufferRenderbuffer( - gl.FRAMEBUFFER, - this.useStencil - ? gl.DEPTH_STENCIL_ATTACHMENT - : gl.DEPTH_ATTACHMENT, - gl.RENDERBUFFER, - this.depthRenderbuffer, - ); - } - } - if (this.useDepth) { - this.depth = new FramebufferTexture(this, "depthTexture"); - var depthFilter = gl.NEAREST; - this.depthP5Texture = new _main.default.Texture( - this.target._renderer, - this.depth, - { - minFilter: depthFilter, - magFilter: depthFilter, - }, - ); - this.target._renderer.textures.set( - this.depth, - this.depthP5Texture, - ); - } - this.color = new FramebufferTexture(this, "colorTexture"); - var filter = - this.textureFiltering === constants.LINEAR - ? gl.LINEAR - : gl.NEAREST; - this.colorP5Texture = new _main.default.Texture( - this.target._renderer, - this.color, - { - minFilter: filter, - magFilter: filter, - }, - ); - this.target._renderer.textures.set( - this.color, - this.colorP5Texture, - ); - gl.bindTexture(gl.TEXTURE_2D, prevBoundTexture); - gl.bindFramebuffer(gl.FRAMEBUFFER, prevBoundFramebuffer); - } /** - * To create a WebGL texture, one needs to supply three pieces of information: - * the type (the data type each channel will be stored as, e.g. int or float), - * the format (the color channels that will each be stored in the previously - * specified type, e.g. rgb or rgba), and the internal format (the specifics - * of how data for each channel, in the aforementioned type, will be packed - * together, such as how many bits to use, e.g. RGBA32F or RGB565.) - * - * The format and channels asked for by the user hint at what these values - * need to be, and the WebGL version affects what options are avaiable. - * This method returns the values for these three properties, given the - * framebuffer's settings. - * - * @private - */, - }, - { - key: "_glColorFormat", - value: function _glColorFormat() { - var type, format, internalFormat; - var gl = this.gl; - if (this.format === constants.FLOAT) { - type = gl.FLOAT; - } else if (this.format === constants.HALF_FLOAT) { - type = - this.target.webglVersion === constants.WEBGL2 - ? gl.HALF_FLOAT - : gl.getExtension("OES_texture_half_float") - .HALF_FLOAT_OES; - } else { - type = gl.UNSIGNED_BYTE; - } - if (this.channels === constants.RGBA) { - format = gl.RGBA; - } else { - format = gl.RGB; - } - if (this.target.webglVersion === constants.WEBGL2) { - var _gl$UNSIGNED_BYTE, _table; - // https://webgl2fundamentals.org/webgl/lessons/webgl-data-textures.html - var table = - ((_table = {}), - _defineProperty( - _table, - gl.FLOAT, - _defineProperty({}, gl.RGBA, gl.RGBA32F), - ), - _defineProperty( - _table, - gl.HALF_FLOAT, - _defineProperty({}, gl.RGBA, gl.RGBA16F), - ), - _defineProperty( - _table, - gl.UNSIGNED_BYTE, - ((_gl$UNSIGNED_BYTE = {}), - _defineProperty(_gl$UNSIGNED_BYTE, gl.RGBA, gl.RGBA8), - _defineProperty(_gl$UNSIGNED_BYTE, gl.RGB, gl.RGB8), - _gl$UNSIGNED_BYTE), - ), - _table); - internalFormat = table[type][format]; - } else if (this.format === constants.HALF_FLOAT) { - internalFormat = gl.RGBA; - } else { - internalFormat = format; - } - return { - internalFormat: internalFormat, - format: format, - type: type, - }; - } /** - * To create a WebGL texture, one needs to supply three pieces of information: - * the type (the data type each channel will be stored as, e.g. int or float), - * the format (the color channels that will each be stored in the previously - * specified type, e.g. rgb or rgba), and the internal format (the specifics - * of how data for each channel, in the aforementioned type, will be packed - * together, such as how many bits to use, e.g. RGBA32F or RGB565.) - * - * This method takes into account the settings asked for by the user and - * returns values for these three properties that can be used for the - * texture storing depth information. - * - * @private - */, - }, - { - key: "_glDepthFormat", - value: function _glDepthFormat() { - var type, format, internalFormat; - var gl = this.gl; - if (this.useStencil) { - if (this.depthFormat === constants.FLOAT) { - type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; - } else if (this.target.webglVersion === constants.WEBGL2) { - type = gl.UNSIGNED_INT_24_8; - } else { - type = gl.getExtension( - "WEBGL_depth_texture", - ).UNSIGNED_INT_24_8_WEBGL; - } - } else { - if (this.depthFormat === constants.FLOAT) { - type = gl.FLOAT; - } else { - type = gl.UNSIGNED_INT; - } - } - if (this.useStencil) { - format = gl.DEPTH_STENCIL; - } else { - format = gl.DEPTH_COMPONENT; - } - if (this.useStencil) { - if (this.depthFormat === constants.FLOAT) { - internalFormat = gl.DEPTH32F_STENCIL8; - } else if (this.target.webglVersion === constants.WEBGL2) { - internalFormat = gl.DEPTH24_STENCIL8; - } else { - internalFormat = gl.DEPTH_STENCIL; - } - } else if (this.target.webglVersion === constants.WEBGL2) { - if (this.depthFormat === constants.FLOAT) { - internalFormat = gl.DEPTH_COMPONENT32F; - } else { - internalFormat = gl.DEPTH_COMPONENT24; - } - } else { - internalFormat = gl.DEPTH_COMPONENT; - } - return { - internalFormat: internalFormat, - format: format, - type: type, - }; - } /** - * A method that will be called when recreating textures. If the framebuffer - * is auto-sized, it will update its width, height, and density properties. - * - * @private - */, - }, - { - key: "_updateSize", - value: function _updateSize() { - if (this.autoSized) { - this.width = this.target.width; - this.height = this.target.height; - this.density = this.target.pixelDensity(); - } - } /** - * Called when the canvas that the framebuffer is attached to resizes. If the - * framebuffer is auto-sized, it will update its textures to match the new - * size. - * - * @private - */, - }, - { - key: "_canvasSizeChanged", - value: function _canvasSizeChanged() { - if (this.autoSized) { - this._handleResize(); - } - } /** - * Called when the size of the framebuffer has changed (either by being - * manually updated or from auto-size updates when its canvas changes size.) - * Old textures and renderbuffers will be deleted, and then recreated with the - * new size. - * - * @private - */, - }, - { - key: "_handleResize", - value: function _handleResize() { - var oldColor = this.color; - var oldDepth = this.depth; - var oldColorRenderbuffer = this.colorRenderbuffer; - var oldDepthRenderbuffer = this.depthRenderbuffer; - this._deleteTexture(oldColor); - if (oldDepth) this._deleteTexture(oldDepth); - var gl = this.gl; - if (oldColorRenderbuffer) - gl.deleteRenderbuffer(oldColorRenderbuffer); - if (oldDepthRenderbuffer) - gl.deleteRenderbuffer(oldDepthRenderbuffer); - this._recreateTextures(); - this.defaultCamera._resize(); - } /** - * Creates and returns a new - * p5.FramebufferCamera to be used - * while drawing to this framebuffer. The camera will be set as the - * currently active camera. - * - * @method createCamera - * @returns {p5.Camera} A new camera - */, - }, - { - key: "createCamera", - value: function createCamera() { - var cam = new FramebufferCamera(this); - cam._computeCameraDefaultSettings(); - cam._setDefaultCamera(); - this.target._renderer._curCamera = cam; - return cam; - } /** - * Given a raw texture wrapper, delete its stored texture from WebGL memory, - * and remove it from p5's list of active textures. - * - * @param {p5.FramebufferTexture} texture - * @private - */, - }, - { - key: "_deleteTexture", - value: function _deleteTexture(texture) { - var gl = this.gl; - gl.deleteTexture(texture.rawTexture()); - this.target._renderer.textures.delete(texture); - } /** - * Removes the framebuffer and frees its resources. - * - * @method remove - * - * @example - *
                                  - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * const useFramebuffer = (frameCount % 120) > 60; - * if (useFramebuffer && !framebuffer) { - * // Create a new framebuffer for us to use - * framebuffer = createFramebuffer(); - * } else if (!useFramebuffer && framebuffer) { - * // Free the old framebuffer's resources - * framebuffer.remove(); - * framebuffer = undefined; - * } - * - * background(255); - * if (useFramebuffer) { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * fill(255, 0, 0); - * box(30); - * framebuffer.end(); - * - * image(framebuffer, -width/2, -height/2); - * } - * } - * - *
                                  - * - * @alt - * A rotating red cube blinks on and off every second. - */, - }, - { - key: "remove", - value: function remove() { - var gl = this.gl; - this._deleteTexture(this.color); - if (this.depth) this._deleteTexture(this.depth); - gl.deleteFramebuffer(this.framebuffer); - if (this.aaFramebuffer) { - gl.deleteFramebuffer(this.aaFramebuffer); - } - if (this.depthRenderbuffer) { - gl.deleteRenderbuffer(this.depthRenderbuffer); - } - if (this.colorRenderbuffer) { - gl.deleteRenderbuffer(this.colorRenderbuffer); - } - this.target._renderer.framebuffers.delete(this); - } /** - * Begin drawing to this framebuffer. Subsequent drawing functions to the - * canvas the framebuffer is attached to will not be immediately visible, and - * will instead be drawn to the framebuffer's texture. Call - * end() when finished to make draw - * functions go right to the canvas again and to be able to read the - * contents of the framebuffer's texture. - * - * @method begin - * - * @example - *
                                  - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * translate(0, 10*sin(frameCount * 0.01), 0); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * fill(255, 0, 0); - * box(50); - * framebuffer.end(); - * - * background(100); - * // Draw the framebuffer to the main canvas - * image(framebuffer, -50, -50, 25, 25); - * image(framebuffer, 0, 0, 35, 35); - * } - * - *
                                  - * - * @alt - * A video of a floating and rotating red cube is pasted twice on the - * canvas: once in the top left, and again, larger, in the bottom right. - */, - }, - { - key: "begin", - value: function begin() { - this.prevFramebuffer = - this.target._renderer.activeFramebuffer(); - if (this.prevFramebuffer) { - this.prevFramebuffer._beforeEnd(); - } - this.target._renderer.activeFramebuffers.push(this); - this._beforeBegin(); - this.target.push(); - // Apply the framebuffer's camera. This does almost what - // RendererGL.reset() does, but this does not try to clear any buffers; - // it only sets the camera. - this.target.setCamera(this.defaultCamera); - this.target._renderer.uMVMatrix.set( - this.target._renderer._curCamera.cameraMatrix.mat4[0], - this.target._renderer._curCamera.cameraMatrix.mat4[1], - this.target._renderer._curCamera.cameraMatrix.mat4[2], - this.target._renderer._curCamera.cameraMatrix.mat4[3], - this.target._renderer._curCamera.cameraMatrix.mat4[4], - this.target._renderer._curCamera.cameraMatrix.mat4[5], - this.target._renderer._curCamera.cameraMatrix.mat4[6], - this.target._renderer._curCamera.cameraMatrix.mat4[7], - this.target._renderer._curCamera.cameraMatrix.mat4[8], - this.target._renderer._curCamera.cameraMatrix.mat4[9], - this.target._renderer._curCamera.cameraMatrix.mat4[10], - this.target._renderer._curCamera.cameraMatrix.mat4[11], - this.target._renderer._curCamera.cameraMatrix.mat4[12], - this.target._renderer._curCamera.cameraMatrix.mat4[13], - this.target._renderer._curCamera.cameraMatrix.mat4[14], - this.target._renderer._curCamera.cameraMatrix.mat4[15], - ); - } /** - * When making a p5.Framebuffer active so that it may be drawn to, this method - * returns the underlying WebGL framebuffer that needs to be active to - * support this. Antialiased framebuffers first write to a multisampled - * renderbuffer, while other framebuffers can write directly to their main - * framebuffers. - * - * @method _framebufferToBind - * @private - */, - }, - { - key: "_framebufferToBind", - value: function _framebufferToBind() { - if (this.antialias) { - // If antialiasing, draw to an antialiased renderbuffer rather - // than directly to the texture. In end() we will copy from the - // renderbuffer to the texture. - return this.aaFramebuffer; - } else { - return this.framebuffer; - } - } /** - * Ensures that the framebuffer is ready to be drawn to - * - * @method _beforeBegin - * @private - */, - }, - { - key: "_beforeBegin", - value: function _beforeBegin() { - var gl = this.gl; - gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebufferToBind()); - this.target._renderer.viewport( - this.width * this.density, - this.height * this.density, - ); - } /** - * Ensures that the framebuffer is ready to be read by other framebuffers. - * - * @method _beforeEnd - * @private - */, - }, - { - key: "_beforeEnd", - value: function _beforeEnd() { - if (this.antialias) { - var gl = this.gl; - gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.aaFramebuffer); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.framebuffer); - var partsToCopy = [ - [gl.COLOR_BUFFER_BIT, this.colorP5Texture.glMagFilter], - ]; - if (this.useDepth) { - partsToCopy.push([ - gl.DEPTH_BUFFER_BIT, - this.depthP5Texture.glMagFilter, - ]); - } - for ( - var _i = 0, _partsToCopy = partsToCopy; - _i < _partsToCopy.length; - _i++ - ) { - var _partsToCopy$_i = _slicedToArray(_partsToCopy[_i], 2), - flag = _partsToCopy$_i[0], - filter = _partsToCopy$_i[1]; - gl.blitFramebuffer( - 0, - 0, - this.width * this.density, - this.height * this.density, - 0, - 0, - this.width * this.density, - this.height * this.density, - flag, - filter, - ); - } - } - } /** - * After having previously called - * begin(), this method stops drawing - * functions from going to the framebuffer's texture, allowing them to go - * right to the canvas again. After this, one can read from the framebuffer's - * texture. - * - * @method end - */, - }, - { - key: "end", - value: function end() { - var gl = this.gl; - this.target.pop(); - var fbo = this.target._renderer.activeFramebuffers.pop(); - if (fbo !== this) { - throw new Error( - "It looks like you've called end() while another Framebuffer is active.", - ); - } - this._beforeEnd(); - if (this.prevFramebuffer) { - this.prevFramebuffer._beforeBegin(); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - this.target._renderer.viewport( - this.target._renderer._origViewport.width, - this.target._renderer._origViewport.height, - ); - } - this.target._renderer._applyStencilTestIfClipping(); - } /** - * Run a function while drawing to the framebuffer rather than to its canvas. - * This is equivalent to calling `framebuffer.begin()`, running the function, - * and then calling `framebuffer.end()`, but ensures that one never - * accidentally forgets `begin` or `end`. - * - * @method draw - * @param {Function} callback A function to run that draws to the canvas. The - * function will immediately be run, but it will draw to the framebuffer - * instead of the canvas. - * - * @example - *
                                  - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.draw(function() { - * background(255); - * translate(0, 10*sin(frameCount * 0.01), 0); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * fill(255, 0, 0); - * box(50); - * }); - * - * background(100); - * // Draw the framebuffer to the main canvas - * image(framebuffer, -50, -50, 25, 25); - * image(framebuffer, 0, 0, 35, 35); - * } - * - *
                                  - * - * @alt - * A video of a floating and rotating red cube is pasted twice on the - * canvas: once in the top left, and again, larger, in the bottom right. - */, - }, - { - key: "draw", - value: function draw(callback) { - this.begin(); - callback(); - this.end(); - } /** - * Call this befpre updating pixels - * and calling updatePixels - * to replace the content of the framebuffer with the data in the pixels - * array. - */, - }, - { - key: "loadPixels", - value: function loadPixels() { - var gl = this.gl; - var prevFramebuffer = - this.target._renderer.activeFramebuffer(); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); - var colorFormat = this._glColorFormat(); - this.pixels = (0, _p2.readPixelsWebGL)( - this.pixels, - gl, - this.framebuffer, - 0, - 0, - this.width * this.density, - this.height * this.density, - colorFormat.format, - colorFormat.type, - ); - if (prevFramebuffer) { - gl.bindFramebuffer( - gl.FRAMEBUFFER, - prevFramebuffer._framebufferToBind(), - ); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - } - } /** - * Get a region of pixels from the canvas in the form of a - * p5.Image, or a single pixel as an array of - * numbers. - * - * Returns an array of [R,G,B,A] values for any pixel or grabs a section of - * an image. If the Framebuffer has been set up to not store alpha values, then - * only [R,G,B] will be returned. If no parameters are specified, the entire - * image is returned. - * Use the x and y parameters to get the value of one pixel. Get a section of - * the display window by specifying additional w and h parameters. When - * getting an image, the x and y parameters define the coordinates for the - * upper-left corner of the image, regardless of the current imageMode(). - * - * @method get - * @param {Number} x x-coordinate of the pixel - * @param {Number} y y-coordinate of the pixel - * @param {Number} w width of the section to be returned - * @param {Number} h height of the section to be returned - * @return {p5.Image} the rectangle p5.Image - */, - /** - * @method get - * @return {p5.Image} the whole p5.Image - */ - /** - * @method get - * @param {Number} x - * @param {Number} y - * @return {Number[]} color of pixel at x,y in array format [R, G, B, A] - */ - }, - { - key: "get", - value: function get(x, y, w, h) { - _main.default._validateParameters( - "p5.Framebuffer.get", - arguments, - ); - var colorFormat = this._glColorFormat(); - if (x === undefined && y === undefined) { - x = 0; - y = 0; - w = this.width; - h = this.height; - } else if (w === undefined && h === undefined) { - if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - console.warn( - "The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped.", - ); - x = this.target.constrain(x, 0, this.width - 1); - y = this.target.constrain(y, 0, this.height - 1); - } - return (0, _p2.readPixelWebGL)( - this.gl, - this.framebuffer, - x * this.density, - y * this.density, - colorFormat.format, - colorFormat.type, - ); - } - x = this.target.constrain(x, 0, this.width - 1); - y = this.target.constrain(y, 0, this.height - 1); - w = this.target.constrain(w, 1, this.width - x); - h = this.target.constrain(h, 1, this.height - y); - var rawData = (0, _p2.readPixelsWebGL)( - undefined, - this.gl, - this.framebuffer, - x * this.density, - y * this.density, - w * this.density, - h * this.density, - colorFormat.format, - colorFormat.type, - ); - // Framebuffer data might be either a Uint8Array or Float32Array - // depending on its format, and it may or may not have an alpha channel. - // To turn it into an image, we have to normalize the data into a - // Uint8ClampedArray with alpha. - var fullData = new Uint8ClampedArray( - w * h * this.density * this.density * 4, - ); - // Default channels that aren't in the framebuffer (e.g. alpha, if the - // framebuffer is in RGB mode instead of RGBA) to 255 - fullData.fill(255); - var channels = colorFormat.type === this.gl.RGB ? 3 : 4; - for (var _y = 0; _y < h * this.density; _y++) { - for (var _x = 0; _x < w * this.density; _x++) { - for (var channel = 0; channel < 4; channel++) { - var idx = (_y * w * this.density + _x) * 4 + channel; - if (channel < channels) { - // Find the index of this pixel in `rawData`, which might have a - // different number of channels - var rawDataIdx = - channels === 4 - ? idx - : (_y * w * this.density + _x) * channels + - channel; - fullData[idx] = rawData[rawDataIdx]; - } - } - } - } // Create an image from the data - - var region = new _main.default.Image( - w * this.density, - h * this.density, - ); - region.imageData = region.canvas - .getContext("2d") - .createImageData(region.width, region.height); - region.imageData.data.set(fullData); - region.pixels = region.imageData.data; - region.updatePixels(); - if (this.density !== 1) { - // TODO: support get() at a pixel density > 1 - region.resize(w, h); - } - return region; - } /** - * Call this after initially calling - * loadPixels() and updating pixels - * to replace the content of the framebuffer with the data in the pixels - * array. - * - * This will also clear the depth buffer so that any future drawing done - * afterwards will go on top. - * - * @example - *
                                  - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * } - * function draw() { - * noStroke(); - * lights(); - * - * // Draw a sphere to the framebuffer - * framebuffer.begin(); - * background(0); - * sphere(25); - * framebuffer.end(); - * - * // Load its pixels and draw a gradient over the lower half of the canvas - * framebuffer.loadPixels(); - * for (let y = height/2; y < height; y++) { - * for (let x = 0; x < width; x++) { - * const idx = (y * width + x) * 4; - * framebuffer.pixels[idx] = (x / width) * 255; - * framebuffer.pixels[idx + 1] = (y / height) * 255; - * framebuffer.pixels[idx + 2] = 255; - * framebuffer.pixels[idx + 3] = 255; - * } - * } - * framebuffer.updatePixels(); - * - * // Draw a cube on top of the pixels we just wrote - * framebuffer.begin(); - * push(); - * translate(20, 20); - * rotateX(0.5); - * rotateY(0.5); - * box(20); - * pop(); - * framebuffer.end(); - * - * image(framebuffer, -width/2, -height/2); - * noLoop(); - * } - * - *
                                  - * - * @alt - * A sphere partly occluded by a gradient from cyan to white to magenta on - * the lower half of the canvas, with a 3D cube drawn on top of that in the - * lower right corner. - */, - }, - { - key: "updatePixels", - value: function updatePixels() { - var gl = this.gl; - this.colorP5Texture.bindTexture(); - var colorFormat = this._glColorFormat(); - var channels = colorFormat.format === gl.RGBA ? 4 : 3; - var len = - this.width * - this.height * - this.density * - this.density * - channels; - var TypedArrayClass = - colorFormat.type === gl.UNSIGNED_BYTE - ? Uint8Array - : Float32Array; - if ( - !(this.pixels instanceof TypedArrayClass) || - this.pixels.length !== len - ) { - throw new Error( - "The pixels array has not been set correctly. Please call loadPixels() before updatePixels().", - ); - } - gl.texImage2D( - gl.TEXTURE_2D, - 0, - colorFormat.internalFormat, - this.width * this.density, - this.height * this.density, - 0, - colorFormat.format, - colorFormat.type, - this.pixels, - ); - this.colorP5Texture.unbindTexture(); - var prevFramebuffer = - this.target._renderer.activeFramebuffer(); - if (this.antialias) { - // We need to make sure the antialiased framebuffer also has the updated - // pixels so that if more is drawn to it, it goes on top of the updated - // pixels instead of replacing them. - // We can't blit the framebuffer to the multisampled antialias - // framebuffer to leave both in the same state, so instead we have - // to use image() to put the framebuffer texture onto the antialiased - // framebuffer. - this.begin(); - this.target.push(); - this.target.imageMode(this.target.CENTER); - this.target.resetMatrix(); - this.target.noStroke(); - this.target.clear(); - this.target.image(this, 0, 0); - this.target.pop(); - if (this.useDepth) { - gl.clearDepth(1); - gl.clear(gl.DEPTH_BUFFER_BIT); - } - this.end(); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); - if (this.useDepth) { - gl.clearDepth(1); - gl.clear(gl.DEPTH_BUFFER_BIT); - } - if (prevFramebuffer) { - gl.bindFramebuffer( - gl.FRAMEBUFFER, - prevFramebuffer._framebufferToBind(), - ); - } else { - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - } - } - }, - }, - ]); - return Framebuffer; - })(); - /** - * A texture with the color information of the framebuffer. Pass this (or the - * framebuffer itself) to texture() to draw it to - * the canvas, or pass it to a shader with - * setUniform() to read its data. - * - * Since Framebuffers are controlled by WebGL, their y coordinates are stored - * flipped compared to images and videos. When texturing with a framebuffer - * texture, you may want to flip vertically, e.g. with - * `plane(framebuffer.width, -framebuffer.height)`. - * - * @property {p5.FramebufferTexture} color - * @for p5.Framebuffer - * - * @example - *
                                  - * - * let framebuffer; - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * normalMaterial(); - * sphere(20); - * framebuffer.end(); - * - * // Draw the framebuffer to the main canvas - * image(framebuffer.color, -width/2, -height/2); - * } - * - *
                                  - * - * @alt - * A red, green, and blue sphere in the middle of the canvas - */ - /** - * A texture with the depth information of the framebuffer. If the framebuffer - * was created with `{ depth: false }` in its settings, then this property will - * be undefined. Pass this to texture() to draw it to - * the canvas, or pass it to a shader with - * setUniform() to read its data. - * - * Since Framebuffers are controlled by WebGL, their y coordinates are stored - * flipped compared to images and videos. When texturing with a framebuffer - * texture, you may want to flip vertically, e.g. with - * `plane(framebuffer.width, -framebuffer.height)`. - * - * @property {p5.FramebufferTexture|undefined} depth - * @for p5.Framebuffer - * - * @example - *
                                  - * - * let framebuffer; - * let depthShader; - * - * const vert = ` - * precision highp float; - * attribute vec3 aPosition; - * attribute vec2 aTexCoord; - * uniform mat4 uModelViewMatrix; - * uniform mat4 uProjectionMatrix; - * varying vec2 vTexCoord; - * void main() { - * vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0); - * gl_Position = uProjectionMatrix * viewModelPosition; - * vTexCoord = aTexCoord; - * } - * `; - * - * const frag = ` - * precision highp float; - * varying vec2 vTexCoord; - * uniform sampler2D depth; - * void main() { - * float depthVal = texture2D(depth, vTexCoord).r; - * gl_FragColor = mix( - * vec4(1., 1., 0., 1.), // yellow - * vec4(0., 0., 1., 1.), // blue - * pow(depthVal, 6.) - * ); - * } - * `; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * framebuffer = createFramebuffer(); - * depthShader = createShader(vert, frag); - * noStroke(); - * } - * - * function draw() { - * // Draw to the framebuffer - * framebuffer.begin(); - * background(255); - * rotateX(frameCount * 0.01); - * box(20, 20, 100); - * framebuffer.end(); - * - * push(); - * shader(depthShader); - * depthShader.setUniform('depth', framebuffer.depth); - * plane(framebuffer.width, framebuffer.height); - * pop(); - * } - * - *
                                  - * - * @alt - * A video of a rectangular prism rotating, with parts closest to the camera - * appearing yellow and colors getting progressively more blue the farther - * from the camera they go - */ - _main.default.Framebuffer = Framebuffer; - var _default = Framebuffer; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.RendererGL": 355, - "./p5.Texture": 357, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.reflect.get": 203, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.float32-array": 229, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/es.typed-array.uint8-clamped-array": 253, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 350: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.sub"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.for-each"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.sub"); - _dereq_("core-js/modules/web.dom-collections.for-each"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @module Shape - * @submodule 3D Primitives - * @for p5 - * @requires core - * @requires p5.Geometry - */ - //some of the functions are adjusted from Three.js(http://threejs.org) - /** - * p5 Geometry class - * @class p5.Geometry - * @constructor - * @param {Integer} [detailX] number of vertices along the x-axis. - * @param {Integer} [detailY] number of vertices along the y-axis. - * @param {function} [callback] function to call upon object instantiation. - */ - - _main.default.Geometry = /*#__PURE__*/ (function () { - function Geometry(detailX, detailY, callback) { - _classCallCheck(this, Geometry); - //an array containing every vertex - //@type [p5.Vector] - this.vertices = []; - //an array containing every vertex for stroke drawing - this.lineVertices = new _main.default.DataArray(); - // The tangents going into or out of a vertex on a line. Along a straight - // line segment, both should be equal. At an endpoint, one or the other - // will not exist and will be all 0. In joins between line segments, they - // may be different, as they will be the tangents on either side of the join. - this.lineTangentsIn = new _main.default.DataArray(); - this.lineTangentsOut = new _main.default.DataArray(); - // When drawing lines with thickness, entries in this buffer represent which - // side of the centerline the vertex will be placed. The sign of the number - // will represent the side of the centerline, and the absolute value will be - // used as an enum to determine which part of the cap or join each vertex - // represents. See the doc comments for _addCap and _addJoin for diagrams. - this.lineSides = new _main.default.DataArray(); - //an array containing 1 normal per vertex - //@type [p5.Vector] - //[p5.Vector, p5.Vector, p5.Vector,p5.Vector, p5.Vector, p5.Vector,...] - this.vertexNormals = []; - //an array containing each three vertex indices that form a face - //[[0, 1, 2], [2, 1, 3], ...] - this.faces = []; - //a 2D array containing uvs for every vertex - //[[0.0,0.0],[1.0,0.0], ...] - this.uvs = []; - // a 2D array containing edge connectivity pattern for create line vertices - //based on faces for most objects; - this.edges = []; - this.vertexColors = []; - // One color per vertex representing the stroke color at that vertex - this.vertexStrokeColors = []; - // One color per line vertex, generated automatically based on - // vertexStrokeColors in _edgesToVertices() - this.lineVertexColors = new _main.default.DataArray(); - this.detailX = detailX !== undefined ? detailX : 1; - this.detailY = detailY !== undefined ? detailY : 1; - this.dirtyFlags = {}; - if (callback instanceof Function) { - callback.call(this); - } - return this; // TODO: is this a constructor? - } - _createClass(Geometry, [ - { - key: "reset", - value: function reset() { - this.lineVertices.clear(); - this.lineTangentsIn.clear(); - this.lineTangentsOut.clear(); - this.lineSides.clear(); - this.vertices.length = 0; - this.edges.length = 0; - this.vertexColors.length = 0; - this.vertexStrokeColors.length = 0; - this.lineVertexColors.clear(); - this.vertexNormals.length = 0; - this.uvs.length = 0; - this.dirtyFlags = {}; - } /** - * Removes the internal colors of p5.Geometry. - * Using `clearColors()`, you can use `fill()` to supply new colors before drawing each shape. - * If `clearColors()` is not used, the shapes will use their internal colors by ignoring `fill()`. - * - * @method clearColors - * - * @example - *
                                  - * - * let shape01; - * let shape02; - * let points = []; - * - * function setup() { - * createCanvas(600, 600, WEBGL); - * points.push(new p5.Vector(-1, -1, 0), new p5.Vector(-1, 1, 0), - * new p5.Vector(1, -1, 0), new p5.Vector(-1, -1, 0)); - * buildShape01(); - * buildShape02(); - * } - * function draw() { - * background(0); - * fill('pink'); // shape01 retains its internal blue color, so it won't turn pink. - * model(shape01); - * fill('yellow'); // Now, shape02 is yellow. - * model(shape02); - * } - * - * function buildShape01() { - * beginGeometry(); - * fill('blue'); // shape01's color is blue because its internal colors remain. - * beginShape(); - * for (let vec of points) vertex(vec.x * 100, vec.y * 100, vec.z * 100); - * endShape(CLOSE); - * shape01 = endGeometry(); - * } - * - * function buildShape02() { - * beginGeometry(); - * fill('red'); // shape02.clearColors() removes its internal colors. Now, shape02 is red. - * beginShape(); - * for (let vec of points) vertex(vec.x * 200, vec.y * 200, vec.z * 200); - * endShape(CLOSE); - * shape02 = endGeometry(); - * shape02.clearColors(); // Resets shape02's colors. - * } - * - *
                                  - */, - }, - { - key: "clearColors", - value: function clearColors() { - this.vertexColors = []; - return this; - } /** - * computes faces for geometry objects based on the vertices. - * @method computeFaces - * @chainable - */, - }, - { - key: "computeFaces", - value: function computeFaces() { - this.faces.length = 0; - var sliceCount = this.detailX + 1; - var a, b, c, d; - for (var i = 0; i < this.detailY; i++) { - for (var j = 0; j < this.detailX; j++) { - a = i * sliceCount + j; // + offset; - b = i * sliceCount + j + 1; // + offset; - c = (i + 1) * sliceCount + j + 1; // + offset; - d = (i + 1) * sliceCount + j; // + offset; - this.faces.push([a, b, d]); - this.faces.push([d, b, c]); - } - } - return this; - }, - }, - { - key: "_getFaceNormal", - value: function _getFaceNormal(faceId) { - //This assumes that vA->vB->vC is a counter-clockwise ordering - var face = this.faces[faceId]; - var vA = this.vertices[face[0]]; - var vB = this.vertices[face[1]]; - var vC = this.vertices[face[2]]; - var ab = _main.default.Vector.sub(vB, vA); - var ac = _main.default.Vector.sub(vC, vA); - var n = _main.default.Vector.cross(ab, ac); - var ln = _main.default.Vector.mag(n); - var sinAlpha = - ln / - (_main.default.Vector.mag(ab) * - _main.default.Vector.mag(ac)); - if (sinAlpha === 0 || isNaN(sinAlpha)) { - console.warn( - "p5.Geometry.prototype._getFaceNormal:", - "face has colinear sides or a repeated vertex", - ); - return n; - } - if (sinAlpha > 1) sinAlpha = 1; // handle float rounding error - return n.mult(Math.asin(sinAlpha) / ln); - } /** - * This function calculates normals for each face, where each vertex's normal is the average of the normals of all faces it's connected to. - * i.e computes smooth normals per vertex as an average of each face. - * - * When using `FLAT` shading, vertices are disconnected/duplicated i.e each face has its own copy of vertices. - * When using `SMOOTH` shading, vertices are connected/deduplicated i.e each face has its vertices shared with other faces. - * - * Options can include: - * - `roundToPrecision`: Precision value for rounding computations. Defaults to 3. - * - * @method computeNormals - * @param {String} [shadingType] shading type (`FLAT` for flat shading or `SMOOTH` for smooth shading) for buildGeometry() outputs. Defaults to `FLAT`. - * @param {Object} [options] An optional object with configuration. - * @chainable - * - * @example - *
                                  - * - * let helix; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * helix = buildGeometry(() => { - * beginShape(); - * - * for (let i = 0; i < TWO_PI * 3; i += 0.6) { - * let radius = 20; - * let x = cos(i) * radius; - * let y = sin(i) * radius; - * let z = map(i, 0, TWO_PI * 3, -30, 30); - * vertex(x, y, z); - * } - * endShape(); - * }); - * helix.computeNormals(); - * } - * function draw() { - * background(255); - * stroke(0); - * fill(150, 200, 250); - * lights(); - * rotateX(PI*0.2); - * orbitControl(); - * model(helix); - * } - * - *
                                  - * - * @alt - * A 3D helix using the computeNormals() function by default uses `FLAT` to create a flat shading effect on the helix. - * - * @example - *
                                  - * - * let star; - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * - * star = buildGeometry(() => { - * beginShape(); - * for (let i = 0; i < TWO_PI; i += PI / 5) { - * let outerRadius = 60; - * let innerRadius = 30; - * let xOuter = cos(i) * outerRadius; - * let yOuter = sin(i) * outerRadius; - * let zOuter = random(-20, 20); - * vertex(xOuter, yOuter, zOuter); - * - * let nextI = i + PI / 5 / 2; - * let xInner = cos(nextI) * innerRadius; - * let yInner = sin(nextI) * innerRadius; - * let zInner = random(-20, 20); - * vertex(xInner, yInner, zInner); - * } - * endShape(CLOSE); - * }); - * star.computeNormals(SMOOTH); - * } - * function draw() { - * background(255); - * stroke(0); - * fill(150, 200, 250); - * lights(); - * rotateX(PI*0.2); - * orbitControl(); - * model(star); - * } - * - *
                                  - * - * @alt - * A star-like geometry, here the computeNormals(SMOOTH) is applied for a smooth shading effect. - * This helps to avoid the faceted appearance that can occur with flat shading. - */, - }, - { - key: "computeNormals", - value: function computeNormals() { - var _this = this; - var shadingType = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : constants.FLAT; - var _ref = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : {}, - _ref$roundToPrecision = _ref.roundToPrecision, - roundToPrecision = - _ref$roundToPrecision === void 0 - ? 3 - : _ref$roundToPrecision; - var vertexNormals = this.vertexNormals; - var vertices = this.vertices; - var faces = this.faces; - var iv; - if (shadingType === constants.SMOOTH) { - var vertexIndices = {}; - var uniqueVertices = []; - var power = Math.pow(10, roundToPrecision); - var rounded = function rounded(val) { - return Math.round(val * power) / power; - }; - var getKey = function getKey(vert) { - return "" - .concat(rounded(vert.x), ",") - .concat(rounded(vert.y), ",") - .concat(rounded(vert.z)); - }; - // loop through each vertex and add uniqueVertices - for (var i = 0; i < vertices.length; i++) { - var vertex = vertices[i]; - var key = getKey(vertex); - if (vertexIndices[key] === undefined) { - vertexIndices[key] = uniqueVertices.length; - uniqueVertices.push(vertex); - } - } // update face indices to use the deduplicated vertex indices - - faces.forEach(function (face) { - for (var fv = 0; fv < 3; ++fv) { - var originalVertexIndex = face[fv]; - var originalVertex = vertices[originalVertexIndex]; - var _key = getKey(originalVertex); - face[fv] = vertexIndices[_key]; - } - }); - // update edge indices to use the deduplicated vertex indices - this.edges.forEach(function (edge) { - for (var ev = 0; ev < 2; ++ev) { - var originalVertexIndex = edge[ev]; - var originalVertex = vertices[originalVertexIndex]; - var _key2 = getKey(originalVertex); - edge[ev] = vertexIndices[_key2]; - } - }); - // update the deduplicated vertices - this.vertices = vertices = uniqueVertices; - } // initialize the vertexNormals array with empty vectors - - vertexNormals.length = 0; - for (iv = 0; iv < vertices.length; ++iv) { - vertexNormals.push(new _main.default.Vector()); - } // loop through all the faces adding its normal to the normal - // of each of its vertices - - faces.forEach(function (face, f) { - var faceNormal = _this._getFaceNormal(f); - // all three vertices get the normal added - for (var fv = 0; fv < 3; ++fv) { - var vertexIndex = face[fv]; - vertexNormals[vertexIndex].add(faceNormal); - } - }); - // normalize the normals - for (iv = 0; iv < vertices.length; ++iv) { - vertexNormals[iv].normalize(); - } - return this; - } /** - * Averages the vertex normals. Used in curved - * surfaces - * @method averageNormals - * @chainable - */, - }, - { - key: "averageNormals", - value: function averageNormals() { - for (var i = 0; i <= this.detailY; i++) { - var offset = this.detailX + 1; - var temp = _main.default.Vector.add( - this.vertexNormals[i * offset], - this.vertexNormals[i * offset + this.detailX], - ); - temp = _main.default.Vector.div(temp, 2); - this.vertexNormals[i * offset] = temp; - this.vertexNormals[i * offset + this.detailX] = temp; - } - return this; - } /** - * Averages pole normals. Used in spherical primitives - * @method averagePoleNormals - * @chainable - */, - }, - { - key: "averagePoleNormals", - value: function averagePoleNormals() { - //average the north pole - var sum = new _main.default.Vector(0, 0, 0); - for (var i = 0; i < this.detailX; i++) { - sum.add(this.vertexNormals[i]); - } - sum = _main.default.Vector.div(sum, this.detailX); - for (var _i = 0; _i < this.detailX; _i++) { - this.vertexNormals[_i] = sum; - } //average the south pole - - sum = new _main.default.Vector(0, 0, 0); - for ( - var _i2 = this.vertices.length - 1; - _i2 > this.vertices.length - 1 - this.detailX; - _i2-- - ) { - sum.add(this.vertexNormals[_i2]); - } - sum = _main.default.Vector.div(sum, this.detailX); - for ( - var _i3 = this.vertices.length - 1; - _i3 > this.vertices.length - 1 - this.detailX; - _i3-- - ) { - this.vertexNormals[_i3] = sum; - } - return this; - } /** - * Create a 2D array for establishing stroke connections - * @private - * @chainable - */, - }, - { - key: "_makeTriangleEdges", - value: function _makeTriangleEdges() { - this.edges.length = 0; - for (var j = 0; j < this.faces.length; j++) { - this.edges.push([this.faces[j][0], this.faces[j][1]]); - this.edges.push([this.faces[j][1], this.faces[j][2]]); - this.edges.push([this.faces[j][2], this.faces[j][0]]); - } - return this; - } /** - * Converts each line segment into the vertices and vertex attributes needed - * to turn the line into a polygon on screen. This will include: - * - Two triangles line segment to create a rectangle - * - Two triangles per endpoint to create a stroke cap rectangle. A fragment - * shader is responsible for displaying the appropriate cap style within - * that rectangle. - * - Four triangles per join between adjacent line segments, creating a quad on - * either side of the join, perpendicular to the lines. A vertex shader will - * discard the quad in the "elbow" of the join, and a fragment shader will - * display the appropriate join style within the remaining quad. - * - * @private - * @chainable - */, - }, - { - key: "_edgesToVertices", - value: function _edgesToVertices() { - this.lineVertices.clear(); - this.lineTangentsIn.clear(); - this.lineTangentsOut.clear(); - this.lineSides.clear(); - var potentialCaps = new Map(); - var connected = new Set(); - var lastValidDir; - for (var i = 0; i < this.edges.length; i++) { - var prevEdge = this.edges[i - 1]; - var currEdge = this.edges[i]; - var begin = this.vertices[currEdge[0]]; - var end = this.vertices[currEdge[1]]; - var fromColor = - this.vertexStrokeColors.length > 0 - ? this.vertexStrokeColors.slice( - currEdge[0] * 4, - (currEdge[0] + 1) * 4, - ) - : [0, 0, 0, 0]; - var toColor = - this.vertexStrokeColors.length > 0 - ? this.vertexStrokeColors.slice( - currEdge[1] * 4, - (currEdge[1] + 1) * 4, - ) - : [0, 0, 0, 0]; - var dir = end.copy().sub(begin).normalize(); - var dirOK = dir.magSq() > 0; - if (dirOK) { - this._addSegment(begin, end, fromColor, toColor, dir); - } - if (i > 0 && prevEdge[1] === currEdge[0]) { - if (!connected.has(currEdge[0])) { - connected.add(currEdge[0]); - potentialCaps.delete(currEdge[0]); - // Add a join if this segment shares a vertex with the previous. Skip - // actually adding join vertices if either the previous segment or this - // one has a length of 0. - // - // Don't add a join if the tangents point in the same direction, which - // would mean the edges line up exactly, and there is no need for a join. - if ( - lastValidDir && - dirOK && - dir.dot(lastValidDir) < 1 - 1e-8 - ) { - this._addJoin(begin, lastValidDir, dir, fromColor); - } - } - } else { - // Start a new line - if (dirOK && !connected.has(currEdge[0])) { - var existingCap = potentialCaps.get(currEdge[0]); - if (existingCap) { - this._addJoin(begin, existingCap.dir, dir, fromColor); - potentialCaps.delete(currEdge[0]); - connected.add(currEdge[0]); - } else { - potentialCaps.set(currEdge[0], { - point: begin, - dir: dir.copy().mult(-1), - color: fromColor, - }); - } - } - if (lastValidDir && !connected.has(prevEdge[1])) { - var _existingCap = potentialCaps.get(prevEdge[1]); - if (_existingCap) { - this._addJoin( - this.vertices[prevEdge[1]], - lastValidDir, - _existingCap.dir.copy().mult(-1), - fromColor, - ); - potentialCaps.delete(prevEdge[1]); - connected.add(prevEdge[1]); - } else { - // Close off the last segment with a cap - potentialCaps.set(prevEdge[1], { - point: this.vertices[prevEdge[1]], - dir: lastValidDir, - color: fromColor, - }); - } - lastValidDir = undefined; - } - } - if ( - i === this.edges.length - 1 && - !connected.has(currEdge[1]) - ) { - var _existingCap2 = potentialCaps.get(currEdge[1]); - if (_existingCap2) { - this._addJoin( - end, - dir, - _existingCap2.dir.copy().mult(-1), - toColor, - ); - potentialCaps.delete(currEdge[1]); - connected.add(currEdge[1]); - } else { - potentialCaps.set(currEdge[1], { - point: end, - dir: dir, - color: toColor, - }); - } - } - if (dirOK) { - lastValidDir = dir; - } - } - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = potentialCaps.values()[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var _step$value = _step.value, - point = _step$value.point, - _dir = _step$value.dir, - color = _step$value.color; - this._addCap(point, _dir, color); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return this; - } /** - * Adds the vertices and vertex attributes for two triangles making a rectangle - * for a straight line segment. A vertex shader is responsible for picking - * proper coordinates on the screen given the centerline positions, the tangent, - * and the side of the centerline each vertex belongs to. Sides follow the - * following scheme: - * - * -1 -1 - * o-------------o - * | | - * o-------------o - * 1 1 - * - * @private - * @chainable - */, - }, - { - key: "_addSegment", - value: function _addSegment( - begin, - end, - fromColor, - toColor, - dir, - ) { - var _this$lineVertices, _this$lineVertexColor; - var a = begin.array(); - var b = end.array(); - var dirArr = dir.array(); - this.lineSides.push(1, 1, -1, 1, -1, -1); - for ( - var _i4 = 0, - _arr = [this.lineTangentsIn, this.lineTangentsOut]; - _i4 < _arr.length; - _i4++ - ) { - var tangents = _arr[_i4]; - for (var i = 0; i < 6; i++) { - tangents.push.apply(tangents, _toConsumableArray(dirArr)); - } - } - (_this$lineVertices = this.lineVertices).push.apply( - _this$lineVertices, - _toConsumableArray(a).concat( - _toConsumableArray(b), - _toConsumableArray(a), - _toConsumableArray(b), - _toConsumableArray(b), - _toConsumableArray(a), - ), - ); - (_this$lineVertexColor = this.lineVertexColors).push.apply( - _this$lineVertexColor, - _toConsumableArray(fromColor).concat( - _toConsumableArray(toColor), - _toConsumableArray(fromColor), - _toConsumableArray(toColor), - _toConsumableArray(toColor), - _toConsumableArray(fromColor), - ), - ); - return this; - } /** - * Adds the vertices and vertex attributes for two triangles representing the - * stroke cap of a line. A fragment shader is responsible for displaying the - * appropriate cap style within the rectangle they make. - * - * The lineSides buffer will include the following values for the points on - * the cap rectangle: - * - * -1 -2 - * -----------o---o - * | | - * -----------o---o - * 1 2 - * @private - * @chainable - */, - }, - { - key: "_addCap", - value: function _addCap(point, tangent, color) { - var ptArray = point.array(); - var tanInArray = tangent.array(); - var tanOutArray = [0, 0, 0]; - for (var i = 0; i < 6; i++) { - var _this$lineVertices2, - _this$lineTangentsIn, - _this$lineTangentsOut, - _this$lineVertexColor2; - (_this$lineVertices2 = this.lineVertices).push.apply( - _this$lineVertices2, - _toConsumableArray(ptArray), - ); - (_this$lineTangentsIn = this.lineTangentsIn).push.apply( - _this$lineTangentsIn, - _toConsumableArray(tanInArray), - ); - (_this$lineTangentsOut = this.lineTangentsOut).push.apply( - _this$lineTangentsOut, - tanOutArray, - ); - (_this$lineVertexColor2 = this.lineVertexColors).push.apply( - _this$lineVertexColor2, - _toConsumableArray(color), - ); - } - this.lineSides.push(-1, 2, -2, 1, 2, -1); - return this; - } /** - * Adds the vertices and vertex attributes for four triangles representing a - * join between two adjacent line segments. This creates a quad on either side - * of the shared vertex of the two line segments, with each quad perpendicular - * to the lines. A vertex shader will discard all but the quad in the "elbow" of - * the join, and a fragment shader will display the appropriate join style - * within the remaining quad. - * - * The lineSides buffer will include the following values for the points on - * the join rectangles: - * - * -1 -2 - * -------------o----o - * | | - * 1 o----o----o -3 - * | | 0 | - * --------o----o | - * 2| 3 | - * | | - * | | - * @private - * @chainable - */, - }, - { - key: "_addJoin", - value: function _addJoin(point, fromTangent, toTangent, color) { - var ptArray = point.array(); - var tanInArray = fromTangent.array(); - var tanOutArray = toTangent.array(); - for (var i = 0; i < 12; i++) { - var _this$lineVertices3, - _this$lineTangentsIn2, - _this$lineTangentsOut2, - _this$lineVertexColor3; - (_this$lineVertices3 = this.lineVertices).push.apply( - _this$lineVertices3, - _toConsumableArray(ptArray), - ); - (_this$lineTangentsIn2 = this.lineTangentsIn).push.apply( - _this$lineTangentsIn2, - _toConsumableArray(tanInArray), - ); - (_this$lineTangentsOut2 = this.lineTangentsOut).push.apply( - _this$lineTangentsOut2, - _toConsumableArray(tanOutArray), - ); - (_this$lineVertexColor3 = this.lineVertexColors).push.apply( - _this$lineVertexColor3, - _toConsumableArray(color), - ); - } - this.lineSides.push(-1, -3, -2, -1, 0, -3); - this.lineSides.push(3, 1, 2, 3, 0, 1); - return this; - } /** - * Modifies all vertices to be centered within the range -100 to 100. - * @method normalize - * @chainable - */, - }, - { - key: "normalize", - value: function normalize() { - if (this.vertices.length > 0) { - // Find the corners of our bounding box - var maxPosition = this.vertices[0].copy(); - var minPosition = this.vertices[0].copy(); - for (var i = 0; i < this.vertices.length; i++) { - maxPosition.x = Math.max( - maxPosition.x, - this.vertices[i].x, - ); - minPosition.x = Math.min( - minPosition.x, - this.vertices[i].x, - ); - maxPosition.y = Math.max( - maxPosition.y, - this.vertices[i].y, - ); - minPosition.y = Math.min( - minPosition.y, - this.vertices[i].y, - ); - maxPosition.z = Math.max( - maxPosition.z, - this.vertices[i].z, - ); - minPosition.z = Math.min( - minPosition.z, - this.vertices[i].z, - ); - } - var center = _main.default.Vector.lerp( - maxPosition, - minPosition, - 0.5, - ); - var dist = _main.default.Vector.sub( - maxPosition, - minPosition, - ); - var longestDist = Math.max( - Math.max(dist.x, dist.y), - dist.z, - ); - var scale = 200 / longestDist; - for (var _i5 = 0; _i5 < this.vertices.length; _i5++) { - this.vertices[_i5].sub(center); - this.vertices[_i5].mult(scale); - } - } - return this; - }, - }, - ]); - return Geometry; - })(); - var _default = _main.default.Geometry; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.for-each": 175, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.map": 187, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.set": 207, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.sub": 218, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.for-each": 255, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 351: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * @requires constants - * @todo see methods below needing further implementation. - * future consideration: implement SIMD optimizations - * when browser compatibility becomes available - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/ - * Reference/Global_Objects/SIMD - */ - - var GLMAT_ARRAY_TYPE = Array; - var isMatrixArray = function isMatrixArray(x) { - return Array.isArray(x); - }; - if (typeof Float32Array !== "undefined") { - GLMAT_ARRAY_TYPE = Float32Array; - isMatrixArray = function isMatrixArray(x) { - return Array.isArray(x) || x instanceof Float32Array; - }; - } /** - * A class to describe a 4×4 matrix - * for model and view matrix manipulation in the p5js webgl renderer. - * @class p5.Matrix - * @private - * @constructor - * @param {Array} [mat4] column-major array literal of our 4×4 matrix - */ - - _main.default.Matrix = /*#__PURE__*/ (function () { - function _class() { - var _ref; - _classCallCheck(this, _class); - // This is default behavior when object - // instantiated using createMatrix() - // @todo implement createMatrix() in core/math.js - if ( - arguments.length && - ((_ref = arguments.length - 1), - _ref < 0 || arguments.length <= _ref - ? undefined - : arguments[_ref]) instanceof _main.default - ) { - var _ref2; - this.p5 = - ((_ref2 = arguments.length - 1), - _ref2 < 0 || arguments.length <= _ref2 - ? undefined - : arguments[_ref2]); - } - if ( - (arguments.length <= 0 ? undefined : arguments[0]) === "mat3" - ) { - this.mat3 = Array.isArray( - arguments.length <= 1 ? undefined : arguments[1], - ) - ? arguments.length <= 1 - ? undefined - : arguments[1] - : new GLMAT_ARRAY_TYPE([1, 0, 0, 0, 1, 0, 0, 0, 1]); - } else { - this.mat4 = Array.isArray( - arguments.length <= 0 ? undefined : arguments[0], - ) - ? arguments.length <= 0 - ? undefined - : arguments[0] - : new GLMAT_ARRAY_TYPE([ - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, - ]); - } - return this; - } /** - * Sets the x, y, and z component of the vector using two or three separate - * variables, the data from a p5.Matrix, or the values from a float array. - * - * @method set - * @param {p5.Matrix|Float32Array|Number[]} [inMatrix] the input p5.Matrix or - * an Array of length 16 - * @chainable - */ - /** - * @method set - * @param {Number[]} elements 16 numbers passed by value to avoid - * array copying. - * @chainable - */ - - _createClass( - _class, - [ - { - key: "set", - value: function set(inMatrix) { - if (inMatrix instanceof _main.default.Matrix) { - this.mat4 = inMatrix.mat4; - return this; - } else if (isMatrixArray(inMatrix)) { - this.mat4 = inMatrix; - return this; - } else if (arguments.length === 16) { - this.mat4[0] = arguments[0]; - this.mat4[1] = arguments[1]; - this.mat4[2] = arguments[2]; - this.mat4[3] = arguments[3]; - this.mat4[4] = arguments[4]; - this.mat4[5] = arguments[5]; - this.mat4[6] = arguments[6]; - this.mat4[7] = arguments[7]; - this.mat4[8] = arguments[8]; - this.mat4[9] = arguments[9]; - this.mat4[10] = arguments[10]; - this.mat4[11] = arguments[11]; - this.mat4[12] = arguments[12]; - this.mat4[13] = arguments[13]; - this.mat4[14] = arguments[14]; - this.mat4[15] = arguments[15]; - } - return this; - } /** - * Gets a copy of the vector, returns a p5.Matrix object. - * - * @method get - * @return {p5.Matrix} the copy of the p5.Matrix object - */, - }, - { - key: "get", - value: function get() { - return new _main.default.Matrix(this.mat4, this.p5); - } /** - * return a copy of this matrix. - * If this matrix is 4x4, a 4x4 matrix with exactly the same entries will be - * generated. The same is true if this matrix is 3x3. - * - * @method copy - * @return {p5.Matrix} the result matrix - */, - }, - { - key: "copy", - value: function copy() { - if (this.mat3 !== undefined) { - var copied3x3 = new _main.default.Matrix("mat3", this.p5); - copied3x3.mat3[0] = this.mat3[0]; - copied3x3.mat3[1] = this.mat3[1]; - copied3x3.mat3[2] = this.mat3[2]; - copied3x3.mat3[3] = this.mat3[3]; - copied3x3.mat3[4] = this.mat3[4]; - copied3x3.mat3[5] = this.mat3[5]; - copied3x3.mat3[6] = this.mat3[6]; - copied3x3.mat3[7] = this.mat3[7]; - copied3x3.mat3[8] = this.mat3[8]; - return copied3x3; - } - var copied = new _main.default.Matrix(this.p5); - copied.mat4[0] = this.mat4[0]; - copied.mat4[1] = this.mat4[1]; - copied.mat4[2] = this.mat4[2]; - copied.mat4[3] = this.mat4[3]; - copied.mat4[4] = this.mat4[4]; - copied.mat4[5] = this.mat4[5]; - copied.mat4[6] = this.mat4[6]; - copied.mat4[7] = this.mat4[7]; - copied.mat4[8] = this.mat4[8]; - copied.mat4[9] = this.mat4[9]; - copied.mat4[10] = this.mat4[10]; - copied.mat4[11] = this.mat4[11]; - copied.mat4[12] = this.mat4[12]; - copied.mat4[13] = this.mat4[13]; - copied.mat4[14] = this.mat4[14]; - copied.mat4[15] = this.mat4[15]; - return copied; - } /** - * return an identity matrix - * @method identity - * @return {p5.Matrix} the result matrix - */, - }, - { - key: "transpose", - /** - * transpose according to a given matrix - * @method transpose - * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be - * based on to transpose - * @chainable - */ - value: function transpose(a) { - var a01, a02, a03, a12, a13, a23; - if (a instanceof _main.default.Matrix) { - a01 = a.mat4[1]; - a02 = a.mat4[2]; - a03 = a.mat4[3]; - a12 = a.mat4[6]; - a13 = a.mat4[7]; - a23 = a.mat4[11]; - this.mat4[0] = a.mat4[0]; - this.mat4[1] = a.mat4[4]; - this.mat4[2] = a.mat4[8]; - this.mat4[3] = a.mat4[12]; - this.mat4[4] = a01; - this.mat4[5] = a.mat4[5]; - this.mat4[6] = a.mat4[9]; - this.mat4[7] = a.mat4[13]; - this.mat4[8] = a02; - this.mat4[9] = a12; - this.mat4[10] = a.mat4[10]; - this.mat4[11] = a.mat4[14]; - this.mat4[12] = a03; - this.mat4[13] = a13; - this.mat4[14] = a23; - this.mat4[15] = a.mat4[15]; - } else if (isMatrixArray(a)) { - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a12 = a[6]; - a13 = a[7]; - a23 = a[11]; - this.mat4[0] = a[0]; - this.mat4[1] = a[4]; - this.mat4[2] = a[8]; - this.mat4[3] = a[12]; - this.mat4[4] = a01; - this.mat4[5] = a[5]; - this.mat4[6] = a[9]; - this.mat4[7] = a[13]; - this.mat4[8] = a02; - this.mat4[9] = a12; - this.mat4[10] = a[10]; - this.mat4[11] = a[14]; - this.mat4[12] = a03; - this.mat4[13] = a13; - this.mat4[14] = a23; - this.mat4[15] = a[15]; - } - return this; - } /** - * invert matrix according to a give matrix - * @method invert - * @param {p5.Matrix|Float32Array|Number[]} a the matrix to be - * based on to invert - * @chainable - */, - }, - { - key: "invert", - value: function invert(a) { - var a00, a01, a02, a03, a10, a11, a12, a13; - var a20, a21, a22, a23, a30, a31, a32, a33; - if (a instanceof _main.default.Matrix) { - a00 = a.mat4[0]; - a01 = a.mat4[1]; - a02 = a.mat4[2]; - a03 = a.mat4[3]; - a10 = a.mat4[4]; - a11 = a.mat4[5]; - a12 = a.mat4[6]; - a13 = a.mat4[7]; - a20 = a.mat4[8]; - a21 = a.mat4[9]; - a22 = a.mat4[10]; - a23 = a.mat4[11]; - a30 = a.mat4[12]; - a31 = a.mat4[13]; - a32 = a.mat4[14]; - a33 = a.mat4[15]; - } else if (isMatrixArray(a)) { - a00 = a[0]; - a01 = a[1]; - a02 = a[2]; - a03 = a[3]; - a10 = a[4]; - a11 = a[5]; - a12 = a[6]; - a13 = a[7]; - a20 = a[8]; - a21 = a[9]; - a22 = a[10]; - a23 = a[11]; - a30 = a[12]; - a31 = a[13]; - a32 = a[14]; - a33 = a[15]; - } - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - // Calculate the determinant - var det = - b00 * b11 - - b01 * b10 + - b02 * b09 + - b03 * b08 - - b04 * b07 + - b05 * b06; - if (!det) { - return null; - } - det = 1 / det; - this.mat4[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - this.mat4[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - this.mat4[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - this.mat4[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - this.mat4[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - this.mat4[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - this.mat4[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - this.mat4[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - this.mat4[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - this.mat4[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - this.mat4[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - this.mat4[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - this.mat4[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - this.mat4[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - this.mat4[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - this.mat4[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - return this; - } /** - * Inverts a 3×3 matrix - * @method invert3x3 - * @chainable - */, - }, - { - key: "invert3x3", - value: function invert3x3() { - var a00 = this.mat3[0]; - var a01 = this.mat3[1]; - var a02 = this.mat3[2]; - var a10 = this.mat3[3]; - var a11 = this.mat3[4]; - var a12 = this.mat3[5]; - var a20 = this.mat3[6]; - var a21 = this.mat3[7]; - var a22 = this.mat3[8]; - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - if (!det) { - return null; - } - det = 1 / det; - this.mat3[0] = b01 * det; - this.mat3[1] = (-a22 * a01 + a02 * a21) * det; - this.mat3[2] = (a12 * a01 - a02 * a11) * det; - this.mat3[3] = b11 * det; - this.mat3[4] = (a22 * a00 - a02 * a20) * det; - this.mat3[5] = (-a12 * a00 + a02 * a10) * det; - this.mat3[6] = b21 * det; - this.mat3[7] = (-a21 * a00 + a01 * a20) * det; - this.mat3[8] = (a11 * a00 - a01 * a10) * det; - return this; - } /** - * This function is only for 3x3 matrices. - * transposes a 3×3 p5.Matrix by a mat3 - * If there is an array of arguments, the matrix obtained by transposing - * the 3x3 matrix generated based on that array is set. - * If no arguments, it transposes itself and returns it. - * - * @method transpose3x3 - * @param {Number[]} mat3 1-dimensional array - * @chainable - */, - }, - { - key: "transpose3x3", - value: function transpose3x3(mat3) { - if (mat3 === undefined) { - mat3 = this.mat3; - } - var a01 = mat3[1]; - var a02 = mat3[2]; - var a12 = mat3[5]; - this.mat3[0] = mat3[0]; - this.mat3[1] = mat3[3]; - this.mat3[2] = mat3[6]; - this.mat3[3] = a01; - this.mat3[4] = mat3[4]; - this.mat3[5] = mat3[7]; - this.mat3[6] = a02; - this.mat3[7] = a12; - this.mat3[8] = mat3[8]; - return this; - } /** - * converts a 4×4 matrix to its 3×3 inverse transform - * commonly used in MVMatrix to NMatrix conversions. - * @method invertTranspose - * @param {p5.Matrix} mat4 the matrix to be based on to invert - * @chainable - * @todo finish implementation - */, - }, - { - key: "inverseTranspose", - value: function inverseTranspose(_ref3) { - var mat4 = _ref3.mat4; - if (this.mat3 === undefined) { - _main.default._friendlyError( - "sorry, this function only works with mat3", - ); - } else { - //convert mat4 -> mat3 - this.mat3[0] = mat4[0]; - this.mat3[1] = mat4[1]; - this.mat3[2] = mat4[2]; - this.mat3[3] = mat4[4]; - this.mat3[4] = mat4[5]; - this.mat3[5] = mat4[6]; - this.mat3[6] = mat4[8]; - this.mat3[7] = mat4[9]; - this.mat3[8] = mat4[10]; - } - var inverse = this.invert3x3(); - // check inverse succeeded - if (inverse) { - inverse.transpose3x3(this.mat3); - } else { - // in case of singularity, just zero the matrix - for (var i = 0; i < 9; i++) { - this.mat3[i] = 0; - } - } - return this; - } /** - * inspired by Toji's mat4 determinant - * @method determinant - * @return {Number} Determinant of our 4×4 matrix - */, - }, - { - key: "determinant", - value: function determinant() { - var d00 = - this.mat4[0] * this.mat4[5] - - this.mat4[1] * this.mat4[4], - d01 = - this.mat4[0] * this.mat4[6] - - this.mat4[2] * this.mat4[4], - d02 = - this.mat4[0] * this.mat4[7] - - this.mat4[3] * this.mat4[4], - d03 = - this.mat4[1] * this.mat4[6] - - this.mat4[2] * this.mat4[5], - d04 = - this.mat4[1] * this.mat4[7] - - this.mat4[3] * this.mat4[5], - d05 = - this.mat4[2] * this.mat4[7] - - this.mat4[3] * this.mat4[6], - d06 = - this.mat4[8] * this.mat4[13] - - this.mat4[9] * this.mat4[12], - d07 = - this.mat4[8] * this.mat4[14] - - this.mat4[10] * this.mat4[12], - d08 = - this.mat4[8] * this.mat4[15] - - this.mat4[11] * this.mat4[12], - d09 = - this.mat4[9] * this.mat4[14] - - this.mat4[10] * this.mat4[13], - d10 = - this.mat4[9] * this.mat4[15] - - this.mat4[11] * this.mat4[13], - d11 = - this.mat4[10] * this.mat4[15] - - this.mat4[11] * this.mat4[14]; - // Calculate the determinant - return ( - d00 * d11 - - d01 * d10 + - d02 * d09 + - d03 * d08 - - d04 * d07 + - d05 * d06 - ); - } /** - * multiply two mat4s - * @method mult - * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix - * we want to multiply by - * @chainable - */, - }, - { - key: "mult", - value: function mult(multMatrix) { - var _src; - if (multMatrix === this || multMatrix === this.mat4) { - _src = this.copy().mat4; // only need to allocate in this rare case - } else if (multMatrix instanceof _main.default.Matrix) { - _src = multMatrix.mat4; - } else if (isMatrixArray(multMatrix)) { - _src = multMatrix; - } else if (arguments.length === 16) { - _src = arguments; - } else { - return; // nothing to do. - } // each row is used for the multiplier - - var b0 = this.mat4[0], - b1 = this.mat4[1], - b2 = this.mat4[2], - b3 = this.mat4[3]; - this.mat4[0] = - b0 * _src[0] + - b1 * _src[4] + - b2 * _src[8] + - b3 * _src[12]; - this.mat4[1] = - b0 * _src[1] + - b1 * _src[5] + - b2 * _src[9] + - b3 * _src[13]; - this.mat4[2] = - b0 * _src[2] + - b1 * _src[6] + - b2 * _src[10] + - b3 * _src[14]; - this.mat4[3] = - b0 * _src[3] + - b1 * _src[7] + - b2 * _src[11] + - b3 * _src[15]; - b0 = this.mat4[4]; - b1 = this.mat4[5]; - b2 = this.mat4[6]; - b3 = this.mat4[7]; - this.mat4[4] = - b0 * _src[0] + - b1 * _src[4] + - b2 * _src[8] + - b3 * _src[12]; - this.mat4[5] = - b0 * _src[1] + - b1 * _src[5] + - b2 * _src[9] + - b3 * _src[13]; - this.mat4[6] = - b0 * _src[2] + - b1 * _src[6] + - b2 * _src[10] + - b3 * _src[14]; - this.mat4[7] = - b0 * _src[3] + - b1 * _src[7] + - b2 * _src[11] + - b3 * _src[15]; - b0 = this.mat4[8]; - b1 = this.mat4[9]; - b2 = this.mat4[10]; - b3 = this.mat4[11]; - this.mat4[8] = - b0 * _src[0] + - b1 * _src[4] + - b2 * _src[8] + - b3 * _src[12]; - this.mat4[9] = - b0 * _src[1] + - b1 * _src[5] + - b2 * _src[9] + - b3 * _src[13]; - this.mat4[10] = - b0 * _src[2] + - b1 * _src[6] + - b2 * _src[10] + - b3 * _src[14]; - this.mat4[11] = - b0 * _src[3] + - b1 * _src[7] + - b2 * _src[11] + - b3 * _src[15]; - b0 = this.mat4[12]; - b1 = this.mat4[13]; - b2 = this.mat4[14]; - b3 = this.mat4[15]; - this.mat4[12] = - b0 * _src[0] + - b1 * _src[4] + - b2 * _src[8] + - b3 * _src[12]; - this.mat4[13] = - b0 * _src[1] + - b1 * _src[5] + - b2 * _src[9] + - b3 * _src[13]; - this.mat4[14] = - b0 * _src[2] + - b1 * _src[6] + - b2 * _src[10] + - b3 * _src[14]; - this.mat4[15] = - b0 * _src[3] + - b1 * _src[7] + - b2 * _src[11] + - b3 * _src[15]; - return this; - }, - }, - { - key: "apply", - value: function apply(multMatrix) { - var _src; - if (multMatrix === this || multMatrix === this.mat4) { - _src = this.copy().mat4; // only need to allocate in this rare case - } else if (multMatrix instanceof _main.default.Matrix) { - _src = multMatrix.mat4; - } else if (isMatrixArray(multMatrix)) { - _src = multMatrix; - } else if (arguments.length === 16) { - _src = arguments; - } else { - return; // nothing to do. - } - var mat4 = this.mat4; - // each row is used for the multiplier - var m0 = mat4[0]; - var m4 = mat4[4]; - var m8 = mat4[8]; - var m12 = mat4[12]; - mat4[0] = - _src[0] * m0 + - _src[1] * m4 + - _src[2] * m8 + - _src[3] * m12; - mat4[4] = - _src[4] * m0 + - _src[5] * m4 + - _src[6] * m8 + - _src[7] * m12; - mat4[8] = - _src[8] * m0 + - _src[9] * m4 + - _src[10] * m8 + - _src[11] * m12; - mat4[12] = - _src[12] * m0 + - _src[13] * m4 + - _src[14] * m8 + - _src[15] * m12; - var m1 = mat4[1]; - var m5 = mat4[5]; - var m9 = mat4[9]; - var m13 = mat4[13]; - mat4[1] = - _src[0] * m1 + - _src[1] * m5 + - _src[2] * m9 + - _src[3] * m13; - mat4[5] = - _src[4] * m1 + - _src[5] * m5 + - _src[6] * m9 + - _src[7] * m13; - mat4[9] = - _src[8] * m1 + - _src[9] * m5 + - _src[10] * m9 + - _src[11] * m13; - mat4[13] = - _src[12] * m1 + - _src[13] * m5 + - _src[14] * m9 + - _src[15] * m13; - var m2 = mat4[2]; - var m6 = mat4[6]; - var m10 = mat4[10]; - var m14 = mat4[14]; - mat4[2] = - _src[0] * m2 + - _src[1] * m6 + - _src[2] * m10 + - _src[3] * m14; - mat4[6] = - _src[4] * m2 + - _src[5] * m6 + - _src[6] * m10 + - _src[7] * m14; - mat4[10] = - _src[8] * m2 + - _src[9] * m6 + - _src[10] * m10 + - _src[11] * m14; - mat4[14] = - _src[12] * m2 + - _src[13] * m6 + - _src[14] * m10 + - _src[15] * m14; - var m3 = mat4[3]; - var m7 = mat4[7]; - var m11 = mat4[11]; - var m15 = mat4[15]; - mat4[3] = - _src[0] * m3 + - _src[1] * m7 + - _src[2] * m11 + - _src[3] * m15; - mat4[7] = - _src[4] * m3 + - _src[5] * m7 + - _src[6] * m11 + - _src[7] * m15; - mat4[11] = - _src[8] * m3 + - _src[9] * m7 + - _src[10] * m11 + - _src[11] * m15; - mat4[15] = - _src[12] * m3 + - _src[13] * m7 + - _src[14] * m11 + - _src[15] * m15; - return this; - } /** - * scales a p5.Matrix by scalars or a vector - * @method scale - * @param {p5.Vector|Float32Array|Number[]} s vector to scale by - * @chainable - */, - }, - { - key: "scale", - value: function scale(x, y, z) { - if (x instanceof _main.default.Vector) { - // x is a vector, extract the components from it. - y = x.y; - z = x.z; - x = x.x; // must be last - } else if (x instanceof Array) { - // x is an array, extract the components from it. - y = x[1]; - z = x[2]; - x = x[0]; // must be last - } - this.mat4[0] *= x; - this.mat4[1] *= x; - this.mat4[2] *= x; - this.mat4[3] *= x; - this.mat4[4] *= y; - this.mat4[5] *= y; - this.mat4[6] *= y; - this.mat4[7] *= y; - this.mat4[8] *= z; - this.mat4[9] *= z; - this.mat4[10] *= z; - this.mat4[11] *= z; - return this; - } /** - * rotate our Matrix around an axis by the given angle. - * @method rotate - * @param {Number} a The angle of rotation in radians - * @param {p5.Vector|Number[]} axis the axis(es) to rotate around - * @chainable - * inspired by Toji's gl-matrix lib, mat4 rotation - */, - }, - { - key: "rotate", - value: function rotate(a, x, y, z) { - if (x instanceof _main.default.Vector) { - // x is a vector, extract the components from it. - y = x.y; - z = x.z; - x = x.x; //must be last - } else if (x instanceof Array) { - // x is an array, extract the components from it. - y = x[1]; - z = x[2]; - x = x[0]; //must be last - } - var len = Math.sqrt(x * x + y * y + z * z); - x *= 1 / len; - y *= 1 / len; - z *= 1 / len; - var a00 = this.mat4[0]; - var a01 = this.mat4[1]; - var a02 = this.mat4[2]; - var a03 = this.mat4[3]; - var a10 = this.mat4[4]; - var a11 = this.mat4[5]; - var a12 = this.mat4[6]; - var a13 = this.mat4[7]; - var a20 = this.mat4[8]; - var a21 = this.mat4[9]; - var a22 = this.mat4[10]; - var a23 = this.mat4[11]; - //sin,cos, and tan of respective angle - var sA = Math.sin(a); - var cA = Math.cos(a); - var tA = 1 - cA; - // Construct the elements of the rotation matrix - var b00 = x * x * tA + cA; - var b01 = y * x * tA + z * sA; - var b02 = z * x * tA - y * sA; - var b10 = x * y * tA - z * sA; - var b11 = y * y * tA + cA; - var b12 = z * y * tA + x * sA; - var b20 = x * z * tA + y * sA; - var b21 = y * z * tA - x * sA; - var b22 = z * z * tA + cA; - // rotation-specific matrix multiplication - this.mat4[0] = a00 * b00 + a10 * b01 + a20 * b02; - this.mat4[1] = a01 * b00 + a11 * b01 + a21 * b02; - this.mat4[2] = a02 * b00 + a12 * b01 + a22 * b02; - this.mat4[3] = a03 * b00 + a13 * b01 + a23 * b02; - this.mat4[4] = a00 * b10 + a10 * b11 + a20 * b12; - this.mat4[5] = a01 * b10 + a11 * b11 + a21 * b12; - this.mat4[6] = a02 * b10 + a12 * b11 + a22 * b12; - this.mat4[7] = a03 * b10 + a13 * b11 + a23 * b12; - this.mat4[8] = a00 * b20 + a10 * b21 + a20 * b22; - this.mat4[9] = a01 * b20 + a11 * b21 + a21 * b22; - this.mat4[10] = a02 * b20 + a12 * b21 + a22 * b22; - this.mat4[11] = a03 * b20 + a13 * b21 + a23 * b22; - return this; - } /** - * @todo finish implementing this method! - * translates - * @method translate - * @param {Number[]} v vector to translate by - * @chainable - */, - }, - { - key: "translate", - value: function translate(v) { - var x = v[0], - y = v[1], - z = v[2] || 0; - this.mat4[12] += - this.mat4[0] * x + this.mat4[4] * y + this.mat4[8] * z; - this.mat4[13] += - this.mat4[1] * x + this.mat4[5] * y + this.mat4[9] * z; - this.mat4[14] += - this.mat4[2] * x + this.mat4[6] * y + this.mat4[10] * z; - this.mat4[15] += - this.mat4[3] * x + this.mat4[7] * y + this.mat4[11] * z; - }, - }, - { - key: "rotateX", - value: function rotateX(a) { - this.rotate(a, 1, 0, 0); - }, - }, - { - key: "rotateY", - value: function rotateY(a) { - this.rotate(a, 0, 1, 0); - }, - }, - { - key: "rotateZ", - value: function rotateZ(a) { - this.rotate(a, 0, 0, 1); - } /** - * sets the perspective matrix - * @method perspective - * @param {Number} fovy [description] - * @param {Number} aspect [description] - * @param {Number} near near clipping plane - * @param {Number} far far clipping plane - * @chainable - */, - }, - { - key: "perspective", - value: function perspective(fovy, aspect, near, far) { - var f = 1 / Math.tan(fovy / 2), - nf = 1 / (near - far); - this.mat4[0] = f / aspect; - this.mat4[1] = 0; - this.mat4[2] = 0; - this.mat4[3] = 0; - this.mat4[4] = 0; - this.mat4[5] = f; - this.mat4[6] = 0; - this.mat4[7] = 0; - this.mat4[8] = 0; - this.mat4[9] = 0; - this.mat4[10] = (far + near) * nf; - this.mat4[11] = -1; - this.mat4[12] = 0; - this.mat4[13] = 0; - this.mat4[14] = 2 * far * near * nf; - this.mat4[15] = 0; - return this; - } /** - * sets the ortho matrix - * @method ortho - * @param {Number} left [description] - * @param {Number} right [description] - * @param {Number} bottom [description] - * @param {Number} top [description] - * @param {Number} near near clipping plane - * @param {Number} far far clipping plane - * @chainable - */, - }, - { - key: "ortho", - value: function ortho(left, right, bottom, top, near, far) { - var lr = 1 / (left - right), - bt = 1 / (bottom - top), - nf = 1 / (near - far); - this.mat4[0] = -2 * lr; - this.mat4[1] = 0; - this.mat4[2] = 0; - this.mat4[3] = 0; - this.mat4[4] = 0; - this.mat4[5] = -2 * bt; - this.mat4[6] = 0; - this.mat4[7] = 0; - this.mat4[8] = 0; - this.mat4[9] = 0; - this.mat4[10] = 2 * nf; - this.mat4[11] = 0; - this.mat4[12] = (left + right) * lr; - this.mat4[13] = (top + bottom) * bt; - this.mat4[14] = (far + near) * nf; - this.mat4[15] = 1; - return this; - } /** - * apply a matrix to a vector with x,y,z,w components - * get the results in the form of an array - * @method multiplyVec4 - * @param {Number} - * @return {Number[]} - */, - }, - { - key: "multiplyVec4", - value: function multiplyVec4(x, y, z, w) { - var result = new Array(4); - var m = this.mat4; - result[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; - result[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; - result[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; - result[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; - return result; - } /** - * Applies a matrix to a vector. - * The fourth component is set to 1. - * Returns a vector consisting of the first - * through third components of the result. - * - * @method multiplyPoint - * @param {p5.Vector} - * @return {p5.Vector} - */, - }, - { - key: "multiplyPoint", - value: function multiplyPoint(_ref4) { - var x = _ref4.x, - y = _ref4.y, - z = _ref4.z; - var array = this.multiplyVec4(x, y, z, 1); - return new _main.default.Vector( - array[0], - array[1], - array[2], - ); - } /** - * Applies a matrix to a vector. - * The fourth component is set to 1. - * Returns the result of dividing the 1st to 3rd components - * of the result by the 4th component as a vector. - * - * @method multiplyAndNormalizePoint - * @param {p5.Vector} - * @return {p5.Vector} - */, - }, - { - key: "multiplyAndNormalizePoint", - value: function multiplyAndNormalizePoint(_ref5) { - var x = _ref5.x, - y = _ref5.y, - z = _ref5.z; - var array = this.multiplyVec4(x, y, z, 1); - array[0] /= array[3]; - array[1] /= array[3]; - array[2] /= array[3]; - return new _main.default.Vector( - array[0], - array[1], - array[2], - ); - } /** - * Applies a matrix to a vector. - * The fourth component is set to 0. - * Returns a vector consisting of the first - * through third components of the result. - * - * @method multiplyDirection - * @param {p5.Vector} - * @return {p5.Vector} - */, - }, - { - key: "multiplyDirection", - value: function multiplyDirection(_ref6) { - var x = _ref6.x, - y = _ref6.y, - z = _ref6.z; - var array = this.multiplyVec4(x, y, z, 0); - return new _main.default.Vector( - array[0], - array[1], - array[2], - ); - } /** - * This function is only for 3x3 matrices. - * multiply two mat3s. It is an operation to multiply the 3x3 matrix of - * the argument from the right. Arguments can be a 3x3 p5.Matrix, - * a Float32Array of length 9, or a javascript array of length 9. - * In addition, it can also be done by enumerating 9 numbers. - * - * @method mult3x3 - * @param {p5.Matrix|Float32Array|Number[]} multMatrix The matrix - * we want to multiply by - * @chainable - */, - }, - { - key: "mult3x3", - value: function mult3x3(multMatrix) { - var _src; - if (multMatrix === this || multMatrix === this.mat3) { - _src = this.copy().mat3; // only need to allocate in this rare case - } else if (multMatrix instanceof _main.default.Matrix) { - _src = multMatrix.mat3; - } else if (isMatrixArray(multMatrix)) { - _src = multMatrix; - } else if (arguments.length === 9) { - _src = arguments; - } else { - return; // nothing to do. - } // each row is used for the multiplier - - var b0 = this.mat3[0]; - var b1 = this.mat3[1]; - var b2 = this.mat3[2]; - this.mat3[0] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; - this.mat3[1] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; - this.mat3[2] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; - b0 = this.mat3[3]; - b1 = this.mat3[4]; - b2 = this.mat3[5]; - this.mat3[3] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; - this.mat3[4] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; - this.mat3[5] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; - b0 = this.mat3[6]; - b1 = this.mat3[7]; - b2 = this.mat3[8]; - this.mat3[6] = b0 * _src[0] + b1 * _src[3] + b2 * _src[6]; - this.mat3[7] = b0 * _src[1] + b1 * _src[4] + b2 * _src[7]; - this.mat3[8] = b0 * _src[2] + b1 * _src[5] + b2 * _src[8]; - return this; - } /** - * This function is only for 3x3 matrices. - * A function that returns a column vector of a 3x3 matrix. - * - * @method column - * @param {Number} columnIndex matrix column number - * @return {p5.Vector} - */, - }, - { - key: "column", - value: function column(columnIndex) { - return new _main.default.Vector( - this.mat3[3 * columnIndex], - this.mat3[3 * columnIndex + 1], - this.mat3[3 * columnIndex + 2], - ); - } /** - * This function is only for 3x3 matrices. - * A function that returns a row vector of a 3x3 matrix. - * - * @method row - * @param {Number} rowIndex matrix row number - * @return {p5.Vector} - */, - }, - { - key: "row", - value: function row(rowIndex) { - return new _main.default.Vector( - this.mat3[rowIndex], - this.mat3[rowIndex + 3], - this.mat3[rowIndex + 6], - ); - } /** - * Returns the diagonal elements of the matrix in the form of an array. - * A 3x3 matrix will return an array of length 3. - * A 4x4 matrix will return an array of length 4. - * - * @method diagonal - * @return {Number[]} An array obtained by arranging the diagonal elements - * of the matrix in ascending order of index - */, - }, - { - key: "diagonal", - value: function diagonal() { - if (this.mat3 !== undefined) { - return [this.mat3[0], this.mat3[4], this.mat3[8]]; - } - return [ - this.mat4[0], - this.mat4[5], - this.mat4[10], - this.mat4[15], - ]; - } /** - * This function is only for 3x3 matrices. - * Takes a vector and returns the vector resulting from multiplying to - * that vector by this matrix from left. - * - * @method multiplyVec3 - * @param {p5.Vector} multVector the vector to which this matrix applies - * @param {p5.Vector} [target] The vector to receive the result - * @return {p5.Vector} - */, - }, - { - key: "multiplyVec3", - value: function multiplyVec3(multVector, target) { - if (target === undefined) { - target = multVector.copy(); - } - target.x = this.row(0).dot(multVector); - target.y = this.row(1).dot(multVector); - target.z = this.row(2).dot(multVector); - return target; - } /** - * This function is only for 4x4 matrices. - * Creates a 3x3 matrix whose entries are the top left 3x3 part and returns it. - * - * @method createSubMatrix3x3 - * @return {p5.Matrix} - */, - }, - { - key: "createSubMatrix3x3", - value: function createSubMatrix3x3() { - var result = new _main.default.Matrix("mat3"); - result.mat3[0] = this.mat4[0]; - result.mat3[1] = this.mat4[1]; - result.mat3[2] = this.mat4[2]; - result.mat3[3] = this.mat4[4]; - result.mat3[4] = this.mat4[5]; - result.mat3[5] = this.mat4[6]; - result.mat3[6] = this.mat4[8]; - result.mat3[7] = this.mat4[9]; - result.mat3[8] = this.mat4[10]; - return result; - } /** - * PRIVATE - */, - // matrix methods adapted from: - // https://developer.mozilla.org/en-US/docs/Web/WebGL/ - // gluPerspective - // - // function _makePerspective(fovy, aspect, znear, zfar){ - // const ymax = znear * Math.tan(fovy * Math.PI / 360.0); - // const ymin = -ymax; - // const xmin = ymin * aspect; - // const xmax = ymax * aspect; - // return _makeFrustum(xmin, xmax, ymin, ymax, znear, zfar); - // } - //// - //// glFrustum - //// - //function _makeFrustum(left, right, bottom, top, znear, zfar){ - // const X = 2*znear/(right-left); - // const Y = 2*znear/(top-bottom); - // const A = (right+left)/(right-left); - // const B = (top+bottom)/(top-bottom); - // const C = -(zfar+znear)/(zfar-znear); - // const D = -2*zfar*znear/(zfar-znear); - // const frustrumMatrix =[ - // X, 0, A, 0, - // 0, Y, B, 0, - // 0, 0, C, D, - // 0, 0, -1, 0 - //]; - //return frustrumMatrix; - // } - // function _setMVPMatrices(){ - ////an identity matrix - ////@TODO use the p5.Matrix class to abstract away our MV matrices and - ///other math - //const _mvMatrix = - //[ - // 1.0,0.0,0.0,0.0, - // 0.0,1.0,0.0,0.0, - // 0.0,0.0,1.0,0.0, - // 0.0,0.0,0.0,1.0 - //]; - }, - ], - [ - { - key: "identity", - value: function identity(pInst) { - return new _main.default.Matrix(pInst); - }, - }, - ], - ); - return _class; - })(); - var _default = _main.default.Matrix; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.float32-array": 229, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - }, - ], - 352: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.map"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - _main.default.RenderBuffer = /*#__PURE__*/ (function () { - function _class(size, src, dst, attr, renderer, map) { - _classCallCheck(this, _class); - this.size = size; // the number of FLOATs in each vertex - this.src = src; // the name of the model's source array - this.dst = dst; // the name of the geometry's buffer - this.attr = attr; // the name of the vertex attribute - this._renderer = renderer; - this.map = map; // optional, a transformation function to apply to src - } /** - * Enables and binds the buffers used by shader when the appropriate data exists in geometry. - * Must always be done prior to drawing geometry in WebGL. - * @param {p5.Geometry} geometry Geometry that is going to be drawn - * @param {p5.Shader} shader Active shader - * @private - */ - - _createClass(_class, [ - { - key: "_prepareBuffer", - value: function _prepareBuffer(geometry, shader) { - var attributes = shader.attributes; - var gl = this._renderer.GL; - var model; - if (geometry.model) { - model = geometry.model; - } else { - model = geometry; - } // loop through each of the buffer definitions - - var attr = attributes[this.attr]; - if (!attr) { - return; - } // check if the model has the appropriate source array - - var buffer = geometry[this.dst]; - var src = model[this.src]; - if (src.length > 0) { - // check if we need to create the GL buffer - var createBuffer = !buffer; - if (createBuffer) { - // create and remember the buffer - geometry[this.dst] = buffer = gl.createBuffer(); - } // bind the buffer - - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - // check if we need to fill the buffer with data - if (createBuffer || model.dirtyFlags[this.src] !== false) { - var map = this.map; - // get the values from the model, possibly transformed - var values = map ? map(src) : src; - // fill the buffer with the values - this._renderer._bindBuffer( - buffer, - gl.ARRAY_BUFFER, - values, - ); - // mark the model's source array as clean - model.dirtyFlags[this.src] = false; - } // enable the attribute - - shader.enableAttrib(attr, this.size); - } else { - var loc = attr.location; - if ( - loc === -1 || - !this._renderer.registerEnabled.has(loc) - ) { - return; - } // Disable register corresponding to unused attribute - - gl.disableVertexAttribArray(loc); - // Record register availability - this._renderer.registerEnabled.delete(loc); - } - }, - }, - ]); - return _class; - })(); - var _default = _main.default.RenderBuffer; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.map": 182, - }, - ], - 353: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.find-index"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.find-index"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.map"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - _dereq_("./p5.RenderBuffer"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } /** - * Welcome to RendererGL Immediate Mode. - * Immediate mode is used for drawing custom shapes - * from a set of vertices. Immediate Mode is activated - * when you call beginShape() & de-activated when you call endShape(). - * Immediate mode is a style of programming borrowed - * from OpenGL's (now-deprecated) immediate mode. - * It differs from p5.js' default, Retained Mode, which caches - * geometries and buffers on the CPU to reduce the number of webgl - * draw calls. Retained mode is more efficient & performative, - * however, Immediate Mode is useful for sketching quick - * geometric ideas. - */ - /** - * Begin shape drawing. This is a helpful way of generating - * custom shapes quickly. However in WEBGL mode, application - * performance will likely drop as a result of too many calls to - * beginShape() / endShape(). As a high performance alternative, - * please use p5.js geometry primitives. - * @private - * @method beginShape - * @param {Number} mode webgl primitives mode. beginShape supports the - * following modes: - * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, - * TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP, - * and TESS(WEBGL only) - * @chainable - */ - - _main.default.RendererGL.prototype.beginShape = function (mode) { - this.immediateMode.shapeMode = - mode !== undefined ? mode : constants.TESS; - this.immediateMode.geometry.reset(); - this.immediateMode.contourIndices = []; - return this; - }; - var immediateBufferStrides = { - vertices: 1, - vertexNormals: 1, - vertexColors: 4, - vertexStrokeColors: 4, - uvs: 2, - }; - _main.default.RendererGL.prototype.beginContour = function () { - if (this.immediateMode.shapeMode !== constants.TESS) { - throw new Error( - "WebGL mode can only use contours with beginShape(TESS).", - ); - } - this.immediateMode.contourIndices.push( - this.immediateMode.geometry.vertices.length, - ); - }; - /** - * adds a vertex to be drawn in a custom Shape. - * @private - * @method vertex - * @param {Number} x x-coordinate of vertex - * @param {Number} y y-coordinate of vertex - * @param {Number} z z-coordinate of vertex - * @chainable - * @TODO implement handling of p5.Vector args - */ - _main.default.RendererGL.prototype.vertex = function (x, y) { - // WebGL 1 doesn't support QUADS or QUAD_STRIP, so we duplicate data to turn - // QUADS into TRIANGLES and QUAD_STRIP into TRIANGLE_STRIP. (There is no extra - // work to convert QUAD_STRIP here, since the only difference is in how edges - // are rendered.) - if (this.immediateMode.shapeMode === constants.QUADS) { - // A finished quad turned into triangles should leave 6 vertices in the - // buffer: - // 0--3 0 3--5 - // | | --> | \ \ | - // 1--2 1--2 4 - // When vertex index 3 is being added, add the necessary duplicates. - if (this.immediateMode.geometry.vertices.length % 6 === 3) { - for (var key in immediateBufferStrides) { - var stride = immediateBufferStrides[key]; - var buffer = this.immediateMode.geometry[key]; - buffer.push.apply( - buffer, - _toConsumableArray( - buffer.slice( - buffer.length - 3 * stride, - buffer.length - 2 * stride, - ), - ).concat( - _toConsumableArray( - buffer.slice(buffer.length - stride, buffer.length), - ), - ), - ); - } - } - } - var z, u, v; - // default to (x, y) mode: all other arguments assumed to be 0. - z = u = v = 0; - if (arguments.length === 3) { - // (x, y, z) mode: (u, v) assumed to be 0. - z = arguments[2]; - } else if (arguments.length === 4) { - // (x, y, u, v) mode: z assumed to be 0. - u = arguments[2]; - v = arguments[3]; - } else if (arguments.length === 5) { - // (x, y, z, u, v) mode - z = arguments[2]; - u = arguments[3]; - v = arguments[4]; - } - var vert = new _main.default.Vector(x, y, z); - this.immediateMode.geometry.vertices.push(vert); - this.immediateMode.geometry.vertexNormals.push(this._currentNormal); - var vertexColor = this.curFillColor || [0.5, 0.5, 0.5, 1]; - this.immediateMode.geometry.vertexColors.push( - vertexColor[0], - vertexColor[1], - vertexColor[2], - vertexColor[3], - ); - var lineVertexColor = this.curStrokeColor || [0.5, 0.5, 0.5, 1]; - this.immediateMode.geometry.vertexStrokeColors.push( - lineVertexColor[0], - lineVertexColor[1], - lineVertexColor[2], - lineVertexColor[3], - ); - if ( - this.textureMode === constants.IMAGE && - !this.isProcessingVertices - ) { - if (this._tex !== null) { - if (this._tex.width > 0 && this._tex.height > 0) { - u /= this._tex.width; - v /= this._tex.height; - } - } else if ( - this.userFillShader !== undefined || - this.userStrokeShader !== undefined || - this.userPointShader !== undefined - ) { - // Do nothing if user-defined shaders are present - } else if (this._tex === null && arguments.length >= 4) { - // Only throw this warning if custom uv's have been provided - console.warn( - "You must first call texture() before using" + - " vertex() with image based u and v coordinates", - ); - } - } - this.immediateMode.geometry.uvs.push(u, v); - this.immediateMode._bezierVertex[0] = x; - this.immediateMode._bezierVertex[1] = y; - this.immediateMode._bezierVertex[2] = z; - this.immediateMode._quadraticVertex[0] = x; - this.immediateMode._quadraticVertex[1] = y; - this.immediateMode._quadraticVertex[2] = z; - return this; - }; - /** - * Sets the normal to use for subsequent vertices. - * @method vertexNormal - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @chainable - * - * @method vertexNormal - * @param {Vector} v - * @chainable - */ - _main.default.RendererGL.prototype.normal = function (xorv, y, z) { - if (xorv instanceof _main.default.Vector) { - this._currentNormal = xorv; - } else { - this._currentNormal = new _main.default.Vector(xorv, y, z); - } - return this; - }; - /** - * End shape drawing and render vertices to screen. - * @chainable - */ - _main.default.RendererGL.prototype.endShape = function ( - mode, - isCurve, - isBezier, - isQuadratic, - isContour, - shapeKind, - ) { - var count = - arguments.length > 6 && arguments[6] !== undefined - ? arguments[6] - : 1; - if (this.immediateMode.shapeMode === constants.POINTS) { - this._drawPoints( - this.immediateMode.geometry.vertices, - this.immediateMode.buffers.point, - ); - return this; - } // When we are drawing a shape then the shape mode is TESS, - // but in case of triangle we can skip the breaking into small triangle - // this can optimize performance by skipping the step of breaking it into triangles - - if ( - this.immediateMode.geometry.vertices.length === 3 && - this.immediateMode.shapeMode === constants.TESS - ) { - this.immediateMode.shapeMode === constants.TRIANGLES; - } - this.isProcessingVertices = true; - this._processVertices.apply(this, arguments); - this.isProcessingVertices = false; - // LINE_STRIP and LINES are not used for rendering, instead - // they only indicate a way to modify vertices during the _processVertices() step - if ( - this.immediateMode.shapeMode === constants.LINE_STRIP || - this.immediateMode.shapeMode === constants.LINES - ) { - this.immediateMode.shapeMode = constants.TRIANGLE_FAN; - } // WebGL doesn't support the QUADS and QUAD_STRIP modes, so we - // need to convert them to a supported format. In `vertex()`, we reformat - // the input data into the formats specified below. - - if (this.immediateMode.shapeMode === constants.QUADS) { - this.immediateMode.shapeMode = constants.TRIANGLES; - } else if (this.immediateMode.shapeMode === constants.QUAD_STRIP) { - this.immediateMode.shapeMode = constants.TRIANGLE_STRIP; - } - if (this._doFill) { - if ( - !this.geometryBuilder && - this.immediateMode.geometry.vertices.length >= 3 - ) { - this._drawImmediateFill(count); - } - } - if (this._doStroke) { - if ( - !this.geometryBuilder && - this.immediateMode.geometry.lineVertices.length >= 1 - ) { - this._drawImmediateStroke(); - } - } - if (this.geometryBuilder) { - this.geometryBuilder.addImmediate(); - } - this.isBezier = false; - this.isQuadratic = false; - this.isCurve = false; - this.immediateMode._bezierVertex.length = 0; - this.immediateMode._quadraticVertex.length = 0; - this.immediateMode._curveVertex.length = 0; - return this; - }; - /** - * Called from endShape(). This function calculates the stroke vertices for custom shapes and - * tesselates shapes when applicable. - * @private - * @param {Number} mode webgl primitives mode. beginShape supports the - * following modes: - * POINTS,LINES,LINE_STRIP,LINE_LOOP,TRIANGLES, - * TRIANGLE_STRIP, TRIANGLE_FAN and TESS(WEBGL only) - */ - _main.default.RendererGL.prototype._processVertices = function ( - mode, - ) { - if (this.immediateMode.geometry.vertices.length === 0) return; - var calculateStroke = this._doStroke; - var shouldClose = mode === constants.CLOSE; - if (calculateStroke) { - this.immediateMode.geometry.edges = this._calculateEdges( - this.immediateMode.shapeMode, - this.immediateMode.geometry.vertices, - shouldClose, - ); - if (!this.geometryBuilder) { - this.immediateMode.geometry._edgesToVertices(); - } - } // For hollow shapes, user must set mode to TESS - - var convexShape = this.immediateMode.shapeMode === constants.TESS; - // If the shape has a contour, we have to re-triangulate to cut out the - // contour region - var hasContour = this.immediateMode.contourIndices.length > 0; - // We tesselate when drawing curves or convex shapes - var shouldTess = - this._doFill && - (this.isBezier || - this.isQuadratic || - this.isCurve || - convexShape || - hasContour) && - this.immediateMode.shapeMode !== constants.LINES; - if (shouldTess) { - this._tesselateShape(); - } - }; - /** - * Called from _processVertices(). This function calculates the stroke vertices for custom shapes and - * tesselates shapes when applicable. - * @private - * @returns {Array[Number]} indices for custom shape vertices indicating edges. - */ - _main.default.RendererGL.prototype._calculateEdges = function ( - shapeMode, - verts, - shouldClose, - ) { - var res = []; - var i = 0; - var contourIndices = this.immediateMode.contourIndices.slice(); - var contourStart = 0; - switch (shapeMode) { - case constants.TRIANGLE_STRIP: - for (i = 0; i < verts.length - 2; i++) { - res.push([i, i + 1]); - res.push([i, i + 2]); - } - res.push([i, i + 1]); - break; - case constants.TRIANGLE_FAN: - for (i = 1; i < verts.length - 1; i++) { - res.push([0, i]); - res.push([i, i + 1]); - } - res.push([0, verts.length - 1]); - break; - case constants.TRIANGLES: - for (i = 0; i < verts.length - 2; i = i + 3) { - res.push([i, i + 1]); - res.push([i + 1, i + 2]); - res.push([i + 2, i]); - } - break; - case constants.LINES: - for (i = 0; i < verts.length - 1; i = i + 2) { - res.push([i, i + 1]); - } - break; - case constants.QUADS: - // Quads have been broken up into two triangles by `vertex()`: - // 0 3--5 - // | \ \ | - // 1--2 4 - for (i = 0; i < verts.length - 5; i += 6) { - res.push([i, i + 1]); - res.push([i + 1, i + 2]); - res.push([i + 3, i + 5]); - res.push([i + 4, i + 5]); - } - break; - case constants.QUAD_STRIP: - // 0---2---4 - // | | | - // 1---3---5 - for (i = 0; i < verts.length - 2; i += 2) { - res.push([i, i + 1]); - res.push([i, i + 2]); - res.push([i + 1, i + 3]); - } - res.push([i, i + 1]); - break; - default: - // TODO: handle contours in other modes too - for (i = 0; i < verts.length; i++) { - // Handle breaks between contours - if (i + 1 < verts.length && i + 1 !== contourIndices[0]) { - res.push([i, i + 1]); - } else { - if (shouldClose || contourStart) { - res.push([i, contourStart]); - } - if (contourIndices.length > 0) { - contourStart = contourIndices.shift(); - } - } - } - break; - } - if (shapeMode !== constants.TESS && shouldClose) { - res.push([verts.length - 1, 0]); - } - return res; - }; - /** - * Called from _processVertices() when applicable. This function tesselates immediateMode.geometry. - * @private - */ - _main.default.RendererGL.prototype._tesselateShape = function () { - var _this = this; - // TODO: handle non-TESS shape modes that have contours - this.immediateMode.shapeMode = constants.TRIANGLES; - var contours = [[]]; - for ( - var i = 0; - i < this.immediateMode.geometry.vertices.length; - i++ - ) { - if ( - this.immediateMode.contourIndices.length > 0 && - this.immediateMode.contourIndices[0] === i - ) { - this.immediateMode.contourIndices.shift(); - contours.push([]); - } - contours[contours.length - 1].push( - this.immediateMode.geometry.vertices[i].x, - this.immediateMode.geometry.vertices[i].y, - this.immediateMode.geometry.vertices[i].z, - this.immediateMode.geometry.uvs[i * 2], - this.immediateMode.geometry.uvs[i * 2 + 1], - this.immediateMode.geometry.vertexColors[i * 4], - this.immediateMode.geometry.vertexColors[i * 4 + 1], - this.immediateMode.geometry.vertexColors[i * 4 + 2], - this.immediateMode.geometry.vertexColors[i * 4 + 3], - this.immediateMode.geometry.vertexNormals[i].x, - this.immediateMode.geometry.vertexNormals[i].y, - this.immediateMode.geometry.vertexNormals[i].z, - ); - } - var polyTriangles = this._triangulate(contours); - var originalVertices = this.immediateMode.geometry.vertices; - this.immediateMode.geometry.vertices = []; - this.immediateMode.geometry.vertexNormals = []; - this.immediateMode.geometry.uvs = []; - var colors = []; - for ( - var j = 0, polyTriLength = polyTriangles.length; - j < polyTriLength; - j = j + _main.default.RendererGL.prototype.tessyVertexSize - ) { - colors.push.apply( - colors, - _toConsumableArray(polyTriangles.slice(j + 5, j + 9)), - ); - this.normal.apply( - this, - _toConsumableArray(polyTriangles.slice(j + 9, j + 12)), - ); - this.vertex.apply( - this, - _toConsumableArray(polyTriangles.slice(j, j + 5)), - ); - } - if (this.geometryBuilder) { - // Tesselating the face causes the indices of edge vertices to stop being - // correct. When rendering, this is not a problem, since _edgesToVertices - // will have been called before this, and edge vertex indices are no longer - // needed. However, the geometry builder still needs this information, so - // when one is active, we need to update the indices. - // - // We record index mappings in a Map so that once we have found a - // corresponding vertex, we don't need to loop to find it again. - var newIndex = new Map(); - this.immediateMode.geometry.edges = - this.immediateMode.geometry.edges.map(function (edge) { - return edge.map(function (origIdx) { - if (!newIndex.has(origIdx)) { - var orig = originalVertices[origIdx]; - var newVertIndex = - _this.immediateMode.geometry.vertices.findIndex( - function (v) { - return ( - orig.x === v.x && orig.y === v.y && orig.z === v.z - ); - }, - ); - if (newVertIndex === -1) { - // The tesselation process didn't output a vertex with the exact - // coordinate as before, potentially due to numerical issues. This - // doesn't happen often, but in this case, pick the closest point - var closestDist = Infinity; - var closestIndex = 0; - for ( - var _i = 0; - _i < _this.immediateMode.geometry.vertices.length; - _i++ - ) { - var vert = _this.immediateMode.geometry.vertices[_i]; - var dX = orig.x - vert.x; - var dY = orig.y - vert.y; - var dZ = orig.z - vert.z; - var dist = dX * dX + dY * dY + dZ * dZ; - if (dist < closestDist) { - closestDist = dist; - closestIndex = _i; - } - } - newVertIndex = closestIndex; - } - newIndex.set(origIdx, newVertIndex); - } - return newIndex.get(origIdx); - }); - }); - } - this.immediateMode.geometry.vertexColors = colors; - }; - /** - * Called from endShape(). Responsible for calculating normals, setting shader uniforms, - * enabling all appropriate buffers, applying color blend, and drawing the fill geometry. - * @private - */ - _main.default.RendererGL.prototype._drawImmediateFill = function () { - var count = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : 1; - var gl = this.GL; - this._useVertexColor = - this.immediateMode.geometry.vertexColors.length > 0; - var shader; - shader = this._getImmediateFillShader(); - this._setFillUniforms(shader); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = - this.immediateMode.buffers.fill[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()).done); - _iteratorNormalCompletion = true - ) { - var buff = _step.value; - buff._prepareBuffer(this.immediateMode.geometry, shader); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - shader.disableRemainingAttributes(); - this._applyColorBlend(this.curFillColor); - if (count === 1) { - gl.drawArrays( - this.immediateMode.shapeMode, - 0, - this.immediateMode.geometry.vertices.length, - ); - } else { - try { - gl.drawArraysInstanced( - this.immediateMode.shapeMode, - 0, - this.immediateMode.geometry.vertices.length, - count, - ); - } catch (e) { - console.log( - "🌸 p5.js says: Instancing is only supported in WebGL2 mode", - ); - } - } - shader.unbindShader(); - }; - /** - * Called from endShape(). Responsible for calculating normals, setting shader uniforms, - * enabling all appropriate buffers, applying color blend, and drawing the stroke geometry. - * @private - */ - _main.default.RendererGL.prototype._drawImmediateStroke = - function () { - var gl = this.GL; - this._useLineColor = - this.immediateMode.geometry.vertexStrokeColors.length > 0; - var shader = this._getImmediateStrokeShader(); - this._setStrokeUniforms(shader); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = - this.immediateMode.buffers.stroke[Symbol.iterator](), - _step2; - !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) - .done); - _iteratorNormalCompletion2 = true - ) { - var buff = _step2.value; - buff._prepareBuffer(this.immediateMode.geometry, shader); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - shader.disableRemainingAttributes(); - this._applyColorBlend(this.curStrokeColor); - gl.drawArrays( - gl.TRIANGLES, - 0, - this.immediateMode.geometry.lineVertices.length / 3, - ); - shader.unbindShader(); - }; - var _default = _main.default.RendererGL; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.RenderBuffer": 352, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.find-index": 174, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.map": 182, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.map": 187, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 354: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.uint16-array"); - _dereq_("core-js/modules/es.typed-array.uint32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.uint16-array"); - _dereq_("core-js/modules/es.typed-array.uint32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - _dereq_("./p5.RendererGL"); - _dereq_("./p5.RenderBuffer"); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } //Retained Mode. The default mode for rendering 3D primitives - //in WEBGL. - /** - * @param {p5.Geometry} geometry The model whose resources will be freed - */ - - _main.default.RendererGL.prototype.freeGeometry = function ( - geometry, - ) { - if (!geometry.gid) { - console.warn( - "The model you passed to freeGeometry does not have an id!", - ); - return; - } - this._freeBuffers(geometry.gid); - }; - /** - * _initBufferDefaults - * @private - * @description initializes buffer defaults. runs each time a new geometry is - * registered - * @param {String} gId key of the geometry object - * @returns {Object} a new buffer object - */ - _main.default.RendererGL.prototype._initBufferDefaults = function ( - gId, - ) { - this._freeBuffers(gId); - //@TODO remove this limit on hashes in retainedMode.geometry - if (Object.keys(this.retainedMode.geometry).length > 1000) { - var key = Object.keys(this.retainedMode.geometry)[0]; - this._freeBuffers(key); - } //create a new entry in our retainedMode.geometry - - return (this.retainedMode.geometry[gId] = {}); - }; - _main.default.RendererGL.prototype._freeBuffers = function (gId) { - var buffers = this.retainedMode.geometry[gId]; - if (!buffers) { - return; - } - delete this.retainedMode.geometry[gId]; - var gl = this.GL; - if (buffers.indexBuffer) { - gl.deleteBuffer(buffers.indexBuffer); - } - function freeBuffers(defs) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = defs[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var def = _step.value; - if (buffers[def.dst]) { - gl.deleteBuffer(buffers[def.dst]); - buffers[def.dst] = null; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } // free all the buffers - - freeBuffers(this.retainedMode.buffers.stroke); - freeBuffers(this.retainedMode.buffers.fill); - }; - /** - * creates a buffers object that holds the WebGL render buffers - * for a geometry. - * @private - * @param {String} gId key of the geometry object - * @param {p5.Geometry} model contains geometry data - */ - _main.default.RendererGL.prototype.createBuffers = function ( - gId, - model, - ) { - var gl = this.GL; - //initialize the gl buffers for our geom groups - var buffers = this._initBufferDefaults(gId); - buffers.model = model; - var indexBuffer = buffers.indexBuffer; - if (model.faces.length) { - // allocate space for faces - if (!indexBuffer) - indexBuffer = buffers.indexBuffer = gl.createBuffer(); - var vals = _main.default.RendererGL.prototype._flatten( - model.faces, - ); - // If any face references a vertex with an index greater than the maximum - // un-singed 16 bit integer, then we need to use a Uint32Array instead of a - // Uint16Array - var hasVertexIndicesOverMaxUInt16 = vals.some(function (v) { - return v > 65535; - }); - var type = hasVertexIndicesOverMaxUInt16 - ? Uint32Array - : Uint16Array; - this._bindBuffer( - indexBuffer, - gl.ELEMENT_ARRAY_BUFFER, - vals, - type, - ); - // If we're using a Uint32Array for our indexBuffer we will need to pass a - // different enum value to WebGL draw triangles. This happens in - // the _drawElements function. - buffers.indexBufferType = hasVertexIndicesOverMaxUInt16 - ? gl.UNSIGNED_INT - : gl.UNSIGNED_SHORT; - // the vertex count is based on the number of faces - buffers.vertexCount = model.faces.length * 3; - } else { - // the index buffer is unused, remove it - if (indexBuffer) { - gl.deleteBuffer(indexBuffer); - buffers.indexBuffer = null; - } // the vertex count comes directly from the model - - buffers.vertexCount = model.vertices ? model.vertices.length : 0; - } - buffers.lineVertexCount = model.lineVertices - ? model.lineVertices.length / 3 - : 0; - return buffers; - }; - /** - * Draws buffers given a geometry key ID - * @private - * @param {String} gId ID in our geom hash - * @chainable - */ - _main.default.RendererGL.prototype.drawBuffers = function (gId) { - var gl = this.GL; - var geometry = this.retainedMode.geometry[gId]; - if ( - !this.geometryBuilder && - this._doFill && - this.retainedMode.geometry[gId].vertexCount > 0 - ) { - this._useVertexColor = geometry.model.vertexColors.length > 0; - var fillShader = this._getRetainedFillShader(); - this._setFillUniforms(fillShader); - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = - this.retainedMode.buffers.fill[Symbol.iterator](), - _step2; - !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()) - .done); - _iteratorNormalCompletion2 = true - ) { - var buff = _step2.value; - buff._prepareBuffer(geometry, fillShader); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - fillShader.disableRemainingAttributes(); - if (geometry.indexBuffer) { - //vertex index buffer - this._bindBuffer(geometry.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); - } - this._applyColorBlend(this.curFillColor); - this._drawElements(gl.TRIANGLES, gId); - fillShader.unbindShader(); - } - if ( - !this.geometryBuilder && - this._doStroke && - geometry.lineVertexCount > 0 - ) { - this._useLineColor = geometry.model.vertexStrokeColors.length > 0; - var strokeShader = this._getRetainedStrokeShader(); - this._setStrokeUniforms(strokeShader); - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = - this.retainedMode.buffers.stroke[Symbol.iterator](), - _step3; - !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) - .done); - _iteratorNormalCompletion3 = true - ) { - var _buff = _step3.value; - _buff._prepareBuffer(geometry, strokeShader); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion3 && - _iterator3.return != null - ) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - strokeShader.disableRemainingAttributes(); - this._applyColorBlend(this.curStrokeColor); - this._drawArrays(gl.TRIANGLES, gId); - strokeShader.unbindShader(); - } - if (this.geometryBuilder) { - this.geometryBuilder.addRetained(geometry); - } - return this; - }; - /** - * Calls drawBuffers() with a scaled model/view matrix. - * - * This is used by various 3d primitive methods (in primitives.js, eg. plane, - * box, torus, etc...) to allow caching of un-scaled geometries. Those - * geometries are generally created with unit-length dimensions, cached as - * such, and then scaled appropriately in this method prior to rendering. - * - * @private - * @method drawBuffersScaled - * @param {String} gId ID in our geom hash - * @param {Number} scaleX the amount to scale in the X direction - * @param {Number} scaleY the amount to scale in the Y direction - * @param {Number} scaleZ the amount to scale in the Z direction - */ - _main.default.RendererGL.prototype.drawBuffersScaled = function ( - gId, - scaleX, - scaleY, - scaleZ, - ) { - var uMVMatrix = this.uMVMatrix.copy(); - try { - this.uMVMatrix.scale(scaleX, scaleY, scaleZ); - this.drawBuffers(gId); - } finally { - this.uMVMatrix = uMVMatrix; - } - }; - _main.default.RendererGL.prototype._drawArrays = function ( - drawMode, - gId, - ) { - this.GL.drawArrays( - drawMode, - 0, - this.retainedMode.geometry[gId].lineVertexCount, - ); - return this; - }; - _main.default.RendererGL.prototype._drawElements = function ( - drawMode, - gId, - ) { - var buffers = this.retainedMode.geometry[gId]; - var gl = this.GL; - // render the fill - if (buffers.indexBuffer) { - // If this model is using a Uint32Array we need to ensure the - // OES_element_index_uint WebGL extension is enabled. - if ( - this._pInst.webglVersion !== constants.WEBGL2 && - buffers.indexBufferType === gl.UNSIGNED_INT - ) { - if (!gl.getExtension("OES_element_index_uint")) { - throw new Error( - "Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.", - ); - } - } // we're drawing faces - - gl.drawElements( - gl.TRIANGLES, - buffers.vertexCount, - buffers.indexBufferType, - 0, - ); - } else { - // drawing vertices - gl.drawArrays(drawMode || gl.TRIANGLES, 0, buffers.vertexCount); - } - }; - _main.default.RendererGL.prototype._drawPoints = function ( - vertices, - vertexBuffer, - ) { - var gl = this.GL; - var pointShader = this._getImmediatePointShader(); - this._setPointUniforms(pointShader); - this._bindBuffer( - vertexBuffer, - gl.ARRAY_BUFFER, - this._vToNArray(vertices), - Float32Array, - gl.STATIC_DRAW, - ); - pointShader.enableAttrib(pointShader.attributes.aPosition, 3); - this._applyColorBlend(this.curStrokeColor); - gl.drawArrays(gl.Points, 0, vertices.length); - pointShader.unbindShader(); - }; - var _default = _main.default.RendererGL; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.RenderBuffer": 352, - "./p5.RendererGL": 355, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.some": 184, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.float32-array": 229, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint16-array": 250, - "core-js/modules/es.typed-array.uint32-array": 251, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 355: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.copy-within"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.reflect.get"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.float64-array"); - _dereq_("core-js/modules/es.typed-array.int16-array"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint16-array"); - _dereq_("core-js/modules/es.typed-array.uint32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.concat"); - _dereq_("core-js/modules/es.array.copy-within"); - _dereq_("core-js/modules/es.array.every"); - _dereq_("core-js/modules/es.array.fill"); - _dereq_("core-js/modules/es.array.from"); - _dereq_("core-js/modules/es.array.includes"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.map"); - _dereq_("core-js/modules/es.object.assign"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.set"); - _dereq_("core-js/modules/es.string.includes"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.float32-array"); - _dereq_("core-js/modules/es.typed-array.float64-array"); - _dereq_("core-js/modules/es.typed-array.int16-array"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.uint16-array"); - _dereq_("core-js/modules/es.typed-array.uint32-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.readPixelsWebGL = readPixelsWebGL; - exports.readPixelWebGL = readPixelWebGL; - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - var _GeometryBuilder = _interopRequireDefault( - _dereq_("./GeometryBuilder"), - ); - var _libtess = _interopRequireDefault(_dereq_("libtess")); - _dereq_("./p5.Shader"); - _dereq_("./p5.Camera"); - _dereq_("../core/p5.Renderer"); - _dereq_("./p5.Matrix"); - _dereq_("./p5.Framebuffer"); - var _path = _dereq_("path"); - var _p6 = _dereq_("./p5.Texture"); - var _filterShaderFrags; - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _toConsumableArray(arr) { - return ( - _arrayWithoutHoles(arr) || - _iterableToArray(arr) || - _nonIterableSpread() - ); - } - function _nonIterableSpread() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function _iterableToArray(iter) { - if ( - Symbol.iterator in Object(iter) || - Object.prototype.toString.call(iter) === "[object Arguments]" - ) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for ( - var i = 0, arr2 = new Array(arr.length); - i < arr.length; - i++ - ) { - arr2[i] = arr[i]; - } - return arr2; - } - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(receiver); - } - return desc.value; - }; - } - return _get(target, property, receiver || target); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true, - }); - } else { - obj[key] = value; - } - return obj; - } - var STROKE_CAP_ENUM = {}; - var STROKE_JOIN_ENUM = {}; - var lineDefs = ""; - var defineStrokeCapEnum = function defineStrokeCapEnum(key, val) { - lineDefs += "#define STROKE_CAP_" - .concat(key, " ") - .concat(val, "\n"); - STROKE_CAP_ENUM[constants[key]] = val; - }; - var defineStrokeJoinEnum = function defineStrokeJoinEnum(key, val) { - lineDefs += "#define STROKE_JOIN_" - .concat(key, " ") - .concat(val, "\n"); - STROKE_JOIN_ENUM[constants[key]] = val; - }; - // Define constants in line shaders for each type of cap/join, and also record - // the values in JS objects - defineStrokeCapEnum("ROUND", 0); - defineStrokeCapEnum("PROJECT", 1); - defineStrokeCapEnum("SQUARE", 2); - defineStrokeJoinEnum("ROUND", 0); - defineStrokeJoinEnum("MITER", 1); - defineStrokeJoinEnum("BEVEL", 2); - var lightingShader = - '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'; - var webgl2CompatibilityShader = - "#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n"; - var defaultShaders = { - immediateVert: - "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n", - vertexColorVert: - "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n", - vertexColorFrag: - "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", - normalVert: - "IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", - normalFrag: - "IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n", - basicFrag: - "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", - lightVert: - lightingShader + - "// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", - lightTextureFrag: - "uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n", - phongVert: - "precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", - phongFrag: - lightingShader + - "// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n", - fontVert: - "IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n", - fontFrag: - "#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of 't' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n", - lineVert: - lineDefs + - "/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n", - lineFrag: - lineDefs + - "precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", - pointVert: - "IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n", - pointFrag: - "precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n", - imageLightVert: - "precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n", - imageLightDiffusedFrag: - "precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}", - imageLightSpecularFrag: - "precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n", - }; - for (var key in defaultShaders) { - defaultShaders[key] = - webgl2CompatibilityShader + defaultShaders[key]; - } - var filterShaderFrags = - ((_filterShaderFrags = {}), - _defineProperty( - _filterShaderFrags, - constants.GRAY, - "precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.ERODE, - "// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.DILATE, - "// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.BLUR, - "precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.POSTERIZE, - "// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.OPAQUE, - "// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.INVERT, - "// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n", - ), - _defineProperty( - _filterShaderFrags, - constants.THRESHOLD, - "// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n", - ), - _filterShaderFrags); - var filterShaderVert = - "uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n"; - /** - * @module Rendering - * @submodule Rendering - * @for p5 - */ - /** - * Set attributes for the WebGL Drawing context. - * This is a way of adjusting how the WebGL - * renderer works to fine-tune the display and performance. - * - * Note that this will reinitialize the drawing context - * if called after the WebGL canvas is made. - * - * If an object is passed as the parameter, all attributes - * not declared in the object will be set to defaults. - * - * The available attributes are: - *
                                  - * alpha - indicates if the canvas contains an alpha buffer - * default is true - * - * depth - indicates whether the drawing buffer has a depth buffer - * of at least 16 bits - default is true - * - * stencil - indicates whether the drawing buffer has a stencil buffer - * of at least 8 bits - * - * antialias - indicates whether or not to perform anti-aliasing - * default is false (true in Safari) - * - * premultipliedAlpha - indicates that the page compositor will assume - * the drawing buffer contains colors with pre-multiplied alpha - * default is true - * - * preserveDrawingBuffer - if true the buffers will not be cleared and - * and will preserve their values until cleared or overwritten by author - * (note that p5 clears automatically on draw loop) - * default is true - * - * perPixelLighting - if true, per-pixel lighting will be used in the - * lighting shader otherwise per-vertex lighting is used. - * default is true. - * - * version - either 1 or 2, to specify which WebGL version to ask for. By - * default, WebGL 2 will be requested. If WebGL2 is not available, it will - * fall back to WebGL 1. You can check what version is used with by looking at - * the global `webglVersion` property. - * - * @method setAttributes - * @for p5 - * @param {String} key Name of attribute - * @param {Boolean} value New value of named attribute - * @example - *
                                  - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(255); - * push(); - * rotateZ(frameCount * 0.02); - * rotateX(frameCount * 0.02); - * rotateY(frameCount * 0.02); - * fill(0, 0, 0); - * box(50); - * pop(); - * } - * - *
                                  - *
                                  - * Now with the antialias attribute set to true. - *
                                  - *
                                  - * - * function setup() { - * setAttributes('antialias', true); - * createCanvas(100, 100, WEBGL); - * } - * - * function draw() { - * background(255); - * push(); - * rotateZ(frameCount * 0.02); - * rotateX(frameCount * 0.02); - * rotateY(frameCount * 0.02); - * fill(0, 0, 0); - * box(50); - * pop(); - * } - * - *
                                  - * - *
                                  - * - * // press the mouse button to disable perPixelLighting - * function setup() { - * createCanvas(100, 100, WEBGL); - * noStroke(); - * fill(255); - * } - * - * let lights = [ - * { c: '#f00', t: 1.12, p: 1.91, r: 0.2 }, - * { c: '#0f0', t: 1.21, p: 1.31, r: 0.2 }, - * { c: '#00f', t: 1.37, p: 1.57, r: 0.2 }, - * { c: '#ff0', t: 1.12, p: 1.91, r: 0.7 }, - * { c: '#0ff', t: 1.21, p: 1.31, r: 0.7 }, - * { c: '#f0f', t: 1.37, p: 1.57, r: 0.7 } - * ]; - * - * function draw() { - * let t = millis() / 1000 + 1000; - * background(0); - * directionalLight(color('#222'), 1, 1, 1); - * - * for (let i = 0; i < lights.length; i++) { - * let light = lights[i]; - * pointLight( - * color(light.c), - * p5.Vector.fromAngles(t * light.t, t * light.p, width * light.r) - * ); - * } - * - * specularMaterial(255); - * sphere(width * 0.1); - * - * rotateX(t * 0.77); - * rotateY(t * 0.83); - * rotateZ(t * 0.91); - * torus(width * 0.3, width * 0.07, 24, 10); - * } - * - * function mousePressed() { - * setAttributes('perPixelLighting', false); - * noStroke(); - * fill(255); - * } - * function mouseReleased() { - * setAttributes('perPixelLighting', true); - * noStroke(); - * fill(255); - * } - * - *
                                  - * - * @alt a rotating cube with smoother edges - */ - /** - * @method setAttributes - * @for p5 - * @param {Object} obj object with key-value pairs - */ - _main.default.prototype.setAttributes = function (key, value) { - if (typeof this._glAttributes === "undefined") { - console.log( - "You are trying to use setAttributes on a p5.Graphics object " + - "that does not use a WEBGL renderer.", - ); - return; - } - var unchanged = true; - if (typeof value !== "undefined") { - //first time modifying the attributes - if (this._glAttributes === null) { - this._glAttributes = {}; - } - if (this._glAttributes[key] !== value) { - //changing value of previously altered attribute - this._glAttributes[key] = value; - unchanged = false; - } //setting all attributes with some change - } else if (key instanceof Object) { - if (this._glAttributes !== key) { - this._glAttributes = key; - unchanged = false; - } - } //@todo_FES - - if (!this._renderer.isP3D || unchanged) { - return; - } - if (!this._setupDone) { - for (var x in this._renderer.retainedMode.geometry) { - if (this._renderer.retainedMode.geometry.hasOwnProperty(x)) { - _main.default._friendlyError( - "Sorry, Could not set the attributes, you need to call setAttributes() " + - "before calling the other drawing methods in setup()", - ); - return; - } - } - } - this.push(); - this._renderer._resetContext(); - this.pop(); - if (this._renderer._curCamera) { - this._renderer._curCamera._renderer = this._renderer; - } - }; - /** - * @private - * @param {Uint8Array|Float32Array|undefined} pixels An existing pixels array to reuse if the size is the same - * @param {WebGLRenderingContext} gl The WebGL context - * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read - * @param {Number} x The x coordiante to read, premultiplied by pixel density - * @param {Number} y The y coordiante to read, premultiplied by pixel density - * @param {Number} width The width in pixels to be read (factoring in pixel density) - * @param {Number} height The height in pixels to be read (factoring in pixel density) - * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read - * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT - * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about - * @returns {Uint8Array|Float32Array} pixels A pixels array with the current state of the - * WebGL context read into it - */ - function readPixelsWebGL( - pixels, - gl, - framebuffer, - x, - y, - width, - height, - format, - type, - flipY, - ) { - // Record the currently bound framebuffer so we can go back to it after, and - // bind the framebuffer we want to read from - var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); - var channels = format === gl.RGBA ? 4 : 3; - // Make a pixels buffer if it doesn't already exist - var len = width * height * channels; - var TypedArrayClass = - type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; - if (!(pixels instanceof TypedArrayClass) || pixels.length !== len) { - pixels = new TypedArrayClass(len); - } - gl.readPixels( - x, - flipY ? flipY - y - height : y, - width, - height, - format, - type, - pixels, - ); - // Re-bind whatever was previously bound - gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); - if (flipY) { - // WebGL pixels are inverted compared to 2D pixels, so we have to flip - // the resulting rows. Adapted from https://stackoverflow.com/a/41973289 - var halfHeight = Math.floor(height / 2); - var tmpRow = new TypedArrayClass(width * channels); - for (var _y = 0; _y < halfHeight; _y++) { - var topOffset = _y * width * 4; - var bottomOffset = (height - _y - 1) * width * 4; - tmpRow.set(pixels.subarray(topOffset, topOffset + width * 4)); - pixels.copyWithin( - topOffset, - bottomOffset, - bottomOffset + width * 4, - ); - pixels.set(tmpRow, bottomOffset); - } - } - return pixels; - } /** - * @private - * @param {WebGLRenderingContext} gl The WebGL context - * @param {WebGLFramebuffer|null} framebuffer The Framebuffer to read - * @param {Number} x The x coordinate to read, premultiplied by pixel density - * @param {Number} y The y coordinate to read, premultiplied by pixel density - * @param {GLEnum} format Either RGB or RGBA depending on how many channels to read - * @param {GLEnum} type The datatype of each channel, e.g. UNSIGNED_BYTE or FLOAT - * @param {Number|undefined} flipY If provided, the total height with which to flip the y axis about - * @returns {Number[]} pixels The channel data for the pixel at that location - */ - - function readPixelWebGL(gl, framebuffer, x, y, format, type, flipY) { - // Record the currently bound framebuffer so we can go back to it after, and - // bind the framebuffer we want to read from - var prevFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING); - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); - var channels = format === gl.RGBA ? 4 : 3; - var TypedArrayClass = - type === gl.UNSIGNED_BYTE ? Uint8Array : Float32Array; - var pixels = new TypedArrayClass(channels); - gl.readPixels( - x, - flipY ? flipY - y - 1 : y, - 1, - 1, - format, - type, - pixels, - ); - // Re-bind whatever was previously bound - gl.bindFramebuffer(gl.FRAMEBUFFER, prevFramebuffer); - return Array.from(pixels); - } /** - * 3D graphics class - * @private - * @class p5.RendererGL - * @constructor - * @extends p5.Renderer - * @todo extend class to include public method for offscreen - * rendering (FBO). - */ - - _main.default.RendererGL = /*#__PURE__*/ (function (_p5$Renderer) { - _inherits(RendererGL, _p5$Renderer); - var _super = _createSuper(RendererGL); - function RendererGL(elt, pInst, isMainCanvas, attr) { - var _this; - _classCallCheck(this, RendererGL); - _this = _super.call(this, elt, pInst, isMainCanvas); - _this._setAttributeDefaults(pInst); - _this._initContext(); - _this.isP3D = true; //lets us know we're in 3d mode - // When constructing a new p5.Geometry, this will represent the builder - _this.geometryBuilder = undefined; - // This redundant property is useful in reminding you that you are - // interacting with WebGLRenderingContext, still worth considering future removal - _this.GL = _this.drawingContext; - _this._pInst._setProperty("drawingContext", _this.drawingContext); - // erasing - _this._isErasing = false; - // clipping - _this._clipDepths = []; - _this._isClipApplied = false; - _this._stencilTestOn = false; - // lights - _this._enableLighting = false; - _this.ambientLightColors = []; - _this.specularColors = [1, 1, 1]; - _this.directionalLightDirections = []; - _this.directionalLightDiffuseColors = []; - _this.directionalLightSpecularColors = []; - _this.pointLightPositions = []; - _this.pointLightDiffuseColors = []; - _this.pointLightSpecularColors = []; - _this.spotLightPositions = []; - _this.spotLightDirections = []; - _this.spotLightDiffuseColors = []; - _this.spotLightSpecularColors = []; - _this.spotLightAngle = []; - _this.spotLightConc = []; - // This property contains the input image if imageLight function - // is called. - // activeImageLight is checked by _setFillUniforms - // for sending uniforms to the fillshader - _this.activeImageLight = null; - // If activeImageLight property is Null, diffusedTextures, - // specularTextures are Empty. - // Else, it maps a p5.Image used by imageLight() to a p5.Graphics. - // p5.Graphics for this are calculated in getDiffusedTexture function - _this.diffusedTextures = new Map(); - // p5.Graphics for this are calculated in getSpecularTexture function - _this.specularTextures = new Map(); - _this.drawMode = constants.FILL; - _this.curFillColor = _this._cachedFillStyle = [1, 1, 1, 1]; - _this.curAmbientColor = _this._cachedFillStyle = [1, 1, 1, 1]; - _this.curSpecularColor = _this._cachedFillStyle = [0, 0, 0, 0]; - _this.curEmissiveColor = _this._cachedFillStyle = [0, 0, 0, 0]; - _this.curStrokeColor = _this._cachedStrokeStyle = [0, 0, 0, 1]; - _this.curBlendMode = constants.BLEND; - _this._cachedBlendMode = undefined; - if (_this.webglVersion === constants.WEBGL2) { - _this.blendExt = _this.GL; - } else { - _this.blendExt = _this.GL.getExtension("EXT_blend_minmax"); - } - _this._isBlending = false; - _this._hasSetAmbient = false; - _this._useSpecularMaterial = false; - _this._useEmissiveMaterial = false; - _this._useNormalMaterial = false; - _this._useShininess = 1; - _this._useLineColor = false; - _this._useVertexColor = false; - _this.registerEnabled = new Set(); - _this._tint = [255, 255, 255, 255]; - // lightFalloff variables - _this.constantAttenuation = 1; - _this.linearAttenuation = 0; - _this.quadraticAttenuation = 0; - /** - * model view, projection, & normal - * matrices - */ - _this.uMVMatrix = new _main.default.Matrix(); - _this.uPMatrix = new _main.default.Matrix(); - _this.uNMatrix = new _main.default.Matrix("mat3"); - // Current vertex normal - _this._currentNormal = new _main.default.Vector(0, 0, 1); - // Camera - _this._curCamera = new _main.default.Camera( - _assertThisInitialized(_this), - ); - _this._curCamera._computeCameraDefaultSettings(); - _this._curCamera._setDefaultCamera(); - // FilterCamera - _this.filterCamera = new _main.default.Camera( - _assertThisInitialized(_this), - ); - _this.filterCamera._computeCameraDefaultSettings(); - _this.filterCamera._setDefaultCamera(); - // Information about the previous frame's touch object - // for executing orbitControl() - _this.prevTouches = []; - // Velocity variable for use with orbitControl() - _this.zoomVelocity = 0; - _this.rotateVelocity = new _main.default.Vector(0, 0); - _this.moveVelocity = new _main.default.Vector(0, 0); - // Flags for recording the state of zooming, rotation and moving - _this.executeZoom = false; - _this.executeRotateAndMove = false; - _this._defaultLightShader = undefined; - _this._defaultImmediateModeShader = undefined; - _this._defaultNormalShader = undefined; - _this._defaultColorShader = undefined; - _this._defaultPointShader = undefined; - _this.userFillShader = undefined; - _this.userStrokeShader = undefined; - _this.userPointShader = undefined; - // Default drawing is done in Retained Mode - // Geometry and Material hashes stored here - _this.retainedMode = { - geometry: {}, - buffers: { - stroke: [ - new _main.default.RenderBuffer( - 4, - "lineVertexColors", - "lineColorBuffer", - "aVertexColor", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "lineVertices", - "lineVerticesBuffer", - "aPosition", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "lineTangentsIn", - "lineTangentsInBuffer", - "aTangentIn", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "lineTangentsOut", - "lineTangentsOutBuffer", - "aTangentOut", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 1, - "lineSides", - "lineSidesBuffer", - "aSide", - _assertThisInitialized(_this), - ), - ], - fill: [ - new _main.default.RenderBuffer( - 3, - "vertices", - "vertexBuffer", - "aPosition", - _assertThisInitialized(_this), - _this._vToNArray, - ), - new _main.default.RenderBuffer( - 3, - "vertexNormals", - "normalBuffer", - "aNormal", - _assertThisInitialized(_this), - _this._vToNArray, - ), - new _main.default.RenderBuffer( - 4, - "vertexColors", - "colorBuffer", - "aVertexColor", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "vertexAmbients", - "ambientBuffer", - "aAmbientColor", - _assertThisInitialized(_this), - ), - //new BufferDef(3, 'vertexSpeculars', 'specularBuffer', 'aSpecularColor'), - new _main.default.RenderBuffer( - 2, - "uvs", - "uvBuffer", - "aTexCoord", - _assertThisInitialized(_this), - _this._flatten, - ), - ], - text: [ - new _main.default.RenderBuffer( - 3, - "vertices", - "vertexBuffer", - "aPosition", - _assertThisInitialized(_this), - _this._vToNArray, - ), - new _main.default.RenderBuffer( - 2, - "uvs", - "uvBuffer", - "aTexCoord", - _assertThisInitialized(_this), - _this._flatten, - ), - ], - }, - }; - // Immediate Mode - // Geometry and Material hashes stored here - _this.immediateMode = { - geometry: new _main.default.Geometry(), - shapeMode: constants.TRIANGLE_FAN, - contourIndices: [], - _bezierVertex: [], - _quadraticVertex: [], - _curveVertex: [], - buffers: { - fill: [ - new _main.default.RenderBuffer( - 3, - "vertices", - "vertexBuffer", - "aPosition", - _assertThisInitialized(_this), - _this._vToNArray, - ), - new _main.default.RenderBuffer( - 3, - "vertexNormals", - "normalBuffer", - "aNormal", - _assertThisInitialized(_this), - _this._vToNArray, - ), - new _main.default.RenderBuffer( - 4, - "vertexColors", - "colorBuffer", - "aVertexColor", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "vertexAmbients", - "ambientBuffer", - "aAmbientColor", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 2, - "uvs", - "uvBuffer", - "aTexCoord", - _assertThisInitialized(_this), - _this._flatten, - ), - ], - stroke: [ - new _main.default.RenderBuffer( - 4, - "lineVertexColors", - "lineColorBuffer", - "aVertexColor", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "lineVertices", - "lineVerticesBuffer", - "aPosition", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "lineTangentsIn", - "lineTangentsInBuffer", - "aTangentIn", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 3, - "lineTangentsOut", - "lineTangentsOutBuffer", - "aTangentOut", - _assertThisInitialized(_this), - ), - new _main.default.RenderBuffer( - 1, - "lineSides", - "lineSidesBuffer", - "aSide", - _assertThisInitialized(_this), - ), - ], - point: _this.GL.createBuffer(), - }, - }; - _this.pointSize = 5; //default point size - _this.curStrokeWeight = 1; - _this.curStrokeCap = constants.ROUND; - _this.curStrokeJoin = constants.ROUND; - // map of texture sources to textures created in this gl context via this.getTexture(src) - _this.textures = new Map(); - // set of framebuffers in use - _this.framebuffers = new Set(); - // stack of active framebuffers - _this.activeFramebuffers = []; - // for post processing step - _this.filterShader = undefined; - _this.filterLayer = undefined; - _this.filterLayerTemp = undefined; - _this.defaultFilterShaders = {}; - _this.textureMode = constants.IMAGE; - // default wrap settings - _this.textureWrapX = constants.CLAMP; - _this.textureWrapY = constants.CLAMP; - _this._tex = null; - _this._curveTightness = 6; - // lookUpTable for coefficients needed to be calculated for bezierVertex, same are used for curveVertex - _this._lookUpTableBezier = []; - // lookUpTable for coefficients needed to be calculated for quadraticVertex - _this._lookUpTableQuadratic = []; - // current curveDetail in the Bezier lookUpTable - _this._lutBezierDetail = 0; - // current curveDetail in the Quadratic lookUpTable - _this._lutQuadraticDetail = 0; - // Used to distinguish between user calls to vertex() and internal calls - _this.isProcessingVertices = false; - _this._tessy = _this._initTessy(); - _this.fontInfos = {}; - _this._curShader = undefined; - return _this; - } /** - * Starts creating a new p5.Geometry. Subsequent shapes drawn will be added - * to the geometry and then returned when - * endGeometry() is called. One can also use - * buildGeometry() to pass a function that - * draws shapes. - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them upfront with `beginGeometry()` and `endGeometry()` and then - * drawing that will run faster than repeatedly drawing the individual pieces. - * - * @method beginGeometry - */ - - _createClass(RendererGL, [ - { - key: "beginGeometry", - value: function beginGeometry() { - if (this.geometryBuilder) { - throw new Error( - "It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.", - ); - } - this.geometryBuilder = new _GeometryBuilder.default(this); - } /** - * Finishes creating a new p5.Geometry that was - * started using beginGeometry(). One can also - * use buildGeometry() to pass a function that - * draws shapes. - * - * @method endGeometry - * @returns {p5.Geometry} The model that was built. - */, - }, - { - key: "endGeometry", - value: function endGeometry() { - if (!this.geometryBuilder) { - throw new Error( - "Make sure you call beginGeometry() before endGeometry()!", - ); - } - var geometry = this.geometryBuilder.finish(); - this.geometryBuilder = undefined; - return geometry; - } /** - * Creates a new p5.Geometry that contains all - * the shapes drawn in a provided callback function. The returned combined shape - * can then be drawn all at once using model(). - * - * If you need to draw complex shapes every frame which don't change over time, - * combining them with `buildGeometry()` once and then drawing that will run - * faster than repeatedly drawing the individual pieces. - * - * One can also draw shapes directly between - * beginGeometry() and - * endGeometry() instead of using a callback - * function. - * - * @method buildGeometry - * @param {Function} callback A function that draws shapes. - * @returns {p5.Geometry} The model that was built from the callback function. - */, - }, - { - key: "buildGeometry", - value: function buildGeometry(callback) { - this.beginGeometry(); - callback(); - return this.endGeometry(); - }, ////////////////////////////////////////////// - // Setting - ////////////////////////////////////////////// - }, - { - key: "_setAttributeDefaults", - value: function _setAttributeDefaults(pInst) { - // See issue #3850, safer to enable AA in Safari - var applyAA = navigator.userAgent - .toLowerCase() - .includes("safari"); - var defaults = { - alpha: true, - depth: true, - stencil: true, - antialias: applyAA, - premultipliedAlpha: true, - preserveDrawingBuffer: true, - perPixelLighting: true, - version: 2, - }; - if (pInst._glAttributes === null) { - pInst._glAttributes = defaults; - } else { - pInst._glAttributes = Object.assign( - defaults, - pInst._glAttributes, - ); - } - return; - }, - }, - { - key: "_initContext", - value: function _initContext() { - if (this._pInst._glAttributes.version !== 1) { - // Unless WebGL1 is explicitly asked for, try to create a WebGL2 context - this.drawingContext = this.canvas.getContext( - "webgl2", - this._pInst._glAttributes, - ); - } - this.webglVersion = this.drawingContext - ? constants.WEBGL2 - : constants.WEBGL; - // If this is the main canvas, make sure the global `webglVersion` is set - this._pInst._setProperty("webglVersion", this.webglVersion); - if (!this.drawingContext) { - // If we were unable to create a WebGL2 context (either because it was - // disabled via `setAttributes({ version: 1 })` or because the device - // doesn't support it), fall back to a WebGL1 context - this.drawingContext = - this.canvas.getContext( - "webgl", - this._pInst._glAttributes, - ) || - this.canvas.getContext( - "experimental-webgl", - this._pInst._glAttributes, - ); - } - if (this.drawingContext === null) { - throw new Error("Error creating webgl context"); - } else { - var gl = this.drawingContext; - gl.enable(gl.DEPTH_TEST); - gl.depthFunc(gl.LEQUAL); - gl.viewport( - 0, - 0, - gl.drawingBufferWidth, - gl.drawingBufferHeight, - ); - // Make sure all images are loaded into the canvas premultiplied so that - // they match the way we render colors. This will make framebuffer textures - // be encoded the same way as textures from everything else. - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - this._viewport = this.drawingContext.getParameter( - this.drawingContext.VIEWPORT, - ); - } - }, //This is helper function to reset the context anytime the attributes - //are changed with setAttributes() - }, - { - key: "_resetContext", - value: function _resetContext(options, callback) { - var w = this.width; - var h = this.height; - var defaultId = this.canvas.id; - var isPGraphics = - this._pInst instanceof _main.default.Graphics; - if (isPGraphics) { - var pg = this._pInst; - pg.canvas.parentNode.removeChild(pg.canvas); - pg.canvas = document.createElement("canvas"); - var node = pg._pInst._userNode || document.body; - node.appendChild(pg.canvas); - _main.default.Element.call(pg, pg.canvas, pg._pInst); - pg.width = w; - pg.height = h; - } else { - var c = this.canvas; - if (c) { - c.parentNode.removeChild(c); - } - c = document.createElement("canvas"); - c.id = defaultId; - if (this._pInst._userNode) { - this._pInst._userNode.appendChild(c); - } else { - document.body.appendChild(c); - } - this._pInst.canvas = c; - this.canvas = c; - } - var renderer = new _main.default.RendererGL( - this._pInst.canvas, - this._pInst, - !isPGraphics, - ); - this._pInst._setProperty("_renderer", renderer); - renderer.resize(w, h); - renderer._applyDefaults(); - if (!isPGraphics) { - this._pInst._elements.push(renderer); - } - if (typeof callback === "function") { - //setTimeout with 0 forces the task to the back of the queue, this ensures that - //we finish switching out the renderer - setTimeout(function () { - callback.apply(window._renderer, options); - }, 0); - } - } /** - * @class p5.RendererGL - */, - }, - { - key: "_update", - value: function _update() { - // reset model view and apply initial camera transform - // (containing only look at info; no projection). - this.uMVMatrix.set( - this._curCamera.cameraMatrix.mat4[0], - this._curCamera.cameraMatrix.mat4[1], - this._curCamera.cameraMatrix.mat4[2], - this._curCamera.cameraMatrix.mat4[3], - this._curCamera.cameraMatrix.mat4[4], - this._curCamera.cameraMatrix.mat4[5], - this._curCamera.cameraMatrix.mat4[6], - this._curCamera.cameraMatrix.mat4[7], - this._curCamera.cameraMatrix.mat4[8], - this._curCamera.cameraMatrix.mat4[9], - this._curCamera.cameraMatrix.mat4[10], - this._curCamera.cameraMatrix.mat4[11], - this._curCamera.cameraMatrix.mat4[12], - this._curCamera.cameraMatrix.mat4[13], - this._curCamera.cameraMatrix.mat4[14], - this._curCamera.cameraMatrix.mat4[15], - ); - // reset light data for new frame. - this.ambientLightColors.length = 0; - this.specularColors = [1, 1, 1]; - this.directionalLightDirections.length = 0; - this.directionalLightDiffuseColors.length = 0; - this.directionalLightSpecularColors.length = 0; - this.pointLightPositions.length = 0; - this.pointLightDiffuseColors.length = 0; - this.pointLightSpecularColors.length = 0; - this.spotLightPositions.length = 0; - this.spotLightDirections.length = 0; - this.spotLightDiffuseColors.length = 0; - this.spotLightSpecularColors.length = 0; - this.spotLightAngle.length = 0; - this.spotLightConc.length = 0; - this._enableLighting = false; - //reset tint value for new frame - this._tint = [255, 255, 255, 255]; - //Clear depth every frame - this.GL.clearStencil(0); - this.GL.clear( - this.GL.DEPTH_BUFFER_BIT | this.GL.STENCIL_BUFFER_BIT, - ); - this.GL.disable(this.GL.STENCIL_TEST); - } /** - * [background description] - */, - }, - { - key: "background", - value: function background() { - var _this$_pInst; - var _col = (_this$_pInst = this._pInst).color.apply( - _this$_pInst, - arguments, - ); - var _r = _col.levels[0] / 255; - var _g = _col.levels[1] / 255; - var _b = _col.levels[2] / 255; - var _a = _col.levels[3] / 255; - this.clear(_r, _g, _b, _a); - }, ////////////////////////////////////////////// - // COLOR - ////////////////////////////////////////////// - /** - * Basic fill material for geometry with a given color - * @method fill - * @class p5.RendererGL - * @param {Number|Number[]|String|p5.Color} v1 gray value, - * red or hue value (depending on the current color mode), - * or color Array, or CSS color string - * @param {Number} [v2] green or saturation value - * @param {Number} [v3] blue or brightness value - * @param {Number} [a] opacity - * @chainable - * @example - *
                                  - * - * function setup() { - * createCanvas(200, 200, WEBGL); - * } - * - * function draw() { - * background(0); - * noStroke(); - * fill(100, 100, 240); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(75, 75, 75); - * } - * - *
                                  - * - * @alt - * black canvas with purple cube spinning - */ - }, - { - key: "fill", - value: function fill(v1, v2, v3, a) { - //see material.js for more info on color blending in webgl - var color = _main.default.prototype.color.apply( - this._pInst, - arguments, - ); - this.curFillColor = color._array; - this.drawMode = constants.FILL; - this._useNormalMaterial = false; - this._tex = null; - } /** - * Basic stroke material for geometry with a given color - * @method stroke - * @param {Number|Number[]|String|p5.Color} v1 gray value, - * red or hue value (depending on the current color mode), - * or color Array, or CSS color string - * @param {Number} [v2] green or saturation value - * @param {Number} [v3] blue or brightness value - * @param {Number} [a] opacity - * @example - *
                                  - * - * function setup() { - * createCanvas(200, 200, WEBGL); - * } - * - * function draw() { - * background(0); - * stroke(240, 150, 150); - * fill(100, 100, 240); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * box(75, 75, 75); - * } - * - *
                                  - * - * @alt - * black canvas with purple cube with pink outline spinning - */, - }, - { - key: "stroke", - value: function stroke(r, g, b, a) { - var color = _main.default.prototype.color.apply( - this._pInst, - arguments, - ); - this.curStrokeColor = color._array; - }, - }, - { - key: "strokeCap", - value: function strokeCap(cap) { - this.curStrokeCap = cap; - }, - }, - { - key: "strokeJoin", - value: function strokeJoin(join) { - this.curStrokeJoin = join; - }, - }, - { - key: "getFilterLayer", - value: function getFilterLayer() { - if (!this.filterLayer) { - this.filterLayer = this._pInst.createFramebuffer(); - } - return this.filterLayer; - }, - }, - { - key: "getFilterLayerTemp", - value: function getFilterLayerTemp() { - if (!this.filterLayerTemp) { - this.filterLayerTemp = this._pInst.createFramebuffer(); - } - return this.filterLayerTemp; - }, - }, - { - key: "matchSize", - value: function matchSize(fboToMatch, target) { - if ( - fboToMatch.width !== target.width || - fboToMatch.height !== target.height - ) { - fboToMatch.resize(target.width, target.height); - } - if (fboToMatch.pixelDensity() !== target.pixelDensity()) { - fboToMatch.pixelDensity(target.pixelDensity()); - } - }, - }, - { - key: "filter", - value: function filter() { - var _this2 = this; - var fbo = this.getFilterLayer(); - // use internal shader for filter constants BLUR, INVERT, etc - var filterParameter = undefined; - var operation = undefined; - if ( - typeof (arguments.length <= 0 - ? undefined - : arguments[0]) === "string" - ) { - var _defaults; - operation = - arguments.length <= 0 ? undefined : arguments[0]; - var defaults = - ((_defaults = {}), - _defineProperty(_defaults, constants.BLUR, 3), - _defineProperty(_defaults, constants.POSTERIZE, 4), - _defineProperty(_defaults, constants.THRESHOLD, 0.5), - _defaults); - var useDefaultParam = - operation in defaults && - (arguments.length <= 1 ? undefined : arguments[1]) === - undefined; - filterParameter = useDefaultParam - ? defaults[operation] - : arguments.length <= 1 - ? undefined - : arguments[1]; - // Create and store shader for constants once on initial filter call. - // Need to store multiple in case user calls different filters, - // eg. filter(BLUR) then filter(GRAY) - if (!(operation in this.defaultFilterShaders)) { - this.defaultFilterShaders[operation] = - new _main.default.Shader( - fbo._renderer, - filterShaderVert, - filterShaderFrags[operation], - ); - } - this.filterShader = this.defaultFilterShaders[operation]; - } // use custom user-supplied shader - else { - this.filterShader = - arguments.length <= 0 ? undefined : arguments[0]; - } // Setting the target to the framebuffer when applying a filter to a framebuffer. - - var target = this.activeFramebuffer() || this; - // Resize the framebuffer 'fbo' and adjust its pixel density if it doesn't match the target. - this.matchSize(fbo, target); - // Set filterCamera for framebuffers. - if (target !== this) { - this.filterCamera = this.getFilterLayer().createCamera(); - } - fbo.draw(function () { - return _this2._pInst.clear(); - }); // prevent undesirable feedback effects accumulating secretly. - var texelSize = [ - 1 / (target.width * target.pixelDensity()), - 1 / (target.height * target.pixelDensity()), - ]; - // apply blur shader with multiple passes. - if (operation === constants.BLUR) { - // Treating 'tmp' as a framebuffer. - var tmp = this.getFilterLayerTemp(); - // Resize the framebuffer 'tmp' and adjust its pixel density if it doesn't match the target. - this.matchSize(tmp, target); - // setup - this._pInst.push(); - this._pInst.noStroke(); - // draw main to temp buffer - this._pInst.shader(this.filterShader); - this.filterShader.setUniform("texelSize", texelSize); - this.filterShader.setUniform("canvasSize", [ - target.width, - target.height, - ]); - this.filterShader.setUniform( - "radius", - Math.max(1, filterParameter), - ); - // Horiz pass: draw `target` to `tmp` - tmp.draw(function () { - _this2.filterShader.setUniform("direction", [1, 0]); - _this2.filterShader.setUniform("tex0", target); - _this2._pInst.clear(); - _this2._pInst.shader(_this2.filterShader); - _this2._pInst.rect( - -target.width / 2, - -target.height / 2, - target.width, - target.height, - ); - }); - // Vert pass: draw `tmp` to `fbo` - fbo.draw(function () { - _this2.filterShader.setUniform("direction", [0, 1]); - _this2.filterShader.setUniform("tex0", tmp); - _this2._pInst.clear(); - _this2._pInst.shader(_this2.filterShader); - _this2._pInst.rect( - -target.width / 2, - -target.height / 2, - target.width, - target.height, - ); - }); - this._pInst.pop(); - } // every other non-blur shader uses single pass - else { - fbo.draw(function () { - _this2._pInst.noStroke(); - _this2._pInst.shader(_this2.filterShader); - _this2.filterShader.setUniform("tex0", target); - _this2.filterShader.setUniform("texelSize", texelSize); - _this2.filterShader.setUniform("canvasSize", [ - target.width, - target.height, - ]); - // filterParameter uniform only used for POSTERIZE, and THRESHOLD - // but shouldn't hurt to always set - _this2.filterShader.setUniform( - "filterParameter", - filterParameter, - ); - _this2._pInst.rect( - -target.width / 2, - -target.height / 2, - target.width, - target.height, - ); - }); - } // draw fbo contents onto main renderer. - - this._pInst.push(); - this._pInst.noStroke(); - this.clear(); - this._pInst.push(); - this._pInst.imageMode(constants.CORNER); - this._pInst.blendMode(constants.BLEND); - this.filterCamera._resize(); - this._pInst.setCamera(this.filterCamera); - this._pInst.resetMatrix(); - this._pInst.image( - fbo, - -this.width / 2, - -this.height / 2, - this.width, - this.height, - ); - this._pInst.pop(); - this._pInst.pop(); - }, // Pass this off to the host instance so that we can treat a renderer and a - // framebuffer the same in filter() - }, - { - key: "pixelDensity", - value: function pixelDensity(newDensity) { - if (newDensity) { - return this._pInst.pixelDensity(newDensity); - } - return this._pInst.pixelDensity(); - }, - }, - { - key: "blendMode", - value: function blendMode(mode) { - if ( - mode === constants.DARKEST || - mode === constants.LIGHTEST || - mode === constants.ADD || - mode === constants.BLEND || - mode === constants.SUBTRACT || - mode === constants.SCREEN || - mode === constants.EXCLUSION || - mode === constants.REPLACE || - mode === constants.MULTIPLY || - mode === constants.REMOVE - ) - this.curBlendMode = mode; - else if ( - mode === constants.BURN || - mode === constants.OVERLAY || - mode === constants.HARD_LIGHT || - mode === constants.SOFT_LIGHT || - mode === constants.DODGE - ) { - console.warn( - "BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.", - ); - } - }, - }, - { - key: "erase", - value: function erase(opacityFill, opacityStroke) { - if (!this._isErasing) { - this._cachedBlendMode = this.curBlendMode; - this._isErasing = true; - this.blendMode(constants.REMOVE); - this._cachedFillStyle = this.curFillColor.slice(); - this.curFillColor = [1, 1, 1, opacityFill / 255]; - this._cachedStrokeStyle = this.curStrokeColor.slice(); - this.curStrokeColor = [1, 1, 1, opacityStroke / 255]; - } - }, - }, - { - key: "noErase", - value: function noErase() { - if (this._isErasing) { - this.curFillColor = this._cachedFillStyle.slice(); - this.curStrokeColor = this._cachedStrokeStyle.slice(); - // It's necessary to restore post-erase state. Needs rework - var temp = this.curBlendMode; - this.blendMode(this._cachedBlendMode); - this._cachedBlendMode = temp; // If we don't do this, applyBlendMode() returns null - this._isErasing = false; - this._applyBlendMode(); // This sets _cachedBlendMode back to the original blendmode - } - }, - }, - { - key: "drawTarget", - value: function drawTarget() { - return ( - this.activeFramebuffers[ - this.activeFramebuffers.length - 1 - ] || this - ); - }, - }, - { - key: "beginClip", - value: function beginClip() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - _get( - _getPrototypeOf(RendererGL.prototype), - "beginClip", - this, - ).call(this, options); - this.drawTarget()._isClipApplied = true; - var gl = this.GL; - gl.clearStencil(0); - gl.clear(gl.STENCIL_BUFFER_BIT); - gl.enable(gl.STENCIL_TEST); - this._stencilTestOn = true; - gl.stencilFunc( - gl.ALWAYS, // the test - 1, // reference value - 255, // mask - ); - gl.stencilOp( - gl.KEEP, // what to do if the stencil test fails - gl.KEEP, // what to do if the depth test fails - gl.REPLACE, // what to do if both tests pass - ); - gl.disable(gl.DEPTH_TEST); - this._pInst.push(); - this._pInst.resetShader(); - if (this._doFill) this._pInst.fill(0, 0); - if (this._doStroke) this._pInst.stroke(0, 0); - }, - }, - { - key: "endClip", - value: function endClip() { - this._pInst.pop(); - var gl = this.GL; - gl.stencilOp( - gl.KEEP, // what to do if the stencil test fails - gl.KEEP, // what to do if the depth test fails - gl.KEEP, // what to do if both tests pass - ); - gl.stencilFunc( - this._clipInvert ? gl.EQUAL : gl.NOTEQUAL, // the test - 0, // reference value - 255, // mask - ); - gl.enable(gl.DEPTH_TEST); - // Mark the depth at which the clip has been applied so that we can clear it - // when we pop past this depth - this._clipDepths.push(this._pushPopDepth); - _get( - _getPrototypeOf(RendererGL.prototype), - "endClip", - this, - ).call(this); - }, - }, - { - key: "_clearClip", - value: function _clearClip() { - this.GL.clearStencil(1); - this.GL.clear(this.GL.STENCIL_BUFFER_BIT); - if (this._clipDepths.length > 0) { - this._clipDepths.pop(); - } - this.drawTarget()._isClipApplied = false; - } /** - * Change weight of stroke - * @method strokeWeight - * @param {Number} stroke weight to be used for drawing - * @example - *
                                  - * - * function setup() { - * createCanvas(200, 400, WEBGL); - * setAttributes('antialias', true); - * } - * - * function draw() { - * background(0); - * noStroke(); - * translate(0, -100, 0); - * stroke(240, 150, 150); - * fill(100, 100, 240); - * push(); - * strokeWeight(8); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * sphere(75); - * pop(); - * push(); - * translate(0, 200, 0); - * strokeWeight(1); - * rotateX(frameCount * 0.01); - * rotateY(frameCount * 0.01); - * sphere(75); - * pop(); - * } - * - *
                                  - * - * @alt - * black canvas with two purple rotating spheres with pink - * outlines the sphere on top has much heavier outlines, - */, - }, - { - key: "strokeWeight", - value: function strokeWeight(w) { - if (this.curStrokeWeight !== w) { - this.pointSize = w; - this.curStrokeWeight = w; - } - }, // x,y are canvas-relative (pre-scaled by _pixelDensity) - }, - { - key: "_getPixel", - value: function _getPixel(x, y) { - var gl = this.GL; - return readPixelWebGL( - gl, - null, - x, - y, - gl.RGBA, - gl.UNSIGNED_BYTE, - this._pInst.height * this._pInst.pixelDensity(), - ); - } /** - * Loads the pixels data for this canvas into the pixels[] attribute. - * Note that updatePixels() and set() do not work. - * Any pixel manipulation must be done directly to the pixels[] array. - * - * @private - * @method loadPixels - */, - }, - { - key: "loadPixels", - value: function loadPixels() { - var pixelsState = this._pixelsState; - //@todo_FES - if ( - this._pInst._glAttributes.preserveDrawingBuffer !== true - ) { - console.log( - "loadPixels only works in WebGL when preserveDrawingBuffer " + - "is true.", - ); - return; - } - var pd = this._pInst._pixelDensity; - var gl = this.GL; - pixelsState._setProperty( - "pixels", - readPixelsWebGL( - pixelsState.pixels, - gl, - null, - 0, - 0, - this.width * pd, - this.height * pd, - gl.RGBA, - gl.UNSIGNED_BYTE, - this.height * pd, - ), - ); - }, - }, - { - key: "updatePixels", - value: function updatePixels() { - var fbo = this._getTempFramebuffer(); - fbo.pixels = this._pixelsState.pixels; - fbo.updatePixels(); - this._pInst.push(); - this._pInst.resetMatrix(); - this._pInst.clear(); - this._pInst.imageMode(constants.CENTER); - this._pInst.image(fbo, 0, 0); - this._pInst.pop(); - this.GL.clearDepth(1); - this.GL.clear(this.GL.DEPTH_BUFFER_BIT); - } /** - * @private - * @returns {p5.Framebuffer} A p5.Framebuffer set to match the size and settings - * of the renderer's canvas. It will be created if it does not yet exist, and - * reused if it does. - */, - }, - { - key: "_getTempFramebuffer", - value: function _getTempFramebuffer() { - if (!this._tempFramebuffer) { - this._tempFramebuffer = this._pInst.createFramebuffer({ - format: constants.UNSIGNED_BYTE, - useDepth: this._pInst._glAttributes.depth, - depthFormat: constants.UNSIGNED_INT, - antialias: this._pInst._glAttributes.antialias, - }); - } - return this._tempFramebuffer; - }, ////////////////////////////////////////////// - // HASH | for geometry - ////////////////////////////////////////////// - }, - { - key: "geometryInHash", - value: function geometryInHash(gId) { - return this.retainedMode.geometry[gId] !== undefined; - }, - }, - { - key: "viewport", - value: function viewport(w, h) { - this._viewport = [0, 0, w, h]; - this.GL.viewport(0, 0, w, h); - } /** - * [resize description] - * @private - * @param {Number} w [description] - * @param {Number} h [description] - */, - }, - { - key: "resize", - value: function resize(w, h) { - _main.default.Renderer.prototype.resize.call(this, w, h); - this._origViewport = { - width: this.GL.drawingBufferWidth, - height: this.GL.drawingBufferHeight, - }; - this.viewport( - this._origViewport.width, - this._origViewport.height, - ); - this._curCamera._resize(); - //resize pixels buffer - var pixelsState = this._pixelsState; - if (typeof pixelsState.pixels !== "undefined") { - pixelsState._setProperty( - "pixels", - new Uint8Array( - this.GL.drawingBufferWidth * - this.GL.drawingBufferHeight * - 4, - ), - ); - } - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = this.framebuffers[Symbol.iterator](), - _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var framebuffer = _step.value; - // Notify framebuffers of the resize so that any auto-sized framebuffers - // can also update their size - framebuffer._canvasSizeChanged(); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } /** - * clears color and depth buffers - * with r,g,b,a - * @private - * @param {Number} r normalized red val. - * @param {Number} g normalized green val. - * @param {Number} b normalized blue val. - * @param {Number} a normalized alpha val. - */, - }, - { - key: "clear", - value: function clear() { - var _r = - (arguments.length <= 0 ? undefined : arguments[0]) || 0; - var _g = - (arguments.length <= 1 ? undefined : arguments[1]) || 0; - var _b = - (arguments.length <= 2 ? undefined : arguments[2]) || 0; - var _a = - (arguments.length <= 3 ? undefined : arguments[3]) || 0; - var activeFramebuffer = this.activeFramebuffer(); - if ( - activeFramebuffer && - activeFramebuffer.format === constants.UNSIGNED_BYTE && - !activeFramebuffer.antialias && - _a === 0 - ) { - // Drivers on Intel Macs check for 0,0,0,0 exactly when drawing to a - // framebuffer and ignore the command if it's the only drawing command to - // the framebuffer. To work around it, we can set the alpha to a value so - // low that it still rounds down to 0, but that circumvents the buggy - // check in the driver. - _a = 1e-10; - } - this.GL.clearColor(_r * _a, _g * _a, _b * _a, _a); - this.GL.clearDepth(1); - this.GL.clear( - this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT, - ); - }, - }, - { - key: "applyMatrix", - value: function applyMatrix(a, b, c, d, e, f) { - if (arguments.length === 16) { - _main.default.Matrix.prototype.apply.apply( - this.uMVMatrix, - arguments, - ); - } else { - this.uMVMatrix.apply([ - a, - b, - 0, - 0, - c, - d, - 0, - 0, - 0, - 0, - 1, - 0, - e, - f, - 0, - 1, - ]); - } - } /** - * [translate description] - * @private - * @param {Number} x [description] - * @param {Number} y [description] - * @param {Number} z [description] - * @chainable - * @todo implement handle for components or vector as args - */, - }, - { - key: "translate", - value: function translate(x, y, z) { - if (x instanceof _main.default.Vector) { - z = x.z; - y = x.y; - x = x.x; - } - this.uMVMatrix.translate([x, y, z]); - return this; - } /** - * Scales the Model View Matrix by a vector - * @private - * @param {Number | p5.Vector | Array} x [description] - * @param {Number} [y] y-axis scalar - * @param {Number} [z] z-axis scalar - * @chainable - */, - }, - { - key: "scale", - value: function scale(x, y, z) { - this.uMVMatrix.scale(x, y, z); - return this; - }, - }, - { - key: "rotate", - value: function rotate(rad, axis) { - if (typeof axis === "undefined") { - return this.rotateZ(rad); - } - _main.default.Matrix.prototype.rotate.apply( - this.uMVMatrix, - arguments, - ); - return this; - }, - }, - { - key: "rotateX", - value: function rotateX(rad) { - this.rotate(rad, 1, 0, 0); - return this; - }, - }, - { - key: "rotateY", - value: function rotateY(rad) { - this.rotate(rad, 0, 1, 0); - return this; - }, - }, - { - key: "rotateZ", - value: function rotateZ(rad) { - this.rotate(rad, 0, 0, 1); - return this; - }, - }, - { - key: "push", - value: function push() { - // get the base renderer style - var style = _main.default.Renderer.prototype.push.apply(this); - // add webgl-specific style properties - var properties = style.properties; - properties.uMVMatrix = this.uMVMatrix.copy(); - properties.uPMatrix = this.uPMatrix.copy(); - properties._curCamera = this._curCamera; - // make a copy of the current camera for the push state - // this preserves any references stored using 'createCamera' - this._curCamera = this._curCamera.copy(); - properties.ambientLightColors = - this.ambientLightColors.slice(); - properties.specularColors = this.specularColors.slice(); - properties.directionalLightDirections = - this.directionalLightDirections.slice(); - properties.directionalLightDiffuseColors = - this.directionalLightDiffuseColors.slice(); - properties.directionalLightSpecularColors = - this.directionalLightSpecularColors.slice(); - properties.pointLightPositions = - this.pointLightPositions.slice(); - properties.pointLightDiffuseColors = - this.pointLightDiffuseColors.slice(); - properties.pointLightSpecularColors = - this.pointLightSpecularColors.slice(); - properties.spotLightPositions = - this.spotLightPositions.slice(); - properties.spotLightDirections = - this.spotLightDirections.slice(); - properties.spotLightDiffuseColors = - this.spotLightDiffuseColors.slice(); - properties.spotLightSpecularColors = - this.spotLightSpecularColors.slice(); - properties.spotLightAngle = this.spotLightAngle.slice(); - properties.spotLightConc = this.spotLightConc.slice(); - properties.userFillShader = this.userFillShader; - properties.userStrokeShader = this.userStrokeShader; - properties.userPointShader = this.userPointShader; - properties.pointSize = this.pointSize; - properties.curStrokeWeight = this.curStrokeWeight; - properties.curStrokeColor = this.curStrokeColor; - properties.curFillColor = this.curFillColor; - properties.curAmbientColor = this.curAmbientColor; - properties.curSpecularColor = this.curSpecularColor; - properties.curEmissiveColor = this.curEmissiveColor; - properties._hasSetAmbient = this._hasSetAmbient; - properties._useSpecularMaterial = this._useSpecularMaterial; - properties._useEmissiveMaterial = this._useEmissiveMaterial; - properties._useShininess = this._useShininess; - properties.constantAttenuation = this.constantAttenuation; - properties.linearAttenuation = this.linearAttenuation; - properties.quadraticAttenuation = this.quadraticAttenuation; - properties._enableLighting = this._enableLighting; - properties._useNormalMaterial = this._useNormalMaterial; - properties._tex = this._tex; - properties.drawMode = this.drawMode; - properties._currentNormal = this._currentNormal; - properties.curBlendMode = this.curBlendMode; - // So that the activeImageLight gets reset in push/pop - properties.activeImageLight = this.activeImageLight; - return style; - }, - }, - { - key: "pop", - value: function pop() { - var _get2; - if ( - this._clipDepths.length > 0 && - this._pushPopDepth === - this._clipDepths[this._clipDepths.length - 1] - ) { - this._clearClip(); - } - for ( - var _len = arguments.length, - args = new Array(_len), - _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - (_get2 = _get( - _getPrototypeOf(RendererGL.prototype), - "pop", - this, - )).call.apply(_get2, [this].concat(args)); - this._applyStencilTestIfClipping(); - }, - }, - { - key: "_applyStencilTestIfClipping", - value: function _applyStencilTestIfClipping() { - var drawTarget = this.drawTarget(); - if (drawTarget._isClipApplied !== this._stencilTestOn) { - if (drawTarget._isClipApplied) { - this.GL.enable(this.GL.STENCIL_TEST); - this._stencilTestOn = true; - } else { - this.GL.disable(this.GL.STENCIL_TEST); - this._stencilTestOn = false; - } - } - }, - }, - { - key: "resetMatrix", - value: function resetMatrix() { - this.uMVMatrix.set( - this._curCamera.cameraMatrix.mat4[0], - this._curCamera.cameraMatrix.mat4[1], - this._curCamera.cameraMatrix.mat4[2], - this._curCamera.cameraMatrix.mat4[3], - this._curCamera.cameraMatrix.mat4[4], - this._curCamera.cameraMatrix.mat4[5], - this._curCamera.cameraMatrix.mat4[6], - this._curCamera.cameraMatrix.mat4[7], - this._curCamera.cameraMatrix.mat4[8], - this._curCamera.cameraMatrix.mat4[9], - this._curCamera.cameraMatrix.mat4[10], - this._curCamera.cameraMatrix.mat4[11], - this._curCamera.cameraMatrix.mat4[12], - this._curCamera.cameraMatrix.mat4[13], - this._curCamera.cameraMatrix.mat4[14], - this._curCamera.cameraMatrix.mat4[15], - ); - return this; - }, ////////////////////////////////////////////// - // SHADER - ////////////////////////////////////////////// - /* - * shaders are created and cached on a per-renderer basis, - * on the grounds that each renderer will have its own gl context - * and the shader must be valid in that context. - */ - }, - { - key: "_getImmediateStrokeShader", - value: function _getImmediateStrokeShader() { - // select the stroke shader to use - var stroke = this.userStrokeShader; - if (!stroke || !stroke.isStrokeShader()) { - return this._getLineShader(); - } - return stroke; - }, - }, - { - key: "_getRetainedStrokeShader", - value: function _getRetainedStrokeShader() { - return this._getImmediateStrokeShader(); - } /* - * selects which fill shader should be used based on renderer state, - * for use with begin/endShape and immediate vertex mode. - */, - }, - { - key: "_getImmediateFillShader", - value: function _getImmediateFillShader() { - var fill = this.userFillShader; - if (this._useNormalMaterial) { - if (!fill || !fill.isNormalShader()) { - return this._getNormalShader(); - } - } - if (this._enableLighting) { - if (!fill || !fill.isLightShader()) { - return this._getLightShader(); - } - } else if (this._tex) { - if (!fill || !fill.isTextureShader()) { - return this._getLightShader(); - } - } else if (!fill /*|| !fill.isColorShader()*/) { - return this._getImmediateModeShader(); - } - return fill; - } /* - * selects which fill shader should be used based on renderer state - * for retained mode. - */, - }, - { - key: "_getRetainedFillShader", - value: function _getRetainedFillShader() { - if (this._useNormalMaterial) { - return this._getNormalShader(); - } - var fill = this.userFillShader; - if (this._enableLighting) { - if (!fill || !fill.isLightShader()) { - return this._getLightShader(); - } - } else if (this._tex) { - if (!fill || !fill.isTextureShader()) { - return this._getLightShader(); - } - } else if (!fill /* || !fill.isColorShader()*/) { - return this._getColorShader(); - } - return fill; - }, - }, - { - key: "_getImmediatePointShader", - value: function _getImmediatePointShader() { - // select the point shader to use - var point = this.userPointShader; - if (!point || !point.isPointShader()) { - return this._getPointShader(); - } - return point; - }, - }, - { - key: "_getRetainedLineShader", - value: function _getRetainedLineShader() { - return this._getImmediateLineShader(); - }, - }, - { - key: "_getLightShader", - value: function _getLightShader() { - if (!this._defaultLightShader) { - if (this._pInst._glAttributes.perPixelLighting) { - this._defaultLightShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "highp") + - defaultShaders.phongVert, - this._webGL2CompatibilityPrefix("frag", "highp") + - defaultShaders.phongFrag, - ); - } else { - this._defaultLightShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "highp") + - defaultShaders.lightVert, - this._webGL2CompatibilityPrefix("frag", "highp") + - defaultShaders.lightTextureFrag, - ); - } - } - return this._defaultLightShader; - }, - }, - { - key: "_getImmediateModeShader", - value: function _getImmediateModeShader() { - if (!this._defaultImmediateModeShader) { - this._defaultImmediateModeShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - defaultShaders.immediateVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - defaultShaders.vertexColorFrag, - ); - } - return this._defaultImmediateModeShader; - }, - }, - { - key: "_getNormalShader", - value: function _getNormalShader() { - if (!this._defaultNormalShader) { - this._defaultNormalShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - defaultShaders.normalVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - defaultShaders.normalFrag, - ); - } - return this._defaultNormalShader; - }, - }, - { - key: "_getColorShader", - value: function _getColorShader() { - if (!this._defaultColorShader) { - this._defaultColorShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - defaultShaders.normalVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - defaultShaders.basicFrag, - ); - } - return this._defaultColorShader; - }, - }, - { - key: "_getPointShader", - value: function _getPointShader() { - if (!this._defaultPointShader) { - this._defaultPointShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - defaultShaders.pointVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - defaultShaders.pointFrag, - ); - } - return this._defaultPointShader; - }, - }, - { - key: "_getLineShader", - value: function _getLineShader() { - if (!this._defaultLineShader) { - this._defaultLineShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - defaultShaders.lineVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - defaultShaders.lineFrag, - ); - } - return this._defaultLineShader; - }, - }, - { - key: "_getFontShader", - value: function _getFontShader() { - if (!this._defaultFontShader) { - if (this.webglVersion === constants.WEBGL) { - this.GL.getExtension("OES_standard_derivatives"); - } - this._defaultFontShader = new _main.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - defaultShaders.fontVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - defaultShaders.fontFrag, - ); - } - return this._defaultFontShader; - }, - }, - { - key: "_webGL2CompatibilityPrefix", - value: function _webGL2CompatibilityPrefix( - shaderType, - floatPrecision, - ) { - var code = ""; - if (this.webglVersion === constants.WEBGL2) { - code += "#version 300 es\n#define WEBGL2\n"; - } - if (shaderType === "vert") { - code += "#define VERTEX_SHADER\n"; - } else if (shaderType === "frag") { - code += "#define FRAGMENT_SHADER\n"; - } - if (floatPrecision) { - code += "precision ".concat(floatPrecision, " float;\n"); - } - return code; - }, - }, - { - key: "_getEmptyTexture", - value: function _getEmptyTexture() { - if (!this._emptyTexture) { - // a plain white texture RGBA, full alpha, single pixel. - var im = new _main.default.Image(1, 1); - im.set(0, 0, 255); - this._emptyTexture = new _main.default.Texture(this, im); - } - return this._emptyTexture; - }, - }, - { - key: "getTexture", - value: function getTexture(input) { - var src = input; - if (src instanceof _main.default.Framebuffer) { - src = src.color; - } - var texture = this.textures.get(src); - if (texture) { - return texture; - } - var tex = new _main.default.Texture(this, src); - this.textures.set(src, tex); - return tex; - } /* - * used in imageLight, - * To create a blurry image from the input non blurry img, if it doesn't already exist - * Add it to the diffusedTexture map, - * Returns the blurry image - * maps a p5.Image used by imageLight() to a p5.Graphics - */, - }, - { - key: "getDiffusedTexture", - value: function getDiffusedTexture(input) { - // if one already exists for a given input image - if (this.diffusedTextures.get(input) != null) { - return this.diffusedTextures.get(input); - } // if not, only then create one - - var newGraphic; // maybe switch to framebuffer - // hardcoded to 200px, because it's going to be blurry and smooth - var smallWidth = 200; - var width = smallWidth; - var height = Math.floor( - smallWidth * (input.height / input.width), - ); - newGraphic = this._pInst.createGraphics( - width, - height, - constants.WEBGL, - ); - // create graphics is like making a new sketch, all functions on main - // sketch it would be available on graphics - var irradiance = newGraphic.createShader( - defaultShaders.imageLightVert, - defaultShaders.imageLightDiffusedFrag, - ); - newGraphic.shader(irradiance); - irradiance.setUniform("environmentMap", input); - newGraphic.noStroke(); - newGraphic.rectMode(newGraphic.CENTER); - newGraphic.rect(0, 0, newGraphic.width, newGraphic.height); - this.diffusedTextures.set(input, newGraphic); - return newGraphic; - } /* - * used in imageLight, - * To create a texture from the input non blurry image, if it doesn't already exist - * Creating 8 different levels of textures according to different - * sizes and atoring them in `levels` array - * Creating a new Mipmap texture with that `levels` array - * Storing the texture for input image in map called `specularTextures` - * maps the input p5.Image to a p5.MipmapTexture - */, - }, - { - key: "getSpecularTexture", - value: function getSpecularTexture(input) { - // check if already exits (there are tex of diff resolution so which one to check) - // currently doing the whole array - if (this.specularTextures.get(input) != null) { - return this.specularTextures.get(input); - } // Hardcoded size - - var size = 512; - var tex; - var levels = []; - var graphic = this._pInst.createGraphics( - size, - size, - constants.WEBGL, - ); - var count = Math.log(size) / Math.log(2); - graphic.pixelDensity(1); - // currently only 8 levels - // This loop calculates 8 graphics of varying size of canvas - // and corresponding different roughness levels. - // Roughness increases with the decrease in canvas size, - // because rougher surfaces have less detailed/more blurry reflections. - for (var w = size; w >= 1; w /= 2) { - graphic.resizeCanvas(w, w); - var currCount = Math.log(w) / Math.log(2); - var roughness = 1 - currCount / count; - var myShader = graphic.createShader( - defaultShaders.imageLightVert, - defaultShaders.imageLightSpecularFrag, - ); - graphic.shader(myShader); - graphic.clear(); - myShader.setUniform("environmentMap", input); - myShader.setUniform("roughness", roughness); - graphic.noStroke(); - graphic.plane(w, w); - levels.push( - graphic.get().drawingContext.getImageData(0, 0, w, w), - ); - } - graphic.remove(); - tex = new _p6.MipmapTexture(this, levels, {}); - this.specularTextures.set(input, tex); - return tex; - } /** - * @method activeFramebuffer - * @private - * @returns {p5.Framebuffer|null} The currently active framebuffer, or null if - * the main canvas is the current draw target. - */, - }, - { - key: "activeFramebuffer", - value: function activeFramebuffer() { - return ( - this.activeFramebuffers[ - this.activeFramebuffers.length - 1 - ] || null - ); - }, - }, - { - key: "createFramebuffer", - value: function createFramebuffer(options) { - return new _main.default.Framebuffer(this, options); - }, - }, - { - key: "_setStrokeUniforms", - value: function _setStrokeUniforms(strokeShader) { - strokeShader.bindShader(); - // set the uniform values - strokeShader.setUniform("uUseLineColor", this._useLineColor); - strokeShader.setUniform( - "uMaterialColor", - this.curStrokeColor, - ); - strokeShader.setUniform( - "uStrokeWeight", - this.curStrokeWeight, - ); - strokeShader.setUniform( - "uStrokeCap", - STROKE_CAP_ENUM[this.curStrokeCap], - ); - strokeShader.setUniform( - "uStrokeJoin", - STROKE_JOIN_ENUM[this.curStrokeJoin], - ); - }, - }, - { - key: "_setFillUniforms", - value: function _setFillUniforms(fillShader) { - fillShader.bindShader(); - // TODO: optimize - fillShader.setUniform( - "uUseVertexColor", - this._useVertexColor, - ); - fillShader.setUniform("uMaterialColor", this.curFillColor); - fillShader.setUniform("isTexture", !!this._tex); - if (this._tex) { - fillShader.setUniform("uSampler", this._tex); - } - fillShader.setUniform("uTint", this._tint); - fillShader.setUniform("uHasSetAmbient", this._hasSetAmbient); - fillShader.setUniform( - "uAmbientMatColor", - this.curAmbientColor, - ); - fillShader.setUniform( - "uSpecularMatColor", - this.curSpecularColor, - ); - fillShader.setUniform( - "uEmissiveMatColor", - this.curEmissiveColor, - ); - fillShader.setUniform("uSpecular", this._useSpecularMaterial); - fillShader.setUniform("uEmissive", this._useEmissiveMaterial); - fillShader.setUniform("uShininess", this._useShininess); - this._setImageLightUniforms(fillShader); - fillShader.setUniform("uUseLighting", this._enableLighting); - var pointLightCount = this.pointLightDiffuseColors.length / 3; - fillShader.setUniform("uPointLightCount", pointLightCount); - fillShader.setUniform( - "uPointLightLocation", - this.pointLightPositions, - ); - fillShader.setUniform( - "uPointLightDiffuseColors", - this.pointLightDiffuseColors, - ); - fillShader.setUniform( - "uPointLightSpecularColors", - this.pointLightSpecularColors, - ); - var directionalLightCount = - this.directionalLightDiffuseColors.length / 3; - fillShader.setUniform( - "uDirectionalLightCount", - directionalLightCount, - ); - fillShader.setUniform( - "uLightingDirection", - this.directionalLightDirections, - ); - fillShader.setUniform( - "uDirectionalDiffuseColors", - this.directionalLightDiffuseColors, - ); - fillShader.setUniform( - "uDirectionalSpecularColors", - this.directionalLightSpecularColors, - ); - // TODO: sum these here... - var ambientLightCount = this.ambientLightColors.length / 3; - fillShader.setUniform( - "uAmbientLightCount", - ambientLightCount, - ); - fillShader.setUniform( - "uAmbientColor", - this.ambientLightColors, - ); - var spotLightCount = this.spotLightDiffuseColors.length / 3; - fillShader.setUniform("uSpotLightCount", spotLightCount); - fillShader.setUniform("uSpotLightAngle", this.spotLightAngle); - fillShader.setUniform("uSpotLightConc", this.spotLightConc); - fillShader.setUniform( - "uSpotLightDiffuseColors", - this.spotLightDiffuseColors, - ); - fillShader.setUniform( - "uSpotLightSpecularColors", - this.spotLightSpecularColors, - ); - fillShader.setUniform( - "uSpotLightLocation", - this.spotLightPositions, - ); - fillShader.setUniform( - "uSpotLightDirection", - this.spotLightDirections, - ); - fillShader.setUniform( - "uConstantAttenuation", - this.constantAttenuation, - ); - fillShader.setUniform( - "uLinearAttenuation", - this.linearAttenuation, - ); - fillShader.setUniform( - "uQuadraticAttenuation", - this.quadraticAttenuation, - ); - fillShader.bindTextures(); - }, // getting called from _setFillUniforms - }, - { - key: "_setImageLightUniforms", - value: function _setImageLightUniforms(shader) { - //set uniform values - shader.setUniform( - "uUseImageLight", - this.activeImageLight != null, - ); - // true - if (this.activeImageLight) { - // this.activeImageLight has image as a key - // look up the texture from the diffusedTexture map - var diffusedLight = this.getDiffusedTexture( - this.activeImageLight, - ); - shader.setUniform("environmentMapDiffused", diffusedLight); - var specularLight = this.getSpecularTexture( - this.activeImageLight, - ); - // In p5js the range of shininess is >= 1, - // Therefore roughness range will be ([0,1]*8)*20 or [0, 160] - // The factor of 8 is because currently the getSpecularTexture - // only calculated 8 different levels of roughness - // The factor of 20 is just to spread up this range so that, - // [1, max] of shininess is converted to [0,160] of roughness - var roughness = 20 / this._useShininess; - shader.setUniform("levelOfDetail", roughness * 8); - shader.setUniform("environmentMapSpecular", specularLight); - } - }, - }, - { - key: "_setPointUniforms", - value: function _setPointUniforms(pointShader) { - pointShader.bindShader(); - // set the uniform values - pointShader.setUniform("uMaterialColor", this.curStrokeColor); - // @todo is there an instance where this isn't stroke weight? - // should be they be same var? - pointShader.setUniform( - "uPointSize", - this.pointSize * this._pInst._pixelDensity, - ); - } /* Binds a buffer to the drawing context - * when passed more than two arguments it also updates or initializes - * the data associated with the buffer - */, - }, - { - key: "_bindBuffer", - value: function _bindBuffer( - buffer, - target, - values, - type, - usage, - ) { - if (!target) target = this.GL.ARRAY_BUFFER; - this.GL.bindBuffer(target, buffer); - if (values !== undefined) { - var data = values; - if (values instanceof _main.default.DataArray) { - data = values.dataArray(); - } else if (!(data instanceof (type || Float32Array))) { - data = new (type || Float32Array)(data); - } - this.GL.bufferData( - target, - data, - usage || this.GL.STATIC_DRAW, - ); - } - }, /////////////////////////////// - //// UTILITY FUNCTIONS - ////////////////////////////// - }, - { - key: "_arraysEqual", - value: function _arraysEqual(a, b) { - var aLength = a.length; - if (aLength !== b.length) return false; - return a.every(function (ai, i) { - return ai === b[i]; - }); - }, - }, - { - key: "_isTypedArray", - value: function _isTypedArray(arr) { - return [ - Float32Array, - Float64Array, - Int16Array, - Uint16Array, - Uint32Array, - ].some(function (x) { - return arr instanceof x; - }); - } /** - * turn a two dimensional array into one dimensional array - * @private - * @param {Array} arr 2-dimensional array - * @return {Array} 1-dimensional array - * [[1, 2, 3],[4, 5, 6]] -> [1, 2, 3, 4, 5, 6] - */, - }, - { - key: "_flatten", - value: function _flatten(arr) { - //when empty, return empty - if (arr.length === 0) { - return []; - } else if (arr.length > 20000) { - //big models , load slower to avoid stack overflow - //faster non-recursive flatten via axelduch - //stackoverflow.com/questions/27266550/how-to-flatten-nested-array-in-javascript - var result = []; - var nodes = arr.slice(); - var node; - node = nodes.pop(); - do { - if (Array.isArray(node)) { - nodes.push.apply(nodes, _toConsumableArray(node)); - } else { - result.push(node); - } - } while ( - nodes.length && - (node = nodes.pop()) !== undefined - ); - result.reverse(); // we reverse result to restore the original order - return result; - } else { - var _ref; - //otherwise if model within limits for browser - //use faster recursive loading - return (_ref = []).concat.apply( - _ref, - _toConsumableArray(arr), - ); - } - } /** - * turn a p5.Vector Array into a one dimensional number array - * @private - * @param {p5.Vector[]} arr an array of p5.Vector - * @return {Number[]} a one dimensional array of numbers - * [p5.Vector(1, 2, 3), p5.Vector(4, 5, 6)] -> - * [1, 2, 3, 4, 5, 6] - */, - }, - { - key: "_vToNArray", - value: function _vToNArray(arr) { - var ret = []; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = arr[Symbol.iterator](), _step2; - !(_iteratorNormalCompletion2 = (_step2 = - _iterator2.next()).done); - _iteratorNormalCompletion2 = true - ) { - var item = _step2.value; - ret.push(item.x, item.y, item.z); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return ret; - }, // function to calculate BezierVertex Coefficients - }, - { - key: "_bezierCoefficients", - value: function _bezierCoefficients(t) { - var t2 = t * t; - var t3 = t2 * t; - var mt = 1 - t; - var mt2 = mt * mt; - var mt3 = mt2 * mt; - return [mt3, 3 * mt2 * t, 3 * mt * t2, t3]; - }, // function to calculate QuadraticVertex Coefficients - }, - { - key: "_quadraticCoefficients", - value: function _quadraticCoefficients(t) { - var t2 = t * t; - var mt = 1 - t; - var mt2 = mt * mt; - return [mt2, 2 * mt * t, t2]; - }, // function to convert Bezier coordinates to Catmull Rom Splines - }, - { - key: "_bezierToCatmull", - value: function _bezierToCatmull(w) { - var p1 = w[1]; - var p2 = w[1] + (w[2] - w[0]) / this._curveTightness; - var p3 = w[2] - (w[3] - w[1]) / this._curveTightness; - var p4 = w[2]; - var p = [p1, p2, p3, p4]; - return p; - }, - }, - { - key: "_initTessy", - value: function _initTessy() { - // function called for each vertex of tesselator output - function vertexCallback(data, polyVertArray) { - for (var i = 0; i < data.length; i++) { - polyVertArray.push(data[i]); - } - } - function begincallback(type) { - if (type !== _libtess.default.primitiveType.GL_TRIANGLES) { - console.log( - "expected TRIANGLES but got type: ".concat(type), - ); - } - } - function errorcallback(errno) { - console.log("error callback"); - console.log("error number: ".concat(errno)); - } // callback for when segments intersect and must be split - - function combinecallback(coords, data, weight) { - var result = new Array( - _main.default.RendererGL.prototype.tessyVertexSize, - ).fill(0); - for (var i = 0; i < weight.length; i++) { - for (var j = 0; j < result.length; j++) { - if (weight[i] === 0 || !data[i]) continue; - result[j] += data[i][j] * weight[i]; - } - } - return result; - } - function edgeCallback(flag) { - // don't really care about the flag, but need no-strip/no-fan behavior - } - var tessy = new _libtess.default.GluTesselator(); - tessy.gluTessCallback( - _libtess.default.gluEnum.GLU_TESS_VERTEX_DATA, - vertexCallback, - ); - tessy.gluTessCallback( - _libtess.default.gluEnum.GLU_TESS_BEGIN, - begincallback, - ); - tessy.gluTessCallback( - _libtess.default.gluEnum.GLU_TESS_ERROR, - errorcallback, - ); - tessy.gluTessCallback( - _libtess.default.gluEnum.GLU_TESS_COMBINE, - combinecallback, - ); - tessy.gluTessCallback( - _libtess.default.gluEnum.GLU_TESS_EDGE_FLAG, - edgeCallback, - ); - tessy.gluTessProperty( - _libtess.default.gluEnum.GLU_TESS_WINDING_RULE, - _libtess.default.windingRule.GLU_TESS_WINDING_NONZERO, - ); - return tessy; - }, - }, - { - key: "_triangulate", - value: function _triangulate(contours) { - // libtess will take 3d verts and flatten to a plane for tesselation. - // libtess is capable of calculating a plane to tesselate on, but - // if all of the vertices have the same z values, we'll just - // assume the face is facing the camera, letting us skip any performance - // issues or bugs in libtess's automatic calculation. - var z = contours[0] ? contours[0][2] : undefined; - var allSameZ = true; - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = contours[Symbol.iterator](), _step3; - !(_iteratorNormalCompletion3 = (_step3 = - _iterator3.next()).done); - _iteratorNormalCompletion3 = true - ) { - var contour = _step3.value; - for ( - var j = 0; - j < contour.length; - j += _main.default.RendererGL.prototype.tessyVertexSize - ) { - if (contour[j + 2] !== z) { - allSameZ = false; - break; - } - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion3 && - _iterator3.return != null - ) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - if (allSameZ) { - this._tessy.gluTessNormal(0, 0, 1); - } else { - // Let libtess pick a plane for us - this._tessy.gluTessNormal(0, 0, 0); - } - var triangleVerts = []; - this._tessy.gluTessBeginPolygon(triangleVerts); - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for ( - var _iterator4 = contours[Symbol.iterator](), _step4; - !(_iteratorNormalCompletion4 = (_step4 = - _iterator4.next()).done); - _iteratorNormalCompletion4 = true - ) { - var _contour = _step4.value; - this._tessy.gluTessBeginContour(); - for ( - var _j = 0; - _j < _contour.length; - _j += _main.default.RendererGL.prototype.tessyVertexSize - ) { - var coords = _contour.slice( - _j, - _j + - _main.default.RendererGL.prototype.tessyVertexSize, - ); - this._tessy.gluTessVertex(coords, coords); - } - this._tessy.gluTessEndContour(); - } // finish polygon - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion4 && - _iterator4.return != null - ) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - this._tessy.gluTessEndPolygon(); - return triangleVerts; - }, - }, - ]); - return RendererGL; - })(_main.default.Renderer); - /** - * ensures that p5 is using a 3d renderer. throws an error if not. - */ - _main.default.prototype._assert3d = function (name) { - if (!this._renderer.isP3D) - throw new Error( - "".concat( - name, - "() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.", - ), - ); - }; - // function to initialize GLU Tesselator - _main.default.RendererGL.prototype.tessyVertexSize = 12; - var _default = _main.default.RendererGL; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "../core/p5.Renderer": 301, - "./GeometryBuilder": 342, - "./p5.Camera": 347, - "./p5.Framebuffer": 349, - "./p5.Matrix": 351, - "./p5.Shader": 356, - "./p5.Texture": 357, - "core-js/modules/es.array.concat": 169, - "core-js/modules/es.array.copy-within": 170, - "core-js/modules/es.array.every": 171, - "core-js/modules/es.array.fill": 172, - "core-js/modules/es.array.from": 176, - "core-js/modules/es.array.includes": 177, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.some": 184, - "core-js/modules/es.map": 187, - "core-js/modules/es.object.assign": 194, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.reflect.get": 203, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.set": 207, - "core-js/modules/es.string.includes": 209, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.float32-array": 229, - "core-js/modules/es.typed-array.float64-array": 230, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.int16-array": 234, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint16-array": 250, - "core-js/modules/es.typed-array.uint32-array": 251, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - libtess: 269, - path: 272, - }, - ], - 356: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.index-of"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.array.slice"); - _dereq_("core-js/modules/es.array.some"); - _dereq_("core-js/modules/es.function.name"); - _dereq_("core-js/modules/es.object.keys"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.default = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * This module defines the p5.Shader class - * @module 3D - * @submodule Material - * @for p5 - * @requires core - */ - /** - * Shader class for WEBGL Mode - * @class p5.Shader - * @constructor - * @param {p5.RendererGL} renderer an instance of p5.RendererGL that - * will provide the GL context for this new p5.Shader - * @param {String} vertSrc source code for the vertex shader (as a string) - * @param {String} fragSrc source code for the fragment shader (as a string) - */ - - _main.default.Shader = /*#__PURE__*/ (function () { - function _class(renderer, vertSrc, fragSrc) { - _classCallCheck(this, _class); - // TODO: adapt this to not take ids, but rather, - // to take the source for a vertex and fragment shader - // to enable custom shaders at some later date - this._renderer = renderer; - this._vertSrc = vertSrc; - this._fragSrc = fragSrc; - this._vertShader = -1; - this._fragShader = -1; - this._glProgram = 0; - this._loadedAttributes = false; - this.attributes = {}; - this._loadedUniforms = false; - this.uniforms = {}; - this._bound = false; - this.samplers = []; - } /** - * Creates, compiles, and links the shader based on its - * sources for the vertex and fragment shaders (provided - * to the constructor). Populates known attributes and - * uniforms from the shader. - * @method init - * @chainable - * @private - */ - - _createClass(_class, [ - { - key: "init", - value: function init() { - if (this._glProgram === 0 /* or context is stale? */) { - var gl = this._renderer.GL; - // @todo: once custom shading is allowed, - // friendly error messages should be used here to share - // compiler and linker errors. - //set up the shader by - // 1. creating and getting a gl id for the shader program, - // 2. compliling its vertex & fragment sources, - // 3. linking the vertex and fragment shaders - this._vertShader = gl.createShader(gl.VERTEX_SHADER); - //load in our default vertex shader - gl.shaderSource(this._vertShader, this._vertSrc); - gl.compileShader(this._vertShader); - // if our vertex shader failed compilation? - if ( - !gl.getShaderParameter( - this._vertShader, - gl.COMPILE_STATUS, - ) - ) { - _main.default._friendlyError( - "Yikes! An error occurred compiling the vertex shader:".concat( - gl.getShaderInfoLog(this._vertShader), - ), - ); - return null; - } - this._fragShader = gl.createShader(gl.FRAGMENT_SHADER); - //load in our material frag shader - gl.shaderSource(this._fragShader, this._fragSrc); - gl.compileShader(this._fragShader); - // if our frag shader failed compilation? - if ( - !gl.getShaderParameter( - this._fragShader, - gl.COMPILE_STATUS, - ) - ) { - _main.default._friendlyError( - "Darn! An error occurred compiling the fragment shader:".concat( - gl.getShaderInfoLog(this._fragShader), - ), - ); - return null; - } - this._glProgram = gl.createProgram(); - gl.attachShader(this._glProgram, this._vertShader); - gl.attachShader(this._glProgram, this._fragShader); - gl.linkProgram(this._glProgram); - if ( - !gl.getProgramParameter(this._glProgram, gl.LINK_STATUS) - ) { - _main.default._friendlyError( - "Snap! Error linking shader program: ".concat( - gl.getProgramInfoLog(this._glProgram), - ), - ); - } - this._loadAttributes(); - this._loadUniforms(); - } - return this; - } /** - * Shaders belong to the main canvas or a p5.Graphics. Once they are compiled, - * they can only be used in the context they were compiled on. - * - * Use this method to make a new copy of a shader that gets compiled on a - * different context. - * - * @method copyToContext - * @param {p5|p5.Graphics} context The graphic or instance to copy this shader to. - * Pass `window` if you need to copy to the main canvas. - * @returns {p5.Shader} A new shader on the target context. - * - * @example - *
                                  - * - * let graphic = createGraphics(200, 200, WEBGL); - * let graphicShader = graphic.createShader(vert, frag); - * graphic.shader(graphicShader); // Use graphicShader on the graphic - * - * let mainShader = graphicShader.copyToContext(window); - * shader(mainShader); // Use `mainShader` on the main canvas - * - *
                                  - */, - }, - { - key: "copyToContext", - value: function copyToContext(context) { - var shader = new _main.default.Shader( - context._renderer, - this._vertSrc, - this._fragSrc, - ); - shader.ensureCompiledOnContext(context); - return shader; - } /** - * @private - */, - }, - { - key: "ensureCompiledOnContext", - value: function ensureCompiledOnContext(context) { - if ( - this._glProgram !== 0 && - this._renderer !== context._renderer - ) { - throw new Error( - "The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?", - ); - } else if (this._glProgram === 0) { - this._renderer = context._renderer; - this.init(); - } - } /** - * Queries the active attributes for this shader and loads - * their names and locations into the attributes array. - * @method _loadAttributes - * @private - */, - }, - { - key: "_loadAttributes", - value: function _loadAttributes() { - if (this._loadedAttributes) { - return; - } - this.attributes = {}; - var gl = this._renderer.GL; - var numAttributes = gl.getProgramParameter( - this._glProgram, - gl.ACTIVE_ATTRIBUTES, - ); - for (var i = 0; i < numAttributes; ++i) { - var attributeInfo = gl.getActiveAttrib(this._glProgram, i); - var name = attributeInfo.name; - var location = gl.getAttribLocation(this._glProgram, name); - var attribute = {}; - attribute.name = name; - attribute.location = location; - attribute.index = i; - attribute.type = attributeInfo.type; - attribute.size = attributeInfo.size; - this.attributes[name] = attribute; - } - this._loadedAttributes = true; - } /** - * Queries the active uniforms for this shader and loads - * their names and locations into the uniforms array. - * @method _loadUniforms - * @private - */, - }, - { - key: "_loadUniforms", - value: function _loadUniforms() { - if (this._loadedUniforms) { - return; - } - var gl = this._renderer.GL; - // Inspect shader and cache uniform info - var numUniforms = gl.getProgramParameter( - this._glProgram, - gl.ACTIVE_UNIFORMS, - ); - var samplerIndex = 0; - for (var i = 0; i < numUniforms; ++i) { - var uniformInfo = gl.getActiveUniform(this._glProgram, i); - var uniform = {}; - uniform.location = gl.getUniformLocation( - this._glProgram, - uniformInfo.name, - ); - uniform.size = uniformInfo.size; - var uniformName = uniformInfo.name; - //uniforms thats are arrays have their name returned as - //someUniform[0] which is a bit silly so we trim it - //off here. The size property tells us that its an array - //so we dont lose any information by doing this - if (uniformInfo.size > 1) { - uniformName = uniformName.substring( - 0, - uniformName.indexOf("[0]"), - ); - } - uniform.name = uniformName; - uniform.type = uniformInfo.type; - uniform._cachedData = undefined; - if (uniform.type === gl.SAMPLER_2D) { - uniform.samplerIndex = samplerIndex; - samplerIndex++; - this.samplers.push(uniform); - } - uniform.isArray = - uniformInfo.size > 1 || - uniform.type === gl.FLOAT_MAT3 || - uniform.type === gl.FLOAT_MAT4 || - uniform.type === gl.FLOAT_VEC2 || - uniform.type === gl.FLOAT_VEC3 || - uniform.type === gl.FLOAT_VEC4 || - uniform.type === gl.INT_VEC2 || - uniform.type === gl.INT_VEC4 || - uniform.type === gl.INT_VEC3; - this.uniforms[uniformName] = uniform; - } - this._loadedUniforms = true; - }, - }, - { - key: "compile", - value: function compile() { - // TODO - } /** - * initializes (if needed) and binds the shader program. - * @method bindShader - * @private - */, - }, - { - key: "bindShader", - value: function bindShader() { - this.init(); - if (!this._bound) { - this.useProgram(); - this._bound = true; - this._setMatrixUniforms(); - this.setUniform("uViewport", this._renderer._viewport); - } - } /** - * @method unbindShader - * @chainable - * @private - */, - }, - { - key: "unbindShader", - value: function unbindShader() { - if (this._bound) { - this.unbindTextures(); - //this._renderer.GL.useProgram(0); ?? - this._bound = false; - } - return this; - }, - }, - { - key: "bindTextures", - value: function bindTextures() { - var gl = this._renderer.GL; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = this.samplers[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var uniform = _step.value; - var tex = uniform.texture; - if (tex === undefined) { - // user hasn't yet supplied a texture for this slot. - // (or there may not be one--maybe just lighting), - // so we supply a default texture instead. - tex = this._renderer._getEmptyTexture(); - } - gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); - tex.bindTexture(); - tex.update(); - gl.uniform1i(uniform.location, uniform.samplerIndex); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }, - }, - { - key: "updateTextures", - value: function updateTextures() { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = this.samplers[Symbol.iterator](), _step2; - !(_iteratorNormalCompletion2 = (_step2 = - _iterator2.next()).done); - _iteratorNormalCompletion2 = true - ) { - var uniform = _step2.value; - var tex = uniform.texture; - if (tex) { - tex.update(); - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - }, - }, - { - key: "unbindTextures", - value: function unbindTextures() { - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = this.samplers[Symbol.iterator](), _step3; - !(_iteratorNormalCompletion3 = (_step3 = - _iterator3.next()).done); - _iteratorNormalCompletion3 = true - ) { - var uniform = _step3.value; - this.setUniform( - uniform.name, - this._renderer._getEmptyTexture(), - ); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion3 && - _iterator3.return != null - ) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - }, - }, - { - key: "_setMatrixUniforms", - value: function _setMatrixUniforms() { - var viewMatrix = this._renderer._curCamera.cameraMatrix; - var projectionMatrix = this._renderer.uPMatrix; - var modelViewMatrix = this._renderer.uMVMatrix; - var modelViewProjectionMatrix = modelViewMatrix.copy(); - modelViewProjectionMatrix.mult(projectionMatrix); - if (this.isStrokeShader()) { - if (this._renderer._curCamera.cameraType === "default") { - // strokes scale up as they approach camera, default - this.setUniform("uPerspective", 1); - } else { - // strokes have uniform scale regardless of distance from camera - this.setUniform("uPerspective", 0); - } - } - this.setUniform("uViewMatrix", viewMatrix.mat4); - this.setUniform("uProjectionMatrix", projectionMatrix.mat4); - this.setUniform("uModelViewMatrix", modelViewMatrix.mat4); - this.setUniform( - "uModelViewProjectionMatrix", - modelViewProjectionMatrix.mat4, - ); - if (this.uniforms.uNormalMatrix) { - this._renderer.uNMatrix.inverseTranspose( - this._renderer.uMVMatrix, - ); - this.setUniform( - "uNormalMatrix", - this._renderer.uNMatrix.mat3, - ); - } - } /** - * @method useProgram - * @chainable - * @private - */, - }, - { - key: "useProgram", - value: function useProgram() { - var gl = this._renderer.GL; - if (this._renderer._curShader !== this) { - gl.useProgram(this._glProgram); - this._renderer._curShader = this; - } - return this; - } /** - * Used to set the uniforms of a - * p5.Shader object. - * - * Uniforms are used as a way to provide shader programs - * (which run on the GPU) with values from a sketch - * (which runs on the CPU). - * - * Here are some examples of uniforms you can make: - * - booleans - * - Example: `setUniform('x', true)` becomes `uniform float x` with the value `1.0` - * - numbers - * - Example: `setUniform('x', -2)` becomes `uniform float x` with the value `-2.0` - * - arrays of numbers - * - Example: `setUniform('x', [0, 0.5, 1])` becomes `uniform vec3 x` with the value `vec3(0.0, 0.5, 1.0)` - * - a p5.Image, p5.Graphics, p5.MediaElement, or p5.Texture - * - Example: `setUniform('x', img)` becomes `uniform sampler2D x` - * - * @method setUniform - * @chainable - * @param {String} uniformName the name of the uniform. - * Must correspond to the name used in the vertex and fragment shaders - * @param {Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture} - * data the data to associate with the uniform. The type can be - * a boolean (true/false), a number, an array of numbers, or - * an image (p5.Image, p5.Graphics, p5.MediaElement, p5.Texture) - * - * @example - *
                                  - * - * // Click within the image to toggle the value of uniforms - * // Note: for an alternative approach to the same example, - * // involving toggling between shaders please refer to: - * // https://p5js.org/reference/#/p5/shader - * - * let grad; - * let showRedGreen = false; - * - * function preload() { - * // note that we are using two instances - * // of the same vertex and fragment shaders - * grad = loadShader('assets/shader.vert', 'assets/shader-gradient.frag'); - * } - * - * function setup() { - * createCanvas(100, 100, WEBGL); - * shader(grad); - * noStroke(); - * - * describe( - * 'canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed.' - * ); - * } - * - * function draw() { - * // update the offset values for each scenario, - * // moving the "grad" shader in either vertical or - * // horizontal direction each with differing colors - * - * if (showRedGreen === true) { - * grad.setUniform('colorCenter', [1, 0, 0]); - * grad.setUniform('colorBackground', [0, 1, 0]); - * grad.setUniform('offset', [sin(millis() / 2000), 1]); - * } else { - * grad.setUniform('colorCenter', [1, 0.5, 0]); - * grad.setUniform('colorBackground', [0.226, 0, 0.615]); - * grad.setUniform('offset', [0, sin(millis() / 2000) + 1]); - * } - * quad(-1, -1, 1, -1, 1, 1, -1, 1); - * } - * - * function mouseClicked() { - * showRedGreen = !showRedGreen; - * } - * - *
                                  - * - * @alt - * canvas toggles between a circular gradient of orange and blue vertically. and a circular gradient of red and green moving horizontally when mouse is clicked/pressed. - */, - }, - { - key: "setUniform", - value: function setUniform(uniformName, data) { - var uniform = this.uniforms[uniformName]; - if (!uniform) { - return; - } - var gl = this._renderer.GL; - if (uniform.isArray) { - if ( - uniform._cachedData && - this._renderer._arraysEqual(uniform._cachedData, data) - ) { - return; - } else { - uniform._cachedData = data.slice(0); - } - } else if ( - uniform._cachedData && - uniform._cachedData === data - ) { - return; - } else { - if (Array.isArray(data)) { - uniform._cachedData = data.slice(0); - } else { - uniform._cachedData = data; - } - } - var location = uniform.location; - this.useProgram(); - switch (uniform.type) { - case gl.BOOL: - if (data === true) { - gl.uniform1i(location, 1); - } else { - gl.uniform1i(location, 0); - } - break; - case gl.INT: - if (uniform.size > 1) { - data.length && gl.uniform1iv(location, data); - } else { - gl.uniform1i(location, data); - } - break; - case gl.FLOAT: - if (uniform.size > 1) { - data.length && gl.uniform1fv(location, data); - } else { - gl.uniform1f(location, data); - } - break; - case gl.FLOAT_MAT3: - gl.uniformMatrix3fv(location, false, data); - break; - case gl.FLOAT_MAT4: - gl.uniformMatrix4fv(location, false, data); - break; - case gl.FLOAT_VEC2: - if (uniform.size > 1) { - data.length && gl.uniform2fv(location, data); - } else { - gl.uniform2f(location, data[0], data[1]); - } - break; - case gl.FLOAT_VEC3: - if (uniform.size > 1) { - data.length && gl.uniform3fv(location, data); - } else { - gl.uniform3f(location, data[0], data[1], data[2]); - } - break; - case gl.FLOAT_VEC4: - if (uniform.size > 1) { - data.length && gl.uniform4fv(location, data); - } else { - gl.uniform4f( - location, - data[0], - data[1], - data[2], - data[3], - ); - } - break; - case gl.INT_VEC2: - if (uniform.size > 1) { - data.length && gl.uniform2iv(location, data); - } else { - gl.uniform2i(location, data[0], data[1]); - } - break; - case gl.INT_VEC3: - if (uniform.size > 1) { - data.length && gl.uniform3iv(location, data); - } else { - gl.uniform3i(location, data[0], data[1], data[2]); - } - break; - case gl.INT_VEC4: - if (uniform.size > 1) { - data.length && gl.uniform4iv(location, data); - } else { - gl.uniform4i( - location, - data[0], - data[1], - data[2], - data[3], - ); - } - break; - case gl.SAMPLER_2D: - gl.activeTexture(gl.TEXTURE0 + uniform.samplerIndex); - uniform.texture = - data instanceof _main.default.Texture - ? data - : this._renderer.getTexture(data); - gl.uniform1i(location, uniform.samplerIndex); - if (uniform.texture.src.gifProperties) { - uniform.texture.src._animateGif(this._renderer._pInst); - } - break; - //@todo complete all types - } - return this; - } /* NONE OF THIS IS FAST OR EFFICIENT BUT BEAR WITH ME - * - * these shader "type" query methods are used by various - * facilities of the renderer to determine if changing - * the shader type for the required action (for example, - * do we need to load the default lighting shader if the - * current shader cannot handle lighting?) - * - **/, - }, - { - key: "isLightShader", - value: function isLightShader() { - return ( - this.attributes.aNormal !== undefined || - this.uniforms.uUseLighting !== undefined || - this.uniforms.uAmbientLightCount !== undefined || - this.uniforms.uDirectionalLightCount !== undefined || - this.uniforms.uPointLightCount !== undefined || - this.uniforms.uAmbientColor !== undefined || - this.uniforms.uDirectionalDiffuseColors !== undefined || - this.uniforms.uDirectionalSpecularColors !== undefined || - this.uniforms.uPointLightLocation !== undefined || - this.uniforms.uPointLightDiffuseColors !== undefined || - this.uniforms.uPointLightSpecularColors !== undefined || - this.uniforms.uLightingDirection !== undefined || - this.uniforms.uSpecular !== undefined - ); - }, - }, - { - key: "isNormalShader", - value: function isNormalShader() { - return this.attributes.aNormal !== undefined; - }, - }, - { - key: "isTextureShader", - value: function isTextureShader() { - return this.samplers.length > 0; - }, - }, - { - key: "isColorShader", - value: function isColorShader() { - return ( - this.attributes.aVertexColor !== undefined || - this.uniforms.uMaterialColor !== undefined - ); - }, - }, - { - key: "isTexLightShader", - value: function isTexLightShader() { - return this.isLightShader() && this.isTextureShader(); - }, - }, - { - key: "isStrokeShader", - value: function isStrokeShader() { - return this.uniforms.uStrokeWeight !== undefined; - } /** - * @method enableAttrib - * @chainable - * @private - */, - }, - { - key: "enableAttrib", - value: function enableAttrib( - attr, - size, - type, - normalized, - stride, - offset, - ) { - if (attr) { - if ( - typeof IS_MINIFIED === "undefined" && - this.attributes[attr.name] !== attr - ) { - console.warn( - 'The attribute "'.concat( - attr.name, - '"passed to enableAttrib does not belong to this shader.', - ), - ); - } - var loc = attr.location; - if (loc !== -1) { - var gl = this._renderer.GL; - // Enable register even if it is disabled - if (!this._renderer.registerEnabled.has(loc)) { - gl.enableVertexAttribArray(loc); - // Record register availability - this._renderer.registerEnabled.add(loc); - } - this._renderer.GL.vertexAttribPointer( - loc, - size, - type || gl.FLOAT, - normalized || false, - stride || 0, - offset || 0, - ); - } - } - return this; - } /** - * Once all buffers have been bound, this checks to see if there are any - * remaining active attributes, likely left over from previous renders, - * and disables them so that they don't affect rendering. - * @method disableRemainingAttributes - * @private - */, - }, - { - key: "disableRemainingAttributes", - value: function disableRemainingAttributes() { - var _this = this; - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - var _loop = function _loop() { - var location = _step4.value; - if ( - !Object.keys(_this.attributes).some(function (key) { - return _this.attributes[key].location === location; - }) - ) { - _this._renderer.GL.disableVertexAttribArray(location); - _this._renderer.registerEnabled.delete(location); - } - }; - for ( - var _iterator4 = this._renderer.registerEnabled - .values() - [Symbol.iterator](), - _step4; - !(_iteratorNormalCompletion4 = (_step4 = - _iterator4.next()).done); - _iteratorNormalCompletion4 = true - ) { - _loop(); - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion4 && - _iterator4.return != null - ) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - }, - }, - ]); - return _class; - })(); - var _default = _main.default.Shader; - exports.default = _default; - }, - { - "../core/main": 298, - "core-js/modules/es.array.index-of": 178, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.array.slice": 183, - "core-js/modules/es.array.some": 184, - "core-js/modules/es.function.name": 186, - "core-js/modules/es.object.keys": 199, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 357: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.get-prototype-of"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.reflect.construct"); - _dereq_("core-js/modules/es.regexp.to-string"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.typed-array.uint8-array"); - _dereq_("core-js/modules/es.typed-array.copy-within"); - _dereq_("core-js/modules/es.typed-array.every"); - _dereq_("core-js/modules/es.typed-array.fill"); - _dereq_("core-js/modules/es.typed-array.filter"); - _dereq_("core-js/modules/es.typed-array.find"); - _dereq_("core-js/modules/es.typed-array.find-index"); - _dereq_("core-js/modules/es.typed-array.for-each"); - _dereq_("core-js/modules/es.typed-array.includes"); - _dereq_("core-js/modules/es.typed-array.index-of"); - _dereq_("core-js/modules/es.typed-array.iterator"); - _dereq_("core-js/modules/es.typed-array.join"); - _dereq_("core-js/modules/es.typed-array.last-index-of"); - _dereq_("core-js/modules/es.typed-array.map"); - _dereq_("core-js/modules/es.typed-array.reduce"); - _dereq_("core-js/modules/es.typed-array.reduce-right"); - _dereq_("core-js/modules/es.typed-array.reverse"); - _dereq_("core-js/modules/es.typed-array.set"); - _dereq_("core-js/modules/es.typed-array.slice"); - _dereq_("core-js/modules/es.typed-array.some"); - _dereq_("core-js/modules/es.typed-array.sort"); - _dereq_("core-js/modules/es.typed-array.subarray"); - _dereq_("core-js/modules/es.typed-array.to-locale-string"); - _dereq_("core-js/modules/es.typed-array.to-string"); - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.checkWebGLCapabilities = checkWebGLCapabilities; - exports.default = exports.MipmapTexture = void 0; - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError( - "Super expression must either be null or a function", - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true, - }, - }, - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - function isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ); - return true; - } catch (e) { - return false; - } - } - return function () { - var Super = _getPrototypeOf(Derived), - result; - if (isNativeReflectConstruct()) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === "object" || typeof call === "function") - ) { - return call; - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return self; - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } /** - * This module defines the p5.Texture class - * @module 3D - * @submodule Material - * @for p5 - * @requires core - */ - /** - * Texture class for WEBGL Mode - * @private - * @class p5.Texture - * @param {p5.RendererGL} renderer an instance of p5.RendererGL that - * will provide the GL context for this new p5.Texture - * @param {p5.Image|p5.Graphics|p5.Element|p5.MediaElement|ImageData|p5.Framebuffer|p5.FramebufferTexture|ImageData} [obj] the - * object containing the image data to store in the texture. - * @param {Object} [settings] optional A javascript object containing texture - * settings. - * @param {Number} [settings.format] optional The internal color component - * format for the texture. Possible values for format include gl.RGBA, - * gl.RGB, gl.ALPHA, gl.LUMINANCE, gl.LUMINANCE_ALPHA. Defaults to gl.RBGA - * @param {Number} [settings.minFilter] optional The texture minification - * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults - * to gl.LINEAR. Note, Mipmaps are not implemented in p5. - * @param {Number} [settings.magFilter] optional The texture magnification - * filter setting. Possible values are gl.NEAREST or gl.LINEAR. Defaults - * to gl.LINEAR. Note, Mipmaps are not implemented in p5. - * @param {Number} [settings.wrapS] optional The texture wrap settings for - * the s coordinate, or x axis. Possible values are gl.CLAMP_TO_EDGE, - * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available - * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE - * @param {Number} [settings.wrapT] optional The texture wrap settings for - * the t coordinate, or y axis. Possible values are gl.CLAMP_TO_EDGE, - * gl.REPEAT, and gl.MIRRORED_REPEAT. The mirror settings are only available - * when using a power of two sized texture. Defaults to gl.CLAMP_TO_EDGE - * @param {Number} [settings.dataType] optional The data type of the texel - * data. Possible values are gl.UNSIGNED_BYTE or gl.FLOAT. There are more - * formats that are not implemented in p5. Defaults to gl.UNSIGNED_BYTE. - */ - - _main.default.Texture = /*#__PURE__*/ (function () { - function Texture(renderer, obj, settings) { - _classCallCheck(this, Texture); - this._renderer = renderer; - var gl = this._renderer.GL; - settings = settings || {}; - this.src = obj; - this.glTex = undefined; - this.glTarget = gl.TEXTURE_2D; - this.glFormat = settings.format || gl.RGBA; - this.mipmaps = false; - this.glMinFilter = settings.minFilter || gl.LINEAR; - this.glMagFilter = settings.magFilter || gl.LINEAR; - this.glWrapS = settings.wrapS || gl.CLAMP_TO_EDGE; - this.glWrapT = settings.wrapT || gl.CLAMP_TO_EDGE; - this.glDataType = settings.dataType || gl.UNSIGNED_BYTE; - var support = checkWebGLCapabilities(renderer); - if (this.glFormat === gl.HALF_FLOAT && !support.halfFloat) { - console.log( - "This device does not support dataType HALF_FLOAT. Falling back to FLOAT.", - ); - this.glDataType = gl.FLOAT; - } - if ( - this.glFormat === gl.HALF_FLOAT && - (this.glMinFilter === gl.LINEAR || - this.glMagFilter === gl.LINEAR) && - !support.halfFloatLinear - ) { - console.log( - "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", - ); - if (this.glMinFilter === gl.LINEAR) - this.glMinFilter = gl.NEAREST; - if (this.glMagFilter === gl.LINEAR) - this.glMagFilter = gl.NEAREST; - } - if (this.glFormat === gl.FLOAT && !support.float) { - console.log( - "This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE.", - ); - this.glDataType = gl.UNSIGNED_BYTE; - } - if ( - this.glFormat === gl.FLOAT && - (this.glMinFilter === gl.LINEAR || - this.glMagFilter === gl.LINEAR) && - !support.floatLinear - ) { - console.log( - "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", - ); - if (this.glMinFilter === gl.LINEAR) - this.glMinFilter = gl.NEAREST; - if (this.glMagFilter === gl.LINEAR) - this.glMagFilter = gl.NEAREST; - } // used to determine if this texture might need constant updating - // because it is a video or gif. - - this.isSrcMediaElement = - typeof _main.default.MediaElement !== "undefined" && - obj instanceof _main.default.MediaElement; - this._videoPrevUpdateTime = 0; - this.isSrcHTMLElement = - typeof _main.default.Element !== "undefined" && - obj instanceof _main.default.Element && - !(obj instanceof _main.default.Graphics) && - !(obj instanceof _main.default.Renderer); - this.isSrcP5Image = obj instanceof _main.default.Image; - this.isSrcP5Graphics = obj instanceof _main.default.Graphics; - this.isSrcP5Renderer = obj instanceof _main.default.Renderer; - this.isImageData = - typeof ImageData !== "undefined" && obj instanceof ImageData; - this.isFramebufferTexture = - obj instanceof _main.default.FramebufferTexture; - var textureData = this._getTextureDataFromSource(); - this.width = textureData.width; - this.height = textureData.height; - this.init(textureData); - return this; - } - _createClass(Texture, [ - { - key: "_getTextureDataFromSource", - value: function _getTextureDataFromSource() { - var textureData; - if (this.isFramebufferTexture) { - textureData = this.src.rawTexture(); - } else if (this.isSrcP5Image) { - // param is a p5.Image - textureData = this.src.canvas; - } else if ( - this.isSrcMediaElement || - this.isSrcP5Graphics || - this.isSrcP5Renderer || - this.isSrcHTMLElement - ) { - // if param is a video HTML element - textureData = this.src.elt; - } else if (this.isImageData) { - textureData = this.src; - } - return textureData; - } /** - * Initializes common texture parameters, creates a gl texture, - * tries to upload the texture for the first time if data is - * already available. - * @private - * @method init - */, - }, - { - key: "init", - value: function init(data) { - var gl = this._renderer.GL; - if (!this.isFramebufferTexture) { - this.glTex = gl.createTexture(); - } - this.glWrapS = this._renderer.textureWrapX; - this.glWrapT = this._renderer.textureWrapY; - this.setWrapMode(this.glWrapS, this.glWrapT); - this.bindTexture(); - //gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_MAG_FILTER, - this.glMagFilter, - ); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_MIN_FILTER, - this.glMinFilter, - ); - if (this.isFramebufferTexture) { - // Do nothing, the framebuffer manages its own content - } else if ( - this.width === 0 || - this.height === 0 || - (this.isSrcMediaElement && !this.src.loadedmetadata) - ) { - // assign a 1×1 empty texture initially, because data is not yet ready, - // so that no errors occur in gl console! - var tmpdata = new Uint8Array([1, 1, 1, 1]); - gl.texImage2D( - this.glTarget, - 0, - gl.RGBA, - 1, - 1, - 0, - this.glFormat, - this.glDataType, - tmpdata, - ); - } else { - // data is ready: just push the texture! - gl.texImage2D( - this.glTarget, - 0, - this.glFormat, - this.glFormat, - this.glDataType, - data, - ); - } - } /** - * Checks if the source data for this texture has changed (if it's - * easy to do so) and reuploads the texture if necessary. If it's not - * possible or to expensive to do a calculation to determine wheter or - * not the data has occurred, this method simply re-uploads the texture. - * @method update - */, - }, - { - key: "update", - value: function update() { - var data = this.src; - if (data.width === 0 || data.height === 0) { - return false; // nothing to do! - } // FramebufferTexture instances wrap raw WebGL textures already, which - // don't need any extra updating, as they already live on the GPU - - if (this.isFramebufferTexture) { - return false; - } - var textureData = this._getTextureDataFromSource(); - var updated = false; - var gl = this._renderer.GL; - // pull texture from data, make sure width & height are appropriate - if ( - textureData.width !== this.width || - textureData.height !== this.height - ) { - updated = true; - // make sure that if the width and height of this.src have changed - // for some reason, we update our metadata and upload the texture again - this.width = textureData.width || data.width; - this.height = textureData.height || data.height; - if (this.isSrcP5Image) { - data.setModified(false); - } else if ( - this.isSrcMediaElement || - this.isSrcHTMLElement - ) { - // on the first frame the metadata comes in, the size will be changed - // from 0 to actual size, but pixels may not be available. - // flag for update in a future frame. - // if we don't do this, a paused video, for example, may not - // send the first frame to texture memory. - data.setModified(true); - } - } else if (this.isSrcP5Image) { - // for an image, we only update if the modified field has been set, - // for example, by a call to p5.Image.set - if (data.isModified()) { - updated = true; - data.setModified(false); - } - } else if (this.isSrcMediaElement) { - // for a media element (video), we'll check if the current time in - // the video frame matches the last time. if it doesn't match, the - // video has advanced or otherwise been taken to a new frame, - // and we need to upload it. - if (data.isModified()) { - // p5.MediaElement may have also had set/updatePixels, etc. called - // on it and should be updated, or may have been set for the first - // time! - updated = true; - data.setModified(false); - } else if (data.loadedmetadata) { - // if the meta data has been loaded, we can ask the video - // what it's current position (in time) is. - if (this._videoPrevUpdateTime !== data.time()) { - // update the texture in gpu mem only if the current - // video timestamp does not match the timestamp of the last - // time we uploaded this texture (and update the time we - // last uploaded, too) - this._videoPrevUpdateTime = data.time(); - updated = true; - } - } - } else if (this.isImageData) { - if (data._dirty) { - data._dirty = false; - updated = true; - } - } else { - /* data instanceof p5.Graphics, probably */ - // there is not enough information to tell if the texture can be - // conditionally updated; so to be safe, we just go ahead and upload it. - updated = true; - } - if (updated) { - this.bindTexture(); - gl.texImage2D( - this.glTarget, - 0, - this.glFormat, - this.glFormat, - this.glDataType, - textureData, - ); - } - return updated; - } /** - * Binds the texture to the appropriate GL target. - * @method bindTexture - */, - }, - { - key: "bindTexture", - value: function bindTexture() { - // bind texture using gl context + glTarget and - // generated gl texture object - var gl = this._renderer.GL; - gl.bindTexture(this.glTarget, this.getTexture()); - return this; - } /** - * Unbinds the texture from the appropriate GL target. - * @method unbindTexture - */, - }, - { - key: "unbindTexture", - value: function unbindTexture() { - // unbind per above, disable texturing on glTarget - var gl = this._renderer.GL; - gl.bindTexture(this.glTarget, null); - }, - }, - { - key: "getTexture", - value: function getTexture() { - if (this.isFramebufferTexture) { - return this.src.rawTexture(); - } else { - return this.glTex; - } - } /** - * Sets how a texture is be interpolated when upscaled or downscaled. - * Nearest filtering uses nearest neighbor scaling when interpolating - * Linear filtering uses WebGL's linear scaling when interpolating - * @method setInterpolation - * @param {String} downScale Specifies the texture filtering when - * textures are shrunk. Options are LINEAR or NEAREST - * @param {String} upScale Specifies the texture filtering when - * textures are magnified. Options are LINEAR or NEAREST - * @todo implement mipmapping filters - */, - }, - { - key: "setInterpolation", - value: function setInterpolation(downScale, upScale) { - var gl = this._renderer.GL; - this.glMinFilter = this.glFilter(downScale); - this.glMagFilter = this.glFilter(upScale); - this.bindTexture(); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_MIN_FILTER, - this.glMinFilter, - ); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_MAG_FILTER, - this.glMagFilter, - ); - this.unbindTexture(); - }, - }, - { - key: "glFilter", - value: function glFilter(filter) { - var gl = this._renderer.GL; - if (filter === constants.NEAREST) { - return gl.NEAREST; - } else { - return gl.LINEAR; - } - } /** - * Sets the texture wrapping mode. This controls how textures behave - * when their uv's go outside of the 0 - 1 range. There are three options: - * CLAMP, REPEAT, and MIRROR. REPEAT & MIRROR are only available if the texture - * is a power of two size (128, 256, 512, 1024, etc.). - * @method setWrapMode - * @param {String} wrapX Controls the horizontal texture wrapping behavior - * @param {String} wrapY Controls the vertical texture wrapping behavior - */, - }, - { - key: "setWrapMode", - value: function setWrapMode(wrapX, wrapY) { - var gl = this._renderer.GL; - // for webgl 1 we need to check if the texture is power of two - // if it isn't we will set the wrap mode to CLAMP - // webgl2 will support npot REPEAT and MIRROR but we don't check for it yet - var isPowerOfTwo = function isPowerOfTwo(x) { - return (x & (x - 1)) === 0; - }; - var textureData = this._getTextureDataFromSource(); - var wrapWidth; - var wrapHeight; - if (textureData.naturalWidth && textureData.naturalHeight) { - wrapWidth = textureData.naturalWidth; - wrapHeight = textureData.naturalHeight; - } else { - wrapWidth = this.width; - wrapHeight = this.height; - } - var widthPowerOfTwo = isPowerOfTwo(wrapWidth); - var heightPowerOfTwo = isPowerOfTwo(wrapHeight); - if (wrapX === constants.REPEAT) { - if ( - this._renderer.webglVersion === constants.WEBGL2 || - (widthPowerOfTwo && heightPowerOfTwo) - ) { - this.glWrapS = gl.REPEAT; - } else { - console.warn( - "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", - ); - this.glWrapS = gl.CLAMP_TO_EDGE; - } - } else if (wrapX === constants.MIRROR) { - if ( - this._renderer.webglVersion === constants.WEBGL2 || - (widthPowerOfTwo && heightPowerOfTwo) - ) { - this.glWrapS = gl.MIRRORED_REPEAT; - } else { - console.warn( - "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", - ); - this.glWrapS = gl.CLAMP_TO_EDGE; - } - } else { - // falling back to default if didn't get a proper mode - this.glWrapS = gl.CLAMP_TO_EDGE; - } - if (wrapY === constants.REPEAT) { - if ( - this._renderer.webglVersion === constants.WEBGL2 || - (widthPowerOfTwo && heightPowerOfTwo) - ) { - this.glWrapT = gl.REPEAT; - } else { - console.warn( - "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", - ); - this.glWrapT = gl.CLAMP_TO_EDGE; - } - } else if (wrapY === constants.MIRROR) { - if ( - this._renderer.webglVersion === constants.WEBGL2 || - (widthPowerOfTwo && heightPowerOfTwo) - ) { - this.glWrapT = gl.MIRRORED_REPEAT; - } else { - console.warn( - "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", - ); - this.glWrapT = gl.CLAMP_TO_EDGE; - } - } else { - // falling back to default if didn't get a proper mode - this.glWrapT = gl.CLAMP_TO_EDGE; - } - this.bindTexture(); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_WRAP_S, - this.glWrapS, - ); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_WRAP_T, - this.glWrapT, - ); - this.unbindTexture(); - }, - }, - ]); - return Texture; - })(); - var MipmapTexture = /*#__PURE__*/ (function (_p5$Texture) { - _inherits(MipmapTexture, _p5$Texture); - var _super = _createSuper(MipmapTexture); - function MipmapTexture(renderer, levels, settings) { - var _this; - _classCallCheck(this, MipmapTexture); - _this = _super.call(this, renderer, levels, settings); - var gl = _this._renderer.GL; - if (_this.glMinFilter === gl.LINEAR) { - _this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; - } - return _this; - } - _createClass(MipmapTexture, [ - { - key: "glFilter", - value: function glFilter(_filter) { - var gl = this._renderer.GL; - // TODO: support others - return gl.LINEAR_MIPMAP_LINEAR; - }, - }, - { - key: "_getTextureDataFromSource", - value: function _getTextureDataFromSource() { - return this.src; - }, - }, - { - key: "init", - value: function init(levels) { - var gl = this._renderer.GL; - this.glTex = gl.createTexture(); - this.bindTexture(); - for (var level = 0; level < levels.length; level++) { - gl.texImage2D( - this.glTarget, - level, - this.glFormat, - this.glFormat, - this.glDataType, - levels[level], - ); - } - this.glMinFilter = gl.LINEAR_MIPMAP_LINEAR; - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_MAG_FILTER, - this.glMagFilter, - ); - gl.texParameteri( - gl.TEXTURE_2D, - gl.TEXTURE_MIN_FILTER, - this.glMinFilter, - ); - this.unbindTexture(); - }, - }, - { - key: "update", - value: function update() {}, - }, - ]); - return MipmapTexture; - })(_main.default.Texture); - exports.MipmapTexture = MipmapTexture; - function checkWebGLCapabilities(_ref) { - var GL = _ref.GL, - webglVersion = _ref.webglVersion; - var gl = GL; - var supportsFloat = - webglVersion === constants.WEBGL2 - ? gl.getExtension("EXT_color_buffer_float") && - gl.getExtension("EXT_float_blend") - : gl.getExtension("OES_texture_float"); - var supportsFloatLinear = - supportsFloat && gl.getExtension("OES_texture_float_linear"); - var supportsHalfFloat = - webglVersion === constants.WEBGL2 - ? gl.getExtension("EXT_color_buffer_float") - : gl.getExtension("OES_texture_half_float"); - var supportsHalfFloatLinear = - supportsHalfFloat && - gl.getExtension("OES_texture_half_float_linear"); - return { - float: supportsFloat, - floatLinear: supportsFloatLinear, - halfFloat: supportsHalfFloat, - halfFloatLinear: supportsHalfFloatLinear, - }; - } - var _default = _main.default.Texture; - exports.default = _default; - }, - { - "../core/constants": 286, - "../core/main": 298, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.get-prototype-of": 198, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.reflect.construct": 202, - "core-js/modules/es.regexp.to-string": 206, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.typed-array.copy-within": 223, - "core-js/modules/es.typed-array.every": 224, - "core-js/modules/es.typed-array.fill": 225, - "core-js/modules/es.typed-array.filter": 226, - "core-js/modules/es.typed-array.find": 228, - "core-js/modules/es.typed-array.find-index": 227, - "core-js/modules/es.typed-array.for-each": 231, - "core-js/modules/es.typed-array.includes": 232, - "core-js/modules/es.typed-array.index-of": 233, - "core-js/modules/es.typed-array.iterator": 236, - "core-js/modules/es.typed-array.join": 237, - "core-js/modules/es.typed-array.last-index-of": 238, - "core-js/modules/es.typed-array.map": 239, - "core-js/modules/es.typed-array.reduce": 241, - "core-js/modules/es.typed-array.reduce-right": 240, - "core-js/modules/es.typed-array.reverse": 242, - "core-js/modules/es.typed-array.set": 243, - "core-js/modules/es.typed-array.slice": 244, - "core-js/modules/es.typed-array.some": 245, - "core-js/modules/es.typed-array.sort": 246, - "core-js/modules/es.typed-array.subarray": 247, - "core-js/modules/es.typed-array.to-locale-string": 248, - "core-js/modules/es.typed-array.to-string": 249, - "core-js/modules/es.typed-array.uint8-array": 252, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 358: [ - function (_dereq_, module, exports) { - "use strict"; - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.get-own-property-descriptor"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.sub"); - _dereq_("core-js/modules/es.weak-map"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - function _typeof2(obj) { - if ( - typeof Symbol === "function" && - typeof Symbol.iterator === "symbol" - ) { - _typeof2 = function _typeof2(obj) { - return typeof obj; - }; - } else { - _typeof2 = function _typeof2(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof2(obj); - } - function _typeof(obj) { - if ( - typeof Symbol === "function" && - _typeof2(Symbol.iterator) === "symbol" - ) { - _typeof = function _typeof(obj) { - return _typeof2(obj); - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : _typeof2(obj); - }; - } - return _typeof(obj); - } - _dereq_("core-js/modules/es.symbol"); - _dereq_("core-js/modules/es.symbol.description"); - _dereq_("core-js/modules/es.symbol.iterator"); - _dereq_("core-js/modules/es.array.iterator"); - _dereq_("core-js/modules/es.object.to-string"); - _dereq_("core-js/modules/es.regexp.exec"); - _dereq_("core-js/modules/es.string.iterator"); - _dereq_("core-js/modules/es.string.split"); - _dereq_("core-js/modules/es.string.sub"); - _dereq_("core-js/modules/web.dom-collections.iterator"); - var _main = _interopRequireDefault(_dereq_("../core/main")); - var constants = _interopRequireWildcard(_dereq_("../core/constants")); - _dereq_("./p5.Shader"); - _dereq_("./p5.RendererGL.Retained"); - function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - return cache; - } - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - if ( - obj === null || - (_typeof(obj) !== "object" && typeof obj !== "function") - ) { - return { - default: obj, - }; - } - var cache = _getRequireWildcardCache(); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = - Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - if (cache) { - cache.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } // Text/Typography - // @TODO: - - _main.default.RendererGL.prototype._applyTextProperties = - function () { - //@TODO finish implementation - //console.error('text commands not yet implemented in webgl'); - }; - _main.default.RendererGL.prototype.textWidth = function (s) { - if (this._isOpenType()) { - return this._textFont._textWidth(s, this._textSize); - } - return 0; // TODO: error - }; - // rendering constants - // the number of rows/columns dividing each glyph - var charGridWidth = 9; - var charGridHeight = charGridWidth; - // size of the image holding the bezier stroke info - var strokeImageWidth = 64; - var strokeImageHeight = 64; - // size of the image holding the stroke indices for each row/col - var gridImageWidth = 64; - var gridImageHeight = 64; - // size of the image holding the offset/length of each row/col stripe - var cellImageWidth = 64; - var cellImageHeight = 64; - /** - * @private - * @class ImageInfos - * @param {Integer} width - * @param {Integer} height - * - * the ImageInfos class holds a list of ImageDatas of a given size. - */ - var ImageInfos = /*#__PURE__*/ (function () { - function ImageInfos(width, height) { - _classCallCheck(this, ImageInfos); - this.width = width; - this.height = height; - this.infos = []; // the list of images - } /** - * - * @method findImage - * @param {Integer} space - * @return {Object} contains the ImageData, and pixel index into that - * ImageData where the free space was allocated. - * - * finds free space of a given size in the ImageData list - */ - - _createClass(ImageInfos, [ - { - key: "findImage", - value: function findImage(space) { - var imageSize = this.width * this.height; - if (space > imageSize) - throw new Error("font is too complex to render in 3D"); - // search through the list of images, looking for one with - // anough unused space. - var imageInfo, imageData; - for (var ii = this.infos.length - 1; ii >= 0; --ii) { - var imageInfoTest = this.infos[ii]; - if (imageInfoTest.index + space < imageSize) { - // found one - imageInfo = imageInfoTest; - imageData = imageInfoTest.imageData; - break; - } - } - if (!imageInfo) { - try { - // create a new image - imageData = new ImageData(this.width, this.height); - } catch (err) { - // for browsers that don't support ImageData constructors (ie IE11) - // create an ImageData using the old method - var canvas = document.getElementsByTagName("canvas")[0]; - var created = !canvas; - if (!canvas) { - // create a temporary canvas - canvas = document.createElement("canvas"); - canvas.style.display = "none"; - document.body.appendChild(canvas); - } - var ctx = canvas.getContext("2d"); - if (ctx) { - imageData = ctx.createImageData( - this.width, - this.height, - ); - } - if (created) { - // distroy the temporary canvas, if necessary - document.body.removeChild(canvas); - } - } // construct & dd the new image info - - imageInfo = { - index: 0, - imageData: imageData, - }; - this.infos.push(imageInfo); - } - var index = imageInfo.index; - imageInfo.index += space; // move to the start of the next image - imageData._dirty = true; - return { - imageData: imageData, - index: index, - }; - }, - }, - ]); - return ImageInfos; - })(); - /** - * @function setPixel - * @param {Object} imageInfo - * @param {Number} r - * @param {Number} g - * @param {Number} b - * @param {Number} a - * - * writes the next pixel into an indexed ImageData - */ - function setPixel(imageInfo, r, g, b, a) { - var imageData = imageInfo.imageData; - var pixels = imageData.data; - var index = imageInfo.index++ * 4; - pixels[index++] = r; - pixels[index++] = g; - pixels[index++] = b; - pixels[index++] = a; - } - var SQRT3 = Math.sqrt(3); - /** - * @private - * @class FontInfo - * @param {Object} font an opentype.js font object - * - * contains cached images and glyph information for an opentype font - */ - var FontInfo = /*#__PURE__*/ (function () { - function FontInfo(font) { - _classCallCheck(this, FontInfo); - this.font = font; - // the bezier curve coordinates - this.strokeImageInfos = new ImageInfos( - strokeImageWidth, - strokeImageHeight, - ); - // lists of curve indices for each row/column slice - this.colDimImageInfos = new ImageInfos( - gridImageWidth, - gridImageHeight, - ); - this.rowDimImageInfos = new ImageInfos( - gridImageWidth, - gridImageHeight, - ); - // the offset & length of each row/col slice in the glyph - this.colCellImageInfos = new ImageInfos( - cellImageWidth, - cellImageHeight, - ); - this.rowCellImageInfos = new ImageInfos( - cellImageWidth, - cellImageHeight, - ); - // the cached information for each glyph - this.glyphInfos = {}; - } /** - * @method getGlyphInfo - * @param {Glyph} glyph the x positions of points in the curve - * @returns {Object} the glyphInfo for that glyph - * - * calculates rendering info for a glyph, including the curve information, - * row & column stripes compiled into textures. - */ - - _createClass(FontInfo, [ - { - key: "getGlyphInfo", - value: function getGlyphInfo(glyph) { - // check the cache - var gi = this.glyphInfos[glyph.index]; - if (gi) return gi; - // get the bounding box of the glyph from opentype.js - var bb = glyph.getBoundingBox(); - var xMin = bb.x1; - var yMin = bb.y1; - var gWidth = bb.x2 - xMin; - var gHeight = bb.y2 - yMin; - var cmds = glyph.path.commands; - // don't bother rendering invisible glyphs - if (gWidth === 0 || gHeight === 0 || !cmds.length) { - return (this.glyphInfos[glyph.index] = {}); - } - var i; - var strokes = []; // the strokes in this glyph - var rows = []; // the indices of strokes in each row - var cols = []; // the indices of strokes in each column - for (i = charGridWidth - 1; i >= 0; --i) { - cols.push([]); - } - for (i = charGridHeight - 1; i >= 0; --i) { - rows.push([]); - } /** - * @function push - * @param {Number[]} xs the x positions of points in the curve - * @param {Number[]} ys the y positions of points in the curve - * @param {Object} v the curve information - * - * adds a curve to the rows & columns that it intersects with - */ - - function push(xs, ys, v) { - var index = strokes.length; // the index of this stroke - strokes.push(v); // add this stroke to the list - /** - * @function minMax - * @param {Number[]} rg the list of values to compare - * @param {Number} min the initial minimum value - * @param {Number} max the initial maximum value - * - * find the minimum & maximum value in a list of values - */ - function minMax(rg, min, max) { - for (var _i = rg.length; _i-- > 0; ) { - var _v = rg[_i]; - if (min > _v) min = _v; - if (max < _v) max = _v; - } - return { - min: min, - max: max, - }; - } // Expand the bounding box of the glyph by the number of cells below - // before rounding. Curves only partially through a cell won't be added - // to adjacent cells, but ones that are close will be. This helps fix - // small visual glitches that occur when curves are close to grid cell - // boundaries. - - var cellOffset = 0.5; - // loop through the rows & columns that the curve intersects - // adding the curve to those slices - var mmX = minMax(xs, 1, 0); - var ixMin = Math.max( - Math.floor(mmX.min * charGridWidth - cellOffset), - 0, - ); - var ixMax = Math.min( - Math.ceil(mmX.max * charGridWidth + cellOffset), - charGridWidth, - ); - for (var iCol = ixMin; iCol < ixMax; ++iCol) { - cols[iCol].push(index); - } - var mmY = minMax(ys, 1, 0); - var iyMin = Math.max( - Math.floor(mmY.min * charGridHeight - cellOffset), - 0, - ); - var iyMax = Math.min( - Math.ceil(mmY.max * charGridHeight + cellOffset), - charGridHeight, - ); - for (var iRow = iyMin; iRow < iyMax; ++iRow) { - rows[iRow].push(index); - } - } /** - * @function clamp - * @param {Number} v the value to clamp - * @param {Number} min the minimum value - * @param {Number} max the maxmimum value - * - * clamps a value between a minimum & maximum value - */ - - function clamp(v, min, max) { - if (v < min) return min; - if (v > max) return max; - return v; - } /** - * @function byte - * @param {Number} v the value to scale - * - * converts a floating-point number in the range 0-1 to a byte 0-255 - */ - - function byte(v) { - return clamp(255 * v, 0, 255); - } /** - * @private - * @class Cubic - * @param {Number} p0 the start point of the curve - * @param {Number} c0 the first control point - * @param {Number} c1 the second control point - * @param {Number} p1 the end point - * - * a cubic curve - */ - - var Cubic = /*#__PURE__*/ (function () { - function Cubic(p0, c0, c1, p1) { - _classCallCheck(this, Cubic); - this.p0 = p0; - this.c0 = c0; - this.c1 = c1; - this.p1 = p1; - } /** - * @method toQuadratic - * @return {Object} the quadratic approximation - * - * converts the cubic to a quadtratic approximation by - * picking an appropriate quadratic control point - */ - - _createClass(Cubic, [ - { - key: "toQuadratic", - value: function toQuadratic() { - return { - x: this.p0.x, - y: this.p0.y, - x1: this.p1.x, - y1: this.p1.y, - cx: - ((this.c0.x + this.c1.x) * 3 - - (this.p0.x + this.p1.x)) / - 4, - cy: - ((this.c0.y + this.c1.y) * 3 - - (this.p0.y + this.p1.y)) / - 4, - }; - } /** - * @method quadError - * @return {Number} the error - * - * calculates the magnitude of error of this curve's - * quadratic approximation. - */, - }, - { - key: "quadError", - value: function quadError() { - return ( - _main.default.Vector.sub( - _main.default.Vector.sub(this.p1, this.p0), - _main.default.Vector.mult( - _main.default.Vector.sub(this.c1, this.c0), - 3, - ), - ).mag() / 2 - ); - } /** - * @method split - * @param {Number} t the value (0-1) at which to split - * @return {Cubic} the second part of the curve - * - * splits the cubic into two parts at a point 't' along the curve. - * this cubic keeps its start point and its end point becomes the - * point at 't'. the 'end half is returned. - */, - }, - { - key: "split", - value: function split(t) { - var m1 = _main.default.Vector.lerp( - this.p0, - this.c0, - t, - ); - var m2 = _main.default.Vector.lerp( - this.c0, - this.c1, - t, - ); - var mm1 = _main.default.Vector.lerp(m1, m2, t); - this.c1 = _main.default.Vector.lerp( - this.c1, - this.p1, - t, - ); - this.c0 = _main.default.Vector.lerp(m2, this.c1, t); - var pt = _main.default.Vector.lerp(mm1, this.c0, t); - var part1 = new Cubic(this.p0, m1, mm1, pt); - this.p0 = pt; - return part1; - } /** - * @method splitInflections - * @return {Cubic[]} the non-inflecting pieces of this cubic - * - * returns an array containing 0, 1 or 2 cubics split resulting - * from splitting this cubic at its inflection points. - * this cubic is (potentially) altered and returned in the list. - */, - }, - { - key: "splitInflections", - value: function splitInflections() { - var a = _main.default.Vector.sub(this.c0, this.p0); - var b = _main.default.Vector.sub( - _main.default.Vector.sub(this.c1, this.c0), - a, - ); - var c = _main.default.Vector.sub( - _main.default.Vector.sub( - _main.default.Vector.sub(this.p1, this.c1), - a, - ), - _main.default.Vector.mult(b, 2), - ); - var cubics = []; - // find the derivative coefficients - var A = b.x * c.y - b.y * c.x; - if (A !== 0) { - var B = a.x * c.y - a.y * c.x; - var C = a.x * b.y - a.y * b.x; - var disc = B * B - 4 * A * C; - if (disc >= 0) { - if (A < 0) { - A = -A; - B = -B; - C = -C; - } - var Q = Math.sqrt(disc); - var t0 = (-B - Q) / (2 * A); // the first inflection point - var t1 = (-B + Q) / (2 * A); // the second inflection point - // test if the first inflection point lies on the curve - if (t0 > 0 && t0 < 1) { - // split at the first inflection point - cubics.push(this.split(t0)); - // scale t2 into the second part - t1 = 1 - (1 - t1) / (1 - t0); - } // test if the second inflection point lies on the curve - - if (t1 > 0 && t1 < 1) { - // split at the second inflection point - cubics.push(this.split(t1)); - } - } - } - cubics.push(this); - return cubics; - }, - }, - ]); - return Cubic; - })(); - /** - * @function cubicToQuadratics - * @param {Number} x0 - * @param {Number} y0 - * @param {Number} cx0 - * @param {Number} cy0 - * @param {Number} cx1 - * @param {Number} cy1 - * @param {Number} x1 - * @param {Number} y1 - * @returns {Cubic[]} an array of cubics whose quadratic approximations - * closely match the civen cubic. - * - * converts a cubic curve to a list of quadratics. - */ - function cubicToQuadratics( - x0, - y0, - cx0, - cy0, - cx1, - cy1, - x1, - y1, - ) { - // create the Cubic object and split it at its inflections - var cubics = new Cubic( - new _main.default.Vector(x0, y0), - new _main.default.Vector(cx0, cy0), - new _main.default.Vector(cx1, cy1), - new _main.default.Vector(x1, y1), - ).splitInflections(); - var qs = []; // the final list of quadratics - var precision = 30 / SQRT3; - // for each of the non-inflected pieces of the original cubic - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - try { - for ( - var _iterator = cubics[Symbol.iterator](), _step; - !(_iteratorNormalCompletion = (_step = _iterator.next()) - .done); - _iteratorNormalCompletion = true - ) { - var cubic = _step.value; - // the cubic is iteratively split in 3 pieces: - // the first piece is accumulated in 'qs', the result. - // the last piece is accumulated in 'tail', temporarily. - // the middle piece is repeatedly split again, while necessary. - var tail = []; - var t3 = void 0; - for (;;) { - // calculate this cubic's precision - t3 = precision / cubic.quadError(); - if (t3 >= 0.5 * 0.5 * 0.5) { - break; // not too bad, we're done - } // find a split point based on the error - - var t = Math.pow(t3, 1 / 3); - // split the cubic in 3 - var start = cubic.split(t); - var middle = cubic.split(1 - t / (1 - t)); - qs.push(start); // the first part - tail.push(cubic); // the last part - cubic = middle; // iterate on the middle piece - } - if (t3 < 1) { - // a little excess error, split the middle in two - qs.push(cubic.split(0.5)); - } // add the middle piece to the result - - qs.push(cubic); - // finally add the tail, reversed, onto the result - Array.prototype.push.apply(qs, tail.reverse()); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if ( - !_iteratorNormalCompletion && - _iterator.return != null - ) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return qs; - } /** - * @function pushLine - * @param {Number} x0 - * @param {Number} y0 - * @param {Number} x1 - * @param {Number} y1 - * - * add a straight line to the row/col grid of a glyph - */ - - function pushLine(x0, y0, x1, y1) { - var mx = (x0 + x1) / 2; - var my = (y0 + y1) / 2; - push([x0, x1], [y0, y1], { - x: x0, - y: y0, - cx: mx, - cy: my, - }); - } /** - * @function samePoint - * @param {Number} x0 - * @param {Number} y0 - * @param {Number} x1 - * @param {Number} y1 - * @return {Boolean} true if the two points are sufficiently close - * - * tests if two points are close enough to be considered the same - */ - - function samePoint(x0, y0, x1, y1) { - return ( - Math.abs(x1 - x0) < 0.00001 && Math.abs(y1 - y0) < 0.00001 - ); - } - var x0, y0, xs, ys; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - try { - for ( - var _iterator2 = cmds[Symbol.iterator](), _step2; - !(_iteratorNormalCompletion2 = (_step2 = - _iterator2.next()).done); - _iteratorNormalCompletion2 = true - ) { - var cmd = _step2.value; - // scale the coordinates to the range 0-1 - var x1 = (cmd.x - xMin) / gWidth; - var y1 = (cmd.y - yMin) / gHeight; - // don't bother if this point is the same as the last - if (samePoint(x0, y0, x1, y1)) continue; - switch (cmd.type) { - case "M": { - // move - xs = x1; - ys = y1; - break; - } - case "L": { - // line - pushLine(x0, y0, x1, y1); - break; - } - case "Q": { - // quadratic - var cx = (cmd.x1 - xMin) / gWidth; - var cy = (cmd.y1 - yMin) / gHeight; - push([x0, x1, cx], [y0, y1, cy], { - x: x0, - y: y0, - cx: cx, - cy: cy, - }); - break; - } - case "Z": { - // end - if (!samePoint(x0, y0, xs, ys)) { - // add an extra line closing the loop, if necessary - pushLine(x0, y0, xs, ys); - strokes.push({ - x: xs, - y: ys, - }); - } else { - strokes.push({ - x: x0, - y: y0, - }); - } - break; - } - case "C": { - // cubic - var cx1 = (cmd.x1 - xMin) / gWidth; - var cy1 = (cmd.y1 - yMin) / gHeight; - var cx2 = (cmd.x2 - xMin) / gWidth; - var cy2 = (cmd.y2 - yMin) / gHeight; - var qs = cubicToQuadratics( - x0, - y0, - cx1, - cy1, - cx2, - cy2, - x1, - y1, - ); - for (var iq = 0; iq < qs.length; iq++) { - var q = qs[iq].toQuadratic(); - push([q.x, q.x1, q.cx], [q.y, q.y1, q.cy], q); - } - break; - } - default: - throw new Error( - "unknown command type: ".concat(cmd.type), - ); - } - x0 = x1; - y0 = y1; - } // allocate space for the strokes - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion2 && - _iterator2.return != null - ) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - var strokeCount = strokes.length; - var strokeImageInfo = - this.strokeImageInfos.findImage(strokeCount); - var strokeOffset = strokeImageInfo.index; - // fill the stroke image - for (var il = 0; il < strokeCount; ++il) { - var s = strokes[il]; - setPixel( - strokeImageInfo, - byte(s.x), - byte(s.y), - byte(s.cx), - byte(s.cy), - ); - } /** - * @function layout - * @param {Number[][]} dim - * @param {ImageInfo[]} dimImageInfos - * @param {ImageInfo[]} cellImageInfos - * @return {Object} - * - * lays out the curves in a dimension (row or col) into two - * images, one for the indices of the curves themselves, and - * one containing the offset and length of those index spans. - */ - - function layout(dim, dimImageInfos, cellImageInfos) { - var dimLength = dim.length; // the number of slices in this dimension - var dimImageInfo = dimImageInfos.findImage(dimLength); - var dimOffset = dimImageInfo.index; - // calculate the total number of stroke indices in this dimension - var totalStrokes = 0; - for (var id = 0; id < dimLength; ++id) { - totalStrokes += dim[id].length; - } // allocate space for the stroke indices - - var cellImageInfo = cellImageInfos.findImage(totalStrokes); - // for each slice in the glyph - for (var _i2 = 0; _i2 < dimLength; ++_i2) { - var strokeIndices = dim[_i2]; - var _strokeCount = strokeIndices.length; - var cellLineIndex = cellImageInfo.index; - // write the offset and count into the glyph slice image - setPixel( - dimImageInfo, - cellLineIndex >> 7, - cellLineIndex & 127, - _strokeCount >> 7, - _strokeCount & 127, - ); - // for each stroke index in that slice - for (var iil = 0; iil < _strokeCount; ++iil) { - // write the stroke index into the slice's image - var strokeIndex = strokeIndices[iil] + strokeOffset; - setPixel( - cellImageInfo, - strokeIndex >> 7, - strokeIndex & 127, - 0, - 0, - ); - } - } - return { - cellImageInfo: cellImageInfo, - dimOffset: dimOffset, - dimImageInfo: dimImageInfo, - }; - } // initialize the info for this glyph - - gi = this.glyphInfos[glyph.index] = { - glyph: glyph, - uGlyphRect: [bb.x1, -bb.y1, bb.x2, -bb.y2], - strokeImageInfo: strokeImageInfo, - strokes: strokes, - colInfo: layout( - cols, - this.colDimImageInfos, - this.colCellImageInfos, - ), - rowInfo: layout( - rows, - this.rowDimImageInfos, - this.rowCellImageInfos, - ), - }; - gi.uGridOffset = [gi.colInfo.dimOffset, gi.rowInfo.dimOffset]; - return gi; - }, - }, - ]); - return FontInfo; - })(); - _main.default.RendererGL.prototype._renderText = function ( - p, - line, - x, - y, - maxY, - ) { - if (!this._textFont || typeof this._textFont === "string") { - console.log( - "WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.", - ); - return; - } - if (y >= maxY || !this._doFill) { - return; // don't render lines beyond our maxY position - } - if (!this._isOpenType()) { - console.log( - "WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported", - ); - return p; - } - p.push(); // fix to #803 - // remember this state, so it can be restored later - var doStroke = this._doStroke; - var drawMode = this.drawMode; - this._doStroke = false; - this.drawMode = constants.TEXTURE; - // get the cached FontInfo object - var font = this._textFont.font; - var fontInfo = this._textFont._fontInfo; - if (!fontInfo) { - fontInfo = this._textFont._fontInfo = new FontInfo(font); - } // calculate the alignment and move/scale the view accordingly - - var pos = this._textFont._handleAlignment(this, line, x, y); - var fontSize = this._textSize; - var scale = fontSize / font.unitsPerEm; - this.translate(pos.x, pos.y, 0); - this.scale(scale, scale, 1); - // initialize the font shader - var gl = this.GL; - var initializeShader = !this._defaultFontShader; - var sh = this._getFontShader(); - sh.init(); - sh.bindShader(); // first time around, bind the shader fully - if (initializeShader) { - // these are constants, really. just initialize them one-time. - sh.setUniform("uGridImageSize", [ - gridImageWidth, - gridImageHeight, - ]); - sh.setUniform("uCellsImageSize", [ - cellImageWidth, - cellImageHeight, - ]); - sh.setUniform("uStrokeImageSize", [ - strokeImageWidth, - strokeImageHeight, - ]); - sh.setUniform("uGridSize", [charGridWidth, charGridHeight]); - } - this._applyColorBlend(this.curFillColor); - var g = this.retainedMode.geometry["glyph"]; - if (!g) { - // create the geometry for rendering a quad - var geom = (this._textGeom = new _main.default.Geometry( - 1, - 1, - function () { - for (var i = 0; i <= 1; i++) { - for (var j = 0; j <= 1; j++) { - this.vertices.push(new _main.default.Vector(j, i, 0)); - this.uvs.push(j, i); - } - } - }, - )); - geom.computeFaces().computeNormals(); - g = this.createBuffers("glyph", geom); - } // bind the shader buffers - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - try { - for ( - var _iterator3 = - this.retainedMode.buffers.text[Symbol.iterator](), - _step3; - !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()) - .done); - _iteratorNormalCompletion3 = true - ) { - var buff = _step3.value; - buff._prepareBuffer(g, sh); - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return != null) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - this._bindBuffer(g.indexBuffer, gl.ELEMENT_ARRAY_BUFFER); - // this will have to do for now... - sh.setUniform("uMaterialColor", this.curFillColor); - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - try { - var dx = 0; // the x position in the line - var glyphPrev = null; // the previous glyph, used for kerning - // fetch the glyphs in the line of text - var glyphs = font.stringToGlyphs(line); - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; - try { - for ( - var _iterator4 = glyphs[Symbol.iterator](), _step4; - !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()) - .done); - _iteratorNormalCompletion4 = true - ) { - var glyph = _step4.value; - // kern - if (glyphPrev) dx += font.getKerningValue(glyphPrev, glyph); - var gi = fontInfo.getGlyphInfo(glyph); - if (gi.uGlyphRect) { - var rowInfo = gi.rowInfo; - var colInfo = gi.colInfo; - sh.setUniform( - "uSamplerStrokes", - gi.strokeImageInfo.imageData, - ); - sh.setUniform( - "uSamplerRowStrokes", - rowInfo.cellImageInfo.imageData, - ); - sh.setUniform( - "uSamplerRows", - rowInfo.dimImageInfo.imageData, - ); - sh.setUniform( - "uSamplerColStrokes", - colInfo.cellImageInfo.imageData, - ); - sh.setUniform( - "uSamplerCols", - colInfo.dimImageInfo.imageData, - ); - sh.setUniform("uGridOffset", gi.uGridOffset); - sh.setUniform("uGlyphRect", gi.uGlyphRect); - sh.setUniform("uGlyphOffset", dx); - sh.bindTextures(); // afterwards, only textures need updating - // draw it - gl.drawElements(gl.TRIANGLES, 6, this.GL.UNSIGNED_SHORT, 0); - } - dx += glyph.advanceWidth; - glyphPrev = glyph; - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if ( - !_iteratorNormalCompletion4 && - _iterator4.return != null - ) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - } finally { - // clean up - sh.unbindShader(); - this._doStroke = doStroke; - this.drawMode = drawMode; - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - p.pop(); - } - return p; - }; - }, - { - "../core/constants": 286, - "../core/main": 298, - "./p5.RendererGL.Retained": 354, - "./p5.Shader": 356, - "core-js/modules/es.array.iterator": 179, - "core-js/modules/es.object.get-own-property-descriptor": 196, - "core-js/modules/es.object.to-string": 200, - "core-js/modules/es.regexp.exec": 205, - "core-js/modules/es.string.iterator": 210, - "core-js/modules/es.string.split": 216, - "core-js/modules/es.string.sub": 218, - "core-js/modules/es.symbol": 222, - "core-js/modules/es.symbol.description": 220, - "core-js/modules/es.symbol.iterator": 221, - "core-js/modules/es.weak-map": 254, - "core-js/modules/web.dom-collections.iterator": 256, - }, - ], - 359: [ - function (_dereq_, module, exports) { - module.exports = { - fes: { - autoplay: - "The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy.\n\n+ More info: {{url}}", - checkUserDefinedFns: - "It seems that you may have accidentally written {{name}} instead of {{actualName}}. Please correct it if it's not intentional.", - fileLoadError: { - bytes: - "It looks like there was a problem loading your file. {{suggestion}}", - font: "It looks like there was a problem loading your font. {{suggestion}}", - gif: "There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.", - image: - "It looks like there was a problem loading your image. {{suggestion}}", - json: "It looks like there was a problem loading your JSON file. {{suggestion}}", - large: - "If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.", - strings: - "It looks like there was a problem loading your text file. {{suggestion}}", - suggestion: - "Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server.\n\n+ More info: {{url}}", - table: - "It looks like there was a problem loading your table file. {{suggestion}}", - xml: "It looks like there was a problem loading your XML file. {{suggestion}}", - }, - friendlyParamError: { - type_EMPTY_VAR: - "{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received an empty variable instead. If not intentional, this is often a problem with scope.\n\n+ More info: {{url}}", - type_TOO_FEW_ARGUMENTS: - "{{location}} {{func}}() was expecting at least {{minParams}} arguments, but received only {{argCount}}.", - type_TOO_MANY_ARGUMENTS: - "{{location}} {{func}}() was expecting no more than {{maxParams}} arguments, but received {{argCount}}.", - type_WRONG_TYPE: - "{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received {{argType}} instead.", - }, - globalErrors: { - reference: { - cannotAccess: - '\n{{location}} "{{symbol}}" is used before declaration. Make sure you have declared the variable before using it.\n\n+ More info: {{url}}', - notDefined: - '\n{{location}} "{{symbol}}" is not defined in the current scope. If you have defined it in your code, you should check its scope, spelling, and letter-casing (JavaScript is case-sensitive).\n\n+ More info: {{url}}', - }, - stackSubseq: - "└[{{location}}] \n\t Called from line {{line}} in {{func}}()\n", - stackTop: - "┌[{{location}}] \n\t Error at line {{line}} in {{func}}()\n", - syntax: { - badReturnOrYield: - "\nSyntax Error - return lies outside of a function. Make sure you’re not missing any brackets, so that return lies inside a function.\n\n+ More info: {{url}}", - invalidToken: - "\nSyntax Error - Found a symbol that JavaScript doesn't recognize or didn't expect at it's place.\n\n+ More info: {{url}}", - missingInitializer: - "\nSyntax Error - A const variable is declared but not initialized. In JavaScript, an initializer for a const is required. A value must be specified in the same statement in which the variable is declared. Check the line number in the error and assign the const variable a value.\n\n+ More info: {{url}}", - redeclaredVariable: - '\nSyntax Error - "{{symbol}}" is being redeclared. JavaScript doesn\'t allow declaring a variable more than once. Check the line number in error for redeclaration of the variable.\n\n+ More info: {{url}}', - unexpectedToken: - "\nSyntax Error - Symbol present at a place that wasn't expected.\nUsually this is due to a typo. Check the line number in the error for anything missing/extra.\n\n+ More info: {{url}}", - }, - type: { - constAssign: - "\n{{location}} A const variable is being re-assigned. In javascript, re-assigning a value to a constant is not allowed. If you want to re-assign new values to a variable, make sure it is declared as var or let.\n\n+ More info: {{url}}", - notfunc: - '\n{{location}} "{{symbol}}" could not be called as a function.\nCheck the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', - notfuncObj: - '\n{{location}} "{{symbol}}" could not be called as a function.\nVerify whether "{{obj}}" has "{{symbol}}" in it and check the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}', - readFromNull: - "\n{{location}} The property of null can't be read. In javascript the value null indicates that an object has no value.\n\n+ More info: {{url}}", - readFromUndefined: - "\n{{location}} Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated is not undefined.\n\n + More info: {{url}}", - }, - }, - libraryError: - '{{location}} An error with message "{{error}}" occurred inside the p5js library when {{func}} was called. If not stated otherwise, it might be an issue with the arguments passed to {{func}}.', - location: "[{{file}}, line {{line}}]", - misspelling: - '{{location}} It seems that you may have accidentally written "{{name}}" instead of "{{actualName}}". Please correct it to {{actualName}} if you wish to use the {{type}} from p5.js.', - misspelling_plural: - '{{location}} It seems that you may have accidentally written "{{name}}".\nYou may have meant one of the following: \n{{suggestions}}', - misusedTopLevel: - "Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\n+ More info: {{url}}", - positions: { - p_1: "first", - p_10: "tenth", - p_11: "eleventh", - p_12: "twelfth", - p_2: "second", - p_3: "third", - p_4: "fourth", - p_5: "fifth", - p_6: "sixth", - p_7: "seventh", - p_8: "eighth", - p_9: "ninth", - }, - pre: "\n🌸 p5.js says: {{message}}", - sketchReaderErrors: { - reservedConst: - 'you have used a p5.js reserved variable "{{symbol}}" make sure you change the variable name to something else.\n\n+ More info: {{url}}', - reservedFunc: - 'you have used a p5.js reserved function "{{symbol}}" make sure you change the function name to something else.\n\n+ More info: {{url}}', - }, - welcome: - "Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js.", - wrongPreload: - '{{location}} An error with message "{{error}}" occurred inside the p5js library when "{{func}}" was called. If not stated otherwise, it might be due to "{{func}}" being called from preload. Nothing besides load calls (loadImage, loadJSON, loadFont, loadStrings, etc.) should be inside the preload function.', - }, - }; - }, - {}, - ], - 360: [ - function (_dereq_, module, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true, - }); - exports.languages = exports.default = void 0; - var _translation = _interopRequireDefault( - _dereq_("./en/translation"), - ); - function _interopRequireDefault(obj) { - return obj && obj.__esModule - ? obj - : { - default: obj, - }; - } // Only one language is imported above. This is intentional as other languages - // will be hosted online and then downloaded whenever needed - /** - * Here, we define a default/fallback language which we can use without internet. - * You won't have to change this when adding a new language. - * - * `translation` is the namespace we are using for our initial set of strings - */ - - var _default = { - en: { - translation: _translation.default, - }, - }; - /** - * This is a list of languages that we have added so far. - * If you have just added a new language (yay!), add its key to the list below - * (`en` is english, `es` es español). Also add its export to - * dev.js, which is another file in this folder. - */ - exports.default = _default; - var languages = ["en", "es", "ko", "zh", "hi"]; - exports.languages = languages; - }, - { - "./en/translation": 359, - }, - ], - }, - {}, - [281], - )(281); + exports.default = _default; + var languages = [ + 'en', + 'es', + 'ko', + 'zh', + 'hi' + ]; + exports.languages = languages; + }, + { + './en/translation': 359 + } + ] + }, { + }, [ + 281 + ]) (281) }); diff --git a/public/lib/p5.min.js b/public/lib/p5.min.js index 88aa40d..7b436a7 100644 --- a/public/lib/p5.min.js +++ b/public/lib/p5.min.js @@ -1,55917 +1,2 @@ /*! p5.js v1.9.0 November 28, 2023 */ -!(function (e) { - "object" == typeof exports && "undefined" != typeof module - ? (module.exports = e()) - : "function" == typeof define && define.amd - ? define([], e) - : (("undefined" != typeof window - ? window - : "undefined" != typeof global - ? global - : "undefined" != typeof self - ? self - : this - ).p5 = e()); -})(function () { - var s, t, r; - return (function o(n, s, i) { - function a(t, e) { - if (!s[t]) { - if (!n[t]) { - var r = "function" == typeof require && require; - if (!e && r) return r(t, !0); - if (l) return l(t, !0); - throw ( - (((e = new Error("Cannot find module '" + t + "'")).code = - "MODULE_NOT_FOUND"), - e) - ); - } - (r = s[t] = { exports: {} }), - n[t][0].call( - r.exports, - function (e) { - return a(n[t][1][e] || e); - }, - r, - r.exports, - o, - n, - s, - i, - ); - } - return s[t].exports; - } - for ( - var l = "function" == typeof require && require, e = 0; - e < i.length; - e++ - ) - a(i[e]); - return a; - })( - { - 1: [ - function (e, t, r) { - "use strict"; - (r.byteLength = function (e) { - var e = c(e), - t = e[0], - e = e[1]; - return (3 * (t + e)) / 4 - e; - }), - (r.toByteArray = function (e) { - var t, - r, - o = c(e), - n = o[0], - o = o[1], - s = new u( - (function (e, t) { - return (3 * (e + t)) / 4 - t; - })(n, o), - ), - i = 0, - a = 0 < o ? n - 4 : n; - for (r = 0; r < a; r += 4) - (t = - (l[e.charCodeAt(r)] << 18) | - (l[e.charCodeAt(r + 1)] << 12) | - (l[e.charCodeAt(r + 2)] << 6) | - l[e.charCodeAt(r + 3)]), - (s[i++] = (t >> 16) & 255), - (s[i++] = (t >> 8) & 255), - (s[i++] = 255 & t); - 2 === o && - ((t = - (l[e.charCodeAt(r)] << 2) | (l[e.charCodeAt(r + 1)] >> 4)), - (s[i++] = 255 & t)); - 1 === o && - ((t = - (l[e.charCodeAt(r)] << 10) | - (l[e.charCodeAt(r + 1)] << 4) | - (l[e.charCodeAt(r + 2)] >> 2)), - (s[i++] = (t >> 8) & 255), - (s[i++] = 255 & t)); - return s; - }), - (r.fromByteArray = function (e) { - for ( - var t, r = e.length, o = r % 3, n = [], s = 0, i = r - o; - s < i; - s += 16383 - ) - n.push( - (function (e, t, r) { - for (var o, n = [], s = t; s < r; s += 3) - (o = - ((e[s] << 16) & 16711680) + - ((e[s + 1] << 8) & 65280) + - (255 & e[s + 2])), - n.push( - (function (e) { - return ( - a[(e >> 18) & 63] + - a[(e >> 12) & 63] + - a[(e >> 6) & 63] + - a[63 & e] - ); - })(o), - ); - return n.join(""); - })(e, s, i < s + 16383 ? i : s + 16383), - ); - 1 == o - ? ((t = e[r - 1]), n.push(a[t >> 2] + a[(t << 4) & 63] + "==")) - : 2 == o && - ((t = (e[r - 2] << 8) + e[r - 1]), - n.push( - a[t >> 10] + a[(t >> 4) & 63] + a[(t << 2) & 63] + "=", - )); - return n.join(""); - }); - for ( - var a = [], - l = [], - u = "undefined" != typeof Uint8Array ? Uint8Array : Array, - o = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", - n = 0, - s = o.length; - n < s; - ++n - ) - (a[n] = o[n]), (l[o.charCodeAt(n)] = n); - function c(e) { - var t = e.length; - if (0 < t % 4) - throw new Error("Invalid string. Length must be a multiple of 4"); - (e = e.indexOf("=")), - (t = (e = -1 === e ? t : e) === t ? 0 : 4 - (e % 4)); - return [e, t]; - } - (l["-".charCodeAt(0)] = 62), (l["_".charCodeAt(0)] = 63); - }, - {}, - ], - 2: [function (e, t, r) {}, {}], - 3: [function (e, t, r) {}, {}], - 4: [ - function (A, e, L) { - !function (d) { - "use strict"; - var S = A("base64-js"), - s = A("ieee754"), - e = - "function" == typeof Symbol && "function" == typeof Symbol.for - ? Symbol.for("nodejs.util.inspect.custom") - : null, - t = - ((L.Buffer = d), - (L.SlowBuffer = function (e) { - +e != e && (e = 0); - return d.alloc(+e); - }), - (L.INSPECT_MAX_BYTES = 50), - 2147483647); - function l(e) { - if (t < e) - throw new RangeError( - 'The value "' + e + '" is invalid for option "size"', - ); - e = new Uint8Array(e); - return Object.setPrototypeOf(e, d.prototype), e; - } - function d(e, t, r) { - if ("number" != typeof e) return o(e, t, r); - if ("string" == typeof t) - throw new TypeError( - 'The "string" argument must be of type string. Received type number', - ); - return i(e); - } - function o(e, t, r) { - if ("string" == typeof e) { - var o = e, - n = t; - if ( - d.isEncoding( - (n = "string" == typeof n && "" !== n ? n : "utf8"), - ) - ) - return ( - (s = 0 | h(o, n)), - (i = l(s)), - (i = (o = i.write(o, n)) !== s ? i.slice(0, o) : i) - ); - throw new TypeError("Unknown encoding: " + n); - } - if (ArrayBuffer.isView(e)) return u(e); - if (null != e) { - if (C(e, ArrayBuffer) || (e && C(e.buffer, ArrayBuffer))) { - var s = e, - o = t, - i = r; - if (o < 0 || s.byteLength < o) - throw new RangeError( - '"offset" is outside of buffer bounds', - ); - if (s.byteLength < o + (i || 0)) - throw new RangeError( - '"length" is outside of buffer bounds', - ); - return ( - (s = - void 0 === o && void 0 === i - ? new Uint8Array(s) - : void 0 === i - ? new Uint8Array(s, o) - : new Uint8Array(s, o, i)), - Object.setPrototypeOf(s, d.prototype), - s - ); - } - if ("number" == typeof e) - throw new TypeError( - 'The "value" argument must not be of type number. Received type number', - ); - n = e.valueOf && e.valueOf(); - if (null != n && n !== e) return d.from(n, t, r); - var a = (function (e) { - { - var t, r; - if (d.isBuffer(e)) - return ( - (t = 0 | c(e.length)), - 0 !== (r = l(t)).length && e.copy(r, 0, 0, t), - r - ); - } - if (void 0 !== e.length) - return "number" != typeof e.length || O(e.length) - ? l(0) - : u(e); - if ("Buffer" === e.type && Array.isArray(e.data)) - return u(e.data); - })(e); - if (a) return a; - if ( - "undefined" != typeof Symbol && - null != Symbol.toPrimitive && - "function" == typeof e[Symbol.toPrimitive] - ) - return d.from(e[Symbol.toPrimitive]("string"), t, r); - } - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + - typeof e, - ); - } - function n(e) { - if ("number" != typeof e) - throw new TypeError('"size" argument must be of type number'); - if (e < 0) - throw new RangeError( - 'The value "' + e + '" is invalid for option "size"', - ); - } - function i(e) { - return n(e), l(e < 0 ? 0 : 0 | c(e)); - } - function u(e) { - for ( - var t = e.length < 0 ? 0 : 0 | c(e.length), r = l(t), o = 0; - o < t; - o += 1 - ) - r[o] = 255 & e[o]; - return r; - } - function c(e) { - if (t <= e) - throw new RangeError( - "Attempt to allocate Buffer larger than maximum size: 0x" + - t.toString(16) + - " bytes", - ); - return 0 | e; - } - function h(e, t) { - if (d.isBuffer(e)) return e.length; - if (ArrayBuffer.isView(e) || C(e, ArrayBuffer)) - return e.byteLength; - if ("string" != typeof e) - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + - typeof e, - ); - var r = e.length, - o = 2 < arguments.length && !0 === arguments[2]; - if (!o && 0 === r) return 0; - for (var n = !1; ; ) - switch (t) { - case "ascii": - case "latin1": - case "binary": - return r; - case "utf8": - case "utf-8": - return M(e).length; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return 2 * r; - case "hex": - return r >>> 1; - case "base64": - return E(e).length; - default: - if (n) return o ? -1 : M(e).length; - (t = ("" + t).toLowerCase()), (n = !0); - } - } - function r(e, t, r) { - var o, - n = !1; - if ((t = void 0 === t || t < 0 ? 0 : t) > this.length) return ""; - if ((r = void 0 === r || r > this.length ? this.length : r) <= 0) - return ""; - if ((r >>>= 0) <= (t >>>= 0)) return ""; - for (e = e || "utf8"; ; ) - switch (e) { - case "hex": - var s = this, - i = t, - a = r, - l = s.length; - (!a || a < 0 || l < a) && (a = l); - for (var u = "", c = (i = !i || i < 0 ? 0 : i); c < a; ++c) - u += P[s[c]]; - return u; - case "utf8": - case "utf-8": - return T(this, t, r); - case "ascii": - var d = this, - l = t, - h = r, - f = ""; - h = Math.min(d.length, h); - for (var p = l; p < h; ++p) - f += String.fromCharCode(127 & d[p]); - return f; - case "latin1": - case "binary": - var m = this, - i = t, - y = r, - g = ""; - y = Math.min(m.length, y); - for (var v = i; v < y; ++v) g += String.fromCharCode(m[v]); - return g; - case "base64": - return ( - (b = this), - (o = r), - 0 === (j = t) && o === b.length - ? S.fromByteArray(b) - : S.fromByteArray(b.slice(j, o)) - ); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - for ( - var b = t, j = r, _ = this.slice(b, j), x = "", w = 0; - w < _.length; - w += 2 - ) - x += String.fromCharCode(_[w] + 256 * _[w + 1]); - return x; - default: - if (n) throw new TypeError("Unknown encoding: " + e); - (e = (e + "").toLowerCase()), (n = !0); - } - } - function a(e, t, r) { - var o = e[t]; - (e[t] = e[r]), (e[r] = o); - } - function f(e, t, r, o, n) { - if (0 === e.length) return -1; - if ( - ("string" == typeof r - ? ((o = r), (r = 0)) - : 2147483647 < r - ? (r = 2147483647) - : r < -2147483648 && (r = -2147483648), - (r = - (r = O((r = +r)) ? (n ? 0 : e.length - 1) : r) < 0 - ? e.length + r - : r) >= e.length) - ) { - if (n) return -1; - r = e.length - 1; - } else if (r < 0) { - if (!n) return -1; - r = 0; - } - if (("string" == typeof t && (t = d.from(t, o)), d.isBuffer(t))) - return 0 === t.length ? -1 : p(e, t, r, o, n); - if ("number" == typeof t) - return ( - (t &= 255), - "function" == typeof Uint8Array.prototype.indexOf - ? (n - ? Uint8Array.prototype.indexOf - : Uint8Array.prototype.lastIndexOf - ).call(e, t, r) - : p(e, [t], r, o, n) - ); - throw new TypeError("val must be string, number or Buffer"); - } - function p(e, t, r, o, n) { - var s = 1, - i = e.length, - a = t.length; - if ( - void 0 !== o && - ("ucs2" === (o = String(o).toLowerCase()) || - "ucs-2" === o || - "utf16le" === o || - "utf-16le" === o) - ) { - if (e.length < 2 || t.length < 2) return -1; - (i /= s = 2), (a /= 2), (r /= 2); - } - function l(e, t) { - return 1 === s ? e[t] : e.readUInt16BE(t * s); - } - if (n) - for (var u = -1, c = r; c < i; c++) - if (l(e, c) === l(t, -1 === u ? 0 : c - u)) { - if (c - (u = -1 === u ? c : u) + 1 === a) return u * s; - } else -1 !== u && (c -= c - u), (u = -1); - else - for (c = r = i < r + a ? i - a : r; 0 <= c; c--) { - for (var d = !0, h = 0; h < a; h++) - if (l(e, c + h) !== l(t, h)) { - d = !1; - break; - } - if (d) return c; - } - return -1; - } - function y(e, t, r, o) { - return k( - (function (e) { - for (var t = [], r = 0; r < e.length; ++r) - t.push(255 & e.charCodeAt(r)); - return t; - })(t), - e, - r, - o, - ); - } - function g(e, t, r, o) { - return k( - (function (e, t) { - for ( - var r, o, n = [], s = 0; - s < e.length && !((t -= 2) < 0); - ++s - ) - (o = e.charCodeAt(s)), - (r = o >> 8), - (o = o % 256), - n.push(o), - n.push(r); - return n; - })(t, e.length - r), - e, - r, - o, - ); - } - function T(e, t, r) { - r = Math.min(e.length, r); - for (var o = [], n = t; n < r; ) { - var s, - i, - a, - l, - u = e[n], - c = null, - d = 239 < u ? 4 : 223 < u ? 3 : 191 < u ? 2 : 1; - if (n + d <= r) - switch (d) { - case 1: - u < 128 && (c = u); - break; - case 2: - 128 == (192 & (s = e[n + 1])) && - 127 < (l = ((31 & u) << 6) | (63 & s)) && - (c = l); - break; - case 3: - (s = e[n + 1]), - (i = e[n + 2]), - 128 == (192 & s) && - 128 == (192 & i) && - 2047 < - (l = - ((15 & u) << 12) | ((63 & s) << 6) | (63 & i)) && - (l < 55296 || 57343 < l) && - (c = l); - break; - case 4: - (s = e[n + 1]), - (i = e[n + 2]), - (a = e[n + 3]), - 128 == (192 & s) && - 128 == (192 & i) && - 128 == (192 & a) && - 65535 < - (l = - ((15 & u) << 18) | - ((63 & s) << 12) | - ((63 & i) << 6) | - (63 & a)) && - l < 1114112 && - (c = l); - } - null === c - ? ((c = 65533), (d = 1)) - : 65535 < c && - ((c -= 65536), - o.push(((c >>> 10) & 1023) | 55296), - (c = 56320 | (1023 & c))), - o.push(c), - (n += d); - } - var h = o, - f = h.length; - if (f <= v) return String.fromCharCode.apply(String, h); - for (var p = "", m = 0; m < f; ) - p += String.fromCharCode.apply(String, h.slice(m, (m += v))); - return p; - } - (L.kMaxLength = t), - (d.TYPED_ARRAY_SUPPORT = (function () { - try { - var e = new Uint8Array(1), - t = { - foo: function () { - return 42; - }, - }; - return ( - Object.setPrototypeOf(t, Uint8Array.prototype), - Object.setPrototypeOf(e, t), - 42 === e.foo() - ); - } catch (e) { - return !1; - } - })()) || - "undefined" == typeof console || - "function" != typeof console.error || - console.error( - "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.", - ), - Object.defineProperty(d.prototype, "parent", { - enumerable: !0, - get: function () { - if (d.isBuffer(this)) return this.buffer; - }, - }), - Object.defineProperty(d.prototype, "offset", { - enumerable: !0, - get: function () { - if (d.isBuffer(this)) return this.byteOffset; - }, - }), - "undefined" != typeof Symbol && - null != Symbol.species && - d[Symbol.species] === d && - Object.defineProperty(d, Symbol.species, { - value: null, - configurable: !0, - enumerable: !1, - writable: !1, - }), - (d.poolSize = 8192), - (d.from = o), - Object.setPrototypeOf(d.prototype, Uint8Array.prototype), - Object.setPrototypeOf(d, Uint8Array), - (d.alloc = function (e, t, r) { - return ( - (t = t), - (r = r), - n((e = e)), - !(e <= 0) && void 0 !== t - ? "string" == typeof r - ? l(e).fill(t, r) - : l(e).fill(t) - : l(e) - ); - }), - (d.allocUnsafe = i), - (d.allocUnsafeSlow = i), - (d.isBuffer = function (e) { - return null != e && !0 === e._isBuffer && e !== d.prototype; - }), - (d.compare = function (e, t) { - if ( - (C(e, Uint8Array) && (e = d.from(e, e.offset, e.byteLength)), - C(t, Uint8Array) && (t = d.from(t, t.offset, t.byteLength)), - !d.isBuffer(e) || !d.isBuffer(t)) - ) - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array', - ); - if (e === t) return 0; - for ( - var r = e.length, o = t.length, n = 0, s = Math.min(r, o); - n < s; - ++n - ) - if (e[n] !== t[n]) { - (r = e[n]), (o = t[n]); - break; - } - return r < o ? -1 : o < r ? 1 : 0; - }), - (d.isEncoding = function (e) { - switch (String(e).toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "latin1": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return !0; - default: - return !1; - } - }), - (d.concat = function (e, t) { - if (!Array.isArray(e)) - throw new TypeError( - '"list" argument must be an Array of Buffers', - ); - if (0 === e.length) return d.alloc(0); - if (void 0 === t) - for (n = t = 0; n < e.length; ++n) t += e[n].length; - for ( - var r = d.allocUnsafe(t), o = 0, n = 0; - n < e.length; - ++n - ) { - var s = e[n]; - if ((C(s, Uint8Array) && (s = d.from(s)), !d.isBuffer(s))) - throw new TypeError( - '"list" argument must be an Array of Buffers', - ); - s.copy(r, o), (o += s.length); - } - return r; - }), - (d.byteLength = h), - (d.prototype._isBuffer = !0), - (d.prototype.swap16 = function () { - var e = this.length; - if (e % 2 != 0) - throw new RangeError( - "Buffer size must be a multiple of 16-bits", - ); - for (var t = 0; t < e; t += 2) a(this, t, t + 1); - return this; - }), - (d.prototype.swap32 = function () { - var e = this.length; - if (e % 4 != 0) - throw new RangeError( - "Buffer size must be a multiple of 32-bits", - ); - for (var t = 0; t < e; t += 4) - a(this, t, t + 3), a(this, t + 1, t + 2); - return this; - }), - (d.prototype.swap64 = function () { - var e = this.length; - if (e % 8 != 0) - throw new RangeError( - "Buffer size must be a multiple of 64-bits", - ); - for (var t = 0; t < e; t += 8) - a(this, t, t + 7), - a(this, t + 1, t + 6), - a(this, t + 2, t + 5), - a(this, t + 3, t + 4); - return this; - }), - (d.prototype.toLocaleString = d.prototype.toString = - function () { - var e = this.length; - return 0 === e - ? "" - : 0 === arguments.length - ? T(this, 0, e) - : r.apply(this, arguments); - }), - (d.prototype.equals = function (e) { - if (d.isBuffer(e)) - return this === e || 0 === d.compare(this, e); - throw new TypeError("Argument must be a Buffer"); - }), - (d.prototype.inspect = function () { - var e = "", - t = L.INSPECT_MAX_BYTES, - e = this.toString("hex", 0, t) - .replace(/(.{2})/g, "$1 ") - .trim(); - return this.length > t && (e += " ... "), ""; - }), - e && (d.prototype[e] = d.prototype.inspect), - (d.prototype.compare = function (e, t, r, o, n) { - if ( - (C(e, Uint8Array) && (e = d.from(e, e.offset, e.byteLength)), - !d.isBuffer(e)) - ) - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + - typeof e, - ); - if ( - (void 0 === r && (r = e ? e.length : 0), - void 0 === o && (o = 0), - void 0 === n && (n = this.length), - (t = void 0 === t ? 0 : t) < 0 || - r > e.length || - o < 0 || - n > this.length) - ) - throw new RangeError("out of range index"); - if (n <= o && r <= t) return 0; - if (n <= o) return -1; - if (r <= t) return 1; - if (this === e) return 0; - for ( - var s = (n >>>= 0) - (o >>>= 0), - i = (r >>>= 0) - (t >>>= 0), - a = Math.min(s, i), - l = this.slice(o, n), - u = e.slice(t, r), - c = 0; - c < a; - ++c - ) - if (l[c] !== u[c]) { - (s = l[c]), (i = u[c]); - break; - } - return s < i ? -1 : i < s ? 1 : 0; - }), - (d.prototype.includes = function (e, t, r) { - return -1 !== this.indexOf(e, t, r); - }), - (d.prototype.indexOf = function (e, t, r) { - return f(this, e, t, r, !0); - }), - (d.prototype.lastIndexOf = function (e, t, r) { - return f(this, e, t, r, !1); - }), - (d.prototype.write = function (e, t, r, o) { - if (void 0 === t) (o = "utf8"), (r = this.length), (t = 0); - else if (void 0 === r && "string" == typeof t) - (o = t), (r = this.length), (t = 0); - else { - if (!isFinite(t)) - throw new Error( - "Buffer.write(string, encoding, offset[, length]) is no longer supported", - ); - (t >>>= 0), - isFinite(r) - ? ((r >>>= 0), void 0 === o && (o = "utf8")) - : ((o = r), (r = void 0)); - } - var n = this.length - t; - if ( - ((void 0 === r || n < r) && (r = n), - (0 < e.length && (r < 0 || t < 0)) || t > this.length) - ) - throw new RangeError( - "Attempt to write outside buffer bounds", - ); - o = o || "utf8"; - for (var s, i, a, l = !1; ; ) - switch (o) { - case "hex": - var u = this, - c = e, - d = t, - h = r, - f = ((d = Number(d) || 0), u.length - d); - (!h || f < (h = Number(h))) && (h = f), - (f = c.length) / 2 < h && (h = f / 2); - for (var p = 0; p < h; ++p) { - var m = parseInt(c.substr(2 * p, 2), 16); - if (O(m)) return p; - u[d + p] = m; - } - return p; - case "utf8": - case "utf-8": - return ( - (f = t), - (a = r), - k(M(e, (i = this).length - f), i, f, a) - ); - case "ascii": - return y(this, e, t, r); - case "latin1": - case "binary": - return y(this, e, t, r); - case "base64": - return (i = this), (a = t), (s = r), k(E(e), i, a, s); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return g(this, e, t, r); - default: - if (l) throw new TypeError("Unknown encoding: " + o); - (o = ("" + o).toLowerCase()), (l = !0); - } - }), - (d.prototype.toJSON = function () { - return { - type: "Buffer", - data: Array.prototype.slice.call(this._arr || this, 0), - }; - }); - var v = 4096; - function m(e, t, r) { - if (e % 1 != 0 || e < 0) - throw new RangeError("offset is not uint"); - if (r < e + t) - throw new RangeError("Trying to access beyond buffer length"); - } - function b(e, t, r, o, n, s) { - if (!d.isBuffer(e)) - throw new TypeError( - '"buffer" argument must be a Buffer instance', - ); - if (n < t || t < s) - throw new RangeError('"value" argument is out of bounds'); - if (r + o > e.length) throw new RangeError("Index out of range"); - } - function j(e, t, r, o) { - if (r + o > e.length) throw new RangeError("Index out of range"); - if (r < 0) throw new RangeError("Index out of range"); - } - function _(e, t, r, o, n) { - return ( - (t = +t), - (r >>>= 0), - n || j(e, 0, r, 4), - s.write(e, t, r, o, 23, 4), - r + 4 - ); - } - function x(e, t, r, o, n) { - return ( - (t = +t), - (r >>>= 0), - n || j(e, 0, r, 8), - s.write(e, t, r, o, 52, 8), - r + 8 - ); - } - (d.prototype.slice = function (e, t) { - var r = this.length, - r = - ((e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : r < e && (e = r), - (t = void 0 === t ? r : ~~t) < 0 - ? (t += r) < 0 && (t = 0) - : r < t && (t = r), - t < e && (t = e), - this.subarray(e, t)); - return Object.setPrototypeOf(r, d.prototype), r; - }), - (d.prototype.readUIntLE = function (e, t, r) { - (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); - for (var o = this[e], n = 1, s = 0; ++s < t && (n *= 256); ) - o += this[e + s] * n; - return o; - }), - (d.prototype.readUIntBE = function (e, t, r) { - (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); - for (var o = this[e + --t], n = 1; 0 < t && (n *= 256); ) - o += this[e + --t] * n; - return o; - }), - (d.prototype.readUInt8 = function (e, t) { - return (e >>>= 0), t || m(e, 1, this.length), this[e]; - }), - (d.prototype.readUInt16LE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 2, this.length), - this[e] | (this[e + 1] << 8) - ); - }), - (d.prototype.readUInt16BE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 2, this.length), - (this[e] << 8) | this[e + 1] - ); - }), - (d.prototype.readUInt32LE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 4, this.length), - (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + - 16777216 * this[e + 3] - ); - }), - (d.prototype.readUInt32BE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 4, this.length), - 16777216 * this[e] + - ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]) - ); - }), - (d.prototype.readIntLE = function (e, t, r) { - (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); - for (var o = this[e], n = 1, s = 0; ++s < t && (n *= 256); ) - o += this[e + s] * n; - return (n *= 128) <= o && (o -= Math.pow(2, 8 * t)), o; - }), - (d.prototype.readIntBE = function (e, t, r) { - (e >>>= 0), (t >>>= 0), r || m(e, t, this.length); - for (var o = t, n = 1, s = this[e + --o]; 0 < o && (n *= 256); ) - s += this[e + --o] * n; - return (n *= 128) <= s && (s -= Math.pow(2, 8 * t)), s; - }), - (d.prototype.readInt8 = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 1, this.length), - 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e] - ); - }), - (d.prototype.readInt16LE = function (e, t) { - (e >>>= 0), t || m(e, 2, this.length); - t = this[e] | (this[e + 1] << 8); - return 32768 & t ? 4294901760 | t : t; - }), - (d.prototype.readInt16BE = function (e, t) { - (e >>>= 0), t || m(e, 2, this.length); - t = this[e + 1] | (this[e] << 8); - return 32768 & t ? 4294901760 | t : t; - }), - (d.prototype.readInt32LE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 4, this.length), - this[e] | - (this[e + 1] << 8) | - (this[e + 2] << 16) | - (this[e + 3] << 24) - ); - }), - (d.prototype.readInt32BE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 4, this.length), - (this[e] << 24) | - (this[e + 1] << 16) | - (this[e + 2] << 8) | - this[e + 3] - ); - }), - (d.prototype.readFloatLE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 4, this.length), - s.read(this, e, !0, 23, 4) - ); - }), - (d.prototype.readFloatBE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 4, this.length), - s.read(this, e, !1, 23, 4) - ); - }), - (d.prototype.readDoubleLE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 8, this.length), - s.read(this, e, !0, 52, 8) - ); - }), - (d.prototype.readDoubleBE = function (e, t) { - return ( - (e >>>= 0), - t || m(e, 8, this.length), - s.read(this, e, !1, 52, 8) - ); - }), - (d.prototype.writeUIntLE = function (e, t, r, o) { - (e = +e), - (t >>>= 0), - (r >>>= 0), - o || b(this, e, t, r, Math.pow(2, 8 * r) - 1, 0); - var n = 1, - s = 0; - for (this[t] = 255 & e; ++s < r && (n *= 256); ) - this[t + s] = (e / n) & 255; - return t + r; - }), - (d.prototype.writeUIntBE = function (e, t, r, o) { - (e = +e), - (t >>>= 0), - (r >>>= 0), - o || b(this, e, t, r, Math.pow(2, 8 * r) - 1, 0); - var n = r - 1, - s = 1; - for (this[t + n] = 255 & e; 0 <= --n && (s *= 256); ) - this[t + n] = (e / s) & 255; - return t + r; - }), - (d.prototype.writeUInt8 = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 1, 255, 0), - (this[t] = 255 & e), - t + 1 - ); - }), - (d.prototype.writeUInt16LE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 2, 65535, 0), - (this[t] = 255 & e), - (this[t + 1] = e >>> 8), - t + 2 - ); - }), - (d.prototype.writeUInt16BE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 2, 65535, 0), - (this[t] = e >>> 8), - (this[t + 1] = 255 & e), - t + 2 - ); - }), - (d.prototype.writeUInt32LE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(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 - ); - }), - (d.prototype.writeUInt32BE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(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 - ); - }), - (d.prototype.writeIntLE = function (e, t, r, o) { - (e = +e), - (t >>>= 0), - o || b(this, e, t, r, (o = Math.pow(2, 8 * r - 1)) - 1, -o); - var n = 0, - s = 1, - i = 0; - for (this[t] = 255 & e; ++n < r && (s *= 256); ) - e < 0 && 0 === i && 0 !== this[t + n - 1] && (i = 1), - (this[t + n] = (((e / s) >> 0) - i) & 255); - return t + r; - }), - (d.prototype.writeIntBE = function (e, t, r, o) { - (e = +e), - (t >>>= 0), - o || b(this, e, t, r, (o = Math.pow(2, 8 * r - 1)) - 1, -o); - var n = r - 1, - s = 1, - i = 0; - for (this[t + n] = 255 & e; 0 <= --n && (s *= 256); ) - e < 0 && 0 === i && 0 !== this[t + n + 1] && (i = 1), - (this[t + n] = (((e / s) >> 0) - i) & 255); - return t + r; - }), - (d.prototype.writeInt8 = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 1, 127, -128), - (this[t] = 255 & (e = e < 0 ? 255 + e + 1 : e)), - t + 1 - ); - }), - (d.prototype.writeInt16LE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 2, 32767, -32768), - (this[t] = 255 & e), - (this[t + 1] = e >>> 8), - t + 2 - ); - }), - (d.prototype.writeInt16BE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 2, 32767, -32768), - (this[t] = e >>> 8), - (this[t + 1] = 255 & e), - t + 2 - ); - }), - (d.prototype.writeInt32LE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(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 - ); - }), - (d.prototype.writeInt32BE = function (e, t, r) { - return ( - (e = +e), - (t >>>= 0), - r || b(this, e, t, 4, 2147483647, -2147483648), - (this[t] = (e = e < 0 ? 4294967295 + e + 1 : e) >>> 24), - (this[t + 1] = e >>> 16), - (this[t + 2] = e >>> 8), - (this[t + 3] = 255 & e), - t + 4 - ); - }), - (d.prototype.writeFloatLE = function (e, t, r) { - return _(this, e, t, !0, r); - }), - (d.prototype.writeFloatBE = function (e, t, r) { - return _(this, e, t, !1, r); - }), - (d.prototype.writeDoubleLE = function (e, t, r) { - return x(this, e, t, !0, r); - }), - (d.prototype.writeDoubleBE = function (e, t, r) { - return x(this, e, t, !1, r); - }), - (d.prototype.copy = function (e, t, r, o) { - if (!d.isBuffer(e)) - throw new TypeError("argument should be a Buffer"); - if ( - ((r = r || 0), - o || 0 === o || (o = this.length), - t >= e.length && (t = e.length), - (o = 0 < o && o < r ? r : o) === r) - ) - return 0; - if (0 === e.length || 0 === this.length) return 0; - if ((t = t || 0) < 0) - throw new RangeError("targetStart out of bounds"); - if (r < 0 || r >= this.length) - throw new RangeError("Index out of range"); - if (o < 0) throw new RangeError("sourceEnd out of bounds"); - o > this.length && (o = this.length); - var n = (o = e.length - t < o - r ? e.length - t + r : o) - r; - if ( - this === e && - "function" == typeof Uint8Array.prototype.copyWithin - ) - this.copyWithin(t, r, o); - else if (this === e && r < t && t < o) - for (var s = n - 1; 0 <= s; --s) e[s + t] = this[s + r]; - else Uint8Array.prototype.set.call(e, this.subarray(r, o), t); - return n; - }), - (d.prototype.fill = function (e, t, r, o) { - if ("string" == typeof e) { - if ( - ("string" == typeof t - ? ((o = t), (t = 0), (r = this.length)) - : "string" == typeof r && ((o = r), (r = this.length)), - void 0 !== o && "string" != typeof o) - ) - throw new TypeError("encoding must be a string"); - if ("string" == typeof o && !d.isEncoding(o)) - throw new TypeError("Unknown encoding: " + o); - var n; - 1 === e.length && - ((n = e.charCodeAt(0)), - (("utf8" === o && n < 128) || "latin1" === o) && (e = n)); - } else - "number" == typeof e - ? (e &= 255) - : "boolean" == typeof e && (e = Number(e)); - if (t < 0 || this.length < t || this.length < r) - throw new RangeError("Out of range index"); - var s; - if (!(r <= t)) - if ( - ((t >>>= 0), - (r = void 0 === r ? this.length : r >>> 0), - "number" == typeof (e = e || 0)) - ) - for (s = t; s < r; ++s) this[s] = e; - else { - var i = d.isBuffer(e) ? e : d.from(e, o), - a = i.length; - if (0 === a) - throw new TypeError( - 'The value "' + e + '" is invalid for argument "value"', - ); - for (s = 0; s < r - t; ++s) this[s + t] = i[s % a]; - } - return this; - }); - var w = /[^+/0-9A-Za-z-_]/g; - function M(e, t) { - t = t || 1 / 0; - for (var r, o = e.length, n = null, s = [], i = 0; i < o; ++i) { - if (55295 < (r = e.charCodeAt(i)) && r < 57344) { - if (!n) { - if (56319 < r) { - -1 < (t -= 3) && s.push(239, 191, 189); - continue; - } - if (i + 1 === o) { - -1 < (t -= 3) && s.push(239, 191, 189); - continue; - } - n = r; - continue; - } - if (r < 56320) { - -1 < (t -= 3) && s.push(239, 191, 189), (n = r); - continue; - } - r = 65536 + (((n - 55296) << 10) | (r - 56320)); - } else n && -1 < (t -= 3) && s.push(239, 191, 189); - if (((n = null), r < 128)) { - if (--t < 0) break; - s.push(r); - } else if (r < 2048) { - if ((t -= 2) < 0) break; - s.push((r >> 6) | 192, (63 & r) | 128); - } else if (r < 65536) { - if ((t -= 3) < 0) break; - s.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; - s.push( - (r >> 18) | 240, - ((r >> 12) & 63) | 128, - ((r >> 6) & 63) | 128, - (63 & r) | 128, - ); - } - } - return s; - } - function E(e) { - return S.toByteArray( - (function (e) { - if ( - (e = (e = e.split("=")[0]).trim().replace(w, "")).length < 2 - ) - return ""; - for (; e.length % 4 != 0; ) e += "="; - return e; - })(e), - ); - } - function k(e, t, r, o) { - for ( - var n = 0; - n < o && !(n + r >= t.length || n >= e.length); - ++n - ) - t[n + r] = e[n]; - return n; - } - function C(e, t) { - return ( - e instanceof t || - (null != e && - null != e.constructor && - null != e.constructor.name && - e.constructor.name === t.name) - ); - } - function O(e) { - return e != e; - } - var P = (function () { - for ( - var e = "0123456789abcdef", t = new Array(256), r = 0; - r < 16; - ++r - ) - for (var o = 16 * r, n = 0; n < 16; ++n) t[o + n] = e[r] + e[n]; - return t; - })(); - }.call(this, A("buffer").Buffer); - }, - { "base64-js": 1, buffer: 4, ieee754: 246 }, - ], - 5: [ - function (e, t, r) { - t.exports = function (e) { - if ("function" != typeof e) - throw TypeError(String(e) + " is not a function"); - return e; - }; - }, - {}, - ], - 6: [ - function (e, t, r) { - var o = e("../internals/is-object"); - t.exports = function (e) { - if (o(e) || null === e) return e; - throw TypeError("Can't set " + String(e) + " as a prototype"); - }; - }, - { "../internals/is-object": 74 }, - ], - 7: [ - function (e, t, r) { - var o = e("../internals/well-known-symbol"), - n = e("../internals/object-create"), - e = e("../internals/object-define-property"), - s = o("unscopables"), - i = Array.prototype; - null == i[s] && e.f(i, s, { configurable: !0, value: n(null) }), - (t.exports = function (e) { - i[s][e] = !0; - }); - }, - { - "../internals/object-create": 90, - "../internals/object-define-property": 92, - "../internals/well-known-symbol": 148, - }, - ], - 8: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/string-multibyte").charAt; - t.exports = function (e, t, r) { - return t + (r ? o(e, t).length : 1); - }; - }, - { "../internals/string-multibyte": 123 }, - ], - 9: [ - function (e, t, r) { - t.exports = function (e, t, r) { - if (e instanceof t) return e; - throw TypeError("Incorrect " + (r ? r + " " : "") + "invocation"); - }; - }, - {}, - ], - 10: [ - function (e, t, r) { - var o = e("../internals/is-object"); - t.exports = function (e) { - if (o(e)) return e; - throw TypeError(String(e) + " is not an object"); - }; - }, - { "../internals/is-object": 74 }, - ], - 11: [ - function (e, t, r) { - t.exports = - "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView; - }, - {}, - ], - 12: [ - function (e, t, r) { - "use strict"; - function o(e) { - return l(e) && u(M, c(e)); - } - var n, - s = e("../internals/array-buffer-native"), - i = e("../internals/descriptors"), - a = e("../internals/global"), - l = e("../internals/is-object"), - u = e("../internals/has"), - c = e("../internals/classof"), - d = e("../internals/create-non-enumerable-property"), - h = e("../internals/redefine"), - f = e("../internals/object-define-property").f, - p = e("../internals/object-get-prototype-of"), - m = e("../internals/object-set-prototype-of"), - y = e("../internals/well-known-symbol"), - e = e("../internals/uid"), - g = a.Int8Array, - v = g && g.prototype, - b = a.Uint8ClampedArray, - b = b && b.prototype, - j = g && p(g), - _ = v && p(v), - x = Object.prototype, - w = x.isPrototypeOf, - y = y("toStringTag"), - S = e("TYPED_ARRAY_TAG"), - T = s && !!m && "Opera" !== c(a.opera), - e = !1, - M = { - Int8Array: 1, - Uint8Array: 1, - Uint8ClampedArray: 1, - Int16Array: 2, - Uint16Array: 2, - Int32Array: 4, - Uint32Array: 4, - Float32Array: 4, - Float64Array: 8, - }; - for (n in M) a[n] || (T = !1); - if ( - (!T || "function" != typeof j || j === Function.prototype) && - ((j = function () { - throw TypeError("Incorrect invocation"); - }), - T) - ) - for (n in M) a[n] && m(a[n], j); - if ((!T || !_ || _ === x) && ((_ = j.prototype), T)) - for (n in M) a[n] && m(a[n].prototype, _); - if ((T && p(b) !== _ && m(b, _), i && !u(_, y))) - for (n in ((e = !0), - f(_, y, { - get: function () { - return l(this) ? this[S] : void 0; - }, - }), - M)) - a[n] && d(a[n], S, n); - t.exports = { - NATIVE_ARRAY_BUFFER_VIEWS: T, - TYPED_ARRAY_TAG: e && S, - aTypedArray: function (e) { - if (o(e)) return e; - throw TypeError("Target is not a typed array"); - }, - aTypedArrayConstructor: function (e) { - if (m) { - if (w.call(j, e)) return e; - } else - for (var t in M) - if (u(M, n)) { - t = a[t]; - if (t && (e === t || w.call(t, e))) return e; - } - throw TypeError("Target is not a typed array constructor"); - }, - exportTypedArrayMethod: function (e, t, r) { - if (i) { - if (r) - for (var o in M) { - o = a[o]; - o && u(o.prototype, e) && delete o.prototype[e]; - } - (_[e] && !r) || h(_, e, (!r && T && v[e]) || t); - } - }, - exportTypedArrayStaticMethod: function (e, t, r) { - var o, n; - if (i) { - if (m) { - if (r) for (o in M) (n = a[o]) && u(n, e) && delete n[e]; - if (j[e] && !r) return; - try { - return h(j, e, (!r && T && g[e]) || t); - } catch (e) {} - } - for (o in M) !(n = a[o]) || (n[e] && !r) || h(n, e, t); - } - }, - isView: function (e) { - e = c(e); - return "DataView" === e || u(M, e); - }, - isTypedArray: o, - TypedArray: j, - TypedArrayPrototype: _, - }; - }, - { - "../internals/array-buffer-native": 11, - "../internals/classof": 29, - "../internals/create-non-enumerable-property": 38, - "../internals/descriptors": 43, - "../internals/global": 59, - "../internals/has": 60, - "../internals/is-object": 74, - "../internals/object-define-property": 92, - "../internals/object-get-prototype-of": 97, - "../internals/object-set-prototype-of": 101, - "../internals/redefine": 108, - "../internals/uid": 145, - "../internals/well-known-symbol": 148, - }, - ], - 13: [ - function (e, t, D) { - "use strict"; - function r(e) { - return [255 & e]; - } - function o(e) { - return [255 & e, (e >> 8) & 255]; - } - function n(e) { - return [255 & e, (e >> 8) & 255, (e >> 16) & 255, (e >> 24) & 255]; - } - function s(e) { - return (e[3] << 24) | (e[2] << 16) | (e[1] << 8) | e[0]; - } - function i(e) { - return O(e, 23, 4); - } - function F(e) { - return O(e, 52, 8); - } - function a(e, t) { - H(e[w], t, { - get: function () { - return b(this)[t]; - }, - }); - } - function l(e, t, r, o) { - if (((r = m(r)), (e = b(e)), r + t > e.byteLength)) throw C(S); - var n = b(e.buffer).bytes, - r = r + e.byteOffset, - e = n.slice(r, r + t); - return o ? e : e.reverse(); - } - function u(e, t, r, o, n, s) { - if (((r = m(r)), (e = b(e)), r + t > e.byteLength)) throw C(S); - for ( - var i = b(e.buffer).bytes, a = r + e.byteOffset, l = o(+n), u = 0; - u < t; - u++ - ) - i[a + u] = l[s ? u : t - u - 1]; - } - var c = e("../internals/global"), - d = e("../internals/descriptors"), - U = e("../internals/array-buffer-native"), - N = e("../internals/create-non-enumerable-property"), - h = e("../internals/redefine-all"), - f = e("../internals/fails"), - p = e("../internals/an-instance"), - B = e("../internals/to-integer"), - G = e("../internals/to-length"), - m = e("../internals/to-index"), - y = e("../internals/ieee754"), - V = e("../internals/object-get-prototype-of"), - g = e("../internals/object-set-prototype-of"), - z = e("../internals/object-get-own-property-names").f, - H = e("../internals/object-define-property").f, - W = e("../internals/array-fill"), - v = e("../internals/set-to-string-tag"), - e = e("../internals/internal-state"), - b = e.get, - j = e.set, - _ = "ArrayBuffer", - x = "DataView", - w = "prototype", - S = "Wrong index", - T = c[_], - M = T, - E = c[x], - e = E && E[w], - k = Object.prototype, - C = c.RangeError, - O = y.pack, - P = y.unpack; - if (U) { - if ( - !f(function () { - T(1); - }) || - !f(function () { - new T(-1); - }) || - f(function () { - return new T(), new T(1.5), new T(NaN), T.name != _; - }) - ) { - for ( - var A, - c = ((M = function (e) { - return p(this, M), new T(m(e)); - })[w] = T[w]), - L = z(T), - R = 0; - L.length > R; - - ) - (A = L[R++]) in M || N(M, A, T[A]); - c.constructor = M; - } - g && V(e) !== k && g(e, k); - var y = new E(new M(2)), - I = e.setInt8; - y.setInt8(0, 2147483648), - y.setInt8(1, 2147483649), - (!y.getInt8(0) && y.getInt8(1)) || - h( - e, - { - setInt8: function (e, t) { - I.call(this, e, (t << 24) >> 24); - }, - setUint8: function (e, t) { - I.call(this, e, (t << 24) >> 24); - }, - }, - { unsafe: !0 }, - ); - } else - (M = function (e) { - p(this, M, _); - e = m(e); - j(this, { bytes: W.call(new Array(e), 0), byteLength: e }), - d || (this.byteLength = e); - }), - (E = function (e, t, r) { - p(this, E, x), p(e, M, x); - var o = b(e).byteLength, - t = B(t); - if (t < 0 || o < t) throw C("Wrong offset"); - if (o < t + (r = void 0 === r ? o - t : G(r))) - throw C("Wrong length"); - j(this, { buffer: e, byteLength: r, byteOffset: t }), - d || - ((this.buffer = e), - (this.byteLength = r), - (this.byteOffset = t)); - }), - d && - (a(M, "byteLength"), - a(E, "buffer"), - a(E, "byteLength"), - a(E, "byteOffset")), - h(E[w], { - getInt8: function (e) { - return (l(this, 1, e)[0] << 24) >> 24; - }, - getUint8: function (e) { - return l(this, 1, e)[0]; - }, - getInt16: function (e) { - e = l( - this, - 2, - e, - 1 < arguments.length ? arguments[1] : void 0, - ); - return (((e[1] << 8) | e[0]) << 16) >> 16; - }, - getUint16: function (e) { - e = l( - this, - 2, - e, - 1 < arguments.length ? arguments[1] : void 0, - ); - return (e[1] << 8) | e[0]; - }, - getInt32: function (e) { - return s( - l(this, 4, e, 1 < arguments.length ? arguments[1] : void 0), - ); - }, - getUint32: function (e) { - return ( - s( - l( - this, - 4, - e, - 1 < arguments.length ? arguments[1] : void 0, - ), - ) >>> 0 - ); - }, - getFloat32: function (e) { - return P( - l(this, 4, e, 1 < arguments.length ? arguments[1] : void 0), - 23, - ); - }, - getFloat64: function (e) { - return P( - l(this, 8, e, 1 < arguments.length ? arguments[1] : void 0), - 52, - ); - }, - setInt8: function (e, t) { - u(this, 1, e, r, t); - }, - setUint8: function (e, t) { - u(this, 1, e, r, t); - }, - setInt16: function (e, t) { - u( - this, - 2, - e, - o, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }, - setUint16: function (e, t) { - u( - this, - 2, - e, - o, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }, - setInt32: function (e, t) { - u( - this, - 4, - e, - n, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }, - setUint32: function (e, t) { - u( - this, - 4, - e, - n, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }, - setFloat32: function (e, t) { - u( - this, - 4, - e, - i, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }, - setFloat64: function (e, t) { - u( - this, - 8, - e, - F, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }, - }); - v(M, _), v(E, x), (t.exports = { ArrayBuffer: M, DataView: E }); - }, - { - "../internals/an-instance": 9, - "../internals/array-buffer-native": 11, - "../internals/array-fill": 15, - "../internals/create-non-enumerable-property": 38, - "../internals/descriptors": 43, - "../internals/fails": 51, - "../internals/global": 59, - "../internals/ieee754": 65, - "../internals/internal-state": 70, - "../internals/object-define-property": 92, - "../internals/object-get-own-property-names": 95, - "../internals/object-get-prototype-of": 97, - "../internals/object-set-prototype-of": 101, - "../internals/redefine-all": 107, - "../internals/set-to-string-tag": 117, - "../internals/to-index": 133, - "../internals/to-integer": 135, - "../internals/to-length": 136, - }, - ], - 14: [ - function (e, t, r) { - "use strict"; - var l = e("../internals/to-object"), - u = e("../internals/to-absolute-index"), - c = e("../internals/to-length"), - d = Math.min; - t.exports = - [].copyWithin || - function (e, t) { - var r = l(this), - o = c(r.length), - n = u(e, o), - s = u(t, o), - e = 2 < arguments.length ? arguments[2] : void 0, - i = d((void 0 === e ? o : u(e, o)) - s, o - n), - a = 1; - for ( - s < n && n < s + i && ((a = -1), (s += i - 1), (n += i - 1)); - 0 < i--; - - ) - s in r ? (r[n] = r[s]) : delete r[n], (n += a), (s += a); - return r; - }; - }, - { - "../internals/to-absolute-index": 132, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 15: [ - function (e, t, r) { - "use strict"; - var i = e("../internals/to-object"), - a = e("../internals/to-absolute-index"), - l = e("../internals/to-length"); - t.exports = function (e) { - for ( - var t = i(this), - r = l(t.length), - o = arguments.length, - n = a(1 < o ? arguments[1] : void 0, r), - o = 2 < o ? arguments[2] : void 0, - s = void 0 === o ? r : a(o, r); - n < s; - - ) - t[n++] = e; - return t; - }; - }, - { - "../internals/to-absolute-index": 132, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 16: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-iteration").forEach, - n = e("../internals/array-method-is-strict"), - e = e("../internals/array-method-uses-to-length"), - n = n("forEach"), - e = e("forEach"); - t.exports = - n && e - ? [].forEach - : function (e) { - return o( - this, - e, - 1 < arguments.length ? arguments[1] : void 0, - ); - }; - }, - { - "../internals/array-iteration": 19, - "../internals/array-method-is-strict": 22, - "../internals/array-method-uses-to-length": 23, - }, - ], - 17: [ - function (e, t, r) { - "use strict"; - var f = e("../internals/function-bind-context"), - p = e("../internals/to-object"), - m = e("../internals/call-with-safe-iteration-closing"), - y = e("../internals/is-array-iterator-method"), - g = e("../internals/to-length"), - v = e("../internals/create-property"), - b = e("../internals/get-iterator-method"); - t.exports = function (e) { - var t, - r, - o, - n, - s, - i, - a = p(e), - e = "function" == typeof this ? this : Array, - l = arguments.length, - u = 1 < l ? arguments[1] : void 0, - c = void 0 !== u, - d = b(a), - h = 0; - if ( - (c && (u = f(u, 2 < l ? arguments[2] : void 0, 2)), - null == d || (e == Array && y(d))) - ) - for (r = new e((t = g(a.length))); h < t; h++) - (i = c ? u(a[h], h) : a[h]), v(r, h, i); - else - for ( - s = (n = d.call(a)).next, r = new e(); - !(o = s.call(n)).done; - h++ - ) - (i = c ? m(n, u, [o.value, h], !0) : o.value), v(r, h, i); - return (r.length = h), r; - }; - }, - { - "../internals/call-with-safe-iteration-closing": 26, - "../internals/create-property": 40, - "../internals/function-bind-context": 54, - "../internals/get-iterator-method": 57, - "../internals/is-array-iterator-method": 71, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 18: [ - function (e, t, r) { - function o(a) { - return function (e, t, r) { - var o, - n = l(e), - s = u(n.length), - i = c(r, s); - if (a && t != t) { - for (; i < s; ) if ((o = n[i++]) != o) return !0; - } else - for (; i < s; i++) - if ((a || i in n) && n[i] === t) return a || i || 0; - return !a && -1; - }; - } - var l = e("../internals/to-indexed-object"), - u = e("../internals/to-length"), - c = e("../internals/to-absolute-index"); - t.exports = { includes: o(!0), indexOf: o(!1) }; - }, - { - "../internals/to-absolute-index": 132, - "../internals/to-indexed-object": 134, - "../internals/to-length": 136, - }, - ], - 19: [ - function (e, t, r) { - function o(h) { - var f = 1 == h, - p = 2 == h, - m = 3 == h, - y = 4 == h, - g = 6 == h, - v = 5 == h || g; - return function (e, t, r, o) { - for ( - var n, - s, - i = _(e), - a = j(i), - l = b(t, r, 3), - u = x(a.length), - c = 0, - t = o || w, - d = f ? t(e, u) : p ? t(e, 0) : void 0; - c < u; - c++ - ) - if ((v || c in a) && ((s = l((n = a[c]), c, i)), h)) - if (f) d[c] = s; - else if (s) - switch (h) { - case 3: - return !0; - case 5: - return n; - case 6: - return c; - case 2: - S.call(d, n); - } - else if (y) return !1; - return g ? -1 : m || y ? y : d; - }; - } - var b = e("../internals/function-bind-context"), - j = e("../internals/indexed-object"), - _ = e("../internals/to-object"), - x = e("../internals/to-length"), - w = e("../internals/array-species-create"), - S = [].push; - t.exports = { - forEach: o(0), - map: o(1), - filter: o(2), - some: o(3), - every: o(4), - find: o(5), - findIndex: o(6), - }; - }, - { - "../internals/array-species-create": 25, - "../internals/function-bind-context": 54, - "../internals/indexed-object": 66, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 20: [ - function (e, t, r) { - "use strict"; - var n = e("../internals/to-indexed-object"), - s = e("../internals/to-integer"), - i = e("../internals/to-length"), - o = e("../internals/array-method-is-strict"), - e = e("../internals/array-method-uses-to-length"), - a = Math.min, - l = [].lastIndexOf, - u = !!l && 1 / [1].lastIndexOf(1, -0) < 0, - o = o("lastIndexOf"), - e = e("indexOf", { ACCESSORS: !0, 1: 0 }); - t.exports = - u || !o || !e - ? function (e) { - if (u) return l.apply(this, arguments) || 0; - var t = n(this), - r = i(t.length), - o = r - 1; - for ( - (o = 1 < arguments.length ? a(o, s(arguments[1])) : o) < - 0 && (o = r + o); - 0 <= o; - o-- - ) - if (o in t && t[o] === e) return o || 0; - return -1; - } - : l; - }, - { - "../internals/array-method-is-strict": 22, - "../internals/array-method-uses-to-length": 23, - "../internals/to-indexed-object": 134, - "../internals/to-integer": 135, - "../internals/to-length": 136, - }, - ], - 21: [ - function (e, t, r) { - var o = e("../internals/fails"), - n = e("../internals/well-known-symbol"), - s = e("../internals/engine-v8-version"), - i = n("species"); - t.exports = function (t) { - return ( - 51 <= s || - !o(function () { - var e = []; - return ( - ((e.constructor = {})[i] = function () { - return { foo: 1 }; - }), - 1 !== e[t](Boolean).foo - ); - }) - ); - }; - }, - { - "../internals/engine-v8-version": 48, - "../internals/fails": 51, - "../internals/well-known-symbol": 148, - }, - ], - 22: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/fails"); - t.exports = function (e, t) { - var r = [][e]; - return ( - !!r && - o(function () { - r.call( - null, - t || - function () { - throw 1; - }, - 1, - ); - }) - ); - }; - }, - { "../internals/fails": 51 }, - ], - 23: [ - function (e, t, r) { - function i(e) { - throw e; - } - var a = e("../internals/descriptors"), - l = e("../internals/fails"), - u = e("../internals/has"), - c = Object.defineProperty, - d = {}; - t.exports = function (e, t) { - var r, o, n, s; - return u(d, e) - ? d[e] - : ((r = [][e]), - (o = !!u((t = t || {}), "ACCESSORS") && t.ACCESSORS), - (n = u(t, 0) ? t[0] : i), - (s = u(t, 1) ? t[1] : void 0), - (d[e] = - !!r && - !l(function () { - if (o && !a) return !0; - var e = { length: -1 }; - o ? c(e, 1, { enumerable: !0, get: i }) : (e[1] = 1), - r.call(e, n, s); - }))); - }; - }, - { - "../internals/descriptors": 43, - "../internals/fails": 51, - "../internals/has": 60, - }, - ], - 24: [ - function (e, t, r) { - function o(u) { - return function (e, t, r, o) { - c(t); - var n = d(e), - s = h(n), - i = f(n.length), - a = u ? i - 1 : 0, - l = u ? -1 : 1; - if (r < 2) - for (;;) { - if (a in s) { - (o = s[a]), (a += l); - break; - } - if (((a += l), u ? a < 0 : i <= a)) - throw TypeError( - "Reduce of empty array with no initial value", - ); - } - for (; u ? 0 <= a : a < i; a += l) - a in s && (o = t(o, s[a], a, n)); - return o; - }; - } - var c = e("../internals/a-function"), - d = e("../internals/to-object"), - h = e("../internals/indexed-object"), - f = e("../internals/to-length"); - t.exports = { left: o(!1), right: o(!0) }; - }, - { - "../internals/a-function": 5, - "../internals/indexed-object": 66, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 25: [ - function (e, t, r) { - var o = e("../internals/is-object"), - n = e("../internals/is-array"), - s = e("../internals/well-known-symbol")("species"); - t.exports = function (e, t) { - var r; - return new ( - void 0 === - (r = - n(e) && - (("function" == typeof (r = e.constructor) && - (r === Array || n(r.prototype))) || - (o(r) && null === (r = r[s]))) - ? void 0 - : r) - ? Array - : r - )(0 === t ? 0 : t); - }; - }, - { - "../internals/is-array": 72, - "../internals/is-object": 74, - "../internals/well-known-symbol": 148, - }, - ], - 26: [ - function (e, t, r) { - var n = e("../internals/an-object"); - t.exports = function (t, e, r, o) { - try { - return o ? e(n(r)[0], r[1]) : e(r); - } catch (e) { - o = t.return; - throw (void 0 !== o && n(o.call(t)), e); - } - }; - }, - { "../internals/an-object": 10 }, - ], - 27: [ - function (e, t, r) { - var n = e("../internals/well-known-symbol")("iterator"), - s = !1; - try { - var o = 0, - i = { - next: function () { - return { done: !!o++ }; - }, - return: function () { - s = !0; - }, - }; - (i[n] = function () { - return this; - }), - Array.from(i, function () { - throw 2; - }); - } catch (e) {} - t.exports = function (e, t) { - if (!t && !s) return !1; - var r = !1; - try { - var o = {}; - (o[n] = function () { - return { - next: function () { - return { done: (r = !0) }; - }, - }; - }), - e(o); - } catch (e) {} - return r; - }; - }, - { "../internals/well-known-symbol": 148 }, - ], - 28: [ - function (e, t, r) { - var o = {}.toString; - t.exports = function (e) { - return o.call(e).slice(8, -1); - }; - }, - {}, - ], - 29: [ - function (e, t, r) { - var o = e("../internals/to-string-tag-support"), - n = e("../internals/classof-raw"), - s = e("../internals/well-known-symbol")("toStringTag"), - i = - "Arguments" == - n( - (function () { - return arguments; - })(), - ); - t.exports = o - ? n - : function (e) { - var t; - return void 0 === e - ? "Undefined" - : null === e - ? "Null" - : "string" == - typeof (t = (function (e, t) { - try { - return e[t]; - } catch (e) {} - })((e = Object(e)), s)) - ? t - : i - ? n(e) - : "Object" == (t = n(e)) && - "function" == typeof e.callee - ? "Arguments" - : t; - }; - }, - { - "../internals/classof-raw": 28, - "../internals/to-string-tag-support": 141, - "../internals/well-known-symbol": 148, - }, - ], - 30: [ - function (e, t, r) { - "use strict"; - var u = e("../internals/object-define-property").f, - c = e("../internals/object-create"), - d = e("../internals/redefine-all"), - h = e("../internals/function-bind-context"), - f = e("../internals/an-instance"), - p = e("../internals/iterate"), - i = e("../internals/define-iterator"), - a = e("../internals/set-species"), - m = e("../internals/descriptors"), - y = e("../internals/internal-metadata").fastKey, - e = e("../internals/internal-state"), - g = e.set, - v = e.getterFor; - t.exports = { - getConstructor: function (e, r, o, n) { - function s(e, t, r) { - var o, - n = l(e), - s = i(e, t); - return ( - s - ? (s.value = r) - : ((n.last = s = - { - index: (o = y(t, !0)), - key: t, - value: r, - previous: (t = n.last), - next: void 0, - removed: !1, - }), - n.first || (n.first = s), - t && (t.next = s), - m ? n.size++ : e.size++, - "F" !== o && (n.index[o] = s)), - e - ); - } - function i(e, t) { - var r, - e = l(e), - o = y(t); - if ("F" !== o) return e.index[o]; - for (r = e.first; r; r = r.next) if (r.key == t) return r; - } - var a = e(function (e, t) { - f(e, a, r), - g(e, { - type: r, - index: c(null), - first: void 0, - last: void 0, - size: 0, - }), - m || (e.size = 0), - null != t && p(t, e[n], e, o); - }), - l = v(r); - return ( - d(a.prototype, { - clear: function () { - for (var e = l(this), t = e.index, r = e.first; r; ) - (r.removed = !0), - r.previous && (r.previous = r.previous.next = void 0), - delete t[r.index], - (r = r.next); - (e.first = e.last = void 0), - m ? (e.size = 0) : (this.size = 0); - }, - delete: function (e) { - var t, - r, - o = l(this), - e = i(this, e); - return ( - e && - ((t = e.next), - (r = e.previous), - delete o.index[e.index], - (e.removed = !0), - r && (r.next = t), - t && (t.previous = r), - o.first == e && (o.first = t), - o.last == e && (o.last = r), - m ? o.size-- : this.size--), - !!e - ); - }, - forEach: function (e) { - for ( - var t, - r = l(this), - o = h( - e, - 1 < arguments.length ? arguments[1] : void 0, - 3, - ); - (t = t ? t.next : r.first); - - ) - for (o(t.value, t.key, this); t && t.removed; ) - t = t.previous; - }, - has: function (e) { - return !!i(this, e); - }, - }), - d( - a.prototype, - o - ? { - get: function (e) { - e = i(this, e); - return e && e.value; - }, - set: function (e, t) { - return s(this, 0 === e ? 0 : e, t); - }, - } - : { - add: function (e) { - return s(this, (e = 0 === e ? 0 : e), e); - }, - }, - ), - m && - u(a.prototype, "size", { - get: function () { - return l(this).size; - }, - }), - a - ); - }, - setStrong: function (e, t, r) { - var o = t + " Iterator", - n = v(t), - s = v(o); - i( - e, - t, - function (e, t) { - g(this, { - type: o, - target: e, - state: n(e), - kind: t, - last: void 0, - }); - }, - function () { - for ( - var e = s(this), t = e.kind, r = e.last; - r && r.removed; - - ) - r = r.previous; - return e.target && (e.last = r = r ? r.next : e.state.first) - ? "keys" == t - ? { value: r.key, done: !1 } - : "values" == t - ? { value: r.value, done: !1 } - : { value: [r.key, r.value], done: !1 } - : { value: (e.target = void 0), done: !0 }; - }, - r ? "entries" : "values", - !r, - !0, - ), - a(t); - }, - }; - }, - { - "../internals/an-instance": 9, - "../internals/define-iterator": 41, - "../internals/descriptors": 43, - "../internals/function-bind-context": 54, - "../internals/internal-metadata": 69, - "../internals/internal-state": 70, - "../internals/iterate": 77, - "../internals/object-create": 90, - "../internals/object-define-property": 92, - "../internals/redefine-all": 107, - "../internals/set-species": 116, - }, - ], - 31: [ - function (e, t, r) { - "use strict"; - function l(e) { - return e.frozen || (e.frozen = new o()); - } - function o() { - this.entries = []; - } - function n(e, t) { - return i(e.entries, function (e) { - return e[0] === t; - }); - } - var u = e("../internals/redefine-all"), - c = e("../internals/internal-metadata").getWeakData, - d = e("../internals/an-object"), - h = e("../internals/is-object"), - f = e("../internals/an-instance"), - p = e("../internals/iterate"), - s = e("../internals/array-iteration"), - m = e("../internals/has"), - e = e("../internals/internal-state"), - y = e.set, - g = e.getterFor, - i = s.find, - a = s.findIndex, - v = 0; - (o.prototype = { - get: function (e) { - e = n(this, e); - if (e) return e[1]; - }, - has: function (e) { - return !!n(this, e); - }, - set: function (e, t) { - var r = n(this, e); - r ? (r[1] = t) : this.entries.push([e, t]); - }, - delete: function (t) { - var e = a(this.entries, function (e) { - return e[0] === t; - }); - return ~e && this.entries.splice(e, 1), !!~e; - }, - }), - (t.exports = { - getConstructor: function (e, r, o, n) { - function s(e, t, r) { - var o = a(e), - n = c(d(t), !0); - return !0 === n ? l(o).set(t, r) : (n[o.id] = r), e; - } - var i = e(function (e, t) { - f(e, i, r), - y(e, { type: r, id: v++, frozen: void 0 }), - null != t && p(t, e[n], e, o); - }), - a = g(r); - return ( - u(i.prototype, { - delete: function (e) { - var t, - r = a(this); - return ( - !!h(e) && - (!0 === (t = c(e)) - ? l(r).delete(e) - : t && m(t, r.id) && delete t[r.id]) - ); - }, - has: function (e) { - var t, - r = a(this); - return ( - !!h(e) && - (!0 === (t = c(e)) ? l(r).has(e) : t && m(t, r.id)) - ); - }, - }), - u( - i.prototype, - o - ? { - get: function (e) { - var t, - r = a(this); - if (h(e)) - return !0 === (t = c(e)) - ? l(r).get(e) - : t - ? t[r.id] - : void 0; - }, - set: function (e, t) { - return s(this, e, t); - }, - } - : { - add: function (e) { - return s(this, e, !0); - }, - }, - ), - i - ); - }, - }); - }, - { - "../internals/an-instance": 9, - "../internals/an-object": 10, - "../internals/array-iteration": 19, - "../internals/has": 60, - "../internals/internal-metadata": 69, - "../internals/internal-state": 70, - "../internals/is-object": 74, - "../internals/iterate": 77, - "../internals/redefine-all": 107, - }, - ], - 32: [ - function (e, t, r) { - "use strict"; - var y = e("../internals/export"), - g = e("../internals/global"), - v = e("../internals/is-forced"), - b = e("../internals/redefine"), - j = e("../internals/internal-metadata"), - _ = e("../internals/iterate"), - x = e("../internals/an-instance"), - w = e("../internals/is-object"), - S = e("../internals/fails"), - T = e("../internals/check-correctness-of-iteration"), - M = e("../internals/set-to-string-tag"), - E = e("../internals/inherit-if-required"); - t.exports = function (r, e, t) { - function o(e) { - var r = f[e]; - b( - f, - e, - "add" == e - ? function (e) { - return r.call(this, 0 === e ? 0 : e), this; - } - : "delete" == e - ? function (e) { - return !(c && !w(e)) && r.call(this, 0 === e ? 0 : e); - } - : "get" == e - ? function (e) { - return c && !w(e) - ? void 0 - : r.call(this, 0 === e ? 0 : e); - } - : "has" == e - ? function (e) { - return ( - !(c && !w(e)) && r.call(this, 0 === e ? 0 : e) - ); - } - : function (e, t) { - return r.call(this, 0 === e ? 0 : e, t), this; - }, - ); - } - var n, - s, - i, - a, - l, - u = -1 !== r.indexOf("Map"), - c = -1 !== r.indexOf("Weak"), - d = u ? "set" : "add", - h = g[r], - f = h && h.prototype, - p = h, - m = {}; - return ( - v( - r, - "function" != typeof h || - !( - c || - (f.forEach && - !S(function () { - new h().entries().next(); - })) - ), - ) - ? ((p = t.getConstructor(e, r, u, d)), (j.REQUIRED = !0)) - : v(r, !0) && - ((s = (n = new p())[d](c ? {} : -0, 1) != n), - (i = S(function () { - n.has(1); - })), - (a = T(function (e) { - new h(e); - })), - (l = - !c && - S(function () { - for (var e = new h(), t = 5; t--; ) e[d](t, t); - return !e.has(-0); - })), - a || - (((p = e(function (e, t) { - x(e, p, r); - e = E(new h(), e, p); - return null != t && _(t, e[d], e, u), e; - })).prototype = f).constructor = p), - (i || l) && (o("delete"), o("has"), u && o("get")), - (l || s) && o(d), - c && f.clear && delete f.clear), - (m[r] = p), - y({ global: !0, forced: p != h }, m), - M(p, r), - c || t.setStrong(p, r, u), - p - ); - }; - }, - { - "../internals/an-instance": 9, - "../internals/check-correctness-of-iteration": 27, - "../internals/export": 50, - "../internals/fails": 51, - "../internals/global": 59, - "../internals/inherit-if-required": 67, - "../internals/internal-metadata": 69, - "../internals/is-forced": 73, - "../internals/is-object": 74, - "../internals/iterate": 77, - "../internals/redefine": 108, - "../internals/set-to-string-tag": 117, - }, - ], - 33: [ - function (e, t, r) { - var a = e("../internals/has"), - l = e("../internals/own-keys"), - u = e("../internals/object-get-own-property-descriptor"), - c = e("../internals/object-define-property"); - t.exports = function (e, t) { - for (var r = l(t), o = c.f, n = u.f, s = 0; s < r.length; s++) { - var i = r[s]; - a(e, i) || o(e, i, n(t, i)); - } - }; - }, - { - "../internals/has": 60, - "../internals/object-define-property": 92, - "../internals/object-get-own-property-descriptor": 93, - "../internals/own-keys": 103, - }, - ], - 34: [ - function (e, t, r) { - var o = e("../internals/well-known-symbol")("match"); - t.exports = function (t) { - var r = /./; - try { - "/./"[t](r); - } catch (e) { - try { - return (r[o] = !1), "/./"[t](r); - } catch (e) {} - } - return !1; - }; - }, - { "../internals/well-known-symbol": 148 }, - ], - 35: [ - function (e, t, r) { - e = e("../internals/fails"); - t.exports = !e(function () { - function e() {} - return ( - (e.prototype.constructor = null), - Object.getPrototypeOf(new e()) !== e.prototype - ); - }); - }, - { "../internals/fails": 51 }, - ], - 36: [ - function (e, t, r) { - var s = e("../internals/require-object-coercible"), - i = /"/g; - t.exports = function (e, t, r, o) { - var e = String(s(e)), - n = "<" + t; - return ( - "" !== r && - (n += " " + r + '="' + String(o).replace(i, """) + '"'), - n + ">" + e + "" - ); - }; - }, - { "../internals/require-object-coercible": 113 }, - ], - 37: [ - function (e, t, r) { - "use strict"; - function o() { - return this; - } - var n = e("../internals/iterators-core").IteratorPrototype, - s = e("../internals/object-create"), - i = e("../internals/create-property-descriptor"), - a = e("../internals/set-to-string-tag"), - l = e("../internals/iterators"); - t.exports = function (e, t, r) { - t += " Iterator"; - return ( - (e.prototype = s(n, { next: i(1, r) })), - a(e, t, !1, !0), - (l[t] = o), - e - ); - }; - }, - { - "../internals/create-property-descriptor": 39, - "../internals/iterators": 79, - "../internals/iterators-core": 78, - "../internals/object-create": 90, - "../internals/set-to-string-tag": 117, - }, - ], - 38: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - n = e("../internals/object-define-property"), - s = e("../internals/create-property-descriptor"); - t.exports = o - ? function (e, t, r) { - return n.f(e, t, s(1, r)); - } - : function (e, t, r) { - return (e[t] = r), e; - }; - }, - { - "../internals/create-property-descriptor": 39, - "../internals/descriptors": 43, - "../internals/object-define-property": 92, - }, - ], - 39: [ - function (e, t, r) { - t.exports = function (e, t) { - return { - enumerable: !(1 & e), - configurable: !(2 & e), - writable: !(4 & e), - value: t, - }; - }; - }, - {}, - ], - 40: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/to-primitive"), - n = e("../internals/object-define-property"), - s = e("../internals/create-property-descriptor"); - t.exports = function (e, t, r) { - t = o(t); - t in e ? n.f(e, t, s(0, r)) : (e[t] = r); - }; - }, - { - "../internals/create-property-descriptor": 39, - "../internals/object-define-property": 92, - "../internals/to-primitive": 140, - }, - ], - 41: [ - function (e, t, r) { - "use strict"; - function m() { - return this; - } - var y = e("../internals/export"), - g = e("../internals/create-iterator-constructor"), - v = e("../internals/object-get-prototype-of"), - b = e("../internals/object-set-prototype-of"), - j = e("../internals/set-to-string-tag"), - _ = e("../internals/create-non-enumerable-property"), - x = e("../internals/redefine"), - o = e("../internals/well-known-symbol"), - w = e("../internals/is-pure"), - S = e("../internals/iterators"), - e = e("../internals/iterators-core"), - T = e.IteratorPrototype, - M = e.BUGGY_SAFARI_ITERATORS, - E = o("iterator"), - k = "values", - C = "entries"; - t.exports = function (e, t, r, o, n, s, i) { - g(r, t, o); - function a(e) { - if (e === n && f) return f; - if (!M && e in d) return d[e]; - switch (e) { - case "keys": - case k: - case C: - return function () { - return new r(this, e); - }; - } - return function () { - return new r(this); - }; - } - var l, - u, - o = t + " Iterator", - c = !1, - d = e.prototype, - h = d[E] || d["@@iterator"] || (n && d[n]), - f = (!M && h) || a(n), - p = ("Array" == t && d.entries) || h; - if ( - (p && - ((p = v(p.call(new e()))), - T !== Object.prototype && - p.next && - (w || - v(p) === T || - (b ? b(p, T) : "function" != typeof p[E] && _(p, E, m)), - j(p, o, !0, !0), - w && (S[o] = m))), - n == k && - h && - h.name !== k && - ((c = !0), - (f = function () { - return h.call(this); - })), - (w && !i) || d[E] === f || _(d, E, f), - (S[t] = f), - n) - ) - if ( - ((l = { values: a(k), keys: s ? f : a("keys"), entries: a(C) }), - i) - ) - for (u in l) (!M && !c && u in d) || x(d, u, l[u]); - else y({ target: t, proto: !0, forced: M || c }, l); - return l; - }; - }, - { - "../internals/create-iterator-constructor": 37, - "../internals/create-non-enumerable-property": 38, - "../internals/export": 50, - "../internals/is-pure": 75, - "../internals/iterators": 79, - "../internals/iterators-core": 78, - "../internals/object-get-prototype-of": 97, - "../internals/object-set-prototype-of": 101, - "../internals/redefine": 108, - "../internals/set-to-string-tag": 117, - "../internals/well-known-symbol": 148, - }, - ], - 42: [ - function (e, t, r) { - var o = e("../internals/path"), - n = e("../internals/has"), - s = e("../internals/well-known-symbol-wrapped"), - i = e("../internals/object-define-property").f; - t.exports = function (e) { - var t = o.Symbol || (o.Symbol = {}); - n(t, e) || i(t, e, { value: s.f(e) }); - }; - }, - { - "../internals/has": 60, - "../internals/object-define-property": 92, - "../internals/path": 104, - "../internals/well-known-symbol-wrapped": 147, - }, - ], - 43: [ - function (e, t, r) { - e = e("../internals/fails"); - t.exports = !e(function () { - return ( - 7 != - Object.defineProperty({}, 1, { - get: function () { - return 7; - }, - })[1] - ); - }); - }, - { "../internals/fails": 51 }, - ], - 44: [ - function (e, t, r) { - var o = e("../internals/global"), - e = e("../internals/is-object"), - n = o.document, - s = e(n) && e(n.createElement); - t.exports = function (e) { - return s ? n.createElement(e) : {}; - }; - }, - { "../internals/global": 59, "../internals/is-object": 74 }, - ], - 45: [ - function (e, t, r) { - t.exports = { - CSSRuleList: 0, - CSSStyleDeclaration: 0, - CSSValueList: 0, - ClientRectList: 0, - DOMRectList: 0, - DOMStringList: 0, - DOMTokenList: 1, - DataTransferItemList: 0, - FileList: 0, - HTMLAllCollection: 0, - HTMLCollection: 0, - HTMLFormElement: 0, - HTMLSelectElement: 0, - MediaList: 0, - MimeTypeArray: 0, - NamedNodeMap: 0, - NodeList: 1, - PaintRequestList: 0, - Plugin: 0, - PluginArray: 0, - SVGLengthList: 0, - SVGNumberList: 0, - SVGPathSegList: 0, - SVGPointList: 0, - SVGStringList: 0, - SVGTransformList: 0, - SourceBufferList: 0, - StyleSheetList: 0, - TextTrackCueList: 0, - TextTrackList: 0, - TouchList: 0, - }; - }, - {}, - ], - 46: [ - function (e, t, r) { - e = e("../internals/engine-user-agent"); - t.exports = /(iphone|ipod|ipad).*applewebkit/i.test(e); - }, - { "../internals/engine-user-agent": 47 }, - ], - 47: [ - function (e, t, r) { - e = e("../internals/get-built-in"); - t.exports = e("navigator", "userAgent") || ""; - }, - { "../internals/get-built-in": 56 }, - ], - 48: [ - function (e, t, r) { - var o, - n, - s = e("../internals/global"), - e = e("../internals/engine-user-agent"), - s = s.process, - s = s && s.versions, - s = s && s.v8; - s - ? (n = (o = s.split("."))[0] + o[1]) - : e && - (!(o = e.match(/Edge\/(\d+)/)) || 74 <= o[1]) && - (o = e.match(/Chrome\/(\d+)/)) && - (n = o[1]), - (t.exports = n && +n); - }, - { "../internals/engine-user-agent": 47, "../internals/global": 59 }, - ], - 49: [ - function (e, t, r) { - t.exports = [ - "constructor", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "toLocaleString", - "toString", - "valueOf", - ]; - }, - {}, - ], - 50: [ - function (e, t, r) { - var u = e("../internals/global"), - c = e("../internals/object-get-own-property-descriptor").f, - d = e("../internals/create-non-enumerable-property"), - h = e("../internals/redefine"), - f = e("../internals/set-global"), - p = e("../internals/copy-constructor-properties"), - m = e("../internals/is-forced"); - t.exports = function (e, t) { - var r, - o, - n, - s = e.target, - i = e.global, - a = e.stat, - l = i ? u : a ? u[s] || f(s, {}) : (u[s] || {}).prototype; - if (l) - for (r in t) { - if ( - ((o = t[r]), - (n = e.noTargetGet ? (n = c(l, r)) && n.value : l[r]), - !m(i ? r : s + (a ? "." : "#") + r, e.forced) && void 0 !== n) - ) { - if (typeof o == typeof n) continue; - p(o, n); - } - (e.sham || (n && n.sham)) && d(o, "sham", !0), h(l, r, o, e); - } - }; - }, - { - "../internals/copy-constructor-properties": 33, - "../internals/create-non-enumerable-property": 38, - "../internals/global": 59, - "../internals/is-forced": 73, - "../internals/object-get-own-property-descriptor": 93, - "../internals/redefine": 108, - "../internals/set-global": 115, - }, - ], - 51: [ - function (e, t, r) { - t.exports = function (e) { - try { - return !!e(); - } catch (e) { - return !0; - } - }; - }, - {}, - ], - 52: [ - function (e, t, r) { - "use strict"; - e("../modules/es.regexp.exec"); - var u = e("../internals/redefine"), - c = e("../internals/fails"), - d = e("../internals/well-known-symbol"), - h = e("../internals/regexp-exec"), - f = e("../internals/create-non-enumerable-property"), - p = d("species"), - m = !c(function () { - var e = /./; - return ( - (e.exec = function () { - var e = []; - return (e.groups = { a: "7" }), e; - }), - "7" !== "".replace(e, "$") - ); - }), - y = "$0" === "a".replace(/./, "$0"), - e = d("replace"), - g = !!/./[e] && "" === /./[e]("a", "$0"), - v = !c(function () { - var e = /(?:)/, - t = e.exec, - e = - ((e.exec = function () { - return t.apply(this, arguments); - }), - "ab".split(e)); - return 2 !== e.length || "a" !== e[0] || "b" !== e[1]; - }); - t.exports = function (r, e, t, o) { - var s, - n, - i = d(r), - a = !c(function () { - var e = {}; - return ( - (e[i] = function () { - return 7; - }), - 7 != ""[r](e) - ); - }), - l = - a && - !c(function () { - var e = !1, - t = /a/; - return ( - "split" === r && - (((t = { constructor: {} }).constructor[p] = function () { - return t; - }), - (t.flags = ""), - (t[i] = /./[i])), - (t.exec = function () { - return (e = !0), null; - }), - t[i](""), - !e - ); - }); - (a && - l && - ("replace" !== r || (m && y && !g)) && - ("split" !== r || v)) || - ((s = /./[i]), - (t = (l = t( - i, - ""[r], - function (e, t, r, o, n) { - return t.exec === h - ? a && !n - ? { done: !0, value: s.call(t, r, o) } - : { done: !0, value: e.call(r, t, o) } - : { done: !1 }; - }, - { - REPLACE_KEEPS_$0: y, - REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: g, - }, - ))[0]), - (n = l[1]), - u(String.prototype, r, t), - u( - RegExp.prototype, - i, - 2 == e - ? function (e, t) { - return n.call(e, this, t); - } - : function (e) { - return n.call(e, this); - }, - )), - o && f(RegExp.prototype[i], "sham", !0); - }; - }, - { - "../internals/create-non-enumerable-property": 38, - "../internals/fails": 51, - "../internals/redefine": 108, - "../internals/regexp-exec": 110, - "../internals/well-known-symbol": 148, - "../modules/es.regexp.exec": 187, - }, - ], - 53: [ - function (e, t, r) { - e = e("../internals/fails"); - t.exports = !e(function () { - return Object.isExtensible(Object.preventExtensions({})); - }); - }, - { "../internals/fails": 51 }, - ], - 54: [ - function (e, t, r) { - var s = e("../internals/a-function"); - t.exports = function (o, n, e) { - if ((s(o), void 0 === n)) return o; - switch (e) { - case 0: - return function () { - return o.call(n); - }; - case 1: - return function (e) { - return o.call(n, e); - }; - case 2: - return function (e, t) { - return o.call(n, e, t); - }; - case 3: - return function (e, t, r) { - return o.call(n, e, t, r); - }; - } - return function () { - return o.apply(n, arguments); - }; - }; - }, - { "../internals/a-function": 5 }, - ], - 55: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/a-function"), - n = e("../internals/is-object"), - c = [].slice, - d = {}; - t.exports = - Function.bind || - function (i) { - var a = o(this), - l = c.call(arguments, 1), - u = function () { - var e = l.concat(c.call(arguments)); - if (this instanceof u) { - var t = a, - r = e.length, - o = e; - if (!(r in d)) { - for (var n = [], s = 0; s < r; s++) n[s] = "a[" + s + "]"; - d[r] = Function( - "C,a", - "return new C(" + n.join(",") + ")", - ); - } - return d[r](t, o); - } - return a.apply(i, e); - }; - return n(a.prototype) && (u.prototype = a.prototype), u; - }; - }, - { "../internals/a-function": 5, "../internals/is-object": 74 }, - ], - 56: [ - function (e, t, r) { - function o(e) { - return "function" == typeof e ? e : void 0; - } - var n = e("../internals/path"), - s = e("../internals/global"); - t.exports = function (e, t) { - return arguments.length < 2 - ? o(n[e]) || o(s[e]) - : (n[e] && n[e][t]) || (s[e] && s[e][t]); - }; - }, - { "../internals/global": 59, "../internals/path": 104 }, - ], - 57: [ - function (e, t, r) { - var o = e("../internals/classof"), - n = e("../internals/iterators"), - s = e("../internals/well-known-symbol")("iterator"); - t.exports = function (e) { - if (null != e) return e[s] || e["@@iterator"] || n[o(e)]; - }; - }, - { - "../internals/classof": 29, - "../internals/iterators": 79, - "../internals/well-known-symbol": 148, - }, - ], - 58: [ - function (e, t, r) { - var o = e("../internals/an-object"), - n = e("../internals/get-iterator-method"); - t.exports = function (e) { - var t = n(e); - if ("function" != typeof t) - throw TypeError(String(e) + " is not iterable"); - return o(t.call(e)); - }; - }, - { - "../internals/an-object": 10, - "../internals/get-iterator-method": 57, - }, - ], - 59: [ - function (e, r, t) { - !function (e) { - function t(e) { - return e && e.Math == Math && e; - } - r.exports = - t("object" == typeof globalThis && globalThis) || - t("object" == typeof window && window) || - t("object" == typeof self && self) || - t("object" == typeof e && e) || - Function("return this")(); - }.call( - this, - "undefined" != typeof global - ? global - : "undefined" != typeof self - ? self - : "undefined" != typeof window - ? window - : {}, - ); - }, - {}, - ], - 60: [ - function (e, t, r) { - var o = {}.hasOwnProperty; - t.exports = function (e, t) { - return o.call(e, t); - }; - }, - {}, - ], - 61: [ - function (e, t, r) { - t.exports = {}; - }, - {}, - ], - 62: [ - function (e, t, r) { - var o = e("../internals/global"); - t.exports = function (e, t) { - var r = o.console; - r && - r.error && - (1 === arguments.length ? r.error(e) : r.error(e, t)); - }; - }, - { "../internals/global": 59 }, - ], - 63: [ - function (e, t, r) { - e = e("../internals/get-built-in"); - t.exports = e("document", "documentElement"); - }, - { "../internals/get-built-in": 56 }, - ], - 64: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - n = e("../internals/fails"), - s = e("../internals/document-create-element"); - t.exports = - !o && - !n(function () { - return ( - 7 != - Object.defineProperty(s("div"), "a", { - get: function () { - return 7; - }, - }).a - ); - }); - }, - { - "../internals/descriptors": 43, - "../internals/document-create-element": 44, - "../internals/fails": 51, - }, - ], - 65: [ - function (e, t, r) { - var h = Math.abs, - f = Math.pow, - p = Math.floor, - m = Math.log, - y = Math.LN2; - t.exports = { - pack: function (e, t, r) { - var o, - n, - s, - i = new Array(r), - a = 8 * r - t - 1, - r = (1 << a) - 1, - l = r >> 1, - u = 23 === t ? f(2, -24) - f(2, -77) : 0, - c = e < 0 || (0 === e && 1 / e < 0) ? 1 : 0, - d = 0; - for ( - (e = h(e)) != e || e === 1 / 0 - ? ((n = e != e ? 1 : 0), (o = r)) - : ((o = p(m(e) / y)), - e * (s = f(2, -o)) < 1 && (o--, (s *= 2)), - 2 <= (e += 1 <= o + l ? u / s : u * f(2, 1 - l)) * s && - (o++, (s /= 2)), - r <= o + l - ? ((n = 0), (o = r)) - : 1 <= o + l - ? ((n = (e * s - 1) * f(2, t)), (o += l)) - : ((n = e * f(2, l - 1) * f(2, t)), (o = 0))); - 8 <= t; - i[d++] = 255 & n, n /= 256, t -= 8 - ); - for ( - o = (o << t) | n, a += t; - 0 < a; - i[d++] = 255 & o, o /= 256, a -= 8 - ); - return (i[--d] |= 128 * c), i; - }, - unpack: function (e, t) { - var r, - o = e.length, - n = 8 * o - t - 1, - s = (1 << n) - 1, - i = s >> 1, - a = n - 7, - l = o - 1, - n = e[l--], - u = 127 & n; - for (n >>= 7; 0 < a; u = 256 * u + e[l], l--, a -= 8); - for ( - r = u & ((1 << -a) - 1), u >>= -a, a += t; - 0 < a; - r = 256 * r + e[l], l--, a -= 8 - ); - if (0 === u) u = 1 - i; - else { - if (u === s) return r ? NaN : n ? -1 / 0 : 1 / 0; - (r += f(2, t)), (u -= i); - } - return (n ? -1 : 1) * r * f(2, u - t); - }, - }; - }, - {}, - ], - 66: [ - function (e, t, r) { - var o = e("../internals/fails"), - n = e("../internals/classof-raw"), - s = "".split; - t.exports = o(function () { - return !Object("z").propertyIsEnumerable(0); - }) - ? function (e) { - return "String" == n(e) ? s.call(e, "") : Object(e); - } - : Object; - }, - { "../internals/classof-raw": 28, "../internals/fails": 51 }, - ], - 67: [ - function (e, t, r) { - var o = e("../internals/is-object"), - n = e("../internals/object-set-prototype-of"); - t.exports = function (e, t, r) { - return ( - n && - "function" == typeof (t = t.constructor) && - t !== r && - o((t = t.prototype)) && - t !== r.prototype && - n(e, t), - e - ); - }; - }, - { - "../internals/is-object": 74, - "../internals/object-set-prototype-of": 101, - }, - ], - 68: [ - function (e, t, r) { - var e = e("../internals/shared-store"), - o = Function.toString; - "function" != typeof e.inspectSource && - (e.inspectSource = function (e) { - return o.call(e); - }), - (t.exports = e.inspectSource); - }, - { "../internals/shared-store": 119 }, - ], - 69: [ - function (e, t, r) { - function o(e) { - a(e, c, { value: { objectID: "O" + ++d, weakData: {} } }); - } - var n = e("../internals/hidden-keys"), - s = e("../internals/is-object"), - i = e("../internals/has"), - a = e("../internals/object-define-property").f, - l = e("../internals/uid"), - u = e("../internals/freezing"), - c = l("meta"), - d = 0, - h = - Object.isExtensible || - function () { - return !0; - }, - f = (t.exports = { - REQUIRED: !1, - fastKey: function (e, t) { - if (!s(e)) - return "symbol" == typeof e - ? e - : ("string" == typeof e ? "S" : "P") + e; - if (!i(e, c)) { - if (!h(e)) return "F"; - if (!t) return "E"; - o(e); - } - return e[c].objectID; - }, - getWeakData: function (e, t) { - if (!i(e, c)) { - if (!h(e)) return !0; - if (!t) return !1; - o(e); - } - return e[c].weakData; - }, - onFreeze: function (e) { - return u && f.REQUIRED && h(e) && !i(e, c) && o(e), e; - }, - }); - n[c] = !0; - }, - { - "../internals/freezing": 53, - "../internals/has": 60, - "../internals/hidden-keys": 61, - "../internals/is-object": 74, - "../internals/object-define-property": 92, - "../internals/uid": 145, - }, - ], - 70: [ - function (e, t, r) { - var o, - n, - s, - i, - a, - l, - u, - c, - d = e("../internals/native-weak-map"), - h = e("../internals/global"), - f = e("../internals/is-object"), - p = e("../internals/create-non-enumerable-property"), - m = e("../internals/has"), - y = e("../internals/shared-key"), - e = e("../internals/hidden-keys"), - h = h.WeakMap; - (u = d - ? ((o = new h()), - (n = o.get), - (s = o.has), - (i = o.set), - (a = function (e, t) { - return i.call(o, e, t), t; - }), - (l = function (e) { - return n.call(o, e) || {}; - }), - function (e) { - return s.call(o, e); - }) - : ((e[(c = y("state"))] = !0), - (a = function (e, t) { - return p(e, c, t), t; - }), - (l = function (e) { - return m(e, c) ? e[c] : {}; - }), - function (e) { - return m(e, c); - })), - (t.exports = { - set: a, - get: l, - has: u, - enforce: function (e) { - return u(e) ? l(e) : a(e, {}); - }, - getterFor: function (t) { - return function (e) { - if (f(e) && (e = l(e)).type === t) return e; - throw TypeError("Incompatible receiver, " + t + " required"); - }; - }, - }); - }, - { - "../internals/create-non-enumerable-property": 38, - "../internals/global": 59, - "../internals/has": 60, - "../internals/hidden-keys": 61, - "../internals/is-object": 74, - "../internals/native-weak-map": 85, - "../internals/shared-key": 118, - }, - ], - 71: [ - function (e, t, r) { - var o = e("../internals/well-known-symbol"), - n = e("../internals/iterators"), - s = o("iterator"), - i = Array.prototype; - t.exports = function (e) { - return void 0 !== e && (n.Array === e || i[s] === e); - }; - }, - { "../internals/iterators": 79, "../internals/well-known-symbol": 148 }, - ], - 72: [ - function (e, t, r) { - var o = e("../internals/classof-raw"); - t.exports = - Array.isArray || - function (e) { - return "Array" == o(e); - }; - }, - { "../internals/classof-raw": 28 }, - ], - 73: [ - function (e, t, r) { - function o(e, t) { - return ( - (e = a[i(e)]) == u || - (e != l && ("function" == typeof t ? n(t) : !!t)) - ); - } - var n = e("../internals/fails"), - s = /#|\.prototype\./, - i = (o.normalize = function (e) { - return String(e).replace(s, ".").toLowerCase(); - }), - a = (o.data = {}), - l = (o.NATIVE = "N"), - u = (o.POLYFILL = "P"); - t.exports = o; - }, - { "../internals/fails": 51 }, - ], - 74: [ - function (e, t, r) { - t.exports = function (e) { - return "object" == typeof e ? null !== e : "function" == typeof e; - }; - }, - {}, - ], - 75: [ - function (e, t, r) { - t.exports = !1; - }, - {}, - ], - 76: [ - function (e, t, r) { - var o = e("../internals/is-object"), - n = e("../internals/classof-raw"), - s = e("../internals/well-known-symbol")("match"); - t.exports = function (e) { - var t; - return o(e) && (void 0 !== (t = e[s]) ? !!t : "RegExp" == n(e)); - }; - }, - { - "../internals/classof-raw": 28, - "../internals/is-object": 74, - "../internals/well-known-symbol": 148, - }, - ], - 77: [ - function (e, t, r) { - function h(e, t) { - (this.stopped = e), (this.result = t); - } - var f = e("../internals/an-object"), - p = e("../internals/is-array-iterator-method"), - m = e("../internals/to-length"), - y = e("../internals/function-bind-context"), - g = e("../internals/get-iterator-method"), - v = e("../internals/call-with-safe-iteration-closing"); - (t.exports = function (e, t, r, o, n) { - var s, - i, - a, - l, - u, - c, - d = y(t, r, o ? 2 : 1); - if (n) s = e; - else { - if ("function" != typeof (t = g(e))) - throw TypeError("Target is not iterable"); - if (p(t)) { - for (i = 0, a = m(e.length); i < a; i++) - if ( - (l = o ? d(f((c = e[i]))[0], c[1]) : d(e[i])) && - l instanceof h - ) - return l; - return new h(!1); - } - s = t.call(e); - } - for (u = s.next; !(c = u.call(s)).done; ) - if ( - "object" == typeof (l = v(s, d, c.value, o)) && - l && - l instanceof h - ) - return l; - return new h(!1); - }).stop = function (e) { - return new h(!0, e); - }; - }, - { - "../internals/an-object": 10, - "../internals/call-with-safe-iteration-closing": 26, - "../internals/function-bind-context": 54, - "../internals/get-iterator-method": 57, - "../internals/is-array-iterator-method": 71, - "../internals/to-length": 136, - }, - ], - 78: [ - function (e, t, r) { - "use strict"; - var o, - n, - s = e("../internals/object-get-prototype-of"), - i = e("../internals/create-non-enumerable-property"), - a = e("../internals/has"), - l = e("../internals/well-known-symbol"), - e = e("../internals/is-pure"), - l = l("iterator"), - u = !1; - [].keys && - ("next" in (n = [].keys()) - ? (s = s(s(n))) !== Object.prototype && (o = s) - : (u = !0)), - null == o && (o = {}), - e || - a(o, l) || - i(o, l, function () { - return this; - }), - (t.exports = { IteratorPrototype: o, BUGGY_SAFARI_ITERATORS: u }); - }, - { - "../internals/create-non-enumerable-property": 38, - "../internals/has": 60, - "../internals/is-pure": 75, - "../internals/object-get-prototype-of": 97, - "../internals/well-known-symbol": 148, - }, - ], - 79: [ - function (e, t, r) { - t.exports = {}; - }, - {}, - ], - 80: [ - function (e, t, r) { - t.exports = - Math.sign || - function (e) { - return 0 == (e = +e) || e != e ? e : e < 0 ? -1 : 1; - }; - }, - {}, - ], - 81: [ - function (e, t, r) { - var o, - n, - s, - i, - a, - l, - u, - c, - d = e("../internals/global"), - h = e("../internals/object-get-own-property-descriptor").f, - f = e("../internals/classof-raw"), - p = e("../internals/task").set, - e = e("../internals/engine-is-ios"), - m = d.MutationObserver || d.WebKitMutationObserver, - y = d.process, - g = d.Promise, - v = "process" == f(y), - f = h(d, "queueMicrotask"), - h = f && f.value; - h || - ((o = function () { - var e, t; - for (v && (e = y.domain) && e.exit(); n; ) { - (t = n.fn), (n = n.next); - try { - t(); - } catch (e) { - throw (n ? i() : (s = void 0), e); - } - } - (s = void 0), e && e.enter(); - }), - (i = v - ? function () { - y.nextTick(o); - } - : m && !e - ? ((a = !0), - (l = document.createTextNode("")), - new m(o).observe(l, { characterData: !0 }), - function () { - l.data = a = !a; - }) - : g && g.resolve - ? ((u = g.resolve(void 0)), - (c = u.then), - function () { - c.call(u, o); - }) - : function () { - p.call(d, o); - })), - (t.exports = - h || - function (e) { - e = { fn: e, next: void 0 }; - s && (s.next = e), n || ((n = e), i()), (s = e); - }); - }, - { - "../internals/classof-raw": 28, - "../internals/engine-is-ios": 46, - "../internals/global": 59, - "../internals/object-get-own-property-descriptor": 93, - "../internals/task": 130, - }, - ], - 82: [ - function (e, t, r) { - e = e("../internals/global"); - t.exports = e.Promise; - }, - { "../internals/global": 59 }, - ], - 83: [ - function (e, t, r) { - e = e("../internals/fails"); - t.exports = - !!Object.getOwnPropertySymbols && - !e(function () { - return !String(Symbol()); - }); - }, - { "../internals/fails": 51 }, - ], - 84: [ - function (e, t, r) { - var o = e("../internals/fails"), - n = e("../internals/well-known-symbol"), - s = e("../internals/is-pure"), - i = n("iterator"); - t.exports = !o(function () { - var e = new URL("b?a=1&b=2&c=3", "http://a"), - r = e.searchParams, - o = ""; - return ( - (e.pathname = "c%20d"), - r.forEach(function (e, t) { - r.delete("b"), (o += t + e); - }), - (s && !e.toJSON) || - !r.sort || - "http://a/c%20d?a=1&c=3" !== e.href || - "3" !== r.get("c") || - "a=1" !== String(new URLSearchParams("?a=1")) || - !r[i] || - "a" !== new URL("https://a@b").username || - "b" !== - new URLSearchParams(new URLSearchParams("a=b")).get("a") || - "xn--e1aybc" !== new URL("http://тест").host || - "#%D0%B1" !== new URL("http://a#б").hash || - "a1c3" !== o || - "x" !== new URL("http://x", void 0).host - ); - }); - }, - { - "../internals/fails": 51, - "../internals/is-pure": 75, - "../internals/well-known-symbol": 148, - }, - ], - 85: [ - function (e, t, r) { - var o = e("../internals/global"), - e = e("../internals/inspect-source"), - o = o.WeakMap; - t.exports = "function" == typeof o && /native code/.test(e(o)); - }, - { "../internals/global": 59, "../internals/inspect-source": 68 }, - ], - 86: [ - function (e, t, r) { - "use strict"; - function o(e) { - var r, o; - (this.promise = new e(function (e, t) { - if (void 0 !== r || void 0 !== o) - throw TypeError("Bad Promise constructor"); - (r = e), (o = t); - })), - (this.resolve = n(r)), - (this.reject = n(o)); - } - var n = e("../internals/a-function"); - t.exports.f = function (e) { - return new o(e); - }; - }, - { "../internals/a-function": 5 }, - ], - 87: [ - function (e, t, r) { - var o = e("../internals/is-regexp"); - t.exports = function (e) { - if (o(e)) - throw TypeError("The method doesn't accept regular expressions"); - return e; - }; - }, - { "../internals/is-regexp": 76 }, - ], - 88: [ - function (e, t, r) { - var o = e("../internals/global").isFinite; - t.exports = - Number.isFinite || - function (e) { - return "number" == typeof e && o(e); - }; - }, - { "../internals/global": 59 }, - ], - 89: [ - function (e, t, r) { - "use strict"; - var h = e("../internals/descriptors"), - o = e("../internals/fails"), - f = e("../internals/object-keys"), - p = e("../internals/object-get-own-property-symbols"), - m = e("../internals/object-property-is-enumerable"), - y = e("../internals/to-object"), - g = e("../internals/indexed-object"), - n = Object.assign, - s = Object.defineProperty; - t.exports = - !n || - o(function () { - var e, t, r, o; - return ( - !( - !h || - 1 === - n( - { b: 1 }, - n( - s({}, "a", { - enumerable: !0, - get: function () { - s(this, "b", { value: 3, enumerable: !1 }); - }, - }), - { b: 2 }, - ), - ).b - ) || - ((t = {}), - (o = "abcdefghijklmnopqrst"), - ((e = {})[(r = Symbol())] = 7), - o.split("").forEach(function (e) { - t[e] = e; - }), - 7 != n({}, e)[r] || f(n({}, t)).join("") != o) - ); - }) - ? function (e, t) { - for ( - var r = y(e), o = arguments.length, n = 1, s = p.f, i = m.f; - n < o; - - ) - for ( - var a, - l = g(arguments[n++]), - u = s ? f(l).concat(s(l)) : f(l), - c = u.length, - d = 0; - d < c; - - ) - (a = u[d++]), (h && !i.call(l, a)) || (r[a] = l[a]); - return r; - } - : n; - }, - { - "../internals/descriptors": 43, - "../internals/fails": 51, - "../internals/indexed-object": 66, - "../internals/object-get-own-property-symbols": 96, - "../internals/object-keys": 99, - "../internals/object-property-is-enumerable": 100, - "../internals/to-object": 137, - }, - ], - 90: [ - function (e, t, r) { - function o() {} - var n, - s = e("../internals/an-object"), - i = e("../internals/object-define-properties"), - a = e("../internals/enum-bug-keys"), - l = e("../internals/hidden-keys"), - u = e("../internals/html"), - c = e("../internals/document-create-element"), - e = e("../internals/shared-key"), - d = "prototype", - h = "script", - f = e("IE_PROTO"), - p = function (e) { - return "<" + h + ">" + e + ""; - }, - m = function () { - try { - n = document.domain && new ActiveXObject("htmlfile"); - } catch (e) {} - m = n - ? ((e = n).write(p("")), - e.close(), - (t = e.parentWindow.Object), - (e = null), - t) - : ((e = c("iframe")), - (t = "java" + h + ":"), - (e.style.display = "none"), - u.appendChild(e), - (e.src = String(t)), - (t = e.contentWindow.document).open(), - t.write(p("document.F=Object")), - t.close(), - t.F); - for (var e, t, r = a.length; r--; ) delete m[d][a[r]]; - return m(); - }; - (l[f] = !0), - (t.exports = - Object.create || - function (e, t) { - var r; - return ( - null !== e - ? ((o[d] = s(e)), (r = new o()), (o[d] = null), (r[f] = e)) - : (r = m()), - void 0 === t ? r : i(r, t) - ); - }); - }, - { - "../internals/an-object": 10, - "../internals/document-create-element": 44, - "../internals/enum-bug-keys": 49, - "../internals/hidden-keys": 61, - "../internals/html": 63, - "../internals/object-define-properties": 91, - "../internals/shared-key": 118, - }, - ], - 91: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - i = e("../internals/object-define-property"), - a = e("../internals/an-object"), - l = e("../internals/object-keys"); - t.exports = o - ? Object.defineProperties - : function (e, t) { - a(e); - for (var r, o = l(t), n = o.length, s = 0; s < n; ) - i.f(e, (r = o[s++]), t[r]); - return e; - }; - }, - { - "../internals/an-object": 10, - "../internals/descriptors": 43, - "../internals/object-define-property": 92, - "../internals/object-keys": 99, - }, - ], - 92: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - n = e("../internals/ie8-dom-define"), - s = e("../internals/an-object"), - i = e("../internals/to-primitive"), - a = Object.defineProperty; - r.f = o - ? a - : function (e, t, r) { - if ((s(e), (t = i(t, !0)), s(r), n)) - try { - return a(e, t, r); - } catch (e) {} - if ("get" in r || "set" in r) - throw TypeError("Accessors not supported"); - return "value" in r && (e[t] = r.value), e; - }; - }, - { - "../internals/an-object": 10, - "../internals/descriptors": 43, - "../internals/ie8-dom-define": 64, - "../internals/to-primitive": 140, - }, - ], - 93: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - n = e("../internals/object-property-is-enumerable"), - s = e("../internals/create-property-descriptor"), - i = e("../internals/to-indexed-object"), - a = e("../internals/to-primitive"), - l = e("../internals/has"), - u = e("../internals/ie8-dom-define"), - c = Object.getOwnPropertyDescriptor; - r.f = o - ? c - : function (e, t) { - if (((e = i(e)), (t = a(t, !0)), u)) - try { - return c(e, t); - } catch (e) {} - if (l(e, t)) return s(!n.f.call(e, t), e[t]); - }; - }, - { - "../internals/create-property-descriptor": 39, - "../internals/descriptors": 43, - "../internals/has": 60, - "../internals/ie8-dom-define": 64, - "../internals/object-property-is-enumerable": 100, - "../internals/to-indexed-object": 134, - "../internals/to-primitive": 140, - }, - ], - 94: [ - function (e, t, r) { - var o = e("../internals/to-indexed-object"), - n = e("../internals/object-get-own-property-names").f, - s = {}.toString, - i = - "object" == typeof window && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) - : []; - t.exports.f = function (e) { - if (!i || "[object Window]" != s.call(e)) return n(o(e)); - try { - return n(e); - } catch (e) { - return i.slice(); - } - }; - }, - { - "../internals/object-get-own-property-names": 95, - "../internals/to-indexed-object": 134, - }, - ], - 95: [ - function (e, t, r) { - var o = e("../internals/object-keys-internal"), - n = e("../internals/enum-bug-keys").concat("length", "prototype"); - r.f = - Object.getOwnPropertyNames || - function (e) { - return o(e, n); - }; - }, - { - "../internals/enum-bug-keys": 49, - "../internals/object-keys-internal": 98, - }, - ], - 96: [ - function (e, t, r) { - r.f = Object.getOwnPropertySymbols; - }, - {}, - ], - 97: [ - function (e, t, r) { - var o = e("../internals/has"), - n = e("../internals/to-object"), - s = e("../internals/shared-key"), - e = e("../internals/correct-prototype-getter"), - i = s("IE_PROTO"), - a = Object.prototype; - t.exports = e - ? Object.getPrototypeOf - : function (e) { - return ( - (e = n(e)), - o(e, i) - ? e[i] - : "function" == typeof e.constructor && - e instanceof e.constructor - ? e.constructor.prototype - : e instanceof Object - ? a - : null - ); - }; - }, - { - "../internals/correct-prototype-getter": 35, - "../internals/has": 60, - "../internals/shared-key": 118, - "../internals/to-object": 137, - }, - ], - 98: [ - function (e, t, r) { - var i = e("../internals/has"), - a = e("../internals/to-indexed-object"), - l = e("../internals/array-includes").indexOf, - u = e("../internals/hidden-keys"); - t.exports = function (e, t) { - var r, - o = a(e), - n = 0, - s = []; - for (r in o) !i(u, r) && i(o, r) && s.push(r); - for (; t.length > n; ) !i(o, (r = t[n++])) || ~l(s, r) || s.push(r); - return s; - }; - }, - { - "../internals/array-includes": 18, - "../internals/has": 60, - "../internals/hidden-keys": 61, - "../internals/to-indexed-object": 134, - }, - ], - 99: [ - function (e, t, r) { - var o = e("../internals/object-keys-internal"), - n = e("../internals/enum-bug-keys"); - t.exports = - Object.keys || - function (e) { - return o(e, n); - }; - }, - { - "../internals/enum-bug-keys": 49, - "../internals/object-keys-internal": 98, - }, - ], - 100: [ - function (e, t, r) { - "use strict"; - var o = {}.propertyIsEnumerable, - n = Object.getOwnPropertyDescriptor, - s = n && !o.call({ 1: 2 }, 1); - r.f = s - ? function (e) { - e = n(this, e); - return !!e && e.enumerable; - } - : o; - }, - {}, - ], - 101: [ - function (e, t, r) { - var n = e("../internals/an-object"), - s = e("../internals/a-possible-prototype"); - t.exports = - Object.setPrototypeOf || - ("__proto__" in {} - ? (function () { - var r, - o = !1, - e = {}; - try { - (r = Object.getOwnPropertyDescriptor( - Object.prototype, - "__proto__", - ).set).call(e, []), - (o = e instanceof Array); - } catch (e) {} - return function (e, t) { - return n(e), s(t), o ? r.call(e, t) : (e.__proto__ = t), e; - }; - })() - : void 0); - }, - { - "../internals/a-possible-prototype": 6, - "../internals/an-object": 10, - }, - ], - 102: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/to-string-tag-support"), - n = e("../internals/classof"); - t.exports = o - ? {}.toString - : function () { - return "[object " + n(this) + "]"; - }; - }, - { - "../internals/classof": 29, - "../internals/to-string-tag-support": 141, - }, - ], - 103: [ - function (e, t, r) { - var o = e("../internals/get-built-in"), - n = e("../internals/object-get-own-property-names"), - s = e("../internals/object-get-own-property-symbols"), - i = e("../internals/an-object"); - t.exports = - o("Reflect", "ownKeys") || - function (e) { - var t = n.f(i(e)), - r = s.f; - return r ? t.concat(r(e)) : t; - }; - }, - { - "../internals/an-object": 10, - "../internals/get-built-in": 56, - "../internals/object-get-own-property-names": 95, - "../internals/object-get-own-property-symbols": 96, - }, - ], - 104: [ - function (e, t, r) { - e = e("../internals/global"); - t.exports = e; - }, - { "../internals/global": 59 }, - ], - 105: [ - function (e, t, r) { - t.exports = function (e) { - try { - return { error: !1, value: e() }; - } catch (e) { - return { error: !0, value: e }; - } - }; - }, - {}, - ], - 106: [ - function (e, t, r) { - var o = e("../internals/an-object"), - n = e("../internals/is-object"), - s = e("../internals/new-promise-capability"); - t.exports = function (e, t) { - return ( - o(e), - n(t) && t.constructor === e - ? t - : ((0, (e = s.f(e)).resolve)(t), e.promise) - ); - }; - }, - { - "../internals/an-object": 10, - "../internals/is-object": 74, - "../internals/new-promise-capability": 86, - }, - ], - 107: [ - function (e, t, r) { - var n = e("../internals/redefine"); - t.exports = function (e, t, r) { - for (var o in t) n(e, o, t[o], r); - return e; - }; - }, - { "../internals/redefine": 108 }, - ], - 108: [ - function (e, t, r) { - var i = e("../internals/global"), - a = e("../internals/create-non-enumerable-property"), - l = e("../internals/has"), - u = e("../internals/set-global"), - o = e("../internals/inspect-source"), - e = e("../internals/internal-state"), - n = e.get, - c = e.enforce, - d = String(String).split("String"); - (t.exports = function (e, t, r, o) { - var n = !!o && !!o.unsafe, - s = !!o && !!o.enumerable, - o = !!o && !!o.noTargetGet; - "function" == typeof r && - ("string" != typeof t || l(r, "name") || a(r, "name", t), - (c(r).source = d.join("string" == typeof t ? t : ""))), - e === i - ? s - ? (e[t] = r) - : u(t, r) - : (n ? !o && e[t] && (s = !0) : delete e[t], - s ? (e[t] = r) : a(e, t, r)); - })(Function.prototype, "toString", function () { - return ("function" == typeof this && n(this).source) || o(this); - }); - }, - { - "../internals/create-non-enumerable-property": 38, - "../internals/global": 59, - "../internals/has": 60, - "../internals/inspect-source": 68, - "../internals/internal-state": 70, - "../internals/set-global": 115, - }, - ], - 109: [ - function (e, t, r) { - var o = e("./classof-raw"), - n = e("./regexp-exec"); - t.exports = function (e, t) { - var r = e.exec; - if ("function" == typeof r) { - r = r.call(e, t); - if ("object" != typeof r) - throw TypeError( - "RegExp exec method returned something other than an Object or null", - ); - return r; - } - if ("RegExp" !== o(e)) - throw TypeError("RegExp#exec called on incompatible receiver"); - return n.call(e, t); - }; - }, - { "./classof-raw": 28, "./regexp-exec": 110 }, - ], - 110: [ - function (e, t, r) { - "use strict"; - var o, - n, - d = e("./regexp-flags"), - e = e("./regexp-sticky-helpers"), - h = RegExp.prototype.exec, - f = String.prototype.replace, - s = h, - p = - ((o = /a/), - (n = /b*/g), - h.call(o, "a"), - h.call(n, "a"), - 0 !== o.lastIndex || 0 !== n.lastIndex), - m = e.UNSUPPORTED_Y || e.BROKEN_CARET, - y = void 0 !== /()??/.exec("")[1]; - t.exports = s = - p || y || m - ? function (e) { - var t, - r, - o, - n, - s = this, - i = m && s.sticky, - a = d.call(s), - l = s.source, - u = 0, - c = e; - return ( - i && - (-1 === (a = a.replace("y", "")).indexOf("g") && - (a += "g"), - (c = String(e).slice(s.lastIndex)), - 0 < s.lastIndex && - (!s.multiline || - (s.multiline && "\n" !== e[s.lastIndex - 1])) && - ((l = "(?: " + l + ")"), (c = " " + c), u++), - (r = new RegExp("^(?:" + l + ")", a))), - y && (r = new RegExp("^" + l + "$(?!\\s)", a)), - p && (t = s.lastIndex), - (o = h.call(i ? r : s, c)), - i - ? o - ? ((o.input = o.input.slice(u)), - (o[0] = o[0].slice(u)), - (o.index = s.lastIndex), - (s.lastIndex += o[0].length)) - : (s.lastIndex = 0) - : p && - o && - (s.lastIndex = s.global ? o.index + o[0].length : t), - y && - o && - 1 < o.length && - f.call(o[0], r, function () { - for (n = 1; n < arguments.length - 2; n++) - void 0 === arguments[n] && (o[n] = void 0); - }), - o - ); - } - : s; - }, - { "./regexp-flags": 111, "./regexp-sticky-helpers": 112 }, - ], - 111: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/an-object"); - t.exports = function () { - var e = o(this), - t = ""; - return ( - e.global && (t += "g"), - e.ignoreCase && (t += "i"), - e.multiline && (t += "m"), - e.dotAll && (t += "s"), - e.unicode && (t += "u"), - e.sticky && (t += "y"), - t - ); - }; - }, - { "../internals/an-object": 10 }, - ], - 112: [ - function (e, t, r) { - "use strict"; - e = e("./fails"); - function o(e, t) { - return RegExp(e, t); - } - (r.UNSUPPORTED_Y = e(function () { - var e = o("a", "y"); - return (e.lastIndex = 2), null != e.exec("abcd"); - })), - (r.BROKEN_CARET = e(function () { - var e = o("^r", "gy"); - return (e.lastIndex = 2), null != e.exec("str"); - })); - }, - { "./fails": 51 }, - ], - 113: [ - function (e, t, r) { - t.exports = function (e) { - if (null == e) throw TypeError("Can't call method on " + e); - return e; - }; - }, - {}, - ], - 114: [ - function (e, t, r) { - t.exports = - Object.is || - function (e, t) { - return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t; - }; - }, - {}, - ], - 115: [ - function (e, t, r) { - var o = e("../internals/global"), - n = e("../internals/create-non-enumerable-property"); - t.exports = function (t, r) { - try { - n(o, t, r); - } catch (e) { - o[t] = r; - } - return r; - }; - }, - { - "../internals/create-non-enumerable-property": 38, - "../internals/global": 59, - }, - ], - 116: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/get-built-in"), - n = e("../internals/object-define-property"), - s = e("../internals/well-known-symbol"), - i = e("../internals/descriptors"), - a = s("species"); - t.exports = function (e) { - var e = o(e), - t = n.f; - i && - e && - !e[a] && - t(e, a, { - configurable: !0, - get: function () { - return this; - }, - }); - }; - }, - { - "../internals/descriptors": 43, - "../internals/get-built-in": 56, - "../internals/object-define-property": 92, - "../internals/well-known-symbol": 148, - }, - ], - 117: [ - function (e, t, r) { - var o = e("../internals/object-define-property").f, - n = e("../internals/has"), - s = e("../internals/well-known-symbol")("toStringTag"); - t.exports = function (e, t, r) { - e && - !n((e = r ? e : e.prototype), s) && - o(e, s, { configurable: !0, value: t }); - }; - }, - { - "../internals/has": 60, - "../internals/object-define-property": 92, - "../internals/well-known-symbol": 148, - }, - ], - 118: [ - function (e, t, r) { - var o = e("../internals/shared"), - n = e("../internals/uid"), - s = o("keys"); - t.exports = function (e) { - return s[e] || (s[e] = n(e)); - }; - }, - { "../internals/shared": 120, "../internals/uid": 145 }, - ], - 119: [ - function (e, t, r) { - var o = e("../internals/global"), - e = e("../internals/set-global"), - n = "__core-js_shared__", - o = o[n] || e(n, {}); - t.exports = o; - }, - { "../internals/global": 59, "../internals/set-global": 115 }, - ], - 120: [ - function (e, t, r) { - var o = e("../internals/is-pure"), - n = e("../internals/shared-store"); - (t.exports = function (e, t) { - return n[e] || (n[e] = void 0 !== t ? t : {}); - })("versions", []).push({ - version: "3.6.5", - mode: o ? "pure" : "global", - copyright: "© 2020 Denis Pushkarev (zloirock.ru)", - }); - }, - { "../internals/is-pure": 75, "../internals/shared-store": 119 }, - ], - 121: [ - function (e, t, r) { - var o = e("../internals/an-object"), - n = e("../internals/a-function"), - s = e("../internals/well-known-symbol")("species"); - t.exports = function (e, t) { - var e = o(e).constructor; - return void 0 === e || null == (e = o(e)[s]) ? t : n(e); - }; - }, - { - "../internals/a-function": 5, - "../internals/an-object": 10, - "../internals/well-known-symbol": 148, - }, - ], - 122: [ - function (e, t, r) { - var o = e("../internals/fails"); - t.exports = function (t) { - return o(function () { - var e = ""[t]('"'); - return e !== e.toLowerCase() || 3 < e.split('"').length; - }); - }; - }, - { "../internals/fails": 51 }, - ], - 123: [ - function (e, t, r) { - function o(n) { - return function (e, t) { - var r, - e = String(i(e)), - t = s(t), - o = e.length; - return t < 0 || o <= t - ? n - ? "" - : void 0 - : (r = e.charCodeAt(t)) < 55296 || - 56319 < r || - t + 1 === o || - (o = e.charCodeAt(t + 1)) < 56320 || - 57343 < o - ? n - ? e.charAt(t) - : r - : n - ? e.slice(t, t + 2) - : o - 56320 + ((r - 55296) << 10) + 65536; - }; - } - var s = e("../internals/to-integer"), - i = e("../internals/require-object-coercible"); - t.exports = { codeAt: o(!1), charAt: o(!0) }; - }, - { - "../internals/require-object-coercible": 113, - "../internals/to-integer": 135, - }, - ], - 124: [ - function (e, t, r) { - e = e("../internals/engine-user-agent"); - t.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test( - e, - ); - }, - { "../internals/engine-user-agent": 47 }, - ], - 125: [ - function (e, t, r) { - function o(n) { - return function (e, t, r) { - var e = String(a(e)), - o = e.length, - r = void 0 === r ? " " : String(r), - t = s(t); - return t <= o || "" == r - ? e - : ((o = i.call(r, l((t = t - o) / r.length))).length > t && - (o = o.slice(0, t)), - n ? e + o : o + e); - }; - } - var s = e("../internals/to-length"), - i = e("../internals/string-repeat"), - a = e("../internals/require-object-coercible"), - l = Math.ceil; - t.exports = { start: o(!1), end: o(!0) }; - }, - { - "../internals/require-object-coercible": 113, - "../internals/string-repeat": 127, - "../internals/to-length": 136, - }, - ], - 126: [ - function (e, t, r) { - "use strict"; - function g(e) { - return e + 22 + 75 * (e < 26); - } - function s(e) { - var t, - r = [], - o = (e = (function (e) { - for (var t = [], r = 0, o = e.length; r < o; ) { - var n, - s = e.charCodeAt(r++); - 55296 <= s && s <= 56319 && r < o - ? 56320 == (64512 & (n = e.charCodeAt(r++))) - ? t.push(((1023 & s) << 10) + (1023 & n) + 65536) - : (t.push(s), r--) - : t.push(s); - } - return t; - })(e)).length, - n = 128, - s = 0, - i = 72; - for (c = 0; c < e.length; c++) (t = e[c]) < 128 && r.push(M(t)); - var a = r.length, - l = a; - for (a && r.push("-"); l < o; ) { - for (var u = v, c = 0; c < e.length; c++) - n <= (t = e[c]) && t < u && (u = t); - var d = l + 1; - if (u - n > T((v - s) / d)) throw RangeError(w); - for (s += (u - n) * d, n = u, c = 0; c < e.length; c++) { - if ((t = e[c]) < n && ++s > v) throw RangeError(w); - if (t == n) { - for (var h = s, f = b; ; f += b) { - var p = f <= i ? 1 : i + j <= f ? j : f - i; - if (h < p) break; - var m = h - p, - y = b - p; - r.push(M(g(p + (m % y)))), (h = T(m / y)); - } - r.push(M(g(h))), - (i = (function (e, t, r) { - var o = 0; - for ( - e = r ? T(e / x) : e >> 1, e += T(e / t); - (S * j) >> 1 < e; - o += b - ) - e = T(e / S); - return T(o + ((S + 1) * e) / (e + _)); - })(s, d, l == a)), - (s = 0), - ++l; - } - } - ++s, ++n; - } - return r.join(""); - } - var v = 2147483647, - b = 36, - j = 26, - _ = 38, - x = 700, - i = /[^\0-\u007E]/, - a = /[.\u3002\uFF0E\uFF61]/g, - w = "Overflow: input needs wider integers to process", - S = b - 1, - T = Math.floor, - M = String.fromCharCode; - t.exports = function (e) { - for ( - var t, - r = [], - o = e.toLowerCase().replace(a, ".").split("."), - n = 0; - n < o.length; - n++ - ) - (t = o[n]), r.push(i.test(t) ? "xn--" + s(t) : t); - return r.join("."); - }; - }, - {}, - ], - 127: [ - function (e, t, r) { - "use strict"; - var n = e("../internals/to-integer"), - s = e("../internals/require-object-coercible"); - t.exports = - "".repeat || - function (e) { - var t = String(s(this)), - r = "", - o = n(e); - if (o < 0 || o == 1 / 0) - throw RangeError("Wrong number of repetitions"); - for (; 0 < o; (o >>>= 1) && (t += t)) 1 & o && (r += t); - return r; - }; - }, - { - "../internals/require-object-coercible": 113, - "../internals/to-integer": 135, - }, - ], - 128: [ - function (e, t, r) { - var o = e("../internals/fails"), - n = e("../internals/whitespaces"); - t.exports = function (e) { - return o(function () { - return !!n[e]() || "​…᠎" != "​…᠎"[e]() || n[e].name !== e; - }); - }; - }, - { "../internals/fails": 51, "../internals/whitespaces": 149 }, - ], - 129: [ - function (e, t, r) { - function o(t) { - return function (e) { - e = String(n(e)); - return ( - 1 & t && (e = e.replace(s, "")), - (e = 2 & t ? e.replace(i, "") : e) - ); - }; - } - var n = e("../internals/require-object-coercible"), - e = "[" + e("../internals/whitespaces") + "]", - s = RegExp("^" + e + e + "*"), - i = RegExp(e + e + "*$"); - t.exports = { start: o(1), end: o(2), trim: o(3) }; - }, - { - "../internals/require-object-coercible": 113, - "../internals/whitespaces": 149, - }, - ], - 130: [ - function (e, t, r) { - function o(e) { - return function () { - x(e); - }; - } - function n(e) { - x(e.data); - } - function s(e) { - a.postMessage(e + "", f.protocol + "//" + f.host); - } - var i, - a = e("../internals/global"), - l = e("../internals/fails"), - u = e("../internals/classof-raw"), - c = e("../internals/function-bind-context"), - d = e("../internals/html"), - h = e("../internals/document-create-element"), - e = e("../internals/engine-is-ios"), - f = a.location, - p = a.setImmediate, - m = a.clearImmediate, - y = a.process, - g = a.MessageChannel, - v = a.Dispatch, - b = 0, - j = {}, - _ = "onreadystatechange", - x = function (e) { - var t; - j.hasOwnProperty(e) && ((t = j[e]), delete j[e], t()); - }; - (p && m) || - ((p = function (e) { - for (var t = [], r = 1; r < arguments.length; ) - t.push(arguments[r++]); - return ( - (j[++b] = function () { - ("function" == typeof e ? e : Function(e)).apply(void 0, t); - }), - i(b), - b - ); - }), - (m = function (e) { - delete j[e]; - }), - "process" == u(y) - ? (i = function (e) { - y.nextTick(o(e)); - }) - : v && v.now - ? (i = function (e) { - v.now(o(e)); - }) - : g && !e - ? ((e = (u = new g()).port2), - (u.port1.onmessage = n), - (i = c(e.postMessage, e, 1))) - : !a.addEventListener || - "function" != typeof postMessage || - a.importScripts || - l(s) || - "file:" === f.protocol - ? (i = - _ in h("script") - ? function (e) { - d.appendChild(h("script"))[_] = function () { - d.removeChild(this), x(e); - }; - } - : function (e) { - setTimeout(o(e), 0); - }) - : ((i = s), a.addEventListener("message", n, !1))), - (t.exports = { set: p, clear: m }); - }, - { - "../internals/classof-raw": 28, - "../internals/document-create-element": 44, - "../internals/engine-is-ios": 46, - "../internals/fails": 51, - "../internals/function-bind-context": 54, - "../internals/global": 59, - "../internals/html": 63, - }, - ], - 131: [ - function (e, t, r) { - var o = e("../internals/classof-raw"); - t.exports = function (e) { - if ("number" != typeof e && "Number" != o(e)) - throw TypeError("Incorrect invocation"); - return +e; - }; - }, - { "../internals/classof-raw": 28 }, - ], - 132: [ - function (e, t, r) { - var o = e("../internals/to-integer"), - n = Math.max, - s = Math.min; - t.exports = function (e, t) { - e = o(e); - return e < 0 ? n(e + t, 0) : s(e, t); - }; - }, - { "../internals/to-integer": 135 }, - ], - 133: [ - function (e, t, r) { - var o = e("../internals/to-integer"), - n = e("../internals/to-length"); - t.exports = function (e) { - if (void 0 === e) return 0; - var e = o(e), - t = n(e); - if (e !== t) throw RangeError("Wrong length or index"); - return t; - }; - }, - { "../internals/to-integer": 135, "../internals/to-length": 136 }, - ], - 134: [ - function (e, t, r) { - var o = e("../internals/indexed-object"), - n = e("../internals/require-object-coercible"); - t.exports = function (e) { - return o(n(e)); - }; - }, - { - "../internals/indexed-object": 66, - "../internals/require-object-coercible": 113, - }, - ], - 135: [ - function (e, t, r) { - var o = Math.ceil, - n = Math.floor; - t.exports = function (e) { - return isNaN((e = +e)) ? 0 : (0 < e ? n : o)(e); - }; - }, - {}, - ], - 136: [ - function (e, t, r) { - var o = e("../internals/to-integer"), - n = Math.min; - t.exports = function (e) { - return 0 < e ? n(o(e), 9007199254740991) : 0; - }; - }, - { "../internals/to-integer": 135 }, - ], - 137: [ - function (e, t, r) { - var o = e("../internals/require-object-coercible"); - t.exports = function (e) { - return Object(o(e)); - }; - }, - { "../internals/require-object-coercible": 113 }, - ], - 138: [ - function (e, t, r) { - var o = e("../internals/to-positive-integer"); - t.exports = function (e, t) { - e = o(e); - if (e % t) throw RangeError("Wrong offset"); - return e; - }; - }, - { "../internals/to-positive-integer": 139 }, - ], - 139: [ - function (e, t, r) { - var o = e("../internals/to-integer"); - t.exports = function (e) { - e = o(e); - if (e < 0) throw RangeError("The argument can't be less than 0"); - return e; - }; - }, - { "../internals/to-integer": 135 }, - ], - 140: [ - function (e, t, r) { - var n = e("../internals/is-object"); - t.exports = function (e, t) { - if (!n(e)) return e; - var r, o; - if ( - (t && - "function" == typeof (r = e.toString) && - !n((o = r.call(e)))) || - ("function" == typeof (r = e.valueOf) && !n((o = r.call(e)))) || - (!t && - "function" == typeof (r = e.toString) && - !n((o = r.call(e)))) - ) - return o; - throw TypeError("Can't convert object to primitive value"); - }; - }, - { "../internals/is-object": 74 }, - ], - 141: [ - function (e, t, r) { - var o = {}; - (o[e("../internals/well-known-symbol")("toStringTag")] = "z"), - (t.exports = "[object z]" === String(o)); - }, - { "../internals/well-known-symbol": 148 }, - ], - 142: [ - function (e, t, D) { - "use strict"; - function f(e, t) { - for (var r = 0, o = t.length, n = new (Q(e))(o); r < o; ) - n[r] = t[r++]; - return n; - } - function r(e, t) { - M(e, t, { - get: function () { - return T(this)[t]; - }, - }); - } - function p(e) { - return ( - e instanceof k || - "ArrayBuffer" == (e = B(e)) || - "SharedArrayBuffer" == e - ); - } - function o(e, t) { - return ( - L(e) && "symbol" != typeof t && t in e && String(+t) == String(t) - ); - } - function n(e, t) { - return o(e, (t = d(t, !0))) ? U(2, e[t]) : X(e, t); - } - function s(e, t, r) { - return !(o(e, (t = d(t, !0))) && b(r) && h(r, "value")) || - h(r, "get") || - h(r, "set") || - r.configurable || - (h(r, "writable") && !r.writable) || - (h(r, "enumerable") && !r.enumerable) - ? M(e, t, r) - : ((e[t] = r.value), e); - } - var a = e("../internals/export"), - l = e("../internals/global"), - i = e("../internals/descriptors"), - F = e("../internals/typed-array-constructors-require-wrappers"), - u = e("../internals/array-buffer-view-core"), - c = e("../internals/array-buffer"), - m = e("../internals/an-instance"), - U = e("../internals/create-property-descriptor"), - y = e("../internals/create-non-enumerable-property"), - N = e("../internals/to-length"), - g = e("../internals/to-index"), - v = e("../internals/to-offset"), - d = e("../internals/to-primitive"), - h = e("../internals/has"), - B = e("../internals/classof"), - b = e("../internals/is-object"), - G = e("../internals/object-create"), - j = e("../internals/object-set-prototype-of"), - V = e("../internals/object-get-own-property-names").f, - _ = e("../internals/typed-array-from"), - z = e("../internals/array-iteration").forEach, - H = e("../internals/set-species"), - x = e("../internals/object-define-property"), - w = e("../internals/object-get-own-property-descriptor"), - S = e("../internals/internal-state"), - W = e("../internals/inherit-if-required"), - T = S.get, - q = S.set, - M = x.f, - X = w.f, - Y = Math.round, - E = l.RangeError, - k = c.ArrayBuffer, - Z = c.DataView, - C = u.NATIVE_ARRAY_BUFFER_VIEWS, - O = u.TYPED_ARRAY_TAG, - P = u.TypedArray, - A = u.TypedArrayPrototype, - Q = u.aTypedArrayConstructor, - L = u.isTypedArray, - R = "BYTES_PER_ELEMENT", - I = "Wrong length"; - i - ? (C || - ((w.f = n), - (x.f = s), - r(A, "buffer"), - r(A, "byteOffset"), - r(A, "byteLength"), - r(A, "length")), - a( - { target: "Object", stat: !0, forced: !C }, - { getOwnPropertyDescriptor: n, defineProperty: s }, - ), - (t.exports = function (e, t, n) { - function u(e, o) { - M(e, o, { - get: function () { - var e = this, - t = o; - return (e = T(e)).view[r](t * c + e.byteOffset, !0); - }, - set: function (e) { - var t = this, - r = o; - (t = T(t)), - n && (e = (e = Y(e)) < 0 ? 0 : 255 < e ? 255 : 255 & e), - t.view[s](r * c + t.byteOffset, e, !0); - }, - enumerable: !0, - }); - } - var c = e.match(/\d+$/)[0] / 8, - d = e + (n ? "Clamped" : "") + "Array", - r = "get" + e, - s = "set" + e, - i = l[d], - h = i, - e = h && h.prototype, - o = {}; - C - ? F && - ((h = t(function (e, t, r, o) { - return ( - m(e, h, d), - W( - b(t) - ? p(t) - ? void 0 !== o - ? new i(t, v(r, c), o) - : void 0 !== r - ? new i(t, v(r, c)) - : new i(t) - : L(t) - ? f(h, t) - : _.call(h, t) - : new i(g(t)), - e, - h, - ) - ); - })), - j && j(h, P), - z(V(i), function (e) { - e in h || y(h, e, i[e]); - }), - (h.prototype = e)) - : ((h = t(function (e, t, r, o) { - m(e, h, d); - var n, - s, - i = 0, - a = 0; - if (b(t)) { - if (!p(t)) return L(t) ? f(h, t) : _.call(h, t); - var l = t, - a = v(r, c), - r = t.byteLength; - if (void 0 === o) { - if (r % c) throw E(I); - if ((n = r - a) < 0) throw E(I); - } else if (r < (n = N(o) * c) + a) throw E(I); - s = n / c; - } else (s = g(t)), (l = new k((n = s * c))); - for ( - q(e, { - buffer: l, - byteOffset: a, - byteLength: n, - length: s, - view: new Z(l), - }); - i < s; - - ) - u(e, i++); - })), - j && j(h, P), - (e = h.prototype = G(A))), - e.constructor !== h && y(e, "constructor", h), - O && y(e, O, d), - (o[d] = h), - a({ global: !0, forced: h != i, sham: !C }, o), - R in h || y(h, R, c), - R in e || y(e, R, c), - H(d); - })) - : (t.exports = function () {}); - }, - { - "../internals/an-instance": 9, - "../internals/array-buffer": 13, - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - "../internals/classof": 29, - "../internals/create-non-enumerable-property": 38, - "../internals/create-property-descriptor": 39, - "../internals/descriptors": 43, - "../internals/export": 50, - "../internals/global": 59, - "../internals/has": 60, - "../internals/inherit-if-required": 67, - "../internals/internal-state": 70, - "../internals/is-object": 74, - "../internals/object-create": 90, - "../internals/object-define-property": 92, - "../internals/object-get-own-property-descriptor": 93, - "../internals/object-get-own-property-names": 95, - "../internals/object-set-prototype-of": 101, - "../internals/set-species": 116, - "../internals/to-index": 133, - "../internals/to-length": 136, - "../internals/to-offset": 138, - "../internals/to-primitive": 140, - "../internals/typed-array-constructors-require-wrappers": 143, - "../internals/typed-array-from": 144, - }, - ], - 143: [ - function (e, t, r) { - var o = e("../internals/global"), - n = e("../internals/fails"), - s = e("../internals/check-correctness-of-iteration"), - e = e( - "../internals/array-buffer-view-core", - ).NATIVE_ARRAY_BUFFER_VIEWS, - i = o.ArrayBuffer, - a = o.Int8Array; - t.exports = - !e || - !n(function () { - a(1); - }) || - !n(function () { - new a(-1); - }) || - !s(function (e) { - new a(), new a(null), new a(1.5), new a(e); - }, !0) || - n(function () { - return 1 !== new a(new i(2), 1, void 0).length; - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/check-correctness-of-iteration": 27, - "../internals/fails": 51, - "../internals/global": 59, - }, - ], - 144: [ - function (e, t, r) { - var h = e("../internals/to-object"), - f = e("../internals/to-length"), - p = e("../internals/get-iterator-method"), - m = e("../internals/is-array-iterator-method"), - y = e("../internals/function-bind-context"), - g = e("../internals/array-buffer-view-core").aTypedArrayConstructor; - t.exports = function (e) { - var t, - r, - o, - n, - s, - i, - a = h(e), - l = arguments.length, - u = 1 < l ? arguments[1] : void 0, - c = void 0 !== u, - d = p(a); - if (null != d && !m(d)) - for (i = (s = d.call(a)).next, a = []; !(n = i.call(s)).done; ) - a.push(n.value); - for ( - c && 2 < l && (u = y(u, arguments[2], 2)), - r = f(a.length), - o = new (g(this))(r), - t = 0; - t < r; - t++ - ) - o[t] = c ? u(a[t], t) : a[t]; - return o; - }; - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/function-bind-context": 54, - "../internals/get-iterator-method": 57, - "../internals/is-array-iterator-method": 71, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 145: [ - function (e, t, r) { - var o = 0, - n = Math.random(); - t.exports = function (e) { - return ( - "Symbol(" + - String(void 0 === e ? "" : e) + - ")_" + - (++o + n).toString(36) - ); - }; - }, - {}, - ], - 146: [ - function (e, t, r) { - e = e("../internals/native-symbol"); - t.exports = e && !Symbol.sham && "symbol" == typeof Symbol.iterator; - }, - { "../internals/native-symbol": 83 }, - ], - 147: [ - function (e, t, r) { - e = e("../internals/well-known-symbol"); - r.f = e; - }, - { "../internals/well-known-symbol": 148 }, - ], - 148: [ - function (e, t, r) { - var o = e("../internals/global"), - n = e("../internals/shared"), - s = e("../internals/has"), - i = e("../internals/uid"), - a = e("../internals/native-symbol"), - e = e("../internals/use-symbol-as-uid"), - l = n("wks"), - u = o.Symbol, - c = e ? u : (u && u.withoutSetter) || i; - t.exports = function (e) { - return ( - s(l, e) || - (a && s(u, e) ? (l[e] = u[e]) : (l[e] = c("Symbol." + e))), - l[e] - ); - }; - }, - { - "../internals/global": 59, - "../internals/has": 60, - "../internals/native-symbol": 83, - "../internals/shared": 120, - "../internals/uid": 145, - "../internals/use-symbol-as-uid": 146, - }, - ], - 149: [ - function (e, t, r) { - t.exports = "\t\n\v\f\r                 \u2028\u2029\ufeff"; - }, - {}, - ], - 150: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/global"), - s = e("../internals/array-buffer"), - e = e("../internals/set-species"), - i = "ArrayBuffer", - s = s[i]; - o({ global: !0, forced: n[i] !== s }, { ArrayBuffer: s }), e(i); - }, - { - "../internals/array-buffer": 13, - "../internals/export": 50, - "../internals/global": 59, - "../internals/set-species": 116, - }, - ], - 151: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/fails"), - d = e("../internals/is-array"), - h = e("../internals/is-object"), - f = e("../internals/to-object"), - p = e("../internals/to-length"), - m = e("../internals/create-property"), - y = e("../internals/array-species-create"), - s = e("../internals/array-method-has-species-support"), - i = e("../internals/well-known-symbol"), - e = e("../internals/engine-v8-version"), - g = i("isConcatSpreadable"), - v = 9007199254740991, - b = "Maximum allowed index exceeded", - i = - 51 <= e || - !n(function () { - var e = []; - return (e[g] = !1), e.concat()[0] !== e; - }), - e = s("concat"); - o( - { target: "Array", proto: !0, forced: !i || !e }, - { - concat: function (e) { - for ( - var t, - r, - o, - n, - s, - i = f(this), - a = y(i, 0), - l = 0, - u = -1, - c = arguments.length; - u < c; - u++ - ) - if ( - ((s = void 0), - !h((n = o = -1 === u ? i : arguments[u])) || - (void 0 !== (s = n[g]) ? !s : !d(n))) - ) { - if (v <= l) throw TypeError(b); - m(a, l++, o); - } else { - if (((r = p(o.length)), v < l + r)) throw TypeError(b); - for (t = 0; t < r; t++, l++) t in o && m(a, l, o[t]); - } - return (a.length = l), a; - }, - }, - ); - }, - { - "../internals/array-method-has-species-support": 21, - "../internals/array-species-create": 25, - "../internals/create-property": 40, - "../internals/engine-v8-version": 48, - "../internals/export": 50, - "../internals/fails": 51, - "../internals/is-array": 72, - "../internals/is-object": 74, - "../internals/to-length": 136, - "../internals/to-object": 137, - "../internals/well-known-symbol": 148, - }, - ], - 152: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/array-copy-within"), - e = e("../internals/add-to-unscopables"); - o({ target: "Array", proto: !0 }, { copyWithin: n }), e("copyWithin"); - }, - { - "../internals/add-to-unscopables": 7, - "../internals/array-copy-within": 14, - "../internals/export": 50, - }, - ], - 153: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-iteration").every, - s = e("../internals/array-method-is-strict"), - e = e("../internals/array-method-uses-to-length"), - s = s("every"), - e = e("every"); - o( - { target: "Array", proto: !0, forced: !s || !e }, - { - every: function (e) { - return n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ); - }, - { - "../internals/array-iteration": 19, - "../internals/array-method-is-strict": 22, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 154: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/array-fill"), - e = e("../internals/add-to-unscopables"); - o({ target: "Array", proto: !0 }, { fill: n }), e("fill"); - }, - { - "../internals/add-to-unscopables": 7, - "../internals/array-fill": 15, - "../internals/export": 50, - }, - ], - 155: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-iteration").filter, - s = e("../internals/array-method-has-species-support"), - e = e("../internals/array-method-uses-to-length"), - s = s("filter"), - e = e("filter"); - o( - { target: "Array", proto: !0, forced: !s || !e }, - { - filter: function (e) { - return n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ); - }, - { - "../internals/array-iteration": 19, - "../internals/array-method-has-species-support": 21, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 156: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-iteration").findIndex, - s = e("../internals/add-to-unscopables"), - e = e("../internals/array-method-uses-to-length"), - i = "findIndex", - a = !0, - e = e(i); - i in [] && - Array(1)[i](function () { - a = !1; - }), - o( - { target: "Array", proto: !0, forced: a || !e }, - { - findIndex: function (e) { - return n( - this, - e, - 1 < arguments.length ? arguments[1] : void 0, - ); - }, - }, - ), - s(i); - }, - { - "../internals/add-to-unscopables": 7, - "../internals/array-iteration": 19, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 157: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - e = e("../internals/array-for-each"); - o( - { target: "Array", proto: !0, forced: [].forEach != e }, - { forEach: e }, - ); - }, - { "../internals/array-for-each": 16, "../internals/export": 50 }, - ], - 158: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/array-from"); - o( - { - target: "Array", - stat: !0, - forced: !e("../internals/check-correctness-of-iteration")( - function (e) { - Array.from(e); - }, - ), - }, - { from: n }, - ); - }, - { - "../internals/array-from": 17, - "../internals/check-correctness-of-iteration": 27, - "../internals/export": 50, - }, - ], - 159: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-includes").includes, - s = e("../internals/add-to-unscopables"); - o( - { - target: "Array", - proto: !0, - forced: !e("../internals/array-method-uses-to-length")( - "indexOf", - { ACCESSORS: !0, 1: 0 }, - ), - }, - { - includes: function (e) { - return n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ), - s("includes"); - }, - { - "../internals/add-to-unscopables": 7, - "../internals/array-includes": 18, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 160: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-includes").indexOf, - s = e("../internals/array-method-is-strict"), - e = e("../internals/array-method-uses-to-length"), - i = [].indexOf, - a = !!i && 1 / [1].indexOf(1, -0) < 0, - s = s("indexOf"), - e = e("indexOf", { ACCESSORS: !0, 1: 0 }); - o( - { target: "Array", proto: !0, forced: a || !s || !e }, - { - indexOf: function (e) { - return a - ? i.apply(this, arguments) || 0 - : n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ); - }, - { - "../internals/array-includes": 18, - "../internals/array-method-is-strict": 22, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 161: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/to-indexed-object"), - n = e("../internals/add-to-unscopables"), - s = e("../internals/iterators"), - i = e("../internals/internal-state"), - e = e("../internals/define-iterator"), - a = "Array Iterator", - l = i.set, - u = i.getterFor(a); - (t.exports = e( - Array, - "Array", - function (e, t) { - l(this, { type: a, target: o(e), index: 0, kind: t }); - }, - function () { - var e = u(this), - t = e.target, - r = e.kind, - o = e.index++; - return !t || o >= t.length - ? { value: (e.target = void 0), done: !0 } - : "keys" == r - ? { value: o, done: !1 } - : "values" == r - ? { value: t[o], done: !1 } - : { value: [o, t[o]], done: !1 }; - }, - "values", - )), - (s.Arguments = s.Array), - n("keys"), - n("values"), - n("entries"); - }, - { - "../internals/add-to-unscopables": 7, - "../internals/define-iterator": 41, - "../internals/internal-state": 70, - "../internals/iterators": 79, - "../internals/to-indexed-object": 134, - }, - ], - 162: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/indexed-object"), - s = e("../internals/to-indexed-object"), - e = e("../internals/array-method-is-strict"), - i = [].join, - n = n != Object, - e = e("join", ","); - o( - { target: "Array", proto: !0, forced: n || !e }, - { - join: function (e) { - return i.call(s(this), void 0 === e ? "," : e); - }, - }, - ); - }, - { - "../internals/array-method-is-strict": 22, - "../internals/export": 50, - "../internals/indexed-object": 66, - "../internals/to-indexed-object": 134, - }, - ], - 163: [ - function (e, t, r) { - var o = e("../internals/export"), - e = e("../internals/array-last-index-of"); - o( - { target: "Array", proto: !0, forced: e !== [].lastIndexOf }, - { lastIndexOf: e }, - ); - }, - { "../internals/array-last-index-of": 20, "../internals/export": 50 }, - ], - 164: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-iteration").map, - s = e("../internals/array-method-has-species-support"), - e = e("../internals/array-method-uses-to-length"), - s = s("map"), - e = e("map"); - o( - { target: "Array", proto: !0, forced: !s || !e }, - { - map: function (e) { - return n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ); - }, - { - "../internals/array-iteration": 19, - "../internals/array-method-has-species-support": 21, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 165: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - u = e("../internals/is-object"), - c = e("../internals/is-array"), - d = e("../internals/to-absolute-index"), - h = e("../internals/to-length"), - f = e("../internals/to-indexed-object"), - p = e("../internals/create-property"), - n = e("../internals/well-known-symbol"), - s = e("../internals/array-method-has-species-support"), - e = e("../internals/array-method-uses-to-length"), - s = s("slice"), - e = e("slice", { ACCESSORS: !0, 0: 0, 1: 2 }), - m = n("species"), - y = [].slice, - g = Math.max; - o( - { target: "Array", proto: !0, forced: !s || !e }, - { - slice: function (e, t) { - var r, - o, - n, - s = f(this), - i = h(s.length), - a = d(e, i), - l = d(void 0 === t ? i : t, i); - if ( - c(s) && - ((r = - ("function" == typeof (r = s.constructor) && - (r === Array || c(r.prototype))) || - (u(r) && null === (r = r[m])) - ? void 0 - : r) === Array || - void 0 === r) - ) - return y.call(s, a, l); - for ( - o = new (void 0 === r ? Array : r)(g(l - a, 0)), n = 0; - a < l; - a++, n++ - ) - a in s && p(o, n, s[a]); - return (o.length = n), o; - }, - }, - ); - }, - { - "../internals/array-method-has-species-support": 21, - "../internals/array-method-uses-to-length": 23, - "../internals/create-property": 40, - "../internals/export": 50, - "../internals/is-array": 72, - "../internals/is-object": 74, - "../internals/to-absolute-index": 132, - "../internals/to-indexed-object": 134, - "../internals/to-length": 136, - "../internals/well-known-symbol": 148, - }, - ], - 166: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/array-iteration").some, - s = e("../internals/array-method-is-strict"), - e = e("../internals/array-method-uses-to-length"), - s = s("some"), - e = e("some"); - o( - { target: "Array", proto: !0, forced: !s || !e }, - { - some: function (e) { - return n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ); - }, - { - "../internals/array-iteration": 19, - "../internals/array-method-is-strict": 22, - "../internals/array-method-uses-to-length": 23, - "../internals/export": 50, - }, - ], - 167: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - d = e("../internals/to-absolute-index"), - h = e("../internals/to-integer"), - f = e("../internals/to-length"), - p = e("../internals/to-object"), - m = e("../internals/array-species-create"), - y = e("../internals/create-property"), - n = e("../internals/array-method-has-species-support"), - e = e("../internals/array-method-uses-to-length"), - n = n("splice"), - e = e("splice", { ACCESSORS: !0, 0: 0, 1: 2 }), - g = Math.max, - v = Math.min; - o( - { target: "Array", proto: !0, forced: !n || !e }, - { - splice: function (e, t) { - var r, - o, - n, - s, - i, - a, - l = p(this), - u = f(l.length), - c = d(e, u), - e = arguments.length; - if ( - (0 === e - ? (r = o = 0) - : (o = - 1 === e - ? ((r = 0), u - c) - : ((r = e - 2), v(g(h(t), 0), u - c))), - 9007199254740991 < u + r - o) - ) - throw TypeError("Maximum allowed length exceeded"); - for (n = m(l, o), s = 0; s < o; s++) - (i = c + s) in l && y(n, s, l[i]); - if (r < (n.length = o)) { - for (s = c; s < u - o; s++) - (a = s + r), (i = s + o) in l ? (l[a] = l[i]) : delete l[a]; - for (s = u; u - o + r < s; s--) delete l[s - 1]; - } else if (o < r) - for (s = u - o; c < s; s--) - (a = s + r - 1), - (i = s + o - 1) in l ? (l[a] = l[i]) : delete l[a]; - for (s = 0; s < r; s++) l[s + c] = arguments[s + 2]; - return (l.length = u - o + r), n; - }, - }, - ); - }, - { - "../internals/array-method-has-species-support": 21, - "../internals/array-method-uses-to-length": 23, - "../internals/array-species-create": 25, - "../internals/create-property": 40, - "../internals/export": 50, - "../internals/to-absolute-index": 132, - "../internals/to-integer": 135, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 168: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - e = e("../internals/object-define-property").f, - n = Function.prototype, - s = n.toString, - i = /^\s*function ([^ (]*)/; - !o || - "name" in n || - e(n, "name", { - configurable: !0, - get: function () { - try { - return s.call(this).match(i)[1]; - } catch (e) { - return ""; - } - }, - }); - }, - { - "../internals/descriptors": 43, - "../internals/object-define-property": 92, - }, - ], - 169: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/collection"), - e = e("../internals/collection-strong"); - t.exports = o( - "Map", - function (e) { - return function () { - return e(this, arguments.length ? arguments[0] : void 0); - }; - }, - e, - ); - }, - { "../internals/collection": 32, "../internals/collection-strong": 30 }, - ], - 170: [ - function (e, t, r) { - var e = e("../internals/export"), - o = Math.hypot, - l = Math.abs, - u = Math.sqrt; - e( - { - target: "Math", - stat: !0, - forced: !!o && o(1 / 0, NaN) !== 1 / 0, - }, - { - hypot: function (e, t) { - for ( - var r, o, n = 0, s = 0, i = arguments.length, a = 0; - s < i; - - ) - a < (r = l(arguments[s++])) - ? ((n = n * (o = a / r) * o + 1), (a = r)) - : (n += 0 < r ? (o = r / a) * o : r); - return a === 1 / 0 ? 1 / 0 : a * u(n); - }, - }, - ); - }, - { "../internals/export": 50 }, - ], - 171: [ - function (e, t, r) { - var e = e("../internals/export"), - o = Math.log, - n = Math.LN2; - e( - { target: "Math", stat: !0 }, - { - log2: function (e) { - return o(e) / n; - }, - }, - ); - }, - { "../internals/export": 50 }, - ], - 172: [ - function (e, t, r) { - e("../internals/export")( - { target: "Math", stat: !0 }, - { sign: e("../internals/math-sign") }, - ); - }, - { "../internals/export": 50, "../internals/math-sign": 80 }, - ], - 173: [ - function (e, t, r) { - "use strict"; - function o(e) { - var t, - r, - o, - n, - s, - i, - a, - l = d(e, !1); - if ("string" == typeof l && 2 < l.length) - if (43 === (e = (l = g(l)).charCodeAt(0)) || 45 === e) { - if (88 === (t = l.charCodeAt(2)) || 120 === t) return NaN; - } else if (48 === e) { - switch (l.charCodeAt(1)) { - case 66: - case 98: - (r = 2), (o = 49); - break; - case 79: - case 111: - (r = 8), (o = 55); - break; - default: - return +l; - } - for (s = (n = l.slice(2)).length, i = 0; i < s; i++) - if ((a = n.charCodeAt(i)) < 48 || o < a) return NaN; - return parseInt(n, r); - } - return +l; - } - var n = e("../internals/descriptors"), - s = e("../internals/global"), - i = e("../internals/is-forced"), - a = e("../internals/redefine"), - l = e("../internals/has"), - u = e("../internals/classof-raw"), - c = e("../internals/inherit-if-required"), - d = e("../internals/to-primitive"), - h = e("../internals/fails"), - f = e("../internals/object-create"), - p = e("../internals/object-get-own-property-names").f, - m = e("../internals/object-get-own-property-descriptor").f, - y = e("../internals/object-define-property").f, - g = e("../internals/string-trim").trim, - v = "Number", - b = s[v], - j = b.prototype, - _ = u(f(j)) == v; - if (i(v, !b(" 0o1") || !b("0b1") || b("+0x1"))) { - for ( - var x, - w = function (e) { - var e = arguments.length < 1 ? 0 : e, - t = this; - return t instanceof w && - (_ - ? h(function () { - j.valueOf.call(t); - }) - : u(t) != v) - ? c(new b(o(e)), t, w) - : o(e); - }, - S = n - ? p(b) - : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split( - ",", - ), - T = 0; - S.length > T; - T++ - ) - l(b, (x = S[T])) && !l(w, x) && y(w, x, m(b, x)); - ((w.prototype = j).constructor = w), a(s, v, w); - } - }, - { - "../internals/classof-raw": 28, - "../internals/descriptors": 43, - "../internals/fails": 51, - "../internals/global": 59, - "../internals/has": 60, - "../internals/inherit-if-required": 67, - "../internals/is-forced": 73, - "../internals/object-create": 90, - "../internals/object-define-property": 92, - "../internals/object-get-own-property-descriptor": 93, - "../internals/object-get-own-property-names": 95, - "../internals/redefine": 108, - "../internals/string-trim": 129, - "../internals/to-primitive": 140, - }, - ], - 174: [ - function (e, t, r) { - e("../internals/export")( - { target: "Number", stat: !0 }, - { isFinite: e("../internals/number-is-finite") }, - ); - }, - { "../internals/export": 50, "../internals/number-is-finite": 88 }, - ], - 175: [ - function (e, t, r) { - "use strict"; - function c(e, t, r) { - return 0 === t - ? r - : t % 2 == 1 - ? c(e, t - 1, r * e) - : c(e * e, t / 2, r); - } - var o = e("../internals/export"), - d = e("../internals/to-integer"), - h = e("../internals/this-number-value"), - f = e("../internals/string-repeat"), - e = e("../internals/fails"), - n = (1).toFixed, - p = Math.floor; - o( - { - target: "Number", - proto: !0, - forced: - (n && - ("0.000" !== (8e-5).toFixed(3) || - "1" !== (0.9).toFixed(0) || - "1.25" !== (1.255).toFixed(2) || - "1000000000000000128" !== - (0xde0b6b3a7640080).toFixed(0))) || - !e(function () { - n.call({}); - }), - }, - { - toFixed: function (e) { - function t(e, t) { - for (var r = -1, o = t; ++r < 6; ) - (o += e * a[r]), (a[r] = o % 1e7), (o = p(o / 1e7)); - } - function r(e) { - for (var t = 6, r = 0; 0 <= --t; ) - (r += a[t]), (a[t] = p(r / e)), (r = (r % e) * 1e7); - } - function o() { - for (var e, t = 6, r = ""; 0 <= --t; ) - ("" === r && 0 !== t && 0 === a[t]) || - ((e = String(a[t])), - (r = "" === r ? e : r + f.call("0", 7 - e.length) + e)); - return r; - } - var n, - s, - i = h(this), - e = d(e), - a = [0, 0, 0, 0, 0, 0], - l = "", - u = "0"; - if (e < 0 || 20 < e) - throw RangeError("Incorrect fraction digits"); - if (i != i) return "NaN"; - if (i <= -1e21 || 1e21 <= i) return String(i); - if ((i < 0 && ((l = "-"), (i = -i)), 1e-21 < i)) - if ( - ((i = - (n = - (function (e) { - for (var t = 0, r = e; 4096 <= r; ) - (t += 12), (r /= 4096); - for (; 2 <= r; ) (t += 1), (r /= 2); - return t; - })(i * c(2, 69, 1)) - 69) < 0 - ? i * c(2, -n, 1) - : i / c(2, n, 1)), - (i *= 4503599627370496), - 0 < (n = 52 - n)) - ) { - for (t(0, i), s = e; 7 <= s; ) t(1e7, 0), (s -= 7); - for (t(c(10, s, 1), 0), s = n - 1; 23 <= s; ) - r(1 << 23), (s -= 23); - r(1 << s), t(1, 1), r(2), (u = o()); - } else t(0, i), t(1 << -n, 0), (u = o() + f.call("0", e)); - return (u = - 0 < e - ? l + - ((i = u.length) <= e - ? "0." + f.call("0", e - i) + u - : u.slice(0, i - e) + "." + u.slice(i - e)) - : l + u); - }, - }, - ); - }, - { - "../internals/export": 50, - "../internals/fails": 51, - "../internals/string-repeat": 127, - "../internals/this-number-value": 131, - "../internals/to-integer": 135, - }, - ], - 176: [ - function (e, t, r) { - var o = e("../internals/export"), - e = e("../internals/object-assign"); - o( - { target: "Object", stat: !0, forced: Object.assign !== e }, - { assign: e }, - ); - }, - { "../internals/export": 50, "../internals/object-assign": 89 }, - ], - 177: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/iterate"), - s = e("../internals/create-property"); - o( - { target: "Object", stat: !0 }, - { - fromEntries: function (e) { - var r = {}; - return ( - n( - e, - function (e, t) { - s(r, e, t); - }, - void 0, - !0, - ), - r - ); - }, - }, - ); - }, - { - "../internals/create-property": 40, - "../internals/export": 50, - "../internals/iterate": 77, - }, - ], - 178: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/fails"), - s = e("../internals/to-indexed-object"), - i = e("../internals/object-get-own-property-descriptor").f, - e = e("../internals/descriptors"), - n = n(function () { - i(1); - }); - o( - { target: "Object", stat: !0, forced: !e || n, sham: !e }, - { - getOwnPropertyDescriptor: function (e, t) { - return i(s(e), t); - }, - }, - ); - }, - { - "../internals/descriptors": 43, - "../internals/export": 50, - "../internals/fails": 51, - "../internals/object-get-own-property-descriptor": 93, - "../internals/to-indexed-object": 134, - }, - ], - 179: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/fails"), - e = e("../internals/object-get-own-property-names-external").f; - o( - { - target: "Object", - stat: !0, - forced: n(function () { - return !Object.getOwnPropertyNames(1); - }), - }, - { getOwnPropertyNames: e }, - ); - }, - { - "../internals/export": 50, - "../internals/fails": 51, - "../internals/object-get-own-property-names-external": 94, - }, - ], - 180: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/fails"), - s = e("../internals/to-object"), - i = e("../internals/object-get-prototype-of"), - e = e("../internals/correct-prototype-getter"); - o( - { - target: "Object", - stat: !0, - forced: n(function () { - i(1); - }), - sham: !e, - }, - { - getPrototypeOf: function (e) { - return i(s(e)); - }, - }, - ); - }, - { - "../internals/correct-prototype-getter": 35, - "../internals/export": 50, - "../internals/fails": 51, - "../internals/object-get-prototype-of": 97, - "../internals/to-object": 137, - }, - ], - 181: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/to-object"), - s = e("../internals/object-keys"); - o( - { - target: "Object", - stat: !0, - forced: e("../internals/fails")(function () { - s(1); - }), - }, - { - keys: function (e) { - return s(n(e)); - }, - }, - ); - }, - { - "../internals/export": 50, - "../internals/fails": 51, - "../internals/object-keys": 99, - "../internals/to-object": 137, - }, - ], - 182: [ - function (e, t, r) { - var o = e("../internals/to-string-tag-support"), - n = e("../internals/redefine"), - e = e("../internals/object-to-string"); - o || n(Object.prototype, "toString", e, { unsafe: !0 }); - }, - { - "../internals/object-to-string": 102, - "../internals/redefine": 108, - "../internals/to-string-tag-support": 141, - }, - ], - 183: [ - function (e, D, F) { - "use strict"; - var r, - t, - o, - n, - s = e("../internals/export"), - i = e("../internals/is-pure"), - g = e("../internals/global"), - a = e("../internals/get-built-in"), - l = e("../internals/native-promise-constructor"), - U = e("../internals/redefine"), - N = e("../internals/redefine-all"), - B = e("../internals/set-to-string-tag"), - G = e("../internals/set-species"), - V = e("../internals/is-object"), - c = e("../internals/a-function"), - z = e("../internals/an-instance"), - H = e("../internals/classof-raw"), - W = e("../internals/inspect-source"), - d = e("../internals/iterate"), - q = e("../internals/check-correctness-of-iteration"), - X = e("../internals/species-constructor"), - v = e("../internals/task").set, - u = e("../internals/microtask"), - h = e("../internals/promise-resolve"), - Y = e("../internals/host-report-errors"), - f = e("../internals/new-promise-capability"), - b = e("../internals/perform"), - p = e("../internals/internal-state"), - Z = e("../internals/is-forced"), - m = e("../internals/well-known-symbol"), - y = e("../internals/engine-v8-version"), - Q = m("species"), - j = "Promise", - _ = p.get, - J = p.set, - K = p.getterFor(j), - x = l, - w = g.TypeError, - S = g.document, - T = g.process, - M = a("fetch"), - E = f.f, - $ = E, - k = "process" == H(T), - ee = !!(S && S.createEvent && g.dispatchEvent), - C = "unhandledrejection", - te = "rejectionhandled", - O = 1, - re = 2, - P = 1, - oe = 2, - e = Z(j, function () { - var e, t; - if (!(W(x) !== String(x))) { - if (66 === y) return !0; - if (!k && "function" != typeof PromiseRejectionEvent) return !0; - } - return ( - !(!i || x.prototype.finally) || - (!(51 <= y && /native code/.test(x)) && - ((t = function (e) { - e( - function () {}, - function () {}, - ); - }), - (((e = x.resolve(1)).constructor = {})[Q] = t), - !(e.then(function () {}) instanceof t))) - ); - }), - m = - e || - !q(function (e) { - x.all(e).catch(function () {}); - }), - ne = function (e) { - var t; - return !(!V(e) || "function" != typeof (t = e.then)) && t; - }, - A = function (f, p, m) { - var y; - p.notified || - ((p.notified = !0), - (y = p.reactions), - u(function () { - for ( - var r, o, e = p.value, t = p.state == O, n = 0; - y.length > n; - - ) { - var s, - i, - a, - l = y[n++], - u = t ? l.ok : l.fail, - c = l.resolve, - d = l.reject, - h = l.domain; - try { - u - ? (t || - (p.rejection === oe && - (function (e, t) { - v.call(g, function () { - if (k) T.emit("rejectionHandled", e); - else se(te, e, t.value); - }); - })(f, p), - (p.rejection = P)), - !0 === u - ? (s = e) - : (h && h.enter(), - (s = u(e)), - h && (h.exit(), (a = !0))), - s === l.promise - ? d(w("Promise-chain cycle")) - : (i = ne(s)) - ? i.call(s, c, d) - : c(s)) - : d(e); - } catch (e) { - h && !a && h.exit(), d(e); - } - } - (p.reactions = []), - (p.notified = !1), - m && - !p.rejection && - ((r = f), - (o = p), - v.call(g, function () { - var e = o.value, - t = ie(o); - if ( - t && - ((t = b(function () { - k - ? T.emit("unhandledRejection", e, r) - : se(C, r, e); - })), - (o.rejection = k || ie(o) ? oe : P), - t.error) - ) - throw t.value; - })); - })); - }, - se = function (e, t, r) { - var o; - ee - ? (((o = S.createEvent("Event")).promise = t), - (o.reason = r), - o.initEvent(e, !1, !0), - g.dispatchEvent(o)) - : (o = { promise: t, reason: r }), - (t = g["on" + e]) - ? t(o) - : e === C && Y("Unhandled promise rejection", r); - }, - ie = function (e) { - return e.rejection !== P && !e.parent; - }, - L = function (t, r, o, n) { - return function (e) { - t(r, o, e, n); - }; - }, - R = function (e, t, r, o) { - t.done || - ((t.done = !0), - ((t = o ? o : t).value = r), - (t.state = re), - A(e, t, !0)); - }, - I = function (r, o, e, t) { - if (!o.done) { - (o.done = !0), t && (o = t); - try { - if (r === e) throw w("Promise can't be resolved itself"); - var n = ne(e); - n - ? u(function () { - var t = { done: !1 }; - try { - n.call(e, L(I, r, t, o), L(R, r, t, o)); - } catch (e) { - R(r, t, e, o); - } - }) - : ((o.value = e), (o.state = O), A(r, o, !1)); - } catch (e) { - R(r, { done: !1 }, e, o); - } - } - }; - e && - ((x = function (e) { - z(this, x, j), c(e), r.call(this); - var t = _(this); - try { - e(L(I, this, t), L(R, this, t)); - } catch (e) { - R(this, t, e); - } - }), - ((r = function (e) { - J(this, { - type: j, - done: !1, - notified: !1, - parent: !1, - reactions: [], - rejection: !1, - state: 0, - value: void 0, - }); - }).prototype = N(x.prototype, { - then: function (e, t) { - var r = K(this), - o = E(X(this, x)); - return ( - (o.ok = "function" != typeof e || e), - (o.fail = "function" == typeof t && t), - (o.domain = k ? T.domain : void 0), - (r.parent = !0), - r.reactions.push(o), - 0 != r.state && A(this, r, !1), - o.promise - ); - }, - catch: function (e) { - return this.then(void 0, e); - }, - })), - (t = function () { - var e = new r(), - t = _(e); - (this.promise = e), - (this.resolve = L(I, e, t)), - (this.reject = L(R, e, t)); - }), - (f.f = E = - function (e) { - return e === x || e === o ? new t() : $(e); - }), - i || - "function" != typeof l || - ((n = l.prototype.then), - U( - l.prototype, - "then", - function (e, t) { - var r = this; - return new x(function (e, t) { - n.call(r, e, t); - }).then(e, t); - }, - { unsafe: !0 }, - ), - "function" == typeof M && - s( - { global: !0, enumerable: !0, forced: !0 }, - { - fetch: function (e) { - return h(x, M.apply(g, arguments)); - }, - }, - ))), - s({ global: !0, wrap: !0, forced: e }, { Promise: x }), - B(x, j, !1, !0), - G(j), - (o = a(j)), - s( - { target: j, stat: !0, forced: e }, - { - reject: function (e) { - var t = E(this); - return t.reject.call(void 0, e), t.promise; - }, - }, - ), - s( - { target: j, stat: !0, forced: i || e }, - { - resolve: function (e) { - return h(i && this === o ? x : this, e); - }, - }, - ), - s( - { target: j, stat: !0, forced: m }, - { - all: function (e) { - var a = this, - t = E(a), - l = t.resolve, - u = t.reject, - r = b(function () { - var o = c(a.resolve), - n = [], - s = 0, - i = 1; - d(e, function (e) { - var t = s++, - r = !1; - n.push(void 0), - i++, - o.call(a, e).then(function (e) { - r || ((r = !0), (n[t] = e), --i || l(n)); - }, u); - }), - --i || l(n); - }); - return r.error && u(r.value), t.promise; - }, - race: function (e) { - var r = this, - o = E(r), - n = o.reject, - t = b(function () { - var t = c(r.resolve); - d(e, function (e) { - t.call(r, e).then(o.resolve, n); - }); - }); - return t.error && n(t.value), o.promise; - }, - }, - ); - }, - { - "../internals/a-function": 5, - "../internals/an-instance": 9, - "../internals/check-correctness-of-iteration": 27, - "../internals/classof-raw": 28, - "../internals/engine-v8-version": 48, - "../internals/export": 50, - "../internals/get-built-in": 56, - "../internals/global": 59, - "../internals/host-report-errors": 62, - "../internals/inspect-source": 68, - "../internals/internal-state": 70, - "../internals/is-forced": 73, - "../internals/is-object": 74, - "../internals/is-pure": 75, - "../internals/iterate": 77, - "../internals/microtask": 81, - "../internals/native-promise-constructor": 82, - "../internals/new-promise-capability": 86, - "../internals/perform": 105, - "../internals/promise-resolve": 106, - "../internals/redefine": 108, - "../internals/redefine-all": 107, - "../internals/set-species": 116, - "../internals/set-to-string-tag": 117, - "../internals/species-constructor": 121, - "../internals/task": 130, - "../internals/well-known-symbol": 148, - }, - ], - 184: [ - function (e, t, r) { - var o = e("../internals/export"), - n = e("../internals/get-built-in"), - s = e("../internals/a-function"), - i = e("../internals/an-object"), - a = e("../internals/is-object"), - l = e("../internals/object-create"), - u = e("../internals/function-bind"), - e = e("../internals/fails"), - c = n("Reflect", "construct"), - d = e(function () { - function e() {} - return !(c(function () {}, [], e) instanceof e); - }), - h = !e(function () { - c(function () {}); - }), - n = d || h; - o( - { target: "Reflect", stat: !0, forced: n, sham: n }, - { - construct: function (e, t) { - s(e), i(t); - var r = arguments.length < 3 ? e : s(arguments[2]); - if (h && !d) return c(e, t, r); - if (e == r) { - switch (t.length) { - case 0: - return new e(); - case 1: - return new e(t[0]); - case 2: - return new e(t[0], t[1]); - case 3: - return new e(t[0], t[1], t[2]); - case 4: - return new e(t[0], t[1], t[2], t[3]); - } - var o = [null]; - return o.push.apply(o, t), new (u.apply(e, o))(); - } - (o = r.prototype), - (r = l(a(o) ? o : Object.prototype)), - (o = Function.apply.call(e, r, t)); - return a(o) ? o : r; - }, - }, - ); - }, - { - "../internals/a-function": 5, - "../internals/an-object": 10, - "../internals/export": 50, - "../internals/fails": 51, - "../internals/function-bind": 55, - "../internals/get-built-in": 56, - "../internals/is-object": 74, - "../internals/object-create": 90, - }, - ], - 185: [ - function (e, t, r) { - var o = e("../internals/export"), - s = e("../internals/is-object"), - i = e("../internals/an-object"), - a = e("../internals/has"), - l = e("../internals/object-get-own-property-descriptor"), - u = e("../internals/object-get-prototype-of"); - o( - { target: "Reflect", stat: !0 }, - { - get: function e(t, r) { - var o, - n = arguments.length < 3 ? t : arguments[2]; - return i(t) === n - ? t[r] - : (o = l.f(t, r)) - ? a(o, "value") - ? o.value - : void 0 === o.get - ? void 0 - : o.get.call(n) - : s((o = u(t))) - ? e(o, r, n) - : void 0; - }, - }, - ); - }, - { - "../internals/an-object": 10, - "../internals/export": 50, - "../internals/has": 60, - "../internals/is-object": 74, - "../internals/object-get-own-property-descriptor": 93, - "../internals/object-get-prototype-of": 97, - }, - ], - 186: [ - function (e, t, r) { - var o = e("../internals/descriptors"), - n = e("../internals/global"), - s = e("../internals/is-forced"), - i = e("../internals/inherit-if-required"), - a = e("../internals/object-define-property").f, - l = e("../internals/object-get-own-property-names").f, - u = e("../internals/is-regexp"), - c = e("../internals/regexp-flags"), - d = e("../internals/regexp-sticky-helpers"), - h = e("../internals/redefine"), - f = e("../internals/fails"), - p = e("../internals/internal-state").set, - m = e("../internals/set-species"), - y = e("../internals/well-known-symbol")("match"), - g = n.RegExp, - v = g.prototype, - b = /a/g, - j = /a/g, - _ = new g(b) !== b, - x = d.UNSUPPORTED_Y; - if ( - o && - s( - "RegExp", - !_ || - x || - f(function () { - return ( - (j[y] = !1), g(b) != b || g(j) == j || "/a/i" != g(b, "i") - ); - }), - ) - ) { - for ( - var w = function (e, t) { - var r, - o = this instanceof w, - n = u(e), - s = void 0 === t; - if (!o && n && e.constructor === w && s) return e; - _ - ? n && !s && (e = e.source) - : e instanceof w && (s && (t = c.call(e)), (e = e.source)), - x && - (r = !!t && -1 < t.indexOf("y")) && - (t = t.replace(/y/g, "")); - n = i(_ ? new g(e, t) : g(e, t), o ? this : v, w); - return x && r && p(n, { sticky: r }), n; - }, - S = l(g), - T = 0; - S.length > T; - - ) - !(function (t) { - t in w || - a(w, t, { - configurable: !0, - get: function () { - return g[t]; - }, - set: function (e) { - g[t] = e; - }, - }); - })(S[T++]); - ((v.constructor = w).prototype = v), h(n, "RegExp", w); - } - m("RegExp"); - }, - { - "../internals/descriptors": 43, - "../internals/fails": 51, - "../internals/global": 59, - "../internals/inherit-if-required": 67, - "../internals/internal-state": 70, - "../internals/is-forced": 73, - "../internals/is-regexp": 76, - "../internals/object-define-property": 92, - "../internals/object-get-own-property-names": 95, - "../internals/redefine": 108, - "../internals/regexp-flags": 111, - "../internals/regexp-sticky-helpers": 112, - "../internals/set-species": 116, - "../internals/well-known-symbol": 148, - }, - ], - 187: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - e = e("../internals/regexp-exec"); - o( - { target: "RegExp", proto: !0, forced: /./.exec !== e }, - { exec: e }, - ); - }, - { "../internals/export": 50, "../internals/regexp-exec": 110 }, - ], - 188: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/redefine"), - n = e("../internals/an-object"), - s = e("../internals/fails"), - i = e("../internals/regexp-flags"), - e = "toString", - a = RegExp.prototype, - l = a[e], - s = s(function () { - return "/a/b" != l.call({ source: "a", flags: "b" }); - }), - u = l.name != e; - (s || u) && - o( - RegExp.prototype, - e, - function () { - var e = n(this), - t = String(e.source), - r = e.flags; - return ( - "/" + - t + - "/" + - String( - void 0 === r && e instanceof RegExp && !("flags" in a) - ? i.call(e) - : r, - ) - ); - }, - { unsafe: !0 }, - ); - }, - { - "../internals/an-object": 10, - "../internals/fails": 51, - "../internals/redefine": 108, - "../internals/regexp-flags": 111, - }, - ], - 189: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/collection"), - e = e("../internals/collection-strong"); - t.exports = o( - "Set", - function (e) { - return function () { - return e(this, arguments.length ? arguments[0] : void 0); - }; - }, - e, - ); - }, - { "../internals/collection": 32, "../internals/collection-strong": 30 }, - ], - 190: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/object-get-own-property-descriptor").f, - s = e("../internals/to-length"), - i = e("../internals/not-a-regexp"), - a = e("../internals/require-object-coercible"), - l = e("../internals/correct-is-regexp-logic"), - e = e("../internals/is-pure"), - u = "".endsWith, - c = Math.min, - l = l("endsWith"); - o( - { - target: "String", - proto: !0, - forced: - !!( - e || - l || - !(o = n(String.prototype, "endsWith")) || - o.writable - ) && !l, - }, - { - endsWith: function (e) { - var t = String(a(this)), - r = (i(e), 1 < arguments.length ? arguments[1] : void 0), - o = s(t.length), - r = void 0 === r ? o : c(s(r), o), - o = String(e); - return u ? u.call(t, o, r) : t.slice(r - o.length, r) === o; - }, - }, - ); - }, - { - "../internals/correct-is-regexp-logic": 34, - "../internals/export": 50, - "../internals/is-pure": 75, - "../internals/not-a-regexp": 87, - "../internals/object-get-own-property-descriptor": 93, - "../internals/require-object-coercible": 113, - "../internals/to-length": 136, - }, - ], - 191: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/not-a-regexp"), - s = e("../internals/require-object-coercible"); - o( - { - target: "String", - proto: !0, - forced: !e("../internals/correct-is-regexp-logic")("includes"), - }, - { - includes: function (e) { - return !!~String(s(this)).indexOf( - n(e), - 1 < arguments.length ? arguments[1] : void 0, - ); - }, - }, - ); - }, - { - "../internals/correct-is-regexp-logic": 34, - "../internals/export": 50, - "../internals/not-a-regexp": 87, - "../internals/require-object-coercible": 113, - }, - ], - 192: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/string-multibyte").charAt, - n = e("../internals/internal-state"), - e = e("../internals/define-iterator"), - s = "String Iterator", - i = n.set, - a = n.getterFor(s); - e( - String, - "String", - function (e) { - i(this, { type: s, string: String(e), index: 0 }); - }, - function () { - var e = a(this), - t = e.string, - r = e.index; - return r >= t.length - ? { value: void 0, done: !0 } - : ((t = o(t, r)), - (e.index += t.length), - { value: t, done: !1 }); - }, - ); - }, - { - "../internals/define-iterator": 41, - "../internals/internal-state": 70, - "../internals/string-multibyte": 123, - }, - ], - 193: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/fix-regexp-well-known-symbol-logic"), - c = e("../internals/an-object"), - d = e("../internals/to-length"), - n = e("../internals/require-object-coercible"), - h = e("../internals/advance-string-index"), - f = e("../internals/regexp-exec-abstract"); - o("match", 1, function (o, l, u) { - return [ - function (e) { - var t = n(this), - r = null == e ? void 0 : e[o]; - return void 0 !== r - ? r.call(e, t) - : new RegExp(e)[o](String(t)); - }, - function (e) { - var t = u(l, e, this); - if (t.done) return t.value; - var r = c(e), - o = String(this); - if (!r.global) return f(r, o); - for ( - var n = r.unicode, s = [], i = (r.lastIndex = 0); - null !== (a = f(r, o)); - - ) { - var a = String(a[0]); - "" === (s[i] = a) && (r.lastIndex = h(o, d(r.lastIndex), n)), - i++; - } - return 0 === i ? null : s; - }, - ]; - }); - }, - { - "../internals/advance-string-index": 8, - "../internals/an-object": 10, - "../internals/fix-regexp-well-known-symbol-logic": 52, - "../internals/regexp-exec-abstract": 109, - "../internals/require-object-coercible": 113, - "../internals/to-length": 136, - }, - ], - 194: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/string-pad").start; - o( - { - target: "String", - proto: !0, - forced: e("../internals/string-pad-webkit-bug"), - }, - { - padStart: function (e) { - return n(this, e, 1 < arguments.length ? arguments[1] : void 0); - }, - }, - ); - }, - { - "../internals/export": 50, - "../internals/string-pad": 125, - "../internals/string-pad-webkit-bug": 124, - }, - ], - 195: [ - function (e, t, r) { - e("../internals/export")( - { target: "String", proto: !0 }, - { repeat: e("../internals/string-repeat") }, - ); - }, - { "../internals/export": 50, "../internals/string-repeat": 127 }, - ], - 196: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/fix-regexp-well-known-symbol-logic"), - T = e("../internals/an-object"), - M = e("../internals/to-object"), - E = e("../internals/to-length"), - k = e("../internals/to-integer"), - s = e("../internals/require-object-coercible"), - C = e("../internals/advance-string-index"), - O = e("../internals/regexp-exec-abstract"), - P = Math.max, - A = Math.min, - L = Math.floor, - R = /\$([$&'`]|\d\d?|<[^>]*>)/g, - I = /\$([$&'`]|\d\d?)/g; - o("replace", 2, function (n, j, _, e) { - var x = e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE, - w = e.REPLACE_KEEPS_$0, - S = x ? "$" : "$0"; - return [ - function (e, t) { - var r = s(this), - o = null == e ? void 0 : e[n]; - return void 0 !== o ? o.call(e, r, t) : j.call(String(r), e, t); - }, - function (e, t) { - if ( - (!x && w) || - ("string" == typeof t && -1 === t.indexOf(S)) - ) { - var r = _(j, e, this, t); - if (r.done) return r.value; - } - for ( - var o, - n = T(e), - s = String(this), - i = "function" == typeof t, - a = (i || (t = String(t)), n.global), - l = (a && ((o = n.unicode), (n.lastIndex = 0)), []); - null !== (f = O(n, s)) && (l.push(f), a); - - ) - "" === String(f[0]) && - (n.lastIndex = C(s, E(n.lastIndex), o)); - for (var u, c = "", d = 0, h = 0; h < l.length; h++) { - for ( - var f = l[h], - p = String(f[0]), - m = P(A(k(f.index), s.length), 0), - y = [], - g = 1; - g < f.length; - g++ - ) - y.push(void 0 === (u = f[g]) ? u : String(u)); - var v = f.groups, - b = i - ? ((b = [p].concat(y, m, s)), - void 0 !== v && b.push(v), - String(t.apply(void 0, b))) - : (function (s, i, a, l, u, e) { - var c = a + s.length, - d = l.length, - t = I; - void 0 !== u && ((u = M(u)), (t = R)); - return j.call(e, t, function (e, t) { - var r; - switch (t.charAt(0)) { - case "$": - return "$"; - case "&": - return s; - case "`": - return i.slice(0, a); - case "'": - return i.slice(c); - case "<": - r = u[t.slice(1, -1)]; - break; - default: - var o, - n = +t; - if (0 == n) return e; - if (d < n) - return 0 !== (o = L(n / 10)) && o <= d - ? void 0 === l[o - 1] - ? t.charAt(1) - : l[o - 1] + t.charAt(1) - : e; - r = l[n - 1]; - } - return void 0 === r ? "" : r; - }); - })(p, s, m, y, v, t); - d <= m && ((c += s.slice(d, m) + b), (d = m + p.length)); - } - return c + s.slice(d); - }, - ]; - }); - }, - { - "../internals/advance-string-index": 8, - "../internals/an-object": 10, - "../internals/fix-regexp-well-known-symbol-logic": 52, - "../internals/regexp-exec-abstract": 109, - "../internals/require-object-coercible": 113, - "../internals/to-integer": 135, - "../internals/to-length": 136, - "../internals/to-object": 137, - }, - ], - 197: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/fix-regexp-well-known-symbol-logic"), - i = e("../internals/an-object"), - a = e("../internals/require-object-coercible"), - l = e("../internals/same-value"), - u = e("../internals/regexp-exec-abstract"); - o("search", 1, function (o, n, s) { - return [ - function (e) { - var t = a(this), - r = null == e ? void 0 : e[o]; - return void 0 !== r - ? r.call(e, t) - : new RegExp(e)[o](String(t)); - }, - function (e) { - var t, - r = s(n, e, this); - return r.done - ? r.value - : ((r = i(e)), - (e = String(this)), - (t = r.lastIndex), - l(t, 0) || (r.lastIndex = 0), - (e = u(r, e)), - l(r.lastIndex, t) || (r.lastIndex = t), - null === e ? -1 : e.index); - }, - ]; - }); - }, - { - "../internals/an-object": 10, - "../internals/fix-regexp-well-known-symbol-logic": 52, - "../internals/regexp-exec-abstract": 109, - "../internals/require-object-coercible": 113, - "../internals/same-value": 114, - }, - ], - 198: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/fix-regexp-well-known-symbol-logic"), - c = e("../internals/is-regexp"), - g = e("../internals/an-object"), - d = e("../internals/require-object-coercible"), - v = e("../internals/species-constructor"), - b = e("../internals/advance-string-index"), - j = e("../internals/to-length"), - _ = e("../internals/regexp-exec-abstract"), - h = e("../internals/regexp-exec"), - e = e("../internals/fails"), - f = [].push, - x = Math.min, - w = 4294967295, - S = !e(function () { - return !RegExp(w, "y"); - }); - o( - "split", - 2, - function (n, p, m) { - var y = - "c" == "abbc".split(/(b)*/)[1] || - 4 != "test".split(/(?:)/, -1).length || - 2 != "ab".split(/(?:ab)*/).length || - 4 != ".".split(/(.?)(.?)/).length || - 1 < ".".split(/()()/).length || - "".split(/.?/).length - ? function (e, t) { - var r = String(d(this)), - o = void 0 === t ? w : t >>> 0; - if (0 == o) return []; - if (void 0 === e) return [r]; - if (!c(e)) return p.call(r, e, o); - for ( - var n, - s, - i, - a = [], - t = - (e.ignoreCase ? "i" : "") + - (e.multiline ? "m" : "") + - (e.unicode ? "u" : "") + - (e.sticky ? "y" : ""), - l = 0, - u = new RegExp(e.source, t + "g"); - (n = h.call(u, r)) && - !( - l < (s = u.lastIndex) && - (a.push(r.slice(l, n.index)), - 1 < n.length && - n.index < r.length && - f.apply(a, n.slice(1)), - (i = n[0].length), - (l = s), - a.length >= o) - ); - - ) - u.lastIndex === n.index && u.lastIndex++; - return ( - l === r.length - ? (!i && u.test("")) || a.push("") - : a.push(r.slice(l)), - a.length > o ? a.slice(0, o) : a - ); - } - : "0".split(void 0, 0).length - ? function (e, t) { - return void 0 === e && 0 === t - ? [] - : p.call(this, e, t); - } - : p; - return [ - function (e, t) { - var r = d(this), - o = null == e ? void 0 : e[n]; - return void 0 !== o - ? o.call(e, r, t) - : y.call(String(r), e, t); - }, - function (e, t) { - var r = m(y, e, this, t, y !== p); - if (r.done) return r.value; - var r = g(e), - o = String(this), - e = v(r, RegExp), - n = r.unicode, - s = - (r.ignoreCase ? "i" : "") + - (r.multiline ? "m" : "") + - (r.unicode ? "u" : "") + - (S ? "y" : "g"), - i = new e(S ? r : "^(?:" + r.source + ")", s), - a = void 0 === t ? w : t >>> 0; - if (0 == a) return []; - if (0 === o.length) return null === _(i, o) ? [o] : []; - for (var l = 0, u = 0, c = []; u < o.length; ) { - i.lastIndex = S ? u : 0; - var d, - h = _(i, S ? o : o.slice(u)); - if ( - null === h || - (d = x(j(i.lastIndex + (S ? 0 : u)), o.length)) === l - ) - u = b(o, u, n); - else { - if ((c.push(o.slice(l, u)), c.length === a)) return c; - for (var f = 1; f <= h.length - 1; f++) - if ((c.push(h[f]), c.length === a)) return c; - u = l = d; - } - } - return c.push(o.slice(l)), c; - }, - ]; - }, - !S, - ); - }, - { - "../internals/advance-string-index": 8, - "../internals/an-object": 10, - "../internals/fails": 51, - "../internals/fix-regexp-well-known-symbol-logic": 52, - "../internals/is-regexp": 76, - "../internals/regexp-exec": 110, - "../internals/regexp-exec-abstract": 109, - "../internals/require-object-coercible": 113, - "../internals/species-constructor": 121, - "../internals/to-length": 136, - }, - ], - 199: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/object-get-own-property-descriptor").f, - s = e("../internals/to-length"), - i = e("../internals/not-a-regexp"), - a = e("../internals/require-object-coercible"), - l = e("../internals/correct-is-regexp-logic"), - e = e("../internals/is-pure"), - u = "".startsWith, - c = Math.min, - l = l("startsWith"); - o( - { - target: "String", - proto: !0, - forced: - !!( - e || - l || - !(o = n(String.prototype, "startsWith")) || - o.writable - ) && !l, - }, - { - startsWith: function (e) { - var t = String(a(this)), - r = - (i(e), - s( - c(1 < arguments.length ? arguments[1] : void 0, t.length), - )), - e = String(e); - return u ? u.call(t, e, r) : t.slice(r, r + e.length) === e; - }, - }, - ); - }, - { - "../internals/correct-is-regexp-logic": 34, - "../internals/export": 50, - "../internals/is-pure": 75, - "../internals/not-a-regexp": 87, - "../internals/object-get-own-property-descriptor": 93, - "../internals/require-object-coercible": 113, - "../internals/to-length": 136, - }, - ], - 200: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/create-html"); - o( - { - target: "String", - proto: !0, - forced: e("../internals/string-html-forced")("sub"), - }, - { - sub: function () { - return n(this, "sub", "", ""); - }, - }, - ); - }, - { - "../internals/create-html": 36, - "../internals/export": 50, - "../internals/string-html-forced": 122, - }, - ], - 201: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/export"), - n = e("../internals/string-trim").trim; - o( - { - target: "String", - proto: !0, - forced: e("../internals/string-trim-forced")("trim"), - }, - { - trim: function () { - return n(this); - }, - }, - ); - }, - { - "../internals/export": 50, - "../internals/string-trim": 129, - "../internals/string-trim-forced": 128, - }, - ], - 202: [ - function (e, t, r) { - "use strict"; - var o, - n, - s, - i, - a, - l = e("../internals/export"), - u = e("../internals/descriptors"), - c = e("../internals/global"), - d = e("../internals/has"), - h = e("../internals/is-object"), - f = e("../internals/object-define-property").f, - e = e("../internals/copy-constructor-properties"), - p = c.Symbol; - !u || - "function" != typeof p || - ("description" in p.prototype && void 0 === p().description) || - ((o = {}), - e( - (n = function () { - var e = - arguments.length < 1 || void 0 === arguments[0] - ? void 0 - : String(arguments[0]), - t = this instanceof n ? new p(e) : void 0 === e ? p() : p(e); - return "" === e && (o[t] = !0), t; - }), - p, - ), - ((c = n.prototype = p.prototype).constructor = n), - (s = c.toString), - (i = "Symbol(test)" == String(p("test"))), - (a = /^Symbol\((.*)\)[^)]+$/), - f(c, "description", { - configurable: !0, - get: function () { - var e = h(this) ? this.valueOf() : this, - t = s.call(e); - return d(o, e) - ? "" - : "" === (e = i ? t.slice(7, -1) : t.replace(a, "$1")) - ? void 0 - : e; - }, - }), - l({ global: !0, forced: !0 }, { Symbol: n })); - }, - { - "../internals/copy-constructor-properties": 33, - "../internals/descriptors": 43, - "../internals/export": 50, - "../internals/global": 59, - "../internals/has": 60, - "../internals/is-object": 74, - "../internals/object-define-property": 92, - }, - ], - 203: [ - function (e, t, r) { - e("../internals/define-well-known-symbol")("iterator"); - }, - { "../internals/define-well-known-symbol": 42 }, - ], - 204: [ - function (e, D, F) { - "use strict"; - function o(e, t) { - var r = (M[e] = f(w[_])); - return ( - ie(r, { type: j, tag: e, description: t }), - s || (r.description = t), - r - ); - } - function r(t, e) { - u(t); - var r = c(e), - e = q(r).concat(I(r)); - return ( - v(e, function (e) { - (s && !R.call(r, e)) || L(t, e, r[e]); - }), - t - ); - } - function t(e, t) { - var r, - e = c(e), - t = d(t, !0); - if (e !== x || !l(M, t) || l(E, t)) - return ( - !(r = le(e, t)) || - !l(M, t) || - (l(e, b) && e[b][t]) || - (r.enumerable = !0), - r - ); - } - function U(e) { - var e = ue(c(e)), - t = []; - return ( - v(e, function (e) { - l(M, e) || l(ee, e) || t.push(e); - }), - t - ); - } - var n = e("../internals/export"), - N = e("../internals/global"), - B = e("../internals/get-built-in"), - G = e("../internals/is-pure"), - s = e("../internals/descriptors"), - i = e("../internals/native-symbol"), - V = e("../internals/use-symbol-as-uid"), - a = e("../internals/fails"), - l = e("../internals/has"), - z = e("../internals/is-array"), - H = e("../internals/is-object"), - u = e("../internals/an-object"), - W = e("../internals/to-object"), - c = e("../internals/to-indexed-object"), - d = e("../internals/to-primitive"), - h = e("../internals/create-property-descriptor"), - f = e("../internals/object-create"), - q = e("../internals/object-keys"), - X = e("../internals/object-get-own-property-names"), - Y = e("../internals/object-get-own-property-names-external"), - p = e("../internals/object-get-own-property-symbols"), - Z = e("../internals/object-get-own-property-descriptor"), - Q = e("../internals/object-define-property"), - J = e("../internals/object-property-is-enumerable"), - K = e("../internals/create-non-enumerable-property"), - m = e("../internals/redefine"), - y = e("../internals/shared"), - $ = e("../internals/shared-key"), - ee = e("../internals/hidden-keys"), - te = e("../internals/uid"), - re = e("../internals/well-known-symbol"), - oe = e("../internals/well-known-symbol-wrapped"), - ne = e("../internals/define-well-known-symbol"), - se = e("../internals/set-to-string-tag"), - g = e("../internals/internal-state"), - v = e("../internals/array-iteration").forEach, - b = $("hidden"), - j = "Symbol", - _ = "prototype", - e = re("toPrimitive"), - ie = g.set, - ae = g.getterFor(j), - x = Object[_], - w = N.Symbol, - S = B("JSON", "stringify"), - le = Z.f, - T = Q.f, - ue = Y.f, - ce = J.f, - M = y("symbols"), - E = y("op-symbols"), - k = y("string-to-symbol-registry"), - C = y("symbol-to-string-registry"), - $ = y("wks"), - g = N.QObject, - O = !g || !g[_] || !g[_].findChild, - P = - s && - a(function () { - return ( - 7 != - f( - T({}, "a", { - get: function () { - return T(this, "a", { value: 7 }).a; - }, - }), - ).a - ); - }) - ? function (e, t, r) { - var o = le(x, t); - o && delete x[t], T(e, t, r), o && e !== x && T(x, t, o); - } - : T, - A = V - ? function (e) { - return "symbol" == typeof e; - } - : function (e) { - return Object(e) instanceof w; - }, - L = function (e, t, r) { - e === x && L(E, t, r), u(e); - t = d(t, !0); - return ( - u(r), - (l(M, t) - ? (r.enumerable - ? (l(e, b) && e[b][t] && (e[b][t] = !1), - (r = f(r, { enumerable: h(0, !1) }))) - : (l(e, b) || T(e, b, h(1, {})), (e[b][t] = !0)), - P) - : T)(e, t, r) - ); - }, - R = function (e) { - var e = d(e, !0), - t = ce.call(this, e); - return ( - !(this === x && l(M, e) && !l(E, e)) && - (!( - t || - !l(this, e) || - !l(M, e) || - (l(this, b) && this[b][e]) - ) || - t) - ); - }, - I = function (e) { - var t = e === x, - e = ue(t ? E : c(e)), - r = []; - return ( - v(e, function (e) { - !l(M, e) || (t && !l(x, e)) || r.push(M[e]); - }), - r - ); - }; - i || - (m( - (w = function () { - if (this instanceof w) - throw TypeError("Symbol is not a constructor"); - var e = - arguments.length && void 0 !== arguments[0] - ? String(arguments[0]) - : void 0, - t = te(e), - r = function (e) { - this === x && r.call(E, e), - l(this, b) && l(this[b], t) && (this[b][t] = !1), - P(this, t, h(1, e)); - }; - return s && O && P(x, t, { configurable: !0, set: r }), o(t, e); - })[_], - "toString", - function () { - return ae(this).tag; - }, - ), - m(w, "withoutSetter", function (e) { - return o(te(e), e); - }), - (J.f = R), - (Q.f = L), - (Z.f = t), - (X.f = Y.f = U), - (p.f = I), - (oe.f = function (e) { - return o(re(e), e); - }), - s && - (T(w[_], "description", { - configurable: !0, - get: function () { - return ae(this).description; - }, - }), - G || m(x, "propertyIsEnumerable", R, { unsafe: !0 }))), - n({ global: !0, wrap: !0, forced: !i, sham: !i }, { Symbol: w }), - v(q($), function (e) { - ne(e); - }), - n( - { target: j, stat: !0, forced: !i }, - { - for: function (e) { - var t, - e = String(e); - return l(k, e) - ? k[e] - : ((t = w(e)), (k[e] = t), (C[t] = e), t); - }, - keyFor: function (e) { - if (!A(e)) throw TypeError(e + " is not a symbol"); - if (l(C, e)) return C[e]; - }, - useSetter: function () { - O = !0; - }, - useSimple: function () { - O = !1; - }, - }, - ), - n( - { target: "Object", stat: !0, forced: !i, sham: !s }, - { - create: function (e, t) { - return void 0 === t ? f(e) : r(f(e), t); - }, - defineProperty: L, - defineProperties: r, - getOwnPropertyDescriptor: t, - }, - ), - n( - { target: "Object", stat: !0, forced: !i }, - { getOwnPropertyNames: U, getOwnPropertySymbols: I }, - ), - n( - { - target: "Object", - stat: !0, - forced: a(function () { - p.f(1); - }), - }, - { - getOwnPropertySymbols: function (e) { - return p.f(W(e)); - }, - }, - ), - S && - n( - { - target: "JSON", - stat: !0, - forced: - !i || - a(function () { - var e = w(); - return ( - "[null]" != S([e]) || - "{}" != S({ a: e }) || - "{}" != S(Object(e)) - ); - }), - }, - { - stringify: function (e, t, r) { - for (var o, n = [e], s = 1; s < arguments.length; ) - n.push(arguments[s++]); - if ((H((o = t)) || void 0 !== e) && !A(e)) - return ( - z(t) || - (t = function (e, t) { - if ( - ("function" == typeof o && - (t = o.call(this, e, t)), - !A(t)) - ) - return t; - }), - (n[1] = t), - S.apply(null, n) - ); - }, - }, - ), - w[_][e] || K(w[_], e, w[_].valueOf), - se(w, j), - (ee[b] = !0); - }, - { - "../internals/an-object": 10, - "../internals/array-iteration": 19, - "../internals/create-non-enumerable-property": 38, - "../internals/create-property-descriptor": 39, - "../internals/define-well-known-symbol": 42, - "../internals/descriptors": 43, - "../internals/export": 50, - "../internals/fails": 51, - "../internals/get-built-in": 56, - "../internals/global": 59, - "../internals/has": 60, - "../internals/hidden-keys": 61, - "../internals/internal-state": 70, - "../internals/is-array": 72, - "../internals/is-object": 74, - "../internals/is-pure": 75, - "../internals/native-symbol": 83, - "../internals/object-create": 90, - "../internals/object-define-property": 92, - "../internals/object-get-own-property-descriptor": 93, - "../internals/object-get-own-property-names": 95, - "../internals/object-get-own-property-names-external": 94, - "../internals/object-get-own-property-symbols": 96, - "../internals/object-keys": 99, - "../internals/object-property-is-enumerable": 100, - "../internals/redefine": 108, - "../internals/set-to-string-tag": 117, - "../internals/shared": 120, - "../internals/shared-key": 118, - "../internals/to-indexed-object": 134, - "../internals/to-object": 137, - "../internals/to-primitive": 140, - "../internals/uid": 145, - "../internals/use-symbol-as-uid": 146, - "../internals/well-known-symbol": 148, - "../internals/well-known-symbol-wrapped": 147, - }, - ], - 205: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-copy-within"), - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("copyWithin", function (e, t) { - return n.call( - s(this), - e, - t, - 2 < arguments.length ? arguments[2] : void 0, - ); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-copy-within": 14, - }, - ], - 206: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-iteration").every, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("every", function (e) { - return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - }, - ], - 207: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-fill"), - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("fill", function (e) { - return n.apply(s(this), arguments); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-fill": 15, - }, - ], - 208: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - s = e("../internals/array-iteration").filter, - i = e("../internals/species-constructor"), - a = o.aTypedArray, - l = o.aTypedArrayConstructor; - (0, o.exportTypedArrayMethod)("filter", function (e) { - for ( - var t = s( - a(this), - e, - 1 < arguments.length ? arguments[1] : void 0, - ), - e = i(this, this.constructor), - r = 0, - o = t.length, - n = new (l(e))(o); - r < o; - - ) - n[r] = t[r++]; - return n; - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - "../internals/species-constructor": 121, - }, - ], - 209: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-iteration").findIndex, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("findIndex", function (e) { - return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - }, - ], - 210: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-iteration").find, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("find", function (e) { - return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - }, - ], - 211: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Float32", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 212: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Float64", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 213: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-iteration").forEach, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("forEach", function (e) { - n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - }, - ], - 214: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-includes").includes, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("includes", function (e) { - return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-includes": 18, - }, - ], - 215: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-includes").indexOf, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("indexOf", function (e) { - return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-includes": 18, - }, - ], - 216: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Int16", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 217: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Int32", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 218: [ - function (e, t, r) { - "use strict"; - function o() { - return a.call(c(this)); - } - var n = e("../internals/global"), - s = e("../internals/array-buffer-view-core"), - i = e("../modules/es.array.iterator"), - e = e("../internals/well-known-symbol")("iterator"), - n = n.Uint8Array, - a = i.values, - l = i.keys, - u = i.entries, - c = s.aTypedArray, - i = s.exportTypedArrayMethod, - s = n && n.prototype[e], - n = !!s && ("values" == s.name || null == s.name); - i("entries", function () { - return u.call(c(this)); - }), - i("keys", function () { - return l.call(c(this)); - }), - i("values", o, !n), - i(e, o, !n); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/global": 59, - "../internals/well-known-symbol": 148, - "../modules/es.array.iterator": 161, - }, - ], - 219: [ - function (e, t, r) { - "use strict"; - var e = e("../internals/array-buffer-view-core"), - o = e.aTypedArray, - e = e.exportTypedArrayMethod, - n = [].join; - e("join", function (e) { - return n.apply(o(this), arguments); - }); - }, - { "../internals/array-buffer-view-core": 12 }, - ], - 220: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-last-index-of"), - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("lastIndexOf", function (e) { - return n.apply(s(this), arguments); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-last-index-of": 20, - }, - ], - 221: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-iteration").map, - s = e("../internals/species-constructor"), - i = o.aTypedArray, - a = o.aTypedArrayConstructor; - (0, o.exportTypedArrayMethod)("map", function (e) { - return n( - i(this), - e, - 1 < arguments.length ? arguments[1] : void 0, - function (e, t) { - return new (a(s(e, e.constructor)))(t); - }, - ); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - "../internals/species-constructor": 121, - }, - ], - 222: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-reduce").right, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("reduceRight", function (e) { - return n( - s(this), - e, - arguments.length, - 1 < arguments.length ? arguments[1] : void 0, - ); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-reduce": 24, - }, - ], - 223: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-reduce").left, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("reduce", function (e) { - return n( - s(this), - e, - arguments.length, - 1 < arguments.length ? arguments[1] : void 0, - ); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-reduce": 24, - }, - ], - 224: [ - function (e, t, r) { - "use strict"; - var e = e("../internals/array-buffer-view-core"), - n = e.aTypedArray, - e = e.exportTypedArrayMethod, - s = Math.floor; - e("reverse", function () { - for (var e, t = n(this).length, r = s(t / 2), o = 0; o < r; ) - (e = this[o]), (this[o++] = this[--t]), (this[t] = e); - return this; - }); - }, - { "../internals/array-buffer-view-core": 12 }, - ], - 225: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - i = e("../internals/to-length"), - a = e("../internals/to-offset"), - l = e("../internals/to-object"), - e = e("../internals/fails"), - u = o.aTypedArray; - (0, o.exportTypedArrayMethod)( - "set", - function (e) { - u(this); - var t = a(1 < arguments.length ? arguments[1] : void 0, 1), - r = this.length, - o = l(e), - n = i(o.length), - s = 0; - if (r < n + t) throw RangeError("Wrong length"); - for (; s < n; ) this[t + s] = o[s++]; - }, - e(function () { - new Int8Array(1).set({}); - }), - ); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/fails": 51, - "../internals/to-length": 136, - "../internals/to-object": 137, - "../internals/to-offset": 138, - }, - ], - 226: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - i = e("../internals/species-constructor"), - e = e("../internals/fails"), - a = o.aTypedArray, - l = o.aTypedArrayConstructor, - o = o.exportTypedArrayMethod, - u = [].slice; - o( - "slice", - function (e, t) { - for ( - var r = u.call(a(this), e, t), - e = i(this, this.constructor), - o = 0, - n = r.length, - s = new (l(e))(n); - o < n; - - ) - s[o] = r[o++]; - return s; - }, - e(function () { - new Int8Array(1).slice(); - }), - ); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/fails": 51, - "../internals/species-constructor": 121, - }, - ], - 227: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/array-iteration").some, - s = o.aTypedArray; - (0, o.exportTypedArrayMethod)("some", function (e) { - return n(s(this), e, 1 < arguments.length ? arguments[1] : void 0); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/array-iteration": 19, - }, - ], - 228: [ - function (e, t, r) { - "use strict"; - var e = e("../internals/array-buffer-view-core"), - o = e.aTypedArray, - e = e.exportTypedArrayMethod, - n = [].sort; - e("sort", function (e) { - return n.call(o(this), e); - }); - }, - { "../internals/array-buffer-view-core": 12 }, - ], - 229: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/array-buffer-view-core"), - n = e("../internals/to-length"), - s = e("../internals/to-absolute-index"), - i = e("../internals/species-constructor"), - a = o.aTypedArray; - (0, o.exportTypedArrayMethod)("subarray", function (e, t) { - var r = a(this), - o = r.length, - e = s(e, o); - return new (i(r, r.constructor))( - r.buffer, - r.byteOffset + e * r.BYTES_PER_ELEMENT, - n((void 0 === t ? o : s(t, o)) - e), - ); - }); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/species-constructor": 121, - "../internals/to-absolute-index": 132, - "../internals/to-length": 136, - }, - ], - 230: [ - function (e, t, r) { - "use strict"; - var o = e("../internals/global"), - n = e("../internals/array-buffer-view-core"), - e = e("../internals/fails"), - s = o.Int8Array, - i = n.aTypedArray, - o = n.exportTypedArrayMethod, - a = [].toLocaleString, - l = [].slice, - u = - !!s && - e(function () { - a.call(new s(1)); - }); - o( - "toLocaleString", - function () { - return a.apply(u ? l.call(i(this)) : i(this), arguments); - }, - e(function () { - return [1, 2].toLocaleString() != new s([1, 2]).toLocaleString(); - }) || - !e(function () { - s.prototype.toLocaleString.call([1, 2]); - }), - ); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/fails": 51, - "../internals/global": 59, - }, - ], - 231: [ - function (e, t, r) { - "use strict"; - var o = e( - "../internals/array-buffer-view-core", - ).exportTypedArrayMethod, - n = e("../internals/fails"), - e = e("../internals/global").Uint8Array, - e = (e && e.prototype) || {}, - s = [].toString, - i = [].join, - n = - (n(function () { - s.call({}); - }) && - (s = function () { - return i.call(this); - }), - e.toString != s); - o("toString", s, n); - }, - { - "../internals/array-buffer-view-core": 12, - "../internals/fails": 51, - "../internals/global": 59, - }, - ], - 232: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Uint16", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 233: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Uint32", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 234: [ - function (e, t, r) { - e("../internals/typed-array-constructor")("Uint8", function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 235: [ - function (e, t, r) { - e("../internals/typed-array-constructor")( - "Uint8", - function (o) { - return function (e, t, r) { - return o(this, e, t, r); - }; - }, - !0, - ); - }, - { "../internals/typed-array-constructor": 142 }, - ], - 236: [ - function (e, t, r) { - "use strict"; - function o(e) { - return function () { - return e(this, arguments.length ? arguments[0] : void 0); - }; - } - var n, - s, - i, - a, - l, - u = e("../internals/global"), - c = e("../internals/redefine-all"), - d = e("../internals/internal-metadata"), - h = e("../internals/collection"), - f = e("../internals/collection-weak"), - p = e("../internals/is-object"), - m = e("../internals/internal-state").enforce, - e = e("../internals/native-weak-map"), - u = !u.ActiveXObject && "ActiveXObject" in u, - y = Object.isExtensible, - t = (t.exports = h("WeakMap", o, f)); - e && - u && - ((n = f.getConstructor(o, "WeakMap", !0)), - (d.REQUIRED = !0), - (h = t.prototype), - (s = h.delete), - (i = h.has), - (a = h.get), - (l = h.set), - c(h, { - delete: function (e) { - var t; - return p(e) && !y(e) - ? ((t = m(this)).frozen || (t.frozen = new n()), - s.call(this, e) || t.frozen.delete(e)) - : s.call(this, e); - }, - has: function (e) { - var t; - return p(e) && !y(e) - ? ((t = m(this)).frozen || (t.frozen = new n()), - i.call(this, e) || t.frozen.has(e)) - : i.call(this, e); - }, - get: function (e) { - var t; - return !p(e) || - y(e) || - ((t = m(this)).frozen || (t.frozen = new n()), - i.call(this, e)) - ? a.call(this, e) - : t.frozen.get(e); - }, - set: function (e, t) { - var r; - return ( - !p(e) || - y(e) || - ((r = m(this)).frozen || (r.frozen = new n()), - i.call(this, e)) - ? l.call(this, e, t) - : r.frozen.set(e, t), - this - ); - }, - })); - }, - { - "../internals/collection": 32, - "../internals/collection-weak": 31, - "../internals/global": 59, - "../internals/internal-metadata": 69, - "../internals/internal-state": 70, - "../internals/is-object": 74, - "../internals/native-weak-map": 85, - "../internals/redefine-all": 107, - }, - ], - 237: [ - function (e, t, r) { - var o, - n = e("../internals/global"), - s = e("../internals/dom-iterables"), - i = e("../internals/array-for-each"), - a = e("../internals/create-non-enumerable-property"); - for (o in s) { - var l = n[o], - l = l && l.prototype; - if (l && l.forEach !== i) - try { - a(l, "forEach", i); - } catch (e) { - l.forEach = i; - } - } - }, - { - "../internals/array-for-each": 16, - "../internals/create-non-enumerable-property": 38, - "../internals/dom-iterables": 45, - "../internals/global": 59, - }, - ], - 238: [ - function (e, t, r) { - var o, - n = e("../internals/global"), - s = e("../internals/dom-iterables"), - i = e("../modules/es.array.iterator"), - a = e("../internals/create-non-enumerable-property"), - e = e("../internals/well-known-symbol"), - l = e("iterator"), - u = e("toStringTag"), - c = i.values; - for (o in s) { - var d = n[o], - h = d && d.prototype; - if (h) { - if (h[l] !== c) - try { - a(h, l, c); - } catch (e) { - h[l] = c; - } - if ((h[u] || a(h, u, o), s[o])) - for (var f in i) - if (h[f] !== i[f]) - try { - a(h, f, i[f]); - } catch (e) { - h[f] = i[f]; - } - } - } - }, - { - "../internals/create-non-enumerable-property": 38, - "../internals/dom-iterables": 45, - "../internals/global": 59, - "../internals/well-known-symbol": 148, - "../modules/es.array.iterator": 161, - }, - ], - 239: [ - function (e, t, D) { - "use strict"; - e("../modules/es.array.iterator"); - function n(t) { - try { - return decodeURIComponent(t); - } catch (e) { - return t; - } - } - function r(e) { - return B[e]; - } - function s(e) { - return encodeURIComponent(e).replace(N, r); - } - function c(e) { - (this.entries.length = 0), R(this.entries, e); - } - function u(e, t) { - if (e < t) throw TypeError("Not enough arguments"); - } - function d() { - y(this, d, k); - var e, - t, - r, - o, - n, - s, - i, - a, - l = 0 < arguments.length ? arguments[0] : void 0, - u = []; - if ( - (O(this, { - type: k, - entries: u, - updateURL: function () {}, - updateSearchParams: c, - }), - void 0 !== l) - ) - if (_(l)) - if ("function" == typeof (e = T(l))) - for (r = (t = e.call(l)).next; !(o = r.call(t)).done; ) { - if ( - (s = (n = (o = S(j(o.value))).next).call(o)).done || - (i = n.call(o)).done || - !n.call(o).done - ) - throw TypeError("Expected sequence with length 2"); - u.push({ key: s.value + "", value: i.value + "" }); - } - else - for (a in l) g(l, a) && u.push({ key: a, value: l[a] + "" }); - else - R( - u, - "string" == typeof l - ? "?" === l.charAt(0) - ? l.slice(1) - : l - : l + "", - ); - } - var o = e("../internals/export"), - i = e("../internals/get-built-in"), - a = e("../internals/native-url"), - l = e("../internals/redefine"), - h = e("../internals/redefine-all"), - f = e("../internals/set-to-string-tag"), - p = e("../internals/create-iterator-constructor"), - m = e("../internals/internal-state"), - y = e("../internals/an-instance"), - g = e("../internals/has"), - v = e("../internals/function-bind-context"), - b = e("../internals/classof"), - j = e("../internals/an-object"), - _ = e("../internals/is-object"), - x = e("../internals/object-create"), - w = e("../internals/create-property-descriptor"), - S = e("../internals/get-iterator"), - T = e("../internals/get-iterator-method"), - e = e("../internals/well-known-symbol"), - M = i("fetch"), - E = i("Headers"), - i = e("iterator"), - k = "URLSearchParams", - C = k + "Iterator", - O = m.set, - P = m.getterFor(k), - F = m.getterFor(C), - U = /\+/g, - A = Array(4), - L = function (e) { - var t, - r = e.replace(U, " "), - o = 4; - try { - return decodeURIComponent(r); - } catch (e) { - for (; o; ) - r = r.replace( - ((t = o--), - A[t - 1] || - (A[t - 1] = RegExp( - "((?:%[\\da-f]{2}){" + t + "})", - "gi", - ))), - n, - ); - return r; - } - }, - N = /[!'()~]|%20/g, - B = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - }, - R = function (e, t) { - if (t) - for (var r, o = t.split("&"), n = 0; n < o.length; ) - (r = o[n++]).length && - ((r = r.split("=")), - e.push({ key: L(r.shift()), value: L(r.join("=")) })); - }, - I = p( - function (e, t) { - O(this, { type: C, iterator: S(P(e).entries), kind: t }); - }, - "Iterator", - function () { - var e = F(this), - t = e.kind, - e = e.iterator.next(), - r = e.value; - return ( - e.done || - (e.value = - "keys" === t - ? r.key - : "values" === t - ? r.value - : [r.key, r.value]), - e - ); - }, - ), - e = d.prototype; - h( - e, - { - append: function (e, t) { - u(arguments.length, 2); - var r = P(this); - r.entries.push({ key: e + "", value: t + "" }), r.updateURL(); - }, - delete: function (e) { - u(arguments.length, 1); - for ( - var t = P(this), r = t.entries, o = e + "", n = 0; - n < r.length; - - ) - r[n].key === o ? r.splice(n, 1) : n++; - t.updateURL(); - }, - get: function (e) { - u(arguments.length, 1); - for ( - var t = P(this).entries, r = e + "", o = 0; - o < t.length; - o++ - ) - if (t[o].key === r) return t[o].value; - return null; - }, - getAll: function (e) { - u(arguments.length, 1); - for ( - var t = P(this).entries, r = e + "", o = [], n = 0; - n < t.length; - n++ - ) - t[n].key === r && o.push(t[n].value); - return o; - }, - has: function (e) { - u(arguments.length, 1); - for (var t = P(this).entries, r = e + "", o = 0; o < t.length; ) - if (t[o++].key === r) return !0; - return !1; - }, - set: function (e, t) { - u(arguments.length, 1); - for ( - var r, - o = P(this), - n = o.entries, - s = !1, - i = e + "", - a = t + "", - l = 0; - l < n.length; - l++ - ) - (r = n[l]).key === i && - (s ? n.splice(l--, 1) : ((s = !0), (r.value = a))); - s || n.push({ key: i, value: a }), o.updateURL(); - }, - sort: function () { - for ( - var e, - t, - r = P(this), - o = r.entries, - n = o.slice(), - s = (o.length = 0); - s < n.length; - s++ - ) { - for (e = n[s], t = 0; t < s; t++) - if (o[t].key > e.key) { - o.splice(t, 0, e); - break; - } - t === s && o.push(e); - } - r.updateURL(); - }, - forEach: function (e) { - for ( - var t, - r = P(this).entries, - o = v(e, 1 < arguments.length ? arguments[1] : void 0, 3), - n = 0; - n < r.length; - - ) - o((t = r[n++]).value, t.key, this); - }, - keys: function () { - return new I(this, "keys"); - }, - values: function () { - return new I(this, "values"); - }, - entries: function () { - return new I(this, "entries"); - }, - }, - { enumerable: !0 }, - ), - l(e, i, e.entries), - l( - e, - "toString", - function () { - for (var e, t = P(this).entries, r = [], o = 0; o < t.length; ) - (e = t[o++]), r.push(s(e.key) + "=" + s(e.value)); - return r.join("&"); - }, - { enumerable: !0 }, - ), - f(d, k), - o({ global: !0, forced: !a }, { URLSearchParams: d }), - a || - "function" != typeof M || - "function" != typeof E || - o( - { global: !0, enumerable: !0, forced: !0 }, - { - fetch: function (e) { - var t, - r, - o, - e = [e]; - return ( - 1 < arguments.length && - (_((t = arguments[1])) && - ((r = t.body), - b(r) === k && - ((o = t.headers ? new E(t.headers) : new E()).has( - "content-type", - ) || - o.set( - "content-type", - "application/x-www-form-urlencoded;charset=UTF-8", - ), - (t = x(t, { - body: w(0, String(r)), - headers: w(0, o), - })))), - e.push(t)), - M.apply(this, e) - ); - }, - }, - ), - (t.exports = { URLSearchParams: d, getState: P }); - }, - { - "../internals/an-instance": 9, - "../internals/an-object": 10, - "../internals/classof": 29, - "../internals/create-iterator-constructor": 37, - "../internals/create-property-descriptor": 39, - "../internals/export": 50, - "../internals/function-bind-context": 54, - "../internals/get-built-in": 56, - "../internals/get-iterator": 58, - "../internals/get-iterator-method": 57, - "../internals/has": 60, - "../internals/internal-state": 70, - "../internals/is-object": 74, - "../internals/native-url": 84, - "../internals/object-create": 90, - "../internals/redefine": 108, - "../internals/redefine-all": 107, - "../internals/set-to-string-tag": 117, - "../internals/well-known-symbol": 148, - "../modules/es.array.iterator": 161, - }, - ], - 240: [ - function (e, y, F) { - "use strict"; - e("../modules/es.string.iterator"); - function c(e) { - var t, r, o, n; - if ("number" == typeof e) { - for (t = [], r = 0; r < 4; r++) - t.unshift(e % 256), (e = Y(e / 256)); - return t.join("."); - } - if ("object" != typeof e) return e; - for (t = "", o = le(e), r = 0; r < 8; r++) - (n && 0 === e[r]) || - ((n = n && !1), - o === r - ? ((t += r ? ":" : "::"), (n = !0)) - : ((t += e[r].toString(16)), r < 7 && (t += ":"))); - return "[" + t + "]"; - } - function n(e) { - return !e.host || e.cannotBeABaseURL || "file" == e.scheme; - } - function a(e, t, r, o) { - var n, - s, - i, - a = r || me, - l = 0, - u = "", - c = !1, - d = !1, - h = !1; - for ( - r || - ((e.scheme = ""), - (e.username = ""), - (e.password = ""), - (e.host = null), - (e.port = null), - (e.path = []), - (e.query = null), - (e.fragment = null), - (e.cannotBeABaseURL = !1), - (t = t.replace(ie, ""))), - t = t.replace(ae, ""), - n = b(t); - l <= n.length; - - ) { - switch (((s = n[l]), a)) { - case me: - if (!s || !K.test(s)) { - if (r) return j; - a = ge; - continue; - } - (u += s.toLowerCase()), (a = ye); - break; - case ye: - if (s && ($.test(s) || "+" == s || "-" == s || "." == s)) - u += s.toLowerCase(); - else { - if (":" != s) { - if (r) return j; - (u = ""), (a = ge), (l = 0); - continue; - } - if ( - r && - (k(e) != v(E, u) || - ("file" == u && (C(e) || null !== e.port)) || - ("file" == e.scheme && !e.host)) - ) - return; - if (((e.scheme = u), r)) - return void ( - k(e) && - E[e.scheme] == e.port && - (e.port = null) - ); - (u = ""), - "file" == e.scheme - ? (a = Me) - : k(e) && o && o.scheme == e.scheme - ? (a = ve) - : k(e) - ? (a = xe) - : "/" == n[l + 1] - ? ((a = be), l++) - : ((e.cannotBeABaseURL = !0), - e.path.push(""), - (a = Ce)); - } - break; - case ge: - if (!o || (o.cannotBeABaseURL && "#" != s)) return j; - if (o.cannotBeABaseURL && "#" == s) { - (e.scheme = o.scheme), - (e.path = o.path.slice()), - (e.query = o.query), - (e.fragment = ""), - (e.cannotBeABaseURL = !0), - (a = D); - break; - } - a = "file" == o.scheme ? Me : je; - continue; - case ve: - if ("/" != s || "/" != n[l + 1]) { - a = je; - continue; - } - (a = P), l++; - break; - case be: - if ("/" == s) { - a = A; - break; - } - a = R; - continue; - case je: - if (((e.scheme = o.scheme), s == g)) - (e.username = o.username), - (e.password = o.password), - (e.host = o.host), - (e.port = o.port), - (e.path = o.path.slice()), - (e.query = o.query); - else if ("/" == s || ("\\" == s && k(e))) a = _e; - else if ("?" == s) - (e.username = o.username), - (e.password = o.password), - (e.host = o.host), - (e.port = o.port), - (e.path = o.path.slice()), - (e.query = ""), - (a = I); - else { - if ("#" != s) { - (e.username = o.username), - (e.password = o.password), - (e.host = o.host), - (e.port = o.port), - (e.path = o.path.slice()), - e.path.pop(), - (a = R); - continue; - } - (e.username = o.username), - (e.password = o.password), - (e.host = o.host), - (e.port = o.port), - (e.path = o.path.slice()), - (e.query = o.query), - (e.fragment = ""), - (a = D); - } - break; - case _e: - if (!k(e) || ("/" != s && "\\" != s)) { - if ("/" != s) { - (e.username = o.username), - (e.password = o.password), - (e.host = o.host), - (e.port = o.port), - (a = R); - continue; - } - a = A; - } else a = P; - break; - case xe: - if (((a = P), "/" != s || "/" != u.charAt(l + 1))) continue; - l++; - break; - case P: - if ("/" == s || "\\" == s) break; - a = A; - continue; - case A: - if ("@" == s) { - c && (u = "%40" + u); - for (var c = !0, f = b(u), p = 0; p < f.length; p++) { - var m = f[p]; - ":" != m || h - ? ((m = M(m, T)), - h ? (e.password += m) : (e.username += m)) - : (h = !0); - } - u = ""; - } else if ( - s == g || - "/" == s || - "?" == s || - "#" == s || - ("\\" == s && k(e)) - ) { - if (c && "" == u) return Q; - (l -= b(u).length + 1), (u = ""), (a = we); - } else u += s; - break; - case we: - case Se: - if (r && "file" == e.scheme) { - a = ke; - continue; - } - if (":" != s || d) { - if ( - s == g || - "/" == s || - "?" == s || - "#" == s || - ("\\" == s && k(e)) - ) { - if (k(e) && "" == u) return _; - if (r && "" == u && (C(e) || null !== e.port)) return; - if ((i = w(e, u))) return i; - if (((u = ""), (a = L), r)) return; - continue; - } - "[" == s ? (d = !0) : "]" == s && (d = !1), (u += s); - } else { - if ("" == u) return _; - if ((i = w(e, u))) return i; - if (((u = ""), (a = Te), r == Se)) return; - } - break; - case Te: - if (!x.test(s)) { - if ( - s == g || - "/" == s || - "?" == s || - "#" == s || - ("\\" == s && k(e)) || - r - ) { - if ("" != u) { - var y = parseInt(u, 10); - if (65535 < y) return J; - (e.port = k(e) && y === E[e.scheme] ? null : y), - (u = ""); - } - if (r) return; - a = L; - continue; - } - return J; - } - u += s; - break; - case Me: - if (((e.scheme = "file"), "/" == s || "\\" == s)) a = Ee; - else { - if (!o || "file" != o.scheme) { - a = R; - continue; - } - if (s == g) - (e.host = o.host), - (e.path = o.path.slice()), - (e.query = o.query); - else if ("?" == s) - (e.host = o.host), - (e.path = o.path.slice()), - (e.query = ""), - (a = I); - else { - if ("#" != s) { - de(n.slice(l).join("")) || - ((e.host = o.host), (e.path = o.path.slice()), he(e)), - (a = R); - continue; - } - (e.host = o.host), - (e.path = o.path.slice()), - (e.query = o.query), - (e.fragment = ""), - (a = D); - } - } - break; - case Ee: - if ("/" == s || "\\" == s) { - a = ke; - break; - } - o && - "file" == o.scheme && - !de(n.slice(l).join("")) && - (O(o.path[0], !0) - ? e.path.push(o.path[0]) - : (e.host = o.host)), - (a = R); - continue; - case ke: - if (s == g || "/" == s || "\\" == s || "?" == s || "#" == s) { - if (!r && O(u)) a = R; - else { - if ("" == u) { - if (((e.host = ""), r)) return; - } else { - if ((i = w(e, u))) return i; - if (("localhost" == e.host && (e.host = ""), r)) return; - u = ""; - } - a = L; - } - continue; - } - u += s; - break; - case L: - if (k(e)) { - if (((a = R), "/" != s && "\\" != s)) continue; - } else if (r || "?" != s) - if (r || "#" != s) { - if (s != g && ((a = R), "/" != s)) continue; - } else (e.fragment = ""), (a = D); - else (e.query = ""), (a = I); - break; - case R: - if ( - s == g || - "/" == s || - ("\\" == s && k(e)) || - (!r && ("?" == s || "#" == s)) - ) { - if ( - (pe(u) - ? (he(e), - "/" == s || ("\\" == s && k(e)) || e.path.push("")) - : fe(u) - ? "/" == s || ("\\" == s && k(e)) || e.path.push("") - : ("file" == e.scheme && - !e.path.length && - O(u) && - (e.host && (e.host = ""), - (u = u.charAt(0) + ":")), - e.path.push(u)), - (u = ""), - "file" == e.scheme && (s == g || "?" == s || "#" == s)) - ) - for (; 1 < e.path.length && "" === e.path[0]; ) - e.path.shift(); - "?" == s - ? ((e.query = ""), (a = I)) - : "#" == s && ((e.fragment = ""), (a = D)); - } else u += M(s, ce); - break; - case Ce: - "?" == s - ? ((e.query = ""), (a = I)) - : "#" == s - ? ((e.fragment = ""), (a = D)) - : s != g && (e.path[0] += M(s, S)); - break; - case I: - r || "#" != s - ? s != g && - ("'" == s && k(e) - ? (e.query += "%27") - : (e.query += "#" == s ? "%23" : M(s, S))) - : ((e.fragment = ""), (a = D)); - break; - case D: - s != g && (e.fragment += M(s, ue)); - } - l++; - } - } - function l(e) { - var t, - r, - o = G(this, l, "URL"), - n = 1 < arguments.length ? arguments[1] : void 0, - e = String(e), - s = X(o, { type: "URL" }); - if (void 0 !== n) - if (n instanceof l) t = p(n); - else if ((r = a((t = {}), String(n)))) throw TypeError(r); - if ((r = a(s, e, null, t))) throw TypeError(r); - var i = (s.searchParams = new q()); - (n = f(i)).updateSearchParams(s.query), - (n.updateURL = function () { - s.query = String(i) || null; - }), - u || - ((o.href = m.call(o)), - (o.origin = Oe.call(o)), - (o.protocol = Pe.call(o)), - (o.username = Ae.call(o)), - (o.password = Le.call(o)), - (o.host = Re.call(o)), - (o.hostname = Ie.call(o)), - (o.port = De.call(o)), - (o.pathname = Fe.call(o)), - (o.search = Ue.call(o)), - (o.searchParams = Ne.call(o)), - (o.hash = Be.call(o))); - } - function t(e, t) { - return { get: e, set: t, configurable: !0, enumerable: !0 }; - } - var g, - r, - o, - U = e("../internals/export"), - u = e("../internals/descriptors"), - N = e("../internals/native-url"), - s = e("../internals/global"), - B = e("../internals/object-define-properties"), - i = e("../internals/redefine"), - G = e("../internals/an-instance"), - v = e("../internals/has"), - d = e("../internals/object-assign"), - b = e("../internals/array-from"), - V = e("../internals/string-multibyte").codeAt, - z = e("../internals/string-punycode-to-ascii"), - H = e("../internals/set-to-string-tag"), - W = e("../modules/web.url-search-params"), - e = e("../internals/internal-state"), - h = s.URL, - q = W.URLSearchParams, - f = W.getState, - X = e.set, - p = e.getterFor("URL"), - Y = Math.floor, - Z = Math.pow, - Q = "Invalid authority", - j = "Invalid scheme", - _ = "Invalid host", - J = "Invalid port", - K = /[A-Za-z]/, - $ = /[\d+-.A-Za-z]/, - x = /\d/, - ee = /^(0x|0X)/, - te = /^[0-7]+$/, - re = /^\d+$/, - oe = /^[\dA-Fa-f]+$/, - ne = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/, - se = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/, - ie = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g, - ae = /[\u0009\u000A\u000D]/g, - w = function (e, t) { - var r, o, n; - if ("[" == t.charAt(0)) - return "]" == t.charAt(t.length - 1) && - (r = (function (e) { - var t = [0, 0, 0, 0, 0, 0, 0, 0], - r = 0, - o = null, - n = 0, - s, - i, - a, - l, - u, - c, - d, - h = function () { - return e.charAt(n); - }; - if (h() == ":") { - if (e.charAt(1) != ":") return; - n += 2; - r++; - o = r; - } - while (h()) { - if (r == 8) return; - if (h() == ":") { - if (o !== null) return; - n++; - r++; - o = r; - continue; - } - s = i = 0; - while (i < 4 && oe.test(h())) { - s = s * 16 + parseInt(h(), 16); - n++; - i++; - } - if (h() == ".") { - if (i == 0) return; - n -= i; - if (r > 6) return; - a = 0; - while (h()) { - l = null; - if (a > 0) - if (h() == "." && a < 4) n++; - else return; - if (!x.test(h())) return; - while (x.test(h())) { - u = parseInt(h(), 10); - if (l === null) l = u; - else if (l == 0) return; - else l = l * 10 + u; - if (l > 255) return; - n++; - } - t[r] = t[r] * 256 + l; - a++; - if (a == 2 || a == 4) r++; - } - if (a != 4) return; - break; - } else if (h() == ":") { - n++; - if (!h()) return; - } else if (h()) return; - t[r++] = s; - } - if (o !== null) { - c = r - o; - r = 7; - while (r != 0 && c > 0) { - d = t[r]; - t[r--] = t[o + c - 1]; - t[o + --c] = d; - } - } else if (r != 8) return; - return t; - })(t.slice(1, -1))) - ? void (e.host = r) - : _; - if (k(e)) - return ( - (t = z(t)), - ne.test(t) || - null === - (r = (function (e) { - var t = e.split("."), - r, - o, - n, - s, - i, - a, - l; - if (t.length && t[t.length - 1] == "") t.pop(); - if ((r = t.length) > 4) return e; - for (o = [], n = 0; n < r; n++) { - s = t[n]; - if (s == "") return e; - i = 10; - if (s.length > 1 && s.charAt(0) == "0") { - i = ee.test(s) ? 16 : 8; - s = s.slice(i == 8 ? 1 : 2); - } - if (s === "") a = 0; - else { - if (!(i == 10 ? re : i == 8 ? te : oe).test(s)) - return e; - a = parseInt(s, i); - } - o.push(a); - } - for (n = 0; n < r; n++) { - a = o[n]; - if (n == r - 1) { - if (a >= Z(256, 5 - r)) return null; - } else if (a > 255) return null; - } - for (l = o.pop(), n = 0; n < o.length; n++) - l += o[n] * Z(256, 3 - n); - return l; - })(t)) - ? _ - : void (e.host = r) - ); - if (se.test(t)) return _; - for (r = "", o = b(t), n = 0; n < o.length; n++) r += M(o[n], S); - e.host = r; - }, - le = function (e) { - for (var t = null, r = 1, o = null, n = 0, s = 0; s < 8; s++) - 0 !== e[s] - ? (r < n && ((t = o), (r = n)), (o = null), (n = 0)) - : (null === o && (o = s), ++n); - return r < n && ((t = o), (r = n)), t; - }, - S = {}, - ue = d({}, S, { " ": 1, '"': 1, "<": 1, ">": 1, "`": 1 }), - ce = d({}, ue, { "#": 1, "?": 1, "{": 1, "}": 1 }), - T = d({}, ce, { - "/": 1, - ":": 1, - ";": 1, - "=": 1, - "@": 1, - "[": 1, - "\\": 1, - "]": 1, - "^": 1, - "|": 1, - }), - M = function (e, t) { - var r = V(e, 0); - return 32 < r && r < 127 && !v(t, e) ? e : encodeURIComponent(e); - }, - E = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }, - k = function (e) { - return v(E, e.scheme); - }, - C = function (e) { - return "" != e.username || "" != e.password; - }, - O = function (e, t) { - return ( - 2 == e.length && - K.test(e.charAt(0)) && - (":" == (e = e.charAt(1)) || (!t && "|" == e)) - ); - }, - de = function (e) { - return ( - 1 < e.length && - O(e.slice(0, 2)) && - (2 == e.length || - "/" === (e = e.charAt(2)) || - "\\" === e || - "?" === e || - "#" === e) - ); - }, - he = function (e) { - var t = e.path, - r = t.length; - !r || ("file" == e.scheme && 1 == r && O(t[0], !0)) || t.pop(); - }, - fe = function (e) { - return "." === e || "%2e" === e.toLowerCase(); - }, - pe = function (e) { - return ( - ".." === (e = e.toLowerCase()) || - "%2e." === e || - ".%2e" === e || - "%2e%2e" === e - ); - }, - me = {}, - ye = {}, - ge = {}, - ve = {}, - be = {}, - je = {}, - _e = {}, - xe = {}, - P = {}, - A = {}, - we = {}, - Se = {}, - Te = {}, - Me = {}, - Ee = {}, - ke = {}, - L = {}, - R = {}, - Ce = {}, - I = {}, - D = {}, - s = l.prototype, - m = function () { - var e = p(this), - t = e.scheme, - r = e.username, - o = e.password, - n = e.host, - s = e.port, - i = e.path, - a = e.query, - l = e.fragment, - u = t + ":"; - return ( - null !== n - ? ((u += "//"), - C(e) && (u += r + (o ? ":" + o : "") + "@"), - (u += c(n)), - null !== s && (u += ":" + s)) - : "file" == t && (u += "//"), - (u += e.cannotBeABaseURL - ? i[0] - : i.length - ? "/" + i.join("/") - : ""), - null !== a && (u += "?" + a), - null !== l && (u += "#" + l), - u - ); - }, - Oe = function () { - var e = p(this), - t = e.scheme, - r = e.port; - if ("blob" == t) - try { - return new URL(t.path[0]).origin; - } catch (e) { - return "null"; - } - return "file" != t && k(e) - ? t + "://" + c(e.host) + (null !== r ? ":" + r : "") - : "null"; - }, - Pe = function () { - return p(this).scheme + ":"; - }, - Ae = function () { - return p(this).username; - }, - Le = function () { - return p(this).password; - }, - Re = function () { - var e = p(this), - t = e.host, - e = e.port; - return null === t ? "" : null === e ? c(t) : c(t) + ":" + e; - }, - Ie = function () { - var e = p(this).host; - return null === e ? "" : c(e); - }, - De = function () { - var e = p(this).port; - return null === e ? "" : String(e); - }, - Fe = function () { - var e = p(this), - t = e.path; - return e.cannotBeABaseURL - ? t[0] - : t.length - ? "/" + t.join("/") - : ""; - }, - Ue = function () { - var e = p(this).query; - return e ? "?" + e : ""; - }, - Ne = function () { - return p(this).searchParams; - }, - Be = function () { - var e = p(this).fragment; - return e ? "#" + e : ""; - }; - u && - B(s, { - href: t(m, function (e) { - var t = p(this), - e = String(e), - e = a(t, e); - if (e) throw TypeError(e); - f(t.searchParams).updateSearchParams(t.query); - }), - origin: t(Oe), - protocol: t(Pe, function (e) { - var t = p(this); - a(t, String(e) + ":", me); - }), - username: t(Ae, function (e) { - var t = p(this), - r = b(String(e)); - if (!n(t)) { - t.username = ""; - for (var o = 0; o < r.length; o++) t.username += M(r[o], T); - } - }), - password: t(Le, function (e) { - var t = p(this), - r = b(String(e)); - if (!n(t)) { - t.password = ""; - for (var o = 0; o < r.length; o++) t.password += M(r[o], T); - } - }), - host: t(Re, function (e) { - var t = p(this); - t.cannotBeABaseURL || a(t, String(e), we); - }), - hostname: t(Ie, function (e) { - var t = p(this); - t.cannotBeABaseURL || a(t, String(e), Se); - }), - port: t(De, function (e) { - var t = p(this); - n(t) || ("" == (e = String(e)) ? (t.port = null) : a(t, e, Te)); - }), - pathname: t(Fe, function (e) { - var t = p(this); - t.cannotBeABaseURL || ((t.path = []), a(t, e + "", L)); - }), - search: t(Ue, function (e) { - var t = p(this); - "" == (e = String(e)) - ? (t.query = null) - : ("?" == e.charAt(0) && (e = e.slice(1)), - (t.query = ""), - a(t, e, I)), - f(t.searchParams).updateSearchParams(t.query); - }), - searchParams: t(Ne), - hash: t(Be, function (e) { - var t = p(this); - "" == (e = String(e)) - ? (t.fragment = null) - : ("#" == e.charAt(0) && (e = e.slice(1)), - (t.fragment = ""), - a(t, e, D)); - }), - }), - i( - s, - "toJSON", - function () { - return m.call(this); - }, - { enumerable: !0 }, - ), - i( - s, - "toString", - function () { - return m.call(this); - }, - { enumerable: !0 }, - ), - h && - ((r = h.createObjectURL), - (o = h.revokeObjectURL), - r && - i(l, "createObjectURL", function (e) { - return r.apply(h, arguments); - }), - o && - i(l, "revokeObjectURL", function (e) { - return o.apply(h, arguments); - })), - H(l, "URL"), - U({ global: !0, forced: !N, sham: !u }, { URL: l }); - }, - { - "../internals/an-instance": 9, - "../internals/array-from": 17, - "../internals/descriptors": 43, - "../internals/export": 50, - "../internals/global": 59, - "../internals/has": 60, - "../internals/internal-state": 70, - "../internals/native-url": 84, - "../internals/object-assign": 89, - "../internals/object-define-properties": 91, - "../internals/redefine": 108, - "../internals/set-to-string-tag": 117, - "../internals/string-multibyte": 123, - "../internals/string-punycode-to-ascii": 126, - "../modules/es.string.iterator": 192, - "../modules/web.url-search-params": 239, - }, - ], - 241: [ - function (e, t, r) { - "use strict"; - t.exports = e("./").polyfill(); - }, - { "./": 242 }, - ], - 242: [ - function (V, r, o) { - !function (B, G) { - var e, t; - (e = this), - (t = function () { - "use strict"; - function l(e) { - return "function" == typeof e; - } - var r = - Array.isArray || - function (e) { - return ( - "[object Array]" === Object.prototype.toString.call(e) - ); - }, - o = 0, - t = void 0, - n = void 0, - i = function (e, t) { - (d[o] = e), - (d[o + 1] = t), - 2 === (o += 2) && (n ? n(h) : D()); - }; - var e = "undefined" != typeof window ? window : void 0, - s = e || {}, - s = s.MutationObserver || s.WebKitMutationObserver, - a = - "undefined" == typeof self && - void 0 !== B && - "[object process]" === {}.toString.call(B), - 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 < o; e += 2) - (0, d[e])(d[e + 1]), (d[e] = void 0), (d[e + 1] = void 0); - o = 0; - } - function f() { - try { - var e = Function("return this")().require("vertx"); - return void 0 !== (t = e.runOnLoop || e.runOnContext) - ? function () { - t(h); - } - : c(); - } catch (e) { - return c(); - } - } - var p, - m, - y, - D = void 0; - function g(e, t) { - var r, - o = this, - n = new this.constructor(j), - s = (void 0 === n[b] && A(n), o._state); - return ( - s - ? ((r = arguments[s - 1]), - i(function () { - return O(s, n, r, o._result); - })) - : k(o, n, e, t), - n - ); - } - function v(e) { - var t; - return e && "object" == typeof e && e.constructor === this - ? e - : (T((t = new this(j)), e), t); - } - var D = a - ? function () { - return B.nextTick(h); - } - : s - ? ((m = 0), - (a = new s(h)), - (y = document.createTextNode("")), - a.observe(y, { characterData: !0 }), - function () { - y.data = m = ++m % 2; - }) - : u - ? (((p = new MessageChannel()).port1.onmessage = h), - function () { - return p.port2.postMessage(0); - }) - : (void 0 === e && "function" == typeof V ? f : c)(), - b = Math.random().toString(36).substring(2); - function j() {} - var _ = void 0, - x = 1, - w = 2; - function F(e, o, n) { - i(function (t) { - var r = !1, - e = (function (e, t, r, o) { - try { - e.call(t, r, o); - } catch (e) { - return e; - } - })( - n, - o, - function (e) { - r || ((r = !0), (o !== e ? T : M)(t, e)); - }, - function (e) { - r || ((r = !0), E(t, e)); - }, - t._label, - ); - !r && e && ((r = !0), E(t, e)); - }, e); - } - function S(e, t, r) { - var o, n; - t.constructor === e.constructor && - r === g && - t.constructor.resolve === v - ? ((o = e), - (n = t)._state === x - ? M(o, n._result) - : n._state === w - ? E(o, n._result) - : k( - n, - void 0, - function (e) { - return T(o, e); - }, - function (e) { - return E(o, e); - }, - )) - : void 0 !== r && l(r) - ? F(e, t, r) - : M(e, t); - } - function T(t, e) { - if (t === e) - E( - t, - new TypeError("You cannot resolve a promise with itself"), - ); - else if ( - ((r = typeof e), - null === e || ("object" != r && "function" != r)) - ) - M(t, e); - else { - r = void 0; - try { - r = e.then; - } catch (e) { - return void E(t, e); - } - S(t, e, r); - } - var r; - } - function U(e) { - e._onerror && e._onerror(e._result), C(e); - } - function M(e, t) { - e._state === _ && - ((e._result = t), - (e._state = x), - 0 !== e._subscribers.length && i(C, e)); - } - function E(e, t) { - e._state === _ && ((e._state = w), (e._result = t), i(U, e)); - } - function k(e, t, r, o) { - var n = e._subscribers, - s = n.length; - (e._onerror = null), - (n[s] = t), - (n[s + x] = r), - (n[s + w] = o), - 0 === s && e._state && i(C, e); - } - function C(e) { - var t = e._subscribers, - r = e._state; - if (0 !== t.length) { - for ( - var o, n = void 0, s = e._result, i = 0; - i < t.length; - i += 3 - ) - (o = t[i]), (n = t[i + r]), o ? O(r, o, n, s) : n(s); - e._subscribers.length = 0; - } - } - function O(e, t, r, o) { - var n = l(r), - s = void 0, - i = void 0, - a = !0; - if (n) { - try { - s = r(o); - } catch (e) { - (a = !1), (i = e); - } - if (t === s) - return void E( - t, - new TypeError( - "A promises callback cannot return that same promise.", - ), - ); - } else s = o; - t._state === _ && - (n && a - ? T(t, s) - : !1 === a - ? E(t, i) - : e === x - ? M(t, s) - : e === w && E(t, s)); - } - var P = 0; - function A(e) { - (e[b] = P++), - (e._state = void 0), - (e._result = void 0), - (e._subscribers = []); - } - (L.prototype._enumerate = function (e) { - for (var t = 0; this._state === _ && t < e.length; t++) - this._eachEntry(e[t], t); - }), - (L.prototype._eachEntry = function (t, e) { - var r = this._instanceConstructor, - o = r.resolve; - if (o === v) { - var n, - s = void 0, - i = void 0, - a = !1; - try { - s = t.then; - } catch (e) { - (a = !0), (i = e); - } - s === g && t._state !== _ - ? this._settledAt(t._state, e, t._result) - : "function" != typeof s - ? (this._remaining--, (this._result[e] = t)) - : r === R - ? ((n = new r(j)), - a ? E(n, i) : S(n, t, s), - this._willSettleAt(n, e)) - : this._willSettleAt( - new r(function (e) { - return e(t); - }), - e, - ); - } else this._willSettleAt(o(t), e); - }), - (L.prototype._settledAt = function (e, t, r) { - var o = this.promise; - o._state === _ && - (this._remaining--, - e === w ? E(o, r) : (this._result[t] = r)), - 0 === this._remaining && M(o, this._result); - }), - (L.prototype._willSettleAt = function (e, t) { - var r = this; - k( - e, - void 0, - function (e) { - return r._settledAt(x, t, e); - }, - function (e) { - return r._settledAt(w, t, e); - }, - ); - }); - var N = L; - function L(e, t) { - (this._instanceConstructor = e), - (this.promise = new e(j)), - this.promise[b] || A(this.promise), - r(t) - ? ((this.length = t.length), - (this._remaining = t.length), - (this._result = new Array(this.length)), - (0 !== this.length && - ((this.length = this.length || 0), - this._enumerate(t), - 0 !== this._remaining)) || - M(this.promise, this._result)) - : E( - this.promise, - new Error("Array Methods must be provided an Array"), - ); - } - (I.prototype.catch = function (e) { - return this.then(null, e); - }), - (I.prototype.finally = function (t) { - var r = this.constructor; - return l(t) - ? this.then( - function (e) { - return r.resolve(t()).then(function () { - return e; - }); - }, - function (e) { - return r.resolve(t()).then(function () { - throw e; - }); - }, - ) - : this.then(t, t); - }); - var R = I; - function I(e) { - if ( - ((this[b] = P++), - (this._result = this._state = void 0), - (this._subscribers = []), - j !== e) - ) { - if ("function" != typeof e) - throw new TypeError( - "You must pass a resolver function as the first argument to the promise constructor", - ); - if (!(this instanceof I)) - throw new TypeError( - "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.", - ); - var t = this; - try { - e( - function (e) { - T(t, e); - }, - function (e) { - E(t, e); - }, - ); - } catch (e) { - E(t, e); - } - } - } - return ( - (R.prototype.then = g), - (R.all = function (e) { - return new N(this, e).promise; - }), - (R.race = function (n) { - var s = this; - return r(n) - ? new s(function (e, t) { - for (var r = n.length, o = 0; o < r; o++) - s.resolve(n[o]).then(e, t); - }) - : new s(function (e, t) { - return t( - new TypeError("You must pass an array to race."), - ); - }); - }), - (R.resolve = v), - (R.reject = function (e) { - var t = new this(j); - return E(t, e), t; - }), - (R._setScheduler = function (e) { - n = e; - }), - (R._setAsap = function (e) { - i = e; - }), - (R._asap = i), - (R.polyfill = function () { - var e = void 0; - if (void 0 !== G) e = G; - else if ("undefined" != typeof self) e = self; - else - try { - e = Function("return this")(); - } catch (e) { - throw new Error( - "polyfill failed because global object is unavailable in this environment", - ); - } - var t = e.Promise; - if (t) { - var r = null; - try { - r = Object.prototype.toString.call(t.resolve()); - } catch (e) {} - if ("[object Promise]" === r && !t.cast) return; - } - e.Promise = R; - }), - (R.Promise = R) - ); - }), - "object" == typeof o && void 0 !== r - ? (r.exports = t()) - : "function" == typeof s && s.amd - ? s(t) - : (e.ES6Promise = t()); - }.call( - this, - V("_process"), - "undefined" != typeof global - ? global - : "undefined" != typeof self - ? self - : "undefined" != typeof window - ? window - : {}, - ); - }, - { _process: 251 }, - ], - 243: [ - function (e, t, r) { - var o, n; - (o = this), - (n = function (e, t) { - "use strict"; - var r = 5e3, - o = "callback"; - function d(t) { - try { - delete window[t]; - } catch (e) { - window[t] = void 0; - } - } - function h(e) { - e = document.getElementById(e); - e && document.getElementsByTagName("head")[0].removeChild(e); - } - t.exports = function (s) { - var i = - arguments.length <= 1 || void 0 === arguments[1] - ? {} - : arguments[1], - a = s, - l = i.timeout || r, - u = i.jsonpCallback || o, - c = void 0; - return new Promise(function (t, e) { - var r = - i.jsonpCallbackFunction || - "jsonp_" + - Date.now() + - "_" + - Math.ceil(1e5 * Math.random()), - o = u + "_" + r, - n = - ((window[r] = function (e) { - t({ - ok: !0, - json: function () { - return Promise.resolve(e); - }, - }), - c && clearTimeout(c), - h(o), - d(r); - }), - (a += -1 === a.indexOf("?") ? "?" : "&"), - document.createElement("script")); - n.setAttribute("src", "" + a + u + "=" + r), - i.charset && n.setAttribute("charset", i.charset), - (n.id = o), - document.getElementsByTagName("head")[0].appendChild(n), - (c = setTimeout(function () { - e(new Error("JSONP request to " + s + " timed out")), - d(r), - h(o), - (window[r] = function () { - d(r); - }); - }, l)), - (n.onerror = function () { - e(new Error("JSONP request to " + s + " failed")), - d(r), - h(o), - c && clearTimeout(c); - }); - }); - }; - }), - "function" == typeof s && s.amd - ? s(["exports", "module"], n) - : void 0 !== r && void 0 !== t - ? n(0, t) - : (n((n = { exports: {} }), n), (o.fetchJsonp = n.exports)); - }, - {}, - ], - 244: [ - function (e, t, r) { - var o = (function (a) { - "use strict"; - var l, u, c, d, h, f, t, p, m, o, e; - if ( - !( - void 0 === a || - ("undefined" != typeof navigator && - /MSIE [1-9]\./.test(navigator.userAgent)) - ) - ) - return ( - (e = a.document), - (l = function () { - return a.URL || a.webkitURL || a; - }), - (u = e.createElementNS("http://www.w3.org/1999/xhtml", "a")), - (c = "download" in u), - (d = /constructor/i.test(a.HTMLElement) || a.safari), - (h = /CriOS\/[\d]+/.test(navigator.userAgent)), - (f = function (e) { - (a.setImmediate || a.setTimeout)(function () { - throw e; - }, 0); - }), - (t = 4e4), - (p = function (e) { - setTimeout(function () { - "string" == typeof e ? l().revokeObjectURL(e) : e.remove(); - }, t); - }), - (m = function (e) { - return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test( - e.type, - ) - ? new Blob([String.fromCharCode(65279), e], { - type: e.type, - }) - : e; - }), - (e = (o = function (e, r, t) { - t || (e = m(e)); - var o, - n, - s = this, - t = "application/octet-stream" === e.type, - i = function () { - for ( - var e = s, - t = "writestart progress write writeend".split(" "), - r = void 0, - o = (t = [].concat(t)).length; - o--; - - ) { - var n = e["on" + t[o]]; - if ("function" == typeof n) - try { - n.call(e, r || e); - } catch (e) { - f(e); - } - } - }; - (s.readyState = s.INIT), - c - ? ((o = l().createObjectURL(e)), - setTimeout(function () { - var e, t; - (u.href = o), - (u.download = r), - (e = u), - (t = new MouseEvent("click")), - e.dispatchEvent(t), - i(), - p(o), - (s.readyState = s.DONE); - })) - : (h || (t && d)) && a.FileReader - ? (((n = new FileReader()).onloadend = function () { - var e = h - ? n.result - : n.result.replace( - /^data:[^;]*;/, - "data:attachment/file;", - ); - a.open(e, "_blank") || (a.location.href = e), - (e = void 0), - (s.readyState = s.DONE), - i(); - }), - n.readAsDataURL(e), - (s.readyState = s.INIT)) - : ((o = o || l().createObjectURL(e)), - (!t && a.open(o, "_blank")) || (a.location.href = o), - (s.readyState = s.DONE), - i(), - p(o)); - }).prototype), - "undefined" != typeof navigator && navigator.msSaveOrOpenBlob - ? function (e, t, r) { - return ( - (t = t || e.name || "download"), - r || (e = m(e)), - navigator.msSaveOrOpenBlob(e, t) - ); - } - : ((e.abort = function () {}), - (e.readyState = e.INIT = 0), - (e.WRITING = 1), - (e.DONE = 2), - (e.error = - e.onwritestart = - e.onprogress = - e.onwrite = - e.onabort = - e.onerror = - e.onwriteend = - null), - function (e, t, r) { - return new o(e, t || e.name || "download", r); - }) - ); - })( - ("undefined" != typeof self && self) || - ("undefined" != typeof window && window) || - this.content, - ); - void 0 !== t && t.exports - ? (t.exports.saveAs = o) - : null != s && - null !== s.amd && - s("FileSaver.js", function () { - return o; - }); - }, - {}, - ], - 245: [ - function (e, t, r) { - var o, - n = Object.defineProperty, - s = (n(r, "__esModule", { value: !0 }), r), - i = { - GIFEncoder: () => h, - applyPalette: () => - function (e, t, r = "rgb565") { - if (!e || !e.buffer) - throw new Error("quantize() expected RGBA Uint8Array data"); - if ( - !(e instanceof Uint8Array || e instanceof Uint8ClampedArray) - ) - throw new Error("quantize() expected RGBA Uint8Array data"); - if (256 < t.length) - throw new Error( - "applyPalette() only works with 256 colors or less", - ); - const o = new Uint32Array(e.buffer), - n = o.length, - s = "rgb444" === r ? 4096 : 65536, - i = new Uint8Array(n), - a = new Array(s); - if ("rgba4444" === r) - for (let e = 0; e < n; e++) { - var l = o[e], - u = (l >> 24) & 255, - c = (l >> 16) & 255, - d = (l >> 8) & 255, - l = 255 & l, - h = P(l, d, c, u), - h = - h in a - ? a[h] - : (a[h] = (function (t, r, o, n, s) { - let i = 0, - a = 1e100; - for (let e = 0; e < s.length; e++) { - var l, - u = s[e], - c = v(u[3] - n); - c > a || - ((l = u[0]), - (c += v(l - t)) > a || - ((l = u[1]), - (c += v(l - r)) > a || - ((l = u[2]), - (c += v(l - o)) > a || - ((a = c), (i = e))))); - } - return i; - })(l, d, c, u, t)); - i[e] = h; - } - else { - const g = "rgb444" === r ? A : O; - for (let e = 0; e < n; e++) { - var f = o[e], - p = (f >> 16) & 255, - m = (f >> 8) & 255, - f = 255 & f, - y = g(f, m, p), - y = - y in a - ? a[y] - : (a[y] = (function (t, r, o, n) { - let s = 0, - i = 1e100; - for (let e = 0; e < n.length; e++) { - var a, - l = n[e], - u = v(l[0] - t); - u > i || - ((a = l[1]), - (u += v(a - r)) > i || - ((a = l[2]), - (u += v(a - o)) > i || - ((i = u), (s = e)))); - } - return s; - })(f, m, p, t)); - i[e] = y; - } - } - return i; - }, - default: () => f, - nearestColor: () => - function (e, t, r = u) { - return e[l(e, t, r)]; - }, - nearestColorIndex: () => l, - nearestColorIndexWithDistance: () => d, - prequantize: () => - function ( - e, - { - roundRGB: r = 5, - roundAlpha: o = 10, - oneBitAlpha: n = null, - } = {}, - ) { - const s = new Uint32Array(e.buffer); - for (let t = 0; t < s.length; t++) { - var i = s[t]; - let e = (i >> 24) & 255; - var a, - l = (i >> 16) & 255, - u = (i >> 8) & 255, - i = 255 & i; - (e = c(e, o)), - n && - ((a = "number" == typeof n ? n : 127), - (e = e <= a ? 0 : 255)), - (i = c(i, r)), - (u = c(u, r)), - (l = c(l, r)), - (s[t] = (e << 24) | (l << 16) | (u << 8) | (i << 0)); - } - }, - quantize: () => - function (e, t, r = {}) { - var { - format: o = "rgb565", - clearAlpha: n = !0, - clearAlphaColor: s = 0, - clearAlphaThreshold: i = 0, - oneBitAlpha: a = !1, - } = r; - if (!e || !e.buffer) - throw new Error("quantize() expected RGBA Uint8Array data"); - if ( - !(e instanceof Uint8Array || e instanceof Uint8ClampedArray) - ) - throw new Error("quantize() expected RGBA Uint8Array data"); - e = new Uint32Array(e.buffer); - let l = !1 !== r.useSqrt; - const u = "rgba4444" === o, - c = (function (r, e) { - const t = "rgb444" === e ? 4096 : 65536, - o = new Array(t), - n = r.length; - if ("rgba4444" === e) - for (let t = 0; t < n; ++t) { - var s = r[t], - i = (s >> 24) & 255, - a = (s >> 16) & 255, - l = (s >> 8) & 255, - s = 255 & s, - u = P(s, l, a, i); - let e = u in o ? o[u] : (o[u] = D()); - (e.rc += s), - (e.gc += l), - (e.bc += a), - (e.ac += i), - e.cnt++; - } - else if ("rgb444" === e) - for (let t = 0; t < n; ++t) { - var c = r[t], - d = (c >> 16) & 255, - h = (c >> 8) & 255, - c = 255 & c, - f = A(c, h, d); - let e = f in o ? o[f] : (o[f] = D()); - (e.rc += c), (e.gc += h), (e.bc += d), e.cnt++; - } - else - for (let t = 0; t < n; ++t) { - var p = r[t], - m = (p >> 16) & 255, - y = (p >> 8) & 255, - p = 255 & p, - g = O(p, y, m); - let e = g in o ? o[g] : (o[g] = D()); - (e.rc += p), (e.gc += y), (e.bc += m), e.cnt++; - } - return o; - })(e, o), - d = c.length, - h = d - 1, - f = new Uint32Array(d + 1); - for (var p = 0, m = 0; m < d; ++m) { - const C = c[m]; - null != C && - ((M = 1 / C.cnt), - u && (C.ac *= M), - (C.rc *= M), - (C.gc *= M), - (C.bc *= M), - (c[p++] = C)); - } - R(t) / p < 0.022 && (l = !1); - for (var y, g, v, m = 0; m < p - 1; ++m) - (c[m].fw = m + 1), - (c[m + 1].bk = m), - l && (c[m].cnt = Math.sqrt(c[m].cnt)); - l && (c[m].cnt = Math.sqrt(c[m].cnt)); - for (m = 0; m < p; ++m) { - I(c, m, !1); - var b = c[m].err; - for ( - g = ++f[0]; - 1 < g && ((v = g >> 1), !(c[(y = f[v])].err <= b)); - g = v - ) - f[g] = y; - f[g] = m; - } - var j, - _ = p - t; - for (m = 0; m < _; ) { - for (;;) { - var x = f[1]; - if ((j = c[x]).tm >= j.mtm && c[j.nn].mtm <= j.tm) break; - j.mtm == h - ? (x = f[1] = f[f[0]--]) - : (I(c, x, !1), (j.tm = m)); - b = c[x].err; - for ( - g = 1; - (v = g + g) <= f[0] && - (v < f[0] && c[f[v]].err > c[f[v + 1]].err && v++, - !(b <= c[(y = f[v])].err)); - g = v - ) - f[g] = y; - f[g] = x; - } - var w = c[j.nn], - S = j.cnt, - T = w.cnt, - M = 1 / (S + T); - u && (j.ac = M * (S * j.ac + T * w.ac)), - (j.rc = M * (S * j.rc + T * w.rc)), - (j.gc = M * (S * j.gc + T * w.gc)), - (j.bc = M * (S * j.bc + T * w.bc)), - (j.cnt += w.cnt), - (j.mtm = ++m), - (c[w.bk].fw = w.fw), - (c[w.fw].bk = w.bk), - (w.mtm = h); - } - let E = []; - for (m = 0; ; 0) { - let e = L(Math.round(c[m].rc), 0, 255), - t = L(Math.round(c[m].gc), 0, 255), - r = L(Math.round(c[m].bc), 0, 255), - o = 255; - u && - ((o = L(Math.round(c[m].ac), 0, 255)), - a && - ((k = "number" == typeof a ? a : 127), - (o = o <= k ? 0 : 255)), - n && o <= i && ((e = t = r = s), (o = 0))); - var k = u ? [e, t, r, o] : [e, t, r]; - if ( - ((function (t, r) { - for (let e = 0; e < t.length; e++) { - var o = t[e], - n = o[0] === r[0] && o[1] === r[1] && o[2] === r[2], - o = - !(4 <= o.length && 4 <= r.length) || - o[3] === r[3]; - if (n && o) return !0; - } - return !1; - })(E, k) || E.push(k), - 0 == (m = c[m].fw)) - ) - break; - } - return E; - }, - snapColorsToPalette: () => - function (r, o, e = 5) { - if (r.length && o.length) { - var n = r.map((e) => e.slice(0, 3)), - s = e * e, - i = r[0].length; - for (let t = 0; t < o.length; t++) { - let e = o[t]; - e = - e.length < i - ? [e[0], e[1], e[2], 255] - : e.length > i - ? e.slice(0, 3) - : e.slice(); - var a = d(n, e.slice(0, 3), u), - l = a[0], - a = a[1]; - 0 < a && a <= s && (r[l] = e); - } - } - }, - }; - for (o in i) n(s, o, { get: i[o], enumerable: !0 }); - var a = { - signature: "GIF", - version: "89a", - trailer: 59, - extensionIntroducer: 33, - applicationExtensionLabel: 255, - graphicControlExtensionLabel: 249, - imageSeparator: 44, - signatureSize: 3, - versionSize: 3, - globalColorTableFlagMask: 128, - colorResolutionMask: 112, - sortFlagMask: 8, - globalColorTableSizeMask: 7, - applicationIdentifierSize: 8, - applicationAuthCodeSize: 3, - disposalMethodMask: 28, - userInputFlagMask: 2, - transparentColorFlagMask: 1, - localColorTableFlagMask: 128, - interlaceFlagMask: 64, - idSortFlagMask: 32, - localColorTableSizeMask: 7, - }; - function E(e = 256) { - let n = 0, - s = new Uint8Array(e); - return { - get buffer() { - return s.buffer; - }, - reset() { - n = 0; - }, - bytesView() { - return s.subarray(0, n); - }, - bytes() { - return s.slice(0, n); - }, - writeByte(e) { - i(n + 1), (s[n] = e), n++; - }, - writeBytes(t, r = 0, o = t.length) { - i(n + o); - for (let e = 0; e < o; e++) s[n++] = t[e + r]; - }, - writeBytesView(e, t = 0, r = e.byteLength) { - i(n + r), s.set(e.subarray(t, t + r), n), (n += r); - }, - }; - function i(e) { - var t = s.length; - if (!(e <= t)) { - (e = Math.max(e, (t * (t < 1048576 ? 2 : 1.125)) >>> 0)), - 0 != t && (e = Math.max(e, 256)); - const r = s; - (s = new Uint8Array(e)), 0 < n && s.set(r.subarray(0, n), 0); - } - } - } - var k = [ - 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, - 16383, 32767, 65535, - ]; - var S = function ( - e, - t, - r, - o, - n = E(512), - s = new Uint8Array(256), - i = new Int32Array(5003), - a = new Int32Array(5003), - ) { - var l = i.length, - o = Math.max(2, o); - s.fill(0), a.fill(0), i.fill(-1); - let u = 0, - c = 0; - var d = o + 1; - const h = d; - let f = !1, - p = h, - m = (1 << p) - 1; - var y = 1 << (d - 1); - const g = 1 + y; - let v = 2 + y, - b = 0, - j = r[0], - _ = 0; - for (let e = l; e < 65536; e *= 2) ++_; - (_ = 8 - _), n.writeByte(o), M(y); - var x = r.length; - for (let t = 1; t < x; t++) - e: { - var w = r[t], - S = (w << 12) + j; - let e = (w << _) ^ j; - if (i[e] === S) j = a[e]; - else { - for (var T = 0 === e ? 1 : l - e; 0 <= i[e]; ) - if (((e -= T) < 0 && (e += l), i[e] === S)) { - j = a[e]; - break e; - } - M(j), - (j = w), - v < 4096 - ? ((a[e] = v++), (i[e] = S)) - : (i.fill(-1), (v = 2 + y), (f = !0), M(y)); - } - } - return M(j), M(g), n.writeByte(0), n.bytesView(); - function M(e) { - for (u &= k[c], 0 < c ? (u |= e << c) : (u = e), c += p; 8 <= c; ) - (s[b++] = 255 & u), - 254 <= b && - (n.writeByte(b), n.writeBytesView(s, 0, b), (b = 0)), - (u >>= 8), - (c -= 8); - if ( - ((v > m || f) && - (f - ? ((p = h), (m = (1 << p) - 1), (f = !1)) - : (++p, (m = 12 === p ? 1 << p : (1 << p) - 1))), - e == g) - ) { - for (; 0 < c; ) - (s[b++] = 255 & u), - 254 <= b && - (n.writeByte(b), n.writeBytesView(s, 0, b), (b = 0)), - (u >>= 8), - (c -= 8); - 0 < b && (n.writeByte(b), n.writeBytesView(s, 0, b), (b = 0)); - } - } - }; - function O(e, t, r) { - return ((e << 8) & 63488) | ((t << 2) & 992) | (r >> 3); - } - function P(e, t, r, o) { - return (e >> 4) | (240 & t) | ((240 & r) << 4) | ((240 & o) << 8); - } - function A(e, t, r) { - return ((e >> 4) << 8) | (240 & t) | (r >> 4); - } - function L(e, t, r) { - return e < t ? t : r < e ? r : e; - } - function R(e) { - return e * e; - } - function I(e, t, r) { - var o = 0, - n = 1e100; - const s = e[t]; - for ( - var i = s.cnt, a = s.ac, l = s.rc, u = s.gc, c = s.bc, d = s.fw; - 0 != d; - d = e[d].fw - ) { - var h, - f = e[d], - p = f.cnt, - p = (i * p) / (i + p); - n <= p || - ((h = 0), - (r && n <= (h += p * R(f.ac - a))) || - n <= (h += p * R(f.rc - l)) || - n <= (h += p * R(f.gc - u)) || - n <= (h += p * R(f.bc - c)) || - ((n = h), (o = d))); - } - (s.err = n), (s.nn = o); - } - function D() { - return { - ac: 0, - rc: 0, - gc: 0, - bc: 0, - cnt: 0, - nn: 0, - fw: 0, - bk: 0, - tm: 0, - mtm: 0, - err: 0, - }; - } - function u(e, t) { - for (var r = 0, o = 0; o < e.length; o++) { - var n = e[o] - t[o]; - r += n * n; - } - return r; - } - function c(e, t) { - return 1 < t ? Math.round(e / t) * t : e; - } - function v(e) { - return e * e; - } - function l(t, r, o = u) { - let n = 1 / 0, - s = -1; - for (let e = 0; e < t.length; e++) { - var i = o(r, t[e]); - i < n && ((n = i), (s = e)); - } - return s; - } - function d(t, r, o = u) { - let n = 1 / 0, - s = -1; - for (let e = 0; e < t.length; e++) { - var i = o(r, t[e]); - i < n && ((n = i), (s = e)); - } - return [s, n]; - } - function h(e = {}) { - const { initialCapacity: t = 4096, auto: g = !0 } = e, - v = E(t); - const b = new Uint8Array(256), - j = new Int32Array(5003), - _ = new Int32Array(5003); - let x = !1; - return { - reset() { - v.reset(), (x = !1); - }, - finish() { - v.writeByte(a.trailer); - }, - bytes() { - return v.bytes(); - }, - bytesView() { - return v.bytesView(); - }, - get buffer() { - return v.buffer; - }, - get stream() { - return v; - }, - writeHeader: w, - writeFrame(e, t, r, o = {}) { - var { - transparent: n = !1, - transparentIndex: s = 0, - delay: i = 0, - palette: a = null, - repeat: l = 0, - colorDepth: u = 8, - dispose: c = -1, - } = o; - let d = !1; - if ( - (g ? x || ((d = !0), w(), (x = !0)) : (d = Boolean(o.first)), - (t = Math.max(0, Math.floor(t))), - (r = Math.max(0, Math.floor(r))), - d) - ) { - if (!a) - throw new Error( - "First frame must include a { palette } option", - ); - var [o, h, f, p, m = 8] = [v, t, r, a, u]; - (p = F(p.length) - 1), - (m = 128 | ((m - 1) << 4) | p), - M(o, h), - M(o, f), - o.writeBytes([m, 0, 0]), - T(v, a), - 0 <= l && - ((p = v), - (h = l), - p.writeByte(33), - p.writeByte(255), - p.writeByte(11), - C(p, "NETSCAPE2.0"), - p.writeByte(3), - p.writeByte(1), - M(p, h), - p.writeByte(0)); - } - var y, - f = Math.round(i / 10), - o = v, - m = c, - l = f, - h = n, - p = s, - i = - (o.writeByte(33), - o.writeByte(249), - o.writeByte(4), - p < 0 && ((p = 0), (h = !1)), - (h = h ? ((y = 1), 2) : (y = 0)), - 0 <= m && (h = 7 & m), - (h <<= 2), - o.writeByte(0 | h | y), - M(o, l), - o.writeByte(p || 0), - o.writeByte(0), - Boolean(a) && !d); - (c = v), - (n = t), - (s = r), - (y = i ? a : null), - c.writeByte(44), - M(c, 0), - M(c, 0), - M(c, n), - M(c, s), - y - ? ((n = F(y.length) - 1), c.writeByte(128 | n)) - : c.writeByte(0), - i && T(v, a), - ([l, o, s, n, c = 8, i, a, e] = [v, e, t, r, u, b, j, _]), - S(s, n, o, c, l, i, a, e); - }, - }; - function w() { - C(v, "GIF89a"); - } - } - function T(r, o) { - var e = 1 << F(o.length); - for (let t = 0; t < e; t++) { - let e = [0, 0, 0]; - t < o.length && (e = o[t]), - r.writeByte(e[0]), - r.writeByte(e[1]), - r.writeByte(e[2]); - } - } - function M(e, t) { - e.writeByte(255 & t), e.writeByte((t >> 8) & 255); - } - function C(e, t) { - for (var r = 0; r < t.length; r++) e.writeByte(t.charCodeAt(r)); - } - function F(e) { - return Math.max(Math.ceil(Math.log2(e)), 1); - } - var f = h; - }, - {}, - ], - 246: [ - function (e, t, r) { - (r.read = function (e, t, r, o, n) { - var s, - i, - a = 8 * n - o - 1, - l = (1 << a) - 1, - u = l >> 1, - c = -7, - d = r ? n - 1 : 0, - h = r ? -1 : 1, - n = e[t + d]; - for ( - d += h, s = n & ((1 << -c) - 1), n >>= -c, c += a; - 0 < c; - s = 256 * s + e[t + d], d += h, c -= 8 - ); - for ( - i = s & ((1 << -c) - 1), s >>= -c, c += o; - 0 < c; - i = 256 * i + e[t + d], d += h, c -= 8 - ); - if (0 === s) s = 1 - u; - else { - if (s === l) return i ? NaN : (1 / 0) * (n ? -1 : 1); - (i += Math.pow(2, o)), (s -= u); - } - return (n ? -1 : 1) * i * Math.pow(2, s - o); - }), - (r.write = function (e, t, r, o, n, s) { - var i, - a, - l = 8 * s - n - 1, - u = (1 << l) - 1, - c = u >> 1, - d = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, - h = o ? 0 : s - 1, - f = o ? 1 : -1, - s = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0; - for ( - t = Math.abs(t), - isNaN(t) || t === 1 / 0 - ? ((a = isNaN(t) ? 1 : 0), (i = u)) - : ((i = Math.floor(Math.log(t) / Math.LN2)), - t * (o = Math.pow(2, -i)) < 1 && (i--, (o *= 2)), - 2 <= - (t += 1 <= i + c ? d / o : d * Math.pow(2, 1 - c)) * - o && (i++, (o /= 2)), - u <= i + c - ? ((a = 0), (i = u)) - : 1 <= i + c - ? ((a = (t * o - 1) * Math.pow(2, n)), (i += c)) - : ((a = t * Math.pow(2, c - 1) * Math.pow(2, n)), - (i = 0))); - 8 <= n; - e[r + h] = 255 & a, h += f, a /= 256, n -= 8 - ); - for ( - i = (i << n) | a, l += n; - 0 < l; - e[r + h] = 255 & i, h += f, i /= 256, l -= 8 - ); - e[r + h - f] |= 128 * s; - }); - }, - {}, - ], - 247: [ - function (o, e, c) { - "use strict"; - var t; - function y(e, t) { - return e.b === t.b && e.a === t.a; - } - function g(e, t) { - return e.b < t.b || (e.b === t.b && e.a <= t.a); - } - function v(e, t, r) { - var o = t.b - e.b, - n = r.b - t.b; - return 0 < o + n - ? o < n - ? t.a - e.a + (o / (o + n)) * (e.a - r.a) - : t.a - r.a + (n / (o + n)) * (r.a - e.a) - : 0; - } - function b(e, t, r) { - var o = t.b - e.b, - n = r.b - t.b; - return 0 < o + n ? (t.a - r.a) * o + (t.a - e.a) * n : 0; - } - function j(e, t) { - return e.a < t.a || (e.a === t.a && e.b <= t.b); - } - function V(e, t, r) { - var o = t.a - e.a, - n = r.a - t.a; - return 0 < o + n - ? o < n - ? t.b - e.b + (o / (o + n)) * (e.b - r.b) - : t.b - r.b + (n / (o + n)) * (r.b - e.b) - : 0; - } - function z(e, t, r) { - var o = t.a - e.a, - n = r.a - t.a; - return 0 < o + n ? (t.b - r.b) * o + (t.b - e.b) * n : 0; - } - function _(e, t, r, o) { - return (e = e < 0 ? 0 : e) <= (r = r < 0 ? 0 : r) - ? 0 === r - ? (t + o) / 2 - : t + (e / (e + r)) * (o - t) - : o + (r / (e + r)) * (t - o); - } - function d(e) { - var t = s(e.b); - return n(t, e.c), n(t.b, e.c), i(t, e.a), t; - } - function x(e, t) { - var r = !1, - o = !1; - e !== t && - (t.a !== e.a && ((o = !0), M(t.a, e.a)), - t.d !== e.d && ((r = !0), a(t.d, e.d)), - T(t, e), - o || (n(t, e.a), (e.a.c = e)), - r || (i(t, e.d), (e.d.a = e))); - } - function m(e) { - var t = e.b, - r = !1; - e.d !== e.b.d && ((r = !0), a(e.d, e.b.d)), - e.c === e - ? M(e.a, null) - : ((e.b.d.a = e.b.e), - (e.a.c = e.c), - T(e, e.b.e), - r || i(e, e.d)), - t.c === t - ? (M(t.a, null), a(t.d, null)) - : ((e.d.a = t.b.e), (t.a.c = t.c), T(t, t.b.e)), - H(e); - } - function w(e) { - var t = s(e), - r = t.b; - return ( - T(t, e.e), - (t.a = e.b.a), - n(r, t.a), - (t.d = r.d = e.d), - (t = t.b), - T(e.b, e.b.b.e), - T(e.b, t), - (e.b.a = t.a), - (t.b.a.c = t.b), - (t.b.d = e.b.d), - (t.f = e.f), - (t.b.f = e.b.f), - t - ); - } - function S(e, t) { - var r = !1, - o = s(e), - n = o.b; - return ( - t.d !== e.d && ((r = !0), a(t.d, e.d)), - T(o, e.e), - T(n, t), - (o.a = e.b.a), - (n.a = t.a), - (o.d = n.d = e.d), - (e.d.a = n), - r || i(o, e.d), - o - ); - } - function s(e) { - var t = new u(), - r = new u(), - o = e.b.h; - return ( - ((((r.h = o).b.h = t).h = e).b.h = r), - (t.b = r), - (((t.c = t).e = r).b = t), - ((r.c = r).e = t) - ); - } - function T(e, t) { - var r = e.c, - o = t.c; - (r.b.e = t), ((o.b.e = e).c = o), (t.c = r); - } - function n(e, t) { - var r = t.f, - o = new D(t, r); - for (r.e = o, r = (t.f = o).c = e; (r.a = o), (r = r.c) !== e; ); - } - function i(e, t) { - var r = t.d, - o = new te(t, r); - for ( - r.b = o, (t.d = o).a = e, o.c = t.c, r = e; - (r.d = o), (r = r.e) !== e; - - ); - } - function H(e) { - var t = e.h; - (e = e.b.h), ((t.b.h = e).b.h = t); - } - function M(e, t) { - for (var r = e.c, o = r; (o.a = t), (o = o.c) !== r; ); - (r = e.f), (((o = e.e).f = r).e = o); - } - function a(e, t) { - for (var r = e.a, o = r; (o.d = t), (o = o.e) !== r; ); - (r = e.d), (((o = e.b).d = r).b = o); - } - function W(e) { - var t = 0; - return ( - Math.abs(e[1]) > Math.abs(e[0]) && (t = 1), - (t = Math.abs(e[2]) > Math.abs(e[t]) ? 2 : t) - ); - } - function E(e, t) { - (e.f += t.f), (e.b.f += t.b.f); - } - function h(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 k(e) { - e.a.i = null; - var t = e.e; - (t.a.c = t.c), (t.c.a = t.a), (e.e = null); - } - function C(e, t) { - m(e.a), (e.c = !1), ((e.a = t).i = e); - } - function O(e) { - for (var t = e.a.a; (e = G(e)).a.a === t; ); - return e.c && (C(e, (t = S(B(e).a.b, e.a.e))), (e = G(e))), e; - } - function q(e, t, r) { - var o = new N(); - return (o.a = r), (o.e = p(e.f, t.e, o)), (r.i = o); - } - function X(e, t) { - switch (e.s) { - case 100130: - return 0 != (1 & t); - case 100131: - return 0 !== t; - case 100132: - return 0 < t; - case 100133: - return t < 0; - case 100134: - return 2 <= t || t <= -2; - } - return !1; - } - function f(e) { - var t = e.a, - r = t.d; - (r.c = e.d), (r.a = t), k(e); - } - function P(e, t, r) { - for (t = (e = t).a; e !== r; ) { - e.c = !1; - var o = B(e), - n = o.a; - if (n.a !== t.a) { - if (!o.c) { - f(e); - break; - } - C(o, (n = S(t.c.b, n.b))); - } - t.c !== n && (x(n.b.e, n), x(t, n)), f(e), (t = o.a), (e = o); - } - return t; - } - function A(e, t, r, o, n, s) { - for (var i = !0; q(e, t, r.b), (r = r.c) !== o; ); - for ( - null === n && (n = B(t).a.b.c); - (r = (o = B(t)).a.b).a === n.a; - - ) - r.c !== n && (x(r.b.e, r), x(n.b.e, r)), - (o.f = t.f - r.f), - (o.d = X(e, o.f)), - (t.b = !0), - !i && R(e, t) && (E(r, n), k(t), m(n)), - (i = !1), - (t = o), - (n = r); - (t.b = !0), s && J(e, t); - } - function Y(e, t, r, o, n) { - var s = [t.g[0], t.g[1], t.g[2]]; - (t.d = null), - (t.d = (e.o && e.o(s, r, o, e.c)) || null), - null === t.d && - (n ? e.n || (l(e, 100156), (e.n = !0)) : (t.d = r[0])); - } - function L(e, t, r) { - var o = [null, null, null, null]; - (o[0] = t.a.d), - (o[1] = r.a.d), - Y(e, t.a, o, [0.5, 0.5, 0, 0], !1), - x(t, r); - } - function Z(e, t, r, o, n) { - var s = Math.abs(t.b - e.b) + Math.abs(t.a - e.a), - i = Math.abs(r.b - e.b) + Math.abs(r.a - e.a), - a = n + 1; - (o[n] = (0.5 * i) / (s + i)), - (o[a] = (0.5 * s) / (s + i)), - (e.g[0] += o[n] * t.g[0] + o[a] * r.g[0]), - (e.g[1] += o[n] * t.g[1] + o[a] * r.g[1]), - (e.g[2] += o[n] * t.g[2] + o[a] * r.g[2]); - } - function R(e, t) { - var r = B(t), - o = t.a, - n = r.a; - if (g(o.a, n.a)) { - if (0 < b(n.b.a, o.a, n.a)) return; - if (y(o.a, n.a)) { - if (o.a !== n.a) { - var r = e.e, - s = o.a.h; - if (0 <= s) { - var i = (r = r.b).d, - a = r.e, - l = r.c, - u = l[s]; - (i[u] = i[r.a]), - (l[i[u]] = u) <= --r.a && - (u <= 1 || g(a[i[u >> 1]], a[i[u]]) ? U : ue)(r, u), - (a[s] = null), - (l[s] = r.b), - (r.b = s); - } else - for ( - r.c[-(s + 1)] = null; - 0 < r.a && null === r.c[r.d[r.a - 1]]; - - ) - --r.a; - L(e, n.b.e, o); - } - } else w(n.b), x(o, n.b.e), (t.b = r.b = !0); - } else { - if (b(o.b.a, n.a, o.a) < 0) return; - (G(t).b = t.b = !0), w(o.b), x(n.b.e, o); - } - return 1; - } - function Q(e, t) { - var r = B(t), - o = t.a, - n = r.a, - s = o.a, - i = n.a, - a = o.b.a, - l = n.b.a, - u = new D(); - if ( - (b(a, e.a, s), - b(l, e.a, i), - !(s === i || Math.min(s.a, a.a) > Math.max(i.a, l.a))) - ) { - if (g(s, i)) { - if (0 < b(l, s, i)) return; - } else if (b(a, i, s) < 0) return; - var c, - d, - h = a, - f = s, - p = l, - m = i; - if ( - (g(h, f) || ((c = h), (h = f), (f = c)), - g(p, m) || ((c = p), (p = m), (m = c)), - g(h, p) || - ((c = h), (h = p), (p = c), (c = f), (f = m), (m = c)), - g(p, f) - ? g(f, m) - ? ((c = v(h, p, f)) + (d = v(p, f, m)) < 0 && - ((c = -c), (d = -d)), - (u.b = _(c, p.b, d, f.b))) - : ((c = b(h, p, f)) + (d = -b(h, m, f)) < 0 && - ((c = -c), (d = -d)), - (u.b = _(c, p.b, d, m.b))) - : (u.b = (p.b + f.b) / 2), - j(h, f) || ((c = h), (h = f), (f = c)), - j(p, m) || ((c = p), (p = m), (m = c)), - j(h, p) || - ((c = h), (h = p), (p = c), (c = f), (f = m), (m = c)), - j(p, f) - ? j(f, m) - ? ((c = V(h, p, f)) + (d = V(p, f, m)) < 0 && - ((c = -c), (d = -d)), - (u.a = _(c, p.a, d, f.a))) - : ((c = z(h, p, f)) + (d = -z(h, m, f)) < 0 && - ((c = -c), (d = -d)), - (u.a = _(c, p.a, d, m.a))) - : (u.a = (p.a + f.a) / 2), - g(u, e.a) && ((u.b = e.a.b), (u.a = e.a.a)), - (h = g(s, i) ? s : i), - g(h, u) && ((u.b = h.b), (u.a = h.a)), - y(u, s) || y(u, i)) - ) - return R(e, t), 0; - if ( - (!y(a, e.a) && 0 <= b(a, e.a, u)) || - (!y(l, e.a) && b(l, e.a, u) <= 0) - ) { - if (l === e.a) - w(o.b), - x(n.b, o), - (o = B((t = O(t))).a), - P(e, B(t), r), - A(e, t, o.b.e, o, o, !0); - else { - if (a !== e.a) - return ( - 0 <= b(a, e.a, u) && - ((G(t).b = t.b = !0), - w(o.b), - (o.a.b = e.a.b), - (o.a.a = e.a.a)), - void ( - b(l, e.a, u) <= 0 && - ((t.b = r.b = !0), - w(n.b), - (n.a.b = e.a.b), - (n.a.a = e.a.a)) - ) - ); - for ( - w(n.b), x(o.e, n.b.e), i = (s = r = t).a.b.a; - (s = G(s)).a.b.a === i; - - ); - (s = B((t = s)).a.b.c), - (r.a = n.b.e), - A(e, t, (n = P(e, r, null)).c, o.b.c, s, !0); - } - return 1; - } - w(o.b), - w(n.b), - x(n.b.e, o), - (o.a.b = u.b), - (o.a.a = u.a), - (o.a.h = ne(e.e, o.a)), - (o = o.a), - (n = [0, 0, 0, 0]), - (u = [s.d, a.d, i.d, l.d]), - (o.g[0] = o.g[1] = o.g[2] = 0), - Z(o, s, a, n, 0), - Z(o, i, l, n, 2), - Y(e, o, u, n, !0), - (G(t).b = t.b = r.b = !0); - } - } - function J(e, t) { - for (var r = B(t); ; ) { - for (; r.b; ) r = B((t = r)); - if (!t.b && (null === (t = G((r = t))) || !t.b)) break; - t.b = !1; - var o = t.a, - n = r.a; - if ((s = o.b.a !== n.b.a)) - e: { - var s, - i = B((s = t)), - a = s.a, - l = i.a, - u = void 0; - if (g(a.b.a, l.b.a)) { - if (b(a.b.a, l.b.a, a.a) < 0) { - s = !1; - break e; - } - (G(s).b = s.b = !0), (u = w(a)), x(l.b, u), (u.d.c = s.d); - } else { - if (0 < b(l.b.a, a.b.a, l.a)) { - s = !1; - break e; - } - (s.b = i.b = !0), (u = w(l)), x(a.e, l.b), (u.b.d.c = s.d); - } - s = !0; - } - if ( - (s && - (r.c - ? (k(r), m(n), (n = (r = B(t)).a)) - : t.c && (k(t), m(o), (o = (t = G(r)).a))), - o.a !== n.a) - ) - if ( - o.b.a === n.b.a || - t.c || - r.c || - (o.b.a !== e.a && n.b.a !== e.a) - ) - R(e, t); - else if (Q(e, t)) break; - o.a === n.a && - o.b.a === n.b.a && - (E(n, o), k(t), m(o), (t = G(r))); - } - } - function K(e, t) { - var r = new N(), - o = d(e.b); - (o.a.b = 4e150), - (o.a.a = t), - (o.b.a.b = -4e150), - (o.b.a.a = t), - (e.a = o.b.a), - (r.a = o), - (r.f = 0), - (r.d = !1), - (r.c = !1), - (r.h = !0), - (r.b = !1), - (o = p((o = e.f), o.a, r)), - (r.e = o); - } - function $(e) { - (this.a = new ee()), (this.b = e), (this.c = h); - } - function p(e, t, r) { - for (; null !== (t = t.c).b && !e.c(e.b, t.b, r); ); - return (e = new ee(r, t.a, t)), (t.a.c = e), (t.a = e); - } - function ee(e, t, r) { - (this.b = e || null), (this.a = t || this), (this.c = r || this); - } - function r() { - (this.d = 0), - (this.p = this.b = this.q = null), - (this.j = [0, 0, 0]), - (this.s = 100130), - (this.n = !1), - (this.o = this.a = this.e = this.f = null), - (this.m = !1), - (this.c = this.r = this.i = this.k = this.l = this.h = null); - } - function I(e, t) { - if (e.d !== t) - for (; e.d !== t; ) - if (e.d < t) - switch (e.d) { - case 0: - l(e, 100151), e.u(null); - break; - case 1: - l(e, 100152), e.t(); - } - else - switch (e.d) { - case 2: - l(e, 100154), e.v(); - break; - case 1: - l(e, 100153), e.w(); - } - } - function l(e, t) { - e.p && e.p(t, e.c); - } - function te(e, t) { - (this.b = e || this), - (this.d = t || this), - (this.a = null), - (this.c = !1); - } - function u() { - ((this.h = this).i = - this.d = - this.a = - this.e = - this.c = - this.b = - null), - (this.f = 0); - } - function re() { - (this.c = new D()), - (this.a = new te()), - (this.b = new u()), - (this.d = new u()), - (this.b.b = this.d), - (this.d.b = this.b); - } - function D(e, t) { - (this.e = e || this), - (this.f = t || this), - (this.d = this.c = null), - (this.g = [0, 0, 0]), - (this.h = this.a = this.b = 0); - } - function oe() { - (this.c = []), - (this.d = null), - (this.a = 0), - (this.e = !1), - (this.b = new ie()); - } - function ne(e, t) { - var r, o, n; - return e.e - ? (2 * (o = ++(r = e.b).a) > r.f && - ((r.f *= 2), (r.c = ae(r.c, r.f + 1))), - 0 === r.b ? (n = o) : ((n = r.b), (r.b = r.c[r.b])), - (r.e[n] = t), - (r.c[n] = o), - (r.d[o] = n), - r.h && ue(r, o), - n) - : ((r = e.a++), (e.c[r] = t), -(r + 1)); - } - function se(e) { - if (0 === e.a) return le(e.b); - var t = e.c[e.d[e.a - 1]]; - if (0 !== e.b.a && g(F(e.b), t)) return le(e.b); - for (; --e.a, 0 < e.a && null === e.c[e.d[e.a - 1]]; ); - return t; - } - function ie() { - (this.d = ae([0], 33)), - (this.e = [null, null]), - (this.c = [0, 0]), - (this.a = 0), - (this.f = 32), - (this.b = 0), - (this.h = !1), - (this.d[1] = 1); - } - function ae(e, t) { - for (var r = Array(t), o = 0; o < e.length; o++) r[o] = e[o]; - for (; o < t; o++) r[o] = 0; - return r; - } - function F(e) { - return e.e[e.d[1]]; - } - function le(e) { - var t = e.d, - r = e.e, - o = e.c, - n = t[1], - s = r[n]; - return ( - 0 < e.a && - ((t[1] = t[e.a]), - (o[t[1]] = 1), - (r[n] = null), - (o[n] = e.b), - (e.b = n), - 0 < --e.a && U(e, 1)), - s - ); - } - function U(e, t) { - for (var r = e.d, o = e.e, n = e.c, s = t, i = r[s]; ; ) { - var a = s << 1, - l = (a < e.a && g(o[r[a + 1]], o[r[a]]) && (a += 1), r[a]); - if (a > e.a || g(o[i], o[l])) { - n[(r[s] = i)] = s; - break; - } - (n[(r[s] = l)] = s), (s = a); - } - } - function ue(e, t) { - for (var r = e.d, o = e.e, n = e.c, s = t, i = r[s]; ; ) { - var a = s >> 1, - l = r[a]; - if (0 == a || g(o[l], o[i])) { - n[(r[s] = i)] = s; - break; - } - (n[(r[s] = l)] = s), (s = a); - } - } - function N() { - (this.e = this.a = null), - (this.f = 0), - (this.c = this.b = this.h = this.d = !1); - } - function B(e) { - return e.e.c.b; - } - function G(e) { - return e.e.a.b; - } - ((t = r.prototype).x = function () { - I(this, 0); - }), - (t.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 l(this, 100900); - } - l(this, 100901); - }), - (t.y = function (e) { - switch (e) { - case 100142: - return 0; - case 100140: - return this.s; - case 100141: - return this.m; - default: - l(this, 100900); - } - return !1; - }), - (t.A = function (e, t, r) { - (this.j[0] = e), (this.j[1] = t), (this.j[2] = r); - }), - (t.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: - l(this, 100900); - } - }), - (t.C = function (e, t) { - var r = !1, - o = [0, 0, 0]; - I(this, 2); - for (var n = 0; n < 3; ++n) { - var s = e[n]; - s < -1e150 && ((s = -1e150), (r = !0)), - 1e150 < s && ((s = 1e150), (r = !0)), - (o[n] = s); - } - r && l(this, 100155), - null === (r = this.q) - ? x((r = d(this.b)), r.b) - : (w(r), (r = r.e)), - (r.a.d = t), - (r.a.g[0] = o[0]), - (r.a.g[1] = o[1]), - (r.a.g[2] = o[2]), - (r.f = 1), - (r.b.f = -1), - (this.q = r); - }), - (t.u = function (e) { - I(this, 0), (this.d = 1), (this.b = new re()), (this.c = e); - }), - (t.t = function () { - I(this, 1), (this.d = 2), (this.q = null); - }), - (t.v = function () { - I(this, 2), (this.d = 1); - }), - (t.w = function () { - I(this, 1), (this.d = 0); - var e, - t, - r = this.j[0], - o = this.j[1], - n = this.j[2], - s = !1, - i = [r, o, n]; - if (0 === r && 0 === o && 0 === n) { - for ( - var o = [-2e150, -2e150, -2e150], - a = [2e150, 2e150, 2e150], - n = [], - l = [], - r = (s = this.b.c).e; - r !== s; - r = r.e - ) - for (var u = 0; u < 3; ++u) { - var c = r.g[u]; - c < a[u] && ((a[u] = c), (l[u] = r)), - c > o[u] && ((o[u] = c), (n[u] = r)); - } - if ( - (o[1] - a[1] > o[(r = 0)] - a[0] && (r = 1), - a[(r = o[2] - a[2] > o[r] - a[r] ? 2 : r)] >= o[r]) - ) - (i[0] = 0), (i[1] = 0), (i[2] = 1); - else { - for ( - a = l[r], - n = n[r], - l = [(o = 0), 0, 0], - a = [a.g[0] - n.g[0], a.g[1] - n.g[1], a.g[2] - n.g[2]], - u = [0, 0, 0], - r = s.e; - r !== s; - r = r.e - ) - (u[0] = r.g[0] - n.g[0]), - (u[1] = r.g[1] - n.g[1]), - (u[2] = r.g[2] - n.g[2]), - (l[0] = a[1] * u[2] - a[2] * u[1]), - (l[1] = a[2] * u[0] - a[0] * u[2]), - (l[2] = a[0] * u[1] - a[1] * u[0]), - o < (c = l[0] * l[0] + l[1] * l[1] + l[2] * l[2]) && - ((o = c), (i[0] = l[0]), (i[1] = l[1]), (i[2] = l[2])); - o <= 0 && ((i[0] = i[1] = i[2] = 0), (i[W(a)] = 1)); - } - s = !0; - } - for ( - l = W(i), - r = this.b.c, - o = (l + 1) % 3, - n = (l + 2) % 3, - l = 0 < i[l] ? 1 : -1, - i = r.e; - i !== r; - i = i.e - ) - (i.b = i.g[o]), (i.a = l * i.g[n]); - if (s) { - for (i = 0, r = (s = this.b.a).b; r !== s; r = r.b) - if (!((o = r.a).f <= 0)) - for ( - ; - (i += (o.a.b - o.b.a.b) * (o.a.a + o.b.a.a)), - (o = o.e) !== r.a; - - ); - if (i < 0) - for (s = (i = this.b.c).e; s !== i; s = s.e) s.a = -s.a; - } - for (this.n = !1, i = this.b.b, r = i.h; r !== i; r = s) - (s = r.h), - (o = r.e), - y(r.a, r.b.a) && - r.e.e !== r && - (L(this, o, r), m(r), (o = (r = o).e)), - o.e === r && - (o !== r && ((o !== s && o !== s.b) || (s = s.h), m(o)), - (r !== s && r !== s.b) || (s = s.h), - m(r)); - for ( - this.e = i = new oe(), s = this.b.c, r = s.e; - r !== s; - r = r.e - ) - r.h = ne(i, r); - var d = i; - d.d = []; - for (var h = 0; h < d.a; h++) d.d[h] = h; - d.d.sort( - (function (r) { - return function (e, t) { - return g(r[e], r[t]) ? 1 : -1; - }; - })(d.c), - ), - (d.e = !0); - for (var f = d.b, p = f.a; 1 <= p; --p) U(f, p); - for ( - f.h = !0, this.f = new $(this), K(this, -4e150), K(this, 4e150); - null !== (i = se(this.e)); - - ) { - for (;;) { - e: if (0 === (r = this.e).a) s = F(r.b); - else if ( - ((s = r.c[r.d[r.a - 1]]), 0 !== r.b.a && g((r = F(r.b)), s)) - ) { - s = r; - break e; - } - if (null === s || !y(s, i)) break; - (s = se(this.e)), L(this, i.c, s.c); - } - !(function e(t, r) { - for (var o, n = (t.a = r).c; null === n.i; ) - if ((n = n.c) === r.c) { - var n = t, - s = r; - (c = new N()).a = s.c.b; - for ( - var i = (a = n.f).a; - null !== (i = i.a).b && !a.c(a.b, c, i.b); - - ); - var a, - l, - u = B((a = i.b)), - c = a.a, - i = u.a; - return void (0 === b(c.b.a, s, c.a) - ? y((c = a.a).a, s) || - y(c.b.a, s) || - (w(c.b), - a.c && (m(c.c), (a.c = !1)), - x(s.c, c), - e(n, s)) - : ((l = g(i.b.a, c.b.a) ? a : u), - (u = void 0), - a.d || l.c - ? ((u = - l === a ? S(s.c.b, c.e) : S(i.b.c.b, s.c).b), - l.c - ? C(l, u) - : (((a = q((c = n), a, u)).f = G(a).f + a.a.f), - (a.d = X(c, a.f))), - e(n, s)) - : A(n, a, s.c, s.c, null, !0))); - } - (a = (c = B((n = O(n.i)))).a), - (c = P(t, c, null)).c === a - ? ((c = (a = c).c), - (i = B(n)), - (u = n.a), - (l = i.a), - (o = !1), - u.b.a !== l.b.a && Q(t, n), - y(u.a, t.a) && - (x(c.b.e, u), - (c = B((n = O(n))).a), - P(t, B(n), i), - (o = !0)), - y(l.a, t.a) && - (x(a, l.b.e), (a = P(t, i, null)), (o = !0)), - o - ? A(t, n, a.c, c, c, !0) - : ((s = g(l.a, u.a) ? l.b.e : u), - A(t, n, (s = S(a.c.b, s)), s.c, s.c, !1), - (s.b.i.c = !0), - J(t, n))) - : A(t, n, c.c, a, a, !0); - })(this, i); - } - for ( - this.a = this.f.a.a.b.a.a, i = 0; - null !== (s = this.f.a.a.b); - - ) - s.h || ++i, k(s); - for ( - this.f = null, - (i = this.e).b = null, - i.d = null, - this.e = i.c = null, - i = this.b, - r = i.a.b; - r !== i.a; - r = s - ) - (s = r.b), (r = r.a).e.e === r && (E(r.c, r), m(r)); - if (!this.n) { - if (((i = this.b), this.m)) - for (r = i.b.h; r !== i.b; r = s) - (s = r.h), - r.b.d.c !== r.d.c ? (r.f = r.d.c ? 1 : -1) : m(r); - else - for (r = i.a.b; r !== i.a; r = s) - if (((s = r.b), r.c)) { - for (r = r.a; g(r.b.a, r.a); r = r.c.b); - for (; g(r.a, r.b.a); r = r.e); - for (o = r.c.b, n = void 0; r.e !== o; ) - if (g(r.b.a, o.a)) { - for ( - ; - o.e !== r && - (g((t = o.e).b.a, t.a) || - b(o.a, o.b.a, o.e.b.a) <= 0); - - ) - o = (n = S(o.e, o)).b; - o = o.c.b; - } else { - for ( - ; - o.e !== r && - (g((e = r.c.b).a, e.b.a) || - 0 <= b(r.b.a, r.a, r.c.b.a)); - - ) - r = (n = S(r, r.c.b)).b; - r = r.e; - } - for (; o.e.e !== r; ) (n = S(o.e, o)), (o = n.b); - } - if (this.h || this.i || this.k || this.l) - if (this.m) { - for (s = (i = this.b).a.b; s !== i.a; s = s.b) - if (s.c) { - for ( - this.h && this.h(2, this.c), r = s.a; - this.k && this.k(r.a.d, this.c), (r = r.e) !== s.a; - - ); - this.i && this.i(this.c); - } - } else { - for ( - i = this.b, s = !!this.l, r = !1, o = -1, n = i.a.d; - n !== i.a; - n = n.d - ) - if (n.c) - for ( - r || (this.h && this.h(4, this.c), (r = !0)), l = n.a; - s && - ((a = l.b.d.c ? 0 : 1), - o !== a && - ((o = a), this.l && this.l(!!o, this.c))), - this.k && this.k(l.a.d, this.c), - (l = l.e) !== n.a; - - ); - r && this.i && this.i(this.c); - } - if (this.r) { - for (i = this.b, r = i.a.b; r !== i.a; r = s) - if (((s = r.b), !r.c)) { - for ( - n = (o = r.a).e, l = void 0; - (n = (l = n).e), - (l.d = null) === l.b.d && - (l.c === l - ? M(l.a, null) - : ((l.a.c = l.c), T(l, l.b.e)), - (a = l.b).c === a - ? M(a.a, null) - : ((a.a.c = a.c), T(a, a.b.e)), - H(l)), - l !== o; - - ); - (o = r.d), (((r = r.b).d = o).b = r); - } - return this.r(this.b), void (this.c = this.b = null); - } - } - this.b = this.c = null; - }), - (this.libtess = { - GluTesselator: r, - windingRule: { - GLU_TESS_WINDING_ODD: 100130, - GLU_TESS_WINDING_NONZERO: 100131, - GLU_TESS_WINDING_POSITIVE: 100132, - GLU_TESS_WINDING_NEGATIVE: 100133, - GLU_TESS_WINDING_ABS_GEQ_TWO: 100134, - }, - primitiveType: { - GL_LINE_LOOP: 2, - GL_TRIANGLES: 4, - GL_TRIANGLE_STRIP: 5, - GL_TRIANGLE_FAN: 6, - }, - errorType: { - GLU_TESS_MISSING_BEGIN_POLYGON: 100151, - GLU_TESS_MISSING_END_POLYGON: 100153, - GLU_TESS_MISSING_BEGIN_CONTOUR: 100152, - GLU_TESS_MISSING_END_CONTOUR: 100154, - GLU_TESS_COORD_TOO_LARGE: 100155, - GLU_TESS_NEED_COMBINE_CALLBACK: 100156, - }, - gluEnum: { - GLU_TESS_MESH: 100112, - GLU_TESS_TOLERANCE: 100142, - GLU_TESS_WINDING_RULE: 100140, - GLU_TESS_BOUNDARY_ONLY: 100141, - GLU_INVALID_ENUM: 100900, - GLU_INVALID_VALUE: 100901, - GLU_TESS_BEGIN: 100100, - GLU_TESS_VERTEX: 100101, - GLU_TESS_END: 100102, - GLU_TESS_ERROR: 100103, - GLU_TESS_EDGE_FLAG: 100104, - GLU_TESS_COMBINE: 100105, - GLU_TESS_BEGIN_DATA: 100106, - GLU_TESS_VERTEX_DATA: 100107, - GLU_TESS_END_DATA: 100108, - GLU_TESS_ERROR_DATA: 100109, - GLU_TESS_EDGE_FLAG_DATA: 100110, - GLU_TESS_COMBINE_DATA: 100111, - }, - }), - (r.prototype.gluDeleteTess = r.prototype.x), - (r.prototype.gluTessProperty = r.prototype.B), - (r.prototype.gluGetTessProperty = r.prototype.y), - (r.prototype.gluTessNormal = r.prototype.A), - (r.prototype.gluTessCallback = r.prototype.z), - (r.prototype.gluTessVertex = r.prototype.C), - (r.prototype.gluTessBeginPolygon = r.prototype.u), - (r.prototype.gluTessBeginContour = r.prototype.t), - (r.prototype.gluTessEndContour = r.prototype.v), - (r.prototype.gluTessEndPolygon = r.prototype.w), - void 0 !== e && (e.exports = this.libtess); - }, - {}, - ], - 248: [ - function (e, t, r) { - "use strict"; - function o(g, e, t, r) { - var v = 0, - o = 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 < e || 65535 < t) - throw new Error("Width/Height invalid."); - function j(e) { - e = e.length; - if (e < 2 || 256 < e || e & (e - 1)) - throw new Error( - "Invalid code/color length, must be power of 2 and 2 .. 256.", - ); - return e; - } - (g[v++] = 71), - (g[v++] = 73), - (g[v++] = 70), - (g[v++] = 56), - (g[v++] = 57), - (g[v++] = 97); - var n = 0, - s = 0; - if (null !== b) { - for (var i = j(b); (i >>= 1); ) ++n; - if (((i = 1 << n), --n, void 0 !== r.background)) { - if (i <= (s = r.background)) - throw new Error("Background index out of range."); - if (0 === s) - throw new Error("Background index explicitly passed as 0."); - } - } - if ( - ((g[v++] = 255 & e), - (g[v++] = (e >> 8) & 255), - (g[v++] = 255 & t), - (g[v++] = (t >> 8) & 255), - (g[v++] = (null !== b ? 128 : 0) | n), - (g[v++] = s), - (g[v++] = 0), - null !== b) - ) - for (var a = 0, l = b.length; a < l; ++a) { - var u = b[a]; - (g[v++] = (u >> 16) & 255), - (g[v++] = (u >> 8) & 255), - (g[v++] = 255 & u); - } - if (null !== o) { - if (o < 0 || 65535 < o) throw new Error("Loop count invalid."); - (g[v++] = 33), - (g[v++] = 255), - (g[v++] = 11), - (g[v++] = 78), - (g[v++] = 69), - (g[v++] = 84), - (g[v++] = 83), - (g[v++] = 67), - (g[v++] = 65), - (g[v++] = 80), - (g[v++] = 69), - (g[v++] = 50), - (g[v++] = 46), - (g[v++] = 48), - (g[v++] = 3), - (g[v++] = 1), - (g[v++] = 255 & o), - (g[v++] = (o >> 8) & 255), - (g[v++] = 0); - } - var _ = !1; - (this.addFrame = function (e, t, r, o, n, s) { - if ( - (!0 === _ && (--v, (_ = !1)), - (s = void 0 === s ? {} : s), - e < 0 || t < 0 || 65535 < e || 65535 < t) - ) - throw new Error("x/y invalid."); - if (r <= 0 || o <= 0 || 65535 < r || 65535 < o) - throw new Error("Width/Height invalid."); - if (n.length < r * o) - throw new Error("Not enough pixels for the frame size."); - var i = !0, - a = s.palette; - if ((null == a && ((i = !1), (a = b)), null == a)) - throw new Error( - "Must supply either a local or global palette.", - ); - for (var l = j(a), u = 0; (l >>= 1); ) ++u; - var l = 1 << u, - c = void 0 === s.delay ? 0 : s.delay, - d = void 0 === s.disposal ? 0 : s.disposal; - if (d < 0 || 3 < d) throw new Error("Disposal out of range."); - var h = !1, - f = 0; - if ( - void 0 !== s.transparent && - null !== s.transparent && - ((h = !0), (f = s.transparent) < 0 || l <= f) - ) - throw new Error("Transparent color index."); - if ( - ((0 === d && !h && 0 === c) || - ((g[v++] = 33), - (g[v++] = 249), - (g[v++] = 4), - (g[v++] = (d << 2) | (!0 === h ? 1 : 0)), - (g[v++] = 255 & c), - (g[v++] = (c >> 8) & 255), - (g[v++] = f), - (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 & o), - (g[v++] = (o >> 8) & 255), - (g[v++] = !0 === i ? 128 | (u - 1) : 0), - !0 === i) - ) - for (var p = 0, m = a.length; p < m; ++p) { - var y = a[p]; - (g[v++] = (y >> 16) & 255), - (g[v++] = (y >> 8) & 255), - (g[v++] = 255 & y); - } - return (v = (function (t, r, e, o) { - t[r++] = e; - var n = r++, - s = 1 << e, - i = s - 1, - a = 1 + s, - l = 1 + a, - u = e + 1, - c = 0, - d = 0; - function h(e) { - for (; e <= c; ) - (t[r++] = 255 & d), - (d >>= 8), - (c -= 8), - r === n + 256 && ((t[n] = 255), (n = r++)); - } - function f(e) { - (d |= e << c), (c += u), h(8); - } - var p = o[0] & i, - m = {}; - f(s); - for (var y = 1, g = o.length; y < g; ++y) { - var v = o[y] & i, - b = (p << 8) | v, - j = m[b]; - if (void 0 === j) { - for (d |= p << c, c += u; 8 <= c; ) - (t[r++] = 255 & d), - (d >>= 8), - (c -= 8), - r === n + 256 && ((t[n] = 255), (n = r++)); - 4096 === l - ? (f(s), (l = 1 + a), (u = e + 1), (m = {})) - : (1 << u <= l && ++u, (m[b] = l++)), - (p = v); - } else p = j; - } - f(p), - f(a), - h(1), - n + 1 === r ? (t[n] = 0) : ((t[n] = r - n - 1), (t[r++] = 0)); - return r; - })(g, v, u < 2 ? 2 : u, n)); - }), - (this.end = function () { - return !1 === _ && ((g[v++] = 59), (_ = !0)), v; - }), - (this.getOutputBuffer = function () { - return g; - }), - (this.setOutputBuffer = function (e) { - g = e; - }), - (this.getOutputBufferPosition = function () { - return v; - }), - (this.setOutputBufferPosition = function (e) { - v = e; - }); - } - function M(e, t, r, o) { - for ( - var n = e[t++], - s = 1 << n, - i = 1 + s, - a = 1 + i, - l = n + 1, - u = (1 << l) - 1, - c = 0, - d = 0, - h = 0, - f = e[t++], - p = new Int32Array(4096), - m = null; - ; - - ) { - for (; c < 16 && 0 !== f; ) - (d |= e[t++] << c), (c += 8), 1 === f ? (f = e[t++]) : --f; - if (c < l) break; - var y = d & u; - if (((d >>= l), (c -= l), y == s)) - (a = 1 + i), (u = (1 << (l = n + 1)) - 1), (m = null); - else { - if (y == i) break; - for (var g = y < a ? y : m, v = 0, b = g; s < b; ) - (b = p[b] >> 8), ++v; - var j = b; - if (o < h + v + (g !== y ? 1 : 0)) - return void console.log( - "Warning, gif stream longer than expected.", - ); - r[h++] = j; - var _ = (h += v); - for (g !== y && (r[h++] = j), b = g; v--; ) - (b = p[b]), (r[--_] = 255 & b), (b >>= 8); - null !== m && - a < 4096 && - ((p[a++] = (m << 8) | j), - u + 1 <= a && l < 12 && (++l, (u = (u << 1) | 1))), - (m = y); - } - } - h !== o && - console.log("Warning, gif stream shorter than expected."); - } - try { - (r.GifWriter = o), - (r.GifReader = function (b) { - var e = 0; - if ( - 71 !== b[e++] || - 73 !== b[e++] || - 70 !== b[e++] || - 56 !== b[e++] || - 56 != ((b[e++] + 1) & 253) || - 97 !== b[e++] - ) - throw new Error("Invalid GIF 87a/89a header."); - var j = b[e++] | (b[e++] << 8), - t = b[e++] | (b[e++] << 8), - r = b[e++], - o = 1 << (1 + (7 & r)), - n = (b[e++], b[e++], null), - s = null, - i = (r >> 7 && ((n = e), (e += 3 * (s = o))), !0), - a = [], - l = 0, - u = null, - c = 0, - d = null; - for (this.width = j, this.height = t; i && e < b.length; ) - switch (b[e++]) { - case 33: - switch (b[e++]) { - case 255: - if ( - 11 !== b[e] || - (78 == b[e + 1] && - 69 == b[e + 2] && - 84 == b[e + 3] && - 83 == b[e + 4] && - 67 == b[e + 5] && - 65 == b[e + 6] && - 80 == b[e + 7] && - 69 == b[e + 8] && - 50 == b[e + 9] && - 46 == b[e + 10] && - 48 == b[e + 11] && - 3 == b[e + 12] && - 1 == b[e + 13] && - 0 == b[e + 16]) - ) - (e += 14), (d = b[e++] | (b[e++] << 8)), e++; - else - for (e += 12; ; ) { - if (!(0 <= (f = b[e++]))) - throw Error("Invalid block size"); - if (0 === f) break; - e += f; - } - break; - case 249: - if (4 !== b[e++] || 0 !== b[e + 4]) - throw new Error( - "Invalid graphics extension block.", - ); - var h = b[e++], - l = b[e++] | (b[e++] << 8), - u = b[e++]; - 0 == (1 & h) && (u = null), (c = (h >> 2) & 7), e++; - break; - case 254: - for (;;) { - if (!(0 <= (f = b[e++]))) - throw Error("Invalid block size"); - if (0 === f) break; - e += f; - } - break; - default: - throw new Error( - "Unknown graphic control label: 0x" + - b[e - 1].toString(16), - ); - } - break; - case 44: - var f, - p = b[e++] | (b[e++] << 8), - m = b[e++] | (b[e++] << 8), - y = b[e++] | (b[e++] << 8), - g = b[e++] | (b[e++] << 8), - v = b[e++], - _ = (v >> 6) & 1, - x = 1 << (1 + (7 & v)), - w = n, - S = s, - T = !1, - v = - (v >> 7 && ((T = !0), (w = e), (e += 3 * (S = x))), - e); - for (e++; ; ) { - if (!(0 <= (f = b[e++]))) - throw Error("Invalid block size"); - if (0 === f) break; - e += f; - } - a.push({ - x: p, - y: m, - width: y, - height: g, - has_local_palette: T, - palette_offset: w, - palette_size: S, - data_offset: v, - data_length: e - v, - transparent_index: u, - interlaced: !!_, - delay: l, - disposal: c, - }); - break; - case 59: - i = !1; - break; - default: - throw new Error( - "Unknown gif block: 0x" + b[e - 1].toString(16), - ); - } - (this.numFrames = function () { - return a.length; - }), - (this.loopCount = function () { - return d; - }), - (this.frameInfo = function (e) { - if (e < 0 || e >= a.length) - throw new Error("Frame index out of range."); - return a[e]; - }), - (this.decodeAndBlitFrameBGRA = function (e, t) { - for ( - var e = this.frameInfo(e), - r = e.width * e.height, - o = new Uint8Array(r), - n = (M(b, e.data_offset, o, r), e.palette_offset), - s = e.transparent_index, - i = (null === s && (s = 256), e.width), - a = j - i, - l = i, - u = 4 * (e.y * j + e.x), - c = 4 * ((e.y + e.height) * j + e.x), - d = u, - h = 4 * a, - f = (!0 === e.interlaced && (h += 4 * j * 7), 8), - p = 0, - m = o.length; - p < m; - ++p - ) { - var y, - g, - v = o[p]; - 0 === l && - ((l = i), - c <= (d += h) && - ((h = 4 * a + 4 * j * (f - 1)), - (d = u + (i + a) * (f << 1)), - (f >>= 1))), - v === s - ? (d += 4) - : ((y = b[n + 3 * v]), - (g = b[n + 3 * v + 1]), - (v = b[n + 3 * v + 2]), - (t[d++] = v), - (t[d++] = g), - (t[d++] = y), - (t[d++] = 255)), - --l; - } - }), - (this.decodeAndBlitFrameRGBA = function (e, t) { - for ( - var e = this.frameInfo(e), - r = e.width * e.height, - o = new Uint8Array(r), - n = (M(b, e.data_offset, o, r), e.palette_offset), - s = e.transparent_index, - i = (null === s && (s = 256), e.width), - a = j - i, - l = i, - u = 4 * (e.y * j + e.x), - c = 4 * ((e.y + e.height) * j + e.x), - d = u, - h = 4 * a, - f = (!0 === e.interlaced && (h += 4 * j * 7), 8), - p = 0, - m = o.length; - p < m; - ++p - ) { - var y, - g, - v = o[p]; - 0 === l && - ((l = i), - c <= (d += h) && - ((h = 4 * a + 4 * j * (f - 1)), - (d = u + (i + a) * (f << 1)), - (f >>= 1))), - v === s - ? (d += 4) - : ((y = b[n + 3 * v]), - (g = b[n + 3 * v + 1]), - (v = b[n + 3 * v + 2]), - (t[d++] = y), - (t[d++] = g), - (t[d++] = v), - (t[d++] = 255)), - --l; - } - }); - }); - } catch (e) {} - }, - {}, - ], - 249: [ - function (Ar, r, o) { - !function (Pr) { - var e, t; - (e = this), - (t = function (j) { - "use strict"; - function D(e) { - if (null == this) throw TypeError(); - var t, - r = String(this), - o = r.length, - e = e ? Number(e) : 0; - if (!((e = e != e ? 0 : e) < 0 || o <= e)) - return 55296 <= (t = r.charCodeAt(e)) && - t <= 56319 && - e + 1 < o && - 56320 <= (o = r.charCodeAt(e + 1)) && - o <= 57343 - ? 1024 * (t - 55296) + o - 56320 + 65536 - : t; - } - String.prototype.codePointAt || - ((F = (function () { - try { - var e = {}, - t = Object.defineProperty, - r = t(e, e, e) && t; - } catch (e) {} - return r; - })()) - ? F(String.prototype, "codePointAt", { - value: D, - configurable: !0, - writable: !0, - }) - : (String.prototype.codePointAt = D)); - var F, - U = 0, - N = -3; - function B() { - (this.table = new Uint16Array(16)), - (this.trans = new Uint16Array(288)); - } - function G(e, t) { - (this.source = e), - (this.sourceIndex = 0), - (this.tag = 0), - (this.bitcount = 0), - (this.dest = t), - (this.destLen = 0), - (this.ltree = new B()), - (this.dtree = new B()); - } - var V = new B(), - z = new B(), - H = new Uint8Array(30), - W = new Uint16Array(30), - q = new Uint8Array(30), - X = new Uint16Array(30), - Y = new Uint8Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, - 1, 15, - ]), - Z = new B(), - v = new Uint8Array(320); - function Q(e, t, r, o) { - for (var n, s = 0; s < r; ++s) e[s] = 0; - for (s = 0; s < 30 - r; ++s) e[s + r] = (s / r) | 0; - for (n = o, s = 0; s < 30; ++s) (t[s] = n), (n += 1 << e[s]); - } - var J = new Uint16Array(16); - function K(e, t, r, o) { - for (var n, s = 0; s < 16; ++s) e.table[s] = 0; - for (s = 0; s < o; ++s) e.table[t[r + s]]++; - for (s = n = e.table[0] = 0; s < 16; ++s) - (J[s] = n), (n += e.table[s]); - for (s = 0; s < o; ++s) - t[r + s] && (e.trans[J[t[r + s]]++] = s); - } - function b(e, t, r) { - if (!t) return r; - for (; e.bitcount < 24; ) - (e.tag |= e.source[e.sourceIndex++] << e.bitcount), - (e.bitcount += 8); - var o = e.tag & (65535 >>> (16 - t)); - return (e.tag >>>= t), (e.bitcount -= t), o + r; - } - function $(e, t) { - for (; e.bitcount < 24; ) - (e.tag |= e.source[e.sourceIndex++] << e.bitcount), - (e.bitcount += 8); - for ( - var r = 0, o = 0, n = 0, s = e.tag; - (o = 2 * o + (1 & s)), - (s >>>= 1), - (r += t.table[++n]), - 0 <= (o -= t.table[n]); - - ); - return (e.tag = s), (e.bitcount -= n), t.trans[r + o]; - } - function ee(e, t, r) { - for (;;) { - var o = $(e, t); - if (256 === o) return U; - if (o < 256) e.dest[e.destLen++] = o; - else - for ( - var n, - s = b(e, H[(o -= 257)], W[o]), - o = $(e, r), - i = (n = e.destLen - b(e, q[o], X[o])); - i < n + s; - ++i - ) - e.dest[e.destLen++] = e.dest[i]; - } - } - for (var e = V, te = z, t = 0; t < 7; ++t) e.table[t] = 0; - for ( - e.table[7] = 24, e.table[8] = 152, e.table[9] = 112, t = 0; - t < 24; - ++t - ) - e.trans[t] = 256 + t; - for (t = 0; t < 144; ++t) e.trans[24 + t] = t; - for (t = 0; t < 8; ++t) e.trans[168 + t] = 280 + t; - for (t = 0; t < 112; ++t) e.trans[176 + t] = 144 + t; - for (t = 0; t < 5; ++t) te.table[t] = 0; - for (te.table[5] = 32, t = 0; t < 32; ++t) te.trans[t] = t; - Q(H, W, 4, 3), Q(q, X, 2, 1), (H[28] = 0), (W[28] = 258); - var re = function (e, t) { - var r, - o, - n, - s = new G(e, t); - do { - switch ( - ((n = void 0), - (o = s).bitcount-- || - ((o.tag = o.source[o.sourceIndex++]), (o.bitcount = 7)), - (n = 1 & o.tag), - (o.tag >>>= 1), - (o = n), - b(s, 2, 0)) - ) { - case 0: - r = (function (e) { - for (var t, r; 8 < e.bitcount; ) - e.sourceIndex--, (e.bitcount -= 8); - if ( - (t = - 256 * e.source[e.sourceIndex + 1] + - e.source[e.sourceIndex]) !== - (65535 & - ~( - 256 * e.source[e.sourceIndex + 3] + - e.source[e.sourceIndex + 2] - )) - ) - return N; - for (e.sourceIndex += 4, r = t; r; --r) - e.dest[e.destLen++] = e.source[e.sourceIndex++]; - return (e.bitcount = 0), U; - })(s); - break; - case 1: - r = ee(s, V, z); - break; - case 2: - y = m = p = g = i = f = h = d = c = u = l = a = void 0; - for ( - var i, - a = s, - l = s.ltree, - u = s.dtree, - c = b(a, 5, 257), - d = b(a, 5, 1), - h = b(a, 4, 4), - f = 0; - f < 19; - ++f - ) - v[f] = 0; - for (f = 0; f < h; ++f) { - var p = b(a, 3, 0); - v[Y[f]] = p; - } - for (K(Z, v, 0, 19), i = 0; i < c + d; ) { - var m = $(a, Z); - switch (m) { - case 16: - for (var y = v[i - 1], g = b(a, 2, 3); g; --g) - v[i++] = y; - break; - case 17: - for (g = b(a, 3, 3); g; --g) v[i++] = 0; - break; - case 18: - for (g = b(a, 7, 11); g; --g) v[i++] = 0; - break; - default: - v[i++] = m; - } - } - K(l, v, 0, c), - K(u, v, c, d), - (r = ee(s, s.ltree, s.dtree)); - break; - default: - r = N; - } - if (r !== U) throw new Error("Data error"); - } while (!o); - return s.destLen < s.dest.length - ? "function" == typeof s.dest.slice - ? s.dest.slice(0, s.destLen) - : s.dest.subarray(0, s.destLen) - : s.dest; - }; - function g(e, t, r, o, n) { - return ( - Math.pow(1 - n, 3) * e + - 3 * Math.pow(1 - n, 2) * n * t + - 3 * (1 - n) * Math.pow(n, 2) * r + - Math.pow(n, 3) * o - ); - } - function a() { - (this.x1 = Number.NaN), - (this.y1 = Number.NaN), - (this.x2 = Number.NaN), - (this.y2 = Number.NaN); - } - function h() { - (this.commands = []), - (this.fill = "black"), - (this.stroke = null), - (this.strokeWidth = 1); - } - function oe(e) { - throw new Error(e); - } - function ne(e, t) { - e || oe(t); - } - (a.prototype.isEmpty = function () { - return ( - isNaN(this.x1) || - isNaN(this.y1) || - isNaN(this.x2) || - isNaN(this.y2) - ); - }), - (a.prototype.addPoint = function (e, t) { - "number" == typeof e && - ((isNaN(this.x1) || isNaN(this.x2)) && - ((this.x1 = e), (this.x2 = e)), - e < this.x1 && (this.x1 = e), - e > this.x2 && (this.x2 = e)), - "number" == typeof t && - ((isNaN(this.y1) || isNaN(this.y2)) && - ((this.y1 = t), (this.y2 = t)), - t < this.y1 && (this.y1 = t), - t > this.y2 && (this.y2 = t)); - }), - (a.prototype.addX = function (e) { - this.addPoint(e, null); - }), - (a.prototype.addY = function (e) { - this.addPoint(null, e); - }), - (a.prototype.addBezier = function (e, t, r, o, n, s, i, a) { - var l = [e, t], - u = [r, o], - c = [n, s], - d = [i, a]; - this.addPoint(e, t), this.addPoint(i, a); - for (var h = 0; h <= 1; h++) { - var f, - p = 6 * l[h] - 12 * u[h] + 6 * c[h], - m = -3 * l[h] + 9 * u[h] - 9 * c[h] + 3 * d[h], - y = 3 * u[h] - 3 * l[h]; - 0 == m - ? 0 == p || - (0 < (f = -y / p) && - f < 1 && - (0 === h && this.addX(g(l[h], u[h], c[h], d[h], f)), - 1 === h && this.addY(g(l[h], u[h], c[h], d[h], f)))) - : (f = Math.pow(p, 2) - 4 * y * m) < 0 || - (0 < (y = (-p + Math.sqrt(f)) / (2 * m)) && - y < 1 && - (0 === h && this.addX(g(l[h], u[h], c[h], d[h], y)), - 1 === h && this.addY(g(l[h], u[h], c[h], d[h], y))), - 0 < (y = (-p - Math.sqrt(f)) / (2 * m)) && - y < 1 && - (0 === h && this.addX(g(l[h], u[h], c[h], d[h], y)), - 1 === h && - this.addY(g(l[h], u[h], c[h], d[h], y)))); - } - }), - (a.prototype.addQuad = function (e, t, r, o, n, s) { - (r = e + (2 / 3) * (r - e)), (o = t + (2 / 3) * (o - t)); - this.addBezier( - e, - t, - r, - o, - r + (1 / 3) * (n - e), - o + (1 / 3) * (s - t), - n, - s, - ); - }), - (h.prototype.moveTo = function (e, t) { - this.commands.push({ type: "M", x: e, y: t }); - }), - (h.prototype.lineTo = function (e, t) { - this.commands.push({ type: "L", x: e, y: t }); - }), - (h.prototype.curveTo = h.prototype.bezierCurveTo = - function (e, t, r, o, n, s) { - this.commands.push({ - type: "C", - x1: e, - y1: t, - x2: r, - y2: o, - x: n, - y: s, - }); - }), - (h.prototype.quadTo = h.prototype.quadraticCurveTo = - function (e, t, r, o) { - this.commands.push({ - type: "Q", - x1: e, - y1: t, - x: r, - y: o, - }); - }), - (h.prototype.close = h.prototype.closePath = - function () { - this.commands.push({ type: "Z" }); - }), - (h.prototype.extend = function (e) { - var t; - if (e.commands) e = e.commands; - else if (e instanceof a) - return ( - (t = e), - this.moveTo(t.x1, t.y1), - this.lineTo(t.x2, t.y1), - this.lineTo(t.x2, t.y2), - this.lineTo(t.x1, t.y2), - void this.close() - ); - Array.prototype.push.apply(this.commands, e); - }), - (h.prototype.getBoundingBox = function () { - for ( - var e = new a(), t = 0, r = 0, o = 0, n = 0, s = 0; - s < this.commands.length; - s++ - ) { - var i = this.commands[s]; - switch (i.type) { - case "M": - e.addPoint(i.x, i.y), (t = o = i.x), (r = n = i.y); - break; - case "L": - e.addPoint(i.x, i.y), (o = i.x), (n = i.y); - break; - case "Q": - e.addQuad(o, n, i.x1, i.y1, i.x, i.y), - (o = i.x), - (n = i.y); - break; - case "C": - e.addBezier(o, n, i.x1, i.y1, i.x2, i.y2, i.x, i.y), - (o = i.x), - (n = i.y); - break; - case "Z": - (o = t), (n = r); - break; - default: - throw new Error("Unexpected path command " + i.type); - } - } - return e.isEmpty() && e.addPoint(0, 0), e; - }), - (h.prototype.draw = function (e) { - e.beginPath(); - for (var t = 0; t < this.commands.length; t += 1) { - var r = this.commands[t]; - "M" === r.type - ? e.moveTo(r.x, r.y) - : "L" === r.type - ? e.lineTo(r.x, r.y) - : "C" === r.type - ? e.bezierCurveTo(r.x1, r.y1, r.x2, r.y2, r.x, r.y) - : "Q" === r.type - ? e.quadraticCurveTo(r.x1, r.y1, r.x, r.y) - : "Z" === r.type && e.closePath(); - } - this.fill && ((e.fillStyle = this.fill), e.fill()), - this.stroke && - ((e.strokeStyle = this.stroke), - (e.lineWidth = this.strokeWidth), - e.stroke()); - }), - (h.prototype.toPathData = function (n) { - function e() { - for ( - var e = arguments, t = "", r = 0; - r < arguments.length; - r += 1 - ) { - var o = e[r]; - 0 <= o && 0 < r && (t += " "), - (t += - ((o = o), - Math.round(o) === o - ? "" + Math.round(o) - : o.toFixed(n))); - } - return t; - } - n = void 0 !== n ? n : 2; - for (var t = "", r = 0; r < this.commands.length; r += 1) { - var o = this.commands[r]; - "M" === o.type - ? (t += "M" + e(o.x, o.y)) - : "L" === o.type - ? (t += "L" + e(o.x, o.y)) - : "C" === o.type - ? (t += "C" + e(o.x1, o.y1, o.x2, o.y2, o.x, o.y)) - : "Q" === o.type - ? (t += "Q" + e(o.x1, o.y1, o.x, o.y)) - : "Z" === o.type && (t += "Z"); - } - return t; - }), - (h.prototype.toSVG = function (e) { - var t = (t = '> 8) & 255, 255 & e]; - }), - (l.USHORT = r(2)), - (w.SHORT = function (e) { - return [ - ((e = 32768 <= e ? -(65536 - e) : e) >> 8) & 255, - 255 & e, - ]; - }), - (l.SHORT = r(2)), - (w.UINT24 = function (e) { - return [(e >> 16) & 255, (e >> 8) & 255, 255 & e]; - }), - (l.UINT24 = r(3)), - (w.ULONG = function (e) { - return [ - (e >> 24) & 255, - (e >> 16) & 255, - (e >> 8) & 255, - 255 & e, - ]; - }), - (l.ULONG = r(4)), - (w.LONG = function (e) { - return [ - ((e = 2147483648 <= e ? -(4294967296 - e) : e) >> 24) & - 255, - (e >> 16) & 255, - (e >> 8) & 255, - 255 & e, - ]; - }), - (l.LONG = r(4)), - (w.FIXED = w.ULONG), - (l.FIXED = l.ULONG), - (w.FWORD = w.SHORT), - (l.FWORD = l.SHORT), - (w.UFWORD = w.USHORT), - (l.UFWORD = l.USHORT), - (w.LONGDATETIME = function (e) { - return [ - 0, - 0, - 0, - 0, - (e >> 24) & 255, - (e >> 16) & 255, - (e >> 8) & 255, - 255 & e, - ]; - }), - (l.LONGDATETIME = r(8)), - (w.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), - ] - ); - }), - (l.TAG = r(4)), - (w.Card8 = w.BYTE), - (l.Card8 = l.BYTE), - (w.Card16 = w.USHORT), - (l.Card16 = l.USHORT), - (w.OffSize = w.BYTE), - (l.OffSize = l.BYTE), - (w.SID = w.USHORT), - (l.SID = l.USHORT), - (w.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 - ? w.NUMBER16(e) - : w.NUMBER32(e); - }), - (l.NUMBER = function (e) { - return w.NUMBER(e).length; - }), - (w.NUMBER16 = function (e) { - return [28, (e >> 8) & 255, 255 & e]; - }), - (l.NUMBER16 = r(3)), - (w.NUMBER32 = function (e) { - return [ - 29, - (e >> 24) & 255, - (e >> 16) & 255, - (e >> 8) & 255, - 255 & e, - ]; - }), - (l.NUMBER32 = r(5)), - (w.REAL = function (e) { - for ( - var t = e.toString(), - r = - /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec( - t, - ), - o = - (r && - ((r = parseFloat( - "1e" + ((r[2] ? +r[2] : 0) + r[1].length), - )), - (t = (Math.round(e * r) / r).toString())), - ""), - n = 0, - s = t.length; - n < s; - n += 1 - ) { - var i = t[n]; - o += - "e" === i - ? "-" === t[++n] - ? "c" - : "b" - : "." === i - ? "a" - : "-" === i - ? "e" - : i; - } - for ( - var a = [30], - l = 0, - u = (o += 1 & o.length ? "f" : "ff").length; - l < u; - l += 2 - ) - a.push(parseInt(o.substr(l, 2), 16)); - return a; - }), - (l.REAL = function (e) { - return w.REAL(e).length; - }), - (w.NAME = w.CHARARRAY), - (l.NAME = l.CHARARRAY), - (w.STRING = w.CHARARRAY), - (l.STRING = l.CHARARRAY), - (m.UTF8 = function (e, t, r) { - for (var o = [], n = r, s = 0; s < n; s++, t += 1) - o[s] = e.getUint8(t); - return String.fromCharCode.apply(null, o); - }), - (m.UTF16 = function (e, t, r) { - for (var o = [], n = r / 2, s = 0; s < n; s++, t += 2) - o[s] = e.getUint16(t); - return String.fromCharCode.apply(null, o); - }), - (w.UTF16 = function (e) { - for (var t = [], r = 0; r < e.length; r += 1) { - var o = e.charCodeAt(r); - (t[t.length] = (o >> 8) & 255), (t[t.length] = 255 & o); - } - return t; - }), - (l.UTF16 = function (e) { - return 2 * e.length; - }); - var se, - ie = { - "x-mac-croatian": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ", - "x-mac-cyrillic": - "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю", - "x-mac-gaelic": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ", - "x-mac-greek": - "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­", - "x-mac-icelandic": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", - "x-mac-inuit": - "ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł", - "x-mac-ce": - "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", - macintosh: - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", - "x-mac-romanian": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", - "x-mac-turkish": - "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ", - }, - ae = - ((m.MACSTRING = function (e, t, r, o) { - var n = ie[o]; - if (void 0 !== n) { - for (var s = "", i = 0; i < r; i++) { - var a = e.getUint8(t + i); - s += a <= 127 ? String.fromCharCode(a) : n[127 & a]; - } - return s; - } - }), - "function" == typeof WeakMap && new WeakMap()); - function le(e) { - return -128 <= e && e <= 127; - } - (w.MACSTRING = function (e, t) { - var r = (function (e) { - if (!se) - for (var t in ((se = {}), ie)) se[t] = new String(t); - var r = se[e]; - if (void 0 !== r) { - if (ae) { - var o = ae.get(r); - if (void 0 !== o) return o; - } - var n = ie[e]; - if (void 0 !== n) { - for (var s = {}, i = 0; i < n.length; i++) - s[n.charCodeAt(i)] = i + 128; - return ae && ae.set(r, s), s; - } - } - })(t); - if (void 0 !== r) { - for (var o = [], n = 0; n < e.length; n++) { - var s = e.charCodeAt(n); - if (128 <= s && void 0 === (s = r[s])) return; - o[n] = s; - } - return o; - } - }), - (l.MACSTRING = function (e, t) { - e = w.MACSTRING(e, t); - return void 0 !== e ? e.length : 0; - }), - (w.VARDELTAS = function (e) { - for (var t = 0, r = []; t < e.length; ) - var o = e[t], - t = ( - 0 === o - ? function (e, t, r) { - for ( - var o = 0, n = e.length; - t < n && o < 64 && 0 === e[t]; - - ) - ++t, ++o; - return r.push(128 | (o - 1)), t; - } - : -128 <= o && o <= 127 - ? function (e, t, r) { - for ( - var o = 0, n = e.length, s = t; - s < n && o < 64; - - ) { - var i = e[s]; - if (!le(i)) break; - if (0 === i && s + 1 < n && 0 === e[s + 1]) - break; - ++s, ++o; - } - r.push(o - 1); - for (var a = t; a < s; ++a) - r.push((e[a] + 256) & 255); - return s; - } - : function (e, t, r) { - for ( - var o = 0, n = e.length, s = t; - s < n && o < 64; - - ) { - var i = e[s]; - if (0 === i) break; - if (le(i) && s + 1 < n && le(e[s + 1])) - break; - ++s, ++o; - } - r.push(64 | (o - 1)); - for (var a = t; a < s; ++a) { - var l = e[a]; - r.push( - ((l + 65536) >> 8) & 255, - (l + 256) & 255, - ); - } - return s; - } - )(e, t, r); - return r; - }), - (w.INDEX = function (e) { - for ( - var t = 1, r = [t], o = [], n = 0; - n < e.length; - n += 1 - ) { - var s = w.OBJECT(e[n]); - Array.prototype.push.apply(o, s), - (t += s.length), - r.push(t); - } - if (0 === o.length) return [0, 0]; - for ( - var i = [], - a = (1 + Math.floor(Math.log(t) / Math.log(2)) / 8) | 0, - l = [void 0, w.BYTE, w.USHORT, w.UINT24, w.ULONG][a], - u = 0; - u < r.length; - u += 1 - ) { - var c = l(r[u]); - Array.prototype.push.apply(i, c); - } - return Array.prototype.concat( - w.Card16(e.length), - w.OffSize(a), - i, - o, - ); - }), - (l.INDEX = function (e) { - return w.INDEX(e).length; - }), - (w.DICT = function (e) { - for ( - var t = [], r = Object.keys(e), o = r.length, n = 0; - n < o; - n += 1 - ) { - var s = parseInt(r[n], 0), - i = e[s]; - t = (t = t.concat(w.OPERAND(i.value, i.type))).concat( - w.OPERATOR(s), - ); - } - return t; - }), - (l.DICT = function (e) { - return w.DICT(e).length; - }), - (w.OPERATOR = function (e) { - return e < 1200 ? [e] : [12, e - 1200]; - }), - (w.OPERAND = function (e, t) { - var r = []; - if (Array.isArray(t)) - for (var o = 0; o < t.length; o += 1) - L.argument( - e.length === t.length, - "Not enough arguments given for type" + t, - ), - (r = r.concat(w.OPERAND(e[o], t[o]))); - else if ("SID" === t) r = r.concat(w.NUMBER(e)); - else if ("offset" === t) r = r.concat(w.NUMBER32(e)); - else if ("number" === t) r = r.concat(w.NUMBER(e)); - else { - if ("real" !== t) - throw new Error("Unknown operand type " + t); - r = r.concat(w.REAL(e)); - } - return r; - }), - (w.OP = w.BYTE), - (l.OP = l.BYTE); - var ue = "function" == typeof WeakMap && new WeakMap(); - function n(e, t, r) { - for (var o = 0; o < t.length; o += 1) { - var n = t[o]; - this[n.name] = n.value; - } - if (((this.tableName = e), (this.fields = t), r)) - for (var s = Object.keys(r), i = 0; i < s.length; i += 1) { - var a = s[i], - l = r[a]; - void 0 !== this[a] && (this[a] = l); - } - } - function ce(e, t, r) { - void 0 === r && (r = t.length); - var o = new Array(t.length + 1); - o[0] = { name: e + "Count", type: "USHORT", value: r }; - for (var n = 0; n < t.length; n++) - o[n + 1] = { name: e + n, type: "USHORT", value: t[n] }; - return o; - } - function de(e, t, r) { - var o = t.length, - n = new Array(o + 1); - n[0] = { name: e + "Count", type: "USHORT", value: o }; - for (var s = 0; s < o; s++) - n[s + 1] = { - name: e + s, - type: "TABLE", - value: r(t[s], s), - }; - return n; - } - function he(e, t, r) { - var o = t.length, - n = []; - n[0] = { name: e + "Count", type: "USHORT", value: o }; - for (var s = 0; s < o; s++) n = n.concat(r(t[s], s)); - return n; - } - function fe(e) { - 1 === e.format - ? n.call( - this, - "coverageTable", - [ - { name: "coverageFormat", type: "USHORT", value: 1 }, - ].concat(ce("glyph", e.glyphs)), - ) - : L.assert(!1, "Can't create coverage table format 2 yet."); - } - function pe(e) { - n.call( - this, - "scriptListTable", - he("scriptRecord", e, function (e, t) { - var r = e.script, - o = r.defaultLangSys; - return ( - L.assert( - !!o, - "Unable to write GSUB: script " + - e.tag + - " has no default language system.", - ), - [ - { name: "scriptTag" + t, type: "TAG", value: e.tag }, - { - name: "script" + t, - type: "TABLE", - value: new n( - "scriptTable", - [ - { - name: "defaultLangSys", - type: "TABLE", - value: new n( - "defaultLangSys", - [ - { - name: "lookupOrder", - type: "USHORT", - value: 0, - }, - { - name: "reqFeatureIndex", - type: "USHORT", - value: o.reqFeatureIndex, - }, - ].concat( - ce("featureIndex", o.featureIndexes), - ), - ), - }, - ].concat( - he( - "langSys", - r.langSysRecords, - function (e, t) { - var r = e.langSys; - return [ - { - name: "langSysTag" + t, - type: "TAG", - value: e.tag, - }, - { - name: "langSys" + t, - type: "TABLE", - value: new n( - "langSys", - [ - { - name: "lookupOrder", - type: "USHORT", - value: 0, - }, - { - name: "reqFeatureIndex", - type: "USHORT", - value: r.reqFeatureIndex, - }, - ].concat( - ce( - "featureIndex", - r.featureIndexes, - ), - ), - ), - }, - ]; - }, - ), - ), - ), - }, - ] - ); - }), - ); - } - function me(e) { - n.call( - this, - "featureListTable", - he("featureRecord", e, function (e, t) { - var r = e.feature; - return [ - { name: "featureTag" + t, type: "TAG", value: e.tag }, - { - name: "feature" + t, - type: "TABLE", - value: new n( - "featureTable", - [ - { - name: "featureParams", - type: "USHORT", - value: r.featureParams, - }, - ].concat( - ce("lookupListIndex", r.lookupListIndexes), - ), - ), - }, - ]; - }), - ); - } - function ye(e, r) { - n.call( - this, - "lookupListTable", - de("lookup", e, function (e) { - var t = r[e.lookupType]; - return ( - L.assert( - !!t, - "Unable to write GSUB lookup type " + - e.lookupType + - " tables.", - ), - new n( - "lookupTable", - [ - { - name: "lookupType", - type: "USHORT", - value: e.lookupType, - }, - { - name: "lookupFlag", - type: "USHORT", - value: e.lookupFlag, - }, - ].concat(de("subtable", e.subtables, t)), - ) - ); - }), - ); - } - (w.CHARSTRING = function (e) { - if (ue) { - var t = ue.get(e); - if (void 0 !== t) return t; - } - for (var r = [], o = e.length, n = 0; n < o; n += 1) - var s = e[n], r = r.concat(w[s.type](s.value)); - return ue && ue.set(e, r), r; - }), - (l.CHARSTRING = function (e) { - return w.CHARSTRING(e).length; - }), - (w.OBJECT = function (e) { - var t = w[e.type]; - return ( - L.argument( - void 0 !== t, - "No encoding function for type " + e.type, - ), - t(e.value) - ); - }), - (l.OBJECT = function (e) { - var t = l[e.type]; - return ( - L.argument( - void 0 !== t, - "No sizeOf function for type " + e.type, - ), - t(e.value) - ); - }), - (w.TABLE = function (e) { - for ( - var t = [], r = e.fields.length, o = [], n = [], s = 0; - s < r; - s += 1 - ) { - var i = e.fields[s], - a = w[i.type], - l = - (L.argument( - void 0 !== a, - "No encoding function for field type " + - i.type + - " (" + - i.name + - ")", - ), - e[i.name]), - a = a((l = void 0 === l ? i.value : l)); - "TABLE" === i.type - ? (n.push(t.length), (t = t.concat([0, 0])), o.push(a)) - : (t = t.concat(a)); - } - for (var u = 0; u < o.length; u += 1) { - var c = n[u], - d = t.length; - L.argument( - d < 65536, - "Table " + e.tableName + " too big.", - ), - (t[c] = d >> 8), - (t[c + 1] = 255 & d), - (t = t.concat(o[u])); - } - return t; - }), - (l.TABLE = function (e) { - for (var t = 0, r = e.fields.length, o = 0; o < r; o += 1) { - var n = e.fields[o], - s = l[n.type], - i = - (L.argument( - void 0 !== s, - "No sizeOf function for field type " + - n.type + - " (" + - n.name + - ")", - ), - e[n.name]); - (t += s((i = void 0 === i ? n.value : i))), - "TABLE" === n.type && (t += 2); - } - return t; - }), - (w.RECORD = w.TABLE), - (l.RECORD = l.TABLE), - (w.LITERAL = function (e) { - return e; - }), - (l.LITERAL = function (e) { - return e.length; - }), - (n.prototype.encode = function () { - return w.TABLE(this); - }), - (n.prototype.sizeOf = function () { - return l.TABLE(this); - }); - var S = { - Table: n, - Record: n, - Coverage: ((fe.prototype = Object.create( - n.prototype, - )).constructor = fe), - ScriptList: ((pe.prototype = Object.create( - n.prototype, - )).constructor = pe), - FeatureList: ((me.prototype = Object.create( - n.prototype, - )).constructor = me), - LookupList: ((ye.prototype = Object.create( - n.prototype, - )).constructor = ye), - ushortList: ce, - tableList: de, - recordList: he, - }; - function ge(e, t) { - return e.getUint8(t); - } - function ve(e, t) { - return e.getUint16(t, !1); - } - function be(e, t) { - return e.getUint32(t, !1); - } - function je(e, t) { - return e.getInt16(t, !1) + e.getUint16(t + 2, !1) / 65535; - } - var _e = { - byte: 1, - uShort: 2, - short: 2, - uLong: 4, - fixed: 4, - longDateTime: 8, - tag: 4, - }; - function u(e, t) { - (this.data = e), (this.offset = t), (this.relativeOffset = 0); - } - (u.prototype.parseByte = function () { - var e = this.data.getUint8(this.offset + this.relativeOffset); - return (this.relativeOffset += 1), e; - }), - (u.prototype.parseChar = function () { - var e = this.data.getInt8( - this.offset + this.relativeOffset, - ); - return (this.relativeOffset += 1), e; - }), - (u.prototype.parseCard8 = u.prototype.parseByte), - (u.prototype.parseCard16 = u.prototype.parseUShort = - function () { - var e = this.data.getUint16( - this.offset + this.relativeOffset, - ); - return (this.relativeOffset += 2), e; - }), - (u.prototype.parseSID = u.prototype.parseUShort), - (u.prototype.parseOffset16 = u.prototype.parseUShort), - (u.prototype.parseShort = function () { - var e = this.data.getInt16( - this.offset + this.relativeOffset, - ); - return (this.relativeOffset += 2), e; - }), - (u.prototype.parseF2Dot14 = function () { - var e = - this.data.getInt16(this.offset + this.relativeOffset) / - 16384; - return (this.relativeOffset += 2), e; - }), - (u.prototype.parseOffset32 = u.prototype.parseULong = - function () { - var e = be(this.data, this.offset + this.relativeOffset); - return (this.relativeOffset += 4), e; - }), - (u.prototype.parseFixed = function () { - var e = je(this.data, this.offset + this.relativeOffset); - return (this.relativeOffset += 4), e; - }), - (u.prototype.parseString = function (e) { - var t = this.data, - r = this.offset + this.relativeOffset, - o = ""; - this.relativeOffset += e; - for (var n = 0; n < e; n++) - o += String.fromCharCode(t.getUint8(r + n)); - return o; - }), - (u.prototype.parseTag = function () { - return this.parseString(4); - }), - (u.prototype.parseLongDateTime = function () { - var e = be( - this.data, - this.offset + this.relativeOffset + 4, - ); - return (e -= 2082844800), (this.relativeOffset += 8), e; - }), - (u.prototype.parseVersion = function (e) { - var t = ve(this.data, this.offset + this.relativeOffset), - r = ve(this.data, this.offset + this.relativeOffset + 2); - return ( - (this.relativeOffset += 4), - t + r / (e = void 0 === e ? 4096 : e) / 10 - ); - }), - (u.prototype.skip = function (e, t) { - this.relativeOffset += _e[e] * (t = void 0 === t ? 1 : t); - }), - (u.prototype.parseULongList = function (e) { - void 0 === e && (e = this.parseULong()); - for ( - var t = new Array(e), - r = this.data, - o = this.offset + this.relativeOffset, - n = 0; - n < e; - n++ - ) - (t[n] = r.getUint32(o)), (o += 4); - return (this.relativeOffset += 4 * e), t; - }), - (u.prototype.parseOffset16List = u.prototype.parseUShortList = - function (e) { - void 0 === e && (e = this.parseUShort()); - for ( - var t = new Array(e), - r = this.data, - o = this.offset + this.relativeOffset, - n = 0; - n < e; - n++ - ) - (t[n] = r.getUint16(o)), (o += 2); - return (this.relativeOffset += 2 * e), t; - }), - (u.prototype.parseShortList = function (e) { - for ( - var t = new Array(e), - r = this.data, - o = this.offset + this.relativeOffset, - n = 0; - n < e; - n++ - ) - (t[n] = r.getInt16(o)), (o += 2); - return (this.relativeOffset += 2 * e), t; - }), - (u.prototype.parseByteList = function (e) { - for ( - var t = new Array(e), - r = this.data, - o = this.offset + this.relativeOffset, - n = 0; - n < e; - n++ - ) - t[n] = r.getUint8(o++); - return (this.relativeOffset += e), t; - }), - (u.prototype.parseList = function (e, t) { - t || ((t = e), (e = this.parseUShort())); - for (var r = new Array(e), o = 0; o < e; o++) - r[o] = t.call(this); - return r; - }), - (u.prototype.parseList32 = function (e, t) { - t || ((t = e), (e = this.parseULong())); - for (var r = new Array(e), o = 0; o < e; o++) - r[o] = t.call(this); - return r; - }), - (u.prototype.parseRecordList = function (e, t) { - t || ((t = e), (e = this.parseUShort())); - for ( - var r = new Array(e), o = Object.keys(t), n = 0; - n < e; - n++ - ) { - for (var s = {}, i = 0; i < o.length; i++) { - var a = o[i], - l = t[a]; - s[a] = l.call(this); - } - r[n] = s; - } - return r; - }), - (u.prototype.parseRecordList32 = function (e, t) { - t || ((t = e), (e = this.parseULong())); - for ( - var r = new Array(e), o = Object.keys(t), n = 0; - n < e; - n++ - ) { - for (var s = {}, i = 0; i < o.length; i++) { - var a = o[i], - l = t[a]; - s[a] = l.call(this); - } - r[n] = s; - } - return r; - }), - (u.prototype.parseStruct = function (e) { - if ("function" == typeof e) return e.call(this); - for ( - var t = Object.keys(e), r = {}, o = 0; - o < t.length; - o++ - ) { - var n = t[o], - s = e[n]; - r[n] = s.call(this); - } - return r; - }), - (u.prototype.parseValueRecord = function (e) { - var t; - if (0 !== (e = void 0 === e ? this.parseUShort() : e)) - return ( - (t = {}), - 1 & e && (t.xPlacement = this.parseShort()), - 2 & e && (t.yPlacement = this.parseShort()), - 4 & e && (t.xAdvance = this.parseShort()), - 8 & e && (t.yAdvance = this.parseShort()), - 16 & e && ((t.xPlaDevice = void 0), this.parseShort()), - 32 & e && ((t.yPlaDevice = void 0), this.parseShort()), - 64 & e && ((t.xAdvDevice = void 0), this.parseShort()), - 128 & e && ((t.yAdvDevice = void 0), this.parseShort()), - t - ); - }), - (u.prototype.parseValueRecordList = function () { - for ( - var e = this.parseUShort(), - t = this.parseUShort(), - r = new Array(t), - o = 0; - o < t; - o++ - ) - r[o] = this.parseValueRecord(e); - return r; - }), - (u.prototype.parsePointer = function (e) { - var t = this.parseOffset16(); - if (0 < t) - return new u(this.data, this.offset + t).parseStruct(e); - }), - (u.prototype.parsePointer32 = function (e) { - var t = this.parseOffset32(); - if (0 < t) - return new u(this.data, this.offset + t).parseStruct(e); - }), - (u.prototype.parseListOfLists = function (e) { - for ( - var t = this.parseOffset16List(), - r = t.length, - o = this.relativeOffset, - n = new Array(r), - s = 0; - s < r; - s++ - ) { - var i = t[s]; - if (0 === i) n[s] = void 0; - else if (((this.relativeOffset = i), e)) { - for ( - var a = this.parseOffset16List(), - l = new Array(a.length), - u = 0; - u < a.length; - u++ - ) - (this.relativeOffset = i + a[u]), - (l[u] = e.call(this)); - n[s] = l; - } else n[s] = this.parseUShortList(); - } - return (this.relativeOffset = o), n; - }), - (u.prototype.parseCoverage = function () { - var e = this.offset + this.relativeOffset, - t = this.parseUShort(), - r = this.parseUShort(); - if (1 === t) - return { format: 1, glyphs: this.parseUShortList(r) }; - if (2 !== t) - throw new Error( - "0x" + - e.toString(16) + - ": Coverage format must be 1 or 2.", - ); - for (var o = new Array(r), n = 0; n < r; n++) - o[n] = { - start: this.parseUShort(), - end: this.parseUShort(), - index: this.parseUShort(), - }; - return { format: 2, ranges: o }; - }), - (u.prototype.parseClassDef = function () { - var e = this.offset + this.relativeOffset, - t = this.parseUShort(); - if (1 === t) - return { - format: 1, - startGlyph: this.parseUShort(), - classes: this.parseUShortList(), - }; - if (2 === t) - return { - format: 2, - ranges: this.parseRecordList({ - start: u.uShort, - end: u.uShort, - classId: u.uShort, - }), - }; - throw new Error( - "0x" + - e.toString(16) + - ": ClassDef format must be 1 or 2.", - ); - }), - (u.list = function (e, t) { - return function () { - return this.parseList(e, t); - }; - }), - (u.list32 = function (e, t) { - return function () { - return this.parseList32(e, t); - }; - }), - (u.recordList = function (e, t) { - return function () { - return this.parseRecordList(e, t); - }; - }), - (u.recordList32 = function (e, t) { - return function () { - return this.parseRecordList32(e, t); - }; - }), - (u.pointer = function (e) { - return function () { - return this.parsePointer(e); - }; - }), - (u.pointer32 = function (e) { - return function () { - return this.parsePointer32(e); - }; - }), - (u.tag = u.prototype.parseTag), - (u.byte = u.prototype.parseByte), - (u.uShort = u.offset16 = u.prototype.parseUShort), - (u.uShortList = u.prototype.parseUShortList), - (u.uLong = u.offset32 = u.prototype.parseULong), - (u.uLongList = u.prototype.parseULongList), - (u.struct = u.prototype.parseStruct), - (u.coverage = u.prototype.parseCoverage), - (u.classDef = u.prototype.parseClassDef); - var xe = { - reserved: u.uShort, - reqFeatureIndex: u.uShort, - featureIndexes: u.uShortList, - }, - R = - ((u.prototype.parseScriptList = function () { - return ( - this.parsePointer( - u.recordList({ - tag: u.tag, - script: u.pointer({ - defaultLangSys: u.pointer(xe), - langSysRecords: u.recordList({ - tag: u.tag, - langSys: u.pointer(xe), - }), - }), - }), - ) || [] - ); - }), - (u.prototype.parseFeatureList = function () { - return ( - this.parsePointer( - u.recordList({ - tag: u.tag, - feature: u.pointer({ - featureParams: u.offset16, - lookupListIndexes: u.uShortList, - }), - }), - ) || [] - ); - }), - (u.prototype.parseLookupList = function (o) { - return ( - this.parsePointer( - u.list( - u.pointer(function () { - var e = this.parseUShort(), - t = - (L.argument( - 1 <= e && e <= 9, - "GPOS/GSUB lookup type " + e + " unknown.", - ), - this.parseUShort()), - r = 16 & t; - return { - lookupType: e, - lookupFlag: t, - subtables: this.parseList(u.pointer(o[e])), - markFilteringSet: r - ? this.parseUShort() - : void 0, - }; - }), - ), - ) || [] - ); - }), - (u.prototype.parseFeatureVariationsList = function () { - return ( - this.parsePointer32(function () { - var e = this.parseUShort(), - t = this.parseUShort(); - return ( - L.argument( - 1 === e && t < 1, - "GPOS/GSUB feature variations table unknown.", - ), - this.parseRecordList32({ - conditionSetOffset: u.offset32, - featureTableSubstitutionOffset: u.offset32, - }) - ); - }) || [] - ); - }), - { - getByte: ge, - getCard8: ge, - getUShort: ve, - getCard16: ve, - getShort: function (e, t) { - return e.getInt16(t, !1); - }, - getULong: be, - getFixed: je, - getTag: function (e, t) { - for (var r = "", o = t; o < t + 4; o += 1) - r += String.fromCharCode(e.getInt8(o)); - return r; - }, - getOffset: function (e, t, r) { - for (var o = 0, n = 0; n < r; n += 1) - o = (o <<= 8) + e.getUint8(t + n); - return o; - }, - getBytes: function (e, t, r) { - for (var o = [], n = t; n < r; n += 1) - o.push(e.getUint8(n)); - return o; - }, - bytesToString: function (e) { - for (var t = "", r = 0; r < e.length; r += 1) - t += String.fromCharCode(e[r]); - return t; - }, - Parser: u, - }); - var we = { - parse: function (e, t) { - for ( - var r = {}, - o = - ((r.version = R.getUShort(e, t)), - L.argument( - 0 === r.version, - "cmap table version should be 0.", - ), - (r.numTables = R.getUShort(e, t + 2)), - -1), - n = r.numTables - 1; - 0 <= n; - --n - ) { - var s = R.getUShort(e, t + 4 + 8 * n), - i = R.getUShort(e, t + 4 + 8 * n + 2); - if ( - (3 === s && (0 === i || 1 === i || 10 === i)) || - (0 === s && - (0 === i || - 1 === i || - 2 === i || - 3 === i || - 4 === i)) - ) { - o = R.getULong(e, t + 4 + 8 * n + 4); - break; - } - } - if (-1 === o) - throw new Error("No valid cmap sub-tables found."); - var a = new R.Parser(e, t + o); - if (((r.format = a.parseUShort()), 12 === r.format)) { - var l, - u = r, - c = a; - c.parseUShort(), - (u.length = c.parseULong()), - (u.language = c.parseULong()), - (u.groupCount = l = c.parseULong()), - (u.glyphIndexMap = {}); - for (var d = 0; d < l; d += 1) - for ( - var h = c.parseULong(), - f = c.parseULong(), - p = c.parseULong(), - m = h; - m <= f; - m += 1 - ) - (u.glyphIndexMap[m] = p), p++; - } else { - if (4 !== r.format) - throw new Error( - "Only format 4 and 12 cmap tables are supported (found format " + - r.format + - ").", - ); - var y = r, - g = e, - v = t, - b = o; - (y.length = a.parseUShort()), - (y.language = a.parseUShort()), - (y.segCount = j = a.parseUShort() >> 1), - a.skip("uShort", 3), - (y.glyphIndexMap = {}); - for ( - var j, - _ = new R.Parser(g, v + b + 14), - x = new R.Parser(g, v + b + 16 + 2 * j), - w = new R.Parser(g, v + b + 16 + 4 * j), - S = new R.Parser(g, v + b + 16 + 6 * j), - T = v + b + 16 + 8 * j, - M = 0; - M < j - 1; - M += 1 - ) - for ( - var E = void 0, - k = _.parseUShort(), - C = x.parseUShort(), - O = w.parseShort(), - P = S.parseUShort(), - A = C; - A <= k; - A += 1 - ) - 0 !== P - ? ((T = - (T = S.offset + S.relativeOffset - 2) + - P + - 2 * (A - C)), - 0 !== (E = R.getUShort(g, T)) && - (E = (E + O) & 65535)) - : (E = (A + O) & 65535), - (y.glyphIndexMap[A] = E); - } - return r; - }, - make: function (e) { - for (var t = !0, r = e.length - 1; 0 < r; --r) - if (65535 < e.get(r).unicode) { - console.log("Adding CMAP format 12 (needed!)"), - (t = !1); - break; - } - var o, - n, - s = [ - { name: "version", type: "USHORT", value: 0 }, - { - name: "numTables", - type: "USHORT", - value: t ? 1 : 2, - }, - { name: "platformID", type: "USHORT", value: 3 }, - { name: "encodingID", type: "USHORT", value: 1 }, - { name: "offset", type: "ULONG", value: t ? 12 : 20 }, - ], - i = - ((s = (s = t - ? s - : s.concat([ - { - name: "cmap12PlatformID", - type: "USHORT", - value: 3, - }, - { - name: "cmap12EncodingID", - type: "USHORT", - value: 10, - }, - { - name: "cmap12Offset", - type: "ULONG", - value: 0, - }, - ])).concat([ - { name: "format", type: "USHORT", value: 4 }, - { name: "cmap4Length", type: "USHORT", value: 0 }, - { name: "language", type: "USHORT", value: 0 }, - { name: "segCountX2", type: "USHORT", value: 0 }, - { name: "searchRange", type: "USHORT", value: 0 }, - { name: "entrySelector", type: "USHORT", value: 0 }, - { name: "rangeShift", type: "USHORT", value: 0 }, - ])), - new S.Table("cmap", s)); - for (i.segments = [], r = 0; r < e.length; r += 1) { - for ( - var a = e.get(r), l = 0; - l < a.unicodes.length; - l += 1 - ) - (o = a.unicodes[l]), - (n = r), - i.segments.push({ - end: o, - start: o, - delta: -(o - n), - offset: 0, - glyphIndex: n, - }); - i.segments = i.segments.sort(function (e, t) { - return e.start - t.start; - }); - } - i.segments.push({ - end: 65535, - start: 65535, - delta: 1, - offset: 0, - }); - var u = i.segments.length, - c = 0, - d = [], - h = [], - f = [], - p = [], - m = [], - y = []; - for (r = 0; r < u; r += 1) { - var g = i.segments[r]; - g.end <= 65535 && g.start <= 65535 - ? ((d = d.concat({ - name: "end_" + r, - type: "USHORT", - value: g.end, - })), - (h = h.concat({ - name: "start_" + r, - type: "USHORT", - value: g.start, - })), - (f = f.concat({ - name: "idDelta_" + r, - type: "SHORT", - value: g.delta, - })), - (p = p.concat({ - name: "idRangeOffset_" + r, - type: "USHORT", - value: g.offset, - })), - void 0 !== g.glyphId && - (m = m.concat({ - name: "glyph_" + r, - type: "USHORT", - value: g.glyphId, - }))) - : (c += 1), - t || - void 0 === g.glyphIndex || - (y = (y = (y = y.concat({ - name: "cmap12Start_" + r, - type: "ULONG", - value: g.start, - })).concat({ - name: "cmap12End_" + r, - type: "ULONG", - value: g.end, - })).concat({ - name: "cmap12Glyph_" + r, - type: "ULONG", - value: g.glyphIndex, - })); - } - return ( - (i.segCountX2 = 2 * (u - c)), - (i.searchRange = - 2 * - Math.pow( - 2, - Math.floor(Math.log(u - c) / Math.log(2)), - )), - (i.entrySelector = - Math.log(i.searchRange / 2) / Math.log(2)), - (i.rangeShift = i.segCountX2 - i.searchRange), - (i.fields = i.fields.concat(d)), - i.fields.push({ - name: "reservedPad", - type: "USHORT", - value: 0, - }), - (i.fields = i.fields.concat(h)), - (i.fields = i.fields.concat(f)), - (i.fields = i.fields.concat(p)), - (i.fields = i.fields.concat(m)), - (i.cmap4Length = - 14 + - 2 * d.length + - 2 + - 2 * h.length + - 2 * f.length + - 2 * p.length + - 2 * m.length), - t || - ((s = 16 + 4 * y.length), - (i.cmap12Offset = 20 + i.cmap4Length), - (i.fields = i.fields.concat([ - { name: "cmap12Format", type: "USHORT", value: 12 }, - { - name: "cmap12Reserved", - type: "USHORT", - value: 0, - }, - { name: "cmap12Length", type: "ULONG", value: s }, - { name: "cmap12Language", type: "ULONG", value: 0 }, - { - name: "cmap12nGroups", - type: "ULONG", - value: y.length / 3, - }, - ])), - (i.fields = i.fields.concat(y))), - i - ); - }, - }, - Se = [ - ".notdef", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "questiondown", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "AE", - "ordfeminine", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "ae", - "dotlessi", - "lslash", - "oslash", - "oe", - "germandbls", - "onesuperior", - "logicalnot", - "mu", - "trademark", - "Eth", - "onehalf", - "plusminus", - "Thorn", - "onequarter", - "divide", - "brokenbar", - "degree", - "thorn", - "threequarters", - "twosuperior", - "registered", - "minus", - "eth", - "multiply", - "threesuperior", - "copyright", - "Aacute", - "Acircumflex", - "Adieresis", - "Agrave", - "Aring", - "Atilde", - "Ccedilla", - "Eacute", - "Ecircumflex", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Ntilde", - "Oacute", - "Ocircumflex", - "Odieresis", - "Ograve", - "Otilde", - "Scaron", - "Uacute", - "Ucircumflex", - "Udieresis", - "Ugrave", - "Yacute", - "Ydieresis", - "Zcaron", - "aacute", - "acircumflex", - "adieresis", - "agrave", - "aring", - "atilde", - "ccedilla", - "eacute", - "ecircumflex", - "edieresis", - "egrave", - "iacute", - "icircumflex", - "idieresis", - "igrave", - "ntilde", - "oacute", - "ocircumflex", - "odieresis", - "ograve", - "otilde", - "scaron", - "uacute", - "ucircumflex", - "udieresis", - "ugrave", - "yacute", - "ydieresis", - "zcaron", - "exclamsmall", - "Hungarumlautsmall", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "266 ff", - "onedotenleader", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "isuperior", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "rsuperior", - "ssuperior", - "tsuperior", - "ff", - "ffi", - "ffl", - "parenleftinferior", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "Dotaccentsmall", - "Macronsmall", - "figuredash", - "hypheninferior", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "zerosuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - "001.000", - "001.001", - "001.002", - "001.003", - "Black", - "Bold", - "Book", - "Light", - "Medium", - "Regular", - "Roman", - "Semibold", - ], - Te = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quoteright", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "quoteleft", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "exclamdown", - "cent", - "sterling", - "fraction", - "yen", - "florin", - "section", - "currency", - "quotesingle", - "quotedblleft", - "guillemotleft", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "", - "endash", - "dagger", - "daggerdbl", - "periodcentered", - "", - "paragraph", - "bullet", - "quotesinglbase", - "quotedblbase", - "quotedblright", - "guillemotright", - "ellipsis", - "perthousand", - "", - "questiondown", - "", - "grave", - "acute", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "dieresis", - "", - "ring", - "cedilla", - "", - "hungarumlaut", - "ogonek", - "caron", - "emdash", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "AE", - "", - "ordfeminine", - "", - "", - "", - "", - "Lslash", - "Oslash", - "OE", - "ordmasculine", - "", - "", - "", - "", - "", - "ae", - "", - "", - "", - "dotlessi", - "", - "", - "lslash", - "oslash", - "oe", - "germandbls", - ], - Me = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "space", - "exclamsmall", - "Hungarumlautsmall", - "", - "dollaroldstyle", - "dollarsuperior", - "ampersandsmall", - "Acutesmall", - "parenleftsuperior", - "parenrightsuperior", - "twodotenleader", - "onedotenleader", - "comma", - "hyphen", - "period", - "fraction", - "zerooldstyle", - "oneoldstyle", - "twooldstyle", - "threeoldstyle", - "fouroldstyle", - "fiveoldstyle", - "sixoldstyle", - "sevenoldstyle", - "eightoldstyle", - "nineoldstyle", - "colon", - "semicolon", - "commasuperior", - "threequartersemdash", - "periodsuperior", - "questionsmall", - "", - "asuperior", - "bsuperior", - "centsuperior", - "dsuperior", - "esuperior", - "", - "", - "isuperior", - "", - "", - "lsuperior", - "msuperior", - "nsuperior", - "osuperior", - "", - "", - "rsuperior", - "ssuperior", - "tsuperior", - "", - "ff", - "fi", - "fl", - "ffi", - "ffl", - "parenleftinferior", - "", - "parenrightinferior", - "Circumflexsmall", - "hyphensuperior", - "Gravesmall", - "Asmall", - "Bsmall", - "Csmall", - "Dsmall", - "Esmall", - "Fsmall", - "Gsmall", - "Hsmall", - "Ismall", - "Jsmall", - "Ksmall", - "Lsmall", - "Msmall", - "Nsmall", - "Osmall", - "Psmall", - "Qsmall", - "Rsmall", - "Ssmall", - "Tsmall", - "Usmall", - "Vsmall", - "Wsmall", - "Xsmall", - "Ysmall", - "Zsmall", - "colonmonetary", - "onefitted", - "rupiah", - "Tildesmall", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "exclamdownsmall", - "centoldstyle", - "Lslashsmall", - "", - "", - "Scaronsmall", - "Zcaronsmall", - "Dieresissmall", - "Brevesmall", - "Caronsmall", - "", - "Dotaccentsmall", - "", - "", - "Macronsmall", - "", - "", - "figuredash", - "hypheninferior", - "", - "", - "Ogoneksmall", - "Ringsmall", - "Cedillasmall", - "", - "", - "", - "onequarter", - "onehalf", - "threequarters", - "questiondownsmall", - "oneeighth", - "threeeighths", - "fiveeighths", - "seveneighths", - "onethird", - "twothirds", - "", - "", - "zerosuperior", - "onesuperior", - "twosuperior", - "threesuperior", - "foursuperior", - "fivesuperior", - "sixsuperior", - "sevensuperior", - "eightsuperior", - "ninesuperior", - "zeroinferior", - "oneinferior", - "twoinferior", - "threeinferior", - "fourinferior", - "fiveinferior", - "sixinferior", - "seveninferior", - "eightinferior", - "nineinferior", - "centinferior", - "dollarinferior", - "periodinferior", - "commainferior", - "Agravesmall", - "Aacutesmall", - "Acircumflexsmall", - "Atildesmall", - "Adieresissmall", - "Aringsmall", - "AEsmall", - "Ccedillasmall", - "Egravesmall", - "Eacutesmall", - "Ecircumflexsmall", - "Edieresissmall", - "Igravesmall", - "Iacutesmall", - "Icircumflexsmall", - "Idieresissmall", - "Ethsmall", - "Ntildesmall", - "Ogravesmall", - "Oacutesmall", - "Ocircumflexsmall", - "Otildesmall", - "Odieresissmall", - "OEsmall", - "Oslashsmall", - "Ugravesmall", - "Uacutesmall", - "Ucircumflexsmall", - "Udieresissmall", - "Yacutesmall", - "Thornsmall", - "Ydieresissmall", - ], - c = [ - ".notdef", - ".null", - "nonmarkingreturn", - "space", - "exclam", - "quotedbl", - "numbersign", - "dollar", - "percent", - "ampersand", - "quotesingle", - "parenleft", - "parenright", - "asterisk", - "plus", - "comma", - "hyphen", - "period", - "slash", - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "colon", - "semicolon", - "less", - "equal", - "greater", - "question", - "at", - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "bracketleft", - "backslash", - "bracketright", - "asciicircum", - "underscore", - "grave", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "braceleft", - "bar", - "braceright", - "asciitilde", - "Adieresis", - "Aring", - "Ccedilla", - "Eacute", - "Ntilde", - "Odieresis", - "Udieresis", - "aacute", - "agrave", - "acircumflex", - "adieresis", - "atilde", - "aring", - "ccedilla", - "eacute", - "egrave", - "ecircumflex", - "edieresis", - "iacute", - "igrave", - "icircumflex", - "idieresis", - "ntilde", - "oacute", - "ograve", - "ocircumflex", - "odieresis", - "otilde", - "uacute", - "ugrave", - "ucircumflex", - "udieresis", - "dagger", - "degree", - "cent", - "sterling", - "section", - "bullet", - "paragraph", - "germandbls", - "registered", - "copyright", - "trademark", - "acute", - "dieresis", - "notequal", - "AE", - "Oslash", - "infinity", - "plusminus", - "lessequal", - "greaterequal", - "yen", - "mu", - "partialdiff", - "summation", - "product", - "pi", - "integral", - "ordfeminine", - "ordmasculine", - "Omega", - "ae", - "oslash", - "questiondown", - "exclamdown", - "logicalnot", - "radical", - "florin", - "approxequal", - "Delta", - "guillemotleft", - "guillemotright", - "ellipsis", - "nonbreakingspace", - "Agrave", - "Atilde", - "Otilde", - "OE", - "oe", - "endash", - "emdash", - "quotedblleft", - "quotedblright", - "quoteleft", - "quoteright", - "divide", - "lozenge", - "ydieresis", - "Ydieresis", - "fraction", - "currency", - "guilsinglleft", - "guilsinglright", - "fi", - "fl", - "daggerdbl", - "periodcentered", - "quotesinglbase", - "quotedblbase", - "perthousand", - "Acircumflex", - "Ecircumflex", - "Aacute", - "Edieresis", - "Egrave", - "Iacute", - "Icircumflex", - "Idieresis", - "Igrave", - "Oacute", - "Ocircumflex", - "apple", - "Ograve", - "Uacute", - "Ucircumflex", - "Ugrave", - "dotlessi", - "circumflex", - "tilde", - "macron", - "breve", - "dotaccent", - "ring", - "cedilla", - "hungarumlaut", - "ogonek", - "caron", - "Lslash", - "lslash", - "Scaron", - "scaron", - "Zcaron", - "zcaron", - "brokenbar", - "Eth", - "eth", - "Yacute", - "yacute", - "Thorn", - "thorn", - "minus", - "multiply", - "onesuperior", - "twosuperior", - "threesuperior", - "onehalf", - "onequarter", - "threequarters", - "franc", - "Gbreve", - "gbreve", - "Idotaccent", - "Scedilla", - "scedilla", - "Cacute", - "cacute", - "Ccaron", - "ccaron", - "dcroat", - ]; - function Ee(e) { - this.font = e; - } - function ke(e) { - this.cmap = e; - } - function Ce(e, t) { - (this.encoding = e), (this.charset = t); - } - function Oe(e) { - switch (e.version) { - case 1: - this.names = c.slice(); - break; - case 2: - this.names = new Array(e.numberOfGlyphs); - for (var t = 0; t < e.numberOfGlyphs; t++) - e.glyphNameIndex[t] < c.length - ? (this.names[t] = c[e.glyphNameIndex[t]]) - : (this.names[t] = - e.names[e.glyphNameIndex[t] - c.length]); - break; - case 2.5: - this.names = new Array(e.numberOfGlyphs); - for (var r = 0; r < e.numberOfGlyphs; r++) - this.names[r] = c[r + e.glyphNameIndex[r]]; - break; - default: - this.names = []; - } - } - (Ee.prototype.charToGlyphIndex = function (e) { - var t = e.codePointAt(0), - r = this.font.glyphs; - if (r) - for (var o = 0; o < r.length; o += 1) - for ( - var n = r.get(o), s = 0; - s < n.unicodes.length; - s += 1 - ) - if (n.unicodes[s] === t) return o; - return null; - }), - (ke.prototype.charToGlyphIndex = function (e) { - return this.cmap.glyphIndexMap[e.codePointAt(0)] || 0; - }), - (Ce.prototype.charToGlyphIndex = function (e) { - (e = e.codePointAt(0)), (e = this.encoding[e]); - return this.charset.indexOf(e); - }), - (Oe.prototype.nameToGlyphIndex = function (e) { - return this.names.indexOf(e); - }), - (Oe.prototype.glyphIndexToName = function (e) { - return this.names[e]; - }); - var d = { - line: function (e, t, r, o, n) { - e.beginPath(), e.moveTo(t, r), e.lineTo(o, n), e.stroke(); - }, - }; - function f(e) { - this.bindConstructorValues(e); - } - function Pe(t, e, r) { - Object.defineProperty(t, e, { - get: function () { - return t.path, t[r]; - }, - set: function (e) { - t[r] = e; - }, - enumerable: !0, - configurable: !0, - }); - } - function Ae(e, t) { - if (((this.font = e), (this.glyphs = {}), Array.isArray(t))) - for (var r = 0; r < t.length; r++) this.glyphs[r] = t[r]; - this.length = (t && t.length) || 0; - } - (f.prototype.bindConstructorValues = function (e) { - var t; - (this.index = e.index || 0), - (this.name = e.name || null), - (this.unicode = e.unicode || void 0), - (this.unicodes = - e.unicodes || void 0 !== e.unicode ? [e.unicode] : []), - e.xMin && (this.xMin = e.xMin), - e.yMin && (this.yMin = e.yMin), - e.xMax && (this.xMax = e.xMax), - e.yMax && (this.yMax = e.yMax), - e.advanceWidth && (this.advanceWidth = e.advanceWidth), - Object.defineProperty( - this, - "path", - ((e = e.path), - (t = e || new h()), - { - configurable: !0, - get: function () { - return (t = "function" == typeof t ? t() : t); - }, - set: function (e) { - t = e; - }, - }), - ); - }), - (f.prototype.addUnicode = function (e) { - 0 === this.unicodes.length && (this.unicode = e), - this.unicodes.push(e); - }), - (f.prototype.getBoundingBox = function () { - return this.path.getBoundingBox(); - }), - (f.prototype.getPath = function (e, t, r, o, n) { - (e = void 0 !== e ? e : 0), - (t = void 0 !== t ? t : 0), - (r = void 0 !== r ? r : 72); - for ( - var s, - i, - a = (o = o || {}).xScale, - l = o.yScale, - u = - ((s = - o.hinting && n && n.hinting - ? this.path && n.hinting.exec(this, r) - : s) - ? ((i = n.hinting.getCommands(s)), - (e = Math.round(e)), - (t = Math.round(t)), - (a = l = 1)) - : ((i = this.path.commands), - (o = (1 / this.path.unitsPerEm) * r), - void 0 === a && (a = o), - void 0 === l && (l = o)), - new h()), - c = 0; - c < i.length; - c += 1 - ) { - var d = i[c]; - "M" === d.type - ? u.moveTo(e + d.x * a, t + -d.y * l) - : "L" === d.type - ? u.lineTo(e + d.x * a, t + -d.y * l) - : "Q" === d.type - ? u.quadraticCurveTo( - e + d.x1 * a, - t + -d.y1 * l, - e + d.x * a, - t + -d.y * l, - ) - : "C" === d.type - ? u.curveTo( - e + d.x1 * a, - t + -d.y1 * l, - e + d.x2 * a, - t + -d.y2 * l, - e + d.x * a, - t + -d.y * l, - ) - : "Z" === d.type && u.closePath(); - } - return u; - }), - (f.prototype.getContours = function () { - if (void 0 === this.points) return []; - for ( - var e = [], t = [], r = 0; - r < this.points.length; - r += 1 - ) { - var o = this.points[r]; - t.push(o), o.lastPointOfContour && (e.push(t), (t = [])); - } - return ( - L.argument( - 0 === t.length, - "There are still points left in the current contour.", - ), - e - ); - }), - (f.prototype.getMetrics = function () { - for ( - var e = this.path.commands, t = [], r = [], o = 0; - o < e.length; - o += 1 - ) { - var n = e[o]; - "Z" !== n.type && (t.push(n.x), r.push(n.y)), - ("Q" !== n.type && "C" !== n.type) || - (t.push(n.x1), r.push(n.y1)), - "C" === n.type && (t.push(n.x2), r.push(n.y2)); - } - var s = { - xMin: Math.min.apply(null, t), - yMin: Math.min.apply(null, r), - xMax: Math.max.apply(null, t), - yMax: Math.max.apply(null, r), - leftSideBearing: this.leftSideBearing, - }; - return ( - isFinite(s.xMin) || (s.xMin = 0), - isFinite(s.xMax) || (s.xMax = this.advanceWidth), - isFinite(s.yMin) || (s.yMin = 0), - isFinite(s.yMax) || (s.yMax = 0), - (s.rightSideBearing = - this.advanceWidth - - s.leftSideBearing - - (s.xMax - s.xMin)), - s - ); - }), - (f.prototype.draw = function (e, t, r, o, n) { - this.getPath(t, r, o, n).draw(e); - }), - (f.prototype.drawPoints = function (i, e, t, r) { - function o(e, t, r, o) { - var n = 2 * Math.PI; - i.beginPath(); - for (var s = 0; s < e.length; s += 1) - i.moveTo(t + e[s].x * o, r + e[s].y * o), - i.arc(t + e[s].x * o, r + e[s].y * o, 2, 0, n, !1); - i.closePath(), i.fill(); - } - (e = void 0 !== e ? e : 0), (t = void 0 !== t ? t : 0); - for ( - var r = - (1 / this.path.unitsPerEm) * - (r = void 0 !== r ? r : 24), - n = [], - s = [], - a = this.path, - l = 0; - l < a.commands.length; - l += 1 - ) { - var u = a.commands[l]; - void 0 !== u.x && n.push({ x: u.x, y: -u.y }), - void 0 !== u.x1 && s.push({ x: u.x1, y: -u.y1 }), - void 0 !== u.x2 && s.push({ x: u.x2, y: -u.y2 }); - } - (i.fillStyle = "blue"), - o(n, e, t, r), - (i.fillStyle = "red"), - o(s, e, t, r); - }), - (f.prototype.drawMetrics = function (e, t, r, o) { - (t = void 0 !== t ? t : 0), - (r = void 0 !== r ? r : 0), - (o = - (1 / this.path.unitsPerEm) * - (o = void 0 !== o ? o : 24)), - (e.lineWidth = 1), - (e.strokeStyle = "black"), - d.line(e, t, -1e4, t, 1e4), - d.line(e, -1e4, r, 1e4, r); - var n = this.xMin || 0, - s = this.yMin || 0, - i = this.xMax || 0, - a = this.yMax || 0, - l = this.advanceWidth || 0; - (e.strokeStyle = "blue"), - d.line(e, t + n * o, -1e4, t + n * o, 1e4), - d.line(e, t + i * o, -1e4, t + i * o, 1e4), - d.line(e, -1e4, r + -s * o, 1e4, r + -s * o), - d.line(e, -1e4, r + -a * o, 1e4, r + -a * o), - (e.strokeStyle = "green"), - d.line(e, t + l * o, -1e4, t + l * o, 1e4); - }), - (Ae.prototype.get = function (e) { - return ( - "function" == typeof this.glyphs[e] && - (this.glyphs[e] = this.glyphs[e]()), - this.glyphs[e] - ); - }), - (Ae.prototype.push = function (e, t) { - (this.glyphs[e] = t), this.length++; - }); - var p = { - GlyphSet: Ae, - glyphLoader: function (e, t) { - return new f({ index: t, font: e }); - }, - ttfGlyphLoader: function (r, e, o, n, s, i) { - return function () { - var t = new f({ index: e, font: r }); - return ( - (t.path = function () { - o(t, n, s); - var e = i(r.glyphs, t); - return (e.unitsPerEm = r.unitsPerEm), e; - }), - Pe(t, "xMin", "_xMin"), - Pe(t, "xMax", "_xMax"), - Pe(t, "yMin", "_yMin"), - Pe(t, "yMax", "_yMax"), - t - ); - }; - }, - cffGlyphLoader: function (r, e, o, n) { - return function () { - var t = new f({ index: e, font: r }); - return ( - (t.path = function () { - var e = o(r, t, n); - return (e.unitsPerEm = r.unitsPerEm), e; - }), - t - ); - }; - }, - }; - function Le(e) { - e = e.length < 1240 ? 107 : e.length < 33900 ? 1131 : 32768; - return e; - } - function y(e, t, r) { - var o, - n = [], - s = [], - i = R.getCard16(e, t); - if (0 !== i) { - for ( - var a = R.getByte(e, t + 2), - l = t + (i + 1) * a + 2, - u = t + 3, - c = 0; - c < i + 1; - c += 1 - ) - n.push(R.getOffset(e, u, a)), (u += a); - o = l + n[i]; - } else o = t + 2; - for (var d = 0; d < n.length - 1; d += 1) { - var h = R.getBytes(e, l + n[d], l + n[d + 1]); - r && (h = r(h)), s.push(h); - } - return { objects: s, startOffset: t, endOffset: o }; - } - function Re(e, t) { - if (28 === t) return (e.parseByte() << 8) | e.parseByte(); - if (29 === t) - return ( - (e.parseByte() << 24) | - (e.parseByte() << 16) | - (e.parseByte() << 8) | - e.parseByte() - ); - if (30 === t) { - for ( - var r = e, - o = "", - n = [ - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - ".", - "E", - "E-", - null, - "-", - ]; - ; - - ) { - var s = r.parseByte(), - i = s >> 4, - s = 15 & s; - if (15 == i) break; - if (((o += n[i]), 15 == s)) break; - o += n[s]; - } - return parseFloat(o); - } - 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 Ie(e, t, r) { - var o = new R.Parser(e, (t = void 0 !== t ? t : 0)), - n = [], - s = []; - for ( - r = void 0 !== r ? r : e.length; - o.relativeOffset < r; - - ) { - var i = o.parseByte(); - i <= 21 - ? (12 === i && (i = 1200 + o.parseByte()), - n.push([i, s]), - (s = [])) - : s.push(Re(o, i)); - } - for (var a = n, l = {}, u = 0; u < a.length; u += 1) { - var c = a[u][0], - d = a[u][1], - h = void 0, - h = 1 === d.length ? d[0] : d; - if (l.hasOwnProperty(c) && !isNaN(l[c])) - throw new Error("Object " + l + " already has key " + c); - l[c] = h; - } - return l; - } - function De(e, t) { - return (t = t <= 390 ? Se[t] : e[t - 391]); - } - function Fe(e, t, r) { - for (var o, n = {}, s = 0; s < t.length; s += 1) { - var i = t[s]; - if (Array.isArray(i.type)) { - var a = []; - a.length = i.type.length; - for (var l = 0; l < i.type.length; l++) - void 0 === - (o = void 0 !== e[i.op] ? e[i.op][l] : void 0) && - (o = - void 0 !== i.value && void 0 !== i.value[l] - ? i.value[l] - : null), - "SID" === i.type[l] && (o = De(r, o)), - (a[l] = o); - n[i.name] = a; - } else - void 0 === (o = e[i.op]) && - (o = void 0 !== i.value ? i.value : null), - "SID" === i.type && (o = De(r, o)), - (n[i.name] = o); - } - return n; - } - var Ue = [ - { name: "version", op: 0, type: "SID" }, - { name: "notice", op: 1, type: "SID" }, - { name: "copyright", op: 1200, type: "SID" }, - { name: "fullName", op: 2, type: "SID" }, - { name: "familyName", op: 3, type: "SID" }, - { name: "weight", op: 4, type: "SID" }, - { - name: "isFixedPitch", - op: 1201, - type: "number", - value: 0, - }, - { name: "italicAngle", op: 1202, type: "number", value: 0 }, - { - name: "underlinePosition", - op: 1203, - type: "number", - value: -100, - }, - { - name: "underlineThickness", - op: 1204, - type: "number", - value: 50, - }, - { name: "paintType", op: 1205, type: "number", value: 0 }, - { - name: "charstringType", - op: 1206, - type: "number", - value: 2, - }, - { - name: "fontMatrix", - op: 1207, - type: ["real", "real", "real", "real", "real", "real"], - value: [0.001, 0, 0, 0.001, 0, 0], - }, - { name: "uniqueId", op: 13, type: "number" }, - { - name: "fontBBox", - op: 5, - type: ["number", "number", "number", "number"], - value: [0, 0, 0, 0], - }, - { name: "strokeWidth", op: 1208, type: "number", value: 0 }, - { name: "xuid", op: 14, type: [], value: null }, - { name: "charset", op: 15, type: "offset", value: 0 }, - { name: "encoding", op: 16, type: "offset", value: 0 }, - { name: "charStrings", op: 17, type: "offset", value: 0 }, - { - name: "private", - op: 18, - type: ["number", "offset"], - value: [0, 0], - }, - { name: "ros", op: 1230, type: ["SID", "SID", "number"] }, - { - name: "cidFontVersion", - op: 1231, - type: "number", - value: 0, - }, - { - name: "cidFontRevision", - op: 1232, - type: "number", - value: 0, - }, - { name: "cidFontType", op: 1233, type: "number", value: 0 }, - { name: "cidCount", op: 1234, type: "number", value: 8720 }, - { name: "uidBase", op: 1235, type: "number" }, - { name: "fdArray", op: 1236, type: "offset" }, - { name: "fdSelect", op: 1237, type: "offset" }, - { name: "fontName", op: 1238, type: "SID" }, - ], - Ne = [ - { name: "subrs", op: 19, type: "offset", value: 0 }, - { name: "defaultWidthX", op: 20, type: "number", value: 0 }, - { name: "nominalWidthX", op: 21, type: "number", value: 0 }, - ]; - function Be(e, t, r, o) { - return Fe(Ie(e, t, r), Ne, o); - } - function Ge(e, t, r, o) { - for (var n = [], s = 0; s < r.length; s += 1) { - var i = new DataView(new Uint8Array(r[s]).buffer), - i = ((a = o), Fe(Ie(i, 0, i.byteLength), Ue, a)), - a = ((i._subrs = []), (i._subrsBias = 0), i.private[0]), - l = i.private[1]; - 0 !== a && - 0 !== l && - ((a = Be(e, l + t, a, o)), - (i._defaultWidthX = a.defaultWidthX), - (i._nominalWidthX = a.nominalWidthX), - 0 !== a.subrs && - ((l = y(e, l + a.subrs + t)), - (i._subrs = l.objects), - (i._subrsBias = Le(i._subrs))), - (i._privateDict = a)), - n.push(i); - } - return n; - } - function Ve(y, g, e) { - var v, - b, - j, - _, - t, - x, - w, - r, - S, - T = new h(), - M = [], - E = 0, - k = !1, - C = !1, - O = 0, - P = 0, - A = - ((S = ( - y.isCIDFont - ? ((t = y.tables.cff.topDict._fdSelect[g.index]), - (t = y.tables.cff.topDict._fdArray[t]), - (x = t._subrs), - (w = t._subrsBias), - (r = t._defaultWidthX), - t) - : ((x = y.tables.cff.topDict._subrs), - (w = y.tables.cff.topDict._subrsBias), - (r = y.tables.cff.topDict._defaultWidthX), - y.tables.cff.topDict) - )._nominalWidthX), - r); - function L(e, t) { - C && T.closePath(), T.moveTo(e, t), (C = !0); - } - function R() { - M.length % 2 == 0 || k || (A = M.shift() + S), - (E += M.length >> 1), - (M.length = 0), - (k = !0); - } - return ( - (function e(t) { - for ( - var r, o, n, s, i, a, l, u, c, d, h, f, p = 0; - p < t.length; - - ) { - var m = t[p]; - switch (((p += 1), m)) { - case 1: - case 3: - R(); - break; - case 4: - 1 < M.length && - !k && - ((A = M.shift() + S), (k = !0)), - (P += M.pop()), - L(O, P); - break; - case 5: - for (; 0 < M.length; ) - (O += M.shift()), - (P += M.shift()), - T.lineTo(O, P); - break; - case 6: - for ( - ; - 0 < M.length && - ((O += M.shift()), - T.lineTo(O, P), - 0 !== M.length); - - ) - (P += M.shift()), T.lineTo(O, P); - break; - case 7: - for ( - ; - 0 < M.length && - ((P += M.shift()), - T.lineTo(O, P), - 0 !== M.length); - - ) - (O += M.shift()), T.lineTo(O, P); - break; - case 8: - for (; 0 < M.length; ) - (v = O + M.shift()), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j + M.shift()), - (P = _ + M.shift()), - T.curveTo(v, b, j, _, O, P); - break; - case 10: - (i = M.pop() + w), (a = x[i]) && e(a); - break; - case 11: - return; - case 12: - switch (((m = t[p]), (p += 1), m)) { - case 35: - (v = O + M.shift()), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (l = j + M.shift()), - (u = _ + M.shift()), - (c = l + M.shift()), - (d = u + M.shift()), - (h = c + M.shift()), - (f = d + M.shift()), - (O = h + M.shift()), - (P = f + M.shift()), - M.shift(), - T.curveTo(v, b, j, _, l, u), - T.curveTo(c, d, h, f, O, P); - break; - case 34: - (v = O + M.shift()), - (b = P), - (j = v + M.shift()), - (_ = b + M.shift()), - (l = j + M.shift()), - (u = _), - (c = l + M.shift()), - (d = _), - (h = c + M.shift()), - (f = P), - (O = h + M.shift()), - T.curveTo(v, b, j, _, l, u), - T.curveTo(c, d, h, f, O, P); - break; - case 36: - (v = O + M.shift()), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (l = j + M.shift()), - (u = _), - (c = l + M.shift()), - (d = _), - (h = c + M.shift()), - (f = d + M.shift()), - (O = h + M.shift()), - T.curveTo(v, b, j, _, l, u), - T.curveTo(c, d, h, f, O, P); - break; - case 37: - (v = O + M.shift()), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (l = j + M.shift()), - (u = _ + M.shift()), - (c = l + M.shift()), - (d = u + M.shift()), - (h = c + M.shift()), - (f = d + M.shift()), - Math.abs(h - O) > Math.abs(f - P) - ? (O = h + M.shift()) - : (P = f + M.shift()), - T.curveTo(v, b, j, _, l, u), - T.curveTo(c, d, h, f, O, P); - break; - default: - console.log( - "Glyph " + - g.index + - ": unknown operator 1200" + - m, - ), - (M.length = 0); - } - break; - case 14: - 0 < M.length && - !k && - ((A = M.shift() + S), (k = !0)), - C && (T.closePath(), (C = !1)); - break; - case 18: - R(); - break; - case 19: - case 20: - R(), (p += (E + 7) >> 3); - break; - case 21: - 2 < M.length && - !k && - ((A = M.shift() + S), (k = !0)), - (P += M.pop()), - L((O += M.pop()), P); - break; - case 22: - 1 < M.length && - !k && - ((A = M.shift() + S), (k = !0)), - L((O += M.pop()), P); - break; - case 23: - R(); - break; - case 24: - for (; 2 < M.length; ) - (v = O + M.shift()), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j + M.shift()), - (P = _ + M.shift()), - T.curveTo(v, b, j, _, O, P); - (O += M.shift()), (P += M.shift()), T.lineTo(O, P); - break; - case 25: - for (; 6 < M.length; ) - (O += M.shift()), - (P += M.shift()), - T.lineTo(O, P); - (v = O + M.shift()), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j + M.shift()), - (P = _ + M.shift()), - T.curveTo(v, b, j, _, O, P); - break; - case 26: - for ( - M.length % 2 && (O += M.shift()); - 0 < M.length; - - ) - (v = O), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j), - (P = _ + M.shift()), - T.curveTo(v, b, j, _, O, P); - break; - case 27: - for ( - M.length % 2 && (P += M.shift()); - 0 < M.length; - - ) - (v = O + M.shift()), - (b = P), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j + M.shift()), - (P = _), - T.curveTo(v, b, j, _, O, P); - break; - case 28: - (r = t[p]), - (o = t[p + 1]), - M.push(((r << 24) | (o << 16)) >> 16), - (p += 2); - break; - case 29: - (i = M.pop() + y.gsubrsBias), - (a = y.gsubrs[i]) && e(a); - break; - case 30: - for ( - ; - 0 < M.length && - ((v = O), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j + M.shift()), - (P = _ + (1 === M.length ? M.shift() : 0)), - T.curveTo(v, b, j, _, O, P), - 0 !== M.length); - - ) - (v = O + M.shift()), - (b = P), - (j = v + M.shift()), - (_ = b + M.shift()), - (P = _ + M.shift()), - (O = j + (1 === M.length ? M.shift() : 0)), - T.curveTo(v, b, j, _, O, P); - break; - case 31: - for ( - ; - 0 < M.length && - ((v = O + M.shift()), - (b = P), - (j = v + M.shift()), - (_ = b + M.shift()), - (P = _ + M.shift()), - (O = j + (1 === M.length ? M.shift() : 0)), - T.curveTo(v, b, j, _, O, P), - 0 !== M.length); - - ) - (v = O), - (b = P + M.shift()), - (j = v + M.shift()), - (_ = b + M.shift()), - (O = j + M.shift()), - (P = _ + (1 === M.length ? M.shift() : 0)), - T.curveTo(v, b, j, _, O, P); - break; - default: - m < 32 - ? console.log( - "Glyph " + - g.index + - ": unknown operator " + - m, - ) - : m < 247 - ? M.push(m - 139) - : m < 251 - ? ((r = t[p]), - (p += 1), - M.push(256 * (m - 247) + r + 108)) - : m < 255 - ? ((r = t[p]), - (p += 1), - M.push(256 * -(m - 251) - r - 108)) - : ((r = t[p]), - (o = t[p + 1]), - (n = t[p + 2]), - (s = t[p + 3]), - (p += 4), - M.push( - ((r << 24) | (o << 16) | (n << 8) | s) / - 65536, - )); - } - } - })(e), - (g.advanceWidth = A), - T - ); - } - function ze(e, t) { - var r, - o = Se.indexOf(e); - return ( - 0 <= o && (r = o), - 0 <= (o = t.indexOf(e)) - ? (r = o + Se.length) - : ((r = Se.length + t.length), t.push(e)), - r - ); - } - function He(e, t, r) { - for (var o = {}, n = 0; n < e.length; n += 1) { - var s = e[n], - i = t[s.name]; - void 0 === i || - (function e(t, r) { - if (t === r) return 1; - if ( - Array.isArray(t) && - Array.isArray(r) && - t.length === r.length - ) { - for (var o = 0; o < t.length; o += 1) - if (!e(t[o], r[o])) return; - return 1; - } - })(i, s.value) || - ("SID" === s.type && (i = ze(i, r)), - (o[s.op] = { name: s.name, type: s.type, value: i })); - } - return o; - } - function We(e, t) { - var r = new S.Record("Top DICT", [ - { name: "dict", type: "DICT", value: {} }, - ]); - return (r.dict = He(Ue, e, t)), r; - } - function qe(e) { - var t = new S.Record("Top DICT INDEX", [ - { name: "topDicts", type: "INDEX", value: [] }, - ]); - return ( - (t.topDicts = [ - { name: "topDict_0", type: "TABLE", value: e }, - ]), - t - ); - } - function Xe(e) { - for ( - var t = new S.Record("CharStrings INDEX", [ - { name: "charStrings", type: "INDEX", value: [] }, - ]), - r = 0; - r < e.length; - r += 1 - ) { - var o = e.get(r), - n = (function (e) { - for ( - var t = [], - r = e.path, - o = - (t.push({ - name: "width", - type: "NUMBER", - value: e.advanceWidth, - }), - 0), - n = 0, - s = 0; - s < r.commands.length; - s += 1 - ) { - var i, - a, - l, - u, - c = void 0, - d = void 0, - h = r.commands[s]; - "M" === - (h = - "Q" === h.type - ? { - type: "C", - x: h.x, - y: h.y, - x1: (1 / 3) * o + (2 / 3) * h.x1, - y1: (1 / 3) * n + (2 / 3) * h.y1, - x2: (1 / 3) * h.x + (2 / 3) * h.x1, - y2: (1 / 3) * h.y + (2 / 3) * h.y1, - } - : h).type - ? ((c = Math.round(h.x - o)), - (d = Math.round(h.y - n)), - t.push({ name: "dx", type: "NUMBER", value: c }), - t.push({ name: "dy", type: "NUMBER", value: d }), - t.push({ - name: "rmoveto", - type: "OP", - value: 21, - }), - (o = Math.round(h.x)), - (n = Math.round(h.y))) - : "L" === h.type - ? ((c = Math.round(h.x - o)), - (d = Math.round(h.y - n)), - t.push({ - name: "dx", - type: "NUMBER", - value: c, - }), - t.push({ - name: "dy", - type: "NUMBER", - value: d, - }), - t.push({ - name: "rlineto", - type: "OP", - value: 5, - }), - (o = Math.round(h.x)), - (n = Math.round(h.y))) - : "C" === h.type && - ((i = Math.round(h.x1 - o)), - (a = Math.round(h.y1 - n)), - (l = Math.round(h.x2 - h.x1)), - (u = Math.round(h.y2 - h.y1)), - (c = Math.round(h.x - h.x2)), - (d = Math.round(h.y - h.y2)), - t.push({ - name: "dx1", - type: "NUMBER", - value: i, - }), - t.push({ - name: "dy1", - type: "NUMBER", - value: a, - }), - t.push({ - name: "dx2", - type: "NUMBER", - value: l, - }), - t.push({ - name: "dy2", - type: "NUMBER", - value: u, - }), - t.push({ - name: "dx", - type: "NUMBER", - value: c, - }), - t.push({ - name: "dy", - type: "NUMBER", - value: d, - }), - t.push({ - name: "rrcurveto", - type: "OP", - value: 8, - }), - (o = Math.round(h.x)), - (n = Math.round(h.y))); - } - return ( - t.push({ name: "endchar", type: "OP", value: 14 }), t - ); - })(o); - t.charStrings.push({ - name: o.name, - type: "CHARSTRING", - value: n, - }); - } - return t; - } - var Ye = { - parse: function (e, t, r) { - (r.tables.cff = {}), - (o = e), - (n = t), - ((s = {}).formatMajor = R.getCard8(o, n)), - (s.formatMinor = R.getCard8(o, n + 1)), - (s.size = R.getCard8(o, n + 2)), - (s.offsetSize = R.getCard8(o, n + 3)), - (s.startOffset = n), - (s.endOffset = n + 4); - var o = y(e, s.endOffset, R.bytesToString), - n = y(e, o.endOffset), - s = y(e, n.endOffset, R.bytesToString), - o = y(e, s.endOffset); - if ( - ((r.gsubrs = o.objects), - (r.gsubrsBias = Le(r.gsubrs)), - 1 !== (o = Ge(e, t, n.objects, s.objects)).length) - ) - throw new Error( - "CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + - o.length, - ); - if ( - ((n = o[0]), - (r.tables.cff.topDict = n)._privateDict && - ((r.defaultWidthX = n._privateDict.defaultWidthX), - (r.nominalWidthX = n._privateDict.nominalWidthX)), - void 0 !== n.ros[0] && - void 0 !== n.ros[1] && - (r.isCIDFont = !0), - r.isCIDFont) - ) { - var o = n.fdArray, - i = n.fdSelect; - if (0 === o || 0 === i) - throw new Error( - "Font is marked as a CID font, but FDArray and/or FDSelect information is missing", - ); - o = Ge(e, t, y(e, (o += t)).objects, s.objects); - (n._fdArray = o), - (n._fdSelect = (function (e, t, r, o) { - var n, - s = [], - i = new R.Parser(e, t); - if (0 === (e = i.parseCard8())) - for (var a = 0; a < r; a++) { - if (o <= (n = i.parseCard8())) - throw new Error( - "CFF table CID Font FDSelect has bad FD index value " + - n + - " (FD count " + - o + - ")", - ); - s.push(n); - } - else { - if (3 !== e) - throw new Error( - "CFF Table CID Font FDSelect table has unsupported format " + - e, - ); - var l, - u = i.parseCard16(), - c = i.parseCard16(); - if (0 !== c) - throw new Error( - "CFF Table CID Font FDSelect format 3 range has bad initial GID " + - c, - ); - for (var d = 0; d < u; d++) { - if ( - ((n = i.parseCard8()), - (l = i.parseCard16()), - o <= n) - ) - throw new Error( - "CFF table CID Font FDSelect has bad FD index value " + - n + - " (FD count " + - o + - ")", - ); - if (r < l) - throw new Error( - "CFF Table CID Font FDSelect format 3 range has bad GID " + - l, - ); - for (; c < l; c++) s.push(n); - c = l; - } - if (l !== r) - throw new Error( - "CFF Table CID Font FDSelect format 3 range has bad final GID " + - l, - ); - } - return s; - })(e, (i += t), r.numGlyphs, o.length)); - } - var i = t + n.private[1], - o = Be(e, i, n.private[0], s.objects), - a = - ((r.defaultWidthX = o.defaultWidthX), - (r.nominalWidthX = o.nominalWidthX), - 0 !== o.subrs - ? ((i = y(e, i + o.subrs)), - (r.subrs = i.objects), - (r.subrsBias = Le(r.subrs))) - : ((r.subrs = []), (r.subrsBias = 0)), - y(e, t + n.charStrings)), - o = - ((r.nGlyphs = a.objects.length), - (function (e, t, r, o) { - var n = new R.Parser(e, t), - s = (--r, [".notdef"]); - if (0 === (e = n.parseCard8())) - for (var i = 0; i < r; i += 1) - (a = n.parseSID()), s.push(De(o, a)); - else if (1 === e) - for (; s.length <= r; ) - for ( - var a = n.parseSID(), l = n.parseCard8(), u = 0; - u <= l; - u += 1 - ) - s.push(De(o, a)), (a += 1); - else { - if (2 !== e) - throw new Error("Unknown charset format " + e); - for (; s.length <= r; ) { - (a = n.parseSID()), (l = n.parseCard16()); - for (var c = 0; c <= l; c += 1) - s.push(De(o, a)), (a += 1); - } - } - return s; - })(e, t + n.charset, r.nGlyphs, s.objects)); - 0 === n.encoding - ? (r.cffEncoding = new Ce(Te, o)) - : 1 === n.encoding - ? (r.cffEncoding = new Ce(Me, o)) - : (r.cffEncoding = (function (e, t, r) { - var o = {}, - n = new R.Parser(e, t); - if (0 === (e = n.parseCard8())) - for (var s = n.parseCard8(), i = 0; i < s; i += 1) - o[(l = n.parseCard8())] = i; - else { - if (1 !== e) - throw new Error("Unknown encoding format " + e); - for ( - var a = n.parseCard8(), l = 1, u = 0; - u < a; - u += 1 - ) - for ( - var c = n.parseCard8(), - d = n.parseCard8(), - h = c; - h <= c + d; - h += 1 - ) - (o[h] = l), (l += 1); - } - return new Ce(o, r); - })(e, t + n.encoding, o)), - (r.encoding = r.encoding || r.cffEncoding), - (r.glyphs = new p.GlyphSet(r)); - for (var l = 0; l < r.nGlyphs; l += 1) { - var u = a.objects[l]; - r.glyphs.push(l, p.cffGlyphLoader(r, l, Ve, u)); - } - }, - make: function (e, t) { - for ( - var r, - o = new S.Table("CFF ", [ - { name: "header", type: "RECORD" }, - { name: "nameIndex", type: "RECORD" }, - { name: "topDictIndex", type: "RECORD" }, - { name: "stringIndex", type: "RECORD" }, - { name: "globalSubrIndex", type: "RECORD" }, - { name: "charsets", type: "RECORD" }, - { name: "charStringsIndex", type: "RECORD" }, - { name: "privateDict", type: "RECORD" }, - ]), - n = 1 / t.unitsPerEm, - n = { - version: t.version, - fullName: t.fullName, - familyName: t.familyName, - weight: t.weightName, - fontBBox: t.fontBBox || [0, 0, 0, 0], - fontMatrix: [n, 0, 0, n, 0, 0], - charset: 999, - encoding: 0, - charStrings: 999, - private: [0, 999], - }, - s = [], - i = 1; - i < e.length; - i += 1 - ) - (r = e.get(i)), s.push(r.name); - var a, - l, - u = [], - t = - ((o.header = new S.Record("Header", [ - { name: "major", type: "Card8", value: 1 }, - { name: "minor", type: "Card8", value: 0 }, - { name: "hdrSize", type: "Card8", value: 4 }, - { name: "major", type: "Card8", value: 1 }, - ])), - (o.nameIndex = (function (e) { - var t = new S.Record("Name INDEX", [ - { name: "names", type: "INDEX", value: [] }, - ]); - t.names = []; - for (var r = 0; r < e.length; r += 1) - t.names.push({ - name: "name_" + r, - type: "NAME", - value: e[r], - }); - return t; - })([t.postScriptName])), - We(n, u)), - c = - ((o.topDictIndex = qe(t)), - (o.globalSubrIndex = new S.Record("Global Subr INDEX", [ - { name: "subrs", type: "INDEX", value: [] }, - ])), - (o.charsets = (function (e, t) { - for ( - var r = new S.Record("Charsets", [ - { name: "format", type: "Card8", value: 0 }, - ]), - o = 0; - o < e.length; - o += 1 - ) { - var n = ze(e[o], t); - r.fields.push({ - name: "glyph_" + o, - type: "SID", - value: n, - }); - } - return r; - })(s, u)), - (o.charStringsIndex = Xe(e)), - (o.privateDict = - ((c = {}), - (a = u), - ((l = new S.Record("Private DICT", [ - { name: "dict", type: "DICT", value: {} }, - ])).dict = He(Ne, c, a)), - l)), - (o.stringIndex = (function (e) { - var t = new S.Record("String INDEX", [ - { name: "strings", type: "INDEX", value: [] }, - ]); - t.strings = []; - for (var r = 0; r < e.length; r += 1) - t.strings.push({ - name: "string_" + r, - type: "STRING", - value: e[r], - }); - return t; - })(u)), - o.header.sizeOf() + - o.nameIndex.sizeOf() + - o.topDictIndex.sizeOf() + - o.stringIndex.sizeOf() + - o.globalSubrIndex.sizeOf()); - return ( - (n.charset = c), - (n.encoding = 0), - (n.charStrings = n.charset + o.charsets.sizeOf()), - (n.private[1] = - n.charStrings + o.charStringsIndex.sizeOf()), - (t = We(n, u)), - (o.topDictIndex = qe(t)), - o - ); - }, - }; - var Ze = { - parse: function (e, t) { - var r = {}, - e = new R.Parser(e, t); - return ( - (r.version = e.parseVersion()), - (r.fontRevision = Math.round(1e3 * e.parseFixed()) / 1e3), - (r.checkSumAdjustment = e.parseULong()), - (r.magicNumber = e.parseULong()), - L.argument( - 1594834165 === r.magicNumber, - "Font header has wrong magic number.", - ), - (r.flags = e.parseUShort()), - (r.unitsPerEm = e.parseUShort()), - (r.created = e.parseLongDateTime()), - (r.modified = e.parseLongDateTime()), - (r.xMin = e.parseShort()), - (r.yMin = e.parseShort()), - (r.xMax = e.parseShort()), - (r.yMax = e.parseShort()), - (r.macStyle = e.parseUShort()), - (r.lowestRecPPEM = e.parseUShort()), - (r.fontDirectionHint = e.parseShort()), - (r.indexToLocFormat = e.parseShort()), - (r.glyphDataFormat = e.parseShort()), - r - ); - }, - make: function (e) { - var t = Math.round(new Date().getTime() / 1e3) + 2082844800, - r = t; - return ( - e.createdTimestamp && - (r = e.createdTimestamp + 2082844800), - new S.Table( - "head", - [ - { name: "version", type: "FIXED", value: 65536 }, - { name: "fontRevision", type: "FIXED", value: 65536 }, - { - name: "checkSumAdjustment", - type: "ULONG", - value: 0, - }, - { - name: "magicNumber", - type: "ULONG", - value: 1594834165, - }, - { name: "flags", type: "USHORT", value: 0 }, - { name: "unitsPerEm", type: "USHORT", value: 1e3 }, - { name: "created", type: "LONGDATETIME", value: r }, - { name: "modified", type: "LONGDATETIME", value: t }, - { name: "xMin", type: "SHORT", value: 0 }, - { name: "yMin", type: "SHORT", value: 0 }, - { name: "xMax", type: "SHORT", value: 0 }, - { name: "yMax", type: "SHORT", value: 0 }, - { name: "macStyle", type: "USHORT", value: 0 }, - { name: "lowestRecPPEM", type: "USHORT", value: 0 }, - { - name: "fontDirectionHint", - type: "SHORT", - value: 2, - }, - { name: "indexToLocFormat", type: "SHORT", value: 0 }, - { name: "glyphDataFormat", type: "SHORT", value: 0 }, - ], - e, - ) - ); - }, - }; - var Qe = { - parse: function (e, t) { - var r = {}, - e = new R.Parser(e, t); - return ( - (r.version = e.parseVersion()), - (r.ascender = e.parseShort()), - (r.descender = e.parseShort()), - (r.lineGap = e.parseShort()), - (r.advanceWidthMax = e.parseUShort()), - (r.minLeftSideBearing = e.parseShort()), - (r.minRightSideBearing = e.parseShort()), - (r.xMaxExtent = e.parseShort()), - (r.caretSlopeRise = e.parseShort()), - (r.caretSlopeRun = e.parseShort()), - (r.caretOffset = e.parseShort()), - (e.relativeOffset += 8), - (r.metricDataFormat = e.parseShort()), - (r.numberOfHMetrics = e.parseUShort()), - r - ); - }, - make: function (e) { - return new S.Table( - "hhea", - [ - { name: "version", type: "FIXED", value: 65536 }, - { name: "ascender", type: "FWORD", value: 0 }, - { name: "descender", type: "FWORD", value: 0 }, - { name: "lineGap", type: "FWORD", value: 0 }, - { name: "advanceWidthMax", type: "UFWORD", value: 0 }, - { name: "minLeftSideBearing", type: "FWORD", value: 0 }, - { - name: "minRightSideBearing", - type: "FWORD", - value: 0, - }, - { name: "xMaxExtent", type: "FWORD", value: 0 }, - { name: "caretSlopeRise", type: "SHORT", value: 1 }, - { name: "caretSlopeRun", type: "SHORT", value: 0 }, - { name: "caretOffset", type: "SHORT", value: 0 }, - { name: "reserved1", type: "SHORT", value: 0 }, - { name: "reserved2", type: "SHORT", value: 0 }, - { name: "reserved3", type: "SHORT", value: 0 }, - { name: "reserved4", type: "SHORT", value: 0 }, - { name: "metricDataFormat", type: "SHORT", value: 0 }, - { name: "numberOfHMetrics", type: "USHORT", value: 0 }, - ], - e, - ); - }, - }; - var Je = { - parse: function (e, t, r, o, n) { - for ( - var s, i, a = new R.Parser(e, t), l = 0; - l < o; - l += 1 - ) { - l < r && ((s = a.parseUShort()), (i = a.parseShort())); - var u = n.get(l); - (u.advanceWidth = s), (u.leftSideBearing = i); - } - }, - make: function (e) { - for ( - var t = new S.Table("hmtx", []), r = 0; - r < e.length; - r += 1 - ) { - var o = e.get(r), - n = o.advanceWidth || 0, - o = o.leftSideBearing || 0; - t.fields.push({ - name: "advanceWidth_" + r, - type: "USHORT", - value: n, - }), - t.fields.push({ - name: "leftSideBearing_" + r, - type: "SHORT", - value: o, - }); - } - return t; - }, - }; - var Ke = { - make: function (e) { - for ( - var t = new S.Table("ltag", [ - { name: "version", type: "ULONG", value: 1 }, - { name: "flags", type: "ULONG", value: 0 }, - { name: "numTags", type: "ULONG", value: e.length }, - ]), - r = "", - o = 12 + 4 * e.length, - n = 0; - n < e.length; - ++n - ) { - var s = r.indexOf(e[n]); - s < 0 && ((s = r.length), (r += e[n])), - t.fields.push({ - name: "offset " + n, - type: "USHORT", - value: o + s, - }), - t.fields.push({ - name: "length " + n, - type: "USHORT", - value: e[n].length, - }); - } - return ( - t.fields.push({ - name: "stringPool", - type: "CHARARRAY", - value: r, - }), - t - ); - }, - parse: function (e, t) { - for ( - var r = new R.Parser(e, t), - o = r.parseULong(), - n = - (L.argument( - 1 === o, - "Unsupported ltag table version.", - ), - r.skip("uLong", 1), - r.parseULong()), - s = [], - i = 0; - i < n; - i++ - ) { - for ( - var a = "", - l = t + r.parseUShort(), - u = r.parseUShort(), - c = l; - c < l + u; - ++c - ) - a += String.fromCharCode(e.getInt8(c)); - s.push(a); - } - return s; - }, - }; - var $e = { - parse: function (e, t) { - var r = {}, - e = new R.Parser(e, t); - return ( - (r.version = e.parseVersion()), - (r.numGlyphs = e.parseUShort()), - 1 === r.version && - ((r.maxPoints = e.parseUShort()), - (r.maxContours = e.parseUShort()), - (r.maxCompositePoints = e.parseUShort()), - (r.maxCompositeContours = e.parseUShort()), - (r.maxZones = e.parseUShort()), - (r.maxTwilightPoints = e.parseUShort()), - (r.maxStorage = e.parseUShort()), - (r.maxFunctionDefs = e.parseUShort()), - (r.maxInstructionDefs = e.parseUShort()), - (r.maxStackElements = e.parseUShort()), - (r.maxSizeOfInstructions = e.parseUShort()), - (r.maxComponentElements = e.parseUShort()), - (r.maxComponentDepth = e.parseUShort())), - r - ); - }, - make: function (e) { - return new S.Table("maxp", [ - { name: "version", type: "FIXED", value: 20480 }, - { name: "numGlyphs", type: "USHORT", value: e }, - ]); - }, - }, - et = [ - "copyright", - "fontFamily", - "fontSubfamily", - "uniqueID", - "fullName", - "version", - "postScriptName", - "trademark", - "manufacturer", - "designer", - "description", - "manufacturerURL", - "designerURL", - "license", - "licenseURL", - "reserved", - "preferredFamily", - "preferredSubfamily", - "compatibleFullName", - "sampleText", - "postScriptFindFontName", - "wwsFamily", - "wwsSubfamily", - ], - tt = { - 0: "en", - 1: "fr", - 2: "de", - 3: "it", - 4: "nl", - 5: "sv", - 6: "es", - 7: "da", - 8: "pt", - 9: "no", - 10: "he", - 11: "ja", - 12: "ar", - 13: "fi", - 14: "el", - 15: "is", - 16: "mt", - 17: "tr", - 18: "hr", - 19: "zh-Hant", - 20: "ur", - 21: "hi", - 22: "th", - 23: "ko", - 24: "lt", - 25: "pl", - 26: "hu", - 27: "es", - 28: "lv", - 29: "se", - 30: "fo", - 31: "fa", - 32: "ru", - 33: "zh", - 34: "nl-BE", - 35: "ga", - 36: "sq", - 37: "ro", - 38: "cz", - 39: "sk", - 40: "si", - 41: "yi", - 42: "sr", - 43: "mk", - 44: "bg", - 45: "uk", - 46: "be", - 47: "uz", - 48: "kk", - 49: "az-Cyrl", - 50: "az-Arab", - 51: "hy", - 52: "ka", - 53: "mo", - 54: "ky", - 55: "tg", - 56: "tk", - 57: "mn-CN", - 58: "mn", - 59: "ps", - 60: "ks", - 61: "ku", - 62: "sd", - 63: "bo", - 64: "ne", - 65: "sa", - 66: "mr", - 67: "bn", - 68: "as", - 69: "gu", - 70: "pa", - 71: "or", - 72: "ml", - 73: "kn", - 74: "ta", - 75: "te", - 76: "si", - 77: "my", - 78: "km", - 79: "lo", - 80: "vi", - 81: "id", - 82: "tl", - 83: "ms", - 84: "ms-Arab", - 85: "am", - 86: "ti", - 87: "om", - 88: "so", - 89: "sw", - 90: "rw", - 91: "rn", - 92: "ny", - 93: "mg", - 94: "eo", - 128: "cy", - 129: "eu", - 130: "ca", - 131: "la", - 132: "qu", - 133: "gn", - 134: "ay", - 135: "tt", - 136: "ug", - 137: "dz", - 138: "jv", - 139: "su", - 140: "gl", - 141: "af", - 142: "br", - 143: "iu", - 144: "gd", - 145: "gv", - 146: "ga", - 147: "to", - 148: "el-polyton", - 149: "kl", - 150: "az", - 151: "nn", - }, - rt = { - 0: 0, - 1: 0, - 2: 0, - 3: 0, - 4: 0, - 5: 0, - 6: 0, - 7: 0, - 8: 0, - 9: 0, - 10: 5, - 11: 1, - 12: 4, - 13: 0, - 14: 6, - 15: 0, - 16: 0, - 17: 0, - 18: 0, - 19: 2, - 20: 4, - 21: 9, - 22: 21, - 23: 3, - 24: 29, - 25: 29, - 26: 29, - 27: 29, - 28: 29, - 29: 0, - 30: 0, - 31: 4, - 32: 7, - 33: 25, - 34: 0, - 35: 0, - 36: 0, - 37: 0, - 38: 29, - 39: 29, - 40: 0, - 41: 5, - 42: 7, - 43: 7, - 44: 7, - 45: 7, - 46: 7, - 47: 7, - 48: 7, - 49: 7, - 50: 4, - 51: 24, - 52: 23, - 53: 7, - 54: 7, - 55: 7, - 56: 7, - 57: 27, - 58: 7, - 59: 4, - 60: 4, - 61: 4, - 62: 4, - 63: 26, - 64: 9, - 65: 9, - 66: 9, - 67: 13, - 68: 13, - 69: 11, - 70: 10, - 71: 12, - 72: 17, - 73: 16, - 74: 14, - 75: 15, - 76: 18, - 77: 19, - 78: 20, - 79: 22, - 80: 30, - 81: 0, - 82: 0, - 83: 0, - 84: 4, - 85: 28, - 86: 28, - 87: 28, - 88: 0, - 89: 0, - 90: 0, - 91: 0, - 92: 0, - 93: 0, - 94: 0, - 128: 0, - 129: 0, - 130: 0, - 131: 0, - 132: 0, - 133: 0, - 134: 0, - 135: 7, - 136: 4, - 137: 26, - 138: 0, - 139: 0, - 140: 0, - 141: 0, - 142: 0, - 143: 28, - 144: 0, - 145: 0, - 146: 0, - 147: 0, - 148: 6, - 149: 0, - 150: 0, - 151: 0, - }, - ot = { - 1078: "af", - 1052: "sq", - 1156: "gsw", - 1118: "am", - 5121: "ar-DZ", - 15361: "ar-BH", - 3073: "ar", - 2049: "ar-IQ", - 11265: "ar-JO", - 13313: "ar-KW", - 12289: "ar-LB", - 4097: "ar-LY", - 6145: "ary", - 8193: "ar-OM", - 16385: "ar-QA", - 1025: "ar-SA", - 10241: "ar-SY", - 7169: "aeb", - 14337: "ar-AE", - 9217: "ar-YE", - 1067: "hy", - 1101: "as", - 2092: "az-Cyrl", - 1068: "az", - 1133: "ba", - 1069: "eu", - 1059: "be", - 2117: "bn", - 1093: "bn-IN", - 8218: "bs-Cyrl", - 5146: "bs", - 1150: "br", - 1026: "bg", - 1027: "ca", - 3076: "zh-HK", - 5124: "zh-MO", - 2052: "zh", - 4100: "zh-SG", - 1028: "zh-TW", - 1155: "co", - 1050: "hr", - 4122: "hr-BA", - 1029: "cs", - 1030: "da", - 1164: "prs", - 1125: "dv", - 2067: "nl-BE", - 1043: "nl", - 3081: "en-AU", - 10249: "en-BZ", - 4105: "en-CA", - 9225: "en-029", - 16393: "en-IN", - 6153: "en-IE", - 8201: "en-JM", - 17417: "en-MY", - 5129: "en-NZ", - 13321: "en-PH", - 18441: "en-SG", - 7177: "en-ZA", - 11273: "en-TT", - 2057: "en-GB", - 1033: "en", - 12297: "en-ZW", - 1061: "et", - 1080: "fo", - 1124: "fil", - 1035: "fi", - 2060: "fr-BE", - 3084: "fr-CA", - 1036: "fr", - 5132: "fr-LU", - 6156: "fr-MC", - 4108: "fr-CH", - 1122: "fy", - 1110: "gl", - 1079: "ka", - 3079: "de-AT", - 1031: "de", - 5127: "de-LI", - 4103: "de-LU", - 2055: "de-CH", - 1032: "el", - 1135: "kl", - 1095: "gu", - 1128: "ha", - 1037: "he", - 1081: "hi", - 1038: "hu", - 1039: "is", - 1136: "ig", - 1057: "id", - 1117: "iu", - 2141: "iu-Latn", - 2108: "ga", - 1076: "xh", - 1077: "zu", - 1040: "it", - 2064: "it-CH", - 1041: "ja", - 1099: "kn", - 1087: "kk", - 1107: "km", - 1158: "quc", - 1159: "rw", - 1089: "sw", - 1111: "kok", - 1042: "ko", - 1088: "ky", - 1108: "lo", - 1062: "lv", - 1063: "lt", - 2094: "dsb", - 1134: "lb", - 1071: "mk", - 2110: "ms-BN", - 1086: "ms", - 1100: "ml", - 1082: "mt", - 1153: "mi", - 1146: "arn", - 1102: "mr", - 1148: "moh", - 1104: "mn", - 2128: "mn-CN", - 1121: "ne", - 1044: "nb", - 2068: "nn", - 1154: "oc", - 1096: "or", - 1123: "ps", - 1045: "pl", - 1046: "pt", - 2070: "pt-PT", - 1094: "pa", - 1131: "qu-BO", - 2155: "qu-EC", - 3179: "qu", - 1048: "ro", - 1047: "rm", - 1049: "ru", - 9275: "smn", - 4155: "smj-NO", - 5179: "smj", - 3131: "se-FI", - 1083: "se", - 2107: "se-SE", - 8251: "sms", - 6203: "sma-NO", - 7227: "sms", - 1103: "sa", - 7194: "sr-Cyrl-BA", - 3098: "sr", - 6170: "sr-Latn-BA", - 2074: "sr-Latn", - 1132: "nso", - 1074: "tn", - 1115: "si", - 1051: "sk", - 1060: "sl", - 11274: "es-AR", - 16394: "es-BO", - 13322: "es-CL", - 9226: "es-CO", - 5130: "es-CR", - 7178: "es-DO", - 12298: "es-EC", - 17418: "es-SV", - 4106: "es-GT", - 18442: "es-HN", - 2058: "es-MX", - 19466: "es-NI", - 6154: "es-PA", - 15370: "es-PY", - 10250: "es-PE", - 20490: "es-PR", - 3082: "es", - 1034: "es", - 21514: "es-US", - 14346: "es-UY", - 8202: "es-VE", - 2077: "sv-FI", - 1053: "sv", - 1114: "syr", - 1064: "tg", - 2143: "tzm", - 1097: "ta", - 1092: "tt", - 1098: "te", - 1054: "th", - 1105: "bo", - 1055: "tr", - 1090: "tk", - 1152: "ug", - 1058: "uk", - 1070: "hsb", - 1056: "ur", - 2115: "uz-Cyrl", - 1091: "uz", - 1066: "vi", - 1106: "cy", - 1160: "wo", - 1157: "sah", - 1144: "ii", - 1130: "yo", - }; - var nt = "utf-16", - st = { - 0: "macintosh", - 1: "x-mac-japanese", - 2: "x-mac-chinesetrad", - 3: "x-mac-korean", - 6: "x-mac-greek", - 7: "x-mac-cyrillic", - 9: "x-mac-devanagai", - 10: "x-mac-gurmukhi", - 11: "x-mac-gujarati", - 12: "x-mac-oriya", - 13: "x-mac-bengali", - 14: "x-mac-tamil", - 15: "x-mac-telugu", - 16: "x-mac-kannada", - 17: "x-mac-malayalam", - 18: "x-mac-sinhalese", - 19: "x-mac-burmese", - 20: "x-mac-khmer", - 21: "x-mac-thai", - 22: "x-mac-lao", - 23: "x-mac-georgian", - 24: "x-mac-armenian", - 25: "x-mac-chinesesimp", - 26: "x-mac-tibetan", - 27: "x-mac-mongolian", - 28: "x-mac-ethiopic", - 29: "x-mac-ce", - 30: "x-mac-vietnamese", - 31: "x-mac-extarabic", - }, - it = { - 15: "x-mac-icelandic", - 17: "x-mac-turkish", - 18: "x-mac-croatian", - 24: "x-mac-ce", - 25: "x-mac-ce", - 26: "x-mac-ce", - 27: "x-mac-ce", - 28: "x-mac-ce", - 30: "x-mac-icelandic", - 37: "x-mac-romanian", - 38: "x-mac-ce", - 39: "x-mac-ce", - 40: "x-mac-ce", - 143: "x-mac-inuit", - 146: "x-mac-gaelic", - }; - function at(e, t, r) { - switch (e) { - case 0: - return nt; - case 1: - return it[r] || st[t]; - case 3: - if (1 === t || 10 === t) return nt; - } - } - function lt(e) { - var t, - r = {}; - for (t in e) r[e[t]] = parseInt(t); - return r; - } - function ut(e, t, r, o, n, s) { - return new S.Record("NameRecord", [ - { name: "platformID", type: "USHORT", value: e }, - { name: "encodingID", type: "USHORT", value: t }, - { name: "languageID", type: "USHORT", value: r }, - { name: "nameID", type: "USHORT", value: o }, - { name: "length", type: "USHORT", value: n }, - { name: "offset", type: "USHORT", value: s }, - ]); - } - function ct(e, t) { - if ( - (r = (function (e, t) { - var r = e.length, - o = t.length - r + 1; - e: for (var n = 0; n < o; n++) - for (; n < o; n++) { - for (var s = 0; s < r; s++) - if (t[n + s] !== e[s]) continue e; - return n; - } - return -1; - })(e, t)) < 0 - ) - for (var r = t.length, o = 0, n = e.length; o < n; ++o) - t.push(e[o]); - return r; - } - var dt = { - parse: function (e, t, r) { - for ( - var o = {}, - n = new R.Parser(e, t), - t = n.parseUShort(), - s = n.parseUShort(), - i = n.offset + n.parseUShort(), - a = 0; - a < s; - a++ - ) { - var l = n.parseUShort(), - u = n.parseUShort(), - c = n.parseUShort(), - d = n.parseUShort(), - d = et[d] || d, - h = n.parseUShort(), - f = n.parseUShort(), - p = (function (e, t, r) { - switch (e) { - case 0: - if (65535 === t) return "und"; - if (r) return r[t]; - break; - case 1: - return tt[t]; - case 3: - return ot[t]; - } - })(l, c, r), - l = at(l, u, c); - void 0 !== l && - void 0 !== p && - ((u = void 0), - (u = - l === nt - ? m.UTF16(e, i + f, h) - : m.MACSTRING(e, i + f, h, l)) && - ((c = void 0 === (c = o[d]) ? (o[d] = {}) : c)[p] = - u)); - } - return 1 === t && n.parseUShort(), o; - }, - make: function (e, t) { - var r, - o = [], - n = {}, - s = lt(et); - for (r in e) { - var i = s[r]; - if ( - (void 0 === i && (i = r), (h = parseInt(i)), isNaN(h)) - ) - throw new Error( - 'Name table entry "' + - r + - '" does not exist, see nameTableNames for complete list.', - ); - (n[h] = e[r]), o.push(h); - } - for ( - var a = lt(tt), l = lt(ot), u = [], c = [], d = 0; - d < o.length; - d++ - ) { - var h, - f, - p = n[(h = o[d])]; - for (f in p) { - var m = p[f], - y = 1, - g = a[f], - v = rt[g], - b = at(y, v, g), - b = w.MACSTRING(m, b), - j = - (void 0 === b && - ((y = 0), - (g = t.indexOf(f)) < 0 && - ((g = t.length), t.push(f)), - (v = 4), - (b = w.UTF16(m))), - ct(b, c)), - y = (u.push(ut(y, v, g, h, b.length, j)), l[f]); - void 0 !== y && - ((g = ct((v = w.UTF16(m)), c)), - u.push(ut(3, 1, y, h, v.length, g))); - } - } - u.sort(function (e, t) { - return ( - e.platformID - t.platformID || - e.encodingID - t.encodingID || - e.languageID - t.languageID || - e.nameID - t.nameID - ); - }); - for ( - var _ = new S.Table("name", [ - { name: "format", type: "USHORT", value: 0 }, - { name: "count", type: "USHORT", value: u.length }, - { - name: "stringOffset", - type: "USHORT", - value: 6 + 12 * u.length, - }, - ]), - x = 0; - x < u.length; - x++ - ) - _.fields.push({ - name: "record_" + x, - type: "RECORD", - value: u[x], - }); - return ( - _.fields.push({ - name: "strings", - type: "LITERAL", - value: c, - }), - _ - ); - }, - }, - ht = [ - { begin: 0, end: 127 }, - { begin: 128, end: 255 }, - { begin: 256, end: 383 }, - { begin: 384, end: 591 }, - { begin: 592, end: 687 }, - { begin: 688, end: 767 }, - { begin: 768, end: 879 }, - { begin: 880, end: 1023 }, - { begin: 11392, end: 11519 }, - { begin: 1024, end: 1279 }, - { begin: 1328, end: 1423 }, - { begin: 1424, end: 1535 }, - { begin: 42240, end: 42559 }, - { begin: 1536, end: 1791 }, - { begin: 1984, end: 2047 }, - { begin: 2304, end: 2431 }, - { begin: 2432, end: 2559 }, - { begin: 2560, end: 2687 }, - { begin: 2688, end: 2815 }, - { begin: 2816, end: 2943 }, - { begin: 2944, end: 3071 }, - { begin: 3072, end: 3199 }, - { begin: 3200, end: 3327 }, - { begin: 3328, end: 3455 }, - { begin: 3584, end: 3711 }, - { begin: 3712, end: 3839 }, - { begin: 4256, end: 4351 }, - { begin: 6912, end: 7039 }, - { begin: 4352, end: 4607 }, - { begin: 7680, end: 7935 }, - { begin: 7936, end: 8191 }, - { begin: 8192, end: 8303 }, - { begin: 8304, end: 8351 }, - { begin: 8352, end: 8399 }, - { begin: 8400, end: 8447 }, - { begin: 8448, end: 8527 }, - { begin: 8528, end: 8591 }, - { begin: 8592, end: 8703 }, - { begin: 8704, end: 8959 }, - { begin: 8960, end: 9215 }, - { begin: 9216, end: 9279 }, - { begin: 9280, end: 9311 }, - { begin: 9312, end: 9471 }, - { begin: 9472, end: 9599 }, - { begin: 9600, end: 9631 }, - { begin: 9632, end: 9727 }, - { begin: 9728, end: 9983 }, - { begin: 9984, end: 10175 }, - { begin: 12288, end: 12351 }, - { begin: 12352, end: 12447 }, - { begin: 12448, end: 12543 }, - { begin: 12544, end: 12591 }, - { begin: 12592, end: 12687 }, - { begin: 43072, end: 43135 }, - { begin: 12800, end: 13055 }, - { begin: 13056, end: 13311 }, - { begin: 44032, end: 55215 }, - { begin: 55296, end: 57343 }, - { begin: 67840, end: 67871 }, - { begin: 19968, end: 40959 }, - { begin: 57344, end: 63743 }, - { begin: 12736, end: 12783 }, - { begin: 64256, end: 64335 }, - { begin: 64336, end: 65023 }, - { begin: 65056, end: 65071 }, - { begin: 65040, end: 65055 }, - { begin: 65104, end: 65135 }, - { begin: 65136, end: 65279 }, - { begin: 65280, end: 65519 }, - { begin: 65520, end: 65535 }, - { begin: 3840, end: 4095 }, - { begin: 1792, end: 1871 }, - { begin: 1920, end: 1983 }, - { begin: 3456, end: 3583 }, - { begin: 4096, end: 4255 }, - { begin: 4608, end: 4991 }, - { begin: 5024, end: 5119 }, - { begin: 5120, end: 5759 }, - { begin: 5760, end: 5791 }, - { begin: 5792, end: 5887 }, - { begin: 6016, end: 6143 }, - { begin: 6144, end: 6319 }, - { begin: 10240, end: 10495 }, - { begin: 40960, end: 42127 }, - { begin: 5888, end: 5919 }, - { begin: 66304, end: 66351 }, - { begin: 66352, end: 66383 }, - { begin: 66560, end: 66639 }, - { begin: 118784, end: 119039 }, - { begin: 119808, end: 120831 }, - { begin: 1044480, end: 1048573 }, - { begin: 65024, end: 65039 }, - { begin: 917504, end: 917631 }, - { begin: 6400, end: 6479 }, - { begin: 6480, end: 6527 }, - { begin: 6528, end: 6623 }, - { begin: 6656, end: 6687 }, - { begin: 11264, end: 11359 }, - { begin: 11568, end: 11647 }, - { begin: 19904, end: 19967 }, - { begin: 43008, end: 43055 }, - { begin: 65536, end: 65663 }, - { begin: 65856, end: 65935 }, - { begin: 66432, end: 66463 }, - { begin: 66464, end: 66527 }, - { begin: 66640, end: 66687 }, - { begin: 66688, end: 66735 }, - { begin: 67584, end: 67647 }, - { begin: 68096, end: 68191 }, - { begin: 119552, end: 119647 }, - { begin: 73728, end: 74751 }, - { begin: 119648, end: 119679 }, - { begin: 7040, end: 7103 }, - { begin: 7168, end: 7247 }, - { begin: 7248, end: 7295 }, - { begin: 43136, end: 43231 }, - { begin: 43264, end: 43311 }, - { begin: 43312, end: 43359 }, - { begin: 43520, end: 43615 }, - { begin: 65936, end: 65999 }, - { begin: 66e3, end: 66047 }, - { begin: 66208, end: 66271 }, - { begin: 127024, end: 127135 }, - ]; - var ft = { - parse: function (e, t) { - var r = {}, - o = new R.Parser(e, t); - (r.version = o.parseUShort()), - (r.xAvgCharWidth = o.parseShort()), - (r.usWeightClass = o.parseUShort()), - (r.usWidthClass = o.parseUShort()), - (r.fsType = o.parseUShort()), - (r.ySubscriptXSize = o.parseShort()), - (r.ySubscriptYSize = o.parseShort()), - (r.ySubscriptXOffset = o.parseShort()), - (r.ySubscriptYOffset = o.parseShort()), - (r.ySuperscriptXSize = o.parseShort()), - (r.ySuperscriptYSize = o.parseShort()), - (r.ySuperscriptXOffset = o.parseShort()), - (r.ySuperscriptYOffset = o.parseShort()), - (r.yStrikeoutSize = o.parseShort()), - (r.yStrikeoutPosition = o.parseShort()), - (r.sFamilyClass = o.parseShort()), - (r.panose = []); - for (var n = 0; n < 10; n++) r.panose[n] = o.parseByte(); - return ( - (r.ulUnicodeRange1 = o.parseULong()), - (r.ulUnicodeRange2 = o.parseULong()), - (r.ulUnicodeRange3 = o.parseULong()), - (r.ulUnicodeRange4 = o.parseULong()), - (r.achVendID = String.fromCharCode( - o.parseByte(), - o.parseByte(), - o.parseByte(), - o.parseByte(), - )), - (r.fsSelection = o.parseUShort()), - (r.usFirstCharIndex = o.parseUShort()), - (r.usLastCharIndex = o.parseUShort()), - (r.sTypoAscender = o.parseShort()), - (r.sTypoDescender = o.parseShort()), - (r.sTypoLineGap = o.parseShort()), - (r.usWinAscent = o.parseUShort()), - (r.usWinDescent = o.parseUShort()), - 1 <= r.version && - ((r.ulCodePageRange1 = o.parseULong()), - (r.ulCodePageRange2 = o.parseULong())), - 2 <= r.version && - ((r.sxHeight = o.parseShort()), - (r.sCapHeight = o.parseShort()), - (r.usDefaultChar = o.parseUShort()), - (r.usBreakChar = o.parseUShort()), - (r.usMaxContent = o.parseUShort())), - r - ); - }, - make: function (e) { - return new S.Table( - "OS/2", - [ - { name: "version", type: "USHORT", value: 3 }, - { name: "xAvgCharWidth", type: "SHORT", value: 0 }, - { name: "usWeightClass", type: "USHORT", value: 0 }, - { name: "usWidthClass", type: "USHORT", value: 0 }, - { name: "fsType", type: "USHORT", value: 0 }, - { name: "ySubscriptXSize", type: "SHORT", value: 650 }, - { name: "ySubscriptYSize", type: "SHORT", value: 699 }, - { name: "ySubscriptXOffset", type: "SHORT", value: 0 }, - { - name: "ySubscriptYOffset", - type: "SHORT", - value: 140, - }, - { - name: "ySuperscriptXSize", - type: "SHORT", - value: 650, - }, - { - name: "ySuperscriptYSize", - type: "SHORT", - value: 699, - }, - { - name: "ySuperscriptXOffset", - type: "SHORT", - value: 0, - }, - { - name: "ySuperscriptYOffset", - type: "SHORT", - value: 479, - }, - { name: "yStrikeoutSize", type: "SHORT", value: 49 }, - { - name: "yStrikeoutPosition", - type: "SHORT", - value: 258, - }, - { name: "sFamilyClass", type: "SHORT", value: 0 }, - { name: "bFamilyType", type: "BYTE", value: 0 }, - { name: "bSerifStyle", type: "BYTE", value: 0 }, - { name: "bWeight", type: "BYTE", value: 0 }, - { name: "bProportion", type: "BYTE", value: 0 }, - { name: "bContrast", type: "BYTE", value: 0 }, - { name: "bStrokeVariation", type: "BYTE", value: 0 }, - { name: "bArmStyle", type: "BYTE", value: 0 }, - { name: "bLetterform", type: "BYTE", value: 0 }, - { name: "bMidline", type: "BYTE", value: 0 }, - { name: "bXHeight", type: "BYTE", value: 0 }, - { name: "ulUnicodeRange1", type: "ULONG", value: 0 }, - { name: "ulUnicodeRange2", type: "ULONG", value: 0 }, - { name: "ulUnicodeRange3", type: "ULONG", value: 0 }, - { name: "ulUnicodeRange4", type: "ULONG", value: 0 }, - { name: "achVendID", type: "CHARARRAY", value: "XXXX" }, - { name: "fsSelection", type: "USHORT", value: 0 }, - { name: "usFirstCharIndex", type: "USHORT", value: 0 }, - { name: "usLastCharIndex", type: "USHORT", value: 0 }, - { name: "sTypoAscender", type: "SHORT", value: 0 }, - { name: "sTypoDescender", type: "SHORT", value: 0 }, - { name: "sTypoLineGap", type: "SHORT", value: 0 }, - { name: "usWinAscent", type: "USHORT", value: 0 }, - { name: "usWinDescent", type: "USHORT", value: 0 }, - { name: "ulCodePageRange1", type: "ULONG", value: 0 }, - { name: "ulCodePageRange2", type: "ULONG", value: 0 }, - { name: "sxHeight", type: "SHORT", value: 0 }, - { name: "sCapHeight", type: "SHORT", value: 0 }, - { name: "usDefaultChar", type: "USHORT", value: 0 }, - { name: "usBreakChar", type: "USHORT", value: 0 }, - { name: "usMaxContext", type: "USHORT", value: 0 }, - ], - e, - ); - }, - unicodeRanges: ht, - getUnicodeRange: function (e) { - for (var t = 0; t < ht.length; t += 1) { - var r = ht[t]; - if (e >= r.begin && e < r.end) return t; - } - return -1; - }, - }; - var pt = { - parse: function (e, t) { - var r = {}, - o = new R.Parser(e, t); - switch ( - ((r.version = o.parseVersion()), - (r.italicAngle = o.parseFixed()), - (r.underlinePosition = o.parseShort()), - (r.underlineThickness = o.parseShort()), - (r.isFixedPitch = o.parseULong()), - (r.minMemType42 = o.parseULong()), - (r.maxMemType42 = o.parseULong()), - (r.minMemType1 = o.parseULong()), - (r.maxMemType1 = o.parseULong()), - r.version) - ) { - case 1: - r.names = c.slice(); - break; - case 2: - (r.numberOfGlyphs = o.parseUShort()), - (r.glyphNameIndex = new Array(r.numberOfGlyphs)); - for (var n = 0; n < r.numberOfGlyphs; n++) - r.glyphNameIndex[n] = o.parseUShort(); - r.names = []; - for (var s, i = 0; i < r.numberOfGlyphs; i++) - r.glyphNameIndex[i] >= c.length && - ((s = o.parseChar()), - r.names.push(o.parseString(s))); - break; - case 2.5: - (r.numberOfGlyphs = o.parseUShort()), - (r.offset = new Array(r.numberOfGlyphs)); - for (var a = 0; a < r.numberOfGlyphs; a++) - r.offset[a] = o.parseChar(); - } - return r; - }, - make: function () { - return new S.Table("post", [ - { name: "version", type: "FIXED", value: 196608 }, - { name: "italicAngle", type: "FIXED", value: 0 }, - { name: "underlinePosition", type: "FWORD", value: 0 }, - { name: "underlineThickness", type: "FWORD", value: 0 }, - { name: "isFixedPitch", type: "ULONG", value: 0 }, - { name: "minMemType42", type: "ULONG", value: 0 }, - { name: "maxMemType42", type: "ULONG", value: 0 }, - { name: "minMemType1", type: "ULONG", value: 0 }, - { name: "maxMemType1", type: "ULONG", value: 0 }, - ]); - }, - }, - o = new Array(9), - s = - ((o[1] = function () { - var e = this.offset + this.relativeOffset, - t = this.parseUShort(); - return 1 === t - ? { - substFormat: 1, - coverage: this.parsePointer(u.coverage), - deltaGlyphId: this.parseUShort(), - } - : 2 === t - ? { - substFormat: 2, - coverage: this.parsePointer(u.coverage), - substitute: this.parseOffset16List(), - } - : void L.assert( - !1, - "0x" + - e.toString(16) + - ": lookup type 1 format must be 1 or 2.", - ); - }), - (o[2] = function () { - var e = this.parseUShort(); - return ( - L.argument( - 1 === e, - "GSUB Multiple Substitution Subtable identifier-format must be 1", - ), - { - substFormat: e, - coverage: this.parsePointer(u.coverage), - sequences: this.parseListOfLists(), - } - ); - }), - (o[3] = function () { - var e = this.parseUShort(); - return ( - L.argument( - 1 === e, - "GSUB Alternate Substitution Subtable identifier-format must be 1", - ), - { - substFormat: e, - coverage: this.parsePointer(u.coverage), - alternateSets: this.parseListOfLists(), - } - ); - }), - (o[4] = function () { - var e = this.parseUShort(); - return ( - L.argument( - 1 === e, - "GSUB ligature table identifier-format must be 1", - ), - { - substFormat: e, - coverage: this.parsePointer(u.coverage), - ligatureSets: this.parseListOfLists(function () { - return { - ligGlyph: this.parseUShort(), - components: this.parseUShortList( - this.parseUShort() - 1, - ), - }; - }), - } - ); - }), - { sequenceIndex: u.uShort, lookupListIndex: u.uShort }); - (o[5] = function () { - var e, - t, - r = this.offset + this.relativeOffset, - o = this.parseUShort(); - return 1 === o - ? { - substFormat: o, - coverage: this.parsePointer(u.coverage), - ruleSets: this.parseListOfLists(function () { - var e = this.parseUShort(), - t = this.parseUShort(); - return { - input: this.parseUShortList(e - 1), - lookupRecords: this.parseRecordList(t, s), - }; - }), - } - : 2 === o - ? { - substFormat: o, - coverage: this.parsePointer(u.coverage), - classDef: this.parsePointer(u.classDef), - classSets: this.parseListOfLists(function () { - var e = this.parseUShort(), - t = this.parseUShort(); - return { - classes: this.parseUShortList(e - 1), - lookupRecords: this.parseRecordList(t, s), - }; - }), - } - : 3 === o - ? ((e = this.parseUShort()), - (t = this.parseUShort()), - { - substFormat: o, - coverages: this.parseList(e, u.pointer(u.coverage)), - lookupRecords: this.parseRecordList(t, s), - }) - : void L.assert( - !1, - "0x" + - r.toString(16) + - ": lookup type 5 format must be 1, 2 or 3.", - ); - }), - (o[6] = function () { - var e = this.offset + this.relativeOffset, - t = this.parseUShort(); - return 1 === t - ? { - substFormat: 1, - coverage: this.parsePointer(u.coverage), - chainRuleSets: this.parseListOfLists(function () { - return { - backtrack: this.parseUShortList(), - input: this.parseUShortList( - this.parseShort() - 1, - ), - lookahead: this.parseUShortList(), - lookupRecords: this.parseRecordList(s), - }; - }), - } - : 2 === t - ? { - substFormat: 2, - coverage: this.parsePointer(u.coverage), - backtrackClassDef: this.parsePointer(u.classDef), - inputClassDef: this.parsePointer(u.classDef), - lookaheadClassDef: this.parsePointer(u.classDef), - chainClassSet: this.parseListOfLists(function () { - return { - backtrack: this.parseUShortList(), - input: this.parseUShortList( - this.parseShort() - 1, - ), - lookahead: this.parseUShortList(), - lookupRecords: this.parseRecordList(s), - }; - }), - } - : 3 === t - ? { - substFormat: 3, - backtrackCoverage: this.parseList( - u.pointer(u.coverage), - ), - inputCoverage: this.parseList( - u.pointer(u.coverage), - ), - lookaheadCoverage: this.parseList( - u.pointer(u.coverage), - ), - lookupRecords: this.parseRecordList(s), - } - : void L.assert( - !1, - "0x" + - e.toString(16) + - ": lookup type 6 format must be 1, 2 or 3.", - ); - }), - (o[7] = function () { - var e = this.parseUShort(), - e = - (L.argument( - 1 === e, - "GSUB Extension Substitution subtable identifier-format must be 1", - ), - this.parseUShort()), - t = new u(this.data, this.offset + this.parseULong()); - return { - substFormat: 1, - lookupType: e, - extension: o[e].call(t), - }; - }), - (o[8] = function () { - var e = this.parseUShort(); - return ( - L.argument( - 1 === e, - "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1", - ), - { - substFormat: e, - coverage: this.parsePointer(u.coverage), - backtrackCoverage: this.parseList( - u.pointer(u.coverage), - ), - lookaheadCoverage: this.parseList( - u.pointer(u.coverage), - ), - substitutes: this.parseUShortList(), - } - ); - }); - var mt = new Array(9); - (mt[1] = function (e) { - return 1 === e.substFormat - ? new S.Table("substitutionTable", [ - { name: "substFormat", type: "USHORT", value: 1 }, - { - name: "coverage", - type: "TABLE", - value: new S.Coverage(e.coverage), - }, - { - name: "deltaGlyphID", - type: "USHORT", - value: e.deltaGlyphId, - }, - ]) - : new S.Table( - "substitutionTable", - [ - { name: "substFormat", type: "USHORT", value: 2 }, - { - name: "coverage", - type: "TABLE", - value: new S.Coverage(e.coverage), - }, - ].concat(S.ushortList("substitute", e.substitute)), - ); - }), - (mt[3] = function (e) { - return ( - L.assert( - 1 === e.substFormat, - "Lookup type 3 substFormat must be 1.", - ), - new S.Table( - "substitutionTable", - [ - { name: "substFormat", type: "USHORT", value: 1 }, - { - name: "coverage", - type: "TABLE", - value: new S.Coverage(e.coverage), - }, - ].concat( - S.tableList("altSet", e.alternateSets, function (e) { - return new S.Table( - "alternateSetTable", - S.ushortList("alternate", e), - ); - }), - ), - ) - ); - }), - (mt[4] = function (e) { - return ( - L.assert( - 1 === e.substFormat, - "Lookup type 4 substFormat must be 1.", - ), - new S.Table( - "substitutionTable", - [ - { name: "substFormat", type: "USHORT", value: 1 }, - { - name: "coverage", - type: "TABLE", - value: new S.Coverage(e.coverage), - }, - ].concat( - S.tableList("ligSet", e.ligatureSets, function (e) { - return new S.Table( - "ligatureSetTable", - S.tableList("ligature", e, function (e) { - return new S.Table( - "ligatureTable", - [ - { - name: "ligGlyph", - type: "USHORT", - value: e.ligGlyph, - }, - ].concat( - S.ushortList( - "component", - e.components, - e.components.length + 1, - ), - ), - ); - }), - ); - }), - ), - ) - ); - }); - var yt = { - parse: function (e, t) { - return ( - (t = (e = new u(e, (t = t || 0))).parseVersion(1)), - L.argument( - 1 === t || 1.1 === t, - "Unsupported GSUB table version.", - ), - 1 === t - ? { - version: t, - scripts: e.parseScriptList(), - features: e.parseFeatureList(), - lookups: e.parseLookupList(o), - } - : { - version: t, - scripts: e.parseScriptList(), - features: e.parseFeatureList(), - lookups: e.parseLookupList(o), - variations: e.parseFeatureVariationsList(), - } - ); - }, - make: function (e) { - return new S.Table("GSUB", [ - { name: "version", type: "ULONG", value: 65536 }, - { - name: "scripts", - type: "TABLE", - value: new S.ScriptList(e.scripts), - }, - { - name: "features", - type: "TABLE", - value: new S.FeatureList(e.features), - }, - { - name: "lookups", - type: "TABLE", - value: new S.LookupList(e.lookups, mt), - }, - ]); - }, - }; - var gt = { - parse: function (e, t) { - for ( - var r = new R.Parser(e, t), - o = r.parseULong(), - n = - (L.argument( - 1 === o, - "Unsupported META table version.", - ), - r.parseULong(), - r.parseULong(), - r.parseULong()), - s = {}, - i = 0; - i < n; - i++ - ) { - var a = r.parseTag(), - l = r.parseULong(), - u = r.parseULong(), - l = m.UTF8(e, t + l, u); - s[a] = l; - } - return s; - }, - make: function (e) { - var t, - r = Object.keys(e).length, - o = "", - n = 16 + 12 * r, - s = new S.Table("meta", [ - { name: "version", type: "ULONG", value: 1 }, - { name: "flags", type: "ULONG", value: 0 }, - { name: "offset", type: "ULONG", value: n }, - { name: "numTags", type: "ULONG", value: r }, - ]); - for (t in e) { - var i = o.length; - (o += e[t]), - s.fields.push({ - name: "tag " + t, - type: "TAG", - value: t, - }), - s.fields.push({ - name: "offset " + t, - type: "ULONG", - value: n + i, - }), - s.fields.push({ - name: "length " + t, - type: "ULONG", - value: e[t].length, - }); - } - return ( - s.fields.push({ - name: "stringPool", - type: "CHARARRAY", - value: o, - }), - s - ); - }, - }; - function vt(e) { - return (Math.log(e) / Math.log(2)) | 0; - } - function bt(e) { - for (; e.length % 4 != 0; ) e.push(0); - for (var t = 0, r = 0; r < e.length; r += 4) - t += - (e[r] << 24) + - (e[r + 1] << 16) + - (e[r + 2] << 8) + - e[r + 3]; - return (t %= Math.pow(2, 32)); - } - function jt(e, t, r, o) { - return new S.Record("Table Record", [ - { name: "tag", type: "TAG", value: void 0 !== e ? e : "" }, - { - name: "checkSum", - type: "ULONG", - value: void 0 !== t ? t : 0, - }, - { - name: "offset", - type: "ULONG", - value: void 0 !== r ? r : 0, - }, - { - name: "length", - type: "ULONG", - value: void 0 !== o ? o : 0, - }, - ]); - } - function _t(e) { - for ( - var t = new S.Table("sfnt", [ - { name: "version", type: "TAG", value: "OTTO" }, - { name: "numTables", type: "USHORT", value: 0 }, - { name: "searchRange", type: "USHORT", value: 0 }, - { name: "entrySelector", type: "USHORT", value: 0 }, - { name: "rangeShift", type: "USHORT", value: 0 }, - ]), - r = - ((t.tables = e), - (t.numTables = e.length), - Math.pow(2, vt(t.numTables))), - o = - ((t.searchRange = 16 * r), - (t.entrySelector = vt(r)), - (t.rangeShift = 16 * t.numTables - t.searchRange), - []), - n = [], - s = t.sizeOf() + jt().sizeOf() * t.numTables; - s % 4 != 0; - - ) - (s += 1), - n.push({ name: "padding", type: "BYTE", value: 0 }); - for (var i = 0; i < e.length; i += 1) { - var a = e[i], - l = - (L.argument( - 4 === a.tableName.length, - "Table name" + a.tableName + " is invalid.", - ), - a.sizeOf()), - u = jt(a.tableName, bt(a.encode()), s, l); - for ( - o.push({ - name: u.tag + " Table Record", - type: "RECORD", - value: u, - }), - n.push({ - name: a.tableName + " table", - type: "RECORD", - value: a, - }), - s += l, - L.argument( - !isNaN(s), - "Something went wrong calculating the offset.", - ); - s % 4 != 0; - - ) - (s += 1), - n.push({ name: "padding", type: "BYTE", value: 0 }); - } - return ( - o.sort(function (e, t) { - return e.value.tag > t.value.tag ? 1 : -1; - }), - (t.fields = t.fields.concat(o)), - (t.fields = t.fields.concat(n)), - t - ); - } - function xt(e, t, r) { - for (var o = 0; o < t.length; o += 1) { - var n = e.charToGlyphIndex(t[o]); - if (0 < n) return e.glyphs.get(n).getMetrics(); - } - return r; - } - var wt = { - make: _t, - fontToTable: function (e) { - for ( - var t, - r = [], - o = [], - n = [], - s = [], - i = [], - a = [], - l = [], - u = 0, - c = 0, - d = 0, - h = 0, - f = 0, - p = 0; - p < e.glyphs.length; - p += 1 - ) { - var m = e.glyphs.get(p), - y = 0 | m.unicode; - if (isNaN(m.advanceWidth)) - throw new Error( - "Glyph " + - m.name + - " (" + - p + - "): advanceWidth is not a number.", - ); - (y < t || void 0 === t) && 0 < y && (t = y), - u < y && (u = y); - var y = ft.getUnicodeRange(y); - if (y < 32) c |= 1 << y; - else if (y < 64) d |= 1 << (y - 32); - else if (y < 96) h |= 1 << (y - 64); - else { - if (!(y < 123)) - throw new Error( - "Unicode ranges bits > 123 are reserved for internal usage", - ); - f |= 1 << (y - 96); - } - ".notdef" !== m.name && - ((y = m.getMetrics()), - r.push(y.xMin), - o.push(y.yMin), - n.push(y.xMax), - s.push(y.yMax), - a.push(y.leftSideBearing), - l.push(y.rightSideBearing), - i.push(m.advanceWidth)); - } - var g, - v = { - xMin: Math.min.apply(null, r), - yMin: Math.min.apply(null, o), - xMax: Math.max.apply(null, n), - yMax: Math.max.apply(null, s), - advanceWidthMax: Math.max.apply(null, i), - advanceWidthAvg: (function (e) { - for (var t = 0, r = 0; r < e.length; r += 1) - t += e[r]; - return t / e.length; - })(i), - minLeftSideBearing: Math.min.apply(null, a), - maxLeftSideBearing: Math.max.apply(null, a), - minRightSideBearing: Math.min.apply(null, l), - }, - b = - ((v.ascender = e.ascender), - (v.descender = e.descender), - Ze.make({ - flags: 3, - unitsPerEm: e.unitsPerEm, - xMin: v.xMin, - yMin: v.yMin, - xMax: v.xMax, - yMax: v.yMax, - lowestRecPPEM: 3, - createdTimestamp: e.createdTimestamp, - })), - j = Qe.make({ - ascender: v.ascender, - descender: v.descender, - advanceWidthMax: v.advanceWidthMax, - minLeftSideBearing: v.minLeftSideBearing, - minRightSideBearing: v.minRightSideBearing, - xMaxExtent: v.maxLeftSideBearing + (v.xMax - v.xMin), - numberOfHMetrics: e.glyphs.length, - }), - _ = $e.make(e.glyphs.length), - x = ft.make({ - xAvgCharWidth: Math.round(v.advanceWidthAvg), - usWeightClass: e.tables.os2.usWeightClass, - usWidthClass: e.tables.os2.usWidthClass, - usFirstCharIndex: t, - usLastCharIndex: u, - ulUnicodeRange1: c, - ulUnicodeRange2: d, - ulUnicodeRange3: h, - ulUnicodeRange4: f, - fsSelection: e.tables.os2.fsSelection, - sTypoAscender: v.ascender, - sTypoDescender: v.descender, - sTypoLineGap: 0, - usWinAscent: v.yMax, - usWinDescent: Math.abs(v.yMin), - ulCodePageRange1: 1, - sxHeight: xt(e, "xyvw", { - yMax: Math.round(v.ascender / 2), - }).yMax, - sCapHeight: xt(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", v).yMax, - usDefaultChar: e.hasChar(" ") ? 32 : 0, - usBreakChar: e.hasChar(" ") ? 32 : 0, - }), - w = Je.make(e.glyphs), - S = we.make(e.glyphs), - T = e.getEnglishName("fontFamily"), - M = e.getEnglishName("fontSubfamily"), - E = T + " " + M, - k = - (k = e.getEnglishName("postScriptName")) || - T.replace(/\s/g, "") + "-" + M, - C = {}; - for (g in e.names) C[g] = e.names[g]; - C.uniqueID || - (C.uniqueID = { - en: e.getEnglishName("manufacturer") + ":" + E, - }), - C.postScriptName || (C.postScriptName = { en: k }), - C.preferredFamily || - (C.preferredFamily = e.names.fontFamily), - C.preferredSubfamily || - (C.preferredSubfamily = e.names.fontSubfamily); - var O = [], - P = dt.make(C, O), - O = 0 < O.length ? Ke.make(O) : void 0, - A = pt.make(), - E = Ye.make(e.glyphs, { - version: e.getEnglishName("version"), - fullName: E, - familyName: T, - weightName: M, - postScriptName: k, - unitsPerEm: e.unitsPerEm, - fontBBox: [0, v.yMin, v.ascender, v.advanceWidthMax], - }), - T = - e.metas && 0 < Object.keys(e.metas).length - ? gt.make(e.metas) - : void 0, - M = [b, j, _, x, P, S, A, E, w]; - O && M.push(O), - e.tables.gsub && M.push(yt.make(e.tables.gsub)), - T && M.push(T); - for ( - var D = bt((k = _t(M)).encode()), - L = k.fields, - R = !1, - I = 0; - I < L.length; - I += 1 - ) - if ("head table" === L[I].name) { - (L[I].value.checkSumAdjustment = 2981146554 - D), - (R = !0); - break; - } - if (R) return k; - throw new Error( - "Could not find head table with checkSum to adjust.", - ); - }, - computeCheckSum: bt, - }; - function St(e, t) { - for (var r = 0, o = e.length - 1; r <= o; ) { - var n = (r + o) >>> 1, - s = e[n].tag; - if (s === t) return n; - s < t ? (r = 1 + n) : (o = n - 1); - } - return -r - 1; - } - function Tt(e, t) { - for (var r = 0, o = e.length - 1; r <= o; ) { - var n = (r + o) >>> 1, - s = e[n]; - if (s === t) return n; - s < t ? (r = 1 + n) : (o = n - 1); - } - return -r - 1; - } - function Mt(e, t) { - for (var r = 0, o = e.length - 1; r <= o; ) { - var n, - s = (r + o) >>> 1, - i = (n = e[s]).start; - if (i === t) return n; - i < t ? (r = 1 + s) : (o = s - 1); - } - if (0 < r) return t > (n = e[r - 1]).end ? 0 : n; - } - function Et(e, t) { - (this.font = e), (this.tableName = t); - } - function kt(e) { - Et.call(this, e, "gpos"); - } - function i(e) { - Et.call(this, e, "gsub"); - } - function Ct(e, t, r) { - for (var o = e.subtables, n = 0; n < o.length; n++) { - var s = o[n]; - if (s.substFormat === t) return s; - } - if (r) return o.push(r), r; - } - function Ot(e) { - for ( - var t = new ArrayBuffer(e.length), - r = new Uint8Array(t), - o = 0; - o < e.length; - ++o - ) - r[o] = e[o]; - return t; - } - function _(e, t) { - if (!e) throw t; - } - function Pt(e, t, r, o, n) { - var s = - 0 < (t & o) - ? ((s = e.parseByte()), r + (s = 0 == (t & n) ? -s : s)) - : 0 < (t & n) - ? r - : r + e.parseShort(); - return s; - } - function At(e, t, r) { - var o, - n = new R.Parser(t, r); - if ( - ((e.numberOfContours = n.parseShort()), - (e._xMin = n.parseShort()), - (e._yMin = n.parseShort()), - (e._xMax = n.parseShort()), - (e._yMax = n.parseShort()), - 0 < e.numberOfContours) - ) { - for ( - var s = (e.endPointIndices = []), i = 0; - i < e.numberOfContours; - i += 1 - ) - s.push(n.parseUShort()); - (e.instructionLength = n.parseUShort()), - (e.instructions = []); - for (var a = 0; a < e.instructionLength; a += 1) - e.instructions.push(n.parseByte()); - for ( - var l = s[s.length - 1] + 1, u = [], c = 0; - c < l; - c += 1 - ) - if (((o = n.parseByte()), u.push(o), 0 < (8 & o))) - for (var d = n.parseByte(), h = 0; h < d; h += 1) - u.push(o), (c += 1); - if ( - (L.argument(u.length === l, "Bad flags."), 0 < s.length) - ) { - var f, - p = []; - if (0 < l) { - for (var m = 0; m < l; m += 1) - (o = u[m]), - ((f = {}).onCurve = !!(1 & o)), - (f.lastPointOfContour = 0 <= s.indexOf(m)), - p.push(f); - for (var y = 0, g = 0; g < l; g += 1) - (o = u[g]), - ((f = p[g]).x = Pt(n, o, y, 2, 16)), - (y = f.x); - for (var v = 0, b = 0; b < l; b += 1) - (o = u[b]), - ((f = p[b]).y = Pt(n, o, v, 4, 32)), - (v = f.y); - } - e.points = p; - } else e.points = []; - } else if (0 === e.numberOfContours) e.points = []; - else { - (e.isComposite = !0), (e.points = []), (e.components = []); - for (var j = !0; j; ) { - u = n.parseUShort(); - var _ = { - glyphIndex: n.parseUShort(), - xScale: 1, - scale01: 0, - scale10: 0, - yScale: 1, - dx: 0, - dy: 0, - }; - 0 < (1 & u) - ? 0 < (2 & u) - ? ((_.dx = n.parseShort()), (_.dy = n.parseShort())) - : (_.matchedPoints = [ - n.parseUShort(), - n.parseUShort(), - ]) - : 0 < (2 & u) - ? ((_.dx = n.parseChar()), (_.dy = n.parseChar())) - : (_.matchedPoints = [n.parseByte(), n.parseByte()]), - 0 < (8 & u) - ? (_.xScale = _.yScale = n.parseF2Dot14()) - : 0 < (64 & u) - ? ((_.xScale = n.parseF2Dot14()), - (_.yScale = n.parseF2Dot14())) - : 0 < (128 & u) && - ((_.xScale = n.parseF2Dot14()), - (_.scale01 = n.parseF2Dot14()), - (_.scale10 = n.parseF2Dot14()), - (_.yScale = n.parseF2Dot14())), - e.components.push(_), - (j = !!(32 & u)); - } - if (256 & u) { - (e.instructionLength = n.parseUShort()), - (e.instructions = []); - for (var x = 0; x < e.instructionLength; x += 1) - e.instructions.push(n.parseByte()); - } - } - } - function Lt(e, t) { - for (var r = [], o = 0; o < e.length; o += 1) { - var n = e[o], - n = { - x: t.xScale * n.x + t.scale01 * n.y + t.dx, - y: t.scale10 * n.x + t.yScale * n.y + t.dy, - onCurve: n.onCurve, - lastPointOfContour: n.lastPointOfContour, - }; - r.push(n); - } - return r; - } - function Rt(e) { - var t = new h(); - if (e) - for ( - var r = (function (e) { - for ( - var t = [], r = [], o = 0; - o < e.length; - o += 1 - ) { - var n = e[o]; - r.push(n), - n.lastPointOfContour && (t.push(r), (r = [])); - } - return ( - L.argument( - 0 === r.length, - "There are still points left in the current contour.", - ), - t - ); - })(e), - o = 0; - o < r.length; - ++o - ) { - var n, - s = r[o], - i = s[s.length - 1], - a = s[0]; - i.onCurve - ? t.moveTo(i.x, i.y) - : a.onCurve - ? t.moveTo(a.x, a.y) - : ((n = { - x: 0.5 * (i.x + a.x), - y: 0.5 * (i.y + a.y), - }), - t.moveTo(n.x, n.y)); - for (var l = 0; l < s.length; ++l) { - var u, - c = i, - i = a, - a = s[(l + 1) % s.length]; - i.onCurve - ? t.lineTo(i.x, i.y) - : ((u = a), - c.onCurve || (i.x, c.x, i.y, c.y), - a.onCurve || - (u = { - x: 0.5 * (i.x + a.x), - y: 0.5 * (i.y + a.y), - }), - t.quadraticCurveTo(i.x, i.y, u.x, u.y)); - } - t.closePath(); - } - return t; - } - function It(e, t) { - if (t.isComposite) - for (var r = 0; r < t.components.length; r += 1) { - var o = t.components[r], - n = e.get(o.glyphIndex); - if ((n.getPath(), n.points)) { - var s = void 0; - if (void 0 === o.matchedPoints) s = Lt(n.points, o); - else { - if ( - o.matchedPoints[0] > t.points.length - 1 || - o.matchedPoints[1] > n.points.length - 1 - ) - throw Error( - "Matched points out of range in " + t.name, - ); - var i = t.points[o.matchedPoints[0]], - a = n.points[o.matchedPoints[1]], - o = { - xScale: o.xScale, - scale01: o.scale01, - scale10: o.scale10, - yScale: o.yScale, - dx: 0, - dy: 0, - }, - a = Lt([a], o)[0]; - (o.dx = i.x - a.x), - (o.dy = i.y - a.y), - (s = Lt(n.points, o)); - } - t.points = t.points.concat(s); - } - } - return Rt(t.points); - } - ((kt.prototype = Et.prototype = - { - searchTag: St, - binSearch: Tt, - getTable: function (e) { - var t = this.font.tables[this.tableName]; - return (t = - !t && e - ? (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 < e.scripts.length; r++) { - var o = e.scripts[r].tag; - if ("DFLT" === o) return o; - "latn" === o && (t = !0); - } - return t ? "latn" : void 0; - } - }, - getScriptTable: function (e, t) { - var r, - o = this.getTable(t); - if (o) - return ( - (r = o.scripts), - 0 <= (o = St(o.scripts, (e = e || "DFLT"))) - ? r[o].script - : t - ? (r.splice( - -1 - o, - 0, - (t = { - tag: e, - script: { - defaultLangSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [], - }, - langSysRecords: [], - }, - }), - ), - t.script) - : void 0 - ); - }, - getLangSysTable: function (e, t, r) { - var o, - e = this.getScriptTable(e, r); - if (e) - return t && "dflt" !== t && "DFLT" !== t - ? 0 <= (o = St(e.langSysRecords, t)) - ? e.langSysRecords[o].langSys - : r - ? (e.langSysRecords.splice( - -1 - o, - 0, - (r = { - tag: t, - langSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [], - }, - }), - ), - r.langSys) - : void 0 - : e.defaultLangSys; - }, - getFeatureTable: function (e, t, r, o) { - e = this.getLangSysTable(e, t, o); - if (e) { - for ( - var n, - s = e.featureIndexes, - i = this.font.tables[this.tableName].features, - a = 0; - a < s.length; - a++ - ) - if ((n = i[s[a]]).tag === r) return n.feature; - if (o) - return ( - (t = i.length), - L.assert( - 0 === t || r >= i[t - 1].tag, - "Features must be added in alphabetical order.", - ), - i.push( - (n = { - tag: r, - feature: { params: 0, lookupListIndexes: [] }, - }), - ), - s.push(t), - n.feature - ); - } - }, - getLookupTables: function (e, t, r, o, n) { - var e = this.getFeatureTable(e, t, r, n), - s = []; - if (e) { - for ( - var i, - a = e.lookupListIndexes, - l = this.font.tables[this.tableName].lookups, - u = 0; - u < a.length; - u++ - ) - (i = l[a[u]]).lookupType === o && s.push(i); - if (0 === s.length && n) - return ( - (t = l.length), - l.push( - (i = { - lookupType: o, - lookupFlag: 0, - subtables: [], - markFilteringSet: void 0, - }), - ), - a.push(t), - [i] - ); - } - return s; - }, - getGlyphClass: function (e, t) { - switch (e.format) { - case 1: - return e.startGlyph <= t && - t < e.startGlyph + e.classes.length - ? e.classes[t - e.startGlyph] - : 0; - case 2: - var r = Mt(e.ranges, t); - return r ? r.classId : 0; - } - }, - getCoverageIndex: function (e, t) { - switch (e.format) { - case 1: - var r = Tt(e.glyphs, t); - return 0 <= r ? r : -1; - case 2: - r = Mt(e.ranges, t); - return r ? r.index + t - r.start : -1; - } - }, - expandCoverage: function (e) { - if (1 === e.format) return e.glyphs; - for (var t = [], r = e.ranges, o = 0; o < r.length; o++) - for ( - var n = r[o], s = n.start, i = n.end, a = s; - a <= i; - a++ - ) - t.push(a); - return t; - }, - }).init = function () { - var e = this.getDefaultScriptName(); - this.defaultKerningTables = this.getKerningTables(e); - }), - (kt.prototype.getKerningValue = function (e, t, r) { - for (var o = 0; o < e.length; o++) - for (var n = e[o].subtables, s = 0; s < n.length; s++) { - var i = n[s], - a = this.getCoverageIndex(i.coverage, t); - if (!(a < 0)) - switch (i.posFormat) { - case 1: - for ( - var l = i.pairSets[a], u = 0; - u < l.length; - u++ - ) { - var c = l[u]; - if (c.secondGlyph === r) - return (c.value1 && c.value1.xAdvance) || 0; - } - break; - case 2: - var d = this.getGlyphClass(i.classDef1, t), - h = this.getGlyphClass(i.classDef2, r), - d = i.classRecords[d][h]; - return (d.value1 && d.value1.xAdvance) || 0; - } - } - return 0; - }), - (kt.prototype.getKerningTables = function (e, t) { - if (this.font.tables.gpos) - return this.getLookupTables(e, t, "kern", 2); - }), - ((i.prototype = Et.prototype).createDefaultTable = - function () { - return { - version: 1, - scripts: [ - { - tag: "DFLT", - script: { - defaultLangSys: { - reserved: 0, - reqFeatureIndex: 65535, - featureIndexes: [], - }, - langSysRecords: [], - }, - }, - ], - features: [], - lookups: [], - }; - }), - (i.prototype.getSingle = function (e, t, r) { - for ( - var o = [], n = this.getLookupTables(t, r, e, 1), s = 0; - s < n.length; - s++ - ) - for (var i = n[s].subtables, a = 0; a < i.length; a++) { - var l = i[a], - u = this.expandCoverage(l.coverage), - c = void 0; - if (1 === l.substFormat) - for ( - var d = l.deltaGlyphId, c = 0; - c < u.length; - c++ - ) { - var h = u[c]; - o.push({ sub: h, by: h + d }); - } - else { - var f = l.substitute; - for (c = 0; c < u.length; c++) - o.push({ sub: u[c], by: f[c] }); - } - } - return o; - }), - (i.prototype.getAlternates = function (e, t, r) { - for ( - var o = [], n = this.getLookupTables(t, r, e, 3), s = 0; - s < n.length; - s++ - ) - for (var i = n[s].subtables, a = 0; a < i.length; a++) - for ( - var l = i[a], - u = this.expandCoverage(l.coverage), - c = l.alternateSets, - d = 0; - d < u.length; - d++ - ) - o.push({ sub: u[d], by: c[d] }); - return o; - }), - (i.prototype.getLigatures = function (e, t, r) { - for ( - var o = [], n = this.getLookupTables(t, r, e, 4), s = 0; - s < n.length; - s++ - ) - for (var i = n[s].subtables, a = 0; a < i.length; a++) - for ( - var l = i[a], - u = this.expandCoverage(l.coverage), - c = l.ligatureSets, - d = 0; - d < u.length; - d++ - ) - for ( - var h = u[d], f = c[d], p = 0; - p < f.length; - p++ - ) { - var m = f[p]; - o.push({ - sub: [h].concat(m.components), - by: m.ligGlyph, - }); - } - return o; - }), - (i.prototype.addSingle = function (e, t, r, o) { - (r = Ct(this.getLookupTables(r, o, e, 1, !0)[0], 2, { - substFormat: 2, - coverage: { format: 1, glyphs: [] }, - substitute: [], - })), - L.assert( - 1 === r.coverage.format, - "Ligature: unable to modify coverage table format " + - r.coverage.format, - ), - (o = t.sub), - (e = this.binSearch(r.coverage.glyphs, o)); - e < 0 && - (r.coverage.glyphs.splice((e = -1 - e), 0, o), - r.substitute.splice(e, 0, 0)), - (r.substitute[e] = t.by); - }), - (i.prototype.addAlternate = function (e, t, r, o) { - (r = Ct(this.getLookupTables(r, o, e, 3, !0)[0], 1, { - substFormat: 1, - coverage: { format: 1, glyphs: [] }, - alternateSets: [], - })), - L.assert( - 1 === r.coverage.format, - "Ligature: unable to modify coverage table format " + - r.coverage.format, - ), - (o = t.sub), - (e = this.binSearch(r.coverage.glyphs, o)); - e < 0 && - (r.coverage.glyphs.splice((e = -1 - e), 0, o), - r.alternateSets.splice(e, 0, 0)), - (r.alternateSets[e] = t.by); - }), - (i.prototype.addLigature = function (e, t, r, o) { - var r = this.getLookupTables(r, o, e, 4, !0)[0], - o = r.subtables[0], - e = - (o || - (r.subtables[0] = o = - { - substFormat: 1, - coverage: { format: 1, glyphs: [] }, - ligatureSets: [], - }), - L.assert( - 1 === o.coverage.format, - "Ligature: unable to modify coverage table format " + - o.coverage.format, - ), - t.sub[0]), - n = t.sub.slice(1), - r = { ligGlyph: t.by, components: n }, - t = this.binSearch(o.coverage.glyphs, e); - if (0 <= t) { - for (var s = o.ligatureSets[t], i = 0; i < s.length; i++) - if ( - (function (e, t) { - var r = e.length; - if (r === t.length) { - for (var o = 0; o < r; o++) - if (e[o] !== t[o]) return; - return 1; - } - })(s[i].components, n) - ) - return; - s.push(r); - } else - o.coverage.glyphs.splice((t = -1 - t), 0, e), - o.ligatureSets.splice(t, 0, [r]); - }), - (i.prototype.getFeature = function (e, t, r) { - if (/ss\d\d/.test(e)) return this.getSingle(e, t, r); - switch (e) { - case "aalt": - case "salt": - return this.getSingle(e, t, r).concat( - this.getAlternates(e, t, r), - ); - case "dlig": - case "liga": - case "rlig": - return this.getLigatures(e, t, r); - } - }), - (i.prototype.add = function (e, t, r, o) { - if (/ss\d\d/.test(e)) return this.addSingle(e, t, r, o); - switch (e) { - case "aalt": - case "salt": - return "number" == typeof t.by - ? this.addSingle(e, t, r, o) - : this.addAlternate(e, t, r, o); - case "dlig": - case "liga": - case "rlig": - return this.addLigature(e, t, r, o); - } - }); - var Dt = { - getPath: Rt, - parse: function (e, t, r, o) { - for ( - var n = new p.GlyphSet(o), s = 0; - s < r.length - 1; - s += 1 - ) { - var i = r[s]; - i !== r[s + 1] - ? n.push(s, p.ttfGlyphLoader(o, s, At, e, t + i, It)) - : n.push(s, p.glyphLoader(o, s)); - } - return n; - }, - }; - function Ft(e) { - (this.font = e), - (this.getCommands = function (e) { - return Dt.getPath(e).commands; - }), - (this._fpgmState = this._prepState = void 0), - (this._errorState = 0); - } - function Ut(e) { - return e; - } - function Nt(e) { - return Math.sign(e) * Math.round(Math.abs(e)); - } - function Bt(e) { - return (Math.sign(e) * Math.round(Math.abs(2 * e))) / 2; - } - function Gt(e) { - return Math.sign(e) * (Math.round(Math.abs(e) + 0.5) - 0.5); - } - function Vt(e) { - return Math.sign(e) * Math.ceil(Math.abs(e)); - } - function zt(e) { - return Math.sign(e) * Math.floor(Math.abs(e)); - } - function Ht(e) { - var t = this.srPeriod, - r = this.srPhase, - o = 1; - return ( - e < 0 && ((e = -e), (o = -1)), - (e += this.srThreshold - r), - (e = Math.trunc(e / t) * t), - (e += r) < 0 ? r * o : e * o - ); - } - var x = { - x: 1, - y: 0, - axis: "x", - distance: function (e, t, r, o) { - return (r ? e.xo : e.x) - (o ? t.xo : t.x); - }, - interpolate: function (e, t, r, o) { - var n, s, i, a, l, u, c; - if (!o || o === this) - return ( - (n = e.xo - t.xo), - (s = e.xo - r.xo), - (l = t.x - t.xo), - (u = r.x - r.xo), - 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) - ? void (e.x = e.xo + (l + u) / 2) - : void (e.x = e.xo + (l * a + u * i) / c) - ); - (n = o.distance(e, t, !0, !0)), - (s = o.distance(e, r, !0, !0)), - (l = o.distance(t, t, !1, !0)), - (u = o.distance(r, r, !1, !0)), - 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) - ? x.setRelative(e, e, (l + u) / 2, o, !0) - : x.setRelative(e, e, (l * a + u * i) / c, o, !0); - }, - normalSlope: Number.NEGATIVE_INFINITY, - setRelative: function (e, t, r, o, n) { - var s, i; - o && o !== this - ? ((s = n ? t.xo : t.x), - (i = n ? t.yo : t.y), - (s += r * o.x), - (i += r * o.y), - (e.x = s + (e.y - i) / o.normalSlope)) - : (e.x = (n ? t.xo : t.x) + r); - }, - slope: 0, - touch: function (e) { - e.xTouched = !0; - }, - touched: function (e) { - return e.xTouched; - }, - untouch: function (e) { - e.xTouched = !1; - }, - }, - T = { - x: 0, - y: 1, - axis: "y", - distance: function (e, t, r, o) { - return (r ? e.yo : e.y) - (o ? t.yo : t.y); - }, - interpolate: function (e, t, r, o) { - var n, s, i, a, l, u, c; - if (!o || o === this) - return ( - (n = e.yo - t.yo), - (s = e.yo - r.yo), - (l = t.y - t.yo), - (u = r.y - r.yo), - 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) - ? void (e.y = e.yo + (l + u) / 2) - : void (e.y = e.yo + (l * a + u * i) / c) - ); - (n = o.distance(e, t, !0, !0)), - (s = o.distance(e, r, !0, !0)), - (l = o.distance(t, t, !1, !0)), - (u = o.distance(r, r, !1, !0)), - 0 === (c = (i = Math.abs(n)) + (a = Math.abs(s))) - ? T.setRelative(e, e, (l + u) / 2, o, !0) - : T.setRelative(e, e, (l * a + u * i) / c, o, !0); - }, - normalSlope: 0, - setRelative: function (e, t, r, o, n) { - var s, i; - o && o !== this - ? ((s = n ? t.xo : t.x), - (i = n ? t.yo : t.y), - (s += r * o.x), - (i += r * o.y), - (e.y = i + o.normalSlope * (e.x - s))) - : (e.y = (n ? t.yo : t.y) + r); - }, - slope: Number.POSITIVE_INFINITY, - touch: function (e) { - e.yTouched = !0; - }, - touched: function (e) { - return e.yTouched; - }, - untouch: function (e) { - e.yTouched = !1; - }, - }; - function Wt(e, t) { - (this.x = e), - (this.y = t), - (this.axis = void 0), - (this.slope = t / e), - (this.normalSlope = -e / t), - Object.freeze(this); - } - function qt(e, t) { - var r = Math.sqrt(e * e + t * t); - return ( - (t /= r), - 1 === (e /= r) && 0 === t - ? x - : 0 === e && 1 === t - ? T - : new Wt(e, t) - ); - } - function M(e, t, r, o) { - (this.x = this.xo = Math.round(64 * e) / 64), - (this.y = this.yo = Math.round(64 * t) / 64), - (this.lastPointOfContour = r), - (this.onCurve = o), - (this.prevPointOnContour = void 0), - (this.nextPointOnContour = void 0), - (this.xTouched = !1), - (this.yTouched = !1), - Object.preventExtensions(this); - } - Object.freeze(x), - Object.freeze(T), - (Wt.prototype.distance = function (e, t, r, o) { - return ( - this.x * x.distance(e, t, r, o) + - this.y * T.distance(e, t, r, o) - ); - }), - (Wt.prototype.interpolate = function (e, t, r, o) { - var n = o.distance(e, t, !0, !0), - s = o.distance(e, r, !0, !0), - t = o.distance(t, t, !1, !0), - r = o.distance(r, r, !1, !0), - n = Math.abs(n), - s = Math.abs(s), - i = n + s; - 0 === i - ? this.setRelative(e, e, (t + r) / 2, o, !0) - : this.setRelative(e, e, (t * s + r * n) / i, o, !0); - }), - (Wt.prototype.setRelative = function (e, t, r, o, n) { - var s = n ? t.xo : t.x, - n = n ? t.yo : t.y, - t = s + r * (o = o || this).x, - s = n + r * o.y, - n = o.normalSlope, - r = this.slope, - o = e.x, - i = e.y; - (e.x = (r * o - n * t + s - i) / (r - n)), - (e.y = r * (e.x - o) + i); - }), - (Wt.prototype.touch = function (e) { - (e.xTouched = !0), (e.yTouched = !0); - }), - (M.prototype.nextTouched = function (e) { - for ( - var t = this.nextPointOnContour; - !e.touched(t) && t !== this; - - ) - t = t.nextPointOnContour; - return t; - }), - (M.prototype.prevTouched = function (e) { - for ( - var t = this.prevPointOnContour; - !e.touched(t) && t !== this; - - ) - t = t.prevPointOnContour; - return t; - }); - var Xt = Object.freeze(new M(0, 0)), - Yt = { - cvCutIn: 17 / 16, - deltaBase: 9, - deltaShift: 0.125, - loop: 1, - minDis: 1, - autoFlip: !0, - }; - function E(e, t) { - switch ( - ((this.env = e), (this.stack = []), (this.prog = t), e) - ) { - case "glyf": - (this.zp0 = this.zp1 = this.zp2 = 1), - (this.rp0 = this.rp1 = this.rp2 = 0); - case "prep": - (this.fv = this.pv = this.dpv = x), (this.round = Nt); - } - } - function Zt(e) { - for ( - var t = (e.tZone = new Array(e.gZone.length)), r = 0; - r < t.length; - r++ - ) - t[r] = new M(0, 0); - } - function Qt(e, t) { - var r, - o = e.prog, - n = e.ip, - s = 1; - do { - if (88 === (r = o[++n])) s++; - else if (89 === r) s--; - else if (64 === r) n += o[n + 1] + 1; - else if (65 === r) n += 2 * o[n + 1] + 1; - else if (176 <= r && r <= 183) n += r - 176 + 1; - else if (184 <= r && r <= 191) n += 2 * (r - 184 + 1); - else if (t && 1 === s && 27 === r) break; - } while (0 < s); - e.ip = n; - } - function Jt(e, t) { - j.DEBUG && console.log(t.step, "SVTCA[" + e.axis + "]"), - (t.fv = t.pv = t.dpv = e); - } - function Kt(e, t) { - j.DEBUG && console.log(t.step, "SPVTCA[" + e.axis + "]"), - (t.pv = t.dpv = e); - } - function $t(e, t) { - j.DEBUG && console.log(t.step, "SFVTCA[" + e.axis + "]"), - (t.fv = e); - } - function er(e, t) { - var r, - o = t.stack, - n = o.pop(), - o = o.pop(), - s = t.z2[n], - i = t.z1[o]; - j.DEBUG && console.log("SPVTL[" + e + "]", n, o), - (n = e - ? ((r = s.y - i.y), i.x - s.x) - : ((r = i.x - s.x), i.y - s.y)), - (t.pv = t.dpv = qt(r, n)); - } - function tr(e, t) { - var r, - o = t.stack, - n = o.pop(), - o = o.pop(), - s = t.z2[n], - i = t.z1[o]; - j.DEBUG && console.log("SFVTL[" + e + "]", n, o), - (n = e - ? ((r = s.y - i.y), i.x - s.x) - : ((r = i.x - s.x), i.y - s.y)), - (t.fv = qt(r, n)); - } - function rr(e) { - j.DEBUG && console.log(e.step, "POP[]"), e.stack.pop(); - } - function or(e, t) { - var r = t.stack.pop(), - o = t.z0[r], - n = t.fv, - s = t.pv, - i = - (j.DEBUG && console.log(t.step, "MDAP[" + e + "]", r), - s.distance(o, Xt)); - e && (i = t.round(i)), - n.setRelative(o, Xt, i, s), - n.touch(o), - (t.rp0 = t.rp1 = r); - } - function nr(e, t) { - var r, - o, - n, - s = t.z2, - i = s.length - 2; - j.DEBUG && console.log(t.step, "IUP[" + e.axis + "]"); - for (var a = 0; a < i; a++) - (r = s[a]), - e.touched(r) || - ((o = r.prevTouched(e)) !== r && - (o === (n = r.nextTouched(e)) && - e.setRelative( - r, - r, - e.distance(o, o, !1, !0), - e, - !0, - ), - e.interpolate(r, o, n, e))); - } - function sr(e, t) { - for ( - var r = t.stack, - o = e ? t.rp1 : t.rp2, - n = (e ? t.z0 : t.z1)[o], - s = t.fv, - i = t.pv, - a = t.loop, - l = t.z2; - a--; - - ) { - var u = r.pop(), - c = l[u], - d = i.distance(n, n, !1, !0); - s.setRelative(c, c, d, i), - s.touch(c), - j.DEBUG && - console.log( - t.step, - (1 < t.loop ? "loop " + (t.loop - a) + ": " : "") + - "SHP[" + - (e ? "rp1" : "rp2") + - "]", - u, - ); - } - t.loop = 1; - } - function ir(e, t) { - for ( - var r = t.stack, - o = e ? t.rp1 : t.rp2, - n = (e ? t.z0 : t.z1)[o], - s = t.fv, - i = t.pv, - o = r.pop(), - a = t.z2[t.contours[o]], - l = a, - u = - (j.DEBUG && console.log(t.step, "SHC[" + e + "]", o), - i.distance(n, n, !1, !0)); - l !== n && s.setRelative(l, l, u, i), - (l = l.nextPointOnContour) !== a; - - ); - } - function ar(e, t) { - var r, - o, - n = t.stack, - s = e ? t.rp1 : t.rp2, - s = (e ? t.z0 : t.z1)[s], - i = t.fv, - a = t.pv, - n = n.pop(); - switch ( - (j.DEBUG && console.log(t.step, "SHZ[" + e + "]", n), n) - ) { - case 0: - r = t.tZone; - break; - case 1: - r = t.gZone; - break; - default: - throw new Error("Invalid zone"); - } - for ( - var l = a.distance(s, s, !1, !0), u = r.length - 2, c = 0; - c < u; - c++ - ) - (o = r[c]), i.setRelative(o, o, l, a); - } - function lr(e, t) { - var r = t.stack, - o = r.pop() / 64, - r = r.pop(), - n = t.z1[r], - s = t.z0[t.rp0], - i = t.fv, - a = t.pv; - i.setRelative(n, s, o, a), - i.touch(n), - j.DEBUG && console.log(t.step, "MSIRP[" + e + "]", o, r), - (t.rp1 = t.rp0), - (t.rp2 = r), - e && (t.rp0 = r); - } - function ur(e, t) { - var r = t.stack, - o = r.pop(), - r = r.pop(), - n = t.z0[r], - s = t.fv, - i = t.pv, - a = t.cvt[o], - o = - (j.DEBUG && - console.log( - t.step, - "MIAP[" + e + "]", - o, - "(", - a, - ")", - r, - ), - i.distance(n, Xt)); - e && - (Math.abs(o - a) < t.cvCutIn && (o = a), (o = t.round(o))), - s.setRelative(n, Xt, o, i), - 0 === t.zp0 && ((n.xo = n.x), (n.yo = n.y)), - s.touch(n), - (t.rp0 = t.rp1 = r); - } - function cr(e, t) { - var r = t.stack, - o = r.pop(), - n = t.z2[o]; - j.DEBUG && console.log(t.step, "GC[" + e + "]", o), - r.push(64 * t.dpv.distance(n, Xt, e, !1)); - } - function dr(e, t) { - var r = t.stack, - o = r.pop(), - r = r.pop(), - n = t.z1[o], - s = t.z0[r], - s = t.dpv.distance(s, n, e, e); - j.DEBUG && - console.log(t.step, "MD[" + e + "]", o, r, "->", s), - t.stack.push(Math.round(64 * s)); - } - function hr(e, t) { - var r = t.stack, - o = r.pop(), - n = t.fv, - s = t.pv, - i = t.ppem, - a = t.deltaBase + 16 * (e - 1), - l = t.deltaShift, - u = t.z0; - j.DEBUG && console.log(t.step, "DELTAP[" + e + "]", o, r); - for (var c = 0; c < o; c++) { - var d = r.pop(), - h = r.pop(); - a + ((240 & h) >> 4) === i && - (0 <= (h = (15 & h) - 8) && h++, - j.DEBUG && - console.log(t.step, "DELTAPFIX", d, "by", h * l), - (d = u[d]), - n.setRelative(d, d, h * l, s)); - } - } - function fr(e, t) { - var r = t.stack, - o = r.pop(); - j.DEBUG && console.log(t.step, "ROUND[]"), - r.push(64 * t.round(o / 64)); - } - function pr(e, t) { - var r = t.stack, - o = r.pop(), - n = t.ppem, - s = t.deltaBase + 16 * (e - 1), - i = t.deltaShift; - j.DEBUG && console.log(t.step, "DELTAC[" + e + "]", o, r); - for (var a = 0; a < o; a++) { - var l = r.pop(), - u = r.pop(); - s + ((240 & u) >> 4) === n && - (0 <= (u = (15 & u) - 8) && u++, - (u = u * i), - j.DEBUG && console.log(t.step, "DELTACFIX", l, "by", u), - (t.cvt[l] += u)); - } - } - function mr(e, t) { - var r, - o = t.stack, - n = o.pop(), - o = o.pop(), - s = t.z2[n], - i = t.z1[o]; - j.DEBUG && console.log(t.step, "SDPVTL[" + e + "]", n, o), - (n = e - ? ((r = s.y - i.y), i.x - s.x) - : ((r = i.x - s.x), i.y - s.y)), - (t.dpv = qt(r, n)); - } - function k(e, t) { - var r = t.stack, - o = t.prog, - n = t.ip; - j.DEBUG && console.log(t.step, "PUSHB[" + e + "]"); - for (var s = 0; s < e; s++) r.push(o[++n]); - t.ip = n; - } - function C(e, t) { - var r = t.ip, - o = t.prog, - n = t.stack; - j.DEBUG && console.log(t.ip, "PUSHW[" + e + "]"); - for (var s = 0; s < e; s++) { - var i = (o[++r] << 8) | o[++r]; - 32768 & i && (i = -(1 + (65535 ^ i))), n.push(i); - } - t.ip = r; - } - function O(e, t, r, o, n, s) { - var i, - a, - l = s.stack, - u = e && l.pop(), - l = l.pop(), - c = s.rp0, - c = s.z0[c], - d = s.z1[l], - h = s.minDis, - f = s.fv, - p = s.dpv, - m = (i = p.distance(d, c, !0, !0)), - y = 0 <= m ? 1 : -1; - (m = Math.abs(m)), - e && - ((a = s.cvt[u]), - o && Math.abs(m - a) < s.cvCutIn && (m = a)), - r && m < h && (m = h), - o && (m = s.round(m)), - f.setRelative(d, c, y * m, p), - f.touch(d), - j.DEBUG && - console.log( - s.step, - (e ? "MIRP[" : "MDRP[") + - (t ? "M" : "m") + - (r ? ">" : "_") + - (o ? "R" : "_") + - (0 === n - ? "Gr" - : 1 === n - ? "Bl" - : 2 === n - ? "Wh" - : "") + - "]", - e ? u + "(" + s.cvt[u] + "," + a + ")" : "", - l, - "(d =", - i, - "->", - y * m, - ")", - ), - (s.rp1 = s.rp0), - (s.rp2 = l), - t && (s.rp0 = l); - } - Ft.prototype.exec = function (e, t) { - if ("number" != typeof t) - throw new Error("Point size is not a number!"); - if (!(2 < this._errorState)) { - var r = this.font, - o = this._prepState; - if (!o || o.ppem !== t) { - var n = this._fpgmState; - if (!n) { - (E.prototype = Yt), - ((n = this._fpgmState = - new E("fpgm", r.tables.fpgm)).funcs = []), - (n.font = r), - j.DEBUG && - (console.log("---EXEC FPGM---"), (n.step = -1)); - try { - vr(n); - } catch (e) { - return ( - console.log("Hinting error in FPGM:" + e), - void (this._errorState = 3) - ); - } - } - (E.prototype = n), - ((o = this._prepState = - new E("prep", r.tables.prep)).ppem = t); - var s = r.tables.cvt; - if (s) - for ( - var i = (o.cvt = new Array(s.length)), - a = t / r.unitsPerEm, - l = 0; - l < s.length; - l++ - ) - i[l] = s[l] * a; - else o.cvt = []; - j.DEBUG && - (console.log("---EXEC PREP---"), (o.step = -1)); - try { - vr(o); - } catch (e) { - this._errorState < 2 && - console.log("Hinting error in PREP:" + e), - (this._errorState = 2); - } - } - if (!(1 < this._errorState)) - try { - return yr(e, o); - } catch (e) { - this._errorState < 1 && - (console.log("Hinting error:" + e), - console.log( - "Note: further hinting errors are silenced", - )), - (this._errorState = 1); - } - } - }; - var yr = function (e, t) { - var r = t.ppem / t.font.unitsPerEm, - o = r, - n = e.components; - if (((E.prototype = t), n)) { - for ( - var s = t.font, i = [], a = [], l = 0; - l < n.length; - l++ - ) { - var u = n[l], - c = s.glyphs.get(u.glyphIndex), - d = new E("glyf", c.instructions); - j.DEBUG && - (console.log("---EXEC COMP " + l + "---"), - (d.step = -1)), - gr(c, d, r, o); - for ( - var h = Math.round(u.dx * r), - f = Math.round(u.dy * o), - p = d.gZone, - m = d.contours, - y = 0; - y < p.length; - y++ - ) { - var g = p[y]; - (g.xTouched = g.yTouched = !1), - (g.xo = g.x = g.x + h), - (g.yo = g.y = g.y + f); - } - var v = i.length; - i.push.apply(i, p); - for (var b = 0; b < m.length; b++) a.push(m[b] + v); - } - e.instructions && - !d.inhibitGridFit && - (((d = new E("glyf", e.instructions)).gZone = - d.z0 = - d.z1 = - d.z2 = - i), - (d.contours = a), - i.push( - new M(0, 0), - new M(Math.round(e.advanceWidth * r), 0), - ), - j.DEBUG && - (console.log("---EXEC COMPOSITE---"), (d.step = -1)), - vr(d), - (i.length -= 2)); - } else - (d = new E("glyf", e.instructions)), - j.DEBUG && - (console.log("---EXEC GLYPH---"), (d.step = -1)), - gr(e, d, r, o), - (i = d.gZone); - return i; - }, - gr = function (e, t, r, o) { - for ( - var n, - s, - i, - a = e.points || [], - l = a.length, - u = (t.gZone = t.z0 = t.z1 = t.z2 = []), - c = (t.contours = []), - d = 0; - d < l; - d++ - ) - (n = a[d]), - (u[d] = new M( - n.x * r, - n.y * o, - n.lastPointOfContour, - n.onCurve, - )); - for (var h = 0; h < l; h++) - (n = u[h]), - s || ((s = n), c.push(h)), - n.lastPointOfContour - ? (((n.nextPointOnContour = s).prevPointOnContour = - n), - (s = void 0)) - : ((i = u[h + 1]), - ((n.nextPointOnContour = i).prevPointOnContour = - n)); - if (!t.inhibitGridFit) { - if (j.DEBUG) { - console.log("PROCESSING GLYPH", t.stack); - for (var f = 0; f < l; f++) - console.log(f, u[f].x, u[f].y); - } - if ( - (u.push( - new M(0, 0), - new M(Math.round(e.advanceWidth * r), 0), - ), - vr(t), - (u.length -= 2), - j.DEBUG) - ) { - console.log("FINISHED GLYPH", t.stack); - for (var p = 0; p < l; p++) - console.log(p, u[p].x, u[p].y); - } - } - }, - vr = function (e) { - var t = e.prog; - if (t) { - var r, - o = t.length; - for (e.ip = 0; e.ip < o; e.ip++) { - if ((j.DEBUG && e.step++, !(r = br[t[e.ip]]))) - throw new Error( - "unknown instruction: 0x" + - Number(t[e.ip]).toString(16), - ); - r(e); - } - } - }, - br = [ - Jt.bind(void 0, T), - Jt.bind(void 0, x), - Kt.bind(void 0, T), - Kt.bind(void 0, x), - $t.bind(void 0, T), - $t.bind(void 0, x), - er.bind(void 0, 0), - er.bind(void 0, 1), - tr.bind(void 0, 0), - tr.bind(void 0, 1), - function (e) { - var t = (r = e.stack).pop(), - r = r.pop(); - j.DEBUG && console.log(e.step, "SPVFS[]", t, r), - (e.pv = e.dpv = qt(r, t)); - }, - function (e) { - var t = (r = e.stack).pop(), - r = r.pop(); - j.DEBUG && console.log(e.step, "SPVFS[]", t, r), - (e.fv = qt(r, t)); - }, - function (e) { - var t = e.stack, - r = e.pv; - j.DEBUG && console.log(e.step, "GPV[]"), - t.push(16384 * r.x), - t.push(16384 * r.y); - }, - function (e) { - var t = e.stack, - r = e.fv; - j.DEBUG && console.log(e.step, "GFV[]"), - t.push(16384 * r.x), - t.push(16384 * r.y); - }, - function (e) { - (e.fv = e.pv), j.DEBUG && console.log(e.step, "SFVTPV[]"); - }, - function (e) { - var t = (s = e.stack).pop(), - r = s.pop(), - o = s.pop(), - n = s.pop(), - s = s.pop(), - i = e.z0, - a = e.z1, - l = i[t], - i = i[r], - u = a[o], - a = a[n], - e = e.z2[s], - t = - (j.DEBUG && console.log("ISECT[], ", t, r, o, n, s), - l.x), - r = l.y, - o = i.x, - n = i.y, - s = u.x, - l = u.y, - i = a.x, - u = a.y, - a = (t - o) * (l - u) - (r - n) * (s - i), - c = t * n - r * o, - d = s * u - l * i; - (e.x = (c * (s - i) - d * (t - o)) / a), - (e.y = (c * (l - u) - d * (r - n)) / a); - }, - function (e) { - (e.rp0 = e.stack.pop()), - j.DEBUG && console.log(e.step, "SRP0[]", e.rp0); - }, - function (e) { - (e.rp1 = e.stack.pop()), - j.DEBUG && console.log(e.step, "SRP1[]", e.rp1); - }, - function (e) { - (e.rp2 = e.stack.pop()), - j.DEBUG && console.log(e.step, "SRP2[]", e.rp2); - }, - function (e) { - var t = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "SZP0[]", t), - (e.zp0 = t)) - ) { - case 0: - e.tZone || Zt(e), (e.z0 = e.tZone); - break; - case 1: - e.z0 = e.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - }, - function (e) { - var t = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "SZP1[]", t), - (e.zp1 = t)) - ) { - case 0: - e.tZone || Zt(e), (e.z1 = e.tZone); - break; - case 1: - e.z1 = e.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - }, - function (e) { - var t = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "SZP2[]", t), - (e.zp2 = t)) - ) { - case 0: - e.tZone || Zt(e), (e.z2 = e.tZone); - break; - case 1: - e.z2 = e.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - }, - function (e) { - var t = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "SZPS[]", t), - (e.zp0 = e.zp1 = e.zp2 = t)) - ) { - case 0: - e.tZone || Zt(e), (e.z0 = e.z1 = e.z2 = e.tZone); - break; - case 1: - e.z0 = e.z1 = e.z2 = e.gZone; - break; - default: - throw new Error("Invalid zone pointer"); - } - }, - function (e) { - (e.loop = e.stack.pop()), - j.DEBUG && console.log(e.step, "SLOOP[]", e.loop); - }, - function (e) { - j.DEBUG && console.log(e.step, "RTG[]"), (e.round = Nt); - }, - function (e) { - j.DEBUG && console.log(e.step, "RTHG[]"), (e.round = Gt); - }, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "SMD[]", t), - (e.minDis = t / 64); - }, - function (e) { - j.DEBUG && console.log(e.step, "ELSE[]"), Qt(e, !1); - }, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "JMPR[]", t), - (e.ip += t - 1); - }, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "SCVTCI[]", t), - (e.cvCutIn = t / 64); - }, - void 0, - void 0, - function (e) { - var t = e.stack; - j.DEBUG && console.log(e.step, "DUP[]"), - t.push(t[t.length - 1]); - }, - rr, - function (e) { - j.DEBUG && console.log(e.step, "CLEAR[]"), - (e.stack.length = 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "SWAP[]"), - t.push(r), - t.push(o); - }, - function (e) { - var t = e.stack; - j.DEBUG && console.log(e.step, "DEPTH[]"), - t.push(t.length); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "CINDEX[]", r), - t.push(t[t.length - r]); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "MINDEX[]", r), - t.push(t.splice(t.length - r, 1)[0]); - }, - void 0, - void 0, - void 0, - function (e) { - var t = (o = e.stack).pop(), - r = o.pop(), - o = - (j.DEBUG && console.log(e.step, "LOOPCALL[]", t, r), - e.ip), - n = e.prog; - e.prog = e.funcs[t]; - for (var s = 0; s < r; s++) - vr(e), - j.DEBUG && - console.log( - ++e.step, - s + 1 < r ? "next loopcall" : "done loopcall", - s, - ); - (e.ip = o), (e.prog = n); - }, - function (e) { - var t = e.stack.pop(), - r = (j.DEBUG && console.log(e.step, "CALL[]", t), e.ip), - o = e.prog; - (e.prog = e.funcs[t]), - vr(e), - (e.ip = r), - (e.prog = o), - j.DEBUG && console.log(++e.step, "returning from", t); - }, - function (e) { - if ("fpgm" !== e.env) - throw new Error("FDEF not allowed here"); - var t = e.stack, - r = e.prog, - o = e.ip, - t = t.pop(), - n = o; - for ( - j.DEBUG && console.log(e.step, "FDEF[]", t); - 45 !== r[++o]; - - ); - (e.ip = o), (e.funcs[t] = r.slice(n + 1, o)); - }, - void 0, - or.bind(void 0, 0), - or.bind(void 0, 1), - nr.bind(void 0, T), - nr.bind(void 0, x), - sr.bind(void 0, 0), - sr.bind(void 0, 1), - ir.bind(void 0, 0), - ir.bind(void 0, 1), - ar.bind(void 0, 0), - ar.bind(void 0, 1), - function (e) { - for ( - var t = e.stack, - r = e.loop, - o = e.fv, - n = t.pop() / 64, - s = e.z2; - r--; - - ) { - var i = t.pop(), - a = s[i]; - j.DEBUG && - console.log( - e.step, - (1 < e.loop ? "loop " + (e.loop - r) + ": " : "") + - "SHPIX[]", - i, - n, - ), - o.setRelative(a, a, n), - o.touch(a); - } - e.loop = 1; - }, - function (e) { - for ( - var t = e.stack, - r = e.rp1, - o = e.rp2, - n = e.loop, - s = e.z0[r], - i = e.z1[o], - a = e.fv, - l = e.dpv, - u = e.z2; - n--; - - ) { - var c = t.pop(), - d = u[c]; - j.DEBUG && - console.log( - e.step, - (1 < e.loop ? "loop " + (e.loop - n) + ": " : "") + - "IP[]", - c, - r, - "<->", - o, - ), - a.interpolate(d, s, i, l), - a.touch(d); - } - e.loop = 1; - }, - lr.bind(void 0, 0), - lr.bind(void 0, 1), - function (e) { - for ( - var t = e.stack, - r = e.rp0, - o = e.z0[r], - n = e.loop, - s = e.fv, - i = e.pv, - a = e.z1; - n--; - - ) { - var l = t.pop(), - u = a[l]; - j.DEBUG && - console.log( - e.step, - (1 < e.loop ? "loop " + (e.loop - n) + ": " : "") + - "ALIGNRP[]", - l, - ), - s.setRelative(u, o, 0, i), - s.touch(u); - } - e.loop = 1; - }, - function (e) { - j.DEBUG && console.log(e.step, "RTDG[]"), (e.round = Bt); - }, - ur.bind(void 0, 0), - ur.bind(void 0, 1), - function (e) { - var t = e.prog, - r = e.ip, - o = e.stack, - n = t[++r]; - j.DEBUG && console.log(e.step, "NPUSHB[]", n); - for (var s = 0; s < n; s++) o.push(t[++r]); - e.ip = r; - }, - function (e) { - var t = e.ip, - r = e.prog, - o = e.stack, - n = r[++t]; - j.DEBUG && console.log(e.step, "NPUSHW[]", n); - for (var s = 0; s < n; s++) { - var i = (r[++t] << 8) | r[++t]; - 32768 & i && (i = -(1 + (65535 ^ i))), o.push(i); - } - e.ip = t; - }, - function (e) { - var t = e.stack, - r = (r = e.store) || (e.store = []), - o = t.pop(), - t = t.pop(); - j.DEBUG && console.log(e.step, "WS", o, t), (r[t] = o); - }, - function (e) { - var t = e.stack, - r = e.store, - o = t.pop(), - e = - (j.DEBUG && console.log(e.step, "RS", o), - (r && r[o]) || 0); - t.push(e); - }, - function (e) { - var t = (r = e.stack).pop(), - r = r.pop(); - j.DEBUG && console.log(e.step, "WCVTP", t, r), - (e.cvt[r] = t / 64); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "RCVT", r), - t.push(64 * e.cvt[r]); - }, - cr.bind(void 0, 0), - cr.bind(void 0, 1), - void 0, - dr.bind(void 0, 0), - dr.bind(void 0, 1), - function (e) { - j.DEBUG && console.log(e.step, "MPPEM[]"), - e.stack.push(e.ppem); - }, - void 0, - function (e) { - j.DEBUG && console.log(e.step, "FLIPON[]"), - (e.autoFlip = !0); - }, - void 0, - void 0, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "LT[]", r, o), - t.push(o < r ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "LTEQ[]", r, o), - t.push(o <= r ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "GT[]", r, o), - t.push(r < o ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "GTEQ[]", r, o), - t.push(r <= o ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "EQ[]", r, o), - t.push(r === o ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "NEQ[]", r, o), - t.push(r !== o ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "ODD[]", r), - t.push(Math.trunc(r) % 2 ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "EVEN[]", r), - t.push(Math.trunc(r) % 2 ? 0 : 1); - }, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "IF[]", t), - t || - (Qt(e, !0), j.DEBUG && console.log(e.step, "EIF[]")); - }, - function (e) { - j.DEBUG && console.log(e.step, "EIF[]"); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "AND[]", r, o), - t.push(r && o ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "OR[]", r, o), - t.push(r || o ? 1 : 0); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "NOT[]", r), - t.push(r ? 0 : 1); - }, - hr.bind(void 0, 1), - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "SDB[]", t), - (e.deltaBase = t); - }, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "SDS[]", t), - (e.deltaShift = Math.pow(0.5, t)); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "ADD[]", r, o), - t.push(o + r); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "SUB[]", r, o), - t.push(o - r); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "DIV[]", r, o), - t.push((64 * o) / r); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "MUL[]", r, o), - t.push((o * r) / 64); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "ABS[]", r), - t.push(Math.abs(r)); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "NEG[]", r), t.push(-r); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "FLOOR[]", r), - t.push(64 * Math.floor(r / 64)); - }, - function (e) { - var t = e.stack, - r = t.pop(); - j.DEBUG && console.log(e.step, "CEILING[]", r), - t.push(64 * Math.ceil(r / 64)); - }, - fr.bind(void 0, 0), - fr.bind(void 0, 1), - fr.bind(void 0, 2), - fr.bind(void 0, 3), - void 0, - void 0, - void 0, - void 0, - function (e) { - var t = (r = e.stack).pop(), - r = r.pop(); - j.DEBUG && console.log(e.step, "WCVTF[]", t, r), - (e.cvt[r] = (t * e.ppem) / e.font.unitsPerEm); - }, - hr.bind(void 0, 2), - hr.bind(void 0, 3), - pr.bind(void 0, 1), - pr.bind(void 0, 2), - pr.bind(void 0, 3), - function (e) { - var t, - r = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "SROUND[]", r), - (e.round = Ht), - 192 & r) - ) { - case 0: - t = 0.5; - break; - case 64: - t = 1; - break; - case 128: - t = 2; - break; - default: - throw new Error("invalid SROUND value"); - } - switch (((e.srPeriod = t), 48 & r)) { - case 0: - e.srPhase = 0; - break; - case 16: - e.srPhase = 0.25 * t; - break; - case 32: - e.srPhase = 0.5 * t; - break; - case 48: - e.srPhase = 0.75 * t; - break; - default: - throw new Error("invalid SROUND value"); - } - e.srThreshold = 0 === (r &= 15) ? 0 : (r / 8 - 0.5) * t; - }, - function (e) { - var t, - r = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "S45ROUND[]", r), - (e.round = Ht), - 192 & r) - ) { - case 0: - t = Math.sqrt(2) / 2; - break; - case 64: - t = Math.sqrt(2); - break; - case 128: - t = 2 * Math.sqrt(2); - break; - default: - throw new Error("invalid S45ROUND value"); - } - switch (((e.srPeriod = t), 48 & r)) { - case 0: - e.srPhase = 0; - break; - case 16: - e.srPhase = 0.25 * t; - break; - case 32: - e.srPhase = 0.5 * t; - break; - case 48: - e.srPhase = 0.75 * t; - break; - default: - throw new Error("invalid S45ROUND value"); - } - e.srThreshold = 0 === (r &= 15) ? 0 : (r / 8 - 0.5) * t; - }, - void 0, - void 0, - function (e) { - j.DEBUG && console.log(e.step, "ROFF[]"), (e.round = Ut); - }, - void 0, - function (e) { - j.DEBUG && console.log(e.step, "RUTG[]"), (e.round = Vt); - }, - function (e) { - j.DEBUG && console.log(e.step, "RDTG[]"), (e.round = zt); - }, - rr, - rr, - void 0, - void 0, - void 0, - void 0, - void 0, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "SCANCTRL[]", t); - }, - mr.bind(void 0, 0), - mr.bind(void 0, 1), - function (e) { - var t = e.stack, - r = t.pop(), - o = 0; - j.DEBUG && console.log(e.step, "GETINFO[]", r), - 1 & r && (o = 35), - 32 & r && (o |= 4096), - t.push(o); - }, - void 0, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(), - n = t.pop(); - j.DEBUG && console.log(e.step, "ROLL[]"), - t.push(o), - t.push(r), - t.push(n); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "MAX[]", r, o), - t.push(Math.max(o, r)); - }, - function (e) { - var t = e.stack, - r = t.pop(), - o = t.pop(); - j.DEBUG && console.log(e.step, "MIN[]", r, o), - t.push(Math.min(o, r)); - }, - function (e) { - var t = e.stack.pop(); - j.DEBUG && console.log(e.step, "SCANTYPE[]", t); - }, - function (e) { - var t = e.stack.pop(), - r = e.stack.pop(); - switch ( - (j.DEBUG && console.log(e.step, "INSTCTRL[]", t, r), t) - ) { - case 1: - return void (e.inhibitGridFit = !!r); - case 2: - return void (e.ignoreCvt = !!r); - default: - throw new Error("invalid INSTCTRL[] selector"); - } - }, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - void 0, - k.bind(void 0, 1), - k.bind(void 0, 2), - k.bind(void 0, 3), - k.bind(void 0, 4), - k.bind(void 0, 5), - k.bind(void 0, 6), - k.bind(void 0, 7), - k.bind(void 0, 8), - C.bind(void 0, 1), - C.bind(void 0, 2), - C.bind(void 0, 3), - C.bind(void 0, 4), - C.bind(void 0, 5), - C.bind(void 0, 6), - C.bind(void 0, 7), - C.bind(void 0, 8), - O.bind(void 0, 0, 0, 0, 0, 0), - O.bind(void 0, 0, 0, 0, 0, 1), - O.bind(void 0, 0, 0, 0, 0, 2), - O.bind(void 0, 0, 0, 0, 0, 3), - O.bind(void 0, 0, 0, 0, 1, 0), - O.bind(void 0, 0, 0, 0, 1, 1), - O.bind(void 0, 0, 0, 0, 1, 2), - O.bind(void 0, 0, 0, 0, 1, 3), - O.bind(void 0, 0, 0, 1, 0, 0), - O.bind(void 0, 0, 0, 1, 0, 1), - O.bind(void 0, 0, 0, 1, 0, 2), - O.bind(void 0, 0, 0, 1, 0, 3), - O.bind(void 0, 0, 0, 1, 1, 0), - O.bind(void 0, 0, 0, 1, 1, 1), - O.bind(void 0, 0, 0, 1, 1, 2), - O.bind(void 0, 0, 0, 1, 1, 3), - O.bind(void 0, 0, 1, 0, 0, 0), - O.bind(void 0, 0, 1, 0, 0, 1), - O.bind(void 0, 0, 1, 0, 0, 2), - O.bind(void 0, 0, 1, 0, 0, 3), - O.bind(void 0, 0, 1, 0, 1, 0), - O.bind(void 0, 0, 1, 0, 1, 1), - O.bind(void 0, 0, 1, 0, 1, 2), - O.bind(void 0, 0, 1, 0, 1, 3), - O.bind(void 0, 0, 1, 1, 0, 0), - O.bind(void 0, 0, 1, 1, 0, 1), - O.bind(void 0, 0, 1, 1, 0, 2), - O.bind(void 0, 0, 1, 1, 0, 3), - O.bind(void 0, 0, 1, 1, 1, 0), - O.bind(void 0, 0, 1, 1, 1, 1), - O.bind(void 0, 0, 1, 1, 1, 2), - O.bind(void 0, 0, 1, 1, 1, 3), - O.bind(void 0, 1, 0, 0, 0, 0), - O.bind(void 0, 1, 0, 0, 0, 1), - O.bind(void 0, 1, 0, 0, 0, 2), - O.bind(void 0, 1, 0, 0, 0, 3), - O.bind(void 0, 1, 0, 0, 1, 0), - O.bind(void 0, 1, 0, 0, 1, 1), - O.bind(void 0, 1, 0, 0, 1, 2), - O.bind(void 0, 1, 0, 0, 1, 3), - O.bind(void 0, 1, 0, 1, 0, 0), - O.bind(void 0, 1, 0, 1, 0, 1), - O.bind(void 0, 1, 0, 1, 0, 2), - O.bind(void 0, 1, 0, 1, 0, 3), - O.bind(void 0, 1, 0, 1, 1, 0), - O.bind(void 0, 1, 0, 1, 1, 1), - O.bind(void 0, 1, 0, 1, 1, 2), - O.bind(void 0, 1, 0, 1, 1, 3), - O.bind(void 0, 1, 1, 0, 0, 0), - O.bind(void 0, 1, 1, 0, 0, 1), - O.bind(void 0, 1, 1, 0, 0, 2), - O.bind(void 0, 1, 1, 0, 0, 3), - O.bind(void 0, 1, 1, 0, 1, 0), - O.bind(void 0, 1, 1, 0, 1, 1), - O.bind(void 0, 1, 1, 0, 1, 2), - O.bind(void 0, 1, 1, 0, 1, 3), - O.bind(void 0, 1, 1, 1, 0, 0), - O.bind(void 0, 1, 1, 1, 0, 1), - O.bind(void 0, 1, 1, 1, 0, 2), - O.bind(void 0, 1, 1, 1, 0, 3), - O.bind(void 0, 1, 1, 1, 1, 0), - O.bind(void 0, 1, 1, 1, 1, 1), - O.bind(void 0, 1, 1, 1, 1, 2), - O.bind(void 0, 1, 1, 1, 1, 3), - ], - jr = - Array.from || - function (e) { - return ( - e.match( - /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g, - ) || [] - ); - }; - function P(e) { - (e = e || {}).empty || - (_( - e.familyName, - "When creating a new Font object, familyName is required.", - ), - _( - e.styleName, - "When creating a new Font object, styleName is required.", - ), - _( - e.unitsPerEm, - "When creating a new Font object, unitsPerEm is required.", - ), - _( - e.ascender, - "When creating a new Font object, ascender is required.", - ), - _( - e.descender, - "When creating a new Font object, descender is required.", - ), - _( - e.descender < 0, - "Descender should be negative (e.g. -512).", - ), - (this.names = { - fontFamily: { en: e.familyName || " " }, - fontSubfamily: { en: e.styleName || " " }, - fullName: { - en: e.fullName || e.familyName + " " + e.styleName, - }, - postScriptName: { - en: - e.postScriptName || - (e.familyName + e.styleName).replace(/\s/g, ""), - }, - designer: { en: e.designer || " " }, - designerURL: { en: e.designerURL || " " }, - manufacturer: { en: e.manufacturer || " " }, - manufacturerURL: { en: e.manufacturerURL || " " }, - license: { en: e.license || " " }, - licenseURL: { en: e.licenseURL || " " }, - version: { en: e.version || "Version 0.1" }, - description: { en: e.description || " " }, - copyright: { en: e.copyright || " " }, - trademark: { en: e.trademark || " " }, - }), - (this.unitsPerEm = e.unitsPerEm || 1e3), - (this.ascender = e.ascender), - (this.descender = e.descender), - (this.createdTimestamp = e.createdTimestamp), - (this.tables = { - os2: { - usWeightClass: - e.weightClass || this.usWeightClasses.MEDIUM, - usWidthClass: - e.widthClass || this.usWidthClasses.MEDIUM, - fsSelection: - e.fsSelection || this.fsSelectionValues.REGULAR, - }, - })), - (this.supported = !0), - (this.glyphs = new p.GlyphSet(this, e.glyphs || [])), - (this.encoding = new Ee(this)), - (this.position = new kt(this)), - (this.substitution = new i(this)), - (this.tables = this.tables || {}), - Object.defineProperty(this, "hinting", { - get: function () { - return ( - this._hinting || - ("truetype" === this.outlinesFormat - ? (this._hinting = new Ft(this)) - : void 0) - ); - }, - }); - } - function _r(e, t) { - var r, - o = JSON.stringify(e), - n = 256; - for (r in t) { - var s = parseInt(r); - if (s && !(s < 256)) { - if (JSON.stringify(t[r]) === o) return s; - n <= s && (n = s + 1); - } - } - return (t[n] = e), n; - } - (P.prototype.hasChar = function (e) { - return null !== this.encoding.charToGlyphIndex(e); - }), - (P.prototype.charToGlyphIndex = function (e) { - return this.encoding.charToGlyphIndex(e); - }), - (P.prototype.charToGlyph = function (e) { - e = this.charToGlyphIndex(e); - return this.glyphs.get(e) || this.glyphs.get(0); - }), - (P.prototype.stringToGlyphs = function (e, t) { - t = t || this.defaultRenderOptions; - for (var r = jr(e), o = [], n = 0; n < r.length; n += 1) { - var s = r[n]; - o.push(this.charToGlyphIndex(s)); - } - var i = o.length; - if (t.features) { - var e = - t.script || this.substitution.getDefaultScriptName(), - a = []; - t.features.liga && - (a = a.concat( - this.substitution.getFeature("liga", e, t.language), - )), - t.features.rlig && - (a = a.concat( - this.substitution.getFeature("rlig", e, t.language), - )); - for (var l = 0; l < i; l += 1) - for (var u = 0; u < a.length; u++) { - for ( - var c = a[u], d = c.sub, h = d.length, f = 0; - f < h && d[f] === o[l + f]; - - ) - f++; - f === h && (o.splice(l, h, c.by), (i = i - h + 1)); - } - } - for ( - var p = new Array(i), m = this.glyphs.get(0), y = 0; - y < i; - y += 1 - ) - p[y] = this.glyphs.get(o[y]) || m; - return p; - }), - (P.prototype.nameToGlyphIndex = function (e) { - return this.glyphNames.nameToGlyphIndex(e); - }), - (P.prototype.nameToGlyph = function (e) { - e = this.nameToGlyphIndex(e); - return this.glyphs.get(e) || this.glyphs.get(0); - }), - (P.prototype.glyphIndexToName = function (e) { - return this.glyphNames.glyphIndexToName - ? this.glyphNames.glyphIndexToName(e) - : ""; - }), - (P.prototype.getKerningValue = function (e, t) { - (e = e.index || e), (t = t.index || t); - var r = this.position.defaultKerningTables; - return r - ? this.position.getKerningValue(r, e, t) - : this.kerningPairs[e + "," + t] || 0; - }), - (P.prototype.defaultRenderOptions = { - kerning: !0, - features: { liga: !0, rlig: !0 }, - }), - (P.prototype.forEachGlyph = function (e, t, r, o, n, s) { - (t = void 0 !== t ? t : 0), - (r = void 0 !== r ? r : 0), - (n = n || this.defaultRenderOptions); - var i, - a = (1 / this.unitsPerEm) * (o = void 0 !== o ? o : 72), - l = this.stringToGlyphs(e, n); - n.kerning && - ((e = n.script || this.position.getDefaultScriptName()), - (i = this.position.getKerningTables(e, n.language))); - for (var u = 0; u < l.length; u += 1) { - var c = l[u]; - s.call(this, c, t, r, o, n), - c.advanceWidth && (t += c.advanceWidth * a), - n.kerning && - u < l.length - 1 && - (t += - (i - ? this.position.getKerningValue( - i, - c.index, - l[u + 1].index, - ) - : this.getKerningValue(c, l[u + 1])) * a), - n.letterSpacing - ? (t += n.letterSpacing * o) - : n.tracking && (t += (n.tracking / 1e3) * o); - } - return t; - }), - (P.prototype.getPath = function (e, t, r, o, n) { - var s = new h(); - return ( - this.forEachGlyph(e, t, r, o, n, function (e, t, r, o) { - e = e.getPath(t, r, o, n, this); - s.extend(e); - }), - s - ); - }), - (P.prototype.getPaths = function (e, t, r, o, n) { - var s = []; - return ( - this.forEachGlyph(e, t, r, o, n, function (e, t, r, o) { - e = e.getPath(t, r, o, n, this); - s.push(e); - }), - s - ); - }), - (P.prototype.getAdvanceWidth = function (e, t, r) { - return this.forEachGlyph(e, 0, 0, t, r, function () {}); - }), - (P.prototype.draw = function (e, t, r, o, n, s) { - this.getPath(t, r, o, n, s).draw(e); - }), - (P.prototype.drawPoints = function (n, e, t, r, o, s) { - this.forEachGlyph(e, t, r, o, s, function (e, t, r, o) { - e.drawPoints(n, t, r, o); - }); - }), - (P.prototype.drawMetrics = function (n, e, t, r, o, s) { - this.forEachGlyph(e, t, r, o, s, function (e, t, r, o) { - e.drawMetrics(n, t, r, o); - }); - }), - (P.prototype.getEnglishName = function (e) { - e = this.names[e]; - if (e) return e.en; - }), - (P.prototype.validate = function () { - var t = this; - function e(e) { - e = t.getEnglishName(e); - e && e.trim().length; - } - e("fontFamily"), - e("weightName"), - e("manufacturer"), - e("copyright"), - e("version"), - this.unitsPerEm; - }), - (P.prototype.toTables = function () { - return wt.fontToTable(this); - }), - (P.prototype.toBuffer = function () { - return ( - console.warn( - "Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.", - ), - this.toArrayBuffer() - ); - }), - (P.prototype.toArrayBuffer = function () { - for ( - var e = this.toTables().encode(), - t = new ArrayBuffer(e.length), - r = new Uint8Array(t), - o = 0; - o < e.length; - o++ - ) - r[o] = e[o]; - return t; - }), - (P.prototype.download = function (t) { - var e = this.getEnglishName("fontFamily"), - r = this.getEnglishName("fontSubfamily"), - o = - ((t = t || e.replace(/\s/g, "") + "-" + r + ".otf"), - this.toArrayBuffer()); - "undefined" != typeof window - ? ((window.requestFileSystem = - window.requestFileSystem || - window.webkitRequestFileSystem), - window.requestFileSystem( - window.TEMPORARY, - o.byteLength, - function (e) { - e.root.getFile(t, { create: !0 }, function (r) { - r.createWriter(function (e) { - var t = new DataView(o), - t = new Blob([t], { type: "font/opentype" }); - e.write(t), - e.addEventListener( - "writeend", - function () { - location.href = r.toURL(); - }, - !1, - ); - }); - }); - }, - function (e) { - throw new Error(e.name + ": " + e.message); - }, - )) - : ((e = Ar("fs")), - (r = (function (e) { - for ( - var t = new Pr(e.byteLength), - r = new Uint8Array(e), - o = 0; - o < t.length; - ++o - ) - t[o] = r[o]; - return t; - })(o)), - e.writeFileSync(t, r)); - }), - (P.prototype.fsSelectionValues = { - ITALIC: 1, - UNDERSCORE: 2, - NEGATIVE: 4, - OUTLINED: 8, - STRIKEOUT: 16, - BOLD: 32, - REGULAR: 64, - USER_TYPO_METRICS: 128, - WWS: 256, - OBLIQUE: 512, - }), - (P.prototype.usWidthClasses = { - ULTRA_CONDENSED: 1, - EXTRA_CONDENSED: 2, - CONDENSED: 3, - SEMI_CONDENSED: 4, - MEDIUM: 5, - SEMI_EXPANDED: 6, - EXPANDED: 7, - EXTRA_EXPANDED: 8, - ULTRA_EXPANDED: 9, - }), - (P.prototype.usWeightClasses = { - THIN: 100, - EXTRA_LIGHT: 200, - LIGHT: 300, - NORMAL: 400, - MEDIUM: 500, - SEMI_BOLD: 600, - BOLD: 700, - EXTRA_BOLD: 800, - BLACK: 900, - }); - var xr = { - make: function (e, t) { - var r = new S.Table("fvar", [ - { name: "version", type: "ULONG", value: 65536 }, - { name: "offsetToData", type: "USHORT", value: 0 }, - { name: "countSizePairs", type: "USHORT", value: 2 }, - { - name: "axisCount", - type: "USHORT", - value: e.axes.length, - }, - { name: "axisSize", type: "USHORT", value: 20 }, - { - name: "instanceCount", - type: "USHORT", - value: e.instances.length, - }, - { - name: "instanceSize", - type: "USHORT", - value: 4 + 4 * e.axes.length, - }, - ]); - r.offsetToData = r.sizeOf(); - for (var o, n, s, i = 0; i < e.axes.length; i++) - r.fields = r.fields.concat( - ((o = i), - (n = e.axes[i]), - (s = t), - (s = _r(n.name, t)), - [ - { name: "tag_" + o, type: "TAG", value: n.tag }, - { - name: "minValue_" + o, - type: "FIXED", - value: n.minValue << 16, - }, - { - name: "defaultValue_" + o, - type: "FIXED", - value: n.defaultValue << 16, - }, - { - name: "maxValue_" + o, - type: "FIXED", - value: n.maxValue << 16, - }, - { name: "flags_" + o, type: "USHORT", value: 0 }, - { name: "nameID_" + o, type: "USHORT", value: s }, - ]), - ); - for (var a = 0; a < e.instances.length; a++) - r.fields = r.fields.concat( - (function (e, t, r, o) { - for ( - var n = [ - { - name: "nameID_" + e, - type: "USHORT", - value: _r(t.name, o), - }, - { - name: "flags_" + e, - type: "USHORT", - value: 0, - }, - ], - s = 0; - s < r.length; - ++s - ) { - var i = r[s].tag; - n.push({ - name: "axis_" + e + " " + i, - type: "FIXED", - value: t.coordinates[i] << 16, - }); - } - return n; - })(a, e.instances[a], e.axes, t), - ); - return r; - }, - parse: function (e, t, r) { - for ( - var o, - n, - s, - i, - a = new R.Parser(e, t), - l = a.parseULong(), - u = - (L.argument( - 65536 === l, - "Unsupported fvar table version.", - ), - a.parseOffset16()), - c = (a.skip("uShort", 1), a.parseUShort()), - d = a.parseUShort(), - h = a.parseUShort(), - f = a.parseUShort(), - p = [], - m = 0; - m < c; - m++ - ) - p.push( - ((o = e), - (n = t + u + m * d), - (s = r), - void 0, - (i = {}), - (o = new R.Parser(o, n)), - (i.tag = o.parseTag()), - (i.minValue = o.parseFixed()), - (i.defaultValue = o.parseFixed()), - (i.maxValue = o.parseFixed()), - o.skip("uShort", 1), - (i.name = s[o.parseUShort()] || {}), - i), - ); - for (var y = [], g = t + u + c * d, v = 0; v < h; v++) - y.push( - (function (e, t, r, o) { - var n = {}, - s = new R.Parser(e, t); - (n.name = o[s.parseUShort()] || {}), - s.skip("uShort", 1), - (n.coordinates = {}); - for (var i = 0; i < r.length; ++i) - n.coordinates[r[i].tag] = s.parseFixed(); - return n; - })(e, g + v * f, p, r), - ); - return { axes: p, instances: y }; - }, - }, - A = new Array(10); - (A[1] = function () { - var e = this.offset + this.relativeOffset, - t = this.parseUShort(); - return 1 === t - ? { - posFormat: 1, - coverage: this.parsePointer(u.coverage), - value: this.parseValueRecord(), - } - : 2 === t - ? { - posFormat: 2, - coverage: this.parsePointer(u.coverage), - values: this.parseValueRecordList(), - } - : void L.assert( - !1, - "0x" + - e.toString(16) + - ": GPOS lookup type 1 format must be 1 or 2.", - ); - }), - (A[2] = function () { - var e, - t, - r, - o, - n = this.offset + this.relativeOffset, - s = this.parseUShort(), - n = - (L.assert( - 1 === s || 2 === s, - "0x" + - n.toString(16) + - ": GPOS lookup type 2 format must be 1 or 2.", - ), - this.parsePointer(u.coverage)), - i = this.parseUShort(), - a = this.parseUShort(); - return 1 === s - ? { - posFormat: s, - coverage: n, - valueFormat1: i, - valueFormat2: a, - pairSets: this.parseList( - u.pointer( - u.list(function () { - return { - secondGlyph: this.parseUShort(), - value1: this.parseValueRecord(i), - value2: this.parseValueRecord(a), - }; - }), - ), - ), - } - : 2 === s - ? ((e = this.parsePointer(u.classDef)), - (t = this.parsePointer(u.classDef)), - (r = this.parseUShort()), - (o = this.parseUShort()), - { - posFormat: s, - coverage: n, - valueFormat1: i, - valueFormat2: a, - classDef1: e, - classDef2: t, - class1Count: r, - class2Count: o, - classRecords: this.parseList( - r, - u.list(o, function () { - return { - value1: this.parseValueRecord(i), - value2: this.parseValueRecord(a), - }; - }), - ), - }) - : void 0; - }), - (A[3] = function () { - return { error: "GPOS Lookup 3 not supported" }; - }), - (A[4] = function () { - return { error: "GPOS Lookup 4 not supported" }; - }), - (A[5] = function () { - return { error: "GPOS Lookup 5 not supported" }; - }), - (A[6] = function () { - return { error: "GPOS Lookup 6 not supported" }; - }), - (A[7] = function () { - return { error: "GPOS Lookup 7 not supported" }; - }), - (A[8] = function () { - return { error: "GPOS Lookup 8 not supported" }; - }), - (A[9] = function () { - return { error: "GPOS Lookup 9 not supported" }; - }); - var wr = new Array(10); - var Sr = { - parse: function (e, t) { - return ( - (t = (e = new u(e, (t = t || 0))).parseVersion(1)), - L.argument( - 1 === t || 1.1 === t, - "Unsupported GPOS table version " + t, - ), - 1 === t - ? { - version: t, - scripts: e.parseScriptList(), - features: e.parseFeatureList(), - lookups: e.parseLookupList(A), - } - : { - version: t, - scripts: e.parseScriptList(), - features: e.parseFeatureList(), - lookups: e.parseLookupList(A), - variations: e.parseFeatureVariationsList(), - } - ); - }, - make: function (e) { - return new S.Table("GPOS", [ - { name: "version", type: "ULONG", value: 65536 }, - { - name: "scripts", - type: "TABLE", - value: new S.ScriptList(e.scripts), - }, - { - name: "features", - type: "TABLE", - value: new S.FeatureList(e.features), - }, - { - name: "lookups", - type: "TABLE", - value: new S.LookupList(e.lookups, wr), - }, - ]); - }, - }; - var Tr = { - parse: function (e, t) { - if ( - ((e = new R.Parser(e, t)), 0 === (t = e.parseUShort())) - ) { - var r = e, - o = {}, - n = (r.skip("uShort"), r.parseUShort()), - s = - (L.argument( - 0 === n, - "Unsupported kern sub-table version.", - ), - r.skip("uShort", 2), - r.parseUShort()); - r.skip("uShort", 3); - for (var i = 0; i < s; i += 1) { - var a = r.parseUShort(), - l = r.parseUShort(), - u = r.parseShort(); - o[a + "," + l] = u; - } - return o; - } - if (1 !== t) - throw new Error( - "Unsupported kern table version (" + t + ").", - ); - var c = e, - d = {}, - n = - (c.skip("uShort"), - 1 < c.parseULong() && - console.warn( - "Only the first kern subtable is supported.", - ), - c.skip("uLong"), - 255 & c.parseUShort()); - if ((c.skip("uShort"), 0 == n)) { - var h = c.parseUShort(); - c.skip("uShort", 3); - for (var f = 0; f < h; f += 1) { - var p = c.parseUShort(), - m = c.parseUShort(), - y = c.parseShort(); - d[p + "," + m] = y; - } - } - return d; - }, - }; - var Mr = { - parse: function (e, t, r, o) { - for ( - var n = new R.Parser(e, t), - s = o ? n.parseUShort : n.parseULong, - i = [], - a = 0; - a < r + 1; - a += 1 - ) { - var l = s.call(n); - o && (l *= 2), i.push(l); - } - return i; - }, - }; - function Er(e, r) { - Ar("fs").readFile(e, function (e, t) { - if (e) return r(e.message); - r(null, Ot(t)); - }); - } - function kr(e, t) { - var r = new XMLHttpRequest(); - r.open("get", e, !0), - (r.responseType = "arraybuffer"), - (r.onload = function () { - return r.response - ? t(null, r.response) - : t("Font could not be loaded: " + r.statusText); - }), - (r.onerror = function () { - t("Font could not be loaded"); - }), - r.send(); - } - function Cr(e, t) { - for (var r = [], o = 12, n = 0; n < t; n += 1) { - var s = R.getTag(e, o), - i = R.getULong(e, o + 4), - a = R.getULong(e, o + 8), - l = R.getULong(e, o + 12); - r.push({ - tag: s, - checksum: i, - offset: a, - length: l, - compression: !1, - }), - (o += 16); - } - return r; - } - function I(e, t) { - if ("WOFF" !== t.compression) - return { data: e, offset: t.offset }; - var e = new Uint8Array( - e.buffer, - t.offset + 2, - t.compressedLength - 2, - ), - r = new Uint8Array(t.length); - if ((re(e, r), r.byteLength !== t.length)) - throw new Error( - "Decompression error: " + - t.tag + - " decompressed length doesn't match recorded length", - ); - return { data: new DataView(r.buffer, 0), offset: 0 }; - } - function Or(e) { - var t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - d, - h, - f, - p, - m = new P({ empty: !0 }), - y = new DataView(e, 0), - g = [], - e = R.getTag(y, 0); - if ( - e === String.fromCharCode(0, 1, 0, 0) || - "true" === e || - "typ1" === e - ) - (m.outlinesFormat = "truetype"), - (g = Cr(y, (o = R.getUShort(y, 4)))); - else if ("OTTO" === e) - (m.outlinesFormat = "cff"), - (g = Cr(y, (o = R.getUShort(y, 4)))); - else { - if ("wOFF" !== e) - throw new Error("Unsupported OpenType signature " + e); - var v = R.getTag(y, 4); - if (v === String.fromCharCode(0, 1, 0, 0)) - m.outlinesFormat = "truetype"; - else { - if ("OTTO" !== v) - throw new Error("Unsupported OpenType flavor " + e); - m.outlinesFormat = "cff"; - } - g = (function (e, t) { - for (var r = [], o = 44, n = 0; n < t; n += 1) { - var s = R.getTag(e, o), - i = R.getULong(e, o + 4), - a = R.getULong(e, o + 8), - l = R.getULong(e, o + 12), - u = void 0, - u = a < l && "WOFF"; - r.push({ - tag: s, - offset: i, - compression: u, - compressedLength: a, - length: l, - }), - (o += 20); - } - return r; - })(y, (o = R.getUShort(y, 12))); - } - for (var b = 0; b < o; b += 1) { - var j = g[b], - _ = void 0; - switch (j.tag) { - case "cmap": - (_ = I(y, j)), - (m.tables.cmap = we.parse(_.data, _.offset)), - (m.encoding = new ke(m.tables.cmap)); - break; - case "cvt ": - (_ = I(y, j)), - (p = new R.Parser(_.data, _.offset)), - (m.tables.cvt = p.parseShortList(j.length / 2)); - break; - case "fvar": - s = j; - break; - case "fpgm": - (_ = I(y, j)), - (p = new R.Parser(_.data, _.offset)), - (m.tables.fpgm = p.parseByteList(j.length)); - break; - case "head": - (_ = I(y, j)), - (m.tables.head = Ze.parse(_.data, _.offset)), - (m.unitsPerEm = m.tables.head.unitsPerEm), - (t = m.tables.head.indexToLocFormat); - break; - case "hhea": - (_ = I(y, j)), - (m.tables.hhea = Qe.parse(_.data, _.offset)), - (m.ascender = m.tables.hhea.ascender), - (m.descender = m.tables.hhea.descender), - (m.numberOfHMetrics = m.tables.hhea.numberOfHMetrics); - break; - case "hmtx": - u = j; - break; - case "ltag": - (_ = I(y, j)), (r = Ke.parse(_.data, _.offset)); - break; - case "maxp": - (_ = I(y, j)), - (m.tables.maxp = $e.parse(_.data, _.offset)), - (m.numGlyphs = m.tables.maxp.numGlyphs); - break; - case "name": - h = j; - break; - case "OS/2": - (_ = I(y, j)), - (m.tables.os2 = ft.parse(_.data, _.offset)); - break; - case "post": - (_ = I(y, j)), - (m.tables.post = pt.parse(_.data, _.offset)), - (m.glyphNames = new Oe(m.tables.post)); - break; - case "prep": - (_ = I(y, j)), - (p = new R.Parser(_.data, _.offset)), - (m.tables.prep = p.parseByteList(j.length)); - break; - case "glyf": - i = j; - break; - case "loca": - d = j; - break; - case "CFF ": - n = j; - break; - case "kern": - c = j; - break; - case "GPOS": - a = j; - break; - case "GSUB": - l = j; - break; - case "meta": - f = j; - } - } - v = I(y, h); - if ( - ((m.tables.name = dt.parse(v.data, v.offset, r)), - (m.names = m.tables.name), - i && d) - ) { - (e = 0 === t), - (v = I(y, d)), - (v = Mr.parse(v.data, v.offset, m.numGlyphs, e)), - (e = I(y, i)); - m.glyphs = Dt.parse(e.data, e.offset, v, m); - } else { - if (!n) - throw new Error( - "Font doesn't contain TrueType or CFF outlines.", - ); - e = I(y, n); - Ye.parse(e.data, e.offset, m); - } - for ( - var v = I(y, u), - x = - (Je.parse( - v.data, - v.offset, - m.numberOfHMetrics, - m.numGlyphs, - m.glyphs, - ), - m), - w = x.tables.cmap.glyphIndexMap, - S = Object.keys(w), - T = 0; - T < S.length; - T += 1 - ) { - var M, - E = S[T], - k = w[E]; - (M = x.glyphs.get(k)).addUnicode(parseInt(E)); - } - for (var C = 0; C < x.glyphs.length; C += 1) - (M = x.glyphs.get(C)), - x.cffEncoding - ? x.isCIDFont - ? (M.name = "gid" + C) - : (M.name = x.cffEncoding.charset[C]) - : x.glyphNames.names && - (M.name = x.glyphNames.glyphIndexToName(C)); - return ( - c - ? ((e = I(y, c)), - (m.kerningPairs = Tr.parse(e.data, e.offset))) - : (m.kerningPairs = {}), - a && - ((v = I(y, a)), - (m.tables.gpos = Sr.parse(v.data, v.offset)), - m.position.init()), - l && - ((e = I(y, l)), - (m.tables.gsub = yt.parse(e.data, e.offset))), - s && - ((v = I(y, s)), - (m.tables.fvar = xr.parse(v.data, v.offset, m.names))), - f && - ((e = I(y, f)), - (m.tables.meta = gt.parse(e.data, e.offset)), - (m.metas = m.tables.meta)), - m - ); - } - (j.Font = P), - (j.Glyph = f), - (j.Path = h), - (j.BoundingBox = a), - (j._parse = R), - (j.parse = Or), - (j.load = function (e, o) { - ("undefined" == typeof window ? Er : kr)( - e, - function (e, t) { - if (e) return o(e); - var r; - try { - r = Or(t); - } catch (e) { - return o(e, null); - } - return o(null, r); - }, - ); - }), - (j.loadSync = function (e) { - return Or(Ot(Ar("fs").readFileSync(e))); - }), - Object.defineProperty(j, "__esModule", { value: !0 }); - }), - "object" == typeof o && void 0 !== r - ? t(o) - : "function" == typeof s && s.amd - ? s(["exports"], t) - : t((e.opentype = {})); - }.call(this, Ar("buffer").Buffer); - }, - { buffer: 4, fs: 2 }, - ], - 250: [ - function (e, t, u) { - !function (n) { - function s(e, t) { - for (var r = 0, o = e.length - 1; 0 <= o; o--) { - var n = e[o]; - "." === n - ? e.splice(o, 1) - : ".." === n - ? (e.splice(o, 1), r++) - : r && (e.splice(o, 1), r--); - } - if (t) for (; r--; ) e.unshift(".."); - return e; - } - function i(e, t) { - if (e.filter) return e.filter(t); - for (var r = [], o = 0; o < e.length; o++) - t(e[o], o, e) && r.push(e[o]); - return r; - } - (u.resolve = function () { - for ( - var e = "", t = !1, r = arguments.length - 1; - -1 <= r && !t; - r-- - ) { - var o = 0 <= r ? arguments[r] : n.cwd(); - if ("string" != typeof o) - throw new TypeError( - "Arguments to path.resolve must be strings", - ); - o && ((e = o + "/" + e), (t = "/" === o.charAt(0))); - } - return ( - (t ? "/" : "") + - (e = s( - i(e.split("/"), function (e) { - return !!e; - }), - !t, - ).join("/")) || "." - ); - }), - (u.normalize = function (e) { - var t = u.isAbsolute(e), - r = "/" === o(e, -1); - return ( - (e = - (e = s( - i(e.split("/"), function (e) { - return !!e; - }), - !t, - ).join("/")) || t - ? e - : ".") && - r && - (e += "/"), - (t ? "/" : "") + e - ); - }), - (u.isAbsolute = function (e) { - return "/" === e.charAt(0); - }), - (u.join = function () { - var e = Array.prototype.slice.call(arguments, 0); - return u.normalize( - i(e, function (e, t) { - if ("string" != typeof e) - throw new TypeError( - "Arguments to path.join must be strings", - ); - return e; - }).join("/"), - ); - }), - (u.relative = function (e, t) { - function r(e) { - for (var t = 0; t < e.length && "" === e[t]; t++); - for (var r = e.length - 1; 0 <= r && "" === e[r]; r--); - return r < t ? [] : e.slice(t, r - t + 1); - } - (e = u.resolve(e).substr(1)), (t = u.resolve(t).substr(1)); - for ( - var o = r(e.split("/")), - n = r(t.split("/")), - s = Math.min(o.length, n.length), - i = s, - a = 0; - a < s; - a++ - ) - if (o[a] !== n[a]) { - i = a; - break; - } - for (var l = [], a = i; a < o.length; a++) l.push(".."); - return (l = l.concat(n.slice(i))).join("/"); - }), - (u.sep = "/"), - (u.delimiter = ":"), - (u.dirname = function (e) { - if (("string" != typeof e && (e += ""), 0 === e.length)) - return "."; - for ( - var t = 47 === e.charCodeAt(0), - r = -1, - o = !0, - n = e.length - 1; - 1 <= n; - --n - ) - if (47 === e.charCodeAt(n)) { - if (!o) { - r = n; - break; - } - } else o = !1; - return -1 === r - ? t - ? "/" - : "." - : t && 1 === r - ? "/" - : e.slice(0, r); - }), - (u.basename = function (e, t) { - e = (function (e) { - "string" != typeof e && (e += ""); - for (var t = 0, r = -1, o = !0, n = e.length - 1; 0 <= n; --n) - if (47 === e.charCodeAt(n)) { - if (!o) { - t = n + 1; - break; - } - } else -1 === r && ((o = !1), (r = n + 1)); - return -1 === r ? "" : e.slice(t, r); - })(e); - return (e = - t && e.substr(-1 * t.length) === t - ? e.substr(0, e.length - t.length) - : e); - }), - (u.extname = function (e) { - "string" != typeof e && (e += ""); - for ( - var t = -1, r = 0, o = -1, n = !0, s = 0, i = e.length - 1; - 0 <= i; - --i - ) { - var a = e.charCodeAt(i); - if (47 === a) { - if (n) continue; - r = i + 1; - break; - } - -1 === o && ((n = !1), (o = i + 1)), - 46 === a - ? -1 === t - ? (t = i) - : 1 !== s && (s = 1) - : -1 !== t && (s = -1); - } - return -1 === t || - -1 === o || - 0 === s || - (1 === s && t === o - 1 && t === r + 1) - ? "" - : e.slice(t, o); - }); - var o = - "b" === "ab".substr(-1) - ? function (e, t, r) { - return e.substr(t, r); - } - : function (e, t, r) { - return t < 0 && (t = e.length + t), e.substr(t, r); - }; - }.call(this, e("_process")); - }, - { _process: 251 }, - ], - 251: [ - function (e, t, r) { - var o, - n, - t = (t.exports = {}); - function s() { - throw new Error("setTimeout has not been defined"); - } - function i() { - throw new Error("clearTimeout has not been defined"); - } - try { - o = "function" == typeof setTimeout ? setTimeout : s; - } catch (e) { - o = s; - } - try { - n = "function" == typeof clearTimeout ? clearTimeout : i; - } catch (e) { - n = i; - } - function a(t) { - if (o === setTimeout) return setTimeout(t, 0); - if ((o === s || !o) && setTimeout) return (o = setTimeout)(t, 0); - try { - return o(t, 0); - } catch (e) { - try { - return o.call(null, t, 0); - } catch (e) { - return o.call(this, t, 0); - } - } - } - var l, - u = [], - c = !1, - d = -1; - function h() { - c && - l && - ((c = !1), - l.length ? (u = l.concat(u)) : (d = -1), - u.length && f()); - } - function f() { - if (!c) { - for (var e = a(h), t = ((c = !0), u.length); t; ) { - for (l = u, u = []; ++d < t; ) l && l[d].run(); - (d = -1), (t = u.length); - } - (l = null), - (c = !1), - !(function (t) { - if (n === clearTimeout) return clearTimeout(t); - if ((n === i || !n) && clearTimeout) - return (n = clearTimeout)(t); - try { - n(t); - } catch (e) { - try { - return n.call(null, t); - } catch (e) { - return n.call(this, t); - } - } - })(e); - } - } - function p(e, t) { - (this.fun = e), (this.array = t); - } - function m() {} - (t.nextTick = function (e) { - var t = new Array(arguments.length - 1); - if (1 < arguments.length) - for (var r = 1; r < arguments.length; r++) - t[r - 1] = arguments[r]; - u.push(new p(e, t)), 1 !== u.length || c || a(f); - }), - (p.prototype.run = function () { - this.fun.apply(null, this.array); - }), - (t.title = "browser"), - (t.browser = !0), - (t.env = {}), - (t.argv = []), - (t.version = ""), - (t.versions = {}), - (t.on = m), - (t.addListener = m), - (t.once = m), - (t.off = m), - (t.removeListener = m), - (t.removeAllListeners = m), - (t.emit = m), - (t.prependListener = m), - (t.prependOnceListener = m), - (t.listeners = function (e) { - return []; - }), - (t.binding = function (e) { - throw new Error("process.binding is not supported"); - }), - (t.cwd = function () { - return "/"; - }), - (t.chdir = function (e) { - throw new Error("process.chdir is not supported"); - }), - (t.umask = function () { - return 0; - }); - }, - {}, - ], - 252: [ - function (e, t, r) { - t = (function (s) { - "use strict"; - var l, - e = Object.prototype, - u = e.hasOwnProperty, - t = "function" == typeof Symbol ? Symbol : {}, - o = t.iterator || "@@iterator", - r = t.asyncIterator || "@@asyncIterator", - n = t.toStringTag || "@@toStringTag"; - function i(e, t, r, o) { - var n, - s, - i, - a, - t = t && t.prototype instanceof y ? t : y, - t = Object.create(t.prototype), - o = new S(o || []); - return ( - (t._invoke = - ((n = e), - (s = r), - (i = o), - (a = d), - function (e, t) { - if (a === f) - throw new Error("Generator is already running"); - if (a === p) { - if ("throw" === e) throw t; - return M(); - } - for (i.method = e, i.arg = t; ; ) { - var r = i.delegate; - if (r) { - r = (function e(t, r) { - var o = t.iterator[r.method]; - if (o === l) { - if (((r.delegate = null), "throw" === r.method)) { - if ( - t.iterator.return && - ((r.method = "return"), - (r.arg = l), - e(t, r), - "throw" === r.method) - ) - return m; - (r.method = "throw"), - (r.arg = new TypeError( - "The iterator does not provide a 'throw' method", - )); - } - return m; - } - o = c(o, t.iterator, r.arg); - if ("throw" === o.type) - return ( - (r.method = "throw"), - (r.arg = o.arg), - (r.delegate = null), - m - ); - o = o.arg; - if (!o) - return ( - (r.method = "throw"), - (r.arg = new TypeError( - "iterator result is not an object", - )), - (r.delegate = null), - m - ); - { - if (!o.done) return o; - (r[t.resultName] = o.value), - (r.next = t.nextLoc), - "return" !== r.method && - ((r.method = "next"), (r.arg = l)); - } - r.delegate = null; - return m; - })(r, i); - if (r) { - if (r === m) continue; - return r; - } - } - if ("next" === i.method) i.sent = i._sent = i.arg; - else if ("throw" === i.method) { - if (a === d) throw ((a = p), i.arg); - i.dispatchException(i.arg); - } else "return" === i.method && i.abrupt("return", i.arg); - a = f; - r = c(n, s, i); - if ("normal" === r.type) { - if (((a = i.done ? p : h), r.arg !== m)) - return { value: r.arg, done: i.done }; - } else - "throw" === r.type && - ((a = p), (i.method = "throw"), (i.arg = r.arg)); - } - })), - t - ); - } - function c(e, t, r) { - try { - return { type: "normal", arg: e.call(t, r) }; - } catch (e) { - return { type: "throw", arg: e }; - } - } - s.wrap = i; - var d = "suspendedStart", - h = "suspendedYield", - f = "executing", - p = "completed", - m = {}; - function y() {} - function a() {} - function g() {} - var t = {}, - v = - ((t[o] = function () { - return this; - }), - Object.getPrototypeOf), - v = v && v(v(T([]))), - b = - (v && v !== e && u.call(v, o) && (t = v), - (g.prototype = y.prototype = Object.create(t))); - function j(e) { - ["next", "throw", "return"].forEach(function (t) { - e[t] = function (e) { - return this._invoke(t, e); - }; - }); - } - function _(i) { - var t; - this._invoke = function (r, o) { - function e() { - return new Promise(function (e, t) { - !(function t(e, r, o, n) { - var s, - e = c(i[e], i, r); - if ("throw" !== e.type) - return (r = (s = e.arg).value) && - "object" == typeof r && - u.call(r, "__await") - ? Promise.resolve(r.__await).then( - function (e) { - t("next", e, o, n); - }, - function (e) { - t("throw", e, o, n); - }, - ) - : Promise.resolve(r).then( - function (e) { - (s.value = e), o(s); - }, - function (e) { - return t("throw", e, o, n); - }, - ); - n(e.arg); - })(r, o, e, t); - }); - } - return (t = t ? t.then(e, e) : e()); - }; - } - function x(e) { - var t = { tryLoc: e[0] }; - 1 in e && (t.catchLoc = e[1]), - 2 in e && ((t.finallyLoc = e[2]), (t.afterLoc = e[3])), - this.tryEntries.push(t); - } - function w(e) { - var t = e.completion || {}; - (t.type = "normal"), delete t.arg, (e.completion = t); - } - function S(e) { - (this.tryEntries = [{ tryLoc: "root" }]), - e.forEach(x, this), - this.reset(!0); - } - function T(t) { - if (t) { - var r, - e = t[o]; - if (e) return e.call(t); - if ("function" == typeof t.next) return t; - if (!isNaN(t.length)) - return ( - (r = -1), - ((e = function e() { - for (; ++r < t.length; ) - if (u.call(t, r)) - return (e.value = t[r]), (e.done = !1), e; - return (e.value = l), (e.done = !0), e; - }).next = e) - ); - } - return { next: M }; - } - function M() { - return { value: l, done: !0 }; - } - return ( - ((a.prototype = b.constructor = g).constructor = a), - (g[n] = a.displayName = "GeneratorFunction"), - (s.isGeneratorFunction = function (e) { - e = "function" == typeof e && e.constructor; - return ( - !!e && - (e === a || "GeneratorFunction" === (e.displayName || e.name)) - ); - }), - (s.mark = function (e) { - return ( - Object.setPrototypeOf - ? Object.setPrototypeOf(e, g) - : ((e.__proto__ = g), - n in e || (e[n] = "GeneratorFunction")), - (e.prototype = Object.create(b)), - e - ); - }), - (s.awrap = function (e) { - return { __await: e }; - }), - j(_.prototype), - (_.prototype[r] = function () { - return this; - }), - (s.AsyncIterator = _), - (s.async = function (e, t, r, o) { - var n = new _(i(e, t, r, o)); - return s.isGeneratorFunction(t) - ? n - : n.next().then(function (e) { - return e.done ? e.value : n.next(); - }); - }), - j(b), - (b[n] = "Generator"), - (b[o] = function () { - return this; - }), - (b.toString = function () { - return "[object Generator]"; - }), - (s.keys = function (r) { - var e, - o = []; - for (e in r) o.push(e); - return ( - o.reverse(), - function e() { - for (; o.length; ) { - var t = o.pop(); - if (t in r) return (e.value = t), (e.done = !1), e; - } - return (e.done = !0), e; - } - ); - }), - (s.values = T), - (S.prototype = { - constructor: S, - reset: function (e) { - if ( - ((this.prev = 0), - (this.next = 0), - (this.sent = this._sent = l), - (this.done = !1), - (this.delegate = null), - (this.method = "next"), - (this.arg = l), - this.tryEntries.forEach(w), - !e) - ) - for (var t in this) - "t" === t.charAt(0) && - u.call(this, t) && - !isNaN(+t.slice(1)) && - (this[t] = l); - }, - stop: function () { - this.done = !0; - var e = this.tryEntries[0].completion; - if ("throw" === e.type) throw e.arg; - return this.rval; - }, - dispatchException: function (r) { - if (this.done) throw r; - var o = this; - function e(e, t) { - return ( - (s.type = "throw"), - (s.arg = r), - (o.next = e), - t && ((o.method = "next"), (o.arg = l)), - !!t - ); - } - for (var t = this.tryEntries.length - 1; 0 <= t; --t) { - var n = this.tryEntries[t], - s = n.completion; - if ("root" === n.tryLoc) return e("end"); - if (n.tryLoc <= this.prev) { - var i = u.call(n, "catchLoc"), - a = u.call(n, "finallyLoc"); - if (i && a) { - if (this.prev < n.catchLoc) return e(n.catchLoc, !0); - if (this.prev < n.finallyLoc) return e(n.finallyLoc); - } else if (i) { - if (this.prev < n.catchLoc) return e(n.catchLoc, !0); - } else { - if (!a) - throw new Error( - "try statement without catch or finally", - ); - if (this.prev < n.finallyLoc) return e(n.finallyLoc); - } - } - } - }, - abrupt: function (e, t) { - for (var r = this.tryEntries.length - 1; 0 <= r; --r) { - var o = this.tryEntries[r]; - if ( - o.tryLoc <= this.prev && - u.call(o, "finallyLoc") && - this.prev < o.finallyLoc - ) { - var n = o; - break; - } - } - var s = (n = - n && - ("break" === e || "continue" === e) && - n.tryLoc <= t && - t <= n.finallyLoc - ? null - : n) - ? n.completion - : {}; - return ( - (s.type = e), - (s.arg = t), - n - ? ((this.method = "next"), (this.next = n.finallyLoc), m) - : this.complete(s) - ); - }, - complete: function (e, t) { - if ("throw" === e.type) throw e.arg; - return ( - "break" === e.type || "continue" === e.type - ? (this.next = e.arg) - : "return" === e.type - ? ((this.rval = this.arg = e.arg), - (this.method = "return"), - (this.next = "end")) - : "normal" === e.type && t && (this.next = t), - m - ); - }, - finish: function (e) { - for (var t = this.tryEntries.length - 1; 0 <= t; --t) { - var r = this.tryEntries[t]; - if (r.finallyLoc === e) - return this.complete(r.completion, r.afterLoc), w(r), m; - } - }, - catch: function (e) { - for (var t = this.tryEntries.length - 1; 0 <= t; --t) { - var r, - o, - n = this.tryEntries[t]; - if (n.tryLoc === e) - return ( - "throw" === (r = n.completion).type && - ((o = r.arg), w(n)), - o - ); - } - throw new Error("illegal catch attempt"); - }, - delegateYield: function (e, t, r) { - return ( - (this.delegate = { - iterator: T(e), - resultName: t, - nextLoc: r, - }), - "next" === this.method && (this.arg = l), - m - ); - }, - }), - s - ); - })("object" == typeof t ? t.exports : {}); - try { - regeneratorRuntime = t; - } catch (e) { - Function("r", "regeneratorRuntime = r")(t); - } - }, - {}, - ], - 253: [ - function (e, t, r) { - !(function (e) { - "use strict"; - var t, r, i, o, n, s, a, l, u, c; - function d(e) { - if ( - ("string" != typeof e && (e = String(e)), - /[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e)) - ) - throw new TypeError("Invalid character in header field name"); - return e.toLowerCase(); - } - function h(e) { - return (e = "string" != typeof e ? String(e) : e); - } - function f(t) { - var e = { - next: function () { - var e = t.shift(); - return { done: void 0 === e, value: e }; - }, - }; - return ( - r && - (e[Symbol.iterator] = function () { - return e; - }), - e - ); - } - function p(t) { - (this.map = {}), - t instanceof p - ? t.forEach(function (e, t) { - this.append(t, e); - }, this) - : Array.isArray(t) - ? t.forEach(function (e) { - this.append(e[0], e[1]); - }, this) - : t && - Object.getOwnPropertyNames(t).forEach(function (e) { - this.append(e, t[e]); - }, this); - } - function m(e) { - if (e.bodyUsed) - return Promise.reject(new TypeError("Already read")); - e.bodyUsed = !0; - } - function y(r) { - return new Promise(function (e, t) { - (r.onload = function () { - e(r.result); - }), - (r.onerror = function () { - t(r.error); - }); - }); - } - function g(e) { - var t = new FileReader(), - r = y(t); - return t.readAsArrayBuffer(e), r; - } - function v(e) { - var t; - return e.slice - ? e.slice(0) - : ((t = new Uint8Array(e.byteLength)).set(new Uint8Array(e)), - t.buffer); - } - function b() { - return ( - (this.bodyUsed = !1), - (this._initBody = function (e) { - if ((this._bodyInit = e)) - if ("string" == typeof e) this._bodyText = e; - else if (i && Blob.prototype.isPrototypeOf(e)) - this._bodyBlob = e; - else if (o && FormData.prototype.isPrototypeOf(e)) - this._bodyFormData = e; - else if (t && URLSearchParams.prototype.isPrototypeOf(e)) - this._bodyText = e.toString(); - else if (n && i && a(e)) - (this._bodyArrayBuffer = v(e.buffer)), - (this._bodyInit = new Blob([this._bodyArrayBuffer])); - else { - if ( - !n || - (!ArrayBuffer.prototype.isPrototypeOf(e) && !l(e)) - ) - throw new Error("unsupported BodyInit type"); - this._bodyArrayBuffer = v(e); - } - else this._bodyText = ""; - this.headers.get("content-type") || - ("string" == typeof e - ? this.headers.set( - "content-type", - "text/plain;charset=UTF-8", - ) - : this._bodyBlob && this._bodyBlob.type - ? this.headers.set("content-type", this._bodyBlob.type) - : t && - URLSearchParams.prototype.isPrototypeOf(e) && - this.headers.set( - "content-type", - "application/x-www-form-urlencoded;charset=UTF-8", - )); - }), - i && - ((this.blob = function () { - var e = m(this); - if (e) return e; - if (this._bodyBlob) return Promise.resolve(this._bodyBlob); - if (this._bodyArrayBuffer) - return Promise.resolve(new Blob([this._bodyArrayBuffer])); - if (this._bodyFormData) - throw new Error("could not read FormData body as blob"); - return Promise.resolve(new Blob([this._bodyText])); - }), - (this.arrayBuffer = function () { - return this._bodyArrayBuffer - ? m(this) || Promise.resolve(this._bodyArrayBuffer) - : this.blob().then(g); - })), - (this.text = function () { - var e, - t, - r = m(this); - if (r) return r; - if (this._bodyBlob) - return ( - (r = this._bodyBlob), - (e = new FileReader()), - (t = y(e)), - e.readAsText(r), - t - ); - if (this._bodyArrayBuffer) - return Promise.resolve( - (function (e) { - for ( - var t = new Uint8Array(e), - r = new Array(t.length), - o = 0; - o < t.length; - o++ - ) - r[o] = String.fromCharCode(t[o]); - return r.join(""); - })(this._bodyArrayBuffer), - ); - if (this._bodyFormData) - throw new Error("could not read FormData body as text"); - return Promise.resolve(this._bodyText); - }), - o && - (this.formData = function () { - return this.text().then(_); - }), - (this.json = function () { - return this.text().then(JSON.parse); - }), - this - ); - } - function j(e, t) { - var r, - o = (t = t || {}).body; - if (e instanceof j) { - if (e.bodyUsed) throw new TypeError("Already read"); - (this.url = e.url), - (this.credentials = e.credentials), - t.headers || (this.headers = new p(e.headers)), - (this.method = e.method), - (this.mode = e.mode), - o || - null == e._bodyInit || - ((o = e._bodyInit), (e.bodyUsed = !0)); - } else this.url = String(e); - if ( - ((this.credentials = - t.credentials || this.credentials || "omit"), - (!t.headers && this.headers) || - (this.headers = new p(t.headers)), - (this.method = - ((e = t.method || this.method || "GET"), - (r = e.toUpperCase()), - -1 < u.indexOf(r) ? r : e)), - (this.mode = t.mode || this.mode || null), - (this.referrer = null), - ("GET" === this.method || "HEAD" === this.method) && o) - ) - throw new TypeError( - "Body not allowed for GET or HEAD requests", - ); - this._initBody(o); - } - function _(e) { - var r = new FormData(); - return ( - e - .trim() - .split("&") - .forEach(function (e) { - var t; - e && - ((t = (e = e.split("=")).shift().replace(/\+/g, " ")), - (e = e.join("=").replace(/\+/g, " ")), - r.append(decodeURIComponent(t), decodeURIComponent(e))); - }), - r - ); - } - function x(e, t) { - (t = t || {}), - (this.type = "default"), - (this.status = void 0 === t.status ? 200 : t.status), - (this.ok = 200 <= this.status && this.status < 300), - (this.statusText = "statusText" in t ? t.statusText : "OK"), - (this.headers = new p(t.headers)), - (this.url = t.url || ""), - this._initBody(e); - } - e.fetch || - ((t = "URLSearchParams" in e), - (r = "Symbol" in e && "iterator" in Symbol), - (i = - "FileReader" in e && - "Blob" in e && - (function () { - try { - return new Blob(), !0; - } catch (e) { - return !1; - } - })()), - (o = "FormData" in e), - (n = "ArrayBuffer" in e) && - ((s = [ - "[object Int8Array]", - "[object Uint8Array]", - "[object Uint8ClampedArray]", - "[object Int16Array]", - "[object Uint16Array]", - "[object Int32Array]", - "[object Uint32Array]", - "[object Float32Array]", - "[object Float64Array]", - ]), - (a = function (e) { - return e && DataView.prototype.isPrototypeOf(e); - }), - (l = - ArrayBuffer.isView || - function (e) { - return ( - e && -1 < s.indexOf(Object.prototype.toString.call(e)) - ); - })), - (p.prototype.append = function (e, t) { - (e = d(e)), (t = h(t)); - var r = this.map[e]; - this.map[e] = r ? r + "," + t : t; - }), - (p.prototype.delete = function (e) { - delete this.map[d(e)]; - }), - (p.prototype.get = function (e) { - return (e = d(e)), this.has(e) ? this.map[e] : null; - }), - (p.prototype.has = function (e) { - return this.map.hasOwnProperty(d(e)); - }), - (p.prototype.set = function (e, t) { - this.map[d(e)] = h(t); - }), - (p.prototype.forEach = function (e, t) { - for (var r in this.map) - this.map.hasOwnProperty(r) && e.call(t, this.map[r], r, this); - }), - (p.prototype.keys = function () { - var r = []; - return ( - this.forEach(function (e, t) { - r.push(t); - }), - f(r) - ); - }), - (p.prototype.values = function () { - var t = []; - return ( - this.forEach(function (e) { - t.push(e); - }), - f(t) - ); - }), - (p.prototype.entries = function () { - var r = []; - return ( - this.forEach(function (e, t) { - r.push([t, e]); - }), - f(r) - ); - }), - r && (p.prototype[Symbol.iterator] = p.prototype.entries), - (u = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]), - (j.prototype.clone = function () { - return new j(this, { body: this._bodyInit }); - }), - b.call(j.prototype), - b.call(x.prototype), - (x.prototype.clone = function () { - return new x(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new p(this.headers), - url: this.url, - }); - }), - (x.error = function () { - var e = new x(null, { status: 0, statusText: "" }); - return (e.type = "error"), e; - }), - (c = [301, 302, 303, 307, 308]), - (x.redirect = function (e, t) { - if (-1 === c.indexOf(t)) - throw new RangeError("Invalid status code"); - return new x(null, { status: t, headers: { location: e } }); - }), - (e.Headers = p), - (e.Request = j), - (e.Response = x), - (e.fetch = function (r, s) { - return new Promise(function (o, e) { - var t = new j(r, s), - n = new XMLHttpRequest(); - (n.onload = function () { - var r, - e = { - status: n.status, - statusText: n.statusText, - headers: - ((e = n.getAllResponseHeaders() || ""), - (r = new p()), - e - .replace(/\r?\n[\t ]+/g, " ") - .split(/\r?\n/) - .forEach(function (e) { - var e = e.split(":"), - t = e.shift().trim(); - t && ((e = e.join(":").trim()), r.append(t, e)); - }), - r), - }, - t = - ((e.url = - "responseURL" in n - ? n.responseURL - : e.headers.get("X-Request-URL")), - "response" in n ? n.response : n.responseText); - o(new x(t, e)); - }), - (n.onerror = function () { - e(new TypeError("Network request failed")); - }), - (n.ontimeout = function () { - e(new TypeError("Network request failed")); - }), - n.open(t.method, t.url, !0), - "include" === t.credentials - ? (n.withCredentials = !0) - : "omit" === t.credentials && (n.withCredentials = !1), - "responseType" in n && i && (n.responseType = "blob"), - t.headers.forEach(function (e, t) { - n.setRequestHeader(t, e); - }), - n.send(void 0 === t._bodyInit ? null : t._bodyInit); - }); - }), - (e.fetch.polyfill = !0)); - })("undefined" != typeof self ? self : this); - }, - {}, - ], - 254: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.function.name"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.split"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l, - o = n(e("../core/main")), - u = n(e("../color/color_conversion")); - function n(e) { - return e && e.__esModule ? e : { default: e }; - } - var c = [ - { h: 0, s: 0, b: 0.8275, name: "gray" }, - { h: 0, s: 0, b: 0.8627, name: "gray" }, - { h: 0, s: 0, b: 0.7529, name: "gray" }, - { h: 0.0167, s: 0.1176, b: 1, name: "light pink" }, - ], - d = [ - { h: 0, s: 0, b: 0, name: "black" }, - { h: 0, s: 0, b: 0.5, name: "gray" }, - { h: 0, s: 0, b: 1, name: "white" }, - { h: 0, s: 0.5, b: 0.5, name: "dark maroon" }, - { h: 0, s: 0.5, b: 1, name: "salmon pink" }, - { h: 0, s: 1, b: 0, name: "black" }, - { h: 0, s: 1, b: 0.5, name: "dark red" }, - { h: 0, s: 1, b: 1, name: "red" }, - { h: 5, s: 0, b: 1, name: "very light peach" }, - { h: 5, s: 0.5, b: 0.5, name: "brown" }, - { h: 5, s: 0.5, b: 1, name: "peach" }, - { h: 5, s: 1, b: 0.5, name: "brick red" }, - { h: 5, s: 1, b: 1, name: "crimson" }, - { h: 10, s: 0, b: 1, name: "light peach" }, - { h: 10, s: 0.5, b: 0.5, name: "brown" }, - { h: 10, s: 0.5, b: 1, name: "light orange" }, - { h: 10, s: 1, b: 0.5, name: "brown" }, - { h: 10, s: 1, b: 1, name: "orange" }, - { h: 15, s: 0, b: 1, name: "very light yellow" }, - { h: 15, s: 0.5, b: 0.5, name: "olive green" }, - { h: 15, s: 0.5, b: 1, name: "light yellow" }, - { h: 15, s: 1, b: 0, name: "dark olive green" }, - { h: 15, s: 1, b: 0.5, name: "olive green" }, - { h: 15, s: 1, b: 1, name: "yellow" }, - { h: 20, s: 0, b: 1, name: "very light yellow" }, - { h: 20, s: 0.5, b: 0.5, name: "olive green" }, - { h: 20, s: 0.5, b: 1, name: "light yellow green" }, - { h: 20, s: 1, b: 0, name: "dark olive green" }, - { h: 20, s: 1, b: 0.5, name: "dark yellow green" }, - { h: 20, s: 1, b: 1, name: "yellow green" }, - { h: 25, s: 0.5, b: 0.5, name: "dark yellow green" }, - { h: 25, s: 0.5, b: 1, name: "light green" }, - { h: 25, s: 1, b: 0.5, name: "dark green" }, - { h: 25, s: 1, b: 1, name: "green" }, - { h: 30, s: 0.5, b: 1, name: "light green" }, - { h: 30, s: 1, b: 0.5, name: "dark green" }, - { h: 30, s: 1, b: 1, name: "green" }, - { h: 35, s: 0, b: 0.5, name: "light green" }, - { h: 35, s: 0, b: 1, name: "very light green" }, - { h: 35, s: 0.5, b: 0.5, name: "dark green" }, - { h: 35, s: 0.5, b: 1, name: "light green" }, - { h: 35, s: 1, b: 0, name: "very dark green" }, - { h: 35, s: 1, b: 0.5, name: "dark green" }, - { h: 35, s: 1, b: 1, name: "green" }, - { h: 40, s: 0, b: 1, name: "very light green" }, - { h: 40, s: 0.5, b: 0.5, name: "dark green" }, - { h: 40, s: 0.5, b: 1, name: "light green" }, - { h: 40, s: 1, b: 0.5, name: "dark green" }, - { h: 40, s: 1, b: 1, name: "green" }, - { h: 45, s: 0.5, b: 1, name: "light turquoise" }, - { h: 45, s: 1, b: 0.5, name: "dark turquoise" }, - { h: 45, s: 1, b: 1, name: "turquoise" }, - { h: 50, s: 0, b: 1, name: "light sky blue" }, - { h: 50, s: 0.5, b: 0.5, name: "dark cyan" }, - { h: 50, s: 0.5, b: 1, name: "light cyan" }, - { h: 50, s: 1, b: 0.5, name: "dark cyan" }, - { h: 50, s: 1, b: 1, name: "cyan" }, - { h: 55, s: 0, b: 1, name: "light sky blue" }, - { h: 55, s: 0.5, b: 1, name: "light sky blue" }, - { h: 55, s: 1, b: 0.5, name: "dark blue" }, - { h: 55, s: 1, b: 1, name: "sky blue" }, - { h: 60, s: 0, b: 0.5, name: "gray" }, - { h: 60, s: 0, b: 1, name: "very light blue" }, - { h: 60, s: 0.5, b: 0.5, name: "blue" }, - { h: 60, s: 0.5, b: 1, name: "light blue" }, - { h: 60, s: 1, b: 0.5, name: "navy blue" }, - { h: 60, s: 1, b: 1, name: "blue" }, - { h: 65, s: 0, b: 1, name: "lavender" }, - { h: 65, s: 0.5, b: 0.5, name: "navy blue" }, - { h: 65, s: 0.5, b: 1, name: "light purple" }, - { h: 65, s: 1, b: 0.5, name: "dark navy blue" }, - { h: 65, s: 1, b: 1, name: "blue" }, - { h: 70, s: 0, b: 1, name: "lavender" }, - { h: 70, s: 0.5, b: 0.5, name: "navy blue" }, - { h: 70, s: 0.5, b: 1, name: "lavender blue" }, - { h: 70, s: 1, b: 0.5, name: "dark navy blue" }, - { h: 70, s: 1, b: 1, name: "blue" }, - { h: 75, s: 0.5, b: 1, name: "lavender" }, - { h: 75, s: 1, b: 0.5, name: "dark purple" }, - { h: 75, s: 1, b: 1, name: "purple" }, - { h: 80, s: 0.5, b: 1, name: "pinkish purple" }, - { h: 80, s: 1, b: 0.5, name: "dark purple" }, - { h: 80, s: 1, b: 1, name: "purple" }, - { h: 85, s: 0, b: 1, name: "light pink" }, - { h: 85, s: 0.5, b: 0.5, name: "purple" }, - { h: 85, s: 0.5, b: 1, name: "light fuchsia" }, - { h: 85, s: 1, b: 0.5, name: "dark fuchsia" }, - { h: 85, s: 1, b: 1, name: "fuchsia" }, - { h: 90, s: 0.5, b: 0.5, name: "dark fuchsia" }, - { h: 90, s: 0.5, b: 1, name: "hot pink" }, - { h: 90, s: 1, b: 0.5, name: "dark fuchsia" }, - { h: 90, s: 1, b: 1, name: "fuchsia" }, - { h: 95, s: 0, b: 1, name: "pink" }, - { h: 95, s: 0.5, b: 1, name: "light pink" }, - { h: 95, s: 1, b: 0.5, name: "dark magenta" }, - { h: 95, s: 1, b: 1, name: "magenta" }, - ]; - o.default.prototype._rgbColorName = function (e) { - var t, - r, - e = u.default._rgbaToHSBA(e), - o = [(l = e)[0], e[1], e[2]]; - 0 !== o[0] && - ((o[0] = Math.round(100 * o[0])), - ((e = o[0].toString().split(""))[(r = e.length - 1)] = parseInt( - e[r], - )), - e[r] < 2.5 ? (e[r] = 0) : 2.5 <= e[r] && e[r] < 7.5 && (e[r] = 5), - 2 === e.length - ? ((e[0] = parseInt(e[0])), - 7.5 <= e[r] && ((e[r] = 0), (e[0] = e[0] + 1)), - (o[0] = 10 * e[0] + e[1])) - : 7.5 <= e[r] - ? (o[0] = 10) - : (o[0] = e[r])), - (o[2] = o[2] / 255); - for (var n = o.length - 1; 1 <= n; n--) - o[n] <= 0.25 - ? (o[n] = 0) - : 0.25 < o[n] && o[n] < 0.75 - ? (o[n] = 0.5) - : (o[n] = 1); - if (0 === o[0] && 0 === o[1] && 1 === o[2]) { - for (var s = 2; 0 <= s; s--) l[s] = Math.round(1e4 * l[s]) / 1e4; - for (var i = 0; i < c.length; i++) { - if (c[i].h === l[0] && c[i].s === l[1] && c[i].b === l[2]) { - t = c[i].name; - break; - } - t = "white"; - } - } else - for (var a = 0; a < d.length; a++) - if (d[a].h === o[0] && d[a].s === o[1] && d[a].b === o[2]) { - t = d[a].name; - break; - } - return t; - }; - e = o.default; - r.default = e; - }, - { - "../color/color_conversion": 260, - "../core/main": 275, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.split": 198, - }, - ], - 255: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.ends-with"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.ends-with"), - e("core-js/modules/es.string.replace"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - var i = "_Description", - a = "_fallbackDesc", - l = "_fallbackTable", - u = "_Label", - c = "_labelDesc", - d = "_labelTable"; - function h(e) { - if ("label" === e || "fallback" === e) - throw new Error("description should not be LABEL or FALLBACK"); - return ( - e.endsWith(".") || - e.endsWith(";") || - e.endsWith(",") || - e.endsWith("?") || - e.endsWith("!") || - (e += "."), - e - ); - } - (s.default.prototype.describe = function (e, t) { - var r; - s.default._validateParameters("describe", arguments), - "string" == typeof e && - ((r = this.canvas.id), - (e = h(e)), - this.dummyDOM || - (this.dummyDOM = document.getElementById(r).parentNode), - this.descriptions || (this.descriptions = {}), - this.descriptions.fallback - ? this.descriptions.fallback.innerHTML !== e && - (this.descriptions.fallback.innerHTML = e) - : this._describeHTML("fallback", e), - t === this.LABEL && - (this.descriptions.label - ? this.descriptions.label.innerHTML !== e && - (this.descriptions.label.innerHTML = e) - : this._describeHTML("label", e))); - }), - (s.default.prototype.describeElement = function (e, t, r) { - var o, n; - s.default._validateParameters("describeElement", arguments), - "string" == typeof t && - "string" == typeof e && - ((o = this.canvas.id), - (t = h(t)), - (n = (function (e) { - if ("label" === e || "fallback" === e) - throw new Error( - "element name should not be LABEL or FALLBACK", - ); - e.endsWith(".") || e.endsWith(";") || e.endsWith(",") - ? (e = e.replace(/.$/, ":")) - : e.endsWith(":") || (e += ":"); - return e; - })(e)), - (e = e.replace(/[^a-zA-Z0-9]/g, "")), - (n = '' - .concat(n, "") - .concat(t, "")), - this.dummyDOM || - (this.dummyDOM = document.getElementById(o).parentNode), - this.descriptions - ? this.descriptions.fallbackElements || - (this.descriptions.fallbackElements = {}) - : (this.descriptions = { fallbackElements: {} }), - this.descriptions.fallbackElements[e] - ? this.descriptions.fallbackElements[e].innerHTML !== n && - (this.descriptions.fallbackElements[e].innerHTML = n) - : this._describeElementHTML("fallback", e, n), - r === this.LABEL && - (this.descriptions.labelElements || - (this.descriptions.labelElements = {}), - this.descriptions.labelElements[e] - ? this.descriptions.labelElements[e].innerHTML !== n && - (this.descriptions.labelElements[e].innerHTML = n) - : this._describeElementHTML("label", e, n))); - }), - (s.default.prototype._describeHTML = function (e, t) { - var r, - o = this.canvas.id; - "fallback" === e - ? (this.dummyDOM.querySelector("#".concat(o + i)) - ? this.dummyDOM - .querySelector("#" + o + l) - .insertAdjacentHTML( - "beforebegin", - '

                                  '), - ) - : ((r = '

                                  ')), - this.dummyDOM.querySelector( - "#".concat(o, "accessibleOutput"), - ) - ? this.dummyDOM - .querySelector("#".concat(o, "accessibleOutput")) - .insertAdjacentHTML("beforebegin", r) - : (this.dummyDOM.querySelector( - "#".concat(o), - ).innerHTML = r)), - (this.descriptions.fallback = this.dummyDOM.querySelector( - "#".concat(o).concat(a), - )), - (this.descriptions.fallback.innerHTML = t)) - : "label" === e && - (this.dummyDOM.querySelector("#".concat(o + u)) - ? this.dummyDOM.querySelector("#".concat(o + d)) && - this.dummyDOM - .querySelector("#".concat(o + d)) - .insertAdjacentHTML( - "beforebegin", - '

                                  '), - ) - : ((r = '

                                  ')), - this.dummyDOM.querySelector( - "#".concat(o, "accessibleOutputLabel"), - ) - ? this.dummyDOM - .querySelector( - "#".concat(o, "accessibleOutputLabel"), - ) - .insertAdjacentHTML("beforebegin", r) - : this.dummyDOM - .querySelector("#" + o) - .insertAdjacentHTML("afterend", r)), - (this.descriptions.label = this.dummyDOM.querySelector( - "#" + o + c, - )), - (this.descriptions.label.innerHTML = t)); - }), - (s.default.prototype._describeElementHTML = function (e, t, r) { - var o, - n = this.canvas.id; - "fallback" === e - ? (this.dummyDOM.querySelector("#".concat(n + i)) - ? this.dummyDOM.querySelector("#" + n + l) || - this.dummyDOM - .querySelector("#" + n + a) - .insertAdjacentHTML( - "afterend", - '
                                  Canvas elements and their descriptions
                                  ', - ), - ) - : ((o = '
                                  Canvas elements and their descriptions
                                  ', - )), - this.dummyDOM.querySelector( - "#".concat(n, "accessibleOutput"), - ) - ? this.dummyDOM - .querySelector("#".concat(n, "accessibleOutput")) - .insertAdjacentHTML("beforebegin", o) - : (this.dummyDOM.querySelector("#" + n).innerHTML = o)), - ((o = document.createElement("tr")).id = n + "_fte_" + t), - this.dummyDOM.querySelector("#" + n + l).appendChild(o), - (this.descriptions.fallbackElements[t] = - this.dummyDOM.querySelector( - "#".concat(n).concat("_fte_").concat(t), - )), - (this.descriptions.fallbackElements[t].innerHTML = r)) - : "label" === e && - (this.dummyDOM.querySelector("#".concat(n + u)) - ? this.dummyDOM.querySelector("#".concat(n + d)) || - this.dummyDOM - .querySelector("#" + n + c) - .insertAdjacentHTML( - "afterend", - '
                                  '), - ) - : ((o = '
                                  ')), - this.dummyDOM.querySelector( - "#".concat(n, "accessibleOutputLabel"), - ) - ? this.dummyDOM - .querySelector( - "#".concat(n, "accessibleOutputLabel"), - ) - .insertAdjacentHTML("beforebegin", o) - : this.dummyDOM - .querySelector("#" + n) - .insertAdjacentHTML("afterend", o)), - ((e = document.createElement("tr")).id = n + "_lte_" + t), - this.dummyDOM.querySelector("#" + n + d).appendChild(e), - (this.descriptions.labelElements[t] = - this.dummyDOM.querySelector( - "#".concat(n).concat("_lte_").concat(t), - )), - (this.descriptions.labelElements[t].innerHTML = r)); - }); - e = s.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.ends-with": 190, - "core-js/modules/es.string.replace": 196, - }, - ], - 256: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.string.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - e.default.prototype._updateGridOutput = function (e) { - var t, r, o, n; - this.dummyDOM.querySelector("#".concat(e, "_summary")) && - ((t = this._accessibleOutputs[e]), - (o = (function (e, t, r, o) { - t = "" - .concat(t, " canvas, ") - .concat(r, " by ") - .concat(o, " pixels, contains ") - .concat(e[0]); - t = ( - 1 === e[0] - ? "".concat(t, " shape: ") - : "".concat(t, " shapes: ") - ).concat(e[1]); - return t; - })( - (r = (function (e, t) { - var r, - o = "", - n = "", - s = 0; - for (r in t) { - var i, - a = 0; - for (i in t[r]) { - var l = '
                                • ') - .concat(t[r][i].color, " ") - .concat(r, ","); - "line" === r - ? (l += " location = " - .concat(t[r][i].pos, ", length = ") - .concat(t[r][i].length, " pixels")) - : ((l += " location = ".concat(t[r][i].pos)), - "point" !== r && - (l += ", area = ".concat(t[r][i].area, " %")), - (l += "
                                • ")), - (o += l), - a++, - s++; - } - n = - 1 < a - ? "".concat(n, " ").concat(a, " ").concat(r, "s") - : "".concat(n, " ").concat(a, " ").concat(r); - } - return { numShapes: [s, n], details: o }; - })(e, this.ingredients.shapes)).numShapes, - this.ingredients.colors.background, - this.width, - this.height, - )), - (n = (function (e, t) { - var r, - o, - n = 0, - s = "", - i = Array.from(Array(10), function () { - return Array(10); - }); - for (r in t) - for (var a in t[r]) { - var l = void 0; - (l = - "line" !== r - ? '
                                  ') - .concat(t[r][a].color, " ") - .concat(r, "") - : '') - .concat(t[r][a].color, " ") - .concat(r, " midpoint")), - i[t[r][a].loc.locY][t[r][a].loc.locX] - ? (i[t[r][a].loc.locY][t[r][a].loc.locX] = - i[t[r][a].loc.locY][t[r][a].loc.locX] + " " + l) - : (i[t[r][a].loc.locY][t[r][a].loc.locX] = l), - n++; - } - for (o in i) { - var u, - c = ""; - for (u in i[o]) - (c += ""), - void 0 !== i[o][u] && (c += i[o][u]), - (c += ""); - s = s + c + ""; - } - return s; - })(e, this.ingredients.shapes)), - o !== t.summary.innerHTML && (t.summary.innerHTML = o), - n !== t.map.innerHTML && (t.map.innerHTML = n), - r.details !== t.shapeDetails.innerHTML && - (t.shapeDetails.innerHTML = r.details), - (this._accessibleOutputs[e] = t)); - }; - e = e.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.string.iterator": 192, - }, - ], - 257: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.number.to-fixed"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function l(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - function u(e, t, r) { - (t = Math.floor((e[0] / t) * 10)), - (e = Math.floor((e[1] / r) * 10)); - return ( - 10 === t && (t -= 1), 10 === e && (e -= 1), { locX: t, locY: e } - ); - } - (o.default.prototype.textOutput = function (e) { - o.default._validateParameters("textOutput", arguments), - this._accessibleOutputs.text || - ((this._accessibleOutputs.text = !0), - this._createOutput("textOutput", "Fallback"), - e === this.LABEL && - ((this._accessibleOutputs.textLabel = !0), - this._createOutput("textOutput", "Label"))); - }), - (o.default.prototype.gridOutput = function (e) { - o.default._validateParameters("gridOutput", arguments), - this._accessibleOutputs.grid || - ((this._accessibleOutputs.grid = !0), - this._createOutput("gridOutput", "Fallback"), - e === this.LABEL && - ((this._accessibleOutputs.gridLabel = !0), - this._createOutput("gridOutput", "Label"))); - }), - (o.default.prototype._addAccsOutput = function () { - return ( - this._accessibleOutputs || - (this._accessibleOutputs = { - text: !1, - grid: !1, - textLabel: !1, - gridLabel: !1, - }), - this._accessibleOutputs.grid || this._accessibleOutputs.text - ); - }), - (o.default.prototype._createOutput = function (e, t) { - var r, - o, - n, - s = this.canvas.id, - i = - (this.ingredients || - (this.ingredients = { - shapes: {}, - colors: { - background: "white", - fill: "white", - stroke: "black", - }, - pShapes: "", - }), - this.dummyDOM || - (this.dummyDOM = document.getElementById(s).parentNode), - ""); - "Fallback" === t - ? ((r = s + e), - this.dummyDOM.querySelector( - "#".concat((o = s + "accessibleOutput")), - ) || - (this.dummyDOM.querySelector("#".concat(s, "_Description")) - ? this.dummyDOM - .querySelector("#".concat(s, "_Description")) - .insertAdjacentHTML( - "afterend", - '
                                  ', - ), - ) - : (this.dummyDOM.querySelector("#".concat(s)).innerHTML = - '
                                  ', - )))) - : "Label" === t && - ((r = s + e + (i = t)), - this.dummyDOM.querySelector( - "#".concat((o = s + "accessibleOutput" + t)), - ) || - (this.dummyDOM.querySelector("#".concat(s, "_Label")) - ? this.dummyDOM.querySelector("#".concat(s, "_Label")) - : this.dummyDOM.querySelector("#".concat(s)) - ).insertAdjacentHTML( - "afterend", - '
                                  '), - )), - (this._accessibleOutputs[r] = {}), - "textOutput" === e - ? ((i = "#".concat(s, "gridOutput").concat(i)), - (n = '
                                  Text Output

                                    ', - )), - this.dummyDOM.querySelector(i) - ? this.dummyDOM - .querySelector(i) - .insertAdjacentHTML("beforebegin", n) - : (this.dummyDOM.querySelector("#".concat(o)).innerHTML = - n), - (this._accessibleOutputs[r].list = - this.dummyDOM.querySelector("#".concat(r, "_list")))) - : "gridOutput" === e && - ((i = "#".concat(s, "textOutput").concat(i)), - (n = '
                                    Grid Output

                                      ', - )), - this.dummyDOM.querySelector(i) - ? this.dummyDOM - .querySelector(i) - .insertAdjacentHTML("afterend", n) - : (this.dummyDOM.querySelector("#".concat(o)).innerHTML = - n), - (this._accessibleOutputs[r].map = - this.dummyDOM.querySelector("#".concat(r, "_map")))), - (this._accessibleOutputs[r].shapeDetails = - this.dummyDOM.querySelector("#".concat(r, "_shapeDetails"))), - (this._accessibleOutputs[r].summary = - this.dummyDOM.querySelector("#".concat(r, "_summary"))); - }), - (o.default.prototype._updateAccsOutput = function () { - var e = this.canvas.id; - JSON.stringify(this.ingredients.shapes) !== - this.ingredients.pShapes && - ((this.ingredients.pShapes = JSON.stringify( - this.ingredients.shapes, - )), - this._accessibleOutputs.text && - this._updateTextOutput(e + "textOutput"), - this._accessibleOutputs.grid && - this._updateGridOutput(e + "gridOutput"), - this._accessibleOutputs.textLabel && - this._updateTextOutput(e + "textOutputLabel"), - this._accessibleOutputs.gridLabel && - this._updateGridOutput(e + "gridOutputLabel")); - }), - (o.default.prototype._accsBackground = function (e) { - (this.ingredients.pShapes = JSON.stringify( - this.ingredients.shapes, - )), - (this.ingredients.shapes = {}), - this.ingredients.colors.backgroundRGBA !== e && - ((this.ingredients.colors.backgroundRGBA = e), - (this.ingredients.colors.background = this._rgbColorName(e))); - }), - (o.default.prototype._accsCanvasColors = function (e, t) { - "fill" === e - ? this.ingredients.colors.fillRGBA !== t && - ((this.ingredients.colors.fillRGBA = t), - (this.ingredients.colors.fill = this._rgbColorName(t))) - : "stroke" === e && - this.ingredients.colors.strokeRGBA !== t && - ((this.ingredients.colors.strokeRGBA = t), - (this.ingredients.colors.stroke = this._rgbColorName(t))); - }), - (o.default.prototype._accsOutput = function (e, t) { - "ellipse" === e && t[2] === t[3] - ? (e = "circle") - : "rectangle" === e && t[2] === t[3] && (e = "square"); - var r, - o, - n = {}, - s = !0, - i = (function (e, t) { - var r; - e = - "rectangle" === e || - "ellipse" === e || - "arc" === e || - "circle" === e || - "square" === e - ? ((r = Math.round(t[0] + t[2] / 2)), - Math.round(t[1] + t[3] / 2)) - : "triangle" === e - ? ((r = (t[0] + t[2] + t[4]) / 3), - (t[1] + t[3] + t[5]) / 3) - : "quadrilateral" === e - ? ((r = (t[0] + t[2] + t[4] + t[6]) / 4), - (t[1] + t[3] + t[5] + t[7]) / 4) - : "line" === e - ? ((r = (t[0] + t[2]) / 2), (t[1] + t[3]) / 2) - : ((r = t[0]), t[1]); - return [r, e]; - })(e, t); - if ( - ("line" === e - ? ((n.color = this.ingredients.colors.stroke), - (n.length = Math.round(this.dist(t[0], t[1], t[2], t[3]))), - (r = this._getPos(t[0], [1])), - (o = this._getPos(t[2], [3])), - (n.loc = u(i, this.width, this.height)), - (n.pos = - r === o - ? "at ".concat(r) - : "from ".concat(r, " to ").concat(o))) - : ("point" === e - ? (n.color = this.ingredients.colors.stroke) - : ((n.color = this.ingredients.colors.fill), - (n.area = this._getArea(e, t))), - (n.pos = this._getPos.apply(this, l(i))), - (n.loc = u(i, this.width, this.height))), - this.ingredients.shapes[e]) - ) { - if (this.ingredients.shapes[e] !== [n]) { - for (var a in this.ingredients.shapes[e]) - JSON.stringify(this.ingredients.shapes[e][a]) === - JSON.stringify(n) && (s = !1); - !0 === s && this.ingredients.shapes[e].push(n); - } - } else this.ingredients.shapes[e] = [n]; - }), - (o.default.prototype._getPos = function (e, t) { - var e = new DOMPointReadOnly(e, t), - t = this._renderer.isP3D - ? new DOMMatrix(this._renderer.uMVMatrix.mat4) - : this.drawingContext.getTransform(), - e = e.matrixTransform(t), - t = e.x, - e = e.y, - r = this.width, - o = this.height; - return t < 0.4 * r - ? e < 0.4 * o - ? "top left" - : 0.6 * o < e - ? "bottom left" - : "mid left" - : 0.6 * r < t - ? e < 0.4 * o - ? "top right" - : 0.6 * o < e - ? "bottom right" - : "mid right" - : e < 0.4 * o - ? "top middle" - : 0.6 * o < e - ? "bottom middle" - : "middle"; - }), - (o.default.prototype._getArea = function (e, t) { - var r, - o, - n = 0, - s = - ("arc" === e - ? ((n = - ((r = - (((t[5] - t[4]) % (2 * Math.PI)) + 2 * Math.PI) % - (2 * Math.PI)) * - t[2] * - t[3]) / - 8), - ("open" !== t[6] && "chord" !== t[6]) || - ((o = t[0]), - (u = t[1]), - (s = t[0] + (t[2] / 2) * Math.cos(t[4]).toFixed(2)), - (c = t[1] + (t[3] / 2) * Math.sin(t[4]).toFixed(2)), - (a = t[0] + (t[2] / 2) * Math.cos(t[5]).toFixed(2)), - (i = t[1] + (t[3] / 2) * Math.sin(t[5]).toFixed(2)), - (o = - Math.abs(o * (c - i) + s * (i - u) + a * (u - c)) / - 2), - r > Math.PI ? (n += o) : (n -= o))) - : "ellipse" === e || "circle" === e - ? (n = (((3.14 * t[2]) / 2) * t[3]) / 2) - : "line" === e || "point" === e - ? (n = 0) - : "quadrilateral" === e - ? (n = - Math.abs( - (t[6] + t[0]) * (t[7] - t[1]) + - (t[0] + t[2]) * (t[1] - t[3]) + - (t[2] + t[4]) * (t[3] - t[5]) + - (t[4] + t[6]) * (t[5] - t[7]), - ) / 2) - : "rectangle" === e || "square" === e - ? (n = t[2] * t[3]) - : "triangle" === e && - (n = - Math.abs( - t[0] * (t[3] - t[5]) + - t[2] * (t[5] - t[1]) + - t[4] * (t[1] - t[3]), - ) / 2), - this.width * this._pixelDensity), - i = this.height * this._pixelDensity, - a = [ - new DOMPoint(0, 0), - new DOMPoint(s, 0), - new DOMPoint(s, i), - new DOMPoint(0, i), - ], - l = ( - this._renderer.isP3D - ? new DOMMatrix(this._renderer.uMVMatrix.mat4) - : this.drawingContext.getTransform() - ).inverse(), - u = a.map(function (e) { - return e.matrixTransform(l); - }), - c = - Math.abs( - (u[3].x + u[0].x) * (u[3].y - u[0].y) + - (u[0].x + u[1].x) * (u[0].y - u[1].y) + - (u[1].x + u[2].x) * (u[1].y - u[2].y) + - (u[2].x + u[3].x) * (u[2].y - u[3].y), - ) / 2; - return Math.round((100 * n) / c); - }); - e = o.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.number.to-fixed": 175, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 258: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.concat"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - e.default.prototype._updateTextOutput = function (e) { - var t, r, o, n; - this.dummyDOM.querySelector("#".concat(e, "_summary")) && - ((t = this._accessibleOutputs[e]), - (o = (function (e, t, r, o) { - r = "Your output is a, " - .concat(r, " by ") - .concat(o, " pixels, ") - .concat(t, " canvas containing the following"); - r = - 1 === e - ? "".concat(r, " shape:") - : "".concat(r, " ").concat(e, " shapes:"); - return r; - })( - (r = (function (e, t) { - var r, - o = "", - n = 0; - for (r in t) - for (var s in t[r]) { - var i = '
                                    • ') - .concat(t[r][s].color, " ") - .concat(r, ""); - "line" === r - ? (i += ", " - .concat(t[r][s].pos, ", ") - .concat(t[r][s].length, " pixels long.
                                    • ")) - : ((i += ", at ".concat(t[r][s].pos)), - "point" !== r && - (i += ", covering ".concat( - t[r][s].area, - "% of the canvas", - )), - (i += ".")), - (o += i), - n++; - } - return { numShapes: n, listShapes: o }; - })(e, this.ingredients.shapes)).numShapes, - this.ingredients.colors.background, - this.width, - this.height, - )), - (n = (function (e, t) { - var r, - o = "", - n = 0; - for (r in t) - for (var s in t[r]) { - var i = '') - .concat(t[r][s].color, " ") - .concat(r, ""); - "line" === r - ? (i += "location = " - .concat(t[r][s].pos, "length = ") - .concat(t[r][s].length, " pixels")) - : ((i += "location = ".concat(t[r][s].pos, "")), - "point" !== r && - (i += " area = ".concat(t[r][s].area, "%")), - (i += "")), - (o += i), - n++; - } - return o; - })(e, this.ingredients.shapes)), - o !== t.summary.innerHTML && (t.summary.innerHTML = o), - r.listShapes !== t.list.innerHTML && - (t.list.innerHTML = r.listShapes), - n !== t.shapeDetails.innerHTML && (t.shapeDetails.innerHTML = n), - (this._accessibleOutputs[e] = t)); - }; - e = e.default; - r.default = e; - }, - { "../core/main": 275, "core-js/modules/es.array.concat": 151 }, - ], - 259: [ - function (e, t, r) { - "use strict"; - var o = (o = e("./core/main")) && o.__esModule ? o : { default: o }; - e("./core/constants"), - e("./core/environment"), - e("./core/friendly_errors/stacktrace"), - e("./core/friendly_errors/validate_params"), - e("./core/friendly_errors/file_errors"), - e("./core/friendly_errors/fes_core"), - e("./core/friendly_errors/sketch_reader"), - e("./core/helpers"), - e("./core/legacy"), - e("./core/preload"), - e("./core/p5.Element"), - e("./core/p5.Graphics"), - e("./core/p5.Renderer"), - e("./core/p5.Renderer2D"), - e("./core/rendering"), - e("./core/shim"), - e("./core/structure"), - e("./core/transform"), - e("./core/shape/2d_primitives"), - e("./core/shape/attributes"), - e("./core/shape/curves"), - e("./core/shape/vertex"), - e("./accessibility/outputs"), - e("./accessibility/textOutput"), - e("./accessibility/gridOutput"), - e("./accessibility/color_namer"), - e("./color/color_conversion"), - e("./color/creating_reading"), - e("./color/p5.Color"), - e("./color/setting"), - e("./data/p5.TypedDict"), - e("./data/local_storage.js"), - e("./dom/dom"), - e("./accessibility/describe"), - e("./events/acceleration"), - e("./events/keyboard"), - e("./events/mouse"), - e("./events/touch"), - e("./image/filters"), - e("./image/image"), - e("./image/loading_displaying"), - e("./image/p5.Image"), - e("./image/pixels"), - e("./io/files"), - e("./io/p5.Table"), - e("./io/p5.TableRow"), - e("./io/p5.XML"), - e("./math/calculation"), - e("./math/math"), - e("./math/noise"), - e("./math/p5.Vector"), - e("./math/random"), - e("./math/trigonometry"), - e("./typography/attributes"), - e("./typography/loading_displaying"), - e("./typography/p5.Font"), - e("./utilities/array_functions"), - e("./utilities/conversion"), - e("./utilities/string_functions"), - e("./utilities/time_date"), - e("./webgl/3d_primitives"), - e("./webgl/interaction"), - e("./webgl/light"), - e("./webgl/loading"), - e("./webgl/material"), - e("./webgl/p5.Camera"), - e("./webgl/p5.DataArray"), - e("./webgl/p5.Geometry"), - e("./webgl/p5.Matrix"), - e("./webgl/p5.RendererGL.Immediate"), - e("./webgl/p5.RendererGL"), - e("./webgl/p5.RendererGL.Retained"), - e("./webgl/p5.Framebuffer"), - e("./webgl/p5.Shader"), - e("./webgl/p5.RenderBuffer"), - e("./webgl/p5.Texture"), - e("./webgl/text"), - e("./core/init"), - (t.exports = o.default); - }, - { - "./accessibility/color_namer": 254, - "./accessibility/describe": 255, - "./accessibility/gridOutput": 256, - "./accessibility/outputs": 257, - "./accessibility/textOutput": 258, - "./color/color_conversion": 260, - "./color/creating_reading": 261, - "./color/p5.Color": 262, - "./color/setting": 263, - "./core/constants": 264, - "./core/environment": 265, - "./core/friendly_errors/fes_core": 266, - "./core/friendly_errors/file_errors": 267, - "./core/friendly_errors/sketch_reader": 268, - "./core/friendly_errors/stacktrace": 269, - "./core/friendly_errors/validate_params": 270, - "./core/helpers": 271, - "./core/init": 272, - "./core/legacy": 274, - "./core/main": 275, - "./core/p5.Element": 276, - "./core/p5.Graphics": 277, - "./core/p5.Renderer": 278, - "./core/p5.Renderer2D": 279, - "./core/preload": 280, - "./core/rendering": 281, - "./core/shape/2d_primitives": 282, - "./core/shape/attributes": 283, - "./core/shape/curves": 284, - "./core/shape/vertex": 285, - "./core/shim": 286, - "./core/structure": 287, - "./core/transform": 288, - "./data/local_storage.js": 289, - "./data/p5.TypedDict": 290, - "./dom/dom": 291, - "./events/acceleration": 292, - "./events/keyboard": 293, - "./events/mouse": 294, - "./events/touch": 295, - "./image/filters": 296, - "./image/image": 297, - "./image/loading_displaying": 298, - "./image/p5.Image": 299, - "./image/pixels": 300, - "./io/files": 301, - "./io/p5.Table": 302, - "./io/p5.TableRow": 303, - "./io/p5.XML": 304, - "./math/calculation": 305, - "./math/math": 306, - "./math/noise": 307, - "./math/p5.Vector": 308, - "./math/random": 309, - "./math/trigonometry": 310, - "./typography/attributes": 311, - "./typography/loading_displaying": 312, - "./typography/p5.Font": 313, - "./utilities/array_functions": 314, - "./utilities/conversion": 315, - "./utilities/string_functions": 316, - "./utilities/time_date": 317, - "./webgl/3d_primitives": 318, - "./webgl/interaction": 320, - "./webgl/light": 321, - "./webgl/loading": 322, - "./webgl/material": 323, - "./webgl/p5.Camera": 324, - "./webgl/p5.DataArray": 325, - "./webgl/p5.Framebuffer": 326, - "./webgl/p5.Geometry": 327, - "./webgl/p5.Matrix": 328, - "./webgl/p5.RenderBuffer": 329, - "./webgl/p5.RendererGL": 332, - "./webgl/p5.RendererGL.Immediate": 330, - "./webgl/p5.RendererGL.Retained": 331, - "./webgl/p5.Shader": 333, - "./webgl/p5.Texture": 334, - "./webgl/text": 335, - }, - ], - 260: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - e.default.ColorConversion = { - _hsbaToHSLA: function (e) { - var t = e[0], - r = e[1], - o = e[2], - n = ((2 - r) * o) / 2; - return ( - 0 != n && - (1 == n - ? (r = 0) - : n < 0.5 - ? (r /= 2 - r) - : (r = (r * o) / (2 - 2 * n))), - [t, r, n, e[3]] - ); - }, - _hsbaToRGBA: function (e) { - var t, - r, - o, - n, - s, - i = 6 * e[0], - a = e[1], - l = e[2]; - return 0 === a - ? [l, l, l, e[3]] - : ((r = l * (1 - a)), - (o = l * (1 - a * (i - (t = Math.floor(i))))), - (a = l * (1 - a * (1 + t - i))), - (i = - 1 === t - ? ((n = o), (s = l), r) - : 2 === t - ? ((n = r), (s = l), a) - : 3 === t - ? ((n = r), (s = o), l) - : 4 === t - ? ((n = a), (s = r), l) - : 5 === t - ? ((n = l), (s = r), o) - : ((n = l), (s = a), r)), - [n, s, i, e[3]]); - }, - _hslaToHSBA: function (e) { - var t = e[0], - r = e[1], - o = e[2], - n = o < 0.5 ? (1 + r) * o : o + r - o * r; - return [t, (r = (2 * (n - o)) / n), n, e[3]]; - }, - _hslaToRGBA: function (e) { - var t, - r = 6 * e[0], - o = e[1], - n = e[2]; - return 0 === o - ? [n, n, n, e[3]] - : [ - (t = function (e, t, r) { - return ( - e < 0 ? (e += 6) : 6 <= e && (e -= 6), - e < 1 - ? t + (r - t) * e - : e < 3 - ? r - : e < 4 - ? t + (r - t) * (4 - e) - : t - ); - })( - 2 + r, - (o = 2 * n - (n = n < 0.5 ? (1 + o) * n : n + o - n * o)), - n, - ), - t(r, o, n), - t(r - 2, o, n), - e[3], - ]; - }, - _rgbaToHSBA: function (e) { - var t, - r, - o = e[0], - n = e[1], - s = e[2], - i = Math.max(o, n, s), - a = i - Math.min(o, n, s); - return ( - 0 == a - ? (r = t = 0) - : ((r = a / i), - o === i - ? (t = (n - s) / a) - : n === i - ? (t = 2 + (s - o) / a) - : s === i && (t = 4 + (o - n) / a), - t < 0 ? (t += 6) : 6 <= t && (t -= 6)), - [t / 6, r, i, e[3]] - ); - }, - _rgbaToHSLA: function (e) { - var t, - r, - o = e[0], - n = e[1], - s = e[2], - i = Math.max(o, n, s), - a = Math.min(o, n, s), - l = i + a, - a = i - a; - return ( - 0 == a - ? (r = t = 0) - : ((r = l < 1 ? a / l : a / (2 - l)), - o === i - ? (t = (n - s) / a) - : n === i - ? (t = 2 + (s - o) / a) - : s === i && (t = 4 + (o - n) / a), - t < 0 ? (t += 6) : 6 <= t && (t -= 6)), - [t / 6, r, l / 2, e[3]] - ); - }, - }; - e = e.default.ColorConversion; - r.default = e; - }, - { "../core/main": 275 }, - ], - 261: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.map"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - u = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - e("./p5.Color"), - e("../core/friendly_errors/validate_params"), - e("../core/friendly_errors/file_errors"), - e("../core/friendly_errors/fes_core"), - (l.default.prototype.alpha = function (e) { - return ( - l.default._validateParameters("alpha", arguments), - this.color(e)._getAlpha() - ); - }), - (l.default.prototype.blue = function (e) { - return ( - l.default._validateParameters("blue", arguments), - this.color(e)._getBlue() - ); - }), - (l.default.prototype.brightness = function (e) { - return ( - l.default._validateParameters("brightness", arguments), - this.color(e)._getBrightness() - ); - }), - (l.default.prototype.color = function () { - var e; - return ( - l.default._validateParameters("color", arguments), - arguments[0] instanceof l.default.Color - ? arguments[0] - : ((e = - arguments[0] instanceof Array ? arguments[0] : arguments), - new l.default.Color(this, e)) - ); - }), - (l.default.prototype.green = function (e) { - return ( - l.default._validateParameters("green", arguments), - this.color(e)._getGreen() - ); - }), - (l.default.prototype.hue = function (e) { - return ( - l.default._validateParameters("hue", arguments), - this.color(e)._getHue() - ); - }), - (l.default.prototype.lerpColor = function (e, t, r) { - l.default._validateParameters("lerpColor", arguments); - var o, - n, - s, - i = this._colorMode, - a = this._colorMaxes; - if (i === u.RGB) - (n = e.levels.map(function (e) { - return e / 255; - })), - (s = t.levels.map(function (e) { - return e / 255; - })); - else if (i === u.HSB) - e._getBrightness(), - t._getBrightness(), - (n = e.hsba), - (s = t.hsba); - else { - if (i !== u.HSL) - throw new Error( - "".concat(i, "cannot be used for interpolation."), - ); - e._getLightness(), - t._getLightness(), - (n = e.hsla), - (s = t.hsla); - } - return ( - (r = Math.max(Math.min(r, 1), 0)), - void 0 === this.lerp && - (this.lerp = function (e, t, r) { - return r * (t - e) + e; - }), - (e = this.lerp(n[0], s[0], r)), - (t = this.lerp(n[1], s[1], r)), - (o = this.lerp(n[2], s[2], r)), - (n = this.lerp(n[3], s[3], r)), - (e *= a[i][0]), - (t *= a[i][1]), - (o *= a[i][2]), - (n *= a[i][3]), - this.color(e, t, o, n) - ); - }), - (l.default.prototype.lightness = function (e) { - return ( - l.default._validateParameters("lightness", arguments), - this.color(e)._getLightness() - ); - }), - (l.default.prototype.red = function (e) { - return ( - l.default._validateParameters("red", arguments), - this.color(e)._getRed() - ); - }), - (l.default.prototype.saturation = function (e) { - return ( - l.default._validateParameters("saturation", arguments), - this.color(e)._getSaturation() - ); - }); - var n = l.default; - r.default = n; - }, - { - "../core/constants": 264, - "../core/friendly_errors/fes_core": 266, - "../core/friendly_errors/file_errors": 267, - "../core/friendly_errors/validate_params": 270, - "../core/main": 275, - "./p5.Color": 262, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 262: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.trim"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.trim"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = s(e("../core/main")), - d = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")), - h = s(e("./color_conversion")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function s(e) { - return e && e.__esModule ? e : { default: e }; - } - function l(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - var f = { - aliceblue: "#f0f8ff", - antiquewhite: "#faebd7", - aqua: "#00ffff", - aquamarine: "#7fffd4", - azure: "#f0ffff", - beige: "#f5f5dc", - bisque: "#ffe4c4", - black: "#000000", - blanchedalmond: "#ffebcd", - blue: "#0000ff", - blueviolet: "#8a2be2", - brown: "#a52a2a", - burlywood: "#deb887", - cadetblue: "#5f9ea0", - chartreuse: "#7fff00", - chocolate: "#d2691e", - coral: "#ff7f50", - cornflowerblue: "#6495ed", - cornsilk: "#fff8dc", - crimson: "#dc143c", - cyan: "#00ffff", - darkblue: "#00008b", - darkcyan: "#008b8b", - darkgoldenrod: "#b8860b", - darkgray: "#a9a9a9", - darkgreen: "#006400", - darkgrey: "#a9a9a9", - darkkhaki: "#bdb76b", - darkmagenta: "#8b008b", - darkolivegreen: "#556b2f", - darkorange: "#ff8c00", - darkorchid: "#9932cc", - darkred: "#8b0000", - darksalmon: "#e9967a", - darkseagreen: "#8fbc8f", - darkslateblue: "#483d8b", - darkslategray: "#2f4f4f", - darkslategrey: "#2f4f4f", - darkturquoise: "#00ced1", - darkviolet: "#9400d3", - deeppink: "#ff1493", - deepskyblue: "#00bfff", - dimgray: "#696969", - dimgrey: "#696969", - dodgerblue: "#1e90ff", - firebrick: "#b22222", - floralwhite: "#fffaf0", - forestgreen: "#228b22", - fuchsia: "#ff00ff", - gainsboro: "#dcdcdc", - ghostwhite: "#f8f8ff", - gold: "#ffd700", - goldenrod: "#daa520", - gray: "#808080", - green: "#008000", - greenyellow: "#adff2f", - grey: "#808080", - honeydew: "#f0fff0", - hotpink: "#ff69b4", - indianred: "#cd5c5c", - indigo: "#4b0082", - ivory: "#fffff0", - khaki: "#f0e68c", - lavender: "#e6e6fa", - lavenderblush: "#fff0f5", - lawngreen: "#7cfc00", - lemonchiffon: "#fffacd", - lightblue: "#add8e6", - lightcoral: "#f08080", - lightcyan: "#e0ffff", - lightgoldenrodyellow: "#fafad2", - lightgray: "#d3d3d3", - lightgreen: "#90ee90", - lightgrey: "#d3d3d3", - lightpink: "#ffb6c1", - lightsalmon: "#ffa07a", - lightseagreen: "#20b2aa", - lightskyblue: "#87cefa", - lightslategray: "#778899", - lightslategrey: "#778899", - lightsteelblue: "#b0c4de", - lightyellow: "#ffffe0", - lime: "#00ff00", - limegreen: "#32cd32", - linen: "#faf0e6", - magenta: "#ff00ff", - maroon: "#800000", - mediumaquamarine: "#66cdaa", - mediumblue: "#0000cd", - mediumorchid: "#ba55d3", - mediumpurple: "#9370db", - mediumseagreen: "#3cb371", - mediumslateblue: "#7b68ee", - mediumspringgreen: "#00fa9a", - mediumturquoise: "#48d1cc", - mediumvioletred: "#c71585", - midnightblue: "#191970", - mintcream: "#f5fffa", - mistyrose: "#ffe4e1", - moccasin: "#ffe4b5", - navajowhite: "#ffdead", - navy: "#000080", - oldlace: "#fdf5e6", - olive: "#808000", - olivedrab: "#6b8e23", - orange: "#ffa500", - orangered: "#ff4500", - orchid: "#da70d6", - palegoldenrod: "#eee8aa", - palegreen: "#98fb98", - paleturquoise: "#afeeee", - palevioletred: "#db7093", - papayawhip: "#ffefd5", - peachpuff: "#ffdab9", - peru: "#cd853f", - pink: "#ffc0cb", - plum: "#dda0dd", - powderblue: "#b0e0e6", - purple: "#800080", - rebeccapurple: "#663399", - red: "#ff0000", - rosybrown: "#bc8f8f", - royalblue: "#4169e1", - saddlebrown: "#8b4513", - salmon: "#fa8072", - sandybrown: "#f4a460", - seagreen: "#2e8b57", - seashell: "#fff5ee", - sienna: "#a0522d", - silver: "#c0c0c0", - skyblue: "#87ceeb", - slateblue: "#6a5acd", - slategray: "#708090", - slategrey: "#708090", - snow: "#fffafa", - springgreen: "#00ff7f", - steelblue: "#4682b4", - tan: "#d2b48c", - teal: "#008080", - thistle: "#d8bfd8", - tomato: "#ff6347", - turquoise: "#40e0d0", - violet: "#ee82ee", - wheat: "#f5deb3", - white: "#ffffff", - whitesmoke: "#f5f5f5", - yellow: "#ffff00", - yellowgreen: "#9acd32", - }, - e = /\s*/, - u = /(\d{1,3})/, - c = /((?:\d+(?:\.\d+)?)|(?:\.\d+))/, - p = new RegExp("".concat(c.source, "%")), - m = { - HEX3: /^#([a-f0-9])([a-f0-9])([a-f0-9])$/i, - HEX4: /^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i, - HEX6: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, - HEX8: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i, - RGB: new RegExp( - [ - "^rgb\\(", - u.source, - ",", - u.source, - ",", - u.source, - "\\)$", - ].join(e.source), - "i", - ), - RGB_PERCENT: new RegExp( - [ - "^rgb\\(", - p.source, - ",", - p.source, - ",", - p.source, - "\\)$", - ].join(e.source), - "i", - ), - RGBA: new RegExp( - [ - "^rgba\\(", - u.source, - ",", - u.source, - ",", - u.source, - ",", - c.source, - "\\)$", - ].join(e.source), - "i", - ), - RGBA_PERCENT: new RegExp( - [ - "^rgba\\(", - p.source, - ",", - p.source, - ",", - p.source, - ",", - c.source, - "\\)$", - ].join(e.source), - "i", - ), - HSL: new RegExp( - [ - "^hsl\\(", - u.source, - ",", - p.source, - ",", - p.source, - "\\)$", - ].join(e.source), - "i", - ), - HSLA: new RegExp( - [ - "^hsla\\(", - u.source, - ",", - p.source, - ",", - p.source, - ",", - c.source, - "\\)$", - ].join(e.source), - "i", - ), - HSB: new RegExp( - [ - "^hsb\\(", - u.source, - ",", - p.source, - ",", - p.source, - "\\)$", - ].join(e.source), - "i", - ), - HSBA: new RegExp( - [ - "^hsba\\(", - u.source, - ",", - p.source, - ",", - p.source, - ",", - c.source, - "\\)$", - ].join(e.source), - "i", - ), - }, - u = - ((n.default.Color = (function () { - function c(e, t) { - if (!(this instanceof c)) - throw new TypeError("Cannot call a class as a function"); - if ( - (this._storeModeAndMaxes(e._colorMode, e._colorMaxes), - ![d.RGB, d.HSL, d.HSB].includes(this.mode)) - ) - throw new Error( - "".concat(this.mode, " is an invalid colorMode."), - ); - (this._array = c._parseInputs.apply(this, t)), - this._calculateLevels(); - } - var e, t, r; - return ( - (e = c), - (r = [ - { - key: "_parseInputs", - value: function (e, t, r, o) { - var n, - s = arguments.length, - i = this.mode, - a = this.maxes[i], - l = []; - if (3 <= s) { - for ( - l[0] = e / a[0], - l[1] = t / a[1], - l[2] = r / a[2], - l[3] = "number" == typeof o ? o / a[3] : 1, - n = l.length - 1; - 0 <= n; - --n - ) { - var u = l[n]; - u < 0 ? (l[n] = 0) : 1 < u && (l[n] = 1); - } - return i === d.HSL - ? h.default._hslaToRGBA(l) - : i === d.HSB - ? h.default._hsbaToRGBA(l) - : l; - } - if (1 === s && "string" == typeof e) { - r = e.trim().toLowerCase(); - if (f[r]) return c._parseInputs.call(this, f[r]); - if (m.HEX3.test(r)) - return ( - ((l = m.HEX3.exec(r) - .slice(1) - .map(function (e) { - return parseInt(e + e, 16) / 255; - }))[3] = 1), - l - ); - if (m.HEX6.test(r)) - return ( - ((l = m.HEX6.exec(r) - .slice(1) - .map(function (e) { - return parseInt(e, 16) / 255; - }))[3] = 1), - l - ); - if (m.HEX4.test(r)) - return (l = m.HEX4.exec(r) - .slice(1) - .map(function (e) { - return parseInt(e + e, 16) / 255; - })); - if (m.HEX8.test(r)) - return (l = m.HEX8.exec(r) - .slice(1) - .map(function (e) { - return parseInt(e, 16) / 255; - })); - if (m.RGB.test(r)) - return ( - ((l = m.RGB.exec(r) - .slice(1) - .map(function (e) { - return e / 255; - }))[3] = 1), - l - ); - if (m.RGB_PERCENT.test(r)) - return ( - ((l = m.RGB_PERCENT.exec(r) - .slice(1) - .map(function (e) { - return parseFloat(e) / 100; - }))[3] = 1), - l - ); - if (m.RGBA.test(r)) - return (l = m.RGBA.exec(r) - .slice(1) - .map(function (e, t) { - return 3 === t ? parseFloat(e) : e / 255; - })); - if (m.RGBA_PERCENT.test(r)) - return (l = m.RGBA_PERCENT.exec(r) - .slice(1) - .map(function (e, t) { - return 3 === t - ? parseFloat(e) - : parseFloat(e) / 100; - })); - if ( - (m.HSL.test(r) - ? ((l = m.HSL.exec(r) - .slice(1) - .map(function (e, t) { - return 0 === t - ? parseInt(e, 10) / 360 - : parseInt(e, 10) / 100; - }))[3] = 1) - : m.HSLA.test(r) && - (l = m.HSLA.exec(r) - .slice(1) - .map(function (e, t) { - return 0 === t - ? parseInt(e, 10) / 360 - : 3 === t - ? parseFloat(e) - : parseInt(e, 10) / 100; - })), - (l = l.map(function (e) { - return Math.max(Math.min(e, 1), 0); - })).length) - ) - return h.default._hslaToRGBA(l); - if ( - (m.HSB.test(r) - ? ((l = m.HSB.exec(r) - .slice(1) - .map(function (e, t) { - return 0 === t - ? parseInt(e, 10) / 360 - : parseInt(e, 10) / 100; - }))[3] = 1) - : m.HSBA.test(r) && - (l = m.HSBA.exec(r) - .slice(1) - .map(function (e, t) { - return 0 === t - ? parseInt(e, 10) / 360 - : 3 === t - ? parseFloat(e) - : parseInt(e, 10) / 100; - })), - l.length) - ) { - for (n = l.length - 1; 0 <= n; --n) - l[n] = Math.max(Math.min(l[n], 1), 0); - return h.default._hsbaToRGBA(l); - } - l = [1, 1, 1, 1]; - } else { - if ((1 !== s && 2 !== s) || "number" != typeof e) - throw new Error( - "".concat( - arguments, - "is not a valid color representation.", - ), - ); - (l[0] = e / a[2]), - (l[1] = e / a[2]), - (l[2] = e / a[2]), - (l[3] = "number" == typeof t ? t / a[3] : 1), - (l = l.map(function (e) { - return Math.max(Math.min(e, 1), 0); - })); - } - return l; - }, - }, - ]), - (t = [ - { - key: "toString", - value: function (e) { - var t = this.levels, - r = this._array, - o = r[3]; - switch (e) { - case "#rrggbb": - return "#".concat( - t[0] < 16 - ? "0".concat(t[0].toString(16)) - : t[0].toString(16), - t[1] < 16 - ? "0".concat(t[1].toString(16)) - : t[1].toString(16), - t[2] < 16 - ? "0".concat(t[2].toString(16)) - : t[2].toString(16), - ); - case "#rrggbbaa": - return "#".concat( - t[0] < 16 - ? "0".concat(t[0].toString(16)) - : t[0].toString(16), - t[1] < 16 - ? "0".concat(t[1].toString(16)) - : t[1].toString(16), - t[2] < 16 - ? "0".concat(t[2].toString(16)) - : t[2].toString(16), - t[3] < 16 - ? "0".concat(t[3].toString(16)) - : t[3].toString(16), - ); - case "#rgb": - return "#".concat( - Math.round(15 * r[0]).toString(16), - Math.round(15 * r[1]).toString(16), - Math.round(15 * r[2]).toString(16), - ); - case "#rgba": - return "#".concat( - Math.round(15 * r[0]).toString(16), - Math.round(15 * r[1]).toString(16), - Math.round(15 * r[2]).toString(16), - Math.round(15 * r[3]).toString(16), - ); - case "rgb": - return "rgb(".concat( - t[0], - ", ", - t[1], - ", ", - t[2], - ")", - ); - case "rgb%": - return "rgb(".concat( - (100 * r[0]).toPrecision(3), - "%, ", - (100 * r[1]).toPrecision(3), - "%, ", - (100 * r[2]).toPrecision(3), - "%)", - ); - case "rgba%": - return "rgba(".concat( - (100 * r[0]).toPrecision(3), - "%, ", - (100 * r[1]).toPrecision(3), - "%, ", - (100 * r[2]).toPrecision(3), - "%, ", - (100 * r[3]).toPrecision(3), - "%)", - ); - case "hsb": - case "hsv": - return ( - this.hsba || - (this.hsba = h.default._rgbaToHSBA( - this._array, - )), - "hsb(".concat( - this.hsba[0] * this.maxes[d.HSB][0], - ", ", - this.hsba[1] * this.maxes[d.HSB][1], - ", ", - this.hsba[2] * this.maxes[d.HSB][2], - ")", - ) - ); - case "hsb%": - case "hsv%": - return ( - this.hsba || - (this.hsba = h.default._rgbaToHSBA( - this._array, - )), - "hsb(".concat( - (100 * this.hsba[0]).toPrecision(3), - "%, ", - (100 * this.hsba[1]).toPrecision(3), - "%, ", - (100 * this.hsba[2]).toPrecision(3), - "%)", - ) - ); - case "hsba": - case "hsva": - return ( - this.hsba || - (this.hsba = h.default._rgbaToHSBA( - this._array, - )), - "hsba(".concat( - this.hsba[0] * this.maxes[d.HSB][0], - ", ", - this.hsba[1] * this.maxes[d.HSB][1], - ", ", - this.hsba[2] * this.maxes[d.HSB][2], - ", ", - o, - ")", - ) - ); - case "hsba%": - case "hsva%": - return ( - this.hsba || - (this.hsba = h.default._rgbaToHSBA( - this._array, - )), - "hsba(".concat( - (100 * this.hsba[0]).toPrecision(3), - "%, ", - (100 * this.hsba[1]).toPrecision(3), - "%, ", - (100 * this.hsba[2]).toPrecision(3), - "%, ", - (100 * o).toPrecision(3), - "%)", - ) - ); - case "hsl": - return ( - this.hsla || - (this.hsla = h.default._rgbaToHSLA( - this._array, - )), - "hsl(".concat( - this.hsla[0] * this.maxes[d.HSL][0], - ", ", - this.hsla[1] * this.maxes[d.HSL][1], - ", ", - this.hsla[2] * this.maxes[d.HSL][2], - ")", - ) - ); - case "hsl%": - return ( - this.hsla || - (this.hsla = h.default._rgbaToHSLA( - this._array, - )), - "hsl(".concat( - (100 * this.hsla[0]).toPrecision(3), - "%, ", - (100 * this.hsla[1]).toPrecision(3), - "%, ", - (100 * this.hsla[2]).toPrecision(3), - "%)", - ) - ); - case "hsla": - return ( - this.hsla || - (this.hsla = h.default._rgbaToHSLA( - this._array, - )), - "hsla(".concat( - this.hsla[0] * this.maxes[d.HSL][0], - ", ", - this.hsla[1] * this.maxes[d.HSL][1], - ", ", - this.hsla[2] * this.maxes[d.HSL][2], - ", ", - o, - ")", - ) - ); - case "hsla%": - return ( - this.hsla || - (this.hsla = h.default._rgbaToHSLA( - this._array, - )), - "hsl(".concat( - (100 * this.hsla[0]).toPrecision(3), - "%, ", - (100 * this.hsla[1]).toPrecision(3), - "%, ", - (100 * this.hsla[2]).toPrecision(3), - "%, ", - (100 * o).toPrecision(3), - "%)", - ) - ); - default: - return "rgba(".concat( - t[0], - ",", - t[1], - ",", - t[2], - ",", - o, - ")", - ); - } - }, - }, - { - key: "setRed", - value: function (e) { - (this._array[0] = e / this.maxes[d.RGB][0]), - this._calculateLevels(); - }, - }, - { - key: "setGreen", - value: function (e) { - (this._array[1] = e / this.maxes[d.RGB][1]), - this._calculateLevels(); - }, - }, - { - key: "setBlue", - value: function (e) { - (this._array[2] = e / this.maxes[d.RGB][2]), - this._calculateLevels(); - }, - }, - { - key: "setAlpha", - value: function (e) { - (this._array[3] = e / this.maxes[this.mode][3]), - this._calculateLevels(); - }, - }, - { - key: "_calculateLevels", - value: function () { - for ( - var e = this._array, - t = (this.levels = new Array(e.length)), - r = e.length - 1; - 0 <= r; - --r - ) - t[r] = Math.round(255 * e[r]); - (this.hsla = null), (this.hsba = null); - }, - }, - { - key: "_getAlpha", - value: function () { - return this._array[3] * this.maxes[this.mode][3]; - }, - }, - { - key: "_storeModeAndMaxes", - value: function (e, t) { - (this.mode = e), (this.maxes = t); - }, - }, - { - key: "_getMode", - value: function () { - return this.mode; - }, - }, - { - key: "_getMaxes", - value: function () { - return this.maxes; - }, - }, - { - key: "_getBlue", - value: function () { - return this._array[2] * this.maxes[d.RGB][2]; - }, - }, - { - key: "_getBrightness", - value: function () { - return ( - this.hsba || - (this.hsba = h.default._rgbaToHSBA(this._array)), - this.hsba[2] * this.maxes[d.HSB][2] - ); - }, - }, - { - key: "_getGreen", - value: function () { - return this._array[1] * this.maxes[d.RGB][1]; - }, - }, - { - key: "_getHue", - value: function () { - return this.mode === d.HSB - ? (this.hsba || - (this.hsba = h.default._rgbaToHSBA(this._array)), - this.hsba[0] * this.maxes[d.HSB][0]) - : (this.hsla || - (this.hsla = h.default._rgbaToHSLA(this._array)), - this.hsla[0] * this.maxes[d.HSL][0]); - }, - }, - { - key: "_getLightness", - value: function () { - return ( - this.hsla || - (this.hsla = h.default._rgbaToHSLA(this._array)), - this.hsla[2] * this.maxes[d.HSL][2] - ); - }, - }, - { - key: "_getRed", - value: function () { - return this._array[0] * this.maxes[d.RGB][0]; - }, - }, - { - key: "_getSaturation", - value: function () { - return this.mode === d.HSB - ? (this.hsba || - (this.hsba = h.default._rgbaToHSBA(this._array)), - this.hsba[1] * this.maxes[d.HSB][1]) - : (this.hsla || - (this.hsla = h.default._rgbaToHSLA(this._array)), - this.hsla[1] * this.maxes[d.HSL][1]); - }, - }, - ]) && l(e.prototype, t), - r && l(e, r), - c - ); - })()), - n.default.Color); - r.default = u; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./color_conversion": 260, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.constructor": 186, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.trim": 201, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 263: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.fill"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - a = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = l(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function l() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (l = function () { - return e; - }), - e); - } - e("./p5.Color"), - (s.default.prototype.beginClip = function () { - this._renderer.beginClip( - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : {}, - ); - }), - (s.default.prototype.endClip = function () { - this._renderer.endClip(); - }), - (s.default.prototype.clip = function (e, t) { - this._renderer.beginClip(t), e(), this._renderer.endClip(t); - }), - (s.default.prototype.background = function () { - var e; - return (e = this._renderer).background.apply(e, arguments), this; - }), - (s.default.prototype.clear = function () { - return ( - this._renderer.clear( - (arguments.length <= 0 ? void 0 : arguments[0]) || 0, - (arguments.length <= 1 ? void 0 : arguments[1]) || 0, - (arguments.length <= 2 ? void 0 : arguments[2]) || 0, - (arguments.length <= 3 ? void 0 : arguments[3]) || 0, - ), - this - ); - }), - (s.default.prototype.colorMode = function (e, t, r, o, n) { - return ( - s.default._validateParameters("colorMode", arguments), - (e !== a.RGB && e !== a.HSB && e !== a.HSL) || - ((this._colorMode = e), - (e = this._colorMaxes[e]), - 2 === arguments.length - ? ((e[0] = t), (e[1] = t), (e[2] = t), (e[3] = t)) - : 4 === arguments.length - ? ((e[0] = t), (e[1] = r), (e[2] = o)) - : 5 === arguments.length && - ((e[0] = t), (e[1] = r), (e[2] = o), (e[3] = n))), - this - ); - }), - (s.default.prototype.fill = function () { - var e; - return ( - this._renderer._setProperty("_fillSet", !0), - this._renderer._setProperty("_doFill", !0), - (e = this._renderer).fill.apply(e, arguments), - this - ); - }), - (s.default.prototype.noFill = function () { - return this._renderer._setProperty("_doFill", !1), this; - }), - (s.default.prototype.noStroke = function () { - return this._renderer._setProperty("_doStroke", !1), this; - }), - (s.default.prototype.stroke = function () { - var e; - return ( - this._renderer._setProperty("_strokeSet", !0), - this._renderer._setProperty("_doStroke", !0), - (e = this._renderer).stroke.apply(e, arguments), - this - ); - }), - (s.default.prototype.erase = function () { - return ( - this._renderer.erase( - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : 255, - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : 255, - ), - this - ); - }), - (s.default.prototype.noErase = function () { - return this._renderer.noErase(), this; - }); - var n = s.default; - r.default = n; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.Color": 262, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 264: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.QUADRATIC = - r.LINEAR = - r._CTX_MIDDLE = - r._DEFAULT_LEADMULT = - r._DEFAULT_TEXT_FILL = - r.WORD = - r.CHAR = - r.BOLDITALIC = - r.BOLD = - r.ITALIC = - r.NORMAL = - r.BLUR = - r.ERODE = - r.DILATE = - r.POSTERIZE = - r.INVERT = - r.OPAQUE = - r.GRAY = - r.THRESHOLD = - r.BURN = - r.DODGE = - r.SOFT_LIGHT = - r.HARD_LIGHT = - r.OVERLAY = - r.REPLACE = - r.SCREEN = - r.MULTIPLY = - r.EXCLUSION = - r.SUBTRACT = - r.DIFFERENCE = - r.LIGHTEST = - r.DARKEST = - r.ADD = - r.REMOVE = - r.BLEND = - r.UP_ARROW = - r.TAB = - r.SHIFT = - r.RIGHT_ARROW = - r.RETURN = - r.OPTION = - r.LEFT_ARROW = - r.ESCAPE = - r.ENTER = - r.DOWN_ARROW = - r.DELETE = - r.CONTROL = - r.BACKSPACE = - r.ALT = - r.AUTO = - r.HSL = - r.HSB = - r.RGB = - r.MITER = - r.BEVEL = - r.ROUND = - r.SQUARE = - r.PROJECT = - r.PIE = - r.CHORD = - r.OPEN = - r.CLOSE = - r.TESS = - r.QUAD_STRIP = - r.QUADS = - r.TRIANGLE_STRIP = - r.TRIANGLE_FAN = - r.TRIANGLES = - r.LINE_LOOP = - r.LINE_STRIP = - r.LINES = - r.POINTS = - r.BASELINE = - r.BOTTOM = - r.TOP = - r.CENTER = - r.LEFT = - r.RIGHT = - r.RADIUS = - r.CORNERS = - r.CORNER = - r.RAD_TO_DEG = - r.DEG_TO_RAD = - r.RADIANS = - r.DEGREES = - r.TWO_PI = - r.TAU = - r.QUARTER_PI = - r.PI = - r.HALF_PI = - r.WAIT = - r.TEXT = - r.MOVE = - r.HAND = - r.CROSS = - r.ARROW = - r.WEBGL2 = - r.WEBGL = - r.P2D = - r.VERSION = - void 0), - (r.RGBA = - r.HALF_FLOAT = - r.FLOAT = - r.UNSIGNED_INT = - r.UNSIGNED_BYTE = - r.COVER = - r.CONTAIN = - r.FALLBACK = - r.LABEL = - r.AXES = - r.GRID = - r._DEFAULT_FILL = - r._DEFAULT_STROKE = - r.PORTRAIT = - r.LANDSCAPE = - r.SMOOTH = - r.FLAT = - r.MIRROR = - r.CLAMP = - r.REPEAT = - r.NEAREST = - r.IMAGE = - r.IMMEDIATE = - r.TEXTURE = - r.FILL = - r.STROKE = - r.CURVE = - r.BEZIER = - void 0); - var o = Math.PI, - n = - ((r.VERSION = "1.9.0"), - (r.P2D = "p2d"), - (r.WEBGL = "webgl"), - (r.WEBGL2 = "webgl2"), - (r.ARROW = "default"), - (r.CROSS = "crosshair"), - (r.HAND = "pointer"), - (r.MOVE = "move"), - (r.TEXT = "text"), - (r.WAIT = "wait"), - o / 2), - n = ((r.HALF_PI = n), o), - n = ((r.PI = n), o / 4), - n = ((r.QUARTER_PI = n), 2 * o), - n = ((r.TAU = n), 2 * o), - n = - ((r.TWO_PI = n), - (r.DEGREES = "degrees"), - (r.RADIANS = "radians"), - o / 180), - n = ((r.DEG_TO_RAD = n), 180 / o); - (r.RAD_TO_DEG = n), - (r.CORNER = "corner"), - (r.CORNERS = "corners"), - (r.RADIUS = "radius"), - (r.RIGHT = "right"), - (r.LEFT = "left"), - (r.CENTER = "center"), - (r.TOP = "top"), - (r.BOTTOM = "bottom"), - (r.BASELINE = "alphabetic"), - (r.POINTS = 0), - (r.LINES = 1), - (r.LINE_STRIP = 3), - (r.LINE_LOOP = 2), - (r.TRIANGLES = 4), - (r.TRIANGLE_FAN = 6), - (r.TRIANGLE_STRIP = 5), - (r.QUADS = "quads"), - (r.QUAD_STRIP = "quad_strip"), - (r.TESS = "tess"), - (r.CLOSE = "close"), - (r.OPEN = "open"), - (r.CHORD = "chord"), - (r.PIE = "pie"), - (r.PROJECT = "square"), - (r.SQUARE = "butt"), - (r.ROUND = "round"), - (r.BEVEL = "bevel"), - (r.MITER = "miter"), - (r.RGB = "rgb"), - (r.HSB = "hsb"), - (r.HSL = "hsl"), - (r.AUTO = "auto"), - (r.ALT = 18), - (r.BACKSPACE = 8), - (r.CONTROL = 17), - (r.DELETE = 46), - (r.DOWN_ARROW = 40), - (r.ENTER = 13), - (r.ESCAPE = 27), - (r.LEFT_ARROW = 37), - (r.OPTION = 18), - (r.RETURN = 13), - (r.RIGHT_ARROW = 39), - (r.SHIFT = 16), - (r.TAB = 9), - (r.UP_ARROW = 38), - (r.BLEND = "source-over"), - (r.REMOVE = "destination-out"), - (r.ADD = "lighter"), - (r.DARKEST = "darken"), - (r.LIGHTEST = "lighten"), - (r.DIFFERENCE = "difference"), - (r.SUBTRACT = "subtract"), - (r.EXCLUSION = "exclusion"), - (r.MULTIPLY = "multiply"), - (r.SCREEN = "screen"), - (r.REPLACE = "copy"), - (r.OVERLAY = "overlay"), - (r.HARD_LIGHT = "hard-light"), - (r.SOFT_LIGHT = "soft-light"), - (r.DODGE = "color-dodge"), - (r.BURN = "color-burn"), - (r.THRESHOLD = "threshold"), - (r.GRAY = "gray"), - (r.OPAQUE = "opaque"), - (r.INVERT = "invert"), - (r.POSTERIZE = "posterize"), - (r.DILATE = "dilate"), - (r.ERODE = "erode"), - (r.BLUR = "blur"), - (r.NORMAL = "normal"), - (r.ITALIC = "italic"), - (r.BOLD = "bold"), - (r.BOLDITALIC = "bold italic"), - (r.CHAR = "CHAR"), - (r.WORD = "WORD"), - (r._DEFAULT_TEXT_FILL = "#000000"), - (r._DEFAULT_LEADMULT = 1.25), - (r._CTX_MIDDLE = "middle"), - (r.LINEAR = "linear"), - (r.QUADRATIC = "quadratic"), - (r.BEZIER = "bezier"), - (r.CURVE = "curve"), - (r.STROKE = "stroke"), - (r.FILL = "fill"), - (r.TEXTURE = "texture"), - (r.IMMEDIATE = "immediate"), - (r.IMAGE = "image"), - (r.NEAREST = "nearest"), - (r.REPEAT = "repeat"), - (r.CLAMP = "clamp"), - (r.MIRROR = "mirror"), - (r.FLAT = "flat"), - (r.SMOOTH = "smooth"), - (r.LANDSCAPE = "landscape"), - (r.PORTRAIT = "portrait"), - (r._DEFAULT_STROKE = "#000000"), - (r._DEFAULT_FILL = "#FFFFFF"), - (r.GRID = "grid"), - (r.AXES = "axes"), - (r.LABEL = "label"), - (r.FALLBACK = "fallback"), - (r.CONTAIN = "contain"), - (r.COVER = "cover"), - (r.UNSIGNED_BYTE = "unsigned-byte"), - (r.UNSIGNED_INT = "unsigned-int"), - (r.FLOAT = "float"), - (r.HALF_FLOAT = "half-float"); - r.RGBA = "rgba"; - }, - {}, - ], - 265: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.search"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.search"), - e("core-js/modules/es.string.split"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (s = e("./main")) && s.__esModule ? s : { default: s }, - s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("./constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - var l = [s.ARROW, s.CROSS, s.HAND, s.MOVE, s.TEXT, s.WAIT], - u = - ((n.default.prototype._frameRate = 0), - (n.default.prototype._lastFrameTime = window.performance.now()), - (n.default.prototype._targetFrameRate = 60), - window.print), - c = !1; - function d() { - return ( - window.innerWidth || - (document.documentElement && - document.documentElement.clientWidth) || - (document.body && document.body.clientWidth) || - 0 - ); - } - function h() { - return ( - window.innerHeight || - (document.documentElement && - document.documentElement.clientHeight) || - (document.body && document.body.clientHeight) || - 0 - ); - } - (n.default.prototype.print = function () { - var e; - arguments.length - ? (e = console).log.apply(e, arguments) - : c || - (u(), - window.confirm( - "You just tried to print the webpage. Do you want to prevent this from running again?", - ) && (c = !0)); - }), - (n.default.prototype.frameCount = 0), - (n.default.prototype.deltaTime = 0), - (n.default.prototype.focused = document.hasFocus()), - (n.default.prototype.cursor = function (e, t, r) { - var o, - n = "auto", - s = this._curElement.elt; - l.includes(e) - ? (n = e) - : "string" == typeof e && - ((o = ""), - t && - r && - "number" == typeof t && - "number" == typeof r && - (o = "".concat(t, " ").concat(r)), - (n = - "http://" === e.substring(0, 7) || - "https://" === e.substring(0, 8) || - /\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(e) - ? "url(".concat(e, ") ").concat(o, ", auto") - : e)), - (s.style.cursor = n); - }), - (n.default.prototype.frameRate = function (e) { - return ( - n.default._validateParameters("frameRate", arguments), - "number" != typeof e || e < 0 - ? this._frameRate - : (this._setProperty("_targetFrameRate", e), - 0 === e && this._setProperty("_frameRate", e), - this) - ); - }), - (n.default.prototype.getFrameRate = function () { - return this.frameRate(); - }), - (n.default.prototype.setFrameRate = function (e) { - return this.frameRate(e); - }), - (n.default.prototype.getTargetFrameRate = function () { - return this._targetFrameRate; - }), - (n.default.prototype.noCursor = function () { - this._curElement.elt.style.cursor = "none"; - }), - (n.default.prototype.webglVersion = s.P2D), - (n.default.prototype.displayWidth = screen.width), - (n.default.prototype.displayHeight = screen.height), - (n.default.prototype.windowWidth = d()), - (n.default.prototype.windowHeight = h()), - (n.default.prototype._onresize = function (e) { - this._setProperty("windowWidth", d()), - this._setProperty("windowHeight", h()); - var t = this._isGlobal ? window : this; - "function" != typeof t.windowResized || - void 0 === (t = t.windowResized(e)) || - t || - e.preventDefault(); - }), - (n.default.prototype.width = 0), - (n.default.prototype.height = 0), - (n.default.prototype.fullscreen = function (e) { - if ( - (n.default._validateParameters("fullscreen", arguments), - void 0 === e) - ) - return ( - document.fullscreenElement || - document.webkitFullscreenElement || - document.mozFullScreenElement || - document.msFullscreenElement - ); - if (e) { - e = document.documentElement; - if ( - !( - document.fullscreenEnabled || - document.webkitFullscreenEnabled || - document.mozFullScreenEnabled || - document.msFullscreenEnabled - ) - ) - throw new Error("Fullscreen not enabled in this browser."); - e.requestFullscreen - ? e.requestFullscreen() - : e.mozRequestFullScreen - ? e.mozRequestFullScreen() - : e.webkitRequestFullscreen - ? e.webkitRequestFullscreen() - : e.msRequestFullscreen && e.msRequestFullscreen(); - } else - document.exitFullscreen - ? document.exitFullscreen() - : document.mozCancelFullScreen - ? document.mozCancelFullScreen() - : document.webkitExitFullscreen - ? document.webkitExitFullscreen() - : document.msExitFullscreen && - document.msExitFullscreen(); - }), - (n.default.prototype.pixelDensity = function (e) { - var t; - return ( - n.default._validateParameters("pixelDensity", arguments), - "number" == typeof e - ? (e !== this._pixelDensity && (this._pixelDensity = e), - (t = this).resizeCanvas(this.width, this.height, !0)) - : (t = this._pixelDensity), - t - ); - }), - (n.default.prototype.displayDensity = function () { - return window.devicePixelRatio; - }), - (n.default.prototype.getURL = function () { - return location.href; - }), - (n.default.prototype.getURLPath = function () { - return location.pathname.split("/").filter(function (e) { - return "" !== e; - }); - }), - (n.default.prototype.getURLParams = function () { - for ( - var e, t = /[?&]([^&=]+)(?:[&=])([^&=]+)/gim, r = {}; - null != (e = t.exec(location.search)); - - ) - e.index === t.lastIndex && t.lastIndex++, (r[e[1]] = e[2]); - return r; - }); - e = n.default; - r.default = e; - }, - { - "./constants": 264, - "./main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.search": 197, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 266: [ - function (r, e, t) { - "use strict"; - r("core-js/modules/es.symbol"), - r("core-js/modules/es.symbol.description"), - r("core-js/modules/es.symbol.iterator"), - r("core-js/modules/es.array.concat"), - r("core-js/modules/es.array.filter"), - r("core-js/modules/es.array.for-each"), - r("core-js/modules/es.array.includes"), - r("core-js/modules/es.array.iterator"), - r("core-js/modules/es.array.join"), - r("core-js/modules/es.array.map"), - r("core-js/modules/es.array.slice"), - r("core-js/modules/es.array.some"), - r("core-js/modules/es.function.name"), - r("core-js/modules/es.object.assign"), - r("core-js/modules/es.object.get-own-property-names"), - r("core-js/modules/es.object.keys"), - r("core-js/modules/es.object.to-string"), - r("core-js/modules/es.regexp.constructor"), - r("core-js/modules/es.regexp.exec"), - r("core-js/modules/es.regexp.to-string"), - r("core-js/modules/es.string.iterator"), - r("core-js/modules/es.string.match"), - r("core-js/modules/es.string.replace"), - r("core-js/modules/es.string.split"), - r("core-js/modules/es.string.starts-with"), - r("core-js/modules/web.dom-collections.for-each"), - r("core-js/modules/web.dom-collections.iterator"), - r("core-js/modules/es.symbol"), - r("core-js/modules/es.symbol.description"), - r("core-js/modules/es.symbol.iterator"), - r("core-js/modules/es.array.concat"), - r("core-js/modules/es.array.filter"), - r("core-js/modules/es.array.for-each"), - r("core-js/modules/es.array.includes"), - r("core-js/modules/es.array.iterator"), - r("core-js/modules/es.array.join"), - r("core-js/modules/es.array.map"), - r("core-js/modules/es.array.slice"), - r("core-js/modules/es.array.some"), - r("core-js/modules/es.function.name"), - r("core-js/modules/es.object.assign"), - r("core-js/modules/es.object.get-own-property-names"), - r("core-js/modules/es.object.keys"), - r("core-js/modules/es.object.to-string"), - r("core-js/modules/es.regexp.constructor"), - r("core-js/modules/es.regexp.exec"), - r("core-js/modules/es.regexp.to-string"), - r("core-js/modules/es.string.iterator"), - r("core-js/modules/es.string.match"), - r("core-js/modules/es.string.replace"), - r("core-js/modules/es.string.split"), - r("core-js/modules/es.string.starts-with"), - r("core-js/modules/web.dom-collections.for-each"), - r("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(t, "__esModule", { value: !0 }), - (t.default = void 0); - var o = (l = r("../main")) && l.__esModule ? l : { default: l }; - r("../internationalization"); - function n(r, o) { - (o = o || console.log.bind(console)), - s || i(), - s.some(function (e) { - var t; - if ( - r.message && - null !== r.message.match("\\W?".concat(e.name, "\\W")) - ) - return ( - (t = - "function" === e.type ? "".concat(e.name, "()") : e.name), - o( - "Did you just try to use p5.js's " - .concat(t, " ") - .concat( - e.type, - "? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ", - ) - .concat(a), - ), - !0 - ); - }); - } - var s = null, - i = null, - a = - ((o.default._friendlyError = - o.default._checkForUserDefinedFunctions = - o.default._fesErrorMonitor = - function () {}), - (s = null), - "https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"), - i = function () { - function e(r) { - return Object.getOwnPropertyNames(r) - .filter(function (e) { - return "_" !== e[0] && !(e in t) && (t[e] = !0); - }) - .map(function (e) { - var t = - "function" == typeof r[e] - ? "function" - : e === e.toUpperCase() - ? "constant" - : "variable"; - return { name: e, type: t }; - }); - } - var t = {}; - (s = [].concat( - e(o.default.prototype), - e(r("../constants")), - )).sort(function (e, t) { - return t.name.length - e.name.length; - }); - }, - l = - ((o.default.prototype._helpForMisusedAtTopLevelCode = n), - "complete" !== document.readyState && - (window.addEventListener("error", n, !1), - window.addEventListener("load", function () { - window.removeEventListener("error", n, !1); - })), - o.default); - t.default = l; - }, - { - "../constants": 264, - "../internationalization": 273, - "../main": 275, - "./browser_errors": void 0, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.some": 166, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.object.assign": 176, - "core-js/modules/es.object.get-own-property-names": 179, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.constructor": 186, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.match": 193, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.starts-with": 199, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 267: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var o = (o = e("../main")) && o.__esModule ? o : { default: o }; - e("../internationalization"); - o.default._friendlyFileLoadError = function () {}; - e = o.default; - r.default = e; - }, - { "../internationalization": 273, "../main": 275 }, - ], - 268: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - e("core-js/modules/web.dom-collections.for-each"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = O(e("../main")), - s = e("../internationalization"), - a = C(e("../constants")), - l, - u, - c, - d, - h, - f, - p, - m, - y, - g, - v, - b, - j, - _, - x, - w, - S, - T, - M, - E, - I; - function k() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (k = function () { - return e; - }), - e); - } - function C(e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = k(); - if (t && t.has(e)) return t.get(e); - var r, - o, - n = {}, - s = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) - Object.prototype.hasOwnProperty.call(e, r) && - ((o = s ? Object.getOwnPropertyDescriptor(e, r) : null) && - (o.get || o.set) - ? Object.defineProperty(n, r, o) - : (n[r] = e[r])); - return (n.default = e), t && t.set(e, n), n; - } - function O(e) { - return e && e.__esModule ? e : { default: e }; - } - function D(e) { - return L(e) || A(e) || P(); - } - function P() { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - } - function A(e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - } - function L(e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - } - n.default._fesCodeReader = function () {}; - var R = n.default; - r.default = R; - }, - { - "../constants": 264, - "../internationalization": 273, - "../main": 275, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.constructor": 186, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.match": 193, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.trim": 201, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 269: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../main")) && e.__esModule ? e : { default: e }; - function o() { - var t = /(^|@)\S+:\d+/, - r = /^\s*at .*(\S+:\d+|\(native\))/m, - o = /^(eval@)?(\[native code])?$/; - return { - parse: function (e) { - return void 0 !== e.stacktrace || - void 0 !== e["opera#sourceloc"] - ? this.parseOpera(e) - : e.stack && e.stack.match(r) - ? this.parseV8OrIE(e) - : e.stack - ? this.parseFFOrSafari(e) - : void 0; - }, - extractLocation: function (e) { - return -1 === e.indexOf(":") - ? [e] - : [ - (e = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec( - e.replace(/[()]/g, ""), - ))[1], - e[2] || void 0, - e[3] || void 0, - ]; - }, - parseV8OrIE: function (e) { - return e.stack - .split("\n") - .filter(function (e) { - return !!e.match(r); - }, this) - .map(function (e) { - var t = (e = - -1 < e.indexOf("(eval ") - ? e - .replace(/eval code/g, "eval") - .replace(/(\(eval at [^()]*)|(\),.*$)/g, "") - : e) - .replace(/^\s+/, "") - .replace(/\(eval code/g, "("), - r = t.match(/ (\((.+):(\d+):(\d+)\)$)/), - t = (t = r ? t.replace(r[0], "") : t) - .split(/\s+/) - .slice(1), - r = this.extractLocation(r ? r[1] : t.pop()); - return { - functionName: t.join(" ") || void 0, - fileName: - -1 < ["eval", ""].indexOf(r[0]) - ? void 0 - : r[0], - lineNumber: r[1], - columnNumber: r[2], - source: e, - }; - }, this); - }, - parseFFOrSafari: function (e) { - return e.stack - .split("\n") - .filter(function (e) { - return !e.match(o); - }, this) - .map(function (e) { - var t, r; - return -1 === - (e = - -1 < e.indexOf(" > eval") - ? e.replace( - / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, - ":$1", - ) - : e).indexOf("@") && -1 === e.indexOf(":") - ? { functionName: e } - : { - functionName: - (r = e.match((t = /((.*".+"[^@]*)?[^@]*)(?:@)/))) && - r[1] - ? r[1] - : void 0, - fileName: (r = this.extractLocation( - e.replace(t, ""), - ))[0], - lineNumber: r[1], - columnNumber: r[2], - source: e, - }; - }, this); - }, - parseOpera: function (e) { - return !e.stacktrace || - (-1 < e.message.indexOf("\n") && - e.message.split("\n").length > - e.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"), - o = [], - n = 2, - s = r.length; - n < s; - n += 2 - ) { - var i = t.exec(r[n]); - i && - o.push({ fileName: i[2], lineNumber: i[1], source: r[n] }); - } - return o; - }, - parseOpera10: function (e) { - for ( - var t = - /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, - r = e.stacktrace.split("\n"), - o = [], - n = 0, - s = r.length; - n < s; - n += 2 - ) { - var i = t.exec(r[n]); - i && - o.push({ - functionName: i[3] || void 0, - fileName: i[2], - lineNumber: i[1], - source: r[n], - }); - } - return o; - }, - parseOpera11: function (e) { - return e.stack - .split("\n") - .filter(function (e) { - return !!e.match(t) && !e.match(/^Error created at/); - }, this) - .map(function (e) { - var t, - r = e.split("@"), - o = this.extractLocation(r.pop()), - r = r.shift() || ""; - return { - functionName: - r - .replace(//, "$2") - .replace(/\([^)]*\)/g, "") || void 0, - args: - void 0 === - (t = r.match(/\(([^)]*)\)/) - ? r.replace(/^[^(]+\(([^)]*)\)$/, "$1") - : t) || "[arguments not available]" === t - ? void 0 - : t.split(","), - fileName: o[0], - lineNumber: o[1], - columnNumber: o[2], - source: e, - }; - }, this); - }, - }; - } - e.default._getErrorStackParser = function () { - return new o(); - }; - e = e.default; - r.default = e; - }, - { - "../main": 275, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.match": 193, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - }, - ], - 270: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.last-index-of"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.map"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.last-index-of"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (n = e("../main")) && n.__esModule ? n : { default: n }; - (function (e) { - if (e && e.__esModule) return; - if (null === e || ("object" !== a(e) && "function" != typeof e)) - return; - var t = i(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - })(e("../constants")), - e("../internationalization"); - function i() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (i = function () { - return e; - }), - e); - } - function a(e) { - return (a = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - n.default._validateParameters = n.default._clearValidateParamsCache = - function () {}; - e = n.default; - r.default = e; - }, - { - "../../../docs/parameterData.json": void 0, - "../constants": 264, - "../internationalization": 273, - "../main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.last-index-of": 163, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.map": 169, - "core-js/modules/es.number.constructor": 173, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.set": 189, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 271: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("./constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - r.default = { - modeAdjust: function (e, t, r, o, n) { - return n === s.CORNER - ? { x: e, y: t, w: r, h: o } - : n === s.CORNERS - ? { x: e, y: t, w: r - e, h: o - t } - : n === s.RADIUS - ? { x: e - r, y: t - o, w: 2 * r, h: 2 * o } - : n === s.CENTER - ? { x: e - 0.5 * r, y: t - 0.5 * o, w: r, h: o } - : void 0; - }, - }; - }, - { - "./constants": 264, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 272: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"); - var o = (n = e("../core/main")) && n.__esModule ? n : { default: n }; - e("./internationalization"); - var n = Promise.resolve(); - Promise.all([ - new Promise(function (e, t) { - "complete" === document.readyState - ? e() - : window.addEventListener("load", e, !1); - }), - n, - ]).then(function () { - void 0 !== window._setupDone - ? console.warn( - "p5.js seems to have been imported multiple times. Please remove the duplicate import", - ) - : window.mocha || - (((window.setup && "function" == typeof window.setup) || - (window.draw && "function" == typeof window.draw)) && - !o.default.instance && - new o.default()); - }); - }, - { - "../core/main": 275, - "./internationalization": 273, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.promise": 183, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 273: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.setTranslatorLanguage = - r.currentTranslatorLanguage = - r.availableTranslatorLanguages = - r.initialize = - r.translator = - void 0); - var n, - s, - o = a(e("i18next")), - i = a(e("i18next-browser-languagedetector")); - function a(e) { - return e && e.__esModule ? e : { default: e }; - } - function l(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - var u = (function () { - function r(e, t) { - if (!(this instanceof r)) - throw new TypeError("Cannot call a class as a function"); - this.init(e, t); - } - var e, t, o; - return ( - (e = r), - (t = [ - { - key: "fetchWithTimeout", - value: function (e, t) { - var r = - 2 < arguments.length && void 0 !== arguments[2] - ? arguments[2] - : 2e3; - return Promise.race([ - fetch(e, t), - new Promise(function (e, t) { - return setTimeout(function () { - return t(new Error("timeout")); - }, r); - }), - ]); - }, - }, - { - key: "init", - value: function (e) { - var t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : {}; - (this.services = e), (this.options = t); - }, - }, - { - key: "read", - value: function (e, t, r) { - var o = this.options.loadPath; - e === this.options.fallback - ? r(null, n[e][t]) - : s.includes(e) - ? ((o = this.services.interpolator.interpolate(o, { - lng: e, - ns: t, - })), - this.loadUrl(o, r)) - : r("Not found", !1); - }, - }, - { - key: "loadUrl", - value: function (t, r) { - this.fetchWithTimeout(t) - .then( - function (e) { - if (e.ok) return e.json(); - throw new Error("failed loading ".concat(t)); - }, - function () { - throw new Error("failed loading ".concat(t)); - }, - ) - .then(function (e) { - return r(null, e); - }) - .catch(r); - }, - }, - ]) && l(e.prototype, t), - o && l(e, o), - r - ); - })(); - (u.type = "backend"), - (r.translator = function (e, t) { - console.debug( - "p5.js translator called before translations were loaded", - ), - o.default.t(e, t); - }), - (r.initialize = function () { - return o.default - .use(i.default) - .use(u) - .init({ - fallbackLng: "en", - nestingPrefix: "$tr(", - nestingSuffix: ")", - defaultNS: "translation", - returnEmptyString: !1, - interpolation: { escapeValue: !1 }, - detection: { - checkWhitelist: !1, - order: [ - "querystring", - "navigator", - "htmlTag", - "path", - "subdomain", - ], - caches: [], - }, - backend: { - fallback: "en", - loadPath: - "https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json", - }, - partialBundledLanguages: !0, - resources: n, - }) - .then( - function (e) { - r.translator = e; - }, - function (e) { - return console.debug( - "Translations failed to load (".concat(e, ")"), - ); - }, - ); - }), - (r.availableTranslatorLanguages = function () { - return o.default.languages; - }), - (r.currentTranslatorLanguage = function (e) { - return o.default.language; - }); - r.setTranslatorLanguage = function (e) { - return o.default.changeLanguage(e || void 0, function (e) { - return console.debug( - "Translations failed to load (".concat(e, ")"), - ); - }); - }; - }, - { - "../../translations": void 0, - "../../translations/dev": void 0, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.promise": 183, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.split": 198, - "core-js/modules/web.dom-collections.iterator": 238, - i18next: 3, - "i18next-browser-languagedetector": 3, - }, - ], - 274: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("./main")) && e.__esModule ? e : { default: e }; - (e.default.prototype.pushStyle = function () { - throw new Error("pushStyle() not used, see push()"); - }), - (e.default.prototype.popStyle = function () { - throw new Error("popStyle() not used, see pop()"); - }), - (e.default.prototype.popMatrix = function () { - throw new Error("popMatrix() not used, see pop()"); - }), - (e.default.prototype.pushMatrix = function () { - throw new Error("pushMatrix() not used, see push()"); - }); - e = e.default; - r.default = e; - }, - { "./main": 275 }, - ], - 275: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-own-property-names"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.object.get-own-property-names"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - 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 = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("./constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - var l, - u = (function () { - function g(e, t) { - var d = this; - if (!(this instanceof g)) - throw new TypeError("Cannot call a class as a function"); - (this._setupDone = !1), - (this._preloadDone = !1), - (this._pixelDensity = - Math.ceil(window.devicePixelRatio) || 1), - (this._userNode = t), - (this._curElement = null), - (this._elements = []), - (this._glAttributes = null), - (this._requestAnimId = 0), - (this._preloadCount = 0), - (this._isGlobal = !1), - (this._loop = !0), - (this._startListener = null), - this._initializeInstanceVariables(), - (this._defaultCanvasSize = { width: 100, height: 100 }), - (this._events = { - mousemove: null, - mousedown: null, - mouseup: null, - dragend: null, - dragover: null, - click: null, - dblclick: null, - mouseover: null, - mouseout: null, - keydown: null, - keyup: null, - keypress: null, - touchstart: null, - touchmove: null, - touchend: null, - resize: null, - blur: null, - }), - (this._millisStart = -1), - (this._recording = !1), - (this._lcg_random_state = null), - (this._gaussian_previous = !1), - (this._events.wheel = null), - (this._loadingScreenId = "p5_loading"), - (this._registeredMethods = {}); - var t = Object.getOwnPropertyNames( - g.prototype._registeredMethods, - ), - r = !0, - o = !1, - n = void 0; - try { - for ( - var s, i = t[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) { - var a = s.value; - this._registeredMethods[a] = - g.prototype._registeredMethods[a].slice(); - } - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - window.DeviceOrientationEvent && - (this._events.deviceorientation = null), - window.DeviceMotionEvent && - !window._isNodeWebkit && - (this._events.devicemotion = null), - (g.prototype.callRegisteredHooksFor = function (t) { - var e = this || g.prototype, - r = this._isGlobal ? window : this; - if (e._registeredMethods.hasOwnProperty(t)) { - var e = e._registeredMethods[t], - o = !0, - t = !1, - n = void 0; - try { - for ( - var s, i = e[Symbol.iterator](); - !(o = (s = i.next()).done); - o = !0 - ) { - var a = s.value; - "function" == typeof a && a.call(r); - } - } catch (e) { - (t = !0), (n = e); - } finally { - try { - o || null == i.return || i.return(); - } finally { - if (t) throw n; - } - } - } - }), - (this._start = function () { - d._userNode && - "string" == typeof d._userNode && - (d._userNode = document.getElementById(d._userNode)); - var e = d._isGlobal ? window : d; - if (e.preload) { - d.callRegisteredHooksFor("beforePreload"); - var t, - r = document.getElementById(d._loadingScreenId), - o = - (r || - (((r = document.createElement("div")).innerHTML = - "Loading..."), - (r.style.position = "absolute"), - (r.id = d._loadingScreenId), - (d._userNode || document.body).appendChild(r)), - d._preloadMethods); - for (t in o) { - o[t] = o[t] || g; - var n = o[t]; - (n !== g.prototype && n !== g) || - (d._isGlobal && (window[t] = d._wrapPreload(d, t)), - (n = d)), - (d._registeredPreloadMethods[t] = n[t]), - (n[t] = d._wrapPreload(n, t)); - } - e.preload(), d._runIfPreloadsAreDone(); - } else d._setup(), d._recording || d._draw(); - }), - (this._runIfPreloadsAreDone = function () { - var e, - t = this._isGlobal ? window : this; - 0 === t._preloadCount && - ((e = document.getElementById(t._loadingScreenId)) && - e.parentNode.removeChild(e), - this.callRegisteredHooksFor("afterPreload"), - this._setupDone || - ((this._lastTargetFrameTime = window.performance.now()), - (this._lastRealFrameTime = window.performance.now()), - t._setup(), - this._recording || t._draw())); - }), - (this._decrementPreload = function () { - var e = this._isGlobal ? window : this; - e._preloadDone || - "function" != typeof e.preload || - (e._setProperty("_preloadCount", e._preloadCount - 1), - e._runIfPreloadsAreDone()); - }), - (this._wrapPreload = function (o, n) { - var s = this; - return function () { - s._incrementPreload(); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return s._registeredPreloadMethods[n].apply(o, t); - }; - }), - (this._incrementPreload = function () { - var e = this._isGlobal ? window : this; - e._preloadDone || - e._setProperty("_preloadCount", e._preloadCount + 1); - }), - (this._setup = function () { - d.callRegisteredHooksFor("beforeSetup"), - d.createCanvas( - d._defaultCanvasSize.width, - d._defaultCanvasSize.height, - "p2d", - ); - var e = d._isGlobal ? window : d; - if ("function" == typeof e.preload) - for (var t in d._preloadMethods) - (e[t] = d._preloadMethods[t][t]), - e[t] && d && (e[t] = e[t].bind(d)); - (d._millisStart = window.performance.now()), - (e._preloadDone = !0), - "function" == typeof e.setup && e.setup(); - var r = document.getElementsByTagName("canvas"), - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = r[Symbol.iterator](); - !(o = (i = a.next()).done); - o = !0 - ) { - var l = i.value; - "true" === l.dataset.hidden && - ((l.style.visibility = ""), delete l.dataset.hidden); - } - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - (d._lastTargetFrameTime = window.performance.now()), - (d._lastRealFrameTime = window.performance.now()), - (d._setupDone = !0), - (d._accessibleOutputs.grid || - d._accessibleOutputs.text) && - d._updateAccsOutput(), - d.callRegisteredHooksFor("afterSetup"); - }), - (this._draw = function () { - var e = window.performance.now(), - t = e - d._lastTargetFrameTime, - r = 1e3 / d._targetFrameRate; - (!d._loop || r - 5 <= t) && - ((d.deltaTime = e - d._lastRealFrameTime), - d._setProperty("deltaTime", d.deltaTime), - (d._frameRate = 1e3 / d.deltaTime), - d.redraw(), - (d._lastTargetFrameTime = Math.max( - d._lastTargetFrameTime + r, - e, - )), - (d._lastRealFrameTime = e), - void 0 !== d._updateMouseCoords && - (d._updateMouseCoords(), - d._setProperty("movedX", 0), - d._setProperty("movedY", 0))), - d._loop && - (d._requestAnimId = window.requestAnimationFrame( - d._draw, - )); - }), - (this._setProperty = function (e, t) { - (d[e] = t), d._isGlobal && (window[e] = t); - }), - (this.remove = function () { - d._startListener && - window.removeEventListener("load", d._startListener, !1); - var t = document.getElementById(d._loadingScreenId); - if ( - (t && - (t.parentNode.removeChild(t), d._incrementPreload()), - d._curElement) - ) { - for (var e in ((d._loop = !1), - d._requestAnimId && - window.cancelAnimationFrame(d._requestAnimId), - d._events)) - window.removeEventListener(e, d._events[e]); - var r = !0, - t = !1, - o = void 0; - try { - for ( - var n, s = d._elements[Symbol.iterator](); - !(r = (n = s.next()).done); - r = !0 - ) { - var i, - a = n.value; - for (i in (a.elt && - a.elt.parentNode && - a.elt.parentNode.removeChild(a.elt), - a._events)) - a.elt.removeEventListener(i, a._events[i]); - } - } catch (e) { - (t = !0), (o = e); - } finally { - try { - r || null == s.return || s.return(); - } finally { - if (t) throw o; - } - } - var l = d; - d._registeredMethods.remove.forEach(function (e) { - void 0 !== e && e.call(l); - }); - } - if (d._isGlobal) { - for (var u in g.prototype) - try { - delete window[u]; - } catch (e) { - window[u] = void 0; - } - for (var c in d) - if (d.hasOwnProperty(c)) - try { - delete window[c]; - } catch (e) { - window[c] = void 0; - } - g.instance = null; - } - }), - this._registeredMethods.init.forEach(function (e) { - void 0 !== e && e.call(this); - }, this), - this._setupPromisePreloads(); - var l, - u, - c = this._createFriendlyGlobalFunctionBinder(); - if (e) e(this), g._checkForUserDefinedFunctions(this); - else { - for (var h in ((this._isGlobal = !0), - (g.instance = this), - g.prototype)) - "function" == typeof g.prototype[h] - ? ((l = h.substring(2)), - this._events.hasOwnProperty(l) || - (Math.hasOwnProperty(h) && Math[h] === g.prototype[h] - ? c(h, g.prototype[h]) - : c(h, g.prototype[h].bind(this)))) - : c(h, g.prototype[h]); - for (var f in this) this.hasOwnProperty(f) && c(f, this[f]); - } - for (u in this._events) { - var p = this["_on".concat(u)]; - p && - ((p = p.bind(this)), - window.addEventListener(u, p, { passive: !1 }), - (this._events[u] = p)); - } - function m() { - d._setProperty("focused", !0); - } - function y() { - d._setProperty("focused", !1); - } - window.addEventListener("focus", m), - window.addEventListener("blur", y), - this.registerMethod("remove", function () { - window.removeEventListener("focus", m), - window.removeEventListener("blur", y); - }), - "complete" === document.readyState - ? this._start() - : ((this._startListener = this._start.bind(this)), - window.addEventListener("load", this._startListener, !1)); - } - var e, t, r; - return ( - (e = g), - (t = [ - { - key: "_initializeInstanceVariables", - value: function () { - (this._accessibleOutputs = { - text: !1, - grid: !1, - textLabel: !1, - gridLabel: !1, - }), - (this._styles = []), - (this._bezierDetail = 20), - (this._curveDetail = 20), - (this._colorMode = n.RGB), - (this._colorMaxes = { - rgb: [255, 255, 255, 255], - hsb: [360, 100, 100, 1], - hsl: [360, 100, 100, 1], - }), - (this._downKeys = {}); - }, - }, - { - key: "registerPreloadMethod", - value: function (e, t) { - g.prototype._preloadMethods.hasOwnProperty(e) || - (g.prototype._preloadMethods[e] = t); - }, - }, - { - key: "registerMethod", - value: function (e, t) { - var r = this || g.prototype; - r._registeredMethods.hasOwnProperty(e) || - (r._registeredMethods[e] = []), - r._registeredMethods[e].push(t); - }, - }, - { - key: "unregisterMethod", - value: function (e, t) { - var r = this || g.prototype; - if (r._registeredMethods.hasOwnProperty(e)) { - for ( - var o = r._registeredMethods[e], n = [], s = 0; - s < o.length; - s++ - ) - o[s] === t && n.push(s); - for (var i = n.length - 1; 0 <= i; i--) - o.splice(n[i], 1); - } - }, - }, - { - key: "_createFriendlyGlobalFunctionBinder", - value: function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : {}, - r = e.globalObject || window; - e.log || console.log.bind(console); - return function (e, t) { - g.disableFriendlyErrors, (r[e] = t); - }; - }, - }, - ]) && s(e.prototype, t), - r && s(e, r), - g - ); - })(); - for (l in ((u.instance = null), (u.disableFriendlyErrors = !1), n)) - u.prototype[l] = n[l]; - (u.VERSION = n.VERSION), - (u.prototype._preloadMethods = { - loadJSON: u.prototype, - loadImage: u.prototype, - loadStrings: u.prototype, - loadXML: u.prototype, - loadBytes: u.prototype, - loadTable: u.prototype, - loadFont: u.prototype, - loadModel: u.prototype, - loadShader: u.prototype, - }), - (u.prototype._registeredMethods = { - init: [], - pre: [], - post: [], - remove: [], - }), - (u.prototype._registeredPreloadMethods = {}), - (r.default = u); - }, - { - "./constants": 264, - "./shim": 286, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-own-property-names": 179, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 276: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (e = e("./main")) && e.__esModule ? e : { default: e }; - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - n.default.Element = (function () { - function r(e, t) { - if (!(this instanceof r)) - throw new TypeError("Cannot call a class as a function"); - (this.elt = e), - (this._pInst = this._pixelsState = t), - (this._events = {}), - (this.width = this.elt.offsetWidth), - (this.height = this.elt.offsetHeight); - } - var e, t, o; - return ( - (e = r), - (o = [ - { - key: "_adjustListener", - value: function (e, t, r) { - return ( - !1 === t - ? n.default.Element._detachListener(e, r) - : n.default.Element._attachListener(e, t, r), - this - ); - }, - }, - { - key: "_attachListener", - value: function (e, t, r) { - r._events[e] && n.default.Element._detachListener(e, r); - t = t.bind(r); - r.elt.addEventListener(e, t, !1), (r._events[e] = t); - }, - }, - { - key: "_detachListener", - value: function (e, t) { - var r = t._events[e]; - t.elt.removeEventListener(e, r, !1), (t._events[e] = null); - }, - }, - ]), - (t = [ - { - key: "parent", - value: function (e) { - return void 0 === e - ? this.elt.parentNode - : ("string" == typeof e - ? ("#" === e[0] && (e = e.substring(1)), - (e = document.getElementById(e))) - : e instanceof n.default.Element && (e = e.elt), - e.appendChild(this.elt), - this); - }, - }, - { - key: "id", - value: function (e) { - return void 0 === e - ? this.elt.id - : ((this.elt.id = e), - (this.width = this.elt.offsetWidth), - (this.height = this.elt.offsetHeight), - this); - }, - }, - { - key: "class", - value: function (e) { - return void 0 === e - ? this.elt.className - : ((this.elt.className = e), this); - }, - }, - { - key: "mousePressed", - value: function (t) { - return ( - n.default.Element._adjustListener( - "mousedown", - function (e) { - return ( - this._pInst._setProperty("mouseIsPressed", !0), - this._pInst._setMouseButton(e), - t.call(this, e) - ); - }, - this, - ), - this - ); - }, - }, - { - key: "doubleClicked", - value: function (e) { - return ( - n.default.Element._adjustListener("dblclick", e, this), - this - ); - }, - }, - { - key: "mouseWheel", - value: function (e) { - return ( - n.default.Element._adjustListener("wheel", e, this), this - ); - }, - }, - { - key: "mouseReleased", - value: function (e) { - return ( - n.default.Element._adjustListener("mouseup", e, this), - this - ); - }, - }, - { - key: "mouseClicked", - value: function (e) { - return ( - n.default.Element._adjustListener("click", e, this), this - ); - }, - }, - { - key: "mouseMoved", - value: function (e) { - return ( - n.default.Element._adjustListener("mousemove", e, this), - this - ); - }, - }, - { - key: "mouseOver", - value: function (e) { - return ( - n.default.Element._adjustListener("mouseover", e, this), - this - ); - }, - }, - { - key: "mouseOut", - value: function (e) { - return ( - n.default.Element._adjustListener("mouseout", e, this), - this - ); - }, - }, - { - key: "touchStarted", - value: function (e) { - return ( - n.default.Element._adjustListener("touchstart", e, this), - this - ); - }, - }, - { - key: "touchMoved", - value: function (e) { - return ( - n.default.Element._adjustListener("touchmove", e, this), - this - ); - }, - }, - { - key: "touchEnded", - value: function (e) { - return ( - n.default.Element._adjustListener("touchend", e, this), - this - ); - }, - }, - { - key: "dragOver", - value: function (e) { - return ( - n.default.Element._adjustListener("dragover", e, this), - this - ); - }, - }, - { - key: "dragLeave", - value: function (e) { - return ( - n.default.Element._adjustListener("dragleave", e, this), - this - ); - }, - }, - { - key: "_setProperty", - value: function (e, t) { - this[e] = t; - }, - }, - ]) && s(e.prototype, t), - o && s(e, o), - r - ); - })(); - e = n.default.Element; - r.default = e; - }, - { "./main": 275 }, - ], - 277: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.object.get-prototype-of"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var c = (u = e("./main")) && u.__esModule ? u : { default: u }, - d = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("./constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function s(e, t) { - return (s = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function h(r) { - return function () { - var e, - t = l(r); - return f( - this, - (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = l(this).constructor), - Reflect.construct(t, arguments, e)) - : t.apply(this, arguments), - ); - }; - } - function f(e, t) { - return !t || ("object" !== i(t) && "function" != typeof t) - ? p(e) - : t; - } - function p(e) { - if (void 0 === e) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return e; - } - function l(e) { - return (l = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - c.default.Graphics = (function (e) { - var t = u; - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && s(t, e); - var r, - l = h(u); - function u(e, t, r, o, n) { - var s; - if (!(this instanceof u)) - throw new TypeError("Cannot call a class as a function"); - (a = n || document.createElement("canvas")), - ((s = l.call(this, a, o)).canvas = a); - var i, - a = r || d.P2D, - r = o._userNode || document.body; - for (i in (n || r.appendChild(s.canvas), c.default.prototype)) - s[i] || - ("function" == typeof c.default.prototype[i] - ? (s[i] = c.default.prototype[i].bind(p(s))) - : (s[i] = c.default.prototype[i])); - return ( - c.default.prototype._initializeInstanceVariables.apply(p(s)), - (s.width = e), - (s.height = t), - (s._pixelDensity = o._pixelDensity), - a === d.WEBGL - ? (s._renderer = new c.default.RendererGL(s.canvas, p(s), !1)) - : (s._renderer = new c.default.Renderer2D( - s.canvas, - p(s), - !1, - )), - o._elements.push(p(s)), - Object.defineProperty(p(s), "deltaTime", { - get: function () { - return this._pInst.deltaTime; - }, - }), - s._renderer.resize(e, t), - s._renderer._applyDefaults(), - f(s, p(s)) - ); - } - return ( - (t = u), - (e = [ - { - key: "reset", - value: function () { - this._renderer.resetMatrix(), - this._renderer.isP3D && this._renderer._update(); - }, - }, - { - key: "remove", - value: function () { - this.elt.parentNode && - this.elt.parentNode.removeChild(this.elt); - var e, - t = this._pInst._elements.indexOf(this); - for (e in (-1 !== t && this._pInst._elements.splice(t, 1), - this._events)) - this.elt.removeEventListener(e, this._events[e]); - }, - }, - { - key: "createFramebuffer", - value: function (e) { - return new c.default.Framebuffer(this, e); - }, - }, - ]) && n(t.prototype, e), - r && n(t, r), - u - ); - })(c.default.Element); - var u = c.default.Graphics; - r.default = u; - }, - { - "./constants": 264, - "./main": 275, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 278: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var a = (s = e("./main")) && s.__esModule ? s : { default: s }, - P = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== l(e) && "function" != typeof e)) - return { default: e }; - var t = i(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function i() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (i = function () { - return e; - }), - e); - } - function l(e) { - return (l = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - function u(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function c(e, t) { - return (c = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function d(o) { - return function () { - var e, - t, - r = n(o); - return ( - (e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = n(this).constructor), - Reflect.construct(r, arguments, e)) - : r.apply(this, arguments)), - (r = this), - !(t = e) || ("object" !== l(t) && "function" != typeof t) - ? h(r) - : t - ); - }; - } - function h(e) { - if (void 0 === e) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return e; - } - function n(e) { - return (n = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - var s = (function (e) { - var t = s; - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && c(t, e); - var r, - n = d(s); - function s(e, t, r) { - var o; - if (this instanceof s) - return ( - ((o = n.call(this, e, t)).canvas = e), - (o._pixelsState = t), - r - ? ((o._isMainCanvas = !0), - o._pInst._setProperty("_curElement", h(o)), - o._pInst._setProperty("canvas", o.canvas), - o._pInst._setProperty("width", o.width), - o._pInst._setProperty("height", o.height)) - : ((o.canvas.style.display = "none"), (o._styles = [])), - (o._clipping = !1), - (o._clipInvert = !1), - (o._textSize = 12), - (o._textLeading = 15), - (o._textFont = "sans-serif"), - (o._textStyle = P.NORMAL), - (o._textAscent = null), - (o._textDescent = null), - (o._textAlign = P.LEFT), - (o._textBaseline = P.BASELINE), - (o._textWrap = P.WORD), - (o._rectMode = P.CORNER), - (o._ellipseMode = P.CENTER), - (o._curveTightness = 0), - (o._imageMode = P.CORNER), - (o._tint = null), - (o._doStroke = !0), - (o._doFill = !0), - (o._strokeSet = !1), - (o._fillSet = !1), - (o._leadingSet = !1), - (o._pushPopDepth = 0), - o - ); - throw new TypeError("Cannot call a class as a function"); - } - return ( - (t = s), - (e = [ - { - key: "push", - value: function () { - return ( - this._pushPopDepth++, - { - properties: { - _doStroke: this._doStroke, - _strokeSet: this._strokeSet, - _doFill: this._doFill, - _fillSet: this._fillSet, - _tint: this._tint, - _imageMode: this._imageMode, - _rectMode: this._rectMode, - _ellipseMode: this._ellipseMode, - _textFont: this._textFont, - _textLeading: this._textLeading, - _leadingSet: this._leadingSet, - _textSize: this._textSize, - _textAlign: this._textAlign, - _textBaseline: this._textBaseline, - _textStyle: this._textStyle, - _textWrap: this._textWrap, - }, - } - ); - }, - }, - { - key: "pop", - value: function (e) { - this._pushPopDepth--, - e.properties && Object.assign(this, e.properties); - }, - }, - { - key: "beginClip", - value: function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : {}; - if (this._clipping) - throw new Error( - "It looks like you're trying to clip while already in the middle of clipping. Did you forget to endClip()?", - ); - (this._clipping = !0), (this._clipInvert = e.invert); - }, - }, - { - key: "endClip", - value: function () { - if (!this._clipping) - throw new Error( - "It looks like you've called endClip() without beginClip(). Did you forget to call beginClip() first?", - ); - this._clipping = !1; - }, - }, - { - key: "resize", - value: function (e, t) { - (this.width = e), - (this.height = t), - (this.elt.width = e * this._pInst._pixelDensity), - (this.elt.height = t * this._pInst._pixelDensity), - (this.elt.style.width = "".concat(e, "px")), - (this.elt.style.height = "".concat(t, "px")), - this._isMainCanvas && - (this._pInst._setProperty("width", this.width), - this._pInst._setProperty("height", this.height)); - }, - }, - { - key: "get", - value: function (e, t, r, o) { - var n = this._pixelsState, - s = n._pixelDensity, - i = this.canvas; - if (void 0 === e && void 0 === t) - (e = t = 0), (r = n.width), (o = n.height); - else if (((e *= s), (t *= s), void 0 === r && void 0 === o)) - return e < 0 || t < 0 || e >= i.width || t >= i.height - ? [0, 0, 0, 0] - : this._getPixel(e, t); - n = new a.default.Image(r * s, o * s); - return ( - n.pixelDensity(s), - n.canvas - .getContext("2d") - .drawImage(i, e, t, r * s, o * s, 0, 0, r * s, o * s), - n - ); - }, - }, - { - key: "textLeading", - value: function (e) { - return "number" == typeof e - ? (this._setProperty("_leadingSet", !0), - this._setProperty("_textLeading", e), - this._pInst) - : this._textLeading; - }, - }, - { - key: "textStyle", - value: function (e) { - return e - ? ((e !== P.NORMAL && - e !== P.ITALIC && - e !== P.BOLD && - e !== P.BOLDITALIC) || - this._setProperty("_textStyle", e), - this._applyTextProperties()) - : this._textStyle; - }, - }, - { - key: "textAscent", - value: function () { - return ( - null === this._textAscent && this._updateTextMetrics(), - this._textAscent - ); - }, - }, - { - key: "textDescent", - value: function () { - return ( - null === this._textDescent && this._updateTextMetrics(), - this._textDescent - ); - }, - }, - { - key: "textAlign", - value: 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, - }; - }, - }, - { - key: "textWrap", - value: function (e) { - return this._setProperty("_textWrap", e), this._textWrap; - }, - }, - { - key: "text", - value: function (e, t, r, o, n) { - var s, - i, - a, - l, - u = this._pInst, - c = this._textWrap, - d = Number.MAX_VALUE, - h = r; - if ((this._doFill || this._doStroke) && void 0 !== e) { - if ( - ((s = (e = (e = - "string" != typeof e ? e.toString() : e).replace( - /(\t)/g, - " ", - )).split("\n")), - void 0 !== o) - ) { - switch ( - (this._rectMode === P.CENTER && (t -= o / 2), - this._textAlign) - ) { - case P.CENTER: - t += o / 2; - break; - case P.RIGHT: - t += o; - } - if (void 0 !== n) { - this._rectMode === P.CENTER && - ((r -= n / 2), (h -= n / 2)); - var e = r, - f = u.textAscent(); - switch (this._textBaseline) { - case P.BOTTOM: - (l = r + n), (r = Math.max(l, r)), (h += f); - break; - case P.CENTER: - (l = r + n / 2), - (r = Math.max(l, r)), - (h += f / 2); - } - (d = r + n - f), - this._textBaseline === P.CENTER && - (d = e + n - f / 2); - } else - (this._textBaseline !== P.BOTTOM && - this._textBaseline !== P.CENTER) || - ((h = - r - (e = u.textSize() * this._textLeading) / 2), - (d = r + e / 2)); - if (c === P.WORD) { - for (var p = [], m = 0; m < s.length; m++) { - for ( - var y = "", g = s[m].split(" "), v = 0; - v < g.length; - v++ - ) - (i = "".concat(y + g[v]) + " "), - (y = - o < (a = this.textWidth(i)) && 0 < y.length - ? (p.push(y), "".concat(g[v]) + " ") - : i); - p.push(y); - } - var b = 0; - this._textBaseline === P.CENTER - ? (b = ((p.length - 1) * u.textLeading()) / 2) - : this._textBaseline === P.BOTTOM && - (b = (p.length - 1) * u.textLeading()); - for (var j = 0; j < s.length; j++) { - (y = ""), (g = s[j].split(" ")); - for (var _ = 0; _ < g.length; _++) - (i = "".concat(y + g[_]) + " "), - o < (a = this.textWidth(i)) && 0 < y.length - ? (this._renderText( - u, - y.trim(), - t, - r - b, - d, - h, - ), - (y = "".concat(g[_]) + " "), - (r += u.textLeading())) - : (y = i); - this._renderText(u, y.trim(), t, r - b, d, h), - (r += u.textLeading()); - } - } else { - for (var x = [], w = 0; w < s.length; w++) - for ( - var S = s[w].split((y = "")), T = 0; - T < S.length; - T++ - ) - (i = "".concat(y + S[T])), - (a = this.textWidth(i)) <= o - ? (y += S[T]) - : o < a && - 0 < y.length && - (x.push(y), (y = "".concat(S[T]))); - x.push(y); - var M = 0; - this._textBaseline === P.CENTER - ? (M = ((x.length - 1) * u.textLeading()) / 2) - : this._textBaseline === P.BOTTOM && - (M = (x.length - 1) * u.textLeading()); - for (var E = 0; E < s.length; E++) { - S = s[E].split((y = "")); - for (var k = 0; k < S.length; k++) - (i = "".concat(y + S[k])), - (a = this.textWidth(i)) <= o - ? (y += S[k]) - : o < a && - 0 < y.length && - (this._renderText( - u, - y.trim(), - t, - r - M, - d, - h, - ), - (r += u.textLeading()), - (y = "".concat(S[k]))); - } - this._renderText(u, y.trim(), t, r - M, d, h), - (r += u.textLeading()); - } - } else { - var C = 0; - this._textBaseline === P.CENTER - ? (C = ((s.length - 1) * u.textLeading()) / 2) - : this._textBaseline === P.BOTTOM && - (C = (s.length - 1) * u.textLeading()); - for (var O = 0; O < s.length; O++) - this._renderText(u, s[O], t, r - C, d, h - C), - (r += u.textLeading()); - } - return u; - } - }, - }, - { - key: "_applyDefaults", - value: function () { - return this; - }, - }, - { - key: "_isOpenType", - value: function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : this._textFont; - return "object" === l(e) && e.font && e.font.supported; - }, - }, - { - key: "_updateTextMetrics", - value: function () { - var e, t, r, o, n, s; - return ( - this._isOpenType() - ? (this._setProperty( - "_textAscent", - this._textFont._textAscent(), - ), - this._setProperty( - "_textDescent", - this._textFont._textDescent(), - )) - : (((e = - document.createElement("span")).style.fontFamily = - this._textFont), - (e.style.fontSize = "".concat(this._textSize, "px")), - (e.innerHTML = "ABCjgq|"), - ((s = document.createElement("div")).style.display = - "inline-block"), - (s.style.width = "1px"), - (s.style.height = "0px"), - (o = - ((t = document.createElement("div")).appendChild(e), - t.appendChild(s), - (t.style.height = "0px"), - (t.style.overflow = "hidden"), - document.body.appendChild(t), - (s.style.verticalAlign = "baseline"), - f(s))), - (n = f(e)), - (r = o[1] - n[1]), - (o = ((s.style.verticalAlign = "bottom"), f(s))), - (n = f(e)), - (s = o[1] - n[1] - r), - document.body.removeChild(t), - this._setProperty("_textAscent", r), - this._setProperty("_textDescent", s)), - this - ); - }, - }, - ]) && u(t.prototype, e), - r && u(t, r), - s - ); - })(a.default.Element); - function f(e) { - var t = 0, - r = 0; - if (e.offsetParent) - for ( - ; - (t += e.offsetLeft), (r += e.offsetTop), (e = e.offsetParent); - - ); - else (t += e.offsetLeft), (r += e.offsetTop); - return [t, r]; - } - (s.prototype.textSize = function (e) { - return "number" == typeof e - ? (this._setProperty("_textSize", e), - this._leadingSet || - this._setProperty("_textLeading", e * P._DEFAULT_LEADMULT), - this._applyTextProperties()) - : this._textSize; - }), - (a.default.Renderer = s); - e = a.default.Renderer; - r.default = e; - }, - { - "../core/constants": 264, - "./main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.number.constructor": 173, - "core-js/modules/es.object.assign": 176, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.trim": 201, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 279: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.reflect.get"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var d = (n = e("./main")) && n.__esModule ? n : { default: n }, - p = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("./constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function l(e, t, r) { - return (l = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (e, t, r) { - var e = (function (e, t) { - for ( - ; - !Object.prototype.hasOwnProperty.call(e, t) && - null !== (e = h(e)); - - ); - return e; - })(e, t); - if (e) - return (e = Object.getOwnPropertyDescriptor(e, t)).get - ? e.get.call(r) - : e.value; - })(e, t, r || e); - } - function u(e, t) { - return (u = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function c(r) { - return function () { - var e, - t = h(r), - t = - ((e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = h(this).constructor), - Reflect.construct(t, arguments, e)) - : t.apply(this, arguments)), - this); - if (!e || ("object" !== i(e) && "function" != typeof e)) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return e; - }; - } - function h(e) { - return (h = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - e("./p5.Renderer"); - var f = "rgba(0,0,0,0)", - n = (function (e) { - var t = n; - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && u(t, e); - var r, - o = c(n); - function n(e, t, r) { - if (this instanceof n) - return ( - ((e = o.call(this, e, t, r)).drawingContext = - e.canvas.getContext("2d")), - e._pInst._setProperty("drawingContext", e.drawingContext), - e - ); - throw new TypeError("Cannot call a class as a function"); - } - return ( - (t = n), - (e = [ - { - key: "getFilterGraphicsLayer", - value: function () { - var e; - return ( - this.filterGraphicsLayer || - ((e = ( - this._pInst instanceof d.default.Graphics - ? this._pInst - : this - )._pInst), - (this.filterGraphicsLayer = new d.default.Graphics( - this.width, - this.height, - p.WEBGL, - e, - ))), - (this.filterGraphicsLayer.width === this.width && - this.filterGraphicsLayer.height === this.height) || - this.filterGraphicsLayer.resizeCanvas( - this.width, - this.height, - ), - this.filterGraphicsLayer.pixelDensity() !== - this._pInst.pixelDensity() && - this.filterGraphicsLayer.pixelDensity( - this._pInst.pixelDensity(), - ), - this.filterGraphicsLayer - ); - }, - }, - { - key: "_applyDefaults", - value: function () { - (this._cachedFillStyle = this._cachedStrokeStyle = - void 0), - (this._cachedBlendMode = p.BLEND), - this._setFill(p._DEFAULT_FILL), - this._setStroke(p._DEFAULT_STROKE), - (this.drawingContext.lineCap = p.ROUND), - (this.drawingContext.font = "normal 12px sans-serif"); - }, - }, - { - key: "resize", - value: function (e, t) { - l(h(n.prototype), "resize", this).call(this, e, t), - this.drawingContext.scale( - this._pInst._pixelDensity, - this._pInst._pixelDensity, - ); - }, - }, - { - key: "background", - value: function () { - var e, t; - this.drawingContext.save(), - this.resetMatrix(), - (arguments.length <= 0 - ? void 0 - : arguments[0]) instanceof d.default.Image - ? 0 <= (arguments.length <= 1 ? void 0 : arguments[1]) - ? ((e = - arguments.length <= 0 ? void 0 : arguments[0]), - (this.drawingContext.globalAlpha = - (arguments.length <= 1 - ? void 0 - : arguments[1]) / 255), - this._pInst.image( - e, - 0, - 0, - this.width, - this.height, - )) - : this._pInst.image( - arguments.length <= 0 ? void 0 : arguments[0], - 0, - 0, - this.width, - this.height, - ) - : ((e = this._getFill()), - (t = (t = this._pInst).color.apply(t, arguments)), - this._pInst._addAccsOutput() && - this._pInst._accsBackground(t.levels), - (t = t.toString()), - this._setFill(t), - this._isErasing && - this.blendMode(this._cachedBlendMode), - this.drawingContext.fillRect( - 0, - 0, - this.width, - this.height, - ), - this._setFill(e), - this._isErasing && this._pInst.erase()), - this.drawingContext.restore(); - }, - }, - { - key: "clear", - value: function () { - this.drawingContext.save(), - this.resetMatrix(), - this.drawingContext.clearRect( - 0, - 0, - this.width, - this.height, - ), - this.drawingContext.restore(); - }, - }, - { - key: "fill", - value: function () { - var e = (e = this._pInst).color.apply(e, arguments); - this._setFill(e.toString()), - this._pInst._addAccsOutput() && - this._pInst._accsCanvasColors("fill", e.levels); - }, - }, - { - key: "stroke", - value: function () { - var e = (e = this._pInst).color.apply(e, arguments); - this._setStroke(e.toString()), - this._pInst._addAccsOutput() && - this._pInst._accsCanvasColors("stroke", e.levels); - }, - }, - { - key: "erase", - value: function (e, t) { - this._isErasing || - ((this._cachedFillStyle = - this.drawingContext.fillStyle), - (e = this._pInst.color(255, e).toString()), - (this.drawingContext.fillStyle = e), - (this._cachedStrokeStyle = - this.drawingContext.strokeStyle), - (e = this._pInst.color(255, t).toString()), - (this.drawingContext.strokeStyle = e), - (t = this._cachedBlendMode), - this.blendMode(p.REMOVE), - (this._cachedBlendMode = t), - (this._isErasing = !0)); - }, - }, - { - key: "noErase", - value: function () { - this._isErasing && - ((this.drawingContext.fillStyle = - this._cachedFillStyle), - (this.drawingContext.strokeStyle = - this._cachedStrokeStyle), - this.blendMode(this._cachedBlendMode), - (this._isErasing = !1)); - }, - }, - { - key: "beginClip", - value: function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : {}, - e = - (l(h(n.prototype), "beginClip", this).call(this, e), - (this._cachedFillStyle = - this.drawingContext.fillStyle), - this._pInst.color(255, 0).toString()), - e = - ((this.drawingContext.fillStyle = e), - (this._cachedStrokeStyle = - this.drawingContext.strokeStyle), - this._pInst.color(255, 0).toString()), - e = - ((this.drawingContext.strokeStyle = e), - this._cachedBlendMode); - this.blendMode(p.BLEND), - (this._cachedBlendMode = e), - this.drawingContext.beginPath(), - this._clipInvert && - (this.drawingContext.moveTo( - -2 * this.width, - -2 * this.height, - ), - this.drawingContext.lineTo( - -2 * this.width, - 2 * this.height, - ), - this.drawingContext.lineTo( - 2 * this.width, - 2 * this.height, - ), - this.drawingContext.lineTo( - 2 * this.width, - -2 * this.height, - ), - this.drawingContext.closePath()); - }, - }, - { - key: "endClip", - value: function () { - this._doFillStrokeClose(), - this.drawingContext.clip(), - l(h(n.prototype), "endClip", this).call(this), - (this.drawingContext.fillStyle = this._cachedFillStyle), - (this.drawingContext.strokeStyle = - this._cachedStrokeStyle), - this.blendMode(this._cachedBlendMode); - }, - }, - { - key: "image", - value: function (e, t, r, o, n, s, i, a, l) { - e.gifProperties && e._animateGif(this._pInst); - try { - d.default.MediaElement && - e instanceof d.default.MediaElement && - e._ensureCanvas(); - var u = - (u = - this._tint && e.canvas - ? this._getTintedImageCanvas(e) - : u) || - e.canvas || - e.elt, - c = 1; - e.width && 0 < e.width && (c = u.width / e.width), - this._isErasing && - this.blendMode(this._cachedBlendMode), - this.drawingContext.drawImage( - u, - c * t, - c * r, - c * o, - c * n, - s, - i, - a, - l, - ), - this._isErasing && this._pInst.erase(); - } catch (e) { - if ("NS_ERROR_NOT_AVAILABLE" !== e.name) throw e; - } - }, - }, - { - key: "_getTintedImageCanvas", - value: function (e) { - if (!e.canvas) return e; - e.tintCanvas || - (e.tintCanvas = document.createElement("canvas")), - e.tintCanvas.width !== e.canvas.width && - (e.tintCanvas.width = e.canvas.width), - e.tintCanvas.height !== e.canvas.height && - (e.tintCanvas.height = e.canvas.height); - var t = e.tintCanvas.getContext("2d"); - return ( - t.save(), - t.clearRect(0, 0, e.canvas.width, e.canvas.height), - (this._tint[0] < 255 || - this._tint[1] < 255 || - this._tint[2] < 255) && - (t.drawImage(e.canvas, 0, 0), - (t.globalCompositeOperation = "luminosity"), - t.drawImage(e.canvas, 0, 0), - (t.globalCompositeOperation = "color"), - t.drawImage(e.canvas, 0, 0), - (t.globalCompositeOperation = "multiply"), - (t.fillStyle = "rgb(".concat( - this._tint.slice(0, 3).join(", "), - ")", - )), - t.fillRect(0, 0, e.canvas.width, e.canvas.height), - (t.globalCompositeOperation = "destination-in")), - (t.globalAlpha = this._tint[3] / 255), - t.drawImage(e.canvas, 0, 0), - t.restore(), - e.tintCanvas - ); - }, - }, - { - key: "blendMode", - value: function (e) { - if (e === p.SUBTRACT) - console.warn( - "blendMode(SUBTRACT) only works in WEBGL mode.", - ); - else { - if ( - e !== p.BLEND && - e !== p.REMOVE && - e !== p.DARKEST && - e !== p.LIGHTEST && - e !== p.DIFFERENCE && - e !== p.MULTIPLY && - e !== p.EXCLUSION && - e !== p.SCREEN && - e !== p.REPLACE && - e !== p.OVERLAY && - e !== p.HARD_LIGHT && - e !== p.SOFT_LIGHT && - e !== p.DODGE && - e !== p.BURN && - e !== p.ADD - ) - throw new Error( - "Mode ".concat(e, " not recognized."), - ); - (this._cachedBlendMode = e), - (this.drawingContext.globalCompositeOperation = e); - } - }, - }, - { - key: "blend", - value: function () { - for ( - var e = this.drawingContext.globalCompositeOperation, - t = arguments.length, - r = new Array(t), - o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - var n = r[r.length - 1], - s = Array.prototype.slice.call(r, 0, r.length - 1); - (this.drawingContext.globalCompositeOperation = n), - d.default.prototype.copy.apply(this, s), - (this.drawingContext.globalCompositeOperation = e); - }, - }, - { - key: "_getPixel", - value: function (e, t) { - e = this.drawingContext.getImageData(e, t, 1, 1).data; - return [e[0], e[1], e[2], e[3]]; - }, - }, - { - key: "loadPixels", - value: function () { - var e = this._pixelsState, - t = e._pixelDensity, - r = this.width * t, - t = this.height * t, - r = this.drawingContext.getImageData(0, 0, r, t); - e._setProperty("imageData", r), - e._setProperty("pixels", r.data); - }, - }, - { - key: "set", - value: function (e, t, r) { - (e = Math.floor(e)), (t = Math.floor(t)); - var o = this._pixelsState; - if (r instanceof d.default.Image) - this.drawingContext.save(), - this.drawingContext.setTransform(1, 0, 0, 1, 0, 0), - this.drawingContext.scale( - o._pixelDensity, - o._pixelDensity, - ), - this.drawingContext.clearRect( - e, - t, - r.width, - r.height, - ), - this.drawingContext.drawImage(r.canvas, e, t), - this.drawingContext.restore(); - else { - var n = 0, - s = 0, - i = 0, - a = 0, - l = - 4 * - (t * - o._pixelDensity * - (this.width * o._pixelDensity) + - e * o._pixelDensity); - if ( - (o.imageData || o.loadPixels.call(o), - "number" == typeof r) - ) - l < o.pixels.length && ((i = s = n = r), (a = 255)); - else if (r instanceof Array) { - if (r.length < 4) - throw new Error( - "pixel array must be of the form [R, G, B, A]", - ); - l < o.pixels.length && - ((n = r[0]), (s = r[1]), (i = r[2]), (a = r[3])); - } else - r instanceof d.default.Color && - l < o.pixels.length && - ((n = r.levels[0]), - (s = r.levels[1]), - (i = r.levels[2]), - (a = r.levels[3])); - for (var u = 0; u < o._pixelDensity; u++) - for (var c = 0; c < o._pixelDensity; c++) - (l = - 4 * - ((t * o._pixelDensity + c) * - this.width * - o._pixelDensity + - (e * o._pixelDensity + u))), - (o.pixels[l] = n), - (o.pixels[l + 1] = s), - (o.pixels[l + 2] = i), - (o.pixels[l + 3] = a); - } - }, - }, - { - key: "updatePixels", - value: function (e, t, r, o) { - var n = this._pixelsState, - s = n._pixelDensity; - void 0 === e && - void 0 === t && - void 0 === r && - void 0 === o && - ((t = e = 0), (r = this.width), (o = this.height)), - (e *= s), - (t *= s), - (r *= s), - (o *= s), - this.gifProperties && - (this.gifProperties.frames[ - this.gifProperties.displayIndex - ].image = n.imageData), - this.drawingContext.putImageData( - n.imageData, - e, - t, - 0, - 0, - r, - o, - ); - }, - }, - { - key: "_acuteArcToBezier", - value: function (e, t) { - var r = t / 2, - o = Math.cos(r), - n = Math.sin(r), - s = 1 / Math.tan(r), - r = e + r, - i = Math.cos(r), - r = Math.sin(r), - a = (4 - o) / 3, - n = n + (o - a) * s; - return { - ax: Math.cos(e).toFixed(7), - ay: Math.sin(e).toFixed(7), - bx: (a * i + n * r).toFixed(7), - by: (a * r - n * i).toFixed(7), - cx: (a * i - n * r).toFixed(7), - cy: (a * r + n * i).toFixed(7), - dx: Math.cos(e + t).toFixed(7), - dy: Math.sin(e + t).toFixed(7), - }; - }, - }, - { - key: "arc", - value: function (r, o, e, t, n, s, i) { - var a, - l = this.drawingContext, - u = e / 2, - c = t / 2, - d = []; - for (r += u, o += c; 1e-5 <= s - n; ) - (a = Math.min(s - n, p.HALF_PI)), - d.push(this._acuteArcToBezier(n, a)), - (n += a); - return ( - this._doFill && - (this._clipping || l.beginPath(), - d.forEach(function (e, t) { - 0 === t && l.moveTo(r + e.ax * u, o + e.ay * c), - l.bezierCurveTo( - r + e.bx * u, - o + e.by * c, - r + e.cx * u, - o + e.cy * c, - r + e.dx * u, - o + e.dy * c, - ); - }), - (i !== p.PIE && null != i) || l.lineTo(r, o), - l.closePath(), - this._clipping || l.fill()), - this._doStroke && - (this._clipping || l.beginPath(), - d.forEach(function (e, t) { - 0 === t && l.moveTo(r + e.ax * u, o + e.ay * c), - l.bezierCurveTo( - r + e.bx * u, - o + e.by * c, - r + e.cx * u, - o + e.cy * c, - r + e.dx * u, - o + e.dy * c, - ); - }), - i === p.PIE - ? (l.lineTo(r, o), l.closePath()) - : i === p.CHORD && l.closePath(), - this._clipping || l.stroke()), - this - ); - }, - }, - { - key: "ellipse", - value: function (e) { - var t = this.drawingContext, - r = this._doFill, - o = this._doStroke, - n = parseFloat(e[0]), - s = parseFloat(e[1]), - i = parseFloat(e[2]), - e = parseFloat(e[3]); - if (r && !o) { - if (this._getFill() === f) return this; - } else if (!r && o && this._getStroke() === f) - return this; - var a = (i / 2) * 0.5522847498, - l = (e / 2) * 0.5522847498, - u = n + i, - c = s + e, - i = n + i / 2, - e = s + e / 2; - this._clipping || t.beginPath(), - t.moveTo(n, e), - t.bezierCurveTo(n, e - l, i - a, s, i, s), - t.bezierCurveTo(i + a, s, u, e - l, u, e), - t.bezierCurveTo(u, e + l, i + a, c, i, c), - t.bezierCurveTo(i - a, c, n, e + l, n, e), - !this._clipping && r && t.fill(), - !this._clipping && o && t.stroke(); - }, - }, - { - key: "line", - value: function (e, t, r, o) { - var n = this.drawingContext; - return ( - this._doStroke && - this._getStroke() !== f && - (this._clipping || n.beginPath(), - n.moveTo(e, t), - n.lineTo(r, o), - n.stroke()), - this - ); - }, - }, - { - key: "point", - value: function (e, t) { - var r, - o, - n = this.drawingContext; - return !this._doStroke || this._getStroke() === f - ? this - : ((r = this._getStroke()), - (o = this._getFill()), - this._clipping || this._setFill(r), - this._clipping || n.beginPath(), - n.arc(e, t, n.lineWidth / 2, 0, p.TWO_PI, !1), - void ( - this._clipping || (n.fill(), this._setFill(o)) - )); - }, - }, - { - key: "quad", - value: function (e, t, r, o, n, s, i, a) { - var l = this.drawingContext, - u = this._doFill, - c = this._doStroke; - if (u && !c) { - if (this._getFill() === f) return this; - } else if (!u && c && this._getStroke() === f) - return this; - return ( - this._clipping || l.beginPath(), - l.moveTo(e, t), - l.lineTo(r, o), - l.lineTo(n, s), - l.lineTo(i, a), - l.closePath(), - !this._clipping && u && l.fill(), - !this._clipping && c && l.stroke(), - this - ); - }, - }, - { - key: "rect", - value: function (e) { - var t, - r, - o = e[0], - n = e[1], - s = e[2], - i = e[3], - a = e[4], - l = e[5], - u = e[6], - e = e[7], - c = this.drawingContext, - d = this._doFill, - h = this._doStroke; - if (d && !h) { - if (this._getFill() === f) return this; - } else if (!d && h && this._getStroke() === f) - return this; - return ( - this._clipping || c.beginPath(), - void 0 === a - ? c.rect(o, n, s, i) - : (void 0 === l && (l = a), - void 0 === u && (u = l), - void 0 === e && (e = u), - (h = (d = Math.abs(s)) / 2), - (r = (t = Math.abs(i)) / 2), - t < 2 * (a = d < 2 * a ? h : a) && (a = r), - t < 2 * (l = d < 2 * l ? h : l) && (l = r), - t < 2 * (u = d < 2 * u ? h : u) && (u = r), - t < 2 * (e = d < 2 * e ? h : e) && (e = r), - this._clipping || c.beginPath(), - c.moveTo(o + a, n), - c.arcTo(o + s, n, o + s, n + i, l), - c.arcTo(o + s, n + i, o, n + i, u), - c.arcTo(o, n + i, o, n, e), - c.arcTo(o, n, o + s, n, a), - c.closePath()), - !this._clipping && this._doFill && c.fill(), - !this._clipping && this._doStroke && c.stroke(), - this - ); - }, - }, - { - key: "triangle", - value: function (e) { - var t = this.drawingContext, - r = this._doFill, - o = this._doStroke, - n = e[0], - s = e[1], - i = e[2], - a = e[3], - l = e[4], - e = e[5]; - if (r && !o) { - if (this._getFill() === f) return this; - } else if (!r && o && this._getStroke() === f) - return this; - this._clipping || t.beginPath(), - t.moveTo(n, s), - t.lineTo(i, a), - t.lineTo(l, e), - t.closePath(), - !this._clipping && r && t.fill(), - !this._clipping && o && t.stroke(); - }, - }, - { - key: "endShape", - value: function (e, t, r, o, n, s, i) { - if (0 !== t.length && (this._doStroke || this._doFill)) { - var a, - l, - u, - c = e === p.CLOSE, - d = (c && !s && t.push(t[0]), t.length); - if (r && null === i) { - if (3 < d) { - var h = [], - f = 1 - this._curveTightness; - for ( - this._clipping || this.drawingContext.beginPath(), - this.drawingContext.moveTo(t[1][0], t[1][1]), - l = 1; - l + 2 < d; - l++ - ) - (a = t[l]), - (h[0] = [a[0], a[1]]), - (h[1] = [ - a[0] + - (f * t[l + 1][0] - f * t[l - 1][0]) / 6, - a[1] + - (f * t[l + 1][1] - f * t[l - 1][1]) / 6, - ]), - (h[2] = [ - t[l + 1][0] + - (f * t[l][0] - f * t[l + 2][0]) / 6, - t[l + 1][1] + - (f * t[l][1] - f * t[l + 2][1]) / 6, - ]), - (h[3] = [t[l + 1][0], t[l + 1][1]]), - this.drawingContext.bezierCurveTo( - h[1][0], - h[1][1], - h[2][0], - h[2][1], - h[3][0], - h[3][1], - ); - c && - this.drawingContext.lineTo( - t[l + 1][0], - t[l + 1][1], - ), - this._doFillStrokeClose(c); - } - } else if (o && null === i) { - for ( - this._clipping || this.drawingContext.beginPath(), - l = 0; - l < d; - l++ - ) - t[l].isVert - ? t[l].moveTo - ? this.drawingContext.moveTo(t[l][0], t[l][1]) - : this.drawingContext.lineTo(t[l][0], t[l][1]) - : this.drawingContext.bezierCurveTo( - t[l][0], - t[l][1], - t[l][2], - t[l][3], - t[l][4], - t[l][5], - ); - this._doFillStrokeClose(c); - } else if (n && null === i) { - for ( - this._clipping || this.drawingContext.beginPath(), - l = 0; - l < d; - l++ - ) - t[l].isVert - ? t[l].moveTo - ? this.drawingContext.moveTo(t[l][0], t[l][1]) - : this.drawingContext.lineTo(t[l][0], t[l][1]) - : this.drawingContext.quadraticCurveTo( - t[l][0], - t[l][1], - t[l][2], - t[l][3], - ); - this._doFillStrokeClose(c); - } else if (i === p.POINTS) - for (l = 0; l < d; l++) - (a = t[l]), - this._doStroke && this._pInst.stroke(a[6]), - this._pInst.point(a[0], a[1]); - else if (i === p.LINES) - for (l = 0; l + 1 < d; l += 2) - (a = t[l]), - this._doStroke && this._pInst.stroke(t[l + 1][6]), - this._pInst.line( - a[0], - a[1], - t[l + 1][0], - t[l + 1][1], - ); - else if (i === p.TRIANGLES) - for (l = 0; l + 2 < d; l += 3) - (a = t[l]), - this._clipping || this.drawingContext.beginPath(), - this.drawingContext.moveTo(a[0], a[1]), - this.drawingContext.lineTo( - t[l + 1][0], - t[l + 1][1], - ), - this.drawingContext.lineTo( - t[l + 2][0], - t[l + 2][1], - ), - this.drawingContext.closePath(), - !this._clipping && - this._doFill && - (this._pInst.fill(t[l + 2][5]), - this.drawingContext.fill()), - !this._clipping && - this._doStroke && - (this._pInst.stroke(t[l + 2][6]), - this.drawingContext.stroke()); - else if (i === p.TRIANGLE_STRIP) - for (l = 0; l + 1 < d; l++) - (a = t[l]), - this._clipping || this.drawingContext.beginPath(), - this.drawingContext.moveTo( - t[l + 1][0], - t[l + 1][1], - ), - this.drawingContext.lineTo(a[0], a[1]), - !this._clipping && - this._doStroke && - this._pInst.stroke(t[l + 1][6]), - !this._clipping && - this._doFill && - this._pInst.fill(t[l + 1][5]), - l + 2 < d && - (this.drawingContext.lineTo( - t[l + 2][0], - t[l + 2][1], - ), - !this._clipping && - this._doStroke && - this._pInst.stroke(t[l + 2][6]), - !this._clipping && - this._doFill && - this._pInst.fill(t[l + 2][5])), - this._doFillStrokeClose(c); - else if (i === p.TRIANGLE_FAN) { - if (2 < d) { - for ( - this._clipping || this.drawingContext.beginPath(), - l = 2; - l < d; - l++ - ) - (a = t[l]), - this.drawingContext.moveTo(t[0][0], t[0][1]), - this.drawingContext.lineTo( - t[l - 1][0], - t[l - 1][1], - ), - this.drawingContext.lineTo(a[0], a[1]), - this.drawingContext.lineTo(t[0][0], t[0][1]), - l < d - 1 && - ((this._doFill && a[5] !== t[l + 1][5]) || - (this._doStroke && a[6] !== t[l + 1][6])) && - (!this._clipping && - this._doFill && - (this._pInst.fill(a[5]), - this.drawingContext.fill(), - this._pInst.fill(t[l + 1][5])), - !this._clipping && - this._doStroke && - (this._pInst.stroke(a[6]), - this.drawingContext.stroke(), - this._pInst.stroke(t[l + 1][6])), - this.drawingContext.closePath(), - this._clipping || - this.drawingContext.beginPath()); - this._doFillStrokeClose(c); - } - } else if (i === p.QUADS) - for (l = 0; l + 3 < d; l += 4) { - for ( - a = t[l], - this._clipping || - this.drawingContext.beginPath(), - this.drawingContext.moveTo(a[0], a[1]), - u = 1; - u < 4; - u++ - ) - this.drawingContext.lineTo( - t[l + u][0], - t[l + u][1], - ); - this.drawingContext.lineTo(a[0], a[1]), - !this._clipping && - this._doFill && - this._pInst.fill(t[l + 3][5]), - !this._clipping && - this._doStroke && - this._pInst.stroke(t[l + 3][6]), - this._doFillStrokeClose(c); - } - else if (i === p.QUAD_STRIP) { - if (3 < d) - for (l = 0; l + 1 < d; l += 2) - (a = t[l]), - this._clipping || - this.drawingContext.beginPath(), - l + 3 < d - ? (this.drawingContext.moveTo( - t[l + 2][0], - t[l + 2][1], - ), - this.drawingContext.lineTo(a[0], a[1]), - this.drawingContext.lineTo( - t[l + 1][0], - t[l + 1][1], - ), - this.drawingContext.lineTo( - t[l + 3][0], - t[l + 3][1], - ), - !this._clipping && - this._doFill && - this._pInst.fill(t[l + 3][5]), - !this._clipping && - this._doStroke && - this._pInst.stroke(t[l + 3][6])) - : (this.drawingContext.moveTo(a[0], a[1]), - this.drawingContext.lineTo( - t[l + 1][0], - t[l + 1][1], - )), - this._doFillStrokeClose(c); - } else { - for ( - this._clipping || this.drawingContext.beginPath(), - this.drawingContext.moveTo(t[0][0], t[0][1]), - l = 1; - l < d; - l++ - ) - (a = t[l]).isVert && - (a.moveTo - ? (c && this.drawingContext.closePath(), - this.drawingContext.moveTo(a[0], a[1])) - : this.drawingContext.lineTo(a[0], a[1])); - this._doFillStrokeClose(c); - } - (s = n = o = r = !1), c && t.pop(); - } - return this; - }, - }, - { - key: "strokeCap", - value: function (e) { - return ( - (e !== p.ROUND && e !== p.SQUARE && e !== p.PROJECT) || - (this.drawingContext.lineCap = e), - this - ); - }, - }, - { - key: "strokeJoin", - value: function (e) { - return ( - (e !== p.ROUND && e !== p.BEVEL && e !== p.MITER) || - (this.drawingContext.lineJoin = e), - this - ); - }, - }, - { - key: "strokeWeight", - value: function (e) { - return ( - (this.drawingContext.lineWidth = - void 0 === e || 0 === e ? 1e-4 : e), - this - ); - }, - }, - { - key: "_getFill", - value: function () { - return ( - this._cachedFillStyle || - (this._cachedFillStyle = - this.drawingContext.fillStyle), - this._cachedFillStyle - ); - }, - }, - { - key: "_setFill", - value: function (e) { - e !== this._cachedFillStyle && - ((this.drawingContext.fillStyle = e), - (this._cachedFillStyle = e)); - }, - }, - { - key: "_getStroke", - value: function () { - return ( - this._cachedStrokeStyle || - (this._cachedStrokeStyle = - this.drawingContext.strokeStyle), - this._cachedStrokeStyle - ); - }, - }, - { - key: "_setStroke", - value: function (e) { - e !== this._cachedStrokeStyle && - ((this.drawingContext.strokeStyle = e), - (this._cachedStrokeStyle = e)); - }, - }, - { - key: "bezier", - value: function (e, t, r, o, n, s, i, a) { - return ( - this._pInst.beginShape(), - this._pInst.vertex(e, t), - this._pInst.bezierVertex(r, o, n, s, i, a), - this._pInst.endShape(), - this - ); - }, - }, - { - key: "curve", - value: function (e, t, r, o, n, s, i, a) { - return ( - this._pInst.beginShape(), - this._pInst.curveVertex(e, t), - this._pInst.curveVertex(r, o), - this._pInst.curveVertex(n, s), - this._pInst.curveVertex(i, a), - this._pInst.endShape(), - this - ); - }, - }, - { - key: "_doFillStrokeClose", - value: function (e) { - e && this.drawingContext.closePath(), - !this._clipping && - this._doFill && - this.drawingContext.fill(), - !this._clipping && - this._doStroke && - this.drawingContext.stroke(); - }, - }, - { - key: "applyMatrix", - value: function (e, t, r, o, n, s) { - this.drawingContext.transform(e, t, r, o, n, s); - }, - }, - { - key: "resetMatrix", - value: function () { - return ( - this.drawingContext.setTransform(1, 0, 0, 1, 0, 0), - this.drawingContext.scale( - this._pInst._pixelDensity, - this._pInst._pixelDensity, - ), - this - ); - }, - }, - { - key: "rotate", - value: function (e) { - this.drawingContext.rotate(e); - }, - }, - { - key: "scale", - value: function (e, t) { - return this.drawingContext.scale(e, t), this; - }, - }, - { - key: "translate", - value: function (e, t) { - return ( - e instanceof d.default.Vector && ((t = e.y), (e = e.x)), - this.drawingContext.translate(e, t), - this - ); - }, - }, - { - key: "_renderText", - value: function (e, t, r, o, n, s) { - if (!(o < s || n <= o)) - return ( - e.push(), - this._isOpenType() - ? this._textFont._renderPath(t, r, o, { - renderer: this, - }) - : (this._doStroke && - this._strokeSet && - this.drawingContext.strokeText(t, r, o), - !this._clipping && - this._doFill && - (this._fillSet || - this._setFill(p._DEFAULT_TEXT_FILL), - this.drawingContext.fillText(t, r, o))), - e.pop(), - e - ); - }, - }, - { - key: "textWidth", - value: function (e) { - return this._isOpenType() - ? this._textFont._textWidth(e, this._textSize) - : this.drawingContext.measureText(e).width; - }, - }, - { - key: "_applyTextProperties", - value: function () { - var e, - t = this._pInst; - return ( - this._setProperty("_textAscent", null), - this._setProperty("_textDescent", null), - (e = this._textFont), - this._isOpenType() && - ((e = this._textFont.font.familyName), - this._setProperty( - "_textStyle", - this._textFont.font.styleName, - )), - (this.drawingContext.font = "" - .concat(this._textStyle || "normal", " ") - .concat(this._textSize || 12, "px ") - .concat(e || "sans-serif")), - (this.drawingContext.textAlign = this._textAlign), - this._textBaseline === p.CENTER - ? (this.drawingContext.textBaseline = p._CTX_MIDDLE) - : (this.drawingContext.textBaseline = - this._textBaseline), - t - ); - }, - }, - { - key: "push", - value: function () { - return ( - this.drawingContext.save(), - l(h(n.prototype), "push", this).call(this) - ); - }, - }, - { - key: "pop", - value: function (e) { - this.drawingContext.restore(), - (this._cachedFillStyle = this.drawingContext.fillStyle), - (this._cachedStrokeStyle = - this.drawingContext.strokeStyle), - l(h(n.prototype), "pop", this).call(this, e); - }, - }, - ]) && s(t.prototype, e), - r && s(t, r), - n - ); - })(d.default.Renderer), - e = - ((n.prototype.text = function (e, t, r, o, n) { - void 0 !== o && - this.drawingContext.textBaseline === p.BASELINE && - ((s = !0), (this.drawingContext.textBaseline = p.TOP)); - var s, - o = d.default.Renderer.prototype.text.apply(this, arguments); - return s && (this.drawingContext.textBaseline = p.BASELINE), o; - }), - (d.default.Renderer2D = n), - d.default.Renderer2D); - r.default = e; - }, - { - "./constants": 264, - "./main": 275, - "./p5.Renderer": 278, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.number.to-fixed": 175, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.reflect.get": 185, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 280: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"); - var h = (e = e("./main")) && e.__esModule ? e : { default: e }; - h.default.prototype._promisePreloads = []; - function o() { - return {}; - } - var f = !(h.default.prototype.registerPromisePreload = function (e) { - h.default.prototype._promisePreloads.push(e); - }); - (h.default.prototype._setupPromisePreloads = function () { - var e = !0, - t = !1, - r = void 0; - try { - for ( - var o, n = this._promisePreloads[Symbol.iterator](); - !(e = (o = n.next()).done); - e = !0 - ) { - var s = o.value, - i = this, - a = s.method, - l = s.addCallbacks, - u = s.legacyPreloadSetup, - c = s.target || this, - d = c[a].bind(c); - if (c === h.default.prototype) { - if (f) continue; - (i = null), (d = c[a]); - } - (c[a] = this._wrapPromisePreload(i, d, l)), - u && (c[u.method] = this._legacyPreloadGenerator(i, u, c[a])); - } - } catch (e) { - (t = !0), (r = e); - } finally { - try { - e || null == n.return || n.return(); - } finally { - if (t) throw r; - } - } - f = !0; - }), - (h.default.prototype._wrapPromisePreload = function (e, l, u) { - var t = function () { - for ( - var e = this, - t = (this._incrementPreload(), null), - r = null, - o = arguments.length, - n = new Array(o), - s = 0; - s < o; - s++ - ) - n[s] = arguments[s]; - if (u) - for ( - var i = n.length - 1; - 0 <= i && !r && "function" == typeof n[i]; - i-- - ) - (r = t), (t = n.pop()); - var a = Promise.resolve(l.apply(this, n)); - return ( - t && a.then(t), - r && a.catch(r), - a.then(function () { - return e._decrementPreload(); - }), - a - ); - }; - return (t = e ? t.bind(e) : t); - }); - h.default.prototype._legacyPreloadGenerator = function (e, t, s) { - var i = t.createBaseObject || o, - t = function () { - var t = this; - this._incrementPreload(); - for ( - var e = arguments.length, r = new Array(e), o = 0; - o < e; - o++ - ) - r[o] = arguments[o]; - var n = i.apply(this, r); - return ( - s.apply(this, r).then(function (e) { - Object.assign(n, e), t._decrementPreload(); - }), - n - ); - }; - return (t = e ? t.bind(e) : t); - }; - }, - { - "./main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.assign": 176, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.promise": 183, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 281: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l = (n = e("./main")) && n.__esModule ? n : { default: n }, - u = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== a(e) && "function" != typeof e)) - return { default: e }; - var t = i(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("./constants")); - function i() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (i = function () { - return e; - }), - e); - } - function a(e) { - return (a = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("./p5.Graphics"), e("./p5.Renderer2D"), e("../webgl/p5.RendererGL"); - var c = "defaultCanvas0", - n = - ((l.default.prototype.createCanvas = function (e, t, r, o) { - var n, s, i; - if ( - (l.default._validateParameters("createCanvas", arguments), - arguments[2] instanceof HTMLCanvasElement - ? ((r = u.P2D), (o = arguments[2])) - : (n = r || u.P2D), - o) - ) - (i = document.getElementById(c)) && - i.parentNode.removeChild(i), - (i = o), - (this._defaultGraphicsCreated = !1); - else { - if (n === u.WEBGL) - (i = document.getElementById(c)) && - (i.parentNode.removeChild(i), - (s = this._renderer), - (this._elements = this._elements.filter(function (e) { - return e !== s; - }))), - ((i = document.createElement("canvas")).id = c), - i.classList.add("p5Canvas"); - else if (this._defaultGraphicsCreated) i = this.canvas; - else { - i = o || document.createElement("canvas"); - for ( - var a = 0; - document.getElementById("defaultCanvas".concat(a)); - - ) - a++; - (c = "defaultCanvas".concat(a)), - (i.id = c), - i.classList.add("p5Canvas"); - } - this._setupDone || - ((i.dataset.hidden = !0), (i.style.visibility = "hidden")), - ( - this._userNode || - (0 === document.getElementsByTagName("main").length && - ((r = document.createElement("main")), - document.body.appendChild(r)), - document.getElementsByTagName("main")[0]) - ).appendChild(i); - } - return ( - n === u.WEBGL - ? (this._setProperty( - "_renderer", - new l.default.RendererGL(i, this, !0), - ), - this._elements.push(this._renderer)) - : this._defaultGraphicsCreated || - (this._setProperty( - "_renderer", - new l.default.Renderer2D(i, this, !0), - ), - (this._defaultGraphicsCreated = !0), - this._elements.push(this._renderer)), - this._renderer.resize(e, t), - this._renderer._applyDefaults(), - this._renderer - ); - }), - (l.default.prototype.resizeCanvas = function (e, t, r) { - if ( - (l.default._validateParameters("resizeCanvas", arguments), - this._renderer) - ) { - var o, - n, - s = {}; - for (o in this.drawingContext) { - var i = this.drawingContext[o]; - "object" !== a(i) && "function" != typeof i && (s[o] = i); - } - for (n in ((this.width = e), - (this.height = t), - this._renderer.resize(e, t), - s)) - try { - this.drawingContext[n] = s[n]; - } catch (e) {} - r || this.redraw(); - } - this._addAccsOutput() && this._updateAccsOutput(); - }), - (l.default.prototype.noCanvas = function () { - this.canvas && this.canvas.parentNode.removeChild(this.canvas); - }), - (l.default.prototype.createGraphics = function (e, t) { - for ( - var r = arguments.length, - o = new Array(2 < r ? r - 2 : 0), - n = 2; - n < r; - n++ - ) - o[n - 2] = arguments[n]; - return ( - o[0] instanceof HTMLCanvasElement && - ((o[1] = o[0]), (o[0] = u.P2D)), - l.default._validateParameters("createGraphics", arguments), - new l.default.Graphics(e, t, o[0], this, o[1]) - ); - }), - (l.default.prototype.createFramebuffer = function (e) { - return new l.default.Framebuffer(this, e); - }), - (l.default.prototype.blendMode = function (e) { - l.default._validateParameters("blendMode", arguments), - e === u.NORMAL && - (console.warn( - "NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead.", - ), - (e = u.BLEND)), - this._renderer.blendMode(e); - }), - l.default); - r.default = n; - }, - { - "../webgl/p5.RendererGL": 332, - "./constants": 264, - "./main": 275, - "./p5.Graphics": 277, - "./p5.Renderer2D": 279, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 282: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.slice"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l = n(e("../main")), - a = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = c(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../constants")), - u = n(e("../helpers")); - function c() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (c = function () { - return e; - }), - e); - } - function n(e) { - return e && e.__esModule ? e : { default: e }; - } - function s(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - e("../friendly_errors/fes_core"), - e("../friendly_errors/file_errors"), - e("../friendly_errors/validate_params"), - (l.default.prototype._normalizeArcAngles = function ( - e, - t, - r, - o, - n, - ) { - var s; - return ( - (e -= a.TWO_PI * Math.floor(e / a.TWO_PI)), - (t -= a.TWO_PI * Math.floor(t / a.TWO_PI)), - (s = Math.min(Math.abs(e - t), a.TWO_PI - Math.abs(e - t))), - n && - ((e = - e <= a.HALF_PI - ? Math.atan((r / o) * Math.tan(e)) - : e > a.HALF_PI && e <= 3 * a.HALF_PI - ? Math.atan((r / o) * Math.tan(e)) + a.PI - : Math.atan((r / o) * Math.tan(e)) + a.TWO_PI), - (t = - t <= a.HALF_PI - ? Math.atan((r / o) * Math.tan(t)) - : t > a.HALF_PI && t <= 3 * a.HALF_PI - ? Math.atan((r / o) * Math.tan(t)) + a.PI - : Math.atan((r / o) * Math.tan(t)) + a.TWO_PI)), - t < e && (t += a.TWO_PI), - { start: e, stop: t, correspondToSamePoint: s < 1e-5 } - ); - }), - (l.default.prototype.arc = function (e, t, r, o, n, s, i, a) { - return ( - l.default._validateParameters("arc", arguments), - (this._renderer._doStroke || this._renderer._doFill) && - n !== s && - ((n = this._toRadians(n)), - (s = this._toRadians(s)), - (r = Math.abs(r)), - (o = Math.abs(o)), - (e = u.default.modeAdjust( - e, - t, - r, - o, - this._renderer._ellipseMode, - )), - (t = this._normalizeArcAngles(n, s, e.w, e.h, !0)) - .correspondToSamePoint - ? this._renderer.ellipse([e.x, e.y, e.w, e.h, a]) - : (this._renderer.arc( - e.x, - e.y, - e.w, - e.h, - t.start, - t.stop, - i, - a, - ), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("arc", [ - e.x, - e.y, - e.w, - e.h, - t.start, - t.stop, - i, - ]))), - this - ); - }), - (l.default.prototype.ellipse = function (e, t, r, o, n) { - return ( - l.default._validateParameters("ellipse", arguments), - this._renderEllipse.apply(this, arguments) - ); - }), - (l.default.prototype.circle = function () { - l.default._validateParameters("circle", arguments); - var e = Array.prototype.slice.call(arguments, 0, 2); - return ( - e.push(arguments[2]), - e.push(arguments[2]), - this._renderEllipse.apply(this, s(e)) - ); - }), - (l.default.prototype._renderEllipse = function (e, t, r, o, n) { - return ( - (this._renderer._doStroke || this._renderer._doFill) && - (r < 0 && (r = Math.abs(r)), - void 0 === o ? (o = r) : o < 0 && (o = Math.abs(o)), - (e = u.default.modeAdjust( - e, - t, - r, - o, - this._renderer._ellipseMode, - )), - this._renderer.ellipse([e.x, e.y, e.w, e.h, n]), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("ellipse", [e.x, e.y, e.w, e.h])), - this - ); - }), - (l.default.prototype.line = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - l.default._validateParameters("line", r), - this._renderer._doStroke && - (e = this._renderer).line.apply(e, r), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("line", r), - this - ); - }), - (l.default.prototype.point = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - l.default._validateParameters("point", r), - this._renderer._doStroke && - (1 === r.length && r[0] instanceof l.default.Vector - ? this._renderer.point.call( - this._renderer, - r[0].x, - r[0].y, - r[0].z, - ) - : ((e = this._renderer).point.apply(e, r), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("point", r))), - this - ); - }), - (l.default.prototype.quad = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - l.default._validateParameters("quad", r), - (this._renderer._doStroke || this._renderer._doFill) && - (this._renderer.isP3D && r.length < 12 - ? this._renderer.quad.call( - this._renderer, - r[0], - r[1], - 0, - r[2], - r[3], - 0, - r[4], - r[5], - 0, - r[6], - r[7], - 0, - r[8], - r[9], - ) - : ((e = this._renderer).quad.apply(e, r), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("quadrilateral", r))), - this - ); - }), - (l.default.prototype.rect = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - l.default._validateParameters("rect", t), - this._renderRect.apply(this, t) - ); - }), - (l.default.prototype.square = function (e, t, r, o, n, s, i) { - return ( - l.default._validateParameters("square", arguments), - this._renderRect.call(this, e, t, r, r, o, n, s, i) - ); - }), - (l.default.prototype._renderRect = function () { - if (this._renderer._doStroke || this._renderer._doFill) { - 3 === arguments.length && (arguments[3] = arguments[2]); - for ( - var e = u.default.modeAdjust( - arguments[0], - arguments[1], - arguments[2], - arguments[3], - this._renderer._rectMode, - ), - t = [e.x, e.y, e.w, e.h], - r = 4; - r < arguments.length; - r++ - ) - t[r] = arguments[r]; - this._renderer.rect(t), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("rectangle", [e.x, e.y, e.w, e.h]); - } - return this; - }), - (l.default.prototype.triangle = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - l.default._validateParameters("triangle", t), - (this._renderer._doStroke || this._renderer._doFill) && - this._renderer.triangle(t), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._accsOutput("triangle", t), - this - ); - }); - e = l.default; - r.default = e; - }, - { - "../constants": 264, - "../friendly_errors/fes_core": 266, - "../friendly_errors/file_errors": 267, - "../friendly_errors/validate_params": 270, - "../helpers": 271, - "../main": 275, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 283: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (l = e("../main")) && l.__esModule ? l : { default: l }, - s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - (n.default.prototype.ellipseMode = function (e) { - return ( - n.default._validateParameters("ellipseMode", arguments), - (e !== s.CORNER && - e !== s.CORNERS && - e !== s.RADIUS && - e !== s.CENTER) || - (this._renderer._ellipseMode = e), - this - ); - }), - (n.default.prototype.noSmooth = function () { - return ( - this._renderer.isP3D - ? this.setAttributes("antialias", !1) - : "imageSmoothingEnabled" in this.drawingContext && - (this.drawingContext.imageSmoothingEnabled = !1), - this - ); - }), - (n.default.prototype.rectMode = function (e) { - return ( - n.default._validateParameters("rectMode", arguments), - (e !== s.CORNER && - e !== s.CORNERS && - e !== s.RADIUS && - e !== s.CENTER) || - (this._renderer._rectMode = e), - this - ); - }), - (n.default.prototype.smooth = function () { - return ( - this.setAttributes("antialias", !0), - this._renderer.isP3D || - ("imageSmoothingEnabled" in this.drawingContext && - (this.drawingContext.imageSmoothingEnabled = !0)), - this - ); - }), - (n.default.prototype.strokeCap = function (e) { - return ( - n.default._validateParameters("strokeCap", arguments), - (e !== s.ROUND && e !== s.SQUARE && e !== s.PROJECT) || - this._renderer.strokeCap(e), - this - ); - }), - (n.default.prototype.strokeJoin = function (e) { - return ( - n.default._validateParameters("strokeJoin", arguments), - (e !== s.ROUND && e !== s.BEVEL && e !== s.MITER) || - this._renderer.strokeJoin(e), - this - ); - }), - (n.default.prototype.strokeWeight = function (e) { - return ( - n.default._validateParameters("strokeWeight", arguments), - this._renderer.strokeWeight(e), - this - ); - }); - var l = n.default; - r.default = l; - }, - { - "../constants": 264, - "../main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 284: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l = (o = e("../main")) && o.__esModule ? o : { default: o }; - e("../friendly_errors/fes_core"), - e("../friendly_errors/file_errors"), - e("../friendly_errors/validate_params"), - (l.default.prototype.bezier = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - l.default._validateParameters("bezier", r), - (this._renderer._doStroke || this._renderer._doFill) && - (e = this._renderer).bezier.apply(e, r), - this - ); - }), - (l.default.prototype.bezierDetail = function (e) { - return ( - l.default._validateParameters("bezierDetail", arguments), - (this._bezierDetail = e), - this - ); - }), - (l.default.prototype.bezierPoint = function (e, t, r, o, n) { - l.default._validateParameters("bezierPoint", arguments); - var s = 1 - n; - return ( - Math.pow(s, 3) * e + - 3 * Math.pow(s, 2) * n * t + - 3 * s * Math.pow(n, 2) * r + - Math.pow(n, 3) * o - ); - }), - (l.default.prototype.bezierTangent = function (e, t, r, o, n) { - l.default._validateParameters("bezierTangent", arguments); - var s = 1 - n; - return ( - 3 * o * Math.pow(n, 2) - - 3 * r * Math.pow(n, 2) + - 6 * r * s * n - - 6 * t * s * n + - 3 * t * Math.pow(s, 2) - - 3 * e * Math.pow(s, 2) - ); - }), - (l.default.prototype.curve = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - l.default._validateParameters("curve", r), - this._renderer._doStroke && - (e = this._renderer).curve.apply(e, r), - this - ); - }), - (l.default.prototype.curveDetail = function (e) { - return ( - l.default._validateParameters("curveDetail", arguments), - (this._curveDetail = e < 3 ? 3 : e), - this - ); - }), - (l.default.prototype.curveTightness = function (e) { - return ( - l.default._validateParameters("curveTightness", arguments), - (this._renderer._curveTightness = e), - this - ); - }), - (l.default.prototype.curvePoint = function (e, t, r, o, n) { - l.default._validateParameters("curvePoint", arguments); - var s = this._renderer._curveTightness, - i = n * n * n, - a = n * n; - return ( - e * (((s - 1) / 2) * i + (1 - s) * a + ((s - 1) / 2) * n) + - t * (((s + 3) / 2) * i + ((-5 - s) / 2) * a + 1) + - r * (((-3 - s) / 2) * i + (s + 2) * a + ((1 - s) / 2) * n) + - o * (((1 - s) / 2) * i + ((s - 1) / 2) * a) - ); - }), - (l.default.prototype.curveTangent = function (e, t, r, o, n) { - l.default._validateParameters("curveTangent", arguments); - var s = this._renderer._curveTightness, - i = n * n * 3, - n = 2 * n; - return ( - e * (((s - 1) / 2) * i + (1 - s) * n + (s - 1) / 2) + - t * (((s + 3) / 2) * i + ((-5 - s) / 2) * n) + - r * (((-3 - s) / 2) * i + (s + 2) * n + (1 - s) / 2) + - o * (((1 - s) / 2) * i + ((s - 1) / 2) * n) - ); - }); - var o = l.default; - r.default = o; - }, - { - "../friendly_errors/fes_core": 266, - "../friendly_errors/file_errors": 267, - "../friendly_errors/validate_params": 270, - "../main": 275, - }, - ], - 285: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.slice"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var a = (y = e("../main")) && y.__esModule ? y : { default: y }, - l = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = u(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../constants")); - function u() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (u = function () { - return e; - }), - e); - } - var n = null, - c = [], - d = [], - h = !1, - s = !1, - f = !1, - p = !1, - m = !0, - y = - ((a.default.prototype.beginContour = function () { - return ( - this._renderer.isP3D - ? this._renderer.beginContour() - : ((d = []), (p = !0)), - this - ); - }), - (a.default.prototype.beginShape = function (e) { - var t; - return ( - a.default._validateParameters("beginShape", arguments), - this._renderer.isP3D - ? (t = this._renderer).beginShape.apply(t, arguments) - : ((n = - e === l.POINTS || - e === l.LINES || - e === l.TRIANGLES || - e === l.TRIANGLE_FAN || - e === l.TRIANGLE_STRIP || - e === l.QUADS || - e === l.QUAD_STRIP - ? e - : null), - (c = []), - (d = [])), - this - ); - }), - (a.default.prototype.bezierVertex = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - if ( - (a.default._validateParameters("bezierVertex", r), - this._renderer.isP3D) - ) - (e = this._renderer).bezierVertex.apply(e, r); - else if (0 === c.length) - a.default._friendlyError( - "vertex() must be used once before calling bezierVertex()", - "bezierVertex", - ); - else { - h = !0; - for (var n = [], s = 0; s < r.length; s++) n[s] = r[s]; - (n.isVert = !1), (p ? d : c).push(n); - } - return this; - }), - (a.default.prototype.curveVertex = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - a.default._validateParameters("curveVertex", r), - this._renderer.isP3D - ? (e = this._renderer).curveVertex.apply(e, r) - : ((s = !0), this.vertex(r[0], r[1])), - this - ); - }), - (a.default.prototype.endContour = function () { - if (!this._renderer.isP3D) { - var e = d[0].slice(); - (e.isVert = d[0].isVert), - (e.moveTo = !1), - d.push(e), - m && (c.push(c[0]), (m = !1)); - for (var t = 0; t < d.length; t++) c.push(d[t]); - } - return this; - }), - (a.default.prototype.endShape = function (e) { - var t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : 1; - if ( - (a.default._validateParameters("endShape", arguments), - t < 1 && - (console.log( - "🌸 p5.js says: You can not have less than one instance", - ), - (t = 1)), - this._renderer.isP3D) - ) - this._renderer.endShape(e, s, h, f, p, n, t); - else { - if ( - (1 !== t && - console.log( - "🌸 p5.js says: Instancing is only supported in WebGL2 mode", - ), - 0 === c.length) - ) - return this; - if (!this._renderer._doStroke && !this._renderer._doFill) - return this; - t = e === l.CLOSE; - t && !p && c.push(c[0]), - this._renderer.endShape(e, c, s, h, f, p, n), - (m = !(p = f = h = s = !1)), - t && c.pop(); - } - return this; - }), - (a.default.prototype.quadraticVertex = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - if ( - (a.default._validateParameters("quadraticVertex", r), - this._renderer.isP3D) - ) - (e = this._renderer).quadraticVertex.apply(e, r); - else { - if (this._contourInited) - return ( - ((e = {}).x = r[0]), - (e.y = r[1]), - (e.x3 = r[2]), - (e.y3 = r[3]), - (e.type = l.QUADRATIC), - this._contourVertices.push(e), - this - ); - if (0 < c.length) { - f = !0; - for (var n = [], s = 0; s < r.length; s++) n[s] = r[s]; - (n.isVert = !1), (p ? d : c).push(n); - } else - a.default._friendlyError( - "vertex() must be used once before calling quadraticVertex()", - "quadraticVertex", - ); - } - return this; - }), - (a.default.prototype.vertex = function (e, t, r, o, n) { - var s; - return ( - this._renderer.isP3D - ? (s = this._renderer).vertex.apply(s, arguments) - : (((s = []).isVert = !0), - (s[0] = e), - (s[1] = t), - (s[2] = 0), - (s[3] = 0), - (s[4] = 0), - (s[5] = this._renderer._getFill()), - (s[6] = this._renderer._getStroke()), - r && (s.moveTo = r), - (p ? (0 === d.length && (s.moveTo = !0), d) : c).push(s)), - this - ); - }), - (a.default.prototype.normal = function (e, t, r) { - var o; - return ( - this._assert3d("normal"), - a.default._validateParameters("normal", arguments), - (o = this._renderer).normal.apply(o, arguments), - this - ); - }), - a.default); - r.default = y; - }, - { - "../constants": 264, - "../main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 286: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function a(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - function n(e) { - return (n = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - var l, u, c; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.uint8-clamped-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.uint8-clamped-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - (window.requestAnimationFrame = - window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function (e, t) { - window.setTimeout(e, 1e3 / 60); - }), - "undefined" == typeof Uint8ClampedArray || - Uint8ClampedArray.prototype.slice || - Object.defineProperty(Uint8ClampedArray.prototype, "slice", { - value: Array.prototype.slice, - writable: !0, - configurable: !0, - enumerable: !1, - }), - Object.assign || - ((l = Object.keys), - (e = Object.defineProperty), - (u = "function" == typeof Symbol && "symbol" === n(Symbol())), - (c = Object.prototype.propertyIsEnumerable), - e(Object, "assign", { - value: function (e, t) { - if (null == e) - throw new TypeError("target must be an object"); - for (var r, o = Object(e), n = 1; n < arguments.length; ++n) { - var s = Object(arguments[n]), - i = l(s); - for ( - u && - Object.getOwnPropertySymbols && - i.push.apply( - i, - a( - Object.getOwnPropertySymbols(s).filter( - (function (t) { - return function (e) { - return c.call(t, e); - }; - })(s), - ), - ), - ), - r = 0; - r < i.length; - ++r - ) - o[i[r]] = s[i[r]]; - } - return o; - }, - configurable: !0, - enumerable: !1, - writable: !0, - })); - }, - { - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.assign": 176, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-clamped-array": 235, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 287: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.assign"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("./main")) && e.__esModule ? e : { default: e }; - (e.default.prototype.noLoop = function () { - this._loop = !1; - }), - (e.default.prototype.loop = function () { - this._loop || - ((this._loop = !0), this._setupDone && this._draw()); - }), - (e.default.prototype.isLooping = function () { - return this._loop; - }), - (e.default.prototype.push = function () { - this._styles.push({ - props: { _colorMode: this._colorMode }, - renderer: this._renderer.push(), - }); - }), - (e.default.prototype.pop = function () { - var e = this._styles.pop(); - e - ? (this._renderer.pop(e.renderer), Object.assign(this, e.props)) - : console.warn("pop() was called without matching push()"); - }), - (e.default.prototype.redraw = function (e) { - if (!this._inUserDraw && this._setupDone) { - var t = parseInt(e), - r = - ((isNaN(t) || t < 1) && (t = 1), - this._isGlobal ? window : this); - if ("function" == typeof r.draw) { - void 0 === r.setup && - r.scale(r._pixelDensity, r._pixelDensity); - for (var o = 0; o < t; o++) { - r.resetMatrix(), - (this._accessibleOutputs.grid || - this._accessibleOutputs.text) && - this._updateAccsOutput(), - r._renderer.isP3D && r._renderer._update(), - r._setProperty("frameCount", r.frameCount + 1), - this.callRegisteredHooksFor("pre"), - (this._inUserDraw = !0); - try { - r.draw(); - } finally { - this._inUserDraw = !1; - } - this.callRegisteredHooksFor("post"); - } - } - } - }); - e = e.default; - r.default = e; - }, - { "./main": 275, "core-js/modules/es.object.assign": 176 }, - ], - 288: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (e = e("./main")) && e.__esModule ? e : { default: e }; - function o(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - (n.default.prototype.applyMatrix = function () { - var e = - (arguments.length <= 0 ? void 0 : arguments[0]) instanceof - Object.getPrototypeOf(Uint8Array); - return ( - Array.isArray(arguments.length <= 0 ? void 0 : arguments[0]) || e - ? (e = this._renderer).applyMatrix.apply( - e, - o(arguments.length <= 0 ? void 0 : arguments[0]), - ) - : (e = this._renderer).applyMatrix.apply(e, arguments), - this - ); - }), - (n.default.prototype.resetMatrix = function () { - return this._renderer.resetMatrix(), this; - }), - (n.default.prototype.rotate = function (e, t) { - return ( - n.default._validateParameters("rotate", arguments), - this._renderer.rotate(this._toRadians(e), t), - this - ); - }), - (n.default.prototype.rotateX = function (e) { - return ( - this._assert3d("rotateX"), - n.default._validateParameters("rotateX", arguments), - this._renderer.rotateX(this._toRadians(e)), - this - ); - }), - (n.default.prototype.rotateY = function (e) { - return ( - this._assert3d("rotateY"), - n.default._validateParameters("rotateY", arguments), - this._renderer.rotateY(this._toRadians(e)), - this - ); - }), - (n.default.prototype.rotateZ = function (e) { - return ( - this._assert3d("rotateZ"), - n.default._validateParameters("rotateZ", arguments), - this._renderer.rotateZ(this._toRadians(e)), - this - ); - }), - (n.default.prototype.scale = function (e, t, r) { - var o; - return ( - n.default._validateParameters("scale", arguments), - e instanceof n.default.Vector - ? ((e = (o = e).x), (t = o.y), (r = o.z)) - : e instanceof Array && - ((e = (o = e)[0]), (t = o[1]), (r = o[2] || 1)), - isNaN(t) ? (t = r = e) : isNaN(r) && (r = 1), - this._renderer.scale.call(this._renderer, e, t, r), - this - ); - }), - (n.default.prototype.shearX = function (e) { - n.default._validateParameters("shearX", arguments); - e = this._toRadians(e); - return ( - this._renderer.applyMatrix(1, 0, Math.tan(e), 1, 0, 0), this - ); - }), - (n.default.prototype.shearY = function (e) { - n.default._validateParameters("shearY", arguments); - e = this._toRadians(e); - return ( - this._renderer.applyMatrix(1, Math.tan(e), 0, 1, 0, 0), this - ); - }), - (n.default.prototype.translate = function (e, t, r) { - return ( - n.default._validateParameters("translate", arguments), - this._renderer.isP3D - ? this._renderer.translate(e, t, r) - : this._renderer.translate(e, t), - this - ); - }); - e = n.default; - r.default = e; - }, - { - "./main": 275, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 289: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.ends-with"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.ends-with"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"); - var n = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function s(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - (n.default.prototype.storeItem = function (e, t) { - "string" != typeof e && - console.log( - "The argument that you passed to storeItem() - ".concat( - e, - " is not a string.", - ), - ), - e.endsWith("p5TypeID") && - console.log( - "The argument that you passed to storeItem() - ".concat( - e, - " must not end with 'p5TypeID'.", - ), - ), - void 0 === t && - console.log( - "You cannot store undefined variables using storeItem().", - ); - var r = i(t); - switch (r) { - case "number": - case "boolean": - t = t.toString(); - break; - case "object": - t instanceof n.default.Color - ? (r = "p5.Color") - : t instanceof n.default.Vector && - ((r = "p5.Vector"), (t = [t.x, t.y, t.z])), - (t = JSON.stringify(t)); - } - localStorage.setItem(e, t); - e = "".concat(e, "p5TypeID"); - localStorage.setItem(e, r); - }), - (n.default.prototype.getItem = function (e) { - var t = localStorage.getItem(e), - r = localStorage.getItem("".concat(e, "p5TypeID")); - if (void 0 === r) - console.log( - "Unable to determine type of item stored under ".concat( - e, - "in local storage. Did you save the item with something other than setItem()?", - ), - ); - else if (null !== t) - switch (r) { - case "number": - t = parseFloat(t); - break; - case "boolean": - t = "true" === t; - break; - case "object": - t = JSON.parse(t); - break; - case "p5.Color": - (t = JSON.parse(t)), - (t = this.color.apply(this, s(t.levels))); - break; - case "p5.Vector": - (t = JSON.parse(t)), - (t = this.createVector.apply(this, s(t))); - } - return t; - }), - (n.default.prototype.clearStorage = function () { - localStorage.clear(); - }), - (n.default.prototype.removeItem = function (e) { - "string" != typeof e && - console.log( - "The argument that you passed to removeItem() - ".concat( - e, - " is not a string.", - ), - ), - localStorage.removeItem(e), - localStorage.removeItem("".concat(e, "p5TypeID")); - }); - }, - { - "../core/main": 275, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.ends-with": 190, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 290: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function n(e) { - return (n = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.object.keys"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function i(e, t) { - if ("function" != typeof t && null !== t) - throw new TypeError( - "Super expression must either be null or a function", - ); - (e.prototype = Object.create(t && t.prototype, { - constructor: { value: e, writable: !0, configurable: !0 }, - })), - t && a(e, t); - } - function a(e, t) { - return (a = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function l(r) { - return function () { - var e, - t = u(r), - t = - ((e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = u(this).constructor), - Reflect.construct(t, arguments, e)) - : t.apply(this, arguments)), - this); - if (!e || ("object" !== n(e) && "function" != typeof e)) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return e; - }; - } - function u(e) { - return (u = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - function c(e, t) { - if (!(e instanceof t)) - throw new TypeError("Cannot call a class as a function"); - } - function d(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function h(e, t, r) { - t && d(e.prototype, t), r && d(e, r); - } - (s.default.prototype.createStringDict = function (e, t) { - return ( - s.default._validateParameters("createStringDict", arguments), - new s.default.StringDict(e, t) - ); - }), - (s.default.prototype.createNumberDict = function (e, t) { - return ( - s.default._validateParameters("createNumberDict", arguments), - new s.default.NumberDict(e, t) - ); - }), - (s.default.TypedDict = (function () { - function r(e, t) { - return ( - c(this, r), - e instanceof Object - ? (this.data = e) - : ((this.data = {}), (this.data[e] = t)), - this - ); - } - return ( - h(r, [ - { - key: "size", - value: function () { - return Object.keys(this.data).length; - }, - }, - { - key: "hasKey", - value: function (e) { - return this.data.hasOwnProperty(e); - }, - }, - { - key: "get", - value: function (e) { - if (this.data.hasOwnProperty(e)) return this.data[e]; - console.log( - "".concat(e, " does not exist in this Dictionary"), - ); - }, - }, - { - key: "set", - value: function (e, t) { - this._validate(t) - ? (this.data[e] = t) - : console.log( - "Those values dont work for this dictionary type.", - ); - }, - }, - { - key: "_addObj", - value: function (e) { - for (var t in e) this.set(t, e[t]); - }, - }, - { - key: "create", - value: function (e, t) { - e instanceof Object && void 0 === t - ? this._addObj(e) - : void 0 !== e - ? this.set(e, t) - : console.log( - "In order to create a new Dictionary entry you must pass an object or a key, value pair", - ); - }, - }, - { - key: "clear", - value: function () { - this.data = {}; - }, - }, - { - key: "remove", - value: function (e) { - if (!this.data.hasOwnProperty(e)) - throw new Error( - "".concat(e, " does not exist in this Dictionary"), - ); - delete this.data[e]; - }, - }, - { - key: "print", - value: function () { - for (var e in this.data) - console.log( - "key:".concat(e, " value:").concat(this.data[e]), - ); - }, - }, - { - key: "saveTable", - value: function (e) { - var t, - r = ""; - for (t in this.data) - r += "".concat(t, ",").concat(this.data[t], "\n"); - var o = new Blob([r], { type: "text/csv" }); - s.default.prototype.downloadFile(o, e || "mycsv", "csv"); - }, - }, - { - key: "saveJSON", - value: function (e, t) { - s.default.prototype.saveJSON(this.data, e, t); - }, - }, - { - key: "_validate", - value: function (e) { - return !0; - }, - }, - ]), - r - ); - })()), - (s.default.StringDict = (function () { - i(n, s.default.TypedDict); - var o = l(n); - function n() { - c(this, n); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return o.call.apply(o, [this].concat(t)); - } - return ( - h(n, [ - { - key: "_validate", - value: function (e) { - return "string" == typeof e; - }, - }, - ]), - n - ); - })()), - (s.default.NumberDict = (function () { - i(n, s.default.TypedDict); - var o = l(n); - function n() { - c(this, n); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return o.call.apply(o, [this].concat(t)); - } - return ( - h(n, [ - { - key: "_validate", - value: function (e) { - return "number" == typeof e; - }, - }, - { - key: "add", - value: function (e, t) { - this.data.hasOwnProperty(e) - ? (this.data[e] += t) - : console.log( - "The key - ".concat( - e, - " does not exist in this dictionary.", - ), - ); - }, - }, - { - key: "sub", - value: function (e, t) { - this.add(e, -t); - }, - }, - { - key: "mult", - value: function (e, t) { - this.data.hasOwnProperty(e) - ? (this.data[e] *= t) - : console.log( - "The key - ".concat( - e, - " does not exist in this dictionary.", - ), - ); - }, - }, - { - key: "div", - value: function (e, t) { - this.data.hasOwnProperty(e) - ? (this.data[e] /= t) - : console.log( - "The key - ".concat( - e, - " does not exist in this dictionary.", - ), - ); - }, - }, - { - key: "_valueTest", - value: function (e) { - if (0 === Object.keys(this.data).length) - throw new Error( - "Unable to search for a minimum or maximum value on an empty NumberDict", - ); - if (1 === Object.keys(this.data).length) - return this.data[Object.keys(this.data)[0]]; - var t, - r = this.data[Object.keys(this.data)[0]]; - for (t in this.data) - this.data[t] * e < r * e && (r = this.data[t]); - return r; - }, - }, - { - key: "minValue", - value: function () { - return this._valueTest(1); - }, - }, - { - key: "maxValue", - value: function () { - return this._valueTest(-1); - }, - }, - { - key: "_keyTest", - value: function (e) { - if (0 === Object.keys(this.data).length) - throw new Error( - "Unable to use minValue on an empty NumberDict", - ); - if (1 === Object.keys(this.data).length) - return Object.keys(this.data)[0]; - for ( - var t = Object.keys(this.data)[0], r = 1; - r < Object.keys(this.data).length; - r++ - ) - Object.keys(this.data)[r] * e < t * e && - (t = Object.keys(this.data)[r]); - return t; - }, - }, - { - key: "minKey", - value: function () { - return this._keyTest(1); - }, - }, - { - key: "maxKey", - value: function () { - return this._keyTest(-1); - }, - }, - ]), - n - ); - })()); - e = s.default.TypedDict; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 291: [ - function (t, r, o) { - "use strict"; - function n(e) { - return (n = - "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); - } - t("core-js/modules/es.symbol"), - t("core-js/modules/es.symbol.description"), - t("core-js/modules/es.symbol.iterator"), - t("core-js/modules/es.array.every"), - t("core-js/modules/es.array.filter"), - t("core-js/modules/es.array.for-each"), - t("core-js/modules/es.array.from"), - t("core-js/modules/es.array.index-of"), - t("core-js/modules/es.array.iterator"), - t("core-js/modules/es.array.map"), - t("core-js/modules/es.array.slice"), - t("core-js/modules/es.array.splice"), - t("core-js/modules/es.function.name"), - t("core-js/modules/es.object.get-prototype-of"), - t("core-js/modules/es.object.to-string"), - t("core-js/modules/es.promise"), - t("core-js/modules/es.reflect.construct"), - t("core-js/modules/es.regexp.exec"), - t("core-js/modules/es.regexp.to-string"), - t("core-js/modules/es.string.iterator"), - t("core-js/modules/es.string.replace"), - t("core-js/modules/es.string.split"), - t("core-js/modules/es.string.trim"), - t("core-js/modules/web.dom-collections.for-each"), - t("core-js/modules/web.dom-collections.iterator"), - t("core-js/modules/web.url"), - t("core-js/modules/es.symbol"), - t("core-js/modules/es.symbol.description"), - t("core-js/modules/es.symbol.iterator"), - t("core-js/modules/es.array.every"), - t("core-js/modules/es.array.filter"), - t("core-js/modules/es.array.for-each"), - t("core-js/modules/es.array.from"), - t("core-js/modules/es.array.index-of"), - t("core-js/modules/es.array.iterator"), - t("core-js/modules/es.array.map"), - t("core-js/modules/es.array.slice"), - t("core-js/modules/es.array.splice"), - t("core-js/modules/es.function.name"), - t("core-js/modules/es.object.to-string"), - t("core-js/modules/es.promise"), - t("core-js/modules/es.regexp.exec"), - t("core-js/modules/es.regexp.to-string"), - t("core-js/modules/es.string.iterator"), - t("core-js/modules/es.string.replace"), - t("core-js/modules/es.string.split"), - t("core-js/modules/es.string.trim"), - t("core-js/modules/web.dom-collections.for-each"), - t("core-js/modules/web.dom-collections.iterator"), - t("core-js/modules/web.url"), - Object.defineProperty(o, "__esModule", { value: !0 }), - (o.default = void 0); - var f = (t = t("../core/main")) && t.__esModule ? t : { default: t }; - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function a(e, t, r) { - t && s(e.prototype, t), r && s(e, r); - } - function l(e, t) { - return (l = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function u(o) { - return function () { - var e, - t, - r = i(o); - return ( - (e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = i(this).constructor), - Reflect.construct(r, arguments, e)) - : r.apply(this, arguments)), - (r = this), - !(t = e) || ("object" !== h(t) && "function" != typeof t) - ? c(r) - : t - ); - }; - } - function c(e) { - if (void 0 === e) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return e; - } - function i(e) { - return (i = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - function d(e, t) { - if (!(e instanceof t)) - throw new TypeError("Cannot call a class as a function"); - } - function h(e) { - return (h = - "function" == typeof Symbol && "symbol" === n(Symbol.iterator) - ? function (e) { - return n(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : n(e); - })(e); - } - function p(e, t, r) { - (t._userNode || document.body).appendChild(e); - r = new (r ? f.default.MediaElement : f.default.Element)(e, t); - return t._elements.push(r), r; - } - function m(e, t, r, o) { - var n = document.createElement(t), - s = ("string" == typeof (r = r || "") && (r = [r]), !0), - t = !1, - i = void 0; - try { - for ( - var a, l = r[Symbol.iterator](); - !(s = (a = l.next()).done); - s = !0 - ) { - var u = a.value, - c = document.createElement("source"); - c.setAttribute("src", u), n.appendChild(c); - } - } catch (e) { - (t = !0), (i = e); - } finally { - try { - s || null == l.return || l.return(); - } finally { - if (t) throw i; - } - } - "function" == typeof o && - n.addEventListener("canplaythrough", function e() { - o(), n.removeEventListener("canplaythrough", e); - }); - var d = p(n, e, !0); - return ( - (d.loadedmetadata = !1), - n.addEventListener("loadedmetadata", function () { - (d.width = n.videoWidth), - (d.height = n.videoHeight), - 0 === d.elt.width && (d.elt.width = n.videoWidth), - 0 === d.elt.height && (d.elt.height = n.videoHeight), - d.presetPlaybackRate && - ((d.elt.playbackRate = d.presetPlaybackRate), - delete d.presetPlaybackRate), - (d.loadedmetadata = !0); - }), - d - ); - } - (f.default.prototype.select = function (e, t) { - f.default._validateParameters("select", arguments); - t = this._getContainer(t).querySelector(e); - return t ? this._wrapElement(t) : null; - }), - (f.default.prototype.selectAll = function (e, t) { - f.default._validateParameters("selectAll", arguments); - var r = [], - o = this._getContainer(t).querySelectorAll(e); - if (o) - for (var n = 0; n < o.length; n++) { - var s = this._wrapElement(o[n]); - r.push(s); - } - return r; - }), - (f.default.prototype._getContainer = function (e) { - var t = document; - return ( - "string" == typeof e - ? (t = document.querySelector(e) || document) - : e instanceof f.default.Element - ? (t = e.elt) - : e instanceof HTMLElement && (t = e), - t - ); - }), - (f.default.prototype._wrapElement = function (e) { - var t, - r = Array.prototype.slice.call(e.children); - return "INPUT" === e.tagName && "checkbox" === e.type - ? (((t = new f.default.Element(e, this)).checked = function () { - return 0 === arguments.length - ? this.elt.checked - : ((this.elt.checked = !( - arguments.length <= 0 || !arguments[0] - )), - this); - }), - t) - : "VIDEO" === e.tagName || "AUDIO" === e.tagName - ? new f.default.MediaElement(e, this) - : "SELECT" === e.tagName - ? this.createSelect(new f.default.Element(e, this)) - : 0 < r.length && - r.every(function (e) { - return "INPUT" === e.tagName || "LABEL" === e.tagName; - }) - ? this.createRadio(new f.default.Element(e, this)) - : new f.default.Element(e, this); - }), - (f.default.prototype.removeElements = function (e) { - f.default._validateParameters("removeElements", arguments); - this._elements - .filter(function (e) { - return !(e.elt instanceof HTMLCanvasElement); - }) - .map(function (e) { - return e.remove(); - }); - }), - (f.default.Element.prototype.changed = function (e) { - return f.default.Element._adjustListener("change", e, this), this; - }), - (f.default.Element.prototype.input = function (e) { - return f.default.Element._adjustListener("input", e, this), this; - }), - (f.default.prototype.createDiv = function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : "", - t = document.createElement("div"); - return (t.innerHTML = e), p(t, this); - }), - (f.default.prototype.createP = function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : "", - t = document.createElement("p"); - return (t.innerHTML = e), p(t, this); - }), - (f.default.prototype.createSpan = function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : "", - t = document.createElement("span"); - return (t.innerHTML = e), p(t, this); - }), - (f.default.prototype.createImg = function () { - f.default._validateParameters("createImg", arguments); - var t, - r = document.createElement("img"), - o = arguments; - return ( - 1 < o.length && "string" == typeof o[1] && (r.alt = o[1]), - 2 < o.length && - "string" == typeof o[2] && - (r.crossOrigin = o[2]), - (r.src = o[0]), - (t = p(r, this)), - r.addEventListener("load", function () { - (t.width = r.offsetWidth || r.width), - (t.height = r.offsetHeight || r.height); - var e = o[o.length - 1]; - "function" == typeof e && e(t); - }), - t - ); - }), - (f.default.prototype.createA = function (e, t, r) { - f.default._validateParameters("createA", arguments); - var o = document.createElement("a"); - return ( - (o.href = e), (o.innerHTML = t), r && (o.target = r), p(o, this) - ); - }), - (f.default.prototype.createSlider = function (e, t, r, o) { - f.default._validateParameters("createSlider", arguments); - var n = document.createElement("input"); - return ( - (n.type = "range"), - (n.min = e), - (n.max = t), - 0 === o ? (n.step = 1e-18) : o && (n.step = o), - "number" == typeof r && (n.value = r), - p(n, this) - ); - }), - (f.default.prototype.createButton = function (e, t) { - f.default._validateParameters("createButton", arguments); - var r = document.createElement("button"); - return (r.innerHTML = e), t && (r.value = t), p(r, this); - }), - (f.default.prototype.createCheckbox = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - f.default._validateParameters("createCheckbox", t); - var o = document.createElement("div"), - n = document.createElement("input"), - s = ((n.type = "checkbox"), document.createElement("label")), - i = (s.appendChild(n), o.appendChild(s), p(o, this)); - return ( - (i.checked = function () { - var e = - i.elt.firstElementChild.getElementsByTagName("input")[0]; - if (e) { - if (0 === arguments.length) return e.checked; - e.checked = !(arguments.length <= 0 || !arguments[0]); - } - return i; - }), - (this.value = function (e) { - return (i.value = e), this; - }), - t[0] && - (i.value(t[0]), - ((o = document.createElement("span")).innerHTML = t[0]), - s.appendChild(o)), - t[1] && (n.checked = !0), - i - ); - }), - (f.default.prototype.createSelect = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - f.default._validateParameters("createSelect", r); - var n, - s = r[0]; - return ( - s instanceof f.default.Element && - s.elt instanceof HTMLSelectElement - ? (this.elt = (e = s).elt) - : s instanceof HTMLSelectElement - ? ((e = p(s, this)), (this.elt = s)) - : ((n = document.createElement("select")), - s && - "boolean" == typeof s && - n.setAttribute("multiple", "true"), - (e = p(n, this)), - (this.elt = n)), - (e.option = function (e, t) { - var r; - if (void 0 !== e) { - for (var o, n = 0; n < this.elt.length; n += 1) - if (this.elt[n].textContent === e) { - r = n; - break; - } - void 0 !== r - ? !1 === t - ? this.elt.remove(r) - : (this.elt[r].value = t) - : (((o = document.createElement("option")).textContent = - e), - (o.value = void 0 === t ? e : t), - this.elt.appendChild(o), - this._pInst._elements.push(o)); - } - }), - (e.selected = function (e) { - if (void 0 !== e) { - for (var t = 0; t < this.elt.length; t += 1) - this.elt[t].value.toString() === e.toString() && - (this.elt.selectedIndex = t); - return this; - } - if (this.elt.getAttribute("multiple")) { - var r = [], - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = this.elt.selectedOptions[Symbol.iterator](); - !(o = (i = a.next()).done); - o = !0 - ) { - var l = i.value; - r.push(l.value); - } - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - return r; - } - return this.elt.value; - }), - (e.disable = function (e) { - if ("string" == typeof e) - for (var t = 0; t < this.elt.length; t++) - this.elt[t].value.toString() === e && - ((this.elt[t].disabled = !0), - (this.elt[t].selected = !1)); - else this.elt.disabled = !0; - return this; - }), - (e.enable = function (e) { - if ("string" == typeof e) - for (var t = 0; t < this.elt.length; t++) - this.elt[t].value.toString() === e && - ((this.elt[t].disabled = !1), - (this.elt[t].selected = !1)); - else { - this.elt.disabled = !1; - for (var r = 0; r < this.elt.length; r++) - (this.elt[r].disabled = !1), (this.elt[r].selected = !1); - } - return this; - }), - e - ); - }), - (f.default.prototype.createRadio = function () { - function t(e) { - return e instanceof HTMLInputElement && "radio" === e.type; - } - function d(e) { - return e instanceof HTMLLabelElement; - } - var h, - e, - r, - o = arguments.length <= 0 ? void 0 : arguments[0]; - o instanceof f.default.Element && - (o.elt instanceof HTMLDivElement || - o.elt instanceof HTMLSpanElement) - ? ((h = o), (this.elt = o.elt)) - : o instanceof HTMLDivElement || o instanceof HTMLSpanElement - ? ((h = p(o, this)), - (e = this.elt = o), - "string" == - typeof (arguments.length <= 1 ? void 0 : arguments[1]) && - (r = arguments.length <= 1 ? void 0 : arguments[1])) - : ("string" == typeof o && (r = o), - (e = document.createElement("div")), - (h = p(e, this)), - (this.elt = e)), - (h._name = r || "radioOption"); - return ( - (h._getOptionsArray = function () { - return Array.from(this.elt.children) - .filter(function (e) { - return t(e) || (d(e) && t(e.firstElementChild)); - }) - .map(function (e) { - return t(e) ? e : e.firstElementChild; - }); - }), - (h.option = function (e, t) { - var r, - o, - n, - s = !0, - i = !1, - a = void 0; - try { - for ( - var l, u = h._getOptionsArray()[Symbol.iterator](); - !(s = (l = u.next()).done); - s = !0 - ) { - var c = l.value; - if (c.value === e) { - r = c; - break; - } - } - } catch (e) { - (i = !0), (a = e); - } finally { - try { - s || null == u.return || u.return(); - } finally { - if (i) throw a; - } - } - return ( - void 0 === r && - ((r = document.createElement("input")).setAttribute( - "type", - "radio", - ), - r.setAttribute("value", e)), - r.setAttribute("name", h._name), - d(r.parentElement) - ? (o = r.parentElement) - : (o = - document.createElement( - "label", - )).insertAdjacentElement("afterbegin", r), - o.lastElementChild instanceof HTMLSpanElement - ? (n = o.lastElementChild) - : ((n = document.createElement("span")), - r.insertAdjacentElement("afterend", n)), - (n.innerHTML = void 0 === t ? e : t), - this.elt.appendChild(o), - r - ); - }), - (h.remove = function (e) { - var t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = h._getOptionsArray()[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - if (i.value === e) - return void ( - d(i.parentElement) ? i.parentElement : i - ).remove(); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - }), - (h.value = function () { - var e = "", - t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = h._getOptionsArray()[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - if (i.checked) { - e = i.value; - break; - } - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - return e; - }), - (h.selected = function (e) { - var t = null; - if (void 0 === e) { - var r = !0, - o = !1, - n = void 0; - try { - for ( - var s, i = h._getOptionsArray()[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) { - var a = s.value; - if (a.checked) { - t = a; - break; - } - } - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - } else { - h._getOptionsArray().forEach(function (e) { - (e.checked = !1), e.removeAttribute("checked"); - }); - var l = !0, - o = !1, - n = void 0; - try { - for ( - var u, c = h._getOptionsArray()[Symbol.iterator](); - !(l = (u = c.next()).done); - l = !0 - ) { - var d = u.value; - d.value === e && - (d.setAttribute("checked", !0), - (d.checked = !0), - (t = d)); - } - } catch (e) { - (o = !0), (n = e); - } finally { - try { - l || null == c.return || c.return(); - } finally { - if (o) throw n; - } - } - } - return t; - }), - (h.disable = function () { - var e = - !(0 < arguments.length && void 0 !== arguments[0]) || - arguments[0], - t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = h._getOptionsArray()[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) - n.value.setAttribute("disabled", e); - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - }), - h - ); - }), - (f.default.prototype.createColorPicker = function (e) { - f.default._validateParameters("createColorPicker", arguments); - var t = document.createElement("input"); - return ( - (t.type = "color"), - e - ? e instanceof f.default.Color - ? (t.value = e.toString("#rrggbb")) - : ((f.default.prototype._colorMode = "rgb"), - (f.default.prototype._colorMaxes = { - rgb: [255, 255, 255, 255], - hsb: [360, 100, 100, 1], - hsl: [360, 100, 100, 1], - }), - (t.value = f.default.prototype - .color(e) - .toString("#rrggbb"))) - : (t.value = "#000000"), - ((t = p(t, this)).color = function () { - return ( - e && - (e.mode && (f.default.prototype._colorMode = e.mode), - e.maxes && (f.default.prototype._colorMaxes = e.maxes)), - f.default.prototype.color(this.elt.value) - ); - }), - t - ); - }), - (f.default.prototype.createInput = function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : "", - t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : "text", - r = - (f.default._validateParameters("createInput", arguments), - document.createElement("input")); - return ( - r.setAttribute("value", e), - r.setAttribute("type", t), - p(r, this) - ); - }), - (f.default.prototype.createFileInput = function (a) { - var e, - t = - 1 < arguments.length && - void 0 !== arguments[1] && - arguments[1]; - f.default._validateParameters("createFileInput", arguments); - if ( - window.File && - window.FileReader && - window.FileList && - window.Blob - ) - return ( - (e = document.createElement("input")).setAttribute( - "type", - "file", - ), - t && e.setAttribute("multiple", !0), - e.addEventListener( - "change", - function (e) { - var t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = e.target.files[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - f.default.File._load(i, a); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - }, - !1, - ), - p(e, this) - ); - console.log( - "The File APIs are not fully supported in this browser. Cannot create element.", - ); - }), - (f.default.prototype.createVideo = function (e, t) { - return ( - f.default._validateParameters("createVideo", arguments), - m(this, "video", e, t) - ); - }), - (f.default.prototype.createAudio = function (e, t) { - return ( - f.default._validateParameters("createAudio", arguments), - m(this, "audio", e, t) - ); - }), - (f.default.prototype.VIDEO = "video"), - (f.default.prototype.AUDIO = "audio"), - void 0 === navigator.mediaDevices && (navigator.mediaDevices = {}), - void 0 === navigator.mediaDevices.getUserMedia && - (navigator.mediaDevices.getUserMedia = function (r) { - var o = - navigator.webkitGetUserMedia || navigator.mozGetUserMedia; - return o - ? new Promise(function (e, t) { - o.call(navigator, r, e, t); - }) - : Promise.reject( - new Error( - "getUserMedia is not implemented in this browser", - ), - ); - }), - (f.default.prototype.createCapture = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - if ( - (f.default._validateParameters("createCapture", t), - !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) - ) - throw new DOMException( - "getUserMedia not supported in this browser", - ); - for (var o, n = !0, s = !0, i = 0, a = t; i < a.length; i++) { - var l = a[i]; - l === f.default.prototype.VIDEO - ? (s = !1) - : l === f.default.prototype.AUDIO - ? (n = !1) - : "object" === h(l) - ? (u = l) - : "function" == typeof l && (o = l); - } - var u = u || { video: n, audio: s }, - c = document.createElement("video"), - d = - (c.setAttribute("playsinline", ""), - navigator.mediaDevices.getUserMedia(u).then(function (t) { - try { - "srcObject" in c - ? (c.srcObject = t) - : (c.src = window.URL.createObjectURL(t)); - } catch (e) { - c.src = t; - } - }, console.log), - p(c, this, !0)); - return ( - (d.loadedmetadata = !1), - c.addEventListener("loadedmetadata", function () { - c.play(), - c.width - ? ((d.width = c.width), (d.height = c.height)) - : ((d.width = d.elt.width = c.videoWidth), - (d.height = d.elt.height = c.videoHeight)), - (d.loadedmetadata = !0), - o && o(c.srcObject); - }), - d - ); - }), - (f.default.prototype.createElement = function (e, t) { - f.default._validateParameters("createElement", arguments); - e = document.createElement(e); - return void 0 !== t && (e.innerHTML = t), p(e, this); - }), - (f.default.Element.prototype.addClass = function (e) { - return ( - this.elt.className - ? this.hasClass(e) || - (this.elt.className = this.elt.className + " " + e) - : (this.elt.className = e), - this - ); - }), - (f.default.Element.prototype.removeClass = function (e) { - return this.elt.classList.remove(e), this; - }), - (f.default.Element.prototype.hasClass = function (e) { - return this.elt.classList.contains(e); - }), - (f.default.Element.prototype.toggleClass = function (e) { - return ( - this.elt.classList.contains(e) - ? this.elt.classList.remove(e) - : this.elt.classList.add(e), - this - ); - }), - (f.default.Element.prototype.child = function (e) { - return void 0 === e - ? this.elt.childNodes - : ("string" == typeof e - ? ("#" === e[0] && (e = e.substring(1)), - (e = document.getElementById(e))) - : e instanceof f.default.Element && (e = e.elt), - e instanceof HTMLElement && this.elt.appendChild(e), - this); - }), - (f.default.Element.prototype.center = function (e) { - var t = this.elt.style.display, - r = "none" === this.elt.style.display, - o = "none" === this.parent().style.display, - n = { x: this.elt.offsetLeft, y: this.elt.offsetTop }, - s = - (r && this.show(), - o && this.parent().show(), - (this.elt.style.display = "block"), - this.position(0, 0), - Math.abs(this.parent().offsetWidth - this.elt.offsetWidth)), - i = Math.abs( - this.parent().offsetHeight - this.elt.offsetHeight, - ); - return ( - "both" === e || void 0 === e - ? this.position( - s / 2 + this.parent().offsetLeft, - i / 2 + this.parent().offsetTop, - ) - : "horizontal" === e - ? this.position(s / 2 + this.parent().offsetLeft, n.y) - : "vertical" === e && - this.position(n.x, i / 2 + this.parent().offsetTop), - this.style("display", t), - r && this.hide(), - o && this.parent().hide(), - this - ); - }), - (f.default.Element.prototype.html = function () { - return 0 === arguments.length - ? this.elt.innerHTML - : (arguments.length <= 1 || !arguments[1] - ? (this.elt.innerHTML = - arguments.length <= 0 ? void 0 : arguments[0]) - : this.elt.insertAdjacentHTML( - "beforeend", - arguments.length <= 0 ? void 0 : arguments[0], - ), - this); - }), - (f.default.Element.prototype.position = function () { - return 0 === arguments.length - ? { x: this.elt.offsetLeft, y: this.elt.offsetTop } - : ((this.elt.style.position = - "static" !== - (arguments.length <= 2 ? void 0 : arguments[2]) && - "fixed" !== - (arguments.length <= 2 ? void 0 : arguments[2]) && - "relative" !== - (arguments.length <= 2 ? void 0 : arguments[2]) && - "sticky" !== - (arguments.length <= 2 ? void 0 : arguments[2]) && - "initial" !== - (arguments.length <= 2 ? void 0 : arguments[2]) && - "inherit" !== - (arguments.length <= 2 ? void 0 : arguments[2]) - ? "absolute" - : arguments.length <= 2 - ? void 0 - : arguments[2]), - (this.elt.style.left = - (arguments.length <= 0 ? void 0 : arguments[0]) + "px"), - (this.elt.style.top = - (arguments.length <= 1 ? void 0 : arguments[1]) + "px"), - (this.x = arguments.length <= 0 ? void 0 : arguments[0]), - (this.y = arguments.length <= 1 ? void 0 : arguments[1]), - this); - }), - (f.default.Element.prototype._translate = function () { - this.elt.style.position = "absolute"; - var e = ""; - return ( - this.elt.style.transform && - (e = (e = this.elt.style.transform.replace( - /translate3d\(.*\)/g, - "", - )).replace(/translate[X-Z]?\(.*\)/g, "")), - 2 === arguments.length - ? (this.elt.style.transform = - "translate(" + - (arguments.length <= 0 ? void 0 : arguments[0]) + - "px, " + - (arguments.length <= 1 ? void 0 : arguments[1]) + - "px)") - : 2 < arguments.length && - ((this.elt.style.transform = - "translate3d(" + - (arguments.length <= 0 ? void 0 : arguments[0]) + - "px," + - (arguments.length <= 1 ? void 0 : arguments[1]) + - "px," + - (arguments.length <= 2 ? void 0 : arguments[2]) + - "px)"), - (this.elt.parentElement.style.perspective = - 3 === arguments.length - ? "1000px" - : (arguments.length <= 3 ? void 0 : arguments[3]) + - "px")), - (this.elt.style.transform += e), - this - ); - }), - (f.default.Element.prototype._rotate = function () { - var e = ""; - return ( - this.elt.style.transform && - (e = (e = this.elt.style.transform.replace( - /rotate3d\(.*\)/g, - "", - )).replace(/rotate[X-Z]?\(.*\)/g, "")), - 1 === arguments.length - ? (this.elt.style.transform = - "rotate(" + - (arguments.length <= 0 ? void 0 : arguments[0]) + - "deg)") - : 2 === arguments.length - ? (this.elt.style.transform = - "rotate(" + - (arguments.length <= 0 ? void 0 : arguments[0]) + - "deg, " + - (arguments.length <= 1 ? void 0 : arguments[1]) + - "deg)") - : 3 === arguments.length && - ((this.elt.style.transform = - "rotateX(" + - (arguments.length <= 0 ? void 0 : arguments[0]) + - "deg)"), - (this.elt.style.transform += - "rotateY(" + - (arguments.length <= 1 ? void 0 : arguments[1]) + - "deg)"), - (this.elt.style.transform += - "rotateZ(" + - (arguments.length <= 2 ? void 0 : arguments[2]) + - "deg)")), - (this.elt.style.transform += e), - this - ); - }), - (f.default.Element.prototype.style = function (e, t) { - if ( - void 0 === - (t = - t instanceof f.default.Color - ? "rgba(" + - t.levels[0] + - "," + - t.levels[1] + - "," + - t.levels[2] + - "," + - t.levels[3] / 255 + - ")" - : t) - ) { - if (-1 === e.indexOf(":")) - return window.getComputedStyle(this.elt).getPropertyValue(e); - for (var r = e.split(";"), o = 0; o < r.length; o++) { - var n = r[o].split(":"); - n[0] && n[1] && (this.elt.style[n[0].trim()] = n[1].trim()); - } - } else - (this.elt.style[e] = t), - ("width" !== e && - "height" !== e && - "left" !== e && - "top" !== e) || - ((t = window - .getComputedStyle(this.elt) - .getPropertyValue(e) - .replace(/[^\d.]/g, "")), - (this[e] = Math.round(parseFloat(t, 10)))); - return this; - }), - (f.default.Element.prototype.attribute = function (e, t) { - if ( - null == this.elt.firstChild || - ("checkbox" !== this.elt.firstChild.type && - "radio" !== this.elt.firstChild.type) - ) - return void 0 === t - ? this.elt.getAttribute(e) - : (this.elt.setAttribute(e, t), this); - if (void 0 === t) return this.elt.firstChild.getAttribute(e); - for (var r = 0; r < this.elt.childNodes.length; r++) - this.elt.childNodes[r].setAttribute(e, t); - }), - (f.default.Element.prototype.removeAttribute = function (e) { - if ( - null != this.elt.firstChild && - ("checkbox" === this.elt.firstChild.type || - "radio" === this.elt.firstChild.type) - ) - for (var t = 0; t < this.elt.childNodes.length; t++) - this.elt.childNodes[t].removeAttribute(e); - return this.elt.removeAttribute(e), this; - }), - (f.default.Element.prototype.value = function () { - return 0 < arguments.length - ? ((this.elt.value = - arguments.length <= 0 ? void 0 : arguments[0]), - this) - : "range" === this.elt.type - ? parseFloat(this.elt.value) - : this.elt.value; - }), - (f.default.Element.prototype.show = function () { - return (this.elt.style.display = "block"), this; - }), - (f.default.Element.prototype.hide = function () { - return (this.elt.style.display = "none"), this; - }), - (f.default.Element.prototype.size = function (e, t) { - if (0 === arguments.length) - return { - width: this.elt.offsetWidth, - height: this.elt.offsetHeight, - }; - var r = e, - o = t, - n = f.default.prototype.AUTO; - if (r !== n || o !== n) { - if ( - (r === n - ? (r = (t * this.width) / this.height) - : o === n && (o = (e * this.height) / this.width), - this.elt instanceof HTMLCanvasElement) - ) { - var s, - i = {}, - a = this.elt.getContext("2d"); - for (s in a) i[s] = a[s]; - for (s in (this.elt.setAttribute( - "width", - r * this._pInst._pixelDensity, - ), - this.elt.setAttribute( - "height", - o * this._pInst._pixelDensity, - ), - (this.elt.style.width = r + "px"), - (this.elt.style.height = o + "px"), - this._pInst.scale( - this._pInst._pixelDensity, - this._pInst._pixelDensity, - ), - i)) - this.elt.getContext("2d")[s] = i[s]; - } else - (this.elt.style.width = r + "px"), - (this.elt.style.height = o + "px"), - (this.elt.width = r), - (this.elt.height = o); - (this.width = this.elt.offsetWidth), - (this.height = this.elt.offsetHeight), - this._pInst && - this._pInst._curElement && - this._pInst._curElement.elt === this.elt && - (this._pInst._setProperty("width", this.elt.offsetWidth), - this._pInst._setProperty("height", this.elt.offsetHeight)); - } - return this; - }), - (f.default.Element.prototype.remove = function () { - this instanceof f.default.MediaElement && - (this.stop(), - null !== (t = this.elt.srcObject) && - t.getTracks().forEach(function (e) { - e.stop(); - })); - var e, - t = this._pInst._elements.indexOf(this); - for (e in (-1 !== t && this._pInst._elements.splice(t, 1), - this._events)) - this.elt.removeEventListener(e, this._events[e]); - this.elt && - this.elt.parentNode && - this.elt.parentNode.removeChild(this.elt); - }), - (f.default.Element.prototype.drop = function (a, l) { - var e; - return ( - window.File && - window.FileReader && - window.FileList && - window.Blob - ? (this._dragDisabled || - ((this._dragDisabled = !0), - this.elt.addEventListener( - "dragover", - (e = function (e) { - e.preventDefault(); - }), - ), - this.elt.addEventListener("dragleave", e)), - f.default.Element._attachListener( - "drop", - function (e) { - e.preventDefault(), - "function" == typeof l && l.call(this, e); - var e = e.dataTransfer.files, - t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = e[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - f.default.File._load(i, a); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - }, - this, - )) - : console.log( - "The File APIs are not fully supported in this browser.", - ), - this - ); - }), - (f.default.Element.prototype.draggable = function (r) { - var e, - o = "ontouchstart" in window, - n = 0, - s = 0, - i = 0, - a = 0, - l = o ? "touchend" : "mouseup", - u = o ? "touchmove" : "mousemove"; - function c(e) { - var t; - (e = e || window.event), - (a = o - ? ((t = e.changedTouches), - (n = i - parseInt(t[0].clientX)), - (s = a - parseInt(t[0].clientY)), - (i = parseInt(t[0].clientX)), - parseInt(t[0].clientY)) - : ((n = i - parseInt(e.clientX)), - (s = a - parseInt(e.clientY)), - (i = parseInt(e.clientX)), - parseInt(e.clientY))), - (r.style.left = r.offsetLeft - n + "px"), - (r.style.top = r.offsetTop - s + "px"); - } - function d() { - document.removeEventListener(l, d, !1), - document.removeEventListener(u, c, !1); - } - return ( - void 0 === r - ? (e = r = this.elt) - : r !== this.elt && - r.elt !== this.elt && - ((r = r.elt), (e = this.elt)), - e.addEventListener( - o ? "touchstart" : "mousedown", - function (e) { - { - var t; - (e = e || window.event), - (a = o - ? ((t = e.changedTouches), - (i = parseInt(t[0].clientX)), - parseInt(t[0].clientY)) - : ((i = parseInt(e.clientX)), parseInt(e.clientY))); - } - return ( - document.addEventListener(l, d, !1), - document.addEventListener(u, c, !1), - !1 - ); - }, - !1, - ), - (e.style.cursor = "move"), - this - ); - }); - function y(e, t, r, o) { - d(this, y), - (this.callback = e), - (this.time = t), - (this.id = r), - (this.val = o); - } - (t = (function (t) { - var r = i; - if ("function" != typeof t && null !== t) - throw new TypeError( - "Super expression must either be null or a function", - ); - (r.prototype = Object.create(t && t.prototype, { - constructor: { value: r, writable: !0, configurable: !0 }, - })), - t && l(r, t); - var s = u(i); - function i(o, e) { - d(this, i); - var n = c((e = s.call(this, o, e))); - return ( - (e.elt.crossOrigin = "anonymous"), - (e._prevTime = 0), - (e._cueIDCounter = 0), - (e._cues = []), - (e.pixels = []), - (e._pixelsState = c(e)), - (e._pixelDensity = 1), - (e._modified = !1), - (e._frameOnCanvas = -1), - Object.defineProperty(n, "src", { - get: function () { - var e = n.elt.children[0].src, - t = n.elt.src === window.location.href ? "" : n.elt.src; - return e === window.location.href ? t : e; - }, - set: function (e) { - for (var t = 0; t < n.elt.children.length; t++) - n.elt.removeChild(n.elt.children[t]); - var r = document.createElement("source"); - (r.src = e), - o.appendChild(r), - (n.elt.src = e), - (n.modified = !0); - }, - }), - (n._onended = function () {}), - (n.elt.onended = function () { - n._onended(n); - }), - e - ); - } - return ( - a(i, [ - { - key: "play", - value: function () { - var e; - return ( - this.elt.currentTime === this.elt.duration && - (this.elt.currentTime = 0), - 1 < this.elt.readyState || this.elt.load(), - (e = this.elt.play()) && - e.catch && - e.catch(function (e) { - "NotAllowedError" === e.name - ? console.error(e) - : console.error( - "Media play method encountered an unexpected error", - e, - ); - }), - this - ); - }, - }, - { - key: "stop", - value: function () { - return this.elt.pause(), (this.elt.currentTime = 0), this; - }, - }, - { - key: "pause", - value: function () { - return this.elt.pause(), this; - }, - }, - { - key: "loop", - value: function () { - return this.elt.setAttribute("loop", !0), this.play(), this; - }, - }, - { - key: "noLoop", - value: function () { - return this.elt.removeAttribute("loop"), this; - }, - }, - { - key: "_setupAutoplayFailDetection", - value: function () { - var t = setTimeout(function () { - console.error(e); - }, 500); - this.elt.addEventListener( - "play", - function () { - return clearTimeout(t); - }, - { passive: !0, once: !0 }, - ); - }, - }, - { - key: "autoplay", - value: function (e) { - var t = this, - r = this.elt.getAttribute("autoplay"); - return ( - this.elt.setAttribute("autoplay", e), - e && - !r && - ((e = function () { - return t._setupAutoplayFailDetection(); - }), - 4 === this.elt.readyState - ? e() - : this.elt.addEventListener("canplay", e, { - passive: !0, - once: !0, - })), - this - ); - }, - }, - { - key: "volume", - value: function (e) { - if (void 0 === e) return this.elt.volume; - this.elt.volume = e; - }, - }, - { - key: "speed", - value: function (e) { - if (void 0 === e) - return this.presetPlaybackRate || this.elt.playbackRate; - this.loadedmetadata - ? (this.elt.playbackRate = e) - : (this.presetPlaybackRate = e); - }, - }, - { - key: "time", - value: function (e) { - return void 0 === e - ? this.elt.currentTime - : ((this.elt.currentTime = e), this); - }, - }, - { - key: "duration", - value: function () { - return this.elt.duration; - }, - }, - { - key: "_ensureCanvas", - value: function () { - this.canvas || - ((this.canvas = document.createElement("canvas")), - (this.drawingContext = this.canvas.getContext("2d")), - this.setModified(!0)); - var e = this._frameOnCanvas !== this._pInst.frameCount; - this.loadedmetadata && - e && - (this.canvas.width !== this.elt.width && - ((this.canvas.width = this.elt.width), - (this.canvas.height = this.elt.height), - (this.width = this.canvas.width), - (this.height = this.canvas.height)), - this.drawingContext.clearRect( - 0, - 0, - this.canvas.width, - this.canvas.height, - ), - this.drawingContext.drawImage( - this.elt, - 0, - 0, - this.canvas.width, - this.canvas.height, - ), - this.setModified(!0), - (this._frameOnCanvas = this._pInst.frameCount)); - }, - }, - { - key: "loadPixels", - value: function () { - this._ensureCanvas(); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return f.default.Renderer2D.prototype.loadPixels.apply( - this, - t, - ); - }, - }, - { - key: "updatePixels", - value: function (e, t, r, o) { - return ( - this.loadedmetadata && - (this._ensureCanvas(), - f.default.Renderer2D.prototype.updatePixels.call( - this, - e, - t, - r, - o, - )), - this.setModified(!0), - this - ); - }, - }, - { - key: "get", - value: function () { - this._ensureCanvas(); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return f.default.Renderer2D.prototype.get.apply(this, t); - }, - }, - { - key: "_getPixel", - value: function () { - this.loadPixels(); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return f.default.Renderer2D.prototype._getPixel.apply( - this, - t, - ); - }, - }, - { - key: "set", - value: function (e, t, r) { - this.loadedmetadata && - (this._ensureCanvas(), - f.default.Renderer2D.prototype.set.call(this, e, t, r), - this.setModified(!0)); - }, - }, - { - key: "copy", - value: function () { - this._ensureCanvas(); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - f.default.prototype.copy.apply(this, t); - }, - }, - { - key: "mask", - value: function () { - this.loadPixels(), this.setModified(!0); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - f.default.Image.prototype.mask.apply(this, t); - }, - }, - { - key: "isModified", - value: function () { - return this._modified; - }, - }, - { - key: "setModified", - value: function (e) { - this._modified = e; - }, - }, - { - key: "onended", - value: function (e) { - return (this._onended = e), this; - }, - }, - { - key: "connect", - value: function (e) { - var t, r; - if ( - "function" == typeof f.default.prototype.getAudioContext - ) - (t = f.default.prototype.getAudioContext()), - (r = f.default.soundOut.input); - else - try { - r = (t = e.context).destination; - } catch (e) { - throw "connect() is meant to be used with Web Audio API or p5.sound.js"; - } - this.audioSourceNode || - ((this.audioSourceNode = t.createMediaElementSource( - this.elt, - )), - this.audioSourceNode.connect(r)), - e - ? e.input - ? this.audioSourceNode.connect(e.input) - : this.audioSourceNode.connect(e) - : this.audioSourceNode.connect(r); - }, - }, - { - key: "disconnect", - value: function () { - if (!this.audioSourceNode) throw "nothing to disconnect"; - this.audioSourceNode.disconnect(); - }, - }, - { - key: "showControls", - value: function () { - (this.elt.style["text-align"] = "inherit"), - (this.elt.controls = !0); - }, - }, - { - key: "hideControls", - value: function () { - this.elt.controls = !1; - }, - }, - { - key: "addCue", - value: function (e, t, r) { - var o = this._cueIDCounter++, - t = new y(t, e, o, r); - return ( - this._cues.push(t), - this.elt.ontimeupdate || - (this.elt.ontimeupdate = this._onTimeUpdate.bind(this)), - o - ); - }, - }, - { - key: "removeCue", - value: function (e) { - for (var t = 0; t < this._cues.length; t++) - this._cues[t].id === e && - (console.log(e), this._cues.splice(t, 1)); - 0 === this._cues.length && (this.elt.ontimeupdate = null); - }, - }, - { - key: "clearCues", - value: function () { - (this._cues = []), (this.elt.ontimeupdate = null); - }, - }, - { - key: "_onTimeUpdate", - value: function () { - for ( - var e = this.time(), t = 0; - t < this._cues.length; - t++ - ) { - var r = this._cues[t].time, - o = this._cues[t].val; - this._prevTime < r && r <= e && this._cues[t].callback(o); - } - this._prevTime = e; - }, - }, - ]), - i - ); - })(f.default.Element)), - (f.default.MediaElement = t), - (t = (function () { - function r(e, t) { - d(this, r), (this.file = e), (this._pInst = t); - t = e.type.split("/"); - (this.type = t[0]), - (this.subtype = t[1]), - (this.name = e.name), - (this.size = e.size), - (this.data = void 0); - } - return ( - a(r, null, [ - { - key: "_createLoader", - value: function (o, n) { - var e = new FileReader(); - return ( - (e.onload = function (e) { - var t, - r = new f.default.File(o); - "application/json" === r.file.type - ? (r.data = JSON.parse(e.target.result)) - : "text/xml" === r.file.type - ? ((t = new DOMParser().parseFromString( - e.target.result, - "text/xml", - )), - (r.data = new f.default.XML(t.documentElement))) - : (r.data = e.target.result), - n(r); - }), - e - ); - }, - }, - { - key: "_load", - value: function (e, t) { - var r; - /^text\//.test(e.type) || "application/json" === e.type - ? f.default.File._createLoader(e, t).readAsText(e) - : /^(video|audio)\//.test(e.type) - ? (((r = new f.default.File(e)).data = - URL.createObjectURL(e)), - t(r)) - : f.default.File._createLoader(e, t).readAsDataURL(e); - }, - }, - ]), - r - ); - })()), - (f.default.File = t), - (t = f.default); - o.default = t; - }, - { - "../core/main": 275, - "core-js/modules/es.array.every": 153, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.promise": 183, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.trim": 201, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - "core-js/modules/web.url": 240, - }, - ], - 292: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (y = e("../core/main")) && y.__esModule ? y : { default: y }, - s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - (n.default.prototype.deviceOrientation = - 1 < window.innerWidth / window.innerHeight - ? "landscape" - : "portrait"), - (n.default.prototype.accelerationX = 0), - (n.default.prototype.accelerationY = 0), - (n.default.prototype.accelerationZ = 0), - (n.default.prototype.pAccelerationX = 0), - (n.default.prototype.pAccelerationY = 0), - (n.default.prototype.pAccelerationZ = 0), - (n.default.prototype._updatePAccelerations = function () { - this._setProperty("pAccelerationX", this.accelerationX), - this._setProperty("pAccelerationY", this.accelerationY), - this._setProperty("pAccelerationZ", this.accelerationZ); - }), - (n.default.prototype.rotationX = 0), - (n.default.prototype.rotationY = 0), - (n.default.prototype.rotationZ = 0), - (n.default.prototype.pRotationX = 0), - (n.default.prototype.pRotationY = 0); - var l = (n.default.prototype.pRotationZ = 0), - u = 0, - c = 0, - d = "clockwise", - h = "clockwise", - f = "clockwise", - p = - ((n.default.prototype.pRotateDirectionX = void 0), - (n.default.prototype.pRotateDirectionY = void 0), - (n.default.prototype.pRotateDirectionZ = void 0), - (n.default.prototype._updatePRotations = function () { - this._setProperty("pRotationX", this.rotationX), - this._setProperty("pRotationY", this.rotationY), - this._setProperty("pRotationZ", this.rotationZ); - }), - (n.default.prototype.turnAxis = void 0), - 0.5), - m = 30, - y = - ((n.default.prototype.setMoveThreshold = function (e) { - n.default._validateParameters("setMoveThreshold", arguments), - (p = e); - }), - (n.default.prototype.setShakeThreshold = function (e) { - n.default._validateParameters("setShakeThreshold", arguments), - (m = e); - }), - (n.default.prototype._ondeviceorientation = function (e) { - this._updatePRotations(), - this._angleMode === s.radians && - ((e.beta = e.beta * (_PI / 180)), - (e.gamma = e.gamma * (_PI / 180)), - (e.alpha = e.alpha * (_PI / 180))), - this._setProperty("rotationX", e.beta), - this._setProperty("rotationY", e.gamma), - this._setProperty("rotationZ", e.alpha), - this._handleMotion(); - }), - (n.default.prototype._ondevicemotion = function (e) { - this._updatePAccelerations(), - this._setProperty("accelerationX", 2 * e.acceleration.x), - this._setProperty("accelerationY", 2 * e.acceleration.y), - this._setProperty("accelerationZ", 2 * e.acceleration.z), - this._handleMotion(); - }), - (n.default.prototype._handleMotion = function () { - 90 === window.orientation || -90 === window.orientation - ? this._setProperty("deviceOrientation", "landscape") - : 0 === window.orientation - ? this._setProperty("deviceOrientation", "portrait") - : void 0 === window.orientation && - this._setProperty("deviceOrientation", "undefined"); - var e, - t, - r, - o, - n, - s = this._isGlobal ? window : this; - "function" == typeof s.deviceMoved && - (Math.abs(this.accelerationX - this.pAccelerationX) > p || - Math.abs(this.accelerationY - this.pAccelerationY) > p || - Math.abs(this.accelerationZ - this.pAccelerationZ) > p) && - s.deviceMoved(), - "function" == typeof s.deviceTurned && - ((t = this.rotationX + 180), - (e = this.pRotationX + 180), - (r = l + 180), - (0 < t - e && t - e < 270) || t - e < -270 - ? (d = "clockwise") - : (t - e < 0 || 270 < t - e) && (d = "counter-clockwise"), - d !== this.pRotateDirectionX && (r = t), - 90 < Math.abs(t - r) && - Math.abs(t - r) < 270 && - ((r = t), - this._setProperty("turnAxis", "X"), - s.deviceTurned()), - (this.pRotateDirectionX = d), - (l = r - 180), - (e = this.rotationY + 180), - (t = this.pRotationY + 180), - (r = u + 180), - (0 < e - t && e - t < 270) || e - t < -270 - ? (h = "clockwise") - : (e - t < 0 || 270 < e - this.pRotationY) && - (h = "counter-clockwise"), - h !== this.pRotateDirectionY && (r = e), - 90 < Math.abs(e - r) && - Math.abs(e - r) < 270 && - ((r = e), - this._setProperty("turnAxis", "Y"), - s.deviceTurned()), - (this.pRotateDirectionY = h), - (u = r - 180), - (0 < this.rotationZ - this.pRotationZ && - this.rotationZ - this.pRotationZ < 270) || - this.rotationZ - this.pRotationZ < -270 - ? (f = "clockwise") - : (this.rotationZ - this.pRotationZ < 0 || - 270 < this.rotationZ - this.pRotationZ) && - (f = "counter-clockwise"), - f !== this.pRotateDirectionZ && (c = this.rotationZ), - 90 < Math.abs(this.rotationZ - c) && - Math.abs(this.rotationZ - c) < 270 && - ((c = this.rotationZ), - this._setProperty("turnAxis", "Z"), - s.deviceTurned()), - (this.pRotateDirectionZ = f), - this._setProperty("turnAxis", void 0)), - "function" == typeof s.deviceShaken && - (null !== this.pAccelerationX && - ((o = Math.abs(this.accelerationX - this.pAccelerationX)), - (n = Math.abs(this.accelerationY - this.pAccelerationY))), - m < o + n && s.deviceShaken()); - }), - n.default); - r.default = y; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 293: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (o.default.prototype.isKeyPressed = !1), - (o.default.prototype.keyIsPressed = !1), - (o.default.prototype.key = ""), - (o.default.prototype.keyCode = 0), - (o.default.prototype._onkeydown = function (e) { - var t; - this._downKeys[e.which] || - (this._setProperty("isKeyPressed", !0), - this._setProperty("keyIsPressed", !0), - this._setProperty("keyCode", e.which), - (this._downKeys[e.which] = !0), - this._setProperty( - "key", - e.key || String.fromCharCode(e.which) || e.which, - ), - "function" != - typeof (t = this._isGlobal ? window : this).keyPressed || - e.charCode || - (!1 === t.keyPressed(e) && e.preventDefault())); - }), - (o.default.prototype._onkeyup = function (e) { - (this._downKeys[e.which] = !1), - this._areDownKeys() || - (this._setProperty("isKeyPressed", !1), - this._setProperty("keyIsPressed", !1)), - this._setProperty("_lastKeyCodeTyped", null), - this._setProperty( - "key", - e.key || String.fromCharCode(e.which) || e.which, - ), - this._setProperty("keyCode", e.which); - var t = this._isGlobal ? window : this; - "function" == typeof t.keyReleased && - !1 === t.keyReleased(e) && - e.preventDefault(); - }), - (o.default.prototype._onkeypress = function (e) { - var t; - e.which !== this._lastKeyCodeTyped && - (this._setProperty("_lastKeyCodeTyped", e.which), - this._setProperty( - "key", - e.key || String.fromCharCode(e.which) || e.which, - ), - "function" == - typeof (t = this._isGlobal ? window : this).keyTyped && - !1 === t.keyTyped(e) && - e.preventDefault()); - }), - (o.default.prototype._onblur = function (e) { - this._downKeys = {}; - }), - (o.default.prototype.keyIsDown = function (e) { - return ( - o.default._validateParameters("keyIsDown", arguments), - this._downKeys[e] || !1 - ); - }), - (o.default.prototype._areDownKeys = function () { - for (var e in this._downKeys) - if ( - this._downKeys.hasOwnProperty(e) && - !0 === this._downKeys[e] - ) - return !0; - return !1; - }); - e = o.default; - r.default = e; - }, - { "../core/main": 275 }, - ], - 294: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.string.includes"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - (n.default.prototype.movedX = 0), - (n.default.prototype.movedY = 0), - (n.default.prototype._hasMouseInteracted = !1), - (n.default.prototype.mouseX = 0), - (n.default.prototype.mouseY = 0), - (n.default.prototype.pmouseX = 0), - (n.default.prototype.pmouseY = 0), - (n.default.prototype.winMouseX = 0), - (n.default.prototype.winMouseY = 0), - (n.default.prototype.pwinMouseX = 0), - (n.default.prototype.pwinMouseY = 0), - (n.default.prototype.mouseButton = 0), - (n.default.prototype.mouseIsPressed = !1), - (n.default.prototype._updateNextMouseCoords = function (e) { - var t, r, o, n, s; - null !== this._curElement && - (!e.touches || 0 < e.touches.length) && - ((t = this._curElement.elt), - (r = this.width), - (o = this.height), - (n = e) && - !n.clientX && - (n.touches - ? (n = n.touches[0]) - : n.changedTouches && (n = n.changedTouches[0])), - (s = t.getBoundingClientRect()), - (r = t.scrollWidth / r || 1), - (t = t.scrollHeight / o || 1), - (o = { - x: (n.clientX - s.left) / r, - y: (n.clientY - s.top) / t, - winX: n.clientX, - winY: n.clientY, - id: n.identifier, - }), - this._setProperty("movedX", e.movementX), - this._setProperty("movedY", e.movementY), - this._setProperty("mouseX", o.x), - this._setProperty("mouseY", o.y), - this._setProperty("winMouseX", o.winX), - this._setProperty("winMouseY", o.winY)), - this._hasMouseInteracted || - (this._updateMouseCoords(), - this._setProperty("_hasMouseInteracted", !0)); - }), - (n.default.prototype._updateMouseCoords = function () { - this._setProperty("pmouseX", this.mouseX), - this._setProperty("pmouseY", this.mouseY), - this._setProperty("pwinMouseX", this.winMouseX), - this._setProperty("pwinMouseY", this.winMouseY), - this._setProperty("_pmouseWheelDeltaY", this._mouseWheelDeltaY); - }), - (n.default.prototype._setMouseButton = function (e) { - 1 === e.button - ? this._setProperty("mouseButton", s.CENTER) - : 2 === e.button - ? this._setProperty("mouseButton", s.RIGHT) - : this._setProperty("mouseButton", s.LEFT); - }), - (n.default.prototype._onmousemove = function (e) { - var t = this._isGlobal ? window : this; - this._updateNextMouseCoords(e), - this.mouseIsPressed - ? "function" == typeof t.mouseDragged - ? !1 === t.mouseDragged(e) && e.preventDefault() - : "function" == typeof t.touchMoved && - !1 === t.touchMoved(e) && - e.preventDefault() - : "function" == typeof t.mouseMoved && - !1 === t.mouseMoved(e) && - e.preventDefault(); - }), - (n.default.prototype._onmousedown = function (e) { - var t = this._isGlobal ? window : this; - this._setProperty("mouseIsPressed", !0), - this._setMouseButton(e), - this._updateNextMouseCoords(e), - "function" == typeof t.mousePressed - ? !1 === t.mousePressed(e) && e.preventDefault() - : navigator.userAgent.toLowerCase().includes("safari") && - "function" == typeof t.touchStarted && - !1 === t.touchStarted(e) && - e.preventDefault(); - }), - (n.default.prototype._onmouseup = function (e) { - var t = this._isGlobal ? window : this; - this._setProperty("mouseIsPressed", !1), - "function" == typeof t.mouseReleased - ? !1 === t.mouseReleased(e) && e.preventDefault() - : "function" == typeof t.touchEnded && - !1 === t.touchEnded(e) && - e.preventDefault(); - }), - (n.default.prototype._ondragend = n.default.prototype._onmouseup), - (n.default.prototype._ondragover = - n.default.prototype._onmousemove), - (n.default.prototype._onclick = function (e) { - var t = this._isGlobal ? window : this; - "function" == typeof t.mouseClicked && - !1 === t.mouseClicked(e) && - e.preventDefault(); - }), - (n.default.prototype._ondblclick = function (e) { - var t = this._isGlobal ? window : this; - "function" == typeof t.doubleClicked && - !1 === t.doubleClicked(e) && - e.preventDefault(); - }), - (n.default.prototype._mouseWheelDeltaY = 0), - (n.default.prototype._pmouseWheelDeltaY = 0), - (n.default.prototype._onwheel = function (e) { - var t = this._isGlobal ? window : this; - this._setProperty("_mouseWheelDeltaY", e.deltaY), - "function" == typeof t.mouseWheel && - ((e.delta = e.deltaY), - !1 === t.mouseWheel(e) && e.preventDefault()); - }), - (n.default.prototype.requestPointerLock = function () { - var e = this._curElement.elt; - return ( - (e.requestPointerLock = - e.requestPointerLock || e.mozRequestPointerLock), - e.requestPointerLock - ? (e.requestPointerLock(), !0) - : (console.log( - "requestPointerLock is not implemented in this browser", - ), - !1) - ); - }), - (n.default.prototype.exitPointerLock = function () { - document.exitPointerLock(); - }); - e = n.default; - r.default = e; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 295: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.string.includes"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (e.default.prototype.touches = []), - (e.default.prototype._updateTouchCoords = function (e) { - if (null !== this._curElement) { - for (var t = [], r = 0; r < e.touches.length; r++) - t[r] = (function (e, t, r, o) { - var n = - 4 < arguments.length && void 0 !== arguments[4] - ? arguments[4] - : 0, - s = e.getBoundingClientRect(), - t = e.scrollWidth / t || 1, - e = e.scrollHeight / r || 1, - r = o.touches[n] || o.changedTouches[n]; - return { - x: (r.clientX - s.left) / t, - y: (r.clientY - s.top) / e, - winX: r.clientX, - winY: r.clientY, - id: r.identifier, - }; - })(this._curElement.elt, this.width, this.height, e, r); - this._setProperty("touches", t); - } - }), - (e.default.prototype._ontouchstart = function (e) { - var t = this._isGlobal ? window : this; - this._setProperty("mouseIsPressed", !0), - this._updateTouchCoords(e), - this._updateNextMouseCoords(e), - this._updateMouseCoords(), - "function" == typeof t.touchStarted - ? !1 === t.touchStarted(e) && e.preventDefault() - : navigator.userAgent.toLowerCase().includes("safari") && - "function" == typeof t.mousePressed && - !1 === t.mousePressed(e) && - e.preventDefault(); - }), - (e.default.prototype._ontouchmove = function (e) { - var t = this._isGlobal ? window : this; - this._updateTouchCoords(e), - this._updateNextMouseCoords(e), - "function" == typeof t.touchMoved - ? !1 === t.touchMoved(e) && e.preventDefault() - : "function" == typeof t.mouseDragged && - !1 === t.mouseDragged(e) && - e.preventDefault(); - }), - (e.default.prototype._ontouchend = function (e) { - this._setProperty("mouseIsPressed", !1), - this._updateTouchCoords(e), - this._updateNextMouseCoords(e); - var t = this._isGlobal ? window : this; - "function" == typeof t.touchEnded - ? !1 === t.touchEnded(e) && e.preventDefault() - : "function" == typeof t.mouseReleased && - !1 === t.mouseReleased(e) && - e.preventDefault(); - }); - e = e.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.string.includes": 191, - }, - ], - 296: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.int32-array"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.int32-array"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var U, - N, - B, - G, - V = { - _toPixels: function (e) { - var t, r; - return e instanceof ImageData - ? e.data - : e.getContext("2d") - ? e.getContext("2d").getImageData(0, 0, e.width, e.height) - .data - : e.getContext("webgl") - ? ((r = - (t = e.getContext("webgl")).drawingBufferWidth * - t.drawingBufferHeight * - 4), - (r = new Uint8Array(r)), - t.readPixels( - 0, - 0, - e.width, - e.height, - t.RGBA, - t.UNSIGNED_BYTE, - r, - ), - r) - : void 0; - }, - _getARGB: function (e, t) { - t *= 4; - return ( - ((e[3 + t] << 24) & 4278190080) | - ((e[t] << 16) & 16711680) | - ((e[1 + t] << 8) & 65280) | - (255 & e[2 + t]) - ); - }, - _setPixels: function (e, t) { - for (var r, o = 0, n = e.length; o < n; o++) - (e[0 + (r = 4 * o)] = (16711680 & t[o]) >>> 16), - (e[1 + r] = (65280 & t[o]) >>> 8), - (e[2 + r] = 255 & t[o]), - (e[3 + r] = (4278190080 & t[o]) >>> 24); - }, - _toImageData: function (e) { - return e instanceof ImageData - ? e - : e.getContext("2d").getImageData(0, 0, e.width, e.height); - }, - _createImageData: function (e, t) { - return ( - (V._tmpCanvas = document.createElement("canvas")), - (V._tmpCtx = V._tmpCanvas.getContext("2d")), - this._tmpCtx.createImageData(e, t) - ); - }, - apply: function (e, t, r) { - var o = e.getContext("2d"), - n = o.getImageData(0, 0, e.width, e.height), - t = t(n, r); - t instanceof ImageData - ? o.putImageData(t, 0, 0, 0, 0, e.width, e.height) - : o.putImageData(n, 0, 0, 0, 0, e.width, e.height); - }, - threshold: function (e, t) { - for ( - var r = V._toPixels(e), - o = (void 0 === t && (t = 0.5), Math.floor(255 * t)), - n = 0; - n < r.length; - n += 4 - ) { - var s = void 0, - s = - o <= 0.2126 * r[n] + 0.7152 * r[n + 1] + 0.0722 * r[n + 2] - ? 255 - : 0; - r[n] = r[n + 1] = r[n + 2] = s; - } - }, - gray: function (e) { - for (var t = V._toPixels(e), r = 0; r < t.length; r += 4) { - var o = t[r], - n = t[r + 1], - s = t[r + 2]; - t[r] = - t[r + 1] = - t[r + 2] = - 0.2126 * o + 0.7152 * n + 0.0722 * s; - } - }, - opaque: function (e) { - for (var t = V._toPixels(e), r = 0; r < t.length; r += 4) - t[r + 3] = 255; - return t; - }, - invert: function (e) { - for (var t = V._toPixels(e), r = 0; r < t.length; r += 4) - (t[r] = 255 - t[r]), - (t[r + 1] = 255 - t[r + 1]), - (t[r + 2] = 255 - t[r + 2]); - }, - posterize: function (e, t) { - var r = V._toPixels(e); - if ((t = void 0 === t ? 4 : t) < 2 || 255 < t) - throw new Error( - "Level must be greater than 2 and less than 255 for posterize", - ); - for (var o = t - 1, n = 0; n < r.length; n += 4) { - var s = r[n], - i = r[n + 1], - a = r[n + 2]; - (r[n] = (255 * ((s * t) >> 8)) / o), - (r[n + 1] = (255 * ((i * t) >> 8)) / o), - (r[n + 2] = (255 * ((a * t) >> 8)) / o); - } - }, - dilate: function (e) { - for ( - var t, - r, - o, - n, - s, - i, - a, - l, - u, - c = V._toPixels(e), - d = 0, - h = c.length ? c.length / 4 : 0, - f = new Int32Array(h); - d < h; - - ) - for (r = (t = d) + e.width; d < r; ) - (n = o = V._getARGB(c, d)), - (u = d - 1) < t && (u = d), - r <= (l = d + 1) && (l = d), - (s = d - e.width) < 0 && (s = 0), - h <= (i = d + e.width) && (i = d), - (s = V._getARGB(c, s)), - (u = V._getARGB(c, u)), - (i = V._getARGB(c, i)), - (n = - 77 * ((n >> 16) & 255) + - 151 * ((n >> 8) & 255) + - 28 * (255 & n)) < - (a = - 77 * ((u >> 16) & 255) + - 151 * ((u >> 8) & 255) + - 28 * (255 & u)) && ((o = u), (n = a)), - n < - (a = - 77 * (((u = V._getARGB(c, l)) >> 16) & 255) + - 151 * ((u >> 8) & 255) + - 28 * (255 & u)) && ((o = u), (n = a)), - n < - (l = - 77 * ((s >> 16) & 255) + - 151 * ((s >> 8) & 255) + - 28 * (255 & s)) && ((o = s), (n = l)), - n < - (u = - 77 * ((i >> 16) & 255) + - 151 * ((i >> 8) & 255) + - 28 * (255 & i)) && ((o = i), (n = u)), - (f[d++] = o); - V._setPixels(c, f); - }, - erode: function (e) { - for ( - var t, - r, - o, - n, - s, - i, - a, - l, - u, - c = V._toPixels(e), - d = 0, - h = c.length ? c.length / 4 : 0, - f = new Int32Array(h); - d < h; - - ) - for (r = (t = d) + e.width; d < r; ) - (n = o = V._getARGB(c, d)), - (u = d - 1) < t && (u = d), - r <= (l = d + 1) && (l = d), - (s = d - e.width) < 0 && (s = 0), - h <= (i = d + e.width) && (i = d), - (s = V._getARGB(c, s)), - (u = V._getARGB(c, u)), - (i = V._getARGB(c, i)), - (a = - 77 * ((u >> 16) & 255) + - 151 * ((u >> 8) & 255) + - 28 * (255 & u)) < - (n = - 77 * ((n >> 16) & 255) + - 151 * ((n >> 8) & 255) + - 28 * (255 & n)) && ((o = u), (n = a)), - (a = - 77 * (((u = V._getARGB(c, l)) >> 16) & 255) + - 151 * ((u >> 8) & 255) + - 28 * (255 & u)) < n && ((o = u), (n = a)), - (l = - 77 * ((s >> 16) & 255) + - 151 * ((s >> 8) & 255) + - 28 * (255 & s)) < n && ((o = s), (n = l)), - (u = - 77 * ((i >> 16) & 255) + - 151 * ((i >> 8) & 255) + - 28 * (255 & i)) < n && ((o = i), (n = u)), - (f[d++] = o); - V._setPixels(c, f); - }, - blur: function (e, D) { - for ( - var t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - d = V._toPixels(e), - h = e.width, - f = e.height, - p = h * f, - m = new Int32Array(p), - y = 0; - y < p; - y++ - ) - m[y] = V._getARGB(d, y); - var g, - v, - b, - j, - _, - x, - w, - S, - T = new Int32Array(p), - M = new Int32Array(p), - E = new Int32Array(p), - F = new Int32Array(p), - k = 0, - C = (3.5 * D) | 0; - if (U !== (C = C < 1 ? 1 : C < 248 ? C : 248)) { - (N = (1 + (U = C)) << 1), - (B = new Int32Array(N)), - (G = new Array(N)); - for (var O = 0; O < N; O++) G[O] = new Int32Array(256); - for (var P = 1, A = C - 1; P < C; P++) { - (B[C + P] = B[A] = x = A * A), (w = G[C + P]), (S = G[A--]); - for (var L = 0; L < 256; L++) w[L] = S[L] = x * L; - } - (_ = B[C] = C * C), (w = G[C]); - for (var R = 0; R < 256; R++) w[R] = _ * R; - } - for (v = 0; v < f; v++) { - for (g = 0; g < h; g++) { - if (((n = o = r = s = t = 0), (i = g - U) < 0)) - (c = -i), (i = 0); - else { - if (h <= i) break; - c = 0; - } - for (b = c; b < N && !(h <= i); b++) { - var I = m[i + k]; - (j = G[b]), - (s += j[(-16777216 & I) >>> 24]), - (r += j[(16711680 & I) >> 16]), - (o += j[(65280 & I) >> 8]), - (n += j[255 & I]), - (t += B[b]), - i++; - } - (T[(a = k + g)] = s / t), - (M[a] = r / t), - (E[a] = o / t), - (F[a] = n / t); - } - k += h; - } - for (u = (l = -U) * h, v = k = 0; v < f; v++) { - for (g = 0; g < h; g++) { - if (((n = o = r = s = t = 0), l < 0)) (c = a = -l), (i = g); - else { - if (f <= l) break; - (c = 0), (a = l), (i = g + u); - } - for (b = c; b < N && !(f <= a); b++) - (j = G[b]), - (s += j[T[i]]), - (r += j[M[i]]), - (o += j[E[i]]), - (n += j[F[i]]), - (t += B[b]), - a++, - (i += h); - m[g + k] = - ((s / t) << 24) | - ((r / t) << 16) | - ((o / t) << 8) | - (n / t); - } - (k += h), (u += h), l++; - } - V._setPixels(d, m); - }, - }; - r.default = V; - }, - { - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.int32-array": 217, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-array": 234, - }, - ], - 297: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var C = o(e("../core/main")), - O = o(e("omggif")); - function o(e) { - return e && e.__esModule ? e : { default: e }; - } - function P(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - (C.default.prototype.createImage = function (e, t) { - return ( - C.default._validateParameters("createImage", arguments), - new C.default.Image(e, t) - ); - }), - (C.default.prototype.saveCanvas = function () { - C.default._validateParameters("saveCanvas", arguments); - var e, - t, - r, - o, - n, - s, - i = [].slice.call(arguments); - switch ( - (arguments[0] instanceof HTMLCanvasElement - ? ((e = arguments[0]), i.shift()) - : arguments[0] instanceof C.default.Element - ? ((e = arguments[0].elt), i.shift()) - : arguments[0] instanceof C.default.Framebuffer - ? ((n = this.createGraphics( - (o = arguments[0]).width, - o.height, - )).pixelDensity(pixelDensity()), - o.loadPixels(), - n.loadPixels(), - n.pixels.set(o.pixels), - n.updatePixels(), - (e = n.elt), - i.shift()) - : (e = this._curElement && this._curElement.elt), - 1 <= i.length && (t = i[0]), - (r = - (r = 2 <= i.length ? i[1] : r) || - C.default.prototype._checkFileExtension(t, r)[1] || - "png")) - ) { - default: - s = "image/png"; - break; - case "jpeg": - case "jpg": - s = "image/jpeg"; - } - e.toBlob(function (e) { - C.default.prototype.downloadFile(e, t, r), n && n.remove(); - }, s); - }), - (C.default.prototype.encodeAndDownloadGif = function (d, e) { - for ( - var h = d.gifProperties, - t = h.loopLimit, - r = - (1 === t ? (t = null) : null === t && (t = 0), - new Uint8Array(d.width * d.height * h.numFrames)), - f = [], - o = {}, - n = 0; - n < h.numFrames; - n++ - ) { - for ( - var s = new Set(), - i = h.frames[n].image.data, - a = i.length, - l = new Uint32Array(d.width * d.height), - u = 0, - c = 0; - u < a; - u += 4, c++ - ) { - var p = (i[u + 0] << 16) | (i[u + 1] << 8) | (i[u + 2] << 0); - s.add(p), (l[c] = p); - } - var m = P(s).sort().toString(); - void 0 === o[m] - ? (o[m] = { freq: 1, frames: [n] }) - : ((o[m].freq += 1), o[m].frames.push(n)), - f.push(l); - } - for ( - var y = [], - g = Object.keys(o).sort(function (e, t) { - return o[t].freq - o[e].freq; - }), - v = g[0].split(",").map(function (e) { - return parseInt(e); - }), - y = y.concat(o[v].frames), - b = new Set(v), - j = 1; - j < g.length; - j++ - ) { - var _ = g[j] - .split(",") - .map(function (e) { - return parseInt(e); - }) - .filter(function (e) { - return !b.has(e); - }); - if (v.length + _.length <= 256) { - for (var x = 0; x < _.length; x++) v.push(_[x]), b.add(_[x]); - y = y.concat(o[g[j]].frames); - } - } - y = new Set(y); - for (var w = {}, S = 0; S < v.length; S++) - w[v[S]] || (w[v[S]] = S); - for (var T = 1; T < v.length; ) T <<= 1; - v.length = T; - for ( - var t = { loop: t, palette: new Uint32Array(v) }, - M = new O.default.GifWriter(r, d.width, d.height, t), - E = {}, - k = 0; - k < h.numFrames; - k++ - ) - !(function (r) { - var o = !y.has(r), - n = o ? [] : v, - s = new Uint8Array(d.width * d.height), - i = {}, - a = new Set(), - e = - (f[r].forEach(function (e, t) { - o - ? (void 0 === i[e] && ((i[e] = n.length), n.push(e)), - (s[t] = i[e])) - : (s[t] = w[e]), - 0 < r && f[r - 1][t] !== e && a.add(e); - }), - {}), - t = n.filter(function (e) { - return !a.has(e); - }); - if (0 < t.length) { - var t = t[0], - l = (o ? i : w)[t]; - if (0 < r) { - for (var u = 0; u < f[r].length; u++) - f[r - 1][u] === f[r][u] && (s[u] = l); - (e.transparent = l), (E.frameOpts.disposal = 1); - } - } - if (((e.delay = h.frames[r].delay / 10), o)) { - for (var c = 1; c < n.length; ) c <<= 1; - (n.length = c), (e.palette = new Uint32Array(n)); - } - 0 < r && - M.addFrame( - 0, - 0, - d.width, - d.height, - E.pixelPaletteIndex, - E.frameOpts, - ), - (E = { pixelPaletteIndex: s, frameOpts: e }); - })(k); - (E.frameOpts.disposal = 1), - M.addFrame( - 0, - 0, - d.width, - d.height, - E.pixelPaletteIndex, - E.frameOpts, - ); - t = new Blob([r.slice(0, M.end())], { type: "image/gif" }); - C.default.prototype.downloadFile(t, e, "gif"); - }), - (C.default.prototype.saveFrames = function (e, t, r, o, n) { - C.default._validateParameters("saveFrames", arguments); - r = C.default.prototype.constrain((r = r || 3), 0, 15); - r *= 1e3; - var o = C.default.prototype.constrain(o || 15, 0, 22), - s = 0, - i = C.default.prototype._makeFrame, - a = this._curElement.elt, - l = [], - u = setInterval(function () { - l.push(i(e + s, t, a)), s++; - }, 1e3 / o); - setTimeout(function () { - if ((clearInterval(u), n)) n(l); - else - for (var e = 0, t = l; e < t.length; e++) { - var r = t[e]; - C.default.prototype.downloadFile( - r.imageData, - r.filename, - r.ext, - ); - } - l = []; - }, 0.01 + r); - }), - (C.default.prototype._makeFrame = function (e, t, r) { - var o, - r = this ? this._curElement.elt : r; - if (t) - switch (t.toLowerCase()) { - case "png": - o = "image/png"; - break; - case "jpeg": - case "jpg": - o = "image/jpeg"; - break; - default: - o = "image/png"; - } - else (t = "png"), (o = "image/png"); - var r = (r = r.toDataURL(o)).replace(o, "image/octet-stream"), - n = {}; - return (n.imageData = r), (n.filename = e), (n.ext = t), n; - }); - e = C.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.set": 189, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint32-array": 233, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - omggif: 248, - }, - ], - 298: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.copy-within"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint8-clamped-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.copy-within"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint8-clamped-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0), - e("regenerator-runtime/runtime"); - var O = n(e("../core/main")), - m = n(e("../core/helpers")), - j = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")), - g = n(e("omggif")), - P = e("gifenc"); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function n(e) { - return e && e.__esModule ? e : { default: e }; - } - function l(e, t, r, o, n, s, i) { - try { - var a = e[s](i), - l = a.value; - } catch (e) { - return void r(e); - } - a.done ? t(l) : Promise.resolve(l).then(o, n); - } - function y(e, t, r, o, n, s, i, a, l, u, c) { - var d, h, f, p, m, y, g, v, b; - return ( - e === j.COVER && - ((d = t), - (f = r), - (g = s), - (v = i), - (y = a), - (b = l), - (h = u), - (p = c), - (m = Math.max(g / h, v / p)), - (g /= m), - (v /= m), - (m = y), - (y = b), - d === j.CENTER - ? (m += (h - g) / 2) - : d === j.RIGHT && (m += h - g), - f === j.CENTER - ? (y += (p - v) / 2) - : f === j.BOTTOM && (y += p - v), - (a = (b = { x: m, y: y, w: g, h: v }).x), - (l = b.y), - (u = b.w), - (c = b.h)), - e === j.CONTAIN && - ((d = t), - (h = r), - (f = o), - (p = n), - (m = s), - (y = i), - (g = u), - (v = c), - (b = Math.max(g / m, v / y)), - (g /= b), - (v /= b), - (b = f), - (f = p), - d === j.CENTER - ? (b += (m - g) / 2) - : d === j.RIGHT && (b += m - g), - h === j.CENTER - ? (f += (y - v) / 2) - : h === j.BOTTOM && (f += y - v), - (o = (e = { x: b, y: f, w: g, h: v }).x), - (n = e.y), - (s = e.w), - (i = e.h)), - { sx: a, sy: l, sw: u, sh: c, dx: o, dy: n, dw: s, dh: i } - ); - } - function v(e, t) { - return 0 < e && e < t ? e : t; - } - e("../core/friendly_errors/validate_params"), - e("../core/friendly_errors/file_errors"), - e("../core/friendly_errors/fes_core"), - (O.default.prototype.loadImage = function (o, f, p) { - O.default._validateParameters("loadImage", arguments); - var m = new O.default.Image(1, 1, this), - y = this, - e = new Request(o, { method: "GET", mode: "cors" }); - return ( - fetch(o, e) - .then(function (e) { - var t, - r = e.headers.get("content-type"); - null === r && - console.warn( - "The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset.", - ), - r && r.includes("image/gif") - ? e.arrayBuffer().then( - function (e) { - if (e) { - for ( - var e = new Uint8Array(e), - r = m, - t = f, - o = p, - n = function (e) { - y._decrementPreload(); - }.bind(y), - s = new g.default.GifReader(e), - i = - ((r.width = r.canvas.width = s.width), - (r.height = r.canvas.height = s.height), - []), - a = s.numFrames(), - l = new Uint8ClampedArray( - r.width * r.height * 4, - ), - u = 0; - u < a; - u++ - ) { - var c = s.frameInfo(u), - d = r.drawingContext.getImageData( - 0, - 0, - r.width, - r.height, - ), - h = - ((l = d.data.slice()), - !(function (e, t) { - try { - t.decodeAndBlitFrameRGBA(e, l); - } catch (e) { - O.default._friendlyFileLoadError( - 8, - r.src, - ), - "function" == typeof o - ? o(e) - : console.error(e); - } - })(u, s), - new ImageData(l, r.width, r.height)), - h = - (r.drawingContext.putImageData(h, 0, 0), - c.delay); - 0 === h && (h = 10), - i.push({ - image: r.drawingContext.getImageData( - 0, - 0, - r.width, - r.height, - ), - delay: 10 * h, - }), - 2 === c.disposal - ? r.drawingContext.clearRect( - c.x, - c.y, - c.width, - c.height, - ) - : 3 === c.disposal && - r.drawingContext.putImageData( - d, - 0, - 0, - c.x, - c.y, - c.width, - c.height, - ); - } - null === (e = s.loopCount()) - ? (e = 1) - : 0 === e && (e = null), - r.drawingContext.putImageData( - i[0].image, - 0, - 0, - ), - 1 < i.length && - (r.gifProperties = { - displayIndex: 0, - loopLimit: e, - loopCount: 0, - frames: i, - numFrames: a, - playing: !0, - timeDisplayed: 0, - lastChangeTime: 0, - }), - "function" == typeof t && t(r), - n(); - } - }, - function (e) { - "function" == typeof p - ? (p(e), y._decrementPreload()) - : console.error(e); - }, - ) - : (((t = new Image()).onload = function () { - (m.width = m.canvas.width = t.width), - (m.height = m.canvas.height = t.height), - m.drawingContext.drawImage(t, 0, 0), - (m.modified = !0), - "function" == typeof f && f(m), - y._decrementPreload(); - }), - (t.onerror = function (e) { - O.default._friendlyFileLoadError(0, t.src), - "function" == typeof p - ? (p(e), y._decrementPreload()) - : console.error(e); - }), - 0 !== o.indexOf("data:image/") && - (t.crossOrigin = "Anonymous"), - (t.src = o)), - (m.modified = !0); - }) - .catch(function (e) { - O.default._friendlyFileLoadError(0, o), - "function" == typeof p - ? (p(e), y._decrementPreload()) - : console.error(e); - }), - m - ); - }), - (O.default.prototype.saveGif = (function () { - a = regeneratorRuntime.mark(function e(t, r) { - var o, - n, - s, - i, - a, - l, - u, - c, - d, - h, - f, - p, - m, - y, - g, - v, - b, - j, - _, - x, - w, - S, - T, - M, - E, - k, - C = arguments; - return regeneratorRuntime.wrap( - function (e) { - for (;;) - switch ((e.prev = e.next)) { - case 0: - if ( - ((o = - 2 < C.length && void 0 !== C[2] - ? C[2] - : { - delay: 0, - units: "seconds", - silent: !1, - notificationDuration: 0, - notificationID: "progressBar", - }), - "string" != typeof t) - ) - throw TypeError( - "fileName parameter must be a string", - ); - e.next = 3; - break; - case 3: - if ("number" != typeof r) - throw TypeError( - "Duration parameter must be a number", - ); - e.next = 5; - break; - case 5: - if ( - ((n = (o && o.delay) || 0), - (s = (o && o.units) || "seconds"), - (i = (o && o.silent) || !1), - (a = (o && o.notificationDuration) || 0), - (l = (o && o.notificationID) || "progressBar"), - "number" != typeof n) - ) - throw TypeError("Delay parameter must be a number"); - e.next = 12; - break; - case 12: - if ("seconds" !== s && "frames" !== s) - throw TypeError( - 'Units parameter must be either "frames" or "seconds"', - ); - e.next = 14; - break; - case 14: - if ("boolean" != typeof i) - throw TypeError( - "Silent parameter must be a boolean", - ); - e.next = 16; - break; - case 16: - if ("number" != typeof a) - throw TypeError( - "Notification duration parameter must be a number", - ); - e.next = 18; - break; - case 18: - if ("string" != typeof l) - throw TypeError( - "Notification ID parameter must be a string", - ); - e.next = 20; - break; - case 20: - return ( - (this._recording = !0), - (h = this._targetFrameRate), - (u = - (u = - (1 / - (h = - h !== 1 / 0 && void 0 !== h && 0 !== h - ? h - : 60)) * - 1e3) < 20 - ? 20 - : u), - (d = - (c = "seconds" === s ? r * h : r) + - (h = "seconds" === s ? n * h : n)), - (h = h), - (this.frameCount = h), - (f = this._pixelDensity), - this.pixelDensity(1), - (p = []), - null !== document.getElementById(l) && - document.getElementById(l).remove(), - i || - ((m = this.createP("")).id(l), - m.style("font-size", "16px"), - m.style("font-family", "Montserrat"), - m.style("background-color", "#ffffffa0"), - m.style("padding", "8px"), - m.style("border-radius", "10px"), - m.position(0, 0)), - this._renderer instanceof O.default.RendererGL && - ((g = this.drawingContext), - (y = new Uint8Array( - g.drawingBufferWidth * - g.drawingBufferHeight * - 4, - ))), - this.noLoop(), - (e.next = 39), - Promise.resolve() - ); - case 39: - if (h < d) - return ( - this.redraw(), - (M = void 0), - (M = - this._renderer instanceof O.default.RendererGL - ? ((y = new Uint8Array( - g.drawingBufferWidth * - g.drawingBufferHeight * - 4, - )), - g.readPixels( - 0, - 0, - g.drawingBufferWidth, - g.drawingBufferHeight, - g.RGBA, - g.UNSIGNED_BYTE, - y, - ), - (function (e) { - for ( - var t = parseInt(height / 2), - r = 4 * width, - o = new Uint8Array(4 * width), - n = 0; - n < t; - ++n - ) { - var s = n * r, - i = (height - n - 1) * r; - o.set(e.subarray(s, s + r)), - e.copyWithin(s, i, i + r), - e.set(o, i); - } - return e; - })(y)) - : this.drawingContext.getImageData( - 0, - 0, - this.width, - this.height, - ).data), - p.push(M), - h++, - i || - m.html( - "Saved frame " + - p.length.toString() + - " out of " + - c.toString(), - ), - (e.next = 48), - new Promise(function (e) { - return setTimeout(e, 0); - }) - ); - e.next = 50; - break; - case 48: - e.next = 39; - break; - case 50: - i || - m.html( - "Frames processed, generating color palette...", - ), - this.loop(), - this.pixelDensity(f), - (v = (0, P.GIFEncoder)()), - (b = (function (e) { - for ( - var t = new Uint8Array(e.length * e[0].length), - r = 0; - r < e.length; - r++ - ) - t.set(e[r], r * e[0].length); - var o = (0, P.quantize)(t, 256, { - format: "rgba4444", - oneBitAlpha: !0, - }); - 256 === o.length - ? (o[o.length - 1] = [ - 255 * Math.random(), - 255 * Math.random(), - 255 * Math.random(), - 0, - ]) - : o.push([ - 255 * Math.random(), - 255 * Math.random(), - 255 * Math.random(), - 0, - ]); - return o; - })(p)), - (j = {}), - (_ = function (e) { - for ( - var t = e.length / 4, - r = new Uint8Array(t), - o = 0; - o < t; - o++ - ) { - var n = - (e[4 * o] << 24) | - (e[4 * o + 1] << 16) | - (e[4 * o + 2] << 8) | - e[4 * o + 3]; - void 0 === j[n] && - (j[n] = (0, P.nearestColorIndex)( - b, - e.slice(4 * o, 4 * (o + 1)), - )), - (r[o] = j[n]); - } - return r; - }), - (x = b.length - 1), - (w = []), - (S = 0); - case 60: - if (!(S < p.length)) { - e.next = 71; - break; - } - if (((T = _(p[S])), (M = T.slice()), 0 === S)) - v.writeFrame(T, this.width, this.height, { - palette: b, - delay: u, - dispose: 1, - }); - else { - for (E = 0; E < T.length; E++) - T[E] === w[E] && (T[E] = x); - v.writeFrame(T, this.width, this.height, { - delay: u, - transparent: !0, - transparentIndex: x, - dispose: 1, - }); - } - return ( - (w = M), - i || - m.html( - "Rendered frame " + - S.toString() + - " out of " + - c.toString(), - ), - (e.next = 68), - new Promise(function (e) { - return setTimeout(e, 0); - }) - ); - case 68: - S++, (e.next = 60); - break; - case 71: - v.finish(), - (k = v.bytesView()), - (k = new Blob([k], { type: "image/gif" })), - (p = []), - (this._recording = !1), - this.loop(), - i || - (m.html("Done. Downloading your gif!🌸"), - 0 < a && - setTimeout(function () { - return m.remove(); - }, 1e3 * a)), - O.default.prototype.downloadFile(k, t, "gif"); - case 80: - case "end": - return e.stop(); - } - }, - e, - this, - ); - }); - var a, - r = function () { - var e = this, - i = arguments; - return new Promise(function (t, r) { - var o = a.apply(e, i); - function n(e) { - l(o, t, r, n, s, "next", e); - } - function s(e) { - l(o, t, r, n, s, "throw", e); - } - n(void 0); - }); - }; - return function (e, t) { - return r.apply(this, arguments); - }; - })()), - (O.default.prototype.image = function ( - e, - t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - d, - ) { - O.default._validateParameters("image", arguments); - var h = e.width, - f = e.height, - p = - ((d = d || j.CENTER), - (c = c || j.CENTER), - e.elt && - ((h = void 0 !== h ? h : e.elt.width), - (f = void 0 !== f ? f : e.elt.height)), - e.elt && - e.elt.videoWidth && - !e.canvas && - ((h = void 0 !== h ? h : e.elt.videoWidth), - (f = void 0 !== f ? f : e.elt.videoHeight)), - o || h), - n = n || f, - s = s || 0, - i = i || 0, - a = v(void 0 !== a ? a : h, h), - h = v(void 0 !== l ? l : f, f), - l = 1; - e.elt && - !e.canvas && - e.elt.style.width && - ((l = e.elt.videoWidth && !o ? e.elt.videoWidth : e.elt.width), - (l /= parseInt(e.elt.style.width, 10))), - (s *= l), - (i *= l), - (h *= l), - (a *= l); - f = y( - u, - c, - d, - (f = m.default.modeAdjust( - t, - r, - p, - n, - this._renderer._imageMode, - )).x, - f.y, - f.w, - f.h, - s, - i, - a, - h, - ); - this._renderer.image( - e, - f.sx, - f.sy, - f.sw, - f.sh, - f.dx, - f.dy, - f.dw, - f.dh, - ); - }), - (O.default.prototype.tint = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - O.default._validateParameters("tint", t); - var o = this.color.apply(this, t); - this._renderer._tint = o.levels; - }), - (O.default.prototype.noTint = function () { - this._renderer._tint = null; - }), - (O.default.prototype._getTintedImageCanvas = - O.default.Renderer2D.prototype._getTintedImageCanvas), - (O.default.prototype.imageMode = function (e) { - O.default._validateParameters("imageMode", arguments), - (e !== j.CORNER && e !== j.CORNERS && e !== j.CENTER) || - (this._renderer._imageMode = e); - }); - e = O.default; - r.default = e; - }, - { - "../core/constants": 264, - "../core/friendly_errors/fes_core": 266, - "../core/friendly_errors/file_errors": 267, - "../core/friendly_errors/validate_params": 270, - "../core/helpers": 271, - "../core/main": 275, - "core-js/modules/es.array.copy-within": 152, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.promise": 183, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/es.typed-array.uint8-clamped-array": 235, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - gifenc: 245, - omggif: 248, - "regenerator-runtime/runtime": 252, - }, - ], - 299: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = o(e("../core/main")), - n = o(e("./filters")); - function o(e) { - return e && e.__esModule ? e : { default: e }; - } - function i(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - s.default.Image = (function () { - function r(e, t) { - if (!(this instanceof r)) - throw new TypeError("Cannot call a class as a function"); - (this.width = e), - (this.height = t), - (this.canvas = document.createElement("canvas")), - (this.canvas.width = this.width), - (this.canvas.height = this.height), - (this.drawingContext = this.canvas.getContext("2d")), - ((this._pixelsState = this)._pixelDensity = 1), - (this.gifProperties = null), - (this._modified = !1), - (this.pixels = []); - } - var e, t, o; - return ( - (e = r), - (t = [ - { - key: "pixelDensity", - value: function (e) { - return void 0 !== e - ? (e <= 0 && - (s.default._friendlyParamError( - { - type: "INVALID_VALUE", - format: { types: ["Number"] }, - position: 1, - }, - "pixelDensity", - ), - (e = 1)), - (this._pixelDensity = e), - (this.width /= e), - (this.height /= e), - this) - : this._pixelDensity; - }, - }, - { - key: "_animateGif", - value: function (e) { - var t, - r = this.gifProperties, - e = e._lastRealFrameTime; - 0 === r.lastChangeTime && (r.lastChangeTime = e), - r.playing && - ((r.timeDisplayed = e - r.lastChangeTime), - (t = r.frames[r.displayIndex].delay), - r.timeDisplayed >= t && - ((t = Math.floor(r.timeDisplayed / t)), - (r.timeDisplayed = 0), - (r.lastChangeTime = e), - (r.displayIndex += t), - (r.loopCount = Math.floor( - r.displayIndex / r.numFrames, - )), - null !== r.loopLimit && r.loopCount >= r.loopLimit - ? (r.playing = !1) - : ((e = r.displayIndex % r.numFrames), - this.drawingContext.putImageData( - r.frames[e].image, - 0, - 0, - ), - (r.displayIndex = e), - this.setModified(!0)))); - }, - }, - { - key: "_setProperty", - value: function (e, t) { - (this[e] = t), this.setModified(!0); - }, - }, - { - key: "loadPixels", - value: function () { - s.default.Renderer2D.prototype.loadPixels.call(this), - this.setModified(!0); - }, - }, - { - key: "updatePixels", - value: function (e, t, r, o) { - s.default.Renderer2D.prototype.updatePixels.call( - this, - e, - t, - r, - o, - ), - this.setModified(!0); - }, - }, - { - key: "get", - value: function (e, t, r, o) { - return ( - s.default._validateParameters("p5.Image.get", arguments), - s.default.Renderer2D.prototype.get.apply(this, arguments) - ); - }, - }, - { - key: "_getPixel", - value: function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return s.default.Renderer2D.prototype._getPixel.apply( - this, - t, - ); - }, - }, - { - key: "set", - value: function (e, t, r) { - s.default.Renderer2D.prototype.set.call(this, e, t, r), - this.setModified(!0); - }, - }, - { - key: "resize", - value: 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 o = this.gifProperties, n = 0; - n < o.numFrames; - n++ - ) { - for ( - var s = this.drawingContext.createImageData(e, t), - i = - ((d = d = c = u = l = void 0), o.frames[n].image), - a = s, - l = 0, - u = 0; - u < a.height; - u++ - ) - for (var c = 0; c < a.width; c++) { - var d = Math.floor((c * i.width) / a.width), - d = - 4 * - (Math.floor((u * i.height) / a.height) * - i.width + - d); - (a.data[l++] = i.data[d++]), - (a.data[l++] = i.data[d++]), - (a.data[l++] = i.data[d++]), - (a.data[l++] = i.data[+d]); - } - o.frames[n].image = s; - } - r - .getContext("2d") - .drawImage( - this.canvas, - 0, - 0, - this.canvas.width, - this.canvas.height, - 0, - 0, - r.width, - r.height, - ), - (this.canvas.width = this.width = e), - (this.canvas.height = this.height = t), - this.drawingContext.drawImage(r, 0, 0, e, t, 0, 0, e, t), - 0 < this.pixels.length && this.loadPixels(), - this.setModified(!0); - }, - }, - { - key: "copy", - value: function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - s.default.prototype.copy.apply(this, t); - }, - }, - { - key: "mask", - value: function (e) { - var t = this.drawingContext.globalCompositeOperation, - r = 1, - o = [ - (e = void 0 === e ? this : e), - 0, - 0, - (r = - e instanceof s.default.Renderer - ? e._pInst._pixelDensity - : r) * e.width, - r * e.height, - 0, - 0, - this.width, - this.height, - ]; - if ( - ((this.drawingContext.globalCompositeOperation = - "destination-in"), - this.gifProperties) - ) { - for (var n = 0; n < this.gifProperties.frames.length; n++) - this.drawingContext.putImageData( - this.gifProperties.frames[n].image, - 0, - 0, - ), - this.copy.apply(this, o), - (this.gifProperties.frames[n].image = - this.drawingContext.getImageData( - 0, - 0, - this.width, - this.height, - )); - this.drawingContext.putImageData( - this.gifProperties.frames[ - this.gifProperties.displayIndex - ].image, - 0, - 0, - ); - } else this.copy.apply(this, o); - (this.drawingContext.globalCompositeOperation = t), - this.setModified(!0); - }, - }, - { - key: "filter", - value: function (e, t) { - n.default.apply(this.canvas, n.default[e], t), - this.setModified(!0); - }, - }, - { - key: "blend", - value: function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - s.default._validateParameters("p5.Image.blend", arguments), - s.default.prototype.blend.apply(this, t), - this.setModified(!0); - }, - }, - { - key: "setModified", - value: function (e) { - this._modified = e; - }, - }, - { - key: "isModified", - value: function () { - return this._modified; - }, - }, - { - key: "save", - value: function (e, t) { - this.gifProperties - ? s.default.prototype.encodeAndDownloadGif(this, e) - : s.default.prototype.saveCanvas(this.canvas, e, t); - }, - }, - { - key: "reset", - value: function () { - var e; - this.gifProperties && - (((e = this.gifProperties).playing = !0), - (e.timeSinceStart = 0), - (e.timeDisplayed = 0), - (e.lastChangeTime = 0), - (e.loopCount = 0), - (e.displayIndex = 0), - this.drawingContext.putImageData( - e.frames[0].image, - 0, - 0, - )); - }, - }, - { - key: "getCurrentFrame", - value: function () { - var e; - if (this.gifProperties) - return ( - (e = this.gifProperties).displayIndex % e.numFrames - ); - }, - }, - { - key: "setFrame", - value: function (e) { - var t; - this.gifProperties && - (e < (t = this.gifProperties).numFrames && 0 <= e - ? ((t.timeDisplayed = 0), - (t.lastChangeTime = 0), - (t.displayIndex = e), - this.drawingContext.putImageData( - t.frames[e].image, - 0, - 0, - )) - : console.log( - "Cannot set GIF to a frame number that is higher than total number of frames or below zero.", - )); - }, - }, - { - key: "numFrames", - value: function () { - if (this.gifProperties) return this.gifProperties.numFrames; - }, - }, - { - key: "play", - value: function () { - this.gifProperties && (this.gifProperties.playing = !0); - }, - }, - { - key: "pause", - value: function () { - this.gifProperties && (this.gifProperties.playing = !1); - }, - }, - { - key: "delay", - value: function (e, t) { - if (this.gifProperties) { - var r = this.gifProperties; - if (t < r.numFrames && 0 <= t) r.frames[t].delay = e; - else { - var o = !0, - t = !1, - n = void 0; - try { - for ( - var s, i = r.frames[Symbol.iterator](); - !(o = (s = i.next()).done); - o = !0 - ) - s.value.delay = e; - } catch (e) { - (t = !0), (n = e); - } finally { - try { - o || null == i.return || i.return(); - } finally { - if (t) throw n; - } - } - } - } - }, - }, - ]) && i(e.prototype, t), - o && i(e, o), - r - ); - })(); - e = s.default.Image; - r.default = e; - }, - { - "../core/main": 275, - "./filters": 296, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 300: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.filter"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var f = o(e("../core/main")), - a = o(e("./filters")); - function o(e) { - return e && e.__esModule ? e : { default: e }; - } - e("../color/p5.Color"), - (f.default.prototype.pixels = []), - (f.default.prototype.blend = function () { - for ( - var e, t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - f.default._validateParameters("blend", r), - this._renderer - ? (e = this._renderer).blend.apply(e, r) - : f.default.Renderer2D.prototype.blend.apply(this, r); - }), - (f.default.prototype.copy = function () { - for ( - var e, - t, - r, - o, - n, - s, - i, - a, - l, - u = arguments.length, - c = new Array(u), - d = 0; - d < u; - d++ - ) - c[d] = arguments[d]; - if ((f.default._validateParameters("copy", c), 9 === c.length)) - (e = c[0]), - (t = c[1]), - (r = c[2]), - (o = c[3]), - (n = c[4]), - (s = c[5]), - (i = c[6]), - (a = c[7]), - (l = c[8]); - else { - if (8 !== c.length) throw new Error("Signature not supported"); - (e = this), - (t = c[0]), - (r = c[1]), - (o = c[2]), - (n = c[3]), - (s = c[4]), - (i = c[5]), - (a = c[6]), - (l = c[7]); - } - f.default.prototype._copyHelper(this, e, t, r, o, n, s, i, a, l); - }), - (f.default.prototype._copyHelper = function ( - e, - t, - r, - o, - n, - s, - i, - a, - l, - u, - ) { - var c = t.canvas.width / t.width, - d = 0, - h = 0; - t._renderer && - t._renderer.isP3D && - ((d = t.width / 2), (h = t.height / 2)), - e._renderer && e._renderer.isP3D - ? f.default.RendererGL.prototype.image.call( - e._renderer, - t, - r + d, - o + h, - n, - s, - i, - a, - l, - u, - ) - : e.drawingContext.drawImage( - t.canvas, - c * (r + d), - c * (o + h), - c * n, - c * s, - i, - a, - l, - u, - ); - }), - (f.default.prototype.getFilterGraphicsLayer = function () { - return this._renderer.getFilterGraphicsLayer(); - }), - (f.default.prototype.filter = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - f.default._validateParameters("filter", arguments); - var o = function () { - var e, - t = { - shader: void 0, - operation: void 0, - value: void 0, - useWebGL: !0, - }; - return ( - (arguments.length <= 0 ? void 0 : arguments[0]) instanceof - f.default.Shader - ? (t.shader = - arguments.length <= 0 ? void 0 : arguments[0]) - : ((t.operation = - arguments.length <= 0 ? void 0 : arguments[0]), - 1 < arguments.length && - "number" == - typeof (arguments.length <= 1 - ? void 0 - : arguments[1]) && - (t.value = - arguments.length <= 1 ? void 0 : arguments[1]), - !1 === - ((e = arguments.length - 1) < 0 || - arguments.length <= e - ? void 0 - : arguments[e]) && (t.useWebGL = !1)), - t - ); - }.apply(void 0, t), - n = o.shader, - s = o.operation, - i = o.value, - o = o.useWebGL; - this._renderer.isP3D && n - ? f.default.RendererGL.prototype.filter.call(this._renderer, n) - : o || this._renderer.isP3D - ? (!o && - this._renderer.isP3D && - console.warn( - "filter() with useWebGL=false is not supported in WEBGL", - ), - this._renderer.isP3D - ? f.default.RendererGL.prototype.filter.call( - this._renderer, - s, - i, - ) - : ((n = this.getFilterGraphicsLayer()).copy( - this._renderer, - 0, - 0, - this.width, - this.height, - -this.width / 2, - -this.height / 2, - this.width, - this.height, - ), - this._renderer.clear(), - this._renderer.resetMatrix(), - n.filter.apply(n, t), - this._renderer._pInst.image(n, 0, 0), - n.clear())) - : void 0 !== this.canvas - ? a.default.apply(this.canvas, a.default[s], i) - : a.default.apply(this.elt, a.default[s], i); - }), - (f.default.prototype.get = function (e, t, r, o) { - var n; - return ( - f.default._validateParameters("get", arguments), - (n = this._renderer).get.apply(n, arguments) - ); - }), - (f.default.prototype.loadPixels = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - f.default._validateParameters("loadPixels", t), - this._renderer.loadPixels(); - }), - (f.default.prototype.set = function (e, t, r) { - this._renderer.set(e, t, r); - }), - (f.default.prototype.updatePixels = function (e, t, r, o) { - f.default._validateParameters("updatePixels", arguments), - 0 !== this.pixels.length && - this._renderer.updatePixels(e, t, r, o); - }); - e = f.default; - r.default = e; - }, - { - "../color/p5.Color": 262, - "../core/main": 275, - "./filters": 296, - "core-js/modules/es.array.filter": 155, - }, - ], - 301: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.last-index-of"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.object.from-entries"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/web.url"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.last-index-of"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.object.from-entries"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.promise"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/web.url"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var v = s(e("../core/main")), - m = (e("whatwg-fetch"), e("es6-promise/auto"), s(e("fetch-jsonp"))), - n = s(e("file-saver")); - function s(e) { - return e && e.__esModule ? e : { default: e }; - } - function y(e) { - return (y = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - function g(e) { - return e - .replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); - } - function i(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"), - (v.default.prototype.loadJSON = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - v.default._validateParameters("loadJSON", t); - for ( - var o, n, s, i = t[0], a = {}, l = "json", u = 1; - u < t.length; - u++ - ) { - var c = t[u]; - "string" == typeof c - ? ("jsonp" !== c && "json" !== c) || (l = c) - : "function" == typeof c - ? o - ? (n = c) - : (o = c) - : "object" === y(c) && - (c.hasOwnProperty("jsonpCallback") || - c.hasOwnProperty("jsonpCallbackFunction")) && - ((l = "jsonp"), (s = c)); - } - var d = this; - return ( - this.httpDo( - i, - "GET", - s, - l, - function (e) { - for (var t in e) a[t] = e[t]; - void 0 !== o && o(e), d._decrementPreload(); - }, - function (e) { - if ((v.default._friendlyFileLoadError(5, i), !n)) throw e; - n(e); - }, - ), - a - ); - }), - (v.default.prototype.loadStrings = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - v.default._validateParameters("loadStrings", t); - for (var n, o, s = [], i = 1; i < t.length; i++) { - var a = t[i]; - "function" == typeof a && - (void 0 === n ? (n = a) : void 0 === o && (o = a)); - } - var l = this; - return ( - v.default.prototype.httpDo.call( - this, - t[0], - "GET", - "text", - function (e) { - for ( - var t = e - .replace(/\r\n/g, "\r") - .replace(/\n/g, "\r") - .split(/\r/), - r = 0, - o = t.length; - r < o; - r += 32768 - ) - Array.prototype.push.apply( - s, - t.slice(r, Math.min(r + 32768, o)), - ); - void 0 !== n && n(s), l._decrementPreload(); - }, - function (e) { - if ((v.default._friendlyFileLoadError(3, e), !o)) throw e; - o(e); - }, - ), - s - ); - }), - (v.default.prototype.loadTable = function (t) { - var f, - r, - p, - e = [], - m = !1, - o = t.substring(t.lastIndexOf(".") + 1, t.length); - "csv" === o - ? (p = ",") - : "ssv" === o - ? (p = ";") - : "tsv" === o && (p = "\t"); - for (var n = 1; n < arguments.length; n++) - "function" == typeof arguments[n] - ? void 0 === f - ? (f = arguments[n]) - : void 0 === r && (r = arguments[n]) - : "string" == typeof arguments[n] && - (e.push(arguments[n]), - "header" === arguments[n] && (m = !0), - "csv" === arguments[n] - ? (p = ",") - : "ssv" === arguments[n] - ? (p = ";") - : "tsv" === arguments[n] && (p = "\t")); - var y = new v.default.Table(), - g = this; - return ( - this.httpDo( - t, - "GET", - "table", - function (e) { - for ( - var t, - r, - o = {}, - n = 0, - s = [], - i = 0, - a = null, - l = function () { - (o.currentState = n), (o.token = ""); - }, - u = function () { - a.push(o.token), l(); - }, - c = function () { - (o.currentState = 4), s.push(a), (a = null); - }; - ; - - ) { - if (null == (t = e[i++])) { - if (o.escaped) - throw new Error("Unclosed quote in file."); - if (a) { - u(), c(); - break; - } - } - if ( - (null === a && ((o.escaped = !1), (a = []), l()), - o.currentState === n) - ) { - if ('"' === t) { - (o.escaped = !0), (o.currentState = 1); - continue; - } - o.currentState = 1; - } - if (1 === o.currentState && o.escaped) - if ('"' === t) - '"' === e[i] - ? ((o.token += '"'), i++) - : ((o.escaped = !1), (o.currentState = 2)); - else { - if ("\r" === t) continue; - o.token += t; - } - else - "\r" === t - ? ("\n" === e[i] && i++, u(), c()) - : "\n" === t - ? (u(), c()) - : t === p - ? u() - : 1 === o.currentState && (o.token += t); - } - if (m) y.columns = s.shift(); - else - for (var d = 0; d < s[0].length; d++) - y.columns[d] = "null"; - for (var h = 0; h < s.length; h++) - (1 !== s[h].length || - ("undefined" !== s[h][0] && "" !== s[h][0])) && - (((r = new v.default.TableRow()).arr = s[h]), - (r.obj = (function (r, e) { - if (void 0 === (e = e || [])) - for (var t = 0; t < r.length; t++) - e[t.toString()] = t; - return Object.fromEntries( - e.map(function (e, t) { - return [e, r[t]]; - }), - ); - })(s[h], y.columns)), - y.addRow(r)); - "function" == typeof f && f(y), g._decrementPreload(); - }, - function (e) { - v.default._friendlyFileLoadError(2, t), - r ? r(e) : console.error(e); - }, - ), - y - ); - }), - (v.default.prototype.loadXML = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - for ( - var o, n, s = new v.default.XML(), i = 1; - i < t.length; - i++ - ) { - var a = t[i]; - "function" == typeof a && - (void 0 === o ? (o = a) : void 0 === n && (n = a)); - } - var l = this; - return ( - this.httpDo( - t[0], - "GET", - "xml", - function (e) { - for (var t in e) s[t] = e[t]; - void 0 !== o && o(s), l._decrementPreload(); - }, - function (e) { - if ((v.default._friendlyFileLoadError(1, e), !n)) throw e; - n(e); - }, - ), - s - ); - }), - (v.default.prototype.loadBytes = function (t, r, o) { - var n = {}, - s = this; - return ( - this.httpDo( - t, - "GET", - "arrayBuffer", - function (e) { - (n.bytes = new Uint8Array(e)), - "function" == typeof r && r(n), - s._decrementPreload(); - }, - function (e) { - if ((v.default._friendlyFileLoadError(6, t), !o)) throw e; - o(e); - }, - ), - n - ); - }), - (v.default.prototype.httpGet = function () { - v.default._validateParameters("httpGet", arguments); - var e = Array.prototype.slice.call(arguments); - return ( - e.splice(1, 0, "GET"), v.default.prototype.httpDo.apply(this, e) - ); - }), - (v.default.prototype.httpPost = function () { - v.default._validateParameters("httpPost", arguments); - var e = Array.prototype.slice.call(arguments); - return ( - e.splice(1, 0, "POST"), - v.default.prototype.httpDo.apply(this, e) - ); - }), - (v.default.prototype.httpDo = function () { - for ( - var r, - e, - t, - o = {}, - n = 0, - s = "text/plain", - i = arguments.length - 1; - 0 < i && - "function" == - typeof (i < 0 || arguments.length <= i - ? void 0 - : arguments[i]); - i-- - ) - n++; - var a = arguments.length - n, - l = arguments.length <= 0 ? void 0 : arguments[0]; - if ( - 2 == a && - "string" == typeof l && - "object" === y(arguments.length <= 1 ? void 0 : arguments[1]) - ) - (p = new Request( - l, - arguments.length <= 1 ? void 0 : arguments[1], - )), - (e = arguments.length <= 2 ? void 0 : arguments[2]), - (t = arguments.length <= 3 ? void 0 : arguments[3]); - else { - for (var u, c = "GET", d = 1; d < arguments.length; d++) { - var h = - d < 0 || arguments.length <= d ? void 0 : arguments[d]; - if ("string" == typeof h) - "GET" === h || "POST" === h || "PUT" === h || "DELETE" === h - ? (c = h) - : "json" === h || - "jsonp" === h || - "binary" === h || - "arrayBuffer" === h || - "xml" === h || - "text" === h || - "table" === h - ? (r = h) - : (u = h); - else if ("number" == typeof h) u = h.toString(); - else if ("object" === y(h)) - if ( - h.hasOwnProperty("jsonpCallback") || - h.hasOwnProperty("jsonpCallbackFunction") - ) - for (var f in h) o[f] = h[f]; - else - s = - h instanceof v.default.XML - ? ((u = h.serialize()), "application/xml") - : ((u = JSON.stringify(h)), "application/json"); - else "function" == typeof h && (e ? (t = h) : (e = h)); - } - var a = - "GET" === c - ? new Headers() - : new Headers({ "Content-Type": s }), - p = new Request(l, { - method: c, - mode: "cors", - body: u, - headers: a, - }); - } - return ( - (a = (a = - "jsonp" === - (r = - r || - (l.includes("json") - ? "json" - : l.includes("xml") - ? "xml" - : "text")) - ? (0, m.default)(l, o) - : fetch(p)).then(function (e) { - if (!e.ok) - throw ( - (((t = new Error(e.body)).status = e.status), - (t.ok = !1), - t) - ); - var t = 0; - switch ( - ((t = - "jsonp" !== r ? e.headers.get("content-length") : t) && - 64e6 < t && - v.default._friendlyFileLoadError(7, l), - r) - ) { - case "json": - case "jsonp": - return e.json(); - case "binary": - return e.blob(); - case "arrayBuffer": - return e.arrayBuffer(); - case "xml": - return e.text().then(function (e) { - e = new DOMParser().parseFromString(e, "text/xml"); - return new v.default.XML(e.documentElement); - }); - default: - return e.text(); - } - })).then(e || function () {}), - a.catch(t || console.error), - a - ); - }), - (window.URL = window.URL || window.webkitURL), - (v.default.prototype._pWriters = []), - (v.default.prototype.createWriter = function (e, t) { - var r, o; - for (o in v.default.prototype._pWriters) - if (v.default.prototype._pWriters[o].name === e) - return ( - (r = new v.default.PrintWriter(e + this.millis(), t)), - v.default.prototype._pWriters.push(r), - r - ); - return ( - (r = new v.default.PrintWriter(e, t)), - v.default.prototype._pWriters.push(r), - r - ); - }), - (v.default.PrintWriter = function (r, o) { - var n = this; - (this.name = r), - (this.content = ""), - (this.write = function (e) { - this.content += e; - }), - (this.print = function (e) { - this.content += "".concat(e, "\n"); - }), - (this.clear = function () { - this.content = ""; - }), - (this.close = function () { - var e, - t = []; - for (e in (t.push(this.content), - v.default.prototype.writeFile(t, r, o), - v.default.prototype._pWriters)) - v.default.prototype._pWriters[e].name === this.name && - v.default.prototype._pWriters.splice(e, 1); - n.clear(), (n = {}); - }); - }), - (v.default.prototype.save = function (e, t, r) { - var o = arguments, - n = (this._curElement || this).elt; - if (0 === o.length) v.default.prototype.saveCanvas(n); - else if ( - o[0] instanceof v.default.Renderer || - o[0] instanceof v.default.Graphics - ) - v.default.prototype.saveCanvas(o[0].elt, o[1], o[2]); - else if (1 === o.length && "string" == typeof o[0]) - v.default.prototype.saveCanvas(n, o[0]); - else - switch (i(o[1], o[2])[1]) { - case "json": - return void v.default.prototype.saveJSON(o[0], o[1], o[2]); - case "txt": - return void v.default.prototype.saveStrings( - o[0], - o[1], - o[2], - ); - default: - o[0] instanceof Array - ? v.default.prototype.saveStrings(o[0], o[1], o[2]) - : o[0] instanceof v.default.Table - ? v.default.prototype.saveTable(o[0], o[1], o[2]) - : o[0] instanceof v.default.Image - ? v.default.prototype.saveCanvas(o[0].canvas, o[1]) - : o[0] instanceof v.default.SoundFile && - v.default.prototype.saveSound( - o[0], - o[1], - o[2], - o[3], - ); - } - }), - (v.default.prototype.saveJSON = function (e, t, r) { - v.default._validateParameters("saveJSON", arguments), - (r = r ? JSON.stringify(e) : JSON.stringify(e, void 0, 2)), - this.saveStrings(r.split("\n"), t, "json"); - }), - (v.default.prototype.saveJSONObject = v.default.prototype.saveJSON), - (v.default.prototype.saveJSONArray = v.default.prototype.saveJSON), - (v.default.prototype.saveStrings = function (e, t, r, o) { - v.default._validateParameters("saveStrings", arguments); - for ( - var n = this.createWriter(t, r || "txt"), s = 0; - s < e.length; - s++ - ) - o ? n.write(e[s] + "\r\n") : n.write(e[s] + "\n"); - n.close(), n.clear(); - }), - (v.default.prototype.saveTable = function (e, t, r) { - v.default._validateParameters("saveTable", arguments), - (o = - void 0 === r - ? t.substring(t.lastIndexOf(".") + 1, t.length) - : r); - var o, - n = this.createWriter(t, o), - s = e.columns, - i = "tsv" === o ? "\t" : ","; - if ("html" !== o) { - if ("0" !== s[0]) { - for (var a = 0; a < s.length; a++) - a < s.length - 1 ? n.write(s[a] + i) : n.write(s[a]); - n.write("\n"); - } - for (var l = 0; l < e.rows.length; l++) { - for (var u = void 0, u = 0; u < e.rows[l].arr.length; u++) - u < e.rows[l].arr.length - 1 - ? "csv" === o && String(e.rows[l].arr[u]).includes(",") - ? n.write('"' + e.rows[l].arr[u] + '"' + i) - : n.write(e.rows[l].arr[u] + i) - : "csv" === o && String(e.rows[l].arr[u]).includes(",") - ? n.write('"' + e.rows[l].arr[u] + '"') - : n.write(e.rows[l].arr[u]); - n.write("\n"); - } - } else { - n.print(""), n.print(""); - if ( - (n.print( - ' ', - ), - n.print(""), - n.print(""), - n.print(" "), - "0" !== s[0]) - ) { - n.print(" "); - for (var c = 0; c < s.length; c++) { - var d = g(s[c]); - n.print(" "); - } - n.print(" "); - } - for (var h = 0; h < e.rows.length; h++) { - n.print(" "); - for (var f = 0; f < e.columns.length; f++) { - var p = g(e.rows[h].getString(f)); - n.print(" "); - } - n.print(" "); - } - n.print("
                                      ".concat(d)), n.print("
                                      ".concat(p)), n.print("
                                      "), n.print(""), n.print(""); - } - n.close(), n.clear(); - }), - (v.default.prototype.writeFile = function (e, t, r) { - var o = "application/octet-stream", - e = - (v.default.prototype._isSafari() && (o = "text/plain"), - new Blob(e, { type: o })); - v.default.prototype.downloadFile(e, t, r); - }), - (v.default.prototype.downloadFile = function (e, t, r) { - var o, - t = i(t, r), - r = t[0]; - e instanceof Blob - ? n.default.saveAs(e, r) - : (((o = document.createElement("a")).href = e), - (o.download = r), - (o.onclick = function (e) { - document.body.removeChild(e.target), e.stopPropagation(); - }), - (o.style.display = "none"), - document.body.appendChild(o), - v.default.prototype._isSafari() && - ((e = - (e = - 'Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n') + - '3. Name it with this extension: ."'.concat(t[1], '"')), - alert(e)), - o.click()); - }), - (v.default.prototype._checkFileExtension = i), - (v.default.prototype._isSafari = function () { - return ( - 0 < - Object.prototype.toString - .call(window.HTMLElement) - .indexOf("Constructor") - ); - }); - e = v.default; - r.default = e; - }, - { - "../core/friendly_errors/fes_core": 266, - "../core/friendly_errors/file_errors": 267, - "../core/friendly_errors/validate_params": 270, - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.last-index-of": 163, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.object.from-entries": 177, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.promise": 183, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/web.dom-collections.iterator": 238, - "core-js/modules/web.url": 240, - "es6-promise/auto": 241, - "fetch-jsonp": 243, - "file-saver": 244, - "whatwg-fetch": 253, - }, - ], - 302: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.replace"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - n.default.Table = (function () { - function t(e) { - if (!(this instanceof t)) - throw new TypeError("Cannot call a class as a function"); - (this.columns = []), (this.rows = []); - } - var e, r, o; - return ( - (e = t), - (r = [ - { - key: "addRow", - value: function (e) { - e = e || new n.default.TableRow(); - if (void 0 === e.arr || void 0 === e.obj) - throw new Error("invalid TableRow: ".concat(e)); - return (e.table = this).rows.push(e), e; - }, - }, - { - key: "removeRow", - value: function (e) { - this.rows[e].table = null; - e = this.rows.splice(e + 1, this.rows.length); - this.rows.pop(), (this.rows = this.rows.concat(e)); - }, - }, - { - key: "getRow", - value: function (e) { - return this.rows[e]; - }, - }, - { - key: "getRows", - value: function () { - return this.rows; - }, - }, - { - key: "findRow", - value: function (e, t) { - if ("string" == typeof t) { - for (var r = 0; r < this.rows.length; r++) - if (this.rows[r].obj[t] === e) return this.rows[r]; - } else - for (var o = 0; o < this.rows.length; o++) - if (this.rows[o].arr[t] === e) return this.rows[o]; - return null; - }, - }, - { - key: "findRows", - value: function (e, t) { - var r = []; - if ("string" == typeof t) - for (var o = 0; o < this.rows.length; o++) - this.rows[o].obj[t] === e && r.push(this.rows[o]); - else - for (var n = 0; n < this.rows.length; n++) - this.rows[n].arr[t] === e && r.push(this.rows[n]); - return r; - }, - }, - { - key: "matchRow", - value: function (e, t) { - if ("number" == typeof t) { - for (var r = 0; r < this.rows.length; r++) - if (this.rows[r].arr[t].match(e)) return this.rows[r]; - } else - for (var o = 0; o < this.rows.length; o++) - if (this.rows[o].obj[t].match(e)) return this.rows[o]; - return null; - }, - }, - { - key: "matchRows", - value: function (e, t) { - var r = []; - if ("number" == typeof t) - for (var o = 0; o < this.rows.length; o++) - this.rows[o].arr[t].match(e) && r.push(this.rows[o]); - else - for (var n = 0; n < this.rows.length; n++) - this.rows[n].obj[t].match(e) && r.push(this.rows[n]); - return r; - }, - }, - { - key: "getColumn", - value: function (e) { - var t = []; - if ("string" == typeof e) - for (var r = 0; r < this.rows.length; r++) - t.push(this.rows[r].obj[e]); - else - for (var o = 0; o < this.rows.length; o++) - t.push(this.rows[o].arr[e]); - return t; - }, - }, - { - key: "clearRows", - value: function () { - delete this.rows, (this.rows = []); - }, - }, - { - key: "addColumn", - value: function (e) { - this.columns.push(e || null); - }, - }, - { - key: "getColumnCount", - value: function () { - return this.columns.length; - }, - }, - { - key: "getRowCount", - value: function () { - return this.rows.length; - }, - }, - { - key: "removeTokens", - value: function (e, t) { - for (var r = [], o = 0; o < e.length; o++) - r.push( - e.charAt(o).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), - ); - var n = new RegExp(r.join("|"), "g"); - if (void 0 === t) - for (var s = 0; s < this.columns.length; s++) - for (var i = 0; i < this.rows.length; i++) { - var a = (a = this.rows[i].arr[s]).replace(n, ""); - (this.rows[i].arr[s] = a), - (this.rows[i].obj[this.columns[s]] = a); - } - else if ("string" == typeof t) - for (var l = 0; l < this.rows.length; l++) { - var u = (u = this.rows[l].obj[t]).replace(n, ""), - c = - ((this.rows[l].obj[t] = u), - this.columns.indexOf(t)); - this.rows[l].arr[c] = u; - } - else - for (var d = 0; d < this.rows.length; d++) { - var h = (h = this.rows[d].arr[t]).replace(n, ""); - (this.rows[d].arr[t] = h), - (this.rows[d].obj[this.columns[t]] = h); - } - }, - }, - { - key: "trim", - value: function (e) { - var t = new RegExp(" ", "g"); - if (void 0 === e) - for (var r = 0; r < this.columns.length; r++) - for (var o = 0; o < this.rows.length; o++) { - var n = (n = this.rows[o].arr[r]).replace(t, ""); - (this.rows[o].arr[r] = n), - (this.rows[o].obj[this.columns[r]] = n); - } - else if ("string" == typeof e) - for (var s = 0; s < this.rows.length; s++) { - var i = (i = this.rows[s].obj[e]).replace(t, ""), - a = - ((this.rows[s].obj[e] = i), - this.columns.indexOf(e)); - this.rows[s].arr[a] = i; - } - else - for (var l = 0; l < this.rows.length; l++) { - var u = (u = this.rows[l].arr[e]).replace(t, ""); - (this.rows[l].arr[e] = u), - (this.rows[l].obj[this.columns[e]] = u); - } - }, - }, - { - key: "removeColumn", - value: function (e) { - "string" == typeof e - ? (r = this.columns.indexOf((t = e))) - : (t = this.columns[(r = e)]); - var t, - r, - e = this.columns.splice(r + 1, this.columns.length); - this.columns.pop(), (this.columns = this.columns.concat(e)); - for (var o = 0; o < this.rows.length; o++) { - var n = this.rows[o].arr, - s = n.splice(r + 1, n.length); - n.pop(), - (this.rows[o].arr = n.concat(s)), - delete this.rows[o].obj[t]; - } - }, - }, - { - key: "set", - value: function (e, t, r) { - this.rows[e].set(t, r); - }, - }, - { - key: "setNum", - value: function (e, t, r) { - this.rows[e].setNum(t, r); - }, - }, - { - key: "setString", - value: function (e, t, r) { - this.rows[e].setString(t, r); - }, - }, - { - key: "get", - value: function (e, t) { - return this.rows[e].get(t); - }, - }, - { - key: "getNum", - value: function (e, t) { - return this.rows[e].getNum(t); - }, - }, - { - key: "getString", - value: function (e, t) { - return this.rows[e].getString(t); - }, - }, - { - key: "getObject", - value: function (e) { - for (var t, r = {}, o = 0; o < this.rows.length; o++) - if (((t = this.rows[o].obj), "string" == typeof e)) { - if (!(0 <= this.columns.indexOf(e))) - throw new Error( - 'This table has no column named "'.concat(e, '"'), - ); - r[t[e]] = t; - } else r[o] = this.rows[o].obj; - return r; - }, - }, - { - key: "getArray", - value: function () { - for (var e = [], t = 0; t < this.rows.length; t++) - e.push(this.rows[t].arr); - return e; - }, - }, - ]) && s(e.prototype, r), - o && s(e, o), - t - ); - })(); - e = n.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.regexp.constructor": 186, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.match": 193, - "core-js/modules/es.string.replace": 196, - }, - ], - 303: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.from-entries"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.split"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.from-entries"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.split"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - e.default.TableRow = (function () { - function o(e, t) { - if (!(this instanceof o)) - throw new TypeError("Cannot call a class as a function"); - var r = []; - e && (r = e.split((t = t || ","))), - (this.arr = r), - (this.obj = Object.fromEntries(r.entries())), - (this.table = null); - } - var e, t, r; - return ( - (e = o), - (t = [ - { - key: "set", - value: function (e, t) { - if ("string" == typeof e) { - var r = this.table.columns.indexOf(e); - if (!(0 <= r)) - throw new Error( - 'This table has no column named "'.concat(e, '"'), - ); - (this.obj[e] = t), (this.arr[r] = t); - } else { - if (!(e < this.table.columns.length)) - throw new Error( - "Column #".concat( - e, - " is out of the range of this table", - ), - ); - this.arr[e] = t; - r = this.table.columns[e]; - this.obj[r] = t; - } - }, - }, - { - key: "setNum", - value: function (e, t) { - t = parseFloat(t); - this.set(e, t); - }, - }, - { - key: "setString", - value: function (e, t) { - t = t.toString(); - this.set(e, t); - }, - }, - { - key: "get", - value: function (e) { - return ("string" == typeof e ? this.obj : this.arr)[e]; - }, - }, - { - key: "getNum", - value: function (e) { - var t = - "string" == typeof e - ? parseFloat(this.obj[e]) - : parseFloat(this.arr[e]); - if ("NaN" === t.toString()) - throw "Error: ".concat( - this.obj[e], - " is NaN (Not a Number)", - ); - return t; - }, - }, - { - key: "getString", - value: function (e) { - return ("string" == typeof e ? this.obj : this.arr)[ - e - ].toString(); - }, - }, - ]) && n(e.prototype, t), - r && n(e, r), - o - ); - })(); - e = e.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.from-entries": 177, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.split": 198, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 304: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var a = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function s(e) { - for (var t = [], r = 0; r < e.length; r++) - t.push(new a.default.XML(e[r])); - return t; - } - a.default.XML = (function () { - function t(e) { - if (!(this instanceof t)) - throw new TypeError("Cannot call a class as a function"); - e - ? (this.DOM = e) - : ((e = document.implementation.createDocument(null, "doc")), - (this.DOM = e.createElement("root"))); - } - var e, r, o; - return ( - (e = t), - (r = [ - { - key: "getParent", - value: function () { - return new a.default.XML(this.DOM.parentElement); - }, - }, - { - key: "getName", - value: function () { - return this.DOM.tagName; - }, - }, - { - key: "setName", - value: function (e) { - var t = this.DOM.innerHTML, - r = this.DOM.attributes, - o = document.implementation - .createDocument(null, "default") - .createElement(e); - o.innerHTML = t; - for (var n = 0; n < r.length; n++) - o.setAttribute(r[n].nodeName, r.nodeValue); - this.DOM = o; - }, - }, - { - key: "hasChildren", - value: function () { - return 0 < this.DOM.children.length; - }, - }, - { - key: "listChildren", - value: function () { - for (var e = [], t = 0; t < this.DOM.childNodes.length; t++) - e.push(this.DOM.childNodes[t].nodeName); - return e; - }, - }, - { - key: "getChildren", - value: function (e) { - return s( - e ? this.DOM.getElementsByTagName(e) : this.DOM.children, - ); - }, - }, - { - key: "getChild", - value: function (e) { - if ("string" != typeof e) - return new a.default.XML(this.DOM.children[e]); - var t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = this.DOM.children[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - if (i.tagName === e) return new a.default.XML(i); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - }, - }, - { - key: "addChild", - value: function (e) { - e instanceof a.default.XML && this.DOM.appendChild(e.DOM); - }, - }, - { - key: "removeChild", - value: function (e) { - var t = -1; - if ("string" == typeof e) { - for (var r = 0; r < this.DOM.children.length; r++) - if (this.DOM.children[r].tagName === e) { - t = r; - break; - } - } else t = e; - -1 !== t && this.DOM.removeChild(this.DOM.children[t]); - }, - }, - { - key: "getAttributeCount", - value: function () { - return this.DOM.attributes.length; - }, - }, - { - key: "listAttributes", - value: function () { - var e = [], - t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = this.DOM.attributes[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - e.push(i.nodeName); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - return e; - }, - }, - { - key: "hasAttribute", - value: function (e) { - var t = {}, - r = !0, - o = !1, - n = void 0; - try { - for ( - var s, i = this.DOM.attributes[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) { - var a = s.value; - t[a.nodeName] = a.nodeValue; - } - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - return !!t[e]; - }, - }, - { - key: "getNum", - value: function (e, t) { - var r = {}, - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = this.DOM.attributes[Symbol.iterator](); - !(o = (i = a.next()).done); - o = !0 - ) { - var l = i.value; - r[l.nodeName] = l.nodeValue; - } - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - return Number(r[e]) || t || 0; - }, - }, - { - key: "getString", - value: function (e, t) { - var r = {}, - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = this.DOM.attributes[Symbol.iterator](); - !(o = (i = a.next()).done); - o = !0 - ) { - var l = i.value; - r[l.nodeName] = l.nodeValue; - } - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - return r[e] ? String(r[e]) : t || null; - }, - }, - { - key: "setAttribute", - value: function (e, t) { - this.DOM.setAttribute(e, t); - }, - }, - { - key: "getContent", - value: function (e) { - var t = this.DOM.textContent; - return (t = t.replace(/\s\s+/g, ",")) || e || null; - }, - }, - { - key: "setContent", - value: function (e) { - this.DOM.children.length || (this.DOM.textContent = e); - }, - }, - { - key: "serialize", - value: function () { - return new XMLSerializer().serializeToString(this.DOM); - }, - }, - ]) && n(e.prototype, r), - o && n(e, o), - t - ); - })(); - e = a.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.number.constructor": 173, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 305: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var i = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (i.default.prototype.abs = Math.abs), - (i.default.prototype.ceil = Math.ceil), - (i.default.prototype.constrain = function (e, t, r) { - return ( - i.default._validateParameters("constrain", arguments), - Math.max(Math.min(e, r), t) - ); - }), - (i.default.prototype.dist = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - i.default._validateParameters("dist", t), - 4 === t.length - ? Math.hypot(t[2] - t[0], t[3] - t[1]) - : 6 === t.length - ? Math.hypot(t[3] - t[0], t[4] - t[1], t[5] - t[2]) - : void 0 - ); - }), - (i.default.prototype.exp = Math.exp), - (i.default.prototype.floor = Math.floor), - (i.default.prototype.lerp = function (e, t, r) { - return ( - i.default._validateParameters("lerp", arguments), - r * (t - e) + e - ); - }), - (i.default.prototype.log = Math.log), - (i.default.prototype.mag = function (e, t) { - return ( - i.default._validateParameters("mag", arguments), - Math.hypot(e, t) - ); - }), - (i.default.prototype.map = function (e, t, r, o, n, s) { - i.default._validateParameters("map", arguments); - e = ((e - t) / (r - t)) * (n - o) + o; - return s - ? o < n - ? this.constrain(e, o, n) - : this.constrain(e, n, o) - : e; - }), - (i.default.prototype.max = function () { - for ( - var e = function (e) { - var t = -1 / 0, - r = !0, - o = !1, - n = void 0; - try { - for ( - var s, i = e[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) - var a = s.value, t = t < a ? a : t; - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - return t; - }, - t = arguments.length, - r = new Array(t), - o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return r[0] instanceof Array ? e(r[0]) : e(r); - }), - (i.default.prototype.min = function () { - for ( - var e = function (e) { - var t = 1 / 0, - r = !0, - o = !1, - n = void 0; - try { - for ( - var s, i = e[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) - var a = s.value, t = a < t ? a : t; - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - return t; - }, - t = arguments.length, - r = new Array(t), - o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return r[0] instanceof Array ? e(r[0]) : e(r); - }), - (i.default.prototype.norm = function (e, t, r) { - return ( - i.default._validateParameters("norm", arguments), - this.map(e, t, r, 0, 1) - ); - }), - (i.default.prototype.pow = Math.pow), - (i.default.prototype.round = function (e, t) { - return t - ? ((t = Math.pow(10, t)), Math.round(e * t) / t) - : Math.round(e); - }), - (i.default.prototype.sq = function (e) { - return e * e; - }), - (i.default.prototype.sqrt = Math.sqrt), - (i.default.prototype.fract = function (e) { - i.default._validateParameters("fract", arguments); - var t, - r = 0, - e = Number(e); - return isNaN(e) || Math.abs(e) === 1 / 0 - ? e - : (e < 0 && ((e = -e), (r = 1)), - String(e).includes(".") && !String(e).includes("e") - ? ((t = String(e)), - (t = Number("0" + t.slice(t.indexOf(".")))), - Math.abs(r - t)) - : e < 1 - ? Math.abs(r - e) - : 0); - }); - e = i.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.math.hypot": 170, - "core-js/modules/es.number.constructor": 173, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 306: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.slice"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t, r) { - return (n = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? Reflect.construct - : function (e, t, r) { - var o = [null]; - o.push.apply(o, t); - t = new (Function.bind.apply(e, o))(); - return r && s(t, r.prototype), t; - }).apply(null, arguments); - } - function s(e, t) { - return (s = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - o.default.prototype.createVector = function (e, t, r) { - return this instanceof o.default - ? n( - o.default.Vector, - [ - this._fromRadians.bind(this), - this._toRadians.bind(this), - ].concat(Array.prototype.slice.call(arguments)), - ) - : new o.default.Vector(e, t, r); - }; - e = o.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.to-string": 188, - }, - ], - 307: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function b(e) { - return 0.5 * (1 - Math.cos(e * Math.PI)); - } - var j, - _ = 4095, - x = 4, - w = 0.5, - e = - ((e.default.prototype.noise = function (e) { - var t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : 0, - r = - 2 < arguments.length && void 0 !== arguments[2] - ? arguments[2] - : 0; - if (null == j) { - j = new Array(4096); - for (var o = 0; o < 4096; o++) j[o] = Math.random(); - } - e < 0 && (e = -e), t < 0 && (t = -t), r < 0 && (r = -r); - for ( - var n, - s, - i = Math.floor(e), - a = Math.floor(t), - l = Math.floor(r), - u = e - i, - c = t - a, - d = r - l, - h = 0, - f = 0.5, - p = 0; - p < x; - p++ - ) { - var m = i + (a << 4) + (l << 8), - y = b(u), - g = b(c), - v = j[m & _]; - (v += y * (j[(m + 1) & _] - v)), - (n = j[(m + 16) & _]), - (v += g * ((n += y * (j[(m + 16 + 1) & _] - n)) - v)), - (n = j[(m += 256) & _]), - (n += y * (j[(m + 1) & _] - n)), - (s = j[(m + 16) & _]), - (n += g * ((s += y * (j[(m + 16 + 1) & _] - s)) - n)), - (h += (v += b(d) * (n - v)) * f), - (f *= w), - (i <<= 1), - (a <<= 1), - (l <<= 1), - 1 <= (u *= 2) && (i++, u--), - 1 <= (c *= 2) && (a++, c--), - 1 <= (d *= 2) && (l++, d--); - } - return h; - }), - (e.default.prototype.noiseDetail = function (e, t) { - 0 < e && (x = e), 0 < t && (w = t); - }), - (e.default.prototype.noiseSeed = function (e) { - o = 4294967296; - var t, - r, - o, - n = { - setSeed: function (e) { - r = t = (null == e ? Math.random() * o : e) >>> 0; - }, - getSeed: function () { - return t; - }, - rand: function () { - return (r = (1664525 * r + 1013904223) % o) / o; - }, - }; - n.setSeed(e), (j = new Array(4096)); - for (var s = 0; s < 4096; s++) j[s] = n.rand(); - }), - e.default); - r.default = e; - }, - { "../core/main": 275 }, - ], - 308: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.every"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.math.sign"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.number.is-finite"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.sub"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.every"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.math.sign"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.number.is-finite"), - e("core-js/modules/es.string.sub"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var a = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = l(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function l() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (l = function () { - return e; - }), - e); - } - function u(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function c(e, t) { - return ( - 0 !== e && (this.x = this.x % e), - 0 !== t && (this.y = this.y % t), - this - ); - } - function d(e, t, r) { - return ( - 0 !== e && (this.x = this.x % e), - 0 !== t && (this.y = this.y % t), - 0 !== r && (this.z = this.z % r), - this - ); - } - a.default.Vector = (function () { - function n() { - var e = this, - t = n; - if (!(e instanceof t)) - throw new TypeError("Cannot call a class as a function"); - var r, - o, - e = - "function" == - typeof (arguments.length <= 0 ? void 0 : arguments[0]) - ? ((this.isPInst = !0), - (this._fromRadians = - arguments.length <= 0 ? void 0 : arguments[0]), - (this._toRadians = - arguments.length <= 1 ? void 0 : arguments[1]), - (r = - (arguments.length <= 2 ? void 0 : arguments[2]) || 0), - (o = - (arguments.length <= 3 ? void 0 : arguments[3]) || 0), - (arguments.length <= 4 ? void 0 : arguments[4]) || 0) - : ((r = - (arguments.length <= 0 ? void 0 : arguments[0]) || 0), - (o = - (arguments.length <= 1 ? void 0 : arguments[1]) || 0), - (arguments.length <= 2 ? void 0 : arguments[2]) || 0); - (this.x = r), (this.y = o), (this.z = e); - } - var e, t, r; - return ( - (e = n), - (r = [ - { - key: "fromAngle", - value: function (e, t) { - return new a.default.Vector( - (t = void 0 === t ? 1 : t) * Math.cos(e), - t * Math.sin(e), - 0, - ); - }, - }, - { - key: "fromAngles", - value: function (e, t, r) { - void 0 === r && (r = 1); - var o = Math.cos(t), - t = Math.sin(t), - n = Math.cos(e), - e = Math.sin(e); - return new a.default.Vector(r * e * t, -r * n, r * e * o); - }, - }, - { - key: "random2D", - value: function () { - return this.fromAngle(Math.random() * s.TWO_PI); - }, - }, - { - key: "random3D", - value: function () { - var e = Math.random() * s.TWO_PI, - t = 2 * Math.random() - 1, - r = Math.sqrt(1 - t * t), - o = r * Math.cos(e), - r = r * Math.sin(e); - return new a.default.Vector(o, r, t); - }, - }, - { - key: "copy", - value: function (e) { - return e.copy(e); - }, - }, - { - key: "add", - value: function (e, t, r) { - return ( - r - ? r.set(e) - : ((r = e.copy()), - 3 === arguments.length && - a.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.add", - )), - r.add(t), - r - ); - }, - }, - { - key: "rem", - value: function (e, t) { - if ( - e instanceof a.default.Vector && - t instanceof a.default.Vector - ) - return (e = e.copy()).rem(t), e; - }, - }, - { - key: "sub", - value: function (e, t, r) { - return ( - r - ? r.set(e) - : ((r = e.copy()), - 3 === arguments.length && - a.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.sub", - )), - r.sub(t), - r - ); - }, - }, - { - key: "mult", - value: function (e, t, r) { - return ( - r - ? r.set(e) - : ((r = e.copy()), - 3 === arguments.length && - a.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.mult", - )), - r.mult(t), - r - ); - }, - }, - { - key: "rotate", - value: function (e, t, r) { - return ( - 2 === arguments.length - ? (r = e.copy()) - : (r instanceof a.default.Vector || - a.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.rotate", - ), - r.set(e)), - r.rotate(t), - r - ); - }, - }, - { - key: "div", - value: function (e, t, r) { - return ( - r - ? r.set(e) - : ((r = e.copy()), - 3 === arguments.length && - a.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.div", - )), - r.div(t), - r - ); - }, - }, - { - key: "dot", - value: function (e, t) { - return e.dot(t); - }, - }, - { - key: "cross", - value: function (e, t) { - return e.cross(t); - }, - }, - { - key: "dist", - value: function (e, t) { - return e.dist(t); - }, - }, - { - key: "lerp", - value: function (e, t, r, o) { - return ( - o - ? o.set(e) - : ((o = e.copy()), - 4 === arguments.length && - a.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.lerp", - )), - o.lerp(t, r), - o - ); - }, - }, - { - key: "slerp", - value: function (e, t, r, o) { - return ( - o - ? o.set(e) - : ((o = e.copy()), - 4 === arguments.length && - a.default._friendlyError( - "The target parameter is undefined, it should be of type p5.Vector", - "p5.Vector.slerp", - )), - o.slerp(t, r), - o - ); - }, - }, - { - key: "mag", - value: function (e) { - return e.mag(); - }, - }, - { - key: "magSq", - value: function (e) { - return e.magSq(); - }, - }, - { - key: "normalize", - value: function (e, t) { - return ( - arguments.length < 2 - ? (t = e.copy()) - : (t instanceof a.default.Vector || - a.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.normalize", - ), - t.set(e)), - t.normalize() - ); - }, - }, - { - key: "limit", - value: function (e, t, r) { - return ( - arguments.length < 3 - ? (r = e.copy()) - : (r instanceof a.default.Vector || - a.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.limit", - ), - r.set(e)), - r.limit(t) - ); - }, - }, - { - key: "setMag", - value: function (e, t, r) { - return ( - arguments.length < 3 - ? (r = e.copy()) - : (r instanceof a.default.Vector || - a.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.setMag", - ), - r.set(e)), - r.setMag(t) - ); - }, - }, - { - key: "heading", - value: function (e) { - return e.heading(); - }, - }, - { - key: "angleBetween", - value: function (e, t) { - return e.angleBetween(t); - }, - }, - { - key: "reflect", - value: function (e, t, r) { - return ( - arguments.length < 3 - ? (r = e.copy()) - : (r instanceof a.default.Vector || - a.default._friendlyError( - "The target parameter should be of type p5.Vector", - "p5.Vector.reflect", - ), - r.set(e)), - r.reflect(t) - ); - }, - }, - { - key: "array", - value: function (e) { - return e.array(); - }, - }, - { - key: "equals", - value: function (e, t) { - var r; - return ( - e instanceof a.default.Vector - ? (r = e) - : e instanceof Array - ? (r = new a.default.Vector().set(e)) - : a.default._friendlyError( - "The v1 parameter should be of type Array or p5.Vector", - "p5.Vector.equals", - ), - r.equals(t) - ); - }, - }, - ]), - (t = [ - { - key: "toString", - value: function () { - return "p5.Vector Object : [" - .concat(this.x, ", ") - .concat(this.y, ", ") - .concat(this.z, "]"); - }, - }, - { - key: "set", - value: function (e, t, r) { - return ( - e instanceof a.default.Vector - ? ((this.x = e.x || 0), - (this.y = e.y || 0), - (this.z = e.z || 0)) - : Array.isArray(e) - ? ((this.x = e[0] || 0), - (this.y = e[1] || 0), - (this.z = e[2] || 0)) - : ((this.x = e || 0), - (this.y = t || 0), - (this.z = r || 0)), - this - ); - }, - }, - { - key: "copy", - value: function () { - return this.isPInst - ? new a.default.Vector( - this._fromRadians, - this._toRadians, - this.x, - this.y, - this.z, - ) - : new a.default.Vector(this.x, this.y, this.z); - }, - }, - { - key: "add", - value: function (e, t, r) { - return ( - e instanceof a.default.Vector - ? ((this.x += e.x || 0), - (this.y += e.y || 0), - (this.z += e.z || 0)) - : Array.isArray(e) - ? ((this.x += e[0] || 0), - (this.y += e[1] || 0), - (this.z += e[2] || 0)) - : ((this.x += e || 0), - (this.y += t || 0), - (this.z += r || 0)), - this - ); - }, - }, - { - key: "rem", - value: function (e, t, r) { - var o; - if (e instanceof a.default.Vector) { - if ([e.x, e.y, e.z].every(Number.isFinite)) - return ( - (n = parseFloat(e.x)), - (s = parseFloat(e.y)), - (o = parseFloat(e.z)), - d.call(this, n, s, o) - ); - } else if (Array.isArray(e)) { - if ( - e.every(function (e) { - return Number.isFinite(e); - }) - ) - return 2 === e.length - ? c.call(this, e[0], e[1]) - : 3 === e.length - ? d.call(this, e[0], e[1], e[2]) - : void 0; - } else if (1 === arguments.length) { - if (Number.isFinite(e) && 0 !== e) - return ( - (this.x = this.x % e), - (this.y = this.y % e), - (this.z = this.z % e), - this - ); - } else if (2 === arguments.length) { - var n = Array.prototype.slice.call(arguments); - if ( - n.every(function (e) { - return Number.isFinite(e); - }) && - 2 === n.length - ) - return c.call(this, n[0], n[1]); - } else if (3 === arguments.length) { - var s = Array.prototype.slice.call(arguments); - if ( - s.every(function (e) { - return Number.isFinite(e); - }) && - 3 === s.length - ) - return d.call(this, s[0], s[1], s[2]); - } - }, - }, - { - key: "sub", - value: function (e, t, r) { - return ( - e instanceof a.default.Vector - ? ((this.x -= e.x || 0), - (this.y -= e.y || 0), - (this.z -= e.z || 0)) - : Array.isArray(e) - ? ((this.x -= e[0] || 0), - (this.y -= e[1] || 0), - (this.z -= e[2] || 0)) - : ((this.x -= e || 0), - (this.y -= t || 0), - (this.z -= r || 0)), - this - ); - }, - }, - { - key: "mult", - value: function (e, t, r) { - var o; - return ( - e instanceof a.default.Vector - ? Number.isFinite(e.x) && - Number.isFinite(e.y) && - Number.isFinite(e.z) && - "number" == typeof e.x && - "number" == typeof e.y && - "number" == typeof e.z - ? ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z)) - : console.warn( - "p5.Vector.prototype.mult:", - "x contains components that are either undefined or not finite numbers", - ) - : Array.isArray(e) - ? e.every(function (e) { - return Number.isFinite(e); - }) && - e.every(function (e) { - return "number" == typeof e; - }) - ? 1 === e.length - ? ((this.x *= e[0]), - (this.y *= e[0]), - (this.z *= e[0])) - : 2 === e.length - ? ((this.x *= e[0]), (this.y *= e[1])) - : 3 === e.length && - ((this.x *= e[0]), - (this.y *= e[1]), - (this.z *= e[2])) - : console.warn( - "p5.Vector.prototype.mult:", - "x contains elements that are either undefined or not finite numbers", - ) - : (o = Array.prototype.slice.call(arguments)).every( - function (e) { - return Number.isFinite(e); - }, - ) && - o.every(function (e) { - return "number" == typeof e; - }) - ? (1 === arguments.length && - ((this.x *= e), (this.y *= e), (this.z *= e)), - 2 === arguments.length && - ((this.x *= e), (this.y *= t)), - 3 === arguments.length && - ((this.x *= e), (this.y *= t), (this.z *= r))) - : console.warn( - "p5.Vector.prototype.mult:", - "x, y, or z arguments are either undefined or not a finite number", - ), - this - ); - }, - }, - { - key: "div", - value: function (e, t, r) { - if (e instanceof a.default.Vector) - if ( - Number.isFinite(e.x) && - Number.isFinite(e.y) && - Number.isFinite(e.z) && - "number" == typeof e.x && - "number" == typeof e.y && - "number" == typeof e.z - ) { - var o = 0 === e.z && 0 === this.z; - if (0 === e.x || 0 === e.y || (!o && 0 === e.z)) - return ( - console.warn( - "p5.Vector.prototype.div:", - "divide by 0", - ), - this - ); - (this.x /= e.x), (this.y /= e.y), o || (this.z /= e.z); - } else - console.warn( - "p5.Vector.prototype.div:", - "x contains components that are either undefined or not finite numbers", - ); - else if (Array.isArray(e)) - if ( - e.every(function (e) { - return Number.isFinite(e); - }) && - e.every(function (e) { - return "number" == typeof e; - }) - ) { - if ( - e.some(function (e) { - return 0 === e; - }) - ) - return ( - console.warn( - "p5.Vector.prototype.div:", - "divide by 0", - ), - this - ); - 1 === e.length - ? ((this.x /= e[0]), - (this.y /= e[0]), - (this.z /= e[0])) - : 2 === e.length - ? ((this.x /= e[0]), (this.y /= e[1])) - : 3 === e.length && - ((this.x /= e[0]), - (this.y /= e[1]), - (this.z /= e[2])); - } else - console.warn( - "p5.Vector.prototype.div:", - "x contains components that are either undefined or not finite numbers", - ); - else { - o = Array.prototype.slice.call(arguments); - if ( - o.every(function (e) { - return Number.isFinite(e); - }) && - o.every(function (e) { - return "number" == typeof e; - }) - ) { - if ( - o.some(function (e) { - return 0 === e; - }) - ) - return ( - console.warn( - "p5.Vector.prototype.div:", - "divide by 0", - ), - this - ); - 1 === arguments.length && - ((this.x /= e), (this.y /= e), (this.z /= e)), - 2 === arguments.length && - ((this.x /= e), (this.y /= t)), - 3 === arguments.length && - ((this.x /= e), (this.y /= t), (this.z /= r)); - } else - console.warn( - "p5.Vector.prototype.div:", - "x, y, or z arguments are either undefined or not a finite number", - ); - } - return this; - }, - }, - { - key: "mag", - value: function () { - return Math.sqrt(this.magSq()); - }, - }, - { - key: "magSq", - value: function () { - var e = this.x, - t = this.y, - r = this.z; - return e * e + t * t + r * r; - }, - }, - { - key: "dot", - value: function (e, t, r) { - return e instanceof a.default.Vector - ? this.dot(e.x, e.y, e.z) - : this.x * (e || 0) + - this.y * (t || 0) + - this.z * (r || 0); - }, - }, - { - key: "cross", - value: function (e) { - var t = this.y * e.z - this.z * e.y, - r = this.z * e.x - this.x * e.z, - e = this.x * e.y - this.y * e.x; - return this.isPInst - ? new a.default.Vector( - this._fromRadians, - this._toRadians, - t, - r, - e, - ) - : new a.default.Vector(t, r, e); - }, - }, - { - key: "dist", - value: function (e) { - return e.copy().sub(this).mag(); - }, - }, - { - key: "normalize", - value: function () { - var e = this.mag(); - return 0 !== e && this.mult(1 / e), this; - }, - }, - { - key: "limit", - value: function (e) { - var t = this.magSq(); - return e * e < t && this.div(Math.sqrt(t)).mult(e), this; - }, - }, - { - key: "setMag", - value: function (e) { - return this.normalize().mult(e); - }, - }, - { - key: "heading", - value: function () { - var e = Math.atan2(this.y, this.x); - return this.isPInst ? this._fromRadians(e) : e; - }, - }, - { - key: "setHeading", - value: function (e) { - this.isPInst && (e = this._toRadians(e)); - var t = this.mag(); - return ( - (this.x = t * Math.cos(e)), - (this.y = t * Math.sin(e)), - this - ); - }, - }, - { - key: "rotate", - value: function (e) { - var e = this.heading() + e, - t = - (this.isPInst && (e = this._toRadians(e)), this.mag()); - return ( - (this.x = Math.cos(e) * t), - (this.y = Math.sin(e) * t), - this - ); - }, - }, - { - key: "angleBetween", - value: function (e) { - var t; - return 0 == this.magSq() * e.magSq() - ? NaN - : ((t = this.cross(e)), - (e = - Math.atan2(t.mag(), this.dot(e)) * - Math.sign(t.z || 1)), - this.isPInst ? this._fromRadians(e) : e); - }, - }, - { - key: "lerp", - value: function (e, t, r, o) { - return e instanceof a.default.Vector - ? this.lerp(e.x, e.y, e.z, t) - : ((this.x += (e - this.x) * o || 0), - (this.y += (t - this.y) * o || 0), - (this.z += (r - this.z) * o || 0), - this); - }, - }, - { - key: "slerp", - value: function (e, t) { - if (0 !== t) { - if (1 === t) return this.set(e); - var r = this.mag(), - o = e.mag(); - if (0 == r * o) - this.mult(1 - t).add(e.x * t, e.y * t, e.z * t); - else { - var n = this.cross(e), - s = n.mag(), - i = Math.atan2(s, this.dot(e)); - if (0 < s) (n.x /= s), (n.y /= s), (n.z /= s); - else { - if (i < 0.5 * Math.PI) - return ( - this.mult(1 - t).add(e.x * t, e.y * t, e.z * t), - this - ); - 0 === this.z && 0 === e.z - ? n.set(0, 0, 1) - : 0 !== this.x - ? n.set(this.y, -this.x, 0).normalize() - : n.set(1, 0, 0); - } - (s = n.cross(this)), - (e = 1 - t + (t * o) / r), - (n = e * Math.cos(t * i)), - (o = e * Math.sin(t * i)); - (this.x = this.x * n + s.x * o), - (this.y = this.y * n + s.y * o), - (this.z = this.z * n + s.z * o); - } - } - return this; - }, - }, - { - key: "reflect", - value: function (e) { - return e.normalize(), this.sub(e.mult(2 * this.dot(e))); - }, - }, - { - key: "array", - value: function () { - return [this.x || 0, this.y || 0, this.z || 0]; - }, - }, - { - key: "equals", - value: function (e, t, r) { - var o, - n, - e = - e instanceof a.default.Vector - ? ((o = e.x || 0), (n = e.y || 0), e.z || 0) - : Array.isArray(e) - ? ((o = e[0] || 0), (n = e[1] || 0), e[2] || 0) - : ((o = e || 0), (n = t || 0), r || 0); - return this.x === o && this.y === n && this.z === e; - }, - }, - ]) && u(e.prototype, t), - r && u(e, r), - n - ); - })(); - var n = a.default.Vector; - r.default = n; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.every": 153, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.some": 166, - "core-js/modules/es.math.sign": 172, - "core-js/modules/es.number.constructor": 173, - "core-js/modules/es.number.is-finite": 174, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.sub": 200, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 309: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - var s = "_lcg_random_state", - o = 4294967296, - i = 0, - e = - ((n.default.prototype._lcg = function (e) { - return ( - (this[e] = (1664525 * this[e] + 1013904223) % o), this[e] / o - ); - }), - (n.default.prototype._lcgSetSeed = function (e, t) { - this[e] = (null == t ? Math.random() * o : t) >>> 0; - }), - (n.default.prototype.randomSeed = function (e) { - this._lcgSetSeed(s, e), (this._gaussian_previous = !1); - }), - (n.default.prototype.random = function (e, t) { - var r, o; - return ( - n.default._validateParameters("random", arguments), - (r = null != this[s] ? this._lcg(s) : Math.random()), - void 0 === e - ? r - : void 0 === t - ? e instanceof Array - ? e[Math.floor(r * e.length)] - : r * e - : (t < e && ((o = e), (e = t), (t = o)), r * (t - e) + e) - ); - }), - (n.default.prototype.randomGaussian = function (e) { - var t, - r, - o, - n, - s = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : 1; - if (this._gaussian_previous) - (t = i), (this._gaussian_previous = !1); - else { - for ( - ; - 1 <= - (n = - (r = this.random(2) - 1) * r + - (o = this.random(2) - 1) * o); - - ); - (t = r * (n = Math.sqrt((-2 * Math.log(n)) / n))), - (i = o * n), - (this._gaussian_previous = !0); - } - return t * s + (e || 0); - }), - n.default); - r.default = e; - }, - { "../core/main": 275 }, - ], - 310: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (l = e("../core/main")) && l.__esModule ? l : { default: l }, - s = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - (n.default.prototype._angleMode = s.RADIANS), - (n.default.prototype.acos = function (e) { - return this._fromRadians(Math.acos(e)); - }), - (n.default.prototype.asin = function (e) { - return this._fromRadians(Math.asin(e)); - }), - (n.default.prototype.atan = function (e) { - return this._fromRadians(Math.atan(e)); - }), - (n.default.prototype.atan2 = function (e, t) { - return this._fromRadians(Math.atan2(e, t)); - }), - (n.default.prototype.cos = function (e) { - return Math.cos(this._toRadians(e)); - }), - (n.default.prototype.sin = function (e) { - return Math.sin(this._toRadians(e)); - }), - (n.default.prototype.tan = function (e) { - return Math.tan(this._toRadians(e)); - }), - (n.default.prototype.degrees = function (e) { - return e * s.RAD_TO_DEG; - }), - (n.default.prototype.radians = function (e) { - return e * s.DEG_TO_RAD; - }), - (n.default.prototype.angleMode = function (e) { - if ( - (n.default._validateParameters("angleMode", arguments), - void 0 === e) - ) - return this._angleMode; - (e !== s.DEGREES && e !== s.RADIANS) || (this._angleMode = e); - }), - (n.default.prototype._toRadians = function (e) { - return this._angleMode === s.DEGREES ? e * s.DEG_TO_RAD : e; - }), - (n.default.prototype._toDegrees = function (e) { - return this._angleMode === s.RADIANS ? e * s.RAD_TO_DEG : e; - }), - (n.default.prototype._fromRadians = function (e) { - return this._angleMode === s.DEGREES ? e * s.RAD_TO_DEG : e; - }); - var l = n.default; - r.default = l; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 311: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var i = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (i.default.prototype.textAlign = function (e, t) { - var r; - return ( - i.default._validateParameters("textAlign", arguments), - (r = this._renderer).textAlign.apply(r, arguments) - ); - }), - (i.default.prototype.textLeading = function (e) { - var t; - return ( - i.default._validateParameters("textLeading", arguments), - (t = this._renderer).textLeading.apply(t, arguments) - ); - }), - (i.default.prototype.textSize = function (e) { - var t; - return ( - i.default._validateParameters("textSize", arguments), - (t = this._renderer).textSize.apply(t, arguments) - ); - }), - (i.default.prototype.textStyle = function (e) { - var t; - return ( - i.default._validateParameters("textStyle", arguments), - (t = this._renderer).textStyle.apply(t, arguments) - ); - }), - (i.default.prototype.textWidth = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - if ( - ((t[0] += ""), - i.default._validateParameters("textWidth", t), - 0 === t[0].length) - ) - return 0; - for ( - var o = t[0].replace(/\t/g, " ").split(/\r?\n|\r|\n/g), - n = [], - s = 0; - s < o.length; - s++ - ) - n.push(this._renderer.textWidth(o[s])); - return Math.max.apply(Math, n); - }), - (i.default.prototype.textAscent = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - i.default._validateParameters("textAscent", t), - this._renderer.textAscent() - ); - }), - (i.default.prototype.textDescent = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - i.default._validateParameters("textDescent", t), - this._renderer.textDescent() - ); - }), - (i.default.prototype._updateTextMetrics = function () { - return this._renderer._updateTextMetrics(); - }), - (i.default.prototype.textWrap = function (e) { - if ("WORD" !== e && "CHAR" !== e) - throw "Error: textWrap accepts only WORD or CHAR"; - return this._renderer.textWrap(e); - }); - e = i.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - }, - ], - 312: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.last-index-of"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.last-index-of"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.split"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l = (c = e("../core/main")) && c.__esModule ? c : { default: c }, - n = s(e("../core/constants")), - u = s(e("opentype.js")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function s(e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o, - n = {}, - s = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) - Object.prototype.hasOwnProperty.call(e, r) && - ((o = s ? Object.getOwnPropertyDescriptor(e, r) : null) && - (o.get || o.set) - ? Object.defineProperty(n, r, o) - : (n[r] = e[r])); - return (n.default = e), t && t.set(e, n), n; - } - e("../core/friendly_errors/validate_params"), - e("../core/friendly_errors/file_errors"), - e("../core/friendly_errors/fes_core"), - (l.default.prototype.loadFont = function (o, n, s) { - l.default._validateParameters("loadFont", arguments); - var i = new l.default.Font(this), - a = this; - return ( - u.load(o, function (e, t) { - if (e) - return ( - l.default._friendlyFileLoadError(4, o), - void 0 !== s ? s(e) : void console.error(e, o) - ); - (i.font = t), void 0 !== n && n(i), a._decrementPreload(); - var e = o.split("\\").pop().split("/").pop(), - t = e.lastIndexOf("."), - r = t < 1 ? null : e.slice(t + 1); - ["ttf", "otf", "woff", "woff2"].includes(r) && - ((r = e.slice(0, -1 !== t ? t : 0)), - (e = document.createElement("style")).appendChild( - document.createTextNode( - "\n@font-face {\nfont-family: " - .concat(r, ";\nsrc: url(") - .concat(o, ");\n}\n"), - ), - ), - document.head.appendChild(e)); - }), - i - ); - }), - (l.default.prototype.text = function (e, t, r, o, n) { - var s; - return ( - l.default._validateParameters("text", arguments), - this._renderer._doFill || this._renderer._doStroke - ? (s = this._renderer).text.apply(s, arguments) - : this - ); - }), - (l.default.prototype.textFont = function (e, t) { - if ( - (l.default._validateParameters("textFont", arguments), - arguments.length) - ) { - if (e) - return ( - this._renderer._setProperty("_textFont", e), - t && - (this._renderer._setProperty("_textSize", t), - this._renderer._leadingSet || - this._renderer._setProperty( - "_textLeading", - t * n._DEFAULT_LEADMULT, - )), - this._renderer._applyTextProperties() - ); - throw new Error("null font passed to textFont"); - } - return this._renderer._textFont; - }); - var c = l.default; - r.default = c; - }, - { - "../core/constants": 264, - "../core/friendly_errors/fes_core": 266, - "../core/friendly_errors/file_errors": 267, - "../core/friendly_errors/validate_params": 270, - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.last-index-of": 163, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - "opentype.js": 249, - }, - ], - 313: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - v = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== j(e) && "function" != typeof e)) - return { default: e }; - var t = i(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function i() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (i = function () { - return e; - }), - e); - } - function j(e) { - return (j = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function _(e, t) { - var r = e.length; - return e[t < 0 ? (t % r) + r : t % r]; - } - function x(e, t, r, o) { - var n, s, i; - return o - ? (void 0 === x.tmpPoint1 && - ((x.tmpPoint1 = []), (x.tmpPoint2 = [])), - (s = x.tmpPoint1), - (i = x.tmpPoint2), - (s.x = t.x - e.x), - (s.y = t.y - e.y), - (i.x = r.x - t.x), - (i.y = r.y - t.y), - (n = s.x * i.x + s.y * i.y), - (s = Math.sqrt(s.x * s.x + s.y * s.y)), - (i = Math.sqrt(i.x * i.x + i.y * i.y)), - Math.acos(n / (s * i)) < o) - : 0 == - (t[0] - e[0]) * (r[1] - e[1]) - (r[0] - e[0]) * (t[1] - e[1]); - } - function d(e, t, r, o, n, s, i, a, l) { - var u = 1 - l, - c = Math.pow(u, 3), - d = Math.pow(u, 2), - h = l * l, - f = h * l, - p = c * e + 3 * d * l * r + 3 * u * l * l * n + f * i, - c = c * t + 3 * d * l * o + 3 * u * l * l * s + f * a, - d = e + 2 * l * (r - e) + h * (n - 2 * r + e), - f = t + 2 * l * (o - t) + h * (s - 2 * o + t), - m = r + 2 * l * (n - r) + h * (i - 2 * n + r), - h = o + 2 * l * (s - o) + h * (a - 2 * s + o), - e = u * e + l * r, - r = u * t + l * o, - t = u * n + l * i, - o = u * s + l * a, - n = 90 - (180 * Math.atan2(d - m, f - h)) / Math.PI; - return ( - (m < d || f < h) && (n += 180), - { - x: p, - y: c, - m: { x: d, y: f }, - n: { x: m, y: h }, - start: { x: e, y: r }, - end: { x: t, y: o }, - alpha: n, - } - ); - } - function h(e, t, r, o, n, s, i, a, l) { - return null == l - ? f(e, t, r, o, n, s, i, a) - : d( - e, - t, - r, - o, - n, - s, - i, - a, - (function (e, t, r, o, n, s, i, a, l) { - if (!(l < 0 || f(e, t, r, o, n, s, i, a) < l)) { - var u, - c = 0.5, - d = 1 - c; - for ( - u = f(e, t, r, o, n, s, i, a, d); - 0.01 < Math.abs(u - l); - - ) - u = f( - e, - t, - r, - o, - n, - s, - i, - a, - (d += (u < l ? 1 : -1) * (c /= 2)), - ); - return d; - } - })(e, t, r, o, n, s, i, a, l), - ); - } - function w(e, t, r) { - for ( - var o, - n, - s, - i, - a, - l = 0, - u = 0, - c = (e = (function (e, t) { - function r(e, t, r) { - var o, n; - if (!e) return ["C", t.x, t.y, t.x, t.y, t.x, t.y]; - switch ( - ((e[0] in { T: 1, Q: 1 }) || (t.qx = t.qy = null), e[0]) - ) { - case "M": - (t.X = e[1]), (t.Y = e[2]); - break; - case "A": - e = ["C"].concat( - M.apply(0, [t.x, t.y].concat(e.slice(1))), - ); - break; - case "S": - (n = - "C" === r || "S" === r - ? ((o = 2 * t.x - t.bx), 2 * t.y - t.by) - : ((o = t.x), t.y)), - (e = ["C", o, n].concat(e.slice(1))); - break; - case "T": - "Q" === r || "T" === r - ? ((t.qx = 2 * t.x - t.qx), (t.qy = 2 * t.y - t.qy)) - : ((t.qx = t.x), (t.qy = t.y)), - (e = ["C"].concat( - E(t.x, t.y, t.qx, t.qy, e[1], e[2]), - )); - break; - case "Q": - (t.qx = e[1]), - (t.qy = e[2]), - (e = ["C"].concat( - E(t.x, t.y, e[1], e[2], e[3], e[4]), - )); - break; - case "L": - e = ["C"].concat(T(t.x, t.y, e[1], e[2])); - break; - case "H": - e = ["C"].concat(T(t.x, t.y, e[1], t.y)); - break; - case "V": - e = ["C"].concat(T(t.x, t.y, t.x, e[1])); - break; - case "Z": - e = ["C"].concat(T(t.x, t.y, t.X, t.Y)); - } - return e; - } - function o(e, t) { - if (7 < e[t].length) { - e[t].shift(); - for (var r = e[t]; r.length; ) - (c[t] = "A"), - a && (d[t] = "A"), - e.splice(t++, 0, ["C"].concat(r.splice(0, 6))); - e.splice(t, 1), - (s = Math.max(i.length, (a && a.length) || 0)); - } - } - function n(e, t, r, o, n) { - e && - t && - "M" === e[n][0] && - "M" !== t[n][0] && - (t.splice(n, 0, ["M", o.x, o.y]), - (r.bx = 0), - (r.by = 0), - (r.x = e[n][1]), - (r.y = e[n][2]), - (s = Math.max(i.length, (a && a.length) || 0))); - } - var s, - i = b(e), - a = t && b(t), - l = { - x: 0, - y: 0, - bx: 0, - by: 0, - X: 0, - Y: 0, - qx: null, - qy: null, - }, - u = { - x: 0, - y: 0, - bx: 0, - by: 0, - X: 0, - Y: 0, - qx: null, - qy: null, - }, - c = [], - d = [], - h = "", - f = ""; - s = Math.max(i.length, (a && a.length) || 0); - for (var p = 0; p < s; p++) { - "C" !== (h = i[p] ? i[p][0] : h) && - ((c[p] = h), p && (f = c[p - 1])), - (i[p] = r(i[p], l, f)), - "A" !== c[p] && "C" === h && (c[p] = "C"), - o(i, p), - a && - ("C" !== (h = a[p] ? a[p][0] : h) && - ((d[p] = h), p && (f = d[p - 1])), - (a[p] = r(a[p], u, f)), - "A" !== d[p] && "C" === h && (d[p] = "C"), - o(a, p)), - n(i, a, l, u, p), - n(a, i, u, l, p); - var m = i[p], - y = a && a[p], - g = m.length, - v = a && y.length; - (l.x = m[g - 2]), - (l.y = m[g - 1]), - (l.bx = parseFloat(m[g - 4]) || l.x), - (l.by = parseFloat(m[g - 3]) || l.y), - (u.bx = a && (parseFloat(y[v - 4]) || u.x)), - (u.by = a && (parseFloat(y[v - 3]) || u.y)), - (u.x = a && y[v - 2]), - (u.y = a && y[v - 1]); - } - return a ? [i, a] : i; - })(e)).length; - u < c; - u++ - ) { - if ("M" === (s = e[u])[0]) (o = +s[1]), (n = +s[2]); - else { - if ( - t < l + (i = h(o, n, s[1], s[2], s[3], s[4], s[5], s[6])) && - !r - ) - return { - x: (a = h(o, n, s[1], s[2], s[3], s[4], s[5], s[6], t - l)) - .x, - y: a.y, - alpha: a.alpha, - }; - (l += i), (o = +s[5]), (n = +s[6]); - } - s.shift(); - } - return (a = (a = r - ? l - : d(o, n, s[0], s[1], s[2], s[3], s[4], s[5], 1)).alpha - ? { x: a.x, y: a.y, alpha: a.alpha } - : a); - } - function b(e) { - var t = [], - r = 0, - o = 0, - n = 0, - s = 0, - i = 0; - if (e) { - "M" === e[0][0] && - ((n = r = +e[0][1]), - (s = o = +e[0][2]), - i++, - (t[0] = ["M", r, o])); - for ( - var a, - l, - u = - 3 === e.length && - "M" === e[0][0] && - "R" === e[1][0].toUpperCase() && - "Z" === e[2][0].toUpperCase(), - c = i, - d = e.length; - c < d; - c++ - ) { - if ( - (t.push((a = [])), - (l = e[c])[0] !== String.prototype.toUpperCase.call(l[0])) - ) - switch ( - ((a[0] = String.prototype.toUpperCase.call(l[0])), a[0]) - ) { - case "A": - (a[1] = l[1]), - (a[2] = l[2]), - (a[3] = l[3]), - (a[4] = l[4]), - (a[5] = l[5]), - (a[6] = +(l[6] + r)), - (a[7] = +(l[7] + o)); - break; - case "V": - a[1] = +l[1] + o; - break; - case "H": - a[1] = +l[1] + r; - break; - case "R": - for ( - var h, - f = 2, - p = (h = [r, o].concat(l.slice(1))).length; - f < p; - f++ - ) - (h[f] = +h[f] + r), (h[++f] = +h[f] + o); - t.pop(), (t = t.concat(S(h, u))); - break; - case "M": - (n = +l[1] + r), (s = +l[2] + o); - break; - default: - for (var m = 1, y = l.length; m < y; m++) - a[m] = +l[m] + (m % 2 ? r : o); - } - else if ("R" === l[0]) - (h = [r, o].concat(l.slice(1))), - t.pop(), - (t = t.concat(S(h, u))), - (a = ["R"].concat(l.slice(-2))); - else for (var g = 0, v = l.length; g < v; g++) a[g] = l[g]; - switch (a[0]) { - case "Z": - (r = n), (o = s); - break; - case "H": - r = a[1]; - break; - case "V": - o = a[1]; - break; - case "M": - (n = a[a.length - 2]), (s = a[a.length - 1]); - break; - default: - (r = a[a.length - 2]), (o = a[a.length - 1]); - } - } - } - return t; - } - function M(e, t, r, o, n, s, i, a, l, u) { - function c(e, t, r) { - return { - x: e * Math.cos(r) - t * Math.sin(r), - y: e * Math.sin(r) + t * Math.cos(r), - }; - } - var d, - h = Math.PI, - f = (120 * h) / 180, - p = (h / 180) * (+n || 0), - m = [], - y = - (u - ? ((x = u[0]), (d = u[1]), (j = u[2]), (_ = u[3])) - : ((e = (v = c(e, t, -p)).x), - (t = v.y), - 1 < - (y = - ((g = (e - (a = (v = c(a, l, -p)).x)) / 2) * g) / - (r * r) + - ((v = (t - (l = v.y)) / 2) * v) / (o * o)) && - ((r *= y = Math.sqrt(y)), (o *= y)), - (y = r * r), - (b = o * o), - (j = - ((s = - (s === i ? -1 : 1) * - Math.sqrt( - Math.abs( - (y * b - y * v * v - b * g * g) / - (y * v * v + b * g * g), - ), - )) * - r * - v) / - o + - (e + a) / 2), - (_ = (s * -o * g) / r + (t + l) / 2), - (x = Math.asin(((t - _) / o).toFixed(9))), - (d = Math.asin(((l - _) / o).toFixed(9))), - (x = e < j ? h - x : x) < 0 && (x = 2 * h + x), - (d = a < j ? h - d : d) < 0 && (d = 2 * h + d), - i && d < x && (x -= 2 * h), - !i && x < d && (d -= 2 * h)), - d - x), - g = - (Math.abs(y) > f && - ((b = d), - (v = a), - (s = l), - (d = x + f * (i && x < d ? 1 : -1)), - (m = M( - (a = j + r * Math.cos(d)), - (l = _ + o * Math.sin(d)), - r, - o, - n, - 0, - i, - v, - s, - [d, b, j, _], - ))), - (y = d - x), - Math.cos(x)), - h = Math.sin(x), - f = Math.cos(d), - n = Math.sin(d), - i = Math.tan(y / 4), - v = (4 / 3) * r * i, - s = (4 / 3) * o * i, - b = [e, t], - j = [e + v * h, t - s * g], - _ = [a + v * n, l - s * f], - x = [a, l]; - if (((j[0] = 2 * b[0] - j[0]), (j[1] = 2 * b[1] - j[1]), u)) - return [j, _, x].concat(m); - for ( - var w = [], - S = 0, - T = (m = [j, _, x].concat(m).join().split(",")).length; - S < T; - S++ - ) - w[S] = S % 2 ? c(m[S - 1], m[S], p).y : c(m[S], m[S + 1], p).x; - return w; - } - function S(e, t) { - for (var r = [], o = 0, n = e.length; o < n - 2 * !t; o += 2) { - var s = [ - { x: +e[o - 2], y: +e[o - 1] }, - { x: +e[o], y: +e[o + 1] }, - { x: +e[o + 2], y: +e[o + 3] }, - { x: +e[o + 4], y: +e[o + 5] }, - ]; - t - ? o - ? n - 4 === o - ? (s[3] = { x: +e[0], y: +e[1] }) - : n - 2 === o && - ((s[2] = { x: +e[0], y: +e[1] }), - (s[3] = { x: +e[2], y: +e[3] })) - : (s[0] = { x: +e[n - 2], y: +e[n - 1] }) - : n - 4 === o - ? (s[3] = s[2]) - : o || (s[0] = { x: +e[o], y: +e[o + 1] }), - r.push([ - "C", - (-s[0].x + 6 * s[1].x + s[2].x) / 6, - (-s[0].y + 6 * s[1].y + s[2].y) / 6, - (s[1].x + 6 * s[2].x - s[3].x) / 6, - (s[1].y + 6 * s[2].y - s[3].y) / 6, - s[2].x, - s[2].y, - ]); - } - return r; - } - function T(e, t, r, o) { - return [e, t, r, o, r, o]; - } - function E(e, t, r, o, n, s) { - return [ - (1 / 3) * e + (2 / 3) * r, - (1 / 3) * t + (2 / 3) * o, - (1 / 3) * n + (2 / 3) * r, - (1 / 3) * s + (2 / 3) * o, - n, - s, - ]; - } - function f(e, t, r, o, n, s, i, a, l) { - for ( - var u = (l = 1 < (l = null == l ? 1 : l) ? 1 : l < 0 ? 0 : l) / 2, - c = [ - -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, - 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, - ], - d = 0, - h = [ - 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, - 0.1601, 0.1069, 0.1069, 0.0472, 0.0472, - ], - f = 0; - f < 12; - f++ - ) { - var p = u * c[f] + u, - m = y(p, e, r, n, i), - p = y(p, t, o, s, a); - d += h[f] * Math.sqrt(m * m + p * p); - } - return u * d; - } - function y(e, t, r, o, n) { - return ( - e * - (e * (-3 * t + 9 * r - 9 * o + 3 * n) + - 6 * t - - 12 * r + - 6 * o) - - 3 * t + - 3 * r - ); - } - n.default.Font = (function () { - function t(e) { - if (!(this instanceof t)) - throw new TypeError("Cannot call a class as a function"); - (this.parent = e), (this.cache = {}), (this.font = void 0); - } - var e, r, o; - return ( - (e = t), - (r = [ - { - key: "textBounds", - value: function (e) { - var t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : 0, - r = - 2 < arguments.length && void 0 !== arguments[2] - ? arguments[2] - : 0, - o = 3 < arguments.length ? arguments[3] : void 0, - n = 4 < arguments.length ? arguments[4] : void 0, - s = (n && n.renderer && n.renderer._pInst) || this.parent, - i = s._renderer.drawingContext, - o = - (i.textAlign || v.LEFT, - i.textBaseline || v.BASELINE, - o || s._renderer._textSize); - if (!g) { - for ( - var a = [], - l = [], - u = [], - c = ((u[0] = []), []), - d = this._scale(o), - h = s._renderer.textLeading(), - f = 0, - p = - (this.font.forEachGlyph( - e, - t, - r, - o, - n, - function (e, t, r, o) { - var n = e.getMetrics(); - 0 === e.index || 10 === e.index - ? (u[(f += 1)] = []) - : (u[f].push(t + n.xMin * d), - u[f].push(t + n.xMax * d), - c.push(r + f * h + -n.yMin * d), - c.push(r + f * h + -n.yMax * d)); - }, - ), - 0 < u[f].length && - ((a[f] = Math.min.apply(null, u[f])), - (l[f] = Math.max.apply(null, u[f]))), - 0), - m = 0; - m <= f; - m++ - ) { - (a[m] = Math.min.apply(null, u[m])), - (l[m] = Math.max.apply(null, u[m])); - var y = l[m] - a[m]; - p < y && (p = y); - } - var i = Math.min.apply(null, a), - g = { - x: i, - y: (r = Math.min.apply(null, c)), - h: Math.max.apply(null, c) - r, - w: p, - advance: i - t, - }, - o = this._handleAlignment( - s._renderer, - e, - g.x, - g.y, - g.w + g.advance, - ); - (g.x = o.x), (g.y = o.y); - } - return g; - }, - }, - { - key: "textToPoints", - value: function (e, t, r, o, n) { - var s = t, - i = [], - a = e.split(/\r?\n|\r|\n/g); - o = o || this.parent._renderer._textSize; - for (var l, u, c, d = 0; d < a.length; d++) { - var h = 0; - t = s; - for ( - var f = (f = a[d]).replace("\t", " "), - p = this._getGlyphs(f), - m = 0; - m < p.length; - m++ - ) { - if ( - ((u = f), - !( - ((c = p)[(l = m)].name && "space" === c[l].name) || - (u.length === c.length && " " === u[l]) - )) - ) - for ( - var y = (function (e) { - for (var t, r = [], o = 0; o < e.length; o++) - "M" === e[o].type && - (t && r.push(t), (t = [])), - t.push( - (function (e) { - var t = [e.type]; - "M" === e.type || "L" === e.type - ? t.push(e.x, e.y) - : "C" === e.type - ? t.push( - e.x1, - e.y1, - e.x2, - e.y2, - e.x, - e.y, - ) - : "Q" === e.type && - t.push(e.x1, e.y1, e.x, e.y); - return t; - })(e[o]), - ); - return r.push(t), r; - })(p[m].getPath(t, r, o).commands), - g = 0; - g < y.length; - g++ - ) - for ( - var v = (function (e, t) { - for ( - var t = (function (e, t) { - if ("object" !== j(e)) e = t; - else - for (var r in t) - void 0 === e[r] && (e[r] = t[r]); - return e; - })(t, { - sampleFactor: 0.1, - simplifyThreshold: 0, - }), - r = w(e, 0, 1), - o = r / (r * t.sampleFactor), - n = [], - s = 0; - s < r; - s += o - ) - n.push(w(e, s)); - t.simplifyThreshold && - !(function (e) { - for ( - var t = - 1 < arguments.length && - void 0 !== arguments[1] - ? arguments[1] - : 0, - r = 0, - o = e.length - 1; - 3 < e.length && 0 <= o; - --o - ) - x( - _(e, o - 1), - _(e, o), - _(e, o + 1), - t, - ) && (e.splice(o % e.length, 1), r++); - })(n, t.simplifyThreshold); - return n; - })(y[g], n), - b = 0; - b < v.length; - b++ - ) - (v[b].x += h), i.push(v[b]); - h += p[m].advanceWidth * this._scale(o); - } - r += this.parent._renderer._textLeading; - } - return i; - }, - }, - { - key: "_getGlyphs", - value: function (e) { - return this.font.stringToGlyphs(e); - }, - }, - { - key: "_getPath", - value: function (e, t, r, o) { - var n = ( - (o && o.renderer && o.renderer._pInst) || - this.parent - )._renderer, - t = this._handleAlignment(n, e, t, r); - return this.font.getPath(e, t.x, t.y, n._textSize, o); - }, - }, - { - key: "_getPathData", - value: function (e, t, r, o) { - var n = 3; - return ( - "string" == typeof e && 2 < arguments.length - ? (e = this._getPath(e, t, r, o)) - : "object" === j(t) && (o = t), - o && "number" == typeof o.decimals && (n = o.decimals), - e.toPathData(n) - ); - }, - }, - { - key: "_getSVG", - value: function (e, t, r, o) { - var n = 3; - return ( - "string" == typeof e && 2 < arguments.length - ? (e = this._getPath(e, t, r, o)) - : "object" === j(t) && (o = t), - o && - ("number" == typeof o.decimals && (n = o.decimals), - "number" == typeof o.strokeWidth && - (e.strokeWidth = o.strokeWidth), - void 0 !== o.fill && (e.fill = o.fill), - void 0 !== o.stroke && (e.stroke = o.stroke)), - e.toSVG(n) - ); - }, - }, - { - key: "_renderPath", - value: function (e, t, r, o) { - var n = (o && o.renderer) || this.parent._renderer, - s = n.drawingContext, - e = ( - "object" === j(e) && e.commands - ? e - : this._getPath(e, t, r, o) - ).commands, - i = (s.beginPath(), !0), - t = !1, - r = void 0; - try { - for ( - var a, l = e[Symbol.iterator](); - !(i = (a = l.next()).done); - i = !0 - ) { - var u = a.value; - "M" === u.type - ? s.moveTo(u.x, u.y) - : "L" === u.type - ? s.lineTo(u.x, u.y) - : "C" === u.type - ? s.bezierCurveTo( - u.x1, - u.y1, - u.x2, - u.y2, - u.x, - u.y, - ) - : "Q" === u.type - ? s.quadraticCurveTo(u.x1, u.y1, u.x, u.y) - : "Z" === u.type && s.closePath(); - } - } catch (e) { - (t = !0), (r = e); - } finally { - try { - i || null == l.return || l.return(); - } finally { - if (t) throw r; - } - } - return ( - n._doStroke && n._strokeSet && !n._clipping && s.stroke(), - n._doFill && - !n._clipping && - (n._fillSet || n._setFill(v._DEFAULT_TEXT_FILL), - s.fill()), - this - ); - }, - }, - { - key: "_textWidth", - value: function (e, t) { - return this.font.getAdvanceWidth(e, t); - }, - }, - { - key: "_textAscent", - value: function (e) { - return this.font.ascender * this._scale(e); - }, - }, - { - key: "_textDescent", - value: function (e) { - return -this.font.descender * this._scale(e); - }, - }, - { - key: "_scale", - value: function (e) { - return ( - (1 / this.font.unitsPerEm) * - (e || this.parent._renderer._textSize) - ); - }, - }, - { - key: "_handleAlignment", - value: function (e, t, r, o, n) { - var s = e._textSize; - switch ( - (void 0 === n && (n = this._textWidth(t, s)), - e._textAlign) - ) { - case v.CENTER: - r -= n / 2; - break; - case v.RIGHT: - r -= n; - } - switch (e._textBaseline) { - case v.TOP: - o += this._textAscent(s); - break; - case v.CENTER: - o += this._textAscent(s) / 2; - break; - case v.BOTTOM: - o -= this._textDescent(s); - } - return { x: r, y: o }; - }, - }, - ]) && s(e.prototype, r), - o && s(e, o), - t - ); - })(); - e = n.default; - r.default = e; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.number.to-fixed": 175, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 314: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.array-buffer.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.array-buffer.constructor"), - e("core-js/modules/es.object.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (e.default.prototype.append = function (e, t) { - return e.push(t), e; - }), - (e.default.prototype.arrayCopy = function (e, t, r, o, n) { - var s, i; - (e = - void 0 !== n - ? ((i = Math.min(n, e.length)), (s = o), e.slice(t, i + t)) - : ((i = - void 0 !== r - ? ((i = r), Math.min(i, e.length)) - : e.length), - (r = t), - e.slice((s = 0), i))), - Array.prototype.splice.apply(r, [s, i].concat(e)); - }), - (e.default.prototype.concat = function (e, t) { - return e.concat(t); - }), - (e.default.prototype.reverse = function (e) { - return e.reverse(); - }), - (e.default.prototype.shorten = function (e) { - return e.pop(), e; - }), - (e.default.prototype.shuffle = function (e, t) { - for ( - var r, - o, - n = - ArrayBuffer && ArrayBuffer.isView && ArrayBuffer.isView(e), - s = (e = t || n ? e : e.slice()).length; - 1 < s; - - ) - (r = (this.random(0, 1) * s) | 0), - (o = e[--s]), - (e[s] = e[r]), - (e[r] = o); - return e; - }), - (e.default.prototype.sort = function (e, t) { - var r = t ? e.slice(0, Math.min(t, e.length)) : e, - t = t ? e.slice(Math.min(t, e.length)) : []; - return (r = - "string" == typeof r[0] - ? r.sort() - : r.sort(function (e, t) { - return e - t; - })).concat(t); - }), - (e.default.prototype.splice = function (e, t, r) { - return Array.prototype.splice.apply(e, [r, 0].concat(t)), e; - }), - (e.default.prototype.subset = function (e, t, r) { - return void 0 !== r ? e.slice(t, t + r) : e.slice(t, e.length); - }); - e = e.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array-buffer.constructor": 150, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.object.to-string": 182, - }, - ], - 315: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.map"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.repeat"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.number.constructor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.repeat"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var o = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (o.default.prototype.float = function (e) { - return e instanceof Array ? e.map(parseFloat) : parseFloat(e); - }), - (o.default.prototype.int = function (e) { - var t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : 10; - return e === 1 / 0 || "Infinity" === e - ? 1 / 0 - : e === -1 / 0 || "-Infinity" === e - ? -1 / 0 - : "string" == typeof e - ? parseInt(e, t) - : "number" == typeof e - ? 0 | e - : "boolean" == typeof e - ? e - ? 1 - : 0 - : e instanceof Array - ? e.map(function (e) { - return o.default.prototype.int(e, t); - }) - : void 0; - }), - (o.default.prototype.str = function (e) { - return e instanceof Array - ? e.map(o.default.prototype.str) - : String(e); - }), - (o.default.prototype.boolean = function (e) { - return "number" == typeof e - ? 0 !== e - : "string" == typeof e - ? "true" === e.toLowerCase() - : "boolean" == typeof e - ? e - : e instanceof Array - ? e.map(o.default.prototype.boolean) - : void 0; - }), - (o.default.prototype.byte = function (e) { - e = o.default.prototype.int(e, 10); - return "number" == typeof e - ? ((e + 128) % 256) - 128 - : e instanceof Array - ? e.map(o.default.prototype.byte) - : void 0; - }), - (o.default.prototype.char = function (e) { - return "number" != typeof e || isNaN(e) - ? e instanceof Array - ? e.map(o.default.prototype.char) - : "string" == typeof e - ? o.default.prototype.char(parseInt(e, 10)) - : void 0 - : String.fromCharCode(e); - }), - (o.default.prototype.unchar = function (e) { - return "string" == typeof e && 1 === e.length - ? e.charCodeAt(0) - : e instanceof Array - ? e.map(o.default.prototype.unchar) - : void 0; - }), - (o.default.prototype.hex = function (e, t) { - if (((t = null == t ? 8 : t), e instanceof Array)) - return e.map(function (e) { - return o.default.prototype.hex(e, t); - }); - if (e === 1 / 0 || e === -1 / 0) - return (e === 1 / 0 ? "F" : "0").repeat(t); - if ("number" == typeof e) { - e < 0 && (e = 4294967295 + e + 1); - for ( - var r = Number(e).toString(16).toUpperCase(); - r.length < t; - - ) - r = "0".concat(r); - return (r = - r.length >= t ? r.substring(r.length - t, r.length) : r); - } - }), - (o.default.prototype.unhex = function (e) { - return e instanceof Array - ? e.map(o.default.prototype.unhex) - : parseInt("0x".concat(e), 16); - }); - e = o.default; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.number.constructor": 173, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.repeat": 195, - }, - ], - 316: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.pad-start"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.filter"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.constructor"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.pad-start"), - e("core-js/modules/es.string.replace"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = (u = e("../core/main")) && u.__esModule ? u : { default: u }; - function i(e, t) { - return ( - (function (e) { - if (Array.isArray(e)) return e; - })(e) || - (function (e, t) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) { - var r = [], - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = e[Symbol.iterator](); - !(o = (i = a.next()).done) && - (r.push(i.value), !t || r.length !== t); - o = !0 - ); - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - return r; - } - })(e, t) || - (function () { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance", - ); - })() - ); - } - function o(e, t, r) { - var o = i(e.toString().split("."), 2), - n = o[0], - o = o[1]; - return void 0 === r - ? ((n = n.padStart(t, "0")), o ? n + "." + o : n) - : ((n = (e = i(e.toFixed(r).toString().split("."), 2))[0]), - (o = e[1]), - (n = n.padStart(t, "0")), - void 0 === o ? n : n + "." + o); - } - function n(e, t) { - var r = (e = e.toString()).indexOf("."), - o = -1 !== r ? e.substring(r) : "", - e = (e = -1 !== r ? e.substring(0, r) : e) - .toString() - .replace(/\B(?=(\d{3})+(?!\d))/g, ","); - if (0 === t) o = ""; - else if (void 0 !== t) - if (t > o.length) - for ( - var n = t - (o += -1 === r ? "." : "").length + 1, s = 0; - s < n; - s++ - ) - o += "0"; - else o = o.substring(0, t + 1); - return e + o; - } - function a(e) { - return 0 < parseFloat(e) ? "+".concat(e.toString()) : e.toString(); - } - function l(e) { - return 0 <= parseFloat(e) ? " ".concat(e.toString()) : e.toString(); - } - e("../core/friendly_errors/validate_params"), - e("../core/friendly_errors/file_errors"), - e("../core/friendly_errors/fes_core"), - (s.default.prototype.join = function (e, t) { - return ( - s.default._validateParameters("join", arguments), e.join(t) - ); - }), - (s.default.prototype.match = function (e, t) { - return ( - s.default._validateParameters("match", arguments), e.match(t) - ); - }), - (s.default.prototype.matchAll = function (e, t) { - s.default._validateParameters("matchAll", arguments); - for ( - var r = new RegExp(t, "g"), o = r.exec(e), n = []; - null !== o; - - ) - n.push(o), (o = r.exec(e)); - return n; - }), - (s.default.prototype.nf = function (e, t, r) { - return ( - s.default._validateParameters("nf", arguments), - e instanceof Array - ? e.map(function (e) { - return o(e, t, r); - }) - : "[object Arguments]" === Object.prototype.toString.call(e) - ? 3 === e.length - ? this.nf(e[0], e[1], e[2]) - : 2 === e.length - ? this.nf(e[0], e[1]) - : this.nf(e[0]) - : o(e, t, r) - ); - }), - (s.default.prototype.nfc = function (e, t) { - return ( - s.default._validateParameters("nfc", arguments), - e instanceof Array - ? e.map(function (e) { - return n(e, t); - }) - : n(e, t) - ); - }), - (s.default.prototype.nfp = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - s.default._validateParameters("nfp", t); - var o = s.default.prototype.nf.apply(this, t); - return o instanceof Array ? o.map(a) : a(o); - }), - (s.default.prototype.nfs = function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - s.default._validateParameters("nfs", t); - var o = s.default.prototype.nf.apply(this, t); - return o instanceof Array ? o.map(l) : l(o); - }), - (s.default.prototype.split = function (e, t) { - return ( - s.default._validateParameters("split", arguments), e.split(t) - ); - }), - (s.default.prototype.splitTokens = function (e, t) { - var r, o; - return ( - s.default._validateParameters("splitTokens", arguments), - (o = - void 0 !== t - ? ((o = /\]/g.exec((t = t))), - (r = /\[/g.exec(t)) && o - ? ((t = t.slice(0, o.index) + t.slice(o.index + 1)), - (r = /\[/g.exec(t)), - (t = t.slice(0, r.index) + t.slice(r.index + 1)), - new RegExp("[\\[".concat(t, "\\]]"), "g")) - : o - ? ((t = t.slice(0, o.index) + t.slice(o.index + 1)), - new RegExp("[".concat(t, "\\]]"), "g")) - : r - ? ((t = t.slice(0, r.index) + t.slice(r.index + 1)), - new RegExp("[".concat(t, "\\[]"), "g")) - : new RegExp("[".concat(t, "]"), "g")) - : /\s/g), - e.split(o).filter(function (e) { - return e; - }) - ); - }), - (s.default.prototype.trim = function (e) { - return ( - s.default._validateParameters("trim", arguments), - e instanceof Array ? e.map(this.trim) : e.trim() - ); - }); - var u = s.default; - r.default = u; - }, - { - "../core/friendly_errors/fes_core": 266, - "../core/friendly_errors/file_errors": 267, - "../core/friendly_errors/validate_params": 270, - "../core/main": 275, - "core-js/modules/es.array.filter": 155, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.number.to-fixed": 175, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.constructor": 186, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.match": 193, - "core-js/modules/es.string.pad-start": 194, - "core-js/modules/es.string.replace": 196, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.trim": 201, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 317: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (e.default.prototype.day = function () { - return new Date().getDate(); - }), - (e.default.prototype.hour = function () { - return new Date().getHours(); - }), - (e.default.prototype.minute = function () { - return new Date().getMinutes(); - }), - (e.default.prototype.millis = function () { - return -1 === this._millisStart - ? 0 - : window.performance.now() - this._millisStart; - }), - (e.default.prototype.month = function () { - return new Date().getMonth() + 1; - }), - (e.default.prototype.second = function () { - return new Date().getSeconds(); - }), - (e.default.prototype.year = function () { - return new Date().getFullYear(); - }); - e = e.default; - r.default = e; - }, - { "../core/main": 275 }, - ], - 318: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.math.sign"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.math.sign"), - e("core-js/modules/es.number.to-fixed"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var S = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - _ = - (e("./p5.Geometry"), - (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants"))); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - (S.default.prototype.beginGeometry = function () { - return this._renderer.beginGeometry(); - }), - (S.default.prototype.endGeometry = function () { - return this._renderer.endGeometry(); - }), - (S.default.prototype.buildGeometry = function (e) { - return this._renderer.buildGeometry(e); - }), - (S.default.prototype.freeGeometry = function (e) { - this._renderer._freeBuffers(e.gid); - }), - (S.default.prototype.plane = function (e, t, r, o) { - this._assert3d("plane"), - S.default._validateParameters("plane", arguments), - void 0 === e && (e = 50), - void 0 === t && (t = e), - void 0 === o && (o = 1); - var n, - s = "plane|".concat((r = void 0 === r ? 1 : r), "|").concat(o); - return ( - this._renderer.geometryInHash(s) || - ((n = new S.default.Geometry(r, o, function () { - for (var e, t, r = 0; r <= this.detailY; r++) - for ( - var o = r / this.detailY, n = 0; - n <= this.detailX; - n++ - ) - (e = n / this.detailX), - (t = new S.default.Vector(e - 0.5, o - 0.5, 0)), - this.vertices.push(t), - this.uvs.push(e, o); - })) - .computeFaces() - .computeNormals(), - r <= 1 && o <= 1 - ? n._makeTriangleEdges()._edgesToVertices() - : this._renderer._doStroke && - console.log( - "Cannot draw stroke on plane objects with more than 1 detailX or 1 detailY", - ), - this._renderer.createBuffers(s, n)), - this._renderer.drawBuffersScaled(s, e, t, 1), - this - ); - }), - (S.default.prototype.box = function (e, t, r, o, n) { - this._assert3d("box"), - S.default._validateParameters("box", arguments), - void 0 === e && (e = 50), - void 0 === t && (t = e), - void 0 === r && (r = t); - var s, - i = - this._renderer.attributes && - this._renderer.attributes.perPixelLighting, - i = - (void 0 === n && (n = i ? 1 : 4), - "box|" - .concat((o = void 0 === o ? (i ? 1 : 4) : o), "|") - .concat(n)); - return ( - this._renderer.geometryInHash(i) || - ((s = new S.default.Geometry(o, n, function () { - var n = this; - (this.edges = [ - [0, 1], - [1, 3], - [3, 2], - [6, 7], - [8, 9], - [9, 11], - [14, 15], - [16, 17], - [17, 19], - [18, 19], - [20, 21], - [22, 23], - ]), - [ - [0, 4, 2, 6], - [1, 3, 5, 7], - [0, 1, 4, 5], - [2, 6, 3, 7], - [0, 2, 1, 3], - [4, 5, 6, 7], - ].forEach(function (e, t) { - for (var t = 4 * t, r = 0; r < 4; r++) { - var o = e[r], - o = new S.default.Vector( - (2 * (1 & o) - 1) / 2, - ((2 & o) - 1) / 2, - ((4 & o) / 2 - 1) / 2, - ); - n.vertices.push(o), n.uvs.push(1 & r, (2 & r) / 2); - } - n.faces.push([t, 1 + t, 2 + t]), - n.faces.push([2 + t, 1 + t, 3 + t]); - }); - })).computeNormals(), - o <= 4 && n <= 4 - ? s._edgesToVertices() - : this._renderer._doStroke && - console.log( - "Cannot draw stroke on box objects with more than 4 detailX or 4 detailY", - ), - this._renderer.createBuffers(i, s)), - this._renderer.drawBuffersScaled(i, e, t, r), - this - ); - }), - (S.default.prototype.sphere = function (e, t, r) { - return ( - this._assert3d("sphere"), - S.default._validateParameters("sphere", arguments), - this.ellipsoid( - (e = void 0 === e ? 50 : e), - e, - e, - (t = void 0 === t ? 24 : t), - (r = void 0 === r ? 16 : r), - ), - this - ); - }); - function l(e, t, r, o, n, s, i) { - (e = e <= 0 ? 1 : e), - (t = t < 0 ? 0 : t), - (r = r <= 0 ? e : r), - (o = o < 3 ? 3 : o); - for ( - var a, - l, - u = (s = void 0 === s || s) ? -2 : 0, - c = - (n = n < 1 ? 1 : n) + - ((i = void 0 === i ? 0 !== t : i) ? 2 : 0), - d = Math.atan2(e - t, r), - h = Math.sin(d), - f = Math.cos(d), - p = u; - p <= c; - ++p - ) { - var m = p / n, - y = r * m, - g = void 0, - g = - p < 0 - ? ((m = y = 0), e) - : n < p - ? ((y = r), (m = 1), t) - : e + (t - e) * m; - for ( - (-2 !== p && p !== n + 2) || (g = 0), y -= r / 2, a = 0; - a < o; - ++a - ) { - var v = a / (o - 1), - b = 2 * Math.PI * v, - j = Math.sin(b), - b = Math.cos(b), - _ = - (this.vertices.push(new S.default.Vector(j * g, y, b * g)), - void 0), - _ = - p < 0 - ? new S.default.Vector(0, -1, 0) - : n < p && t - ? new S.default.Vector(0, 1, 0) - : new S.default.Vector(j * f, h, b * f); - this.vertexNormals.push(_), this.uvs.push(v, m); - } - } - var x = 0; - if (s) { - for (l = 0; l < o; ++l) - this.faces.push([x + l, x + o + ((l + 1) % o), x + o + l]); - x += 2 * o; - } - for (p = 0; p < n; ++p) { - for (a = 0; a < o; ++a) { - var w = (a + 1) % o; - this.faces.push([x + a, x + w, x + o + w]), - this.faces.push([x + a, x + o + w, x + o + a]); - } - x += o; - } - if (i) - for (x += o, a = 0; a < o; ++a) - this.faces.push([x + a, x + ((a + 1) % o), x + o]); - } - (S.default.prototype.cylinder = function (e, t, r, o, n, s) { - this._assert3d("cylinder"), - S.default._validateParameters("cylinder", arguments), - void 0 === e && (e = 50), - void 0 === t && (t = e), - void 0 === o && (o = 1), - void 0 === s && (s = !0), - void 0 === n && (n = !0); - var i, - a = "cylinder|" - .concat((r = void 0 === r ? 24 : r), "|") - .concat(o, "|") - .concat(n, "|") - .concat(s); - return ( - this._renderer.geometryInHash(a) || - ((i = new S.default.Geometry(r, o)), - l.call(i, 1, 1, 1, r, o, n, s), - r <= 24 && o <= 16 - ? i._makeTriangleEdges()._edgesToVertices() - : this._renderer._doStroke && - console.log( - "Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY", - ), - this._renderer.createBuffers(a, i)), - this._renderer.drawBuffersScaled(a, e, t, e), - this - ); - }), - (S.default.prototype.cone = function (e, t, r, o, n) { - this._assert3d("cone"), - S.default._validateParameters("cone", arguments), - void 0 === e && (e = 50), - void 0 === t && (t = e), - void 0 === o && (o = 1), - void 0 === n && (n = !0); - var s, - i = "cone|" - .concat((r = void 0 === r ? 24 : r), "|") - .concat(o, "|") - .concat(n); - return ( - this._renderer.geometryInHash(i) || - ((s = new S.default.Geometry(r, o)), - l.call(s, 1, 0, 1, r, o, n, !1), - r <= 24 && o <= 16 - ? s._makeTriangleEdges()._edgesToVertices() - : this._renderer._doStroke && - console.log( - "Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY", - ), - this._renderer.createBuffers(i, s)), - this._renderer.drawBuffersScaled(i, e, t, e), - this - ); - }), - (S.default.prototype.ellipsoid = function (e, t, r, o, n) { - this._assert3d("ellipsoid"), - S.default._validateParameters("ellipsoid", arguments), - void 0 === e && (e = 50), - void 0 === t && (t = e), - void 0 === r && (r = e), - void 0 === n && (n = 16); - var s, - i = "ellipsoid|" - .concat((o = void 0 === o ? 24 : o), "|") - .concat(n); - return ( - this._renderer.geometryInHash(i) || - ((s = new S.default.Geometry(o, n, function () { - for (var e = 0; e <= this.detailY; e++) - for ( - var t = e / this.detailY, - r = Math.PI * t - Math.PI / 2, - o = Math.cos(r), - n = Math.sin(r), - s = 0; - s <= this.detailX; - s++ - ) { - var i = s / this.detailX, - a = 2 * Math.PI * i, - l = Math.cos(a), - a = Math.sin(a), - a = new S.default.Vector(o * a, n, o * l); - this.vertices.push(a), - this.vertexNormals.push(a), - this.uvs.push(i, t); - } - })).computeFaces(), - o <= 24 && n <= 24 - ? s._makeTriangleEdges()._edgesToVertices() - : this._renderer._doStroke && - console.log( - "Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY", - ), - this._renderer.createBuffers(i, s)), - this._renderer.drawBuffersScaled(i, e, t, r), - this - ); - }), - (S.default.prototype.torus = function (e, t, r, o) { - if ( - (this._assert3d("torus"), - S.default._validateParameters("torus", arguments), - void 0 === e) - ) - e = 50; - else if (!e) return; - if (void 0 === t) t = 10; - else if (!t) return; - void 0 === r && (r = 24), void 0 === o && (o = 16); - var n, - d = (t / e).toPrecision(4), - t = "torus|".concat(d, "|").concat(r, "|").concat(o); - return ( - this._renderer.geometryInHash(t) || - ((n = new S.default.Geometry(r, o, function () { - for (var e = 0; e <= this.detailY; e++) - for ( - var t = e / this.detailY, - r = 2 * Math.PI * t, - o = Math.cos(r), - n = Math.sin(r), - s = 1 + d * o, - i = 0; - i <= this.detailX; - i++ - ) { - var a = i / this.detailX, - l = 2 * Math.PI * a, - u = Math.cos(l), - l = Math.sin(l), - c = new S.default.Vector(s * u, s * l, d * n), - u = new S.default.Vector(o * u, o * l, n); - this.vertices.push(c), - this.vertexNormals.push(u), - this.uvs.push(a, t); - } - })).computeFaces(), - r <= 24 && o <= 16 - ? n._makeTriangleEdges()._edgesToVertices() - : this._renderer._doStroke && - console.log( - "Cannot draw strokes on torus object with more than 24 detailX or 16 detailY", - ), - this._renderer.createBuffers(t, n)), - this._renderer.drawBuffersScaled(t, e, e, e), - this - ); - }), - (S.default.RendererGL.prototype.point = function (e, t, r) { - var o = []; - return ( - o.push(new S.default.Vector(e, t, (r = void 0 === r ? 0 : r))), - this._drawPoints(o, this.immediateMode.buffers.point), - this - ); - }), - (S.default.RendererGL.prototype.triangle = function (e) { - var t = e[0], - r = e[1], - o = e[2], - n = e[3], - s = e[4], - e = e[5], - i = - (this.geometryInHash("tri") || - ((i = new S.default.Geometry(1, 1, function () { - var e = []; - e.push(new S.default.Vector(0, 0, 0)), - e.push(new S.default.Vector(1, 0, 0)), - e.push(new S.default.Vector(0, 1, 0)), - (this.edges = [ - [0, 1], - [1, 2], - [2, 0], - ]), - (this.vertices = e), - (this.faces = [[0, 1, 2]]), - (this.uvs = [0, 0, 1, 0, 1, 1]); - }))._edgesToVertices(), - i.computeNormals(), - this.createBuffers("tri", i)), - this.uMVMatrix.copy()); - try { - var a = Math.sign( - t * n - o * r + o * e - s * n + s * r - t * e, - ), - l = new S.default.Matrix([ - o - t, - n - r, - 0, - 0, - s - t, - e - r, - 0, - 0, - 0, - 0, - a, - 0, - t, - r, - 0, - 1, - ]).mult(this.uMVMatrix); - (this.uMVMatrix = l), this.drawBuffers("tri"); - } finally { - this.uMVMatrix = i; - } - return this; - }), - (S.default.RendererGL.prototype.ellipse = function (e) { - this.arc(e[0], e[1], e[2], e[3], 0, _.TWO_PI, _.OPEN, e[4]); - }), - (S.default.RendererGL.prototype.arc = function (e) { - var t, - r = arguments[1], - o = arguments[2], - n = arguments[3], - s = arguments[4], - i = arguments[5], - a = arguments[6], - l = arguments[7] || 25, - u = ( - Math.abs(i - s) >= _.TWO_PI - ? "".concat((c = "ellipse"), "|") - : "" - .concat((c = "arc"), "|") - .concat(s, "|") - .concat(i, "|") - .concat(a, "|") - ).concat(l, "|"), - c = - (this.geometryInHash(u) || - ((t = new S.default.Geometry(l, 1, function () { - if (s.toFixed(10) !== i.toFixed(10)) { - (a !== _.PIE && void 0 !== a) || - (this.vertices.push( - new S.default.Vector(0.5, 0.5, 0), - ), - this.uvs.push([0.5, 0.5])); - for (var e = 0; e <= l; e++) { - var t = (i - s) * (e / l) + s, - r = 0.5 + Math.cos(t) / 2, - t = 0.5 + Math.sin(t) / 2; - this.vertices.push(new S.default.Vector(r, t, 0)), - this.uvs.push([r, t]), - e < l - 1 && - (this.faces.push([0, e + 1, e + 2]), - this.edges.push([e + 1, e + 2])); - } - switch (a) { - case _.PIE: - this.faces.push([ - 0, - this.vertices.length - 2, - this.vertices.length - 1, - ]), - this.edges.push([0, 1]), - this.edges.push([ - this.vertices.length - 2, - this.vertices.length - 1, - ]), - this.edges.push([0, this.vertices.length - 1]); - break; - case _.CHORD: - this.edges.push([0, 1]), - this.edges.push([0, this.vertices.length - 1]); - break; - case _.OPEN: - this.edges.push([0, 1]); - break; - default: - this.faces.push([ - 0, - this.vertices.length - 2, - this.vertices.length - 1, - ]), - this.edges.push([ - this.vertices.length - 2, - this.vertices.length - 1, - ]); - } - } - })).computeNormals(), - l <= 50 - ? t._edgesToVertices(t) - : this._doStroke && - console.log( - "Cannot apply a stroke to an ".concat( - c, - " with more than 50 detail", - ), - ), - this.createBuffers(u, t)), - this.uMVMatrix.copy()); - try { - this.uMVMatrix.translate([e, r, 0]), - this.uMVMatrix.scale(o, n, 1), - this.drawBuffers(u); - } finally { - this.uMVMatrix = c; - } - return this; - }), - (S.default.RendererGL.prototype.rect = function (e) { - var t = e[0], - r = e[1], - o = e[2], - n = e[3]; - if (void 0 === e[4]) { - var s = this._pInst._glAttributes.perPixelLighting, - i = e[4] || (s ? 1 : 24), - a = e[5] || (s ? 1 : 16), - s = "rect|".concat(i, "|").concat(a), - l = - (this.geometryInHash(s) || - ((l = new S.default.Geometry(i, a, function () { - for (var e = 0; e <= this.detailY; e++) - for ( - var t = e / this.detailY, r = 0; - r <= this.detailX; - r++ - ) { - var o = r / this.detailX, - n = new S.default.Vector(o, t, 0); - this.vertices.push(n), this.uvs.push(o, t); - } - 0 < i && - 0 < a && - (this.edges = [ - [0, i], - [i, (i + 1) * (a + 1) - 1], - [(i + 1) * (a + 1) - 1, (i + 1) * a], - [(i + 1) * a, 0], - ]); - })) - .computeFaces() - .computeNormals() - ._edgesToVertices(), - this.createBuffers(s, l)), - this.uMVMatrix.copy()); - try { - this.uMVMatrix.translate([t, r, 0]), - this.uMVMatrix.scale(o, n, 1), - this.drawBuffers(s); - } finally { - this.uMVMatrix = l; - } - } else { - var s = e[4], - l = void 0 === e[5] ? s : e[5], - u = void 0 === e[6] ? l : e[6], - e = void 0 === e[7] ? u : e[7], - c = o, - d = n, - h = - ((c += t) < t && ((h = t), (t = c), (c = h)), - (d += r) < r && ((h = r), (r = d), (d = h)), - Math.min((c - t) / 2, (d - r) / 2)), - f = - (h < s && (s = h), - h < l && (l = h), - h < u && (u = h), - h < e && (e = h), - t), - p = r, - h = c, - t = d, - m = - (this.beginShape(), - 0 !== l - ? (this.vertex(h - l, p), - this.quadraticVertex(h, p, h, p + l)) - : this.vertex(h, p), - 0 !== u - ? (this.vertex(h, t - u), - this.quadraticVertex(h, t, h - u, t)) - : this.vertex(h, t), - 0 !== e - ? (this.vertex(f + e, t), - this.quadraticVertex(f, t, f, t - e)) - : this.vertex(f, t), - 0 !== s - ? (this.vertex(f, p + s), - this.quadraticVertex(f, p, f + s, p)) - : this.vertex(f, p), - !(this.immediateMode.geometry.uvs.length = 0)), - r = !1, - c = void 0; - try { - for ( - var y, - g = - this.immediateMode.geometry.vertices[Symbol.iterator](); - !(m = (y = g.next()).done); - m = !0 - ) { - var v = y.value, - b = (v.x - f) / o, - j = (v.y - p) / n; - this.immediateMode.geometry.uvs.push(b, j); - } - } catch (e) { - (r = !0), (c = e); - } finally { - try { - m || null == g.return || g.return(); - } finally { - if (r) throw c; - } - } - this.endShape(_.CLOSE); - } - return this; - }), - (S.default.RendererGL.prototype.quad = function ( - i, - a, - l, - u, - c, - d, - h, - f, - p, - m, - y, - g, - e, - t, - ) { - void 0 === e && (e = 2), void 0 === t && (t = 2); - var r = "quad|" - .concat(i, "|") - .concat(a, "|") - .concat(l, "|") - .concat(u, "|") - .concat(c, "|") - .concat(d, "|") - .concat(h, "|") - .concat(f, "|") - .concat(p, "|") - .concat(m, "|") - .concat(y, "|") - .concat(g, "|") - .concat(e, "|") - .concat(t); - if (!this.geometryInHash(r)) { - var o = new S.default.Geometry(e, t, function () { - for ( - var e = 1 / (this.detailX - 1), - t = 1 / (this.detailY - 1), - r = 0; - r < this.detailY; - r++ - ) - for (var o = 0; o < this.detailX; o++) { - var n = o * e, - s = r * t; - this.vertices.push( - new S.default.Vector( - (1 - n) * ((1 - s) * i + s * m) + - n * ((1 - s) * u + s * h), - (1 - n) * ((1 - s) * a + s * y) + - n * ((1 - s) * c + s * f), - (1 - n) * ((1 - s) * l + s * g) + - n * ((1 - s) * d + s * p), - ), - ), - this.uvs.push([n, s]); - } - }); - o.faces = []; - for (var n = 0; n < t - 1; n++) - for (var s = 0; s < e - 1; s++) { - var v = s + n * e, - b = s + 1 + (n + 1) * e, - j = s + (n + 1) * e; - o.faces.push([v, s + 1 + n * e, b]), - o.faces.push([v, b, j]); - } - o.computeNormals(); - for ( - var _ = [(o.edges.length = 0), 2, 3, 1], x = 0; - x < _.length; - x++ - ) - o.edges.push([_[x], _[(x + 1) % _.length]]); - o._edgesToVertices(), this.createBuffers(r, o); - } - return this.drawBuffers(r), this; - }), - (S.default.RendererGL.prototype.bezier = function ( - e, - t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - d, - ) { - 8 === arguments.length && - ((c = a), - (u = i), - (a = s), - (i = n), - (n = o), - (o = r), - (r = s = l = d = 0)); - var h = this._pInst._bezierDetail || 20; - this.beginShape(); - for (var f = 0; f <= h; f++) { - var p = Math.pow(1 - f / h, 3), - m = (f / h) * 3 * Math.pow(1 - f / h, 2), - y = 3 * Math.pow(f / h, 2) * (1 - f / h), - g = Math.pow(f / h, 3); - this.vertex( - e * p + o * m + i * y + u * g, - t * p + n * m + a * y + c * g, - r * p + s * m + l * y + d * g, - ); - } - return this.endShape(), this; - }), - (S.default.RendererGL.prototype.curve = function ( - e, - t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - d, - ) { - 8 === arguments.length && - ((u = i), - (c = a), - (i = n), - (a = o), - (n = o = r), - (r = s = l = d = 0)); - var h = this._pInst._curveDetail; - this.beginShape(); - for (var f = 0; f <= h; f++) { - var p = 0.5 * Math.pow(f / h, 3), - m = 0.5 * Math.pow(f / h, 2), - y = (f / h) * 0.5; - this.vertex( - p * (3 * o - e - 3 * i + u) + - m * (2 * e - 5 * o + 4 * i - u) + - y * (-e + i) + - 2 * o * 0.5, - p * (3 * n - t - 3 * a + c) + - m * (2 * t - 5 * n + 4 * a - c) + - y * (-t + a) + - 2 * n * 0.5, - p * (3 * s - r - 3 * l + d) + - m * (2 * r - 5 * s + 4 * l - d) + - y * (-r + l) + - 2 * s * 0.5, - ); - } - return this.endShape(), this; - }), - (S.default.RendererGL.prototype.line = function () { - return ( - 6 === arguments.length - ? (this.beginShape(_.LINES), - this.vertex( - arguments.length <= 0 ? void 0 : arguments[0], - arguments.length <= 1 ? void 0 : arguments[1], - arguments.length <= 2 ? void 0 : arguments[2], - ), - this.vertex( - arguments.length <= 3 ? void 0 : arguments[3], - arguments.length <= 4 ? void 0 : arguments[4], - arguments.length <= 5 ? void 0 : arguments[5], - ), - this.endShape()) - : 4 === arguments.length && - (this.beginShape(_.LINES), - this.vertex( - arguments.length <= 0 ? void 0 : arguments[0], - arguments.length <= 1 ? void 0 : arguments[1], - 0, - ), - this.vertex( - arguments.length <= 2 ? void 0 : arguments[2], - arguments.length <= 3 ? void 0 : arguments[3], - 0, - ), - this.endShape()), - this - ); - }), - (S.default.RendererGL.prototype.bezierVertex = function () { - if (0 === this.immediateMode._bezierVertex.length) - throw Error( - "vertex() must be used once before calling bezierVertex()", - ); - var e, - t, - r, - o, - n, - s, - i = [], - a = [], - l = arguments.length; - if ( - 0 === this._lookUpTableBezier.length || - this._lutBezierDetail !== this._pInst._curveDetail - ) { - (this._lookUpTableBezier = []), - (this._lutBezierDetail = this._pInst._curveDetail); - for ( - var u = 1 / this._lutBezierDetail, c = 0, d = 1, h = 0; - c < 1; - - ) { - if ( - ((s = parseFloat(c.toFixed(6))), - (this._lookUpTableBezier[h] = this._bezierCoefficients(s)), - d.toFixed(6) === u.toFixed(6)) - ) { - (s = parseFloat(d.toFixed(6)) + parseFloat(c.toFixed(6))), - ++h, - (this._lookUpTableBezier[h] = - this._bezierCoefficients(s)); - break; - } - (c += u), (d -= u), ++h; - } - } - for ( - var f = this._lookUpTableBezier.length, p = [], m = 0; - m < 4; - m++ - ) - p.push([]); - (p[0] = this.immediateMode.geometry.vertexColors.slice(-4)), - (p[3] = this.curFillColor.slice()); - var y = []; - for (m = 0; m < 4; m++) y.push([]); - if ( - ((y[0] = - this.immediateMode.geometry.vertexStrokeColors.slice(-4)), - (y[3] = this.curStrokeColor.slice()), - 6 === l) - ) { - this.isBezier = !0; - var i = [ - this.immediateMode._bezierVertex[0], - arguments.length <= 0 ? void 0 : arguments[0], - arguments.length <= 2 ? void 0 : arguments[2], - arguments.length <= 4 ? void 0 : arguments[4], - ], - a = [ - this.immediateMode._bezierVertex[1], - arguments.length <= 1 ? void 0 : arguments[1], - arguments.length <= 3 ? void 0 : arguments[3], - arguments.length <= 5 ? void 0 : arguments[5], - ], - g = Math.hypot(i[0] - i[1], a[0] - a[1]), - v = Math.hypot(i[1] - i[2], a[1] - a[2]), - b = Math.hypot(i[2] - i[3], a[2] - a[3]), - v = g + v + b; - for (g /= v, b /= v, n = 0; n < 4; n++) - p[1].push(p[0][n] * (1 - g) + p[3][n] * g), - p[2].push(p[0][n] * b + p[3][n] * (1 - b)), - y[1].push(y[0][n] * (1 - g) + y[3][n] * g), - y[2].push(y[0][n] * b + y[3][n] * (1 - b)); - for (o = 0; o < f; o++) { - for ( - this.curFillColor = [0, 0, 0, 0], - this.curStrokeColor = [0, 0, 0, 0], - m = e = t = 0; - m < 4; - m++ - ) { - for (n = 0; n < 4; n++) - (this.curFillColor[n] += - this._lookUpTableBezier[o][m] * p[m][n]), - (this.curStrokeColor[n] += - this._lookUpTableBezier[o][m] * y[m][n]); - (e += i[m] * this._lookUpTableBezier[o][m]), - (t += a[m] * this._lookUpTableBezier[o][m]); - } - this.vertex(e, t); - } - (this.curFillColor = p[3]), - (this.curStrokeColor = y[3]), - (this.immediateMode._bezierVertex[0] = - arguments.length <= 4 ? void 0 : arguments[4]), - (this.immediateMode._bezierVertex[1] = - arguments.length <= 5 ? void 0 : arguments[5]); - } else if (9 === l) { - (this.isBezier = !0), - (i = [ - this.immediateMode._bezierVertex[0], - arguments.length <= 0 ? void 0 : arguments[0], - arguments.length <= 3 ? void 0 : arguments[3], - arguments.length <= 6 ? void 0 : arguments[6], - ]), - (a = [ - this.immediateMode._bezierVertex[1], - arguments.length <= 1 ? void 0 : arguments[1], - arguments.length <= 4 ? void 0 : arguments[4], - arguments.length <= 7 ? void 0 : arguments[7], - ]); - var j = [ - this.immediateMode._bezierVertex[2], - arguments.length <= 2 ? void 0 : arguments[2], - arguments.length <= 5 ? void 0 : arguments[5], - arguments.length <= 8 ? void 0 : arguments[8], - ], - _ = Math.hypot(i[0] - i[1], a[0] - a[1], j[0] - j[1]), - v = Math.hypot(i[1] - i[2], a[1] - a[2], j[1] - j[2]), - x = Math.hypot(i[2] - i[3], a[2] - a[3], j[2] - j[3]), - l = _ + v + x; - for (_ /= l, x /= l, n = 0; n < 4; n++) - p[1].push(p[0][n] * (1 - _) + p[3][n] * _), - p[2].push(p[0][n] * x + p[3][n] * (1 - x)), - y[1].push(y[0][n] * (1 - _) + y[3][n] * _), - y[2].push(y[0][n] * x + y[3][n] * (1 - x)); - for (o = 0; o < f; o++) { - for ( - this.curFillColor = [0, 0, 0, 0], - this.curStrokeColor = [0, 0, 0, 0], - m = e = t = r = 0; - m < 4; - m++ - ) { - for (n = 0; n < 4; n++) - (this.curFillColor[n] += - this._lookUpTableBezier[o][m] * p[m][n]), - (this.curStrokeColor[n] += - this._lookUpTableBezier[o][m] * y[m][n]); - (e += i[m] * this._lookUpTableBezier[o][m]), - (t += a[m] * this._lookUpTableBezier[o][m]), - (r += j[m] * this._lookUpTableBezier[o][m]); - } - this.vertex(e, t, r); - } - (this.curFillColor = p[3]), - (this.curStrokeColor = y[3]), - (this.immediateMode._bezierVertex[0] = - arguments.length <= 6 ? void 0 : arguments[6]), - (this.immediateMode._bezierVertex[1] = - arguments.length <= 7 ? void 0 : arguments[7]), - (this.immediateMode._bezierVertex[2] = - arguments.length <= 8 ? void 0 : arguments[8]); - } - }), - (S.default.RendererGL.prototype.quadraticVertex = function () { - if (0 === this.immediateMode._quadraticVertex.length) - throw Error( - "vertex() must be used once before calling quadraticVertex()", - ); - var e, - t, - r, - o, - n, - s, - i = [], - a = [], - l = arguments.length; - if ( - 0 === this._lookUpTableQuadratic.length || - this._lutQuadraticDetail !== this._pInst._curveDetail - ) { - (this._lookUpTableQuadratic = []), - (this._lutQuadraticDetail = this._pInst._curveDetail); - for ( - var u = 1 / this._lutQuadraticDetail, c = 0, d = 1, h = 0; - c < 1; - - ) { - if ( - ((s = parseFloat(c.toFixed(6))), - (this._lookUpTableQuadratic[h] = - this._quadraticCoefficients(s)), - d.toFixed(6) === u.toFixed(6)) - ) { - (s = parseFloat(d.toFixed(6)) + parseFloat(c.toFixed(6))), - ++h, - (this._lookUpTableQuadratic[h] = - this._quadraticCoefficients(s)); - break; - } - (c += u), (d -= u), ++h; - } - } - for ( - var f = this._lookUpTableQuadratic.length, p = [], m = 0; - m < 3; - m++ - ) - p.push([]); - (p[0] = this.immediateMode.geometry.vertexColors.slice(-4)), - (p[2] = this.curFillColor.slice()); - var y = []; - for (m = 0; m < 3; m++) y.push([]); - if ( - ((y[0] = - this.immediateMode.geometry.vertexStrokeColors.slice(-4)), - (y[2] = this.curStrokeColor.slice()), - 4 === l) - ) { - this.isQuadratic = !0; - var i = [ - this.immediateMode._quadraticVertex[0], - arguments.length <= 0 ? void 0 : arguments[0], - arguments.length <= 2 ? void 0 : arguments[2], - ], - a = [ - this.immediateMode._quadraticVertex[1], - arguments.length <= 1 ? void 0 : arguments[1], - arguments.length <= 3 ? void 0 : arguments[3], - ], - g = Math.hypot(i[0] - i[1], a[0] - a[1]); - for ( - g /= g + Math.hypot(i[1] - i[2], a[1] - a[2]), n = 0; - n < 4; - n++ - ) - p[1].push(p[0][n] * (1 - g) + p[2][n] * g), - y[1].push(y[0][n] * (1 - g) + y[2][n] * g); - for (o = 0; o < f; o++) { - for ( - this.curFillColor = [0, 0, 0, 0], - this.curStrokeColor = [0, 0, 0, 0], - m = e = t = 0; - m < 3; - m++ - ) { - for (n = 0; n < 4; n++) - (this.curFillColor[n] += - this._lookUpTableQuadratic[o][m] * p[m][n]), - (this.curStrokeColor[n] += - this._lookUpTableQuadratic[o][m] * y[m][n]); - (e += i[m] * this._lookUpTableQuadratic[o][m]), - (t += a[m] * this._lookUpTableQuadratic[o][m]); - } - this.vertex(e, t); - } - (this.curFillColor = p[2]), - (this.curStrokeColor = y[2]), - (this.immediateMode._quadraticVertex[0] = - arguments.length <= 2 ? void 0 : arguments[2]), - (this.immediateMode._quadraticVertex[1] = - arguments.length <= 3 ? void 0 : arguments[3]); - } else if (6 === l) { - (this.isQuadratic = !0), - (i = [ - this.immediateMode._quadraticVertex[0], - arguments.length <= 0 ? void 0 : arguments[0], - arguments.length <= 3 ? void 0 : arguments[3], - ]), - (a = [ - this.immediateMode._quadraticVertex[1], - arguments.length <= 1 ? void 0 : arguments[1], - arguments.length <= 4 ? void 0 : arguments[4], - ]); - var v = [ - this.immediateMode._quadraticVertex[2], - arguments.length <= 2 ? void 0 : arguments[2], - arguments.length <= 5 ? void 0 : arguments[5], - ], - b = Math.hypot(i[0] - i[1], a[0] - a[1], v[0] - v[1]); - for ( - b /= b + Math.hypot(i[1] - i[2], a[1] - a[2], v[1] - v[2]), - n = 0; - n < 4; - n++ - ) - p[1].push(p[0][n] * (1 - b) + p[2][n] * b), - y[1].push(y[0][n] * (1 - b) + y[2][n] * b); - for (o = 0; o < f; o++) { - for ( - this.curFillColor = [0, 0, 0, 0], - this.curStrokeColor = [0, 0, 0, 0], - m = e = t = r = 0; - m < 3; - m++ - ) { - for (n = 0; n < 4; n++) - (this.curFillColor[n] += - this._lookUpTableQuadratic[o][m] * p[m][n]), - (this.curStrokeColor[n] += - this._lookUpTableQuadratic[o][m] * y[m][n]); - (e += i[m] * this._lookUpTableQuadratic[o][m]), - (t += a[m] * this._lookUpTableQuadratic[o][m]), - (r += v[m] * this._lookUpTableQuadratic[o][m]); - } - this.vertex(e, t, r); - } - (this.curFillColor = p[2]), - (this.curStrokeColor = y[2]), - (this.immediateMode._quadraticVertex[0] = - arguments.length <= 3 ? void 0 : arguments[3]), - (this.immediateMode._quadraticVertex[1] = - arguments.length <= 4 ? void 0 : arguments[4]), - (this.immediateMode._quadraticVertex[2] = - arguments.length <= 5 ? void 0 : arguments[5]); - } - }), - (S.default.RendererGL.prototype.curveVertex = function () { - var e, - t, - r, - o, - n, - s, - i = [], - a = [], - l = arguments.length; - if ( - 0 === this._lookUpTableBezier.length || - this._lutBezierDetail !== this._pInst._curveDetail - ) { - (this._lookUpTableBezier = []), - (this._lutBezierDetail = this._pInst._curveDetail); - for ( - var u = 1 / this._lutBezierDetail, c = 0, d = 1, h = 0; - c < 1; - - ) { - if ( - ((s = parseFloat(c.toFixed(6))), - (this._lookUpTableBezier[h] = this._bezierCoefficients(s)), - d.toFixed(6) === u.toFixed(6)) - ) { - (s = parseFloat(d.toFixed(6)) + parseFloat(c.toFixed(6))), - ++h, - (this._lookUpTableBezier[h] = - this._bezierCoefficients(s)); - break; - } - (c += u), (d -= u), ++h; - } - } - var f = this._lookUpTableBezier.length; - if (2 === l) { - if ( - (this.immediateMode._curveVertex.push( - arguments.length <= 0 ? void 0 : arguments[0], - ), - this.immediateMode._curveVertex.push( - arguments.length <= 1 ? void 0 : arguments[1], - ), - 8 === this.immediateMode._curveVertex.length) - ) { - for ( - this.isCurve = !0, - i = this._bezierToCatmull([ - this.immediateMode._curveVertex[0], - this.immediateMode._curveVertex[2], - this.immediateMode._curveVertex[4], - this.immediateMode._curveVertex[6], - ]), - a = this._bezierToCatmull([ - this.immediateMode._curveVertex[1], - this.immediateMode._curveVertex[3], - this.immediateMode._curveVertex[5], - this.immediateMode._curveVertex[7], - ]), - n = 0; - n < f; - n++ - ) - (t = - i[0] * this._lookUpTableBezier[n][0] + - i[1] * this._lookUpTableBezier[n][1] + - i[2] * this._lookUpTableBezier[n][2] + - i[3] * this._lookUpTableBezier[n][3]), - (r = - a[0] * this._lookUpTableBezier[n][0] + - a[1] * this._lookUpTableBezier[n][1] + - a[2] * this._lookUpTableBezier[n][2] + - a[3] * this._lookUpTableBezier[n][3]), - this.vertex(t, r); - for (n = 0; n < l; n++) - this.immediateMode._curveVertex.shift(); - } - } else if ( - 3 === l && - (this.immediateMode._curveVertex.push( - arguments.length <= 0 ? void 0 : arguments[0], - ), - this.immediateMode._curveVertex.push( - arguments.length <= 1 ? void 0 : arguments[1], - ), - this.immediateMode._curveVertex.push( - arguments.length <= 2 ? void 0 : arguments[2], - ), - 12 === this.immediateMode._curveVertex.length) - ) { - for ( - this.isCurve = !0, - i = this._bezierToCatmull([ - this.immediateMode._curveVertex[0], - this.immediateMode._curveVertex[3], - this.immediateMode._curveVertex[6], - this.immediateMode._curveVertex[9], - ]), - a = this._bezierToCatmull([ - this.immediateMode._curveVertex[1], - this.immediateMode._curveVertex[4], - this.immediateMode._curveVertex[7], - this.immediateMode._curveVertex[10], - ]), - e = this._bezierToCatmull([ - this.immediateMode._curveVertex[2], - this.immediateMode._curveVertex[5], - this.immediateMode._curveVertex[8], - this.immediateMode._curveVertex[11], - ]), - n = 0; - n < f; - n++ - ) - (t = - i[0] * this._lookUpTableBezier[n][0] + - i[1] * this._lookUpTableBezier[n][1] + - i[2] * this._lookUpTableBezier[n][2] + - i[3] * this._lookUpTableBezier[n][3]), - (r = - a[0] * this._lookUpTableBezier[n][0] + - a[1] * this._lookUpTableBezier[n][1] + - a[2] * this._lookUpTableBezier[n][2] + - a[3] * this._lookUpTableBezier[n][3]), - (o = - e[0] * this._lookUpTableBezier[n][0] + - e[1] * this._lookUpTableBezier[n][1] + - e[2] * this._lookUpTableBezier[n][2] + - e[3] * this._lookUpTableBezier[n][3]), - this.vertex(t, r, o); - for (n = 0; n < l; n++) this.immediateMode._curveVertex.shift(); - } - }), - (S.default.RendererGL.prototype.image = function ( - e, - t, - r, - o, - n, - s, - i, - a, - l, - ) { - this._isErasing && this.blendMode(this._cachedBlendMode), - this._pInst.push(), - this._pInst.noLights(), - this._pInst.noStroke(), - this._pInst.texture(e), - this._pInst.textureMode(_.NORMAL); - var u = 0, - c = (t <= e.width && (u = t / e.width), 1), - t = (t + o <= e.width && (c = (t + o) / e.width), 0), - o = (r <= e.height && (t = r / e.height), 1); - r + n <= e.height && (o = (r + n) / e.height), - this.beginShape(), - this.vertex(s, i, 0, u, t), - this.vertex(s + a, i, 0, c, t), - this.vertex(s + a, i + l, 0, c, o), - this.vertex(s, i + l, 0, u, o), - this.endShape(_.CLOSE), - this._pInst.pop(), - this._isErasing && this.blendMode(_.REMOVE); - }); - var n = S.default; - r.default = n; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.Geometry": 327, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.math.hypot": 170, - "core-js/modules/es.math.sign": 172, - "core-js/modules/es.number.to-fixed": 175, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 319: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.every"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.every"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.object.assign"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var n = (c = e("../core/main")) && c.__esModule ? c : { default: c }, - a = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = l(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function l() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (l = function () { - return e; - }), - e); - } - function s(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - function u(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - var c = (function () { - function t(e) { - if (!(this instanceof t)) - throw new TypeError("Cannot call a class as a function"); - (this.renderer = e)._pInst.push(), - (this.identityMatrix = new n.default.Matrix()), - (e.uMVMatrix = new n.default.Matrix()), - (this.geometry = new n.default.Geometry()), - (this.geometry.gid = "_p5_GeometryBuilder_".concat( - t.nextGeometryId, - )), - t.nextGeometryId++, - (this.hasTransform = !1); - } - var e, r, o; - return ( - (e = t), - (r = [ - { - key: "transformVertices", - value: function (e) { - var t = this; - return this.hasTransform - ? e.map(function (e) { - return t.renderer.uMVMatrix.multiplyPoint(e); - }) - : e; - }, - }, - { - key: "transformNormals", - value: function (e) { - var t = this; - return this.hasTransform - ? e.map(function (e) { - return t.renderer.uNMatrix.multiplyVec3(e); - }) - : e; - }, - }, - { - key: "addGeometry", - value: function (e) { - for ( - var t, - r = this, - o = - ((this.hasTransform = - !this.renderer.uMVMatrix.mat4.every( - function (e, t) { - return e === r.identityMatrix.mat4[t]; - }, - )), - this.hasTransform && - this.renderer.uNMatrix.inverseTranspose( - this.renderer.uMVMatrix, - ), - this.geometry.vertices.length), - n = - ((t = this.geometry.vertices).push.apply( - t, - s(this.transformVertices(e.vertices)), - ), - (t = this.geometry.vertexNormals).push.apply( - t, - s(this.transformNormals(e.vertexNormals)), - ), - (t = this.geometry.uvs).push.apply(t, s(e.uvs)), - this.renderer._doFill && - (t = this.geometry.faces).push.apply( - t, - s( - e.faces.map(function (e) { - return e.map(function (e) { - return e + o; - }); - }), - ), - ), - this.renderer._doStroke && - (t = this.geometry.edges).push.apply( - t, - s( - e.edges.map(function (e) { - return e.map(function (e) { - return e + o; - }); - }), - ), - ), - s(e.vertexColors)); - n.length < 4 * e.vertices.length; - - ) - n.push.apply(n, s(this.renderer.curFillColor)); - (t = this.geometry.vertexColors).push.apply(t, s(n)); - }, - }, - { - key: "addImmediate", - value: function () { - var e = this.renderer.immediateMode.geometry, - t = this.renderer.immediateMode.shapeMode, - r = []; - if (this.renderer._doFill) - if (t === a.TRIANGLE_STRIP || t === a.QUAD_STRIP) - for (var o = 2; o < e.vertices.length; o++) - o % 2 == 0 - ? r.push([o, o - 1, o - 2]) - : r.push([o, o - 2, o - 1]); - else if (t === a.TRIANGLE_FAN) - for (var n = 2; n < e.vertices.length; n++) - r.push([0, n - 1, n]); - else - for (var s = 0; s < e.vertices.length; s += 3) - r.push([s, s + 1, s + 2]); - this.addGeometry(Object.assign({}, e, { faces: r })); - }, - }, - { - key: "addRetained", - value: function (e) { - this.addGeometry(e.model); - }, - }, - { - key: "finish", - value: function () { - return this.renderer._pInst.pop(), this.geometry; - }, - }, - ]) && u(e.prototype, r), - o && u(e, o), - t - ); - })(); - (c.nextGeometryId = 0), (r.default = c); - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.every": 153, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.object.assign": 176, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 320: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.math.sign"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.math.sign"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var g = (s = e("../core/main")) && s.__esModule ? s : { default: s }, - n = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== v(e) && "function" != typeof e)) - return { default: e }; - var t = i(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function i() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (i = function () { - return e; - }), - e); - } - function v(e) { - return (v = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - (g.default.prototype.orbitControl = function (e, t, r, o) { - var n = this, - s = - (this._assert3d("orbitControl"), - g.default._validateParameters("orbitControl", arguments), - this._renderer._curCamera); - void 0 === e && (e = 1), - void 0 === t && (t = e), - void 0 === r && (r = 1), - "object" !== v(o) && (o = {}), - !0 !== this.contextMenuDisabled && - ((this.canvas.oncontextmenu = function () { - return !1; - }), - this._setProperty("contextMenuDisabled", !0)), - !0 !== this.wheelDefaultDisabled && - ((this.canvas.onwheel = function () { - return !1; - }), - this._setProperty("wheelDefaultDisabled", !0)); - var i = o.disableTouchActions; - !0 === this.touchActionsDisabled || - (void 0 !== i && !i) || - ((this.canvas.style["touch-action"] = "none"), - this._setProperty("touchActionsDisabled", !0)); - var a, - l, - u, - i = o.freeRotation, - o = void 0 !== i && i, - c = [], - i = - (this.touches.forEach(function (t) { - n._renderer.prevTouches.forEach(function (e) { - t.id === e.id && - ((e = { x: t.x, y: t.y, px: e.x, py: e.y }), c.push(e)); - }); - }), - (this._renderer.prevTouches = this.touches), - 0), - d = 0, - h = 0, - f = 0, - p = 0, - m = this.height < this.width ? this.height : this.width, - y = !1; - return ( - 0 < c.length - ? ((y = - 0 < c[0].x && - c[0].x < this.width && - 0 < c[0].y && - c[0].y < this.height), - 1 === c.length - ? ((d = (-e * ((a = c[0]).x - a.px)) / m), - (h = (t * (a.y - a.py)) / m)) - : ((a = c[0]), - (l = c[1]), - (i = - -( - Math.hypot(a.x - l.x, a.y - l.y) - - Math.hypot(a.px - l.px, a.py - l.py) - ) * - r * - 4e-4), - (f = 0.5 * (a.x + l.x) - 0.5 * (a.px + l.px)), - (p = 0.5 * (a.y + l.y) - 0.5 * (a.py + l.py))), - 0 < this.touches.length - ? y && - ((this._renderer.executeRotateAndMove = !0), - (this._renderer.executeZoom = !0)) - : ((this._renderer.executeRotateAndMove = !1), - (this._renderer.executeZoom = !1))) - : ((y = - 0 < this.mouseX && - this.mouseX < this.width && - 0 < this.mouseY && - this.mouseY < this.height), - 0 !== this._mouseWheelDeltaY - ? ((i = Math.sign(this._mouseWheelDeltaY) * r), - (i *= 0.01), - (this._mouseWheelDeltaY = 0), - y && (this._renderer.executeZoom = !0)) - : (this._renderer.zoomFlag = !1), - this.mouseIsPressed - ? (this.mouseButton === this.LEFT - ? ((d = (-e * this.movedX) / m), - (h = (t * this.movedY) / m)) - : this.mouseButton === this.RIGHT && - ((f = this.movedX), (p = this.movedY * s.yScale)), - y && (this._renderer.executeRotateAndMove = !0)) - : (this._renderer.executeRotateAndMove = !1)), - 0 !== i && - this._renderer.executeZoom && - (this._renderer.zoomVelocity += i), - 0.001 < Math.abs(this._renderer.zoomVelocity) - ? (o - ? s._orbitFree(0, 0, this._renderer.zoomVelocity) - : s._orbit(0, 0, this._renderer.zoomVelocity), - 0 !== s.projMatrix.mat4[15] && - ((s.projMatrix.mat4[0] *= Math.pow( - 10, - -this._renderer.zoomVelocity, - )), - (s.projMatrix.mat4[5] *= Math.pow( - 10, - -this._renderer.zoomVelocity, - )), - (this._renderer.uPMatrix.mat4[0] = s.projMatrix.mat4[0]), - (this._renderer.uPMatrix.mat4[5] = s.projMatrix.mat4[5])), - (this._renderer.zoomVelocity *= 0.85)) - : (this._renderer.zoomVelocity = 0), - (0 === d && 0 === h) || - !this._renderer.executeRotateAndMove || - this._renderer.rotateVelocity.add(0.6 * d, 0.6 * h), - 1e-6 < this._renderer.rotateVelocity.magSq() - ? (o - ? s._orbitFree( - -this._renderer.rotateVelocity.x, - this._renderer.rotateVelocity.y, - 0, - ) - : s._orbit( - this._renderer.rotateVelocity.x, - this._renderer.rotateVelocity.y, - 0, - ), - this._renderer.rotateVelocity.mult(0.85)) - : this._renderer.rotateVelocity.set(0, 0), - (0 === f && 0 === p) || - !this._renderer.executeRotateAndMove || - ((a = (2 * f) / this.width), - (l = (2 * -p) / this.height), - this._renderer.moveVelocity.add(0.15 * a, 0.15 * l)), - 1e-6 < this._renderer.moveVelocity.magSq() - ? ((r = s._getLocalAxes()), - (e = s.eyeX - s.centerX), - (t = s.eyeY - s.centerY), - (m = s.eyeZ - s.centerZ), - (y = Math.sqrt(e * e + t * t + m * m)), - (i = new g.default.Vector(s.centerX, s.centerY, s.centerZ)), - (i = s.cameraMatrix.multiplyPoint(i)), - ((i = - this._renderer.uPMatrix.multiplyAndNormalizePoint(i)).x -= - this._renderer.moveVelocity.x), - (i.y -= this._renderer.moveVelocity.y), - (h = - 0 === (d = this._renderer.uPMatrix.mat4)[15] - ? ((u = ((d[8] + i.x) / d[0]) * y), - ((d[9] + i.y) / d[5]) * y) - : ((u = (i.x - d[12]) / d[0]), (i.y - d[13]) / d[5])), - s.setPosition( - s.eyeX + u * r.x[0] + h * r.y[0], - s.eyeY + u * r.x[1] + h * r.y[1], - s.eyeZ + u * r.x[2] + h * r.y[2], - ), - this._renderer.moveVelocity.mult(0.85)) - : this._renderer.moveVelocity.set(0, 0), - this - ); - }), - (g.default.prototype.debugMode = function () { - this._assert3d("debugMode"); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - g.default._validateParameters("debugMode", t); - for (var o = this._registeredMethods.post.length - 1; 0 <= o; o--) - (this._registeredMethods.post[o].toString() !== - this._grid().toString() && - this._registeredMethods.post[o].toString() !== - this._axesIcon().toString()) || - this._registeredMethods.post.splice(o, 1); - t[0] === n.GRID - ? this.registerMethod( - "post", - this._grid.call(this, t[1], t[2], t[3], t[4], t[5]), - ) - : t[0] === n.AXES - ? this.registerMethod( - "post", - this._axesIcon.call(this, t[1], t[2], t[3], t[4]), - ) - : (this.registerMethod( - "post", - this._grid.call(this, t[0], t[1], t[2], t[3], t[4]), - ), - this.registerMethod( - "post", - this._axesIcon.call(this, t[5], t[6], t[7], t[8]), - )); - }), - (g.default.prototype.noDebugMode = function () { - this._assert3d("noDebugMode"); - for (var e = this._registeredMethods.post.length - 1; 0 <= e; e--) - (this._registeredMethods.post[e].toString() !== - this._grid().toString() && - this._registeredMethods.post[e].toString() !== - this._axesIcon().toString()) || - this._registeredMethods.post.splice(e, 1); - }), - (g.default.prototype._grid = function (e, r, o, n, s) { - void 0 === e && (e = this.width / 2), - void 0 === r && - (r = Math.round(e / 30) < 4 ? 4 : Math.round(e / 30)), - void 0 === o && (o = 0), - void 0 === n && (n = 0), - void 0 === s && (s = 0); - var i = e / r, - a = e / 2; - return function () { - this.push(), - this.stroke( - 255 * this._renderer.curStrokeColor[0], - 255 * this._renderer.curStrokeColor[1], - 255 * this._renderer.curStrokeColor[2], - ), - this._renderer.uMVMatrix.set( - this._renderer._curCamera.cameraMatrix.mat4[0], - this._renderer._curCamera.cameraMatrix.mat4[1], - this._renderer._curCamera.cameraMatrix.mat4[2], - this._renderer._curCamera.cameraMatrix.mat4[3], - this._renderer._curCamera.cameraMatrix.mat4[4], - this._renderer._curCamera.cameraMatrix.mat4[5], - this._renderer._curCamera.cameraMatrix.mat4[6], - this._renderer._curCamera.cameraMatrix.mat4[7], - this._renderer._curCamera.cameraMatrix.mat4[8], - this._renderer._curCamera.cameraMatrix.mat4[9], - this._renderer._curCamera.cameraMatrix.mat4[10], - this._renderer._curCamera.cameraMatrix.mat4[11], - this._renderer._curCamera.cameraMatrix.mat4[12], - this._renderer._curCamera.cameraMatrix.mat4[13], - this._renderer._curCamera.cameraMatrix.mat4[14], - this._renderer._curCamera.cameraMatrix.mat4[15], - ); - for (var e = 0; e <= r; e++) - this.beginShape(this.LINES), - this.vertex(-a + o, n, e * i - a + s), - this.vertex(a + o, n, e * i - a + s), - this.endShape(); - for (var t = 0; t <= r; t++) - this.beginShape(this.LINES), - this.vertex(t * i - a + o, n, -a + s), - this.vertex(t * i - a + o, n, a + s), - this.endShape(); - this.pop(); - }; - }), - (g.default.prototype._axesIcon = function (e, t, r, o) { - return ( - void 0 === e && - (e = 40 < this.width / 20 ? this.width / 20 : 40), - void 0 === t && (t = -this.width / 4), - void 0 === r && (r = t), - void 0 === o && (o = t), - function () { - this.push(), - this._renderer.uMVMatrix.set( - this._renderer._curCamera.cameraMatrix.mat4[0], - this._renderer._curCamera.cameraMatrix.mat4[1], - this._renderer._curCamera.cameraMatrix.mat4[2], - this._renderer._curCamera.cameraMatrix.mat4[3], - this._renderer._curCamera.cameraMatrix.mat4[4], - this._renderer._curCamera.cameraMatrix.mat4[5], - this._renderer._curCamera.cameraMatrix.mat4[6], - this._renderer._curCamera.cameraMatrix.mat4[7], - this._renderer._curCamera.cameraMatrix.mat4[8], - this._renderer._curCamera.cameraMatrix.mat4[9], - this._renderer._curCamera.cameraMatrix.mat4[10], - this._renderer._curCamera.cameraMatrix.mat4[11], - this._renderer._curCamera.cameraMatrix.mat4[12], - this._renderer._curCamera.cameraMatrix.mat4[13], - this._renderer._curCamera.cameraMatrix.mat4[14], - this._renderer._curCamera.cameraMatrix.mat4[15], - ), - this.strokeWeight(2), - this.stroke(255, 0, 0), - this.beginShape(this.LINES), - this.vertex(t, r, o), - this.vertex(t + e, r, o), - this.endShape(), - this.stroke(0, 255, 0), - this.beginShape(this.LINES), - this.vertex(t, r, o), - this.vertex(t, r + e, o), - this.endShape(), - this.stroke(0, 0, 255), - this.beginShape(this.LINES), - this.vertex(t, r, o), - this.vertex(t, r, o + e), - this.endShape(), - this.pop(); - } - ); - }); - var s = g.default; - r.default = s; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.math.hypot": 170, - "core-js/modules/es.math.sign": 172, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 321: [ - function (e, t, r) { - "use strict"; - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var m = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - (m.default.prototype.ambientLight = function (e, t, r, o) { - this._assert3d("ambientLight"), - m.default._validateParameters("ambientLight", arguments); - var n = this.color.apply(this, arguments); - return ( - this._renderer.ambientLightColors.push( - n._array[0], - n._array[1], - n._array[2], - ), - (this._renderer._enableLighting = !0), - this - ); - }), - (m.default.prototype.specularColor = function (e, t, r) { - this._assert3d("specularColor"), - m.default._validateParameters("specularColor", arguments); - var o = this.color.apply(this, arguments); - return ( - (this._renderer.specularColors = [ - o._array[0], - o._array[1], - o._array[2], - ]), - this - ); - }), - (m.default.prototype.directionalLight = function ( - e, - t, - r, - o, - n, - s, - ) { - this._assert3d("directionalLight"), - m.default._validateParameters("directionalLight", arguments), - (e = e instanceof m.default.Color ? e : this.color(e, t, r)); - var i, - a, - t = arguments[arguments.length - 1], - r = - "number" == typeof t - ? ((i = arguments[arguments.length - 3]), - (a = arguments[arguments.length - 2]), - arguments[arguments.length - 1]) - : ((i = t.x), (a = t.y), t.z), - t = Math.sqrt(i * i + a * a + r * r); - return ( - this._renderer.directionalLightDirections.push( - i / t, - a / t, - r / t, - ), - this._renderer.directionalLightDiffuseColors.push( - e._array[0], - e._array[1], - e._array[2], - ), - Array.prototype.push.apply( - this._renderer.directionalLightSpecularColors, - this._renderer.specularColors, - ), - (this._renderer._enableLighting = !0), - this - ); - }), - (m.default.prototype.pointLight = function (e, t, r, o, n, s) { - this._assert3d("pointLight"), - m.default._validateParameters("pointLight", arguments), - (e = e instanceof m.default.Color ? e : this.color(e, t, r)); - var i, - a, - t = arguments[arguments.length - 1], - r = - "number" == typeof t - ? ((i = arguments[arguments.length - 3]), - (a = arguments[arguments.length - 2]), - arguments[arguments.length - 1]) - : ((i = t.x), (a = t.y), t.z); - return ( - this._renderer.pointLightPositions.push(i, a, r), - this._renderer.pointLightDiffuseColors.push( - e._array[0], - e._array[1], - e._array[2], - ), - Array.prototype.push.apply( - this._renderer.pointLightSpecularColors, - this._renderer.specularColors, - ), - (this._renderer._enableLighting = !0), - this - ); - }), - (m.default.prototype.imageLight = function (e) { - (this._renderer.activeImageLight = e), - (this._renderer._enableLighting = !0); - }), - (m.default.prototype.lights = function () { - this._assert3d("lights"); - var e = this.color("rgb(128,128,128)"); - return ( - this.ambientLight(e), this.directionalLight(e, 0, 0, -1), this - ); - }), - (m.default.prototype.lightFalloff = function (e, t, r) { - return ( - this._assert3d("lightFalloff"), - m.default._validateParameters("lightFalloff", arguments), - e < 0 && - ((e = 0), - console.warn( - "Value of constant argument in lightFalloff() should be never be negative. Set to 0.", - )), - t < 0 && - ((t = 0), - console.warn( - "Value of linear argument in lightFalloff() should be never be negative. Set to 0.", - )), - r < 0 && - ((r = 0), - console.warn( - "Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.", - )), - 0 === e && - 0 === t && - 0 === r && - ((e = 1), - console.warn( - "Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.", - )), - (this._renderer.constantAttenuation = e), - (this._renderer.linearAttenuation = t), - (this._renderer.quadraticAttenuation = r), - this - ); - }), - (m.default.prototype.spotLight = function ( - e, - t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - ) { - this._assert3d("spotLight"), - m.default._validateParameters("spotLight", arguments); - var d, - h, - f, - p = arguments.length; - switch (p) { - case 11: - case 10: - (d = this.color(e, t, r)), - (h = new m.default.Vector(o, n, s)), - (f = new m.default.Vector(i, a, l)); - break; - case 9: - e instanceof m.default.Color - ? ((d = e), - (h = new m.default.Vector(t, r, o)), - (f = new m.default.Vector(n, s, i)), - (u = a), - (c = l)) - : o instanceof m.default.Vector - ? ((d = this.color(e, t, r)), - (h = o), - (f = new m.default.Vector(n, s, i)), - (u = a), - (c = l)) - : i instanceof m.default.Vector - ? ((d = this.color(e, t, r)), - (h = new m.default.Vector(o, n, s)), - (f = i), - (u = a), - (c = l)) - : ((d = this.color(e, t, r)), - (h = new m.default.Vector(o, n, s)), - (f = new m.default.Vector(i, a, l))); - break; - case 8: - u = - ((f = - e instanceof m.default.Color - ? ((d = e), - (h = new m.default.Vector(t, r, o)), - new m.default.Vector(n, s, i)) - : o instanceof m.default.Vector - ? ((d = this.color(e, t, r)), - (h = o), - new m.default.Vector(n, s, i)) - : ((d = this.color(e, t, r)), - (h = new m.default.Vector(o, n, s)), - i)), - a); - break; - case 7: - e instanceof m.default.Color && t instanceof m.default.Vector - ? ((d = e), - (h = t), - (f = new m.default.Vector(r, o, n)), - (u = s), - (c = i)) - : e instanceof m.default.Color && - n instanceof m.default.Vector - ? ((d = e), - (h = new m.default.Vector(t, r, o)), - (f = n), - (u = s), - (c = i)) - : o instanceof m.default.Vector && - n instanceof m.default.Vector - ? ((d = this.color(e, t, r)), - (h = o), - (f = n), - (u = s), - (c = i)) - : (f = - e instanceof m.default.Color - ? ((d = e), - (h = new m.default.Vector(t, r, o)), - new m.default.Vector(n, s, i)) - : o instanceof m.default.Vector - ? ((d = this.color(e, t, r)), - (h = o), - new m.default.Vector(n, s, i)) - : ((d = this.color(e, t, r)), - (h = new m.default.Vector(o, n, s)), - i)); - break; - case 6: - o instanceof m.default.Vector && n instanceof m.default.Vector - ? ((d = this.color(e, t, r)), (h = o), (f = n), (u = s)) - : e instanceof m.default.Color && - n instanceof m.default.Vector - ? ((d = e), - (h = new m.default.Vector(t, r, o)), - (f = n), - (u = s)) - : e instanceof m.default.Color && - t instanceof m.default.Vector && - ((d = e), - (h = t), - (f = new m.default.Vector(r, o, n)), - (u = s)); - break; - case 5: - e instanceof m.default.Color && - t instanceof m.default.Vector && - r instanceof m.default.Vector - ? ((d = e), (h = t), (f = r), (u = o), (c = n)) - : o instanceof m.default.Vector && - n instanceof m.default.Vector - ? ((d = this.color(e, t, r)), (h = o), (f = n)) - : e instanceof m.default.Color && - n instanceof m.default.Vector - ? ((d = e), - (h = new m.default.Vector(t, r, o)), - (f = n)) - : e instanceof m.default.Color && - t instanceof m.default.Vector && - ((d = e), - (h = t), - (f = new m.default.Vector(r, o, n))); - break; - case 4: - (d = e), (h = t), (f = r), (u = o); - break; - case 3: - (d = e), (h = t), (f = r); - break; - default: - return ( - console.warn( - "Sorry, input for spotlight() is not in prescribed format. Too ".concat( - p < 3 ? "few" : "many", - " arguments were provided", - ), - ), - this - ); - } - return ( - this._renderer.spotLightDiffuseColors.push( - d._array[0], - d._array[1], - d._array[2], - ), - Array.prototype.push.apply( - this._renderer.spotLightSpecularColors, - this._renderer.specularColors, - ), - this._renderer.spotLightPositions.push(h.x, h.y, h.z), - f.normalize(), - this._renderer.spotLightDirections.push(f.x, f.y, f.z), - void 0 === u && (u = Math.PI / 3), - void 0 !== c && c < 1 - ? ((c = 1), - console.warn( - "Value of concentration needs to be greater than 1. Setting it to 1", - )) - : void 0 === c && (c = 100), - (u = this._renderer._pInst._toRadians(u)), - this._renderer.spotLightAngle.push(Math.cos(u)), - this._renderer.spotLightConc.push(c), - (this._renderer._enableLighting = !0), - this - ); - }), - (m.default.prototype.noLights = function () { - this._assert3d("noLights"); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - m.default._validateParameters("noLights", t), - (this._renderer._enableLighting = !1), - (this._renderer.ambientLightColors.length = 0), - (this._renderer.specularColors = [1, 1, 1]), - (this._renderer.directionalLightDirections.length = 0), - (this._renderer.directionalLightDiffuseColors.length = 0), - (this._renderer.directionalLightSpecularColors.length = 0), - (this._renderer.pointLightPositions.length = 0), - (this._renderer.pointLightDiffuseColors.length = 0), - (this._renderer.pointLightSpecularColors.length = 0), - (this._renderer.spotLightPositions.length = 0), - (this._renderer.spotLightDirections.length = 0), - (this._renderer.spotLightDiffuseColors.length = 0), - (this._renderer.spotLightSpecularColors.length = 0), - (this._renderer.spotLightAngle.length = 0), - (this._renderer.spotLightConc.length = 0), - (this._renderer.constantAttenuation = 1), - (this._renderer.linearAttenuation = 0), - (this._renderer.quadraticAttenuation = 0), - (this._renderer._useShininess = 1), - this - ); - }); - e = m.default; - r.default = e; - }, - { "../core/main": 275 }, - ], - 322: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.splice"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.match"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.trim"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var x = (o = e("../core/main")) && o.__esModule ? o : { default: o }; - e("./p5.Geometry"), - (x.default.prototype.loadModel = function (e) { - x.default._validateParameters("loadModel", arguments); - var y, - g, - t, - r = e.slice(-4), - v = - ("boolean" == typeof arguments[1] - ? ((y = arguments[1]), - (g = arguments[2]), - (t = arguments[3]), - void 0 !== arguments[4] && (r = arguments[4])) - : ((y = !1), - (g = arguments[1]), - (t = arguments[2]), - void 0 !== arguments[3] && (r = arguments[3])), - new x.default.Geometry()), - b = ((v.gid = "".concat(e, "|").concat(y)), this); - return ( - r.match(/\.stl$/i) - ? this.httpDo( - e, - "GET", - "arrayBuffer", - function (e) { - !(function (e, t) { - if ( - (function (e) { - for ( - var t = new DataView(e), - r = [115, 111, 108, 105, 100], - o = 0; - o < 5; - o++ - ) - if ( - (function (e, t, r) { - for (var o = 0, n = e.length; o < n; o++) - if (e[o] !== t.getUint8(r + o, !1)) - return; - return 1; - })(r, t, o) - ) - return; - return 1; - })(t) - ) - !(function (e, t) { - for ( - var r, - o, - n, - s, - i, - a, - l, - u = new DataView(t), - c = u.getUint32(80, !0), - d = !1, - h = 0; - h < 70; - h++ - ) - 1129270351 === u.getUint32(h, !1) && - 82 === u.getUint8(h + 4) && - 61 === u.getUint8(h + 5) && - ((d = !0), - (s = []), - (i = u.getUint8(h + 6) / 255), - (a = u.getUint8(h + 7) / 255), - (l = u.getUint8(h + 8) / 255)); - for (var f = 0; f < c; f++) { - for ( - var p, - m = 84 + 50 * f, - y = u.getFloat32(m, !0), - g = u.getFloat32(4 + m, !0), - v = u.getFloat32(8 + m, !0), - b = - (d && - ((p = u.getUint16(48 + m, !0)), - (n = - 0 == (32768 & p) - ? ((r = (31 & p) / 31), - (o = ((p >> 5) & 31) / 31), - ((p >> 10) & 31) / 31) - : ((r = i), (o = a), l))), - new x.default.Vector(y, g, v)), - j = 1; - j <= 3; - j++ - ) { - var _ = m + 12 * j, - _ = new x.default.Vector( - u.getFloat32(_, !0), - u.getFloat32(4 + _, !0), - u.getFloat32(8 + _, !0), - ); - e.vertices.push(_), - e.vertexNormals.push(b), - d && s.push(r, o, n); - } - e.faces.push([3 * f, 3 * f + 1, 3 * f + 2]), - e.uvs.push([0, 0], [0, 0], [0, 0]); - } - })(e, t); - else { - t = new DataView(t); - if (!("TextDecoder" in window)) - return console.warn( - "Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)", - ); - t = new TextDecoder("utf-8").decode(t).split("\n"); - !(function (e, t) { - for ( - var r, o, n = "", s = [], i = 0; - i < t.length; - ++i - ) { - for ( - var a = t[i].trim(), l = a.split(" "), u = 0; - u < l.length; - ++u - ) - "" === l[u] && l.splice(u, 1); - if (0 !== l.length) - switch (n) { - case "": - if ("solid" !== l[0]) - return ( - console.error(a), - console.error( - 'Invalid state "'.concat( - l[0], - '", should be "solid"', - ), - ) - ); - n = "solid"; - break; - case "solid": - if ("facet" !== l[0] || "normal" !== l[1]) - return ( - console.error(a), - console.error( - 'Invalid state "'.concat( - l[0], - '", should be "facet normal"', - ), - ) - ); - (r = new x.default.Vector( - parseFloat(l[2]), - parseFloat(l[3]), - parseFloat(l[4]), - )), - e.vertexNormals.push(r, r, r), - (n = "facet normal"); - break; - case "facet normal": - if ("outer" !== l[0] || "loop" !== l[1]) - return ( - console.error(a), - console.error( - 'Invalid state "'.concat( - l[0], - '", should be "outer loop"', - ), - ) - ); - n = "vertex"; - break; - case "vertex": - if ("vertex" === l[0]) - (o = new x.default.Vector( - parseFloat(l[1]), - parseFloat(l[2]), - parseFloat(l[3]), - )), - e.vertices.push(o), - e.uvs.push([0, 0]), - s.push(e.vertices.indexOf(o)); - else { - if ("endloop" !== l[0]) - return ( - console.error(a), - console.error( - 'Invalid state "'.concat( - l[0], - '", should be "vertex" or "endloop"', - ), - ) - ); - e.faces.push(s), - (s = []), - (n = "endloop"); - } - break; - case "endloop": - if ("endfacet" !== l[0]) - return ( - console.error(a), - console.error( - 'Invalid state "'.concat( - l[0], - '", should be "endfacet"', - ), - ) - ); - n = "endfacet"; - break; - case "endfacet": - if ("endsolid" !== l[0]) { - if ( - "facet" !== l[0] || - "normal" !== l[1] - ) - return ( - console.error(a), - console.error( - 'Invalid state "'.concat( - l[0], - '", should be "endsolid" or "facet normal"', - ), - ) - ); - (r = new x.default.Vector( - parseFloat(l[2]), - parseFloat(l[3]), - parseFloat(l[4]), - )), - e.vertexNormals.push(r, r, r), - (n = "facet normal"); - } - break; - default: - console.error( - 'Invalid state "'.concat(n, '"'), - ); - } - } - })(e, t); - } - })(v, e), - y && v.normalize(), - b._decrementPreload(), - "function" == typeof g && g(v); - }, - t, - ) - : r.match(/\.obj$/i) - ? this.loadStrings( - e, - function (e) { - for ( - var t = v, - r = e, - o = { v: [], vt: [], vn: [] }, - n = {}, - s = 0; - s < r.length; - ++s - ) { - var i = r[s].trim().split(/\b\s+/); - if (0 < i.length) - if ("v" === i[0] || "vn" === i[0]) { - var a = new x.default.Vector( - parseFloat(i[1]), - parseFloat(i[2]), - parseFloat(i[3]), - ); - o[i[0]].push(a); - } else if ("vt" === i[0]) { - a = [parseFloat(i[1]), 1 - parseFloat(i[2])]; - o[i[0]].push(a); - } else if ("f" === i[0]) - for (var l = 3; l < i.length; ++l) { - for ( - var u = [], c = [1, l - 1, l], d = 0; - d < c.length; - ++d - ) { - var h = i[c[d]], - f = 0; - if (void 0 !== n[h]) f = n[h]; - else { - for ( - var p = h.split("/"), m = 0; - m < p.length; - m++ - ) - p[m] = parseInt(p[m]) - 1; - (f = n[h] = t.vertices.length), - t.vertices.push(o.v[p[0]].copy()), - o.vt[p[1]] - ? t.uvs.push(o.vt[p[1]].slice()) - : t.uvs.push([0, 0]), - o.vn[p[2]] && - t.vertexNormals.push( - o.vn[p[2]].copy(), - ); - } - u.push(f); - } - u[0] !== u[1] && - u[0] !== u[2] && - u[1] !== u[2] && - t.faces.push(u); - } - } - 0 === t.vertexNormals.length && t.computeNormals(), - y && v.normalize(), - b._decrementPreload(), - "function" == typeof g && g(v); - }, - t, - ) - : (x.default._friendlyFileLoadError(3, e), - t - ? t() - : x.default._friendlyError( - "Sorry, the file type is invalid. Only OBJ and STL files are supported.", - )), - v - ); - }), - (x.default.prototype.model = function (e) { - this._assert3d("model"), - x.default._validateParameters("model", arguments), - 0 < e.vertices.length && - (this._renderer.geometryInHash(e.gid) || - (0 === e.edges.length && e._makeTriangleEdges(), - e._edgesToVertices(), - this._renderer.createBuffers(e.gid, e)), - this._renderer.drawBuffers(e.gid)); - }); - var o = x.default; - r.default = o; - }, - { - "../core/main": 275, - "./p5.Geometry": 327, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.splice": 167, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.match": 193, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.trim": 201, - }, - ], - 323: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.join"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var u = (s = e("../core/main")) && s.__esModule ? s : { default: s }, - n = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - e("./p5.Texture"), - (u.default.prototype.loadShader = function (e, t, r, o) { - u.default._validateParameters("loadShader", arguments), - (o = o || console.error); - function n() { - i._decrementPreload(), r && r(s); - } - var s = new u.default.Shader(), - i = this, - a = !1, - l = !1; - return ( - this.loadStrings( - e, - function (e) { - (s._vertSrc = e.join("\n")), (l = !0), a && n(); - }, - o, - ), - this.loadStrings( - t, - function (e) { - (s._fragSrc = e.join("\n")), (a = !0), l && n(); - }, - o, - ), - s - ); - }), - (u.default.prototype.createShader = function (e, t) { - return ( - u.default._validateParameters("createShader", arguments), - new u.default.Shader(this._renderer, e, t) - ); - }), - (u.default.prototype.createFilterShader = function (e) { - u.default._validateParameters("createFilterShader", arguments); - var t = e.includes("#version 300 es") - ? "#version 300 es\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n in vec3 aPosition;\n in vec2 aTexCoord;\n out vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n " - : "\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n attribute vec3 aPosition;\n // texcoords only come from p5 to vertex shader\n // so pass texcoords on to the fragment shader in a varying variable\n attribute vec2 aTexCoord;\n varying vec2 vTexCoord;\n\n void main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // project to 3D space\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n }\n ", - t = new u.default.Shader(this._renderer, t, e); - return ( - this._renderer.GL - ? t.ensureCompiledOnContext(this) - : t.ensureCompiledOnContext( - this._renderer.getFilterGraphicsLayer(), - ), - t - ); - }), - (u.default.prototype.shader = function (e) { - return ( - this._assert3d("shader"), - u.default._validateParameters("shader", arguments), - e.ensureCompiledOnContext(this), - e.isStrokeShader() - ? (this._renderer.userStrokeShader = e) - : ((this._renderer.userFillShader = e), - (this._renderer._useNormalMaterial = !1)), - this - ); - }), - (u.default.prototype.resetShader = function () { - return ( - (this._renderer.userFillShader = - this._renderer.userStrokeShader = - null), - this - ); - }), - (u.default.prototype.texture = function (e) { - return ( - this._assert3d("texture"), - u.default._validateParameters("texture", arguments), - e.gifProperties && e._animateGif(this), - (this._renderer.drawMode = n.TEXTURE), - (this._renderer._useNormalMaterial = !1), - (this._renderer._tex = e), - this._renderer._setProperty("_doFill", !0), - this - ); - }), - (u.default.prototype.textureMode = function (e) { - e !== n.IMAGE && e !== n.NORMAL - ? console.warn( - "You tried to set ".concat( - e, - " textureMode only supports IMAGE & NORMAL ", - ), - ) - : (this._renderer.textureMode = e); - }), - (u.default.prototype.textureWrap = function (e) { - var t = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : e, - r = - ((this._renderer.textureWrapX = e), - (this._renderer.textureWrapY = t), - !0), - o = !1, - n = void 0; - try { - for ( - var s, - i = this._renderer.textures.values()[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) - s.value.setWrapMode(e, t); - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - }), - (u.default.prototype.normalMaterial = function () { - this._assert3d("normalMaterial"); - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - return ( - u.default._validateParameters("normalMaterial", t), - (this._renderer.drawMode = n.FILL), - (this._renderer._useSpecularMaterial = !1), - (this._renderer._useEmissiveMaterial = !1), - (this._renderer._useNormalMaterial = !0), - (this._renderer.curFillColor = [1, 1, 1, 1]), - this._renderer._setProperty("_doFill", !0), - this.noStroke(), - this - ); - }), - (u.default.prototype.ambientMaterial = function (e, t, r) { - this._assert3d("ambientMaterial"), - u.default._validateParameters("ambientMaterial", arguments); - var o = u.default.prototype.color.apply(this, arguments); - return ( - (this._renderer._hasSetAmbient = !0), - (this._renderer.curAmbientColor = o._array), - (this._renderer._useNormalMaterial = !1), - (this._renderer._enableLighting = !0), - this._renderer._setProperty("_doFill", !0), - this - ); - }), - (u.default.prototype.emissiveMaterial = function (e, t, r, o) { - this._assert3d("emissiveMaterial"), - u.default._validateParameters("emissiveMaterial", arguments); - var n = u.default.prototype.color.apply(this, arguments); - return ( - (this._renderer.curEmissiveColor = n._array), - (this._renderer._useEmissiveMaterial = !0), - (this._renderer._useNormalMaterial = !1), - (this._renderer._enableLighting = !0), - this - ); - }), - (u.default.prototype.specularMaterial = function (e, t, r, o) { - this._assert3d("specularMaterial"), - u.default._validateParameters("specularMaterial", arguments); - var n = u.default.prototype.color.apply(this, arguments); - return ( - (this._renderer.curSpecularColor = n._array), - (this._renderer._useSpecularMaterial = !0), - (this._renderer._useNormalMaterial = !1), - (this._renderer._enableLighting = !0), - this - ); - }), - (u.default.prototype.shininess = function (e) { - return ( - this._assert3d("shininess"), - u.default._validateParameters("shininess", arguments), - (this._renderer._useShininess = e = e < 1 ? 1 : e), - this - ); - }), - (u.default.RendererGL.prototype._applyColorBlend = function (e) { - var t = this.GL, - r = this.drawMode === n.TEXTURE, - r = - this.userFillShader || - this.userStrokeShader || - this.userPointShader || - r || - this.curBlendMode !== n.BLEND || - e[e.length - 1] < 1 || - this._isErasing; - return ( - r !== this._isBlending && - (r || - (this.curBlendMode !== n.BLEND && this.curBlendMode !== n.ADD) - ? t.enable(t.BLEND) - : t.disable(t.BLEND), - t.depthMask(!0), - (this._isBlending = r)), - this._applyBlendMode(), - e - ); - }), - (u.default.RendererGL.prototype._applyBlendMode = function () { - if (this._cachedBlendMode !== this.curBlendMode) { - var e = this.GL; - switch (this.curBlendMode) { - case n.BLEND: - e.blendEquation(e.FUNC_ADD), - e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA); - break; - case n.ADD: - e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ONE); - break; - case n.REMOVE: - e.blendEquation(e.FUNC_ADD), - e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_ALPHA); - break; - case n.MULTIPLY: - e.blendEquation(e.FUNC_ADD), - e.blendFunc(e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA); - break; - case n.SCREEN: - e.blendEquation(e.FUNC_ADD), - e.blendFunc(e.ONE, e.ONE_MINUS_SRC_COLOR); - break; - case n.EXCLUSION: - e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), - e.blendFuncSeparate( - e.ONE_MINUS_DST_COLOR, - e.ONE_MINUS_SRC_COLOR, - e.ONE, - e.ONE, - ); - break; - case n.REPLACE: - e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO); - break; - case n.SUBTRACT: - e.blendEquationSeparate( - e.FUNC_REVERSE_SUBTRACT, - e.FUNC_ADD, - ), - e.blendFuncSeparate( - e.ONE, - e.ONE, - e.ONE, - e.ONE_MINUS_SRC_ALPHA, - ); - break; - case n.DARKEST: - this.blendExt - ? (e.blendEquationSeparate( - this.blendExt.MIN || this.blendExt.MIN_EXT, - e.FUNC_ADD, - ), - e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) - : console.warn( - "blendMode(DARKEST) does not work in your browser in WEBGL mode.", - ); - break; - case n.LIGHTEST: - this.blendExt - ? (e.blendEquationSeparate( - this.blendExt.MAX || this.blendExt.MAX_EXT, - e.FUNC_ADD, - ), - e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) - : console.warn( - "blendMode(LIGHTEST) does not work in your browser in WEBGL mode.", - ); - break; - default: - console.error( - "Oops! Somehow RendererGL set curBlendMode to an unsupported mode.", - ); - } - this._isErasing || (this._cachedBlendMode = this.curBlendMode); - } - }); - var s = u.default; - r.default = s; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.Texture": 334, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.join": 162, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 324: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.string.sub"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.hypot"), - e("core-js/modules/es.string.sub"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var _ = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - (_.default.prototype.camera = function () { - var e; - this._assert3d("camera"); - for (var t = arguments.length, r = new Array(t), o = 0; o < t; o++) - r[o] = arguments[o]; - return ( - _.default._validateParameters("camera", r), - (e = this._renderer._curCamera).camera.apply(e, r), - this - ); - }), - (_.default.prototype.perspective = function () { - var e; - this._assert3d("perspective"); - for ( - var t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - _.default._validateParameters("perspective", r), - (e = this._renderer._curCamera).perspective.apply(e, r), - this - ); - }), - (_.default.prototype.ortho = function () { - var e; - this._assert3d("ortho"); - for ( - var t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - _.default._validateParameters("ortho", r), - (e = this._renderer._curCamera).ortho.apply(e, r), - this - ); - }), - (_.default.prototype.frustum = function () { - var e; - this._assert3d("frustum"); - for ( - var t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - return ( - _.default._validateParameters("frustum", r), - (e = this._renderer._curCamera).frustum.apply(e, r), - this - ); - }), - (_.default.prototype.createCamera = function () { - this._assert3d("createCamera"); - var e = new _.default.Camera(this._renderer); - return ( - e._computeCameraDefaultSettings(), - e._setDefaultCamera(), - (this._renderer._curCamera = e) - ); - }), - (_.default.Camera = (function () { - function t(e) { - if (!(this instanceof t)) - throw new TypeError("Cannot call a class as a function"); - (this._renderer = e), - (this.cameraType = "default"), - (this.cameraMatrix = new _.default.Matrix()), - (this.projMatrix = new _.default.Matrix()), - (this.yScale = 1); - } - var e, r, o; - return ( - (e = t), - (r = [ - { - key: "perspective", - value: function (e, t, r, o) { - (this.cameraType = - 0 < arguments.length ? "custom" : "default"), - void 0 === e - ? ((e = this.defaultCameraFOV), (this.cameraFOV = e)) - : (this.cameraFOV = - this._renderer._pInst._toRadians(e)), - void 0 === t && (t = this.defaultAspectRatio), - void 0 === r && (r = this.defaultCameraNear), - void 0 === o && (o = this.defaultCameraFar), - r <= 1e-4 && - ((r = 0.01), - console.log( - "Avoid perspective near plane values close to or below 0. Setting value to 0.01.", - )), - o < r && - console.log( - "Perspective far plane value is less than near plane value. Nothing will be shown.", - ), - (this.aspectRatio = t), - (this.cameraNear = r), - (this.cameraFar = o), - (this.projMatrix = _.default.Matrix.identity()); - var e = 1 / Math.tan(this.cameraFOV / 2), - n = 1 / (this.cameraNear - this.cameraFar); - this.projMatrix.set( - e / t, - 0, - 0, - 0, - 0, - -e * this.yScale, - 0, - 0, - 0, - 0, - (o + r) * n, - -1, - 0, - 0, - 2 * o * r * n, - 0, - ), - this._isActive() && - this._renderer.uPMatrix.set( - this.projMatrix.mat4[0], - this.projMatrix.mat4[1], - this.projMatrix.mat4[2], - this.projMatrix.mat4[3], - this.projMatrix.mat4[4], - this.projMatrix.mat4[5], - this.projMatrix.mat4[6], - this.projMatrix.mat4[7], - this.projMatrix.mat4[8], - this.projMatrix.mat4[9], - this.projMatrix.mat4[10], - this.projMatrix.mat4[11], - this.projMatrix.mat4[12], - this.projMatrix.mat4[13], - this.projMatrix.mat4[14], - this.projMatrix.mat4[15], - ); - }, - }, - { - key: "ortho", - value: function (e, t, r, o, n, s) { - void 0 === e && (e = -this._renderer.width / 2), - void 0 === t && (t = +this._renderer.width / 2), - void 0 === r && (r = -this._renderer.height / 2), - void 0 === o && (o = +this._renderer.height / 2), - void 0 === n && (n = 0), - void 0 === s && - (s = Math.max( - this._renderer.width, - this._renderer.height, - )), - (this.cameraNear = n); - var i = t - e, - a = o - r, - l = (this.cameraFar = s) - n, - u = 2 / i, - c = (2 / a) * this.yScale, - d = -2 / l, - t = -(t + e) / i, - e = -(o + r) / a, - i = -(s + n) / l; - (this.projMatrix = _.default.Matrix.identity()), - this.projMatrix.set( - u, - 0, - 0, - 0, - 0, - -c, - 0, - 0, - 0, - 0, - d, - 0, - t, - e, - i, - 1, - ), - this._isActive() && - this._renderer.uPMatrix.set( - this.projMatrix.mat4[0], - this.projMatrix.mat4[1], - this.projMatrix.mat4[2], - this.projMatrix.mat4[3], - this.projMatrix.mat4[4], - this.projMatrix.mat4[5], - this.projMatrix.mat4[6], - this.projMatrix.mat4[7], - this.projMatrix.mat4[8], - this.projMatrix.mat4[9], - this.projMatrix.mat4[10], - this.projMatrix.mat4[11], - this.projMatrix.mat4[12], - this.projMatrix.mat4[13], - this.projMatrix.mat4[14], - this.projMatrix.mat4[15], - ), - (this.cameraType = "custom"); - }, - }, - { - key: "frustum", - value: function (e, t, r, o, n, s) { - void 0 === e && (e = 0.05 * -this._renderer.width), - void 0 === t && (t = 0.05 * +this._renderer.width), - void 0 === r && (r = 0.05 * +this._renderer.height), - void 0 === o && (o = 0.05 * -this._renderer.height), - void 0 === n && (n = this.defaultCameraNear), - void 0 === s && (s = this.defaultCameraFar), - (this.cameraNear = n); - var i = t - e, - a = o - r, - l = (this.cameraFar = s) - n, - u = (2 * n) / i, - c = ((2 * n) / a) * this.yScale, - d = (-2 * s * n) / l, - t = (t + e) / i, - e = (o + r) / a, - i = -(s + n) / l; - (this.projMatrix = _.default.Matrix.identity()), - this.projMatrix.set( - u, - 0, - 0, - 0, - 0, - -c, - 0, - 0, - t, - e, - i, - -1, - 0, - 0, - d, - 0, - ), - this._isActive() && - this._renderer.uPMatrix.set( - this.projMatrix.mat4[0], - this.projMatrix.mat4[1], - this.projMatrix.mat4[2], - this.projMatrix.mat4[3], - this.projMatrix.mat4[4], - this.projMatrix.mat4[5], - this.projMatrix.mat4[6], - this.projMatrix.mat4[7], - this.projMatrix.mat4[8], - this.projMatrix.mat4[9], - this.projMatrix.mat4[10], - this.projMatrix.mat4[11], - this.projMatrix.mat4[12], - this.projMatrix.mat4[13], - this.projMatrix.mat4[14], - this.projMatrix.mat4[15], - ), - (this.cameraType = "custom"); - }, - }, - { - key: "_rotateView", - value: function (e, t, r, o) { - var n = this.centerX, - s = this.centerY, - i = this.centerZ, - a = - ((n -= this.eyeX), - (s -= this.eyeY), - (i -= this.eyeZ), - _.default.Matrix.identity(this._renderer._pInst)), - e = - (a.rotate( - this._renderer._pInst._toRadians(e), - t, - r, - o, - ), - [ - n * a.mat4[0] + s * a.mat4[4] + i * a.mat4[8], - n * a.mat4[1] + s * a.mat4[5] + i * a.mat4[9], - n * a.mat4[2] + s * a.mat4[6] + i * a.mat4[10], - ]); - (e[0] += this.eyeX), - (e[1] += this.eyeY), - (e[2] += this.eyeZ), - this.camera( - this.eyeX, - this.eyeY, - this.eyeZ, - e[0], - e[1], - e[2], - this.upX, - this.upY, - this.upZ, - ); - }, - }, - { - key: "pan", - value: function (e) { - var t = this._getLocalAxes(); - this._rotateView(e, t.y[0], t.y[1], t.y[2]); - }, - }, - { - key: "tilt", - value: function (e) { - var t = this._getLocalAxes(); - this._rotateView(e, t.x[0], t.x[1], t.x[2]); - }, - }, - { - key: "lookAt", - value: function (e, t, r) { - this.camera( - this.eyeX, - this.eyeY, - this.eyeZ, - e, - t, - r, - this.upX, - this.upY, - this.upZ, - ); - }, - }, - { - key: "camera", - value: function (e, t, r, o, n, s, i, a, l) { - void 0 === e && - ((e = this.defaultEyeX), - (t = this.defaultEyeY), - (r = this.defaultEyeZ), - (o = e), - (n = t), - (a = 1), - (l = i = s = 0)), - (this.eyeX = e), - (this.eyeY = t), - (this.eyeZ = r), - void 0 !== o && - ((this.centerX = o), - (this.centerY = n), - (this.centerZ = s)), - void 0 !== i && - ((this.upX = i), (this.upY = a), (this.upZ = l)); - (o = this._getLocalAxes()), - this.cameraMatrix.set( - o.x[0], - o.y[0], - o.z[0], - 0, - o.x[1], - o.y[1], - o.z[1], - 0, - o.x[2], - o.y[2], - o.z[2], - 0, - 0, - 0, - 0, - 1, - ), - (n = -e); - return ( - this.cameraMatrix.translate([n, -t, -r]), - this._isActive() && - this._renderer.uMVMatrix.set( - this.cameraMatrix.mat4[0], - this.cameraMatrix.mat4[1], - this.cameraMatrix.mat4[2], - this.cameraMatrix.mat4[3], - this.cameraMatrix.mat4[4], - this.cameraMatrix.mat4[5], - this.cameraMatrix.mat4[6], - this.cameraMatrix.mat4[7], - this.cameraMatrix.mat4[8], - this.cameraMatrix.mat4[9], - this.cameraMatrix.mat4[10], - this.cameraMatrix.mat4[11], - this.cameraMatrix.mat4[12], - this.cameraMatrix.mat4[13], - this.cameraMatrix.mat4[14], - this.cameraMatrix.mat4[15], - ), - this - ); - }, - }, - { - key: "move", - value: function (e, t, r) { - var o = this._getLocalAxes(), - e = [o.x[0] * e, o.x[1] * e, o.x[2] * e], - t = [o.y[0] * t, o.y[1] * t, o.y[2] * t], - o = [o.z[0] * r, o.z[1] * r, o.z[2] * r]; - this.camera( - this.eyeX + e[0] + t[0] + o[0], - this.eyeY + e[1] + t[1] + o[1], - this.eyeZ + e[2] + t[2] + o[2], - this.centerX + e[0] + t[0] + o[0], - this.centerY + e[1] + t[1] + o[1], - this.centerZ + e[2] + t[2] + o[2], - this.upX, - this.upY, - this.upZ, - ); - }, - }, - { - key: "setPosition", - value: function (e, t, r) { - var o = e - this.eyeX, - n = t - this.eyeY, - s = r - this.eyeZ; - this.camera( - e, - t, - r, - this.centerX + o, - this.centerY + n, - this.centerZ + s, - this.upX, - this.upY, - this.upZ, - ); - }, - }, - { - key: "set", - value: function (e) { - for ( - var t = 0, - r = [ - "eyeX", - "eyeY", - "eyeZ", - "centerX", - "centerY", - "centerZ", - "upX", - "upY", - "upZ", - "cameraFOV", - "aspectRatio", - "cameraNear", - "cameraFar", - "cameraType", - "yScale", - ]; - t < r.length; - t++ - ) { - var o = r[t]; - this[o] = e[o]; - } - (this.cameraMatrix = e.cameraMatrix.copy()), - (this.projMatrix = e.projMatrix.copy()), - this._isActive() && - ((this._renderer.uMVMatrix.mat4 = - this.cameraMatrix.mat4.slice()), - (this._renderer.uPMatrix.mat4 = - this.projMatrix.mat4.slice())); - }, - }, - { - key: "slerp", - value: function (e, t, r) { - var o, n, s, i, a, l, u, c, d, h, f, p, m, y, g, v, b, j; - 0 === r - ? this.set(e) - : 1 === r - ? this.set(t) - : (0 !== this.projMatrix.mat4[15] && - ((this.projMatrix.mat4[0] = - e.projMatrix.mat4[0] * - Math.pow( - t.projMatrix.mat4[0] / e.projMatrix.mat4[0], - r, - )), - (this.projMatrix.mat4[5] = - e.projMatrix.mat4[5] * - Math.pow( - t.projMatrix.mat4[5] / e.projMatrix.mat4[5], - r, - )), - this._isActive() && - (this._renderer.uPMatrix.mat4 = - this.projMatrix.mat4.slice())), - (i = new _.default.Vector(e.eyeX, e.eyeY, e.eyeZ)), - (a = new _.default.Vector(t.eyeX, t.eyeY, t.eyeZ)), - (v = new _.default.Vector( - e.centerX, - e.centerY, - e.centerZ, - )), - (j = new _.default.Vector( - t.centerX, - t.centerY, - t.centerZ, - )), - (s = _.default.Vector.dist(i, v)), - (o = _.default.Vector.dist(a, j)), - (o = s * Math.pow(o / s, r)), - (s = _.default.Vector.sub(i, a)), - (n = 1), - 1e-6 < - (b = (y = i - .copy() - .sub(a) - .sub(v) - .add(j)).magSq()) && - ((n = _.default.Vector.dot(s, y) / b), - (n = Math.max(0, Math.min(n, 1)))), - (s = _.default.Vector.lerp( - _.default.Vector.lerp(i, v, n), - _.default.Vector.lerp(a, j, n), - r, - )), - (y = e.cameraMatrix.createSubMatrix3x3()), - (b = t.cameraMatrix.createSubMatrix3x3()), - (i = y.row(2)), - (v = b.row(2)), - (a = y.row(1)), - (j = b.row(1)), - (e = new _.default.Vector()), - (t = new _.default.Vector()), - (l = new _.default.Vector()), - (u = new _.default.Vector()), - 1 - - (c = - 0.5 * - ((y = (b = b.mult3x3( - y.copy().transpose3x3(), - )).diagonal())[0] + - y[1] + - y[2] - - 1)) < - 1e-7 - ? (e - .set(_.default.Vector.lerp(i, v, r)) - .normalize(), - l - .set(e) - .mult(n * o) - .add(s), - u - .set(e) - .mult((n - 1) * o) - .add(s), - t - .set(_.default.Vector.lerp(a, j, r)) - .normalize()) - : ((v = 1 / (1 - c)), - (j = Math.max(y[0], y[1], y[2])), - (p = b.mat3[1] + b.mat3[3]), - (m = b.mat3[2] + b.mat3[6]), - (g = b.mat3[5] + b.mat3[7]), - (j = - j === y[0] - ? ((h = - 0.5 * - p * - (v /= d = Math.sqrt((y[0] - c) * v))), - (f = 0.5 * m * v), - (0.5 * (b.mat3[7] - b.mat3[5])) / d) - : j === y[1] - ? ((f = - 0.5 * - g * - (v /= h = Math.sqrt((y[1] - c) * v))), - (d = 0.5 * p * v), - (0.5 * (b.mat3[2] - b.mat3[6])) / h) - : ((d = - 0.5 * - m * - (v /= f = Math.sqrt((y[2] - c) * v))), - (h = 0.5 * g * v), - (0.5 * (b.mat3[3] - b.mat3[1])) / f)), - (p = r * Math.atan2(j, c)), - (m = Math.cos(p)), - (y = Math.sin(p)), - (j = new _.default.Matrix("mat3", [ - m + (g = 1 - m) * d * d, - g * (v = d * h) + y * f, - g * (b = f * d) - y * h, - g * v - y * f, - m + g * h * h, - g * (r = h * f) + y * d, - g * b + y * h, - g * r - y * d, - m + g * f * f, - ])).multiplyVec3(i, e), - l - .set(e) - .mult(n * o) - .add(s), - u - .set(e) - .mult((n - 1) * o) - .add(s), - j.multiplyVec3(a, t)), - this.camera( - l.x, - l.y, - l.z, - u.x, - u.y, - u.z, - t.x, - t.y, - t.z, - )); - }, - }, - { - key: "_computeCameraDefaultSettings", - value: function () { - (this.defaultAspectRatio = - this._renderer.width / this._renderer.height), - (this.defaultEyeX = 0), - (this.defaultEyeY = 0), - (this.defaultEyeZ = 800), - (this.defaultCameraFOV = - 2 * - Math.atan( - this._renderer.height / 2 / this.defaultEyeZ, - )), - (this.defaultCenterX = 0), - (this.defaultCenterY = 0), - (this.defaultCenterZ = 0), - (this.defaultCameraNear = 0.1 * this.defaultEyeZ), - (this.defaultCameraFar = 10 * this.defaultEyeZ); - }, - }, - { - key: "_setDefaultCamera", - value: function () { - (this.cameraFOV = this.defaultCameraFOV), - (this.aspectRatio = this.defaultAspectRatio), - (this.eyeX = this.defaultEyeX), - (this.eyeY = this.defaultEyeY), - (this.eyeZ = this.defaultEyeZ), - (this.centerX = this.defaultCenterX), - (this.centerY = this.defaultCenterY), - (this.centerZ = this.defaultCenterZ), - (this.upX = 0), - (this.upY = 1), - (this.upZ = 0), - (this.cameraNear = this.defaultCameraNear), - (this.cameraFar = this.defaultCameraFar), - this.perspective(), - this.camera(), - (this.cameraType = "default"); - }, - }, - { - key: "_resize", - value: function () { - "default" === this.cameraType && - (this._computeCameraDefaultSettings(), - (this.cameraFOV = this.defaultCameraFOV), - (this.aspectRatio = this.defaultAspectRatio), - this.perspective()); - }, - }, - { - key: "copy", - value: function () { - var e = new _.default.Camera(this._renderer); - return ( - (e.cameraFOV = this.cameraFOV), - (e.aspectRatio = this.aspectRatio), - (e.eyeX = this.eyeX), - (e.eyeY = this.eyeY), - (e.eyeZ = this.eyeZ), - (e.centerX = this.centerX), - (e.centerY = this.centerY), - (e.centerZ = this.centerZ), - (e.upX = this.upX), - (e.upY = this.upY), - (e.upZ = this.upZ), - (e.cameraNear = this.cameraNear), - (e.cameraFar = this.cameraFar), - (e.cameraType = this.cameraType), - (e.cameraMatrix = this.cameraMatrix.copy()), - (e.projMatrix = this.projMatrix.copy()), - (e.yScale = this.yScale), - e - ); - }, - }, - { - key: "_getLocalAxes", - value: function () { - var e = this.eyeX - this.centerX, - t = this.eyeY - this.centerY, - r = this.eyeZ - this.centerZ, - o = Math.sqrt(e * e + t * t + r * r), - o = - (0 !== o && ((e /= o), (t /= o), (r /= o)), this.upX), - n = (a = this.upY) * r - (l = this.upZ) * t, - s = -o * r + l * e, - i = o * t - a * e, - o = t * i - r * s, - a = -e * i + r * n, - l = e * s - t * n, - u = Math.sqrt(n * n + s * s + i * i), - u = - (0 !== u && ((n /= u), (s /= u), (i /= u)), - Math.sqrt(o * o + a * a + l * l)); - return ( - 0 !== u && ((o /= u), (a /= u), (l /= u)), - { x: [n, s, i], y: [o, a, l], z: [e, t, r] } - ); - }, - }, - { - key: "_orbit", - value: function (e, t, r) { - var o = this.eyeX - this.centerX, - n = this.eyeY - this.centerY, - s = this.eyeZ - this.centerZ, - i = Math.hypot(o, n, s), - o = new _.default.Vector(o, n, s).normalize(), - n = new _.default.Vector( - this.upX, - this.upY, - this.upZ, - ).normalize(), - s = new _.default.Vector.cross(n, o).normalize(), - a = new _.default.Vector.cross(s, n), - r = - ((i = - (i *= Math.pow(10, r)) < this.cameraNear - ? this.cameraNear - : i) > this.cameraFar && (i = this.cameraFar), - Math.acos( - Math.max( - -1, - Math.min(1, _.default.Vector.dot(o, n)), - ), - ) + t), - t = e; - (r <= 0 || r >= Math.PI) && - ((this.upX *= -1), (this.upY *= -1), (this.upZ *= -1)), - n.mult(Math.cos(r)), - a.mult(Math.cos(t) * Math.sin(r)), - s.mult(Math.sin(t) * Math.sin(r)), - o.set(n).add(a).add(s), - (this.eyeX = i * o.x + this.centerX), - (this.eyeY = i * o.y + this.centerY), - (this.eyeZ = i * o.z + this.centerZ), - this.camera( - this.eyeX, - this.eyeY, - this.eyeZ, - this.centerX, - this.centerY, - this.centerZ, - this.upX, - this.upY, - this.upZ, - ); - }, - }, - { - key: "_orbitFree", - value: function (e, t, r) { - var o = this.eyeX - this.centerX, - n = this.eyeY - this.centerY, - s = this.eyeZ - this.centerZ, - i = Math.hypot(o, n, s), - o = new _.default.Vector(o, n, s).normalize(), - n = new _.default.Vector(this.upX, this.upY, this.upZ), - s = new _.default.Vector.cross(n, o).normalize(), - a = new _.default.Vector.cross(o, s), - l = Math.atan2(t, e), - l = - (a.mult(Math.sin(l)), - s.mult(Math.cos(l)).add(a), - Math.sqrt(e * e + t * t)), - a = new _.default.Vector.cross(o, s), - e = - ((i = - (i *= Math.pow(10, r)) < this.cameraNear - ? this.cameraNear - : i) > this.cameraFar && (i = this.cameraFar), - Math.cos(l)), - t = Math.sin(l), - r = n.dot(o), - l = n.dot(s), - u = r * e + l * t, - r = -r * t + l * e, - l = n.dot(a); - (n.x = u * o.x + r * s.x + l * a.x), - (n.y = u * o.y + r * s.y + l * a.y), - (n.z = u * o.z + r * s.z + l * a.z), - s.mult(-t), - o.mult(e).add(s).mult(i), - this.camera( - o.x + this.centerX, - o.y + this.centerY, - o.z + this.centerZ, - this.centerX, - this.centerY, - this.centerZ, - n.x, - n.y, - n.z, - ); - }, - }, - { - key: "_isActive", - value: function () { - return this === this._renderer._curCamera; - }, - }, - ]) && n(e.prototype, r), - o && n(e, o), - t - ); - })()), - (_.default.prototype.setCamera = function (e) { - (this._renderer._curCamera = e), - this._renderer.uPMatrix.set( - e.projMatrix.mat4[0], - e.projMatrix.mat4[1], - e.projMatrix.mat4[2], - e.projMatrix.mat4[3], - e.projMatrix.mat4[4], - e.projMatrix.mat4[5], - e.projMatrix.mat4[6], - e.projMatrix.mat4[7], - e.projMatrix.mat4[8], - e.projMatrix.mat4[9], - e.projMatrix.mat4[10], - e.projMatrix.mat4[11], - e.projMatrix.mat4[12], - e.projMatrix.mat4[13], - e.projMatrix.mat4[14], - e.projMatrix.mat4[15], - ); - }); - e = _.default.Camera; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.math.hypot": 170, - "core-js/modules/es.string.sub": 200, - }, - ], - 325: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.log2"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.math.log2"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - e.default.DataArray = (function () { - function o() { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : 128, - t = this, - r = o; - if (!(t instanceof r)) - throw new TypeError("Cannot call a class as a function"); - (this.length = 0), - (this.data = new Float32Array(e)), - (this.initialLength = e); - } - var e, t, r; - return ( - (e = o), - (t = [ - { - key: "dataArray", - value: function () { - return this.subArray(0, this.length); - }, - }, - { - key: "clear", - value: function () { - this.length = 0; - }, - }, - { - key: "rescale", - value: function () { - var e; - this.length < this.data.length / 2 && - ((e = 1 << Math.ceil(Math.log2(this.length))), - (e = new Float32Array(e)).set( - this.data.subarray(0, this.length), - 0, - ), - (this.data = e)); - }, - }, - { - key: "reset", - value: function () { - this.clear(), - (this.data = new Float32Array(this.initialLength)); - }, - }, - { - key: "push", - value: function () { - for ( - var e = arguments.length, t = new Array(e), r = 0; - r < e; - r++ - ) - t[r] = arguments[r]; - this.ensureLength(this.length + t.length), - this.data.set(t, this.length), - (this.length += t.length); - }, - }, - { - key: "slice", - value: function (e, t) { - return this.data.slice(e, Math.min(t, this.length)); - }, - }, - { - key: "subArray", - value: function (e, t) { - return this.data.subarray(e, Math.min(t, this.length)); - }, - }, - { - key: "ensureLength", - value: function (e) { - for (; this.data.length < e; ) { - var t = new Float32Array(2 * this.data.length); - t.set(this.data, 0), (this.data = t); - } - }, - }, - ]) && n(e.prototype, t), - r && n(e, r), - o - ); - })(); - e = e.default.DataArray; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.math.log2": 171, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.float32-array": 211, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - }, - ], - 326: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.reflect.get"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint8-clamped-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint8-clamped-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var f = (_ = e("../core/main")) && _.__esModule ? _ : { default: _ }, - a = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = l(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")), - n = e("./p5.Texture"), - p = e("./p5.RendererGL"); - function l() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (l = function () { - return e; - }), - e); - } - function u(e, t) { - return ( - (function (e) { - if (Array.isArray(e)) return e; - })(e) || - (function (e, t) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) { - var r = [], - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = e[Symbol.iterator](); - !(o = (i = a.next()).done) && - (r.push(i.value), !t || r.length !== t); - o = !0 - ); - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - return r; - } - })(e, t) || - (function () { - throw new TypeError( - "Invalid attempt to destructure non-iterable instance", - ); - })() - ); - } - function s(e, t, r) { - return ( - t in e - ? Object.defineProperty(e, t, { - value: r, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (e[t] = r), - e - ); - } - function c(e, t) { - if (!(e instanceof t)) - throw new TypeError("Cannot call a class as a function"); - } - function d(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function h(e, t, r) { - t && d(e.prototype, t), r && d(e, r); - } - function m(e, t, r) { - return (m = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (e, t, r) { - var e = (function (e, t) { - for ( - ; - !Object.prototype.hasOwnProperty.call(e, t) && - null !== (e = v(e)); - - ); - return e; - })(e, t); - if (e) - return (e = Object.getOwnPropertyDescriptor(e, t)).get - ? e.get.call(r) - : e.value; - })(e, t, r || e); - } - function y(e, t) { - return (y = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function g(r) { - return function () { - var e, - t = v(r), - t = - ((e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = v(this).constructor), - Reflect.construct(t, arguments, e)) - : t.apply(this, arguments)), - this); - if (!e || ("object" !== i(e) && "function" != typeof e)) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return e; - }; - } - function v(e) { - return (v = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - var b = (function (e) { - var t = o; - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && y(t, e); - var r = g(o); - function o(e) { - var t; - return ( - c(this, o), - ((t = r.call(this, e.target._renderer)).fbo = e), - (t.yScale = -1), - t - ); - } - return ( - h(o, [ - { - key: "_computeCameraDefaultSettings", - value: function () { - m( - v(o.prototype), - "_computeCameraDefaultSettings", - this, - ).call(this), - (this.defaultAspectRatio = - this.fbo.width / this.fbo.height), - (this.defaultCameraFOV = - 2 * - Math.atan(this.fbo.height / 2 / this.defaultEyeZ)); - }, - }, - ]), - o - ); - })(f.default.Camera), - j = - ((f.default.FramebufferCamera = b), - (function () { - function r(e, t) { - c(this, r), (this.framebuffer = e), (this.property = t); - } - return ( - h(r, [ - { - key: "rawTexture", - value: function () { - return this.framebuffer[this.property]; - }, - }, - { - key: "width", - get: function () { - return ( - this.framebuffer.width * this.framebuffer.density - ); - }, - }, - { - key: "height", - get: function () { - return ( - this.framebuffer.height * this.framebuffer.density - ); - }, - }, - ]), - r - ); - })()), - _ = - ((f.default.FramebufferTexture = j), - (function () { - function o(e) { - var t = this, - r = - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : {}, - e = - (c(this, o), - (this.target = e), - this.target._renderer.framebuffers.add(this), - (this._isClipApplied = !1), - (this.pixels = []), - (this.format = r.format || a.UNSIGNED_BYTE), - (this.channels = - r.channels || - (e._renderer._pInst._glAttributes.alpha - ? a.RGBA - : a.RGB)), - (this.useDepth = void 0 === r.depth || r.depth), - (this.depthFormat = r.depthFormat || a.FLOAT), - (this.textureFiltering = r.textureFiltering || a.LINEAR), - void 0 === r.antialias - ? (this.antialiasSamples = e._renderer._pInst - ._glAttributes.antialias - ? 2 - : 0) - : "number" == typeof r.antialias - ? (this.antialiasSamples = r.antialias) - : (this.antialiasSamples = r.antialias ? 2 : 0), - (this.antialias = 0 < this.antialiasSamples), - this.antialias && - e.webglVersion !== a.WEBGL2 && - (console.warn( - "Antialiasing is unsupported in a WebGL 1 context", - ), - (this.antialias = !1)), - r.width && r.height - ? ((this.width = r.width), - (this.height = r.height), - (this.autoSized = !1)) - : ((void 0 === r.width) != (void 0 === r.height) && - console.warn( - "Please supply both width and height for a framebuffer to give it a size. Only one was given, so the framebuffer will match the size of its canvas.", - ), - (this.width = e.width), - (this.height = e.height), - (this.autoSized = !0)), - (this.density = r.density || e.pixelDensity()), - e._renderer.GL); - if ( - ((this.gl = e), - this._checkIfFormatsAvailable(), - r.stencil && - !this.useDepth && - console.warn( - "A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored.", - ), - (this.useStencil = - this.useDepth && (void 0 === r.stencil || r.stencil)), - (this.framebuffer = e.createFramebuffer()), - !this.framebuffer) - ) - throw new Error("Unable to create a framebuffer"); - if ( - this.antialias && - ((this.aaFramebuffer = e.createFramebuffer()), - !this.aaFramebuffer) - ) - throw new Error( - "Unable to create a framebuffer for antialiasing", - ); - this._recreateTextures(); - r = this.target._renderer._curCamera; - (this.defaultCamera = this.createCamera()), - (this.target._renderer._curCamera = r), - this.draw(function () { - return t.target.clear(); - }); - } - return ( - h(o, [ - { - key: "resize", - value: function (e, t) { - (this.autoSized = !1), - (this.width = e), - (this.height = t), - this._handleResize(); - }, - }, - { - key: "pixelDensity", - value: function (e) { - if (!e) return this.density; - (this.autoSized = !1), - (this.density = e), - this._handleResize(); - }, - }, - { - key: "autoSized", - value: function (e) { - if (void 0 === e) return this.autoSized; - (this.autoSized = e), this._handleResize(); - }, - }, - { - key: "_checkIfFormatsAvailable", - value: function () { - var e = this.gl, - e = - (this.useDepth && - this.target.webglVersion === a.WEBGL && - !e.getExtension("WEBGL_depth_texture") && - (console.warn( - "Unable to create depth textures in this environment. Falling back to a framebuffer without depth.", - ), - (this.useDepth = !1)), - this.useDepth && - this.target.webglVersion === a.WEBGL && - this.depthFormat === a.FLOAT && - (console.warn( - "FLOAT depth format is unavailable in WebGL 1. Defaulting to UNSIGNED_INT.", - ), - (this.depthFormat = a.UNSIGNED_INT)), - [a.UNSIGNED_BYTE, a.FLOAT, a.HALF_FLOAT].includes( - this.format, - ) || - (console.warn( - "Unknown Framebuffer format. Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. Defaulting to UNSIGNED_BYTE.", - ), - (this.format = a.UNSIGNED_BYTE)), - this.useDepth && - ![a.UNSIGNED_INT, a.FLOAT].includes( - this.depthFormat, - ) && - (console.warn( - "Unknown Framebuffer depth format. Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT.", - ), - (this.depthFormat = a.FLOAT)), - (0, n.checkWebGLCapabilities)( - this.target._renderer, - )); - e.float || - this.format !== a.FLOAT || - (console.warn( - "This environment does not support FLOAT textures. Falling back to UNSIGNED_BYTE.", - ), - (this.format = a.UNSIGNED_BYTE)), - this.useDepth && - !e.float && - this.depthFormat === a.FLOAT && - (console.warn( - "This environment does not support FLOAT depth textures. Falling back to UNSIGNED_INT.", - ), - (this.depthFormat = a.UNSIGNED_INT)), - e.halfFloat || - this.format !== a.HALF_FLOAT || - (console.warn( - "This environment does not support HALF_FLOAT textures. Falling back to UNSIGNED_BYTE.", - ), - (this.format = a.UNSIGNED_BYTE)), - this.channels === a.RGB && - [a.FLOAT, a.HALF_FLOAT].includes(this.format) && - (console.warn( - "FLOAT and HALF_FLOAT formats do not work cross-platform with only RGB channels. Falling back to RGBA.", - ), - (this.channels = a.RGBA)); - }, - }, - { - key: "_recreateTextures", - value: function () { - var e = this.gl, - t = - (this._updateSize(), - e.getParameter(e.TEXTURE_BINDING_2D)), - r = e.getParameter(e.FRAMEBUFFER_BINDING), - o = e.createTexture(); - if (!o) - throw new Error("Unable to create color texture"); - e.bindTexture(e.TEXTURE_2D, o); - var n = this._glColorFormat(); - if ( - (e.texImage2D( - e.TEXTURE_2D, - 0, - n.internalFormat, - this.width * this.density, - this.height * this.density, - 0, - n.format, - n.type, - null, - ), - (this.colorTexture = o), - e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer), - e.framebufferTexture2D( - e.FRAMEBUFFER, - e.COLOR_ATTACHMENT0, - e.TEXTURE_2D, - o, - 0, - ), - this.useDepth) - ) { - var o = e.createTexture(); - if (!o) - throw new Error("Unable to create depth texture"); - var s = this._glDepthFormat(); - e.bindTexture(e.TEXTURE_2D, o), - e.texImage2D( - e.TEXTURE_2D, - 0, - s.internalFormat, - this.width * this.density, - this.height * this.density, - 0, - s.format, - s.type, - null, - ), - e.framebufferTexture2D( - e.FRAMEBUFFER, - this.useStencil - ? e.DEPTH_STENCIL_ATTACHMENT - : e.DEPTH_ATTACHMENT, - e.TEXTURE_2D, - o, - 0, - ), - (this.depthTexture = o); - } - this.antialias && - ((this.colorRenderbuffer = e.createRenderbuffer()), - e.bindRenderbuffer( - e.RENDERBUFFER, - this.colorRenderbuffer, - ), - e.renderbufferStorageMultisample( - e.RENDERBUFFER, - Math.max( - 0, - Math.min( - this.antialiasSamples, - e.getParameter(e.MAX_SAMPLES), - ), - ), - n.internalFormat, - this.width * this.density, - this.height * this.density, - ), - this.useDepth && - ((s = this._glDepthFormat()), - (this.depthRenderbuffer = e.createRenderbuffer()), - e.bindRenderbuffer( - e.RENDERBUFFER, - this.depthRenderbuffer, - ), - e.renderbufferStorageMultisample( - e.RENDERBUFFER, - Math.max( - 0, - Math.min( - this.antialiasSamples, - e.getParameter(e.MAX_SAMPLES), - ), - ), - s.internalFormat, - this.width * this.density, - this.height * this.density, - )), - e.bindFramebuffer(e.FRAMEBUFFER, this.aaFramebuffer), - e.framebufferRenderbuffer( - e.FRAMEBUFFER, - e.COLOR_ATTACHMENT0, - e.RENDERBUFFER, - this.colorRenderbuffer, - ), - this.useDepth && - e.framebufferRenderbuffer( - e.FRAMEBUFFER, - this.useStencil - ? e.DEPTH_STENCIL_ATTACHMENT - : e.DEPTH_ATTACHMENT, - e.RENDERBUFFER, - this.depthRenderbuffer, - )), - this.useDepth && - ((this.depth = new j(this, "depthTexture")), - (o = e.NEAREST), - (this.depthP5Texture = new f.default.Texture( - this.target._renderer, - this.depth, - { minFilter: o, magFilter: o }, - )), - this.target._renderer.textures.set( - this.depth, - this.depthP5Texture, - )), - (this.color = new j(this, "colorTexture")); - n = - this.textureFiltering === a.LINEAR - ? e.LINEAR - : e.NEAREST; - (this.colorP5Texture = new f.default.Texture( - this.target._renderer, - this.color, - { minFilter: n, magFilter: n }, - )), - this.target._renderer.textures.set( - this.color, - this.colorP5Texture, - ), - e.bindTexture(e.TEXTURE_2D, t), - e.bindFramebuffer(e.FRAMEBUFFER, r); - }, - }, - { - key: "_glColorFormat", - value: function () { - var e, - t, - r = this.gl, - o = - this.format === a.FLOAT - ? r.FLOAT - : this.format === a.HALF_FLOAT - ? this.target.webglVersion === a.WEBGL2 - ? r.HALF_FLOAT - : r.getExtension("OES_texture_half_float") - .HALF_FLOAT_OES - : r.UNSIGNED_BYTE, - n = this.channels === a.RGBA ? r.RGBA : r.RGB; - return { - internalFormat: - this.target.webglVersion === a.WEBGL2 - ? (s((t = {}), r.FLOAT, s({}, r.RGBA, r.RGBA32F)), - s(t, r.HALF_FLOAT, s({}, r.RGBA, r.RGBA16F)), - s( - t, - r.UNSIGNED_BYTE, - (s((e = {}), r.RGBA, r.RGBA8), - s(e, r.RGB, r.RGB8), - e), - ), - t[o][n]) - : this.format === a.HALF_FLOAT - ? r.RGBA - : n, - format: n, - type: o, - }; - }, - }, - { - key: "_glDepthFormat", - value: function () { - var e = this.gl, - t = this.useStencil - ? this.depthFormat === a.FLOAT - ? e.FLOAT_32_UNSIGNED_INT_24_8_REV - : this.target.webglVersion === a.WEBGL2 - ? e.UNSIGNED_INT_24_8 - : e.getExtension("WEBGL_depth_texture") - .UNSIGNED_INT_24_8_WEBGL - : this.depthFormat === a.FLOAT - ? e.FLOAT - : e.UNSIGNED_INT, - r = this.useStencil - ? e.DEPTH_STENCIL - : e.DEPTH_COMPONENT, - e = this.useStencil - ? this.depthFormat === a.FLOAT - ? e.DEPTH32F_STENCIL8 - : this.target.webglVersion === a.WEBGL2 - ? e.DEPTH24_STENCIL8 - : e.DEPTH_STENCIL - : this.target.webglVersion === a.WEBGL2 - ? this.depthFormat === a.FLOAT - ? e.DEPTH_COMPONENT32F - : e.DEPTH_COMPONENT24 - : e.DEPTH_COMPONENT; - return { internalFormat: e, format: r, type: t }; - }, - }, - { - key: "_updateSize", - value: function () { - this.autoSized && - ((this.width = this.target.width), - (this.height = this.target.height), - (this.density = this.target.pixelDensity())); - }, - }, - { - key: "_canvasSizeChanged", - value: function () { - this.autoSized && this._handleResize(); - }, - }, - { - key: "_handleResize", - value: function () { - var e = this.color, - t = this.depth, - r = this.colorRenderbuffer, - o = this.depthRenderbuffer, - e = - (this._deleteTexture(e), - t && this._deleteTexture(t), - this.gl); - r && e.deleteRenderbuffer(r), - o && e.deleteRenderbuffer(o), - this._recreateTextures(), - this.defaultCamera._resize(); - }, - }, - { - key: "createCamera", - value: function () { - var e = new b(this); - return ( - e._computeCameraDefaultSettings(), - e._setDefaultCamera(), - (this.target._renderer._curCamera = e) - ); - }, - }, - { - key: "_deleteTexture", - value: function (e) { - this.gl.deleteTexture(e.rawTexture()), - this.target._renderer.textures.delete(e); - }, - }, - { - key: "remove", - value: function () { - var e = this.gl; - this._deleteTexture(this.color), - this.depth && this._deleteTexture(this.depth), - e.deleteFramebuffer(this.framebuffer), - this.aaFramebuffer && - e.deleteFramebuffer(this.aaFramebuffer), - this.depthRenderbuffer && - e.deleteRenderbuffer(this.depthRenderbuffer), - this.colorRenderbuffer && - e.deleteRenderbuffer(this.colorRenderbuffer), - this.target._renderer.framebuffers.delete(this); - }, - }, - { - key: "begin", - value: function () { - (this.prevFramebuffer = - this.target._renderer.activeFramebuffer()), - this.prevFramebuffer && - this.prevFramebuffer._beforeEnd(), - this.target._renderer.activeFramebuffers.push(this), - this._beforeBegin(), - this.target.push(), - this.target.setCamera(this.defaultCamera), - this.target._renderer.uMVMatrix.set( - this.target._renderer._curCamera.cameraMatrix - .mat4[0], - this.target._renderer._curCamera.cameraMatrix - .mat4[1], - this.target._renderer._curCamera.cameraMatrix - .mat4[2], - this.target._renderer._curCamera.cameraMatrix - .mat4[3], - this.target._renderer._curCamera.cameraMatrix - .mat4[4], - this.target._renderer._curCamera.cameraMatrix - .mat4[5], - this.target._renderer._curCamera.cameraMatrix - .mat4[6], - this.target._renderer._curCamera.cameraMatrix - .mat4[7], - this.target._renderer._curCamera.cameraMatrix - .mat4[8], - this.target._renderer._curCamera.cameraMatrix - .mat4[9], - this.target._renderer._curCamera.cameraMatrix - .mat4[10], - this.target._renderer._curCamera.cameraMatrix - .mat4[11], - this.target._renderer._curCamera.cameraMatrix - .mat4[12], - this.target._renderer._curCamera.cameraMatrix - .mat4[13], - this.target._renderer._curCamera.cameraMatrix - .mat4[14], - this.target._renderer._curCamera.cameraMatrix - .mat4[15], - ); - }, - }, - { - key: "_framebufferToBind", - value: function () { - return this.antialias - ? this.aaFramebuffer - : this.framebuffer; - }, - }, - { - key: "_beforeBegin", - value: function () { - var e = this.gl; - e.bindFramebuffer( - e.FRAMEBUFFER, - this._framebufferToBind(), - ), - this.target._renderer.viewport( - this.width * this.density, - this.height * this.density, - ); - }, - }, - { - key: "_beforeEnd", - value: function () { - if (this.antialias) { - var e = this.gl, - t = - (e.bindFramebuffer( - e.READ_FRAMEBUFFER, - this.aaFramebuffer, - ), - e.bindFramebuffer( - e.DRAW_FRAMEBUFFER, - this.framebuffer, - ), - [ - [ - e.COLOR_BUFFER_BIT, - this.colorP5Texture.glMagFilter, - ], - ]); - this.useDepth && - t.push([ - e.DEPTH_BUFFER_BIT, - this.depthP5Texture.glMagFilter, - ]); - for (var r = 0, o = t; r < o.length; r++) { - var n = u(o[r], 2), - s = n[0], - n = n[1]; - e.blitFramebuffer( - 0, - 0, - this.width * this.density, - this.height * this.density, - 0, - 0, - this.width * this.density, - this.height * this.density, - s, - n, - ); - } - } - }, - }, - { - key: "end", - value: function () { - var e = this.gl; - if ( - (this.target.pop(), - this.target._renderer.activeFramebuffers.pop() !== - this) - ) - throw new Error( - "It looks like you've called end() while another Framebuffer is active.", - ); - this._beforeEnd(), - this.prevFramebuffer - ? this.prevFramebuffer._beforeBegin() - : (e.bindFramebuffer(e.FRAMEBUFFER, null), - this.target._renderer.viewport( - this.target._renderer._origViewport.width, - this.target._renderer._origViewport.height, - )), - this.target._renderer._applyStencilTestIfClipping(); - }, - }, - { - key: "draw", - value: function (e) { - this.begin(), e(), this.end(); - }, - }, - { - key: "loadPixels", - value: function () { - var e = this.gl, - t = this.target._renderer.activeFramebuffer(), - r = - (e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer), - this._glColorFormat()); - (this.pixels = (0, p.readPixelsWebGL)( - this.pixels, - e, - this.framebuffer, - 0, - 0, - this.width * this.density, - this.height * this.density, - r.format, - r.type, - )), - t - ? e.bindFramebuffer( - e.FRAMEBUFFER, - t._framebufferToBind(), - ) - : e.bindFramebuffer(e.FRAMEBUFFER, null); - }, - }, - { - key: "get", - value: function (e, t, r, o) { - f.default._validateParameters( - "p5.Framebuffer.get", - arguments, - ); - var n = this._glColorFormat(); - if (void 0 === e && void 0 === t) - (t = e = 0), (r = this.width), (o = this.height); - else if (void 0 === r && void 0 === o) - return ( - (e < 0 || - t < 0 || - e >= this.width || - t >= this.height) && - (console.warn( - "The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped.", - ), - (e = this.target.constrain(e, 0, this.width - 1)), - (t = this.target.constrain( - t, - 0, - this.height - 1, - ))), - (0, p.readPixelWebGL)( - this.gl, - this.framebuffer, - e * this.density, - t * this.density, - n.format, - n.type, - ) - ); - (e = this.target.constrain(e, 0, this.width - 1)), - (t = this.target.constrain(t, 0, this.height - 1)), - (r = this.target.constrain(r, 1, this.width - e)), - (o = this.target.constrain(o, 1, this.height - t)); - for ( - var s = (0, p.readPixelsWebGL)( - void 0, - this.gl, - this.framebuffer, - e * this.density, - t * this.density, - r * this.density, - o * this.density, - n.format, - n.type, - ), - i = new Uint8ClampedArray( - r * o * this.density * this.density * 4, - ), - a = (i.fill(255), n.type === this.gl.RGB ? 3 : 4), - l = 0; - l < o * this.density; - l++ - ) - for (var u = 0; u < r * this.density; u++) - for (var c = 0; c < 4; c++) { - var d, - h = 4 * (l * r * this.density + u) + c; - c < a && - ((d = - 4 == a - ? h - : (l * r * this.density + u) * a + c), - (i[h] = s[d])); - } - e = new f.default.Image( - r * this.density, - o * this.density, - ); - return ( - (e.imageData = e.canvas - .getContext("2d") - .createImageData(e.width, e.height)), - e.imageData.data.set(i), - (e.pixels = e.imageData.data), - e.updatePixels(), - 1 !== this.density && e.resize(r, o), - e - ); - }, - }, - { - key: "updatePixels", - value: function () { - var e = this.gl, - t = - (this.colorP5Texture.bindTexture(), - this._glColorFormat()), - r = t.format === e.RGBA ? 4 : 3, - r = - this.width * - this.height * - this.density * - this.density * - r, - o = - t.type === e.UNSIGNED_BYTE - ? Uint8Array - : Float32Array; - if ( - !(this.pixels instanceof o) || - this.pixels.length !== r - ) - throw new Error( - "The pixels array has not been set correctly. Please call loadPixels() before updatePixels().", - ); - e.texImage2D( - e.TEXTURE_2D, - 0, - t.internalFormat, - this.width * this.density, - this.height * this.density, - 0, - t.format, - t.type, - this.pixels, - ), - this.colorP5Texture.unbindTexture(); - o = this.target._renderer.activeFramebuffer(); - this.antialias - ? (this.begin(), - this.target.push(), - this.target.imageMode(this.target.CENTER), - this.target.resetMatrix(), - this.target.noStroke(), - this.target.clear(), - this.target.image(this, 0, 0), - this.target.pop(), - this.useDepth && - (e.clearDepth(1), e.clear(e.DEPTH_BUFFER_BIT)), - this.end()) - : (e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer), - this.useDepth && - (e.clearDepth(1), e.clear(e.DEPTH_BUFFER_BIT)), - o - ? e.bindFramebuffer( - e.FRAMEBUFFER, - o._framebufferToBind(), - ) - : e.bindFramebuffer(e.FRAMEBUFFER, null)); - }, - }, - ]), - o - ); - })()), - e = (f.default.Framebuffer = _); - r.default = e; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.RendererGL": 332, - "./p5.Texture": 334, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.reflect.get": 185, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.float32-array": 211, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/es.typed-array.uint8-clamped-array": 235, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 327: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.map"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.sub"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.for-each"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.map"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.sub"), - e("core-js/modules/web.dom-collections.for-each"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var m = (s = e("../core/main")) && s.__esModule ? s : { default: s }, - y = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function c(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - m.default.Geometry = (function () { - function o(e, t, r) { - if (this instanceof o) - return ( - (this.vertices = []), - (this.lineVertices = new m.default.DataArray()), - (this.lineTangentsIn = new m.default.DataArray()), - (this.lineTangentsOut = new m.default.DataArray()), - (this.lineSides = new m.default.DataArray()), - (this.vertexNormals = []), - (this.faces = []), - (this.uvs = []), - (this.edges = []), - (this.vertexColors = []), - (this.vertexStrokeColors = []), - (this.lineVertexColors = new m.default.DataArray()), - (this.detailX = void 0 !== e ? e : 1), - (this.detailY = void 0 !== t ? t : 1), - (this.dirtyFlags = {}), - r instanceof Function && r.call(this), - this - ); - throw new TypeError("Cannot call a class as a function"); - } - var e, t, r; - return ( - (e = o), - (t = [ - { - key: "reset", - value: function () { - this.lineVertices.clear(), - this.lineTangentsIn.clear(), - this.lineTangentsOut.clear(), - this.lineSides.clear(), - (this.vertices.length = 0), - (this.edges.length = 0), - (this.vertexColors.length = 0), - (this.vertexStrokeColors.length = 0), - this.lineVertexColors.clear(), - (this.vertexNormals.length = 0), - (this.uvs.length = 0), - (this.dirtyFlags = {}); - }, - }, - { - key: "clearColors", - value: function () { - return (this.vertexColors = []), this; - }, - }, - { - key: "computeFaces", - value: function () { - this.faces.length = 0; - for ( - var e, t, r, o = this.detailX + 1, n = 0; - n < this.detailY; - n++ - ) - for (var s = 0; s < this.detailX; s++) - (t = (n + 1) * o + s + 1), - this.faces.push([ - n * o + s, - (e = n * o + s + 1), - (r = (n + 1) * o + s), - ]), - this.faces.push([r, e, t]); - return this; - }, - }, - { - key: "_getFaceNormal", - value: function (e) { - var e = this.faces[e], - t = this.vertices[e[0]], - r = this.vertices[e[1]], - e = this.vertices[e[2]], - r = m.default.Vector.sub(r, t), - e = m.default.Vector.sub(e, t), - t = m.default.Vector.cross(r, e), - o = m.default.Vector.mag(t), - r = - o / (m.default.Vector.mag(r) * m.default.Vector.mag(e)); - return 0 === r || isNaN(r) - ? (console.warn( - "p5.Geometry.prototype._getFaceNormal:", - "face has colinear sides or a repeated vertex", - ), - t) - : (1 < r && (r = 1), t.mult(Math.asin(r) / o)); - }, - }, - { - key: "computeNormals", - value: function () { - var e, - s = this, - t = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : y.FLAT, - r = ( - 1 < arguments.length && void 0 !== arguments[1] - ? arguments[1] - : {} - ).roundToPrecision, - i = this.vertexNormals, - o = this.vertices, - n = this.faces; - if (t === y.SMOOTH) { - for ( - var a = {}, - l = [], - u = Math.pow(10, void 0 === r ? 3 : r), - c = function (e) { - return Math.round(e * u) / u; - }, - d = function (e) { - return "" - .concat(c(e.x), ",") - .concat(c(e.y), ",") - .concat(c(e.z)); - }, - h = 0; - h < o.length; - h++ - ) { - var f = o[h], - p = d(f); - void 0 === a[p] && ((a[p] = l.length), l.push(f)); - } - n.forEach(function (e) { - for (var t = 0; t < 3; ++t) { - var r = e[t], - r = o[r], - r = d(r); - e[t] = a[r]; - } - }), - this.edges.forEach(function (e) { - for (var t = 0; t < 2; ++t) { - var r = e[t], - r = o[r], - r = d(r); - e[t] = a[r]; - } - }), - (this.vertices = o = l); - } - for (e = i.length = 0; e < o.length; ++e) - i.push(new m.default.Vector()); - for ( - n.forEach(function (e, t) { - for (var r = s._getFaceNormal(t), o = 0; o < 3; ++o) { - var n = e[o]; - i[n].add(r); - } - }), - e = 0; - e < o.length; - ++e - ) - i[e].normalize(); - return this; - }, - }, - { - key: "averageNormals", - value: function () { - for (var e = 0; e <= this.detailY; e++) { - var t = this.detailX + 1, - r = m.default.Vector.add( - this.vertexNormals[e * t], - this.vertexNormals[e * t + this.detailX], - ), - r = m.default.Vector.div(r, 2); - (this.vertexNormals[e * t] = r), - (this.vertexNormals[e * t + this.detailX] = r); - } - return this; - }, - }, - { - key: "averagePoleNormals", - value: function () { - for ( - var e = new m.default.Vector(0, 0, 0), t = 0; - t < this.detailX; - t++ - ) - e.add(this.vertexNormals[t]); - for ( - var e = m.default.Vector.div(e, this.detailX), r = 0; - r < this.detailX; - r++ - ) - this.vertexNormals[r] = e; - e = new m.default.Vector(0, 0, 0); - for ( - var o = this.vertices.length - 1; - o > this.vertices.length - 1 - this.detailX; - o-- - ) - e.add(this.vertexNormals[o]); - e = m.default.Vector.div(e, this.detailX); - for ( - var n = this.vertices.length - 1; - n > this.vertices.length - 1 - this.detailX; - n-- - ) - this.vertexNormals[n] = e; - return this; - }, - }, - { - key: "_makeTriangleEdges", - value: function () { - for ( - var e = (this.edges.length = 0); - e < this.faces.length; - e++ - ) - this.edges.push([this.faces[e][0], this.faces[e][1]]), - this.edges.push([this.faces[e][1], this.faces[e][2]]), - this.edges.push([this.faces[e][2], this.faces[e][0]]); - return this; - }, - }, - { - key: "_edgesToVertices", - value: function () { - this.lineVertices.clear(), - this.lineTangentsIn.clear(), - this.lineTangentsOut.clear(), - this.lineSides.clear(); - for ( - var e, t = new Map(), r = new Set(), o = 0; - o < this.edges.length; - o++ - ) { - var n, - s = this.edges[o - 1], - i = this.edges[o], - a = this.vertices[i[0]], - l = this.vertices[i[1]], - u = - 0 < this.vertexStrokeColors.length - ? this.vertexStrokeColors.slice( - 4 * i[0], - 4 * (i[0] + 1), - ) - : [0, 0, 0, 0], - c = - 0 < this.vertexStrokeColors.length - ? this.vertexStrokeColors.slice( - 4 * i[1], - 4 * (i[1] + 1), - ) - : [0, 0, 0, 0], - d = l.copy().sub(a).normalize(), - h = 0 < d.magSq(); - h && this._addSegment(a, l, u, c, d), - 0 < o && s[1] === i[0] - ? r.has(i[0]) || - (r.add(i[0]), - t.delete(i[0]), - e && - h && - d.dot(e) < 1 - 1e-8 && - this._addJoin(a, e, d, u)) - : (h && - !r.has(i[0]) && - ((n = t.get(i[0])) - ? (this._addJoin(a, n.dir, d, u), - t.delete(i[0]), - r.add(i[0])) - : t.set(i[0], { - point: a, - dir: d.copy().mult(-1), - color: u, - })), - e && - !r.has(s[1]) && - ((n = t.get(s[1])) - ? (this._addJoin( - this.vertices[s[1]], - e, - n.dir.copy().mult(-1), - u, - ), - t.delete(s[1]), - r.add(s[1])) - : t.set(s[1], { - point: this.vertices[s[1]], - dir: e, - color: u, - }), - (e = void 0))), - o !== this.edges.length - 1 || - r.has(i[1]) || - ((a = t.get(i[1])) - ? (this._addJoin(l, d, a.dir.copy().mult(-1), c), - t.delete(i[1]), - r.add(i[1])) - : t.set(i[1], { point: l, dir: d, color: c })), - h && (e = d); - } - var f = !0, - p = !1, - m = void 0; - try { - for ( - var y, g = t.values()[Symbol.iterator](); - !(f = (y = g.next()).done); - f = !0 - ) { - var v = y.value, - b = v.point, - j = v.dir, - _ = v.color; - this._addCap(b, j, _); - } - } catch (e) { - (p = !0), (m = e); - } finally { - try { - f || null == g.return || g.return(); - } finally { - if (p) throw m; - } - } - return this; - }, - }, - { - key: "_addSegment", - value: function (e, t, r, o, n) { - var e = e.array(), - t = t.array(), - s = n.array(); - this.lineSides.push(1, 1, -1, 1, -1, -1); - for ( - var i = 0, - a = [this.lineTangentsIn, this.lineTangentsOut]; - i < a.length; - i++ - ) - for (var l = a[i], u = 0; u < 6; u++) - l.push.apply(l, c(s)); - return ( - (n = this.lineVertices).push.apply( - n, - c(e).concat(c(t), c(e), c(t), c(t), c(e)), - ), - (n = this.lineVertexColors).push.apply( - n, - c(r).concat(c(o), c(r), c(o), c(o), c(r)), - ), - this - ); - }, - }, - { - key: "_addCap", - value: function (e, t, r) { - for ( - var o, n = e.array(), s = t.array(), i = [0, 0, 0], a = 0; - a < 6; - a++ - ) - (o = this.lineVertices).push.apply(o, c(n)), - (o = this.lineTangentsIn).push.apply(o, c(s)), - (o = this.lineTangentsOut).push.apply(o, i), - (o = this.lineVertexColors).push.apply(o, c(r)); - return this.lineSides.push(-1, 2, -2, 1, 2, -1), this; - }, - }, - { - key: "_addJoin", - value: function (e, t, r, o) { - for ( - var n, s = e.array(), i = t.array(), a = r.array(), l = 0; - l < 12; - l++ - ) - (n = this.lineVertices).push.apply(n, c(s)), - (n = this.lineTangentsIn).push.apply(n, c(i)), - (n = this.lineTangentsOut).push.apply(n, c(a)), - (n = this.lineVertexColors).push.apply(n, c(o)); - return ( - this.lineSides.push(-1, -3, -2, -1, 0, -3), - this.lineSides.push(3, 1, 2, 3, 0, 1), - this - ); - }, - }, - { - key: "normalize", - value: function () { - if (0 < this.vertices.length) { - for ( - var e = this.vertices[0].copy(), - t = this.vertices[0].copy(), - r = 0; - r < this.vertices.length; - r++ - ) - (e.x = Math.max(e.x, this.vertices[r].x)), - (t.x = Math.min(t.x, this.vertices[r].x)), - (e.y = Math.max(e.y, this.vertices[r].y)), - (t.y = Math.min(t.y, this.vertices[r].y)), - (e.z = Math.max(e.z, this.vertices[r].z)), - (t.z = Math.min(t.z, this.vertices[r].z)); - for ( - var o = m.default.Vector.lerp(e, t, 0.5), - n = m.default.Vector.sub(e, t), - s = 200 / Math.max(Math.max(n.x, n.y), n.z), - i = 0; - i < this.vertices.length; - i++ - ) - this.vertices[i].sub(o), this.vertices[i].mult(s); - } - return this; - }, - }, - ]) && n(e.prototype, t), - r && n(e, r), - o - ); - })(); - var s = m.default.Geometry; - r.default = s; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.for-each": 157, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.map": 169, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.set": 189, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.sub": 200, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.for-each": 237, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 328: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var C = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - var s = Array, - O = function (e) { - return Array.isArray(e); - }, - e = - ("undefined" != typeof Float32Array && - ((s = Float32Array), - (O = function (e) { - return Array.isArray(e) || e instanceof Float32Array; - })), - (C.default.Matrix = (function () { - function r() { - var e = this, - t = r; - if (e instanceof t) - return ( - arguments.length && - ((e = arguments.length - 1) < 0 || arguments.length <= e - ? void 0 - : arguments[e]) instanceof C.default && - (this.p5 = - (t = arguments.length - 1) < 0 || - arguments.length <= t - ? void 0 - : arguments[t]), - "mat3" === (arguments.length <= 0 ? void 0 : arguments[0]) - ? (this.mat3 = Array.isArray( - arguments.length <= 1 ? void 0 : arguments[1], - ) - ? arguments.length <= 1 - ? void 0 - : arguments[1] - : new s([1, 0, 0, 0, 1, 0, 0, 0, 1])) - : (this.mat4 = Array.isArray( - arguments.length <= 0 ? void 0 : arguments[0], - ) - ? arguments.length <= 0 - ? void 0 - : arguments[0] - : new s([ - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, - ])), - this - ); - throw new TypeError("Cannot call a class as a function"); - } - var e, t, o; - return ( - (e = r), - (o = [ - { - key: "identity", - value: function (e) { - return new C.default.Matrix(e); - }, - }, - ]), - (t = [ - { - key: "set", - value: function (e) { - return ( - e instanceof C.default.Matrix - ? (this.mat4 = e.mat4) - : O(e) - ? (this.mat4 = e) - : 16 === arguments.length && - ((this.mat4[0] = e), - (this.mat4[1] = arguments[1]), - (this.mat4[2] = arguments[2]), - (this.mat4[3] = arguments[3]), - (this.mat4[4] = arguments[4]), - (this.mat4[5] = arguments[5]), - (this.mat4[6] = arguments[6]), - (this.mat4[7] = arguments[7]), - (this.mat4[8] = arguments[8]), - (this.mat4[9] = arguments[9]), - (this.mat4[10] = arguments[10]), - (this.mat4[11] = arguments[11]), - (this.mat4[12] = arguments[12]), - (this.mat4[13] = arguments[13]), - (this.mat4[14] = arguments[14]), - (this.mat4[15] = arguments[15])), - this - ); - }, - }, - { - key: "get", - value: function () { - return new C.default.Matrix(this.mat4, this.p5); - }, - }, - { - key: "copy", - value: function () { - var e; - return ( - void 0 !== this.mat3 - ? (((e = new C.default.Matrix( - "mat3", - this.p5, - )).mat3[0] = this.mat3[0]), - (e.mat3[1] = this.mat3[1]), - (e.mat3[2] = this.mat3[2]), - (e.mat3[3] = this.mat3[3]), - (e.mat3[4] = this.mat3[4]), - (e.mat3[5] = this.mat3[5]), - (e.mat3[6] = this.mat3[6]), - (e.mat3[7] = this.mat3[7]), - (e.mat3[8] = this.mat3[8])) - : (((e = new C.default.Matrix(this.p5)).mat4[0] = - this.mat4[0]), - (e.mat4[1] = this.mat4[1]), - (e.mat4[2] = this.mat4[2]), - (e.mat4[3] = this.mat4[3]), - (e.mat4[4] = this.mat4[4]), - (e.mat4[5] = this.mat4[5]), - (e.mat4[6] = this.mat4[6]), - (e.mat4[7] = this.mat4[7]), - (e.mat4[8] = this.mat4[8]), - (e.mat4[9] = this.mat4[9]), - (e.mat4[10] = this.mat4[10]), - (e.mat4[11] = this.mat4[11]), - (e.mat4[12] = this.mat4[12]), - (e.mat4[13] = this.mat4[13]), - (e.mat4[14] = this.mat4[14]), - (e.mat4[15] = this.mat4[15])), - e - ); - }, - }, - { - key: "transpose", - value: function (e) { - var t, r, o, n, s, i; - return ( - e instanceof C.default.Matrix - ? ((t = e.mat4[1]), - (r = e.mat4[2]), - (o = e.mat4[3]), - (n = e.mat4[6]), - (s = e.mat4[7]), - (i = e.mat4[11]), - (this.mat4[0] = e.mat4[0]), - (this.mat4[1] = e.mat4[4]), - (this.mat4[2] = e.mat4[8]), - (this.mat4[3] = e.mat4[12]), - (this.mat4[4] = t), - (this.mat4[5] = e.mat4[5]), - (this.mat4[6] = e.mat4[9]), - (this.mat4[7] = e.mat4[13]), - (this.mat4[8] = r), - (this.mat4[9] = n), - (this.mat4[10] = e.mat4[10]), - (this.mat4[11] = e.mat4[14]), - (this.mat4[12] = o), - (this.mat4[13] = s), - (this.mat4[14] = i), - (this.mat4[15] = e.mat4[15])) - : O(e) && - ((t = e[1]), - (r = e[2]), - (o = e[3]), - (n = e[6]), - (s = e[7]), - (i = e[11]), - (this.mat4[0] = e[0]), - (this.mat4[1] = e[4]), - (this.mat4[2] = e[8]), - (this.mat4[3] = e[12]), - (this.mat4[4] = t), - (this.mat4[5] = e[5]), - (this.mat4[6] = e[9]), - (this.mat4[7] = e[13]), - (this.mat4[8] = r), - (this.mat4[9] = n), - (this.mat4[10] = e[10]), - (this.mat4[11] = e[14]), - (this.mat4[12] = o), - (this.mat4[13] = s), - (this.mat4[14] = i), - (this.mat4[15] = e[15])), - this - ); - }, - }, - { - key: "invert", - value: function (e) { - e instanceof C.default.Matrix - ? ((t = e.mat4[0]), - (r = e.mat4[1]), - (o = e.mat4[2]), - (n = e.mat4[3]), - (s = e.mat4[4]), - (i = e.mat4[5]), - (a = e.mat4[6]), - (l = e.mat4[7]), - (u = e.mat4[8]), - (c = e.mat4[9]), - (d = e.mat4[10]), - (h = e.mat4[11]), - (f = e.mat4[12]), - (p = e.mat4[13]), - (m = e.mat4[14]), - (y = e.mat4[15])) - : O(e) && - ((t = e[0]), - (r = e[1]), - (o = e[2]), - (n = e[3]), - (s = e[4]), - (i = e[5]), - (a = e[6]), - (l = e[7]), - (u = e[8]), - (c = e[9]), - (d = e[10]), - (h = e[11]), - (f = e[12]), - (p = e[13]), - (m = e[14]), - (y = e[15])); - var t, - r, - o, - n, - s, - i, - a, - l, - u, - c, - d, - h, - f, - p, - m, - y, - e = t * i - r * s, - g = t * a - o * s, - v = t * l - n * s, - b = r * a - o * i, - j = r * l - n * i, - _ = o * l - n * a, - x = u * p - c * f, - w = u * m - d * f, - S = u * y - h * f, - T = c * m - d * p, - M = c * y - h * p, - E = d * y - h * m, - k = e * E - g * M + v * T + b * S - j * w + _ * x; - return k - ? ((this.mat4[0] = - (i * E - a * M + l * T) * (k = 1 / k)), - (this.mat4[1] = (o * M - r * E - n * T) * k), - (this.mat4[2] = (p * _ - m * j + y * b) * k), - (this.mat4[3] = (d * j - c * _ - h * b) * k), - (this.mat4[4] = (a * S - s * E - l * w) * k), - (this.mat4[5] = (t * E - o * S + n * w) * k), - (this.mat4[6] = (m * v - f * _ - y * g) * k), - (this.mat4[7] = (u * _ - d * v + h * g) * k), - (this.mat4[8] = (s * M - i * S + l * x) * k), - (this.mat4[9] = (r * S - t * M - n * x) * k), - (this.mat4[10] = (f * j - p * v + y * e) * k), - (this.mat4[11] = (c * v - u * j - h * e) * k), - (this.mat4[12] = (i * w - s * T - a * x) * k), - (this.mat4[13] = (t * T - r * w + o * x) * k), - (this.mat4[14] = (p * g - f * b - m * e) * k), - (this.mat4[15] = (u * b - c * g + d * e) * k), - this) - : null; - }, - }, - { - key: "invert3x3", - value: function () { - var e = this.mat3[0], - t = this.mat3[1], - r = this.mat3[2], - o = this.mat3[3], - n = this.mat3[4], - s = this.mat3[5], - i = this.mat3[6], - a = this.mat3[7], - l = this.mat3[8], - u = l * n - s * a, - c = -l * o + s * i, - d = a * o - n * i, - h = e * u + t * c + r * d; - return h - ? ((this.mat3[0] = u * (h = 1 / h)), - (this.mat3[1] = (-l * t + r * a) * h), - (this.mat3[2] = (s * t - r * n) * h), - (this.mat3[3] = c * h), - (this.mat3[4] = (l * e - r * i) * h), - (this.mat3[5] = (-s * e + r * o) * h), - (this.mat3[6] = d * h), - (this.mat3[7] = (-a * e + t * i) * h), - (this.mat3[8] = (n * e - t * o) * h), - this) - : null; - }, - }, - { - key: "transpose3x3", - value: function (e) { - var t = (e = void 0 === e ? this.mat3 : e)[1], - r = e[2], - o = e[5]; - return ( - (this.mat3[0] = e[0]), - (this.mat3[1] = e[3]), - (this.mat3[2] = e[6]), - (this.mat3[3] = t), - (this.mat3[4] = e[4]), - (this.mat3[5] = e[7]), - (this.mat3[6] = r), - (this.mat3[7] = o), - (this.mat3[8] = e[8]), - this - ); - }, - }, - { - key: "inverseTranspose", - value: function (e) { - (e = e.mat4), - void 0 === this.mat3 - ? C.default._friendlyError( - "sorry, this function only works with mat3", - ) - : ((this.mat3[0] = e[0]), - (this.mat3[1] = e[1]), - (this.mat3[2] = e[2]), - (this.mat3[3] = e[4]), - (this.mat3[4] = e[5]), - (this.mat3[5] = e[6]), - (this.mat3[6] = e[8]), - (this.mat3[7] = e[9]), - (this.mat3[8] = e[10])), - (e = this.invert3x3()); - if (e) e.transpose3x3(this.mat3); - else for (var t = 0; t < 9; t++) this.mat3[t] = 0; - return this; - }, - }, - { - key: "determinant", - value: function () { - var e = - this.mat4[0] * this.mat4[5] - - this.mat4[1] * this.mat4[4], - t = - this.mat4[0] * this.mat4[6] - - this.mat4[2] * this.mat4[4], - r = - this.mat4[0] * this.mat4[7] - - this.mat4[3] * this.mat4[4], - o = - this.mat4[1] * this.mat4[6] - - this.mat4[2] * this.mat4[5], - n = - this.mat4[1] * this.mat4[7] - - this.mat4[3] * this.mat4[5], - s = - this.mat4[2] * this.mat4[7] - - this.mat4[3] * this.mat4[6], - i = - this.mat4[8] * this.mat4[13] - - this.mat4[9] * this.mat4[12], - a = - this.mat4[8] * this.mat4[14] - - this.mat4[10] * this.mat4[12], - l = - this.mat4[8] * this.mat4[15] - - this.mat4[11] * this.mat4[12], - u = - this.mat4[9] * this.mat4[14] - - this.mat4[10] * this.mat4[13], - c = - this.mat4[9] * this.mat4[15] - - this.mat4[11] * this.mat4[13]; - return ( - e * - (this.mat4[10] * this.mat4[15] - - this.mat4[11] * this.mat4[14]) - - t * c + - r * u + - o * l - - n * a + - s * i - ); - }, - }, - { - key: "mult", - value: function (e) { - var t; - if (e === this || e === this.mat4) t = this.copy().mat4; - else if (e instanceof C.default.Matrix) t = e.mat4; - else if (O(e)) t = e; - else { - if (16 !== arguments.length) return; - t = arguments; - } - var e = this.mat4[0], - r = this.mat4[1], - o = this.mat4[2], - n = this.mat4[3]; - return ( - (this.mat4[0] = - e * t[0] + r * t[4] + o * t[8] + n * t[12]), - (this.mat4[1] = - e * t[1] + r * t[5] + o * t[9] + n * t[13]), - (this.mat4[2] = - e * t[2] + r * t[6] + o * t[10] + n * t[14]), - (this.mat4[3] = - e * t[3] + r * t[7] + o * t[11] + n * t[15]), - (e = this.mat4[4]), - (r = this.mat4[5]), - (o = this.mat4[6]), - (n = this.mat4[7]), - (this.mat4[4] = - e * t[0] + r * t[4] + o * t[8] + n * t[12]), - (this.mat4[5] = - e * t[1] + r * t[5] + o * t[9] + n * t[13]), - (this.mat4[6] = - e * t[2] + r * t[6] + o * t[10] + n * t[14]), - (this.mat4[7] = - e * t[3] + r * t[7] + o * t[11] + n * t[15]), - (e = this.mat4[8]), - (r = this.mat4[9]), - (o = this.mat4[10]), - (n = this.mat4[11]), - (this.mat4[8] = - e * t[0] + r * t[4] + o * t[8] + n * t[12]), - (this.mat4[9] = - e * t[1] + r * t[5] + o * t[9] + n * t[13]), - (this.mat4[10] = - e * t[2] + r * t[6] + o * t[10] + n * t[14]), - (this.mat4[11] = - e * t[3] + r * t[7] + o * t[11] + n * t[15]), - (e = this.mat4[12]), - (r = this.mat4[13]), - (o = this.mat4[14]), - (n = this.mat4[15]), - (this.mat4[12] = - e * t[0] + r * t[4] + o * t[8] + n * t[12]), - (this.mat4[13] = - e * t[1] + r * t[5] + o * t[9] + n * t[13]), - (this.mat4[14] = - e * t[2] + r * t[6] + o * t[10] + n * t[14]), - (this.mat4[15] = - e * t[3] + r * t[7] + o * t[11] + n * t[15]), - this - ); - }, - }, - { - key: "apply", - value: function (e) { - var t; - if (e === this || e === this.mat4) t = this.copy().mat4; - else if (e instanceof C.default.Matrix) t = e.mat4; - else if (O(e)) t = e; - else { - if (16 !== arguments.length) return; - t = arguments; - } - var e = this.mat4, - r = e[0], - o = e[4], - n = e[8], - s = e[12], - r = - ((e[0] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), - (e[4] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), - (e[8] = - t[8] * r + t[9] * o + t[10] * n + t[11] * s), - (e[12] = - t[12] * r + t[13] * o + t[14] * n + t[15] * s), - e[1]), - o = e[5], - n = e[9], - s = e[13], - r = - ((e[1] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), - (e[5] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), - (e[9] = - t[8] * r + t[9] * o + t[10] * n + t[11] * s), - (e[13] = - t[12] * r + t[13] * o + t[14] * n + t[15] * s), - e[2]), - o = e[6], - n = e[10], - s = e[14], - r = - ((e[2] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), - (e[6] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), - (e[10] = - t[8] * r + t[9] * o + t[10] * n + t[11] * s), - (e[14] = - t[12] * r + t[13] * o + t[14] * n + t[15] * s), - e[3]), - o = e[7], - n = e[11], - s = e[15]; - return ( - (e[3] = t[0] * r + t[1] * o + t[2] * n + t[3] * s), - (e[7] = t[4] * r + t[5] * o + t[6] * n + t[7] * s), - (e[11] = t[8] * r + t[9] * o + t[10] * n + t[11] * s), - (e[15] = - t[12] * r + t[13] * o + t[14] * n + t[15] * s), - this - ); - }, - }, - { - key: "scale", - value: function (e, t, r) { - return ( - e instanceof C.default.Vector - ? ((t = e.y), (r = e.z), (e = e.x)) - : e instanceof Array && - ((t = e[1]), (r = e[2]), (e = e[0])), - (this.mat4[0] *= e), - (this.mat4[1] *= e), - (this.mat4[2] *= e), - (this.mat4[3] *= e), - (this.mat4[4] *= t), - (this.mat4[5] *= t), - (this.mat4[6] *= t), - (this.mat4[7] *= t), - (this.mat4[8] *= r), - (this.mat4[9] *= r), - (this.mat4[10] *= r), - (this.mat4[11] *= r), - this - ); - }, - }, - { - key: "rotate", - value: function (e, t, r, o) { - t instanceof C.default.Vector - ? ((r = t.y), (o = t.z), (t = t.x)) - : t instanceof Array && - ((r = t[1]), (o = t[2]), (t = t[0])); - var n = Math.sqrt(t * t + r * r + o * o), - n = - ((t *= 1 / n), - (r *= 1 / n), - (o *= 1 / n), - this.mat4[0]), - s = this.mat4[1], - i = this.mat4[2], - a = this.mat4[3], - l = this.mat4[4], - u = this.mat4[5], - c = this.mat4[6], - d = this.mat4[7], - h = this.mat4[8], - f = this.mat4[9], - p = this.mat4[10], - m = this.mat4[11], - y = Math.sin(e), - e = Math.cos(e), - g = 1 - e, - v = t * t * g + e, - b = r * t * g + o * y, - j = o * t * g - r * y, - _ = t * r * g - o * y, - x = r * r * g + e, - w = o * r * g + t * y, - S = t * o * g + r * y, - r = r * o * g - t * y, - t = o * o * g + e; - return ( - (this.mat4[0] = n * v + l * b + h * j), - (this.mat4[1] = s * v + u * b + f * j), - (this.mat4[2] = i * v + c * b + p * j), - (this.mat4[3] = a * v + d * b + m * j), - (this.mat4[4] = n * _ + l * x + h * w), - (this.mat4[5] = s * _ + u * x + f * w), - (this.mat4[6] = i * _ + c * x + p * w), - (this.mat4[7] = a * _ + d * x + m * w), - (this.mat4[8] = n * S + l * r + h * t), - (this.mat4[9] = s * S + u * r + f * t), - (this.mat4[10] = i * S + c * r + p * t), - (this.mat4[11] = a * S + d * r + m * t), - this - ); - }, - }, - { - key: "translate", - value: function (e) { - var t = e[0], - r = e[1], - e = e[2] || 0; - (this.mat4[12] += - this.mat4[0] * t + - this.mat4[4] * r + - this.mat4[8] * e), - (this.mat4[13] += - this.mat4[1] * t + - this.mat4[5] * r + - this.mat4[9] * e), - (this.mat4[14] += - this.mat4[2] * t + - this.mat4[6] * r + - this.mat4[10] * e), - (this.mat4[15] += - this.mat4[3] * t + - this.mat4[7] * r + - this.mat4[11] * e); - }, - }, - { - key: "rotateX", - value: function (e) { - this.rotate(e, 1, 0, 0); - }, - }, - { - key: "rotateY", - value: function (e) { - this.rotate(e, 0, 1, 0); - }, - }, - { - key: "rotateZ", - value: function (e) { - this.rotate(e, 0, 0, 1); - }, - }, - { - key: "perspective", - value: function (e, t, r, o) { - var e = 1 / Math.tan(e / 2), - n = 1 / (r - o); - return ( - (this.mat4[0] = e / t), - (this.mat4[1] = 0), - (this.mat4[2] = 0), - (this.mat4[3] = 0), - (this.mat4[4] = 0), - (this.mat4[5] = e), - (this.mat4[6] = 0), - (this.mat4[7] = 0), - (this.mat4[8] = 0), - (this.mat4[9] = 0), - (this.mat4[10] = (o + r) * n), - (this.mat4[11] = -1), - (this.mat4[12] = 0), - (this.mat4[13] = 0), - (this.mat4[14] = 2 * o * r * n), - (this.mat4[15] = 0), - this - ); - }, - }, - { - key: "ortho", - value: function (e, t, r, o, n, s) { - var i = 1 / (e - t), - a = 1 / (r - o), - l = 1 / (n - s); - return ( - (this.mat4[0] = -2 * i), - (this.mat4[1] = 0), - (this.mat4[2] = 0), - (this.mat4[3] = 0), - (this.mat4[4] = 0), - (this.mat4[5] = -2 * a), - (this.mat4[6] = 0), - (this.mat4[7] = 0), - (this.mat4[8] = 0), - (this.mat4[9] = 0), - (this.mat4[10] = 2 * l), - (this.mat4[11] = 0), - (this.mat4[12] = (e + t) * i), - (this.mat4[13] = (o + r) * a), - (this.mat4[14] = (s + n) * l), - (this.mat4[15] = 1), - this - ); - }, - }, - { - key: "multiplyVec4", - value: function (e, t, r, o) { - var n = new Array(4), - s = this.mat4; - return ( - (n[0] = s[0] * e + s[4] * t + s[8] * r + s[12] * o), - (n[1] = s[1] * e + s[5] * t + s[9] * r + s[13] * o), - (n[2] = s[2] * e + s[6] * t + s[10] * r + s[14] * o), - (n[3] = s[3] * e + s[7] * t + s[11] * r + s[15] * o), - n - ); - }, - }, - { - key: "multiplyPoint", - value: function (e) { - var t = e.x, - r = e.y, - e = e.z, - t = this.multiplyVec4(t, r, e, 1); - return new C.default.Vector(t[0], t[1], t[2]); - }, - }, - { - key: "multiplyAndNormalizePoint", - value: function (e) { - var t = e.x, - r = e.y, - e = e.z, - t = this.multiplyVec4(t, r, e, 1); - return ( - (t[0] /= t[3]), - (t[1] /= t[3]), - (t[2] /= t[3]), - new C.default.Vector(t[0], t[1], t[2]) - ); - }, - }, - { - key: "multiplyDirection", - value: function (e) { - var t = e.x, - r = e.y, - e = e.z, - t = this.multiplyVec4(t, r, e, 0); - return new C.default.Vector(t[0], t[1], t[2]); - }, - }, - { - key: "mult3x3", - value: function (e) { - var t; - if (e === this || e === this.mat3) t = this.copy().mat3; - else if (e instanceof C.default.Matrix) t = e.mat3; - else if (O(e)) t = e; - else { - if (9 !== arguments.length) return; - t = arguments; - } - var e = this.mat3[0], - r = this.mat3[1], - o = this.mat3[2]; - return ( - (this.mat3[0] = e * t[0] + r * t[3] + o * t[6]), - (this.mat3[1] = e * t[1] + r * t[4] + o * t[7]), - (this.mat3[2] = e * t[2] + r * t[5] + o * t[8]), - (e = this.mat3[3]), - (r = this.mat3[4]), - (o = this.mat3[5]), - (this.mat3[3] = e * t[0] + r * t[3] + o * t[6]), - (this.mat3[4] = e * t[1] + r * t[4] + o * t[7]), - (this.mat3[5] = e * t[2] + r * t[5] + o * t[8]), - (e = this.mat3[6]), - (r = this.mat3[7]), - (o = this.mat3[8]), - (this.mat3[6] = e * t[0] + r * t[3] + o * t[6]), - (this.mat3[7] = e * t[1] + r * t[4] + o * t[7]), - (this.mat3[8] = e * t[2] + r * t[5] + o * t[8]), - this - ); - }, - }, - { - key: "column", - value: function (e) { - return new C.default.Vector( - this.mat3[3 * e], - this.mat3[3 * e + 1], - this.mat3[3 * e + 2], - ); - }, - }, - { - key: "row", - value: function (e) { - return new C.default.Vector( - this.mat3[e], - this.mat3[e + 3], - this.mat3[e + 6], - ); - }, - }, - { - key: "diagonal", - value: function () { - return void 0 !== this.mat3 - ? [this.mat3[0], this.mat3[4], this.mat3[8]] - : [ - this.mat4[0], - this.mat4[5], - this.mat4[10], - this.mat4[15], - ]; - }, - }, - { - key: "multiplyVec3", - value: function (e, t) { - return ( - ((t = void 0 === t ? e.copy() : t).x = - this.row(0).dot(e)), - (t.y = this.row(1).dot(e)), - (t.z = this.row(2).dot(e)), - t - ); - }, - }, - { - key: "createSubMatrix3x3", - value: function () { - var e = new C.default.Matrix("mat3"); - return ( - (e.mat3[0] = this.mat4[0]), - (e.mat3[1] = this.mat4[1]), - (e.mat3[2] = this.mat4[2]), - (e.mat3[3] = this.mat4[4]), - (e.mat3[4] = this.mat4[5]), - (e.mat3[5] = this.mat4[6]), - (e.mat3[6] = this.mat4[8]), - (e.mat3[7] = this.mat4[9]), - (e.mat3[8] = this.mat4[10]), - e - ); - }, - }, - ]) && n(e.prototype, t), - o && n(e, o), - r - ); - })()), - C.default.Matrix); - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.float32-array": 211, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - }, - ], - 329: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.map"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - e = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function o(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - e.default.RenderBuffer = (function () { - function i(e, t, r, o, n, s) { - if (!(this instanceof i)) - throw new TypeError("Cannot call a class as a function"); - (this.size = e), - (this.src = t), - (this.dst = r), - (this.attr = o), - (this._renderer = n), - (this.map = s); - } - var e, t, r; - return ( - (e = i), - (t = [ - { - key: "_prepareBuffer", - value: function (e, t) { - var r, - o, - n, - s = t.attributes, - i = this._renderer.GL, - a = e.model || e, - s = s[this.attr]; - s && - ((r = e[this.dst]), - 0 < (o = a[this.src]).length - ? ((n = !r) && (e[this.dst] = r = i.createBuffer()), - i.bindBuffer(i.ARRAY_BUFFER, r), - (!n && !1 === a.dirtyFlags[this.src]) || - ((n = (e = this.map) ? e(o) : o), - this._renderer._bindBuffer(r, i.ARRAY_BUFFER, n), - (a.dirtyFlags[this.src] = !1)), - t.enableAttrib(s, this.size)) - : -1 !== (e = s.location) && - this._renderer.registerEnabled.has(e) && - (i.disableVertexAttribArray(e), - this._renderer.registerEnabled.delete(e))); - }, - }, - ]) && o(e.prototype, t), - r && o(e, r), - i - ); - })(); - e = e.default.RenderBuffer; - r.default = e; - }, - { "../core/main": 275, "core-js/modules/es.array.map": 164 }, - ], - 330: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.find-index"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.map"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.find-index"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.map"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.map"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var l = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - h = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function f(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - e("./p5.RenderBuffer"), - (l.default.RendererGL.prototype.beginShape = function (e) { - return ( - (this.immediateMode.shapeMode = void 0 !== e ? e : h.TESS), - this.immediateMode.geometry.reset(), - (this.immediateMode.contourIndices = []), - this - ); - }); - var u = { - vertices: 1, - vertexNormals: 1, - vertexColors: 4, - vertexStrokeColors: 4, - uvs: 2, - }, - n = - ((l.default.RendererGL.prototype.beginContour = function () { - if (this.immediateMode.shapeMode !== h.TESS) - throw new Error( - "WebGL mode can only use contours with beginShape(TESS).", - ); - this.immediateMode.contourIndices.push( - this.immediateMode.geometry.vertices.length, - ); - }), - (l.default.RendererGL.prototype.vertex = function (e, t) { - if ( - this.immediateMode.shapeMode === h.QUADS && - this.immediateMode.geometry.vertices.length % 6 == 3 - ) - for (var r in u) { - var o = u[r], - r = this.immediateMode.geometry[r]; - r.push.apply( - r, - f(r.slice(r.length - 3 * o, r.length - 2 * o)).concat( - f(r.slice(r.length - o, r.length)), - ), - ); - } - var n, - s, - i = (n = s = 0), - a = - (3 === arguments.length - ? (i = arguments[2]) - : 4 === arguments.length - ? ((n = arguments[2]), (s = arguments[3])) - : 5 === arguments.length && - ((i = arguments[2]), - (n = arguments[3]), - (s = arguments[4])), - new l.default.Vector(e, t, i)), - a = - (this.immediateMode.geometry.vertices.push(a), - this.immediateMode.geometry.vertexNormals.push( - this._currentNormal, - ), - this.curFillColor || [0.5, 0.5, 0.5, 1]), - a = - (this.immediateMode.geometry.vertexColors.push( - a[0], - a[1], - a[2], - a[3], - ), - this.curStrokeColor || [0.5, 0.5, 0.5, 1]); - return ( - this.immediateMode.geometry.vertexStrokeColors.push( - a[0], - a[1], - a[2], - a[3], - ), - this.textureMode !== h.IMAGE || - this.isProcessingVertices || - (null !== this._tex - ? 0 < this._tex.width && - 0 < this._tex.height && - ((n /= this._tex.width), (s /= this._tex.height)) - : void 0 === this.userFillShader && - void 0 === this.userStrokeShader && - void 0 === this.userPointShader && - null === this._tex && - 4 <= arguments.length && - console.warn( - "You must first call texture() before using vertex() with image based u and v coordinates", - )), - this.immediateMode.geometry.uvs.push(n, s), - (this.immediateMode._bezierVertex[0] = e), - (this.immediateMode._bezierVertex[1] = t), - (this.immediateMode._bezierVertex[2] = i), - (this.immediateMode._quadraticVertex[0] = e), - (this.immediateMode._quadraticVertex[1] = t), - (this.immediateMode._quadraticVertex[2] = i), - this - ); - }), - (l.default.RendererGL.prototype.normal = function (e, t, r) { - return ( - e instanceof l.default.Vector - ? (this._currentNormal = e) - : (this._currentNormal = new l.default.Vector(e, t, r)), - this - ); - }), - (l.default.RendererGL.prototype.endShape = function ( - e, - t, - r, - o, - n, - s, - ) { - var i = - 6 < arguments.length && void 0 !== arguments[6] - ? arguments[6] - : 1; - return ( - this.immediateMode.shapeMode === h.POINTS - ? this._drawPoints( - this.immediateMode.geometry.vertices, - this.immediateMode.buffers.point, - ) - : (3 === this.immediateMode.geometry.vertices.length && - this.immediateMode.shapeMode === h.TESS && - (this.immediateMode.shapeMode, h.TRIANGLES), - (this.isProcessingVertices = !0), - this._processVertices.apply(this, arguments), - (this.isProcessingVertices = !1), - (this.immediateMode.shapeMode !== h.LINE_STRIP && - this.immediateMode.shapeMode !== h.LINES) || - (this.immediateMode.shapeMode = h.TRIANGLE_FAN), - this.immediateMode.shapeMode === h.QUADS - ? (this.immediateMode.shapeMode = h.TRIANGLES) - : this.immediateMode.shapeMode === h.QUAD_STRIP && - (this.immediateMode.shapeMode = h.TRIANGLE_STRIP), - this._doFill && - !this.geometryBuilder && - 3 <= this.immediateMode.geometry.vertices.length && - this._drawImmediateFill(i), - this._doStroke && - !this.geometryBuilder && - 1 <= this.immediateMode.geometry.lineVertices.length && - this._drawImmediateStroke(), - this.geometryBuilder && - this.geometryBuilder.addImmediate(), - (this.isBezier = !1), - (this.isQuadratic = !1), - (this.isCurve = !1), - (this.immediateMode._bezierVertex.length = 0), - (this.immediateMode._quadraticVertex.length = 0), - (this.immediateMode._curveVertex.length = 0)), - this - ); - }), - (l.default.RendererGL.prototype._processVertices = function (e) { - var t; - 0 !== this.immediateMode.geometry.vertices.length && - ((t = this._doStroke), - (e = e === h.CLOSE), - t && - ((this.immediateMode.geometry.edges = this._calculateEdges( - this.immediateMode.shapeMode, - this.immediateMode.geometry.vertices, - e, - )), - this.geometryBuilder || - this.immediateMode.geometry._edgesToVertices()), - (t = this.immediateMode.shapeMode === h.TESS), - (e = 0 < this.immediateMode.contourIndices.length), - this._doFill && - (this.isBezier || - this.isQuadratic || - this.isCurve || - t || - e) && - this.immediateMode.shapeMode !== h.LINES && - this._tesselateShape()); - }), - (l.default.RendererGL.prototype._calculateEdges = function ( - e, - t, - r, - ) { - var o = [], - n = 0, - s = this.immediateMode.contourIndices.slice(), - i = 0; - switch (e) { - case h.TRIANGLE_STRIP: - for (n = 0; n < t.length - 2; n++) - o.push([n, n + 1]), o.push([n, n + 2]); - o.push([n, n + 1]); - break; - case h.TRIANGLE_FAN: - for (n = 1; n < t.length - 1; n++) - o.push([0, n]), o.push([n, n + 1]); - o.push([0, t.length - 1]); - break; - case h.TRIANGLES: - for (n = 0; n < t.length - 2; n += 3) - o.push([n, n + 1]), - o.push([n + 1, n + 2]), - o.push([n + 2, n]); - break; - case h.LINES: - for (n = 0; n < t.length - 1; n += 2) o.push([n, n + 1]); - break; - case h.QUADS: - for (n = 0; n < t.length - 5; n += 6) - o.push([n, n + 1]), - o.push([n + 1, n + 2]), - o.push([n + 3, n + 5]), - o.push([n + 4, n + 5]); - break; - case h.QUAD_STRIP: - for (n = 0; n < t.length - 2; n += 2) - o.push([n, n + 1]), - o.push([n, n + 2]), - o.push([n + 1, n + 3]); - o.push([n, n + 1]); - break; - default: - for (n = 0; n < t.length; n++) - n + 1 < t.length && n + 1 !== s[0] - ? o.push([n, n + 1]) - : ((r || i) && o.push([n, i]), - 0 < s.length && (i = s.shift())); - } - return e !== h.TESS && r && o.push([t.length - 1, 0]), o; - }), - (l.default.RendererGL.prototype._tesselateShape = function () { - for ( - var u = this, - e = ((this.immediateMode.shapeMode = h.TRIANGLES), [[]]), - t = 0; - t < this.immediateMode.geometry.vertices.length; - t++ - ) - 0 < this.immediateMode.contourIndices.length && - this.immediateMode.contourIndices[0] === t && - (this.immediateMode.contourIndices.shift(), e.push([])), - e[e.length - 1].push( - this.immediateMode.geometry.vertices[t].x, - this.immediateMode.geometry.vertices[t].y, - this.immediateMode.geometry.vertices[t].z, - this.immediateMode.geometry.uvs[2 * t], - this.immediateMode.geometry.uvs[2 * t + 1], - this.immediateMode.geometry.vertexColors[4 * t], - this.immediateMode.geometry.vertexColors[4 * t + 1], - this.immediateMode.geometry.vertexColors[4 * t + 2], - this.immediateMode.geometry.vertexColors[4 * t + 3], - this.immediateMode.geometry.vertexNormals[t].x, - this.immediateMode.geometry.vertexNormals[t].y, - this.immediateMode.geometry.vertexNormals[t].z, - ); - for ( - var c, - r = this._triangulate(e), - d = this.immediateMode.geometry.vertices, - o = - ((this.immediateMode.geometry.vertices = []), - (this.immediateMode.geometry.vertexNormals = []), - (this.immediateMode.geometry.uvs = []), - []), - n = 0, - s = r.length; - n < s; - n += l.default.RendererGL.prototype.tessyVertexSize - ) - o.push.apply(o, f(r.slice(n + 5, n + 9))), - this.normal.apply(this, f(r.slice(n + 9, n + 12))), - this.vertex.apply(this, f(r.slice(n, n + 5))); - this.geometryBuilder && - ((c = new Map()), - (this.immediateMode.geometry.edges = - this.immediateMode.geometry.edges.map(function (e) { - return e.map(function (e) { - if (!c.has(e)) { - var t = d[e], - r = u.immediateMode.geometry.vertices.findIndex( - function (e) { - return ( - t.x === e.x && t.y === e.y && t.z === e.z - ); - }, - ); - if (-1 === r) { - for ( - var o = 1 / 0, n = 0, s = 0; - s < u.immediateMode.geometry.vertices.length; - s++ - ) { - var i = u.immediateMode.geometry.vertices[s], - a = t.x - i.x, - l = t.y - i.y, - i = t.z - i.z, - a = a * a + l * l + i * i; - a < o && ((o = a), (n = s)); - } - r = n; - } - c.set(e, r); - } - return c.get(e); - }); - }))), - (this.immediateMode.geometry.vertexColors = o); - }), - (l.default.RendererGL.prototype._drawImmediateFill = function () { - var e, - t = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : 1, - r = this.GL, - o = - ((this._useVertexColor = - 0 < this.immediateMode.geometry.vertexColors.length), - (e = this._getImmediateFillShader()), - this._setFillUniforms(e), - !0), - n = !1, - s = void 0; - try { - for ( - var i, - a = this.immediateMode.buffers.fill[Symbol.iterator](); - !(o = (i = a.next()).done); - o = !0 - ) - i.value._prepareBuffer(this.immediateMode.geometry, e); - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - if ( - (e.disableRemainingAttributes(), - this._applyColorBlend(this.curFillColor), - 1 === t) - ) - r.drawArrays( - this.immediateMode.shapeMode, - 0, - this.immediateMode.geometry.vertices.length, - ); - else - try { - r.drawArraysInstanced( - this.immediateMode.shapeMode, - 0, - this.immediateMode.geometry.vertices.length, - t, - ); - } catch (e) { - console.log( - "🌸 p5.js says: Instancing is only supported in WebGL2 mode", - ); - } - e.unbindShader(); - }), - (l.default.RendererGL.prototype._drawImmediateStroke = - function () { - var e = this.GL, - t = - ((this._useLineColor = - 0 < - this.immediateMode.geometry.vertexStrokeColors.length), - this._getImmediateStrokeShader()), - r = (this._setStrokeUniforms(t), !0), - o = !1, - n = void 0; - try { - for ( - var s, - i = - this.immediateMode.buffers.stroke[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) - s.value._prepareBuffer(this.immediateMode.geometry, t); - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - t.disableRemainingAttributes(), - this._applyColorBlend(this.curStrokeColor), - e.drawArrays( - e.TRIANGLES, - 0, - this.immediateMode.geometry.lineVertices.length / 3, - ), - t.unbindShader(); - }), - l.default.RendererGL); - r.default = n; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.RenderBuffer": 329, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.find-index": 156, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.map": 164, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.map": 169, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 331: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.uint16-array"), - e("core-js/modules/es.typed-array.uint32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.uint16-array"), - e("core-js/modules/es.typed-array.uint32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var a = (s = e("../core/main")) && s.__esModule ? s : { default: s }, - n = - (e("./p5.RendererGL"), - e("./p5.RenderBuffer"), - (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = l(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants"))); - function l() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (l = function () { - return e; - }), - e); - } - (a.default.RendererGL.prototype.freeGeometry = function (e) { - e.gid - ? this._freeBuffers(e.gid) - : console.warn( - "The model you passed to freeGeometry does not have an id!", - ); - }), - (a.default.RendererGL.prototype._initBufferDefaults = function (e) { - var t; - return ( - this._freeBuffers(e), - 1e3 < Object.keys(this.retainedMode.geometry).length && - ((t = Object.keys(this.retainedMode.geometry)[0]), - this._freeBuffers(t)), - (this.retainedMode.geometry[e] = {}) - ); - }), - (a.default.RendererGL.prototype._freeBuffers = function (e) { - var a, - l = this.retainedMode.geometry[e]; - function t(e) { - var t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = e[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value; - l[i.dst] && (a.deleteBuffer(l[i.dst]), (l[i.dst] = null)); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - } - l && - (delete this.retainedMode.geometry[e], - (a = this.GL), - l.indexBuffer && a.deleteBuffer(l.indexBuffer), - t(this.retainedMode.buffers.stroke), - t(this.retainedMode.buffers.fill)); - }), - (a.default.RendererGL.prototype.createBuffers = function (e, t) { - var r, - o, - n, - s = this.GL, - e = this._initBufferDefaults(e), - i = ((e.model = t), e.indexBuffer); - return ( - t.faces.length - ? ((i = i || (e.indexBuffer = s.createBuffer())), - (n = (o = (r = a.default.RendererGL.prototype._flatten( - t.faces, - )).some(function (e) { - return 65535 < e; - })) - ? Uint32Array - : Uint16Array), - this._bindBuffer(i, s.ELEMENT_ARRAY_BUFFER, r, n), - (e.indexBufferType = o ? s.UNSIGNED_INT : s.UNSIGNED_SHORT), - (e.vertexCount = 3 * t.faces.length)) - : (i && (s.deleteBuffer(i), (e.indexBuffer = null)), - (e.vertexCount = t.vertices ? t.vertices.length : 0)), - (e.lineVertexCount = t.lineVertices - ? t.lineVertices.length / 3 - : 0), - e - ); - }), - (a.default.RendererGL.prototype.drawBuffers = function (e) { - var t = this.GL, - r = this.retainedMode.geometry[e]; - if ( - !this.geometryBuilder && - this._doFill && - 0 < this.retainedMode.geometry[e].vertexCount - ) { - this._useVertexColor = 0 < r.model.vertexColors.length; - var o = this._getRetainedFillShader(), - n = (this._setFillUniforms(o), !0), - s = !1, - i = void 0; - try { - for ( - var a, - l = this.retainedMode.buffers.fill[Symbol.iterator](); - !(n = (a = l.next()).done); - n = !0 - ) - a.value._prepareBuffer(r, o); - } catch (e) { - (s = !0), (i = e); - } finally { - try { - n || null == l.return || l.return(); - } finally { - if (s) throw i; - } - } - o.disableRemainingAttributes(), - r.indexBuffer && - this._bindBuffer(r.indexBuffer, t.ELEMENT_ARRAY_BUFFER), - this._applyColorBlend(this.curFillColor), - this._drawElements(t.TRIANGLES, e), - o.unbindShader(); - } - if ( - !this.geometryBuilder && - this._doStroke && - 0 < r.lineVertexCount - ) { - this._useLineColor = 0 < r.model.vertexStrokeColors.length; - var u = this._getRetainedStrokeShader(), - c = (this._setStrokeUniforms(u), !0), - s = !1, - i = void 0; - try { - for ( - var d, - h = this.retainedMode.buffers.stroke[Symbol.iterator](); - !(c = (d = h.next()).done); - c = !0 - ) - d.value._prepareBuffer(r, u); - } catch (e) { - (s = !0), (i = e); - } finally { - try { - c || null == h.return || h.return(); - } finally { - if (s) throw i; - } - } - u.disableRemainingAttributes(), - this._applyColorBlend(this.curStrokeColor), - this._drawArrays(t.TRIANGLES, e), - u.unbindShader(); - } - return ( - this.geometryBuilder && this.geometryBuilder.addRetained(r), - this - ); - }), - (a.default.RendererGL.prototype.drawBuffersScaled = function ( - e, - t, - r, - o, - ) { - var n = this.uMVMatrix.copy(); - try { - this.uMVMatrix.scale(t, r, o), this.drawBuffers(e); - } finally { - this.uMVMatrix = n; - } - }), - (a.default.RendererGL.prototype._drawArrays = function (e, t) { - return ( - this.GL.drawArrays( - e, - 0, - this.retainedMode.geometry[t].lineVertexCount, - ), - this - ); - }), - (a.default.RendererGL.prototype._drawElements = function (e, t) { - var t = this.retainedMode.geometry[t], - r = this.GL; - if (t.indexBuffer) { - if ( - this._pInst.webglVersion !== n.WEBGL2 && - t.indexBufferType === r.UNSIGNED_INT && - !r.getExtension("OES_element_index_uint") - ) - throw new Error( - "Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.", - ); - r.drawElements( - r.TRIANGLES, - t.vertexCount, - t.indexBufferType, - 0, - ); - } else r.drawArrays(e || r.TRIANGLES, 0, t.vertexCount); - }), - (a.default.RendererGL.prototype._drawPoints = function (e, t) { - var r = this.GL, - o = this._getImmediatePointShader(); - this._setPointUniforms(o), - this._bindBuffer( - t, - r.ARRAY_BUFFER, - this._vToNArray(e), - Float32Array, - r.STATIC_DRAW, - ), - o.enableAttrib(o.attributes.aPosition, 3), - this._applyColorBlend(this.curStrokeColor), - r.drawArrays(r.Points, 0, e.length), - o.unbindShader(); - }); - var s = a.default.RendererGL; - r.default = s; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.RenderBuffer": 329, - "./p5.RendererGL": 332, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.some": 166, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.float32-array": 211, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint16-array": 232, - "core-js/modules/es.typed-array.uint32-array": 233, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 332: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.copy-within"), - e("core-js/modules/es.array.every"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.map"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.reflect.get"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.float64-array"), - e("core-js/modules/es.typed-array.int16-array"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint16-array"), - e("core-js/modules/es.typed-array.uint32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.concat"), - e("core-js/modules/es.array.copy-within"), - e("core-js/modules/es.array.every"), - e("core-js/modules/es.array.fill"), - e("core-js/modules/es.array.from"), - e("core-js/modules/es.array.includes"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.map"), - e("core-js/modules/es.object.assign"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.set"), - e("core-js/modules/es.string.includes"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.float32-array"), - e("core-js/modules/es.typed-array.float64-array"), - e("core-js/modules/es.typed-array.int16-array"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.uint16-array"), - e("core-js/modules/es.typed-array.uint32-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.readPixelsWebGL = k), - (r.readPixelWebGL = C), - (r.default = void 0); - var g = n(e("../core/main")), - l = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = d(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")), - a = n(e("./GeometryBuilder")), - u = n(e("libtess")), - c = - (e("./p5.Shader"), - e("./p5.Camera"), - e("../core/p5.Renderer"), - e("./p5.Matrix"), - e("./p5.Framebuffer"), - e("path"), - e("./p5.Texture")); - function d() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (d = function () { - return e; - }), - e); - } - function n(e) { - return e && e.__esModule ? e : { default: e }; - } - function h(e) { - return ( - (function (e) { - if (Array.isArray(e)) { - for (var t = 0, r = new Array(e.length); t < e.length; t++) - r[t] = e[t]; - return r; - } - })(e) || - (function (e) { - if ( - Symbol.iterator in Object(e) || - "[object Arguments]" === Object.prototype.toString.call(e) - ) - return Array.from(e); - })(e) || - (function () { - throw new TypeError( - "Invalid attempt to spread non-iterable instance", - ); - })() - ); - } - function f(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function p(e, t, r) { - return (p = - "undefined" != typeof Reflect && Reflect.get - ? Reflect.get - : function (e, t, r) { - var e = (function (e, t) { - for ( - ; - !Object.prototype.hasOwnProperty.call(e, t) && - null !== (e = b(e)); - - ); - return e; - })(e, t); - if (e) - return (e = Object.getOwnPropertyDescriptor(e, t)).get - ? e.get.call(r) - : e.value; - })(e, t, r || e); - } - function m(e, t) { - return (m = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function y(o) { - return function () { - var e, - t, - r = b(o); - return ( - (e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = b(this).constructor), - Reflect.construct(r, arguments, e)) - : r.apply(this, arguments)), - (r = this), - !(t = e) || ("object" !== i(t) && "function" != typeof t) - ? v(r) - : t - ); - }; - } - function v(e) { - if (void 0 === e) - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - return e; - } - function b(e) { - return (b = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - function j(e, t, r) { - t in e - ? Object.defineProperty(e, t, { - value: r, - enumerable: !0, - configurable: !0, - writable: !0, - }) - : (e[t] = r); - } - function s(e, t) { - (T += "#define STROKE_CAP_".concat(e, " ").concat(t, "\n")), - (w[l[e]] = t); - } - function _(e, t) { - (T += "#define STROKE_JOIN_".concat(e, " ").concat(t, "\n")), - (S[l[e]] = t); - } - var x, - w = {}, - S = {}, - T = "", - e = - (s("ROUND", 0), - s("PROJECT", 1), - s("SQUARE", 2), - _("ROUND", 0), - _("MITER", 1), - _("BEVEL", 2), - '#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n// roughness for use in calculateImageSpecular\nuniform float levelOfDetail;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n return angles;\n}\n\n\nvec3 calculateImageDiffuse( vec3 vNormal, vec3 vViewPosition ){\n // make 2 seperate builds \n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0); // hardcoded world camera position\n vec3 worldNormal = normalize(vNormal);\n vec2 newTexCoor = mapTextureToNormal( worldNormal );\n vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return smoothstep(vec3(0.0), vec3(0.8), texture.xyz);\n}\n\nvec3 calculateImageSpecular( vec3 vNormal, vec3 vViewPosition ){\n vec3 worldCameraPosition = vec3(0.0, 0.0, 0.0);\n vec3 worldNormal = normalize(vNormal);\n vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n vec3 R = reflect(lightDirection, worldNormal);\n vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, levelOfDetail);\n#else\n vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n // this is to make the darker sections more dark\n // png and jpg usually flatten the brightness so it is to reverse that\n return pow(outColor.xyz, vec3(10.0));\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n if( uUseImageLight ){\n totalDiffuse += calculateImageDiffuse(normal, modelPosition);\n totalSpecular += calculateImageSpecular(normal, modelPosition);\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n'), - M = { - immediateVert: - "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nOUT vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n", - vertexColorVert: - "IN vec3 aPosition;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n", - vertexColorFrag: - "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", - normalVert: - "IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", - normalFrag: - "IN vec3 vVertexNormal;\nvoid main(void) {\n OUT_COLOR = vec4(vVertexNormal, 1.0);\n}\n", - basicFrag: - "IN vec4 vColor;\nvoid main(void) {\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", - lightVert: - e + - "// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", - lightTextureFrag: - "uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n OUT_COLOR = vColor;\n }\n else {\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n }\n}\n", - phongVert: - "precision highp int;\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n", - phongFrag: - e + - "// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture\n // Textures come in with premultiplied alpha. To apply tint and still have\n // premultiplied alpha output, we need to multiply the RGB channels by the\n // tint RGB, and all channels by the tint alpha.\n ? TEXTURE(uSampler, vTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n // channels by alpha to convert it to premultiplied alpha.\n : vec4(vColor.rgb * vColor.a, vColor.a);\n OUT_COLOR = vec4(diffuse * baseColor.rgb + \n vAmbientColor * (\n uHasSetAmbient ? uAmbientMatColor.rgb : baseColor.rgb\n ) + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, baseColor.a);\n}\n", - fontVert: - "IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n", - fontFrag: - "#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = ROUND(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of 't' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n", - lineVert: - T + - "/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n", - lineFrag: - T + - "precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n", - pointVert: - "IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n", - pointFrag: - "precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n", - imageLightVert: - "precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n", - imageLightDiffusedFrag: - "precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}", - imageLightSpecularFrag: - "precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n", - }; - for (x in M) - M[x] = - "#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n" + - M[x]; - j( - (e = {}), - l.GRAY, - "precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n", - ), - j( - e, - l.ERODE, - "// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", - ), - j( - e, - l.DILATE, - "// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n", - ), - j( - e, - l.BLUR, - "precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n", - ), - j( - e, - l.POSTERIZE, - "// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n", - ), - j( - e, - l.OPAQUE, - "// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n", - ), - j( - e, - l.INVERT, - "// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n", - ), - j( - e, - l.THRESHOLD, - "// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n", - ); - var E = e; - function k(e, t, r, o, n, s, i, a, l, u) { - var c = t.getParameter(t.FRAMEBUFFER_BINDING), - r = (t.bindFramebuffer(t.FRAMEBUFFER, r), a === t.RGBA ? 4 : 3), - d = s * i * r, - h = l === t.UNSIGNED_BYTE ? Uint8Array : Float32Array; - if ( - ((e instanceof h && e.length === d) || (e = new h(d)), - t.readPixels(o, u ? u - n - i : n, s, i, a, l, e), - t.bindFramebuffer(t.FRAMEBUFFER, c), - u) - ) - for ( - var f = Math.floor(i / 2), p = new h(s * r), m = 0; - m < f; - m++ - ) { - var y = m * s * 4, - g = (i - m - 1) * s * 4; - p.set(e.subarray(y, y + 4 * s)), - e.copyWithin(y, g, g + 4 * s), - e.set(p, g); - } - return e; - } - function C(e, t, r, o, n, s, i) { - var a = e.getParameter(e.FRAMEBUFFER_BINDING), - t = (e.bindFramebuffer(e.FRAMEBUFFER, t), n === e.RGBA ? 4 : 3), - t = new (s === e.UNSIGNED_BYTE ? Uint8Array : Float32Array)(t); - return ( - e.readPixels(r, i ? i - o - 1 : o, 1, 1, n, s, t), - e.bindFramebuffer(e.FRAMEBUFFER, a), - Array.from(t) - ); - } - (g.default.prototype.setAttributes = function (e, t) { - if (void 0 === this._glAttributes) - console.log( - "You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.", - ); - else { - var r = !0; - if ( - (void 0 !== t - ? (null === this._glAttributes && (this._glAttributes = {}), - this._glAttributes[e] !== t && - ((this._glAttributes[e] = t), (r = !1))) - : e instanceof Object && - this._glAttributes !== e && - ((this._glAttributes = e), (r = !1)), - this._renderer.isP3D && !r) - ) { - if (!this._setupDone) - for (var o in this._renderer.retainedMode.geometry) - if (this._renderer.retainedMode.geometry.hasOwnProperty(o)) - return void g.default._friendlyError( - "Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()", - ); - this.push(), - this._renderer._resetContext(), - this.pop(), - this._renderer._curCamera && - (this._renderer._curCamera._renderer = this._renderer); - } - } - }), - (g.default.RendererGL = (function (e) { - var t = s; - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && m(t, e); - var r, - n = y(s); - function s(e, t, r, o) { - if (this instanceof s) - return ( - (e = n.call(this, e, t, r))._setAttributeDefaults(t), - e._initContext(), - (e.isP3D = !0), - (e.geometryBuilder = void 0), - (e.GL = e.drawingContext), - e._pInst._setProperty("drawingContext", e.drawingContext), - (e._isErasing = !1), - (e._clipDepths = []), - (e._isClipApplied = !1), - (e._stencilTestOn = !1), - (e._enableLighting = !1), - (e.ambientLightColors = []), - (e.specularColors = [1, 1, 1]), - (e.directionalLightDirections = []), - (e.directionalLightDiffuseColors = []), - (e.directionalLightSpecularColors = []), - (e.pointLightPositions = []), - (e.pointLightDiffuseColors = []), - (e.pointLightSpecularColors = []), - (e.spotLightPositions = []), - (e.spotLightDirections = []), - (e.spotLightDiffuseColors = []), - (e.spotLightSpecularColors = []), - (e.spotLightAngle = []), - (e.spotLightConc = []), - (e.activeImageLight = null), - (e.diffusedTextures = new Map()), - (e.specularTextures = new Map()), - (e.drawMode = l.FILL), - (e.curFillColor = e._cachedFillStyle = [1, 1, 1, 1]), - (e.curAmbientColor = e._cachedFillStyle = [1, 1, 1, 1]), - (e.curSpecularColor = e._cachedFillStyle = [0, 0, 0, 0]), - (e.curEmissiveColor = e._cachedFillStyle = [0, 0, 0, 0]), - (e.curStrokeColor = e._cachedStrokeStyle = [0, 0, 0, 1]), - (e.curBlendMode = l.BLEND), - (e._cachedBlendMode = void 0), - e.webglVersion === l.WEBGL2 - ? (e.blendExt = e.GL) - : (e.blendExt = e.GL.getExtension("EXT_blend_minmax")), - (e._isBlending = !1), - (e._hasSetAmbient = !1), - (e._useSpecularMaterial = !1), - (e._useEmissiveMaterial = !1), - (e._useNormalMaterial = !1), - (e._useShininess = 1), - (e._useLineColor = !1), - (e._useVertexColor = !1), - (e.registerEnabled = new Set()), - (e._tint = [255, 255, 255, 255]), - (e.constantAttenuation = 1), - (e.linearAttenuation = 0), - (e.quadraticAttenuation = 0), - (e.uMVMatrix = new g.default.Matrix()), - (e.uPMatrix = new g.default.Matrix()), - (e.uNMatrix = new g.default.Matrix("mat3")), - (e._currentNormal = new g.default.Vector(0, 0, 1)), - (e._curCamera = new g.default.Camera(v(e))), - e._curCamera._computeCameraDefaultSettings(), - e._curCamera._setDefaultCamera(), - (e.filterCamera = new g.default.Camera(v(e))), - e.filterCamera._computeCameraDefaultSettings(), - e.filterCamera._setDefaultCamera(), - (e.prevTouches = []), - (e.zoomVelocity = 0), - (e.rotateVelocity = new g.default.Vector(0, 0)), - (e.moveVelocity = new g.default.Vector(0, 0)), - (e.executeZoom = !1), - (e.executeRotateAndMove = !1), - (e._defaultLightShader = void 0), - (e._defaultImmediateModeShader = void 0), - (e._defaultNormalShader = void 0), - (e._defaultColorShader = void 0), - (e._defaultPointShader = void 0), - (e.userFillShader = void 0), - (e.userStrokeShader = void 0), - (e.userPointShader = void 0), - (e.retainedMode = { - geometry: {}, - buffers: { - stroke: [ - new g.default.RenderBuffer( - 4, - "lineVertexColors", - "lineColorBuffer", - "aVertexColor", - v(e), - ), - new g.default.RenderBuffer( - 3, - "lineVertices", - "lineVerticesBuffer", - "aPosition", - v(e), - ), - new g.default.RenderBuffer( - 3, - "lineTangentsIn", - "lineTangentsInBuffer", - "aTangentIn", - v(e), - ), - new g.default.RenderBuffer( - 3, - "lineTangentsOut", - "lineTangentsOutBuffer", - "aTangentOut", - v(e), - ), - new g.default.RenderBuffer( - 1, - "lineSides", - "lineSidesBuffer", - "aSide", - v(e), - ), - ], - fill: [ - new g.default.RenderBuffer( - 3, - "vertices", - "vertexBuffer", - "aPosition", - v(e), - e._vToNArray, - ), - new g.default.RenderBuffer( - 3, - "vertexNormals", - "normalBuffer", - "aNormal", - v(e), - e._vToNArray, - ), - new g.default.RenderBuffer( - 4, - "vertexColors", - "colorBuffer", - "aVertexColor", - v(e), - ), - new g.default.RenderBuffer( - 3, - "vertexAmbients", - "ambientBuffer", - "aAmbientColor", - v(e), - ), - new g.default.RenderBuffer( - 2, - "uvs", - "uvBuffer", - "aTexCoord", - v(e), - e._flatten, - ), - ], - text: [ - new g.default.RenderBuffer( - 3, - "vertices", - "vertexBuffer", - "aPosition", - v(e), - e._vToNArray, - ), - new g.default.RenderBuffer( - 2, - "uvs", - "uvBuffer", - "aTexCoord", - v(e), - e._flatten, - ), - ], - }, - }), - (e.immediateMode = { - geometry: new g.default.Geometry(), - shapeMode: l.TRIANGLE_FAN, - contourIndices: [], - _bezierVertex: [], - _quadraticVertex: [], - _curveVertex: [], - buffers: { - fill: [ - new g.default.RenderBuffer( - 3, - "vertices", - "vertexBuffer", - "aPosition", - v(e), - e._vToNArray, - ), - new g.default.RenderBuffer( - 3, - "vertexNormals", - "normalBuffer", - "aNormal", - v(e), - e._vToNArray, - ), - new g.default.RenderBuffer( - 4, - "vertexColors", - "colorBuffer", - "aVertexColor", - v(e), - ), - new g.default.RenderBuffer( - 3, - "vertexAmbients", - "ambientBuffer", - "aAmbientColor", - v(e), - ), - new g.default.RenderBuffer( - 2, - "uvs", - "uvBuffer", - "aTexCoord", - v(e), - e._flatten, - ), - ], - stroke: [ - new g.default.RenderBuffer( - 4, - "lineVertexColors", - "lineColorBuffer", - "aVertexColor", - v(e), - ), - new g.default.RenderBuffer( - 3, - "lineVertices", - "lineVerticesBuffer", - "aPosition", - v(e), - ), - new g.default.RenderBuffer( - 3, - "lineTangentsIn", - "lineTangentsInBuffer", - "aTangentIn", - v(e), - ), - new g.default.RenderBuffer( - 3, - "lineTangentsOut", - "lineTangentsOutBuffer", - "aTangentOut", - v(e), - ), - new g.default.RenderBuffer( - 1, - "lineSides", - "lineSidesBuffer", - "aSide", - v(e), - ), - ], - point: e.GL.createBuffer(), - }, - }), - (e.pointSize = 5), - (e.curStrokeWeight = 1), - (e.curStrokeCap = l.ROUND), - (e.curStrokeJoin = l.ROUND), - (e.textures = new Map()), - (e.framebuffers = new Set()), - (e.activeFramebuffers = []), - (e.filterShader = void 0), - (e.filterLayer = void 0), - (e.filterLayerTemp = void 0), - (e.defaultFilterShaders = {}), - (e.textureMode = l.IMAGE), - (e.textureWrapX = l.CLAMP), - (e.textureWrapY = l.CLAMP), - (e._tex = null), - (e._curveTightness = 6), - (e._lookUpTableBezier = []), - (e._lookUpTableQuadratic = []), - (e._lutBezierDetail = 0), - (e._lutQuadraticDetail = 0), - (e.isProcessingVertices = !1), - (e._tessy = e._initTessy()), - (e.fontInfos = {}), - (e._curShader = void 0), - e - ); - throw new TypeError("Cannot call a class as a function"); - } - return ( - (t = s), - (e = [ - { - key: "beginGeometry", - value: function () { - if (this.geometryBuilder) - throw new Error( - "It looks like `beginGeometry()` is being called while another p5.Geometry is already being build.", - ); - this.geometryBuilder = new a.default(this); - }, - }, - { - key: "endGeometry", - value: function () { - var e; - if (this.geometryBuilder) - return ( - (e = this.geometryBuilder.finish()), - (this.geometryBuilder = void 0), - e - ); - throw new Error( - "Make sure you call beginGeometry() before endGeometry()!", - ); - }, - }, - { - key: "buildGeometry", - value: function (e) { - return this.beginGeometry(), e(), this.endGeometry(); - }, - }, - { - key: "_setAttributeDefaults", - value: function (e) { - var t = { - alpha: !0, - depth: !0, - stencil: !0, - antialias: navigator.userAgent - .toLowerCase() - .includes("safari"), - premultipliedAlpha: !0, - preserveDrawingBuffer: !0, - perPixelLighting: !0, - version: 2, - }; - null === e._glAttributes - ? (e._glAttributes = t) - : (e._glAttributes = Object.assign(t, e._glAttributes)); - }, - }, - { - key: "_initContext", - value: function () { - if ( - (1 !== this._pInst._glAttributes.version && - (this.drawingContext = this.canvas.getContext( - "webgl2", - this._pInst._glAttributes, - )), - (this.webglVersion = this.drawingContext - ? l.WEBGL2 - : l.WEBGL), - this._pInst._setProperty( - "webglVersion", - this.webglVersion, - ), - this.drawingContext || - (this.drawingContext = - this.canvas.getContext( - "webgl", - this._pInst._glAttributes, - ) || - this.canvas.getContext( - "experimental-webgl", - this._pInst._glAttributes, - )), - null === this.drawingContext) - ) - throw new Error("Error creating webgl context"); - var e = this.drawingContext; - e.enable(e.DEPTH_TEST), - e.depthFunc(e.LEQUAL), - e.viewport( - 0, - 0, - e.drawingBufferWidth, - e.drawingBufferHeight, - ), - e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), - (this._viewport = this.drawingContext.getParameter( - this.drawingContext.VIEWPORT, - )); - }, - }, - { - key: "_resetContext", - value: function (e, t) { - var r, - o = this.width, - n = this.height, - s = this.canvas.id, - i = this._pInst instanceof g.default.Graphics, - s = - (i - ? ((r = this._pInst).canvas.parentNode.removeChild( - r.canvas, - ), - (r.canvas = document.createElement("canvas")), - (r._pInst._userNode || document.body).appendChild( - r.canvas, - ), - g.default.Element.call(r, r.canvas, r._pInst), - (r.width = o), - (r.height = n)) - : ((r = this.canvas) && r.parentNode.removeChild(r), - ((r = document.createElement("canvas")).id = s), - ( - this._pInst._userNode || document.body - ).appendChild(r), - (this._pInst.canvas = r), - (this.canvas = r)), - new g.default.RendererGL( - this._pInst.canvas, - this._pInst, - !i, - )); - this._pInst._setProperty("_renderer", s), - s.resize(o, n), - s._applyDefaults(), - i || this._pInst._elements.push(s), - "function" == typeof t && - setTimeout(function () { - t.apply(window._renderer, e); - }, 0); - }, - }, - { - key: "_update", - value: function () { - this.uMVMatrix.set( - this._curCamera.cameraMatrix.mat4[0], - this._curCamera.cameraMatrix.mat4[1], - this._curCamera.cameraMatrix.mat4[2], - this._curCamera.cameraMatrix.mat4[3], - this._curCamera.cameraMatrix.mat4[4], - this._curCamera.cameraMatrix.mat4[5], - this._curCamera.cameraMatrix.mat4[6], - this._curCamera.cameraMatrix.mat4[7], - this._curCamera.cameraMatrix.mat4[8], - this._curCamera.cameraMatrix.mat4[9], - this._curCamera.cameraMatrix.mat4[10], - this._curCamera.cameraMatrix.mat4[11], - this._curCamera.cameraMatrix.mat4[12], - this._curCamera.cameraMatrix.mat4[13], - this._curCamera.cameraMatrix.mat4[14], - this._curCamera.cameraMatrix.mat4[15], - ), - (this.ambientLightColors.length = 0), - (this.specularColors = [1, 1, 1]), - (this.directionalLightDirections.length = 0), - (this.directionalLightDiffuseColors.length = 0), - (this.directionalLightSpecularColors.length = 0), - (this.pointLightPositions.length = 0), - (this.pointLightDiffuseColors.length = 0), - (this.pointLightSpecularColors.length = 0), - (this.spotLightPositions.length = 0), - (this.spotLightDirections.length = 0), - (this.spotLightDiffuseColors.length = 0), - (this.spotLightSpecularColors.length = 0), - (this.spotLightAngle.length = 0), - (this.spotLightConc.length = 0), - (this._enableLighting = !1), - (this._tint = [255, 255, 255, 255]), - this.GL.clearStencil(0), - this.GL.clear( - this.GL.DEPTH_BUFFER_BIT | this.GL.STENCIL_BUFFER_BIT, - ), - this.GL.disable(this.GL.STENCIL_TEST); - }, - }, - { - key: "background", - value: function () { - var e = (e = this._pInst).color.apply(e, arguments), - t = e.levels[0] / 255, - r = e.levels[1] / 255, - o = e.levels[2] / 255, - e = e.levels[3] / 255; - this.clear(t, r, o, e); - }, - }, - { - key: "fill", - value: function (e, t, r, o) { - var n = g.default.prototype.color.apply( - this._pInst, - arguments, - ); - (this.curFillColor = n._array), - (this.drawMode = l.FILL), - (this._useNormalMaterial = !1), - (this._tex = null); - }, - }, - { - key: "stroke", - value: function (e, t, r, o) { - var n = g.default.prototype.color.apply( - this._pInst, - arguments, - ); - this.curStrokeColor = n._array; - }, - }, - { - key: "strokeCap", - value: function (e) { - this.curStrokeCap = e; - }, - }, - { - key: "strokeJoin", - value: function (e) { - this.curStrokeJoin = e; - }, - }, - { - key: "getFilterLayer", - value: function () { - return ( - this.filterLayer || - (this.filterLayer = this._pInst.createFramebuffer()), - this.filterLayer - ); - }, - }, - { - key: "getFilterLayerTemp", - value: function () { - return ( - this.filterLayerTemp || - (this.filterLayerTemp = - this._pInst.createFramebuffer()), - this.filterLayerTemp - ); - }, - }, - { - key: "matchSize", - value: function (e, t) { - (e.width === t.width && e.height === t.height) || - e.resize(t.width, t.height), - e.pixelDensity() !== t.pixelDensity() && - e.pixelDensity(t.pixelDensity()); - }, - }, - { - key: "filter", - value: function () { - var e, - t, - r = this, - o = this.getFilterLayer(), - n = void 0, - s = void 0, - i = - ("string" == - typeof (arguments.length <= 0 ? void 0 : arguments[0]) - ? ((s = - arguments.length <= 0 ? void 0 : arguments[0]), - j((e = {}), l.BLUR, 3), - j(e, l.POSTERIZE, 4), - j(e, l.THRESHOLD, 0.5), - (n = - s in (e = e) && - void 0 === - (arguments.length <= 1 - ? void 0 - : arguments[1]) - ? e[s] - : arguments.length <= 1 - ? void 0 - : arguments[1]), - s in this.defaultFilterShaders || - (this.defaultFilterShaders[s] = - new g.default.Shader( - o._renderer, - "uniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nattribute vec3 aPosition;\n// texcoords only come from p5 to vertex shader\n// so pass texcoords on to the fragment shader in a varying variable\nattribute vec2 aTexCoord;\nvarying vec2 vTexCoord;\n\nvoid main() {\n // transferring texcoords for the frag shader\n vTexCoord = aTexCoord;\n\n // copy position with a fourth coordinate for projection (1.0 is normal)\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n", - E[s], - )), - (this.filterShader = - this.defaultFilterShaders[s])) - : (this.filterShader = - arguments.length <= 0 ? void 0 : arguments[0]), - this.activeFramebuffer() || this), - a = - (this.matchSize(o, i), - i !== this && - (this.filterCamera = - this.getFilterLayer().createCamera()), - o.draw(function () { - return r._pInst.clear(); - }), - [ - 1 / (i.width * i.pixelDensity()), - 1 / (i.height * i.pixelDensity()), - ]); - s === l.BLUR - ? ((t = this.getFilterLayerTemp()), - this.matchSize(t, i), - this._pInst.push(), - this._pInst.noStroke(), - this._pInst.shader(this.filterShader), - this.filterShader.setUniform("texelSize", a), - this.filterShader.setUniform("canvasSize", [ - i.width, - i.height, - ]), - this.filterShader.setUniform( - "radius", - Math.max(1, n), - ), - t.draw(function () { - r.filterShader.setUniform("direction", [1, 0]), - r.filterShader.setUniform("tex0", i), - r._pInst.clear(), - r._pInst.shader(r.filterShader), - r._pInst.rect( - -i.width / 2, - -i.height / 2, - i.width, - i.height, - ); - }), - o.draw(function () { - r.filterShader.setUniform("direction", [0, 1]), - r.filterShader.setUniform("tex0", t), - r._pInst.clear(), - r._pInst.shader(r.filterShader), - r._pInst.rect( - -i.width / 2, - -i.height / 2, - i.width, - i.height, - ); - }), - this._pInst.pop()) - : o.draw(function () { - r._pInst.noStroke(), - r._pInst.shader(r.filterShader), - r.filterShader.setUniform("tex0", i), - r.filterShader.setUniform("texelSize", a), - r.filterShader.setUniform("canvasSize", [ - i.width, - i.height, - ]), - r.filterShader.setUniform("filterParameter", n), - r._pInst.rect( - -i.width / 2, - -i.height / 2, - i.width, - i.height, - ); - }), - this._pInst.push(), - this._pInst.noStroke(), - this.clear(), - this._pInst.push(), - this._pInst.imageMode(l.CORNER), - this._pInst.blendMode(l.BLEND), - this.filterCamera._resize(), - this._pInst.setCamera(this.filterCamera), - this._pInst.resetMatrix(), - this._pInst.image( - o, - -this.width / 2, - -this.height / 2, - this.width, - this.height, - ), - this._pInst.pop(), - this._pInst.pop(); - }, - }, - { - key: "pixelDensity", - value: function (e) { - return e - ? this._pInst.pixelDensity(e) - : this._pInst.pixelDensity(); - }, - }, - { - key: "blendMode", - value: function (e) { - e === l.DARKEST || - e === l.LIGHTEST || - e === l.ADD || - e === l.BLEND || - e === l.SUBTRACT || - e === l.SCREEN || - e === l.EXCLUSION || - e === l.REPLACE || - e === l.MULTIPLY || - e === l.REMOVE - ? (this.curBlendMode = e) - : (e !== l.BURN && - e !== l.OVERLAY && - e !== l.HARD_LIGHT && - e !== l.SOFT_LIGHT && - e !== l.DODGE) || - console.warn( - "BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.", - ); - }, - }, - { - key: "erase", - value: function (e, t) { - this._isErasing || - ((this._cachedBlendMode = this.curBlendMode), - (this._isErasing = !0), - this.blendMode(l.REMOVE), - (this._cachedFillStyle = this.curFillColor.slice()), - (this.curFillColor = [1, 1, 1, e / 255]), - (this._cachedStrokeStyle = this.curStrokeColor.slice()), - (this.curStrokeColor = [1, 1, 1, t / 255])); - }, - }, - { - key: "noErase", - value: function () { - var e; - this._isErasing && - ((this.curFillColor = this._cachedFillStyle.slice()), - (this.curStrokeColor = this._cachedStrokeStyle.slice()), - (e = this.curBlendMode), - this.blendMode(this._cachedBlendMode), - (this._cachedBlendMode = e), - (this._isErasing = !1), - this._applyBlendMode()); - }, - }, - { - key: "drawTarget", - value: function () { - return ( - this.activeFramebuffers[ - this.activeFramebuffers.length - 1 - ] || this - ); - }, - }, - { - key: "beginClip", - value: function () { - var e = - 0 < arguments.length && void 0 !== arguments[0] - ? arguments[0] - : {}, - e = - (p(b(s.prototype), "beginClip", this).call(this, e), - (this.drawTarget()._isClipApplied = !0), - this.GL); - e.clearStencil(0), - e.clear(e.STENCIL_BUFFER_BIT), - e.enable(e.STENCIL_TEST), - (this._stencilTestOn = !0), - e.stencilFunc(e.ALWAYS, 1, 255), - e.stencilOp(e.KEEP, e.KEEP, e.REPLACE), - e.disable(e.DEPTH_TEST), - this._pInst.push(), - this._pInst.resetShader(), - this._doFill && this._pInst.fill(0, 0), - this._doStroke && this._pInst.stroke(0, 0); - }, - }, - { - key: "endClip", - value: function () { - this._pInst.pop(); - var e = this.GL; - e.stencilOp(e.KEEP, e.KEEP, e.KEEP), - e.stencilFunc( - this._clipInvert ? e.EQUAL : e.NOTEQUAL, - 0, - 255, - ), - e.enable(e.DEPTH_TEST), - this._clipDepths.push(this._pushPopDepth), - p(b(s.prototype), "endClip", this).call(this); - }, - }, - { - key: "_clearClip", - value: function () { - this.GL.clearStencil(1), - this.GL.clear(this.GL.STENCIL_BUFFER_BIT), - 0 < this._clipDepths.length && this._clipDepths.pop(), - (this.drawTarget()._isClipApplied = !1); - }, - }, - { - key: "strokeWeight", - value: function (e) { - this.curStrokeWeight !== e && - ((this.pointSize = e), (this.curStrokeWeight = e)); - }, - }, - { - key: "_getPixel", - value: function (e, t) { - var r = this.GL; - return C( - r, - null, - e, - t, - r.RGBA, - r.UNSIGNED_BYTE, - this._pInst.height * this._pInst.pixelDensity(), - ); - }, - }, - { - key: "loadPixels", - value: function () { - var e, - t, - r = this._pixelsState; - !0 !== this._pInst._glAttributes.preserveDrawingBuffer - ? console.log( - "loadPixels only works in WebGL when preserveDrawingBuffer is true.", - ) - : ((e = this._pInst._pixelDensity), - (t = this.GL), - r._setProperty( - "pixels", - k( - r.pixels, - t, - null, - 0, - 0, - this.width * e, - this.height * e, - t.RGBA, - t.UNSIGNED_BYTE, - this.height * e, - ), - )); - }, - }, - { - key: "updatePixels", - value: function () { - var e = this._getTempFramebuffer(); - (e.pixels = this._pixelsState.pixels), - e.updatePixels(), - this._pInst.push(), - this._pInst.resetMatrix(), - this._pInst.clear(), - this._pInst.imageMode(l.CENTER), - this._pInst.image(e, 0, 0), - this._pInst.pop(), - this.GL.clearDepth(1), - this.GL.clear(this.GL.DEPTH_BUFFER_BIT); - }, - }, - { - key: "_getTempFramebuffer", - value: function () { - return ( - this._tempFramebuffer || - (this._tempFramebuffer = - this._pInst.createFramebuffer({ - format: l.UNSIGNED_BYTE, - useDepth: this._pInst._glAttributes.depth, - depthFormat: l.UNSIGNED_INT, - antialias: this._pInst._glAttributes.antialias, - })), - this._tempFramebuffer - ); - }, - }, - { - key: "geometryInHash", - value: function (e) { - return void 0 !== this.retainedMode.geometry[e]; - }, - }, - { - key: "viewport", - value: function (e, t) { - (this._viewport = [0, 0, e, t]), - this.GL.viewport(0, 0, e, t); - }, - }, - { - key: "resize", - value: function (t, r) { - g.default.Renderer.prototype.resize.call(this, t, r), - (this._origViewport = { - width: this.GL.drawingBufferWidth, - height: this.GL.drawingBufferHeight, - }), - this.viewport( - this._origViewport.width, - this._origViewport.height, - ), - this._curCamera._resize(); - var t = this._pixelsState, - e = - (void 0 !== t.pixels && - t._setProperty( - "pixels", - new Uint8Array( - this.GL.drawingBufferWidth * - this.GL.drawingBufferHeight * - 4, - ), - ), - !0), - r = !1, - t = void 0; - try { - for ( - var o, n = this.framebuffers[Symbol.iterator](); - !(e = (o = n.next()).done); - e = !0 - ) - o.value._canvasSizeChanged(); - } catch (e) { - (r = !0), (t = e); - } finally { - try { - e || null == n.return || n.return(); - } finally { - if (r) throw t; - } - } - }, - }, - { - key: "clear", - value: function () { - var e = - (arguments.length <= 0 ? void 0 : arguments[0]) || 0, - t = - (arguments.length <= 1 ? void 0 : arguments[1]) || 0, - r = - (arguments.length <= 2 ? void 0 : arguments[2]) || 0, - o = - (arguments.length <= 3 ? void 0 : arguments[3]) || 0, - n = this.activeFramebuffer(); - n && - n.format === l.UNSIGNED_BYTE && - !n.antialias && - 0 === o && - (o = 1e-10), - this.GL.clearColor(e * o, t * o, r * o, o), - this.GL.clearDepth(1), - this.GL.clear( - this.GL.COLOR_BUFFER_BIT | this.GL.DEPTH_BUFFER_BIT, - ); - }, - }, - { - key: "applyMatrix", - value: function (e, t, r, o, n, s) { - 16 === arguments.length - ? g.default.Matrix.prototype.apply.apply( - this.uMVMatrix, - arguments, - ) - : this.uMVMatrix.apply([ - e, - t, - 0, - 0, - r, - o, - 0, - 0, - 0, - 0, - 1, - 0, - n, - s, - 0, - 1, - ]); - }, - }, - { - key: "translate", - value: function (e, t, r) { - return ( - e instanceof g.default.Vector && - ((r = e.z), (t = e.y), (e = e.x)), - this.uMVMatrix.translate([e, t, r]), - this - ); - }, - }, - { - key: "scale", - value: function (e, t, r) { - return this.uMVMatrix.scale(e, t, r), this; - }, - }, - { - key: "rotate", - value: function (e, t) { - return void 0 === t - ? this.rotateZ(e) - : (g.default.Matrix.prototype.rotate.apply( - this.uMVMatrix, - arguments, - ), - this); - }, - }, - { - key: "rotateX", - value: function (e) { - return this.rotate(e, 1, 0, 0), this; - }, - }, - { - key: "rotateY", - value: function (e) { - return this.rotate(e, 0, 1, 0), this; - }, - }, - { - key: "rotateZ", - value: function (e) { - return this.rotate(e, 0, 0, 1), this; - }, - }, - { - key: "push", - value: function () { - var e = g.default.Renderer.prototype.push.apply(this), - t = e.properties; - return ( - (t.uMVMatrix = this.uMVMatrix.copy()), - (t.uPMatrix = this.uPMatrix.copy()), - (t._curCamera = this._curCamera), - (this._curCamera = this._curCamera.copy()), - (t.ambientLightColors = - this.ambientLightColors.slice()), - (t.specularColors = this.specularColors.slice()), - (t.directionalLightDirections = - this.directionalLightDirections.slice()), - (t.directionalLightDiffuseColors = - this.directionalLightDiffuseColors.slice()), - (t.directionalLightSpecularColors = - this.directionalLightSpecularColors.slice()), - (t.pointLightPositions = - this.pointLightPositions.slice()), - (t.pointLightDiffuseColors = - this.pointLightDiffuseColors.slice()), - (t.pointLightSpecularColors = - this.pointLightSpecularColors.slice()), - (t.spotLightPositions = - this.spotLightPositions.slice()), - (t.spotLightDirections = - this.spotLightDirections.slice()), - (t.spotLightDiffuseColors = - this.spotLightDiffuseColors.slice()), - (t.spotLightSpecularColors = - this.spotLightSpecularColors.slice()), - (t.spotLightAngle = this.spotLightAngle.slice()), - (t.spotLightConc = this.spotLightConc.slice()), - (t.userFillShader = this.userFillShader), - (t.userStrokeShader = this.userStrokeShader), - (t.userPointShader = this.userPointShader), - (t.pointSize = this.pointSize), - (t.curStrokeWeight = this.curStrokeWeight), - (t.curStrokeColor = this.curStrokeColor), - (t.curFillColor = this.curFillColor), - (t.curAmbientColor = this.curAmbientColor), - (t.curSpecularColor = this.curSpecularColor), - (t.curEmissiveColor = this.curEmissiveColor), - (t._hasSetAmbient = this._hasSetAmbient), - (t._useSpecularMaterial = this._useSpecularMaterial), - (t._useEmissiveMaterial = this._useEmissiveMaterial), - (t._useShininess = this._useShininess), - (t.constantAttenuation = this.constantAttenuation), - (t.linearAttenuation = this.linearAttenuation), - (t.quadraticAttenuation = this.quadraticAttenuation), - (t._enableLighting = this._enableLighting), - (t._useNormalMaterial = this._useNormalMaterial), - (t._tex = this._tex), - (t.drawMode = this.drawMode), - (t._currentNormal = this._currentNormal), - (t.curBlendMode = this.curBlendMode), - (t.activeImageLight = this.activeImageLight), - e - ); - }, - }, - { - key: "pop", - value: function () { - var e; - 0 < this._clipDepths.length && - this._pushPopDepth === - this._clipDepths[this._clipDepths.length - 1] && - this._clearClip(); - for ( - var t = arguments.length, r = new Array(t), o = 0; - o < t; - o++ - ) - r[o] = arguments[o]; - (e = p(b(s.prototype), "pop", this)).call.apply( - e, - [this].concat(r), - ), - this._applyStencilTestIfClipping(); - }, - }, - { - key: "_applyStencilTestIfClipping", - value: function () { - var e = this.drawTarget(); - e._isClipApplied !== this._stencilTestOn && - (e._isClipApplied - ? (this.GL.enable(this.GL.STENCIL_TEST), - (this._stencilTestOn = !0)) - : (this.GL.disable(this.GL.STENCIL_TEST), - (this._stencilTestOn = !1))); - }, - }, - { - key: "resetMatrix", - value: function () { - return ( - this.uMVMatrix.set( - this._curCamera.cameraMatrix.mat4[0], - this._curCamera.cameraMatrix.mat4[1], - this._curCamera.cameraMatrix.mat4[2], - this._curCamera.cameraMatrix.mat4[3], - this._curCamera.cameraMatrix.mat4[4], - this._curCamera.cameraMatrix.mat4[5], - this._curCamera.cameraMatrix.mat4[6], - this._curCamera.cameraMatrix.mat4[7], - this._curCamera.cameraMatrix.mat4[8], - this._curCamera.cameraMatrix.mat4[9], - this._curCamera.cameraMatrix.mat4[10], - this._curCamera.cameraMatrix.mat4[11], - this._curCamera.cameraMatrix.mat4[12], - this._curCamera.cameraMatrix.mat4[13], - this._curCamera.cameraMatrix.mat4[14], - this._curCamera.cameraMatrix.mat4[15], - ), - this - ); - }, - }, - { - key: "_getImmediateStrokeShader", - value: function () { - var e = this.userStrokeShader; - return e && e.isStrokeShader() - ? e - : this._getLineShader(); - }, - }, - { - key: "_getRetainedStrokeShader", - value: function () { - return this._getImmediateStrokeShader(); - }, - }, - { - key: "_getImmediateFillShader", - value: function () { - var e = this.userFillShader; - if ( - this._useNormalMaterial && - (!e || !e.isNormalShader()) - ) - return this._getNormalShader(); - if (this._enableLighting) { - if (!e || !e.isLightShader()) - return this._getLightShader(); - } else if (this._tex) { - if (!e || !e.isTextureShader()) - return this._getLightShader(); - } else if (!e) return this._getImmediateModeShader(); - return e; - }, - }, - { - key: "_getRetainedFillShader", - value: function () { - if (this._useNormalMaterial) - return this._getNormalShader(); - var e = this.userFillShader; - if (this._enableLighting) { - if (!e || !e.isLightShader()) - return this._getLightShader(); - } else if (this._tex) { - if (!e || !e.isTextureShader()) - return this._getLightShader(); - } else if (!e) return this._getColorShader(); - return e; - }, - }, - { - key: "_getImmediatePointShader", - value: function () { - var e = this.userPointShader; - return e && e.isPointShader() - ? e - : this._getPointShader(); - }, - }, - { - key: "_getRetainedLineShader", - value: function () { - return this._getImmediateLineShader(); - }, - }, - { - key: "_getLightShader", - value: function () { - return ( - this._defaultLightShader || - (this._pInst._glAttributes.perPixelLighting - ? (this._defaultLightShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix( - "vert", - "highp", - ) + M.phongVert, - this._webGL2CompatibilityPrefix( - "frag", - "highp", - ) + M.phongFrag, - )) - : (this._defaultLightShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix( - "vert", - "highp", - ) + M.lightVert, - this._webGL2CompatibilityPrefix( - "frag", - "highp", - ) + M.lightTextureFrag, - ))), - this._defaultLightShader - ); - }, - }, - { - key: "_getImmediateModeShader", - value: function () { - return ( - this._defaultImmediateModeShader || - (this._defaultImmediateModeShader = - new g.default.Shader( - this, - this._webGL2CompatibilityPrefix( - "vert", - "mediump", - ) + M.immediateVert, - this._webGL2CompatibilityPrefix( - "frag", - "mediump", - ) + M.vertexColorFrag, - )), - this._defaultImmediateModeShader - ); - }, - }, - { - key: "_getNormalShader", - value: function () { - return ( - this._defaultNormalShader || - (this._defaultNormalShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - M.normalVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - M.normalFrag, - )), - this._defaultNormalShader - ); - }, - }, - { - key: "_getColorShader", - value: function () { - return ( - this._defaultColorShader || - (this._defaultColorShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - M.normalVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - M.basicFrag, - )), - this._defaultColorShader - ); - }, - }, - { - key: "_getPointShader", - value: function () { - return ( - this._defaultPointShader || - (this._defaultPointShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - M.pointVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - M.pointFrag, - )), - this._defaultPointShader - ); - }, - }, - { - key: "_getLineShader", - value: function () { - return ( - this._defaultLineShader || - (this._defaultLineShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - M.lineVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - M.lineFrag, - )), - this._defaultLineShader - ); - }, - }, - { - key: "_getFontShader", - value: function () { - return ( - this._defaultFontShader || - (this.webglVersion === l.WEBGL && - this.GL.getExtension("OES_standard_derivatives"), - (this._defaultFontShader = new g.default.Shader( - this, - this._webGL2CompatibilityPrefix("vert", "mediump") + - M.fontVert, - this._webGL2CompatibilityPrefix("frag", "mediump") + - M.fontFrag, - ))), - this._defaultFontShader - ); - }, - }, - { - key: "_webGL2CompatibilityPrefix", - value: function (e, t) { - var r = ""; - return ( - this.webglVersion === l.WEBGL2 && - (r += "#version 300 es\n#define WEBGL2\n"), - "vert" === e - ? (r += "#define VERTEX_SHADER\n") - : "frag" === e && (r += "#define FRAGMENT_SHADER\n"), - t && (r += "precision ".concat(t, " float;\n")), - r - ); - }, - }, - { - key: "_getEmptyTexture", - value: function () { - var e; - return ( - this._emptyTexture || - ((e = new g.default.Image(1, 1)).set(0, 0, 255), - (this._emptyTexture = new g.default.Texture( - this, - e, - ))), - this._emptyTexture - ); - }, - }, - { - key: "getTexture", - value: function (e) { - e instanceof g.default.Framebuffer && (e = e.color); - var t = this.textures.get(e); - return ( - t || - ((t = new g.default.Texture(this, e)), - this.textures.set(e, t), - t) - ); - }, - }, - { - key: "getDiffusedTexture", - value: function (e) { - var t, r; - return null != this.diffusedTextures.get(e) - ? this.diffusedTextures.get(e) - : (0, - (t = Math.floor((e.height / e.width) * 200)), - (r = (t = this._pInst.createGraphics( - 200, - t, - l.WEBGL, - )).createShader( - M.imageLightVert, - M.imageLightDiffusedFrag, - )), - t.shader(r), - r.setUniform("environmentMap", e), - t.noStroke(), - t.rectMode(t.CENTER), - t.rect(0, 0, t.width, t.height), - this.diffusedTextures.set(e, t), - t); - }, - }, - { - key: "getSpecularTexture", - value: function (e) { - if (null != this.specularTextures.get(e)) - return this.specularTextures.get(e); - var t, - r = [], - o = this._pInst.createGraphics(512, 512, l.WEBGL), - n = Math.log(512) / Math.log(2); - o.pixelDensity(1); - for (var s = 512; 1 <= s; s /= 2) { - o.resizeCanvas(s, s); - var i = 1 - Math.log(s) / Math.log(2) / n, - a = o.createShader( - M.imageLightVert, - M.imageLightSpecularFrag, - ); - o.shader(a), - o.clear(), - a.setUniform("environmentMap", e), - a.setUniform("roughness", i), - o.noStroke(), - o.plane(s, s), - r.push( - o.get().drawingContext.getImageData(0, 0, s, s), - ); - } - return ( - o.remove(), - (t = new c.MipmapTexture(this, r, {})), - this.specularTextures.set(e, t), - t - ); - }, - }, - { - key: "activeFramebuffer", - value: function () { - return ( - this.activeFramebuffers[ - this.activeFramebuffers.length - 1 - ] || null - ); - }, - }, - { - key: "createFramebuffer", - value: function (e) { - return new g.default.Framebuffer(this, e); - }, - }, - { - key: "_setStrokeUniforms", - value: function (e) { - e.bindShader(), - e.setUniform("uUseLineColor", this._useLineColor), - e.setUniform("uMaterialColor", this.curStrokeColor), - e.setUniform("uStrokeWeight", this.curStrokeWeight), - e.setUniform("uStrokeCap", w[this.curStrokeCap]), - e.setUniform("uStrokeJoin", S[this.curStrokeJoin]); - }, - }, - { - key: "_setFillUniforms", - value: function (e) { - e.bindShader(), - e.setUniform("uUseVertexColor", this._useVertexColor), - e.setUniform("uMaterialColor", this.curFillColor), - e.setUniform("isTexture", !!this._tex), - this._tex && e.setUniform("uSampler", this._tex), - e.setUniform("uTint", this._tint), - e.setUniform("uHasSetAmbient", this._hasSetAmbient), - e.setUniform("uAmbientMatColor", this.curAmbientColor), - e.setUniform( - "uSpecularMatColor", - this.curSpecularColor, - ), - e.setUniform( - "uEmissiveMatColor", - this.curEmissiveColor, - ), - e.setUniform("uSpecular", this._useSpecularMaterial), - e.setUniform("uEmissive", this._useEmissiveMaterial), - e.setUniform("uShininess", this._useShininess), - this._setImageLightUniforms(e), - e.setUniform("uUseLighting", this._enableLighting); - var t = this.pointLightDiffuseColors.length / 3, - t = - (e.setUniform("uPointLightCount", t), - e.setUniform( - "uPointLightLocation", - this.pointLightPositions, - ), - e.setUniform( - "uPointLightDiffuseColors", - this.pointLightDiffuseColors, - ), - e.setUniform( - "uPointLightSpecularColors", - this.pointLightSpecularColors, - ), - this.directionalLightDiffuseColors.length / 3), - t = - (e.setUniform("uDirectionalLightCount", t), - e.setUniform( - "uLightingDirection", - this.directionalLightDirections, - ), - e.setUniform( - "uDirectionalDiffuseColors", - this.directionalLightDiffuseColors, - ), - e.setUniform( - "uDirectionalSpecularColors", - this.directionalLightSpecularColors, - ), - this.ambientLightColors.length / 3), - t = - (e.setUniform("uAmbientLightCount", t), - e.setUniform( - "uAmbientColor", - this.ambientLightColors, - ), - this.spotLightDiffuseColors.length / 3); - e.setUniform("uSpotLightCount", t), - e.setUniform("uSpotLightAngle", this.spotLightAngle), - e.setUniform("uSpotLightConc", this.spotLightConc), - e.setUniform( - "uSpotLightDiffuseColors", - this.spotLightDiffuseColors, - ), - e.setUniform( - "uSpotLightSpecularColors", - this.spotLightSpecularColors, - ), - e.setUniform( - "uSpotLightLocation", - this.spotLightPositions, - ), - e.setUniform( - "uSpotLightDirection", - this.spotLightDirections, - ), - e.setUniform( - "uConstantAttenuation", - this.constantAttenuation, - ), - e.setUniform( - "uLinearAttenuation", - this.linearAttenuation, - ), - e.setUniform( - "uQuadraticAttenuation", - this.quadraticAttenuation, - ), - e.bindTextures(); - }, - }, - { - key: "_setImageLightUniforms", - value: function (e) { - var t, r; - e.setUniform( - "uUseImageLight", - null != this.activeImageLight, - ), - this.activeImageLight && - ((t = this.getDiffusedTexture(this.activeImageLight)), - e.setUniform("environmentMapDiffused", t), - (t = this.getSpecularTexture(this.activeImageLight)), - (r = 20 / this._useShininess), - e.setUniform("levelOfDetail", 8 * r), - e.setUniform("environmentMapSpecular", t)); - }, - }, - { - key: "_setPointUniforms", - value: function (e) { - e.bindShader(), - e.setUniform("uMaterialColor", this.curStrokeColor), - e.setUniform( - "uPointSize", - this.pointSize * this._pInst._pixelDensity, - ); - }, - }, - { - key: "_bindBuffer", - value: function (e, t, r, o, n) { - (t = t || this.GL.ARRAY_BUFFER), - this.GL.bindBuffer(t, e), - void 0 !== r && - ((e = r) instanceof g.default.DataArray - ? (e = r.dataArray()) - : e instanceof (o || Float32Array) || - (e = new (o || Float32Array)(e)), - this.GL.bufferData(t, e, n || this.GL.STATIC_DRAW)); - }, - }, - { - key: "_arraysEqual", - value: function (e, r) { - return ( - e.length === r.length && - e.every(function (e, t) { - return e === r[t]; - }) - ); - }, - }, - { - key: "_isTypedArray", - value: function (t) { - return [ - Float32Array, - Float64Array, - Int16Array, - Uint16Array, - Uint32Array, - ].some(function (e) { - return t instanceof e; - }); - }, - }, - { - key: "_flatten", - value: function (e) { - if (0 === e.length) return []; - var t; - if (2e4 < e.length) { - for ( - var r = [], o = e.slice(), n = o.pop(); - Array.isArray(n) ? o.push.apply(o, h(n)) : r.push(n), - o.length && void 0 !== (n = o.pop()); - - ); - return r.reverse(), r; - } - return (t = []).concat.apply(t, h(e)); - }, - }, - { - key: "_vToNArray", - value: function (e) { - var t = [], - r = !0, - o = !1, - n = void 0; - try { - for ( - var s, i = e[Symbol.iterator](); - !(r = (s = i.next()).done); - r = !0 - ) { - var a = s.value; - t.push(a.x, a.y, a.z); - } - } catch (e) { - (o = !0), (n = e); - } finally { - try { - r || null == i.return || i.return(); - } finally { - if (o) throw n; - } - } - return t; - }, - }, - { - key: "_bezierCoefficients", - value: function (e) { - var t = e * e, - r = 1 - e, - o = r * r; - return [o * r, 3 * o * e, 3 * r * t, t * e]; - }, - }, - { - key: "_quadraticCoefficients", - value: function (e) { - var t = 1 - e; - return [t * t, 2 * t * e, e * e]; - }, - }, - { - key: "_bezierToCatmull", - value: function (e) { - return [ - e[1], - e[1] + (e[2] - e[0]) / this._curveTightness, - e[2] - (e[3] - e[1]) / this._curveTightness, - e[2], - ]; - }, - }, - { - key: "_initTessy", - value: function () { - var e = new u.default.GluTesselator(); - return ( - e.gluTessCallback( - u.default.gluEnum.GLU_TESS_VERTEX_DATA, - function (e, t) { - for (var r = 0; r < e.length; r++) t.push(e[r]); - }, - ), - e.gluTessCallback( - u.default.gluEnum.GLU_TESS_BEGIN, - function (e) { - e !== u.default.primitiveType.GL_TRIANGLES && - console.log( - "expected TRIANGLES but got type: ".concat(e), - ); - }, - ), - e.gluTessCallback( - u.default.gluEnum.GLU_TESS_ERROR, - function (e) { - console.log("error callback"), - console.log("error number: ".concat(e)); - }, - ), - e.gluTessCallback( - u.default.gluEnum.GLU_TESS_COMBINE, - function (e, t, r) { - for ( - var o = new Array( - g.default.RendererGL.prototype.tessyVertexSize, - ).fill(0), - n = 0; - n < r.length; - n++ - ) - for (var s = 0; s < o.length; s++) - 0 !== r[n] && t[n] && (o[s] += t[n][s] * r[n]); - return o; - }, - ), - e.gluTessCallback( - u.default.gluEnum.GLU_TESS_EDGE_FLAG, - function (e) {}, - ), - e.gluTessProperty( - u.default.gluEnum.GLU_TESS_WINDING_RULE, - u.default.windingRule.GLU_TESS_WINDING_NONZERO, - ), - e - ); - }, - }, - { - key: "_triangulate", - value: function (e) { - var t = e[0] ? e[0][2] : void 0, - r = !0, - o = !0, - n = !1, - s = void 0; - try { - for ( - var i, a = e[Symbol.iterator](); - !(o = (i = a.next()).done); - o = !0 - ) - for ( - var l = i.value, u = 0; - u < l.length; - u += g.default.RendererGL.prototype.tessyVertexSize - ) - if (l[u + 2] !== t) { - r = !1; - break; - } - } catch (e) { - (n = !0), (s = e); - } finally { - try { - o || null == a.return || a.return(); - } finally { - if (n) throw s; - } - } - r - ? this._tessy.gluTessNormal(0, 0, 1) - : this._tessy.gluTessNormal(0, 0, 0); - var n = [], - c = (this._tessy.gluTessBeginPolygon(n), !0), - s = !1, - d = void 0; - try { - for ( - var h, f = e[Symbol.iterator](); - !(c = (h = f.next()).done); - c = !0 - ) { - var p = h.value; - this._tessy.gluTessBeginContour(); - for ( - var m = 0; - m < p.length; - m += g.default.RendererGL.prototype.tessyVertexSize - ) { - var y = p.slice( - m, - m + - g.default.RendererGL.prototype.tessyVertexSize, - ); - this._tessy.gluTessVertex(y, y); - } - this._tessy.gluTessEndContour(); - } - } catch (e) { - (s = !0), (d = e); - } finally { - try { - c || null == f.return || f.return(); - } finally { - if (s) throw d; - } - } - return this._tessy.gluTessEndPolygon(), n; - }, - }, - ]) && f(t.prototype, e), - r && f(t, r), - s - ); - })(g.default.Renderer)), - (g.default.prototype._assert3d = function (e) { - if (!this._renderer.isP3D) - throw new Error( - "".concat( - e, - "() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information.", - ), - ); - }), - (g.default.RendererGL.prototype.tessyVertexSize = 12); - e = g.default.RendererGL; - r.default = e; - }, - { - "../core/constants": 264, - "../core/main": 275, - "../core/p5.Renderer": 278, - "./GeometryBuilder": 319, - "./p5.Camera": 324, - "./p5.Framebuffer": 326, - "./p5.Matrix": 328, - "./p5.Shader": 333, - "./p5.Texture": 334, - "core-js/modules/es.array.concat": 151, - "core-js/modules/es.array.copy-within": 152, - "core-js/modules/es.array.every": 153, - "core-js/modules/es.array.fill": 154, - "core-js/modules/es.array.from": 158, - "core-js/modules/es.array.includes": 159, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.some": 166, - "core-js/modules/es.map": 169, - "core-js/modules/es.object.assign": 176, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.reflect.get": 185, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.set": 189, - "core-js/modules/es.string.includes": 191, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.float32-array": 211, - "core-js/modules/es.typed-array.float64-array": 212, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.int16-array": 216, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint16-array": 232, - "core-js/modules/es.typed-array.uint32-array": 233, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - libtess: 247, - path: 250, - }, - ], - 333: [ - function (e, t, r) { - "use strict"; - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.index-of"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.array.slice"), - e("core-js/modules/es.array.some"), - e("core-js/modules/es.function.name"), - e("core-js/modules/es.object.keys"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/web.dom-collections.iterator"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.default = void 0); - var s = (e = e("../core/main")) && e.__esModule ? e : { default: e }; - function n(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - s.default.Shader = (function () { - function o(e, t, r) { - if (!(this instanceof o)) - throw new TypeError("Cannot call a class as a function"); - (this._renderer = e), - (this._vertSrc = t), - (this._fragSrc = r), - (this._vertShader = -1), - (this._fragShader = -1), - (this._glProgram = 0), - (this._loadedAttributes = !1), - (this.attributes = {}), - (this._loadedUniforms = !1), - (this.uniforms = {}), - (this._bound = !1), - (this.samplers = []); - } - var e, t, r; - return ( - (e = o), - (t = [ - { - key: "init", - value: function () { - if (0 === this._glProgram) { - var e = this._renderer.GL; - if ( - ((this._vertShader = e.createShader(e.VERTEX_SHADER)), - e.shaderSource(this._vertShader, this._vertSrc), - e.compileShader(this._vertShader), - !e.getShaderParameter( - this._vertShader, - e.COMPILE_STATUS, - )) - ) - return ( - s.default._friendlyError( - "Yikes! An error occurred compiling the vertex shader:".concat( - e.getShaderInfoLog(this._vertShader), - ), - ), - null - ); - if ( - ((this._fragShader = e.createShader(e.FRAGMENT_SHADER)), - e.shaderSource(this._fragShader, this._fragSrc), - e.compileShader(this._fragShader), - !e.getShaderParameter( - this._fragShader, - e.COMPILE_STATUS, - )) - ) - return ( - s.default._friendlyError( - "Darn! An error occurred compiling the fragment shader:".concat( - e.getShaderInfoLog(this._fragShader), - ), - ), - null - ); - (this._glProgram = e.createProgram()), - e.attachShader(this._glProgram, this._vertShader), - e.attachShader(this._glProgram, this._fragShader), - e.linkProgram(this._glProgram), - e.getProgramParameter(this._glProgram, e.LINK_STATUS) || - s.default._friendlyError( - "Snap! Error linking shader program: ".concat( - e.getProgramInfoLog(this._glProgram), - ), - ), - this._loadAttributes(), - this._loadUniforms(); - } - return this; - }, - }, - { - key: "copyToContext", - value: function (e) { - var t = new s.default.Shader( - e._renderer, - this._vertSrc, - this._fragSrc, - ); - return t.ensureCompiledOnContext(e), t; - }, - }, - { - key: "ensureCompiledOnContext", - value: function (e) { - if (0 !== this._glProgram && this._renderer !== e._renderer) - throw new Error( - "The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?", - ); - 0 === this._glProgram && - ((this._renderer = e._renderer), this.init()); - }, - }, - { - key: "_loadAttributes", - value: function () { - if (!this._loadedAttributes) { - this.attributes = {}; - for ( - var e = this._renderer.GL, - t = e.getProgramParameter( - this._glProgram, - e.ACTIVE_ATTRIBUTES, - ), - r = 0; - r < t; - ++r - ) { - var o = e.getActiveAttrib(this._glProgram, r), - n = o.name, - s = e.getAttribLocation(this._glProgram, n), - i = {}; - (i.name = n), - (i.location = s), - (i.index = r), - (i.type = o.type), - (i.size = o.size), - (this.attributes[n] = i); - } - this._loadedAttributes = !0; - } - }, - }, - { - key: "_loadUniforms", - value: function () { - if (!this._loadedUniforms) { - for ( - var e = this._renderer.GL, - t = e.getProgramParameter( - this._glProgram, - e.ACTIVE_UNIFORMS, - ), - r = 0, - o = 0; - o < t; - ++o - ) { - var n = e.getActiveUniform(this._glProgram, o), - s = {}, - i = - ((s.location = e.getUniformLocation( - this._glProgram, - n.name, - )), - (s.size = n.size), - n.name); - 1 < n.size && (i = i.substring(0, i.indexOf("[0]"))), - (s.name = i), - (s.type = n.type), - (s._cachedData = void 0), - s.type === e.SAMPLER_2D && - ((s.samplerIndex = r), r++, this.samplers.push(s)), - (s.isArray = - 1 < n.size || - s.type === e.FLOAT_MAT3 || - s.type === e.FLOAT_MAT4 || - s.type === e.FLOAT_VEC2 || - s.type === e.FLOAT_VEC3 || - s.type === e.FLOAT_VEC4 || - s.type === e.INT_VEC2 || - s.type === e.INT_VEC4 || - s.type === e.INT_VEC3), - (this.uniforms[i] = s); - } - this._loadedUniforms = !0; - } - }, - }, - { key: "compile", value: function () {} }, - { - key: "bindShader", - value: function () { - this.init(), - this._bound || - (this.useProgram(), - (this._bound = !0), - this._setMatrixUniforms(), - this.setUniform("uViewport", this._renderer._viewport)); - }, - }, - { - key: "unbindShader", - value: function () { - return ( - this._bound && - (this.unbindTextures(), (this._bound = !1)), - this - ); - }, - }, - { - key: "bindTextures", - value: function () { - var e = this._renderer.GL, - t = !0, - r = !1, - o = void 0; - try { - for ( - var n, s = this.samplers[Symbol.iterator](); - !(t = (n = s.next()).done); - t = !0 - ) { - var i = n.value, - a = i.texture; - void 0 === a && (a = this._renderer._getEmptyTexture()), - e.activeTexture(e.TEXTURE0 + i.samplerIndex), - a.bindTexture(), - a.update(), - e.uniform1i(i.location, i.samplerIndex); - } - } catch (e) { - (r = !0), (o = e); - } finally { - try { - t || null == s.return || s.return(); - } finally { - if (r) throw o; - } - } - }, - }, - { - key: "updateTextures", - value: function () { - var e = !0, - t = !1, - r = void 0; - try { - for ( - var o, n = this.samplers[Symbol.iterator](); - !(e = (o = n.next()).done); - e = !0 - ) { - var s = o.value.texture; - s && s.update(); - } - } catch (e) { - (t = !0), (r = e); - } finally { - try { - e || null == n.return || n.return(); - } finally { - if (t) throw r; - } - } - }, - }, - { - key: "unbindTextures", - value: function () { - var e = !0, - t = !1, - r = void 0; - try { - for ( - var o, n = this.samplers[Symbol.iterator](); - !(e = (o = n.next()).done); - e = !0 - ) { - var s = o.value; - this.setUniform( - s.name, - this._renderer._getEmptyTexture(), - ); - } - } catch (e) { - (t = !0), (r = e); - } finally { - try { - e || null == n.return || n.return(); - } finally { - if (t) throw r; - } - } - }, - }, - { - key: "_setMatrixUniforms", - value: function () { - var e = this._renderer._curCamera.cameraMatrix, - t = this._renderer.uPMatrix, - r = this._renderer.uMVMatrix, - o = r.copy(); - o.mult(t), - this.isStrokeShader() && - ("default" === this._renderer._curCamera.cameraType - ? this.setUniform("uPerspective", 1) - : this.setUniform("uPerspective", 0)), - this.setUniform("uViewMatrix", e.mat4), - this.setUniform("uProjectionMatrix", t.mat4), - this.setUniform("uModelViewMatrix", r.mat4), - this.setUniform("uModelViewProjectionMatrix", o.mat4), - this.uniforms.uNormalMatrix && - (this._renderer.uNMatrix.inverseTranspose( - this._renderer.uMVMatrix, - ), - this.setUniform( - "uNormalMatrix", - this._renderer.uNMatrix.mat3, - )); - }, - }, - { - key: "useProgram", - value: function () { - var e = this._renderer.GL; - return ( - this._renderer._curShader !== this && - (e.useProgram(this._glProgram), - (this._renderer._curShader = this)), - this - ); - }, - }, - { - key: "setUniform", - value: function (e, t) { - var r = this.uniforms[e]; - if (r) { - var o = this._renderer.GL; - if (r.isArray) { - if ( - r._cachedData && - this._renderer._arraysEqual(r._cachedData, t) - ) - return; - r._cachedData = t.slice(0); - } else { - if (r._cachedData && r._cachedData === t) return; - Array.isArray(t) - ? (r._cachedData = t.slice(0)) - : (r._cachedData = t); - } - var n = r.location; - switch ((this.useProgram(), r.type)) { - case o.BOOL: - !0 === t ? o.uniform1i(n, 1) : o.uniform1i(n, 0); - break; - case o.INT: - 1 < r.size - ? t.length && o.uniform1iv(n, t) - : o.uniform1i(n, t); - break; - case o.FLOAT: - 1 < r.size - ? t.length && o.uniform1fv(n, t) - : o.uniform1f(n, t); - break; - case o.FLOAT_MAT3: - o.uniformMatrix3fv(n, !1, t); - break; - case o.FLOAT_MAT4: - o.uniformMatrix4fv(n, !1, t); - break; - case o.FLOAT_VEC2: - 1 < r.size - ? t.length && o.uniform2fv(n, t) - : o.uniform2f(n, t[0], t[1]); - break; - case o.FLOAT_VEC3: - 1 < r.size - ? t.length && o.uniform3fv(n, t) - : o.uniform3f(n, t[0], t[1], t[2]); - break; - case o.FLOAT_VEC4: - 1 < r.size - ? t.length && o.uniform4fv(n, t) - : o.uniform4f(n, t[0], t[1], t[2], t[3]); - break; - case o.INT_VEC2: - 1 < r.size - ? t.length && o.uniform2iv(n, t) - : o.uniform2i(n, t[0], t[1]); - break; - case o.INT_VEC3: - 1 < r.size - ? t.length && o.uniform3iv(n, t) - : o.uniform3i(n, t[0], t[1], t[2]); - break; - case o.INT_VEC4: - 1 < r.size - ? t.length && o.uniform4iv(n, t) - : o.uniform4i(n, t[0], t[1], t[2], t[3]); - break; - case o.SAMPLER_2D: - o.activeTexture(o.TEXTURE0 + r.samplerIndex), - (r.texture = - t instanceof s.default.Texture - ? t - : this._renderer.getTexture(t)), - o.uniform1i(n, r.samplerIndex), - r.texture.src.gifProperties && - r.texture.src._animateGif(this._renderer._pInst); - } - return this; - } - }, - }, - { - key: "isLightShader", - value: function () { - return ( - void 0 !== this.attributes.aNormal || - void 0 !== this.uniforms.uUseLighting || - void 0 !== this.uniforms.uAmbientLightCount || - void 0 !== this.uniforms.uDirectionalLightCount || - void 0 !== this.uniforms.uPointLightCount || - void 0 !== this.uniforms.uAmbientColor || - void 0 !== this.uniforms.uDirectionalDiffuseColors || - void 0 !== this.uniforms.uDirectionalSpecularColors || - void 0 !== this.uniforms.uPointLightLocation || - void 0 !== this.uniforms.uPointLightDiffuseColors || - void 0 !== this.uniforms.uPointLightSpecularColors || - void 0 !== this.uniforms.uLightingDirection || - void 0 !== this.uniforms.uSpecular - ); - }, - }, - { - key: "isNormalShader", - value: function () { - return void 0 !== this.attributes.aNormal; - }, - }, - { - key: "isTextureShader", - value: function () { - return 0 < this.samplers.length; - }, - }, - { - key: "isColorShader", - value: function () { - return ( - void 0 !== this.attributes.aVertexColor || - void 0 !== this.uniforms.uMaterialColor - ); - }, - }, - { - key: "isTexLightShader", - value: function () { - return this.isLightShader() && this.isTextureShader(); - }, - }, - { - key: "isStrokeShader", - value: function () { - return void 0 !== this.uniforms.uStrokeWeight; - }, - }, - { - key: "enableAttrib", - value: function (e, t, r, o, n, s) { - var i; - return ( - e && - -1 !== (e = e.location) && - ((i = this._renderer.GL), - this._renderer.registerEnabled.has(e) || - (i.enableVertexAttribArray(e), - this._renderer.registerEnabled.add(e)), - this._renderer.GL.vertexAttribPointer( - e, - t, - r || i.FLOAT, - o || !1, - n || 0, - s || 0, - )), - this - ); - }, - }, - { - key: "disableRemainingAttributes", - value: function () { - var r = this, - e = !0, - t = !1, - o = void 0; - try { - for ( - var n, - s = this._renderer.registerEnabled - .values() - [Symbol.iterator](); - !(e = (n = s.next()).done); - e = !0 - ) - !(function () { - var t = n.value; - Object.keys(r.attributes).some(function (e) { - return r.attributes[e].location === t; - }) || - (r._renderer.GL.disableVertexAttribArray(t), - r._renderer.registerEnabled.delete(t)); - })(); - } catch (e) { - (t = !0), (o = e); - } finally { - try { - e || null == s.return || s.return(); - } finally { - if (t) throw o; - } - } - }, - }, - ]) && n(e.prototype, t), - r && n(e, r), - o - ); - })(); - e = s.default.Shader; - r.default = e; - }, - { - "../core/main": 275, - "core-js/modules/es.array.index-of": 160, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.array.slice": 165, - "core-js/modules/es.array.some": 166, - "core-js/modules/es.function.name": 168, - "core-js/modules/es.object.keys": 181, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 334: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.get-prototype-of"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.reflect.construct"), - e("core-js/modules/es.regexp.to-string"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.typed-array.uint8-array"), - e("core-js/modules/es.typed-array.copy-within"), - e("core-js/modules/es.typed-array.every"), - e("core-js/modules/es.typed-array.fill"), - e("core-js/modules/es.typed-array.filter"), - e("core-js/modules/es.typed-array.find"), - e("core-js/modules/es.typed-array.find-index"), - e("core-js/modules/es.typed-array.for-each"), - e("core-js/modules/es.typed-array.includes"), - e("core-js/modules/es.typed-array.index-of"), - e("core-js/modules/es.typed-array.iterator"), - e("core-js/modules/es.typed-array.join"), - e("core-js/modules/es.typed-array.last-index-of"), - e("core-js/modules/es.typed-array.map"), - e("core-js/modules/es.typed-array.reduce"), - e("core-js/modules/es.typed-array.reduce-right"), - e("core-js/modules/es.typed-array.reverse"), - e("core-js/modules/es.typed-array.set"), - e("core-js/modules/es.typed-array.slice"), - e("core-js/modules/es.typed-array.some"), - e("core-js/modules/es.typed-array.sort"), - e("core-js/modules/es.typed-array.subarray"), - e("core-js/modules/es.typed-array.to-locale-string"), - e("core-js/modules/es.typed-array.to-string"), - Object.defineProperty(r, "__esModule", { value: !0 }), - (r.checkWebGLCapabilities = m), - (r.default = r.MipmapTexture = void 0); - var s = (p = e("../core/main")) && p.__esModule ? p : { default: p }, - a = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = l(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function l() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (l = function () { - return e; - }), - e); - } - function u(e, t) { - return (u = - Object.setPrototypeOf || - function (e, t) { - return (e.__proto__ = t), e; - })(e, t); - } - function c(r) { - return function () { - var e, - t = n(r), - t = - ((e = (function () { - if ( - "undefined" != typeof Reflect && - Reflect.construct && - !Reflect.construct.sham - ) { - if ("function" == typeof Proxy) return 1; - try { - return ( - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}), - ), - 1 - ); - } catch (e) {} - } - })() - ? ((e = n(this).constructor), - Reflect.construct(t, arguments, e)) - : t.apply(this, arguments)), - this); - if (!e || ("object" !== i(e) && "function" != typeof e)) { - if (void 0 !== t) return t; - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called", - ); - } - return e; - }; - } - function n(e) { - return (n = Object.setPrototypeOf - ? Object.getPrototypeOf - : function (e) { - return e.__proto__ || Object.getPrototypeOf(e); - })(e); - } - function d(e, t) { - if (!(e instanceof t)) - throw new TypeError("Cannot call a class as a function"); - } - function h(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function f(e, t, r) { - t && h(e.prototype, t), r && h(e, r); - } - s.default.Texture = (function () { - function n(e, t, r) { - d(this, n), (this._renderer = e); - var o = this._renderer.GL, - r = - ((r = r || {}), - (this.src = t), - (this.glTex = void 0), - (this.glTarget = o.TEXTURE_2D), - (this.glFormat = r.format || o.RGBA), - (this.mipmaps = !1), - (this.glMinFilter = r.minFilter || o.LINEAR), - (this.glMagFilter = r.magFilter || o.LINEAR), - (this.glWrapS = r.wrapS || o.CLAMP_TO_EDGE), - (this.glWrapT = r.wrapT || o.CLAMP_TO_EDGE), - (this.glDataType = r.dataType || o.UNSIGNED_BYTE), - m(e)), - e = - (this.glFormat !== o.HALF_FLOAT || - r.halfFloat || - (console.log( - "This device does not support dataType HALF_FLOAT. Falling back to FLOAT.", - ), - (this.glDataType = o.FLOAT)), - this.glFormat !== o.HALF_FLOAT || - (this.glMinFilter !== o.LINEAR && - this.glMagFilter !== o.LINEAR) || - r.halfFloatLinear || - (console.log( - "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", - ), - this.glMinFilter === o.LINEAR && - (this.glMinFilter = o.NEAREST), - this.glMagFilter === o.LINEAR && - (this.glMagFilter = o.NEAREST)), - this.glFormat !== o.FLOAT || - r.float || - (console.log( - "This device does not support dataType FLOAT. Falling back to UNSIGNED_BYTE.", - ), - (this.glDataType = o.UNSIGNED_BYTE)), - this.glFormat !== o.FLOAT || - (this.glMinFilter !== o.LINEAR && - this.glMagFilter !== o.LINEAR) || - r.floatLinear || - (console.log( - "This device does not support linear filtering for dataType FLOAT. Falling back to NEAREST.", - ), - this.glMinFilter === o.LINEAR && - (this.glMinFilter = o.NEAREST), - this.glMagFilter === o.LINEAR && - (this.glMagFilter = o.NEAREST)), - (this.isSrcMediaElement = - void 0 !== s.default.MediaElement && - t instanceof s.default.MediaElement), - (this._videoPrevUpdateTime = 0), - (this.isSrcHTMLElement = - void 0 !== s.default.Element && - t instanceof s.default.Element && - !(t instanceof s.default.Graphics) && - !(t instanceof s.default.Renderer)), - (this.isSrcP5Image = t instanceof s.default.Image), - (this.isSrcP5Graphics = t instanceof s.default.Graphics), - (this.isSrcP5Renderer = t instanceof s.default.Renderer), - (this.isImageData = - "undefined" != typeof ImageData && t instanceof ImageData), - (this.isFramebufferTexture = - t instanceof s.default.FramebufferTexture), - this._getTextureDataFromSource()); - return ( - (this.width = e.width), - (this.height = e.height), - this.init(e), - this - ); - } - return ( - f(n, [ - { - key: "_getTextureDataFromSource", - value: function () { - var e; - return ( - this.isFramebufferTexture - ? (e = this.src.rawTexture()) - : this.isSrcP5Image - ? (e = this.src.canvas) - : this.isSrcMediaElement || - this.isSrcP5Graphics || - this.isSrcP5Renderer || - this.isSrcHTMLElement - ? (e = this.src.elt) - : this.isImageData && (e = this.src), - e - ); - }, - }, - { - key: "init", - value: function (e) { - var t, - r = this._renderer.GL; - this.isFramebufferTexture || - (this.glTex = r.createTexture()), - (this.glWrapS = this._renderer.textureWrapX), - (this.glWrapT = this._renderer.textureWrapY), - this.setWrapMode(this.glWrapS, this.glWrapT), - this.bindTexture(), - r.texParameteri( - r.TEXTURE_2D, - r.TEXTURE_MAG_FILTER, - this.glMagFilter, - ), - r.texParameteri( - r.TEXTURE_2D, - r.TEXTURE_MIN_FILTER, - this.glMinFilter, - ), - this.isFramebufferTexture || - (0 === this.width || - 0 === this.height || - (this.isSrcMediaElement && !this.src.loadedmetadata) - ? ((t = new Uint8Array([1, 1, 1, 1])), - r.texImage2D( - this.glTarget, - 0, - r.RGBA, - 1, - 1, - 0, - this.glFormat, - this.glDataType, - t, - )) - : r.texImage2D( - this.glTarget, - 0, - this.glFormat, - this.glFormat, - this.glDataType, - e, - )); - }, - }, - { - key: "update", - value: function () { - var e, - t, - r, - o = this.src; - return ( - 0 !== o.width && - 0 !== o.height && - !this.isFramebufferTexture && - ((e = this._getTextureDataFromSource()), - (t = !1), - (r = this._renderer.GL), - e.width !== this.width || e.height !== this.height - ? ((t = !0), - (this.width = e.width || o.width), - (this.height = e.height || o.height), - this.isSrcP5Image - ? o.setModified(!1) - : (this.isSrcMediaElement || - this.isSrcHTMLElement) && - o.setModified(!0)) - : this.isSrcP5Image - ? o.isModified() && o.setModified(!(t = !0)) - : this.isSrcMediaElement - ? o.isModified() - ? o.setModified(!(t = !0)) - : o.loadedmetadata && - this._videoPrevUpdateTime !== o.time() && - ((this._videoPrevUpdateTime = o.time()), - (t = !0)) - : this.isImageData - ? o._dirty && (t = !(o._dirty = !1)) - : (t = !0), - t && - (this.bindTexture(), - r.texImage2D( - this.glTarget, - 0, - this.glFormat, - this.glFormat, - this.glDataType, - e, - )), - t) - ); - }, - }, - { - key: "bindTexture", - value: function () { - return ( - this._renderer.GL.bindTexture( - this.glTarget, - this.getTexture(), - ), - this - ); - }, - }, - { - key: "unbindTexture", - value: function () { - this._renderer.GL.bindTexture(this.glTarget, null); - }, - }, - { - key: "getTexture", - value: function () { - return this.isFramebufferTexture - ? this.src.rawTexture() - : this.glTex; - }, - }, - { - key: "setInterpolation", - value: function (e, t) { - var r = this._renderer.GL; - (this.glMinFilter = this.glFilter(e)), - (this.glMagFilter = this.glFilter(t)), - this.bindTexture(), - r.texParameteri( - r.TEXTURE_2D, - r.TEXTURE_MIN_FILTER, - this.glMinFilter, - ), - r.texParameteri( - r.TEXTURE_2D, - r.TEXTURE_MAG_FILTER, - this.glMagFilter, - ), - this.unbindTexture(); - }, - }, - { - key: "glFilter", - value: function (e) { - var t = this._renderer.GL; - return e === a.NEAREST ? t.NEAREST : t.LINEAR; - }, - }, - { - key: "setWrapMode", - value: function (e, t) { - function r(e) { - return 0 == (e & (e - 1)); - } - var o = this._renderer.GL, - n = this._getTextureDataFromSource(), - n = - n.naturalWidth && n.naturalHeight - ? ((s = n.naturalWidth), n.naturalHeight) - : ((s = this.width), this.height), - s = r(s), - n = r(n); - e === a.REPEAT - ? this._renderer.webglVersion === a.WEBGL2 || (s && n) - ? (this.glWrapS = o.REPEAT) - : (console.warn( - "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", - ), - (this.glWrapS = o.CLAMP_TO_EDGE)) - : e === a.MIRROR - ? this._renderer.webglVersion === a.WEBGL2 || (s && n) - ? (this.glWrapS = o.MIRRORED_REPEAT) - : (console.warn( - "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", - ), - (this.glWrapS = o.CLAMP_TO_EDGE)) - : (this.glWrapS = o.CLAMP_TO_EDGE), - t === a.REPEAT - ? this._renderer.webglVersion === a.WEBGL2 || (s && n) - ? (this.glWrapT = o.REPEAT) - : (console.warn( - "You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead", - ), - (this.glWrapT = o.CLAMP_TO_EDGE)) - : t === a.MIRROR - ? this._renderer.webglVersion === a.WEBGL2 || (s && n) - ? (this.glWrapT = o.MIRRORED_REPEAT) - : (console.warn( - "You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead", - ), - (this.glWrapT = o.CLAMP_TO_EDGE)) - : (this.glWrapT = o.CLAMP_TO_EDGE), - this.bindTexture(), - o.texParameteri( - o.TEXTURE_2D, - o.TEXTURE_WRAP_S, - this.glWrapS, - ), - o.texParameteri( - o.TEXTURE_2D, - o.TEXTURE_WRAP_T, - this.glWrapT, - ), - this.unbindTexture(); - }, - }, - ]), - n - ); - })(); - var p = (function (e) { - var t = n; - if ("function" != typeof e && null !== e) - throw new TypeError( - "Super expression must either be null or a function", - ); - (t.prototype = Object.create(e && e.prototype, { - constructor: { value: t, writable: !0, configurable: !0 }, - })), - e && u(t, e); - var o = c(n); - function n(e, t, r) { - d(this, n); - t = (e = o.call(this, e, t, r))._renderer.GL; - return ( - e.glMinFilter === t.LINEAR && - (e.glMinFilter = t.LINEAR_MIPMAP_LINEAR), - e - ); - } - return ( - f(n, [ - { - key: "glFilter", - value: function (e) { - return this._renderer.GL.LINEAR_MIPMAP_LINEAR; - }, - }, - { - key: "_getTextureDataFromSource", - value: function () { - return this.src; - }, - }, - { - key: "init", - value: function (e) { - var t = this._renderer.GL; - (this.glTex = t.createTexture()), this.bindTexture(); - for (var r = 0; r < e.length; r++) - t.texImage2D( - this.glTarget, - r, - this.glFormat, - this.glFormat, - this.glDataType, - e[r], - ); - (this.glMinFilter = t.LINEAR_MIPMAP_LINEAR), - t.texParameteri( - t.TEXTURE_2D, - t.TEXTURE_MAG_FILTER, - this.glMagFilter, - ), - t.texParameteri( - t.TEXTURE_2D, - t.TEXTURE_MIN_FILTER, - this.glMinFilter, - ), - this.unbindTexture(); - }, - }, - { key: "update", value: function () {} }, - ]), - n - ); - })(s.default.Texture); - function m(e) { - var t = e.GL, - e = e.webglVersion, - r = - e === a.WEBGL2 - ? t.getExtension("EXT_color_buffer_float") && - t.getExtension("EXT_float_blend") - : t.getExtension("OES_texture_float"), - o = r && t.getExtension("OES_texture_float_linear"), - e = - e === a.WEBGL2 - ? t.getExtension("EXT_color_buffer_float") - : t.getExtension("OES_texture_half_float"); - return { - float: r, - floatLinear: o, - halfFloat: e, - halfFloatLinear: - e && t.getExtension("OES_texture_half_float_linear"), - }; - } - r.MipmapTexture = p; - e = s.default.Texture; - r.default = e; - }, - { - "../core/constants": 264, - "../core/main": 275, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.get-prototype-of": 180, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.reflect.construct": 184, - "core-js/modules/es.regexp.to-string": 188, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.typed-array.copy-within": 205, - "core-js/modules/es.typed-array.every": 206, - "core-js/modules/es.typed-array.fill": 207, - "core-js/modules/es.typed-array.filter": 208, - "core-js/modules/es.typed-array.find": 210, - "core-js/modules/es.typed-array.find-index": 209, - "core-js/modules/es.typed-array.for-each": 213, - "core-js/modules/es.typed-array.includes": 214, - "core-js/modules/es.typed-array.index-of": 215, - "core-js/modules/es.typed-array.iterator": 218, - "core-js/modules/es.typed-array.join": 219, - "core-js/modules/es.typed-array.last-index-of": 220, - "core-js/modules/es.typed-array.map": 221, - "core-js/modules/es.typed-array.reduce": 223, - "core-js/modules/es.typed-array.reduce-right": 222, - "core-js/modules/es.typed-array.reverse": 224, - "core-js/modules/es.typed-array.set": 225, - "core-js/modules/es.typed-array.slice": 226, - "core-js/modules/es.typed-array.some": 227, - "core-js/modules/es.typed-array.sort": 228, - "core-js/modules/es.typed-array.subarray": 229, - "core-js/modules/es.typed-array.to-locale-string": 230, - "core-js/modules/es.typed-array.to-string": 231, - "core-js/modules/es.typed-array.uint8-array": 234, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - 335: [ - function (e, t, r) { - "use strict"; - function o(e) { - return (o = - "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); - } - function i(e) { - return (i = - "function" == typeof Symbol && "symbol" === o(Symbol.iterator) - ? function (e) { - return o(e); - } - : function (e) { - return e && - "function" == typeof Symbol && - e.constructor === Symbol && - e !== Symbol.prototype - ? "symbol" - : o(e); - })(e); - } - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.get-own-property-descriptor"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.sub"), - e("core-js/modules/es.weak-map"), - e("core-js/modules/web.dom-collections.iterator"), - e("core-js/modules/es.symbol"), - e("core-js/modules/es.symbol.description"), - e("core-js/modules/es.symbol.iterator"), - e("core-js/modules/es.array.iterator"), - e("core-js/modules/es.object.to-string"), - e("core-js/modules/es.regexp.exec"), - e("core-js/modules/es.string.iterator"), - e("core-js/modules/es.string.split"), - e("core-js/modules/es.string.sub"), - e("core-js/modules/web.dom-collections.iterator"); - var n, - B = (n = e("../core/main")) && n.__esModule ? n : { default: n }, - M = (function (e) { - if (e && e.__esModule) return e; - if (null === e || ("object" !== i(e) && "function" != typeof e)) - return { default: e }; - var t = a(); - if (t && t.has(e)) return t.get(e); - var r, - o = {}, - n = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (r in e) { - var s; - Object.prototype.hasOwnProperty.call(e, r) && - ((s = n ? Object.getOwnPropertyDescriptor(e, r) : null) && - (s.get || s.set) - ? Object.defineProperty(o, r, s) - : (o[r] = e[r])); - } - (o.default = e), t && t.set(e, o); - return o; - })(e("../core/constants")); - function a() { - var e; - return "function" != typeof WeakMap - ? null - : ((e = new WeakMap()), - (a = function () { - return e; - }), - e); - } - function G(e, t) { - if (!(e instanceof t)) - throw new TypeError("Cannot call a class as a function"); - } - function s(e, t) { - for (var r = 0; r < t.length; r++) { - var o = t[r]; - (o.enumerable = o.enumerable || !1), - (o.configurable = !0), - "value" in o && (o.writable = !0), - Object.defineProperty(e, o.key, o); - } - } - function V(e, t, r) { - t && s(e.prototype, t), r && s(e, r); - } - e("./p5.Shader"), - e("./p5.RendererGL.Retained"), - (B.default.RendererGL.prototype._applyTextProperties = - function () {}), - (B.default.RendererGL.prototype.textWidth = function (e) { - return this._isOpenType() - ? this._textFont._textWidth(e, this._textSize) - : 0; - }); - var l = (function () { - function r(e, t) { - G(this, r), - (this.width = e), - (this.height = t), - (this.infos = []); - } - return ( - V(r, [ - { - key: "findImage", - value: function (e) { - var t, - r, - o = this.width * this.height; - if (o < e) - throw new Error("font is too complex to render in 3D"); - for (var n = this.infos.length - 1; 0 <= n; --n) { - var s = this.infos[n]; - if (s.index + e < o) { - r = (t = s).imageData; - break; - } - } - if (!t) { - try { - r = new ImageData(this.width, this.height); - } catch (e) { - var i = document.getElementsByTagName("canvas")[0], - a = !i, - l = - (i || - (((i = - document.createElement( - "canvas", - )).style.display = "none"), - document.body.appendChild(i)), - i.getContext("2d")); - l && (r = l.createImageData(this.width, this.height)), - a && document.body.removeChild(i); - } - this.infos.push((t = { index: 0, imageData: r })); - } - l = t.index; - return ( - (t.index += e), - (r._dirty = !0), - { imageData: r, index: l } - ); - }, - }, - ]), - r - ); - })(); - function z(e, t, r, o, n) { - var s = e.imageData.data, - e = 4 * e.index++; - (s[e++] = t), (s[e++] = r), (s[e++] = o), (s[+e] = n); - } - var H = Math.sqrt(3), - E = (function () { - function t(e) { - G(this, t), - (this.font = e), - (this.strokeImageInfos = new l(64, 64)), - (this.colDimImageInfos = new l(64, 64)), - (this.rowDimImageInfos = new l(64, 64)), - (this.colCellImageInfos = new l(64, 64)), - (this.rowCellImageInfos = new l(64, 64)), - (this.glyphInfos = {}); - } - return ( - V(t, [ - { - key: "getGlyphInfo", - value: function (e) { - var t = this.glyphInfos[e.index]; - if (!t) { - var r = e.getBoundingBox(), - o = r.x1, - n = r.y1, - s = r.x2 - o, - i = r.y2 - n, - a = e.path.commands; - if (0 == s || 0 == i || !a.length) - return (this.glyphInfos[e.index] = {}); - for (var u = [], c = [], d = [], l = 8; 0 <= l; --l) - d.push([]); - for (l = 8; 0 <= l; --l) c.push([]); - var h, - f, - p, - m, - D = (function () { - function n(e, t, r, o) { - G(this, n), - (this.p0 = e), - (this.c0 = t), - (this.c1 = r), - (this.p1 = o); - } - return ( - V(n, [ - { - key: "toQuadratic", - value: function () { - return { - x: this.p0.x, - y: this.p0.y, - x1: this.p1.x, - y1: this.p1.y, - cx: - (3 * (this.c0.x + this.c1.x) - - (this.p0.x + this.p1.x)) / - 4, - cy: - (3 * (this.c0.y + this.c1.y) - - (this.p0.y + this.p1.y)) / - 4, - }; - }, - }, - { - key: "quadError", - value: function () { - return ( - B.default.Vector.sub( - B.default.Vector.sub(this.p1, this.p0), - B.default.Vector.mult( - B.default.Vector.sub( - this.c1, - this.c0, - ), - 3, - ), - ).mag() / 2 - ); - }, - }, - { - key: "split", - value: function (e) { - var t = B.default.Vector.lerp( - this.p0, - this.c0, - e, - ), - r = B.default.Vector.lerp( - this.c0, - this.c1, - e, - ), - o = B.default.Vector.lerp(t, r, e), - r = - ((this.c1 = B.default.Vector.lerp( - this.c1, - this.p1, - e, - )), - (this.c0 = B.default.Vector.lerp( - r, - this.c1, - e, - )), - B.default.Vector.lerp(o, this.c0, e)), - e = new n(this.p0, t, o, r); - return (this.p0 = r), e; - }, - }, - { - key: "splitInflections", - value: function () { - var e = B.default.Vector.sub( - this.c0, - this.p0, - ), - t = B.default.Vector.sub( - B.default.Vector.sub(this.c1, this.c0), - e, - ), - r = B.default.Vector.sub( - B.default.Vector.sub( - B.default.Vector.sub( - this.p1, - this.c1, - ), - e, - ), - B.default.Vector.mult(t, 2), - ), - o = [], - n = t.x * r.y - t.y * r.x; - return ( - 0 !== n && - 0 <= - (e = - (r = e.x * r.y - e.y * r.x) * r - - 4 * n * (e.x * t.y - e.y * t.x)) && - (n < 0 && ((n = -n), (r = -r), 0), - (e = - (-r + (t = Math.sqrt(e))) / (2 * n)), - 0 < (r = (-r - t) / (2 * n)) && - r < 1 && - (o.push(this.split(r)), - (e = 1 - (1 - e) / (1 - r))), - 0 < e && - e < 1 && - o.push(this.split(e))), - o.push(this), - o - ); - }, - }, - ]), - n - ); - })(), - y = !0, - g = !1, - v = void 0; - try { - for ( - var b, j = a[Symbol.iterator](); - !(y = (b = j.next()).done); - y = !0 - ) { - var _ = b.value, - x = (_.x - o) / s, - w = (_.y - n) / i; - if (!U(h, f, x, w)) { - switch (_.type) { - case "M": - (p = x), (m = w); - break; - case "L": - I(h, f, x, w); - break; - case "Q": - var S = (_.x1 - o) / s, - T = (_.y1 - n) / i; - L([h, x, S], [f, w, T], { - x: h, - y: f, - cx: S, - cy: T, - }); - break; - case "Z": - U(h, f, p, m) - ? u.push({ x: h, y: f }) - : (I(h, f, p, m), u.push({ x: p, y: m })); - break; - case "C": - for ( - var M = (function (e, t, r, o, n, s, i, a) { - var e = new D( - new B.default.Vector(e, t), - new B.default.Vector(r, o), - new B.default.Vector(n, s), - new B.default.Vector(i, a), - ).splitInflections(), - l = [], - u = 30 / H, - c = !0, - t = !1, - r = void 0; - try { - for ( - var d, h = e[Symbol.iterator](); - !(c = (d = h.next()).done); - c = !0 - ) { - for ( - var f = d.value, - p = [], - m = void 0; - !( - 0.125 <= (m = u / f.quadError()) - ); - - ) { - var y = Math.pow(m, 1 / 3), - g = f.split(y), - v = f.split(1 - y / (1 - y)); - l.push(g), p.push(f), (f = v); - } - m < 1 && l.push(f.split(0.5)), - l.push(f), - Array.prototype.push.apply( - l, - p.reverse(), - ); - } - } catch (e) { - (t = !0), (r = e); - } finally { - try { - c || null == h.return || h.return(); - } finally { - if (t) throw r; - } - } - return l; - })( - h, - f, - (_.x1 - o) / s, - (_.y1 - n) / i, - (_.x2 - o) / s, - (_.y2 - n) / i, - x, - w, - ), - E = 0; - E < M.length; - E++ - ) { - var k = M[E].toQuadratic(); - L([k.x, k.x1, k.cx], [k.y, k.y1, k.cy], k); - } - break; - default: - throw new Error( - "unknown command type: ".concat(_.type), - ); - } - (h = x), (f = w); - } - } - } catch (e) { - (g = !0), (v = e); - } finally { - try { - y || null == j.return || j.return(); - } finally { - if (g) throw v; - } - } - for ( - var C = u.length, - O = this.strokeImageInfos.findImage(C), - F = O.index, - P = 0; - P < C; - ++P - ) { - var A = u[P]; - z(O, R(A.x), R(A.y), R(A.cx), R(A.cy)); - } - (t = this.glyphInfos[e.index] = - { - glyph: e, - uGlyphRect: [r.x1, -r.y1, r.x2, -r.y2], - strokeImageInfo: O, - strokes: u, - colInfo: N( - d, - this.colDimImageInfos, - this.colCellImageInfos, - ), - rowInfo: N( - c, - this.rowDimImageInfos, - this.rowCellImageInfos, - ), - }).uGridOffset = [ - t.colInfo.dimOffset, - t.rowInfo.dimOffset, - ]; - } - return t; - function L(e, t, r) { - var o = u.length; - function n(e, t, r) { - for (var o = e.length; 0 < o--; ) { - var n = e[o]; - n < t && (t = n), r < n && (r = n); - } - return { min: t, max: r }; - } - u.push(r); - for ( - var r = n(e, 1, 0), - e = Math.max(Math.floor(9 * r.min - 0.5), 0), - s = Math.min(Math.ceil(9 * r.max + 0.5), 9), - i = e; - i < s; - ++i - ) - d[i].push(o); - for ( - var r = n(t, 1, 0), - e = Math.max(Math.floor(9 * r.min - 0.5), 0), - a = Math.min(Math.ceil(9 * r.max + 0.5), 9), - l = e; - l < a; - ++l - ) - c[l].push(o); - } - function R(e) { - return (e = (r = 255) * e) < (t = 0) - ? t - : r < e - ? r - : e; - var t, r; - } - function I(e, t, r, o) { - L([e, r], [t, o], { - x: e, - y: t, - cx: (e + r) / 2, - cy: (t + o) / 2, - }); - } - function U(e, t, r, o) { - return Math.abs(r - e) < 1e-5 && Math.abs(o - t) < 1e-5; - } - function N(e, t, r) { - for ( - var o = e.length, - n = t.findImage(o), - t = n.index, - s = 0, - i = 0; - i < o; - ++i - ) - s += e[i].length; - for (var a = r.findImage(s), l = 0; l < o; ++l) { - var u = e[l], - c = u.length, - d = a.index; - z(n, d >> 7, 127 & d, c >> 7, 127 & c); - for (var h = 0; h < c; ++h) { - var f = u[h] + F; - z(a, f >> 7, 127 & f, 0, 0); - } - } - return { - cellImageInfo: a, - dimOffset: t, - dimImageInfo: n, - }; - } - }, - }, - ]), - t - ); - })(); - B.default.RendererGL.prototype._renderText = function ( - e, - t, - r, - o, - n, - ) { - if (this._textFont && "string" != typeof this._textFont) { - if (!(n <= o) && this._doFill) { - if (this._isOpenType()) { - e.push(); - var n = this._doStroke, - s = this.drawMode, - i = - ((this._doStroke = !1), - (this.drawMode = M.TEXTURE), - this._textFont.font), - a = - (a = this._textFont._fontInfo) || - (this._textFont._fontInfo = new E(i)), - r = this._textFont._handleAlignment(this, t, r, o), - o = this._textSize / i.unitsPerEm, - l = - (this.translate(r.x, r.y, 0), - this.scale(o, o, 1), - this.GL), - r = !this._defaultFontShader, - u = this._getFontShader(), - c = - (u.init(), - u.bindShader(), - r && - (u.setUniform("uGridImageSize", [64, 64]), - u.setUniform("uCellsImageSize", [64, 64]), - u.setUniform("uStrokeImageSize", [64, 64]), - u.setUniform("uGridSize", [9, 9])), - this._applyColorBlend(this.curFillColor), - this.retainedMode.geometry.glyph), - d = - (c || - ((o = this._textGeom = - new B.default.Geometry(1, 1, function () { - for (var e = 0; e <= 1; e++) - for (var t = 0; t <= 1; t++) - this.vertices.push( - new B.default.Vector(t, e, 0), - ), - this.uvs.push(t, e); - })) - .computeFaces() - .computeNormals(), - (c = this.createBuffers("glyph", o))), - !0), - r = !1, - o = void 0; - try { - for ( - var h, - f = this.retainedMode.buffers.text[Symbol.iterator](); - !(d = (h = f.next()).done); - d = !0 - ) - h.value._prepareBuffer(c, u); - } catch (e) { - (r = !0), (o = e); - } finally { - try { - d || null == f.return || f.return(); - } finally { - if (r) throw o; - } - } - this._bindBuffer(c.indexBuffer, l.ELEMENT_ARRAY_BUFFER), - u.setUniform("uMaterialColor", this.curFillColor), - l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1); - try { - var p = 0, - m = null, - y = i.stringToGlyphs(t), - g = !0, - v = !1, - b = void 0; - try { - for ( - var j, _ = y[Symbol.iterator](); - !(g = (j = _.next()).done); - g = !0 - ) { - var x, - w, - S = j.value, - T = - (m && (p += i.getKerningValue(m, S)), - a.getGlyphInfo(S)); - T.uGlyphRect && - ((x = T.rowInfo), - (w = T.colInfo), - u.setUniform( - "uSamplerStrokes", - T.strokeImageInfo.imageData, - ), - u.setUniform( - "uSamplerRowStrokes", - x.cellImageInfo.imageData, - ), - u.setUniform( - "uSamplerRows", - x.dimImageInfo.imageData, - ), - u.setUniform( - "uSamplerColStrokes", - w.cellImageInfo.imageData, - ), - u.setUniform( - "uSamplerCols", - w.dimImageInfo.imageData, - ), - u.setUniform("uGridOffset", T.uGridOffset), - u.setUniform("uGlyphRect", T.uGlyphRect), - u.setUniform("uGlyphOffset", p), - u.bindTextures(), - l.drawElements( - l.TRIANGLES, - 6, - this.GL.UNSIGNED_SHORT, - 0, - )), - (p += S.advanceWidth), - (m = S); - } - } catch (e) { - (v = !0), (b = e); - } finally { - try { - g || null == _.return || _.return(); - } finally { - if (v) throw b; - } - } - } finally { - u.unbindShader(), - (this._doStroke = n), - (this.drawMode = s), - l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), - e.pop(); - } - } else - console.log( - "WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported", - ); - return e; - } - } else - console.log( - "WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.", - ); - }; - }, - { - "../core/constants": 264, - "../core/main": 275, - "./p5.RendererGL.Retained": 331, - "./p5.Shader": 333, - "core-js/modules/es.array.iterator": 161, - "core-js/modules/es.object.get-own-property-descriptor": 178, - "core-js/modules/es.object.to-string": 182, - "core-js/modules/es.regexp.exec": 187, - "core-js/modules/es.string.iterator": 192, - "core-js/modules/es.string.split": 198, - "core-js/modules/es.string.sub": 200, - "core-js/modules/es.symbol": 204, - "core-js/modules/es.symbol.description": 202, - "core-js/modules/es.symbol.iterator": 203, - "core-js/modules/es.weak-map": 236, - "core-js/modules/web.dom-collections.iterator": 238, - }, - ], - }, - {}, - [259], - )(259); -}); +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n>>1;case"base64":return E(e).length;default:if(n)return o?-1:M(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function T(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var h=o,f=h.length;if(f<=v)return String.fromCharCode.apply(String,h);for(var p="",m=0;mt&&(e+=" ... "),""},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(C(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,h=r,f=(d=Number(d)||0,u.length-d);(!h||f<(h=Number(h)))&&(h=f),(f=c.length)/2e.length)throw new RangeError("Index out of range")}function j(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(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},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function E(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function C(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function O(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,A("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:246}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":148}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(M,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,j=g&&p(g),_=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),T=s&&!!m&&"Opera"!==c(a.opera),e=!1,M={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in M)a[n]||(T=!1);if((!T||"function"!=typeof j||j===Function.prototype)&&(j=function(){throw TypeError("Incorrect invocation")},T))for(n in M)a[n]&&m(a[n],j);if((!T||!_||_===x)&&(_=j.prototype,T))for(n in M)a[n]&&m(a[n].prototype,_);if(T&&p(b)!==_&&m(b,_),i&&!u(_,y))for(n in e=!0,f(_,y,{get:function(){return l(this)?this[S]:void 0}}),M)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(j,e))return e}else for(var t in M)if(u(M,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in M){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}_[e]&&!r||h(_,e,!r&&T&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in M)(n=a[o])&&u(n,e)&&delete n[e];if(j[e]&&!r)return;try{return h(j,e,!r&&T&&g[e]||t)}catch(e){}}for(o in M)!(n=a[o])||n[e]&&!r||h(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(M,e)},isTypedArray:o,TypedArray:j,TypedArrayPrototype:_}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":145,"../internals/well-known-symbol":148}],13:[function(e,t,D){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return O(e,23,4)}function F(e){return O(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw C(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;uR;)(A=L[R++])in M||N(M,A,T[A]);c.constructor=M}g&&V(e)!==k&&g(e,k);var y=new E(new M(2)),I=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||h(e,{setInt8:function(e,t){I.call(this,e,t<<24>>24)},setUint8:function(e,t){I.call(this,e,t<<24>>24)}},{unsafe:!0})}else M=function(e){p(this,M,_);e=m(e);j(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},E=function(e,t,r){p(this,E,x),p(e,M,x);var o=b(e).byteLength,t=B(t);if(t<0||o>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1>16},getUint16:function(e){e=l(this,2,e,1>>0},getFloat32:function(e){return P(l(this,4,e,1"+e+""}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":140}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),j=e("../internals/set-to-string-tag"),_=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/iterators"),e=e("../internals/iterators-core"),T=e.IteratorPrototype,M=e.BUGGY_SAFARI_ITERATORS,E=o("iterator"),k="values",C="entries";t.exports=function(e,t,r,o,n,s,i){g(r,t,o);function a(e){if(e===n&&f)return f;if(!M&&e in d)return d[e];switch(e){case"keys":case k:case C:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,u,o=t+" Iterator",c=!1,d=e.prototype,h=d[E]||d["@@iterator"]||n&&d[n],f=!M&&h||a(n),p="Array"==t&&d.entries||h;if(p&&(p=v(p.call(new e)),T!==Object.prototype&&p.next&&(w||v(p)===T||(b?b(p,T):"function"!=typeof p[E]&&_(p,E,m)),j(p,o,!0,!0),w&&(S[o]=m))),n==k&&h&&h.name!==k&&(c=!0,f=function(){return h.call(this)}),w&&!i||d[E]===f||_(d,E,f),S[t]=f,n)if(l={values:a(k),keys:s?f:a("keys"),entries:a(C)},i)for(u in l)!M&&!c&&u in d||x(d,u,l[u]);else y({target:t,proto:!0,forced:M||c},l);return l}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":148}],42:[function(e,t,r){var o=e("../internals/path"),n=e("../internals/has"),s=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});n(t,e)||i(t,e,{value:s.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":147}],43:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/is-object"),n=o.document,s=e(n)&&e(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,n,s=e("../internals/global"),e=e("../internals/engine-user-agent"),s=s.process,s=s&&s.versions,s=s&&s.v8;s?n=(o=s.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(n=o[1]),t.exports=n&&+n},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var u=e("../internals/global"),c=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/set-global"),p=e("../internals/copy-constructor-properties"),m=e("../internals/is-forced");t.exports=function(e,t){var r,o,n,s=e.target,i=e.global,a=e.stat,l=i?u:a?u[s]||f(s,{}):(u[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.noTargetGet?(n=c(l,r))&&n.value:l[r],!m(i?r:s+(a?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;p(o,n)}(e.sham||n&&n.sham)&&d(o,"sham",!0),h(l,r,o,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var u=e("../internals/redefine"),c=e("../internals/fails"),d=e("../internals/well-known-symbol"),h=e("../internals/regexp-exec"),f=e("../internals/create-non-enumerable-property"),p=d("species"),m=!c(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),y="$0"==="a".replace(/./,"$0"),e=d("replace"),g=!!/./[e]&&""===/./[e]("a","$0"),v=!c(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(r,e,t,o){var s,n,i=d(r),a=!c(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),l=a&&!c(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[p]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});a&&l&&("replace"!==r||m&&y&&!g)&&("split"!==r||v)||(s=/./[i],t=(l=t(i,""[r],function(e,t,r,o,n){return t.exec===h?a&&!n?{done:!0,value:s.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}))[0],n=l[1],u(String.prototype,r,t),u(RegExp.prototype,i,2==e?function(e,t){return n.call(e,this,t)}:function(e){return n.call(e,this)})),o&&f(RegExp.prototype[i],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":148,"../modules/es.regexp.exec":187}],53:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(e,t,r){var s=e("../internals/a-function");t.exports=function(o,n,e){if(s(o),void 0===n)return o;switch(e){case 0:return function(){return o.call(n)};case 1:return function(e){return o.call(n,e)};case 2:return function(e,t){return o.call(n,e,t)};case 3:return function(e,t,r){return o.call(n,e,t,r)}}return function(){return o.apply(n,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){"use strict";var o=e("../internals/a-function"),n=e("../internals/is-object"),c=[].slice,d={};t.exports=Function.bind||function(i){var a=o(this),l=c.call(arguments,1),u=function(){var e=l.concat(c.call(arguments));if(this instanceof u){var t=a,r=e.length,o=e;if(!(r in d)){for(var n=[],s=0;s>1,u=23===t?f(2,-24)-f(2,-77):0,c=e<0||0===e&&1/e<0?1:0,d=0;for((e=h(e))!=e||e===1/0?(n=e!=e?1:0,o=r):(o=p(m(e)/y),e*(s=f(2,-o))<1&&(o--,s*=2),2<=(e+=1<=o+l?u/s:u*f(2,1-l))*s&&(o++,s/=2),r<=o+l?(n=0,o=r):1<=o+l?(n=(e*s-1)*f(2,t),o+=l):(n=e*f(2,l-1)*f(2,t),o=0));8<=t;i[d++]=255&n,n/=256,t-=8);for(o=o<>1,a=n-7,l=o-1,n=e[l--],u=127&n;for(n>>=7;0>=-a,a+=t;0"+e+""},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=n?((e=n).write(p("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=c("iframe"),t="java"+h+":",e.style.display="none",u.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[f]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=s(e),r=new o,o[d]=null,r[f]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),l=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){a(e);for(var r,o=l(t),n=o.length,s=0;sn;)!i(o,r=t[n++])||~l(s,r)||s.push(r);return s}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":134}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){"use strict";var o={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!o.call({1:2},1);r.f=s?function(e){e=n(this,e);return!!e&&e.enumerable}:o},{}],101:[function(e,t,r){var n=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return n(e),s(t),o?r.call(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){"use strict";var o=e("../internals/to-string-tag-support"),n=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+n(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":141}],103:[function(e,t,r){var o=e("../internals/get-built-in"),n=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=n.f(i(e)),r=s.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global");t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/is-object"),s=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),n(t)&&t.constructor===e?t:((0,(e=s.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var i=e("../internals/global"),a=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),u=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),n=e.get,c=e.enforce,d=String(String).split("String");(t.exports=function(e,t,r,o){var n=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,o=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||l(r,"name")||a(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e===i?s?e[t]=r:u(t,r):(n?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=r:a(e,t,r))})(Function.prototype,"toString",function(){return"function"==typeof this&&n(this).source||o(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),n=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){r=r.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return n.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){"use strict";var o,n,d=e("./regexp-flags"),e=e("./regexp-sticky-helpers"),h=RegExp.prototype.exec,f=String.prototype.replace,s=h,p=(o=/a/,n=/b*/g,h.call(o,"a"),h.call(n,"a"),0!==o.lastIndex||0!==n.lastIndex),m=e.UNSUPPORTED_Y||e.BROKEN_CARET,y=void 0!==/()??/.exec("")[1];t.exports=s=p||y||m?function(e){var t,r,o,n,s=this,i=m&&s.sticky,a=d.call(s),l=s.source,u=0,c=e;return i&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),c=String(e).slice(s.lastIndex),0t&&(o=o.slice(0,t)),n?e+o:o+e)}}var s=e("../internals/to-length"),i=e("../internals/string-repeat"),a=e("../internals/require-object-coercible"),l=Math.ceil;t.exports={start:o(!1),end:o(!0)}},{"../internals/require-object-coercible":113,"../internals/string-repeat":127,"../internals/to-length":136}],126:[function(e,t,r){"use strict";function g(e){return e+22+75*(e<26)}function s(e){var t,r=[],o=(e=function(e){for(var t=[],r=0,o=e.length;rT((v-s)/d))throw RangeError(w);for(s+=(u-n)*d,n=u,c=0;cv)throw RangeError(w);if(t==n){for(var h=s,f=b;;f+=b){var p=f<=i?1:i+j<=f?j:f-i;if(h>1,e+=T(e/t);S*j>>1>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":135}],128:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/whitespaces");t.exports=function(e){return o(function(){return!!n[e]()||"​…᠎"!="​…᠎"[e]()||n[e].name!==e})}},{"../internals/fails":51,"../internals/whitespaces":149}],129:[function(e,t,r){function o(t){return function(e){e=String(n(e));return 1&t&&(e=e.replace(s,"")),e=2&t?e.replace(i,""):e}}var n=e("../internals/require-object-coercible"),e="["+e("../internals/whitespaces")+"]",s=RegExp("^"+e+e+"*"),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":149}],130:[function(e,t,r){function o(e){return function(){x(e)}}function n(e){x(e.data)}function s(e){a.postMessage(e+"",f.protocol+"//"+f.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),u=e("../internals/classof-raw"),c=e("../internals/function-bind-context"),d=e("../internals/html"),h=e("../internals/document-create-element"),e=e("../internals/engine-is-ios"),f=a.location,p=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,j={},_="onreadystatechange",x=function(e){var t;j.hasOwnProperty(e)&&(t=j[e],delete j[e],t())};p&&m||(p=function(e){for(var t=[],r=1;r=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":134}],162:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),i=[].join,n=n!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:n||!e},{join:function(e){return i.call(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":134}],163:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/array-last-index-of");o({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],164:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").map,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("map"),e=e("map");o({target:"Array",proto:!0,forced:!s||!e},{map:function(e){return n(this,e,1T;T++)l(b,x=S[T])&&!l(w,x)&&y(w,x,m(b,x));(w.prototype=j).constructor=w,a(s,v,w)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":129,"../internals/to-primitive":140}],174:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],175:[function(e,t,r){"use strict";function c(e,t,r){return 0===t?r:t%2==1?c(e,t-1,r*e):c(e*e,t/2,r)}var o=e("../internals/export"),d=e("../internals/to-integer"),h=e("../internals/this-number-value"),f=e("../internals/string-repeat"),e=e("../internals/fails"),n=1..toFixed,p=Math.floor;o({target:"Number",proto:!0,forced:n&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!e(function(){n.call({})})},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*a[r],a[r]=o%1e7,o=p(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=a[t],a[t]=p(r/e),r=r%e*1e7}function o(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===a[t]||(e=String(a[t]),r=""===r?e:r+f.call("0",7-e.length)+e);return r}var n,s,i=h(this),e=d(e),a=[0,0,0,0,0,0],l="",u="0";if(e<0||20n;){var s,i,a,l=y[n++],u=t?l.ok:l.fail,c=l.resolve,d=l.reject,h=l.domain;try{u?(t||(p.rejection===oe&&function(e,t){v.call(g,function(){if(k)T.emit("rejectionHandled",e);else se(te,e,t.value)})}(f,p),p.rejection=P),!0===u?s=e:(h&&h.enter(),s=u(e),h&&(h.exit(),a=!0)),s===l.promise?d(w("Promise-chain cycle")):(i=ne(s))?i.call(s,c,d):c(s)):d(e)}catch(e){h&&!a&&h.exit(),d(e)}}p.reactions=[],p.notified=!1,m&&!p.rejection&&(r=f,o=p,v.call(g,function(){var e=o.value,t=ie(o);if(t&&(t=b(function(){k?T.emit("unhandledRejection",e,r):se(C,r,e)}),o.rejection=k||ie(o)?oe:P,t.error))throw t.value}))}))},se=function(e,t,r){var o;ee?((o=S.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),g.dispatchEvent(o)):o={promise:t,reason:r},(t=g["on"+e])?t(o):e===C&&Y("Unhandled promise rejection",r)},ie=function(e){return e.rejection!==P&&!e.parent},L=function(t,r,o,n){return function(e){t(r,o,e,n)}},R=function(e,t,r,o){t.done||(t.done=!0,(t=o?o:t).value=r,t.state=re,A(e,t,!0))},I=function(r,o,e,t){if(!o.done){o.done=!0,t&&(o=t);try{if(r===e)throw w("Promise can't be resolved itself");var n=ne(e);n?u(function(){var t={done:!1};try{n.call(e,L(I,r,t,o),L(R,r,t,o))}catch(e){R(r,t,e,o)}}):(o.value=e,o.state=O,A(r,o,!1))}catch(e){R(r,{done:!1},e,o)}}};e&&(x=function(e){z(this,x,j),c(e),r.call(this);var t=_(this);try{e(L(I,this,t),L(R,this,t))}catch(e){R(this,t,e)}},(r=function(e){J(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=N(x.prototype,{then:function(e,t){var r=K(this),o=E(X(this,x));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=k?T.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&A(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),t=function(){var e=new r,t=_(e);this.promise=e,this.resolve=L(I,e,t),this.reject=L(R,e,t)},f.f=E=function(e){return e===x||e===o?new t:$(e)},i||"function"!=typeof l||(n=l.prototype.then,U(l.prototype,"then",function(e,t){var r=this;return new x(function(e,t){n.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof M&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return h(x,M.apply(g,arguments))}}))),s({global:!0,wrap:!0,forced:e},{Promise:x}),B(x,j,!1,!0),G(j),o=a(j),s({target:j,stat:!0,forced:e},{reject:function(e){var t=E(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:i||e},{resolve:function(e){return h(i&&this===o?x:this,e)}}),s({target:j,stat:!0,forced:m},{all:function(e){var a=this,t=E(a),l=t.resolve,u=t.reject,r=b(function(){var o=c(a.resolve),n=[],s=0,i=1;d(e,function(e){var t=s++,r=!1;n.push(void 0),i++,o.call(a,e).then(function(e){r||(r=!0,n[t]=e,--i||l(n))},u)}),--i||l(n)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,o=E(r),n=o.reject,t=b(function(){var t=c(r.resolve);d(e,function(e){t.call(r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":130,"../internals/well-known-symbol":148}],184:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/get-built-in"),s=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),c=n("Reflect","construct"),d=e(function(){function e(){}return!(c(function(){},[],e)instanceof e)}),h=!e(function(){c(function(){})}),n=d||h;o({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(e,t){s(e),i(t);var r=arguments.length<3?e:s(arguments[2]);if(h&&!d)return c(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(u.apply(e,o))}o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t);return a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],185:[function(e,t,r){var o=e("../internals/export"),s=e("../internals/is-object"),i=e("../internals/an-object"),a=e("../internals/has"),l=e("../internals/object-get-own-property-descriptor"),u=e("../internals/object-get-prototype-of");o({target:"Reflect",stat:!0},{get:function e(t,r){var o,n=arguments.length<3?t:arguments[2];return i(t)===n?t[r]:(o=l.f(t,r))?a(o,"value")?o.value:void 0===o.get?void 0:o.get.call(n):s(o=u(t))?e(o,r,n):void 0}})},{"../internals/an-object":10,"../internals/export":50,"../internals/has":60,"../internals/is-object":74,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-prototype-of":97}],186:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/global"),s=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,u=e("../internals/is-regexp"),c=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),h=e("../internals/redefine"),f=e("../internals/fails"),p=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=n.RegExp,v=g.prototype,b=/a/g,j=/a/g,_=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&s("RegExp",!_||x||f(function(){return j[y]=!1,g(b)!=b||g(j)==j||"/a/i"!=g(b,"i")}))){for(var w=function(e,t){var r,o=this instanceof w,n=u(e),s=void 0===t;if(!o&&n&&e.constructor===w&&s)return e;_?n&&!s&&(e=e.source):e instanceof w&&(s&&(t=c.call(e)),e=e.source),x&&(r=!!t&&-1T;)!function(t){t in w||a(w,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})}(S[T++]);(v.constructor=w).prototype=v,h(n,"RegExp",w)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":148}],187:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],188:[function(e,t,r){"use strict";var o=e("../internals/redefine"),n=e("../internals/an-object"),s=e("../internals/fails"),i=e("../internals/regexp-flags"),e="toString",a=RegExp.prototype,l=a[e],s=s(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),u=l.name!=e;(s||u)&&o(RegExp.prototype,e,function(){var e=n(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],189:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],190:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),e=e("../internals/is-pure"),u="".endsWith,c=Math.min,l=l("endsWith");o({target:"String",proto:!0,forced:!!(e||l||(!(o=n(String.prototype,"endsWith"))||o.writable))&&!l},{endsWith:function(e){var t=String(a(this)),r=(i(e),1=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],193:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/an-object"),d=e("../internals/to-length"),n=e("../internals/require-object-coercible"),h=e("../internals/advance-string-index"),f=e("../internals/regexp-exec-abstract");o("match",1,function(o,l,u){return[function(e){var t=n(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=u(l,e,this);if(t.done)return t.value;var r=c(e),o=String(this);if(!r.global)return f(r,o);for(var n=r.unicode,s=[],i=r.lastIndex=0;null!==(a=f(r,o));){var a=String(a[0]);""===(s[i]=a)&&(r.lastIndex=h(o,d(r.lastIndex),n)),i++}return 0===i?null:s}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":136}],194:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/string-pad").start;o({target:"String",proto:!0,forced:e("../internals/string-pad-webkit-bug")},{padStart:function(e){return n(this,e,1]*>)/g,I=/\$([$&'`]|\d\d?)/g;o("replace",2,function(n,j,_,e){var x=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=e.REPLACE_KEEPS_$0,S=x?"$":"$0";return[function(e,t){var r=s(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):j.call(String(r),e,t)},function(e,t){if(!x&&w||"string"==typeof t&&-1===t.indexOf(S)){var r=_(j,e,this,t);if(r.done)return r.value}for(var o,n=T(e),s=String(this),i="function"==typeof t,a=(i||(t=String(t)),n.global),l=(a&&(o=n.unicode,n.lastIndex=0),[]);null!==(f=O(n,s))&&(l.push(f),a);)""===String(f[0])&&(n.lastIndex=C(s,E(n.lastIndex),o));for(var u,c="",d=0,h=0;h>>0;if(0==o)return[];if(void 0===e)return[r];if(!c(e))return p.call(r,e,o);for(var n,s,i,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=new RegExp(e.source,t+"g");(n=h.call(u,r))&&!(l<(s=u.lastIndex)&&(a.push(r.slice(l,n.index)),1=o));)u.lastIndex===n.index&&u.lastIndex++;return l===r.length?!i&&u.test("")||a.push(""):a.push(r.slice(l)),a.length>o?a.slice(0,o):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)}:p;return[function(e,t){var r=d(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):y.call(String(r),e,t)},function(e,t){var r=m(y,e,this,t,y!==p);if(r.done)return r.value;var r=g(e),o=String(this),e=v(r,RegExp),n=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"y":"g"),i=new e(S?r:"^(?:"+r.source+")",s),a=void 0===t?w:t>>>0;if(0==a)return[];if(0===o.length)return null===_(i,o)?[o]:[];for(var l=0,u=0,c=[];ue.key){o.splice(t,0,e);break}t===s&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=P(this).entries,o=v(e,16)return;a=0;while(h()){l=null;if(a>0)if(h()=="."&&a<4)n++;else return;if(!x.test(h()))return;while(x.test(h())){u=parseInt(h(),10);if(l===null)l=u;else if(l==0)return;else l=l*10+u;if(l>255)return;n++}t[r]=t[r]*256+l;a++;if(a==2||a==4)r++}if(a!=4)return;break}else if(h()==":"){n++;if(!h())return}else if(h())return;t[r++]=s}if(o!==null){c=r-o;r=7;while(r!=0&&c>0){d=t[r];t[r--]=t[o+c-1];t[o+--c]=d}}else if(r!=8)return;return t}(t.slice(1,-1)))?void(e.host=r):_;if(k(e))return t=z(t),ne.test(t)||null===(r=function(e){var t=e.split("."),r,o,n,s,i,a,l;if(t.length&&t[t.length-1]=="")t.pop();if((r=t.length)>4)return e;for(o=[],n=0;n1&&s.charAt(0)=="0"){i=ee.test(s)?16:8;s=s.slice(i==8?1:2)}if(s==="")a=0;else{if(!(i==10?re:i==8?te:oe).test(s))return e;a=parseInt(s,i)}o.push(a)}for(n=0;n=Z(256,5-r))return null}else if(a>255)return null}for(l=o.pop(),n=0;n":1,"`":1}),ce=d({},ue,{"#":1,"?":1,"{":1,"}":1}),T=d({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),M=function(e,t){var r=V(e,0);return 32h,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256>24&255,c=l>>16&255,d=l>>8&255,l=255&l,h=P(l,d,c,u),h=h in a?a[h]:a[h]=function(t,r,o,n,s){let i=0,a=1e100;for(let e=0;ea||(l=u[0],(c+=v(l-t))>a||(l=u[1],(c+=v(l-r))>a||(l=u[2],(c+=v(l-o))>a||(a=c,i=e))))}return i}(l,d,c,u,t);i[e]=h}else{const g="rgb444"===r?A:O;for(let e=0;e>16&255,m=f>>8&255,f=255&f,y=g(f,m,p),y=y in a?a[y]:a[y]=function(t,r,o,n){let s=0,i=1e100;for(let e=0;ei||(a=l[1],(u+=v(a-r))>i||(a=l[2],(u+=v(a-o))>i||(i=u,s=e)))}return s}(f,m,p,t);i[e]=y}}return i},default:()=>f,nearestColor:()=>function(e,t,r=u){return e[l(e,t,r)]},nearestColorIndex:()=>l,nearestColorIndexWithDistance:()=>d,prequantize:()=>function(e,{roundRGB:r=5,roundAlpha:o=10,oneBitAlpha:n=null}={}){const s=new Uint32Array(e.buffer);for(let t=0;t>24&255;var a,l=i>>16&255,u=i>>8&255,i=255&i;e=c(e,o),n&&(a="number"==typeof n?n:127,e=e<=a?0:255),i=c(i,r),u=c(u,r),l=c(l,r),s[t]=e<<24|l<<16|u<<8|i<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:n=!0,clearAlphaColor:s=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const u="rgba4444"===o,c=function(r,e){const t="rgb444"===e?4096:65536,o=new Array(t),n=r.length;if("rgba4444"===e)for(let t=0;t>24&255,a=s>>16&255,l=s>>8&255,s=255&s,u=P(s,l,a,i);let e=u in o?o[u]:o[u]=D();e.rc+=s,e.gc+=l,e.bc+=a,e.ac+=i,e.cnt++}else if("rgb444"===e)for(let t=0;t>16&255,h=c>>8&255,c=255&c,f=A(c,h,d);let e=f in o?o[f]:o[f]=D();e.rc+=c,e.gc+=h,e.bc+=d,e.cnt++}else for(let t=0;t>16&255,y=p>>8&255,p=255&p,g=O(p,y,m);let e=g in o?o[g]:o[g]=D();e.rc+=p,e.gc+=y,e.bc+=m,e.cnt++}return o}(e,o),d=c.length,h=d-1,f=new Uint32Array(d+1);for(var p=0,m=0;m>1,!(c[y=f[v]].err<=b));g=v)f[g]=y;f[g]=m}var j,_=p-t;for(m=0;m<_;){for(;;){var x=f[1];if((j=c[x]).tm>=j.mtm&&c[j.nn].mtm<=j.tm)break;j.mtm==h?x=f[1]=f[f[0]--]:(I(c,x,!1),j.tm=m);b=c[x].err;for(g=1;(v=g+g)<=f[0]&&(vc[f[v+1]].err&&v++,!(b<=c[y=f[v]].err));g=v)f[g]=y;f[g]=x}var w=c[j.nn],S=j.cnt,T=w.cnt,M=1/(S+T);u&&(j.ac=M*(S*j.ac+T*w.ac)),j.rc=M*(S*j.rc+T*w.rc),j.gc=M*(S*j.gc+T*w.gc),j.bc=M*(S*j.bc+T*w.bc),j.cnt+=w.cnt,j.mtm=++m,c[w.bk].fw=w.fw,c[w.fw].bk=w.bk,w.mtm=h}let E=[];for(m=0;;0){let e=L(Math.round(c[m].rc),0,255),t=L(Math.round(c[m].gc),0,255),r=L(Math.round(c[m].bc),0,255),o=255;u&&(o=L(Math.round(c[m].ac),0,255),a&&(k="number"==typeof a?a:127,o=o<=k?0:255),n&&o<=i&&(e=t=r=s,o=0));var k=u?[e,t,r,o]:[e,t,r];if(function(t,r){for(let e=0;efunction(r,o,e=5){if(r.length&&o.length){var n=r.map(e=>e.slice(0,3)),s=e*e,i=r[0].length;for(let t=0;ti?e.slice(0,3):e.slice();var a=d(n,e.slice(0,3),u),l=a[0],a=a[1];0>>0),0!=t&&(e=Math.max(e,256));const r=s;s=new Uint8Array(e),0>=8,c-=8;if((v>m||f)&&(f?(p=h,m=(1<>=8,c-=8;0>3}function P(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function A(e,t,r){return e>>4<<8|240&t|r>>4}function L(e,t,r){return e>8&255)}function C(e,t){for(var r=0;r>1,c=-7,d=r?n-1:0,h=r?-1:1,n=e[t+d];for(d+=h,s=n&(1<<-c)-1,n>>=-c,c+=a;0>=-c,c+=o;0>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:s-1,f=o?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+c?d/o:d*Math.pow(2,1-c))*o&&(i++,o/=2),u<=i+c?(a=0,i=u):1<=i+c?(a=(t*o-1)*Math.pow(2,n),i+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),i=0));8<=n;e[r+h]=255&a,h+=f,a/=256,n-=8);for(i=i<Math.abs(e[0])&&(t=1),t=Math.abs(e[2])>Math.abs(e[t])?2:t}function E(e,t){e.f+=t.f,e.b.f+=t.b.f}function h(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 k(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function C(e,t){m(e.a),e.c=!1,(e.a=t).i=e}function O(e){for(var t=e.a.a;(e=G(e)).a.a===t;);return e.c&&(C(e,t=S(B(e).a.b,e.a.e)),e=G(e)),e}function q(e,t,r){var o=new N;return o.a=r,o.e=p(e.f,t.e,o),r.i=o}function X(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],a[i[u]])?U:ue)(r,u),a[s]=null,l[s]=r.b,r.b=s}else for(r.c[-(s+1)]=null;0Math.max(i.a,l.a))){if(g(s,i)){if(0r.f&&(r.f*=2,r.c=ae(r.c,r.f+1)),0===r.b?n=o:(n=r.b,r.b=r.c[r.b]),r.e[n]=t,r.c[n]=o,r.d[o]=n,r.h&&ue(r,o),n):(r=e.a++,e.c[r]=t,-(r+1))}function se(e){if(0===e.a)return le(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(F(e.b),t))return le(e.b);for(;--e.a,0e.a||g(o[i],o[l])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function ue(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s>>1,l=r[a];if(0==a||g(o[l],o[i])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function N(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function B(e){return e.e.c.b}function G(e){return e.e.a.b}(t=r.prototype).x=function(){I(this,0)},t.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 l(this,100900)}l(this,100901)},t.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:l(this,100900)}return!1},t.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},t.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:l(this,100900)}},t.C=function(e,t){var r=!1,o=[0,0,0];I(this,2);for(var n=0;n<3;++n){var s=e[n];s<-1e150&&(s=-1e150,r=!0),1e150o[u]&&(o[u]=c,n[u]=r)}if(o[1]-a[1]>o[r=0]-a[0]&&(r=1),a[r=o[2]-a[2]>o[r]-a[r]?2:r]>=o[r])i[0]=0,i[1]=0,i[2]=1;else{for(a=l[r],n=n[r],l=[o=0,0,0],a=[a.g[0]-n.g[0],a.g[1]-n.g[1],a.g[2]-n.g[2]],u=[0,0,0],r=s.e;r!==s;r=r.e)u[0]=r.g[0]-n.g[0],u[1]=r.g[1]-n.g[1],u[2]=r.g[2]-n.g[2],l[0]=a[1]*u[2]-a[2]*u[1],l[1]=a[2]*u[0]-a[0]*u[2],l[2]=a[0]*u[1]-a[1]*u[0],o<(c=l[0]*l[0]+l[1]*l[1]+l[2]*l[2])&&(o=c,i[0]=l[0],i[1]=l[1],i[2]=l[2]);o<=0&&(i[0]=i[1]=i[2]=0,i[W(a)]=1)}s=!0}for(l=W(i),r=this.b.c,o=(l+1)%3,n=(l+2)%3,l=0>=1;)++n;if(i=1<>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|n,g[v++]=s,g[v++]=0,null!==b)for(var a=0,l=b.length;a>16&255,g[v++]=u>>8&255,g[v++]=255&u}if(null!==o){if(o<0||65535>8&255,g[v++]=0}var _=!1;this.addFrame=function(e,t,r,o,n,s){if(!0===_&&(--v,_=!1),s=void 0===s?{}:s,e<0||t<0||65535>=1;)++u;var l=1<>8&255,g[v++]=f,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&o,g[v++]=o>>8&255,g[v++]=!0===i?128|u-1:0,!0===i)for(var p=0,m=a.length;p>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,o){t[r++]=e;var n=r++,s=1<>=8,c-=8,r===n+256&&(t[n]=255,n=r++)}function f(e){d|=e<>=8,c-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(f(s),l=1+a,u=e+1,m={}):(1<>=l,c-=l,y==s)a=1+i,u=(1<<(l=n+1))-1,m=null;else{if(y==i)break;for(var g=y>8,++v;var j=b;if(o>=8;null!==m&&a<4096&&(p[a++]=m<<8|j,u+1<=a&&l<12&&(++l,u=u<<1|1)),m=y}}h!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=o,r.GifReader=function(b){var e=0;if(71!==b[e++]||73!==b[e++]||70!==b[e++]||56!==b[e++]||56!=(b[e++]+1&253)||97!==b[e++])throw new Error("Invalid GIF 87a/89a header.");var j=b[e++]|b[e++]<<8,t=b[e++]|b[e++]<<8,r=b[e++],o=1<<1+(7&r),n=(b[e++],b[e++],null),s=null,i=(r>>7&&(n=e,e+=3*(s=o)),!0),a=[],l=0,u=null,c=0,d=null;for(this.width=j,this.height=t;i&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}break;default:throw new Error("Unknown graphic control label: 0x"+b[e-1].toString(16))}break;case 44:var f,p=b[e++]|b[e++]<<8,m=b[e++]|b[e++]<<8,y=b[e++]|b[e++]<<8,g=b[e++]|b[e++]<<8,v=b[e++],_=v>>6&1,x=1<<1+(7&v),w=n,S=s,T=!1,v=(v>>7&&(T=!0,w=e,e+=3*(S=x)),e);for(e++;;){if(!(0<=(f=b[e++])))throw Error("Invalid block size");if(0===f)break;e+=f}a.push({x:p,y:m,width:y,height:g,has_local_palette:T,palette_offset:w,palette_size:S,data_offset:v,data_length:e-v,transparent_index:u,interlaced:!!_,delay:l,disposal:c});break;case 59:i=!1;break;default:throw new Error("Unknown gif block: 0x"+b[e-1].toString(16))}this.numFrames=function(){return a.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=a.length)throw new Error("Frame index out of range.");return a[e]},this.decodeAndBlitFrameBGRA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(M(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=v,t[d++]=g,t[d++]=y,t[d++]=255),--l}},this.decodeAndBlitFrameRGBA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(M(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,h=4*a,f=(!0===e.interlaced&&(h+=4*j*7),8),p=0,m=o.length;p>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=y,t[d++]=g,t[d++]=v,t[d++]=255),--l}}}}catch(e){}},{}],249:[function(Ar,r,o){!function(Pr){var e,t;e=this,t=function(j){"use strict";function D(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length,e=e?Number(e):0;if(!((e=e!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function $(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,r+=t.table[++n],0<=(o-=t.table[n]););return e.tag=s,e.bitcount-=n,t.trans[r+o]}function ee(e,t,r){for(;;){var o=$(e,t);if(256===o)return U;if(o<256)e.dest[e.destLen++]=o;else for(var n,s=b(e,H[o-=257],W[o]),o=$(e,r),i=n=e.destLen-b(e,q[o],X[o]);i>>=1,o=n,b(s,2,0)){case 0:r=function(e){for(var t,r;8this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,r,o,n,s,i,a){var l=[e,t],u=[r,o],c=[n,s],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var h=0;h<=1;h++){var f,p=6*l[h]-12*u[h]+6*c[h],m=-3*l[h]+9*u[h]-9*c[h]+3*d[h],y=3*u[h]-3*l[h];0==m?0==p||0<(f=-y/p)&&f<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],f)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],f))):(f=Math.pow(p,2)-4*y*m)<0||(0<(y=(-p+Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))),0<(y=(-p-Math.sqrt(f))/(2*m))&&y<1&&(0===h&&this.addX(g(l[h],u[h],c[h],d[h],y)),1===h&&this.addY(g(l[h],u[h],c[h],d[h],y))))}},a.prototype.addQuad=function(e,t,r,o,n,s){r=e+2/3*(r-e),o=t+2/3*(o-t);this.addBezier(e,t,r,o,r+1/3*(n-e),o+1/3*(s-t),n,s)},h.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},h.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},h.prototype.curveTo=h.prototype.bezierCurveTo=function(e,t,r,o,n,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:n,y:s})},h.prototype.quadTo=h.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},h.prototype.close=h.prototype.closePath=function(){this.commands.push({type:"Z"})},h.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof a)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},h.prototype.getBoundingBox=function(){for(var e=new a,t=0,r=0,o=0,n=0,s=0;s>8&255,255&e]},l.USHORT=r(2),w.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},l.SHORT=r(2),w.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},l.UINT24=r(3),w.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.ULONG=r(4),w.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},l.LONG=r(4),w.FIXED=w.ULONG,l.FIXED=l.ULONG,w.FWORD=w.SHORT,l.FWORD=l.SHORT,w.UFWORD=w.USHORT,l.UFWORD=l.USHORT,w.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},l.LONGDATETIME=r(8),w.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)]},l.TAG=r(4),w.Card8=w.BYTE,l.Card8=l.BYTE,w.Card16=w.USHORT,l.Card16=l.USHORT,w.OffSize=w.BYTE,l.OffSize=l.BYTE,w.SID=w.USHORT,l.SID=l.USHORT,w.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?w.NUMBER16(e):w.NUMBER32(e)},l.NUMBER=function(e){return w.NUMBER(e).length},w.NUMBER16=function(e){return[28,e>>8&255,255&e]},l.NUMBER16=r(3),w.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},l.NUMBER32=r(5),w.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),n=0,s=t.length;n>8&255,t[t.length]=255&o}return t},l.UTF16=function(e){return 2*e.length};var se,ie={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(m.MACSTRING=function(e,t,r,o){var n=ie[o];if(void 0!==n){for(var s="",i=0;i>8&255,l+256&255)}return s})(e,t,r);return r},w.INDEX=function(e){for(var t=1,r=[t],o=[],n=0;n>8,t[c+1]=255&d,t=t.concat(o[u])}return t},l.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o>1,a.skip("uShort",3),y.glyphIndexMap={};for(var j,_=new R.Parser(g,v+b+14),x=new R.Parser(g,v+b+16+2*j),w=new R.Parser(g,v+b+16+4*j),S=new R.Parser(g,v+b+16+6*j),T=v+b+16+8*j,M=0;M>4,s=15&s;if(15==i)break;if(o+=n[i],15==s)break;o+=n[s]}return parseFloat(o)}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 Ie(e,t,r){var o=new R.Parser(e,t=void 0!==t?t:0),n=[],s=[];for(r=void 0!==r?r:e.length;o.relativeOffset>1,M.length=0,k=!0}return function e(t){for(var r,o,n,s,i,a,l,u,c,d,h,f,p=0;pMath.abs(f-P)?O=h+M.shift():P=f+M.shift(),T.curveTo(v,b,j,_,l,u),T.curveTo(c,d,h,f,O,P);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+m),M.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:i=M.pop()+y.gsubrsBias,(a=y.gsubrs[i])&&e(a);break;case 30:for(;0=r.begin&&e=c.length&&(s=o.parseChar(),r.names.push(o.parseString(s)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;at.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(n),t}function xt(e,t,r){for(var o=0;o 123 are reserved for internal usage");f|=1<>>1,s=e[n].tag;if(s===t)return n;s>>1,s=e[n];if(s===t)return n;s>>1,i=(n=e[s]).start;if(i===t)return n;i(n=e[r-1]).end?0:n}function Et(e,t){this.font=e,this.tableName=t}function kt(e){Et.call(this,e,"gpos")}function i(e){Et.call(this,e,"gsub")}function Ct(e,t,r){for(var o=e.subtables,n=0;nt.points.length-1||o.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=n.points[o.matchedPoints[1]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0},a=Lt([a],o)[0];o.dx=i.x-a.x,o.dy=i.y-a.y,s=Lt(n.points,o)}t.points=t.points.concat(s)}}return Rt(t.points)}(kt.prototype=Et.prototype={searchTag:St,binSearch:Tt,getTable:function(e){var t=this.font.tables[this.tableName];return t=!t&&e?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=i[t-1].tag,"Features must be added in alphabetical order."),i.push(n={tag:r,feature:{params:0,lookupListIndexes:[]}}),s.push(t),n.feature}},getLookupTables:function(e,t,r,o,n){var e=this.getFeatureTable(e,t,r,n),s=[];if(e){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u",s),t.stack.push(Math.round(64*s))}function hr(e,t){var r=t.stack,o=r.pop(),n=t.fv,s=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;j.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,r);for(var c=0;c>4)===i&&(0<=(h=(15&h)-8)&&h++,j.DEBUG&&console.log(t.step,"DELTAPFIX",d,"by",h*l),d=u[d],n.setRelative(d,d,h*l,s))}}function fr(e,t){var r=t.stack,o=r.pop();j.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(o/64))}function pr(e,t){var r=t.stack,o=r.pop(),n=t.ppem,s=t.deltaBase+16*(e-1),i=t.deltaShift;j.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,r);for(var a=0;a>4)===n&&(0<=(u=(15&u)-8)&&u++,u=u*i,j.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",u),t.cvt[l]+=u)}}function mr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.dpv=qt(r,n)}function k(e,t){var r=t.stack,o=t.prog,n=t.ip;j.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var s=0;s":"_")+(o?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+a+")":"",l,"(d =",i,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",o),a.interpolate(d,s,i,l),a.touch(d)}e.loop=1},lr.bind(void 0,0),lr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,o=e.z0[r],n=e.loop,s=e.fv,i=e.pv,a=e.z1;n--;){var l=t.pop(),u=a[l];j.DEBUG&&console.log(e.step,(1'.concat(n,"").concat(t,""),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},s.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+i))?this.dummyDOM.querySelector("#"+o+l).insertAdjacentHTML("beforebegin",'

                                      ')):(r='

                                      '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(a)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+u))?this.dummyDOM.querySelector("#".concat(o+d))&&this.dummyDOM.querySelector("#".concat(o+d)).insertAdjacentHTML("beforebegin",'

                                      ')):(r='

                                      '),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+c),this.descriptions.label.innerHTML=t)},s.default.prototype._describeElementHTML=function(e,t,r){var o,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+l)||this.dummyDOM.querySelector("#"+n+a).insertAdjacentHTML("afterend",'
                                      Canvas elements and their descriptions
                                      ')):(o='
                                      Canvas elements and their descriptions
                                      '),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).innerHTML=o),(o=document.createElement("tr")).id=n+"_fte_"+t,this.dummyDOM.querySelector("#"+n+l).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+u))?this.dummyDOM.querySelector("#".concat(n+d))||this.dummyDOM.querySelector("#"+n+c).insertAdjacentHTML("afterend",'
                                      ')):(o='
                                      '),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=n+"_lte_"+t,this.dummyDOM.querySelector("#"+n+d).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)};e=s.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.ends-with":190,"core-js/modules/es.string.replace":196}],256:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.map"),e("core-js/modules/es.string.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateGridOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]);t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1]);return t}((r=function(e,t){var r,o="",n="",s=0;for(r in t){var i,a=0;for(i in t[r]){var l='
                                    • ').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="
                                    • "),o+=l,a++,s++}n=1').concat(t[r][a].color," ").concat(r,"
                                      "):'').concat(t[r][a].color," ").concat(r," midpoint"),i[t[r][a].loc.locY][t[r][a].loc.locX]?i[t[r][a].loc.locY][t[r][a].loc.locX]=i[t[r][a].loc.locY][t[r][a].loc.locX]+" "+l:i[t[r][a].loc.locY][t[r][a].loc.locX]=l,n++}for(o in i){var u,c="";for(u in i[o])c+="",void 0!==i[o][u]&&(c+=i[o][u]),c+="";s=s+c+""}return s}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.from":158,"core-js/modules/es.array.map":164,"core-js/modules/es.string.iterator":192}],257:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function l(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t
                                      ')):this.dummyDOM.querySelector("#".concat(s)).innerHTML='
                                      '))):"Label"===t&&(r=s+e+(i=t),this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(s,"_Label"))?this.dummyDOM.querySelector("#".concat(s,"_Label")):this.dummyDOM.querySelector("#".concat(s))).insertAdjacentHTML("afterend",'
                                      '))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(s,"gridOutput").concat(i),n='
                                      Text Output

                                        '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(s,"textOutput").concat(i),n='
                                        Grid Output

                                          '),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,n={},s=!0,i=function(e,t){var r;e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,e]}(e,t);if("line"===e?(n.color=this.ingredients.colors.stroke,n.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=this._getPos(t[0],[1]),o=this._getPos(t[2],[3]),n.loc=u(i,this.width,this.height),n.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?n.color=this.ingredients.colors.stroke:(n.color=this.ingredients.colors.fill,n.area=this._getArea(e,t)),n.pos=this._getPos.apply(this,l(i)),n.loc=u(i,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[n]){for(var a in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][a])===JSON.stringify(n)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(n)}}else this.ingredients.shapes[e]=[n]},o.default.prototype._getPos=function(e,t){var e=new DOMPointReadOnly(e,t),t=this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform(),e=e.matrixTransform(t),t=e.x,e=e.y,r=this.width,o=this.height;return t<.4*r?e<.4*o?"top left":.6*oMath.PI?n+=o:n-=o)):"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2),this.width*this._pixelDensity),i=this.height*this._pixelDensity,a=[new DOMPoint(0,0),new DOMPoint(s,0),new DOMPoint(s,i),new DOMPoint(0,i)],l=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),u=a.map(function(e){return e.matrixTransform(l)}),c=Math.abs((u[3].x+u[0].x)*(u[3].y-u[0].y)+(u[0].x+u[1].x)*(u[0].y-u[1].y)+(u[1].x+u[2].x)*(u[1].y-u[2].y)+(u[2].x+u[3].x)*(u[2].y-u[3].y))/2;return Math.round(100*n/c)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.from":158,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.number.to-fixed":175,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/web.dom-collections.iterator":238}],258:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateTextOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following");r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:");return r}((r=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='
                                        • ').concat(t[r][s].color," ").concat(r,"");"line"===r?i+=", ".concat(t[r][s].pos,", ").concat(t[r][s].length," pixels long.
                                        • "):(i+=", at ".concat(t[r][s].pos),"point"!==r&&(i+=", covering ".concat(t[r][s].area,"% of the canvas")),i+="."),o+=i,n++}return{numShapes:n,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='').concat(t[r][s].color," ").concat(r,"");"line"===r?i+="location = ".concat(t[r][s].pos,"length = ").concat(t[r][s].length," pixels"):(i+="location = ".concat(t[r][s].pos,""),"point"!==r&&(i+=" area = ".concat(t[r][s].area,"%")),i+=""),o+=i,n++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.concat":151}],259:[function(e,t,r){"use strict";var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.DataArray"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Framebuffer"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":254,"./accessibility/describe":255,"./accessibility/gridOutput":256,"./accessibility/outputs":257,"./accessibility/textOutput":258,"./color/color_conversion":260,"./color/creating_reading":261,"./color/p5.Color":262,"./color/setting":263,"./core/constants":264,"./core/environment":265,"./core/friendly_errors/fes_core":266,"./core/friendly_errors/file_errors":267,"./core/friendly_errors/sketch_reader":268,"./core/friendly_errors/stacktrace":269,"./core/friendly_errors/validate_params":270,"./core/helpers":271,"./core/init":272,"./core/legacy":274,"./core/main":275,"./core/p5.Element":276,"./core/p5.Graphics":277,"./core/p5.Renderer":278,"./core/p5.Renderer2D":279,"./core/preload":280,"./core/rendering":281,"./core/shape/2d_primitives":282,"./core/shape/attributes":283,"./core/shape/curves":284,"./core/shape/vertex":285,"./core/shim":286,"./core/structure":287,"./core/transform":288,"./data/local_storage.js":289,"./data/p5.TypedDict":290,"./dom/dom":291,"./events/acceleration":292,"./events/keyboard":293,"./events/mouse":294,"./events/touch":295,"./image/filters":296,"./image/image":297,"./image/loading_displaying":298,"./image/p5.Image":299,"./image/pixels":300,"./io/files":301,"./io/p5.Table":302,"./io/p5.TableRow":303,"./io/p5.XML":304,"./math/calculation":305,"./math/math":306,"./math/noise":307,"./math/p5.Vector":308,"./math/random":309,"./math/trigonometry":310,"./typography/attributes":311,"./typography/loading_displaying":312,"./typography/p5.Font":313,"./utilities/array_functions":314,"./utilities/conversion":315,"./utilities/string_functions":316,"./utilities/time_date":317,"./webgl/3d_primitives":318,"./webgl/interaction":320,"./webgl/light":321,"./webgl/loading":322,"./webgl/material":323,"./webgl/p5.Camera":324,"./webgl/p5.DataArray":325,"./webgl/p5.Framebuffer":326,"./webgl/p5.Geometry":327,"./webgl/p5.Matrix":328,"./webgl/p5.RenderBuffer":329,"./webgl/p5.RendererGL":332,"./webgl/p5.RendererGL.Immediate":330,"./webgl/p5.RendererGL.Retained":331,"./webgl/p5.Shader":333,"./webgl/p5.Texture":334,"./webgl/text":335}],260:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.ColorConversion={_hsbaToHSLA:function(e){var t=e[0],r=e[1],o=e[2],n=(2-r)*o/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*o/(2-2*n)),[t,r,n,e[3]]},_hsbaToRGBA:function(e){var t,r,o,n,s,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(n=o,s=l,r):2===t?(n=r,s=l,a):3===t?(n=r,s=o,l):4===t?(n=a,s=r,l):5===t?(n=l,s=r,o):(n=l,s=a,r),[n,s,i,e[3]])},_hslaToHSBA:function(e){var t=e[0],r=e[1],o=e[2],n=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(n-o)/n,n,e[3]]},_hslaToRGBA:function(e){var t,r=6*e[0],o=e[1],n=e[2];return 0===o?[n,n,n,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*n-(n=n<.5?(1+o)*n:n+o-n*o),n),t(r,o,n),t(r-2,o,n),e[3]]},_rgbaToHSBA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=i-Math.min(o,n,s);return 0==a?r=t=0:(r=a/i,o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},_rgbaToHSLA:function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=Math.min(o,n,s),l=i+a,a=i-a;return 0==a?r=t=0:(r=l<1?a/l:a/(2-l),o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]}};e=e.default.ColorConversion;r.default=e},{"../core/main":275}],261:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.alpha=function(e){return l.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},l.default.prototype.blue=function(e){return l.default._validateParameters("blue",arguments),this.color(e)._getBlue()},l.default.prototype.brightness=function(e){return l.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},l.default.prototype.color=function(){var e;return l.default._validateParameters("color",arguments),arguments[0]instanceof l.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new l.default.Color(this,e))},l.default.prototype.green=function(e){return l.default._validateParameters("green",arguments),this.color(e)._getGreen()},l.default.prototype.hue=function(e){return l.default._validateParameters("hue",arguments),this.color(e)._getHue()},l.default.prototype.lerpColor=function(e,t,r){l.default._validateParameters("lerpColor",arguments);var o,n,s,i=this._colorMode,a=this._colorMaxes;if(i===u.RGB)n=e.levels.map(function(e){return e/255}),s=t.levels.map(function(e){return e/255});else if(i===u.HSB)e._getBrightness(),t._getBrightness(),n=e.hsba,s=t.hsba;else{if(i!==u.HSL)throw new Error("".concat(i,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),n=e.hsla,s=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(n[0],s[0],r),t=this.lerp(n[1],s[1],r),o=this.lerp(n[2],s[2],r),n=this.lerp(n[3],s[3],r),e*=a[i][0],t*=a[i][1],o*=a[i][2],n*=a[i][3],this.color(e,t,o,n)},l.default.prototype.lightness=function(e){return l.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},l.default.prototype.red=function(e){return l.default._validateParameters("red",arguments),this.color(e)._getRed()},l.default.prototype.saturation=function(e){return l.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=l.default;r.default=n},{"../core/constants":264,"../core/friendly_errors/fes_core":266,"../core/friendly_errors/file_errors":267,"../core/friendly_errors/validate_params":270,"../core/main":275,"./p5.Color":262,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.map":164,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],262:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(e("../core/main")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),h=s(e("./color_conversion"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r"].indexOf(r[0])?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(o)},this).map(function(e){var t,r;return-1===(e=-1 eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[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"),o=[],n=2,s=r.length;n/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}},this)}}}e.default._getErrorStackParser=function(){return new o};e=e.default;r.default=e},{"../main":275,"core-js/modules/es.array.filter":155,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.join":162,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.match":193,"core-js/modules/es.string.replace":196,"core-js/modules/es.string.split":198}],270:[function(e,t,r){"use strict";function o(e){return(o="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)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==a(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o)})(e("../constants")),e("../internationalization");function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};e=n.default;r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":264,"../internationalization":273,"../main":275,"core-js/modules/es.array.concat":151,"core-js/modules/es.array.for-each":157,"core-js/modules/es.array.includes":159,"core-js/modules/es.array.index-of":160,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.join":162,"core-js/modules/es.array.last-index-of":163,"core-js/modules/es.array.map":164,"core-js/modules/es.array.slice":165,"core-js/modules/es.function.name":168,"core-js/modules/es.map":169,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.get-prototype-of":180,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.reflect.construct":184,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.set":189,"core-js/modules/es.string.includes":191,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.for-each":237,"core-js/modules/web.dom-collections.iterator":238}],271:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,n){return n===s.CORNER?{x:e,y:t,w:r,h:o}:n===s.CORNERS?{x:e,y:t,w:r-e,h:o-t}:n===s.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:n===s.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":264,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],272:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var n=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),n]).then(function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default})},{"../core/main":275,"./internationalization":273,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.to-string":182,"core-js/modules/es.promise":183,"core-js/modules/es.string.iterator":192,"core-js/modules/web.dom-collections.iterator":238}],273:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,s,o=a(e("i18next")),i=a(e("i18next-browser-languagedetector"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r*s,o*s);return n.pixelDensity(s),n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r*s,o*s),n}},{key:"textLeading",value:function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading}},{key:"textStyle",value:function(e){return e?(e!==P.NORMAL&&e!==P.ITALIC&&e!==P.BOLD&&e!==P.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle}},{key:"textAscent",value:function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent}},{key:"textDescent",value:function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent}},{key:"textAlign",value: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}}},{key:"textWrap",value:function(e){return this._setProperty("_textWrap",e),this._textWrap}},{key:"text",value:function(e,t,r,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,h=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===P.CENTER&&(t-=o/2),this._textAlign){case P.CENTER:t+=o/2;break;case P.RIGHT:t+=o}if(void 0!==n){this._rectMode===P.CENTER&&(r-=n/2,h-=n/2);var e=r,f=u.textAscent();switch(this._textBaseline){case P.BOTTOM:l=r+n,r=Math.max(l,r),h+=f;break;case P.CENTER:l=r+n/2,r=Math.max(l,r),h+=f/2}d=r+n-f,this._textBaseline===P.CENTER&&(d=e+n-f/2)}else this._textBaseline!==P.BOTTOM&&this._textBaseline!==P.CENTER||(h=r-(e=u.textSize()*this._textLeading)/2,d=r+e/2);if(c===P.WORD){for(var p=[],m=0;ma.HALF_PI&&e<=3*a.HALF_PI?Math.atan(r/o*Math.tan(e))+a.PI:Math.atan(r/o*Math.tan(e))+a.TWO_PI,t=t<=a.HALF_PI?Math.atan(r/o*Math.tan(t)):t>a.HALF_PI&&t<=3*a.HALF_PI?Math.atan(r/o*Math.tan(t))+a.PI:Math.atan(r/o*Math.tan(t))+a.TWO_PI),tp||Math.abs(this.accelerationY-this.pAccelerationY)>p||Math.abs(this.accelerationZ-this.pAccelerationZ)>p)&&s.deviceMoved(),"function"==typeof s.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},_toImageData:function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},_createImageData:function(e,t){return V._tmpCanvas=document.createElement("canvas"),V._tmpCtx=V._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},apply:function(e,t,r){var o=e.getContext("2d"),n=o.getImageData(0,0,e.width,e.height),t=t(n,r);t instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(n,0,0,0,0,e.width,e.height)},threshold:function(e,t){for(var r=V._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),n=0;n>8)/o,r[n+1]=255*(i*t>>8)/o,r[n+2]=255*(a*t>>8)/o}},dilate:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(n>>8&255)+28*(255&n))<(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=s,n=l),n<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,n=u),f[d++]=o;V._setPixels(c,f)},erode:function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,h=c.length?c.length/4:0,f=new Int32Array(h);d>16&255)+151*(u>>8&255)+28*(255&u))<(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=u,n=a),(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(s>>8&255)+28*(255&s))>16&255)+151*(i>>8&255)+28*(255&i))>>24],r+=j[(16711680&I)>>16],o+=j[(65280&I)>>8],n+=j[255&I],t+=B[b],i++}T[a=k+g]=s/t,M[a]=r/t,E[a]=o/t,F[a]=n/t}k+=h}for(u=(l=-U)*h,v=k=0;v"+p.length.toString()+" out of "+c.toString()),e.next=48,new Promise(function(e){return setTimeout(e,0)});e.next=50;break;case 48:e.next=39;break;case 50:i||m.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(f),v=(0,P.GIFEncoder)(),b=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r"+S.toString()+" out of "+c.toString()),e.next=68,new Promise(function(e){return setTimeout(e,0)});case 68:S++,e.next=60;break;case 71:v.finish(),k=v.bytesView(),k=new Blob([k],{type:"image/gif"}),p=[],this._recording=!1,this.loop(),i||(m.html("Done. Downloading your gif!🌸"),0=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))}},{key:"_setProperty",value:function(e,t){this[e]=t,this.setModified(!0)}},{key:"loadPixels",value:function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)}},{key:"updatePixels",value:function(e,t,r,o){s.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o),this.setModified(!0)}},{key:"get",value:function(e,t,r,o){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)}},{key:"_getPixel",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(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"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==s[0]){n.print(" ");for(var c=0;c".concat(d)),n.print(" ")}n.print(" ")}for(var h=0;h");for(var f=0;f".concat(p)),n.print(" ")}n.print(" ")}n.print("
                                          "),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream",e=(v.default.prototype._isSafari()&&(o="text/plain"),new Blob(e,{type:o}));v.default.prototype.downloadFile(e,t,r)},v.default.prototype.downloadFile=function(e,t,r){var o,t=i(t,r),r=t[0];e instanceof Blob?n.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},v.default.prototype._checkFileExtension=i,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%o)/o}};n.setSeed(e),j=new Array(4096);for(var s=0;s<4096;s++)j[s]=n.rand()},e.default);r.default=e},{"../core/main":275}],308:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("../core/main"))&&n.__esModule?n:{default:n},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function u(e,t){for(var r=0;r>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(tf&&(b=d,v=a,s=l,d=x+f*(i&&x=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)};e=o.default;r.default=e},{"../core/main":275,"core-js/modules/es.array.map":164,"core-js/modules/es.number.constructor":173,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.to-string":188,"core-js/modules/es.string.repeat":195}],316:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.pad-start"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(u=e("../core/main"))&&u.__esModule?u:{default:u};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t,r){var o=i(e.toString().split("."),2),n=o[0],o=o[1];return void 0===r?(n=n.padStart(t,"0"),o?n+"."+o:n):(n=(e=i(e.toFixed(r).toString().split("."),2))[0],o=e[1],n=n.padStart(t,"0"),void 0===o?n:n+"."+o)}function n(e,t){var r=(e=e.toString()).indexOf("."),o=-1!==r?e.substring(r):"",e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(0===t)o="";else if(void 0!==t)if(t>o.length)for(var n=t-(o+=-1===r?".":"").length+1,s=0;s=_.TWO_PI?"".concat(c="ellipse","|"):"".concat(c="arc","|").concat(s,"|").concat(i,"|").concat(a,"|")).concat(l,"|"),c=(this.geometryInHash(u)||((t=new S.default.Geometry(l,1,function(){if(s.toFixed(10)!==i.toFixed(10)){a!==_.PIE&&void 0!==a||(this.vertices.push(new S.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=l;e++){var t=(i-s)*(e/l)+s,r=.5+Math.cos(t)/2,t=.5+Math.sin(t)/2;this.vertices.push(new S.default.Vector(r,t,0)),this.uvs.push([r,t]),e>5&31)/31,(p>>10&31)/31):(r=i,o=a,l)),new x.default.Vector(y,g,v)),j=1;j<=3;j++){var _=m+12*j,_=new x.default.Vector(u.getFloat32(_,!0),u.getFloat32(4+_,!0),u.getFloat32(8+_,!0));e.vertices.push(_),e.vertexNormals.push(b),d&&s.push(r,o,n)}e.faces.push([3*f,3*f+1,3*f+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{t=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");t=new TextDecoder("utf-8").decode(t).split("\n");!function(e,t){for(var r,o,n="",s=[],i=0;ithis.cameraFar&&(i=this.cameraFar),Math.acos(Math.max(-1,Math.min(1,_.default.Vector.dot(o,n))))+t),t=e;(r<=0||r>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),n.mult(Math.cos(r)),a.mult(Math.cos(t)*Math.sin(r)),s.mult(Math.sin(t)*Math.sin(r)),o.set(n).add(a).add(s),this.eyeX=i*o.x+this.centerX,this.eyeY=i*o.y+this.centerY,this.eyeZ=i*o.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.hypot(o,n,s),o=new _.default.Vector(o,n,s).normalize(),n=new _.default.Vector(this.upX,this.upY,this.upZ),s=new _.default.Vector.cross(n,o).normalize(),a=new _.default.Vector.cross(o,s),l=Math.atan2(t,e),l=(a.mult(Math.sin(l)),s.mult(Math.cos(l)).add(a),Math.sqrt(e*e+t*t)),a=new _.default.Vector.cross(o,s),e=((i=(i*=Math.pow(10,r))this.cameraFar&&(i=this.cameraFar),Math.cos(l)),t=Math.sin(l),r=n.dot(o),l=n.dot(s),u=r*e+l*t,r=-r*t+l*e,l=n.dot(a);n.x=u*o.x+r*s.x+l*a.x,n.y=u*o.y+r*s.y+l*a.y,n.z=u*o.z+r*s.z+l*a.z,s.mult(-t),o.mult(e).add(s).mult(i),this.camera(o.x+this.centerX,o.y+this.centerY,o.z+this.centerZ,this.centerX,this.centerY,this.centerZ,n.x,n.y,n.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&n(e.prototype,r),o&&n(e,o),t}(),_.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};e=_.default.Camera;r.default=e},{"../core/main":275,"core-js/modules/es.array.slice":165,"core-js/modules/es.math.hypot":170,"core-js/modules/es.string.sub":200}],325:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t){for(var r=0;r=this.width||t>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1)),(0,p.readPixelWebGL)(this.gl,this.framebuffer,e*this.density,t*this.density,n.format,n.type);e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1),r=this.target.constrain(r,1,this.width-e),o=this.target.constrain(o,1,this.height-t);for(var s=(0,p.readPixelsWebGL)(void 0,this.gl,this.framebuffer,e*this.density,t*this.density,r*this.density,o*this.density,n.format,n.type),i=new Uint8ClampedArray(r*o*this.density*this.density*4),a=(i.fill(255),n.type===this.gl.RGB?3:4),l=0;lthis.vertices.length-1-this.detailX;o--)e.add(this.vertexNormals[o]);e=m.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this}},{key:"_makeTriangleEdges",value:function(){for(var e=this.edges.length=0;e 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},a.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),this._applyColorBlend(this.curStrokeColor),r.drawArrays(r.Points,0,e.length),o.unbindShader()};var s=a.default.RendererGL;r.default=s},{"../core/constants":264,"../core/main":275,"./p5.RenderBuffer":329,"./p5.RendererGL":332,"core-js/modules/es.array.fill":154,"core-js/modules/es.array.iterator":161,"core-js/modules/es.array.some":166,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.keys":181,"core-js/modules/es.object.to-string":182,"core-js/modules/es.string.iterator":192,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.typed-array.copy-within":205,"core-js/modules/es.typed-array.every":206,"core-js/modules/es.typed-array.fill":207,"core-js/modules/es.typed-array.filter":208,"core-js/modules/es.typed-array.find":210,"core-js/modules/es.typed-array.find-index":209,"core-js/modules/es.typed-array.float32-array":211,"core-js/modules/es.typed-array.for-each":213,"core-js/modules/es.typed-array.includes":214,"core-js/modules/es.typed-array.index-of":215,"core-js/modules/es.typed-array.iterator":218,"core-js/modules/es.typed-array.join":219,"core-js/modules/es.typed-array.last-index-of":220,"core-js/modules/es.typed-array.map":221,"core-js/modules/es.typed-array.reduce":223,"core-js/modules/es.typed-array.reduce-right":222,"core-js/modules/es.typed-array.reverse":224,"core-js/modules/es.typed-array.set":225,"core-js/modules/es.typed-array.slice":226,"core-js/modules/es.typed-array.some":227,"core-js/modules/es.typed-array.sort":228,"core-js/modules/es.typed-array.subarray":229,"core-js/modules/es.typed-array.to-locale-string":230,"core-js/modules/es.typed-array.to-string":231,"core-js/modules/es.typed-array.uint16-array":232,"core-js/modules/es.typed-array.uint32-array":233,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}],332:[function(e,t,r){"use strict";function o(e){return(o="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)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.map"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.readPixelsWebGL=k,r.readPixelWebGL=C,r.default=void 0;var g=n(e("../core/main")),l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),a=n(e("./GeometryBuilder")),u=n(e("libtess")),c=(e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("./p5.Framebuffer"),e("path"),e("./p5.Texture"));function d(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,d=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n OUT_COLOR *= saturate(max(antialias, cover));\n}\n",lineVert:T+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec4 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n float facingCamera = pow(\n // The word space tangent's z value is 0 if it's facing the camera\n abs(normalize(posqIn-posp).z),\n\n // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n // so most lines get scaled and don't get clipped\n 0.25\n );\n\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n float scale = mix(1., 0.995, facingCamera);\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n // Multiplying again by its sign here negates the flip to get just the scale.\n curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.),\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.),\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset;\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:T+"precision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n OUT_COLOR = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"IN vec3 aPosition;\nuniform float uPointSize;\nOUT float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}\n",pointFrag:"precision mediump int;\nuniform vec4 uMaterialColor;\nIN float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n",imageLightVert:"precision highp float;\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\n\nvarying vec3 localPos;\nvarying vec3 vWorldNormal;\nvarying vec3 vWorldPosition;\nvarying vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n // Multiply the position by the matrix.\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition; \n \n // orient the normals and pass to the fragment shader\n vWorldNormal = uNormalMatrix * aNormal;\n \n // send the view position to the fragment shader\n vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n \n localPos = vWorldPosition;\n vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n",imageLightDiffusedFrag:"precision highp float;\nvarying vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nvarying vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n // x = r sin(phi) cos(theta) \n // y = r cos(phi) \n // z = r sin(phi) sin(theta)\n float phi = acos( v.y );\n // if phi is 0, then there are no x, z components\n float theta = 0.0;\n // else \n theta = acos(v.x / sin(phi));\n float sinTheta = v.z / sin(phi);\n if (sinTheta < 0.0) {\n // Turn it into -theta, but in the 0-2PI range\n theta = 2.0 * PI - theta;\n }\n theta = theta / (2.0 * 3.14159);\n phi = phi / 3.14159 ;\n \n vec2 angles = vec2( phi, theta );\n return angles;\n}\n\nvoid main()\n{ \t \n\t// the sample direction equals the hemisphere's orientation\n float phi = vTexCoord.x * 2.0 * PI;\n float theta = vTexCoord.y * PI;\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 normal = vec3( x, y, z);\n\n\t// Discretely sampling the hemisphere given the integral's\n // spherical coordinates translates to the following fragment code:\n\tvec3 irradiance = vec3(0.0); \n\tvec3 up\t= vec3(0.0, 1.0, 0.0);\n\tvec3 right = normalize(cross(up, normal));\n\tup = normalize(cross(normal, right));\n\n\t// We specify a fixed sampleDelta delta value to traverse\n // the hemisphere; decreasing or increasing the sample delta\n // will increase or decrease the accuracy respectively.\n\tconst float sampleDelta = 0.025;\n\tfloat nrSamples = 0.0;\n \n\tfor(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta)\n\t{\n for(float theta = 0.0; theta < ( 0.5 ) * PI; theta += sampleDelta)\n {\n // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n float x = sin(theta) * cos(phi);\n float y = sin(theta) * sin(phi);\n float z = cos(theta);\n vec3 tangentSample = vec3( x, y, z);\n \n vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n irradiance += (texture2D(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n nrSamples++;\n }\n\t}\n\t// divide by the total number of samples taken, giving us the average sampled irradiance.\n\tirradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n \n \n\tgl_FragColor = vec4(irradiance, 1.0);\n}",imageLightSpecularFrag:"precision highp float;\r\nvarying vec3 localPos;\r\nvarying vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n // x = r sin(phi) cos(theta) \r\n // y = r cos(phi) \r\n // z = r sin(phi) sin(theta)\r\n float phi = acos( v.y );\r\n // if phi is 0, then there are no x, z components\r\n float theta = 0.0;\r\n // else \r\n theta = acos(v.x / sin(phi));\r\n float sinTheta = v.z / sin(phi);\r\n if (sinTheta < 0.0) {\r\n // Turn it into -theta, but in the 0-2PI range\r\n theta = 2.0 * PI - theta;\r\n }\r\n theta = theta / (2.0 * 3.14159);\r\n phi = phi / 3.14159 ;\r\n \r\n vec2 angles = vec2( phi, theta );\r\n return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n const int SAMPLE_COUNT = 1024; // 4096\r\n float totalWeight = 0.0;\r\n vec3 prefilteredColor = vec3(0.0);\r\n float phi = vTexCoord.x * 2.0 * PI;\r\n float theta = vTexCoord.y * PI;\r\n float x = sin(theta) * cos(phi);\r\n float y = sin(theta) * sin(phi);\r\n float z = cos(theta);\r\n vec3 N = vec3(x,y,z);\r\n vec3 V = N;\r\n for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n {\r\n vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n float NdotL = max(dot(N, L), 0.0);\r\n if (NdotL > 0.0)\r\n {\r\n prefilteredColor += texture2D(environmentMap, nTOE(L)).xyz * NdotL;\r\n totalWeight += NdotL;\r\n }\r\n }\r\n prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n gl_FragColor = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n float a = roughness * roughness;\r\n\r\n float phi = 2.0 * PI * Xi.x;\r\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n // from spherical coordinates to cartesian coordinates\r\n vec3 H;\r\n H.x = cos(phi) * sinTheta;\r\n H.y = sin(phi) * sinTheta;\r\n H.z = cosTheta;\r\n\r\n // from tangent-space vector to world-space sample vector\r\n vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n vec3 tangent = normalize(cross(up, N));\r\n vec3 bitangent = cross(N, tangent);\r\n\r\n vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n float invBase = 1.0 / float(base);\r\n float denom = 1.0;\r\n float result = 0.0;\r\n\r\n for (int i = 0; i < 32; ++i)\r\n {\r\n\tif (n > 0)\r\n\t{\r\n \tdenom = mod(float(n), 2.0);\r\n \tresult += denom * invBase;\r\n \tinvBase = invBase / 2.0;\r\n \tn = int(float(n) / 2.0);\r\n\t}\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n"};for(x in M)M[x]="#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n"+M[x];j(e={},l.GRAY,"precision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 tex = texture2D(tex0, vTexCoord);\n float gray = luma(tex.rgb);\n gl_FragColor = vec4(gray, gray, gray, tex.a);\n}\n"),j(e,l.ERODE,"// Reduces the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the darkest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum < lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),j(e,l.DILATE,"// Increase the bright areas in an image\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform vec2 texelSize;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n // weights 77, 151, 28 taken from src/image/filters.js\n return dot(color, vec3(0.300781, 0.589844, 0.109375));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float lum = luma(color.rgb);\n\n // set current color as the brightest neighbor color\n\n vec4 neighbors[4];\n neighbors[0] = texture2D(tex0, vTexCoord + vec2( texelSize.x, 0.0));\n neighbors[1] = texture2D(tex0, vTexCoord + vec2(-texelSize.x, 0.0));\n neighbors[2] = texture2D(tex0, vTexCoord + vec2(0.0, texelSize.y));\n neighbors[3] = texture2D(tex0, vTexCoord + vec2(0.0, -texelSize.y));\n\n for (int i = 0; i < 4; i++) {\n vec4 neighborColor = neighbors[i];\n float neighborLum = luma(neighborColor.rgb);\n\n if (neighborLum > lum) {\n color = neighborColor;\n lum = neighborLum;\n }\n }\n\n gl_FragColor = color;\n}\n"),j(e,l.BLUR,"precision highp float;\n\n// Two-pass blur filter, unweighted kernel.\n// See also a similar blur at Adam Ferriss' repo of shader examples:\n// https://github.com/aferriss/p5jsShaderExamples/blob/gh-pages/4_image-effects/4-9_single-pass-blur/effect.frag\n\n\nuniform sampler2D tex0;\nvarying vec2 vTexCoord;\nuniform vec2 direction;\nuniform vec2 canvasSize;\nuniform float radius;\n\nfloat random(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * .1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// This isn't a real Gaussian weight, it's a quadratic weight. It's what the\n// CPU mode's blur uses though, so we also use it here to match.\nfloat quadWeight(float x, float e) {\n return pow(e-abs(x), 2.);\n}\n\nvoid main(){\n vec2 uv = vTexCoord;\n\n // A reasonable maximum number of samples\n const float maxSamples = 64.0;\n\n float numSamples = floor(7. * radius);\n if (fract(numSamples / 2.) == 0.) {\n numSamples++;\n }\n vec4 avg = vec4(0.0);\n float total = 0.0;\n\n // Calculate the spacing to avoid skewing if numSamples > maxSamples\n float spacing = 1.0;\n if (numSamples > maxSamples) {\n spacing = numSamples / maxSamples;\n numSamples = maxSamples;\n }\n\n float randomOffset = (spacing - 1.0) * mix(-0.5, 0.5, random(gl_FragCoord.xy));\n for (float i = 0.0; i < maxSamples; i++) {\n if (i >= numSamples) break;\n\n float sample = i * spacing - (numSamples - 1.0) * 0.5 * spacing + randomOffset;\n vec2 sampleCoord = uv + vec2(sample, sample) / canvasSize * direction;\n float weight = quadWeight(sample, (numSamples - 1.0) * 0.5 * spacing);\n\n avg += weight * texture2D(tex0, sampleCoord);\n total += weight;\n }\n\n avg /= total;\n gl_FragColor = avg;\n}\n"),j(e,l.POSTERIZE,"// Limit color space for a stylized cartoon / poster effect\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nvec3 quantize(vec3 color, float n) {\n // restrict values to N options/bins\n // and floor each channel to nearest value\n //\n // eg. when N = 5, values = 0.0, 0.25, 0.50, 0.75, 1.0\n // then quantize (0.1, 0.7, 0.9) -> (0.0, 0.5, 1.0)\n\n color = color * n;\n color = floor(color);\n color = color / (n - 1.0);\n return color;\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n\n vec3 restrictedColor = quantize(color.rgb / color.a, filterParameter);\n\n gl_FragColor = vec4(restrictedColor.rgb * color.a, color.a);\n}\n"),j(e,l.OPAQUE,"// Set alpha channel to entirely opaque\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n gl_FragColor = vec4(color.rgb / color.a, 1.0);\n}\n"),j(e,l.INVERT,"// Set each pixel to inverse value\n// Note that original INVERT does not change the opacity, so this follows suit\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\n\nvoid main() {\nvec4 color = texture2D(tex0, vTexCoord);\nvec3 origColor = color.rgb / color.a;\nvec3 invertedColor = vec3(1.0) - origColor;\ngl_FragColor = vec4(invertedColor * color.a, color.a);\n}\n"),j(e,l.THRESHOLD,"// Convert pixels to either white or black, \n// depending on if their luma is above or below filterParameter\n\nprecision highp float;\n\nvarying vec2 vTexCoord;\n\nuniform sampler2D tex0;\nuniform float filterParameter;\n\nfloat luma(vec3 color) {\n // weighted grayscale with luminance values\n return dot(color, vec3(0.2126, 0.7152, 0.0722));\n}\n\nvoid main() {\n vec4 color = texture2D(tex0, vTexCoord);\n float gray = luma(color.rgb / color.a);\n // floor() used to match src/image/filters.js\n float threshold = floor(filterParameter * 255.0) / 255.0;\n float blackOrWhite = step(threshold, gray);\n gl_FragColor = vec4(vec3(blackOrWhite) * color.a, color.a);\n}\n");var E=e;function k(e,t,r,o,n,s,i,a,l,u){var c=t.getParameter(t.FRAMEBUFFER_BINDING),r=(t.bindFramebuffer(t.FRAMEBUFFER,r),a===t.RGBA?4:3),d=s*i*r,h=l===t.UNSIGNED_BYTE?Uint8Array:Float32Array;if(e instanceof h&&e.length===d||(e=new h(d)),t.readPixels(o,u?u-n-i:n,s,i,a,l,e),t.bindFramebuffer(t.FRAMEBUFFER,c),u)for(var f=Math.floor(i/2),p=new h(s*r),m=0;m>7,127&d,c>>7,127&c);for(var h=0;h>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}]),t}();B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=M.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new E(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var h,f=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(h=f.next()).done);d=!0)h.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==f.return||f.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var j,_=y[Symbol.iterator]();!(g=(j=_.next()).done);g=!0){var x,w,S=j.value,T=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));T.uGlyphRect&&(x=T.rowInfo,w=T.colInfo,u.setUniform("uSamplerStrokes",T.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",T.uGridOffset),u.setUniform("uGlyphRect",T.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":264,"../core/main":275,"./p5.RendererGL.Retained":331,"./p5.Shader":333,"core-js/modules/es.array.iterator":161,"core-js/modules/es.object.get-own-property-descriptor":178,"core-js/modules/es.object.to-string":182,"core-js/modules/es.regexp.exec":187,"core-js/modules/es.string.iterator":192,"core-js/modules/es.string.split":198,"core-js/modules/es.string.sub":200,"core-js/modules/es.symbol":204,"core-js/modules/es.symbol.description":202,"core-js/modules/es.symbol.iterator":203,"core-js/modules/es.weak-map":236,"core-js/modules/web.dom-collections.iterator":238}]},{},[259])(259)}); \ No newline at end of file From 2685b9834735bb71d0fc787c6f976c7649d57b83 Mon Sep 17 00:00:00 2001 From: ff6347 Date: Sat, 9 Mar 2024 16:27:36 +0100 Subject: [PATCH 10/26] fix: Disable font ligatures --- src/components/Sandbox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Sandbox.tsx b/src/components/Sandbox.tsx index c2295cf..ba9e735 100644 --- a/src/components/Sandbox.tsx +++ b/src/components/Sandbox.tsx @@ -174,7 +174,7 @@ export default function Sandbox({ disableStorage, initialCode }: SandboxProps) { scrollBeyondLastLine: false, automaticLayout: true, cursorStyle: "line", - fontLigatures: true, + fontLigatures: false, cursorBlinking: "blink", minimap: { enabled: true, From d8100aaafa8136c4f9863870f54f2576d1b1577f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 10 Mar 2024 04:42:16 +0000 Subject: [PATCH 11/26] chore(release): 1.4.6 [skip ci] ## [1.4.6](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.5...v1.4.6) (2024-03-10) ### Bug Fixes * Disable font ligatures ([2685b98](https://github.com/ff6347/p5-code-sandbox/commit/2685b9834735bb71d0fc787c6f976c7649d57b83)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7edb2a8..110f192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.4.6](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.5...v1.4.6) (2024-03-10) + + +### Bug Fixes + +* Disable font ligatures ([2685b98](https://github.com/ff6347/p5-code-sandbox/commit/2685b9834735bb71d0fc787c6f976c7649d57b83)) + ## [1.4.5](https://github.com/ff6347/p5-code-sandbox/compare/v1.4.4...v1.4.5) (2023-12-17) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index d2e9f5b..e09c346 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ff6347/p5-sandbox", - "version": "1.4.5", + "version": "1.4.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ff6347/p5-sandbox", - "version": "1.4.5", + "version": "1.4.6", "hasInstallScript": true, "dependencies": { "@astrojs/check": "0.3.4", diff --git a/package.json b/package.json index c0d7468..5901af2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ff6347/p5-sandbox", "private": true, - "version": "1.4.5", + "version": "1.4.6", "type": "module", "scripts": { "copy:p5": "mkdirp ./public/lib && shx cp -r ./node_modules/p5/lib ./public/", From 4f3a7eb09cbf0141c22fdbdcec31ed8cc72cfced Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:30:14 +0000 Subject: [PATCH 12/26] chore(deps): update devdependencies-non-major --- package-lock.json | 2005 ++++++++++++++++++++++++++++++++++----------- package.json | 8 +- 2 files changed, 1548 insertions(+), 465 deletions(-) diff --git a/package-lock.json b/package-lock.json index e09c346..8376d6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.42.0", + "@playwright/test": "1.42.1", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", + "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.20", + "@types/node": "20.11.25", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.17.1", + "netlify-cli": "17.19.0", "shx": "0.3.4", "vitest": "1.3.1" } @@ -714,6 +714,7 @@ "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, "optional": true, + "peer": true, "engines": { "node": ">=0.1.90" } @@ -1812,12 +1813,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.0.tgz", - "integrity": "sha512-2k1HzC28Fs+HiwbJOQDUwrWMttqSLUVdjCqitBOjdCD0svWOMQUVqrXX6iFD7POps6xXAojsX/dGBpKnjZctLA==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", + "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", "dev": true, "dependencies": { - "playwright": "1.42.0" + "playwright": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -2467,9 +2468,9 @@ } }, "node_modules/@testing-library/react": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.1.2.tgz", - "integrity": "sha512-z4p7DVBTPjKM5qDZ0t5ZjzkpSNb+fZy1u6bzO7kk8oeGagpPCAtgh4cx1syrfp7a+QWkM021jGqjJaxJJnXAZg==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.1.tgz", + "integrity": "sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A==", "dev": true, "dependencies": { "@babel/runtime": "^7.12.5", @@ -2590,9 +2591,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.11.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", - "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", + "version": "20.11.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", + "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2990,6 +2991,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, + "peer": true, "dependencies": { "type-fest": "^3.0.0" }, @@ -3005,6 +3007,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, + "peer": true, "engines": { "node": ">=14.16" }, @@ -3944,6 +3947,7 @@ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, + "peer": true, "dependencies": { "string-width": "^4.2.0" }, @@ -3958,13 +3962,15 @@ "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 + "dev": true, + "peer": true }, "node_modules/cli-table3/node_modules/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, + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3979,6 +3985,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4820,6 +4827,7 @@ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -7828,22 +7836,22 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.17.1", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.17.1.tgz", - "integrity": "sha512-jn0KPVKDnLnpm8vytmUgG36AjdOKQVQ8qnWzm3lOPNtpX37W8j38PK/m5+C4ZXLLwVbwe8e4ZRNajDFBB3M1AA==", + "version": "17.19.0", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.19.0.tgz", + "integrity": "sha512-lz4RwFjprW4blAvEe0yZ43TYJJKOigOuo4830d057HoSR2LZ2AJdG/ZzJgkbzAagvo/Ut/VbuQVbrx+5x/385w==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "dependencies": { "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", - "@netlify/blobs": "6.5.0", + "@netlify/blobs": "7.0.0", "@netlify/build": "29.36.1", "@netlify/build-info": "7.13.0", "@netlify/config": "20.12.1", - "@netlify/edge-bundler": "11.2.2", + "@netlify/edge-bundler": "11.3.0", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.29.2", + "@netlify/zip-it-and-ship-it": "9.30.0", "@octokit/rest": "19.0.13", "ansi-escapes": "6.2.0", "ansi-styles": "6.2.1", @@ -7893,7 +7901,7 @@ "https-proxy-agent": "5.0.1", "inquirer": "6.5.2", "inquirer-autocomplete-prompt": "1.4.0", - "ipx": "2.0.1", + "ipx": "2.1.0", "is-docker": "3.0.0", "is-stream": "3.0.0", "is-wsl": "2.2.0", @@ -9019,9 +9027,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", - "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.0.0.tgz", + "integrity": "sha512-JHYlZzF7LNRSZv8vDoChpEtrfe/P9m+GoWkllWsy6Pn68ZWRB2FcDdXjvqq3i9psbf3BLVEECmvxYbdYDhlIGQ==", "dev": true, "engines": { "node": "^14.16.0 || >=16.0.0" @@ -9193,6 +9201,180 @@ "node": ">= 14" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/blobs": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", + "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", + "dev": true, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler": { + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.2.2.tgz", + "integrity": "sha512-RrRmM/bSl9K5InIJS9BbpY89Y7Y+83DoOoKR1/PE3gy7b9FONm8Cry9/YC4y+tUUWLuUo4dgt8+/Pw0uGFyI+g==", + "dev": true, + "dependencies": { + "@import-maps/resolve": "^1.0.1", + "@vercel/nft": "^0.26.0", + "ajv": "^8.11.2", + "ajv-errors": "^3.0.0", + "better-ajv-errors": "^1.2.0", + "common-path-prefix": "^3.0.0", + "env-paths": "^3.0.0", + "esbuild": "0.19.11", + "execa": "^6.0.0", + "find-up": "^6.3.0", + "get-package-name": "^2.2.0", + "get-port": "^6.1.2", + "is-path-inside": "^4.0.0", + "jsonc-parser": "^3.2.0", + "node-fetch": "^3.1.1", + "node-stream-zip": "^1.15.0", + "p-retry": "^5.1.1", + "p-wait-for": "^4.1.0", + "path-key": "^4.0.0", + "regexp-tree": "^0.1.24", + "semver": "^7.3.8", + "tmp-promise": "^3.0.3", + "urlpattern-polyfill": "8.0.2", + "uuid": "^9.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { + "version": "0.26.4", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.4.tgz", + "integrity": "sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==", + "dev": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "acorn-import-attributes": "^1.9.2", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" + }, + "bin": { + "nft": "out/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it": { + "version": "9.29.2", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", + "integrity": "sha512-9o/4lsFWuyPpe38Rhk/00JyccKSBRGM9Av3DINnh/QrpTeIC6esfJsaJNQ4JQ+gU4XXAwxPY9Uk+16WMPs/zkg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.22.5", + "@babel/types": "7.23.6", + "@netlify/binary-info": "^1.0.0", + "@netlify/serverless-functions-api": "^1.14.0", + "@vercel/nft": "^0.23.0", + "archiver": "^6.0.0", + "common-path-prefix": "^3.0.0", + "cp-file": "^10.0.0", + "es-module-lexer": "^1.0.0", + "esbuild": "0.19.11", + "execa": "^6.0.0", + "fast-glob": "^3.3.2", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "glob": "^8.0.3", + "is-builtin-module": "^3.1.0", + "is-path-inside": "^4.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "merge-options": "^3.0.4", + "minimatch": "^9.0.0", + "normalize-path": "^3.0.0", + "p-map": "^5.0.0", + "path-exists": "^5.0.0", + "precinct": "^11.0.0", + "require-package-name": "^2.0.1", + "resolve": "^2.0.0-next.1", + "semver": "^7.3.8", + "tmp-promise": "^3.0.2", + "toml": "^3.0.0", + "unixify": "^1.0.0", + "urlpattern-polyfill": "8.0.2", + "yargs": "^17.0.0" + }, + "bin": { + "zip-it-and-ship-it": "dist/bin.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", @@ -9217,6 +9399,40 @@ "node": ">=14.16" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "dev": true, + "peerDependencies": { + "ajv": "^8.0.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -9301,6 +9517,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { "version": "12.6.1", "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", @@ -9360,12 +9619,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { @@ -9396,6 +9673,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", @@ -9507,6 +9799,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "dev": true, + "dependencies": { + "p-timeout": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -9895,9 +10214,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.2.2.tgz", - "integrity": "sha512-RrRmM/bSl9K5InIJS9BbpY89Y7Y+83DoOoKR1/PE3gy7b9FONm8Cry9/YC4y+tUUWLuUo4dgt8+/Pw0uGFyI+g==", + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.3.0.tgz", + "integrity": "sha512-ROyjrrOCe4TYdBf9Eky8EFrSFENcKdsHHqGe0nSwbyLKDfbe9gPNwN9LoXt9QhxmPyJCOGwxz12kDX2rqFc+Mw==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", @@ -9907,7 +10226,7 @@ "better-ajv-errors": "^1.2.0", "common-path-prefix": "^3.0.0", "env-paths": "^3.0.0", - "esbuild": "0.19.11", + "esbuild": "0.20.0", "execa": "^6.0.0", "find-up": "^6.3.0", "get-package-name": "^2.2.0", @@ -9919,7 +10238,6 @@ "p-retry": "^5.1.1", "p-wait-for": "^4.1.0", "path-key": "^4.0.0", - "regexp-tree": "^0.1.24", "semver": "^7.3.8", "tmp-promise": "^3.0.3", "urlpattern-polyfill": "8.0.2", @@ -9929,158 +10247,564 @@ "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.2.tgz", - "integrity": "sha512-bxe2iShmKZi7476xYamyKvhhKwQ6JPEtQ2FSq1AjMUH2buMd8LQMkdoHinTqZYc+1sMTh3G0ARdjzNvV1FEisA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/aix-ppc64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.0.tgz", + "integrity": "sha512-fGFDEctNh0CcSwsiRPxiaqX0P5rq+AqE0SRhYGZ4PX46Lg1FNR6oCxJghf8YgY0WQEgQuh3lErUFE4KxLeRmmw==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "acorn-import-attributes": "^1.9.2", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=16" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.0.tgz", + "integrity": "sha512-3bMAfInvByLHfJwYPJRlpTeaQA75n8C/QKpEaiS4HrFWFiJlNI0vzq/zCjBrhAYcPyVPG7Eo9dMrcQXuqmNk5g==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", - "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.0.tgz", + "integrity": "sha512-aVpnM4lURNkp0D3qPoAzSG92VXStYmoVPOgXveAUoQBWRSuQzt51yvSju29J6AHPmwY1BjH49uR29oyfH1ra8Q==", + "cpu": [ + "arm64" + ], "dev": true, - "peerDependencies": { - "ajv": "^8.0.1" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.0.tgz", + "integrity": "sha512-uK7wAnlRvjkCPzh8jJ+QejFyrP8ObKuR5cBIsQZ+qbMunwR8sbd8krmMbxTLSrDhiPZaJYKQAU5Y3iMDcZPhyQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", - "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.0.tgz", + "integrity": "sha512-AjEcivGAlPs3UAcJedMa9qYg9eSfU6FnGHJjT8s346HSKkrcWlYezGE8VaO2xKfvvlZkgAhyvl06OJOxiMgOYQ==", + "cpu": [ + "arm64" + ], "dev": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.0.tgz", + "integrity": "sha512-bsgTPoyYDnPv8ER0HqnJggXK6RyFy4PH4rtsId0V7Efa90u2+EifxytE9pZnsDgExgkARy24WUQGv9irVbTvIw==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=12.20.0" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.0.tgz", + "integrity": "sha512-kQ7jYdlKS335mpGbMW5tEe3IrQFIok9r84EM3PXB8qBFJPSc6dpWfrtsC/y1pyrz82xfUIn5ZrnSHQQsd6jebQ==", + "cpu": [ + "arm64" + ], "dev": true, + "optional": true, + "os": [ + "freebsd" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.0.tgz", + "integrity": "sha512-uG8B0WSepMRsBNVXAQcHf9+Ko/Tr+XqmK7Ptel9HVmnykupXdS4J7ovSQUIi0tQGIndhbqWLaIL/qO/cWhXKyQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.0.tgz", + "integrity": "sha512-2ezuhdiZw8vuHf1HKSf4TIk80naTbP9At7sOqZmdVwvvMyuoDiZB49YZKLsLOfKIr77+I40dWpHVeY5JHpIEIg==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.0.tgz", + "integrity": "sha512-uTtyYAP5veqi2z9b6Gr0NUoNv9F/rOzI8tOD5jKcCvRUn7T60Bb+42NDBCWNhMjkQzI0qqwXkQGo1SY41G52nw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.0.tgz", + "integrity": "sha512-c88wwtfs8tTffPaoJ+SQn3y+lKtgTzyjkD8NgsyCtCmtoIC8RDL7PrJU05an/e9VuAke6eJqGkoMhJK1RY6z4w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.0.tgz", + "integrity": "sha512-lR2rr/128/6svngnVta6JN4gxSXle/yZEZL3o4XZ6esOqhyR4wsKyfu6qXAL04S4S5CgGfG+GYZnjFd4YiG3Aw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.0.tgz", + "integrity": "sha512-9Sycc+1uUsDnJCelDf6ZNqgZQoK1mJvFtqf2MUz4ujTxGhvCWw+4chYfDLPepMEvVL9PDwn6HrXad5yOrNzIsQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.0.tgz", + "integrity": "sha512-CoWSaaAXOZd+CjbUTdXIJE/t7Oz+4g90A3VBCHLbfuc5yUQU/nFDLOzQsN0cdxgXd97lYW/psIIBdjzQIwTBGw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.0.tgz", + "integrity": "sha512-mlb1hg/eYRJUpv8h/x+4ShgoNLL8wgZ64SUr26KwglTYnwAWjkhR2GpoKftDbPOCnodA9t4Y/b68H4J9XmmPzA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.0.tgz", + "integrity": "sha512-fgf9ubb53xSnOBqyvWEY6ukBNRl1mVX1srPNu06B6mNsNK20JfH6xV6jECzrQ69/VMiTLvHMicQR/PgTOgqJUQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.0.tgz", + "integrity": "sha512-H9Eu6MGse++204XZcYsse1yFHmRXEWgadk2N58O/xd50P9EvFMLJTQLg+lB4E1cF2xhLZU5luSWtGTb0l9UeSg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.0.tgz", + "integrity": "sha512-lCT675rTN1v8Fo+RGrE5KjSnfY0x9Og4RN7t7lVrN3vMSjy34/+3na0q7RIfWDAj0e0rCh0OL+P88lu3Rt21MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.0.tgz", + "integrity": "sha512-HKoUGXz/TOVXKQ+67NhxyHv+aDSZf44QpWLa3I1lLvAwGq8x1k0T+e2HHSRvxWhfJrFxaaqre1+YyzQ99KixoA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.0.tgz", + "integrity": "sha512-GDwAqgHQm1mVoPppGsoq4WJwT3vhnz/2N62CzhvApFD1eJyTroob30FPpOZabN+FgCjhG+AgcZyOPIkR8dfD7g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.0.tgz", + "integrity": "sha512-0vYsP8aC4TvMlOQYozoksiaxjlvUcQrac+muDqj1Fxy6jh9l9CZJzj7zmh8JGfiV49cYLTorFLxg7593pGldwQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.0.tgz", + "integrity": "sha512-p98u4rIgfh4gdpV00IqknBD5pC84LCub+4a3MO+zjqvU5MVXOc3hqR2UgT2jI2nh3h8s9EQxmOsVI3tyzv1iFg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.0.tgz", + "integrity": "sha512-NgJnesu1RtWihtTtXGFMU5YSE6JyyHPMxCwBZK7a6/8d31GuSo9l0Ss7w1Jw5QnKUawG6UEehs883kcXf5fYwg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { + "version": "0.26.4", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.4.tgz", + "integrity": "sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==", + "dev": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "acorn-import-attributes": "^1.9.2", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" + }, + "bin": { + "nft": "out/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "dev": true, + "peerDependencies": { + "ajv": "^8.0.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.0.tgz", + "integrity": "sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.0", + "@esbuild/android-arm": "0.20.0", + "@esbuild/android-arm64": "0.20.0", + "@esbuild/android-x64": "0.20.0", + "@esbuild/darwin-arm64": "0.20.0", + "@esbuild/darwin-x64": "0.20.0", + "@esbuild/freebsd-arm64": "0.20.0", + "@esbuild/freebsd-x64": "0.20.0", + "@esbuild/linux-arm": "0.20.0", + "@esbuild/linux-arm64": "0.20.0", + "@esbuild/linux-ia32": "0.20.0", + "@esbuild/linux-loong64": "0.20.0", + "@esbuild/linux-mips64el": "0.20.0", + "@esbuild/linux-ppc64": "0.20.0", + "@esbuild/linux-riscv64": "0.20.0", + "@esbuild/linux-s390x": "0.20.0", + "@esbuild/linux-x64": "0.20.0", + "@esbuild/netbsd-x64": "0.20.0", + "@esbuild/openbsd-x64": "0.20.0", + "@esbuild/sunos-x64": "0.20.0", + "@esbuild/win32-arm64": "0.20.0", + "@esbuild/win32-ia32": "0.20.0", + "@esbuild/win32-x64": "0.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { "mimic-fn": "^4.0.0" }, "engines": { @@ -10150,82 +10874,258 @@ "node": "^14.14.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { + "version": "5.2.51", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.51.tgz", + "integrity": "sha512-A4XLQOE2pfcOHcCTs97G6FDVQg20zGoROCAZcpnNd8bMvBDDVgziC/xoFxm4xGC36u0YogSECsLoIbSKSxLloA==", + "dev": true, + "dependencies": { + "@netlify/zip-it-and-ship-it": "9.29.2", + "cpy": "^9.0.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/@netlify/zip-it-and-ship-it": { + "version": "9.29.2", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", + "integrity": "sha512-9o/4lsFWuyPpe38Rhk/00JyccKSBRGM9Av3DINnh/QrpTeIC6esfJsaJNQ4JQ+gU4XXAwxPY9Uk+16WMPs/zkg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.22.5", + "@babel/types": "7.23.6", + "@netlify/binary-info": "^1.0.0", + "@netlify/serverless-functions-api": "^1.14.0", + "@vercel/nft": "^0.23.0", + "archiver": "^6.0.0", + "common-path-prefix": "^3.0.0", + "cp-file": "^10.0.0", + "es-module-lexer": "^1.0.0", + "esbuild": "0.19.11", + "execa": "^6.0.0", + "fast-glob": "^3.3.2", + "filter-obj": "^5.0.0", + "find-up": "^6.0.0", + "glob": "^8.0.3", + "is-builtin-module": "^3.1.0", + "is-path-inside": "^4.0.0", + "junk": "^4.0.0", + "locate-path": "^7.0.0", + "merge-options": "^3.0.4", + "minimatch": "^9.0.0", + "normalize-path": "^3.0.0", + "p-map": "^5.0.0", + "path-exists": "^5.0.0", + "precinct": "^11.0.0", + "require-package-name": "^2.0.1", + "resolve": "^2.0.0-next.1", + "semver": "^7.3.8", + "tmp-promise": "^3.0.2", + "toml": "^3.0.0", + "unixify": "^1.0.0", + "urlpattern-polyfill": "8.0.2", + "yargs": "^17.0.0" + }, + "bin": { + "zip-it-and-ship-it": "dist/bin.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "brace-expansion": "^2.0.1" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": ">=10" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", - "dev": true + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "engines": { + "node": ">=12.20.0" + } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/is-path-inside": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-locate": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", - "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "p-limit": "^4.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, "engines": { - "node": ">=12.20" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.51", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.51.tgz", - "integrity": "sha512-A4XLQOE2pfcOHcCTs97G6FDVQg20zGoROCAZcpnNd8bMvBDDVgziC/xoFxm4xGC36u0YogSECsLoIbSKSxLloA==", + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.29.2", - "cpy": "^9.0.0", - "path-exists": "^5.0.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": "^14.16.0 || >=16.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { @@ -10237,6 +11137,18 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/git-utils": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", @@ -10699,9 +11611,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.29.2", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", - "integrity": "sha512-9o/4lsFWuyPpe38Rhk/00JyccKSBRGM9Av3DINnh/QrpTeIC6esfJsaJNQ4JQ+gU4XXAwxPY9Uk+16WMPs/zkg==", + "version": "9.30.0", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.30.0.tgz", + "integrity": "sha512-R0v1/vDjjizB4em4YvigqIRj4ZAdcp18svajvcDp6OhB6pt76LZ/RlPEEPq4sGfpQRUpdmapNdnQDNHHReyXug==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", @@ -10845,9 +11757,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "dependencies": { "path-key": "^4.0.0" @@ -11151,9 +12063,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.3.0.tgz", - "integrity": "sha512-pW7QaFiL11O0BphO+bq3MgqeX/INAk9jgBldVDYjlQPO4VddoZnF22TcF9onMhnLVHuNqBJeRf+Fj7eezi/+rQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.0.tgz", + "integrity": "sha512-XJLGVL0DEclX5pcWa2N9SX1jCGTDd8l972biNooLFtjneuGqodupPQh6XseXIBBeVIMaaJ7bTcs3qGvXwsp4vg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -11170,24 +12082,24 @@ "url": "https://opencollective.com/parcel" }, "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.3.0", - "@parcel/watcher-darwin-arm64": "2.3.0", - "@parcel/watcher-darwin-x64": "2.3.0", - "@parcel/watcher-freebsd-x64": "2.3.0", - "@parcel/watcher-linux-arm-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-musl": "2.3.0", - "@parcel/watcher-linux-x64-glibc": "2.3.0", - "@parcel/watcher-linux-x64-musl": "2.3.0", - "@parcel/watcher-win32-arm64": "2.3.0", - "@parcel/watcher-win32-ia32": "2.3.0", - "@parcel/watcher-win32-x64": "2.3.0" + "@parcel/watcher-android-arm64": "2.4.0", + "@parcel/watcher-darwin-arm64": "2.4.0", + "@parcel/watcher-darwin-x64": "2.4.0", + "@parcel/watcher-freebsd-x64": "2.4.0", + "@parcel/watcher-linux-arm-glibc": "2.4.0", + "@parcel/watcher-linux-arm64-glibc": "2.4.0", + "@parcel/watcher-linux-arm64-musl": "2.4.0", + "@parcel/watcher-linux-x64-glibc": "2.4.0", + "@parcel/watcher-linux-x64-musl": "2.4.0", + "@parcel/watcher-win32-arm64": "2.4.0", + "@parcel/watcher-win32-ia32": "2.4.0", + "@parcel/watcher-win32-x64": "2.4.0" } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-android-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.3.0.tgz", - "integrity": "sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.0.tgz", + "integrity": "sha512-+fPtO/GsbYX1LJnCYCaDVT3EOBjvSFdQN9Mrzh9zWAOOfvidPWyScTrHIZHHfJBvlHzNA0Gy0U3NXFA/M7PHUA==", "cpu": [ "arm64" ], @@ -11205,9 +12117,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.3.0.tgz", - "integrity": "sha512-mKY+oijI4ahBMc/GygVGvEdOq0L4DxhYgwQqYAz/7yPzuGi79oXrZG52WdpGA1wLBPrYb0T8uBaGFo7I6rvSKw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.0.tgz", + "integrity": "sha512-T/At5pansFuQ8VJLRx0C6C87cgfqIYhW2N/kBfLCUvDhCah0EnLLwaD/6MW3ux+rpgkpQAnMELOCTKlbwncwiA==", "cpu": [ "arm64" ], @@ -11225,9 +12137,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.3.0.tgz", - "integrity": "sha512-20oBj8LcEOnLE3mgpy6zuOq8AplPu9NcSSSfyVKgfOhNAc4eF4ob3ldj0xWjGGbOF7Dcy1Tvm6ytvgdjlfUeow==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.0.tgz", + "integrity": "sha512-vZMv9jl+szz5YLsSqEGCMSllBl1gU1snfbRL5ysJU03MEa6gkVy9OMcvXV1j4g0++jHEcvzhs3Z3LpeEbVmY6Q==", "cpu": [ "x64" ], @@ -11245,9 +12157,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.3.0.tgz", - "integrity": "sha512-7LftKlaHunueAEiojhCn+Ef2CTXWsLgTl4hq0pkhkTBFI3ssj2bJXmH2L67mKpiAD5dz66JYk4zS66qzdnIOgw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.0.tgz", + "integrity": "sha512-dHTRMIplPDT1M0+BkXjtMN+qLtqq24sLDUhmU+UxxLP2TEY2k8GIoqIJiVrGWGomdWsy5IO27aDV1vWyQ6gfHA==", "cpu": [ "x64" ], @@ -11265,9 +12177,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.3.0.tgz", - "integrity": "sha512-1apPw5cD2xBv1XIHPUlq0cO6iAaEUQ3BcY0ysSyD9Kuyw4MoWm1DV+W9mneWI+1g6OeP6dhikiFE6BlU+AToTQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.0.tgz", + "integrity": "sha512-9NQXD+qk46RwATNC3/UB7HWurscY18CnAPMTFcI9Y8CTbtm63/eex1SNt+BHFinEQuLBjaZwR2Lp+n7pmEJPpQ==", "cpu": [ "arm" ], @@ -11285,9 +12197,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.3.0.tgz", - "integrity": "sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.0.tgz", + "integrity": "sha512-QuJTAQdsd7PFW9jNGaV9Pw+ZMWV9wKThEzzlY3Lhnnwy7iW23qtQFPql8iEaSFMCVI5StNNmONUopk+MFKpiKg==", "cpu": [ "arm64" ], @@ -11305,9 +12217,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.3.0.tgz", - "integrity": "sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.0.tgz", + "integrity": "sha512-oyN+uA9xcTDo/45bwsd6TFHa7Lc7hKujyMlvwrCLvSckvWogndCEoVYFNfZ6JJ2KNL/6fFiGPcbjp8jJmEh5Ng==", "cpu": [ "arm64" ], @@ -11325,9 +12237,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.3.0.tgz", - "integrity": "sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.0.tgz", + "integrity": "sha512-KphV8awJmxU3q52JQvJot0QMu07CIyEjV+2Tb2ZtbucEgqyRcxOBDMsqp1JNq5nuDXtcCC0uHQICeiEz38dPBQ==", "cpu": [ "x64" ], @@ -11345,9 +12257,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.3.0.tgz", - "integrity": "sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.0.tgz", + "integrity": "sha512-7jzcOonpXNWcSijPpKD5IbC6xC7yTibjJw9jviVzZostYLGxbz8LDJLUnLzLzhASPlPGgpeKLtFUMjAAzM+gSA==", "cpu": [ "x64" ], @@ -11365,9 +12277,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-wasm": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.3.0.tgz", - "integrity": "sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.4.0.tgz", + "integrity": "sha512-MNgQ4WCbBybqQ97KwR/hqJGYTg3+s8qHpgIyFWB2qJOBvoJWbXuJGmm4ZkPLq2bMaANqCZqrXwmKYagZTkMKZA==", "bundleDependencies": [ "napi-wasm" ], @@ -11392,9 +12304,9 @@ "license": "MIT" }, "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.3.0.tgz", - "integrity": "sha512-35gXCnaz1AqIXpG42evcoP2+sNL62gZTMZne3IackM+6QlfMcJLy3DrjuL6Iks7Czpd3j4xRBzez3ADCj1l7Aw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.0.tgz", + "integrity": "sha512-NOej2lqlq8bQNYhUMnOD0nwvNql8ToQF+1Zhi9ULZoG+XTtJ9hNnCFfyICxoZLXor4bBPTOnzs/aVVoefYnjIg==", "cpu": [ "arm64" ], @@ -11412,9 +12324,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-ia32": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.3.0.tgz", - "integrity": "sha512-FJS/IBQHhRpZ6PiCjFt1UAcPr0YmCLHRbTc00IBTrelEjlmmgIVLeOx4MSXzx2HFEy5Jo5YdhGpxCuqCyDJ5ow==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.0.tgz", + "integrity": "sha512-IO/nM+K2YD/iwjWAfHFMBPz4Zqn6qBDqZxY4j2n9s+4+OuTSRM/y/irksnuqcspom5DjkSeF9d0YbO+qpys+JA==", "cpu": [ "ia32" ], @@ -11432,9 +12344,9 @@ } }, "node_modules/netlify-cli/node_modules/@parcel/watcher-win32-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.3.0.tgz", - "integrity": "sha512-dLx+0XRdMnVI62kU3wbXvbIRhLck4aE28bIGKbRGS7BJNt54IIj9+c/Dkqb+7DJEbHUZAX1bwaoM8PqVlHJmCA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.0.tgz", + "integrity": "sha512-pAUyUVjfFjWaf/pShmJpJmNxZhbMvJASUpdes9jL6bTEJ+gDxPRSpXTIemNyNsb9AtbiGXs9XduP1reThmd+dA==", "cpu": [ "x64" ], @@ -12175,9 +13087,9 @@ } }, "node_modules/netlify-cli/node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -12429,26 +13341,6 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/arch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", - "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/netlify-cli/node_modules/archiver": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.1.tgz", @@ -13309,9 +14201,9 @@ } }, "node_modules/netlify-cli/node_modules/citty": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.4.tgz", - "integrity": "sha512-Q3bK1huLxzQrvj7hImJ7Z1vKYJRPQCDnd0EjXfHMidcjecGOMuLrmuQmtWmFkuKLcMThlGh1yCKG8IEc6VeNXQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", "dev": true, "dependencies": { "consola": "^3.2.3" @@ -13468,15 +14360,127 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/clipboardy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-4.0.0.tgz", + "integrity": "sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==", + "dev": true, + "dependencies": { + "execa": "^8.0.1", + "is-wsl": "^3.1.0", + "is64bit": "^2.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "mimic-fn": "^4.0.0" }, "engines": { "node": ">=12" @@ -13485,24 +14489,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, - "node_modules/netlify-cli/node_modules/clipboardy": { + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/strip-final-newline": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-3.0.0.tgz", - "integrity": "sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, - "dependencies": { - "arch": "^2.2.0", - "execa": "^5.1.1", - "is-wsl": "^2.2.0" - }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -14239,6 +15244,12 @@ "node": ">=8" } }, + "node_modules/netlify-cli/node_modules/crossws": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.1.1.tgz", + "integrity": "sha512-c9c/o7bS3OjsdpSkvexpka0JNlesBF2JU9B2V1yNsYGwRbAafxhJQ7VI9b48D5bpONz/oxbPGMzBojy9sXoQIQ==", + "dev": true + }, "node_modules/netlify-cli/node_modules/crypto-random-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", @@ -14561,9 +15572,9 @@ } }, "node_modules/netlify-cli/node_modules/defu": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.3.tgz", - "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", "dev": true }, "node_modules/netlify-cli/node_modules/delegates": { @@ -16564,9 +17575,9 @@ } }, "node_modules/netlify-cli/node_modules/get-port-please": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.1.tgz", - "integrity": "sha512-3UBAyM3u4ZBVYDsxOQfJDxEa6XTbpBDrOjp4mf7ExFRt5BKs/QywQQiJsh2B+hxcZLSapWqCRvElUe8DnKcFHA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.2.tgz", + "integrity": "sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==", "dev": true }, "node_modules/netlify-cli/node_modules/get-stream": { @@ -16748,19 +17759,20 @@ "dev": true }, "node_modules/netlify-cli/node_modules/h3": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/h3/-/h3-1.8.2.tgz", - "integrity": "sha512-1Ca0orJJlCaiFY68BvzQtP2lKLk46kcLAxVM8JgYbtm2cUg6IY7pjpYgWMwUvDO9QI30N5JAukOKoT8KD3Q0PQ==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.10.1.tgz", + "integrity": "sha512-UBAUp47hmm4BB5/njB4LrEa9gpuvZj4/Qf/ynSMzO6Ku2RXaouxEfiG2E2IFnv6fxbhAkzjasDxmo6DFdEeXRg==", "dev": true, "dependencies": { "cookie-es": "^1.0.0", - "defu": "^6.1.2", - "destr": "^2.0.1", - "iron-webcrypto": "^0.10.1", + "defu": "^6.1.4", + "destr": "^2.0.2", + "iron-webcrypto": "^1.0.0", + "ohash": "^1.1.3", "radix3": "^1.1.0", - "ufo": "^1.3.0", + "ufo": "^1.3.2", "uncrypto": "^0.1.3", - "unenv": "^1.7.4" + "unenv": "^1.9.0" } }, "node_modules/netlify-cli/node_modules/has": { @@ -17495,36 +18507,127 @@ } }, "node_modules/netlify-cli/node_modules/ipx": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipx/-/ipx-2.0.1.tgz", - "integrity": "sha512-+EyZiVNosYr3hu3F5+5GripTBLjKmSPTvcy3YdT4zxlhqHQJ2gUopLGxpfv9Wd11YgeiPh53ysbtG+ZNIOVF4A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipx/-/ipx-2.1.0.tgz", + "integrity": "sha512-AVnPGXJ8L41vjd11Z4akIF2yd14636Klxul3tBySxHA6PKfCOQPxBDkCFK5zcWh0z/keR6toh1eg8qzdBVUgdA==", "dev": true, "dependencies": { "@fastify/accept-negotiator": "^1.1.0", - "citty": "^0.1.4", + "citty": "^0.1.5", "consola": "^3.2.3", - "defu": "^6.1.3", + "defu": "^6.1.4", "destr": "^2.0.2", "etag": "^1.8.1", - "h3": "^1.8.2", + "h3": "^1.10.0", "image-meta": "^0.2.0", - "listhen": "^1.5.5", + "listhen": "^1.5.6", "ofetch": "^1.3.3", - "pathe": "^1.1.1", + "pathe": "^1.1.2", "sharp": "^0.32.6", - "svgo": "^3.0.2", - "ufo": "^1.3.1", - "unstorage": "^1.9.0", + "svgo": "^3.2.0", + "ufo": "^1.3.2", + "unstorage": "^1.10.1", "xss": "^1.0.14" }, "bin": { "ipx": "bin/ipx.mjs" } }, + "node_modules/netlify-cli/node_modules/ipx/node_modules/@netlify/blobs": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", + "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/ipx/node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/netlify-cli/node_modules/ipx/node_modules/unstorage": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.10.1.tgz", + "integrity": "sha512-rWQvLRfZNBpF+x8D3/gda5nUCQL2PgXy2jNG4U7/Rc9BGEv9+CAJd0YyGCROUBKs9v49Hg8huw3aih5Bf5TAVw==", + "dev": true, + "dependencies": { + "anymatch": "^3.1.3", + "chokidar": "^3.5.3", + "destr": "^2.0.2", + "h3": "^1.8.2", + "ioredis": "^5.3.2", + "listhen": "^1.5.5", + "lru-cache": "^10.0.2", + "mri": "^1.2.0", + "node-fetch-native": "^1.4.1", + "ofetch": "^1.3.3", + "ufo": "^1.3.1" + }, + "peerDependencies": { + "@azure/app-configuration": "^1.4.1", + "@azure/cosmos": "^4.0.0", + "@azure/data-tables": "^13.2.2", + "@azure/identity": "^3.3.2", + "@azure/keyvault-secrets": "^4.7.0", + "@azure/storage-blob": "^12.16.0", + "@capacitor/preferences": "^5.0.6", + "@netlify/blobs": "^6.2.0", + "@planetscale/database": "^1.11.0", + "@upstash/redis": "^1.23.4", + "@vercel/kv": "^0.2.3", + "idb-keyval": "^6.2.1" + }, + "peerDependenciesMeta": { + "@azure/app-configuration": { + "optional": true + }, + "@azure/cosmos": { + "optional": true + }, + "@azure/data-tables": { + "optional": true + }, + "@azure/identity": { + "optional": true + }, + "@azure/keyvault-secrets": { + "optional": true + }, + "@azure/storage-blob": { + "optional": true + }, + "@capacitor/preferences": { + "optional": true + }, + "@netlify/blobs": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/kv": { + "optional": true + }, + "idb-keyval": { + "optional": true + } + } + }, "node_modules/netlify-cli/node_modules/iron-webcrypto": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-0.10.1.tgz", - "integrity": "sha512-QGOS8MRMnj/UiOa+aMIgfyHcvkhqNUsUxb1XzskENvbo+rEfp6TOwqd1KPuDzXC4OnGHcMSVxDGRoilqB8ViqA==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.0.0.tgz", + "integrity": "sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg==", "dev": true, "funding": { "url": "https://github.com/sponsors/brc-dd" @@ -17699,6 +18802,24 @@ "node": ">=0.10.0" } }, + "node_modules/netlify-cli/node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -17895,6 +19016,21 @@ "node": ">=12" } }, + "node_modules/netlify-cli/node_modules/is64bit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is64bit/-/is64bit-2.0.0.tgz", + "integrity": "sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==", + "dev": true, + "dependencies": { + "system-architecture": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -18317,27 +19453,28 @@ "dev": true }, "node_modules/netlify-cli/node_modules/listhen": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.5.5.tgz", - "integrity": "sha512-LXe8Xlyh3gnxdv4tSjTjscD1vpr/2PRpzq8YIaMJgyKzRG8wdISlWVWnGThJfHnlJ6hmLt2wq1yeeix0TEbuoA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/listhen/-/listhen-1.6.0.tgz", + "integrity": "sha512-z0RcEXVX5oTpY1bO02SKoTU/kmZSrFSngNNzHRM6KICR17PTq7ANush6AE6ztGJwJD4RLpBrVHd9GnV51J7s3w==", "dev": true, "dependencies": { - "@parcel/watcher": "^2.3.0", - "@parcel/watcher-wasm": "2.3.0", - "citty": "^0.1.4", - "clipboardy": "^3.0.0", + "@parcel/watcher": "^2.4.0", + "@parcel/watcher-wasm": "2.4.0", + "citty": "^0.1.5", + "clipboardy": "^4.0.0", "consola": "^3.2.3", - "defu": "^6.1.2", - "get-port-please": "^3.1.1", - "h3": "^1.8.1", + "crossws": "^0.1.0", + "defu": "^6.1.4", + "get-port-please": "^3.1.2", + "h3": "^1.10.1", "http-shutdown": "^1.2.2", - "jiti": "^1.20.0", - "mlly": "^1.4.2", + "jiti": "^1.21.0", + "mlly": "^1.5.0", "node-forge": "^1.3.1", - "pathe": "^1.1.1", - "std-env": "^3.4.3", - "ufo": "^1.3.0", - "untun": "^0.1.2", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "ufo": "^1.3.2", + "untun": "^0.1.3", "uqr": "^0.1.2" }, "bin": { @@ -19116,15 +20253,15 @@ "dev": true }, "node_modules/netlify-cli/node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", + "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", "dev": true, "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", + "acorn": "^8.11.3", + "pathe": "^1.1.2", "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "ufo": "^1.3.2" } }, "node_modules/netlify-cli/node_modules/module-definition": { @@ -19457,10 +20594,13 @@ } }, "node_modules/netlify-cli/node_modules/node-addon-api": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", - "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", - "dev": true + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "dev": true, + "engines": { + "node": "^16 || ^18 || >= 20" + } }, "node_modules/netlify-cli/node_modules/node-domexception": { "version": "1.0.0", @@ -19502,9 +20642,9 @@ } }, "node_modules/netlify-cli/node_modules/node-fetch-native": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.4.1.tgz", - "integrity": "sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.2.tgz", + "integrity": "sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==", "dev": true }, "node_modules/netlify-cli/node_modules/node-forge": { @@ -19786,6 +20926,12 @@ "ufo": "^1.3.0" } }, + "node_modules/netlify-cli/node_modules/ohash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.3.tgz", + "integrity": "sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/omit.js": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-2.0.2.tgz", @@ -20437,9 +21583,9 @@ } }, "node_modules/netlify-cli/node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, "node_modules/netlify-cli/node_modules/peek-readable": { @@ -22382,15 +23528,16 @@ } }, "node_modules/netlify-cli/node_modules/svgo": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", - "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz", + "integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==", "dev": true, "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", "css-select": "^5.1.0", - "css-tree": "^2.2.1", + "css-tree": "^2.3.1", + "css-what": "^6.1.0", "csso": "^5.0.5", "picocolors": "^1.0.0" }, @@ -22414,6 +23561,18 @@ "node": ">= 10" } }, + "node_modules/netlify-cli/node_modules/system-architecture": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/system-architecture/-/system-architecture-0.1.0.tgz", + "integrity": "sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/tabtab": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/tabtab/-/tabtab-3.0.2.tgz", @@ -22967,9 +24126,9 @@ } }, "node_modules/netlify-cli/node_modules/ufo": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", - "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", "dev": true }, "node_modules/netlify-cli/node_modules/uid-safe": { @@ -23016,15 +24175,15 @@ "dev": true }, "node_modules/netlify-cli/node_modules/unenv": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.7.4.tgz", - "integrity": "sha512-fjYsXYi30It0YCQYqLOcT6fHfMXsBr2hw9XC7ycf8rTG7Xxpe3ZssiqUnD0khrjiZEmkBXWLwm42yCSCH46fMw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.9.0.tgz", + "integrity": "sha512-QKnFNznRxmbOF1hDgzpqrlIf6NC5sbZ2OJ+5Wl3OX8uM+LUJXbj4TXvLJCtwbPTmbMHCLIz6JLKNinNsMShK9g==", "dev": true, "dependencies": { "consola": "^3.2.3", - "defu": "^6.1.2", + "defu": "^6.1.3", "mime": "^3.0.0", - "node-fetch-native": "^1.4.0", + "node-fetch-native": "^1.6.1", "pathe": "^1.1.1" } }, @@ -23181,82 +24340,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/unstorage": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.9.0.tgz", - "integrity": "sha512-VpD8ZEYc/le8DZCrny3bnqKE4ZjioQxBRnWE+j5sGNvziPjeDlaS1NaFFHzl/kkXaO3r7UaF8MGQrs14+1B4pQ==", - "dev": true, - "dependencies": { - "anymatch": "^3.1.3", - "chokidar": "^3.5.3", - "destr": "^2.0.1", - "h3": "^1.7.1", - "ioredis": "^5.3.2", - "listhen": "^1.2.2", - "lru-cache": "^10.0.0", - "mri": "^1.2.0", - "node-fetch-native": "^1.2.0", - "ofetch": "^1.1.1", - "ufo": "^1.2.0" - }, - "peerDependencies": { - "@azure/app-configuration": "^1.4.1", - "@azure/cosmos": "^3.17.3", - "@azure/data-tables": "^13.2.2", - "@azure/identity": "^3.2.3", - "@azure/keyvault-secrets": "^4.7.0", - "@azure/storage-blob": "^12.14.0", - "@capacitor/preferences": "^5.0.0", - "@planetscale/database": "^1.8.0", - "@upstash/redis": "^1.22.0", - "@vercel/kv": "^0.2.2", - "idb-keyval": "^6.2.1" - }, - "peerDependenciesMeta": { - "@azure/app-configuration": { - "optional": true - }, - "@azure/cosmos": { - "optional": true - }, - "@azure/data-tables": { - "optional": true - }, - "@azure/identity": { - "optional": true - }, - "@azure/keyvault-secrets": { - "optional": true - }, - "@azure/storage-blob": { - "optional": true - }, - "@capacitor/preferences": { - "optional": true - }, - "@planetscale/database": { - "optional": true - }, - "@upstash/redis": { - "optional": true - }, - "@vercel/kv": { - "optional": true - }, - "idb-keyval": { - "optional": true - } - } - }, - "node_modules/netlify-cli/node_modules/unstorage/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/netlify-cli/node_modules/untildify": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", @@ -23267,12 +24350,12 @@ } }, "node_modules/netlify-cli/node_modules/untun": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.2.tgz", - "integrity": "sha512-wLAMWvxfqyTiBODA1lg3IXHQtjggYLeTK7RnSfqtOXixWJ3bAa2kK/HHmOOg19upteqO3muLvN6O/icbyQY33Q==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/untun/-/untun-0.1.3.tgz", + "integrity": "sha512-4luGP9LMYszMRZwsvyUd9MrxgEGZdZuZgpVQHEEX0lCYFESasVRvZd0EYpCkOIbJKHMuv0LskpXc/8Un+MJzEQ==", "dev": true, "dependencies": { - "citty": "^0.1.3", + "citty": "^0.1.5", "consola": "^3.2.3", "pathe": "^1.1.1" }, @@ -27409,12 +28492,12 @@ } }, "node_modules/playwright": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.0.tgz", - "integrity": "sha512-Ko7YRUgj5xBHbntrgt4EIw/nE//XBHOKVKnBjO1KuZkmkhlbgyggTe5s9hjqQ1LpN+Xg+kHsQyt5Pa0Bw5XpvQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", + "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", "dev": true, "dependencies": { - "playwright-core": "1.42.0" + "playwright-core": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -27427,9 +28510,9 @@ } }, "node_modules/playwright-core": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.0.tgz", - "integrity": "sha512-0HD9y8qEVlcbsAjdpBaFjmaTHf+1FeIddy8VJLeiqwhcNqGCBe4Wp2e8knpqiYbzxtxarxiXyNDw2cG8sCaNMQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", + "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 5901af2..61faab6 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.42.0", + "@playwright/test": "1.42.1", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.1.2", + "@testing-library/react": "14.2.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.20", + "@types/node": "20.11.25", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.17.1", + "netlify-cli": "17.19.0", "shx": "0.3.4", "vitest": "1.3.1" }, From ab48394369123497b8b69e0cba660ea0a35e56c7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 01:49:58 +0000 Subject: [PATCH 13/26] chore(deps): update devdependencies-non-major --- package-lock.json | 627 +++++++++++++++++++++------------------------- package.json | 8 +- 2 files changed, 293 insertions(+), 342 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8376d6c..5d8280a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,14 +26,14 @@ "devDependencies": { "@playwright/test": "1.42.1", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.2.1", + "@testing-library/react": "14.2.2", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.25", + "@types/node": "20.11.30", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.19.0", + "netlify-cli": "17.20.1", "shx": "0.3.4", - "vitest": "1.3.1" + "vitest": "1.4.0" } }, "node_modules/@ampproject/remapping": { @@ -2468,9 +2468,9 @@ } }, "node_modules/@testing-library/react": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.1.tgz", - "integrity": "sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A==", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.2.tgz", + "integrity": "sha512-SOUuM2ysCvjUWBXTNfQ/ztmnKDmqaiPV3SvoIuyxMUca45rbSWWAT/qB8CUs/JQ/ux/8JFs9DNdFQ3f6jH3crA==", "dev": true, "dependencies": { "@babel/runtime": "^7.12.5", @@ -2591,9 +2591,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "version": "20.11.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", + "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2667,13 +2667,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", - "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", + "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", "dev": true, "dependencies": { - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", "chai": "^4.3.10" }, "funding": { @@ -2681,12 +2681,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", - "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", + "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", "dev": true, "dependencies": { - "@vitest/utils": "1.3.1", + "@vitest/utils": "1.4.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2695,9 +2695,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", - "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", + "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2741,9 +2741,9 @@ "dev": true }, "node_modules/@vitest/spy": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", - "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", + "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2753,9 +2753,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", - "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -7836,17 +7836,17 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.19.0", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.19.0.tgz", - "integrity": "sha512-lz4RwFjprW4blAvEe0yZ43TYJJKOigOuo4830d057HoSR2LZ2AJdG/ZzJgkbzAagvo/Ut/VbuQVbrx+5x/385w==", + "version": "17.20.1", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.20.1.tgz", + "integrity": "sha512-Hj71m61PGteCk27t8y3O0y8JqFmMuPCitbVfDK1V/Ro+U6zUDsVQUFO3v4sEeoB8s/QOLhXZn/2NHu/sBUlDNQ==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "dependencies": { "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", - "@netlify/blobs": "7.0.0", - "@netlify/build": "29.36.1", + "@netlify/blobs": "7.0.1", + "@netlify/build": "29.36.3", "@netlify/build-info": "7.13.0", "@netlify/config": "20.12.1", "@netlify/edge-bundler": "11.3.0", @@ -7880,7 +7880,7 @@ "envinfo": "7.8.1", "etag": "1.8.1", "execa": "5.1.1", - "express": "4.18.2", + "express": "4.19.1", "express-logging": "1.1.1", "extract-zip": "2.0.1", "fastest-levenshtein": "1.0.16", @@ -7907,7 +7907,7 @@ "is-wsl": "2.2.0", "isexe": "2.0.0", "js-yaml": "4.1.0", - "jsonwebtoken": "9.0.1", + "jsonwebtoken": "9.0.2", "jwt-decode": "3.1.2", "lambda-local": "2.1.2", "listr2": "7.0.2", @@ -7933,7 +7933,7 @@ "prettyjson": "1.2.5", "pump": "3.0.0", "raw-body": "2.5.2", - "read-pkg-up": "9.1.0", + "read-package-up": "11.0.0", "semver": "7.5.4", "source-map-support": "0.5.21", "strip-ansi-control-characters": "2.0.0", @@ -9027,25 +9027,25 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.0.0.tgz", - "integrity": "sha512-JHYlZzF7LNRSZv8vDoChpEtrfe/P9m+GoWkllWsy6Pn68ZWRB2FcDdXjvqq3i9psbf3BLVEECmvxYbdYDhlIGQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.0.1.tgz", + "integrity": "sha512-TPx1QzdPcrtBLFXDsv+BOJg5ip/g4trKaot1MZIUV/uI6H0Islg3gU4AGuH5hAMZOr6VlRLWicFhGX7ihLz4eg==", "dev": true, "engines": { "node": "^14.16.0 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.36.1", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.36.1.tgz", - "integrity": "sha512-S+zQbdw7Np4NesLK3kA1BzmNK8oijNZ13y2kknJdGLyQbz+bQxU0iMIuMyFca+6LtGPPonCFlWPz+cKe9G0/Mw==", + "version": "29.36.3", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.36.3.tgz", + "integrity": "sha512-WLJB98MVt1jfHuUZq3dg2RvqbThTtbrs/0zOyjFq0b3TVMic7CyOnVfDOz78pfwLwbojZM0PW+AVBh5hHkRJVA==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^6.5.0", "@netlify/cache-utils": "^5.1.5", "@netlify/config": "^20.12.1", - "@netlify/edge-bundler": "11.2.2", + "@netlify/edge-bundler": "11.3.0", "@netlify/framework-info": "^9.8.10", "@netlify/functions-utils": "^5.2.51", "@netlify/git-utils": "^5.1.1", @@ -9107,7 +9107,7 @@ "node": "^14.16.0 || >=16.0.0" }, "peerDependencies": { - "@netlify/opentelemetry-sdk-setup": "^1.0.3" + "@netlify/opentelemetry-sdk-setup": "^1.0.4" }, "peerDependenciesMeta": { "@netlify/opentelemetry-sdk-setup": { @@ -9210,109 +9210,6 @@ "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.2.2.tgz", - "integrity": "sha512-RrRmM/bSl9K5InIJS9BbpY89Y7Y+83DoOoKR1/PE3gy7b9FONm8Cry9/YC4y+tUUWLuUo4dgt8+/Pw0uGFyI+g==", - "dev": true, - "dependencies": { - "@import-maps/resolve": "^1.0.1", - "@vercel/nft": "^0.26.0", - "ajv": "^8.11.2", - "ajv-errors": "^3.0.0", - "better-ajv-errors": "^1.2.0", - "common-path-prefix": "^3.0.0", - "env-paths": "^3.0.0", - "esbuild": "0.19.11", - "execa": "^6.0.0", - "find-up": "^6.3.0", - "get-package-name": "^2.2.0", - "get-port": "^6.1.2", - "is-path-inside": "^4.0.0", - "jsonc-parser": "^3.2.0", - "node-fetch": "^3.1.1", - "node-stream-zip": "^1.15.0", - "p-retry": "^5.1.1", - "p-wait-for": "^4.1.0", - "path-key": "^4.0.0", - "regexp-tree": "^0.1.24", - "semver": "^7.3.8", - "tmp-promise": "^3.0.3", - "urlpattern-polyfill": "8.0.2", - "uuid": "^9.0.0" - }, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.26.4", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.4.tgz", - "integrity": "sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==", - "dev": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "acorn-import-attributes": "^1.9.2", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it": { "version": "9.29.2", "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", @@ -9399,31 +9296,6 @@ "node": ">=14.16" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/ajv-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", - "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", - "dev": true, - "peerDependencies": { - "ajv": "^8.0.1" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -9517,18 +9389,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/get-port": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", - "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -9631,12 +9491,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/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==", - "dev": true - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -9707,9 +9561,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", "dev": true, "engines": { "node": ">=14.16" @@ -9719,9 +9573,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "dependencies": { "path-key": "^4.0.0" @@ -9799,33 +9653,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-wait-for": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", - "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", - "dev": true, - "dependencies": { - "p-timeout": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -12625,9 +12452,9 @@ } }, "node_modules/netlify-cli/node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, "node_modules/netlify-cli/node_modules/@types/qs": { @@ -13791,85 +13618,6 @@ "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", "dev": true }, - "node_modules/netlify-cli/node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/body-parser/node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/netlify-cli/node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -16315,17 +16063,17 @@ } }, "node_modules/netlify-cli/node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.1.tgz", + "integrity": "sha512-K4w1/Bp7y8iSiVObmCrtq8Cs79XjJc/RU2YYkZQ7wpUu5ZyZ7MtPHkqoMz4pf+mgXfNvo2qft8D9OnrH2ABk9w==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -16368,6 +16116,39 @@ "node": ">= 0.10.26" } }, + "node_modules/netlify-cli/node_modules/express/node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/netlify-cli/node_modules/express/node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/netlify-cli/node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -17269,6 +17050,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/find-up-simple": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/find-up/node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -18167,6 +17960,18 @@ "node": ">=0.8.19" } }, + "node_modules/netlify-cli/node_modules/index-to-position": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -19216,15 +19021,21 @@ } }, "node_modules/netlify-cli/node_modules/jsonwebtoken": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.1.tgz", - "integrity": "sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", "dev": true, "dependencies": { "jws": "^3.2.2", - "lodash": "^4.17.21", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", "ms": "^2.1.1", - "semver": "^7.3.8" + "semver": "^7.5.4" }, "engines": { "node": ">=12", @@ -19626,24 +19437,60 @@ "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", "dev": true }, + "node_modules/netlify-cli/node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", "dev": true }, + "node_modules/netlify-cli/node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lodash.isempty": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", "dev": true }, + "node_modules/netlify-cli/node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", "dev": true }, + "node_modules/netlify-cli/node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lodash.transform": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", @@ -22090,6 +21937,107 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true }, + "node_modules/netlify-cli/node_modules/read-package-up": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-11.0.0.tgz", + "integrity": "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==", + "dev": true, + "dependencies": { + "find-up-simple": "^1.0.0", + "read-pkg": "^9.0.0", + "type-fest": "^4.6.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-package-up/node_modules/hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/read-package-up/node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/netlify-cli/node_modules/read-package-up/node_modules/normalize-package-data": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/netlify-cli/node_modules/read-package-up/node_modules/parse-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "index-to-position": "^0.1.2", + "type-fest": "^4.7.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-package-up/node_modules/read-pkg": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.3", + "normalize-package-data": "^6.0.0", + "parse-json": "^8.0.0", + "type-fest": "^4.6.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-package-up/node_modules/type-fest": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.12.0.tgz", + "integrity": "sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/read-pkg-up": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", @@ -22261,15 +22209,6 @@ "ret": "~0.1.10" } }, - "node_modules/netlify-cli/node_modules/regexp-tree": { - "version": "0.1.24", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz", - "integrity": "sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==", - "dev": true, - "bin": { - "regexp-tree": "bin/regexp-tree" - } - }, "node_modules/netlify-cli/node_modules/registry-auth-token": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", @@ -24199,6 +24138,18 @@ "node": ">=10.0.0" } }, + "node_modules/netlify-cli/node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -31327,9 +31278,9 @@ } }, "node_modules/vite-node": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", - "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", + "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -31362,16 +31313,16 @@ } }, "node_modules/vitest": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", - "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", + "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", "dev": true, "dependencies": { - "@vitest/expect": "1.3.1", - "@vitest/runner": "1.3.1", - "@vitest/snapshot": "1.3.1", - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", + "@vitest/expect": "1.4.0", + "@vitest/runner": "1.4.0", + "@vitest/snapshot": "1.4.0", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -31385,7 +31336,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.3.1", + "vite-node": "1.4.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -31400,8 +31351,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.3.1", - "@vitest/ui": "1.3.1", + "@vitest/browser": "1.4.0", + "@vitest/ui": "1.4.0", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index 61faab6..9d0b02f 100644 --- a/package.json +++ b/package.json @@ -35,14 +35,14 @@ "devDependencies": { "@playwright/test": "1.42.1", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.2.1", + "@testing-library/react": "14.2.2", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.25", + "@types/node": "20.11.30", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.19.0", + "netlify-cli": "17.20.1", "shx": "0.3.4", - "vitest": "1.3.1" + "vitest": "1.4.0" }, "prettier": { "tabWidth": 2, From 7d5b250e7f14f0556b41aeaa9de01e097f988343 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 00:54:44 +0000 Subject: [PATCH 14/26] chore(deps): update devdependencies-non-major --- package-lock.json | 505 ++++++++-------------------------------------- package.json | 6 +- 2 files changed, 87 insertions(+), 424 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5d8280a..dd5d8d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.42.1", + "@playwright/test": "1.43.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.2.2", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.30", + "@types/node": "20.12.5", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.20.1", + "netlify-cli": "17.21.2", "shx": "0.3.4", "vitest": "1.4.0" } @@ -1813,12 +1813,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", - "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.0.tgz", + "integrity": "sha512-Ebw0+MCqoYflop7wVKj711ccbNlrwTBCtjY5rlbiY9kHL2bCYxq+qltK6uPsVBGGAOb033H2VO0YobcQVxoW7Q==", "dev": true, "dependencies": { - "playwright": "1.42.1" + "playwright": "1.43.0" }, "bin": { "playwright": "cli.js" @@ -2591,9 +2591,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.11.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", - "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", + "version": "20.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", + "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -7836,24 +7836,25 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.20.1", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.20.1.tgz", - "integrity": "sha512-Hj71m61PGteCk27t8y3O0y8JqFmMuPCitbVfDK1V/Ro+U6zUDsVQUFO3v4sEeoB8s/QOLhXZn/2NHu/sBUlDNQ==", + "version": "17.21.2", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.21.2.tgz", + "integrity": "sha512-St125NfR3N+PVbWa5736rlJszG9YhxznDhU3xhZvjRkGimr2CkKSs5mDhc2c7f7/aOlke5v/SedK0bszRbkgJw==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "dependencies": { "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", - "@netlify/blobs": "7.0.1", - "@netlify/build": "29.36.3", - "@netlify/build-info": "7.13.0", + "@netlify/blobs": "7.3.0", + "@netlify/build": "29.39.0", + "@netlify/build-info": "7.13.2", "@netlify/config": "20.12.1", "@netlify/edge-bundler": "11.3.0", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.30.0", + "@netlify/zip-it-and-ship-it": "9.31.1", "@octokit/rest": "19.0.13", - "ansi-escapes": "6.2.0", + "@opentelemetry/api": "1.8.0", + "ansi-escapes": "6.2.1", "ansi-styles": "6.2.1", "ansi-to-html": "0.7.2", "ascii-table": "0.0.9", @@ -7880,7 +7881,7 @@ "envinfo": "7.8.1", "etag": "1.8.1", "execa": "5.1.1", - "express": "4.19.1", + "express": "4.19.2", "express-logging": "1.1.1", "extract-zip": "2.0.1", "fastest-levenshtein": "1.0.16", @@ -9027,33 +9028,32 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.0.1.tgz", - "integrity": "sha512-TPx1QzdPcrtBLFXDsv+BOJg5ip/g4trKaot1MZIUV/uI6H0Islg3gU4AGuH5hAMZOr6VlRLWicFhGX7ihLz4eg==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.3.0.tgz", + "integrity": "sha512-wN/kNTZo4xjlUM/C0WILOkJbe8p4AFquSGkZEIoIcgnsx5ikp2GyqGiq1WMLee7QdbnqeIV2g2hn/PjT324E5w==", "dev": true, "engines": { "node": "^14.16.0 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.36.3", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.36.3.tgz", - "integrity": "sha512-WLJB98MVt1jfHuUZq3dg2RvqbThTtbrs/0zOyjFq0b3TVMic7CyOnVfDOz78pfwLwbojZM0PW+AVBh5hHkRJVA==", + "version": "29.39.0", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.39.0.tgz", + "integrity": "sha512-VbPHFGm3fojWakBr94e8qBb0SlxeRaAfZMWK4gqKFbXV0ANLTNWsyh4TFPDRHlfY79LFcUZ9WKc7/SpHa4FhGg==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", - "@netlify/blobs": "^6.5.0", + "@netlify/blobs": "^7.3.0", "@netlify/cache-utils": "^5.1.5", "@netlify/config": "^20.12.1", "@netlify/edge-bundler": "11.3.0", - "@netlify/framework-info": "^9.8.10", - "@netlify/functions-utils": "^5.2.51", + "@netlify/framework-info": "^9.8.11", + "@netlify/functions-utils": "^5.2.53", "@netlify/git-utils": "^5.1.1", - "@netlify/opentelemetry-utils": "^1.0.2", - "@netlify/plugins-list": "^6.75.0", + "@netlify/opentelemetry-utils": "^1.1.0", + "@netlify/plugins-list": "^6.77.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.29.2", - "@opentelemetry/api": "~1.7.0", + "@netlify/zip-it-and-ship-it": "9.31.1", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9107,7 +9107,8 @@ "node": "^14.16.0 || >=16.0.0" }, "peerDependencies": { - "@netlify/opentelemetry-sdk-setup": "^1.0.4" + "@netlify/opentelemetry-sdk-setup": "^1.1.0", + "@opentelemetry/api": "~1.8.0" }, "peerDependenciesMeta": { "@netlify/opentelemetry-sdk-setup": { @@ -9116,9 +9117,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.13.0.tgz", - "integrity": "sha512-rVwq9HGp72mLjSzmyHXMwmKBtArbZYdvLMnqIdiTOVJDOC7nL8mce1JQhHC4DI0dNe/3k3xfzceeKPeeNY993A==", + "version": "7.13.2", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.13.2.tgz", + "integrity": "sha512-smzhIgcms6Z/v2cct90l8ncBbnA5kvknj5/quhwyM6UHUycgMKFlA22qkB0KLj9shwL1Lkh7iQW751JwhSaP9g==", "dev": true, "dependencies": { "@bugsnag/js": "^7.20.0", @@ -9193,83 +9194,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/blobs": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.5.0.tgz", - "integrity": "sha512-wRFlNnL/Qv3WNLZd3OT/YYqF1zb6iPSo8T31sl9ccL1ahBxW1fBqKgF4b1XL7Z+6mRIkatvcsVPkWBcO+oJMNA==", - "dev": true, - "engines": { - "node": "^14.16.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.29.2", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", - "integrity": "sha512-9o/4lsFWuyPpe38Rhk/00JyccKSBRGM9Av3DINnh/QrpTeIC6esfJsaJNQ4JQ+gU4XXAwxPY9Uk+16WMPs/zkg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", + "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", "dev": true, - "dependencies": { - "@babel/parser": "^7.22.5", - "@babel/types": "7.23.6", - "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.14.0", - "@vercel/nft": "^0.23.0", - "archiver": "^6.0.0", - "common-path-prefix": "^3.0.0", - "cp-file": "^10.0.0", - "es-module-lexer": "^1.0.0", - "esbuild": "0.19.11", - "execa": "^6.0.0", - "fast-glob": "^3.3.2", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "glob": "^8.0.3", - "is-builtin-module": "^3.1.0", - "is-path-inside": "^4.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "merge-options": "^3.0.4", - "minimatch": "^9.0.0", - "normalize-path": "^3.0.0", - "p-map": "^5.0.0", - "path-exists": "^5.0.0", - "precinct": "^11.0.0", - "require-package-name": "^2.0.1", - "resolve": "^2.0.0-next.1", - "semver": "^7.3.8", - "tmp-promise": "^3.0.2", - "toml": "^3.0.0", - "unixify": "^1.0.0", - "urlpattern-polyfill": "8.0.2", - "yargs": "^17.0.0" - }, "bin": { - "zip-it-and-ship-it": "dist/bin.js" + "yaml": "bin.mjs" }, "engines": { - "node": "^14.18.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/node_modules/p-map": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", - "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", - "dev": true, - "dependencies": { - "aggregate-error": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 14" } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { @@ -9296,15 +9229,6 @@ "node": ">=14.16" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -9389,37 +9313,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { "version": "12.6.1", "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", @@ -9479,18 +9372,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -9527,21 +9408,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", @@ -10681,9 +10547,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/framework-info": { - "version": "9.8.10", - "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.10.tgz", - "integrity": "sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==", + "version": "9.8.11", + "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.11.tgz", + "integrity": "sha512-8NuvzQQVeU36PRilWqijiIWmjy6JZcqbKooGQ4bNgH/26YNdS+tN5gOWGWVYnRHgdmBUCycyYrM5h1Srwnq3hQ==", "dev": true, "dependencies": { "ajv": "^8.12.0", @@ -10766,12 +10632,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.51", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.51.tgz", - "integrity": "sha512-A4XLQOE2pfcOHcCTs97G6FDVQg20zGoROCAZcpnNd8bMvBDDVgziC/xoFxm4xGC36u0YogSECsLoIbSKSxLloA==", + "version": "5.2.53", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.53.tgz", + "integrity": "sha512-mIUKmLgZgXp2kSut2X1FrKelhZFYxHzk27FdpqnjhkAlKA8trjoFJ0vOODJejddGFKNGDBYM3SEbTb82JBassg==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.29.2", + "@netlify/zip-it-and-ship-it": "9.31.1", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10779,182 +10645,6 @@ "node": "^14.16.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.29.2", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.29.2.tgz", - "integrity": "sha512-9o/4lsFWuyPpe38Rhk/00JyccKSBRGM9Av3DINnh/QrpTeIC6esfJsaJNQ4JQ+gU4XXAwxPY9Uk+16WMPs/zkg==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.22.5", - "@babel/types": "7.23.6", - "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.14.0", - "@vercel/nft": "^0.23.0", - "archiver": "^6.0.0", - "common-path-prefix": "^3.0.0", - "cp-file": "^10.0.0", - "es-module-lexer": "^1.0.0", - "esbuild": "0.19.11", - "execa": "^6.0.0", - "fast-glob": "^3.3.2", - "filter-obj": "^5.0.0", - "find-up": "^6.0.0", - "glob": "^8.0.3", - "is-builtin-module": "^3.1.0", - "is-path-inside": "^4.0.0", - "junk": "^4.0.0", - "locate-path": "^7.0.0", - "merge-options": "^3.0.4", - "minimatch": "^9.0.0", - "normalize-path": "^3.0.0", - "p-map": "^5.0.0", - "path-exists": "^5.0.0", - "precinct": "^11.0.0", - "require-package-name": "^2.0.1", - "resolve": "^2.0.0-next.1", - "semver": "^7.3.8", - "tmp-promise": "^3.0.2", - "toml": "^3.0.0", - "unixify": "^1.0.0", - "urlpattern-polyfill": "8.0.2", - "yargs": "^17.0.0" - }, - "bin": { - "zip-it-and-ship-it": "dist/bin.js" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -10964,18 +10654,6 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/functions-utils/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/git-utils": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@netlify/git-utils/-/git-utils-5.1.1.tgz", @@ -11318,21 +10996,21 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/opentelemetry-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.0.2.tgz", - "integrity": "sha512-GeY5z/Af7q7DMSmJbJtrtKQaHCsw/XPdJwnryv/CqRpvg7z6rpGVH6V1UTck1Fe8BVQuB20mrb6qr4MZsAAiyg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.1.0.tgz", + "integrity": "sha512-VpjyInWRdreD0lPqTmWlxROfjF5mFHo99y9r21v/TvRmPniUbvEeFrtPgbA1VsiXt0YcHXZ9jUi/PrsLjQ5vPg==", "dev": true, - "dependencies": { - "@opentelemetry/api": "~1.7.0" - }, "engines": { "node": ">=18.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "~1.8.0" } }, "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { - "version": "6.75.0", - "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.75.0.tgz", - "integrity": "sha512-xH5UWc6v6oOu53kaNhJI6o0vESVECoGBjD5hW5nmjFaIkEJFDfbtHj/gSQ2hCcwIzTlGYRGIyGVBMY+e7ki6bw==", + "version": "6.77.0", + "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.77.0.tgz", + "integrity": "sha512-czL3FH61hFhhVQydRj2xjIwLVYHDNskMhRib7dUfOQrUHifqLlUFKp03NwBD87G9BFKXUYGWZMEUU+JjIpVc9w==", "dev": true, "engines": { "node": "^14.14.0 || >=16.0.0" @@ -11425,9 +11103,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.14.0.tgz", - "integrity": "sha512-HUNETLNvNiC2J+SB/YuRwJA9+agPrc0azSoWVk8H85GC+YE114hcS5JW+dstpKwVerp2xILE3vNWN7IMXP5Q5Q==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.16.0.tgz", + "integrity": "sha512-n45TXwMm09zvI6ClQQS80cJT/5JXLsxY74sxpcLZS3ity0Bh0qzanjGthFYUFbVwL7LGfuJExyavKjtRnVEMFw==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", @@ -11438,15 +11116,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.30.0", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.30.0.tgz", - "integrity": "sha512-R0v1/vDjjizB4em4YvigqIRj4ZAdcp18svajvcDp6OhB6pt76LZ/RlPEEPq4sGfpQRUpdmapNdnQDNHHReyXug==", + "version": "9.31.1", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.31.1.tgz", + "integrity": "sha512-vBgclVWQbFlVisD/VUFL2k2qUbmYY0elMTSiEr/JuM966cQT9G4yeCs9kkbgnpNuDCFztdO01r8xrm9F7PywRQ==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", "@babel/types": "7.23.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.14.0", + "@netlify/serverless-functions-api": "^1.16.0", "@vercel/nft": "^0.23.0", "archiver": "^6.0.0", "common-path-prefix": "^3.0.0", @@ -11569,9 +11247,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -11881,9 +11559,9 @@ } }, "node_modules/netlify-cli/node_modules/@opentelemetry/api": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", - "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", + "integrity": "sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==", "dev": true, "engines": { "node": ">=8.0.0" @@ -13090,13 +12768,10 @@ } }, "node_modules/netlify-cli/node_modules/ansi-escapes": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", - "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", + "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", "dev": true, - "dependencies": { - "type-fest": "^3.0.0" - }, "engines": { "node": ">=14.16" }, @@ -16063,9 +15738,9 @@ } }, "node_modules/netlify-cli/node_modules/express": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.1.tgz", - "integrity": "sha512-K4w1/Bp7y8iSiVObmCrtq8Cs79XjJc/RU2YYkZQ7wpUu5ZyZ7MtPHkqoMz4pf+mgXfNvo2qft8D9OnrH2ABk9w==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dev": true, "dependencies": { "accepts": "~1.3.8", @@ -24017,18 +23692,6 @@ "node": "*" } }, - "node_modules/netlify-cli/node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -28443,12 +28106,12 @@ } }, "node_modules/playwright": { - "version": "1.42.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", - "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0.tgz", + "integrity": "sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==", "dev": true, "dependencies": { - "playwright-core": "1.42.1" + "playwright-core": "1.43.0" }, "bin": { "playwright": "cli.js" @@ -28461,9 +28124,9 @@ } }, "node_modules/playwright-core": { - "version": "1.42.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", - "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.0.tgz", + "integrity": "sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 9d0b02f..424c725 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.42.1", + "@playwright/test": "1.43.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.2.2", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.11.30", + "@types/node": "20.12.5", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.20.1", + "netlify-cli": "17.21.2", "shx": "0.3.4", "vitest": "1.4.0" }, From 18936599bf289b71d7d834d800ee4e85ff40eccd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 00:02:49 +0000 Subject: [PATCH 15/26] chore(deps): update devdependencies-non-major --- package-lock.json | 447 +++++++++++++++++++++++++--------------------- package.json | 10 +- 2 files changed, 252 insertions(+), 205 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd5d8d9..bec6bca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,16 +24,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.43.0", + "@playwright/test": "1.43.1", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.2.2", + "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.12.5", + "@types/node": "20.12.7", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.21.2", + "netlify-cli": "17.22.1", "shx": "0.3.4", - "vitest": "1.4.0" + "vitest": "1.5.0" } }, "node_modules/@ampproject/remapping": { @@ -1813,12 +1813,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.0.tgz", - "integrity": "sha512-Ebw0+MCqoYflop7wVKj711ccbNlrwTBCtjY5rlbiY9kHL2bCYxq+qltK6uPsVBGGAOb033H2VO0YobcQVxoW7Q==", + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.1.tgz", + "integrity": "sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA==", "dev": true, "dependencies": { - "playwright": "1.43.0" + "playwright": "1.43.1" }, "bin": { "playwright": "cli.js" @@ -2468,9 +2468,9 @@ } }, "node_modules/@testing-library/react": { - "version": "14.2.2", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.2.tgz", - "integrity": "sha512-SOUuM2ysCvjUWBXTNfQ/ztmnKDmqaiPV3SvoIuyxMUca45rbSWWAT/qB8CUs/JQ/ux/8JFs9DNdFQ3f6jH3crA==", + "version": "14.3.1", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.3.1.tgz", + "integrity": "sha512-H99XjUhWQw0lTgyMN05W3xQG1Nh4lq574D8keFf1dDoNTJgp66VbJozRaczoF+wsiaPJNt/TcnfpLGufGxSrZQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.12.5", @@ -2591,9 +2591,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.12.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", - "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2667,13 +2667,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", - "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.0.tgz", + "integrity": "sha512-0pzuCI6KYi2SIC3LQezmxujU9RK/vwC1U9R0rLuGlNGcOuDWxqWKu6nUdFsX9tH1WU0SXtAxToOsEjeUn1s3hA==", "dev": true, "dependencies": { - "@vitest/spy": "1.4.0", - "@vitest/utils": "1.4.0", + "@vitest/spy": "1.5.0", + "@vitest/utils": "1.5.0", "chai": "^4.3.10" }, "funding": { @@ -2681,12 +2681,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", - "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.5.0.tgz", + "integrity": "sha512-7HWwdxXP5yDoe7DTpbif9l6ZmDwCzcSIK38kTSIt6CFEpMjX4EpCgT6wUmS0xTXqMI6E/ONmfgRKmaujpabjZQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.4.0", + "@vitest/utils": "1.5.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2695,9 +2695,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", - "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.5.0.tgz", + "integrity": "sha512-qpv3fSEuNrhAO3FpH6YYRdaECnnRjg9VxbhdtPwPRnzSfHVXnNzzrpX4cJxqiwgRMo7uRMWDFBlsBq4Cr+rO3A==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2741,9 +2741,9 @@ "dev": true }, "node_modules/@vitest/spy": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", - "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.5.0.tgz", + "integrity": "sha512-vu6vi6ew5N5MMHJjD5PoakMRKYdmIrNJmyfkhRpQt5d9Ewhw9nZ5Aqynbi3N61bvk9UvZ5UysMT6ayIrZ8GA9w==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2753,9 +2753,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", - "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.5.0.tgz", + "integrity": "sha512-BDU0GNL8MWkRkSRdNFvCUCAVOeHaUlVJ9Tx0TYBZyXaaOTmGtUFObzchCivIBrIwKzvZA7A9sCejVhXM2aY98A==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -7836,9 +7836,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.21.2", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.21.2.tgz", - "integrity": "sha512-St125NfR3N+PVbWa5736rlJszG9YhxznDhU3xhZvjRkGimr2CkKSs5mDhc2c7f7/aOlke5v/SedK0bszRbkgJw==", + "version": "17.22.1", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.22.1.tgz", + "integrity": "sha512-76ZvarNs85vNW/s6sJnMmwU39tx1rGkozMBUsx3of752gUAgr3T+BzAVB+/2DeDSbqQPlCKXfo2PuqqrhdeKew==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7846,12 +7846,13 @@ "@bugsnag/js": "7.20.2", "@fastify/static": "6.10.2", "@netlify/blobs": "7.3.0", - "@netlify/build": "29.39.0", + "@netlify/build": "29.39.1", "@netlify/build-info": "7.13.2", "@netlify/config": "20.12.1", "@netlify/edge-bundler": "11.3.0", + "@netlify/edge-functions": "2.5.1", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.31.1", + "@netlify/zip-it-and-ship-it": "9.31.3", "@octokit/rest": "19.0.13", "@opentelemetry/api": "1.8.0", "ansi-escapes": "6.2.1", @@ -9037,9 +9038,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.39.0", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.39.0.tgz", - "integrity": "sha512-VbPHFGm3fojWakBr94e8qBb0SlxeRaAfZMWK4gqKFbXV0ANLTNWsyh4TFPDRHlfY79LFcUZ9WKc7/SpHa4FhGg==", + "version": "29.39.1", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.39.1.tgz", + "integrity": "sha512-Pl6xb7CecEJEkUszylscT1f7FF+37xaIk+wz5ZL99TIhZ2D/3f0w+wm0knASTB90dvmDaL4IAfPTDMORzgMBIA==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", @@ -9048,12 +9049,12 @@ "@netlify/config": "^20.12.1", "@netlify/edge-bundler": "11.3.0", "@netlify/framework-info": "^9.8.11", - "@netlify/functions-utils": "^5.2.53", + "@netlify/functions-utils": "^5.2.54", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.1.0", "@netlify/plugins-list": "^6.77.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.31.1", + "@netlify/zip-it-and-ship-it": "9.31.3", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -10546,6 +10547,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/edge-functions": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-functions/-/edge-functions-2.5.1.tgz", + "integrity": "sha512-6YGlbzxPaSqc/D2LhP4T4PXrim/vRmqpO1RwQKqVod6WCWlkdtJcAd3mGoI7efrjfND8twh7TqXtL7RRCI23qA==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@netlify/framework-info": { "version": "9.8.11", "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.11.tgz", @@ -10632,12 +10639,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.53", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.53.tgz", - "integrity": "sha512-mIUKmLgZgXp2kSut2X1FrKelhZFYxHzk27FdpqnjhkAlKA8trjoFJ0vOODJejddGFKNGDBYM3SEbTb82JBassg==", + "version": "5.2.54", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.54.tgz", + "integrity": "sha512-QdYmIPC6NBp90MfuHWeNGqf1XdsRUcIIbcWnT2AK1g2By8ur8m28qGM99GlReRmprzC7ZT7YmwcHjUjaq24sRA==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.31.1", + "@netlify/zip-it-and-ship-it": "9.31.3", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -11103,9 +11110,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.16.0.tgz", - "integrity": "sha512-n45TXwMm09zvI6ClQQS80cJT/5JXLsxY74sxpcLZS3ity0Bh0qzanjGthFYUFbVwL7LGfuJExyavKjtRnVEMFw==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.16.2.tgz", + "integrity": "sha512-v28g91/bnvvFw+LO/ro/n766RhbWqB5UG2H73kwEUuSqlnLuO/tMgPh13vOeeIgjZcXZoulGn13g7eUs4j6Qpg==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", @@ -11116,15 +11123,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.31.1", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.31.1.tgz", - "integrity": "sha512-vBgclVWQbFlVisD/VUFL2k2qUbmYY0elMTSiEr/JuM966cQT9G4yeCs9kkbgnpNuDCFztdO01r8xrm9F7PywRQ==", + "version": "9.31.3", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.31.3.tgz", + "integrity": "sha512-cB8DE0pV90IYShytLcKyxZFy6aolKqSuFDMOKVL/svJ6hMQOVlngz5ZKcNRX4rQ2uHWHTe75tgTn6OqmelQYrw==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", "@babel/types": "7.23.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.16.0", + "@netlify/serverless-functions-api": "^1.16.2", "@vercel/nft": "^0.23.0", "archiver": "^6.0.0", "common-path-prefix": "^3.0.0", @@ -13293,6 +13300,70 @@ "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", "dev": true }, + "node_modules/netlify-cli/node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/netlify-cli/node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/netlify-cli/node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -15791,30 +15862,6 @@ "node": ">= 0.10.26" } }, - "node_modules/netlify-cli/node_modules/express/node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, "node_modules/netlify-cli/node_modules/express/node_modules/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", @@ -16193,30 +16240,6 @@ "integrity": "sha512-ovwFQG2qNy3jcCROiWpr94Hs0le+c7N/3t7m9aVwbFhkxcR/esp2xu25dP8e617HpQdmeDv+gFX4zagdUhDByw==", "dev": true }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino": { "version": "8.16.1", "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz", @@ -16239,16 +16262,6 @@ "pino": "bin.js" } }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-abstract-transport": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", - "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", - "dev": true, - "dependencies": { - "readable-stream": "^4.0.0", - "split2": "^4.0.0" - } - }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-std-serializers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", @@ -16261,69 +16274,6 @@ "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", "dev": true }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/readable-stream": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", - "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", - "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/sonic-boom": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.7.0.tgz", - "integrity": "sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==", - "dev": true, - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "dev": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/netlify-cli/node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -21147,6 +21097,94 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/netlify-cli/node_modules/pino-abstract-transport": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", + "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", + "dev": true, + "dependencies": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, + "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/netlify-cli/node_modules/pkg-types": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", @@ -22692,6 +22730,15 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, + "node_modules/netlify-cli/node_modules/sonic-boom": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.0.tgz", + "integrity": "sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==", + "dev": true, + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, "node_modules/netlify-cli/node_modules/sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", @@ -28106,12 +28153,12 @@ } }, "node_modules/playwright": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0.tgz", - "integrity": "sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==", + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.1.tgz", + "integrity": "sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA==", "dev": true, "dependencies": { - "playwright-core": "1.43.0" + "playwright-core": "1.43.1" }, "bin": { "playwright": "cli.js" @@ -28124,9 +28171,9 @@ } }, "node_modules/playwright-core": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.0.tgz", - "integrity": "sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==", + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.1.tgz", + "integrity": "sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -30402,9 +30449,9 @@ "dev": true }, "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "dev": true, "engines": { "node": ">=14.0.0" @@ -30941,9 +30988,9 @@ } }, "node_modules/vite-node": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", - "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.0.tgz", + "integrity": "sha512-tV8h6gMj6vPzVCa7l+VGq9lwoJjW8Y79vst8QZZGiuRAfijU+EEWuc0kFpmndQrWhMMhet1jdSF+40KSZUqIIw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -30976,16 +31023,16 @@ } }, "node_modules/vitest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", - "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.0.tgz", + "integrity": "sha512-d8UKgR0m2kjdxDWX6911uwxout6GHS0XaGH1cksSIVVG8kRlE7G7aBw7myKQCvDI5dT4j7ZMa+l706BIORMDLw==", "dev": true, "dependencies": { - "@vitest/expect": "1.4.0", - "@vitest/runner": "1.4.0", - "@vitest/snapshot": "1.4.0", - "@vitest/spy": "1.4.0", - "@vitest/utils": "1.4.0", + "@vitest/expect": "1.5.0", + "@vitest/runner": "1.5.0", + "@vitest/snapshot": "1.5.0", + "@vitest/spy": "1.5.0", + "@vitest/utils": "1.5.0", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -30997,9 +31044,9 @@ "std-env": "^3.5.0", "strip-literal": "^2.0.0", "tinybench": "^2.5.1", - "tinypool": "^0.8.2", + "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.4.0", + "vite-node": "1.5.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -31014,8 +31061,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.4.0", - "@vitest/ui": "1.4.0", + "@vitest/browser": "1.5.0", + "@vitest/ui": "1.5.0", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index 424c725..3b8c206 100644 --- a/package.json +++ b/package.json @@ -33,16 +33,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.43.0", + "@playwright/test": "1.43.1", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.2.2", + "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.12.5", + "@types/node": "20.12.7", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.21.2", + "netlify-cli": "17.22.1", "shx": "0.3.4", - "vitest": "1.4.0" + "vitest": "1.5.0" }, "prettier": { "tabWidth": 2, From ff2e45c6e573bd01ac85b7157fa7c4a2cb25c942 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 5 May 2024 22:41:40 +0000 Subject: [PATCH 16/26] chore(deps): update devdependencies-non-major --- package-lock.json | 826 ++++++++++++++++++++++++++++------------------ package.json | 6 +- 2 files changed, 504 insertions(+), 328 deletions(-) diff --git a/package-lock.json b/package-lock.json index bec6bca..e4c47bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,12 +28,12 @@ "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.12.7", + "@types/node": "20.12.8", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.22.1", + "netlify-cli": "17.23.1", "shx": "0.3.4", - "vitest": "1.5.0" + "vitest": "1.6.0" } }, "node_modules/@ampproject/remapping": { @@ -2591,9 +2591,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", - "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "version": "20.12.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.8.tgz", + "integrity": "sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w==", "devOptional": true, "dependencies": { "undici-types": "~5.26.4" @@ -2667,13 +2667,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.0.tgz", - "integrity": "sha512-0pzuCI6KYi2SIC3LQezmxujU9RK/vwC1U9R0rLuGlNGcOuDWxqWKu6nUdFsX9tH1WU0SXtAxToOsEjeUn1s3hA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.5.0", - "@vitest/utils": "1.5.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "chai": "^4.3.10" }, "funding": { @@ -2681,12 +2681,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.5.0.tgz", - "integrity": "sha512-7HWwdxXP5yDoe7DTpbif9l6ZmDwCzcSIK38kTSIt6CFEpMjX4EpCgT6wUmS0xTXqMI6E/ONmfgRKmaujpabjZQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", "dev": true, "dependencies": { - "@vitest/utils": "1.5.0", + "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2695,9 +2695,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.5.0.tgz", - "integrity": "sha512-qpv3fSEuNrhAO3FpH6YYRdaECnnRjg9VxbhdtPwPRnzSfHVXnNzzrpX4cJxqiwgRMo7uRMWDFBlsBq4Cr+rO3A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2741,9 +2741,9 @@ "dev": true }, "node_modules/@vitest/spy": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.5.0.tgz", - "integrity": "sha512-vu6vi6ew5N5MMHJjD5PoakMRKYdmIrNJmyfkhRpQt5d9Ewhw9nZ5Aqynbi3N61bvk9UvZ5UysMT6ayIrZ8GA9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2753,9 +2753,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.5.0.tgz", - "integrity": "sha512-BDU0GNL8MWkRkSRdNFvCUCAVOeHaUlVJ9Tx0TYBZyXaaOTmGtUFObzchCivIBrIwKzvZA7A9sCejVhXM2aY98A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -2794,9 +2794,9 @@ } }, "node_modules/@vitest/utils/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/@volar/kit": { @@ -7836,23 +7836,23 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.22.1", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.22.1.tgz", - "integrity": "sha512-76ZvarNs85vNW/s6sJnMmwU39tx1rGkozMBUsx3of752gUAgr3T+BzAVB+/2DeDSbqQPlCKXfo2PuqqrhdeKew==", + "version": "17.23.1", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.23.1.tgz", + "integrity": "sha512-MISg7qb1wVP0umvB0Tn6KhZUIB/HPph0w1OzzV4DP+Mm0MS+/t0wqzcYx0WJeLdJsLzywq2lfL2smttQz/6lwQ==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "dependencies": { - "@bugsnag/js": "7.20.2", - "@fastify/static": "6.10.2", + "@bugsnag/js": "7.22.7", + "@fastify/static": "6.12.0", "@netlify/blobs": "7.3.0", - "@netlify/build": "29.39.1", + "@netlify/build": "29.41.2", "@netlify/build-info": "7.13.2", - "@netlify/config": "20.12.1", - "@netlify/edge-bundler": "11.3.0", + "@netlify/config": "20.12.3", + "@netlify/edge-bundler": "12.0.0", "@netlify/edge-functions": "2.5.1", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.31.3", + "@netlify/zip-it-and-ship-it": "9.32.1", "@octokit/rest": "19.0.13", "@opentelemetry/api": "1.8.0", "ansi-escapes": "6.2.1", @@ -7900,7 +7900,7 @@ "hasha": "5.2.2", "http-proxy": "1.18.1", "http-proxy-middleware": "2.0.6", - "https-proxy-agent": "5.0.1", + "https-proxy-agent": "7.0.4", "inquirer": "6.5.2", "inquirer-autocomplete-prompt": "1.4.0", "ipx": "2.1.0", @@ -7918,7 +7918,7 @@ "log-symbols": "5.1.0", "log-update": "5.0.1", "multiparty": "4.2.3", - "netlify": "13.1.14", + "netlify": "13.1.15", "netlify-headers-parser": "7.1.4", "netlify-redirect-parser": "14.2.2", "netlify-redirector": "0.5.0", @@ -7936,7 +7936,7 @@ "pump": "3.0.0", "raw-body": "2.5.2", "read-package-up": "11.0.0", - "semver": "7.5.4", + "semver": "7.6.0", "source-map-support": "0.5.21", "strip-ansi-control-characters": "2.0.0", "tabtab": "3.0.2", @@ -7950,7 +7950,7 @@ "ulid": "2.3.0", "unixify": "1.0.0", "update-notifier": "6.0.2", - "uuid": "9.0.0", + "uuid": "9.0.1", "wait-port": "1.0.4", "write-file-atomic": "5.0.1", "ws": "8.14.2", @@ -8148,18 +8148,18 @@ } }, "node_modules/netlify-cli/node_modules/@bugsnag/browser": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz", - "integrity": "sha512-4J4s53ZpYr3hHA+QjxUjOI6U+A8+XuUVH45UshE87Jp2Y4mV8ML2DovejqJS8J8yjdbnh2z1Wtg/v3WUNt4ayQ==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.22.7.tgz", + "integrity": "sha512-70jFkWKscK2osm7bnFbPLevrzHClrygM3UcKetKs/l81Xuzlxnu1SS3onN5OUl9kd9RN4XMFr46Pv5jSqWqImQ==", "dev": true, "dependencies": { - "@bugsnag/core": "^7.19.0" + "@bugsnag/core": "^7.22.7" } }, "node_modules/netlify-cli/node_modules/@bugsnag/core": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.19.0.tgz", - "integrity": "sha512-2KGwdaLD9PhR7Wk7xPi3jGuGsKTatc/28U4TOZIDU3CgC2QhGjubwiXSECel5gwxhZ3jACKcMKSV2ovHhv1NrA==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.22.7.tgz", + "integrity": "sha512-9DPWBkkBjhFJc5dCFy/wVC3HE0Aw3ZiLJKjyAxgywSKbILgtpD+qT1Xe8sacWyxU92znamlZ8H8ziQOe7jhhbA==", "dev": true, "dependencies": { "@bugsnag/cuid": "^3.0.0", @@ -8170,28 +8170,28 @@ } }, "node_modules/netlify-cli/node_modules/@bugsnag/cuid": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.2.tgz", - "integrity": "sha512-cIwzC93r3PQ/INeuwtZwkZIG2K8WWN0rRLZQhu+mr48Ay+i6sEki4GYfTsflse7hZ1BeDWrNb/Q9vgY3B31xHQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.1.0.tgz", + "integrity": "sha512-U6vPVhFPLWLXQIGnmk/uPbyidB5xLVFfEdZDmmLbv41Be67re4mNsjMukHdUv669RXOWTDQNJ+bMODhuWpshkw==", "dev": true }, "node_modules/netlify-cli/node_modules/@bugsnag/js": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.20.2.tgz", - "integrity": "sha512-Q08k0h0h6NFwFGkFmib39Uln2WpvJdqT1EGF1JlyYiGW03Y+VopVb9r37pZrRrN9IY08mxaIEO8la5xeaWAs6A==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.22.7.tgz", + "integrity": "sha512-Qq8l06rSDTZtxgNIDpTeXHrin9C30INNbPfnR2CNcEsCmfqyVQb4USPEuRb0xg5wiaLKU9r4IAatMqiCgdzG6A==", "dev": true, "dependencies": { - "@bugsnag/browser": "^7.20.2", - "@bugsnag/node": "^7.19.0" + "@bugsnag/browser": "^7.22.7", + "@bugsnag/node": "^7.22.7" } }, "node_modules/netlify-cli/node_modules/@bugsnag/node": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.19.0.tgz", - "integrity": "sha512-c4snyxx5d/fsMogmgehFBGc//daH6+4XCplia4zrEQYltjaQ+l8ud0dPx623DgJl/2j1+2zlRc7y7IHSd7Gm5w==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.22.7.tgz", + "integrity": "sha512-Ud8vpX9UkGxoWAk7OigyR7w1eycbsE5uv5KZx0aWiqDPXylvICd42V5ZiWstpkdm9IVFo9AQ4+gmerHPe4Lwrg==", "dev": true, "dependencies": { - "@bugsnag/core": "^7.19.0", + "@bugsnag/core": "^7.22.7", "byline": "^5.0.0", "error-stack-parser": "^2.0.2", "iserror": "^0.0.2", @@ -8732,9 +8732,9 @@ } }, "node_modules/netlify-cli/node_modules/@fastify/static": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.10.2.tgz", - "integrity": "sha512-UoaMvIHSBLCZBYOVZwFRYqX2ufUhd7FFMYGDeSf0Z+D8jhYtwljjmuQGuanUP8kS4y/ZEV1a8mfLha3zNwsnnQ==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.12.0.tgz", + "integrity": "sha512-KK1B84E6QD/FcQWxDI2aiUCwHxMJBI1KeCUzm1BwYpPY1b742+jeKruGHP2uOluuM6OkBPI8CIANrXcCRtC2oQ==", "dev": true, "dependencies": { "@fastify/accept-negotiator": "^1.0.0", @@ -8742,8 +8742,7 @@ "content-disposition": "^0.5.3", "fastify-plugin": "^4.0.0", "glob": "^8.0.1", - "p-limit": "^3.1.0", - "readable-stream": "^4.0.0" + "p-limit": "^3.1.0" } }, "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { @@ -8755,30 +8754,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -8810,51 +8785,6 @@ "node": ">=10" } }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/readable-stream": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", - "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", - "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/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==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", @@ -9022,6 +8952,36 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/netlify-cli/node_modules/@mswjs/interceptors": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.27.2.tgz", + "integrity": "sha512-mE6PhwcoW70EX8+h+Y/4dLfHk33GFt/y5PzDJz56ktMyaVGFXMJ5BYLbUjdmGEABfE0x5GgAGyKbrbkYww2s3A==", + "dev": true, + "dependencies": { + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", + "outvariant": "^1.2.1", + "strict-event-emitter": "^0.5.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/netlify-cli/node_modules/@netlify/binary-info": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@netlify/binary-info/-/binary-info-1.0.0.tgz", @@ -9038,23 +8998,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.39.1", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.39.1.tgz", - "integrity": "sha512-Pl6xb7CecEJEkUszylscT1f7FF+37xaIk+wz5ZL99TIhZ2D/3f0w+wm0knASTB90dvmDaL4IAfPTDMORzgMBIA==", + "version": "29.41.2", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.41.2.tgz", + "integrity": "sha512-txcYS00PXfmfw9hIxc4Q5c8p4DLkaGqgX3yjGUH2y/2NXxJQxpZiZBBVYeVW5q0rwb+17trE2gQJ/xnOXo3O5Q==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^7.3.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.12.1", - "@netlify/edge-bundler": "11.3.0", + "@netlify/config": "^20.12.3", + "@netlify/edge-bundler": "12.0.0", "@netlify/framework-info": "^9.8.11", - "@netlify/functions-utils": "^5.2.54", + "@netlify/functions-utils": "^5.2.55", "@netlify/git-utils": "^5.1.1", - "@netlify/opentelemetry-utils": "^1.1.0", + "@netlify/opentelemetry-utils": "^1.2.0", "@netlify/plugins-list": "^6.77.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.31.3", + "@netlify/zip-it-and-ship-it": "9.32.1", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9073,6 +9033,7 @@ "log-process-errors": "^8.0.0", "map-obj": "^5.0.0", "memoize-one": "^6.0.0", + "minimatch": "^9.0.4", "node-fetch": "^3.3.2", "os-name": "^5.0.0", "p-event": "^5.0.0", @@ -9230,6 +9191,15 @@ "node": ">=14.16" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -9409,6 +9379,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", @@ -9672,9 +9657,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.12.1", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.12.1.tgz", - "integrity": "sha512-sziuaOA9XfeQjQf6Yru7S9k9xTMy9GAJSPJL02WFld0cFDA5dgDyAFLN34jedIbgl7jVV+g7Vb2nOJocfgibbg==", + "version": "20.12.3", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.12.3.tgz", + "integrity": "sha512-E+oiGEm6zIvyFJ2kQC1IV5Ipiv7Ar84RuP2K+aVMSgu/raOn7ZfN9lM5TC43qboF3bDrJd6EuYDxVIAuxVkMCA==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -9691,7 +9676,7 @@ "is-plain-obj": "^4.0.0", "js-yaml": "^4.0.0", "map-obj": "^5.0.0", - "netlify": "^13.1.14", + "netlify": "^13.1.15", "netlify-headers-parser": "^7.1.4", "netlify-redirect-parser": "^14.2.2", "node-fetch": "^3.3.1", @@ -9812,9 +9797,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "dependencies": { "path-key": "^4.0.0" @@ -9908,9 +9893,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-11.3.0.tgz", - "integrity": "sha512-ROyjrrOCe4TYdBf9Eky8EFrSFENcKdsHHqGe0nSwbyLKDfbe9gPNwN9LoXt9QhxmPyJCOGwxz12kDX2rqFc+Mw==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.0.0.tgz", + "integrity": "sha512-whAeq2gQxWz8Bt85XN8VJRBwhHpGlbmu7LRX4bFBgXPNWVi1a9UrQ+F51gHj9p+B01tsztVrKlxqA555Sg0dgg==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", @@ -9920,7 +9905,7 @@ "better-ajv-errors": "^1.2.0", "common-path-prefix": "^3.0.0", "env-paths": "^3.0.0", - "esbuild": "0.20.0", + "esbuild": "0.20.2", "execa": "^6.0.0", "find-up": "^6.3.0", "get-package-name": "^2.2.0", @@ -9942,9 +9927,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/aix-ppc64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.0.tgz", - "integrity": "sha512-fGFDEctNh0CcSwsiRPxiaqX0P5rq+AqE0SRhYGZ4PX46Lg1FNR6oCxJghf8YgY0WQEgQuh3lErUFE4KxLeRmmw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -9958,9 +9943,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.0.tgz", - "integrity": "sha512-3bMAfInvByLHfJwYPJRlpTeaQA75n8C/QKpEaiS4HrFWFiJlNI0vzq/zCjBrhAYcPyVPG7Eo9dMrcQXuqmNk5g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -9974,9 +9959,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.0.tgz", - "integrity": "sha512-aVpnM4lURNkp0D3qPoAzSG92VXStYmoVPOgXveAUoQBWRSuQzt51yvSju29J6AHPmwY1BjH49uR29oyfH1ra8Q==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -9990,9 +9975,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.0.tgz", - "integrity": "sha512-uK7wAnlRvjkCPzh8jJ+QejFyrP8ObKuR5cBIsQZ+qbMunwR8sbd8krmMbxTLSrDhiPZaJYKQAU5Y3iMDcZPhyQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -10006,9 +9991,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.0.tgz", - "integrity": "sha512-AjEcivGAlPs3UAcJedMa9qYg9eSfU6FnGHJjT8s346HSKkrcWlYezGE8VaO2xKfvvlZkgAhyvl06OJOxiMgOYQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -10022,9 +10007,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.0.tgz", - "integrity": "sha512-bsgTPoyYDnPv8ER0HqnJggXK6RyFy4PH4rtsId0V7Efa90u2+EifxytE9pZnsDgExgkARy24WUQGv9irVbTvIw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -10038,9 +10023,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.0.tgz", - "integrity": "sha512-kQ7jYdlKS335mpGbMW5tEe3IrQFIok9r84EM3PXB8qBFJPSc6dpWfrtsC/y1pyrz82xfUIn5ZrnSHQQsd6jebQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -10054,9 +10039,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.0.tgz", - "integrity": "sha512-uG8B0WSepMRsBNVXAQcHf9+Ko/Tr+XqmK7Ptel9HVmnykupXdS4J7ovSQUIi0tQGIndhbqWLaIL/qO/cWhXKyQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -10070,9 +10055,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.0.tgz", - "integrity": "sha512-2ezuhdiZw8vuHf1HKSf4TIk80naTbP9At7sOqZmdVwvvMyuoDiZB49YZKLsLOfKIr77+I40dWpHVeY5JHpIEIg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -10086,9 +10071,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.0.tgz", - "integrity": "sha512-uTtyYAP5veqi2z9b6Gr0NUoNv9F/rOzI8tOD5jKcCvRUn7T60Bb+42NDBCWNhMjkQzI0qqwXkQGo1SY41G52nw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -10102,9 +10087,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.0.tgz", - "integrity": "sha512-c88wwtfs8tTffPaoJ+SQn3y+lKtgTzyjkD8NgsyCtCmtoIC8RDL7PrJU05an/e9VuAke6eJqGkoMhJK1RY6z4w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -10118,9 +10103,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.0.tgz", - "integrity": "sha512-lR2rr/128/6svngnVta6JN4gxSXle/yZEZL3o4XZ6esOqhyR4wsKyfu6qXAL04S4S5CgGfG+GYZnjFd4YiG3Aw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -10134,9 +10119,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.0.tgz", - "integrity": "sha512-9Sycc+1uUsDnJCelDf6ZNqgZQoK1mJvFtqf2MUz4ujTxGhvCWw+4chYfDLPepMEvVL9PDwn6HrXad5yOrNzIsQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -10150,9 +10135,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.0.tgz", - "integrity": "sha512-CoWSaaAXOZd+CjbUTdXIJE/t7Oz+4g90A3VBCHLbfuc5yUQU/nFDLOzQsN0cdxgXd97lYW/psIIBdjzQIwTBGw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -10166,9 +10151,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.0.tgz", - "integrity": "sha512-mlb1hg/eYRJUpv8h/x+4ShgoNLL8wgZ64SUr26KwglTYnwAWjkhR2GpoKftDbPOCnodA9t4Y/b68H4J9XmmPzA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -10182,9 +10167,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.0.tgz", - "integrity": "sha512-fgf9ubb53xSnOBqyvWEY6ukBNRl1mVX1srPNu06B6mNsNK20JfH6xV6jECzrQ69/VMiTLvHMicQR/PgTOgqJUQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -10198,9 +10183,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.0.tgz", - "integrity": "sha512-H9Eu6MGse++204XZcYsse1yFHmRXEWgadk2N58O/xd50P9EvFMLJTQLg+lB4E1cF2xhLZU5luSWtGTb0l9UeSg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -10214,9 +10199,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.0.tgz", - "integrity": "sha512-lCT675rTN1v8Fo+RGrE5KjSnfY0x9Og4RN7t7lVrN3vMSjy34/+3na0q7RIfWDAj0e0rCh0OL+P88lu3Rt21MQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -10230,9 +10215,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.0.tgz", - "integrity": "sha512-HKoUGXz/TOVXKQ+67NhxyHv+aDSZf44QpWLa3I1lLvAwGq8x1k0T+e2HHSRvxWhfJrFxaaqre1+YyzQ99KixoA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -10246,9 +10231,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.0.tgz", - "integrity": "sha512-GDwAqgHQm1mVoPppGsoq4WJwT3vhnz/2N62CzhvApFD1eJyTroob30FPpOZabN+FgCjhG+AgcZyOPIkR8dfD7g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -10262,9 +10247,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.0.tgz", - "integrity": "sha512-0vYsP8aC4TvMlOQYozoksiaxjlvUcQrac+muDqj1Fxy6jh9l9CZJzj7zmh8JGfiV49cYLTorFLxg7593pGldwQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -10278,9 +10263,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.0.tgz", - "integrity": "sha512-p98u4rIgfh4gdpV00IqknBD5pC84LCub+4a3MO+zjqvU5MVXOc3hqR2UgT2jI2nh3h8s9EQxmOsVI3tyzv1iFg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -10294,9 +10279,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.0.tgz", - "integrity": "sha512-NgJnesu1RtWihtTtXGFMU5YSE6JyyHPMxCwBZK7a6/8d31GuSo9l0Ss7w1Jw5QnKUawG6UEehs883kcXf5fYwg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -10361,9 +10346,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.0.tgz", - "integrity": "sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "hasInstallScript": true, "bin": { @@ -10373,29 +10358,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.0", - "@esbuild/android-arm": "0.20.0", - "@esbuild/android-arm64": "0.20.0", - "@esbuild/android-x64": "0.20.0", - "@esbuild/darwin-arm64": "0.20.0", - "@esbuild/darwin-x64": "0.20.0", - "@esbuild/freebsd-arm64": "0.20.0", - "@esbuild/freebsd-x64": "0.20.0", - "@esbuild/linux-arm": "0.20.0", - "@esbuild/linux-arm64": "0.20.0", - "@esbuild/linux-ia32": "0.20.0", - "@esbuild/linux-loong64": "0.20.0", - "@esbuild/linux-mips64el": "0.20.0", - "@esbuild/linux-ppc64": "0.20.0", - "@esbuild/linux-riscv64": "0.20.0", - "@esbuild/linux-s390x": "0.20.0", - "@esbuild/linux-x64": "0.20.0", - "@esbuild/netbsd-x64": "0.20.0", - "@esbuild/openbsd-x64": "0.20.0", - "@esbuild/sunos-x64": "0.20.0", - "@esbuild/win32-arm64": "0.20.0", - "@esbuild/win32-ia32": "0.20.0", - "@esbuild/win32-x64": "0.20.0" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { @@ -10639,12 +10624,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.54", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.54.tgz", - "integrity": "sha512-QdYmIPC6NBp90MfuHWeNGqf1XdsRUcIIbcWnT2AK1g2By8ur8m28qGM99GlReRmprzC7ZT7YmwcHjUjaq24sRA==", + "version": "5.2.55", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.55.tgz", + "integrity": "sha512-4xTb/zuUT5SFpZH+RGKUV6pwrYyGS3L4emcrVi5u/nbJ/8yU8v8MdUdTGxoUhyeFw1kIp5C6vsru1fpU0ti0XA==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.31.3", + "@netlify/zip-it-and-ship-it": "9.32.1", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10994,18 +10979,18 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.28.0", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.28.0.tgz", - "integrity": "sha512-lSx9yVn5mzTS7u9aevQyDRoWaHJYNl15B7CU373g8We39wW8fGh4sdNY7ciPWshf42FblOVlBdoasn/LpzquXg==", + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.30.0.tgz", + "integrity": "sha512-SMRzNwaG6/2MTIBe/RThLQRm3kNpiwb90te+iDJgMLLfTdVA33P/oiinTypBMyQU4Cm3IvQm7P5zD2mXZacSsg==", "dev": true, "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@netlify/opentelemetry-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.1.0.tgz", - "integrity": "sha512-VpjyInWRdreD0lPqTmWlxROfjF5mFHo99y9r21v/TvRmPniUbvEeFrtPgbA1VsiXt0YcHXZ9jUi/PrsLjQ5vPg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.2.0.tgz", + "integrity": "sha512-sdeYmvUHXzs7bfoh7f32WVh2wLMOdF3d2Xdcg2FG1lCySXOJ4V6F3n8vPoPXwO7S5iSzJbfO2RPJsTtZCmbIcg==", "dev": true, "engines": { "node": ">=18.0.0" @@ -11110,28 +11095,34 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.16.2.tgz", - "integrity": "sha512-v28g91/bnvvFw+LO/ro/n766RhbWqB5UG2H73kwEUuSqlnLuO/tMgPh13vOeeIgjZcXZoulGn13g7eUs4j6Qpg==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.0.tgz", + "integrity": "sha512-VCU5btoGZ8M6iI7HSwpfZXCpBLKWFmRtq5xYt0K7dY96BZWVBmaZY6Tn+w4L2DrGXwAsIeOFNp8CHjVXfuCAkg==", "dev": true, "dependencies": { + "@mswjs/interceptors": "0.27.2", "@netlify/node-cookies": "^0.1.0", + "@opentelemetry/core": "^1.23.0", + "@opentelemetry/otlp-transformer": "^0.50.0", + "@opentelemetry/resources": "^1.23.0", + "@opentelemetry/sdk-trace-base": "^1.23.0", + "@opentelemetry/semantic-conventions": "^1.23.0", "urlpattern-polyfill": "8.0.2" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=18.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.31.3", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.31.3.tgz", - "integrity": "sha512-cB8DE0pV90IYShytLcKyxZFy6aolKqSuFDMOKVL/svJ6hMQOVlngz5ZKcNRX4rQ2uHWHTe75tgTn6OqmelQYrw==", + "version": "9.32.1", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.32.1.tgz", + "integrity": "sha512-zLsWEJYCoWbQ7ZM0WcPdXzXtIRp9Y2KvbGpL7iWYmTaLBDrmZtYDnUkoyG0E3b9zmuQp9EAiE6evBdRr6usiRg==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", "@babel/types": "7.23.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.16.2", + "@netlify/serverless-functions-api": "^1.18.0", "@vercel/nft": "^0.23.0", "archiver": "^6.0.0", "common-path-prefix": "^3.0.0", @@ -11565,6 +11556,28 @@ "@octokit/openapi-types": "^13.11.0" } }, + "node_modules/netlify-cli/node_modules/@open-draft/deferred-promise": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@open-draft/logger": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "dev": true, + "dependencies": { + "is-node-process": "^1.2.0", + "outvariant": "^1.4.0" + } + }, + "node_modules/netlify-cli/node_modules/@open-draft/until": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@opentelemetry/api": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", @@ -11574,6 +11587,129 @@ "node": ">=8.0.0" } }, + "node_modules/netlify-cli/node_modules/@opentelemetry/api-logs": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.50.0.tgz", + "integrity": "sha512-JdZuKrhOYggqOpUljAq4WWNi5nB10PmgoF0y2CvedLGXd0kSawb/UBnWT8gg1ND3bHCNHStAIVT0ELlxJJRqrA==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/core": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.23.0.tgz", + "integrity": "sha512-hdQ/a9TMzMQF/BO8Cz1juA43/L5YGtCSiKoOHmrTEf7VMDAZgy8ucpWx3eQTnQ3gBloRcWtzvcrMZABC3PTSKQ==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.50.0.tgz", + "integrity": "sha512-s0sl1Yfqd5q1Kjrf6DqXPWzErL+XHhrXOfejh4Vc/SMTNqC902xDsC8JQxbjuramWt/+hibfguIvi7Ns8VLolA==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.50.0", + "@opentelemetry/core": "1.23.0", + "@opentelemetry/resources": "1.23.0", + "@opentelemetry/sdk-logs": "0.50.0", + "@opentelemetry/sdk-metrics": "1.23.0", + "@opentelemetry/sdk-trace-base": "1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/resources": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.23.0.tgz", + "integrity": "sha512-iPRLfVfcEQynYGo7e4Di+ti+YQTAY0h5mQEUJcHlU9JOqpb4x965O6PZ+wMcwYVY63G96KtdS86YCM1BF1vQZg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.23.0", + "@opentelemetry/semantic-conventions": "1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.50.0.tgz", + "integrity": "sha512-PeUEupBB29p9nlPNqXoa1PUWNLsZnxG0DCDj3sHqzae+8y76B/A5hvZjg03ulWdnvBLYpnJslqzylG9E0IL87g==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.23.0", + "@opentelemetry/resources": "1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.9.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.23.0.tgz", + "integrity": "sha512-4OkvW6+wST4h6LFG23rXSTf6nmTf201h9dzq7bE0z5R9ESEVLERZz6WXwE7PSgg1gdjlaznm1jLJf8GttypFDg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.23.0", + "@opentelemetry/resources": "1.23.0", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.23.0.tgz", + "integrity": "sha512-PzBmZM8hBomUqvCddF/5Olyyviayka44O5nDWq673np3ctnvwMOvNrsUORZjKja1zJbwEuD9niAGbnVrz3jwRQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.23.0", + "@opentelemetry/resources": "1.23.0", + "@opentelemetry/semantic-conventions": "1.23.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.23.0.tgz", + "integrity": "sha512-MiqFvfOzfR31t8cc74CTP1OZfz7MbqpAnLCra8NqQoaHJX6ncIRTdYOQYBDQ2uFISDq0WY8Y9dDTWvsgzzBYRg==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/netlify-cli/node_modules/@parcel/watcher": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.0.tgz", @@ -12611,9 +12747,9 @@ } }, "node_modules/netlify-cli/node_modules/acorn-import-attributes": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.2.tgz", - "integrity": "sha512-O+nfJwNolEA771IYJaiLWK1UAwjNsQmZbTRqqwBYxCgVQTmpFEMvBw6LOIQV0Me339L5UMVYFyRohGnGlQDdIQ==", + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -16722,9 +16858,9 @@ } }, "node_modules/netlify-cli/node_modules/follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "dev": true, "funding": [ { @@ -17499,16 +17635,28 @@ } }, "node_modules/netlify-cli/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/https-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" } }, "node_modules/netlify-cli/node_modules/human-signals": { @@ -18293,6 +18441,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/is-node-process": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", + "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/is-npm": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", @@ -19110,6 +19264,12 @@ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "dev": true }, + "node_modules/netlify-cli/node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -19910,12 +20070,12 @@ "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.14", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.14.tgz", - "integrity": "sha512-7vSq6so7lPjr3HEpjbtLyde0F3IXOzD0ocJs3s2wnJR+nX+8pWOAVGe+KN6S98odsClJBJxCkWG2rLjTBzW9pw==", + "version": "13.1.15", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.15.tgz", + "integrity": "sha512-6gZ2lMcjqiXqirwbxeXoNyQn1LcW18s8zdR9eTS8Dtuqg/h4JxI7y9ahV9fypfp0bdaTt8hkBoopBJXLQPsJmA==", "dev": true, "dependencies": { - "@netlify/open-api": "^2.28.0", + "@netlify/open-api": "^2.30.0", "lodash-es": "^4.17.21", "micro-api-client": "^3.3.0", "node-fetch": "^3.0.0", @@ -20593,6 +20753,12 @@ "node": ">=0.10.0" } }, + "node_modules/netlify-cli/node_modules/outvariant": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.2.tgz", + "integrity": "sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==", + "dev": true + }, "node_modules/netlify-cli/node_modules/p-event": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", @@ -20723,6 +20889,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/p-wait-for": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-5.0.2.tgz", @@ -20738,18 +20916,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/p-wait-for/node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/package-json": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", @@ -21206,9 +21372,9 @@ } }, "node_modules/netlify-cli/node_modules/postcss": { - "version": "8.4.33", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", - "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -21227,7 +21393,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -22240,9 +22406,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -22782,9 +22948,9 @@ } }, "node_modules/netlify-cli/node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -23017,6 +23183,12 @@ "queue-tick": "^1.0.1" } }, + "node_modules/netlify-cli/node_modules/strict-event-emitter": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dev": true + }, "node_modules/netlify-cli/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -23249,9 +23421,9 @@ } }, "node_modules/netlify-cli/node_modules/tar": { - "version": "6.1.15", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", - "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", @@ -24105,10 +24277,14 @@ } }, "node_modules/netlify-cli/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } @@ -24372,9 +24548,9 @@ } }, "node_modules/netlify-cli/node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -30988,9 +31164,9 @@ } }, "node_modules/vite-node": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.0.tgz", - "integrity": "sha512-tV8h6gMj6vPzVCa7l+VGq9lwoJjW8Y79vst8QZZGiuRAfijU+EEWuc0kFpmndQrWhMMhet1jdSF+40KSZUqIIw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -31023,16 +31199,16 @@ } }, "node_modules/vitest": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.0.tgz", - "integrity": "sha512-d8UKgR0m2kjdxDWX6911uwxout6GHS0XaGH1cksSIVVG8kRlE7G7aBw7myKQCvDI5dT4j7ZMa+l706BIORMDLw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", "dev": true, "dependencies": { - "@vitest/expect": "1.5.0", - "@vitest/runner": "1.5.0", - "@vitest/snapshot": "1.5.0", - "@vitest/spy": "1.5.0", - "@vitest/utils": "1.5.0", + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -31046,7 +31222,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.5.0", + "vite-node": "1.6.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -31061,8 +31237,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.5.0", - "@vitest/ui": "1.5.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index 3b8c206..7ce4762 100644 --- a/package.json +++ b/package.json @@ -37,12 +37,12 @@ "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.12.7", + "@types/node": "20.12.8", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.22.1", + "netlify-cli": "17.23.1", "shx": "0.3.4", - "vitest": "1.5.0" + "vitest": "1.6.0" }, "prettier": { "tabWidth": 2, From 02dca63ca09445c62c097a1749ea507fc118e2d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 23:04:43 +0000 Subject: [PATCH 17/26] chore(deps): update devdependencies-non-major --- package-lock.json | 5888 +++++++++++++++++++-------------------------- package.json | 6 +- 2 files changed, 2483 insertions(+), 3411 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4c47bd..7320671 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.43.1", + "@playwright/test": "1.44.1", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.12.8", + "@types/node": "20.14.0", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.23.1", + "netlify-cli": "17.25.0", "shx": "0.3.4", "vitest": "1.6.0" } @@ -1813,12 +1813,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.1.tgz", - "integrity": "sha512-HgtQzFgNEEo4TE22K/X7sYTYNqEMMTZmFS8kTq6m8hXj+m1D8TgwgIbumHddJa9h4yl4GkKb8/bgAl2+g7eDgA==", + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.44.1.tgz", + "integrity": "sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright": "1.43.1" + "playwright": "1.44.1" }, "bin": { "playwright": "cli.js" @@ -2591,10 +2592,11 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.12.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.8.tgz", - "integrity": "sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w==", + "version": "20.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.0.tgz", + "integrity": "sha512-5cHBxFGJx6L4s56Bubp4fglrEpmyJypsqI6RgzMfBHWUJQGWAAi8cWcgetEbZXHYXo9C2Fa4EEds/uSyS4cxmA==", "devOptional": true, + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -7836,58 +7838,58 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.23.1", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.23.1.tgz", - "integrity": "sha512-MISg7qb1wVP0umvB0Tn6KhZUIB/HPph0w1OzzV4DP+Mm0MS+/t0wqzcYx0WJeLdJsLzywq2lfL2smttQz/6lwQ==", + "version": "17.25.0", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.25.0.tgz", + "integrity": "sha512-XPEc6quX+yWWFMJIdD6XKT5slV5FdiHhwcVc5BYeI2UWdjpg+Z1l8/PobL+McZkzsfv4ctnvt43ioOCCx7gJMQ==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, + "license": "MIT", "dependencies": { - "@bugsnag/js": "7.22.7", - "@fastify/static": "6.12.0", + "@bugsnag/js": "7.23.0", + "@fastify/static": "7.0.4", "@netlify/blobs": "7.3.0", - "@netlify/build": "29.41.2", + "@netlify/build": "29.46.0", "@netlify/build-info": "7.13.2", - "@netlify/config": "20.12.3", - "@netlify/edge-bundler": "12.0.0", - "@netlify/edge-functions": "2.5.1", + "@netlify/config": "20.13.1", + "@netlify/edge-bundler": "12.0.1", + "@netlify/edge-functions": "2.8.1", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.32.1", - "@octokit/rest": "19.0.13", + "@netlify/zip-it-and-ship-it": "9.34.0", + "@octokit/rest": "20.1.1", "@opentelemetry/api": "1.8.0", - "ansi-escapes": "6.2.1", + "ansi-escapes": "7.0.0", "ansi-styles": "6.2.1", "ansi-to-html": "0.7.2", "ascii-table": "0.0.9", "backoff": "2.5.0", "better-opn": "3.0.2", "boxen": "7.1.1", - "chalk": "5.2.0", - "chokidar": "3.5.3", - "ci-info": "3.8.0", + "chalk": "5.3.0", + "chokidar": "3.6.0", + "ci-info": "4.0.0", "clean-deep": "3.4.0", "commander": "10.0.1", "comment-json": "4.2.3", "concordance": "5.0.4", "configstore": "6.0.0", "content-type": "1.0.5", - "cookie": "0.5.0", - "copy-template-dir": "1.4.0", - "cron-parser": "4.8.1", + "cookie": "0.6.0", + "cron-parser": "4.9.0", "debug": "4.3.4", "decache": "4.6.2", - "dot-prop": "7.2.0", - "dotenv": "16.0.3", + "dot-prop": "9.0.0", + "dotenv": "16.4.5", "env-paths": "3.0.0", - "envinfo": "7.8.1", + "envinfo": "7.13.0", "etag": "1.8.1", "execa": "5.1.1", "express": "4.19.2", "express-logging": "1.1.1", "extract-zip": "2.0.1", "fastest-levenshtein": "1.0.16", - "fastify": "4.17.0", - "find-up": "6.3.0", + "fastify": "4.27.0", + "find-up": "7.0.0", "flush-write-stream": "2.0.0", "folder-walker": "3.2.0", "from2-array": "0.0.4", @@ -7905,28 +7907,30 @@ "inquirer-autocomplete-prompt": "1.4.0", "ipx": "2.1.0", "is-docker": "3.0.0", - "is-stream": "3.0.0", - "is-wsl": "2.2.0", - "isexe": "2.0.0", + "is-stream": "4.0.1", + "is-wsl": "3.1.0", + "isexe": "3.1.1", "js-yaml": "4.1.0", "jsonwebtoken": "9.0.2", - "jwt-decode": "3.1.2", - "lambda-local": "2.1.2", - "listr2": "7.0.2", + "jwt-decode": "4.0.0", + "lambda-local": "2.2.0", + "listr2": "8.2.1", "locate-path": "7.2.0", "lodash": "4.17.21", - "log-symbols": "5.1.0", - "log-update": "5.0.1", + "log-symbols": "6.0.0", + "log-update": "6.0.0", + "maxstache": "1.0.7", + "maxstache-stream": "1.0.4", "multiparty": "4.2.3", - "netlify": "13.1.15", + "netlify": "13.1.17", "netlify-headers-parser": "7.1.4", - "netlify-redirect-parser": "14.2.2", + "netlify-redirect-parser": "14.3.0", "netlify-redirector": "0.5.0", - "node-fetch": "2.6.12", + "node-fetch": "3.3.2", "node-version-alias": "3.4.1", - "ora": "6.3.1", - "p-filter": "3.0.0", - "p-map": "5.5.0", + "ora": "8.0.1", + "p-filter": "4.1.0", + "p-map": "7.0.2", "p-wait-for": "5.0.2", "parallel-transform": "1.2.0", "parse-github-url": "1.0.2", @@ -7936,25 +7940,26 @@ "pump": "3.0.0", "raw-body": "2.5.2", "read-package-up": "11.0.0", - "semver": "7.6.0", + "readdirp": "3.6.0", + "semver": "7.6.2", "source-map-support": "0.5.21", "strip-ansi-control-characters": "2.0.0", "tabtab": "3.0.2", - "tempy": "3.0.0", + "tempy": "3.1.0", "terminal-link": "3.0.0", - "through2-filter": "3.0.0", - "through2-map": "3.0.0", + "through2-filter": "4.0.0", + "through2-map": "4.0.0", "to-readable-stream": "3.0.0", "toml": "3.0.0", "tomlify-j0.4": "3.0.0", "ulid": "2.3.0", "unixify": "1.0.0", - "update-notifier": "6.0.2", + "update-notifier": "7.0.0", "uuid": "9.0.1", - "wait-port": "1.0.4", + "wait-port": "1.1.0", "write-file-atomic": "5.0.1", - "ws": "8.14.2", - "zod": "3.22.4" + "ws": "8.17.0", + "zod": "3.23.8" }, "bin": { "netlify": "bin/run.js", @@ -8034,18 +8039,18 @@ } }, "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", + "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/netlify-cli/node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", "dev": true, "engines": { "node": ">=6.9.0" @@ -8134,13 +8139,13 @@ } }, "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", - "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.5.tgz", + "integrity": "sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.24.1", + "@babel/helper-validator-identifier": "^7.24.5", "to-fast-properties": "^2.0.0" }, "engines": { @@ -8176,19 +8181,19 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@bugsnag/js": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.22.7.tgz", - "integrity": "sha512-Qq8l06rSDTZtxgNIDpTeXHrin9C30INNbPfnR2CNcEsCmfqyVQb4USPEuRb0xg5wiaLKU9r4IAatMqiCgdzG6A==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.23.0.tgz", + "integrity": "sha512-gnCpcv/v6p3CtbwwDuAjVYPPNq4NMVj4hp70MiB3OGJ+LmIS66CwElDiyvRMA8Ar6OzCF4joTeaNG5bD9cM41w==", "dev": true, "dependencies": { "@bugsnag/browser": "^7.22.7", - "@bugsnag/node": "^7.22.7" + "@bugsnag/node": "^7.23.0" } }, "node_modules/netlify-cli/node_modules/@bugsnag/node": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.22.7.tgz", - "integrity": "sha512-Ud8vpX9UkGxoWAk7OigyR7w1eycbsE5uv5KZx0aWiqDPXylvICd42V5ZiWstpkdm9IVFo9AQ4+gmerHPe4Lwrg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.23.0.tgz", + "integrity": "sha512-eXA8/h+J2booEMlKsuRl1NAszebwm4KZ9zxCSg/xN4sw5boXia7kMifLf8QTqk+UBtIhNKBsyQQKHXbawKyE6Q==", "dev": true, "dependencies": { "@bugsnag/core": "^7.22.7", @@ -8660,16 +8665,10 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, - "node_modules/netlify-cli/node_modules/@fastify/deepmerge": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", - "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==", - "dev": true - }, "node_modules/netlify-cli/node_modules/@fastify/error": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.2.0.tgz", - "integrity": "sha512-KAfcLa+CnknwVi5fWogrLXgidLic+GXnLjijXdpl8pvkvbXU5BGa37iZO9FGvsh9ZL4y+oFi5cbHBm5UOG+dmQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.4.1.tgz", + "integrity": "sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ==", "dev": true }, "node_modules/netlify-cli/node_modules/@fastify/fast-json-stringify-compiler": { @@ -8681,6 +8680,15 @@ "fast-json-stringify": "^5.7.0" } }, + "node_modules/netlify-cli/node_modules/@fastify/merge-json-schemas": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.1.1.tgz", + "integrity": "sha512-fERDVz7topgNjtXsJTTW1JKLy0rhuLRcquYqNR9rF7OcVpCa2OVW49ZPDIhaRRCaUuvVxI+N416xUoF76HNSXA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, "node_modules/netlify-cli/node_modules/@fastify/send": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.0.1.tgz", @@ -8732,17 +8740,17 @@ } }, "node_modules/netlify-cli/node_modules/@fastify/static": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.12.0.tgz", - "integrity": "sha512-KK1B84E6QD/FcQWxDI2aiUCwHxMJBI1KeCUzm1BwYpPY1b742+jeKruGHP2uOluuM6OkBPI8CIANrXcCRtC2oQ==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-7.0.4.tgz", + "integrity": "sha512-p2uKtaf8BMOZWLs6wu+Ihg7bWNBdjNgCwDza4MJtTqg+5ovKmcbgbR9Xs5/smZ1YISfzKOCNYmZV8LaCj+eJ1Q==", "dev": true, "dependencies": { "@fastify/accept-negotiator": "^1.0.0", "@fastify/send": "^2.0.0", "content-disposition": "^0.5.3", "fastify-plugin": "^4.0.0", - "glob": "^8.0.1", - "p-limit": "^3.1.0" + "fastq": "^1.17.0", + "glob": "^10.3.4" } }, "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/brace-expansion": { @@ -8755,34 +8763,49 @@ } }, "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "version": "10.3.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", + "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.11.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/@fastify/static/node_modules/minipass": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { @@ -8812,6 +8835,63 @@ "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", "dev": true }, + "node_modules/netlify-cli/node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/netlify-cli/node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/netlify-cli/node_modules/@jest/types": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", @@ -8965,21 +9045,24 @@ "node": ">= 6" } }, - "node_modules/netlify-cli/node_modules/@mswjs/interceptors": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.27.2.tgz", - "integrity": "sha512-mE6PhwcoW70EX8+h+Y/4dLfHk33GFt/y5PzDJz56ktMyaVGFXMJ5BYLbUjdmGEABfE0x5GgAGyKbrbkYww2s3A==", + "node_modules/netlify-cli/node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "dependencies": { - "@open-draft/deferred-promise": "^2.2.0", - "@open-draft/logger": "^0.3.0", - "@open-draft/until": "^2.0.0", - "is-node-process": "^1.2.0", - "outvariant": "^1.2.1", - "strict-event-emitter": "^0.5.1" + "whatwg-url": "^5.0.0" }, "engines": { - "node": ">=18" + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/netlify-cli/node_modules/@netlify/binary-info": { @@ -8998,23 +9081,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.41.2", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.41.2.tgz", - "integrity": "sha512-txcYS00PXfmfw9hIxc4Q5c8p4DLkaGqgX3yjGUH2y/2NXxJQxpZiZBBVYeVW5q0rwb+17trE2gQJ/xnOXo3O5Q==", + "version": "29.46.0", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.46.0.tgz", + "integrity": "sha512-HI3RgsCge1qLzGUUKnU95t9ylPKQBSdZyFKBeLHH+zHc8yi/0Qe/lVjAnkBF9KrPgbpV4qWG1C7W504cfS8LQg==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^7.3.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.12.3", - "@netlify/edge-bundler": "12.0.0", - "@netlify/framework-info": "^9.8.11", - "@netlify/functions-utils": "^5.2.55", + "@netlify/config": "^20.13.0", + "@netlify/edge-bundler": "12.0.1", + "@netlify/framework-info": "^9.8.13", + "@netlify/functions-utils": "^5.2.60", "@netlify/git-utils": "^5.1.1", - "@netlify/opentelemetry-utils": "^1.2.0", - "@netlify/plugins-list": "^6.77.0", + "@netlify/opentelemetry-utils": "^1.2.1", + "@netlify/plugins-list": "^6.80.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.32.1", + "@netlify/zip-it-and-ship-it": "9.34.0", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9047,7 +9130,7 @@ "pkg-dir": "^7.0.0", "pretty-ms": "^8.0.0", "ps-list": "^8.0.0", - "read-pkg-up": "^9.0.0", + "read-package-up": "^11.0.0", "readdirp": "^3.4.0", "resolve": "^2.0.0-next.1", "rfdc": "^1.3.0", @@ -9110,6 +9193,37 @@ "balanced-match": "^1.0.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/dot-prop": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz", + "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==", + "dev": true, + "dependencies": { + "type-fest": "^2.11.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -9125,6 +9239,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/read-pkg": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", @@ -9143,18 +9266,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", @@ -9167,28 +9278,16 @@ "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/ansi-escapes": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", + "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", "dev": true, "engines": { "node": ">=14.16" }, "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/brace-expansion": { @@ -9200,33 +9299,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -9284,42 +9356,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" }, "engines": { - "node": ">=14.16" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/human-signals": { @@ -9343,10 +9393,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/lowercase-keys": { + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/is-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -9367,18 +9417,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/minimatch": { "version": "9.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", @@ -9394,43 +9432,43 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" + "path-key": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/normalize-url": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", - "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", "dev": true, "dependencies": { - "path-key": "^4.0.0" + "p-map": "^5.1.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -9439,13 +9477,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-filter/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", "dev": true, "dependencies": { - "mimic-fn": "^4.0.0" + "aggregate-error": "^4.0.0" }, "engines": { "node": ">=12" @@ -9454,15 +9492,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -9541,21 +9570,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -9657,9 +9671,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.12.3", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.12.3.tgz", - "integrity": "sha512-E+oiGEm6zIvyFJ2kQC1IV5Ipiv7Ar84RuP2K+aVMSgu/raOn7ZfN9lM5TC43qboF3bDrJd6EuYDxVIAuxVkMCA==", + "version": "20.13.1", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.13.1.tgz", + "integrity": "sha512-5SnaPf/V0bxeI+9hLgTYHdyMaasLMwQZhN+b1BI0WbfHTx/cVHYphOeqd5hQQHrFsuTDFQ1P/uaykSPfA57iLw==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -9676,9 +9690,9 @@ "is-plain-obj": "^4.0.0", "js-yaml": "^4.0.0", "map-obj": "^5.0.0", - "netlify": "^13.1.15", + "netlify": "^13.1.17", "netlify-headers-parser": "^7.1.4", - "netlify-redirect-parser": "^14.2.2", + "netlify-redirect-parser": "^14.3.0", "node-fetch": "^3.3.1", "omit.js": "^2.0.2", "p-locate": "^6.0.0", @@ -9694,6 +9708,21 @@ "node": "^14.16.0 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/dot-prop": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz", + "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==", + "dev": true, + "dependencies": { + "type-fest": "^2.11.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -9745,6 +9774,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/human-signals": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", @@ -9766,10 +9811,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", - "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -9778,22 +9823,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/map-obj": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", + "integrity": "sha512-K6K2NgKnTXimT3779/4KxSvobxOtMmx1LBZ3NwRxT/MDIR3Br/fQ4Q+WCX5QxjyUR8zg5+RV9Tbf2c5pAWTD2A==", "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/npm-run-path": { @@ -9856,6 +9895,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/path-type": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", @@ -9893,19 +9941,19 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.0.0.tgz", - "integrity": "sha512-whAeq2gQxWz8Bt85XN8VJRBwhHpGlbmu7LRX4bFBgXPNWVi1a9UrQ+F51gHj9p+B01tsztVrKlxqA555Sg0dgg==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.0.1.tgz", + "integrity": "sha512-7Soa0Ny2mDhPHfBbdg28FJ96Kk71Q6vDJfJ3d5BLBqSh6buw+TRcDJye84wJ9LaMlff+eAN/vlMgsoumCH5L9Q==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", - "@vercel/nft": "^0.26.0", + "@vercel/nft": "^0.27.0", "ajv": "^8.11.2", "ajv-errors": "^3.0.0", "better-ajv-errors": "^1.2.0", "common-path-prefix": "^3.0.0", "env-paths": "^3.0.0", - "esbuild": "0.20.2", + "esbuild": "0.21.2", "execa": "^6.0.0", "find-up": "^6.3.0", "get-package-name": "^2.2.0", @@ -9927,9 +9975,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", + "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", "cpu": [ "ppc64" ], @@ -9943,9 +9991,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", + "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", "cpu": [ "arm" ], @@ -9959,9 +10007,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", + "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", "cpu": [ "arm64" ], @@ -9975,9 +10023,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", + "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", "cpu": [ "x64" ], @@ -9991,9 +10039,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", + "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", "cpu": [ "arm64" ], @@ -10007,9 +10055,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", + "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", "cpu": [ "x64" ], @@ -10023,9 +10071,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", + "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", "cpu": [ "arm64" ], @@ -10039,9 +10087,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", + "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", "cpu": [ "x64" ], @@ -10055,9 +10103,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", + "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", "cpu": [ "arm" ], @@ -10071,9 +10119,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", + "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", "cpu": [ "arm64" ], @@ -10087,9 +10135,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", + "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", "cpu": [ "ia32" ], @@ -10103,9 +10151,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", + "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", "cpu": [ "loong64" ], @@ -10119,9 +10167,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", + "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", "cpu": [ "mips64el" ], @@ -10135,9 +10183,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", + "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", "cpu": [ "ppc64" ], @@ -10151,9 +10199,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", + "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", "cpu": [ "riscv64" ], @@ -10167,9 +10215,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", + "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", "cpu": [ "s390x" ], @@ -10183,9 +10231,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", + "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", "cpu": [ "x64" ], @@ -10199,9 +10247,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", + "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", "cpu": [ "x64" ], @@ -10215,9 +10263,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", + "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", "cpu": [ "x64" ], @@ -10231,9 +10279,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", + "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", "cpu": [ "x64" ], @@ -10247,9 +10295,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", + "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", "cpu": [ "arm64" ], @@ -10263,9 +10311,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", + "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", "cpu": [ "ia32" ], @@ -10279,9 +10327,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", + "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", "cpu": [ "x64" ], @@ -10295,15 +10343,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.26.4", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.4.tgz", - "integrity": "sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.27.0.tgz", + "integrity": "sha512-W5pValyhToK9hbgEUAM6sLRUIl1I++RsFnXKHXtND50P1+vZ+OYPCzq1OOz0Ok6ghK6aOwae8G/rEAXkLedC+w==", "dev": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.5", "@rollup/pluginutils": "^4.0.0", "acorn": "^8.6.0", - "acorn-import-attributes": "^1.9.2", + "acorn-import-attributes": "^1.9.5", "async-sema": "^3.1.1", "bindings": "^1.4.0", "estree-walker": "2.0.2", @@ -10321,15 +10369,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", @@ -10346,9 +10394,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", + "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", "dev": true, "hasInstallScript": true, "bin": { @@ -10358,29 +10406,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.2", + "@esbuild/android-arm": "0.21.2", + "@esbuild/android-arm64": "0.21.2", + "@esbuild/android-x64": "0.21.2", + "@esbuild/darwin-arm64": "0.21.2", + "@esbuild/darwin-x64": "0.21.2", + "@esbuild/freebsd-arm64": "0.21.2", + "@esbuild/freebsd-x64": "0.21.2", + "@esbuild/linux-arm": "0.21.2", + "@esbuild/linux-arm64": "0.21.2", + "@esbuild/linux-ia32": "0.21.2", + "@esbuild/linux-loong64": "0.21.2", + "@esbuild/linux-mips64el": "0.21.2", + "@esbuild/linux-ppc64": "0.21.2", + "@esbuild/linux-riscv64": "0.21.2", + "@esbuild/linux-s390x": "0.21.2", + "@esbuild/linux-x64": "0.21.2", + "@esbuild/netbsd-x64": "0.21.2", + "@esbuild/openbsd-x64": "0.21.2", + "@esbuild/sunos-x64": "0.21.2", + "@esbuild/win32-arm64": "0.21.2", + "@esbuild/win32-ia32": "0.21.2", + "@esbuild/win32-x64": "0.21.2" } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/execa": { @@ -10406,6 +10454,22 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/get-port": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", @@ -10439,30 +10503,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/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==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/npm-run-path": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", @@ -10520,6 +10578,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -10533,15 +10600,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-functions": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@netlify/edge-functions/-/edge-functions-2.5.1.tgz", - "integrity": "sha512-6YGlbzxPaSqc/D2LhP4T4PXrim/vRmqpO1RwQKqVod6WCWlkdtJcAd3mGoI7efrjfND8twh7TqXtL7RRCI23qA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-functions/-/edge-functions-2.8.1.tgz", + "integrity": "sha512-BoAz/gCWHLn9DVugGViORbWFDqaqrB/JHM+9N+ahk7U6C3EwaFojnnGKCMrQ65f2YOi6Wwlue1ZZO+8mq43RZA==", "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/framework-info": { - "version": "9.8.11", - "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.11.tgz", - "integrity": "sha512-8NuvzQQVeU36PRilWqijiIWmjy6JZcqbKooGQ4bNgH/26YNdS+tN5gOWGWVYnRHgdmBUCycyYrM5h1Srwnq3hQ==", + "version": "9.8.13", + "resolved": "https://registry.npmjs.org/@netlify/framework-info/-/framework-info-9.8.13.tgz", + "integrity": "sha512-ZZXCggokY/y5Sz93XYbl/Lig1UAUSWPMBiQRpkVfbrrkjmW2ZPkYS/BgrM2/MxwXRvYhc/TQpZX6y5JPe3quQg==", "dev": true, "dependencies": { "ajv": "^8.12.0", @@ -10552,7 +10619,7 @@ "p-filter": "^3.0.0", "p-locate": "^6.0.0", "process": "^0.11.10", - "read-pkg-up": "^9.0.0", + "read-pkg-up": "^9.1.0", "semver": "^7.3.8" }, "engines": { @@ -10575,12 +10642,43 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/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==", "dev": true }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "dependencies": { + "p-map": "^5.1.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -10611,6 +10709,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/framework-info/node_modules/yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", @@ -10624,12 +10746,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.55", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.55.tgz", - "integrity": "sha512-4xTb/zuUT5SFpZH+RGKUV6pwrYyGS3L4emcrVi5u/nbJ/8yU8v8MdUdTGxoUhyeFw1kIp5C6vsru1fpU0ti0XA==", + "version": "5.2.60", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.60.tgz", + "integrity": "sha512-gTzrajMk4rkJgDQnKprVB/wanQja6vF8NRfL8KW5eiVDWKaLqNqWpZmYOp80uD2k9Oxvowt6+BjPupwkOORKWA==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.32.1", + "@netlify/zip-it-and-ship-it": "9.34.0", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10694,6 +10816,18 @@ "node": ">=12.20.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/git-utils/node_modules/map-obj": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.2.tgz", @@ -10979,18 +11113,18 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.30.0.tgz", - "integrity": "sha512-SMRzNwaG6/2MTIBe/RThLQRm3kNpiwb90te+iDJgMLLfTdVA33P/oiinTypBMyQU4Cm3IvQm7P5zD2mXZacSsg==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.31.0.tgz", + "integrity": "sha512-g7bZej+AL+n5TdXwSa3PVGZ53SqNIt/TahyWuGziRagyDZmTeEE3Md/KEV+c+qo5Os0k4aNkGhkY2amD2elOMg==", "dev": true, "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/@netlify/opentelemetry-utils": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.2.0.tgz", - "integrity": "sha512-sdeYmvUHXzs7bfoh7f32WVh2wLMOdF3d2Xdcg2FG1lCySXOJ4V6F3n8vPoPXwO7S5iSzJbfO2RPJsTtZCmbIcg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@netlify/opentelemetry-utils/-/opentelemetry-utils-1.2.1.tgz", + "integrity": "sha512-A6nQBvUn/avHQopLOOjX8rY2eua//jufbx4NZZODACEHtfXAEmOjCoDe2m+cQPRq+jNa98nvCy/sJh2RwuCQog==", "dev": true, "engines": { "node": ">=18.0.0" @@ -11000,9 +11134,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/plugins-list": { - "version": "6.77.0", - "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.77.0.tgz", - "integrity": "sha512-czL3FH61hFhhVQydRj2xjIwLVYHDNskMhRib7dUfOQrUHifqLlUFKp03NwBD87G9BFKXUYGWZMEUU+JjIpVc9w==", + "version": "6.80.0", + "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.80.0.tgz", + "integrity": "sha512-bCKLI51UZ70ziIWsf2nvgPd4XuG6m8AMCoHiYtl/BSsiaSBfmryZnTTqdRXerH09tBRpbPPwzaEgUJwyU9o8Qw==", "dev": true, "engines": { "node": "^14.14.0 || >=16.0.0" @@ -11052,7 +11186,19 @@ "node": ">=12.20.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/run-utils/node_modules/npm-run-path": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", @@ -11094,37 +11240,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.0.tgz", - "integrity": "sha512-VCU5btoGZ8M6iI7HSwpfZXCpBLKWFmRtq5xYt0K7dY96BZWVBmaZY6Tn+w4L2DrGXwAsIeOFNp8CHjVXfuCAkg==", - "dev": true, - "dependencies": { - "@mswjs/interceptors": "0.27.2", - "@netlify/node-cookies": "^0.1.0", - "@opentelemetry/core": "^1.23.0", - "@opentelemetry/otlp-transformer": "^0.50.0", - "@opentelemetry/resources": "^1.23.0", - "@opentelemetry/sdk-trace-base": "^1.23.0", - "@opentelemetry/semantic-conventions": "^1.23.0", - "urlpattern-polyfill": "8.0.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.32.1", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.32.1.tgz", - "integrity": "sha512-zLsWEJYCoWbQ7ZM0WcPdXzXtIRp9Y2KvbGpL7iWYmTaLBDrmZtYDnUkoyG0E3b9zmuQp9EAiE6evBdRr6usiRg==", + "version": "9.34.0", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.34.0.tgz", + "integrity": "sha512-nv3UVZGbZDaAmkqmBqpEAhKihBB3sHEJqu2GUHujSdRJ6oZy8J5/jCSz0kmWTdzKTrcF+Y74QnNRLU83sQMqxg==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", - "@babel/types": "7.23.6", + "@babel/types": "7.24.5", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.18.0", + "@netlify/serverless-functions-api": "^1.18.2", "@vercel/nft": "^0.23.0", - "archiver": "^6.0.0", + "archiver": "^7.0.0", "common-path-prefix": "^3.0.0", "cp-file": "^10.0.0", "es-module-lexer": "^1.0.0", @@ -11154,12 +11281,30 @@ "yargs": "^17.0.0" }, "bin": { - "zip-it-and-ship-it": "dist/bin.js" + "zip-it-and-ship-it": "bin.js" }, "engines": { "node": "^14.18.0 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@netlify/serverless-functions-api": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.2.tgz", + "integrity": "sha512-KHhcNWP1B+8Io2aAobzRRuT1FSWb7Bfsih16dxKgaU9IgP/OxMVvssbmhRAmoR01rVGhQEiNN0vk6juMzOafOw==", + "dev": true, + "dependencies": { + "@netlify/node-cookies": "^0.1.0", + "@opentelemetry/core": "^1.23.0", + "@opentelemetry/otlp-transformer": "^0.50.0", + "@opentelemetry/resources": "^1.23.0", + "@opentelemetry/sdk-trace-base": "^1.23.0", + "@opentelemetry/semantic-conventions": "^1.23.0", + "urlpattern-polyfill": "8.0.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -11192,10 +11337,27 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -11244,6 +11406,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { "version": "9.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", @@ -11289,6 +11463,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -11346,238 +11535,160 @@ } }, "node_modules/netlify-cli/node_modules/@octokit/auth-token": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", - "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0" - }, "engines": { - "node": ">= 14" + "node": ">= 18" } }, "node_modules/netlify-cli/node_modules/@octokit/core": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz", - "integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", "dev": true, "dependencies": { - "@octokit/auth-token": "^3.0.0", - "@octokit/graphql": "^5.0.0", - "@octokit/request": "^6.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^9.0.0", + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.3.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/core/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "node": ">= 18" } }, "node_modules/netlify-cli/node_modules/@octokit/endpoint": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", - "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", "dev": true, "dependencies": { - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 18" } }, "node_modules/netlify-cli/node_modules/@octokit/graphql": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", - "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", "dev": true, "dependencies": { - "@octokit/request": "^6.0.0", - "@octokit/types": "^7.0.0", + "@octokit/request": "^8.3.0", + "@octokit/types": "^13.0.0", "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 18" } }, "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { - "version": "13.13.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.13.1.tgz", - "integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ==", + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz", + "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==", "dev": true }, "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", - "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.1.tgz", + "integrity": "sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==", "dev": true, "dependencies": { - "@octokit/tsconfig": "^1.0.2", - "@octokit/types": "^9.2.3" + "@octokit/types": "^13.5.0" }, "engines": { - "node": ">= 14" + "node": ">= 18" }, "peerDependencies": { - "@octokit/core": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "@octokit/core": "5" } }, "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-4.0.1.tgz", + "integrity": "sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==", "dev": true, + "engines": { + "node": ">= 18" + }, "peerDependencies": { - "@octokit/core": ">=3" + "@octokit/core": "5" } }, "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz", - "integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.2.tgz", + "integrity": "sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==", "dev": true, "dependencies": { - "@octokit/types": "^9.2.3", - "deprecation": "^2.3.1" + "@octokit/types": "^13.5.0" }, "engines": { - "node": ">= 14" + "node": ">= 18" }, "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { - "version": "18.1.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", - "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", - "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^18.0.0" + "@octokit/core": "^5" } }, "node_modules/netlify-cli/node_modules/@octokit/request": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", - "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", "dev": true, "dependencies": { - "@octokit/endpoint": "^7.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 18" } }, "node_modules/netlify-cli/node_modules/@octokit/request-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", - "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", "dev": true, "dependencies": { - "@octokit/types": "^7.0.0", + "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" }, "engines": { - "node": ">= 14" + "node": ">= 18" } }, "node_modules/netlify-cli/node_modules/@octokit/rest": { - "version": "19.0.13", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", - "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-20.1.1.tgz", + "integrity": "sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==", "dev": true, "dependencies": { - "@octokit/core": "^4.2.1", - "@octokit/plugin-paginate-rest": "^6.1.2", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^7.1.2" + "@octokit/core": "^5.0.2", + "@octokit/plugin-paginate-rest": "11.3.1", + "@octokit/plugin-request-log": "^4.0.0", + "@octokit/plugin-rest-endpoint-methods": "13.2.2" }, "engines": { - "node": ">= 14" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@octokit/tsconfig": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", - "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", - "dev": true - }, "node_modules/netlify-cli/node_modules/@octokit/types": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz", - "integrity": "sha512-Zk4OUMLCSpXNI8KZZn47lVLJSsgMyCimsWWQI5hyjZg7hdYm0kjotaIkbG0Pp8SfU2CofMBzonboTqvzn3FrJA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^13.11.0" - } - }, - "node_modules/netlify-cli/node_modules/@open-draft/deferred-promise": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", - "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@open-draft/logger": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", - "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz", + "integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==", "dev": true, "dependencies": { - "is-node-process": "^1.2.0", - "outvariant": "^1.4.0" + "@octokit/openapi-types": "^22.2.0" } }, - "node_modules/netlify-cli/node_modules/@open-draft/until": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", - "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", - "dev": true - }, "node_modules/netlify-cli/node_modules/@opentelemetry/api": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", @@ -12023,6 +12134,16 @@ "node": ">=0.10" } }, + "node_modules/netlify-cli/node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/netlify-cli/node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -12071,6 +12192,18 @@ "node": ">= 8.0.0" } }, + "node_modules/netlify-cli/node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, "node_modules/netlify-cli/node_modules/@sindresorhus/slugify": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", @@ -12127,6 +12260,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, "node_modules/netlify-cli/node_modules/@tokenizer/token": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", @@ -12217,9 +12362,9 @@ } }, "node_modules/netlify-cli/node_modules/@types/http-cache-semantics": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.2.tgz", - "integrity": "sha512-FD+nQWA2zJjh4L9+pFXqWOi0Hs1ryBCfI+985NjluQ1p8EYtoLvjLOKidXBtZ4/IcxDX4o8/E8qDS3540tNliw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", "dev": true }, "node_modules/netlify-cli/node_modules/@types/http-proxy": { @@ -12264,9 +12409,9 @@ "peer": true }, "node_modules/netlify-cli/node_modules/@types/node": { - "version": "20.9.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", - "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -12397,6 +12542,18 @@ "node": "^14.14.0 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tar/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tarbz2": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-tarbz2/-/decompress-tarbz2-7.0.0.tgz", @@ -12413,6 +12570,18 @@ "node": "^14.14.0 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-tarbz2/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-targz": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-targz/-/decompress-targz-7.0.0.tgz", @@ -12427,6 +12596,18 @@ "node": "^14.14.0 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-targz/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/@xhmikosr/decompress-unzip": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@xhmikosr/decompress-unzip/-/decompress-unzip-6.0.0.tgz", @@ -12483,73 +12664,22 @@ "node": "^14.14.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filename-reserved-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz", - "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==", + "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/filename-reserved-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz", + "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -12575,104 +12705,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/@xhmikosr/downloader/node_modules/strip-outer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-2.0.0.tgz", @@ -12911,12 +12943,15 @@ } }, "node_modules/netlify-cli/node_modules/ansi-escapes": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", - "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", "dev": true, + "dependencies": { + "environment": "^1.0.0" + }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12987,38 +13022,39 @@ "dev": true }, "node_modules/netlify-cli/node_modules/archiver": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.1.tgz", - "integrity": "sha512-CXGy4poOLBKptiZH//VlWdFuUC1RESbdZjGjILwBuZ73P7WkAUN0htfSfBq/7k6FRFlpu7bg4JOkj1vU9G6jcQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", + "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==", "dev": true, "dependencies": { - "archiver-utils": "^4.0.1", + "archiver-utils": "^5.0.2", "async": "^3.2.4", - "buffer-crc32": "^0.2.1", - "readable-stream": "^3.6.0", + "buffer-crc32": "^1.0.0", + "readable-stream": "^4.0.0", "readdir-glob": "^1.1.2", "tar-stream": "^3.0.0", - "zip-stream": "^5.0.1" + "zip-stream": "^6.0.1" }, "engines": { - "node": ">= 12.0.0" + "node": ">= 14" } }, "node_modules/netlify-cli/node_modules/archiver-utils": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-4.0.1.tgz", - "integrity": "sha512-Q4Q99idbvzmgCTEAAhi32BkOyq8iVI5EwdO0PmBDSGIzzjYNdcFn7Q7k3OzbLy4kLUPXfJtG6fO2RjftXbobBg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz", + "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==", "dev": true, "dependencies": { - "glob": "^8.0.0", + "glob": "^10.0.0", "graceful-fs": "^4.2.0", + "is-stream": "^2.0.1", "lazystream": "^1.0.0", "lodash": "^4.17.15", "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 12.0.0" + "node": ">= 14" } }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/brace-expansion": { @@ -13030,95 +13066,260 @@ "balanced-match": "^1.0.0" } }, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "version": "10.3.16", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", + "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.11.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, "engines": { - "node": ">=10" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/jackspeak": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "dev": true, "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" + "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/netlify-cli/node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/netlify-cli/node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minipass": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=16 || 14 >=14.17" } }, - "node_modules/netlify-cli/node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/archiver/node_modules/buffer-crc32": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/archiver/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/archiver/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/netlify-cli/node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" } }, + "node_modules/netlify-cli/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/netlify-cli/node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -13140,15 +13341,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/arrify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", @@ -13167,15 +13359,6 @@ "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=", "dev": true }, - "node_modules/netlify-cli/node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/ast-module-types": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-5.0.0.tgz", @@ -13197,18 +13380,6 @@ "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", "dev": true }, - "node_modules/netlify-cli/node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, "node_modules/netlify-cli/node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -13219,14 +13390,15 @@ } }, "node_modules/netlify-cli/node_modules/avvio": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", - "integrity": "sha512-bbCQdg7bpEv6kGH41RO/3B2/GMMmJSo2iBK+X8AWN9mujtfUipMDfIjsgHCfpnKqoGEQrrmCDKSa5OQ19+fDmg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.3.0.tgz", + "integrity": "sha512-VBVH0jubFr9LdFASy/vNtm5giTrnbVquWBhT0fyizuNK2rQ7e7ONU2plZQWUNqtE1EmxFEb+kbSkFRkstiaS9Q==", "dev": true, "dependencies": { + "@fastify/error": "^3.3.0", "archy": "^1.0.0", "debug": "^4.0.0", - "fastq": "^1.6.1" + "fastq": "^1.17.1" } }, "node_modules/netlify-cli/node_modules/b4a": { @@ -13253,36 +13425,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/netlify-cli/node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -13563,18 +13705,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/boxen/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/boxen/node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -13698,24 +13828,31 @@ "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "node_modules/netlify-cli/node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "dev": true, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/netlify-cli/node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", "dev": true, "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=14.16" } }, "node_modules/netlify-cli/node_modules/cachedir": { @@ -13762,9 +13899,9 @@ } }, "node_modules/netlify-cli/node_modules/chalk": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", - "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -13780,16 +13917,10 @@ "dev": true }, "node_modules/netlify-cli/node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -13802,6 +13933,9 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } @@ -13816,9 +13950,9 @@ } }, "node_modules/netlify-cli/node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", "dev": true, "funding": [ { @@ -13839,46 +13973,6 @@ "consola": "^3.2.3" } }, - "node_modules/netlify-cli/node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/netlify-cli/node_modules/clean-deep": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", @@ -13957,9 +14051,9 @@ } }, "node_modules/netlify-cli/node_modules/cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, "engines": { "node": ">=6" @@ -13969,39 +14063,39 @@ } }, "node_modules/netlify-cli/node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", "dev": true, "dependencies": { "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" + "string-width": "^7.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, "node_modules/netlify-cli/node_modules/cli-truncate/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -14074,16 +14168,13 @@ "node": ">=16.17.0" } }, - "node_modules/netlify-cli/node_modules/clipboardy/node_modules/is-wsl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", - "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "node_modules/netlify-cli/node_modules/clipboardy/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, - "dependencies": { - "is-inside-container": "^1.0.0" - }, "engines": { - "node": ">=16" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -14143,15 +14234,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/netlify-cli/node_modules/cluster-key-slot": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", @@ -14161,19 +14243,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/color": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", @@ -14307,25 +14376,101 @@ "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", "dev": true }, - "node_modules/netlify-cli/node_modules/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==", - "dev": true - }, "node_modules/netlify-cli/node_modules/compress-commons": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-5.0.1.tgz", - "integrity": "sha512-MPh//1cERdLtqwO3pOFLeXtpuai0Y2WCd5AhtKxznqM7WtaMYaOEMSgn45d9D10sIHSfIKE603HlOp8OPGrvag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", + "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==", "dev": true, "dependencies": { "crc-32": "^1.2.0", - "crc32-stream": "^5.0.0", + "crc32-stream": "^6.0.0", + "is-stream": "^2.0.1", "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 12.0.0" + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/compress-commons/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/compress-commons/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/compress-commons/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/compress-commons/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/compress-commons/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" } }, "node_modules/netlify-cli/node_modules/concat-map": { @@ -14472,9 +14617,9 @@ } }, "node_modules/netlify-cli/node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true, "engines": { "node": ">= 0.6" @@ -14492,296 +14637,131 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", "dev": true }, - "node_modules/netlify-cli/node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/copy-template-dir/-/copy-template-dir-1.4.0.tgz", - "integrity": "sha512-xkXSJhvKz4MfLbVkZ7GyCaFo4ciB3uKI/HHzkGwj1eyTH5+7RTFxW5CE0irWAZgV5oFcO9hd6+NVXAtY9hlo7Q==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "graceful-fs": "^4.1.3", - "maxstache": "^1.0.0", - "maxstache-stream": "^1.0.0", - "mkdirp": "^0.5.1", - "noop2": "^2.0.0", - "pump": "^1.0.0", - "readdirp": "^2.0.0", - "run-parallel": "^1.1.4" - } + "node_modules/netlify-cli/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "node_modules/netlify-cli/node_modules/cp-file": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", "dev": true, "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "graceful-fs": "^4.2.10", + "nested-error-stacks": "^2.1.1", + "p-event": "^5.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/netlify-cli/node_modules/cpy": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", + "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "arrify": "^3.0.0", + "cp-file": "^9.1.0", + "globby": "^13.1.1", + "junk": "^4.0.0", + "micromatch": "^4.0.4", + "nested-error-stacks": "^2.1.0", + "p-filter": "^3.0.0", + "p-map": "^5.3.0" }, "engines": { - "node": ">=0.10.0" + "node": "^12.20.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "node_modules/netlify-cli/node_modules/cpy/node_modules/cp-file": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", + "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", "dev": true, "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "nested-error-stacks": "^2.0.0", + "p-event": "^4.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "node_modules/netlify-cli/node_modules/cpy/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "node_modules/netlify-cli/node_modules/cpy/node_modules/p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", "dev": true, + "dependencies": { + "p-timeout": "^3.1.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number": { + "node_modules/netlify-cli/node_modules/cpy/node_modules/p-filter": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "p-map": "^5.1.0" }, "engines": { - "node": ">=0.10.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/netlify-cli/node_modules/cpy/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "aggregate-error": "^4.0.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/copy-template-dir/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/cp-file": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", - "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.10", - "nested-error-stacks": "^2.1.1", - "p-event": "^5.0.1" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", - "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", - "dev": true, - "dependencies": { - "arrify": "^3.0.0", - "cp-file": "^9.1.0", - "globby": "^13.1.1", - "junk": "^4.0.0", - "micromatch": "^4.0.4", - "nested-error-stacks": "^2.1.0", - "p-filter": "^3.0.0", - "p-map": "^5.3.0" - }, - "engines": { - "node": "^12.20.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/cp-file": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", - "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "nested-error-stacks": "^2.0.0", - "p-event": "^4.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "dev": true, - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/cpy/node_modules/p-event": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", - "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", - "dev": true, - "dependencies": { - "p-timeout": "^3.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/cpy/node_modules/p-timeout": { @@ -14821,16 +14801,85 @@ } }, "node_modules/netlify-cli/node_modules/crc32-stream": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-5.0.0.tgz", - "integrity": "sha512-B0EPa1UK+qnpBZpG+7FgPCu0J2ETLpXq09o9BkLkEAhdB6Z61Qo4pJ3JYu0c+Qi+/SAL7QThqnzS06pmSSyZaw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz", + "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==", "dev": true, "dependencies": { "crc-32": "^1.2.0", - "readable-stream": "^3.4.0" + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 12.0.0" + "node": ">= 14" + } + }, + "node_modules/netlify-cli/node_modules/crc32-stream/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/crc32-stream/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/crc32-stream/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/crc32-stream/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" } }, "node_modules/netlify-cli/node_modules/create-require": { @@ -14840,9 +14889,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/cron-parser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.8.1.tgz", - "integrity": "sha512-jbokKWGcyU4gl6jAfX97E1gDpY12DJ1cLJZmoDzaAln/shZ+S3KBFBuA2Q6WeUN4gJf/8klnV1EfvhA2lK5IRQ==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", + "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", "dev": true, "dependencies": { "luxon": "^3.2.1" @@ -15101,15 +15150,6 @@ "callsite": "^1.0.0" } }, - "node_modules/netlify-cli/node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, "node_modules/netlify-cli/node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -15161,15 +15201,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "dependencies": { - "clone": "^1.0.2" - } - }, "node_modules/netlify-cli/node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -15188,19 +15219,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/defu": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", @@ -15463,39 +15481,42 @@ ] }, "node_modules/netlify-cli/node_modules/dot-prop": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz", - "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-9.0.0.tgz", + "integrity": "sha512-1gxPBJpI/pcjQhKgIU91II6Wkay+dLcN3M6rf2uwP8hRur3HtQXjVrdAK3sjC0piaEuxzMwjXChcETiJl47lAQ==", "dev": true, "dependencies": { - "type-fest": "^2.11.2" + "type-fest": "^4.18.2" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/dot-prop/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", + "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", "dev": true, "engines": { - "node": ">=12.20" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "dev": true, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, "node_modules/netlify-cli/node_modules/eastasianwidth": { @@ -15562,9 +15583,9 @@ } }, "node_modules/netlify-cli/node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.13.0.tgz", + "integrity": "sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q==", "dev": true, "bin": { "envinfo": "dist/cli.js" @@ -15573,6 +15594,18 @@ "node": ">=4" } }, + "node_modules/netlify-cli/node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -15856,85 +15889,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/netlify-cli/node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -15998,15 +15952,6 @@ "node": ">= 0.10.26" } }, - "node_modules/netlify-cli/node_modules/express/node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/netlify-cli/node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -16092,19 +16037,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", - "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -16119,58 +16051,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/extglob/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -16207,9 +16087,9 @@ } }, "node_modules/netlify-cli/node_modules/fast-content-type-parse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.0.0.tgz", - "integrity": "sha512-Xbc4XcysUXcsP5aHUU7Nq3OwvHq97C+WnbkeIefpeYLX+ryzFJlU6OStFJhs6Ol0LkUGpcK+wL0JwfM+FCU5IA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz", + "integrity": "sha512-fBHHqSTFLVnR61C+gltJuE5GkVQMV0S2nqUO8TJ+5Z3qAKG8vAx4FKai1s5jq/inV1+sREynIWSuQ6HgoSXpDQ==", "dev": true }, "node_modules/netlify-cli/node_modules/fast-decode-uri-component": { @@ -16266,16 +16146,17 @@ "peer": true }, "node_modules/netlify-cli/node_modules/fast-json-stringify": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.7.0.tgz", - "integrity": "sha512-sBVPTgnAZseLu1Qgj6lUbQ0HfjFhZWXAmpZ5AaSGkyLh5gAXBga/uPJjQPHpDFjC9adWIpdOcCLSDTgrZ7snoQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.15.1.tgz", + "integrity": "sha512-JopGtkvvguRqrS4gHXSSA2jf4pDgOZkeBAkLO1LbzOpiOMo7/kugoR+KiWifpLpluaVeYDkAuxCJOj4Gyc6L9A==", "dev": true, "dependencies": { - "@fastify/deepmerge": "^1.0.0", + "@fastify/merge-json-schemas": "^0.1.0", "ajv": "^8.10.0", - "ajv-formats": "^2.1.1", + "ajv-formats": "^3.0.1", "fast-deep-equal": "^3.1.3", "fast-uri": "^2.1.0", + "json-schema-ref-resolver": "^1.0.1", "rfdc": "^1.2.0" } }, @@ -16295,6 +16176,23 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/netlify-cli/node_modules/fast-json-stringify/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -16347,27 +16245,37 @@ } }, "node_modules/netlify-cli/node_modules/fastify": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.17.0.tgz", - "integrity": "sha512-tzuY1tgWJo2Y6qEKwmLhFvACUmr68Io2pqP/sDKU71KRM6A6R3DrCDqLGqANbeLZcKUfdfY58ut35CGqemcTgg==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.27.0.tgz", + "integrity": "sha512-ci9IXzbigB8dyi0mSy3faa3Bsj0xWAPb9JeT4KRzubdSb6pNhcADRUaXCBml6V1Ss/a05kbtQls5LBmhHydoTA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], "dependencies": { "@fastify/ajv-compiler": "^3.5.0", - "@fastify/error": "^3.0.0", + "@fastify/error": "^3.4.0", "@fastify/fast-json-stringify-compiler": "^4.3.0", "abstract-logging": "^2.0.1", - "avvio": "^8.2.0", - "fast-content-type-parse": "^1.0.0", - "fast-json-stringify": "^5.7.0", - "find-my-way": "^7.6.0", - "light-my-request": "^5.6.1", - "pino": "^8.5.0", - "process-warning": "^2.0.0", + "avvio": "^8.3.0", + "fast-content-type-parse": "^1.1.0", + "fast-json-stringify": "^5.8.0", + "find-my-way": "^8.0.0", + "light-my-request": "^5.11.0", + "pino": "^9.0.0", + "process-warning": "^3.0.0", "proxy-addr": "^2.0.7", "rfdc": "^1.3.0", - "secure-json-parse": "^2.5.0", - "semver": "^7.3.7", - "tiny-lru": "^11.0.1" + "secure-json-parse": "^2.7.0", + "semver": "^7.5.4", + "toad-cache": "^3.3.0" } }, "node_modules/netlify-cli/node_modules/fastify-plugin": { @@ -16376,44 +16284,150 @@ "integrity": "sha512-ovwFQG2qNy3jcCROiWpr94Hs0le+c7N/3t7m9aVwbFhkxcR/esp2xu25dP8e617HpQdmeDv+gFX4zagdUhDByw==", "dev": true }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz", - "integrity": "sha512-3bKsVhBmgPjGV9pyn4fO/8RtoVDR8ssW1ev819FsRXlRNgW8gR/9Kx+gCK4UPWd4JjrRDLWpzd/pb1AyWm3MGA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.1.0.tgz", + "integrity": "sha512-qUcgfrlyOtjwhNLdbhoL7NR4NkHjzykAPw0V2QLFbvu/zss29h4NkRnibyFzBrNCbzCOY3WZ9hhKSwfOkNggYA==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "v1.1.0", - "pino-std-serializers": "^6.0.0", - "process-warning": "^2.0.0", + "pino-abstract-transport": "^1.2.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^3.0.0", "quick-format-unescaped": "^4.0.3", "real-require": "^0.2.0", "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^3.7.0", - "thread-stream": "^2.0.0" + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" }, "bin": { "pino": "bin.js" } }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-abstract-transport": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", + "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", + "dev": true, + "dependencies": { + "readable-stream": "^4.0.0", + "split2": "^4.0.0" + } + }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino-std-serializers": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", "dev": true }, "node_modules/netlify-cli/node_modules/fastify/node_modules/process-warning": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", - "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", "dev": true }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/sonic-boom": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.0.1.tgz", + "integrity": "sha512-hTSD/6JMLyT4r9zeof6UtuBDpjJ9sO08/nmS5djaA9eozT9oOlNdpXSnzcgj4FTqpk3nkLrs61l4gip9r1HCrQ==", + "dev": true, + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/netlify-cli/node_modules/fastify/node_modules/thread-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.0.0.tgz", + "integrity": "sha512-oUIFjxaUT6knhPtWgDMc29zF1FcSl0yXpapkyrQrCGEfYA2HUZXCilUtKyYIv6HkCyqSPAMkY+EG0GbyIrNDQg==", + "dev": true, + "dependencies": { + "real-require": "^0.2.0" + } + }, "node_modules/netlify-cli/node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -16487,68 +16501,17 @@ "node": ">=14.18.0" } }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/colors-option": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-4.5.0.tgz", + "integrity": "sha512-Soe5lerRg3erMRgYC0EC696/8dMCGpBzcQchFfi55Yrkja8F+P7cUt0LVTIg7u5ob5BexLZ/F1kO+ejmv+nq8w==", "dev": true, - "engines": { - "node": ">=14.16" + "dependencies": { + "chalk": "^5.0.1", + "is-plain-obj": "^4.1.0" }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/colors-option": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/colors-option/-/colors-option-4.5.0.tgz", - "integrity": "sha512-Soe5lerRg3erMRgYC0EC696/8dMCGpBzcQchFfi55Yrkja8F+P7cUt0LVTIg7u5ob5BexLZ/F1kO+ejmv+nq8w==", - "dev": true, - "dependencies": { - "chalk": "^5.0.1", - "is-plain-obj": "^4.1.0" - }, - "engines": { - "node": ">=14.18.0" + "engines": { + "node": ">=14.18.0" } }, "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/escape-string-regexp": { @@ -16579,104 +16542,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true, - "engines": { - "node": ">=12.20" - } - }, - "node_modules/netlify-cli/node_modules/fetch-node-website/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -16782,30 +16647,31 @@ "dev": true }, "node_modules/netlify-cli/node_modules/find-my-way": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.6.2.tgz", - "integrity": "sha512-0OjHn1b1nCX3eVbm9ByeEHiscPYiHLfhei1wOUU9qffQkk98wE0Lo8VrVYfSGMgnSnDh86DxedduAnBf4nwUEw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-8.2.0.tgz", + "integrity": "sha512-HdWXgFYc6b1BJcOBDBwjqWuHJj1WYiqrxSh25qtU4DabpMFdj/gSunNBQb83t+8Zt67D7CXEzJWTkxaShMTMOA==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-querystring": "^1.0.0", - "safe-regex2": "^2.0.0" + "safe-regex2": "^3.1.0" }, "engines": { "node": ">=14" } }, "node_modules/netlify-cli/node_modules/find-up": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", - "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", + "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", "dev": true, "dependencies": { - "locate-path": "^7.1.0", - "path-exists": "^5.0.0" + "locate-path": "^7.2.0", + "path-exists": "^5.0.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -16877,13 +16743,32 @@ } } }, - "node_modules/netlify-cli/node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "node_modules/netlify-cli/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/netlify-cli/node_modules/form-data-encoder": { @@ -16916,18 +16801,6 @@ "node": ">= 0.6" } }, - "node_modules/netlify-cli/node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -17093,6 +16966,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/netlify-cli/node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/get-intrinsic": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", @@ -17146,15 +17031,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/gh-release-fetch": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/gh-release-fetch/-/gh-release-fetch-4.0.3.tgz", @@ -17169,24 +17045,6 @@ "node": "^14.18.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/netlify-cli/node_modules/gh-release-fetch/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/netlify-cli/node_modules/git-repo-info": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/git-repo-info/-/git-repo-info-2.1.1.tgz", @@ -17306,6 +17164,31 @@ "node": ">=0.6.0" } }, + "node_modules/netlify-cli/node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, "node_modules/netlify-cli/node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -17377,107 +17260,32 @@ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "node_modules/netlify-cli/node_modules/hasbin": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz", + "integrity": "sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==", "dev": true, "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" + "async": "~1.5" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.10" } }, - "node_modules/netlify-cli/node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "node_modules/netlify-cli/node_modules/hasbin/node_modules/async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/has-yarn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", - "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/hasbin": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/hasbin/-/hasbin-1.2.3.tgz", - "integrity": "sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==", - "dev": true, - "dependencies": { - "async": "~1.5" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/netlify-cli/node_modules/hasbin/node_modules/async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "dev": true, - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" }, "engines": { "node": ">=8" @@ -17507,18 +17315,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/netlify-cli/node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -17634,6 +17430,19 @@ "node": ">= 0.12.0" } }, + "node_modules/netlify-cli/node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, "node_modules/netlify-cli/node_modules/https-proxy-agent": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", @@ -17761,15 +17570,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/netlify-cli/node_modules/inquirer": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", @@ -18211,18 +18011,6 @@ "url": "https://github.com/sponsors/brc-dd" } }, - "node_modules/netlify-cli/node_modules/is-accessor-descriptor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", - "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/netlify-cli/node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -18241,12 +18029,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "node_modules/netlify-cli/node_modules/is-builtin-module": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", @@ -18259,18 +18041,6 @@ "node": ">=6" } }, - "node_modules/netlify-cli/node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/netlify-cli/node_modules/is-core-module": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", @@ -18283,31 +18053,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/netlify-cli/node_modules/is-data-descriptor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", - "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/is-descriptor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", - "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/netlify-cli/node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -18323,30 +18068,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/is-extendable/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -18380,6 +18101,21 @@ "node": ">=0.10.0" } }, + "node_modules/netlify-cli/node_modules/is-in-ci": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-0.1.0.tgz", + "integrity": "sha512-d9PXLEY0v1iJ64xLiQMJ51J128EYHAaOR4yZqQi8aHGfw6KgifM3/Viw1oZZ1GCVmb3gBuyhLyHj0HgR2DhSXQ==", + "dev": true, + "bin": { + "is-in-ci": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/is-inside-container": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", @@ -18429,6 +18165,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/is-installed-globally/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/netlify-cli/node_modules/is-interactive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", @@ -18441,12 +18186,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/is-node-process": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", - "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==", - "dev": true - }, "node_modules/netlify-cli/node_modules/is-npm": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", @@ -18498,22 +18237,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -18555,51 +18285,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", "dev": true, "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/is-wsl/node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" + "is-inside-container": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/is-yarn-global": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", - "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/netlify-cli/node_modules/is64bit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is64bit/-/is64bit-2.0.0.tgz", @@ -18628,18 +18328,30 @@ "dev": true }, "node_modules/netlify-cli/node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "engines": { + "node": ">=16" + } }, - "node_modules/netlify-cli/node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "node_modules/netlify-cli/node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, "node_modules/netlify-cli/node_modules/jest-get-type": { @@ -18777,6 +18489,15 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/netlify-cli/node_modules/json-schema-ref-resolver": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-1.0.1.tgz", + "integrity": "sha512-EJAj1pgHc1hxF6vo2Z3s69fMjO1INq6eGHXZ8Z6wCQeldCuwxGK9Sxf4/cScGn3FZubCVUehfWtcDM/PLteCQw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + } + }, "node_modules/netlify-cli/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -18855,10 +18576,13 @@ } }, "node_modules/netlify-cli/node_modules/jwt-decode": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "dev": true, + "engines": { + "node": ">=18" + } }, "node_modules/netlify-cli/node_modules/keep-func-props": { "version": "4.0.1", @@ -18873,9 +18597,9 @@ } }, "node_modules/netlify-cli/node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { "json-buffer": "3.0.1" @@ -18897,9 +18621,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/lambda-local": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/lambda-local/-/lambda-local-2.1.2.tgz", - "integrity": "sha512-nGTJn2JxZWcLGpNwXFmXC7UEXL7QCLieQWDiXs46vIv9y/gSPm/uHygEMCaym+HIziniAw0XIm+1VTrXCvG1Zw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/lambda-local/-/lambda-local-2.2.0.tgz", + "integrity": "sha512-bPcgpIXbHnVGfI/omZIlgucDqlf4LrsunwoKue5JdZeGybt8L6KyJz2Zu19ffuZwIwLj2NAI2ZyaqNT6/cetcg==", "dev": true, "dependencies": { "commander": "^10.0.1", @@ -18913,65 +18637,10 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/lambda-local/node_modules/winston": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", - "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", - "dev": true, - "dependencies": { - "@colors/colors": "^1.6.0", - "@dabh/diagnostics": "^2.0.2", - "async": "^3.2.3", - "is-stream": "^2.0.0", - "logform": "^2.4.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "safe-stable-stringify": "^2.3.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.5.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/netlify-cli/node_modules/latest-version": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", - "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", + "node_modules/netlify-cli/node_modules/latest-version": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", + "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", "dev": true, "dependencies": { "package-json": "^8.1.0" @@ -19020,20 +18689,20 @@ } }, "node_modules/netlify-cli/node_modules/light-my-request": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.8.0.tgz", - "integrity": "sha512-4BtD5C+VmyTpzlDPCZbsatZMJVgUIciSOwYhJDCbLffPZ35KoDkDj4zubLeHDEb35b4kkPeEv5imbh+RJxK/Pg==", + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.13.0.tgz", + "integrity": "sha512-9IjUN9ZyCS9pTG+KqTDEQo68Sui2lHsYBrfMyVUTTZ3XhH8PMZq7xO94Kr+eP9dhi/kcKsx4N41p2IXEBil1pQ==", "dev": true, "dependencies": { - "cookie": "^0.5.0", - "process-warning": "^2.0.0", + "cookie": "^0.6.0", + "process-warning": "^3.0.0", "set-cookie-parser": "^2.4.1" } }, "node_modules/netlify-cli/node_modules/light-my-request/node_modules/process-warning": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", - "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", "dev": true }, "node_modules/netlify-cli/node_modules/lines-and-columns": { @@ -19073,26 +18742,26 @@ } }, "node_modules/netlify-cli/node_modules/listr2": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", - "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.1.tgz", + "integrity": "sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==", "dev": true, "dependencies": { - "cli-truncate": "^3.1.0", + "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", - "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" + "log-update": "^6.0.0", + "rfdc": "^1.3.1", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/netlify-cli/node_modules/listr2/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, "node_modules/netlify-cli/node_modules/listr2/node_modules/eventemitter3": { @@ -19102,34 +18771,34 @@ "dev": true }, "node_modules/netlify-cli/node_modules/listr2/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/listr2/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "dev": true, "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -19353,50 +19022,47 @@ } }, "node_modules/netlify-cli/node_modules/log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", + "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", "dev": true, "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" + "chalk": "^5.3.0", + "is-unicode-supported": "^1.3.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", + "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", "dev": true, "dependencies": { - "ansi-escapes": "^5.0.0", + "ansi-escapes": "^6.2.0", "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/log-update/node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", + "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", "dev": true, - "dependencies": { - "type-fest": "^1.0.2" - }, "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -19418,11 +19084,26 @@ } }, "node_modules/netlify-cli/node_modules/log-update/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, + "node_modules/netlify-cli/node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/log-update/node_modules/restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", @@ -19439,47 +19120,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/netlify-cli/node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/log-update/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "node_modules/netlify-cli/node_modules/log-update/node_modules/string-width": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/log-update/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "dev": true, "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -19498,6 +19183,18 @@ "triple-beam": "^1.3.0" } }, + "node_modules/netlify-cli/node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -19561,37 +19258,16 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "node_modules/netlify-cli/node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/maxstache": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/maxstache/-/maxstache-1.0.7.tgz", - "integrity": "sha1-IjHVGAung9Xs/DHEX+2seuQnaYQ=", + "integrity": "sha512-53ZBxHrZM+W//5AcRVewiLpDunHnucfdzZUGz54Fnvo4tE+J3p8EL66kBrs2UhBXvYKTWckWYYWBqJqoTcenqg==", "dev": true }, "node_modules/netlify-cli/node_modules/maxstache-stream": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/maxstache-stream/-/maxstache-stream-1.0.4.tgz", - "integrity": "sha1-nH9cq35f3S2Q2oYUO06WMeoygEA=", + "integrity": "sha512-v8qlfPN0pSp7bdSoLo1NTjG43GXGqk5W2NWFnOCq2GlmFFqebGzPCjLKSbShuqIOVorOtZSAy7O/S1OCCRONUw==", "dev": true, "dependencies": { "maxstache": "^1.0.0", @@ -19798,6 +19474,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -19853,19 +19541,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -20026,28 +19701,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/netlify-cli/node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -20070,12 +19723,12 @@ "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.15", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.15.tgz", - "integrity": "sha512-6gZ2lMcjqiXqirwbxeXoNyQn1LcW18s8zdR9eTS8Dtuqg/h4JxI7y9ahV9fypfp0bdaTt8hkBoopBJXLQPsJmA==", + "version": "13.1.17", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.17.tgz", + "integrity": "sha512-rwNArhc36BgRWRxx88q+tNR3eSH89SQwk78t/m63k1z3Z/b7G4+0LxN9409cdhyM9/o/phNv80dNmLyhMGnopQ==", "dev": true, "dependencies": { - "@netlify/open-api": "^2.30.0", + "@netlify/open-api": "^2.31.0", "lodash-es": "^4.17.21", "micro-api-client": "^3.3.0", "node-fetch": "^3.0.0", @@ -20138,9 +19791,9 @@ } }, "node_modules/netlify-cli/node_modules/netlify-redirect-parser": { - "version": "14.2.2", - "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.2.2.tgz", - "integrity": "sha512-LS3cbHZfATtfZFeJr8RLBREAjCE1rEG1CybKnA6dTLgXez0lGJE/QTPzjn6GqfNmiMowo15YQe4+UjRhbzQ04w==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-14.3.0.tgz", + "integrity": "sha512-/Oqq+SrTXk8hZqjCBy0AkWf5qAhsgcsdxQA09uYFdSSNG5w9rhh17a7dp77o5Q5XoHCahm8u4Kig/lbXkl4j2g==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -20168,24 +19821,6 @@ "integrity": "sha512-4zdzIP+6muqPCuE8avnrgDJ6KW/2+UpHTRcTbMXCIRxiRmyrX+IZ4WSJGZdHPWF3WmQpXpy603XxecZ9iygN7w==", "dev": true }, - "node_modules/netlify-cli/node_modules/netlify/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/netlify-cli/node_modules/netlify/node_modules/p-timeout": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", @@ -20254,23 +19889,21 @@ } }, "node_modules/netlify-cli/node_modules/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/netlify-cli/node_modules/node-fetch-native": { @@ -20350,12 +19983,6 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/noop2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/noop2/-/noop2-2.0.0.tgz", - "integrity": "sha1-S2NgFemIK1R4PAK0EvaZ2MXNCls=", - "dev": true - }, "node_modules/netlify-cli/node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -20409,9 +20036,21 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "node_modules/netlify-cli/node_modules/normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { @@ -20463,57 +20102,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/object-inspect": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", @@ -20523,30 +20111,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/netlify-cli/node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/ofetch": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", @@ -20674,24 +20238,36 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/open/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/netlify-cli/node_modules/ora": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", - "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.0.1.tgz", + "integrity": "sha512-ANIvzobt1rls2BDny5fWZ3ZVKyD6nscLvfFRpQgfWsythlcsVUC9kL0zq6j2Z5z9wwp1kd7wpsD/T9qNPVLCaQ==", "dev": true, "dependencies": { - "chalk": "^5.0.0", + "chalk": "^5.3.0", "cli-cursor": "^4.0.0", - "cli-spinners": "^2.6.1", + "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.1.0", - "log-symbols": "^5.1.0", - "stdin-discarder": "^0.1.0", - "strip-ansi": "^7.0.1", - "wcwidth": "^1.0.1" + "is-unicode-supported": "^2.0.0", + "log-symbols": "^6.0.0", + "stdin-discarder": "^0.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -20712,6 +20288,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/ora/node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/ora/node_modules/is-unicode-supported": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", + "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/ora/node_modules/restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", @@ -20728,6 +20322,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/ora/node_modules/string-width": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/os-name": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", @@ -20753,11 +20364,14 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/outvariant": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.2.tgz", - "integrity": "sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==", - "dev": true + "node_modules/netlify-cli/node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, + "engines": { + "node": ">=12.20" + } }, "node_modules/netlify-cli/node_modules/p-event": { "version": "5.0.1", @@ -20786,260 +20400,84 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/p-every": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-every/-/p-every-2.0.0.tgz", - "integrity": "sha512-MCz9DqD5opPC48Zsd+BHm56O/HfhYIQQtupfDzhXoVgQdg/Ux4F8/JcdRuQ+arq7zD5fB6zP3axbH3d9Nr8dlw==", - "dev": true, - "dependencies": { - "p-map": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/netlify-cli/node_modules/p-every/node_modules/p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/netlify-cli/node_modules/p-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", - "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", - "dev": true, - "dependencies": { - "p-map": "^5.1.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-map": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", - "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", - "dev": true, - "dependencies": { - "aggregate-error": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-reduce": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", - "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-retry": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", - "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", - "dev": true, - "dependencies": { - "@types/retry": "0.12.1", - "retry": "^0.13.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-timeout": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", - "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/p-wait-for": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-5.0.2.tgz", - "integrity": "sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==", - "dev": true, - "dependencies": { - "p-timeout": "^6.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", - "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", - "dev": true, - "dependencies": { - "got": "^12.1.0", - "registry-auth-token": "^5.0.1", - "registry-url": "^6.0.0", - "semver": "^7.3.7" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "node_modules/netlify-cli/node_modules/p-every": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-every/-/p-every-2.0.0.tgz", + "integrity": "sha512-MCz9DqD5opPC48Zsd+BHm56O/HfhYIQQtupfDzhXoVgQdg/Ux4F8/JcdRuQ+arq7zD5fB6zP3axbH3d9Nr8dlw==", "dev": true, "dependencies": { - "defer-to-connect": "^2.0.1" + "p-map": "^2.0.0" }, "engines": { - "node": ">=14.16" + "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "node_modules/netlify-cli/node_modules/p-every/node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", "dev": true, "engines": { - "node": ">=14.16" + "node": ">=6" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "node_modules/netlify-cli/node_modules/p-filter": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-4.1.0.tgz", + "integrity": "sha512-37/tPdZ3oJwHaS3gNJdenCDB3Tz26i9sjhnguBtvN0vYlRIiDNnvTWkuh+0hETV9rLPdJ3rlL3yVOYPIAnM8rw==", "dev": true, "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" + "p-map": "^7.0.1" }, "engines": { - "node": ">=14.16" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "node_modules/netlify-cli/node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true, - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" + "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", + "node_modules/netlify-cli/node_modules/p-map": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", + "integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==", "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, "engines": { - "node": ">=10.19.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/lowercase-keys": { + "node_modules/netlify-cli/node_modules/p-reduce": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "node_modules/netlify-cli/node_modules/p-retry": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", "dev": true, + "dependencies": { + "@types/retry": "0.12.1", + "retry": "^0.13.1" + }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -21047,10 +20485,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/normalize-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", - "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "node_modules/netlify-cli/node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "dev": true, "engines": { "node": ">=14.16" @@ -21059,22 +20497,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "node_modules/netlify-cli/node_modules/p-wait-for": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-5.0.2.tgz", + "integrity": "sha512-lwx6u1CotQYPVju77R+D0vFomni/AqRfqLmqQ8hekklqZ6gAY9rONh7lBQ0uxWMkC2AuX9b2DVAl8To0NyP1JA==", "dev": true, + "dependencies": { + "p-timeout": "^6.0.0" + }, "engines": { - "node": ">=12.20" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/package-json/node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "node_modules/netlify-cli/node_modules/package-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", + "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", "dev": true, "dependencies": { - "lowercase-keys": "^3.0.0" + "got": "^12.1.0", + "registry-auth-token": "^5.0.1", + "registry-url": "^6.0.0", + "semver": "^7.3.7" }, "engines": { "node": ">=14.16" @@ -21169,15 +20616,6 @@ "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -21205,6 +20643,31 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/netlify-cli/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/netlify-cli/node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -21263,94 +20726,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/netlify-cli/node_modules/pino-abstract-transport": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", - "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", - "dev": true, - "dependencies": { - "readable-stream": "^4.0.0", - "split2": "^4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dev": true, - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/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==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "dev": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/netlify-cli/node_modules/pino-abstract-transport/node_modules/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==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/netlify-cli/node_modules/pkg-types": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", @@ -21362,15 +20737,6 @@ "pathe": "^1.1.0" } }, - "node_modules/netlify-cli/node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/postcss": { "version": "8.4.38", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", @@ -21929,9 +21295,34 @@ }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/read-pkg": { @@ -21952,18 +21343,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/read-pkg-up/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -22066,28 +21445,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/regex-not/node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, "node_modules/netlify-cli/node_modules/registry-auth-token": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", @@ -22121,15 +21478,6 @@ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, - "node_modules/netlify-cli/node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -22201,12 +21549,20 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true + "node_modules/netlify-cli/node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dev": true, + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/netlify-cli/node_modules/restore-cursor": { "version": "2.0.0", @@ -22242,15 +21598,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, "node_modules/netlify-cli/node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", @@ -22271,9 +21618,9 @@ } }, "node_modules/netlify-cli/node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", "dev": true }, "node_modules/netlify-cli/node_modules/rimraf": { @@ -22348,21 +21695,21 @@ "dev": true }, "node_modules/netlify-cli/node_modules/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==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-3.1.0.tgz", + "integrity": "sha512-RAAZAGbap2kBfbVhvmnTFv73NWLMvDGOITFYTZBAaY8eR+Ir4ef7Up/e7amo+y1+AH+3PtLkrt9mvcTsG9LXug==", "dev": true, "dependencies": { - "ret": "~0.2.0" + "ret": "~0.4.0" } }, "node_modules/netlify-cli/node_modules/safe-regex2/node_modules/ret": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", - "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.4.3.tgz", + "integrity": "sha512-0f4Memo5QP7WQyUEAYUO3esD/XjOc3Zjjg5CPsAq1p8sIu0XPeMbHJemKA0BO7tV0X7+A0FoEpbmHXWxPyD3wQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/netlify-cli/node_modules/safe-stable-stringify": { @@ -22381,9 +21728,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/secure-json-parse": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.6.0.tgz", - "integrity": "sha512-B9osKohb6L+EZ6Kve3wHKfsAClzOC/iISA2vSuCe5Jx5NAKiwitfxx8ZKYapHXr0sYRj7UZInT7pLb3rp2Yx6A==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", + "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==", "dev": true }, "node_modules/netlify-cli/node_modules/seek-bzip": { @@ -22406,13 +21753,10 @@ "dev": true }, "node_modules/netlify-cli/node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -22526,54 +21870,6 @@ "integrity": "sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/set-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/set-value/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -22766,145 +22062,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/netlify-cli/node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/sonic-boom": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.0.tgz", - "integrity": "sha512-ybz6OYOUjoQQCQ/i4LU8kaToD8ACtYP+Cj5qd2AO36bwbdewxWJ3ArmJ2cr6AvxlL2o0PqnCcPGUgkILbfkaCA==", - "dev": true, - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, "node_modules/netlify-cli/node_modules/sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", @@ -22938,15 +22095,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -22956,20 +22104,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, "node_modules/netlify-cli/node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -22989,13 +22123,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated", - "dev": true - }, "node_modules/netlify-cli/node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -23028,18 +22155,6 @@ "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", "dev": true }, - "node_modules/netlify-cli/node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/stack-generator": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", @@ -23050,64 +22165,26 @@ } }, "node_modules/netlify-cli/node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/netlify-cli/node_modules/stackframe": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", - "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/standard-as-callback": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", - "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", - "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.1", - "is-data-descriptor": "^1.0.1" - }, "engines": { - "node": ">= 0.4" + "node": "*" } }, + "node_modules/netlify-cli/node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", + "dev": true + }, "node_modules/netlify-cli/node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -23124,55 +22201,17 @@ "dev": true }, "node_modules/netlify-cli/node_modules/stdin-discarder": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", - "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", + "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", "dev": true, - "dependencies": { - "bl": "^5.0.0" - }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/netlify-cli/node_modules/stdin-discarder/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/netlify-cli/node_modules/streamx": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.0.tgz", @@ -23183,12 +22222,6 @@ "queue-tick": "^1.0.1" } }, - "node_modules/netlify-cli/node_modules/strict-event-emitter": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", - "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", - "dev": true - }, "node_modules/netlify-cli/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -23212,6 +22245,42 @@ "node": ">=8" } }, + "node_modules/netlify-cli/node_modules/string-width-cjs": { + "name": "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, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/string-width-cjs/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/netlify-cli/node_modules/string-width-cjs/node_modules/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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/netlify-cli/node_modules/string-width/node_modules/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", @@ -23248,6 +22317,19 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/netlify-cli/node_modules/strip-ansi-cjs": { + "name": "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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/netlify-cli/node_modules/strip-ansi-control-characters": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-ansi-control-characters/-/strip-ansi-control-characters-2.0.0.tgz", @@ -23472,22 +22554,22 @@ } }, "node_modules/netlify-cli/node_modules/temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=14.16" } }, "node_modules/netlify-cli/node_modules/tempy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.0.0.tgz", - "integrity": "sha512-B2I9X7+o2wOaW4r/CWMkpOO9mdiTRCxXNgob6iGvPmfPWgH/KyUD6Uy5crtWBxIBe3YrNZKR2lSzv1JJKWD4vA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tempy/-/tempy-3.1.0.tgz", + "integrity": "sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==", "dev": true, "dependencies": { "is-stream": "^3.0.0", - "temp-dir": "^2.0.0", + "temp-dir": "^3.0.0", "type-fest": "^2.12.2", "unique-string": "^3.0.0" }, @@ -23498,13 +22580,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/tempy/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "node_modules/netlify-cli/node_modules/tempy/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { - "node": ">=12.20" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -23559,89 +22641,43 @@ "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", "dev": true }, - "node_modules/netlify-cli/node_modules/thread-stream": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", - "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", - "dev": true, - "dependencies": { - "real-require": "^0.2.0" - } - }, "node_modules/netlify-cli/node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "node_modules/netlify-cli/node_modules/through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/through2-filter/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/netlify-cli/node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "readable-stream": "3" } }, - "node_modules/netlify-cli/node_modules/through2-filter/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "node_modules/netlify-cli/node_modules/through2-filter": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-4.0.0.tgz", + "integrity": "sha512-P8IpQL19bSdXqGLvLdbidYRxERXgHEXGcQofPxbLpPkqS1ieOrUrocdYRTNv8YwSukaDJWr71s6F2kZ3bvgEhA==", "dev": true, "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "through2": "^4.0.2" + }, + "engines": { + "node": ">= 6" } }, "node_modules/netlify-cli/node_modules/through2-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-map/-/through2-map-3.0.0.tgz", - "integrity": "sha512-Ms68QPbSJKjRYY7fmqZHB0VGt+vD0/tjmDHUWgxltjifCof6hZWWeQAEi27Wjbs7jyNlIIyerQw/TVj7gHkd/Q==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/netlify-cli/node_modules/through2-map/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/netlify-cli/node_modules/through2-map/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/through2-map/-/through2-map-4.0.0.tgz", + "integrity": "sha512-+rpmDB5yckiBGEuqJSsWYWMs9e1zdksypDKvByysEyN+knhsPXV9Z6O2mA9meczIa6AON7bi2G3xWk5T8UG4zQ==", "dev": true, "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "through2": "^4.0.2" + }, + "engines": { + "node": ">= 6" } }, "node_modules/netlify-cli/node_modules/time-zone": { @@ -23653,15 +22689,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/tiny-lru": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-11.0.1.tgz", - "integrity": "sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/netlify-cli/node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -23704,30 +22731,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/to-readable-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-3.0.0.tgz", @@ -23740,21 +22743,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -23767,13 +22755,13 @@ "node": ">=8.0" } }, - "node_modules/netlify-cli/node_modules/to-regex/node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "node_modules/netlify-cli/node_modules/toad-cache": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.0.tgz", + "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==", "dev": true, - "dependencies": { - "ret": "~0.1.10" + "engines": { + "node": ">=12" } }, "node_modules/netlify-cli/node_modules/toidentifier": { @@ -23911,6 +22899,18 @@ "node": "*" } }, + "node_modules/netlify-cli/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -24017,43 +23017,19 @@ "mime": "cli.js" }, "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/netlify-cli/node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "dev": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=10.0.0" } }, - "node_modules/netlify-cli/node_modules/union-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "node_modules/netlify-cli/node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/unique-string": { @@ -24072,9 +23048,9 @@ } }, "node_modules/netlify-cli/node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", "dev": true }, "node_modules/netlify-cli/node_modules/unix-dgram": { @@ -24125,54 +23101,6 @@ "node": ">= 0.8" } }, - "node_modules/netlify-cli/node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/untildify": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", @@ -24197,28 +23125,26 @@ } }, "node_modules/netlify-cli/node_modules/update-notifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", - "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-7.0.0.tgz", + "integrity": "sha512-Hv25Bh+eAbOLlsjJreVPOs4vd51rrtCrmhyOJtbpAojro34jS4KQaEp4/EvlHJX7jSO42VvEFpkastVyXyIsdQ==", "dev": true, "dependencies": { - "boxen": "^7.0.0", - "chalk": "^5.0.1", + "boxen": "^7.1.1", + "chalk": "^5.3.0", "configstore": "^6.0.0", - "has-yarn": "^3.0.0", "import-lazy": "^4.0.0", - "is-ci": "^3.0.1", + "is-in-ci": "^0.1.0", "is-installed-globally": "^0.4.0", "is-npm": "^6.0.0", - "is-yarn-global": "^0.4.0", "latest-version": "^7.0.0", "pupa": "^3.1.0", - "semver": "^7.3.7", + "semver": "^7.5.4", "semver-diff": "^4.0.0", "xdg-basedir": "^5.1.0" }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/yeoman/update-notifier?sponsor=1" @@ -24239,28 +23165,12 @@ "punycode": "^2.1.0" } }, - "node_modules/netlify-cli/node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, "node_modules/netlify-cli/node_modules/urlpattern-polyfill": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz", "integrity": "sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==", "dev": true }, - "node_modules/netlify-cli/node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -24327,9 +23237,9 @@ } }, "node_modules/netlify-cli/node_modules/wait-port": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.0.4.tgz", - "integrity": "sha512-w8Ftna3h6XSFWWc2JC5gZEgp64nz8bnaTp5cvzbJSZ53j+omktWTDdwXxEF0jM8YveviLgFWvNGrSvRHnkyHyw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.1.0.tgz", + "integrity": "sha512-3e04qkoN3LxTMLakdqeWth8nih8usyg+sf1Bgdf9wwUkp05iuK1eSY/QpLvscT/+F/gA89+LpUmmgBtesbqI2Q==", "dev": true, "dependencies": { "chalk": "^4.1.2", @@ -24413,15 +23323,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/netlify-cli/node_modules/web-streams-polyfill": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", @@ -24471,6 +23372,12 @@ "node": ">= 8" } }, + "node_modules/netlify-cli/node_modules/which/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", @@ -24533,10 +23440,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/winston": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz", + "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==", + "dev": true, + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.4.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.7.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/netlify-cli/node_modules/winston-transport": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz", + "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==", "dev": true, "dependencies": { "logform": "^2.3.2", @@ -24544,7 +23473,28 @@ "triple-beam": "^1.3.0" }, "engines": { - "node": ">= 6.4.0" + "node": ">= 12.0.0" + } + }, + "node_modules/netlify-cli/node_modules/winston/node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/netlify-cli/node_modules/winston/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/netlify-cli/node_modules/word-wrap": { @@ -24573,6 +23523,69 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/netlify-cli/node_modules/wrap-ansi-cjs": { + "name": "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, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/wrap-ansi-cjs/node_modules/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/wrap-ansi-cjs/node_modules/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, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/netlify-cli/node_modules/wrap-ansi-cjs/node_modules/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 + }, + "node_modules/netlify-cli/node_modules/wrap-ansi-cjs/node_modules/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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/netlify-cli/node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -24650,9 +23663,9 @@ } }, "node_modules/netlify-cli/node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", + "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", "dev": true, "engines": { "node": ">=10.0.0" @@ -24800,36 +23813,93 @@ "node": ">=6" } }, - "node_modules/netlify-cli/node_modules/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==", + "node_modules/netlify-cli/node_modules/zip-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz", + "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "archiver-utils": "^5.0.0", + "compress-commons": "^6.0.2", + "readable-stream": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 14" } }, - "node_modules/netlify-cli/node_modules/zip-stream": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz", - "integrity": "sha512-UfZ0oa0C8LI58wJ+moL46BDIMgCQbnsb+2PoiJYtonhBsMh2bq1eRBVkvjfVsqbEHd9/EgKPUuL9saSSsec8OA==", + "node_modules/netlify-cli/node_modules/zip-stream/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "archiver-utils": "^4.0.1", - "compress-commons": "^5.0.1", - "readable-stream": "^3.6.0" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/netlify-cli/node_modules/zip-stream/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" }, "engines": { - "node": ">= 12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/netlify-cli/node_modules/zip-stream/node_modules/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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/netlify-cli/node_modules/zip-stream/node_modules/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==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" } }, "node_modules/netlify-cli/node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", "dev": true, "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -28329,12 +27399,13 @@ } }, "node_modules/playwright": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.1.tgz", - "integrity": "sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA==", + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.1.tgz", + "integrity": "sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.43.1" + "playwright-core": "1.44.1" }, "bin": { "playwright": "cli.js" @@ -28347,10 +27418,11 @@ } }, "node_modules/playwright-core": { - "version": "1.43.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.1.tgz", - "integrity": "sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg==", + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz", + "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==", "dev": true, + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, diff --git a/package.json b/package.json index 7ce4762..64f93b1 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.43.1", + "@playwright/test": "1.44.1", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.12.8", + "@types/node": "20.14.0", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.23.1", + "netlify-cli": "17.25.0", "shx": "0.3.4", "vitest": "1.6.0" }, From 6055190eb3b9a0b26a2600238bfcc7f4dc46483c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 00:14:36 +0000 Subject: [PATCH 18/26] chore(deps): update devdependencies-non-major --- package-lock.json | 1920 ++++++++++++++++++++++++++++++++++----------- package.json | 4 +- 2 files changed, 1468 insertions(+), 456 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7320671..0a85297 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,10 +28,10 @@ "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.0", + "@types/node": "20.14.2", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.25.0", + "netlify-cli": "17.27.0", "shx": "0.3.4", "vitest": "1.6.0" } @@ -2592,9 +2592,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.14.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.0.tgz", - "integrity": "sha512-5cHBxFGJx6L4s56Bubp4fglrEpmyJypsqI6RgzMfBHWUJQGWAAi8cWcgetEbZXHYXo9C2Fa4EEds/uSyS4cxmA==", + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "devOptional": true, "license": "MIT", "dependencies": { @@ -7838,9 +7838,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.25.0", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.25.0.tgz", - "integrity": "sha512-XPEc6quX+yWWFMJIdD6XKT5slV5FdiHhwcVc5BYeI2UWdjpg+Z1l8/PobL+McZkzsfv4ctnvt43ioOCCx7gJMQ==", + "version": "17.27.0", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.27.0.tgz", + "integrity": "sha512-DG7o1BvcIAV1Lxa6CaXlwhw2mUO21Kdc8RpdXLdeBHQ5p042nOjTXu4NsTU4KJuafOxmLsoj4nSxSo1j9BhfOA==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7849,13 +7849,13 @@ "@bugsnag/js": "7.23.0", "@fastify/static": "7.0.4", "@netlify/blobs": "7.3.0", - "@netlify/build": "29.46.0", + "@netlify/build": "29.47.2", "@netlify/build-info": "7.13.2", - "@netlify/config": "20.13.1", + "@netlify/config": "20.15.2", "@netlify/edge-bundler": "12.0.1", "@netlify/edge-functions": "2.8.1", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.34.0", + "@netlify/zip-it-and-ship-it": "9.34.3", "@octokit/rest": "20.1.1", "@opentelemetry/api": "1.8.0", "ansi-escapes": "7.0.0", @@ -7876,7 +7876,7 @@ "content-type": "1.0.5", "cookie": "0.6.0", "cron-parser": "4.9.0", - "debug": "4.3.4", + "debug": "4.3.5", "decache": "4.6.2", "dot-prop": "9.0.0", "dotenv": "16.4.5", @@ -7922,7 +7922,7 @@ "maxstache": "1.0.7", "maxstache-stream": "1.0.4", "multiparty": "4.2.3", - "netlify": "13.1.17", + "netlify": "13.1.18", "netlify-headers-parser": "7.1.4", "netlify-redirect-parser": "14.3.0", "netlify-redirector": "0.5.0", @@ -7970,101 +7970,46 @@ } }, "node_modules/netlify-cli/node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/netlify-cli/node_modules/@babel/code-frame/node_modules/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, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.6.tgz", - "integrity": "sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/netlify-cli/node_modules/@babel/helper-validator-identifier": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", - "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/netlify-cli/node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -8127,9 +8072,9 @@ } }, "node_modules/netlify-cli/node_modules/@babel/parser": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", - "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -8139,13 +8084,13 @@ } }, "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.5.tgz", - "integrity": "sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.6.tgz", + "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.1", - "@babel/helper-validator-identifier": "^7.24.5", + "@babel/helper-string-parser": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.6", "to-fast-properties": "^2.0.0" }, "engines": { @@ -8243,13 +8188,13 @@ } }, "node_modules/netlify-cli/node_modules/@dependents/detective-less": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.0.0.tgz", - "integrity": "sha512-0udn+HKjGUzTX4Z+0vXdEJVsO28gxy5QxWjeChK4ZH+bwdvIXLuztiGZk8wLyAG1+LNZ5haVHKr5j1XfJnAkyQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.1.0.tgz", + "integrity": "sha512-KrkT6qO5NxqNfy68sBl6CTSoJ4SNDIS5iQArkibhlbGU4LaDukZ3q2HIkh8aUKDio6o4itU4xDR7t82Y2eP1Bg==", "dev": true, "dependencies": { "gonzales-pe": "^4.3.0", - "node-source-walk": "^6.0.0" + "node-source-walk": "^6.0.1" }, "engines": { "node": ">=14" @@ -8808,6 +8753,37 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.8.tgz", + "integrity": "sha512-vYVqYzHicDqyKB+NQhAc54I1QWCBLCrYG6unqOIcBTHx+7x8C9lcoLj3KVJXs2VB4lUbpWY+Kk9NipcbXYWmvg==", + "dev": true, + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "dev": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", @@ -9003,6 +8979,16 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/netlify-cli/node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/netlify-cli/node_modules/@lukeed/ms": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", @@ -9081,23 +9067,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.46.0", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.46.0.tgz", - "integrity": "sha512-HI3RgsCge1qLzGUUKnU95t9ylPKQBSdZyFKBeLHH+zHc8yi/0Qe/lVjAnkBF9KrPgbpV4qWG1C7W504cfS8LQg==", + "version": "29.47.2", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.47.2.tgz", + "integrity": "sha512-k72FGXoCdeVybvqoZSYPjU0PX0P05isHGKGnvvbrqY7jCKhzHdqt8ePOs20uCmK5k9AcNqbnbg/oNY/OO+LYwQ==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^7.3.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.13.0", + "@netlify/config": "^20.15.2", "@netlify/edge-bundler": "12.0.1", "@netlify/framework-info": "^9.8.13", - "@netlify/functions-utils": "^5.2.60", + "@netlify/functions-utils": "^5.2.63", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.2.1", "@netlify/plugins-list": "^6.80.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.34.0", + "@netlify/zip-it-and-ship-it": "9.34.3", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9671,9 +9657,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.13.1", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.13.1.tgz", - "integrity": "sha512-5SnaPf/V0bxeI+9hLgTYHdyMaasLMwQZhN+b1BI0WbfHTx/cVHYphOeqd5hQQHrFsuTDFQ1P/uaykSPfA57iLw==", + "version": "20.15.2", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.15.2.tgz", + "integrity": "sha512-nPakZuXLiQ6b5OshwB7Jmbjirj15E3/yMlBqx6VUrSln8cE/aohtmH157ZZdw9RKqk5Fd71kDFZmhAhmarhvmg==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -9690,7 +9676,7 @@ "is-plain-obj": "^4.0.0", "js-yaml": "^4.0.0", "map-obj": "^5.0.0", - "netlify": "^13.1.17", + "netlify": "^13.1.18", "netlify-headers-parser": "^7.1.4", "netlify-redirect-parser": "^14.3.0", "node-fetch": "^3.3.1", @@ -10342,32 +10328,6 @@ "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/@vercel/nft": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.27.0.tgz", - "integrity": "sha512-W5pValyhToK9hbgEUAM6sLRUIl1I++RsFnXKHXtND50P1+vZ+OYPCzq1OOz0Ok6ghK6aOwae8G/rEAXkLedC+w==", - "dev": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "acorn-import-attributes": "^1.9.5", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, - "engines": { - "node": ">=16" - } - }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", @@ -10746,12 +10706,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.60", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.60.tgz", - "integrity": "sha512-gTzrajMk4rkJgDQnKprVB/wanQja6vF8NRfL8KW5eiVDWKaLqNqWpZmYOp80uD2k9Oxvowt6+BjPupwkOORKWA==", + "version": "5.2.63", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.63.tgz", + "integrity": "sha512-bRPX1nsxx2b3FcExKVoqZUcYz0FYe1NKLLr0IVhAKa8p64qX73tRmmKts9YDexzkrTYUdJtcvmLIFq5cpxb/bQ==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.34.0", + "@netlify/zip-it-and-ship-it": "9.34.3", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -11113,9 +11073,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.31.0", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.31.0.tgz", - "integrity": "sha512-g7bZej+AL+n5TdXwSa3PVGZ53SqNIt/TahyWuGziRagyDZmTeEE3Md/KEV+c+qo5Os0k4aNkGhkY2amD2elOMg==", + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.32.0.tgz", + "integrity": "sha512-pw3tfLvKm/6RwF2fNAXe1tJyf6R9OgU/wuGz//N3jhig0FGVNusbt+bwcj5eTzwOvCb0KkUh0OLT8e1gSSz8qQ==", "dev": true, "engines": { "node": ">=14" @@ -11241,16 +11201,16 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.34.0.tgz", - "integrity": "sha512-nv3UVZGbZDaAmkqmBqpEAhKihBB3sHEJqu2GUHujSdRJ6oZy8J5/jCSz0kmWTdzKTrcF+Y74QnNRLU83sQMqxg==", + "version": "9.34.3", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.34.3.tgz", + "integrity": "sha512-mWdGjUNAvqLc9Vt3eufSWj1Rk3Wj6uKuh0Zw6gvHmxNBA4rUz/0Z9Fjc5NxR7WHMQtzX4AHo2ol2qFow1B2Y5Q==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", - "@babel/types": "7.24.5", + "@babel/types": "7.24.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.18.2", - "@vercel/nft": "^0.23.0", + "@netlify/serverless-functions-api": "^1.18.3", + "@vercel/nft": "^0.27.1", "archiver": "^7.0.0", "common-path-prefix": "^3.0.0", "cp-file": "^10.0.0", @@ -11288,23 +11248,146 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@netlify/serverless-functions-api": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.2.tgz", - "integrity": "sha512-KHhcNWP1B+8Io2aAobzRRuT1FSWb7Bfsih16dxKgaU9IgP/OxMVvssbmhRAmoR01rVGhQEiNN0vk6juMzOafOw==", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.3.tgz", + "integrity": "sha512-j89Zu4nu+ZYaBMXARKniUHc3B65BV4dJOmIUbNfWmBjiHth9gU/K9LQDvcjzy4TPXd9Wq0+DBsdVZlYbZKTuYw==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", "@opentelemetry/core": "^1.23.0", - "@opentelemetry/otlp-transformer": "^0.50.0", + "@opentelemetry/otlp-transformer": "^0.51.0", "@opentelemetry/resources": "^1.23.0", - "@opentelemetry/sdk-trace-base": "^1.23.0", - "@opentelemetry/semantic-conventions": "^1.23.0", + "@opentelemetry/sdk-node": "^0.51.1", + "@opentelemetry/sdk-trace-node": "^1.24.1", "urlpattern-polyfill": "8.0.2" }, "engines": { "node": ">=18.0.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/api-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", + "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", + "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.51.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-logs": "0.51.1", + "@opentelemetry/sdk-metrics": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/sdk-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", + "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.9.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", + "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -11698,10 +11781,42 @@ "node": ">=8.0.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/api-logs": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.50.0.tgz", - "integrity": "sha512-JdZuKrhOYggqOpUljAq4WWNi5nB10PmgoF0y2CvedLGXd0kSawb/UBnWT8gg1ND3bHCNHStAIVT0ELlxJJRqrA==", + "node_modules/netlify-cli/node_modules/@opentelemetry/context-async-hooks": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.24.1.tgz", + "integrity": "sha512-R5r6DO4kgEOVBxFXhXjwospLQkv+sYxwCfjvoZBe7Zm6KKXAV9kDSJhi/D1BweowdZmO+sdbENLs374gER8hpQ==", + "dev": true, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.51.1.tgz", + "integrity": "sha512-P9+Hkszih95ITvldGZ+kXvj9HpD1QfS+PwooyHK72GYA+Bgm+yUSAsDkUkDms8+s9HW6poxURv3LcjaMuBBpVQ==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/otlp-grpc-exporter-base": "0.51.1", + "@opentelemetry/otlp-transformer": "0.51.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/api-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", + "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", "dev": true, "dependencies": { "@opentelemetry/api": "^1.0.0" @@ -11710,13 +11825,13 @@ "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/core": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.23.0.tgz", - "integrity": "sha512-hdQ/a9TMzMQF/BO8Cz1juA43/L5YGtCSiKoOHmrTEf7VMDAZgy8ucpWx3eQTnQ3gBloRcWtzvcrMZABC3PTSKQ==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.23.0" + "@opentelemetry/semantic-conventions": "1.24.1" }, "engines": { "node": ">=14" @@ -11725,18 +11840,18 @@ "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.50.0.tgz", - "integrity": "sha512-s0sl1Yfqd5q1Kjrf6DqXPWzErL+XHhrXOfejh4Vc/SMTNqC902xDsC8JQxbjuramWt/+hibfguIvi7Ns8VLolA==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", + "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", "dev": true, "dependencies": { - "@opentelemetry/api-logs": "0.50.0", - "@opentelemetry/core": "1.23.0", - "@opentelemetry/resources": "1.23.0", - "@opentelemetry/sdk-logs": "0.50.0", - "@opentelemetry/sdk-metrics": "1.23.0", - "@opentelemetry/sdk-trace-base": "1.23.0" + "@opentelemetry/api-logs": "0.51.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-logs": "0.51.1", + "@opentelemetry/sdk-metrics": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" }, "engines": { "node": ">=14" @@ -11745,14 +11860,14 @@ "@opentelemetry/api": ">=1.3.0 <1.9.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/resources": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.23.0.tgz", - "integrity": "sha512-iPRLfVfcEQynYGo7e4Di+ti+YQTAY0h5mQEUJcHlU9JOqpb4x965O6PZ+wMcwYVY63G96KtdS86YCM1BF1vQZg==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.23.0", - "@opentelemetry/semantic-conventions": "1.23.0" + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" }, "engines": { "node": ">=14" @@ -11761,14 +11876,14 @@ "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-logs": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.50.0.tgz", - "integrity": "sha512-PeUEupBB29p9nlPNqXoa1PUWNLsZnxG0DCDj3sHqzae+8y76B/A5hvZjg03ulWdnvBLYpnJslqzylG9E0IL87g==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", + "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.23.0", - "@opentelemetry/resources": "1.23.0" + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1" }, "engines": { "node": ">=14" @@ -11778,14 +11893,14 @@ "@opentelemetry/api-logs": ">=0.39.1" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.23.0.tgz", - "integrity": "sha512-4OkvW6+wST4h6LFG23rXSTf6nmTf201h9dzq7bE0z5R9ESEVLERZz6WXwE7PSgg1gdjlaznm1jLJf8GttypFDg==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", + "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.23.0", - "@opentelemetry/resources": "1.23.0", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", "lodash.merge": "^4.6.2" }, "engines": { @@ -11795,15 +11910,15 @@ "@opentelemetry/api": ">=1.3.0 <1.9.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.23.0.tgz", - "integrity": "sha512-PzBmZM8hBomUqvCddF/5Olyyviayka44O5nDWq673np3ctnvwMOvNrsUORZjKja1zJbwEuD9niAGbnVrz3jwRQ==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.23.0", - "@opentelemetry/resources": "1.23.0", - "@opentelemetry/semantic-conventions": "1.23.0" + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" }, "engines": { "node": ">=14" @@ -11812,70 +11927,869 @@ "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.23.0.tgz", - "integrity": "sha512-MiqFvfOzfR31t8cc74CTP1OZfz7MbqpAnLCra8NqQoaHJX6ncIRTdYOQYBDQ2uFISDq0WY8Y9dDTWvsgzzBYRg==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", "dev": true, "engines": { "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@parcel/watcher": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.0.tgz", - "integrity": "sha512-XJLGVL0DEclX5pcWa2N9SX1jCGTDd8l972biNooLFtjneuGqodupPQh6XseXIBBeVIMaaJ7bTcs3qGvXwsp4vg==", + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.51.1.tgz", + "integrity": "sha512-n+LhLPsX07URh+HhV2SHVSvz1t4G/l/CE5BjpmhAPqeTceFac1VpyQkavWEJbvnK5bUEXijWt4LxAxFpt2fXyw==", "dev": true, - "hasInstallScript": true, "dependencies": { - "detect-libc": "^1.0.3", - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "node-addon-api": "^7.0.0" + "@opentelemetry/core": "1.24.1", + "@opentelemetry/otlp-exporter-base": "0.51.1", + "@opentelemetry/otlp-transformer": "0.51.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" }, "engines": { - "node": ">= 10.0.0" + "node": ">=14" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/api-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", + "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" }, - "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.4.0", - "@parcel/watcher-darwin-arm64": "2.4.0", - "@parcel/watcher-darwin-x64": "2.4.0", - "@parcel/watcher-freebsd-x64": "2.4.0", - "@parcel/watcher-linux-arm-glibc": "2.4.0", - "@parcel/watcher-linux-arm64-glibc": "2.4.0", - "@parcel/watcher-linux-arm64-musl": "2.4.0", - "@parcel/watcher-linux-x64-glibc": "2.4.0", - "@parcel/watcher-linux-x64-musl": "2.4.0", - "@parcel/watcher-win32-arm64": "2.4.0", - "@parcel/watcher-win32-ia32": "2.4.0", - "@parcel/watcher-win32-x64": "2.4.0" + "engines": { + "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-android-arm64": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.0.tgz", - "integrity": "sha512-+fPtO/GsbYX1LJnCYCaDVT3EOBjvSFdQN9Mrzh9zWAOOfvidPWyScTrHIZHHfJBvlHzNA0Gy0U3NXFA/M7PHUA==", - "cpu": [ - "arm64" - ], + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", "dev": true, - "optional": true, - "os": [ - "android" - ], + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, "engines": { - "node": ">= 10.0.0" + "node": ">=14" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-arm64": { + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", + "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.51.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-logs": "0.51.1", + "@opentelemetry/sdk-metrics": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", + "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.9.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", + "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.51.1.tgz", + "integrity": "sha512-SE9f0/6V6EeXC9i+WA4WFjS1EYgaBCpAnI5+lxWvZ7iO7EU1IvHvZhP6Kojr0nLldo83gqg6G7OWFqsID3uF+w==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/otlp-exporter-base": "0.51.1", + "@opentelemetry/otlp-proto-exporter-base": "0.51.1", + "@opentelemetry/otlp-transformer": "0.51.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/api-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", + "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", + "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.51.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-logs": "0.51.1", + "@opentelemetry/sdk-metrics": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", + "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.9.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", + "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.24.1.tgz", + "integrity": "sha512-+Rl/VFmu2n6eaRMnVbyfZx1DqR/1KNyWebYuHyQBZaEAVIn/ZLgmofRpXN1X2nhJ4BNaptQUNxAstCYYz6dKoQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.51.1.tgz", + "integrity": "sha512-JIrvhpgqY6437QIqToyozrUG1h5UhwHkaGK/WAX+fkrpyPtc+RO5FkRtUd9BH0MibabHHvqsnBGKfKVijbmp8w==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.51.1", + "@types/shimmer": "^1.0.2", + "import-in-the-middle": "1.7.4", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation/node_modules/@opentelemetry/api-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", + "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.51.1.tgz", + "integrity": "sha512-UYlnOYyDdzo1Gw559EHCzru0RwhvuXCwoH8jGo9J4gO1TE58GjnEmIjomMsKBCym3qWNJfIQXw+9SZCV0DdQNg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.51.1.tgz", + "integrity": "sha512-ZAS+4pq8o7dsugGTwV9s6JMKSxi+guIHdn0acOv0bqj26e9pWDFx5Ky+bI0aY46uR9Y0JyXqY+KAEYM/SO3DFA==", + "dev": true, + "dependencies": { + "@grpc/grpc-js": "^1.7.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/otlp-exporter-base": "0.51.1", + "protobufjs": "^7.2.3" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.51.1.tgz", + "integrity": "sha512-gxxxwfk0inDMb5DLeuxQ3L8TtptxSiTNHE4nnAJH34IQXAVRhXSXW1rK8PmDKDngRPIZ6J7ncUCjjIn8b+AgqQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/otlp-exporter-base": "0.51.1", + "protobufjs": "^7.2.3" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.24.1.tgz", + "integrity": "sha512-nda97ZwhpZKyUJTXqQuKzNhPMUgMLunbbGWn8kroBwegn+nh6OhtyGkrVQsQLNdVKJl0KeB5z0ZgeWszrYhwFw==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.24.1.tgz", + "integrity": "sha512-7bRBJn3FG1l195A1m+xXRHvgzAOBsfmRi9uZ5Da18oTh7BLmNDiA8+kpk51FpTsU1PCikPVpRDNPhKVB6lyzZg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.51.1.tgz", + "integrity": "sha512-GgmNF9C+6esr8PIJxCqHw84rEOkYm6XdFWZ2+Wyc3qaUt92ACoN7uSw5iKNvaUq62W0xii1wsGxwHzyENtPP8w==", + "dev": true, + "dependencies": { + "@opentelemetry/api-logs": "0.51.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/exporter-trace-otlp-grpc": "0.51.1", + "@opentelemetry/exporter-trace-otlp-http": "0.51.1", + "@opentelemetry/exporter-trace-otlp-proto": "0.51.1", + "@opentelemetry/exporter-zipkin": "1.24.1", + "@opentelemetry/instrumentation": "0.51.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/sdk-logs": "0.51.1", + "@opentelemetry/sdk-metrics": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1", + "@opentelemetry/sdk-trace-node": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/api-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", + "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", + "dev": true, + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-logs": { + "version": "0.51.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", + "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.9.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", + "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.24.1.tgz", + "integrity": "sha512-/FZX8uWaGIAwsDhqI8VvQ+qWtfMNlXjaFYGc+vmxgdRFppCSSIRwrPyIhJO1qx61okyYhoyxVEZAfoiNxrfJCg==", + "dev": true, + "dependencies": { + "@opentelemetry/context-async-hooks": "1.24.1", + "@opentelemetry/core": "1.24.1", + "@opentelemetry/propagator-b3": "1.24.1", + "@opentelemetry/propagator-jaeger": "1.24.1", + "@opentelemetry/sdk-trace-base": "1.24.1", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/core": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", + "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "dev": true, + "dependencies": { + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/resources": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", + "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", + "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "dev": true, + "dependencies": { + "@opentelemetry/core": "1.24.1", + "@opentelemetry/resources": "1.24.1", + "@opentelemetry/semantic-conventions": "1.24.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" + } + }, + "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", + "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.0.tgz", + "integrity": "sha512-XJLGVL0DEclX5pcWa2N9SX1jCGTDd8l972biNooLFtjneuGqodupPQh6XseXIBBeVIMaaJ7bTcs3qGvXwsp4vg==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.4.0", + "@parcel/watcher-darwin-arm64": "2.4.0", + "@parcel/watcher-darwin-x64": "2.4.0", + "@parcel/watcher-freebsd-x64": "2.4.0", + "@parcel/watcher-linux-arm-glibc": "2.4.0", + "@parcel/watcher-linux-arm64-glibc": "2.4.0", + "@parcel/watcher-linux-arm64-musl": "2.4.0", + "@parcel/watcher-linux-x64-glibc": "2.4.0", + "@parcel/watcher-linux-x64-musl": "2.4.0", + "@parcel/watcher-win32-arm64": "2.4.0", + "@parcel/watcher-win32-ia32": "2.4.0", + "@parcel/watcher-win32-x64": "2.4.0" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-android-arm64": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.0.tgz", + "integrity": "sha512-+fPtO/GsbYX1LJnCYCaDVT3EOBjvSFdQN9Mrzh9zWAOOfvidPWyScTrHIZHHfJBvlHzNA0Gy0U3NXFA/M7PHUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/netlify-cli/node_modules/@parcel/watcher-darwin-arm64": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.0.tgz", "integrity": "sha512-T/At5pansFuQ8VJLRx0C6C87cgfqIYhW2N/kBfLCUvDhCah0EnLLwaD/6MW3ux+rpgkpQAnMELOCTKlbwncwiA==", @@ -12179,6 +13093,70 @@ "node": ">=12" } }, + "node_modules/netlify-cli/node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dev": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/netlify-cli/node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@rollup/pluginutils": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", @@ -12409,9 +13387,9 @@ "peer": true }, "node_modules/netlify-cli/node_modules/@types/node": { - "version": "20.12.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", - "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -12457,6 +13435,12 @@ "@types/node": "*" } }, + "node_modules/netlify-cli/node_modules/@types/shimmer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.5.tgz", + "integrity": "sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@types/yargs-parser": { "version": "20.2.1", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", @@ -12474,14 +13458,15 @@ } }, "node_modules/netlify-cli/node_modules/@vercel/nft": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.23.1.tgz", - "integrity": "sha512-NE0xSmGWVhgHF1OIoir71XAd0W0C1UE3nzFyhpFiMr3rVhetww7NvM1kc41trBsPG37Bh+dE5FYCTMzM/gBu0w==", + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.27.2.tgz", + "integrity": "sha512-7LeioS1yE5hwPpQfD3DdH04tuugKjo5KrJk3yK5kAI3Lh76iSsK/ezoFQfzuT08X3ZASQOd1y9ePjLNI9+TxTQ==", "dev": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.5", "@rollup/pluginutils": "^4.0.0", "acorn": "^8.6.0", + "acorn-import-attributes": "^1.9.5", "async-sema": "^3.1.1", "bindings": "^1.4.0", "estree-walker": "2.0.2", @@ -12495,7 +13480,7 @@ "nft": "out/cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/netlify-cli/node_modules/@xhmikosr/archive-type": { @@ -13091,16 +14076,16 @@ } }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/glob": { - "version": "10.3.16", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", - "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.11.0" + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -13158,9 +14143,9 @@ } }, "node_modules/netlify-cli/node_modules/archiver-utils/node_modules/minipass": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", - "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -13802,9 +14787,9 @@ } }, "node_modules/netlify-cli/node_modules/builtins": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", - "integrity": "sha512-aizhtbxgT1Udg0Fj6GssXshAVK+nxbtCV+1OtTrMNy67jffDFBY6CUBAkhO4owbleAx6fdbnWdpsmmcXydbzNw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", "dev": true, "dependencies": { "semver": "^7.0.0" @@ -13973,6 +14958,12 @@ "consola": "^3.2.3" } }, + "node_modules/netlify-cli/node_modules/cjs-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", + "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", + "dev": true + }, "node_modules/netlify-cli/node_modules/clean-deep": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", @@ -14972,61 +15963,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/netlify-cli/node_modules/css-select/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/netlify-cli/node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", @@ -15119,9 +16055,9 @@ } }, "node_modules/netlify-cli/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -15186,16 +16122,10 @@ "node": ">=4.0.0" } }, - "node_modules/netlify-cli/node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, "node_modules/netlify-cli/node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "engines": { "node": ">=0.10.0" @@ -15281,15 +16211,15 @@ } }, "node_modules/netlify-cli/node_modules/detective-amd": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.1.tgz", - "integrity": "sha512-e7n0E0Wte78U9lcpl3hsTh1ZJ+zp/rgEbdbzGLgTowSbbSemuHnM8olp4KHMF1eCaurrCE50IU9VkoV13ezK4A==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-5.0.2.tgz", + "integrity": "sha512-XFd/VEQ76HSpym80zxM68ieB77unNuoMwopU2TFT/ErUk5n4KvUTwW4beafAVUugrjV48l4BmmR0rh2MglBaiA==", "dev": true, "dependencies": { "ast-module-types": "^5.0.0", "escodegen": "^2.0.0", - "get-amd-module-type": "^5.0.0", - "node-source-walk": "^6.0.0" + "get-amd-module-type": "^5.0.1", + "node-source-walk": "^6.0.1" }, "bin": { "detective-amd": "bin/cli.js" @@ -15373,15 +16303,15 @@ } }, "node_modules/netlify-cli/node_modules/detective-typescript": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.0.1.tgz", - "integrity": "sha512-pVCuFWdEAyHI16zO3NBWSAULV8pevSkX3gwK8w3y9RrBGUrig6wDvwv6vUpnu+HfOr0MDmjMkmJGNWaTb6+HkA==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-11.2.0.tgz", + "integrity": "sha512-ARFxjzizOhPqs1fYC/2NMC3N4jrQ6HvVflnXBTRqNEqJuXwyKLRr9CrJwkRcV/SnZt1sNXgsF6FPm0x57Tq0rw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "^5.59.2", + "@typescript-eslint/typescript-estree": "^5.62.0", "ast-module-types": "^5.0.0", - "node-source-walk": "^6.0.0", - "typescript": "^5.0.4" + "node-source-walk": "^6.0.2", + "typescript": "^5.4.4" }, "engines": { "node": "^14.14.0 || >=16.0.0" @@ -15456,6 +16386,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/netlify-cli/node_modules/detective-typescript/node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/netlify-cli/node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -15468,6 +16411,20 @@ "node": ">=8" } }, + "node_modules/netlify-cli/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, "node_modules/netlify-cli/node_modules/domelementtype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", @@ -15480,6 +16437,35 @@ } ] }, + "node_modules/netlify-cli/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/netlify-cli/node_modules/dot-prop": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-9.0.0.tgz", @@ -15570,6 +16556,18 @@ "once": "^1.4.0" } }, + "node_modules/netlify-cli/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/netlify-cli/node_modules/env-paths": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", @@ -15625,9 +16623,9 @@ } }, "node_modules/netlify-cli/node_modules/es-module-lexer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.3.tgz", - "integrity": "sha512-iC67eXHToclrlVhQfpRawDiF8D8sQxNxmbqw5oebegOaJkyx/w9C/k57/5e6yJR2zIByRt9OXdqX50DV2t6ZKw==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", + "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", "dev": true }, "node_modules/netlify-cli/node_modules/es6-promisify": { @@ -15702,15 +16700,14 @@ "dev": true }, "node_modules/netlify-cli/node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dev": true, "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" + "esutils": "^2.0.2" }, "bin": { "escodegen": "bin/escodegen.js", @@ -15723,67 +16720,6 @@ "source-map": "~0.6.1" } }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/netlify-cli/node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/netlify-cli/node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -16199,12 +17135,6 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, - "node_modules/netlify-cli/node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, "node_modules/netlify-cli/node_modules/fast-querystring": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", @@ -17524,6 +18454,18 @@ "integrity": "sha512-ZBGjl0ZMEMeOC3Ns0wUF/5UdUmr3qQhBSCniT0LxOgGGIRHiNFOkMtIHB7EOznRU47V2AxPgiVP+s+0/UCU0Hg==", "dev": true }, + "node_modules/netlify-cli/node_modules/import-in-the-middle": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.4.tgz", + "integrity": "sha512-Lk+qzWmiQuRPPulGQeK5qq0v32k2bHnWrRPFgqyvhw7Kkov5L6MOLOIU3pcWeujc9W4q54Cp3Q2WV16eQkc7Bg==", + "dev": true, + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "node_modules/netlify-cli/node_modules/import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", @@ -18873,6 +19815,12 @@ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true }, + "node_modules/netlify-cli/node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lodash.deburr": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", @@ -19183,6 +20131,12 @@ "triple-beam": "^1.3.0" } }, + "node_modules/netlify-cli/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "dev": true + }, "node_modules/netlify-cli/node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -19587,6 +20541,12 @@ "node": ">=14" } }, + "node_modules/netlify-cli/node_modules/module-details-from-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", + "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", + "dev": true + }, "node_modules/netlify-cli/node_modules/moize": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/moize/-/moize-6.1.3.tgz", @@ -19723,12 +20683,12 @@ "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.17", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.17.tgz", - "integrity": "sha512-rwNArhc36BgRWRxx88q+tNR3eSH89SQwk78t/m63k1z3Z/b7G4+0LxN9409cdhyM9/o/phNv80dNmLyhMGnopQ==", + "version": "13.1.18", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.18.tgz", + "integrity": "sha512-1IDnULb21Fx1CVCBEhMwwKA8uZwhSmsqWzrfhvaWuUYQMHIjEhs9dPSci09I8zWOrAIiRI1mQSG1ZfnmqFZE+Q==", "dev": true, "dependencies": { - "@netlify/open-api": "^2.31.0", + "@netlify/open-api": "^2.32.0", "lodash-es": "^4.17.21", "micro-api-client": "^3.3.0", "node-fetch": "^3.0.0", @@ -19933,9 +20893,9 @@ } }, "node_modules/netlify-cli/node_modules/node-source-walk": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.1.tgz", - "integrity": "sha512-QUlkJYzrNewUCp4c7CCPN8Mh8c+pwNs23JsQfHKUwIkCxYa6c0AFLuUJIZxU6BdnarfytPSGKm1YMAz06hj9cw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-6.0.2.tgz", + "integrity": "sha512-jn9vOIK/nfqoFCcpK89/VCVaLg1IHE6UVfDOzvqmANaJ/rWCTEdH8RZ1V278nv2jr36BJdyQXIAavBLXpzdlag==", "dev": true, "dependencies": { "@babel/parser": "^7.21.8" @@ -20849,23 +21809,23 @@ } }, "node_modules/netlify-cli/node_modules/precinct": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.2.tgz", - "integrity": "sha512-UuhB1q0nEFf80iMGcs7IoT0o1GnNFWT4CjZjcMsHDXAIsW/aiLovOSbeMJ2Ejg6raRsplsriZZkoBUh0h/IHlw==", + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-11.0.5.tgz", + "integrity": "sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==", "dev": true, "dependencies": { - "@dependents/detective-less": "^4.0.0", + "@dependents/detective-less": "^4.1.0", "commander": "^10.0.1", - "detective-amd": "^5.0.1", + "detective-amd": "^5.0.2", "detective-cjs": "^5.0.1", - "detective-es6": "^4.0.0", + "detective-es6": "^4.0.1", "detective-postcss": "^6.1.3", - "detective-sass": "^5.0.0", - "detective-scss": "^4.0.0", + "detective-sass": "^5.0.3", + "detective-scss": "^4.0.3", "detective-stylus": "^4.0.0", - "detective-typescript": "^11.0.1", - "module-definition": "^5.0.0", - "node-source-walk": "^6.0.1" + "detective-typescript": "^11.1.0", + "module-definition": "^5.0.1", + "node-source-walk": "^6.0.2" }, "bin": { "precinct": "bin/cli.js" @@ -20958,6 +21918,30 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, + "node_modules/netlify-cli/node_modules/protobufjs": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/netlify-cli/node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -21505,10 +22489,41 @@ "node": ">=0.10.0" } }, + "node_modules/netlify-cli/node_modules/require-in-the-middle": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.3.0.tgz", + "integrity": "sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "module-details-from-path": "^1.0.3", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/netlify-cli/node_modules/require-in-the-middle/node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/netlify-cli/node_modules/require-package-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", - "integrity": "sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk=", + "integrity": "sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==", "dev": true }, "node_modules/netlify-cli/node_modules/requires-port": { @@ -21957,6 +22972,12 @@ "node": ">=8" } }, + "node_modules/netlify-cli/node_modules/shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -22095,6 +23116,15 @@ "node": ">=0.10.0" } }, + "node_modules/netlify-cli/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/netlify-cli/node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -22114,15 +23144,6 @@ "source-map": "^0.6.0" } }, - "node_modules/netlify-cli/node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -22531,9 +23552,9 @@ } }, "node_modules/netlify-cli/node_modules/tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", "dev": true, "dependencies": { "b4a": "^1.6.4", @@ -23497,15 +24518,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/netlify-cli/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index 64f93b1..1180499 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.0", + "@types/node": "20.14.2", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.25.0", + "netlify-cli": "17.27.0", "shx": "0.3.4", "vitest": "1.6.0" }, From f5dc87d9ab32a98f2b665fe8ac820c02c8d7efca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:31:40 +0000 Subject: [PATCH 19/26] chore(deps): update devdependencies-non-major --- package-lock.json | 1693 ++++++--------------------------------------- package.json | 6 +- 2 files changed, 202 insertions(+), 1497 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a85297..874459c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.44.1", + "@playwright/test": "1.45.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.2", + "@types/node": "20.14.9", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.27.0", + "netlify-cli": "17.30.0", "shx": "0.3.4", "vitest": "1.6.0" } @@ -1813,19 +1813,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.44.1.tgz", - "integrity": "sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.0.tgz", + "integrity": "sha512-TVYsfMlGAaxeUllNkywbwek67Ncf8FRGn8ZlRdO291OL3NjG9oMbfVhyP82HQF0CZLMrYsvesqoUekxdWuF9Qw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.44.1" + "playwright": "1.45.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/@pnpm/config.env-replace": { @@ -2592,9 +2592,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", - "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -7838,9 +7838,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.27.0", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.27.0.tgz", - "integrity": "sha512-DG7o1BvcIAV1Lxa6CaXlwhw2mUO21Kdc8RpdXLdeBHQ5p042nOjTXu4NsTU4KJuafOxmLsoj4nSxSo1j9BhfOA==", + "version": "17.30.0", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.30.0.tgz", + "integrity": "sha512-B6BcWxeEPaYaV7bWnMQczhavNc7nbXcxqjC2tmhXjZ4z7/ESgfUZqnGiaupAiAWnh7EjszX4Dmdy5lThA+8Hvg==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7849,13 +7849,13 @@ "@bugsnag/js": "7.23.0", "@fastify/static": "7.0.4", "@netlify/blobs": "7.3.0", - "@netlify/build": "29.47.2", + "@netlify/build": "29.50.0", "@netlify/build-info": "7.13.2", - "@netlify/config": "20.15.2", - "@netlify/edge-bundler": "12.0.1", + "@netlify/config": "20.15.4", + "@netlify/edge-bundler": "12.1.1", "@netlify/edge-functions": "2.8.1", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.34.3", + "@netlify/zip-it-and-ship-it": "9.37.2", "@octokit/rest": "20.1.1", "@opentelemetry/api": "1.8.0", "ansi-escapes": "7.0.0", @@ -7914,7 +7914,7 @@ "jsonwebtoken": "9.0.2", "jwt-decode": "4.0.0", "lambda-local": "2.2.0", - "listr2": "8.2.1", + "listr2": "8.2.3", "locate-path": "7.2.0", "lodash": "4.17.21", "log-symbols": "6.0.0", @@ -7922,7 +7922,7 @@ "maxstache": "1.0.7", "maxstache-stream": "1.0.4", "multiparty": "4.2.3", - "netlify": "13.1.18", + "netlify": "13.1.20", "netlify-headers-parser": "7.1.4", "netlify-redirect-parser": "14.3.0", "netlify-redirector": "0.5.0", @@ -7958,7 +7958,7 @@ "uuid": "9.0.1", "wait-port": "1.1.0", "write-file-atomic": "5.0.1", - "ws": "8.17.0", + "ws": "8.17.1", "zod": "3.23.8" }, "bin": { @@ -8753,37 +8753,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/netlify-cli/node_modules/@grpc/grpc-js": { - "version": "1.10.8", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.8.tgz", - "integrity": "sha512-vYVqYzHicDqyKB+NQhAc54I1QWCBLCrYG6unqOIcBTHx+7x8C9lcoLj3KVJXs2VB4lUbpWY+Kk9NipcbXYWmvg==", - "dev": true, - "dependencies": { - "@grpc/proto-loader": "^0.7.13", - "@js-sdsl/ordered-map": "^4.4.2" - }, - "engines": { - "node": ">=12.10.0" - } - }, - "node_modules/netlify-cli/node_modules/@grpc/proto-loader": { - "version": "0.7.13", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", - "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", - "dev": true, - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.2.5", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/netlify-cli/node_modules/@humanwhocodes/momoa": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", @@ -8979,16 +8948,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/netlify-cli/node_modules/@js-sdsl/ordered-map": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", - "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/netlify-cli/node_modules/@lukeed/ms": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.1.tgz", @@ -9067,23 +9026,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.47.2", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.47.2.tgz", - "integrity": "sha512-k72FGXoCdeVybvqoZSYPjU0PX0P05isHGKGnvvbrqY7jCKhzHdqt8ePOs20uCmK5k9AcNqbnbg/oNY/OO+LYwQ==", + "version": "29.50.0", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.50.0.tgz", + "integrity": "sha512-9/xFufOlqB5jydYnqqzO8N93YP2ZFJ6qAdRgo/JclJyxQ3yNBfVLzwWiY7FhKpT0p/laag0RJ/a8TNENwHhPhg==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^7.3.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.15.2", - "@netlify/edge-bundler": "12.0.1", + "@netlify/config": "^20.15.4", + "@netlify/edge-bundler": "12.1.1", "@netlify/framework-info": "^9.8.13", - "@netlify/functions-utils": "^5.2.63", + "@netlify/functions-utils": "^5.2.70", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.2.1", "@netlify/plugins-list": "^6.80.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.34.3", + "@netlify/zip-it-and-ship-it": "9.37.2", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9657,9 +9616,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.15.2", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.15.2.tgz", - "integrity": "sha512-nPakZuXLiQ6b5OshwB7Jmbjirj15E3/yMlBqx6VUrSln8cE/aohtmH157ZZdw9RKqk5Fd71kDFZmhAhmarhvmg==", + "version": "20.15.4", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.15.4.tgz", + "integrity": "sha512-qH9kubtF4A53GJwem3BZGVaVRjBpnfeRrkC4Krz45yp4isdhI6mt6L0rDiSSkUl64uu3SQWWd1JapG+hzdhqNQ==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -9676,7 +9635,7 @@ "is-plain-obj": "^4.0.0", "js-yaml": "^4.0.0", "map-obj": "^5.0.0", - "netlify": "^13.1.18", + "netlify": "^13.1.20", "netlify-headers-parser": "^7.1.4", "netlify-redirect-parser": "^14.3.0", "node-fetch": "^3.3.1", @@ -9927,9 +9886,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.0.1.tgz", - "integrity": "sha512-7Soa0Ny2mDhPHfBbdg28FJ96Kk71Q6vDJfJ3d5BLBqSh6buw+TRcDJye84wJ9LaMlff+eAN/vlMgsoumCH5L9Q==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.1.1.tgz", + "integrity": "sha512-Jmq4JrWfTRdEJMgIrZt4kr6ETTCCVGupG6AgBwVZ6p93T7z9u9QBb4nkMDbCG6o9roGgUNlh2DtMG8HvD4zdUA==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", @@ -10329,9 +10288,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", - "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", @@ -10706,12 +10665,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.63", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.63.tgz", - "integrity": "sha512-bRPX1nsxx2b3FcExKVoqZUcYz0FYe1NKLLr0IVhAKa8p64qX73tRmmKts9YDexzkrTYUdJtcvmLIFq5cpxb/bQ==", + "version": "5.2.70", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.70.tgz", + "integrity": "sha512-7SSLuLmvcyIs4vGVyp4K1Vs9fvwNMmpwjBSLOYqrC89rGKFA9zJ7QWgHxtoYF+7I1zf91vRQpz1oiir8kW9F1g==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.34.3", + "@netlify/zip-it-and-ship-it": "9.37.2", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -11073,9 +11032,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/open-api": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.32.0.tgz", - "integrity": "sha512-pw3tfLvKm/6RwF2fNAXe1tJyf6R9OgU/wuGz//N3jhig0FGVNusbt+bwcj5eTzwOvCb0KkUh0OLT8e1gSSz8qQ==", + "version": "2.33.1", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.33.1.tgz", + "integrity": "sha512-EP5nVae2sRSg8orieT/PvmykIUkPWr/Qzk2vj1QIUAPeMbR8JM3Aq+W/4fK9m0Yq+1CZ3sWeNy/r6nsxLqnXVg==", "dev": true, "engines": { "node": ">=14" @@ -11201,15 +11160,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.34.3", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.34.3.tgz", - "integrity": "sha512-mWdGjUNAvqLc9Vt3eufSWj1Rk3Wj6uKuh0Zw6gvHmxNBA4rUz/0Z9Fjc5NxR7WHMQtzX4AHo2ol2qFow1B2Y5Q==", + "version": "9.37.2", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.2.tgz", + "integrity": "sha512-ZOibSzp4ICeNgBu66UjVnRkEUpxZ59OtvR2Wk0bZxU708jCgcYzyQfIXrWqDHNq3QTFjFpZVuhBe6CTSOZkPjg==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", "@babel/types": "7.24.6", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.18.3", + "@netlify/serverless-functions-api": "^1.18.5", "@vercel/nft": "^0.27.1", "archiver": "^7.0.0", "common-path-prefix": "^3.0.0", @@ -11238,7 +11197,8 @@ "toml": "^3.0.0", "unixify": "^1.0.0", "urlpattern-polyfill": "8.0.2", - "yargs": "^17.0.0" + "yargs": "^17.0.0", + "zod": "^3.23.8" }, "bin": { "zip-it-and-ship-it": "bin.js" @@ -11248,146 +11208,18 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@netlify/serverless-functions-api": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.3.tgz", - "integrity": "sha512-j89Zu4nu+ZYaBMXARKniUHc3B65BV4dJOmIUbNfWmBjiHth9gU/K9LQDvcjzy4TPXd9Wq0+DBsdVZlYbZKTuYw==", + "version": "1.18.5", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.5.tgz", + "integrity": "sha512-2/LCG0b7xPee9uVMh422h4TPQdT5/Uk4o2H9L//sKDp8PLlvEdJJkagmWqBOYDtGMId/aO5KyZ/iF/zRA7Nq5A==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", - "@opentelemetry/core": "^1.23.0", - "@opentelemetry/otlp-transformer": "^0.51.0", - "@opentelemetry/resources": "^1.23.0", - "@opentelemetry/sdk-node": "^0.51.1", - "@opentelemetry/sdk-trace-node": "^1.24.1", "urlpattern-polyfill": "8.0.2" }, "engines": { "node": ">=18.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/api-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", - "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", - "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.51.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-logs": "0.51.1", - "@opentelemetry/sdk-metrics": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/sdk-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", - "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.9.0", - "@opentelemetry/api-logs": ">=0.39.1" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", - "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "lodash.merge": "^4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -11578,1161 +11410,207 @@ "engines": { "node": ">=12" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/auth-token": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", - "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", - "dev": true, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/core": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", - "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", - "dev": true, - "dependencies": { - "@octokit/auth-token": "^4.0.0", - "@octokit/graphql": "^7.1.0", - "@octokit/request": "^8.3.1", - "@octokit/request-error": "^5.1.0", - "@octokit/types": "^13.0.0", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/endpoint": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", - "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", - "dev": true, - "dependencies": { - "@octokit/types": "^13.1.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/graphql": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", - "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", - "dev": true, - "dependencies": { - "@octokit/request": "^8.3.0", - "@octokit/types": "^13.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { - "version": "22.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz", - "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { - "version": "11.3.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.1.tgz", - "integrity": "sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==", - "dev": true, - "dependencies": { - "@octokit/types": "^13.5.0" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "@octokit/core": "5" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-4.0.1.tgz", - "integrity": "sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==", - "dev": true, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "@octokit/core": "5" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.2.tgz", - "integrity": "sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==", - "dev": true, - "dependencies": { - "@octokit/types": "^13.5.0" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "@octokit/core": "^5" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/request": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", - "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", - "dev": true, - "dependencies": { - "@octokit/endpoint": "^9.0.1", - "@octokit/request-error": "^5.1.0", - "@octokit/types": "^13.1.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/request-error": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", - "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", - "dev": true, - "dependencies": { - "@octokit/types": "^13.1.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/rest": { - "version": "20.1.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-20.1.1.tgz", - "integrity": "sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==", - "dev": true, - "dependencies": { - "@octokit/core": "^5.0.2", - "@octokit/plugin-paginate-rest": "11.3.1", - "@octokit/plugin-request-log": "^4.0.0", - "@octokit/plugin-rest-endpoint-methods": "13.2.2" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/netlify-cli/node_modules/@octokit/types": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz", - "integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^22.2.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/api": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", - "integrity": "sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/context-async-hooks": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.24.1.tgz", - "integrity": "sha512-R5r6DO4kgEOVBxFXhXjwospLQkv+sYxwCfjvoZBe7Zm6KKXAV9kDSJhi/D1BweowdZmO+sdbENLs374gER8hpQ==", - "dev": true, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-grpc/-/exporter-trace-otlp-grpc-0.51.1.tgz", - "integrity": "sha512-P9+Hkszih95ITvldGZ+kXvj9HpD1QfS+PwooyHK72GYA+Bgm+yUSAsDkUkDms8+s9HW6poxURv3LcjaMuBBpVQ==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/otlp-grpc-exporter-base": "0.51.1", - "@opentelemetry/otlp-transformer": "0.51.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/api-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", - "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", - "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.51.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-logs": "0.51.1", - "@opentelemetry/sdk-metrics": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", - "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.9.0", - "@opentelemetry/api-logs": ">=0.39.1" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", - "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "lodash.merge": "^4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-grpc/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.51.1.tgz", - "integrity": "sha512-n+LhLPsX07URh+HhV2SHVSvz1t4G/l/CE5BjpmhAPqeTceFac1VpyQkavWEJbvnK5bUEXijWt4LxAxFpt2fXyw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/otlp-exporter-base": "0.51.1", - "@opentelemetry/otlp-transformer": "0.51.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/api-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", - "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", - "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.51.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-logs": "0.51.1", - "@opentelemetry/sdk-metrics": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", - "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.9.0", - "@opentelemetry/api-logs": ">=0.39.1" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", - "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "lodash.merge": "^4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.51.1.tgz", - "integrity": "sha512-SE9f0/6V6EeXC9i+WA4WFjS1EYgaBCpAnI5+lxWvZ7iO7EU1IvHvZhP6Kojr0nLldo83gqg6G7OWFqsID3uF+w==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/otlp-exporter-base": "0.51.1", - "@opentelemetry/otlp-proto-exporter-base": "0.51.1", - "@opentelemetry/otlp-transformer": "0.51.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/api-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", - "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.51.1.tgz", - "integrity": "sha512-OppYOXwV9LQqqtYUCywqoOqX/JT9LQ5/FMuPZ//eTkvuHdUC4ZMwz2c6uSoT2R90GWvvGnF1iEqTGyTT3xAt2Q==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.51.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-logs": "0.51.1", - "@opentelemetry/sdk-metrics": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", - "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.9.0", - "@opentelemetry/api-logs": ">=0.39.1" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", - "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "lodash.merge": "^4.6.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.24.1.tgz", - "integrity": "sha512-+Rl/VFmu2n6eaRMnVbyfZx1DqR/1KNyWebYuHyQBZaEAVIn/ZLgmofRpXN1X2nhJ4BNaptQUNxAstCYYz6dKoQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/exporter-zipkin/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.51.1.tgz", - "integrity": "sha512-JIrvhpgqY6437QIqToyozrUG1h5UhwHkaGK/WAX+fkrpyPtc+RO5FkRtUd9BH0MibabHHvqsnBGKfKVijbmp8w==", - "dev": true, - "dependencies": { - "@opentelemetry/api-logs": "0.51.1", - "@types/shimmer": "^1.0.2", - "import-in-the-middle": "1.7.4", - "require-in-the-middle": "^7.1.1", - "semver": "^7.5.2", - "shimmer": "^1.2.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/instrumentation/node_modules/@opentelemetry/api-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", - "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", - "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.51.1.tgz", - "integrity": "sha512-UYlnOYyDdzo1Gw559EHCzru0RwhvuXCwoH8jGo9J4gO1TE58GjnEmIjomMsKBCym3qWNJfIQXw+9SZCV0DdQNg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-grpc-exporter-base/-/otlp-grpc-exporter-base-0.51.1.tgz", - "integrity": "sha512-ZAS+4pq8o7dsugGTwV9s6JMKSxi+guIHdn0acOv0bqj26e9pWDFx5Ky+bI0aY46uR9Y0JyXqY+KAEYM/SO3DFA==", - "dev": true, - "dependencies": { - "@grpc/grpc-js": "^1.7.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/otlp-exporter-base": "0.51.1", - "protobufjs": "^7.2.3" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-grpc-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.51.1.tgz", - "integrity": "sha512-gxxxwfk0inDMb5DLeuxQ3L8TtptxSiTNHE4nnAJH34IQXAVRhXSXW1rK8PmDKDngRPIZ6J7ncUCjjIn8b+AgqQ==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/otlp-exporter-base": "0.51.1", - "protobufjs": "^7.2.3" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.24.1.tgz", - "integrity": "sha512-nda97ZwhpZKyUJTXqQuKzNhPMUgMLunbbGWn8kroBwegn+nh6OhtyGkrVQsQLNdVKJl0KeB5z0ZgeWszrYhwFw==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", - "dev": true, - "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-b3/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.24.1.tgz", - "integrity": "sha512-7bRBJn3FG1l195A1m+xXRHvgzAOBsfmRi9uZ5Da18oTh7BLmNDiA8+kpk51FpTsU1PCikPVpRDNPhKVB6lyzZg==", - "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "node_modules/netlify-cli/node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "node": ">= 8" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "node_modules/netlify-cli/node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { - "node": ">=14" + "node": ">= 8" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.51.1.tgz", - "integrity": "sha512-GgmNF9C+6esr8PIJxCqHw84rEOkYm6XdFWZ2+Wyc3qaUt92ACoN7uSw5iKNvaUq62W0xii1wsGxwHzyENtPP8w==", + "node_modules/netlify-cli/node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "@opentelemetry/api-logs": "0.51.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/exporter-trace-otlp-grpc": "0.51.1", - "@opentelemetry/exporter-trace-otlp-http": "0.51.1", - "@opentelemetry/exporter-trace-otlp-proto": "0.51.1", - "@opentelemetry/exporter-zipkin": "1.24.1", - "@opentelemetry/instrumentation": "0.51.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/sdk-logs": "0.51.1", - "@opentelemetry/sdk-metrics": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1", - "@opentelemetry/sdk-trace-node": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" + "node": ">= 8" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/api-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.51.1.tgz", - "integrity": "sha512-E3skn949Pk1z2XtXu/lxf6QAZpawuTM/IUEXcAzpiUkTd73Hmvw26FiN3cJuTmkpM5hZzHwkomVdtrh/n/zzwA==", + "node_modules/netlify-cli/node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", "dev": true, - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, "engines": { - "node": ">=14" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "node_modules/netlify-cli/node_modules/@octokit/core": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.3.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "node_modules/netlify-cli/node_modules/@octokit/endpoint": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-logs": { - "version": "0.51.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.51.1.tgz", - "integrity": "sha512-ULQQtl82b673PpZc5/0EtH4V+BrwVOgKJZEB7tYZnGTG3I98tQVk89S9/JSixomDr++F4ih+LSJTCqIKBz+MQQ==", + "node_modules/netlify-cli/node_modules/@octokit/graphql": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1" + "@octokit/request": "^8.3.0", + "@octokit/types": "^13.0.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.4.0 <1.9.0", - "@opentelemetry/api-logs": ">=0.39.1" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-metrics": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz", - "integrity": "sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==", + "node_modules/netlify-cli/node_modules/@octokit/openapi-types": { + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz", + "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==", + "dev": true + }, + "node_modules/netlify-cli/node_modules/@octokit/plugin-paginate-rest": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.1.tgz", + "integrity": "sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "lodash.merge": "^4.6.2" + "@octokit/types": "^13.5.0" }, "engines": { - "node": ">=14" + "node": ">= 18" }, "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.9.0" + "@octokit/core": "5" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "node_modules/netlify-cli/node_modules/@octokit/plugin-request-log": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-4.0.1.tgz", + "integrity": "sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==", "dev": true, - "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" - }, "engines": { - "node": ">=14" + "node": ">= 18" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" - } - }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-node/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", - "dev": true, - "engines": { - "node": ">=14" + "@octokit/core": "5" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.24.1.tgz", - "integrity": "sha512-/FZX8uWaGIAwsDhqI8VvQ+qWtfMNlXjaFYGc+vmxgdRFppCSSIRwrPyIhJO1qx61okyYhoyxVEZAfoiNxrfJCg==", + "node_modules/netlify-cli/node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.2.tgz", + "integrity": "sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==", "dev": true, "dependencies": { - "@opentelemetry/context-async-hooks": "1.24.1", - "@opentelemetry/core": "1.24.1", - "@opentelemetry/propagator-b3": "1.24.1", - "@opentelemetry/propagator-jaeger": "1.24.1", - "@opentelemetry/sdk-trace-base": "1.24.1", - "semver": "^7.5.2" + "@octokit/types": "^13.5.0" }, "engines": { - "node": ">=14" + "node": ">= 18" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "@octokit/core": "^5" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/core": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.24.1.tgz", - "integrity": "sha512-wMSGfsdmibI88K9wB498zXY04yThPexo8jvwNNlm542HZB7XrrMRBbAyKJqG8qDRJwIBdBrPMi4V9ZPW/sqrcg==", + "node_modules/netlify-cli/node_modules/@octokit/request": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.24.1" + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/resources": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.24.1.tgz", - "integrity": "sha512-cyv0MwAaPF7O86x5hk3NNgenMObeejZFLJJDVuSeSMIsknlsj3oOZzRv3qSzlwYomXsICfBeFFlxwHQte5mGXQ==", + "node_modules/netlify-cli/node_modules/@octokit/request-error": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" + "@octokit/types": "^13.1.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "node": ">= 18" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.24.1.tgz", - "integrity": "sha512-zz+N423IcySgjihl2NfjBf0qw1RWe11XIAWVrTNOSSI6dtSPJiVom2zipFB2AEEtJWpv0Iz6DY6+TjnyTV5pWg==", + "node_modules/netlify-cli/node_modules/@octokit/rest": { + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-20.1.1.tgz", + "integrity": "sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.24.1", - "@opentelemetry/resources": "1.24.1", - "@opentelemetry/semantic-conventions": "1.24.1" + "@octokit/core": "^5.0.2", + "@octokit/plugin-paginate-rest": "11.3.1", + "@octokit/plugin-request-log": "^4.0.0", + "@octokit/plugin-rest-endpoint-methods": "13.2.2" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.9.0" + "node": ">= 18" + } + }, + "node_modules/netlify-cli/node_modules/@octokit/types": { + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz", + "integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^22.2.0" } }, - "node_modules/netlify-cli/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.24.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.24.1.tgz", - "integrity": "sha512-VkliWlS4/+GHLLW7J/rVBA00uXus1SWvwFvcUDxDwmFxYfg/2VI6ekwdXS28cjI8Qz2ky2BzG8OUHo+WeYIWqw==", + "node_modules/netlify-cli/node_modules/@opentelemetry/api": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", + "integrity": "sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==", "dev": true, "engines": { - "node": ">=14" + "node": ">=8.0.0" } }, "node_modules/netlify-cli/node_modules/@parcel/watcher": { @@ -13093,70 +11971,6 @@ "node": ">=12" } }, - "node_modules/netlify-cli/node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dev": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/netlify-cli/node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "dev": true - }, - "node_modules/netlify-cli/node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "dev": true - }, "node_modules/netlify-cli/node_modules/@rollup/pluginutils": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", @@ -13387,9 +12201,9 @@ "peer": true }, "node_modules/netlify-cli/node_modules/@types/node": { - "version": "20.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", - "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "version": "20.14.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", + "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -13435,12 +12249,6 @@ "@types/node": "*" } }, - "node_modules/netlify-cli/node_modules/@types/shimmer": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.5.tgz", - "integrity": "sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==", - "dev": true - }, "node_modules/netlify-cli/node_modules/@types/yargs-parser": { "version": "20.2.1", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", @@ -14958,12 +13766,6 @@ "consola": "^3.2.3" } }, - "node_modules/netlify-cli/node_modules/cjs-module-lexer": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", - "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", - "dev": true - }, "node_modules/netlify-cli/node_modules/clean-deep": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", @@ -18454,18 +17256,6 @@ "integrity": "sha512-ZBGjl0ZMEMeOC3Ns0wUF/5UdUmr3qQhBSCniT0LxOgGGIRHiNFOkMtIHB7EOznRU47V2AxPgiVP+s+0/UCU0Hg==", "dev": true }, - "node_modules/netlify-cli/node_modules/import-in-the-middle": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.7.4.tgz", - "integrity": "sha512-Lk+qzWmiQuRPPulGQeK5qq0v32k2bHnWrRPFgqyvhw7Kkov5L6MOLOIU3pcWeujc9W4q54Cp3Q2WV16eQkc7Bg==", - "dev": true, - "dependencies": { - "acorn": "^8.8.2", - "acorn-import-attributes": "^1.9.5", - "cjs-module-lexer": "^1.2.2", - "module-details-from-path": "^1.0.3" - } - }, "node_modules/netlify-cli/node_modules/import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", @@ -19684,16 +18474,16 @@ } }, "node_modules/netlify-cli/node_modules/listr2": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.1.tgz", - "integrity": "sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==", + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.3.tgz", + "integrity": "sha512-Lllokma2mtoniUOS94CcOErHWAug5iu7HOmDrvWgpw8jyQH2fomgB+7lZS4HWZxytUuQwkGOwe49FvwVaA85Xw==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", "log-update": "^6.0.0", - "rfdc": "^1.3.1", + "rfdc": "^1.4.1", "wrap-ansi": "^9.0.0" }, "engines": { @@ -19815,12 +18605,6 @@ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true }, - "node_modules/netlify-cli/node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true - }, "node_modules/netlify-cli/node_modules/lodash.deburr": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", @@ -19881,12 +18665,6 @@ "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "dev": true }, - "node_modules/netlify-cli/node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "node_modules/netlify-cli/node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -20131,12 +18909,6 @@ "triple-beam": "^1.3.0" } }, - "node_modules/netlify-cli/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true - }, "node_modules/netlify-cli/node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -20541,12 +19313,6 @@ "node": ">=14" } }, - "node_modules/netlify-cli/node_modules/module-details-from-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", - "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==", - "dev": true - }, "node_modules/netlify-cli/node_modules/moize": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/moize/-/moize-6.1.3.tgz", @@ -20683,12 +19449,12 @@ "dev": true }, "node_modules/netlify-cli/node_modules/netlify": { - "version": "13.1.18", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.18.tgz", - "integrity": "sha512-1IDnULb21Fx1CVCBEhMwwKA8uZwhSmsqWzrfhvaWuUYQMHIjEhs9dPSci09I8zWOrAIiRI1mQSG1ZfnmqFZE+Q==", + "version": "13.1.20", + "resolved": "https://registry.npmjs.org/netlify/-/netlify-13.1.20.tgz", + "integrity": "sha512-pfYUCfaywrzkMzN8If4IVM58DqsAYq2JroAFziuYK7m0LKYPzlbuSNYWhlfQL/zoBmRm8kxzRxEiK6fj1tvOOw==", "dev": true, "dependencies": { - "@netlify/open-api": "^2.32.0", + "@netlify/open-api": "^2.33.1", "lodash-es": "^4.17.21", "micro-api-client": "^3.3.0", "node-fetch": "^3.0.0", @@ -21918,30 +20684,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/netlify-cli/node_modules/protobufjs": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", - "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/netlify-cli/node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -22489,37 +21231,6 @@ "node": ">=0.10.0" } }, - "node_modules/netlify-cli/node_modules/require-in-the-middle": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.3.0.tgz", - "integrity": "sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "module-details-from-path": "^1.0.3", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/netlify-cli/node_modules/require-in-the-middle/node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/netlify-cli/node_modules/require-package-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", @@ -22633,9 +21344,9 @@ } }, "node_modules/netlify-cli/node_modules/rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true }, "node_modules/netlify-cli/node_modules/rimraf": { @@ -22972,12 +21683,6 @@ "node": ">=8" } }, - "node_modules/netlify-cli/node_modules/shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", - "dev": true - }, "node_modules/netlify-cli/node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -24675,9 +23380,9 @@ } }, "node_modules/netlify-cli/node_modules/ws": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", - "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" @@ -28411,35 +27116,35 @@ } }, "node_modules/playwright": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.1.tgz", - "integrity": "sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.0.tgz", + "integrity": "sha512-4z3ac3plDfYzGB6r0Q3LF8POPR20Z8D0aXcxbJvmfMgSSq1hkcgvFRXJk9rUq5H/MJ0Ktal869hhOdI/zUTeLA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.44.1" + "playwright-core": "1.45.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz", - "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", + "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/playwright/node_modules/fsevents": { diff --git a/package.json b/package.json index 1180499..2c65124 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.44.1", + "@playwright/test": "1.45.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.2", + "@types/node": "20.14.9", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.27.0", + "netlify-cli": "17.30.0", "shx": "0.3.4", "vitest": "1.6.0" }, From 6a7f5dc621457e64af63cd688cf1a4c66308c9ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:17:33 +0000 Subject: [PATCH 20/26] chore(deps): update dependency node to v20.15.1 --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 2dbbe00..b8e593f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.11.1 +20.15.1 From 1f9ed824a0c9367ac724dc681a0deae22c9401c4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 01:46:33 +0000 Subject: [PATCH 21/26] chore(deps): update devdependencies-non-major --- package-lock.json | 227 ++++++++++++++++++++++------------------------ package.json | 6 +- 2 files changed, 110 insertions(+), 123 deletions(-) diff --git a/package-lock.json b/package-lock.json index 874459c..a295c54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.45.0", + "@playwright/test": "1.45.1", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.9", + "@types/node": "20.14.10", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.30.0", + "netlify-cli": "17.33.3", "shx": "0.3.4", "vitest": "1.6.0" } @@ -1813,13 +1813,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.0.tgz", - "integrity": "sha512-TVYsfMlGAaxeUllNkywbwek67Ncf8FRGn8ZlRdO291OL3NjG9oMbfVhyP82HQF0CZLMrYsvesqoUekxdWuF9Qw==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", + "integrity": "sha512-Wo1bWTzQvGA7LyKGIZc8nFSTFf2TkthGIFBR+QVNilvwouGzFd4PYukZe3rvf5PSqjHi1+1NyKSDZKcQWETzaA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.45.0" + "playwright": "1.45.1" }, "bin": { "playwright": "cli.js" @@ -2592,9 +2592,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", - "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -7838,9 +7838,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.30.0", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.30.0.tgz", - "integrity": "sha512-B6BcWxeEPaYaV7bWnMQczhavNc7nbXcxqjC2tmhXjZ4z7/ESgfUZqnGiaupAiAWnh7EjszX4Dmdy5lThA+8Hvg==", + "version": "17.33.3", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.33.3.tgz", + "integrity": "sha512-gl9WABnmSnk0NP8E4801YZPBfSsgYDcqIPqwdbwAIeADNG6ZY1DPOZ8IfnDi8U447vDjy/GMBzGDek/DyMgL5g==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7848,14 +7848,14 @@ "dependencies": { "@bugsnag/js": "7.23.0", "@fastify/static": "7.0.4", - "@netlify/blobs": "7.3.0", - "@netlify/build": "29.50.0", - "@netlify/build-info": "7.13.2", - "@netlify/config": "20.15.4", - "@netlify/edge-bundler": "12.1.1", - "@netlify/edge-functions": "2.8.1", + "@netlify/blobs": "7.4.0", + "@netlify/build": "29.51.1", + "@netlify/build-info": "7.14.1", + "@netlify/config": "20.17.0", + "@netlify/edge-bundler": "12.2.2", + "@netlify/edge-functions": "2.9.0", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.37.2", + "@netlify/zip-it-and-ship-it": "9.37.6", "@octokit/rest": "20.1.1", "@opentelemetry/api": "1.8.0", "ansi-escapes": "7.0.0", @@ -7902,7 +7902,7 @@ "hasha": "5.2.2", "http-proxy": "1.18.1", "http-proxy-middleware": "2.0.6", - "https-proxy-agent": "7.0.4", + "https-proxy-agent": "7.0.5", "inquirer": "6.5.2", "inquirer-autocomplete-prompt": "1.4.0", "ipx": "2.1.0", @@ -7933,7 +7933,7 @@ "p-map": "7.0.2", "p-wait-for": "5.0.2", "parallel-transform": "1.2.0", - "parse-github-url": "1.0.2", + "parse-github-url": "1.0.3", "parse-gitignore": "2.0.0", "path-key": "4.0.0", "prettyjson": "1.2.5", @@ -7949,7 +7949,6 @@ "terminal-link": "3.0.0", "through2-filter": "4.0.0", "through2-map": "4.0.0", - "to-readable-stream": "3.0.0", "toml": "3.0.0", "tomlify-j0.4": "3.0.0", "ulid": "2.3.0", @@ -7983,9 +7982,9 @@ } }, "node_modules/netlify-cli/node_modules/@babel/helper-string-parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", - "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -8084,13 +8083,13 @@ } }, "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.6.tgz", - "integrity": "sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", + "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.6", - "@babel/helper-validator-identifier": "^7.24.6", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -9017,32 +9016,32 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.3.0.tgz", - "integrity": "sha512-wN/kNTZo4xjlUM/C0WILOkJbe8p4AFquSGkZEIoIcgnsx5ikp2GyqGiq1WMLee7QdbnqeIV2g2hn/PjT324E5w==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.4.0.tgz", + "integrity": "sha512-7rdPzo8bggt3D2CVO+U1rmEtxxs8X7cLusDbHZRJaMlxqxBD05mXgThj5DUJMFOvmfVjhEH/S/3AyiLUbDQGDg==", "dev": true, "engines": { "node": "^14.16.0 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.50.0", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.50.0.tgz", - "integrity": "sha512-9/xFufOlqB5jydYnqqzO8N93YP2ZFJ6qAdRgo/JclJyxQ3yNBfVLzwWiY7FhKpT0p/laag0RJ/a8TNENwHhPhg==", + "version": "29.51.1", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.51.1.tgz", + "integrity": "sha512-1aAbAOGbQ4O9dnDQmEdukR8RMzT7+yEMNTNl3zvOBFyQImYhHw6bMBKImGF9ess8xRDaVBBlVzpd9bLSZ72L2A==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", - "@netlify/blobs": "^7.3.0", + "@netlify/blobs": "^7.4.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.15.4", - "@netlify/edge-bundler": "12.1.1", + "@netlify/config": "^20.17.0", + "@netlify/edge-bundler": "12.2.2", "@netlify/framework-info": "^9.8.13", - "@netlify/functions-utils": "^5.2.70", + "@netlify/functions-utils": "^5.2.74", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.2.1", "@netlify/plugins-list": "^6.80.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.37.2", + "@netlify/zip-it-and-ship-it": "9.37.6", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9107,9 +9106,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.13.2.tgz", - "integrity": "sha512-smzhIgcms6Z/v2cct90l8ncBbnA5kvknj5/quhwyM6UHUycgMKFlA22qkB0KLj9shwL1Lkh7iQW751JwhSaP9g==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@netlify/build-info/-/build-info-7.14.1.tgz", + "integrity": "sha512-0FhHK8+v80pDt0hkN4s5+sFUL5OF8bVU4bqwqDx04NiSQ/jOUSwCZ70F5MHkbvjuqf4RoP0vVKqrvIB3EP0wyA==", "dev": true, "dependencies": { "@bugsnag/js": "^7.20.0", @@ -9170,9 +9169,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -9212,9 +9211,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build-info/node_modules/yaml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", - "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", "dev": true, "bin": { "yaml": "bin.mjs" @@ -9363,9 +9362,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -9545,9 +9544,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true, "engines": { "node": ">=12.20" @@ -9616,9 +9615,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.15.4", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.15.4.tgz", - "integrity": "sha512-qH9kubtF4A53GJwem3BZGVaVRjBpnfeRrkC4Krz45yp4isdhI6mt6L0rDiSSkUl64uu3SQWWd1JapG+hzdhqNQ==", + "version": "20.17.0", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.17.0.tgz", + "integrity": "sha512-sws+WVno3fq2YtHO23TO5tkNO4TzXZJepU8+9sCJkTBR2/DfNBMqVVxPoEXpl+p1Knqv/BVklTAQk/ny4oNM5A==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -9874,9 +9873,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true, "engines": { "node": ">=12.20" @@ -9886,9 +9885,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "12.1.1", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.1.1.tgz", - "integrity": "sha512-Jmq4JrWfTRdEJMgIrZt4kr6ETTCCVGupG6AgBwVZ6p93T7z9u9QBb4nkMDbCG6o9roGgUNlh2DtMG8HvD4zdUA==", + "version": "12.2.2", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.2.2.tgz", + "integrity": "sha512-esaM7H/lViceghUR84ZTuNk3VkeVNy2BaCeV+/nWHFOXbEpMmlNML31hJswk79QRztV2XO1oLWu8PxtmURd7DA==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", @@ -10519,9 +10518,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-functions": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@netlify/edge-functions/-/edge-functions-2.8.1.tgz", - "integrity": "sha512-BoAz/gCWHLn9DVugGViORbWFDqaqrB/JHM+9N+ahk7U6C3EwaFojnnGKCMrQ65f2YOi6Wwlue1ZZO+8mq43RZA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@netlify/edge-functions/-/edge-functions-2.9.0.tgz", + "integrity": "sha512-W1kdwLpvUlhfI2FTOe6SEcoobW7Fw+Vm9WN5Gwb5lTCG6QXBE3gpCZk+NVQ4p/XoOcXYwWAS5pfOTMKUoYNQnA==", "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/framework-info": { @@ -10665,12 +10664,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.70", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.70.tgz", - "integrity": "sha512-7SSLuLmvcyIs4vGVyp4K1Vs9fvwNMmpwjBSLOYqrC89rGKFA9zJ7QWgHxtoYF+7I1zf91vRQpz1oiir8kW9F1g==", + "version": "5.2.74", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.74.tgz", + "integrity": "sha512-JvCwQbhoSeQ8dXkjIQOqgi7jrWVDQnoRWM/1NY+amzKXJVXptioI7PQjABa/OZIPs3jD9n1hbHSdVewtvsG+tA==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.37.2", + "@netlify/zip-it-and-ship-it": "9.37.6", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -11159,16 +11158,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.19.1.tgz", + "integrity": "sha512-2KYkyluThg1AKfd0JWI7FzpS4A/fzVVGYIf6AM4ydWyNj8eI/86GQVLeRgDoH7CNOxt243R5tutWlmHpVq0/Ew==", + "dev": true, + "dependencies": { + "@netlify/node-cookies": "^0.1.0", + "urlpattern-polyfill": "8.0.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.37.2", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.2.tgz", - "integrity": "sha512-ZOibSzp4ICeNgBu66UjVnRkEUpxZ59OtvR2Wk0bZxU708jCgcYzyQfIXrWqDHNq3QTFjFpZVuhBe6CTSOZkPjg==", + "version": "9.37.6", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.6.tgz", + "integrity": "sha512-dBmR6juvS3lJmUSHO2cMPueLe6EEhGqhxTFR14q6sq+wqxdMYof9eP3EDOPrloicuOX5/iAM0Q3gQdeW2FGWMQ==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", - "@babel/types": "7.24.6", + "@babel/types": "7.24.8", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.18.5", + "@netlify/serverless-functions-api": "^1.19.1", "@vercel/nft": "^0.27.1", "archiver": "^7.0.0", "common-path-prefix": "^3.0.0", @@ -11207,19 +11219,6 @@ "node": "^14.18.0 || >=16.0.0" } }, - "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@netlify/serverless-functions-api": { - "version": "1.18.5", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.18.5.tgz", - "integrity": "sha512-2/LCG0b7xPee9uVMh422h4TPQdT5/Uk4o2H9L//sKDp8PLlvEdJJkagmWqBOYDtGMId/aO5KyZ/iF/zRA7Nq5A==", - "dev": true, - "dependencies": { - "@netlify/node-cookies": "^0.1.0", - "urlpattern-polyfill": "8.0.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -11334,9 +11333,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -17176,9 +17175,9 @@ } }, "node_modules/netlify-cli/node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, "dependencies": { "agent-base": "^7.0.2", @@ -20283,15 +20282,15 @@ } }, "node_modules/netlify-cli/node_modules/parse-github-url": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", - "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.3.tgz", + "integrity": "sha512-tfalY5/4SqGaV/GIGzWyHnFjlpTPTNpENR9Ea2lLldSJ8EWXMsvacWucqY3m3I4YPtas15IxTLQVQ5NSYXPrww==", "dev": true, "bin": { "parse-github-url": "cli.js" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, "node_modules/netlify-cli/node_modules/parse-gitignore": { @@ -22457,18 +22456,6 @@ "node": ">=4" } }, - "node_modules/netlify-cli/node_modules/to-readable-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-3.0.0.tgz", - "integrity": "sha512-vD2LytT6DxPynBa1xbMtswY9gGqj27wNbh2uvI5OhBe+mrGLurRWRQZyQn3812sqlQRtUJwaKVshG+PoGwbPDQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/netlify-cli/node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -27116,13 +27103,13 @@ } }, "node_modules/playwright": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.0.tgz", - "integrity": "sha512-4z3ac3plDfYzGB6r0Q3LF8POPR20Z8D0aXcxbJvmfMgSSq1hkcgvFRXJk9rUq5H/MJ0Ktal869hhOdI/zUTeLA==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", + "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.45.0" + "playwright-core": "1.45.1" }, "bin": { "playwright": "cli.js" @@ -27135,9 +27122,9 @@ } }, "node_modules/playwright-core": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", - "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", + "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 2c65124..232bbc9 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.45.0", + "@playwright/test": "1.45.1", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.9", + "@types/node": "20.14.10", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.30.0", + "netlify-cli": "17.33.3", "shx": "0.3.4", "vitest": "1.6.0" }, From 82cc2e02cde992d3a449860e0613a82e311975f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 28 Jul 2024 23:27:13 +0000 Subject: [PATCH 22/26] chore(deps): update devdependencies-non-major --- package-lock.json | 166 +++++++++++++++++++++++----------------------- package.json | 6 +- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/package-lock.json b/package-lock.json index a295c54..bfe92f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.45.1", + "@playwright/test": "1.45.3", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.10", + "@types/node": "20.14.13", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.33.3", + "netlify-cli": "17.33.4", "shx": "0.3.4", "vitest": "1.6.0" } @@ -1813,13 +1813,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", - "integrity": "sha512-Wo1bWTzQvGA7LyKGIZc8nFSTFf2TkthGIFBR+QVNilvwouGzFd4PYukZe3rvf5PSqjHi1+1NyKSDZKcQWETzaA==", + "version": "1.45.3", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.3.tgz", + "integrity": "sha512-UKF4XsBfy+u3MFWEH44hva1Q8Da28G6RFtR2+5saw+jgAFQV5yYnB1fu68Mz7fO+5GJF3wgwAIs0UelU8TxFrA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.45.1" + "playwright": "1.45.3" }, "bin": { "playwright": "cli.js" @@ -2592,9 +2592,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.14.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", - "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "version": "20.14.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.13.tgz", + "integrity": "sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==", "devOptional": true, "license": "MIT", "dependencies": { @@ -7838,24 +7838,24 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.33.3", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.33.3.tgz", - "integrity": "sha512-gl9WABnmSnk0NP8E4801YZPBfSsgYDcqIPqwdbwAIeADNG6ZY1DPOZ8IfnDi8U447vDjy/GMBzGDek/DyMgL5g==", + "version": "17.33.4", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.33.4.tgz", + "integrity": "sha512-wXWWxOHMab7ztaqNY1lq2OHq3lT31SW36O2upekyTekMI8KriSAGnfXQEXC8ddD4DwAViNUdBpxvjc6WaMjuug==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, "license": "MIT", "dependencies": { - "@bugsnag/js": "7.23.0", + "@bugsnag/js": "7.25.0", "@fastify/static": "7.0.4", "@netlify/blobs": "7.4.0", - "@netlify/build": "29.51.1", + "@netlify/build": "29.51.3", "@netlify/build-info": "7.14.1", - "@netlify/config": "20.17.0", + "@netlify/config": "20.17.1", "@netlify/edge-bundler": "12.2.2", "@netlify/edge-functions": "2.9.0", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.37.6", + "@netlify/zip-it-and-ship-it": "9.37.7", "@octokit/rest": "20.1.1", "@opentelemetry/api": "1.8.0", "ansi-escapes": "7.0.0", @@ -7888,7 +7888,7 @@ "express-logging": "1.1.1", "extract-zip": "2.0.1", "fastest-levenshtein": "1.0.16", - "fastify": "4.27.0", + "fastify": "4.28.1", "find-up": "7.0.0", "flush-write-stream": "2.0.0", "folder-walker": "3.2.0", @@ -8097,18 +8097,18 @@ } }, "node_modules/netlify-cli/node_modules/@bugsnag/browser": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.22.7.tgz", - "integrity": "sha512-70jFkWKscK2osm7bnFbPLevrzHClrygM3UcKetKs/l81Xuzlxnu1SS3onN5OUl9kd9RN4XMFr46Pv5jSqWqImQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.25.0.tgz", + "integrity": "sha512-PzzWy5d9Ly1CU1KkxTB6ZaOw/dO+CYSfVtqxVJccy832e6+7rW/dvSw5Jy7rsNhgcKSKjZq86LtNkPSvritOLA==", "dev": true, "dependencies": { - "@bugsnag/core": "^7.22.7" + "@bugsnag/core": "^7.25.0" } }, "node_modules/netlify-cli/node_modules/@bugsnag/core": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.22.7.tgz", - "integrity": "sha512-9DPWBkkBjhFJc5dCFy/wVC3HE0Aw3ZiLJKjyAxgywSKbILgtpD+qT1Xe8sacWyxU92znamlZ8H8ziQOe7jhhbA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.25.0.tgz", + "integrity": "sha512-JZLak1b5BVzy77CPcklViZrppac/pE07L3uSDmfSvFYSCGReXkik2txOgV05VlF9EDe36dtUAIIV7iAPDfFpQQ==", "dev": true, "dependencies": { "@bugsnag/cuid": "^3.0.0", @@ -8119,28 +8119,28 @@ } }, "node_modules/netlify-cli/node_modules/@bugsnag/cuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.1.0.tgz", - "integrity": "sha512-U6vPVhFPLWLXQIGnmk/uPbyidB5xLVFfEdZDmmLbv41Be67re4mNsjMukHdUv669RXOWTDQNJ+bMODhuWpshkw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.1.1.tgz", + "integrity": "sha512-d2z4b0rEo3chI07FNN1Xds8v25CNeekecU6FC/2Fs9MxY2EipkZTThVcV2YinMn8dvRUlViKOyC50evoUxg8tw==", "dev": true }, "node_modules/netlify-cli/node_modules/@bugsnag/js": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.23.0.tgz", - "integrity": "sha512-gnCpcv/v6p3CtbwwDuAjVYPPNq4NMVj4hp70MiB3OGJ+LmIS66CwElDiyvRMA8Ar6OzCF4joTeaNG5bD9cM41w==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.25.0.tgz", + "integrity": "sha512-d8n8SyKdRUz8jMacRW1j/Sj/ckhKbIEp49+Dacp3CS8afRgfMZ//NXhUFFXITsDP5cXouaejR9fx4XVapYXNgg==", "dev": true, "dependencies": { - "@bugsnag/browser": "^7.22.7", - "@bugsnag/node": "^7.23.0" + "@bugsnag/browser": "^7.25.0", + "@bugsnag/node": "^7.25.0" } }, "node_modules/netlify-cli/node_modules/@bugsnag/node": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.23.0.tgz", - "integrity": "sha512-eXA8/h+J2booEMlKsuRl1NAszebwm4KZ9zxCSg/xN4sw5boXia7kMifLf8QTqk+UBtIhNKBsyQQKHXbawKyE6Q==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.25.0.tgz", + "integrity": "sha512-KlxBaJ8EREEsfKInybAjTO9LmdDXV3cUH5+XNXyqUZrcRVuPOu4j4xvljh+n24ifok/wbFZTKVXUzrN4iKIeIA==", "dev": true, "dependencies": { - "@bugsnag/core": "^7.22.7", + "@bugsnag/core": "^7.25.0", "byline": "^5.0.0", "error-stack-parser": "^2.0.2", "iserror": "^0.0.2", @@ -9025,23 +9025,23 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.51.1", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.51.1.tgz", - "integrity": "sha512-1aAbAOGbQ4O9dnDQmEdukR8RMzT7+yEMNTNl3zvOBFyQImYhHw6bMBKImGF9ess8xRDaVBBlVzpd9bLSZ72L2A==", + "version": "29.51.3", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.51.3.tgz", + "integrity": "sha512-bHnQLeMv6yHsENU9HQw1JQ+I4RikgjIiqtWo5pPgLAt0ktm+UH+5eFrPZ61zdkSwqMWup06364+wUqTlj4q1hQ==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^7.4.0", "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.17.0", + "@netlify/config": "^20.17.1", "@netlify/edge-bundler": "12.2.2", "@netlify/framework-info": "^9.8.13", - "@netlify/functions-utils": "^5.2.74", + "@netlify/functions-utils": "^5.2.75", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.2.1", "@netlify/plugins-list": "^6.80.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.37.6", + "@netlify/zip-it-and-ship-it": "9.37.7", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -9615,9 +9615,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.17.0", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.17.0.tgz", - "integrity": "sha512-sws+WVno3fq2YtHO23TO5tkNO4TzXZJepU8+9sCJkTBR2/DfNBMqVVxPoEXpl+p1Knqv/BVklTAQk/ny4oNM5A==", + "version": "20.17.1", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.17.1.tgz", + "integrity": "sha512-uZuEYooSWVnyx54AdLwPd7mgHy/PrWjHvPy5AO0ApPYsokNVceuk7NX6xqkD0CuGwcc5K9oRQx91XDWQoWd2zQ==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -10664,12 +10664,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.74", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.74.tgz", - "integrity": "sha512-JvCwQbhoSeQ8dXkjIQOqgi7jrWVDQnoRWM/1NY+amzKXJVXptioI7PQjABa/OZIPs3jD9n1hbHSdVewtvsG+tA==", + "version": "5.2.75", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.75.tgz", + "integrity": "sha512-KTNEJhRvjNCz9I0IKgmr6WyFuHWlbFGg5BgV35b0qDhcpMVwIr+jTTykb5wuc2153++tLCpxTwYXNx2Uz73P8g==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.37.6", + "@netlify/zip-it-and-ship-it": "9.37.7", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -11158,29 +11158,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/netlify-cli/node_modules/@netlify/serverless-functions-api": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.19.1.tgz", - "integrity": "sha512-2KYkyluThg1AKfd0JWI7FzpS4A/fzVVGYIf6AM4ydWyNj8eI/86GQVLeRgDoH7CNOxt243R5tutWlmHpVq0/Ew==", - "dev": true, - "dependencies": { - "@netlify/node-cookies": "^0.1.0", - "urlpattern-polyfill": "8.0.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.37.6", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.6.tgz", - "integrity": "sha512-dBmR6juvS3lJmUSHO2cMPueLe6EEhGqhxTFR14q6sq+wqxdMYof9eP3EDOPrloicuOX5/iAM0Q3gQdeW2FGWMQ==", + "version": "9.37.7", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.7.tgz", + "integrity": "sha512-d6PLXNFSjV5Q+maUMpyJeDybS1r8b6c7/qrIFPDpDioLnyxU97ur2gQ2cxn5WrlY0gfzLInRR7ipAa7MXdT3BQ==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", "@babel/types": "7.24.8", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.19.1", + "@netlify/serverless-functions-api": "^1.20.0", "@vercel/nft": "^0.27.1", "archiver": "^7.0.0", "common-path-prefix": "^3.0.0", @@ -11219,6 +11206,19 @@ "node": "^14.18.0 || >=16.0.0" } }, + "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@netlify/serverless-functions-api": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.20.0.tgz", + "integrity": "sha512-MsPw/753mUWCWYuaBvL6dkMa5uAh6o5hOSdjN16IhVuAQMrLLgZweSI9q2TW+C8QnQEgdtb5TV7iL8xAuxGsdA==", + "dev": true, + "dependencies": { + "@netlify/node-cookies": "^0.1.0", + "urlpattern-polyfill": "8.0.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -15976,9 +15976,9 @@ } }, "node_modules/netlify-cli/node_modules/fastify": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.27.0.tgz", - "integrity": "sha512-ci9IXzbigB8dyi0mSy3faa3Bsj0xWAPb9JeT4KRzubdSb6pNhcADRUaXCBml6V1Ss/a05kbtQls5LBmhHydoTA==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.28.1.tgz", + "integrity": "sha512-kFWUtpNr4i7t5vY2EJPCN2KgMVpuqfU4NjnJNCgiNB900oiDeYqaNDRcAfeBbOF5hGixixxcKnOU4KN9z6QncQ==", "dev": true, "funding": [ { @@ -16040,9 +16040,9 @@ } }, "node_modules/netlify-cli/node_modules/fastify/node_modules/pino": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-9.1.0.tgz", - "integrity": "sha512-qUcgfrlyOtjwhNLdbhoL7NR4NkHjzykAPw0V2QLFbvu/zss29h4NkRnibyFzBrNCbzCOY3WZ9hhKSwfOkNggYA==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.2.0.tgz", + "integrity": "sha512-g3/hpwfujK5a4oVbaefoJxezLzsDgLcNJeITvC6yrfwYeT9la+edCK42j5QpEQSQCZgTKapXvnQIdgZwvRaZug==", "dev": true, "dependencies": { "atomic-sleep": "^1.0.0", @@ -16147,9 +16147,9 @@ } }, "node_modules/netlify-cli/node_modules/fastify/node_modules/thread-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.0.0.tgz", - "integrity": "sha512-oUIFjxaUT6knhPtWgDMc29zF1FcSl0yXpapkyrQrCGEfYA2HUZXCilUtKyYIv6HkCyqSPAMkY+EG0GbyIrNDQg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", + "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", "dev": true, "dependencies": { "real-require": "^0.2.0" @@ -27103,13 +27103,13 @@ } }, "node_modules/playwright": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", - "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", + "version": "1.45.3", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.3.tgz", + "integrity": "sha512-QhVaS+lpluxCaioejDZ95l4Y4jSFCsBvl2UZkpeXlzxmqS+aABr5c82YmfMHrL6x27nvrvykJAFpkzT2eWdJww==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.45.1" + "playwright-core": "1.45.3" }, "bin": { "playwright": "cli.js" @@ -27122,9 +27122,9 @@ } }, "node_modules/playwright-core": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", - "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", + "version": "1.45.3", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.3.tgz", + "integrity": "sha512-+ym0jNbcjikaOwwSZycFbwkWgfruWvYlJfThKYAlImbxUgdWFO2oW70ojPm4OpE4t6TAo2FY/smM+hpVTtkhDA==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 232bbc9..2c87030 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.45.1", + "@playwright/test": "1.45.3", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "14.3.1", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.10", + "@types/node": "20.14.13", "jsdom": "23.2.0", "mkdirp": "3.0.1", - "netlify-cli": "17.33.3", + "netlify-cli": "17.33.4", "shx": "0.3.4", "vitest": "1.6.0" }, From 273b36c10e96bb8f52ec8022e2b5cd7c9f66d6fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 01:26:14 +0000 Subject: [PATCH 23/26] chore(deps): update devdependencies-major --- package-lock.json | 1346 +++++++++------------------------------------ package.json | 6 +- 2 files changed, 261 insertions(+), 1091 deletions(-) diff --git a/package-lock.json b/package-lock.json index bfe92f8..7cdea3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,39 +26,29 @@ "devDependencies": { "@playwright/test": "1.45.3", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.3.1", + "@testing-library/react": "16.0.0", "@types/lodash.debounce": "4.0.9", "@types/node": "20.14.13", - "jsdom": "23.2.0", + "jsdom": "24.1.1", "mkdirp": "3.0.1", "netlify-cli": "17.33.4", "shx": "0.3.4", - "vitest": "1.6.0" + "vitest": "2.0.4" } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, - "node_modules/@asamuzakjp/dom-selector": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-2.0.2.tgz", - "integrity": "sha512-x1KXOatwofR6ZAYzXRBL5wrdV0vwNxlTCK9NCuLqAzQYARqGcvFwiJA6A1ERuh+dgeA4Dxm3JBYictIes+SqUQ==", - "dev": true, - "dependencies": { - "bidi-js": "^1.0.3", - "css-tree": "^2.3.1", - "is-potential-custom-element-name": "^1.0.1" - } - }, "node_modules/@astrojs/check": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.3.4.tgz", @@ -1525,26 +1515,15 @@ "url": "https://opencollective.com/libvips" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", - "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -1559,9 +1538,10 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -1572,9 +1552,10 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", - "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2414,12 +2395,6 @@ "semantic-release": ">=20.1.0" } }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -2450,47 +2425,60 @@ } }, "node_modules/@testing-library/dom": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", - "integrity": "sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", + "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", "@types/aria-query": "^5.0.1", - "aria-query": "5.1.3", + "aria-query": "5.3.0", "chalk": "^4.1.0", "dom-accessibility-api": "^0.5.9", "lz-string": "^1.5.0", "pretty-format": "^27.0.2" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/@testing-library/react": { - "version": "14.3.1", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.3.1.tgz", - "integrity": "sha512-H99XjUhWQw0lTgyMN05W3xQG1Nh4lq574D8keFf1dDoNTJgp66VbJozRaczoF+wsiaPJNt/TcnfpLGufGxSrZQ==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.0.0.tgz", + "integrity": "sha512-guuxUKRWQ+FgNX0h0NS0FIq3Q3uLtWVpBzcLOggmfMoUpgBnzBzvLLd4fbm6yS8ydJd94cIfY4yP9qUQjM2KwQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.5", - "@testing-library/dom": "^9.0.0", - "@types/react-dom": "^18.0.0" + "@babel/runtime": "^7.12.5" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", "react": "^18.0.0", "react-dom": "^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -2669,138 +2657,92 @@ } }, "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.4.tgz", + "integrity": "sha512-39jr5EguIoanChvBqe34I8m1hJFI4+jxvdOpD7gslZrVQBKhh8H9eD7J/LJX4zakrw23W+dITQTDqdt43xVcJw==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" + "@vitest/spy": "2.0.4", + "@vitest/utils": "2.0.4", + "chai": "^5.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "node_modules/@vitest/pretty-format": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.4.tgz", + "integrity": "sha512-RYZl31STbNGqf4l2eQM1nvKPXE0NhC6Eq0suTTePc4mtMQ1Fn8qZmjV4emZdEdG2NOWGKSCrHZjmTqDCDoeFBw==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "node_modules/@vitest/runner": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.4.tgz", + "integrity": "sha512-Gk+9Su/2H2zNfNdeJR124gZckd5st4YoSuhF1Rebi37qTXKnqYyFCd9KP4vl2cQHbtuVKjfEKrNJxHHCW8thbQ==", "dev": true, + "license": "MIT", "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@vitest/utils": "2.0.4", + "pathe": "^1.1.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/snapshot/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@vitest/snapshot/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "node_modules/@vitest/snapshot": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.4.tgz", + "integrity": "sha512-or6Mzoz/pD7xTvuJMFYEtso1vJo1S5u6zBTinfl+7smGUhqybn6VjzCDMhmTyVOFWwkCMuNjmNNxnyXPgKDoPw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "@vitest/pretty-format": "2.0.4", + "magic-string": "^0.30.10", + "pathe": "^1.1.2" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/snapshot/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.4.tgz", + "integrity": "sha512-uTXU56TNoYrTohb+6CseP8IqNwlNdtPwEO0AWl+5j7NelS6x0xZZtP0bDWaLvOfUbaYwhhWp1guzXUxkC7mW7Q==", "dev": true, + "license": "MIT", "dependencies": { - "tinyspy": "^2.2.0" + "tinyspy": "^3.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.4.tgz", + "integrity": "sha512-Zc75QuuoJhOBnlo99ZVUkJIuq4Oj0zAkrQ2VzCqNCx6wAwViHEh5Fnp4fiJTE9rA+sAoXRf00Z9xGgfEzV6fzQ==", "dev": true, + "license": "MIT", "dependencies": { - "diff-sequences": "^29.6.3", + "@vitest/pretty-format": "2.0.4", "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "loupe": "^3.1.1", + "tinyrainbow": "^1.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/utils/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@vitest/utils/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@vitest/utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/@volar/kit": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.4.tgz", @@ -2917,15 +2859,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/agent-base": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", @@ -3071,28 +3004,12 @@ "peer": true }, "node_modules/aria-query": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", - "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", - "dev": true, - "dependencies": { - "deep-equal": "^2.0.5" - } - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "license": "Apache-2.0", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "dequal": "^2.0.3" } }, "node_modules/array-ify": { @@ -3111,12 +3028,13 @@ } }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/astro": { @@ -3199,14 +3117,6 @@ "sharp": "^0.33.1" } }, - "node_modules/astro/node_modules/aria-query": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", - "dependencies": { - "dequal": "^2.0.3" - } - }, "node_modules/astro/node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -3337,21 +3247,6 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/axobject-query": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", @@ -3405,15 +3300,6 @@ "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, - "node_modules/bidi-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", - "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", - "dev": true, - "dependencies": { - "require-from-string": "^2.0.2" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -3588,25 +3474,6 @@ "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3657,21 +3524,20 @@ } }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, + "license": "MIT", "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chalk": { @@ -3679,6 +3545,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3728,15 +3595,13 @@ } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, + "license": "MIT", "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/chokidar": { @@ -4330,19 +4195,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/css-tree": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dev": true, - "dependencies": { - "mdn-data": "2.0.30", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, "node_modules/cssstyle": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", @@ -4374,9 +4226,10 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -4408,49 +4261,15 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, + "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/deep-equal": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", - "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.5", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.2", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -4460,40 +4279,6 @@ "node": ">=4.0.0" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -4562,15 +4347,6 @@ "node": ">=0.3.1" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4592,7 +4368,8 @@ "version": "0.5.16", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/dot-prop": { "version": "5.3.0", @@ -4843,47 +4620,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es-module-lexer": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", @@ -5145,15 +4881,6 @@ "node": ">=8" } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -5219,15 +4946,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -5260,29 +4978,11 @@ "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-stream": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", @@ -5383,18 +5083,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -5455,75 +5143,16 @@ "uglify-js": "^3.1.4" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/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, + "peer": true, "engines": { "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasown": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", @@ -5765,10 +5394,11 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, + "license": "MIT", "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -5930,20 +5560,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -5969,56 +5585,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -6030,22 +5602,6 @@ "node": ">=8" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-buffer": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", @@ -6068,18 +5624,6 @@ "node": ">=4" } }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -6091,21 +5635,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -6183,15 +5712,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -6200,21 +5720,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", @@ -6241,46 +5746,6 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -6293,36 +5758,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-text-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", @@ -6336,36 +5771,14 @@ } }, "node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-wsl": { @@ -6382,12 +5795,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -6436,31 +5843,32 @@ } }, "node_modules/jsdom": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.2.0.tgz", - "integrity": "sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==", + "version": "24.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz", + "integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==", "dev": true, + "license": "MIT", "dependencies": { - "@asamuzakjp/dom-selector": "^2.0.1", "cssstyle": "^4.0.1", "data-urls": "^5.0.0", "decimal.js": "^10.4.3", "form-data": "^4.0.0", "html-encoding-sniffer": "^4.0.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.2", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.12", "parse5": "^7.1.2", - "rrweb-cssom": "^0.6.0", + "rrweb-cssom": "^0.7.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.3", + "tough-cookie": "^4.1.4", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^3.1.1", "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0", - "ws": "^8.16.0", + "ws": "^8.18.0", "xml-name-validator": "^5.0.0" }, "engines": { @@ -6475,6 +5883,13 @@ } } }, + "node_modules/jsdom/node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==", + "dev": true, + "license": "MIT" + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -6519,12 +5934,6 @@ "node": ">=6" } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -6659,22 +6068,6 @@ "node": ">=6" } }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -6788,10 +6181,11 @@ } }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", "dev": true, + "license": "MIT", "dependencies": { "get-func-name": "^2.0.1" } @@ -6809,19 +6203,18 @@ "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "dev": true, + "peer": true, "bin": { "lz-string": "bin/bin.js" } }, "node_modules/magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" } }, "node_modules/markdown-table": { @@ -7090,12 +6483,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true - }, "node_modules/meow": { "version": "12.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", @@ -7744,18 +7131,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mlly": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", - "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.0.3", - "ufo": "^1.3.2" - } - }, "node_modules/monaco-editor": { "version": "0.46.0", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.46.0.tgz", @@ -26439,6 +25814,13 @@ "inBundle": true, "license": "ISC" }, + "node_modules/nwsapi": { + "version": "2.2.12", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", + "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==", + "dev": true, + "license": "MIT" + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -26449,58 +25831,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -26913,12 +26243,13 @@ "dev": true }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/picocolors": { @@ -27091,17 +26422,6 @@ "node": ">=6" } }, - "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, "node_modules/playwright": { "version": "1.45.3", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.3.tgz", @@ -27148,15 +26468,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postcss": { "version": "8.4.35", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", @@ -27229,6 +26540,7 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dev": true, + "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -27243,6 +26555,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -27391,7 +26704,8 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true + "dev": true, + "peer": true }, "node_modules/react-refresh": { "version": "0.14.0", @@ -27580,24 +26894,6 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "dev": true }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/registry-auth-token": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", @@ -27755,15 +27051,6 @@ "node": ">=0.10.0" } }, - "node_modules/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==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -28680,38 +27967,6 @@ "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==" }, - "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.2", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/sharp": { "version": "0.33.2", "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", @@ -28812,24 +28067,6 @@ "node": ">=6" } }, - "node_modules/side-channel": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", - "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -29102,18 +28339,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", @@ -29242,29 +28467,12 @@ "node": ">=0.10.0" } }, - "node_modules/strip-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", - "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", - "dev": true, - "dependencies": { - "js-tokens": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/strip-literal/node_modules/js-tokens": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", - "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", - "dev": true - }, "node_modules/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, + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -29395,25 +28603,38 @@ } }, "node_modules/tinybench": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", - "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", - "dev": true + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", + "dev": true, + "license": "MIT" }, "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.0.tgz", + "integrity": "sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.0.tgz", + "integrity": "sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -29438,10 +28659,11 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -29529,15 +28751,6 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "optional": true }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", @@ -29574,12 +28787,6 @@ "semver": "^7.3.8" } }, - "node_modules/ufo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", - "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", - "dev": true - }, "node_modules/uglify-js": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", @@ -29940,15 +29147,16 @@ } }, "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.4.tgz", + "integrity": "sha512-ZpJVkxcakYtig5iakNeL7N3trufe3M6vGuzYAr4GsbCTwobDeyPJpE4cjDhhPluv8OvQCFzu2LWp6GkoKRITXA==", "dev": true, + "license": "MIT", "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", + "debug": "^4.3.5", + "pathe": "^1.1.2", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0" }, "bin": { @@ -29975,31 +29183,31 @@ } }, "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.4.tgz", + "integrity": "sha512-luNLDpfsnxw5QSW4bISPe6tkxVvv5wn2BBs/PuDRkhXZ319doZyLOBr1sjfB5yCEpTiU7xCAdViM8TNVGPwoog==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", + "@ampproject/remapping": "^2.3.0", + "@vitest/expect": "2.0.4", + "@vitest/pretty-format": "^2.0.4", + "@vitest/runner": "2.0.4", + "@vitest/snapshot": "2.0.4", + "@vitest/spy": "2.0.4", + "@vitest/utils": "2.0.4", + "chai": "^5.1.1", + "debug": "^4.3.5", "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", + "magic-string": "^0.30.10", + "pathe": "^1.1.2", + "std-env": "^3.7.0", + "tinybench": "^2.8.0", + "tinypool": "^1.0.0", + "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" + "vite-node": "2.0.4", + "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" @@ -30013,8 +29221,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", + "@vitest/browser": "2.0.4", + "@vitest/ui": "2.0.4", "happy-dom": "*", "jsdom": "*" }, @@ -30044,6 +29252,7 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -30067,6 +29276,7 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, @@ -30079,6 +29289,7 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=16.17.0" } @@ -30088,6 +29299,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -30100,6 +29312,7 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -30112,6 +29325,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -30127,6 +29341,7 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, + "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -30142,6 +29357,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -30154,6 +29370,7 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, + "license": "ISC", "engines": { "node": ">=14" }, @@ -30166,6 +29383,7 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -30449,37 +29667,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dev": true, - "dependencies": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/which-pm": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", @@ -30500,30 +29687,12 @@ "node": ">=4" } }, - "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, + "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -30631,10 +29800,11 @@ "dev": true }, "node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, diff --git a/package.json b/package.json index 2c87030..8bd8eb5 100644 --- a/package.json +++ b/package.json @@ -35,14 +35,14 @@ "devDependencies": { "@playwright/test": "1.45.3", "@technologiestiftung/semantic-release-config": "1.2.4", - "@testing-library/react": "14.3.1", + "@testing-library/react": "16.0.0", "@types/lodash.debounce": "4.0.9", "@types/node": "20.14.13", - "jsdom": "23.2.0", + "jsdom": "24.1.1", "mkdirp": "3.0.1", "netlify-cli": "17.33.4", "shx": "0.3.4", - "vitest": "1.6.0" + "vitest": "2.0.4" }, "prettier": { "tabWidth": 2, From 4db6fb171a2f950bb73ec38729bd5051f362114b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 01:16:43 +0000 Subject: [PATCH 24/26] chore(deps): update devdependencies-non-major --- package-lock.json | 381 +++++++++++++++++++++++++++++++--------------- package.json | 8 +- 2 files changed, 262 insertions(+), 127 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7cdea3b..3c2173b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,16 +24,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.45.3", + "@playwright/test": "1.46.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "16.0.0", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.13", + "@types/node": "20.14.15", "jsdom": "24.1.1", "mkdirp": "3.0.1", - "netlify-cli": "17.33.4", + "netlify-cli": "17.34.0", "shx": "0.3.4", - "vitest": "2.0.4" + "vitest": "2.0.5" } }, "node_modules/@ampproject/remapping": { @@ -1794,13 +1794,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.45.3", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.3.tgz", - "integrity": "sha512-UKF4XsBfy+u3MFWEH44hva1Q8Da28G6RFtR2+5saw+jgAFQV5yYnB1fu68Mz7fO+5GJF3wgwAIs0UelU8TxFrA==", + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.46.0.tgz", + "integrity": "sha512-/QYft5VArOrGRP5pgkrfKksqsKA6CEFyGQ/gjNe6q0y4tZ1aaPfq4gIjudr1s3D+pXyrPRdsy4opKDrjBabE5w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.45.3" + "playwright": "1.46.0" }, "bin": { "playwright": "cli.js" @@ -2580,9 +2580,9 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, "node_modules/@types/node": { - "version": "20.14.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.13.tgz", - "integrity": "sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==", + "version": "20.14.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.15.tgz", + "integrity": "sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==", "devOptional": true, "license": "MIT", "dependencies": { @@ -2657,14 +2657,14 @@ } }, "node_modules/@vitest/expect": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.4.tgz", - "integrity": "sha512-39jr5EguIoanChvBqe34I8m1hJFI4+jxvdOpD7gslZrVQBKhh8H9eD7J/LJX4zakrw23W+dITQTDqdt43xVcJw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", + "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.0.4", - "@vitest/utils": "2.0.4", + "@vitest/spy": "2.0.5", + "@vitest/utils": "2.0.5", "chai": "^5.1.1", "tinyrainbow": "^1.2.0" }, @@ -2673,9 +2673,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.4.tgz", - "integrity": "sha512-RYZl31STbNGqf4l2eQM1nvKPXE0NhC6Eq0suTTePc4mtMQ1Fn8qZmjV4emZdEdG2NOWGKSCrHZjmTqDCDoeFBw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", + "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2686,13 +2686,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.4.tgz", - "integrity": "sha512-Gk+9Su/2H2zNfNdeJR124gZckd5st4YoSuhF1Rebi37qTXKnqYyFCd9KP4vl2cQHbtuVKjfEKrNJxHHCW8thbQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.5.tgz", + "integrity": "sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.0.4", + "@vitest/utils": "2.0.5", "pathe": "^1.1.2" }, "funding": { @@ -2700,13 +2700,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.4.tgz", - "integrity": "sha512-or6Mzoz/pD7xTvuJMFYEtso1vJo1S5u6zBTinfl+7smGUhqybn6VjzCDMhmTyVOFWwkCMuNjmNNxnyXPgKDoPw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.5.tgz", + "integrity": "sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.0.4", + "@vitest/pretty-format": "2.0.5", "magic-string": "^0.30.10", "pathe": "^1.1.2" }, @@ -2715,9 +2715,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.4.tgz", - "integrity": "sha512-uTXU56TNoYrTohb+6CseP8IqNwlNdtPwEO0AWl+5j7NelS6x0xZZtP0bDWaLvOfUbaYwhhWp1guzXUxkC7mW7Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.5.tgz", + "integrity": "sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==", "dev": true, "license": "MIT", "dependencies": { @@ -2728,13 +2728,13 @@ } }, "node_modules/@vitest/utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.4.tgz", - "integrity": "sha512-Zc75QuuoJhOBnlo99ZVUkJIuq4Oj0zAkrQ2VzCqNCx6wAwViHEh5Fnp4fiJTE9rA+sAoXRf00Z9xGgfEzV6fzQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.5.tgz", + "integrity": "sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.0.4", + "@vitest/pretty-format": "2.0.5", "estree-walker": "^3.0.3", "loupe": "^3.1.1", "tinyrainbow": "^1.2.0" @@ -7213,9 +7213,9 @@ "dev": true }, "node_modules/netlify-cli": { - "version": "17.33.4", - "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.33.4.tgz", - "integrity": "sha512-wXWWxOHMab7ztaqNY1lq2OHq3lT31SW36O2upekyTekMI8KriSAGnfXQEXC8ddD4DwAViNUdBpxvjc6WaMjuug==", + "version": "17.34.0", + "resolved": "https://registry.npmjs.org/netlify-cli/-/netlify-cli-17.34.0.tgz", + "integrity": "sha512-HuxTlDIwOn1Mi+6/2DpQbM44qE1rAAUMytyZgolqyRjWPSi4X5Li5sIvEb6VPbimBohWmQQW/qc8P07iuRPXSA==", "dev": true, "hasInstallScript": true, "hasShrinkwrap": true, @@ -7223,14 +7223,14 @@ "dependencies": { "@bugsnag/js": "7.25.0", "@fastify/static": "7.0.4", - "@netlify/blobs": "7.4.0", - "@netlify/build": "29.51.3", + "@netlify/blobs": "8.0.0", + "@netlify/build": "29.53.0", "@netlify/build-info": "7.14.1", - "@netlify/config": "20.17.1", - "@netlify/edge-bundler": "12.2.2", + "@netlify/config": "20.18.0", + "@netlify/edge-bundler": "12.2.3", "@netlify/edge-functions": "2.9.0", "@netlify/local-functions-proxy": "1.1.1", - "@netlify/zip-it-and-ship-it": "9.37.7", + "@netlify/zip-it-and-ship-it": "9.37.9", "@octokit/rest": "20.1.1", "@opentelemetry/api": "1.8.0", "ansi-escapes": "7.0.0", @@ -7251,7 +7251,7 @@ "content-type": "1.0.5", "cookie": "0.6.0", "cron-parser": "4.9.0", - "debug": "4.3.5", + "debug": "4.3.6", "decache": "4.6.2", "dot-prop": "9.0.0", "dotenv": "16.4.5", @@ -7289,7 +7289,7 @@ "jsonwebtoken": "9.0.2", "jwt-decode": "4.0.0", "lambda-local": "2.2.0", - "listr2": "8.2.3", + "listr2": "8.2.4", "locate-path": "7.2.0", "lodash": "4.17.21", "log-symbols": "6.0.0", @@ -7458,9 +7458,9 @@ } }, "node_modules/netlify-cli/node_modules/@babel/types": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.8.tgz", - "integrity": "sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", + "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.24.8", @@ -8391,32 +8391,32 @@ "dev": true }, "node_modules/netlify-cli/node_modules/@netlify/blobs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.4.0.tgz", - "integrity": "sha512-7rdPzo8bggt3D2CVO+U1rmEtxxs8X7cLusDbHZRJaMlxqxBD05mXgThj5DUJMFOvmfVjhEH/S/3AyiLUbDQGDg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-8.0.0.tgz", + "integrity": "sha512-p9DdRSPvDuFhl9PYODWRo5QYWB4Du/lX5gbZNmwmtw+xfcaIpPD3lWs8I1OwHcpVgbay0Ik4JfCT75ZiPylKgA==", "dev": true, "engines": { "node": "^14.16.0 || >=16.0.0" } }, "node_modules/netlify-cli/node_modules/@netlify/build": { - "version": "29.51.3", - "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.51.3.tgz", - "integrity": "sha512-bHnQLeMv6yHsENU9HQw1JQ+I4RikgjIiqtWo5pPgLAt0ktm+UH+5eFrPZ61zdkSwqMWup06364+wUqTlj4q1hQ==", + "version": "29.53.0", + "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.53.0.tgz", + "integrity": "sha512-1/IfubZQIfal/HfpvmG9PIhfc+MuGvfMOcZHckOTZ35N8KJ2xmlTN0H/Bqf8OePwA1pn10s2kDdiXh4e9/MlHg==", "dev": true, "dependencies": { "@bugsnag/js": "^7.0.0", "@netlify/blobs": "^7.4.0", - "@netlify/cache-utils": "^5.1.5", - "@netlify/config": "^20.17.1", - "@netlify/edge-bundler": "12.2.2", + "@netlify/cache-utils": "^5.1.6", + "@netlify/config": "^20.18.0", + "@netlify/edge-bundler": "12.2.3", "@netlify/framework-info": "^9.8.13", - "@netlify/functions-utils": "^5.2.75", + "@netlify/functions-utils": "^5.2.77", "@netlify/git-utils": "^5.1.1", "@netlify/opentelemetry-utils": "^1.2.1", "@netlify/plugins-list": "^6.80.0", "@netlify/run-utils": "^5.1.1", - "@netlify/zip-it-and-ship-it": "9.37.7", + "@netlify/zip-it-and-ship-it": "9.37.9", "@sindresorhus/slugify": "^2.0.0", "ansi-escapes": "^6.0.0", "chalk": "^5.0.0", @@ -8597,6 +8597,15 @@ "node": ">= 14" } }, + "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/@netlify/blobs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-7.4.0.tgz", + "integrity": "sha512-7rdPzo8bggt3D2CVO+U1rmEtxxs8X7cLusDbHZRJaMlxqxBD05mXgThj5DUJMFOvmfVjhEH/S/3AyiLUbDQGDg==", + "dev": true, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, "node_modules/netlify-cli/node_modules/@netlify/build/node_modules/ansi-escapes": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", @@ -8931,9 +8940,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/cache-utils": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.5.tgz", - "integrity": "sha512-lMNdFmy2Yu3oVquSPooRDLxJ8QOsIX6X6vzA2pKz/9V2LQFJiqBukggXM+Rnqzk1regPpdJ0jK3dPGvOKaRQgg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@netlify/cache-utils/-/cache-utils-5.1.6.tgz", + "integrity": "sha512-0K1+5umxENy9H3CC+v5qGQbeTmKv/PBAhOxPKK6GPykOVa7OxT26KGMU7Jozo6pVNeLPJUvCCMw48ycwtQ1fvw==", "dev": true, "dependencies": { "cpy": "^9.0.0", @@ -8990,9 +8999,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/config": { - "version": "20.17.1", - "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.17.1.tgz", - "integrity": "sha512-uZuEYooSWVnyx54AdLwPd7mgHy/PrWjHvPy5AO0ApPYsokNVceuk7NX6xqkD0CuGwcc5K9oRQx91XDWQoWd2zQ==", + "version": "20.18.0", + "resolved": "https://registry.npmjs.org/@netlify/config/-/config-20.18.0.tgz", + "integrity": "sha512-sP10JJ73MELqzm4SLGjIDabwy2iRhieDXtgmVRpA/8nkndo5MpN9jqEkBP9ocPezjngvrk+YeUIYjndBCS0Wzg==", "dev": true, "dependencies": { "@iarna/toml": "^2.2.5", @@ -9260,9 +9269,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler": { - "version": "12.2.2", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.2.2.tgz", - "integrity": "sha512-esaM7H/lViceghUR84ZTuNk3VkeVNy2BaCeV+/nWHFOXbEpMmlNML31hJswk79QRztV2XO1oLWu8PxtmURd7DA==", + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-12.2.3.tgz", + "integrity": "sha512-o/Od4gvGT2qPSjJ1TSh8KYDJHfzxW4iemA5DiZtXIDgaIvWgvehZKDROp9wJ2FseP2F83y4ZDmt5xFfBSD9IYQ==", "dev": true, "dependencies": { "@import-maps/resolve": "^1.0.1", @@ -9662,15 +9671,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/ajv": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", - "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -9747,6 +9756,12 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, "node_modules/netlify-cli/node_modules/@netlify/edge-bundler/node_modules/find-up": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", @@ -10039,12 +10054,12 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/functions-utils": { - "version": "5.2.75", - "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.75.tgz", - "integrity": "sha512-KTNEJhRvjNCz9I0IKgmr6WyFuHWlbFGg5BgV35b0qDhcpMVwIr+jTTykb5wuc2153++tLCpxTwYXNx2Uz73P8g==", + "version": "5.2.77", + "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.77.tgz", + "integrity": "sha512-JmcfFwWskyQWYNV3aGISkAgRm4ggCWdOpLmc2BxJX+T6tf8i19wC5ZlyX3l16yH0c/dAXWOakEoKZsLJ4MbJZQ==", "dev": true, "dependencies": { - "@netlify/zip-it-and-ship-it": "9.37.7", + "@netlify/zip-it-and-ship-it": "9.37.9", "cpy": "^9.0.0", "path-exists": "^5.0.0" }, @@ -10534,15 +10549,15 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it": { - "version": "9.37.7", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.7.tgz", - "integrity": "sha512-d6PLXNFSjV5Q+maUMpyJeDybS1r8b6c7/qrIFPDpDioLnyxU97ur2gQ2cxn5WrlY0gfzLInRR7ipAa7MXdT3BQ==", + "version": "9.37.9", + "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.37.9.tgz", + "integrity": "sha512-pRrxQ8KBxV6qgR2Qg3QVHy39FGg/1u1hsxiXNpZMzq0DF8/XglT4G/4jL0FRlmleV4djWyUsR2V93RsbTlxy8w==", "dev": true, "dependencies": { "@babel/parser": "^7.22.5", - "@babel/types": "7.24.8", + "@babel/types": "7.25.2", "@netlify/binary-info": "^1.0.0", - "@netlify/serverless-functions-api": "^1.20.0", + "@netlify/serverless-functions-api": "^1.22.0", "@vercel/nft": "^0.27.1", "archiver": "^7.0.0", "common-path-prefix": "^3.0.0", @@ -10582,9 +10597,9 @@ } }, "node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/node_modules/@netlify/serverless-functions-api": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.20.0.tgz", - "integrity": "sha512-MsPw/753mUWCWYuaBvL6dkMa5uAh6o5hOSdjN16IhVuAQMrLLgZweSI9q2TW+C8QnQEgdtb5TV7iL8xAuxGsdA==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.22.0.tgz", + "integrity": "sha512-vv8fWCOIadSvdmR+8UYopdyHO/gOysl+8IBOxUUB0B3y7nnLOiBniE1JBeBR3y7gI/q/cnibBF2RhR3W04Wo/A==", "dev": true, "dependencies": { "@netlify/node-cookies": "^0.1.0", @@ -12900,12 +12915,12 @@ } }, "node_modules/netlify-cli/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -14231,9 +14246,9 @@ } }, "node_modules/netlify-cli/node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -15696,9 +15711,9 @@ "dev": true }, "node_modules/netlify-cli/node_modules/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==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -17848,15 +17863,15 @@ } }, "node_modules/netlify-cli/node_modules/listr2": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.3.tgz", - "integrity": "sha512-Lllokma2mtoniUOS94CcOErHWAug5iu7HOmDrvWgpw8jyQH2fomgB+7lZS4HWZxytUuQwkGOwe49FvwVaA85Xw==", + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.4.tgz", + "integrity": "sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", - "log-update": "^6.0.0", + "log-update": "^6.1.0", "rfdc": "^1.4.1", "wrap-ansi": "^9.0.0" }, @@ -17864,6 +17879,21 @@ "node": ">=18.0.0" } }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/listr2/node_modules/emoji-regex": { "version": "10.3.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", @@ -17876,10 +17906,103 @@ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "dev": true }, - "node_modules/netlify-cli/node_modules/listr2/node_modules/string-width": { + "node_modules/netlify-cli/node_modules/listr2/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/slice-ansi": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", - "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/netlify-cli/node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, "dependencies": { "emoji-regex": "^10.3.0", @@ -18574,6 +18697,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/netlify-cli/node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/netlify-cli/node_modules/mimic-response": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", @@ -26423,13 +26558,13 @@ } }, "node_modules/playwright": { - "version": "1.45.3", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.3.tgz", - "integrity": "sha512-QhVaS+lpluxCaioejDZ95l4Y4jSFCsBvl2UZkpeXlzxmqS+aABr5c82YmfMHrL6x27nvrvykJAFpkzT2eWdJww==", + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.0.tgz", + "integrity": "sha512-XYJ5WvfefWONh1uPAUAi0H2xXV5S3vrtcnXe6uAOgdGi3aSpqOSXX08IAjXW34xitfuOJsvXU5anXZxPSEQiJw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.45.3" + "playwright-core": "1.46.0" }, "bin": { "playwright": "cli.js" @@ -26442,9 +26577,9 @@ } }, "node_modules/playwright-core": { - "version": "1.45.3", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.3.tgz", - "integrity": "sha512-+ym0jNbcjikaOwwSZycFbwkWgfruWvYlJfThKYAlImbxUgdWFO2oW70ojPm4OpE4t6TAo2FY/smM+hpVTtkhDA==", + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.0.tgz", + "integrity": "sha512-9Y/d5UIwuJk8t3+lhmMSAJyNP1BUC/DqP3cQJDQQL/oWqAiuPTLgy7Q5dzglmTLwcBRdetzgNM/gni7ckfTr6A==", "dev": true, "license": "Apache-2.0", "bin": { @@ -29147,9 +29282,9 @@ } }, "node_modules/vite-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.4.tgz", - "integrity": "sha512-ZpJVkxcakYtig5iakNeL7N3trufe3M6vGuzYAr4GsbCTwobDeyPJpE4cjDhhPluv8OvQCFzu2LWp6GkoKRITXA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.5.tgz", + "integrity": "sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==", "dev": true, "license": "MIT", "dependencies": { @@ -29183,19 +29318,19 @@ } }, "node_modules/vitest": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.4.tgz", - "integrity": "sha512-luNLDpfsnxw5QSW4bISPe6tkxVvv5wn2BBs/PuDRkhXZ319doZyLOBr1sjfB5yCEpTiU7xCAdViM8TNVGPwoog==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.5.tgz", + "integrity": "sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.3.0", - "@vitest/expect": "2.0.4", - "@vitest/pretty-format": "^2.0.4", - "@vitest/runner": "2.0.4", - "@vitest/snapshot": "2.0.4", - "@vitest/spy": "2.0.4", - "@vitest/utils": "2.0.4", + "@vitest/expect": "2.0.5", + "@vitest/pretty-format": "^2.0.5", + "@vitest/runner": "2.0.5", + "@vitest/snapshot": "2.0.5", + "@vitest/spy": "2.0.5", + "@vitest/utils": "2.0.5", "chai": "^5.1.1", "debug": "^4.3.5", "execa": "^8.0.1", @@ -29206,7 +29341,7 @@ "tinypool": "^1.0.0", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.0.4", + "vite-node": "2.0.5", "why-is-node-running": "^2.3.0" }, "bin": { @@ -29221,8 +29356,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.0.4", - "@vitest/ui": "2.0.4", + "@vitest/browser": "2.0.5", + "@vitest/ui": "2.0.5", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index 8bd8eb5..219f046 100644 --- a/package.json +++ b/package.json @@ -33,16 +33,16 @@ "typescript": "5.3.3" }, "devDependencies": { - "@playwright/test": "1.45.3", + "@playwright/test": "1.46.0", "@technologiestiftung/semantic-release-config": "1.2.4", "@testing-library/react": "16.0.0", "@types/lodash.debounce": "4.0.9", - "@types/node": "20.14.13", + "@types/node": "20.14.15", "jsdom": "24.1.1", "mkdirp": "3.0.1", - "netlify-cli": "17.33.4", + "netlify-cli": "17.34.0", "shx": "0.3.4", - "vitest": "2.0.4" + "vitest": "2.0.5" }, "prettier": { "tabWidth": 2, From 30132ea201b3d110c6358bec17de3554c3559342 Mon Sep 17 00:00:00 2001 From: ff6347 Date: Sun, 25 Aug 2024 14:59:14 +0200 Subject: [PATCH 25/26] feat(iframe origin): Take origin from URL --- src/lib/iframe-source.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/iframe-source.ts b/src/lib/iframe-source.ts index c6d02f4..c56e75e 100644 --- a/src/lib/iframe-source.ts +++ b/src/lib/iframe-source.ts @@ -1,10 +1,10 @@ -export function iframeSource(code: string) { +export function iframeSource(code: string, baseUrl: string) { return /* html */ ` - +